/* Generated by Cython 3.0.6 */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ #if defined(CYTHON_LIMITED_API) && 0 #ifndef Py_LIMITED_API #if CYTHON_LIMITED_API+0 > 0x03030000 #define Py_LIMITED_API CYTHON_LIMITED_API #else #define Py_LIMITED_API 0x03030000 #endif #endif #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.7+ or Python 3.3+. #else #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API #define __PYX_EXTRA_ABI_MODULE_NAME "limited" #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif #define CYTHON_ABI "3_0_6" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." #define CYTHON_HEX_VERSION 0x030006F0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #define HAVE_LONG_LONG #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX #if defined(GRAALVM_PYTHON) /* For very preliminary testing purposes. Most variables are set the same as PyPy. The existence of this section does not imply that anything works or is even tested */ #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(PYPY_VERSION) #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(CYTHON_LIMITED_API) #ifdef Py_LIMITED_API #undef __PYX_LIMITED_VERSION_HEX #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API #endif #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #endif #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 1 #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #ifndef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_GIL #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #if PY_VERSION_HEX < 0x030400a1 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #elif !defined(CYTHON_USE_TP_FINALIZE) #define CYTHON_USE_TP_FINALIZE 1 #endif #if PY_VERSION_HEX < 0x030600B1 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX < 0x030700A3 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif !defined(CYTHON_USE_EXC_INFO_STACK) #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if !defined(CYTHON_VECTORCALL) #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) #endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS #if PY_MAJOR_VERSION < 3 #include "longintrepr.h" #endif #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED #if defined(__cplusplus) /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(maybe_unused) #define CYTHON_UNUSED [[maybe_unused]] #endif #endif #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_UNUSED_VAR( const T& ) { } # else # define CYTHON_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #ifndef CYTHON_USE_CPP_STD_MOVE #if defined(__cplusplus) && (\ __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) #define CYTHON_USE_CPP_STD_MOVE 1 #else #define CYTHON_USE_CPP_STD_MOVE 0 #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; #endif #endif #if _MSC_VER < 1300 #ifdef _WIN64 typedef unsigned long long __pyx_uintptr_t; #else typedef unsigned int __pyx_uintptr_t; #endif #else #ifdef _WIN64 typedef unsigned __int64 __pyx_uintptr_t; #else typedef unsigned __int32 __pyx_uintptr_t; #endif #endif #else #include typedef uintptr_t __pyx_uintptr_t; #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) #else #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) #endif #if CYTHON_COMPILING_IN_PYPY == 1 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) #else #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_DefaultClassType PyClass_Type #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 PyObject *version_info; // borrowed PyObject *py_minor_version = NULL; #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 minor_version = 11; // we don't yet need to distinguish between versions > 11 #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; minor_version = PyLong_AsLong(py_minor_version); Py_DECREF(py_minor_version); if (minor_version == -1 && PyErr_Occurred()) goto end; #endif if (!(types_module = PyImport_ImportModule("types"))) goto end; if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; if (minor_version <= 7) { (void)p; result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else if (minor_version <= 10) { result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else { if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } end: Py_XDECREF(code_type); Py_XDECREF(exception_table); Py_XDECREF(types_module); if (type) { PyErr_Restore(type, value, traceback); } return result; } #ifndef CO_OPTIMIZED #define CO_OPTIMIZED 0x0001 #endif #ifndef CO_NEWLOCALS #define CO_NEWLOCALS 0x0002 #endif #ifndef CO_VARARGS #define CO_VARARGS 0x0004 #endif #ifndef CO_VARKEYWORDS #define CO_VARKEYWORDS 0x0008 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x0200 #endif #ifndef CO_GENERATOR #define CO_GENERATOR 0x0020 #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x0080 #endif #elif PY_VERSION_HEX >= 0x030B0000 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); // we don't have access to __pyx_empty_bytes here if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 PyUnstable_Code_NewWithPosOnlyArgs #else PyCode_NewWithPosOnlyArgs #endif (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); Py_DECREF(empty_bytes); return result; } #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif #endif #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) #else #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) #define __Pyx_Py_Is(x, y) Py_Is(x, y) #else #define __Pyx_Py_Is(x, y) ((x) == (y)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) #else #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) #else #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) #else #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) #endif #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) #else #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x80 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x200 #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef Py_TPFLAGS_SEQUENCE #define Py_TPFLAGS_SEQUENCE 0 #endif #ifndef Py_TPFLAGS_MAPPING #define Py_TPFLAGS_MAPPING 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #define __Pyx_PyCFunctionFast _PyCFunctionFast #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #if CYTHON_METH_FASTCALL #define __Pyx_METH_FASTCALL METH_FASTCALL #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords #else #define __Pyx_METH_FASTCALL METH_VARARGS #define __Pyx_PyCFunction_FastCall PyCFunction #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords #endif #if CYTHON_VECTORCALL #define __pyx_vectorcallfunc vectorcallfunc #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) #elif CYTHON_BACKPORT_VECTORCALL typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames); #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) #else #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif #if PY_MAJOR_VERSION >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) #endif #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) #elif !CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; } #endif static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #if CYTHON_COMPILING_IN_LIMITED_API return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; #else return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) #if __PYX_LIMITED_VERSION_HEX < 0x030900B1 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) #define __Pyx_PyCMethod PyCMethod #endif #ifndef METH_METHOD #define METH_METHOD 0x200 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyThreadState_Current PyThreadState_Get() #elif !CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); if (!result) Py_FatalError("Couldn't find the module state"); return result; } #endif #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) #else #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif #if PY_MAJOR_VERSION < 3 #if CYTHON_COMPILING_IN_PYPY #if PYPY_VERSION_NUM < 0x07030600 #if defined(__cplusplus) && __cplusplus >= 201402L [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] #elif defined(__GNUC__) || defined(__clang__) __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) #elif defined(_MSC_VER) __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) #endif static CYTHON_INLINE int PyGILState_Check(void) { return 0; } #else // PYPY_VERSION_NUM < 0x07030600 #endif // PYPY_VERSION_NUM < 0x07030600 #else static CYTHON_INLINE int PyGILState_Check(void) { PyThreadState * tstate = _PyThreadState_Current; return tstate && (tstate == PyGILState_GetThisThreadState()); } #endif #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { #if CYTHON_COMPILING_IN_PYPY return PyDict_GetItem(dict, name); #else PyDictEntry *ep; PyDictObject *mp = (PyDictObject*) dict; long hash = ((PyStringObject *) name)->ob_shash; assert(hash != -1); ep = (mp->ma_lookup)(mp, name, hash); if (ep == NULL) { return NULL; } return ep->me_value; #endif } #define __Pyx_PyDict_GetItemStr PyDict_GetItem #endif #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) #else #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ PyObject_GC_Del(obj);\ Py_DECREF(type);\ } #else #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) #else #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) #undef PyUnicode_Contains #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif #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)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #ifndef PyObject_Unicode #define PyObject_Unicode PyObject_Str #endif #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) #else #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) #endif #if PY_VERSION_HEX >= 0x030900A4 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) #else #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) #else #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #endif #if PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { PyObject *module = PyImport_AddModule(name); Py_XINCREF(module); return module; } #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define __Pyx_Py3Int_Check(op) PyLong_Check(op) #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #else #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) #if !defined(_USE_MATH_DEFINES) #define _USE_MATH_DEFINES #endif #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_MARK_ERR_POS(f_index, lineno) \ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } #ifdef CYTHON_EXTERN_C #undef __PYX_EXTERN_C #define __PYX_EXTERN_C CYTHON_EXTERN_C #elif defined(__PYX_EXTERN_C) #ifdef _MSC_VER #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") #else #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. #endif #else #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__petsc4py__PETSc #define __PYX_HAVE_API__petsc4py__PETSc /* Early includes */ #include #include "lib-petsc/compat.h" #include "lib-petsc/custom.h" /* Silence Clang warnings in Cython-generated C code */ #if defined(__clang__) #pragma clang diagnostic ignored "-Wextra-semi-stmt" #pragma clang diagnostic ignored "-Wparentheses-equality" #pragma clang diagnostic ignored "-Wunreachable-code-fallthrough" #pragma clang diagnostic ignored "-Woverlength-strings" #pragma clang diagnostic ignored "-Wunreachable-code" #pragma clang diagnostic ignored "-Wundef" #elif defined(__GNUC__) || defined(__GNUG__) #pragma GCC diagnostic ignored "-Wstrict-aliasing" #pragma GCC diagnostic ignored "-Wtype-limits" #endif #include #include #include #include #include "cython.h" #include #include #include #include #include "lib-petsc/initpkg.h" #include "pythread.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const wchar_t *u) { const wchar_t *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #else static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #endif #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK #define _PyLong_SIGN_MASK 3 #endif #ifndef _PyLong_NON_SIZE_BITS #define _PyLong_NON_SIZE_BITS 3 #endif #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_SignedDigitCount(x)\ ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) #else #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; #else // Py < 3.12 #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) #define __Pyx_PyLong_CompactValue(x)\ ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) typedef sdigit __Pyx_compact_pylong; typedef digit __Pyx_compact_upylong; #endif #if PY_VERSION_HEX >= 0x030C00A5 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) #else #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII #include static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = (char) c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #include static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { "petsc4py/PETSc/Const.pyx", "petsc4py/PETSc/Error.pyx", "petsc4py/PETSc/Device.pyx", "petsc4py/PETSc/petscdef.pxi", "petsc4py/PETSc/petscopt.pxi", "petsc4py/PETSc/petscdevice.pxi", "petsc4py/PETSc/petscis.pxi", "petsc4py/PETSc/petscvec.pxi", "petsc4py/PETSc/petscmat.pxi", "petsc4py/PETSc/petscpc.pxi", "petsc4py/PETSc/petscdmda.pxi", "petsc4py/PETSc/libpetsc4py.pyx", "petsc4py/PETSc/PETSc.pyx", "", "petsc4py/PETSc.pyx", "petsc4py/PETSc/arraynpy.pxi", "petsc4py/PETSc/dlpack.pxi", "petsc4py/PETSc/petscmpi.pxi", "petsc4py/PETSc/petscsys.pxi", "petsc4py/PETSc/petsclog.pxi", "petsc4py/PETSc/petscobj.pxi", "petsc4py/PETSc/petscvwr.pxi", "petsc4py/PETSc/petscksp.pxi", "petsc4py/PETSc/petscsnes.pxi", "petsc4py/PETSc/petscts.pxi", "petsc4py/PETSc/petsctao.pxi", "petsc4py/PETSc/petscdm.pxi", "petsc4py/PETSc/petscdmstag.pxi", "petsc4py/PETSc/petscdmcomposite.pxi", "petsc4py/PETSc/petscdmshell.pxi", "petsc4py/PETSc/petscpyappctx.pxi", "petsc4py/PETSc/Options.pyx", "petsc4py/PETSc/Sys.pyx", "petsc4py/PETSc/Log.pyx", "petsc4py/PETSc/Comm.pyx", "petsc4py/PETSc/Object.pyx", "petsc4py/PETSc/cyclicgc.pxi", "petsc4py/PETSc/Viewer.pyx", "petsc4py/PETSc/Random.pyx", "petsc4py/PETSc/IS.pyx", "petsc4py/PETSc/SF.pyx", "petsc4py/PETSc/Vec.pyx", "petsc4py/PETSc/DT.pyx", "petsc4py/PETSc/FE.pyx", "petsc4py/PETSc/Scatter.pyx", "petsc4py/PETSc/Section.pyx", "petsc4py/PETSc/Mat.pyx", "petsc4py/PETSc/MatPartitioning.pyx", "petsc4py/PETSc/PC.pyx", "petsc4py/PETSc/KSP.pyx", "petsc4py/PETSc/SNES.pyx", "petsc4py/PETSc/TS.pyx", "petsc4py/PETSc/TAO.pyx", "petsc4py/PETSc/AO.pyx", "petsc4py/PETSc/DM.pyx", "petsc4py/PETSc/DS.pyx", "petsc4py/PETSc/DMDA.pyx", "petsc4py/PETSc/DMPlex.pyx", "petsc4py/PETSc/DMStag.pyx", "petsc4py/PETSc/DMComposite.pyx", "petsc4py/PETSc/DMShell.pyx", "petsc4py/PETSc/DMLabel.pyx", "petsc4py/PETSc/DMSwarm.pyx", "petsc4py/PETSc/Partitioner.pyx", "petsc4py/PETSc/Space.pyx", "petsc4py/PETSc/DMUtils.pyx", "petsc4py/PETSc/CAPI.pyx", }; /* #### Code section: utility_code_proto_before_types ### */ /* ForceInitThreads.proto */ #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif /* NoFastGil.proto */ #define __Pyx_PyGILState_Ensure PyGILState_Ensure #define __Pyx_PyGILState_Release PyGILState_Release #define __Pyx_FastGIL_Remember() #define __Pyx_FastGIL_Forget() #define __Pyx_FastGilFuncInit() /* BufferFormatStructs.proto */ struct __Pyx_StructField_; #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0) typedef struct { const char* name; struct __Pyx_StructField_* fields; size_t size; size_t arraysize[8]; int ndim; char typegroup; char is_unsigned; int flags; } __Pyx_TypeInfo; typedef struct __Pyx_StructField_ { __Pyx_TypeInfo* type; const char* name; size_t offset; } __Pyx_StructField; typedef struct { __Pyx_StructField* field; size_t parent_offset; } __Pyx_BufFmt_StackElem; typedef struct { __Pyx_StructField root; __Pyx_BufFmt_StackElem* head; size_t fmt_offset; size_t new_count, enc_count; size_t struct_alignment; int is_complex; char enc_type; char new_packmode; char enc_packmode; char is_valid_array; } __Pyx_BufFmt_Context; /* Atomics.proto */ #include #ifndef CYTHON_ATOMICS #define CYTHON_ATOMICS 1 #endif #define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS #define __pyx_atomic_int_type int #define __pyx_nonatomic_int_type int #if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\ (__STDC_VERSION__ >= 201112L) &&\ !defined(__STDC_NO_ATOMICS__)) #include #elif CYTHON_ATOMICS && (defined(__cplusplus) && (\ (__cplusplus >= 201103L) ||\ (defined(_MSC_VER) && _MSC_VER >= 1700))) #include #endif #if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\ (__STDC_VERSION__ >= 201112L) &&\ !defined(__STDC_NO_ATOMICS__) &&\ ATOMIC_INT_LOCK_FREE == 2) #undef __pyx_atomic_int_type #define __pyx_atomic_int_type atomic_int #define __pyx_atomic_incr_aligned(value) atomic_fetch_add_explicit(value, 1, memory_order_relaxed) #define __pyx_atomic_decr_aligned(value) atomic_fetch_sub_explicit(value, 1, memory_order_acq_rel) #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER) #pragma message ("Using standard C atomics") #elif defined(__PYX_DEBUG_ATOMICS) #warning "Using standard C atomics" #endif #elif CYTHON_ATOMICS && (defined(__cplusplus) && (\ (__cplusplus >= 201103L) ||\ \ (defined(_MSC_VER) && _MSC_VER >= 1700)) &&\ ATOMIC_INT_LOCK_FREE == 2) #undef __pyx_atomic_int_type #define __pyx_atomic_int_type std::atomic_int #define __pyx_atomic_incr_aligned(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_relaxed) #define __pyx_atomic_decr_aligned(value) std::atomic_fetch_sub_explicit(value, 1, std::memory_order_acq_rel) #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER) #pragma message ("Using standard C++ atomics") #elif defined(__PYX_DEBUG_ATOMICS) #warning "Using standard C++ atomics" #endif #elif CYTHON_ATOMICS && (__GNUC__ >= 5 || (__GNUC__ == 4 &&\ (__GNUC_MINOR__ > 1 ||\ (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2)))) #define __pyx_atomic_incr_aligned(value) __sync_fetch_and_add(value, 1) #define __pyx_atomic_decr_aligned(value) __sync_fetch_and_sub(value, 1) #ifdef __PYX_DEBUG_ATOMICS #warning "Using GNU atomics" #endif #elif CYTHON_ATOMICS && defined(_MSC_VER) #include #undef __pyx_atomic_int_type #define __pyx_atomic_int_type long #undef __pyx_nonatomic_int_type #define __pyx_nonatomic_int_type long #pragma intrinsic (_InterlockedExchangeAdd) #define __pyx_atomic_incr_aligned(value) _InterlockedExchangeAdd(value, 1) #define __pyx_atomic_decr_aligned(value) _InterlockedExchangeAdd(value, -1) #ifdef __PYX_DEBUG_ATOMICS #pragma message ("Using MSVC atomics") #endif #else #undef CYTHON_ATOMICS #define CYTHON_ATOMICS 0 #ifdef __PYX_DEBUG_ATOMICS #warning "Not using atomics" #endif #endif #if CYTHON_ATOMICS #define __pyx_add_acquisition_count(memview)\ __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview)) #define __pyx_sub_acquisition_count(memview)\ __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview)) #else #define __pyx_add_acquisition_count(memview)\ __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock) #define __pyx_sub_acquisition_count(memview)\ __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock) #endif /* MemviewSliceStruct.proto */ struct __pyx_memoryview_obj; typedef struct { struct __pyx_memoryview_obj *memview; char *data; Py_ssize_t shape[8]; Py_ssize_t strides[8]; Py_ssize_t suboffsets[8]; } __Pyx_memviewslice; #define __Pyx_MemoryView_Len(m) (m.shape[0]) /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ /* #### Code section: type_declarations ### */ /*--- Type declarations ---*/ struct PyPetscCommObject; struct PyPetscObjectObject; struct PyPetscViewerObject; struct PyPetscRandomObject; struct PyPetscDeviceObject; struct PyPetscDeviceContextObject; struct PyPetscISObject; struct PyPetscLGMapObject; struct PyPetscSFObject; struct PyPetscVecObject; struct PyPetscSpaceObject; struct PyPetscDualSpaceObject; struct PyPetscFEObject; struct PyPetscQuadObject; struct PyPetscScatterObject; struct PyPetscSectionObject; struct PyPetscMatObject; struct PyPetscMatPartitioningObject; struct PyPetscNullSpaceObject; struct PyPetscPCObject; struct PyPetscKSPObject; struct PyPetscSNESObject; struct PyPetscTSObject; struct PyPetscTAOObject; struct PyPetscTAOLineSearchObject; struct PyPetscAOObject; struct PyPetscDMObject; struct PyPetscDMPlexTransformObject; struct PyPetscDSObject; struct PyPetscPartitionerObject; struct PyPetscDMLabelObject; struct __pyx_obj_8petsc4py_5PETSc__IS_buffer; struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer; struct __pyx_obj_8petsc4py_5PETSc__Vec_LocalForm; struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array; struct __pyx_obj_8petsc4py_5PETSc__DMComposite_access; struct __pyx_obj_8petsc4py_5PETSc_Options; struct __pyx_obj_8petsc4py_5PETSc_Sys; struct __pyx_obj_8petsc4py_5PETSc_Log; struct __pyx_obj_8petsc4py_5PETSc_LogStage; struct __pyx_obj_8petsc4py_5PETSc_LogClass; struct __pyx_obj_8petsc4py_5PETSc_LogEvent; struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5; struct __pyx_obj_8petsc4py_5PETSc_MatStencil; struct __pyx_obj_8petsc4py_5PETSc_DMDA; struct __pyx_obj_8petsc4py_5PETSc_DMPlex; struct __pyx_obj_8petsc4py_5PETSc_DMStag; struct __pyx_obj_8petsc4py_5PETSc_DMComposite; struct __pyx_obj_8petsc4py_5PETSc_DMShell; struct __pyx_obj_8petsc4py_5PETSc_DMSwarm; struct __pyx_obj_8petsc4py_5PETSc_DMInterpolation; struct __pyx_obj_8petsc4py_5PETSc__PyObj; struct __pyx_obj_8petsc4py_5PETSc__PyMat; struct __pyx_obj_8petsc4py_5PETSc__PyPC; struct __pyx_obj_8petsc4py_5PETSc__PyKSP; struct __pyx_obj_8petsc4py_5PETSc__PySNES; struct __pyx_obj_8petsc4py_5PETSc__PyTS; struct __pyx_obj_8petsc4py_5PETSc__PyTao; struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator; struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct_1_decorator; struct __pyx_array_obj; struct __pyx_MemviewEnum_obj; struct __pyx_memoryview_obj; struct __pyx_memoryviewslice_obj; struct __pyx_t_8petsc4py_5PETSc_DLDataType; struct __pyx_t_8petsc4py_5PETSc_DLContext; typedef struct __pyx_t_8petsc4py_5PETSc_DLContext __pyx_t_8petsc4py_5PETSc_DLContext; struct __pyx_t_8petsc4py_5PETSc_DLTensor; struct __pyx_t_8petsc4py_5PETSc_DLManagedTensor; struct __pyx_opt_args_8petsc4py_5PETSc_getprefix; /* "petsc4py/PETSc/dlpack.pxi":24 * uint16_t lanes * * cdef enum PetscDLDeviceType: # <<<<<<<<<<<<<< * kDLCPU = 1 * kDLCUDA = 2 */ enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType { /* "petsc4py/PETSc/dlpack.pxi":35 * kDLROCMHost = 11 * #kDLExtDev = 12 * kDLCUDAManaged = 13 # <<<<<<<<<<<<<< * #kDLOneAPI = 14 * */ __pyx_e_8petsc4py_5PETSc_kDLCPU = ((unsigned int)1), __pyx_e_8petsc4py_5PETSc_kDLCUDA = ((unsigned int)2), __pyx_e_8petsc4py_5PETSc_kDLCUDAHost = ((unsigned int)3), __pyx_e_8petsc4py_5PETSc_kDLROCM = ((unsigned int)10), __pyx_e_8petsc4py_5PETSc_kDLROCMHost = ((unsigned int)11), __pyx_e_8petsc4py_5PETSc_kDLCUDAManaged = ((unsigned int)13) }; /* "petsc4py/PETSc/dlpack.pxi":42 * int device_id * * cdef enum DLDataTypeCode: # <<<<<<<<<<<<<< * kDLInt = 0 * kDLUInt = 1 */ enum __pyx_t_8petsc4py_5PETSc_DLDataTypeCode { /* "petsc4py/PETSc/dlpack.pxi":45 * kDLInt = 0 * kDLUInt = 1 * kDLFloat = 2 # <<<<<<<<<<<<<< * * cdef struct DLTensor: */ __pyx_e_8petsc4py_5PETSc_kDLInt = ((unsigned int)0), __pyx_e_8petsc4py_5PETSc_kDLUInt = ((unsigned int)1), __pyx_e_8petsc4py_5PETSc_kDLFloat = ((unsigned int)2) }; /* "petsc4py/PETSc/petscopt.pxi":103 * * * cdef enum PetscOptType: # <<<<<<<<<<<<<< * OPT_BOOL * OPT_INT */ enum __pyx_t_8petsc4py_5PETSc_PetscOptType { __pyx_e_8petsc4py_5PETSc_OPT_BOOL, __pyx_e_8petsc4py_5PETSc_OPT_INT, __pyx_e_8petsc4py_5PETSc_OPT_REAL, __pyx_e_8petsc4py_5PETSc_OPT_SCALAR, __pyx_e_8petsc4py_5PETSc_OPT_STRING }; /* "petsc4py/PETSc/dlpack.pxi":19 * void* malloc(size_t size) * * cdef struct DLDataType: # <<<<<<<<<<<<<< * uint8_t code * uint8_t bits */ struct __pyx_t_8petsc4py_5PETSc_DLDataType { uint8_t code; uint8_t bits; uint16_t lanes; }; /* "petsc4py/PETSc/dlpack.pxi":38 * #kDLOneAPI = 14 * * ctypedef struct DLContext: # <<<<<<<<<<<<<< * PetscDLDeviceType device_type * int device_id */ struct __pyx_t_8petsc4py_5PETSc_DLContext { enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType device_type; int device_id; }; /* "petsc4py/PETSc/dlpack.pxi":47 * kDLFloat = 2 * * cdef struct DLTensor: # <<<<<<<<<<<<<< * void* data * DLContext ctx */ struct __pyx_t_8petsc4py_5PETSc_DLTensor { void *data; __pyx_t_8petsc4py_5PETSc_DLContext ctx; int ndim; struct __pyx_t_8petsc4py_5PETSc_DLDataType dtype; int64_t *shape; int64_t *strides; uint64_t byte_offset; }; /* "petsc4py/PETSc/dlpack.pxi":56 * uint64_t byte_offset * * ctypedef int (*dlpack_manager_del_obj)(void*) noexcept nogil # <<<<<<<<<<<<<< * * cdef struct DLManagedTensor: */ typedef int (*__pyx_t_8petsc4py_5PETSc_dlpack_manager_del_obj)(void *); /* "petsc4py/PETSc/dlpack.pxi":58 * ctypedef int (*dlpack_manager_del_obj)(void*) noexcept nogil * * cdef struct DLManagedTensor: # <<<<<<<<<<<<<< * DLTensor dl_tensor * void* manager_ctx */ struct __pyx_t_8petsc4py_5PETSc_DLManagedTensor { struct __pyx_t_8petsc4py_5PETSc_DLTensor dl_tensor; void *manager_ctx; void (*manager_deleter)(struct __pyx_t_8petsc4py_5PETSc_DLManagedTensor *); __pyx_t_8petsc4py_5PETSc_dlpack_manager_del_obj del_obj; }; /* "petsc4py/PETSc/petscopt.pxi":38 * # * * cdef getprefix(prefix, deft=None): # <<<<<<<<<<<<<< * if prefix is None: * prefix = deft */ struct __pyx_opt_args_8petsc4py_5PETSc_getprefix { int __pyx_n; PyObject *deft; }; /* "petsc4py/PETSc/petscmpi.pxi":39 * void *Cython_ImportFunction(object, char[], char[]) except? NULL * * ctypedef MPI_Comm* PyMPICommGet(object) except NULL # <<<<<<<<<<<<<< * ctypedef object PyMPICommNew(MPI_Comm) * ctypedef MPI_Datatype* PyMPIDatatypeGet(object) except NULL */ typedef MPI_Comm *__pyx_t_8petsc4py_5PETSc_PyMPICommGet(PyObject *); /* "petsc4py/PETSc/petscmpi.pxi":40 * * ctypedef MPI_Comm* PyMPICommGet(object) except NULL * ctypedef object PyMPICommNew(MPI_Comm) # <<<<<<<<<<<<<< * ctypedef MPI_Datatype* PyMPIDatatypeGet(object) except NULL * ctypedef MPI_Op* PyMPIOpGet(object) except NULL */ typedef PyObject *__pyx_t_8petsc4py_5PETSc_PyMPICommNew(MPI_Comm); /* "petsc4py/PETSc/petscmpi.pxi":41 * ctypedef MPI_Comm* PyMPICommGet(object) except NULL * ctypedef object PyMPICommNew(MPI_Comm) * ctypedef MPI_Datatype* PyMPIDatatypeGet(object) except NULL # <<<<<<<<<<<<<< * ctypedef MPI_Op* PyMPIOpGet(object) except NULL * */ typedef MPI_Datatype *__pyx_t_8petsc4py_5PETSc_PyMPIDatatypeGet(PyObject *); /* "petsc4py/PETSc/petscmpi.pxi":42 * ctypedef object PyMPICommNew(MPI_Comm) * ctypedef MPI_Datatype* PyMPIDatatypeGet(object) except NULL * ctypedef MPI_Op* PyMPIOpGet(object) except NULL # <<<<<<<<<<<<<< * * cdef inline MPI_Comm mpi4py_Comm_Get( */ typedef MPI_Op *__pyx_t_8petsc4py_5PETSc_PyMPIOpGet(PyObject *); /* "petsc4py/PETSc/petscvec.pxi":350 * # -------------------------------------------------------------------- * * ctypedef PetscErrorCode VecSetValuesFcn(PetscVec, # <<<<<<<<<<<<<< * PetscInt,const PetscInt*, * const PetscScalar*,PetscInsertMode) */ typedef PetscErrorCode __pyx_t_8petsc4py_5PETSc_VecSetValuesFcn(Vec, PetscInt, PetscInt const *, PetscScalar const *, InsertMode); /* "petsc4py/PETSc/petscmat.pxi":876 * # ----------------------------------------------------------------------------- * * ctypedef PetscErrorCode MatSetValuesFcn(PetscMat, # <<<<<<<<<<<<<< * PetscInt,const PetscInt*, * PetscInt,const PetscInt*, */ typedef PetscErrorCode __pyx_t_8petsc4py_5PETSc_MatSetValuesFcn(Mat, PetscInt, PetscInt const *, PetscInt, PetscInt const *, PetscScalar const *, InsertMode); /* "petsc4py/PETSc/petscdmshell.pxi":1 * ctypedef PetscErrorCode (*PetscDMShellXToYFunction)(PetscDM, # <<<<<<<<<<<<<< * PetscVec, * PetscInsertMode, */ typedef PetscErrorCode (*__pyx_t_8petsc4py_5PETSc_PetscDMShellXToYFunction)(DM, Vec, InsertMode, Vec); /* "petsc4py/PETSc.pxd":112 * # -------------------------------------------------------------------- * * ctypedef public api class Comm [ # <<<<<<<<<<<<<< * type PyPetscComm_Type, * object PyPetscCommObject, */ struct PyPetscCommObject { PyObject_HEAD MPI_Comm comm; int isdup; PyObject *base; }; typedef struct PyPetscCommObject PyPetscCommObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscComm_Type; /* "petsc4py/PETSc.pxd":120 * cdef object base * * ctypedef public api class Object [ # <<<<<<<<<<<<<< * type PyPetscObject_Type, * object PyPetscObjectObject, */ struct PyPetscObjectObject { PyObject_HEAD struct __pyx_vtabstruct_8petsc4py_5PETSc_Object *__pyx_vtab; PyObject *__weakref__; PyObject *__pyx___dummy__; PetscObject oval; PetscObject *obj; }; typedef struct PyPetscObjectObject PyPetscObjectObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscObject_Type; /* "petsc4py/PETSc.pxd":132 * cdef object get_dict(self) * * ctypedef public api class Viewer(Object) [ # <<<<<<<<<<<<<< * type PyPetscViewer_Type, * object PyPetscViewerObject, */ struct PyPetscViewerObject { struct PyPetscObjectObject __pyx_base; PetscViewer vwr; }; typedef struct PyPetscViewerObject PyPetscViewerObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscViewer_Type; /* "petsc4py/PETSc.pxd":138 * cdef PetscViewer vwr * * ctypedef public api class Random(Object) [ # <<<<<<<<<<<<<< * type PyPetscRandom_Type, * object PyPetscRandomObject, */ struct PyPetscRandomObject { struct PyPetscObjectObject __pyx_base; PetscRandom rnd; }; typedef struct PyPetscRandomObject PyPetscRandomObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscRandom_Type; /* "petsc4py/PETSc.pxd":144 * cdef PetscRandom rnd * * ctypedef public api class Device [ # <<<<<<<<<<<<<< * type PyPetscDevice_Type, * object PyPetscDeviceObject, */ struct PyPetscDeviceObject { PyObject_HEAD PetscDevice device; PyObject *__weakref__; }; typedef struct PyPetscDeviceObject PyPetscDeviceObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscDevice_Type; /* "petsc4py/PETSc.pxd":151 * cdef object __weakref__ * * ctypedef public api class DeviceContext(Object) [ # <<<<<<<<<<<<<< * type PyPetscDeviceContext_Type, * object PyPetscDeviceContextObject, */ struct PyPetscDeviceContextObject { struct PyPetscObjectObject __pyx_base; PetscDeviceContext dctx; }; typedef struct PyPetscDeviceContextObject PyPetscDeviceContextObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscDeviceContext_Type; /* "petsc4py/PETSc.pxd":157 * cdef PetscDeviceContext dctx * * ctypedef public api class IS(Object) [ # <<<<<<<<<<<<<< * type PyPetscIS_Type, * object PyPetscISObject, */ struct PyPetscISObject { struct PyPetscObjectObject __pyx_base; IS iset; }; typedef struct PyPetscISObject PyPetscISObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscIS_Type; /* "petsc4py/PETSc.pxd":163 * cdef PetscIS iset * * ctypedef public api class LGMap(Object) [ # <<<<<<<<<<<<<< * type PyPetscLGMap_Type, * object PyPetscLGMapObject, */ struct PyPetscLGMapObject { struct PyPetscObjectObject __pyx_base; ISLocalToGlobalMapping lgm; }; typedef struct PyPetscLGMapObject PyPetscLGMapObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscLGMap_Type; /* "petsc4py/PETSc.pxd":169 * cdef PetscLGMap lgm * * ctypedef public api class SF(Object) [ # <<<<<<<<<<<<<< * type PyPetscSF_Type, * object PyPetscSFObject, */ struct PyPetscSFObject { struct PyPetscObjectObject __pyx_base; PetscSF sf; }; typedef struct PyPetscSFObject PyPetscSFObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscSF_Type; /* "petsc4py/PETSc.pxd":175 * cdef PetscSF sf * * ctypedef public api class Vec(Object) [ # <<<<<<<<<<<<<< * type PyPetscVec_Type, * object PyPetscVecObject, */ struct PyPetscVecObject { struct PyPetscObjectObject __pyx_base; Vec vec; }; typedef struct PyPetscVecObject PyPetscVecObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscVec_Type; /* "petsc4py/PETSc.pxd":181 * cdef PetscVec vec * * ctypedef public api class Space(Object) [ # <<<<<<<<<<<<<< * type PyPetscSpace_Type, * object PyPetscSpaceObject, */ struct PyPetscSpaceObject { struct PyPetscObjectObject __pyx_base; PetscSpace space; }; typedef struct PyPetscSpaceObject PyPetscSpaceObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscSpace_Type; /* "petsc4py/PETSc.pxd":187 * cdef PetscSpace space * * ctypedef public api class DualSpace(Object) [ # <<<<<<<<<<<<<< * type PyPetscDualSpace_Type, * object PyPetscDualSpaceObject, */ struct PyPetscDualSpaceObject { struct PyPetscObjectObject __pyx_base; PetscDualSpace dualspace; }; typedef struct PyPetscDualSpaceObject PyPetscDualSpaceObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscDualSpace_Type; /* "petsc4py/PETSc.pxd":193 * cdef PetscDualSpace dualspace * * ctypedef public api class FE(Object) [ # <<<<<<<<<<<<<< * type PyPetscFE_Type, * object PyPetscFEObject, */ struct PyPetscFEObject { struct PyPetscObjectObject __pyx_base; PetscFE fe; }; typedef struct PyPetscFEObject PyPetscFEObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscFE_Type; /* "petsc4py/PETSc.pxd":199 * cdef PetscFE fe * * ctypedef public api class Quad(Object) [ # <<<<<<<<<<<<<< * type PyPetscQuad_Type, * object PyPetscQuadObject, */ struct PyPetscQuadObject { struct PyPetscObjectObject __pyx_base; PetscQuadrature quad; }; typedef struct PyPetscQuadObject PyPetscQuadObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscQuad_Type; /* "petsc4py/PETSc.pxd":205 * cdef PetscQuadrature quad * * ctypedef public api class Scatter(Object) [ # <<<<<<<<<<<<<< * type PyPetscScatter_Type, * object PyPetscScatterObject, */ struct PyPetscScatterObject { struct PyPetscObjectObject __pyx_base; VecScatter sct; }; typedef struct PyPetscScatterObject PyPetscScatterObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscScatter_Type; /* "petsc4py/PETSc.pxd":211 * cdef PetscScatter sct * * ctypedef public api class Section(Object) [ # <<<<<<<<<<<<<< * type PyPetscSection_Type, * object PyPetscSectionObject, */ struct PyPetscSectionObject { struct PyPetscObjectObject __pyx_base; PetscSection sec; }; typedef struct PyPetscSectionObject PyPetscSectionObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscSection_Type; /* "petsc4py/PETSc.pxd":217 * cdef PetscSection sec * * ctypedef public api class Mat(Object) [ # <<<<<<<<<<<<<< * type PyPetscMat_Type, * object PyPetscMatObject, */ struct PyPetscMatObject { struct PyPetscObjectObject __pyx_base; Mat mat; }; typedef struct PyPetscMatObject PyPetscMatObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscMat_Type; /* "petsc4py/PETSc.pxd":223 * cdef PetscMat mat * * ctypedef public api class MatPartitioning(Object) [ # <<<<<<<<<<<<<< * type PyPetscMatPartitioning_Type, * object PyPetscMatPartitioningObject, */ struct PyPetscMatPartitioningObject { struct PyPetscObjectObject __pyx_base; MatPartitioning part; }; typedef struct PyPetscMatPartitioningObject PyPetscMatPartitioningObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscMatPartitioning_Type; /* "petsc4py/PETSc.pxd":229 * cdef PetscMatPartitioning part * * ctypedef public api class NullSpace(Object) [ # <<<<<<<<<<<<<< * type PyPetscNullSpace_Type, * object PyPetscNullSpaceObject, */ struct PyPetscNullSpaceObject { struct PyPetscObjectObject __pyx_base; MatNullSpace nsp; }; typedef struct PyPetscNullSpaceObject PyPetscNullSpaceObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscNullSpace_Type; /* "petsc4py/PETSc.pxd":235 * cdef PetscNullSpace nsp * * ctypedef public api class PC(Object) [ # <<<<<<<<<<<<<< * type PyPetscPC_Type, * object PyPetscPCObject, */ struct PyPetscPCObject { struct PyPetscObjectObject __pyx_base; PC pc; }; typedef struct PyPetscPCObject PyPetscPCObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscPC_Type; /* "petsc4py/PETSc.pxd":241 * cdef PetscPC pc * * ctypedef public api class KSP(Object) [ # <<<<<<<<<<<<<< * type PyPetscKSP_Type, * object PyPetscKSPObject, */ struct PyPetscKSPObject { struct PyPetscObjectObject __pyx_base; KSP ksp; }; typedef struct PyPetscKSPObject PyPetscKSPObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscKSP_Type; /* "petsc4py/PETSc.pxd":247 * cdef PetscKSP ksp * * ctypedef public api class SNES(Object) [ # <<<<<<<<<<<<<< * type PyPetscSNES_Type, * object PyPetscSNESObject, */ struct PyPetscSNESObject { struct PyPetscObjectObject __pyx_base; SNES snes; }; typedef struct PyPetscSNESObject PyPetscSNESObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscSNES_Type; /* "petsc4py/PETSc.pxd":253 * cdef PetscSNES snes * * ctypedef public api class TS(Object) [ # <<<<<<<<<<<<<< * type PyPetscTS_Type, * object PyPetscTSObject, */ struct PyPetscTSObject { struct PyPetscObjectObject __pyx_base; TS ts; }; typedef struct PyPetscTSObject PyPetscTSObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscTS_Type; /* "petsc4py/PETSc.pxd":259 * cdef PetscTS ts * * ctypedef public api class TAO(Object) [ # <<<<<<<<<<<<<< * type PyPetscTAO_Type, * object PyPetscTAOObject, */ struct PyPetscTAOObject { struct PyPetscObjectObject __pyx_base; Tao tao; }; typedef struct PyPetscTAOObject PyPetscTAOObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscTAO_Type; /* "petsc4py/PETSc.pxd":265 * cdef PetscTAO tao * * ctypedef public api class TAOLineSearch(Object) [ # <<<<<<<<<<<<<< * type PyPetscTAOLineSearch_Type, * object PyPetscTAOLineSearchObject, */ struct PyPetscTAOLineSearchObject { struct PyPetscObjectObject __pyx_base; TaoLineSearch taols; }; typedef struct PyPetscTAOLineSearchObject PyPetscTAOLineSearchObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscTAOLineSearch_Type; /* "petsc4py/PETSc.pxd":272 * * * ctypedef public api class AO(Object) [ # <<<<<<<<<<<<<< * type PyPetscAO_Type, * object PyPetscAOObject, */ struct PyPetscAOObject { struct PyPetscObjectObject __pyx_base; AO ao; }; typedef struct PyPetscAOObject PyPetscAOObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscAO_Type; /* "petsc4py/PETSc.pxd":278 * cdef PetscAO ao * * ctypedef public api class DM(Object) [ # <<<<<<<<<<<<<< * type PyPetscDM_Type, * object PyPetscDMObject, */ struct PyPetscDMObject { struct PyPetscObjectObject __pyx_base; DM dm; }; typedef struct PyPetscDMObject PyPetscDMObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscDM_Type; /* "petsc4py/PETSc.pxd":284 * cdef PetscDM dm * * ctypedef public api class DMPlexTransform(Object) [ # <<<<<<<<<<<<<< * type PyPetscDMPlexTransform_Type, * object PyPetscDMPlexTransformObject, */ struct PyPetscDMPlexTransformObject { struct PyPetscObjectObject __pyx_base; DMPlexTransform tr; }; typedef struct PyPetscDMPlexTransformObject PyPetscDMPlexTransformObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscDMPlexTransform_Type; /* "petsc4py/PETSc.pxd":290 * cdef PetscDMPlexTransform tr * * ctypedef public api class DS(Object) [ # <<<<<<<<<<<<<< * type PyPetscDS_Type, * object PyPetscDSObject, */ struct PyPetscDSObject { struct PyPetscObjectObject __pyx_base; PetscDS ds; }; typedef struct PyPetscDSObject PyPetscDSObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscDS_Type; /* "petsc4py/PETSc.pxd":296 * cdef PetscDS ds * * ctypedef public api class Partitioner(Object) [ # <<<<<<<<<<<<<< * type PyPetscPartitioner_Type, * object PyPetscPartitionerObject, */ struct PyPetscPartitionerObject { struct PyPetscObjectObject __pyx_base; PetscPartitioner part; }; typedef struct PyPetscPartitionerObject PyPetscPartitionerObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscPartitioner_Type; /* "petsc4py/PETSc.pxd":302 * cdef PetscPartitioner part * * ctypedef public api class DMLabel(Object) [ # <<<<<<<<<<<<<< * type PyPetscDMLabel_Type, * object PyPetscDMLabelObject, */ struct PyPetscDMLabelObject { struct PyPetscObjectObject __pyx_base; DMLabel dmlabel; }; typedef struct PyPetscDMLabelObject PyPetscDMLabelObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscDMLabel_Type; /* "petsc4py/PETSc/petscis.pxi":111 * # -------------------------------------------------------------------- * * cdef class _IS_buffer: # <<<<<<<<<<<<<< * * cdef PetscIS iset */ struct __pyx_obj_8petsc4py_5PETSc__IS_buffer { PyObject_HEAD struct __pyx_vtabstruct_8petsc4py_5PETSc__IS_buffer *__pyx_vtab; IS iset; PetscInt size; PetscInt const *data; int hasarray; }; /* "petsc4py/PETSc/petscvec.pxi":499 * return 0 * * cdef class _Vec_buffer: # <<<<<<<<<<<<<< * * cdef PetscVec vec */ struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer { PyObject_HEAD struct __pyx_vtabstruct_8petsc4py_5PETSc__Vec_buffer *__pyx_vtab; Vec vec; PetscInt size; PetscScalar *data; int readonly; int hasarray; }; /* "petsc4py/PETSc/petscvec.pxi":619 * # -------------------------------------------------------------------- * * cdef class _Vec_LocalForm: # <<<<<<<<<<<<<< * * "Context manager for `Vec` local form" */ struct __pyx_obj_8petsc4py_5PETSc__Vec_LocalForm { PyObject_HEAD struct PyPetscVecObject *gvec; struct PyPetscVecObject *lvec; }; /* "petsc4py/PETSc/petscdmda.pxi":198 * # -------------------------------------------------------------------- * * cdef class _DMDA_Vec_array(object): # <<<<<<<<<<<<<< * * cdef _Vec_buffer vecbuf */ struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array { PyObject_HEAD struct __pyx_vtabstruct_8petsc4py_5PETSc__DMDA_Vec_array *__pyx_vtab; struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *vecbuf; PyObject *starts; PyObject *sizes; PyObject *shape; PyObject *strides; PyArrayObject *array; }; /* "petsc4py/PETSc/petscdmcomposite.pxi":17 * PetscErrorCode DMCompositeGetISLocalToGlobalMappings(PetscDM,PetscLGMap**) * * cdef class _DMComposite_access: # <<<<<<<<<<<<<< * cdef PetscDM dm * cdef PetscVec gvec */ struct __pyx_obj_8petsc4py_5PETSc__DMComposite_access { PyObject_HEAD DM dm; Vec gvec; PetscInt nlocs; PetscInt *locs; Vec *vecs; PyObject *locs_mem; PyObject *vecs_mem; PyObject *access; }; /* "petsc4py/PETSc/Options.pyx":3 * # -------------------------------------------------------------------- * * cdef class Options: # <<<<<<<<<<<<<< * * cdef PetscOptions opt */ struct __pyx_obj_8petsc4py_5PETSc_Options { PyObject_HEAD PetscOptions opt; PyObject *_prefix; }; /* "petsc4py/PETSc/Sys.pyx":3 * # ------------------------------------------------------------------------------ * * cdef class Sys: # <<<<<<<<<<<<<< * * """System utilities.""" */ struct __pyx_obj_8petsc4py_5PETSc_Sys { PyObject_HEAD }; /* "petsc4py/PETSc/Log.pyx":8 * # -------------------------------------------------------------------- * * cdef class Log: # <<<<<<<<<<<<<< * """Logging support.""" * */ struct __pyx_obj_8petsc4py_5PETSc_Log { PyObject_HEAD }; /* "petsc4py/PETSc/Log.pyx":210 * # -------------------------------------------------------------------- * * cdef class LogStage: # <<<<<<<<<<<<<< * """Logging support for different stages.""" * */ struct __pyx_obj_8petsc4py_5PETSc_LogStage { PyObject_HEAD PetscLogStage id; }; /* "petsc4py/PETSc/Log.pyx":384 * # -------------------------------------------------------------------- * * cdef class LogClass: # <<<<<<<<<<<<<< * * cdef readonly PetscLogClass id */ struct __pyx_obj_8petsc4py_5PETSc_LogClass { PyObject_HEAD PetscClassId id; }; /* "petsc4py/PETSc/Log.pyx":446 * # -------------------------------------------------------------------- * * cdef class LogEvent: # <<<<<<<<<<<<<< * * cdef readonly PetscLogEvent id */ struct __pyx_obj_8petsc4py_5PETSc_LogEvent { PyObject_HEAD PetscLogEvent id; }; /* "petsc4py/PETSc/Viewer.pyx":906 * # -------------------------------------------------------------------- * * cdef class ViewerHDF5(Viewer): # <<<<<<<<<<<<<< * * def create(self, name, mode=None, comm=None): */ struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 { struct PyPetscViewerObject __pyx_base; }; /* "petsc4py/PETSc/Mat.pyx":269 * * @cython.internal * cdef class MatStencil: # <<<<<<<<<<<<<< * """Associate structured grid coordinates with matrix indices. * */ struct __pyx_obj_8petsc4py_5PETSc_MatStencil { PyObject_HEAD MatStencil stencil; }; /* "petsc4py/PETSc/DMDA.pyx":17 * # -------------------------------------------------------------------- * * cdef class DMDA(DM): # <<<<<<<<<<<<<< * """A DM object that is used to manage data for a structured grid.""" * */ struct __pyx_obj_8petsc4py_5PETSc_DMDA { struct PyPetscDMObject __pyx_base; }; /* "petsc4py/PETSc/DMPlex.pyx":10 * # -------------------------------------------------------------------- * * cdef class DMPlex(DM): # <<<<<<<<<<<<<< * """Encapsulate an unstructured mesh. * */ struct __pyx_obj_8petsc4py_5PETSc_DMPlex { struct PyPetscDMObject __pyx_base; }; /* "petsc4py/PETSc/DMStag.pyx":40 * # -------------------------------------------------------------------- * * cdef class DMStag(DM): # <<<<<<<<<<<<<< * """A DM object representing a "staggered grid" or a structured cell complex.""" * */ struct __pyx_obj_8petsc4py_5PETSc_DMStag { struct PyPetscDMObject __pyx_base; }; /* "petsc4py/PETSc/DMComposite.pyx":3 * # -------------------------------------------------------------------- * * cdef class DMComposite(DM): # <<<<<<<<<<<<<< * """A DM object that is used to manage data for a collection of DMs.""" * */ struct __pyx_obj_8petsc4py_5PETSc_DMComposite { struct PyPetscDMObject __pyx_base; }; /* "petsc4py/PETSc/DMShell.pyx":1 * cdef class DMShell(DM): # <<<<<<<<<<<<<< * """A shell DM object, used to manage user-defined problem data.""" * */ struct __pyx_obj_8petsc4py_5PETSc_DMShell { struct PyPetscDMObject __pyx_base; }; /* "petsc4py/PETSc/DMSwarm.pyx":25 * * * cdef class DMSwarm(DM): # <<<<<<<<<<<<<< * """A `DM` object used to represent arrays of data (fields) of arbitrary type.""" * Type = DMSwarmType */ struct __pyx_obj_8petsc4py_5PETSc_DMSwarm { struct PyPetscDMObject __pyx_base; }; /* "petsc4py/PETSc/DMUtils.pyx":2 * * cdef class DMInterpolation: # <<<<<<<<<<<<<< * """Interpolation on a mesh.""" * */ struct __pyx_obj_8petsc4py_5PETSc_DMInterpolation { PyObject_HEAD DMInterpolationInfo dminterp; }; /* "petsc4py/PETSc/libpetsc4py.pyx":172 * * @cython.internal * cdef class _PyObj: # <<<<<<<<<<<<<< * * cdef object self */ struct __pyx_obj_8petsc4py_5PETSc__PyObj { PyObject_HEAD struct __pyx_vtabstruct_8petsc4py_5PETSc__PyObj *__pyx_vtab; PyObject *self; PyObject *name; }; /* "petsc4py/PETSc/libpetsc4py.pyx":343 * * @cython.internal * cdef class _PyMat(_PyObj): pass # <<<<<<<<<<<<<< * cdef inline _PyMat PyMat(PetscMat mat): * if mat != NULL and mat.data != NULL: */ struct __pyx_obj_8petsc4py_5PETSc__PyMat { struct __pyx_obj_8petsc4py_5PETSc__PyObj __pyx_base; }; /* "petsc4py/PETSc/libpetsc4py.pyx":1252 * * @cython.internal * cdef class _PyPC(_PyObj): pass # <<<<<<<<<<<<<< * cdef inline _PyPC PyPC(PetscPC pc): * if pc != NULL and pc.data != NULL: */ struct __pyx_obj_8petsc4py_5PETSc__PyPC { struct __pyx_obj_8petsc4py_5PETSc__PyObj __pyx_base; }; /* "petsc4py/PETSc/libpetsc4py.pyx":1549 * * @cython.internal * cdef class _PyKSP(_PyObj): pass # <<<<<<<<<<<<<< * cdef inline _PyKSP PyKSP(PetscKSP ksp): * if ksp != NULL and ksp.data != NULL: */ struct __pyx_obj_8petsc4py_5PETSc__PyKSP { struct __pyx_obj_8petsc4py_5PETSc__PyObj __pyx_base; }; /* "petsc4py/PETSc/libpetsc4py.pyx":1910 * * @cython.internal * cdef class _PySNES(_PyObj): pass # <<<<<<<<<<<<<< * cdef inline _PySNES PySNES(PetscSNES snes): * if snes != NULL and snes.data != NULL: */ struct __pyx_obj_8petsc4py_5PETSc__PySNES { struct __pyx_obj_8petsc4py_5PETSc__PyObj __pyx_base; }; /* "petsc4py/PETSc/libpetsc4py.pyx":2259 * * @cython.internal * cdef class _PyTS(_PyObj): pass # <<<<<<<<<<<<<< * cdef inline _PyTS PyTS(PetscTS ts): * if ts != NULL and ts.data != NULL: */ struct __pyx_obj_8petsc4py_5PETSc__PyTS { struct __pyx_obj_8petsc4py_5PETSc__PyObj __pyx_base; }; /* "petsc4py/PETSc/libpetsc4py.pyx":2680 * * @cython.internal * cdef class _PyTao(_PyObj): pass # <<<<<<<<<<<<<< * cdef inline _PyTao PyTao(PetscTAO tao): * if tao != NULL and tao.data != NULL: */ struct __pyx_obj_8petsc4py_5PETSc__PyTao { struct __pyx_obj_8petsc4py_5PETSc__PyObj __pyx_base; }; /* "petsc4py/PETSc/Log.pyx":178 * return cputime * * @classmethod # <<<<<<<<<<<<<< * def EventDecorator(cls, name=None, klass=None): * """Decorate a function with a `PETSc` event.""" */ struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator { PyObject_HEAD PyTypeObject *__pyx_v_cls; PyObject *__pyx_v_klass; PyObject *__pyx_v_name; }; /* "petsc4py/PETSc/Log.pyx":181 * def EventDecorator(cls, name=None, klass=None): * """Decorate a function with a `PETSc` event.""" * def decorator(func): # <<<<<<<<<<<<<< * @functools.wraps(func) * def wrapped_func(*args, **kwargs): */ struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct_1_decorator { PyObject_HEAD struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator *__pyx_outer_scope; PyObject *__pyx_v_func; }; /* "View.MemoryView":114 * @cython.collection_type("sequence") * @cname("__pyx_array") * cdef class array: # <<<<<<<<<<<<<< * * cdef: */ struct __pyx_array_obj { PyObject_HEAD struct __pyx_vtabstruct_array *__pyx_vtab; char *data; Py_ssize_t len; char *format; int ndim; Py_ssize_t *_shape; Py_ssize_t *_strides; Py_ssize_t itemsize; PyObject *mode; PyObject *_format; void (*callback_free_data)(void *); int free_data; int dtype_is_object; }; /* "View.MemoryView":302 * * @cname('__pyx_MemviewEnum') * cdef class Enum(object): # <<<<<<<<<<<<<< * cdef object name * def __init__(self, name): */ struct __pyx_MemviewEnum_obj { PyObject_HEAD PyObject *name; }; /* "View.MemoryView":337 * * @cname('__pyx_memoryview') * cdef class memoryview: # <<<<<<<<<<<<<< * * cdef object obj */ struct __pyx_memoryview_obj { PyObject_HEAD struct __pyx_vtabstruct_memoryview *__pyx_vtab; PyObject *obj; PyObject *_size; PyObject *_array_interface; PyThread_type_lock lock; __pyx_atomic_int_type acquisition_count; Py_buffer view; int flags; int dtype_is_object; __Pyx_TypeInfo *typeinfo; }; /* "View.MemoryView":952 * @cython.collection_type("sequence") * @cname('__pyx_memoryviewslice') * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<< * "Internal class for passing memoryview slices to Python" * */ struct __pyx_memoryviewslice_obj { struct __pyx_memoryview_obj __pyx_base; __Pyx_memviewslice from_slice; PyObject *from_object; PyObject *(*to_object_func)(char *); int (*to_dtype_func)(char *, PyObject *); }; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscObject_Type; /* "petsc4py/PETSc/Object.pyx":3 * # -------------------------------------------------------------------- * * cdef class Object: # <<<<<<<<<<<<<< * * # --- special methods --- */ struct __pyx_vtabstruct_8petsc4py_5PETSc_Object { PyObject *(*get_attr)(struct PyPetscObjectObject *, char *); PyObject *(*set_attr)(struct PyPetscObjectObject *, char *, PyObject *); PyObject *(*get_dict)(struct PyPetscObjectObject *); }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_Object *__pyx_vtabptr_8petsc4py_5PETSc_Object; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscViewer_Type; /* "petsc4py/PETSc/Viewer.pyx":88 * # -------------------------------------------------------------------- * * cdef class Viewer(Object): # <<<<<<<<<<<<<< * """Viewer object. * */ struct __pyx_vtabstruct_8petsc4py_5PETSc_Viewer { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_Viewer *__pyx_vtabptr_8petsc4py_5PETSc_Viewer; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscRandom_Type; /* "petsc4py/PETSc/Random.pyx":13 * # -------------------------------------------------------------------- * * cdef class Random(Object): # <<<<<<<<<<<<<< * """The random number generator object. * */ struct __pyx_vtabstruct_8petsc4py_5PETSc_Random { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_Random *__pyx_vtabptr_8petsc4py_5PETSc_Random; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscDeviceContext_Type; /* "petsc4py/PETSc/Device.pyx":219 * # -------------------------------------------------------------------- * * cdef class DeviceContext(Object): # <<<<<<<<<<<<<< * """DeviceContext object. * */ struct __pyx_vtabstruct_8petsc4py_5PETSc_DeviceContext { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_DeviceContext *__pyx_vtabptr_8petsc4py_5PETSc_DeviceContext; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscIS_Type; /* "petsc4py/PETSc/IS.pyx":10 * # -------------------------------------------------------------------- * * cdef class IS(Object): # <<<<<<<<<<<<<< * """A collection of indices. * */ struct __pyx_vtabstruct_8petsc4py_5PETSc_IS { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_IS *__pyx_vtabptr_8petsc4py_5PETSc_IS; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscLGMap_Type; /* "petsc4py/PETSc/IS.pyx":1077 * # -------------------------------------------------------------------- * * cdef class LGMap(Object): # <<<<<<<<<<<<<< * """Mapping from an arbitrary local ordering from ``0`` to ``n-1`` to a global PETSc ordering used by a vector or matrix. * */ struct __pyx_vtabstruct_8petsc4py_5PETSc_LGMap { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_LGMap *__pyx_vtabptr_8petsc4py_5PETSc_LGMap; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscSF_Type; /* "petsc4py/PETSc/SF.pyx":15 * # -------------------------------------------------------------------- * * cdef class SF(Object): # <<<<<<<<<<<<<< * """Star Forest object for communication. * */ struct __pyx_vtabstruct_8petsc4py_5PETSc_SF { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_SF *__pyx_vtabptr_8petsc4py_5PETSc_SF; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscVec_Type; /* "petsc4py/PETSc/Vec.pyx":29 * * # -------------------------------------------------------------------- * cdef class Vec(Object): # <<<<<<<<<<<<<< * """A vector object. * */ struct __pyx_vtabstruct_8petsc4py_5PETSc_Vec { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_Vec *__pyx_vtabptr_8petsc4py_5PETSc_Vec; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscSpace_Type; /* "petsc4py/PETSc/Space.pyx":14 * # -------------------------------------------------------------------- * * cdef class Space(Object): # <<<<<<<<<<<<<< * """Linear space object.""" * Type = SpaceType */ struct __pyx_vtabstruct_8petsc4py_5PETSc_Space { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_Space *__pyx_vtabptr_8petsc4py_5PETSc_Space; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscDualSpace_Type; /* "petsc4py/PETSc/Space.pyx":560 * # -------------------------------------------------------------------- * * cdef class DualSpace(Object): # <<<<<<<<<<<<<< * """Dual space to a linear space.""" * */ struct __pyx_vtabstruct_8petsc4py_5PETSc_DualSpace { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_DualSpace *__pyx_vtabptr_8petsc4py_5PETSc_DualSpace; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscFE_Type; /* "petsc4py/PETSc/FE.pyx":10 * # -------------------------------------------------------------------- * * cdef class FE(Object): # <<<<<<<<<<<<<< * """A PETSc object that manages a finite element space.""" * */ struct __pyx_vtabstruct_8petsc4py_5PETSc_FE { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_FE *__pyx_vtabptr_8petsc4py_5PETSc_FE; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscQuad_Type; /* "petsc4py/PETSc/DT.pyx":3 * # -------------------------------------------------------------------- * * cdef class Quad(Object): # <<<<<<<<<<<<<< * """Quadrature rule for integration.""" * def __cinit__(self): */ struct __pyx_vtabstruct_8petsc4py_5PETSc_Quad { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_Quad *__pyx_vtabptr_8petsc4py_5PETSc_Quad; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscScatter_Type; /* "petsc4py/PETSc/Scatter.pyx":22 * # -------------------------------------------------------------------- * * cdef class Scatter(Object): # <<<<<<<<<<<<<< * """Scatter object. * */ struct __pyx_vtabstruct_8petsc4py_5PETSc_Scatter { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_Scatter *__pyx_vtabptr_8petsc4py_5PETSc_Scatter; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscSection_Type; /* "petsc4py/PETSc/Section.pyx":3 * # -------------------------------------------------------------------- * * cdef class Section(Object): # <<<<<<<<<<<<<< * """Mapping from integers in a range to unstructured set of integers.""" * */ struct __pyx_vtabstruct_8petsc4py_5PETSc_Section { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_Section *__pyx_vtabptr_8petsc4py_5PETSc_Section; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscMat_Type; /* "petsc4py/PETSc/Mat.pyx":329 * # -------------------------------------------------------------------- * * cdef class Mat(Object): # <<<<<<<<<<<<<< * """Matrix object. * */ struct __pyx_vtabstruct_8petsc4py_5PETSc_Mat { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_Mat *__pyx_vtabptr_8petsc4py_5PETSc_Mat; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscMatPartitioning_Type; /* "petsc4py/PETSc/MatPartitioning.pyx":15 * # -------------------------------------------------------------------- * * cdef class MatPartitioning(Object): # <<<<<<<<<<<<<< * """Object for managing the partitioning of a matrix or graph.""" * */ struct __pyx_vtabstruct_8petsc4py_5PETSc_MatPartitioning { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_MatPartitioning *__pyx_vtabptr_8petsc4py_5PETSc_MatPartitioning; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscNullSpace_Type; /* "petsc4py/PETSc/Mat.pyx":5605 * # -------------------------------------------------------------------- * * cdef class NullSpace(Object): # <<<<<<<<<<<<<< * """Nullspace object. * */ struct __pyx_vtabstruct_8petsc4py_5PETSc_NullSpace { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_NullSpace *__pyx_vtabptr_8petsc4py_5PETSc_NullSpace; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscPC_Type; /* "petsc4py/PETSc/PC.pyx":160 * # -------------------------------------------------------------------- * * cdef class PC(Object): # <<<<<<<<<<<<<< * """Preconditioners. * */ struct __pyx_vtabstruct_8petsc4py_5PETSc_PC { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_PC *__pyx_vtabptr_8petsc4py_5PETSc_PC; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscKSP_Type; /* "petsc4py/PETSc/KSP.pyx":369 * # -------------------------------------------------------------------- * * cdef class KSP(Object): # <<<<<<<<<<<<<< * """Abstract PETSc object that manages all Krylov methods. * */ struct __pyx_vtabstruct_8petsc4py_5PETSc_KSP { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_KSP *__pyx_vtabptr_8petsc4py_5PETSc_KSP; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscSNES_Type; /* "petsc4py/PETSc/SNES.pyx":87 * # -------------------------------------------------------------------- * * cdef class SNES(Object): # <<<<<<<<<<<<<< * """Nonlinear equations solver. * */ struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *__pyx_vtabptr_8petsc4py_5PETSc_SNES; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscTS_Type; /* "petsc4py/PETSc/TS.pyx":130 * # ----------------------------------------------------------------------------- * * cdef class TS(Object): # <<<<<<<<<<<<<< * """ODE integrator. * */ struct __pyx_vtabstruct_8petsc4py_5PETSc_TS { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *__pyx_vtabptr_8petsc4py_5PETSc_TS; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscTAO_Type; /* "petsc4py/PETSc/TAO.pyx":89 * # -------------------------------------------------------------------- * * cdef class TAO(Object): # <<<<<<<<<<<<<< * """Optimization solver. * */ struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *__pyx_vtabptr_8petsc4py_5PETSc_TAO; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscTAOLineSearch_Type; /* "petsc4py/PETSc/TAO.pyx":1905 * # -------------------------------------------------------------------- * * cdef class TAOLineSearch(Object): # <<<<<<<<<<<<<< * """TAO Line Search.""" * */ struct __pyx_vtabstruct_8petsc4py_5PETSc_TAOLineSearch { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_TAOLineSearch *__pyx_vtabptr_8petsc4py_5PETSc_TAOLineSearch; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscAO_Type; /* "petsc4py/PETSc/AO.pyx":11 * # -------------------------------------------------------------------- * * cdef class AO(Object): # <<<<<<<<<<<<<< * """Application ordering object.""" * Type = AOType */ struct __pyx_vtabstruct_8petsc4py_5PETSc_AO { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_AO *__pyx_vtabptr_8petsc4py_5PETSc_AO; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscDM_Type; /* "petsc4py/PETSc/DM.pyx":48 * # -------------------------------------------------------------------- * * cdef class DM(Object): # <<<<<<<<<<<<<< * """An object describing a computational grid or mesh. * */ struct __pyx_vtabstruct_8petsc4py_5PETSc_DM { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *__pyx_vtabptr_8petsc4py_5PETSc_DM; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscDMPlexTransform_Type; /* "petsc4py/PETSc/DMPlex.pyx":3295 * TRANSFORMFILTER = S_(DMPLEXTRANSFORMFILTER) * * cdef class DMPlexTransform(Object): # <<<<<<<<<<<<<< * * def __cinit__(self): */ struct __pyx_vtabstruct_8petsc4py_5PETSc_DMPlexTransform { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_DMPlexTransform *__pyx_vtabptr_8petsc4py_5PETSc_DMPlexTransform; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscDS_Type; /* "petsc4py/PETSc/DS.pyx":8 * # -------------------------------------------------------------------- * * cdef class DS(Object): # <<<<<<<<<<<<<< * """Discrete System object.""" * */ struct __pyx_vtabstruct_8petsc4py_5PETSc_DS { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_DS *__pyx_vtabptr_8petsc4py_5PETSc_DS; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscPartitioner_Type; /* "petsc4py/PETSc/Partitioner.pyx":14 * # -------------------------------------------------------------------- * * cdef class Partitioner(Object): # <<<<<<<<<<<<<< * """A graph partitioner.""" * */ struct __pyx_vtabstruct_8petsc4py_5PETSc_Partitioner { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_Partitioner *__pyx_vtabptr_8petsc4py_5PETSc_Partitioner; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscDMLabel_Type; /* "petsc4py/PETSc/DMLabel.pyx":2 * * cdef class DMLabel(Object): # <<<<<<<<<<<<<< * """An object representing a subset of mesh entities from a `DM`.""" * def __cinit__(self): */ struct __pyx_vtabstruct_8petsc4py_5PETSc_DMLabel { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_DMLabel *__pyx_vtabptr_8petsc4py_5PETSc_DMLabel; /* "petsc4py/PETSc/petscis.pxi":111 * # -------------------------------------------------------------------- * * cdef class _IS_buffer: # <<<<<<<<<<<<<< * * cdef PetscIS iset */ struct __pyx_vtabstruct_8petsc4py_5PETSc__IS_buffer { int (*acquire)(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *); int (*release)(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *); int (*acquirebuffer)(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *, Py_buffer *, int); int (*releasebuffer)(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *, Py_buffer *); PyObject *(*enter)(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *); PyObject *(*exit)(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *); Py_ssize_t (*getbuffer)(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *, void **); }; static struct __pyx_vtabstruct_8petsc4py_5PETSc__IS_buffer *__pyx_vtabptr_8petsc4py_5PETSc__IS_buffer; /* "petsc4py/PETSc/petscvec.pxi":499 * return 0 * * cdef class _Vec_buffer: # <<<<<<<<<<<<<< * * cdef PetscVec vec */ struct __pyx_vtabstruct_8petsc4py_5PETSc__Vec_buffer { int (*acquire)(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *); int (*release)(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *); int (*acquirebuffer)(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *, Py_buffer *, int); int (*releasebuffer)(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *, Py_buffer *); PyObject *(*enter)(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *); PyObject *(*exit)(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *); Py_ssize_t (*getbuffer)(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *, void **); }; static struct __pyx_vtabstruct_8petsc4py_5PETSc__Vec_buffer *__pyx_vtabptr_8petsc4py_5PETSc__Vec_buffer; /* "petsc4py/PETSc/petscdmda.pxi":198 * # -------------------------------------------------------------------- * * cdef class _DMDA_Vec_array(object): # <<<<<<<<<<<<<< * * cdef _Vec_buffer vecbuf */ struct __pyx_vtabstruct_8petsc4py_5PETSc__DMDA_Vec_array { int (*acquire)(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *); int (*release)(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *); }; static struct __pyx_vtabstruct_8petsc4py_5PETSc__DMDA_Vec_array *__pyx_vtabptr_8petsc4py_5PETSc__DMDA_Vec_array; /* "petsc4py/PETSc/Viewer.pyx":906 * # -------------------------------------------------------------------- * * cdef class ViewerHDF5(Viewer): # <<<<<<<<<<<<<< * * def create(self, name, mode=None, comm=None): */ struct __pyx_vtabstruct_8petsc4py_5PETSc_ViewerHDF5 { struct __pyx_vtabstruct_8petsc4py_5PETSc_Viewer __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_ViewerHDF5 *__pyx_vtabptr_8petsc4py_5PETSc_ViewerHDF5; /* "petsc4py/PETSc/DMDA.pyx":17 * # -------------------------------------------------------------------- * * cdef class DMDA(DM): # <<<<<<<<<<<<<< * """A DM object that is used to manage data for a structured grid.""" * */ struct __pyx_vtabstruct_8petsc4py_5PETSc_DMDA { struct __pyx_vtabstruct_8petsc4py_5PETSc_DM __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_DMDA *__pyx_vtabptr_8petsc4py_5PETSc_DMDA; /* "petsc4py/PETSc/DMPlex.pyx":10 * # -------------------------------------------------------------------- * * cdef class DMPlex(DM): # <<<<<<<<<<<<<< * """Encapsulate an unstructured mesh. * */ struct __pyx_vtabstruct_8petsc4py_5PETSc_DMPlex { struct __pyx_vtabstruct_8petsc4py_5PETSc_DM __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_DMPlex *__pyx_vtabptr_8petsc4py_5PETSc_DMPlex; /* "petsc4py/PETSc/DMStag.pyx":40 * # -------------------------------------------------------------------- * * cdef class DMStag(DM): # <<<<<<<<<<<<<< * """A DM object representing a "staggered grid" or a structured cell complex.""" * */ struct __pyx_vtabstruct_8petsc4py_5PETSc_DMStag { struct __pyx_vtabstruct_8petsc4py_5PETSc_DM __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_DMStag *__pyx_vtabptr_8petsc4py_5PETSc_DMStag; /* "petsc4py/PETSc/DMComposite.pyx":3 * # -------------------------------------------------------------------- * * cdef class DMComposite(DM): # <<<<<<<<<<<<<< * """A DM object that is used to manage data for a collection of DMs.""" * */ struct __pyx_vtabstruct_8petsc4py_5PETSc_DMComposite { struct __pyx_vtabstruct_8petsc4py_5PETSc_DM __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_DMComposite *__pyx_vtabptr_8petsc4py_5PETSc_DMComposite; /* "petsc4py/PETSc/DMShell.pyx":1 * cdef class DMShell(DM): # <<<<<<<<<<<<<< * """A shell DM object, used to manage user-defined problem data.""" * */ struct __pyx_vtabstruct_8petsc4py_5PETSc_DMShell { struct __pyx_vtabstruct_8petsc4py_5PETSc_DM __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_DMShell *__pyx_vtabptr_8petsc4py_5PETSc_DMShell; /* "petsc4py/PETSc/DMSwarm.pyx":25 * * * cdef class DMSwarm(DM): # <<<<<<<<<<<<<< * """A `DM` object used to represent arrays of data (fields) of arbitrary type.""" * Type = DMSwarmType */ struct __pyx_vtabstruct_8petsc4py_5PETSc_DMSwarm { struct __pyx_vtabstruct_8petsc4py_5PETSc_DM __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_DMSwarm *__pyx_vtabptr_8petsc4py_5PETSc_DMSwarm; /* "petsc4py/PETSc/libpetsc4py.pyx":172 * * @cython.internal * cdef class _PyObj: # <<<<<<<<<<<<<< * * cdef object self */ struct __pyx_vtabstruct_8petsc4py_5PETSc__PyObj { int (*setcontext)(struct __pyx_obj_8petsc4py_5PETSc__PyObj *, void *, struct PyPetscObjectObject *); int (*getcontext)(struct __pyx_obj_8petsc4py_5PETSc__PyObj *, void **); int (*setname)(struct __pyx_obj_8petsc4py_5PETSc__PyObj *, char *); char *(*getname)(struct __pyx_obj_8petsc4py_5PETSc__PyObj *); }; static struct __pyx_vtabstruct_8petsc4py_5PETSc__PyObj *__pyx_vtabptr_8petsc4py_5PETSc__PyObj; /* "petsc4py/PETSc/libpetsc4py.pyx":343 * * @cython.internal * cdef class _PyMat(_PyObj): pass # <<<<<<<<<<<<<< * cdef inline _PyMat PyMat(PetscMat mat): * if mat != NULL and mat.data != NULL: */ struct __pyx_vtabstruct_8petsc4py_5PETSc__PyMat { struct __pyx_vtabstruct_8petsc4py_5PETSc__PyObj __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc__PyMat *__pyx_vtabptr_8petsc4py_5PETSc__PyMat; /* "petsc4py/PETSc/libpetsc4py.pyx":1252 * * @cython.internal * cdef class _PyPC(_PyObj): pass # <<<<<<<<<<<<<< * cdef inline _PyPC PyPC(PetscPC pc): * if pc != NULL and pc.data != NULL: */ struct __pyx_vtabstruct_8petsc4py_5PETSc__PyPC { struct __pyx_vtabstruct_8petsc4py_5PETSc__PyObj __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc__PyPC *__pyx_vtabptr_8petsc4py_5PETSc__PyPC; /* "petsc4py/PETSc/libpetsc4py.pyx":1549 * * @cython.internal * cdef class _PyKSP(_PyObj): pass # <<<<<<<<<<<<<< * cdef inline _PyKSP PyKSP(PetscKSP ksp): * if ksp != NULL and ksp.data != NULL: */ struct __pyx_vtabstruct_8petsc4py_5PETSc__PyKSP { struct __pyx_vtabstruct_8petsc4py_5PETSc__PyObj __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc__PyKSP *__pyx_vtabptr_8petsc4py_5PETSc__PyKSP; /* "petsc4py/PETSc/libpetsc4py.pyx":1910 * * @cython.internal * cdef class _PySNES(_PyObj): pass # <<<<<<<<<<<<<< * cdef inline _PySNES PySNES(PetscSNES snes): * if snes != NULL and snes.data != NULL: */ struct __pyx_vtabstruct_8petsc4py_5PETSc__PySNES { struct __pyx_vtabstruct_8petsc4py_5PETSc__PyObj __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc__PySNES *__pyx_vtabptr_8petsc4py_5PETSc__PySNES; /* "petsc4py/PETSc/libpetsc4py.pyx":2259 * * @cython.internal * cdef class _PyTS(_PyObj): pass # <<<<<<<<<<<<<< * cdef inline _PyTS PyTS(PetscTS ts): * if ts != NULL and ts.data != NULL: */ struct __pyx_vtabstruct_8petsc4py_5PETSc__PyTS { struct __pyx_vtabstruct_8petsc4py_5PETSc__PyObj __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc__PyTS *__pyx_vtabptr_8petsc4py_5PETSc__PyTS; /* "petsc4py/PETSc/libpetsc4py.pyx":2680 * * @cython.internal * cdef class _PyTao(_PyObj): pass # <<<<<<<<<<<<<< * cdef inline _PyTao PyTao(PetscTAO tao): * if tao != NULL and tao.data != NULL: */ struct __pyx_vtabstruct_8petsc4py_5PETSc__PyTao { struct __pyx_vtabstruct_8petsc4py_5PETSc__PyObj __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc__PyTao *__pyx_vtabptr_8petsc4py_5PETSc__PyTao; /* "View.MemoryView":114 * @cython.collection_type("sequence") * @cname("__pyx_array") * cdef class array: # <<<<<<<<<<<<<< * * cdef: */ struct __pyx_vtabstruct_array { PyObject *(*get_memview)(struct __pyx_array_obj *); }; static struct __pyx_vtabstruct_array *__pyx_vtabptr_array; /* "View.MemoryView":337 * * @cname('__pyx_memoryview') * cdef class memoryview: # <<<<<<<<<<<<<< * * cdef object obj */ struct __pyx_vtabstruct_memoryview { char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *); PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *); PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *); PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *); PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *); PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *); PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *); PyObject *(*_get_base)(struct __pyx_memoryview_obj *); }; static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview; /* "View.MemoryView":952 * @cython.collection_type("sequence") * @cname('__pyx_memoryviewslice') * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<< * "Internal class for passing memoryview slices to Python" * */ struct __pyx_vtabstruct__memoryviewslice { struct __pyx_vtabstruct_memoryview __pyx_base; }; static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice; /* #### Code section: utility_code_proto ### */ /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, Py_ssize_t); void (*DECREF)(void*, PyObject*, Py_ssize_t); void (*GOTREF)(void*, PyObject*, Py_ssize_t); void (*GIVEREF)(void*, PyObject*, Py_ssize_t); void* (*SetupContext)(const char*, Py_ssize_t, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ } #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() #endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContextNogil() #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_Py_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; Py_XDECREF(tmp);\ } while (0) #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #if PY_VERSION_HEX >= 0x030C00A6 #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) #else #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) #endif #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* PyObjectGetAttrStrNoError.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif /* IncludeStringH.proto */ #include /* BytesEquals.proto */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /* UnicodeEquals.proto */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* fastcall.proto */ #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) #elif CYTHON_ASSUME_SAFE_MACROS #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) #else #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) #endif #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) #else #define __Pyx_Arg_NewRef_VARARGS(arg) arg // no-op #define __Pyx_Arg_XDECREF_VARARGS(arg) // no-op - arg is borrowed #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL #define __Pyx_Arg_FASTCALL(args, i) args[i] #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif #define __Pyx_Arg_NewRef_FASTCALL(arg) arg // no-op, __Pyx_Arg_FASTCALL is direct and this needs #define __Pyx_Arg_XDECREF_FASTCALL(arg) // no-op - arg was returned from array #else #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) #endif #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) #else #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #endif /* KeywordStringCheck.proto */ static int __Pyx_CheckKeywordStrings(PyObject *kw, const char* function_name, int kw_allowed); /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /* ArgTypeTest.proto */ #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\ __Pyx__ArgTypeTest(obj, type, name, exact)) static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #if !CYTHON_VECTORCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) #endif #endif #endif /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectFastCall.proto */ #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); /* RaiseUnexpectedTypeError.proto */ static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj); /* GCCDiagnostics.proto */ #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define __Pyx_HAS_GCC_DIAGNOSTIC #endif /* BuildPyUnicode.proto */ static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, char* chars, int clength, int prepend_sign, char padding_char); /* CIntToPyUnicode.proto */ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char, char format_char); /* CIntToPyUnicode.proto */ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char, char format_char); /* JoinPyUnicode.proto */ static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength, Py_UCS4 max_char); /* StrEquals.proto */ #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals #else #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals #endif /* PyObjectFormatSimple.proto */ #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_FormatSimple(s, f) (\ likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ PyObject_Format(s, f)) #elif PY_MAJOR_VERSION < 3 #define __Pyx_PyObject_FormatSimple(s, f) (\ likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ likely(PyString_CheckExact(s)) ? PyUnicode_FromEncodedObject(s, NULL, "strict") :\ PyObject_Format(s, f)) #elif CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_FormatSimple(s, f) (\ likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ likely(PyLong_CheckExact(s)) ? PyLong_Type.tp_repr(s) :\ likely(PyFloat_CheckExact(s)) ? PyFloat_Type.tp_repr(s) :\ PyObject_Format(s, f)) #else #define __Pyx_PyObject_FormatSimple(s, f) (\ likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ PyObject_Format(s, f)) #endif CYTHON_UNUSED static int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/ /* GetAttr.proto */ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); /* GetItemInt.proto */ #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ __Pyx_GetItemInt_Generic(o, to_py_func(i)))) #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck); /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* ObjectGetItem.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key); #else #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key) #endif /* DivInt[Py_ssize_t].proto */ static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t); /* UnaryNegOverflows.proto */ #define __Pyx_UNARY_NEG_WOULD_OVERFLOW(x)\ (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x))) /* GetAttr3.proto */ static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif /* AssertionsEnabled.proto */ #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define __Pyx_init_assertions_enabled() (0) #define __pyx_assertions_enabled() (1) #elif CYTHON_COMPILING_IN_LIMITED_API || (CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030C0000) static int __pyx_assertions_enabled_flag; #define __pyx_assertions_enabled() (__pyx_assertions_enabled_flag) static int __Pyx_init_assertions_enabled(void) { PyObject *builtins, *debug, *debug_str; int flag; builtins = PyEval_GetBuiltins(); if (!builtins) goto bad; debug_str = PyUnicode_FromStringAndSize("__debug__", 9); if (!debug_str) goto bad; debug = PyObject_GetItem(builtins, debug_str); Py_DECREF(debug_str); if (!debug) goto bad; flag = PyObject_IsTrue(debug); Py_DECREF(debug); if (flag == -1) goto bad; __pyx_assertions_enabled_flag = flag; return 0; bad: __pyx_assertions_enabled_flag = 1; return -1; } #else #define __Pyx_init_assertions_enabled() (0) #define __pyx_assertions_enabled() (!Py_OptimizeFlag) #endif /* RaiseTooManyValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); /* RaiseNeedMoreValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); /* RaiseNoneIterError.proto */ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); /* ExtTypeTest.proto */ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /* GetTopmostException.proto */ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); #endif /* SaveResetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); #else #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) #endif /* GetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); #endif /* SwapException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); #endif /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportDottedModule.proto */ static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); #endif /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) CYTHON_UNUSED static int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ /* ListCompAppend.proto */ #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len)) { Py_INCREF(x); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 L->ob_item[len] = x; #else PyList_SET_ITEM(list, len, x); #endif __Pyx_SET_SIZE(list, len + 1); return 0; } return PyList_Append(list, x); } #else #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x) #endif /* PySequenceMultiply.proto */ #define __Pyx_PySequence_Multiply_Left(mul, seq) __Pyx_PySequence_Multiply(seq, mul) static CYTHON_INLINE PyObject* __Pyx_PySequence_Multiply(PyObject *seq, Py_ssize_t mul); /* SetItemInt.proto */ #define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\ __Pyx_SetItemInt_Generic(o, to_py_func(i), v))) static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v); static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list, int wraparound, int boundscheck); /* RaiseUnboundLocalError.proto */ static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname); /* DivInt[long].proto */ static CYTHON_INLINE long __Pyx_div_long(long, long); /* PySequenceContains.proto */ static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) { int result = PySequence_Contains(seq, item); return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); } /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* HasAttr.proto */ #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 #define __Pyx_HasAttr(o, n) PyObject_HasAttrWithError(o, n) #else static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); #endif /* ListAppend.proto */ #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { Py_INCREF(x); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 L->ob_item[len] = x; #else PyList_SET_ITEM(list, len, x); #endif __Pyx_SET_SIZE(list, len + 1); return 0; } return PyList_Append(list, x); } #else #define __Pyx_PyList_Append(L,x) PyList_Append(L,x) #endif /* PyObjectCall2Args.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); /* PyObjectGetMethod.proto */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); /* PyObjectCallMethod1.proto */ static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); /* StringJoin.proto */ #if PY_MAJOR_VERSION < 3 #define __Pyx_PyString_Join __Pyx_PyBytes_Join #define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v)) #else #define __Pyx_PyString_Join PyUnicode_Join #define __Pyx_PyBaseString_Join PyUnicode_Join #endif static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values); /* CIntToPyUnicode.proto */ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_size_t(size_t value, Py_ssize_t width, char padding_char, char format_char); /* decode_c_string_utf16.proto */ static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) { int byteorder = 0; return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); } static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) { int byteorder = -1; return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); } static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) { int byteorder = 1; return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); } /* decode_c_bytes.proto */ static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes( const char* cstring, Py_ssize_t length, Py_ssize_t start, Py_ssize_t stop, const char* encoding, const char* errors, PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)); /* decode_bytes.proto */ static CYTHON_INLINE PyObject* __Pyx_decode_bytes( PyObject* string, Py_ssize_t start, Py_ssize_t stop, const char* encoding, const char* errors, PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) { char* as_c_string; Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS as_c_string = PyBytes_AS_STRING(string); size = PyBytes_GET_SIZE(string); #else if (PyBytes_AsStringAndSize(string, &as_c_string, &size) < 0) { return NULL; } #endif return __Pyx_decode_c_bytes( as_c_string, size, start, stop, encoding, errors, decode_func); } /* WriteUnraisableException.proto */ static void __Pyx_WriteUnraisable(const char *name, int clineno, int lineno, const char *filename, int full_traceback, int nogil); /* pop_index.proto */ static PyObject* __Pyx__PyObject_PopNewIndex(PyObject* L, PyObject* py_ix); static PyObject* __Pyx__PyObject_PopIndex(PyObject* L, PyObject* py_ix); #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static PyObject* __Pyx__PyList_PopIndex(PyObject* L, PyObject* py_ix, Py_ssize_t ix); #define __Pyx_PyObject_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) (\ (likely(PyList_CheckExact(L) && __Pyx_fits_Py_ssize_t(ix, type, is_signed))) ?\ __Pyx__PyList_PopIndex(L, py_ix, ix) : (\ (unlikely((py_ix) == Py_None)) ? __Pyx__PyObject_PopNewIndex(L, to_py_func(ix)) :\ __Pyx__PyObject_PopIndex(L, py_ix))) #define __Pyx_PyList_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) (\ __Pyx_fits_Py_ssize_t(ix, type, is_signed) ?\ __Pyx__PyList_PopIndex(L, py_ix, ix) : (\ (unlikely((py_ix) == Py_None)) ? __Pyx__PyObject_PopNewIndex(L, to_py_func(ix)) :\ __Pyx__PyObject_PopIndex(L, py_ix))) #else #define __Pyx_PyList_PopIndex(L, py_ix, ix, is_signed, type, to_py_func)\ __Pyx_PyObject_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) #define __Pyx_PyObject_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) (\ (unlikely((py_ix) == Py_None)) ? __Pyx__PyObject_PopNewIndex(L, to_py_func(ix)) :\ __Pyx__PyObject_PopIndex(L, py_ix)) #endif /* SliceObject.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice( PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop, PyObject** py_start, PyObject** py_stop, PyObject** py_slice, int has_cstart, int has_cstop, int wraparound); /* PyObjectCallNoArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); /* IterFinish.proto */ static CYTHON_INLINE int __Pyx_IterFinish(void); /* UnpackItemEndCheck.proto */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /* PyObjectSetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); #else #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) #endif /* dict_getitem_default.proto */ static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value); /* UnpackUnboundCMethod.proto */ typedef struct { PyObject *type; PyObject **method_name; PyCFunction func; PyObject *method; int flag; } __Pyx_CachedCFunction; /* CallUnboundCMethod1.proto */ static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); #else #define __Pyx_CallUnboundCMethod1(cfunc, self, arg) __Pyx__CallUnboundCMethod1(cfunc, self, arg) #endif /* CallUnboundCMethod2.proto */ static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1 static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2); #else #define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2) __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2) #endif /* py_dict_pop.proto */ static CYTHON_INLINE PyObject *__Pyx_PyDict_Pop(PyObject *d, PyObject *key, PyObject *default_value); /* py_dict_keys.proto */ static CYTHON_INLINE PyObject* __Pyx_PyDict_Keys(PyObject* d); /* CallUnboundCMethod0.proto */ static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self); #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CallUnboundCMethod0(cfunc, self)\ (likely((cfunc)->func) ?\ (likely((cfunc)->flag == METH_NOARGS) ? (*((cfunc)->func))(self, NULL) :\ (PY_VERSION_HEX >= 0x030600B1 && likely((cfunc)->flag == METH_FASTCALL) ?\ (PY_VERSION_HEX >= 0x030700A0 ?\ (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0) :\ (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0, NULL)) :\ (PY_VERSION_HEX >= 0x030700A0 && (cfunc)->flag == (METH_FASTCALL | METH_KEYWORDS) ?\ (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0, NULL) :\ (likely((cfunc)->flag == (METH_VARARGS | METH_KEYWORDS)) ? ((*(PyCFunctionWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, __pyx_empty_tuple, NULL)) :\ ((cfunc)->flag == METH_VARARGS ? (*((cfunc)->func))(self, __pyx_empty_tuple) :\ __Pyx__CallUnboundCMethod0(cfunc, self)))))) :\ __Pyx__CallUnboundCMethod0(cfunc, self)) #else #define __Pyx_CallUnboundCMethod0(cfunc, self) __Pyx__CallUnboundCMethod0(cfunc, self) #endif /* PyIntCompare.proto */ static CYTHON_INLINE int __Pyx_PyInt_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace); /* PyIntBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); #else #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\ (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) #endif /* pyfrozenset_new.proto */ static CYTHON_INLINE PyObject* __Pyx_PyFrozenSet_New(PyObject* it); /* PySetContains.proto */ static CYTHON_INLINE int __Pyx_PySet_ContainsTF(PyObject* key, PyObject* set, int eq); /* PyObject_Str.proto */ #define __Pyx_PyObject_Str(obj)\ (likely(PyString_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Str(obj)) /* append.proto */ static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x); /* PyObjectFormatAndDecref.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f); static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f); /* RaiseClosureNameError.proto */ static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname); /* PyObjectLookupSpecial.proto */ #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_LookupSpecialNoError(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 0) #define __Pyx_PyObject_LookupSpecial(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 1) static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error); #else #define __Pyx_PyObject_LookupSpecialNoError(o,n) __Pyx_PyObject_GetAttrStrNoError(o,n) #define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n) #endif /* IncludeStructmemberH.proto */ #include /* FixUpExtensionType.proto */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); #endif /* FetchSharedCythonModule.proto */ static PyObject *__Pyx_FetchSharedCythonABIModule(void); /* FetchCommonType.proto */ #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); #else static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); #endif /* PyMethodNew.proto */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); typesModule = PyImport_ImportModule("types"); if (!typesModule) return NULL; methodType = PyObject_GetAttrString(typesModule, "MethodType"); Py_DECREF(typesModule); if (!methodType) return NULL; result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); Py_DECREF(methodType); return result; } #elif PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); return PyMethod_New(func, self); } #else #define __Pyx_PyMethod_New PyMethod_New #endif /* PyVectorcallFastCallDict.proto */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif /* CythonFunctionShared.proto */ #define __Pyx_CyFunction_USED #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CYFUNCTION_COROUTINE 0x08 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #else #define __Pyx_CyFunction_GetClassObj(f)\ ((PyObject*) ((PyCMethodObject *) (f))->mm_class) #endif #define __Pyx_CyFunction_SetClassObj(f, classobj)\ __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { #if CYTHON_COMPILING_IN_LIMITED_API PyObject_HEAD PyObject *func; #elif PY_VERSION_HEX < 0x030900B1 PyCFunctionObject func; #else PyCMethodObject func; #endif #if CYTHON_BACKPORT_VECTORCALL __pyx_vectorcallfunc func_vectorcall; #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #endif void *defaults; int defaults_pyobjects; size_t defaults_size; // used by FusedFunction for copying defaults int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; PyObject *func_is_coroutine; } __pyx_CyFunctionObject; #undef __Pyx_CyOrPyCFunction_Check #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); #undef __Pyx_IsSameCFunction #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(PyObject *module); #if CYTHON_METH_FASTCALL static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); #if CYTHON_BACKPORT_VECTORCALL #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) #else #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) #endif #endif /* CythonFunction.proto */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); /* PyObjectCallMethod0.proto */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); /* pop.proto */ static CYTHON_INLINE PyObject* __Pyx__PyObject_Pop(PyObject* L); #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static CYTHON_INLINE PyObject* __Pyx_PyList_Pop(PyObject* L); #define __Pyx_PyObject_Pop(L) (likely(PyList_CheckExact(L)) ?\ __Pyx_PyList_Pop(L) : __Pyx__PyObject_Pop(L)) #else #define __Pyx_PyList_Pop(L) __Pyx__PyObject_Pop(L) #define __Pyx_PyObject_Pop(L) __Pyx__PyObject_Pop(L) #endif /* PyDictContains.proto */ static CYTHON_INLINE int __Pyx_PyDict_ContainsTF(PyObject* item, PyObject* dict, int eq) { int result = PyDict_Contains(dict, item); return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); } /* DictGetItem.proto */ #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key); #define __Pyx_PyObject_Dict_GetItem(obj, name)\ (likely(PyDict_CheckExact(obj)) ?\ __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name)) #else #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name) #endif /* SliceObject.proto */ #define __Pyx_PyObject_DelSlice(obj, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound)\ __Pyx_PyObject_SetSlice(obj, (PyObject*)NULL, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound) static CYTHON_INLINE int __Pyx_PyObject_SetSlice( PyObject* obj, PyObject* value, Py_ssize_t cstart, Py_ssize_t cstop, PyObject** py_start, PyObject** py_stop, PyObject** py_slice, int has_cstart, int has_cstop, int wraparound); /* PyIntCompare.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, long inplace); /* CallableCheck.proto */ #if CYTHON_USE_TYPE_SLOTS && PY_MAJOR_VERSION >= 3 #define __Pyx_PyCallable_Check(obj) (Py_TYPE(obj)->tp_call != NULL) #else #define __Pyx_PyCallable_Check(obj) PyCallable_Check(obj) #endif /* SliceTupleAndList.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_GetSlice(PyObject* src, Py_ssize_t start, Py_ssize_t stop); static CYTHON_INLINE PyObject* __Pyx_PyTuple_GetSlice(PyObject* src, Py_ssize_t start, Py_ssize_t stop); #else #define __Pyx_PyList_GetSlice(seq, start, stop) PySequence_GetSlice(seq, start, stop) #define __Pyx_PyTuple_GetSlice(seq, start, stop) PySequence_GetSlice(seq, start, stop) #endif /* PyExec.proto */ static PyObject* __Pyx_PyExec3(PyObject*, PyObject*, PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyExec2(PyObject*, PyObject*); /* decode_c_string.proto */ static CYTHON_INLINE PyObject* __Pyx_decode_c_string( const char* cstring, Py_ssize_t start, Py_ssize_t stop, const char* encoding, const char* errors, PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)); /* py_dict_clear.proto */ #define __Pyx_PyDict_Clear(d) (PyDict_Clear(d), 0) /* PyObject_GenericGetAttrNoDict.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr #endif /* PyObject_GenericGetAttr.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr #endif /* ValidateBasesTuple.proto */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases); #endif /* PyType_Ready.proto */ CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t); /* SetVTable.proto */ static int __Pyx_SetVtable(PyTypeObject* typeptr , void* vtable); /* GetVTable.proto */ static void* __Pyx_GetVtable(PyTypeObject *type); /* MergeVTables.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_MergeVtables(PyTypeObject *type); #endif /* TypeImport.proto */ #ifndef __PYX_HAVE_RT_ImportType_proto_3_0_6 #define __PYX_HAVE_RT_ImportType_proto_3_0_6 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L #include #endif #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L #define __PYX_GET_STRUCT_ALIGNMENT_3_0_6(s) alignof(s) #else #define __PYX_GET_STRUCT_ALIGNMENT_3_0_6(s) sizeof(void*) #endif enum __Pyx_ImportType_CheckSize_3_0_6 { __Pyx_ImportType_CheckSize_Error_3_0_6 = 0, __Pyx_ImportType_CheckSize_Warn_3_0_6 = 1, __Pyx_ImportType_CheckSize_Ignore_3_0_6 = 2 }; static PyTypeObject *__Pyx_ImportType_3_0_6(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_6 check_size); #endif /* SetupReduce.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_setup_reduce(PyObject* type_obj); #endif /* Py3UpdateBases.proto */ static PyObject* __Pyx_PEP560_update_bases(PyObject *bases); /* CalculateMetaclass.proto */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); /* SetNameInClass.proto */ #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 #define __Pyx_SetNameInClass(ns, name, value)\ (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value)) #elif CYTHON_COMPILING_IN_CPYTHON #define __Pyx_SetNameInClass(ns, name, value)\ (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value)) #else #define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value) #endif /* Py3ClassCreate.proto */ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc); static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); /* ClassMethod.proto */ #include "descrobject.h" CYTHON_UNUSED static PyObject* __Pyx_Method_ClassMethod(PyObject *method); /* GetNameInClass.proto */ #define __Pyx_GetNameInClass(var, nmspace, name) (var) = __Pyx__GetNameInClass(nmspace, name) static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name); /* RegisterModuleCleanup.proto */ static void __pyx_module_cleanup(PyObject *self); #if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY static int __Pyx_RegisterCleanup(void); #else #define __Pyx_RegisterCleanup() (0) #endif /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); #endif /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); #if PY_MAJOR_VERSION < 3 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags); static void __Pyx_ReleaseBuffer(Py_buffer *view); #else #define __Pyx_GetBuffer PyObject_GetBuffer #define __Pyx_ReleaseBuffer PyBuffer_Release #endif /* BufferStructDeclare.proto */ typedef struct { Py_ssize_t shape, strides, suboffsets; } __Pyx_Buf_DimInfo; typedef struct { size_t refcount; Py_buffer pybuffer; } __Pyx_Buffer; typedef struct { __Pyx_Buffer *rcbuffer; char *data; __Pyx_Buf_DimInfo diminfo[8]; } __Pyx_LocalBuf_ND; /* MemviewSliceIsContig.proto */ static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim); /* OverlappingSlices.proto */ static int __pyx_slices_overlap(__Pyx_memviewslice *slice1, __Pyx_memviewslice *slice2, int ndim, size_t itemsize); /* IsLittleEndian.proto */ static CYTHON_INLINE int __Pyx_Is_Little_Endian(void); /* BufferFormatCheck.proto */ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts); static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, __Pyx_BufFmt_StackElem* stack, __Pyx_TypeInfo* type); /* TypeInfoCompare.proto */ static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b); /* MemviewSliceValidateAndInit.proto */ static int __Pyx_ValidateAndInit_memviewslice( int *axes_specs, int c_or_f_flag, int buf_flags, int ndim, __Pyx_TypeInfo *dtype, __Pyx_BufFmt_StackElem stack[], __Pyx_memviewslice *memviewslice, PyObject *original_obj); /* ObjectToMemviewSlice.proto */ static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn_PetscInt(PyObject *, int writable_flag); /* MemviewDtypeToObject.proto */ static CYTHON_INLINE PyObject *__pyx_memview_get_nn_PetscInt(const char *itemp); static CYTHON_INLINE int __pyx_memview_set_nn_PetscInt(const char *itemp, PyObject *obj); static PyObject* __pyx_convert__to_py_PetscEventPerfInfo(PetscEventPerfInfo s); struct __pyx_t_8petsc4py_5PETSc_DLDataType; static PyObject* __pyx_convert__to_py_struct____pyx_t_8petsc4py_5PETSc_DLDataType(struct __pyx_t_8petsc4py_5PETSc_DLDataType s); static PyObject* __pyx_convert__to_py_MatInfo(MatInfo s); /* MemviewSliceCopyTemplate.proto */ static __Pyx_memviewslice __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs, const char *mode, int ndim, size_t sizeof_dtype, int contig_flag, int dtype_is_object); /* MemviewSliceInit.proto */ #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d #define __Pyx_MEMVIEW_DIRECT 1 #define __Pyx_MEMVIEW_PTR 2 #define __Pyx_MEMVIEW_FULL 4 #define __Pyx_MEMVIEW_CONTIG 8 #define __Pyx_MEMVIEW_STRIDED 16 #define __Pyx_MEMVIEW_FOLLOW 32 #define __Pyx_IS_C_CONTIG 1 #define __Pyx_IS_F_CONTIG 2 static int __Pyx_init_memviewslice( struct __pyx_memoryview_obj *memview, int ndim, __Pyx_memviewslice *memviewslice, int memview_is_new_reference); static CYTHON_INLINE int __pyx_add_acquisition_count_locked( __pyx_atomic_int_type *acquisition_count, PyThread_type_lock lock); static CYTHON_INLINE int __pyx_sub_acquisition_count_locked( __pyx_atomic_int_type *acquisition_count, PyThread_type_lock lock); #define __pyx_get_slice_count_pointer(memview) (&memview->acquisition_count) #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__) #define __PYX_XCLEAR_MEMVIEW(slice, have_gil) __Pyx_XCLEAR_MEMVIEW(slice, have_gil, __LINE__) static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int); static CYTHON_INLINE void __Pyx_XCLEAR_MEMVIEW(__Pyx_memviewslice *, int, int); /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From___pyx_anon_enum(int value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_InsertMode(InsertMode value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ScatterMode(ScatterMode value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_NormType(NormType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PetscViewerFormat(PetscViewerFormat value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PetscFileMode(PetscFileMode value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PetscDeviceType(PetscDeviceType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PetscStreamType(PetscStreamType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PetscDeviceContextJoinMode(PetscDeviceContextJoinMode value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ISGlobalToLocalMappingMode(ISGlobalToLocalMappingMode value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_VecOption(VecOption value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_MatOption(MatOption value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_MatAssemblyType(MatAssemblyType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_MatInfoType(MatInfoType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_MatStructure(MatStructure value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_MatDuplicateOption(MatDuplicateOption value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_MatFactorShiftType(MatFactorShiftType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_MatSORType(MatSORType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PCSide(PCSide value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PCASMType(PCASMType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PCGASMType(PCGASMType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PCMGType(PCMGType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PCMGCycleType(PCMGCycleType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PCCompositeType(PCCompositeType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PCFieldSplitSchurPreType(PCFieldSplitSchurPreType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PCFieldSplitSchurFactType(PCFieldSplitSchurFactType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PCPatchConstructType(PCPatchConstructType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PCHPDDMCoarseCorrectionType(PCHPDDMCoarseCorrectionType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PCDeflationSpaceType(PCDeflationSpaceType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PCFailedReason(PCFailedReason value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_KSPNormType(KSPNormType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_KSPConvergedReason(KSPConvergedReason value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_KSPHPDDMType(KSPHPDDMType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SNESNormSchedule(SNESNormSchedule value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SNESConvergedReason(SNESConvergedReason value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_TSProblemType(TSProblemType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_TSEquationType(TSEquationType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_TSExactFinalTimeOption(TSExactFinalTimeOption value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_TSConvergedReason(TSConvergedReason value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_TaoConvergedReason(TaoConvergedReason value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_TaoBNCGType(TaoBNCGType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_TaoLineSearchConvergedReason(TaoLineSearchConvergedReason value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_DMBoundaryType(DMBoundaryType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_DMPolytopeType(DMPolytopeType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_DMDAStencilType(DMDAStencilType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_DMDAInterpolationType(DMDAInterpolationType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_DMDAElementType(DMDAElementType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_DMPlexReorderDefaultFlag(DMPlexReorderDefaultFlag value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_DMStagStencilType(DMStagStencilType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_DMStagStencilLocation(DMStagStencilLocation value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_DMSwarmType(DMSwarmType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_DMSwarmMigrateType(DMSwarmMigrateType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_DMSwarmCollectType(DMSwarmCollectType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_DMSwarmPICLayoutType(DMSwarmPICLayoutType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PetscInt(PetscInt value); /* CIntFromPy.proto */ static CYTHON_INLINE PetscInt __Pyx_PyInt_As_PetscInt(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE InsertMode __Pyx_PyInt_As_InsertMode(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE ScatterMode __Pyx_PyInt_As_ScatterMode(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE PetscFileMode __Pyx_PyInt_As_PetscFileMode(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE PetscDeviceType __Pyx_PyInt_As_PetscDeviceType(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE PetscStreamType __Pyx_PyInt_As_PetscStreamType(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE PetscDeviceContextJoinMode __Pyx_PyInt_As_PetscDeviceContextJoinMode(PyObject *); /* TypeInfoToFormat.proto */ struct __pyx_typeinfo_string { char string[3]; }; static struct __pyx_typeinfo_string __Pyx_TypeInfoToFormat(__Pyx_TypeInfo *type); /* CIntFromPy.proto */ static CYTHON_INLINE int64_t __Pyx_PyInt_As_int64_t(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PetscMemType(PetscMemType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____pyx_t_8petsc4py_5PETSc_PetscDLDeviceType(enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64_t(int64_t value); /* CIntFromPy.proto */ static CYTHON_INLINE MatStructure __Pyx_PyInt_As_MatStructure(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE MatAssemblyType __Pyx_PyInt_As_MatAssemblyType(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE MatInfoType __Pyx_PyInt_As_MatInfoType(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE MatFactorShiftType __Pyx_PyInt_As_MatFactorShiftType(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE KSPConvergedReason __Pyx_PyInt_As_KSPConvergedReason(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE SNESConvergedReason __Pyx_PyInt_As_SNESConvergedReason(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE TaoConvergedReason __Pyx_PyInt_As_TaoConvergedReason(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE DMBoundaryType __Pyx_PyInt_As_DMBoundaryType(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE DMDAStencilType __Pyx_PyInt_As_DMDAStencilType(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE DMDAInterpolationType __Pyx_PyInt_As_DMDAInterpolationType(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE DMDAElementType __Pyx_PyInt_As_DMDAElementType(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE DMStagStencilType __Pyx_PyInt_As_DMStagStencilType(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE DMStagStencilLocation __Pyx_PyInt_As_DMStagStencilLocation(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE PetscClassId __Pyx_PyInt_As_PetscClassId(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PetscLogStage(PetscLogStage value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PetscClassId(PetscClassId value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PetscLogEvent(PetscLogEvent value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_MPI_Fint(MPI_Fint value); /* CIntFromPy.proto */ static CYTHON_INLINE PetscViewerFormat __Pyx_PyInt_As_PetscViewerFormat(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_long(unsigned long value); /* CIntFromPy.proto */ static CYTHON_INLINE unsigned long __Pyx_PyInt_As_unsigned_long(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE PetscBool __Pyx_PyInt_As_PetscBool(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE ISGlobalToLocalMappingMode __Pyx_PyInt_As_ISGlobalToLocalMappingMode(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint16_t(uint16_t value); /* CIntFromPy.proto */ static CYTHON_INLINE enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType __Pyx_PyInt_As_enum____pyx_t_8petsc4py_5PETSc_PetscDLDeviceType(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE VecOption __Pyx_PyInt_As_VecOption(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PetscOffloadMask(PetscOffloadMask value); /* CIntFromPy.proto */ static CYTHON_INLINE NormType __Pyx_PyInt_As_NormType(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE MatOption __Pyx_PyInt_As_MatOption(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE PCFailedReason __Pyx_PyInt_As_PCFailedReason(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE PCASMType __Pyx_PyInt_As_PCASMType(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE PCGASMType __Pyx_PyInt_As_PCGASMType(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE PCCompositeType __Pyx_PyInt_As_PCCompositeType(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE PCFieldSplitSchurFactType __Pyx_PyInt_As_PCFieldSplitSchurFactType(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE PCFieldSplitSchurPreType __Pyx_PyInt_As_PCFieldSplitSchurPreType(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE PCMGType __Pyx_PyInt_As_PCMGType(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE PCMGCycleType __Pyx_PyInt_As_PCMGCycleType(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE PCPatchConstructType __Pyx_PyInt_As_PCPatchConstructType(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE PCHPDDMCoarseCorrectionType __Pyx_PyInt_As_PCHPDDMCoarseCorrectionType(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE PCDeflationSpaceType __Pyx_PyInt_As_PCDeflationSpaceType(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE PCSide __Pyx_PyInt_As_PCSide(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE KSPNormType __Pyx_PyInt_As_KSPNormType(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE KSPHPDDMType __Pyx_PyInt_As_KSPHPDDMType(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE SNESNormSchedule __Pyx_PyInt_As_SNESNormSchedule(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE TSProblemType __Pyx_PyInt_As_TSProblemType(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE TSEquationType __Pyx_PyInt_As_TSEquationType(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE TSExactFinalTimeOption __Pyx_PyInt_As_TSExactFinalTimeOption(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE TSConvergedReason __Pyx_PyInt_As_TSConvergedReason(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE TaoBNCGType __Pyx_PyInt_As_TaoBNCGType(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PetscBool(PetscBool value); /* CIntFromPy.proto */ static CYTHON_INLINE DMPolytopeType __Pyx_PyInt_As_DMPolytopeType(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE DMPlexReorderDefaultFlag __Pyx_PyInt_As_DMPlexReorderDefaultFlag(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE DMSwarmType __Pyx_PyInt_As_DMSwarmType(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE DMSwarmPICLayoutType __Pyx_PyInt_As_DMSwarmPICLayoutType(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_MatProductType(MatProductType value); /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) #else typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" #define __Pyx_PyType_GetName(tp) ((tp)->tp_name) #define __Pyx_DECREF_TypeName(obj) #endif /* CheckBinaryVersion.proto */ static unsigned long __Pyx_get_runtime_version(void); static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* FunctionExport.proto */ static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* #### Code section: module_declarations ### */ static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/ static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value); /* proto*/ static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/ static PyObject *__pyx_memoryview__get_base(struct __pyx_memoryview_obj *__pyx_v_self); /* proto*/ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/ static PyObject *__pyx_memoryviewslice__get_base(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto*/ static int __pyx_f_8petsc4py_5PETSc_10_IS_buffer_acquire(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self); /* proto*/ static int __pyx_f_8petsc4py_5PETSc_10_IS_buffer_release(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self); /* proto*/ static int __pyx_f_8petsc4py_5PETSc_10_IS_buffer_acquirebuffer(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self, Py_buffer *__pyx_v_view, int __pyx_v_flags); /* proto*/ static int __pyx_f_8petsc4py_5PETSc_10_IS_buffer_releasebuffer(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self, Py_buffer *__pyx_v_view); /* proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_10_IS_buffer_enter(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self); /* proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_10_IS_buffer_exit(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self); /* proto*/ static Py_ssize_t __pyx_f_8petsc4py_5PETSc_10_IS_buffer_getbuffer(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self, void **__pyx_v_p); /* proto*/ static int __pyx_f_8petsc4py_5PETSc_11_Vec_buffer_acquire(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self); /* proto*/ static int __pyx_f_8petsc4py_5PETSc_11_Vec_buffer_release(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self); /* proto*/ static int __pyx_f_8petsc4py_5PETSc_11_Vec_buffer_acquirebuffer(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self, Py_buffer *__pyx_v_view, int __pyx_v_flags); /* proto*/ static int __pyx_f_8petsc4py_5PETSc_11_Vec_buffer_releasebuffer(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self, Py_buffer *__pyx_v_view); /* proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_11_Vec_buffer_enter(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self); /* proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_11_Vec_buffer_exit(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self); /* proto*/ static Py_ssize_t __pyx_f_8petsc4py_5PETSc_11_Vec_buffer_getbuffer(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self, void **__pyx_v_p); /* proto*/ static int __pyx_f_8petsc4py_5PETSc_15_DMDA_Vec_array_acquire(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *__pyx_v_self); /* proto*/ static int __pyx_f_8petsc4py_5PETSc_15_DMDA_Vec_array_release(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *__pyx_v_self); /* proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_6Object_get_attr(struct PyPetscObjectObject *__pyx_v_self, char *__pyx_v_name); /* proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_6Object_set_attr(struct PyPetscObjectObject *__pyx_v_self, char *__pyx_v_name, PyObject *__pyx_v_attr); /* proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_6Object_get_dict(struct PyPetscObjectObject *__pyx_v_self); /* proto*/ static int __pyx_f_8petsc4py_5PETSc_6_PyObj_setcontext(struct __pyx_obj_8petsc4py_5PETSc__PyObj *__pyx_v_self, void *__pyx_v_ctx, struct PyPetscObjectObject *__pyx_v_base); /* proto*/ static int __pyx_f_8petsc4py_5PETSc_6_PyObj_getcontext(struct __pyx_obj_8petsc4py_5PETSc__PyObj *__pyx_v_self, void **__pyx_v_ctx); /* proto*/ static int __pyx_f_8petsc4py_5PETSc_6_PyObj_setname(struct __pyx_obj_8petsc4py_5PETSc__PyObj *__pyx_v_self, char *__pyx_v_name); /* proto*/ static char *__pyx_f_8petsc4py_5PETSc_6_PyObj_getname(struct __pyx_obj_8petsc4py_5PETSc__PyObj *__pyx_v_self); /* proto*/ /* Module declarations from "cython.view" */ static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/ /* Module declarations from "cython.dataclasses" */ /* Module declarations from "cython" */ /* Module declarations from "numpy" */ /* Module declarations from "petsc4py.PETSc" */ static PyObject *__pyx_v_8petsc4py_5PETSc_PetscError = 0; static PyObject *__pyx_v_8petsc4py_5PETSc_appctx_registry = 0; static PyObject *__pyx_v_8petsc4py_5PETSc_citations_registry = 0; static PyObject *__pyx_v_8petsc4py_5PETSc_functools = 0; static PyObject *__pyx_v_8petsc4py_5PETSc_stage_registry = 0; static PyObject *__pyx_v_8petsc4py_5PETSc_class_registry = 0; static PyObject *__pyx_v_8petsc4py_5PETSc_event_registry = 0; static struct PyPetscCommObject *__pyx_v_8petsc4py_5PETSc___COMM_NULL__ = 0; static struct PyPetscCommObject *__pyx_v_8petsc4py_5PETSc___COMM_SELF__ = 0; static struct PyPetscCommObject *__pyx_v_8petsc4py_5PETSc___COMM_WORLD__ = 0; static MPI_Comm __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT; static PyObject *__pyx_v_8petsc4py_5PETSc_type_registry = 0; static char *__pyx_v_8petsc4py_5PETSc_FUNCT; static char *__pyx_v_8petsc4py_5PETSc_fstack[0x400]; static int __pyx_v_8petsc4py_5PETSc_istack; static PyObject *__pyx_v_8petsc4py_5PETSc_module_cache = 0; static PyObject *__pyx_v_8petsc4py_5PETSc_dMatOps = 0; static PetscInt __pyx_v_8petsc4py_5PETSc_matmatid; static PyObject *__pyx_v_8petsc4py_5PETSc_tracebacklist = 0; static int __pyx_v_8petsc4py_5PETSc_PyPetsc_Argc; static char **__pyx_v_8petsc4py_5PETSc_PyPetsc_Argv; static PetscErrorCode (*__pyx_v_8petsc4py_5PETSc_prevfprintf)(FILE *, char const *, va_list); static int __pyx_v_8petsc4py_5PETSc_registercalled; static char const *__pyx_v_8petsc4py_5PETSc_citation; static PyObject *__pyx_collections_abc_Sequence = 0; static PyObject *generic = 0; static PyObject *strided = 0; static PyObject *indirect = 0; static PyObject *contiguous = 0; static PyObject *indirect_contiguous = 0; static int __pyx_memoryview_thread_locks_used; static PyThread_type_lock __pyx_memoryview_thread_locks[8]; static MPI_Comm __pyx_f_8petsc4py_5PETSc_GetComm(PyObject *, MPI_Comm); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_PyPetscType_Register(int, PyTypeObject *); /*proto*/ static PyTypeObject *__pyx_f_8petsc4py_5PETSc_PyPetscType_Lookup(int); /*proto*/ static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_CHKERR(PetscErrorCode); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_bytes2str(char const *); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_str2bytes(PyObject *, char const **); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_S_(char const *); /*proto*/ static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_SETERR(PetscErrorCode); /*proto*/ static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_SETERRMPI(int); /*proto*/ static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_CHKERRMPI(int); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toBool(PetscBool); /*proto*/ static CYTHON_INLINE PetscBool __pyx_f_8petsc4py_5PETSc_asBool(PyObject *); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toInt(PetscInt); /*proto*/ static CYTHON_INLINE PetscInt __pyx_f_8petsc4py_5PETSc_asInt(PyObject *); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toReal(PetscReal); /*proto*/ static CYTHON_INLINE PetscReal __pyx_f_8petsc4py_5PETSc_asReal(PyObject *); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toScalar(PetscScalar); /*proto*/ static CYTHON_INLINE PetscScalar __pyx_f_8petsc4py_5PETSc_asScalar(PyObject *); /*proto*/ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_asarray(PyObject *); /*proto*/ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_arange(PyObject *, PyObject *, PyObject *); /*proto*/ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_empty_i(PetscInt); /*proto*/ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_empty_r(PetscInt); /*proto*/ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_empty_s(PetscInt); /*proto*/ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_empty_c(PetscInt); /*proto*/ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_empty_p(PetscInt); /*proto*/ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_array_i(PetscInt, PetscInt const *); /*proto*/ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_array_r(PetscInt, PetscReal const *); /*proto*/ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_array_s(PetscInt, PetscScalar const *); /*proto*/ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_iarray(PyObject *, int); /*proto*/ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_iarray_i(PyObject *, PetscInt *, PetscInt **); /*proto*/ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_iarray_r(PyObject *, PetscInt *, PetscReal **); /*proto*/ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_iarray_b(PyObject *, PetscInt *, PetscBool **); /*proto*/ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_iarray_s(PyObject *, PetscInt *, PetscScalar **); /*proto*/ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_oarray(PyObject *, int); /*proto*/ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_oarray_i(PyObject *, PetscInt *, PetscInt **); /*proto*/ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_oarray_r(PyObject *, PetscInt *, PetscReal **); /*proto*/ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_oarray_s(PyObject *, PetscInt *, PetscScalar **); /*proto*/ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_oarray_p(PyObject *, PetscInt *, void **); /*proto*/ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_ofarray_s(PyObject *, PetscInt *, PetscScalar **); /*proto*/ static void __pyx_f_8petsc4py_5PETSc_pycapsule_deleter(PyObject *); /*proto*/ static void __pyx_f_8petsc4py_5PETSc_manager_deleter(struct __pyx_t_8petsc4py_5PETSc_DLManagedTensor *); /*proto*/ static CYTHON_INLINE InsertMode __pyx_f_8petsc4py_5PETSc_insertmode(PyObject *); /*proto*/ static CYTHON_INLINE ScatterMode __pyx_f_8petsc4py_5PETSc_scattermode(PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_getprefix(PyObject *, struct __pyx_opt_args_8petsc4py_5PETSc_getprefix *__pyx_optional_args); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_opt2str(char const *, char const *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_getopt_Bool(PetscOptions, char const *, char const *, PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_getopt_Int(PetscOptions, char const *, char const *, PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_getopt_Real(PetscOptions, char const *, char const *, PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_getopt_Scalar(PetscOptions, char const *, char const *, PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_getopt_String(PetscOptions, char const *, char const *, PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_getpair(PyObject *, PyObject *, char const **, char const **); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_getopt(PetscOptions, enum __pyx_t_8petsc4py_5PETSc_PetscOptType, PyObject *, PyObject *, PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_tokenize(PyObject *); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_iskey(PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_gettok(PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_getkey(PyObject *, PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_parseopt(PyObject *, PyObject *); /*proto*/ static CYTHON_INLINE MPI_Comm __pyx_f_8petsc4py_5PETSc_mpi4py_Comm_Get(PyObject *); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_mpi4py_Comm_New(MPI_Comm); /*proto*/ static CYTHON_INLINE MPI_Datatype __pyx_f_8petsc4py_5PETSc_mpi4py_Datatype_Get(PyObject *); /*proto*/ static CYTHON_INLINE MPI_Op __pyx_f_8petsc4py_5PETSc_mpi4py_Op_Get(PyObject *); /*proto*/ static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_PetscCommDEALLOC(MPI_Comm *); /*proto*/ static CYTHON_INLINE MPI_Comm __pyx_f_8petsc4py_5PETSc_def_Comm(PyObject *, MPI_Comm); /*proto*/ static CYTHON_INLINE struct PyPetscCommObject *__pyx_f_8petsc4py_5PETSc_new_Comm(MPI_Comm); /*proto*/ static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_comm_size(MPI_Comm); /*proto*/ static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_comm_rank(MPI_Comm); /*proto*/ static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_Sys_Sizes(PyObject *, PyObject *, PetscInt *, PetscInt *, PetscInt *); /*proto*/ static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_Sys_Layout(MPI_Comm, PetscInt, PetscInt *, PetscInt *); /*proto*/ static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_event_args2objs(PyObject *, PetscObject *); /*proto*/ static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_PetscINCREF(PetscObject *); /*proto*/ static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_PetscCLEAR(PetscObject *); /*proto*/ static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_PetscDEALLOC(PetscObject *); /*proto*/ static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_PetscINCSTATE(PetscObject *); /*proto*/ static CYTHON_INLINE void __pyx_f_8petsc4py_5PETSc_Py_DecRef(PyObject *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PetscDelPyDict(void *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_PetscGetPyDict(PetscObject, int); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_PetscGetPyObj(PetscObject, char *); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_PetscSetPyObj(PetscObject, char *, PyObject *); /*proto*/ static CYTHON_INLINE Py_intptr_t __pyx_f_8petsc4py_5PETSc_Object_toFortran(PetscObject); /*proto*/ static CYTHON_INLINE PyTypeObject *__pyx_f_8petsc4py_5PETSc_subtype_DM(DM); /*proto*/ static CYTHON_INLINE PyTypeObject *__pyx_f_8petsc4py_5PETSc_subtype_Object(PetscObject); /*proto*/ static CYTHON_INLINE PetscFileMode __pyx_f_8petsc4py_5PETSc_filemode(PyObject *); /*proto*/ static CYTHON_INLINE PetscDeviceType __pyx_f_8petsc4py_5PETSc_asDeviceType(PyObject *); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toDeviceType(PetscDeviceType); /*proto*/ static CYTHON_INLINE PetscStreamType __pyx_f_8petsc4py_5PETSc_asStreamType(PyObject *); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toStreamType(PetscStreamType); /*proto*/ static CYTHON_INLINE PetscDeviceContextJoinMode __pyx_f_8petsc4py_5PETSc_asJoinMode(PyObject *); /*proto*/ static CYTHON_INLINE struct PyPetscISObject *__pyx_f_8petsc4py_5PETSc_ref_IS(IS); /*proto*/ static CYTHON_INLINE struct PyPetscLGMapObject *__pyx_f_8petsc4py_5PETSc_ref_LGMap(ISLocalToGlobalMapping); /*proto*/ static CYTHON_INLINE struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_ref_Vec(Vec); /*proto*/ static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_vec_pos(struct PyPetscVecObject *); /*proto*/ static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_vec_neg(struct PyPetscVecObject *); /*proto*/ static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_vec_abs(struct PyPetscVecObject *); /*proto*/ static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_vec_iadd(struct PyPetscVecObject *, PyObject *); /*proto*/ static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_vec_isub(struct PyPetscVecObject *, PyObject *); /*proto*/ static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_vec_imul(struct PyPetscVecObject *, PyObject *); /*proto*/ static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_vec_idiv(struct PyPetscVecObject *, PyObject *); /*proto*/ static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_vec_add(struct PyPetscVecObject *, PyObject *); /*proto*/ static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_vec_sub(struct PyPetscVecObject *, PyObject *); /*proto*/ static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_vec_mul(struct PyPetscVecObject *, PyObject *); /*proto*/ static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_vec_div(struct PyPetscVecObject *, PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_vec_matmul(struct PyPetscVecObject *, PyObject *); /*proto*/ static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_vec_radd(struct PyPetscVecObject *, PyObject *); /*proto*/ static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_vec_rsub(struct PyPetscVecObject *, PyObject *); /*proto*/ static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_vec_rmul(struct PyPetscVecObject *, PyObject *); /*proto*/ static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_vec_rdiv(struct PyPetscVecObject *, PyObject *); /*proto*/ static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_Vec_Sizes(PyObject *, PyObject *, PetscInt *, PetscInt *, PetscInt *); /*proto*/ static CYTHON_INLINE __pyx_t_8petsc4py_5PETSc_VecSetValuesFcn *__pyx_f_8petsc4py_5PETSc_vecsetvalues_fcn(int, int); /*proto*/ static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_vecsetvalues(Vec, PyObject *, PyObject *, PyObject *, int, int); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_vecgetvalues(Vec, PyObject *, PyObject *); /*proto*/ static CYTHON_INLINE struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_f_8petsc4py_5PETSc_vec_getbuffer_r(struct PyPetscVecObject *); /*proto*/ static CYTHON_INLINE struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_f_8petsc4py_5PETSc_vec_getbuffer_w(struct PyPetscVecObject *); /*proto*/ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_vec_getarray_r(struct PyPetscVecObject *); /*proto*/ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_vec_getarray_w(struct PyPetscVecObject *); /*proto*/ static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_vec_setarray(struct PyPetscVecObject *, PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_vec_getitem(struct PyPetscVecObject *, PyObject *); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_vec_setitem(struct PyPetscVecObject *, PyObject *, PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_vec_get_dlpack_ctx(struct PyPetscVecObject *); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_Vec_AcquireArray(Vec, PetscScalar **, int); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_Vec_ReleaseArray(Vec, PetscScalar **, int); /*proto*/ static CYTHON_INLINE struct PyPetscNullSpaceObject *__pyx_f_8petsc4py_5PETSc_ref_NullSpace(MatNullSpace); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_NullSpace_Function(MatNullSpace, Vec, void *); /*proto*/ static CYTHON_INLINE struct PyPetscMatObject *__pyx_f_8petsc4py_5PETSc_ref_Mat(Mat); /*proto*/ static struct PyPetscMatObject *__pyx_f_8petsc4py_5PETSc_mat_pos(struct PyPetscMatObject *); /*proto*/ static struct PyPetscMatObject *__pyx_f_8petsc4py_5PETSc_mat_neg(struct PyPetscMatObject *); /*proto*/ static struct PyPetscMatObject *__pyx_f_8petsc4py_5PETSc_mat_iadd(struct PyPetscMatObject *, PyObject *); /*proto*/ static struct PyPetscMatObject *__pyx_f_8petsc4py_5PETSc_mat_isub(struct PyPetscMatObject *, PyObject *); /*proto*/ static struct PyPetscMatObject *__pyx_f_8petsc4py_5PETSc_mat_imul(struct PyPetscMatObject *, PyObject *); /*proto*/ static struct PyPetscMatObject *__pyx_f_8petsc4py_5PETSc_mat_idiv(struct PyPetscMatObject *, PyObject *); /*proto*/ static struct PyPetscMatObject *__pyx_f_8petsc4py_5PETSc_mat_add(struct PyPetscMatObject *, PyObject *); /*proto*/ static struct PyPetscMatObject *__pyx_f_8petsc4py_5PETSc_mat_sub(struct PyPetscMatObject *, PyObject *); /*proto*/ static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_mat_mul_vec(struct PyPetscMatObject *, struct PyPetscVecObject *); /*proto*/ static struct PyPetscMatObject *__pyx_f_8petsc4py_5PETSc_mat_mul_mat(struct PyPetscMatObject *, struct PyPetscMatObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_mat_mul(struct PyPetscMatObject *, PyObject *); /*proto*/ static struct PyPetscMatObject *__pyx_f_8petsc4py_5PETSc_mat_div(struct PyPetscMatObject *, PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_mat_matmul(struct PyPetscMatObject *, PyObject *); /*proto*/ static struct PyPetscMatObject *__pyx_f_8petsc4py_5PETSc_mat_radd(struct PyPetscMatObject *, PyObject *); /*proto*/ static struct PyPetscMatObject *__pyx_f_8petsc4py_5PETSc_mat_rsub(struct PyPetscMatObject *, PyObject *); /*proto*/ static struct PyPetscMatObject *__pyx_f_8petsc4py_5PETSc_mat_rmul(struct PyPetscMatObject *, PyObject *); /*proto*/ static struct PyPetscMatObject *__pyx_f_8petsc4py_5PETSc_mat_rdiv(struct PyPetscMatObject *, PyObject *); /*proto*/ static CYTHON_INLINE MatStructure __pyx_f_8petsc4py_5PETSc_matstructure(PyObject *); /*proto*/ static CYTHON_INLINE MatAssemblyType __pyx_f_8petsc4py_5PETSc_assemblytype(PyObject *); /*proto*/ static CYTHON_INLINE MatInfoType __pyx_f_8petsc4py_5PETSc_infotype(PyObject *); /*proto*/ static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_Mat_Sizes(PyObject *, PyObject *, PetscInt *, PetscInt *, PetscInt *, PetscInt *, PetscInt *, PetscInt *); /*proto*/ static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_Mat_Create(MatType, PyObject *, PyObject *, PyObject *, Mat *); /*proto*/ static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_Mat_AllocAIJ_NNZ(Mat, PyObject *); /*proto*/ static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_Mat_AllocAIJ_CSR(Mat, PyObject *); /*proto*/ static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_Mat_AllocAIJ(Mat, PyObject *, PyObject *); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_Mat_AllocDense(Mat, PyObject *); /*proto*/ static CYTHON_INLINE __pyx_t_8petsc4py_5PETSc_MatSetValuesFcn *__pyx_f_8petsc4py_5PETSc_matsetvalues_fcn(int, int); /*proto*/ static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_matsetvalues(Mat, PyObject *, PyObject *, PyObject *, PyObject *, int, int); /*proto*/ static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_matsetvalues_rcv(Mat, PyObject *, PyObject *, PyObject *, PyObject *, int, int); /*proto*/ static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_matsetvalues_ijv(Mat, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, int, int); /*proto*/ static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_matsetvalues_csr(Mat, PyObject *, PyObject *, PyObject *, PyObject *, int, int); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_matgetvalues(Mat, PyObject *, PyObject *, PyObject *); /*proto*/ static CYTHON_INLINE MatFactorShiftType __pyx_f_8petsc4py_5PETSc_matfactorshifttype(PyObject *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_matfactorinfo(PetscBool, PetscBool, PyObject *, MatFactorInfo *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_mat_getitem(struct PyPetscMatObject *, PyObject *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_mat_setitem(struct PyPetscMatObject *, PyObject *, PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_matsetvaluestencil(Mat, struct __pyx_obj_8petsc4py_5PETSc_MatStencil *, struct __pyx_obj_8petsc4py_5PETSc_MatStencil *, PyObject *, InsertMode, int); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_mat_get_dlpack_ctx(struct PyPetscMatObject *); /*proto*/ static CYTHON_INLINE struct PyPetscPCObject *__pyx_f_8petsc4py_5PETSc_ref_PC(PC); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCPatch_ComputeOperator(PC, PetscInt, Vec, Mat, IS, PetscInt, PetscInt const *, PetscInt const *, void *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCPatch_ComputeFunction(PC, PetscInt, Vec, Vec, IS, PetscInt, PetscInt const *, PetscInt const *, void *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCPatch_ComputeOperatorInteriorFacets(PC, PetscInt, Vec, Mat, IS, PetscInt, PetscInt const *, PetscInt const *, void *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCPatch_ComputeFunctionInteriorFacets(PC, PetscInt, Vec, Vec, IS, PetscInt, PetscInt const *, PetscInt const *, void *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCPatch_UserConstructOperator(PC, PetscInt *, IS **, IS *, void *); /*proto*/ static CYTHON_INLINE struct PyPetscKSPObject *__pyx_f_8petsc4py_5PETSc_ref_KSP(KSP); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_KSP_Converged(KSP, PetscInt, PetscReal, KSPConvergedReason *, void *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_KSP_Monitor(KSP, PetscInt, PetscReal, void *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_KSP_ComputeRHS(KSP, Vec, void *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_KSP_ComputeOps(KSP, Mat, Mat, void *); /*proto*/ static CYTHON_INLINE struct PyPetscSNESObject *__pyx_f_8petsc4py_5PETSc_ref_SNES(SNES); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNES_InitialGuess(SNES, Vec, void *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNES_PreCheck(SNESLineSearch, Vec, Vec, PetscBool *, void *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNES_Function(SNES, Vec, Vec, void *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNES_Update(SNES, PetscInt); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNES_Jacobian(SNES, Vec, Mat, Mat, void *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNES_Objective(SNES, Vec, PetscReal *, void *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNES_NGS(SNES, Vec, Vec, void *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNES_Converged(SNES, PetscInt, PetscReal, PetscReal, PetscReal, SNESConvergedReason *, void *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNES_Monitor(SNES, PetscInt, PetscReal, void *); /*proto*/ static CYTHON_INLINE struct PyPetscTSObject *__pyx_f_8petsc4py_5PETSc_ref_TS(TS); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TS_RHSFunction(TS, PetscReal, Vec, Vec, void *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TS_RHSJacobian(TS, PetscReal, Vec, Mat, Mat, void *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TS_RHSJacobianP(TS, PetscReal, Vec, Mat, void *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TS_IFunction(TS, PetscReal, Vec, Vec, Vec, void *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TS_IJacobian(TS, PetscReal, Vec, Vec, PetscReal, Mat, Mat, void *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TS_IJacobianP(TS, PetscReal, Vec, Vec, PetscReal, Mat, void *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TS_I2Function(TS, PetscReal, Vec, Vec, Vec, Vec, void *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TS_I2Jacobian(TS, PetscReal, Vec, Vec, Vec, PetscReal, PetscReal, Mat, Mat, void *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TS_Monitor(TS, PetscInt, PetscReal, Vec, void *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TS_EventHandler(TS, PetscReal, Vec, PetscScalar *, void *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TS_PostEvent(TS, PetscInt, PetscInt *, PetscReal, Vec, PetscBool, void *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TS_PreStep(TS); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TS_PostStep(TS); /*proto*/ static CYTHON_INLINE struct PyPetscTAOObject *__pyx_f_8petsc4py_5PETSc_ref_TAO(Tao); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TAO_Objective(Tao, Vec, PetscReal *, void *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TAO_Residual(Tao, Vec, Vec, void *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TAO_Gradient(Tao, Vec, Vec, void *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TAO_ObjGrad(Tao, Vec, PetscReal *, Vec, void *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TAO_BRGNRegObjGrad(Tao, Vec, PetscReal *, Vec, void *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TAO_Constraints(Tao, Vec, Vec, void *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TAO_VarBounds(Tao, Vec, Vec, void *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TAO_Hessian(Tao, Vec, Mat, Mat, void *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TAO_BRGNRegHessian(Tao, Vec, Mat, void *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TAO_Jacobian(Tao, Vec, Mat, Mat, void *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TAO_JacobianResidual(Tao, Vec, Mat, Mat, void *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TAO_JacobianState(Tao, Vec, Mat, Mat, Mat, void *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TAO_JacobianDesign(Tao, Vec, Mat, void *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TAO_EqualityConstraints(Tao, Vec, Vec, void *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TAO_JacobianEquality(Tao, Vec, Mat, Mat, void *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TAO_Update(Tao, PetscInt, void *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TAO_Converged(Tao, void *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TAO_Monitor(Tao, void *); /*proto*/ static CYTHON_INLINE struct PyPetscTAOLineSearchObject *__pyx_f_8petsc4py_5PETSc_ref_TAOLS(TaoLineSearch); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TAOLS_Objective(TaoLineSearch, Vec, PetscReal *, void *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TAOLS_Gradient(TaoLineSearch, Vec, Vec, void *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TAOLS_ObjGrad(TaoLineSearch, Vec, PetscReal *, Vec, void *); /*proto*/ static CYTHON_INLINE DMBoundaryType __pyx_f_8petsc4py_5PETSc_asBoundaryType(PyObject *); /*proto*/ static CYTHON_INLINE PetscInt __pyx_f_8petsc4py_5PETSc_asBoundary(PyObject *, DMBoundaryType *, DMBoundaryType *, DMBoundaryType *); /*proto*/ static CYTHON_INLINE struct PyPetscDMObject *__pyx_f_8petsc4py_5PETSc_ref_DM(DM); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_DM_PyCoarsenHook(DM, DM, void *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_DM_PyRestrictHook(DM, Mat, Vec, Mat, DM, void *); /*proto*/ static CYTHON_INLINE DMDAStencilType __pyx_f_8petsc4py_5PETSc_asStencil(PyObject *); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toStencil(DMDAStencilType); /*proto*/ static CYTHON_INLINE DMDAInterpolationType __pyx_f_8petsc4py_5PETSc_dainterpolationtype(PyObject *); /*proto*/ static CYTHON_INLINE DMDAElementType __pyx_f_8petsc4py_5PETSc_daelementtype(PyObject *); /*proto*/ static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_DMDAGetDim(DM, PetscInt *); /*proto*/ static CYTHON_INLINE PetscInt __pyx_f_8petsc4py_5PETSc_asDims(PyObject *, PetscInt *, PetscInt *, PetscInt *); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toDims(PetscInt, PetscInt, PetscInt, PetscInt); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_asOwnershipRanges(PyObject *, PetscInt, PetscInt *, PetscInt *, PetscInt *, PetscInt **, PetscInt **, PetscInt **); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toOwnershipRanges(PetscInt, PetscInt, PetscInt, PetscInt, PetscInt const *, PetscInt const *, PetscInt const *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_adjust_index_exp(PyObject *, PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_adjust_index(PyObject *, PyObject *); /*proto*/ static CYTHON_INLINE DMStagStencilType __pyx_f_8petsc4py_5PETSc_asStagStencil(PyObject *); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toStagStencil(DMStagStencilType); /*proto*/ static CYTHON_INLINE DMStagStencilLocation __pyx_f_8petsc4py_5PETSc_asStagStencilLocation(PyObject *); /*proto*/ static CYTHON_INLINE PetscInt __pyx_f_8petsc4py_5PETSc_asStagDims(PyObject *, PetscInt *, PetscInt *, PetscInt *); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toStagDims(PetscInt, PetscInt, PetscInt, PetscInt); /*proto*/ static CYTHON_INLINE PetscInt __pyx_f_8petsc4py_5PETSc_asDofs(PyObject *, PetscInt *, PetscInt *, PetscInt *, PetscInt *); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toDofs(PetscInt, PetscInt, PetscInt, PetscInt, PetscInt); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_asStagOwnershipRanges(PyObject *, PetscInt, PetscInt *, PetscInt *, PetscInt *, PetscInt **, PetscInt **, PetscInt **); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toStagOwnershipRanges(PetscInt, PetscInt, PetscInt, PetscInt, PetscInt const *, PetscInt const *, PetscInt const *); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toStagBoundary(DMBoundaryType); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toStagBoundaryTypes(PetscInt, DMBoundaryType, DMBoundaryType, DMBoundaryType); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_DMSHELL_CreateGlobalVector(DM, Vec *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_DMSHELL_CreateLocalVector(DM, Vec *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_DMSHELL_GlobalToLocalBegin(DM, Vec, InsertMode, Vec); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_DMSHELL_GlobalToLocalEnd(DM, Vec, InsertMode, Vec); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_DMSHELL_LocalToGlobalBegin(DM, Vec, InsertMode, Vec); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_DMSHELL_LocalToGlobalEnd(DM, Vec, InsertMode, Vec); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_DMSHELL_LocalToLocalBegin(DM, Vec, InsertMode, Vec); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_DMSHELL_LocalToLocalEnd(DM, Vec, InsertMode, Vec); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_DMSHELL_CreateMatrix(DM, Mat *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_DMSHELL_Coarsen(DM, MPI_Comm, DM *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_DMSHELL_Refine(DM, MPI_Comm, DM *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_DMSHELL_CreateInterpolation(DM, DM, Mat *, Vec *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_DMSHELL_CreateInjection(DM, DM, Mat *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_DMSHELL_CreateRestriction(DM, DM, Mat *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_DMSHELL_CreateFieldDecomposition(DM, PetscInt *, char ***, IS **, DM **); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_DMSHELL_CreateDomainDecomposition(DM, PetscInt *, char ***, IS **, IS **, DM **); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_DMSHELL_CreateDomainDecompositionScatters(DM, PetscInt, DM *, VecScatter **, VecScatter **, VecScatter **); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_DMSHELL_CreateSubDM(DM, PetscInt, PetscInt const *, IS *, DM *); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_registerAppCtx(void *); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toAppCtx(void *); /*proto*/ static PetscBool __pyx_f_8petsc4py_5PETSc_get_citation(PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_set_citation(PyObject *, int); /*proto*/ static struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_f_8petsc4py_5PETSc_get_LogStage(PyObject *); /*proto*/ static struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_f_8petsc4py_5PETSc_reg_LogStage(PyObject *, PetscLogStage); /*proto*/ static struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_f_8petsc4py_5PETSc_get_LogClass(PyObject *); /*proto*/ static struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_f_8petsc4py_5PETSc_reg_LogClass(PyObject *, PetscClassId); /*proto*/ static struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_f_8petsc4py_5PETSc_get_LogEvent(PyObject *); /*proto*/ static struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_f_8petsc4py_5PETSc_reg_LogEvent(PyObject *, PetscLogEvent); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_tp_traverse(PyObject *, visitproc, void *); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_tp_clear(PyObject *); /*proto*/ static CYTHON_INLINE void __pyx_f_8petsc4py_5PETSc_TypeEnableGC(PyTypeObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_make_enum_class(PyObject *, PyObject *, PyObject *); /*proto*/ static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_setref(void *, void *); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_PyPetscError_Set(PetscErrorCode); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscComm_New(MPI_Comm); /*proto*/ static MPI_Comm __pyx_f_8petsc4py_5PETSc_PyPetscComm_Get(PyObject *); /*proto*/ static MPI_Comm *__pyx_f_8petsc4py_5PETSc_PyPetscComm_GetPtr(PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscObject_New(PetscObject); /*proto*/ static PetscObject __pyx_f_8petsc4py_5PETSc_PyPetscObject_Get(PyObject *); /*proto*/ static PetscObject *__pyx_f_8petsc4py_5PETSc_PyPetscObject_GetPtr(PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscViewer_New(PetscViewer); /*proto*/ static PetscViewer __pyx_f_8petsc4py_5PETSc_PyPetscViewer_Get(PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscRandom_New(PetscRandom); /*proto*/ static PetscRandom __pyx_f_8petsc4py_5PETSc_PyPetscRandom_Get(PyObject *); /*proto*/ static struct PyPetscDeviceObject *__pyx_f_8petsc4py_5PETSc_PyPetscDevice_New(PetscDevice); /*proto*/ static PetscDevice __pyx_f_8petsc4py_5PETSc_PyPetscDevice_Get(PyObject *); /*proto*/ static struct PyPetscDeviceContextObject *__pyx_f_8petsc4py_5PETSc_PyPetscDeviceContext_New(PetscDeviceContext); /*proto*/ static PetscDeviceContext __pyx_f_8petsc4py_5PETSc_PyPetscDeviceContext_Get(PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscIS_New(IS); /*proto*/ static IS __pyx_f_8petsc4py_5PETSc_PyPetscIS_Get(PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscLGMap_New(ISLocalToGlobalMapping); /*proto*/ static ISLocalToGlobalMapping __pyx_f_8petsc4py_5PETSc_PyPetscLGMap_Get(PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscSF_New(PetscSF); /*proto*/ static PetscSF __pyx_f_8petsc4py_5PETSc_PyPetscSF_Get(PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscVec_New(Vec); /*proto*/ static Vec __pyx_f_8petsc4py_5PETSc_PyPetscVec_Get(PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscScatter_New(VecScatter); /*proto*/ static VecScatter __pyx_f_8petsc4py_5PETSc_PyPetscScatter_Get(PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscSection_New(PetscSection); /*proto*/ static PetscSection __pyx_f_8petsc4py_5PETSc_PyPetscSection_Get(PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscMat_New(Mat); /*proto*/ static Mat __pyx_f_8petsc4py_5PETSc_PyPetscMat_Get(PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscMatPartitioning_New(MatPartitioning); /*proto*/ static MatPartitioning __pyx_f_8petsc4py_5PETSc_PyPetscMatPartitioning_Get(PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscPC_New(PC); /*proto*/ static PC __pyx_f_8petsc4py_5PETSc_PyPetscPC_Get(PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscKSP_New(KSP); /*proto*/ static KSP __pyx_f_8petsc4py_5PETSc_PyPetscKSP_Get(PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscSNES_New(SNES); /*proto*/ static SNES __pyx_f_8petsc4py_5PETSc_PyPetscSNES_Get(PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscTS_New(TS); /*proto*/ static TS __pyx_f_8petsc4py_5PETSc_PyPetscTS_Get(PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscTAO_New(Tao); /*proto*/ static Tao __pyx_f_8petsc4py_5PETSc_PyPetscTAO_Get(PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscTAOLineSearch_New(TaoLineSearch); /*proto*/ static TaoLineSearch __pyx_f_8petsc4py_5PETSc_PyPetscTAOLineSearch_Get(PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscAO_New(AO); /*proto*/ static AO __pyx_f_8petsc4py_5PETSc_PyPetscAO_Get(PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscDM_New(DM); /*proto*/ static DM __pyx_f_8petsc4py_5PETSc_PyPetscDM_Get(PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscDS_New(PetscDS); /*proto*/ static PetscDS __pyx_f_8petsc4py_5PETSc_PyPetscDS_Get(PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscPartitioner_New(PetscPartitioner); /*proto*/ static PetscPartitioner __pyx_f_8petsc4py_5PETSc_PyPetscPartitioner_Get(PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscFE_New(PetscFE); /*proto*/ static PetscFE __pyx_f_8petsc4py_5PETSc_PyPetscFE_Get(PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscQuad_New(PetscQuadrature); /*proto*/ static PetscQuadrature __pyx_f_8petsc4py_5PETSc_PyPetscQuad_Get(PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscDMLabel_New(DMLabel); /*proto*/ static DMLabel __pyx_f_8petsc4py_5PETSc_PyPetscDMLabel_Get(PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscSpace_New(PetscSpace); /*proto*/ static PetscSpace __pyx_f_8petsc4py_5PETSc_PyPetscSpace_Get(PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscDualSpace_New(PetscDualSpace); /*proto*/ static PetscDualSpace __pyx_f_8petsc4py_5PETSc_PyPetscDualSpace_Get(PyObject *); /*proto*/ static CYTHON_INLINE void __pyx_f_8petsc4py_5PETSc_FunctionBegin(char *); /*proto*/ static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_FunctionEnd(void); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PetscSETERR(PetscErrorCode, char *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_UNSUPPORTED(char *); /*proto*/ static CYTHON_INLINE PetscInt __pyx_f_8petsc4py_5PETSc_getRef(void *); /*proto*/ static CYTHON_INLINE void __pyx_f_8petsc4py_5PETSc_addRef(void *); /*proto*/ static CYTHON_INLINE void __pyx_f_8petsc4py_5PETSc_delRef(void *); /*proto*/ static CYTHON_INLINE PetscObject __pyx_f_8petsc4py_5PETSc_newRef(void *); /*proto*/ static CYTHON_INLINE char const *__pyx_f_8petsc4py_5PETSc_getPrefix(void *); /*proto*/ static CYTHON_INLINE struct PyPetscViewerObject *__pyx_f_8petsc4py_5PETSc_Viewer_(PetscViewer); /*proto*/ static CYTHON_INLINE struct PyPetscISObject *__pyx_f_8petsc4py_5PETSc_IS_(IS); /*proto*/ static CYTHON_INLINE struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_Vec_(Vec); /*proto*/ static CYTHON_INLINE struct PyPetscMatObject *__pyx_f_8petsc4py_5PETSc_Mat_(Mat); /*proto*/ static CYTHON_INLINE struct PyPetscPCObject *__pyx_f_8petsc4py_5PETSc_PC_(PC); /*proto*/ static CYTHON_INLINE struct PyPetscKSPObject *__pyx_f_8petsc4py_5PETSc_KSP_(KSP); /*proto*/ static CYTHON_INLINE struct PyPetscSNESObject *__pyx_f_8petsc4py_5PETSc_SNES_(SNES); /*proto*/ static CYTHON_INLINE struct PyPetscTSObject *__pyx_f_8petsc4py_5PETSc_TS_(TS); /*proto*/ static CYTHON_INLINE struct PyPetscTAOObject *__pyx_f_8petsc4py_5PETSc_TAO_(Tao); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_parse_url(PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_load_module(PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_createcontext(char *); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_viewcontext(struct __pyx_obj_8petsc4py_5PETSc__PyObj *, PetscViewer); /*proto*/ static CYTHON_INLINE struct __pyx_obj_8petsc4py_5PETSc__PyMat *__pyx_f_8petsc4py_5PETSc_PyMat(Mat); /*proto*/ __PYX_EXTERN_C PetscErrorCode MatPythonGetContext(Mat, void **); /*proto*/ __PYX_EXTERN_C PetscErrorCode MatPythonSetContext(Mat, void *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatPythonSetType_PYTHON(Mat, char *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatPythonGetType_PYTHON(Mat, char const **); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatCreate_Python(Mat); /*proto*/ static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatDestroy_Python_inner(Mat); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatDestroy_Python(Mat); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatSetFromOptions_Python(Mat, PetscOptionItems *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatView_Python(Mat, PetscViewer); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatDuplicate_Python(Mat, MatDuplicateOption, Mat *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatCopy_Python(Mat, Mat, MatStructure); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatGetDiagonalBlock_Python(Mat, Mat *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatCreateSubMatrix_Python(Mat, IS, IS, MatReuse, Mat *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatSetOption_Python(Mat, MatOption, PetscBool); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatSetUp_Python(Mat); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatAssemblyBegin_Python(Mat, MatAssemblyType); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatAssemblyEnd_Python(Mat, MatAssemblyType); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatZeroEntries_Python(Mat); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatZeroRowsColumns_Python(Mat, PetscInt, PetscInt const *, PetscScalar, Vec, Vec); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatScale_Python(Mat, PetscScalar); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatShift_Python(Mat, PetscScalar); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatCreateVecs_Python(Mat, Vec *, Vec *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatMult_Python(Mat, Vec, Vec); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatMultTranspose_Python(Mat, Vec, Vec); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatMultHermitian_Python(Mat, Vec, Vec); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatMultAdd_Python(Mat, Vec, Vec, Vec); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatMultTransposeAdd_Python(Mat, Vec, Vec, Vec); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatMultHermitianAdd_Python(Mat, Vec, Vec, Vec); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatMultDiagonalBlock_Python(Mat, Vec, Vec); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatSolve_Python(Mat, Vec, Vec); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatSolveTranspose_Python(Mat, Vec, Vec); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatSolveAdd_Python(Mat, Vec, Vec, Vec); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatSolveTransposeAdd_Python(Mat, Vec, Vec, Vec); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatSOR_Python(Mat, Vec, PetscReal, MatSORType, PetscReal, PetscInt, PetscInt, Vec); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatGetDiagonal_Python(Mat, Vec); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatSetDiagonal_Python(Mat, Vec, InsertMode); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatDiagonalScale_Python(Mat, Vec, Vec); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatMissingDiagonal_Python(Mat, PetscBool *, PetscInt *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatNorm_Python(Mat, NormType, PetscReal *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatRealPart_Python(Mat); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatImagPart_Python(Mat); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatConjugate_Python(Mat); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatHasOperation_Python(Mat, MatOperation, PetscBool *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatProductNumeric_Python(Mat); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatProductSymbolic_Python(Mat); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatProductSetFromOptions_Python(Mat); /*proto*/ static CYTHON_INLINE struct __pyx_obj_8petsc4py_5PETSc__PyPC *__pyx_f_8petsc4py_5PETSc_PyPC(PC); /*proto*/ __PYX_EXTERN_C PetscErrorCode PCPythonGetContext(PC, void **); /*proto*/ __PYX_EXTERN_C PetscErrorCode PCPythonSetContext(PC, void *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCPythonSetType_PYTHON(PC, char *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCPythonGetType_PYTHON(PC, char const **); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCCreate_Python(PC); /*proto*/ static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCDestroy_Python_inner(PC); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCDestroy_Python(PC); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCSetUp_Python(PC); /*proto*/ static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCReset_Python_inner(PC); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCReset_Python(PC); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCSetFromOptions_Python(PC, PetscOptionItems *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCView_Python(PC, PetscViewer); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCPreSolve_Python(PC, KSP, Vec, Vec); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCPostSolve_Python(PC, KSP, Vec, Vec); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCApply_Python(PC, Vec, Vec); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCApplyTranspose_Python(PC, Vec, Vec); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCApplySymmetricLeft_Python(PC, Vec, Vec); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCApplySymmetricRight_Python(PC, Vec, Vec); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCMatApply_Python(PC, Mat, Mat); /*proto*/ static CYTHON_INLINE struct __pyx_obj_8petsc4py_5PETSc__PyKSP *__pyx_f_8petsc4py_5PETSc_PyKSP(KSP); /*proto*/ __PYX_EXTERN_C PetscErrorCode KSPPythonGetContext(KSP, void **); /*proto*/ __PYX_EXTERN_C PetscErrorCode KSPPythonSetContext(KSP, void *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_KSPPythonSetType_PYTHON(KSP, char *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_KSPPythonGetType_PYTHON(KSP, char const **); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_KSPCreate_Python(KSP); /*proto*/ static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_KSPDestroy_Python_inner(KSP); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_KSPDestroy_Python(KSP); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_KSPSetUp_Python(KSP); /*proto*/ static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_KSPReset_Python_inner(KSP); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_KSPReset_Python(KSP); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_KSPSetFromOptions_Python(KSP, PetscOptionItems *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_KSPView_Python(KSP, PetscViewer); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_KSPBuildSolution_Python(KSP, Vec, Vec *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_KSPBuildResidual_Python(KSP, Vec, Vec, Vec *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_KSPSolve_Python(KSP); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_KSPSolve_Python_default(KSP, Vec, Vec); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_KSPPreStep_Python(KSP); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_KSPPostStep_Python(KSP); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_KSPStep_Python(KSP, Vec, Vec); /*proto*/ static CYTHON_INLINE struct __pyx_obj_8petsc4py_5PETSc__PySNES *__pyx_f_8petsc4py_5PETSc_PySNES(SNES); /*proto*/ __PYX_EXTERN_C PetscErrorCode SNESPythonGetContext(SNES, void **); /*proto*/ __PYX_EXTERN_C PetscErrorCode SNESPythonSetContext(SNES, void *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNESPythonSetType_PYTHON(SNES, char *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNESPythonGetType_PYTHON(SNES, char const **); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNESCreate_Python(SNES); /*proto*/ static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNESDestroy_Python_inner(SNES); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNESDestroy_Python(SNES); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNESSetUp_Python(SNES); /*proto*/ static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNESReset_Python_inner(SNES); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNESReset_Python(SNES); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNESSetFromOptions_Python(SNES, PetscOptionItems *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNESView_Python(SNES, PetscViewer); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNESSolve_Python(SNES); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNESSolve_Python_default(SNES); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNESPreStep_Python(SNES); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNESPostStep_Python(SNES); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNESStep_Python(SNES, Vec, Vec, Vec); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNESStep_Python_default(SNES, Vec, Vec, Vec); /*proto*/ static CYTHON_INLINE struct __pyx_obj_8petsc4py_5PETSc__PyTS *__pyx_f_8petsc4py_5PETSc_PyTS(TS); /*proto*/ __PYX_EXTERN_C PetscErrorCode TSPythonGetContext(TS, void **); /*proto*/ __PYX_EXTERN_C PetscErrorCode TSPythonSetContext(TS, void *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TSPythonSetType_PYTHON(TS, char *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TSPythonGetType_PYTHON(TS, char const **); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TSCreate_Python(TS); /*proto*/ static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_TSDestroy_Python_inner(TS); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TSDestroy_Python(TS); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TSSetUp_Python(TS); /*proto*/ static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_TSReset_Python_inner(TS); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TSReset_Python(TS); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TSSetFromOptions_Python(TS, PetscOptionItems *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TSView_Python(TS, PetscViewer); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TSStep_Python(TS); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TSRollBack_Python(TS); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TSInterpolate_Python(TS, PetscReal, Vec); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TSEvaluateStep_Python(TS, PetscInt, Vec, PetscBool *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNESTSFormFunction_Python(SNES, Vec, Vec, TS); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNESTSFormJacobian_Python(SNES, Vec, Mat, Mat, TS); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TSSolveStep_Python(TS, PetscReal, Vec); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TSAdaptStep_Python(TS, PetscReal, Vec, PetscReal *, PetscBool *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TSStep_Python_default(TS); /*proto*/ static CYTHON_INLINE struct __pyx_obj_8petsc4py_5PETSc__PyTao *__pyx_f_8petsc4py_5PETSc_PyTao(Tao); /*proto*/ __PYX_EXTERN_C PetscErrorCode TaoPythonGetContext(Tao, void **); /*proto*/ __PYX_EXTERN_C PetscErrorCode TaoPythonSetContext(Tao, void *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TaoPythonSetType_PYTHON(Tao, char *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TaoPythonGetType_PYTHON(Tao, char const **); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TaoCreate_Python(Tao); /*proto*/ static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_TaoDestroy_Python_inner(Tao); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TaoDestroy_Python(Tao); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TaoSetUp_Python(Tao); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TaoSetFromOptions_Python(Tao, PetscOptionItems *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TaoView_Python(Tao, PetscViewer); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TaoSolve_Python(Tao); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TaoSolve_Python_default(Tao); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TaoStep_Python(Tao, Vec, Vec, Vec); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TaoPreStep_Python(Tao); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TaoPostStep_Python(Tao); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PetscPythonMonitorSet_Python(PetscObject, char const *); /*proto*/ __PYX_EXTERN_C PetscErrorCode PetscPythonRegisterAll(void); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_traceback(MPI_Comm, int, char const *, char const *, PetscErrorCode, PetscErrorType, char const *, void *); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PetscPythonErrorHandler(MPI_Comm, int, char const *, char const *, PetscErrorCode, PetscErrorType, char const *, void *); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_getinitargs(PyObject *, int *, char ***); /*proto*/ static void __pyx_f_8petsc4py_5PETSc_delinitargs(int *, char ***); /*proto*/ static void __pyx_f_8petsc4py_5PETSc_finalize(void); /*proto*/ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PetscVFPrintf_PythonStdStream(FILE *, char const *, va_list); /*proto*/ static int __pyx_f_8petsc4py_5PETSc__push_vfprintf(PetscErrorCode (*)(FILE *, char const *, va_list)); /*proto*/ static int __pyx_f_8petsc4py_5PETSc__pop_vfprintf(void); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_initialize(PyObject *, PyObject *); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_register(void); /*proto*/ static int __pyx_array_allocate_buffer(struct __pyx_array_obj *); /*proto*/ static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/ static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/ static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/ static PyObject *_unellipsify(PyObject *, int); /*proto*/ static int assert_direct_dimensions(Py_ssize_t *, int); /*proto*/ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int, int); /*proto*/ static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/ static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/ static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/ static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/ static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/ static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/ static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/ static int __pyx_memoryview_err_dim(PyObject *, PyObject *, int); /*proto*/ static int __pyx_memoryview_err(PyObject *, PyObject *); /*proto*/ static int __pyx_memoryview_err_no_memory(void); /*proto*/ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/ static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/ static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/ static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/ static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/ static PyObject *__pyx_format_from_typeinfo(__Pyx_TypeInfo *); /*proto*/ /* #### Code section: typeinfo ### */ static __Pyx_TypeInfo __Pyx_TypeInfo_nn_PetscInt = { "PetscInt", NULL, sizeof(PetscInt), { 0 }, 0, __PYX_IS_UNSIGNED(PetscInt) ? 'U' : 'I', __PYX_IS_UNSIGNED(PetscInt), 0 }; /* #### Code section: before_global_var ### */ #define __Pyx_MODULE_NAME "petsc4py.PETSc" extern int __pyx_module_is_main_petsc4py__PETSc; int __pyx_module_is_main_petsc4py__PETSc = 0; /* Implementation of "petsc4py.PETSc" */ /* #### Code section: global_var ### */ static PyObject *__pyx_builtin_object; static PyObject *__pyx_builtin_RuntimeError; static PyObject *__pyx_builtin_property; static PyObject *__pyx_builtin_staticmethod; static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_TypeError; static PyObject *__pyx_builtin_KeyError; static PyObject *__pyx_builtin_AttributeError; static PyObject *__pyx_builtin_NotImplementedError; static PyObject *__pyx_builtin_SystemError; static PyObject *__pyx_builtin_NotImplemented; static PyObject *__pyx_builtin_Ellipsis; static PyObject *__pyx_builtin_AssertionError; static PyObject *__pyx_builtin_range; static PyObject *__pyx_builtin_enumerate; static PyObject *__pyx_builtin_open; static PyObject *__pyx_builtin_compile; static PyObject *__pyx_builtin_MemoryError; static PyObject *__pyx_builtin___import__; static PyObject *__pyx_builtin_id; static PyObject *__pyx_builtin_IndexError; /* #### Code section: string_decls ### */ static const char __pyx_k_[] = ": "; static const char __pyx_k_A[] = "A"; static const char __pyx_k_B[] = "B"; static const char __pyx_k_C[] = "C"; static const char __pyx_k_D[] = "D"; static const char __pyx_k_G[] = "G"; static const char __pyx_k_H[] = "H"; static const char __pyx_k_I[] = "I"; static const char __pyx_k_J[] = "J"; static const char __pyx_k_L[] = "L"; static const char __pyx_k_O[] = "O"; static const char __pyx_k_P[] = "P"; static const char __pyx_k_R[] = "R"; static const char __pyx_k_S[] = "S"; static const char __pyx_k_T[] = "T{"; static const char __pyx_k_U[] = "U"; static const char __pyx_k_V[] = "V"; static const char __pyx_k_W[] = "W"; static const char __pyx_k_X[] = "X"; static const char __pyx_k_a[] = "a"; static const char __pyx_k_b[] = "b"; static const char __pyx_k_c[] = "c"; static const char __pyx_k_e[] = "e"; static const char __pyx_k_f[] = "f"; static const char __pyx_k_g[] = "g"; static const char __pyx_k_i[] = "i"; static const char __pyx_k_j[] = "j"; static const char __pyx_k_k[] = "k"; static const char __pyx_k_l[] = "l"; static const char __pyx_k_n[] = "n"; static const char __pyx_k_p[] = "p"; static const char __pyx_k_r[] = "r"; static const char __pyx_k_s[] = "%s"; static const char __pyx_k_t[] = "t"; static const char __pyx_k_u[] = "u"; static const char __pyx_k_v[] = "v"; static const char __pyx_k_w[] = "w"; static const char __pyx_k_x[] = "x"; static const char __pyx_k_y[] = "y"; static const char __pyx_k_AB[] = "AB"; static const char __pyx_k_AO[] = "AO"; static const char __pyx_k_AU[] = "AU"; static const char __pyx_k_BE[] = "BE"; static const char __pyx_k_CG[] = "CG"; static const char __pyx_k_CN[] = "CN"; static const char __pyx_k_CP[] = "CP"; static const char __pyx_k_CR[] = "CR"; static const char __pyx_k_DA[] = "DA"; static const char __pyx_k_DK[] = "DK"; static const char __pyx_k_DM[] = "DM"; static const char __pyx_k_DS[] = "DS"; static const char __pyx_k_DY[] = "DY"; static const char __pyx_k_FE[] = "FE"; static const char __pyx_k_FR[] = "FR"; static const char __pyx_k_GD[] = "GD"; static const char __pyx_k_HS[] = "HS"; static const char __pyx_k_HZ[] = "HZ"; static const char __pyx_k_IS[] = "IS"; static const char __pyx_k_KD[] = "KD"; static const char __pyx_k_LU[] = "LU"; static const char __pyx_k_MG[] = "MG"; static const char __pyx_k_ML[] = "ML"; static const char __pyx_k_MS[] = "MS"; static const char __pyx_k_N1[] = "N1"; static const char __pyx_k_N2[] = "N2"; static const char __pyx_k_ND[] = "ND"; static const char __pyx_k_NM[] = "NM"; static const char __pyx_k_NN[] = "NN"; static const char __pyx_k_NO[] = "NO"; static const char __pyx_k_NZ[] = "NZ"; static const char __pyx_k_P1[] = "P1"; static const char __pyx_k_PC[] = "PC"; static const char __pyx_k_PD[] = "PD"; static const char __pyx_k_Q0[] = "Q0"; static const char __pyx_k_Q1[] = "Q1"; static const char __pyx_k_QN[] = "QN"; static const char __pyx_k_QR[] = "QR"; static const char __pyx_k_RK[] = "RK"; static const char __pyx_k_SF[] = "SF"; static const char __pyx_k_TH[] = "TH"; static const char __pyx_k_TS[] = "TS"; static const char __pyx_k_UA[] = "UA"; static const char __pyx_k_UP[] = "UP"; static const char __pyx_k_VU[] = "VU"; static const char __pyx_k__2[] = "."; static const char __pyx_k__3[] = "*"; static const char __pyx_k__6[] = "'"; static const char __pyx_k__7[] = ")"; static const char __pyx_k__9[] = "^"; static const char __pyx_k_au[] = "au"; static const char __pyx_k_bs[] = "bs"; static const char __pyx_k_da[] = "da"; static const char __pyx_k_dm[] = "dm"; static const char __pyx_k_dt[] = "dt"; static const char __pyx_k_gc[] = "gc"; static const char __pyx_k_gv[] = "gv"; static const char __pyx_k_id[] = "id"; static const char __pyx_k_is[] = "is_"; static const char __pyx_k_lv[] = "lv"; static const char __pyx_k_na[] = "na"; static const char __pyx_k_nc[] = "nc"; static const char __pyx_k_op[] = "op"; static const char __pyx_k_p1[] = "p1"; static const char __pyx_k_pc[] = "pc"; static const char __pyx_k_pd[] = "pd"; static const char __pyx_k_pi[] = "pi"; static const char __pyx_k_pj[] = "pj"; static const char __pyx_k_q0[] = "q0"; static const char __pyx_k_q1[] = "q1"; static const char __pyx_k_rw[] = "rw"; static const char __pyx_k_sf[] = "sf"; static const char __pyx_k_sp[] = "sp"; static const char __pyx_k_sx[] = "sx"; static const char __pyx_k_ua[] = "ua"; static const char __pyx_k_up[] = "up"; static const char __pyx_k_vg[] = "vg"; static const char __pyx_k_vl[] = "vl"; static const char __pyx_k_vm[] = "vm"; static const char __pyx_k_vn[] = "vn"; static const char __pyx_k_xl[] = "xl"; static const char __pyx_k_xu[] = "xu"; static const char __pyx_k_A11[] = "A11"; static const char __pyx_k_ABC[] = "ABC"; static const char __pyx_k_ABt[] = "ABt"; static const char __pyx_k_ADD[] = "ADD"; static const char __pyx_k_AGG[] = "AGG"; static const char __pyx_k_AIJ[] = "AIJ"; static const char __pyx_k_AMD[] = "AMD"; static const char __pyx_k_ASM[] = "ASM"; static const char __pyx_k_AtB[] = "AtB"; static const char __pyx_k_BAS[] = "BAS"; static const char __pyx_k_BCG[] = "BCG"; static const char __pyx_k_BDF[] = "BDF"; static const char __pyx_k_BDM[] = "BDM"; static const char __pyx_k_BOX[] = "BOX"; static const char __pyx_k_CGS[] = "CGS"; static const char __pyx_k_DB2[] = "DB2"; static const char __pyx_k_DB4[] = "DB4"; static const char __pyx_k_DB8[] = "DB8"; static const char __pyx_k_DOF[] = "DOF"; static const char __pyx_k_Dup[] = "Dup"; static const char __pyx_k_FAS[] = "FAS"; static const char __pyx_k_FCG[] = "FCG"; static const char __pyx_k_FFT[] = "FFT"; static const char __pyx_k_FRB[] = "FRB"; static const char __pyx_k_GCR[] = "GCR"; static const char __pyx_k_GEO[] = "GEO"; static const char __pyx_k_HIP[] = "HIP"; static const char __pyx_k_HMG[] = "HMG"; static const char __pyx_k_ICC[] = "ICC"; static const char __pyx_k_ILU[] = "ILU"; static const char __pyx_k_INF[] = "INF"; static const char __pyx_k_IPM[] = "IPM"; static const char __pyx_k_KLU[] = "KLU"; static const char __pyx_k_KSP[] = "KSP"; static const char __pyx_k_LCD[] = "LCD"; static const char __pyx_k_LCL[] = "LCL"; static const char __pyx_k_LRC[] = "LRC"; static const char __pyx_k_LSC[] = "LSC"; static const char __pyx_k_Log[] = "Log"; static const char __pyx_k_MAT[] = "MAT"; static const char __pyx_k_MAX[] = "MAX"; static const char __pyx_k_MPI[] = "MPI"; static const char __pyx_k_Mat[] = "Mat"; static const char __pyx_k_N12[] = "N12"; static const char __pyx_k_NCG[] = "NCG"; static const char __pyx_k_NGS[] = "NGS"; static const char __pyx_k_NLS[] = "NLS"; static const char __pyx_k_NTL[] = "NTL"; static const char __pyx_k_NTR[] = "NTR"; static const char __pyx_k_OWD[] = "OWD"; static const char __pyx_k_PIC[] = "PIC"; static const char __pyx_k_PRP[] = "PRP"; static const char __pyx_k_QCG[] = "QCG"; static const char __pyx_k_QMD[] = "QMD"; static const char __pyx_k_RCM[] = "RCM"; static const char __pyx_k_RK3[] = "RK3"; static const char __pyx_k_RK4[] = "RK4"; static const char __pyx_k_SEQ[] = "SEQ"; static const char __pyx_k_SOR[] = "SOR"; static const char __pyx_k_SPD[] = "SPD"; static const char __pyx_k_SSP[] = "SSP"; static const char __pyx_k_SUM[] = "SUM"; static const char __pyx_k_SVD[] = "SVD"; static const char __pyx_k_Sys[] = "Sys"; static const char __pyx_k_TAO[] = "TAO"; static const char __pyx_k_TFS[] = "TFS"; static const char __pyx_k_T_2[] = "T"; static const char __pyx_k_VTK[] = "VTK"; static const char __pyx_k_Vec[] = "Vec"; static const char __pyx_k_WBM[] = "WBM"; static const char __pyx_k_WXY[] = "WXY"; static const char __pyx_k__10[] = ""; static const char __pyx_k__11[] = ":"; static const char __pyx_k__12[] = "}"; static const char __pyx_k__13[] = "("; static const char __pyx_k__14[] = ","; static const char __pyx_k__16[] = " "; static const char __pyx_k__18[] = "-"; static const char __pyx_k__26[] = "\n"; static const char __pyx_k_a_2[] = "a+"; static const char __pyx_k_abc[] = "abc"; static const char __pyx_k_adj[] = "adj"; static const char __pyx_k_and[] = " and "; static const char __pyx_k_app[] = "app"; static const char __pyx_k_aux[] = "aux"; static const char __pyx_k_box[] = "box"; static const char __pyx_k_c_d[] = "=%c%d"; static const char __pyx_k_col[] = "col"; static const char __pyx_k_csr[] = "csr"; static const char __pyx_k_d_s[] = "[%*d] %s"; static const char __pyx_k_dim[] = "dim"; static const char __pyx_k_div[] = "div"; static const char __pyx_k_dmf[] = "dmf"; static const char __pyx_k_dms[] = "dms"; static const char __pyx_k_doc[] = "__doc__"; static const char __pyx_k_dof[] = "dof"; static const char __pyx_k_dot[] = "dot"; static const char __pyx_k_end[] = "end"; static const char __pyx_k_eta[] = "eta"; static const char __pyx_k_fix[] = "fix"; static const char __pyx_k_flg[] = "flg"; static const char __pyx_k_get[] = "__get__"; static const char __pyx_k_got[] = " (got "; static const char __pyx_k_has[] = "has"; static const char __pyx_k_idx[] = "idx"; static const char __pyx_k_int[] = "int"; static const char __pyx_k_its[] = "its"; static const char __pyx_k_ksp[] = "ksp"; static const char __pyx_k_l2l[] = "l2l"; static const char __pyx_k_lda[] = "lda"; static const char __pyx_k_loc[] = "loc"; static const char __pyx_k_mat[] = "mat"; static const char __pyx_k_max[] = "max"; static const char __pyx_k_min[] = "min"; static const char __pyx_k_mit[] = "mit"; static const char __pyx_k_msg[] = "msg"; static const char __pyx_k_new[] = "__new__"; static const char __pyx_k_ngs[] = "ngs"; static const char __pyx_k_nnz[] = "nnz"; static const char __pyx_k_nsd[] = "nsd"; static const char __pyx_k_nsp[] = "nsp"; static const char __pyx_k_obj[] = "obj"; static const char __pyx_k_out[] = "out"; static const char __pyx_k_ozz[] = "ozz"; static const char __pyx_k_pop[] = "pop"; static const char __pyx_k_pre[] = "pre"; static const char __pyx_k_r_2[] = "r+"; static const char __pyx_k_red[] = "red"; static const char __pyx_k_res[] = "res"; static const char __pyx_k_rhs[] = "rhs"; static const char __pyx_k_row[] = "row"; static const char __pyx_k_s_2[] = "s"; static const char __pyx_k_s_s[] = "-%s%s"; static const char __pyx_k_sec[] = "sec"; static const char __pyx_k_sep[] = "sep"; static const char __pyx_k_str[] = "__str__"; static const char __pyx_k_sub[] = "sub"; static const char __pyx_k_sym[] = "sym"; static const char __pyx_k_sys[] = "sys"; static const char __pyx_k_tab[] = "tab"; static const char __pyx_k_tao[] = "tao"; static const char __pyx_k_tol[] = "tol"; static const char __pyx_k_typ[] = "typ"; static const char __pyx_k_uis[] = "uis"; static const char __pyx_k_val[] = "val"; static const char __pyx_k_vec[] = "vec"; static const char __pyx_k_vlg[] = "vlg"; static const char __pyx_k_w_2[] = "w+"; static const char __pyx_k_zoz[] = "zoz"; static const char __pyx_k_zzo[] = "zzo"; static const char __pyx_k_ADMM[] = "ADMM"; static const char __pyx_k_ALMM[] = "ALMM"; static const char __pyx_k_BACK[] = "BACK"; static const char __pyx_k_BAIJ[] = "BAIJ"; static const char __pyx_k_BCGS[] = "BCGS"; static const char __pyx_k_BDDC[] = "BDDC"; static const char __pyx_k_BFBT[] = "BFBT"; static const char __pyx_k_BICG[] = "BICG"; static const char __pyx_k_BMRM[] = "BMRM"; static const char __pyx_k_BNCG[] = "BNCG"; static const char __pyx_k_BNLS[] = "BNLS"; static const char __pyx_k_BNTL[] = "BNTL"; static const char __pyx_k_BNTR[] = "BNTR"; static const char __pyx_k_BRGN[] = "BRGN"; static const char __pyx_k_CGLS[] = "CGLS"; static const char __pyx_k_CGNE[] = "CGNE"; static const char __pyx_k_CUDA[] = "CUDA"; static const char __pyx_k_Comm[] = "Comm"; static const char __pyx_k_DB16[] = "DB16"; static const char __pyx_k_DIAG[] = "DIAG"; static const char __pyx_k_DIRK[] = "DIRK"; static const char __pyx_k_DMDA[] = "DMDA"; static const char __pyx_k_DOWN[] = "DOWN"; static const char __pyx_k_DRAW[] = "DRAW"; static const char __pyx_k_DROP[] = "DROP"; static const char __pyx_k_ESSL[] = "ESSL"; static const char __pyx_k_FFTW[] = "FFTW"; static const char __pyx_k_FULL[] = "FULL"; static const char __pyx_k_Free[] = "Free"; static const char __pyx_k_GAMG[] = "GAMG"; static const char __pyx_k_GASM[] = "GASM"; static const char __pyx_k_GLEE[] = "GLEE"; static const char __pyx_k_GLLE[] = "GLLE"; static const char __pyx_k_GLTR[] = "GLTR"; static const char __pyx_k_GPCG[] = "GPCG"; static const char __pyx_k_HAAR[] = "HAAR"; static const char __pyx_k_HALF[] = "HALF"; static const char __pyx_k_HASH[] = "HASH"; static const char __pyx_k_HDF5[] = "HDF5"; static const char __pyx_k_HOST[] = "HOST"; static const char __pyx_k_KAIJ[] = "KAIJ"; static const char __pyx_k_LEFT[] = "LEFT"; static const char __pyx_k_LMVM[] = "LMVM"; static const char __pyx_k_LSQR[] = "LSQR"; static const char __pyx_k_Left[] = "Left"; static const char __pyx_k_MAIJ[] = "MAIJ"; static const char __pyx_k_MASK[] = "MASK"; static const char __pyx_k_MFFD[] = "MFFD"; static const char __pyx_k_MOAB[] = "MOAB"; static const char __pyx_k_MPRK[] = "MPRK"; static const char __pyx_k_Mode[] = "Mode"; static const char __pyx_k_NASH[] = "NASH"; static const char __pyx_k_NASM[] = "NASM"; static const char __pyx_k_NEST[] = "NEST"; static const char __pyx_k_NONE[] = "NONE"; static const char __pyx_k_PCGD[] = "PCGD"; static const char __pyx_k_PFMG[] = "PFMG"; static const char __pyx_k_PLEX[] = "PLEX"; static const char __pyx_k_PtAP[] = "PtAP"; static const char __pyx_k_Quad[] = "Quad"; static const char __pyx_k_RAND[] = "RAND"; static const char __pyx_k_RARt[] = "RARt"; static const char __pyx_k_READ[] = "READ"; static const char __pyx_k_RK2A[] = "RK2A"; static const char __pyx_k_RK2B[] = "RK2B"; static const char __pyx_k_RK5F[] = "RK5F"; static const char __pyx_k_ROSW[] = "ROSW"; static const char __pyx_k_SAME[] = "SAME"; static const char __pyx_k_SAWS[] = "SAWS"; static const char __pyx_k_SELF[] = "SELF"; static const char __pyx_k_SELL[] = "SELL"; static const char __pyx_k_SNES[] = "SNES"; static const char __pyx_k_SPAI[] = "SPAI"; static const char __pyx_k_SPQR[] = "SPQR"; static const char __pyx_k_STAG[] = "STAG"; static const char __pyx_k_STAR[] = "STAR"; static const char __pyx_k_STCG[] = "STCG"; static const char __pyx_k_SYCL[] = "SYCL"; static const char __pyx_k_SYNC[] = "SYNC"; static const char __pyx_k_Side[] = "Side"; static const char __pyx_k_Size[] = "Size"; static const char __pyx_k_TRON[] = "TRON"; static const char __pyx_k_TRUE[] = "TRUE"; static const char __pyx_k_Type[] = "Type"; static const char __pyx_k_UNIT[] = "UNIT"; static const char __pyx_k_USER[] = "USER"; static const char __pyx_k__257[] = "?"; static const char __pyx_k_addv[] = "addv"; static const char __pyx_k_args[] = "args"; static const char __pyx_k_atol[] = "atol"; static const char __pyx_k_attr[] = "attr"; static const char __pyx_k_axpy[] = "axpy"; static const char __pyx_k_back[] = "back"; static const char __pyx_k_base[] = "base"; static const char __pyx_k_beta[] = "beta"; static const char __pyx_k_bits[] = "bits"; static const char __pyx_k_bndr[] = "bndr"; static const char __pyx_k_bool[] = "__bool__"; static const char __pyx_k_cell[] = "cell"; static const char __pyx_k_cgid[] = "cgid"; static const char __pyx_k_cmap[] = "cmap"; static const char __pyx_k_code[] = "code"; static const char __pyx_k_cols[] = "cols"; static const char __pyx_k_comm[] = "comm"; static const char __pyx_k_comp[] = "comp"; static const char __pyx_k_cone[] = "cone"; static const char __pyx_k_copy[] = "copy"; static const char __pyx_k_data[] = "data"; static const char __pyx_k_date[] = "date"; static const char __pyx_k_dctx[] = "dctx"; static const char __pyx_k_diag[] = "diag"; static const char __pyx_k_dict[] = "__dict__"; static const char __pyx_k_dims[] = "dims"; static const char __pyx_k_disc[] = "disc"; static const char __pyx_k_dist[] = "dist"; static const char __pyx_k_dmTo[] = "dmTo"; static const char __pyx_k_dofs[] = "dofs"; static const char __pyx_k_down[] = "down"; static const char __pyx_k_drop[] = "drop"; static const char __pyx_k_exec[] = "exec"; static const char __pyx_k_exit[] = "__exit__"; static const char __pyx_k_fact[] = "fact"; static const char __pyx_k_fget[] = "fget"; static const char __pyx_k_file[] = "__file__"; static const char __pyx_k_fill[] = "fill"; static const char __pyx_k_flag[] = "flag"; static const char __pyx_k_flip[] = "flip"; static const char __pyx_k_func[] = "func"; static const char __pyx_k_gord[] = "gord"; static const char __pyx_k_gsec[] = "gsec"; static const char __pyx_k_gtol[] = "gtol"; static const char __pyx_k_gvec[] = "gvec"; static const char __pyx_k_hmax[] = "hmax"; static const char __pyx_k_hmin[] = "hmin"; static const char __pyx_k_idxm[] = "idxm"; static const char __pyx_k_ierr[] = "ierr"; static const char __pyx_k_imag[] = "imag"; static const char __pyx_k_imex[] = "imex"; static const char __pyx_k_info[] = "info"; static const char __pyx_k_init[] = "__init__"; static const char __pyx_k_iset[] = "iset"; static const char __pyx_k_ival[] = "ival"; static const char __pyx_k_join[] = "join"; static const char __pyx_k_keys[] = "keys"; static const char __pyx_k_kind[] = "kind"; static const char __pyx_k_left[] = "left"; static const char __pyx_k_lits[] = "lits"; static const char __pyx_k_locC[] = "locC"; static const char __pyx_k_locX[] = "locX"; static const char __pyx_k_locs[] = "locs"; static const char __pyx_k_ltog[] = "ltog"; static const char __pyx_k_ltol[] = "ltol"; static const char __pyx_k_lvec[] = "lvec"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_mats[] = "mats"; static const char __pyx_k_memo[] = "memo"; static const char __pyx_k_mode[] = "mode"; static const char __pyx_k_mult[] = "mult"; static const char __pyx_k_name[] = "name"; static const char __pyx_k_ndim[] = "ndim"; static const char __pyx_k_nmax[] = "nmax"; static const char __pyx_k_nmin[] = "nmin"; static const char __pyx_k_none[] = "none"; static const char __pyx_k_norm[] = "norm"; static const char __pyx_k_null[] = "null"; static const char __pyx_k_onnz[] = "onnz"; static const char __pyx_k_open[] = "open"; static const char __pyx_k_opts[] = "opts"; static const char __pyx_k_pEnd[] = "pEnd"; static const char __pyx_k_pack[] = "pack"; static const char __pyx_k_part[] = "part"; static const char __pyx_k_perm[] = "perm"; static const char __pyx_k_ptap[] = "ptap"; static const char __pyx_k_push[] = "push"; static const char __pyx_k_quad[] = "quad"; static const char __pyx_k_rank[] = "rank"; static const char __pyx_k_read[] = "read"; static const char __pyx_k_real[] = "real"; static const char __pyx_k_repr[] = "__repr__"; static const char __pyx_k_rmap[] = "rmap"; static const char __pyx_k_rows[] = "rows"; static const char __pyx_k_rtol[] = "rtol"; static const char __pyx_k_seed[] = "seed"; static const char __pyx_k_self[] = "self"; static const char __pyx_k_sfxc[] = "sfxc"; static const char __pyx_k_side[] = "side"; static const char __pyx_k_size[] = "size"; static const char __pyx_k_skip[] = "skip"; static const char __pyx_k_snes[] = "snes"; static const char __pyx_k_spec[] = "__spec__"; static const char __pyx_k_star[] = "star"; static const char __pyx_k_step[] = "step"; static const char __pyx_k_stol[] = "stol"; static const char __pyx_k_stop[] = "stop"; static const char __pyx_k_supp[] = "supp"; static const char __pyx_k_tabs[] = "tabs"; static const char __pyx_k_time[] = "time"; static const char __pyx_k_uaux[] = "uaux"; static const char __pyx_k_unit[] = "unit"; static const char __pyx_k_vecs[] = "vecs"; static const char __pyx_k_view[] = "view"; static const char __pyx_k_vtol[] = "vtol"; static const char __pyx_k_xdot[] = "xdot"; static const char __pyx_k_xmax[] = "xmax"; static const char __pyx_k_xmin[] = "xmin"; static const char __pyx_k_ymax[] = "ymax"; static const char __pyx_k_ymin[] = "ymin"; static const char __pyx_k_zmax[] = "zmax"; static const char __pyx_k_zmin[] = "zmin"; static const char __pyx_k_ADIOS[] = "ADIOS"; static const char __pyx_k_ALPHA[] = "ALPHA"; static const char __pyx_k_ASCII[] = "ASCII"; static const char __pyx_k_ASFLS[] = "ASFLS"; static const char __pyx_k_ASILS[] = "ASILS"; static const char __pyx_k_ASPIN[] = "ASPIN"; static const char __pyx_k_BASIC[] = "BASIC"; static const char __pyx_k_BCGSL[] = "BCGSL"; static const char __pyx_k_BFBCG[] = "BFBCG"; static const char __pyx_k_BLMVM[] = "BLMVM"; static const char __pyx_k_BLOCK[] = "BLOCK"; static const char __pyx_k_BQNLS[] = "BQNLS"; static const char __pyx_k_BQPIP[] = "BQPIP"; static const char __pyx_k_CHACO[] = "CHACO"; static const char __pyx_k_Class[] = "Class"; static const char __pyx_k_Clone[] = "Clone"; static const char __pyx_k_DENSE[] = "DENSE"; static const char __pyx_k_DUMMY[] = "DUMMY"; static const char __pyx_k_EIMEX[] = "EIMEX"; static const char __pyx_k_EULER[] = "EULER"; static const char __pyx_k_Error[] = "Error"; static const char __pyx_k_Event[] = "Event"; static const char __pyx_k_FALSE[] = "FALSE"; static const char __pyx_k_FBCGS[] = "FBCGS"; static const char __pyx_k_FINAL[] = "FINAL"; static const char __pyx_k_FLUSH[] = "FLUSH"; static const char __pyx_k_FRONT[] = "FRONT"; static const char __pyx_k_GLVIS[] = "GLVIS"; static const char __pyx_k_GMRES[] = "GMRES"; static const char __pyx_k_HPDDM[] = "HPDDM"; static const char __pyx_k_HYPRE[] = "HYPRE"; static const char __pyx_k_IBCGS[] = "IBCGS"; static const char __pyx_k_LGMap[] = "LGMap"; static const char __pyx_k_LOCAL[] = "LOCAL"; static const char __pyx_k_LOWER[] = "LOWER"; static const char __pyx_k_LUSOL[] = "LUSOL"; static const char __pyx_k_MEYER[] = "MEYER"; static const char __pyx_k_MIMEX[] = "MIMEX"; static const char __pyx_k_MUMPS[] = "MUMPS"; static const char __pyx_k_ND_Pi[] = "ND_Pi"; static const char __pyx_k_OWLQN[] = "OWLQN"; static const char __pyx_k_P4EST[] = "P4EST"; static const char __pyx_k_P8EST[] = "P8EST"; static const char __pyx_k_PARMS[] = "PARMS"; static const char __pyx_k_PATCH[] = "PATCH"; static const char __pyx_k_PDIPM[] = "PDIPM"; static const char __pyx_k_PETSC[] = "PETSC"; static const char __pyx_k_POINT[] = "POINT"; static const char __pyx_k_Print[] = "Print"; static const char __pyx_k_RIGHT[] = "RIGHT"; static const char __pyx_k_RK1FE[] = "RK1FE"; static const char __pyx_k_RK3BS[] = "RK3BS"; static const char __pyx_k_RK5BS[] = "RK5BS"; static const char __pyx_k_RK5DP[] = "RK5DP"; static const char __pyx_k_RK6VR[] = "RK6VR"; static const char __pyx_k_RK7VR[] = "RK7VR"; static const char __pyx_k_RK8VR[] = "RK8VR"; static const char __pyx_k_RT_Pi[] = "RT_Pi"; static const char __pyx_k_Right[] = "Right"; static const char __pyx_k_SBAIJ[] = "SBAIJ"; static const char __pyx_k_SCHUR[] = "SCHUR"; static const char __pyx_k_SELFP[] = "SELFP"; static const char __pyx_k_SHELL[] = "SHELL"; static const char __pyx_k_SPRNG[] = "SPRNG"; static const char __pyx_k_SSFLS[] = "SSFLS"; static const char __pyx_k_SSILS[] = "SSILS"; static const char __pyx_k_SWARM[] = "SWARM"; static const char __pyx_k_Space[] = "Space"; static const char __pyx_k_Stage[] = "Stage"; static const char __pyx_k_TCQMR[] = "TCQMR"; static const char __pyx_k_TFQMR[] = "TFQMR"; static const char __pyx_k_THETA[] = "THETA"; static const char __pyx_k_THIRD[] = "THIRD"; static const char __pyx_k_TSIRM[] = "TSIRM"; static const char __pyx_k_TWIST[] = "TWIST"; static const char __pyx_k_UPPER[] = "UPPER"; static const char __pyx_k_VANKA[] = "VANKA"; static const char __pyx_k_WRITE[] = "WRITE"; static const char __pyx_k_a_max[] = "a_max"; static const char __pyx_k_abort[] = "abort"; static const char __pyx_k_alpha[] = "alpha"; static const char __pyx_k_apply[] = "apply"; static const char __pyx_k_array[] = "array"; static const char __pyx_k_begin[] = "begin"; static const char __pyx_k_bsize[] = "bsize"; static const char __pyx_k_catol[] = "catol"; static const char __pyx_k_ccomm[] = "ccomm"; static const char __pyx_k_cdctx[] = "cdctx"; static const char __pyx_k_cells[] = "cells"; static const char __pyx_k_class[] = "__class__"; static const char __pyx_k_cnorm[] = "cnorm"; static const char __pyx_k_comms[] = "comms"; static const char __pyx_k_count[] = "count"; static const char __pyx_k_crank[] = "crank"; static const char __pyx_k_crtol[] = "crtol"; static const char __pyx_k_csize[] = "csize"; static const char __pyx_k_ctype[] = "ctype"; static const char __pyx_k_dense[] = "dense"; static const char __pyx_k_devel[] = "devel"; static const char __pyx_k_dtcol[] = "dtcol"; static const char __pyx_k_dtype[] = "dtype"; static const char __pyx_k_emacs[] = "emacs"; static const char __pyx_k_enter[] = "__enter__"; static const char __pyx_k_entry[] = "entry"; static const char __pyx_k_error[] = "error"; static const char __pyx_k_exoid[] = "exoid"; static const char __pyx_k_faces[] = "faces"; static const char __pyx_k_field[] = "field"; static const char __pyx_k_first[] = "first"; static const char __pyx_k_flags[] = "flags"; static const char __pyx_k_flops[] = "flops"; static const char __pyx_k_flush[] = "flush"; static const char __pyx_k_fnorm[] = "fnorm"; static const char __pyx_k_force[] = "force"; static const char __pyx_k_front[] = "front"; static const char __pyx_k_gamma[] = "gamma"; static const char __pyx_k_gatol[] = "gatol"; static const char __pyx_k_getDM[] = "getDM"; static const char __pyx_k_getDS[] = "getDS"; static const char __pyx_k_getPC[] = "getPC"; static const char __pyx_k_get_2[] = "get"; static const char __pyx_k_group[] = "group"; static const char __pyx_k_grtol[] = "grtol"; static const char __pyx_k_gttol[] = "gttol"; static const char __pyx_k_h_max[] = "h_max"; static const char __pyx_k_h_min[] = "h_min"; static const char __pyx_k_hausd[] = "hausd"; static const char __pyx_k_icntl[] = "icntl"; static const char __pyx_k_imode[] = "imode"; static const char __pyx_k_index[] = "index"; static const char __pyx_k_is_to[] = "is_to"; static const char __pyx_k_iscol[] = "iscol"; static const char __pyx_k_isets[] = "isets"; static const char __pyx_k_isrow[] = "isrow"; static const char __pyx_k_kargs[] = "kargs"; static const char __pyx_k_klass[] = "klass"; static const char __pyx_k_label[] = "label"; static const char __pyx_k_lanes[] = "lanes"; static const char __pyx_k_level[] = "level"; static const char __pyx_k_lgmap[] = "lgmap"; static const char __pyx_k_local[] = "local"; static const char __pyx_k_lower[] = "lower"; static const char __pyx_k_lvecs[] = "lvecs"; static const char __pyx_k_major[] = "major"; static const char __pyx_k_minor[] = "minor"; static const char __pyx_k_model[] = "model"; static const char __pyx_k_omega[] = "omega"; static const char __pyx_k_order[] = "order"; static const char __pyx_k_other[] = "other"; static const char __pyx_k_otype[] = "otype"; static const char __pyx_k_petsc[] = "petsc"; static const char __pyx_k_point[] = "point"; static const char __pyx_k_primv[] = "primv"; static const char __pyx_k_ptype[] = "ptype"; static const char __pyx_k_range[] = "range"; static const char __pyx_k_ready[] = "ready"; static const char __pyx_k_reset[] = "reset"; static const char __pyx_k_reuse[] = "reuse"; static const char __pyx_k_right[] = "right"; static const char __pyx_k_rnorm[] = "rnorm"; static const char __pyx_k_scale[] = "scale"; static const char __pyx_k_setDM[] = "setDM"; static const char __pyx_k_setDS[] = "setDS"; static const char __pyx_k_setUp[] = "setUp"; static const char __pyx_k_setup[] = "setup"; static const char __pyx_k_shape[] = "shape"; static const char __pyx_k_shift[] = "shift"; static const char __pyx_k_sizes[] = "sizes"; static const char __pyx_k_sleep[] = "sleep"; static const char __pyx_k_solve[] = "solve"; static const char __pyx_k_split[] = "split"; static const char __pyx_k_stage[] = "stage"; static const char __pyx_k_start[] = "start"; static const char __pyx_k_state[] = "state"; static const char __pyx_k_strip[] = "strip"; static const char __pyx_k_subdm[] = "subdm"; static const char __pyx_k_subsp[] = "subsp"; static const char __pyx_k_super[] = "super"; static const char __pyx_k_theta[] = "theta"; static const char __pyx_k_title[] = "title"; static const char __pyx_k_toAll[] = "toAll"; static const char __pyx_k_trans[] = "trans"; static const char __pyx_k_tspan[] = "tspan"; static const char __pyx_k_twist[] = "twist"; static const char __pyx_k_upper[] = "upper"; static const char __pyx_k_value[] = "value"; static const char __pyx_k_vecTo[] = "vecTo"; static const char __pyx_k_width[] = "width"; static const char __pyx_k_wraps[] = "wraps"; static const char __pyx_k_write[] = "write"; static const char __pyx_k_xnorm[] = "xnorm"; static const char __pyx_k_ynorm[] = "ynorm"; static const char __pyx_k_ADD_BC[] = "ADD_BC"; static const char __pyx_k_AIJCRL[] = "AIJCRL"; static const char __pyx_k_AIJMKL[] = "AIJMKL"; static const char __pyx_k_ALPHA2[] = "ALPHA2"; static const char __pyx_k_ALWAYS[] = "ALWAYS"; static const char __pyx_k_AOType[] = "AOType"; static const char __pyx_k_APPEND[] = "APPEND"; static const char __pyx_k_ARMIJO[] = "ARMIJO"; static const char __pyx_k_BEULER[] = "BEULER"; static const char __pyx_k_BGMRES[] = "BGMRES"; static const char __pyx_k_BINARY[] = "BINARY"; static const char __pyx_k_BQNKLS[] = "BQNKLS"; static const char __pyx_k_BQNKTL[] = "BQNKTL"; static const char __pyx_k_BQNKTR[] = "BQNKTR"; static const char __pyx_k_DECIDE[] = "DECIDE"; static const char __pyx_k_DGMRES[] = "DGMRES"; static const char __pyx_k_DMPlex[] = "DMPlex"; static const char __pyx_k_DMStag[] = "DMStag"; static const char __pyx_k_DMType[] = "DMType"; static const char __pyx_k_DSType[] = "DSType"; static const char __pyx_k_Device[] = "Device"; static const char __pyx_k_EXOTIC[] = "EXOTIC"; static const char __pyx_k_FAILED[] = "FAILED"; static const char __pyx_k_FBCGSR[] = "FBCGSR"; static const char __pyx_k_FETIDP[] = "FETIDP"; static const char __pyx_k_FEType[] = "FEType"; static const char __pyx_k_FGMRES[] = "FGMRES"; static const char __pyx_k_FOREST[] = "FOREST"; static const char __pyx_k_Format[] = "Format"; static const char __pyx_k_GATHER[] = "GATHER"; static const char __pyx_k_GCRODR[] = "GCRODR"; static const char __pyx_k_H2OPUS[] = "H2OPUS"; static const char __pyx_k_INSERT[] = "INSERT"; static const char __pyx_k_ISType[] = "ISType"; static const char __pyx_k_JACOBI[] = "JACOBI"; static const char __pyx_k_KOKKOS[] = "KOKKOS"; static const char __pyx_k_LGMRES[] = "LGMRES"; static const char __pyx_k_LINEAR[] = "LINEAR"; static const char __pyx_k_MATLAB[] = "MATLAB"; static const char __pyx_k_MGType[] = "MGType"; static const char __pyx_k_MINRES[] = "MINRES"; static const char __pyx_k_MIRROR[] = "MIRROR"; static const char __pyx_k_MPIADJ[] = "MPIADJ"; static const char __pyx_k_MPIAIJ[] = "MPIAIJ"; static const char __pyx_k_MPIHIP[] = "MPIHIP"; static const char __pyx_k_NATIVE[] = "NATIVE"; static const char __pyx_k_NGMRES[] = "NGMRES"; static const char __pyx_k_NORMAL[] = "NORMAL"; static const char __pyx_k_NORM_1[] = "NORM_1"; static const char __pyx_k_NORM_2[] = "NORM_2"; static const char __pyx_k_NOTSET[] = "NOTSET"; static const char __pyx_k_OPENCL[] = "OPENCL"; static const char __pyx_k_Object[] = "Object"; static const char __pyx_k_Option[] = "Option"; static const char __pyx_k_PASTIX[] = "PASTIX"; static const char __pyx_k_PCSide[] = "PCSide"; static const char __pyx_k_PCType[] = "PCType"; static const char __pyx_k_PGMRES[] = "PGMRES"; static const char __pyx_k_PIPECG[] = "PIPECG"; static const char __pyx_k_PIPECR[] = "PIPECR"; static const char __pyx_k_PSEUDO[] = "PSEUDO"; static const char __pyx_k_PYTHON[] = "PYTHON"; static const char __pyx_k_QMRCGS[] = "QMRCGS"; static const char __pyx_k_RADAU5[] = "RADAU5"; static const char __pyx_k_RAND48[] = "RAND48"; static const char __pyx_k_RKType[] = "RKType"; static const char __pyx_k_Random[] = "Random"; static const char __pyx_k_Reason[] = "Reason"; static const char __pyx_k_SEQAIJ[] = "SEQAIJ"; static const char __pyx_k_SEQHIP[] = "SEQHIP"; static const char __pyx_k_SFType[] = "SFType"; static const char __pyx_k_SHARED[] = "SHARED"; static const char __pyx_k_SIMPLE[] = "SIMPLE"; static const char __pyx_k_SLICED[] = "SLICED"; static const char __pyx_k_SOCKET[] = "SOCKET"; static const char __pyx_k_STDERR[] = "STDERR"; static const char __pyx_k_STDOUT[] = "STDOUT"; static const char __pyx_k_STRIDE[] = "STRIDE"; static const char __pyx_k_STRING[] = "STRING"; static const char __pyx_k_SUBSET[] = "SUBSET"; static const char __pyx_k_SYMMLQ[] = "SYMMLQ"; static const char __pyx_k_TENSOR[] = "TENSOR"; static const char __pyx_k_TSType[] = "TSType"; static const char __pyx_k_UPDATE[] = "UPDATE"; static const char __pyx_k_Viewer[] = "Viewer"; static const char __pyx_k_WINDOW[] = "WINDOW"; static const char __pyx_k_alpha2[] = "alpha2"; static const char __pyx_k_alphas[] = "alphas"; static const char __pyx_k_amount[] = "amount"; static const char __pyx_k_appctx[] = "appctx"; static const char __pyx_k_append[] = "append"; static const char __pyx_k_atexit[] = "atexit"; static const char __pyx_k_author[] = "author"; static const char __pyx_k_buffer[] = "buffer"; static const char __pyx_k_column[] = "column"; static const char __pyx_k_coords[] = "coords"; static const char __pyx_k_cratio[] = "cratio"; static const char __pyx_k_create[] = "create"; static const char __pyx_k_decode[] = "decode"; static const char __pyx_k_decomp[] = "decomp"; static const char __pyx_k_degree[] = "degree"; static const char __pyx_k_design[] = "design"; static const char __pyx_k_device[] = "device"; static const char __pyx_k_divtol[] = "divtol"; static const char __pyx_k_dlpack[] = "__dlpack__"; static const char __pyx_k_dmtype[] = "dmtype"; static const char __pyx_k_dosort[] = "dosort"; static const char __pyx_k_dspace[] = "dspace"; static const char __pyx_k_enable[] = "enable"; static const char __pyx_k_encode[] = "encode"; static const char __pyx_k_eqtype[] = "eqtype"; static const char __pyx_k_fields[] = "fields"; static const char __pyx_k_format[] = "format"; static const char __pyx_k_getDim[] = "getDim"; static const char __pyx_k_getDof[] = "getDof"; static const char __pyx_k_getKSP[] = "getKSP"; static const char __pyx_k_getNPC[] = "getNPC"; static const char __pyx_k_getRhs[] = "getRhs"; static const char __pyx_k_ghosts[] = "ghosts"; static const char __pyx_k_handle[] = "handle"; static const char __pyx_k_ignore[] = "ignore"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_invert[] = "invert"; static const char __pyx_k_iscols[] = "iscols"; static const char __pyx_k_isperm[] = "isperm"; static const char __pyx_k_isrows[] = "isrows"; static const char __pyx_k_kwargs[] = "kwargs"; static const char __pyx_k_lambda[] = ""; static const char __pyx_k_length[] = "length"; static const char __pyx_k_levels[] = "levels"; static const char __pyx_k_lgmapc[] = "lgmapc"; static const char __pyx_k_lgmapr[] = "lgmapr"; static const char __pyx_k_max_it[] = "max_it"; static const char __pyx_k_maxval[] = "maxval"; static const char __pyx_k_memory[] = "memory"; static const char __pyx_k_metric[] = "metric"; static const char __pyx_k_mgtype[] = "mgtype"; static const char __pyx_k_mirror[] = "mirror"; static const char __pyx_k_module[] = "__module__"; static const char __pyx_k_mpi4py[] = "mpi4py"; static const char __pyx_k_name_2[] = "__name__"; static const char __pyx_k_name_3[] = "name_"; static const char __pyx_k_newsec[] = "newsec"; static const char __pyx_k_newvec[] = "newvec"; static const char __pyx_k_nlocal[] = "nlocal"; static const char __pyx_k_noMove[] = "noMove"; static const char __pyx_k_noSurf[] = "noSurf"; static const char __pyx_k_noSwap[] = "noSwap"; static const char __pyx_k_nroots[] = "nroots"; static const char __pyx_k_numDof[] = "numDof"; static const char __pyx_k_nzdiag[] = "nzdiag"; static const char __pyx_k_object[] = "object"; static const char __pyx_k_offset[] = "offset"; static const char __pyx_k_option[] = "option"; static const char __pyx_k_output[] = "output"; static const char __pyx_k_pStart[] = "pStart"; static const char __pyx_k_parent[] = "parent"; static const char __pyx_k_pickle[] = "pickle"; static const char __pyx_k_points[] = "points"; static const char __pyx_k_prefix[] = "prefix"; static const char __pyx_k_python[] = "python"; static const char __pyx_k_qorder[] = "qorder"; static const char __pyx_k_radius[] = "radius"; static const char __pyx_k_random[] = "random"; static const char __pyx_k_ranges[] = "ranges"; static const char __pyx_k_reason[] = "reason"; static const char __pyx_k_reduce[] = "__reduce__"; static const char __pyx_k_refine[] = "refine"; static const char __pyx_k_remote[] = "remote"; static const char __pyx_k_remove[] = "remove"; static const char __pyx_k_result[] = "result"; static const char __pyx_k_rowmap[] = "rowmap"; static const char __pyx_k_rscale[] = "rscale"; static const char __pyx_k_rsplit[] = "rsplit"; static const char __pyx_k_rtol_0[] = "rtol_0"; static const char __pyx_k_setKSP[] = "setKSP"; static const char __pyx_k_setNPC[] = "setNPC"; static const char __pyx_k_solver[] = "solver"; static const char __pyx_k_starts[] = "starts"; static const char __pyx_k_stderr[] = "stderr"; static const char __pyx_k_stdout[] = "stdout"; static const char __pyx_k_strata[] = "strata"; static const char __pyx_k_stream[] = "stream"; static const char __pyx_k_string[] = "string"; static const char __pyx_k_struct[] = "struct"; static const char __pyx_k_submat[] = "submat"; static const char __pyx_k_subvec[] = "subvec"; static const char __pyx_k_svalue[] = "svalue"; static const char __pyx_k_swidth[] = "swidth"; static const char __pyx_k_tbline[] = "tbline"; static const char __pyx_k_tblist[] = "tblist"; static const char __pyx_k_tensor[] = "tensor"; static const char __pyx_k_toZero[] = "toZero"; static const char __pyx_k_toindx[] = "toindx"; static const char __pyx_k_unpack[] = "unpack"; static const char __pyx_k_update[] = "update"; static const char __pyx_k_values[] = "values"; static const char __pyx_k_vec_to[] = "vec_to"; static const char __pyx_k_viewer[] = "viewer"; static const char __pyx_k_weight[] = "weight"; static const char __pyx_k_ADD_ALL[] = "ADD_ALL"; static const char __pyx_k_AIJPERM[] = "AIJPERM"; static const char __pyx_k_AIJSELL[] = "AIJSELL"; static const char __pyx_k_ARKIMEX[] = "ARKIMEX"; static const char __pyx_k_ASMType[] = "ASMType"; static const char __pyx_k_BACK_UP[] = "BACK_UP"; static const char __pyx_k_BAIJMKL[] = "BAIJMKL"; static const char __pyx_k_BGCRODR[] = "BGCRODR"; static const char __pyx_k_BJACOBI[] = "BJACOBI"; static const char __pyx_k_Barrier[] = "Barrier"; static const char __pyx_k_CHOLMOD[] = "CHOLMOD"; static const char __pyx_k_DEFAULT[] = "DEFAULT"; static const char __pyx_k_DESTROY[] = "DESTROY"; static const char __pyx_k_DMLabel[] = "DMLabel"; static const char __pyx_k_DMShell[] = "DMShell"; static const char __pyx_k_DMSwarm[] = "DMSwarm"; static const char __pyx_k_DRAW_LG[] = "DRAW_LG"; static const char __pyx_k_ELEMENT[] = "ELEMENT"; static const char __pyx_k_EXTRUDE[] = "EXTRUDE"; static const char __pyx_k_FORWARD[] = "FORWARD"; static const char __pyx_k_GATHERV[] = "GATHERV"; static const char __pyx_k_GENERAL[] = "GENERAL"; static const char __pyx_k_GHOSTED[] = "GHOSTED"; static const char __pyx_k_GROPPCG[] = "GROPPCG"; static const char __pyx_k_IntType[] = "IntType"; static const char __pyx_k_KASKADE[] = "KASKADE"; static const char __pyx_k_KSPONLY[] = "KSPONLY"; static const char __pyx_k_KSPType[] = "KSPType"; static const char __pyx_k_LMVMDFP[] = "LMVMDFP"; static const char __pyx_k_LMVMSR1[] = "LMVMSR1"; static const char __pyx_k_MAPPING[] = "MAPPING"; static const char __pyx_k_METISND[] = "METISND"; static const char __pyx_k_MPIBAIJ[] = "MPIBAIJ"; static const char __pyx_k_MPICUDA[] = "MPICUDA"; static const char __pyx_k_MPIKAIJ[] = "MPIKAIJ"; static const char __pyx_k_MPIMAIJ[] = "MPIMAIJ"; static const char __pyx_k_MPISELL[] = "MPISELL"; static const char __pyx_k_MapMode[] = "MapMode"; static const char __pyx_k_MatType[] = "MatType"; static const char __pyx_k_NATURAL[] = "NATURAL"; static const char __pyx_k_NETWORK[] = "NETWORK"; static const char __pyx_k_NOERROR[] = "NOERROR"; static const char __pyx_k_NONZERO[] = "NONZERO"; static const char __pyx_k_NO_SYNC[] = "NO_SYNC"; static const char __pyx_k_NULLLOC[] = "NULLLOC"; static const char __pyx_k_Options[] = "Options"; static const char __pyx_k_PIPECG2[] = "PIPECG2"; static const char __pyx_k_PIPEFCG[] = "PIPEFCG"; static const char __pyx_k_PIPEGCR[] = "PIPEGCR"; static const char __pyx_k_PIPELCG[] = "PIPELCG"; static const char __pyx_k_PREONLY[] = "PREONLY"; static const char __pyx_k_PRODUCT[] = "PRODUCT"; static const char __pyx_k_PYRAMID[] = "PYRAMID"; static const char __pyx_k_QUARTER[] = "QUARTER"; static const char __pyx_k_REFINED[] = "REFINED"; static const char __pyx_k_REVERSE[] = "REVERSE"; static const char __pyx_k_SAME_NZ[] = "SAME_NZ"; static const char __pyx_k_SCATTER[] = "SCATTER"; static const char __pyx_k_SEGMENT[] = "SEGMENT"; static const char __pyx_k_SEQBAIJ[] = "SEQBAIJ"; static const char __pyx_k_SEQCUDA[] = "SEQCUDA"; static const char __pyx_k_SEQKAIJ[] = "SEQKAIJ"; static const char __pyx_k_SEQMAIJ[] = "SEQMAIJ"; static const char __pyx_k_SEQSELL[] = "SEQSELL"; static const char __pyx_k_SORType[] = "SORType"; static const char __pyx_k_SPECIAL[] = "SPECIAL"; static const char __pyx_k_SUCCESS[] = "SUCCESS"; static const char __pyx_k_SUPERLU[] = "SUPERLU"; static const char __pyx_k_SYSPFMG[] = "SYSPFMG"; static const char __pyx_k_Scatter[] = "Scatter"; static const char __pyx_k_Section[] = "Section"; static const char __pyx_k_Stencil[] = "Stencil"; static const char __pyx_k_TAOType[] = "TAOType"; static const char __pyx_k_UMFPACK[] = "UMFPACK"; static const char __pyx_k_UNKNOWN[] = "UNKNOWN"; static const char __pyx_k_UP_LEFT[] = "UP_LEFT"; static const char __pyx_k_VTK_VTR[] = "VTK_VTR"; static const char __pyx_k_VTK_VTS[] = "VTK_VTS"; static const char __pyx_k_VTK_VTU[] = "VTK_VTU"; static const char __pyx_k_VecType[] = "VecType"; static const char __pyx_k_alpha_f[] = "alpha_f"; static const char __pyx_k_alpha_m[] = "alpha_m"; static const char __pyx_k_array_w[] = "array_w"; static const char __pyx_k_asmtype[] = "asmtype"; static const char __pyx_k_back_up[] = "back_up"; static const char __pyx_k_barrier[] = "barrier"; static const char __pyx_k_bcComps[] = "bcComps"; static const char __pyx_k_bcField[] = "bcField"; static const char __pyx_k_bdLabel[] = "bdLabel"; static const char __pyx_k_bdlabel[] = "bdlabel"; static const char __pyx_k_bdvalue[] = "bdvalue"; static const char __pyx_k_cg_type[] = "cg_type"; static const char __pyx_k_coarsen[] = "coarsen"; static const char __pyx_k_compile[] = "compile"; static const char __pyx_k_conePos[] = "conePos"; static const char __pyx_k_context[] = "context"; static const char __pyx_k_default[] = "default"; static const char __pyx_k_destroy[] = "destroy"; static const char __pyx_k_disable[] = "disable"; static const char __pyx_k_display[] = "display"; static const char __pyx_k_dm_type[] = "dm_type"; static const char __pyx_k_ds_type[] = "ds_type"; static const char __pyx_k_dtcount[] = "dtcount"; static const char __pyx_k_element[] = "element"; static const char __pyx_k_epsilon[] = "epsilon"; static const char __pyx_k_fe_type[] = "fe_type"; static const char __pyx_k_fortran[] = "fortran"; static const char __pyx_k_forward[] = "forward"; static const char __pyx_k_getComm[] = "getComm"; static const char __pyx_k_getInfo[] = "getInfo"; static const char __pyx_k_getName[] = "getName"; static const char __pyx_k_getRank[] = "getRank"; static const char __pyx_k_getSNES[] = "getSNES"; static const char __pyx_k_getSeed[] = "getSeed"; static const char __pyx_k_getSize[] = "getSize"; static const char __pyx_k_getTime[] = "getTime"; static const char __pyx_k_getType[] = "getType"; static const char __pyx_k_getVecs[] = "getVecs"; static const char __pyx_k_ghosted[] = "ghosted"; static const char __pyx_k_hasName[] = "hasName"; static const char __pyx_k_hessian[] = "hessian"; static const char __pyx_k_indices[] = "indices"; static const char __pyx_k_is_from[] = "is_from"; static const char __pyx_k_is_type[] = "is_type"; static const char __pyx_k_ls_type[] = "ls_type"; static const char __pyx_k_mallocs[] = "mallocs"; static const char __pyx_k_matMult[] = "matMult"; static const char __pyx_k_maxrank[] = "maxrank"; static const char __pyx_k_memview[] = "memview"; static const char __pyx_k_metric1[] = "metric1"; static const char __pyx_k_metric2[] = "metric2"; static const char __pyx_k_metric3[] = "metric3"; static const char __pyx_k_monitor[] = "monitor"; static const char __pyx_k_multAdd[] = "multAdd"; static const char __pyx_k_nbsteps[] = "nbsteps"; static const char __pyx_k_nlevels[] = "nlevels"; static const char __pyx_k_nonzero[] = "nonzero"; static const char __pyx_k_npoints[] = "npoints"; static const char __pyx_k_numComp[] = "numComp"; static const char __pyx_k_numIter[] = "numIter"; static const char __pyx_k_nz_used[] = "nz_used"; static const char __pyx_k_objgrad[] = "objgrad"; static const char __pyx_k_ometric[] = "ometric"; static const char __pyx_k_options[] = "options"; static const char __pyx_k_overlap[] = "overlap"; static const char __pyx_k_package[] = "package"; static const char __pyx_k_pc_type[] = "pc_type"; static const char __pyx_k_preStep[] = "preStep"; static const char __pyx_k_prepare[] = "__prepare__"; static const char __pyx_k_prestep[] = "prestep"; static const char __pyx_k_py_type[] = "py_type"; static const char __pyx_k_release[] = "release"; static const char __pyx_k_replace[] = "replace"; static const char __pyx_k_reshape[] = "reshape"; static const char __pyx_k_restart[] = "restart"; static const char __pyx_k_reverse[] = "reverse"; static const char __pyx_k_rgLabel[] = "rgLabel"; static const char __pyx_k_scatter[] = "scatter"; static const char __pyx_k_seconds[] = "seconds"; static const char __pyx_k_setName[] = "setName"; static const char __pyx_k_setSeed[] = "setSeed"; static const char __pyx_k_setTime[] = "setTime"; static const char __pyx_k_setType[] = "setType"; static const char __pyx_k_sf_type[] = "sf_type"; static const char __pyx_k_simplex[] = "simplex"; static const char __pyx_k_smooths[] = "smooths"; static const char __pyx_k_sortype[] = "sortype"; static const char __pyx_k_stratum[] = "stratum"; static const char __pyx_k_strides[] = "strides"; static const char __pyx_k_subcomm[] = "subcomm"; static const char __pyx_k_submats[] = "submats"; static const char __pyx_k_tr_type[] = "tr_type"; static const char __pyx_k_trimmed[] = "trimmed"; static const char __pyx_k_ts_type[] = "ts_type"; static const char __pyx_k_typestr[] = "typestr"; static const char __pyx_k_uniform[] = "uniform"; static const char __pyx_k_unnamed[] = "unnamed"; static const char __pyx_k_up_left[] = "up_left"; static const char __pyx_k_useCone[] = "useCone"; static const char __pyx_k_vectors[] = "vectors"; static const char __pyx_k_version[] = "version"; static const char __pyx_k_xdotdot[] = "xdotdot"; static const char __pyx_k_ADDITIVE[] = "ADDITIVE"; static const char __pyx_k_ADVANCED[] = "ADVANCED"; static const char __pyx_k_ALLTOALL[] = "ALLTOALL"; static const char __pyx_k_ANDERSON[] = "ANDERSON"; static const char __pyx_k_ARKIMEX3[] = "ARKIMEX3"; static const char __pyx_k_ARKIMEX4[] = "ARKIMEX4"; static const char __pyx_k_ARKIMEX5[] = "ARKIMEX5"; static const char __pyx_k_BALANCED[] = "BALANCED"; static const char __pyx_k_BIORTH22[] = "BIORTH22"; static const char __pyx_k_BLOCKMAT[] = "BLOCKMAT"; static const char __pyx_k_BNCGType[] = "BNCGType"; static const char __pyx_k_CHOLESKY[] = "CHOLESKY"; static const char __pyx_k_CUSPARSE[] = "CUSPARSE"; static const char __pyx_k_DEFLATED[] = "DEFLATED"; static const char __pyx_k_DIAGONAL[] = "DIAGONAL"; static const char __pyx_k_DIRK657A[] = "DIRK657A"; static const char __pyx_k_DIRK658A[] = "DIRK658A"; static const char __pyx_k_DIRK759A[] = "DIRK759A"; static const char __pyx_k_DIRKS212[] = "DIRKS212"; static const char __pyx_k_DIRKType[] = "DIRKType"; static const char __pyx_k_DISCGRAD[] = "DISCGRAD"; static const char __pyx_k_DM_types[] = "`DM` types."; static const char __pyx_k_DrawSize[] = "DrawSize"; static const char __pyx_k_EXODUSII[] = "EXODUSII"; static const char __pyx_k_EXPLICIT[] = "EXPLICIT"; static const char __pyx_k_Ellipsis[] = "Ellipsis"; static const char __pyx_k_FRONT_UP[] = "FRONT_UP"; static const char __pyx_k_FV_GHOST[] = "FV_GHOST"; static const char __pyx_k_FileMode[] = "FileMode"; static const char __pyx_k_GALERKIN[] = "GALERKIN"; static const char __pyx_k_GAMGType[] = "GAMGType"; static const char __pyx_k_GASMType[] = "GASMType"; static const char __pyx_k_GIT_Date[] = "GIT Date:"; static const char __pyx_k_Get_rank[] = "Get_rank"; static const char __pyx_k_Get_size[] = "Get_size"; static const char __pyx_k_HDF5_MAT[] = "HDF5_MAT"; static const char __pyx_k_HDF5_VIZ[] = "HDF5_VIZ"; static const char __pyx_k_IMPLICIT[] = "IMPLICIT"; static const char __pyx_k_INBLOCKS[] = "INBLOCKS"; static const char __pyx_k_INFINITY[] = "INFINITY"; static const char __pyx_k_InfoType[] = "InfoType"; static const char __pyx_k_JoinMode[] = "JoinMode"; static const char __pyx_k_KACZMARZ[] = "KACZMARZ"; static const char __pyx_k_KeyError[] = "KeyError"; static const char __pyx_k_LAGRANGE[] = "LAGRANGE"; static const char __pyx_k_LMVMBFGS[] = "LMVMBFGS"; static const char __pyx_k_LOCALREF[] = "LOCALREF"; static const char __pyx_k_LogClass[] = "LogClass"; static const char __pyx_k_LogEvent[] = "LogEvent"; static const char __pyx_k_LogStage[] = "LogStage"; static const char __pyx_k_MPIDENSE[] = "MPIDENSE"; static const char __pyx_k_MPISBAIJ[] = "MPISBAIJ"; static const char __pyx_k_NEIGHBOR[] = "NEIGHBOR"; static const char __pyx_k_NEWTONLS[] = "NEWTONLS"; static const char __pyx_k_NEWTONTR[] = "NEWTONTR"; static const char __pyx_k_NOFORMAT[] = "NOFORMAT"; static const char __pyx_k_NORM_MAX[] = "NORM_MAX"; static const char __pyx_k_NormType[] = "NormType"; static const char __pyx_k_OWARMIJO[] = "OWARMIJO"; static const char __pyx_k_PARMETIS[] = "PARMETIS"; static const char __pyx_k_PBJACOBI[] = "PBJACOBI"; static const char __pyx_k_PCMGType[] = "PCMGType"; static const char __pyx_k_PERIODIC[] = "PERIODIC"; static const char __pyx_k_PIPEBCGS[] = "PIPEBCGS"; static const char __pyx_k_PIPECGRR[] = "PIPECGRR"; static const char __pyx_k_PIPEPRCG[] = "PIPEPRCG"; static const char __pyx_k_POUNDERS[] = "POUNDERS"; static const char __pyx_k_PRP_PLUS[] = "PRP_PLUS"; static const char __pyx_k_PTRIMMED[] = "PTRIMMED"; static const char __pyx_k_PTSCOTCH[] = "PTSCOTCH"; static const char __pyx_k_RANDER48[] = "RANDER48"; static const char __pyx_k_REFINE1D[] = "REFINE1D"; static const char __pyx_k_RESTRICT[] = "RESTRICT"; static const char __pyx_k_RealType[] = "RealType"; static const char __pyx_k_SEQCUFFT[] = "SEQCUFFT"; static const char __pyx_k_SEQDENSE[] = "SEQDENSE"; static const char __pyx_k_SEQSBAIJ[] = "SEQSBAIJ"; static const char __pyx_k_SNESType[] = "SNESType"; static const char __pyx_k_SPECTRAL[] = "SPECTRAL"; static const char __pyx_k_SSML_DFP[] = "SSML_DFP"; static const char __pyx_k_STANDARD[] = "STANDARD"; static const char __pyx_k_STEPOVER[] = "STEPOVER"; static const char __pyx_k_SUBSPACE[] = "SUBSPACE"; static const char __pyx_k_SUNDIALS[] = "SUNDIALS"; static const char __pyx_k_Sequence[] = "Sequence"; static const char __pyx_k_TRIANGLE[] = "TRIANGLE"; static const char __pyx_k_TSRKType[] = "TSRKType"; static const char __pyx_k_UP_RIGHT[] = "UP_RIGHT"; static const char __pyx_k_VIENNACL[] = "VIENNACL"; static const char __pyx_k_addFlops[] = "addFlops"; static const char __pyx_k_assembly[] = "assembly"; static const char __pyx_k_bcPoints[] = "bcPoints"; static const char __pyx_k_boundary[] = "boundary"; static const char __pyx_k_buffer_w[] = "buffer_w"; static const char __pyx_k_builtins[] = "__builtins__"; static const char __pyx_k_citation[] = "citation"; static const char __pyx_k_constant[] = "constant"; static const char __pyx_k_cpuarray[] = "cpuarray"; static const char __pyx_k_debugger[] = "debugger"; static const char __pyx_k_delValue[] = "delValue"; static const char __pyx_k_dltensor[] = "dltensor"; static const char __pyx_k_end_args[] = "end_args"; static const char __pyx_k_enum2str[] = "__enum2str"; static const char __pyx_k_filename[] = "filename"; static const char __pyx_k_finalize[] = "_finalize"; static const char __pyx_k_front_up[] = "front_up"; static const char __pyx_k_function[] = "function"; static const char __pyx_k_gamgtype[] = "gamgtype"; static const char __pyx_k_gasmtype[] = "gasmtype"; static const char __pyx_k_getArray[] = "getArray"; static const char __pyx_k_getFlops[] = "getFlops"; static const char __pyx_k_getSizes[] = "getSizes"; static const char __pyx_k_getUseEW[] = "getUseEW"; static const char __pyx_k_getUseFD[] = "getUseFD"; static const char __pyx_k_getUseMF[] = "getUseMF"; static const char __pyx_k_getValue[] = "getValue"; static const char __pyx_k_getstate[] = "__getstate__"; static const char __pyx_k_gradient[] = "gradient"; static const char __pyx_k_hasLabel[] = "hasLabel"; static const char __pyx_k_imagPart[] = "imagPart"; static const char __pyx_k_inblocks[] = "inblocks"; static const char __pyx_k_interior[] = "interior"; static const char __pyx_k_interval[] = "interval"; static const char __pyx_k_isActive[] = "isActive"; static const char __pyx_k_isSorted[] = "isSorted"; static const char __pyx_k_is_local[] = "is_local"; static const char __pyx_k_isfields[] = "isfields"; static const char __pyx_k_itemsize[] = "itemsize"; static const char __pyx_k_jacobian[] = "jacobian"; static const char __pyx_k_ksp_type[] = "ksp_type"; static const char __pyx_k_leafdata[] = "leafdata"; static const char __pyx_k_leafsize[] = "leafsize"; static const char __pyx_k_localsec[] = "localsec"; static const char __pyx_k_logFlops[] = "logFlops"; static const char __pyx_k_matApply[] = "matApply"; static const char __pyx_k_mat_type[] = "mat_type"; static const char __pyx_k_max_time[] = "max_time"; static const char __pyx_k_mpiabort[] = "mpiabort"; static const char __pyx_k_noInsert[] = "noInsert"; static const char __pyx_k_normtype[] = "normtype"; static const char __pyx_k_nsubcomm[] = "nsubcomm"; static const char __pyx_k_numProcs[] = "numProcs"; static const char __pyx_k_only_and[] = "only '==' and '!='"; static const char __pyx_k_operator[] = "operator"; static const char __pyx_k_ord_type[] = "ord_type"; static const char __pyx_k_parallel[] = "parallel"; static const char __pyx_k_periodic[] = "periodic"; static const char __pyx_k_plexname[] = "plexname"; static const char __pyx_k_position[] = "position"; static const char __pyx_k_postStep[] = "postStep"; static const char __pyx_k_poststep[] = "poststep"; static const char __pyx_k_preSolve[] = "preSolve"; static const char __pyx_k_precheck[] = "precheck"; static const char __pyx_k_property[] = "property"; static const char __pyx_k_pyx_type[] = "__pyx_type"; static const char __pyx_k_qualname[] = "__qualname__"; static const char __pyx_k_readonly[] = "readonly"; static const char __pyx_k_realPart[] = "realPart"; static const char __pyx_k_refine_x[] = "refine_x"; static const char __pyx_k_refine_y[] = "refine_y"; static const char __pyx_k_refine_z[] = "refine_z"; static const char __pyx_k_register[] = "register"; static const char __pyx_k_residual[] = "residual"; static const char __pyx_k_rnd_type[] = "rnd_type"; static const char __pyx_k_rollback[] = "rollback"; static const char __pyx_k_rootdata[] = "rootdata"; static const char __pyx_k_rtol_max[] = "rtol_max"; static const char __pyx_k_s_at_s_d[] = "%s() at %s:%d"; static const char __pyx_k_selected[] = "selected"; static const char __pyx_k_setSizes[] = "setSizes"; static const char __pyx_k_setUseEW[] = "setUseEW"; static const char __pyx_k_setUseFD[] = "setUseFD"; static const char __pyx_k_setUseMF[] = "setUseMF"; static const char __pyx_k_setValue[] = "setValue"; static const char __pyx_k_set_name[] = "__set_name__"; static const char __pyx_k_setstate[] = "__setstate__"; static const char __pyx_k_solveAdd[] = "solveAdd"; static const char __pyx_k_stderr_2[] = "__stderr__"; static const char __pyx_k_stdout_2[] = "__stdout__"; static const char __pyx_k_subminor[] = "subminor"; static const char __pyx_k_tao_type[] = "tao_type"; static const char __pyx_k_timestep[] = "timestep"; static const char __pyx_k_toDLPack[] = "toDLPack"; static const char __pyx_k_up_right[] = "up_right"; static const char __pyx_k_vec_from[] = "vec_from"; static const char __pyx_k_vec_type[] = "vec_type"; static const char __pyx_k_vwr_type[] = "vwr_type"; static const char __pyx_k_ALLGATHER[] = "ALLGATHER"; static const char __pyx_k_ARKIMEX2C[] = "ARKIMEX2C"; static const char __pyx_k_ARKIMEX2D[] = "ARKIMEX2D"; static const char __pyx_k_ARKIMEX2E[] = "ARKIMEX2E"; static const char __pyx_k_ARKIMEXA2[] = "ARKIMEXA2"; static const char __pyx_k_ARKIMEXL2[] = "ARKIMEXL2"; static const char __pyx_k_ASCII_CSV[] = "ASCII_CSV"; static const char __pyx_k_ASCII_VTK[] = "ASCII_VTK"; static const char __pyx_k_ASCII_XML[] = "ASCII_XML"; static const char __pyx_k_BACK_DOWN[] = "BACK_DOWN"; static const char __pyx_k_BACK_LEFT[] = "BACK_LEFT"; static const char __pyx_k_CHEBYSHEV[] = "CHEBYSHEV"; static const char __pyx_k_CLASSICAL[] = "CLASSICAL"; static const char __pyx_k_COMM_NULL[] = "COMM_NULL"; static const char __pyx_k_COMM_SELF[] = "COMM_SELF"; static const char __pyx_k_COMPOSITE[] = "COMPOSITE"; static const char __pyx_k_DEFLATION[] = "DEFLATION"; static const char __pyx_k_DENSECUDA[] = "DENSECUDA"; static const char __pyx_k_DETERMINE[] = "DETERMINE"; static const char __pyx_k_DIFFERENT[] = "DIFFERENT"; static const char __pyx_k_DIRK8614A[] = "DIRK8614A"; static const char __pyx_k_DIRKS659A[] = "DIRKS659A"; static const char __pyx_k_DOWN_LEFT[] = "DOWN_LEFT"; static const char __pyx_k_DualSpace[] = "DualSpace"; static const char __pyx_k_EISENSTAT[] = "EISENSTAT"; static const char __pyx_k_ELEMENTAL[] = "ELEMENTAL"; static const char __pyx_k_FROBENIUS[] = "FROBENIUS"; static const char __pyx_k_FULL_SIZE[] = "FULL_SIZE"; static const char __pyx_k_GLMapMode[] = "GLMapMode"; static const char __pyx_k_HALF_SIZE[] = "HALF_SIZE"; static const char __pyx_k_HDF5_XDMF[] = "HDF5_XDMF"; static const char __pyx_k_HERMITIAN[] = "HERMITIAN"; static const char __pyx_k_HPDDMType[] = "HPDDMType"; static const char __pyx_k_INSERT_BC[] = "INSERT_BC"; static const char __pyx_k_IS_buffer[] = "_IS_buffer"; static const char __pyx_k_ITERATING[] = "ITERATING"; static const char __pyx_k_LGMapType[] = "LGMapType"; static const char __pyx_k_MATCHSTEP[] = "MATCHSTEP"; static const char __pyx_k_MPIAIJCRL[] = "MPIAIJCRL"; static const char __pyx_k_MPIAIJMKL[] = "MPIAIJMKL"; static const char __pyx_k_MPIKOKKOS[] = "MPIKOKKOS"; static const char __pyx_k_MatOption[] = "MatOption"; static const char __pyx_k_NINFINITY[] = "NINFINITY"; static const char __pyx_k_NONLINEAR[] = "NONLINEAR"; static const char __pyx_k_NORM_NONE[] = "NORM_NONE"; static const char __pyx_k_NullSpace[] = "NullSpace"; static const char __pyx_k_PARDECOMP[] = "PARDECOMP"; static const char __pyx_k_PCASMType[] = "PCASMType"; static const char __pyx_k_PINFINITY[] = "PINFINITY"; static const char __pyx_k_RANDOM123[] = "RANDOM123"; static const char __pyx_k_REDUNDANT[] = "REDUNDANT"; static const char __pyx_k_REFINESBR[] = "REFINESBR"; static const char __pyx_k_ROWLENGTH[] = "ROWLENGTH"; static const char __pyx_k_SCALAPACK[] = "SCALAPACK"; static const char __pyx_k_SEQAIJCRL[] = "SEQAIJCRL"; static const char __pyx_k_SEQAIJMKL[] = "SEQAIJMKL"; static const char __pyx_k_SEQKOKKOS[] = "SEQKOKKOS"; static const char __pyx_k_SSML_BFGS[] = "SSML_BFGS"; static const char __pyx_k_SSML_BRDN[] = "SSML_BRDN"; static const char __pyx_k_STRUMPACK[] = "STRUMPACK"; static const char __pyx_k_SUBMATRIX[] = "SUBMATRIX"; static const char __pyx_k_SUBSET_NZ[] = "SUBSET_NZ"; static const char __pyx_k_SYMMETRIC[] = "SYMMETRIC"; static const char __pyx_k_SpaceType[] = "SpaceType"; static const char __pyx_k_Structure[] = "Structure"; static const char __pyx_k_TELESCOPE[] = "TELESCOPE"; static const char __pyx_k_TRANSPOSE[] = "TRANSPOSE"; static const char __pyx_k_TRI_PRISM[] = "TRI_PRISM"; static const char __pyx_k_TypeError[] = "TypeError"; static const char __pyx_k_VPBJACOBI[] = "VPBJACOBI"; static const char __pyx_k_VecOption[] = "VecOption"; static const char __pyx_k_adaptStep[] = "adaptStep"; static const char __pyx_k_back_down[] = "back_down"; static const char __pyx_k_back_left[] = "back_left"; static const char __pyx_k_batchSize[] = "batchSize"; static const char __pyx_k_blockSize[] = "blockSize"; static const char __pyx_k_blocksize[] = "blocksize"; static const char __pyx_k_col_bsize[] = "col_bsize"; static const char __pyx_k_conePoint[] = "conePoint"; static const char __pyx_k_conjugate[] = "conjugate"; static const char __pyx_k_converged[] = "converged"; static const char __pyx_k_createMat[] = "createMat"; static const char __pyx_k_decorator[] = "decorator"; static const char __pyx_k_device_id[] = "device_id"; static const char __pyx_k_direction[] = "direction"; static const char __pyx_k_down_left[] = "down_left"; static const char __pyx_k_duplicate[] = "duplicate"; static const char __pyx_k_elem_type[] = "elem_type"; static const char __pyx_k_end_kargs[] = "end_kargs"; static const char __pyx_k_enumerate[] = "enumerate"; static const char __pyx_k_fieldName[] = "fieldName"; static const char __pyx_k_fieldname[] = "fieldname"; static const char __pyx_k_functools[] = "functools"; static const char __pyx_k_getActive[] = "getActive"; static const char __pyx_k_getAppCtx[] = "getAppCtx"; static const char __pyx_k_getBuffer[] = "getBuffer"; static const char __pyx_k_getDevice[] = "getDevice"; static const char __pyx_k_getMatrix[] = "getMatrix"; static const char __pyx_k_getNumber[] = "getNumber"; static const char __pyx_k_getPCSide[] = "getPCSide"; static const char __pyx_k_getRanges[] = "getRanges"; static const char __pyx_k_getString[] = "getString"; static const char __pyx_k_globalsec[] = "globalsec"; static const char __pyx_k_hiphandle[] = "hiphandle"; static const char __pyx_k_hypretype[] = "hypretype"; static const char __pyx_k_indicator[] = "indicator"; static const char __pyx_k_infoAllow[] = "infoAllow"; static const char __pyx_k_isSimplex[] = "isSimplex"; static const char __pyx_k_isenabled[] = "isenabled"; static const char __pyx_k_isotropic[] = "isotropic"; static const char __pyx_k_jacobianp[] = "jacobianp"; static const char __pyx_k_join_mode[] = "join_mode"; static const char __pyx_k_labelName[] = "labelName"; static const char __pyx_k_maxDegree[] = "maxDegree"; static const char __pyx_k_max_fails[] = "max_fails"; static const char __pyx_k_max_funcs[] = "max_funcs"; static const char __pyx_k_max_steps[] = "max_steps"; static const char __pyx_k_metaclass[] = "__metaclass__"; static const char __pyx_k_metricAvg[] = "metricAvg"; static const char __pyx_k_metricInt[] = "metricInt"; static const char __pyx_k_norm_type[] = "norm_type"; static const char __pyx_k_normsched[] = "normsched"; static const char __pyx_k_numBlocks[] = "numBlocks"; static const char __pyx_k_numFields[] = "numFields"; static const char __pyx_k_objective[] = "objective"; static const char __pyx_k_operators[] = "operators"; static const char __pyx_k_package_2[] = "__package__"; static const char __pyx_k_part_type[] = "part_type"; static const char __pyx_k_postSolve[] = "postSolve"; static const char __pyx_k_postevent[] = "postevent"; static const char __pyx_k_pyx_state[] = "__pyx_state"; static const char __pyx_k_reduce_ex[] = "__reduce_ex__"; static const char __pyx_k_redundant[] = "redundant"; static const char __pyx_k_row_bsize[] = "row_bsize"; static const char __pyx_k_sectiondm[] = "sectiondm"; static const char __pyx_k_setActive[] = "setActive"; static const char __pyx_k_setAppCtx[] = "setAppCtx"; static const char __pyx_k_setDevice[] = "setDevice"; static const char __pyx_k_setOption[] = "setOption"; static const char __pyx_k_setPCSide[] = "setPCSide"; static const char __pyx_k_shifttype[] = "shifttype"; static const char __pyx_k_snes_type[] = "snes_type"; static const char __pyx_k_solveStep[] = "solveStep"; static const char __pyx_k_structure[] = "structure"; static const char __pyx_k_symmetric[] = "symmetric"; static const char __pyx_k_syncFlush[] = "syncFlush"; static const char __pyx_k_syncPrint[] = "syncPrint"; static const char __pyx_k_terminate[] = "terminate"; static const char __pyx_k_threshold[] = "threshold"; static const char __pyx_k_time_step[] = "time_step"; static const char __pyx_k_traceback[] = "_traceback_"; static const char __pyx_k_transpose[] = "transpose"; static const char __pyx_k_varbounds[] = "varbounds"; static const char __pyx_k_verbosity[] = "verbosity"; static const char __pyx_k_zeropivot[] = "zeropivot"; static const char __pyx_k_ADD_VALUES[] = "ADD_VALUES"; static const char __pyx_k_ALLGATHERV[] = "ALLGATHERV"; static const char __pyx_k_ASCII_IMPL[] = "ASCII_IMPL"; static const char __pyx_k_ASCII_INFO[] = "ASCII_INFO"; static const char __pyx_k_BACK_RIGHT[] = "BACK_RIGHT"; static const char __pyx_k_COMM_WORLD[] = "COMM_WORLD"; static const char __pyx_k_DOWN_RIGHT[] = "DOWN_RIGHT"; static const char __pyx_k_DRAW_BASIC[] = "DRAW_BASIC"; static const char __pyx_k_DRAW_PORTS[] = "DRAW_PORTS"; static const char __pyx_k_DeviceType[] = "DeviceType"; static const char __pyx_k_FIELDSPLIT[] = "FIELDSPLIT"; static const char __pyx_k_FINAL_ONLY[] = "FINAL_ONLY"; static const char __pyx_k_FRONT_DOWN[] = "FRONT_DOWN"; static const char __pyx_k_FRONT_LEFT[] = "FRONT_LEFT"; static const char __pyx_k_GLOBAL_MAX[] = "GLOBAL_MAX"; static const char __pyx_k_GLOBAL_SUM[] = "GLOBAL_SUM"; static const char __pyx_k_HDF5_PETSC[] = "HDF5_PETSC"; static const char __pyx_k_HEXAHEDRON[] = "HEXAHEDRON"; static const char __pyx_k_INSERT_ALL[] = "INSERT_ALL"; static const char __pyx_k_IndexError[] = "IndexError"; static const char __pyx_k_InsertMode[] = "InsertMode"; static const char __pyx_k_MAX_VALUES[] = "MAX_VALUES"; static const char __pyx_k_MPIAIJPERM[] = "MPIAIJPERM"; static const char __pyx_k_MPIAIJSELL[] = "MPIAIJSELL"; static const char __pyx_k_MPIBAIJMKL[] = "MPIBAIJMKL"; static const char __pyx_k_MatSORType[] = "MatSORType"; static const char __pyx_k_ND_Pi_Full[] = "ND_Pi_Full"; static const char __pyx_k_OPTION_MAX[] = "OPTION_MAX"; static const char __pyx_k_OPTION_MIN[] = "OPTION_MIN"; static const char __pyx_k_PCGAMGType[] = "PCGAMGType"; static const char __pyx_k_PCGASMType[] = "PCGASMType"; static const char __pyx_k_PIPEFGMRES[] = "PIPEFGMRES"; static const char __pyx_k_POLYNOMIAL[] = "POLYNOMIAL"; static const char __pyx_k_RICHARDSON[] = "RICHARDSON"; static const char __pyx_k_RT_Pi_Full[] = "RT_Pi_Full"; static const char __pyx_k_RandomType[] = "RandomType"; static const char __pyx_k_SAVIENNACL[] = "SAVIENNACL"; static const char __pyx_k_SEQAIJPERM[] = "SEQAIJPERM"; static const char __pyx_k_SEQAIJSELL[] = "SEQAIJSELL"; static const char __pyx_k_SEQBAIJMKL[] = "SEQBAIJMKL"; static const char __pyx_k_ScalarType[] = "ScalarType"; static const char __pyx_k_SolverType[] = "SolverType"; static const char __pyx_k_StreamType[] = "StreamType"; static const char __pyx_k_THIRD_SIZE[] = "THIRD_SIZE"; static const char __pyx_k_TSDIRKType[] = "TSDIRKType"; static const char __pyx_k_UNKNOWN_NZ[] = "UNKNOWN_NZ"; static const char __pyx_k_USE_INODES[] = "USE_INODES"; static const char __pyx_k_ValueError[] = "ValueError"; static const char __pyx_k_Vec_buffer[] = "_Vec_buffer"; static const char __pyx_k_ViewerHDF5[] = "ViewerHDF5"; static const char __pyx_k_ViewerType[] = "ViewerType"; static const char __pyx_k_assemblies[] = "assemblies"; static const char __pyx_k_authorinfo[] = "authorinfo"; static const char __pyx_k_back_right[] = "back_right"; static const char __pyx_k_begin_args[] = "begin_args"; static const char __pyx_k_block_size[] = "block_size"; static const char __pyx_k_compressed[] = "compressed"; static const char __pyx_k_conforming[] = "conforming"; static const char __pyx_k_continuous[] = "continuous"; static const char __pyx_k_createVecs[] = "createVecs"; static const char __pyx_k_cudahandle[] = "cudahandle"; static const char __pyx_k_cycle_type[] = "cycle_type"; static const char __pyx_k_down_right[] = "down_right"; static const char __pyx_k_empty_name[] = "empty name"; static const char __pyx_k_errhandler[] = "errhandler"; static const char __pyx_k_fieldnames[] = "fieldnames"; static const char __pyx_k_fill_param[] = "fill_param"; static const char __pyx_k_formDegree[] = "formDegree"; static const char __pyx_k_front_down[] = "front_down"; static const char __pyx_k_front_left[] = "front_left"; static const char __pyx_k_functional[] = "functional"; static const char __pyx_k_getCPUTime[] = "getCPUTime"; static const char __pyx_k_getClassId[] = "getClassId"; static const char __pyx_k_getCorners[] = "getCorners"; static const char __pyx_k_getCurrent[] = "getCurrent"; static const char __pyx_k_getIndices[] = "getIndices"; static const char __pyx_k_getMaxTime[] = "getMaxTime"; static const char __pyx_k_getSection[] = "getSection"; static const char __pyx_k_getStencil[] = "getStencil"; static const char __pyx_k_getVecLeft[] = "getVecLeft"; static const char __pyx_k_getVersion[] = "getVersion"; static const char __pyx_k_getVisible[] = "getVisible"; static const char __pyx_k_hpddm_type[] = "hpddm_type"; static const char __pyx_k_initialize[] = "_initialize"; static const char __pyx_k_isIdentity[] = "isIdentity"; static const char __pyx_k_layoutType[] = "layoutType"; static const char __pyx_k_leafupdate[] = "leafupdate"; static const char __pyx_k_lgmap_type[] = "lgmap_type"; static const char __pyx_k_linear_its[] = "linear_its"; static const char __pyx_k_mpi4py_MPI[] = "mpi4py.MPI"; static const char __pyx_k_numBatches[] = "numBatches"; static const char __pyx_k_proc_sizes[] = "proc_sizes"; static const char __pyx_k_pyx_result[] = "__pyx_result"; static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static const char __pyx_k_reciprocal[] = "reciprocal"; static const char __pyx_k_scatterEnd[] = "scatterEnd"; static const char __pyx_k_setCurrent[] = "setCurrent"; static const char __pyx_k_setInitial[] = "setInitial"; static const char __pyx_k_setMaxTime[] = "setMaxTime"; static const char __pyx_k_setMonitor[] = "setMonitor"; static const char __pyx_k_setSection[] = "setSection"; static const char __pyx_k_setVisible[] = "setVisible"; static const char __pyx_k_shift_type[] = "shift_type"; static const char __pyx_k_space_type[] = "space_type"; static const char __pyx_k_startswith[] = "startswith"; static const char __pyx_k_useAnchors[] = "useAnchors"; static const char __pyx_k_useClosure[] = "useClosure"; static const char __pyx_k_AGGREGATION[] = "AGGREGATION"; static const char __pyx_k_AIJCUSPARSE[] = "AIJCUSPARSE"; static const char __pyx_k_AIJVIENNACL[] = "AIJVIENNACL"; static const char __pyx_k_APPLY_LOWER[] = "APPLY_LOWER"; static const char __pyx_k_APPLY_UPPER[] = "APPLY_UPPER"; static const char __pyx_k_ARKIMEX1BEE[] = "ARKIMEX1BEE"; static const char __pyx_k_ARKIMEXBPR3[] = "ARKIMEXBPR3"; static const char __pyx_k_ARKIMEXType[] = "ARKIMEXType"; static const char __pyx_k_ASCII_DENSE[] = "ASCII_DENSE"; static const char __pyx_k_ASCII_GLVIS[] = "ASCII_GLVIS"; static const char __pyx_k_ASCII_INDEX[] = "ASCII_INDEX"; static const char __pyx_k_ASCII_LATEX[] = "ASCII_LATEX"; static const char __pyx_k_ASCII_PCICE[] = "ASCII_PCICE"; static const char __pyx_k_COPY_VALUES[] = "COPY_VALUES"; static const char __pyx_k_CollectType[] = "CollectType"; static const char __pyx_k_ComplexType[] = "ComplexType"; static const char __pyx_k_DIRK7510SAL[] = "DIRK7510SAL"; static const char __pyx_k_DIRK8616SAL[] = "DIRK8616SAL"; static const char __pyx_k_DIRKES648SA[] = "DIRKES648SA"; static const char __pyx_k_DMComposite[] = "DMComposite"; static const char __pyx_k_DMSwarmType[] = "DMSwarmType"; static const char __pyx_k_ElementType[] = "ElementType"; static const char __pyx_k_Error___str[] = "Error.__str__"; static const char __pyx_k_FRONT_RIGHT[] = "FRONT_RIGHT"; static const char __pyx_k_HALTED_RTOL[] = "HALTED_RTOL"; static const char __pyx_k_HALTED_USER[] = "HALTED_USER"; static const char __pyx_k_HYPRESTRUCT[] = "HYPRESTRUCT"; static const char __pyx_k_INTERPOLATE[] = "INTERPOLATE"; static const char __pyx_k_KSPNormType[] = "KSPNormType"; static const char __pyx_k_LMVMBROYDEN[] = "LMVMBROYDEN"; static const char __pyx_k_MATHEMATICA[] = "MATHEMATICA"; static const char __pyx_k_MGCycleType[] = "MGCycleType"; static const char __pyx_k_MKL_PARDISO[] = "MKL_PARDISO"; static const char __pyx_k_MORETHUENTE[] = "MORETHUENTE"; static const char __pyx_k_MPIVIENNACL[] = "MPIVIENNACL"; static const char __pyx_k_MatInfoType[] = "MatInfoType"; static const char __pyx_k_MemoryError[] = "MemoryError"; static const char __pyx_k_MigrateType[] = "MigrateType"; static const char __pyx_k_NORM_ALWAYS[] = "NORM_ALWAYS"; static const char __pyx_k_NRICHARDSON[] = "NRICHARDSON"; static const char __pyx_k_Partitioner[] = "Partitioner"; static const char __pyx_k_PickleError[] = "PickleError"; static const char __pyx_k_ProblemType[] = "ProblemType"; static const char __pyx_k_REFINETOBOX[] = "REFINETOBOX"; static const char __pyx_k_RUNGE_KUTTA[] = "RUNGE_KUTTA"; static const char __pyx_k_SEQVIENNACL[] = "SEQVIENNACL"; static const char __pyx_k_SETUP_ERROR[] = "SETUP_ERROR"; static const char __pyx_k_SORTED_FULL[] = "SORTED_FULL"; static const char __pyx_k_SUBPC_ERROR[] = "SUBPC_ERROR"; static const char __pyx_k_ScatterMode[] = "ScatterMode"; static const char __pyx_k_ScatterType[] = "ScatterType"; static const char __pyx_k_StencilType[] = "StencilType"; static const char __pyx_k_SystemError[] = "SystemError"; static const char __pyx_k_TAOBNCGType[] = "TAOBNCGType"; static const char __pyx_k_TETRAHEDRON[] = "TETRAHEDRON"; static const char __pyx_k_UNSPECIFIED[] = "UNSPECIFIED"; static const char __pyx_k_Viewer_type[] = "Viewer type."; static const char __pyx_k_Window_size[] = "Window size."; static const char __pyx_k_assemblyEnd[] = "assemblyEnd"; static const char __pyx_k_begin_kargs[] = "begin_kargs"; static const char __pyx_k_coarsenhook[] = "coarsenhook"; static const char __pyx_k_collections[] = "collections"; static const char __pyx_k_concatenate[] = "concatenate"; static const char __pyx_k_constraints[] = "constraints"; static const char __pyx_k_coordinates[] = "coordinates"; static const char __pyx_k_createLabel[] = "createLabel"; static const char __pyx_k_create_gvec[] = "create_gvec"; static const char __pyx_k_create_lvec[] = "create_lvec"; static const char __pyx_k_determinant[] = "determinant"; static const char __pyx_k_device_type[] = "device_type"; static const char __pyx_k_entityDepth[] = "entityDepth"; static const char __pyx_k_front_right[] = "front_right"; static const char __pyx_k_getDeviceId[] = "getDeviceId"; static const char __pyx_k_getDiagonal[] = "getDiagonal"; static const char __pyx_k_getGradient[] = "getGradient"; static const char __pyx_k_getInterval[] = "getInterval"; static const char __pyx_k_getMaxSteps[] = "getMaxSteps"; static const char __pyx_k_getNormType[] = "getNormType"; static const char __pyx_k_getNumberDM[] = "getNumberDM"; static const char __pyx_k_getRefCount[] = "getRefCount"; static const char __pyx_k_getSolution[] = "getSolution"; static const char __pyx_k_getTimeStep[] = "getTimeStep"; static const char __pyx_k_getVecRight[] = "getVecRight"; static const char __pyx_k_hasLagrange[] = "hasLagrange"; static const char __pyx_k_interp_type[] = "interp_type"; static const char __pyx_k_interpolate[] = "interpolate"; static const char __pyx_k_isAssembled[] = "isAssembled"; static const char __pyx_k_isFinalized[] = "isFinalized"; static const char __pyx_k_isHermitian[] = "isHermitian"; static const char __pyx_k_isSymmetric[] = "isSymmetric"; static const char __pyx_k_leafSection[] = "leafSection"; static const char __pyx_k_mro_entries[] = "__mro_entries__"; static const char __pyx_k_numMessages[] = "numMessages"; static const char __pyx_k_nz_unneeded[] = "nz_unneeded"; static const char __pyx_k_orientation[] = "orientation"; static const char __pyx_k_permutation[] = "permutation"; static const char __pyx_k_py_sub_ctxs[] = "py_sub_ctxs"; static const char __pyx_k_rootSection[] = "rootSection"; static const char __pyx_k_setDiagonal[] = "setDiagonal"; static const char __pyx_k_setInterval[] = "setInterval"; static const char __pyx_k_setMaxSteps[] = "setMaxSteps"; static const char __pyx_k_setNormType[] = "setNormType"; static const char __pyx_k_setParamsEW[] = "setParamsEW"; static const char __pyx_k_setSolution[] = "setSolution"; static const char __pyx_k_setTimeStep[] = "setTimeStep"; static const char __pyx_k_shiftamount[] = "shiftamount"; static const char __pyx_k_stenciltype[] = "stenciltype"; static const char __pyx_k_step_number[] = "step_number"; static const char __pyx_k_stream_type[] = "stream_type"; static const char __pyx_k_traceback_2[] = "traceback"; static const char __pyx_k_zeroEntries[] = "zeroEntries"; static const char __pyx_k_ASCII_COMMON[] = "ASCII_COMMON"; static const char __pyx_k_ASCII_MATLAB[] = "ASCII_MATLAB"; static const char __pyx_k_ASCII_PYTHON[] = "ASCII_PYTHON"; static const char __pyx_k_AssemblyType[] = "AssemblyType"; static const char __pyx_k_BACK_UP_LEFT[] = "BACK_UP_LEFT"; static const char __pyx_k_BoundaryType[] = "BoundaryType"; static const char __pyx_k_COLLECT_USER[] = "COLLECT_USER"; static const char __pyx_k_DIFFERENT_NZ[] = "DIFFERENT_NZ"; static const char __pyx_k_DIRKES122SAL[] = "DIRKES122SAL"; static const char __pyx_k_DIRKES213SAL[] = "DIRKES213SAL"; static const char __pyx_k_DIRKES324SAL[] = "DIRKES324SAL"; static const char __pyx_k_DIRKES325SAL[] = "DIRKES325SAL"; static const char __pyx_k_DIRKES7510SA[] = "DIRKES7510SA"; static const char __pyx_k_DIRKS7511SAL[] = "DIRKS7511SAL"; static const char __pyx_k_DIVERGED_NAN[] = "DIVERGED_NAN"; static const char __pyx_k_DRAW_CONTOUR[] = "DRAW_CONTOUR"; static const char __pyx_k_EquationType[] = "EquationType"; static const char __pyx_k_Error___bool[] = "Error.__bool__"; static const char __pyx_k_Error___init[] = "Error.__init__"; static const char __pyx_k_Error___repr[] = "Error.__repr__"; static const char __pyx_k_FACTOR_OTHER[] = "FACTOR_OTHER"; static const char __pyx_k_FailedReason[] = "FailedReason"; static const char __pyx_k_HALTED_OTHER[] = "HALTED_OTHER"; static const char __pyx_k_HYPRESSTRUCT[] = "HYPRESSTRUCT"; static const char __pyx_k_INITIAL_ONLY[] = "INITIAL_ONLY"; static const char __pyx_k_KSPHPDDMType[] = "KSPHPDDMType"; static const char __pyx_k_LAYOUT_GAUSS[] = "LAYOUT_GAUSS"; static const char __pyx_k_LOAD_BALANCE[] = "LOAD_BALANCE"; static const char __pyx_k_MIGRATE_USER[] = "MIGRATE_USER"; static const char __pyx_k_MKL_CPARDISO[] = "MKL_CPARDISO"; static const char __pyx_k_MPIDENSECUDA[] = "MPIDENSECUDA"; static const char __pyx_k_MatStructure[] = "MatStructure"; static const char __pyx_k_NORM_1_AND_2[] = "NORM_1_AND_2"; static const char __pyx_k_NORM_DEFAULT[] = "NORM_DEFAULT"; static const char __pyx_k_NORM_NATURAL[] = "NORM_NATURAL"; static const char __pyx_k_NormSchedule[] = "NormSchedule"; static const char __pyx_k_Not_for_type[] = "Not for type {}"; static const char __pyx_k_ODE_EXPLICIT[] = "ODE_EXPLICIT"; static const char __pyx_k_ODE_IMPLICIT[] = "ODE_IMPLICIT"; static const char __pyx_k_OrderingType[] = "OrderingType"; static const char __pyx_k_PREALLOCATOR[] = "PREALLOCATOR"; static const char __pyx_k_PolytopeType[] = "PolytopeType"; static const char __pyx_k_QUARTER_SIZE[] = "QUARTER_SIZE"; static const char __pyx_k_REDISTRIBUTE[] = "REDISTRIBUTE"; static const char __pyx_k_REFINEALFELD[] = "REFINEALFELD"; static const char __pyx_k_ROW_ORIENTED[] = "ROW_ORIENTED"; static const char __pyx_k_RuntimeError[] = "RuntimeError"; static const char __pyx_k_SEQDENSECUDA[] = "SEQDENSECUDA"; static const char __pyx_k_SUCCESS_USER[] = "SUCCESS_USER"; static const char __pyx_k_SUPERLU_DIST[] = "SUPERLU_DIST"; static const char __pyx_k_SchurPreType[] = "SchurPreType"; static const char __pyx_k_VINEWTONRSLS[] = "VINEWTONRSLS"; static const char __pyx_k_VINEWTONSSLS[] = "VINEWTONSSLS"; static const char __pyx_k_ViewerFormat[] = "ViewerFormat"; static const char __pyx_k_back_up_left[] = "back_up_left"; static const char __pyx_k_cdevice_type[] = "cdevice_type"; static const char __pyx_k_cellNodeMaps[] = "cellNodeMaps"; static const char __pyx_k_createMatrix[] = "createMatrix"; static const char __pyx_k_create_subdm[] = "create_subdm"; static const char __pyx_k_dmswarm_type[] = "dmswarm_type"; static const char __pyx_k_error_code_d[] = "error code %d"; static const char __pyx_k_evaluatestep[] = "evaluatestep"; static const char __pyx_k_eventhandler[] = "eventhandler"; static const char __pyx_k_garbage_view[] = "garbage_view"; static const char __pyx_k_getActiveAll[] = "getActiveAll"; static const char __pyx_k_getBlockInfo[] = "getBlockInfo"; static const char __pyx_k_getBlockSize[] = "getBlockSize"; static const char __pyx_k_getClassName[] = "getClassName"; static const char __pyx_k_getDefaultSF[] = "getDefaultSF"; static const char __pyx_k_getDimension[] = "getDimension"; static const char __pyx_k_getLocalSize[] = "getLocalSize"; static const char __pyx_k_getOperators[] = "getOperators"; static const char __pyx_k_getProcSizes[] = "getProcSizes"; static const char __pyx_k_getSectionSF[] = "getSectionSF"; static const char __pyx_k_ghostBcNodes[] = "ghostBcNodes"; static const char __pyx_k_initialguess[] = "initialguess"; static const char __pyx_k_initializing[] = "_initializing"; static const char __pyx_k_is_coroutine[] = "_is_coroutine"; static const char __pyx_k_numSumSpaces[] = "numSumSpaces"; static const char __pyx_k_nz_allocated[] = "nz_allocated"; static const char __pyx_k_partitioning[] = "partitioning"; static const char __pyx_k_pre_finalize[] = "_pre_finalize"; static const char __pyx_k_pyx_checksum[] = "__pyx_checksum"; static const char __pyx_k_restricthook[] = "restricthook"; static const char __pyx_k_rhsjacobianp[] = "rhsjacobianp"; static const char __pyx_k_scatterBegin[] = "scatterBegin"; static const char __pyx_k_scatter_type[] = "scatter_type"; static const char __pyx_k_setActiveAll[] = "setActiveAll"; static const char __pyx_k_setDefaultSF[] = "setDefaultSF"; static const char __pyx_k_setDimension[] = "setDimension"; static const char __pyx_k_setSectionSF[] = "setSectionSF"; static const char __pyx_k_staticmethod[] = "staticmethod"; static const char __pyx_k_stencil_type[] = "stencil_type"; static const char __pyx_k_stringsource[] = ""; static const char __pyx_k_version_info[] = "version_info"; static const char __pyx_k_wrapped_func[] = "wrapped_func"; static const char __pyx_k_ADD_BC_VALUES[] = "ADD_BC_VALUES"; static const char __pyx_k_APPEND_UPDATE[] = "APPEND_UPDATE"; static const char __pyx_k_ARKIMEXARS122[] = "ARKIMEXARS122"; static const char __pyx_k_ARKIMEXARS443[] = "ARKIMEXARS443"; static const char __pyx_k_ARKIMEXPRSSP2[] = "ARKIMEXPRSSP2"; static const char __pyx_k_ASCII_SYMMODU[] = "ASCII_SYMMODU"; static const char __pyx_k_BACK_UP_RIGHT[] = "BACK_UP_RIGHT"; static const char __pyx_k_BINARY_MATLAB[] = "BINARY_MATLAB"; static const char __pyx_k_COLLECT_BASIC[] = "COLLECT_BASIC"; static const char __pyx_k_CONVERGED_ITS[] = "CONVERGED_ITS"; static const char __pyx_k_CompositeType[] = "CompositeType"; static const char __pyx_k_DIRKES8516SAL[] = "DIRKES8516SAL"; static const char __pyx_k_DIVERGED_DTOL[] = "DIVERGED_DTOL"; static const char __pyx_k_DIVERGED_NULL[] = "DIVERGED_NULL"; static const char __pyx_k_DIVERGED_USER[] = "DIVERGED_USER"; static const char __pyx_k_DeviceContext[] = "DeviceContext"; static const char __pyx_k_DualSpaceType[] = "DualSpaceType"; static const char __pyx_k_FAILED_ASCENT[] = "FAILED_ASCENT"; static const char __pyx_k_FORWARD_LOCAL[] = "FORWARD_LOCAL"; static const char __pyx_k_FORWARD_SWEEP[] = "FORWARD_SWEEP"; static const char __pyx_k_FRONT_UP_LEFT[] = "FRONT_UP_LEFT"; static const char __pyx_k_HALTED_MAXFCN[] = "HALTED_MAXFCN"; static const char __pyx_k_INSERT_VALUES[] = "INSERT_VALUES"; static const char __pyx_k_MIGRATE_BASIC[] = "MIGRATE_BASIC"; static const char __pyx_k_MatSolverType[] = "MatSolverType"; static const char __pyx_k_NORM_INFINITY[] = "NORM_INFINITY"; static const char __pyx_k_PCMGCycleType[] = "PCMGCycleType"; static const char __pyx_k_PETSc_Error_d[] = "PETSc.Error(%d)"; static const char __pyx_k_PICLayoutType[] = "PICLayoutType"; static const char __pyx_k_QUADRILATERAL[] = "QUADRILATERAL"; static const char __pyx_k_REFINEREGULAR[] = "REFINEREGULAR"; static const char __pyx_k_REVERSE_LOCAL[] = "REVERSE_LOCAL"; static const char __pyx_k_SchurFactType[] = "SchurFactType"; static const char __pyx_k_TAOLineSearch[] = "TAOLineSearch"; static const char __pyx_k_TSARKIMEXType[] = "TSARKIMEXType"; static const char __pyx_k_TSProblemType[] = "TSProblemType"; static const char __pyx_k_Vec_LocalForm[] = "_Vec_LocalForm"; static const char __pyx_k_Viewer_format[] = "Viewer format."; static const char __pyx_k_adjoint_steps[] = "adjoint_steps"; static const char __pyx_k_assemblyBegin[] = "assemblyBegin"; static const char __pyx_k_back_up_right[] = "back_up_right"; static const char __pyx_k_boundary_type[] = "boundary_type"; static const char __pyx_k_buildResidual[] = "buildResidual"; static const char __pyx_k_buildSolution[] = "buildSolution"; static const char __pyx_k_cancelMonitor[] = "cancelMonitor"; static const char __pyx_k_class_getitem[] = "__class_getitem__"; static const char __pyx_k_createVecLeft[] = "createVecLeft"; static const char __pyx_k_create_matrix[] = "create_matrix"; static const char __pyx_k_diagonalScale[] = "diagonalScale"; static const char __pyx_k_diagonal_fill[] = "diagonal_fill"; static const char __pyx_k_front_up_left[] = "front_up_left"; static const char __pyx_k_getBlockSizes[] = "getBlockSizes"; static const char __pyx_k_getDeviceType[] = "getDeviceType"; static const char __pyx_k_getLocalSizes[] = "getLocalSizes"; static const char __pyx_k_getStepNumber[] = "getStepNumber"; static const char __pyx_k_getStreamType[] = "getStreamType"; static const char __pyx_k_getTolerances[] = "getTolerances"; static const char __pyx_k_globalBcNodes[] = "globalBcNodes"; static const char __pyx_k_init_subclass[] = "__init_subclass__"; static const char __pyx_k_isInitialized[] = "isInitialized"; static const char __pyx_k_isPermutation[] = "isPermutation"; static const char __pyx_k_messageLength[] = "messageLength"; static const char __pyx_k_monitorCancel[] = "monitorCancel"; static const char __pyx_k_multHermitian[] = "multHermitian"; static const char __pyx_k_multTranspose[] = "multTranspose"; static const char __pyx_k_multirootdata[] = "multirootdata"; static const char __pyx_k_numReductions[] = "numReductions"; static const char __pyx_k_numTensSpaces[] = "numTensSpaces"; static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; static const char __pyx_k_remoteOffsets[] = "remoteOffsets"; static const char __pyx_k_restrictSizes[] = "restrictSizes"; static const char __pyx_k_setStepNumber[] = "setStepNumber"; static const char __pyx_k_setStreamType[] = "setStreamType"; static const char __pyx_k_setTolerances[] = "setTolerances"; static const char __pyx_k_stencil_width[] = "stencil_width"; static const char __pyx_k_stepTranspose[] = "stepTranspose"; static const char __pyx_k_type_registry[] = "__type_registry__"; static const char __pyx_k_ADD_ALL_VALUES[] = "ADD_ALL_VALUES"; static const char __pyx_k_ASCII_VTK_CELL[] = "ASCII_VTK_CELL"; static const char __pyx_k_AssertionError[] = "AssertionError"; static const char __pyx_k_AttributeError[] = "AttributeError"; static const char __pyx_k_BACKWARD_SWEEP[] = "BACKWARD_SWEEP"; static const char __pyx_k_BACK_DOWN_LEFT[] = "BACK_DOWN_LEFT"; static const char __pyx_k_CONVERGED_ATOL[] = "CONVERGED_ATOL"; static const char __pyx_k_CONVERGED_MINF[] = "CONVERGED_MINF"; static const char __pyx_k_CONVERGED_RTOL[] = "CONVERGED_RTOL"; static const char __pyx_k_CONVERGED_TIME[] = "CONVERGED_TIME"; static const char __pyx_k_CONVERGED_USER[] = "CONVERGED_USER"; static const char __pyx_k_CRANK_NICOLSON[] = "CRANK_NICOLSON"; static const char __pyx_k_DIVERGED_INNER[] = "DIVERGED_INNER"; static const char __pyx_k_DMBoundaryType[] = "DMBoundaryType"; static const char __pyx_k_DMDA_Vec_array[] = "_DMDA_Vec_array"; static const char __pyx_k_DMPolytopeType[] = "DMPolytopeType"; static const char __pyx_k_DRAW_LG_XRANGE[] = "DRAW_LG_XRANGE"; static const char __pyx_k_DeviceJoinMode[] = "DeviceJoinMode"; static const char __pyx_k_EventDecorator[] = "EventDecorator"; static const char __pyx_k_ExactFinalTime[] = "ExactFinalTime"; static const char __pyx_k_FINAL_ASSEMBLY[] = "FINAL_ASSEMBLY"; static const char __pyx_k_FLUSH_ASSEMBLY[] = "FLUSH_ASSEMBLY"; static const char __pyx_k_FRONT_UP_RIGHT[] = "FRONT_UP_RIGHT"; static const char __pyx_k_INTERIOR_GHOST[] = "INTERIOR_GHOST"; static const char __pyx_k_LAYOUT_REGULAR[] = "LAYOUT_REGULAR"; static const char __pyx_k_LMVMBADBROYDEN[] = "LMVMBADBROYDEN"; static const char __pyx_k_LMVMSYMBROYDEN[] = "LMVMSYMBROYDEN"; static const char __pyx_k_MEMORYSCALABLE[] = "MEMORYSCALABLE"; static const char __pyx_k_MPIAIJCUSPARSE[] = "MPIAIJCUSPARSE"; static const char __pyx_k_MPIAIJVIENNACL[] = "MPIAIJVIENNACL"; static const char __pyx_k_MULTIPLICATIVE[] = "MULTIPLICATIVE"; static const char __pyx_k_NORM_FROBENIUS[] = "NORM_FROBENIUS"; static const char __pyx_k_NOT_SET_VALUES[] = "NOT_SET_VALUES"; static const char __pyx_k_NotImplemented[] = "NotImplemented"; static const char __pyx_k_PCFailedReason[] = "PCFailedReason"; static const char __pyx_k_PRECONDITIONED[] = "PRECONDITIONED"; static const char __pyx_k_SEQAIJCUSPARSE[] = "SEQAIJCUSPARSE"; static const char __pyx_k_SEQAIJVIENNACL[] = "SEQAIJVIENNACL"; static const char __pyx_k_STRUCTURE_ONLY[] = "STRUCTURE_ONLY"; static const char __pyx_k_SYMMETRY_SWEEP[] = "SYMMETRY_SWEEP"; static const char __pyx_k_TSEquationType[] = "TSEquationType"; static const char __pyx_k_The_MG_subtype[] = "The *MG* subtype."; static const char __pyx_k_The_RK_subtype[] = "The *RK* subtype."; static const char __pyx_k_USE_HASH_TABLE[] = "USE_HASH_TABLE"; static const char __pyx_k_ViewerDrawSize[] = "ViewerDrawSize"; static const char __pyx_k_ViewerFileMode[] = "ViewerFileMode"; static const char __pyx_k_applyTranspose[] = "applyTranspose"; static const char __pyx_k_back_down_left[] = "back_down_left"; static const char __pyx_k_boundary_types[] = "boundary_types"; static const char __pyx_k_createLocalVec[] = "createLocalVec"; static const char __pyx_k_createVecRight[] = "createVecRight"; static const char __pyx_k_dualspace_type[] = "dualspace_type"; static const char __pyx_k_empty_citation[] = "empty citation"; static const char __pyx_k_factor_mallocs[] = "factor_mallocs"; static const char __pyx_k_front_up_right[] = "front_up_right"; static const char __pyx_k_getDefaultComm[] = "getDefaultComm"; static const char __pyx_k_getGhostRanges[] = "getGhostRanges"; static const char __pyx_k_getGlobalSizes[] = "getGlobalSizes"; static const char __pyx_k_getKSPFailures[] = "getKSPFailures"; static const char __pyx_k_getProblemType[] = "getProblemType"; static const char __pyx_k_getStencilType[] = "getStencilType"; static const char __pyx_k_getVersionInfo[] = "getVersionInfo"; static const char __pyx_k_jacobian_state[] = "jacobian_state"; static const char __pyx_k_petsc4py_PETSc[] = "petsc4py.PETSc"; static const char __pyx_k_productNumeric[] = "productNumeric"; static const char __pyx_k_setDefaultComm[] = "setDefaultComm"; static const char __pyx_k_setDefaultType[] = "setDefaultType"; static const char __pyx_k_setFromOptions[] = "setFromOptions"; static const char __pyx_k_setProblemType[] = "setProblemType"; static const char __pyx_k_solveTranspose[] = "solveTranspose"; static const char __pyx_k_splitOwnership[] = "splitOwnership"; static const char __pyx_k_staticproperty[] = "staticproperty"; static const char __pyx_k_BACK_DOWN_RIGHT[] = "BACK_DOWN_RIGHT"; static const char __pyx_k_BASICSYMPLECTIC[] = "BASICSYMPLECTIC"; static const char __pyx_k_CHOWILUVIENNACL[] = "CHOWILUVIENNACL"; static const char __pyx_k_COLLECT_GENERAL[] = "COLLECT_GENERAL"; static const char __pyx_k_CONTINUE_SEARCH[] = "CONTINUE_SEARCH"; static const char __pyx_k_CONVERGED_EVENT[] = "CONVERGED_EVENT"; static const char __pyx_k_CONVERGED_GATOL[] = "CONVERGED_GATOL"; static const char __pyx_k_CONVERGED_GRTOL[] = "CONVERGED_GRTOL"; static const char __pyx_k_CONVERGED_GTTOL[] = "CONVERGED_GTTOL"; static const char __pyx_k_ConvergedReason[] = "ConvergedReason"; static const char __pyx_k_DIVERGED_MAXFCN[] = "DIVERGED_MAXFCN"; static const char __pyx_k_DIVERGED_MAXITS[] = "DIVERGED_MAXITS"; static const char __pyx_k_DIVERGED_MAX_IT[] = "DIVERGED_MAX_IT"; static const char __pyx_k_DMDAElementType[] = "DMDAElementType"; static const char __pyx_k_DMDAStencilType[] = "DMDAStencilType"; static const char __pyx_k_DMInterpolation[] = "DMInterpolation"; static const char __pyx_k_DMPlexTransform[] = "DMPlexTransform"; static const char __pyx_k_DuplicateOption[] = "DuplicateOption"; static const char __pyx_k_FAILED_INFORNAN[] = "FAILED_INFORNAN"; static const char __pyx_k_FRONT_DOWN_LEFT[] = "FRONT_DOWN_LEFT"; static const char __pyx_k_FactorShiftType[] = "FactorShiftType"; static const char __pyx_k_GLOBAL_BLOCKING[] = "GLOBAL_BLOCKING"; static const char __pyx_k_MATPARTITIONING[] = "MATPARTITIONING"; static const char __pyx_k_MatAssemblyType[] = "MatAssemblyType"; static const char __pyx_k_MatOrderingType[] = "MatOrderingType"; static const char __pyx_k_MatPartitioning[] = "MatPartitioning"; static const char __pyx_k_NORMALHERMITIAN[] = "NORMALHERMITIAN"; static const char __pyx_k_NORM_FINAL_ONLY[] = "NORM_FINAL_ONLY"; static const char __pyx_k_PCCompositeType[] = "PCCompositeType"; static const char __pyx_k_PartitionerType[] = "PartitionerType"; static const char __pyx_k_REFINETOSIMPLEX[] = "REFINETOSIMPLEX"; static const char __pyx_k_SCATTER_FORWARD[] = "SCATTER_FORWARD"; static const char __pyx_k_SCATTER_REVERSE[] = "SCATTER_REVERSE"; static const char __pyx_k_SCHURCOMPLEMENT[] = "SCHURCOMPLEMENT"; static const char __pyx_k_SUBMAT_SINGLEIS[] = "SUBMAT_SINGLEIS"; static const char __pyx_k_StencilLocation[] = "StencilLocation"; static const char __pyx_k_TRANSFORMFILTER[] = "TRANSFORMFILTER"; static const char __pyx_k_The_ASM_subtype[] = "The *ASM* subtype."; static const char __pyx_k_The_vector_type[] = "The vector type."; static const char __pyx_k_View_MemoryView[] = "View.MemoryView"; static const char __pyx_k_allocate_buffer[] = "allocate_buffer"; static const char __pyx_k_array_interface[] = "__array_interface__"; static const char __pyx_k_back_down_right[] = "back_down_right"; static const char __pyx_k_collections_abc[] = "collections.abc"; static const char __pyx_k_coneOrientation[] = "coneOrientation"; static const char __pyx_k_correction_type[] = "correction_type"; static const char __pyx_k_createDefaultSF[] = "createDefaultSF"; static const char __pyx_k_createGlobalVec[] = "createGlobalVec"; static const char __pyx_k_createSectionSF[] = "createSectionSF"; static const char __pyx_k_createSubMatrix[] = "createSubMatrix"; static const char __pyx_k_dtype_is_object[] = "dtype_is_object"; static const char __pyx_k_front_down_left[] = "front_down_left"; static const char __pyx_k_garbage_cleanup[] = "garbage_cleanup"; static const char __pyx_k_getBlockIndices[] = "getBlockIndices"; static const char __pyx_k_getBoundaryType[] = "getBoundaryType"; static const char __pyx_k_getEquationType[] = "getEquationType"; static const char __pyx_k_getFunctionNorm[] = "getFunctionNorm"; static const char __pyx_k_getGhostCorners[] = "getGhostCorners"; static const char __pyx_k_getLocalSection[] = "getLocalSection"; static const char __pyx_k_getResidualNorm[] = "getResidualNorm"; static const char __pyx_k_getSolutionNorm[] = "getSolutionNorm"; static const char __pyx_k_getStencilWidth[] = "getStencilWidth"; static const char __pyx_k_getStepFailures[] = "getStepFailures"; static const char __pyx_k_jacobian_design[] = "jacobian_design"; static const char __pyx_k_missingDiagonal[] = "missingDiagonal"; static const char __pyx_k_popErrorHandler[] = "popErrorHandler"; static const char __pyx_k_prefix_s_name_s[] = "(prefix:%s, name:%s)"; static const char __pyx_k_productSymbolic[] = "productSymbolic"; static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError"; static const char __pyx_k_redundantPoints[] = "redundantPoints"; static const char __pyx_k_refinementLimit[] = "refinementLimit"; static const char __pyx_k_setEquationType[] = "setEquationType"; static const char __pyx_k_setFunctionNorm[] = "setFunctionNorm"; static const char __pyx_k_setLocalSection[] = "setLocalSection"; static const char __pyx_k_setResidualNorm[] = "setResidualNorm"; static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; static const char __pyx_k_subspaceOffsets[] = "subspaceOffsets"; static const char __pyx_k_useInitialGuess[] = "useInitialGuess"; static const char __pyx_k_zeroRowsColumns[] = "zeroRowsColumns"; static const char __pyx_k_ASCII_VTK_COORDS[] = "ASCII_VTK_COORDS"; static const char __pyx_k_CONSTANTDIAGONAL[] = "CONSTANTDIAGONAL"; static const char __pyx_k_DEFAULT_BLOCKING[] = "DEFAULT_BLOCKING"; static const char __pyx_k_FACTOR_OUTMEMORY[] = "FACTOR_OUTMEMORY"; static const char __pyx_k_FRONT_DOWN_RIGHT[] = "FRONT_DOWN_RIGHT"; static const char __pyx_k_INSERT_BC_VALUES[] = "INSERT_BC_VALUES"; static const char __pyx_k_KSPTRANSPOSEONLY[] = "KSPTRANSPOSEONLY"; static const char __pyx_k_LMVMDIAGBBROYDEN[] = "LMVMDIAGBBROYDEN"; static const char __pyx_k_Matrix_info_type[] = "Matrix info type."; static const char __pyx_k_SEG_PRISM_TENSOR[] = "SEG_PRISM_TENSOR"; static const char __pyx_k_SNESNormSchedule[] = "SNESNormSchedule"; static const char __pyx_k_SYMMETRY_ETERNAL[] = "SYMMETRY_ETERNAL"; static const char __pyx_k_TRI_PRISM_TENSOR[] = "TRI_PRISM_TENSOR"; static const char __pyx_k_TSExactFinalTime[] = "TSExactFinalTime"; static const char __pyx_k_The_DIRK_subtype[] = "The *DIRK* subtype."; static const char __pyx_k_The_GAMG_subtype[] = "The *GAMG* subtype."; static const char __pyx_k_The_GASM_subtype[] = "The *GASM* subtype."; static const char __pyx_k_UNPRECONDITIONED[] = "UNPRECONDITIONED"; static const char __pyx_k_Viewer_file_mode[] = "Viewer file mode."; static const char __pyx_k_createNaturalVec[] = "createNaturalVec"; static const char __pyx_k_create_injection[] = "create_injection"; static const char __pyx_k_fill_ratio_given[] = "fill_ratio_given"; static const char __pyx_k_formSNESFunction[] = "formSNESFunction"; static const char __pyx_k_formSNESJacobian[] = "formSNESJacobian"; static const char __pyx_k_front_down_right[] = "front_down_right"; static const char __pyx_k_getBoundaryTypes[] = "getBoundaryTypes"; static const char __pyx_k_getDiagonalBlock[] = "getDiagonalBlock"; static const char __pyx_k_getFunctionValue[] = "getFunctionValue"; static const char __pyx_k_getGlobalSection[] = "getGlobalSection"; static const char __pyx_k_getOptionsPrefix[] = "getOptionsPrefix"; static const char __pyx_k_multHermitianAdd[] = "multHermitianAdd"; static const char __pyx_k_multTransposeAdd[] = "multTransposeAdd"; static const char __pyx_k_ownership_ranges[] = "ownership_ranges"; static const char __pyx_k_popSignalHandler[] = "popSignalHandler"; static const char __pyx_k_pushErrorHandler[] = "pushErrorHandler"; static const char __pyx_k_registerCitation[] = "registerCitation"; static const char __pyx_k_setGlobalSection[] = "setGlobalSection"; static const char __pyx_k_setOptionsPrefix[] = "setOptionsPrefix"; static const char __pyx_k_stdout_is_stderr[] = "_stdout_is_stderr"; static const char __pyx_k_targetComplexity[] = "targetComplexity"; static const char __pyx_k_ASCII_FACTOR_INFO[] = "ASCII_FACTOR_INFO"; static const char __pyx_k_ASCII_INFO_DETAIL[] = "ASCII_INFO_DETAIL"; static const char __pyx_k_ASCII_MATHEMATICA[] = "ASCII_MATHEMATICA"; static const char __pyx_k_CONVERGED_STEPTOL[] = "CONVERGED_STEPTOL"; static const char __pyx_k_DIVERGED_NANORINF[] = "DIVERGED_NANORINF"; static const char __pyx_k_DIVERGED_TR_DELTA[] = "DIVERGED_TR_DELTA"; static const char __pyx_k_DMStagStencilType[] = "DMStagStencilType"; static const char __pyx_k_DM_Boundary_types[] = "`DM` Boundary types."; static const char __pyx_k_HALTED_LOWERBOUND[] = "HALTED_LOWERBOUND"; static const char __pyx_k_HALTED_UPPERBOUND[] = "HALTED_UPPERBOUND"; static const char __pyx_k_INSERT_ALL_VALUES[] = "INSERT_ALL_VALUES"; static const char __pyx_k_InterpolationType[] = "InterpolationType"; static const char __pyx_k_LMVMSYMBADBROYDEN[] = "LMVMSYMBADBROYDEN"; static const char __pyx_k_NORM_INITIAL_ONLY[] = "NORM_INITIAL_ONLY"; static const char __pyx_k_PARTITIONINGCHACO[] = "PARTITIONINGCHACO"; static const char __pyx_k_PARTITIONINGPARTY[] = "PARTITIONINGPARTY"; static const char __pyx_k_POSITIVE_DEFINITE[] = "POSITIVE_DEFINITE"; static const char __pyx_k_QUAD_PRISM_TENSOR[] = "QUAD_PRISM_TENSOR"; static const char __pyx_k_REFINEPOWELLSABIN[] = "REFINEPOWELLSABIN"; static const char __pyx_k_TAOLineSearchType[] = "TAOLineSearchType"; static const char __pyx_k_TSConvergedReason[] = "TSConvergedReason"; static const char __pyx_k_The_MG_cycle_type[] = "The *MG* cycle type."; static const char __pyx_k_createLocalVector[] = "createLocalVector"; static const char __pyx_k_fill_ratio_needed[] = "fill_ratio_needed"; static const char __pyx_k_getDefaultSection[] = "getDefaultSection"; static const char __pyx_k_getMaxKSPFailures[] = "getMaxKSPFailures"; static const char __pyx_k_getObjectiveValue[] = "getObjectiveValue"; static const char __pyx_k_getOwnershipRange[] = "getOwnershipRange"; static const char __pyx_k_getSolutionUpdate[] = "getSolutionUpdate"; static const char __pyx_k_jacobian_equality[] = "jacobian_equality"; static const char __pyx_k_multDiagonalBlock[] = "multDiagonalBlock"; static const char __pyx_k_null_communicator[] = "null communicator"; static const char __pyx_k_positive_definite[] = "positive_definite"; static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum"; static const char __pyx_k_refinementUniform[] = "refinementUniform"; static const char __pyx_k_setDefaultSection[] = "setDefaultSection"; static const char __pyx_k_setMaxKSPFailures[] = "setMaxKSPFailures"; static const char __pyx_k_solveTransposeAdd[] = "solveTransposeAdd"; static const char __pyx_k_unknown_options_s[] = "unknown options: %s"; static const char __pyx_k_viennaclvechandle[] = "viennaclvechandle"; static const char __pyx_k_ASCII_MATRIXMARKET[] = "ASCII_MATRIXMARKET"; static const char __pyx_k_CONTINUE_ITERATING[] = "CONTINUE_ITERATING"; static const char __pyx_k_DIVERGED_BREAKDOWN[] = "DIVERGED_BREAKDOWN"; static const char __pyx_k_DIVERGED_FNORM_NAN[] = "DIVERGED_FNORM_NAN"; static const char __pyx_k_DIVERGED_LOCAL_MIN[] = "DIVERGED_LOCAL_MIN"; static const char __pyx_k_DMComposite_access[] = "_DMComposite_access"; static const char __pyx_k_DMSwarmCollectType[] = "DMSwarmCollectType"; static const char __pyx_k_DMSwarmMigrateType[] = "DMSwarmMigrateType"; static const char __pyx_k_DO_NOT_COPY_VALUES[] = "DO_NOT_COPY_VALUES"; static const char __pyx_k_DeflationSpaceType[] = "DeflationSpaceType"; static const char __pyx_k_GLOBAL_NONBLOCKING[] = "GLOBAL_NONBLOCKING"; static const char __pyx_k_HERMITIANTRANSPOSE[] = "HERMITIANTRANSPOSE"; static const char __pyx_k_INITIAL_FINAL_ONLY[] = "INITIAL_FINAL_ONLY"; static const char __pyx_k_KSPConvergedReason[] = "KSPConvergedReason"; static const char __pyx_k_LAYOUT_SUBDIVISION[] = "LAYOUT_SUBDIVISION"; static const char __pyx_k_MatDuplicateOption[] = "MatDuplicateOption"; static const char __pyx_k_MatFactorShiftType[] = "MatFactorShiftType"; static const char __pyx_k_PARTITIONINGSQUARE[] = "PARTITIONINGSQUARE"; static const char __pyx_k_POINT_PRISM_TENSOR[] = "POINT_PRISM_TENSOR"; static const char __pyx_k_PatchConstructType[] = "PatchConstructType"; static const char __pyx_k_ROWSCALINGVIENNACL[] = "ROWSCALINGVIENNACL"; static const char __pyx_k_ReorderDefaultFlag[] = "ReorderDefaultFlag"; static const char __pyx_k_TAOConvergedReason[] = "TAOConvergedReason"; static const char __pyx_k_The_composite_type[] = "The composite type."; static const char __pyx_k_ZERO_INITIAL_GUESS[] = "ZERO_INITIAL_GUESS"; static const char __pyx_k_applySymmetricLeft[] = "applySymmetricLeft"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_block_size_not_set[] = "block size not set"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_createGlobalVector[] = "createGlobalVector"; static const char __pyx_k_create_restriction[] = "create_restriction"; static const char __pyx_k_getConvergedReason[] = "getConvergedReason"; static const char __pyx_k_getIterationNumber[] = "getIterationNumber"; static const char __pyx_k_getMaxStepFailures[] = "getMaxStepFailures"; static const char __pyx_k_getOwnershipRanges[] = "getOwnershipRanges"; static const char __pyx_k_hasExternalPackage[] = "hasExternalPackage"; static const char __pyx_k_readonly_attribute[] = "readonly attribute"; static const char __pyx_k_remove_sent_points[] = "remove_sent_points"; static const char __pyx_k_restrictAnisotropy[] = "restrictAnisotropy"; static const char __pyx_k_setConvergedReason[] = "setConvergedReason"; static const char __pyx_k_setIterationNumber[] = "setIterationNumber"; static const char __pyx_k_setMaxStepFailures[] = "setMaxStepFailures"; static const char __pyx_k_strided_and_direct[] = ""; static const char __pyx_k_CONVERGED_FNORM_ABS[] = "CONVERGED_FNORM_ABS"; static const char __pyx_k_CONVERGED_ITERATING[] = "CONVERGED_ITERATING"; static const char __pyx_k_CONVERGED_NEG_CURVE[] = "CONVERGED_NEG_CURVE"; static const char __pyx_k_DAE_IMPLICIT_INDEX1[] = "DAE_IMPLICIT_INDEX1"; static const char __pyx_k_DAE_IMPLICIT_INDEX2[] = "DAE_IMPLICIT_INDEX2"; static const char __pyx_k_DAE_IMPLICIT_INDEX3[] = "DAE_IMPLICIT_INDEX3"; static const char __pyx_k_DIVERGED_LS_FAILURE[] = "DIVERGED_LS_FAILURE"; static const char __pyx_k_DMPlexTransformType[] = "DMPlexTransformType"; static const char __pyx_k_FAILED_BADPARAMETER[] = "FAILED_BADPARAMETER"; static const char __pyx_k_IGNORE_ZERO_ENTRIES[] = "IGNORE_ZERO_ENTRIES"; static const char __pyx_k_I_0_is_d_expected_d[] = "I[0] is %d, expected %d"; static const char __pyx_k_LOCAL_FORWARD_SWEEP[] = "LOCAL_FORWARD_SWEEP"; static const char __pyx_k_MIGRATE_DMCELLEXACT[] = "MIGRATE_DMCELLEXACT"; static const char __pyx_k_MatPartitioningType[] = "MatPartitioningType"; static const char __pyx_k_NORM_PRECONDITIONED[] = "NORM_PRECONDITIONED"; static const char __pyx_k_NO_OFF_PROC_ENTRIES[] = "NO_OFF_PROC_ENTRIES"; static const char __pyx_k_NotImplementedError[] = "NotImplementedError"; static const char __pyx_k_PARTITIONINGAVERAGE[] = "PARTITIONINGAVERAGE"; static const char __pyx_k_PARTITIONINGCURRENT[] = "PARTITIONINGCURRENT"; static const char __pyx_k_REFINEBOUNDARYLAYER[] = "REFINEBOUNDARYLAYER"; static const char __pyx_k_SNESConvergedReason[] = "SNESConvergedReason"; static const char __pyx_k_The_ARKIMEX_subtype[] = "The *ARKIMEX* subtype."; static const char __pyx_k_applySymmetricRight[] = "applySymmetricRight"; static const char __pyx_k_createNaturalVector[] = "createNaturalVector"; static const char __pyx_k_ignoreOutsideDomain[] = "ignoreOutsideDomain"; static const char __pyx_k_pop_python_vfprintf[] = "_pop_python_vfprintf"; static const char __pyx_k_unknown_join_mode_s[] = "unknown join mode: %s"; static const char __pyx_k_DAE_IMPLICIT_INDEXHI[] = "DAE_IMPLICIT_INDEXHI"; static const char __pyx_k_DIVERGED_LINE_SEARCH[] = "DIVERGED_LINE_SEARCH"; static const char __pyx_k_DMSwarmPICLayoutType[] = "DMSwarmPICLayoutType"; static const char __pyx_k_ExactFinalTimeOption[] = "ExactFinalTimeOption"; static const char __pyx_k_KEEP_NONZERO_PATTERN[] = "KEEP_NONZERO_PATTERN"; static const char __pyx_k_LOCAL_BACKWARD_SWEEP[] = "LOCAL_BACKWARD_SWEEP"; static const char __pyx_k_PARTITIONINGHIERARCH[] = "PARTITIONINGHIERARCH"; static const char __pyx_k_PARTITIONINGPARMETIS[] = "PARTITIONINGPARMETIS"; static const char __pyx_k_PARTITIONINGPTSCOTCH[] = "PARTITIONINGPTSCOTCH"; static const char __pyx_k_PCDeflationSpaceType[] = "PCDeflationSpaceType"; static const char __pyx_k_PCPatchConstructType[] = "PCPatchConstructType"; static const char __pyx_k_SAME_NONZERO_PATTERN[] = "SAME_NONZERO_PATTERN"; static const char __pyx_k_create_interpolation[] = "create_interpolation"; static const char __pyx_k_equality_constraints[] = "equality_constraints"; static const char __pyx_k_getEntriesPerElement[] = "getEntriesPerElement"; static const char __pyx_k_getInitialGuessKnoll[] = "getInitialGuessKnoll"; static const char __pyx_k_matpartitioning_type[] = "matpartitioning_type"; static const char __pyx_k_push_python_vfprintf[] = "_push_python_vfprintf"; static const char __pyx_k_setInitialGuessKnoll[] = "setInitialGuessKnoll"; static const char __pyx_k_staticproperty___get[] = "staticproperty.__get__"; static const char __pyx_k_strided_and_indirect[] = ""; static const char __pyx_k_unknown_shift_type_s[] = "unknown shift type: %s"; static const char __pyx_k_CONVERGED_ATOL_NORMAL[] = "CONVERGED_ATOL_NORMAL"; static const char __pyx_k_CONVERGED_RTOL_NORMAL[] = "CONVERGED_RTOL_NORMAL"; static const char __pyx_k_CONVERGED_STEP_LENGTH[] = "CONVERGED_STEP_LENGTH"; static const char __pyx_k_DIVERGED_LINEAR_SOLVE[] = "DIVERGED_LINEAR_SOLVE"; static const char __pyx_k_DIVERGED_NONSYMMETRIC[] = "DIVERGED_NONSYMMETRIC"; static const char __pyx_k_DIVERGED_TR_REDUCTION[] = "DIVERGED_TR_REDUCTION"; static const char __pyx_k_DMDAInterpolationType[] = "DMDAInterpolationType"; static const char __pyx_k_DMStagStencilLocation[] = "DMStagStencilLocation"; static const char __pyx_k_Invalid_shape_in_axis[] = "Invalid shape in axis "; static const char __pyx_k_LOCAL_SYMMETRIC_SWEEP[] = "LOCAL_SYMMETRIC_SWEEP"; static const char __pyx_k_NEW_NONZERO_LOCATIONS[] = "NEW_NONZERO_LOCATIONS"; static const char __pyx_k_NORM_UNPRECONDITIONED[] = "NORM_UNPRECONDITIONED"; static const char __pyx_k_NO_OFF_PROC_ZERO_ROWS[] = "NO_OFF_PROC_ZERO_ROWS"; static const char __pyx_k_SCATTER_FORWARD_LOCAL[] = "SCATTER_FORWARD_LOCAL"; static const char __pyx_k_SCATTER_REVERSE_LOCAL[] = "SCATTER_REVERSE_LOCAL"; static const char __pyx_k_SHARE_NONZERO_PATTERN[] = "SHARE_NONZERO_PATTERN"; static const char __pyx_k_TAO_Line_Search_Types[] = "TAO Line Search Types."; static const char __pyx_k_contiguous_and_direct[] = ""; static const char __pyx_k_getApplicationContext[] = "getApplicationContext"; static const char __pyx_k_getConvergenceHistory[] = "getConvergenceHistory"; static const char __pyx_k_getFunctionTolerances[] = "getFunctionTolerances"; static const char __pyx_k_getGradientTolerances[] = "getGradientTolerances"; static const char __pyx_k_productSetFromOptions[] = "productSetFromOptions"; static const char __pyx_k_setApplicationContext[] = "setApplicationContext"; static const char __pyx_k_setFunctionTolerances[] = "setFunctionTolerances"; static const char __pyx_k_side_r_not_understood[] = "side '%r' not understood"; static const char __pyx_k_unknown_device_type_s[] = "unknown device type: %s"; static const char __pyx_k_unknown_error_handler[] = "unknown error handler: "; static const char __pyx_k_unknown_stream_type_s[] = "unknown stream type: %s"; static const char __pyx_k_Cannot_index_with_type[] = "Cannot index with type '"; static const char __pyx_k_DIVERGED_INDEFINITE_PC[] = "DIVERGED_INDEFINITE_PC"; static const char __pyx_k_DIVERGED_STEP_REJECTED[] = "DIVERGED_STEP_REJECTED"; static const char __pyx_k_ERROR_LOWER_TRIANGULAR[] = "ERROR_LOWER_TRIANGULAR"; static const char __pyx_k_FORCE_DIAGONAL_ENTRIES[] = "FORCE_DIAGONAL_ENTRIES"; static const char __pyx_k_FieldSplitSchurPreType[] = "FieldSplitSchurPreType"; static const char __pyx_k_GETROW_UPPERTRIANGULAR[] = "GETROW_UPPERTRIANGULAR"; static const char __pyx_k_MIGRATE_DMCELLNSCATTER[] = "MIGRATE_DMCELLNSCATTER"; static const char __pyx_k_MemoryView_of_r_object[] = ""; static const char __pyx_k_Object_is_not_writable[] = "Object is not writable."; static const char __pyx_k_STRUCTURALLY_SYMMETRIC[] = "STRUCTURALLY_SYMMETRIC"; static const char __pyx_k_SUBSET_NONZERO_PATTERN[] = "SUBSET_NONZERO_PATTERN"; static const char __pyx_k_Vector_assembly_option[] = "Vector assembly option."; static const char __pyx_k_communicator_not_owned[] = "communicator not owned"; static const char __pyx_k_getDefaultLocalSection[] = "getDefaultLocalSection"; static const char __pyx_k_getInitialGuessNonzero[] = "getInitialGuessNonzero"; static const char __pyx_k_getLinearSolveFailures[] = "getLinearSolveFailures"; static const char __pyx_k_petsc4py_PETSc_Log_pyx[] = "petsc4py/PETSc/Log.pyx"; static const char __pyx_k_setDefaultLocalSection[] = "setDefaultLocalSection"; static const char __pyx_k_setInitialGuessNonzero[] = "setInitialGuessNonzero"; static const char __pyx_k_size_I_is_d_expected_d[] = "size(I) is %d, expected %d"; static const char __pyx_k_size_J_is_d_expected_d[] = "size(J) is %d, expected %d"; static const char __pyx_k_size_V_is_d_expected_d[] = "size(V) is %d, expected %d"; static const char __pyx_k_unknown_element_type_s[] = "unknown element type: %s"; static const char __pyx_k_unknown_scatter_mode_s[] = "unknown scatter mode: %s"; static const char __pyx_k_unknown_stencil_type_s[] = "unknown stencil type: %s"; static const char __pyx_k_COLLECT_DMDABOUNDINGBOX[] = "COLLECT_DMDABOUNDINGBOX"; static const char __pyx_k_DIVERGED_BREAKDOWN_BICG[] = "DIVERGED_BREAKDOWN_BICG"; static const char __pyx_k_DIVERGED_FUNCTION_COUNT[] = "DIVERGED_FUNCTION_COUNT"; static const char __pyx_k_DIVERGED_INDEFINITE_MAT[] = "DIVERGED_INDEFINITE_MAT"; static const char __pyx_k_DIVERGED_PCSETUP_FAILED[] = "DIVERGED_PCSETUP_FAILED"; static const char __pyx_k_FACTOR_STRUCT_ZEROPIVOT[] = "FACTOR_STRUCT_ZEROPIVOT"; static const char __pyx_k_FieldSplitSchurFactType[] = "FieldSplitSchurFactType"; static const char __pyx_k_IGNORE_LOWER_TRIANGULAR[] = "IGNORE_LOWER_TRIANGULAR"; static const char __pyx_k_IGNORE_NEGATIVE_INDICES[] = "IGNORE_NEGATIVE_INDICES"; static const char __pyx_k_IGNORE_OFF_PROC_ENTRIES[] = "IGNORE_OFF_PROC_ENTRIES"; static const char __pyx_k_MemoryView_of_r_at_0x_x[] = ""; static const char __pyx_k_NORM_INITIAL_FINAL_ONLY[] = "NORM_INITIAL_FINAL_ONLY"; static const char __pyx_k_SUBSET_OFF_PROC_ENTRIES[] = "SUBSET_OFF_PROC_ENTRIES"; static const char __pyx_k_UNKNOWN_NONZERO_PATTERN[] = "UNKNOWN_NONZERO_PATTERN"; static const char __pyx_k_contiguous_and_indirect[] = ""; static const char __pyx_k_getConstraintTolerances[] = "getConstraintTolerances"; static const char __pyx_k_getDefaultGlobalSection[] = "getDefaultGlobalSection"; static const char __pyx_k_isStructurallySymmetric[] = "isStructurallySymmetric"; static const char __pyx_k_restrictAnisotropyFirst[] = "restrictAnisotropyFirst"; static const char __pyx_k_setDefaultGlobalSection[] = "setDefaultGlobalSection"; static const char __pyx_k_unknown_boundary_type_s[] = "unknown boundary type: %s"; static const char __pyx_k_CONVERGED_FNORM_RELATIVE[] = "CONVERGED_FNORM_RELATIVE"; static const char __pyx_k_CONVERGED_SNORM_RELATIVE[] = "CONVERGED_SNORM_RELATIVE"; static const char __pyx_k_DAE_SEMI_EXPLICIT_INDEX1[] = "DAE_SEMI_EXPLICIT_INDEX1"; static const char __pyx_k_DAE_SEMI_EXPLICIT_INDEX2[] = "DAE_SEMI_EXPLICIT_INDEX2"; static const char __pyx_k_DAE_SEMI_EXPLICIT_INDEX3[] = "DAE_SEMI_EXPLICIT_INDEX3"; static const char __pyx_k_DIVERGED_FUNCTION_DOMAIN[] = "DIVERGED_FUNCTION_DOMAIN"; static const char __pyx_k_DIVERGED_JACOBIAN_DOMAIN[] = "DIVERGED_JACOBIAN_DOMAIN"; static const char __pyx_k_DIVERGED_NONLINEAR_SOLVE[] = "DIVERGED_NONLINEAR_SOLVE"; static const char __pyx_k_DMPlexReorderDefaultFlag[] = "DMPlexReorderDefaultFlag"; static const char __pyx_k_FACTOR_NUMERIC_ZEROPIVOT[] = "FACTOR_NUMERIC_ZEROPIVOT"; static const char __pyx_k_Missing_input_parameters[] = "Missing input parameters"; static const char __pyx_k_NEW_NONZERO_LOCATION_ERR[] = "NEW_NONZERO_LOCATION_ERR"; static const char __pyx_k_PCFieldSplitSchurPreType[] = "PCFieldSplitSchurPreType"; static const char __pyx_k_SYMMETRIC_MULTIPLICATIVE[] = "SYMMETRIC_MULTIPLICATIVE"; static const char __pyx_k_The_time_stepping_method[] = "The time stepping method."; static const char __pyx_k_getNonlinearStepFailures[] = "getNonlinearStepFailures"; static const char __pyx_k_incompatible_array_sizes[] = "incompatible array sizes"; static const char __pyx_k_petsc4py_PETSc_Error_pyx[] = "petsc4py/PETSc/Error.pyx"; static const char __pyx_k_petsc4py_PETSc_PETSc_pyx[] = "petsc4py/PETSc/PETSc.pyx"; static const char __pyx_k_CONVERGED_HAPPY_BREAKDOWN[] = "CONVERGED_HAPPY_BREAKDOWN"; static const char __pyx_k_DAE_SEMI_EXPLICIT_INDEXHI[] = "DAE_SEMI_EXPLICIT_INDEXHI"; static const char __pyx_k_DIFFERENT_NONZERO_PATTERN[] = "DIFFERENT_NONZERO_PATTERN"; static const char __pyx_k_Device_type_not_supported[] = "Device type {} not supported"; static const char __pyx_k_Dimension_d_is_not_direct[] = "Dimension %d is not direct"; static const char __pyx_k_HPDDMCoarseCorrectionType[] = "HPDDMCoarseCorrectionType"; static const char __pyx_k_PCFieldSplitSchurFactType[] = "PCFieldSplitSchurFactType"; static const char __pyx_k_The_preconditioner_method[] = "The preconditioner method."; static const char __pyx_k_getMaxFunctionEvaluations[] = "getMaxFunctionEvaluations"; static const char __pyx_k_getMaxLinearSolveFailures[] = "getMaxLinearSolveFailures"; static const char __pyx_k_petsc4py_PETSc_Device_pyx[] = "petsc4py/PETSc/Device.pyx"; static const char __pyx_k_setMaxFunctionEvaluations[] = "setMaxFunctionEvaluations"; static const char __pyx_k_setMaxLinearSolveFailures[] = "setMaxLinearSolveFailures"; static const char __pyx_k_Index_out_of_bounds_axis_d[] = "Index out of bounds (axis %d)"; static const char __pyx_k_NEW_NONZERO_ALLOCATION_ERR[] = "NEW_NONZERO_ALLOCATION_ERR"; static const char __pyx_k_size_d_nnz_is_d_expected_d[] = "size(d_nnz) is %d, expected %d"; static const char __pyx_k_size_o_nnz_is_d_expected_d[] = "size(o_nnz) is %d, expected %d"; static const char __pyx_k_PCHPDDMCoarseCorrectionType[] = "PCHPDDMCoarseCorrectionType"; static const char __pyx_k_Step_may_not_be_zero_axis_d[] = "Step may not be zero (axis %d)"; static const char __pyx_k_The_deflation_space_subtype[] = "The deflation space subtype."; static const char __pyx_k_The_patch_construction_type[] = "The patch construction type."; static const char __pyx_k_UNUSED_NONZERO_LOCATION_ERR[] = "UNUSED_NONZERO_LOCATION_ERR"; static const char __pyx_k_getMaxNonlinearStepFailures[] = "getMaxNonlinearStepFailures"; static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array"; static const char __pyx_k_petsc4py_PETSc_cyclicgc_pxi[] = "petsc4py/PETSc/cyclicgc.pxi"; static const char __pyx_k_setMaxNonlinearStepFailures[] = "setMaxNonlinearStepFailures"; static const char __pyx_k_unhandled_PetscDeviceType_d[] = "unhandled PetscDeviceType %d"; static const char __pyx_k_unhandled_PetscStreamType_d[] = "unhandled PetscStreamType %d"; static const char __pyx_k_Not_for_rectangular_matrices[] = "Not for rectangular matrices"; static const char __pyx_k_TAOLineSearchConvergedReason[] = "TAOLineSearchConvergedReason"; static const char __pyx_k_The_HPDDM_Krylov_solver_type[] = "The *HPDDM* Krylov solver type."; static const char __pyx_k_Unsupported_PetscScalar_type[] = "Unsupported PetscScalar type"; static const char __pyx_k_expecting_tuple_list_or_dict[] = "expecting tuple/list or dict"; static const char __pyx_k_option_prefix_must_be_string[] = "option prefix must be string"; static const char __pyx_k_unknown_interpolation_type_s[] = "unknown interpolation type: %s"; static const char __pyx_k_The_field_split_Schur_subtype[] = "The field split Schur subtype."; static const char __pyx_k_block_size_d_must_be_positive[] = "block size %d must be positive"; static const char __pyx_k_incompatible_array_sizes_nv_d[] = "incompatible array sizes: nv=%d"; static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data."; static const char __pyx_k_expecting_a_C_contiguous_array[] = "expecting a C-contiguous array"; static const char __pyx_k_strided_and_direct_or_indirect[] = ""; static const char __pyx_k_A_matrix_with_d_rows_requires_a[] = "A matrix with %d rows requires a row pointer of length %d (given: %d)"; static const char __pyx_k_Basic_constants_DECIDE_Use_a_de[] = "\nBasic constants:\n\n`DECIDE`\n Use a default value for an `int` or `float` parameter.\n`DEFAULT`\n Use a default value for an `int` or `float` parameter.\n`DETERMINE`\n Compute a default value for an `int` or `float` parameter.\n"; static const char __pyx_k_EventDecorator_locals_decorator[] = "EventDecorator..decorator..wrapped_func"; static const char __pyx_k_Factored_matrix_solver_type_See[] = "Factored matrix solver type.\n\n See Also\n --------\n petsc.MatSolverType\n\n "; static const char __pyx_k_Invalid_mode_expected_r_w_or_rw[] = "Invalid mode: expected 'r', 'w' or 'rw'"; static const char __pyx_k_Invalid_mode_expected_rw_r_or_w[] = "Invalid mode: expected 'rw', 'r', or 'w'"; static const char __pyx_k_More_constants_INFINITY_Very_la[] = "\nMore constants:\n\n`INFINITY`\n Very large real value.\n`NINFINITY`\n Very large negative real value.\n`PINFINITY`\n Very large positive real value, same as `INFINITY`.\n"; static const char __pyx_k_PETSc_Error_Attributes_ierr_int[] = "PETSc Error.\n\n Attributes\n ----------\n ierr : int\n PETSc error code.\n\n "; static const char __pyx_k_Portable_Extensible_Toolkit_for[] = "\nPortable, Extensible Toolkit for Scientific Computation.\n"; static const char __pyx_k_SNES_solver_type_See_Also_petsc[] = "SNES solver type.\n\n See Also\n --------\n petsc.SNESType\n\n "; static const char __pyx_k_Scatter_mode_Most_commonly_used[] = "Scatter mode.\n\n Most commonly used scatter modes are:\n\n `FORWARD`\n Scatter values in the forward direction.\n `REVERSE`\n Scatter values in the reverse direction.\n\n See Also\n --------\n Scatter.create, Scatter.begin, Scatter.end\n petsc.ScatterMode\n\n "; static const char __pyx_k_TAO_Bound_Constrained_Conjugate[] = "TAO Bound Constrained Conjugate Gradient (BNCG) Update Type."; static const char __pyx_k_The_type_of_join_to_perform_See[] = "The type of join to perform.\n\n See Also\n --------\n DeviceContext, DeviceContext.join, DeviceContext.fork, petsc.PetscDeviceContextJoinMode\n\n "; static const char __pyx_k_bcPoints_is_a_required_argument[] = "bcPoints is a required argument"; static const char __pyx_k_cannot_place_input_array_size_d[] = "cannot place input array size %d, vector size %d"; static const char __pyx_k_key_d_cannot_register_s_already[] = "key: %d, cannot register: %s, already registered: %s"; static const char __pyx_k_size_array_is_d_expected_dx_d_d[] = "size(array) is %d, expected %dx%d=%d"; static const char __pyx_k_unknown_stencil_location_type_s[] = "unknown stencil location type: %s"; static const char __pyx_k_All_dimensions_preceding_dimensi[] = "All dimensions preceding dimension %d must be indexed and not sliced"; static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides"; static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory."; static const char __pyx_k_Cannot_assign_to_read_only_memor[] = "Cannot assign to read-only memoryview"; static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview"; static const char __pyx_k_Cannot_transpose_memoryview_with[] = "Cannot transpose memoryview with indirect dimensions"; static const char __pyx_k_Distinguishes_among_types_of_exp[] = "Distinguishes among types of explicit and implicit equations."; static const char __pyx_k_Distinguishes_linear_and_nonline[] = "Distinguishes linear and nonlinear problems."; static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array"; static const char __pyx_k_Enum_describing_mapping_behavior[] = "Enum describing mapping behavior for global-to-local maps when global indices are missing.\n\n MASK\n Give missing global indices a local index of -1.\n DROP\n Drop missing global indices.\n\n See Also\n --------\n petsc.ISGlobalToLocalMappingMode\n\n "; static const char __pyx_k_Expect_a_dltensor_field_pycapsul[] = "Expect a dltensor field, pycapsule.PyCapsule can only be consumed once"; static const char __pyx_k_Expect_a_dltensor_or_used_dltens[] = "Expect a dltensor or used_dltensor field"; static const char __pyx_k_Factored_matrix_ordering_type_Se[] = "Factored matrix ordering type.\n\n See Also\n --------\n petsc.MatOrderingType\n\n "; static const char __pyx_k_Factored_matrix_shift_type_See_A[] = "Factored matrix shift type.\n\n See Also\n --------\n petsc.MatFactorShiftType\n\n "; static const char __pyx_k_Given_d_column_indices_but_d_non[] = "Given %d column indices but %d non-zero values"; static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] = "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))"; static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported"; static const char __pyx_k_Input_vector_has_no_tensor_infor[] = "Input vector has no tensor information"; static const char __pyx_k_Insertion_mode_Most_commonly_use[] = "Insertion mode.\n\n Most commonly used insertion modes are:\n\n `INSERT`\n Insert provided value/s discarding previous value/s.\n `ADD`\n Add provided value/s to current value/s.\n `MAX`\n Insert the maximum of provided value/s and current value/s.\n\n See Also\n --------\n petsc.InsertMode\n\n "; static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got "; static const char __pyx_k_KSP_Converged_Reason_CONVERGED_I[] = "KSP Converged Reason.\n\n `CONVERGED_ITERATING`\n Still iterating\n `ITERATING`\n Still iterating\n\n `CONVERGED_RTOL_NORMAL`\n Undocumented.\n `CONVERGED_ATOL_NORMAL`\n Undocumented.\n `CONVERGED_RTOL`\n \342\210\245r\342\210\245 <= rtolnorm(b) or rtolnorm(b - Ax\342\202\200)\n `CONVERGED_ATOL`\n \342\210\245r\342\210\245 <= atol\n `CONVERGED_ITS`\n Used by the `Type.PREONLY` solver after the single iteration of the\n preconditioner is applied. Also used when the\n `petsc.KSPConvergedSkip` convergence test routine is set in KSP.\n `CONVERGED_NEG_CURVE`\n Undocumented.\n `CONVERGED_STEP_LENGTH`\n Undocumented.\n `CONVERGED_HAPPY_BREAKDOWN`\n Undocumented.\n\n `DIVERGED_NULL`\n Undocumented.\n `DIVERGED_MAX_IT`\n Ran out of iterations before any convergence criteria was\n reached.\n `DIVERGED_DTOL`\n norm(r) >= dtol*norm(b)\n `DIVERGED_BREAKDOWN`\n A breakdown in the Krylov method was detected so the method\n could not continue to enlarge the Krylov space. Could be due to\n a singular matrix or preconditioner. In KSPHPDDM, this is also\n returned when some search directions within a block are\n colinear.\n `DIVERGED_BREAKDOWN_BICG`\n A breakdown in the KSPBICG method was detected so the method\n could not continue to enlarge the Krylov space.\n `DIVERGED_NONSYMMETRIC`\n It appears the operator or preconditioner is not symmetric and\n this Krylov method (`Type.CG`, `Type.MINRES`, `Type.CR`)\n requires symmetry.\n `DIVERGED_INDEFINITE_PC`\n It appears the preconditioner is indefinite (has both positive\n and negative eigenvalues) and this Krylov method (`Type.CG`)\n requires it to be positive definite.\n `DIVERGED_NANORINF`\n Undocumented.\n `DIVERGED_INDEFINITE_MAT`\n Undocumented.\n `DIVERGED_PC""SETUP_FAILED`\n It was not possible to build or use the requested\n preconditioner. This is usually due to a zero pivot in a\n factorization. It can also result from a failure in a\n subpreconditioner inside a nested preconditioner such as\n `PC.Type.FIELDSPLIT`.\n\n See Also\n --------\n `petsc.KSPConvergedReason`\n\n "; static const char __pyx_k_KSP_Type_The_available_types_are[] = "KSP Type.\n\n The available types are:\n\n `RICHARDSON`\n The preconditioned Richardson iterative method\n `petsc.KSPRICHARDSON`.\n `CHEBYSHEV`\n The preconditioned Chebyshev iterative method.\n `petsc.KSPCHEBYSHEV`.\n `CG`\n The Preconditioned Conjugate Gradient (PCG) iterative method.\n `petsc.KSPCG`\n `GROPPCG`\n A pipelined conjugate gradient method (Gropp).\n `petsc.KSPGROPPCG`\n `PIPECG`\n A pipelined conjugate gradient method.\n `petsc.KSPPIPECG`\n `PIPECGRR`\n Pipelined Conjugate Gradients with Residual Replacement.\n `petsc.KSPPIPECGRR`\n `PIPELCG`\n Deep pipelined (length l) Conjugate Gradient method.\n `petsc.KSPPIPELCG`\n `PIPEPRCG`\n Pipelined predict-and-recompute conjugate gradient method.\n `petsc.KSPPIPEPRCG`\n `PIPECG2`\n Pipelined conjugate gradient method with a single non-blocking\n reduction per two iterations. `petsc.KSPPIPECG2`\n `CGNE`\n Applies the preconditioned conjugate gradient method to the\n normal equations without explicitly forming A\341\265\200A. `petsc.KSPCGNE`\n `NASH`\n Conjugate gradient method subject to a constraint\n on the solution norm. `petsc.KSPNASH`\n `STCG`\n Conjugate gradient method subject to a constraint on the\n solution norm. `petsc.KSPSTCG`\n `GLTR`\n Conjugate gradient method subject to a constraint on the\n solution norm. `petsc.KSPGLTR`\n `FCG`\n Flexible Conjugate Gradient method (FCG). Unlike most KSP\n methods this allows the preconditioner to be nonlinear.\n `petsc.KSPFCG`\n `PIPEFCG`\n Pipelined, Flexible Conjugate Gradient method.\n `petsc.KSPPIPEFCG`\n `GMRES`\n Generalized Minimal Residual method with restart.\n `petsc.KSPGMRES`\n `PIPEFGMRES`\n Pipelined (1-stage) Flexible Generalized Minimal Residual\n me""thod. `petsc.KSPPIPEFGMRES`\n `FGMRES`\n Implements the Flexible Generalized Minimal Residual method.\n `petsc.KSPFGMRES`\n `LGMRES`\n Augments the standard Generalized Minimal Residual method\n approximation space with approximations to the error from\n previous restart cycles. `petsc.KSPLGMRES`\n `DGMRES`\n Deflated Generalized Minimal Residual method. In this\n implementation, the adaptive strategy allows to switch to the\n deflated GMRES when the stagnation occurs. `petsc.KSPDGMRES`\n `PGMRES`\n Pipelined Generalized Minimal Residual method.\n `petsc.KSPPGMRES`\n `TCQMR`\n A variant of Quasi Minimal Residual (QMR).\n `petsc.KSPTCQMR`\n `BCGS`\n Stabilized version of Biconjugate Gradient (BiCGStab) method.\n `petsc.KSPBCGS`\n `IBCGS`\n Improved Stabilized version of BiConjugate Gradient (IBiCGStab)\n method in an alternative form to have only a single global\n reduction operation instead of the usual 3 (or 4).\n `petsc.KSPIBCGS`\n `QMRCGS`\n Quasi- Minimal Residual variant of the Bi-CGStab algorithm\n (QMRCGStab) method. `petsc.KSPQMRCGS`\n `FBCGS`\n Flexible Stabilized version of BiConjugate Gradient (BiCGStab)\n method. `petsc.KSPFBCGS`\n `FBCGSR`\n A mathematically equivalent variant of flexible stabilized\n BiConjugate Gradient (BiCGStab). `petsc.KSPFBCGSR`\n `BCGSL`\n Variant of the L-step stabilized BiConjugate Gradient\n (BiCGStab(L)) algorithm. Uses \"L-step\" Minimal Residual (MR)\n polynomials. The variation concerns cases when some parameters\n are negative due to round-off. `petsc.KSPBCGSL`\n `PIPEBCGS`\n Pipelined stabilized BiConjugate Gradient (BiCGStab) method.\n `petsc.KSPPIPEBCGS`\n `CGS`\n Conjugate Gradient Squared method.\n `petsc.KSPCGS`\n `TFQMR`\n A Transpose Tree Quasi- ""Minimal Residual (QMR).\n `petsc.KSPCR`\n `CR`\n (Preconditioned) Conjugate Residuals (CR) method.\n `petsc.KSPCR`\n `PIPECR`\n Pipelined Conjugate Residual (CR) method.\n `petsc.KSPPIPECR`\n `LSQR`\n Least squares solver.\n `petsc.KSPLSQR`\n `PREONLY`\n Applies ONLY the preconditioner exactly once. This may be used\n in inner iterations, where it is desired to allow multiple\n iterations as well as the \"0-iteration\" case. It is commonly\n used with the direct solver preconditioners like PCLU and\n PCCHOLESKY. There is an alias of KSPNONE.\n `petsc.KSPPREONLY`\n `NONE`\n No solver\n ``KSPNONE``\n `QCG`\n Conjugate Gradient (CG) method subject to a constraint on the\n solution norm. `petsc.KSPQCG`\n `BICG`\n Implements the Biconjugate gradient method (BiCG).\n Similar to running the conjugate gradient on the normal equations.\n `petsc.KSPBICG`\n `MINRES`\n Minimum Residual (MINRES) method.\n `petsc.KSPMINRES`\n `SYMMLQ`\n Symmetric LQ method (SymmLQ). Uses LQ decomposition (lower\n trapezoidal).\n `petsc.KSPSYMMLQ`\n `LCD`\n Left Conjugate Direction (LCD) method.\n `petsc.KSPLCD`\n `PYTHON`\n Python shell solver. Call Python function to implement solver.\n ``KSPPYTHON``\n `GCR`\n Preconditioned flexible Generalized Conjugate Residual (GCR)\n method.\n `petsc.KSPGCR`\n `PIPEGCR`\n Pipelined Generalized Conjugate Residual method.\n `petsc.KSPPIPEGCR`\n `TSIRM`\n Two-Stage Iteration with least-squares Residual Minimization\n method. `petsc.KSPTSIRM`\n `CGLS`\n Conjugate Gradient method for Least-Squares problems. Supports\n non-square (rectangular) matrices. `petsc.KSPCGLS`\n `FETIDP`\n Dual-Primal (DP) Finite Element Tearing and Interconnect (FETI)""\n method. `petsc.KSPFETIDP`\n `HPDDM`\n Interface with the HPDDM library. This KSP may be used to\n further select methods that are currently not implemented\n natively in PETSc, e.g., GCRODR, a recycled Krylov\n method which is similar to KSPLGMRES. `petsc.KSPHPDDM`\n\n Notes\n -----\n `KSP Type `__\n `KSP Type table `__\n `Pieplined KSP methods `__\n `Flexible KSP methods `__\n\n See Also\n --------\n petsc_options, petsc.KSP\n\n "; static const char __pyx_k_KSP_norm_type_The_available_norm[] = "KSP norm type.\n\n The available norm types are:\n\n `NONE`\n Skips computing the norm, this should generally only be used if\n you are using the Krylov method as a smoother with a fixed\n small number of iterations. Implicitly sets\n `petsc.KSPConvergedSkip` as KSP convergence test. Note that\n certain algorithms such as `Type.GMRES` ALWAYS require the norm\n calculation, for these methods the norms are still computed,\n they are just not used in the convergence test.\n `PRECONDITIONED`\n The default for left preconditioned solves, uses the l\342\202\202 norm of\n the preconditioned residual P\342\201\273\302\271(b - Ax).\n `UNPRECONDITIONED`\n Uses the l\342\202\202 norm of the true b - Ax residual.\n `NATURAL`\n Supported by `Type.CG`, `Type.CR`, `Type.CGNE`, `Type.CGS`.\n\n "; static const char __pyx_k_Matrix_SOR_type_See_Also_petsc_M[] = "Matrix SOR type.\n\n See Also\n --------\n petsc.MatSORType\n\n "; static const char __pyx_k_Matrix_assembly_type_See_Also_pe[] = "Matrix assembly type.\n\n See Also\n --------\n petsc.MatAssemblyType\n\n "; static const char __pyx_k_Matrix_duplicate_option_See_Also[] = "Matrix duplicate option.\n\n See Also\n --------\n petsc.MatDuplicateOption\n\n "; static const char __pyx_k_Matrix_modification_structure_Se[] = "Matrix modification structure.\n\n See Also\n --------\n petsc.MatStructure\n\n "; static const char __pyx_k_Matrix_option_See_Also_petsc_Mat[] = "Matrix option.\n\n See Also\n --------\n petsc.MatOption\n\n "; static const char __pyx_k_Matrix_type_See_Also_petsc_MatTy[] = "Matrix type.\n\n See Also\n --------\n petsc.MatType\n\n "; static const char __pyx_k_Must_provide_as_many_communicato[] = "Must provide as many communicators as levels"; static const char __pyx_k_Must_provide_both_sizes_and_poin[] = "Must provide both sizes and points arrays"; static const char __pyx_k_Must_provide_operator_for_USER_o[] = "Must provide operator for USER or PYTHON type"; static const char __pyx_k_Norm_type_Commonly_used_norm_typ[] = "Norm type.\n\n Commonly used norm types:\n\n `N1`\n The one norm.\n `N2`\n The two norm.\n `FROBENIUS`\n The Frobenius norm.\n `INFINITY`\n The infinity norm.\n\n See Also\n --------\n petsc.NormType\n\n "; static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis "; static const char __pyx_k_Out_of_memory_Allocated_d_Used_b[] = "Out of memory. Allocated: %d, Used by process: %d"; static const char __pyx_k_SNES_norm_schedule_See_Also_pets[] = "SNES norm schedule.\n\n See Also\n --------\n petsc.SNESNormSchedule\n\n "; static const char __pyx_k_SNES_solver_termination_reason_S[] = "SNES solver termination reason.\n\n See Also\n --------\n petsc.SNESGetConvergedReason\n\n "; static const char __pyx_k_Scatter_type_See_Also_petsc_VecS[] = "Scatter type.\n\n See Also\n --------\n petsc.VecScatterType\n\n "; static const char __pyx_k_TAO_Line_Search_Termination_Reas[] = "TAO Line Search Termination Reasons."; static const char __pyx_k_TAO_solver_termination_reason_Se[] = "TAO solver termination reason.\n\n See Also\n --------\n petsc.TaoConvergedReason\n\n "; static const char __pyx_k_TAO_solver_type_See_Also_petsc_T[] = "TAO solver type.\n\n See Also\n --------\n petsc.TaoType\n\n "; static const char __pyx_k_Tensor_dtype_does_not_match_PETS[] = "Tensor dtype = {} does not match PETSc precision"; static const char __pyx_k_The_HPDDM_coarse_correction_type[] = "The *HPDDM* coarse correction type."; static const char __pyx_k_The_field_split_Schur_factorizat[] = "The field split Schur factorization type."; static const char __pyx_k_The_manner_in_which_the_precondi[] = "The manner in which the preconditioner is applied."; static const char __pyx_k_The_method_for_ending_time_stepp[] = "The method for ending time stepping."; static const char __pyx_k_The_random_number_generator_type[] = "The random number generator type."; static const char __pyx_k_The_reason_the_preconditioner_ha[] = "The reason the preconditioner has failed."; static const char __pyx_k_The_reason_the_time_step_is_conv[] = "The reason the time step is converging."; static const char __pyx_k_The_type_of_device_See_Also_Devi[] = "The type of device.\n\n See Also\n --------\n Device, Device.create, Device.getDeviceType, Device.type, petsc.PetscDeviceType\n\n "; static const char __pyx_k_The_type_of_stream_See_Also_Devi[] = "The type of stream.\n\n See Also\n --------\n DeviceContext, DeviceContext.getStreamType, DeviceContext.setStreamType, petsc.PetscStreamType\n\n "; static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object"; static const char __pyx_k_Vector_local_size_d_is_not_compa[] = "Vector local size %d is not compatible with DMDA local sizes %s"; static const char __pyx_k_accessing_non_existent_buffer_se[] = "accessing non-existent buffer segment"; static const char __pyx_k_array_size_d_and_vector_local_si[] = "array size %d and vector local size %d block size %d"; static const char __pyx_k_array_size_d_incompatible_with_v[] = "array size %d incompatible with vector local size %d"; static const char __pyx_k_cell_indices_must_have_two_dimen[] = "cell indices must have two dimensions: cells.ndim=%d"; static const char __pyx_k_column_indices_must_have_two_dim[] = "column indices must have two dimensions: cols.ndim=%d"; static const char __pyx_k_coordinates_must_have_two_dimens[] = "coordinates must have two dimensions: coordinates.ndim=%d"; static const char __pyx_k_coordinates_size_must_be_at_leas[] = "coordinates size must be at least %d"; static const char __pyx_k_coords_vertices_must_have_two_di[] = "coords vertices must have two dimensions: coords.ndim=%d"; static const char __pyx_k_get1dCoordinatecArrays_for_DMSta[] = "get1dCoordinatecArrays for DMStag not yet implemented in petsc4py"; static const char __pyx_k_getVecArray_for_DMStag_not_yet_i[] = "getVecArray for DMStag not yet implemented in petsc4py"; static const char __pyx_k_ghosts_size_d_array_size_d_and_v[] = "ghosts size %d, array size %d, and vector local size %d block size %d"; static const char __pyx_k_global_size_d_not_divisible_by_b[] = "global size %d not divisible by block size %d"; static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension "; static const char __pyx_k_incompatible_array_sizes_ni_d_nj[] = "incompatible array sizes: ni=%d, nj=%d, nv=%d"; static const char __pyx_k_incompatible_array_sizes_ni_d_nv[] = "incompatible array sizes: ni=%d, nv=%d, bs=%d"; static const char __pyx_k_input_arrays_have_incompatible_s[] = "input arrays have incompatible shapes: rows.shape=%s, cols.shape=%s, vals.shape=%s"; static const char __pyx_k_local_and_global_sizes_cannot_be[] = "local and global sizes cannot be both 'DECIDE'"; static const char __pyx_k_local_size_d_not_divisible_by_bl[] = "local size %d not divisible by block size %d"; static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__"; static const char __pyx_k_number_of_dimensions_d_and_numbe[] = "number of dimensions %d and number ownership ranges %d"; static const char __pyx_k_option_prefix_should_not_have_sp[] = "option prefix should not have spaces"; static const char __pyx_k_option_prefix_should_not_start_w[] = "option prefix should not start with a hyphen"; static const char __pyx_k_ownership_range_size_d_and_numbe[] = "ownership range size %d and number or processors %d"; static const char __pyx_k_row_indices_must_have_two_dimens[] = "row indices must have two dimensions: rows.ndim=%d"; static const char __pyx_k_sizes_array_should_have_d_entrie[] = "sizes array should have %d entries (has %d)"; static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides."; static const char __pyx_k_unhandled_PetscDeviceContextJoin[] = "unhandled PetscDeviceContextJoinMode %d"; static const char __pyx_k_values_must_have_two_or_more_dim[] = "values must have two or more dimensions: vals.ndim=%d"; static const char __pyx_k_EventDecorator_locals_decorator_2[] = "EventDecorator..decorator"; static const char __pyx_k_incompatible_array_sizes_ni_d_nv_2[] = "incompatible array sizes: ni=%d, nv=%d"; /* #### Code section: decls ### */ static PyObject *__pyx_lambda_funcdef_8petsc4py_5PETSc_lambda(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v__, CYTHON_UNUSED PyObject *__pyx_v___); /* proto */ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */ static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */ static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */ static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */ static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object); /* proto */ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */ static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */ static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_10_IS_buffer___cinit__(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset); /* proto */ static void __pyx_pf_8petsc4py_5PETSc_10_IS_buffer_2__dealloc__(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_10_IS_buffer_4__getbuffer__(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self, Py_buffer *__pyx_v_view, int __pyx_v_flags); /* proto */ static void __pyx_pf_8petsc4py_5PETSc_10_IS_buffer_6__releasebuffer__(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self, Py_buffer *__pyx_v_view); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_10_IS_buffer_8__enter__(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_10_IS_buffer_10__exit__(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc); /* proto */ #if PY_MAJOR_VERSION < 3 static Py_ssize_t __pyx_pf_8petsc4py_5PETSc_10_IS_buffer_12__getsegcount__(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self, Py_ssize_t *__pyx_v_lenp); /* proto */ #endif #if PY_MAJOR_VERSION < 3 static Py_ssize_t __pyx_pf_8petsc4py_5PETSc_10_IS_buffer_14__getreadbuffer__(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self, Py_ssize_t __pyx_v_idx, void **__pyx_v_p); /* proto */ #endif static PyObject *__pyx_pf_8petsc4py_5PETSc_10_IS_buffer_19__array_interface_____get__(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_11_Vec_buffer___cinit__(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec, int __pyx_v_readonly); /* proto */ static void __pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_2__dealloc__(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_4__getbuffer__(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self, Py_buffer *__pyx_v_view, int __pyx_v_flags); /* proto */ static void __pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_6__releasebuffer__(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self, Py_buffer *__pyx_v_view); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_8__enter__(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_10__exit__(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc); /* proto */ #if PY_MAJOR_VERSION < 3 static Py_ssize_t __pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_12__getsegcount__(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self, Py_ssize_t *__pyx_v_lenp); /* proto */ #endif #if PY_MAJOR_VERSION < 3 static Py_ssize_t __pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_14__getreadbuffer__(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self, Py_ssize_t __pyx_v_idx, void **__pyx_v_p); /* proto */ #endif #if PY_MAJOR_VERSION < 3 static Py_ssize_t __pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_16__getwritebuffer__(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self, Py_ssize_t __pyx_v_idx, void **__pyx_v_p); /* proto */ #endif static PyObject *__pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_19__array_interface_____get__(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_14_Vec_LocalForm___init__(struct __pyx_obj_8petsc4py_5PETSc__Vec_LocalForm *__pyx_v_self, struct PyPetscVecObject *__pyx_v_gvec); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_14_Vec_LocalForm_2__enter__(struct __pyx_obj_8petsc4py_5PETSc__Vec_LocalForm *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_14_Vec_LocalForm_4__exit__(struct __pyx_obj_8petsc4py_5PETSc__Vec_LocalForm *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array___cinit__(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *__pyx_v_self, struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_da, struct PyPetscVecObject *__pyx_v_vec, int __pyx_v_DOF); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array_2__getitem__(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *__pyx_v_self, PyObject *__pyx_v_index); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array_4__setitem__(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array_6__enter__(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array_8__exit__(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array_6starts___get__(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array_5sizes___get__(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array_5shape___get__(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array_7strides___get__(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array_5array___get__(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_19_DMComposite_access___cinit__(struct __pyx_obj_8petsc4py_5PETSc__DMComposite_access *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm, struct PyPetscVecObject *__pyx_v_gvec, PyObject *__pyx_v_locs); /* proto */ static void __pyx_pf_8petsc4py_5PETSc_19_DMComposite_access_2__dealloc__(struct __pyx_obj_8petsc4py_5PETSc__DMComposite_access *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_19_DMComposite_access_4__enter__(struct __pyx_obj_8petsc4py_5PETSc__DMComposite_access *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_19_DMComposite_access_6__exit__(struct __pyx_obj_8petsc4py_5PETSc__DMComposite_access *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5Error___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, int __pyx_v_ierr); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5Error_2__bool__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5Error_4__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5Error_6__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_7Options___init__(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_prefix); /* proto */ static void __pyx_pf_8petsc4py_5PETSc_7Options_2__dealloc__(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_7Options_4__contains__(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_item); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_6__getitem__(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_item); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_7Options_8__setitem__(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_7Options_10__delitem__(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_item); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_6prefix___get__(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_7Options_6prefix_2__set__(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_prefix); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_7Options_6prefix_4__del__(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_12create(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_14destroy(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_16clear(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_18view(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_20prefixPush(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_prefix); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_22prefixPop(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_24hasName(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_26setValue(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_28delValue(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_30getBool(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_default); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_32getInt(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_default); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_34getReal(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_default); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_36getScalar(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_default); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_38getString(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_default); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_40insertString(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_string); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_42getAll(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_getVersion(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_devel, PyObject *__pyx_v_date, PyObject *__pyx_v_author); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_2getVersionInfo(PyTypeObject *__pyx_v_cls); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_4isInitialized(CYTHON_UNUSED PyTypeObject *__pyx_v_cls); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_6isFinalized(CYTHON_UNUSED PyTypeObject *__pyx_v_cls); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_8getDefaultComm(CYTHON_UNUSED PyTypeObject *__pyx_v_cls); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_10setDefaultComm(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_12Print(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_sep, PyObject *__pyx_v_end, PyObject *__pyx_v_comm, PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_14syncPrint(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_sep, PyObject *__pyx_v_end, PyObject *__pyx_v_flush, PyObject *__pyx_v_comm, PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_16syncFlush(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_18splitOwnership(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_20sleep(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_seconds); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_22pushErrorHandler(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_errhandler); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_24popErrorHandler(CYTHON_UNUSED PyTypeObject *__pyx_v_cls); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_26popSignalHandler(CYTHON_UNUSED PyTypeObject *__pyx_v_cls); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_28infoAllow(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_flag, PyObject *__pyx_v_filename, PyObject *__pyx_v_mode); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_30registerCitation(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_citation); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_32hasExternalPackage(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_package); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_Stage(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_2Class(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_4Event(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_name, PyObject *__pyx_v_klass); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_6begin(CYTHON_UNUSED PyTypeObject *__pyx_v_cls); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_8view(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_10logFlops(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_flops); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_12addFlops(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_flops); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_14getFlops(CYTHON_UNUSED PyTypeObject *__pyx_v_cls); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_16getTime(CYTHON_UNUSED PyTypeObject *__pyx_v_cls); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_18getCPUTime(CYTHON_UNUSED PyTypeObject *__pyx_v_cls); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_14EventDecorator_9decorator_wrapped_func(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_14EventDecorator_decorator(PyObject *__pyx_self, PyObject *__pyx_v_func); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_20EventDecorator(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_name, PyObject *__pyx_v_klass); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_22isActive(CYTHON_UNUSED PyTypeObject *__pyx_v_cls); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_8LogStage___cinit__(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_2__int__(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_4__enter__(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_6__exit__(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_8push(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_10pop(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_12getName(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_4name___get__(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_8LogStage_4name_2__set__(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_14activate(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_16deactivate(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_18getActive(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_20setActive(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_6active___get__(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_8LogStage_6active_2__set__(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_22getVisible(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_24setVisible(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_7visible___get__(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_8LogStage_7visible_2__set__(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_2id___get__(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_8LogClass___cinit__(struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogClass_2__int__(struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogClass_4getName(struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogClass_4name___get__(struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_8LogClass_4name_2__set__(struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogClass_6activate(struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogClass_8deactivate(struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogClass_10getActive(struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogClass_12setActive(struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogClass_6active___get__(struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_8LogClass_6active_2__set__(struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogClass_2id___get__(struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_8LogEvent___cinit__(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_2__int__(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_4__enter__(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_6__exit__(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_8begin(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self, PyObject *__pyx_v_objs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_10end(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self, PyObject *__pyx_v_objs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_12getName(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_4name___get__(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_8LogEvent_4name_2__set__(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_14activate(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_16deactivate(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_18getActive(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_20setActive(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_6active___get__(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_8LogEvent_6active_2__set__(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_22getActiveAll(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_24setActiveAll(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_10active_all___get__(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_8LogEvent_10active_all_2__set__(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_26getPerfInfo(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self, PyObject *__pyx_v_stage); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_2id___get__(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_4Comm___cinit__(struct PyPetscCommObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */ static void __pyx_pf_8petsc4py_5PETSc_4Comm_2__dealloc__(struct PyPetscCommObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4Comm_4__richcmp__(struct PyPetscCommObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_4Comm_6__bool__(struct PyPetscCommObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4Comm_8destroy(struct PyPetscCommObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4Comm_10duplicate(struct PyPetscCommObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4Comm_12getSize(struct PyPetscCommObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4Comm_14getRank(struct PyPetscCommObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4Comm_16barrier(struct PyPetscCommObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4Comm_4size___get__(struct PyPetscCommObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4Comm_4rank___get__(struct PyPetscCommObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4Comm_7fortran___get__(struct PyPetscCommObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4Comm_18tompi4py(struct PyPetscCommObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_6Object___cinit__(struct PyPetscObjectObject *__pyx_v_self); /* proto */ static void __pyx_pf_8petsc4py_5PETSc_6Object_2__dealloc__(struct PyPetscObjectObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_4__richcmp__(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_6Object_6__bool__(struct PyPetscObjectObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_8__copy__(struct PyPetscObjectObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_10__deepcopy__(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_memo); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_12view(struct PyPetscObjectObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_14destroy(struct PyPetscObjectObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_16getType(struct PyPetscObjectObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_18setOptionsPrefix(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_prefix); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_20getOptionsPrefix(struct PyPetscObjectObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_22appendOptionsPrefix(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_prefix); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_24setFromOptions(struct PyPetscObjectObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_26viewFromOptions(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_name, struct PyPetscObjectObject *__pyx_v_prefix); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_28getComm(struct PyPetscObjectObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_30getName(struct PyPetscObjectObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_32setName(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_34getClassId(struct PyPetscObjectObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_36getClassName(struct PyPetscObjectObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_38getRefCount(struct PyPetscObjectObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_40compose(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_name, struct PyPetscObjectObject *__pyx_v_obj); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_42query(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_44incRef(struct PyPetscObjectObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_46decRef(struct PyPetscObjectObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_48getAttr(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_50setAttr(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_attr); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_52getDict(struct PyPetscObjectObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_54stateIncrease(struct PyPetscObjectObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_56stateGet(struct PyPetscObjectObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_58stateSet(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_state); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_60incrementTabLevel(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_tab, struct PyPetscObjectObject *__pyx_v_parent); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_62setTabLevel(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_level); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_64getTabLevel(struct PyPetscObjectObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_4type___get__(struct PyPetscObjectObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_6Object_4type_2__set__(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_6prefix___get__(struct PyPetscObjectObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_6Object_6prefix_2__set__(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_4comm___get__(struct PyPetscObjectObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_4name___get__(struct PyPetscObjectObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_6Object_4name_2__set__(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_7classid___get__(struct PyPetscObjectObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_5klass___get__(struct PyPetscObjectObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_8refcount___get__(struct PyPetscObjectObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_6handle___get__(struct PyPetscObjectObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_7fortran___get__(struct PyPetscObjectObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_garbage_cleanup(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2garbage_view(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_comm); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_6Viewer___cinit__(struct PyPetscViewerObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_2__call__(struct PyPetscViewerObject *__pyx_v_self, struct PyPetscObjectObject *__pyx_v_obj); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_4view(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_obj); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_6destroy(struct PyPetscViewerObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_8create(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_10createASCII(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_mode, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_12createBinary(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_mode, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_14createMPIIO(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_mode, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_16createVTK(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_mode, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_18createHDF5(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_mode, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_20createDraw(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_display, PyObject *__pyx_v_title, PyObject *__pyx_v_position, PyObject *__pyx_v_size, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_22setType(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_vwr_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_24getType(struct PyPetscViewerObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_26getFormat(struct PyPetscViewerObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_28pushFormat(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_format); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_30popFormat(struct PyPetscViewerObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_32getSubViewer(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_34restoreSubViewer(struct PyPetscViewerObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_sub); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_36STDOUT(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_38STDERR(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_40ASCII(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_name, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_42BINARY(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_44DRAW(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_46setASCIITab(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_tabs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_48getASCIITab(struct PyPetscViewerObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_50addASCIITab(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_tabs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_52subtractASCIITab(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_tabs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_54pushASCIISynchronized(struct PyPetscViewerObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_56popASCIISynchronized(struct PyPetscViewerObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_58pushASCIITab(struct PyPetscViewerObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_60popASCIITab(struct PyPetscViewerObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_62useASCIITabs(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_64printfASCII(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_msg); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_66printfASCIISynchronized(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_msg); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_68flush(struct PyPetscViewerObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_70setFileMode(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_mode); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_72getFileMode(struct PyPetscViewerObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_74setFileName(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_76getFileName(struct PyPetscViewerObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_78setDrawInfo(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_display, PyObject *__pyx_v_title, PyObject *__pyx_v_position, PyObject *__pyx_v_size); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_80clearDraw(struct PyPetscViewerObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_10ViewerHDF5_create(struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_mode, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_10ViewerHDF5_2pushTimestepping(struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_10ViewerHDF5_4popTimestepping(struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_10ViewerHDF5_6getTimestep(struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_10ViewerHDF5_8setTimestep(struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *__pyx_v_self, PyObject *__pyx_v_timestep); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_10ViewerHDF5_10incrementTimestep(struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_10ViewerHDF5_12pushGroup(struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *__pyx_v_self, PyObject *__pyx_v_group); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_10ViewerHDF5_14popGroup(struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_10ViewerHDF5_16getGroup(struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_6Random___cinit__(struct PyPetscRandomObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_2__call__(struct PyPetscRandomObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_4view(struct PyPetscRandomObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_6destroy(struct PyPetscRandomObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_8create(struct PyPetscRandomObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_10setType(struct PyPetscRandomObject *__pyx_v_self, PyObject *__pyx_v_rnd_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_12getType(struct PyPetscRandomObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_14setFromOptions(struct PyPetscRandomObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_16getValue(struct PyPetscRandomObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_18getValueReal(struct PyPetscRandomObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_20getSeed(struct PyPetscRandomObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_22setSeed(struct PyPetscRandomObject *__pyx_v_self, PyObject *__pyx_v_seed); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_24getInterval(struct PyPetscRandomObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_26setInterval(struct PyPetscRandomObject *__pyx_v_self, PyObject *__pyx_v_interval); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_4seed___get__(struct PyPetscRandomObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_6Random_4seed_2__set__(struct PyPetscRandomObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_8interval___get__(struct PyPetscRandomObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_6Random_8interval_2__set__(struct PyPetscRandomObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_14staticproperty___get__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_6Device___cinit__(struct PyPetscDeviceObject *__pyx_v_self); /* proto */ static void __pyx_pf_8petsc4py_5PETSc_6Device_2__dealloc__(struct PyPetscDeviceObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Device_4create(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_dtype, PyObject *__pyx_v_device_id); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Device_6destroy(struct PyPetscDeviceObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Device_8configure(struct PyPetscDeviceObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Device_10view(struct PyPetscDeviceObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Device_12getDeviceType(struct PyPetscDeviceObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Device_14getDeviceId(struct PyPetscDeviceObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Device_16setDefaultType(PyObject *__pyx_v_device_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Device_4type___get__(struct PyPetscDeviceObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Device_9device_id___get__(struct PyPetscDeviceObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_13DeviceContext___cinit__(struct PyPetscDeviceContextObject *__pyx_v_self); /* proto */ static void __pyx_pf_8petsc4py_5PETSc_13DeviceContext_2__dealloc__(struct PyPetscDeviceContextObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_13DeviceContext_4create(PyTypeObject *__pyx_v_cls); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_13DeviceContext_6getStreamType(struct PyPetscDeviceContextObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_13DeviceContext_8setStreamType(struct PyPetscDeviceContextObject *__pyx_v_self, PyObject *__pyx_v_stream_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_13DeviceContext_10getDevice(struct PyPetscDeviceContextObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_13DeviceContext_12setDevice(struct PyPetscDeviceContextObject *__pyx_v_self, struct PyPetscDeviceObject *__pyx_v_device); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_13DeviceContext_14setUp(struct PyPetscDeviceContextObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_13DeviceContext_16duplicate(struct PyPetscDeviceContextObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_13DeviceContext_18idle(struct PyPetscDeviceContextObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_13DeviceContext_20waitFor(struct PyPetscDeviceContextObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_13DeviceContext_22fork(struct PyPetscDeviceContextObject *__pyx_v_self, PyObject *__pyx_v_n, PyObject *__pyx_v_stream_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_13DeviceContext_24join(struct PyPetscDeviceContextObject *__pyx_v_self, PyObject *__pyx_v_join_mode, PyObject *__pyx_v_py_sub_ctxs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_13DeviceContext_26synchronize(struct PyPetscDeviceContextObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_13DeviceContext_28setFromOptions(struct PyPetscDeviceContextObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_13DeviceContext_30getCurrent(void); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_13DeviceContext_32setCurrent(PyObject *__pyx_v_dctx); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_13DeviceContext_11stream_type___get__(struct PyPetscDeviceContextObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_13DeviceContext_11stream_type_2__set__(struct PyPetscDeviceContextObject *__pyx_v_self, PyObject *__pyx_v_stype); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_13DeviceContext_6device___get__(struct PyPetscDeviceContextObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_13DeviceContext_6device_2__set__(struct PyPetscDeviceContextObject *__pyx_v_self, struct PyPetscDeviceObject *__pyx_v_device); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_13DeviceContext_7current___get__(struct PyPetscDeviceContextObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_13DeviceContext_7current_2__set__(struct PyPetscDeviceContextObject *__pyx_v_self, PyObject *__pyx_v_dctx); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_2IS___cinit__(struct PyPetscISObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_2IS_2__getbuffer__(struct PyPetscISObject *__pyx_v_self, Py_buffer *__pyx_v_view, int __pyx_v_flags); /* proto */ static void __pyx_pf_8petsc4py_5PETSc_2IS_4__releasebuffer__(struct PyPetscISObject *__pyx_v_self, Py_buffer *__pyx_v_view); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_6__enter__(struct PyPetscISObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_8__exit__(struct PyPetscISObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_10view(struct PyPetscISObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_12destroy(struct PyPetscISObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_14create(struct PyPetscISObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_16setType(struct PyPetscISObject *__pyx_v_self, PyObject *__pyx_v_is_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_18getType(struct PyPetscISObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_20createGeneral(struct PyPetscISObject *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_22createBlock(struct PyPetscISObject *__pyx_v_self, PyObject *__pyx_v_bsize, PyObject *__pyx_v_indices, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_24createStride(struct PyPetscISObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_first, PyObject *__pyx_v_step, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_26duplicate(struct PyPetscISObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_28copy(struct PyPetscISObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_result); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_30load(struct PyPetscISObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_32allGather(struct PyPetscISObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_34toGeneral(struct PyPetscISObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_36buildTwoSided(struct PyPetscISObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_toindx); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_38invertPermutation(struct PyPetscISObject *__pyx_v_self, PyObject *__pyx_v_nlocal); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_40getSize(struct PyPetscISObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_42getLocalSize(struct PyPetscISObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_44getSizes(struct PyPetscISObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_46getBlockSize(struct PyPetscISObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_48setBlockSize(struct PyPetscISObject *__pyx_v_self, PyObject *__pyx_v_bs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_50sort(struct PyPetscISObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_52isSorted(struct PyPetscISObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_54setPermutation(struct PyPetscISObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_56isPermutation(struct PyPetscISObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_58setIdentity(struct PyPetscISObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_60isIdentity(struct PyPetscISObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_62equal(struct PyPetscISObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_64sum(struct PyPetscISObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_66expand(struct PyPetscISObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_68union(struct PyPetscISObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_70difference(struct PyPetscISObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_72complement(struct PyPetscISObject *__pyx_v_self, PyObject *__pyx_v_nmin, PyObject *__pyx_v_nmax); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_74embed(struct PyPetscISObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset, PyObject *__pyx_v_drop); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_76renumber(struct PyPetscISObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_mult); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_78setIndices(struct PyPetscISObject *__pyx_v_self, PyObject *__pyx_v_indices); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_80getIndices(struct PyPetscISObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_82setBlockIndices(struct PyPetscISObject *__pyx_v_self, PyObject *__pyx_v_bsize, PyObject *__pyx_v_indices); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_84getBlockIndices(struct PyPetscISObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_86setStride(struct PyPetscISObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_first, PyObject *__pyx_v_step); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_88getStride(struct PyPetscISObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_90getInfo(struct PyPetscISObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_11permutation___get__(struct PyPetscISObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_8identity___get__(struct PyPetscISObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_6sorted___get__(struct PyPetscISObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_5sizes___get__(struct PyPetscISObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_4size___get__(struct PyPetscISObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_10local_size___get__(struct PyPetscISObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_10block_size___get__(struct PyPetscISObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_7indices___get__(struct PyPetscISObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_5array___get__(struct PyPetscISObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_19__array_interface_____get__(struct PyPetscISObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_5LGMap___cinit__(struct PyPetscLGMapObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_2__call__(struct PyPetscLGMapObject *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_result); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_4setType(struct PyPetscLGMapObject *__pyx_v_self, PyObject *__pyx_v_lgmap_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_6setFromOptions(struct PyPetscLGMapObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_8view(struct PyPetscLGMapObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_10destroy(struct PyPetscLGMapObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_12create(struct PyPetscLGMapObject *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_bsize, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_14createIS(struct PyPetscLGMapObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_16createSF(struct PyPetscLGMapObject *__pyx_v_self, struct PyPetscSFObject *__pyx_v_sf, PyObject *__pyx_v_start); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_18getSize(struct PyPetscLGMapObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_20getBlockSize(struct PyPetscLGMapObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_22getIndices(struct PyPetscLGMapObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_24getBlockIndices(struct PyPetscLGMapObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_26getInfo(struct PyPetscLGMapObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_28getBlockInfo(struct PyPetscLGMapObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_30apply(struct PyPetscLGMapObject *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_result); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_32applyBlock(struct PyPetscLGMapObject *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_result); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_34applyIS(struct PyPetscLGMapObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_36applyInverse(struct PyPetscLGMapObject *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_mode); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_38applyBlockInverse(struct PyPetscLGMapObject *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_mode); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_4size___get__(struct PyPetscLGMapObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_10block_size___get__(struct PyPetscLGMapObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_7indices___get__(struct PyPetscLGMapObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_13block_indices___get__(struct PyPetscLGMapObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_4info___get__(struct PyPetscLGMapObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_10block_info___get__(struct PyPetscLGMapObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_2SF___cinit__(struct PyPetscSFObject *__pyx_v_self); /* proto */ static void __pyx_pf_8petsc4py_5PETSc_2SF_2__dealloc__(struct PyPetscSFObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_4view(struct PyPetscSFObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_6destroy(struct PyPetscSFObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_8create(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_10setType(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_sf_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_12getType(struct PyPetscSFObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_14setFromOptions(struct PyPetscSFObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_16setUp(struct PyPetscSFObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_18reset(struct PyPetscSFObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_20getGraph(struct PyPetscSFObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_22setGraph(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_nroots, PyObject *__pyx_v_local, PyObject *__pyx_v_remote); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_24setRankOrder(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_26getMulti(struct PyPetscSFObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_28createInverse(struct PyPetscSFObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_30computeDegree(struct PyPetscSFObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_32createEmbeddedRootSF(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_selected); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_34createEmbeddedLeafSF(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_selected); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_36createSectionSF(struct PyPetscSFObject *__pyx_v_self, struct PyPetscSectionObject *__pyx_v_rootSection, PyObject *__pyx_v_remoteOffsets, struct PyPetscSectionObject *__pyx_v_leafSection); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_38distributeSection(struct PyPetscSFObject *__pyx_v_self, struct PyPetscSectionObject *__pyx_v_rootSection, struct PyPetscSectionObject *__pyx_v_leafSection); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_40compose(struct PyPetscSFObject *__pyx_v_self, struct PyPetscSFObject *__pyx_v_sf); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_42bcastBegin(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_unit, PyArrayObject *__pyx_v_rootdata, PyArrayObject *__pyx_v_leafdata, PyObject *__pyx_v_op); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_44bcastEnd(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_unit, PyArrayObject *__pyx_v_rootdata, PyArrayObject *__pyx_v_leafdata, PyObject *__pyx_v_op); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_46reduceBegin(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_unit, PyArrayObject *__pyx_v_leafdata, PyArrayObject *__pyx_v_rootdata, PyObject *__pyx_v_op); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_48reduceEnd(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_unit, PyArrayObject *__pyx_v_leafdata, PyArrayObject *__pyx_v_rootdata, PyObject *__pyx_v_op); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_50scatterBegin(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_unit, PyArrayObject *__pyx_v_multirootdata, PyArrayObject *__pyx_v_leafdata); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_52scatterEnd(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_unit, PyArrayObject *__pyx_v_multirootdata, PyArrayObject *__pyx_v_leafdata); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_54gatherBegin(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_unit, PyArrayObject *__pyx_v_leafdata, PyArrayObject *__pyx_v_multirootdata); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_56gatherEnd(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_unit, PyArrayObject *__pyx_v_leafdata, PyArrayObject *__pyx_v_multirootdata); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_58fetchAndOpBegin(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_unit, PyObject *__pyx_v_rootdata, PyObject *__pyx_v_leafdata, PyObject *__pyx_v_leafupdate, PyObject *__pyx_v_op); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_60fetchAndOpEnd(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_unit, PyObject *__pyx_v_rootdata, PyObject *__pyx_v_leafdata, PyObject *__pyx_v_leafupdate, PyObject *__pyx_v_op); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_3Vec___cinit__(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_2__pos__(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_4__neg__(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_6__abs__(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_8__iadd__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_10__isub__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_12__imul__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_14__idiv__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ #endif static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_16__itruediv__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_18__add__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_20__radd__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_22__sub__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_24__rsub__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_26__mul__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_28__rmul__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_30__div__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ #endif #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_32__rdiv__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ #endif static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_34__truediv__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_36__rtruediv__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ #if PY_VERSION_HEX >= 0x03050000 static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_38__matmul__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ #endif static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_40__getitem__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_i); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_3Vec_42__setitem__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_i, PyObject *__pyx_v_v); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_3Vec_44__getbuffer__(struct PyPetscVecObject *__pyx_v_self, Py_buffer *__pyx_v_view, int __pyx_v_flags); /* proto */ static void __pyx_pf_8petsc4py_5PETSc_3Vec_46__releasebuffer__(struct PyPetscVecObject *__pyx_v_self, Py_buffer *__pyx_v_view); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_48__enter__(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_50__exit__(struct PyPetscVecObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_52view(struct PyPetscVecObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_54destroy(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_56create(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_58setType(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_vec_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_60setSizes(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_62createSeq(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_64createMPI(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_66createWithArray(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_array, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_68createCUDAWithArrays(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_cpuarray, PyObject *__pyx_v_cudahandle, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_70createHIPWithArrays(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_cpuarray, PyObject *__pyx_v_hiphandle, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_72createViennaCLWithArrays(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_cpuarray, PyObject *__pyx_v_viennaclvechandle, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_74createWithDLPack(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_dltensor, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_76attachDLPackInfo(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec, PyObject *__pyx_v_dltensor); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_78clearDLPackInfo(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_80__dlpack__(struct PyPetscVecObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_stream); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_82__dlpack_device__(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_84toDLPack(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_mode); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_86createGhost(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_ghosts, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_88createGhostWithArray(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_ghosts, PyObject *__pyx_v_array, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_90createShared(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_92createNest(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_vecs, PyObject *__pyx_v_isets, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_94setOptionsPrefix(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_prefix); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_96getOptionsPrefix(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_98appendOptionsPrefix(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_prefix); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_100setFromOptions(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_102setUp(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_104setOption(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_option, PyObject *__pyx_v_flag); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_106getType(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_108getSize(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_110getLocalSize(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_112getSizes(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_114setBlockSize(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_bsize); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_116getBlockSize(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_118getOwnershipRange(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_120getOwnershipRanges(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_122createLocalVector(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_124getLocalVector(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_lvec, PyObject *__pyx_v_readonly); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_126restoreLocalVector(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_lvec, PyObject *__pyx_v_readonly); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_128getBuffer(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_readonly); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_130getArray(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_readonly); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_132setArray(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_array); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_134placeArray(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_array); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_136resetArray(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_force); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_138bindToCPU(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_flg); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_140boundToCPU(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_142getCUDAHandle(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_mode); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_144restoreCUDAHandle(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_handle, PyObject *__pyx_v_mode); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_146getHIPHandle(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_mode); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_148restoreHIPHandle(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_handle, PyObject *__pyx_v_mode); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_150getOffloadMask(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_152getCLContextHandle(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_154getCLQueueHandle(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_156getCLMemHandle(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_mode); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_158restoreCLMemHandle(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_160duplicate(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_array); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_162copy(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_result); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_164chop(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_tol); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_166load(struct PyPetscVecObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_168equal(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_170dot(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_172dotBegin(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_174dotEnd(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_176tDot(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_178tDotBegin(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_180tDotEnd(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_182mDot(CYTHON_UNUSED struct PyPetscVecObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_vecs, CYTHON_UNUSED PyObject *__pyx_v_out); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_184mDotBegin(CYTHON_UNUSED struct PyPetscVecObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_vecs, CYTHON_UNUSED PyObject *__pyx_v_out); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_186mDotEnd(CYTHON_UNUSED struct PyPetscVecObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_vecs, CYTHON_UNUSED PyObject *__pyx_v_out); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_188mtDot(CYTHON_UNUSED struct PyPetscVecObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_vecs, CYTHON_UNUSED PyObject *__pyx_v_out); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_190mtDotBegin(CYTHON_UNUSED struct PyPetscVecObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_vecs, CYTHON_UNUSED PyObject *__pyx_v_out); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_192mtDotEnd(CYTHON_UNUSED struct PyPetscVecObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_vecs, CYTHON_UNUSED PyObject *__pyx_v_out); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_194norm(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_norm_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_196normBegin(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_norm_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_198normEnd(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_norm_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_200dotNorm2(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_202sum(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_204min(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_206max(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_208normalize(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_210reciprocal(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_212exp(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_214log(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_216sqrtabs(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_218abs(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_220conjugate(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_222setRandom(struct PyPetscVecObject *__pyx_v_self, struct PyPetscRandomObject *__pyx_v_random); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_224permute(struct PyPetscVecObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_order, PyObject *__pyx_v_invert); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_226zeroEntries(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_228set(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_alpha); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_230isset(struct PyPetscVecObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_idx, PyObject *__pyx_v_alpha); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_232scale(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_alpha); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_234shift(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_alpha); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_236swap(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_238axpy(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_alpha, struct PyPetscVecObject *__pyx_v_x); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_240isaxpy(struct PyPetscVecObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_idx, PyObject *__pyx_v_alpha, struct PyPetscVecObject *__pyx_v_x); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_242aypx(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_alpha, struct PyPetscVecObject *__pyx_v_x); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_244axpby(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_alpha, PyObject *__pyx_v_beta, struct PyPetscVecObject *__pyx_v_x); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_246waxpy(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_alpha, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_248maxpy(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_alphas, PyObject *__pyx_v_vecs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_250pointwiseMult(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_252pointwiseDivide(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_254pointwiseMin(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_256pointwiseMax(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_258pointwiseMaxAbs(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_260maxPointwiseDivide(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_262getValue(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_index); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_264getValues(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_values); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_266getValuesStagStencil(CYTHON_UNUSED struct PyPetscVecObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_indices, CYTHON_UNUSED PyObject *__pyx_v_values); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_268setValue(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value, PyObject *__pyx_v_addv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_270setValues(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_values, PyObject *__pyx_v_addv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_272setValuesBlocked(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_values, PyObject *__pyx_v_addv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_274setValuesStagStencil(CYTHON_UNUSED struct PyPetscVecObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_indices, CYTHON_UNUSED PyObject *__pyx_v_values, CYTHON_UNUSED PyObject *__pyx_v_addv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_276setLGMap(struct PyPetscVecObject *__pyx_v_self, struct PyPetscLGMapObject *__pyx_v_lgmap); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_278getLGMap(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_280setValueLocal(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value, PyObject *__pyx_v_addv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_282setValuesLocal(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_values, PyObject *__pyx_v_addv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_284setValuesBlockedLocal(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_values, PyObject *__pyx_v_addv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_286assemblyBegin(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_288assemblyEnd(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_290assemble(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_292strideScale(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_alpha); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_294strideSum(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_field); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_296strideMin(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_field); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_298strideMax(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_field); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_300strideNorm(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_norm_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_302strideScatter(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_field, struct PyPetscVecObject *__pyx_v_vec, PyObject *__pyx_v_addv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_304strideGather(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_field, struct PyPetscVecObject *__pyx_v_vec, PyObject *__pyx_v_addv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_306localForm(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_308ghostUpdateBegin(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_addv, PyObject *__pyx_v_mode); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_310ghostUpdateEnd(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_addv, PyObject *__pyx_v_mode); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_312ghostUpdate(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_addv, PyObject *__pyx_v_mode); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_314setMPIGhost(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_ghosts); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_316getSubVector(struct PyPetscVecObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset, struct PyPetscVecObject *__pyx_v_subvec); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_318restoreSubVector(struct PyPetscVecObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset, struct PyPetscVecObject *__pyx_v_subvec); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_320getNestSubVecs(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_322setNestSubVecs(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_sx, PyObject *__pyx_v_idxm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_324setDM(struct PyPetscVecObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_326getDM(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_5sizes___get__(struct PyPetscVecObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_3Vec_5sizes_2__set__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_4size___get__(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_10local_size___get__(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_10block_size___get__(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_11owner_range___get__(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_12owner_ranges___get__(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_8buffer_w___get__(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_8buffer_r___get__(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_7array_w___get__(struct PyPetscVecObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_3Vec_7array_w_2__set__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_7array_r___get__(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_6buffer___get__(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_5array___get__(struct PyPetscVecObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_3Vec_5array_2__set__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_19__array_interface_____get__(struct PyPetscVecObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_4Quad___cinit__(struct PyPetscQuadObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4Quad_2view(struct PyPetscQuadObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4Quad_4create(struct PyPetscQuadObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4Quad_6duplicate(struct PyPetscQuadObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4Quad_8destroy(struct PyPetscQuadObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4Quad_10getData(struct PyPetscQuadObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4Quad_12getNumComponents(struct PyPetscQuadObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4Quad_14setNumComponents(struct PyPetscQuadObject *__pyx_v_self, PyObject *__pyx_v_nc); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4Quad_16getOrder(struct PyPetscQuadObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4Quad_18setOrder(struct PyPetscQuadObject *__pyx_v_self, PyObject *__pyx_v_order); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_2FE___cinit__(struct PyPetscFEObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_2view(struct PyPetscFEObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_4destroy(struct PyPetscFEObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_6create(struct PyPetscFEObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_8createDefault(struct PyPetscFEObject *__pyx_v_self, PyObject *__pyx_v_dim, PyObject *__pyx_v_nc, PyObject *__pyx_v_isSimplex, PyObject *__pyx_v_qorder, PyObject *__pyx_v_prefix, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_10createLagrange(struct PyPetscFEObject *__pyx_v_self, PyObject *__pyx_v_dim, PyObject *__pyx_v_nc, PyObject *__pyx_v_isSimplex, PyObject *__pyx_v_k, PyObject *__pyx_v_qorder, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_12getQuadrature(struct PyPetscFEObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_14getDimension(struct PyPetscFEObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_16getSpatialDimension(struct PyPetscFEObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_18getNumComponents(struct PyPetscFEObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_20setNumComponents(struct PyPetscFEObject *__pyx_v_self, PyObject *__pyx_v_comp); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_22getNumDof(struct PyPetscFEObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_24getTileSizes(struct PyPetscFEObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_26setTileSizes(struct PyPetscFEObject *__pyx_v_self, PyObject *__pyx_v_blockSize, PyObject *__pyx_v_numBlocks, PyObject *__pyx_v_batchSize, PyObject *__pyx_v_numBatches); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_28getFaceQuadrature(struct PyPetscFEObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_30setQuadrature(struct PyPetscFEObject *__pyx_v_self, struct PyPetscQuadObject *__pyx_v_quad); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_32setFaceQuadrature(struct PyPetscFEObject *__pyx_v_self, struct PyPetscQuadObject *__pyx_v_quad); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_34setType(struct PyPetscFEObject *__pyx_v_self, PyObject *__pyx_v_fe_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_36getBasisSpace(struct PyPetscFEObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_38setBasisSpace(struct PyPetscFEObject *__pyx_v_self, struct PyPetscSpaceObject *__pyx_v_sp); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_40setFromOptions(struct PyPetscFEObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_42setUp(struct PyPetscFEObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_44getDualSpace(struct PyPetscFEObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_46setDualSpace(struct PyPetscFEObject *__pyx_v_self, struct PyPetscDualSpaceObject *__pyx_v_dspace); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_48viewFromOptions(struct PyPetscFEObject *__pyx_v_self, PyObject *__pyx_v_name, struct PyPetscObjectObject *__pyx_v_obj); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_7Scatter___cinit__(struct PyPetscScatterObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_2__call__(struct PyPetscScatterObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_addv, PyObject *__pyx_v_mode); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_4view(struct PyPetscScatterObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_6destroy(struct PyPetscScatterObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_8create(struct PyPetscScatterObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec_from, struct PyPetscISObject *__pyx_v_is_from, struct PyPetscVecObject *__pyx_v_vec_to, struct PyPetscISObject *__pyx_v_is_to); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_10setType(struct PyPetscScatterObject *__pyx_v_self, PyObject *__pyx_v_scatter_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_12getType(struct PyPetscScatterObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_14setFromOptions(struct PyPetscScatterObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_16setUp(struct PyPetscScatterObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_18copy(struct PyPetscScatterObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_20toAll(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, struct PyPetscVecObject *__pyx_v_vec); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_22toZero(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, struct PyPetscVecObject *__pyx_v_vec); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_24begin(struct PyPetscScatterObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec_from, struct PyPetscVecObject *__pyx_v_vec_to, PyObject *__pyx_v_addv, PyObject *__pyx_v_mode); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_26end(struct PyPetscScatterObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec_from, struct PyPetscVecObject *__pyx_v_vec_to, PyObject *__pyx_v_addv, PyObject *__pyx_v_mode); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_28scatter(struct PyPetscScatterObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec_from, struct PyPetscVecObject *__pyx_v_vec_to, PyObject *__pyx_v_addv, PyObject *__pyx_v_mode); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_7Section___cinit__(struct PyPetscSectionObject *__pyx_v_self); /* proto */ static void __pyx_pf_8petsc4py_5PETSc_7Section_2__dealloc__(struct PyPetscSectionObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_4view(struct PyPetscSectionObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_6destroy(struct PyPetscSectionObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_8create(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_10clone(struct PyPetscSectionObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_12setUp(struct PyPetscSectionObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_14reset(struct PyPetscSectionObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_16getNumFields(struct PyPetscSectionObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_18setNumFields(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_numFields); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_20getFieldName(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_field); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_22setFieldName(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_fieldName); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_24getFieldComponents(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_field); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_26setFieldComponents(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_numComp); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_28getChart(struct PyPetscSectionObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_30setChart(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_pStart, PyObject *__pyx_v_pEnd); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_32getPermutation(struct PyPetscSectionObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_34setPermutation(struct PyPetscSectionObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_perm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_36getDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_38setDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_numDof); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_40addDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_numDof); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_42getFieldDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_44setFieldDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field, PyObject *__pyx_v_numDof); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_46addFieldDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field, PyObject *__pyx_v_numDof); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_48getConstraintDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_50setConstraintDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_numDof); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_52addConstraintDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_numDof); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_54getFieldConstraintDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_56setFieldConstraintDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field, PyObject *__pyx_v_numDof); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_58addFieldConstraintDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field, PyObject *__pyx_v_numDof); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_60getConstraintIndices(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_62setConstraintIndices(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_indices); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_64getFieldConstraintIndices(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_66setFieldConstraintIndices(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field, PyObject *__pyx_v_indices); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_68getMaxDof(struct PyPetscSectionObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_70getStorageSize(struct PyPetscSectionObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_72getConstrainedStorageSize(struct PyPetscSectionObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_74getOffset(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_76setOffset(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_offset); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_78getFieldOffset(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_80setFieldOffset(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field, PyObject *__pyx_v_offset); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_82getOffsetRange(struct PyPetscSectionObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_84createGlobalSection(struct PyPetscSectionObject *__pyx_v_self, struct PyPetscSFObject *__pyx_v_sf); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_10MatStencil_1i___get__(struct __pyx_obj_8petsc4py_5PETSc_MatStencil *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_10MatStencil_1i_2__set__(struct __pyx_obj_8petsc4py_5PETSc_MatStencil *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_10MatStencil_1j___get__(struct __pyx_obj_8petsc4py_5PETSc_MatStencil *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_10MatStencil_1j_2__set__(struct __pyx_obj_8petsc4py_5PETSc_MatStencil *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_10MatStencil_1k___get__(struct __pyx_obj_8petsc4py_5PETSc_MatStencil *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_10MatStencil_1k_2__set__(struct __pyx_obj_8petsc4py_5PETSc_MatStencil *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_10MatStencil_1c___get__(struct __pyx_obj_8petsc4py_5PETSc_MatStencil *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_10MatStencil_1c_2__set__(struct __pyx_obj_8petsc4py_5PETSc_MatStencil *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_10MatStencil_5index___get__(struct __pyx_obj_8petsc4py_5PETSc_MatStencil *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_10MatStencil_5index_2__set__(struct __pyx_obj_8petsc4py_5PETSc_MatStencil *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_10MatStencil_5field___get__(struct __pyx_obj_8petsc4py_5PETSc_MatStencil *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_10MatStencil_5field_2__set__(struct __pyx_obj_8petsc4py_5PETSc_MatStencil *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_3Mat___cinit__(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_2__pos__(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_4__neg__(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_6__iadd__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_8__isub__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_10__imul__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_12__idiv__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ #endif static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_14__itruediv__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_16__add__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_18__radd__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_20__sub__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_22__rsub__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_24__mul__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_26__rmul__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_28__div__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ #endif #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_30__rdiv__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ #endif static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_32__truediv__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_34__rtruediv__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ #if PY_VERSION_HEX >= 0x03050000 static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_36__matmul__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ #endif static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_38__getitem__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_ij); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_3Mat_40__setitem__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_ij, PyObject *__pyx_v_v); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_42__call__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_44view(struct PyPetscMatObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_46destroy(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_48create(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_50setType(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_mat_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_52setSizes(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_54setBlockSize(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_bsize); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_56setBlockSizes(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_row_bsize, PyObject *__pyx_v_col_bsize); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_58setVecType(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_vec_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_60getVecType(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_62setNestVecType(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_vec_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_64createAIJ(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PyObject *__pyx_v_nnz, PyObject *__pyx_v_csr, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_66createBAIJ(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PyObject *__pyx_v_nnz, PyObject *__pyx_v_csr, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_68createSBAIJ(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PyObject *__pyx_v_nnz, PyObject *__pyx_v_csr, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_70createAIJCRL(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PyObject *__pyx_v_nnz, PyObject *__pyx_v_csr, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_72setPreallocationNNZ(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_nnz); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_74setPreallocationCSR(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_csr); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_76createAIJWithArrays(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_csr, PyObject *__pyx_v_bsize, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_78createDense(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PyObject *__pyx_v_array, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_80createDenseCUDA(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PyObject *__pyx_v_array, PyObject *__pyx_v_cudahandle, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_82setPreallocationDense(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_array); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_84createScatter(struct PyPetscMatObject *__pyx_v_self, struct PyPetscScatterObject *__pyx_v_scatter, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_86createNormal(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_88createTranspose(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_90createNormalHermitian(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_92createHermitianTranspose(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_94createLRC(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_A, struct PyPetscMatObject *__pyx_v_U, struct PyPetscVecObject *__pyx_v_c, struct PyPetscMatObject *__pyx_v_V); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_96createSubMatrixVirtual(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_A, struct PyPetscISObject *__pyx_v_isrow, struct PyPetscISObject *__pyx_v_iscol); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_98createNest(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_mats, PyObject *__pyx_v_isrows, PyObject *__pyx_v_iscols, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_100createH2OpusFromMat(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_A, PyObject *__pyx_v_coordinates, PyObject *__pyx_v_dist, PyObject *__pyx_v_eta, PyObject *__pyx_v_leafsize, PyObject *__pyx_v_maxrank, PyObject *__pyx_v_bs, PyObject *__pyx_v_rtol); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_102createIS(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_size, struct PyPetscLGMapObject *__pyx_v_lgmapr, struct PyPetscLGMapObject *__pyx_v_lgmapc, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_104createConstantDiagonal(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_diag, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_106createDiagonal(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_diag); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_108createPython(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_context, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_110setPythonContext(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_context); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_112getPythonContext(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_114setPythonType(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_py_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_116getPythonType(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_118setOptionsPrefix(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_prefix); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_120getOptionsPrefix(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_122appendOptionsPrefix(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_prefix); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_124setFromOptions(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_126setUp(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_128setOption(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_option, PyObject *__pyx_v_flag); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_130getOption(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_option); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_132getType(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_134getSize(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_136getLocalSize(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_138getSizes(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_140getBlockSize(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_142getBlockSizes(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_144getOwnershipRange(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_146getOwnershipRanges(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_148getOwnershipRangeColumn(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_150getOwnershipRangesColumn(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_152getOwnershipIS(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_154getInfo(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_info); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_156duplicate(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_copy); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_158copy(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_result, PyObject *__pyx_v_structure); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_160load(struct PyPetscMatObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_162convert(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_mat_type, struct PyPetscMatObject *__pyx_v_out); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_164transpose(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_out); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_166setTransposePrecursor(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_out); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_168hermitianTranspose(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_out); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_170realPart(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_out); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_172imagPart(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_out); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_174conjugate(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_out); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_176permute(struct PyPetscMatObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_row, struct PyPetscISObject *__pyx_v_col); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_178equal(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_180isTranspose(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat, PyObject *__pyx_v_tol); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_182isSymmetric(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_tol); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_184isSymmetricKnown(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_186isHermitian(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_tol); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_188isHermitianKnown(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_190isStructurallySymmetric(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_192zeroEntries(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_194getValue(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_row, PyObject *__pyx_v_col); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_196getValues(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_rows, PyObject *__pyx_v_cols, PyObject *__pyx_v_values); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_198getValuesCSR(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_200getRow(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_row); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_202getRowIJ(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_symmetric, PyObject *__pyx_v_compressed); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_204getColumnIJ(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_symmetric, PyObject *__pyx_v_compressed); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_206setValue(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_row, PyObject *__pyx_v_col, PyObject *__pyx_v_value, PyObject *__pyx_v_addv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_208setValues(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_rows, PyObject *__pyx_v_cols, PyObject *__pyx_v_values, PyObject *__pyx_v_addv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_210setValuesRCV(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_R, PyObject *__pyx_v_C, PyObject *__pyx_v_V, PyObject *__pyx_v_addv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_212setValuesIJV(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_I, PyObject *__pyx_v_J, PyObject *__pyx_v_V, PyObject *__pyx_v_addv, PyObject *__pyx_v_rowmap); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_214setValuesCSR(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_I, PyObject *__pyx_v_J, PyObject *__pyx_v_V, PyObject *__pyx_v_addv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_216setValuesBlocked(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_rows, PyObject *__pyx_v_cols, PyObject *__pyx_v_values, PyObject *__pyx_v_addv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_218setValuesBlockedRCV(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_R, PyObject *__pyx_v_C, PyObject *__pyx_v_V, PyObject *__pyx_v_addv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_220setValuesBlockedIJV(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_I, PyObject *__pyx_v_J, PyObject *__pyx_v_V, PyObject *__pyx_v_addv, PyObject *__pyx_v_rowmap); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_222setValuesBlockedCSR(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_I, PyObject *__pyx_v_J, PyObject *__pyx_v_V, PyObject *__pyx_v_addv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_224setLGMap(struct PyPetscMatObject *__pyx_v_self, struct PyPetscLGMapObject *__pyx_v_rmap, struct PyPetscLGMapObject *__pyx_v_cmap); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_226getLGMap(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_228setValueLocal(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_row, PyObject *__pyx_v_col, PyObject *__pyx_v_value, PyObject *__pyx_v_addv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_230setValuesLocal(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_rows, PyObject *__pyx_v_cols, PyObject *__pyx_v_values, PyObject *__pyx_v_addv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_232setValuesLocalRCV(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_R, PyObject *__pyx_v_C, PyObject *__pyx_v_V, PyObject *__pyx_v_addv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_234setValuesLocalIJV(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_I, PyObject *__pyx_v_J, PyObject *__pyx_v_V, PyObject *__pyx_v_addv, PyObject *__pyx_v_rowmap); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_236setValuesLocalCSR(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_I, PyObject *__pyx_v_J, PyObject *__pyx_v_V, PyObject *__pyx_v_addv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_238setValuesBlockedLocal(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_rows, PyObject *__pyx_v_cols, PyObject *__pyx_v_values, PyObject *__pyx_v_addv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_240setValuesBlockedLocalRCV(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_R, PyObject *__pyx_v_C, PyObject *__pyx_v_V, PyObject *__pyx_v_addv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_242setValuesBlockedLocalIJV(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_I, PyObject *__pyx_v_J, PyObject *__pyx_v_V, PyObject *__pyx_v_addv, PyObject *__pyx_v_rowmap); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_244setValuesBlockedLocalCSR(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_I, PyObject *__pyx_v_J, PyObject *__pyx_v_V, PyObject *__pyx_v_addv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_246setStencil(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_dims, PyObject *__pyx_v_starts, PyObject *__pyx_v_dof); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_248setValueStencil(struct PyPetscMatObject *__pyx_v_self, struct __pyx_obj_8petsc4py_5PETSc_MatStencil *__pyx_v_row, struct __pyx_obj_8petsc4py_5PETSc_MatStencil *__pyx_v_col, PyObject *__pyx_v_value, PyObject *__pyx_v_addv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_250setValueStagStencil(CYTHON_UNUSED struct PyPetscMatObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_row, CYTHON_UNUSED PyObject *__pyx_v_col, CYTHON_UNUSED PyObject *__pyx_v_value, CYTHON_UNUSED PyObject *__pyx_v_addv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_252setValueBlockedStencil(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_row, PyObject *__pyx_v_col, PyObject *__pyx_v_value, PyObject *__pyx_v_addv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_254setValueBlockedStagStencil(CYTHON_UNUSED struct PyPetscMatObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_row, CYTHON_UNUSED PyObject *__pyx_v_col, CYTHON_UNUSED PyObject *__pyx_v_value, CYTHON_UNUSED PyObject *__pyx_v_addv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_256zeroRows(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_rows, PyObject *__pyx_v_diag, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_b); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_258zeroRowsLocal(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_rows, PyObject *__pyx_v_diag, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_b); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_260zeroRowsColumns(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_rows, PyObject *__pyx_v_diag, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_b); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_262zeroRowsColumnsLocal(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_rows, PyObject *__pyx_v_diag, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_b); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_264zeroRowsColumnsStencil(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_rows, PyObject *__pyx_v_diag, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_b); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_266storeValues(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_268retrieveValues(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_270assemblyBegin(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_assembly); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_272assemblyEnd(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_assembly); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_274assemble(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_assembly); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_276isAssembled(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_278findZeroRows(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_280createVecs(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_side); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_282createVecRight(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_284createVecLeft(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_286getColumnVector(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_column, struct PyPetscVecObject *__pyx_v_result); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_288getRedundantMatrix(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_nsubcomm, PyObject *__pyx_v_subcomm, struct PyPetscMatObject *__pyx_v_out); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_290getDiagonal(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_result); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_292getRowSum(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_result); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_294setDiagonal(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_diag, PyObject *__pyx_v_addv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_296diagonalScale(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_L, struct PyPetscVecObject *__pyx_v_R); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_298invertBlockDiagonal(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_300setNullSpace(struct PyPetscMatObject *__pyx_v_self, struct PyPetscNullSpaceObject *__pyx_v_nsp); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_302getNullSpace(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_304setTransposeNullSpace(struct PyPetscMatObject *__pyx_v_self, struct PyPetscNullSpaceObject *__pyx_v_nsp); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_306getTransposeNullSpace(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_308setNearNullSpace(struct PyPetscMatObject *__pyx_v_self, struct PyPetscNullSpaceObject *__pyx_v_nsp); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_310getNearNullSpace(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_312mult(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_314multAdd(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_v, struct PyPetscVecObject *__pyx_v_y); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_316multTranspose(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_318multTransposeAdd(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_v, struct PyPetscVecObject *__pyx_v_y); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_320multHermitian(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_322multHermitianAdd(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_v, struct PyPetscVecObject *__pyx_v_y); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_324SOR(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_b, struct PyPetscVecObject *__pyx_v_x, PyObject *__pyx_v_omega, PyObject *__pyx_v_sortype, PyObject *__pyx_v_shift, PyObject *__pyx_v_its, PyObject *__pyx_v_lits); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_326getDiagonalBlock(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_328increaseOverlap(struct PyPetscMatObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset, PyObject *__pyx_v_overlap); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_330createSubMatrix(struct PyPetscMatObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_isrow, struct PyPetscISObject *__pyx_v_iscol, struct PyPetscMatObject *__pyx_v_submat); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_332createSubMatrices(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_isrows, PyObject *__pyx_v_iscols, PyObject *__pyx_v_submats); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_334getLocalSubMatrix(struct PyPetscMatObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_isrow, struct PyPetscISObject *__pyx_v_iscol, struct PyPetscMatObject *__pyx_v_submat); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_336restoreLocalSubMatrix(struct PyPetscMatObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_isrow, struct PyPetscISObject *__pyx_v_iscol, struct PyPetscMatObject *__pyx_v_submat); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_338norm(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_norm_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_340scale(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_alpha); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_342shift(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_alpha); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_344chop(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_tol); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_346setRandom(struct PyPetscMatObject *__pyx_v_self, struct PyPetscRandomObject *__pyx_v_random); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_348axpy(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_alpha, struct PyPetscMatObject *__pyx_v_X, PyObject *__pyx_v_structure); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_350aypx(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_alpha, struct PyPetscMatObject *__pyx_v_X, PyObject *__pyx_v_structure); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_352matMult(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat, struct PyPetscMatObject *__pyx_v_result, PyObject *__pyx_v_fill); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_354matTransposeMult(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat, struct PyPetscMatObject *__pyx_v_result, PyObject *__pyx_v_fill); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_356transposeMatMult(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat, struct PyPetscMatObject *__pyx_v_result, PyObject *__pyx_v_fill); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_358ptap(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_P, struct PyPetscMatObject *__pyx_v_result, PyObject *__pyx_v_fill); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_360rart(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_R, struct PyPetscMatObject *__pyx_v_result, PyObject *__pyx_v_fill); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_362matMatMult(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_B, struct PyPetscMatObject *__pyx_v_C, struct PyPetscMatObject *__pyx_v_result, PyObject *__pyx_v_fill); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_364kron(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat, struct PyPetscMatObject *__pyx_v_result); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_366bindToCPU(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_flg); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_368boundToCPU(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_370getOrdering(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_ord_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_372reorderForNonzeroDiagonal(struct PyPetscMatObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_isrow, struct PyPetscISObject *__pyx_v_iscol, PyObject *__pyx_v_atol); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_374factorLU(struct PyPetscMatObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_isrow, struct PyPetscISObject *__pyx_v_iscol, PyObject *__pyx_v_options); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_376factorSymbolicLU(CYTHON_UNUSED struct PyPetscMatObject *__pyx_v_self, CYTHON_UNUSED struct PyPetscMatObject *__pyx_v_mat, CYTHON_UNUSED struct PyPetscISObject *__pyx_v_isrow, CYTHON_UNUSED struct PyPetscISObject *__pyx_v_iscol, CYTHON_UNUSED PyObject *__pyx_v_options); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_378factorNumericLU(CYTHON_UNUSED struct PyPetscMatObject *__pyx_v_self, CYTHON_UNUSED struct PyPetscMatObject *__pyx_v_mat, CYTHON_UNUSED PyObject *__pyx_v_options); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_380factorILU(struct PyPetscMatObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_isrow, struct PyPetscISObject *__pyx_v_iscol, PyObject *__pyx_v_options); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_382factorSymbolicILU(CYTHON_UNUSED struct PyPetscMatObject *__pyx_v_self, CYTHON_UNUSED struct PyPetscISObject *__pyx_v_isrow, CYTHON_UNUSED struct PyPetscISObject *__pyx_v_iscol, CYTHON_UNUSED PyObject *__pyx_v_options); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_384factorCholesky(struct PyPetscMatObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_isperm, PyObject *__pyx_v_options); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_386factorSymbolicCholesky(CYTHON_UNUSED struct PyPetscMatObject *__pyx_v_self, CYTHON_UNUSED struct PyPetscISObject *__pyx_v_isperm, CYTHON_UNUSED PyObject *__pyx_v_options); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_388factorNumericCholesky(CYTHON_UNUSED struct PyPetscMatObject *__pyx_v_self, CYTHON_UNUSED struct PyPetscMatObject *__pyx_v_mat, CYTHON_UNUSED PyObject *__pyx_v_options); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_390factorICC(struct PyPetscMatObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_isperm, PyObject *__pyx_v_options); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_392factorSymbolicICC(CYTHON_UNUSED struct PyPetscMatObject *__pyx_v_self, CYTHON_UNUSED struct PyPetscISObject *__pyx_v_isperm, CYTHON_UNUSED PyObject *__pyx_v_options); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_394getInertia(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_396setUnfactored(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_398fixISLocalEmpty(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_fix); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_400getISLocalMat(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_402restoreISLocalMat(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_local); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_404setISLocalMat(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_local); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_406setISPreallocation(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_nnz, PyObject *__pyx_v_onnz); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_408getLRCMats(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_410setLRCMats(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_A, struct PyPetscMatObject *__pyx_v_U, struct PyPetscVecObject *__pyx_v_c, struct PyPetscMatObject *__pyx_v_V); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_412H2OpusOrthogonalize(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_414H2OpusCompress(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_tol); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_416H2OpusLowRankUpdate(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_U, struct PyPetscMatObject *__pyx_v_V, PyObject *__pyx_v_s); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_418setMumpsIcntl(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_icntl, PyObject *__pyx_v_ival); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_420getMumpsIcntl(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_icntl); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_422setMumpsCntl(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_icntl, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_424getMumpsCntl(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_icntl); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_426getMumpsInfo(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_icntl); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_428getMumpsInfog(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_icntl); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_430getMumpsRinfo(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_icntl); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_432getMumpsRinfog(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_icntl); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_434solveForward(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_b, struct PyPetscVecObject *__pyx_v_x); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_436solveBackward(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_b, struct PyPetscVecObject *__pyx_v_x); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_438solve(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_b, struct PyPetscVecObject *__pyx_v_x); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_440solveTranspose(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_b, struct PyPetscVecObject *__pyx_v_x); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_442solveAdd(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_b, struct PyPetscVecObject *__pyx_v_y, struct PyPetscVecObject *__pyx_v_x); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_444solveTransposeAdd(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_b, struct PyPetscVecObject *__pyx_v_y, struct PyPetscVecObject *__pyx_v_x); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_446matSolve(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_B, struct PyPetscMatObject *__pyx_v_X); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_448setDenseLDA(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_lda); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_450getDenseLDA(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_452getDenseArray(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_readonly); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_454getDenseLocalMatrix(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_456getDenseColumnVec(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_i, PyObject *__pyx_v_mode); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_458restoreDenseColumnVec(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_i, PyObject *__pyx_v_mode); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_460getNestSize(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_462getNestISs(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_464getNestLocalISs(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_466getNestSubMatrix(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_i, PyObject *__pyx_v_j); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_468getDM(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_470setDM(struct PyPetscMatObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_5sizes___get__(struct PyPetscMatObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_3Mat_5sizes_2__set__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_4size___get__(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_10local_size___get__(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_10block_size___get__(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_11block_sizes___get__(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_11owner_range___get__(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_12owner_ranges___get__(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_9assembled___get__(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_9symmetric___get__(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_9hermitian___get__(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_10structsymm___get__(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_472__dlpack__(struct PyPetscMatObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_stream); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_474__dlpack_device__(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_476toDLPack(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_mode); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_9NullSpace___cinit__(struct PyPetscNullSpaceObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_9NullSpace_2__call__(struct PyPetscNullSpaceObject *__pyx_v_self, PyObject *__pyx_v_vec); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_9NullSpace_4view(struct PyPetscNullSpaceObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_9NullSpace_6destroy(struct PyPetscNullSpaceObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_9NullSpace_8create(struct PyPetscNullSpaceObject *__pyx_v_self, PyObject *__pyx_v_constant, PyObject *__pyx_v_vectors, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_9NullSpace_10createRigidBody(struct PyPetscNullSpaceObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_coords); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_9NullSpace_12setFunction(struct PyPetscNullSpaceObject *__pyx_v_self, PyObject *__pyx_v_function, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_9NullSpace_14hasConstant(struct PyPetscNullSpaceObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_9NullSpace_16getVecs(struct PyPetscNullSpaceObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_9NullSpace_18getFunction(struct PyPetscNullSpaceObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_9NullSpace_20remove(struct PyPetscNullSpaceObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_9NullSpace_22test(struct PyPetscNullSpaceObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_15MatPartitioning___cinit__(struct PyPetscMatPartitioningObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_15MatPartitioning_2__call__(struct PyPetscMatPartitioningObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_15MatPartitioning_4view(struct PyPetscMatPartitioningObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_15MatPartitioning_6destroy(struct PyPetscMatPartitioningObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_15MatPartitioning_8create(struct PyPetscMatPartitioningObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_15MatPartitioning_10setType(struct PyPetscMatPartitioningObject *__pyx_v_self, PyObject *__pyx_v_matpartitioning_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_15MatPartitioning_12getType(struct PyPetscMatPartitioningObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_15MatPartitioning_14setFromOptions(struct PyPetscMatPartitioningObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_15MatPartitioning_16setAdjacency(struct PyPetscMatPartitioningObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_adj); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_15MatPartitioning_18apply(struct PyPetscMatPartitioningObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_partitioning); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_2PC___cinit__(struct PyPetscPCObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_2__call__(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_4view(struct PyPetscPCObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_6destroy(struct PyPetscPCObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_8create(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_10setType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_pc_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_12getType(struct PyPetscPCObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_14setOptionsPrefix(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_prefix); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_16getOptionsPrefix(struct PyPetscPCObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_18appendOptionsPrefix(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_prefix); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_20setFromOptions(struct PyPetscPCObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_22setOperators(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_A, struct PyPetscMatObject *__pyx_v_P); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_24getOperators(struct PyPetscPCObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_26setUseAmat(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_28getUseAmat(struct PyPetscPCObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_30setReusePreconditioner(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_32setFailedReason(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_reason); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_34getFailedReason(struct PyPetscPCObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_36getFailedReasonRank(struct PyPetscPCObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_38setUp(struct PyPetscPCObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_40reset(struct PyPetscPCObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_42setUpOnBlocks(struct PyPetscPCObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_44apply(struct PyPetscPCObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_46matApply(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_x, struct PyPetscMatObject *__pyx_v_y); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_48applyTranspose(struct PyPetscPCObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_50applySymmetricLeft(struct PyPetscPCObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_52applySymmetricRight(struct PyPetscPCObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_54getDM(struct PyPetscPCObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_56setDM(struct PyPetscPCObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_58setCoordinates(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_coordinates); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_60createPython(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_62setPythonContext(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_context); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_64getPythonContext(struct PyPetscPCObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_66setPythonType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_py_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_68getPythonType(struct PyPetscPCObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_70setASMType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_asmtype); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_72setASMOverlap(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_overlap); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_74setASMLocalSubdomains(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_nsd, PyObject *__pyx_v_is_, PyObject *__pyx_v_is_local); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_76setASMTotalSubdomains(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_nsd, PyObject *__pyx_v_is_, PyObject *__pyx_v_is_local); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_78getASMSubKSP(struct PyPetscPCObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_80setASMSortIndices(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_dosort); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_82setGASMType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_gasmtype); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_84setGASMOverlap(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_overlap); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_86setGAMGType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_gamgtype); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_88setGAMGLevels(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_levels); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_90setGAMGSmooths(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_smooths); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_92getHYPREType(struct PyPetscPCObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_94setHYPREType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_hypretype); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_96setHYPREDiscreteCurl(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_98setHYPREDiscreteGradient(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_100setHYPRESetAlphaPoissonMatrix(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_102setHYPRESetBetaPoissonMatrix(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_104setHYPRESetInterpolations(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_dim, struct PyPetscMatObject *__pyx_v_RT_Pi_Full, PyObject *__pyx_v_RT_Pi, struct PyPetscMatObject *__pyx_v_ND_Pi_Full, PyObject *__pyx_v_ND_Pi); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_106setHYPRESetEdgeConstantVectors(struct PyPetscPCObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_ozz, struct PyPetscVecObject *__pyx_v_zoz, struct PyPetscVecObject *__pyx_v_zzo); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_108setHYPREAMSSetInteriorNodes(struct PyPetscPCObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_interior); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_110setFactorSolverType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_solver); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_112getFactorSolverType(struct PyPetscPCObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_114setFactorSetUpSolverType(struct PyPetscPCObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_116setFactorOrdering(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_ord_type, PyObject *__pyx_v_nzdiag, PyObject *__pyx_v_reuse); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_118setFactorPivot(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_zeropivot, PyObject *__pyx_v_inblocks); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_120setFactorShift(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_shift_type, PyObject *__pyx_v_amount); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_122setFactorLevels(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_levels); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_124getFactorMatrix(struct PyPetscPCObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_126setFieldSplitType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_ctype); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_128setFieldSplitIS(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_fields); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_130setFieldSplitFields(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_bsize, PyObject *__pyx_v_fields); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_132getFieldSplitSubKSP(struct PyPetscPCObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_134getFieldSplitSchurGetSubKSP(struct PyPetscPCObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_136setFieldSplitSchurFactType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_ctype); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_138setFieldSplitSchurPreType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_ptype, struct PyPetscMatObject *__pyx_v_pre); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_140setCompositeType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_ctype); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_142getCompositePC(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_n); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_144addCompositePCType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_pc_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_146getKSP(struct PyPetscPCObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_148getMGType(struct PyPetscPCObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_150setMGType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_mgtype); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_152getMGLevels(struct PyPetscPCObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_154setMGLevels(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_levels); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_156getMGCoarseSolve(struct PyPetscPCObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_158setMGInterpolation(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level, struct PyPetscMatObject *__pyx_v_mat); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_160getMGInterpolation(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_162setMGRestriction(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level, struct PyPetscMatObject *__pyx_v_mat); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_164getMGRestriction(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_166setMGRScale(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level, struct PyPetscVecObject *__pyx_v_rscale); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_168getMGRScale(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_170getMGSmoother(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_172getMGSmootherDown(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_174getMGSmootherUp(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_176setMGCycleType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_cycle_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_178setMGCycleTypeOnLevel(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level, PyObject *__pyx_v_cycle_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_180setMGRhs(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level, struct PyPetscVecObject *__pyx_v_rhs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_182setMGX(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level, struct PyPetscVecObject *__pyx_v_x); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_184setMGR(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level, struct PyPetscVecObject *__pyx_v_r); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_186setBDDCDivergenceMat(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_div, PyObject *__pyx_v_trans, struct PyPetscISObject *__pyx_v_l2l); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_188setBDDCDiscreteGradient(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_G, PyObject *__pyx_v_order, PyObject *__pyx_v_field, PyObject *__pyx_v_gord, PyObject *__pyx_v_conforming); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_190setBDDCChangeOfBasisMat(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_T, PyObject *__pyx_v_interior); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_192setBDDCPrimalVerticesIS(struct PyPetscPCObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_primv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_194setBDDCPrimalVerticesLocalIS(struct PyPetscPCObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_primv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_196setBDDCCoarseningRatio(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_cratio); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_198setBDDCLevels(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_levels); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_200setBDDCDirichletBoundaries(struct PyPetscPCObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_bndr); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_202setBDDCDirichletBoundariesLocal(struct PyPetscPCObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_bndr); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_204setBDDCNeumannBoundaries(struct PyPetscPCObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_bndr); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_206setBDDCNeumannBoundariesLocal(struct PyPetscPCObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_bndr); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_208setBDDCDofsSplitting(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_isfields); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_210setBDDCDofsSplittingLocal(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_isfields); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_212setPatchCellNumbering(struct PyPetscPCObject *__pyx_v_self, struct PyPetscSectionObject *__pyx_v_sec); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_214setPatchDiscretisationInfo(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_dms, PyObject *__pyx_v_bs, PyObject *__pyx_v_cellNodeMaps, PyObject *__pyx_v_subspaceOffsets, PyObject *__pyx_v_ghostBcNodes, PyObject *__pyx_v_globalBcNodes); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_216setPatchComputeOperator(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_operator, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_218setPatchComputeOperatorInteriorFacets(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_operator, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_220setPatchComputeFunction(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_function, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_222setPatchComputeFunctionInteriorFacets(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_function, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_224setPatchConstructType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_typ, PyObject *__pyx_v_operator, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_226setHPDDMAuxiliaryMat(struct PyPetscPCObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_uis, struct PyPetscMatObject *__pyx_v_uaux); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_228setHPDDMRHSMat(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_B); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_230setHPDDMHasNeumannMat(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_has); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_232setHPDDMCoarseCorrectionType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_correction_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_234getHPDDMCoarseCorrectionType(struct PyPetscPCObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_236getHPDDMSTShareSubKSP(struct PyPetscPCObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_238setHPDDMDeflationMat(struct PyPetscPCObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_uis, struct PyPetscMatObject *__pyx_v_U); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_240setSPAIEpsilon(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_242setSPAINBSteps(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_nbsteps); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_244setSPAIMax(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_maxval); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_246setSPAIMaxNew(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_maxval); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_248setSPAIBlockSize(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_n); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_250setSPAICacheSize(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_size); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_252setSPAIVerbose(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_254setSPAISp(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_sym); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_256setDeflationInitOnly(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_flg); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_258setDeflationLevels(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_levels); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_260setDeflationReductionFactor(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_red); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_262setDeflationCorrectionFactor(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_fact); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_264setDeflationSpaceToCompute(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_space_type, PyObject *__pyx_v_size); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_266setDeflationSpace(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_W, PyObject *__pyx_v_transpose); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_268setDeflationProjectionNullSpaceMat(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_270setDeflationCoarseMat(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_272getDeflationCoarseKSP(struct PyPetscPCObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_274getDeflationPC(struct PyPetscPCObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_3KSP___cinit__(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_2__call__(struct PyPetscKSPObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_b, struct PyPetscVecObject *__pyx_v_x); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_4view(struct PyPetscKSPObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_6destroy(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_8create(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_10setType(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_ksp_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_12getType(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_14setOptionsPrefix(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_prefix); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_16getOptionsPrefix(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_18appendOptionsPrefix(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_prefix); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_20setFromOptions(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_22setAppCtx(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_appctx); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_24getAppCtx(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_26getDM(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_28setDM(struct PyPetscKSPObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_30setDMActive(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_32setComputeRHS(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_rhs, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_34setComputeOperators(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_operators, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_36setOperators(struct PyPetscKSPObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_A, struct PyPetscMatObject *__pyx_v_P); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_38getOperators(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_40setPC(struct PyPetscKSPObject *__pyx_v_self, struct PyPetscPCObject *__pyx_v_pc); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_42getPC(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_44setTolerances(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_rtol, PyObject *__pyx_v_atol, PyObject *__pyx_v_divtol, PyObject *__pyx_v_max_it); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_46getTolerances(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_48setConvergenceTest(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_converged, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_50getConvergenceTest(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_52callConvergenceTest(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_its, PyObject *__pyx_v_rnorm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_54setConvergenceHistory(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_length, PyObject *__pyx_v_reset); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_56getConvergenceHistory(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_58logConvergenceHistory(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_rnorm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_60setMonitor(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_monitor, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_62getMonitor(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_64monitorCancel(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_66monitor(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_its, PyObject *__pyx_v_rnorm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_68setPCSide(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_side); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_70getPCSide(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_72setNormType(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_normtype); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_74getNormType(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_76setComputeEigenvalues(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_78getComputeEigenvalues(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_80setComputeSingularValues(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_82getComputeSingularValues(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_84setInitialGuessNonzero(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_86getInitialGuessNonzero(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_88setInitialGuessKnoll(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_90getInitialGuessKnoll(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_92setUseFischerGuess(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_model, PyObject *__pyx_v_size); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_94setUp(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_96reset(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_98setUpOnBlocks(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_100solve(struct PyPetscKSPObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_b, struct PyPetscVecObject *__pyx_v_x); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_102solveTranspose(struct PyPetscKSPObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_b, struct PyPetscVecObject *__pyx_v_x); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_104matSolve(struct PyPetscKSPObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_B, struct PyPetscMatObject *__pyx_v_X); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_106matSolveTranspose(struct PyPetscKSPObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_B, struct PyPetscMatObject *__pyx_v_X); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_108setIterationNumber(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_its); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_110getIterationNumber(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_112setResidualNorm(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_rnorm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_114getResidualNorm(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_116setConvergedReason(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_reason); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_118getConvergedReason(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_120setHPDDMType(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_hpddm_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_122getHPDDMType(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_124setErrorIfNotConverged(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_126getErrorIfNotConverged(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_128getRhs(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_130getSolution(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_132getWorkVecs(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_right, PyObject *__pyx_v_left); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_134buildSolution(struct PyPetscKSPObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_136buildResidual(struct PyPetscKSPObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_r); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_138computeEigenvalues(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_140computeExtremeSingularValues(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_142setGMRESRestart(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_restart); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_144createPython(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_146setPythonContext(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_context); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_148getPythonContext(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_150setPythonType(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_py_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_152getPythonType(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_6appctx___get__(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_3KSP_6appctx_2__set__(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_2dm___get__(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_3KSP_2dm_2__set__(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_7vec_sol___get__(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_7vec_rhs___get__(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_6mat_op___get__(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_6mat_pc___get__(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_13guess_nonzero___get__(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_3KSP_13guess_nonzero_2__set__(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_11guess_knoll___get__(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_3KSP_11guess_knoll_2__set__(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_2pc___get__(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_7pc_side___get__(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_3KSP_7pc_side_2__set__(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_9norm_type___get__(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_3KSP_9norm_type_2__set__(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_4rtol___get__(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_3KSP_4rtol_2__set__(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_4atol___get__(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_3KSP_4atol_2__set__(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_6divtol___get__(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_3KSP_6divtol_2__set__(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_6max_it___get__(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_3KSP_6max_it_2__set__(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_3its___get__(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_3KSP_3its_2__set__(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_4norm___get__(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_3KSP_4norm_2__set__(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_7history___get__(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_6reason___get__(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_3KSP_6reason_2__set__(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_12is_iterating___get__(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_12is_converged___get__(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_11is_diverged___get__(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_4SNES___cinit__(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_2view(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_4destroy(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_6create(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_8setType(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_snes_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_10getType(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_12setOptionsPrefix(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_prefix); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_14getOptionsPrefix(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_16appendOptionsPrefix(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_prefix); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_18setFromOptions(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_20setApplicationContext(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_appctx); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_22getApplicationContext(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_24getDM(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_26setDM(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_28setFASInterpolation(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level, struct PyPetscMatObject *__pyx_v_mat); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_30getFASInterpolation(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_32setFASRestriction(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level, struct PyPetscMatObject *__pyx_v_mat); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_34getFASRestriction(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_36setFASInjection(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level, struct PyPetscMatObject *__pyx_v_mat); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_38getFASInjection(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_40setFASRScale(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level, struct PyPetscVecObject *__pyx_v_vec); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_42setFASLevels(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_levels, PyObject *__pyx_v_comms); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_44getFASLevels(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_46getFASCycleSNES(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_48getFASCoarseSolve(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_50getFASSmoother(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_52getFASSmootherDown(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_54getFASSmootherUp(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_56getNPC(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_58hasNPC(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_60setNPC(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscSNESObject *__pyx_v_snes); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_62setNPCSide(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_side); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_64getNPCSide(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_66setLineSearchPreCheck(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_precheck, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_68setInitialGuess(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_initialguess, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_70getInitialGuess(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_72setFunction(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_function, struct PyPetscVecObject *__pyx_v_f, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_74getFunction(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_76setUpdate(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_update, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_78getUpdate(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_80setJacobian(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_jacobian, struct PyPetscMatObject *__pyx_v_J, struct PyPetscMatObject *__pyx_v_P, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_82getJacobian(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_84setObjective(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_objective, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_86getObjective(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_88computeFunction(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_f); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_90computeJacobian(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscMatObject *__pyx_v_J, struct PyPetscMatObject *__pyx_v_P); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_92computeObjective(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_94setNGS(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_ngs, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_96getNGS(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_98computeNGS(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_b); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_100setTolerances(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_rtol, PyObject *__pyx_v_atol, PyObject *__pyx_v_stol, PyObject *__pyx_v_max_it); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_102getTolerances(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_104setNormSchedule(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_normsched); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_106getNormSchedule(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_108setConvergenceTest(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_converged, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_110getConvergenceTest(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_112callConvergenceTest(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_its, PyObject *__pyx_v_xnorm, PyObject *__pyx_v_ynorm, PyObject *__pyx_v_fnorm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_114converged(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_its, PyObject *__pyx_v_xnorm, PyObject *__pyx_v_ynorm, PyObject *__pyx_v_fnorm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_116setConvergenceHistory(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_length, PyObject *__pyx_v_reset); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_118getConvergenceHistory(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_120logConvergenceHistory(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_norm, PyObject *__pyx_v_linear_its); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_122setResetCounters(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_reset); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_124setMonitor(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_monitor, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_126getMonitor(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_128monitorCancel(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_130monitor(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_its, PyObject *__pyx_v_rnorm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_132setMaxFunctionEvaluations(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_max_funcs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_134getMaxFunctionEvaluations(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_136getFunctionEvaluations(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_138setMaxStepFailures(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_max_fails); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_140getMaxStepFailures(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_142getStepFailures(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_144setMaxKSPFailures(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_max_fails); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_146getMaxKSPFailures(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_148getKSPFailures(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_150setUp(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_152setUpMatrices(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_154reset(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_156solve(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_b, struct PyPetscVecObject *__pyx_v_x); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_158setConvergedReason(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_reason); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_160getConvergedReason(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_162setErrorIfNotConverged(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_164getErrorIfNotConverged(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_166setIterationNumber(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_its); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_168getIterationNumber(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_170setForceIteration(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_force); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_172setFunctionNorm(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_norm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_174getFunctionNorm(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_176getLinearSolveIterations(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_178getRhs(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_180getSolution(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_182setSolution(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_184getSolutionUpdate(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_186setKSP(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscKSPObject *__pyx_v_ksp); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_188getKSP(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_190setUseEW(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_flag, PyObject *__pyx_v_targs, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_192getUseEW(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_194setParamsEW(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_version, PyObject *__pyx_v_rtol_0, PyObject *__pyx_v_rtol_max, PyObject *__pyx_v_gamma, PyObject *__pyx_v_alpha, PyObject *__pyx_v_alpha2, PyObject *__pyx_v_threshold); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_196getParamsEW(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_198setUseMF(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_200getUseMF(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_202setUseFD(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_204getUseFD(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_206setVariableBounds(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_xl, struct PyPetscVecObject *__pyx_v_xu); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_208getVIInactiveSet(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_210createPython(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_212setPythonContext(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_context); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_214getPythonContext(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_216setPythonType(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_py_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_218getPythonType(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_220getCompositeSNES(struct PyPetscSNESObject *__pyx_v_self, int __pyx_v_n); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_222getCompositeNumber(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_224getNASMSNES(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_n); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_226getNASMNumber(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_228setPatchCellNumbering(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscSectionObject *__pyx_v_sec); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_230setPatchDiscretisationInfo(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_dms, PyObject *__pyx_v_bs, PyObject *__pyx_v_cellNodeMaps, PyObject *__pyx_v_subspaceOffsets, PyObject *__pyx_v_ghostBcNodes, PyObject *__pyx_v_globalBcNodes); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_232setPatchComputeOperator(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_operator, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_234setPatchComputeFunction(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_function, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_236setPatchConstructType(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_typ, PyObject *__pyx_v_operator, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_6appctx___get__(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_4SNES_6appctx_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_2dm___get__(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_4SNES_2dm_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_3npc___get__(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_4SNES_3npc_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_7vec_sol___get__(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_7vec_upd___get__(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_7vec_rhs___get__(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_3ksp___get__(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_4SNES_3ksp_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_6use_ew___get__(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_4SNES_6use_ew_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_4rtol___get__(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_4SNES_4rtol_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_4atol___get__(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_4SNES_4atol_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_4stol___get__(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_4SNES_4stol_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_6max_it___get__(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_4SNES_6max_it_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_9max_funcs___get__(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_4SNES_9max_funcs_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_3its___get__(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_4SNES_3its_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_4norm___get__(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_4SNES_4norm_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_7history___get__(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_6reason___get__(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_4SNES_6reason_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_12is_iterating___get__(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_12is_converged___get__(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_11is_diverged___get__(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_6use_mf___get__(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_4SNES_6use_mf_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_6use_fd___get__(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_4SNES_6use_fd_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_2TS___cinit__(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_2view(struct PyPetscTSObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_4load(struct PyPetscTSObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_6destroy(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_8create(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_10clone(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_12setType(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_ts_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_14setRKType(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_ts_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_16setARKIMEXType(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_ts_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_18setARKIMEXFullyImplicit(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_20getType(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_22getRKType(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_24getARKIMEXType(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_26setDIRKType(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_ts_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_28getDIRKType(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_30setProblemType(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_ptype); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_32getProblemType(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_34setEquationType(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_eqtype); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_36getEquationType(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_38setOptionsPrefix(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_prefix); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_40getOptionsPrefix(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_42appendOptionsPrefix(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_prefix); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_44setFromOptions(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_46setAppCtx(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_appctx); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_48getAppCtx(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_50setRHSFunction(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_function, struct PyPetscVecObject *__pyx_v_f, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_52setRHSJacobian(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_jacobian, struct PyPetscMatObject *__pyx_v_J, struct PyPetscMatObject *__pyx_v_P, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_54computeRHSFunction(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_t, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_f); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_56computeRHSFunctionLinear(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_t, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_f); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_58computeRHSJacobian(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_t, struct PyPetscVecObject *__pyx_v_x, struct PyPetscMatObject *__pyx_v_J, struct PyPetscMatObject *__pyx_v_P); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_60computeRHSJacobianConstant(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_t, struct PyPetscVecObject *__pyx_v_x, struct PyPetscMatObject *__pyx_v_J, struct PyPetscMatObject *__pyx_v_P); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_62getRHSFunction(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_64getRHSJacobian(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_66setIFunction(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_function, struct PyPetscVecObject *__pyx_v_f, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_68setIJacobian(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_jacobian, struct PyPetscMatObject *__pyx_v_J, struct PyPetscMatObject *__pyx_v_P, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_70setIJacobianP(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_jacobian, struct PyPetscMatObject *__pyx_v_J, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_72computeIFunction(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_t, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_xdot, struct PyPetscVecObject *__pyx_v_f, PyObject *__pyx_v_imex); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_74computeIJacobian(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_t, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_xdot, PyObject *__pyx_v_a, struct PyPetscMatObject *__pyx_v_J, struct PyPetscMatObject *__pyx_v_P, PyObject *__pyx_v_imex); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_76computeIJacobianP(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_t, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_xdot, PyObject *__pyx_v_a, struct PyPetscMatObject *__pyx_v_J, PyObject *__pyx_v_imex); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_78getIFunction(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_80getIJacobian(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_82setI2Function(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_function, struct PyPetscVecObject *__pyx_v_f, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_84setI2Jacobian(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_jacobian, struct PyPetscMatObject *__pyx_v_J, struct PyPetscMatObject *__pyx_v_P, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_86computeI2Function(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_t, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_xdot, struct PyPetscVecObject *__pyx_v_xdotdot, struct PyPetscVecObject *__pyx_v_f); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_88computeI2Jacobian(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_t, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_xdot, struct PyPetscVecObject *__pyx_v_xdotdot, PyObject *__pyx_v_v, PyObject *__pyx_v_a, struct PyPetscMatObject *__pyx_v_J, struct PyPetscMatObject *__pyx_v_P); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_90getI2Function(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_92getI2Jacobian(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_94setSolution(struct PyPetscTSObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_u); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_96getSolution(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_98setSolution2(struct PyPetscTSObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_u, struct PyPetscVecObject *__pyx_v_v); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_100getSolution2(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_102setTimeSpan(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_tspan); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_104getTimeSpan(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_106getTimeSpanSolutions(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_108getSNES(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_110getKSP(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_112getDM(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_114setDM(struct PyPetscTSObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_116setTime(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_t); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_118getTime(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_120getPrevTime(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_122getSolveTime(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_124setTimeStep(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_time_step); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_126getTimeStep(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_128setStepNumber(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_step_number); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_130getStepNumber(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_132setMaxTime(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_max_time); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_134getMaxTime(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_136setMaxSteps(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_max_steps); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_138getMaxSteps(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_140getSNESIterations(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_142getKSPIterations(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_144setMaxStepRejections(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_n); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_146getStepRejections(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_148setMaxSNESFailures(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_n); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_150getSNESFailures(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_152setErrorIfStepFails(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_154setTolerances(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_rtol, PyObject *__pyx_v_atol); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_156getTolerances(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_158setExactFinalTime(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_option); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_160setConvergedReason(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_reason); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_162getConvergedReason(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_164setMonitor(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_monitor, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_166getMonitor(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_168monitorCancel(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_170monitor(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_step, PyObject *__pyx_v_time, struct PyPetscVecObject *__pyx_v_u); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_172setEventHandler(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_direction, PyObject *__pyx_v_terminate, PyObject *__pyx_v_eventhandler, PyObject *__pyx_v_postevent, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_174setEventTolerances(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_tol, PyObject *__pyx_v_vtol); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_176getNumEvents(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_178setPreStep(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_prestep, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_180getPreStep(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_182setPostStep(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_poststep, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_184getPostStep(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_186setUp(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_188reset(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_190step(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_192restartStep(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_194rollBack(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_196solve(struct PyPetscTSObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_u); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_198interpolate(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_t, struct PyPetscVecObject *__pyx_v_u); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_200setStepLimits(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_hmin, PyObject *__pyx_v_hmax); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_202getStepLimits(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_204setSaveTrajectory(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_206removeTrajectory(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_208getCostIntegral(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_210setCostGradients(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_vl, PyObject *__pyx_v_vm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_212getCostGradients(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_214setRHSJacobianP(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_jacobianp, struct PyPetscMatObject *__pyx_v_A, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_216createQuadratureTS(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_forward); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_218getQuadratureTS(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_220setRHSJacobianP(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_rhsjacobianp, struct PyPetscMatObject *__pyx_v_A, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_222computeRHSJacobianP(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_t, struct PyPetscVecObject *__pyx_v_x, struct PyPetscMatObject *__pyx_v_J); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_224adjointSetSteps(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_adjoint_steps); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_226adjointSetUp(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_228adjointSolve(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_230adjointStep(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_232adjointReset(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_234createPython(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_236setPythonContext(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_context); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_238getPythonContext(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_240setPythonType(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_py_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_242getPythonType(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_244setTheta(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_theta); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_246getTheta(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_248setThetaEndpoint(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_250getThetaEndpoint(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_252setAlphaRadius(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_radius); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_254setAlphaParams(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_alpha_m, PyObject *__pyx_v_alpha_f, PyObject *__pyx_v_gamma); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_256getAlphaParams(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_6appctx___get__(struct PyPetscTSObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_2TS_6appctx_2__set__(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_2dm___get__(struct PyPetscTSObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_2TS_2dm_2__set__(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_12problem_type___get__(struct PyPetscTSObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_2TS_12problem_type_2__set__(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_13equation_type___get__(struct PyPetscTSObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_2TS_13equation_type_2__set__(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_4snes___get__(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_3ksp___get__(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_7vec_sol___get__(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_4time___get__(struct PyPetscTSObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_2TS_4time_2__set__(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_9time_step___get__(struct PyPetscTSObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_2TS_9time_step_2__set__(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_11step_number___get__(struct PyPetscTSObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_2TS_11step_number_2__set__(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_8max_time___get__(struct PyPetscTSObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_2TS_8max_time_2__set__(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_9max_steps___get__(struct PyPetscTSObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_2TS_9max_steps_2__set__(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_4rtol___get__(struct PyPetscTSObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_2TS_4rtol_2__set__(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_4atol___get__(struct PyPetscTSObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_2TS_4atol_2__set__(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_6reason___get__(struct PyPetscTSObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_2TS_6reason_2__set__(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_9iterating___get__(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_9converged___get__(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_8diverged___get__(struct PyPetscTSObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_3TAO___cinit__(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_2view(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_4destroy(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_6create(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_8setType(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_tao_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_10getType(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_12setOptionsPrefix(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_prefix); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_14appendOptionsPrefix(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_prefix); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_16getOptionsPrefix(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_18setFromOptions(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_20setUp(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_22setInitialTrustRegionRadius(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_radius); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_24setAppCtx(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_appctx); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_26getAppCtx(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_28setSolution(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_30setObjective(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_objective, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_32setResidual(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_residual, struct PyPetscVecObject *__pyx_v_R, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_34setJacobianResidual(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_jacobian, struct PyPetscMatObject *__pyx_v_J, struct PyPetscMatObject *__pyx_v_P, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_36setGradient(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_gradient, struct PyPetscVecObject *__pyx_v_g, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_38getGradient(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_40setObjectiveGradient(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_objgrad, struct PyPetscVecObject *__pyx_v_g, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_42getObjectiveAndGradient(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_44setVariableBounds(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_varbounds, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_46setConstraints(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_constraints, struct PyPetscVecObject *__pyx_v_C, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_48setHessian(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_hessian, struct PyPetscMatObject *__pyx_v_H, struct PyPetscMatObject *__pyx_v_P, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_50getHessian(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_52setJacobian(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_jacobian, struct PyPetscMatObject *__pyx_v_J, struct PyPetscMatObject *__pyx_v_P, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_54setStateDesignIS(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_state, struct PyPetscISObject *__pyx_v_design); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_56setJacobianState(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_jacobian_state, struct PyPetscMatObject *__pyx_v_J, struct PyPetscMatObject *__pyx_v_P, struct PyPetscMatObject *__pyx_v_I, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_58setJacobianDesign(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_jacobian_design, struct PyPetscMatObject *__pyx_v_J, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_60setEqualityConstraints(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_equality_constraints, struct PyPetscVecObject *__pyx_v_c, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_62setJacobianEquality(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_jacobian_equality, struct PyPetscMatObject *__pyx_v_J, struct PyPetscMatObject *__pyx_v_P, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_64setUpdate(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_update, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_66getUpdate(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_68computeObjective(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_70computeResidual(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_f); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_72computeGradient(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_g); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_74computeObjectiveGradient(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_g); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_76computeDualVariables(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_xl, struct PyPetscVecObject *__pyx_v_xu); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_78computeVariableBounds(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_xl, struct PyPetscVecObject *__pyx_v_xu); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_80computeConstraints(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_c); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_82computeHessian(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscMatObject *__pyx_v_H, struct PyPetscMatObject *__pyx_v_P); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_84computeJacobian(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscMatObject *__pyx_v_J, struct PyPetscMatObject *__pyx_v_P); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_86setTolerances(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_gatol, PyObject *__pyx_v_grtol, PyObject *__pyx_v_gttol); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_88getTolerances(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_90setMaximumIterations(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_mit); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_92getMaximumIterations(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_94setMaximumFunctionEvaluations(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_mit); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_96getMaximumFunctionEvaluations(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_98setConstraintTolerances(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_catol, PyObject *__pyx_v_crtol); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_100getConstraintTolerances(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_102setConvergenceTest(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_converged, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_104getConvergenceTest(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_106setConvergedReason(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_reason); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_108getConvergedReason(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_110setMonitor(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_monitor, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_112getMonitor(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_114cancelMonitor(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_116monitor(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_its, PyObject *__pyx_v_f, PyObject *__pyx_v_res, PyObject *__pyx_v_cnorm, PyObject *__pyx_v_step); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_118solve(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_120getSolution(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_122setGradientNorm(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_124getGradientNorm(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_126setLMVMH0(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_128getLMVMH0(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_130getLMVMH0KSP(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_132getVariableBounds(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_134setBNCGType(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_cg_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_136getBNCGType(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_138setIterationNumber(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_its); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_140getIterationNumber(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_142getObjectiveValue(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_144getConvergedReason(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_146getSolutionNorm(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_148getSolutionStatus(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_150getKSP(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_152getBRGNSubsolver(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_154setBRGNRegularizerObjectiveGradient(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_objgrad, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_156setBRGNRegularizerHessian(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_hessian, struct PyPetscMatObject *__pyx_v_H, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_158setBRGNRegularizerWeight(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_weight); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_160setBRGNSmoothL1Epsilon(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_epsilon); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_162setBRGNDictionaryMatrix(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_D); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_164getBRGNDampingVector(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_166createPython(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_168setPythonContext(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_context); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_170getPythonContext(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_172setPythonType(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_py_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_174getPythonType(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_176getLineSearch(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_6appctx___get__(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_3TAO_6appctx_2__set__(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_3ksp___get__(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_4ftol___get__(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_3TAO_4ftol_2__set__(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_4gtol___get__(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_3TAO_4gtol_2__set__(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_4ctol___get__(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_3TAO_4ctol_2__set__(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_3its___get__(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_5gnorm___get__(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_5cnorm___get__(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_8solution___get__(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_9objective___get__(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_8function___get__(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_8gradient___get__(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_6reason___get__(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_9iterating___get__(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_9converged___get__(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_8diverged___get__(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_13TAOLineSearch___cinit__(struct PyPetscTAOLineSearchObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_13TAOLineSearch_2view(struct PyPetscTAOLineSearchObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_13TAOLineSearch_4destroy(struct PyPetscTAOLineSearchObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_13TAOLineSearch_6create(struct PyPetscTAOLineSearchObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_13TAOLineSearch_8setType(struct PyPetscTAOLineSearchObject *__pyx_v_self, PyObject *__pyx_v_ls_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_13TAOLineSearch_10getType(struct PyPetscTAOLineSearchObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_13TAOLineSearch_12setFromOptions(struct PyPetscTAOLineSearchObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_13TAOLineSearch_14setUp(struct PyPetscTAOLineSearchObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_13TAOLineSearch_16setOptionsPrefix(struct PyPetscTAOLineSearchObject *__pyx_v_self, PyObject *__pyx_v_prefix); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_13TAOLineSearch_18getOptionsPrefix(struct PyPetscTAOLineSearchObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_13TAOLineSearch_20setObjective(struct PyPetscTAOLineSearchObject *__pyx_v_self, PyObject *__pyx_v_objective, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_13TAOLineSearch_22setGradient(struct PyPetscTAOLineSearchObject *__pyx_v_self, PyObject *__pyx_v_gradient, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_13TAOLineSearch_24setObjectiveGradient(struct PyPetscTAOLineSearchObject *__pyx_v_self, PyObject *__pyx_v_objgrad, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_13TAOLineSearch_26useTAORoutine(struct PyPetscTAOLineSearchObject *__pyx_v_self, struct PyPetscTAOObject *__pyx_v_tao); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_13TAOLineSearch_28apply(struct PyPetscTAOLineSearchObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_g, struct PyPetscVecObject *__pyx_v_s); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_2AO___cinit__(struct PyPetscAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2AO_2view(struct PyPetscAOObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2AO_4destroy(struct PyPetscAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2AO_6createBasic(struct PyPetscAOObject *__pyx_v_self, PyObject *__pyx_v_app, PyObject *__pyx_v_petsc, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2AO_8createMemoryScalable(struct PyPetscAOObject *__pyx_v_self, PyObject *__pyx_v_app, PyObject *__pyx_v_petsc, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2AO_10createMapping(struct PyPetscAOObject *__pyx_v_self, PyObject *__pyx_v_app, PyObject *__pyx_v_petsc, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2AO_12getType(struct PyPetscAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2AO_14app2petsc(struct PyPetscAOObject *__pyx_v_self, PyObject *__pyx_v_indices); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2AO_16petsc2app(struct PyPetscAOObject *__pyx_v_self, PyObject *__pyx_v_indices); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_2DM___cinit__(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_2view(struct PyPetscDMObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_4load(struct PyPetscDMObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_6destroy(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_8create(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_10clone(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_12setType(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_dm_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_14getType(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_16getDimension(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_18setDimension(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_dim); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_20getCoordinateDim(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_22setCoordinateDim(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_dim); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_24setOptionsPrefix(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_prefix); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_26getOptionsPrefix(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_28appendOptionsPrefix(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_prefix); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_30setFromOptions(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_32viewFromOptions(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name, struct PyPetscObjectObject *__pyx_v_obj); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_34setUp(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_36setAppCtx(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_appctx); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_38getAppCtx(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_40setBasicAdjacency(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_useCone, PyObject *__pyx_v_useClosure); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_42getBasicAdjacency(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_44setFieldAdjacency(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_useCone, PyObject *__pyx_v_useClosure); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_46getFieldAdjacency(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_field); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_48createSubDM(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_fields); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_50setAuxiliaryVec(struct PyPetscDMObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_aux, PyObject *__pyx_v_label, PyObject *__pyx_v_value, PyObject *__pyx_v_part); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_52getAuxiliaryVec(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_label, PyObject *__pyx_v_value, PyObject *__pyx_v_part); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_54setNumFields(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_numFields); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_56getNumFields(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_58setField(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_index, struct PyPetscObjectObject *__pyx_v_field, PyObject *__pyx_v_label); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_60getField(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_index); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_62addField(struct PyPetscDMObject *__pyx_v_self, struct PyPetscObjectObject *__pyx_v_field, PyObject *__pyx_v_label); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_64clearFields(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_66copyFields(struct PyPetscDMObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_68createDS(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_70clearDS(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_72getDS(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_74copyDS(struct PyPetscDMObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_76copyDisc(struct PyPetscDMObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_78getBlockSize(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_80setVecType(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_vec_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_82createGlobalVec(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_84createLocalVec(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_86getGlobalVec(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_88restoreGlobalVec(struct PyPetscDMObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vg); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_90getLocalVec(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_92restoreLocalVec(struct PyPetscDMObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vl); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_94globalToLocal(struct PyPetscDMObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vg, struct PyPetscVecObject *__pyx_v_vl, PyObject *__pyx_v_addv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_96localToGlobal(struct PyPetscDMObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vl, struct PyPetscVecObject *__pyx_v_vg, PyObject *__pyx_v_addv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_98localToLocal(struct PyPetscDMObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vl, struct PyPetscVecObject *__pyx_v_vlg, PyObject *__pyx_v_addv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_100getLGMap(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_102getCoarseDM(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_104setCoarseDM(struct PyPetscDMObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_106getCoordinateDM(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_108getCoordinateSection(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_110setCoordinates(struct PyPetscDMObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_c); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_112getCoordinates(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_114setCoordinatesLocal(struct PyPetscDMObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_c); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_116getCoordinatesLocal(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_118projectCoordinates(struct PyPetscDMObject *__pyx_v_self, struct PyPetscFEObject *__pyx_v_disc); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_120getBoundingBox(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_122getLocalBoundingBox(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_124localizeCoordinates(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_126setMatType(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_mat_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_128createMat(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_130createMassMatrix(struct PyPetscDMObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dmf); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_132createInterpolation(struct PyPetscDMObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_134createInjection(struct PyPetscDMObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_136createRestriction(struct PyPetscDMObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_138convert(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_dm_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_140refine(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_142coarsen(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_144refineHierarchy(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_nlevels); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_146coarsenHierarchy(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_nlevels); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_148getRefineLevel(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_150setRefineLevel(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_level); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_152getCoarsenLevel(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_154adaptLabel(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_label); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_156adaptMetric(struct PyPetscDMObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_metric, PyObject *__pyx_v_bdLabel, PyObject *__pyx_v_rgLabel); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_158getLabel(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_160setLocalSection(struct PyPetscDMObject *__pyx_v_self, struct PyPetscSectionObject *__pyx_v_sec); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_162getLocalSection(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_164setGlobalSection(struct PyPetscDMObject *__pyx_v_self, struct PyPetscSectionObject *__pyx_v_sec); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_166getGlobalSection(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_168createSectionSF(struct PyPetscDMObject *__pyx_v_self, struct PyPetscSectionObject *__pyx_v_localsec, struct PyPetscSectionObject *__pyx_v_globalsec); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_170getSectionSF(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_172setSectionSF(struct PyPetscDMObject *__pyx_v_self, struct PyPetscSFObject *__pyx_v_sf); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_174getPointSF(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_176setPointSF(struct PyPetscDMObject *__pyx_v_self, struct PyPetscSFObject *__pyx_v_sf); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_178getNumLabels(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_180getLabelName(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_index); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_182hasLabel(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_184createLabel(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_186removeLabel(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_188getLabelValue(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_point); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_190setLabelValue(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_point, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_192clearLabelValue(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_point, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_194getLabelSize(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_196getLabelIdIS(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_198getStratumSize(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_200getStratumIS(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_202clearLabelStratum(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_204setLabelOutput(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_output); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_206getLabelOutput(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_208setKSPComputeOperators(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_operators, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_210createFieldDecomposition(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_212setSNESFunction(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_function, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_214setSNESJacobian(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_jacobian, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_216addCoarsenHook(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_coarsenhook, PyObject *__pyx_v_restricthook, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_6appctx___get__(struct PyPetscDMObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_2DM_6appctx_2__set__(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_2ds___get__(struct PyPetscDMObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_2DM_2ds_2__set__(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_2DS___cinit__(struct PyPetscDSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_2view(struct PyPetscDSObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_4destroy(struct PyPetscDSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_6create(struct PyPetscDSObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_8setType(struct PyPetscDSObject *__pyx_v_self, PyObject *__pyx_v_ds_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_10getType(struct PyPetscDSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_12setFromOptions(struct PyPetscDSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_14setUp(struct PyPetscDSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_16getSpatialDimension(struct PyPetscDSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_18getCoordinateDimension(struct PyPetscDSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_20getNumFields(struct PyPetscDSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_22getFieldIndex(struct PyPetscDSObject *__pyx_v_self, struct PyPetscObjectObject *__pyx_v_disc); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_24getTotalDimensions(struct PyPetscDSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_26getTotalComponents(struct PyPetscDSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_28getDimensions(struct PyPetscDSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_30getComponents(struct PyPetscDSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_32setDiscretisation(struct PyPetscDSObject *__pyx_v_self, PyObject *__pyx_v_f, PyObject *__pyx_v_disc); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_create(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_dim, PyObject *__pyx_v_dof, PyObject *__pyx_v_sizes, PyObject *__pyx_v_proc_sizes, PyObject *__pyx_v_boundary_type, PyObject *__pyx_v_stencil_type, PyObject *__pyx_v_stencil_width, int __pyx_v_setup, PyObject *__pyx_v_ownership_ranges, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_2duplicate(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_dof, PyObject *__pyx_v_boundary_type, PyObject *__pyx_v_stencil_type, PyObject *__pyx_v_stencil_width); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_4setDim(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_dim); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_6getDim(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_8setDof(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_dof); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_10getDof(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_12setSizes(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_sizes); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_14getSizes(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_16setProcSizes(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_proc_sizes); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_18getProcSizes(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_20setBoundaryType(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_boundary_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_22getBoundaryType(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_24setStencilType(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_stencil_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_26getStencilType(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_28setStencilWidth(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_stencil_width); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_30getStencilWidth(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_32setStencil(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_stencil_type, PyObject *__pyx_v_stencil_width); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_34getStencil(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_36getRanges(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_38getGhostRanges(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_40getOwnershipRanges(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_42getCorners(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_44getGhostCorners(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_46setFieldName(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_48getFieldName(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_field); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_50getVecArray(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_52setUniformCoordinates(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_xmin, PyObject *__pyx_v_xmax, PyObject *__pyx_v_ymin, PyObject *__pyx_v_ymax, PyObject *__pyx_v_zmin, PyObject *__pyx_v_zmax); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_54setCoordinateName(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_56getCoordinateName(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_index); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_58createNaturalVec(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_60globalToNatural(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vg, struct PyPetscVecObject *__pyx_v_vn, PyObject *__pyx_v_addv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_62naturalToGlobal(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vn, struct PyPetscVecObject *__pyx_v_vg, PyObject *__pyx_v_addv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_64getAO(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_66getScatter(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_68setRefinementFactor(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_refine_x, PyObject *__pyx_v_refine_y, PyObject *__pyx_v_refine_z); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_70getRefinementFactor(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_72setInterpolationType(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_interp_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_74getInterpolationType(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_76setElementType(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_elem_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_78getElementType(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_80getElements(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_elem_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_3dim___get__(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_3dof___get__(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_5sizes___get__(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_10proc_sizes___get__(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_13boundary_type___get__(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_7stencil___get__(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_12stencil_type___get__(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_13stencil_width___get__(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_6ranges___get__(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_12ghost_ranges___get__(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_7corners___get__(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_13ghost_corners___get__(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_create(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_2createFromCellList(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_dim, PyObject *__pyx_v_cells, PyObject *__pyx_v_coords, PyObject *__pyx_v_interpolate, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_4createBoxMesh(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_faces, PyObject *__pyx_v_lower, PyObject *__pyx_v_upper, PyObject *__pyx_v_simplex, PyObject *__pyx_v_periodic, PyObject *__pyx_v_interpolate, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_6createBoxSurfaceMesh(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_faces, PyObject *__pyx_v_lower, PyObject *__pyx_v_upper, PyObject *__pyx_v_interpolate, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_8createFromFile(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_plexname, PyObject *__pyx_v_interpolate, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_10createCGNS(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_cgid, PyObject *__pyx_v_interpolate, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_12createCGNSFromFile(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_interpolate, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_14createExodusFromFile(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_interpolate, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_16createExodus(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_exoid, PyObject *__pyx_v_interpolate, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_18createGmsh(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer, PyObject *__pyx_v_interpolate, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_20createCohesiveSubmesh(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_hasLagrange, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_22getChart(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_24setChart(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_pStart, PyObject *__pyx_v_pEnd); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_26getConeSize(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_28setConeSize(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p, PyObject *__pyx_v_size); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_30getCone(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_32setCone(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p, PyObject *__pyx_v_cone, PyObject *__pyx_v_orientation); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_34insertCone(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p, PyObject *__pyx_v_conePos, PyObject *__pyx_v_conePoint); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_36insertConeOrientation(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p, PyObject *__pyx_v_conePos, PyObject *__pyx_v_coneOrientation); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_38getConeOrientation(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_40setConeOrientation(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p, PyObject *__pyx_v_orientation); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_42setCellType(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p, PyObject *__pyx_v_ctype); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_44getCellType(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_46getCellTypeLabel(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_48getSupportSize(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_50setSupportSize(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p, PyObject *__pyx_v_size); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_52getSupport(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_54setSupport(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p, PyObject *__pyx_v_supp); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_56getMaxSizes(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_58symmetrize(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_60stratify(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_62orient(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_64getCellNumbering(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_66getVertexNumbering(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_68createPointNumbering(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_70getDepth(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_72getDepthStratum(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_svalue); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_74getHeightStratum(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_svalue); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_76getPointDepth(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_point); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_78getPointHeight(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_point); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_80getMeet(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_points); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_82getJoin(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_points); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_84getFullJoin(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_points); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_86getTransitiveClosure(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p, PyObject *__pyx_v_useCone); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_88vecGetClosure(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscSectionObject *__pyx_v_sec, struct PyPetscVecObject *__pyx_v_vec, PyObject *__pyx_v_p); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_90getVecClosure(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscSectionObject *__pyx_v_sec, struct PyPetscVecObject *__pyx_v_vec, PyObject *__pyx_v_point); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_92setVecClosure(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscSectionObject *__pyx_v_sec, struct PyPetscVecObject *__pyx_v_vec, PyObject *__pyx_v_point, PyObject *__pyx_v_values, PyObject *__pyx_v_addv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_94setMatClosure(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscSectionObject *__pyx_v_sec, struct PyPetscSectionObject *__pyx_v_gsec, struct PyPetscMatObject *__pyx_v_mat, PyObject *__pyx_v_point, PyObject *__pyx_v_values, PyObject *__pyx_v_addv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_96generate(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_boundary, PyObject *__pyx_v_name, PyObject *__pyx_v_interpolate); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_98setTriangleOptions(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_opts); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_100setTetGenOptions(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_opts); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_102markBoundaryFaces(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_label, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_104labelComplete(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscDMLabelObject *__pyx_v_label); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_106labelCohesiveComplete(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscDMLabelObject *__pyx_v_label, struct PyPetscDMLabelObject *__pyx_v_bdlabel, PyObject *__pyx_v_bdvalue, PyObject *__pyx_v_flip, struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_subdm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_108setAdjacencyUseAnchors(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_useAnchors); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_110getAdjacencyUseAnchors(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_112getAdjacency(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_114setPartitioner(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscPartitionerObject *__pyx_v_part); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_116getPartitioner(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_118rebalanceSharedPoints(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_entityDepth, PyObject *__pyx_v_useInitialGuess, PyObject *__pyx_v_parallel); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_120distribute(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_overlap); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_122distributeOverlap(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_overlap); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_124isDistributed(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_126isSimplex(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_128distributeGetDefault(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_130distributeSetDefault(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_132distributionSetName(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_134distributionGetName(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_136interpolate(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_138uninterpolate(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_140distributeField(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscSFObject *__pyx_v_sf, struct PyPetscSectionObject *__pyx_v_sec, struct PyPetscVecObject *__pyx_v_vec, struct PyPetscSectionObject *__pyx_v_newsec, struct PyPetscVecObject *__pyx_v_newvec); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_142getMinRadius(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_144createCoarsePointIS(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_146createSection(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_numComp, PyObject *__pyx_v_numDof, PyObject *__pyx_v_bcField, PyObject *__pyx_v_bcComps, PyObject *__pyx_v_bcPoints, struct PyPetscISObject *__pyx_v_perm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_148getPointLocal(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_point); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_150getPointLocalField(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_152getPointGlobal(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_point); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_154getPointGlobalField(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_156createClosureIndex(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscSectionObject *__pyx_v_sec); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_158setRefinementUniform(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_refinementUniform); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_160getRefinementUniform(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_162setRefinementLimit(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_refinementLimit); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_164getRefinementLimit(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_166getOrdering(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_otype); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_168permute(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscISObject *__pyx_v_perm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_170reorderGetDefault(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_172reorderSetDefault(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_174computeCellGeometryFVM(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_cell); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_176constructGhostCells(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_labelName); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_178metricSetFromOptions(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_180metricSetUniform(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_uniform); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_182metricIsUniform(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_184metricSetIsotropic(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_isotropic); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_186metricIsIsotropic(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_188metricSetRestrictAnisotropyFirst(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_restrictAnisotropyFirst); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_190metricRestrictAnisotropyFirst(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_192metricSetNoInsertion(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_noInsert); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_194metricNoInsertion(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_196metricSetNoSwapping(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_noSwap); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_198metricNoSwapping(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_200metricSetNoMovement(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_noMove); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_202metricNoMovement(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_204metricSetNoSurf(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_noSurf); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_206metricNoSurf(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_208metricSetVerbosity(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_verbosity); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_210metricGetVerbosity(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_212metricSetNumIterations(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_numIter); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_214metricGetNumIterations(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_216metricSetMinimumMagnitude(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_h_min); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_218metricGetMinimumMagnitude(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_220metricSetMaximumMagnitude(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_h_max); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_222metricGetMaximumMagnitude(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_224metricSetMaximumAnisotropy(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_a_max); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_226metricGetMaximumAnisotropy(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_228metricSetTargetComplexity(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_targetComplexity); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_230metricGetTargetComplexity(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_232metricSetNormalizationOrder(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_234metricGetNormalizationOrder(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_236metricSetGradationFactor(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_beta); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_238metricGetGradationFactor(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_240metricSetHausdorffNumber(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_hausd); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_242metricGetHausdorffNumber(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_244metricCreate(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_field); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_246metricCreateUniform(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_alpha, PyObject *__pyx_v_field); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_248metricCreateIsotropic(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscVecObject *__pyx_v_indicator, PyObject *__pyx_v_field); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_250metricDeterminantCreate(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_field); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_252metricEnforceSPD(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscVecObject *__pyx_v_metric, struct PyPetscVecObject *__pyx_v_ometric, struct PyPetscVecObject *__pyx_v_determinant, PyObject *__pyx_v_restrictSizes, PyObject *__pyx_v_restrictAnisotropy); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_254metricNormalize(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscVecObject *__pyx_v_metric, struct PyPetscVecObject *__pyx_v_ometric, struct PyPetscVecObject *__pyx_v_determinant, PyObject *__pyx_v_restrictSizes, PyObject *__pyx_v_restrictAnisotropy); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_256metricAverage2(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscVecObject *__pyx_v_metric1, struct PyPetscVecObject *__pyx_v_metric2, struct PyPetscVecObject *__pyx_v_metricAvg); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_258metricAverage3(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscVecObject *__pyx_v_metric1, struct PyPetscVecObject *__pyx_v_metric2, struct PyPetscVecObject *__pyx_v_metric3, struct PyPetscVecObject *__pyx_v_metricAvg); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_260metricIntersection2(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscVecObject *__pyx_v_metric1, struct PyPetscVecObject *__pyx_v_metric2, struct PyPetscVecObject *__pyx_v_metricInt); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_262metricIntersection3(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscVecObject *__pyx_v_metric1, struct PyPetscVecObject *__pyx_v_metric2, struct PyPetscVecObject *__pyx_v_metric3, struct PyPetscVecObject *__pyx_v_metricInt); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_264computeGradientClementInterpolant(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscVecObject *__pyx_v_locX, struct PyPetscVecObject *__pyx_v_locC); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_266topologyView(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_268coordinatesView(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_270labelsView(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_272sectionView(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer, struct PyPetscDMObject *__pyx_v_sectiondm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_274globalVectorView(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer, struct PyPetscDMObject *__pyx_v_sectiondm, struct PyPetscVecObject *__pyx_v_vec); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_276localVectorView(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer, struct PyPetscDMObject *__pyx_v_sectiondm, struct PyPetscVecObject *__pyx_v_vec); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_278topologyLoad(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_280coordinatesLoad(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer, struct PyPetscSFObject *__pyx_v_sfxc); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_282labelsLoad(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer, struct PyPetscSFObject *__pyx_v_sfxc); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_284sectionLoad(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer, struct PyPetscDMObject *__pyx_v_sectiondm, struct PyPetscSFObject *__pyx_v_sfxc); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_286globalVectorLoad(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer, struct PyPetscDMObject *__pyx_v_sectiondm, struct PyPetscSFObject *__pyx_v_sf, struct PyPetscVecObject *__pyx_v_vec); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_288localVectorLoad(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer, struct PyPetscDMObject *__pyx_v_sectiondm, struct PyPetscSFObject *__pyx_v_sf, struct PyPetscVecObject *__pyx_v_vec); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_15DMPlexTransform___cinit__(struct PyPetscDMPlexTransformObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_15DMPlexTransform_2apply(struct PyPetscDMPlexTransformObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_15DMPlexTransform_4create(struct PyPetscDMPlexTransformObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_15DMPlexTransform_6destroy(struct PyPetscDMPlexTransformObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_15DMPlexTransform_8getType(struct PyPetscDMPlexTransformObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_15DMPlexTransform_10setUp(struct PyPetscDMPlexTransformObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_15DMPlexTransform_12setType(struct PyPetscDMPlexTransformObject *__pyx_v_self, PyObject *__pyx_v_tr_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_15DMPlexTransform_14setDM(struct PyPetscDMPlexTransformObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_15DMPlexTransform_16setFromOptions(struct PyPetscDMPlexTransformObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_15DMPlexTransform_18view(struct PyPetscDMPlexTransformObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_create(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_dim, PyObject *__pyx_v_dofs, PyObject *__pyx_v_sizes, PyObject *__pyx_v_boundary_types, PyObject *__pyx_v_stencil_type, PyObject *__pyx_v_stencil_width, PyObject *__pyx_v_proc_sizes, PyObject *__pyx_v_ownership_ranges, PyObject *__pyx_v_comm, PyObject *__pyx_v_setUp); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_2setStencilWidth(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_swidth); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_4setStencilType(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_stenciltype); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_6setBoundaryTypes(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_boundary_types); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_8setDof(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_dofs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_10setGlobalSizes(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_sizes); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_12setProcSizes(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_sizes); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_14setOwnershipRanges(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_ranges); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_16getDim(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_18getEntriesPerElement(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_20getStencilWidth(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_22getDof(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_24getCorners(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_26getGhostCorners(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_28getLocalSizes(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_30getGlobalSizes(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_32getProcSizes(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_34getStencilType(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_36getOwnershipRanges(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_38getBoundaryTypes(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_40getIsFirstRank(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_42getIsLastRank(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_44setUniformCoordinatesExplicit(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_xmin, PyObject *__pyx_v_xmax, PyObject *__pyx_v_ymin, PyObject *__pyx_v_ymax, PyObject *__pyx_v_zmin, PyObject *__pyx_v_zmax); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_46setUniformCoordinatesProduct(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_xmin, PyObject *__pyx_v_xmax, PyObject *__pyx_v_ymin, PyObject *__pyx_v_ymax, PyObject *__pyx_v_zmin, PyObject *__pyx_v_zmax); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_48setUniformCoordinates(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_xmin, PyObject *__pyx_v_xmax, PyObject *__pyx_v_ymin, PyObject *__pyx_v_ymax, PyObject *__pyx_v_zmin, PyObject *__pyx_v_zmax); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_50setCoordinateDMType(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_dmtype); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_52getLocationSlot(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_loc, PyObject *__pyx_v_c); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_54getProductCoordinateLocationSlot(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_loc); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_56getLocationDof(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_loc); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_58migrateVec(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec, struct PyPetscDMObject *__pyx_v_dmTo, struct PyPetscVecObject *__pyx_v_vecTo); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_60createCompatibleDMStag(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_dofs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_62VecSplitToDMDA(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec, PyObject *__pyx_v_loc, PyObject *__pyx_v_c); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_64getVecArray(CYTHON_UNUSED struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, CYTHON_UNUSED struct PyPetscVecObject *__pyx_v_vec); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_66get1dCoordinatecArrays(CYTHON_UNUSED struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_3dim___get__(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_4dofs___get__(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_19entries_per_element___get__(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_12global_sizes___get__(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_11local_sizes___get__(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_10proc_sizes___get__(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_14boundary_types___get__(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_12stencil_type___get__(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_13stencil_width___get__(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_7corners___get__(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_13ghost_corners___get__(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_11DMComposite_create(struct __pyx_obj_8petsc4py_5PETSc_DMComposite *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_11DMComposite_2addDM(struct __pyx_obj_8petsc4py_5PETSc_DMComposite *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm, PyObject *__pyx_v_args); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_11DMComposite_4getNumber(struct __pyx_obj_8petsc4py_5PETSc_DMComposite *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_11DMComposite_6getEntries(struct __pyx_obj_8petsc4py_5PETSc_DMComposite *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_11DMComposite_8scatter(struct __pyx_obj_8petsc4py_5PETSc_DMComposite *__pyx_v_self, struct PyPetscVecObject *__pyx_v_gvec, PyObject *__pyx_v_lvecs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_11DMComposite_10gather(struct __pyx_obj_8petsc4py_5PETSc_DMComposite *__pyx_v_self, struct PyPetscVecObject *__pyx_v_gvec, PyObject *__pyx_v_imode, PyObject *__pyx_v_lvecs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_11DMComposite_12getGlobalISs(struct __pyx_obj_8petsc4py_5PETSc_DMComposite *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_11DMComposite_14getLocalISs(struct __pyx_obj_8petsc4py_5PETSc_DMComposite *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_11DMComposite_16getLGMaps(struct __pyx_obj_8petsc4py_5PETSc_DMComposite *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_11DMComposite_18getAccess(struct __pyx_obj_8petsc4py_5PETSc_DMComposite *__pyx_v_self, struct PyPetscVecObject *__pyx_v_gvec, PyObject *__pyx_v_locs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_create(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_2setMatrix(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_4setGlobalVector(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, struct PyPetscVecObject *__pyx_v_gv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_6setLocalVector(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, struct PyPetscVecObject *__pyx_v_lv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_8setCreateGlobalVector(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_create_gvec, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_10setCreateLocalVector(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_create_lvec, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_12setGlobalToLocal(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_begin, PyObject *__pyx_v_end, PyObject *__pyx_v_begin_args, PyObject *__pyx_v_begin_kargs, PyObject *__pyx_v_end_args, PyObject *__pyx_v_end_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_14setGlobalToLocalVecScatter(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, struct PyPetscScatterObject *__pyx_v_gtol); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_16setLocalToGlobal(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_begin, PyObject *__pyx_v_end, PyObject *__pyx_v_begin_args, PyObject *__pyx_v_begin_kargs, PyObject *__pyx_v_end_args, PyObject *__pyx_v_end_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_18setLocalToGlobalVecScatter(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, struct PyPetscScatterObject *__pyx_v_ltog); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_20setLocalToLocal(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_begin, PyObject *__pyx_v_end, PyObject *__pyx_v_begin_args, PyObject *__pyx_v_begin_kargs, PyObject *__pyx_v_end_args, PyObject *__pyx_v_end_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_22setLocalToLocalVecScatter(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, struct PyPetscScatterObject *__pyx_v_ltol); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_24setCreateMatrix(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_create_matrix, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_26setCoarsen(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_coarsen, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_28setRefine(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_refine, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_30setCreateInterpolation(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_create_interpolation, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_32setCreateInjection(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_create_injection, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_34setCreateRestriction(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_create_restriction, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_36setCreateFieldDecomposition(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_decomp, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_38setCreateDomainDecomposition(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_decomp, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_40setCreateDomainDecompositionScatters(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_scatter, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_42setCreateSubDM(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_create_subdm, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_7DMLabel___cinit__(struct PyPetscDMLabelObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_2destroy(struct PyPetscDMLabelObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_4view(struct PyPetscDMLabelObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_6create(struct PyPetscDMLabelObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_8duplicate(struct PyPetscDMLabelObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_10reset(struct PyPetscDMLabelObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_12insertIS(struct PyPetscDMLabelObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_14setValue(struct PyPetscDMLabelObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_16getValue(struct PyPetscDMLabelObject *__pyx_v_self, PyObject *__pyx_v_point); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_18getDefaultValue(struct PyPetscDMLabelObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_20setDefaultValue(struct PyPetscDMLabelObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_22clearValue(struct PyPetscDMLabelObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_24addStratum(struct PyPetscDMLabelObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_26addStrata(struct PyPetscDMLabelObject *__pyx_v_self, PyObject *__pyx_v_strata); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_28addStrataIS(struct PyPetscDMLabelObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_30getNumValues(struct PyPetscDMLabelObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_32getValueIS(struct PyPetscDMLabelObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_34stratumHasPoint(struct PyPetscDMLabelObject *__pyx_v_self, PyObject *__pyx_v_value, PyObject *__pyx_v_point); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_36hasStratum(struct PyPetscDMLabelObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_38getStratumSize(struct PyPetscDMLabelObject *__pyx_v_self, PyObject *__pyx_v_stratum); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_40getStratumIS(struct PyPetscDMLabelObject *__pyx_v_self, PyObject *__pyx_v_stratum); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_42setStratumIS(struct PyPetscDMLabelObject *__pyx_v_self, PyObject *__pyx_v_stratum, struct PyPetscISObject *__pyx_v_iset); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_44clearStratum(struct PyPetscDMLabelObject *__pyx_v_self, PyObject *__pyx_v_stratum); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_46computeIndex(struct PyPetscDMLabelObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_48createIndex(struct PyPetscDMLabelObject *__pyx_v_self, PyObject *__pyx_v_pStart, PyObject *__pyx_v_pEnd); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_50destroyIndex(struct PyPetscDMLabelObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_52hasValue(struct PyPetscDMLabelObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_54hasPoint(struct PyPetscDMLabelObject *__pyx_v_self, PyObject *__pyx_v_point); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_56getBounds(struct PyPetscDMLabelObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_58filter(struct PyPetscDMLabelObject *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_end); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_60permute(struct PyPetscDMLabelObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_permutation); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_62distribute(struct PyPetscDMLabelObject *__pyx_v_self, struct PyPetscSFObject *__pyx_v_sf); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_64gather(struct PyPetscDMLabelObject *__pyx_v_self, struct PyPetscSFObject *__pyx_v_sf); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_66convertToSection(struct PyPetscDMLabelObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_68getNonEmptyStratumValuesIS(struct PyPetscDMLabelObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_create(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_2createGlobalVectorFromField(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_fieldname); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_4destroyGlobalVectorFromField(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_fieldname); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_6createLocalVectorFromField(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_fieldname); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_8destroyLocalVectorFromField(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_fieldname); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_10initializeFieldRegister(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_12finalizeFieldRegister(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_14setLocalSizes(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_nlocal, PyObject *__pyx_v_buffer); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_16registerField(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_fieldname, PyObject *__pyx_v_blocksize, PyObject *__pyx_v_dtype); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_18getField(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_fieldname); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_20restoreField(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_fieldname); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_22vectorDefineField(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_fieldname); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_24addPoint(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_26addNPoints(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_npoints); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_28removePoint(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_30removePointAtIndex(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_index); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_32copyPoint(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_pi, PyObject *__pyx_v_pj); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_34getLocalSize(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_36getSize(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_38migrate(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_remove_sent_points); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_40collectViewCreate(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_42collectViewDestroy(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_44setCellDM(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_46getCellDM(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_48setType(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_dmswarm_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_50setPointsUniformCoordinates(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_min, PyObject *__pyx_v_max, PyObject *__pyx_v_npoints, PyObject *__pyx_v_mode); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_52setPointCoordinates(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_coordinates, PyObject *__pyx_v_redundant, PyObject *__pyx_v_mode); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_54insertPointUsingCellDM(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_layoutType, PyObject *__pyx_v_fill_param); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_56setPointCoordinatesCellwise(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_coordinates); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_58viewFieldsXDMF(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_fieldnames); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_60viewXDMF(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_filename); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_62sortGetAccess(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_64sortRestoreAccess(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_66sortGetPointsPerCell(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_e); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_68sortGetNumberOfPointsPerCell(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_e); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_70sortGetIsValid(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_72sortGetSizes(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_74projectFields(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_fieldnames, PyObject *__pyx_v_vecs, PyObject *__pyx_v_mode); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_11Partitioner___cinit__(struct PyPetscPartitionerObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_11Partitioner_2view(struct PyPetscPartitionerObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_11Partitioner_4destroy(struct PyPetscPartitionerObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_11Partitioner_6create(struct PyPetscPartitionerObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_11Partitioner_8setType(struct PyPetscPartitionerObject *__pyx_v_self, PyObject *__pyx_v_part_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_11Partitioner_10getType(struct PyPetscPartitionerObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_11Partitioner_12setFromOptions(struct PyPetscPartitionerObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_11Partitioner_14setUp(struct PyPetscPartitionerObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_11Partitioner_16reset(struct PyPetscPartitionerObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_11Partitioner_18setShellPartition(struct PyPetscPartitionerObject *__pyx_v_self, PyObject *__pyx_v_numProcs, PyObject *__pyx_v_sizes, PyObject *__pyx_v_points); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_5Space___cinit__(struct PyPetscSpaceObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_2setUp(struct PyPetscSpaceObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_4create(struct PyPetscSpaceObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_6destroy(struct PyPetscSpaceObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_8view(struct PyPetscSpaceObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_10setFromOptions(struct PyPetscSpaceObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_12getDimension(struct PyPetscSpaceObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_14getDegree(struct PyPetscSpaceObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_16setDegree(struct PyPetscSpaceObject *__pyx_v_self, PyObject *__pyx_v_degree, PyObject *__pyx_v_maxDegree); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_18getNumVariables(struct PyPetscSpaceObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_20setNumVariables(struct PyPetscSpaceObject *__pyx_v_self, PyObject *__pyx_v_n); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_22getNumComponents(struct PyPetscSpaceObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_24setNumComponents(struct PyPetscSpaceObject *__pyx_v_self, PyObject *__pyx_v_nc); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_26getType(struct PyPetscSpaceObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_28setType(struct PyPetscSpaceObject *__pyx_v_self, PyObject *__pyx_v_space_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_30getSumConcatenate(struct PyPetscSpaceObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_32setSumConcatenate(struct PyPetscSpaceObject *__pyx_v_self, PyObject *__pyx_v_concatenate); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_34getSumNumSubspaces(struct PyPetscSpaceObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_36getSumSubspace(struct PyPetscSpaceObject *__pyx_v_self, PyObject *__pyx_v_s); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_38setSumSubspace(struct PyPetscSpaceObject *__pyx_v_self, PyObject *__pyx_v_s, struct PyPetscSpaceObject *__pyx_v_subsp); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_40setSumNumSubspaces(struct PyPetscSpaceObject *__pyx_v_self, PyObject *__pyx_v_numSumSpaces); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_42getTensorNumSubspaces(struct PyPetscSpaceObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_44setTensorSubspace(struct PyPetscSpaceObject *__pyx_v_self, PyObject *__pyx_v_s, struct PyPetscSpaceObject *__pyx_v_subsp); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_46getTensorSubspace(struct PyPetscSpaceObject *__pyx_v_self, PyObject *__pyx_v_s); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_48setTensorNumSubspaces(struct PyPetscSpaceObject *__pyx_v_self, PyObject *__pyx_v_numTensSpaces); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_50getPolynomialTensor(struct PyPetscSpaceObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_52setPolynomialTensor(struct PyPetscSpaceObject *__pyx_v_self, PyObject *__pyx_v_tensor); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_54setPointPoints(struct PyPetscSpaceObject *__pyx_v_self, struct PyPetscQuadObject *__pyx_v_quad); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_56getPointPoints(struct PyPetscSpaceObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_58setPTrimmedFormDegree(struct PyPetscSpaceObject *__pyx_v_self, PyObject *__pyx_v_formDegree); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_60getPTrimmedFormDegree(struct PyPetscSpaceObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_62viewFromOptions(struct PyPetscSpaceObject *__pyx_v_self, PyObject *__pyx_v_name, struct PyPetscObjectObject *__pyx_v_obj); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_9DualSpace___cinit__(struct PyPetscDualSpaceObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_2setUp(struct PyPetscDualSpaceObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_4create(struct PyPetscDualSpaceObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_6view(struct PyPetscDualSpaceObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_8destroy(struct PyPetscDualSpaceObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_10duplicate(struct PyPetscDualSpaceObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_12getDM(struct PyPetscDualSpaceObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_14setDM(struct PyPetscDualSpaceObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_16getDimension(struct PyPetscDualSpaceObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_18getNumComponents(struct PyPetscDualSpaceObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_20setNumComponents(struct PyPetscDualSpaceObject *__pyx_v_self, PyObject *__pyx_v_nc); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_22getType(struct PyPetscDualSpaceObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_24setType(struct PyPetscDualSpaceObject *__pyx_v_self, PyObject *__pyx_v_dualspace_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_26getOrder(struct PyPetscDualSpaceObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_28setOrder(struct PyPetscDualSpaceObject *__pyx_v_self, PyObject *__pyx_v_order); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_30getNumDof(struct PyPetscDualSpaceObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_32getFunctional(struct PyPetscDualSpaceObject *__pyx_v_self, PyObject *__pyx_v_i); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_34getInteriorDimension(struct PyPetscDualSpaceObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_36getLagrangeContinuity(struct PyPetscDualSpaceObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_38setLagrangeContinuity(struct PyPetscDualSpaceObject *__pyx_v_self, PyObject *__pyx_v_continuous); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_40getLagrangeTensor(struct PyPetscDualSpaceObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_42setLagrangeTensor(struct PyPetscDualSpaceObject *__pyx_v_self, PyObject *__pyx_v_tensor); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_44getLagrangeTrimmed(struct PyPetscDualSpaceObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_46setLagrangeTrimmed(struct PyPetscDualSpaceObject *__pyx_v_self, PyObject *__pyx_v_trimmed); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_48viewFromOptions(struct PyPetscDualSpaceObject *__pyx_v_self, PyObject *__pyx_v_name, struct PyPetscObjectObject *__pyx_v_obj); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_50setSimpleDimension(struct PyPetscDualSpaceObject *__pyx_v_self, PyObject *__pyx_v_dim); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_52setSimpleFunctional(struct PyPetscDualSpaceObject *__pyx_v_self, PyObject *__pyx_v_func, struct PyPetscQuadObject *__pyx_v_functional); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_15DMInterpolation___cinit__(struct __pyx_obj_8petsc4py_5PETSc_DMInterpolation *__pyx_v_self); /* proto */ static void __pyx_pf_8petsc4py_5PETSc_15DMInterpolation_2__dealloc__(struct __pyx_obj_8petsc4py_5PETSc_DMInterpolation *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_15DMInterpolation_4create(struct __pyx_obj_8petsc4py_5PETSc_DMInterpolation *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_15DMInterpolation_6destroy(struct __pyx_obj_8petsc4py_5PETSc_DMInterpolation *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_15DMInterpolation_8evaluate(struct __pyx_obj_8petsc4py_5PETSc_DMInterpolation *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_v); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_15DMInterpolation_10getCoordinates(struct __pyx_obj_8petsc4py_5PETSc_DMInterpolation *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_15DMInterpolation_12getDim(struct __pyx_obj_8petsc4py_5PETSc_DMInterpolation *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_15DMInterpolation_14getDof(struct __pyx_obj_8petsc4py_5PETSc_DMInterpolation *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_15DMInterpolation_16setDim(struct __pyx_obj_8petsc4py_5PETSc_DMInterpolation *__pyx_v_self, PyObject *__pyx_v_dim); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_15DMInterpolation_18setDof(struct __pyx_obj_8petsc4py_5PETSc_DMInterpolation *__pyx_v_self, PyObject *__pyx_v_dof); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_15DMInterpolation_20setUp(struct __pyx_obj_8petsc4py_5PETSc_DMInterpolation *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm, PyObject *__pyx_v_redundantPoints, PyObject *__pyx_v_ignoreOutsideDomain); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_15DMInterpolation_22getVector(struct __pyx_obj_8petsc4py_5PETSc_DMInterpolation *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_15DMInterpolation_24restoreVector(struct __pyx_obj_8petsc4py_5PETSc_DMInterpolation *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6_PyObj___getattr__(struct __pyx_obj_8petsc4py_5PETSc__PyObj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4_initialize(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6_pre_finalize(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8_finalize(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_10_push_python_vfprintf(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_12_pop_python_vfprintf(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_14_stdout_is_stderr(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_Comm(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_Object(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_Viewer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_Random(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_Device(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_DeviceContext(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_IS(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_LGMap(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_SF(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_Vec(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_Space(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_DualSpace(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_FE(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_Quad(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_Scatter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_Section(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_Mat(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_MatPartitioning(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_NullSpace(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_PC(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_KSP(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_SNES(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_TS(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_TAO(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_TAOLineSearch(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_AO(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_DM(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_DMPlexTransform(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_DS(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_Partitioner(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_DMLabel(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc__IS_buffer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc__Vec_buffer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc__Vec_LocalForm(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc__DMDA_Vec_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc__DMComposite_access(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_Options(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_Sys(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_Log(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_LogStage(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_LogClass(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_LogEvent(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_ViewerHDF5(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_MatStencil(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_DMDA(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_DMPlex(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_DMStag(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_DMComposite(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_DMShell(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_DMSwarm(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_DMInterpolation(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc__PyObj(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc__PyMat(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc__PyPC(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc__PyKSP(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc__PySNES(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc__PyTS(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc__PyTao(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc___pyx_scope_struct_1_decorator(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_get = {0, 0, 0, 0, 0}; static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_keys = {0, 0, 0, 0, 0}; static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop = {0, 0, 0, 0, 0}; static __Pyx_CachedCFunction __pyx_umethod_PyList_Type_pop = {0, 0, 0, 0, 0}; /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; PyObject *__pyx_cython_runtime; PyObject *__pyx_empty_tuple; PyObject *__pyx_empty_bytes; PyObject *__pyx_empty_unicode; #ifdef __Pyx_CyFunction_USED PyTypeObject *__pyx_CyFunctionType; #endif #ifdef __Pyx_FusedFunction_USED PyTypeObject *__pyx_FusedFunctionType; #endif #ifdef __Pyx_Generator_USED PyTypeObject *__pyx_GeneratorType; #endif #ifdef __Pyx_IterableCoroutine_USED PyTypeObject *__pyx_IterableCoroutineType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineAwaitType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE PyObject *PyPetscComm_Type; PyObject *PyPetscObject_Type; PyObject *PyPetscViewer_Type; PyObject *PyPetscRandom_Type; PyObject *PyPetscDevice_Type; PyObject *PyPetscDeviceContext_Type; PyObject *PyPetscIS_Type; PyObject *PyPetscLGMap_Type; PyObject *PyPetscSF_Type; PyObject *PyPetscVec_Type; PyObject *PyPetscSpace_Type; PyObject *PyPetscDualSpace_Type; PyObject *PyPetscFE_Type; PyObject *PyPetscQuad_Type; PyObject *PyPetscScatter_Type; PyObject *PyPetscSection_Type; PyObject *PyPetscMat_Type; PyObject *PyPetscMatPartitioning_Type; PyObject *PyPetscNullSpace_Type; PyObject *PyPetscPC_Type; PyObject *PyPetscKSP_Type; PyObject *PyPetscSNES_Type; PyObject *PyPetscTS_Type; PyObject *PyPetscTAO_Type; PyObject *PyPetscTAOLineSearch_Type; PyObject *PyPetscAO_Type; PyObject *PyPetscDM_Type; PyObject *PyPetscDMPlexTransform_Type; PyObject *PyPetscDS_Type; PyObject *PyPetscPartitioner_Type; PyObject *PyPetscDMLabel_Type; PyObject *__pyx_type_8petsc4py_5PETSc__IS_buffer; PyObject *__pyx_type_8petsc4py_5PETSc__Vec_buffer; PyObject *__pyx_type_8petsc4py_5PETSc__Vec_LocalForm; PyObject *__pyx_type_8petsc4py_5PETSc__DMDA_Vec_array; PyObject *__pyx_type_8petsc4py_5PETSc__DMComposite_access; PyObject *__pyx_type_8petsc4py_5PETSc_Options; PyObject *__pyx_type_8petsc4py_5PETSc_Sys; PyObject *__pyx_type_8petsc4py_5PETSc_Log; PyObject *__pyx_type_8petsc4py_5PETSc_LogStage; PyObject *__pyx_type_8petsc4py_5PETSc_LogClass; PyObject *__pyx_type_8petsc4py_5PETSc_LogEvent; PyObject *__pyx_type_8petsc4py_5PETSc_ViewerHDF5; PyObject *__pyx_type_8petsc4py_5PETSc_MatStencil; PyObject *__pyx_type_8petsc4py_5PETSc_DMDA; PyObject *__pyx_type_8petsc4py_5PETSc_DMPlex; PyObject *__pyx_type_8petsc4py_5PETSc_DMStag; PyObject *__pyx_type_8petsc4py_5PETSc_DMComposite; PyObject *__pyx_type_8petsc4py_5PETSc_DMShell; PyObject *__pyx_type_8petsc4py_5PETSc_DMSwarm; PyObject *__pyx_type_8petsc4py_5PETSc_DMInterpolation; PyObject *__pyx_type_8petsc4py_5PETSc__PyObj; PyObject *__pyx_type_8petsc4py_5PETSc__PyMat; PyObject *__pyx_type_8petsc4py_5PETSc__PyPC; PyObject *__pyx_type_8petsc4py_5PETSc__PyKSP; PyObject *__pyx_type_8petsc4py_5PETSc__PySNES; PyObject *__pyx_type_8petsc4py_5PETSc__PyTS; PyObject *__pyx_type_8petsc4py_5PETSc__PyTao; PyObject *__pyx_type_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator; PyObject *__pyx_type_8petsc4py_5PETSc___pyx_scope_struct_1_decorator; PyObject *__pyx_type___pyx_array; PyObject *__pyx_type___pyx_MemviewEnum; PyObject *__pyx_type___pyx_memoryview; PyObject *__pyx_type___pyx_memoryviewslice; #endif PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Comm; PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Object; PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Viewer; PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Random; PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Device; PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_DeviceContext; PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_IS; PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_LGMap; PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_SF; PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Vec; PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Space; PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_DualSpace; PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_FE; PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Quad; PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Scatter; PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Section; PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Mat; PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_MatPartitioning; PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_NullSpace; PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_PC; PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_KSP; PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_SNES; PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_TS; PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_TAO; PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_TAOLineSearch; PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_AO; PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_DM; PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_DMPlexTransform; PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_DS; PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Partitioner; PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_DMLabel; PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_dtype; PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_ndarray; PyTypeObject *__pyx_ptype_8petsc4py_5PETSc__IS_buffer; PyTypeObject *__pyx_ptype_8petsc4py_5PETSc__Vec_buffer; PyTypeObject *__pyx_ptype_8petsc4py_5PETSc__Vec_LocalForm; PyTypeObject *__pyx_ptype_8petsc4py_5PETSc__DMDA_Vec_array; PyTypeObject *__pyx_ptype_8petsc4py_5PETSc__DMComposite_access; PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Options; PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Sys; PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Log; PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_LogStage; PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_LogClass; PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_LogEvent; PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_ViewerHDF5; PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_MatStencil; PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_DMDA; PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_DMPlex; PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_DMStag; PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_DMComposite; PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_DMShell; PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_DMSwarm; PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_DMInterpolation; PyTypeObject *__pyx_ptype_8petsc4py_5PETSc__PyObj; PyTypeObject *__pyx_ptype_8petsc4py_5PETSc__PyMat; PyTypeObject *__pyx_ptype_8petsc4py_5PETSc__PyPC; PyTypeObject *__pyx_ptype_8petsc4py_5PETSc__PyKSP; PyTypeObject *__pyx_ptype_8petsc4py_5PETSc__PySNES; PyTypeObject *__pyx_ptype_8petsc4py_5PETSc__PyTS; PyTypeObject *__pyx_ptype_8petsc4py_5PETSc__PyTao; PyTypeObject *__pyx_ptype_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator; PyTypeObject *__pyx_ptype_8petsc4py_5PETSc___pyx_scope_struct_1_decorator; PyTypeObject *__pyx_array_type; PyTypeObject *__pyx_MemviewEnum_type; PyTypeObject *__pyx_memoryview_type; PyTypeObject *__pyx_memoryviewslice_type; PyObject *__pyx_kp_u_; PyObject *__pyx_n_s_A; PyObject *__pyx_n_s_A11; PyObject *__pyx_n_s_AB; PyObject *__pyx_n_s_ABC; PyObject *__pyx_n_s_ABt; PyObject *__pyx_n_s_ADD; PyObject *__pyx_n_s_ADDITIVE; PyObject *__pyx_n_s_ADD_ALL; PyObject *__pyx_n_s_ADD_ALL_VALUES; PyObject *__pyx_n_s_ADD_BC; PyObject *__pyx_n_s_ADD_BC_VALUES; PyObject *__pyx_n_s_ADD_VALUES; PyObject *__pyx_n_s_ADIOS; PyObject *__pyx_n_s_ADMM; PyObject *__pyx_n_s_ADVANCED; PyObject *__pyx_n_s_AGG; PyObject *__pyx_n_s_AGGREGATION; PyObject *__pyx_n_s_AIJ; PyObject *__pyx_n_s_AIJCRL; PyObject *__pyx_n_s_AIJCUSPARSE; PyObject *__pyx_n_s_AIJMKL; PyObject *__pyx_n_s_AIJPERM; PyObject *__pyx_n_s_AIJSELL; PyObject *__pyx_n_s_AIJVIENNACL; PyObject *__pyx_n_s_ALLGATHER; PyObject *__pyx_n_s_ALLGATHERV; PyObject *__pyx_n_s_ALLTOALL; PyObject *__pyx_n_s_ALMM; PyObject *__pyx_n_s_ALPHA; PyObject *__pyx_n_s_ALPHA2; PyObject *__pyx_n_s_ALWAYS; PyObject *__pyx_n_s_AMD; PyObject *__pyx_n_s_ANDERSON; PyObject *__pyx_n_s_AO; PyObject *__pyx_n_s_AOType; PyObject *__pyx_n_s_APPEND; PyObject *__pyx_n_s_APPEND_UPDATE; PyObject *__pyx_n_s_APPLY_LOWER; PyObject *__pyx_n_s_APPLY_UPPER; PyObject *__pyx_n_s_ARKIMEX; PyObject *__pyx_n_s_ARKIMEX1BEE; PyObject *__pyx_n_s_ARKIMEX2C; PyObject *__pyx_n_s_ARKIMEX2D; PyObject *__pyx_n_s_ARKIMEX2E; PyObject *__pyx_n_s_ARKIMEX3; PyObject *__pyx_n_s_ARKIMEX4; PyObject *__pyx_n_s_ARKIMEX5; PyObject *__pyx_n_s_ARKIMEXA2; PyObject *__pyx_n_s_ARKIMEXARS122; PyObject *__pyx_n_s_ARKIMEXARS443; PyObject *__pyx_n_s_ARKIMEXBPR3; PyObject *__pyx_n_s_ARKIMEXL2; PyObject *__pyx_n_s_ARKIMEXPRSSP2; PyObject *__pyx_n_s_ARKIMEXType; PyObject *__pyx_n_s_ARMIJO; PyObject *__pyx_n_s_ASCII; PyObject *__pyx_n_s_ASCII_COMMON; PyObject *__pyx_n_s_ASCII_CSV; PyObject *__pyx_n_s_ASCII_DENSE; PyObject *__pyx_n_s_ASCII_FACTOR_INFO; PyObject *__pyx_n_s_ASCII_GLVIS; PyObject *__pyx_n_s_ASCII_IMPL; PyObject *__pyx_n_s_ASCII_INDEX; PyObject *__pyx_n_s_ASCII_INFO; PyObject *__pyx_n_s_ASCII_INFO_DETAIL; PyObject *__pyx_n_s_ASCII_LATEX; PyObject *__pyx_n_s_ASCII_MATHEMATICA; PyObject *__pyx_n_s_ASCII_MATLAB; PyObject *__pyx_n_s_ASCII_MATRIXMARKET; PyObject *__pyx_n_s_ASCII_PCICE; PyObject *__pyx_n_s_ASCII_PYTHON; PyObject *__pyx_n_s_ASCII_SYMMODU; PyObject *__pyx_n_s_ASCII_VTK; PyObject *__pyx_n_s_ASCII_VTK_CELL; PyObject *__pyx_n_s_ASCII_VTK_COORDS; PyObject *__pyx_n_s_ASCII_XML; PyObject *__pyx_n_s_ASFLS; PyObject *__pyx_n_s_ASILS; PyObject *__pyx_n_s_ASM; PyObject *__pyx_n_s_ASMType; PyObject *__pyx_n_s_ASPIN; PyObject *__pyx_n_s_AU; PyObject *__pyx_kp_s_A_matrix_with_d_rows_requires_a; PyObject *__pyx_kp_s_All_dimensions_preceding_dimensi; PyObject *__pyx_n_s_AssemblyType; PyObject *__pyx_n_s_AssertionError; PyObject *__pyx_n_s_AtB; PyObject *__pyx_n_s_AttributeError; PyObject *__pyx_n_s_B; PyObject *__pyx_n_s_BACK; PyObject *__pyx_n_s_BACKWARD_SWEEP; PyObject *__pyx_n_s_BACK_DOWN; PyObject *__pyx_n_s_BACK_DOWN_LEFT; PyObject *__pyx_n_s_BACK_DOWN_RIGHT; PyObject *__pyx_n_s_BACK_LEFT; PyObject *__pyx_n_s_BACK_RIGHT; PyObject *__pyx_n_s_BACK_UP; PyObject *__pyx_n_s_BACK_UP_LEFT; PyObject *__pyx_n_s_BACK_UP_RIGHT; PyObject *__pyx_n_s_BAIJ; PyObject *__pyx_n_s_BAIJMKL; PyObject *__pyx_n_s_BALANCED; PyObject *__pyx_n_s_BAS; PyObject *__pyx_n_s_BASIC; PyObject *__pyx_n_s_BASICSYMPLECTIC; PyObject *__pyx_n_s_BCG; PyObject *__pyx_n_s_BCGS; PyObject *__pyx_n_s_BCGSL; PyObject *__pyx_n_s_BDDC; PyObject *__pyx_n_s_BDF; PyObject *__pyx_n_s_BDM; PyObject *__pyx_n_s_BE; PyObject *__pyx_n_s_BEULER; PyObject *__pyx_n_s_BFBCG; PyObject *__pyx_n_s_BFBT; PyObject *__pyx_n_s_BGCRODR; PyObject *__pyx_n_s_BGMRES; PyObject *__pyx_n_s_BICG; PyObject *__pyx_n_s_BINARY; PyObject *__pyx_n_s_BINARY_MATLAB; PyObject *__pyx_n_s_BIORTH22; PyObject *__pyx_n_s_BJACOBI; PyObject *__pyx_n_s_BLMVM; PyObject *__pyx_n_s_BLOCK; PyObject *__pyx_n_s_BLOCKMAT; PyObject *__pyx_n_s_BMRM; PyObject *__pyx_n_s_BNCG; PyObject *__pyx_n_s_BNCGType; PyObject *__pyx_n_s_BNLS; PyObject *__pyx_n_s_BNTL; PyObject *__pyx_n_s_BNTR; PyObject *__pyx_n_s_BOX; PyObject *__pyx_n_s_BQNKLS; PyObject *__pyx_n_s_BQNKTL; PyObject *__pyx_n_s_BQNKTR; PyObject *__pyx_n_s_BQNLS; PyObject *__pyx_n_s_BQPIP; PyObject *__pyx_n_s_BRGN; PyObject *__pyx_n_s_Barrier; PyObject *__pyx_kp_s_Basic_constants_DECIDE_Use_a_de; PyObject *__pyx_n_s_BoundaryType; PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri; PyObject *__pyx_n_s_C; PyObject *__pyx_n_s_CG; PyObject *__pyx_n_s_CGLS; PyObject *__pyx_n_s_CGNE; PyObject *__pyx_n_s_CGS; PyObject *__pyx_n_s_CHACO; PyObject *__pyx_n_s_CHEBYSHEV; PyObject *__pyx_n_s_CHOLESKY; PyObject *__pyx_n_s_CHOLMOD; PyObject *__pyx_n_s_CHOWILUVIENNACL; PyObject *__pyx_n_s_CLASSICAL; PyObject *__pyx_n_s_CN; PyObject *__pyx_n_s_COLLECT_BASIC; PyObject *__pyx_n_s_COLLECT_DMDABOUNDINGBOX; PyObject *__pyx_n_s_COLLECT_GENERAL; PyObject *__pyx_n_s_COLLECT_USER; PyObject *__pyx_n_s_COMM_NULL; PyObject *__pyx_n_s_COMM_SELF; PyObject *__pyx_n_s_COMM_WORLD; PyObject *__pyx_n_s_COMPOSITE; PyObject *__pyx_n_s_CONSTANTDIAGONAL; PyObject *__pyx_n_s_CONTINUE_ITERATING; PyObject *__pyx_n_s_CONTINUE_SEARCH; PyObject *__pyx_n_s_CONVERGED_ATOL; PyObject *__pyx_n_s_CONVERGED_ATOL_NORMAL; PyObject *__pyx_n_s_CONVERGED_EVENT; PyObject *__pyx_n_s_CONVERGED_FNORM_ABS; PyObject *__pyx_n_s_CONVERGED_FNORM_RELATIVE; PyObject *__pyx_n_s_CONVERGED_GATOL; PyObject *__pyx_n_s_CONVERGED_GRTOL; PyObject *__pyx_n_s_CONVERGED_GTTOL; PyObject *__pyx_n_s_CONVERGED_HAPPY_BREAKDOWN; PyObject *__pyx_n_s_CONVERGED_ITERATING; PyObject *__pyx_n_s_CONVERGED_ITS; PyObject *__pyx_n_s_CONVERGED_MINF; PyObject *__pyx_n_s_CONVERGED_NEG_CURVE; PyObject *__pyx_n_s_CONVERGED_RTOL; PyObject *__pyx_n_s_CONVERGED_RTOL_NORMAL; PyObject *__pyx_n_s_CONVERGED_SNORM_RELATIVE; PyObject *__pyx_n_s_CONVERGED_STEPTOL; PyObject *__pyx_n_s_CONVERGED_STEP_LENGTH; PyObject *__pyx_n_s_CONVERGED_TIME; PyObject *__pyx_n_s_CONVERGED_USER; PyObject *__pyx_n_s_COPY_VALUES; PyObject *__pyx_n_s_CP; PyObject *__pyx_n_s_CR; PyObject *__pyx_n_s_CRANK_NICOLSON; PyObject *__pyx_n_s_CUDA; PyObject *__pyx_n_s_CUSPARSE; PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is; PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor; PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi; PyObject *__pyx_kp_u_Cannot_index_with_type; PyObject *__pyx_kp_s_Cannot_transpose_memoryview_with; PyObject *__pyx_n_s_Class; PyObject *__pyx_n_s_Clone; PyObject *__pyx_n_s_CollectType; PyObject *__pyx_n_s_Comm; PyObject *__pyx_n_s_ComplexType; PyObject *__pyx_n_s_CompositeType; PyObject *__pyx_n_s_ConvergedReason; PyObject *__pyx_n_s_D; PyObject *__pyx_n_s_DA; PyObject *__pyx_n_s_DAE_IMPLICIT_INDEX1; PyObject *__pyx_n_s_DAE_IMPLICIT_INDEX2; PyObject *__pyx_n_s_DAE_IMPLICIT_INDEX3; PyObject *__pyx_n_s_DAE_IMPLICIT_INDEXHI; PyObject *__pyx_n_s_DAE_SEMI_EXPLICIT_INDEX1; PyObject *__pyx_n_s_DAE_SEMI_EXPLICIT_INDEX2; PyObject *__pyx_n_s_DAE_SEMI_EXPLICIT_INDEX3; PyObject *__pyx_n_s_DAE_SEMI_EXPLICIT_INDEXHI; PyObject *__pyx_n_s_DB16; PyObject *__pyx_n_s_DB2; PyObject *__pyx_n_s_DB4; PyObject *__pyx_n_s_DB8; PyObject *__pyx_n_s_DECIDE; PyObject *__pyx_n_s_DEFAULT; PyObject *__pyx_n_s_DEFAULT_BLOCKING; PyObject *__pyx_n_s_DEFLATED; PyObject *__pyx_n_s_DEFLATION; PyObject *__pyx_n_s_DENSE; PyObject *__pyx_n_s_DENSECUDA; PyObject *__pyx_n_s_DESTROY; PyObject *__pyx_n_s_DETERMINE; PyObject *__pyx_n_s_DGMRES; PyObject *__pyx_n_s_DIAG; PyObject *__pyx_n_s_DIAGONAL; PyObject *__pyx_n_s_DIFFERENT; PyObject *__pyx_n_s_DIFFERENT_NONZERO_PATTERN; PyObject *__pyx_n_s_DIFFERENT_NZ; PyObject *__pyx_n_s_DIRK; PyObject *__pyx_n_s_DIRK657A; PyObject *__pyx_n_s_DIRK658A; PyObject *__pyx_n_s_DIRK7510SAL; PyObject *__pyx_n_s_DIRK759A; PyObject *__pyx_n_s_DIRK8614A; PyObject *__pyx_n_s_DIRK8616SAL; PyObject *__pyx_n_s_DIRKES122SAL; PyObject *__pyx_n_s_DIRKES213SAL; PyObject *__pyx_n_s_DIRKES324SAL; PyObject *__pyx_n_s_DIRKES325SAL; PyObject *__pyx_n_s_DIRKES648SA; PyObject *__pyx_n_s_DIRKES7510SA; PyObject *__pyx_n_s_DIRKES8516SAL; PyObject *__pyx_n_s_DIRKS212; PyObject *__pyx_n_s_DIRKS659A; PyObject *__pyx_n_s_DIRKS7511SAL; PyObject *__pyx_n_s_DIRKType; PyObject *__pyx_n_s_DISCGRAD; PyObject *__pyx_n_s_DIVERGED_BREAKDOWN; PyObject *__pyx_n_s_DIVERGED_BREAKDOWN_BICG; PyObject *__pyx_n_s_DIVERGED_DTOL; PyObject *__pyx_n_s_DIVERGED_FNORM_NAN; PyObject *__pyx_n_s_DIVERGED_FUNCTION_COUNT; PyObject *__pyx_n_s_DIVERGED_FUNCTION_DOMAIN; PyObject *__pyx_n_s_DIVERGED_INDEFINITE_MAT; PyObject *__pyx_n_s_DIVERGED_INDEFINITE_PC; PyObject *__pyx_n_s_DIVERGED_INNER; PyObject *__pyx_n_s_DIVERGED_JACOBIAN_DOMAIN; PyObject *__pyx_n_s_DIVERGED_LINEAR_SOLVE; PyObject *__pyx_n_s_DIVERGED_LINE_SEARCH; PyObject *__pyx_n_s_DIVERGED_LOCAL_MIN; PyObject *__pyx_n_s_DIVERGED_LS_FAILURE; PyObject *__pyx_n_s_DIVERGED_MAXFCN; PyObject *__pyx_n_s_DIVERGED_MAXITS; PyObject *__pyx_n_s_DIVERGED_MAX_IT; PyObject *__pyx_n_s_DIVERGED_NAN; PyObject *__pyx_n_s_DIVERGED_NANORINF; PyObject *__pyx_n_s_DIVERGED_NONLINEAR_SOLVE; PyObject *__pyx_n_s_DIVERGED_NONSYMMETRIC; PyObject *__pyx_n_s_DIVERGED_NULL; PyObject *__pyx_n_s_DIVERGED_PCSETUP_FAILED; PyObject *__pyx_n_s_DIVERGED_STEP_REJECTED; PyObject *__pyx_n_s_DIVERGED_TR_DELTA; PyObject *__pyx_n_s_DIVERGED_TR_REDUCTION; PyObject *__pyx_n_s_DIVERGED_USER; PyObject *__pyx_n_s_DK; PyObject *__pyx_n_s_DM; PyObject *__pyx_n_s_DMBoundaryType; PyObject *__pyx_n_s_DMComposite; PyObject *__pyx_n_s_DMComposite_access; PyObject *__pyx_n_s_DMDA; PyObject *__pyx_n_s_DMDAElementType; PyObject *__pyx_n_s_DMDAInterpolationType; PyObject *__pyx_n_s_DMDAStencilType; PyObject *__pyx_n_s_DMDA_Vec_array; PyObject *__pyx_n_s_DMInterpolation; PyObject *__pyx_n_s_DMLabel; PyObject *__pyx_n_s_DMPlex; PyObject *__pyx_n_s_DMPlexReorderDefaultFlag; PyObject *__pyx_n_s_DMPlexTransform; PyObject *__pyx_n_s_DMPlexTransformType; PyObject *__pyx_n_s_DMPolytopeType; PyObject *__pyx_n_s_DMShell; PyObject *__pyx_n_s_DMStag; PyObject *__pyx_n_s_DMStagStencilLocation; PyObject *__pyx_n_s_DMStagStencilType; PyObject *__pyx_n_s_DMSwarm; PyObject *__pyx_n_s_DMSwarmCollectType; PyObject *__pyx_n_s_DMSwarmMigrateType; PyObject *__pyx_n_s_DMSwarmPICLayoutType; PyObject *__pyx_n_s_DMSwarmType; PyObject *__pyx_n_s_DMType; PyObject *__pyx_kp_s_DM_Boundary_types; PyObject *__pyx_kp_s_DM_types; PyObject *__pyx_n_s_DOF; PyObject *__pyx_n_s_DOWN; PyObject *__pyx_n_s_DOWN_LEFT; PyObject *__pyx_n_s_DOWN_RIGHT; PyObject *__pyx_n_s_DO_NOT_COPY_VALUES; PyObject *__pyx_n_s_DRAW; PyObject *__pyx_n_s_DRAW_BASIC; PyObject *__pyx_n_s_DRAW_CONTOUR; PyObject *__pyx_n_s_DRAW_LG; PyObject *__pyx_n_s_DRAW_LG_XRANGE; PyObject *__pyx_n_s_DRAW_PORTS; PyObject *__pyx_n_s_DROP; PyObject *__pyx_n_s_DS; PyObject *__pyx_n_s_DSType; PyObject *__pyx_n_s_DUMMY; PyObject *__pyx_n_s_DY; PyObject *__pyx_n_s_DeflationSpaceType; PyObject *__pyx_n_s_Device; PyObject *__pyx_n_s_DeviceContext; PyObject *__pyx_n_s_DeviceJoinMode; PyObject *__pyx_n_s_DeviceType; PyObject *__pyx_kp_s_Device_type_not_supported; PyObject *__pyx_kp_s_Dimension_d_is_not_direct; PyObject *__pyx_kp_s_Distinguishes_among_types_of_exp; PyObject *__pyx_kp_s_Distinguishes_linear_and_nonline; PyObject *__pyx_n_s_DrawSize; PyObject *__pyx_n_s_DualSpace; PyObject *__pyx_n_s_DualSpaceType; PyObject *__pyx_n_s_Dup; PyObject *__pyx_n_s_DuplicateOption; PyObject *__pyx_n_s_EIMEX; PyObject *__pyx_n_s_EISENSTAT; PyObject *__pyx_n_s_ELEMENT; PyObject *__pyx_n_s_ELEMENTAL; PyObject *__pyx_n_s_ERROR_LOWER_TRIANGULAR; PyObject *__pyx_n_s_ESSL; PyObject *__pyx_n_s_EULER; PyObject *__pyx_n_s_EXODUSII; PyObject *__pyx_n_s_EXOTIC; PyObject *__pyx_n_s_EXPLICIT; PyObject *__pyx_n_s_EXTRUDE; PyObject *__pyx_n_s_ElementType; PyObject *__pyx_n_s_Ellipsis; PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr; PyObject *__pyx_kp_s_Enum_describing_mapping_behavior; PyObject *__pyx_n_s_EquationType; PyObject *__pyx_n_s_Error; PyObject *__pyx_n_s_Error___bool; PyObject *__pyx_n_s_Error___init; PyObject *__pyx_n_s_Error___repr; PyObject *__pyx_n_s_Error___str; PyObject *__pyx_n_s_Event; PyObject *__pyx_n_s_EventDecorator; PyObject *__pyx_n_s_EventDecorator_locals_decorator; PyObject *__pyx_n_s_EventDecorator_locals_decorator_2; PyObject *__pyx_n_s_ExactFinalTime; PyObject *__pyx_n_s_ExactFinalTimeOption; PyObject *__pyx_kp_s_Expect_a_dltensor_field_pycapsul; PyObject *__pyx_kp_s_Expect_a_dltensor_or_used_dltens; PyObject *__pyx_n_s_FACTOR_NUMERIC_ZEROPIVOT; PyObject *__pyx_n_s_FACTOR_OTHER; PyObject *__pyx_n_s_FACTOR_OUTMEMORY; PyObject *__pyx_n_s_FACTOR_STRUCT_ZEROPIVOT; PyObject *__pyx_n_s_FAILED; PyObject *__pyx_n_s_FAILED_ASCENT; PyObject *__pyx_n_s_FAILED_BADPARAMETER; PyObject *__pyx_n_s_FAILED_INFORNAN; PyObject *__pyx_n_s_FALSE; PyObject *__pyx_n_s_FAS; PyObject *__pyx_n_s_FBCGS; PyObject *__pyx_n_s_FBCGSR; PyObject *__pyx_n_s_FCG; PyObject *__pyx_n_s_FE; PyObject *__pyx_n_s_FETIDP; PyObject *__pyx_n_s_FEType; PyObject *__pyx_n_s_FFT; PyObject *__pyx_n_s_FFTW; PyObject *__pyx_n_s_FGMRES; PyObject *__pyx_n_s_FIELDSPLIT; PyObject *__pyx_n_s_FINAL; PyObject *__pyx_n_s_FINAL_ASSEMBLY; PyObject *__pyx_n_s_FINAL_ONLY; PyObject *__pyx_n_s_FLUSH; PyObject *__pyx_n_s_FLUSH_ASSEMBLY; PyObject *__pyx_n_s_FORCE_DIAGONAL_ENTRIES; PyObject *__pyx_n_s_FOREST; PyObject *__pyx_n_s_FORWARD; PyObject *__pyx_n_s_FORWARD_LOCAL; PyObject *__pyx_n_s_FORWARD_SWEEP; PyObject *__pyx_n_s_FR; PyObject *__pyx_n_s_FRB; PyObject *__pyx_n_s_FROBENIUS; PyObject *__pyx_n_s_FRONT; PyObject *__pyx_n_s_FRONT_DOWN; PyObject *__pyx_n_s_FRONT_DOWN_LEFT; PyObject *__pyx_n_s_FRONT_DOWN_RIGHT; PyObject *__pyx_n_s_FRONT_LEFT; PyObject *__pyx_n_s_FRONT_RIGHT; PyObject *__pyx_n_s_FRONT_UP; PyObject *__pyx_n_s_FRONT_UP_LEFT; PyObject *__pyx_n_s_FRONT_UP_RIGHT; PyObject *__pyx_n_s_FULL; PyObject *__pyx_n_s_FULL_SIZE; PyObject *__pyx_n_s_FV_GHOST; PyObject *__pyx_n_s_FactorShiftType; PyObject *__pyx_kp_s_Factored_matrix_ordering_type_Se; PyObject *__pyx_kp_s_Factored_matrix_shift_type_See_A; PyObject *__pyx_kp_s_Factored_matrix_solver_type_See; PyObject *__pyx_n_s_FailedReason; PyObject *__pyx_n_s_FieldSplitSchurFactType; PyObject *__pyx_n_s_FieldSplitSchurPreType; PyObject *__pyx_n_s_FileMode; PyObject *__pyx_n_s_Format; PyObject *__pyx_n_s_Free; PyObject *__pyx_n_s_G; PyObject *__pyx_n_s_GALERKIN; PyObject *__pyx_n_s_GAMG; PyObject *__pyx_n_s_GAMGType; PyObject *__pyx_n_s_GASM; PyObject *__pyx_n_s_GASMType; PyObject *__pyx_n_s_GATHER; PyObject *__pyx_n_s_GATHERV; PyObject *__pyx_n_s_GCR; PyObject *__pyx_n_s_GCRODR; PyObject *__pyx_n_s_GD; PyObject *__pyx_n_s_GENERAL; PyObject *__pyx_n_s_GEO; PyObject *__pyx_n_s_GETROW_UPPERTRIANGULAR; PyObject *__pyx_n_s_GHOSTED; PyObject *__pyx_kp_s_GIT_Date; PyObject *__pyx_n_s_GLEE; PyObject *__pyx_n_s_GLLE; PyObject *__pyx_n_s_GLMapMode; PyObject *__pyx_n_s_GLOBAL_BLOCKING; PyObject *__pyx_n_s_GLOBAL_MAX; PyObject *__pyx_n_s_GLOBAL_NONBLOCKING; PyObject *__pyx_n_s_GLOBAL_SUM; PyObject *__pyx_n_s_GLTR; PyObject *__pyx_n_s_GLVIS; PyObject *__pyx_n_s_GMRES; PyObject *__pyx_n_s_GPCG; PyObject *__pyx_n_s_GROPPCG; PyObject *__pyx_n_s_Get_rank; PyObject *__pyx_n_s_Get_size; PyObject *__pyx_kp_s_Given_d_column_indices_but_d_non; PyObject *__pyx_n_s_H; PyObject *__pyx_n_s_H2OPUS; PyObject *__pyx_n_s_HAAR; PyObject *__pyx_n_s_HALF; PyObject *__pyx_n_s_HALF_SIZE; PyObject *__pyx_n_s_HALTED_LOWERBOUND; PyObject *__pyx_n_s_HALTED_MAXFCN; PyObject *__pyx_n_s_HALTED_OTHER; PyObject *__pyx_n_s_HALTED_RTOL; PyObject *__pyx_n_s_HALTED_UPPERBOUND; PyObject *__pyx_n_s_HALTED_USER; PyObject *__pyx_n_s_HASH; PyObject *__pyx_n_s_HDF5; PyObject *__pyx_n_s_HDF5_MAT; PyObject *__pyx_n_s_HDF5_PETSC; PyObject *__pyx_n_s_HDF5_VIZ; PyObject *__pyx_n_s_HDF5_XDMF; PyObject *__pyx_n_s_HERMITIAN; PyObject *__pyx_n_s_HERMITIANTRANSPOSE; PyObject *__pyx_n_s_HEXAHEDRON; PyObject *__pyx_n_s_HIP; PyObject *__pyx_n_s_HMG; PyObject *__pyx_n_s_HOST; PyObject *__pyx_n_s_HPDDM; PyObject *__pyx_n_s_HPDDMCoarseCorrectionType; PyObject *__pyx_n_s_HPDDMType; PyObject *__pyx_n_s_HS; PyObject *__pyx_n_s_HYPRE; PyObject *__pyx_n_s_HYPRESSTRUCT; PyObject *__pyx_n_s_HYPRESTRUCT; PyObject *__pyx_n_s_HZ; PyObject *__pyx_n_s_I; PyObject *__pyx_n_s_IBCGS; PyObject *__pyx_n_s_ICC; PyObject *__pyx_n_s_IGNORE_LOWER_TRIANGULAR; PyObject *__pyx_n_s_IGNORE_NEGATIVE_INDICES; PyObject *__pyx_n_s_IGNORE_OFF_PROC_ENTRIES; PyObject *__pyx_n_s_IGNORE_ZERO_ENTRIES; PyObject *__pyx_n_s_ILU; PyObject *__pyx_n_s_IMPLICIT; PyObject *__pyx_n_s_INBLOCKS; PyObject *__pyx_n_s_INF; PyObject *__pyx_n_s_INFINITY; PyObject *__pyx_n_s_INITIAL_FINAL_ONLY; PyObject *__pyx_n_s_INITIAL_ONLY; PyObject *__pyx_n_s_INSERT; PyObject *__pyx_n_s_INSERT_ALL; PyObject *__pyx_n_s_INSERT_ALL_VALUES; PyObject *__pyx_n_s_INSERT_BC; PyObject *__pyx_n_s_INSERT_BC_VALUES; PyObject *__pyx_n_s_INSERT_VALUES; PyObject *__pyx_n_s_INTERIOR_GHOST; PyObject *__pyx_n_s_INTERPOLATE; PyObject *__pyx_n_s_IPM; PyObject *__pyx_n_s_IS; PyObject *__pyx_n_s_ISType; PyObject *__pyx_n_s_IS_buffer; PyObject *__pyx_n_s_ITERATING; PyObject *__pyx_kp_s_I_0_is_d_expected_d; PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0; PyObject *__pyx_n_s_IndexError; PyObject *__pyx_kp_s_Index_out_of_bounds_axis_d; PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte; PyObject *__pyx_n_s_InfoType; PyObject *__pyx_kp_s_Input_vector_has_no_tensor_infor; PyObject *__pyx_n_s_InsertMode; PyObject *__pyx_kp_s_Insertion_mode_Most_commonly_use; PyObject *__pyx_n_s_IntType; PyObject *__pyx_n_s_InterpolationType; PyObject *__pyx_kp_u_Invalid_mode_expected_c_or_fortr; PyObject *__pyx_kp_s_Invalid_mode_expected_r_w_or_rw; PyObject *__pyx_kp_s_Invalid_mode_expected_rw_r_or_w; PyObject *__pyx_kp_u_Invalid_shape_in_axis; PyObject *__pyx_n_s_J; PyObject *__pyx_n_s_JACOBI; PyObject *__pyx_n_s_JoinMode; PyObject *__pyx_n_s_KACZMARZ; PyObject *__pyx_n_s_KAIJ; PyObject *__pyx_n_s_KASKADE; PyObject *__pyx_n_s_KD; PyObject *__pyx_n_s_KEEP_NONZERO_PATTERN; PyObject *__pyx_n_s_KLU; PyObject *__pyx_n_s_KOKKOS; PyObject *__pyx_n_s_KSP; PyObject *__pyx_n_s_KSPConvergedReason; PyObject *__pyx_n_s_KSPHPDDMType; PyObject *__pyx_n_s_KSPNormType; PyObject *__pyx_n_s_KSPONLY; PyObject *__pyx_n_s_KSPTRANSPOSEONLY; PyObject *__pyx_n_s_KSPType; PyObject *__pyx_kp_s_KSP_Converged_Reason_CONVERGED_I; PyObject *__pyx_kp_s_KSP_Type_The_available_types_are; PyObject *__pyx_kp_s_KSP_norm_type_The_available_norm; PyObject *__pyx_n_s_KeyError; PyObject *__pyx_n_s_L; PyObject *__pyx_n_s_LAGRANGE; PyObject *__pyx_n_s_LAYOUT_GAUSS; PyObject *__pyx_n_s_LAYOUT_REGULAR; PyObject *__pyx_n_s_LAYOUT_SUBDIVISION; PyObject *__pyx_n_s_LCD; PyObject *__pyx_n_s_LCL; PyObject *__pyx_n_s_LEFT; PyObject *__pyx_n_s_LGMRES; PyObject *__pyx_n_s_LGMap; PyObject *__pyx_n_s_LGMapType; PyObject *__pyx_n_s_LINEAR; PyObject *__pyx_n_s_LMVM; PyObject *__pyx_n_s_LMVMBADBROYDEN; PyObject *__pyx_n_s_LMVMBFGS; PyObject *__pyx_n_s_LMVMBROYDEN; PyObject *__pyx_n_s_LMVMDFP; PyObject *__pyx_n_s_LMVMDIAGBBROYDEN; PyObject *__pyx_n_s_LMVMSR1; PyObject *__pyx_n_s_LMVMSYMBADBROYDEN; PyObject *__pyx_n_s_LMVMSYMBROYDEN; PyObject *__pyx_n_s_LOAD_BALANCE; PyObject *__pyx_n_s_LOCAL; PyObject *__pyx_n_s_LOCALREF; PyObject *__pyx_n_s_LOCAL_BACKWARD_SWEEP; PyObject *__pyx_n_s_LOCAL_FORWARD_SWEEP; PyObject *__pyx_n_s_LOCAL_SYMMETRIC_SWEEP; PyObject *__pyx_n_s_LOWER; PyObject *__pyx_n_s_LRC; PyObject *__pyx_n_s_LSC; PyObject *__pyx_n_s_LSQR; PyObject *__pyx_n_s_LU; PyObject *__pyx_n_s_LUSOL; PyObject *__pyx_n_s_Left; PyObject *__pyx_n_s_Log; PyObject *__pyx_n_s_LogClass; PyObject *__pyx_n_s_LogEvent; PyObject *__pyx_n_s_LogStage; PyObject *__pyx_n_s_MAIJ; PyObject *__pyx_n_s_MAPPING; PyObject *__pyx_n_s_MASK; PyObject *__pyx_n_s_MAT; PyObject *__pyx_n_s_MATCHSTEP; PyObject *__pyx_n_s_MATHEMATICA; PyObject *__pyx_n_s_MATLAB; PyObject *__pyx_n_s_MATPARTITIONING; PyObject *__pyx_n_s_MAX; PyObject *__pyx_n_s_MAX_VALUES; PyObject *__pyx_n_s_MEMORYSCALABLE; PyObject *__pyx_n_s_METISND; PyObject *__pyx_n_s_MEYER; PyObject *__pyx_n_s_MFFD; PyObject *__pyx_n_s_MG; PyObject *__pyx_n_s_MGCycleType; PyObject *__pyx_n_s_MGType; PyObject *__pyx_n_s_MIGRATE_BASIC; PyObject *__pyx_n_s_MIGRATE_DMCELLEXACT; PyObject *__pyx_n_s_MIGRATE_DMCELLNSCATTER; PyObject *__pyx_n_s_MIGRATE_USER; PyObject *__pyx_n_s_MIMEX; PyObject *__pyx_n_s_MINRES; PyObject *__pyx_n_s_MIRROR; PyObject *__pyx_n_s_MKL_CPARDISO; PyObject *__pyx_n_s_MKL_PARDISO; PyObject *__pyx_n_s_ML; PyObject *__pyx_n_s_MOAB; PyObject *__pyx_n_s_MORETHUENTE; PyObject *__pyx_n_s_MPI; PyObject *__pyx_n_s_MPIADJ; PyObject *__pyx_n_s_MPIAIJ; PyObject *__pyx_n_s_MPIAIJCRL; PyObject *__pyx_n_s_MPIAIJCUSPARSE; PyObject *__pyx_n_s_MPIAIJMKL; PyObject *__pyx_n_s_MPIAIJPERM; PyObject *__pyx_n_s_MPIAIJSELL; PyObject *__pyx_n_s_MPIAIJVIENNACL; PyObject *__pyx_n_s_MPIBAIJ; PyObject *__pyx_n_s_MPIBAIJMKL; PyObject *__pyx_n_s_MPICUDA; PyObject *__pyx_n_s_MPIDENSE; PyObject *__pyx_n_s_MPIDENSECUDA; PyObject *__pyx_n_s_MPIHIP; PyObject *__pyx_n_s_MPIKAIJ; PyObject *__pyx_n_s_MPIKOKKOS; PyObject *__pyx_n_s_MPIMAIJ; PyObject *__pyx_n_s_MPISBAIJ; PyObject *__pyx_n_s_MPISELL; PyObject *__pyx_n_s_MPIVIENNACL; PyObject *__pyx_n_s_MPRK; PyObject *__pyx_n_s_MS; PyObject *__pyx_n_s_MULTIPLICATIVE; PyObject *__pyx_n_s_MUMPS; PyObject *__pyx_n_s_MapMode; PyObject *__pyx_n_s_Mat; PyObject *__pyx_n_s_MatAssemblyType; PyObject *__pyx_n_s_MatDuplicateOption; PyObject *__pyx_n_s_MatFactorShiftType; PyObject *__pyx_n_s_MatInfoType; PyObject *__pyx_n_s_MatOption; PyObject *__pyx_n_s_MatOrderingType; PyObject *__pyx_n_s_MatPartitioning; PyObject *__pyx_n_s_MatPartitioningType; PyObject *__pyx_n_s_MatSORType; PyObject *__pyx_n_s_MatSolverType; PyObject *__pyx_n_s_MatStructure; PyObject *__pyx_n_s_MatType; PyObject *__pyx_kp_s_Matrix_SOR_type_See_Also_petsc_M; PyObject *__pyx_kp_s_Matrix_assembly_type_See_Also_pe; PyObject *__pyx_kp_s_Matrix_duplicate_option_See_Also; PyObject *__pyx_kp_s_Matrix_info_type; PyObject *__pyx_kp_s_Matrix_modification_structure_Se; PyObject *__pyx_kp_s_Matrix_option_See_Also_petsc_Mat; PyObject *__pyx_kp_s_Matrix_type_See_Also_petsc_MatTy; PyObject *__pyx_n_s_MemoryError; PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x; PyObject *__pyx_kp_s_MemoryView_of_r_object; PyObject *__pyx_n_s_MigrateType; PyObject *__pyx_kp_s_Missing_input_parameters; PyObject *__pyx_n_s_Mode; PyObject *__pyx_kp_s_More_constants_INFINITY_Very_la; PyObject *__pyx_kp_s_Must_provide_as_many_communicato; PyObject *__pyx_kp_s_Must_provide_both_sizes_and_poin; PyObject *__pyx_kp_s_Must_provide_operator_for_USER_o; PyObject *__pyx_n_s_N1; PyObject *__pyx_n_s_N12; PyObject *__pyx_n_s_N2; PyObject *__pyx_n_s_NASH; PyObject *__pyx_n_s_NASM; PyObject *__pyx_n_s_NATIVE; PyObject *__pyx_n_s_NATURAL; PyObject *__pyx_n_s_NCG; PyObject *__pyx_n_s_ND; PyObject *__pyx_n_s_ND_Pi; PyObject *__pyx_n_s_ND_Pi_Full; PyObject *__pyx_n_s_NEIGHBOR; PyObject *__pyx_n_s_NEST; PyObject *__pyx_n_s_NETWORK; PyObject *__pyx_n_s_NEWTONLS; PyObject *__pyx_n_s_NEWTONTR; PyObject *__pyx_n_s_NEW_NONZERO_ALLOCATION_ERR; PyObject *__pyx_n_s_NEW_NONZERO_LOCATIONS; PyObject *__pyx_n_s_NEW_NONZERO_LOCATION_ERR; PyObject *__pyx_n_s_NGMRES; PyObject *__pyx_n_s_NGS; PyObject *__pyx_n_s_NINFINITY; PyObject *__pyx_n_s_NLS; PyObject *__pyx_n_s_NM; PyObject *__pyx_n_s_NN; PyObject *__pyx_n_s_NO; PyObject *__pyx_n_s_NOERROR; PyObject *__pyx_n_s_NOFORMAT; PyObject *__pyx_n_s_NONE; PyObject *__pyx_n_s_NONLINEAR; PyObject *__pyx_n_s_NONZERO; PyObject *__pyx_n_s_NORMAL; PyObject *__pyx_n_s_NORMALHERMITIAN; PyObject *__pyx_n_s_NORM_1; PyObject *__pyx_n_s_NORM_1_AND_2; PyObject *__pyx_n_s_NORM_2; PyObject *__pyx_n_s_NORM_ALWAYS; PyObject *__pyx_n_s_NORM_DEFAULT; PyObject *__pyx_n_s_NORM_FINAL_ONLY; PyObject *__pyx_n_s_NORM_FROBENIUS; PyObject *__pyx_n_s_NORM_INFINITY; PyObject *__pyx_n_s_NORM_INITIAL_FINAL_ONLY; PyObject *__pyx_n_s_NORM_INITIAL_ONLY; PyObject *__pyx_n_s_NORM_MAX; PyObject *__pyx_n_s_NORM_NATURAL; PyObject *__pyx_n_s_NORM_NONE; PyObject *__pyx_n_s_NORM_PRECONDITIONED; PyObject *__pyx_n_s_NORM_UNPRECONDITIONED; PyObject *__pyx_n_s_NOTSET; PyObject *__pyx_n_s_NOT_SET_VALUES; PyObject *__pyx_n_s_NO_OFF_PROC_ENTRIES; PyObject *__pyx_n_s_NO_OFF_PROC_ZERO_ROWS; PyObject *__pyx_n_s_NO_SYNC; PyObject *__pyx_n_s_NRICHARDSON; PyObject *__pyx_n_s_NTL; PyObject *__pyx_n_s_NTR; PyObject *__pyx_n_s_NULLLOC; PyObject *__pyx_n_s_NZ; PyObject *__pyx_n_s_NormSchedule; PyObject *__pyx_n_s_NormType; PyObject *__pyx_kp_s_Norm_type_Commonly_used_norm_typ; PyObject *__pyx_n_s_NotImplemented; PyObject *__pyx_n_s_NotImplementedError; PyObject *__pyx_kp_s_Not_for_rectangular_matrices; PyObject *__pyx_kp_s_Not_for_type; PyObject *__pyx_n_s_NullSpace; PyObject *__pyx_n_b_O; PyObject *__pyx_n_s_ODE_EXPLICIT; PyObject *__pyx_n_s_ODE_IMPLICIT; PyObject *__pyx_n_s_OPENCL; PyObject *__pyx_n_s_OPTION_MAX; PyObject *__pyx_n_s_OPTION_MIN; PyObject *__pyx_n_s_OWARMIJO; PyObject *__pyx_n_s_OWD; PyObject *__pyx_n_s_OWLQN; PyObject *__pyx_n_s_Object; PyObject *__pyx_kp_s_Object_is_not_writable; PyObject *__pyx_n_s_Option; PyObject *__pyx_n_s_Options; PyObject *__pyx_n_s_OrderingType; PyObject *__pyx_kp_u_Out_of_bounds_on_buffer_access_a; PyObject *__pyx_kp_s_Out_of_memory_Allocated_d_Used_b; PyObject *__pyx_n_s_P; PyObject *__pyx_n_s_P1; PyObject *__pyx_n_s_P4EST; PyObject *__pyx_n_s_P8EST; PyObject *__pyx_n_s_PARDECOMP; PyObject *__pyx_n_s_PARMETIS; PyObject *__pyx_n_s_PARMS; PyObject *__pyx_n_s_PARTITIONINGAVERAGE; PyObject *__pyx_n_s_PARTITIONINGCHACO; PyObject *__pyx_n_s_PARTITIONINGCURRENT; PyObject *__pyx_n_s_PARTITIONINGHIERARCH; PyObject *__pyx_n_s_PARTITIONINGPARMETIS; PyObject *__pyx_n_s_PARTITIONINGPARTY; PyObject *__pyx_n_s_PARTITIONINGPTSCOTCH; PyObject *__pyx_n_s_PARTITIONINGSQUARE; PyObject *__pyx_n_s_PASTIX; PyObject *__pyx_n_s_PATCH; PyObject *__pyx_n_s_PBJACOBI; PyObject *__pyx_n_s_PC; PyObject *__pyx_n_s_PCASMType; PyObject *__pyx_n_s_PCCompositeType; PyObject *__pyx_n_s_PCDeflationSpaceType; PyObject *__pyx_n_s_PCFailedReason; PyObject *__pyx_n_s_PCFieldSplitSchurFactType; PyObject *__pyx_n_s_PCFieldSplitSchurPreType; PyObject *__pyx_n_s_PCGAMGType; PyObject *__pyx_n_s_PCGASMType; PyObject *__pyx_n_s_PCGD; PyObject *__pyx_n_s_PCHPDDMCoarseCorrectionType; PyObject *__pyx_n_s_PCMGCycleType; PyObject *__pyx_n_s_PCMGType; PyObject *__pyx_n_s_PCPatchConstructType; PyObject *__pyx_n_s_PCSide; PyObject *__pyx_n_s_PCType; PyObject *__pyx_n_s_PD; PyObject *__pyx_n_s_PDIPM; PyObject *__pyx_n_s_PERIODIC; PyObject *__pyx_n_s_PETSC; PyObject *__pyx_kp_s_PETSc_Error_Attributes_ierr_int; PyObject *__pyx_kp_s_PETSc_Error_d; PyObject *__pyx_n_s_PFMG; PyObject *__pyx_n_s_PGMRES; PyObject *__pyx_n_s_PIC; PyObject *__pyx_n_s_PICLayoutType; PyObject *__pyx_n_s_PINFINITY; PyObject *__pyx_n_s_PIPEBCGS; PyObject *__pyx_n_s_PIPECG; PyObject *__pyx_n_s_PIPECG2; PyObject *__pyx_n_s_PIPECGRR; PyObject *__pyx_n_s_PIPECR; PyObject *__pyx_n_s_PIPEFCG; PyObject *__pyx_n_s_PIPEFGMRES; PyObject *__pyx_n_s_PIPEGCR; PyObject *__pyx_n_s_PIPELCG; PyObject *__pyx_n_s_PIPEPRCG; PyObject *__pyx_n_s_PLEX; PyObject *__pyx_n_s_POINT; PyObject *__pyx_n_s_POINT_PRISM_TENSOR; PyObject *__pyx_n_s_POLYNOMIAL; PyObject *__pyx_n_s_POSITIVE_DEFINITE; PyObject *__pyx_n_s_POUNDERS; PyObject *__pyx_n_s_PREALLOCATOR; PyObject *__pyx_n_s_PRECONDITIONED; PyObject *__pyx_n_s_PREONLY; PyObject *__pyx_n_s_PRODUCT; PyObject *__pyx_n_s_PRP; PyObject *__pyx_n_s_PRP_PLUS; PyObject *__pyx_n_s_PSEUDO; PyObject *__pyx_n_s_PTRIMMED; PyObject *__pyx_n_s_PTSCOTCH; PyObject *__pyx_n_s_PYRAMID; PyObject *__pyx_n_s_PYTHON; PyObject *__pyx_n_s_Partitioner; PyObject *__pyx_n_s_PartitionerType; PyObject *__pyx_n_s_PatchConstructType; PyObject *__pyx_n_s_PickleError; PyObject *__pyx_n_s_PolytopeType; PyObject *__pyx_kp_s_Portable_Extensible_Toolkit_for; PyObject *__pyx_n_s_Print; PyObject *__pyx_n_s_ProblemType; PyObject *__pyx_n_s_PtAP; PyObject *__pyx_n_s_Q0; PyObject *__pyx_n_s_Q1; PyObject *__pyx_n_s_QCG; PyObject *__pyx_n_s_QMD; PyObject *__pyx_n_s_QMRCGS; PyObject *__pyx_n_s_QN; PyObject *__pyx_n_s_QR; PyObject *__pyx_n_s_QUADRILATERAL; PyObject *__pyx_n_s_QUAD_PRISM_TENSOR; PyObject *__pyx_n_s_QUARTER; PyObject *__pyx_n_s_QUARTER_SIZE; PyObject *__pyx_n_s_Quad; PyObject *__pyx_n_s_R; PyObject *__pyx_n_s_RADAU5; PyObject *__pyx_n_s_RAND; PyObject *__pyx_n_s_RAND48; PyObject *__pyx_n_s_RANDER48; PyObject *__pyx_n_s_RANDOM123; PyObject *__pyx_n_s_RARt; PyObject *__pyx_n_s_RCM; PyObject *__pyx_n_s_READ; PyObject *__pyx_n_s_REDISTRIBUTE; PyObject *__pyx_n_s_REDUNDANT; PyObject *__pyx_n_s_REFINE1D; PyObject *__pyx_n_s_REFINEALFELD; PyObject *__pyx_n_s_REFINEBOUNDARYLAYER; PyObject *__pyx_n_s_REFINED; PyObject *__pyx_n_s_REFINEPOWELLSABIN; PyObject *__pyx_n_s_REFINEREGULAR; PyObject *__pyx_n_s_REFINESBR; PyObject *__pyx_n_s_REFINETOBOX; PyObject *__pyx_n_s_REFINETOSIMPLEX; PyObject *__pyx_n_s_RESTRICT; PyObject *__pyx_n_s_REVERSE; PyObject *__pyx_n_s_REVERSE_LOCAL; PyObject *__pyx_n_s_RICHARDSON; PyObject *__pyx_n_s_RIGHT; PyObject *__pyx_n_s_RK; PyObject *__pyx_n_s_RK1FE; PyObject *__pyx_n_s_RK2A; PyObject *__pyx_n_s_RK2B; PyObject *__pyx_n_s_RK3; PyObject *__pyx_n_s_RK3BS; PyObject *__pyx_n_s_RK4; PyObject *__pyx_n_s_RK5BS; PyObject *__pyx_n_s_RK5DP; PyObject *__pyx_n_s_RK5F; PyObject *__pyx_n_s_RK6VR; PyObject *__pyx_n_s_RK7VR; PyObject *__pyx_n_s_RK8VR; PyObject *__pyx_n_s_RKType; PyObject *__pyx_n_s_ROSW; PyObject *__pyx_n_s_ROWLENGTH; PyObject *__pyx_n_s_ROWSCALINGVIENNACL; PyObject *__pyx_n_s_ROW_ORIENTED; PyObject *__pyx_n_s_RT_Pi; PyObject *__pyx_n_s_RT_Pi_Full; PyObject *__pyx_n_s_RUNGE_KUTTA; PyObject *__pyx_n_s_Random; PyObject *__pyx_n_s_RandomType; PyObject *__pyx_n_s_RealType; PyObject *__pyx_n_s_Reason; PyObject *__pyx_n_s_ReorderDefaultFlag; PyObject *__pyx_n_s_Right; PyObject *__pyx_n_s_RuntimeError; PyObject *__pyx_n_s_S; PyObject *__pyx_n_s_SAME; PyObject *__pyx_n_s_SAME_NONZERO_PATTERN; PyObject *__pyx_n_s_SAME_NZ; PyObject *__pyx_n_s_SAVIENNACL; PyObject *__pyx_n_s_SAWS; PyObject *__pyx_n_s_SBAIJ; PyObject *__pyx_n_s_SCALAPACK; PyObject *__pyx_n_s_SCATTER; PyObject *__pyx_n_s_SCATTER_FORWARD; PyObject *__pyx_n_s_SCATTER_FORWARD_LOCAL; PyObject *__pyx_n_s_SCATTER_REVERSE; PyObject *__pyx_n_s_SCATTER_REVERSE_LOCAL; PyObject *__pyx_n_s_SCHUR; PyObject *__pyx_n_s_SCHURCOMPLEMENT; PyObject *__pyx_n_s_SEGMENT; PyObject *__pyx_n_s_SEG_PRISM_TENSOR; PyObject *__pyx_n_s_SELF; PyObject *__pyx_n_s_SELFP; PyObject *__pyx_n_s_SELL; PyObject *__pyx_n_s_SEQ; PyObject *__pyx_n_s_SEQAIJ; PyObject *__pyx_n_s_SEQAIJCRL; PyObject *__pyx_n_s_SEQAIJCUSPARSE; PyObject *__pyx_n_s_SEQAIJMKL; PyObject *__pyx_n_s_SEQAIJPERM; PyObject *__pyx_n_s_SEQAIJSELL; PyObject *__pyx_n_s_SEQAIJVIENNACL; PyObject *__pyx_n_s_SEQBAIJ; PyObject *__pyx_n_s_SEQBAIJMKL; PyObject *__pyx_n_s_SEQCUDA; PyObject *__pyx_n_s_SEQCUFFT; PyObject *__pyx_n_s_SEQDENSE; PyObject *__pyx_n_s_SEQDENSECUDA; PyObject *__pyx_n_s_SEQHIP; PyObject *__pyx_n_s_SEQKAIJ; PyObject *__pyx_n_s_SEQKOKKOS; PyObject *__pyx_n_s_SEQMAIJ; PyObject *__pyx_n_s_SEQSBAIJ; PyObject *__pyx_n_s_SEQSELL; PyObject *__pyx_n_s_SEQVIENNACL; PyObject *__pyx_n_s_SETUP_ERROR; PyObject *__pyx_n_s_SF; PyObject *__pyx_n_s_SFType; PyObject *__pyx_n_s_SHARED; PyObject *__pyx_n_s_SHARE_NONZERO_PATTERN; PyObject *__pyx_n_s_SHELL; PyObject *__pyx_n_s_SIMPLE; PyObject *__pyx_n_s_SLICED; PyObject *__pyx_n_s_SNES; PyObject *__pyx_n_s_SNESConvergedReason; PyObject *__pyx_n_s_SNESNormSchedule; PyObject *__pyx_n_s_SNESType; PyObject *__pyx_kp_s_SNES_norm_schedule_See_Also_pets; PyObject *__pyx_kp_s_SNES_solver_termination_reason_S; PyObject *__pyx_kp_s_SNES_solver_type_See_Also_petsc; PyObject *__pyx_n_s_SOCKET; PyObject *__pyx_n_s_SOR; PyObject *__pyx_n_s_SORTED_FULL; PyObject *__pyx_n_s_SORType; PyObject *__pyx_n_s_SPAI; PyObject *__pyx_n_s_SPD; PyObject *__pyx_n_s_SPECIAL; PyObject *__pyx_n_s_SPECTRAL; PyObject *__pyx_n_s_SPQR; PyObject *__pyx_n_s_SPRNG; PyObject *__pyx_n_s_SSFLS; PyObject *__pyx_n_s_SSILS; PyObject *__pyx_n_s_SSML_BFGS; PyObject *__pyx_n_s_SSML_BRDN; PyObject *__pyx_n_s_SSML_DFP; PyObject *__pyx_n_s_SSP; PyObject *__pyx_n_s_STAG; PyObject *__pyx_n_s_STANDARD; PyObject *__pyx_n_s_STAR; PyObject *__pyx_n_s_STCG; PyObject *__pyx_n_s_STDERR; PyObject *__pyx_n_s_STDOUT; PyObject *__pyx_n_s_STEPOVER; PyObject *__pyx_n_s_STRIDE; PyObject *__pyx_n_s_STRING; PyObject *__pyx_n_s_STRUCTURALLY_SYMMETRIC; PyObject *__pyx_n_s_STRUCTURE_ONLY; PyObject *__pyx_n_s_STRUMPACK; PyObject *__pyx_n_s_SUBMATRIX; PyObject *__pyx_n_s_SUBMAT_SINGLEIS; PyObject *__pyx_n_s_SUBPC_ERROR; PyObject *__pyx_n_s_SUBSET; PyObject *__pyx_n_s_SUBSET_NONZERO_PATTERN; PyObject *__pyx_n_s_SUBSET_NZ; PyObject *__pyx_n_s_SUBSET_OFF_PROC_ENTRIES; PyObject *__pyx_n_s_SUBSPACE; PyObject *__pyx_n_s_SUCCESS; PyObject *__pyx_n_s_SUCCESS_USER; PyObject *__pyx_n_s_SUM; PyObject *__pyx_n_s_SUNDIALS; PyObject *__pyx_n_s_SUPERLU; PyObject *__pyx_n_s_SUPERLU_DIST; PyObject *__pyx_n_s_SVD; PyObject *__pyx_n_s_SWARM; PyObject *__pyx_n_s_SYCL; PyObject *__pyx_n_s_SYMMETRIC; PyObject *__pyx_n_s_SYMMETRIC_MULTIPLICATIVE; PyObject *__pyx_n_s_SYMMETRY_ETERNAL; PyObject *__pyx_n_s_SYMMETRY_SWEEP; PyObject *__pyx_n_s_SYMMLQ; PyObject *__pyx_n_s_SYNC; PyObject *__pyx_n_s_SYSPFMG; PyObject *__pyx_n_s_ScalarType; PyObject *__pyx_n_s_Scatter; PyObject *__pyx_n_s_ScatterMode; PyObject *__pyx_n_s_ScatterType; PyObject *__pyx_kp_s_Scatter_mode_Most_commonly_used; PyObject *__pyx_kp_s_Scatter_type_See_Also_petsc_VecS; PyObject *__pyx_n_s_SchurFactType; PyObject *__pyx_n_s_SchurPreType; PyObject *__pyx_n_s_Section; PyObject *__pyx_n_s_Sequence; PyObject *__pyx_n_s_Side; PyObject *__pyx_n_s_Size; PyObject *__pyx_n_s_SolverType; PyObject *__pyx_n_s_Space; PyObject *__pyx_n_s_SpaceType; PyObject *__pyx_n_s_Stage; PyObject *__pyx_n_s_Stencil; PyObject *__pyx_n_s_StencilLocation; PyObject *__pyx_n_s_StencilType; PyObject *__pyx_kp_s_Step_may_not_be_zero_axis_d; PyObject *__pyx_n_s_StreamType; PyObject *__pyx_n_s_Structure; PyObject *__pyx_n_s_Sys; PyObject *__pyx_n_s_SystemError; PyObject *__pyx_kp_b_T; PyObject *__pyx_n_s_TAO; PyObject *__pyx_n_s_TAOBNCGType; PyObject *__pyx_n_s_TAOConvergedReason; PyObject *__pyx_n_s_TAOLineSearch; PyObject *__pyx_n_s_TAOLineSearchConvergedReason; PyObject *__pyx_n_s_TAOLineSearchType; PyObject *__pyx_n_s_TAOType; PyObject *__pyx_kp_s_TAO_Bound_Constrained_Conjugate; PyObject *__pyx_kp_s_TAO_Line_Search_Termination_Reas; PyObject *__pyx_kp_s_TAO_Line_Search_Types; PyObject *__pyx_kp_s_TAO_solver_termination_reason_Se; PyObject *__pyx_kp_s_TAO_solver_type_See_Also_petsc_T; PyObject *__pyx_n_s_TCQMR; PyObject *__pyx_n_s_TELESCOPE; PyObject *__pyx_n_s_TENSOR; PyObject *__pyx_n_s_TETRAHEDRON; PyObject *__pyx_n_s_TFQMR; PyObject *__pyx_n_s_TFS; PyObject *__pyx_n_s_TH; PyObject *__pyx_n_s_THETA; PyObject *__pyx_n_s_THIRD; PyObject *__pyx_n_s_THIRD_SIZE; PyObject *__pyx_n_s_TRANSFORMFILTER; PyObject *__pyx_n_s_TRANSPOSE; PyObject *__pyx_n_s_TRIANGLE; PyObject *__pyx_n_s_TRI_PRISM; PyObject *__pyx_n_s_TRI_PRISM_TENSOR; PyObject *__pyx_n_s_TRON; PyObject *__pyx_n_s_TRUE; PyObject *__pyx_n_s_TS; PyObject *__pyx_n_s_TSARKIMEXType; PyObject *__pyx_n_s_TSConvergedReason; PyObject *__pyx_n_s_TSDIRKType; PyObject *__pyx_n_s_TSEquationType; PyObject *__pyx_n_s_TSExactFinalTime; PyObject *__pyx_n_s_TSIRM; PyObject *__pyx_n_s_TSProblemType; PyObject *__pyx_n_s_TSRKType; PyObject *__pyx_n_s_TSType; PyObject *__pyx_n_s_TWIST; PyObject *__pyx_n_s_T_2; PyObject *__pyx_kp_s_Tensor_dtype_does_not_match_PETS; PyObject *__pyx_kp_s_The_ARKIMEX_subtype; PyObject *__pyx_kp_s_The_ASM_subtype; PyObject *__pyx_kp_s_The_DIRK_subtype; PyObject *__pyx_kp_s_The_GAMG_subtype; PyObject *__pyx_kp_s_The_GASM_subtype; PyObject *__pyx_kp_s_The_HPDDM_Krylov_solver_type; PyObject *__pyx_kp_s_The_HPDDM_coarse_correction_type; PyObject *__pyx_kp_s_The_MG_cycle_type; PyObject *__pyx_kp_s_The_MG_subtype; PyObject *__pyx_kp_s_The_RK_subtype; PyObject *__pyx_kp_s_The_composite_type; PyObject *__pyx_kp_s_The_deflation_space_subtype; PyObject *__pyx_kp_s_The_field_split_Schur_factorizat; PyObject *__pyx_kp_s_The_field_split_Schur_subtype; PyObject *__pyx_kp_s_The_manner_in_which_the_precondi; PyObject *__pyx_kp_s_The_method_for_ending_time_stepp; PyObject *__pyx_kp_s_The_patch_construction_type; PyObject *__pyx_kp_s_The_preconditioner_method; PyObject *__pyx_kp_s_The_random_number_generator_type; PyObject *__pyx_kp_s_The_reason_the_preconditioner_ha; PyObject *__pyx_kp_s_The_reason_the_time_step_is_conv; PyObject *__pyx_kp_s_The_time_stepping_method; PyObject *__pyx_kp_s_The_type_of_device_See_Also_Devi; PyObject *__pyx_kp_s_The_type_of_join_to_perform_See; PyObject *__pyx_kp_s_The_type_of_stream_See_Also_Devi; PyObject *__pyx_kp_s_The_vector_type; PyObject *__pyx_n_s_Type; PyObject *__pyx_n_s_TypeError; PyObject *__pyx_n_s_U; PyObject *__pyx_n_s_UA; PyObject *__pyx_n_s_UMFPACK; PyObject *__pyx_n_s_UNIT; PyObject *__pyx_n_s_UNKNOWN; PyObject *__pyx_n_s_UNKNOWN_NONZERO_PATTERN; PyObject *__pyx_n_s_UNKNOWN_NZ; PyObject *__pyx_n_s_UNPRECONDITIONED; PyObject *__pyx_n_s_UNSPECIFIED; PyObject *__pyx_n_s_UNUSED_NONZERO_LOCATION_ERR; PyObject *__pyx_n_s_UP; PyObject *__pyx_n_s_UPDATE; PyObject *__pyx_n_s_UPPER; PyObject *__pyx_n_s_UP_LEFT; PyObject *__pyx_n_s_UP_RIGHT; PyObject *__pyx_n_s_USER; PyObject *__pyx_n_s_USE_HASH_TABLE; PyObject *__pyx_n_s_USE_INODES; PyObject *__pyx_kp_s_Unable_to_convert_item_to_object; PyObject *__pyx_kp_s_Unsupported_PetscScalar_type; PyObject *__pyx_n_s_V; PyObject *__pyx_n_s_VANKA; PyObject *__pyx_n_s_VIENNACL; PyObject *__pyx_n_s_VINEWTONRSLS; PyObject *__pyx_n_s_VINEWTONSSLS; PyObject *__pyx_n_s_VPBJACOBI; PyObject *__pyx_n_s_VTK; PyObject *__pyx_n_s_VTK_VTR; PyObject *__pyx_n_s_VTK_VTS; PyObject *__pyx_n_s_VTK_VTU; PyObject *__pyx_n_s_VU; PyObject *__pyx_n_s_ValueError; PyObject *__pyx_n_s_Vec; PyObject *__pyx_n_s_VecOption; PyObject *__pyx_n_s_VecType; PyObject *__pyx_n_s_Vec_LocalForm; PyObject *__pyx_n_s_Vec_buffer; PyObject *__pyx_kp_s_Vector_assembly_option; PyObject *__pyx_kp_s_Vector_local_size_d_is_not_compa; PyObject *__pyx_n_s_View_MemoryView; PyObject *__pyx_n_s_Viewer; PyObject *__pyx_n_s_ViewerDrawSize; PyObject *__pyx_n_s_ViewerFileMode; PyObject *__pyx_n_s_ViewerFormat; PyObject *__pyx_n_s_ViewerHDF5; PyObject *__pyx_n_s_ViewerType; PyObject *__pyx_kp_s_Viewer_file_mode; PyObject *__pyx_kp_s_Viewer_format; PyObject *__pyx_kp_s_Viewer_type; PyObject *__pyx_n_s_W; PyObject *__pyx_n_s_WBM; PyObject *__pyx_n_s_WINDOW; PyObject *__pyx_n_s_WRITE; PyObject *__pyx_n_s_WXY; PyObject *__pyx_kp_s_Window_size; PyObject *__pyx_n_s_X; PyObject *__pyx_n_s_ZERO_INITIAL_GUESS; PyObject *__pyx_kp_b__10; PyObject *__pyx_kp_s__10; PyObject *__pyx_kp_b__11; PyObject *__pyx_kp_s__11; PyObject *__pyx_kp_b__12; PyObject *__pyx_kp_u__13; PyObject *__pyx_kp_s__14; PyObject *__pyx_kp_u__14; PyObject *__pyx_kp_s__16; PyObject *__pyx_kp_b__18; PyObject *__pyx_kp_s__18; PyObject *__pyx_kp_s__2; PyObject *__pyx_kp_u__2; PyObject *__pyx_n_s__257; PyObject *__pyx_kp_s__26; PyObject *__pyx_n_s__3; PyObject *__pyx_kp_u__6; PyObject *__pyx_kp_u__7; PyObject *__pyx_kp_b__9; PyObject *__pyx_n_s_a; PyObject *__pyx_kp_s_a_2; PyObject *__pyx_n_s_a_max; PyObject *__pyx_n_s_abc; PyObject *__pyx_n_s_abort; PyObject *__pyx_kp_s_accessing_non_existent_buffer_se; PyObject *__pyx_n_s_adaptStep; PyObject *__pyx_n_s_addFlops; PyObject *__pyx_n_s_addv; PyObject *__pyx_n_s_adj; PyObject *__pyx_n_s_adjoint_steps; PyObject *__pyx_n_s_allocate_buffer; PyObject *__pyx_n_s_alpha; PyObject *__pyx_n_s_alpha2; PyObject *__pyx_n_s_alpha_f; PyObject *__pyx_n_s_alpha_m; PyObject *__pyx_n_s_alphas; PyObject *__pyx_n_s_amount; PyObject *__pyx_kp_u_and; PyObject *__pyx_n_s_app; PyObject *__pyx_n_s_appctx; PyObject *__pyx_n_s_append; PyObject *__pyx_n_s_apply; PyObject *__pyx_n_s_applySymmetricLeft; PyObject *__pyx_n_s_applySymmetricRight; PyObject *__pyx_n_s_applyTranspose; PyObject *__pyx_n_s_args; PyObject *__pyx_n_s_array; PyObject *__pyx_n_s_array_interface; PyObject *__pyx_kp_s_array_size_d_and_vector_local_si; PyObject *__pyx_kp_s_array_size_d_incompatible_with_v; PyObject *__pyx_n_s_array_w; PyObject *__pyx_n_s_asmtype; PyObject *__pyx_n_s_assemblies; PyObject *__pyx_n_s_assembly; PyObject *__pyx_n_s_assemblyBegin; PyObject *__pyx_n_s_assemblyEnd; PyObject *__pyx_n_s_asyncio_coroutines; PyObject *__pyx_n_s_atexit; PyObject *__pyx_n_s_atol; PyObject *__pyx_n_s_attr; PyObject *__pyx_n_s_au; PyObject *__pyx_n_s_author; PyObject *__pyx_n_s_authorinfo; PyObject *__pyx_n_s_aux; PyObject *__pyx_n_s_axpy; PyObject *__pyx_n_s_b; PyObject *__pyx_n_s_back; PyObject *__pyx_n_s_back_down; PyObject *__pyx_n_s_back_down_left; PyObject *__pyx_n_s_back_down_right; PyObject *__pyx_n_s_back_left; PyObject *__pyx_n_s_back_right; PyObject *__pyx_n_s_back_up; PyObject *__pyx_n_s_back_up_left; PyObject *__pyx_n_s_back_up_right; PyObject *__pyx_n_s_barrier; PyObject *__pyx_n_s_base; PyObject *__pyx_n_s_batchSize; PyObject *__pyx_n_s_bcComps; PyObject *__pyx_n_s_bcField; PyObject *__pyx_n_s_bcPoints; PyObject *__pyx_kp_s_bcPoints_is_a_required_argument; PyObject *__pyx_n_s_bdLabel; PyObject *__pyx_n_s_bdlabel; PyObject *__pyx_n_s_bdvalue; PyObject *__pyx_n_s_begin; PyObject *__pyx_n_s_begin_args; PyObject *__pyx_n_s_begin_kargs; PyObject *__pyx_n_s_beta; PyObject *__pyx_n_s_bits; PyObject *__pyx_n_s_blockSize; PyObject *__pyx_n_s_block_size; PyObject *__pyx_kp_s_block_size_d_must_be_positive; PyObject *__pyx_kp_s_block_size_not_set; PyObject *__pyx_n_s_blocksize; PyObject *__pyx_n_s_bndr; PyObject *__pyx_n_s_bool; PyObject *__pyx_n_s_boundary; PyObject *__pyx_n_s_boundary_type; PyObject *__pyx_n_s_boundary_types; PyObject *__pyx_n_s_box; PyObject *__pyx_n_s_bs; PyObject *__pyx_n_s_bsize; PyObject *__pyx_n_s_buffer; PyObject *__pyx_n_s_buffer_w; PyObject *__pyx_n_s_buildResidual; PyObject *__pyx_n_s_buildSolution; PyObject *__pyx_n_s_builtins; PyObject *__pyx_n_s_c; PyObject *__pyx_n_u_c; PyObject *__pyx_kp_s_c_d; PyObject *__pyx_n_s_cancelMonitor; PyObject *__pyx_kp_s_cannot_place_input_array_size_d; PyObject *__pyx_n_s_catol; PyObject *__pyx_n_s_ccomm; PyObject *__pyx_n_s_cdctx; PyObject *__pyx_n_s_cdevice_type; PyObject *__pyx_n_s_cell; PyObject *__pyx_n_s_cellNodeMaps; PyObject *__pyx_kp_s_cell_indices_must_have_two_dimen; PyObject *__pyx_n_s_cells; PyObject *__pyx_n_s_cg_type; PyObject *__pyx_n_s_cgid; PyObject *__pyx_n_s_citation; PyObject *__pyx_n_s_class; PyObject *__pyx_n_s_class_getitem; PyObject *__pyx_n_s_cline_in_traceback; PyObject *__pyx_n_s_cmap; PyObject *__pyx_n_s_cnorm; PyObject *__pyx_n_s_coarsen; PyObject *__pyx_n_s_coarsenhook; PyObject *__pyx_n_s_code; PyObject *__pyx_n_s_col; PyObject *__pyx_n_s_col_bsize; PyObject *__pyx_n_s_collections; PyObject *__pyx_kp_s_collections_abc; PyObject *__pyx_n_s_cols; PyObject *__pyx_n_s_column; PyObject *__pyx_kp_s_column_indices_must_have_two_dim; PyObject *__pyx_n_s_comm; PyObject *__pyx_n_s_comms; PyObject *__pyx_kp_s_communicator_not_owned; PyObject *__pyx_n_s_comp; PyObject *__pyx_n_s_compile; PyObject *__pyx_n_s_compressed; PyObject *__pyx_n_s_concatenate; PyObject *__pyx_n_s_cone; PyObject *__pyx_n_s_coneOrientation; PyObject *__pyx_n_s_conePoint; PyObject *__pyx_n_s_conePos; PyObject *__pyx_n_s_conforming; PyObject *__pyx_n_s_conjugate; PyObject *__pyx_n_s_constant; PyObject *__pyx_n_s_constraints; PyObject *__pyx_n_s_context; PyObject *__pyx_kp_s_contiguous_and_direct; PyObject *__pyx_kp_s_contiguous_and_indirect; PyObject *__pyx_n_s_continuous; PyObject *__pyx_n_s_converged; PyObject *__pyx_n_s_coordinates; PyObject *__pyx_kp_s_coordinates_must_have_two_dimens; PyObject *__pyx_kp_s_coordinates_size_must_be_at_leas; PyObject *__pyx_n_s_coords; PyObject *__pyx_kp_s_coords_vertices_must_have_two_di; PyObject *__pyx_n_s_copy; PyObject *__pyx_n_s_correction_type; PyObject *__pyx_n_s_count; PyObject *__pyx_n_s_cpuarray; PyObject *__pyx_n_s_crank; PyObject *__pyx_n_s_cratio; PyObject *__pyx_n_s_create; PyObject *__pyx_n_s_createDefaultSF; PyObject *__pyx_n_s_createGlobalVec; PyObject *__pyx_n_s_createGlobalVector; PyObject *__pyx_n_s_createLabel; PyObject *__pyx_n_s_createLocalVec; PyObject *__pyx_n_s_createLocalVector; PyObject *__pyx_n_s_createMat; PyObject *__pyx_n_s_createMatrix; PyObject *__pyx_n_s_createNaturalVec; PyObject *__pyx_n_s_createNaturalVector; PyObject *__pyx_n_s_createSectionSF; PyObject *__pyx_n_s_createSubMatrix; PyObject *__pyx_n_s_createVecLeft; PyObject *__pyx_n_s_createVecRight; PyObject *__pyx_n_s_createVecs; PyObject *__pyx_n_s_create_gvec; PyObject *__pyx_n_s_create_injection; PyObject *__pyx_n_s_create_interpolation; PyObject *__pyx_n_s_create_lvec; PyObject *__pyx_n_s_create_matrix; PyObject *__pyx_n_s_create_restriction; PyObject *__pyx_n_s_create_subdm; PyObject *__pyx_n_s_crtol; PyObject *__pyx_n_s_csize; PyObject *__pyx_n_s_csr; PyObject *__pyx_n_s_ctype; PyObject *__pyx_n_s_cudahandle; PyObject *__pyx_n_s_cycle_type; PyObject *__pyx_kp_s_d_s; PyObject *__pyx_n_s_da; PyObject *__pyx_n_s_data; PyObject *__pyx_n_s_date; PyObject *__pyx_n_s_dctx; PyObject *__pyx_n_s_debugger; PyObject *__pyx_n_s_decode; PyObject *__pyx_n_s_decomp; PyObject *__pyx_n_s_decorator; PyObject *__pyx_n_s_default; PyObject *__pyx_n_s_degree; PyObject *__pyx_n_s_delValue; PyObject *__pyx_n_s_dense; PyObject *__pyx_n_s_design; PyObject *__pyx_n_s_destroy; PyObject *__pyx_n_s_determinant; PyObject *__pyx_n_s_devel; PyObject *__pyx_n_s_device; PyObject *__pyx_n_s_device_id; PyObject *__pyx_n_s_device_type; PyObject *__pyx_n_s_diag; PyObject *__pyx_n_s_diagonalScale; PyObject *__pyx_n_s_diagonal_fill; PyObject *__pyx_n_s_dict; PyObject *__pyx_n_s_dim; PyObject *__pyx_n_s_dims; PyObject *__pyx_n_s_direction; PyObject *__pyx_kp_u_disable; PyObject *__pyx_n_s_disc; PyObject *__pyx_n_s_display; PyObject *__pyx_n_s_dist; PyObject *__pyx_n_s_div; PyObject *__pyx_n_s_divtol; PyObject *__pyx_n_s_dlpack; PyObject *__pyx_n_s_dltensor; PyObject *__pyx_n_s_dm; PyObject *__pyx_n_s_dmTo; PyObject *__pyx_n_s_dm_type; PyObject *__pyx_n_s_dmf; PyObject *__pyx_n_s_dms; PyObject *__pyx_n_s_dmswarm_type; PyObject *__pyx_n_s_dmtype; PyObject *__pyx_n_s_doc; PyObject *__pyx_n_s_dof; PyObject *__pyx_n_s_dofs; PyObject *__pyx_n_s_dosort; PyObject *__pyx_n_s_dot; PyObject *__pyx_n_s_down; PyObject *__pyx_n_s_down_left; PyObject *__pyx_n_s_down_right; PyObject *__pyx_n_s_drop; PyObject *__pyx_n_s_ds_type; PyObject *__pyx_n_s_dspace; PyObject *__pyx_n_s_dt; PyObject *__pyx_n_s_dtcol; PyObject *__pyx_n_s_dtcount; PyObject *__pyx_n_s_dtype; PyObject *__pyx_n_s_dtype_is_object; PyObject *__pyx_n_s_dualspace_type; PyObject *__pyx_n_s_duplicate; PyObject *__pyx_n_s_e; PyObject *__pyx_n_s_elem_type; PyObject *__pyx_n_s_element; PyObject *__pyx_n_s_emacs; PyObject *__pyx_kp_s_empty_citation; PyObject *__pyx_kp_s_empty_name; PyObject *__pyx_kp_u_enable; PyObject *__pyx_n_s_encode; PyObject *__pyx_n_s_end; PyObject *__pyx_n_s_end_args; PyObject *__pyx_n_s_end_kargs; PyObject *__pyx_n_s_enter; PyObject *__pyx_n_s_entityDepth; PyObject *__pyx_n_s_entry; PyObject *__pyx_n_s_enum2str; PyObject *__pyx_n_s_enumerate; PyObject *__pyx_n_s_epsilon; PyObject *__pyx_n_s_eqtype; PyObject *__pyx_n_s_equality_constraints; PyObject *__pyx_n_s_errhandler; PyObject *__pyx_n_s_error; PyObject *__pyx_kp_s_error_code_d; PyObject *__pyx_n_s_eta; PyObject *__pyx_n_s_evaluatestep; PyObject *__pyx_n_s_eventhandler; PyObject *__pyx_n_s_exec; PyObject *__pyx_n_s_exit; PyObject *__pyx_n_s_exoid; PyObject *__pyx_kp_s_expecting_a_C_contiguous_array; PyObject *__pyx_kp_s_expecting_tuple_list_or_dict; PyObject *__pyx_n_s_f; PyObject *__pyx_n_s_faces; PyObject *__pyx_n_s_fact; PyObject *__pyx_n_s_factor_mallocs; PyObject *__pyx_n_s_fe_type; PyObject *__pyx_n_s_fget; PyObject *__pyx_n_s_field; PyObject *__pyx_n_s_fieldName; PyObject *__pyx_n_s_fieldname; PyObject *__pyx_n_s_fieldnames; PyObject *__pyx_n_s_fields; PyObject *__pyx_n_s_file; PyObject *__pyx_n_s_filename; PyObject *__pyx_n_s_fill; PyObject *__pyx_n_s_fill_param; PyObject *__pyx_n_s_fill_ratio_given; PyObject *__pyx_n_s_fill_ratio_needed; PyObject *__pyx_n_s_finalize; PyObject *__pyx_n_s_first; PyObject *__pyx_n_s_fix; PyObject *__pyx_n_s_flag; PyObject *__pyx_n_s_flags; PyObject *__pyx_n_s_flg; PyObject *__pyx_n_s_flip; PyObject *__pyx_n_s_flops; PyObject *__pyx_n_s_flush; PyObject *__pyx_n_s_fnorm; PyObject *__pyx_n_s_force; PyObject *__pyx_n_s_formDegree; PyObject *__pyx_n_s_formSNESFunction; PyObject *__pyx_n_s_formSNESJacobian; PyObject *__pyx_n_s_format; PyObject *__pyx_n_s_fortran; PyObject *__pyx_n_u_fortran; PyObject *__pyx_n_s_forward; PyObject *__pyx_n_s_front; PyObject *__pyx_n_s_front_down; PyObject *__pyx_n_s_front_down_left; PyObject *__pyx_n_s_front_down_right; PyObject *__pyx_n_s_front_left; PyObject *__pyx_n_s_front_right; PyObject *__pyx_n_s_front_up; PyObject *__pyx_n_s_front_up_left; PyObject *__pyx_n_s_front_up_right; PyObject *__pyx_n_s_func; PyObject *__pyx_n_s_function; PyObject *__pyx_n_s_functional; PyObject *__pyx_n_s_functools; PyObject *__pyx_n_s_g; PyObject *__pyx_n_s_gamgtype; PyObject *__pyx_n_s_gamma; PyObject *__pyx_n_s_garbage_cleanup; PyObject *__pyx_n_s_garbage_view; PyObject *__pyx_n_s_gasmtype; PyObject *__pyx_n_s_gatol; PyObject *__pyx_kp_u_gc; PyObject *__pyx_n_s_get; PyObject *__pyx_kp_s_get1dCoordinatecArrays_for_DMSta; PyObject *__pyx_n_s_getActive; PyObject *__pyx_n_s_getActiveAll; PyObject *__pyx_n_s_getAppCtx; PyObject *__pyx_n_s_getApplicationContext; PyObject *__pyx_n_s_getArray; PyObject *__pyx_n_s_getBlockIndices; PyObject *__pyx_n_s_getBlockInfo; PyObject *__pyx_n_s_getBlockSize; PyObject *__pyx_n_s_getBlockSizes; PyObject *__pyx_n_s_getBoundaryType; PyObject *__pyx_n_s_getBoundaryTypes; PyObject *__pyx_n_s_getBuffer; PyObject *__pyx_n_s_getCPUTime; PyObject *__pyx_n_s_getClassId; PyObject *__pyx_n_s_getClassName; PyObject *__pyx_n_s_getComm; PyObject *__pyx_n_s_getConstraintTolerances; PyObject *__pyx_n_s_getConvergedReason; PyObject *__pyx_n_s_getConvergenceHistory; PyObject *__pyx_n_s_getCorners; PyObject *__pyx_n_s_getCurrent; PyObject *__pyx_n_s_getDM; PyObject *__pyx_n_s_getDS; PyObject *__pyx_n_s_getDefaultComm; PyObject *__pyx_n_s_getDefaultGlobalSection; PyObject *__pyx_n_s_getDefaultLocalSection; PyObject *__pyx_n_s_getDefaultSF; PyObject *__pyx_n_s_getDefaultSection; PyObject *__pyx_n_s_getDevice; PyObject *__pyx_n_s_getDeviceId; PyObject *__pyx_n_s_getDeviceType; PyObject *__pyx_n_s_getDiagonal; PyObject *__pyx_n_s_getDiagonalBlock; PyObject *__pyx_n_s_getDim; PyObject *__pyx_n_s_getDimension; PyObject *__pyx_n_s_getDof; PyObject *__pyx_n_s_getEntriesPerElement; PyObject *__pyx_n_s_getEquationType; PyObject *__pyx_n_s_getFlops; PyObject *__pyx_n_s_getFunctionNorm; PyObject *__pyx_n_s_getFunctionTolerances; PyObject *__pyx_n_s_getFunctionValue; PyObject *__pyx_n_s_getGhostCorners; PyObject *__pyx_n_s_getGhostRanges; PyObject *__pyx_n_s_getGlobalSection; PyObject *__pyx_n_s_getGlobalSizes; PyObject *__pyx_n_s_getGradient; PyObject *__pyx_n_s_getGradientTolerances; PyObject *__pyx_n_s_getIndices; PyObject *__pyx_n_s_getInfo; PyObject *__pyx_n_s_getInitialGuessKnoll; PyObject *__pyx_n_s_getInitialGuessNonzero; PyObject *__pyx_n_s_getInterval; PyObject *__pyx_n_s_getIterationNumber; PyObject *__pyx_n_s_getKSP; PyObject *__pyx_n_s_getKSPFailures; PyObject *__pyx_n_s_getLinearSolveFailures; PyObject *__pyx_n_s_getLocalSection; PyObject *__pyx_n_s_getLocalSize; PyObject *__pyx_n_s_getLocalSizes; PyObject *__pyx_n_s_getMatrix; PyObject *__pyx_n_s_getMaxFunctionEvaluations; PyObject *__pyx_n_s_getMaxKSPFailures; PyObject *__pyx_n_s_getMaxLinearSolveFailures; PyObject *__pyx_n_s_getMaxNonlinearStepFailures; PyObject *__pyx_n_s_getMaxStepFailures; PyObject *__pyx_n_s_getMaxSteps; PyObject *__pyx_n_s_getMaxTime; PyObject *__pyx_n_s_getNPC; PyObject *__pyx_n_s_getName; PyObject *__pyx_n_s_getNonlinearStepFailures; PyObject *__pyx_n_s_getNormType; PyObject *__pyx_n_s_getNumber; PyObject *__pyx_n_s_getNumberDM; PyObject *__pyx_n_s_getObjectiveValue; PyObject *__pyx_n_s_getOperators; PyObject *__pyx_n_s_getOptionsPrefix; PyObject *__pyx_n_s_getOwnershipRange; PyObject *__pyx_n_s_getOwnershipRanges; PyObject *__pyx_n_s_getPC; PyObject *__pyx_n_s_getPCSide; PyObject *__pyx_n_s_getProblemType; PyObject *__pyx_n_s_getProcSizes; PyObject *__pyx_n_s_getRanges; PyObject *__pyx_n_s_getRank; PyObject *__pyx_n_s_getRefCount; PyObject *__pyx_n_s_getResidualNorm; PyObject *__pyx_n_s_getRhs; PyObject *__pyx_n_s_getSNES; PyObject *__pyx_n_s_getSection; PyObject *__pyx_n_s_getSectionSF; PyObject *__pyx_n_s_getSeed; PyObject *__pyx_n_s_getSize; PyObject *__pyx_n_s_getSizes; PyObject *__pyx_n_s_getSolution; PyObject *__pyx_n_s_getSolutionNorm; PyObject *__pyx_n_s_getSolutionUpdate; PyObject *__pyx_n_s_getStencil; PyObject *__pyx_n_s_getStencilType; PyObject *__pyx_n_s_getStencilWidth; PyObject *__pyx_n_s_getStepFailures; PyObject *__pyx_n_s_getStepNumber; PyObject *__pyx_n_s_getStreamType; PyObject *__pyx_n_s_getString; PyObject *__pyx_n_s_getTime; PyObject *__pyx_n_s_getTimeStep; PyObject *__pyx_n_s_getTolerances; PyObject *__pyx_n_s_getType; PyObject *__pyx_n_s_getUseEW; PyObject *__pyx_n_s_getUseFD; PyObject *__pyx_n_s_getUseMF; PyObject *__pyx_n_s_getValue; PyObject *__pyx_kp_s_getVecArray_for_DMStag_not_yet_i; PyObject *__pyx_n_s_getVecLeft; PyObject *__pyx_n_s_getVecRight; PyObject *__pyx_n_s_getVecs; PyObject *__pyx_n_s_getVersion; PyObject *__pyx_n_s_getVersionInfo; PyObject *__pyx_n_s_getVisible; PyObject *__pyx_n_s_get_2; PyObject *__pyx_n_s_getstate; PyObject *__pyx_n_s_ghostBcNodes; PyObject *__pyx_n_s_ghosted; PyObject *__pyx_n_s_ghosts; PyObject *__pyx_kp_s_ghosts_size_d_array_size_d_and_v; PyObject *__pyx_n_s_globalBcNodes; PyObject *__pyx_kp_s_global_size_d_not_divisible_by_b; PyObject *__pyx_n_s_globalsec; PyObject *__pyx_n_s_gord; PyObject *__pyx_kp_u_got; PyObject *__pyx_kp_u_got_differing_extents_in_dimensi; PyObject *__pyx_n_s_gradient; PyObject *__pyx_n_s_group; PyObject *__pyx_n_s_grtol; PyObject *__pyx_n_s_gsec; PyObject *__pyx_n_s_gtol; PyObject *__pyx_n_s_gttol; PyObject *__pyx_n_s_gv; PyObject *__pyx_n_s_gvec; PyObject *__pyx_n_s_h_max; PyObject *__pyx_n_s_h_min; PyObject *__pyx_n_s_handle; PyObject *__pyx_n_s_has; PyObject *__pyx_n_s_hasExternalPackage; PyObject *__pyx_n_s_hasLabel; PyObject *__pyx_n_s_hasLagrange; PyObject *__pyx_n_s_hasName; PyObject *__pyx_n_s_hausd; PyObject *__pyx_n_s_hessian; PyObject *__pyx_n_s_hiphandle; PyObject *__pyx_n_s_hmax; PyObject *__pyx_n_s_hmin; PyObject *__pyx_n_s_hpddm_type; PyObject *__pyx_n_s_hypretype; PyObject *__pyx_n_s_i; PyObject *__pyx_n_s_icntl; PyObject *__pyx_n_s_id; PyObject *__pyx_n_s_idx; PyObject *__pyx_n_s_idxm; PyObject *__pyx_n_s_ierr; PyObject *__pyx_n_s_ignore; PyObject *__pyx_n_s_ignoreOutsideDomain; PyObject *__pyx_n_s_imag; PyObject *__pyx_n_s_imagPart; PyObject *__pyx_n_s_imex; PyObject *__pyx_n_s_imode; PyObject *__pyx_n_s_import; PyObject *__pyx_n_s_inblocks; PyObject *__pyx_kp_s_incompatible_array_sizes; PyObject *__pyx_kp_s_incompatible_array_sizes_ni_d_nj; PyObject *__pyx_kp_s_incompatible_array_sizes_ni_d_nv; PyObject *__pyx_kp_s_incompatible_array_sizes_ni_d_nv_2; PyObject *__pyx_kp_s_incompatible_array_sizes_nv_d; PyObject *__pyx_n_s_index; PyObject *__pyx_n_s_indicator; PyObject *__pyx_n_s_indices; PyObject *__pyx_n_s_info; PyObject *__pyx_n_s_infoAllow; PyObject *__pyx_n_s_init; PyObject *__pyx_n_s_init_subclass; PyObject *__pyx_n_s_initialguess; PyObject *__pyx_n_s_initialize; PyObject *__pyx_n_s_initializing; PyObject *__pyx_kp_s_input_arrays_have_incompatible_s; PyObject *__pyx_n_s_int; PyObject *__pyx_n_s_interior; PyObject *__pyx_n_s_interp_type; PyObject *__pyx_n_s_interpolate; PyObject *__pyx_n_s_interval; PyObject *__pyx_n_s_invert; PyObject *__pyx_n_s_is; PyObject *__pyx_n_s_isActive; PyObject *__pyx_n_s_isAssembled; PyObject *__pyx_n_s_isFinalized; PyObject *__pyx_n_s_isHermitian; PyObject *__pyx_n_s_isIdentity; PyObject *__pyx_n_s_isInitialized; PyObject *__pyx_n_s_isPermutation; PyObject *__pyx_n_s_isSimplex; PyObject *__pyx_n_s_isSorted; PyObject *__pyx_n_s_isStructurallySymmetric; PyObject *__pyx_n_s_isSymmetric; PyObject *__pyx_n_s_is_coroutine; PyObject *__pyx_n_s_is_from; PyObject *__pyx_n_s_is_local; PyObject *__pyx_n_s_is_to; PyObject *__pyx_n_s_is_type; PyObject *__pyx_n_s_iscol; PyObject *__pyx_n_s_iscols; PyObject *__pyx_kp_u_isenabled; PyObject *__pyx_n_s_iset; PyObject *__pyx_n_s_isets; PyObject *__pyx_n_s_isfields; PyObject *__pyx_n_s_isotropic; PyObject *__pyx_n_s_isperm; PyObject *__pyx_n_s_isrow; PyObject *__pyx_n_s_isrows; PyObject *__pyx_n_s_itemsize; PyObject *__pyx_kp_s_itemsize_0_for_cython_array; PyObject *__pyx_n_s_its; PyObject *__pyx_n_s_ival; PyObject *__pyx_n_s_j; PyObject *__pyx_n_s_jacobian; PyObject *__pyx_n_s_jacobian_design; PyObject *__pyx_n_s_jacobian_equality; PyObject *__pyx_n_s_jacobian_state; PyObject *__pyx_n_s_jacobianp; PyObject *__pyx_n_s_join; PyObject *__pyx_n_s_join_mode; PyObject *__pyx_n_s_k; PyObject *__pyx_n_s_kargs; PyObject *__pyx_kp_s_key_d_cannot_register_s_already; PyObject *__pyx_n_s_keys; PyObject *__pyx_n_s_kind; PyObject *__pyx_n_s_klass; PyObject *__pyx_n_s_ksp; PyObject *__pyx_n_s_ksp_type; PyObject *__pyx_n_s_kwargs; PyObject *__pyx_n_s_l; PyObject *__pyx_n_s_l2l; PyObject *__pyx_n_s_label; PyObject *__pyx_n_s_labelName; PyObject *__pyx_n_s_lambda; PyObject *__pyx_n_s_lanes; PyObject *__pyx_n_s_layoutType; PyObject *__pyx_n_s_lda; PyObject *__pyx_n_s_leafSection; PyObject *__pyx_n_s_leafdata; PyObject *__pyx_n_s_leafsize; PyObject *__pyx_n_s_leafupdate; PyObject *__pyx_n_s_left; PyObject *__pyx_n_s_length; PyObject *__pyx_n_s_level; PyObject *__pyx_n_s_levels; PyObject *__pyx_n_s_lgmap; PyObject *__pyx_n_s_lgmap_type; PyObject *__pyx_n_s_lgmapc; PyObject *__pyx_n_s_lgmapr; PyObject *__pyx_n_s_linear_its; PyObject *__pyx_n_s_lits; PyObject *__pyx_n_s_loc; PyObject *__pyx_n_s_locC; PyObject *__pyx_n_s_locX; PyObject *__pyx_n_s_local; PyObject *__pyx_kp_s_local_and_global_sizes_cannot_be; PyObject *__pyx_kp_s_local_size_d_not_divisible_by_bl; PyObject *__pyx_n_s_localsec; PyObject *__pyx_n_s_locs; PyObject *__pyx_n_s_logFlops; PyObject *__pyx_n_s_lower; PyObject *__pyx_n_s_ls_type; PyObject *__pyx_n_s_ltog; PyObject *__pyx_n_s_ltol; PyObject *__pyx_n_s_lv; PyObject *__pyx_n_s_lvec; PyObject *__pyx_n_s_lvecs; PyObject *__pyx_n_s_main; PyObject *__pyx_n_s_major; PyObject *__pyx_n_s_mallocs; PyObject *__pyx_n_s_mat; PyObject *__pyx_n_s_matApply; PyObject *__pyx_n_s_matMult; PyObject *__pyx_n_s_mat_type; PyObject *__pyx_n_s_matpartitioning_type; PyObject *__pyx_n_s_mats; PyObject *__pyx_n_s_max; PyObject *__pyx_n_s_maxDegree; PyObject *__pyx_n_s_max_fails; PyObject *__pyx_n_s_max_funcs; PyObject *__pyx_n_s_max_it; PyObject *__pyx_n_s_max_steps; PyObject *__pyx_n_s_max_time; PyObject *__pyx_n_s_maxrank; PyObject *__pyx_n_s_maxval; PyObject *__pyx_n_s_memo; PyObject *__pyx_n_s_memory; PyObject *__pyx_n_s_memview; PyObject *__pyx_n_s_messageLength; PyObject *__pyx_n_s_metaclass; PyObject *__pyx_n_s_metric; PyObject *__pyx_n_s_metric1; PyObject *__pyx_n_s_metric2; PyObject *__pyx_n_s_metric3; PyObject *__pyx_n_s_metricAvg; PyObject *__pyx_n_s_metricInt; PyObject *__pyx_n_s_mgtype; PyObject *__pyx_n_s_min; PyObject *__pyx_n_s_minor; PyObject *__pyx_n_s_mirror; PyObject *__pyx_n_s_missingDiagonal; PyObject *__pyx_n_s_mit; PyObject *__pyx_n_s_mode; PyObject *__pyx_n_s_model; PyObject *__pyx_n_s_module; PyObject *__pyx_n_s_monitor; PyObject *__pyx_n_s_monitorCancel; PyObject *__pyx_n_s_mpi4py; PyObject *__pyx_kp_s_mpi4py_MPI; PyObject *__pyx_n_s_mpiabort; PyObject *__pyx_n_s_mro_entries; PyObject *__pyx_n_s_msg; PyObject *__pyx_n_s_mult; PyObject *__pyx_n_s_multAdd; PyObject *__pyx_n_s_multDiagonalBlock; PyObject *__pyx_n_s_multHermitian; PyObject *__pyx_n_s_multHermitianAdd; PyObject *__pyx_n_s_multTranspose; PyObject *__pyx_n_s_multTransposeAdd; PyObject *__pyx_n_s_multirootdata; PyObject *__pyx_n_s_n; PyObject *__pyx_n_s_na; PyObject *__pyx_n_s_name; PyObject *__pyx_n_s_name_2; PyObject *__pyx_n_s_name_3; PyObject *__pyx_n_s_nbsteps; PyObject *__pyx_n_s_nc; PyObject *__pyx_n_s_ndim; PyObject *__pyx_n_s_new; PyObject *__pyx_n_s_newsec; PyObject *__pyx_n_s_newvec; PyObject *__pyx_n_s_ngs; PyObject *__pyx_n_s_nlevels; PyObject *__pyx_n_s_nlocal; PyObject *__pyx_n_s_nmax; PyObject *__pyx_n_s_nmin; PyObject *__pyx_n_s_nnz; PyObject *__pyx_n_s_noInsert; PyObject *__pyx_n_s_noMove; PyObject *__pyx_n_s_noSurf; PyObject *__pyx_n_s_noSwap; PyObject *__pyx_kp_s_no_default___reduce___due_to_non; PyObject *__pyx_n_s_none; PyObject *__pyx_n_s_nonzero; PyObject *__pyx_n_s_norm; PyObject *__pyx_n_s_norm_type; PyObject *__pyx_n_s_normsched; PyObject *__pyx_n_s_normtype; PyObject *__pyx_n_s_npoints; PyObject *__pyx_n_s_nroots; PyObject *__pyx_n_s_nsd; PyObject *__pyx_n_s_nsp; PyObject *__pyx_n_s_nsubcomm; PyObject *__pyx_n_s_null; PyObject *__pyx_kp_s_null_communicator; PyObject *__pyx_n_s_numBatches; PyObject *__pyx_n_s_numBlocks; PyObject *__pyx_n_s_numComp; PyObject *__pyx_n_s_numDof; PyObject *__pyx_n_s_numFields; PyObject *__pyx_n_s_numIter; PyObject *__pyx_n_s_numMessages; PyObject *__pyx_n_s_numProcs; PyObject *__pyx_n_s_numReductions; PyObject *__pyx_n_s_numSumSpaces; PyObject *__pyx_n_s_numTensSpaces; PyObject *__pyx_kp_s_number_of_dimensions_d_and_numbe; PyObject *__pyx_n_s_nz_allocated; PyObject *__pyx_n_s_nz_unneeded; PyObject *__pyx_n_s_nz_used; PyObject *__pyx_n_s_nzdiag; PyObject *__pyx_n_s_obj; PyObject *__pyx_n_s_object; PyObject *__pyx_n_s_objective; PyObject *__pyx_n_s_objgrad; PyObject *__pyx_n_s_offset; PyObject *__pyx_n_s_omega; PyObject *__pyx_n_s_ometric; PyObject *__pyx_kp_s_only_and; PyObject *__pyx_n_s_onnz; PyObject *__pyx_n_s_op; PyObject *__pyx_n_s_open; PyObject *__pyx_n_s_operator; PyObject *__pyx_n_s_operators; PyObject *__pyx_n_s_option; PyObject *__pyx_kp_s_option_prefix_must_be_string; PyObject *__pyx_kp_s_option_prefix_should_not_have_sp; PyObject *__pyx_kp_s_option_prefix_should_not_start_w; PyObject *__pyx_n_s_options; PyObject *__pyx_n_s_opts; PyObject *__pyx_n_s_ord_type; PyObject *__pyx_n_s_order; PyObject *__pyx_n_s_orientation; PyObject *__pyx_n_s_other; PyObject *__pyx_n_s_otype; PyObject *__pyx_n_s_out; PyObject *__pyx_n_s_output; PyObject *__pyx_n_s_overlap; PyObject *__pyx_kp_s_ownership_range_size_d_and_numbe; PyObject *__pyx_n_s_ownership_ranges; PyObject *__pyx_n_s_ozz; PyObject *__pyx_n_s_p; PyObject *__pyx_n_s_p1; PyObject *__pyx_n_s_pEnd; PyObject *__pyx_n_s_pStart; PyObject *__pyx_n_s_pack; PyObject *__pyx_n_s_package; PyObject *__pyx_n_s_package_2; PyObject *__pyx_n_s_parallel; PyObject *__pyx_n_s_parent; PyObject *__pyx_n_s_part; PyObject *__pyx_n_s_part_type; PyObject *__pyx_n_s_partitioning; PyObject *__pyx_n_s_pc; PyObject *__pyx_n_s_pc_type; PyObject *__pyx_n_s_pd; PyObject *__pyx_n_s_periodic; PyObject *__pyx_n_s_perm; PyObject *__pyx_n_s_permutation; PyObject *__pyx_n_s_petsc; PyObject *__pyx_n_s_petsc4py_PETSc; PyObject *__pyx_kp_s_petsc4py_PETSc_Device_pyx; PyObject *__pyx_kp_s_petsc4py_PETSc_Error_pyx; PyObject *__pyx_kp_s_petsc4py_PETSc_Log_pyx; PyObject *__pyx_kp_s_petsc4py_PETSc_PETSc_pyx; PyObject *__pyx_kp_s_petsc4py_PETSc_cyclicgc_pxi; PyObject *__pyx_n_s_pi; PyObject *__pyx_n_s_pickle; PyObject *__pyx_n_s_pj; PyObject *__pyx_n_s_plexname; PyObject *__pyx_n_s_point; PyObject *__pyx_n_s_points; PyObject *__pyx_n_s_pop; PyObject *__pyx_n_s_popErrorHandler; PyObject *__pyx_n_s_popSignalHandler; PyObject *__pyx_n_s_pop_python_vfprintf; PyObject *__pyx_n_s_position; PyObject *__pyx_n_s_positive_definite; PyObject *__pyx_n_s_postSolve; PyObject *__pyx_n_s_postStep; PyObject *__pyx_n_s_postevent; PyObject *__pyx_n_s_poststep; PyObject *__pyx_n_s_pre; PyObject *__pyx_n_s_preSolve; PyObject *__pyx_n_s_preStep; PyObject *__pyx_n_s_pre_finalize; PyObject *__pyx_n_s_precheck; PyObject *__pyx_n_s_prefix; PyObject *__pyx_kp_s_prefix_s_name_s; PyObject *__pyx_n_s_prepare; PyObject *__pyx_n_s_prestep; PyObject *__pyx_n_s_primv; PyObject *__pyx_n_s_proc_sizes; PyObject *__pyx_n_s_productNumeric; PyObject *__pyx_n_s_productSetFromOptions; PyObject *__pyx_n_s_productSymbolic; PyObject *__pyx_n_s_property; PyObject *__pyx_n_s_ptap; PyObject *__pyx_n_s_ptype; PyObject *__pyx_n_s_push; PyObject *__pyx_n_s_pushErrorHandler; PyObject *__pyx_n_s_push_python_vfprintf; PyObject *__pyx_n_s_py_sub_ctxs; PyObject *__pyx_n_s_py_type; PyObject *__pyx_n_s_python; PyObject *__pyx_n_s_pyx_PickleError; PyObject *__pyx_n_s_pyx_checksum; PyObject *__pyx_n_s_pyx_result; PyObject *__pyx_n_s_pyx_state; PyObject *__pyx_n_s_pyx_type; PyObject *__pyx_n_s_pyx_unpickle_Enum; PyObject *__pyx_n_s_pyx_vtable; PyObject *__pyx_n_s_q0; PyObject *__pyx_n_s_q1; PyObject *__pyx_n_s_qorder; PyObject *__pyx_n_s_quad; PyObject *__pyx_n_s_qualname; PyObject *__pyx_n_s_r; PyObject *__pyx_kp_s_r_2; PyObject *__pyx_n_s_radius; PyObject *__pyx_n_s_random; PyObject *__pyx_n_s_range; PyObject *__pyx_n_s_ranges; PyObject *__pyx_n_s_rank; PyObject *__pyx_n_s_read; PyObject *__pyx_n_s_readonly; PyObject *__pyx_kp_s_readonly_attribute; PyObject *__pyx_n_s_ready; PyObject *__pyx_n_s_real; PyObject *__pyx_n_s_realPart; PyObject *__pyx_n_s_reason; PyObject *__pyx_n_s_reciprocal; PyObject *__pyx_n_s_red; PyObject *__pyx_n_s_reduce; PyObject *__pyx_n_s_reduce_cython; PyObject *__pyx_n_s_reduce_ex; PyObject *__pyx_n_s_redundant; PyObject *__pyx_n_s_redundantPoints; PyObject *__pyx_n_s_refine; PyObject *__pyx_n_s_refine_x; PyObject *__pyx_n_s_refine_y; PyObject *__pyx_n_s_refine_z; PyObject *__pyx_n_s_refinementLimit; PyObject *__pyx_n_s_refinementUniform; PyObject *__pyx_n_s_register; PyObject *__pyx_n_s_registerCitation; PyObject *__pyx_n_s_release; PyObject *__pyx_n_s_remote; PyObject *__pyx_n_s_remoteOffsets; PyObject *__pyx_n_s_remove; PyObject *__pyx_n_s_remove_sent_points; PyObject *__pyx_n_s_replace; PyObject *__pyx_n_s_repr; PyObject *__pyx_n_s_res; PyObject *__pyx_n_s_reset; PyObject *__pyx_n_s_reshape; PyObject *__pyx_n_s_residual; PyObject *__pyx_n_s_restart; PyObject *__pyx_n_s_restrictAnisotropy; PyObject *__pyx_n_s_restrictAnisotropyFirst; PyObject *__pyx_n_s_restrictSizes; PyObject *__pyx_n_s_restricthook; PyObject *__pyx_n_s_result; PyObject *__pyx_n_s_reuse; PyObject *__pyx_n_s_reverse; PyObject *__pyx_n_s_rgLabel; PyObject *__pyx_n_s_rhs; PyObject *__pyx_n_s_rhsjacobianp; PyObject *__pyx_n_s_right; PyObject *__pyx_n_s_rmap; PyObject *__pyx_n_s_rnd_type; PyObject *__pyx_n_s_rnorm; PyObject *__pyx_n_s_rollback; PyObject *__pyx_n_s_rootSection; PyObject *__pyx_n_s_rootdata; PyObject *__pyx_n_s_row; PyObject *__pyx_n_s_row_bsize; PyObject *__pyx_kp_s_row_indices_must_have_two_dimens; PyObject *__pyx_n_s_rowmap; PyObject *__pyx_n_s_rows; PyObject *__pyx_n_s_rscale; PyObject *__pyx_n_s_rsplit; PyObject *__pyx_n_s_rtol; PyObject *__pyx_n_s_rtol_0; PyObject *__pyx_n_s_rtol_max; PyObject *__pyx_n_s_rw; PyObject *__pyx_kp_s_s; PyObject *__pyx_n_s_s_2; PyObject *__pyx_kp_s_s_at_s_d; PyObject *__pyx_kp_s_s_s; PyObject *__pyx_n_s_scale; PyObject *__pyx_n_s_scatter; PyObject *__pyx_n_s_scatterBegin; PyObject *__pyx_n_s_scatterEnd; PyObject *__pyx_n_s_scatter_type; PyObject *__pyx_n_s_sec; PyObject *__pyx_n_s_seconds; PyObject *__pyx_n_s_sectiondm; PyObject *__pyx_n_s_seed; PyObject *__pyx_n_s_selected; PyObject *__pyx_n_s_self; PyObject *__pyx_n_s_sep; PyObject *__pyx_n_s_setActive; PyObject *__pyx_n_s_setActiveAll; PyObject *__pyx_n_s_setAppCtx; PyObject *__pyx_n_s_setApplicationContext; PyObject *__pyx_n_s_setConvergedReason; PyObject *__pyx_n_s_setCurrent; PyObject *__pyx_n_s_setDM; PyObject *__pyx_n_s_setDS; PyObject *__pyx_n_s_setDefaultComm; PyObject *__pyx_n_s_setDefaultGlobalSection; PyObject *__pyx_n_s_setDefaultLocalSection; PyObject *__pyx_n_s_setDefaultSF; PyObject *__pyx_n_s_setDefaultSection; PyObject *__pyx_n_s_setDefaultType; PyObject *__pyx_n_s_setDevice; PyObject *__pyx_n_s_setDiagonal; PyObject *__pyx_n_s_setDimension; PyObject *__pyx_n_s_setEquationType; PyObject *__pyx_n_s_setFromOptions; PyObject *__pyx_n_s_setFunctionNorm; PyObject *__pyx_n_s_setFunctionTolerances; PyObject *__pyx_n_s_setGlobalSection; PyObject *__pyx_n_s_setInitial; PyObject *__pyx_n_s_setInitialGuessKnoll; PyObject *__pyx_n_s_setInitialGuessNonzero; PyObject *__pyx_n_s_setInterval; PyObject *__pyx_n_s_setIterationNumber; PyObject *__pyx_n_s_setKSP; PyObject *__pyx_n_s_setLocalSection; PyObject *__pyx_n_s_setMaxFunctionEvaluations; PyObject *__pyx_n_s_setMaxKSPFailures; PyObject *__pyx_n_s_setMaxLinearSolveFailures; PyObject *__pyx_n_s_setMaxNonlinearStepFailures; PyObject *__pyx_n_s_setMaxStepFailures; PyObject *__pyx_n_s_setMaxSteps; PyObject *__pyx_n_s_setMaxTime; PyObject *__pyx_n_s_setMonitor; PyObject *__pyx_n_s_setNPC; PyObject *__pyx_n_s_setName; PyObject *__pyx_n_s_setNormType; PyObject *__pyx_n_s_setOption; PyObject *__pyx_n_s_setOptionsPrefix; PyObject *__pyx_n_s_setPCSide; PyObject *__pyx_n_s_setParamsEW; PyObject *__pyx_n_s_setProblemType; PyObject *__pyx_n_s_setResidualNorm; PyObject *__pyx_n_s_setSection; PyObject *__pyx_n_s_setSectionSF; PyObject *__pyx_n_s_setSeed; PyObject *__pyx_n_s_setSizes; PyObject *__pyx_n_s_setSolution; PyObject *__pyx_n_s_setStepNumber; PyObject *__pyx_n_s_setStreamType; PyObject *__pyx_n_s_setTime; PyObject *__pyx_n_s_setTimeStep; PyObject *__pyx_n_s_setTolerances; PyObject *__pyx_n_s_setType; PyObject *__pyx_n_s_setUp; PyObject *__pyx_n_s_setUseEW; PyObject *__pyx_n_s_setUseFD; PyObject *__pyx_n_s_setUseMF; PyObject *__pyx_n_s_setValue; PyObject *__pyx_n_s_setVisible; PyObject *__pyx_n_s_set_name; PyObject *__pyx_n_s_setstate; PyObject *__pyx_n_s_setstate_cython; PyObject *__pyx_n_s_setup; PyObject *__pyx_n_s_sf; PyObject *__pyx_n_s_sf_type; PyObject *__pyx_n_s_sfxc; PyObject *__pyx_n_s_shape; PyObject *__pyx_n_s_shift; PyObject *__pyx_n_s_shift_type; PyObject *__pyx_n_s_shiftamount; PyObject *__pyx_n_s_shifttype; PyObject *__pyx_n_s_side; PyObject *__pyx_kp_s_side_r_not_understood; PyObject *__pyx_n_s_simplex; PyObject *__pyx_n_s_size; PyObject *__pyx_kp_s_size_I_is_d_expected_d; PyObject *__pyx_kp_s_size_J_is_d_expected_d; PyObject *__pyx_kp_s_size_V_is_d_expected_d; PyObject *__pyx_kp_s_size_array_is_d_expected_dx_d_d; PyObject *__pyx_kp_s_size_d_nnz_is_d_expected_d; PyObject *__pyx_kp_s_size_o_nnz_is_d_expected_d; PyObject *__pyx_n_s_sizes; PyObject *__pyx_kp_s_sizes_array_should_have_d_entrie; PyObject *__pyx_n_s_skip; PyObject *__pyx_n_s_sleep; PyObject *__pyx_n_s_smooths; PyObject *__pyx_n_s_snes; PyObject *__pyx_n_s_snes_type; PyObject *__pyx_n_s_solve; PyObject *__pyx_n_s_solveAdd; PyObject *__pyx_n_s_solveStep; PyObject *__pyx_n_s_solveTranspose; PyObject *__pyx_n_s_solveTransposeAdd; PyObject *__pyx_n_s_solver; PyObject *__pyx_n_s_sortype; PyObject *__pyx_n_s_sp; PyObject *__pyx_n_s_space_type; PyObject *__pyx_n_s_spec; PyObject *__pyx_n_s_split; PyObject *__pyx_n_s_splitOwnership; PyObject *__pyx_n_s_stage; PyObject *__pyx_n_s_star; PyObject *__pyx_n_s_start; PyObject *__pyx_n_s_starts; PyObject *__pyx_n_s_startswith; PyObject *__pyx_n_s_state; PyObject *__pyx_n_s_staticmethod; PyObject *__pyx_n_s_staticproperty; PyObject *__pyx_n_s_staticproperty___get; PyObject *__pyx_n_s_stderr; PyObject *__pyx_n_s_stderr_2; PyObject *__pyx_n_s_stdout; PyObject *__pyx_n_s_stdout_2; PyObject *__pyx_n_s_stdout_is_stderr; PyObject *__pyx_n_s_stencil_type; PyObject *__pyx_n_s_stencil_width; PyObject *__pyx_n_s_stenciltype; PyObject *__pyx_n_s_step; PyObject *__pyx_n_s_stepTranspose; PyObject *__pyx_n_s_step_number; PyObject *__pyx_n_s_stol; PyObject *__pyx_n_s_stop; PyObject *__pyx_n_s_str; PyObject *__pyx_n_s_strata; PyObject *__pyx_n_s_stratum; PyObject *__pyx_n_s_stream; PyObject *__pyx_n_s_stream_type; PyObject *__pyx_kp_s_strided_and_direct; PyObject *__pyx_kp_s_strided_and_direct_or_indirect; PyObject *__pyx_kp_s_strided_and_indirect; PyObject *__pyx_n_s_strides; PyObject *__pyx_n_s_string; PyObject *__pyx_kp_s_stringsource; PyObject *__pyx_n_s_strip; PyObject *__pyx_n_s_struct; PyObject *__pyx_n_s_structure; PyObject *__pyx_n_s_sub; PyObject *__pyx_n_s_subcomm; PyObject *__pyx_n_s_subdm; PyObject *__pyx_n_s_submat; PyObject *__pyx_n_s_submats; PyObject *__pyx_n_s_subminor; PyObject *__pyx_n_s_subsp; PyObject *__pyx_n_s_subspaceOffsets; PyObject *__pyx_n_s_subvec; PyObject *__pyx_n_s_super; PyObject *__pyx_n_s_supp; PyObject *__pyx_n_s_svalue; PyObject *__pyx_n_s_swidth; PyObject *__pyx_n_s_sx; PyObject *__pyx_n_s_sym; PyObject *__pyx_n_s_symmetric; PyObject *__pyx_n_s_syncFlush; PyObject *__pyx_n_s_syncPrint; PyObject *__pyx_n_s_sys; PyObject *__pyx_n_s_t; PyObject *__pyx_n_s_tab; PyObject *__pyx_n_s_tabs; PyObject *__pyx_n_s_tao; PyObject *__pyx_n_s_tao_type; PyObject *__pyx_n_s_targetComplexity; PyObject *__pyx_n_s_tbline; PyObject *__pyx_n_s_tblist; PyObject *__pyx_n_s_tensor; PyObject *__pyx_n_s_terminate; PyObject *__pyx_n_s_theta; PyObject *__pyx_n_s_threshold; PyObject *__pyx_n_s_time; PyObject *__pyx_n_s_time_step; PyObject *__pyx_n_s_timestep; PyObject *__pyx_n_s_title; PyObject *__pyx_n_s_toAll; PyObject *__pyx_n_s_toDLPack; PyObject *__pyx_n_s_toZero; PyObject *__pyx_n_s_toindx; PyObject *__pyx_n_s_tol; PyObject *__pyx_n_s_tr_type; PyObject *__pyx_n_s_traceback; PyObject *__pyx_n_s_traceback_2; PyObject *__pyx_n_s_trans; PyObject *__pyx_n_s_transpose; PyObject *__pyx_n_s_trimmed; PyObject *__pyx_n_s_ts_type; PyObject *__pyx_n_s_tspan; PyObject *__pyx_n_s_twist; PyObject *__pyx_n_s_typ; PyObject *__pyx_n_s_type_registry; PyObject *__pyx_n_s_typestr; PyObject *__pyx_n_s_u; PyObject *__pyx_n_s_ua; PyObject *__pyx_n_s_uaux; PyObject *__pyx_n_s_uis; PyObject *__pyx_kp_s_unable_to_allocate_array_data; PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str; PyObject *__pyx_kp_s_unhandled_PetscDeviceContextJoin; PyObject *__pyx_kp_s_unhandled_PetscDeviceType_d; PyObject *__pyx_kp_s_unhandled_PetscStreamType_d; PyObject *__pyx_n_s_uniform; PyObject *__pyx_n_s_unit; PyObject *__pyx_kp_s_unknown_boundary_type_s; PyObject *__pyx_kp_s_unknown_device_type_s; PyObject *__pyx_kp_s_unknown_element_type_s; PyObject *__pyx_kp_u_unknown_error_handler; PyObject *__pyx_kp_s_unknown_interpolation_type_s; PyObject *__pyx_kp_s_unknown_join_mode_s; PyObject *__pyx_kp_s_unknown_options_s; PyObject *__pyx_kp_s_unknown_scatter_mode_s; PyObject *__pyx_kp_s_unknown_shift_type_s; PyObject *__pyx_kp_s_unknown_stencil_location_type_s; PyObject *__pyx_kp_s_unknown_stencil_type_s; PyObject *__pyx_kp_s_unknown_stream_type_s; PyObject *__pyx_n_s_unnamed; PyObject *__pyx_n_s_unpack; PyObject *__pyx_n_s_up; PyObject *__pyx_n_s_up_left; PyObject *__pyx_n_s_up_right; PyObject *__pyx_n_s_update; PyObject *__pyx_n_s_upper; PyObject *__pyx_n_s_useAnchors; PyObject *__pyx_n_s_useClosure; PyObject *__pyx_n_s_useCone; PyObject *__pyx_n_s_useInitialGuess; PyObject *__pyx_n_s_v; PyObject *__pyx_n_s_val; PyObject *__pyx_n_s_value; PyObject *__pyx_n_s_values; PyObject *__pyx_kp_s_values_must_have_two_or_more_dim; PyObject *__pyx_n_s_varbounds; PyObject *__pyx_n_s_vec; PyObject *__pyx_n_s_vecTo; PyObject *__pyx_n_s_vec_from; PyObject *__pyx_n_s_vec_to; PyObject *__pyx_n_s_vec_type; PyObject *__pyx_n_s_vecs; PyObject *__pyx_n_s_vectors; PyObject *__pyx_n_s_verbosity; PyObject *__pyx_n_s_version; PyObject *__pyx_n_s_version_info; PyObject *__pyx_n_s_vg; PyObject *__pyx_n_s_viennaclvechandle; PyObject *__pyx_n_s_view; PyObject *__pyx_n_s_viewer; PyObject *__pyx_n_s_vl; PyObject *__pyx_n_s_vlg; PyObject *__pyx_n_s_vm; PyObject *__pyx_n_s_vn; PyObject *__pyx_n_s_vtol; PyObject *__pyx_n_s_vwr_type; PyObject *__pyx_n_s_w; PyObject *__pyx_kp_s_w_2; PyObject *__pyx_n_s_weight; PyObject *__pyx_n_s_width; PyObject *__pyx_n_s_wrapped_func; PyObject *__pyx_n_s_wraps; PyObject *__pyx_n_s_write; PyObject *__pyx_n_s_x; PyObject *__pyx_n_s_xdot; PyObject *__pyx_n_s_xdotdot; PyObject *__pyx_n_s_xl; PyObject *__pyx_n_s_xmax; PyObject *__pyx_n_s_xmin; PyObject *__pyx_n_s_xnorm; PyObject *__pyx_n_s_xu; PyObject *__pyx_n_s_y; PyObject *__pyx_n_s_ymax; PyObject *__pyx_n_s_ymin; PyObject *__pyx_n_s_ynorm; PyObject *__pyx_n_s_zeroEntries; PyObject *__pyx_n_s_zeroRowsColumns; PyObject *__pyx_n_s_zeropivot; PyObject *__pyx_n_s_zmax; PyObject *__pyx_n_s_zmin; PyObject *__pyx_n_s_zoz; PyObject *__pyx_n_s_zzo; PyObject *__pyx_float_0_; PyObject *__pyx_float_0_0; PyObject *__pyx_float_1_0; PyObject *__pyx_int_0; PyObject *__pyx_int_1; PyObject *__pyx_int_2; PyObject *__pyx_int_3; PyObject *__pyx_int_4; PyObject *__pyx_int_5; PyObject *__pyx_int_6; PyObject *__pyx_int_7; PyObject *__pyx_int_8; PyObject *__pyx_int_9; PyObject *__pyx_int_10; PyObject *__pyx_int_13; PyObject *__pyx_int_17; PyObject *__pyx_int_18; PyObject *__pyx_int_19; PyObject *__pyx_int_23; PyObject *__pyx_int_32; PyObject *__pyx_int_34; PyObject *__pyx_int_43; PyObject *__pyx_int_45; PyObject *__pyx_int_46; PyObject *__pyx_int_47; PyObject *__pyx_int_48; PyObject *__pyx_int_59; PyObject *__pyx_int_88; PyObject *__pyx_int_102; PyObject *__pyx_int_105; PyObject *__pyx_int_106; PyObject *__pyx_int_113; PyObject *__pyx_int_119; PyObject *__pyx_int_121; PyObject *__pyx_int_122; PyObject *__pyx_int_112105877; PyObject *__pyx_int_136983863; PyObject *__pyx_int_184977713; PyObject *__pyx_int_neg_1; PyObject *__pyx_k__41; PyObject *__pyx_k__49; PyObject *__pyx_k__50; PyObject *__pyx_k__63; PyObject *__pyx_slice__5; PyObject *__pyx_tuple__4; PyObject *__pyx_tuple__8; PyObject *__pyx_slice__20; PyObject *__pyx_slice__58; PyObject *__pyx_slice__59; PyObject *__pyx_tuple__15; PyObject *__pyx_tuple__17; PyObject *__pyx_tuple__19; PyObject *__pyx_tuple__21; PyObject *__pyx_tuple__22; PyObject *__pyx_tuple__23; PyObject *__pyx_tuple__24; PyObject *__pyx_tuple__25; PyObject *__pyx_tuple__27; PyObject *__pyx_tuple__28; PyObject *__pyx_tuple__29; PyObject *__pyx_tuple__30; PyObject *__pyx_tuple__31; PyObject *__pyx_tuple__32; PyObject *__pyx_tuple__33; PyObject *__pyx_tuple__35; PyObject *__pyx_tuple__37; PyObject *__pyx_tuple__38; PyObject *__pyx_tuple__39; PyObject *__pyx_tuple__40; PyObject *__pyx_tuple__42; PyObject *__pyx_tuple__43; PyObject *__pyx_tuple__44; PyObject *__pyx_tuple__45; PyObject *__pyx_tuple__46; PyObject *__pyx_tuple__47; PyObject *__pyx_tuple__48; PyObject *__pyx_tuple__51; PyObject *__pyx_tuple__52; PyObject *__pyx_tuple__53; PyObject *__pyx_tuple__54; PyObject *__pyx_tuple__55; PyObject *__pyx_tuple__56; PyObject *__pyx_tuple__57; PyObject *__pyx_tuple__60; PyObject *__pyx_tuple__61; PyObject *__pyx_tuple__62; PyObject *__pyx_tuple__64; PyObject *__pyx_tuple__65; PyObject *__pyx_tuple__66; PyObject *__pyx_tuple__67; PyObject *__pyx_tuple__68; PyObject *__pyx_tuple__69; PyObject *__pyx_tuple__70; PyObject *__pyx_tuple__71; PyObject *__pyx_tuple__72; PyObject *__pyx_tuple__73; PyObject *__pyx_tuple__74; PyObject *__pyx_tuple__75; PyObject *__pyx_tuple__76; PyObject *__pyx_tuple__78; PyObject *__pyx_tuple__79; PyObject *__pyx_tuple__80; PyObject *__pyx_tuple__81; PyObject *__pyx_tuple__82; PyObject *__pyx_tuple__83; PyObject *__pyx_tuple__84; PyObject *__pyx_tuple__85; PyObject *__pyx_tuple__86; PyObject *__pyx_tuple__89; PyObject *__pyx_tuple__91; PyObject *__pyx_tuple__93; PyObject *__pyx_tuple__96; PyObject *__pyx_tuple__97; PyObject *__pyx_tuple__98; PyObject *__pyx_tuple__99; PyObject *__pyx_tuple__100; PyObject *__pyx_tuple__101; PyObject *__pyx_tuple__102; PyObject *__pyx_tuple__103; PyObject *__pyx_tuple__104; PyObject *__pyx_tuple__105; PyObject *__pyx_tuple__106; PyObject *__pyx_tuple__107; PyObject *__pyx_tuple__108; PyObject *__pyx_tuple__110; PyObject *__pyx_tuple__112; PyObject *__pyx_tuple__114; PyObject *__pyx_tuple__116; PyObject *__pyx_tuple__117; PyObject *__pyx_tuple__118; PyObject *__pyx_tuple__119; PyObject *__pyx_tuple__120; PyObject *__pyx_tuple__121; PyObject *__pyx_tuple__122; PyObject *__pyx_tuple__123; PyObject *__pyx_tuple__124; PyObject *__pyx_tuple__125; PyObject *__pyx_tuple__126; PyObject *__pyx_tuple__127; PyObject *__pyx_tuple__128; PyObject *__pyx_tuple__129; PyObject *__pyx_tuple__130; PyObject *__pyx_tuple__131; PyObject *__pyx_tuple__132; PyObject *__pyx_tuple__133; PyObject *__pyx_tuple__134; PyObject *__pyx_tuple__135; PyObject *__pyx_tuple__136; PyObject *__pyx_tuple__137; PyObject *__pyx_tuple__138; PyObject *__pyx_tuple__139; PyObject *__pyx_tuple__140; PyObject *__pyx_tuple__141; PyObject *__pyx_tuple__142; PyObject *__pyx_tuple__143; PyObject *__pyx_tuple__144; PyObject *__pyx_tuple__145; PyObject *__pyx_tuple__146; PyObject *__pyx_tuple__147; PyObject *__pyx_tuple__148; PyObject *__pyx_tuple__149; PyObject *__pyx_tuple__150; PyObject *__pyx_tuple__151; PyObject *__pyx_tuple__152; PyObject *__pyx_tuple__153; PyObject *__pyx_tuple__154; PyObject *__pyx_tuple__155; PyObject *__pyx_tuple__156; PyObject *__pyx_tuple__157; PyObject *__pyx_tuple__158; PyObject *__pyx_tuple__159; PyObject *__pyx_tuple__160; PyObject *__pyx_tuple__161; PyObject *__pyx_tuple__162; PyObject *__pyx_tuple__163; PyObject *__pyx_tuple__164; PyObject *__pyx_tuple__165; PyObject *__pyx_tuple__166; PyObject *__pyx_tuple__167; PyObject *__pyx_tuple__168; PyObject *__pyx_tuple__169; PyObject *__pyx_tuple__170; PyObject *__pyx_tuple__171; PyObject *__pyx_tuple__172; PyObject *__pyx_tuple__173; PyObject *__pyx_tuple__174; PyObject *__pyx_tuple__175; PyObject *__pyx_tuple__176; PyObject *__pyx_tuple__177; PyObject *__pyx_tuple__178; PyObject *__pyx_tuple__179; PyObject *__pyx_tuple__180; PyObject *__pyx_tuple__181; PyObject *__pyx_tuple__182; PyObject *__pyx_tuple__183; PyObject *__pyx_tuple__184; PyObject *__pyx_tuple__185; PyObject *__pyx_tuple__186; PyObject *__pyx_tuple__187; PyObject *__pyx_tuple__188; PyObject *__pyx_tuple__189; PyObject *__pyx_tuple__190; PyObject *__pyx_tuple__191; PyObject *__pyx_tuple__192; PyObject *__pyx_tuple__193; PyObject *__pyx_tuple__194; PyObject *__pyx_tuple__195; PyObject *__pyx_tuple__196; PyObject *__pyx_tuple__197; PyObject *__pyx_tuple__198; PyObject *__pyx_tuple__199; PyObject *__pyx_tuple__200; PyObject *__pyx_tuple__201; PyObject *__pyx_tuple__202; PyObject *__pyx_tuple__203; PyObject *__pyx_tuple__204; PyObject *__pyx_tuple__205; PyObject *__pyx_tuple__206; PyObject *__pyx_tuple__207; PyObject *__pyx_tuple__208; PyObject *__pyx_tuple__209; PyObject *__pyx_tuple__210; PyObject *__pyx_tuple__211; PyObject *__pyx_tuple__212; PyObject *__pyx_tuple__213; PyObject *__pyx_tuple__214; PyObject *__pyx_tuple__215; PyObject *__pyx_tuple__216; PyObject *__pyx_tuple__217; PyObject *__pyx_tuple__218; PyObject *__pyx_tuple__219; PyObject *__pyx_tuple__220; PyObject *__pyx_tuple__221; PyObject *__pyx_tuple__222; PyObject *__pyx_tuple__223; PyObject *__pyx_tuple__224; PyObject *__pyx_tuple__225; PyObject *__pyx_tuple__226; PyObject *__pyx_tuple__227; PyObject *__pyx_tuple__228; PyObject *__pyx_tuple__229; PyObject *__pyx_tuple__230; PyObject *__pyx_tuple__231; PyObject *__pyx_tuple__232; PyObject *__pyx_tuple__233; PyObject *__pyx_tuple__234; PyObject *__pyx_tuple__235; PyObject *__pyx_tuple__236; PyObject *__pyx_tuple__237; PyObject *__pyx_tuple__238; PyObject *__pyx_tuple__239; PyObject *__pyx_tuple__240; PyObject *__pyx_tuple__241; PyObject *__pyx_tuple__242; PyObject *__pyx_tuple__243; PyObject *__pyx_tuple__244; PyObject *__pyx_tuple__245; PyObject *__pyx_tuple__246; PyObject *__pyx_tuple__247; PyObject *__pyx_tuple__248; PyObject *__pyx_tuple__249; PyObject *__pyx_tuple__250; PyObject *__pyx_codeobj__34; PyObject *__pyx_codeobj__36; PyObject *__pyx_codeobj__77; PyObject *__pyx_codeobj__87; PyObject *__pyx_codeobj__88; PyObject *__pyx_codeobj__90; PyObject *__pyx_codeobj__92; PyObject *__pyx_codeobj__94; PyObject *__pyx_codeobj__95; PyObject *__pyx_codeobj__109; PyObject *__pyx_codeobj__111; PyObject *__pyx_codeobj__113; PyObject *__pyx_codeobj__115; PyObject *__pyx_codeobj__251; PyObject *__pyx_codeobj__252; PyObject *__pyx_codeobj__253; PyObject *__pyx_codeobj__254; PyObject *__pyx_codeobj__255; PyObject *__pyx_codeobj__256; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) #define __pyx_m (PyState_FindModule(&__pyx_moduledef)) #else static __pyx_mstate __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; #endif /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_clear(PyObject *m) { __pyx_mstate *clear_module_state = __pyx_mstate(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); Py_CLEAR(clear_module_state->__pyx_cython_runtime); Py_CLEAR(clear_module_state->__pyx_empty_tuple); Py_CLEAR(clear_module_state->__pyx_empty_bytes); Py_CLEAR(clear_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_CLEAR(clear_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif Py_CLEAR(clear_module_state->__pyx_ptype_8petsc4py_5PETSc_Comm); Py_CLEAR(clear_module_state->PyPetscComm_Type); Py_CLEAR(clear_module_state->__pyx_ptype_8petsc4py_5PETSc_Object); Py_CLEAR(clear_module_state->PyPetscObject_Type); Py_CLEAR(clear_module_state->__pyx_ptype_8petsc4py_5PETSc_Viewer); Py_CLEAR(clear_module_state->PyPetscViewer_Type); Py_CLEAR(clear_module_state->__pyx_ptype_8petsc4py_5PETSc_Random); Py_CLEAR(clear_module_state->PyPetscRandom_Type); Py_CLEAR(clear_module_state->__pyx_ptype_8petsc4py_5PETSc_Device); Py_CLEAR(clear_module_state->PyPetscDevice_Type); Py_CLEAR(clear_module_state->__pyx_ptype_8petsc4py_5PETSc_DeviceContext); Py_CLEAR(clear_module_state->PyPetscDeviceContext_Type); Py_CLEAR(clear_module_state->__pyx_ptype_8petsc4py_5PETSc_IS); Py_CLEAR(clear_module_state->PyPetscIS_Type); Py_CLEAR(clear_module_state->__pyx_ptype_8petsc4py_5PETSc_LGMap); Py_CLEAR(clear_module_state->PyPetscLGMap_Type); Py_CLEAR(clear_module_state->__pyx_ptype_8petsc4py_5PETSc_SF); Py_CLEAR(clear_module_state->PyPetscSF_Type); Py_CLEAR(clear_module_state->__pyx_ptype_8petsc4py_5PETSc_Vec); Py_CLEAR(clear_module_state->PyPetscVec_Type); Py_CLEAR(clear_module_state->__pyx_ptype_8petsc4py_5PETSc_Space); Py_CLEAR(clear_module_state->PyPetscSpace_Type); Py_CLEAR(clear_module_state->__pyx_ptype_8petsc4py_5PETSc_DualSpace); Py_CLEAR(clear_module_state->PyPetscDualSpace_Type); Py_CLEAR(clear_module_state->__pyx_ptype_8petsc4py_5PETSc_FE); Py_CLEAR(clear_module_state->PyPetscFE_Type); Py_CLEAR(clear_module_state->__pyx_ptype_8petsc4py_5PETSc_Quad); Py_CLEAR(clear_module_state->PyPetscQuad_Type); Py_CLEAR(clear_module_state->__pyx_ptype_8petsc4py_5PETSc_Scatter); Py_CLEAR(clear_module_state->PyPetscScatter_Type); Py_CLEAR(clear_module_state->__pyx_ptype_8petsc4py_5PETSc_Section); Py_CLEAR(clear_module_state->PyPetscSection_Type); Py_CLEAR(clear_module_state->__pyx_ptype_8petsc4py_5PETSc_Mat); Py_CLEAR(clear_module_state->PyPetscMat_Type); Py_CLEAR(clear_module_state->__pyx_ptype_8petsc4py_5PETSc_MatPartitioning); Py_CLEAR(clear_module_state->PyPetscMatPartitioning_Type); Py_CLEAR(clear_module_state->__pyx_ptype_8petsc4py_5PETSc_NullSpace); Py_CLEAR(clear_module_state->PyPetscNullSpace_Type); Py_CLEAR(clear_module_state->__pyx_ptype_8petsc4py_5PETSc_PC); Py_CLEAR(clear_module_state->PyPetscPC_Type); Py_CLEAR(clear_module_state->__pyx_ptype_8petsc4py_5PETSc_KSP); Py_CLEAR(clear_module_state->PyPetscKSP_Type); Py_CLEAR(clear_module_state->__pyx_ptype_8petsc4py_5PETSc_SNES); Py_CLEAR(clear_module_state->PyPetscSNES_Type); Py_CLEAR(clear_module_state->__pyx_ptype_8petsc4py_5PETSc_TS); Py_CLEAR(clear_module_state->PyPetscTS_Type); Py_CLEAR(clear_module_state->__pyx_ptype_8petsc4py_5PETSc_TAO); Py_CLEAR(clear_module_state->PyPetscTAO_Type); Py_CLEAR(clear_module_state->__pyx_ptype_8petsc4py_5PETSc_TAOLineSearch); Py_CLEAR(clear_module_state->PyPetscTAOLineSearch_Type); Py_CLEAR(clear_module_state->__pyx_ptype_8petsc4py_5PETSc_AO); Py_CLEAR(clear_module_state->PyPetscAO_Type); Py_CLEAR(clear_module_state->__pyx_ptype_8petsc4py_5PETSc_DM); Py_CLEAR(clear_module_state->PyPetscDM_Type); Py_CLEAR(clear_module_state->__pyx_ptype_8petsc4py_5PETSc_DMPlexTransform); Py_CLEAR(clear_module_state->PyPetscDMPlexTransform_Type); Py_CLEAR(clear_module_state->__pyx_ptype_8petsc4py_5PETSc_DS); Py_CLEAR(clear_module_state->PyPetscDS_Type); Py_CLEAR(clear_module_state->__pyx_ptype_8petsc4py_5PETSc_Partitioner); Py_CLEAR(clear_module_state->PyPetscPartitioner_Type); Py_CLEAR(clear_module_state->__pyx_ptype_8petsc4py_5PETSc_DMLabel); Py_CLEAR(clear_module_state->PyPetscDMLabel_Type); Py_CLEAR(clear_module_state->__pyx_ptype_8petsc4py_5PETSc_dtype); Py_CLEAR(clear_module_state->__pyx_ptype_8petsc4py_5PETSc_ndarray); Py_CLEAR(clear_module_state->__pyx_ptype_8petsc4py_5PETSc__IS_buffer); Py_CLEAR(clear_module_state->__pyx_type_8petsc4py_5PETSc__IS_buffer); Py_CLEAR(clear_module_state->__pyx_ptype_8petsc4py_5PETSc__Vec_buffer); Py_CLEAR(clear_module_state->__pyx_type_8petsc4py_5PETSc__Vec_buffer); Py_CLEAR(clear_module_state->__pyx_ptype_8petsc4py_5PETSc__Vec_LocalForm); Py_CLEAR(clear_module_state->__pyx_type_8petsc4py_5PETSc__Vec_LocalForm); Py_CLEAR(clear_module_state->__pyx_ptype_8petsc4py_5PETSc__DMDA_Vec_array); Py_CLEAR(clear_module_state->__pyx_type_8petsc4py_5PETSc__DMDA_Vec_array); Py_CLEAR(clear_module_state->__pyx_ptype_8petsc4py_5PETSc__DMComposite_access); Py_CLEAR(clear_module_state->__pyx_type_8petsc4py_5PETSc__DMComposite_access); Py_CLEAR(clear_module_state->__pyx_ptype_8petsc4py_5PETSc_Options); Py_CLEAR(clear_module_state->__pyx_type_8petsc4py_5PETSc_Options); Py_CLEAR(clear_module_state->__pyx_ptype_8petsc4py_5PETSc_Sys); Py_CLEAR(clear_module_state->__pyx_type_8petsc4py_5PETSc_Sys); Py_CLEAR(clear_module_state->__pyx_ptype_8petsc4py_5PETSc_Log); Py_CLEAR(clear_module_state->__pyx_type_8petsc4py_5PETSc_Log); Py_CLEAR(clear_module_state->__pyx_ptype_8petsc4py_5PETSc_LogStage); Py_CLEAR(clear_module_state->__pyx_type_8petsc4py_5PETSc_LogStage); Py_CLEAR(clear_module_state->__pyx_ptype_8petsc4py_5PETSc_LogClass); Py_CLEAR(clear_module_state->__pyx_type_8petsc4py_5PETSc_LogClass); Py_CLEAR(clear_module_state->__pyx_ptype_8petsc4py_5PETSc_LogEvent); Py_CLEAR(clear_module_state->__pyx_type_8petsc4py_5PETSc_LogEvent); Py_CLEAR(clear_module_state->__pyx_ptype_8petsc4py_5PETSc_ViewerHDF5); Py_CLEAR(clear_module_state->__pyx_type_8petsc4py_5PETSc_ViewerHDF5); Py_CLEAR(clear_module_state->__pyx_ptype_8petsc4py_5PETSc_MatStencil); Py_CLEAR(clear_module_state->__pyx_type_8petsc4py_5PETSc_MatStencil); Py_CLEAR(clear_module_state->__pyx_ptype_8petsc4py_5PETSc_DMDA); Py_CLEAR(clear_module_state->__pyx_type_8petsc4py_5PETSc_DMDA); Py_CLEAR(clear_module_state->__pyx_ptype_8petsc4py_5PETSc_DMPlex); Py_CLEAR(clear_module_state->__pyx_type_8petsc4py_5PETSc_DMPlex); Py_CLEAR(clear_module_state->__pyx_ptype_8petsc4py_5PETSc_DMStag); Py_CLEAR(clear_module_state->__pyx_type_8petsc4py_5PETSc_DMStag); Py_CLEAR(clear_module_state->__pyx_ptype_8petsc4py_5PETSc_DMComposite); Py_CLEAR(clear_module_state->__pyx_type_8petsc4py_5PETSc_DMComposite); Py_CLEAR(clear_module_state->__pyx_ptype_8petsc4py_5PETSc_DMShell); Py_CLEAR(clear_module_state->__pyx_type_8petsc4py_5PETSc_DMShell); Py_CLEAR(clear_module_state->__pyx_ptype_8petsc4py_5PETSc_DMSwarm); Py_CLEAR(clear_module_state->__pyx_type_8petsc4py_5PETSc_DMSwarm); Py_CLEAR(clear_module_state->__pyx_ptype_8petsc4py_5PETSc_DMInterpolation); Py_CLEAR(clear_module_state->__pyx_type_8petsc4py_5PETSc_DMInterpolation); Py_CLEAR(clear_module_state->__pyx_ptype_8petsc4py_5PETSc__PyObj); Py_CLEAR(clear_module_state->__pyx_type_8petsc4py_5PETSc__PyObj); Py_CLEAR(clear_module_state->__pyx_ptype_8petsc4py_5PETSc__PyMat); Py_CLEAR(clear_module_state->__pyx_type_8petsc4py_5PETSc__PyMat); Py_CLEAR(clear_module_state->__pyx_ptype_8petsc4py_5PETSc__PyPC); Py_CLEAR(clear_module_state->__pyx_type_8petsc4py_5PETSc__PyPC); Py_CLEAR(clear_module_state->__pyx_ptype_8petsc4py_5PETSc__PyKSP); Py_CLEAR(clear_module_state->__pyx_type_8petsc4py_5PETSc__PyKSP); Py_CLEAR(clear_module_state->__pyx_ptype_8petsc4py_5PETSc__PySNES); Py_CLEAR(clear_module_state->__pyx_type_8petsc4py_5PETSc__PySNES); Py_CLEAR(clear_module_state->__pyx_ptype_8petsc4py_5PETSc__PyTS); Py_CLEAR(clear_module_state->__pyx_type_8petsc4py_5PETSc__PyTS); Py_CLEAR(clear_module_state->__pyx_ptype_8petsc4py_5PETSc__PyTao); Py_CLEAR(clear_module_state->__pyx_type_8petsc4py_5PETSc__PyTao); Py_CLEAR(clear_module_state->__pyx_ptype_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator); Py_CLEAR(clear_module_state->__pyx_type_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator); Py_CLEAR(clear_module_state->__pyx_ptype_8petsc4py_5PETSc___pyx_scope_struct_1_decorator); Py_CLEAR(clear_module_state->__pyx_type_8petsc4py_5PETSc___pyx_scope_struct_1_decorator); Py_CLEAR(clear_module_state->__pyx_array_type); Py_CLEAR(clear_module_state->__pyx_type___pyx_array); Py_CLEAR(clear_module_state->__pyx_MemviewEnum_type); Py_CLEAR(clear_module_state->__pyx_type___pyx_MemviewEnum); Py_CLEAR(clear_module_state->__pyx_memoryview_type); Py_CLEAR(clear_module_state->__pyx_type___pyx_memoryview); Py_CLEAR(clear_module_state->__pyx_memoryviewslice_type); Py_CLEAR(clear_module_state->__pyx_type___pyx_memoryviewslice); Py_CLEAR(clear_module_state->__pyx_kp_u_); Py_CLEAR(clear_module_state->__pyx_n_s_A); Py_CLEAR(clear_module_state->__pyx_n_s_A11); Py_CLEAR(clear_module_state->__pyx_n_s_AB); Py_CLEAR(clear_module_state->__pyx_n_s_ABC); Py_CLEAR(clear_module_state->__pyx_n_s_ABt); Py_CLEAR(clear_module_state->__pyx_n_s_ADD); Py_CLEAR(clear_module_state->__pyx_n_s_ADDITIVE); Py_CLEAR(clear_module_state->__pyx_n_s_ADD_ALL); Py_CLEAR(clear_module_state->__pyx_n_s_ADD_ALL_VALUES); Py_CLEAR(clear_module_state->__pyx_n_s_ADD_BC); Py_CLEAR(clear_module_state->__pyx_n_s_ADD_BC_VALUES); Py_CLEAR(clear_module_state->__pyx_n_s_ADD_VALUES); Py_CLEAR(clear_module_state->__pyx_n_s_ADIOS); Py_CLEAR(clear_module_state->__pyx_n_s_ADMM); Py_CLEAR(clear_module_state->__pyx_n_s_ADVANCED); Py_CLEAR(clear_module_state->__pyx_n_s_AGG); Py_CLEAR(clear_module_state->__pyx_n_s_AGGREGATION); Py_CLEAR(clear_module_state->__pyx_n_s_AIJ); Py_CLEAR(clear_module_state->__pyx_n_s_AIJCRL); Py_CLEAR(clear_module_state->__pyx_n_s_AIJCUSPARSE); Py_CLEAR(clear_module_state->__pyx_n_s_AIJMKL); Py_CLEAR(clear_module_state->__pyx_n_s_AIJPERM); Py_CLEAR(clear_module_state->__pyx_n_s_AIJSELL); Py_CLEAR(clear_module_state->__pyx_n_s_AIJVIENNACL); Py_CLEAR(clear_module_state->__pyx_n_s_ALLGATHER); Py_CLEAR(clear_module_state->__pyx_n_s_ALLGATHERV); Py_CLEAR(clear_module_state->__pyx_n_s_ALLTOALL); Py_CLEAR(clear_module_state->__pyx_n_s_ALMM); Py_CLEAR(clear_module_state->__pyx_n_s_ALPHA); Py_CLEAR(clear_module_state->__pyx_n_s_ALPHA2); Py_CLEAR(clear_module_state->__pyx_n_s_ALWAYS); Py_CLEAR(clear_module_state->__pyx_n_s_AMD); Py_CLEAR(clear_module_state->__pyx_n_s_ANDERSON); Py_CLEAR(clear_module_state->__pyx_n_s_AO); Py_CLEAR(clear_module_state->__pyx_n_s_AOType); Py_CLEAR(clear_module_state->__pyx_n_s_APPEND); Py_CLEAR(clear_module_state->__pyx_n_s_APPEND_UPDATE); Py_CLEAR(clear_module_state->__pyx_n_s_APPLY_LOWER); Py_CLEAR(clear_module_state->__pyx_n_s_APPLY_UPPER); Py_CLEAR(clear_module_state->__pyx_n_s_ARKIMEX); Py_CLEAR(clear_module_state->__pyx_n_s_ARKIMEX1BEE); Py_CLEAR(clear_module_state->__pyx_n_s_ARKIMEX2C); Py_CLEAR(clear_module_state->__pyx_n_s_ARKIMEX2D); Py_CLEAR(clear_module_state->__pyx_n_s_ARKIMEX2E); Py_CLEAR(clear_module_state->__pyx_n_s_ARKIMEX3); Py_CLEAR(clear_module_state->__pyx_n_s_ARKIMEX4); Py_CLEAR(clear_module_state->__pyx_n_s_ARKIMEX5); Py_CLEAR(clear_module_state->__pyx_n_s_ARKIMEXA2); Py_CLEAR(clear_module_state->__pyx_n_s_ARKIMEXARS122); Py_CLEAR(clear_module_state->__pyx_n_s_ARKIMEXARS443); Py_CLEAR(clear_module_state->__pyx_n_s_ARKIMEXBPR3); Py_CLEAR(clear_module_state->__pyx_n_s_ARKIMEXL2); Py_CLEAR(clear_module_state->__pyx_n_s_ARKIMEXPRSSP2); Py_CLEAR(clear_module_state->__pyx_n_s_ARKIMEXType); Py_CLEAR(clear_module_state->__pyx_n_s_ARMIJO); Py_CLEAR(clear_module_state->__pyx_n_s_ASCII); Py_CLEAR(clear_module_state->__pyx_n_s_ASCII_COMMON); Py_CLEAR(clear_module_state->__pyx_n_s_ASCII_CSV); Py_CLEAR(clear_module_state->__pyx_n_s_ASCII_DENSE); Py_CLEAR(clear_module_state->__pyx_n_s_ASCII_FACTOR_INFO); Py_CLEAR(clear_module_state->__pyx_n_s_ASCII_GLVIS); Py_CLEAR(clear_module_state->__pyx_n_s_ASCII_IMPL); Py_CLEAR(clear_module_state->__pyx_n_s_ASCII_INDEX); Py_CLEAR(clear_module_state->__pyx_n_s_ASCII_INFO); Py_CLEAR(clear_module_state->__pyx_n_s_ASCII_INFO_DETAIL); Py_CLEAR(clear_module_state->__pyx_n_s_ASCII_LATEX); Py_CLEAR(clear_module_state->__pyx_n_s_ASCII_MATHEMATICA); Py_CLEAR(clear_module_state->__pyx_n_s_ASCII_MATLAB); Py_CLEAR(clear_module_state->__pyx_n_s_ASCII_MATRIXMARKET); Py_CLEAR(clear_module_state->__pyx_n_s_ASCII_PCICE); Py_CLEAR(clear_module_state->__pyx_n_s_ASCII_PYTHON); Py_CLEAR(clear_module_state->__pyx_n_s_ASCII_SYMMODU); Py_CLEAR(clear_module_state->__pyx_n_s_ASCII_VTK); Py_CLEAR(clear_module_state->__pyx_n_s_ASCII_VTK_CELL); Py_CLEAR(clear_module_state->__pyx_n_s_ASCII_VTK_COORDS); Py_CLEAR(clear_module_state->__pyx_n_s_ASCII_XML); Py_CLEAR(clear_module_state->__pyx_n_s_ASFLS); Py_CLEAR(clear_module_state->__pyx_n_s_ASILS); Py_CLEAR(clear_module_state->__pyx_n_s_ASM); Py_CLEAR(clear_module_state->__pyx_n_s_ASMType); Py_CLEAR(clear_module_state->__pyx_n_s_ASPIN); Py_CLEAR(clear_module_state->__pyx_n_s_AU); Py_CLEAR(clear_module_state->__pyx_kp_s_A_matrix_with_d_rows_requires_a); Py_CLEAR(clear_module_state->__pyx_kp_s_All_dimensions_preceding_dimensi); Py_CLEAR(clear_module_state->__pyx_n_s_AssemblyType); Py_CLEAR(clear_module_state->__pyx_n_s_AssertionError); Py_CLEAR(clear_module_state->__pyx_n_s_AtB); Py_CLEAR(clear_module_state->__pyx_n_s_AttributeError); Py_CLEAR(clear_module_state->__pyx_n_s_B); Py_CLEAR(clear_module_state->__pyx_n_s_BACK); Py_CLEAR(clear_module_state->__pyx_n_s_BACKWARD_SWEEP); Py_CLEAR(clear_module_state->__pyx_n_s_BACK_DOWN); Py_CLEAR(clear_module_state->__pyx_n_s_BACK_DOWN_LEFT); Py_CLEAR(clear_module_state->__pyx_n_s_BACK_DOWN_RIGHT); Py_CLEAR(clear_module_state->__pyx_n_s_BACK_LEFT); Py_CLEAR(clear_module_state->__pyx_n_s_BACK_RIGHT); Py_CLEAR(clear_module_state->__pyx_n_s_BACK_UP); Py_CLEAR(clear_module_state->__pyx_n_s_BACK_UP_LEFT); Py_CLEAR(clear_module_state->__pyx_n_s_BACK_UP_RIGHT); Py_CLEAR(clear_module_state->__pyx_n_s_BAIJ); Py_CLEAR(clear_module_state->__pyx_n_s_BAIJMKL); Py_CLEAR(clear_module_state->__pyx_n_s_BALANCED); Py_CLEAR(clear_module_state->__pyx_n_s_BAS); Py_CLEAR(clear_module_state->__pyx_n_s_BASIC); Py_CLEAR(clear_module_state->__pyx_n_s_BASICSYMPLECTIC); Py_CLEAR(clear_module_state->__pyx_n_s_BCG); Py_CLEAR(clear_module_state->__pyx_n_s_BCGS); Py_CLEAR(clear_module_state->__pyx_n_s_BCGSL); Py_CLEAR(clear_module_state->__pyx_n_s_BDDC); Py_CLEAR(clear_module_state->__pyx_n_s_BDF); Py_CLEAR(clear_module_state->__pyx_n_s_BDM); Py_CLEAR(clear_module_state->__pyx_n_s_BE); Py_CLEAR(clear_module_state->__pyx_n_s_BEULER); Py_CLEAR(clear_module_state->__pyx_n_s_BFBCG); Py_CLEAR(clear_module_state->__pyx_n_s_BFBT); Py_CLEAR(clear_module_state->__pyx_n_s_BGCRODR); Py_CLEAR(clear_module_state->__pyx_n_s_BGMRES); Py_CLEAR(clear_module_state->__pyx_n_s_BICG); Py_CLEAR(clear_module_state->__pyx_n_s_BINARY); Py_CLEAR(clear_module_state->__pyx_n_s_BINARY_MATLAB); Py_CLEAR(clear_module_state->__pyx_n_s_BIORTH22); Py_CLEAR(clear_module_state->__pyx_n_s_BJACOBI); Py_CLEAR(clear_module_state->__pyx_n_s_BLMVM); Py_CLEAR(clear_module_state->__pyx_n_s_BLOCK); Py_CLEAR(clear_module_state->__pyx_n_s_BLOCKMAT); Py_CLEAR(clear_module_state->__pyx_n_s_BMRM); Py_CLEAR(clear_module_state->__pyx_n_s_BNCG); Py_CLEAR(clear_module_state->__pyx_n_s_BNCGType); Py_CLEAR(clear_module_state->__pyx_n_s_BNLS); Py_CLEAR(clear_module_state->__pyx_n_s_BNTL); Py_CLEAR(clear_module_state->__pyx_n_s_BNTR); Py_CLEAR(clear_module_state->__pyx_n_s_BOX); Py_CLEAR(clear_module_state->__pyx_n_s_BQNKLS); Py_CLEAR(clear_module_state->__pyx_n_s_BQNKTL); Py_CLEAR(clear_module_state->__pyx_n_s_BQNKTR); Py_CLEAR(clear_module_state->__pyx_n_s_BQNLS); Py_CLEAR(clear_module_state->__pyx_n_s_BQPIP); Py_CLEAR(clear_module_state->__pyx_n_s_BRGN); Py_CLEAR(clear_module_state->__pyx_n_s_Barrier); Py_CLEAR(clear_module_state->__pyx_kp_s_Basic_constants_DECIDE_Use_a_de); Py_CLEAR(clear_module_state->__pyx_n_s_BoundaryType); Py_CLEAR(clear_module_state->__pyx_kp_s_Buffer_view_does_not_expose_stri); Py_CLEAR(clear_module_state->__pyx_n_s_C); Py_CLEAR(clear_module_state->__pyx_n_s_CG); Py_CLEAR(clear_module_state->__pyx_n_s_CGLS); Py_CLEAR(clear_module_state->__pyx_n_s_CGNE); Py_CLEAR(clear_module_state->__pyx_n_s_CGS); Py_CLEAR(clear_module_state->__pyx_n_s_CHACO); Py_CLEAR(clear_module_state->__pyx_n_s_CHEBYSHEV); Py_CLEAR(clear_module_state->__pyx_n_s_CHOLESKY); Py_CLEAR(clear_module_state->__pyx_n_s_CHOLMOD); Py_CLEAR(clear_module_state->__pyx_n_s_CHOWILUVIENNACL); Py_CLEAR(clear_module_state->__pyx_n_s_CLASSICAL); Py_CLEAR(clear_module_state->__pyx_n_s_CN); Py_CLEAR(clear_module_state->__pyx_n_s_COLLECT_BASIC); Py_CLEAR(clear_module_state->__pyx_n_s_COLLECT_DMDABOUNDINGBOX); Py_CLEAR(clear_module_state->__pyx_n_s_COLLECT_GENERAL); Py_CLEAR(clear_module_state->__pyx_n_s_COLLECT_USER); Py_CLEAR(clear_module_state->__pyx_n_s_COMM_NULL); Py_CLEAR(clear_module_state->__pyx_n_s_COMM_SELF); Py_CLEAR(clear_module_state->__pyx_n_s_COMM_WORLD); Py_CLEAR(clear_module_state->__pyx_n_s_COMPOSITE); Py_CLEAR(clear_module_state->__pyx_n_s_CONSTANTDIAGONAL); Py_CLEAR(clear_module_state->__pyx_n_s_CONTINUE_ITERATING); Py_CLEAR(clear_module_state->__pyx_n_s_CONTINUE_SEARCH); Py_CLEAR(clear_module_state->__pyx_n_s_CONVERGED_ATOL); Py_CLEAR(clear_module_state->__pyx_n_s_CONVERGED_ATOL_NORMAL); Py_CLEAR(clear_module_state->__pyx_n_s_CONVERGED_EVENT); Py_CLEAR(clear_module_state->__pyx_n_s_CONVERGED_FNORM_ABS); Py_CLEAR(clear_module_state->__pyx_n_s_CONVERGED_FNORM_RELATIVE); Py_CLEAR(clear_module_state->__pyx_n_s_CONVERGED_GATOL); Py_CLEAR(clear_module_state->__pyx_n_s_CONVERGED_GRTOL); Py_CLEAR(clear_module_state->__pyx_n_s_CONVERGED_GTTOL); Py_CLEAR(clear_module_state->__pyx_n_s_CONVERGED_HAPPY_BREAKDOWN); Py_CLEAR(clear_module_state->__pyx_n_s_CONVERGED_ITERATING); Py_CLEAR(clear_module_state->__pyx_n_s_CONVERGED_ITS); Py_CLEAR(clear_module_state->__pyx_n_s_CONVERGED_MINF); Py_CLEAR(clear_module_state->__pyx_n_s_CONVERGED_NEG_CURVE); Py_CLEAR(clear_module_state->__pyx_n_s_CONVERGED_RTOL); Py_CLEAR(clear_module_state->__pyx_n_s_CONVERGED_RTOL_NORMAL); Py_CLEAR(clear_module_state->__pyx_n_s_CONVERGED_SNORM_RELATIVE); Py_CLEAR(clear_module_state->__pyx_n_s_CONVERGED_STEPTOL); Py_CLEAR(clear_module_state->__pyx_n_s_CONVERGED_STEP_LENGTH); Py_CLEAR(clear_module_state->__pyx_n_s_CONVERGED_TIME); Py_CLEAR(clear_module_state->__pyx_n_s_CONVERGED_USER); Py_CLEAR(clear_module_state->__pyx_n_s_COPY_VALUES); Py_CLEAR(clear_module_state->__pyx_n_s_CP); Py_CLEAR(clear_module_state->__pyx_n_s_CR); Py_CLEAR(clear_module_state->__pyx_n_s_CRANK_NICOLSON); Py_CLEAR(clear_module_state->__pyx_n_s_CUDA); Py_CLEAR(clear_module_state->__pyx_n_s_CUSPARSE); Py_CLEAR(clear_module_state->__pyx_kp_s_Can_only_create_a_buffer_that_is); Py_CLEAR(clear_module_state->__pyx_kp_s_Cannot_assign_to_read_only_memor); Py_CLEAR(clear_module_state->__pyx_kp_s_Cannot_create_writable_memory_vi); Py_CLEAR(clear_module_state->__pyx_kp_u_Cannot_index_with_type); Py_CLEAR(clear_module_state->__pyx_kp_s_Cannot_transpose_memoryview_with); Py_CLEAR(clear_module_state->__pyx_n_s_Class); Py_CLEAR(clear_module_state->__pyx_n_s_Clone); Py_CLEAR(clear_module_state->__pyx_n_s_CollectType); Py_CLEAR(clear_module_state->__pyx_n_s_Comm); Py_CLEAR(clear_module_state->__pyx_n_s_ComplexType); Py_CLEAR(clear_module_state->__pyx_n_s_CompositeType); Py_CLEAR(clear_module_state->__pyx_n_s_ConvergedReason); Py_CLEAR(clear_module_state->__pyx_n_s_D); Py_CLEAR(clear_module_state->__pyx_n_s_DA); Py_CLEAR(clear_module_state->__pyx_n_s_DAE_IMPLICIT_INDEX1); Py_CLEAR(clear_module_state->__pyx_n_s_DAE_IMPLICIT_INDEX2); Py_CLEAR(clear_module_state->__pyx_n_s_DAE_IMPLICIT_INDEX3); Py_CLEAR(clear_module_state->__pyx_n_s_DAE_IMPLICIT_INDEXHI); Py_CLEAR(clear_module_state->__pyx_n_s_DAE_SEMI_EXPLICIT_INDEX1); Py_CLEAR(clear_module_state->__pyx_n_s_DAE_SEMI_EXPLICIT_INDEX2); Py_CLEAR(clear_module_state->__pyx_n_s_DAE_SEMI_EXPLICIT_INDEX3); Py_CLEAR(clear_module_state->__pyx_n_s_DAE_SEMI_EXPLICIT_INDEXHI); Py_CLEAR(clear_module_state->__pyx_n_s_DB16); Py_CLEAR(clear_module_state->__pyx_n_s_DB2); Py_CLEAR(clear_module_state->__pyx_n_s_DB4); Py_CLEAR(clear_module_state->__pyx_n_s_DB8); Py_CLEAR(clear_module_state->__pyx_n_s_DECIDE); Py_CLEAR(clear_module_state->__pyx_n_s_DEFAULT); Py_CLEAR(clear_module_state->__pyx_n_s_DEFAULT_BLOCKING); Py_CLEAR(clear_module_state->__pyx_n_s_DEFLATED); Py_CLEAR(clear_module_state->__pyx_n_s_DEFLATION); Py_CLEAR(clear_module_state->__pyx_n_s_DENSE); Py_CLEAR(clear_module_state->__pyx_n_s_DENSECUDA); Py_CLEAR(clear_module_state->__pyx_n_s_DESTROY); Py_CLEAR(clear_module_state->__pyx_n_s_DETERMINE); Py_CLEAR(clear_module_state->__pyx_n_s_DGMRES); Py_CLEAR(clear_module_state->__pyx_n_s_DIAG); Py_CLEAR(clear_module_state->__pyx_n_s_DIAGONAL); Py_CLEAR(clear_module_state->__pyx_n_s_DIFFERENT); Py_CLEAR(clear_module_state->__pyx_n_s_DIFFERENT_NONZERO_PATTERN); Py_CLEAR(clear_module_state->__pyx_n_s_DIFFERENT_NZ); Py_CLEAR(clear_module_state->__pyx_n_s_DIRK); Py_CLEAR(clear_module_state->__pyx_n_s_DIRK657A); Py_CLEAR(clear_module_state->__pyx_n_s_DIRK658A); Py_CLEAR(clear_module_state->__pyx_n_s_DIRK7510SAL); Py_CLEAR(clear_module_state->__pyx_n_s_DIRK759A); Py_CLEAR(clear_module_state->__pyx_n_s_DIRK8614A); Py_CLEAR(clear_module_state->__pyx_n_s_DIRK8616SAL); Py_CLEAR(clear_module_state->__pyx_n_s_DIRKES122SAL); Py_CLEAR(clear_module_state->__pyx_n_s_DIRKES213SAL); Py_CLEAR(clear_module_state->__pyx_n_s_DIRKES324SAL); Py_CLEAR(clear_module_state->__pyx_n_s_DIRKES325SAL); Py_CLEAR(clear_module_state->__pyx_n_s_DIRKES648SA); Py_CLEAR(clear_module_state->__pyx_n_s_DIRKES7510SA); Py_CLEAR(clear_module_state->__pyx_n_s_DIRKES8516SAL); Py_CLEAR(clear_module_state->__pyx_n_s_DIRKS212); Py_CLEAR(clear_module_state->__pyx_n_s_DIRKS659A); Py_CLEAR(clear_module_state->__pyx_n_s_DIRKS7511SAL); Py_CLEAR(clear_module_state->__pyx_n_s_DIRKType); Py_CLEAR(clear_module_state->__pyx_n_s_DISCGRAD); Py_CLEAR(clear_module_state->__pyx_n_s_DIVERGED_BREAKDOWN); Py_CLEAR(clear_module_state->__pyx_n_s_DIVERGED_BREAKDOWN_BICG); Py_CLEAR(clear_module_state->__pyx_n_s_DIVERGED_DTOL); Py_CLEAR(clear_module_state->__pyx_n_s_DIVERGED_FNORM_NAN); Py_CLEAR(clear_module_state->__pyx_n_s_DIVERGED_FUNCTION_COUNT); Py_CLEAR(clear_module_state->__pyx_n_s_DIVERGED_FUNCTION_DOMAIN); Py_CLEAR(clear_module_state->__pyx_n_s_DIVERGED_INDEFINITE_MAT); Py_CLEAR(clear_module_state->__pyx_n_s_DIVERGED_INDEFINITE_PC); Py_CLEAR(clear_module_state->__pyx_n_s_DIVERGED_INNER); Py_CLEAR(clear_module_state->__pyx_n_s_DIVERGED_JACOBIAN_DOMAIN); Py_CLEAR(clear_module_state->__pyx_n_s_DIVERGED_LINEAR_SOLVE); Py_CLEAR(clear_module_state->__pyx_n_s_DIVERGED_LINE_SEARCH); Py_CLEAR(clear_module_state->__pyx_n_s_DIVERGED_LOCAL_MIN); Py_CLEAR(clear_module_state->__pyx_n_s_DIVERGED_LS_FAILURE); Py_CLEAR(clear_module_state->__pyx_n_s_DIVERGED_MAXFCN); Py_CLEAR(clear_module_state->__pyx_n_s_DIVERGED_MAXITS); Py_CLEAR(clear_module_state->__pyx_n_s_DIVERGED_MAX_IT); Py_CLEAR(clear_module_state->__pyx_n_s_DIVERGED_NAN); Py_CLEAR(clear_module_state->__pyx_n_s_DIVERGED_NANORINF); Py_CLEAR(clear_module_state->__pyx_n_s_DIVERGED_NONLINEAR_SOLVE); Py_CLEAR(clear_module_state->__pyx_n_s_DIVERGED_NONSYMMETRIC); Py_CLEAR(clear_module_state->__pyx_n_s_DIVERGED_NULL); Py_CLEAR(clear_module_state->__pyx_n_s_DIVERGED_PCSETUP_FAILED); Py_CLEAR(clear_module_state->__pyx_n_s_DIVERGED_STEP_REJECTED); Py_CLEAR(clear_module_state->__pyx_n_s_DIVERGED_TR_DELTA); Py_CLEAR(clear_module_state->__pyx_n_s_DIVERGED_TR_REDUCTION); Py_CLEAR(clear_module_state->__pyx_n_s_DIVERGED_USER); Py_CLEAR(clear_module_state->__pyx_n_s_DK); Py_CLEAR(clear_module_state->__pyx_n_s_DM); Py_CLEAR(clear_module_state->__pyx_n_s_DMBoundaryType); Py_CLEAR(clear_module_state->__pyx_n_s_DMComposite); Py_CLEAR(clear_module_state->__pyx_n_s_DMComposite_access); Py_CLEAR(clear_module_state->__pyx_n_s_DMDA); Py_CLEAR(clear_module_state->__pyx_n_s_DMDAElementType); Py_CLEAR(clear_module_state->__pyx_n_s_DMDAInterpolationType); Py_CLEAR(clear_module_state->__pyx_n_s_DMDAStencilType); Py_CLEAR(clear_module_state->__pyx_n_s_DMDA_Vec_array); Py_CLEAR(clear_module_state->__pyx_n_s_DMInterpolation); Py_CLEAR(clear_module_state->__pyx_n_s_DMLabel); Py_CLEAR(clear_module_state->__pyx_n_s_DMPlex); Py_CLEAR(clear_module_state->__pyx_n_s_DMPlexReorderDefaultFlag); Py_CLEAR(clear_module_state->__pyx_n_s_DMPlexTransform); Py_CLEAR(clear_module_state->__pyx_n_s_DMPlexTransformType); Py_CLEAR(clear_module_state->__pyx_n_s_DMPolytopeType); Py_CLEAR(clear_module_state->__pyx_n_s_DMShell); Py_CLEAR(clear_module_state->__pyx_n_s_DMStag); Py_CLEAR(clear_module_state->__pyx_n_s_DMStagStencilLocation); Py_CLEAR(clear_module_state->__pyx_n_s_DMStagStencilType); Py_CLEAR(clear_module_state->__pyx_n_s_DMSwarm); Py_CLEAR(clear_module_state->__pyx_n_s_DMSwarmCollectType); Py_CLEAR(clear_module_state->__pyx_n_s_DMSwarmMigrateType); Py_CLEAR(clear_module_state->__pyx_n_s_DMSwarmPICLayoutType); Py_CLEAR(clear_module_state->__pyx_n_s_DMSwarmType); Py_CLEAR(clear_module_state->__pyx_n_s_DMType); Py_CLEAR(clear_module_state->__pyx_kp_s_DM_Boundary_types); Py_CLEAR(clear_module_state->__pyx_kp_s_DM_types); Py_CLEAR(clear_module_state->__pyx_n_s_DOF); Py_CLEAR(clear_module_state->__pyx_n_s_DOWN); Py_CLEAR(clear_module_state->__pyx_n_s_DOWN_LEFT); Py_CLEAR(clear_module_state->__pyx_n_s_DOWN_RIGHT); Py_CLEAR(clear_module_state->__pyx_n_s_DO_NOT_COPY_VALUES); Py_CLEAR(clear_module_state->__pyx_n_s_DRAW); Py_CLEAR(clear_module_state->__pyx_n_s_DRAW_BASIC); Py_CLEAR(clear_module_state->__pyx_n_s_DRAW_CONTOUR); Py_CLEAR(clear_module_state->__pyx_n_s_DRAW_LG); Py_CLEAR(clear_module_state->__pyx_n_s_DRAW_LG_XRANGE); Py_CLEAR(clear_module_state->__pyx_n_s_DRAW_PORTS); Py_CLEAR(clear_module_state->__pyx_n_s_DROP); Py_CLEAR(clear_module_state->__pyx_n_s_DS); Py_CLEAR(clear_module_state->__pyx_n_s_DSType); Py_CLEAR(clear_module_state->__pyx_n_s_DUMMY); Py_CLEAR(clear_module_state->__pyx_n_s_DY); Py_CLEAR(clear_module_state->__pyx_n_s_DeflationSpaceType); Py_CLEAR(clear_module_state->__pyx_n_s_Device); Py_CLEAR(clear_module_state->__pyx_n_s_DeviceContext); Py_CLEAR(clear_module_state->__pyx_n_s_DeviceJoinMode); Py_CLEAR(clear_module_state->__pyx_n_s_DeviceType); Py_CLEAR(clear_module_state->__pyx_kp_s_Device_type_not_supported); Py_CLEAR(clear_module_state->__pyx_kp_s_Dimension_d_is_not_direct); Py_CLEAR(clear_module_state->__pyx_kp_s_Distinguishes_among_types_of_exp); Py_CLEAR(clear_module_state->__pyx_kp_s_Distinguishes_linear_and_nonline); Py_CLEAR(clear_module_state->__pyx_n_s_DrawSize); Py_CLEAR(clear_module_state->__pyx_n_s_DualSpace); Py_CLEAR(clear_module_state->__pyx_n_s_DualSpaceType); Py_CLEAR(clear_module_state->__pyx_n_s_Dup); Py_CLEAR(clear_module_state->__pyx_n_s_DuplicateOption); Py_CLEAR(clear_module_state->__pyx_n_s_EIMEX); Py_CLEAR(clear_module_state->__pyx_n_s_EISENSTAT); Py_CLEAR(clear_module_state->__pyx_n_s_ELEMENT); Py_CLEAR(clear_module_state->__pyx_n_s_ELEMENTAL); Py_CLEAR(clear_module_state->__pyx_n_s_ERROR_LOWER_TRIANGULAR); Py_CLEAR(clear_module_state->__pyx_n_s_ESSL); Py_CLEAR(clear_module_state->__pyx_n_s_EULER); Py_CLEAR(clear_module_state->__pyx_n_s_EXODUSII); Py_CLEAR(clear_module_state->__pyx_n_s_EXOTIC); Py_CLEAR(clear_module_state->__pyx_n_s_EXPLICIT); Py_CLEAR(clear_module_state->__pyx_n_s_EXTRUDE); Py_CLEAR(clear_module_state->__pyx_n_s_ElementType); Py_CLEAR(clear_module_state->__pyx_n_s_Ellipsis); Py_CLEAR(clear_module_state->__pyx_kp_s_Empty_shape_tuple_for_cython_arr); Py_CLEAR(clear_module_state->__pyx_kp_s_Enum_describing_mapping_behavior); Py_CLEAR(clear_module_state->__pyx_n_s_EquationType); Py_CLEAR(clear_module_state->__pyx_n_s_Error); Py_CLEAR(clear_module_state->__pyx_n_s_Error___bool); Py_CLEAR(clear_module_state->__pyx_n_s_Error___init); Py_CLEAR(clear_module_state->__pyx_n_s_Error___repr); Py_CLEAR(clear_module_state->__pyx_n_s_Error___str); Py_CLEAR(clear_module_state->__pyx_n_s_Event); Py_CLEAR(clear_module_state->__pyx_n_s_EventDecorator); Py_CLEAR(clear_module_state->__pyx_n_s_EventDecorator_locals_decorator); Py_CLEAR(clear_module_state->__pyx_n_s_EventDecorator_locals_decorator_2); Py_CLEAR(clear_module_state->__pyx_n_s_ExactFinalTime); Py_CLEAR(clear_module_state->__pyx_n_s_ExactFinalTimeOption); Py_CLEAR(clear_module_state->__pyx_kp_s_Expect_a_dltensor_field_pycapsul); Py_CLEAR(clear_module_state->__pyx_kp_s_Expect_a_dltensor_or_used_dltens); Py_CLEAR(clear_module_state->__pyx_n_s_FACTOR_NUMERIC_ZEROPIVOT); Py_CLEAR(clear_module_state->__pyx_n_s_FACTOR_OTHER); Py_CLEAR(clear_module_state->__pyx_n_s_FACTOR_OUTMEMORY); Py_CLEAR(clear_module_state->__pyx_n_s_FACTOR_STRUCT_ZEROPIVOT); Py_CLEAR(clear_module_state->__pyx_n_s_FAILED); Py_CLEAR(clear_module_state->__pyx_n_s_FAILED_ASCENT); Py_CLEAR(clear_module_state->__pyx_n_s_FAILED_BADPARAMETER); Py_CLEAR(clear_module_state->__pyx_n_s_FAILED_INFORNAN); Py_CLEAR(clear_module_state->__pyx_n_s_FALSE); Py_CLEAR(clear_module_state->__pyx_n_s_FAS); Py_CLEAR(clear_module_state->__pyx_n_s_FBCGS); Py_CLEAR(clear_module_state->__pyx_n_s_FBCGSR); Py_CLEAR(clear_module_state->__pyx_n_s_FCG); Py_CLEAR(clear_module_state->__pyx_n_s_FE); Py_CLEAR(clear_module_state->__pyx_n_s_FETIDP); Py_CLEAR(clear_module_state->__pyx_n_s_FEType); Py_CLEAR(clear_module_state->__pyx_n_s_FFT); Py_CLEAR(clear_module_state->__pyx_n_s_FFTW); Py_CLEAR(clear_module_state->__pyx_n_s_FGMRES); Py_CLEAR(clear_module_state->__pyx_n_s_FIELDSPLIT); Py_CLEAR(clear_module_state->__pyx_n_s_FINAL); Py_CLEAR(clear_module_state->__pyx_n_s_FINAL_ASSEMBLY); Py_CLEAR(clear_module_state->__pyx_n_s_FINAL_ONLY); Py_CLEAR(clear_module_state->__pyx_n_s_FLUSH); Py_CLEAR(clear_module_state->__pyx_n_s_FLUSH_ASSEMBLY); Py_CLEAR(clear_module_state->__pyx_n_s_FORCE_DIAGONAL_ENTRIES); Py_CLEAR(clear_module_state->__pyx_n_s_FOREST); Py_CLEAR(clear_module_state->__pyx_n_s_FORWARD); Py_CLEAR(clear_module_state->__pyx_n_s_FORWARD_LOCAL); Py_CLEAR(clear_module_state->__pyx_n_s_FORWARD_SWEEP); Py_CLEAR(clear_module_state->__pyx_n_s_FR); Py_CLEAR(clear_module_state->__pyx_n_s_FRB); Py_CLEAR(clear_module_state->__pyx_n_s_FROBENIUS); Py_CLEAR(clear_module_state->__pyx_n_s_FRONT); Py_CLEAR(clear_module_state->__pyx_n_s_FRONT_DOWN); Py_CLEAR(clear_module_state->__pyx_n_s_FRONT_DOWN_LEFT); Py_CLEAR(clear_module_state->__pyx_n_s_FRONT_DOWN_RIGHT); Py_CLEAR(clear_module_state->__pyx_n_s_FRONT_LEFT); Py_CLEAR(clear_module_state->__pyx_n_s_FRONT_RIGHT); Py_CLEAR(clear_module_state->__pyx_n_s_FRONT_UP); Py_CLEAR(clear_module_state->__pyx_n_s_FRONT_UP_LEFT); Py_CLEAR(clear_module_state->__pyx_n_s_FRONT_UP_RIGHT); Py_CLEAR(clear_module_state->__pyx_n_s_FULL); Py_CLEAR(clear_module_state->__pyx_n_s_FULL_SIZE); Py_CLEAR(clear_module_state->__pyx_n_s_FV_GHOST); Py_CLEAR(clear_module_state->__pyx_n_s_FactorShiftType); Py_CLEAR(clear_module_state->__pyx_kp_s_Factored_matrix_ordering_type_Se); Py_CLEAR(clear_module_state->__pyx_kp_s_Factored_matrix_shift_type_See_A); Py_CLEAR(clear_module_state->__pyx_kp_s_Factored_matrix_solver_type_See); Py_CLEAR(clear_module_state->__pyx_n_s_FailedReason); Py_CLEAR(clear_module_state->__pyx_n_s_FieldSplitSchurFactType); Py_CLEAR(clear_module_state->__pyx_n_s_FieldSplitSchurPreType); Py_CLEAR(clear_module_state->__pyx_n_s_FileMode); Py_CLEAR(clear_module_state->__pyx_n_s_Format); Py_CLEAR(clear_module_state->__pyx_n_s_Free); Py_CLEAR(clear_module_state->__pyx_n_s_G); Py_CLEAR(clear_module_state->__pyx_n_s_GALERKIN); Py_CLEAR(clear_module_state->__pyx_n_s_GAMG); Py_CLEAR(clear_module_state->__pyx_n_s_GAMGType); Py_CLEAR(clear_module_state->__pyx_n_s_GASM); Py_CLEAR(clear_module_state->__pyx_n_s_GASMType); Py_CLEAR(clear_module_state->__pyx_n_s_GATHER); Py_CLEAR(clear_module_state->__pyx_n_s_GATHERV); Py_CLEAR(clear_module_state->__pyx_n_s_GCR); Py_CLEAR(clear_module_state->__pyx_n_s_GCRODR); Py_CLEAR(clear_module_state->__pyx_n_s_GD); Py_CLEAR(clear_module_state->__pyx_n_s_GENERAL); Py_CLEAR(clear_module_state->__pyx_n_s_GEO); Py_CLEAR(clear_module_state->__pyx_n_s_GETROW_UPPERTRIANGULAR); Py_CLEAR(clear_module_state->__pyx_n_s_GHOSTED); Py_CLEAR(clear_module_state->__pyx_kp_s_GIT_Date); Py_CLEAR(clear_module_state->__pyx_n_s_GLEE); Py_CLEAR(clear_module_state->__pyx_n_s_GLLE); Py_CLEAR(clear_module_state->__pyx_n_s_GLMapMode); Py_CLEAR(clear_module_state->__pyx_n_s_GLOBAL_BLOCKING); Py_CLEAR(clear_module_state->__pyx_n_s_GLOBAL_MAX); Py_CLEAR(clear_module_state->__pyx_n_s_GLOBAL_NONBLOCKING); Py_CLEAR(clear_module_state->__pyx_n_s_GLOBAL_SUM); Py_CLEAR(clear_module_state->__pyx_n_s_GLTR); Py_CLEAR(clear_module_state->__pyx_n_s_GLVIS); Py_CLEAR(clear_module_state->__pyx_n_s_GMRES); Py_CLEAR(clear_module_state->__pyx_n_s_GPCG); Py_CLEAR(clear_module_state->__pyx_n_s_GROPPCG); Py_CLEAR(clear_module_state->__pyx_n_s_Get_rank); Py_CLEAR(clear_module_state->__pyx_n_s_Get_size); Py_CLEAR(clear_module_state->__pyx_kp_s_Given_d_column_indices_but_d_non); Py_CLEAR(clear_module_state->__pyx_n_s_H); Py_CLEAR(clear_module_state->__pyx_n_s_H2OPUS); Py_CLEAR(clear_module_state->__pyx_n_s_HAAR); Py_CLEAR(clear_module_state->__pyx_n_s_HALF); Py_CLEAR(clear_module_state->__pyx_n_s_HALF_SIZE); Py_CLEAR(clear_module_state->__pyx_n_s_HALTED_LOWERBOUND); Py_CLEAR(clear_module_state->__pyx_n_s_HALTED_MAXFCN); Py_CLEAR(clear_module_state->__pyx_n_s_HALTED_OTHER); Py_CLEAR(clear_module_state->__pyx_n_s_HALTED_RTOL); Py_CLEAR(clear_module_state->__pyx_n_s_HALTED_UPPERBOUND); Py_CLEAR(clear_module_state->__pyx_n_s_HALTED_USER); Py_CLEAR(clear_module_state->__pyx_n_s_HASH); Py_CLEAR(clear_module_state->__pyx_n_s_HDF5); Py_CLEAR(clear_module_state->__pyx_n_s_HDF5_MAT); Py_CLEAR(clear_module_state->__pyx_n_s_HDF5_PETSC); Py_CLEAR(clear_module_state->__pyx_n_s_HDF5_VIZ); Py_CLEAR(clear_module_state->__pyx_n_s_HDF5_XDMF); Py_CLEAR(clear_module_state->__pyx_n_s_HERMITIAN); Py_CLEAR(clear_module_state->__pyx_n_s_HERMITIANTRANSPOSE); Py_CLEAR(clear_module_state->__pyx_n_s_HEXAHEDRON); Py_CLEAR(clear_module_state->__pyx_n_s_HIP); Py_CLEAR(clear_module_state->__pyx_n_s_HMG); Py_CLEAR(clear_module_state->__pyx_n_s_HOST); Py_CLEAR(clear_module_state->__pyx_n_s_HPDDM); Py_CLEAR(clear_module_state->__pyx_n_s_HPDDMCoarseCorrectionType); Py_CLEAR(clear_module_state->__pyx_n_s_HPDDMType); Py_CLEAR(clear_module_state->__pyx_n_s_HS); Py_CLEAR(clear_module_state->__pyx_n_s_HYPRE); Py_CLEAR(clear_module_state->__pyx_n_s_HYPRESSTRUCT); Py_CLEAR(clear_module_state->__pyx_n_s_HYPRESTRUCT); Py_CLEAR(clear_module_state->__pyx_n_s_HZ); Py_CLEAR(clear_module_state->__pyx_n_s_I); Py_CLEAR(clear_module_state->__pyx_n_s_IBCGS); Py_CLEAR(clear_module_state->__pyx_n_s_ICC); Py_CLEAR(clear_module_state->__pyx_n_s_IGNORE_LOWER_TRIANGULAR); Py_CLEAR(clear_module_state->__pyx_n_s_IGNORE_NEGATIVE_INDICES); Py_CLEAR(clear_module_state->__pyx_n_s_IGNORE_OFF_PROC_ENTRIES); Py_CLEAR(clear_module_state->__pyx_n_s_IGNORE_ZERO_ENTRIES); Py_CLEAR(clear_module_state->__pyx_n_s_ILU); Py_CLEAR(clear_module_state->__pyx_n_s_IMPLICIT); Py_CLEAR(clear_module_state->__pyx_n_s_INBLOCKS); Py_CLEAR(clear_module_state->__pyx_n_s_INF); Py_CLEAR(clear_module_state->__pyx_n_s_INFINITY); Py_CLEAR(clear_module_state->__pyx_n_s_INITIAL_FINAL_ONLY); Py_CLEAR(clear_module_state->__pyx_n_s_INITIAL_ONLY); Py_CLEAR(clear_module_state->__pyx_n_s_INSERT); Py_CLEAR(clear_module_state->__pyx_n_s_INSERT_ALL); Py_CLEAR(clear_module_state->__pyx_n_s_INSERT_ALL_VALUES); Py_CLEAR(clear_module_state->__pyx_n_s_INSERT_BC); Py_CLEAR(clear_module_state->__pyx_n_s_INSERT_BC_VALUES); Py_CLEAR(clear_module_state->__pyx_n_s_INSERT_VALUES); Py_CLEAR(clear_module_state->__pyx_n_s_INTERIOR_GHOST); Py_CLEAR(clear_module_state->__pyx_n_s_INTERPOLATE); Py_CLEAR(clear_module_state->__pyx_n_s_IPM); Py_CLEAR(clear_module_state->__pyx_n_s_IS); Py_CLEAR(clear_module_state->__pyx_n_s_ISType); Py_CLEAR(clear_module_state->__pyx_n_s_IS_buffer); Py_CLEAR(clear_module_state->__pyx_n_s_ITERATING); Py_CLEAR(clear_module_state->__pyx_kp_s_I_0_is_d_expected_d); Py_CLEAR(clear_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0); Py_CLEAR(clear_module_state->__pyx_n_s_IndexError); Py_CLEAR(clear_module_state->__pyx_kp_s_Index_out_of_bounds_axis_d); Py_CLEAR(clear_module_state->__pyx_kp_s_Indirect_dimensions_not_supporte); Py_CLEAR(clear_module_state->__pyx_n_s_InfoType); Py_CLEAR(clear_module_state->__pyx_kp_s_Input_vector_has_no_tensor_infor); Py_CLEAR(clear_module_state->__pyx_n_s_InsertMode); Py_CLEAR(clear_module_state->__pyx_kp_s_Insertion_mode_Most_commonly_use); Py_CLEAR(clear_module_state->__pyx_n_s_IntType); Py_CLEAR(clear_module_state->__pyx_n_s_InterpolationType); Py_CLEAR(clear_module_state->__pyx_kp_u_Invalid_mode_expected_c_or_fortr); Py_CLEAR(clear_module_state->__pyx_kp_s_Invalid_mode_expected_r_w_or_rw); Py_CLEAR(clear_module_state->__pyx_kp_s_Invalid_mode_expected_rw_r_or_w); Py_CLEAR(clear_module_state->__pyx_kp_u_Invalid_shape_in_axis); Py_CLEAR(clear_module_state->__pyx_n_s_J); Py_CLEAR(clear_module_state->__pyx_n_s_JACOBI); Py_CLEAR(clear_module_state->__pyx_n_s_JoinMode); Py_CLEAR(clear_module_state->__pyx_n_s_KACZMARZ); Py_CLEAR(clear_module_state->__pyx_n_s_KAIJ); Py_CLEAR(clear_module_state->__pyx_n_s_KASKADE); Py_CLEAR(clear_module_state->__pyx_n_s_KD); Py_CLEAR(clear_module_state->__pyx_n_s_KEEP_NONZERO_PATTERN); Py_CLEAR(clear_module_state->__pyx_n_s_KLU); Py_CLEAR(clear_module_state->__pyx_n_s_KOKKOS); Py_CLEAR(clear_module_state->__pyx_n_s_KSP); Py_CLEAR(clear_module_state->__pyx_n_s_KSPConvergedReason); Py_CLEAR(clear_module_state->__pyx_n_s_KSPHPDDMType); Py_CLEAR(clear_module_state->__pyx_n_s_KSPNormType); Py_CLEAR(clear_module_state->__pyx_n_s_KSPONLY); Py_CLEAR(clear_module_state->__pyx_n_s_KSPTRANSPOSEONLY); Py_CLEAR(clear_module_state->__pyx_n_s_KSPType); Py_CLEAR(clear_module_state->__pyx_kp_s_KSP_Converged_Reason_CONVERGED_I); Py_CLEAR(clear_module_state->__pyx_kp_s_KSP_Type_The_available_types_are); Py_CLEAR(clear_module_state->__pyx_kp_s_KSP_norm_type_The_available_norm); Py_CLEAR(clear_module_state->__pyx_n_s_KeyError); Py_CLEAR(clear_module_state->__pyx_n_s_L); Py_CLEAR(clear_module_state->__pyx_n_s_LAGRANGE); Py_CLEAR(clear_module_state->__pyx_n_s_LAYOUT_GAUSS); Py_CLEAR(clear_module_state->__pyx_n_s_LAYOUT_REGULAR); Py_CLEAR(clear_module_state->__pyx_n_s_LAYOUT_SUBDIVISION); Py_CLEAR(clear_module_state->__pyx_n_s_LCD); Py_CLEAR(clear_module_state->__pyx_n_s_LCL); Py_CLEAR(clear_module_state->__pyx_n_s_LEFT); Py_CLEAR(clear_module_state->__pyx_n_s_LGMRES); Py_CLEAR(clear_module_state->__pyx_n_s_LGMap); Py_CLEAR(clear_module_state->__pyx_n_s_LGMapType); Py_CLEAR(clear_module_state->__pyx_n_s_LINEAR); Py_CLEAR(clear_module_state->__pyx_n_s_LMVM); Py_CLEAR(clear_module_state->__pyx_n_s_LMVMBADBROYDEN); Py_CLEAR(clear_module_state->__pyx_n_s_LMVMBFGS); Py_CLEAR(clear_module_state->__pyx_n_s_LMVMBROYDEN); Py_CLEAR(clear_module_state->__pyx_n_s_LMVMDFP); Py_CLEAR(clear_module_state->__pyx_n_s_LMVMDIAGBBROYDEN); Py_CLEAR(clear_module_state->__pyx_n_s_LMVMSR1); Py_CLEAR(clear_module_state->__pyx_n_s_LMVMSYMBADBROYDEN); Py_CLEAR(clear_module_state->__pyx_n_s_LMVMSYMBROYDEN); Py_CLEAR(clear_module_state->__pyx_n_s_LOAD_BALANCE); Py_CLEAR(clear_module_state->__pyx_n_s_LOCAL); Py_CLEAR(clear_module_state->__pyx_n_s_LOCALREF); Py_CLEAR(clear_module_state->__pyx_n_s_LOCAL_BACKWARD_SWEEP); Py_CLEAR(clear_module_state->__pyx_n_s_LOCAL_FORWARD_SWEEP); Py_CLEAR(clear_module_state->__pyx_n_s_LOCAL_SYMMETRIC_SWEEP); Py_CLEAR(clear_module_state->__pyx_n_s_LOWER); Py_CLEAR(clear_module_state->__pyx_n_s_LRC); Py_CLEAR(clear_module_state->__pyx_n_s_LSC); Py_CLEAR(clear_module_state->__pyx_n_s_LSQR); Py_CLEAR(clear_module_state->__pyx_n_s_LU); Py_CLEAR(clear_module_state->__pyx_n_s_LUSOL); Py_CLEAR(clear_module_state->__pyx_n_s_Left); Py_CLEAR(clear_module_state->__pyx_n_s_Log); Py_CLEAR(clear_module_state->__pyx_n_s_LogClass); Py_CLEAR(clear_module_state->__pyx_n_s_LogEvent); Py_CLEAR(clear_module_state->__pyx_n_s_LogStage); Py_CLEAR(clear_module_state->__pyx_n_s_MAIJ); Py_CLEAR(clear_module_state->__pyx_n_s_MAPPING); Py_CLEAR(clear_module_state->__pyx_n_s_MASK); Py_CLEAR(clear_module_state->__pyx_n_s_MAT); Py_CLEAR(clear_module_state->__pyx_n_s_MATCHSTEP); Py_CLEAR(clear_module_state->__pyx_n_s_MATHEMATICA); Py_CLEAR(clear_module_state->__pyx_n_s_MATLAB); Py_CLEAR(clear_module_state->__pyx_n_s_MATPARTITIONING); Py_CLEAR(clear_module_state->__pyx_n_s_MAX); Py_CLEAR(clear_module_state->__pyx_n_s_MAX_VALUES); Py_CLEAR(clear_module_state->__pyx_n_s_MEMORYSCALABLE); Py_CLEAR(clear_module_state->__pyx_n_s_METISND); Py_CLEAR(clear_module_state->__pyx_n_s_MEYER); Py_CLEAR(clear_module_state->__pyx_n_s_MFFD); Py_CLEAR(clear_module_state->__pyx_n_s_MG); Py_CLEAR(clear_module_state->__pyx_n_s_MGCycleType); Py_CLEAR(clear_module_state->__pyx_n_s_MGType); Py_CLEAR(clear_module_state->__pyx_n_s_MIGRATE_BASIC); Py_CLEAR(clear_module_state->__pyx_n_s_MIGRATE_DMCELLEXACT); Py_CLEAR(clear_module_state->__pyx_n_s_MIGRATE_DMCELLNSCATTER); Py_CLEAR(clear_module_state->__pyx_n_s_MIGRATE_USER); Py_CLEAR(clear_module_state->__pyx_n_s_MIMEX); Py_CLEAR(clear_module_state->__pyx_n_s_MINRES); Py_CLEAR(clear_module_state->__pyx_n_s_MIRROR); Py_CLEAR(clear_module_state->__pyx_n_s_MKL_CPARDISO); Py_CLEAR(clear_module_state->__pyx_n_s_MKL_PARDISO); Py_CLEAR(clear_module_state->__pyx_n_s_ML); Py_CLEAR(clear_module_state->__pyx_n_s_MOAB); Py_CLEAR(clear_module_state->__pyx_n_s_MORETHUENTE); Py_CLEAR(clear_module_state->__pyx_n_s_MPI); Py_CLEAR(clear_module_state->__pyx_n_s_MPIADJ); Py_CLEAR(clear_module_state->__pyx_n_s_MPIAIJ); Py_CLEAR(clear_module_state->__pyx_n_s_MPIAIJCRL); Py_CLEAR(clear_module_state->__pyx_n_s_MPIAIJCUSPARSE); Py_CLEAR(clear_module_state->__pyx_n_s_MPIAIJMKL); Py_CLEAR(clear_module_state->__pyx_n_s_MPIAIJPERM); Py_CLEAR(clear_module_state->__pyx_n_s_MPIAIJSELL); Py_CLEAR(clear_module_state->__pyx_n_s_MPIAIJVIENNACL); Py_CLEAR(clear_module_state->__pyx_n_s_MPIBAIJ); Py_CLEAR(clear_module_state->__pyx_n_s_MPIBAIJMKL); Py_CLEAR(clear_module_state->__pyx_n_s_MPICUDA); Py_CLEAR(clear_module_state->__pyx_n_s_MPIDENSE); Py_CLEAR(clear_module_state->__pyx_n_s_MPIDENSECUDA); Py_CLEAR(clear_module_state->__pyx_n_s_MPIHIP); Py_CLEAR(clear_module_state->__pyx_n_s_MPIKAIJ); Py_CLEAR(clear_module_state->__pyx_n_s_MPIKOKKOS); Py_CLEAR(clear_module_state->__pyx_n_s_MPIMAIJ); Py_CLEAR(clear_module_state->__pyx_n_s_MPISBAIJ); Py_CLEAR(clear_module_state->__pyx_n_s_MPISELL); Py_CLEAR(clear_module_state->__pyx_n_s_MPIVIENNACL); Py_CLEAR(clear_module_state->__pyx_n_s_MPRK); Py_CLEAR(clear_module_state->__pyx_n_s_MS); Py_CLEAR(clear_module_state->__pyx_n_s_MULTIPLICATIVE); Py_CLEAR(clear_module_state->__pyx_n_s_MUMPS); Py_CLEAR(clear_module_state->__pyx_n_s_MapMode); Py_CLEAR(clear_module_state->__pyx_n_s_Mat); Py_CLEAR(clear_module_state->__pyx_n_s_MatAssemblyType); Py_CLEAR(clear_module_state->__pyx_n_s_MatDuplicateOption); Py_CLEAR(clear_module_state->__pyx_n_s_MatFactorShiftType); Py_CLEAR(clear_module_state->__pyx_n_s_MatInfoType); Py_CLEAR(clear_module_state->__pyx_n_s_MatOption); Py_CLEAR(clear_module_state->__pyx_n_s_MatOrderingType); Py_CLEAR(clear_module_state->__pyx_n_s_MatPartitioning); Py_CLEAR(clear_module_state->__pyx_n_s_MatPartitioningType); Py_CLEAR(clear_module_state->__pyx_n_s_MatSORType); Py_CLEAR(clear_module_state->__pyx_n_s_MatSolverType); Py_CLEAR(clear_module_state->__pyx_n_s_MatStructure); Py_CLEAR(clear_module_state->__pyx_n_s_MatType); Py_CLEAR(clear_module_state->__pyx_kp_s_Matrix_SOR_type_See_Also_petsc_M); Py_CLEAR(clear_module_state->__pyx_kp_s_Matrix_assembly_type_See_Also_pe); Py_CLEAR(clear_module_state->__pyx_kp_s_Matrix_duplicate_option_See_Also); Py_CLEAR(clear_module_state->__pyx_kp_s_Matrix_info_type); Py_CLEAR(clear_module_state->__pyx_kp_s_Matrix_modification_structure_Se); Py_CLEAR(clear_module_state->__pyx_kp_s_Matrix_option_See_Also_petsc_Mat); Py_CLEAR(clear_module_state->__pyx_kp_s_Matrix_type_See_Also_petsc_MatTy); Py_CLEAR(clear_module_state->__pyx_n_s_MemoryError); Py_CLEAR(clear_module_state->__pyx_kp_s_MemoryView_of_r_at_0x_x); Py_CLEAR(clear_module_state->__pyx_kp_s_MemoryView_of_r_object); Py_CLEAR(clear_module_state->__pyx_n_s_MigrateType); Py_CLEAR(clear_module_state->__pyx_kp_s_Missing_input_parameters); Py_CLEAR(clear_module_state->__pyx_n_s_Mode); Py_CLEAR(clear_module_state->__pyx_kp_s_More_constants_INFINITY_Very_la); Py_CLEAR(clear_module_state->__pyx_kp_s_Must_provide_as_many_communicato); Py_CLEAR(clear_module_state->__pyx_kp_s_Must_provide_both_sizes_and_poin); Py_CLEAR(clear_module_state->__pyx_kp_s_Must_provide_operator_for_USER_o); Py_CLEAR(clear_module_state->__pyx_n_s_N1); Py_CLEAR(clear_module_state->__pyx_n_s_N12); Py_CLEAR(clear_module_state->__pyx_n_s_N2); Py_CLEAR(clear_module_state->__pyx_n_s_NASH); Py_CLEAR(clear_module_state->__pyx_n_s_NASM); Py_CLEAR(clear_module_state->__pyx_n_s_NATIVE); Py_CLEAR(clear_module_state->__pyx_n_s_NATURAL); Py_CLEAR(clear_module_state->__pyx_n_s_NCG); Py_CLEAR(clear_module_state->__pyx_n_s_ND); Py_CLEAR(clear_module_state->__pyx_n_s_ND_Pi); Py_CLEAR(clear_module_state->__pyx_n_s_ND_Pi_Full); Py_CLEAR(clear_module_state->__pyx_n_s_NEIGHBOR); Py_CLEAR(clear_module_state->__pyx_n_s_NEST); Py_CLEAR(clear_module_state->__pyx_n_s_NETWORK); Py_CLEAR(clear_module_state->__pyx_n_s_NEWTONLS); Py_CLEAR(clear_module_state->__pyx_n_s_NEWTONTR); Py_CLEAR(clear_module_state->__pyx_n_s_NEW_NONZERO_ALLOCATION_ERR); Py_CLEAR(clear_module_state->__pyx_n_s_NEW_NONZERO_LOCATIONS); Py_CLEAR(clear_module_state->__pyx_n_s_NEW_NONZERO_LOCATION_ERR); Py_CLEAR(clear_module_state->__pyx_n_s_NGMRES); Py_CLEAR(clear_module_state->__pyx_n_s_NGS); Py_CLEAR(clear_module_state->__pyx_n_s_NINFINITY); Py_CLEAR(clear_module_state->__pyx_n_s_NLS); Py_CLEAR(clear_module_state->__pyx_n_s_NM); Py_CLEAR(clear_module_state->__pyx_n_s_NN); Py_CLEAR(clear_module_state->__pyx_n_s_NO); Py_CLEAR(clear_module_state->__pyx_n_s_NOERROR); Py_CLEAR(clear_module_state->__pyx_n_s_NOFORMAT); Py_CLEAR(clear_module_state->__pyx_n_s_NONE); Py_CLEAR(clear_module_state->__pyx_n_s_NONLINEAR); Py_CLEAR(clear_module_state->__pyx_n_s_NONZERO); Py_CLEAR(clear_module_state->__pyx_n_s_NORMAL); Py_CLEAR(clear_module_state->__pyx_n_s_NORMALHERMITIAN); Py_CLEAR(clear_module_state->__pyx_n_s_NORM_1); Py_CLEAR(clear_module_state->__pyx_n_s_NORM_1_AND_2); Py_CLEAR(clear_module_state->__pyx_n_s_NORM_2); Py_CLEAR(clear_module_state->__pyx_n_s_NORM_ALWAYS); Py_CLEAR(clear_module_state->__pyx_n_s_NORM_DEFAULT); Py_CLEAR(clear_module_state->__pyx_n_s_NORM_FINAL_ONLY); Py_CLEAR(clear_module_state->__pyx_n_s_NORM_FROBENIUS); Py_CLEAR(clear_module_state->__pyx_n_s_NORM_INFINITY); Py_CLEAR(clear_module_state->__pyx_n_s_NORM_INITIAL_FINAL_ONLY); Py_CLEAR(clear_module_state->__pyx_n_s_NORM_INITIAL_ONLY); Py_CLEAR(clear_module_state->__pyx_n_s_NORM_MAX); Py_CLEAR(clear_module_state->__pyx_n_s_NORM_NATURAL); Py_CLEAR(clear_module_state->__pyx_n_s_NORM_NONE); Py_CLEAR(clear_module_state->__pyx_n_s_NORM_PRECONDITIONED); Py_CLEAR(clear_module_state->__pyx_n_s_NORM_UNPRECONDITIONED); Py_CLEAR(clear_module_state->__pyx_n_s_NOTSET); Py_CLEAR(clear_module_state->__pyx_n_s_NOT_SET_VALUES); Py_CLEAR(clear_module_state->__pyx_n_s_NO_OFF_PROC_ENTRIES); Py_CLEAR(clear_module_state->__pyx_n_s_NO_OFF_PROC_ZERO_ROWS); Py_CLEAR(clear_module_state->__pyx_n_s_NO_SYNC); Py_CLEAR(clear_module_state->__pyx_n_s_NRICHARDSON); Py_CLEAR(clear_module_state->__pyx_n_s_NTL); Py_CLEAR(clear_module_state->__pyx_n_s_NTR); Py_CLEAR(clear_module_state->__pyx_n_s_NULLLOC); Py_CLEAR(clear_module_state->__pyx_n_s_NZ); Py_CLEAR(clear_module_state->__pyx_n_s_NormSchedule); Py_CLEAR(clear_module_state->__pyx_n_s_NormType); Py_CLEAR(clear_module_state->__pyx_kp_s_Norm_type_Commonly_used_norm_typ); Py_CLEAR(clear_module_state->__pyx_n_s_NotImplemented); Py_CLEAR(clear_module_state->__pyx_n_s_NotImplementedError); Py_CLEAR(clear_module_state->__pyx_kp_s_Not_for_rectangular_matrices); Py_CLEAR(clear_module_state->__pyx_kp_s_Not_for_type); Py_CLEAR(clear_module_state->__pyx_n_s_NullSpace); Py_CLEAR(clear_module_state->__pyx_n_b_O); Py_CLEAR(clear_module_state->__pyx_n_s_ODE_EXPLICIT); Py_CLEAR(clear_module_state->__pyx_n_s_ODE_IMPLICIT); Py_CLEAR(clear_module_state->__pyx_n_s_OPENCL); Py_CLEAR(clear_module_state->__pyx_n_s_OPTION_MAX); Py_CLEAR(clear_module_state->__pyx_n_s_OPTION_MIN); Py_CLEAR(clear_module_state->__pyx_n_s_OWARMIJO); Py_CLEAR(clear_module_state->__pyx_n_s_OWD); Py_CLEAR(clear_module_state->__pyx_n_s_OWLQN); Py_CLEAR(clear_module_state->__pyx_n_s_Object); Py_CLEAR(clear_module_state->__pyx_kp_s_Object_is_not_writable); Py_CLEAR(clear_module_state->__pyx_n_s_Option); Py_CLEAR(clear_module_state->__pyx_n_s_Options); Py_CLEAR(clear_module_state->__pyx_n_s_OrderingType); Py_CLEAR(clear_module_state->__pyx_kp_u_Out_of_bounds_on_buffer_access_a); Py_CLEAR(clear_module_state->__pyx_kp_s_Out_of_memory_Allocated_d_Used_b); Py_CLEAR(clear_module_state->__pyx_n_s_P); Py_CLEAR(clear_module_state->__pyx_n_s_P1); Py_CLEAR(clear_module_state->__pyx_n_s_P4EST); Py_CLEAR(clear_module_state->__pyx_n_s_P8EST); Py_CLEAR(clear_module_state->__pyx_n_s_PARDECOMP); Py_CLEAR(clear_module_state->__pyx_n_s_PARMETIS); Py_CLEAR(clear_module_state->__pyx_n_s_PARMS); Py_CLEAR(clear_module_state->__pyx_n_s_PARTITIONINGAVERAGE); Py_CLEAR(clear_module_state->__pyx_n_s_PARTITIONINGCHACO); Py_CLEAR(clear_module_state->__pyx_n_s_PARTITIONINGCURRENT); Py_CLEAR(clear_module_state->__pyx_n_s_PARTITIONINGHIERARCH); Py_CLEAR(clear_module_state->__pyx_n_s_PARTITIONINGPARMETIS); Py_CLEAR(clear_module_state->__pyx_n_s_PARTITIONINGPARTY); Py_CLEAR(clear_module_state->__pyx_n_s_PARTITIONINGPTSCOTCH); Py_CLEAR(clear_module_state->__pyx_n_s_PARTITIONINGSQUARE); Py_CLEAR(clear_module_state->__pyx_n_s_PASTIX); Py_CLEAR(clear_module_state->__pyx_n_s_PATCH); Py_CLEAR(clear_module_state->__pyx_n_s_PBJACOBI); Py_CLEAR(clear_module_state->__pyx_n_s_PC); Py_CLEAR(clear_module_state->__pyx_n_s_PCASMType); Py_CLEAR(clear_module_state->__pyx_n_s_PCCompositeType); Py_CLEAR(clear_module_state->__pyx_n_s_PCDeflationSpaceType); Py_CLEAR(clear_module_state->__pyx_n_s_PCFailedReason); Py_CLEAR(clear_module_state->__pyx_n_s_PCFieldSplitSchurFactType); Py_CLEAR(clear_module_state->__pyx_n_s_PCFieldSplitSchurPreType); Py_CLEAR(clear_module_state->__pyx_n_s_PCGAMGType); Py_CLEAR(clear_module_state->__pyx_n_s_PCGASMType); Py_CLEAR(clear_module_state->__pyx_n_s_PCGD); Py_CLEAR(clear_module_state->__pyx_n_s_PCHPDDMCoarseCorrectionType); Py_CLEAR(clear_module_state->__pyx_n_s_PCMGCycleType); Py_CLEAR(clear_module_state->__pyx_n_s_PCMGType); Py_CLEAR(clear_module_state->__pyx_n_s_PCPatchConstructType); Py_CLEAR(clear_module_state->__pyx_n_s_PCSide); Py_CLEAR(clear_module_state->__pyx_n_s_PCType); Py_CLEAR(clear_module_state->__pyx_n_s_PD); Py_CLEAR(clear_module_state->__pyx_n_s_PDIPM); Py_CLEAR(clear_module_state->__pyx_n_s_PERIODIC); Py_CLEAR(clear_module_state->__pyx_n_s_PETSC); Py_CLEAR(clear_module_state->__pyx_kp_s_PETSc_Error_Attributes_ierr_int); Py_CLEAR(clear_module_state->__pyx_kp_s_PETSc_Error_d); Py_CLEAR(clear_module_state->__pyx_n_s_PFMG); Py_CLEAR(clear_module_state->__pyx_n_s_PGMRES); Py_CLEAR(clear_module_state->__pyx_n_s_PIC); Py_CLEAR(clear_module_state->__pyx_n_s_PICLayoutType); Py_CLEAR(clear_module_state->__pyx_n_s_PINFINITY); Py_CLEAR(clear_module_state->__pyx_n_s_PIPEBCGS); Py_CLEAR(clear_module_state->__pyx_n_s_PIPECG); Py_CLEAR(clear_module_state->__pyx_n_s_PIPECG2); Py_CLEAR(clear_module_state->__pyx_n_s_PIPECGRR); Py_CLEAR(clear_module_state->__pyx_n_s_PIPECR); Py_CLEAR(clear_module_state->__pyx_n_s_PIPEFCG); Py_CLEAR(clear_module_state->__pyx_n_s_PIPEFGMRES); Py_CLEAR(clear_module_state->__pyx_n_s_PIPEGCR); Py_CLEAR(clear_module_state->__pyx_n_s_PIPELCG); Py_CLEAR(clear_module_state->__pyx_n_s_PIPEPRCG); Py_CLEAR(clear_module_state->__pyx_n_s_PLEX); Py_CLEAR(clear_module_state->__pyx_n_s_POINT); Py_CLEAR(clear_module_state->__pyx_n_s_POINT_PRISM_TENSOR); Py_CLEAR(clear_module_state->__pyx_n_s_POLYNOMIAL); Py_CLEAR(clear_module_state->__pyx_n_s_POSITIVE_DEFINITE); Py_CLEAR(clear_module_state->__pyx_n_s_POUNDERS); Py_CLEAR(clear_module_state->__pyx_n_s_PREALLOCATOR); Py_CLEAR(clear_module_state->__pyx_n_s_PRECONDITIONED); Py_CLEAR(clear_module_state->__pyx_n_s_PREONLY); Py_CLEAR(clear_module_state->__pyx_n_s_PRODUCT); Py_CLEAR(clear_module_state->__pyx_n_s_PRP); Py_CLEAR(clear_module_state->__pyx_n_s_PRP_PLUS); Py_CLEAR(clear_module_state->__pyx_n_s_PSEUDO); Py_CLEAR(clear_module_state->__pyx_n_s_PTRIMMED); Py_CLEAR(clear_module_state->__pyx_n_s_PTSCOTCH); Py_CLEAR(clear_module_state->__pyx_n_s_PYRAMID); Py_CLEAR(clear_module_state->__pyx_n_s_PYTHON); Py_CLEAR(clear_module_state->__pyx_n_s_Partitioner); Py_CLEAR(clear_module_state->__pyx_n_s_PartitionerType); Py_CLEAR(clear_module_state->__pyx_n_s_PatchConstructType); Py_CLEAR(clear_module_state->__pyx_n_s_PickleError); Py_CLEAR(clear_module_state->__pyx_n_s_PolytopeType); Py_CLEAR(clear_module_state->__pyx_kp_s_Portable_Extensible_Toolkit_for); Py_CLEAR(clear_module_state->__pyx_n_s_Print); Py_CLEAR(clear_module_state->__pyx_n_s_ProblemType); Py_CLEAR(clear_module_state->__pyx_n_s_PtAP); Py_CLEAR(clear_module_state->__pyx_n_s_Q0); Py_CLEAR(clear_module_state->__pyx_n_s_Q1); Py_CLEAR(clear_module_state->__pyx_n_s_QCG); Py_CLEAR(clear_module_state->__pyx_n_s_QMD); Py_CLEAR(clear_module_state->__pyx_n_s_QMRCGS); Py_CLEAR(clear_module_state->__pyx_n_s_QN); Py_CLEAR(clear_module_state->__pyx_n_s_QR); Py_CLEAR(clear_module_state->__pyx_n_s_QUADRILATERAL); Py_CLEAR(clear_module_state->__pyx_n_s_QUAD_PRISM_TENSOR); Py_CLEAR(clear_module_state->__pyx_n_s_QUARTER); Py_CLEAR(clear_module_state->__pyx_n_s_QUARTER_SIZE); Py_CLEAR(clear_module_state->__pyx_n_s_Quad); Py_CLEAR(clear_module_state->__pyx_n_s_R); Py_CLEAR(clear_module_state->__pyx_n_s_RADAU5); Py_CLEAR(clear_module_state->__pyx_n_s_RAND); Py_CLEAR(clear_module_state->__pyx_n_s_RAND48); Py_CLEAR(clear_module_state->__pyx_n_s_RANDER48); Py_CLEAR(clear_module_state->__pyx_n_s_RANDOM123); Py_CLEAR(clear_module_state->__pyx_n_s_RARt); Py_CLEAR(clear_module_state->__pyx_n_s_RCM); Py_CLEAR(clear_module_state->__pyx_n_s_READ); Py_CLEAR(clear_module_state->__pyx_n_s_REDISTRIBUTE); Py_CLEAR(clear_module_state->__pyx_n_s_REDUNDANT); Py_CLEAR(clear_module_state->__pyx_n_s_REFINE1D); Py_CLEAR(clear_module_state->__pyx_n_s_REFINEALFELD); Py_CLEAR(clear_module_state->__pyx_n_s_REFINEBOUNDARYLAYER); Py_CLEAR(clear_module_state->__pyx_n_s_REFINED); Py_CLEAR(clear_module_state->__pyx_n_s_REFINEPOWELLSABIN); Py_CLEAR(clear_module_state->__pyx_n_s_REFINEREGULAR); Py_CLEAR(clear_module_state->__pyx_n_s_REFINESBR); Py_CLEAR(clear_module_state->__pyx_n_s_REFINETOBOX); Py_CLEAR(clear_module_state->__pyx_n_s_REFINETOSIMPLEX); Py_CLEAR(clear_module_state->__pyx_n_s_RESTRICT); Py_CLEAR(clear_module_state->__pyx_n_s_REVERSE); Py_CLEAR(clear_module_state->__pyx_n_s_REVERSE_LOCAL); Py_CLEAR(clear_module_state->__pyx_n_s_RICHARDSON); Py_CLEAR(clear_module_state->__pyx_n_s_RIGHT); Py_CLEAR(clear_module_state->__pyx_n_s_RK); Py_CLEAR(clear_module_state->__pyx_n_s_RK1FE); Py_CLEAR(clear_module_state->__pyx_n_s_RK2A); Py_CLEAR(clear_module_state->__pyx_n_s_RK2B); Py_CLEAR(clear_module_state->__pyx_n_s_RK3); Py_CLEAR(clear_module_state->__pyx_n_s_RK3BS); Py_CLEAR(clear_module_state->__pyx_n_s_RK4); Py_CLEAR(clear_module_state->__pyx_n_s_RK5BS); Py_CLEAR(clear_module_state->__pyx_n_s_RK5DP); Py_CLEAR(clear_module_state->__pyx_n_s_RK5F); Py_CLEAR(clear_module_state->__pyx_n_s_RK6VR); Py_CLEAR(clear_module_state->__pyx_n_s_RK7VR); Py_CLEAR(clear_module_state->__pyx_n_s_RK8VR); Py_CLEAR(clear_module_state->__pyx_n_s_RKType); Py_CLEAR(clear_module_state->__pyx_n_s_ROSW); Py_CLEAR(clear_module_state->__pyx_n_s_ROWLENGTH); Py_CLEAR(clear_module_state->__pyx_n_s_ROWSCALINGVIENNACL); Py_CLEAR(clear_module_state->__pyx_n_s_ROW_ORIENTED); Py_CLEAR(clear_module_state->__pyx_n_s_RT_Pi); Py_CLEAR(clear_module_state->__pyx_n_s_RT_Pi_Full); Py_CLEAR(clear_module_state->__pyx_n_s_RUNGE_KUTTA); Py_CLEAR(clear_module_state->__pyx_n_s_Random); Py_CLEAR(clear_module_state->__pyx_n_s_RandomType); Py_CLEAR(clear_module_state->__pyx_n_s_RealType); Py_CLEAR(clear_module_state->__pyx_n_s_Reason); Py_CLEAR(clear_module_state->__pyx_n_s_ReorderDefaultFlag); Py_CLEAR(clear_module_state->__pyx_n_s_Right); Py_CLEAR(clear_module_state->__pyx_n_s_RuntimeError); Py_CLEAR(clear_module_state->__pyx_n_s_S); Py_CLEAR(clear_module_state->__pyx_n_s_SAME); Py_CLEAR(clear_module_state->__pyx_n_s_SAME_NONZERO_PATTERN); Py_CLEAR(clear_module_state->__pyx_n_s_SAME_NZ); Py_CLEAR(clear_module_state->__pyx_n_s_SAVIENNACL); Py_CLEAR(clear_module_state->__pyx_n_s_SAWS); Py_CLEAR(clear_module_state->__pyx_n_s_SBAIJ); Py_CLEAR(clear_module_state->__pyx_n_s_SCALAPACK); Py_CLEAR(clear_module_state->__pyx_n_s_SCATTER); Py_CLEAR(clear_module_state->__pyx_n_s_SCATTER_FORWARD); Py_CLEAR(clear_module_state->__pyx_n_s_SCATTER_FORWARD_LOCAL); Py_CLEAR(clear_module_state->__pyx_n_s_SCATTER_REVERSE); Py_CLEAR(clear_module_state->__pyx_n_s_SCATTER_REVERSE_LOCAL); Py_CLEAR(clear_module_state->__pyx_n_s_SCHUR); Py_CLEAR(clear_module_state->__pyx_n_s_SCHURCOMPLEMENT); Py_CLEAR(clear_module_state->__pyx_n_s_SEGMENT); Py_CLEAR(clear_module_state->__pyx_n_s_SEG_PRISM_TENSOR); Py_CLEAR(clear_module_state->__pyx_n_s_SELF); Py_CLEAR(clear_module_state->__pyx_n_s_SELFP); Py_CLEAR(clear_module_state->__pyx_n_s_SELL); Py_CLEAR(clear_module_state->__pyx_n_s_SEQ); Py_CLEAR(clear_module_state->__pyx_n_s_SEQAIJ); Py_CLEAR(clear_module_state->__pyx_n_s_SEQAIJCRL); Py_CLEAR(clear_module_state->__pyx_n_s_SEQAIJCUSPARSE); Py_CLEAR(clear_module_state->__pyx_n_s_SEQAIJMKL); Py_CLEAR(clear_module_state->__pyx_n_s_SEQAIJPERM); Py_CLEAR(clear_module_state->__pyx_n_s_SEQAIJSELL); Py_CLEAR(clear_module_state->__pyx_n_s_SEQAIJVIENNACL); Py_CLEAR(clear_module_state->__pyx_n_s_SEQBAIJ); Py_CLEAR(clear_module_state->__pyx_n_s_SEQBAIJMKL); Py_CLEAR(clear_module_state->__pyx_n_s_SEQCUDA); Py_CLEAR(clear_module_state->__pyx_n_s_SEQCUFFT); Py_CLEAR(clear_module_state->__pyx_n_s_SEQDENSE); Py_CLEAR(clear_module_state->__pyx_n_s_SEQDENSECUDA); Py_CLEAR(clear_module_state->__pyx_n_s_SEQHIP); Py_CLEAR(clear_module_state->__pyx_n_s_SEQKAIJ); Py_CLEAR(clear_module_state->__pyx_n_s_SEQKOKKOS); Py_CLEAR(clear_module_state->__pyx_n_s_SEQMAIJ); Py_CLEAR(clear_module_state->__pyx_n_s_SEQSBAIJ); Py_CLEAR(clear_module_state->__pyx_n_s_SEQSELL); Py_CLEAR(clear_module_state->__pyx_n_s_SEQVIENNACL); Py_CLEAR(clear_module_state->__pyx_n_s_SETUP_ERROR); Py_CLEAR(clear_module_state->__pyx_n_s_SF); Py_CLEAR(clear_module_state->__pyx_n_s_SFType); Py_CLEAR(clear_module_state->__pyx_n_s_SHARED); Py_CLEAR(clear_module_state->__pyx_n_s_SHARE_NONZERO_PATTERN); Py_CLEAR(clear_module_state->__pyx_n_s_SHELL); Py_CLEAR(clear_module_state->__pyx_n_s_SIMPLE); Py_CLEAR(clear_module_state->__pyx_n_s_SLICED); Py_CLEAR(clear_module_state->__pyx_n_s_SNES); Py_CLEAR(clear_module_state->__pyx_n_s_SNESConvergedReason); Py_CLEAR(clear_module_state->__pyx_n_s_SNESNormSchedule); Py_CLEAR(clear_module_state->__pyx_n_s_SNESType); Py_CLEAR(clear_module_state->__pyx_kp_s_SNES_norm_schedule_See_Also_pets); Py_CLEAR(clear_module_state->__pyx_kp_s_SNES_solver_termination_reason_S); Py_CLEAR(clear_module_state->__pyx_kp_s_SNES_solver_type_See_Also_petsc); Py_CLEAR(clear_module_state->__pyx_n_s_SOCKET); Py_CLEAR(clear_module_state->__pyx_n_s_SOR); Py_CLEAR(clear_module_state->__pyx_n_s_SORTED_FULL); Py_CLEAR(clear_module_state->__pyx_n_s_SORType); Py_CLEAR(clear_module_state->__pyx_n_s_SPAI); Py_CLEAR(clear_module_state->__pyx_n_s_SPD); Py_CLEAR(clear_module_state->__pyx_n_s_SPECIAL); Py_CLEAR(clear_module_state->__pyx_n_s_SPECTRAL); Py_CLEAR(clear_module_state->__pyx_n_s_SPQR); Py_CLEAR(clear_module_state->__pyx_n_s_SPRNG); Py_CLEAR(clear_module_state->__pyx_n_s_SSFLS); Py_CLEAR(clear_module_state->__pyx_n_s_SSILS); Py_CLEAR(clear_module_state->__pyx_n_s_SSML_BFGS); Py_CLEAR(clear_module_state->__pyx_n_s_SSML_BRDN); Py_CLEAR(clear_module_state->__pyx_n_s_SSML_DFP); Py_CLEAR(clear_module_state->__pyx_n_s_SSP); Py_CLEAR(clear_module_state->__pyx_n_s_STAG); Py_CLEAR(clear_module_state->__pyx_n_s_STANDARD); Py_CLEAR(clear_module_state->__pyx_n_s_STAR); Py_CLEAR(clear_module_state->__pyx_n_s_STCG); Py_CLEAR(clear_module_state->__pyx_n_s_STDERR); Py_CLEAR(clear_module_state->__pyx_n_s_STDOUT); Py_CLEAR(clear_module_state->__pyx_n_s_STEPOVER); Py_CLEAR(clear_module_state->__pyx_n_s_STRIDE); Py_CLEAR(clear_module_state->__pyx_n_s_STRING); Py_CLEAR(clear_module_state->__pyx_n_s_STRUCTURALLY_SYMMETRIC); Py_CLEAR(clear_module_state->__pyx_n_s_STRUCTURE_ONLY); Py_CLEAR(clear_module_state->__pyx_n_s_STRUMPACK); Py_CLEAR(clear_module_state->__pyx_n_s_SUBMATRIX); Py_CLEAR(clear_module_state->__pyx_n_s_SUBMAT_SINGLEIS); Py_CLEAR(clear_module_state->__pyx_n_s_SUBPC_ERROR); Py_CLEAR(clear_module_state->__pyx_n_s_SUBSET); Py_CLEAR(clear_module_state->__pyx_n_s_SUBSET_NONZERO_PATTERN); Py_CLEAR(clear_module_state->__pyx_n_s_SUBSET_NZ); Py_CLEAR(clear_module_state->__pyx_n_s_SUBSET_OFF_PROC_ENTRIES); Py_CLEAR(clear_module_state->__pyx_n_s_SUBSPACE); Py_CLEAR(clear_module_state->__pyx_n_s_SUCCESS); Py_CLEAR(clear_module_state->__pyx_n_s_SUCCESS_USER); Py_CLEAR(clear_module_state->__pyx_n_s_SUM); Py_CLEAR(clear_module_state->__pyx_n_s_SUNDIALS); Py_CLEAR(clear_module_state->__pyx_n_s_SUPERLU); Py_CLEAR(clear_module_state->__pyx_n_s_SUPERLU_DIST); Py_CLEAR(clear_module_state->__pyx_n_s_SVD); Py_CLEAR(clear_module_state->__pyx_n_s_SWARM); Py_CLEAR(clear_module_state->__pyx_n_s_SYCL); Py_CLEAR(clear_module_state->__pyx_n_s_SYMMETRIC); Py_CLEAR(clear_module_state->__pyx_n_s_SYMMETRIC_MULTIPLICATIVE); Py_CLEAR(clear_module_state->__pyx_n_s_SYMMETRY_ETERNAL); Py_CLEAR(clear_module_state->__pyx_n_s_SYMMETRY_SWEEP); Py_CLEAR(clear_module_state->__pyx_n_s_SYMMLQ); Py_CLEAR(clear_module_state->__pyx_n_s_SYNC); Py_CLEAR(clear_module_state->__pyx_n_s_SYSPFMG); Py_CLEAR(clear_module_state->__pyx_n_s_ScalarType); Py_CLEAR(clear_module_state->__pyx_n_s_Scatter); Py_CLEAR(clear_module_state->__pyx_n_s_ScatterMode); Py_CLEAR(clear_module_state->__pyx_n_s_ScatterType); Py_CLEAR(clear_module_state->__pyx_kp_s_Scatter_mode_Most_commonly_used); Py_CLEAR(clear_module_state->__pyx_kp_s_Scatter_type_See_Also_petsc_VecS); Py_CLEAR(clear_module_state->__pyx_n_s_SchurFactType); Py_CLEAR(clear_module_state->__pyx_n_s_SchurPreType); Py_CLEAR(clear_module_state->__pyx_n_s_Section); Py_CLEAR(clear_module_state->__pyx_n_s_Sequence); Py_CLEAR(clear_module_state->__pyx_n_s_Side); Py_CLEAR(clear_module_state->__pyx_n_s_Size); Py_CLEAR(clear_module_state->__pyx_n_s_SolverType); Py_CLEAR(clear_module_state->__pyx_n_s_Space); Py_CLEAR(clear_module_state->__pyx_n_s_SpaceType); Py_CLEAR(clear_module_state->__pyx_n_s_Stage); Py_CLEAR(clear_module_state->__pyx_n_s_Stencil); Py_CLEAR(clear_module_state->__pyx_n_s_StencilLocation); Py_CLEAR(clear_module_state->__pyx_n_s_StencilType); Py_CLEAR(clear_module_state->__pyx_kp_s_Step_may_not_be_zero_axis_d); Py_CLEAR(clear_module_state->__pyx_n_s_StreamType); Py_CLEAR(clear_module_state->__pyx_n_s_Structure); Py_CLEAR(clear_module_state->__pyx_n_s_Sys); Py_CLEAR(clear_module_state->__pyx_n_s_SystemError); Py_CLEAR(clear_module_state->__pyx_kp_b_T); Py_CLEAR(clear_module_state->__pyx_n_s_TAO); Py_CLEAR(clear_module_state->__pyx_n_s_TAOBNCGType); Py_CLEAR(clear_module_state->__pyx_n_s_TAOConvergedReason); Py_CLEAR(clear_module_state->__pyx_n_s_TAOLineSearch); Py_CLEAR(clear_module_state->__pyx_n_s_TAOLineSearchConvergedReason); Py_CLEAR(clear_module_state->__pyx_n_s_TAOLineSearchType); Py_CLEAR(clear_module_state->__pyx_n_s_TAOType); Py_CLEAR(clear_module_state->__pyx_kp_s_TAO_Bound_Constrained_Conjugate); Py_CLEAR(clear_module_state->__pyx_kp_s_TAO_Line_Search_Termination_Reas); Py_CLEAR(clear_module_state->__pyx_kp_s_TAO_Line_Search_Types); Py_CLEAR(clear_module_state->__pyx_kp_s_TAO_solver_termination_reason_Se); Py_CLEAR(clear_module_state->__pyx_kp_s_TAO_solver_type_See_Also_petsc_T); Py_CLEAR(clear_module_state->__pyx_n_s_TCQMR); Py_CLEAR(clear_module_state->__pyx_n_s_TELESCOPE); Py_CLEAR(clear_module_state->__pyx_n_s_TENSOR); Py_CLEAR(clear_module_state->__pyx_n_s_TETRAHEDRON); Py_CLEAR(clear_module_state->__pyx_n_s_TFQMR); Py_CLEAR(clear_module_state->__pyx_n_s_TFS); Py_CLEAR(clear_module_state->__pyx_n_s_TH); Py_CLEAR(clear_module_state->__pyx_n_s_THETA); Py_CLEAR(clear_module_state->__pyx_n_s_THIRD); Py_CLEAR(clear_module_state->__pyx_n_s_THIRD_SIZE); Py_CLEAR(clear_module_state->__pyx_n_s_TRANSFORMFILTER); Py_CLEAR(clear_module_state->__pyx_n_s_TRANSPOSE); Py_CLEAR(clear_module_state->__pyx_n_s_TRIANGLE); Py_CLEAR(clear_module_state->__pyx_n_s_TRI_PRISM); Py_CLEAR(clear_module_state->__pyx_n_s_TRI_PRISM_TENSOR); Py_CLEAR(clear_module_state->__pyx_n_s_TRON); Py_CLEAR(clear_module_state->__pyx_n_s_TRUE); Py_CLEAR(clear_module_state->__pyx_n_s_TS); Py_CLEAR(clear_module_state->__pyx_n_s_TSARKIMEXType); Py_CLEAR(clear_module_state->__pyx_n_s_TSConvergedReason); Py_CLEAR(clear_module_state->__pyx_n_s_TSDIRKType); Py_CLEAR(clear_module_state->__pyx_n_s_TSEquationType); Py_CLEAR(clear_module_state->__pyx_n_s_TSExactFinalTime); Py_CLEAR(clear_module_state->__pyx_n_s_TSIRM); Py_CLEAR(clear_module_state->__pyx_n_s_TSProblemType); Py_CLEAR(clear_module_state->__pyx_n_s_TSRKType); Py_CLEAR(clear_module_state->__pyx_n_s_TSType); Py_CLEAR(clear_module_state->__pyx_n_s_TWIST); Py_CLEAR(clear_module_state->__pyx_n_s_T_2); Py_CLEAR(clear_module_state->__pyx_kp_s_Tensor_dtype_does_not_match_PETS); Py_CLEAR(clear_module_state->__pyx_kp_s_The_ARKIMEX_subtype); Py_CLEAR(clear_module_state->__pyx_kp_s_The_ASM_subtype); Py_CLEAR(clear_module_state->__pyx_kp_s_The_DIRK_subtype); Py_CLEAR(clear_module_state->__pyx_kp_s_The_GAMG_subtype); Py_CLEAR(clear_module_state->__pyx_kp_s_The_GASM_subtype); Py_CLEAR(clear_module_state->__pyx_kp_s_The_HPDDM_Krylov_solver_type); Py_CLEAR(clear_module_state->__pyx_kp_s_The_HPDDM_coarse_correction_type); Py_CLEAR(clear_module_state->__pyx_kp_s_The_MG_cycle_type); Py_CLEAR(clear_module_state->__pyx_kp_s_The_MG_subtype); Py_CLEAR(clear_module_state->__pyx_kp_s_The_RK_subtype); Py_CLEAR(clear_module_state->__pyx_kp_s_The_composite_type); Py_CLEAR(clear_module_state->__pyx_kp_s_The_deflation_space_subtype); Py_CLEAR(clear_module_state->__pyx_kp_s_The_field_split_Schur_factorizat); Py_CLEAR(clear_module_state->__pyx_kp_s_The_field_split_Schur_subtype); Py_CLEAR(clear_module_state->__pyx_kp_s_The_manner_in_which_the_precondi); Py_CLEAR(clear_module_state->__pyx_kp_s_The_method_for_ending_time_stepp); Py_CLEAR(clear_module_state->__pyx_kp_s_The_patch_construction_type); Py_CLEAR(clear_module_state->__pyx_kp_s_The_preconditioner_method); Py_CLEAR(clear_module_state->__pyx_kp_s_The_random_number_generator_type); Py_CLEAR(clear_module_state->__pyx_kp_s_The_reason_the_preconditioner_ha); Py_CLEAR(clear_module_state->__pyx_kp_s_The_reason_the_time_step_is_conv); Py_CLEAR(clear_module_state->__pyx_kp_s_The_time_stepping_method); Py_CLEAR(clear_module_state->__pyx_kp_s_The_type_of_device_See_Also_Devi); Py_CLEAR(clear_module_state->__pyx_kp_s_The_type_of_join_to_perform_See); Py_CLEAR(clear_module_state->__pyx_kp_s_The_type_of_stream_See_Also_Devi); Py_CLEAR(clear_module_state->__pyx_kp_s_The_vector_type); Py_CLEAR(clear_module_state->__pyx_n_s_Type); Py_CLEAR(clear_module_state->__pyx_n_s_TypeError); Py_CLEAR(clear_module_state->__pyx_n_s_U); Py_CLEAR(clear_module_state->__pyx_n_s_UA); Py_CLEAR(clear_module_state->__pyx_n_s_UMFPACK); Py_CLEAR(clear_module_state->__pyx_n_s_UNIT); Py_CLEAR(clear_module_state->__pyx_n_s_UNKNOWN); Py_CLEAR(clear_module_state->__pyx_n_s_UNKNOWN_NONZERO_PATTERN); Py_CLEAR(clear_module_state->__pyx_n_s_UNKNOWN_NZ); Py_CLEAR(clear_module_state->__pyx_n_s_UNPRECONDITIONED); Py_CLEAR(clear_module_state->__pyx_n_s_UNSPECIFIED); Py_CLEAR(clear_module_state->__pyx_n_s_UNUSED_NONZERO_LOCATION_ERR); Py_CLEAR(clear_module_state->__pyx_n_s_UP); Py_CLEAR(clear_module_state->__pyx_n_s_UPDATE); Py_CLEAR(clear_module_state->__pyx_n_s_UPPER); Py_CLEAR(clear_module_state->__pyx_n_s_UP_LEFT); Py_CLEAR(clear_module_state->__pyx_n_s_UP_RIGHT); Py_CLEAR(clear_module_state->__pyx_n_s_USER); Py_CLEAR(clear_module_state->__pyx_n_s_USE_HASH_TABLE); Py_CLEAR(clear_module_state->__pyx_n_s_USE_INODES); Py_CLEAR(clear_module_state->__pyx_kp_s_Unable_to_convert_item_to_object); Py_CLEAR(clear_module_state->__pyx_kp_s_Unsupported_PetscScalar_type); Py_CLEAR(clear_module_state->__pyx_n_s_V); Py_CLEAR(clear_module_state->__pyx_n_s_VANKA); Py_CLEAR(clear_module_state->__pyx_n_s_VIENNACL); Py_CLEAR(clear_module_state->__pyx_n_s_VINEWTONRSLS); Py_CLEAR(clear_module_state->__pyx_n_s_VINEWTONSSLS); Py_CLEAR(clear_module_state->__pyx_n_s_VPBJACOBI); Py_CLEAR(clear_module_state->__pyx_n_s_VTK); Py_CLEAR(clear_module_state->__pyx_n_s_VTK_VTR); Py_CLEAR(clear_module_state->__pyx_n_s_VTK_VTS); Py_CLEAR(clear_module_state->__pyx_n_s_VTK_VTU); Py_CLEAR(clear_module_state->__pyx_n_s_VU); Py_CLEAR(clear_module_state->__pyx_n_s_ValueError); Py_CLEAR(clear_module_state->__pyx_n_s_Vec); Py_CLEAR(clear_module_state->__pyx_n_s_VecOption); Py_CLEAR(clear_module_state->__pyx_n_s_VecType); Py_CLEAR(clear_module_state->__pyx_n_s_Vec_LocalForm); Py_CLEAR(clear_module_state->__pyx_n_s_Vec_buffer); Py_CLEAR(clear_module_state->__pyx_kp_s_Vector_assembly_option); Py_CLEAR(clear_module_state->__pyx_kp_s_Vector_local_size_d_is_not_compa); Py_CLEAR(clear_module_state->__pyx_n_s_View_MemoryView); Py_CLEAR(clear_module_state->__pyx_n_s_Viewer); Py_CLEAR(clear_module_state->__pyx_n_s_ViewerDrawSize); Py_CLEAR(clear_module_state->__pyx_n_s_ViewerFileMode); Py_CLEAR(clear_module_state->__pyx_n_s_ViewerFormat); Py_CLEAR(clear_module_state->__pyx_n_s_ViewerHDF5); Py_CLEAR(clear_module_state->__pyx_n_s_ViewerType); Py_CLEAR(clear_module_state->__pyx_kp_s_Viewer_file_mode); Py_CLEAR(clear_module_state->__pyx_kp_s_Viewer_format); Py_CLEAR(clear_module_state->__pyx_kp_s_Viewer_type); Py_CLEAR(clear_module_state->__pyx_n_s_W); Py_CLEAR(clear_module_state->__pyx_n_s_WBM); Py_CLEAR(clear_module_state->__pyx_n_s_WINDOW); Py_CLEAR(clear_module_state->__pyx_n_s_WRITE); Py_CLEAR(clear_module_state->__pyx_n_s_WXY); Py_CLEAR(clear_module_state->__pyx_kp_s_Window_size); Py_CLEAR(clear_module_state->__pyx_n_s_X); Py_CLEAR(clear_module_state->__pyx_n_s_ZERO_INITIAL_GUESS); Py_CLEAR(clear_module_state->__pyx_kp_b__10); Py_CLEAR(clear_module_state->__pyx_kp_s__10); Py_CLEAR(clear_module_state->__pyx_kp_b__11); Py_CLEAR(clear_module_state->__pyx_kp_s__11); Py_CLEAR(clear_module_state->__pyx_kp_b__12); Py_CLEAR(clear_module_state->__pyx_kp_u__13); Py_CLEAR(clear_module_state->__pyx_kp_s__14); Py_CLEAR(clear_module_state->__pyx_kp_u__14); Py_CLEAR(clear_module_state->__pyx_kp_s__16); Py_CLEAR(clear_module_state->__pyx_kp_b__18); Py_CLEAR(clear_module_state->__pyx_kp_s__18); Py_CLEAR(clear_module_state->__pyx_kp_s__2); Py_CLEAR(clear_module_state->__pyx_kp_u__2); Py_CLEAR(clear_module_state->__pyx_n_s__257); Py_CLEAR(clear_module_state->__pyx_kp_s__26); Py_CLEAR(clear_module_state->__pyx_n_s__3); Py_CLEAR(clear_module_state->__pyx_kp_u__6); Py_CLEAR(clear_module_state->__pyx_kp_u__7); Py_CLEAR(clear_module_state->__pyx_kp_b__9); Py_CLEAR(clear_module_state->__pyx_n_s_a); Py_CLEAR(clear_module_state->__pyx_kp_s_a_2); Py_CLEAR(clear_module_state->__pyx_n_s_a_max); Py_CLEAR(clear_module_state->__pyx_n_s_abc); Py_CLEAR(clear_module_state->__pyx_n_s_abort); Py_CLEAR(clear_module_state->__pyx_kp_s_accessing_non_existent_buffer_se); Py_CLEAR(clear_module_state->__pyx_n_s_adaptStep); Py_CLEAR(clear_module_state->__pyx_n_s_addFlops); Py_CLEAR(clear_module_state->__pyx_n_s_addv); Py_CLEAR(clear_module_state->__pyx_n_s_adj); Py_CLEAR(clear_module_state->__pyx_n_s_adjoint_steps); Py_CLEAR(clear_module_state->__pyx_n_s_allocate_buffer); Py_CLEAR(clear_module_state->__pyx_n_s_alpha); Py_CLEAR(clear_module_state->__pyx_n_s_alpha2); Py_CLEAR(clear_module_state->__pyx_n_s_alpha_f); Py_CLEAR(clear_module_state->__pyx_n_s_alpha_m); Py_CLEAR(clear_module_state->__pyx_n_s_alphas); Py_CLEAR(clear_module_state->__pyx_n_s_amount); Py_CLEAR(clear_module_state->__pyx_kp_u_and); Py_CLEAR(clear_module_state->__pyx_n_s_app); Py_CLEAR(clear_module_state->__pyx_n_s_appctx); Py_CLEAR(clear_module_state->__pyx_n_s_append); Py_CLEAR(clear_module_state->__pyx_n_s_apply); Py_CLEAR(clear_module_state->__pyx_n_s_applySymmetricLeft); Py_CLEAR(clear_module_state->__pyx_n_s_applySymmetricRight); Py_CLEAR(clear_module_state->__pyx_n_s_applyTranspose); Py_CLEAR(clear_module_state->__pyx_n_s_args); Py_CLEAR(clear_module_state->__pyx_n_s_array); Py_CLEAR(clear_module_state->__pyx_n_s_array_interface); Py_CLEAR(clear_module_state->__pyx_kp_s_array_size_d_and_vector_local_si); Py_CLEAR(clear_module_state->__pyx_kp_s_array_size_d_incompatible_with_v); Py_CLEAR(clear_module_state->__pyx_n_s_array_w); Py_CLEAR(clear_module_state->__pyx_n_s_asmtype); Py_CLEAR(clear_module_state->__pyx_n_s_assemblies); Py_CLEAR(clear_module_state->__pyx_n_s_assembly); Py_CLEAR(clear_module_state->__pyx_n_s_assemblyBegin); Py_CLEAR(clear_module_state->__pyx_n_s_assemblyEnd); Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); Py_CLEAR(clear_module_state->__pyx_n_s_atexit); Py_CLEAR(clear_module_state->__pyx_n_s_atol); Py_CLEAR(clear_module_state->__pyx_n_s_attr); Py_CLEAR(clear_module_state->__pyx_n_s_au); Py_CLEAR(clear_module_state->__pyx_n_s_author); Py_CLEAR(clear_module_state->__pyx_n_s_authorinfo); Py_CLEAR(clear_module_state->__pyx_n_s_aux); Py_CLEAR(clear_module_state->__pyx_n_s_axpy); Py_CLEAR(clear_module_state->__pyx_n_s_b); Py_CLEAR(clear_module_state->__pyx_n_s_back); Py_CLEAR(clear_module_state->__pyx_n_s_back_down); Py_CLEAR(clear_module_state->__pyx_n_s_back_down_left); Py_CLEAR(clear_module_state->__pyx_n_s_back_down_right); Py_CLEAR(clear_module_state->__pyx_n_s_back_left); Py_CLEAR(clear_module_state->__pyx_n_s_back_right); Py_CLEAR(clear_module_state->__pyx_n_s_back_up); Py_CLEAR(clear_module_state->__pyx_n_s_back_up_left); Py_CLEAR(clear_module_state->__pyx_n_s_back_up_right); Py_CLEAR(clear_module_state->__pyx_n_s_barrier); Py_CLEAR(clear_module_state->__pyx_n_s_base); Py_CLEAR(clear_module_state->__pyx_n_s_batchSize); Py_CLEAR(clear_module_state->__pyx_n_s_bcComps); Py_CLEAR(clear_module_state->__pyx_n_s_bcField); Py_CLEAR(clear_module_state->__pyx_n_s_bcPoints); Py_CLEAR(clear_module_state->__pyx_kp_s_bcPoints_is_a_required_argument); Py_CLEAR(clear_module_state->__pyx_n_s_bdLabel); Py_CLEAR(clear_module_state->__pyx_n_s_bdlabel); Py_CLEAR(clear_module_state->__pyx_n_s_bdvalue); Py_CLEAR(clear_module_state->__pyx_n_s_begin); Py_CLEAR(clear_module_state->__pyx_n_s_begin_args); Py_CLEAR(clear_module_state->__pyx_n_s_begin_kargs); Py_CLEAR(clear_module_state->__pyx_n_s_beta); Py_CLEAR(clear_module_state->__pyx_n_s_bits); Py_CLEAR(clear_module_state->__pyx_n_s_blockSize); Py_CLEAR(clear_module_state->__pyx_n_s_block_size); Py_CLEAR(clear_module_state->__pyx_kp_s_block_size_d_must_be_positive); Py_CLEAR(clear_module_state->__pyx_kp_s_block_size_not_set); Py_CLEAR(clear_module_state->__pyx_n_s_blocksize); Py_CLEAR(clear_module_state->__pyx_n_s_bndr); Py_CLEAR(clear_module_state->__pyx_n_s_bool); Py_CLEAR(clear_module_state->__pyx_n_s_boundary); Py_CLEAR(clear_module_state->__pyx_n_s_boundary_type); Py_CLEAR(clear_module_state->__pyx_n_s_boundary_types); Py_CLEAR(clear_module_state->__pyx_n_s_box); Py_CLEAR(clear_module_state->__pyx_n_s_bs); Py_CLEAR(clear_module_state->__pyx_n_s_bsize); Py_CLEAR(clear_module_state->__pyx_n_s_buffer); Py_CLEAR(clear_module_state->__pyx_n_s_buffer_w); Py_CLEAR(clear_module_state->__pyx_n_s_buildResidual); Py_CLEAR(clear_module_state->__pyx_n_s_buildSolution); Py_CLEAR(clear_module_state->__pyx_n_s_builtins); Py_CLEAR(clear_module_state->__pyx_n_s_c); Py_CLEAR(clear_module_state->__pyx_n_u_c); Py_CLEAR(clear_module_state->__pyx_kp_s_c_d); Py_CLEAR(clear_module_state->__pyx_n_s_cancelMonitor); Py_CLEAR(clear_module_state->__pyx_kp_s_cannot_place_input_array_size_d); Py_CLEAR(clear_module_state->__pyx_n_s_catol); Py_CLEAR(clear_module_state->__pyx_n_s_ccomm); Py_CLEAR(clear_module_state->__pyx_n_s_cdctx); Py_CLEAR(clear_module_state->__pyx_n_s_cdevice_type); Py_CLEAR(clear_module_state->__pyx_n_s_cell); Py_CLEAR(clear_module_state->__pyx_n_s_cellNodeMaps); Py_CLEAR(clear_module_state->__pyx_kp_s_cell_indices_must_have_two_dimen); Py_CLEAR(clear_module_state->__pyx_n_s_cells); Py_CLEAR(clear_module_state->__pyx_n_s_cg_type); Py_CLEAR(clear_module_state->__pyx_n_s_cgid); Py_CLEAR(clear_module_state->__pyx_n_s_citation); Py_CLEAR(clear_module_state->__pyx_n_s_class); Py_CLEAR(clear_module_state->__pyx_n_s_class_getitem); Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); Py_CLEAR(clear_module_state->__pyx_n_s_cmap); Py_CLEAR(clear_module_state->__pyx_n_s_cnorm); Py_CLEAR(clear_module_state->__pyx_n_s_coarsen); Py_CLEAR(clear_module_state->__pyx_n_s_coarsenhook); Py_CLEAR(clear_module_state->__pyx_n_s_code); Py_CLEAR(clear_module_state->__pyx_n_s_col); Py_CLEAR(clear_module_state->__pyx_n_s_col_bsize); Py_CLEAR(clear_module_state->__pyx_n_s_collections); Py_CLEAR(clear_module_state->__pyx_kp_s_collections_abc); Py_CLEAR(clear_module_state->__pyx_n_s_cols); Py_CLEAR(clear_module_state->__pyx_n_s_column); Py_CLEAR(clear_module_state->__pyx_kp_s_column_indices_must_have_two_dim); Py_CLEAR(clear_module_state->__pyx_n_s_comm); Py_CLEAR(clear_module_state->__pyx_n_s_comms); Py_CLEAR(clear_module_state->__pyx_kp_s_communicator_not_owned); Py_CLEAR(clear_module_state->__pyx_n_s_comp); Py_CLEAR(clear_module_state->__pyx_n_s_compile); Py_CLEAR(clear_module_state->__pyx_n_s_compressed); Py_CLEAR(clear_module_state->__pyx_n_s_concatenate); Py_CLEAR(clear_module_state->__pyx_n_s_cone); Py_CLEAR(clear_module_state->__pyx_n_s_coneOrientation); Py_CLEAR(clear_module_state->__pyx_n_s_conePoint); Py_CLEAR(clear_module_state->__pyx_n_s_conePos); Py_CLEAR(clear_module_state->__pyx_n_s_conforming); Py_CLEAR(clear_module_state->__pyx_n_s_conjugate); Py_CLEAR(clear_module_state->__pyx_n_s_constant); Py_CLEAR(clear_module_state->__pyx_n_s_constraints); Py_CLEAR(clear_module_state->__pyx_n_s_context); Py_CLEAR(clear_module_state->__pyx_kp_s_contiguous_and_direct); Py_CLEAR(clear_module_state->__pyx_kp_s_contiguous_and_indirect); Py_CLEAR(clear_module_state->__pyx_n_s_continuous); Py_CLEAR(clear_module_state->__pyx_n_s_converged); Py_CLEAR(clear_module_state->__pyx_n_s_coordinates); Py_CLEAR(clear_module_state->__pyx_kp_s_coordinates_must_have_two_dimens); Py_CLEAR(clear_module_state->__pyx_kp_s_coordinates_size_must_be_at_leas); Py_CLEAR(clear_module_state->__pyx_n_s_coords); Py_CLEAR(clear_module_state->__pyx_kp_s_coords_vertices_must_have_two_di); Py_CLEAR(clear_module_state->__pyx_n_s_copy); Py_CLEAR(clear_module_state->__pyx_n_s_correction_type); Py_CLEAR(clear_module_state->__pyx_n_s_count); Py_CLEAR(clear_module_state->__pyx_n_s_cpuarray); Py_CLEAR(clear_module_state->__pyx_n_s_crank); Py_CLEAR(clear_module_state->__pyx_n_s_cratio); Py_CLEAR(clear_module_state->__pyx_n_s_create); Py_CLEAR(clear_module_state->__pyx_n_s_createDefaultSF); Py_CLEAR(clear_module_state->__pyx_n_s_createGlobalVec); Py_CLEAR(clear_module_state->__pyx_n_s_createGlobalVector); Py_CLEAR(clear_module_state->__pyx_n_s_createLabel); Py_CLEAR(clear_module_state->__pyx_n_s_createLocalVec); Py_CLEAR(clear_module_state->__pyx_n_s_createLocalVector); Py_CLEAR(clear_module_state->__pyx_n_s_createMat); Py_CLEAR(clear_module_state->__pyx_n_s_createMatrix); Py_CLEAR(clear_module_state->__pyx_n_s_createNaturalVec); Py_CLEAR(clear_module_state->__pyx_n_s_createNaturalVector); Py_CLEAR(clear_module_state->__pyx_n_s_createSectionSF); Py_CLEAR(clear_module_state->__pyx_n_s_createSubMatrix); Py_CLEAR(clear_module_state->__pyx_n_s_createVecLeft); Py_CLEAR(clear_module_state->__pyx_n_s_createVecRight); Py_CLEAR(clear_module_state->__pyx_n_s_createVecs); Py_CLEAR(clear_module_state->__pyx_n_s_create_gvec); Py_CLEAR(clear_module_state->__pyx_n_s_create_injection); Py_CLEAR(clear_module_state->__pyx_n_s_create_interpolation); Py_CLEAR(clear_module_state->__pyx_n_s_create_lvec); Py_CLEAR(clear_module_state->__pyx_n_s_create_matrix); Py_CLEAR(clear_module_state->__pyx_n_s_create_restriction); Py_CLEAR(clear_module_state->__pyx_n_s_create_subdm); Py_CLEAR(clear_module_state->__pyx_n_s_crtol); Py_CLEAR(clear_module_state->__pyx_n_s_csize); Py_CLEAR(clear_module_state->__pyx_n_s_csr); Py_CLEAR(clear_module_state->__pyx_n_s_ctype); Py_CLEAR(clear_module_state->__pyx_n_s_cudahandle); Py_CLEAR(clear_module_state->__pyx_n_s_cycle_type); Py_CLEAR(clear_module_state->__pyx_kp_s_d_s); Py_CLEAR(clear_module_state->__pyx_n_s_da); Py_CLEAR(clear_module_state->__pyx_n_s_data); Py_CLEAR(clear_module_state->__pyx_n_s_date); Py_CLEAR(clear_module_state->__pyx_n_s_dctx); Py_CLEAR(clear_module_state->__pyx_n_s_debugger); Py_CLEAR(clear_module_state->__pyx_n_s_decode); Py_CLEAR(clear_module_state->__pyx_n_s_decomp); Py_CLEAR(clear_module_state->__pyx_n_s_decorator); Py_CLEAR(clear_module_state->__pyx_n_s_default); Py_CLEAR(clear_module_state->__pyx_n_s_degree); Py_CLEAR(clear_module_state->__pyx_n_s_delValue); Py_CLEAR(clear_module_state->__pyx_n_s_dense); Py_CLEAR(clear_module_state->__pyx_n_s_design); Py_CLEAR(clear_module_state->__pyx_n_s_destroy); Py_CLEAR(clear_module_state->__pyx_n_s_determinant); Py_CLEAR(clear_module_state->__pyx_n_s_devel); Py_CLEAR(clear_module_state->__pyx_n_s_device); Py_CLEAR(clear_module_state->__pyx_n_s_device_id); Py_CLEAR(clear_module_state->__pyx_n_s_device_type); Py_CLEAR(clear_module_state->__pyx_n_s_diag); Py_CLEAR(clear_module_state->__pyx_n_s_diagonalScale); Py_CLEAR(clear_module_state->__pyx_n_s_diagonal_fill); Py_CLEAR(clear_module_state->__pyx_n_s_dict); Py_CLEAR(clear_module_state->__pyx_n_s_dim); Py_CLEAR(clear_module_state->__pyx_n_s_dims); Py_CLEAR(clear_module_state->__pyx_n_s_direction); Py_CLEAR(clear_module_state->__pyx_kp_u_disable); Py_CLEAR(clear_module_state->__pyx_n_s_disc); Py_CLEAR(clear_module_state->__pyx_n_s_display); Py_CLEAR(clear_module_state->__pyx_n_s_dist); Py_CLEAR(clear_module_state->__pyx_n_s_div); Py_CLEAR(clear_module_state->__pyx_n_s_divtol); Py_CLEAR(clear_module_state->__pyx_n_s_dlpack); Py_CLEAR(clear_module_state->__pyx_n_s_dltensor); Py_CLEAR(clear_module_state->__pyx_n_s_dm); Py_CLEAR(clear_module_state->__pyx_n_s_dmTo); Py_CLEAR(clear_module_state->__pyx_n_s_dm_type); Py_CLEAR(clear_module_state->__pyx_n_s_dmf); Py_CLEAR(clear_module_state->__pyx_n_s_dms); Py_CLEAR(clear_module_state->__pyx_n_s_dmswarm_type); Py_CLEAR(clear_module_state->__pyx_n_s_dmtype); Py_CLEAR(clear_module_state->__pyx_n_s_doc); Py_CLEAR(clear_module_state->__pyx_n_s_dof); Py_CLEAR(clear_module_state->__pyx_n_s_dofs); Py_CLEAR(clear_module_state->__pyx_n_s_dosort); Py_CLEAR(clear_module_state->__pyx_n_s_dot); Py_CLEAR(clear_module_state->__pyx_n_s_down); Py_CLEAR(clear_module_state->__pyx_n_s_down_left); Py_CLEAR(clear_module_state->__pyx_n_s_down_right); Py_CLEAR(clear_module_state->__pyx_n_s_drop); Py_CLEAR(clear_module_state->__pyx_n_s_ds_type); Py_CLEAR(clear_module_state->__pyx_n_s_dspace); Py_CLEAR(clear_module_state->__pyx_n_s_dt); Py_CLEAR(clear_module_state->__pyx_n_s_dtcol); Py_CLEAR(clear_module_state->__pyx_n_s_dtcount); Py_CLEAR(clear_module_state->__pyx_n_s_dtype); Py_CLEAR(clear_module_state->__pyx_n_s_dtype_is_object); Py_CLEAR(clear_module_state->__pyx_n_s_dualspace_type); Py_CLEAR(clear_module_state->__pyx_n_s_duplicate); Py_CLEAR(clear_module_state->__pyx_n_s_e); Py_CLEAR(clear_module_state->__pyx_n_s_elem_type); Py_CLEAR(clear_module_state->__pyx_n_s_element); Py_CLEAR(clear_module_state->__pyx_n_s_emacs); Py_CLEAR(clear_module_state->__pyx_kp_s_empty_citation); Py_CLEAR(clear_module_state->__pyx_kp_s_empty_name); Py_CLEAR(clear_module_state->__pyx_kp_u_enable); Py_CLEAR(clear_module_state->__pyx_n_s_encode); Py_CLEAR(clear_module_state->__pyx_n_s_end); Py_CLEAR(clear_module_state->__pyx_n_s_end_args); Py_CLEAR(clear_module_state->__pyx_n_s_end_kargs); Py_CLEAR(clear_module_state->__pyx_n_s_enter); Py_CLEAR(clear_module_state->__pyx_n_s_entityDepth); Py_CLEAR(clear_module_state->__pyx_n_s_entry); Py_CLEAR(clear_module_state->__pyx_n_s_enum2str); Py_CLEAR(clear_module_state->__pyx_n_s_enumerate); Py_CLEAR(clear_module_state->__pyx_n_s_epsilon); Py_CLEAR(clear_module_state->__pyx_n_s_eqtype); Py_CLEAR(clear_module_state->__pyx_n_s_equality_constraints); Py_CLEAR(clear_module_state->__pyx_n_s_errhandler); Py_CLEAR(clear_module_state->__pyx_n_s_error); Py_CLEAR(clear_module_state->__pyx_kp_s_error_code_d); Py_CLEAR(clear_module_state->__pyx_n_s_eta); Py_CLEAR(clear_module_state->__pyx_n_s_evaluatestep); Py_CLEAR(clear_module_state->__pyx_n_s_eventhandler); Py_CLEAR(clear_module_state->__pyx_n_s_exec); Py_CLEAR(clear_module_state->__pyx_n_s_exit); Py_CLEAR(clear_module_state->__pyx_n_s_exoid); Py_CLEAR(clear_module_state->__pyx_kp_s_expecting_a_C_contiguous_array); Py_CLEAR(clear_module_state->__pyx_kp_s_expecting_tuple_list_or_dict); Py_CLEAR(clear_module_state->__pyx_n_s_f); Py_CLEAR(clear_module_state->__pyx_n_s_faces); Py_CLEAR(clear_module_state->__pyx_n_s_fact); Py_CLEAR(clear_module_state->__pyx_n_s_factor_mallocs); Py_CLEAR(clear_module_state->__pyx_n_s_fe_type); Py_CLEAR(clear_module_state->__pyx_n_s_fget); Py_CLEAR(clear_module_state->__pyx_n_s_field); Py_CLEAR(clear_module_state->__pyx_n_s_fieldName); Py_CLEAR(clear_module_state->__pyx_n_s_fieldname); Py_CLEAR(clear_module_state->__pyx_n_s_fieldnames); Py_CLEAR(clear_module_state->__pyx_n_s_fields); Py_CLEAR(clear_module_state->__pyx_n_s_file); Py_CLEAR(clear_module_state->__pyx_n_s_filename); Py_CLEAR(clear_module_state->__pyx_n_s_fill); Py_CLEAR(clear_module_state->__pyx_n_s_fill_param); Py_CLEAR(clear_module_state->__pyx_n_s_fill_ratio_given); Py_CLEAR(clear_module_state->__pyx_n_s_fill_ratio_needed); Py_CLEAR(clear_module_state->__pyx_n_s_finalize); Py_CLEAR(clear_module_state->__pyx_n_s_first); Py_CLEAR(clear_module_state->__pyx_n_s_fix); Py_CLEAR(clear_module_state->__pyx_n_s_flag); Py_CLEAR(clear_module_state->__pyx_n_s_flags); Py_CLEAR(clear_module_state->__pyx_n_s_flg); Py_CLEAR(clear_module_state->__pyx_n_s_flip); Py_CLEAR(clear_module_state->__pyx_n_s_flops); Py_CLEAR(clear_module_state->__pyx_n_s_flush); Py_CLEAR(clear_module_state->__pyx_n_s_fnorm); Py_CLEAR(clear_module_state->__pyx_n_s_force); Py_CLEAR(clear_module_state->__pyx_n_s_formDegree); Py_CLEAR(clear_module_state->__pyx_n_s_formSNESFunction); Py_CLEAR(clear_module_state->__pyx_n_s_formSNESJacobian); Py_CLEAR(clear_module_state->__pyx_n_s_format); Py_CLEAR(clear_module_state->__pyx_n_s_fortran); Py_CLEAR(clear_module_state->__pyx_n_u_fortran); Py_CLEAR(clear_module_state->__pyx_n_s_forward); Py_CLEAR(clear_module_state->__pyx_n_s_front); Py_CLEAR(clear_module_state->__pyx_n_s_front_down); Py_CLEAR(clear_module_state->__pyx_n_s_front_down_left); Py_CLEAR(clear_module_state->__pyx_n_s_front_down_right); Py_CLEAR(clear_module_state->__pyx_n_s_front_left); Py_CLEAR(clear_module_state->__pyx_n_s_front_right); Py_CLEAR(clear_module_state->__pyx_n_s_front_up); Py_CLEAR(clear_module_state->__pyx_n_s_front_up_left); Py_CLEAR(clear_module_state->__pyx_n_s_front_up_right); Py_CLEAR(clear_module_state->__pyx_n_s_func); Py_CLEAR(clear_module_state->__pyx_n_s_function); Py_CLEAR(clear_module_state->__pyx_n_s_functional); Py_CLEAR(clear_module_state->__pyx_n_s_functools); Py_CLEAR(clear_module_state->__pyx_n_s_g); Py_CLEAR(clear_module_state->__pyx_n_s_gamgtype); Py_CLEAR(clear_module_state->__pyx_n_s_gamma); Py_CLEAR(clear_module_state->__pyx_n_s_garbage_cleanup); Py_CLEAR(clear_module_state->__pyx_n_s_garbage_view); Py_CLEAR(clear_module_state->__pyx_n_s_gasmtype); Py_CLEAR(clear_module_state->__pyx_n_s_gatol); Py_CLEAR(clear_module_state->__pyx_kp_u_gc); Py_CLEAR(clear_module_state->__pyx_n_s_get); Py_CLEAR(clear_module_state->__pyx_kp_s_get1dCoordinatecArrays_for_DMSta); Py_CLEAR(clear_module_state->__pyx_n_s_getActive); Py_CLEAR(clear_module_state->__pyx_n_s_getActiveAll); Py_CLEAR(clear_module_state->__pyx_n_s_getAppCtx); Py_CLEAR(clear_module_state->__pyx_n_s_getApplicationContext); Py_CLEAR(clear_module_state->__pyx_n_s_getArray); Py_CLEAR(clear_module_state->__pyx_n_s_getBlockIndices); Py_CLEAR(clear_module_state->__pyx_n_s_getBlockInfo); Py_CLEAR(clear_module_state->__pyx_n_s_getBlockSize); Py_CLEAR(clear_module_state->__pyx_n_s_getBlockSizes); Py_CLEAR(clear_module_state->__pyx_n_s_getBoundaryType); Py_CLEAR(clear_module_state->__pyx_n_s_getBoundaryTypes); Py_CLEAR(clear_module_state->__pyx_n_s_getBuffer); Py_CLEAR(clear_module_state->__pyx_n_s_getCPUTime); Py_CLEAR(clear_module_state->__pyx_n_s_getClassId); Py_CLEAR(clear_module_state->__pyx_n_s_getClassName); Py_CLEAR(clear_module_state->__pyx_n_s_getComm); Py_CLEAR(clear_module_state->__pyx_n_s_getConstraintTolerances); Py_CLEAR(clear_module_state->__pyx_n_s_getConvergedReason); Py_CLEAR(clear_module_state->__pyx_n_s_getConvergenceHistory); Py_CLEAR(clear_module_state->__pyx_n_s_getCorners); Py_CLEAR(clear_module_state->__pyx_n_s_getCurrent); Py_CLEAR(clear_module_state->__pyx_n_s_getDM); Py_CLEAR(clear_module_state->__pyx_n_s_getDS); Py_CLEAR(clear_module_state->__pyx_n_s_getDefaultComm); Py_CLEAR(clear_module_state->__pyx_n_s_getDefaultGlobalSection); Py_CLEAR(clear_module_state->__pyx_n_s_getDefaultLocalSection); Py_CLEAR(clear_module_state->__pyx_n_s_getDefaultSF); Py_CLEAR(clear_module_state->__pyx_n_s_getDefaultSection); Py_CLEAR(clear_module_state->__pyx_n_s_getDevice); Py_CLEAR(clear_module_state->__pyx_n_s_getDeviceId); Py_CLEAR(clear_module_state->__pyx_n_s_getDeviceType); Py_CLEAR(clear_module_state->__pyx_n_s_getDiagonal); Py_CLEAR(clear_module_state->__pyx_n_s_getDiagonalBlock); Py_CLEAR(clear_module_state->__pyx_n_s_getDim); Py_CLEAR(clear_module_state->__pyx_n_s_getDimension); Py_CLEAR(clear_module_state->__pyx_n_s_getDof); Py_CLEAR(clear_module_state->__pyx_n_s_getEntriesPerElement); Py_CLEAR(clear_module_state->__pyx_n_s_getEquationType); Py_CLEAR(clear_module_state->__pyx_n_s_getFlops); Py_CLEAR(clear_module_state->__pyx_n_s_getFunctionNorm); Py_CLEAR(clear_module_state->__pyx_n_s_getFunctionTolerances); Py_CLEAR(clear_module_state->__pyx_n_s_getFunctionValue); Py_CLEAR(clear_module_state->__pyx_n_s_getGhostCorners); Py_CLEAR(clear_module_state->__pyx_n_s_getGhostRanges); Py_CLEAR(clear_module_state->__pyx_n_s_getGlobalSection); Py_CLEAR(clear_module_state->__pyx_n_s_getGlobalSizes); Py_CLEAR(clear_module_state->__pyx_n_s_getGradient); Py_CLEAR(clear_module_state->__pyx_n_s_getGradientTolerances); Py_CLEAR(clear_module_state->__pyx_n_s_getIndices); Py_CLEAR(clear_module_state->__pyx_n_s_getInfo); Py_CLEAR(clear_module_state->__pyx_n_s_getInitialGuessKnoll); Py_CLEAR(clear_module_state->__pyx_n_s_getInitialGuessNonzero); Py_CLEAR(clear_module_state->__pyx_n_s_getInterval); Py_CLEAR(clear_module_state->__pyx_n_s_getIterationNumber); Py_CLEAR(clear_module_state->__pyx_n_s_getKSP); Py_CLEAR(clear_module_state->__pyx_n_s_getKSPFailures); Py_CLEAR(clear_module_state->__pyx_n_s_getLinearSolveFailures); Py_CLEAR(clear_module_state->__pyx_n_s_getLocalSection); Py_CLEAR(clear_module_state->__pyx_n_s_getLocalSize); Py_CLEAR(clear_module_state->__pyx_n_s_getLocalSizes); Py_CLEAR(clear_module_state->__pyx_n_s_getMatrix); Py_CLEAR(clear_module_state->__pyx_n_s_getMaxFunctionEvaluations); Py_CLEAR(clear_module_state->__pyx_n_s_getMaxKSPFailures); Py_CLEAR(clear_module_state->__pyx_n_s_getMaxLinearSolveFailures); Py_CLEAR(clear_module_state->__pyx_n_s_getMaxNonlinearStepFailures); Py_CLEAR(clear_module_state->__pyx_n_s_getMaxStepFailures); Py_CLEAR(clear_module_state->__pyx_n_s_getMaxSteps); Py_CLEAR(clear_module_state->__pyx_n_s_getMaxTime); Py_CLEAR(clear_module_state->__pyx_n_s_getNPC); Py_CLEAR(clear_module_state->__pyx_n_s_getName); Py_CLEAR(clear_module_state->__pyx_n_s_getNonlinearStepFailures); Py_CLEAR(clear_module_state->__pyx_n_s_getNormType); Py_CLEAR(clear_module_state->__pyx_n_s_getNumber); Py_CLEAR(clear_module_state->__pyx_n_s_getNumberDM); Py_CLEAR(clear_module_state->__pyx_n_s_getObjectiveValue); Py_CLEAR(clear_module_state->__pyx_n_s_getOperators); Py_CLEAR(clear_module_state->__pyx_n_s_getOptionsPrefix); Py_CLEAR(clear_module_state->__pyx_n_s_getOwnershipRange); Py_CLEAR(clear_module_state->__pyx_n_s_getOwnershipRanges); Py_CLEAR(clear_module_state->__pyx_n_s_getPC); Py_CLEAR(clear_module_state->__pyx_n_s_getPCSide); Py_CLEAR(clear_module_state->__pyx_n_s_getProblemType); Py_CLEAR(clear_module_state->__pyx_n_s_getProcSizes); Py_CLEAR(clear_module_state->__pyx_n_s_getRanges); Py_CLEAR(clear_module_state->__pyx_n_s_getRank); Py_CLEAR(clear_module_state->__pyx_n_s_getRefCount); Py_CLEAR(clear_module_state->__pyx_n_s_getResidualNorm); Py_CLEAR(clear_module_state->__pyx_n_s_getRhs); Py_CLEAR(clear_module_state->__pyx_n_s_getSNES); Py_CLEAR(clear_module_state->__pyx_n_s_getSection); Py_CLEAR(clear_module_state->__pyx_n_s_getSectionSF); Py_CLEAR(clear_module_state->__pyx_n_s_getSeed); Py_CLEAR(clear_module_state->__pyx_n_s_getSize); Py_CLEAR(clear_module_state->__pyx_n_s_getSizes); Py_CLEAR(clear_module_state->__pyx_n_s_getSolution); Py_CLEAR(clear_module_state->__pyx_n_s_getSolutionNorm); Py_CLEAR(clear_module_state->__pyx_n_s_getSolutionUpdate); Py_CLEAR(clear_module_state->__pyx_n_s_getStencil); Py_CLEAR(clear_module_state->__pyx_n_s_getStencilType); Py_CLEAR(clear_module_state->__pyx_n_s_getStencilWidth); Py_CLEAR(clear_module_state->__pyx_n_s_getStepFailures); Py_CLEAR(clear_module_state->__pyx_n_s_getStepNumber); Py_CLEAR(clear_module_state->__pyx_n_s_getStreamType); Py_CLEAR(clear_module_state->__pyx_n_s_getString); Py_CLEAR(clear_module_state->__pyx_n_s_getTime); Py_CLEAR(clear_module_state->__pyx_n_s_getTimeStep); Py_CLEAR(clear_module_state->__pyx_n_s_getTolerances); Py_CLEAR(clear_module_state->__pyx_n_s_getType); Py_CLEAR(clear_module_state->__pyx_n_s_getUseEW); Py_CLEAR(clear_module_state->__pyx_n_s_getUseFD); Py_CLEAR(clear_module_state->__pyx_n_s_getUseMF); Py_CLEAR(clear_module_state->__pyx_n_s_getValue); Py_CLEAR(clear_module_state->__pyx_kp_s_getVecArray_for_DMStag_not_yet_i); Py_CLEAR(clear_module_state->__pyx_n_s_getVecLeft); Py_CLEAR(clear_module_state->__pyx_n_s_getVecRight); Py_CLEAR(clear_module_state->__pyx_n_s_getVecs); Py_CLEAR(clear_module_state->__pyx_n_s_getVersion); Py_CLEAR(clear_module_state->__pyx_n_s_getVersionInfo); Py_CLEAR(clear_module_state->__pyx_n_s_getVisible); Py_CLEAR(clear_module_state->__pyx_n_s_get_2); Py_CLEAR(clear_module_state->__pyx_n_s_getstate); Py_CLEAR(clear_module_state->__pyx_n_s_ghostBcNodes); Py_CLEAR(clear_module_state->__pyx_n_s_ghosted); Py_CLEAR(clear_module_state->__pyx_n_s_ghosts); Py_CLEAR(clear_module_state->__pyx_kp_s_ghosts_size_d_array_size_d_and_v); Py_CLEAR(clear_module_state->__pyx_n_s_globalBcNodes); Py_CLEAR(clear_module_state->__pyx_kp_s_global_size_d_not_divisible_by_b); Py_CLEAR(clear_module_state->__pyx_n_s_globalsec); Py_CLEAR(clear_module_state->__pyx_n_s_gord); Py_CLEAR(clear_module_state->__pyx_kp_u_got); Py_CLEAR(clear_module_state->__pyx_kp_u_got_differing_extents_in_dimensi); Py_CLEAR(clear_module_state->__pyx_n_s_gradient); Py_CLEAR(clear_module_state->__pyx_n_s_group); Py_CLEAR(clear_module_state->__pyx_n_s_grtol); Py_CLEAR(clear_module_state->__pyx_n_s_gsec); Py_CLEAR(clear_module_state->__pyx_n_s_gtol); Py_CLEAR(clear_module_state->__pyx_n_s_gttol); Py_CLEAR(clear_module_state->__pyx_n_s_gv); Py_CLEAR(clear_module_state->__pyx_n_s_gvec); Py_CLEAR(clear_module_state->__pyx_n_s_h_max); Py_CLEAR(clear_module_state->__pyx_n_s_h_min); Py_CLEAR(clear_module_state->__pyx_n_s_handle); Py_CLEAR(clear_module_state->__pyx_n_s_has); Py_CLEAR(clear_module_state->__pyx_n_s_hasExternalPackage); Py_CLEAR(clear_module_state->__pyx_n_s_hasLabel); Py_CLEAR(clear_module_state->__pyx_n_s_hasLagrange); Py_CLEAR(clear_module_state->__pyx_n_s_hasName); Py_CLEAR(clear_module_state->__pyx_n_s_hausd); Py_CLEAR(clear_module_state->__pyx_n_s_hessian); Py_CLEAR(clear_module_state->__pyx_n_s_hiphandle); Py_CLEAR(clear_module_state->__pyx_n_s_hmax); Py_CLEAR(clear_module_state->__pyx_n_s_hmin); Py_CLEAR(clear_module_state->__pyx_n_s_hpddm_type); Py_CLEAR(clear_module_state->__pyx_n_s_hypretype); Py_CLEAR(clear_module_state->__pyx_n_s_i); Py_CLEAR(clear_module_state->__pyx_n_s_icntl); Py_CLEAR(clear_module_state->__pyx_n_s_id); Py_CLEAR(clear_module_state->__pyx_n_s_idx); Py_CLEAR(clear_module_state->__pyx_n_s_idxm); Py_CLEAR(clear_module_state->__pyx_n_s_ierr); Py_CLEAR(clear_module_state->__pyx_n_s_ignore); Py_CLEAR(clear_module_state->__pyx_n_s_ignoreOutsideDomain); Py_CLEAR(clear_module_state->__pyx_n_s_imag); Py_CLEAR(clear_module_state->__pyx_n_s_imagPart); Py_CLEAR(clear_module_state->__pyx_n_s_imex); Py_CLEAR(clear_module_state->__pyx_n_s_imode); Py_CLEAR(clear_module_state->__pyx_n_s_import); Py_CLEAR(clear_module_state->__pyx_n_s_inblocks); Py_CLEAR(clear_module_state->__pyx_kp_s_incompatible_array_sizes); Py_CLEAR(clear_module_state->__pyx_kp_s_incompatible_array_sizes_ni_d_nj); Py_CLEAR(clear_module_state->__pyx_kp_s_incompatible_array_sizes_ni_d_nv); Py_CLEAR(clear_module_state->__pyx_kp_s_incompatible_array_sizes_ni_d_nv_2); Py_CLEAR(clear_module_state->__pyx_kp_s_incompatible_array_sizes_nv_d); Py_CLEAR(clear_module_state->__pyx_n_s_index); Py_CLEAR(clear_module_state->__pyx_n_s_indicator); Py_CLEAR(clear_module_state->__pyx_n_s_indices); Py_CLEAR(clear_module_state->__pyx_n_s_info); Py_CLEAR(clear_module_state->__pyx_n_s_infoAllow); Py_CLEAR(clear_module_state->__pyx_n_s_init); Py_CLEAR(clear_module_state->__pyx_n_s_init_subclass); Py_CLEAR(clear_module_state->__pyx_n_s_initialguess); Py_CLEAR(clear_module_state->__pyx_n_s_initialize); Py_CLEAR(clear_module_state->__pyx_n_s_initializing); Py_CLEAR(clear_module_state->__pyx_kp_s_input_arrays_have_incompatible_s); Py_CLEAR(clear_module_state->__pyx_n_s_int); Py_CLEAR(clear_module_state->__pyx_n_s_interior); Py_CLEAR(clear_module_state->__pyx_n_s_interp_type); Py_CLEAR(clear_module_state->__pyx_n_s_interpolate); Py_CLEAR(clear_module_state->__pyx_n_s_interval); Py_CLEAR(clear_module_state->__pyx_n_s_invert); Py_CLEAR(clear_module_state->__pyx_n_s_is); Py_CLEAR(clear_module_state->__pyx_n_s_isActive); Py_CLEAR(clear_module_state->__pyx_n_s_isAssembled); Py_CLEAR(clear_module_state->__pyx_n_s_isFinalized); Py_CLEAR(clear_module_state->__pyx_n_s_isHermitian); Py_CLEAR(clear_module_state->__pyx_n_s_isIdentity); Py_CLEAR(clear_module_state->__pyx_n_s_isInitialized); Py_CLEAR(clear_module_state->__pyx_n_s_isPermutation); Py_CLEAR(clear_module_state->__pyx_n_s_isSimplex); Py_CLEAR(clear_module_state->__pyx_n_s_isSorted); Py_CLEAR(clear_module_state->__pyx_n_s_isStructurallySymmetric); Py_CLEAR(clear_module_state->__pyx_n_s_isSymmetric); Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); Py_CLEAR(clear_module_state->__pyx_n_s_is_from); Py_CLEAR(clear_module_state->__pyx_n_s_is_local); Py_CLEAR(clear_module_state->__pyx_n_s_is_to); Py_CLEAR(clear_module_state->__pyx_n_s_is_type); Py_CLEAR(clear_module_state->__pyx_n_s_iscol); Py_CLEAR(clear_module_state->__pyx_n_s_iscols); Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled); Py_CLEAR(clear_module_state->__pyx_n_s_iset); Py_CLEAR(clear_module_state->__pyx_n_s_isets); Py_CLEAR(clear_module_state->__pyx_n_s_isfields); Py_CLEAR(clear_module_state->__pyx_n_s_isotropic); Py_CLEAR(clear_module_state->__pyx_n_s_isperm); Py_CLEAR(clear_module_state->__pyx_n_s_isrow); Py_CLEAR(clear_module_state->__pyx_n_s_isrows); Py_CLEAR(clear_module_state->__pyx_n_s_itemsize); Py_CLEAR(clear_module_state->__pyx_kp_s_itemsize_0_for_cython_array); Py_CLEAR(clear_module_state->__pyx_n_s_its); Py_CLEAR(clear_module_state->__pyx_n_s_ival); Py_CLEAR(clear_module_state->__pyx_n_s_j); Py_CLEAR(clear_module_state->__pyx_n_s_jacobian); Py_CLEAR(clear_module_state->__pyx_n_s_jacobian_design); Py_CLEAR(clear_module_state->__pyx_n_s_jacobian_equality); Py_CLEAR(clear_module_state->__pyx_n_s_jacobian_state); Py_CLEAR(clear_module_state->__pyx_n_s_jacobianp); Py_CLEAR(clear_module_state->__pyx_n_s_join); Py_CLEAR(clear_module_state->__pyx_n_s_join_mode); Py_CLEAR(clear_module_state->__pyx_n_s_k); Py_CLEAR(clear_module_state->__pyx_n_s_kargs); Py_CLEAR(clear_module_state->__pyx_kp_s_key_d_cannot_register_s_already); Py_CLEAR(clear_module_state->__pyx_n_s_keys); Py_CLEAR(clear_module_state->__pyx_n_s_kind); Py_CLEAR(clear_module_state->__pyx_n_s_klass); Py_CLEAR(clear_module_state->__pyx_n_s_ksp); Py_CLEAR(clear_module_state->__pyx_n_s_ksp_type); Py_CLEAR(clear_module_state->__pyx_n_s_kwargs); Py_CLEAR(clear_module_state->__pyx_n_s_l); Py_CLEAR(clear_module_state->__pyx_n_s_l2l); Py_CLEAR(clear_module_state->__pyx_n_s_label); Py_CLEAR(clear_module_state->__pyx_n_s_labelName); Py_CLEAR(clear_module_state->__pyx_n_s_lambda); Py_CLEAR(clear_module_state->__pyx_n_s_lanes); Py_CLEAR(clear_module_state->__pyx_n_s_layoutType); Py_CLEAR(clear_module_state->__pyx_n_s_lda); Py_CLEAR(clear_module_state->__pyx_n_s_leafSection); Py_CLEAR(clear_module_state->__pyx_n_s_leafdata); Py_CLEAR(clear_module_state->__pyx_n_s_leafsize); Py_CLEAR(clear_module_state->__pyx_n_s_leafupdate); Py_CLEAR(clear_module_state->__pyx_n_s_left); Py_CLEAR(clear_module_state->__pyx_n_s_length); Py_CLEAR(clear_module_state->__pyx_n_s_level); Py_CLEAR(clear_module_state->__pyx_n_s_levels); Py_CLEAR(clear_module_state->__pyx_n_s_lgmap); Py_CLEAR(clear_module_state->__pyx_n_s_lgmap_type); Py_CLEAR(clear_module_state->__pyx_n_s_lgmapc); Py_CLEAR(clear_module_state->__pyx_n_s_lgmapr); Py_CLEAR(clear_module_state->__pyx_n_s_linear_its); Py_CLEAR(clear_module_state->__pyx_n_s_lits); Py_CLEAR(clear_module_state->__pyx_n_s_loc); Py_CLEAR(clear_module_state->__pyx_n_s_locC); Py_CLEAR(clear_module_state->__pyx_n_s_locX); Py_CLEAR(clear_module_state->__pyx_n_s_local); Py_CLEAR(clear_module_state->__pyx_kp_s_local_and_global_sizes_cannot_be); Py_CLEAR(clear_module_state->__pyx_kp_s_local_size_d_not_divisible_by_bl); Py_CLEAR(clear_module_state->__pyx_n_s_localsec); Py_CLEAR(clear_module_state->__pyx_n_s_locs); Py_CLEAR(clear_module_state->__pyx_n_s_logFlops); Py_CLEAR(clear_module_state->__pyx_n_s_lower); Py_CLEAR(clear_module_state->__pyx_n_s_ls_type); Py_CLEAR(clear_module_state->__pyx_n_s_ltog); Py_CLEAR(clear_module_state->__pyx_n_s_ltol); Py_CLEAR(clear_module_state->__pyx_n_s_lv); Py_CLEAR(clear_module_state->__pyx_n_s_lvec); Py_CLEAR(clear_module_state->__pyx_n_s_lvecs); Py_CLEAR(clear_module_state->__pyx_n_s_main); Py_CLEAR(clear_module_state->__pyx_n_s_major); Py_CLEAR(clear_module_state->__pyx_n_s_mallocs); Py_CLEAR(clear_module_state->__pyx_n_s_mat); Py_CLEAR(clear_module_state->__pyx_n_s_matApply); Py_CLEAR(clear_module_state->__pyx_n_s_matMult); Py_CLEAR(clear_module_state->__pyx_n_s_mat_type); Py_CLEAR(clear_module_state->__pyx_n_s_matpartitioning_type); Py_CLEAR(clear_module_state->__pyx_n_s_mats); Py_CLEAR(clear_module_state->__pyx_n_s_max); Py_CLEAR(clear_module_state->__pyx_n_s_maxDegree); Py_CLEAR(clear_module_state->__pyx_n_s_max_fails); Py_CLEAR(clear_module_state->__pyx_n_s_max_funcs); Py_CLEAR(clear_module_state->__pyx_n_s_max_it); Py_CLEAR(clear_module_state->__pyx_n_s_max_steps); Py_CLEAR(clear_module_state->__pyx_n_s_max_time); Py_CLEAR(clear_module_state->__pyx_n_s_maxrank); Py_CLEAR(clear_module_state->__pyx_n_s_maxval); Py_CLEAR(clear_module_state->__pyx_n_s_memo); Py_CLEAR(clear_module_state->__pyx_n_s_memory); Py_CLEAR(clear_module_state->__pyx_n_s_memview); Py_CLEAR(clear_module_state->__pyx_n_s_messageLength); Py_CLEAR(clear_module_state->__pyx_n_s_metaclass); Py_CLEAR(clear_module_state->__pyx_n_s_metric); Py_CLEAR(clear_module_state->__pyx_n_s_metric1); Py_CLEAR(clear_module_state->__pyx_n_s_metric2); Py_CLEAR(clear_module_state->__pyx_n_s_metric3); Py_CLEAR(clear_module_state->__pyx_n_s_metricAvg); Py_CLEAR(clear_module_state->__pyx_n_s_metricInt); Py_CLEAR(clear_module_state->__pyx_n_s_mgtype); Py_CLEAR(clear_module_state->__pyx_n_s_min); Py_CLEAR(clear_module_state->__pyx_n_s_minor); Py_CLEAR(clear_module_state->__pyx_n_s_mirror); Py_CLEAR(clear_module_state->__pyx_n_s_missingDiagonal); Py_CLEAR(clear_module_state->__pyx_n_s_mit); Py_CLEAR(clear_module_state->__pyx_n_s_mode); Py_CLEAR(clear_module_state->__pyx_n_s_model); Py_CLEAR(clear_module_state->__pyx_n_s_module); Py_CLEAR(clear_module_state->__pyx_n_s_monitor); Py_CLEAR(clear_module_state->__pyx_n_s_monitorCancel); Py_CLEAR(clear_module_state->__pyx_n_s_mpi4py); Py_CLEAR(clear_module_state->__pyx_kp_s_mpi4py_MPI); Py_CLEAR(clear_module_state->__pyx_n_s_mpiabort); Py_CLEAR(clear_module_state->__pyx_n_s_mro_entries); Py_CLEAR(clear_module_state->__pyx_n_s_msg); Py_CLEAR(clear_module_state->__pyx_n_s_mult); Py_CLEAR(clear_module_state->__pyx_n_s_multAdd); Py_CLEAR(clear_module_state->__pyx_n_s_multDiagonalBlock); Py_CLEAR(clear_module_state->__pyx_n_s_multHermitian); Py_CLEAR(clear_module_state->__pyx_n_s_multHermitianAdd); Py_CLEAR(clear_module_state->__pyx_n_s_multTranspose); Py_CLEAR(clear_module_state->__pyx_n_s_multTransposeAdd); Py_CLEAR(clear_module_state->__pyx_n_s_multirootdata); Py_CLEAR(clear_module_state->__pyx_n_s_n); Py_CLEAR(clear_module_state->__pyx_n_s_na); Py_CLEAR(clear_module_state->__pyx_n_s_name); Py_CLEAR(clear_module_state->__pyx_n_s_name_2); Py_CLEAR(clear_module_state->__pyx_n_s_name_3); Py_CLEAR(clear_module_state->__pyx_n_s_nbsteps); Py_CLEAR(clear_module_state->__pyx_n_s_nc); Py_CLEAR(clear_module_state->__pyx_n_s_ndim); Py_CLEAR(clear_module_state->__pyx_n_s_new); Py_CLEAR(clear_module_state->__pyx_n_s_newsec); Py_CLEAR(clear_module_state->__pyx_n_s_newvec); Py_CLEAR(clear_module_state->__pyx_n_s_ngs); Py_CLEAR(clear_module_state->__pyx_n_s_nlevels); Py_CLEAR(clear_module_state->__pyx_n_s_nlocal); Py_CLEAR(clear_module_state->__pyx_n_s_nmax); Py_CLEAR(clear_module_state->__pyx_n_s_nmin); Py_CLEAR(clear_module_state->__pyx_n_s_nnz); Py_CLEAR(clear_module_state->__pyx_n_s_noInsert); Py_CLEAR(clear_module_state->__pyx_n_s_noMove); Py_CLEAR(clear_module_state->__pyx_n_s_noSurf); Py_CLEAR(clear_module_state->__pyx_n_s_noSwap); Py_CLEAR(clear_module_state->__pyx_kp_s_no_default___reduce___due_to_non); Py_CLEAR(clear_module_state->__pyx_n_s_none); Py_CLEAR(clear_module_state->__pyx_n_s_nonzero); Py_CLEAR(clear_module_state->__pyx_n_s_norm); Py_CLEAR(clear_module_state->__pyx_n_s_norm_type); Py_CLEAR(clear_module_state->__pyx_n_s_normsched); Py_CLEAR(clear_module_state->__pyx_n_s_normtype); Py_CLEAR(clear_module_state->__pyx_n_s_npoints); Py_CLEAR(clear_module_state->__pyx_n_s_nroots); Py_CLEAR(clear_module_state->__pyx_n_s_nsd); Py_CLEAR(clear_module_state->__pyx_n_s_nsp); Py_CLEAR(clear_module_state->__pyx_n_s_nsubcomm); Py_CLEAR(clear_module_state->__pyx_n_s_null); Py_CLEAR(clear_module_state->__pyx_kp_s_null_communicator); Py_CLEAR(clear_module_state->__pyx_n_s_numBatches); Py_CLEAR(clear_module_state->__pyx_n_s_numBlocks); Py_CLEAR(clear_module_state->__pyx_n_s_numComp); Py_CLEAR(clear_module_state->__pyx_n_s_numDof); Py_CLEAR(clear_module_state->__pyx_n_s_numFields); Py_CLEAR(clear_module_state->__pyx_n_s_numIter); Py_CLEAR(clear_module_state->__pyx_n_s_numMessages); Py_CLEAR(clear_module_state->__pyx_n_s_numProcs); Py_CLEAR(clear_module_state->__pyx_n_s_numReductions); Py_CLEAR(clear_module_state->__pyx_n_s_numSumSpaces); Py_CLEAR(clear_module_state->__pyx_n_s_numTensSpaces); Py_CLEAR(clear_module_state->__pyx_kp_s_number_of_dimensions_d_and_numbe); Py_CLEAR(clear_module_state->__pyx_n_s_nz_allocated); Py_CLEAR(clear_module_state->__pyx_n_s_nz_unneeded); Py_CLEAR(clear_module_state->__pyx_n_s_nz_used); Py_CLEAR(clear_module_state->__pyx_n_s_nzdiag); Py_CLEAR(clear_module_state->__pyx_n_s_obj); Py_CLEAR(clear_module_state->__pyx_n_s_object); Py_CLEAR(clear_module_state->__pyx_n_s_objective); Py_CLEAR(clear_module_state->__pyx_n_s_objgrad); Py_CLEAR(clear_module_state->__pyx_n_s_offset); Py_CLEAR(clear_module_state->__pyx_n_s_omega); Py_CLEAR(clear_module_state->__pyx_n_s_ometric); Py_CLEAR(clear_module_state->__pyx_kp_s_only_and); Py_CLEAR(clear_module_state->__pyx_n_s_onnz); Py_CLEAR(clear_module_state->__pyx_n_s_op); Py_CLEAR(clear_module_state->__pyx_n_s_open); Py_CLEAR(clear_module_state->__pyx_n_s_operator); Py_CLEAR(clear_module_state->__pyx_n_s_operators); Py_CLEAR(clear_module_state->__pyx_n_s_option); Py_CLEAR(clear_module_state->__pyx_kp_s_option_prefix_must_be_string); Py_CLEAR(clear_module_state->__pyx_kp_s_option_prefix_should_not_have_sp); Py_CLEAR(clear_module_state->__pyx_kp_s_option_prefix_should_not_start_w); Py_CLEAR(clear_module_state->__pyx_n_s_options); Py_CLEAR(clear_module_state->__pyx_n_s_opts); Py_CLEAR(clear_module_state->__pyx_n_s_ord_type); Py_CLEAR(clear_module_state->__pyx_n_s_order); Py_CLEAR(clear_module_state->__pyx_n_s_orientation); Py_CLEAR(clear_module_state->__pyx_n_s_other); Py_CLEAR(clear_module_state->__pyx_n_s_otype); Py_CLEAR(clear_module_state->__pyx_n_s_out); Py_CLEAR(clear_module_state->__pyx_n_s_output); Py_CLEAR(clear_module_state->__pyx_n_s_overlap); Py_CLEAR(clear_module_state->__pyx_kp_s_ownership_range_size_d_and_numbe); Py_CLEAR(clear_module_state->__pyx_n_s_ownership_ranges); Py_CLEAR(clear_module_state->__pyx_n_s_ozz); Py_CLEAR(clear_module_state->__pyx_n_s_p); Py_CLEAR(clear_module_state->__pyx_n_s_p1); Py_CLEAR(clear_module_state->__pyx_n_s_pEnd); Py_CLEAR(clear_module_state->__pyx_n_s_pStart); Py_CLEAR(clear_module_state->__pyx_n_s_pack); Py_CLEAR(clear_module_state->__pyx_n_s_package); Py_CLEAR(clear_module_state->__pyx_n_s_package_2); Py_CLEAR(clear_module_state->__pyx_n_s_parallel); Py_CLEAR(clear_module_state->__pyx_n_s_parent); Py_CLEAR(clear_module_state->__pyx_n_s_part); Py_CLEAR(clear_module_state->__pyx_n_s_part_type); Py_CLEAR(clear_module_state->__pyx_n_s_partitioning); Py_CLEAR(clear_module_state->__pyx_n_s_pc); Py_CLEAR(clear_module_state->__pyx_n_s_pc_type); Py_CLEAR(clear_module_state->__pyx_n_s_pd); Py_CLEAR(clear_module_state->__pyx_n_s_periodic); Py_CLEAR(clear_module_state->__pyx_n_s_perm); Py_CLEAR(clear_module_state->__pyx_n_s_permutation); Py_CLEAR(clear_module_state->__pyx_n_s_petsc); Py_CLEAR(clear_module_state->__pyx_n_s_petsc4py_PETSc); Py_CLEAR(clear_module_state->__pyx_kp_s_petsc4py_PETSc_Device_pyx); Py_CLEAR(clear_module_state->__pyx_kp_s_petsc4py_PETSc_Error_pyx); Py_CLEAR(clear_module_state->__pyx_kp_s_petsc4py_PETSc_Log_pyx); Py_CLEAR(clear_module_state->__pyx_kp_s_petsc4py_PETSc_PETSc_pyx); Py_CLEAR(clear_module_state->__pyx_kp_s_petsc4py_PETSc_cyclicgc_pxi); Py_CLEAR(clear_module_state->__pyx_n_s_pi); Py_CLEAR(clear_module_state->__pyx_n_s_pickle); Py_CLEAR(clear_module_state->__pyx_n_s_pj); Py_CLEAR(clear_module_state->__pyx_n_s_plexname); Py_CLEAR(clear_module_state->__pyx_n_s_point); Py_CLEAR(clear_module_state->__pyx_n_s_points); Py_CLEAR(clear_module_state->__pyx_n_s_pop); Py_CLEAR(clear_module_state->__pyx_n_s_popErrorHandler); Py_CLEAR(clear_module_state->__pyx_n_s_popSignalHandler); Py_CLEAR(clear_module_state->__pyx_n_s_pop_python_vfprintf); Py_CLEAR(clear_module_state->__pyx_n_s_position); Py_CLEAR(clear_module_state->__pyx_n_s_positive_definite); Py_CLEAR(clear_module_state->__pyx_n_s_postSolve); Py_CLEAR(clear_module_state->__pyx_n_s_postStep); Py_CLEAR(clear_module_state->__pyx_n_s_postevent); Py_CLEAR(clear_module_state->__pyx_n_s_poststep); Py_CLEAR(clear_module_state->__pyx_n_s_pre); Py_CLEAR(clear_module_state->__pyx_n_s_preSolve); Py_CLEAR(clear_module_state->__pyx_n_s_preStep); Py_CLEAR(clear_module_state->__pyx_n_s_pre_finalize); Py_CLEAR(clear_module_state->__pyx_n_s_precheck); Py_CLEAR(clear_module_state->__pyx_n_s_prefix); Py_CLEAR(clear_module_state->__pyx_kp_s_prefix_s_name_s); Py_CLEAR(clear_module_state->__pyx_n_s_prepare); Py_CLEAR(clear_module_state->__pyx_n_s_prestep); Py_CLEAR(clear_module_state->__pyx_n_s_primv); Py_CLEAR(clear_module_state->__pyx_n_s_proc_sizes); Py_CLEAR(clear_module_state->__pyx_n_s_productNumeric); Py_CLEAR(clear_module_state->__pyx_n_s_productSetFromOptions); Py_CLEAR(clear_module_state->__pyx_n_s_productSymbolic); Py_CLEAR(clear_module_state->__pyx_n_s_property); Py_CLEAR(clear_module_state->__pyx_n_s_ptap); Py_CLEAR(clear_module_state->__pyx_n_s_ptype); Py_CLEAR(clear_module_state->__pyx_n_s_push); Py_CLEAR(clear_module_state->__pyx_n_s_pushErrorHandler); Py_CLEAR(clear_module_state->__pyx_n_s_push_python_vfprintf); Py_CLEAR(clear_module_state->__pyx_n_s_py_sub_ctxs); Py_CLEAR(clear_module_state->__pyx_n_s_py_type); Py_CLEAR(clear_module_state->__pyx_n_s_python); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_PickleError); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_checksum); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_result); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_state); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_type); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_unpickle_Enum); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_vtable); Py_CLEAR(clear_module_state->__pyx_n_s_q0); Py_CLEAR(clear_module_state->__pyx_n_s_q1); Py_CLEAR(clear_module_state->__pyx_n_s_qorder); Py_CLEAR(clear_module_state->__pyx_n_s_quad); Py_CLEAR(clear_module_state->__pyx_n_s_qualname); Py_CLEAR(clear_module_state->__pyx_n_s_r); Py_CLEAR(clear_module_state->__pyx_kp_s_r_2); Py_CLEAR(clear_module_state->__pyx_n_s_radius); Py_CLEAR(clear_module_state->__pyx_n_s_random); Py_CLEAR(clear_module_state->__pyx_n_s_range); Py_CLEAR(clear_module_state->__pyx_n_s_ranges); Py_CLEAR(clear_module_state->__pyx_n_s_rank); Py_CLEAR(clear_module_state->__pyx_n_s_read); Py_CLEAR(clear_module_state->__pyx_n_s_readonly); Py_CLEAR(clear_module_state->__pyx_kp_s_readonly_attribute); Py_CLEAR(clear_module_state->__pyx_n_s_ready); Py_CLEAR(clear_module_state->__pyx_n_s_real); Py_CLEAR(clear_module_state->__pyx_n_s_realPart); Py_CLEAR(clear_module_state->__pyx_n_s_reason); Py_CLEAR(clear_module_state->__pyx_n_s_reciprocal); Py_CLEAR(clear_module_state->__pyx_n_s_red); Py_CLEAR(clear_module_state->__pyx_n_s_reduce); Py_CLEAR(clear_module_state->__pyx_n_s_reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_reduce_ex); Py_CLEAR(clear_module_state->__pyx_n_s_redundant); Py_CLEAR(clear_module_state->__pyx_n_s_redundantPoints); Py_CLEAR(clear_module_state->__pyx_n_s_refine); Py_CLEAR(clear_module_state->__pyx_n_s_refine_x); Py_CLEAR(clear_module_state->__pyx_n_s_refine_y); Py_CLEAR(clear_module_state->__pyx_n_s_refine_z); Py_CLEAR(clear_module_state->__pyx_n_s_refinementLimit); Py_CLEAR(clear_module_state->__pyx_n_s_refinementUniform); Py_CLEAR(clear_module_state->__pyx_n_s_register); Py_CLEAR(clear_module_state->__pyx_n_s_registerCitation); Py_CLEAR(clear_module_state->__pyx_n_s_release); Py_CLEAR(clear_module_state->__pyx_n_s_remote); Py_CLEAR(clear_module_state->__pyx_n_s_remoteOffsets); Py_CLEAR(clear_module_state->__pyx_n_s_remove); Py_CLEAR(clear_module_state->__pyx_n_s_remove_sent_points); Py_CLEAR(clear_module_state->__pyx_n_s_replace); Py_CLEAR(clear_module_state->__pyx_n_s_repr); Py_CLEAR(clear_module_state->__pyx_n_s_res); Py_CLEAR(clear_module_state->__pyx_n_s_reset); Py_CLEAR(clear_module_state->__pyx_n_s_reshape); Py_CLEAR(clear_module_state->__pyx_n_s_residual); Py_CLEAR(clear_module_state->__pyx_n_s_restart); Py_CLEAR(clear_module_state->__pyx_n_s_restrictAnisotropy); Py_CLEAR(clear_module_state->__pyx_n_s_restrictAnisotropyFirst); Py_CLEAR(clear_module_state->__pyx_n_s_restrictSizes); Py_CLEAR(clear_module_state->__pyx_n_s_restricthook); Py_CLEAR(clear_module_state->__pyx_n_s_result); Py_CLEAR(clear_module_state->__pyx_n_s_reuse); Py_CLEAR(clear_module_state->__pyx_n_s_reverse); Py_CLEAR(clear_module_state->__pyx_n_s_rgLabel); Py_CLEAR(clear_module_state->__pyx_n_s_rhs); Py_CLEAR(clear_module_state->__pyx_n_s_rhsjacobianp); Py_CLEAR(clear_module_state->__pyx_n_s_right); Py_CLEAR(clear_module_state->__pyx_n_s_rmap); Py_CLEAR(clear_module_state->__pyx_n_s_rnd_type); Py_CLEAR(clear_module_state->__pyx_n_s_rnorm); Py_CLEAR(clear_module_state->__pyx_n_s_rollback); Py_CLEAR(clear_module_state->__pyx_n_s_rootSection); Py_CLEAR(clear_module_state->__pyx_n_s_rootdata); Py_CLEAR(clear_module_state->__pyx_n_s_row); Py_CLEAR(clear_module_state->__pyx_n_s_row_bsize); Py_CLEAR(clear_module_state->__pyx_kp_s_row_indices_must_have_two_dimens); Py_CLEAR(clear_module_state->__pyx_n_s_rowmap); Py_CLEAR(clear_module_state->__pyx_n_s_rows); Py_CLEAR(clear_module_state->__pyx_n_s_rscale); Py_CLEAR(clear_module_state->__pyx_n_s_rsplit); Py_CLEAR(clear_module_state->__pyx_n_s_rtol); Py_CLEAR(clear_module_state->__pyx_n_s_rtol_0); Py_CLEAR(clear_module_state->__pyx_n_s_rtol_max); Py_CLEAR(clear_module_state->__pyx_n_s_rw); Py_CLEAR(clear_module_state->__pyx_kp_s_s); Py_CLEAR(clear_module_state->__pyx_n_s_s_2); Py_CLEAR(clear_module_state->__pyx_kp_s_s_at_s_d); Py_CLEAR(clear_module_state->__pyx_kp_s_s_s); Py_CLEAR(clear_module_state->__pyx_n_s_scale); Py_CLEAR(clear_module_state->__pyx_n_s_scatter); Py_CLEAR(clear_module_state->__pyx_n_s_scatterBegin); Py_CLEAR(clear_module_state->__pyx_n_s_scatterEnd); Py_CLEAR(clear_module_state->__pyx_n_s_scatter_type); Py_CLEAR(clear_module_state->__pyx_n_s_sec); Py_CLEAR(clear_module_state->__pyx_n_s_seconds); Py_CLEAR(clear_module_state->__pyx_n_s_sectiondm); Py_CLEAR(clear_module_state->__pyx_n_s_seed); Py_CLEAR(clear_module_state->__pyx_n_s_selected); Py_CLEAR(clear_module_state->__pyx_n_s_self); Py_CLEAR(clear_module_state->__pyx_n_s_sep); Py_CLEAR(clear_module_state->__pyx_n_s_setActive); Py_CLEAR(clear_module_state->__pyx_n_s_setActiveAll); Py_CLEAR(clear_module_state->__pyx_n_s_setAppCtx); Py_CLEAR(clear_module_state->__pyx_n_s_setApplicationContext); Py_CLEAR(clear_module_state->__pyx_n_s_setConvergedReason); Py_CLEAR(clear_module_state->__pyx_n_s_setCurrent); Py_CLEAR(clear_module_state->__pyx_n_s_setDM); Py_CLEAR(clear_module_state->__pyx_n_s_setDS); Py_CLEAR(clear_module_state->__pyx_n_s_setDefaultComm); Py_CLEAR(clear_module_state->__pyx_n_s_setDefaultGlobalSection); Py_CLEAR(clear_module_state->__pyx_n_s_setDefaultLocalSection); Py_CLEAR(clear_module_state->__pyx_n_s_setDefaultSF); Py_CLEAR(clear_module_state->__pyx_n_s_setDefaultSection); Py_CLEAR(clear_module_state->__pyx_n_s_setDefaultType); Py_CLEAR(clear_module_state->__pyx_n_s_setDevice); Py_CLEAR(clear_module_state->__pyx_n_s_setDiagonal); Py_CLEAR(clear_module_state->__pyx_n_s_setDimension); Py_CLEAR(clear_module_state->__pyx_n_s_setEquationType); Py_CLEAR(clear_module_state->__pyx_n_s_setFromOptions); Py_CLEAR(clear_module_state->__pyx_n_s_setFunctionNorm); Py_CLEAR(clear_module_state->__pyx_n_s_setFunctionTolerances); Py_CLEAR(clear_module_state->__pyx_n_s_setGlobalSection); Py_CLEAR(clear_module_state->__pyx_n_s_setInitial); Py_CLEAR(clear_module_state->__pyx_n_s_setInitialGuessKnoll); Py_CLEAR(clear_module_state->__pyx_n_s_setInitialGuessNonzero); Py_CLEAR(clear_module_state->__pyx_n_s_setInterval); Py_CLEAR(clear_module_state->__pyx_n_s_setIterationNumber); Py_CLEAR(clear_module_state->__pyx_n_s_setKSP); Py_CLEAR(clear_module_state->__pyx_n_s_setLocalSection); Py_CLEAR(clear_module_state->__pyx_n_s_setMaxFunctionEvaluations); Py_CLEAR(clear_module_state->__pyx_n_s_setMaxKSPFailures); Py_CLEAR(clear_module_state->__pyx_n_s_setMaxLinearSolveFailures); Py_CLEAR(clear_module_state->__pyx_n_s_setMaxNonlinearStepFailures); Py_CLEAR(clear_module_state->__pyx_n_s_setMaxStepFailures); Py_CLEAR(clear_module_state->__pyx_n_s_setMaxSteps); Py_CLEAR(clear_module_state->__pyx_n_s_setMaxTime); Py_CLEAR(clear_module_state->__pyx_n_s_setMonitor); Py_CLEAR(clear_module_state->__pyx_n_s_setNPC); Py_CLEAR(clear_module_state->__pyx_n_s_setName); Py_CLEAR(clear_module_state->__pyx_n_s_setNormType); Py_CLEAR(clear_module_state->__pyx_n_s_setOption); Py_CLEAR(clear_module_state->__pyx_n_s_setOptionsPrefix); Py_CLEAR(clear_module_state->__pyx_n_s_setPCSide); Py_CLEAR(clear_module_state->__pyx_n_s_setParamsEW); Py_CLEAR(clear_module_state->__pyx_n_s_setProblemType); Py_CLEAR(clear_module_state->__pyx_n_s_setResidualNorm); Py_CLEAR(clear_module_state->__pyx_n_s_setSection); Py_CLEAR(clear_module_state->__pyx_n_s_setSectionSF); Py_CLEAR(clear_module_state->__pyx_n_s_setSeed); Py_CLEAR(clear_module_state->__pyx_n_s_setSizes); Py_CLEAR(clear_module_state->__pyx_n_s_setSolution); Py_CLEAR(clear_module_state->__pyx_n_s_setStepNumber); Py_CLEAR(clear_module_state->__pyx_n_s_setStreamType); Py_CLEAR(clear_module_state->__pyx_n_s_setTime); Py_CLEAR(clear_module_state->__pyx_n_s_setTimeStep); Py_CLEAR(clear_module_state->__pyx_n_s_setTolerances); Py_CLEAR(clear_module_state->__pyx_n_s_setType); Py_CLEAR(clear_module_state->__pyx_n_s_setUp); Py_CLEAR(clear_module_state->__pyx_n_s_setUseEW); Py_CLEAR(clear_module_state->__pyx_n_s_setUseFD); Py_CLEAR(clear_module_state->__pyx_n_s_setUseMF); Py_CLEAR(clear_module_state->__pyx_n_s_setValue); Py_CLEAR(clear_module_state->__pyx_n_s_setVisible); Py_CLEAR(clear_module_state->__pyx_n_s_set_name); Py_CLEAR(clear_module_state->__pyx_n_s_setstate); Py_CLEAR(clear_module_state->__pyx_n_s_setstate_cython); Py_CLEAR(clear_module_state->__pyx_n_s_setup); Py_CLEAR(clear_module_state->__pyx_n_s_sf); Py_CLEAR(clear_module_state->__pyx_n_s_sf_type); Py_CLEAR(clear_module_state->__pyx_n_s_sfxc); Py_CLEAR(clear_module_state->__pyx_n_s_shape); Py_CLEAR(clear_module_state->__pyx_n_s_shift); Py_CLEAR(clear_module_state->__pyx_n_s_shift_type); Py_CLEAR(clear_module_state->__pyx_n_s_shiftamount); Py_CLEAR(clear_module_state->__pyx_n_s_shifttype); Py_CLEAR(clear_module_state->__pyx_n_s_side); Py_CLEAR(clear_module_state->__pyx_kp_s_side_r_not_understood); Py_CLEAR(clear_module_state->__pyx_n_s_simplex); Py_CLEAR(clear_module_state->__pyx_n_s_size); Py_CLEAR(clear_module_state->__pyx_kp_s_size_I_is_d_expected_d); Py_CLEAR(clear_module_state->__pyx_kp_s_size_J_is_d_expected_d); Py_CLEAR(clear_module_state->__pyx_kp_s_size_V_is_d_expected_d); Py_CLEAR(clear_module_state->__pyx_kp_s_size_array_is_d_expected_dx_d_d); Py_CLEAR(clear_module_state->__pyx_kp_s_size_d_nnz_is_d_expected_d); Py_CLEAR(clear_module_state->__pyx_kp_s_size_o_nnz_is_d_expected_d); Py_CLEAR(clear_module_state->__pyx_n_s_sizes); Py_CLEAR(clear_module_state->__pyx_kp_s_sizes_array_should_have_d_entrie); Py_CLEAR(clear_module_state->__pyx_n_s_skip); Py_CLEAR(clear_module_state->__pyx_n_s_sleep); Py_CLEAR(clear_module_state->__pyx_n_s_smooths); Py_CLEAR(clear_module_state->__pyx_n_s_snes); Py_CLEAR(clear_module_state->__pyx_n_s_snes_type); Py_CLEAR(clear_module_state->__pyx_n_s_solve); Py_CLEAR(clear_module_state->__pyx_n_s_solveAdd); Py_CLEAR(clear_module_state->__pyx_n_s_solveStep); Py_CLEAR(clear_module_state->__pyx_n_s_solveTranspose); Py_CLEAR(clear_module_state->__pyx_n_s_solveTransposeAdd); Py_CLEAR(clear_module_state->__pyx_n_s_solver); Py_CLEAR(clear_module_state->__pyx_n_s_sortype); Py_CLEAR(clear_module_state->__pyx_n_s_sp); Py_CLEAR(clear_module_state->__pyx_n_s_space_type); Py_CLEAR(clear_module_state->__pyx_n_s_spec); Py_CLEAR(clear_module_state->__pyx_n_s_split); Py_CLEAR(clear_module_state->__pyx_n_s_splitOwnership); Py_CLEAR(clear_module_state->__pyx_n_s_stage); Py_CLEAR(clear_module_state->__pyx_n_s_star); Py_CLEAR(clear_module_state->__pyx_n_s_start); Py_CLEAR(clear_module_state->__pyx_n_s_starts); Py_CLEAR(clear_module_state->__pyx_n_s_startswith); Py_CLEAR(clear_module_state->__pyx_n_s_state); Py_CLEAR(clear_module_state->__pyx_n_s_staticmethod); Py_CLEAR(clear_module_state->__pyx_n_s_staticproperty); Py_CLEAR(clear_module_state->__pyx_n_s_staticproperty___get); Py_CLEAR(clear_module_state->__pyx_n_s_stderr); Py_CLEAR(clear_module_state->__pyx_n_s_stderr_2); Py_CLEAR(clear_module_state->__pyx_n_s_stdout); Py_CLEAR(clear_module_state->__pyx_n_s_stdout_2); Py_CLEAR(clear_module_state->__pyx_n_s_stdout_is_stderr); Py_CLEAR(clear_module_state->__pyx_n_s_stencil_type); Py_CLEAR(clear_module_state->__pyx_n_s_stencil_width); Py_CLEAR(clear_module_state->__pyx_n_s_stenciltype); Py_CLEAR(clear_module_state->__pyx_n_s_step); Py_CLEAR(clear_module_state->__pyx_n_s_stepTranspose); Py_CLEAR(clear_module_state->__pyx_n_s_step_number); Py_CLEAR(clear_module_state->__pyx_n_s_stol); Py_CLEAR(clear_module_state->__pyx_n_s_stop); Py_CLEAR(clear_module_state->__pyx_n_s_str); Py_CLEAR(clear_module_state->__pyx_n_s_strata); Py_CLEAR(clear_module_state->__pyx_n_s_stratum); Py_CLEAR(clear_module_state->__pyx_n_s_stream); Py_CLEAR(clear_module_state->__pyx_n_s_stream_type); Py_CLEAR(clear_module_state->__pyx_kp_s_strided_and_direct); Py_CLEAR(clear_module_state->__pyx_kp_s_strided_and_direct_or_indirect); Py_CLEAR(clear_module_state->__pyx_kp_s_strided_and_indirect); Py_CLEAR(clear_module_state->__pyx_n_s_strides); Py_CLEAR(clear_module_state->__pyx_n_s_string); Py_CLEAR(clear_module_state->__pyx_kp_s_stringsource); Py_CLEAR(clear_module_state->__pyx_n_s_strip); Py_CLEAR(clear_module_state->__pyx_n_s_struct); Py_CLEAR(clear_module_state->__pyx_n_s_structure); Py_CLEAR(clear_module_state->__pyx_n_s_sub); Py_CLEAR(clear_module_state->__pyx_n_s_subcomm); Py_CLEAR(clear_module_state->__pyx_n_s_subdm); Py_CLEAR(clear_module_state->__pyx_n_s_submat); Py_CLEAR(clear_module_state->__pyx_n_s_submats); Py_CLEAR(clear_module_state->__pyx_n_s_subminor); Py_CLEAR(clear_module_state->__pyx_n_s_subsp); Py_CLEAR(clear_module_state->__pyx_n_s_subspaceOffsets); Py_CLEAR(clear_module_state->__pyx_n_s_subvec); Py_CLEAR(clear_module_state->__pyx_n_s_super); Py_CLEAR(clear_module_state->__pyx_n_s_supp); Py_CLEAR(clear_module_state->__pyx_n_s_svalue); Py_CLEAR(clear_module_state->__pyx_n_s_swidth); Py_CLEAR(clear_module_state->__pyx_n_s_sx); Py_CLEAR(clear_module_state->__pyx_n_s_sym); Py_CLEAR(clear_module_state->__pyx_n_s_symmetric); Py_CLEAR(clear_module_state->__pyx_n_s_syncFlush); Py_CLEAR(clear_module_state->__pyx_n_s_syncPrint); Py_CLEAR(clear_module_state->__pyx_n_s_sys); Py_CLEAR(clear_module_state->__pyx_n_s_t); Py_CLEAR(clear_module_state->__pyx_n_s_tab); Py_CLEAR(clear_module_state->__pyx_n_s_tabs); Py_CLEAR(clear_module_state->__pyx_n_s_tao); Py_CLEAR(clear_module_state->__pyx_n_s_tao_type); Py_CLEAR(clear_module_state->__pyx_n_s_targetComplexity); Py_CLEAR(clear_module_state->__pyx_n_s_tbline); Py_CLEAR(clear_module_state->__pyx_n_s_tblist); Py_CLEAR(clear_module_state->__pyx_n_s_tensor); Py_CLEAR(clear_module_state->__pyx_n_s_terminate); Py_CLEAR(clear_module_state->__pyx_n_s_theta); Py_CLEAR(clear_module_state->__pyx_n_s_threshold); Py_CLEAR(clear_module_state->__pyx_n_s_time); Py_CLEAR(clear_module_state->__pyx_n_s_time_step); Py_CLEAR(clear_module_state->__pyx_n_s_timestep); Py_CLEAR(clear_module_state->__pyx_n_s_title); Py_CLEAR(clear_module_state->__pyx_n_s_toAll); Py_CLEAR(clear_module_state->__pyx_n_s_toDLPack); Py_CLEAR(clear_module_state->__pyx_n_s_toZero); Py_CLEAR(clear_module_state->__pyx_n_s_toindx); Py_CLEAR(clear_module_state->__pyx_n_s_tol); Py_CLEAR(clear_module_state->__pyx_n_s_tr_type); Py_CLEAR(clear_module_state->__pyx_n_s_traceback); Py_CLEAR(clear_module_state->__pyx_n_s_traceback_2); Py_CLEAR(clear_module_state->__pyx_n_s_trans); Py_CLEAR(clear_module_state->__pyx_n_s_transpose); Py_CLEAR(clear_module_state->__pyx_n_s_trimmed); Py_CLEAR(clear_module_state->__pyx_n_s_ts_type); Py_CLEAR(clear_module_state->__pyx_n_s_tspan); Py_CLEAR(clear_module_state->__pyx_n_s_twist); Py_CLEAR(clear_module_state->__pyx_n_s_typ); Py_CLEAR(clear_module_state->__pyx_n_s_type_registry); Py_CLEAR(clear_module_state->__pyx_n_s_typestr); Py_CLEAR(clear_module_state->__pyx_n_s_u); Py_CLEAR(clear_module_state->__pyx_n_s_ua); Py_CLEAR(clear_module_state->__pyx_n_s_uaux); Py_CLEAR(clear_module_state->__pyx_n_s_uis); Py_CLEAR(clear_module_state->__pyx_kp_s_unable_to_allocate_array_data); Py_CLEAR(clear_module_state->__pyx_kp_s_unable_to_allocate_shape_and_str); Py_CLEAR(clear_module_state->__pyx_kp_s_unhandled_PetscDeviceContextJoin); Py_CLEAR(clear_module_state->__pyx_kp_s_unhandled_PetscDeviceType_d); Py_CLEAR(clear_module_state->__pyx_kp_s_unhandled_PetscStreamType_d); Py_CLEAR(clear_module_state->__pyx_n_s_uniform); Py_CLEAR(clear_module_state->__pyx_n_s_unit); Py_CLEAR(clear_module_state->__pyx_kp_s_unknown_boundary_type_s); Py_CLEAR(clear_module_state->__pyx_kp_s_unknown_device_type_s); Py_CLEAR(clear_module_state->__pyx_kp_s_unknown_element_type_s); Py_CLEAR(clear_module_state->__pyx_kp_u_unknown_error_handler); Py_CLEAR(clear_module_state->__pyx_kp_s_unknown_interpolation_type_s); Py_CLEAR(clear_module_state->__pyx_kp_s_unknown_join_mode_s); Py_CLEAR(clear_module_state->__pyx_kp_s_unknown_options_s); Py_CLEAR(clear_module_state->__pyx_kp_s_unknown_scatter_mode_s); Py_CLEAR(clear_module_state->__pyx_kp_s_unknown_shift_type_s); Py_CLEAR(clear_module_state->__pyx_kp_s_unknown_stencil_location_type_s); Py_CLEAR(clear_module_state->__pyx_kp_s_unknown_stencil_type_s); Py_CLEAR(clear_module_state->__pyx_kp_s_unknown_stream_type_s); Py_CLEAR(clear_module_state->__pyx_n_s_unnamed); Py_CLEAR(clear_module_state->__pyx_n_s_unpack); Py_CLEAR(clear_module_state->__pyx_n_s_up); Py_CLEAR(clear_module_state->__pyx_n_s_up_left); Py_CLEAR(clear_module_state->__pyx_n_s_up_right); Py_CLEAR(clear_module_state->__pyx_n_s_update); Py_CLEAR(clear_module_state->__pyx_n_s_upper); Py_CLEAR(clear_module_state->__pyx_n_s_useAnchors); Py_CLEAR(clear_module_state->__pyx_n_s_useClosure); Py_CLEAR(clear_module_state->__pyx_n_s_useCone); Py_CLEAR(clear_module_state->__pyx_n_s_useInitialGuess); Py_CLEAR(clear_module_state->__pyx_n_s_v); Py_CLEAR(clear_module_state->__pyx_n_s_val); Py_CLEAR(clear_module_state->__pyx_n_s_value); Py_CLEAR(clear_module_state->__pyx_n_s_values); Py_CLEAR(clear_module_state->__pyx_kp_s_values_must_have_two_or_more_dim); Py_CLEAR(clear_module_state->__pyx_n_s_varbounds); Py_CLEAR(clear_module_state->__pyx_n_s_vec); Py_CLEAR(clear_module_state->__pyx_n_s_vecTo); Py_CLEAR(clear_module_state->__pyx_n_s_vec_from); Py_CLEAR(clear_module_state->__pyx_n_s_vec_to); Py_CLEAR(clear_module_state->__pyx_n_s_vec_type); Py_CLEAR(clear_module_state->__pyx_n_s_vecs); Py_CLEAR(clear_module_state->__pyx_n_s_vectors); Py_CLEAR(clear_module_state->__pyx_n_s_verbosity); Py_CLEAR(clear_module_state->__pyx_n_s_version); Py_CLEAR(clear_module_state->__pyx_n_s_version_info); Py_CLEAR(clear_module_state->__pyx_n_s_vg); Py_CLEAR(clear_module_state->__pyx_n_s_viennaclvechandle); Py_CLEAR(clear_module_state->__pyx_n_s_view); Py_CLEAR(clear_module_state->__pyx_n_s_viewer); Py_CLEAR(clear_module_state->__pyx_n_s_vl); Py_CLEAR(clear_module_state->__pyx_n_s_vlg); Py_CLEAR(clear_module_state->__pyx_n_s_vm); Py_CLEAR(clear_module_state->__pyx_n_s_vn); Py_CLEAR(clear_module_state->__pyx_n_s_vtol); Py_CLEAR(clear_module_state->__pyx_n_s_vwr_type); Py_CLEAR(clear_module_state->__pyx_n_s_w); Py_CLEAR(clear_module_state->__pyx_kp_s_w_2); Py_CLEAR(clear_module_state->__pyx_n_s_weight); Py_CLEAR(clear_module_state->__pyx_n_s_width); Py_CLEAR(clear_module_state->__pyx_n_s_wrapped_func); Py_CLEAR(clear_module_state->__pyx_n_s_wraps); Py_CLEAR(clear_module_state->__pyx_n_s_write); Py_CLEAR(clear_module_state->__pyx_n_s_x); Py_CLEAR(clear_module_state->__pyx_n_s_xdot); Py_CLEAR(clear_module_state->__pyx_n_s_xdotdot); Py_CLEAR(clear_module_state->__pyx_n_s_xl); Py_CLEAR(clear_module_state->__pyx_n_s_xmax); Py_CLEAR(clear_module_state->__pyx_n_s_xmin); Py_CLEAR(clear_module_state->__pyx_n_s_xnorm); Py_CLEAR(clear_module_state->__pyx_n_s_xu); Py_CLEAR(clear_module_state->__pyx_n_s_y); Py_CLEAR(clear_module_state->__pyx_n_s_ymax); Py_CLEAR(clear_module_state->__pyx_n_s_ymin); Py_CLEAR(clear_module_state->__pyx_n_s_ynorm); Py_CLEAR(clear_module_state->__pyx_n_s_zeroEntries); Py_CLEAR(clear_module_state->__pyx_n_s_zeroRowsColumns); Py_CLEAR(clear_module_state->__pyx_n_s_zeropivot); Py_CLEAR(clear_module_state->__pyx_n_s_zmax); Py_CLEAR(clear_module_state->__pyx_n_s_zmin); Py_CLEAR(clear_module_state->__pyx_n_s_zoz); Py_CLEAR(clear_module_state->__pyx_n_s_zzo); Py_CLEAR(clear_module_state->__pyx_float_0_); Py_CLEAR(clear_module_state->__pyx_float_0_0); Py_CLEAR(clear_module_state->__pyx_float_1_0); Py_CLEAR(clear_module_state->__pyx_int_0); Py_CLEAR(clear_module_state->__pyx_int_1); Py_CLEAR(clear_module_state->__pyx_int_2); Py_CLEAR(clear_module_state->__pyx_int_3); Py_CLEAR(clear_module_state->__pyx_int_4); Py_CLEAR(clear_module_state->__pyx_int_5); Py_CLEAR(clear_module_state->__pyx_int_6); Py_CLEAR(clear_module_state->__pyx_int_7); Py_CLEAR(clear_module_state->__pyx_int_8); Py_CLEAR(clear_module_state->__pyx_int_9); Py_CLEAR(clear_module_state->__pyx_int_10); Py_CLEAR(clear_module_state->__pyx_int_13); Py_CLEAR(clear_module_state->__pyx_int_17); Py_CLEAR(clear_module_state->__pyx_int_18); Py_CLEAR(clear_module_state->__pyx_int_19); Py_CLEAR(clear_module_state->__pyx_int_23); Py_CLEAR(clear_module_state->__pyx_int_32); Py_CLEAR(clear_module_state->__pyx_int_34); Py_CLEAR(clear_module_state->__pyx_int_43); Py_CLEAR(clear_module_state->__pyx_int_45); Py_CLEAR(clear_module_state->__pyx_int_46); Py_CLEAR(clear_module_state->__pyx_int_47); Py_CLEAR(clear_module_state->__pyx_int_48); Py_CLEAR(clear_module_state->__pyx_int_59); Py_CLEAR(clear_module_state->__pyx_int_88); Py_CLEAR(clear_module_state->__pyx_int_102); Py_CLEAR(clear_module_state->__pyx_int_105); Py_CLEAR(clear_module_state->__pyx_int_106); Py_CLEAR(clear_module_state->__pyx_int_113); Py_CLEAR(clear_module_state->__pyx_int_119); Py_CLEAR(clear_module_state->__pyx_int_121); Py_CLEAR(clear_module_state->__pyx_int_122); Py_CLEAR(clear_module_state->__pyx_int_112105877); Py_CLEAR(clear_module_state->__pyx_int_136983863); Py_CLEAR(clear_module_state->__pyx_int_184977713); Py_CLEAR(clear_module_state->__pyx_int_neg_1); Py_CLEAR(clear_module_state->__pyx_k__41); Py_CLEAR(clear_module_state->__pyx_k__49); Py_CLEAR(clear_module_state->__pyx_k__50); Py_CLEAR(clear_module_state->__pyx_k__63); Py_CLEAR(clear_module_state->__pyx_slice__5); Py_CLEAR(clear_module_state->__pyx_tuple__4); Py_CLEAR(clear_module_state->__pyx_tuple__8); Py_CLEAR(clear_module_state->__pyx_slice__20); Py_CLEAR(clear_module_state->__pyx_slice__58); Py_CLEAR(clear_module_state->__pyx_slice__59); Py_CLEAR(clear_module_state->__pyx_tuple__15); Py_CLEAR(clear_module_state->__pyx_tuple__17); Py_CLEAR(clear_module_state->__pyx_tuple__19); Py_CLEAR(clear_module_state->__pyx_tuple__21); Py_CLEAR(clear_module_state->__pyx_tuple__22); Py_CLEAR(clear_module_state->__pyx_tuple__23); Py_CLEAR(clear_module_state->__pyx_tuple__24); Py_CLEAR(clear_module_state->__pyx_tuple__25); Py_CLEAR(clear_module_state->__pyx_tuple__27); Py_CLEAR(clear_module_state->__pyx_tuple__28); Py_CLEAR(clear_module_state->__pyx_tuple__29); Py_CLEAR(clear_module_state->__pyx_tuple__30); Py_CLEAR(clear_module_state->__pyx_tuple__31); Py_CLEAR(clear_module_state->__pyx_tuple__32); Py_CLEAR(clear_module_state->__pyx_tuple__33); Py_CLEAR(clear_module_state->__pyx_tuple__35); Py_CLEAR(clear_module_state->__pyx_tuple__37); Py_CLEAR(clear_module_state->__pyx_tuple__38); Py_CLEAR(clear_module_state->__pyx_tuple__39); Py_CLEAR(clear_module_state->__pyx_tuple__40); Py_CLEAR(clear_module_state->__pyx_tuple__42); Py_CLEAR(clear_module_state->__pyx_tuple__43); Py_CLEAR(clear_module_state->__pyx_tuple__44); Py_CLEAR(clear_module_state->__pyx_tuple__45); Py_CLEAR(clear_module_state->__pyx_tuple__46); Py_CLEAR(clear_module_state->__pyx_tuple__47); Py_CLEAR(clear_module_state->__pyx_tuple__48); Py_CLEAR(clear_module_state->__pyx_tuple__51); Py_CLEAR(clear_module_state->__pyx_tuple__52); Py_CLEAR(clear_module_state->__pyx_tuple__53); Py_CLEAR(clear_module_state->__pyx_tuple__54); Py_CLEAR(clear_module_state->__pyx_tuple__55); Py_CLEAR(clear_module_state->__pyx_tuple__56); Py_CLEAR(clear_module_state->__pyx_tuple__57); Py_CLEAR(clear_module_state->__pyx_tuple__60); Py_CLEAR(clear_module_state->__pyx_tuple__61); Py_CLEAR(clear_module_state->__pyx_tuple__62); Py_CLEAR(clear_module_state->__pyx_tuple__64); Py_CLEAR(clear_module_state->__pyx_tuple__65); Py_CLEAR(clear_module_state->__pyx_tuple__66); Py_CLEAR(clear_module_state->__pyx_tuple__67); Py_CLEAR(clear_module_state->__pyx_tuple__68); Py_CLEAR(clear_module_state->__pyx_tuple__69); Py_CLEAR(clear_module_state->__pyx_tuple__70); Py_CLEAR(clear_module_state->__pyx_tuple__71); Py_CLEAR(clear_module_state->__pyx_tuple__72); Py_CLEAR(clear_module_state->__pyx_tuple__73); Py_CLEAR(clear_module_state->__pyx_tuple__74); Py_CLEAR(clear_module_state->__pyx_tuple__75); Py_CLEAR(clear_module_state->__pyx_tuple__76); Py_CLEAR(clear_module_state->__pyx_tuple__78); Py_CLEAR(clear_module_state->__pyx_tuple__79); Py_CLEAR(clear_module_state->__pyx_tuple__80); Py_CLEAR(clear_module_state->__pyx_tuple__81); Py_CLEAR(clear_module_state->__pyx_tuple__82); Py_CLEAR(clear_module_state->__pyx_tuple__83); Py_CLEAR(clear_module_state->__pyx_tuple__84); Py_CLEAR(clear_module_state->__pyx_tuple__85); Py_CLEAR(clear_module_state->__pyx_tuple__86); Py_CLEAR(clear_module_state->__pyx_tuple__89); Py_CLEAR(clear_module_state->__pyx_tuple__91); Py_CLEAR(clear_module_state->__pyx_tuple__93); Py_CLEAR(clear_module_state->__pyx_tuple__96); Py_CLEAR(clear_module_state->__pyx_tuple__97); Py_CLEAR(clear_module_state->__pyx_tuple__98); Py_CLEAR(clear_module_state->__pyx_tuple__99); Py_CLEAR(clear_module_state->__pyx_tuple__100); Py_CLEAR(clear_module_state->__pyx_tuple__101); Py_CLEAR(clear_module_state->__pyx_tuple__102); Py_CLEAR(clear_module_state->__pyx_tuple__103); Py_CLEAR(clear_module_state->__pyx_tuple__104); Py_CLEAR(clear_module_state->__pyx_tuple__105); Py_CLEAR(clear_module_state->__pyx_tuple__106); Py_CLEAR(clear_module_state->__pyx_tuple__107); Py_CLEAR(clear_module_state->__pyx_tuple__108); Py_CLEAR(clear_module_state->__pyx_tuple__110); Py_CLEAR(clear_module_state->__pyx_tuple__112); Py_CLEAR(clear_module_state->__pyx_tuple__114); Py_CLEAR(clear_module_state->__pyx_tuple__116); Py_CLEAR(clear_module_state->__pyx_tuple__117); Py_CLEAR(clear_module_state->__pyx_tuple__118); Py_CLEAR(clear_module_state->__pyx_tuple__119); Py_CLEAR(clear_module_state->__pyx_tuple__120); Py_CLEAR(clear_module_state->__pyx_tuple__121); Py_CLEAR(clear_module_state->__pyx_tuple__122); Py_CLEAR(clear_module_state->__pyx_tuple__123); Py_CLEAR(clear_module_state->__pyx_tuple__124); Py_CLEAR(clear_module_state->__pyx_tuple__125); Py_CLEAR(clear_module_state->__pyx_tuple__126); Py_CLEAR(clear_module_state->__pyx_tuple__127); Py_CLEAR(clear_module_state->__pyx_tuple__128); Py_CLEAR(clear_module_state->__pyx_tuple__129); Py_CLEAR(clear_module_state->__pyx_tuple__130); Py_CLEAR(clear_module_state->__pyx_tuple__131); Py_CLEAR(clear_module_state->__pyx_tuple__132); Py_CLEAR(clear_module_state->__pyx_tuple__133); Py_CLEAR(clear_module_state->__pyx_tuple__134); Py_CLEAR(clear_module_state->__pyx_tuple__135); Py_CLEAR(clear_module_state->__pyx_tuple__136); Py_CLEAR(clear_module_state->__pyx_tuple__137); Py_CLEAR(clear_module_state->__pyx_tuple__138); Py_CLEAR(clear_module_state->__pyx_tuple__139); Py_CLEAR(clear_module_state->__pyx_tuple__140); Py_CLEAR(clear_module_state->__pyx_tuple__141); Py_CLEAR(clear_module_state->__pyx_tuple__142); Py_CLEAR(clear_module_state->__pyx_tuple__143); Py_CLEAR(clear_module_state->__pyx_tuple__144); Py_CLEAR(clear_module_state->__pyx_tuple__145); Py_CLEAR(clear_module_state->__pyx_tuple__146); Py_CLEAR(clear_module_state->__pyx_tuple__147); Py_CLEAR(clear_module_state->__pyx_tuple__148); Py_CLEAR(clear_module_state->__pyx_tuple__149); Py_CLEAR(clear_module_state->__pyx_tuple__150); Py_CLEAR(clear_module_state->__pyx_tuple__151); Py_CLEAR(clear_module_state->__pyx_tuple__152); Py_CLEAR(clear_module_state->__pyx_tuple__153); Py_CLEAR(clear_module_state->__pyx_tuple__154); Py_CLEAR(clear_module_state->__pyx_tuple__155); Py_CLEAR(clear_module_state->__pyx_tuple__156); Py_CLEAR(clear_module_state->__pyx_tuple__157); Py_CLEAR(clear_module_state->__pyx_tuple__158); Py_CLEAR(clear_module_state->__pyx_tuple__159); Py_CLEAR(clear_module_state->__pyx_tuple__160); Py_CLEAR(clear_module_state->__pyx_tuple__161); Py_CLEAR(clear_module_state->__pyx_tuple__162); Py_CLEAR(clear_module_state->__pyx_tuple__163); Py_CLEAR(clear_module_state->__pyx_tuple__164); Py_CLEAR(clear_module_state->__pyx_tuple__165); Py_CLEAR(clear_module_state->__pyx_tuple__166); Py_CLEAR(clear_module_state->__pyx_tuple__167); Py_CLEAR(clear_module_state->__pyx_tuple__168); Py_CLEAR(clear_module_state->__pyx_tuple__169); Py_CLEAR(clear_module_state->__pyx_tuple__170); Py_CLEAR(clear_module_state->__pyx_tuple__171); Py_CLEAR(clear_module_state->__pyx_tuple__172); Py_CLEAR(clear_module_state->__pyx_tuple__173); Py_CLEAR(clear_module_state->__pyx_tuple__174); Py_CLEAR(clear_module_state->__pyx_tuple__175); Py_CLEAR(clear_module_state->__pyx_tuple__176); Py_CLEAR(clear_module_state->__pyx_tuple__177); Py_CLEAR(clear_module_state->__pyx_tuple__178); Py_CLEAR(clear_module_state->__pyx_tuple__179); Py_CLEAR(clear_module_state->__pyx_tuple__180); Py_CLEAR(clear_module_state->__pyx_tuple__181); Py_CLEAR(clear_module_state->__pyx_tuple__182); Py_CLEAR(clear_module_state->__pyx_tuple__183); Py_CLEAR(clear_module_state->__pyx_tuple__184); Py_CLEAR(clear_module_state->__pyx_tuple__185); Py_CLEAR(clear_module_state->__pyx_tuple__186); Py_CLEAR(clear_module_state->__pyx_tuple__187); Py_CLEAR(clear_module_state->__pyx_tuple__188); Py_CLEAR(clear_module_state->__pyx_tuple__189); Py_CLEAR(clear_module_state->__pyx_tuple__190); Py_CLEAR(clear_module_state->__pyx_tuple__191); Py_CLEAR(clear_module_state->__pyx_tuple__192); Py_CLEAR(clear_module_state->__pyx_tuple__193); Py_CLEAR(clear_module_state->__pyx_tuple__194); Py_CLEAR(clear_module_state->__pyx_tuple__195); Py_CLEAR(clear_module_state->__pyx_tuple__196); Py_CLEAR(clear_module_state->__pyx_tuple__197); Py_CLEAR(clear_module_state->__pyx_tuple__198); Py_CLEAR(clear_module_state->__pyx_tuple__199); Py_CLEAR(clear_module_state->__pyx_tuple__200); Py_CLEAR(clear_module_state->__pyx_tuple__201); Py_CLEAR(clear_module_state->__pyx_tuple__202); Py_CLEAR(clear_module_state->__pyx_tuple__203); Py_CLEAR(clear_module_state->__pyx_tuple__204); Py_CLEAR(clear_module_state->__pyx_tuple__205); Py_CLEAR(clear_module_state->__pyx_tuple__206); Py_CLEAR(clear_module_state->__pyx_tuple__207); Py_CLEAR(clear_module_state->__pyx_tuple__208); Py_CLEAR(clear_module_state->__pyx_tuple__209); Py_CLEAR(clear_module_state->__pyx_tuple__210); Py_CLEAR(clear_module_state->__pyx_tuple__211); Py_CLEAR(clear_module_state->__pyx_tuple__212); Py_CLEAR(clear_module_state->__pyx_tuple__213); Py_CLEAR(clear_module_state->__pyx_tuple__214); Py_CLEAR(clear_module_state->__pyx_tuple__215); Py_CLEAR(clear_module_state->__pyx_tuple__216); Py_CLEAR(clear_module_state->__pyx_tuple__217); Py_CLEAR(clear_module_state->__pyx_tuple__218); Py_CLEAR(clear_module_state->__pyx_tuple__219); Py_CLEAR(clear_module_state->__pyx_tuple__220); Py_CLEAR(clear_module_state->__pyx_tuple__221); Py_CLEAR(clear_module_state->__pyx_tuple__222); Py_CLEAR(clear_module_state->__pyx_tuple__223); Py_CLEAR(clear_module_state->__pyx_tuple__224); Py_CLEAR(clear_module_state->__pyx_tuple__225); Py_CLEAR(clear_module_state->__pyx_tuple__226); Py_CLEAR(clear_module_state->__pyx_tuple__227); Py_CLEAR(clear_module_state->__pyx_tuple__228); Py_CLEAR(clear_module_state->__pyx_tuple__229); Py_CLEAR(clear_module_state->__pyx_tuple__230); Py_CLEAR(clear_module_state->__pyx_tuple__231); Py_CLEAR(clear_module_state->__pyx_tuple__232); Py_CLEAR(clear_module_state->__pyx_tuple__233); Py_CLEAR(clear_module_state->__pyx_tuple__234); Py_CLEAR(clear_module_state->__pyx_tuple__235); Py_CLEAR(clear_module_state->__pyx_tuple__236); Py_CLEAR(clear_module_state->__pyx_tuple__237); Py_CLEAR(clear_module_state->__pyx_tuple__238); Py_CLEAR(clear_module_state->__pyx_tuple__239); Py_CLEAR(clear_module_state->__pyx_tuple__240); Py_CLEAR(clear_module_state->__pyx_tuple__241); Py_CLEAR(clear_module_state->__pyx_tuple__242); Py_CLEAR(clear_module_state->__pyx_tuple__243); Py_CLEAR(clear_module_state->__pyx_tuple__244); Py_CLEAR(clear_module_state->__pyx_tuple__245); Py_CLEAR(clear_module_state->__pyx_tuple__246); Py_CLEAR(clear_module_state->__pyx_tuple__247); Py_CLEAR(clear_module_state->__pyx_tuple__248); Py_CLEAR(clear_module_state->__pyx_tuple__249); Py_CLEAR(clear_module_state->__pyx_tuple__250); Py_CLEAR(clear_module_state->__pyx_codeobj__34); Py_CLEAR(clear_module_state->__pyx_codeobj__36); Py_CLEAR(clear_module_state->__pyx_codeobj__77); Py_CLEAR(clear_module_state->__pyx_codeobj__87); Py_CLEAR(clear_module_state->__pyx_codeobj__88); Py_CLEAR(clear_module_state->__pyx_codeobj__90); Py_CLEAR(clear_module_state->__pyx_codeobj__92); Py_CLEAR(clear_module_state->__pyx_codeobj__94); Py_CLEAR(clear_module_state->__pyx_codeobj__95); Py_CLEAR(clear_module_state->__pyx_codeobj__109); Py_CLEAR(clear_module_state->__pyx_codeobj__111); Py_CLEAR(clear_module_state->__pyx_codeobj__113); Py_CLEAR(clear_module_state->__pyx_codeobj__115); Py_CLEAR(clear_module_state->__pyx_codeobj__251); Py_CLEAR(clear_module_state->__pyx_codeobj__252); Py_CLEAR(clear_module_state->__pyx_codeobj__253); Py_CLEAR(clear_module_state->__pyx_codeobj__254); Py_CLEAR(clear_module_state->__pyx_codeobj__255); Py_CLEAR(clear_module_state->__pyx_codeobj__256); return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { __pyx_mstate *traverse_module_state = __pyx_mstate(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); Py_VISIT(traverse_module_state->__pyx_empty_tuple); Py_VISIT(traverse_module_state->__pyx_empty_bytes); Py_VISIT(traverse_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_VISIT(traverse_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif Py_VISIT(traverse_module_state->__pyx_ptype_8petsc4py_5PETSc_Comm); Py_VISIT(traverse_module_state->PyPetscComm_Type); Py_VISIT(traverse_module_state->__pyx_ptype_8petsc4py_5PETSc_Object); Py_VISIT(traverse_module_state->PyPetscObject_Type); Py_VISIT(traverse_module_state->__pyx_ptype_8petsc4py_5PETSc_Viewer); Py_VISIT(traverse_module_state->PyPetscViewer_Type); Py_VISIT(traverse_module_state->__pyx_ptype_8petsc4py_5PETSc_Random); Py_VISIT(traverse_module_state->PyPetscRandom_Type); Py_VISIT(traverse_module_state->__pyx_ptype_8petsc4py_5PETSc_Device); Py_VISIT(traverse_module_state->PyPetscDevice_Type); Py_VISIT(traverse_module_state->__pyx_ptype_8petsc4py_5PETSc_DeviceContext); Py_VISIT(traverse_module_state->PyPetscDeviceContext_Type); Py_VISIT(traverse_module_state->__pyx_ptype_8petsc4py_5PETSc_IS); Py_VISIT(traverse_module_state->PyPetscIS_Type); Py_VISIT(traverse_module_state->__pyx_ptype_8petsc4py_5PETSc_LGMap); Py_VISIT(traverse_module_state->PyPetscLGMap_Type); Py_VISIT(traverse_module_state->__pyx_ptype_8petsc4py_5PETSc_SF); Py_VISIT(traverse_module_state->PyPetscSF_Type); Py_VISIT(traverse_module_state->__pyx_ptype_8petsc4py_5PETSc_Vec); Py_VISIT(traverse_module_state->PyPetscVec_Type); Py_VISIT(traverse_module_state->__pyx_ptype_8petsc4py_5PETSc_Space); Py_VISIT(traverse_module_state->PyPetscSpace_Type); Py_VISIT(traverse_module_state->__pyx_ptype_8petsc4py_5PETSc_DualSpace); Py_VISIT(traverse_module_state->PyPetscDualSpace_Type); Py_VISIT(traverse_module_state->__pyx_ptype_8petsc4py_5PETSc_FE); Py_VISIT(traverse_module_state->PyPetscFE_Type); Py_VISIT(traverse_module_state->__pyx_ptype_8petsc4py_5PETSc_Quad); Py_VISIT(traverse_module_state->PyPetscQuad_Type); Py_VISIT(traverse_module_state->__pyx_ptype_8petsc4py_5PETSc_Scatter); Py_VISIT(traverse_module_state->PyPetscScatter_Type); Py_VISIT(traverse_module_state->__pyx_ptype_8petsc4py_5PETSc_Section); Py_VISIT(traverse_module_state->PyPetscSection_Type); Py_VISIT(traverse_module_state->__pyx_ptype_8petsc4py_5PETSc_Mat); Py_VISIT(traverse_module_state->PyPetscMat_Type); Py_VISIT(traverse_module_state->__pyx_ptype_8petsc4py_5PETSc_MatPartitioning); Py_VISIT(traverse_module_state->PyPetscMatPartitioning_Type); Py_VISIT(traverse_module_state->__pyx_ptype_8petsc4py_5PETSc_NullSpace); Py_VISIT(traverse_module_state->PyPetscNullSpace_Type); Py_VISIT(traverse_module_state->__pyx_ptype_8petsc4py_5PETSc_PC); Py_VISIT(traverse_module_state->PyPetscPC_Type); Py_VISIT(traverse_module_state->__pyx_ptype_8petsc4py_5PETSc_KSP); Py_VISIT(traverse_module_state->PyPetscKSP_Type); Py_VISIT(traverse_module_state->__pyx_ptype_8petsc4py_5PETSc_SNES); Py_VISIT(traverse_module_state->PyPetscSNES_Type); Py_VISIT(traverse_module_state->__pyx_ptype_8petsc4py_5PETSc_TS); Py_VISIT(traverse_module_state->PyPetscTS_Type); Py_VISIT(traverse_module_state->__pyx_ptype_8petsc4py_5PETSc_TAO); Py_VISIT(traverse_module_state->PyPetscTAO_Type); Py_VISIT(traverse_module_state->__pyx_ptype_8petsc4py_5PETSc_TAOLineSearch); Py_VISIT(traverse_module_state->PyPetscTAOLineSearch_Type); Py_VISIT(traverse_module_state->__pyx_ptype_8petsc4py_5PETSc_AO); Py_VISIT(traverse_module_state->PyPetscAO_Type); Py_VISIT(traverse_module_state->__pyx_ptype_8petsc4py_5PETSc_DM); Py_VISIT(traverse_module_state->PyPetscDM_Type); Py_VISIT(traverse_module_state->__pyx_ptype_8petsc4py_5PETSc_DMPlexTransform); Py_VISIT(traverse_module_state->PyPetscDMPlexTransform_Type); Py_VISIT(traverse_module_state->__pyx_ptype_8petsc4py_5PETSc_DS); Py_VISIT(traverse_module_state->PyPetscDS_Type); Py_VISIT(traverse_module_state->__pyx_ptype_8petsc4py_5PETSc_Partitioner); Py_VISIT(traverse_module_state->PyPetscPartitioner_Type); Py_VISIT(traverse_module_state->__pyx_ptype_8petsc4py_5PETSc_DMLabel); Py_VISIT(traverse_module_state->PyPetscDMLabel_Type); Py_VISIT(traverse_module_state->__pyx_ptype_8petsc4py_5PETSc_dtype); Py_VISIT(traverse_module_state->__pyx_ptype_8petsc4py_5PETSc_ndarray); Py_VISIT(traverse_module_state->__pyx_ptype_8petsc4py_5PETSc__IS_buffer); Py_VISIT(traverse_module_state->__pyx_type_8petsc4py_5PETSc__IS_buffer); Py_VISIT(traverse_module_state->__pyx_ptype_8petsc4py_5PETSc__Vec_buffer); Py_VISIT(traverse_module_state->__pyx_type_8petsc4py_5PETSc__Vec_buffer); Py_VISIT(traverse_module_state->__pyx_ptype_8petsc4py_5PETSc__Vec_LocalForm); Py_VISIT(traverse_module_state->__pyx_type_8petsc4py_5PETSc__Vec_LocalForm); Py_VISIT(traverse_module_state->__pyx_ptype_8petsc4py_5PETSc__DMDA_Vec_array); Py_VISIT(traverse_module_state->__pyx_type_8petsc4py_5PETSc__DMDA_Vec_array); Py_VISIT(traverse_module_state->__pyx_ptype_8petsc4py_5PETSc__DMComposite_access); Py_VISIT(traverse_module_state->__pyx_type_8petsc4py_5PETSc__DMComposite_access); Py_VISIT(traverse_module_state->__pyx_ptype_8petsc4py_5PETSc_Options); Py_VISIT(traverse_module_state->__pyx_type_8petsc4py_5PETSc_Options); Py_VISIT(traverse_module_state->__pyx_ptype_8petsc4py_5PETSc_Sys); Py_VISIT(traverse_module_state->__pyx_type_8petsc4py_5PETSc_Sys); Py_VISIT(traverse_module_state->__pyx_ptype_8petsc4py_5PETSc_Log); Py_VISIT(traverse_module_state->__pyx_type_8petsc4py_5PETSc_Log); Py_VISIT(traverse_module_state->__pyx_ptype_8petsc4py_5PETSc_LogStage); Py_VISIT(traverse_module_state->__pyx_type_8petsc4py_5PETSc_LogStage); Py_VISIT(traverse_module_state->__pyx_ptype_8petsc4py_5PETSc_LogClass); Py_VISIT(traverse_module_state->__pyx_type_8petsc4py_5PETSc_LogClass); Py_VISIT(traverse_module_state->__pyx_ptype_8petsc4py_5PETSc_LogEvent); Py_VISIT(traverse_module_state->__pyx_type_8petsc4py_5PETSc_LogEvent); Py_VISIT(traverse_module_state->__pyx_ptype_8petsc4py_5PETSc_ViewerHDF5); Py_VISIT(traverse_module_state->__pyx_type_8petsc4py_5PETSc_ViewerHDF5); Py_VISIT(traverse_module_state->__pyx_ptype_8petsc4py_5PETSc_MatStencil); Py_VISIT(traverse_module_state->__pyx_type_8petsc4py_5PETSc_MatStencil); Py_VISIT(traverse_module_state->__pyx_ptype_8petsc4py_5PETSc_DMDA); Py_VISIT(traverse_module_state->__pyx_type_8petsc4py_5PETSc_DMDA); Py_VISIT(traverse_module_state->__pyx_ptype_8petsc4py_5PETSc_DMPlex); Py_VISIT(traverse_module_state->__pyx_type_8petsc4py_5PETSc_DMPlex); Py_VISIT(traverse_module_state->__pyx_ptype_8petsc4py_5PETSc_DMStag); Py_VISIT(traverse_module_state->__pyx_type_8petsc4py_5PETSc_DMStag); Py_VISIT(traverse_module_state->__pyx_ptype_8petsc4py_5PETSc_DMComposite); Py_VISIT(traverse_module_state->__pyx_type_8petsc4py_5PETSc_DMComposite); Py_VISIT(traverse_module_state->__pyx_ptype_8petsc4py_5PETSc_DMShell); Py_VISIT(traverse_module_state->__pyx_type_8petsc4py_5PETSc_DMShell); Py_VISIT(traverse_module_state->__pyx_ptype_8petsc4py_5PETSc_DMSwarm); Py_VISIT(traverse_module_state->__pyx_type_8petsc4py_5PETSc_DMSwarm); Py_VISIT(traverse_module_state->__pyx_ptype_8petsc4py_5PETSc_DMInterpolation); Py_VISIT(traverse_module_state->__pyx_type_8petsc4py_5PETSc_DMInterpolation); Py_VISIT(traverse_module_state->__pyx_ptype_8petsc4py_5PETSc__PyObj); Py_VISIT(traverse_module_state->__pyx_type_8petsc4py_5PETSc__PyObj); Py_VISIT(traverse_module_state->__pyx_ptype_8petsc4py_5PETSc__PyMat); Py_VISIT(traverse_module_state->__pyx_type_8petsc4py_5PETSc__PyMat); Py_VISIT(traverse_module_state->__pyx_ptype_8petsc4py_5PETSc__PyPC); Py_VISIT(traverse_module_state->__pyx_type_8petsc4py_5PETSc__PyPC); Py_VISIT(traverse_module_state->__pyx_ptype_8petsc4py_5PETSc__PyKSP); Py_VISIT(traverse_module_state->__pyx_type_8petsc4py_5PETSc__PyKSP); Py_VISIT(traverse_module_state->__pyx_ptype_8petsc4py_5PETSc__PySNES); Py_VISIT(traverse_module_state->__pyx_type_8petsc4py_5PETSc__PySNES); Py_VISIT(traverse_module_state->__pyx_ptype_8petsc4py_5PETSc__PyTS); Py_VISIT(traverse_module_state->__pyx_type_8petsc4py_5PETSc__PyTS); Py_VISIT(traverse_module_state->__pyx_ptype_8petsc4py_5PETSc__PyTao); Py_VISIT(traverse_module_state->__pyx_type_8petsc4py_5PETSc__PyTao); Py_VISIT(traverse_module_state->__pyx_ptype_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator); Py_VISIT(traverse_module_state->__pyx_type_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator); Py_VISIT(traverse_module_state->__pyx_ptype_8petsc4py_5PETSc___pyx_scope_struct_1_decorator); Py_VISIT(traverse_module_state->__pyx_type_8petsc4py_5PETSc___pyx_scope_struct_1_decorator); Py_VISIT(traverse_module_state->__pyx_array_type); Py_VISIT(traverse_module_state->__pyx_type___pyx_array); Py_VISIT(traverse_module_state->__pyx_MemviewEnum_type); Py_VISIT(traverse_module_state->__pyx_type___pyx_MemviewEnum); Py_VISIT(traverse_module_state->__pyx_memoryview_type); Py_VISIT(traverse_module_state->__pyx_type___pyx_memoryview); Py_VISIT(traverse_module_state->__pyx_memoryviewslice_type); Py_VISIT(traverse_module_state->__pyx_type___pyx_memoryviewslice); Py_VISIT(traverse_module_state->__pyx_kp_u_); Py_VISIT(traverse_module_state->__pyx_n_s_A); Py_VISIT(traverse_module_state->__pyx_n_s_A11); Py_VISIT(traverse_module_state->__pyx_n_s_AB); Py_VISIT(traverse_module_state->__pyx_n_s_ABC); Py_VISIT(traverse_module_state->__pyx_n_s_ABt); Py_VISIT(traverse_module_state->__pyx_n_s_ADD); Py_VISIT(traverse_module_state->__pyx_n_s_ADDITIVE); Py_VISIT(traverse_module_state->__pyx_n_s_ADD_ALL); Py_VISIT(traverse_module_state->__pyx_n_s_ADD_ALL_VALUES); Py_VISIT(traverse_module_state->__pyx_n_s_ADD_BC); Py_VISIT(traverse_module_state->__pyx_n_s_ADD_BC_VALUES); Py_VISIT(traverse_module_state->__pyx_n_s_ADD_VALUES); Py_VISIT(traverse_module_state->__pyx_n_s_ADIOS); Py_VISIT(traverse_module_state->__pyx_n_s_ADMM); Py_VISIT(traverse_module_state->__pyx_n_s_ADVANCED); Py_VISIT(traverse_module_state->__pyx_n_s_AGG); Py_VISIT(traverse_module_state->__pyx_n_s_AGGREGATION); Py_VISIT(traverse_module_state->__pyx_n_s_AIJ); Py_VISIT(traverse_module_state->__pyx_n_s_AIJCRL); Py_VISIT(traverse_module_state->__pyx_n_s_AIJCUSPARSE); Py_VISIT(traverse_module_state->__pyx_n_s_AIJMKL); Py_VISIT(traverse_module_state->__pyx_n_s_AIJPERM); Py_VISIT(traverse_module_state->__pyx_n_s_AIJSELL); Py_VISIT(traverse_module_state->__pyx_n_s_AIJVIENNACL); Py_VISIT(traverse_module_state->__pyx_n_s_ALLGATHER); Py_VISIT(traverse_module_state->__pyx_n_s_ALLGATHERV); Py_VISIT(traverse_module_state->__pyx_n_s_ALLTOALL); Py_VISIT(traverse_module_state->__pyx_n_s_ALMM); Py_VISIT(traverse_module_state->__pyx_n_s_ALPHA); Py_VISIT(traverse_module_state->__pyx_n_s_ALPHA2); Py_VISIT(traverse_module_state->__pyx_n_s_ALWAYS); Py_VISIT(traverse_module_state->__pyx_n_s_AMD); Py_VISIT(traverse_module_state->__pyx_n_s_ANDERSON); Py_VISIT(traverse_module_state->__pyx_n_s_AO); Py_VISIT(traverse_module_state->__pyx_n_s_AOType); Py_VISIT(traverse_module_state->__pyx_n_s_APPEND); Py_VISIT(traverse_module_state->__pyx_n_s_APPEND_UPDATE); Py_VISIT(traverse_module_state->__pyx_n_s_APPLY_LOWER); Py_VISIT(traverse_module_state->__pyx_n_s_APPLY_UPPER); Py_VISIT(traverse_module_state->__pyx_n_s_ARKIMEX); Py_VISIT(traverse_module_state->__pyx_n_s_ARKIMEX1BEE); Py_VISIT(traverse_module_state->__pyx_n_s_ARKIMEX2C); Py_VISIT(traverse_module_state->__pyx_n_s_ARKIMEX2D); Py_VISIT(traverse_module_state->__pyx_n_s_ARKIMEX2E); Py_VISIT(traverse_module_state->__pyx_n_s_ARKIMEX3); Py_VISIT(traverse_module_state->__pyx_n_s_ARKIMEX4); Py_VISIT(traverse_module_state->__pyx_n_s_ARKIMEX5); Py_VISIT(traverse_module_state->__pyx_n_s_ARKIMEXA2); Py_VISIT(traverse_module_state->__pyx_n_s_ARKIMEXARS122); Py_VISIT(traverse_module_state->__pyx_n_s_ARKIMEXARS443); Py_VISIT(traverse_module_state->__pyx_n_s_ARKIMEXBPR3); Py_VISIT(traverse_module_state->__pyx_n_s_ARKIMEXL2); Py_VISIT(traverse_module_state->__pyx_n_s_ARKIMEXPRSSP2); Py_VISIT(traverse_module_state->__pyx_n_s_ARKIMEXType); Py_VISIT(traverse_module_state->__pyx_n_s_ARMIJO); Py_VISIT(traverse_module_state->__pyx_n_s_ASCII); Py_VISIT(traverse_module_state->__pyx_n_s_ASCII_COMMON); Py_VISIT(traverse_module_state->__pyx_n_s_ASCII_CSV); Py_VISIT(traverse_module_state->__pyx_n_s_ASCII_DENSE); Py_VISIT(traverse_module_state->__pyx_n_s_ASCII_FACTOR_INFO); Py_VISIT(traverse_module_state->__pyx_n_s_ASCII_GLVIS); Py_VISIT(traverse_module_state->__pyx_n_s_ASCII_IMPL); Py_VISIT(traverse_module_state->__pyx_n_s_ASCII_INDEX); Py_VISIT(traverse_module_state->__pyx_n_s_ASCII_INFO); Py_VISIT(traverse_module_state->__pyx_n_s_ASCII_INFO_DETAIL); Py_VISIT(traverse_module_state->__pyx_n_s_ASCII_LATEX); Py_VISIT(traverse_module_state->__pyx_n_s_ASCII_MATHEMATICA); Py_VISIT(traverse_module_state->__pyx_n_s_ASCII_MATLAB); Py_VISIT(traverse_module_state->__pyx_n_s_ASCII_MATRIXMARKET); Py_VISIT(traverse_module_state->__pyx_n_s_ASCII_PCICE); Py_VISIT(traverse_module_state->__pyx_n_s_ASCII_PYTHON); Py_VISIT(traverse_module_state->__pyx_n_s_ASCII_SYMMODU); Py_VISIT(traverse_module_state->__pyx_n_s_ASCII_VTK); Py_VISIT(traverse_module_state->__pyx_n_s_ASCII_VTK_CELL); Py_VISIT(traverse_module_state->__pyx_n_s_ASCII_VTK_COORDS); Py_VISIT(traverse_module_state->__pyx_n_s_ASCII_XML); Py_VISIT(traverse_module_state->__pyx_n_s_ASFLS); Py_VISIT(traverse_module_state->__pyx_n_s_ASILS); Py_VISIT(traverse_module_state->__pyx_n_s_ASM); Py_VISIT(traverse_module_state->__pyx_n_s_ASMType); Py_VISIT(traverse_module_state->__pyx_n_s_ASPIN); Py_VISIT(traverse_module_state->__pyx_n_s_AU); Py_VISIT(traverse_module_state->__pyx_kp_s_A_matrix_with_d_rows_requires_a); Py_VISIT(traverse_module_state->__pyx_kp_s_All_dimensions_preceding_dimensi); Py_VISIT(traverse_module_state->__pyx_n_s_AssemblyType); Py_VISIT(traverse_module_state->__pyx_n_s_AssertionError); Py_VISIT(traverse_module_state->__pyx_n_s_AtB); Py_VISIT(traverse_module_state->__pyx_n_s_AttributeError); Py_VISIT(traverse_module_state->__pyx_n_s_B); Py_VISIT(traverse_module_state->__pyx_n_s_BACK); Py_VISIT(traverse_module_state->__pyx_n_s_BACKWARD_SWEEP); Py_VISIT(traverse_module_state->__pyx_n_s_BACK_DOWN); Py_VISIT(traverse_module_state->__pyx_n_s_BACK_DOWN_LEFT); Py_VISIT(traverse_module_state->__pyx_n_s_BACK_DOWN_RIGHT); Py_VISIT(traverse_module_state->__pyx_n_s_BACK_LEFT); Py_VISIT(traverse_module_state->__pyx_n_s_BACK_RIGHT); Py_VISIT(traverse_module_state->__pyx_n_s_BACK_UP); Py_VISIT(traverse_module_state->__pyx_n_s_BACK_UP_LEFT); Py_VISIT(traverse_module_state->__pyx_n_s_BACK_UP_RIGHT); Py_VISIT(traverse_module_state->__pyx_n_s_BAIJ); Py_VISIT(traverse_module_state->__pyx_n_s_BAIJMKL); Py_VISIT(traverse_module_state->__pyx_n_s_BALANCED); Py_VISIT(traverse_module_state->__pyx_n_s_BAS); Py_VISIT(traverse_module_state->__pyx_n_s_BASIC); Py_VISIT(traverse_module_state->__pyx_n_s_BASICSYMPLECTIC); Py_VISIT(traverse_module_state->__pyx_n_s_BCG); Py_VISIT(traverse_module_state->__pyx_n_s_BCGS); Py_VISIT(traverse_module_state->__pyx_n_s_BCGSL); Py_VISIT(traverse_module_state->__pyx_n_s_BDDC); Py_VISIT(traverse_module_state->__pyx_n_s_BDF); Py_VISIT(traverse_module_state->__pyx_n_s_BDM); Py_VISIT(traverse_module_state->__pyx_n_s_BE); Py_VISIT(traverse_module_state->__pyx_n_s_BEULER); Py_VISIT(traverse_module_state->__pyx_n_s_BFBCG); Py_VISIT(traverse_module_state->__pyx_n_s_BFBT); Py_VISIT(traverse_module_state->__pyx_n_s_BGCRODR); Py_VISIT(traverse_module_state->__pyx_n_s_BGMRES); Py_VISIT(traverse_module_state->__pyx_n_s_BICG); Py_VISIT(traverse_module_state->__pyx_n_s_BINARY); Py_VISIT(traverse_module_state->__pyx_n_s_BINARY_MATLAB); Py_VISIT(traverse_module_state->__pyx_n_s_BIORTH22); Py_VISIT(traverse_module_state->__pyx_n_s_BJACOBI); Py_VISIT(traverse_module_state->__pyx_n_s_BLMVM); Py_VISIT(traverse_module_state->__pyx_n_s_BLOCK); Py_VISIT(traverse_module_state->__pyx_n_s_BLOCKMAT); Py_VISIT(traverse_module_state->__pyx_n_s_BMRM); Py_VISIT(traverse_module_state->__pyx_n_s_BNCG); Py_VISIT(traverse_module_state->__pyx_n_s_BNCGType); Py_VISIT(traverse_module_state->__pyx_n_s_BNLS); Py_VISIT(traverse_module_state->__pyx_n_s_BNTL); Py_VISIT(traverse_module_state->__pyx_n_s_BNTR); Py_VISIT(traverse_module_state->__pyx_n_s_BOX); Py_VISIT(traverse_module_state->__pyx_n_s_BQNKLS); Py_VISIT(traverse_module_state->__pyx_n_s_BQNKTL); Py_VISIT(traverse_module_state->__pyx_n_s_BQNKTR); Py_VISIT(traverse_module_state->__pyx_n_s_BQNLS); Py_VISIT(traverse_module_state->__pyx_n_s_BQPIP); Py_VISIT(traverse_module_state->__pyx_n_s_BRGN); Py_VISIT(traverse_module_state->__pyx_n_s_Barrier); Py_VISIT(traverse_module_state->__pyx_kp_s_Basic_constants_DECIDE_Use_a_de); Py_VISIT(traverse_module_state->__pyx_n_s_BoundaryType); Py_VISIT(traverse_module_state->__pyx_kp_s_Buffer_view_does_not_expose_stri); Py_VISIT(traverse_module_state->__pyx_n_s_C); Py_VISIT(traverse_module_state->__pyx_n_s_CG); Py_VISIT(traverse_module_state->__pyx_n_s_CGLS); Py_VISIT(traverse_module_state->__pyx_n_s_CGNE); Py_VISIT(traverse_module_state->__pyx_n_s_CGS); Py_VISIT(traverse_module_state->__pyx_n_s_CHACO); Py_VISIT(traverse_module_state->__pyx_n_s_CHEBYSHEV); Py_VISIT(traverse_module_state->__pyx_n_s_CHOLESKY); Py_VISIT(traverse_module_state->__pyx_n_s_CHOLMOD); Py_VISIT(traverse_module_state->__pyx_n_s_CHOWILUVIENNACL); Py_VISIT(traverse_module_state->__pyx_n_s_CLASSICAL); Py_VISIT(traverse_module_state->__pyx_n_s_CN); Py_VISIT(traverse_module_state->__pyx_n_s_COLLECT_BASIC); Py_VISIT(traverse_module_state->__pyx_n_s_COLLECT_DMDABOUNDINGBOX); Py_VISIT(traverse_module_state->__pyx_n_s_COLLECT_GENERAL); Py_VISIT(traverse_module_state->__pyx_n_s_COLLECT_USER); Py_VISIT(traverse_module_state->__pyx_n_s_COMM_NULL); Py_VISIT(traverse_module_state->__pyx_n_s_COMM_SELF); Py_VISIT(traverse_module_state->__pyx_n_s_COMM_WORLD); Py_VISIT(traverse_module_state->__pyx_n_s_COMPOSITE); Py_VISIT(traverse_module_state->__pyx_n_s_CONSTANTDIAGONAL); Py_VISIT(traverse_module_state->__pyx_n_s_CONTINUE_ITERATING); Py_VISIT(traverse_module_state->__pyx_n_s_CONTINUE_SEARCH); Py_VISIT(traverse_module_state->__pyx_n_s_CONVERGED_ATOL); Py_VISIT(traverse_module_state->__pyx_n_s_CONVERGED_ATOL_NORMAL); Py_VISIT(traverse_module_state->__pyx_n_s_CONVERGED_EVENT); Py_VISIT(traverse_module_state->__pyx_n_s_CONVERGED_FNORM_ABS); Py_VISIT(traverse_module_state->__pyx_n_s_CONVERGED_FNORM_RELATIVE); Py_VISIT(traverse_module_state->__pyx_n_s_CONVERGED_GATOL); Py_VISIT(traverse_module_state->__pyx_n_s_CONVERGED_GRTOL); Py_VISIT(traverse_module_state->__pyx_n_s_CONVERGED_GTTOL); Py_VISIT(traverse_module_state->__pyx_n_s_CONVERGED_HAPPY_BREAKDOWN); Py_VISIT(traverse_module_state->__pyx_n_s_CONVERGED_ITERATING); Py_VISIT(traverse_module_state->__pyx_n_s_CONVERGED_ITS); Py_VISIT(traverse_module_state->__pyx_n_s_CONVERGED_MINF); Py_VISIT(traverse_module_state->__pyx_n_s_CONVERGED_NEG_CURVE); Py_VISIT(traverse_module_state->__pyx_n_s_CONVERGED_RTOL); Py_VISIT(traverse_module_state->__pyx_n_s_CONVERGED_RTOL_NORMAL); Py_VISIT(traverse_module_state->__pyx_n_s_CONVERGED_SNORM_RELATIVE); Py_VISIT(traverse_module_state->__pyx_n_s_CONVERGED_STEPTOL); Py_VISIT(traverse_module_state->__pyx_n_s_CONVERGED_STEP_LENGTH); Py_VISIT(traverse_module_state->__pyx_n_s_CONVERGED_TIME); Py_VISIT(traverse_module_state->__pyx_n_s_CONVERGED_USER); Py_VISIT(traverse_module_state->__pyx_n_s_COPY_VALUES); Py_VISIT(traverse_module_state->__pyx_n_s_CP); Py_VISIT(traverse_module_state->__pyx_n_s_CR); Py_VISIT(traverse_module_state->__pyx_n_s_CRANK_NICOLSON); Py_VISIT(traverse_module_state->__pyx_n_s_CUDA); Py_VISIT(traverse_module_state->__pyx_n_s_CUSPARSE); Py_VISIT(traverse_module_state->__pyx_kp_s_Can_only_create_a_buffer_that_is); Py_VISIT(traverse_module_state->__pyx_kp_s_Cannot_assign_to_read_only_memor); Py_VISIT(traverse_module_state->__pyx_kp_s_Cannot_create_writable_memory_vi); Py_VISIT(traverse_module_state->__pyx_kp_u_Cannot_index_with_type); Py_VISIT(traverse_module_state->__pyx_kp_s_Cannot_transpose_memoryview_with); Py_VISIT(traverse_module_state->__pyx_n_s_Class); Py_VISIT(traverse_module_state->__pyx_n_s_Clone); Py_VISIT(traverse_module_state->__pyx_n_s_CollectType); Py_VISIT(traverse_module_state->__pyx_n_s_Comm); Py_VISIT(traverse_module_state->__pyx_n_s_ComplexType); Py_VISIT(traverse_module_state->__pyx_n_s_CompositeType); Py_VISIT(traverse_module_state->__pyx_n_s_ConvergedReason); Py_VISIT(traverse_module_state->__pyx_n_s_D); Py_VISIT(traverse_module_state->__pyx_n_s_DA); Py_VISIT(traverse_module_state->__pyx_n_s_DAE_IMPLICIT_INDEX1); Py_VISIT(traverse_module_state->__pyx_n_s_DAE_IMPLICIT_INDEX2); Py_VISIT(traverse_module_state->__pyx_n_s_DAE_IMPLICIT_INDEX3); Py_VISIT(traverse_module_state->__pyx_n_s_DAE_IMPLICIT_INDEXHI); Py_VISIT(traverse_module_state->__pyx_n_s_DAE_SEMI_EXPLICIT_INDEX1); Py_VISIT(traverse_module_state->__pyx_n_s_DAE_SEMI_EXPLICIT_INDEX2); Py_VISIT(traverse_module_state->__pyx_n_s_DAE_SEMI_EXPLICIT_INDEX3); Py_VISIT(traverse_module_state->__pyx_n_s_DAE_SEMI_EXPLICIT_INDEXHI); Py_VISIT(traverse_module_state->__pyx_n_s_DB16); Py_VISIT(traverse_module_state->__pyx_n_s_DB2); Py_VISIT(traverse_module_state->__pyx_n_s_DB4); Py_VISIT(traverse_module_state->__pyx_n_s_DB8); Py_VISIT(traverse_module_state->__pyx_n_s_DECIDE); Py_VISIT(traverse_module_state->__pyx_n_s_DEFAULT); Py_VISIT(traverse_module_state->__pyx_n_s_DEFAULT_BLOCKING); Py_VISIT(traverse_module_state->__pyx_n_s_DEFLATED); Py_VISIT(traverse_module_state->__pyx_n_s_DEFLATION); Py_VISIT(traverse_module_state->__pyx_n_s_DENSE); Py_VISIT(traverse_module_state->__pyx_n_s_DENSECUDA); Py_VISIT(traverse_module_state->__pyx_n_s_DESTROY); Py_VISIT(traverse_module_state->__pyx_n_s_DETERMINE); Py_VISIT(traverse_module_state->__pyx_n_s_DGMRES); Py_VISIT(traverse_module_state->__pyx_n_s_DIAG); Py_VISIT(traverse_module_state->__pyx_n_s_DIAGONAL); Py_VISIT(traverse_module_state->__pyx_n_s_DIFFERENT); Py_VISIT(traverse_module_state->__pyx_n_s_DIFFERENT_NONZERO_PATTERN); Py_VISIT(traverse_module_state->__pyx_n_s_DIFFERENT_NZ); Py_VISIT(traverse_module_state->__pyx_n_s_DIRK); Py_VISIT(traverse_module_state->__pyx_n_s_DIRK657A); Py_VISIT(traverse_module_state->__pyx_n_s_DIRK658A); Py_VISIT(traverse_module_state->__pyx_n_s_DIRK7510SAL); Py_VISIT(traverse_module_state->__pyx_n_s_DIRK759A); Py_VISIT(traverse_module_state->__pyx_n_s_DIRK8614A); Py_VISIT(traverse_module_state->__pyx_n_s_DIRK8616SAL); Py_VISIT(traverse_module_state->__pyx_n_s_DIRKES122SAL); Py_VISIT(traverse_module_state->__pyx_n_s_DIRKES213SAL); Py_VISIT(traverse_module_state->__pyx_n_s_DIRKES324SAL); Py_VISIT(traverse_module_state->__pyx_n_s_DIRKES325SAL); Py_VISIT(traverse_module_state->__pyx_n_s_DIRKES648SA); Py_VISIT(traverse_module_state->__pyx_n_s_DIRKES7510SA); Py_VISIT(traverse_module_state->__pyx_n_s_DIRKES8516SAL); Py_VISIT(traverse_module_state->__pyx_n_s_DIRKS212); Py_VISIT(traverse_module_state->__pyx_n_s_DIRKS659A); Py_VISIT(traverse_module_state->__pyx_n_s_DIRKS7511SAL); Py_VISIT(traverse_module_state->__pyx_n_s_DIRKType); Py_VISIT(traverse_module_state->__pyx_n_s_DISCGRAD); Py_VISIT(traverse_module_state->__pyx_n_s_DIVERGED_BREAKDOWN); Py_VISIT(traverse_module_state->__pyx_n_s_DIVERGED_BREAKDOWN_BICG); Py_VISIT(traverse_module_state->__pyx_n_s_DIVERGED_DTOL); Py_VISIT(traverse_module_state->__pyx_n_s_DIVERGED_FNORM_NAN); Py_VISIT(traverse_module_state->__pyx_n_s_DIVERGED_FUNCTION_COUNT); Py_VISIT(traverse_module_state->__pyx_n_s_DIVERGED_FUNCTION_DOMAIN); Py_VISIT(traverse_module_state->__pyx_n_s_DIVERGED_INDEFINITE_MAT); Py_VISIT(traverse_module_state->__pyx_n_s_DIVERGED_INDEFINITE_PC); Py_VISIT(traverse_module_state->__pyx_n_s_DIVERGED_INNER); Py_VISIT(traverse_module_state->__pyx_n_s_DIVERGED_JACOBIAN_DOMAIN); Py_VISIT(traverse_module_state->__pyx_n_s_DIVERGED_LINEAR_SOLVE); Py_VISIT(traverse_module_state->__pyx_n_s_DIVERGED_LINE_SEARCH); Py_VISIT(traverse_module_state->__pyx_n_s_DIVERGED_LOCAL_MIN); Py_VISIT(traverse_module_state->__pyx_n_s_DIVERGED_LS_FAILURE); Py_VISIT(traverse_module_state->__pyx_n_s_DIVERGED_MAXFCN); Py_VISIT(traverse_module_state->__pyx_n_s_DIVERGED_MAXITS); Py_VISIT(traverse_module_state->__pyx_n_s_DIVERGED_MAX_IT); Py_VISIT(traverse_module_state->__pyx_n_s_DIVERGED_NAN); Py_VISIT(traverse_module_state->__pyx_n_s_DIVERGED_NANORINF); Py_VISIT(traverse_module_state->__pyx_n_s_DIVERGED_NONLINEAR_SOLVE); Py_VISIT(traverse_module_state->__pyx_n_s_DIVERGED_NONSYMMETRIC); Py_VISIT(traverse_module_state->__pyx_n_s_DIVERGED_NULL); Py_VISIT(traverse_module_state->__pyx_n_s_DIVERGED_PCSETUP_FAILED); Py_VISIT(traverse_module_state->__pyx_n_s_DIVERGED_STEP_REJECTED); Py_VISIT(traverse_module_state->__pyx_n_s_DIVERGED_TR_DELTA); Py_VISIT(traverse_module_state->__pyx_n_s_DIVERGED_TR_REDUCTION); Py_VISIT(traverse_module_state->__pyx_n_s_DIVERGED_USER); Py_VISIT(traverse_module_state->__pyx_n_s_DK); Py_VISIT(traverse_module_state->__pyx_n_s_DM); Py_VISIT(traverse_module_state->__pyx_n_s_DMBoundaryType); Py_VISIT(traverse_module_state->__pyx_n_s_DMComposite); Py_VISIT(traverse_module_state->__pyx_n_s_DMComposite_access); Py_VISIT(traverse_module_state->__pyx_n_s_DMDA); Py_VISIT(traverse_module_state->__pyx_n_s_DMDAElementType); Py_VISIT(traverse_module_state->__pyx_n_s_DMDAInterpolationType); Py_VISIT(traverse_module_state->__pyx_n_s_DMDAStencilType); Py_VISIT(traverse_module_state->__pyx_n_s_DMDA_Vec_array); Py_VISIT(traverse_module_state->__pyx_n_s_DMInterpolation); Py_VISIT(traverse_module_state->__pyx_n_s_DMLabel); Py_VISIT(traverse_module_state->__pyx_n_s_DMPlex); Py_VISIT(traverse_module_state->__pyx_n_s_DMPlexReorderDefaultFlag); Py_VISIT(traverse_module_state->__pyx_n_s_DMPlexTransform); Py_VISIT(traverse_module_state->__pyx_n_s_DMPlexTransformType); Py_VISIT(traverse_module_state->__pyx_n_s_DMPolytopeType); Py_VISIT(traverse_module_state->__pyx_n_s_DMShell); Py_VISIT(traverse_module_state->__pyx_n_s_DMStag); Py_VISIT(traverse_module_state->__pyx_n_s_DMStagStencilLocation); Py_VISIT(traverse_module_state->__pyx_n_s_DMStagStencilType); Py_VISIT(traverse_module_state->__pyx_n_s_DMSwarm); Py_VISIT(traverse_module_state->__pyx_n_s_DMSwarmCollectType); Py_VISIT(traverse_module_state->__pyx_n_s_DMSwarmMigrateType); Py_VISIT(traverse_module_state->__pyx_n_s_DMSwarmPICLayoutType); Py_VISIT(traverse_module_state->__pyx_n_s_DMSwarmType); Py_VISIT(traverse_module_state->__pyx_n_s_DMType); Py_VISIT(traverse_module_state->__pyx_kp_s_DM_Boundary_types); Py_VISIT(traverse_module_state->__pyx_kp_s_DM_types); Py_VISIT(traverse_module_state->__pyx_n_s_DOF); Py_VISIT(traverse_module_state->__pyx_n_s_DOWN); Py_VISIT(traverse_module_state->__pyx_n_s_DOWN_LEFT); Py_VISIT(traverse_module_state->__pyx_n_s_DOWN_RIGHT); Py_VISIT(traverse_module_state->__pyx_n_s_DO_NOT_COPY_VALUES); Py_VISIT(traverse_module_state->__pyx_n_s_DRAW); Py_VISIT(traverse_module_state->__pyx_n_s_DRAW_BASIC); Py_VISIT(traverse_module_state->__pyx_n_s_DRAW_CONTOUR); Py_VISIT(traverse_module_state->__pyx_n_s_DRAW_LG); Py_VISIT(traverse_module_state->__pyx_n_s_DRAW_LG_XRANGE); Py_VISIT(traverse_module_state->__pyx_n_s_DRAW_PORTS); Py_VISIT(traverse_module_state->__pyx_n_s_DROP); Py_VISIT(traverse_module_state->__pyx_n_s_DS); Py_VISIT(traverse_module_state->__pyx_n_s_DSType); Py_VISIT(traverse_module_state->__pyx_n_s_DUMMY); Py_VISIT(traverse_module_state->__pyx_n_s_DY); Py_VISIT(traverse_module_state->__pyx_n_s_DeflationSpaceType); Py_VISIT(traverse_module_state->__pyx_n_s_Device); Py_VISIT(traverse_module_state->__pyx_n_s_DeviceContext); Py_VISIT(traverse_module_state->__pyx_n_s_DeviceJoinMode); Py_VISIT(traverse_module_state->__pyx_n_s_DeviceType); Py_VISIT(traverse_module_state->__pyx_kp_s_Device_type_not_supported); Py_VISIT(traverse_module_state->__pyx_kp_s_Dimension_d_is_not_direct); Py_VISIT(traverse_module_state->__pyx_kp_s_Distinguishes_among_types_of_exp); Py_VISIT(traverse_module_state->__pyx_kp_s_Distinguishes_linear_and_nonline); Py_VISIT(traverse_module_state->__pyx_n_s_DrawSize); Py_VISIT(traverse_module_state->__pyx_n_s_DualSpace); Py_VISIT(traverse_module_state->__pyx_n_s_DualSpaceType); Py_VISIT(traverse_module_state->__pyx_n_s_Dup); Py_VISIT(traverse_module_state->__pyx_n_s_DuplicateOption); Py_VISIT(traverse_module_state->__pyx_n_s_EIMEX); Py_VISIT(traverse_module_state->__pyx_n_s_EISENSTAT); Py_VISIT(traverse_module_state->__pyx_n_s_ELEMENT); Py_VISIT(traverse_module_state->__pyx_n_s_ELEMENTAL); Py_VISIT(traverse_module_state->__pyx_n_s_ERROR_LOWER_TRIANGULAR); Py_VISIT(traverse_module_state->__pyx_n_s_ESSL); Py_VISIT(traverse_module_state->__pyx_n_s_EULER); Py_VISIT(traverse_module_state->__pyx_n_s_EXODUSII); Py_VISIT(traverse_module_state->__pyx_n_s_EXOTIC); Py_VISIT(traverse_module_state->__pyx_n_s_EXPLICIT); Py_VISIT(traverse_module_state->__pyx_n_s_EXTRUDE); Py_VISIT(traverse_module_state->__pyx_n_s_ElementType); Py_VISIT(traverse_module_state->__pyx_n_s_Ellipsis); Py_VISIT(traverse_module_state->__pyx_kp_s_Empty_shape_tuple_for_cython_arr); Py_VISIT(traverse_module_state->__pyx_kp_s_Enum_describing_mapping_behavior); Py_VISIT(traverse_module_state->__pyx_n_s_EquationType); Py_VISIT(traverse_module_state->__pyx_n_s_Error); Py_VISIT(traverse_module_state->__pyx_n_s_Error___bool); Py_VISIT(traverse_module_state->__pyx_n_s_Error___init); Py_VISIT(traverse_module_state->__pyx_n_s_Error___repr); Py_VISIT(traverse_module_state->__pyx_n_s_Error___str); Py_VISIT(traverse_module_state->__pyx_n_s_Event); Py_VISIT(traverse_module_state->__pyx_n_s_EventDecorator); Py_VISIT(traverse_module_state->__pyx_n_s_EventDecorator_locals_decorator); Py_VISIT(traverse_module_state->__pyx_n_s_EventDecorator_locals_decorator_2); Py_VISIT(traverse_module_state->__pyx_n_s_ExactFinalTime); Py_VISIT(traverse_module_state->__pyx_n_s_ExactFinalTimeOption); Py_VISIT(traverse_module_state->__pyx_kp_s_Expect_a_dltensor_field_pycapsul); Py_VISIT(traverse_module_state->__pyx_kp_s_Expect_a_dltensor_or_used_dltens); Py_VISIT(traverse_module_state->__pyx_n_s_FACTOR_NUMERIC_ZEROPIVOT); Py_VISIT(traverse_module_state->__pyx_n_s_FACTOR_OTHER); Py_VISIT(traverse_module_state->__pyx_n_s_FACTOR_OUTMEMORY); Py_VISIT(traverse_module_state->__pyx_n_s_FACTOR_STRUCT_ZEROPIVOT); Py_VISIT(traverse_module_state->__pyx_n_s_FAILED); Py_VISIT(traverse_module_state->__pyx_n_s_FAILED_ASCENT); Py_VISIT(traverse_module_state->__pyx_n_s_FAILED_BADPARAMETER); Py_VISIT(traverse_module_state->__pyx_n_s_FAILED_INFORNAN); Py_VISIT(traverse_module_state->__pyx_n_s_FALSE); Py_VISIT(traverse_module_state->__pyx_n_s_FAS); Py_VISIT(traverse_module_state->__pyx_n_s_FBCGS); Py_VISIT(traverse_module_state->__pyx_n_s_FBCGSR); Py_VISIT(traverse_module_state->__pyx_n_s_FCG); Py_VISIT(traverse_module_state->__pyx_n_s_FE); Py_VISIT(traverse_module_state->__pyx_n_s_FETIDP); Py_VISIT(traverse_module_state->__pyx_n_s_FEType); Py_VISIT(traverse_module_state->__pyx_n_s_FFT); Py_VISIT(traverse_module_state->__pyx_n_s_FFTW); Py_VISIT(traverse_module_state->__pyx_n_s_FGMRES); Py_VISIT(traverse_module_state->__pyx_n_s_FIELDSPLIT); Py_VISIT(traverse_module_state->__pyx_n_s_FINAL); Py_VISIT(traverse_module_state->__pyx_n_s_FINAL_ASSEMBLY); Py_VISIT(traverse_module_state->__pyx_n_s_FINAL_ONLY); Py_VISIT(traverse_module_state->__pyx_n_s_FLUSH); Py_VISIT(traverse_module_state->__pyx_n_s_FLUSH_ASSEMBLY); Py_VISIT(traverse_module_state->__pyx_n_s_FORCE_DIAGONAL_ENTRIES); Py_VISIT(traverse_module_state->__pyx_n_s_FOREST); Py_VISIT(traverse_module_state->__pyx_n_s_FORWARD); Py_VISIT(traverse_module_state->__pyx_n_s_FORWARD_LOCAL); Py_VISIT(traverse_module_state->__pyx_n_s_FORWARD_SWEEP); Py_VISIT(traverse_module_state->__pyx_n_s_FR); Py_VISIT(traverse_module_state->__pyx_n_s_FRB); Py_VISIT(traverse_module_state->__pyx_n_s_FROBENIUS); Py_VISIT(traverse_module_state->__pyx_n_s_FRONT); Py_VISIT(traverse_module_state->__pyx_n_s_FRONT_DOWN); Py_VISIT(traverse_module_state->__pyx_n_s_FRONT_DOWN_LEFT); Py_VISIT(traverse_module_state->__pyx_n_s_FRONT_DOWN_RIGHT); Py_VISIT(traverse_module_state->__pyx_n_s_FRONT_LEFT); Py_VISIT(traverse_module_state->__pyx_n_s_FRONT_RIGHT); Py_VISIT(traverse_module_state->__pyx_n_s_FRONT_UP); Py_VISIT(traverse_module_state->__pyx_n_s_FRONT_UP_LEFT); Py_VISIT(traverse_module_state->__pyx_n_s_FRONT_UP_RIGHT); Py_VISIT(traverse_module_state->__pyx_n_s_FULL); Py_VISIT(traverse_module_state->__pyx_n_s_FULL_SIZE); Py_VISIT(traverse_module_state->__pyx_n_s_FV_GHOST); Py_VISIT(traverse_module_state->__pyx_n_s_FactorShiftType); Py_VISIT(traverse_module_state->__pyx_kp_s_Factored_matrix_ordering_type_Se); Py_VISIT(traverse_module_state->__pyx_kp_s_Factored_matrix_shift_type_See_A); Py_VISIT(traverse_module_state->__pyx_kp_s_Factored_matrix_solver_type_See); Py_VISIT(traverse_module_state->__pyx_n_s_FailedReason); Py_VISIT(traverse_module_state->__pyx_n_s_FieldSplitSchurFactType); Py_VISIT(traverse_module_state->__pyx_n_s_FieldSplitSchurPreType); Py_VISIT(traverse_module_state->__pyx_n_s_FileMode); Py_VISIT(traverse_module_state->__pyx_n_s_Format); Py_VISIT(traverse_module_state->__pyx_n_s_Free); Py_VISIT(traverse_module_state->__pyx_n_s_G); Py_VISIT(traverse_module_state->__pyx_n_s_GALERKIN); Py_VISIT(traverse_module_state->__pyx_n_s_GAMG); Py_VISIT(traverse_module_state->__pyx_n_s_GAMGType); Py_VISIT(traverse_module_state->__pyx_n_s_GASM); Py_VISIT(traverse_module_state->__pyx_n_s_GASMType); Py_VISIT(traverse_module_state->__pyx_n_s_GATHER); Py_VISIT(traverse_module_state->__pyx_n_s_GATHERV); Py_VISIT(traverse_module_state->__pyx_n_s_GCR); Py_VISIT(traverse_module_state->__pyx_n_s_GCRODR); Py_VISIT(traverse_module_state->__pyx_n_s_GD); Py_VISIT(traverse_module_state->__pyx_n_s_GENERAL); Py_VISIT(traverse_module_state->__pyx_n_s_GEO); Py_VISIT(traverse_module_state->__pyx_n_s_GETROW_UPPERTRIANGULAR); Py_VISIT(traverse_module_state->__pyx_n_s_GHOSTED); Py_VISIT(traverse_module_state->__pyx_kp_s_GIT_Date); Py_VISIT(traverse_module_state->__pyx_n_s_GLEE); Py_VISIT(traverse_module_state->__pyx_n_s_GLLE); Py_VISIT(traverse_module_state->__pyx_n_s_GLMapMode); Py_VISIT(traverse_module_state->__pyx_n_s_GLOBAL_BLOCKING); Py_VISIT(traverse_module_state->__pyx_n_s_GLOBAL_MAX); Py_VISIT(traverse_module_state->__pyx_n_s_GLOBAL_NONBLOCKING); Py_VISIT(traverse_module_state->__pyx_n_s_GLOBAL_SUM); Py_VISIT(traverse_module_state->__pyx_n_s_GLTR); Py_VISIT(traverse_module_state->__pyx_n_s_GLVIS); Py_VISIT(traverse_module_state->__pyx_n_s_GMRES); Py_VISIT(traverse_module_state->__pyx_n_s_GPCG); Py_VISIT(traverse_module_state->__pyx_n_s_GROPPCG); Py_VISIT(traverse_module_state->__pyx_n_s_Get_rank); Py_VISIT(traverse_module_state->__pyx_n_s_Get_size); Py_VISIT(traverse_module_state->__pyx_kp_s_Given_d_column_indices_but_d_non); Py_VISIT(traverse_module_state->__pyx_n_s_H); Py_VISIT(traverse_module_state->__pyx_n_s_H2OPUS); Py_VISIT(traverse_module_state->__pyx_n_s_HAAR); Py_VISIT(traverse_module_state->__pyx_n_s_HALF); Py_VISIT(traverse_module_state->__pyx_n_s_HALF_SIZE); Py_VISIT(traverse_module_state->__pyx_n_s_HALTED_LOWERBOUND); Py_VISIT(traverse_module_state->__pyx_n_s_HALTED_MAXFCN); Py_VISIT(traverse_module_state->__pyx_n_s_HALTED_OTHER); Py_VISIT(traverse_module_state->__pyx_n_s_HALTED_RTOL); Py_VISIT(traverse_module_state->__pyx_n_s_HALTED_UPPERBOUND); Py_VISIT(traverse_module_state->__pyx_n_s_HALTED_USER); Py_VISIT(traverse_module_state->__pyx_n_s_HASH); Py_VISIT(traverse_module_state->__pyx_n_s_HDF5); Py_VISIT(traverse_module_state->__pyx_n_s_HDF5_MAT); Py_VISIT(traverse_module_state->__pyx_n_s_HDF5_PETSC); Py_VISIT(traverse_module_state->__pyx_n_s_HDF5_VIZ); Py_VISIT(traverse_module_state->__pyx_n_s_HDF5_XDMF); Py_VISIT(traverse_module_state->__pyx_n_s_HERMITIAN); Py_VISIT(traverse_module_state->__pyx_n_s_HERMITIANTRANSPOSE); Py_VISIT(traverse_module_state->__pyx_n_s_HEXAHEDRON); Py_VISIT(traverse_module_state->__pyx_n_s_HIP); Py_VISIT(traverse_module_state->__pyx_n_s_HMG); Py_VISIT(traverse_module_state->__pyx_n_s_HOST); Py_VISIT(traverse_module_state->__pyx_n_s_HPDDM); Py_VISIT(traverse_module_state->__pyx_n_s_HPDDMCoarseCorrectionType); Py_VISIT(traverse_module_state->__pyx_n_s_HPDDMType); Py_VISIT(traverse_module_state->__pyx_n_s_HS); Py_VISIT(traverse_module_state->__pyx_n_s_HYPRE); Py_VISIT(traverse_module_state->__pyx_n_s_HYPRESSTRUCT); Py_VISIT(traverse_module_state->__pyx_n_s_HYPRESTRUCT); Py_VISIT(traverse_module_state->__pyx_n_s_HZ); Py_VISIT(traverse_module_state->__pyx_n_s_I); Py_VISIT(traverse_module_state->__pyx_n_s_IBCGS); Py_VISIT(traverse_module_state->__pyx_n_s_ICC); Py_VISIT(traverse_module_state->__pyx_n_s_IGNORE_LOWER_TRIANGULAR); Py_VISIT(traverse_module_state->__pyx_n_s_IGNORE_NEGATIVE_INDICES); Py_VISIT(traverse_module_state->__pyx_n_s_IGNORE_OFF_PROC_ENTRIES); Py_VISIT(traverse_module_state->__pyx_n_s_IGNORE_ZERO_ENTRIES); Py_VISIT(traverse_module_state->__pyx_n_s_ILU); Py_VISIT(traverse_module_state->__pyx_n_s_IMPLICIT); Py_VISIT(traverse_module_state->__pyx_n_s_INBLOCKS); Py_VISIT(traverse_module_state->__pyx_n_s_INF); Py_VISIT(traverse_module_state->__pyx_n_s_INFINITY); Py_VISIT(traverse_module_state->__pyx_n_s_INITIAL_FINAL_ONLY); Py_VISIT(traverse_module_state->__pyx_n_s_INITIAL_ONLY); Py_VISIT(traverse_module_state->__pyx_n_s_INSERT); Py_VISIT(traverse_module_state->__pyx_n_s_INSERT_ALL); Py_VISIT(traverse_module_state->__pyx_n_s_INSERT_ALL_VALUES); Py_VISIT(traverse_module_state->__pyx_n_s_INSERT_BC); Py_VISIT(traverse_module_state->__pyx_n_s_INSERT_BC_VALUES); Py_VISIT(traverse_module_state->__pyx_n_s_INSERT_VALUES); Py_VISIT(traverse_module_state->__pyx_n_s_INTERIOR_GHOST); Py_VISIT(traverse_module_state->__pyx_n_s_INTERPOLATE); Py_VISIT(traverse_module_state->__pyx_n_s_IPM); Py_VISIT(traverse_module_state->__pyx_n_s_IS); Py_VISIT(traverse_module_state->__pyx_n_s_ISType); Py_VISIT(traverse_module_state->__pyx_n_s_IS_buffer); Py_VISIT(traverse_module_state->__pyx_n_s_ITERATING); Py_VISIT(traverse_module_state->__pyx_kp_s_I_0_is_d_expected_d); Py_VISIT(traverse_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0); Py_VISIT(traverse_module_state->__pyx_n_s_IndexError); Py_VISIT(traverse_module_state->__pyx_kp_s_Index_out_of_bounds_axis_d); Py_VISIT(traverse_module_state->__pyx_kp_s_Indirect_dimensions_not_supporte); Py_VISIT(traverse_module_state->__pyx_n_s_InfoType); Py_VISIT(traverse_module_state->__pyx_kp_s_Input_vector_has_no_tensor_infor); Py_VISIT(traverse_module_state->__pyx_n_s_InsertMode); Py_VISIT(traverse_module_state->__pyx_kp_s_Insertion_mode_Most_commonly_use); Py_VISIT(traverse_module_state->__pyx_n_s_IntType); Py_VISIT(traverse_module_state->__pyx_n_s_InterpolationType); Py_VISIT(traverse_module_state->__pyx_kp_u_Invalid_mode_expected_c_or_fortr); Py_VISIT(traverse_module_state->__pyx_kp_s_Invalid_mode_expected_r_w_or_rw); Py_VISIT(traverse_module_state->__pyx_kp_s_Invalid_mode_expected_rw_r_or_w); Py_VISIT(traverse_module_state->__pyx_kp_u_Invalid_shape_in_axis); Py_VISIT(traverse_module_state->__pyx_n_s_J); Py_VISIT(traverse_module_state->__pyx_n_s_JACOBI); Py_VISIT(traverse_module_state->__pyx_n_s_JoinMode); Py_VISIT(traverse_module_state->__pyx_n_s_KACZMARZ); Py_VISIT(traverse_module_state->__pyx_n_s_KAIJ); Py_VISIT(traverse_module_state->__pyx_n_s_KASKADE); Py_VISIT(traverse_module_state->__pyx_n_s_KD); Py_VISIT(traverse_module_state->__pyx_n_s_KEEP_NONZERO_PATTERN); Py_VISIT(traverse_module_state->__pyx_n_s_KLU); Py_VISIT(traverse_module_state->__pyx_n_s_KOKKOS); Py_VISIT(traverse_module_state->__pyx_n_s_KSP); Py_VISIT(traverse_module_state->__pyx_n_s_KSPConvergedReason); Py_VISIT(traverse_module_state->__pyx_n_s_KSPHPDDMType); Py_VISIT(traverse_module_state->__pyx_n_s_KSPNormType); Py_VISIT(traverse_module_state->__pyx_n_s_KSPONLY); Py_VISIT(traverse_module_state->__pyx_n_s_KSPTRANSPOSEONLY); Py_VISIT(traverse_module_state->__pyx_n_s_KSPType); Py_VISIT(traverse_module_state->__pyx_kp_s_KSP_Converged_Reason_CONVERGED_I); Py_VISIT(traverse_module_state->__pyx_kp_s_KSP_Type_The_available_types_are); Py_VISIT(traverse_module_state->__pyx_kp_s_KSP_norm_type_The_available_norm); Py_VISIT(traverse_module_state->__pyx_n_s_KeyError); Py_VISIT(traverse_module_state->__pyx_n_s_L); Py_VISIT(traverse_module_state->__pyx_n_s_LAGRANGE); Py_VISIT(traverse_module_state->__pyx_n_s_LAYOUT_GAUSS); Py_VISIT(traverse_module_state->__pyx_n_s_LAYOUT_REGULAR); Py_VISIT(traverse_module_state->__pyx_n_s_LAYOUT_SUBDIVISION); Py_VISIT(traverse_module_state->__pyx_n_s_LCD); Py_VISIT(traverse_module_state->__pyx_n_s_LCL); Py_VISIT(traverse_module_state->__pyx_n_s_LEFT); Py_VISIT(traverse_module_state->__pyx_n_s_LGMRES); Py_VISIT(traverse_module_state->__pyx_n_s_LGMap); Py_VISIT(traverse_module_state->__pyx_n_s_LGMapType); Py_VISIT(traverse_module_state->__pyx_n_s_LINEAR); Py_VISIT(traverse_module_state->__pyx_n_s_LMVM); Py_VISIT(traverse_module_state->__pyx_n_s_LMVMBADBROYDEN); Py_VISIT(traverse_module_state->__pyx_n_s_LMVMBFGS); Py_VISIT(traverse_module_state->__pyx_n_s_LMVMBROYDEN); Py_VISIT(traverse_module_state->__pyx_n_s_LMVMDFP); Py_VISIT(traverse_module_state->__pyx_n_s_LMVMDIAGBBROYDEN); Py_VISIT(traverse_module_state->__pyx_n_s_LMVMSR1); Py_VISIT(traverse_module_state->__pyx_n_s_LMVMSYMBADBROYDEN); Py_VISIT(traverse_module_state->__pyx_n_s_LMVMSYMBROYDEN); Py_VISIT(traverse_module_state->__pyx_n_s_LOAD_BALANCE); Py_VISIT(traverse_module_state->__pyx_n_s_LOCAL); Py_VISIT(traverse_module_state->__pyx_n_s_LOCALREF); Py_VISIT(traverse_module_state->__pyx_n_s_LOCAL_BACKWARD_SWEEP); Py_VISIT(traverse_module_state->__pyx_n_s_LOCAL_FORWARD_SWEEP); Py_VISIT(traverse_module_state->__pyx_n_s_LOCAL_SYMMETRIC_SWEEP); Py_VISIT(traverse_module_state->__pyx_n_s_LOWER); Py_VISIT(traverse_module_state->__pyx_n_s_LRC); Py_VISIT(traverse_module_state->__pyx_n_s_LSC); Py_VISIT(traverse_module_state->__pyx_n_s_LSQR); Py_VISIT(traverse_module_state->__pyx_n_s_LU); Py_VISIT(traverse_module_state->__pyx_n_s_LUSOL); Py_VISIT(traverse_module_state->__pyx_n_s_Left); Py_VISIT(traverse_module_state->__pyx_n_s_Log); Py_VISIT(traverse_module_state->__pyx_n_s_LogClass); Py_VISIT(traverse_module_state->__pyx_n_s_LogEvent); Py_VISIT(traverse_module_state->__pyx_n_s_LogStage); Py_VISIT(traverse_module_state->__pyx_n_s_MAIJ); Py_VISIT(traverse_module_state->__pyx_n_s_MAPPING); Py_VISIT(traverse_module_state->__pyx_n_s_MASK); Py_VISIT(traverse_module_state->__pyx_n_s_MAT); Py_VISIT(traverse_module_state->__pyx_n_s_MATCHSTEP); Py_VISIT(traverse_module_state->__pyx_n_s_MATHEMATICA); Py_VISIT(traverse_module_state->__pyx_n_s_MATLAB); Py_VISIT(traverse_module_state->__pyx_n_s_MATPARTITIONING); Py_VISIT(traverse_module_state->__pyx_n_s_MAX); Py_VISIT(traverse_module_state->__pyx_n_s_MAX_VALUES); Py_VISIT(traverse_module_state->__pyx_n_s_MEMORYSCALABLE); Py_VISIT(traverse_module_state->__pyx_n_s_METISND); Py_VISIT(traverse_module_state->__pyx_n_s_MEYER); Py_VISIT(traverse_module_state->__pyx_n_s_MFFD); Py_VISIT(traverse_module_state->__pyx_n_s_MG); Py_VISIT(traverse_module_state->__pyx_n_s_MGCycleType); Py_VISIT(traverse_module_state->__pyx_n_s_MGType); Py_VISIT(traverse_module_state->__pyx_n_s_MIGRATE_BASIC); Py_VISIT(traverse_module_state->__pyx_n_s_MIGRATE_DMCELLEXACT); Py_VISIT(traverse_module_state->__pyx_n_s_MIGRATE_DMCELLNSCATTER); Py_VISIT(traverse_module_state->__pyx_n_s_MIGRATE_USER); Py_VISIT(traverse_module_state->__pyx_n_s_MIMEX); Py_VISIT(traverse_module_state->__pyx_n_s_MINRES); Py_VISIT(traverse_module_state->__pyx_n_s_MIRROR); Py_VISIT(traverse_module_state->__pyx_n_s_MKL_CPARDISO); Py_VISIT(traverse_module_state->__pyx_n_s_MKL_PARDISO); Py_VISIT(traverse_module_state->__pyx_n_s_ML); Py_VISIT(traverse_module_state->__pyx_n_s_MOAB); Py_VISIT(traverse_module_state->__pyx_n_s_MORETHUENTE); Py_VISIT(traverse_module_state->__pyx_n_s_MPI); Py_VISIT(traverse_module_state->__pyx_n_s_MPIADJ); Py_VISIT(traverse_module_state->__pyx_n_s_MPIAIJ); Py_VISIT(traverse_module_state->__pyx_n_s_MPIAIJCRL); Py_VISIT(traverse_module_state->__pyx_n_s_MPIAIJCUSPARSE); Py_VISIT(traverse_module_state->__pyx_n_s_MPIAIJMKL); Py_VISIT(traverse_module_state->__pyx_n_s_MPIAIJPERM); Py_VISIT(traverse_module_state->__pyx_n_s_MPIAIJSELL); Py_VISIT(traverse_module_state->__pyx_n_s_MPIAIJVIENNACL); Py_VISIT(traverse_module_state->__pyx_n_s_MPIBAIJ); Py_VISIT(traverse_module_state->__pyx_n_s_MPIBAIJMKL); Py_VISIT(traverse_module_state->__pyx_n_s_MPICUDA); Py_VISIT(traverse_module_state->__pyx_n_s_MPIDENSE); Py_VISIT(traverse_module_state->__pyx_n_s_MPIDENSECUDA); Py_VISIT(traverse_module_state->__pyx_n_s_MPIHIP); Py_VISIT(traverse_module_state->__pyx_n_s_MPIKAIJ); Py_VISIT(traverse_module_state->__pyx_n_s_MPIKOKKOS); Py_VISIT(traverse_module_state->__pyx_n_s_MPIMAIJ); Py_VISIT(traverse_module_state->__pyx_n_s_MPISBAIJ); Py_VISIT(traverse_module_state->__pyx_n_s_MPISELL); Py_VISIT(traverse_module_state->__pyx_n_s_MPIVIENNACL); Py_VISIT(traverse_module_state->__pyx_n_s_MPRK); Py_VISIT(traverse_module_state->__pyx_n_s_MS); Py_VISIT(traverse_module_state->__pyx_n_s_MULTIPLICATIVE); Py_VISIT(traverse_module_state->__pyx_n_s_MUMPS); Py_VISIT(traverse_module_state->__pyx_n_s_MapMode); Py_VISIT(traverse_module_state->__pyx_n_s_Mat); Py_VISIT(traverse_module_state->__pyx_n_s_MatAssemblyType); Py_VISIT(traverse_module_state->__pyx_n_s_MatDuplicateOption); Py_VISIT(traverse_module_state->__pyx_n_s_MatFactorShiftType); Py_VISIT(traverse_module_state->__pyx_n_s_MatInfoType); Py_VISIT(traverse_module_state->__pyx_n_s_MatOption); Py_VISIT(traverse_module_state->__pyx_n_s_MatOrderingType); Py_VISIT(traverse_module_state->__pyx_n_s_MatPartitioning); Py_VISIT(traverse_module_state->__pyx_n_s_MatPartitioningType); Py_VISIT(traverse_module_state->__pyx_n_s_MatSORType); Py_VISIT(traverse_module_state->__pyx_n_s_MatSolverType); Py_VISIT(traverse_module_state->__pyx_n_s_MatStructure); Py_VISIT(traverse_module_state->__pyx_n_s_MatType); Py_VISIT(traverse_module_state->__pyx_kp_s_Matrix_SOR_type_See_Also_petsc_M); Py_VISIT(traverse_module_state->__pyx_kp_s_Matrix_assembly_type_See_Also_pe); Py_VISIT(traverse_module_state->__pyx_kp_s_Matrix_duplicate_option_See_Also); Py_VISIT(traverse_module_state->__pyx_kp_s_Matrix_info_type); Py_VISIT(traverse_module_state->__pyx_kp_s_Matrix_modification_structure_Se); Py_VISIT(traverse_module_state->__pyx_kp_s_Matrix_option_See_Also_petsc_Mat); Py_VISIT(traverse_module_state->__pyx_kp_s_Matrix_type_See_Also_petsc_MatTy); Py_VISIT(traverse_module_state->__pyx_n_s_MemoryError); Py_VISIT(traverse_module_state->__pyx_kp_s_MemoryView_of_r_at_0x_x); Py_VISIT(traverse_module_state->__pyx_kp_s_MemoryView_of_r_object); Py_VISIT(traverse_module_state->__pyx_n_s_MigrateType); Py_VISIT(traverse_module_state->__pyx_kp_s_Missing_input_parameters); Py_VISIT(traverse_module_state->__pyx_n_s_Mode); Py_VISIT(traverse_module_state->__pyx_kp_s_More_constants_INFINITY_Very_la); Py_VISIT(traverse_module_state->__pyx_kp_s_Must_provide_as_many_communicato); Py_VISIT(traverse_module_state->__pyx_kp_s_Must_provide_both_sizes_and_poin); Py_VISIT(traverse_module_state->__pyx_kp_s_Must_provide_operator_for_USER_o); Py_VISIT(traverse_module_state->__pyx_n_s_N1); Py_VISIT(traverse_module_state->__pyx_n_s_N12); Py_VISIT(traverse_module_state->__pyx_n_s_N2); Py_VISIT(traverse_module_state->__pyx_n_s_NASH); Py_VISIT(traverse_module_state->__pyx_n_s_NASM); Py_VISIT(traverse_module_state->__pyx_n_s_NATIVE); Py_VISIT(traverse_module_state->__pyx_n_s_NATURAL); Py_VISIT(traverse_module_state->__pyx_n_s_NCG); Py_VISIT(traverse_module_state->__pyx_n_s_ND); Py_VISIT(traverse_module_state->__pyx_n_s_ND_Pi); Py_VISIT(traverse_module_state->__pyx_n_s_ND_Pi_Full); Py_VISIT(traverse_module_state->__pyx_n_s_NEIGHBOR); Py_VISIT(traverse_module_state->__pyx_n_s_NEST); Py_VISIT(traverse_module_state->__pyx_n_s_NETWORK); Py_VISIT(traverse_module_state->__pyx_n_s_NEWTONLS); Py_VISIT(traverse_module_state->__pyx_n_s_NEWTONTR); Py_VISIT(traverse_module_state->__pyx_n_s_NEW_NONZERO_ALLOCATION_ERR); Py_VISIT(traverse_module_state->__pyx_n_s_NEW_NONZERO_LOCATIONS); Py_VISIT(traverse_module_state->__pyx_n_s_NEW_NONZERO_LOCATION_ERR); Py_VISIT(traverse_module_state->__pyx_n_s_NGMRES); Py_VISIT(traverse_module_state->__pyx_n_s_NGS); Py_VISIT(traverse_module_state->__pyx_n_s_NINFINITY); Py_VISIT(traverse_module_state->__pyx_n_s_NLS); Py_VISIT(traverse_module_state->__pyx_n_s_NM); Py_VISIT(traverse_module_state->__pyx_n_s_NN); Py_VISIT(traverse_module_state->__pyx_n_s_NO); Py_VISIT(traverse_module_state->__pyx_n_s_NOERROR); Py_VISIT(traverse_module_state->__pyx_n_s_NOFORMAT); Py_VISIT(traverse_module_state->__pyx_n_s_NONE); Py_VISIT(traverse_module_state->__pyx_n_s_NONLINEAR); Py_VISIT(traverse_module_state->__pyx_n_s_NONZERO); Py_VISIT(traverse_module_state->__pyx_n_s_NORMAL); Py_VISIT(traverse_module_state->__pyx_n_s_NORMALHERMITIAN); Py_VISIT(traverse_module_state->__pyx_n_s_NORM_1); Py_VISIT(traverse_module_state->__pyx_n_s_NORM_1_AND_2); Py_VISIT(traverse_module_state->__pyx_n_s_NORM_2); Py_VISIT(traverse_module_state->__pyx_n_s_NORM_ALWAYS); Py_VISIT(traverse_module_state->__pyx_n_s_NORM_DEFAULT); Py_VISIT(traverse_module_state->__pyx_n_s_NORM_FINAL_ONLY); Py_VISIT(traverse_module_state->__pyx_n_s_NORM_FROBENIUS); Py_VISIT(traverse_module_state->__pyx_n_s_NORM_INFINITY); Py_VISIT(traverse_module_state->__pyx_n_s_NORM_INITIAL_FINAL_ONLY); Py_VISIT(traverse_module_state->__pyx_n_s_NORM_INITIAL_ONLY); Py_VISIT(traverse_module_state->__pyx_n_s_NORM_MAX); Py_VISIT(traverse_module_state->__pyx_n_s_NORM_NATURAL); Py_VISIT(traverse_module_state->__pyx_n_s_NORM_NONE); Py_VISIT(traverse_module_state->__pyx_n_s_NORM_PRECONDITIONED); Py_VISIT(traverse_module_state->__pyx_n_s_NORM_UNPRECONDITIONED); Py_VISIT(traverse_module_state->__pyx_n_s_NOTSET); Py_VISIT(traverse_module_state->__pyx_n_s_NOT_SET_VALUES); Py_VISIT(traverse_module_state->__pyx_n_s_NO_OFF_PROC_ENTRIES); Py_VISIT(traverse_module_state->__pyx_n_s_NO_OFF_PROC_ZERO_ROWS); Py_VISIT(traverse_module_state->__pyx_n_s_NO_SYNC); Py_VISIT(traverse_module_state->__pyx_n_s_NRICHARDSON); Py_VISIT(traverse_module_state->__pyx_n_s_NTL); Py_VISIT(traverse_module_state->__pyx_n_s_NTR); Py_VISIT(traverse_module_state->__pyx_n_s_NULLLOC); Py_VISIT(traverse_module_state->__pyx_n_s_NZ); Py_VISIT(traverse_module_state->__pyx_n_s_NormSchedule); Py_VISIT(traverse_module_state->__pyx_n_s_NormType); Py_VISIT(traverse_module_state->__pyx_kp_s_Norm_type_Commonly_used_norm_typ); Py_VISIT(traverse_module_state->__pyx_n_s_NotImplemented); Py_VISIT(traverse_module_state->__pyx_n_s_NotImplementedError); Py_VISIT(traverse_module_state->__pyx_kp_s_Not_for_rectangular_matrices); Py_VISIT(traverse_module_state->__pyx_kp_s_Not_for_type); Py_VISIT(traverse_module_state->__pyx_n_s_NullSpace); Py_VISIT(traverse_module_state->__pyx_n_b_O); Py_VISIT(traverse_module_state->__pyx_n_s_ODE_EXPLICIT); Py_VISIT(traverse_module_state->__pyx_n_s_ODE_IMPLICIT); Py_VISIT(traverse_module_state->__pyx_n_s_OPENCL); Py_VISIT(traverse_module_state->__pyx_n_s_OPTION_MAX); Py_VISIT(traverse_module_state->__pyx_n_s_OPTION_MIN); Py_VISIT(traverse_module_state->__pyx_n_s_OWARMIJO); Py_VISIT(traverse_module_state->__pyx_n_s_OWD); Py_VISIT(traverse_module_state->__pyx_n_s_OWLQN); Py_VISIT(traverse_module_state->__pyx_n_s_Object); Py_VISIT(traverse_module_state->__pyx_kp_s_Object_is_not_writable); Py_VISIT(traverse_module_state->__pyx_n_s_Option); Py_VISIT(traverse_module_state->__pyx_n_s_Options); Py_VISIT(traverse_module_state->__pyx_n_s_OrderingType); Py_VISIT(traverse_module_state->__pyx_kp_u_Out_of_bounds_on_buffer_access_a); Py_VISIT(traverse_module_state->__pyx_kp_s_Out_of_memory_Allocated_d_Used_b); Py_VISIT(traverse_module_state->__pyx_n_s_P); Py_VISIT(traverse_module_state->__pyx_n_s_P1); Py_VISIT(traverse_module_state->__pyx_n_s_P4EST); Py_VISIT(traverse_module_state->__pyx_n_s_P8EST); Py_VISIT(traverse_module_state->__pyx_n_s_PARDECOMP); Py_VISIT(traverse_module_state->__pyx_n_s_PARMETIS); Py_VISIT(traverse_module_state->__pyx_n_s_PARMS); Py_VISIT(traverse_module_state->__pyx_n_s_PARTITIONINGAVERAGE); Py_VISIT(traverse_module_state->__pyx_n_s_PARTITIONINGCHACO); Py_VISIT(traverse_module_state->__pyx_n_s_PARTITIONINGCURRENT); Py_VISIT(traverse_module_state->__pyx_n_s_PARTITIONINGHIERARCH); Py_VISIT(traverse_module_state->__pyx_n_s_PARTITIONINGPARMETIS); Py_VISIT(traverse_module_state->__pyx_n_s_PARTITIONINGPARTY); Py_VISIT(traverse_module_state->__pyx_n_s_PARTITIONINGPTSCOTCH); Py_VISIT(traverse_module_state->__pyx_n_s_PARTITIONINGSQUARE); Py_VISIT(traverse_module_state->__pyx_n_s_PASTIX); Py_VISIT(traverse_module_state->__pyx_n_s_PATCH); Py_VISIT(traverse_module_state->__pyx_n_s_PBJACOBI); Py_VISIT(traverse_module_state->__pyx_n_s_PC); Py_VISIT(traverse_module_state->__pyx_n_s_PCASMType); Py_VISIT(traverse_module_state->__pyx_n_s_PCCompositeType); Py_VISIT(traverse_module_state->__pyx_n_s_PCDeflationSpaceType); Py_VISIT(traverse_module_state->__pyx_n_s_PCFailedReason); Py_VISIT(traverse_module_state->__pyx_n_s_PCFieldSplitSchurFactType); Py_VISIT(traverse_module_state->__pyx_n_s_PCFieldSplitSchurPreType); Py_VISIT(traverse_module_state->__pyx_n_s_PCGAMGType); Py_VISIT(traverse_module_state->__pyx_n_s_PCGASMType); Py_VISIT(traverse_module_state->__pyx_n_s_PCGD); Py_VISIT(traverse_module_state->__pyx_n_s_PCHPDDMCoarseCorrectionType); Py_VISIT(traverse_module_state->__pyx_n_s_PCMGCycleType); Py_VISIT(traverse_module_state->__pyx_n_s_PCMGType); Py_VISIT(traverse_module_state->__pyx_n_s_PCPatchConstructType); Py_VISIT(traverse_module_state->__pyx_n_s_PCSide); Py_VISIT(traverse_module_state->__pyx_n_s_PCType); Py_VISIT(traverse_module_state->__pyx_n_s_PD); Py_VISIT(traverse_module_state->__pyx_n_s_PDIPM); Py_VISIT(traverse_module_state->__pyx_n_s_PERIODIC); Py_VISIT(traverse_module_state->__pyx_n_s_PETSC); Py_VISIT(traverse_module_state->__pyx_kp_s_PETSc_Error_Attributes_ierr_int); Py_VISIT(traverse_module_state->__pyx_kp_s_PETSc_Error_d); Py_VISIT(traverse_module_state->__pyx_n_s_PFMG); Py_VISIT(traverse_module_state->__pyx_n_s_PGMRES); Py_VISIT(traverse_module_state->__pyx_n_s_PIC); Py_VISIT(traverse_module_state->__pyx_n_s_PICLayoutType); Py_VISIT(traverse_module_state->__pyx_n_s_PINFINITY); Py_VISIT(traverse_module_state->__pyx_n_s_PIPEBCGS); Py_VISIT(traverse_module_state->__pyx_n_s_PIPECG); Py_VISIT(traverse_module_state->__pyx_n_s_PIPECG2); Py_VISIT(traverse_module_state->__pyx_n_s_PIPECGRR); Py_VISIT(traverse_module_state->__pyx_n_s_PIPECR); Py_VISIT(traverse_module_state->__pyx_n_s_PIPEFCG); Py_VISIT(traverse_module_state->__pyx_n_s_PIPEFGMRES); Py_VISIT(traverse_module_state->__pyx_n_s_PIPEGCR); Py_VISIT(traverse_module_state->__pyx_n_s_PIPELCG); Py_VISIT(traverse_module_state->__pyx_n_s_PIPEPRCG); Py_VISIT(traverse_module_state->__pyx_n_s_PLEX); Py_VISIT(traverse_module_state->__pyx_n_s_POINT); Py_VISIT(traverse_module_state->__pyx_n_s_POINT_PRISM_TENSOR); Py_VISIT(traverse_module_state->__pyx_n_s_POLYNOMIAL); Py_VISIT(traverse_module_state->__pyx_n_s_POSITIVE_DEFINITE); Py_VISIT(traverse_module_state->__pyx_n_s_POUNDERS); Py_VISIT(traverse_module_state->__pyx_n_s_PREALLOCATOR); Py_VISIT(traverse_module_state->__pyx_n_s_PRECONDITIONED); Py_VISIT(traverse_module_state->__pyx_n_s_PREONLY); Py_VISIT(traverse_module_state->__pyx_n_s_PRODUCT); Py_VISIT(traverse_module_state->__pyx_n_s_PRP); Py_VISIT(traverse_module_state->__pyx_n_s_PRP_PLUS); Py_VISIT(traverse_module_state->__pyx_n_s_PSEUDO); Py_VISIT(traverse_module_state->__pyx_n_s_PTRIMMED); Py_VISIT(traverse_module_state->__pyx_n_s_PTSCOTCH); Py_VISIT(traverse_module_state->__pyx_n_s_PYRAMID); Py_VISIT(traverse_module_state->__pyx_n_s_PYTHON); Py_VISIT(traverse_module_state->__pyx_n_s_Partitioner); Py_VISIT(traverse_module_state->__pyx_n_s_PartitionerType); Py_VISIT(traverse_module_state->__pyx_n_s_PatchConstructType); Py_VISIT(traverse_module_state->__pyx_n_s_PickleError); Py_VISIT(traverse_module_state->__pyx_n_s_PolytopeType); Py_VISIT(traverse_module_state->__pyx_kp_s_Portable_Extensible_Toolkit_for); Py_VISIT(traverse_module_state->__pyx_n_s_Print); Py_VISIT(traverse_module_state->__pyx_n_s_ProblemType); Py_VISIT(traverse_module_state->__pyx_n_s_PtAP); Py_VISIT(traverse_module_state->__pyx_n_s_Q0); Py_VISIT(traverse_module_state->__pyx_n_s_Q1); Py_VISIT(traverse_module_state->__pyx_n_s_QCG); Py_VISIT(traverse_module_state->__pyx_n_s_QMD); Py_VISIT(traverse_module_state->__pyx_n_s_QMRCGS); Py_VISIT(traverse_module_state->__pyx_n_s_QN); Py_VISIT(traverse_module_state->__pyx_n_s_QR); Py_VISIT(traverse_module_state->__pyx_n_s_QUADRILATERAL); Py_VISIT(traverse_module_state->__pyx_n_s_QUAD_PRISM_TENSOR); Py_VISIT(traverse_module_state->__pyx_n_s_QUARTER); Py_VISIT(traverse_module_state->__pyx_n_s_QUARTER_SIZE); Py_VISIT(traverse_module_state->__pyx_n_s_Quad); Py_VISIT(traverse_module_state->__pyx_n_s_R); Py_VISIT(traverse_module_state->__pyx_n_s_RADAU5); Py_VISIT(traverse_module_state->__pyx_n_s_RAND); Py_VISIT(traverse_module_state->__pyx_n_s_RAND48); Py_VISIT(traverse_module_state->__pyx_n_s_RANDER48); Py_VISIT(traverse_module_state->__pyx_n_s_RANDOM123); Py_VISIT(traverse_module_state->__pyx_n_s_RARt); Py_VISIT(traverse_module_state->__pyx_n_s_RCM); Py_VISIT(traverse_module_state->__pyx_n_s_READ); Py_VISIT(traverse_module_state->__pyx_n_s_REDISTRIBUTE); Py_VISIT(traverse_module_state->__pyx_n_s_REDUNDANT); Py_VISIT(traverse_module_state->__pyx_n_s_REFINE1D); Py_VISIT(traverse_module_state->__pyx_n_s_REFINEALFELD); Py_VISIT(traverse_module_state->__pyx_n_s_REFINEBOUNDARYLAYER); Py_VISIT(traverse_module_state->__pyx_n_s_REFINED); Py_VISIT(traverse_module_state->__pyx_n_s_REFINEPOWELLSABIN); Py_VISIT(traverse_module_state->__pyx_n_s_REFINEREGULAR); Py_VISIT(traverse_module_state->__pyx_n_s_REFINESBR); Py_VISIT(traverse_module_state->__pyx_n_s_REFINETOBOX); Py_VISIT(traverse_module_state->__pyx_n_s_REFINETOSIMPLEX); Py_VISIT(traverse_module_state->__pyx_n_s_RESTRICT); Py_VISIT(traverse_module_state->__pyx_n_s_REVERSE); Py_VISIT(traverse_module_state->__pyx_n_s_REVERSE_LOCAL); Py_VISIT(traverse_module_state->__pyx_n_s_RICHARDSON); Py_VISIT(traverse_module_state->__pyx_n_s_RIGHT); Py_VISIT(traverse_module_state->__pyx_n_s_RK); Py_VISIT(traverse_module_state->__pyx_n_s_RK1FE); Py_VISIT(traverse_module_state->__pyx_n_s_RK2A); Py_VISIT(traverse_module_state->__pyx_n_s_RK2B); Py_VISIT(traverse_module_state->__pyx_n_s_RK3); Py_VISIT(traverse_module_state->__pyx_n_s_RK3BS); Py_VISIT(traverse_module_state->__pyx_n_s_RK4); Py_VISIT(traverse_module_state->__pyx_n_s_RK5BS); Py_VISIT(traverse_module_state->__pyx_n_s_RK5DP); Py_VISIT(traverse_module_state->__pyx_n_s_RK5F); Py_VISIT(traverse_module_state->__pyx_n_s_RK6VR); Py_VISIT(traverse_module_state->__pyx_n_s_RK7VR); Py_VISIT(traverse_module_state->__pyx_n_s_RK8VR); Py_VISIT(traverse_module_state->__pyx_n_s_RKType); Py_VISIT(traverse_module_state->__pyx_n_s_ROSW); Py_VISIT(traverse_module_state->__pyx_n_s_ROWLENGTH); Py_VISIT(traverse_module_state->__pyx_n_s_ROWSCALINGVIENNACL); Py_VISIT(traverse_module_state->__pyx_n_s_ROW_ORIENTED); Py_VISIT(traverse_module_state->__pyx_n_s_RT_Pi); Py_VISIT(traverse_module_state->__pyx_n_s_RT_Pi_Full); Py_VISIT(traverse_module_state->__pyx_n_s_RUNGE_KUTTA); Py_VISIT(traverse_module_state->__pyx_n_s_Random); Py_VISIT(traverse_module_state->__pyx_n_s_RandomType); Py_VISIT(traverse_module_state->__pyx_n_s_RealType); Py_VISIT(traverse_module_state->__pyx_n_s_Reason); Py_VISIT(traverse_module_state->__pyx_n_s_ReorderDefaultFlag); Py_VISIT(traverse_module_state->__pyx_n_s_Right); Py_VISIT(traverse_module_state->__pyx_n_s_RuntimeError); Py_VISIT(traverse_module_state->__pyx_n_s_S); Py_VISIT(traverse_module_state->__pyx_n_s_SAME); Py_VISIT(traverse_module_state->__pyx_n_s_SAME_NONZERO_PATTERN); Py_VISIT(traverse_module_state->__pyx_n_s_SAME_NZ); Py_VISIT(traverse_module_state->__pyx_n_s_SAVIENNACL); Py_VISIT(traverse_module_state->__pyx_n_s_SAWS); Py_VISIT(traverse_module_state->__pyx_n_s_SBAIJ); Py_VISIT(traverse_module_state->__pyx_n_s_SCALAPACK); Py_VISIT(traverse_module_state->__pyx_n_s_SCATTER); Py_VISIT(traverse_module_state->__pyx_n_s_SCATTER_FORWARD); Py_VISIT(traverse_module_state->__pyx_n_s_SCATTER_FORWARD_LOCAL); Py_VISIT(traverse_module_state->__pyx_n_s_SCATTER_REVERSE); Py_VISIT(traverse_module_state->__pyx_n_s_SCATTER_REVERSE_LOCAL); Py_VISIT(traverse_module_state->__pyx_n_s_SCHUR); Py_VISIT(traverse_module_state->__pyx_n_s_SCHURCOMPLEMENT); Py_VISIT(traverse_module_state->__pyx_n_s_SEGMENT); Py_VISIT(traverse_module_state->__pyx_n_s_SEG_PRISM_TENSOR); Py_VISIT(traverse_module_state->__pyx_n_s_SELF); Py_VISIT(traverse_module_state->__pyx_n_s_SELFP); Py_VISIT(traverse_module_state->__pyx_n_s_SELL); Py_VISIT(traverse_module_state->__pyx_n_s_SEQ); Py_VISIT(traverse_module_state->__pyx_n_s_SEQAIJ); Py_VISIT(traverse_module_state->__pyx_n_s_SEQAIJCRL); Py_VISIT(traverse_module_state->__pyx_n_s_SEQAIJCUSPARSE); Py_VISIT(traverse_module_state->__pyx_n_s_SEQAIJMKL); Py_VISIT(traverse_module_state->__pyx_n_s_SEQAIJPERM); Py_VISIT(traverse_module_state->__pyx_n_s_SEQAIJSELL); Py_VISIT(traverse_module_state->__pyx_n_s_SEQAIJVIENNACL); Py_VISIT(traverse_module_state->__pyx_n_s_SEQBAIJ); Py_VISIT(traverse_module_state->__pyx_n_s_SEQBAIJMKL); Py_VISIT(traverse_module_state->__pyx_n_s_SEQCUDA); Py_VISIT(traverse_module_state->__pyx_n_s_SEQCUFFT); Py_VISIT(traverse_module_state->__pyx_n_s_SEQDENSE); Py_VISIT(traverse_module_state->__pyx_n_s_SEQDENSECUDA); Py_VISIT(traverse_module_state->__pyx_n_s_SEQHIP); Py_VISIT(traverse_module_state->__pyx_n_s_SEQKAIJ); Py_VISIT(traverse_module_state->__pyx_n_s_SEQKOKKOS); Py_VISIT(traverse_module_state->__pyx_n_s_SEQMAIJ); Py_VISIT(traverse_module_state->__pyx_n_s_SEQSBAIJ); Py_VISIT(traverse_module_state->__pyx_n_s_SEQSELL); Py_VISIT(traverse_module_state->__pyx_n_s_SEQVIENNACL); Py_VISIT(traverse_module_state->__pyx_n_s_SETUP_ERROR); Py_VISIT(traverse_module_state->__pyx_n_s_SF); Py_VISIT(traverse_module_state->__pyx_n_s_SFType); Py_VISIT(traverse_module_state->__pyx_n_s_SHARED); Py_VISIT(traverse_module_state->__pyx_n_s_SHARE_NONZERO_PATTERN); Py_VISIT(traverse_module_state->__pyx_n_s_SHELL); Py_VISIT(traverse_module_state->__pyx_n_s_SIMPLE); Py_VISIT(traverse_module_state->__pyx_n_s_SLICED); Py_VISIT(traverse_module_state->__pyx_n_s_SNES); Py_VISIT(traverse_module_state->__pyx_n_s_SNESConvergedReason); Py_VISIT(traverse_module_state->__pyx_n_s_SNESNormSchedule); Py_VISIT(traverse_module_state->__pyx_n_s_SNESType); Py_VISIT(traverse_module_state->__pyx_kp_s_SNES_norm_schedule_See_Also_pets); Py_VISIT(traverse_module_state->__pyx_kp_s_SNES_solver_termination_reason_S); Py_VISIT(traverse_module_state->__pyx_kp_s_SNES_solver_type_See_Also_petsc); Py_VISIT(traverse_module_state->__pyx_n_s_SOCKET); Py_VISIT(traverse_module_state->__pyx_n_s_SOR); Py_VISIT(traverse_module_state->__pyx_n_s_SORTED_FULL); Py_VISIT(traverse_module_state->__pyx_n_s_SORType); Py_VISIT(traverse_module_state->__pyx_n_s_SPAI); Py_VISIT(traverse_module_state->__pyx_n_s_SPD); Py_VISIT(traverse_module_state->__pyx_n_s_SPECIAL); Py_VISIT(traverse_module_state->__pyx_n_s_SPECTRAL); Py_VISIT(traverse_module_state->__pyx_n_s_SPQR); Py_VISIT(traverse_module_state->__pyx_n_s_SPRNG); Py_VISIT(traverse_module_state->__pyx_n_s_SSFLS); Py_VISIT(traverse_module_state->__pyx_n_s_SSILS); Py_VISIT(traverse_module_state->__pyx_n_s_SSML_BFGS); Py_VISIT(traverse_module_state->__pyx_n_s_SSML_BRDN); Py_VISIT(traverse_module_state->__pyx_n_s_SSML_DFP); Py_VISIT(traverse_module_state->__pyx_n_s_SSP); Py_VISIT(traverse_module_state->__pyx_n_s_STAG); Py_VISIT(traverse_module_state->__pyx_n_s_STANDARD); Py_VISIT(traverse_module_state->__pyx_n_s_STAR); Py_VISIT(traverse_module_state->__pyx_n_s_STCG); Py_VISIT(traverse_module_state->__pyx_n_s_STDERR); Py_VISIT(traverse_module_state->__pyx_n_s_STDOUT); Py_VISIT(traverse_module_state->__pyx_n_s_STEPOVER); Py_VISIT(traverse_module_state->__pyx_n_s_STRIDE); Py_VISIT(traverse_module_state->__pyx_n_s_STRING); Py_VISIT(traverse_module_state->__pyx_n_s_STRUCTURALLY_SYMMETRIC); Py_VISIT(traverse_module_state->__pyx_n_s_STRUCTURE_ONLY); Py_VISIT(traverse_module_state->__pyx_n_s_STRUMPACK); Py_VISIT(traverse_module_state->__pyx_n_s_SUBMATRIX); Py_VISIT(traverse_module_state->__pyx_n_s_SUBMAT_SINGLEIS); Py_VISIT(traverse_module_state->__pyx_n_s_SUBPC_ERROR); Py_VISIT(traverse_module_state->__pyx_n_s_SUBSET); Py_VISIT(traverse_module_state->__pyx_n_s_SUBSET_NONZERO_PATTERN); Py_VISIT(traverse_module_state->__pyx_n_s_SUBSET_NZ); Py_VISIT(traverse_module_state->__pyx_n_s_SUBSET_OFF_PROC_ENTRIES); Py_VISIT(traverse_module_state->__pyx_n_s_SUBSPACE); Py_VISIT(traverse_module_state->__pyx_n_s_SUCCESS); Py_VISIT(traverse_module_state->__pyx_n_s_SUCCESS_USER); Py_VISIT(traverse_module_state->__pyx_n_s_SUM); Py_VISIT(traverse_module_state->__pyx_n_s_SUNDIALS); Py_VISIT(traverse_module_state->__pyx_n_s_SUPERLU); Py_VISIT(traverse_module_state->__pyx_n_s_SUPERLU_DIST); Py_VISIT(traverse_module_state->__pyx_n_s_SVD); Py_VISIT(traverse_module_state->__pyx_n_s_SWARM); Py_VISIT(traverse_module_state->__pyx_n_s_SYCL); Py_VISIT(traverse_module_state->__pyx_n_s_SYMMETRIC); Py_VISIT(traverse_module_state->__pyx_n_s_SYMMETRIC_MULTIPLICATIVE); Py_VISIT(traverse_module_state->__pyx_n_s_SYMMETRY_ETERNAL); Py_VISIT(traverse_module_state->__pyx_n_s_SYMMETRY_SWEEP); Py_VISIT(traverse_module_state->__pyx_n_s_SYMMLQ); Py_VISIT(traverse_module_state->__pyx_n_s_SYNC); Py_VISIT(traverse_module_state->__pyx_n_s_SYSPFMG); Py_VISIT(traverse_module_state->__pyx_n_s_ScalarType); Py_VISIT(traverse_module_state->__pyx_n_s_Scatter); Py_VISIT(traverse_module_state->__pyx_n_s_ScatterMode); Py_VISIT(traverse_module_state->__pyx_n_s_ScatterType); Py_VISIT(traverse_module_state->__pyx_kp_s_Scatter_mode_Most_commonly_used); Py_VISIT(traverse_module_state->__pyx_kp_s_Scatter_type_See_Also_petsc_VecS); Py_VISIT(traverse_module_state->__pyx_n_s_SchurFactType); Py_VISIT(traverse_module_state->__pyx_n_s_SchurPreType); Py_VISIT(traverse_module_state->__pyx_n_s_Section); Py_VISIT(traverse_module_state->__pyx_n_s_Sequence); Py_VISIT(traverse_module_state->__pyx_n_s_Side); Py_VISIT(traverse_module_state->__pyx_n_s_Size); Py_VISIT(traverse_module_state->__pyx_n_s_SolverType); Py_VISIT(traverse_module_state->__pyx_n_s_Space); Py_VISIT(traverse_module_state->__pyx_n_s_SpaceType); Py_VISIT(traverse_module_state->__pyx_n_s_Stage); Py_VISIT(traverse_module_state->__pyx_n_s_Stencil); Py_VISIT(traverse_module_state->__pyx_n_s_StencilLocation); Py_VISIT(traverse_module_state->__pyx_n_s_StencilType); Py_VISIT(traverse_module_state->__pyx_kp_s_Step_may_not_be_zero_axis_d); Py_VISIT(traverse_module_state->__pyx_n_s_StreamType); Py_VISIT(traverse_module_state->__pyx_n_s_Structure); Py_VISIT(traverse_module_state->__pyx_n_s_Sys); Py_VISIT(traverse_module_state->__pyx_n_s_SystemError); Py_VISIT(traverse_module_state->__pyx_kp_b_T); Py_VISIT(traverse_module_state->__pyx_n_s_TAO); Py_VISIT(traverse_module_state->__pyx_n_s_TAOBNCGType); Py_VISIT(traverse_module_state->__pyx_n_s_TAOConvergedReason); Py_VISIT(traverse_module_state->__pyx_n_s_TAOLineSearch); Py_VISIT(traverse_module_state->__pyx_n_s_TAOLineSearchConvergedReason); Py_VISIT(traverse_module_state->__pyx_n_s_TAOLineSearchType); Py_VISIT(traverse_module_state->__pyx_n_s_TAOType); Py_VISIT(traverse_module_state->__pyx_kp_s_TAO_Bound_Constrained_Conjugate); Py_VISIT(traverse_module_state->__pyx_kp_s_TAO_Line_Search_Termination_Reas); Py_VISIT(traverse_module_state->__pyx_kp_s_TAO_Line_Search_Types); Py_VISIT(traverse_module_state->__pyx_kp_s_TAO_solver_termination_reason_Se); Py_VISIT(traverse_module_state->__pyx_kp_s_TAO_solver_type_See_Also_petsc_T); Py_VISIT(traverse_module_state->__pyx_n_s_TCQMR); Py_VISIT(traverse_module_state->__pyx_n_s_TELESCOPE); Py_VISIT(traverse_module_state->__pyx_n_s_TENSOR); Py_VISIT(traverse_module_state->__pyx_n_s_TETRAHEDRON); Py_VISIT(traverse_module_state->__pyx_n_s_TFQMR); Py_VISIT(traverse_module_state->__pyx_n_s_TFS); Py_VISIT(traverse_module_state->__pyx_n_s_TH); Py_VISIT(traverse_module_state->__pyx_n_s_THETA); Py_VISIT(traverse_module_state->__pyx_n_s_THIRD); Py_VISIT(traverse_module_state->__pyx_n_s_THIRD_SIZE); Py_VISIT(traverse_module_state->__pyx_n_s_TRANSFORMFILTER); Py_VISIT(traverse_module_state->__pyx_n_s_TRANSPOSE); Py_VISIT(traverse_module_state->__pyx_n_s_TRIANGLE); Py_VISIT(traverse_module_state->__pyx_n_s_TRI_PRISM); Py_VISIT(traverse_module_state->__pyx_n_s_TRI_PRISM_TENSOR); Py_VISIT(traverse_module_state->__pyx_n_s_TRON); Py_VISIT(traverse_module_state->__pyx_n_s_TRUE); Py_VISIT(traverse_module_state->__pyx_n_s_TS); Py_VISIT(traverse_module_state->__pyx_n_s_TSARKIMEXType); Py_VISIT(traverse_module_state->__pyx_n_s_TSConvergedReason); Py_VISIT(traverse_module_state->__pyx_n_s_TSDIRKType); Py_VISIT(traverse_module_state->__pyx_n_s_TSEquationType); Py_VISIT(traverse_module_state->__pyx_n_s_TSExactFinalTime); Py_VISIT(traverse_module_state->__pyx_n_s_TSIRM); Py_VISIT(traverse_module_state->__pyx_n_s_TSProblemType); Py_VISIT(traverse_module_state->__pyx_n_s_TSRKType); Py_VISIT(traverse_module_state->__pyx_n_s_TSType); Py_VISIT(traverse_module_state->__pyx_n_s_TWIST); Py_VISIT(traverse_module_state->__pyx_n_s_T_2); Py_VISIT(traverse_module_state->__pyx_kp_s_Tensor_dtype_does_not_match_PETS); Py_VISIT(traverse_module_state->__pyx_kp_s_The_ARKIMEX_subtype); Py_VISIT(traverse_module_state->__pyx_kp_s_The_ASM_subtype); Py_VISIT(traverse_module_state->__pyx_kp_s_The_DIRK_subtype); Py_VISIT(traverse_module_state->__pyx_kp_s_The_GAMG_subtype); Py_VISIT(traverse_module_state->__pyx_kp_s_The_GASM_subtype); Py_VISIT(traverse_module_state->__pyx_kp_s_The_HPDDM_Krylov_solver_type); Py_VISIT(traverse_module_state->__pyx_kp_s_The_HPDDM_coarse_correction_type); Py_VISIT(traverse_module_state->__pyx_kp_s_The_MG_cycle_type); Py_VISIT(traverse_module_state->__pyx_kp_s_The_MG_subtype); Py_VISIT(traverse_module_state->__pyx_kp_s_The_RK_subtype); Py_VISIT(traverse_module_state->__pyx_kp_s_The_composite_type); Py_VISIT(traverse_module_state->__pyx_kp_s_The_deflation_space_subtype); Py_VISIT(traverse_module_state->__pyx_kp_s_The_field_split_Schur_factorizat); Py_VISIT(traverse_module_state->__pyx_kp_s_The_field_split_Schur_subtype); Py_VISIT(traverse_module_state->__pyx_kp_s_The_manner_in_which_the_precondi); Py_VISIT(traverse_module_state->__pyx_kp_s_The_method_for_ending_time_stepp); Py_VISIT(traverse_module_state->__pyx_kp_s_The_patch_construction_type); Py_VISIT(traverse_module_state->__pyx_kp_s_The_preconditioner_method); Py_VISIT(traverse_module_state->__pyx_kp_s_The_random_number_generator_type); Py_VISIT(traverse_module_state->__pyx_kp_s_The_reason_the_preconditioner_ha); Py_VISIT(traverse_module_state->__pyx_kp_s_The_reason_the_time_step_is_conv); Py_VISIT(traverse_module_state->__pyx_kp_s_The_time_stepping_method); Py_VISIT(traverse_module_state->__pyx_kp_s_The_type_of_device_See_Also_Devi); Py_VISIT(traverse_module_state->__pyx_kp_s_The_type_of_join_to_perform_See); Py_VISIT(traverse_module_state->__pyx_kp_s_The_type_of_stream_See_Also_Devi); Py_VISIT(traverse_module_state->__pyx_kp_s_The_vector_type); Py_VISIT(traverse_module_state->__pyx_n_s_Type); Py_VISIT(traverse_module_state->__pyx_n_s_TypeError); Py_VISIT(traverse_module_state->__pyx_n_s_U); Py_VISIT(traverse_module_state->__pyx_n_s_UA); Py_VISIT(traverse_module_state->__pyx_n_s_UMFPACK); Py_VISIT(traverse_module_state->__pyx_n_s_UNIT); Py_VISIT(traverse_module_state->__pyx_n_s_UNKNOWN); Py_VISIT(traverse_module_state->__pyx_n_s_UNKNOWN_NONZERO_PATTERN); Py_VISIT(traverse_module_state->__pyx_n_s_UNKNOWN_NZ); Py_VISIT(traverse_module_state->__pyx_n_s_UNPRECONDITIONED); Py_VISIT(traverse_module_state->__pyx_n_s_UNSPECIFIED); Py_VISIT(traverse_module_state->__pyx_n_s_UNUSED_NONZERO_LOCATION_ERR); Py_VISIT(traverse_module_state->__pyx_n_s_UP); Py_VISIT(traverse_module_state->__pyx_n_s_UPDATE); Py_VISIT(traverse_module_state->__pyx_n_s_UPPER); Py_VISIT(traverse_module_state->__pyx_n_s_UP_LEFT); Py_VISIT(traverse_module_state->__pyx_n_s_UP_RIGHT); Py_VISIT(traverse_module_state->__pyx_n_s_USER); Py_VISIT(traverse_module_state->__pyx_n_s_USE_HASH_TABLE); Py_VISIT(traverse_module_state->__pyx_n_s_USE_INODES); Py_VISIT(traverse_module_state->__pyx_kp_s_Unable_to_convert_item_to_object); Py_VISIT(traverse_module_state->__pyx_kp_s_Unsupported_PetscScalar_type); Py_VISIT(traverse_module_state->__pyx_n_s_V); Py_VISIT(traverse_module_state->__pyx_n_s_VANKA); Py_VISIT(traverse_module_state->__pyx_n_s_VIENNACL); Py_VISIT(traverse_module_state->__pyx_n_s_VINEWTONRSLS); Py_VISIT(traverse_module_state->__pyx_n_s_VINEWTONSSLS); Py_VISIT(traverse_module_state->__pyx_n_s_VPBJACOBI); Py_VISIT(traverse_module_state->__pyx_n_s_VTK); Py_VISIT(traverse_module_state->__pyx_n_s_VTK_VTR); Py_VISIT(traverse_module_state->__pyx_n_s_VTK_VTS); Py_VISIT(traverse_module_state->__pyx_n_s_VTK_VTU); Py_VISIT(traverse_module_state->__pyx_n_s_VU); Py_VISIT(traverse_module_state->__pyx_n_s_ValueError); Py_VISIT(traverse_module_state->__pyx_n_s_Vec); Py_VISIT(traverse_module_state->__pyx_n_s_VecOption); Py_VISIT(traverse_module_state->__pyx_n_s_VecType); Py_VISIT(traverse_module_state->__pyx_n_s_Vec_LocalForm); Py_VISIT(traverse_module_state->__pyx_n_s_Vec_buffer); Py_VISIT(traverse_module_state->__pyx_kp_s_Vector_assembly_option); Py_VISIT(traverse_module_state->__pyx_kp_s_Vector_local_size_d_is_not_compa); Py_VISIT(traverse_module_state->__pyx_n_s_View_MemoryView); Py_VISIT(traverse_module_state->__pyx_n_s_Viewer); Py_VISIT(traverse_module_state->__pyx_n_s_ViewerDrawSize); Py_VISIT(traverse_module_state->__pyx_n_s_ViewerFileMode); Py_VISIT(traverse_module_state->__pyx_n_s_ViewerFormat); Py_VISIT(traverse_module_state->__pyx_n_s_ViewerHDF5); Py_VISIT(traverse_module_state->__pyx_n_s_ViewerType); Py_VISIT(traverse_module_state->__pyx_kp_s_Viewer_file_mode); Py_VISIT(traverse_module_state->__pyx_kp_s_Viewer_format); Py_VISIT(traverse_module_state->__pyx_kp_s_Viewer_type); Py_VISIT(traverse_module_state->__pyx_n_s_W); Py_VISIT(traverse_module_state->__pyx_n_s_WBM); Py_VISIT(traverse_module_state->__pyx_n_s_WINDOW); Py_VISIT(traverse_module_state->__pyx_n_s_WRITE); Py_VISIT(traverse_module_state->__pyx_n_s_WXY); Py_VISIT(traverse_module_state->__pyx_kp_s_Window_size); Py_VISIT(traverse_module_state->__pyx_n_s_X); Py_VISIT(traverse_module_state->__pyx_n_s_ZERO_INITIAL_GUESS); Py_VISIT(traverse_module_state->__pyx_kp_b__10); Py_VISIT(traverse_module_state->__pyx_kp_s__10); Py_VISIT(traverse_module_state->__pyx_kp_b__11); Py_VISIT(traverse_module_state->__pyx_kp_s__11); Py_VISIT(traverse_module_state->__pyx_kp_b__12); Py_VISIT(traverse_module_state->__pyx_kp_u__13); Py_VISIT(traverse_module_state->__pyx_kp_s__14); Py_VISIT(traverse_module_state->__pyx_kp_u__14); Py_VISIT(traverse_module_state->__pyx_kp_s__16); Py_VISIT(traverse_module_state->__pyx_kp_b__18); Py_VISIT(traverse_module_state->__pyx_kp_s__18); Py_VISIT(traverse_module_state->__pyx_kp_s__2); Py_VISIT(traverse_module_state->__pyx_kp_u__2); Py_VISIT(traverse_module_state->__pyx_n_s__257); Py_VISIT(traverse_module_state->__pyx_kp_s__26); Py_VISIT(traverse_module_state->__pyx_n_s__3); Py_VISIT(traverse_module_state->__pyx_kp_u__6); Py_VISIT(traverse_module_state->__pyx_kp_u__7); Py_VISIT(traverse_module_state->__pyx_kp_b__9); Py_VISIT(traverse_module_state->__pyx_n_s_a); Py_VISIT(traverse_module_state->__pyx_kp_s_a_2); Py_VISIT(traverse_module_state->__pyx_n_s_a_max); Py_VISIT(traverse_module_state->__pyx_n_s_abc); Py_VISIT(traverse_module_state->__pyx_n_s_abort); Py_VISIT(traverse_module_state->__pyx_kp_s_accessing_non_existent_buffer_se); Py_VISIT(traverse_module_state->__pyx_n_s_adaptStep); Py_VISIT(traverse_module_state->__pyx_n_s_addFlops); Py_VISIT(traverse_module_state->__pyx_n_s_addv); Py_VISIT(traverse_module_state->__pyx_n_s_adj); Py_VISIT(traverse_module_state->__pyx_n_s_adjoint_steps); Py_VISIT(traverse_module_state->__pyx_n_s_allocate_buffer); Py_VISIT(traverse_module_state->__pyx_n_s_alpha); Py_VISIT(traverse_module_state->__pyx_n_s_alpha2); Py_VISIT(traverse_module_state->__pyx_n_s_alpha_f); Py_VISIT(traverse_module_state->__pyx_n_s_alpha_m); Py_VISIT(traverse_module_state->__pyx_n_s_alphas); Py_VISIT(traverse_module_state->__pyx_n_s_amount); Py_VISIT(traverse_module_state->__pyx_kp_u_and); Py_VISIT(traverse_module_state->__pyx_n_s_app); Py_VISIT(traverse_module_state->__pyx_n_s_appctx); Py_VISIT(traverse_module_state->__pyx_n_s_append); Py_VISIT(traverse_module_state->__pyx_n_s_apply); Py_VISIT(traverse_module_state->__pyx_n_s_applySymmetricLeft); Py_VISIT(traverse_module_state->__pyx_n_s_applySymmetricRight); Py_VISIT(traverse_module_state->__pyx_n_s_applyTranspose); Py_VISIT(traverse_module_state->__pyx_n_s_args); Py_VISIT(traverse_module_state->__pyx_n_s_array); Py_VISIT(traverse_module_state->__pyx_n_s_array_interface); Py_VISIT(traverse_module_state->__pyx_kp_s_array_size_d_and_vector_local_si); Py_VISIT(traverse_module_state->__pyx_kp_s_array_size_d_incompatible_with_v); Py_VISIT(traverse_module_state->__pyx_n_s_array_w); Py_VISIT(traverse_module_state->__pyx_n_s_asmtype); Py_VISIT(traverse_module_state->__pyx_n_s_assemblies); Py_VISIT(traverse_module_state->__pyx_n_s_assembly); Py_VISIT(traverse_module_state->__pyx_n_s_assemblyBegin); Py_VISIT(traverse_module_state->__pyx_n_s_assemblyEnd); Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); Py_VISIT(traverse_module_state->__pyx_n_s_atexit); Py_VISIT(traverse_module_state->__pyx_n_s_atol); Py_VISIT(traverse_module_state->__pyx_n_s_attr); Py_VISIT(traverse_module_state->__pyx_n_s_au); Py_VISIT(traverse_module_state->__pyx_n_s_author); Py_VISIT(traverse_module_state->__pyx_n_s_authorinfo); Py_VISIT(traverse_module_state->__pyx_n_s_aux); Py_VISIT(traverse_module_state->__pyx_n_s_axpy); Py_VISIT(traverse_module_state->__pyx_n_s_b); Py_VISIT(traverse_module_state->__pyx_n_s_back); Py_VISIT(traverse_module_state->__pyx_n_s_back_down); Py_VISIT(traverse_module_state->__pyx_n_s_back_down_left); Py_VISIT(traverse_module_state->__pyx_n_s_back_down_right); Py_VISIT(traverse_module_state->__pyx_n_s_back_left); Py_VISIT(traverse_module_state->__pyx_n_s_back_right); Py_VISIT(traverse_module_state->__pyx_n_s_back_up); Py_VISIT(traverse_module_state->__pyx_n_s_back_up_left); Py_VISIT(traverse_module_state->__pyx_n_s_back_up_right); Py_VISIT(traverse_module_state->__pyx_n_s_barrier); Py_VISIT(traverse_module_state->__pyx_n_s_base); Py_VISIT(traverse_module_state->__pyx_n_s_batchSize); Py_VISIT(traverse_module_state->__pyx_n_s_bcComps); Py_VISIT(traverse_module_state->__pyx_n_s_bcField); Py_VISIT(traverse_module_state->__pyx_n_s_bcPoints); Py_VISIT(traverse_module_state->__pyx_kp_s_bcPoints_is_a_required_argument); Py_VISIT(traverse_module_state->__pyx_n_s_bdLabel); Py_VISIT(traverse_module_state->__pyx_n_s_bdlabel); Py_VISIT(traverse_module_state->__pyx_n_s_bdvalue); Py_VISIT(traverse_module_state->__pyx_n_s_begin); Py_VISIT(traverse_module_state->__pyx_n_s_begin_args); Py_VISIT(traverse_module_state->__pyx_n_s_begin_kargs); Py_VISIT(traverse_module_state->__pyx_n_s_beta); Py_VISIT(traverse_module_state->__pyx_n_s_bits); Py_VISIT(traverse_module_state->__pyx_n_s_blockSize); Py_VISIT(traverse_module_state->__pyx_n_s_block_size); Py_VISIT(traverse_module_state->__pyx_kp_s_block_size_d_must_be_positive); Py_VISIT(traverse_module_state->__pyx_kp_s_block_size_not_set); Py_VISIT(traverse_module_state->__pyx_n_s_blocksize); Py_VISIT(traverse_module_state->__pyx_n_s_bndr); Py_VISIT(traverse_module_state->__pyx_n_s_bool); Py_VISIT(traverse_module_state->__pyx_n_s_boundary); Py_VISIT(traverse_module_state->__pyx_n_s_boundary_type); Py_VISIT(traverse_module_state->__pyx_n_s_boundary_types); Py_VISIT(traverse_module_state->__pyx_n_s_box); Py_VISIT(traverse_module_state->__pyx_n_s_bs); Py_VISIT(traverse_module_state->__pyx_n_s_bsize); Py_VISIT(traverse_module_state->__pyx_n_s_buffer); Py_VISIT(traverse_module_state->__pyx_n_s_buffer_w); Py_VISIT(traverse_module_state->__pyx_n_s_buildResidual); Py_VISIT(traverse_module_state->__pyx_n_s_buildSolution); Py_VISIT(traverse_module_state->__pyx_n_s_builtins); Py_VISIT(traverse_module_state->__pyx_n_s_c); Py_VISIT(traverse_module_state->__pyx_n_u_c); Py_VISIT(traverse_module_state->__pyx_kp_s_c_d); Py_VISIT(traverse_module_state->__pyx_n_s_cancelMonitor); Py_VISIT(traverse_module_state->__pyx_kp_s_cannot_place_input_array_size_d); Py_VISIT(traverse_module_state->__pyx_n_s_catol); Py_VISIT(traverse_module_state->__pyx_n_s_ccomm); Py_VISIT(traverse_module_state->__pyx_n_s_cdctx); Py_VISIT(traverse_module_state->__pyx_n_s_cdevice_type); Py_VISIT(traverse_module_state->__pyx_n_s_cell); Py_VISIT(traverse_module_state->__pyx_n_s_cellNodeMaps); Py_VISIT(traverse_module_state->__pyx_kp_s_cell_indices_must_have_two_dimen); Py_VISIT(traverse_module_state->__pyx_n_s_cells); Py_VISIT(traverse_module_state->__pyx_n_s_cg_type); Py_VISIT(traverse_module_state->__pyx_n_s_cgid); Py_VISIT(traverse_module_state->__pyx_n_s_citation); Py_VISIT(traverse_module_state->__pyx_n_s_class); Py_VISIT(traverse_module_state->__pyx_n_s_class_getitem); Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); Py_VISIT(traverse_module_state->__pyx_n_s_cmap); Py_VISIT(traverse_module_state->__pyx_n_s_cnorm); Py_VISIT(traverse_module_state->__pyx_n_s_coarsen); Py_VISIT(traverse_module_state->__pyx_n_s_coarsenhook); Py_VISIT(traverse_module_state->__pyx_n_s_code); Py_VISIT(traverse_module_state->__pyx_n_s_col); Py_VISIT(traverse_module_state->__pyx_n_s_col_bsize); Py_VISIT(traverse_module_state->__pyx_n_s_collections); Py_VISIT(traverse_module_state->__pyx_kp_s_collections_abc); Py_VISIT(traverse_module_state->__pyx_n_s_cols); Py_VISIT(traverse_module_state->__pyx_n_s_column); Py_VISIT(traverse_module_state->__pyx_kp_s_column_indices_must_have_two_dim); Py_VISIT(traverse_module_state->__pyx_n_s_comm); Py_VISIT(traverse_module_state->__pyx_n_s_comms); Py_VISIT(traverse_module_state->__pyx_kp_s_communicator_not_owned); Py_VISIT(traverse_module_state->__pyx_n_s_comp); Py_VISIT(traverse_module_state->__pyx_n_s_compile); Py_VISIT(traverse_module_state->__pyx_n_s_compressed); Py_VISIT(traverse_module_state->__pyx_n_s_concatenate); Py_VISIT(traverse_module_state->__pyx_n_s_cone); Py_VISIT(traverse_module_state->__pyx_n_s_coneOrientation); Py_VISIT(traverse_module_state->__pyx_n_s_conePoint); Py_VISIT(traverse_module_state->__pyx_n_s_conePos); Py_VISIT(traverse_module_state->__pyx_n_s_conforming); Py_VISIT(traverse_module_state->__pyx_n_s_conjugate); Py_VISIT(traverse_module_state->__pyx_n_s_constant); Py_VISIT(traverse_module_state->__pyx_n_s_constraints); Py_VISIT(traverse_module_state->__pyx_n_s_context); Py_VISIT(traverse_module_state->__pyx_kp_s_contiguous_and_direct); Py_VISIT(traverse_module_state->__pyx_kp_s_contiguous_and_indirect); Py_VISIT(traverse_module_state->__pyx_n_s_continuous); Py_VISIT(traverse_module_state->__pyx_n_s_converged); Py_VISIT(traverse_module_state->__pyx_n_s_coordinates); Py_VISIT(traverse_module_state->__pyx_kp_s_coordinates_must_have_two_dimens); Py_VISIT(traverse_module_state->__pyx_kp_s_coordinates_size_must_be_at_leas); Py_VISIT(traverse_module_state->__pyx_n_s_coords); Py_VISIT(traverse_module_state->__pyx_kp_s_coords_vertices_must_have_two_di); Py_VISIT(traverse_module_state->__pyx_n_s_copy); Py_VISIT(traverse_module_state->__pyx_n_s_correction_type); Py_VISIT(traverse_module_state->__pyx_n_s_count); Py_VISIT(traverse_module_state->__pyx_n_s_cpuarray); Py_VISIT(traverse_module_state->__pyx_n_s_crank); Py_VISIT(traverse_module_state->__pyx_n_s_cratio); Py_VISIT(traverse_module_state->__pyx_n_s_create); Py_VISIT(traverse_module_state->__pyx_n_s_createDefaultSF); Py_VISIT(traverse_module_state->__pyx_n_s_createGlobalVec); Py_VISIT(traverse_module_state->__pyx_n_s_createGlobalVector); Py_VISIT(traverse_module_state->__pyx_n_s_createLabel); Py_VISIT(traverse_module_state->__pyx_n_s_createLocalVec); Py_VISIT(traverse_module_state->__pyx_n_s_createLocalVector); Py_VISIT(traverse_module_state->__pyx_n_s_createMat); Py_VISIT(traverse_module_state->__pyx_n_s_createMatrix); Py_VISIT(traverse_module_state->__pyx_n_s_createNaturalVec); Py_VISIT(traverse_module_state->__pyx_n_s_createNaturalVector); Py_VISIT(traverse_module_state->__pyx_n_s_createSectionSF); Py_VISIT(traverse_module_state->__pyx_n_s_createSubMatrix); Py_VISIT(traverse_module_state->__pyx_n_s_createVecLeft); Py_VISIT(traverse_module_state->__pyx_n_s_createVecRight); Py_VISIT(traverse_module_state->__pyx_n_s_createVecs); Py_VISIT(traverse_module_state->__pyx_n_s_create_gvec); Py_VISIT(traverse_module_state->__pyx_n_s_create_injection); Py_VISIT(traverse_module_state->__pyx_n_s_create_interpolation); Py_VISIT(traverse_module_state->__pyx_n_s_create_lvec); Py_VISIT(traverse_module_state->__pyx_n_s_create_matrix); Py_VISIT(traverse_module_state->__pyx_n_s_create_restriction); Py_VISIT(traverse_module_state->__pyx_n_s_create_subdm); Py_VISIT(traverse_module_state->__pyx_n_s_crtol); Py_VISIT(traverse_module_state->__pyx_n_s_csize); Py_VISIT(traverse_module_state->__pyx_n_s_csr); Py_VISIT(traverse_module_state->__pyx_n_s_ctype); Py_VISIT(traverse_module_state->__pyx_n_s_cudahandle); Py_VISIT(traverse_module_state->__pyx_n_s_cycle_type); Py_VISIT(traverse_module_state->__pyx_kp_s_d_s); Py_VISIT(traverse_module_state->__pyx_n_s_da); Py_VISIT(traverse_module_state->__pyx_n_s_data); Py_VISIT(traverse_module_state->__pyx_n_s_date); Py_VISIT(traverse_module_state->__pyx_n_s_dctx); Py_VISIT(traverse_module_state->__pyx_n_s_debugger); Py_VISIT(traverse_module_state->__pyx_n_s_decode); Py_VISIT(traverse_module_state->__pyx_n_s_decomp); Py_VISIT(traverse_module_state->__pyx_n_s_decorator); Py_VISIT(traverse_module_state->__pyx_n_s_default); Py_VISIT(traverse_module_state->__pyx_n_s_degree); Py_VISIT(traverse_module_state->__pyx_n_s_delValue); Py_VISIT(traverse_module_state->__pyx_n_s_dense); Py_VISIT(traverse_module_state->__pyx_n_s_design); Py_VISIT(traverse_module_state->__pyx_n_s_destroy); Py_VISIT(traverse_module_state->__pyx_n_s_determinant); Py_VISIT(traverse_module_state->__pyx_n_s_devel); Py_VISIT(traverse_module_state->__pyx_n_s_device); Py_VISIT(traverse_module_state->__pyx_n_s_device_id); Py_VISIT(traverse_module_state->__pyx_n_s_device_type); Py_VISIT(traverse_module_state->__pyx_n_s_diag); Py_VISIT(traverse_module_state->__pyx_n_s_diagonalScale); Py_VISIT(traverse_module_state->__pyx_n_s_diagonal_fill); Py_VISIT(traverse_module_state->__pyx_n_s_dict); Py_VISIT(traverse_module_state->__pyx_n_s_dim); Py_VISIT(traverse_module_state->__pyx_n_s_dims); Py_VISIT(traverse_module_state->__pyx_n_s_direction); Py_VISIT(traverse_module_state->__pyx_kp_u_disable); Py_VISIT(traverse_module_state->__pyx_n_s_disc); Py_VISIT(traverse_module_state->__pyx_n_s_display); Py_VISIT(traverse_module_state->__pyx_n_s_dist); Py_VISIT(traverse_module_state->__pyx_n_s_div); Py_VISIT(traverse_module_state->__pyx_n_s_divtol); Py_VISIT(traverse_module_state->__pyx_n_s_dlpack); Py_VISIT(traverse_module_state->__pyx_n_s_dltensor); Py_VISIT(traverse_module_state->__pyx_n_s_dm); Py_VISIT(traverse_module_state->__pyx_n_s_dmTo); Py_VISIT(traverse_module_state->__pyx_n_s_dm_type); Py_VISIT(traverse_module_state->__pyx_n_s_dmf); Py_VISIT(traverse_module_state->__pyx_n_s_dms); Py_VISIT(traverse_module_state->__pyx_n_s_dmswarm_type); Py_VISIT(traverse_module_state->__pyx_n_s_dmtype); Py_VISIT(traverse_module_state->__pyx_n_s_doc); Py_VISIT(traverse_module_state->__pyx_n_s_dof); Py_VISIT(traverse_module_state->__pyx_n_s_dofs); Py_VISIT(traverse_module_state->__pyx_n_s_dosort); Py_VISIT(traverse_module_state->__pyx_n_s_dot); Py_VISIT(traverse_module_state->__pyx_n_s_down); Py_VISIT(traverse_module_state->__pyx_n_s_down_left); Py_VISIT(traverse_module_state->__pyx_n_s_down_right); Py_VISIT(traverse_module_state->__pyx_n_s_drop); Py_VISIT(traverse_module_state->__pyx_n_s_ds_type); Py_VISIT(traverse_module_state->__pyx_n_s_dspace); Py_VISIT(traverse_module_state->__pyx_n_s_dt); Py_VISIT(traverse_module_state->__pyx_n_s_dtcol); Py_VISIT(traverse_module_state->__pyx_n_s_dtcount); Py_VISIT(traverse_module_state->__pyx_n_s_dtype); Py_VISIT(traverse_module_state->__pyx_n_s_dtype_is_object); Py_VISIT(traverse_module_state->__pyx_n_s_dualspace_type); Py_VISIT(traverse_module_state->__pyx_n_s_duplicate); Py_VISIT(traverse_module_state->__pyx_n_s_e); Py_VISIT(traverse_module_state->__pyx_n_s_elem_type); Py_VISIT(traverse_module_state->__pyx_n_s_element); Py_VISIT(traverse_module_state->__pyx_n_s_emacs); Py_VISIT(traverse_module_state->__pyx_kp_s_empty_citation); Py_VISIT(traverse_module_state->__pyx_kp_s_empty_name); Py_VISIT(traverse_module_state->__pyx_kp_u_enable); Py_VISIT(traverse_module_state->__pyx_n_s_encode); Py_VISIT(traverse_module_state->__pyx_n_s_end); Py_VISIT(traverse_module_state->__pyx_n_s_end_args); Py_VISIT(traverse_module_state->__pyx_n_s_end_kargs); Py_VISIT(traverse_module_state->__pyx_n_s_enter); Py_VISIT(traverse_module_state->__pyx_n_s_entityDepth); Py_VISIT(traverse_module_state->__pyx_n_s_entry); Py_VISIT(traverse_module_state->__pyx_n_s_enum2str); Py_VISIT(traverse_module_state->__pyx_n_s_enumerate); Py_VISIT(traverse_module_state->__pyx_n_s_epsilon); Py_VISIT(traverse_module_state->__pyx_n_s_eqtype); Py_VISIT(traverse_module_state->__pyx_n_s_equality_constraints); Py_VISIT(traverse_module_state->__pyx_n_s_errhandler); Py_VISIT(traverse_module_state->__pyx_n_s_error); Py_VISIT(traverse_module_state->__pyx_kp_s_error_code_d); Py_VISIT(traverse_module_state->__pyx_n_s_eta); Py_VISIT(traverse_module_state->__pyx_n_s_evaluatestep); Py_VISIT(traverse_module_state->__pyx_n_s_eventhandler); Py_VISIT(traverse_module_state->__pyx_n_s_exec); Py_VISIT(traverse_module_state->__pyx_n_s_exit); Py_VISIT(traverse_module_state->__pyx_n_s_exoid); Py_VISIT(traverse_module_state->__pyx_kp_s_expecting_a_C_contiguous_array); Py_VISIT(traverse_module_state->__pyx_kp_s_expecting_tuple_list_or_dict); Py_VISIT(traverse_module_state->__pyx_n_s_f); Py_VISIT(traverse_module_state->__pyx_n_s_faces); Py_VISIT(traverse_module_state->__pyx_n_s_fact); Py_VISIT(traverse_module_state->__pyx_n_s_factor_mallocs); Py_VISIT(traverse_module_state->__pyx_n_s_fe_type); Py_VISIT(traverse_module_state->__pyx_n_s_fget); Py_VISIT(traverse_module_state->__pyx_n_s_field); Py_VISIT(traverse_module_state->__pyx_n_s_fieldName); Py_VISIT(traverse_module_state->__pyx_n_s_fieldname); Py_VISIT(traverse_module_state->__pyx_n_s_fieldnames); Py_VISIT(traverse_module_state->__pyx_n_s_fields); Py_VISIT(traverse_module_state->__pyx_n_s_file); Py_VISIT(traverse_module_state->__pyx_n_s_filename); Py_VISIT(traverse_module_state->__pyx_n_s_fill); Py_VISIT(traverse_module_state->__pyx_n_s_fill_param); Py_VISIT(traverse_module_state->__pyx_n_s_fill_ratio_given); Py_VISIT(traverse_module_state->__pyx_n_s_fill_ratio_needed); Py_VISIT(traverse_module_state->__pyx_n_s_finalize); Py_VISIT(traverse_module_state->__pyx_n_s_first); Py_VISIT(traverse_module_state->__pyx_n_s_fix); Py_VISIT(traverse_module_state->__pyx_n_s_flag); Py_VISIT(traverse_module_state->__pyx_n_s_flags); Py_VISIT(traverse_module_state->__pyx_n_s_flg); Py_VISIT(traverse_module_state->__pyx_n_s_flip); Py_VISIT(traverse_module_state->__pyx_n_s_flops); Py_VISIT(traverse_module_state->__pyx_n_s_flush); Py_VISIT(traverse_module_state->__pyx_n_s_fnorm); Py_VISIT(traverse_module_state->__pyx_n_s_force); Py_VISIT(traverse_module_state->__pyx_n_s_formDegree); Py_VISIT(traverse_module_state->__pyx_n_s_formSNESFunction); Py_VISIT(traverse_module_state->__pyx_n_s_formSNESJacobian); Py_VISIT(traverse_module_state->__pyx_n_s_format); Py_VISIT(traverse_module_state->__pyx_n_s_fortran); Py_VISIT(traverse_module_state->__pyx_n_u_fortran); Py_VISIT(traverse_module_state->__pyx_n_s_forward); Py_VISIT(traverse_module_state->__pyx_n_s_front); Py_VISIT(traverse_module_state->__pyx_n_s_front_down); Py_VISIT(traverse_module_state->__pyx_n_s_front_down_left); Py_VISIT(traverse_module_state->__pyx_n_s_front_down_right); Py_VISIT(traverse_module_state->__pyx_n_s_front_left); Py_VISIT(traverse_module_state->__pyx_n_s_front_right); Py_VISIT(traverse_module_state->__pyx_n_s_front_up); Py_VISIT(traverse_module_state->__pyx_n_s_front_up_left); Py_VISIT(traverse_module_state->__pyx_n_s_front_up_right); Py_VISIT(traverse_module_state->__pyx_n_s_func); Py_VISIT(traverse_module_state->__pyx_n_s_function); Py_VISIT(traverse_module_state->__pyx_n_s_functional); Py_VISIT(traverse_module_state->__pyx_n_s_functools); Py_VISIT(traverse_module_state->__pyx_n_s_g); Py_VISIT(traverse_module_state->__pyx_n_s_gamgtype); Py_VISIT(traverse_module_state->__pyx_n_s_gamma); Py_VISIT(traverse_module_state->__pyx_n_s_garbage_cleanup); Py_VISIT(traverse_module_state->__pyx_n_s_garbage_view); Py_VISIT(traverse_module_state->__pyx_n_s_gasmtype); Py_VISIT(traverse_module_state->__pyx_n_s_gatol); Py_VISIT(traverse_module_state->__pyx_kp_u_gc); Py_VISIT(traverse_module_state->__pyx_n_s_get); Py_VISIT(traverse_module_state->__pyx_kp_s_get1dCoordinatecArrays_for_DMSta); Py_VISIT(traverse_module_state->__pyx_n_s_getActive); Py_VISIT(traverse_module_state->__pyx_n_s_getActiveAll); Py_VISIT(traverse_module_state->__pyx_n_s_getAppCtx); Py_VISIT(traverse_module_state->__pyx_n_s_getApplicationContext); Py_VISIT(traverse_module_state->__pyx_n_s_getArray); Py_VISIT(traverse_module_state->__pyx_n_s_getBlockIndices); Py_VISIT(traverse_module_state->__pyx_n_s_getBlockInfo); Py_VISIT(traverse_module_state->__pyx_n_s_getBlockSize); Py_VISIT(traverse_module_state->__pyx_n_s_getBlockSizes); Py_VISIT(traverse_module_state->__pyx_n_s_getBoundaryType); Py_VISIT(traverse_module_state->__pyx_n_s_getBoundaryTypes); Py_VISIT(traverse_module_state->__pyx_n_s_getBuffer); Py_VISIT(traverse_module_state->__pyx_n_s_getCPUTime); Py_VISIT(traverse_module_state->__pyx_n_s_getClassId); Py_VISIT(traverse_module_state->__pyx_n_s_getClassName); Py_VISIT(traverse_module_state->__pyx_n_s_getComm); Py_VISIT(traverse_module_state->__pyx_n_s_getConstraintTolerances); Py_VISIT(traverse_module_state->__pyx_n_s_getConvergedReason); Py_VISIT(traverse_module_state->__pyx_n_s_getConvergenceHistory); Py_VISIT(traverse_module_state->__pyx_n_s_getCorners); Py_VISIT(traverse_module_state->__pyx_n_s_getCurrent); Py_VISIT(traverse_module_state->__pyx_n_s_getDM); Py_VISIT(traverse_module_state->__pyx_n_s_getDS); Py_VISIT(traverse_module_state->__pyx_n_s_getDefaultComm); Py_VISIT(traverse_module_state->__pyx_n_s_getDefaultGlobalSection); Py_VISIT(traverse_module_state->__pyx_n_s_getDefaultLocalSection); Py_VISIT(traverse_module_state->__pyx_n_s_getDefaultSF); Py_VISIT(traverse_module_state->__pyx_n_s_getDefaultSection); Py_VISIT(traverse_module_state->__pyx_n_s_getDevice); Py_VISIT(traverse_module_state->__pyx_n_s_getDeviceId); Py_VISIT(traverse_module_state->__pyx_n_s_getDeviceType); Py_VISIT(traverse_module_state->__pyx_n_s_getDiagonal); Py_VISIT(traverse_module_state->__pyx_n_s_getDiagonalBlock); Py_VISIT(traverse_module_state->__pyx_n_s_getDim); Py_VISIT(traverse_module_state->__pyx_n_s_getDimension); Py_VISIT(traverse_module_state->__pyx_n_s_getDof); Py_VISIT(traverse_module_state->__pyx_n_s_getEntriesPerElement); Py_VISIT(traverse_module_state->__pyx_n_s_getEquationType); Py_VISIT(traverse_module_state->__pyx_n_s_getFlops); Py_VISIT(traverse_module_state->__pyx_n_s_getFunctionNorm); Py_VISIT(traverse_module_state->__pyx_n_s_getFunctionTolerances); Py_VISIT(traverse_module_state->__pyx_n_s_getFunctionValue); Py_VISIT(traverse_module_state->__pyx_n_s_getGhostCorners); Py_VISIT(traverse_module_state->__pyx_n_s_getGhostRanges); Py_VISIT(traverse_module_state->__pyx_n_s_getGlobalSection); Py_VISIT(traverse_module_state->__pyx_n_s_getGlobalSizes); Py_VISIT(traverse_module_state->__pyx_n_s_getGradient); Py_VISIT(traverse_module_state->__pyx_n_s_getGradientTolerances); Py_VISIT(traverse_module_state->__pyx_n_s_getIndices); Py_VISIT(traverse_module_state->__pyx_n_s_getInfo); Py_VISIT(traverse_module_state->__pyx_n_s_getInitialGuessKnoll); Py_VISIT(traverse_module_state->__pyx_n_s_getInitialGuessNonzero); Py_VISIT(traverse_module_state->__pyx_n_s_getInterval); Py_VISIT(traverse_module_state->__pyx_n_s_getIterationNumber); Py_VISIT(traverse_module_state->__pyx_n_s_getKSP); Py_VISIT(traverse_module_state->__pyx_n_s_getKSPFailures); Py_VISIT(traverse_module_state->__pyx_n_s_getLinearSolveFailures); Py_VISIT(traverse_module_state->__pyx_n_s_getLocalSection); Py_VISIT(traverse_module_state->__pyx_n_s_getLocalSize); Py_VISIT(traverse_module_state->__pyx_n_s_getLocalSizes); Py_VISIT(traverse_module_state->__pyx_n_s_getMatrix); Py_VISIT(traverse_module_state->__pyx_n_s_getMaxFunctionEvaluations); Py_VISIT(traverse_module_state->__pyx_n_s_getMaxKSPFailures); Py_VISIT(traverse_module_state->__pyx_n_s_getMaxLinearSolveFailures); Py_VISIT(traverse_module_state->__pyx_n_s_getMaxNonlinearStepFailures); Py_VISIT(traverse_module_state->__pyx_n_s_getMaxStepFailures); Py_VISIT(traverse_module_state->__pyx_n_s_getMaxSteps); Py_VISIT(traverse_module_state->__pyx_n_s_getMaxTime); Py_VISIT(traverse_module_state->__pyx_n_s_getNPC); Py_VISIT(traverse_module_state->__pyx_n_s_getName); Py_VISIT(traverse_module_state->__pyx_n_s_getNonlinearStepFailures); Py_VISIT(traverse_module_state->__pyx_n_s_getNormType); Py_VISIT(traverse_module_state->__pyx_n_s_getNumber); Py_VISIT(traverse_module_state->__pyx_n_s_getNumberDM); Py_VISIT(traverse_module_state->__pyx_n_s_getObjectiveValue); Py_VISIT(traverse_module_state->__pyx_n_s_getOperators); Py_VISIT(traverse_module_state->__pyx_n_s_getOptionsPrefix); Py_VISIT(traverse_module_state->__pyx_n_s_getOwnershipRange); Py_VISIT(traverse_module_state->__pyx_n_s_getOwnershipRanges); Py_VISIT(traverse_module_state->__pyx_n_s_getPC); Py_VISIT(traverse_module_state->__pyx_n_s_getPCSide); Py_VISIT(traverse_module_state->__pyx_n_s_getProblemType); Py_VISIT(traverse_module_state->__pyx_n_s_getProcSizes); Py_VISIT(traverse_module_state->__pyx_n_s_getRanges); Py_VISIT(traverse_module_state->__pyx_n_s_getRank); Py_VISIT(traverse_module_state->__pyx_n_s_getRefCount); Py_VISIT(traverse_module_state->__pyx_n_s_getResidualNorm); Py_VISIT(traverse_module_state->__pyx_n_s_getRhs); Py_VISIT(traverse_module_state->__pyx_n_s_getSNES); Py_VISIT(traverse_module_state->__pyx_n_s_getSection); Py_VISIT(traverse_module_state->__pyx_n_s_getSectionSF); Py_VISIT(traverse_module_state->__pyx_n_s_getSeed); Py_VISIT(traverse_module_state->__pyx_n_s_getSize); Py_VISIT(traverse_module_state->__pyx_n_s_getSizes); Py_VISIT(traverse_module_state->__pyx_n_s_getSolution); Py_VISIT(traverse_module_state->__pyx_n_s_getSolutionNorm); Py_VISIT(traverse_module_state->__pyx_n_s_getSolutionUpdate); Py_VISIT(traverse_module_state->__pyx_n_s_getStencil); Py_VISIT(traverse_module_state->__pyx_n_s_getStencilType); Py_VISIT(traverse_module_state->__pyx_n_s_getStencilWidth); Py_VISIT(traverse_module_state->__pyx_n_s_getStepFailures); Py_VISIT(traverse_module_state->__pyx_n_s_getStepNumber); Py_VISIT(traverse_module_state->__pyx_n_s_getStreamType); Py_VISIT(traverse_module_state->__pyx_n_s_getString); Py_VISIT(traverse_module_state->__pyx_n_s_getTime); Py_VISIT(traverse_module_state->__pyx_n_s_getTimeStep); Py_VISIT(traverse_module_state->__pyx_n_s_getTolerances); Py_VISIT(traverse_module_state->__pyx_n_s_getType); Py_VISIT(traverse_module_state->__pyx_n_s_getUseEW); Py_VISIT(traverse_module_state->__pyx_n_s_getUseFD); Py_VISIT(traverse_module_state->__pyx_n_s_getUseMF); Py_VISIT(traverse_module_state->__pyx_n_s_getValue); Py_VISIT(traverse_module_state->__pyx_kp_s_getVecArray_for_DMStag_not_yet_i); Py_VISIT(traverse_module_state->__pyx_n_s_getVecLeft); Py_VISIT(traverse_module_state->__pyx_n_s_getVecRight); Py_VISIT(traverse_module_state->__pyx_n_s_getVecs); Py_VISIT(traverse_module_state->__pyx_n_s_getVersion); Py_VISIT(traverse_module_state->__pyx_n_s_getVersionInfo); Py_VISIT(traverse_module_state->__pyx_n_s_getVisible); Py_VISIT(traverse_module_state->__pyx_n_s_get_2); Py_VISIT(traverse_module_state->__pyx_n_s_getstate); Py_VISIT(traverse_module_state->__pyx_n_s_ghostBcNodes); Py_VISIT(traverse_module_state->__pyx_n_s_ghosted); Py_VISIT(traverse_module_state->__pyx_n_s_ghosts); Py_VISIT(traverse_module_state->__pyx_kp_s_ghosts_size_d_array_size_d_and_v); Py_VISIT(traverse_module_state->__pyx_n_s_globalBcNodes); Py_VISIT(traverse_module_state->__pyx_kp_s_global_size_d_not_divisible_by_b); Py_VISIT(traverse_module_state->__pyx_n_s_globalsec); Py_VISIT(traverse_module_state->__pyx_n_s_gord); Py_VISIT(traverse_module_state->__pyx_kp_u_got); Py_VISIT(traverse_module_state->__pyx_kp_u_got_differing_extents_in_dimensi); Py_VISIT(traverse_module_state->__pyx_n_s_gradient); Py_VISIT(traverse_module_state->__pyx_n_s_group); Py_VISIT(traverse_module_state->__pyx_n_s_grtol); Py_VISIT(traverse_module_state->__pyx_n_s_gsec); Py_VISIT(traverse_module_state->__pyx_n_s_gtol); Py_VISIT(traverse_module_state->__pyx_n_s_gttol); Py_VISIT(traverse_module_state->__pyx_n_s_gv); Py_VISIT(traverse_module_state->__pyx_n_s_gvec); Py_VISIT(traverse_module_state->__pyx_n_s_h_max); Py_VISIT(traverse_module_state->__pyx_n_s_h_min); Py_VISIT(traverse_module_state->__pyx_n_s_handle); Py_VISIT(traverse_module_state->__pyx_n_s_has); Py_VISIT(traverse_module_state->__pyx_n_s_hasExternalPackage); Py_VISIT(traverse_module_state->__pyx_n_s_hasLabel); Py_VISIT(traverse_module_state->__pyx_n_s_hasLagrange); Py_VISIT(traverse_module_state->__pyx_n_s_hasName); Py_VISIT(traverse_module_state->__pyx_n_s_hausd); Py_VISIT(traverse_module_state->__pyx_n_s_hessian); Py_VISIT(traverse_module_state->__pyx_n_s_hiphandle); Py_VISIT(traverse_module_state->__pyx_n_s_hmax); Py_VISIT(traverse_module_state->__pyx_n_s_hmin); Py_VISIT(traverse_module_state->__pyx_n_s_hpddm_type); Py_VISIT(traverse_module_state->__pyx_n_s_hypretype); Py_VISIT(traverse_module_state->__pyx_n_s_i); Py_VISIT(traverse_module_state->__pyx_n_s_icntl); Py_VISIT(traverse_module_state->__pyx_n_s_id); Py_VISIT(traverse_module_state->__pyx_n_s_idx); Py_VISIT(traverse_module_state->__pyx_n_s_idxm); Py_VISIT(traverse_module_state->__pyx_n_s_ierr); Py_VISIT(traverse_module_state->__pyx_n_s_ignore); Py_VISIT(traverse_module_state->__pyx_n_s_ignoreOutsideDomain); Py_VISIT(traverse_module_state->__pyx_n_s_imag); Py_VISIT(traverse_module_state->__pyx_n_s_imagPart); Py_VISIT(traverse_module_state->__pyx_n_s_imex); Py_VISIT(traverse_module_state->__pyx_n_s_imode); Py_VISIT(traverse_module_state->__pyx_n_s_import); Py_VISIT(traverse_module_state->__pyx_n_s_inblocks); Py_VISIT(traverse_module_state->__pyx_kp_s_incompatible_array_sizes); Py_VISIT(traverse_module_state->__pyx_kp_s_incompatible_array_sizes_ni_d_nj); Py_VISIT(traverse_module_state->__pyx_kp_s_incompatible_array_sizes_ni_d_nv); Py_VISIT(traverse_module_state->__pyx_kp_s_incompatible_array_sizes_ni_d_nv_2); Py_VISIT(traverse_module_state->__pyx_kp_s_incompatible_array_sizes_nv_d); Py_VISIT(traverse_module_state->__pyx_n_s_index); Py_VISIT(traverse_module_state->__pyx_n_s_indicator); Py_VISIT(traverse_module_state->__pyx_n_s_indices); Py_VISIT(traverse_module_state->__pyx_n_s_info); Py_VISIT(traverse_module_state->__pyx_n_s_infoAllow); Py_VISIT(traverse_module_state->__pyx_n_s_init); Py_VISIT(traverse_module_state->__pyx_n_s_init_subclass); Py_VISIT(traverse_module_state->__pyx_n_s_initialguess); Py_VISIT(traverse_module_state->__pyx_n_s_initialize); Py_VISIT(traverse_module_state->__pyx_n_s_initializing); Py_VISIT(traverse_module_state->__pyx_kp_s_input_arrays_have_incompatible_s); Py_VISIT(traverse_module_state->__pyx_n_s_int); Py_VISIT(traverse_module_state->__pyx_n_s_interior); Py_VISIT(traverse_module_state->__pyx_n_s_interp_type); Py_VISIT(traverse_module_state->__pyx_n_s_interpolate); Py_VISIT(traverse_module_state->__pyx_n_s_interval); Py_VISIT(traverse_module_state->__pyx_n_s_invert); Py_VISIT(traverse_module_state->__pyx_n_s_is); Py_VISIT(traverse_module_state->__pyx_n_s_isActive); Py_VISIT(traverse_module_state->__pyx_n_s_isAssembled); Py_VISIT(traverse_module_state->__pyx_n_s_isFinalized); Py_VISIT(traverse_module_state->__pyx_n_s_isHermitian); Py_VISIT(traverse_module_state->__pyx_n_s_isIdentity); Py_VISIT(traverse_module_state->__pyx_n_s_isInitialized); Py_VISIT(traverse_module_state->__pyx_n_s_isPermutation); Py_VISIT(traverse_module_state->__pyx_n_s_isSimplex); Py_VISIT(traverse_module_state->__pyx_n_s_isSorted); Py_VISIT(traverse_module_state->__pyx_n_s_isStructurallySymmetric); Py_VISIT(traverse_module_state->__pyx_n_s_isSymmetric); Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); Py_VISIT(traverse_module_state->__pyx_n_s_is_from); Py_VISIT(traverse_module_state->__pyx_n_s_is_local); Py_VISIT(traverse_module_state->__pyx_n_s_is_to); Py_VISIT(traverse_module_state->__pyx_n_s_is_type); Py_VISIT(traverse_module_state->__pyx_n_s_iscol); Py_VISIT(traverse_module_state->__pyx_n_s_iscols); Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled); Py_VISIT(traverse_module_state->__pyx_n_s_iset); Py_VISIT(traverse_module_state->__pyx_n_s_isets); Py_VISIT(traverse_module_state->__pyx_n_s_isfields); Py_VISIT(traverse_module_state->__pyx_n_s_isotropic); Py_VISIT(traverse_module_state->__pyx_n_s_isperm); Py_VISIT(traverse_module_state->__pyx_n_s_isrow); Py_VISIT(traverse_module_state->__pyx_n_s_isrows); Py_VISIT(traverse_module_state->__pyx_n_s_itemsize); Py_VISIT(traverse_module_state->__pyx_kp_s_itemsize_0_for_cython_array); Py_VISIT(traverse_module_state->__pyx_n_s_its); Py_VISIT(traverse_module_state->__pyx_n_s_ival); Py_VISIT(traverse_module_state->__pyx_n_s_j); Py_VISIT(traverse_module_state->__pyx_n_s_jacobian); Py_VISIT(traverse_module_state->__pyx_n_s_jacobian_design); Py_VISIT(traverse_module_state->__pyx_n_s_jacobian_equality); Py_VISIT(traverse_module_state->__pyx_n_s_jacobian_state); Py_VISIT(traverse_module_state->__pyx_n_s_jacobianp); Py_VISIT(traverse_module_state->__pyx_n_s_join); Py_VISIT(traverse_module_state->__pyx_n_s_join_mode); Py_VISIT(traverse_module_state->__pyx_n_s_k); Py_VISIT(traverse_module_state->__pyx_n_s_kargs); Py_VISIT(traverse_module_state->__pyx_kp_s_key_d_cannot_register_s_already); Py_VISIT(traverse_module_state->__pyx_n_s_keys); Py_VISIT(traverse_module_state->__pyx_n_s_kind); Py_VISIT(traverse_module_state->__pyx_n_s_klass); Py_VISIT(traverse_module_state->__pyx_n_s_ksp); Py_VISIT(traverse_module_state->__pyx_n_s_ksp_type); Py_VISIT(traverse_module_state->__pyx_n_s_kwargs); Py_VISIT(traverse_module_state->__pyx_n_s_l); Py_VISIT(traverse_module_state->__pyx_n_s_l2l); Py_VISIT(traverse_module_state->__pyx_n_s_label); Py_VISIT(traverse_module_state->__pyx_n_s_labelName); Py_VISIT(traverse_module_state->__pyx_n_s_lambda); Py_VISIT(traverse_module_state->__pyx_n_s_lanes); Py_VISIT(traverse_module_state->__pyx_n_s_layoutType); Py_VISIT(traverse_module_state->__pyx_n_s_lda); Py_VISIT(traverse_module_state->__pyx_n_s_leafSection); Py_VISIT(traverse_module_state->__pyx_n_s_leafdata); Py_VISIT(traverse_module_state->__pyx_n_s_leafsize); Py_VISIT(traverse_module_state->__pyx_n_s_leafupdate); Py_VISIT(traverse_module_state->__pyx_n_s_left); Py_VISIT(traverse_module_state->__pyx_n_s_length); Py_VISIT(traverse_module_state->__pyx_n_s_level); Py_VISIT(traverse_module_state->__pyx_n_s_levels); Py_VISIT(traverse_module_state->__pyx_n_s_lgmap); Py_VISIT(traverse_module_state->__pyx_n_s_lgmap_type); Py_VISIT(traverse_module_state->__pyx_n_s_lgmapc); Py_VISIT(traverse_module_state->__pyx_n_s_lgmapr); Py_VISIT(traverse_module_state->__pyx_n_s_linear_its); Py_VISIT(traverse_module_state->__pyx_n_s_lits); Py_VISIT(traverse_module_state->__pyx_n_s_loc); Py_VISIT(traverse_module_state->__pyx_n_s_locC); Py_VISIT(traverse_module_state->__pyx_n_s_locX); Py_VISIT(traverse_module_state->__pyx_n_s_local); Py_VISIT(traverse_module_state->__pyx_kp_s_local_and_global_sizes_cannot_be); Py_VISIT(traverse_module_state->__pyx_kp_s_local_size_d_not_divisible_by_bl); Py_VISIT(traverse_module_state->__pyx_n_s_localsec); Py_VISIT(traverse_module_state->__pyx_n_s_locs); Py_VISIT(traverse_module_state->__pyx_n_s_logFlops); Py_VISIT(traverse_module_state->__pyx_n_s_lower); Py_VISIT(traverse_module_state->__pyx_n_s_ls_type); Py_VISIT(traverse_module_state->__pyx_n_s_ltog); Py_VISIT(traverse_module_state->__pyx_n_s_ltol); Py_VISIT(traverse_module_state->__pyx_n_s_lv); Py_VISIT(traverse_module_state->__pyx_n_s_lvec); Py_VISIT(traverse_module_state->__pyx_n_s_lvecs); Py_VISIT(traverse_module_state->__pyx_n_s_main); Py_VISIT(traverse_module_state->__pyx_n_s_major); Py_VISIT(traverse_module_state->__pyx_n_s_mallocs); Py_VISIT(traverse_module_state->__pyx_n_s_mat); Py_VISIT(traverse_module_state->__pyx_n_s_matApply); Py_VISIT(traverse_module_state->__pyx_n_s_matMult); Py_VISIT(traverse_module_state->__pyx_n_s_mat_type); Py_VISIT(traverse_module_state->__pyx_n_s_matpartitioning_type); Py_VISIT(traverse_module_state->__pyx_n_s_mats); Py_VISIT(traverse_module_state->__pyx_n_s_max); Py_VISIT(traverse_module_state->__pyx_n_s_maxDegree); Py_VISIT(traverse_module_state->__pyx_n_s_max_fails); Py_VISIT(traverse_module_state->__pyx_n_s_max_funcs); Py_VISIT(traverse_module_state->__pyx_n_s_max_it); Py_VISIT(traverse_module_state->__pyx_n_s_max_steps); Py_VISIT(traverse_module_state->__pyx_n_s_max_time); Py_VISIT(traverse_module_state->__pyx_n_s_maxrank); Py_VISIT(traverse_module_state->__pyx_n_s_maxval); Py_VISIT(traverse_module_state->__pyx_n_s_memo); Py_VISIT(traverse_module_state->__pyx_n_s_memory); Py_VISIT(traverse_module_state->__pyx_n_s_memview); Py_VISIT(traverse_module_state->__pyx_n_s_messageLength); Py_VISIT(traverse_module_state->__pyx_n_s_metaclass); Py_VISIT(traverse_module_state->__pyx_n_s_metric); Py_VISIT(traverse_module_state->__pyx_n_s_metric1); Py_VISIT(traverse_module_state->__pyx_n_s_metric2); Py_VISIT(traverse_module_state->__pyx_n_s_metric3); Py_VISIT(traverse_module_state->__pyx_n_s_metricAvg); Py_VISIT(traverse_module_state->__pyx_n_s_metricInt); Py_VISIT(traverse_module_state->__pyx_n_s_mgtype); Py_VISIT(traverse_module_state->__pyx_n_s_min); Py_VISIT(traverse_module_state->__pyx_n_s_minor); Py_VISIT(traverse_module_state->__pyx_n_s_mirror); Py_VISIT(traverse_module_state->__pyx_n_s_missingDiagonal); Py_VISIT(traverse_module_state->__pyx_n_s_mit); Py_VISIT(traverse_module_state->__pyx_n_s_mode); Py_VISIT(traverse_module_state->__pyx_n_s_model); Py_VISIT(traverse_module_state->__pyx_n_s_module); Py_VISIT(traverse_module_state->__pyx_n_s_monitor); Py_VISIT(traverse_module_state->__pyx_n_s_monitorCancel); Py_VISIT(traverse_module_state->__pyx_n_s_mpi4py); Py_VISIT(traverse_module_state->__pyx_kp_s_mpi4py_MPI); Py_VISIT(traverse_module_state->__pyx_n_s_mpiabort); Py_VISIT(traverse_module_state->__pyx_n_s_mro_entries); Py_VISIT(traverse_module_state->__pyx_n_s_msg); Py_VISIT(traverse_module_state->__pyx_n_s_mult); Py_VISIT(traverse_module_state->__pyx_n_s_multAdd); Py_VISIT(traverse_module_state->__pyx_n_s_multDiagonalBlock); Py_VISIT(traverse_module_state->__pyx_n_s_multHermitian); Py_VISIT(traverse_module_state->__pyx_n_s_multHermitianAdd); Py_VISIT(traverse_module_state->__pyx_n_s_multTranspose); Py_VISIT(traverse_module_state->__pyx_n_s_multTransposeAdd); Py_VISIT(traverse_module_state->__pyx_n_s_multirootdata); Py_VISIT(traverse_module_state->__pyx_n_s_n); Py_VISIT(traverse_module_state->__pyx_n_s_na); Py_VISIT(traverse_module_state->__pyx_n_s_name); Py_VISIT(traverse_module_state->__pyx_n_s_name_2); Py_VISIT(traverse_module_state->__pyx_n_s_name_3); Py_VISIT(traverse_module_state->__pyx_n_s_nbsteps); Py_VISIT(traverse_module_state->__pyx_n_s_nc); Py_VISIT(traverse_module_state->__pyx_n_s_ndim); Py_VISIT(traverse_module_state->__pyx_n_s_new); Py_VISIT(traverse_module_state->__pyx_n_s_newsec); Py_VISIT(traverse_module_state->__pyx_n_s_newvec); Py_VISIT(traverse_module_state->__pyx_n_s_ngs); Py_VISIT(traverse_module_state->__pyx_n_s_nlevels); Py_VISIT(traverse_module_state->__pyx_n_s_nlocal); Py_VISIT(traverse_module_state->__pyx_n_s_nmax); Py_VISIT(traverse_module_state->__pyx_n_s_nmin); Py_VISIT(traverse_module_state->__pyx_n_s_nnz); Py_VISIT(traverse_module_state->__pyx_n_s_noInsert); Py_VISIT(traverse_module_state->__pyx_n_s_noMove); Py_VISIT(traverse_module_state->__pyx_n_s_noSurf); Py_VISIT(traverse_module_state->__pyx_n_s_noSwap); Py_VISIT(traverse_module_state->__pyx_kp_s_no_default___reduce___due_to_non); Py_VISIT(traverse_module_state->__pyx_n_s_none); Py_VISIT(traverse_module_state->__pyx_n_s_nonzero); Py_VISIT(traverse_module_state->__pyx_n_s_norm); Py_VISIT(traverse_module_state->__pyx_n_s_norm_type); Py_VISIT(traverse_module_state->__pyx_n_s_normsched); Py_VISIT(traverse_module_state->__pyx_n_s_normtype); Py_VISIT(traverse_module_state->__pyx_n_s_npoints); Py_VISIT(traverse_module_state->__pyx_n_s_nroots); Py_VISIT(traverse_module_state->__pyx_n_s_nsd); Py_VISIT(traverse_module_state->__pyx_n_s_nsp); Py_VISIT(traverse_module_state->__pyx_n_s_nsubcomm); Py_VISIT(traverse_module_state->__pyx_n_s_null); Py_VISIT(traverse_module_state->__pyx_kp_s_null_communicator); Py_VISIT(traverse_module_state->__pyx_n_s_numBatches); Py_VISIT(traverse_module_state->__pyx_n_s_numBlocks); Py_VISIT(traverse_module_state->__pyx_n_s_numComp); Py_VISIT(traverse_module_state->__pyx_n_s_numDof); Py_VISIT(traverse_module_state->__pyx_n_s_numFields); Py_VISIT(traverse_module_state->__pyx_n_s_numIter); Py_VISIT(traverse_module_state->__pyx_n_s_numMessages); Py_VISIT(traverse_module_state->__pyx_n_s_numProcs); Py_VISIT(traverse_module_state->__pyx_n_s_numReductions); Py_VISIT(traverse_module_state->__pyx_n_s_numSumSpaces); Py_VISIT(traverse_module_state->__pyx_n_s_numTensSpaces); Py_VISIT(traverse_module_state->__pyx_kp_s_number_of_dimensions_d_and_numbe); Py_VISIT(traverse_module_state->__pyx_n_s_nz_allocated); Py_VISIT(traverse_module_state->__pyx_n_s_nz_unneeded); Py_VISIT(traverse_module_state->__pyx_n_s_nz_used); Py_VISIT(traverse_module_state->__pyx_n_s_nzdiag); Py_VISIT(traverse_module_state->__pyx_n_s_obj); Py_VISIT(traverse_module_state->__pyx_n_s_object); Py_VISIT(traverse_module_state->__pyx_n_s_objective); Py_VISIT(traverse_module_state->__pyx_n_s_objgrad); Py_VISIT(traverse_module_state->__pyx_n_s_offset); Py_VISIT(traverse_module_state->__pyx_n_s_omega); Py_VISIT(traverse_module_state->__pyx_n_s_ometric); Py_VISIT(traverse_module_state->__pyx_kp_s_only_and); Py_VISIT(traverse_module_state->__pyx_n_s_onnz); Py_VISIT(traverse_module_state->__pyx_n_s_op); Py_VISIT(traverse_module_state->__pyx_n_s_open); Py_VISIT(traverse_module_state->__pyx_n_s_operator); Py_VISIT(traverse_module_state->__pyx_n_s_operators); Py_VISIT(traverse_module_state->__pyx_n_s_option); Py_VISIT(traverse_module_state->__pyx_kp_s_option_prefix_must_be_string); Py_VISIT(traverse_module_state->__pyx_kp_s_option_prefix_should_not_have_sp); Py_VISIT(traverse_module_state->__pyx_kp_s_option_prefix_should_not_start_w); Py_VISIT(traverse_module_state->__pyx_n_s_options); Py_VISIT(traverse_module_state->__pyx_n_s_opts); Py_VISIT(traverse_module_state->__pyx_n_s_ord_type); Py_VISIT(traverse_module_state->__pyx_n_s_order); Py_VISIT(traverse_module_state->__pyx_n_s_orientation); Py_VISIT(traverse_module_state->__pyx_n_s_other); Py_VISIT(traverse_module_state->__pyx_n_s_otype); Py_VISIT(traverse_module_state->__pyx_n_s_out); Py_VISIT(traverse_module_state->__pyx_n_s_output); Py_VISIT(traverse_module_state->__pyx_n_s_overlap); Py_VISIT(traverse_module_state->__pyx_kp_s_ownership_range_size_d_and_numbe); Py_VISIT(traverse_module_state->__pyx_n_s_ownership_ranges); Py_VISIT(traverse_module_state->__pyx_n_s_ozz); Py_VISIT(traverse_module_state->__pyx_n_s_p); Py_VISIT(traverse_module_state->__pyx_n_s_p1); Py_VISIT(traverse_module_state->__pyx_n_s_pEnd); Py_VISIT(traverse_module_state->__pyx_n_s_pStart); Py_VISIT(traverse_module_state->__pyx_n_s_pack); Py_VISIT(traverse_module_state->__pyx_n_s_package); Py_VISIT(traverse_module_state->__pyx_n_s_package_2); Py_VISIT(traverse_module_state->__pyx_n_s_parallel); Py_VISIT(traverse_module_state->__pyx_n_s_parent); Py_VISIT(traverse_module_state->__pyx_n_s_part); Py_VISIT(traverse_module_state->__pyx_n_s_part_type); Py_VISIT(traverse_module_state->__pyx_n_s_partitioning); Py_VISIT(traverse_module_state->__pyx_n_s_pc); Py_VISIT(traverse_module_state->__pyx_n_s_pc_type); Py_VISIT(traverse_module_state->__pyx_n_s_pd); Py_VISIT(traverse_module_state->__pyx_n_s_periodic); Py_VISIT(traverse_module_state->__pyx_n_s_perm); Py_VISIT(traverse_module_state->__pyx_n_s_permutation); Py_VISIT(traverse_module_state->__pyx_n_s_petsc); Py_VISIT(traverse_module_state->__pyx_n_s_petsc4py_PETSc); Py_VISIT(traverse_module_state->__pyx_kp_s_petsc4py_PETSc_Device_pyx); Py_VISIT(traverse_module_state->__pyx_kp_s_petsc4py_PETSc_Error_pyx); Py_VISIT(traverse_module_state->__pyx_kp_s_petsc4py_PETSc_Log_pyx); Py_VISIT(traverse_module_state->__pyx_kp_s_petsc4py_PETSc_PETSc_pyx); Py_VISIT(traverse_module_state->__pyx_kp_s_petsc4py_PETSc_cyclicgc_pxi); Py_VISIT(traverse_module_state->__pyx_n_s_pi); Py_VISIT(traverse_module_state->__pyx_n_s_pickle); Py_VISIT(traverse_module_state->__pyx_n_s_pj); Py_VISIT(traverse_module_state->__pyx_n_s_plexname); Py_VISIT(traverse_module_state->__pyx_n_s_point); Py_VISIT(traverse_module_state->__pyx_n_s_points); Py_VISIT(traverse_module_state->__pyx_n_s_pop); Py_VISIT(traverse_module_state->__pyx_n_s_popErrorHandler); Py_VISIT(traverse_module_state->__pyx_n_s_popSignalHandler); Py_VISIT(traverse_module_state->__pyx_n_s_pop_python_vfprintf); Py_VISIT(traverse_module_state->__pyx_n_s_position); Py_VISIT(traverse_module_state->__pyx_n_s_positive_definite); Py_VISIT(traverse_module_state->__pyx_n_s_postSolve); Py_VISIT(traverse_module_state->__pyx_n_s_postStep); Py_VISIT(traverse_module_state->__pyx_n_s_postevent); Py_VISIT(traverse_module_state->__pyx_n_s_poststep); Py_VISIT(traverse_module_state->__pyx_n_s_pre); Py_VISIT(traverse_module_state->__pyx_n_s_preSolve); Py_VISIT(traverse_module_state->__pyx_n_s_preStep); Py_VISIT(traverse_module_state->__pyx_n_s_pre_finalize); Py_VISIT(traverse_module_state->__pyx_n_s_precheck); Py_VISIT(traverse_module_state->__pyx_n_s_prefix); Py_VISIT(traverse_module_state->__pyx_kp_s_prefix_s_name_s); Py_VISIT(traverse_module_state->__pyx_n_s_prepare); Py_VISIT(traverse_module_state->__pyx_n_s_prestep); Py_VISIT(traverse_module_state->__pyx_n_s_primv); Py_VISIT(traverse_module_state->__pyx_n_s_proc_sizes); Py_VISIT(traverse_module_state->__pyx_n_s_productNumeric); Py_VISIT(traverse_module_state->__pyx_n_s_productSetFromOptions); Py_VISIT(traverse_module_state->__pyx_n_s_productSymbolic); Py_VISIT(traverse_module_state->__pyx_n_s_property); Py_VISIT(traverse_module_state->__pyx_n_s_ptap); Py_VISIT(traverse_module_state->__pyx_n_s_ptype); Py_VISIT(traverse_module_state->__pyx_n_s_push); Py_VISIT(traverse_module_state->__pyx_n_s_pushErrorHandler); Py_VISIT(traverse_module_state->__pyx_n_s_push_python_vfprintf); Py_VISIT(traverse_module_state->__pyx_n_s_py_sub_ctxs); Py_VISIT(traverse_module_state->__pyx_n_s_py_type); Py_VISIT(traverse_module_state->__pyx_n_s_python); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_PickleError); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_checksum); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_result); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_state); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_type); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_unpickle_Enum); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_vtable); Py_VISIT(traverse_module_state->__pyx_n_s_q0); Py_VISIT(traverse_module_state->__pyx_n_s_q1); Py_VISIT(traverse_module_state->__pyx_n_s_qorder); Py_VISIT(traverse_module_state->__pyx_n_s_quad); Py_VISIT(traverse_module_state->__pyx_n_s_qualname); Py_VISIT(traverse_module_state->__pyx_n_s_r); Py_VISIT(traverse_module_state->__pyx_kp_s_r_2); Py_VISIT(traverse_module_state->__pyx_n_s_radius); Py_VISIT(traverse_module_state->__pyx_n_s_random); Py_VISIT(traverse_module_state->__pyx_n_s_range); Py_VISIT(traverse_module_state->__pyx_n_s_ranges); Py_VISIT(traverse_module_state->__pyx_n_s_rank); Py_VISIT(traverse_module_state->__pyx_n_s_read); Py_VISIT(traverse_module_state->__pyx_n_s_readonly); Py_VISIT(traverse_module_state->__pyx_kp_s_readonly_attribute); Py_VISIT(traverse_module_state->__pyx_n_s_ready); Py_VISIT(traverse_module_state->__pyx_n_s_real); Py_VISIT(traverse_module_state->__pyx_n_s_realPart); Py_VISIT(traverse_module_state->__pyx_n_s_reason); Py_VISIT(traverse_module_state->__pyx_n_s_reciprocal); Py_VISIT(traverse_module_state->__pyx_n_s_red); Py_VISIT(traverse_module_state->__pyx_n_s_reduce); Py_VISIT(traverse_module_state->__pyx_n_s_reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_reduce_ex); Py_VISIT(traverse_module_state->__pyx_n_s_redundant); Py_VISIT(traverse_module_state->__pyx_n_s_redundantPoints); Py_VISIT(traverse_module_state->__pyx_n_s_refine); Py_VISIT(traverse_module_state->__pyx_n_s_refine_x); Py_VISIT(traverse_module_state->__pyx_n_s_refine_y); Py_VISIT(traverse_module_state->__pyx_n_s_refine_z); Py_VISIT(traverse_module_state->__pyx_n_s_refinementLimit); Py_VISIT(traverse_module_state->__pyx_n_s_refinementUniform); Py_VISIT(traverse_module_state->__pyx_n_s_register); Py_VISIT(traverse_module_state->__pyx_n_s_registerCitation); Py_VISIT(traverse_module_state->__pyx_n_s_release); Py_VISIT(traverse_module_state->__pyx_n_s_remote); Py_VISIT(traverse_module_state->__pyx_n_s_remoteOffsets); Py_VISIT(traverse_module_state->__pyx_n_s_remove); Py_VISIT(traverse_module_state->__pyx_n_s_remove_sent_points); Py_VISIT(traverse_module_state->__pyx_n_s_replace); Py_VISIT(traverse_module_state->__pyx_n_s_repr); Py_VISIT(traverse_module_state->__pyx_n_s_res); Py_VISIT(traverse_module_state->__pyx_n_s_reset); Py_VISIT(traverse_module_state->__pyx_n_s_reshape); Py_VISIT(traverse_module_state->__pyx_n_s_residual); Py_VISIT(traverse_module_state->__pyx_n_s_restart); Py_VISIT(traverse_module_state->__pyx_n_s_restrictAnisotropy); Py_VISIT(traverse_module_state->__pyx_n_s_restrictAnisotropyFirst); Py_VISIT(traverse_module_state->__pyx_n_s_restrictSizes); Py_VISIT(traverse_module_state->__pyx_n_s_restricthook); Py_VISIT(traverse_module_state->__pyx_n_s_result); Py_VISIT(traverse_module_state->__pyx_n_s_reuse); Py_VISIT(traverse_module_state->__pyx_n_s_reverse); Py_VISIT(traverse_module_state->__pyx_n_s_rgLabel); Py_VISIT(traverse_module_state->__pyx_n_s_rhs); Py_VISIT(traverse_module_state->__pyx_n_s_rhsjacobianp); Py_VISIT(traverse_module_state->__pyx_n_s_right); Py_VISIT(traverse_module_state->__pyx_n_s_rmap); Py_VISIT(traverse_module_state->__pyx_n_s_rnd_type); Py_VISIT(traverse_module_state->__pyx_n_s_rnorm); Py_VISIT(traverse_module_state->__pyx_n_s_rollback); Py_VISIT(traverse_module_state->__pyx_n_s_rootSection); Py_VISIT(traverse_module_state->__pyx_n_s_rootdata); Py_VISIT(traverse_module_state->__pyx_n_s_row); Py_VISIT(traverse_module_state->__pyx_n_s_row_bsize); Py_VISIT(traverse_module_state->__pyx_kp_s_row_indices_must_have_two_dimens); Py_VISIT(traverse_module_state->__pyx_n_s_rowmap); Py_VISIT(traverse_module_state->__pyx_n_s_rows); Py_VISIT(traverse_module_state->__pyx_n_s_rscale); Py_VISIT(traverse_module_state->__pyx_n_s_rsplit); Py_VISIT(traverse_module_state->__pyx_n_s_rtol); Py_VISIT(traverse_module_state->__pyx_n_s_rtol_0); Py_VISIT(traverse_module_state->__pyx_n_s_rtol_max); Py_VISIT(traverse_module_state->__pyx_n_s_rw); Py_VISIT(traverse_module_state->__pyx_kp_s_s); Py_VISIT(traverse_module_state->__pyx_n_s_s_2); Py_VISIT(traverse_module_state->__pyx_kp_s_s_at_s_d); Py_VISIT(traverse_module_state->__pyx_kp_s_s_s); Py_VISIT(traverse_module_state->__pyx_n_s_scale); Py_VISIT(traverse_module_state->__pyx_n_s_scatter); Py_VISIT(traverse_module_state->__pyx_n_s_scatterBegin); Py_VISIT(traverse_module_state->__pyx_n_s_scatterEnd); Py_VISIT(traverse_module_state->__pyx_n_s_scatter_type); Py_VISIT(traverse_module_state->__pyx_n_s_sec); Py_VISIT(traverse_module_state->__pyx_n_s_seconds); Py_VISIT(traverse_module_state->__pyx_n_s_sectiondm); Py_VISIT(traverse_module_state->__pyx_n_s_seed); Py_VISIT(traverse_module_state->__pyx_n_s_selected); Py_VISIT(traverse_module_state->__pyx_n_s_self); Py_VISIT(traverse_module_state->__pyx_n_s_sep); Py_VISIT(traverse_module_state->__pyx_n_s_setActive); Py_VISIT(traverse_module_state->__pyx_n_s_setActiveAll); Py_VISIT(traverse_module_state->__pyx_n_s_setAppCtx); Py_VISIT(traverse_module_state->__pyx_n_s_setApplicationContext); Py_VISIT(traverse_module_state->__pyx_n_s_setConvergedReason); Py_VISIT(traverse_module_state->__pyx_n_s_setCurrent); Py_VISIT(traverse_module_state->__pyx_n_s_setDM); Py_VISIT(traverse_module_state->__pyx_n_s_setDS); Py_VISIT(traverse_module_state->__pyx_n_s_setDefaultComm); Py_VISIT(traverse_module_state->__pyx_n_s_setDefaultGlobalSection); Py_VISIT(traverse_module_state->__pyx_n_s_setDefaultLocalSection); Py_VISIT(traverse_module_state->__pyx_n_s_setDefaultSF); Py_VISIT(traverse_module_state->__pyx_n_s_setDefaultSection); Py_VISIT(traverse_module_state->__pyx_n_s_setDefaultType); Py_VISIT(traverse_module_state->__pyx_n_s_setDevice); Py_VISIT(traverse_module_state->__pyx_n_s_setDiagonal); Py_VISIT(traverse_module_state->__pyx_n_s_setDimension); Py_VISIT(traverse_module_state->__pyx_n_s_setEquationType); Py_VISIT(traverse_module_state->__pyx_n_s_setFromOptions); Py_VISIT(traverse_module_state->__pyx_n_s_setFunctionNorm); Py_VISIT(traverse_module_state->__pyx_n_s_setFunctionTolerances); Py_VISIT(traverse_module_state->__pyx_n_s_setGlobalSection); Py_VISIT(traverse_module_state->__pyx_n_s_setInitial); Py_VISIT(traverse_module_state->__pyx_n_s_setInitialGuessKnoll); Py_VISIT(traverse_module_state->__pyx_n_s_setInitialGuessNonzero); Py_VISIT(traverse_module_state->__pyx_n_s_setInterval); Py_VISIT(traverse_module_state->__pyx_n_s_setIterationNumber); Py_VISIT(traverse_module_state->__pyx_n_s_setKSP); Py_VISIT(traverse_module_state->__pyx_n_s_setLocalSection); Py_VISIT(traverse_module_state->__pyx_n_s_setMaxFunctionEvaluations); Py_VISIT(traverse_module_state->__pyx_n_s_setMaxKSPFailures); Py_VISIT(traverse_module_state->__pyx_n_s_setMaxLinearSolveFailures); Py_VISIT(traverse_module_state->__pyx_n_s_setMaxNonlinearStepFailures); Py_VISIT(traverse_module_state->__pyx_n_s_setMaxStepFailures); Py_VISIT(traverse_module_state->__pyx_n_s_setMaxSteps); Py_VISIT(traverse_module_state->__pyx_n_s_setMaxTime); Py_VISIT(traverse_module_state->__pyx_n_s_setMonitor); Py_VISIT(traverse_module_state->__pyx_n_s_setNPC); Py_VISIT(traverse_module_state->__pyx_n_s_setName); Py_VISIT(traverse_module_state->__pyx_n_s_setNormType); Py_VISIT(traverse_module_state->__pyx_n_s_setOption); Py_VISIT(traverse_module_state->__pyx_n_s_setOptionsPrefix); Py_VISIT(traverse_module_state->__pyx_n_s_setPCSide); Py_VISIT(traverse_module_state->__pyx_n_s_setParamsEW); Py_VISIT(traverse_module_state->__pyx_n_s_setProblemType); Py_VISIT(traverse_module_state->__pyx_n_s_setResidualNorm); Py_VISIT(traverse_module_state->__pyx_n_s_setSection); Py_VISIT(traverse_module_state->__pyx_n_s_setSectionSF); Py_VISIT(traverse_module_state->__pyx_n_s_setSeed); Py_VISIT(traverse_module_state->__pyx_n_s_setSizes); Py_VISIT(traverse_module_state->__pyx_n_s_setSolution); Py_VISIT(traverse_module_state->__pyx_n_s_setStepNumber); Py_VISIT(traverse_module_state->__pyx_n_s_setStreamType); Py_VISIT(traverse_module_state->__pyx_n_s_setTime); Py_VISIT(traverse_module_state->__pyx_n_s_setTimeStep); Py_VISIT(traverse_module_state->__pyx_n_s_setTolerances); Py_VISIT(traverse_module_state->__pyx_n_s_setType); Py_VISIT(traverse_module_state->__pyx_n_s_setUp); Py_VISIT(traverse_module_state->__pyx_n_s_setUseEW); Py_VISIT(traverse_module_state->__pyx_n_s_setUseFD); Py_VISIT(traverse_module_state->__pyx_n_s_setUseMF); Py_VISIT(traverse_module_state->__pyx_n_s_setValue); Py_VISIT(traverse_module_state->__pyx_n_s_setVisible); Py_VISIT(traverse_module_state->__pyx_n_s_set_name); Py_VISIT(traverse_module_state->__pyx_n_s_setstate); Py_VISIT(traverse_module_state->__pyx_n_s_setstate_cython); Py_VISIT(traverse_module_state->__pyx_n_s_setup); Py_VISIT(traverse_module_state->__pyx_n_s_sf); Py_VISIT(traverse_module_state->__pyx_n_s_sf_type); Py_VISIT(traverse_module_state->__pyx_n_s_sfxc); Py_VISIT(traverse_module_state->__pyx_n_s_shape); Py_VISIT(traverse_module_state->__pyx_n_s_shift); Py_VISIT(traverse_module_state->__pyx_n_s_shift_type); Py_VISIT(traverse_module_state->__pyx_n_s_shiftamount); Py_VISIT(traverse_module_state->__pyx_n_s_shifttype); Py_VISIT(traverse_module_state->__pyx_n_s_side); Py_VISIT(traverse_module_state->__pyx_kp_s_side_r_not_understood); Py_VISIT(traverse_module_state->__pyx_n_s_simplex); Py_VISIT(traverse_module_state->__pyx_n_s_size); Py_VISIT(traverse_module_state->__pyx_kp_s_size_I_is_d_expected_d); Py_VISIT(traverse_module_state->__pyx_kp_s_size_J_is_d_expected_d); Py_VISIT(traverse_module_state->__pyx_kp_s_size_V_is_d_expected_d); Py_VISIT(traverse_module_state->__pyx_kp_s_size_array_is_d_expected_dx_d_d); Py_VISIT(traverse_module_state->__pyx_kp_s_size_d_nnz_is_d_expected_d); Py_VISIT(traverse_module_state->__pyx_kp_s_size_o_nnz_is_d_expected_d); Py_VISIT(traverse_module_state->__pyx_n_s_sizes); Py_VISIT(traverse_module_state->__pyx_kp_s_sizes_array_should_have_d_entrie); Py_VISIT(traverse_module_state->__pyx_n_s_skip); Py_VISIT(traverse_module_state->__pyx_n_s_sleep); Py_VISIT(traverse_module_state->__pyx_n_s_smooths); Py_VISIT(traverse_module_state->__pyx_n_s_snes); Py_VISIT(traverse_module_state->__pyx_n_s_snes_type); Py_VISIT(traverse_module_state->__pyx_n_s_solve); Py_VISIT(traverse_module_state->__pyx_n_s_solveAdd); Py_VISIT(traverse_module_state->__pyx_n_s_solveStep); Py_VISIT(traverse_module_state->__pyx_n_s_solveTranspose); Py_VISIT(traverse_module_state->__pyx_n_s_solveTransposeAdd); Py_VISIT(traverse_module_state->__pyx_n_s_solver); Py_VISIT(traverse_module_state->__pyx_n_s_sortype); Py_VISIT(traverse_module_state->__pyx_n_s_sp); Py_VISIT(traverse_module_state->__pyx_n_s_space_type); Py_VISIT(traverse_module_state->__pyx_n_s_spec); Py_VISIT(traverse_module_state->__pyx_n_s_split); Py_VISIT(traverse_module_state->__pyx_n_s_splitOwnership); Py_VISIT(traverse_module_state->__pyx_n_s_stage); Py_VISIT(traverse_module_state->__pyx_n_s_star); Py_VISIT(traverse_module_state->__pyx_n_s_start); Py_VISIT(traverse_module_state->__pyx_n_s_starts); Py_VISIT(traverse_module_state->__pyx_n_s_startswith); Py_VISIT(traverse_module_state->__pyx_n_s_state); Py_VISIT(traverse_module_state->__pyx_n_s_staticmethod); Py_VISIT(traverse_module_state->__pyx_n_s_staticproperty); Py_VISIT(traverse_module_state->__pyx_n_s_staticproperty___get); Py_VISIT(traverse_module_state->__pyx_n_s_stderr); Py_VISIT(traverse_module_state->__pyx_n_s_stderr_2); Py_VISIT(traverse_module_state->__pyx_n_s_stdout); Py_VISIT(traverse_module_state->__pyx_n_s_stdout_2); Py_VISIT(traverse_module_state->__pyx_n_s_stdout_is_stderr); Py_VISIT(traverse_module_state->__pyx_n_s_stencil_type); Py_VISIT(traverse_module_state->__pyx_n_s_stencil_width); Py_VISIT(traverse_module_state->__pyx_n_s_stenciltype); Py_VISIT(traverse_module_state->__pyx_n_s_step); Py_VISIT(traverse_module_state->__pyx_n_s_stepTranspose); Py_VISIT(traverse_module_state->__pyx_n_s_step_number); Py_VISIT(traverse_module_state->__pyx_n_s_stol); Py_VISIT(traverse_module_state->__pyx_n_s_stop); Py_VISIT(traverse_module_state->__pyx_n_s_str); Py_VISIT(traverse_module_state->__pyx_n_s_strata); Py_VISIT(traverse_module_state->__pyx_n_s_stratum); Py_VISIT(traverse_module_state->__pyx_n_s_stream); Py_VISIT(traverse_module_state->__pyx_n_s_stream_type); Py_VISIT(traverse_module_state->__pyx_kp_s_strided_and_direct); Py_VISIT(traverse_module_state->__pyx_kp_s_strided_and_direct_or_indirect); Py_VISIT(traverse_module_state->__pyx_kp_s_strided_and_indirect); Py_VISIT(traverse_module_state->__pyx_n_s_strides); Py_VISIT(traverse_module_state->__pyx_n_s_string); Py_VISIT(traverse_module_state->__pyx_kp_s_stringsource); Py_VISIT(traverse_module_state->__pyx_n_s_strip); Py_VISIT(traverse_module_state->__pyx_n_s_struct); Py_VISIT(traverse_module_state->__pyx_n_s_structure); Py_VISIT(traverse_module_state->__pyx_n_s_sub); Py_VISIT(traverse_module_state->__pyx_n_s_subcomm); Py_VISIT(traverse_module_state->__pyx_n_s_subdm); Py_VISIT(traverse_module_state->__pyx_n_s_submat); Py_VISIT(traverse_module_state->__pyx_n_s_submats); Py_VISIT(traverse_module_state->__pyx_n_s_subminor); Py_VISIT(traverse_module_state->__pyx_n_s_subsp); Py_VISIT(traverse_module_state->__pyx_n_s_subspaceOffsets); Py_VISIT(traverse_module_state->__pyx_n_s_subvec); Py_VISIT(traverse_module_state->__pyx_n_s_super); Py_VISIT(traverse_module_state->__pyx_n_s_supp); Py_VISIT(traverse_module_state->__pyx_n_s_svalue); Py_VISIT(traverse_module_state->__pyx_n_s_swidth); Py_VISIT(traverse_module_state->__pyx_n_s_sx); Py_VISIT(traverse_module_state->__pyx_n_s_sym); Py_VISIT(traverse_module_state->__pyx_n_s_symmetric); Py_VISIT(traverse_module_state->__pyx_n_s_syncFlush); Py_VISIT(traverse_module_state->__pyx_n_s_syncPrint); Py_VISIT(traverse_module_state->__pyx_n_s_sys); Py_VISIT(traverse_module_state->__pyx_n_s_t); Py_VISIT(traverse_module_state->__pyx_n_s_tab); Py_VISIT(traverse_module_state->__pyx_n_s_tabs); Py_VISIT(traverse_module_state->__pyx_n_s_tao); Py_VISIT(traverse_module_state->__pyx_n_s_tao_type); Py_VISIT(traverse_module_state->__pyx_n_s_targetComplexity); Py_VISIT(traverse_module_state->__pyx_n_s_tbline); Py_VISIT(traverse_module_state->__pyx_n_s_tblist); Py_VISIT(traverse_module_state->__pyx_n_s_tensor); Py_VISIT(traverse_module_state->__pyx_n_s_terminate); Py_VISIT(traverse_module_state->__pyx_n_s_theta); Py_VISIT(traverse_module_state->__pyx_n_s_threshold); Py_VISIT(traverse_module_state->__pyx_n_s_time); Py_VISIT(traverse_module_state->__pyx_n_s_time_step); Py_VISIT(traverse_module_state->__pyx_n_s_timestep); Py_VISIT(traverse_module_state->__pyx_n_s_title); Py_VISIT(traverse_module_state->__pyx_n_s_toAll); Py_VISIT(traverse_module_state->__pyx_n_s_toDLPack); Py_VISIT(traverse_module_state->__pyx_n_s_toZero); Py_VISIT(traverse_module_state->__pyx_n_s_toindx); Py_VISIT(traverse_module_state->__pyx_n_s_tol); Py_VISIT(traverse_module_state->__pyx_n_s_tr_type); Py_VISIT(traverse_module_state->__pyx_n_s_traceback); Py_VISIT(traverse_module_state->__pyx_n_s_traceback_2); Py_VISIT(traverse_module_state->__pyx_n_s_trans); Py_VISIT(traverse_module_state->__pyx_n_s_transpose); Py_VISIT(traverse_module_state->__pyx_n_s_trimmed); Py_VISIT(traverse_module_state->__pyx_n_s_ts_type); Py_VISIT(traverse_module_state->__pyx_n_s_tspan); Py_VISIT(traverse_module_state->__pyx_n_s_twist); Py_VISIT(traverse_module_state->__pyx_n_s_typ); Py_VISIT(traverse_module_state->__pyx_n_s_type_registry); Py_VISIT(traverse_module_state->__pyx_n_s_typestr); Py_VISIT(traverse_module_state->__pyx_n_s_u); Py_VISIT(traverse_module_state->__pyx_n_s_ua); Py_VISIT(traverse_module_state->__pyx_n_s_uaux); Py_VISIT(traverse_module_state->__pyx_n_s_uis); Py_VISIT(traverse_module_state->__pyx_kp_s_unable_to_allocate_array_data); Py_VISIT(traverse_module_state->__pyx_kp_s_unable_to_allocate_shape_and_str); Py_VISIT(traverse_module_state->__pyx_kp_s_unhandled_PetscDeviceContextJoin); Py_VISIT(traverse_module_state->__pyx_kp_s_unhandled_PetscDeviceType_d); Py_VISIT(traverse_module_state->__pyx_kp_s_unhandled_PetscStreamType_d); Py_VISIT(traverse_module_state->__pyx_n_s_uniform); Py_VISIT(traverse_module_state->__pyx_n_s_unit); Py_VISIT(traverse_module_state->__pyx_kp_s_unknown_boundary_type_s); Py_VISIT(traverse_module_state->__pyx_kp_s_unknown_device_type_s); Py_VISIT(traverse_module_state->__pyx_kp_s_unknown_element_type_s); Py_VISIT(traverse_module_state->__pyx_kp_u_unknown_error_handler); Py_VISIT(traverse_module_state->__pyx_kp_s_unknown_interpolation_type_s); Py_VISIT(traverse_module_state->__pyx_kp_s_unknown_join_mode_s); Py_VISIT(traverse_module_state->__pyx_kp_s_unknown_options_s); Py_VISIT(traverse_module_state->__pyx_kp_s_unknown_scatter_mode_s); Py_VISIT(traverse_module_state->__pyx_kp_s_unknown_shift_type_s); Py_VISIT(traverse_module_state->__pyx_kp_s_unknown_stencil_location_type_s); Py_VISIT(traverse_module_state->__pyx_kp_s_unknown_stencil_type_s); Py_VISIT(traverse_module_state->__pyx_kp_s_unknown_stream_type_s); Py_VISIT(traverse_module_state->__pyx_n_s_unnamed); Py_VISIT(traverse_module_state->__pyx_n_s_unpack); Py_VISIT(traverse_module_state->__pyx_n_s_up); Py_VISIT(traverse_module_state->__pyx_n_s_up_left); Py_VISIT(traverse_module_state->__pyx_n_s_up_right); Py_VISIT(traverse_module_state->__pyx_n_s_update); Py_VISIT(traverse_module_state->__pyx_n_s_upper); Py_VISIT(traverse_module_state->__pyx_n_s_useAnchors); Py_VISIT(traverse_module_state->__pyx_n_s_useClosure); Py_VISIT(traverse_module_state->__pyx_n_s_useCone); Py_VISIT(traverse_module_state->__pyx_n_s_useInitialGuess); Py_VISIT(traverse_module_state->__pyx_n_s_v); Py_VISIT(traverse_module_state->__pyx_n_s_val); Py_VISIT(traverse_module_state->__pyx_n_s_value); Py_VISIT(traverse_module_state->__pyx_n_s_values); Py_VISIT(traverse_module_state->__pyx_kp_s_values_must_have_two_or_more_dim); Py_VISIT(traverse_module_state->__pyx_n_s_varbounds); Py_VISIT(traverse_module_state->__pyx_n_s_vec); Py_VISIT(traverse_module_state->__pyx_n_s_vecTo); Py_VISIT(traverse_module_state->__pyx_n_s_vec_from); Py_VISIT(traverse_module_state->__pyx_n_s_vec_to); Py_VISIT(traverse_module_state->__pyx_n_s_vec_type); Py_VISIT(traverse_module_state->__pyx_n_s_vecs); Py_VISIT(traverse_module_state->__pyx_n_s_vectors); Py_VISIT(traverse_module_state->__pyx_n_s_verbosity); Py_VISIT(traverse_module_state->__pyx_n_s_version); Py_VISIT(traverse_module_state->__pyx_n_s_version_info); Py_VISIT(traverse_module_state->__pyx_n_s_vg); Py_VISIT(traverse_module_state->__pyx_n_s_viennaclvechandle); Py_VISIT(traverse_module_state->__pyx_n_s_view); Py_VISIT(traverse_module_state->__pyx_n_s_viewer); Py_VISIT(traverse_module_state->__pyx_n_s_vl); Py_VISIT(traverse_module_state->__pyx_n_s_vlg); Py_VISIT(traverse_module_state->__pyx_n_s_vm); Py_VISIT(traverse_module_state->__pyx_n_s_vn); Py_VISIT(traverse_module_state->__pyx_n_s_vtol); Py_VISIT(traverse_module_state->__pyx_n_s_vwr_type); Py_VISIT(traverse_module_state->__pyx_n_s_w); Py_VISIT(traverse_module_state->__pyx_kp_s_w_2); Py_VISIT(traverse_module_state->__pyx_n_s_weight); Py_VISIT(traverse_module_state->__pyx_n_s_width); Py_VISIT(traverse_module_state->__pyx_n_s_wrapped_func); Py_VISIT(traverse_module_state->__pyx_n_s_wraps); Py_VISIT(traverse_module_state->__pyx_n_s_write); Py_VISIT(traverse_module_state->__pyx_n_s_x); Py_VISIT(traverse_module_state->__pyx_n_s_xdot); Py_VISIT(traverse_module_state->__pyx_n_s_xdotdot); Py_VISIT(traverse_module_state->__pyx_n_s_xl); Py_VISIT(traverse_module_state->__pyx_n_s_xmax); Py_VISIT(traverse_module_state->__pyx_n_s_xmin); Py_VISIT(traverse_module_state->__pyx_n_s_xnorm); Py_VISIT(traverse_module_state->__pyx_n_s_xu); Py_VISIT(traverse_module_state->__pyx_n_s_y); Py_VISIT(traverse_module_state->__pyx_n_s_ymax); Py_VISIT(traverse_module_state->__pyx_n_s_ymin); Py_VISIT(traverse_module_state->__pyx_n_s_ynorm); Py_VISIT(traverse_module_state->__pyx_n_s_zeroEntries); Py_VISIT(traverse_module_state->__pyx_n_s_zeroRowsColumns); Py_VISIT(traverse_module_state->__pyx_n_s_zeropivot); Py_VISIT(traverse_module_state->__pyx_n_s_zmax); Py_VISIT(traverse_module_state->__pyx_n_s_zmin); Py_VISIT(traverse_module_state->__pyx_n_s_zoz); Py_VISIT(traverse_module_state->__pyx_n_s_zzo); Py_VISIT(traverse_module_state->__pyx_float_0_); Py_VISIT(traverse_module_state->__pyx_float_0_0); Py_VISIT(traverse_module_state->__pyx_float_1_0); Py_VISIT(traverse_module_state->__pyx_int_0); Py_VISIT(traverse_module_state->__pyx_int_1); Py_VISIT(traverse_module_state->__pyx_int_2); Py_VISIT(traverse_module_state->__pyx_int_3); Py_VISIT(traverse_module_state->__pyx_int_4); Py_VISIT(traverse_module_state->__pyx_int_5); Py_VISIT(traverse_module_state->__pyx_int_6); Py_VISIT(traverse_module_state->__pyx_int_7); Py_VISIT(traverse_module_state->__pyx_int_8); Py_VISIT(traverse_module_state->__pyx_int_9); Py_VISIT(traverse_module_state->__pyx_int_10); Py_VISIT(traverse_module_state->__pyx_int_13); Py_VISIT(traverse_module_state->__pyx_int_17); Py_VISIT(traverse_module_state->__pyx_int_18); Py_VISIT(traverse_module_state->__pyx_int_19); Py_VISIT(traverse_module_state->__pyx_int_23); Py_VISIT(traverse_module_state->__pyx_int_32); Py_VISIT(traverse_module_state->__pyx_int_34); Py_VISIT(traverse_module_state->__pyx_int_43); Py_VISIT(traverse_module_state->__pyx_int_45); Py_VISIT(traverse_module_state->__pyx_int_46); Py_VISIT(traverse_module_state->__pyx_int_47); Py_VISIT(traverse_module_state->__pyx_int_48); Py_VISIT(traverse_module_state->__pyx_int_59); Py_VISIT(traverse_module_state->__pyx_int_88); Py_VISIT(traverse_module_state->__pyx_int_102); Py_VISIT(traverse_module_state->__pyx_int_105); Py_VISIT(traverse_module_state->__pyx_int_106); Py_VISIT(traverse_module_state->__pyx_int_113); Py_VISIT(traverse_module_state->__pyx_int_119); Py_VISIT(traverse_module_state->__pyx_int_121); Py_VISIT(traverse_module_state->__pyx_int_122); Py_VISIT(traverse_module_state->__pyx_int_112105877); Py_VISIT(traverse_module_state->__pyx_int_136983863); Py_VISIT(traverse_module_state->__pyx_int_184977713); Py_VISIT(traverse_module_state->__pyx_int_neg_1); Py_VISIT(traverse_module_state->__pyx_k__41); Py_VISIT(traverse_module_state->__pyx_k__49); Py_VISIT(traverse_module_state->__pyx_k__50); Py_VISIT(traverse_module_state->__pyx_k__63); Py_VISIT(traverse_module_state->__pyx_slice__5); Py_VISIT(traverse_module_state->__pyx_tuple__4); Py_VISIT(traverse_module_state->__pyx_tuple__8); Py_VISIT(traverse_module_state->__pyx_slice__20); Py_VISIT(traverse_module_state->__pyx_slice__58); Py_VISIT(traverse_module_state->__pyx_slice__59); Py_VISIT(traverse_module_state->__pyx_tuple__15); Py_VISIT(traverse_module_state->__pyx_tuple__17); Py_VISIT(traverse_module_state->__pyx_tuple__19); Py_VISIT(traverse_module_state->__pyx_tuple__21); Py_VISIT(traverse_module_state->__pyx_tuple__22); Py_VISIT(traverse_module_state->__pyx_tuple__23); Py_VISIT(traverse_module_state->__pyx_tuple__24); Py_VISIT(traverse_module_state->__pyx_tuple__25); Py_VISIT(traverse_module_state->__pyx_tuple__27); Py_VISIT(traverse_module_state->__pyx_tuple__28); Py_VISIT(traverse_module_state->__pyx_tuple__29); Py_VISIT(traverse_module_state->__pyx_tuple__30); Py_VISIT(traverse_module_state->__pyx_tuple__31); Py_VISIT(traverse_module_state->__pyx_tuple__32); Py_VISIT(traverse_module_state->__pyx_tuple__33); Py_VISIT(traverse_module_state->__pyx_tuple__35); Py_VISIT(traverse_module_state->__pyx_tuple__37); Py_VISIT(traverse_module_state->__pyx_tuple__38); Py_VISIT(traverse_module_state->__pyx_tuple__39); Py_VISIT(traverse_module_state->__pyx_tuple__40); Py_VISIT(traverse_module_state->__pyx_tuple__42); Py_VISIT(traverse_module_state->__pyx_tuple__43); Py_VISIT(traverse_module_state->__pyx_tuple__44); Py_VISIT(traverse_module_state->__pyx_tuple__45); Py_VISIT(traverse_module_state->__pyx_tuple__46); Py_VISIT(traverse_module_state->__pyx_tuple__47); Py_VISIT(traverse_module_state->__pyx_tuple__48); Py_VISIT(traverse_module_state->__pyx_tuple__51); Py_VISIT(traverse_module_state->__pyx_tuple__52); Py_VISIT(traverse_module_state->__pyx_tuple__53); Py_VISIT(traverse_module_state->__pyx_tuple__54); Py_VISIT(traverse_module_state->__pyx_tuple__55); Py_VISIT(traverse_module_state->__pyx_tuple__56); Py_VISIT(traverse_module_state->__pyx_tuple__57); Py_VISIT(traverse_module_state->__pyx_tuple__60); Py_VISIT(traverse_module_state->__pyx_tuple__61); Py_VISIT(traverse_module_state->__pyx_tuple__62); Py_VISIT(traverse_module_state->__pyx_tuple__64); Py_VISIT(traverse_module_state->__pyx_tuple__65); Py_VISIT(traverse_module_state->__pyx_tuple__66); Py_VISIT(traverse_module_state->__pyx_tuple__67); Py_VISIT(traverse_module_state->__pyx_tuple__68); Py_VISIT(traverse_module_state->__pyx_tuple__69); Py_VISIT(traverse_module_state->__pyx_tuple__70); Py_VISIT(traverse_module_state->__pyx_tuple__71); Py_VISIT(traverse_module_state->__pyx_tuple__72); Py_VISIT(traverse_module_state->__pyx_tuple__73); Py_VISIT(traverse_module_state->__pyx_tuple__74); Py_VISIT(traverse_module_state->__pyx_tuple__75); Py_VISIT(traverse_module_state->__pyx_tuple__76); Py_VISIT(traverse_module_state->__pyx_tuple__78); Py_VISIT(traverse_module_state->__pyx_tuple__79); Py_VISIT(traverse_module_state->__pyx_tuple__80); Py_VISIT(traverse_module_state->__pyx_tuple__81); Py_VISIT(traverse_module_state->__pyx_tuple__82); Py_VISIT(traverse_module_state->__pyx_tuple__83); Py_VISIT(traverse_module_state->__pyx_tuple__84); Py_VISIT(traverse_module_state->__pyx_tuple__85); Py_VISIT(traverse_module_state->__pyx_tuple__86); Py_VISIT(traverse_module_state->__pyx_tuple__89); Py_VISIT(traverse_module_state->__pyx_tuple__91); Py_VISIT(traverse_module_state->__pyx_tuple__93); Py_VISIT(traverse_module_state->__pyx_tuple__96); Py_VISIT(traverse_module_state->__pyx_tuple__97); Py_VISIT(traverse_module_state->__pyx_tuple__98); Py_VISIT(traverse_module_state->__pyx_tuple__99); Py_VISIT(traverse_module_state->__pyx_tuple__100); Py_VISIT(traverse_module_state->__pyx_tuple__101); Py_VISIT(traverse_module_state->__pyx_tuple__102); Py_VISIT(traverse_module_state->__pyx_tuple__103); Py_VISIT(traverse_module_state->__pyx_tuple__104); Py_VISIT(traverse_module_state->__pyx_tuple__105); Py_VISIT(traverse_module_state->__pyx_tuple__106); Py_VISIT(traverse_module_state->__pyx_tuple__107); Py_VISIT(traverse_module_state->__pyx_tuple__108); Py_VISIT(traverse_module_state->__pyx_tuple__110); Py_VISIT(traverse_module_state->__pyx_tuple__112); Py_VISIT(traverse_module_state->__pyx_tuple__114); Py_VISIT(traverse_module_state->__pyx_tuple__116); Py_VISIT(traverse_module_state->__pyx_tuple__117); Py_VISIT(traverse_module_state->__pyx_tuple__118); Py_VISIT(traverse_module_state->__pyx_tuple__119); Py_VISIT(traverse_module_state->__pyx_tuple__120); Py_VISIT(traverse_module_state->__pyx_tuple__121); Py_VISIT(traverse_module_state->__pyx_tuple__122); Py_VISIT(traverse_module_state->__pyx_tuple__123); Py_VISIT(traverse_module_state->__pyx_tuple__124); Py_VISIT(traverse_module_state->__pyx_tuple__125); Py_VISIT(traverse_module_state->__pyx_tuple__126); Py_VISIT(traverse_module_state->__pyx_tuple__127); Py_VISIT(traverse_module_state->__pyx_tuple__128); Py_VISIT(traverse_module_state->__pyx_tuple__129); Py_VISIT(traverse_module_state->__pyx_tuple__130); Py_VISIT(traverse_module_state->__pyx_tuple__131); Py_VISIT(traverse_module_state->__pyx_tuple__132); Py_VISIT(traverse_module_state->__pyx_tuple__133); Py_VISIT(traverse_module_state->__pyx_tuple__134); Py_VISIT(traverse_module_state->__pyx_tuple__135); Py_VISIT(traverse_module_state->__pyx_tuple__136); Py_VISIT(traverse_module_state->__pyx_tuple__137); Py_VISIT(traverse_module_state->__pyx_tuple__138); Py_VISIT(traverse_module_state->__pyx_tuple__139); Py_VISIT(traverse_module_state->__pyx_tuple__140); Py_VISIT(traverse_module_state->__pyx_tuple__141); Py_VISIT(traverse_module_state->__pyx_tuple__142); Py_VISIT(traverse_module_state->__pyx_tuple__143); Py_VISIT(traverse_module_state->__pyx_tuple__144); Py_VISIT(traverse_module_state->__pyx_tuple__145); Py_VISIT(traverse_module_state->__pyx_tuple__146); Py_VISIT(traverse_module_state->__pyx_tuple__147); Py_VISIT(traverse_module_state->__pyx_tuple__148); Py_VISIT(traverse_module_state->__pyx_tuple__149); Py_VISIT(traverse_module_state->__pyx_tuple__150); Py_VISIT(traverse_module_state->__pyx_tuple__151); Py_VISIT(traverse_module_state->__pyx_tuple__152); Py_VISIT(traverse_module_state->__pyx_tuple__153); Py_VISIT(traverse_module_state->__pyx_tuple__154); Py_VISIT(traverse_module_state->__pyx_tuple__155); Py_VISIT(traverse_module_state->__pyx_tuple__156); Py_VISIT(traverse_module_state->__pyx_tuple__157); Py_VISIT(traverse_module_state->__pyx_tuple__158); Py_VISIT(traverse_module_state->__pyx_tuple__159); Py_VISIT(traverse_module_state->__pyx_tuple__160); Py_VISIT(traverse_module_state->__pyx_tuple__161); Py_VISIT(traverse_module_state->__pyx_tuple__162); Py_VISIT(traverse_module_state->__pyx_tuple__163); Py_VISIT(traverse_module_state->__pyx_tuple__164); Py_VISIT(traverse_module_state->__pyx_tuple__165); Py_VISIT(traverse_module_state->__pyx_tuple__166); Py_VISIT(traverse_module_state->__pyx_tuple__167); Py_VISIT(traverse_module_state->__pyx_tuple__168); Py_VISIT(traverse_module_state->__pyx_tuple__169); Py_VISIT(traverse_module_state->__pyx_tuple__170); Py_VISIT(traverse_module_state->__pyx_tuple__171); Py_VISIT(traverse_module_state->__pyx_tuple__172); Py_VISIT(traverse_module_state->__pyx_tuple__173); Py_VISIT(traverse_module_state->__pyx_tuple__174); Py_VISIT(traverse_module_state->__pyx_tuple__175); Py_VISIT(traverse_module_state->__pyx_tuple__176); Py_VISIT(traverse_module_state->__pyx_tuple__177); Py_VISIT(traverse_module_state->__pyx_tuple__178); Py_VISIT(traverse_module_state->__pyx_tuple__179); Py_VISIT(traverse_module_state->__pyx_tuple__180); Py_VISIT(traverse_module_state->__pyx_tuple__181); Py_VISIT(traverse_module_state->__pyx_tuple__182); Py_VISIT(traverse_module_state->__pyx_tuple__183); Py_VISIT(traverse_module_state->__pyx_tuple__184); Py_VISIT(traverse_module_state->__pyx_tuple__185); Py_VISIT(traverse_module_state->__pyx_tuple__186); Py_VISIT(traverse_module_state->__pyx_tuple__187); Py_VISIT(traverse_module_state->__pyx_tuple__188); Py_VISIT(traverse_module_state->__pyx_tuple__189); Py_VISIT(traverse_module_state->__pyx_tuple__190); Py_VISIT(traverse_module_state->__pyx_tuple__191); Py_VISIT(traverse_module_state->__pyx_tuple__192); Py_VISIT(traverse_module_state->__pyx_tuple__193); Py_VISIT(traverse_module_state->__pyx_tuple__194); Py_VISIT(traverse_module_state->__pyx_tuple__195); Py_VISIT(traverse_module_state->__pyx_tuple__196); Py_VISIT(traverse_module_state->__pyx_tuple__197); Py_VISIT(traverse_module_state->__pyx_tuple__198); Py_VISIT(traverse_module_state->__pyx_tuple__199); Py_VISIT(traverse_module_state->__pyx_tuple__200); Py_VISIT(traverse_module_state->__pyx_tuple__201); Py_VISIT(traverse_module_state->__pyx_tuple__202); Py_VISIT(traverse_module_state->__pyx_tuple__203); Py_VISIT(traverse_module_state->__pyx_tuple__204); Py_VISIT(traverse_module_state->__pyx_tuple__205); Py_VISIT(traverse_module_state->__pyx_tuple__206); Py_VISIT(traverse_module_state->__pyx_tuple__207); Py_VISIT(traverse_module_state->__pyx_tuple__208); Py_VISIT(traverse_module_state->__pyx_tuple__209); Py_VISIT(traverse_module_state->__pyx_tuple__210); Py_VISIT(traverse_module_state->__pyx_tuple__211); Py_VISIT(traverse_module_state->__pyx_tuple__212); Py_VISIT(traverse_module_state->__pyx_tuple__213); Py_VISIT(traverse_module_state->__pyx_tuple__214); Py_VISIT(traverse_module_state->__pyx_tuple__215); Py_VISIT(traverse_module_state->__pyx_tuple__216); Py_VISIT(traverse_module_state->__pyx_tuple__217); Py_VISIT(traverse_module_state->__pyx_tuple__218); Py_VISIT(traverse_module_state->__pyx_tuple__219); Py_VISIT(traverse_module_state->__pyx_tuple__220); Py_VISIT(traverse_module_state->__pyx_tuple__221); Py_VISIT(traverse_module_state->__pyx_tuple__222); Py_VISIT(traverse_module_state->__pyx_tuple__223); Py_VISIT(traverse_module_state->__pyx_tuple__224); Py_VISIT(traverse_module_state->__pyx_tuple__225); Py_VISIT(traverse_module_state->__pyx_tuple__226); Py_VISIT(traverse_module_state->__pyx_tuple__227); Py_VISIT(traverse_module_state->__pyx_tuple__228); Py_VISIT(traverse_module_state->__pyx_tuple__229); Py_VISIT(traverse_module_state->__pyx_tuple__230); Py_VISIT(traverse_module_state->__pyx_tuple__231); Py_VISIT(traverse_module_state->__pyx_tuple__232); Py_VISIT(traverse_module_state->__pyx_tuple__233); Py_VISIT(traverse_module_state->__pyx_tuple__234); Py_VISIT(traverse_module_state->__pyx_tuple__235); Py_VISIT(traverse_module_state->__pyx_tuple__236); Py_VISIT(traverse_module_state->__pyx_tuple__237); Py_VISIT(traverse_module_state->__pyx_tuple__238); Py_VISIT(traverse_module_state->__pyx_tuple__239); Py_VISIT(traverse_module_state->__pyx_tuple__240); Py_VISIT(traverse_module_state->__pyx_tuple__241); Py_VISIT(traverse_module_state->__pyx_tuple__242); Py_VISIT(traverse_module_state->__pyx_tuple__243); Py_VISIT(traverse_module_state->__pyx_tuple__244); Py_VISIT(traverse_module_state->__pyx_tuple__245); Py_VISIT(traverse_module_state->__pyx_tuple__246); Py_VISIT(traverse_module_state->__pyx_tuple__247); Py_VISIT(traverse_module_state->__pyx_tuple__248); Py_VISIT(traverse_module_state->__pyx_tuple__249); Py_VISIT(traverse_module_state->__pyx_tuple__250); Py_VISIT(traverse_module_state->__pyx_codeobj__34); Py_VISIT(traverse_module_state->__pyx_codeobj__36); Py_VISIT(traverse_module_state->__pyx_codeobj__77); Py_VISIT(traverse_module_state->__pyx_codeobj__87); Py_VISIT(traverse_module_state->__pyx_codeobj__88); Py_VISIT(traverse_module_state->__pyx_codeobj__90); Py_VISIT(traverse_module_state->__pyx_codeobj__92); Py_VISIT(traverse_module_state->__pyx_codeobj__94); Py_VISIT(traverse_module_state->__pyx_codeobj__95); Py_VISIT(traverse_module_state->__pyx_codeobj__109); Py_VISIT(traverse_module_state->__pyx_codeobj__111); Py_VISIT(traverse_module_state->__pyx_codeobj__113); Py_VISIT(traverse_module_state->__pyx_codeobj__115); Py_VISIT(traverse_module_state->__pyx_codeobj__251); Py_VISIT(traverse_module_state->__pyx_codeobj__252); Py_VISIT(traverse_module_state->__pyx_codeobj__253); Py_VISIT(traverse_module_state->__pyx_codeobj__254); Py_VISIT(traverse_module_state->__pyx_codeobj__255); Py_VISIT(traverse_module_state->__pyx_codeobj__256); return 0; } #endif /* #### Code section: module_state_defines ### */ #define __pyx_d __pyx_mstate_global->__pyx_d #define __pyx_b __pyx_mstate_global->__pyx_b #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode #ifdef __Pyx_CyFunction_USED #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType #endif #ifdef __Pyx_FusedFunction_USED #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType #endif #ifdef __Pyx_Generator_USED #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType #endif #ifdef __Pyx_IterableCoroutine_USED #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #define PyPetscComm_Type __pyx_mstate_global->PyPetscComm_Type #define PyPetscObject_Type __pyx_mstate_global->PyPetscObject_Type #define PyPetscViewer_Type __pyx_mstate_global->PyPetscViewer_Type #define PyPetscRandom_Type __pyx_mstate_global->PyPetscRandom_Type #define PyPetscDevice_Type __pyx_mstate_global->PyPetscDevice_Type #define PyPetscDeviceContext_Type __pyx_mstate_global->PyPetscDeviceContext_Type #define PyPetscIS_Type __pyx_mstate_global->PyPetscIS_Type #define PyPetscLGMap_Type __pyx_mstate_global->PyPetscLGMap_Type #define PyPetscSF_Type __pyx_mstate_global->PyPetscSF_Type #define PyPetscVec_Type __pyx_mstate_global->PyPetscVec_Type #define PyPetscSpace_Type __pyx_mstate_global->PyPetscSpace_Type #define PyPetscDualSpace_Type __pyx_mstate_global->PyPetscDualSpace_Type #define PyPetscFE_Type __pyx_mstate_global->PyPetscFE_Type #define PyPetscQuad_Type __pyx_mstate_global->PyPetscQuad_Type #define PyPetscScatter_Type __pyx_mstate_global->PyPetscScatter_Type #define PyPetscSection_Type __pyx_mstate_global->PyPetscSection_Type #define PyPetscMat_Type __pyx_mstate_global->PyPetscMat_Type #define PyPetscMatPartitioning_Type __pyx_mstate_global->PyPetscMatPartitioning_Type #define PyPetscNullSpace_Type __pyx_mstate_global->PyPetscNullSpace_Type #define PyPetscPC_Type __pyx_mstate_global->PyPetscPC_Type #define PyPetscKSP_Type __pyx_mstate_global->PyPetscKSP_Type #define PyPetscSNES_Type __pyx_mstate_global->PyPetscSNES_Type #define PyPetscTS_Type __pyx_mstate_global->PyPetscTS_Type #define PyPetscTAO_Type __pyx_mstate_global->PyPetscTAO_Type #define PyPetscTAOLineSearch_Type __pyx_mstate_global->PyPetscTAOLineSearch_Type #define PyPetscAO_Type __pyx_mstate_global->PyPetscAO_Type #define PyPetscDM_Type __pyx_mstate_global->PyPetscDM_Type #define PyPetscDMPlexTransform_Type __pyx_mstate_global->PyPetscDMPlexTransform_Type #define PyPetscDS_Type __pyx_mstate_global->PyPetscDS_Type #define PyPetscPartitioner_Type __pyx_mstate_global->PyPetscPartitioner_Type #define PyPetscDMLabel_Type __pyx_mstate_global->PyPetscDMLabel_Type #define __pyx_type_8petsc4py_5PETSc__IS_buffer __pyx_mstate_global->__pyx_type_8petsc4py_5PETSc__IS_buffer #define __pyx_type_8petsc4py_5PETSc__Vec_buffer __pyx_mstate_global->__pyx_type_8petsc4py_5PETSc__Vec_buffer #define __pyx_type_8petsc4py_5PETSc__Vec_LocalForm __pyx_mstate_global->__pyx_type_8petsc4py_5PETSc__Vec_LocalForm #define __pyx_type_8petsc4py_5PETSc__DMDA_Vec_array __pyx_mstate_global->__pyx_type_8petsc4py_5PETSc__DMDA_Vec_array #define __pyx_type_8petsc4py_5PETSc__DMComposite_access __pyx_mstate_global->__pyx_type_8petsc4py_5PETSc__DMComposite_access #define __pyx_type_8petsc4py_5PETSc_Options __pyx_mstate_global->__pyx_type_8petsc4py_5PETSc_Options #define __pyx_type_8petsc4py_5PETSc_Sys __pyx_mstate_global->__pyx_type_8petsc4py_5PETSc_Sys #define __pyx_type_8petsc4py_5PETSc_Log __pyx_mstate_global->__pyx_type_8petsc4py_5PETSc_Log #define __pyx_type_8petsc4py_5PETSc_LogStage __pyx_mstate_global->__pyx_type_8petsc4py_5PETSc_LogStage #define __pyx_type_8petsc4py_5PETSc_LogClass __pyx_mstate_global->__pyx_type_8petsc4py_5PETSc_LogClass #define __pyx_type_8petsc4py_5PETSc_LogEvent __pyx_mstate_global->__pyx_type_8petsc4py_5PETSc_LogEvent #define __pyx_type_8petsc4py_5PETSc_ViewerHDF5 __pyx_mstate_global->__pyx_type_8petsc4py_5PETSc_ViewerHDF5 #define __pyx_type_8petsc4py_5PETSc_MatStencil __pyx_mstate_global->__pyx_type_8petsc4py_5PETSc_MatStencil #define __pyx_type_8petsc4py_5PETSc_DMDA __pyx_mstate_global->__pyx_type_8petsc4py_5PETSc_DMDA #define __pyx_type_8petsc4py_5PETSc_DMPlex __pyx_mstate_global->__pyx_type_8petsc4py_5PETSc_DMPlex #define __pyx_type_8petsc4py_5PETSc_DMStag __pyx_mstate_global->__pyx_type_8petsc4py_5PETSc_DMStag #define __pyx_type_8petsc4py_5PETSc_DMComposite __pyx_mstate_global->__pyx_type_8petsc4py_5PETSc_DMComposite #define __pyx_type_8petsc4py_5PETSc_DMShell __pyx_mstate_global->__pyx_type_8petsc4py_5PETSc_DMShell #define __pyx_type_8petsc4py_5PETSc_DMSwarm __pyx_mstate_global->__pyx_type_8petsc4py_5PETSc_DMSwarm #define __pyx_type_8petsc4py_5PETSc_DMInterpolation __pyx_mstate_global->__pyx_type_8petsc4py_5PETSc_DMInterpolation #define __pyx_type_8petsc4py_5PETSc__PyObj __pyx_mstate_global->__pyx_type_8petsc4py_5PETSc__PyObj #define __pyx_type_8petsc4py_5PETSc__PyMat __pyx_mstate_global->__pyx_type_8petsc4py_5PETSc__PyMat #define __pyx_type_8petsc4py_5PETSc__PyPC __pyx_mstate_global->__pyx_type_8petsc4py_5PETSc__PyPC #define __pyx_type_8petsc4py_5PETSc__PyKSP __pyx_mstate_global->__pyx_type_8petsc4py_5PETSc__PyKSP #define __pyx_type_8petsc4py_5PETSc__PySNES __pyx_mstate_global->__pyx_type_8petsc4py_5PETSc__PySNES #define __pyx_type_8petsc4py_5PETSc__PyTS __pyx_mstate_global->__pyx_type_8petsc4py_5PETSc__PyTS #define __pyx_type_8petsc4py_5PETSc__PyTao __pyx_mstate_global->__pyx_type_8petsc4py_5PETSc__PyTao #define __pyx_type_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator __pyx_mstate_global->__pyx_type_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator #define __pyx_type_8petsc4py_5PETSc___pyx_scope_struct_1_decorator __pyx_mstate_global->__pyx_type_8petsc4py_5PETSc___pyx_scope_struct_1_decorator #define __pyx_type___pyx_array __pyx_mstate_global->__pyx_type___pyx_array #define __pyx_type___pyx_MemviewEnum __pyx_mstate_global->__pyx_type___pyx_MemviewEnum #define __pyx_type___pyx_memoryview __pyx_mstate_global->__pyx_type___pyx_memoryview #define __pyx_type___pyx_memoryviewslice __pyx_mstate_global->__pyx_type___pyx_memoryviewslice #endif #define __pyx_ptype_8petsc4py_5PETSc_Comm __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Comm #define __pyx_ptype_8petsc4py_5PETSc_Object __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object #define __pyx_ptype_8petsc4py_5PETSc_Viewer __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer #define __pyx_ptype_8petsc4py_5PETSc_Random __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Random #define __pyx_ptype_8petsc4py_5PETSc_Device __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Device #define __pyx_ptype_8petsc4py_5PETSc_DeviceContext __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DeviceContext #define __pyx_ptype_8petsc4py_5PETSc_IS __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS #define __pyx_ptype_8petsc4py_5PETSc_LGMap __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LGMap #define __pyx_ptype_8petsc4py_5PETSc_SF __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SF #define __pyx_ptype_8petsc4py_5PETSc_Vec __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec #define __pyx_ptype_8petsc4py_5PETSc_Space __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Space #define __pyx_ptype_8petsc4py_5PETSc_DualSpace __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DualSpace #define __pyx_ptype_8petsc4py_5PETSc_FE __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_FE #define __pyx_ptype_8petsc4py_5PETSc_Quad __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Quad #define __pyx_ptype_8petsc4py_5PETSc_Scatter __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Scatter #define __pyx_ptype_8petsc4py_5PETSc_Section __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section #define __pyx_ptype_8petsc4py_5PETSc_Mat __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat #define __pyx_ptype_8petsc4py_5PETSc_MatPartitioning __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_MatPartitioning #define __pyx_ptype_8petsc4py_5PETSc_NullSpace __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_NullSpace #define __pyx_ptype_8petsc4py_5PETSc_PC __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC #define __pyx_ptype_8petsc4py_5PETSc_KSP __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP #define __pyx_ptype_8petsc4py_5PETSc_SNES __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES #define __pyx_ptype_8petsc4py_5PETSc_TS __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS #define __pyx_ptype_8petsc4py_5PETSc_TAO __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO #define __pyx_ptype_8petsc4py_5PETSc_TAOLineSearch __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAOLineSearch #define __pyx_ptype_8petsc4py_5PETSc_AO __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_AO #define __pyx_ptype_8petsc4py_5PETSc_DM __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM #define __pyx_ptype_8petsc4py_5PETSc_DMPlexTransform __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlexTransform #define __pyx_ptype_8petsc4py_5PETSc_DS __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DS #define __pyx_ptype_8petsc4py_5PETSc_Partitioner __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Partitioner #define __pyx_ptype_8petsc4py_5PETSc_DMLabel __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMLabel #define __pyx_ptype_8petsc4py_5PETSc_dtype __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_dtype #define __pyx_ptype_8petsc4py_5PETSc_ndarray __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_ndarray #define __pyx_ptype_8petsc4py_5PETSc__IS_buffer __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc__IS_buffer #define __pyx_ptype_8petsc4py_5PETSc__Vec_buffer __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc__Vec_buffer #define __pyx_ptype_8petsc4py_5PETSc__Vec_LocalForm __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc__Vec_LocalForm #define __pyx_ptype_8petsc4py_5PETSc__DMDA_Vec_array __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc__DMDA_Vec_array #define __pyx_ptype_8petsc4py_5PETSc__DMComposite_access __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc__DMComposite_access #define __pyx_ptype_8petsc4py_5PETSc_Options __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Options #define __pyx_ptype_8petsc4py_5PETSc_Sys __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Sys #define __pyx_ptype_8petsc4py_5PETSc_Log __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Log #define __pyx_ptype_8petsc4py_5PETSc_LogStage __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LogStage #define __pyx_ptype_8petsc4py_5PETSc_LogClass __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LogClass #define __pyx_ptype_8petsc4py_5PETSc_LogEvent __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LogEvent #define __pyx_ptype_8petsc4py_5PETSc_ViewerHDF5 __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_ViewerHDF5 #define __pyx_ptype_8petsc4py_5PETSc_MatStencil __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_MatStencil #define __pyx_ptype_8petsc4py_5PETSc_DMDA __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMDA #define __pyx_ptype_8petsc4py_5PETSc_DMPlex __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex #define __pyx_ptype_8petsc4py_5PETSc_DMStag __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMStag #define __pyx_ptype_8petsc4py_5PETSc_DMComposite __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMComposite #define __pyx_ptype_8petsc4py_5PETSc_DMShell __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMShell #define __pyx_ptype_8petsc4py_5PETSc_DMSwarm __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMSwarm #define __pyx_ptype_8petsc4py_5PETSc_DMInterpolation __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMInterpolation #define __pyx_ptype_8petsc4py_5PETSc__PyObj __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc__PyObj #define __pyx_ptype_8petsc4py_5PETSc__PyMat __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc__PyMat #define __pyx_ptype_8petsc4py_5PETSc__PyPC __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc__PyPC #define __pyx_ptype_8petsc4py_5PETSc__PyKSP __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc__PyKSP #define __pyx_ptype_8petsc4py_5PETSc__PySNES __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc__PySNES #define __pyx_ptype_8petsc4py_5PETSc__PyTS __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc__PyTS #define __pyx_ptype_8petsc4py_5PETSc__PyTao __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc__PyTao #define __pyx_ptype_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator #define __pyx_ptype_8petsc4py_5PETSc___pyx_scope_struct_1_decorator __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc___pyx_scope_struct_1_decorator #define __pyx_array_type __pyx_mstate_global->__pyx_array_type #define __pyx_MemviewEnum_type __pyx_mstate_global->__pyx_MemviewEnum_type #define __pyx_memoryview_type __pyx_mstate_global->__pyx_memoryview_type #define __pyx_memoryviewslice_type __pyx_mstate_global->__pyx_memoryviewslice_type #define __pyx_kp_u_ __pyx_mstate_global->__pyx_kp_u_ #define __pyx_n_s_A __pyx_mstate_global->__pyx_n_s_A #define __pyx_n_s_A11 __pyx_mstate_global->__pyx_n_s_A11 #define __pyx_n_s_AB __pyx_mstate_global->__pyx_n_s_AB #define __pyx_n_s_ABC __pyx_mstate_global->__pyx_n_s_ABC #define __pyx_n_s_ABt __pyx_mstate_global->__pyx_n_s_ABt #define __pyx_n_s_ADD __pyx_mstate_global->__pyx_n_s_ADD #define __pyx_n_s_ADDITIVE __pyx_mstate_global->__pyx_n_s_ADDITIVE #define __pyx_n_s_ADD_ALL __pyx_mstate_global->__pyx_n_s_ADD_ALL #define __pyx_n_s_ADD_ALL_VALUES __pyx_mstate_global->__pyx_n_s_ADD_ALL_VALUES #define __pyx_n_s_ADD_BC __pyx_mstate_global->__pyx_n_s_ADD_BC #define __pyx_n_s_ADD_BC_VALUES __pyx_mstate_global->__pyx_n_s_ADD_BC_VALUES #define __pyx_n_s_ADD_VALUES __pyx_mstate_global->__pyx_n_s_ADD_VALUES #define __pyx_n_s_ADIOS __pyx_mstate_global->__pyx_n_s_ADIOS #define __pyx_n_s_ADMM __pyx_mstate_global->__pyx_n_s_ADMM #define __pyx_n_s_ADVANCED __pyx_mstate_global->__pyx_n_s_ADVANCED #define __pyx_n_s_AGG __pyx_mstate_global->__pyx_n_s_AGG #define __pyx_n_s_AGGREGATION __pyx_mstate_global->__pyx_n_s_AGGREGATION #define __pyx_n_s_AIJ __pyx_mstate_global->__pyx_n_s_AIJ #define __pyx_n_s_AIJCRL __pyx_mstate_global->__pyx_n_s_AIJCRL #define __pyx_n_s_AIJCUSPARSE __pyx_mstate_global->__pyx_n_s_AIJCUSPARSE #define __pyx_n_s_AIJMKL __pyx_mstate_global->__pyx_n_s_AIJMKL #define __pyx_n_s_AIJPERM __pyx_mstate_global->__pyx_n_s_AIJPERM #define __pyx_n_s_AIJSELL __pyx_mstate_global->__pyx_n_s_AIJSELL #define __pyx_n_s_AIJVIENNACL __pyx_mstate_global->__pyx_n_s_AIJVIENNACL #define __pyx_n_s_ALLGATHER __pyx_mstate_global->__pyx_n_s_ALLGATHER #define __pyx_n_s_ALLGATHERV __pyx_mstate_global->__pyx_n_s_ALLGATHERV #define __pyx_n_s_ALLTOALL __pyx_mstate_global->__pyx_n_s_ALLTOALL #define __pyx_n_s_ALMM __pyx_mstate_global->__pyx_n_s_ALMM #define __pyx_n_s_ALPHA __pyx_mstate_global->__pyx_n_s_ALPHA #define __pyx_n_s_ALPHA2 __pyx_mstate_global->__pyx_n_s_ALPHA2 #define __pyx_n_s_ALWAYS __pyx_mstate_global->__pyx_n_s_ALWAYS #define __pyx_n_s_AMD __pyx_mstate_global->__pyx_n_s_AMD #define __pyx_n_s_ANDERSON __pyx_mstate_global->__pyx_n_s_ANDERSON #define __pyx_n_s_AO __pyx_mstate_global->__pyx_n_s_AO #define __pyx_n_s_AOType __pyx_mstate_global->__pyx_n_s_AOType #define __pyx_n_s_APPEND __pyx_mstate_global->__pyx_n_s_APPEND #define __pyx_n_s_APPEND_UPDATE __pyx_mstate_global->__pyx_n_s_APPEND_UPDATE #define __pyx_n_s_APPLY_LOWER __pyx_mstate_global->__pyx_n_s_APPLY_LOWER #define __pyx_n_s_APPLY_UPPER __pyx_mstate_global->__pyx_n_s_APPLY_UPPER #define __pyx_n_s_ARKIMEX __pyx_mstate_global->__pyx_n_s_ARKIMEX #define __pyx_n_s_ARKIMEX1BEE __pyx_mstate_global->__pyx_n_s_ARKIMEX1BEE #define __pyx_n_s_ARKIMEX2C __pyx_mstate_global->__pyx_n_s_ARKIMEX2C #define __pyx_n_s_ARKIMEX2D __pyx_mstate_global->__pyx_n_s_ARKIMEX2D #define __pyx_n_s_ARKIMEX2E __pyx_mstate_global->__pyx_n_s_ARKIMEX2E #define __pyx_n_s_ARKIMEX3 __pyx_mstate_global->__pyx_n_s_ARKIMEX3 #define __pyx_n_s_ARKIMEX4 __pyx_mstate_global->__pyx_n_s_ARKIMEX4 #define __pyx_n_s_ARKIMEX5 __pyx_mstate_global->__pyx_n_s_ARKIMEX5 #define __pyx_n_s_ARKIMEXA2 __pyx_mstate_global->__pyx_n_s_ARKIMEXA2 #define __pyx_n_s_ARKIMEXARS122 __pyx_mstate_global->__pyx_n_s_ARKIMEXARS122 #define __pyx_n_s_ARKIMEXARS443 __pyx_mstate_global->__pyx_n_s_ARKIMEXARS443 #define __pyx_n_s_ARKIMEXBPR3 __pyx_mstate_global->__pyx_n_s_ARKIMEXBPR3 #define __pyx_n_s_ARKIMEXL2 __pyx_mstate_global->__pyx_n_s_ARKIMEXL2 #define __pyx_n_s_ARKIMEXPRSSP2 __pyx_mstate_global->__pyx_n_s_ARKIMEXPRSSP2 #define __pyx_n_s_ARKIMEXType __pyx_mstate_global->__pyx_n_s_ARKIMEXType #define __pyx_n_s_ARMIJO __pyx_mstate_global->__pyx_n_s_ARMIJO #define __pyx_n_s_ASCII __pyx_mstate_global->__pyx_n_s_ASCII #define __pyx_n_s_ASCII_COMMON __pyx_mstate_global->__pyx_n_s_ASCII_COMMON #define __pyx_n_s_ASCII_CSV __pyx_mstate_global->__pyx_n_s_ASCII_CSV #define __pyx_n_s_ASCII_DENSE __pyx_mstate_global->__pyx_n_s_ASCII_DENSE #define __pyx_n_s_ASCII_FACTOR_INFO __pyx_mstate_global->__pyx_n_s_ASCII_FACTOR_INFO #define __pyx_n_s_ASCII_GLVIS __pyx_mstate_global->__pyx_n_s_ASCII_GLVIS #define __pyx_n_s_ASCII_IMPL __pyx_mstate_global->__pyx_n_s_ASCII_IMPL #define __pyx_n_s_ASCII_INDEX __pyx_mstate_global->__pyx_n_s_ASCII_INDEX #define __pyx_n_s_ASCII_INFO __pyx_mstate_global->__pyx_n_s_ASCII_INFO #define __pyx_n_s_ASCII_INFO_DETAIL __pyx_mstate_global->__pyx_n_s_ASCII_INFO_DETAIL #define __pyx_n_s_ASCII_LATEX __pyx_mstate_global->__pyx_n_s_ASCII_LATEX #define __pyx_n_s_ASCII_MATHEMATICA __pyx_mstate_global->__pyx_n_s_ASCII_MATHEMATICA #define __pyx_n_s_ASCII_MATLAB __pyx_mstate_global->__pyx_n_s_ASCII_MATLAB #define __pyx_n_s_ASCII_MATRIXMARKET __pyx_mstate_global->__pyx_n_s_ASCII_MATRIXMARKET #define __pyx_n_s_ASCII_PCICE __pyx_mstate_global->__pyx_n_s_ASCII_PCICE #define __pyx_n_s_ASCII_PYTHON __pyx_mstate_global->__pyx_n_s_ASCII_PYTHON #define __pyx_n_s_ASCII_SYMMODU __pyx_mstate_global->__pyx_n_s_ASCII_SYMMODU #define __pyx_n_s_ASCII_VTK __pyx_mstate_global->__pyx_n_s_ASCII_VTK #define __pyx_n_s_ASCII_VTK_CELL __pyx_mstate_global->__pyx_n_s_ASCII_VTK_CELL #define __pyx_n_s_ASCII_VTK_COORDS __pyx_mstate_global->__pyx_n_s_ASCII_VTK_COORDS #define __pyx_n_s_ASCII_XML __pyx_mstate_global->__pyx_n_s_ASCII_XML #define __pyx_n_s_ASFLS __pyx_mstate_global->__pyx_n_s_ASFLS #define __pyx_n_s_ASILS __pyx_mstate_global->__pyx_n_s_ASILS #define __pyx_n_s_ASM __pyx_mstate_global->__pyx_n_s_ASM #define __pyx_n_s_ASMType __pyx_mstate_global->__pyx_n_s_ASMType #define __pyx_n_s_ASPIN __pyx_mstate_global->__pyx_n_s_ASPIN #define __pyx_n_s_AU __pyx_mstate_global->__pyx_n_s_AU #define __pyx_kp_s_A_matrix_with_d_rows_requires_a __pyx_mstate_global->__pyx_kp_s_A_matrix_with_d_rows_requires_a #define __pyx_kp_s_All_dimensions_preceding_dimensi __pyx_mstate_global->__pyx_kp_s_All_dimensions_preceding_dimensi #define __pyx_n_s_AssemblyType __pyx_mstate_global->__pyx_n_s_AssemblyType #define __pyx_n_s_AssertionError __pyx_mstate_global->__pyx_n_s_AssertionError #define __pyx_n_s_AtB __pyx_mstate_global->__pyx_n_s_AtB #define __pyx_n_s_AttributeError __pyx_mstate_global->__pyx_n_s_AttributeError #define __pyx_n_s_B __pyx_mstate_global->__pyx_n_s_B #define __pyx_n_s_BACK __pyx_mstate_global->__pyx_n_s_BACK #define __pyx_n_s_BACKWARD_SWEEP __pyx_mstate_global->__pyx_n_s_BACKWARD_SWEEP #define __pyx_n_s_BACK_DOWN __pyx_mstate_global->__pyx_n_s_BACK_DOWN #define __pyx_n_s_BACK_DOWN_LEFT __pyx_mstate_global->__pyx_n_s_BACK_DOWN_LEFT #define __pyx_n_s_BACK_DOWN_RIGHT __pyx_mstate_global->__pyx_n_s_BACK_DOWN_RIGHT #define __pyx_n_s_BACK_LEFT __pyx_mstate_global->__pyx_n_s_BACK_LEFT #define __pyx_n_s_BACK_RIGHT __pyx_mstate_global->__pyx_n_s_BACK_RIGHT #define __pyx_n_s_BACK_UP __pyx_mstate_global->__pyx_n_s_BACK_UP #define __pyx_n_s_BACK_UP_LEFT __pyx_mstate_global->__pyx_n_s_BACK_UP_LEFT #define __pyx_n_s_BACK_UP_RIGHT __pyx_mstate_global->__pyx_n_s_BACK_UP_RIGHT #define __pyx_n_s_BAIJ __pyx_mstate_global->__pyx_n_s_BAIJ #define __pyx_n_s_BAIJMKL __pyx_mstate_global->__pyx_n_s_BAIJMKL #define __pyx_n_s_BALANCED __pyx_mstate_global->__pyx_n_s_BALANCED #define __pyx_n_s_BAS __pyx_mstate_global->__pyx_n_s_BAS #define __pyx_n_s_BASIC __pyx_mstate_global->__pyx_n_s_BASIC #define __pyx_n_s_BASICSYMPLECTIC __pyx_mstate_global->__pyx_n_s_BASICSYMPLECTIC #define __pyx_n_s_BCG __pyx_mstate_global->__pyx_n_s_BCG #define __pyx_n_s_BCGS __pyx_mstate_global->__pyx_n_s_BCGS #define __pyx_n_s_BCGSL __pyx_mstate_global->__pyx_n_s_BCGSL #define __pyx_n_s_BDDC __pyx_mstate_global->__pyx_n_s_BDDC #define __pyx_n_s_BDF __pyx_mstate_global->__pyx_n_s_BDF #define __pyx_n_s_BDM __pyx_mstate_global->__pyx_n_s_BDM #define __pyx_n_s_BE __pyx_mstate_global->__pyx_n_s_BE #define __pyx_n_s_BEULER __pyx_mstate_global->__pyx_n_s_BEULER #define __pyx_n_s_BFBCG __pyx_mstate_global->__pyx_n_s_BFBCG #define __pyx_n_s_BFBT __pyx_mstate_global->__pyx_n_s_BFBT #define __pyx_n_s_BGCRODR __pyx_mstate_global->__pyx_n_s_BGCRODR #define __pyx_n_s_BGMRES __pyx_mstate_global->__pyx_n_s_BGMRES #define __pyx_n_s_BICG __pyx_mstate_global->__pyx_n_s_BICG #define __pyx_n_s_BINARY __pyx_mstate_global->__pyx_n_s_BINARY #define __pyx_n_s_BINARY_MATLAB __pyx_mstate_global->__pyx_n_s_BINARY_MATLAB #define __pyx_n_s_BIORTH22 __pyx_mstate_global->__pyx_n_s_BIORTH22 #define __pyx_n_s_BJACOBI __pyx_mstate_global->__pyx_n_s_BJACOBI #define __pyx_n_s_BLMVM __pyx_mstate_global->__pyx_n_s_BLMVM #define __pyx_n_s_BLOCK __pyx_mstate_global->__pyx_n_s_BLOCK #define __pyx_n_s_BLOCKMAT __pyx_mstate_global->__pyx_n_s_BLOCKMAT #define __pyx_n_s_BMRM __pyx_mstate_global->__pyx_n_s_BMRM #define __pyx_n_s_BNCG __pyx_mstate_global->__pyx_n_s_BNCG #define __pyx_n_s_BNCGType __pyx_mstate_global->__pyx_n_s_BNCGType #define __pyx_n_s_BNLS __pyx_mstate_global->__pyx_n_s_BNLS #define __pyx_n_s_BNTL __pyx_mstate_global->__pyx_n_s_BNTL #define __pyx_n_s_BNTR __pyx_mstate_global->__pyx_n_s_BNTR #define __pyx_n_s_BOX __pyx_mstate_global->__pyx_n_s_BOX #define __pyx_n_s_BQNKLS __pyx_mstate_global->__pyx_n_s_BQNKLS #define __pyx_n_s_BQNKTL __pyx_mstate_global->__pyx_n_s_BQNKTL #define __pyx_n_s_BQNKTR __pyx_mstate_global->__pyx_n_s_BQNKTR #define __pyx_n_s_BQNLS __pyx_mstate_global->__pyx_n_s_BQNLS #define __pyx_n_s_BQPIP __pyx_mstate_global->__pyx_n_s_BQPIP #define __pyx_n_s_BRGN __pyx_mstate_global->__pyx_n_s_BRGN #define __pyx_n_s_Barrier __pyx_mstate_global->__pyx_n_s_Barrier #define __pyx_kp_s_Basic_constants_DECIDE_Use_a_de __pyx_mstate_global->__pyx_kp_s_Basic_constants_DECIDE_Use_a_de #define __pyx_n_s_BoundaryType __pyx_mstate_global->__pyx_n_s_BoundaryType #define __pyx_kp_s_Buffer_view_does_not_expose_stri __pyx_mstate_global->__pyx_kp_s_Buffer_view_does_not_expose_stri #define __pyx_n_s_C __pyx_mstate_global->__pyx_n_s_C #define __pyx_n_s_CG __pyx_mstate_global->__pyx_n_s_CG #define __pyx_n_s_CGLS __pyx_mstate_global->__pyx_n_s_CGLS #define __pyx_n_s_CGNE __pyx_mstate_global->__pyx_n_s_CGNE #define __pyx_n_s_CGS __pyx_mstate_global->__pyx_n_s_CGS #define __pyx_n_s_CHACO __pyx_mstate_global->__pyx_n_s_CHACO #define __pyx_n_s_CHEBYSHEV __pyx_mstate_global->__pyx_n_s_CHEBYSHEV #define __pyx_n_s_CHOLESKY __pyx_mstate_global->__pyx_n_s_CHOLESKY #define __pyx_n_s_CHOLMOD __pyx_mstate_global->__pyx_n_s_CHOLMOD #define __pyx_n_s_CHOWILUVIENNACL __pyx_mstate_global->__pyx_n_s_CHOWILUVIENNACL #define __pyx_n_s_CLASSICAL __pyx_mstate_global->__pyx_n_s_CLASSICAL #define __pyx_n_s_CN __pyx_mstate_global->__pyx_n_s_CN #define __pyx_n_s_COLLECT_BASIC __pyx_mstate_global->__pyx_n_s_COLLECT_BASIC #define __pyx_n_s_COLLECT_DMDABOUNDINGBOX __pyx_mstate_global->__pyx_n_s_COLLECT_DMDABOUNDINGBOX #define __pyx_n_s_COLLECT_GENERAL __pyx_mstate_global->__pyx_n_s_COLLECT_GENERAL #define __pyx_n_s_COLLECT_USER __pyx_mstate_global->__pyx_n_s_COLLECT_USER #define __pyx_n_s_COMM_NULL __pyx_mstate_global->__pyx_n_s_COMM_NULL #define __pyx_n_s_COMM_SELF __pyx_mstate_global->__pyx_n_s_COMM_SELF #define __pyx_n_s_COMM_WORLD __pyx_mstate_global->__pyx_n_s_COMM_WORLD #define __pyx_n_s_COMPOSITE __pyx_mstate_global->__pyx_n_s_COMPOSITE #define __pyx_n_s_CONSTANTDIAGONAL __pyx_mstate_global->__pyx_n_s_CONSTANTDIAGONAL #define __pyx_n_s_CONTINUE_ITERATING __pyx_mstate_global->__pyx_n_s_CONTINUE_ITERATING #define __pyx_n_s_CONTINUE_SEARCH __pyx_mstate_global->__pyx_n_s_CONTINUE_SEARCH #define __pyx_n_s_CONVERGED_ATOL __pyx_mstate_global->__pyx_n_s_CONVERGED_ATOL #define __pyx_n_s_CONVERGED_ATOL_NORMAL __pyx_mstate_global->__pyx_n_s_CONVERGED_ATOL_NORMAL #define __pyx_n_s_CONVERGED_EVENT __pyx_mstate_global->__pyx_n_s_CONVERGED_EVENT #define __pyx_n_s_CONVERGED_FNORM_ABS __pyx_mstate_global->__pyx_n_s_CONVERGED_FNORM_ABS #define __pyx_n_s_CONVERGED_FNORM_RELATIVE __pyx_mstate_global->__pyx_n_s_CONVERGED_FNORM_RELATIVE #define __pyx_n_s_CONVERGED_GATOL __pyx_mstate_global->__pyx_n_s_CONVERGED_GATOL #define __pyx_n_s_CONVERGED_GRTOL __pyx_mstate_global->__pyx_n_s_CONVERGED_GRTOL #define __pyx_n_s_CONVERGED_GTTOL __pyx_mstate_global->__pyx_n_s_CONVERGED_GTTOL #define __pyx_n_s_CONVERGED_HAPPY_BREAKDOWN __pyx_mstate_global->__pyx_n_s_CONVERGED_HAPPY_BREAKDOWN #define __pyx_n_s_CONVERGED_ITERATING __pyx_mstate_global->__pyx_n_s_CONVERGED_ITERATING #define __pyx_n_s_CONVERGED_ITS __pyx_mstate_global->__pyx_n_s_CONVERGED_ITS #define __pyx_n_s_CONVERGED_MINF __pyx_mstate_global->__pyx_n_s_CONVERGED_MINF #define __pyx_n_s_CONVERGED_NEG_CURVE __pyx_mstate_global->__pyx_n_s_CONVERGED_NEG_CURVE #define __pyx_n_s_CONVERGED_RTOL __pyx_mstate_global->__pyx_n_s_CONVERGED_RTOL #define __pyx_n_s_CONVERGED_RTOL_NORMAL __pyx_mstate_global->__pyx_n_s_CONVERGED_RTOL_NORMAL #define __pyx_n_s_CONVERGED_SNORM_RELATIVE __pyx_mstate_global->__pyx_n_s_CONVERGED_SNORM_RELATIVE #define __pyx_n_s_CONVERGED_STEPTOL __pyx_mstate_global->__pyx_n_s_CONVERGED_STEPTOL #define __pyx_n_s_CONVERGED_STEP_LENGTH __pyx_mstate_global->__pyx_n_s_CONVERGED_STEP_LENGTH #define __pyx_n_s_CONVERGED_TIME __pyx_mstate_global->__pyx_n_s_CONVERGED_TIME #define __pyx_n_s_CONVERGED_USER __pyx_mstate_global->__pyx_n_s_CONVERGED_USER #define __pyx_n_s_COPY_VALUES __pyx_mstate_global->__pyx_n_s_COPY_VALUES #define __pyx_n_s_CP __pyx_mstate_global->__pyx_n_s_CP #define __pyx_n_s_CR __pyx_mstate_global->__pyx_n_s_CR #define __pyx_n_s_CRANK_NICOLSON __pyx_mstate_global->__pyx_n_s_CRANK_NICOLSON #define __pyx_n_s_CUDA __pyx_mstate_global->__pyx_n_s_CUDA #define __pyx_n_s_CUSPARSE __pyx_mstate_global->__pyx_n_s_CUSPARSE #define __pyx_kp_s_Can_only_create_a_buffer_that_is __pyx_mstate_global->__pyx_kp_s_Can_only_create_a_buffer_that_is #define __pyx_kp_s_Cannot_assign_to_read_only_memor __pyx_mstate_global->__pyx_kp_s_Cannot_assign_to_read_only_memor #define __pyx_kp_s_Cannot_create_writable_memory_vi __pyx_mstate_global->__pyx_kp_s_Cannot_create_writable_memory_vi #define __pyx_kp_u_Cannot_index_with_type __pyx_mstate_global->__pyx_kp_u_Cannot_index_with_type #define __pyx_kp_s_Cannot_transpose_memoryview_with __pyx_mstate_global->__pyx_kp_s_Cannot_transpose_memoryview_with #define __pyx_n_s_Class __pyx_mstate_global->__pyx_n_s_Class #define __pyx_n_s_Clone __pyx_mstate_global->__pyx_n_s_Clone #define __pyx_n_s_CollectType __pyx_mstate_global->__pyx_n_s_CollectType #define __pyx_n_s_Comm __pyx_mstate_global->__pyx_n_s_Comm #define __pyx_n_s_ComplexType __pyx_mstate_global->__pyx_n_s_ComplexType #define __pyx_n_s_CompositeType __pyx_mstate_global->__pyx_n_s_CompositeType #define __pyx_n_s_ConvergedReason __pyx_mstate_global->__pyx_n_s_ConvergedReason #define __pyx_n_s_D __pyx_mstate_global->__pyx_n_s_D #define __pyx_n_s_DA __pyx_mstate_global->__pyx_n_s_DA #define __pyx_n_s_DAE_IMPLICIT_INDEX1 __pyx_mstate_global->__pyx_n_s_DAE_IMPLICIT_INDEX1 #define __pyx_n_s_DAE_IMPLICIT_INDEX2 __pyx_mstate_global->__pyx_n_s_DAE_IMPLICIT_INDEX2 #define __pyx_n_s_DAE_IMPLICIT_INDEX3 __pyx_mstate_global->__pyx_n_s_DAE_IMPLICIT_INDEX3 #define __pyx_n_s_DAE_IMPLICIT_INDEXHI __pyx_mstate_global->__pyx_n_s_DAE_IMPLICIT_INDEXHI #define __pyx_n_s_DAE_SEMI_EXPLICIT_INDEX1 __pyx_mstate_global->__pyx_n_s_DAE_SEMI_EXPLICIT_INDEX1 #define __pyx_n_s_DAE_SEMI_EXPLICIT_INDEX2 __pyx_mstate_global->__pyx_n_s_DAE_SEMI_EXPLICIT_INDEX2 #define __pyx_n_s_DAE_SEMI_EXPLICIT_INDEX3 __pyx_mstate_global->__pyx_n_s_DAE_SEMI_EXPLICIT_INDEX3 #define __pyx_n_s_DAE_SEMI_EXPLICIT_INDEXHI __pyx_mstate_global->__pyx_n_s_DAE_SEMI_EXPLICIT_INDEXHI #define __pyx_n_s_DB16 __pyx_mstate_global->__pyx_n_s_DB16 #define __pyx_n_s_DB2 __pyx_mstate_global->__pyx_n_s_DB2 #define __pyx_n_s_DB4 __pyx_mstate_global->__pyx_n_s_DB4 #define __pyx_n_s_DB8 __pyx_mstate_global->__pyx_n_s_DB8 #define __pyx_n_s_DECIDE __pyx_mstate_global->__pyx_n_s_DECIDE #define __pyx_n_s_DEFAULT __pyx_mstate_global->__pyx_n_s_DEFAULT #define __pyx_n_s_DEFAULT_BLOCKING __pyx_mstate_global->__pyx_n_s_DEFAULT_BLOCKING #define __pyx_n_s_DEFLATED __pyx_mstate_global->__pyx_n_s_DEFLATED #define __pyx_n_s_DEFLATION __pyx_mstate_global->__pyx_n_s_DEFLATION #define __pyx_n_s_DENSE __pyx_mstate_global->__pyx_n_s_DENSE #define __pyx_n_s_DENSECUDA __pyx_mstate_global->__pyx_n_s_DENSECUDA #define __pyx_n_s_DESTROY __pyx_mstate_global->__pyx_n_s_DESTROY #define __pyx_n_s_DETERMINE __pyx_mstate_global->__pyx_n_s_DETERMINE #define __pyx_n_s_DGMRES __pyx_mstate_global->__pyx_n_s_DGMRES #define __pyx_n_s_DIAG __pyx_mstate_global->__pyx_n_s_DIAG #define __pyx_n_s_DIAGONAL __pyx_mstate_global->__pyx_n_s_DIAGONAL #define __pyx_n_s_DIFFERENT __pyx_mstate_global->__pyx_n_s_DIFFERENT #define __pyx_n_s_DIFFERENT_NONZERO_PATTERN __pyx_mstate_global->__pyx_n_s_DIFFERENT_NONZERO_PATTERN #define __pyx_n_s_DIFFERENT_NZ __pyx_mstate_global->__pyx_n_s_DIFFERENT_NZ #define __pyx_n_s_DIRK __pyx_mstate_global->__pyx_n_s_DIRK #define __pyx_n_s_DIRK657A __pyx_mstate_global->__pyx_n_s_DIRK657A #define __pyx_n_s_DIRK658A __pyx_mstate_global->__pyx_n_s_DIRK658A #define __pyx_n_s_DIRK7510SAL __pyx_mstate_global->__pyx_n_s_DIRK7510SAL #define __pyx_n_s_DIRK759A __pyx_mstate_global->__pyx_n_s_DIRK759A #define __pyx_n_s_DIRK8614A __pyx_mstate_global->__pyx_n_s_DIRK8614A #define __pyx_n_s_DIRK8616SAL __pyx_mstate_global->__pyx_n_s_DIRK8616SAL #define __pyx_n_s_DIRKES122SAL __pyx_mstate_global->__pyx_n_s_DIRKES122SAL #define __pyx_n_s_DIRKES213SAL __pyx_mstate_global->__pyx_n_s_DIRKES213SAL #define __pyx_n_s_DIRKES324SAL __pyx_mstate_global->__pyx_n_s_DIRKES324SAL #define __pyx_n_s_DIRKES325SAL __pyx_mstate_global->__pyx_n_s_DIRKES325SAL #define __pyx_n_s_DIRKES648SA __pyx_mstate_global->__pyx_n_s_DIRKES648SA #define __pyx_n_s_DIRKES7510SA __pyx_mstate_global->__pyx_n_s_DIRKES7510SA #define __pyx_n_s_DIRKES8516SAL __pyx_mstate_global->__pyx_n_s_DIRKES8516SAL #define __pyx_n_s_DIRKS212 __pyx_mstate_global->__pyx_n_s_DIRKS212 #define __pyx_n_s_DIRKS659A __pyx_mstate_global->__pyx_n_s_DIRKS659A #define __pyx_n_s_DIRKS7511SAL __pyx_mstate_global->__pyx_n_s_DIRKS7511SAL #define __pyx_n_s_DIRKType __pyx_mstate_global->__pyx_n_s_DIRKType #define __pyx_n_s_DISCGRAD __pyx_mstate_global->__pyx_n_s_DISCGRAD #define __pyx_n_s_DIVERGED_BREAKDOWN __pyx_mstate_global->__pyx_n_s_DIVERGED_BREAKDOWN #define __pyx_n_s_DIVERGED_BREAKDOWN_BICG __pyx_mstate_global->__pyx_n_s_DIVERGED_BREAKDOWN_BICG #define __pyx_n_s_DIVERGED_DTOL __pyx_mstate_global->__pyx_n_s_DIVERGED_DTOL #define __pyx_n_s_DIVERGED_FNORM_NAN __pyx_mstate_global->__pyx_n_s_DIVERGED_FNORM_NAN #define __pyx_n_s_DIVERGED_FUNCTION_COUNT __pyx_mstate_global->__pyx_n_s_DIVERGED_FUNCTION_COUNT #define __pyx_n_s_DIVERGED_FUNCTION_DOMAIN __pyx_mstate_global->__pyx_n_s_DIVERGED_FUNCTION_DOMAIN #define __pyx_n_s_DIVERGED_INDEFINITE_MAT __pyx_mstate_global->__pyx_n_s_DIVERGED_INDEFINITE_MAT #define __pyx_n_s_DIVERGED_INDEFINITE_PC __pyx_mstate_global->__pyx_n_s_DIVERGED_INDEFINITE_PC #define __pyx_n_s_DIVERGED_INNER __pyx_mstate_global->__pyx_n_s_DIVERGED_INNER #define __pyx_n_s_DIVERGED_JACOBIAN_DOMAIN __pyx_mstate_global->__pyx_n_s_DIVERGED_JACOBIAN_DOMAIN #define __pyx_n_s_DIVERGED_LINEAR_SOLVE __pyx_mstate_global->__pyx_n_s_DIVERGED_LINEAR_SOLVE #define __pyx_n_s_DIVERGED_LINE_SEARCH __pyx_mstate_global->__pyx_n_s_DIVERGED_LINE_SEARCH #define __pyx_n_s_DIVERGED_LOCAL_MIN __pyx_mstate_global->__pyx_n_s_DIVERGED_LOCAL_MIN #define __pyx_n_s_DIVERGED_LS_FAILURE __pyx_mstate_global->__pyx_n_s_DIVERGED_LS_FAILURE #define __pyx_n_s_DIVERGED_MAXFCN __pyx_mstate_global->__pyx_n_s_DIVERGED_MAXFCN #define __pyx_n_s_DIVERGED_MAXITS __pyx_mstate_global->__pyx_n_s_DIVERGED_MAXITS #define __pyx_n_s_DIVERGED_MAX_IT __pyx_mstate_global->__pyx_n_s_DIVERGED_MAX_IT #define __pyx_n_s_DIVERGED_NAN __pyx_mstate_global->__pyx_n_s_DIVERGED_NAN #define __pyx_n_s_DIVERGED_NANORINF __pyx_mstate_global->__pyx_n_s_DIVERGED_NANORINF #define __pyx_n_s_DIVERGED_NONLINEAR_SOLVE __pyx_mstate_global->__pyx_n_s_DIVERGED_NONLINEAR_SOLVE #define __pyx_n_s_DIVERGED_NONSYMMETRIC __pyx_mstate_global->__pyx_n_s_DIVERGED_NONSYMMETRIC #define __pyx_n_s_DIVERGED_NULL __pyx_mstate_global->__pyx_n_s_DIVERGED_NULL #define __pyx_n_s_DIVERGED_PCSETUP_FAILED __pyx_mstate_global->__pyx_n_s_DIVERGED_PCSETUP_FAILED #define __pyx_n_s_DIVERGED_STEP_REJECTED __pyx_mstate_global->__pyx_n_s_DIVERGED_STEP_REJECTED #define __pyx_n_s_DIVERGED_TR_DELTA __pyx_mstate_global->__pyx_n_s_DIVERGED_TR_DELTA #define __pyx_n_s_DIVERGED_TR_REDUCTION __pyx_mstate_global->__pyx_n_s_DIVERGED_TR_REDUCTION #define __pyx_n_s_DIVERGED_USER __pyx_mstate_global->__pyx_n_s_DIVERGED_USER #define __pyx_n_s_DK __pyx_mstate_global->__pyx_n_s_DK #define __pyx_n_s_DM __pyx_mstate_global->__pyx_n_s_DM #define __pyx_n_s_DMBoundaryType __pyx_mstate_global->__pyx_n_s_DMBoundaryType #define __pyx_n_s_DMComposite __pyx_mstate_global->__pyx_n_s_DMComposite #define __pyx_n_s_DMComposite_access __pyx_mstate_global->__pyx_n_s_DMComposite_access #define __pyx_n_s_DMDA __pyx_mstate_global->__pyx_n_s_DMDA #define __pyx_n_s_DMDAElementType __pyx_mstate_global->__pyx_n_s_DMDAElementType #define __pyx_n_s_DMDAInterpolationType __pyx_mstate_global->__pyx_n_s_DMDAInterpolationType #define __pyx_n_s_DMDAStencilType __pyx_mstate_global->__pyx_n_s_DMDAStencilType #define __pyx_n_s_DMDA_Vec_array __pyx_mstate_global->__pyx_n_s_DMDA_Vec_array #define __pyx_n_s_DMInterpolation __pyx_mstate_global->__pyx_n_s_DMInterpolation #define __pyx_n_s_DMLabel __pyx_mstate_global->__pyx_n_s_DMLabel #define __pyx_n_s_DMPlex __pyx_mstate_global->__pyx_n_s_DMPlex #define __pyx_n_s_DMPlexReorderDefaultFlag __pyx_mstate_global->__pyx_n_s_DMPlexReorderDefaultFlag #define __pyx_n_s_DMPlexTransform __pyx_mstate_global->__pyx_n_s_DMPlexTransform #define __pyx_n_s_DMPlexTransformType __pyx_mstate_global->__pyx_n_s_DMPlexTransformType #define __pyx_n_s_DMPolytopeType __pyx_mstate_global->__pyx_n_s_DMPolytopeType #define __pyx_n_s_DMShell __pyx_mstate_global->__pyx_n_s_DMShell #define __pyx_n_s_DMStag __pyx_mstate_global->__pyx_n_s_DMStag #define __pyx_n_s_DMStagStencilLocation __pyx_mstate_global->__pyx_n_s_DMStagStencilLocation #define __pyx_n_s_DMStagStencilType __pyx_mstate_global->__pyx_n_s_DMStagStencilType #define __pyx_n_s_DMSwarm __pyx_mstate_global->__pyx_n_s_DMSwarm #define __pyx_n_s_DMSwarmCollectType __pyx_mstate_global->__pyx_n_s_DMSwarmCollectType #define __pyx_n_s_DMSwarmMigrateType __pyx_mstate_global->__pyx_n_s_DMSwarmMigrateType #define __pyx_n_s_DMSwarmPICLayoutType __pyx_mstate_global->__pyx_n_s_DMSwarmPICLayoutType #define __pyx_n_s_DMSwarmType __pyx_mstate_global->__pyx_n_s_DMSwarmType #define __pyx_n_s_DMType __pyx_mstate_global->__pyx_n_s_DMType #define __pyx_kp_s_DM_Boundary_types __pyx_mstate_global->__pyx_kp_s_DM_Boundary_types #define __pyx_kp_s_DM_types __pyx_mstate_global->__pyx_kp_s_DM_types #define __pyx_n_s_DOF __pyx_mstate_global->__pyx_n_s_DOF #define __pyx_n_s_DOWN __pyx_mstate_global->__pyx_n_s_DOWN #define __pyx_n_s_DOWN_LEFT __pyx_mstate_global->__pyx_n_s_DOWN_LEFT #define __pyx_n_s_DOWN_RIGHT __pyx_mstate_global->__pyx_n_s_DOWN_RIGHT #define __pyx_n_s_DO_NOT_COPY_VALUES __pyx_mstate_global->__pyx_n_s_DO_NOT_COPY_VALUES #define __pyx_n_s_DRAW __pyx_mstate_global->__pyx_n_s_DRAW #define __pyx_n_s_DRAW_BASIC __pyx_mstate_global->__pyx_n_s_DRAW_BASIC #define __pyx_n_s_DRAW_CONTOUR __pyx_mstate_global->__pyx_n_s_DRAW_CONTOUR #define __pyx_n_s_DRAW_LG __pyx_mstate_global->__pyx_n_s_DRAW_LG #define __pyx_n_s_DRAW_LG_XRANGE __pyx_mstate_global->__pyx_n_s_DRAW_LG_XRANGE #define __pyx_n_s_DRAW_PORTS __pyx_mstate_global->__pyx_n_s_DRAW_PORTS #define __pyx_n_s_DROP __pyx_mstate_global->__pyx_n_s_DROP #define __pyx_n_s_DS __pyx_mstate_global->__pyx_n_s_DS #define __pyx_n_s_DSType __pyx_mstate_global->__pyx_n_s_DSType #define __pyx_n_s_DUMMY __pyx_mstate_global->__pyx_n_s_DUMMY #define __pyx_n_s_DY __pyx_mstate_global->__pyx_n_s_DY #define __pyx_n_s_DeflationSpaceType __pyx_mstate_global->__pyx_n_s_DeflationSpaceType #define __pyx_n_s_Device __pyx_mstate_global->__pyx_n_s_Device #define __pyx_n_s_DeviceContext __pyx_mstate_global->__pyx_n_s_DeviceContext #define __pyx_n_s_DeviceJoinMode __pyx_mstate_global->__pyx_n_s_DeviceJoinMode #define __pyx_n_s_DeviceType __pyx_mstate_global->__pyx_n_s_DeviceType #define __pyx_kp_s_Device_type_not_supported __pyx_mstate_global->__pyx_kp_s_Device_type_not_supported #define __pyx_kp_s_Dimension_d_is_not_direct __pyx_mstate_global->__pyx_kp_s_Dimension_d_is_not_direct #define __pyx_kp_s_Distinguishes_among_types_of_exp __pyx_mstate_global->__pyx_kp_s_Distinguishes_among_types_of_exp #define __pyx_kp_s_Distinguishes_linear_and_nonline __pyx_mstate_global->__pyx_kp_s_Distinguishes_linear_and_nonline #define __pyx_n_s_DrawSize __pyx_mstate_global->__pyx_n_s_DrawSize #define __pyx_n_s_DualSpace __pyx_mstate_global->__pyx_n_s_DualSpace #define __pyx_n_s_DualSpaceType __pyx_mstate_global->__pyx_n_s_DualSpaceType #define __pyx_n_s_Dup __pyx_mstate_global->__pyx_n_s_Dup #define __pyx_n_s_DuplicateOption __pyx_mstate_global->__pyx_n_s_DuplicateOption #define __pyx_n_s_EIMEX __pyx_mstate_global->__pyx_n_s_EIMEX #define __pyx_n_s_EISENSTAT __pyx_mstate_global->__pyx_n_s_EISENSTAT #define __pyx_n_s_ELEMENT __pyx_mstate_global->__pyx_n_s_ELEMENT #define __pyx_n_s_ELEMENTAL __pyx_mstate_global->__pyx_n_s_ELEMENTAL #define __pyx_n_s_ERROR_LOWER_TRIANGULAR __pyx_mstate_global->__pyx_n_s_ERROR_LOWER_TRIANGULAR #define __pyx_n_s_ESSL __pyx_mstate_global->__pyx_n_s_ESSL #define __pyx_n_s_EULER __pyx_mstate_global->__pyx_n_s_EULER #define __pyx_n_s_EXODUSII __pyx_mstate_global->__pyx_n_s_EXODUSII #define __pyx_n_s_EXOTIC __pyx_mstate_global->__pyx_n_s_EXOTIC #define __pyx_n_s_EXPLICIT __pyx_mstate_global->__pyx_n_s_EXPLICIT #define __pyx_n_s_EXTRUDE __pyx_mstate_global->__pyx_n_s_EXTRUDE #define __pyx_n_s_ElementType __pyx_mstate_global->__pyx_n_s_ElementType #define __pyx_n_s_Ellipsis __pyx_mstate_global->__pyx_n_s_Ellipsis #define __pyx_kp_s_Empty_shape_tuple_for_cython_arr __pyx_mstate_global->__pyx_kp_s_Empty_shape_tuple_for_cython_arr #define __pyx_kp_s_Enum_describing_mapping_behavior __pyx_mstate_global->__pyx_kp_s_Enum_describing_mapping_behavior #define __pyx_n_s_EquationType __pyx_mstate_global->__pyx_n_s_EquationType #define __pyx_n_s_Error __pyx_mstate_global->__pyx_n_s_Error #define __pyx_n_s_Error___bool __pyx_mstate_global->__pyx_n_s_Error___bool #define __pyx_n_s_Error___init __pyx_mstate_global->__pyx_n_s_Error___init #define __pyx_n_s_Error___repr __pyx_mstate_global->__pyx_n_s_Error___repr #define __pyx_n_s_Error___str __pyx_mstate_global->__pyx_n_s_Error___str #define __pyx_n_s_Event __pyx_mstate_global->__pyx_n_s_Event #define __pyx_n_s_EventDecorator __pyx_mstate_global->__pyx_n_s_EventDecorator #define __pyx_n_s_EventDecorator_locals_decorator __pyx_mstate_global->__pyx_n_s_EventDecorator_locals_decorator #define __pyx_n_s_EventDecorator_locals_decorator_2 __pyx_mstate_global->__pyx_n_s_EventDecorator_locals_decorator_2 #define __pyx_n_s_ExactFinalTime __pyx_mstate_global->__pyx_n_s_ExactFinalTime #define __pyx_n_s_ExactFinalTimeOption __pyx_mstate_global->__pyx_n_s_ExactFinalTimeOption #define __pyx_kp_s_Expect_a_dltensor_field_pycapsul __pyx_mstate_global->__pyx_kp_s_Expect_a_dltensor_field_pycapsul #define __pyx_kp_s_Expect_a_dltensor_or_used_dltens __pyx_mstate_global->__pyx_kp_s_Expect_a_dltensor_or_used_dltens #define __pyx_n_s_FACTOR_NUMERIC_ZEROPIVOT __pyx_mstate_global->__pyx_n_s_FACTOR_NUMERIC_ZEROPIVOT #define __pyx_n_s_FACTOR_OTHER __pyx_mstate_global->__pyx_n_s_FACTOR_OTHER #define __pyx_n_s_FACTOR_OUTMEMORY __pyx_mstate_global->__pyx_n_s_FACTOR_OUTMEMORY #define __pyx_n_s_FACTOR_STRUCT_ZEROPIVOT __pyx_mstate_global->__pyx_n_s_FACTOR_STRUCT_ZEROPIVOT #define __pyx_n_s_FAILED __pyx_mstate_global->__pyx_n_s_FAILED #define __pyx_n_s_FAILED_ASCENT __pyx_mstate_global->__pyx_n_s_FAILED_ASCENT #define __pyx_n_s_FAILED_BADPARAMETER __pyx_mstate_global->__pyx_n_s_FAILED_BADPARAMETER #define __pyx_n_s_FAILED_INFORNAN __pyx_mstate_global->__pyx_n_s_FAILED_INFORNAN #define __pyx_n_s_FALSE __pyx_mstate_global->__pyx_n_s_FALSE #define __pyx_n_s_FAS __pyx_mstate_global->__pyx_n_s_FAS #define __pyx_n_s_FBCGS __pyx_mstate_global->__pyx_n_s_FBCGS #define __pyx_n_s_FBCGSR __pyx_mstate_global->__pyx_n_s_FBCGSR #define __pyx_n_s_FCG __pyx_mstate_global->__pyx_n_s_FCG #define __pyx_n_s_FE __pyx_mstate_global->__pyx_n_s_FE #define __pyx_n_s_FETIDP __pyx_mstate_global->__pyx_n_s_FETIDP #define __pyx_n_s_FEType __pyx_mstate_global->__pyx_n_s_FEType #define __pyx_n_s_FFT __pyx_mstate_global->__pyx_n_s_FFT #define __pyx_n_s_FFTW __pyx_mstate_global->__pyx_n_s_FFTW #define __pyx_n_s_FGMRES __pyx_mstate_global->__pyx_n_s_FGMRES #define __pyx_n_s_FIELDSPLIT __pyx_mstate_global->__pyx_n_s_FIELDSPLIT #define __pyx_n_s_FINAL __pyx_mstate_global->__pyx_n_s_FINAL #define __pyx_n_s_FINAL_ASSEMBLY __pyx_mstate_global->__pyx_n_s_FINAL_ASSEMBLY #define __pyx_n_s_FINAL_ONLY __pyx_mstate_global->__pyx_n_s_FINAL_ONLY #define __pyx_n_s_FLUSH __pyx_mstate_global->__pyx_n_s_FLUSH #define __pyx_n_s_FLUSH_ASSEMBLY __pyx_mstate_global->__pyx_n_s_FLUSH_ASSEMBLY #define __pyx_n_s_FORCE_DIAGONAL_ENTRIES __pyx_mstate_global->__pyx_n_s_FORCE_DIAGONAL_ENTRIES #define __pyx_n_s_FOREST __pyx_mstate_global->__pyx_n_s_FOREST #define __pyx_n_s_FORWARD __pyx_mstate_global->__pyx_n_s_FORWARD #define __pyx_n_s_FORWARD_LOCAL __pyx_mstate_global->__pyx_n_s_FORWARD_LOCAL #define __pyx_n_s_FORWARD_SWEEP __pyx_mstate_global->__pyx_n_s_FORWARD_SWEEP #define __pyx_n_s_FR __pyx_mstate_global->__pyx_n_s_FR #define __pyx_n_s_FRB __pyx_mstate_global->__pyx_n_s_FRB #define __pyx_n_s_FROBENIUS __pyx_mstate_global->__pyx_n_s_FROBENIUS #define __pyx_n_s_FRONT __pyx_mstate_global->__pyx_n_s_FRONT #define __pyx_n_s_FRONT_DOWN __pyx_mstate_global->__pyx_n_s_FRONT_DOWN #define __pyx_n_s_FRONT_DOWN_LEFT __pyx_mstate_global->__pyx_n_s_FRONT_DOWN_LEFT #define __pyx_n_s_FRONT_DOWN_RIGHT __pyx_mstate_global->__pyx_n_s_FRONT_DOWN_RIGHT #define __pyx_n_s_FRONT_LEFT __pyx_mstate_global->__pyx_n_s_FRONT_LEFT #define __pyx_n_s_FRONT_RIGHT __pyx_mstate_global->__pyx_n_s_FRONT_RIGHT #define __pyx_n_s_FRONT_UP __pyx_mstate_global->__pyx_n_s_FRONT_UP #define __pyx_n_s_FRONT_UP_LEFT __pyx_mstate_global->__pyx_n_s_FRONT_UP_LEFT #define __pyx_n_s_FRONT_UP_RIGHT __pyx_mstate_global->__pyx_n_s_FRONT_UP_RIGHT #define __pyx_n_s_FULL __pyx_mstate_global->__pyx_n_s_FULL #define __pyx_n_s_FULL_SIZE __pyx_mstate_global->__pyx_n_s_FULL_SIZE #define __pyx_n_s_FV_GHOST __pyx_mstate_global->__pyx_n_s_FV_GHOST #define __pyx_n_s_FactorShiftType __pyx_mstate_global->__pyx_n_s_FactorShiftType #define __pyx_kp_s_Factored_matrix_ordering_type_Se __pyx_mstate_global->__pyx_kp_s_Factored_matrix_ordering_type_Se #define __pyx_kp_s_Factored_matrix_shift_type_See_A __pyx_mstate_global->__pyx_kp_s_Factored_matrix_shift_type_See_A #define __pyx_kp_s_Factored_matrix_solver_type_See __pyx_mstate_global->__pyx_kp_s_Factored_matrix_solver_type_See #define __pyx_n_s_FailedReason __pyx_mstate_global->__pyx_n_s_FailedReason #define __pyx_n_s_FieldSplitSchurFactType __pyx_mstate_global->__pyx_n_s_FieldSplitSchurFactType #define __pyx_n_s_FieldSplitSchurPreType __pyx_mstate_global->__pyx_n_s_FieldSplitSchurPreType #define __pyx_n_s_FileMode __pyx_mstate_global->__pyx_n_s_FileMode #define __pyx_n_s_Format __pyx_mstate_global->__pyx_n_s_Format #define __pyx_n_s_Free __pyx_mstate_global->__pyx_n_s_Free #define __pyx_n_s_G __pyx_mstate_global->__pyx_n_s_G #define __pyx_n_s_GALERKIN __pyx_mstate_global->__pyx_n_s_GALERKIN #define __pyx_n_s_GAMG __pyx_mstate_global->__pyx_n_s_GAMG #define __pyx_n_s_GAMGType __pyx_mstate_global->__pyx_n_s_GAMGType #define __pyx_n_s_GASM __pyx_mstate_global->__pyx_n_s_GASM #define __pyx_n_s_GASMType __pyx_mstate_global->__pyx_n_s_GASMType #define __pyx_n_s_GATHER __pyx_mstate_global->__pyx_n_s_GATHER #define __pyx_n_s_GATHERV __pyx_mstate_global->__pyx_n_s_GATHERV #define __pyx_n_s_GCR __pyx_mstate_global->__pyx_n_s_GCR #define __pyx_n_s_GCRODR __pyx_mstate_global->__pyx_n_s_GCRODR #define __pyx_n_s_GD __pyx_mstate_global->__pyx_n_s_GD #define __pyx_n_s_GENERAL __pyx_mstate_global->__pyx_n_s_GENERAL #define __pyx_n_s_GEO __pyx_mstate_global->__pyx_n_s_GEO #define __pyx_n_s_GETROW_UPPERTRIANGULAR __pyx_mstate_global->__pyx_n_s_GETROW_UPPERTRIANGULAR #define __pyx_n_s_GHOSTED __pyx_mstate_global->__pyx_n_s_GHOSTED #define __pyx_kp_s_GIT_Date __pyx_mstate_global->__pyx_kp_s_GIT_Date #define __pyx_n_s_GLEE __pyx_mstate_global->__pyx_n_s_GLEE #define __pyx_n_s_GLLE __pyx_mstate_global->__pyx_n_s_GLLE #define __pyx_n_s_GLMapMode __pyx_mstate_global->__pyx_n_s_GLMapMode #define __pyx_n_s_GLOBAL_BLOCKING __pyx_mstate_global->__pyx_n_s_GLOBAL_BLOCKING #define __pyx_n_s_GLOBAL_MAX __pyx_mstate_global->__pyx_n_s_GLOBAL_MAX #define __pyx_n_s_GLOBAL_NONBLOCKING __pyx_mstate_global->__pyx_n_s_GLOBAL_NONBLOCKING #define __pyx_n_s_GLOBAL_SUM __pyx_mstate_global->__pyx_n_s_GLOBAL_SUM #define __pyx_n_s_GLTR __pyx_mstate_global->__pyx_n_s_GLTR #define __pyx_n_s_GLVIS __pyx_mstate_global->__pyx_n_s_GLVIS #define __pyx_n_s_GMRES __pyx_mstate_global->__pyx_n_s_GMRES #define __pyx_n_s_GPCG __pyx_mstate_global->__pyx_n_s_GPCG #define __pyx_n_s_GROPPCG __pyx_mstate_global->__pyx_n_s_GROPPCG #define __pyx_n_s_Get_rank __pyx_mstate_global->__pyx_n_s_Get_rank #define __pyx_n_s_Get_size __pyx_mstate_global->__pyx_n_s_Get_size #define __pyx_kp_s_Given_d_column_indices_but_d_non __pyx_mstate_global->__pyx_kp_s_Given_d_column_indices_but_d_non #define __pyx_n_s_H __pyx_mstate_global->__pyx_n_s_H #define __pyx_n_s_H2OPUS __pyx_mstate_global->__pyx_n_s_H2OPUS #define __pyx_n_s_HAAR __pyx_mstate_global->__pyx_n_s_HAAR #define __pyx_n_s_HALF __pyx_mstate_global->__pyx_n_s_HALF #define __pyx_n_s_HALF_SIZE __pyx_mstate_global->__pyx_n_s_HALF_SIZE #define __pyx_n_s_HALTED_LOWERBOUND __pyx_mstate_global->__pyx_n_s_HALTED_LOWERBOUND #define __pyx_n_s_HALTED_MAXFCN __pyx_mstate_global->__pyx_n_s_HALTED_MAXFCN #define __pyx_n_s_HALTED_OTHER __pyx_mstate_global->__pyx_n_s_HALTED_OTHER #define __pyx_n_s_HALTED_RTOL __pyx_mstate_global->__pyx_n_s_HALTED_RTOL #define __pyx_n_s_HALTED_UPPERBOUND __pyx_mstate_global->__pyx_n_s_HALTED_UPPERBOUND #define __pyx_n_s_HALTED_USER __pyx_mstate_global->__pyx_n_s_HALTED_USER #define __pyx_n_s_HASH __pyx_mstate_global->__pyx_n_s_HASH #define __pyx_n_s_HDF5 __pyx_mstate_global->__pyx_n_s_HDF5 #define __pyx_n_s_HDF5_MAT __pyx_mstate_global->__pyx_n_s_HDF5_MAT #define __pyx_n_s_HDF5_PETSC __pyx_mstate_global->__pyx_n_s_HDF5_PETSC #define __pyx_n_s_HDF5_VIZ __pyx_mstate_global->__pyx_n_s_HDF5_VIZ #define __pyx_n_s_HDF5_XDMF __pyx_mstate_global->__pyx_n_s_HDF5_XDMF #define __pyx_n_s_HERMITIAN __pyx_mstate_global->__pyx_n_s_HERMITIAN #define __pyx_n_s_HERMITIANTRANSPOSE __pyx_mstate_global->__pyx_n_s_HERMITIANTRANSPOSE #define __pyx_n_s_HEXAHEDRON __pyx_mstate_global->__pyx_n_s_HEXAHEDRON #define __pyx_n_s_HIP __pyx_mstate_global->__pyx_n_s_HIP #define __pyx_n_s_HMG __pyx_mstate_global->__pyx_n_s_HMG #define __pyx_n_s_HOST __pyx_mstate_global->__pyx_n_s_HOST #define __pyx_n_s_HPDDM __pyx_mstate_global->__pyx_n_s_HPDDM #define __pyx_n_s_HPDDMCoarseCorrectionType __pyx_mstate_global->__pyx_n_s_HPDDMCoarseCorrectionType #define __pyx_n_s_HPDDMType __pyx_mstate_global->__pyx_n_s_HPDDMType #define __pyx_n_s_HS __pyx_mstate_global->__pyx_n_s_HS #define __pyx_n_s_HYPRE __pyx_mstate_global->__pyx_n_s_HYPRE #define __pyx_n_s_HYPRESSTRUCT __pyx_mstate_global->__pyx_n_s_HYPRESSTRUCT #define __pyx_n_s_HYPRESTRUCT __pyx_mstate_global->__pyx_n_s_HYPRESTRUCT #define __pyx_n_s_HZ __pyx_mstate_global->__pyx_n_s_HZ #define __pyx_n_s_I __pyx_mstate_global->__pyx_n_s_I #define __pyx_n_s_IBCGS __pyx_mstate_global->__pyx_n_s_IBCGS #define __pyx_n_s_ICC __pyx_mstate_global->__pyx_n_s_ICC #define __pyx_n_s_IGNORE_LOWER_TRIANGULAR __pyx_mstate_global->__pyx_n_s_IGNORE_LOWER_TRIANGULAR #define __pyx_n_s_IGNORE_NEGATIVE_INDICES __pyx_mstate_global->__pyx_n_s_IGNORE_NEGATIVE_INDICES #define __pyx_n_s_IGNORE_OFF_PROC_ENTRIES __pyx_mstate_global->__pyx_n_s_IGNORE_OFF_PROC_ENTRIES #define __pyx_n_s_IGNORE_ZERO_ENTRIES __pyx_mstate_global->__pyx_n_s_IGNORE_ZERO_ENTRIES #define __pyx_n_s_ILU __pyx_mstate_global->__pyx_n_s_ILU #define __pyx_n_s_IMPLICIT __pyx_mstate_global->__pyx_n_s_IMPLICIT #define __pyx_n_s_INBLOCKS __pyx_mstate_global->__pyx_n_s_INBLOCKS #define __pyx_n_s_INF __pyx_mstate_global->__pyx_n_s_INF #define __pyx_n_s_INFINITY __pyx_mstate_global->__pyx_n_s_INFINITY #define __pyx_n_s_INITIAL_FINAL_ONLY __pyx_mstate_global->__pyx_n_s_INITIAL_FINAL_ONLY #define __pyx_n_s_INITIAL_ONLY __pyx_mstate_global->__pyx_n_s_INITIAL_ONLY #define __pyx_n_s_INSERT __pyx_mstate_global->__pyx_n_s_INSERT #define __pyx_n_s_INSERT_ALL __pyx_mstate_global->__pyx_n_s_INSERT_ALL #define __pyx_n_s_INSERT_ALL_VALUES __pyx_mstate_global->__pyx_n_s_INSERT_ALL_VALUES #define __pyx_n_s_INSERT_BC __pyx_mstate_global->__pyx_n_s_INSERT_BC #define __pyx_n_s_INSERT_BC_VALUES __pyx_mstate_global->__pyx_n_s_INSERT_BC_VALUES #define __pyx_n_s_INSERT_VALUES __pyx_mstate_global->__pyx_n_s_INSERT_VALUES #define __pyx_n_s_INTERIOR_GHOST __pyx_mstate_global->__pyx_n_s_INTERIOR_GHOST #define __pyx_n_s_INTERPOLATE __pyx_mstate_global->__pyx_n_s_INTERPOLATE #define __pyx_n_s_IPM __pyx_mstate_global->__pyx_n_s_IPM #define __pyx_n_s_IS __pyx_mstate_global->__pyx_n_s_IS #define __pyx_n_s_ISType __pyx_mstate_global->__pyx_n_s_ISType #define __pyx_n_s_IS_buffer __pyx_mstate_global->__pyx_n_s_IS_buffer #define __pyx_n_s_ITERATING __pyx_mstate_global->__pyx_n_s_ITERATING #define __pyx_kp_s_I_0_is_d_expected_d __pyx_mstate_global->__pyx_kp_s_I_0_is_d_expected_d #define __pyx_kp_s_Incompatible_checksums_0x_x_vs_0 __pyx_mstate_global->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0 #define __pyx_n_s_IndexError __pyx_mstate_global->__pyx_n_s_IndexError #define __pyx_kp_s_Index_out_of_bounds_axis_d __pyx_mstate_global->__pyx_kp_s_Index_out_of_bounds_axis_d #define __pyx_kp_s_Indirect_dimensions_not_supporte __pyx_mstate_global->__pyx_kp_s_Indirect_dimensions_not_supporte #define __pyx_n_s_InfoType __pyx_mstate_global->__pyx_n_s_InfoType #define __pyx_kp_s_Input_vector_has_no_tensor_infor __pyx_mstate_global->__pyx_kp_s_Input_vector_has_no_tensor_infor #define __pyx_n_s_InsertMode __pyx_mstate_global->__pyx_n_s_InsertMode #define __pyx_kp_s_Insertion_mode_Most_commonly_use __pyx_mstate_global->__pyx_kp_s_Insertion_mode_Most_commonly_use #define __pyx_n_s_IntType __pyx_mstate_global->__pyx_n_s_IntType #define __pyx_n_s_InterpolationType __pyx_mstate_global->__pyx_n_s_InterpolationType #define __pyx_kp_u_Invalid_mode_expected_c_or_fortr __pyx_mstate_global->__pyx_kp_u_Invalid_mode_expected_c_or_fortr #define __pyx_kp_s_Invalid_mode_expected_r_w_or_rw __pyx_mstate_global->__pyx_kp_s_Invalid_mode_expected_r_w_or_rw #define __pyx_kp_s_Invalid_mode_expected_rw_r_or_w __pyx_mstate_global->__pyx_kp_s_Invalid_mode_expected_rw_r_or_w #define __pyx_kp_u_Invalid_shape_in_axis __pyx_mstate_global->__pyx_kp_u_Invalid_shape_in_axis #define __pyx_n_s_J __pyx_mstate_global->__pyx_n_s_J #define __pyx_n_s_JACOBI __pyx_mstate_global->__pyx_n_s_JACOBI #define __pyx_n_s_JoinMode __pyx_mstate_global->__pyx_n_s_JoinMode #define __pyx_n_s_KACZMARZ __pyx_mstate_global->__pyx_n_s_KACZMARZ #define __pyx_n_s_KAIJ __pyx_mstate_global->__pyx_n_s_KAIJ #define __pyx_n_s_KASKADE __pyx_mstate_global->__pyx_n_s_KASKADE #define __pyx_n_s_KD __pyx_mstate_global->__pyx_n_s_KD #define __pyx_n_s_KEEP_NONZERO_PATTERN __pyx_mstate_global->__pyx_n_s_KEEP_NONZERO_PATTERN #define __pyx_n_s_KLU __pyx_mstate_global->__pyx_n_s_KLU #define __pyx_n_s_KOKKOS __pyx_mstate_global->__pyx_n_s_KOKKOS #define __pyx_n_s_KSP __pyx_mstate_global->__pyx_n_s_KSP #define __pyx_n_s_KSPConvergedReason __pyx_mstate_global->__pyx_n_s_KSPConvergedReason #define __pyx_n_s_KSPHPDDMType __pyx_mstate_global->__pyx_n_s_KSPHPDDMType #define __pyx_n_s_KSPNormType __pyx_mstate_global->__pyx_n_s_KSPNormType #define __pyx_n_s_KSPONLY __pyx_mstate_global->__pyx_n_s_KSPONLY #define __pyx_n_s_KSPTRANSPOSEONLY __pyx_mstate_global->__pyx_n_s_KSPTRANSPOSEONLY #define __pyx_n_s_KSPType __pyx_mstate_global->__pyx_n_s_KSPType #define __pyx_kp_s_KSP_Converged_Reason_CONVERGED_I __pyx_mstate_global->__pyx_kp_s_KSP_Converged_Reason_CONVERGED_I #define __pyx_kp_s_KSP_Type_The_available_types_are __pyx_mstate_global->__pyx_kp_s_KSP_Type_The_available_types_are #define __pyx_kp_s_KSP_norm_type_The_available_norm __pyx_mstate_global->__pyx_kp_s_KSP_norm_type_The_available_norm #define __pyx_n_s_KeyError __pyx_mstate_global->__pyx_n_s_KeyError #define __pyx_n_s_L __pyx_mstate_global->__pyx_n_s_L #define __pyx_n_s_LAGRANGE __pyx_mstate_global->__pyx_n_s_LAGRANGE #define __pyx_n_s_LAYOUT_GAUSS __pyx_mstate_global->__pyx_n_s_LAYOUT_GAUSS #define __pyx_n_s_LAYOUT_REGULAR __pyx_mstate_global->__pyx_n_s_LAYOUT_REGULAR #define __pyx_n_s_LAYOUT_SUBDIVISION __pyx_mstate_global->__pyx_n_s_LAYOUT_SUBDIVISION #define __pyx_n_s_LCD __pyx_mstate_global->__pyx_n_s_LCD #define __pyx_n_s_LCL __pyx_mstate_global->__pyx_n_s_LCL #define __pyx_n_s_LEFT __pyx_mstate_global->__pyx_n_s_LEFT #define __pyx_n_s_LGMRES __pyx_mstate_global->__pyx_n_s_LGMRES #define __pyx_n_s_LGMap __pyx_mstate_global->__pyx_n_s_LGMap #define __pyx_n_s_LGMapType __pyx_mstate_global->__pyx_n_s_LGMapType #define __pyx_n_s_LINEAR __pyx_mstate_global->__pyx_n_s_LINEAR #define __pyx_n_s_LMVM __pyx_mstate_global->__pyx_n_s_LMVM #define __pyx_n_s_LMVMBADBROYDEN __pyx_mstate_global->__pyx_n_s_LMVMBADBROYDEN #define __pyx_n_s_LMVMBFGS __pyx_mstate_global->__pyx_n_s_LMVMBFGS #define __pyx_n_s_LMVMBROYDEN __pyx_mstate_global->__pyx_n_s_LMVMBROYDEN #define __pyx_n_s_LMVMDFP __pyx_mstate_global->__pyx_n_s_LMVMDFP #define __pyx_n_s_LMVMDIAGBBROYDEN __pyx_mstate_global->__pyx_n_s_LMVMDIAGBBROYDEN #define __pyx_n_s_LMVMSR1 __pyx_mstate_global->__pyx_n_s_LMVMSR1 #define __pyx_n_s_LMVMSYMBADBROYDEN __pyx_mstate_global->__pyx_n_s_LMVMSYMBADBROYDEN #define __pyx_n_s_LMVMSYMBROYDEN __pyx_mstate_global->__pyx_n_s_LMVMSYMBROYDEN #define __pyx_n_s_LOAD_BALANCE __pyx_mstate_global->__pyx_n_s_LOAD_BALANCE #define __pyx_n_s_LOCAL __pyx_mstate_global->__pyx_n_s_LOCAL #define __pyx_n_s_LOCALREF __pyx_mstate_global->__pyx_n_s_LOCALREF #define __pyx_n_s_LOCAL_BACKWARD_SWEEP __pyx_mstate_global->__pyx_n_s_LOCAL_BACKWARD_SWEEP #define __pyx_n_s_LOCAL_FORWARD_SWEEP __pyx_mstate_global->__pyx_n_s_LOCAL_FORWARD_SWEEP #define __pyx_n_s_LOCAL_SYMMETRIC_SWEEP __pyx_mstate_global->__pyx_n_s_LOCAL_SYMMETRIC_SWEEP #define __pyx_n_s_LOWER __pyx_mstate_global->__pyx_n_s_LOWER #define __pyx_n_s_LRC __pyx_mstate_global->__pyx_n_s_LRC #define __pyx_n_s_LSC __pyx_mstate_global->__pyx_n_s_LSC #define __pyx_n_s_LSQR __pyx_mstate_global->__pyx_n_s_LSQR #define __pyx_n_s_LU __pyx_mstate_global->__pyx_n_s_LU #define __pyx_n_s_LUSOL __pyx_mstate_global->__pyx_n_s_LUSOL #define __pyx_n_s_Left __pyx_mstate_global->__pyx_n_s_Left #define __pyx_n_s_Log __pyx_mstate_global->__pyx_n_s_Log #define __pyx_n_s_LogClass __pyx_mstate_global->__pyx_n_s_LogClass #define __pyx_n_s_LogEvent __pyx_mstate_global->__pyx_n_s_LogEvent #define __pyx_n_s_LogStage __pyx_mstate_global->__pyx_n_s_LogStage #define __pyx_n_s_MAIJ __pyx_mstate_global->__pyx_n_s_MAIJ #define __pyx_n_s_MAPPING __pyx_mstate_global->__pyx_n_s_MAPPING #define __pyx_n_s_MASK __pyx_mstate_global->__pyx_n_s_MASK #define __pyx_n_s_MAT __pyx_mstate_global->__pyx_n_s_MAT #define __pyx_n_s_MATCHSTEP __pyx_mstate_global->__pyx_n_s_MATCHSTEP #define __pyx_n_s_MATHEMATICA __pyx_mstate_global->__pyx_n_s_MATHEMATICA #define __pyx_n_s_MATLAB __pyx_mstate_global->__pyx_n_s_MATLAB #define __pyx_n_s_MATPARTITIONING __pyx_mstate_global->__pyx_n_s_MATPARTITIONING #define __pyx_n_s_MAX __pyx_mstate_global->__pyx_n_s_MAX #define __pyx_n_s_MAX_VALUES __pyx_mstate_global->__pyx_n_s_MAX_VALUES #define __pyx_n_s_MEMORYSCALABLE __pyx_mstate_global->__pyx_n_s_MEMORYSCALABLE #define __pyx_n_s_METISND __pyx_mstate_global->__pyx_n_s_METISND #define __pyx_n_s_MEYER __pyx_mstate_global->__pyx_n_s_MEYER #define __pyx_n_s_MFFD __pyx_mstate_global->__pyx_n_s_MFFD #define __pyx_n_s_MG __pyx_mstate_global->__pyx_n_s_MG #define __pyx_n_s_MGCycleType __pyx_mstate_global->__pyx_n_s_MGCycleType #define __pyx_n_s_MGType __pyx_mstate_global->__pyx_n_s_MGType #define __pyx_n_s_MIGRATE_BASIC __pyx_mstate_global->__pyx_n_s_MIGRATE_BASIC #define __pyx_n_s_MIGRATE_DMCELLEXACT __pyx_mstate_global->__pyx_n_s_MIGRATE_DMCELLEXACT #define __pyx_n_s_MIGRATE_DMCELLNSCATTER __pyx_mstate_global->__pyx_n_s_MIGRATE_DMCELLNSCATTER #define __pyx_n_s_MIGRATE_USER __pyx_mstate_global->__pyx_n_s_MIGRATE_USER #define __pyx_n_s_MIMEX __pyx_mstate_global->__pyx_n_s_MIMEX #define __pyx_n_s_MINRES __pyx_mstate_global->__pyx_n_s_MINRES #define __pyx_n_s_MIRROR __pyx_mstate_global->__pyx_n_s_MIRROR #define __pyx_n_s_MKL_CPARDISO __pyx_mstate_global->__pyx_n_s_MKL_CPARDISO #define __pyx_n_s_MKL_PARDISO __pyx_mstate_global->__pyx_n_s_MKL_PARDISO #define __pyx_n_s_ML __pyx_mstate_global->__pyx_n_s_ML #define __pyx_n_s_MOAB __pyx_mstate_global->__pyx_n_s_MOAB #define __pyx_n_s_MORETHUENTE __pyx_mstate_global->__pyx_n_s_MORETHUENTE #define __pyx_n_s_MPI __pyx_mstate_global->__pyx_n_s_MPI #define __pyx_n_s_MPIADJ __pyx_mstate_global->__pyx_n_s_MPIADJ #define __pyx_n_s_MPIAIJ __pyx_mstate_global->__pyx_n_s_MPIAIJ #define __pyx_n_s_MPIAIJCRL __pyx_mstate_global->__pyx_n_s_MPIAIJCRL #define __pyx_n_s_MPIAIJCUSPARSE __pyx_mstate_global->__pyx_n_s_MPIAIJCUSPARSE #define __pyx_n_s_MPIAIJMKL __pyx_mstate_global->__pyx_n_s_MPIAIJMKL #define __pyx_n_s_MPIAIJPERM __pyx_mstate_global->__pyx_n_s_MPIAIJPERM #define __pyx_n_s_MPIAIJSELL __pyx_mstate_global->__pyx_n_s_MPIAIJSELL #define __pyx_n_s_MPIAIJVIENNACL __pyx_mstate_global->__pyx_n_s_MPIAIJVIENNACL #define __pyx_n_s_MPIBAIJ __pyx_mstate_global->__pyx_n_s_MPIBAIJ #define __pyx_n_s_MPIBAIJMKL __pyx_mstate_global->__pyx_n_s_MPIBAIJMKL #define __pyx_n_s_MPICUDA __pyx_mstate_global->__pyx_n_s_MPICUDA #define __pyx_n_s_MPIDENSE __pyx_mstate_global->__pyx_n_s_MPIDENSE #define __pyx_n_s_MPIDENSECUDA __pyx_mstate_global->__pyx_n_s_MPIDENSECUDA #define __pyx_n_s_MPIHIP __pyx_mstate_global->__pyx_n_s_MPIHIP #define __pyx_n_s_MPIKAIJ __pyx_mstate_global->__pyx_n_s_MPIKAIJ #define __pyx_n_s_MPIKOKKOS __pyx_mstate_global->__pyx_n_s_MPIKOKKOS #define __pyx_n_s_MPIMAIJ __pyx_mstate_global->__pyx_n_s_MPIMAIJ #define __pyx_n_s_MPISBAIJ __pyx_mstate_global->__pyx_n_s_MPISBAIJ #define __pyx_n_s_MPISELL __pyx_mstate_global->__pyx_n_s_MPISELL #define __pyx_n_s_MPIVIENNACL __pyx_mstate_global->__pyx_n_s_MPIVIENNACL #define __pyx_n_s_MPRK __pyx_mstate_global->__pyx_n_s_MPRK #define __pyx_n_s_MS __pyx_mstate_global->__pyx_n_s_MS #define __pyx_n_s_MULTIPLICATIVE __pyx_mstate_global->__pyx_n_s_MULTIPLICATIVE #define __pyx_n_s_MUMPS __pyx_mstate_global->__pyx_n_s_MUMPS #define __pyx_n_s_MapMode __pyx_mstate_global->__pyx_n_s_MapMode #define __pyx_n_s_Mat __pyx_mstate_global->__pyx_n_s_Mat #define __pyx_n_s_MatAssemblyType __pyx_mstate_global->__pyx_n_s_MatAssemblyType #define __pyx_n_s_MatDuplicateOption __pyx_mstate_global->__pyx_n_s_MatDuplicateOption #define __pyx_n_s_MatFactorShiftType __pyx_mstate_global->__pyx_n_s_MatFactorShiftType #define __pyx_n_s_MatInfoType __pyx_mstate_global->__pyx_n_s_MatInfoType #define __pyx_n_s_MatOption __pyx_mstate_global->__pyx_n_s_MatOption #define __pyx_n_s_MatOrderingType __pyx_mstate_global->__pyx_n_s_MatOrderingType #define __pyx_n_s_MatPartitioning __pyx_mstate_global->__pyx_n_s_MatPartitioning #define __pyx_n_s_MatPartitioningType __pyx_mstate_global->__pyx_n_s_MatPartitioningType #define __pyx_n_s_MatSORType __pyx_mstate_global->__pyx_n_s_MatSORType #define __pyx_n_s_MatSolverType __pyx_mstate_global->__pyx_n_s_MatSolverType #define __pyx_n_s_MatStructure __pyx_mstate_global->__pyx_n_s_MatStructure #define __pyx_n_s_MatType __pyx_mstate_global->__pyx_n_s_MatType #define __pyx_kp_s_Matrix_SOR_type_See_Also_petsc_M __pyx_mstate_global->__pyx_kp_s_Matrix_SOR_type_See_Also_petsc_M #define __pyx_kp_s_Matrix_assembly_type_See_Also_pe __pyx_mstate_global->__pyx_kp_s_Matrix_assembly_type_See_Also_pe #define __pyx_kp_s_Matrix_duplicate_option_See_Also __pyx_mstate_global->__pyx_kp_s_Matrix_duplicate_option_See_Also #define __pyx_kp_s_Matrix_info_type __pyx_mstate_global->__pyx_kp_s_Matrix_info_type #define __pyx_kp_s_Matrix_modification_structure_Se __pyx_mstate_global->__pyx_kp_s_Matrix_modification_structure_Se #define __pyx_kp_s_Matrix_option_See_Also_petsc_Mat __pyx_mstate_global->__pyx_kp_s_Matrix_option_See_Also_petsc_Mat #define __pyx_kp_s_Matrix_type_See_Also_petsc_MatTy __pyx_mstate_global->__pyx_kp_s_Matrix_type_See_Also_petsc_MatTy #define __pyx_n_s_MemoryError __pyx_mstate_global->__pyx_n_s_MemoryError #define __pyx_kp_s_MemoryView_of_r_at_0x_x __pyx_mstate_global->__pyx_kp_s_MemoryView_of_r_at_0x_x #define __pyx_kp_s_MemoryView_of_r_object __pyx_mstate_global->__pyx_kp_s_MemoryView_of_r_object #define __pyx_n_s_MigrateType __pyx_mstate_global->__pyx_n_s_MigrateType #define __pyx_kp_s_Missing_input_parameters __pyx_mstate_global->__pyx_kp_s_Missing_input_parameters #define __pyx_n_s_Mode __pyx_mstate_global->__pyx_n_s_Mode #define __pyx_kp_s_More_constants_INFINITY_Very_la __pyx_mstate_global->__pyx_kp_s_More_constants_INFINITY_Very_la #define __pyx_kp_s_Must_provide_as_many_communicato __pyx_mstate_global->__pyx_kp_s_Must_provide_as_many_communicato #define __pyx_kp_s_Must_provide_both_sizes_and_poin __pyx_mstate_global->__pyx_kp_s_Must_provide_both_sizes_and_poin #define __pyx_kp_s_Must_provide_operator_for_USER_o __pyx_mstate_global->__pyx_kp_s_Must_provide_operator_for_USER_o #define __pyx_n_s_N1 __pyx_mstate_global->__pyx_n_s_N1 #define __pyx_n_s_N12 __pyx_mstate_global->__pyx_n_s_N12 #define __pyx_n_s_N2 __pyx_mstate_global->__pyx_n_s_N2 #define __pyx_n_s_NASH __pyx_mstate_global->__pyx_n_s_NASH #define __pyx_n_s_NASM __pyx_mstate_global->__pyx_n_s_NASM #define __pyx_n_s_NATIVE __pyx_mstate_global->__pyx_n_s_NATIVE #define __pyx_n_s_NATURAL __pyx_mstate_global->__pyx_n_s_NATURAL #define __pyx_n_s_NCG __pyx_mstate_global->__pyx_n_s_NCG #define __pyx_n_s_ND __pyx_mstate_global->__pyx_n_s_ND #define __pyx_n_s_ND_Pi __pyx_mstate_global->__pyx_n_s_ND_Pi #define __pyx_n_s_ND_Pi_Full __pyx_mstate_global->__pyx_n_s_ND_Pi_Full #define __pyx_n_s_NEIGHBOR __pyx_mstate_global->__pyx_n_s_NEIGHBOR #define __pyx_n_s_NEST __pyx_mstate_global->__pyx_n_s_NEST #define __pyx_n_s_NETWORK __pyx_mstate_global->__pyx_n_s_NETWORK #define __pyx_n_s_NEWTONLS __pyx_mstate_global->__pyx_n_s_NEWTONLS #define __pyx_n_s_NEWTONTR __pyx_mstate_global->__pyx_n_s_NEWTONTR #define __pyx_n_s_NEW_NONZERO_ALLOCATION_ERR __pyx_mstate_global->__pyx_n_s_NEW_NONZERO_ALLOCATION_ERR #define __pyx_n_s_NEW_NONZERO_LOCATIONS __pyx_mstate_global->__pyx_n_s_NEW_NONZERO_LOCATIONS #define __pyx_n_s_NEW_NONZERO_LOCATION_ERR __pyx_mstate_global->__pyx_n_s_NEW_NONZERO_LOCATION_ERR #define __pyx_n_s_NGMRES __pyx_mstate_global->__pyx_n_s_NGMRES #define __pyx_n_s_NGS __pyx_mstate_global->__pyx_n_s_NGS #define __pyx_n_s_NINFINITY __pyx_mstate_global->__pyx_n_s_NINFINITY #define __pyx_n_s_NLS __pyx_mstate_global->__pyx_n_s_NLS #define __pyx_n_s_NM __pyx_mstate_global->__pyx_n_s_NM #define __pyx_n_s_NN __pyx_mstate_global->__pyx_n_s_NN #define __pyx_n_s_NO __pyx_mstate_global->__pyx_n_s_NO #define __pyx_n_s_NOERROR __pyx_mstate_global->__pyx_n_s_NOERROR #define __pyx_n_s_NOFORMAT __pyx_mstate_global->__pyx_n_s_NOFORMAT #define __pyx_n_s_NONE __pyx_mstate_global->__pyx_n_s_NONE #define __pyx_n_s_NONLINEAR __pyx_mstate_global->__pyx_n_s_NONLINEAR #define __pyx_n_s_NONZERO __pyx_mstate_global->__pyx_n_s_NONZERO #define __pyx_n_s_NORMAL __pyx_mstate_global->__pyx_n_s_NORMAL #define __pyx_n_s_NORMALHERMITIAN __pyx_mstate_global->__pyx_n_s_NORMALHERMITIAN #define __pyx_n_s_NORM_1 __pyx_mstate_global->__pyx_n_s_NORM_1 #define __pyx_n_s_NORM_1_AND_2 __pyx_mstate_global->__pyx_n_s_NORM_1_AND_2 #define __pyx_n_s_NORM_2 __pyx_mstate_global->__pyx_n_s_NORM_2 #define __pyx_n_s_NORM_ALWAYS __pyx_mstate_global->__pyx_n_s_NORM_ALWAYS #define __pyx_n_s_NORM_DEFAULT __pyx_mstate_global->__pyx_n_s_NORM_DEFAULT #define __pyx_n_s_NORM_FINAL_ONLY __pyx_mstate_global->__pyx_n_s_NORM_FINAL_ONLY #define __pyx_n_s_NORM_FROBENIUS __pyx_mstate_global->__pyx_n_s_NORM_FROBENIUS #define __pyx_n_s_NORM_INFINITY __pyx_mstate_global->__pyx_n_s_NORM_INFINITY #define __pyx_n_s_NORM_INITIAL_FINAL_ONLY __pyx_mstate_global->__pyx_n_s_NORM_INITIAL_FINAL_ONLY #define __pyx_n_s_NORM_INITIAL_ONLY __pyx_mstate_global->__pyx_n_s_NORM_INITIAL_ONLY #define __pyx_n_s_NORM_MAX __pyx_mstate_global->__pyx_n_s_NORM_MAX #define __pyx_n_s_NORM_NATURAL __pyx_mstate_global->__pyx_n_s_NORM_NATURAL #define __pyx_n_s_NORM_NONE __pyx_mstate_global->__pyx_n_s_NORM_NONE #define __pyx_n_s_NORM_PRECONDITIONED __pyx_mstate_global->__pyx_n_s_NORM_PRECONDITIONED #define __pyx_n_s_NORM_UNPRECONDITIONED __pyx_mstate_global->__pyx_n_s_NORM_UNPRECONDITIONED #define __pyx_n_s_NOTSET __pyx_mstate_global->__pyx_n_s_NOTSET #define __pyx_n_s_NOT_SET_VALUES __pyx_mstate_global->__pyx_n_s_NOT_SET_VALUES #define __pyx_n_s_NO_OFF_PROC_ENTRIES __pyx_mstate_global->__pyx_n_s_NO_OFF_PROC_ENTRIES #define __pyx_n_s_NO_OFF_PROC_ZERO_ROWS __pyx_mstate_global->__pyx_n_s_NO_OFF_PROC_ZERO_ROWS #define __pyx_n_s_NO_SYNC __pyx_mstate_global->__pyx_n_s_NO_SYNC #define __pyx_n_s_NRICHARDSON __pyx_mstate_global->__pyx_n_s_NRICHARDSON #define __pyx_n_s_NTL __pyx_mstate_global->__pyx_n_s_NTL #define __pyx_n_s_NTR __pyx_mstate_global->__pyx_n_s_NTR #define __pyx_n_s_NULLLOC __pyx_mstate_global->__pyx_n_s_NULLLOC #define __pyx_n_s_NZ __pyx_mstate_global->__pyx_n_s_NZ #define __pyx_n_s_NormSchedule __pyx_mstate_global->__pyx_n_s_NormSchedule #define __pyx_n_s_NormType __pyx_mstate_global->__pyx_n_s_NormType #define __pyx_kp_s_Norm_type_Commonly_used_norm_typ __pyx_mstate_global->__pyx_kp_s_Norm_type_Commonly_used_norm_typ #define __pyx_n_s_NotImplemented __pyx_mstate_global->__pyx_n_s_NotImplemented #define __pyx_n_s_NotImplementedError __pyx_mstate_global->__pyx_n_s_NotImplementedError #define __pyx_kp_s_Not_for_rectangular_matrices __pyx_mstate_global->__pyx_kp_s_Not_for_rectangular_matrices #define __pyx_kp_s_Not_for_type __pyx_mstate_global->__pyx_kp_s_Not_for_type #define __pyx_n_s_NullSpace __pyx_mstate_global->__pyx_n_s_NullSpace #define __pyx_n_b_O __pyx_mstate_global->__pyx_n_b_O #define __pyx_n_s_ODE_EXPLICIT __pyx_mstate_global->__pyx_n_s_ODE_EXPLICIT #define __pyx_n_s_ODE_IMPLICIT __pyx_mstate_global->__pyx_n_s_ODE_IMPLICIT #define __pyx_n_s_OPENCL __pyx_mstate_global->__pyx_n_s_OPENCL #define __pyx_n_s_OPTION_MAX __pyx_mstate_global->__pyx_n_s_OPTION_MAX #define __pyx_n_s_OPTION_MIN __pyx_mstate_global->__pyx_n_s_OPTION_MIN #define __pyx_n_s_OWARMIJO __pyx_mstate_global->__pyx_n_s_OWARMIJO #define __pyx_n_s_OWD __pyx_mstate_global->__pyx_n_s_OWD #define __pyx_n_s_OWLQN __pyx_mstate_global->__pyx_n_s_OWLQN #define __pyx_n_s_Object __pyx_mstate_global->__pyx_n_s_Object #define __pyx_kp_s_Object_is_not_writable __pyx_mstate_global->__pyx_kp_s_Object_is_not_writable #define __pyx_n_s_Option __pyx_mstate_global->__pyx_n_s_Option #define __pyx_n_s_Options __pyx_mstate_global->__pyx_n_s_Options #define __pyx_n_s_OrderingType __pyx_mstate_global->__pyx_n_s_OrderingType #define __pyx_kp_u_Out_of_bounds_on_buffer_access_a __pyx_mstate_global->__pyx_kp_u_Out_of_bounds_on_buffer_access_a #define __pyx_kp_s_Out_of_memory_Allocated_d_Used_b __pyx_mstate_global->__pyx_kp_s_Out_of_memory_Allocated_d_Used_b #define __pyx_n_s_P __pyx_mstate_global->__pyx_n_s_P #define __pyx_n_s_P1 __pyx_mstate_global->__pyx_n_s_P1 #define __pyx_n_s_P4EST __pyx_mstate_global->__pyx_n_s_P4EST #define __pyx_n_s_P8EST __pyx_mstate_global->__pyx_n_s_P8EST #define __pyx_n_s_PARDECOMP __pyx_mstate_global->__pyx_n_s_PARDECOMP #define __pyx_n_s_PARMETIS __pyx_mstate_global->__pyx_n_s_PARMETIS #define __pyx_n_s_PARMS __pyx_mstate_global->__pyx_n_s_PARMS #define __pyx_n_s_PARTITIONINGAVERAGE __pyx_mstate_global->__pyx_n_s_PARTITIONINGAVERAGE #define __pyx_n_s_PARTITIONINGCHACO __pyx_mstate_global->__pyx_n_s_PARTITIONINGCHACO #define __pyx_n_s_PARTITIONINGCURRENT __pyx_mstate_global->__pyx_n_s_PARTITIONINGCURRENT #define __pyx_n_s_PARTITIONINGHIERARCH __pyx_mstate_global->__pyx_n_s_PARTITIONINGHIERARCH #define __pyx_n_s_PARTITIONINGPARMETIS __pyx_mstate_global->__pyx_n_s_PARTITIONINGPARMETIS #define __pyx_n_s_PARTITIONINGPARTY __pyx_mstate_global->__pyx_n_s_PARTITIONINGPARTY #define __pyx_n_s_PARTITIONINGPTSCOTCH __pyx_mstate_global->__pyx_n_s_PARTITIONINGPTSCOTCH #define __pyx_n_s_PARTITIONINGSQUARE __pyx_mstate_global->__pyx_n_s_PARTITIONINGSQUARE #define __pyx_n_s_PASTIX __pyx_mstate_global->__pyx_n_s_PASTIX #define __pyx_n_s_PATCH __pyx_mstate_global->__pyx_n_s_PATCH #define __pyx_n_s_PBJACOBI __pyx_mstate_global->__pyx_n_s_PBJACOBI #define __pyx_n_s_PC __pyx_mstate_global->__pyx_n_s_PC #define __pyx_n_s_PCASMType __pyx_mstate_global->__pyx_n_s_PCASMType #define __pyx_n_s_PCCompositeType __pyx_mstate_global->__pyx_n_s_PCCompositeType #define __pyx_n_s_PCDeflationSpaceType __pyx_mstate_global->__pyx_n_s_PCDeflationSpaceType #define __pyx_n_s_PCFailedReason __pyx_mstate_global->__pyx_n_s_PCFailedReason #define __pyx_n_s_PCFieldSplitSchurFactType __pyx_mstate_global->__pyx_n_s_PCFieldSplitSchurFactType #define __pyx_n_s_PCFieldSplitSchurPreType __pyx_mstate_global->__pyx_n_s_PCFieldSplitSchurPreType #define __pyx_n_s_PCGAMGType __pyx_mstate_global->__pyx_n_s_PCGAMGType #define __pyx_n_s_PCGASMType __pyx_mstate_global->__pyx_n_s_PCGASMType #define __pyx_n_s_PCGD __pyx_mstate_global->__pyx_n_s_PCGD #define __pyx_n_s_PCHPDDMCoarseCorrectionType __pyx_mstate_global->__pyx_n_s_PCHPDDMCoarseCorrectionType #define __pyx_n_s_PCMGCycleType __pyx_mstate_global->__pyx_n_s_PCMGCycleType #define __pyx_n_s_PCMGType __pyx_mstate_global->__pyx_n_s_PCMGType #define __pyx_n_s_PCPatchConstructType __pyx_mstate_global->__pyx_n_s_PCPatchConstructType #define __pyx_n_s_PCSide __pyx_mstate_global->__pyx_n_s_PCSide #define __pyx_n_s_PCType __pyx_mstate_global->__pyx_n_s_PCType #define __pyx_n_s_PD __pyx_mstate_global->__pyx_n_s_PD #define __pyx_n_s_PDIPM __pyx_mstate_global->__pyx_n_s_PDIPM #define __pyx_n_s_PERIODIC __pyx_mstate_global->__pyx_n_s_PERIODIC #define __pyx_n_s_PETSC __pyx_mstate_global->__pyx_n_s_PETSC #define __pyx_kp_s_PETSc_Error_Attributes_ierr_int __pyx_mstate_global->__pyx_kp_s_PETSc_Error_Attributes_ierr_int #define __pyx_kp_s_PETSc_Error_d __pyx_mstate_global->__pyx_kp_s_PETSc_Error_d #define __pyx_n_s_PFMG __pyx_mstate_global->__pyx_n_s_PFMG #define __pyx_n_s_PGMRES __pyx_mstate_global->__pyx_n_s_PGMRES #define __pyx_n_s_PIC __pyx_mstate_global->__pyx_n_s_PIC #define __pyx_n_s_PICLayoutType __pyx_mstate_global->__pyx_n_s_PICLayoutType #define __pyx_n_s_PINFINITY __pyx_mstate_global->__pyx_n_s_PINFINITY #define __pyx_n_s_PIPEBCGS __pyx_mstate_global->__pyx_n_s_PIPEBCGS #define __pyx_n_s_PIPECG __pyx_mstate_global->__pyx_n_s_PIPECG #define __pyx_n_s_PIPECG2 __pyx_mstate_global->__pyx_n_s_PIPECG2 #define __pyx_n_s_PIPECGRR __pyx_mstate_global->__pyx_n_s_PIPECGRR #define __pyx_n_s_PIPECR __pyx_mstate_global->__pyx_n_s_PIPECR #define __pyx_n_s_PIPEFCG __pyx_mstate_global->__pyx_n_s_PIPEFCG #define __pyx_n_s_PIPEFGMRES __pyx_mstate_global->__pyx_n_s_PIPEFGMRES #define __pyx_n_s_PIPEGCR __pyx_mstate_global->__pyx_n_s_PIPEGCR #define __pyx_n_s_PIPELCG __pyx_mstate_global->__pyx_n_s_PIPELCG #define __pyx_n_s_PIPEPRCG __pyx_mstate_global->__pyx_n_s_PIPEPRCG #define __pyx_n_s_PLEX __pyx_mstate_global->__pyx_n_s_PLEX #define __pyx_n_s_POINT __pyx_mstate_global->__pyx_n_s_POINT #define __pyx_n_s_POINT_PRISM_TENSOR __pyx_mstate_global->__pyx_n_s_POINT_PRISM_TENSOR #define __pyx_n_s_POLYNOMIAL __pyx_mstate_global->__pyx_n_s_POLYNOMIAL #define __pyx_n_s_POSITIVE_DEFINITE __pyx_mstate_global->__pyx_n_s_POSITIVE_DEFINITE #define __pyx_n_s_POUNDERS __pyx_mstate_global->__pyx_n_s_POUNDERS #define __pyx_n_s_PREALLOCATOR __pyx_mstate_global->__pyx_n_s_PREALLOCATOR #define __pyx_n_s_PRECONDITIONED __pyx_mstate_global->__pyx_n_s_PRECONDITIONED #define __pyx_n_s_PREONLY __pyx_mstate_global->__pyx_n_s_PREONLY #define __pyx_n_s_PRODUCT __pyx_mstate_global->__pyx_n_s_PRODUCT #define __pyx_n_s_PRP __pyx_mstate_global->__pyx_n_s_PRP #define __pyx_n_s_PRP_PLUS __pyx_mstate_global->__pyx_n_s_PRP_PLUS #define __pyx_n_s_PSEUDO __pyx_mstate_global->__pyx_n_s_PSEUDO #define __pyx_n_s_PTRIMMED __pyx_mstate_global->__pyx_n_s_PTRIMMED #define __pyx_n_s_PTSCOTCH __pyx_mstate_global->__pyx_n_s_PTSCOTCH #define __pyx_n_s_PYRAMID __pyx_mstate_global->__pyx_n_s_PYRAMID #define __pyx_n_s_PYTHON __pyx_mstate_global->__pyx_n_s_PYTHON #define __pyx_n_s_Partitioner __pyx_mstate_global->__pyx_n_s_Partitioner #define __pyx_n_s_PartitionerType __pyx_mstate_global->__pyx_n_s_PartitionerType #define __pyx_n_s_PatchConstructType __pyx_mstate_global->__pyx_n_s_PatchConstructType #define __pyx_n_s_PickleError __pyx_mstate_global->__pyx_n_s_PickleError #define __pyx_n_s_PolytopeType __pyx_mstate_global->__pyx_n_s_PolytopeType #define __pyx_kp_s_Portable_Extensible_Toolkit_for __pyx_mstate_global->__pyx_kp_s_Portable_Extensible_Toolkit_for #define __pyx_n_s_Print __pyx_mstate_global->__pyx_n_s_Print #define __pyx_n_s_ProblemType __pyx_mstate_global->__pyx_n_s_ProblemType #define __pyx_n_s_PtAP __pyx_mstate_global->__pyx_n_s_PtAP #define __pyx_n_s_Q0 __pyx_mstate_global->__pyx_n_s_Q0 #define __pyx_n_s_Q1 __pyx_mstate_global->__pyx_n_s_Q1 #define __pyx_n_s_QCG __pyx_mstate_global->__pyx_n_s_QCG #define __pyx_n_s_QMD __pyx_mstate_global->__pyx_n_s_QMD #define __pyx_n_s_QMRCGS __pyx_mstate_global->__pyx_n_s_QMRCGS #define __pyx_n_s_QN __pyx_mstate_global->__pyx_n_s_QN #define __pyx_n_s_QR __pyx_mstate_global->__pyx_n_s_QR #define __pyx_n_s_QUADRILATERAL __pyx_mstate_global->__pyx_n_s_QUADRILATERAL #define __pyx_n_s_QUAD_PRISM_TENSOR __pyx_mstate_global->__pyx_n_s_QUAD_PRISM_TENSOR #define __pyx_n_s_QUARTER __pyx_mstate_global->__pyx_n_s_QUARTER #define __pyx_n_s_QUARTER_SIZE __pyx_mstate_global->__pyx_n_s_QUARTER_SIZE #define __pyx_n_s_Quad __pyx_mstate_global->__pyx_n_s_Quad #define __pyx_n_s_R __pyx_mstate_global->__pyx_n_s_R #define __pyx_n_s_RADAU5 __pyx_mstate_global->__pyx_n_s_RADAU5 #define __pyx_n_s_RAND __pyx_mstate_global->__pyx_n_s_RAND #define __pyx_n_s_RAND48 __pyx_mstate_global->__pyx_n_s_RAND48 #define __pyx_n_s_RANDER48 __pyx_mstate_global->__pyx_n_s_RANDER48 #define __pyx_n_s_RANDOM123 __pyx_mstate_global->__pyx_n_s_RANDOM123 #define __pyx_n_s_RARt __pyx_mstate_global->__pyx_n_s_RARt #define __pyx_n_s_RCM __pyx_mstate_global->__pyx_n_s_RCM #define __pyx_n_s_READ __pyx_mstate_global->__pyx_n_s_READ #define __pyx_n_s_REDISTRIBUTE __pyx_mstate_global->__pyx_n_s_REDISTRIBUTE #define __pyx_n_s_REDUNDANT __pyx_mstate_global->__pyx_n_s_REDUNDANT #define __pyx_n_s_REFINE1D __pyx_mstate_global->__pyx_n_s_REFINE1D #define __pyx_n_s_REFINEALFELD __pyx_mstate_global->__pyx_n_s_REFINEALFELD #define __pyx_n_s_REFINEBOUNDARYLAYER __pyx_mstate_global->__pyx_n_s_REFINEBOUNDARYLAYER #define __pyx_n_s_REFINED __pyx_mstate_global->__pyx_n_s_REFINED #define __pyx_n_s_REFINEPOWELLSABIN __pyx_mstate_global->__pyx_n_s_REFINEPOWELLSABIN #define __pyx_n_s_REFINEREGULAR __pyx_mstate_global->__pyx_n_s_REFINEREGULAR #define __pyx_n_s_REFINESBR __pyx_mstate_global->__pyx_n_s_REFINESBR #define __pyx_n_s_REFINETOBOX __pyx_mstate_global->__pyx_n_s_REFINETOBOX #define __pyx_n_s_REFINETOSIMPLEX __pyx_mstate_global->__pyx_n_s_REFINETOSIMPLEX #define __pyx_n_s_RESTRICT __pyx_mstate_global->__pyx_n_s_RESTRICT #define __pyx_n_s_REVERSE __pyx_mstate_global->__pyx_n_s_REVERSE #define __pyx_n_s_REVERSE_LOCAL __pyx_mstate_global->__pyx_n_s_REVERSE_LOCAL #define __pyx_n_s_RICHARDSON __pyx_mstate_global->__pyx_n_s_RICHARDSON #define __pyx_n_s_RIGHT __pyx_mstate_global->__pyx_n_s_RIGHT #define __pyx_n_s_RK __pyx_mstate_global->__pyx_n_s_RK #define __pyx_n_s_RK1FE __pyx_mstate_global->__pyx_n_s_RK1FE #define __pyx_n_s_RK2A __pyx_mstate_global->__pyx_n_s_RK2A #define __pyx_n_s_RK2B __pyx_mstate_global->__pyx_n_s_RK2B #define __pyx_n_s_RK3 __pyx_mstate_global->__pyx_n_s_RK3 #define __pyx_n_s_RK3BS __pyx_mstate_global->__pyx_n_s_RK3BS #define __pyx_n_s_RK4 __pyx_mstate_global->__pyx_n_s_RK4 #define __pyx_n_s_RK5BS __pyx_mstate_global->__pyx_n_s_RK5BS #define __pyx_n_s_RK5DP __pyx_mstate_global->__pyx_n_s_RK5DP #define __pyx_n_s_RK5F __pyx_mstate_global->__pyx_n_s_RK5F #define __pyx_n_s_RK6VR __pyx_mstate_global->__pyx_n_s_RK6VR #define __pyx_n_s_RK7VR __pyx_mstate_global->__pyx_n_s_RK7VR #define __pyx_n_s_RK8VR __pyx_mstate_global->__pyx_n_s_RK8VR #define __pyx_n_s_RKType __pyx_mstate_global->__pyx_n_s_RKType #define __pyx_n_s_ROSW __pyx_mstate_global->__pyx_n_s_ROSW #define __pyx_n_s_ROWLENGTH __pyx_mstate_global->__pyx_n_s_ROWLENGTH #define __pyx_n_s_ROWSCALINGVIENNACL __pyx_mstate_global->__pyx_n_s_ROWSCALINGVIENNACL #define __pyx_n_s_ROW_ORIENTED __pyx_mstate_global->__pyx_n_s_ROW_ORIENTED #define __pyx_n_s_RT_Pi __pyx_mstate_global->__pyx_n_s_RT_Pi #define __pyx_n_s_RT_Pi_Full __pyx_mstate_global->__pyx_n_s_RT_Pi_Full #define __pyx_n_s_RUNGE_KUTTA __pyx_mstate_global->__pyx_n_s_RUNGE_KUTTA #define __pyx_n_s_Random __pyx_mstate_global->__pyx_n_s_Random #define __pyx_n_s_RandomType __pyx_mstate_global->__pyx_n_s_RandomType #define __pyx_n_s_RealType __pyx_mstate_global->__pyx_n_s_RealType #define __pyx_n_s_Reason __pyx_mstate_global->__pyx_n_s_Reason #define __pyx_n_s_ReorderDefaultFlag __pyx_mstate_global->__pyx_n_s_ReorderDefaultFlag #define __pyx_n_s_Right __pyx_mstate_global->__pyx_n_s_Right #define __pyx_n_s_RuntimeError __pyx_mstate_global->__pyx_n_s_RuntimeError #define __pyx_n_s_S __pyx_mstate_global->__pyx_n_s_S #define __pyx_n_s_SAME __pyx_mstate_global->__pyx_n_s_SAME #define __pyx_n_s_SAME_NONZERO_PATTERN __pyx_mstate_global->__pyx_n_s_SAME_NONZERO_PATTERN #define __pyx_n_s_SAME_NZ __pyx_mstate_global->__pyx_n_s_SAME_NZ #define __pyx_n_s_SAVIENNACL __pyx_mstate_global->__pyx_n_s_SAVIENNACL #define __pyx_n_s_SAWS __pyx_mstate_global->__pyx_n_s_SAWS #define __pyx_n_s_SBAIJ __pyx_mstate_global->__pyx_n_s_SBAIJ #define __pyx_n_s_SCALAPACK __pyx_mstate_global->__pyx_n_s_SCALAPACK #define __pyx_n_s_SCATTER __pyx_mstate_global->__pyx_n_s_SCATTER #define __pyx_n_s_SCATTER_FORWARD __pyx_mstate_global->__pyx_n_s_SCATTER_FORWARD #define __pyx_n_s_SCATTER_FORWARD_LOCAL __pyx_mstate_global->__pyx_n_s_SCATTER_FORWARD_LOCAL #define __pyx_n_s_SCATTER_REVERSE __pyx_mstate_global->__pyx_n_s_SCATTER_REVERSE #define __pyx_n_s_SCATTER_REVERSE_LOCAL __pyx_mstate_global->__pyx_n_s_SCATTER_REVERSE_LOCAL #define __pyx_n_s_SCHUR __pyx_mstate_global->__pyx_n_s_SCHUR #define __pyx_n_s_SCHURCOMPLEMENT __pyx_mstate_global->__pyx_n_s_SCHURCOMPLEMENT #define __pyx_n_s_SEGMENT __pyx_mstate_global->__pyx_n_s_SEGMENT #define __pyx_n_s_SEG_PRISM_TENSOR __pyx_mstate_global->__pyx_n_s_SEG_PRISM_TENSOR #define __pyx_n_s_SELF __pyx_mstate_global->__pyx_n_s_SELF #define __pyx_n_s_SELFP __pyx_mstate_global->__pyx_n_s_SELFP #define __pyx_n_s_SELL __pyx_mstate_global->__pyx_n_s_SELL #define __pyx_n_s_SEQ __pyx_mstate_global->__pyx_n_s_SEQ #define __pyx_n_s_SEQAIJ __pyx_mstate_global->__pyx_n_s_SEQAIJ #define __pyx_n_s_SEQAIJCRL __pyx_mstate_global->__pyx_n_s_SEQAIJCRL #define __pyx_n_s_SEQAIJCUSPARSE __pyx_mstate_global->__pyx_n_s_SEQAIJCUSPARSE #define __pyx_n_s_SEQAIJMKL __pyx_mstate_global->__pyx_n_s_SEQAIJMKL #define __pyx_n_s_SEQAIJPERM __pyx_mstate_global->__pyx_n_s_SEQAIJPERM #define __pyx_n_s_SEQAIJSELL __pyx_mstate_global->__pyx_n_s_SEQAIJSELL #define __pyx_n_s_SEQAIJVIENNACL __pyx_mstate_global->__pyx_n_s_SEQAIJVIENNACL #define __pyx_n_s_SEQBAIJ __pyx_mstate_global->__pyx_n_s_SEQBAIJ #define __pyx_n_s_SEQBAIJMKL __pyx_mstate_global->__pyx_n_s_SEQBAIJMKL #define __pyx_n_s_SEQCUDA __pyx_mstate_global->__pyx_n_s_SEQCUDA #define __pyx_n_s_SEQCUFFT __pyx_mstate_global->__pyx_n_s_SEQCUFFT #define __pyx_n_s_SEQDENSE __pyx_mstate_global->__pyx_n_s_SEQDENSE #define __pyx_n_s_SEQDENSECUDA __pyx_mstate_global->__pyx_n_s_SEQDENSECUDA #define __pyx_n_s_SEQHIP __pyx_mstate_global->__pyx_n_s_SEQHIP #define __pyx_n_s_SEQKAIJ __pyx_mstate_global->__pyx_n_s_SEQKAIJ #define __pyx_n_s_SEQKOKKOS __pyx_mstate_global->__pyx_n_s_SEQKOKKOS #define __pyx_n_s_SEQMAIJ __pyx_mstate_global->__pyx_n_s_SEQMAIJ #define __pyx_n_s_SEQSBAIJ __pyx_mstate_global->__pyx_n_s_SEQSBAIJ #define __pyx_n_s_SEQSELL __pyx_mstate_global->__pyx_n_s_SEQSELL #define __pyx_n_s_SEQVIENNACL __pyx_mstate_global->__pyx_n_s_SEQVIENNACL #define __pyx_n_s_SETUP_ERROR __pyx_mstate_global->__pyx_n_s_SETUP_ERROR #define __pyx_n_s_SF __pyx_mstate_global->__pyx_n_s_SF #define __pyx_n_s_SFType __pyx_mstate_global->__pyx_n_s_SFType #define __pyx_n_s_SHARED __pyx_mstate_global->__pyx_n_s_SHARED #define __pyx_n_s_SHARE_NONZERO_PATTERN __pyx_mstate_global->__pyx_n_s_SHARE_NONZERO_PATTERN #define __pyx_n_s_SHELL __pyx_mstate_global->__pyx_n_s_SHELL #define __pyx_n_s_SIMPLE __pyx_mstate_global->__pyx_n_s_SIMPLE #define __pyx_n_s_SLICED __pyx_mstate_global->__pyx_n_s_SLICED #define __pyx_n_s_SNES __pyx_mstate_global->__pyx_n_s_SNES #define __pyx_n_s_SNESConvergedReason __pyx_mstate_global->__pyx_n_s_SNESConvergedReason #define __pyx_n_s_SNESNormSchedule __pyx_mstate_global->__pyx_n_s_SNESNormSchedule #define __pyx_n_s_SNESType __pyx_mstate_global->__pyx_n_s_SNESType #define __pyx_kp_s_SNES_norm_schedule_See_Also_pets __pyx_mstate_global->__pyx_kp_s_SNES_norm_schedule_See_Also_pets #define __pyx_kp_s_SNES_solver_termination_reason_S __pyx_mstate_global->__pyx_kp_s_SNES_solver_termination_reason_S #define __pyx_kp_s_SNES_solver_type_See_Also_petsc __pyx_mstate_global->__pyx_kp_s_SNES_solver_type_See_Also_petsc #define __pyx_n_s_SOCKET __pyx_mstate_global->__pyx_n_s_SOCKET #define __pyx_n_s_SOR __pyx_mstate_global->__pyx_n_s_SOR #define __pyx_n_s_SORTED_FULL __pyx_mstate_global->__pyx_n_s_SORTED_FULL #define __pyx_n_s_SORType __pyx_mstate_global->__pyx_n_s_SORType #define __pyx_n_s_SPAI __pyx_mstate_global->__pyx_n_s_SPAI #define __pyx_n_s_SPD __pyx_mstate_global->__pyx_n_s_SPD #define __pyx_n_s_SPECIAL __pyx_mstate_global->__pyx_n_s_SPECIAL #define __pyx_n_s_SPECTRAL __pyx_mstate_global->__pyx_n_s_SPECTRAL #define __pyx_n_s_SPQR __pyx_mstate_global->__pyx_n_s_SPQR #define __pyx_n_s_SPRNG __pyx_mstate_global->__pyx_n_s_SPRNG #define __pyx_n_s_SSFLS __pyx_mstate_global->__pyx_n_s_SSFLS #define __pyx_n_s_SSILS __pyx_mstate_global->__pyx_n_s_SSILS #define __pyx_n_s_SSML_BFGS __pyx_mstate_global->__pyx_n_s_SSML_BFGS #define __pyx_n_s_SSML_BRDN __pyx_mstate_global->__pyx_n_s_SSML_BRDN #define __pyx_n_s_SSML_DFP __pyx_mstate_global->__pyx_n_s_SSML_DFP #define __pyx_n_s_SSP __pyx_mstate_global->__pyx_n_s_SSP #define __pyx_n_s_STAG __pyx_mstate_global->__pyx_n_s_STAG #define __pyx_n_s_STANDARD __pyx_mstate_global->__pyx_n_s_STANDARD #define __pyx_n_s_STAR __pyx_mstate_global->__pyx_n_s_STAR #define __pyx_n_s_STCG __pyx_mstate_global->__pyx_n_s_STCG #define __pyx_n_s_STDERR __pyx_mstate_global->__pyx_n_s_STDERR #define __pyx_n_s_STDOUT __pyx_mstate_global->__pyx_n_s_STDOUT #define __pyx_n_s_STEPOVER __pyx_mstate_global->__pyx_n_s_STEPOVER #define __pyx_n_s_STRIDE __pyx_mstate_global->__pyx_n_s_STRIDE #define __pyx_n_s_STRING __pyx_mstate_global->__pyx_n_s_STRING #define __pyx_n_s_STRUCTURALLY_SYMMETRIC __pyx_mstate_global->__pyx_n_s_STRUCTURALLY_SYMMETRIC #define __pyx_n_s_STRUCTURE_ONLY __pyx_mstate_global->__pyx_n_s_STRUCTURE_ONLY #define __pyx_n_s_STRUMPACK __pyx_mstate_global->__pyx_n_s_STRUMPACK #define __pyx_n_s_SUBMATRIX __pyx_mstate_global->__pyx_n_s_SUBMATRIX #define __pyx_n_s_SUBMAT_SINGLEIS __pyx_mstate_global->__pyx_n_s_SUBMAT_SINGLEIS #define __pyx_n_s_SUBPC_ERROR __pyx_mstate_global->__pyx_n_s_SUBPC_ERROR #define __pyx_n_s_SUBSET __pyx_mstate_global->__pyx_n_s_SUBSET #define __pyx_n_s_SUBSET_NONZERO_PATTERN __pyx_mstate_global->__pyx_n_s_SUBSET_NONZERO_PATTERN #define __pyx_n_s_SUBSET_NZ __pyx_mstate_global->__pyx_n_s_SUBSET_NZ #define __pyx_n_s_SUBSET_OFF_PROC_ENTRIES __pyx_mstate_global->__pyx_n_s_SUBSET_OFF_PROC_ENTRIES #define __pyx_n_s_SUBSPACE __pyx_mstate_global->__pyx_n_s_SUBSPACE #define __pyx_n_s_SUCCESS __pyx_mstate_global->__pyx_n_s_SUCCESS #define __pyx_n_s_SUCCESS_USER __pyx_mstate_global->__pyx_n_s_SUCCESS_USER #define __pyx_n_s_SUM __pyx_mstate_global->__pyx_n_s_SUM #define __pyx_n_s_SUNDIALS __pyx_mstate_global->__pyx_n_s_SUNDIALS #define __pyx_n_s_SUPERLU __pyx_mstate_global->__pyx_n_s_SUPERLU #define __pyx_n_s_SUPERLU_DIST __pyx_mstate_global->__pyx_n_s_SUPERLU_DIST #define __pyx_n_s_SVD __pyx_mstate_global->__pyx_n_s_SVD #define __pyx_n_s_SWARM __pyx_mstate_global->__pyx_n_s_SWARM #define __pyx_n_s_SYCL __pyx_mstate_global->__pyx_n_s_SYCL #define __pyx_n_s_SYMMETRIC __pyx_mstate_global->__pyx_n_s_SYMMETRIC #define __pyx_n_s_SYMMETRIC_MULTIPLICATIVE __pyx_mstate_global->__pyx_n_s_SYMMETRIC_MULTIPLICATIVE #define __pyx_n_s_SYMMETRY_ETERNAL __pyx_mstate_global->__pyx_n_s_SYMMETRY_ETERNAL #define __pyx_n_s_SYMMETRY_SWEEP __pyx_mstate_global->__pyx_n_s_SYMMETRY_SWEEP #define __pyx_n_s_SYMMLQ __pyx_mstate_global->__pyx_n_s_SYMMLQ #define __pyx_n_s_SYNC __pyx_mstate_global->__pyx_n_s_SYNC #define __pyx_n_s_SYSPFMG __pyx_mstate_global->__pyx_n_s_SYSPFMG #define __pyx_n_s_ScalarType __pyx_mstate_global->__pyx_n_s_ScalarType #define __pyx_n_s_Scatter __pyx_mstate_global->__pyx_n_s_Scatter #define __pyx_n_s_ScatterMode __pyx_mstate_global->__pyx_n_s_ScatterMode #define __pyx_n_s_ScatterType __pyx_mstate_global->__pyx_n_s_ScatterType #define __pyx_kp_s_Scatter_mode_Most_commonly_used __pyx_mstate_global->__pyx_kp_s_Scatter_mode_Most_commonly_used #define __pyx_kp_s_Scatter_type_See_Also_petsc_VecS __pyx_mstate_global->__pyx_kp_s_Scatter_type_See_Also_petsc_VecS #define __pyx_n_s_SchurFactType __pyx_mstate_global->__pyx_n_s_SchurFactType #define __pyx_n_s_SchurPreType __pyx_mstate_global->__pyx_n_s_SchurPreType #define __pyx_n_s_Section __pyx_mstate_global->__pyx_n_s_Section #define __pyx_n_s_Sequence __pyx_mstate_global->__pyx_n_s_Sequence #define __pyx_n_s_Side __pyx_mstate_global->__pyx_n_s_Side #define __pyx_n_s_Size __pyx_mstate_global->__pyx_n_s_Size #define __pyx_n_s_SolverType __pyx_mstate_global->__pyx_n_s_SolverType #define __pyx_n_s_Space __pyx_mstate_global->__pyx_n_s_Space #define __pyx_n_s_SpaceType __pyx_mstate_global->__pyx_n_s_SpaceType #define __pyx_n_s_Stage __pyx_mstate_global->__pyx_n_s_Stage #define __pyx_n_s_Stencil __pyx_mstate_global->__pyx_n_s_Stencil #define __pyx_n_s_StencilLocation __pyx_mstate_global->__pyx_n_s_StencilLocation #define __pyx_n_s_StencilType __pyx_mstate_global->__pyx_n_s_StencilType #define __pyx_kp_s_Step_may_not_be_zero_axis_d __pyx_mstate_global->__pyx_kp_s_Step_may_not_be_zero_axis_d #define __pyx_n_s_StreamType __pyx_mstate_global->__pyx_n_s_StreamType #define __pyx_n_s_Structure __pyx_mstate_global->__pyx_n_s_Structure #define __pyx_n_s_Sys __pyx_mstate_global->__pyx_n_s_Sys #define __pyx_n_s_SystemError __pyx_mstate_global->__pyx_n_s_SystemError #define __pyx_kp_b_T __pyx_mstate_global->__pyx_kp_b_T #define __pyx_n_s_TAO __pyx_mstate_global->__pyx_n_s_TAO #define __pyx_n_s_TAOBNCGType __pyx_mstate_global->__pyx_n_s_TAOBNCGType #define __pyx_n_s_TAOConvergedReason __pyx_mstate_global->__pyx_n_s_TAOConvergedReason #define __pyx_n_s_TAOLineSearch __pyx_mstate_global->__pyx_n_s_TAOLineSearch #define __pyx_n_s_TAOLineSearchConvergedReason __pyx_mstate_global->__pyx_n_s_TAOLineSearchConvergedReason #define __pyx_n_s_TAOLineSearchType __pyx_mstate_global->__pyx_n_s_TAOLineSearchType #define __pyx_n_s_TAOType __pyx_mstate_global->__pyx_n_s_TAOType #define __pyx_kp_s_TAO_Bound_Constrained_Conjugate __pyx_mstate_global->__pyx_kp_s_TAO_Bound_Constrained_Conjugate #define __pyx_kp_s_TAO_Line_Search_Termination_Reas __pyx_mstate_global->__pyx_kp_s_TAO_Line_Search_Termination_Reas #define __pyx_kp_s_TAO_Line_Search_Types __pyx_mstate_global->__pyx_kp_s_TAO_Line_Search_Types #define __pyx_kp_s_TAO_solver_termination_reason_Se __pyx_mstate_global->__pyx_kp_s_TAO_solver_termination_reason_Se #define __pyx_kp_s_TAO_solver_type_See_Also_petsc_T __pyx_mstate_global->__pyx_kp_s_TAO_solver_type_See_Also_petsc_T #define __pyx_n_s_TCQMR __pyx_mstate_global->__pyx_n_s_TCQMR #define __pyx_n_s_TELESCOPE __pyx_mstate_global->__pyx_n_s_TELESCOPE #define __pyx_n_s_TENSOR __pyx_mstate_global->__pyx_n_s_TENSOR #define __pyx_n_s_TETRAHEDRON __pyx_mstate_global->__pyx_n_s_TETRAHEDRON #define __pyx_n_s_TFQMR __pyx_mstate_global->__pyx_n_s_TFQMR #define __pyx_n_s_TFS __pyx_mstate_global->__pyx_n_s_TFS #define __pyx_n_s_TH __pyx_mstate_global->__pyx_n_s_TH #define __pyx_n_s_THETA __pyx_mstate_global->__pyx_n_s_THETA #define __pyx_n_s_THIRD __pyx_mstate_global->__pyx_n_s_THIRD #define __pyx_n_s_THIRD_SIZE __pyx_mstate_global->__pyx_n_s_THIRD_SIZE #define __pyx_n_s_TRANSFORMFILTER __pyx_mstate_global->__pyx_n_s_TRANSFORMFILTER #define __pyx_n_s_TRANSPOSE __pyx_mstate_global->__pyx_n_s_TRANSPOSE #define __pyx_n_s_TRIANGLE __pyx_mstate_global->__pyx_n_s_TRIANGLE #define __pyx_n_s_TRI_PRISM __pyx_mstate_global->__pyx_n_s_TRI_PRISM #define __pyx_n_s_TRI_PRISM_TENSOR __pyx_mstate_global->__pyx_n_s_TRI_PRISM_TENSOR #define __pyx_n_s_TRON __pyx_mstate_global->__pyx_n_s_TRON #define __pyx_n_s_TRUE __pyx_mstate_global->__pyx_n_s_TRUE #define __pyx_n_s_TS __pyx_mstate_global->__pyx_n_s_TS #define __pyx_n_s_TSARKIMEXType __pyx_mstate_global->__pyx_n_s_TSARKIMEXType #define __pyx_n_s_TSConvergedReason __pyx_mstate_global->__pyx_n_s_TSConvergedReason #define __pyx_n_s_TSDIRKType __pyx_mstate_global->__pyx_n_s_TSDIRKType #define __pyx_n_s_TSEquationType __pyx_mstate_global->__pyx_n_s_TSEquationType #define __pyx_n_s_TSExactFinalTime __pyx_mstate_global->__pyx_n_s_TSExactFinalTime #define __pyx_n_s_TSIRM __pyx_mstate_global->__pyx_n_s_TSIRM #define __pyx_n_s_TSProblemType __pyx_mstate_global->__pyx_n_s_TSProblemType #define __pyx_n_s_TSRKType __pyx_mstate_global->__pyx_n_s_TSRKType #define __pyx_n_s_TSType __pyx_mstate_global->__pyx_n_s_TSType #define __pyx_n_s_TWIST __pyx_mstate_global->__pyx_n_s_TWIST #define __pyx_n_s_T_2 __pyx_mstate_global->__pyx_n_s_T_2 #define __pyx_kp_s_Tensor_dtype_does_not_match_PETS __pyx_mstate_global->__pyx_kp_s_Tensor_dtype_does_not_match_PETS #define __pyx_kp_s_The_ARKIMEX_subtype __pyx_mstate_global->__pyx_kp_s_The_ARKIMEX_subtype #define __pyx_kp_s_The_ASM_subtype __pyx_mstate_global->__pyx_kp_s_The_ASM_subtype #define __pyx_kp_s_The_DIRK_subtype __pyx_mstate_global->__pyx_kp_s_The_DIRK_subtype #define __pyx_kp_s_The_GAMG_subtype __pyx_mstate_global->__pyx_kp_s_The_GAMG_subtype #define __pyx_kp_s_The_GASM_subtype __pyx_mstate_global->__pyx_kp_s_The_GASM_subtype #define __pyx_kp_s_The_HPDDM_Krylov_solver_type __pyx_mstate_global->__pyx_kp_s_The_HPDDM_Krylov_solver_type #define __pyx_kp_s_The_HPDDM_coarse_correction_type __pyx_mstate_global->__pyx_kp_s_The_HPDDM_coarse_correction_type #define __pyx_kp_s_The_MG_cycle_type __pyx_mstate_global->__pyx_kp_s_The_MG_cycle_type #define __pyx_kp_s_The_MG_subtype __pyx_mstate_global->__pyx_kp_s_The_MG_subtype #define __pyx_kp_s_The_RK_subtype __pyx_mstate_global->__pyx_kp_s_The_RK_subtype #define __pyx_kp_s_The_composite_type __pyx_mstate_global->__pyx_kp_s_The_composite_type #define __pyx_kp_s_The_deflation_space_subtype __pyx_mstate_global->__pyx_kp_s_The_deflation_space_subtype #define __pyx_kp_s_The_field_split_Schur_factorizat __pyx_mstate_global->__pyx_kp_s_The_field_split_Schur_factorizat #define __pyx_kp_s_The_field_split_Schur_subtype __pyx_mstate_global->__pyx_kp_s_The_field_split_Schur_subtype #define __pyx_kp_s_The_manner_in_which_the_precondi __pyx_mstate_global->__pyx_kp_s_The_manner_in_which_the_precondi #define __pyx_kp_s_The_method_for_ending_time_stepp __pyx_mstate_global->__pyx_kp_s_The_method_for_ending_time_stepp #define __pyx_kp_s_The_patch_construction_type __pyx_mstate_global->__pyx_kp_s_The_patch_construction_type #define __pyx_kp_s_The_preconditioner_method __pyx_mstate_global->__pyx_kp_s_The_preconditioner_method #define __pyx_kp_s_The_random_number_generator_type __pyx_mstate_global->__pyx_kp_s_The_random_number_generator_type #define __pyx_kp_s_The_reason_the_preconditioner_ha __pyx_mstate_global->__pyx_kp_s_The_reason_the_preconditioner_ha #define __pyx_kp_s_The_reason_the_time_step_is_conv __pyx_mstate_global->__pyx_kp_s_The_reason_the_time_step_is_conv #define __pyx_kp_s_The_time_stepping_method __pyx_mstate_global->__pyx_kp_s_The_time_stepping_method #define __pyx_kp_s_The_type_of_device_See_Also_Devi __pyx_mstate_global->__pyx_kp_s_The_type_of_device_See_Also_Devi #define __pyx_kp_s_The_type_of_join_to_perform_See __pyx_mstate_global->__pyx_kp_s_The_type_of_join_to_perform_See #define __pyx_kp_s_The_type_of_stream_See_Also_Devi __pyx_mstate_global->__pyx_kp_s_The_type_of_stream_See_Also_Devi #define __pyx_kp_s_The_vector_type __pyx_mstate_global->__pyx_kp_s_The_vector_type #define __pyx_n_s_Type __pyx_mstate_global->__pyx_n_s_Type #define __pyx_n_s_TypeError __pyx_mstate_global->__pyx_n_s_TypeError #define __pyx_n_s_U __pyx_mstate_global->__pyx_n_s_U #define __pyx_n_s_UA __pyx_mstate_global->__pyx_n_s_UA #define __pyx_n_s_UMFPACK __pyx_mstate_global->__pyx_n_s_UMFPACK #define __pyx_n_s_UNIT __pyx_mstate_global->__pyx_n_s_UNIT #define __pyx_n_s_UNKNOWN __pyx_mstate_global->__pyx_n_s_UNKNOWN #define __pyx_n_s_UNKNOWN_NONZERO_PATTERN __pyx_mstate_global->__pyx_n_s_UNKNOWN_NONZERO_PATTERN #define __pyx_n_s_UNKNOWN_NZ __pyx_mstate_global->__pyx_n_s_UNKNOWN_NZ #define __pyx_n_s_UNPRECONDITIONED __pyx_mstate_global->__pyx_n_s_UNPRECONDITIONED #define __pyx_n_s_UNSPECIFIED __pyx_mstate_global->__pyx_n_s_UNSPECIFIED #define __pyx_n_s_UNUSED_NONZERO_LOCATION_ERR __pyx_mstate_global->__pyx_n_s_UNUSED_NONZERO_LOCATION_ERR #define __pyx_n_s_UP __pyx_mstate_global->__pyx_n_s_UP #define __pyx_n_s_UPDATE __pyx_mstate_global->__pyx_n_s_UPDATE #define __pyx_n_s_UPPER __pyx_mstate_global->__pyx_n_s_UPPER #define __pyx_n_s_UP_LEFT __pyx_mstate_global->__pyx_n_s_UP_LEFT #define __pyx_n_s_UP_RIGHT __pyx_mstate_global->__pyx_n_s_UP_RIGHT #define __pyx_n_s_USER __pyx_mstate_global->__pyx_n_s_USER #define __pyx_n_s_USE_HASH_TABLE __pyx_mstate_global->__pyx_n_s_USE_HASH_TABLE #define __pyx_n_s_USE_INODES __pyx_mstate_global->__pyx_n_s_USE_INODES #define __pyx_kp_s_Unable_to_convert_item_to_object __pyx_mstate_global->__pyx_kp_s_Unable_to_convert_item_to_object #define __pyx_kp_s_Unsupported_PetscScalar_type __pyx_mstate_global->__pyx_kp_s_Unsupported_PetscScalar_type #define __pyx_n_s_V __pyx_mstate_global->__pyx_n_s_V #define __pyx_n_s_VANKA __pyx_mstate_global->__pyx_n_s_VANKA #define __pyx_n_s_VIENNACL __pyx_mstate_global->__pyx_n_s_VIENNACL #define __pyx_n_s_VINEWTONRSLS __pyx_mstate_global->__pyx_n_s_VINEWTONRSLS #define __pyx_n_s_VINEWTONSSLS __pyx_mstate_global->__pyx_n_s_VINEWTONSSLS #define __pyx_n_s_VPBJACOBI __pyx_mstate_global->__pyx_n_s_VPBJACOBI #define __pyx_n_s_VTK __pyx_mstate_global->__pyx_n_s_VTK #define __pyx_n_s_VTK_VTR __pyx_mstate_global->__pyx_n_s_VTK_VTR #define __pyx_n_s_VTK_VTS __pyx_mstate_global->__pyx_n_s_VTK_VTS #define __pyx_n_s_VTK_VTU __pyx_mstate_global->__pyx_n_s_VTK_VTU #define __pyx_n_s_VU __pyx_mstate_global->__pyx_n_s_VU #define __pyx_n_s_ValueError __pyx_mstate_global->__pyx_n_s_ValueError #define __pyx_n_s_Vec __pyx_mstate_global->__pyx_n_s_Vec #define __pyx_n_s_VecOption __pyx_mstate_global->__pyx_n_s_VecOption #define __pyx_n_s_VecType __pyx_mstate_global->__pyx_n_s_VecType #define __pyx_n_s_Vec_LocalForm __pyx_mstate_global->__pyx_n_s_Vec_LocalForm #define __pyx_n_s_Vec_buffer __pyx_mstate_global->__pyx_n_s_Vec_buffer #define __pyx_kp_s_Vector_assembly_option __pyx_mstate_global->__pyx_kp_s_Vector_assembly_option #define __pyx_kp_s_Vector_local_size_d_is_not_compa __pyx_mstate_global->__pyx_kp_s_Vector_local_size_d_is_not_compa #define __pyx_n_s_View_MemoryView __pyx_mstate_global->__pyx_n_s_View_MemoryView #define __pyx_n_s_Viewer __pyx_mstate_global->__pyx_n_s_Viewer #define __pyx_n_s_ViewerDrawSize __pyx_mstate_global->__pyx_n_s_ViewerDrawSize #define __pyx_n_s_ViewerFileMode __pyx_mstate_global->__pyx_n_s_ViewerFileMode #define __pyx_n_s_ViewerFormat __pyx_mstate_global->__pyx_n_s_ViewerFormat #define __pyx_n_s_ViewerHDF5 __pyx_mstate_global->__pyx_n_s_ViewerHDF5 #define __pyx_n_s_ViewerType __pyx_mstate_global->__pyx_n_s_ViewerType #define __pyx_kp_s_Viewer_file_mode __pyx_mstate_global->__pyx_kp_s_Viewer_file_mode #define __pyx_kp_s_Viewer_format __pyx_mstate_global->__pyx_kp_s_Viewer_format #define __pyx_kp_s_Viewer_type __pyx_mstate_global->__pyx_kp_s_Viewer_type #define __pyx_n_s_W __pyx_mstate_global->__pyx_n_s_W #define __pyx_n_s_WBM __pyx_mstate_global->__pyx_n_s_WBM #define __pyx_n_s_WINDOW __pyx_mstate_global->__pyx_n_s_WINDOW #define __pyx_n_s_WRITE __pyx_mstate_global->__pyx_n_s_WRITE #define __pyx_n_s_WXY __pyx_mstate_global->__pyx_n_s_WXY #define __pyx_kp_s_Window_size __pyx_mstate_global->__pyx_kp_s_Window_size #define __pyx_n_s_X __pyx_mstate_global->__pyx_n_s_X #define __pyx_n_s_ZERO_INITIAL_GUESS __pyx_mstate_global->__pyx_n_s_ZERO_INITIAL_GUESS #define __pyx_kp_b__10 __pyx_mstate_global->__pyx_kp_b__10 #define __pyx_kp_s__10 __pyx_mstate_global->__pyx_kp_s__10 #define __pyx_kp_b__11 __pyx_mstate_global->__pyx_kp_b__11 #define __pyx_kp_s__11 __pyx_mstate_global->__pyx_kp_s__11 #define __pyx_kp_b__12 __pyx_mstate_global->__pyx_kp_b__12 #define __pyx_kp_u__13 __pyx_mstate_global->__pyx_kp_u__13 #define __pyx_kp_s__14 __pyx_mstate_global->__pyx_kp_s__14 #define __pyx_kp_u__14 __pyx_mstate_global->__pyx_kp_u__14 #define __pyx_kp_s__16 __pyx_mstate_global->__pyx_kp_s__16 #define __pyx_kp_b__18 __pyx_mstate_global->__pyx_kp_b__18 #define __pyx_kp_s__18 __pyx_mstate_global->__pyx_kp_s__18 #define __pyx_kp_s__2 __pyx_mstate_global->__pyx_kp_s__2 #define __pyx_kp_u__2 __pyx_mstate_global->__pyx_kp_u__2 #define __pyx_n_s__257 __pyx_mstate_global->__pyx_n_s__257 #define __pyx_kp_s__26 __pyx_mstate_global->__pyx_kp_s__26 #define __pyx_n_s__3 __pyx_mstate_global->__pyx_n_s__3 #define __pyx_kp_u__6 __pyx_mstate_global->__pyx_kp_u__6 #define __pyx_kp_u__7 __pyx_mstate_global->__pyx_kp_u__7 #define __pyx_kp_b__9 __pyx_mstate_global->__pyx_kp_b__9 #define __pyx_n_s_a __pyx_mstate_global->__pyx_n_s_a #define __pyx_kp_s_a_2 __pyx_mstate_global->__pyx_kp_s_a_2 #define __pyx_n_s_a_max __pyx_mstate_global->__pyx_n_s_a_max #define __pyx_n_s_abc __pyx_mstate_global->__pyx_n_s_abc #define __pyx_n_s_abort __pyx_mstate_global->__pyx_n_s_abort #define __pyx_kp_s_accessing_non_existent_buffer_se __pyx_mstate_global->__pyx_kp_s_accessing_non_existent_buffer_se #define __pyx_n_s_adaptStep __pyx_mstate_global->__pyx_n_s_adaptStep #define __pyx_n_s_addFlops __pyx_mstate_global->__pyx_n_s_addFlops #define __pyx_n_s_addv __pyx_mstate_global->__pyx_n_s_addv #define __pyx_n_s_adj __pyx_mstate_global->__pyx_n_s_adj #define __pyx_n_s_adjoint_steps __pyx_mstate_global->__pyx_n_s_adjoint_steps #define __pyx_n_s_allocate_buffer __pyx_mstate_global->__pyx_n_s_allocate_buffer #define __pyx_n_s_alpha __pyx_mstate_global->__pyx_n_s_alpha #define __pyx_n_s_alpha2 __pyx_mstate_global->__pyx_n_s_alpha2 #define __pyx_n_s_alpha_f __pyx_mstate_global->__pyx_n_s_alpha_f #define __pyx_n_s_alpha_m __pyx_mstate_global->__pyx_n_s_alpha_m #define __pyx_n_s_alphas __pyx_mstate_global->__pyx_n_s_alphas #define __pyx_n_s_amount __pyx_mstate_global->__pyx_n_s_amount #define __pyx_kp_u_and __pyx_mstate_global->__pyx_kp_u_and #define __pyx_n_s_app __pyx_mstate_global->__pyx_n_s_app #define __pyx_n_s_appctx __pyx_mstate_global->__pyx_n_s_appctx #define __pyx_n_s_append __pyx_mstate_global->__pyx_n_s_append #define __pyx_n_s_apply __pyx_mstate_global->__pyx_n_s_apply #define __pyx_n_s_applySymmetricLeft __pyx_mstate_global->__pyx_n_s_applySymmetricLeft #define __pyx_n_s_applySymmetricRight __pyx_mstate_global->__pyx_n_s_applySymmetricRight #define __pyx_n_s_applyTranspose __pyx_mstate_global->__pyx_n_s_applyTranspose #define __pyx_n_s_args __pyx_mstate_global->__pyx_n_s_args #define __pyx_n_s_array __pyx_mstate_global->__pyx_n_s_array #define __pyx_n_s_array_interface __pyx_mstate_global->__pyx_n_s_array_interface #define __pyx_kp_s_array_size_d_and_vector_local_si __pyx_mstate_global->__pyx_kp_s_array_size_d_and_vector_local_si #define __pyx_kp_s_array_size_d_incompatible_with_v __pyx_mstate_global->__pyx_kp_s_array_size_d_incompatible_with_v #define __pyx_n_s_array_w __pyx_mstate_global->__pyx_n_s_array_w #define __pyx_n_s_asmtype __pyx_mstate_global->__pyx_n_s_asmtype #define __pyx_n_s_assemblies __pyx_mstate_global->__pyx_n_s_assemblies #define __pyx_n_s_assembly __pyx_mstate_global->__pyx_n_s_assembly #define __pyx_n_s_assemblyBegin __pyx_mstate_global->__pyx_n_s_assemblyBegin #define __pyx_n_s_assemblyEnd __pyx_mstate_global->__pyx_n_s_assemblyEnd #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines #define __pyx_n_s_atexit __pyx_mstate_global->__pyx_n_s_atexit #define __pyx_n_s_atol __pyx_mstate_global->__pyx_n_s_atol #define __pyx_n_s_attr __pyx_mstate_global->__pyx_n_s_attr #define __pyx_n_s_au __pyx_mstate_global->__pyx_n_s_au #define __pyx_n_s_author __pyx_mstate_global->__pyx_n_s_author #define __pyx_n_s_authorinfo __pyx_mstate_global->__pyx_n_s_authorinfo #define __pyx_n_s_aux __pyx_mstate_global->__pyx_n_s_aux #define __pyx_n_s_axpy __pyx_mstate_global->__pyx_n_s_axpy #define __pyx_n_s_b __pyx_mstate_global->__pyx_n_s_b #define __pyx_n_s_back __pyx_mstate_global->__pyx_n_s_back #define __pyx_n_s_back_down __pyx_mstate_global->__pyx_n_s_back_down #define __pyx_n_s_back_down_left __pyx_mstate_global->__pyx_n_s_back_down_left #define __pyx_n_s_back_down_right __pyx_mstate_global->__pyx_n_s_back_down_right #define __pyx_n_s_back_left __pyx_mstate_global->__pyx_n_s_back_left #define __pyx_n_s_back_right __pyx_mstate_global->__pyx_n_s_back_right #define __pyx_n_s_back_up __pyx_mstate_global->__pyx_n_s_back_up #define __pyx_n_s_back_up_left __pyx_mstate_global->__pyx_n_s_back_up_left #define __pyx_n_s_back_up_right __pyx_mstate_global->__pyx_n_s_back_up_right #define __pyx_n_s_barrier __pyx_mstate_global->__pyx_n_s_barrier #define __pyx_n_s_base __pyx_mstate_global->__pyx_n_s_base #define __pyx_n_s_batchSize __pyx_mstate_global->__pyx_n_s_batchSize #define __pyx_n_s_bcComps __pyx_mstate_global->__pyx_n_s_bcComps #define __pyx_n_s_bcField __pyx_mstate_global->__pyx_n_s_bcField #define __pyx_n_s_bcPoints __pyx_mstate_global->__pyx_n_s_bcPoints #define __pyx_kp_s_bcPoints_is_a_required_argument __pyx_mstate_global->__pyx_kp_s_bcPoints_is_a_required_argument #define __pyx_n_s_bdLabel __pyx_mstate_global->__pyx_n_s_bdLabel #define __pyx_n_s_bdlabel __pyx_mstate_global->__pyx_n_s_bdlabel #define __pyx_n_s_bdvalue __pyx_mstate_global->__pyx_n_s_bdvalue #define __pyx_n_s_begin __pyx_mstate_global->__pyx_n_s_begin #define __pyx_n_s_begin_args __pyx_mstate_global->__pyx_n_s_begin_args #define __pyx_n_s_begin_kargs __pyx_mstate_global->__pyx_n_s_begin_kargs #define __pyx_n_s_beta __pyx_mstate_global->__pyx_n_s_beta #define __pyx_n_s_bits __pyx_mstate_global->__pyx_n_s_bits #define __pyx_n_s_blockSize __pyx_mstate_global->__pyx_n_s_blockSize #define __pyx_n_s_block_size __pyx_mstate_global->__pyx_n_s_block_size #define __pyx_kp_s_block_size_d_must_be_positive __pyx_mstate_global->__pyx_kp_s_block_size_d_must_be_positive #define __pyx_kp_s_block_size_not_set __pyx_mstate_global->__pyx_kp_s_block_size_not_set #define __pyx_n_s_blocksize __pyx_mstate_global->__pyx_n_s_blocksize #define __pyx_n_s_bndr __pyx_mstate_global->__pyx_n_s_bndr #define __pyx_n_s_bool __pyx_mstate_global->__pyx_n_s_bool #define __pyx_n_s_boundary __pyx_mstate_global->__pyx_n_s_boundary #define __pyx_n_s_boundary_type __pyx_mstate_global->__pyx_n_s_boundary_type #define __pyx_n_s_boundary_types __pyx_mstate_global->__pyx_n_s_boundary_types #define __pyx_n_s_box __pyx_mstate_global->__pyx_n_s_box #define __pyx_n_s_bs __pyx_mstate_global->__pyx_n_s_bs #define __pyx_n_s_bsize __pyx_mstate_global->__pyx_n_s_bsize #define __pyx_n_s_buffer __pyx_mstate_global->__pyx_n_s_buffer #define __pyx_n_s_buffer_w __pyx_mstate_global->__pyx_n_s_buffer_w #define __pyx_n_s_buildResidual __pyx_mstate_global->__pyx_n_s_buildResidual #define __pyx_n_s_buildSolution __pyx_mstate_global->__pyx_n_s_buildSolution #define __pyx_n_s_builtins __pyx_mstate_global->__pyx_n_s_builtins #define __pyx_n_s_c __pyx_mstate_global->__pyx_n_s_c #define __pyx_n_u_c __pyx_mstate_global->__pyx_n_u_c #define __pyx_kp_s_c_d __pyx_mstate_global->__pyx_kp_s_c_d #define __pyx_n_s_cancelMonitor __pyx_mstate_global->__pyx_n_s_cancelMonitor #define __pyx_kp_s_cannot_place_input_array_size_d __pyx_mstate_global->__pyx_kp_s_cannot_place_input_array_size_d #define __pyx_n_s_catol __pyx_mstate_global->__pyx_n_s_catol #define __pyx_n_s_ccomm __pyx_mstate_global->__pyx_n_s_ccomm #define __pyx_n_s_cdctx __pyx_mstate_global->__pyx_n_s_cdctx #define __pyx_n_s_cdevice_type __pyx_mstate_global->__pyx_n_s_cdevice_type #define __pyx_n_s_cell __pyx_mstate_global->__pyx_n_s_cell #define __pyx_n_s_cellNodeMaps __pyx_mstate_global->__pyx_n_s_cellNodeMaps #define __pyx_kp_s_cell_indices_must_have_two_dimen __pyx_mstate_global->__pyx_kp_s_cell_indices_must_have_two_dimen #define __pyx_n_s_cells __pyx_mstate_global->__pyx_n_s_cells #define __pyx_n_s_cg_type __pyx_mstate_global->__pyx_n_s_cg_type #define __pyx_n_s_cgid __pyx_mstate_global->__pyx_n_s_cgid #define __pyx_n_s_citation __pyx_mstate_global->__pyx_n_s_citation #define __pyx_n_s_class __pyx_mstate_global->__pyx_n_s_class #define __pyx_n_s_class_getitem __pyx_mstate_global->__pyx_n_s_class_getitem #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback #define __pyx_n_s_cmap __pyx_mstate_global->__pyx_n_s_cmap #define __pyx_n_s_cnorm __pyx_mstate_global->__pyx_n_s_cnorm #define __pyx_n_s_coarsen __pyx_mstate_global->__pyx_n_s_coarsen #define __pyx_n_s_coarsenhook __pyx_mstate_global->__pyx_n_s_coarsenhook #define __pyx_n_s_code __pyx_mstate_global->__pyx_n_s_code #define __pyx_n_s_col __pyx_mstate_global->__pyx_n_s_col #define __pyx_n_s_col_bsize __pyx_mstate_global->__pyx_n_s_col_bsize #define __pyx_n_s_collections __pyx_mstate_global->__pyx_n_s_collections #define __pyx_kp_s_collections_abc __pyx_mstate_global->__pyx_kp_s_collections_abc #define __pyx_n_s_cols __pyx_mstate_global->__pyx_n_s_cols #define __pyx_n_s_column __pyx_mstate_global->__pyx_n_s_column #define __pyx_kp_s_column_indices_must_have_two_dim __pyx_mstate_global->__pyx_kp_s_column_indices_must_have_two_dim #define __pyx_n_s_comm __pyx_mstate_global->__pyx_n_s_comm #define __pyx_n_s_comms __pyx_mstate_global->__pyx_n_s_comms #define __pyx_kp_s_communicator_not_owned __pyx_mstate_global->__pyx_kp_s_communicator_not_owned #define __pyx_n_s_comp __pyx_mstate_global->__pyx_n_s_comp #define __pyx_n_s_compile __pyx_mstate_global->__pyx_n_s_compile #define __pyx_n_s_compressed __pyx_mstate_global->__pyx_n_s_compressed #define __pyx_n_s_concatenate __pyx_mstate_global->__pyx_n_s_concatenate #define __pyx_n_s_cone __pyx_mstate_global->__pyx_n_s_cone #define __pyx_n_s_coneOrientation __pyx_mstate_global->__pyx_n_s_coneOrientation #define __pyx_n_s_conePoint __pyx_mstate_global->__pyx_n_s_conePoint #define __pyx_n_s_conePos __pyx_mstate_global->__pyx_n_s_conePos #define __pyx_n_s_conforming __pyx_mstate_global->__pyx_n_s_conforming #define __pyx_n_s_conjugate __pyx_mstate_global->__pyx_n_s_conjugate #define __pyx_n_s_constant __pyx_mstate_global->__pyx_n_s_constant #define __pyx_n_s_constraints __pyx_mstate_global->__pyx_n_s_constraints #define __pyx_n_s_context __pyx_mstate_global->__pyx_n_s_context #define __pyx_kp_s_contiguous_and_direct __pyx_mstate_global->__pyx_kp_s_contiguous_and_direct #define __pyx_kp_s_contiguous_and_indirect __pyx_mstate_global->__pyx_kp_s_contiguous_and_indirect #define __pyx_n_s_continuous __pyx_mstate_global->__pyx_n_s_continuous #define __pyx_n_s_converged __pyx_mstate_global->__pyx_n_s_converged #define __pyx_n_s_coordinates __pyx_mstate_global->__pyx_n_s_coordinates #define __pyx_kp_s_coordinates_must_have_two_dimens __pyx_mstate_global->__pyx_kp_s_coordinates_must_have_two_dimens #define __pyx_kp_s_coordinates_size_must_be_at_leas __pyx_mstate_global->__pyx_kp_s_coordinates_size_must_be_at_leas #define __pyx_n_s_coords __pyx_mstate_global->__pyx_n_s_coords #define __pyx_kp_s_coords_vertices_must_have_two_di __pyx_mstate_global->__pyx_kp_s_coords_vertices_must_have_two_di #define __pyx_n_s_copy __pyx_mstate_global->__pyx_n_s_copy #define __pyx_n_s_correction_type __pyx_mstate_global->__pyx_n_s_correction_type #define __pyx_n_s_count __pyx_mstate_global->__pyx_n_s_count #define __pyx_n_s_cpuarray __pyx_mstate_global->__pyx_n_s_cpuarray #define __pyx_n_s_crank __pyx_mstate_global->__pyx_n_s_crank #define __pyx_n_s_cratio __pyx_mstate_global->__pyx_n_s_cratio #define __pyx_n_s_create __pyx_mstate_global->__pyx_n_s_create #define __pyx_n_s_createDefaultSF __pyx_mstate_global->__pyx_n_s_createDefaultSF #define __pyx_n_s_createGlobalVec __pyx_mstate_global->__pyx_n_s_createGlobalVec #define __pyx_n_s_createGlobalVector __pyx_mstate_global->__pyx_n_s_createGlobalVector #define __pyx_n_s_createLabel __pyx_mstate_global->__pyx_n_s_createLabel #define __pyx_n_s_createLocalVec __pyx_mstate_global->__pyx_n_s_createLocalVec #define __pyx_n_s_createLocalVector __pyx_mstate_global->__pyx_n_s_createLocalVector #define __pyx_n_s_createMat __pyx_mstate_global->__pyx_n_s_createMat #define __pyx_n_s_createMatrix __pyx_mstate_global->__pyx_n_s_createMatrix #define __pyx_n_s_createNaturalVec __pyx_mstate_global->__pyx_n_s_createNaturalVec #define __pyx_n_s_createNaturalVector __pyx_mstate_global->__pyx_n_s_createNaturalVector #define __pyx_n_s_createSectionSF __pyx_mstate_global->__pyx_n_s_createSectionSF #define __pyx_n_s_createSubMatrix __pyx_mstate_global->__pyx_n_s_createSubMatrix #define __pyx_n_s_createVecLeft __pyx_mstate_global->__pyx_n_s_createVecLeft #define __pyx_n_s_createVecRight __pyx_mstate_global->__pyx_n_s_createVecRight #define __pyx_n_s_createVecs __pyx_mstate_global->__pyx_n_s_createVecs #define __pyx_n_s_create_gvec __pyx_mstate_global->__pyx_n_s_create_gvec #define __pyx_n_s_create_injection __pyx_mstate_global->__pyx_n_s_create_injection #define __pyx_n_s_create_interpolation __pyx_mstate_global->__pyx_n_s_create_interpolation #define __pyx_n_s_create_lvec __pyx_mstate_global->__pyx_n_s_create_lvec #define __pyx_n_s_create_matrix __pyx_mstate_global->__pyx_n_s_create_matrix #define __pyx_n_s_create_restriction __pyx_mstate_global->__pyx_n_s_create_restriction #define __pyx_n_s_create_subdm __pyx_mstate_global->__pyx_n_s_create_subdm #define __pyx_n_s_crtol __pyx_mstate_global->__pyx_n_s_crtol #define __pyx_n_s_csize __pyx_mstate_global->__pyx_n_s_csize #define __pyx_n_s_csr __pyx_mstate_global->__pyx_n_s_csr #define __pyx_n_s_ctype __pyx_mstate_global->__pyx_n_s_ctype #define __pyx_n_s_cudahandle __pyx_mstate_global->__pyx_n_s_cudahandle #define __pyx_n_s_cycle_type __pyx_mstate_global->__pyx_n_s_cycle_type #define __pyx_kp_s_d_s __pyx_mstate_global->__pyx_kp_s_d_s #define __pyx_n_s_da __pyx_mstate_global->__pyx_n_s_da #define __pyx_n_s_data __pyx_mstate_global->__pyx_n_s_data #define __pyx_n_s_date __pyx_mstate_global->__pyx_n_s_date #define __pyx_n_s_dctx __pyx_mstate_global->__pyx_n_s_dctx #define __pyx_n_s_debugger __pyx_mstate_global->__pyx_n_s_debugger #define __pyx_n_s_decode __pyx_mstate_global->__pyx_n_s_decode #define __pyx_n_s_decomp __pyx_mstate_global->__pyx_n_s_decomp #define __pyx_n_s_decorator __pyx_mstate_global->__pyx_n_s_decorator #define __pyx_n_s_default __pyx_mstate_global->__pyx_n_s_default #define __pyx_n_s_degree __pyx_mstate_global->__pyx_n_s_degree #define __pyx_n_s_delValue __pyx_mstate_global->__pyx_n_s_delValue #define __pyx_n_s_dense __pyx_mstate_global->__pyx_n_s_dense #define __pyx_n_s_design __pyx_mstate_global->__pyx_n_s_design #define __pyx_n_s_destroy __pyx_mstate_global->__pyx_n_s_destroy #define __pyx_n_s_determinant __pyx_mstate_global->__pyx_n_s_determinant #define __pyx_n_s_devel __pyx_mstate_global->__pyx_n_s_devel #define __pyx_n_s_device __pyx_mstate_global->__pyx_n_s_device #define __pyx_n_s_device_id __pyx_mstate_global->__pyx_n_s_device_id #define __pyx_n_s_device_type __pyx_mstate_global->__pyx_n_s_device_type #define __pyx_n_s_diag __pyx_mstate_global->__pyx_n_s_diag #define __pyx_n_s_diagonalScale __pyx_mstate_global->__pyx_n_s_diagonalScale #define __pyx_n_s_diagonal_fill __pyx_mstate_global->__pyx_n_s_diagonal_fill #define __pyx_n_s_dict __pyx_mstate_global->__pyx_n_s_dict #define __pyx_n_s_dim __pyx_mstate_global->__pyx_n_s_dim #define __pyx_n_s_dims __pyx_mstate_global->__pyx_n_s_dims #define __pyx_n_s_direction __pyx_mstate_global->__pyx_n_s_direction #define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable #define __pyx_n_s_disc __pyx_mstate_global->__pyx_n_s_disc #define __pyx_n_s_display __pyx_mstate_global->__pyx_n_s_display #define __pyx_n_s_dist __pyx_mstate_global->__pyx_n_s_dist #define __pyx_n_s_div __pyx_mstate_global->__pyx_n_s_div #define __pyx_n_s_divtol __pyx_mstate_global->__pyx_n_s_divtol #define __pyx_n_s_dlpack __pyx_mstate_global->__pyx_n_s_dlpack #define __pyx_n_s_dltensor __pyx_mstate_global->__pyx_n_s_dltensor #define __pyx_n_s_dm __pyx_mstate_global->__pyx_n_s_dm #define __pyx_n_s_dmTo __pyx_mstate_global->__pyx_n_s_dmTo #define __pyx_n_s_dm_type __pyx_mstate_global->__pyx_n_s_dm_type #define __pyx_n_s_dmf __pyx_mstate_global->__pyx_n_s_dmf #define __pyx_n_s_dms __pyx_mstate_global->__pyx_n_s_dms #define __pyx_n_s_dmswarm_type __pyx_mstate_global->__pyx_n_s_dmswarm_type #define __pyx_n_s_dmtype __pyx_mstate_global->__pyx_n_s_dmtype #define __pyx_n_s_doc __pyx_mstate_global->__pyx_n_s_doc #define __pyx_n_s_dof __pyx_mstate_global->__pyx_n_s_dof #define __pyx_n_s_dofs __pyx_mstate_global->__pyx_n_s_dofs #define __pyx_n_s_dosort __pyx_mstate_global->__pyx_n_s_dosort #define __pyx_n_s_dot __pyx_mstate_global->__pyx_n_s_dot #define __pyx_n_s_down __pyx_mstate_global->__pyx_n_s_down #define __pyx_n_s_down_left __pyx_mstate_global->__pyx_n_s_down_left #define __pyx_n_s_down_right __pyx_mstate_global->__pyx_n_s_down_right #define __pyx_n_s_drop __pyx_mstate_global->__pyx_n_s_drop #define __pyx_n_s_ds_type __pyx_mstate_global->__pyx_n_s_ds_type #define __pyx_n_s_dspace __pyx_mstate_global->__pyx_n_s_dspace #define __pyx_n_s_dt __pyx_mstate_global->__pyx_n_s_dt #define __pyx_n_s_dtcol __pyx_mstate_global->__pyx_n_s_dtcol #define __pyx_n_s_dtcount __pyx_mstate_global->__pyx_n_s_dtcount #define __pyx_n_s_dtype __pyx_mstate_global->__pyx_n_s_dtype #define __pyx_n_s_dtype_is_object __pyx_mstate_global->__pyx_n_s_dtype_is_object #define __pyx_n_s_dualspace_type __pyx_mstate_global->__pyx_n_s_dualspace_type #define __pyx_n_s_duplicate __pyx_mstate_global->__pyx_n_s_duplicate #define __pyx_n_s_e __pyx_mstate_global->__pyx_n_s_e #define __pyx_n_s_elem_type __pyx_mstate_global->__pyx_n_s_elem_type #define __pyx_n_s_element __pyx_mstate_global->__pyx_n_s_element #define __pyx_n_s_emacs __pyx_mstate_global->__pyx_n_s_emacs #define __pyx_kp_s_empty_citation __pyx_mstate_global->__pyx_kp_s_empty_citation #define __pyx_kp_s_empty_name __pyx_mstate_global->__pyx_kp_s_empty_name #define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable #define __pyx_n_s_encode __pyx_mstate_global->__pyx_n_s_encode #define __pyx_n_s_end __pyx_mstate_global->__pyx_n_s_end #define __pyx_n_s_end_args __pyx_mstate_global->__pyx_n_s_end_args #define __pyx_n_s_end_kargs __pyx_mstate_global->__pyx_n_s_end_kargs #define __pyx_n_s_enter __pyx_mstate_global->__pyx_n_s_enter #define __pyx_n_s_entityDepth __pyx_mstate_global->__pyx_n_s_entityDepth #define __pyx_n_s_entry __pyx_mstate_global->__pyx_n_s_entry #define __pyx_n_s_enum2str __pyx_mstate_global->__pyx_n_s_enum2str #define __pyx_n_s_enumerate __pyx_mstate_global->__pyx_n_s_enumerate #define __pyx_n_s_epsilon __pyx_mstate_global->__pyx_n_s_epsilon #define __pyx_n_s_eqtype __pyx_mstate_global->__pyx_n_s_eqtype #define __pyx_n_s_equality_constraints __pyx_mstate_global->__pyx_n_s_equality_constraints #define __pyx_n_s_errhandler __pyx_mstate_global->__pyx_n_s_errhandler #define __pyx_n_s_error __pyx_mstate_global->__pyx_n_s_error #define __pyx_kp_s_error_code_d __pyx_mstate_global->__pyx_kp_s_error_code_d #define __pyx_n_s_eta __pyx_mstate_global->__pyx_n_s_eta #define __pyx_n_s_evaluatestep __pyx_mstate_global->__pyx_n_s_evaluatestep #define __pyx_n_s_eventhandler __pyx_mstate_global->__pyx_n_s_eventhandler #define __pyx_n_s_exec __pyx_mstate_global->__pyx_n_s_exec #define __pyx_n_s_exit __pyx_mstate_global->__pyx_n_s_exit #define __pyx_n_s_exoid __pyx_mstate_global->__pyx_n_s_exoid #define __pyx_kp_s_expecting_a_C_contiguous_array __pyx_mstate_global->__pyx_kp_s_expecting_a_C_contiguous_array #define __pyx_kp_s_expecting_tuple_list_or_dict __pyx_mstate_global->__pyx_kp_s_expecting_tuple_list_or_dict #define __pyx_n_s_f __pyx_mstate_global->__pyx_n_s_f #define __pyx_n_s_faces __pyx_mstate_global->__pyx_n_s_faces #define __pyx_n_s_fact __pyx_mstate_global->__pyx_n_s_fact #define __pyx_n_s_factor_mallocs __pyx_mstate_global->__pyx_n_s_factor_mallocs #define __pyx_n_s_fe_type __pyx_mstate_global->__pyx_n_s_fe_type #define __pyx_n_s_fget __pyx_mstate_global->__pyx_n_s_fget #define __pyx_n_s_field __pyx_mstate_global->__pyx_n_s_field #define __pyx_n_s_fieldName __pyx_mstate_global->__pyx_n_s_fieldName #define __pyx_n_s_fieldname __pyx_mstate_global->__pyx_n_s_fieldname #define __pyx_n_s_fieldnames __pyx_mstate_global->__pyx_n_s_fieldnames #define __pyx_n_s_fields __pyx_mstate_global->__pyx_n_s_fields #define __pyx_n_s_file __pyx_mstate_global->__pyx_n_s_file #define __pyx_n_s_filename __pyx_mstate_global->__pyx_n_s_filename #define __pyx_n_s_fill __pyx_mstate_global->__pyx_n_s_fill #define __pyx_n_s_fill_param __pyx_mstate_global->__pyx_n_s_fill_param #define __pyx_n_s_fill_ratio_given __pyx_mstate_global->__pyx_n_s_fill_ratio_given #define __pyx_n_s_fill_ratio_needed __pyx_mstate_global->__pyx_n_s_fill_ratio_needed #define __pyx_n_s_finalize __pyx_mstate_global->__pyx_n_s_finalize #define __pyx_n_s_first __pyx_mstate_global->__pyx_n_s_first #define __pyx_n_s_fix __pyx_mstate_global->__pyx_n_s_fix #define __pyx_n_s_flag __pyx_mstate_global->__pyx_n_s_flag #define __pyx_n_s_flags __pyx_mstate_global->__pyx_n_s_flags #define __pyx_n_s_flg __pyx_mstate_global->__pyx_n_s_flg #define __pyx_n_s_flip __pyx_mstate_global->__pyx_n_s_flip #define __pyx_n_s_flops __pyx_mstate_global->__pyx_n_s_flops #define __pyx_n_s_flush __pyx_mstate_global->__pyx_n_s_flush #define __pyx_n_s_fnorm __pyx_mstate_global->__pyx_n_s_fnorm #define __pyx_n_s_force __pyx_mstate_global->__pyx_n_s_force #define __pyx_n_s_formDegree __pyx_mstate_global->__pyx_n_s_formDegree #define __pyx_n_s_formSNESFunction __pyx_mstate_global->__pyx_n_s_formSNESFunction #define __pyx_n_s_formSNESJacobian __pyx_mstate_global->__pyx_n_s_formSNESJacobian #define __pyx_n_s_format __pyx_mstate_global->__pyx_n_s_format #define __pyx_n_s_fortran __pyx_mstate_global->__pyx_n_s_fortran #define __pyx_n_u_fortran __pyx_mstate_global->__pyx_n_u_fortran #define __pyx_n_s_forward __pyx_mstate_global->__pyx_n_s_forward #define __pyx_n_s_front __pyx_mstate_global->__pyx_n_s_front #define __pyx_n_s_front_down __pyx_mstate_global->__pyx_n_s_front_down #define __pyx_n_s_front_down_left __pyx_mstate_global->__pyx_n_s_front_down_left #define __pyx_n_s_front_down_right __pyx_mstate_global->__pyx_n_s_front_down_right #define __pyx_n_s_front_left __pyx_mstate_global->__pyx_n_s_front_left #define __pyx_n_s_front_right __pyx_mstate_global->__pyx_n_s_front_right #define __pyx_n_s_front_up __pyx_mstate_global->__pyx_n_s_front_up #define __pyx_n_s_front_up_left __pyx_mstate_global->__pyx_n_s_front_up_left #define __pyx_n_s_front_up_right __pyx_mstate_global->__pyx_n_s_front_up_right #define __pyx_n_s_func __pyx_mstate_global->__pyx_n_s_func #define __pyx_n_s_function __pyx_mstate_global->__pyx_n_s_function #define __pyx_n_s_functional __pyx_mstate_global->__pyx_n_s_functional #define __pyx_n_s_functools __pyx_mstate_global->__pyx_n_s_functools #define __pyx_n_s_g __pyx_mstate_global->__pyx_n_s_g #define __pyx_n_s_gamgtype __pyx_mstate_global->__pyx_n_s_gamgtype #define __pyx_n_s_gamma __pyx_mstate_global->__pyx_n_s_gamma #define __pyx_n_s_garbage_cleanup __pyx_mstate_global->__pyx_n_s_garbage_cleanup #define __pyx_n_s_garbage_view __pyx_mstate_global->__pyx_n_s_garbage_view #define __pyx_n_s_gasmtype __pyx_mstate_global->__pyx_n_s_gasmtype #define __pyx_n_s_gatol __pyx_mstate_global->__pyx_n_s_gatol #define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc #define __pyx_n_s_get __pyx_mstate_global->__pyx_n_s_get #define __pyx_kp_s_get1dCoordinatecArrays_for_DMSta __pyx_mstate_global->__pyx_kp_s_get1dCoordinatecArrays_for_DMSta #define __pyx_n_s_getActive __pyx_mstate_global->__pyx_n_s_getActive #define __pyx_n_s_getActiveAll __pyx_mstate_global->__pyx_n_s_getActiveAll #define __pyx_n_s_getAppCtx __pyx_mstate_global->__pyx_n_s_getAppCtx #define __pyx_n_s_getApplicationContext __pyx_mstate_global->__pyx_n_s_getApplicationContext #define __pyx_n_s_getArray __pyx_mstate_global->__pyx_n_s_getArray #define __pyx_n_s_getBlockIndices __pyx_mstate_global->__pyx_n_s_getBlockIndices #define __pyx_n_s_getBlockInfo __pyx_mstate_global->__pyx_n_s_getBlockInfo #define __pyx_n_s_getBlockSize __pyx_mstate_global->__pyx_n_s_getBlockSize #define __pyx_n_s_getBlockSizes __pyx_mstate_global->__pyx_n_s_getBlockSizes #define __pyx_n_s_getBoundaryType __pyx_mstate_global->__pyx_n_s_getBoundaryType #define __pyx_n_s_getBoundaryTypes __pyx_mstate_global->__pyx_n_s_getBoundaryTypes #define __pyx_n_s_getBuffer __pyx_mstate_global->__pyx_n_s_getBuffer #define __pyx_n_s_getCPUTime __pyx_mstate_global->__pyx_n_s_getCPUTime #define __pyx_n_s_getClassId __pyx_mstate_global->__pyx_n_s_getClassId #define __pyx_n_s_getClassName __pyx_mstate_global->__pyx_n_s_getClassName #define __pyx_n_s_getComm __pyx_mstate_global->__pyx_n_s_getComm #define __pyx_n_s_getConstraintTolerances __pyx_mstate_global->__pyx_n_s_getConstraintTolerances #define __pyx_n_s_getConvergedReason __pyx_mstate_global->__pyx_n_s_getConvergedReason #define __pyx_n_s_getConvergenceHistory __pyx_mstate_global->__pyx_n_s_getConvergenceHistory #define __pyx_n_s_getCorners __pyx_mstate_global->__pyx_n_s_getCorners #define __pyx_n_s_getCurrent __pyx_mstate_global->__pyx_n_s_getCurrent #define __pyx_n_s_getDM __pyx_mstate_global->__pyx_n_s_getDM #define __pyx_n_s_getDS __pyx_mstate_global->__pyx_n_s_getDS #define __pyx_n_s_getDefaultComm __pyx_mstate_global->__pyx_n_s_getDefaultComm #define __pyx_n_s_getDefaultGlobalSection __pyx_mstate_global->__pyx_n_s_getDefaultGlobalSection #define __pyx_n_s_getDefaultLocalSection __pyx_mstate_global->__pyx_n_s_getDefaultLocalSection #define __pyx_n_s_getDefaultSF __pyx_mstate_global->__pyx_n_s_getDefaultSF #define __pyx_n_s_getDefaultSection __pyx_mstate_global->__pyx_n_s_getDefaultSection #define __pyx_n_s_getDevice __pyx_mstate_global->__pyx_n_s_getDevice #define __pyx_n_s_getDeviceId __pyx_mstate_global->__pyx_n_s_getDeviceId #define __pyx_n_s_getDeviceType __pyx_mstate_global->__pyx_n_s_getDeviceType #define __pyx_n_s_getDiagonal __pyx_mstate_global->__pyx_n_s_getDiagonal #define __pyx_n_s_getDiagonalBlock __pyx_mstate_global->__pyx_n_s_getDiagonalBlock #define __pyx_n_s_getDim __pyx_mstate_global->__pyx_n_s_getDim #define __pyx_n_s_getDimension __pyx_mstate_global->__pyx_n_s_getDimension #define __pyx_n_s_getDof __pyx_mstate_global->__pyx_n_s_getDof #define __pyx_n_s_getEntriesPerElement __pyx_mstate_global->__pyx_n_s_getEntriesPerElement #define __pyx_n_s_getEquationType __pyx_mstate_global->__pyx_n_s_getEquationType #define __pyx_n_s_getFlops __pyx_mstate_global->__pyx_n_s_getFlops #define __pyx_n_s_getFunctionNorm __pyx_mstate_global->__pyx_n_s_getFunctionNorm #define __pyx_n_s_getFunctionTolerances __pyx_mstate_global->__pyx_n_s_getFunctionTolerances #define __pyx_n_s_getFunctionValue __pyx_mstate_global->__pyx_n_s_getFunctionValue #define __pyx_n_s_getGhostCorners __pyx_mstate_global->__pyx_n_s_getGhostCorners #define __pyx_n_s_getGhostRanges __pyx_mstate_global->__pyx_n_s_getGhostRanges #define __pyx_n_s_getGlobalSection __pyx_mstate_global->__pyx_n_s_getGlobalSection #define __pyx_n_s_getGlobalSizes __pyx_mstate_global->__pyx_n_s_getGlobalSizes #define __pyx_n_s_getGradient __pyx_mstate_global->__pyx_n_s_getGradient #define __pyx_n_s_getGradientTolerances __pyx_mstate_global->__pyx_n_s_getGradientTolerances #define __pyx_n_s_getIndices __pyx_mstate_global->__pyx_n_s_getIndices #define __pyx_n_s_getInfo __pyx_mstate_global->__pyx_n_s_getInfo #define __pyx_n_s_getInitialGuessKnoll __pyx_mstate_global->__pyx_n_s_getInitialGuessKnoll #define __pyx_n_s_getInitialGuessNonzero __pyx_mstate_global->__pyx_n_s_getInitialGuessNonzero #define __pyx_n_s_getInterval __pyx_mstate_global->__pyx_n_s_getInterval #define __pyx_n_s_getIterationNumber __pyx_mstate_global->__pyx_n_s_getIterationNumber #define __pyx_n_s_getKSP __pyx_mstate_global->__pyx_n_s_getKSP #define __pyx_n_s_getKSPFailures __pyx_mstate_global->__pyx_n_s_getKSPFailures #define __pyx_n_s_getLinearSolveFailures __pyx_mstate_global->__pyx_n_s_getLinearSolveFailures #define __pyx_n_s_getLocalSection __pyx_mstate_global->__pyx_n_s_getLocalSection #define __pyx_n_s_getLocalSize __pyx_mstate_global->__pyx_n_s_getLocalSize #define __pyx_n_s_getLocalSizes __pyx_mstate_global->__pyx_n_s_getLocalSizes #define __pyx_n_s_getMatrix __pyx_mstate_global->__pyx_n_s_getMatrix #define __pyx_n_s_getMaxFunctionEvaluations __pyx_mstate_global->__pyx_n_s_getMaxFunctionEvaluations #define __pyx_n_s_getMaxKSPFailures __pyx_mstate_global->__pyx_n_s_getMaxKSPFailures #define __pyx_n_s_getMaxLinearSolveFailures __pyx_mstate_global->__pyx_n_s_getMaxLinearSolveFailures #define __pyx_n_s_getMaxNonlinearStepFailures __pyx_mstate_global->__pyx_n_s_getMaxNonlinearStepFailures #define __pyx_n_s_getMaxStepFailures __pyx_mstate_global->__pyx_n_s_getMaxStepFailures #define __pyx_n_s_getMaxSteps __pyx_mstate_global->__pyx_n_s_getMaxSteps #define __pyx_n_s_getMaxTime __pyx_mstate_global->__pyx_n_s_getMaxTime #define __pyx_n_s_getNPC __pyx_mstate_global->__pyx_n_s_getNPC #define __pyx_n_s_getName __pyx_mstate_global->__pyx_n_s_getName #define __pyx_n_s_getNonlinearStepFailures __pyx_mstate_global->__pyx_n_s_getNonlinearStepFailures #define __pyx_n_s_getNormType __pyx_mstate_global->__pyx_n_s_getNormType #define __pyx_n_s_getNumber __pyx_mstate_global->__pyx_n_s_getNumber #define __pyx_n_s_getNumberDM __pyx_mstate_global->__pyx_n_s_getNumberDM #define __pyx_n_s_getObjectiveValue __pyx_mstate_global->__pyx_n_s_getObjectiveValue #define __pyx_n_s_getOperators __pyx_mstate_global->__pyx_n_s_getOperators #define __pyx_n_s_getOptionsPrefix __pyx_mstate_global->__pyx_n_s_getOptionsPrefix #define __pyx_n_s_getOwnershipRange __pyx_mstate_global->__pyx_n_s_getOwnershipRange #define __pyx_n_s_getOwnershipRanges __pyx_mstate_global->__pyx_n_s_getOwnershipRanges #define __pyx_n_s_getPC __pyx_mstate_global->__pyx_n_s_getPC #define __pyx_n_s_getPCSide __pyx_mstate_global->__pyx_n_s_getPCSide #define __pyx_n_s_getProblemType __pyx_mstate_global->__pyx_n_s_getProblemType #define __pyx_n_s_getProcSizes __pyx_mstate_global->__pyx_n_s_getProcSizes #define __pyx_n_s_getRanges __pyx_mstate_global->__pyx_n_s_getRanges #define __pyx_n_s_getRank __pyx_mstate_global->__pyx_n_s_getRank #define __pyx_n_s_getRefCount __pyx_mstate_global->__pyx_n_s_getRefCount #define __pyx_n_s_getResidualNorm __pyx_mstate_global->__pyx_n_s_getResidualNorm #define __pyx_n_s_getRhs __pyx_mstate_global->__pyx_n_s_getRhs #define __pyx_n_s_getSNES __pyx_mstate_global->__pyx_n_s_getSNES #define __pyx_n_s_getSection __pyx_mstate_global->__pyx_n_s_getSection #define __pyx_n_s_getSectionSF __pyx_mstate_global->__pyx_n_s_getSectionSF #define __pyx_n_s_getSeed __pyx_mstate_global->__pyx_n_s_getSeed #define __pyx_n_s_getSize __pyx_mstate_global->__pyx_n_s_getSize #define __pyx_n_s_getSizes __pyx_mstate_global->__pyx_n_s_getSizes #define __pyx_n_s_getSolution __pyx_mstate_global->__pyx_n_s_getSolution #define __pyx_n_s_getSolutionNorm __pyx_mstate_global->__pyx_n_s_getSolutionNorm #define __pyx_n_s_getSolutionUpdate __pyx_mstate_global->__pyx_n_s_getSolutionUpdate #define __pyx_n_s_getStencil __pyx_mstate_global->__pyx_n_s_getStencil #define __pyx_n_s_getStencilType __pyx_mstate_global->__pyx_n_s_getStencilType #define __pyx_n_s_getStencilWidth __pyx_mstate_global->__pyx_n_s_getStencilWidth #define __pyx_n_s_getStepFailures __pyx_mstate_global->__pyx_n_s_getStepFailures #define __pyx_n_s_getStepNumber __pyx_mstate_global->__pyx_n_s_getStepNumber #define __pyx_n_s_getStreamType __pyx_mstate_global->__pyx_n_s_getStreamType #define __pyx_n_s_getString __pyx_mstate_global->__pyx_n_s_getString #define __pyx_n_s_getTime __pyx_mstate_global->__pyx_n_s_getTime #define __pyx_n_s_getTimeStep __pyx_mstate_global->__pyx_n_s_getTimeStep #define __pyx_n_s_getTolerances __pyx_mstate_global->__pyx_n_s_getTolerances #define __pyx_n_s_getType __pyx_mstate_global->__pyx_n_s_getType #define __pyx_n_s_getUseEW __pyx_mstate_global->__pyx_n_s_getUseEW #define __pyx_n_s_getUseFD __pyx_mstate_global->__pyx_n_s_getUseFD #define __pyx_n_s_getUseMF __pyx_mstate_global->__pyx_n_s_getUseMF #define __pyx_n_s_getValue __pyx_mstate_global->__pyx_n_s_getValue #define __pyx_kp_s_getVecArray_for_DMStag_not_yet_i __pyx_mstate_global->__pyx_kp_s_getVecArray_for_DMStag_not_yet_i #define __pyx_n_s_getVecLeft __pyx_mstate_global->__pyx_n_s_getVecLeft #define __pyx_n_s_getVecRight __pyx_mstate_global->__pyx_n_s_getVecRight #define __pyx_n_s_getVecs __pyx_mstate_global->__pyx_n_s_getVecs #define __pyx_n_s_getVersion __pyx_mstate_global->__pyx_n_s_getVersion #define __pyx_n_s_getVersionInfo __pyx_mstate_global->__pyx_n_s_getVersionInfo #define __pyx_n_s_getVisible __pyx_mstate_global->__pyx_n_s_getVisible #define __pyx_n_s_get_2 __pyx_mstate_global->__pyx_n_s_get_2 #define __pyx_n_s_getstate __pyx_mstate_global->__pyx_n_s_getstate #define __pyx_n_s_ghostBcNodes __pyx_mstate_global->__pyx_n_s_ghostBcNodes #define __pyx_n_s_ghosted __pyx_mstate_global->__pyx_n_s_ghosted #define __pyx_n_s_ghosts __pyx_mstate_global->__pyx_n_s_ghosts #define __pyx_kp_s_ghosts_size_d_array_size_d_and_v __pyx_mstate_global->__pyx_kp_s_ghosts_size_d_array_size_d_and_v #define __pyx_n_s_globalBcNodes __pyx_mstate_global->__pyx_n_s_globalBcNodes #define __pyx_kp_s_global_size_d_not_divisible_by_b __pyx_mstate_global->__pyx_kp_s_global_size_d_not_divisible_by_b #define __pyx_n_s_globalsec __pyx_mstate_global->__pyx_n_s_globalsec #define __pyx_n_s_gord __pyx_mstate_global->__pyx_n_s_gord #define __pyx_kp_u_got __pyx_mstate_global->__pyx_kp_u_got #define __pyx_kp_u_got_differing_extents_in_dimensi __pyx_mstate_global->__pyx_kp_u_got_differing_extents_in_dimensi #define __pyx_n_s_gradient __pyx_mstate_global->__pyx_n_s_gradient #define __pyx_n_s_group __pyx_mstate_global->__pyx_n_s_group #define __pyx_n_s_grtol __pyx_mstate_global->__pyx_n_s_grtol #define __pyx_n_s_gsec __pyx_mstate_global->__pyx_n_s_gsec #define __pyx_n_s_gtol __pyx_mstate_global->__pyx_n_s_gtol #define __pyx_n_s_gttol __pyx_mstate_global->__pyx_n_s_gttol #define __pyx_n_s_gv __pyx_mstate_global->__pyx_n_s_gv #define __pyx_n_s_gvec __pyx_mstate_global->__pyx_n_s_gvec #define __pyx_n_s_h_max __pyx_mstate_global->__pyx_n_s_h_max #define __pyx_n_s_h_min __pyx_mstate_global->__pyx_n_s_h_min #define __pyx_n_s_handle __pyx_mstate_global->__pyx_n_s_handle #define __pyx_n_s_has __pyx_mstate_global->__pyx_n_s_has #define __pyx_n_s_hasExternalPackage __pyx_mstate_global->__pyx_n_s_hasExternalPackage #define __pyx_n_s_hasLabel __pyx_mstate_global->__pyx_n_s_hasLabel #define __pyx_n_s_hasLagrange __pyx_mstate_global->__pyx_n_s_hasLagrange #define __pyx_n_s_hasName __pyx_mstate_global->__pyx_n_s_hasName #define __pyx_n_s_hausd __pyx_mstate_global->__pyx_n_s_hausd #define __pyx_n_s_hessian __pyx_mstate_global->__pyx_n_s_hessian #define __pyx_n_s_hiphandle __pyx_mstate_global->__pyx_n_s_hiphandle #define __pyx_n_s_hmax __pyx_mstate_global->__pyx_n_s_hmax #define __pyx_n_s_hmin __pyx_mstate_global->__pyx_n_s_hmin #define __pyx_n_s_hpddm_type __pyx_mstate_global->__pyx_n_s_hpddm_type #define __pyx_n_s_hypretype __pyx_mstate_global->__pyx_n_s_hypretype #define __pyx_n_s_i __pyx_mstate_global->__pyx_n_s_i #define __pyx_n_s_icntl __pyx_mstate_global->__pyx_n_s_icntl #define __pyx_n_s_id __pyx_mstate_global->__pyx_n_s_id #define __pyx_n_s_idx __pyx_mstate_global->__pyx_n_s_idx #define __pyx_n_s_idxm __pyx_mstate_global->__pyx_n_s_idxm #define __pyx_n_s_ierr __pyx_mstate_global->__pyx_n_s_ierr #define __pyx_n_s_ignore __pyx_mstate_global->__pyx_n_s_ignore #define __pyx_n_s_ignoreOutsideDomain __pyx_mstate_global->__pyx_n_s_ignoreOutsideDomain #define __pyx_n_s_imag __pyx_mstate_global->__pyx_n_s_imag #define __pyx_n_s_imagPart __pyx_mstate_global->__pyx_n_s_imagPart #define __pyx_n_s_imex __pyx_mstate_global->__pyx_n_s_imex #define __pyx_n_s_imode __pyx_mstate_global->__pyx_n_s_imode #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import #define __pyx_n_s_inblocks __pyx_mstate_global->__pyx_n_s_inblocks #define __pyx_kp_s_incompatible_array_sizes __pyx_mstate_global->__pyx_kp_s_incompatible_array_sizes #define __pyx_kp_s_incompatible_array_sizes_ni_d_nj __pyx_mstate_global->__pyx_kp_s_incompatible_array_sizes_ni_d_nj #define __pyx_kp_s_incompatible_array_sizes_ni_d_nv __pyx_mstate_global->__pyx_kp_s_incompatible_array_sizes_ni_d_nv #define __pyx_kp_s_incompatible_array_sizes_ni_d_nv_2 __pyx_mstate_global->__pyx_kp_s_incompatible_array_sizes_ni_d_nv_2 #define __pyx_kp_s_incompatible_array_sizes_nv_d __pyx_mstate_global->__pyx_kp_s_incompatible_array_sizes_nv_d #define __pyx_n_s_index __pyx_mstate_global->__pyx_n_s_index #define __pyx_n_s_indicator __pyx_mstate_global->__pyx_n_s_indicator #define __pyx_n_s_indices __pyx_mstate_global->__pyx_n_s_indices #define __pyx_n_s_info __pyx_mstate_global->__pyx_n_s_info #define __pyx_n_s_infoAllow __pyx_mstate_global->__pyx_n_s_infoAllow #define __pyx_n_s_init __pyx_mstate_global->__pyx_n_s_init #define __pyx_n_s_init_subclass __pyx_mstate_global->__pyx_n_s_init_subclass #define __pyx_n_s_initialguess __pyx_mstate_global->__pyx_n_s_initialguess #define __pyx_n_s_initialize __pyx_mstate_global->__pyx_n_s_initialize #define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing #define __pyx_kp_s_input_arrays_have_incompatible_s __pyx_mstate_global->__pyx_kp_s_input_arrays_have_incompatible_s #define __pyx_n_s_int __pyx_mstate_global->__pyx_n_s_int #define __pyx_n_s_interior __pyx_mstate_global->__pyx_n_s_interior #define __pyx_n_s_interp_type __pyx_mstate_global->__pyx_n_s_interp_type #define __pyx_n_s_interpolate __pyx_mstate_global->__pyx_n_s_interpolate #define __pyx_n_s_interval __pyx_mstate_global->__pyx_n_s_interval #define __pyx_n_s_invert __pyx_mstate_global->__pyx_n_s_invert #define __pyx_n_s_is __pyx_mstate_global->__pyx_n_s_is #define __pyx_n_s_isActive __pyx_mstate_global->__pyx_n_s_isActive #define __pyx_n_s_isAssembled __pyx_mstate_global->__pyx_n_s_isAssembled #define __pyx_n_s_isFinalized __pyx_mstate_global->__pyx_n_s_isFinalized #define __pyx_n_s_isHermitian __pyx_mstate_global->__pyx_n_s_isHermitian #define __pyx_n_s_isIdentity __pyx_mstate_global->__pyx_n_s_isIdentity #define __pyx_n_s_isInitialized __pyx_mstate_global->__pyx_n_s_isInitialized #define __pyx_n_s_isPermutation __pyx_mstate_global->__pyx_n_s_isPermutation #define __pyx_n_s_isSimplex __pyx_mstate_global->__pyx_n_s_isSimplex #define __pyx_n_s_isSorted __pyx_mstate_global->__pyx_n_s_isSorted #define __pyx_n_s_isStructurallySymmetric __pyx_mstate_global->__pyx_n_s_isStructurallySymmetric #define __pyx_n_s_isSymmetric __pyx_mstate_global->__pyx_n_s_isSymmetric #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine #define __pyx_n_s_is_from __pyx_mstate_global->__pyx_n_s_is_from #define __pyx_n_s_is_local __pyx_mstate_global->__pyx_n_s_is_local #define __pyx_n_s_is_to __pyx_mstate_global->__pyx_n_s_is_to #define __pyx_n_s_is_type __pyx_mstate_global->__pyx_n_s_is_type #define __pyx_n_s_iscol __pyx_mstate_global->__pyx_n_s_iscol #define __pyx_n_s_iscols __pyx_mstate_global->__pyx_n_s_iscols #define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled #define __pyx_n_s_iset __pyx_mstate_global->__pyx_n_s_iset #define __pyx_n_s_isets __pyx_mstate_global->__pyx_n_s_isets #define __pyx_n_s_isfields __pyx_mstate_global->__pyx_n_s_isfields #define __pyx_n_s_isotropic __pyx_mstate_global->__pyx_n_s_isotropic #define __pyx_n_s_isperm __pyx_mstate_global->__pyx_n_s_isperm #define __pyx_n_s_isrow __pyx_mstate_global->__pyx_n_s_isrow #define __pyx_n_s_isrows __pyx_mstate_global->__pyx_n_s_isrows #define __pyx_n_s_itemsize __pyx_mstate_global->__pyx_n_s_itemsize #define __pyx_kp_s_itemsize_0_for_cython_array __pyx_mstate_global->__pyx_kp_s_itemsize_0_for_cython_array #define __pyx_n_s_its __pyx_mstate_global->__pyx_n_s_its #define __pyx_n_s_ival __pyx_mstate_global->__pyx_n_s_ival #define __pyx_n_s_j __pyx_mstate_global->__pyx_n_s_j #define __pyx_n_s_jacobian __pyx_mstate_global->__pyx_n_s_jacobian #define __pyx_n_s_jacobian_design __pyx_mstate_global->__pyx_n_s_jacobian_design #define __pyx_n_s_jacobian_equality __pyx_mstate_global->__pyx_n_s_jacobian_equality #define __pyx_n_s_jacobian_state __pyx_mstate_global->__pyx_n_s_jacobian_state #define __pyx_n_s_jacobianp __pyx_mstate_global->__pyx_n_s_jacobianp #define __pyx_n_s_join __pyx_mstate_global->__pyx_n_s_join #define __pyx_n_s_join_mode __pyx_mstate_global->__pyx_n_s_join_mode #define __pyx_n_s_k __pyx_mstate_global->__pyx_n_s_k #define __pyx_n_s_kargs __pyx_mstate_global->__pyx_n_s_kargs #define __pyx_kp_s_key_d_cannot_register_s_already __pyx_mstate_global->__pyx_kp_s_key_d_cannot_register_s_already #define __pyx_n_s_keys __pyx_mstate_global->__pyx_n_s_keys #define __pyx_n_s_kind __pyx_mstate_global->__pyx_n_s_kind #define __pyx_n_s_klass __pyx_mstate_global->__pyx_n_s_klass #define __pyx_n_s_ksp __pyx_mstate_global->__pyx_n_s_ksp #define __pyx_n_s_ksp_type __pyx_mstate_global->__pyx_n_s_ksp_type #define __pyx_n_s_kwargs __pyx_mstate_global->__pyx_n_s_kwargs #define __pyx_n_s_l __pyx_mstate_global->__pyx_n_s_l #define __pyx_n_s_l2l __pyx_mstate_global->__pyx_n_s_l2l #define __pyx_n_s_label __pyx_mstate_global->__pyx_n_s_label #define __pyx_n_s_labelName __pyx_mstate_global->__pyx_n_s_labelName #define __pyx_n_s_lambda __pyx_mstate_global->__pyx_n_s_lambda #define __pyx_n_s_lanes __pyx_mstate_global->__pyx_n_s_lanes #define __pyx_n_s_layoutType __pyx_mstate_global->__pyx_n_s_layoutType #define __pyx_n_s_lda __pyx_mstate_global->__pyx_n_s_lda #define __pyx_n_s_leafSection __pyx_mstate_global->__pyx_n_s_leafSection #define __pyx_n_s_leafdata __pyx_mstate_global->__pyx_n_s_leafdata #define __pyx_n_s_leafsize __pyx_mstate_global->__pyx_n_s_leafsize #define __pyx_n_s_leafupdate __pyx_mstate_global->__pyx_n_s_leafupdate #define __pyx_n_s_left __pyx_mstate_global->__pyx_n_s_left #define __pyx_n_s_length __pyx_mstate_global->__pyx_n_s_length #define __pyx_n_s_level __pyx_mstate_global->__pyx_n_s_level #define __pyx_n_s_levels __pyx_mstate_global->__pyx_n_s_levels #define __pyx_n_s_lgmap __pyx_mstate_global->__pyx_n_s_lgmap #define __pyx_n_s_lgmap_type __pyx_mstate_global->__pyx_n_s_lgmap_type #define __pyx_n_s_lgmapc __pyx_mstate_global->__pyx_n_s_lgmapc #define __pyx_n_s_lgmapr __pyx_mstate_global->__pyx_n_s_lgmapr #define __pyx_n_s_linear_its __pyx_mstate_global->__pyx_n_s_linear_its #define __pyx_n_s_lits __pyx_mstate_global->__pyx_n_s_lits #define __pyx_n_s_loc __pyx_mstate_global->__pyx_n_s_loc #define __pyx_n_s_locC __pyx_mstate_global->__pyx_n_s_locC #define __pyx_n_s_locX __pyx_mstate_global->__pyx_n_s_locX #define __pyx_n_s_local __pyx_mstate_global->__pyx_n_s_local #define __pyx_kp_s_local_and_global_sizes_cannot_be __pyx_mstate_global->__pyx_kp_s_local_and_global_sizes_cannot_be #define __pyx_kp_s_local_size_d_not_divisible_by_bl __pyx_mstate_global->__pyx_kp_s_local_size_d_not_divisible_by_bl #define __pyx_n_s_localsec __pyx_mstate_global->__pyx_n_s_localsec #define __pyx_n_s_locs __pyx_mstate_global->__pyx_n_s_locs #define __pyx_n_s_logFlops __pyx_mstate_global->__pyx_n_s_logFlops #define __pyx_n_s_lower __pyx_mstate_global->__pyx_n_s_lower #define __pyx_n_s_ls_type __pyx_mstate_global->__pyx_n_s_ls_type #define __pyx_n_s_ltog __pyx_mstate_global->__pyx_n_s_ltog #define __pyx_n_s_ltol __pyx_mstate_global->__pyx_n_s_ltol #define __pyx_n_s_lv __pyx_mstate_global->__pyx_n_s_lv #define __pyx_n_s_lvec __pyx_mstate_global->__pyx_n_s_lvec #define __pyx_n_s_lvecs __pyx_mstate_global->__pyx_n_s_lvecs #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main #define __pyx_n_s_major __pyx_mstate_global->__pyx_n_s_major #define __pyx_n_s_mallocs __pyx_mstate_global->__pyx_n_s_mallocs #define __pyx_n_s_mat __pyx_mstate_global->__pyx_n_s_mat #define __pyx_n_s_matApply __pyx_mstate_global->__pyx_n_s_matApply #define __pyx_n_s_matMult __pyx_mstate_global->__pyx_n_s_matMult #define __pyx_n_s_mat_type __pyx_mstate_global->__pyx_n_s_mat_type #define __pyx_n_s_matpartitioning_type __pyx_mstate_global->__pyx_n_s_matpartitioning_type #define __pyx_n_s_mats __pyx_mstate_global->__pyx_n_s_mats #define __pyx_n_s_max __pyx_mstate_global->__pyx_n_s_max #define __pyx_n_s_maxDegree __pyx_mstate_global->__pyx_n_s_maxDegree #define __pyx_n_s_max_fails __pyx_mstate_global->__pyx_n_s_max_fails #define __pyx_n_s_max_funcs __pyx_mstate_global->__pyx_n_s_max_funcs #define __pyx_n_s_max_it __pyx_mstate_global->__pyx_n_s_max_it #define __pyx_n_s_max_steps __pyx_mstate_global->__pyx_n_s_max_steps #define __pyx_n_s_max_time __pyx_mstate_global->__pyx_n_s_max_time #define __pyx_n_s_maxrank __pyx_mstate_global->__pyx_n_s_maxrank #define __pyx_n_s_maxval __pyx_mstate_global->__pyx_n_s_maxval #define __pyx_n_s_memo __pyx_mstate_global->__pyx_n_s_memo #define __pyx_n_s_memory __pyx_mstate_global->__pyx_n_s_memory #define __pyx_n_s_memview __pyx_mstate_global->__pyx_n_s_memview #define __pyx_n_s_messageLength __pyx_mstate_global->__pyx_n_s_messageLength #define __pyx_n_s_metaclass __pyx_mstate_global->__pyx_n_s_metaclass #define __pyx_n_s_metric __pyx_mstate_global->__pyx_n_s_metric #define __pyx_n_s_metric1 __pyx_mstate_global->__pyx_n_s_metric1 #define __pyx_n_s_metric2 __pyx_mstate_global->__pyx_n_s_metric2 #define __pyx_n_s_metric3 __pyx_mstate_global->__pyx_n_s_metric3 #define __pyx_n_s_metricAvg __pyx_mstate_global->__pyx_n_s_metricAvg #define __pyx_n_s_metricInt __pyx_mstate_global->__pyx_n_s_metricInt #define __pyx_n_s_mgtype __pyx_mstate_global->__pyx_n_s_mgtype #define __pyx_n_s_min __pyx_mstate_global->__pyx_n_s_min #define __pyx_n_s_minor __pyx_mstate_global->__pyx_n_s_minor #define __pyx_n_s_mirror __pyx_mstate_global->__pyx_n_s_mirror #define __pyx_n_s_missingDiagonal __pyx_mstate_global->__pyx_n_s_missingDiagonal #define __pyx_n_s_mit __pyx_mstate_global->__pyx_n_s_mit #define __pyx_n_s_mode __pyx_mstate_global->__pyx_n_s_mode #define __pyx_n_s_model __pyx_mstate_global->__pyx_n_s_model #define __pyx_n_s_module __pyx_mstate_global->__pyx_n_s_module #define __pyx_n_s_monitor __pyx_mstate_global->__pyx_n_s_monitor #define __pyx_n_s_monitorCancel __pyx_mstate_global->__pyx_n_s_monitorCancel #define __pyx_n_s_mpi4py __pyx_mstate_global->__pyx_n_s_mpi4py #define __pyx_kp_s_mpi4py_MPI __pyx_mstate_global->__pyx_kp_s_mpi4py_MPI #define __pyx_n_s_mpiabort __pyx_mstate_global->__pyx_n_s_mpiabort #define __pyx_n_s_mro_entries __pyx_mstate_global->__pyx_n_s_mro_entries #define __pyx_n_s_msg __pyx_mstate_global->__pyx_n_s_msg #define __pyx_n_s_mult __pyx_mstate_global->__pyx_n_s_mult #define __pyx_n_s_multAdd __pyx_mstate_global->__pyx_n_s_multAdd #define __pyx_n_s_multDiagonalBlock __pyx_mstate_global->__pyx_n_s_multDiagonalBlock #define __pyx_n_s_multHermitian __pyx_mstate_global->__pyx_n_s_multHermitian #define __pyx_n_s_multHermitianAdd __pyx_mstate_global->__pyx_n_s_multHermitianAdd #define __pyx_n_s_multTranspose __pyx_mstate_global->__pyx_n_s_multTranspose #define __pyx_n_s_multTransposeAdd __pyx_mstate_global->__pyx_n_s_multTransposeAdd #define __pyx_n_s_multirootdata __pyx_mstate_global->__pyx_n_s_multirootdata #define __pyx_n_s_n __pyx_mstate_global->__pyx_n_s_n #define __pyx_n_s_na __pyx_mstate_global->__pyx_n_s_na #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name #define __pyx_n_s_name_2 __pyx_mstate_global->__pyx_n_s_name_2 #define __pyx_n_s_name_3 __pyx_mstate_global->__pyx_n_s_name_3 #define __pyx_n_s_nbsteps __pyx_mstate_global->__pyx_n_s_nbsteps #define __pyx_n_s_nc __pyx_mstate_global->__pyx_n_s_nc #define __pyx_n_s_ndim __pyx_mstate_global->__pyx_n_s_ndim #define __pyx_n_s_new __pyx_mstate_global->__pyx_n_s_new #define __pyx_n_s_newsec __pyx_mstate_global->__pyx_n_s_newsec #define __pyx_n_s_newvec __pyx_mstate_global->__pyx_n_s_newvec #define __pyx_n_s_ngs __pyx_mstate_global->__pyx_n_s_ngs #define __pyx_n_s_nlevels __pyx_mstate_global->__pyx_n_s_nlevels #define __pyx_n_s_nlocal __pyx_mstate_global->__pyx_n_s_nlocal #define __pyx_n_s_nmax __pyx_mstate_global->__pyx_n_s_nmax #define __pyx_n_s_nmin __pyx_mstate_global->__pyx_n_s_nmin #define __pyx_n_s_nnz __pyx_mstate_global->__pyx_n_s_nnz #define __pyx_n_s_noInsert __pyx_mstate_global->__pyx_n_s_noInsert #define __pyx_n_s_noMove __pyx_mstate_global->__pyx_n_s_noMove #define __pyx_n_s_noSurf __pyx_mstate_global->__pyx_n_s_noSurf #define __pyx_n_s_noSwap __pyx_mstate_global->__pyx_n_s_noSwap #define __pyx_kp_s_no_default___reduce___due_to_non __pyx_mstate_global->__pyx_kp_s_no_default___reduce___due_to_non #define __pyx_n_s_none __pyx_mstate_global->__pyx_n_s_none #define __pyx_n_s_nonzero __pyx_mstate_global->__pyx_n_s_nonzero #define __pyx_n_s_norm __pyx_mstate_global->__pyx_n_s_norm #define __pyx_n_s_norm_type __pyx_mstate_global->__pyx_n_s_norm_type #define __pyx_n_s_normsched __pyx_mstate_global->__pyx_n_s_normsched #define __pyx_n_s_normtype __pyx_mstate_global->__pyx_n_s_normtype #define __pyx_n_s_npoints __pyx_mstate_global->__pyx_n_s_npoints #define __pyx_n_s_nroots __pyx_mstate_global->__pyx_n_s_nroots #define __pyx_n_s_nsd __pyx_mstate_global->__pyx_n_s_nsd #define __pyx_n_s_nsp __pyx_mstate_global->__pyx_n_s_nsp #define __pyx_n_s_nsubcomm __pyx_mstate_global->__pyx_n_s_nsubcomm #define __pyx_n_s_null __pyx_mstate_global->__pyx_n_s_null #define __pyx_kp_s_null_communicator __pyx_mstate_global->__pyx_kp_s_null_communicator #define __pyx_n_s_numBatches __pyx_mstate_global->__pyx_n_s_numBatches #define __pyx_n_s_numBlocks __pyx_mstate_global->__pyx_n_s_numBlocks #define __pyx_n_s_numComp __pyx_mstate_global->__pyx_n_s_numComp #define __pyx_n_s_numDof __pyx_mstate_global->__pyx_n_s_numDof #define __pyx_n_s_numFields __pyx_mstate_global->__pyx_n_s_numFields #define __pyx_n_s_numIter __pyx_mstate_global->__pyx_n_s_numIter #define __pyx_n_s_numMessages __pyx_mstate_global->__pyx_n_s_numMessages #define __pyx_n_s_numProcs __pyx_mstate_global->__pyx_n_s_numProcs #define __pyx_n_s_numReductions __pyx_mstate_global->__pyx_n_s_numReductions #define __pyx_n_s_numSumSpaces __pyx_mstate_global->__pyx_n_s_numSumSpaces #define __pyx_n_s_numTensSpaces __pyx_mstate_global->__pyx_n_s_numTensSpaces #define __pyx_kp_s_number_of_dimensions_d_and_numbe __pyx_mstate_global->__pyx_kp_s_number_of_dimensions_d_and_numbe #define __pyx_n_s_nz_allocated __pyx_mstate_global->__pyx_n_s_nz_allocated #define __pyx_n_s_nz_unneeded __pyx_mstate_global->__pyx_n_s_nz_unneeded #define __pyx_n_s_nz_used __pyx_mstate_global->__pyx_n_s_nz_used #define __pyx_n_s_nzdiag __pyx_mstate_global->__pyx_n_s_nzdiag #define __pyx_n_s_obj __pyx_mstate_global->__pyx_n_s_obj #define __pyx_n_s_object __pyx_mstate_global->__pyx_n_s_object #define __pyx_n_s_objective __pyx_mstate_global->__pyx_n_s_objective #define __pyx_n_s_objgrad __pyx_mstate_global->__pyx_n_s_objgrad #define __pyx_n_s_offset __pyx_mstate_global->__pyx_n_s_offset #define __pyx_n_s_omega __pyx_mstate_global->__pyx_n_s_omega #define __pyx_n_s_ometric __pyx_mstate_global->__pyx_n_s_ometric #define __pyx_kp_s_only_and __pyx_mstate_global->__pyx_kp_s_only_and #define __pyx_n_s_onnz __pyx_mstate_global->__pyx_n_s_onnz #define __pyx_n_s_op __pyx_mstate_global->__pyx_n_s_op #define __pyx_n_s_open __pyx_mstate_global->__pyx_n_s_open #define __pyx_n_s_operator __pyx_mstate_global->__pyx_n_s_operator #define __pyx_n_s_operators __pyx_mstate_global->__pyx_n_s_operators #define __pyx_n_s_option __pyx_mstate_global->__pyx_n_s_option #define __pyx_kp_s_option_prefix_must_be_string __pyx_mstate_global->__pyx_kp_s_option_prefix_must_be_string #define __pyx_kp_s_option_prefix_should_not_have_sp __pyx_mstate_global->__pyx_kp_s_option_prefix_should_not_have_sp #define __pyx_kp_s_option_prefix_should_not_start_w __pyx_mstate_global->__pyx_kp_s_option_prefix_should_not_start_w #define __pyx_n_s_options __pyx_mstate_global->__pyx_n_s_options #define __pyx_n_s_opts __pyx_mstate_global->__pyx_n_s_opts #define __pyx_n_s_ord_type __pyx_mstate_global->__pyx_n_s_ord_type #define __pyx_n_s_order __pyx_mstate_global->__pyx_n_s_order #define __pyx_n_s_orientation __pyx_mstate_global->__pyx_n_s_orientation #define __pyx_n_s_other __pyx_mstate_global->__pyx_n_s_other #define __pyx_n_s_otype __pyx_mstate_global->__pyx_n_s_otype #define __pyx_n_s_out __pyx_mstate_global->__pyx_n_s_out #define __pyx_n_s_output __pyx_mstate_global->__pyx_n_s_output #define __pyx_n_s_overlap __pyx_mstate_global->__pyx_n_s_overlap #define __pyx_kp_s_ownership_range_size_d_and_numbe __pyx_mstate_global->__pyx_kp_s_ownership_range_size_d_and_numbe #define __pyx_n_s_ownership_ranges __pyx_mstate_global->__pyx_n_s_ownership_ranges #define __pyx_n_s_ozz __pyx_mstate_global->__pyx_n_s_ozz #define __pyx_n_s_p __pyx_mstate_global->__pyx_n_s_p #define __pyx_n_s_p1 __pyx_mstate_global->__pyx_n_s_p1 #define __pyx_n_s_pEnd __pyx_mstate_global->__pyx_n_s_pEnd #define __pyx_n_s_pStart __pyx_mstate_global->__pyx_n_s_pStart #define __pyx_n_s_pack __pyx_mstate_global->__pyx_n_s_pack #define __pyx_n_s_package __pyx_mstate_global->__pyx_n_s_package #define __pyx_n_s_package_2 __pyx_mstate_global->__pyx_n_s_package_2 #define __pyx_n_s_parallel __pyx_mstate_global->__pyx_n_s_parallel #define __pyx_n_s_parent __pyx_mstate_global->__pyx_n_s_parent #define __pyx_n_s_part __pyx_mstate_global->__pyx_n_s_part #define __pyx_n_s_part_type __pyx_mstate_global->__pyx_n_s_part_type #define __pyx_n_s_partitioning __pyx_mstate_global->__pyx_n_s_partitioning #define __pyx_n_s_pc __pyx_mstate_global->__pyx_n_s_pc #define __pyx_n_s_pc_type __pyx_mstate_global->__pyx_n_s_pc_type #define __pyx_n_s_pd __pyx_mstate_global->__pyx_n_s_pd #define __pyx_n_s_periodic __pyx_mstate_global->__pyx_n_s_periodic #define __pyx_n_s_perm __pyx_mstate_global->__pyx_n_s_perm #define __pyx_n_s_permutation __pyx_mstate_global->__pyx_n_s_permutation #define __pyx_n_s_petsc __pyx_mstate_global->__pyx_n_s_petsc #define __pyx_n_s_petsc4py_PETSc __pyx_mstate_global->__pyx_n_s_petsc4py_PETSc #define __pyx_kp_s_petsc4py_PETSc_Device_pyx __pyx_mstate_global->__pyx_kp_s_petsc4py_PETSc_Device_pyx #define __pyx_kp_s_petsc4py_PETSc_Error_pyx __pyx_mstate_global->__pyx_kp_s_petsc4py_PETSc_Error_pyx #define __pyx_kp_s_petsc4py_PETSc_Log_pyx __pyx_mstate_global->__pyx_kp_s_petsc4py_PETSc_Log_pyx #define __pyx_kp_s_petsc4py_PETSc_PETSc_pyx __pyx_mstate_global->__pyx_kp_s_petsc4py_PETSc_PETSc_pyx #define __pyx_kp_s_petsc4py_PETSc_cyclicgc_pxi __pyx_mstate_global->__pyx_kp_s_petsc4py_PETSc_cyclicgc_pxi #define __pyx_n_s_pi __pyx_mstate_global->__pyx_n_s_pi #define __pyx_n_s_pickle __pyx_mstate_global->__pyx_n_s_pickle #define __pyx_n_s_pj __pyx_mstate_global->__pyx_n_s_pj #define __pyx_n_s_plexname __pyx_mstate_global->__pyx_n_s_plexname #define __pyx_n_s_point __pyx_mstate_global->__pyx_n_s_point #define __pyx_n_s_points __pyx_mstate_global->__pyx_n_s_points #define __pyx_n_s_pop __pyx_mstate_global->__pyx_n_s_pop #define __pyx_n_s_popErrorHandler __pyx_mstate_global->__pyx_n_s_popErrorHandler #define __pyx_n_s_popSignalHandler __pyx_mstate_global->__pyx_n_s_popSignalHandler #define __pyx_n_s_pop_python_vfprintf __pyx_mstate_global->__pyx_n_s_pop_python_vfprintf #define __pyx_n_s_position __pyx_mstate_global->__pyx_n_s_position #define __pyx_n_s_positive_definite __pyx_mstate_global->__pyx_n_s_positive_definite #define __pyx_n_s_postSolve __pyx_mstate_global->__pyx_n_s_postSolve #define __pyx_n_s_postStep __pyx_mstate_global->__pyx_n_s_postStep #define __pyx_n_s_postevent __pyx_mstate_global->__pyx_n_s_postevent #define __pyx_n_s_poststep __pyx_mstate_global->__pyx_n_s_poststep #define __pyx_n_s_pre __pyx_mstate_global->__pyx_n_s_pre #define __pyx_n_s_preSolve __pyx_mstate_global->__pyx_n_s_preSolve #define __pyx_n_s_preStep __pyx_mstate_global->__pyx_n_s_preStep #define __pyx_n_s_pre_finalize __pyx_mstate_global->__pyx_n_s_pre_finalize #define __pyx_n_s_precheck __pyx_mstate_global->__pyx_n_s_precheck #define __pyx_n_s_prefix __pyx_mstate_global->__pyx_n_s_prefix #define __pyx_kp_s_prefix_s_name_s __pyx_mstate_global->__pyx_kp_s_prefix_s_name_s #define __pyx_n_s_prepare __pyx_mstate_global->__pyx_n_s_prepare #define __pyx_n_s_prestep __pyx_mstate_global->__pyx_n_s_prestep #define __pyx_n_s_primv __pyx_mstate_global->__pyx_n_s_primv #define __pyx_n_s_proc_sizes __pyx_mstate_global->__pyx_n_s_proc_sizes #define __pyx_n_s_productNumeric __pyx_mstate_global->__pyx_n_s_productNumeric #define __pyx_n_s_productSetFromOptions __pyx_mstate_global->__pyx_n_s_productSetFromOptions #define __pyx_n_s_productSymbolic __pyx_mstate_global->__pyx_n_s_productSymbolic #define __pyx_n_s_property __pyx_mstate_global->__pyx_n_s_property #define __pyx_n_s_ptap __pyx_mstate_global->__pyx_n_s_ptap #define __pyx_n_s_ptype __pyx_mstate_global->__pyx_n_s_ptype #define __pyx_n_s_push __pyx_mstate_global->__pyx_n_s_push #define __pyx_n_s_pushErrorHandler __pyx_mstate_global->__pyx_n_s_pushErrorHandler #define __pyx_n_s_push_python_vfprintf __pyx_mstate_global->__pyx_n_s_push_python_vfprintf #define __pyx_n_s_py_sub_ctxs __pyx_mstate_global->__pyx_n_s_py_sub_ctxs #define __pyx_n_s_py_type __pyx_mstate_global->__pyx_n_s_py_type #define __pyx_n_s_python __pyx_mstate_global->__pyx_n_s_python #define __pyx_n_s_pyx_PickleError __pyx_mstate_global->__pyx_n_s_pyx_PickleError #define __pyx_n_s_pyx_checksum __pyx_mstate_global->__pyx_n_s_pyx_checksum #define __pyx_n_s_pyx_result __pyx_mstate_global->__pyx_n_s_pyx_result #define __pyx_n_s_pyx_state __pyx_mstate_global->__pyx_n_s_pyx_state #define __pyx_n_s_pyx_type __pyx_mstate_global->__pyx_n_s_pyx_type #define __pyx_n_s_pyx_unpickle_Enum __pyx_mstate_global->__pyx_n_s_pyx_unpickle_Enum #define __pyx_n_s_pyx_vtable __pyx_mstate_global->__pyx_n_s_pyx_vtable #define __pyx_n_s_q0 __pyx_mstate_global->__pyx_n_s_q0 #define __pyx_n_s_q1 __pyx_mstate_global->__pyx_n_s_q1 #define __pyx_n_s_qorder __pyx_mstate_global->__pyx_n_s_qorder #define __pyx_n_s_quad __pyx_mstate_global->__pyx_n_s_quad #define __pyx_n_s_qualname __pyx_mstate_global->__pyx_n_s_qualname #define __pyx_n_s_r __pyx_mstate_global->__pyx_n_s_r #define __pyx_kp_s_r_2 __pyx_mstate_global->__pyx_kp_s_r_2 #define __pyx_n_s_radius __pyx_mstate_global->__pyx_n_s_radius #define __pyx_n_s_random __pyx_mstate_global->__pyx_n_s_random #define __pyx_n_s_range __pyx_mstate_global->__pyx_n_s_range #define __pyx_n_s_ranges __pyx_mstate_global->__pyx_n_s_ranges #define __pyx_n_s_rank __pyx_mstate_global->__pyx_n_s_rank #define __pyx_n_s_read __pyx_mstate_global->__pyx_n_s_read #define __pyx_n_s_readonly __pyx_mstate_global->__pyx_n_s_readonly #define __pyx_kp_s_readonly_attribute __pyx_mstate_global->__pyx_kp_s_readonly_attribute #define __pyx_n_s_ready __pyx_mstate_global->__pyx_n_s_ready #define __pyx_n_s_real __pyx_mstate_global->__pyx_n_s_real #define __pyx_n_s_realPart __pyx_mstate_global->__pyx_n_s_realPart #define __pyx_n_s_reason __pyx_mstate_global->__pyx_n_s_reason #define __pyx_n_s_reciprocal __pyx_mstate_global->__pyx_n_s_reciprocal #define __pyx_n_s_red __pyx_mstate_global->__pyx_n_s_red #define __pyx_n_s_reduce __pyx_mstate_global->__pyx_n_s_reduce #define __pyx_n_s_reduce_cython __pyx_mstate_global->__pyx_n_s_reduce_cython #define __pyx_n_s_reduce_ex __pyx_mstate_global->__pyx_n_s_reduce_ex #define __pyx_n_s_redundant __pyx_mstate_global->__pyx_n_s_redundant #define __pyx_n_s_redundantPoints __pyx_mstate_global->__pyx_n_s_redundantPoints #define __pyx_n_s_refine __pyx_mstate_global->__pyx_n_s_refine #define __pyx_n_s_refine_x __pyx_mstate_global->__pyx_n_s_refine_x #define __pyx_n_s_refine_y __pyx_mstate_global->__pyx_n_s_refine_y #define __pyx_n_s_refine_z __pyx_mstate_global->__pyx_n_s_refine_z #define __pyx_n_s_refinementLimit __pyx_mstate_global->__pyx_n_s_refinementLimit #define __pyx_n_s_refinementUniform __pyx_mstate_global->__pyx_n_s_refinementUniform #define __pyx_n_s_register __pyx_mstate_global->__pyx_n_s_register #define __pyx_n_s_registerCitation __pyx_mstate_global->__pyx_n_s_registerCitation #define __pyx_n_s_release __pyx_mstate_global->__pyx_n_s_release #define __pyx_n_s_remote __pyx_mstate_global->__pyx_n_s_remote #define __pyx_n_s_remoteOffsets __pyx_mstate_global->__pyx_n_s_remoteOffsets #define __pyx_n_s_remove __pyx_mstate_global->__pyx_n_s_remove #define __pyx_n_s_remove_sent_points __pyx_mstate_global->__pyx_n_s_remove_sent_points #define __pyx_n_s_replace __pyx_mstate_global->__pyx_n_s_replace #define __pyx_n_s_repr __pyx_mstate_global->__pyx_n_s_repr #define __pyx_n_s_res __pyx_mstate_global->__pyx_n_s_res #define __pyx_n_s_reset __pyx_mstate_global->__pyx_n_s_reset #define __pyx_n_s_reshape __pyx_mstate_global->__pyx_n_s_reshape #define __pyx_n_s_residual __pyx_mstate_global->__pyx_n_s_residual #define __pyx_n_s_restart __pyx_mstate_global->__pyx_n_s_restart #define __pyx_n_s_restrictAnisotropy __pyx_mstate_global->__pyx_n_s_restrictAnisotropy #define __pyx_n_s_restrictAnisotropyFirst __pyx_mstate_global->__pyx_n_s_restrictAnisotropyFirst #define __pyx_n_s_restrictSizes __pyx_mstate_global->__pyx_n_s_restrictSizes #define __pyx_n_s_restricthook __pyx_mstate_global->__pyx_n_s_restricthook #define __pyx_n_s_result __pyx_mstate_global->__pyx_n_s_result #define __pyx_n_s_reuse __pyx_mstate_global->__pyx_n_s_reuse #define __pyx_n_s_reverse __pyx_mstate_global->__pyx_n_s_reverse #define __pyx_n_s_rgLabel __pyx_mstate_global->__pyx_n_s_rgLabel #define __pyx_n_s_rhs __pyx_mstate_global->__pyx_n_s_rhs #define __pyx_n_s_rhsjacobianp __pyx_mstate_global->__pyx_n_s_rhsjacobianp #define __pyx_n_s_right __pyx_mstate_global->__pyx_n_s_right #define __pyx_n_s_rmap __pyx_mstate_global->__pyx_n_s_rmap #define __pyx_n_s_rnd_type __pyx_mstate_global->__pyx_n_s_rnd_type #define __pyx_n_s_rnorm __pyx_mstate_global->__pyx_n_s_rnorm #define __pyx_n_s_rollback __pyx_mstate_global->__pyx_n_s_rollback #define __pyx_n_s_rootSection __pyx_mstate_global->__pyx_n_s_rootSection #define __pyx_n_s_rootdata __pyx_mstate_global->__pyx_n_s_rootdata #define __pyx_n_s_row __pyx_mstate_global->__pyx_n_s_row #define __pyx_n_s_row_bsize __pyx_mstate_global->__pyx_n_s_row_bsize #define __pyx_kp_s_row_indices_must_have_two_dimens __pyx_mstate_global->__pyx_kp_s_row_indices_must_have_two_dimens #define __pyx_n_s_rowmap __pyx_mstate_global->__pyx_n_s_rowmap #define __pyx_n_s_rows __pyx_mstate_global->__pyx_n_s_rows #define __pyx_n_s_rscale __pyx_mstate_global->__pyx_n_s_rscale #define __pyx_n_s_rsplit __pyx_mstate_global->__pyx_n_s_rsplit #define __pyx_n_s_rtol __pyx_mstate_global->__pyx_n_s_rtol #define __pyx_n_s_rtol_0 __pyx_mstate_global->__pyx_n_s_rtol_0 #define __pyx_n_s_rtol_max __pyx_mstate_global->__pyx_n_s_rtol_max #define __pyx_n_s_rw __pyx_mstate_global->__pyx_n_s_rw #define __pyx_kp_s_s __pyx_mstate_global->__pyx_kp_s_s #define __pyx_n_s_s_2 __pyx_mstate_global->__pyx_n_s_s_2 #define __pyx_kp_s_s_at_s_d __pyx_mstate_global->__pyx_kp_s_s_at_s_d #define __pyx_kp_s_s_s __pyx_mstate_global->__pyx_kp_s_s_s #define __pyx_n_s_scale __pyx_mstate_global->__pyx_n_s_scale #define __pyx_n_s_scatter __pyx_mstate_global->__pyx_n_s_scatter #define __pyx_n_s_scatterBegin __pyx_mstate_global->__pyx_n_s_scatterBegin #define __pyx_n_s_scatterEnd __pyx_mstate_global->__pyx_n_s_scatterEnd #define __pyx_n_s_scatter_type __pyx_mstate_global->__pyx_n_s_scatter_type #define __pyx_n_s_sec __pyx_mstate_global->__pyx_n_s_sec #define __pyx_n_s_seconds __pyx_mstate_global->__pyx_n_s_seconds #define __pyx_n_s_sectiondm __pyx_mstate_global->__pyx_n_s_sectiondm #define __pyx_n_s_seed __pyx_mstate_global->__pyx_n_s_seed #define __pyx_n_s_selected __pyx_mstate_global->__pyx_n_s_selected #define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self #define __pyx_n_s_sep __pyx_mstate_global->__pyx_n_s_sep #define __pyx_n_s_setActive __pyx_mstate_global->__pyx_n_s_setActive #define __pyx_n_s_setActiveAll __pyx_mstate_global->__pyx_n_s_setActiveAll #define __pyx_n_s_setAppCtx __pyx_mstate_global->__pyx_n_s_setAppCtx #define __pyx_n_s_setApplicationContext __pyx_mstate_global->__pyx_n_s_setApplicationContext #define __pyx_n_s_setConvergedReason __pyx_mstate_global->__pyx_n_s_setConvergedReason #define __pyx_n_s_setCurrent __pyx_mstate_global->__pyx_n_s_setCurrent #define __pyx_n_s_setDM __pyx_mstate_global->__pyx_n_s_setDM #define __pyx_n_s_setDS __pyx_mstate_global->__pyx_n_s_setDS #define __pyx_n_s_setDefaultComm __pyx_mstate_global->__pyx_n_s_setDefaultComm #define __pyx_n_s_setDefaultGlobalSection __pyx_mstate_global->__pyx_n_s_setDefaultGlobalSection #define __pyx_n_s_setDefaultLocalSection __pyx_mstate_global->__pyx_n_s_setDefaultLocalSection #define __pyx_n_s_setDefaultSF __pyx_mstate_global->__pyx_n_s_setDefaultSF #define __pyx_n_s_setDefaultSection __pyx_mstate_global->__pyx_n_s_setDefaultSection #define __pyx_n_s_setDefaultType __pyx_mstate_global->__pyx_n_s_setDefaultType #define __pyx_n_s_setDevice __pyx_mstate_global->__pyx_n_s_setDevice #define __pyx_n_s_setDiagonal __pyx_mstate_global->__pyx_n_s_setDiagonal #define __pyx_n_s_setDimension __pyx_mstate_global->__pyx_n_s_setDimension #define __pyx_n_s_setEquationType __pyx_mstate_global->__pyx_n_s_setEquationType #define __pyx_n_s_setFromOptions __pyx_mstate_global->__pyx_n_s_setFromOptions #define __pyx_n_s_setFunctionNorm __pyx_mstate_global->__pyx_n_s_setFunctionNorm #define __pyx_n_s_setFunctionTolerances __pyx_mstate_global->__pyx_n_s_setFunctionTolerances #define __pyx_n_s_setGlobalSection __pyx_mstate_global->__pyx_n_s_setGlobalSection #define __pyx_n_s_setInitial __pyx_mstate_global->__pyx_n_s_setInitial #define __pyx_n_s_setInitialGuessKnoll __pyx_mstate_global->__pyx_n_s_setInitialGuessKnoll #define __pyx_n_s_setInitialGuessNonzero __pyx_mstate_global->__pyx_n_s_setInitialGuessNonzero #define __pyx_n_s_setInterval __pyx_mstate_global->__pyx_n_s_setInterval #define __pyx_n_s_setIterationNumber __pyx_mstate_global->__pyx_n_s_setIterationNumber #define __pyx_n_s_setKSP __pyx_mstate_global->__pyx_n_s_setKSP #define __pyx_n_s_setLocalSection __pyx_mstate_global->__pyx_n_s_setLocalSection #define __pyx_n_s_setMaxFunctionEvaluations __pyx_mstate_global->__pyx_n_s_setMaxFunctionEvaluations #define __pyx_n_s_setMaxKSPFailures __pyx_mstate_global->__pyx_n_s_setMaxKSPFailures #define __pyx_n_s_setMaxLinearSolveFailures __pyx_mstate_global->__pyx_n_s_setMaxLinearSolveFailures #define __pyx_n_s_setMaxNonlinearStepFailures __pyx_mstate_global->__pyx_n_s_setMaxNonlinearStepFailures #define __pyx_n_s_setMaxStepFailures __pyx_mstate_global->__pyx_n_s_setMaxStepFailures #define __pyx_n_s_setMaxSteps __pyx_mstate_global->__pyx_n_s_setMaxSteps #define __pyx_n_s_setMaxTime __pyx_mstate_global->__pyx_n_s_setMaxTime #define __pyx_n_s_setMonitor __pyx_mstate_global->__pyx_n_s_setMonitor #define __pyx_n_s_setNPC __pyx_mstate_global->__pyx_n_s_setNPC #define __pyx_n_s_setName __pyx_mstate_global->__pyx_n_s_setName #define __pyx_n_s_setNormType __pyx_mstate_global->__pyx_n_s_setNormType #define __pyx_n_s_setOption __pyx_mstate_global->__pyx_n_s_setOption #define __pyx_n_s_setOptionsPrefix __pyx_mstate_global->__pyx_n_s_setOptionsPrefix #define __pyx_n_s_setPCSide __pyx_mstate_global->__pyx_n_s_setPCSide #define __pyx_n_s_setParamsEW __pyx_mstate_global->__pyx_n_s_setParamsEW #define __pyx_n_s_setProblemType __pyx_mstate_global->__pyx_n_s_setProblemType #define __pyx_n_s_setResidualNorm __pyx_mstate_global->__pyx_n_s_setResidualNorm #define __pyx_n_s_setSection __pyx_mstate_global->__pyx_n_s_setSection #define __pyx_n_s_setSectionSF __pyx_mstate_global->__pyx_n_s_setSectionSF #define __pyx_n_s_setSeed __pyx_mstate_global->__pyx_n_s_setSeed #define __pyx_n_s_setSizes __pyx_mstate_global->__pyx_n_s_setSizes #define __pyx_n_s_setSolution __pyx_mstate_global->__pyx_n_s_setSolution #define __pyx_n_s_setStepNumber __pyx_mstate_global->__pyx_n_s_setStepNumber #define __pyx_n_s_setStreamType __pyx_mstate_global->__pyx_n_s_setStreamType #define __pyx_n_s_setTime __pyx_mstate_global->__pyx_n_s_setTime #define __pyx_n_s_setTimeStep __pyx_mstate_global->__pyx_n_s_setTimeStep #define __pyx_n_s_setTolerances __pyx_mstate_global->__pyx_n_s_setTolerances #define __pyx_n_s_setType __pyx_mstate_global->__pyx_n_s_setType #define __pyx_n_s_setUp __pyx_mstate_global->__pyx_n_s_setUp #define __pyx_n_s_setUseEW __pyx_mstate_global->__pyx_n_s_setUseEW #define __pyx_n_s_setUseFD __pyx_mstate_global->__pyx_n_s_setUseFD #define __pyx_n_s_setUseMF __pyx_mstate_global->__pyx_n_s_setUseMF #define __pyx_n_s_setValue __pyx_mstate_global->__pyx_n_s_setValue #define __pyx_n_s_setVisible __pyx_mstate_global->__pyx_n_s_setVisible #define __pyx_n_s_set_name __pyx_mstate_global->__pyx_n_s_set_name #define __pyx_n_s_setstate __pyx_mstate_global->__pyx_n_s_setstate #define __pyx_n_s_setstate_cython __pyx_mstate_global->__pyx_n_s_setstate_cython #define __pyx_n_s_setup __pyx_mstate_global->__pyx_n_s_setup #define __pyx_n_s_sf __pyx_mstate_global->__pyx_n_s_sf #define __pyx_n_s_sf_type __pyx_mstate_global->__pyx_n_s_sf_type #define __pyx_n_s_sfxc __pyx_mstate_global->__pyx_n_s_sfxc #define __pyx_n_s_shape __pyx_mstate_global->__pyx_n_s_shape #define __pyx_n_s_shift __pyx_mstate_global->__pyx_n_s_shift #define __pyx_n_s_shift_type __pyx_mstate_global->__pyx_n_s_shift_type #define __pyx_n_s_shiftamount __pyx_mstate_global->__pyx_n_s_shiftamount #define __pyx_n_s_shifttype __pyx_mstate_global->__pyx_n_s_shifttype #define __pyx_n_s_side __pyx_mstate_global->__pyx_n_s_side #define __pyx_kp_s_side_r_not_understood __pyx_mstate_global->__pyx_kp_s_side_r_not_understood #define __pyx_n_s_simplex __pyx_mstate_global->__pyx_n_s_simplex #define __pyx_n_s_size __pyx_mstate_global->__pyx_n_s_size #define __pyx_kp_s_size_I_is_d_expected_d __pyx_mstate_global->__pyx_kp_s_size_I_is_d_expected_d #define __pyx_kp_s_size_J_is_d_expected_d __pyx_mstate_global->__pyx_kp_s_size_J_is_d_expected_d #define __pyx_kp_s_size_V_is_d_expected_d __pyx_mstate_global->__pyx_kp_s_size_V_is_d_expected_d #define __pyx_kp_s_size_array_is_d_expected_dx_d_d __pyx_mstate_global->__pyx_kp_s_size_array_is_d_expected_dx_d_d #define __pyx_kp_s_size_d_nnz_is_d_expected_d __pyx_mstate_global->__pyx_kp_s_size_d_nnz_is_d_expected_d #define __pyx_kp_s_size_o_nnz_is_d_expected_d __pyx_mstate_global->__pyx_kp_s_size_o_nnz_is_d_expected_d #define __pyx_n_s_sizes __pyx_mstate_global->__pyx_n_s_sizes #define __pyx_kp_s_sizes_array_should_have_d_entrie __pyx_mstate_global->__pyx_kp_s_sizes_array_should_have_d_entrie #define __pyx_n_s_skip __pyx_mstate_global->__pyx_n_s_skip #define __pyx_n_s_sleep __pyx_mstate_global->__pyx_n_s_sleep #define __pyx_n_s_smooths __pyx_mstate_global->__pyx_n_s_smooths #define __pyx_n_s_snes __pyx_mstate_global->__pyx_n_s_snes #define __pyx_n_s_snes_type __pyx_mstate_global->__pyx_n_s_snes_type #define __pyx_n_s_solve __pyx_mstate_global->__pyx_n_s_solve #define __pyx_n_s_solveAdd __pyx_mstate_global->__pyx_n_s_solveAdd #define __pyx_n_s_solveStep __pyx_mstate_global->__pyx_n_s_solveStep #define __pyx_n_s_solveTranspose __pyx_mstate_global->__pyx_n_s_solveTranspose #define __pyx_n_s_solveTransposeAdd __pyx_mstate_global->__pyx_n_s_solveTransposeAdd #define __pyx_n_s_solver __pyx_mstate_global->__pyx_n_s_solver #define __pyx_n_s_sortype __pyx_mstate_global->__pyx_n_s_sortype #define __pyx_n_s_sp __pyx_mstate_global->__pyx_n_s_sp #define __pyx_n_s_space_type __pyx_mstate_global->__pyx_n_s_space_type #define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec #define __pyx_n_s_split __pyx_mstate_global->__pyx_n_s_split #define __pyx_n_s_splitOwnership __pyx_mstate_global->__pyx_n_s_splitOwnership #define __pyx_n_s_stage __pyx_mstate_global->__pyx_n_s_stage #define __pyx_n_s_star __pyx_mstate_global->__pyx_n_s_star #define __pyx_n_s_start __pyx_mstate_global->__pyx_n_s_start #define __pyx_n_s_starts __pyx_mstate_global->__pyx_n_s_starts #define __pyx_n_s_startswith __pyx_mstate_global->__pyx_n_s_startswith #define __pyx_n_s_state __pyx_mstate_global->__pyx_n_s_state #define __pyx_n_s_staticmethod __pyx_mstate_global->__pyx_n_s_staticmethod #define __pyx_n_s_staticproperty __pyx_mstate_global->__pyx_n_s_staticproperty #define __pyx_n_s_staticproperty___get __pyx_mstate_global->__pyx_n_s_staticproperty___get #define __pyx_n_s_stderr __pyx_mstate_global->__pyx_n_s_stderr #define __pyx_n_s_stderr_2 __pyx_mstate_global->__pyx_n_s_stderr_2 #define __pyx_n_s_stdout __pyx_mstate_global->__pyx_n_s_stdout #define __pyx_n_s_stdout_2 __pyx_mstate_global->__pyx_n_s_stdout_2 #define __pyx_n_s_stdout_is_stderr __pyx_mstate_global->__pyx_n_s_stdout_is_stderr #define __pyx_n_s_stencil_type __pyx_mstate_global->__pyx_n_s_stencil_type #define __pyx_n_s_stencil_width __pyx_mstate_global->__pyx_n_s_stencil_width #define __pyx_n_s_stenciltype __pyx_mstate_global->__pyx_n_s_stenciltype #define __pyx_n_s_step __pyx_mstate_global->__pyx_n_s_step #define __pyx_n_s_stepTranspose __pyx_mstate_global->__pyx_n_s_stepTranspose #define __pyx_n_s_step_number __pyx_mstate_global->__pyx_n_s_step_number #define __pyx_n_s_stol __pyx_mstate_global->__pyx_n_s_stol #define __pyx_n_s_stop __pyx_mstate_global->__pyx_n_s_stop #define __pyx_n_s_str __pyx_mstate_global->__pyx_n_s_str #define __pyx_n_s_strata __pyx_mstate_global->__pyx_n_s_strata #define __pyx_n_s_stratum __pyx_mstate_global->__pyx_n_s_stratum #define __pyx_n_s_stream __pyx_mstate_global->__pyx_n_s_stream #define __pyx_n_s_stream_type __pyx_mstate_global->__pyx_n_s_stream_type #define __pyx_kp_s_strided_and_direct __pyx_mstate_global->__pyx_kp_s_strided_and_direct #define __pyx_kp_s_strided_and_direct_or_indirect __pyx_mstate_global->__pyx_kp_s_strided_and_direct_or_indirect #define __pyx_kp_s_strided_and_indirect __pyx_mstate_global->__pyx_kp_s_strided_and_indirect #define __pyx_n_s_strides __pyx_mstate_global->__pyx_n_s_strides #define __pyx_n_s_string __pyx_mstate_global->__pyx_n_s_string #define __pyx_kp_s_stringsource __pyx_mstate_global->__pyx_kp_s_stringsource #define __pyx_n_s_strip __pyx_mstate_global->__pyx_n_s_strip #define __pyx_n_s_struct __pyx_mstate_global->__pyx_n_s_struct #define __pyx_n_s_structure __pyx_mstate_global->__pyx_n_s_structure #define __pyx_n_s_sub __pyx_mstate_global->__pyx_n_s_sub #define __pyx_n_s_subcomm __pyx_mstate_global->__pyx_n_s_subcomm #define __pyx_n_s_subdm __pyx_mstate_global->__pyx_n_s_subdm #define __pyx_n_s_submat __pyx_mstate_global->__pyx_n_s_submat #define __pyx_n_s_submats __pyx_mstate_global->__pyx_n_s_submats #define __pyx_n_s_subminor __pyx_mstate_global->__pyx_n_s_subminor #define __pyx_n_s_subsp __pyx_mstate_global->__pyx_n_s_subsp #define __pyx_n_s_subspaceOffsets __pyx_mstate_global->__pyx_n_s_subspaceOffsets #define __pyx_n_s_subvec __pyx_mstate_global->__pyx_n_s_subvec #define __pyx_n_s_super __pyx_mstate_global->__pyx_n_s_super #define __pyx_n_s_supp __pyx_mstate_global->__pyx_n_s_supp #define __pyx_n_s_svalue __pyx_mstate_global->__pyx_n_s_svalue #define __pyx_n_s_swidth __pyx_mstate_global->__pyx_n_s_swidth #define __pyx_n_s_sx __pyx_mstate_global->__pyx_n_s_sx #define __pyx_n_s_sym __pyx_mstate_global->__pyx_n_s_sym #define __pyx_n_s_symmetric __pyx_mstate_global->__pyx_n_s_symmetric #define __pyx_n_s_syncFlush __pyx_mstate_global->__pyx_n_s_syncFlush #define __pyx_n_s_syncPrint __pyx_mstate_global->__pyx_n_s_syncPrint #define __pyx_n_s_sys __pyx_mstate_global->__pyx_n_s_sys #define __pyx_n_s_t __pyx_mstate_global->__pyx_n_s_t #define __pyx_n_s_tab __pyx_mstate_global->__pyx_n_s_tab #define __pyx_n_s_tabs __pyx_mstate_global->__pyx_n_s_tabs #define __pyx_n_s_tao __pyx_mstate_global->__pyx_n_s_tao #define __pyx_n_s_tao_type __pyx_mstate_global->__pyx_n_s_tao_type #define __pyx_n_s_targetComplexity __pyx_mstate_global->__pyx_n_s_targetComplexity #define __pyx_n_s_tbline __pyx_mstate_global->__pyx_n_s_tbline #define __pyx_n_s_tblist __pyx_mstate_global->__pyx_n_s_tblist #define __pyx_n_s_tensor __pyx_mstate_global->__pyx_n_s_tensor #define __pyx_n_s_terminate __pyx_mstate_global->__pyx_n_s_terminate #define __pyx_n_s_theta __pyx_mstate_global->__pyx_n_s_theta #define __pyx_n_s_threshold __pyx_mstate_global->__pyx_n_s_threshold #define __pyx_n_s_time __pyx_mstate_global->__pyx_n_s_time #define __pyx_n_s_time_step __pyx_mstate_global->__pyx_n_s_time_step #define __pyx_n_s_timestep __pyx_mstate_global->__pyx_n_s_timestep #define __pyx_n_s_title __pyx_mstate_global->__pyx_n_s_title #define __pyx_n_s_toAll __pyx_mstate_global->__pyx_n_s_toAll #define __pyx_n_s_toDLPack __pyx_mstate_global->__pyx_n_s_toDLPack #define __pyx_n_s_toZero __pyx_mstate_global->__pyx_n_s_toZero #define __pyx_n_s_toindx __pyx_mstate_global->__pyx_n_s_toindx #define __pyx_n_s_tol __pyx_mstate_global->__pyx_n_s_tol #define __pyx_n_s_tr_type __pyx_mstate_global->__pyx_n_s_tr_type #define __pyx_n_s_traceback __pyx_mstate_global->__pyx_n_s_traceback #define __pyx_n_s_traceback_2 __pyx_mstate_global->__pyx_n_s_traceback_2 #define __pyx_n_s_trans __pyx_mstate_global->__pyx_n_s_trans #define __pyx_n_s_transpose __pyx_mstate_global->__pyx_n_s_transpose #define __pyx_n_s_trimmed __pyx_mstate_global->__pyx_n_s_trimmed #define __pyx_n_s_ts_type __pyx_mstate_global->__pyx_n_s_ts_type #define __pyx_n_s_tspan __pyx_mstate_global->__pyx_n_s_tspan #define __pyx_n_s_twist __pyx_mstate_global->__pyx_n_s_twist #define __pyx_n_s_typ __pyx_mstate_global->__pyx_n_s_typ #define __pyx_n_s_type_registry __pyx_mstate_global->__pyx_n_s_type_registry #define __pyx_n_s_typestr __pyx_mstate_global->__pyx_n_s_typestr #define __pyx_n_s_u __pyx_mstate_global->__pyx_n_s_u #define __pyx_n_s_ua __pyx_mstate_global->__pyx_n_s_ua #define __pyx_n_s_uaux __pyx_mstate_global->__pyx_n_s_uaux #define __pyx_n_s_uis __pyx_mstate_global->__pyx_n_s_uis #define __pyx_kp_s_unable_to_allocate_array_data __pyx_mstate_global->__pyx_kp_s_unable_to_allocate_array_data #define __pyx_kp_s_unable_to_allocate_shape_and_str __pyx_mstate_global->__pyx_kp_s_unable_to_allocate_shape_and_str #define __pyx_kp_s_unhandled_PetscDeviceContextJoin __pyx_mstate_global->__pyx_kp_s_unhandled_PetscDeviceContextJoin #define __pyx_kp_s_unhandled_PetscDeviceType_d __pyx_mstate_global->__pyx_kp_s_unhandled_PetscDeviceType_d #define __pyx_kp_s_unhandled_PetscStreamType_d __pyx_mstate_global->__pyx_kp_s_unhandled_PetscStreamType_d #define __pyx_n_s_uniform __pyx_mstate_global->__pyx_n_s_uniform #define __pyx_n_s_unit __pyx_mstate_global->__pyx_n_s_unit #define __pyx_kp_s_unknown_boundary_type_s __pyx_mstate_global->__pyx_kp_s_unknown_boundary_type_s #define __pyx_kp_s_unknown_device_type_s __pyx_mstate_global->__pyx_kp_s_unknown_device_type_s #define __pyx_kp_s_unknown_element_type_s __pyx_mstate_global->__pyx_kp_s_unknown_element_type_s #define __pyx_kp_u_unknown_error_handler __pyx_mstate_global->__pyx_kp_u_unknown_error_handler #define __pyx_kp_s_unknown_interpolation_type_s __pyx_mstate_global->__pyx_kp_s_unknown_interpolation_type_s #define __pyx_kp_s_unknown_join_mode_s __pyx_mstate_global->__pyx_kp_s_unknown_join_mode_s #define __pyx_kp_s_unknown_options_s __pyx_mstate_global->__pyx_kp_s_unknown_options_s #define __pyx_kp_s_unknown_scatter_mode_s __pyx_mstate_global->__pyx_kp_s_unknown_scatter_mode_s #define __pyx_kp_s_unknown_shift_type_s __pyx_mstate_global->__pyx_kp_s_unknown_shift_type_s #define __pyx_kp_s_unknown_stencil_location_type_s __pyx_mstate_global->__pyx_kp_s_unknown_stencil_location_type_s #define __pyx_kp_s_unknown_stencil_type_s __pyx_mstate_global->__pyx_kp_s_unknown_stencil_type_s #define __pyx_kp_s_unknown_stream_type_s __pyx_mstate_global->__pyx_kp_s_unknown_stream_type_s #define __pyx_n_s_unnamed __pyx_mstate_global->__pyx_n_s_unnamed #define __pyx_n_s_unpack __pyx_mstate_global->__pyx_n_s_unpack #define __pyx_n_s_up __pyx_mstate_global->__pyx_n_s_up #define __pyx_n_s_up_left __pyx_mstate_global->__pyx_n_s_up_left #define __pyx_n_s_up_right __pyx_mstate_global->__pyx_n_s_up_right #define __pyx_n_s_update __pyx_mstate_global->__pyx_n_s_update #define __pyx_n_s_upper __pyx_mstate_global->__pyx_n_s_upper #define __pyx_n_s_useAnchors __pyx_mstate_global->__pyx_n_s_useAnchors #define __pyx_n_s_useClosure __pyx_mstate_global->__pyx_n_s_useClosure #define __pyx_n_s_useCone __pyx_mstate_global->__pyx_n_s_useCone #define __pyx_n_s_useInitialGuess __pyx_mstate_global->__pyx_n_s_useInitialGuess #define __pyx_n_s_v __pyx_mstate_global->__pyx_n_s_v #define __pyx_n_s_val __pyx_mstate_global->__pyx_n_s_val #define __pyx_n_s_value __pyx_mstate_global->__pyx_n_s_value #define __pyx_n_s_values __pyx_mstate_global->__pyx_n_s_values #define __pyx_kp_s_values_must_have_two_or_more_dim __pyx_mstate_global->__pyx_kp_s_values_must_have_two_or_more_dim #define __pyx_n_s_varbounds __pyx_mstate_global->__pyx_n_s_varbounds #define __pyx_n_s_vec __pyx_mstate_global->__pyx_n_s_vec #define __pyx_n_s_vecTo __pyx_mstate_global->__pyx_n_s_vecTo #define __pyx_n_s_vec_from __pyx_mstate_global->__pyx_n_s_vec_from #define __pyx_n_s_vec_to __pyx_mstate_global->__pyx_n_s_vec_to #define __pyx_n_s_vec_type __pyx_mstate_global->__pyx_n_s_vec_type #define __pyx_n_s_vecs __pyx_mstate_global->__pyx_n_s_vecs #define __pyx_n_s_vectors __pyx_mstate_global->__pyx_n_s_vectors #define __pyx_n_s_verbosity __pyx_mstate_global->__pyx_n_s_verbosity #define __pyx_n_s_version __pyx_mstate_global->__pyx_n_s_version #define __pyx_n_s_version_info __pyx_mstate_global->__pyx_n_s_version_info #define __pyx_n_s_vg __pyx_mstate_global->__pyx_n_s_vg #define __pyx_n_s_viennaclvechandle __pyx_mstate_global->__pyx_n_s_viennaclvechandle #define __pyx_n_s_view __pyx_mstate_global->__pyx_n_s_view #define __pyx_n_s_viewer __pyx_mstate_global->__pyx_n_s_viewer #define __pyx_n_s_vl __pyx_mstate_global->__pyx_n_s_vl #define __pyx_n_s_vlg __pyx_mstate_global->__pyx_n_s_vlg #define __pyx_n_s_vm __pyx_mstate_global->__pyx_n_s_vm #define __pyx_n_s_vn __pyx_mstate_global->__pyx_n_s_vn #define __pyx_n_s_vtol __pyx_mstate_global->__pyx_n_s_vtol #define __pyx_n_s_vwr_type __pyx_mstate_global->__pyx_n_s_vwr_type #define __pyx_n_s_w __pyx_mstate_global->__pyx_n_s_w #define __pyx_kp_s_w_2 __pyx_mstate_global->__pyx_kp_s_w_2 #define __pyx_n_s_weight __pyx_mstate_global->__pyx_n_s_weight #define __pyx_n_s_width __pyx_mstate_global->__pyx_n_s_width #define __pyx_n_s_wrapped_func __pyx_mstate_global->__pyx_n_s_wrapped_func #define __pyx_n_s_wraps __pyx_mstate_global->__pyx_n_s_wraps #define __pyx_n_s_write __pyx_mstate_global->__pyx_n_s_write #define __pyx_n_s_x __pyx_mstate_global->__pyx_n_s_x #define __pyx_n_s_xdot __pyx_mstate_global->__pyx_n_s_xdot #define __pyx_n_s_xdotdot __pyx_mstate_global->__pyx_n_s_xdotdot #define __pyx_n_s_xl __pyx_mstate_global->__pyx_n_s_xl #define __pyx_n_s_xmax __pyx_mstate_global->__pyx_n_s_xmax #define __pyx_n_s_xmin __pyx_mstate_global->__pyx_n_s_xmin #define __pyx_n_s_xnorm __pyx_mstate_global->__pyx_n_s_xnorm #define __pyx_n_s_xu __pyx_mstate_global->__pyx_n_s_xu #define __pyx_n_s_y __pyx_mstate_global->__pyx_n_s_y #define __pyx_n_s_ymax __pyx_mstate_global->__pyx_n_s_ymax #define __pyx_n_s_ymin __pyx_mstate_global->__pyx_n_s_ymin #define __pyx_n_s_ynorm __pyx_mstate_global->__pyx_n_s_ynorm #define __pyx_n_s_zeroEntries __pyx_mstate_global->__pyx_n_s_zeroEntries #define __pyx_n_s_zeroRowsColumns __pyx_mstate_global->__pyx_n_s_zeroRowsColumns #define __pyx_n_s_zeropivot __pyx_mstate_global->__pyx_n_s_zeropivot #define __pyx_n_s_zmax __pyx_mstate_global->__pyx_n_s_zmax #define __pyx_n_s_zmin __pyx_mstate_global->__pyx_n_s_zmin #define __pyx_n_s_zoz __pyx_mstate_global->__pyx_n_s_zoz #define __pyx_n_s_zzo __pyx_mstate_global->__pyx_n_s_zzo #define __pyx_float_0_ __pyx_mstate_global->__pyx_float_0_ #define __pyx_float_0_0 __pyx_mstate_global->__pyx_float_0_0 #define __pyx_float_1_0 __pyx_mstate_global->__pyx_float_1_0 #define __pyx_int_0 __pyx_mstate_global->__pyx_int_0 #define __pyx_int_1 __pyx_mstate_global->__pyx_int_1 #define __pyx_int_2 __pyx_mstate_global->__pyx_int_2 #define __pyx_int_3 __pyx_mstate_global->__pyx_int_3 #define __pyx_int_4 __pyx_mstate_global->__pyx_int_4 #define __pyx_int_5 __pyx_mstate_global->__pyx_int_5 #define __pyx_int_6 __pyx_mstate_global->__pyx_int_6 #define __pyx_int_7 __pyx_mstate_global->__pyx_int_7 #define __pyx_int_8 __pyx_mstate_global->__pyx_int_8 #define __pyx_int_9 __pyx_mstate_global->__pyx_int_9 #define __pyx_int_10 __pyx_mstate_global->__pyx_int_10 #define __pyx_int_13 __pyx_mstate_global->__pyx_int_13 #define __pyx_int_17 __pyx_mstate_global->__pyx_int_17 #define __pyx_int_18 __pyx_mstate_global->__pyx_int_18 #define __pyx_int_19 __pyx_mstate_global->__pyx_int_19 #define __pyx_int_23 __pyx_mstate_global->__pyx_int_23 #define __pyx_int_32 __pyx_mstate_global->__pyx_int_32 #define __pyx_int_34 __pyx_mstate_global->__pyx_int_34 #define __pyx_int_43 __pyx_mstate_global->__pyx_int_43 #define __pyx_int_45 __pyx_mstate_global->__pyx_int_45 #define __pyx_int_46 __pyx_mstate_global->__pyx_int_46 #define __pyx_int_47 __pyx_mstate_global->__pyx_int_47 #define __pyx_int_48 __pyx_mstate_global->__pyx_int_48 #define __pyx_int_59 __pyx_mstate_global->__pyx_int_59 #define __pyx_int_88 __pyx_mstate_global->__pyx_int_88 #define __pyx_int_102 __pyx_mstate_global->__pyx_int_102 #define __pyx_int_105 __pyx_mstate_global->__pyx_int_105 #define __pyx_int_106 __pyx_mstate_global->__pyx_int_106 #define __pyx_int_113 __pyx_mstate_global->__pyx_int_113 #define __pyx_int_119 __pyx_mstate_global->__pyx_int_119 #define __pyx_int_121 __pyx_mstate_global->__pyx_int_121 #define __pyx_int_122 __pyx_mstate_global->__pyx_int_122 #define __pyx_int_112105877 __pyx_mstate_global->__pyx_int_112105877 #define __pyx_int_136983863 __pyx_mstate_global->__pyx_int_136983863 #define __pyx_int_184977713 __pyx_mstate_global->__pyx_int_184977713 #define __pyx_int_neg_1 __pyx_mstate_global->__pyx_int_neg_1 #define __pyx_k__41 __pyx_mstate_global->__pyx_k__41 #define __pyx_k__49 __pyx_mstate_global->__pyx_k__49 #define __pyx_k__50 __pyx_mstate_global->__pyx_k__50 #define __pyx_k__63 __pyx_mstate_global->__pyx_k__63 #define __pyx_slice__5 __pyx_mstate_global->__pyx_slice__5 #define __pyx_tuple__4 __pyx_mstate_global->__pyx_tuple__4 #define __pyx_tuple__8 __pyx_mstate_global->__pyx_tuple__8 #define __pyx_slice__20 __pyx_mstate_global->__pyx_slice__20 #define __pyx_slice__58 __pyx_mstate_global->__pyx_slice__58 #define __pyx_slice__59 __pyx_mstate_global->__pyx_slice__59 #define __pyx_tuple__15 __pyx_mstate_global->__pyx_tuple__15 #define __pyx_tuple__17 __pyx_mstate_global->__pyx_tuple__17 #define __pyx_tuple__19 __pyx_mstate_global->__pyx_tuple__19 #define __pyx_tuple__21 __pyx_mstate_global->__pyx_tuple__21 #define __pyx_tuple__22 __pyx_mstate_global->__pyx_tuple__22 #define __pyx_tuple__23 __pyx_mstate_global->__pyx_tuple__23 #define __pyx_tuple__24 __pyx_mstate_global->__pyx_tuple__24 #define __pyx_tuple__25 __pyx_mstate_global->__pyx_tuple__25 #define __pyx_tuple__27 __pyx_mstate_global->__pyx_tuple__27 #define __pyx_tuple__28 __pyx_mstate_global->__pyx_tuple__28 #define __pyx_tuple__29 __pyx_mstate_global->__pyx_tuple__29 #define __pyx_tuple__30 __pyx_mstate_global->__pyx_tuple__30 #define __pyx_tuple__31 __pyx_mstate_global->__pyx_tuple__31 #define __pyx_tuple__32 __pyx_mstate_global->__pyx_tuple__32 #define __pyx_tuple__33 __pyx_mstate_global->__pyx_tuple__33 #define __pyx_tuple__35 __pyx_mstate_global->__pyx_tuple__35 #define __pyx_tuple__37 __pyx_mstate_global->__pyx_tuple__37 #define __pyx_tuple__38 __pyx_mstate_global->__pyx_tuple__38 #define __pyx_tuple__39 __pyx_mstate_global->__pyx_tuple__39 #define __pyx_tuple__40 __pyx_mstate_global->__pyx_tuple__40 #define __pyx_tuple__42 __pyx_mstate_global->__pyx_tuple__42 #define __pyx_tuple__43 __pyx_mstate_global->__pyx_tuple__43 #define __pyx_tuple__44 __pyx_mstate_global->__pyx_tuple__44 #define __pyx_tuple__45 __pyx_mstate_global->__pyx_tuple__45 #define __pyx_tuple__46 __pyx_mstate_global->__pyx_tuple__46 #define __pyx_tuple__47 __pyx_mstate_global->__pyx_tuple__47 #define __pyx_tuple__48 __pyx_mstate_global->__pyx_tuple__48 #define __pyx_tuple__51 __pyx_mstate_global->__pyx_tuple__51 #define __pyx_tuple__52 __pyx_mstate_global->__pyx_tuple__52 #define __pyx_tuple__53 __pyx_mstate_global->__pyx_tuple__53 #define __pyx_tuple__54 __pyx_mstate_global->__pyx_tuple__54 #define __pyx_tuple__55 __pyx_mstate_global->__pyx_tuple__55 #define __pyx_tuple__56 __pyx_mstate_global->__pyx_tuple__56 #define __pyx_tuple__57 __pyx_mstate_global->__pyx_tuple__57 #define __pyx_tuple__60 __pyx_mstate_global->__pyx_tuple__60 #define __pyx_tuple__61 __pyx_mstate_global->__pyx_tuple__61 #define __pyx_tuple__62 __pyx_mstate_global->__pyx_tuple__62 #define __pyx_tuple__64 __pyx_mstate_global->__pyx_tuple__64 #define __pyx_tuple__65 __pyx_mstate_global->__pyx_tuple__65 #define __pyx_tuple__66 __pyx_mstate_global->__pyx_tuple__66 #define __pyx_tuple__67 __pyx_mstate_global->__pyx_tuple__67 #define __pyx_tuple__68 __pyx_mstate_global->__pyx_tuple__68 #define __pyx_tuple__69 __pyx_mstate_global->__pyx_tuple__69 #define __pyx_tuple__70 __pyx_mstate_global->__pyx_tuple__70 #define __pyx_tuple__71 __pyx_mstate_global->__pyx_tuple__71 #define __pyx_tuple__72 __pyx_mstate_global->__pyx_tuple__72 #define __pyx_tuple__73 __pyx_mstate_global->__pyx_tuple__73 #define __pyx_tuple__74 __pyx_mstate_global->__pyx_tuple__74 #define __pyx_tuple__75 __pyx_mstate_global->__pyx_tuple__75 #define __pyx_tuple__76 __pyx_mstate_global->__pyx_tuple__76 #define __pyx_tuple__78 __pyx_mstate_global->__pyx_tuple__78 #define __pyx_tuple__79 __pyx_mstate_global->__pyx_tuple__79 #define __pyx_tuple__80 __pyx_mstate_global->__pyx_tuple__80 #define __pyx_tuple__81 __pyx_mstate_global->__pyx_tuple__81 #define __pyx_tuple__82 __pyx_mstate_global->__pyx_tuple__82 #define __pyx_tuple__83 __pyx_mstate_global->__pyx_tuple__83 #define __pyx_tuple__84 __pyx_mstate_global->__pyx_tuple__84 #define __pyx_tuple__85 __pyx_mstate_global->__pyx_tuple__85 #define __pyx_tuple__86 __pyx_mstate_global->__pyx_tuple__86 #define __pyx_tuple__89 __pyx_mstate_global->__pyx_tuple__89 #define __pyx_tuple__91 __pyx_mstate_global->__pyx_tuple__91 #define __pyx_tuple__93 __pyx_mstate_global->__pyx_tuple__93 #define __pyx_tuple__96 __pyx_mstate_global->__pyx_tuple__96 #define __pyx_tuple__97 __pyx_mstate_global->__pyx_tuple__97 #define __pyx_tuple__98 __pyx_mstate_global->__pyx_tuple__98 #define __pyx_tuple__99 __pyx_mstate_global->__pyx_tuple__99 #define __pyx_tuple__100 __pyx_mstate_global->__pyx_tuple__100 #define __pyx_tuple__101 __pyx_mstate_global->__pyx_tuple__101 #define __pyx_tuple__102 __pyx_mstate_global->__pyx_tuple__102 #define __pyx_tuple__103 __pyx_mstate_global->__pyx_tuple__103 #define __pyx_tuple__104 __pyx_mstate_global->__pyx_tuple__104 #define __pyx_tuple__105 __pyx_mstate_global->__pyx_tuple__105 #define __pyx_tuple__106 __pyx_mstate_global->__pyx_tuple__106 #define __pyx_tuple__107 __pyx_mstate_global->__pyx_tuple__107 #define __pyx_tuple__108 __pyx_mstate_global->__pyx_tuple__108 #define __pyx_tuple__110 __pyx_mstate_global->__pyx_tuple__110 #define __pyx_tuple__112 __pyx_mstate_global->__pyx_tuple__112 #define __pyx_tuple__114 __pyx_mstate_global->__pyx_tuple__114 #define __pyx_tuple__116 __pyx_mstate_global->__pyx_tuple__116 #define __pyx_tuple__117 __pyx_mstate_global->__pyx_tuple__117 #define __pyx_tuple__118 __pyx_mstate_global->__pyx_tuple__118 #define __pyx_tuple__119 __pyx_mstate_global->__pyx_tuple__119 #define __pyx_tuple__120 __pyx_mstate_global->__pyx_tuple__120 #define __pyx_tuple__121 __pyx_mstate_global->__pyx_tuple__121 #define __pyx_tuple__122 __pyx_mstate_global->__pyx_tuple__122 #define __pyx_tuple__123 __pyx_mstate_global->__pyx_tuple__123 #define __pyx_tuple__124 __pyx_mstate_global->__pyx_tuple__124 #define __pyx_tuple__125 __pyx_mstate_global->__pyx_tuple__125 #define __pyx_tuple__126 __pyx_mstate_global->__pyx_tuple__126 #define __pyx_tuple__127 __pyx_mstate_global->__pyx_tuple__127 #define __pyx_tuple__128 __pyx_mstate_global->__pyx_tuple__128 #define __pyx_tuple__129 __pyx_mstate_global->__pyx_tuple__129 #define __pyx_tuple__130 __pyx_mstate_global->__pyx_tuple__130 #define __pyx_tuple__131 __pyx_mstate_global->__pyx_tuple__131 #define __pyx_tuple__132 __pyx_mstate_global->__pyx_tuple__132 #define __pyx_tuple__133 __pyx_mstate_global->__pyx_tuple__133 #define __pyx_tuple__134 __pyx_mstate_global->__pyx_tuple__134 #define __pyx_tuple__135 __pyx_mstate_global->__pyx_tuple__135 #define __pyx_tuple__136 __pyx_mstate_global->__pyx_tuple__136 #define __pyx_tuple__137 __pyx_mstate_global->__pyx_tuple__137 #define __pyx_tuple__138 __pyx_mstate_global->__pyx_tuple__138 #define __pyx_tuple__139 __pyx_mstate_global->__pyx_tuple__139 #define __pyx_tuple__140 __pyx_mstate_global->__pyx_tuple__140 #define __pyx_tuple__141 __pyx_mstate_global->__pyx_tuple__141 #define __pyx_tuple__142 __pyx_mstate_global->__pyx_tuple__142 #define __pyx_tuple__143 __pyx_mstate_global->__pyx_tuple__143 #define __pyx_tuple__144 __pyx_mstate_global->__pyx_tuple__144 #define __pyx_tuple__145 __pyx_mstate_global->__pyx_tuple__145 #define __pyx_tuple__146 __pyx_mstate_global->__pyx_tuple__146 #define __pyx_tuple__147 __pyx_mstate_global->__pyx_tuple__147 #define __pyx_tuple__148 __pyx_mstate_global->__pyx_tuple__148 #define __pyx_tuple__149 __pyx_mstate_global->__pyx_tuple__149 #define __pyx_tuple__150 __pyx_mstate_global->__pyx_tuple__150 #define __pyx_tuple__151 __pyx_mstate_global->__pyx_tuple__151 #define __pyx_tuple__152 __pyx_mstate_global->__pyx_tuple__152 #define __pyx_tuple__153 __pyx_mstate_global->__pyx_tuple__153 #define __pyx_tuple__154 __pyx_mstate_global->__pyx_tuple__154 #define __pyx_tuple__155 __pyx_mstate_global->__pyx_tuple__155 #define __pyx_tuple__156 __pyx_mstate_global->__pyx_tuple__156 #define __pyx_tuple__157 __pyx_mstate_global->__pyx_tuple__157 #define __pyx_tuple__158 __pyx_mstate_global->__pyx_tuple__158 #define __pyx_tuple__159 __pyx_mstate_global->__pyx_tuple__159 #define __pyx_tuple__160 __pyx_mstate_global->__pyx_tuple__160 #define __pyx_tuple__161 __pyx_mstate_global->__pyx_tuple__161 #define __pyx_tuple__162 __pyx_mstate_global->__pyx_tuple__162 #define __pyx_tuple__163 __pyx_mstate_global->__pyx_tuple__163 #define __pyx_tuple__164 __pyx_mstate_global->__pyx_tuple__164 #define __pyx_tuple__165 __pyx_mstate_global->__pyx_tuple__165 #define __pyx_tuple__166 __pyx_mstate_global->__pyx_tuple__166 #define __pyx_tuple__167 __pyx_mstate_global->__pyx_tuple__167 #define __pyx_tuple__168 __pyx_mstate_global->__pyx_tuple__168 #define __pyx_tuple__169 __pyx_mstate_global->__pyx_tuple__169 #define __pyx_tuple__170 __pyx_mstate_global->__pyx_tuple__170 #define __pyx_tuple__171 __pyx_mstate_global->__pyx_tuple__171 #define __pyx_tuple__172 __pyx_mstate_global->__pyx_tuple__172 #define __pyx_tuple__173 __pyx_mstate_global->__pyx_tuple__173 #define __pyx_tuple__174 __pyx_mstate_global->__pyx_tuple__174 #define __pyx_tuple__175 __pyx_mstate_global->__pyx_tuple__175 #define __pyx_tuple__176 __pyx_mstate_global->__pyx_tuple__176 #define __pyx_tuple__177 __pyx_mstate_global->__pyx_tuple__177 #define __pyx_tuple__178 __pyx_mstate_global->__pyx_tuple__178 #define __pyx_tuple__179 __pyx_mstate_global->__pyx_tuple__179 #define __pyx_tuple__180 __pyx_mstate_global->__pyx_tuple__180 #define __pyx_tuple__181 __pyx_mstate_global->__pyx_tuple__181 #define __pyx_tuple__182 __pyx_mstate_global->__pyx_tuple__182 #define __pyx_tuple__183 __pyx_mstate_global->__pyx_tuple__183 #define __pyx_tuple__184 __pyx_mstate_global->__pyx_tuple__184 #define __pyx_tuple__185 __pyx_mstate_global->__pyx_tuple__185 #define __pyx_tuple__186 __pyx_mstate_global->__pyx_tuple__186 #define __pyx_tuple__187 __pyx_mstate_global->__pyx_tuple__187 #define __pyx_tuple__188 __pyx_mstate_global->__pyx_tuple__188 #define __pyx_tuple__189 __pyx_mstate_global->__pyx_tuple__189 #define __pyx_tuple__190 __pyx_mstate_global->__pyx_tuple__190 #define __pyx_tuple__191 __pyx_mstate_global->__pyx_tuple__191 #define __pyx_tuple__192 __pyx_mstate_global->__pyx_tuple__192 #define __pyx_tuple__193 __pyx_mstate_global->__pyx_tuple__193 #define __pyx_tuple__194 __pyx_mstate_global->__pyx_tuple__194 #define __pyx_tuple__195 __pyx_mstate_global->__pyx_tuple__195 #define __pyx_tuple__196 __pyx_mstate_global->__pyx_tuple__196 #define __pyx_tuple__197 __pyx_mstate_global->__pyx_tuple__197 #define __pyx_tuple__198 __pyx_mstate_global->__pyx_tuple__198 #define __pyx_tuple__199 __pyx_mstate_global->__pyx_tuple__199 #define __pyx_tuple__200 __pyx_mstate_global->__pyx_tuple__200 #define __pyx_tuple__201 __pyx_mstate_global->__pyx_tuple__201 #define __pyx_tuple__202 __pyx_mstate_global->__pyx_tuple__202 #define __pyx_tuple__203 __pyx_mstate_global->__pyx_tuple__203 #define __pyx_tuple__204 __pyx_mstate_global->__pyx_tuple__204 #define __pyx_tuple__205 __pyx_mstate_global->__pyx_tuple__205 #define __pyx_tuple__206 __pyx_mstate_global->__pyx_tuple__206 #define __pyx_tuple__207 __pyx_mstate_global->__pyx_tuple__207 #define __pyx_tuple__208 __pyx_mstate_global->__pyx_tuple__208 #define __pyx_tuple__209 __pyx_mstate_global->__pyx_tuple__209 #define __pyx_tuple__210 __pyx_mstate_global->__pyx_tuple__210 #define __pyx_tuple__211 __pyx_mstate_global->__pyx_tuple__211 #define __pyx_tuple__212 __pyx_mstate_global->__pyx_tuple__212 #define __pyx_tuple__213 __pyx_mstate_global->__pyx_tuple__213 #define __pyx_tuple__214 __pyx_mstate_global->__pyx_tuple__214 #define __pyx_tuple__215 __pyx_mstate_global->__pyx_tuple__215 #define __pyx_tuple__216 __pyx_mstate_global->__pyx_tuple__216 #define __pyx_tuple__217 __pyx_mstate_global->__pyx_tuple__217 #define __pyx_tuple__218 __pyx_mstate_global->__pyx_tuple__218 #define __pyx_tuple__219 __pyx_mstate_global->__pyx_tuple__219 #define __pyx_tuple__220 __pyx_mstate_global->__pyx_tuple__220 #define __pyx_tuple__221 __pyx_mstate_global->__pyx_tuple__221 #define __pyx_tuple__222 __pyx_mstate_global->__pyx_tuple__222 #define __pyx_tuple__223 __pyx_mstate_global->__pyx_tuple__223 #define __pyx_tuple__224 __pyx_mstate_global->__pyx_tuple__224 #define __pyx_tuple__225 __pyx_mstate_global->__pyx_tuple__225 #define __pyx_tuple__226 __pyx_mstate_global->__pyx_tuple__226 #define __pyx_tuple__227 __pyx_mstate_global->__pyx_tuple__227 #define __pyx_tuple__228 __pyx_mstate_global->__pyx_tuple__228 #define __pyx_tuple__229 __pyx_mstate_global->__pyx_tuple__229 #define __pyx_tuple__230 __pyx_mstate_global->__pyx_tuple__230 #define __pyx_tuple__231 __pyx_mstate_global->__pyx_tuple__231 #define __pyx_tuple__232 __pyx_mstate_global->__pyx_tuple__232 #define __pyx_tuple__233 __pyx_mstate_global->__pyx_tuple__233 #define __pyx_tuple__234 __pyx_mstate_global->__pyx_tuple__234 #define __pyx_tuple__235 __pyx_mstate_global->__pyx_tuple__235 #define __pyx_tuple__236 __pyx_mstate_global->__pyx_tuple__236 #define __pyx_tuple__237 __pyx_mstate_global->__pyx_tuple__237 #define __pyx_tuple__238 __pyx_mstate_global->__pyx_tuple__238 #define __pyx_tuple__239 __pyx_mstate_global->__pyx_tuple__239 #define __pyx_tuple__240 __pyx_mstate_global->__pyx_tuple__240 #define __pyx_tuple__241 __pyx_mstate_global->__pyx_tuple__241 #define __pyx_tuple__242 __pyx_mstate_global->__pyx_tuple__242 #define __pyx_tuple__243 __pyx_mstate_global->__pyx_tuple__243 #define __pyx_tuple__244 __pyx_mstate_global->__pyx_tuple__244 #define __pyx_tuple__245 __pyx_mstate_global->__pyx_tuple__245 #define __pyx_tuple__246 __pyx_mstate_global->__pyx_tuple__246 #define __pyx_tuple__247 __pyx_mstate_global->__pyx_tuple__247 #define __pyx_tuple__248 __pyx_mstate_global->__pyx_tuple__248 #define __pyx_tuple__249 __pyx_mstate_global->__pyx_tuple__249 #define __pyx_tuple__250 __pyx_mstate_global->__pyx_tuple__250 #define __pyx_codeobj__34 __pyx_mstate_global->__pyx_codeobj__34 #define __pyx_codeobj__36 __pyx_mstate_global->__pyx_codeobj__36 #define __pyx_codeobj__77 __pyx_mstate_global->__pyx_codeobj__77 #define __pyx_codeobj__87 __pyx_mstate_global->__pyx_codeobj__87 #define __pyx_codeobj__88 __pyx_mstate_global->__pyx_codeobj__88 #define __pyx_codeobj__90 __pyx_mstate_global->__pyx_codeobj__90 #define __pyx_codeobj__92 __pyx_mstate_global->__pyx_codeobj__92 #define __pyx_codeobj__94 __pyx_mstate_global->__pyx_codeobj__94 #define __pyx_codeobj__95 __pyx_mstate_global->__pyx_codeobj__95 #define __pyx_codeobj__109 __pyx_mstate_global->__pyx_codeobj__109 #define __pyx_codeobj__111 __pyx_mstate_global->__pyx_codeobj__111 #define __pyx_codeobj__113 __pyx_mstate_global->__pyx_codeobj__113 #define __pyx_codeobj__115 __pyx_mstate_global->__pyx_codeobj__115 #define __pyx_codeobj__251 __pyx_mstate_global->__pyx_codeobj__251 #define __pyx_codeobj__252 __pyx_mstate_global->__pyx_codeobj__252 #define __pyx_codeobj__253 __pyx_mstate_global->__pyx_codeobj__253 #define __pyx_codeobj__254 __pyx_mstate_global->__pyx_codeobj__254 #define __pyx_codeobj__255 __pyx_mstate_global->__pyx_codeobj__255 #define __pyx_codeobj__256 __pyx_mstate_global->__pyx_codeobj__256 /* #### Code section: module_code ### */ /* "petsc4py/PETSc/Device.pyx":33 * ("HIP" , PETSC_DEVICE_HIP), * ("SYCL" , PETSC_DEVICE_SYCL), * ("DEFAULT" , staticproperty(lambda *_,**__: PETSC_DEVICE_DEFAULT())) # <<<<<<<<<<<<<< * ) * ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_16lambda(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_16lambda = {"lambda", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_16lambda, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_8petsc4py_5PETSc_16lambda(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED PyObject *__pyx_v__ = 0; CYTHON_UNUSED PyObject *__pyx_v___ = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lambda (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "lambda", 1))) return NULL; __Pyx_INCREF(__pyx_args); __pyx_v__ = __pyx_args; __pyx_r = __pyx_lambda_funcdef_8petsc4py_5PETSc_lambda(__pyx_self, __pyx_v__, __pyx_v___); /* function exit code */ __Pyx_DECREF(__pyx_v__); __Pyx_XDECREF(__pyx_v___); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_lambda_funcdef_8petsc4py_5PETSc_lambda(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v__, CYTHON_UNUSED PyObject *__pyx_v___) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("lambda", 1); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_PetscDeviceType(PETSC_DEVICE_DEFAULT()); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.lambda", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":131 * cdef bint dtype_is_object * * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< * mode="c", bint allocate_buffer=True): * */ /* Python wrapper */ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_shape = 0; Py_ssize_t __pyx_v_itemsize; PyObject *__pyx_v_format = 0; PyObject *__pyx_v_mode = 0; int __pyx_v_allocate_buffer; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0}; values[3] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)__pyx_n_s_c)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_shape)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(13, 131, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_itemsize)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(13, 131, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(13, 131, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_format)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(13, 131, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(13, 131, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mode); if (value) { values[3] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(13, 131, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_allocate_buffer); if (value) { values[4] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(13, 131, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__cinit__") < 0)) __PYX_ERR(13, 131, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_shape = ((PyObject*)values[0]); __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(13, 131, __pyx_L3_error) __pyx_v_format = values[2]; __pyx_v_mode = values[3]; if (values[4]) { __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(13, 132, __pyx_L3_error) } else { /* "View.MemoryView":132 * * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<< * * cdef int idx */ __pyx_v_allocate_buffer = ((int)1); } } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, __pyx_nargs); __PYX_ERR(13, 131, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(13, 131, __pyx_L1_error) if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(13, 131, __pyx_L1_error) } __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer); /* "View.MemoryView":131 * cdef bint dtype_is_object * * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< * mode="c", bint allocate_buffer=True): * */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = -1; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer) { int __pyx_v_idx; Py_ssize_t __pyx_v_dim; char __pyx_v_order; int __pyx_r; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; char *__pyx_t_8; Py_ssize_t __pyx_t_9; Py_UCS4 __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); __Pyx_INCREF(__pyx_v_format); /* "View.MemoryView":137 * cdef Py_ssize_t dim * * self.ndim = len(shape) # <<<<<<<<<<<<<< * self.itemsize = itemsize * */ if (unlikely(__pyx_v_shape == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(13, 137, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(13, 137, __pyx_L1_error) __pyx_v_self->ndim = ((int)__pyx_t_1); /* "View.MemoryView":138 * * self.ndim = len(shape) * self.itemsize = itemsize # <<<<<<<<<<<<<< * * if not self.ndim: */ __pyx_v_self->itemsize = __pyx_v_itemsize; /* "View.MemoryView":140 * self.itemsize = itemsize * * if not self.ndim: # <<<<<<<<<<<<<< * raise ValueError, "Empty shape tuple for cython.array" * */ __pyx_t_2 = (!(__pyx_v_self->ndim != 0)); if (unlikely(__pyx_t_2)) { /* "View.MemoryView":141 * * if not self.ndim: * raise ValueError, "Empty shape tuple for cython.array" # <<<<<<<<<<<<<< * * if itemsize <= 0: */ __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_Empty_shape_tuple_for_cython_arr, 0, 0); __PYX_ERR(13, 141, __pyx_L1_error) /* "View.MemoryView":140 * self.itemsize = itemsize * * if not self.ndim: # <<<<<<<<<<<<<< * raise ValueError, "Empty shape tuple for cython.array" * */ } /* "View.MemoryView":143 * raise ValueError, "Empty shape tuple for cython.array" * * if itemsize <= 0: # <<<<<<<<<<<<<< * raise ValueError, "itemsize <= 0 for cython.array" * */ __pyx_t_2 = (__pyx_v_itemsize <= 0); if (unlikely(__pyx_t_2)) { /* "View.MemoryView":144 * * if itemsize <= 0: * raise ValueError, "itemsize <= 0 for cython.array" # <<<<<<<<<<<<<< * * if not isinstance(format, bytes): */ __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_itemsize_0_for_cython_array, 0, 0); __PYX_ERR(13, 144, __pyx_L1_error) /* "View.MemoryView":143 * raise ValueError, "Empty shape tuple for cython.array" * * if itemsize <= 0: # <<<<<<<<<<<<<< * raise ValueError, "itemsize <= 0 for cython.array" * */ } /* "View.MemoryView":146 * raise ValueError, "itemsize <= 0 for cython.array" * * if not isinstance(format, bytes): # <<<<<<<<<<<<<< * format = format.encode('ASCII') * self._format = format # keep a reference to the byte string */ __pyx_t_2 = PyBytes_Check(__pyx_v_format); __pyx_t_3 = (!__pyx_t_2); if (__pyx_t_3) { /* "View.MemoryView":147 * * if not isinstance(format, bytes): * format = format.encode('ASCII') # <<<<<<<<<<<<<< * self._format = format # keep a reference to the byte string * self.format = self._format */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_n_s_ASCII}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_4); __pyx_t_4 = 0; /* "View.MemoryView":146 * raise ValueError, "itemsize <= 0 for cython.array" * * if not isinstance(format, bytes): # <<<<<<<<<<<<<< * format = format.encode('ASCII') * self._format = format # keep a reference to the byte string */ } /* "View.MemoryView":148 * if not isinstance(format, bytes): * format = format.encode('ASCII') * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<< * self.format = self._format * */ if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_v_format))) __PYX_ERR(13, 148, __pyx_L1_error) __pyx_t_4 = __pyx_v_format; __Pyx_INCREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __Pyx_GOTREF(__pyx_v_self->_format); __Pyx_DECREF(__pyx_v_self->_format); __pyx_v_self->_format = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "View.MemoryView":149 * format = format.encode('ASCII') * self._format = format # keep a reference to the byte string * self.format = self._format # <<<<<<<<<<<<<< * * */ if (unlikely(__pyx_v_self->_format == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); __PYX_ERR(13, 149, __pyx_L1_error) } __pyx_t_8 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(13, 149, __pyx_L1_error) __pyx_v_self->format = __pyx_t_8; /* "View.MemoryView":152 * * * self._shape = PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<< * self._strides = self._shape + self.ndim * */ __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2))); /* "View.MemoryView":153 * * self._shape = PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<< * * if not self._shape: */ __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim); /* "View.MemoryView":155 * self._strides = self._shape + self.ndim * * if not self._shape: # <<<<<<<<<<<<<< * raise MemoryError, "unable to allocate shape and strides." * */ __pyx_t_3 = (!(__pyx_v_self->_shape != 0)); if (unlikely(__pyx_t_3)) { /* "View.MemoryView":156 * * if not self._shape: * raise MemoryError, "unable to allocate shape and strides." # <<<<<<<<<<<<<< * * */ __Pyx_Raise(__pyx_builtin_MemoryError, __pyx_kp_s_unable_to_allocate_shape_and_str, 0, 0); __PYX_ERR(13, 156, __pyx_L1_error) /* "View.MemoryView":155 * self._strides = self._shape + self.ndim * * if not self._shape: # <<<<<<<<<<<<<< * raise MemoryError, "unable to allocate shape and strides." * */ } /* "View.MemoryView":159 * * * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<< * if dim <= 0: * raise ValueError, f"Invalid shape in axis {idx}: {dim}." */ __pyx_t_7 = 0; __pyx_t_4 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_4); __pyx_t_1 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(13, 159, __pyx_L1_error) #endif if (__pyx_t_1 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(13, 159, __pyx_L1_error) #else __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(13, 159, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_dim = __pyx_t_9; __pyx_v_idx = __pyx_t_7; __pyx_t_7 = (__pyx_t_7 + 1); /* "View.MemoryView":160 * * for idx, dim in enumerate(shape): * if dim <= 0: # <<<<<<<<<<<<<< * raise ValueError, f"Invalid shape in axis {idx}: {dim}." * self._shape[idx] = dim */ __pyx_t_3 = (__pyx_v_dim <= 0); if (unlikely(__pyx_t_3)) { /* "View.MemoryView":161 * for idx, dim in enumerate(shape): * if dim <= 0: * raise ValueError, f"Invalid shape in axis {idx}: {dim}." # <<<<<<<<<<<<<< * self._shape[idx] = dim * */ __pyx_t_5 = PyTuple_New(5); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_9 = 0; __pyx_t_10 = 127; __Pyx_INCREF(__pyx_kp_u_Invalid_shape_in_axis); __pyx_t_9 += 22; __Pyx_GIVEREF(__pyx_kp_u_Invalid_shape_in_axis); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_u_Invalid_shape_in_axis); __pyx_t_6 = __Pyx_PyUnicode_From_int(__pyx_v_idx, 0, ' ', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(13, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_9 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6); __pyx_t_6 = 0; __Pyx_INCREF(__pyx_kp_u_); __pyx_t_9 += 2; __Pyx_GIVEREF(__pyx_kp_u_); PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_kp_u_); __pyx_t_6 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_dim, 0, ' ', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(13, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_9 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_6); __pyx_t_6 = 0; __Pyx_INCREF(__pyx_kp_u__2); __pyx_t_9 += 1; __Pyx_GIVEREF(__pyx_kp_u__2); PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_kp_u__2); __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_5, 5, __pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(13, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_6, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __PYX_ERR(13, 161, __pyx_L1_error) /* "View.MemoryView":160 * * for idx, dim in enumerate(shape): * if dim <= 0: # <<<<<<<<<<<<<< * raise ValueError, f"Invalid shape in axis {idx}: {dim}." * self._shape[idx] = dim */ } /* "View.MemoryView":162 * if dim <= 0: * raise ValueError, f"Invalid shape in axis {idx}: {dim}." * self._shape[idx] = dim # <<<<<<<<<<<<<< * * cdef char order */ (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim; /* "View.MemoryView":159 * * * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<< * if dim <= 0: * raise ValueError, f"Invalid shape in axis {idx}: {dim}." */ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "View.MemoryView":165 * * cdef char order * if mode == 'c': # <<<<<<<<<<<<<< * order = b'C' * self.mode = u'c' */ __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(13, 165, __pyx_L1_error) if (__pyx_t_3) { /* "View.MemoryView":166 * cdef char order * if mode == 'c': * order = b'C' # <<<<<<<<<<<<<< * self.mode = u'c' * elif mode == 'fortran': */ __pyx_v_order = 'C'; /* "View.MemoryView":167 * if mode == 'c': * order = b'C' * self.mode = u'c' # <<<<<<<<<<<<<< * elif mode == 'fortran': * order = b'F' */ __Pyx_INCREF(__pyx_n_u_c); __Pyx_GIVEREF(__pyx_n_u_c); __Pyx_GOTREF(__pyx_v_self->mode); __Pyx_DECREF(__pyx_v_self->mode); __pyx_v_self->mode = __pyx_n_u_c; /* "View.MemoryView":165 * * cdef char order * if mode == 'c': # <<<<<<<<<<<<<< * order = b'C' * self.mode = u'c' */ goto __pyx_L11; } /* "View.MemoryView":168 * order = b'C' * self.mode = u'c' * elif mode == 'fortran': # <<<<<<<<<<<<<< * order = b'F' * self.mode = u'fortran' */ __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(13, 168, __pyx_L1_error) if (likely(__pyx_t_3)) { /* "View.MemoryView":169 * self.mode = u'c' * elif mode == 'fortran': * order = b'F' # <<<<<<<<<<<<<< * self.mode = u'fortran' * else: */ __pyx_v_order = 'F'; /* "View.MemoryView":170 * elif mode == 'fortran': * order = b'F' * self.mode = u'fortran' # <<<<<<<<<<<<<< * else: * raise ValueError, f"Invalid mode, expected 'c' or 'fortran', got {mode}" */ __Pyx_INCREF(__pyx_n_u_fortran); __Pyx_GIVEREF(__pyx_n_u_fortran); __Pyx_GOTREF(__pyx_v_self->mode); __Pyx_DECREF(__pyx_v_self->mode); __pyx_v_self->mode = __pyx_n_u_fortran; /* "View.MemoryView":168 * order = b'C' * self.mode = u'c' * elif mode == 'fortran': # <<<<<<<<<<<<<< * order = b'F' * self.mode = u'fortran' */ goto __pyx_L11; } /* "View.MemoryView":172 * self.mode = u'fortran' * else: * raise ValueError, f"Invalid mode, expected 'c' or 'fortran', got {mode}" # <<<<<<<<<<<<<< * * self.len = fill_contig_strides_array(self._shape, self._strides, itemsize, self.ndim, order) */ /*else*/ { __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_v_mode, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Invalid_mode_expected_c_or_fortr, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(13, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_6, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __PYX_ERR(13, 172, __pyx_L1_error) } __pyx_L11:; /* "View.MemoryView":174 * raise ValueError, f"Invalid mode, expected 'c' or 'fortran', got {mode}" * * self.len = fill_contig_strides_array(self._shape, self._strides, itemsize, self.ndim, order) # <<<<<<<<<<<<<< * * self.free_data = allocate_buffer */ __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order); /* "View.MemoryView":176 * self.len = fill_contig_strides_array(self._shape, self._strides, itemsize, self.ndim, order) * * self.free_data = allocate_buffer # <<<<<<<<<<<<<< * self.dtype_is_object = format == b'O' * */ __pyx_v_self->free_data = __pyx_v_allocate_buffer; /* "View.MemoryView":177 * * self.free_data = allocate_buffer * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<< * * if allocate_buffer: */ __pyx_t_6 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(13, 177, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(13, 177, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_self->dtype_is_object = __pyx_t_3; /* "View.MemoryView":179 * self.dtype_is_object = format == b'O' * * if allocate_buffer: # <<<<<<<<<<<<<< * _allocate_buffer(self) * */ if (__pyx_v_allocate_buffer) { /* "View.MemoryView":180 * * if allocate_buffer: * _allocate_buffer(self) # <<<<<<<<<<<<<< * * @cname('getbuffer') */ __pyx_t_7 = __pyx_array_allocate_buffer(__pyx_v_self); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(13, 180, __pyx_L1_error) /* "View.MemoryView":179 * self.dtype_is_object = format == b'O' * * if allocate_buffer: # <<<<<<<<<<<<<< * _allocate_buffer(self) * */ } /* "View.MemoryView":131 * cdef bint dtype_is_object * * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< * mode="c", bint allocate_buffer=True): * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_format); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":182 * _allocate_buffer(self) * * @cname('getbuffer') # <<<<<<<<<<<<<< * def __getbuffer__(self, Py_buffer *info, int flags): * cdef int bufmode = -1 */ /* Python wrapper */ CYTHON_UNUSED static int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ CYTHON_UNUSED static int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { int __pyx_v_bufmode; int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; char *__pyx_t_2; Py_ssize_t __pyx_t_3; int __pyx_t_4; Py_ssize_t *__pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; if (unlikely(__pyx_v_info == NULL)) { PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete"); return -1; } __Pyx_RefNannySetupContext("__getbuffer__", 0); __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); __Pyx_GIVEREF(__pyx_v_info->obj); /* "View.MemoryView":184 * @cname('getbuffer') * def __getbuffer__(self, Py_buffer *info, int flags): * cdef int bufmode = -1 # <<<<<<<<<<<<<< * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS): * if self.mode == u"c": */ __pyx_v_bufmode = -1; /* "View.MemoryView":185 * def __getbuffer__(self, Py_buffer *info, int flags): * cdef int bufmode = -1 * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS): # <<<<<<<<<<<<<< * if self.mode == u"c": * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS */ __pyx_t_1 = ((__pyx_v_flags & ((PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS) | PyBUF_ANY_CONTIGUOUS)) != 0); if (__pyx_t_1) { /* "View.MemoryView":186 * cdef int bufmode = -1 * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS): * if self.mode == u"c": # <<<<<<<<<<<<<< * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS * elif self.mode == u"fortran": */ __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(13, 186, __pyx_L1_error) if (__pyx_t_1) { /* "View.MemoryView":187 * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS): * if self.mode == u"c": * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<< * elif self.mode == u"fortran": * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS */ __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS); /* "View.MemoryView":186 * cdef int bufmode = -1 * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS): * if self.mode == u"c": # <<<<<<<<<<<<<< * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS * elif self.mode == u"fortran": */ goto __pyx_L4; } /* "View.MemoryView":188 * if self.mode == u"c": * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS * elif self.mode == u"fortran": # <<<<<<<<<<<<<< * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS * if not (flags & bufmode): */ __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(13, 188, __pyx_L1_error) if (__pyx_t_1) { /* "View.MemoryView":189 * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS * elif self.mode == u"fortran": * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<< * if not (flags & bufmode): * raise ValueError, "Can only create a buffer that is contiguous in memory." */ __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS); /* "View.MemoryView":188 * if self.mode == u"c": * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS * elif self.mode == u"fortran": # <<<<<<<<<<<<<< * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS * if not (flags & bufmode): */ } __pyx_L4:; /* "View.MemoryView":190 * elif self.mode == u"fortran": * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS * if not (flags & bufmode): # <<<<<<<<<<<<<< * raise ValueError, "Can only create a buffer that is contiguous in memory." * info.buf = self.data */ __pyx_t_1 = (!((__pyx_v_flags & __pyx_v_bufmode) != 0)); if (unlikely(__pyx_t_1)) { /* "View.MemoryView":191 * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS * if not (flags & bufmode): * raise ValueError, "Can only create a buffer that is contiguous in memory." # <<<<<<<<<<<<<< * info.buf = self.data * info.len = self.len */ __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_Can_only_create_a_buffer_that_is, 0, 0); __PYX_ERR(13, 191, __pyx_L1_error) /* "View.MemoryView":190 * elif self.mode == u"fortran": * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS * if not (flags & bufmode): # <<<<<<<<<<<<<< * raise ValueError, "Can only create a buffer that is contiguous in memory." * info.buf = self.data */ } /* "View.MemoryView":185 * def __getbuffer__(self, Py_buffer *info, int flags): * cdef int bufmode = -1 * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS): # <<<<<<<<<<<<<< * if self.mode == u"c": * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS */ } /* "View.MemoryView":192 * if not (flags & bufmode): * raise ValueError, "Can only create a buffer that is contiguous in memory." * info.buf = self.data # <<<<<<<<<<<<<< * info.len = self.len * */ __pyx_t_2 = __pyx_v_self->data; __pyx_v_info->buf = __pyx_t_2; /* "View.MemoryView":193 * raise ValueError, "Can only create a buffer that is contiguous in memory." * info.buf = self.data * info.len = self.len # <<<<<<<<<<<<<< * * if flags & PyBUF_STRIDES: */ __pyx_t_3 = __pyx_v_self->len; __pyx_v_info->len = __pyx_t_3; /* "View.MemoryView":195 * info.len = self.len * * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< * info.ndim = self.ndim * info.shape = self._shape */ __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0); if (__pyx_t_1) { /* "View.MemoryView":196 * * if flags & PyBUF_STRIDES: * info.ndim = self.ndim # <<<<<<<<<<<<<< * info.shape = self._shape * info.strides = self._strides */ __pyx_t_4 = __pyx_v_self->ndim; __pyx_v_info->ndim = __pyx_t_4; /* "View.MemoryView":197 * if flags & PyBUF_STRIDES: * info.ndim = self.ndim * info.shape = self._shape # <<<<<<<<<<<<<< * info.strides = self._strides * else: */ __pyx_t_5 = __pyx_v_self->_shape; __pyx_v_info->shape = __pyx_t_5; /* "View.MemoryView":198 * info.ndim = self.ndim * info.shape = self._shape * info.strides = self._strides # <<<<<<<<<<<<<< * else: * info.ndim = 1 */ __pyx_t_5 = __pyx_v_self->_strides; __pyx_v_info->strides = __pyx_t_5; /* "View.MemoryView":195 * info.len = self.len * * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< * info.ndim = self.ndim * info.shape = self._shape */ goto __pyx_L6; } /* "View.MemoryView":200 * info.strides = self._strides * else: * info.ndim = 1 # <<<<<<<<<<<<<< * info.shape = &self.len if flags & PyBUF_ND else NULL * info.strides = NULL */ /*else*/ { __pyx_v_info->ndim = 1; /* "View.MemoryView":201 * else: * info.ndim = 1 * info.shape = &self.len if flags & PyBUF_ND else NULL # <<<<<<<<<<<<<< * info.strides = NULL * */ __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0); if (__pyx_t_1) { __pyx_t_5 = (&__pyx_v_self->len); } else { __pyx_t_5 = NULL; } __pyx_v_info->shape = __pyx_t_5; /* "View.MemoryView":202 * info.ndim = 1 * info.shape = &self.len if flags & PyBUF_ND else NULL * info.strides = NULL # <<<<<<<<<<<<<< * * info.suboffsets = NULL */ __pyx_v_info->strides = NULL; } __pyx_L6:; /* "View.MemoryView":204 * info.strides = NULL * * info.suboffsets = NULL # <<<<<<<<<<<<<< * info.itemsize = self.itemsize * info.readonly = 0 */ __pyx_v_info->suboffsets = NULL; /* "View.MemoryView":205 * * info.suboffsets = NULL * info.itemsize = self.itemsize # <<<<<<<<<<<<<< * info.readonly = 0 * info.format = self.format if flags & PyBUF_FORMAT else NULL */ __pyx_t_3 = __pyx_v_self->itemsize; __pyx_v_info->itemsize = __pyx_t_3; /* "View.MemoryView":206 * info.suboffsets = NULL * info.itemsize = self.itemsize * info.readonly = 0 # <<<<<<<<<<<<<< * info.format = self.format if flags & PyBUF_FORMAT else NULL * info.obj = self */ __pyx_v_info->readonly = 0; /* "View.MemoryView":207 * info.itemsize = self.itemsize * info.readonly = 0 * info.format = self.format if flags & PyBUF_FORMAT else NULL # <<<<<<<<<<<<<< * info.obj = self * */ __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_self->format; } else { __pyx_t_2 = NULL; } __pyx_v_info->format = __pyx_t_2; /* "View.MemoryView":208 * info.readonly = 0 * info.format = self.format if flags & PyBUF_FORMAT else NULL * info.obj = self # <<<<<<<<<<<<<< * * def __dealloc__(array self): */ __Pyx_INCREF((PyObject *)__pyx_v_self); __Pyx_GIVEREF((PyObject *)__pyx_v_self); __Pyx_GOTREF(__pyx_v_info->obj); __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = ((PyObject *)__pyx_v_self); /* "View.MemoryView":182 * _allocate_buffer(self) * * @cname('getbuffer') # <<<<<<<<<<<<<< * def __getbuffer__(self, Py_buffer *info, int flags): * cdef int bufmode = -1 */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; if (__pyx_v_info->obj != NULL) { __Pyx_GOTREF(__pyx_v_info->obj); __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0; } goto __pyx_L2; __pyx_L0:; if (__pyx_v_info->obj == Py_None) { __Pyx_GOTREF(__pyx_v_info->obj); __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0; } __pyx_L2:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":210 * info.obj = self * * def __dealloc__(array self): # <<<<<<<<<<<<<< * if self.callback_free_data != NULL: * self.callback_free_data(self.data) */ /* Python wrapper */ static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_array___dealloc__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) { int __pyx_t_1; int __pyx_t_2; /* "View.MemoryView":211 * * def __dealloc__(array self): * if self.callback_free_data != NULL: # <<<<<<<<<<<<<< * self.callback_free_data(self.data) * elif self.free_data and self.data is not NULL: */ __pyx_t_1 = (__pyx_v_self->callback_free_data != NULL); if (__pyx_t_1) { /* "View.MemoryView":212 * def __dealloc__(array self): * if self.callback_free_data != NULL: * self.callback_free_data(self.data) # <<<<<<<<<<<<<< * elif self.free_data and self.data is not NULL: * if self.dtype_is_object: */ __pyx_v_self->callback_free_data(__pyx_v_self->data); /* "View.MemoryView":211 * * def __dealloc__(array self): * if self.callback_free_data != NULL: # <<<<<<<<<<<<<< * self.callback_free_data(self.data) * elif self.free_data and self.data is not NULL: */ goto __pyx_L3; } /* "View.MemoryView":213 * if self.callback_free_data != NULL: * self.callback_free_data(self.data) * elif self.free_data and self.data is not NULL: # <<<<<<<<<<<<<< * if self.dtype_is_object: * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False) */ if (__pyx_v_self->free_data) { } else { __pyx_t_1 = __pyx_v_self->free_data; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = (__pyx_v_self->data != NULL); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "View.MemoryView":214 * self.callback_free_data(self.data) * elif self.free_data and self.data is not NULL: * if self.dtype_is_object: # <<<<<<<<<<<<<< * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False) * free(self.data) */ if (__pyx_v_self->dtype_is_object) { /* "View.MemoryView":215 * elif self.free_data and self.data is not NULL: * if self.dtype_is_object: * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False) # <<<<<<<<<<<<<< * free(self.data) * PyObject_Free(self._shape) */ __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0); /* "View.MemoryView":214 * self.callback_free_data(self.data) * elif self.free_data and self.data is not NULL: * if self.dtype_is_object: # <<<<<<<<<<<<<< * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False) * free(self.data) */ } /* "View.MemoryView":216 * if self.dtype_is_object: * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False) * free(self.data) # <<<<<<<<<<<<<< * PyObject_Free(self._shape) * */ free(__pyx_v_self->data); /* "View.MemoryView":213 * if self.callback_free_data != NULL: * self.callback_free_data(self.data) * elif self.free_data and self.data is not NULL: # <<<<<<<<<<<<<< * if self.dtype_is_object: * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False) */ } __pyx_L3:; /* "View.MemoryView":217 * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False) * free(self.data) * PyObject_Free(self._shape) # <<<<<<<<<<<<<< * * @property */ PyObject_Free(__pyx_v_self->_shape); /* "View.MemoryView":210 * info.obj = self * * def __dealloc__(array self): # <<<<<<<<<<<<<< * if self.callback_free_data != NULL: * self.callback_free_data(self.data) */ /* function exit code */ } /* "View.MemoryView":219 * PyObject_Free(self._shape) * * @property # <<<<<<<<<<<<<< * def memview(self): * return self.get_memview() */ /* Python wrapper */ static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "View.MemoryView":221 * @property * def memview(self): * return self.get_memview() # <<<<<<<<<<<<<< * * @cname('get_memview') */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "View.MemoryView":219 * PyObject_Free(self._shape) * * @property # <<<<<<<<<<<<<< * def memview(self): * return self.get_memview() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":224 * * @cname('get_memview') * cdef get_memview(self): # <<<<<<<<<<<<<< * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE * return memoryview(self, flags, self.dtype_is_object) */ static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) { int __pyx_v_flags; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_memview", 1); /* "View.MemoryView":225 * @cname('get_memview') * cdef get_memview(self): * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<< * return memoryview(self, flags, self.dtype_is_object) * */ __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE); /* "View.MemoryView":226 * cdef get_memview(self): * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<< * * def __len__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF((PyObject *)__pyx_v_self); __Pyx_GIVEREF((PyObject *)__pyx_v_self); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self))) __PYX_ERR(13, 226, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(13, 226, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2)) __PYX_ERR(13, 226, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "View.MemoryView":224 * * @cname('get_memview') * cdef get_memview(self): # <<<<<<<<<<<<<< * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE * return memoryview(self, flags, self.dtype_is_object) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":228 * return memoryview(self, flags, self.dtype_is_object) * * def __len__(self): # <<<<<<<<<<<<<< * return self._shape[0] * */ /* Python wrapper */ static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/ static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) { Py_ssize_t __pyx_r; /* "View.MemoryView":229 * * def __len__(self): * return self._shape[0] # <<<<<<<<<<<<<< * * def __getattr__(self, attr): */ __pyx_r = (__pyx_v_self->_shape[0]); goto __pyx_L0; /* "View.MemoryView":228 * return memoryview(self, flags, self.dtype_is_object) * * def __len__(self): # <<<<<<<<<<<<<< * return self._shape[0] * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "View.MemoryView":231 * return self._shape[0] * * def __getattr__(self, attr): # <<<<<<<<<<<<<< * return getattr(self.memview, attr) * */ /* Python wrapper */ static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/ static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getattr__", 1); /* "View.MemoryView":232 * * def __getattr__(self, attr): * return getattr(self.memview, attr) # <<<<<<<<<<<<<< * * def __getitem__(self, item): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "View.MemoryView":231 * return self._shape[0] * * def __getattr__(self, attr): # <<<<<<<<<<<<<< * return getattr(self.memview, attr) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":234 * return getattr(self.memview, attr) * * def __getitem__(self, item): # <<<<<<<<<<<<<< * return self.memview[item] * */ /* Python wrapper */ static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/ static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getitem__", 1); /* "View.MemoryView":235 * * def __getitem__(self, item): * return self.memview[item] # <<<<<<<<<<<<<< * * def __setitem__(self, item, value): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "View.MemoryView":234 * return getattr(self.memview, attr) * * def __getitem__(self, item): # <<<<<<<<<<<<<< * return self.memview[item] * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":237 * return self.memview[item] * * def __setitem__(self, item, value): # <<<<<<<<<<<<<< * self.memview[item] = value * */ /* Python wrapper */ static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/ static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setitem__", 1); /* "View.MemoryView":238 * * def __setitem__(self, item, value): * self.memview[item] = value # <<<<<<<<<<<<<< * * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely((PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0))) __PYX_ERR(13, 238, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "View.MemoryView":237 * return self.memview[item] * * def __setitem__(self, item, value): # <<<<<<<<<<<<<< * self.memview[item] = value * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(13, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* Python wrapper */ static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(13, 3, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(13, 3, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v___pyx_state = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(13, 3, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":4 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(13, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":248 * * @cname("__pyx_array_allocate_buffer") * cdef int _allocate_buffer(array self) except -1: # <<<<<<<<<<<<<< * * */ static int __pyx_array_allocate_buffer(struct __pyx_array_obj *__pyx_v_self) { Py_ssize_t __pyx_v_i; PyObject **__pyx_v_p; int __pyx_r; int __pyx_t_1; Py_ssize_t __pyx_t_2; Py_ssize_t __pyx_t_3; Py_ssize_t __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "View.MemoryView":254 * cdef PyObject **p * * self.free_data = True # <<<<<<<<<<<<<< * self.data = malloc(self.len) * if not self.data: */ __pyx_v_self->free_data = 1; /* "View.MemoryView":255 * * self.free_data = True * self.data = malloc(self.len) # <<<<<<<<<<<<<< * if not self.data: * raise MemoryError, "unable to allocate array data." */ __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len)); /* "View.MemoryView":256 * self.free_data = True * self.data = malloc(self.len) * if not self.data: # <<<<<<<<<<<<<< * raise MemoryError, "unable to allocate array data." * */ __pyx_t_1 = (!(__pyx_v_self->data != 0)); if (unlikely(__pyx_t_1)) { /* "View.MemoryView":257 * self.data = malloc(self.len) * if not self.data: * raise MemoryError, "unable to allocate array data." # <<<<<<<<<<<<<< * * if self.dtype_is_object: */ __Pyx_Raise(__pyx_builtin_MemoryError, __pyx_kp_s_unable_to_allocate_array_data, 0, 0); __PYX_ERR(13, 257, __pyx_L1_error) /* "View.MemoryView":256 * self.free_data = True * self.data = malloc(self.len) * if not self.data: # <<<<<<<<<<<<<< * raise MemoryError, "unable to allocate array data." * */ } /* "View.MemoryView":259 * raise MemoryError, "unable to allocate array data." * * if self.dtype_is_object: # <<<<<<<<<<<<<< * p = self.data * for i in range(self.len // self.itemsize): */ if (__pyx_v_self->dtype_is_object) { /* "View.MemoryView":260 * * if self.dtype_is_object: * p = self.data # <<<<<<<<<<<<<< * for i in range(self.len // self.itemsize): * p[i] = Py_None */ __pyx_v_p = ((PyObject **)__pyx_v_self->data); /* "View.MemoryView":261 * if self.dtype_is_object: * p = self.data * for i in range(self.len // self.itemsize): # <<<<<<<<<<<<<< * p[i] = Py_None * Py_INCREF(Py_None) */ if (unlikely(__pyx_v_self->itemsize == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); __PYX_ERR(13, 261, __pyx_L1_error) } else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_self->itemsize == (Py_ssize_t)-1) && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) { PyErr_SetString(PyExc_OverflowError, "value too large to perform division"); __PYX_ERR(13, 261, __pyx_L1_error) } __pyx_t_2 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_self->itemsize); __pyx_t_3 = __pyx_t_2; for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; /* "View.MemoryView":262 * p = self.data * for i in range(self.len // self.itemsize): * p[i] = Py_None # <<<<<<<<<<<<<< * Py_INCREF(Py_None) * return 0 */ (__pyx_v_p[__pyx_v_i]) = Py_None; /* "View.MemoryView":263 * for i in range(self.len // self.itemsize): * p[i] = Py_None * Py_INCREF(Py_None) # <<<<<<<<<<<<<< * return 0 * */ Py_INCREF(Py_None); } /* "View.MemoryView":259 * raise MemoryError, "unable to allocate array data." * * if self.dtype_is_object: # <<<<<<<<<<<<<< * p = self.data * for i in range(self.len // self.itemsize): */ } /* "View.MemoryView":264 * p[i] = Py_None * Py_INCREF(Py_None) * return 0 # <<<<<<<<<<<<<< * * */ __pyx_r = 0; goto __pyx_L0; /* "View.MemoryView":248 * * @cname("__pyx_array_allocate_buffer") * cdef int _allocate_buffer(array self) except -1: # <<<<<<<<<<<<<< * * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("View.MemoryView._allocate_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "View.MemoryView":268 * * @cname("__pyx_array_new") * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, char *c_mode, char *buf): # <<<<<<<<<<<<<< * cdef array result * cdef str mode = "fortran" if c_mode[0] == b'f' else "c" # this often comes from a constant C string. */ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, char *__pyx_v_format, char *__pyx_v_c_mode, char *__pyx_v_buf) { struct __pyx_array_obj *__pyx_v_result = 0; PyObject *__pyx_v_mode = 0; struct __pyx_array_obj *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("array_cwrapper", 1); /* "View.MemoryView":270 * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, char *c_mode, char *buf): * cdef array result * cdef str mode = "fortran" if c_mode[0] == b'f' else "c" # this often comes from a constant C string. # <<<<<<<<<<<<<< * * if buf is NULL: */ __pyx_t_2 = ((__pyx_v_c_mode[0]) == 'f'); if (__pyx_t_2) { __Pyx_INCREF(__pyx_n_s_fortran); __pyx_t_1 = __pyx_n_s_fortran; } else { __Pyx_INCREF(__pyx_n_s_c); __pyx_t_1 = __pyx_n_s_c; } __pyx_v_mode = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "View.MemoryView":272 * cdef str mode = "fortran" if c_mode[0] == b'f' else "c" # this often comes from a constant C string. * * if buf is NULL: # <<<<<<<<<<<<<< * result = array.__new__(array, shape, itemsize, format, mode) * else: */ __pyx_t_2 = (__pyx_v_buf == NULL); if (__pyx_t_2) { /* "View.MemoryView":273 * * if buf is NULL: * result = array.__new__(array, shape, itemsize, format, mode) # <<<<<<<<<<<<<< * else: * result = array.__new__(array, shape, itemsize, format, mode, allocate_buffer=False) */ __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_shape)) __PYX_ERR(13, 273, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(13, 273, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3)) __PYX_ERR(13, 273, __pyx_L1_error); __Pyx_INCREF(__pyx_v_mode); __Pyx_GIVEREF(__pyx_v_mode); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_mode)) __PYX_ERR(13, 273, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_3 = 0; __pyx_t_3 = ((PyObject *)__pyx_tp_new_array(((PyTypeObject *)__pyx_array_type), __pyx_t_4, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 273, __pyx_L1_error) __Pyx_GOTREF((PyObject *)__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_3); __pyx_t_3 = 0; /* "View.MemoryView":272 * cdef str mode = "fortran" if c_mode[0] == b'f' else "c" # this often comes from a constant C string. * * if buf is NULL: # <<<<<<<<<<<<<< * result = array.__new__(array, shape, itemsize, format, mode) * else: */ goto __pyx_L3; } /* "View.MemoryView":275 * result = array.__new__(array, shape, itemsize, format, mode) * else: * result = array.__new__(array, shape, itemsize, format, mode, allocate_buffer=False) # <<<<<<<<<<<<<< * result.data = buf * */ /*else*/ { __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_shape)) __PYX_ERR(13, 275, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3)) __PYX_ERR(13, 275, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_4)) __PYX_ERR(13, 275, __pyx_L1_error); __Pyx_INCREF(__pyx_v_mode); __Pyx_GIVEREF(__pyx_v_mode); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_mode)) __PYX_ERR(13, 275, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(13, 275, __pyx_L1_error) __pyx_t_3 = ((PyObject *)__pyx_tp_new_array(((PyTypeObject *)__pyx_array_type), __pyx_t_1, __pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 275, __pyx_L1_error) __Pyx_GOTREF((PyObject *)__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_3); __pyx_t_3 = 0; /* "View.MemoryView":276 * else: * result = array.__new__(array, shape, itemsize, format, mode, allocate_buffer=False) * result.data = buf # <<<<<<<<<<<<<< * * return result */ __pyx_v_result->data = __pyx_v_buf; } __pyx_L3:; /* "View.MemoryView":278 * result.data = buf * * return result # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_result); __pyx_r = __pyx_v_result; goto __pyx_L0; /* "View.MemoryView":268 * * @cname("__pyx_array_new") * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, char *c_mode, char *buf): # <<<<<<<<<<<<<< * cdef array result * cdef str mode = "fortran" if c_mode[0] == b'f' else "c" # this often comes from a constant C string. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_result); __Pyx_XDECREF(__pyx_v_mode); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":304 * cdef class Enum(object): * cdef object name * def __init__(self, name): # <<<<<<<<<<<<<< * self.name = name * def __repr__(self): */ /* Python wrapper */ static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_name = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(13, 304, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(13, 304, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); } __pyx_v_name = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(13, 304, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 1); /* "View.MemoryView":305 * cdef object name * def __init__(self, name): * self.name = name # <<<<<<<<<<<<<< * def __repr__(self): * return self.name */ __Pyx_INCREF(__pyx_v_name); __Pyx_GIVEREF(__pyx_v_name); __Pyx_GOTREF(__pyx_v_self->name); __Pyx_DECREF(__pyx_v_self->name); __pyx_v_self->name = __pyx_v_name; /* "View.MemoryView":304 * cdef class Enum(object): * cdef object name * def __init__(self, name): # <<<<<<<<<<<<<< * self.name = name * def __repr__(self): */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":306 * def __init__(self, name): * self.name = name * def __repr__(self): # <<<<<<<<<<<<<< * return self.name * */ /* Python wrapper */ static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__", 1); /* "View.MemoryView":307 * self.name = name * def __repr__(self): * return self.name # <<<<<<<<<<<<<< * * cdef generic = Enum("") */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->name); __pyx_r = __pyx_v_self->name; goto __pyx_L0; /* "View.MemoryView":306 * def __init__(self, name): * self.name = name * def __repr__(self): # <<<<<<<<<<<<<< * return self.name * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ /* Python wrapper */ static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self) { PyObject *__pyx_v_state = 0; PyObject *__pyx_v__dict = 0; int __pyx_v_use_setstate; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":5 * cdef object _dict * cdef bint use_setstate * state = (self.name,) # <<<<<<<<<<<<<< * _dict = getattr(self, '__dict__', None) * if _dict is not None: */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_self->name); __Pyx_GIVEREF(__pyx_v_self->name); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name)) __PYX_ERR(13, 5, __pyx_L1_error); __pyx_v_state = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":6 * cdef bint use_setstate * state = (self.name,) * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< * if _dict is not None: * state += (_dict,) */ __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v__dict = __pyx_t_1; __pyx_t_1 = 0; /* "(tree fragment)":7 * state = (self.name,) * _dict = getattr(self, '__dict__', None) * if _dict is not None: # <<<<<<<<<<<<<< * state += (_dict,) * use_setstate = True */ __pyx_t_2 = (__pyx_v__dict != Py_None); if (__pyx_t_2) { /* "(tree fragment)":8 * _dict = getattr(self, '__dict__', None) * if _dict is not None: * state += (_dict,) # <<<<<<<<<<<<<< * use_setstate = True * else: */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v__dict); __Pyx_GIVEREF(__pyx_v__dict); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict)) __PYX_ERR(13, 8, __pyx_L1_error); __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; /* "(tree fragment)":9 * if _dict is not None: * state += (_dict,) * use_setstate = True # <<<<<<<<<<<<<< * else: * use_setstate = self.name is not None */ __pyx_v_use_setstate = 1; /* "(tree fragment)":7 * state = (self.name,) * _dict = getattr(self, '__dict__', None) * if _dict is not None: # <<<<<<<<<<<<<< * state += (_dict,) * use_setstate = True */ goto __pyx_L3; } /* "(tree fragment)":11 * use_setstate = True * else: * use_setstate = self.name is not None # <<<<<<<<<<<<<< * if use_setstate: * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state */ /*else*/ { __pyx_t_2 = (__pyx_v_self->name != Py_None); __pyx_v_use_setstate = __pyx_t_2; } __pyx_L3:; /* "(tree fragment)":12 * else: * use_setstate = self.name is not None * if use_setstate: # <<<<<<<<<<<<<< * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state * else: */ if (__pyx_v_use_setstate) { /* "(tree fragment)":13 * use_setstate = self.name is not None * if use_setstate: * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state # <<<<<<<<<<<<<< * else: * return __pyx_unpickle_Enum, (type(self), 0x82a3537, state) */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(13, 13, __pyx_L1_error); __Pyx_INCREF(__pyx_int_136983863); __Pyx_GIVEREF(__pyx_int_136983863); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_136983863)) __PYX_ERR(13, 13, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None)) __PYX_ERR(13, 13, __pyx_L1_error); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(13, 13, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(13, 13, __pyx_L1_error); __Pyx_INCREF(__pyx_v_state); __Pyx_GIVEREF(__pyx_v_state); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_state)) __PYX_ERR(13, 13, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_1 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "(tree fragment)":12 * else: * use_setstate = self.name is not None * if use_setstate: # <<<<<<<<<<<<<< * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state * else: */ } /* "(tree fragment)":15 * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state * else: * return __pyx_unpickle_Enum, (type(self), 0x82a3537, state) # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * __pyx_unpickle_Enum__set_state(self, __pyx_state) */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(13, 15, __pyx_L1_error); __Pyx_INCREF(__pyx_int_136983863); __Pyx_GIVEREF(__pyx_int_136983863); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_136983863)) __PYX_ERR(13, 15, __pyx_L1_error); __Pyx_INCREF(__pyx_v_state); __Pyx_GIVEREF(__pyx_v_state); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state)) __PYX_ERR(13, 15, __pyx_L1_error); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(13, 15, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(13, 15, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_1 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_state); __Pyx_XDECREF(__pyx_v__dict); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":16 * else: * return __pyx_unpickle_Enum, (type(self), 0x82a3537, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_Enum__set_state(self, __pyx_state) */ /* Python wrapper */ static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(13, 16, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(13, 16, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v___pyx_state = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(13, 16, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":17 * return __pyx_unpickle_Enum, (type(self), 0x82a3537, state) * def __setstate_cython__(self, __pyx_state): * __pyx_unpickle_Enum__set_state(self, __pyx_state) # <<<<<<<<<<<<<< */ if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(13, 17, __pyx_L1_error) __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":16 * else: * return __pyx_unpickle_Enum, (type(self), 0x82a3537, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_Enum__set_state(self, __pyx_state) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":349 * cdef __Pyx_TypeInfo *typeinfo * * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<< * self.obj = obj * self.flags = flags */ /* Python wrapper */ static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_obj = 0; int __pyx_v_flags; int __pyx_v_dtype_is_object; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_obj)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(13, 349, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flags)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(13, 349, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(13, 349, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dtype_is_object); if (value) { values[2] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(13, 349, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__cinit__") < 0)) __PYX_ERR(13, 349, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_obj = values[0]; __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(13, 349, __pyx_L3_error) if (values[2]) { __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(13, 349, __pyx_L3_error) } else { __pyx_v_dtype_is_object = ((int)0); } } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, __pyx_nargs); __PYX_ERR(13, 349, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; Py_intptr_t __pyx_t_4; size_t __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 1); /* "View.MemoryView":350 * * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): * self.obj = obj # <<<<<<<<<<<<<< * self.flags = flags * if type(self) is memoryview or obj is not None: */ __Pyx_INCREF(__pyx_v_obj); __Pyx_GIVEREF(__pyx_v_obj); __Pyx_GOTREF(__pyx_v_self->obj); __Pyx_DECREF(__pyx_v_self->obj); __pyx_v_self->obj = __pyx_v_obj; /* "View.MemoryView":351 * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): * self.obj = obj * self.flags = flags # <<<<<<<<<<<<<< * if type(self) is memoryview or obj is not None: * __Pyx_GetBuffer(obj, &self.view, flags) */ __pyx_v_self->flags = __pyx_v_flags; /* "View.MemoryView":352 * self.obj = obj * self.flags = flags * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<< * __Pyx_GetBuffer(obj, &self.view, flags) * if self.view.obj == NULL: */ __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type)); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = (__pyx_v_obj != Py_None); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "View.MemoryView":353 * self.flags = flags * if type(self) is memoryview or obj is not None: * __Pyx_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<< * if self.view.obj == NULL: * (<__pyx_buffer *> &self.view).obj = Py_None */ __pyx_t_3 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(13, 353, __pyx_L1_error) /* "View.MemoryView":354 * if type(self) is memoryview or obj is not None: * __Pyx_GetBuffer(obj, &self.view, flags) * if self.view.obj == NULL: # <<<<<<<<<<<<<< * (<__pyx_buffer *> &self.view).obj = Py_None * Py_INCREF(Py_None) */ __pyx_t_1 = (((PyObject *)__pyx_v_self->view.obj) == NULL); if (__pyx_t_1) { /* "View.MemoryView":355 * __Pyx_GetBuffer(obj, &self.view, flags) * if self.view.obj == NULL: * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<< * Py_INCREF(Py_None) * */ ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None; /* "View.MemoryView":356 * if self.view.obj == NULL: * (<__pyx_buffer *> &self.view).obj = Py_None * Py_INCREF(Py_None) # <<<<<<<<<<<<<< * * if not __PYX_CYTHON_ATOMICS_ENABLED(): */ Py_INCREF(Py_None); /* "View.MemoryView":354 * if type(self) is memoryview or obj is not None: * __Pyx_GetBuffer(obj, &self.view, flags) * if self.view.obj == NULL: # <<<<<<<<<<<<<< * (<__pyx_buffer *> &self.view).obj = Py_None * Py_INCREF(Py_None) */ } /* "View.MemoryView":352 * self.obj = obj * self.flags = flags * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<< * __Pyx_GetBuffer(obj, &self.view, flags) * if self.view.obj == NULL: */ } /* "View.MemoryView":358 * Py_INCREF(Py_None) * * if not __PYX_CYTHON_ATOMICS_ENABLED(): # <<<<<<<<<<<<<< * global __pyx_memoryview_thread_locks_used * if __pyx_memoryview_thread_locks_used < 8: */ __pyx_t_1 = (!__PYX_CYTHON_ATOMICS_ENABLED()); if (__pyx_t_1) { /* "View.MemoryView":360 * if not __PYX_CYTHON_ATOMICS_ENABLED(): * global __pyx_memoryview_thread_locks_used * if __pyx_memoryview_thread_locks_used < 8: # <<<<<<<<<<<<<< * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] * __pyx_memoryview_thread_locks_used += 1 */ __pyx_t_1 = (__pyx_memoryview_thread_locks_used < 8); if (__pyx_t_1) { /* "View.MemoryView":361 * global __pyx_memoryview_thread_locks_used * if __pyx_memoryview_thread_locks_used < 8: * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<< * __pyx_memoryview_thread_locks_used += 1 * if self.lock is NULL: */ __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]); /* "View.MemoryView":362 * if __pyx_memoryview_thread_locks_used < 8: * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<< * if self.lock is NULL: * self.lock = PyThread_allocate_lock() */ __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1); /* "View.MemoryView":360 * if not __PYX_CYTHON_ATOMICS_ENABLED(): * global __pyx_memoryview_thread_locks_used * if __pyx_memoryview_thread_locks_used < 8: # <<<<<<<<<<<<<< * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] * __pyx_memoryview_thread_locks_used += 1 */ } /* "View.MemoryView":363 * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] * __pyx_memoryview_thread_locks_used += 1 * if self.lock is NULL: # <<<<<<<<<<<<<< * self.lock = PyThread_allocate_lock() * if self.lock is NULL: */ __pyx_t_1 = (__pyx_v_self->lock == NULL); if (__pyx_t_1) { /* "View.MemoryView":364 * __pyx_memoryview_thread_locks_used += 1 * if self.lock is NULL: * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<< * if self.lock is NULL: * raise MemoryError */ __pyx_v_self->lock = PyThread_allocate_lock(); /* "View.MemoryView":365 * if self.lock is NULL: * self.lock = PyThread_allocate_lock() * if self.lock is NULL: # <<<<<<<<<<<<<< * raise MemoryError * */ __pyx_t_1 = (__pyx_v_self->lock == NULL); if (unlikely(__pyx_t_1)) { /* "View.MemoryView":366 * self.lock = PyThread_allocate_lock() * if self.lock is NULL: * raise MemoryError # <<<<<<<<<<<<<< * * if flags & PyBUF_FORMAT: */ PyErr_NoMemory(); __PYX_ERR(13, 366, __pyx_L1_error) /* "View.MemoryView":365 * if self.lock is NULL: * self.lock = PyThread_allocate_lock() * if self.lock is NULL: # <<<<<<<<<<<<<< * raise MemoryError * */ } /* "View.MemoryView":363 * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] * __pyx_memoryview_thread_locks_used += 1 * if self.lock is NULL: # <<<<<<<<<<<<<< * self.lock = PyThread_allocate_lock() * if self.lock is NULL: */ } /* "View.MemoryView":358 * Py_INCREF(Py_None) * * if not __PYX_CYTHON_ATOMICS_ENABLED(): # <<<<<<<<<<<<<< * global __pyx_memoryview_thread_locks_used * if __pyx_memoryview_thread_locks_used < 8: */ } /* "View.MemoryView":368 * raise MemoryError * * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') * else: */ __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); if (__pyx_t_1) { /* "View.MemoryView":369 * * if flags & PyBUF_FORMAT: * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<< * else: * self.dtype_is_object = dtype_is_object */ __pyx_t_2 = ((__pyx_v_self->view.format[0]) == 'O'); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L12_bool_binop_done; } __pyx_t_2 = ((__pyx_v_self->view.format[1]) == '\x00'); __pyx_t_1 = __pyx_t_2; __pyx_L12_bool_binop_done:; __pyx_v_self->dtype_is_object = __pyx_t_1; /* "View.MemoryView":368 * raise MemoryError * * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') * else: */ goto __pyx_L11; } /* "View.MemoryView":371 * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') * else: * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<< * * assert (&self.acquisition_count) % sizeof(__pyx_atomic_int_type) == 0 */ /*else*/ { __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object; } __pyx_L11:; /* "View.MemoryView":373 * self.dtype_is_object = dtype_is_object * * assert (&self.acquisition_count) % sizeof(__pyx_atomic_int_type) == 0 # <<<<<<<<<<<<<< * self.typeinfo = NULL * */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_4 = ((Py_intptr_t)((void *)(&__pyx_v_self->acquisition_count))); __pyx_t_5 = (sizeof(__pyx_atomic_int_type)); if (unlikely(__pyx_t_5 == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); __PYX_ERR(13, 373, __pyx_L1_error) } __pyx_t_1 = ((__pyx_t_4 % __pyx_t_5) == 0); if (unlikely(!__pyx_t_1)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(13, 373, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(13, 373, __pyx_L1_error) #endif /* "View.MemoryView":374 * * assert (&self.acquisition_count) % sizeof(__pyx_atomic_int_type) == 0 * self.typeinfo = NULL # <<<<<<<<<<<<<< * * def __dealloc__(memoryview self): */ __pyx_v_self->typeinfo = NULL; /* "View.MemoryView":349 * cdef __Pyx_TypeInfo *typeinfo * * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<< * self.obj = obj * self.flags = flags */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":376 * self.typeinfo = NULL * * def __dealloc__(memoryview self): # <<<<<<<<<<<<<< * if self.obj is not None: * __Pyx_ReleaseBuffer(&self.view) */ /* Python wrapper */ static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) { int __pyx_v_i; int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PyThread_type_lock __pyx_t_5; PyThread_type_lock __pyx_t_6; /* "View.MemoryView":377 * * def __dealloc__(memoryview self): * if self.obj is not None: # <<<<<<<<<<<<<< * __Pyx_ReleaseBuffer(&self.view) * elif (<__pyx_buffer *> &self.view).obj == Py_None: */ __pyx_t_1 = (__pyx_v_self->obj != Py_None); if (__pyx_t_1) { /* "View.MemoryView":378 * def __dealloc__(memoryview self): * if self.obj is not None: * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<< * elif (<__pyx_buffer *> &self.view).obj == Py_None: * */ __Pyx_ReleaseBuffer((&__pyx_v_self->view)); /* "View.MemoryView":377 * * def __dealloc__(memoryview self): * if self.obj is not None: # <<<<<<<<<<<<<< * __Pyx_ReleaseBuffer(&self.view) * elif (<__pyx_buffer *> &self.view).obj == Py_None: */ goto __pyx_L3; } /* "View.MemoryView":379 * if self.obj is not None: * __Pyx_ReleaseBuffer(&self.view) * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<< * * (<__pyx_buffer *> &self.view).obj = NULL */ __pyx_t_1 = (((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None); if (__pyx_t_1) { /* "View.MemoryView":381 * elif (<__pyx_buffer *> &self.view).obj == Py_None: * * (<__pyx_buffer *> &self.view).obj = NULL # <<<<<<<<<<<<<< * Py_DECREF(Py_None) * */ ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL; /* "View.MemoryView":382 * * (<__pyx_buffer *> &self.view).obj = NULL * Py_DECREF(Py_None) # <<<<<<<<<<<<<< * * cdef int i */ Py_DECREF(Py_None); /* "View.MemoryView":379 * if self.obj is not None: * __Pyx_ReleaseBuffer(&self.view) * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<< * * (<__pyx_buffer *> &self.view).obj = NULL */ } __pyx_L3:; /* "View.MemoryView":386 * cdef int i * global __pyx_memoryview_thread_locks_used * if self.lock != NULL: # <<<<<<<<<<<<<< * for i in range(__pyx_memoryview_thread_locks_used): * if __pyx_memoryview_thread_locks[i] is self.lock: */ __pyx_t_1 = (__pyx_v_self->lock != NULL); if (__pyx_t_1) { /* "View.MemoryView":387 * global __pyx_memoryview_thread_locks_used * if self.lock != NULL: * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<< * if __pyx_memoryview_thread_locks[i] is self.lock: * __pyx_memoryview_thread_locks_used -= 1 */ __pyx_t_2 = __pyx_memoryview_thread_locks_used; __pyx_t_3 = __pyx_t_2; for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; /* "View.MemoryView":388 * if self.lock != NULL: * for i in range(__pyx_memoryview_thread_locks_used): * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<< * __pyx_memoryview_thread_locks_used -= 1 * if i != __pyx_memoryview_thread_locks_used: */ __pyx_t_1 = ((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock); if (__pyx_t_1) { /* "View.MemoryView":389 * for i in range(__pyx_memoryview_thread_locks_used): * if __pyx_memoryview_thread_locks[i] is self.lock: * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<< * if i != __pyx_memoryview_thread_locks_used: * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( */ __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1); /* "View.MemoryView":390 * if __pyx_memoryview_thread_locks[i] is self.lock: * __pyx_memoryview_thread_locks_used -= 1 * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<< * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) */ __pyx_t_1 = (__pyx_v_i != __pyx_memoryview_thread_locks_used); if (__pyx_t_1) { /* "View.MemoryView":392 * if i != __pyx_memoryview_thread_locks_used: * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<< * break * else: */ __pyx_t_5 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]); __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_v_i]); /* "View.MemoryView":391 * __pyx_memoryview_thread_locks_used -= 1 * if i != __pyx_memoryview_thread_locks_used: * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<< * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) * break */ (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_5; (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_6; /* "View.MemoryView":390 * if __pyx_memoryview_thread_locks[i] is self.lock: * __pyx_memoryview_thread_locks_used -= 1 * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<< * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) */ } /* "View.MemoryView":393 * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) * break # <<<<<<<<<<<<<< * else: * PyThread_free_lock(self.lock) */ goto __pyx_L6_break; /* "View.MemoryView":388 * if self.lock != NULL: * for i in range(__pyx_memoryview_thread_locks_used): * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<< * __pyx_memoryview_thread_locks_used -= 1 * if i != __pyx_memoryview_thread_locks_used: */ } } /*else*/ { /* "View.MemoryView":395 * break * else: * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<< * * cdef char *get_item_pointer(memoryview self, object index) except NULL: */ PyThread_free_lock(__pyx_v_self->lock); } __pyx_L6_break:; /* "View.MemoryView":386 * cdef int i * global __pyx_memoryview_thread_locks_used * if self.lock != NULL: # <<<<<<<<<<<<<< * for i in range(__pyx_memoryview_thread_locks_used): * if __pyx_memoryview_thread_locks[i] is self.lock: */ } /* "View.MemoryView":376 * self.typeinfo = NULL * * def __dealloc__(memoryview self): # <<<<<<<<<<<<<< * if self.obj is not None: * __Pyx_ReleaseBuffer(&self.view) */ /* function exit code */ } /* "View.MemoryView":397 * PyThread_free_lock(self.lock) * * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<< * cdef Py_ssize_t dim * cdef char *itemp = self.view.buf */ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) { Py_ssize_t __pyx_v_dim; char *__pyx_v_itemp; PyObject *__pyx_v_idx = NULL; char *__pyx_r; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; PyObject *(*__pyx_t_4)(PyObject *); PyObject *__pyx_t_5 = NULL; Py_ssize_t __pyx_t_6; char *__pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_item_pointer", 1); /* "View.MemoryView":399 * cdef char *get_item_pointer(memoryview self, object index) except NULL: * cdef Py_ssize_t dim * cdef char *itemp = self.view.buf # <<<<<<<<<<<<<< * * for dim, idx in enumerate(index): */ __pyx_v_itemp = ((char *)__pyx_v_self->view.buf); /* "View.MemoryView":401 * cdef char *itemp = self.view.buf * * for dim, idx in enumerate(index): # <<<<<<<<<<<<<< * itemp = pybuffer_index(&self.view, itemp, idx, dim) * */ __pyx_t_1 = 0; if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) { __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 401, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 401, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_2))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(13, 401, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(13, 401, __pyx_L1_error) #else __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 401, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(13, 401, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(13, 401, __pyx_L1_error) #else __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 401, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } } else { __pyx_t_5 = __pyx_t_4(__pyx_t_2); if (unlikely(!__pyx_t_5)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(13, 401, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_5); } __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5); __pyx_t_5 = 0; __pyx_v_dim = __pyx_t_1; __pyx_t_1 = (__pyx_t_1 + 1); /* "View.MemoryView":402 * * for dim, idx in enumerate(index): * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<< * * return itemp */ __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(13, 402, __pyx_L1_error) __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == ((char *)NULL))) __PYX_ERR(13, 402, __pyx_L1_error) __pyx_v_itemp = __pyx_t_7; /* "View.MemoryView":401 * cdef char *itemp = self.view.buf * * for dim, idx in enumerate(index): # <<<<<<<<<<<<<< * itemp = pybuffer_index(&self.view, itemp, idx, dim) * */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "View.MemoryView":404 * itemp = pybuffer_index(&self.view, itemp, idx, dim) * * return itemp # <<<<<<<<<<<<<< * * */ __pyx_r = __pyx_v_itemp; goto __pyx_L0; /* "View.MemoryView":397 * PyThread_free_lock(self.lock) * * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<< * cdef Py_ssize_t dim * cdef char *itemp = self.view.buf */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_idx); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":407 * * * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<< * if index is Ellipsis: * return self */ /* Python wrapper */ static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/ static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) { PyObject *__pyx_v_have_slices = NULL; PyObject *__pyx_v_indices = NULL; char *__pyx_v_itemp; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; char *__pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getitem__", 1); /* "View.MemoryView":408 * * def __getitem__(memoryview self, object index): * if index is Ellipsis: # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis); if (__pyx_t_1) { /* "View.MemoryView":409 * def __getitem__(memoryview self, object index): * if index is Ellipsis: * return self # <<<<<<<<<<<<<< * * have_slices, indices = _unellipsify(index, self.view.ndim) */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "View.MemoryView":408 * * def __getitem__(memoryview self, object index): * if index is Ellipsis: # <<<<<<<<<<<<<< * return self * */ } /* "View.MemoryView":411 * return self * * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<< * * cdef char *itemp */ __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (likely(__pyx_t_2 != Py_None)) { PyObject* sequence = __pyx_t_2; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(13, 411, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); #else __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(13, 411, __pyx_L1_error) } __pyx_v_have_slices = __pyx_t_3; __pyx_t_3 = 0; __pyx_v_indices = __pyx_t_4; __pyx_t_4 = 0; /* "View.MemoryView":414 * * cdef char *itemp * if have_slices: # <<<<<<<<<<<<<< * return memview_slice(self, indices) * else: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(13, 414, __pyx_L1_error) if (__pyx_t_1) { /* "View.MemoryView":415 * cdef char *itemp * if have_slices: * return memview_slice(self, indices) # <<<<<<<<<<<<<< * else: * itemp = self.get_item_pointer(indices) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 415, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "View.MemoryView":414 * * cdef char *itemp * if have_slices: # <<<<<<<<<<<<<< * return memview_slice(self, indices) * else: */ } /* "View.MemoryView":417 * return memview_slice(self, indices) * else: * itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<< * return self.convert_item_to_object(itemp) * */ /*else*/ { __pyx_t_5 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_5 == ((char *)NULL))) __PYX_ERR(13, 417, __pyx_L1_error) __pyx_v_itemp = __pyx_t_5; /* "View.MemoryView":418 * else: * itemp = self.get_item_pointer(indices) * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<< * * def __setitem__(memoryview self, object index, object value): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 418, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; } /* "View.MemoryView":407 * * * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<< * if index is Ellipsis: * return self */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_have_slices); __Pyx_XDECREF(__pyx_v_indices); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":420 * return self.convert_item_to_object(itemp) * * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<< * if self.view.readonly: * raise TypeError, "Cannot assign to read-only memoryview" */ /* Python wrapper */ static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/ static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) { PyObject *__pyx_v_have_slices = NULL; PyObject *__pyx_v_obj = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setitem__", 0); __Pyx_INCREF(__pyx_v_index); /* "View.MemoryView":421 * * def __setitem__(memoryview self, object index, object value): * if self.view.readonly: # <<<<<<<<<<<<<< * raise TypeError, "Cannot assign to read-only memoryview" * */ if (unlikely(__pyx_v_self->view.readonly)) { /* "View.MemoryView":422 * def __setitem__(memoryview self, object index, object value): * if self.view.readonly: * raise TypeError, "Cannot assign to read-only memoryview" # <<<<<<<<<<<<<< * * have_slices, index = _unellipsify(index, self.view.ndim) */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_Cannot_assign_to_read_only_memor, 0, 0); __PYX_ERR(13, 422, __pyx_L1_error) /* "View.MemoryView":421 * * def __setitem__(memoryview self, object index, object value): * if self.view.readonly: # <<<<<<<<<<<<<< * raise TypeError, "Cannot assign to read-only memoryview" * */ } /* "View.MemoryView":424 * raise TypeError, "Cannot assign to read-only memoryview" * * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<< * * if have_slices: */ __pyx_t_1 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 424, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(__pyx_t_1 != Py_None)) { PyObject* sequence = __pyx_t_1; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(13, 424, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 424, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 424, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(13, 424, __pyx_L1_error) } __pyx_v_have_slices = __pyx_t_2; __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_3); __pyx_t_3 = 0; /* "View.MemoryView":426 * have_slices, index = _unellipsify(index, self.view.ndim) * * if have_slices: # <<<<<<<<<<<<<< * obj = self.is_slice(value) * if obj: */ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(13, 426, __pyx_L1_error) if (__pyx_t_4) { /* "View.MemoryView":427 * * if have_slices: * obj = self.is_slice(value) # <<<<<<<<<<<<<< * if obj: * self.setitem_slice_assignment(self[index], obj) */ __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_obj = __pyx_t_1; __pyx_t_1 = 0; /* "View.MemoryView":428 * if have_slices: * obj = self.is_slice(value) * if obj: # <<<<<<<<<<<<<< * self.setitem_slice_assignment(self[index], obj) * else: */ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(13, 428, __pyx_L1_error) if (__pyx_t_4) { /* "View.MemoryView":429 * obj = self.is_slice(value) * if obj: * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<< * else: * self.setitem_slice_assign_scalar(self[index], value) */ __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_1, __pyx_v_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "View.MemoryView":428 * if have_slices: * obj = self.is_slice(value) * if obj: # <<<<<<<<<<<<<< * self.setitem_slice_assignment(self[index], obj) * else: */ goto __pyx_L5; } /* "View.MemoryView":431 * self.setitem_slice_assignment(self[index], obj) * else: * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<< * else: * self.setitem_indexed(index, value) */ /*else*/ { __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 431, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(13, 431, __pyx_L1_error) __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_3), __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 431, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_L5:; /* "View.MemoryView":426 * have_slices, index = _unellipsify(index, self.view.ndim) * * if have_slices: # <<<<<<<<<<<<<< * obj = self.is_slice(value) * if obj: */ goto __pyx_L4; } /* "View.MemoryView":433 * self.setitem_slice_assign_scalar(self[index], value) * else: * self.setitem_indexed(index, value) # <<<<<<<<<<<<<< * * cdef is_slice(self, obj): */ /*else*/ { __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 433, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_L4:; /* "View.MemoryView":420 * return self.convert_item_to_object(itemp) * * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<< * if self.view.readonly: * raise TypeError, "Cannot assign to read-only memoryview" */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_have_slices); __Pyx_XDECREF(__pyx_v_obj); __Pyx_XDECREF(__pyx_v_index); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":435 * self.setitem_indexed(index, value) * * cdef is_slice(self, obj): # <<<<<<<<<<<<<< * if not isinstance(obj, memoryview): * try: */ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("is_slice", 0); __Pyx_INCREF(__pyx_v_obj); /* "View.MemoryView":436 * * cdef is_slice(self, obj): * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<< * try: * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type); __pyx_t_2 = (!__pyx_t_1); if (__pyx_t_2) { /* "View.MemoryView":437 * cdef is_slice(self, obj): * if not isinstance(obj, memoryview): * try: # <<<<<<<<<<<<<< * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, * self.dtype_is_object) */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_5); /*try:*/ { /* "View.MemoryView":438 * if not isinstance(obj, memoryview): * try: * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<< * self.dtype_is_object) * except TypeError: */ __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(13, 438, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_6); /* "View.MemoryView":439 * try: * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, * self.dtype_is_object) # <<<<<<<<<<<<<< * except TypeError: * return None */ __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(13, 439, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_7); /* "View.MemoryView":438 * if not isinstance(obj, memoryview): * try: * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<< * self.dtype_is_object) * except TypeError: */ __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(13, 438, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_obj); __Pyx_GIVEREF(__pyx_v_obj); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj)) __PYX_ERR(13, 438, __pyx_L4_error); __Pyx_GIVEREF(__pyx_t_6); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6)) __PYX_ERR(13, 438, __pyx_L4_error); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7)) __PYX_ERR(13, 438, __pyx_L4_error); __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(13, 438, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7); __pyx_t_7 = 0; /* "View.MemoryView":437 * cdef is_slice(self, obj): * if not isinstance(obj, memoryview): * try: # <<<<<<<<<<<<<< * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, * self.dtype_is_object) */ } __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L9_try_end; __pyx_L4_error:; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; /* "View.MemoryView":440 * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, * self.dtype_is_object) * except TypeError: # <<<<<<<<<<<<<< * return None * */ __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError); if (__pyx_t_9) { __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(13, 440, __pyx_L6_except_error) __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); /* "View.MemoryView":441 * self.dtype_is_object) * except TypeError: * return None # <<<<<<<<<<<<<< * * return obj */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L7_except_return; } goto __pyx_L6_except_error; /* "View.MemoryView":437 * cdef is_slice(self, obj): * if not isinstance(obj, memoryview): * try: # <<<<<<<<<<<<<< * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, * self.dtype_is_object) */ __pyx_L6_except_error:; __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); goto __pyx_L1_error; __pyx_L7_except_return:; __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); goto __pyx_L0; __pyx_L9_try_end:; } /* "View.MemoryView":436 * * cdef is_slice(self, obj): * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<< * try: * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, */ } /* "View.MemoryView":443 * return None * * return obj # <<<<<<<<<<<<<< * * cdef setitem_slice_assignment(self, dst, src): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_obj); __pyx_r = __pyx_v_obj; goto __pyx_L0; /* "View.MemoryView":435 * self.setitem_indexed(index, value) * * cdef is_slice(self, obj): # <<<<<<<<<<<<<< * if not isinstance(obj, memoryview): * try: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_obj); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":445 * return obj * * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<< * cdef __Pyx_memviewslice dst_slice * cdef __Pyx_memviewslice src_slice */ static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) { __Pyx_memviewslice __pyx_v_dst_slice; __Pyx_memviewslice __pyx_v_src_slice; __Pyx_memviewslice __pyx_v_msrc; __Pyx_memviewslice __pyx_v_mdst; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_memviewslice *__pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setitem_slice_assignment", 1); /* "View.MemoryView":448 * cdef __Pyx_memviewslice dst_slice * cdef __Pyx_memviewslice src_slice * cdef __Pyx_memviewslice msrc = get_slice_from_memview(src, &src_slice)[0] # <<<<<<<<<<<<<< * cdef __Pyx_memviewslice mdst = get_slice_from_memview(dst, &dst_slice)[0] * */ if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(13, 448, __pyx_L1_error) __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(13, 448, __pyx_L1_error) __pyx_v_msrc = (__pyx_t_1[0]); /* "View.MemoryView":449 * cdef __Pyx_memviewslice src_slice * cdef __Pyx_memviewslice msrc = get_slice_from_memview(src, &src_slice)[0] * cdef __Pyx_memviewslice mdst = get_slice_from_memview(dst, &dst_slice)[0] # <<<<<<<<<<<<<< * * memoryview_copy_contents(msrc, mdst, src.ndim, dst.ndim, self.dtype_is_object) */ if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(13, 449, __pyx_L1_error) __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(13, 449, __pyx_L1_error) __pyx_v_mdst = (__pyx_t_1[0]); /* "View.MemoryView":451 * cdef __Pyx_memviewslice mdst = get_slice_from_memview(dst, &dst_slice)[0] * * memoryview_copy_contents(msrc, mdst, src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<< * * cdef setitem_slice_assign_scalar(self, memoryview dst, value): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(13, 451, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(13, 451, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_5 = __pyx_memoryview_copy_contents(__pyx_v_msrc, __pyx_v_mdst, __pyx_t_3, __pyx_t_4, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(13, 451, __pyx_L1_error) /* "View.MemoryView":445 * return obj * * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<< * cdef __Pyx_memviewslice dst_slice * cdef __Pyx_memviewslice src_slice */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":453 * memoryview_copy_contents(msrc, mdst, src.ndim, dst.ndim, self.dtype_is_object) * * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<< * cdef int array[128] * cdef void *tmp = NULL */ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) { int __pyx_v_array[0x80]; void *__pyx_v_tmp; void *__pyx_v_item; __Pyx_memviewslice *__pyx_v_dst_slice; __Pyx_memviewslice __pyx_v_tmp_slice; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_memviewslice *__pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; char const *__pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 1); /* "View.MemoryView":455 * cdef setitem_slice_assign_scalar(self, memoryview dst, value): * cdef int array[128] * cdef void *tmp = NULL # <<<<<<<<<<<<<< * cdef void *item * */ __pyx_v_tmp = NULL; /* "View.MemoryView":460 * cdef __Pyx_memviewslice *dst_slice * cdef __Pyx_memviewslice tmp_slice * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<< * * if self.view.itemsize > sizeof(array): */ __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(13, 460, __pyx_L1_error) __pyx_v_dst_slice = __pyx_t_1; /* "View.MemoryView":462 * dst_slice = get_slice_from_memview(dst, &tmp_slice) * * if self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<< * tmp = PyMem_Malloc(self.view.itemsize) * if tmp == NULL: */ __pyx_t_2 = (((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))); if (__pyx_t_2) { /* "View.MemoryView":463 * * if self.view.itemsize > sizeof(array): * tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<< * if tmp == NULL: * raise MemoryError */ __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize); /* "View.MemoryView":464 * if self.view.itemsize > sizeof(array): * tmp = PyMem_Malloc(self.view.itemsize) * if tmp == NULL: # <<<<<<<<<<<<<< * raise MemoryError * item = tmp */ __pyx_t_2 = (__pyx_v_tmp == NULL); if (unlikely(__pyx_t_2)) { /* "View.MemoryView":465 * tmp = PyMem_Malloc(self.view.itemsize) * if tmp == NULL: * raise MemoryError # <<<<<<<<<<<<<< * item = tmp * else: */ PyErr_NoMemory(); __PYX_ERR(13, 465, __pyx_L1_error) /* "View.MemoryView":464 * if self.view.itemsize > sizeof(array): * tmp = PyMem_Malloc(self.view.itemsize) * if tmp == NULL: # <<<<<<<<<<<<<< * raise MemoryError * item = tmp */ } /* "View.MemoryView":466 * if tmp == NULL: * raise MemoryError * item = tmp # <<<<<<<<<<<<<< * else: * item = array */ __pyx_v_item = __pyx_v_tmp; /* "View.MemoryView":462 * dst_slice = get_slice_from_memview(dst, &tmp_slice) * * if self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<< * tmp = PyMem_Malloc(self.view.itemsize) * if tmp == NULL: */ goto __pyx_L3; } /* "View.MemoryView":468 * item = tmp * else: * item = array # <<<<<<<<<<<<<< * * try: */ /*else*/ { __pyx_v_item = ((void *)__pyx_v_array); } __pyx_L3:; /* "View.MemoryView":470 * item = array * * try: # <<<<<<<<<<<<<< * if self.dtype_is_object: * ( item)[0] = value */ /*try:*/ { /* "View.MemoryView":471 * * try: * if self.dtype_is_object: # <<<<<<<<<<<<<< * ( item)[0] = value * else: */ if (__pyx_v_self->dtype_is_object) { /* "View.MemoryView":472 * try: * if self.dtype_is_object: * ( item)[0] = value # <<<<<<<<<<<<<< * else: * self.assign_item_from_object( item, value) */ (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value); /* "View.MemoryView":471 * * try: * if self.dtype_is_object: # <<<<<<<<<<<<<< * ( item)[0] = value * else: */ goto __pyx_L8; } /* "View.MemoryView":474 * ( item)[0] = value * else: * self.assign_item_from_object( item, value) # <<<<<<<<<<<<<< * * */ /*else*/ { __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 474, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_L8:; /* "View.MemoryView":478 * * * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<< * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, */ __pyx_t_2 = (__pyx_v_self->view.suboffsets != NULL); if (__pyx_t_2) { /* "View.MemoryView":479 * * if self.view.suboffsets != NULL: * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<< * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, * item, self.dtype_is_object) */ __pyx_t_4 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(13, 479, __pyx_L6_error) /* "View.MemoryView":478 * * * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<< * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, */ } /* "View.MemoryView":480 * if self.view.suboffsets != NULL: * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<< * item, self.dtype_is_object) * finally: */ __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object); } /* "View.MemoryView":483 * item, self.dtype_is_object) * finally: * PyMem_Free(tmp) # <<<<<<<<<<<<<< * * cdef setitem_indexed(self, index, value): */ /*finally:*/ { /*normal exit:*/{ PyMem_Free(__pyx_v_tmp); goto __pyx_L7; } __pyx_L6_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename; { PyMem_Free(__pyx_v_tmp); } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); } __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9); __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6; goto __pyx_L1_error; } __pyx_L7:; } /* "View.MemoryView":453 * memoryview_copy_contents(msrc, mdst, src.ndim, dst.ndim, self.dtype_is_object) * * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<< * cdef int array[128] * cdef void *tmp = NULL */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":485 * PyMem_Free(tmp) * * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<< * cdef char *itemp = self.get_item_pointer(index) * self.assign_item_from_object(itemp, value) */ static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) { char *__pyx_v_itemp; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations char *__pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setitem_indexed", 1); /* "View.MemoryView":486 * * cdef setitem_indexed(self, index, value): * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<< * self.assign_item_from_object(itemp, value) * */ __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(13, 486, __pyx_L1_error) __pyx_v_itemp = __pyx_t_1; /* "View.MemoryView":487 * cdef setitem_indexed(self, index, value): * cdef char *itemp = self.get_item_pointer(index) * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<< * * cdef convert_item_to_object(self, char *itemp): */ __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "View.MemoryView":485 * PyMem_Free(tmp) * * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<< * cdef char *itemp = self.get_item_pointer(index) * self.assign_item_from_object(itemp, value) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":489 * self.assign_item_from_object(itemp, value) * * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< * """Only used if instantiated manually by the user, or if Cython doesn't * know how to convert the type""" */ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) { PyObject *__pyx_v_struct = NULL; PyObject *__pyx_v_bytesitem = 0; PyObject *__pyx_v_result = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; Py_ssize_t __pyx_t_9; int __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("convert_item_to_object", 1); /* "View.MemoryView":492 * """Only used if instantiated manually by the user, or if Cython doesn't * know how to convert the type""" * import struct # <<<<<<<<<<<<<< * cdef bytes bytesitem * */ __pyx_t_1 = __Pyx_ImportDottedModule(__pyx_n_s_struct, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 492, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_struct = __pyx_t_1; __pyx_t_1 = 0; /* "View.MemoryView":495 * cdef bytes bytesitem * * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<< * try: * result = struct.unpack(self.view.format, bytesitem) */ __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 495, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_bytesitem = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "View.MemoryView":496 * * bytesitem = itemp[:self.view.itemsize] * try: # <<<<<<<<<<<<<< * result = struct.unpack(self.view.format, bytesitem) * except struct.error: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_4); /*try:*/ { /* "View.MemoryView":497 * bytesitem = itemp[:self.view.itemsize] * try: * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<< * except struct.error: * raise ValueError, "Unable to convert item to object" */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 497, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(13, 497, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 497, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_v_result = __pyx_t_1; __pyx_t_1 = 0; /* "View.MemoryView":496 * * bytesitem = itemp[:self.view.itemsize] * try: # <<<<<<<<<<<<<< * result = struct.unpack(self.view.format, bytesitem) * except struct.error: */ } /* "View.MemoryView":501 * raise ValueError, "Unable to convert item to object" * else: * if len(self.view.format) == 1: # <<<<<<<<<<<<<< * return result[0] * return result */ /*else:*/ { __pyx_t_9 = __Pyx_ssize_strlen(__pyx_v_self->view.format); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(13, 501, __pyx_L5_except_error) __pyx_t_10 = (__pyx_t_9 == 1); if (__pyx_t_10) { /* "View.MemoryView":502 * else: * if len(self.view.format) == 1: * return result[0] # <<<<<<<<<<<<<< * return result * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 502, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L6_except_return; /* "View.MemoryView":501 * raise ValueError, "Unable to convert item to object" * else: * if len(self.view.format) == 1: # <<<<<<<<<<<<<< * return result[0] * return result */ } /* "View.MemoryView":503 * if len(self.view.format) == 1: * return result[0] * return result # <<<<<<<<<<<<<< * * cdef assign_item_from_object(self, char *itemp, object value): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_result); __pyx_r = __pyx_v_result; goto __pyx_L6_except_return; } __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; /* "View.MemoryView":498 * try: * result = struct.unpack(self.view.format, bytesitem) * except struct.error: # <<<<<<<<<<<<<< * raise ValueError, "Unable to convert item to object" * else: */ __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_7)) __PYX_ERR(13, 498, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_6); __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0; if (__pyx_t_8) { __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(13, 498, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_1); /* "View.MemoryView":499 * result = struct.unpack(self.view.format, bytesitem) * except struct.error: * raise ValueError, "Unable to convert item to object" # <<<<<<<<<<<<<< * else: * if len(self.view.format) == 1: */ __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_Unable_to_convert_item_to_object, 0, 0); __PYX_ERR(13, 499, __pyx_L5_except_error) } goto __pyx_L5_except_error; /* "View.MemoryView":496 * * bytesitem = itemp[:self.view.itemsize] * try: # <<<<<<<<<<<<<< * result = struct.unpack(self.view.format, bytesitem) * except struct.error: */ __pyx_L5_except_error:; __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); goto __pyx_L1_error; __pyx_L6_except_return:; __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); goto __pyx_L0; } /* "View.MemoryView":489 * self.assign_item_from_object(itemp, value) * * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< * """Only used if instantiated manually by the user, or if Cython doesn't * know how to convert the type""" */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_struct); __Pyx_XDECREF(__pyx_v_bytesitem); __Pyx_XDECREF(__pyx_v_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":505 * return result * * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< * """Only used if instantiated manually by the user, or if Cython doesn't * know how to convert the type""" */ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) { PyObject *__pyx_v_struct = NULL; char __pyx_v_c; PyObject *__pyx_v_bytesvalue = 0; Py_ssize_t __pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; Py_ssize_t __pyx_t_7; PyObject *__pyx_t_8 = NULL; char *__pyx_t_9; char *__pyx_t_10; char *__pyx_t_11; char *__pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("assign_item_from_object", 1); /* "View.MemoryView":508 * """Only used if instantiated manually by the user, or if Cython doesn't * know how to convert the type""" * import struct # <<<<<<<<<<<<<< * cdef char c * cdef bytes bytesvalue */ __pyx_t_1 = __Pyx_ImportDottedModule(__pyx_n_s_struct, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 508, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_struct = __pyx_t_1; __pyx_t_1 = 0; /* "View.MemoryView":513 * cdef Py_ssize_t i * * if isinstance(value, tuple): # <<<<<<<<<<<<<< * bytesvalue = struct.pack(self.view.format, *value) * else: */ __pyx_t_2 = PyTuple_Check(__pyx_v_value); if (__pyx_t_2) { /* "View.MemoryView":514 * * if isinstance(value, tuple): * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<< * else: * bytesvalue = struct.pack(self.view.format, value) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(13, 514, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (!(likely(PyBytes_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_3))) __PYX_ERR(13, 514, __pyx_L1_error) __pyx_v_bytesvalue = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "View.MemoryView":513 * cdef Py_ssize_t i * * if isinstance(value, tuple): # <<<<<<<<<<<<<< * bytesvalue = struct.pack(self.view.format, *value) * else: */ goto __pyx_L3; } /* "View.MemoryView":516 * bytesvalue = struct.pack(self.view.format, *value) * else: * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<< * * for i, c in enumerate(bytesvalue): */ /*else*/ { __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 516, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 516, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_1, __pyx_v_value}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 516, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } if (!(likely(PyBytes_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_3))) __PYX_ERR(13, 516, __pyx_L1_error) __pyx_v_bytesvalue = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; } __pyx_L3:; /* "View.MemoryView":518 * bytesvalue = struct.pack(self.view.format, value) * * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<< * itemp[i] = c * */ __pyx_t_7 = 0; if (unlikely(__pyx_v_bytesvalue == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable"); __PYX_ERR(13, 518, __pyx_L1_error) } __Pyx_INCREF(__pyx_v_bytesvalue); __pyx_t_8 = __pyx_v_bytesvalue; __pyx_t_10 = PyBytes_AS_STRING(__pyx_t_8); __pyx_t_11 = (__pyx_t_10 + PyBytes_GET_SIZE(__pyx_t_8)); for (__pyx_t_12 = __pyx_t_10; __pyx_t_12 < __pyx_t_11; __pyx_t_12++) { __pyx_t_9 = __pyx_t_12; __pyx_v_c = (__pyx_t_9[0]); /* "View.MemoryView":519 * * for i, c in enumerate(bytesvalue): * itemp[i] = c # <<<<<<<<<<<<<< * * @cname('getbuffer') */ __pyx_v_i = __pyx_t_7; /* "View.MemoryView":518 * bytesvalue = struct.pack(self.view.format, value) * * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<< * itemp[i] = c * */ __pyx_t_7 = (__pyx_t_7 + 1); /* "View.MemoryView":519 * * for i, c in enumerate(bytesvalue): * itemp[i] = c # <<<<<<<<<<<<<< * * @cname('getbuffer') */ (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c; } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "View.MemoryView":505 * return result * * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< * """Only used if instantiated manually by the user, or if Cython doesn't * know how to convert the type""" */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_struct); __Pyx_XDECREF(__pyx_v_bytesvalue); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":521 * itemp[i] = c * * @cname('getbuffer') # <<<<<<<<<<<<<< * def __getbuffer__(self, Py_buffer *info, int flags): * if flags & PyBUF_WRITABLE and self.view.readonly: */ /* Python wrapper */ CYTHON_UNUSED static int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ CYTHON_UNUSED static int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; Py_ssize_t *__pyx_t_3; char *__pyx_t_4; void *__pyx_t_5; int __pyx_t_6; Py_ssize_t __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; if (unlikely(__pyx_v_info == NULL)) { PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete"); return -1; } __Pyx_RefNannySetupContext("__getbuffer__", 0); __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); __Pyx_GIVEREF(__pyx_v_info->obj); /* "View.MemoryView":523 * @cname('getbuffer') * def __getbuffer__(self, Py_buffer *info, int flags): * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<< * raise ValueError, "Cannot create writable memory view from read-only memoryview" * */ __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_1 = __pyx_v_self->view.readonly; __pyx_L4_bool_binop_done:; if (unlikely(__pyx_t_1)) { /* "View.MemoryView":524 * def __getbuffer__(self, Py_buffer *info, int flags): * if flags & PyBUF_WRITABLE and self.view.readonly: * raise ValueError, "Cannot create writable memory view from read-only memoryview" # <<<<<<<<<<<<<< * * if flags & PyBUF_ND: */ __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_Cannot_create_writable_memory_vi, 0, 0); __PYX_ERR(13, 524, __pyx_L1_error) /* "View.MemoryView":523 * @cname('getbuffer') * def __getbuffer__(self, Py_buffer *info, int flags): * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<< * raise ValueError, "Cannot create writable memory view from read-only memoryview" * */ } /* "View.MemoryView":526 * raise ValueError, "Cannot create writable memory view from read-only memoryview" * * if flags & PyBUF_ND: # <<<<<<<<<<<<<< * info.shape = self.view.shape * else: */ __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0); if (__pyx_t_1) { /* "View.MemoryView":527 * * if flags & PyBUF_ND: * info.shape = self.view.shape # <<<<<<<<<<<<<< * else: * info.shape = NULL */ __pyx_t_3 = __pyx_v_self->view.shape; __pyx_v_info->shape = __pyx_t_3; /* "View.MemoryView":526 * raise ValueError, "Cannot create writable memory view from read-only memoryview" * * if flags & PyBUF_ND: # <<<<<<<<<<<<<< * info.shape = self.view.shape * else: */ goto __pyx_L6; } /* "View.MemoryView":529 * info.shape = self.view.shape * else: * info.shape = NULL # <<<<<<<<<<<<<< * * if flags & PyBUF_STRIDES: */ /*else*/ { __pyx_v_info->shape = NULL; } __pyx_L6:; /* "View.MemoryView":531 * info.shape = NULL * * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< * info.strides = self.view.strides * else: */ __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0); if (__pyx_t_1) { /* "View.MemoryView":532 * * if flags & PyBUF_STRIDES: * info.strides = self.view.strides # <<<<<<<<<<<<<< * else: * info.strides = NULL */ __pyx_t_3 = __pyx_v_self->view.strides; __pyx_v_info->strides = __pyx_t_3; /* "View.MemoryView":531 * info.shape = NULL * * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< * info.strides = self.view.strides * else: */ goto __pyx_L7; } /* "View.MemoryView":534 * info.strides = self.view.strides * else: * info.strides = NULL # <<<<<<<<<<<<<< * * if flags & PyBUF_INDIRECT: */ /*else*/ { __pyx_v_info->strides = NULL; } __pyx_L7:; /* "View.MemoryView":536 * info.strides = NULL * * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<< * info.suboffsets = self.view.suboffsets * else: */ __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0); if (__pyx_t_1) { /* "View.MemoryView":537 * * if flags & PyBUF_INDIRECT: * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<< * else: * info.suboffsets = NULL */ __pyx_t_3 = __pyx_v_self->view.suboffsets; __pyx_v_info->suboffsets = __pyx_t_3; /* "View.MemoryView":536 * info.strides = NULL * * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<< * info.suboffsets = self.view.suboffsets * else: */ goto __pyx_L8; } /* "View.MemoryView":539 * info.suboffsets = self.view.suboffsets * else: * info.suboffsets = NULL # <<<<<<<<<<<<<< * * if flags & PyBUF_FORMAT: */ /*else*/ { __pyx_v_info->suboffsets = NULL; } __pyx_L8:; /* "View.MemoryView":541 * info.suboffsets = NULL * * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< * info.format = self.view.format * else: */ __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); if (__pyx_t_1) { /* "View.MemoryView":542 * * if flags & PyBUF_FORMAT: * info.format = self.view.format # <<<<<<<<<<<<<< * else: * info.format = NULL */ __pyx_t_4 = __pyx_v_self->view.format; __pyx_v_info->format = __pyx_t_4; /* "View.MemoryView":541 * info.suboffsets = NULL * * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< * info.format = self.view.format * else: */ goto __pyx_L9; } /* "View.MemoryView":544 * info.format = self.view.format * else: * info.format = NULL # <<<<<<<<<<<<<< * * info.buf = self.view.buf */ /*else*/ { __pyx_v_info->format = NULL; } __pyx_L9:; /* "View.MemoryView":546 * info.format = NULL * * info.buf = self.view.buf # <<<<<<<<<<<<<< * info.ndim = self.view.ndim * info.itemsize = self.view.itemsize */ __pyx_t_5 = __pyx_v_self->view.buf; __pyx_v_info->buf = __pyx_t_5; /* "View.MemoryView":547 * * info.buf = self.view.buf * info.ndim = self.view.ndim # <<<<<<<<<<<<<< * info.itemsize = self.view.itemsize * info.len = self.view.len */ __pyx_t_6 = __pyx_v_self->view.ndim; __pyx_v_info->ndim = __pyx_t_6; /* "View.MemoryView":548 * info.buf = self.view.buf * info.ndim = self.view.ndim * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<< * info.len = self.view.len * info.readonly = self.view.readonly */ __pyx_t_7 = __pyx_v_self->view.itemsize; __pyx_v_info->itemsize = __pyx_t_7; /* "View.MemoryView":549 * info.ndim = self.view.ndim * info.itemsize = self.view.itemsize * info.len = self.view.len # <<<<<<<<<<<<<< * info.readonly = self.view.readonly * info.obj = self */ __pyx_t_7 = __pyx_v_self->view.len; __pyx_v_info->len = __pyx_t_7; /* "View.MemoryView":550 * info.itemsize = self.view.itemsize * info.len = self.view.len * info.readonly = self.view.readonly # <<<<<<<<<<<<<< * info.obj = self * */ __pyx_t_1 = __pyx_v_self->view.readonly; __pyx_v_info->readonly = __pyx_t_1; /* "View.MemoryView":551 * info.len = self.view.len * info.readonly = self.view.readonly * info.obj = self # <<<<<<<<<<<<<< * * */ __Pyx_INCREF((PyObject *)__pyx_v_self); __Pyx_GIVEREF((PyObject *)__pyx_v_self); __Pyx_GOTREF(__pyx_v_info->obj); __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = ((PyObject *)__pyx_v_self); /* "View.MemoryView":521 * itemp[i] = c * * @cname('getbuffer') # <<<<<<<<<<<<<< * def __getbuffer__(self, Py_buffer *info, int flags): * if flags & PyBUF_WRITABLE and self.view.readonly: */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; if (__pyx_v_info->obj != NULL) { __Pyx_GOTREF(__pyx_v_info->obj); __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0; } goto __pyx_L2; __pyx_L0:; if (__pyx_v_info->obj == Py_None) { __Pyx_GOTREF(__pyx_v_info->obj); __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0; } __pyx_L2:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":554 * * * @property # <<<<<<<<<<<<<< * def T(self): * cdef _memoryviewslice result = memoryview_copy(self) */ /* Python wrapper */ static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) { struct __pyx_memoryviewslice_obj *__pyx_v_result = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "View.MemoryView":556 * @property * def T(self): * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<< * transpose_memslice(&result.from_slice) * return result */ __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(13, 556, __pyx_L1_error) __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1); __pyx_t_1 = 0; /* "View.MemoryView":557 * def T(self): * cdef _memoryviewslice result = memoryview_copy(self) * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<< * return result * */ __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(13, 557, __pyx_L1_error) /* "View.MemoryView":558 * cdef _memoryviewslice result = memoryview_copy(self) * transpose_memslice(&result.from_slice) * return result # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_result); __pyx_r = ((PyObject *)__pyx_v_result); goto __pyx_L0; /* "View.MemoryView":554 * * * @property # <<<<<<<<<<<<<< * def T(self): * cdef _memoryviewslice result = memoryview_copy(self) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":560 * return result * * @property # <<<<<<<<<<<<<< * def base(self): * return self._get_base() */ /* Python wrapper */ static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "View.MemoryView":562 * @property * def base(self): * return self._get_base() # <<<<<<<<<<<<<< * * cdef _get_base(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->_get_base(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "View.MemoryView":560 * return result * * @property # <<<<<<<<<<<<<< * def base(self): * return self._get_base() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("View.MemoryView.memoryview.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":564 * return self._get_base() * * cdef _get_base(self): # <<<<<<<<<<<<<< * return self.obj * */ static PyObject *__pyx_memoryview__get_base(struct __pyx_memoryview_obj *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_get_base", 1); /* "View.MemoryView":565 * * cdef _get_base(self): * return self.obj # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->obj); __pyx_r = __pyx_v_self->obj; goto __pyx_L0; /* "View.MemoryView":564 * return self._get_base() * * cdef _get_base(self): # <<<<<<<<<<<<<< * return self.obj * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":567 * return self.obj * * @property # <<<<<<<<<<<<<< * def shape(self): * return tuple([length for length in self.view.shape[:self.view.ndim]]) */ /* Python wrapper */ static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) { Py_ssize_t __pyx_7genexpr__pyx_v_length; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t *__pyx_t_2; Py_ssize_t *__pyx_t_3; Py_ssize_t *__pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "View.MemoryView":569 * @property * def shape(self): * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); { /* enter inner scope */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim); for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) { __pyx_t_2 = __pyx_t_4; __pyx_7genexpr__pyx_v_length = (__pyx_t_2[0]); __pyx_t_5 = PyInt_FromSsize_t(__pyx_7genexpr__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(13, 569, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } } /* exit inner scope */ __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "View.MemoryView":567 * return self.obj * * @property # <<<<<<<<<<<<<< * def shape(self): * return tuple([length for length in self.view.shape[:self.view.ndim]]) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":571 * return tuple([length for length in self.view.shape[:self.view.ndim]]) * * @property # <<<<<<<<<<<<<< * def strides(self): * if self.view.strides == NULL: */ /* Python wrapper */ static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) { Py_ssize_t __pyx_8genexpr1__pyx_v_stride; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; Py_ssize_t *__pyx_t_3; Py_ssize_t *__pyx_t_4; Py_ssize_t *__pyx_t_5; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "View.MemoryView":573 * @property * def strides(self): * if self.view.strides == NULL: # <<<<<<<<<<<<<< * * raise ValueError, "Buffer view does not expose strides" */ __pyx_t_1 = (__pyx_v_self->view.strides == NULL); if (unlikely(__pyx_t_1)) { /* "View.MemoryView":575 * if self.view.strides == NULL: * * raise ValueError, "Buffer view does not expose strides" # <<<<<<<<<<<<<< * * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) */ __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_Buffer_view_does_not_expose_stri, 0, 0); __PYX_ERR(13, 575, __pyx_L1_error) /* "View.MemoryView":573 * @property * def strides(self): * if self.view.strides == NULL: # <<<<<<<<<<<<<< * * raise ValueError, "Buffer view does not expose strides" */ } /* "View.MemoryView":577 * raise ValueError, "Buffer view does not expose strides" * * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); { /* enter inner scope */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim); for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) { __pyx_t_3 = __pyx_t_5; __pyx_8genexpr1__pyx_v_stride = (__pyx_t_3[0]); __pyx_t_6 = PyInt_FromSsize_t(__pyx_8genexpr1__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(13, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(13, 577, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } } /* exit inner scope */ __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(13, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "View.MemoryView":571 * return tuple([length for length in self.view.shape[:self.view.ndim]]) * * @property # <<<<<<<<<<<<<< * def strides(self): * if self.view.strides == NULL: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":579 * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) * * @property # <<<<<<<<<<<<<< * def suboffsets(self): * if self.view.suboffsets == NULL: */ /* Python wrapper */ static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) { Py_ssize_t __pyx_8genexpr2__pyx_v_suboffset; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; Py_ssize_t *__pyx_t_3; Py_ssize_t *__pyx_t_4; Py_ssize_t *__pyx_t_5; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "View.MemoryView":581 * @property * def suboffsets(self): * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<< * return (-1,) * self.view.ndim * */ __pyx_t_1 = (__pyx_v_self->view.suboffsets == NULL); if (__pyx_t_1) { /* "View.MemoryView":582 * def suboffsets(self): * if self.view.suboffsets == NULL: * return (-1,) * self.view.ndim # <<<<<<<<<<<<<< * * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PySequence_Multiply(__pyx_tuple__4, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "View.MemoryView":581 * @property * def suboffsets(self): * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<< * return (-1,) * self.view.ndim * */ } /* "View.MemoryView":584 * return (-1,) * self.view.ndim * * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); { /* enter inner scope */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim); for (__pyx_t_5 = __pyx_v_self->view.suboffsets; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) { __pyx_t_3 = __pyx_t_5; __pyx_8genexpr2__pyx_v_suboffset = (__pyx_t_3[0]); __pyx_t_6 = PyInt_FromSsize_t(__pyx_8genexpr2__pyx_v_suboffset); if (unlikely(!__pyx_t_6)) __PYX_ERR(13, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(13, 584, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } } /* exit inner scope */ __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(13, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "View.MemoryView":579 * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) * * @property # <<<<<<<<<<<<<< * def suboffsets(self): * if self.view.suboffsets == NULL: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":586 * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) * * @property # <<<<<<<<<<<<<< * def ndim(self): * return self.view.ndim */ /* Python wrapper */ static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "View.MemoryView":588 * @property * def ndim(self): * return self.view.ndim # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 588, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "View.MemoryView":586 * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) * * @property # <<<<<<<<<<<<<< * def ndim(self): * return self.view.ndim */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":590 * return self.view.ndim * * @property # <<<<<<<<<<<<<< * def itemsize(self): * return self.view.itemsize */ /* Python wrapper */ static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "View.MemoryView":592 * @property * def itemsize(self): * return self.view.itemsize # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "View.MemoryView":590 * return self.view.ndim * * @property # <<<<<<<<<<<<<< * def itemsize(self): * return self.view.itemsize */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":594 * return self.view.itemsize * * @property # <<<<<<<<<<<<<< * def nbytes(self): * return self.size * self.view.itemsize */ /* Python wrapper */ static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "View.MemoryView":596 * @property * def nbytes(self): * return self.size * self.view.itemsize # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 596, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 596, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 596, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "View.MemoryView":594 * return self.view.itemsize * * @property # <<<<<<<<<<<<<< * def nbytes(self): * return self.size * self.view.itemsize */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":598 * return self.size * self.view.itemsize * * @property # <<<<<<<<<<<<<< * def size(self): * if self._size is None: */ /* Python wrapper */ static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) { PyObject *__pyx_v_result = NULL; PyObject *__pyx_v_length = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; Py_ssize_t *__pyx_t_2; Py_ssize_t *__pyx_t_3; Py_ssize_t *__pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "View.MemoryView":600 * @property * def size(self): * if self._size is None: # <<<<<<<<<<<<<< * result = 1 * */ __pyx_t_1 = (__pyx_v_self->_size == Py_None); if (__pyx_t_1) { /* "View.MemoryView":601 * def size(self): * if self._size is None: * result = 1 # <<<<<<<<<<<<<< * * for length in self.view.shape[:self.view.ndim]: */ __Pyx_INCREF(__pyx_int_1); __pyx_v_result = __pyx_int_1; /* "View.MemoryView":603 * result = 1 * * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<< * result *= length * */ __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim); for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) { __pyx_t_2 = __pyx_t_4; __pyx_t_5 = PyInt_FromSsize_t((__pyx_t_2[0])); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 603, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_5); __pyx_t_5 = 0; /* "View.MemoryView":604 * * for length in self.view.shape[:self.view.ndim]: * result *= length # <<<<<<<<<<<<<< * * self._size = result */ __pyx_t_5 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 604, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_5); __pyx_t_5 = 0; } /* "View.MemoryView":606 * result *= length * * self._size = result # <<<<<<<<<<<<<< * * return self._size */ __Pyx_INCREF(__pyx_v_result); __Pyx_GIVEREF(__pyx_v_result); __Pyx_GOTREF(__pyx_v_self->_size); __Pyx_DECREF(__pyx_v_self->_size); __pyx_v_self->_size = __pyx_v_result; /* "View.MemoryView":600 * @property * def size(self): * if self._size is None: # <<<<<<<<<<<<<< * result = 1 * */ } /* "View.MemoryView":608 * self._size = result * * return self._size # <<<<<<<<<<<<<< * * def __len__(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_size); __pyx_r = __pyx_v_self->_size; goto __pyx_L0; /* "View.MemoryView":598 * return self.size * self.view.itemsize * * @property # <<<<<<<<<<<<<< * def size(self): * if self._size is None: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_result); __Pyx_XDECREF(__pyx_v_length); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":610 * return self._size * * def __len__(self): # <<<<<<<<<<<<<< * if self.view.ndim >= 1: * return self.view.shape[0] */ /* Python wrapper */ static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/ static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) { Py_ssize_t __pyx_r; int __pyx_t_1; /* "View.MemoryView":611 * * def __len__(self): * if self.view.ndim >= 1: # <<<<<<<<<<<<<< * return self.view.shape[0] * */ __pyx_t_1 = (__pyx_v_self->view.ndim >= 1); if (__pyx_t_1) { /* "View.MemoryView":612 * def __len__(self): * if self.view.ndim >= 1: * return self.view.shape[0] # <<<<<<<<<<<<<< * * return 0 */ __pyx_r = (__pyx_v_self->view.shape[0]); goto __pyx_L0; /* "View.MemoryView":611 * * def __len__(self): * if self.view.ndim >= 1: # <<<<<<<<<<<<<< * return self.view.shape[0] * */ } /* "View.MemoryView":614 * return self.view.shape[0] * * return 0 # <<<<<<<<<<<<<< * * def __repr__(self): */ __pyx_r = 0; goto __pyx_L0; /* "View.MemoryView":610 * return self._size * * def __len__(self): # <<<<<<<<<<<<<< * if self.view.ndim >= 1: * return self.view.shape[0] */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "View.MemoryView":616 * return 0 * * def __repr__(self): # <<<<<<<<<<<<<< * return "" % (self.base.__class__.__name__, * id(self)) */ /* Python wrapper */ static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__repr__", 1); /* "View.MemoryView":617 * * def __repr__(self): * return "" % (self.base.__class__.__name__, # <<<<<<<<<<<<<< * id(self)) * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "View.MemoryView":618 * def __repr__(self): * return "" % (self.base.__class__.__name__, * id(self)) # <<<<<<<<<<<<<< * * def __str__(self): */ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "View.MemoryView":617 * * def __repr__(self): * return "" % (self.base.__class__.__name__, # <<<<<<<<<<<<<< * id(self)) * */ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(13, 617, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(13, 617, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "View.MemoryView":616 * return 0 * * def __repr__(self): # <<<<<<<<<<<<<< * return "" % (self.base.__class__.__name__, * id(self)) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":620 * id(self)) * * def __str__(self): # <<<<<<<<<<<<<< * return "" % (self.base.__class__.__name__,) * */ /* Python wrapper */ static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__str__", 1); /* "View.MemoryView":621 * * def __str__(self): * return "" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 621, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 621, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 621, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 621, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(13, 621, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 621, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "View.MemoryView":620 * id(self)) * * def __str__(self): # <<<<<<<<<<<<<< * return "" % (self.base.__class__.__name__,) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":624 * * * def is_c_contig(self): # <<<<<<<<<<<<<< * cdef __Pyx_memviewslice *mslice * cdef __Pyx_memviewslice tmp */ /* Python wrapper */ static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("is_c_contig", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "is_c_contig", 0))) return NULL; __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) { __Pyx_memviewslice *__pyx_v_mslice; __Pyx_memviewslice __pyx_v_tmp; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_memviewslice *__pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("is_c_contig", 1); /* "View.MemoryView":627 * cdef __Pyx_memviewslice *mslice * cdef __Pyx_memviewslice tmp * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<< * return slice_is_contig(mslice[0], 'C', self.view.ndim) * */ __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(13, 627, __pyx_L1_error) __pyx_v_mslice = __pyx_t_1; /* "View.MemoryView":628 * cdef __Pyx_memviewslice tmp * mslice = get_slice_from_memview(self, &tmp) * return slice_is_contig(mslice[0], 'C', self.view.ndim) # <<<<<<<<<<<<<< * * def is_f_contig(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 628, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "View.MemoryView":624 * * * def is_c_contig(self): # <<<<<<<<<<<<<< * cdef __Pyx_memviewslice *mslice * cdef __Pyx_memviewslice tmp */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":630 * return slice_is_contig(mslice[0], 'C', self.view.ndim) * * def is_f_contig(self): # <<<<<<<<<<<<<< * cdef __Pyx_memviewslice *mslice * cdef __Pyx_memviewslice tmp */ /* Python wrapper */ static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("is_f_contig", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "is_f_contig", 0))) return NULL; __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) { __Pyx_memviewslice *__pyx_v_mslice; __Pyx_memviewslice __pyx_v_tmp; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_memviewslice *__pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("is_f_contig", 1); /* "View.MemoryView":633 * cdef __Pyx_memviewslice *mslice * cdef __Pyx_memviewslice tmp * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<< * return slice_is_contig(mslice[0], 'F', self.view.ndim) * */ __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(13, 633, __pyx_L1_error) __pyx_v_mslice = __pyx_t_1; /* "View.MemoryView":634 * cdef __Pyx_memviewslice tmp * mslice = get_slice_from_memview(self, &tmp) * return slice_is_contig(mslice[0], 'F', self.view.ndim) # <<<<<<<<<<<<<< * * def copy(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 634, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "View.MemoryView":630 * return slice_is_contig(mslice[0], 'C', self.view.ndim) * * def is_f_contig(self): # <<<<<<<<<<<<<< * cdef __Pyx_memviewslice *mslice * cdef __Pyx_memviewslice tmp */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":636 * return slice_is_contig(mslice[0], 'F', self.view.ndim) * * def copy(self): # <<<<<<<<<<<<<< * cdef __Pyx_memviewslice mslice * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS */ /* Python wrapper */ static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("copy (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("copy", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "copy", 0))) return NULL; __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) { __Pyx_memviewslice __pyx_v_mslice; int __pyx_v_flags; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_memviewslice __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("copy", 1); /* "View.MemoryView":638 * def copy(self): * cdef __Pyx_memviewslice mslice * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<< * * slice_copy(self, &mslice) */ __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS)); /* "View.MemoryView":640 * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS * * slice_copy(self, &mslice) # <<<<<<<<<<<<<< * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, * self.view.itemsize, */ __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice)); /* "View.MemoryView":641 * * slice_copy(self, &mslice) * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<< * self.view.itemsize, * flags|PyBUF_C_CONTIGUOUS, */ __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(13, 641, __pyx_L1_error) __pyx_v_mslice = __pyx_t_1; /* "View.MemoryView":646 * self.dtype_is_object) * * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<< * * def copy_fortran(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "View.MemoryView":636 * return slice_is_contig(mslice[0], 'F', self.view.ndim) * * def copy(self): # <<<<<<<<<<<<<< * cdef __Pyx_memviewslice mslice * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":648 * return memoryview_copy_from_slice(self, &mslice) * * def copy_fortran(self): # <<<<<<<<<<<<<< * cdef __Pyx_memviewslice src, dst * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS */ /* Python wrapper */ static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("copy_fortran", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "copy_fortran", 0))) return NULL; __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) { __Pyx_memviewslice __pyx_v_src; __Pyx_memviewslice __pyx_v_dst; int __pyx_v_flags; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_memviewslice __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("copy_fortran", 1); /* "View.MemoryView":650 * def copy_fortran(self): * cdef __Pyx_memviewslice src, dst * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<< * * slice_copy(self, &src) */ __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS)); /* "View.MemoryView":652 * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS * * slice_copy(self, &src) # <<<<<<<<<<<<<< * dst = slice_copy_contig(&src, "fortran", self.view.ndim, * self.view.itemsize, */ __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src)); /* "View.MemoryView":653 * * slice_copy(self, &src) * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<< * self.view.itemsize, * flags|PyBUF_F_CONTIGUOUS, */ __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(13, 653, __pyx_L1_error) __pyx_v_dst = __pyx_t_1; /* "View.MemoryView":658 * self.dtype_is_object) * * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 658, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "View.MemoryView":648 * return memoryview_copy_from_slice(self, &mslice) * * def copy_fortran(self): # <<<<<<<<<<<<<< * cdef __Pyx_memviewslice src, dst * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(13, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* Python wrapper */ static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(13, 3, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(13, 3, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v___pyx_state = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(13, 3, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":4 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(13, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":662 * * @cname('__pyx_memoryview_new') * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<< * cdef memoryview result = memoryview(o, flags, dtype_is_object) * result.typeinfo = typeinfo */ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) { struct __pyx_memoryview_obj *__pyx_v_result = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("memoryview_cwrapper", 1); /* "View.MemoryView":663 * @cname('__pyx_memoryview_new') * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<< * result.typeinfo = typeinfo * return result */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 663, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 663, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 663, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_o); __Pyx_GIVEREF(__pyx_v_o); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o)) __PYX_ERR(13, 663, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(13, 663, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2)) __PYX_ERR(13, 663, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 663, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2); __pyx_t_2 = 0; /* "View.MemoryView":664 * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): * cdef memoryview result = memoryview(o, flags, dtype_is_object) * result.typeinfo = typeinfo # <<<<<<<<<<<<<< * return result * */ __pyx_v_result->typeinfo = __pyx_v_typeinfo; /* "View.MemoryView":665 * cdef memoryview result = memoryview(o, flags, dtype_is_object) * result.typeinfo = typeinfo * return result # <<<<<<<<<<<<<< * * @cname('__pyx_memoryview_check') */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_result); __pyx_r = ((PyObject *)__pyx_v_result); goto __pyx_L0; /* "View.MemoryView":662 * * @cname('__pyx_memoryview_new') * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<< * cdef memoryview result = memoryview(o, flags, dtype_is_object) * result.typeinfo = typeinfo */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":668 * * @cname('__pyx_memoryview_check') * cdef inline bint memoryview_check(object o) noexcept: # <<<<<<<<<<<<<< * return isinstance(o, memoryview) * */ static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) { int __pyx_r; int __pyx_t_1; /* "View.MemoryView":669 * @cname('__pyx_memoryview_check') * cdef inline bint memoryview_check(object o) noexcept: * return isinstance(o, memoryview) # <<<<<<<<<<<<<< * * cdef tuple _unellipsify(object index, int ndim): */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type); __pyx_r = __pyx_t_1; goto __pyx_L0; /* "View.MemoryView":668 * * @cname('__pyx_memoryview_check') * cdef inline bint memoryview_check(object o) noexcept: # <<<<<<<<<<<<<< * return isinstance(o, memoryview) * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "View.MemoryView":671 * return isinstance(o, memoryview) * * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<< * """ * Replace all ellipses with full slices and fill incomplete indices with */ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { Py_ssize_t __pyx_v_idx; PyObject *__pyx_v_tup = NULL; PyObject *__pyx_v_result = NULL; int __pyx_v_have_slices; int __pyx_v_seen_ellipsis; PyObject *__pyx_v_item = NULL; Py_ssize_t __pyx_v_nslices; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; Py_ssize_t __pyx_t_5; Py_UCS4 __pyx_t_6; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_unellipsify", 1); /* "View.MemoryView":677 * """ * cdef Py_ssize_t idx * tup = index if isinstance(index, tuple) else (index,) # <<<<<<<<<<<<<< * * result = [slice(None)] * ndim */ __pyx_t_2 = PyTuple_Check(__pyx_v_index); if (__pyx_t_2) { __Pyx_INCREF(((PyObject*)__pyx_v_index)); __pyx_t_1 = __pyx_v_index; } else { __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 677, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_index); __Pyx_GIVEREF(__pyx_v_index); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index)) __PYX_ERR(13, 677, __pyx_L1_error); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } __pyx_v_tup = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "View.MemoryView":679 * tup = index if isinstance(index, tuple) else (index,) * * result = [slice(None)] * ndim # <<<<<<<<<<<<<< * have_slices = False * seen_ellipsis = False */ __pyx_t_1 = PyList_New(1 * ((__pyx_v_ndim<0) ? 0:__pyx_v_ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 679, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < __pyx_v_ndim; __pyx_temp++) { __Pyx_INCREF(__pyx_slice__5); __Pyx_GIVEREF(__pyx_slice__5); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, __pyx_temp, __pyx_slice__5)) __PYX_ERR(13, 679, __pyx_L1_error); } } __pyx_v_result = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "View.MemoryView":680 * * result = [slice(None)] * ndim * have_slices = False # <<<<<<<<<<<<<< * seen_ellipsis = False * idx = 0 */ __pyx_v_have_slices = 0; /* "View.MemoryView":681 * result = [slice(None)] * ndim * have_slices = False * seen_ellipsis = False # <<<<<<<<<<<<<< * idx = 0 * for item in tup: */ __pyx_v_seen_ellipsis = 0; /* "View.MemoryView":682 * have_slices = False * seen_ellipsis = False * idx = 0 # <<<<<<<<<<<<<< * for item in tup: * if item is Ellipsis: */ __pyx_v_idx = 0; /* "View.MemoryView":683 * seen_ellipsis = False * idx = 0 * for item in tup: # <<<<<<<<<<<<<< * if item is Ellipsis: * if not seen_ellipsis: */ if (unlikely(__pyx_v_tup == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(13, 683, __pyx_L1_error) } __pyx_t_1 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(13, 683, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(13, 683, __pyx_L1_error) #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 683, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_3); __pyx_t_3 = 0; /* "View.MemoryView":684 * idx = 0 * for item in tup: * if item is Ellipsis: # <<<<<<<<<<<<<< * if not seen_ellipsis: * idx += ndim - len(tup) */ __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis); if (__pyx_t_2) { /* "View.MemoryView":685 * for item in tup: * if item is Ellipsis: * if not seen_ellipsis: # <<<<<<<<<<<<<< * idx += ndim - len(tup) * seen_ellipsis = True */ __pyx_t_2 = (!__pyx_v_seen_ellipsis); if (__pyx_t_2) { /* "View.MemoryView":686 * if item is Ellipsis: * if not seen_ellipsis: * idx += ndim - len(tup) # <<<<<<<<<<<<<< * seen_ellipsis = True * have_slices = True */ if (unlikely(__pyx_v_tup == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(13, 686, __pyx_L1_error) } __pyx_t_5 = __Pyx_PyTuple_GET_SIZE(__pyx_v_tup); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(13, 686, __pyx_L1_error) __pyx_v_idx = (__pyx_v_idx + (__pyx_v_ndim - __pyx_t_5)); /* "View.MemoryView":687 * if not seen_ellipsis: * idx += ndim - len(tup) * seen_ellipsis = True # <<<<<<<<<<<<<< * have_slices = True * else: */ __pyx_v_seen_ellipsis = 1; /* "View.MemoryView":685 * for item in tup: * if item is Ellipsis: * if not seen_ellipsis: # <<<<<<<<<<<<<< * idx += ndim - len(tup) * seen_ellipsis = True */ } /* "View.MemoryView":688 * idx += ndim - len(tup) * seen_ellipsis = True * have_slices = True # <<<<<<<<<<<<<< * else: * if isinstance(item, slice): */ __pyx_v_have_slices = 1; /* "View.MemoryView":684 * idx = 0 * for item in tup: * if item is Ellipsis: # <<<<<<<<<<<<<< * if not seen_ellipsis: * idx += ndim - len(tup) */ goto __pyx_L5; } /* "View.MemoryView":690 * have_slices = True * else: * if isinstance(item, slice): # <<<<<<<<<<<<<< * have_slices = True * elif not PyIndex_Check(item): */ /*else*/ { __pyx_t_2 = PySlice_Check(__pyx_v_item); if (__pyx_t_2) { /* "View.MemoryView":691 * else: * if isinstance(item, slice): * have_slices = True # <<<<<<<<<<<<<< * elif not PyIndex_Check(item): * raise TypeError, f"Cannot index with type '{type(item)}'" */ __pyx_v_have_slices = 1; /* "View.MemoryView":690 * have_slices = True * else: * if isinstance(item, slice): # <<<<<<<<<<<<<< * have_slices = True * elif not PyIndex_Check(item): */ goto __pyx_L7; } /* "View.MemoryView":692 * if isinstance(item, slice): * have_slices = True * elif not PyIndex_Check(item): # <<<<<<<<<<<<<< * raise TypeError, f"Cannot index with type '{type(item)}'" * result[idx] = item */ __pyx_t_2 = (!(PyIndex_Check(__pyx_v_item) != 0)); if (unlikely(__pyx_t_2)) { /* "View.MemoryView":693 * have_slices = True * elif not PyIndex_Check(item): * raise TypeError, f"Cannot index with type '{type(item)}'" # <<<<<<<<<<<<<< * result[idx] = item * idx += 1 */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 693, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = 0; __pyx_t_6 = 127; __Pyx_INCREF(__pyx_kp_u_Cannot_index_with_type); __pyx_t_5 += 24; __Pyx_GIVEREF(__pyx_kp_u_Cannot_index_with_type); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_Cannot_index_with_type); __pyx_t_7 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_v_item)), __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(13, 693, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6; __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7); __pyx_t_7 = 0; __Pyx_INCREF(__pyx_kp_u__6); __pyx_t_5 += 1; __Pyx_GIVEREF(__pyx_kp_u__6); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u__6); __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(13, 693, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_builtin_TypeError, __pyx_t_7, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __PYX_ERR(13, 693, __pyx_L1_error) /* "View.MemoryView":692 * if isinstance(item, slice): * have_slices = True * elif not PyIndex_Check(item): # <<<<<<<<<<<<<< * raise TypeError, f"Cannot index with type '{type(item)}'" * result[idx] = item */ } __pyx_L7:; /* "View.MemoryView":694 * elif not PyIndex_Check(item): * raise TypeError, f"Cannot index with type '{type(item)}'" * result[idx] = item # <<<<<<<<<<<<<< * idx += 1 * */ if (unlikely((__Pyx_SetItemInt(__pyx_v_result, __pyx_v_idx, __pyx_v_item, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1) < 0))) __PYX_ERR(13, 694, __pyx_L1_error) } __pyx_L5:; /* "View.MemoryView":695 * raise TypeError, f"Cannot index with type '{type(item)}'" * result[idx] = item * idx += 1 # <<<<<<<<<<<<<< * * nslices = ndim - idx */ __pyx_v_idx = (__pyx_v_idx + 1); /* "View.MemoryView":683 * seen_ellipsis = False * idx = 0 * for item in tup: # <<<<<<<<<<<<<< * if item is Ellipsis: * if not seen_ellipsis: */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "View.MemoryView":697 * idx += 1 * * nslices = ndim - idx # <<<<<<<<<<<<<< * return have_slices or nslices, tuple(result) * */ __pyx_v_nslices = (__pyx_v_ndim - __pyx_v_idx); /* "View.MemoryView":698 * * nslices = ndim - idx * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<< * * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1: */ __Pyx_XDECREF(__pyx_r); if (!__pyx_v_have_slices) { } else { __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_7)) __PYX_ERR(13, 698, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_1 = __pyx_t_7; __pyx_t_7 = 0; goto __pyx_L9_bool_binop_done; } __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_7)) __PYX_ERR(13, 698, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_1 = __pyx_t_7; __pyx_t_7 = 0; __pyx_L9_bool_binop_done:; __pyx_t_7 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(13, 698, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 698, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(13, 698, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7)) __PYX_ERR(13, 698, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_7 = 0; __pyx_r = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; /* "View.MemoryView":671 * return isinstance(o, memoryview) * * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<< * """ * Replace all ellipses with full slices and fill incomplete indices with */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_tup); __Pyx_XDECREF(__pyx_v_result); __Pyx_XDECREF(__pyx_v_item); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":700 * return have_slices or nslices, tuple(result) * * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1: # <<<<<<<<<<<<<< * for suboffset in suboffsets[:ndim]: * if suboffset >= 0: */ static int assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) { Py_ssize_t __pyx_v_suboffset; int __pyx_r; Py_ssize_t *__pyx_t_1; Py_ssize_t *__pyx_t_2; Py_ssize_t *__pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "View.MemoryView":701 * * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1: * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<< * if suboffset >= 0: * raise ValueError, "Indirect dimensions not supported" */ __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim); for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) { __pyx_t_1 = __pyx_t_3; __pyx_v_suboffset = (__pyx_t_1[0]); /* "View.MemoryView":702 * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1: * for suboffset in suboffsets[:ndim]: * if suboffset >= 0: # <<<<<<<<<<<<<< * raise ValueError, "Indirect dimensions not supported" * return 0 # return type just used as an error flag */ __pyx_t_4 = (__pyx_v_suboffset >= 0); if (unlikely(__pyx_t_4)) { /* "View.MemoryView":703 * for suboffset in suboffsets[:ndim]: * if suboffset >= 0: * raise ValueError, "Indirect dimensions not supported" # <<<<<<<<<<<<<< * return 0 # return type just used as an error flag * */ __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_Indirect_dimensions_not_supporte, 0, 0); __PYX_ERR(13, 703, __pyx_L1_error) /* "View.MemoryView":702 * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1: * for suboffset in suboffsets[:ndim]: * if suboffset >= 0: # <<<<<<<<<<<<<< * raise ValueError, "Indirect dimensions not supported" * return 0 # return type just used as an error flag */ } } /* "View.MemoryView":704 * if suboffset >= 0: * raise ValueError, "Indirect dimensions not supported" * return 0 # return type just used as an error flag # <<<<<<<<<<<<<< * * */ __pyx_r = 0; goto __pyx_L0; /* "View.MemoryView":700 * return have_slices or nslices, tuple(result) * * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1: # <<<<<<<<<<<<<< * for suboffset in suboffsets[:ndim]: * if suboffset >= 0: */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "View.MemoryView":711 * * @cname('__pyx_memview_slice') * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<< * cdef int new_ndim = 0, suboffset_dim = -1, dim * cdef bint negative_step */ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) { int __pyx_v_new_ndim; int __pyx_v_suboffset_dim; int __pyx_v_dim; __Pyx_memviewslice __pyx_v_src; __Pyx_memviewslice __pyx_v_dst; __Pyx_memviewslice *__pyx_v_p_src; struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0; __Pyx_memviewslice *__pyx_v_p_dst; int *__pyx_v_p_suboffset_dim; Py_ssize_t __pyx_v_start; Py_ssize_t __pyx_v_stop; Py_ssize_t __pyx_v_step; Py_ssize_t __pyx_v_cindex; int __pyx_v_have_start; int __pyx_v_have_stop; int __pyx_v_have_step; PyObject *__pyx_v_index = NULL; struct __pyx_memoryview_obj *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; struct __pyx_memoryview_obj *__pyx_t_3; char *__pyx_t_4; int __pyx_t_5; Py_ssize_t __pyx_t_6; PyObject *(*__pyx_t_7)(PyObject *); PyObject *__pyx_t_8 = NULL; Py_ssize_t __pyx_t_9; int __pyx_t_10; Py_ssize_t __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("memview_slice", 1); /* "View.MemoryView":712 * @cname('__pyx_memview_slice') * cdef memoryview memview_slice(memoryview memview, object indices): * cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<< * cdef bint negative_step * cdef __Pyx_memviewslice src, dst */ __pyx_v_new_ndim = 0; __pyx_v_suboffset_dim = -1; /* "View.MemoryView":719 * * * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<< * * cdef _memoryviewslice memviewsliceobj */ (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst)))); /* "View.MemoryView":723 * cdef _memoryviewslice memviewsliceobj * * assert memview.view.ndim > 0 # <<<<<<<<<<<<<< * * if isinstance(memview, _memoryviewslice): */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_1 = (__pyx_v_memview->view.ndim > 0); if (unlikely(!__pyx_t_1)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(13, 723, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(13, 723, __pyx_L1_error) #endif /* "View.MemoryView":725 * assert memview.view.ndim > 0 * * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< * memviewsliceobj = memview * p_src = &memviewsliceobj.from_slice */ __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); if (__pyx_t_1) { /* "View.MemoryView":726 * * if isinstance(memview, _memoryviewslice): * memviewsliceobj = memview # <<<<<<<<<<<<<< * p_src = &memviewsliceobj.from_slice * else: */ if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(13, 726, __pyx_L1_error) __pyx_t_2 = ((PyObject *)__pyx_v_memview); __Pyx_INCREF(__pyx_t_2); __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2); __pyx_t_2 = 0; /* "View.MemoryView":727 * if isinstance(memview, _memoryviewslice): * memviewsliceobj = memview * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<< * else: * slice_copy(memview, &src) */ __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice); /* "View.MemoryView":725 * assert memview.view.ndim > 0 * * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< * memviewsliceobj = memview * p_src = &memviewsliceobj.from_slice */ goto __pyx_L3; } /* "View.MemoryView":729 * p_src = &memviewsliceobj.from_slice * else: * slice_copy(memview, &src) # <<<<<<<<<<<<<< * p_src = &src * */ /*else*/ { __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src)); /* "View.MemoryView":730 * else: * slice_copy(memview, &src) * p_src = &src # <<<<<<<<<<<<<< * * */ __pyx_v_p_src = (&__pyx_v_src); } __pyx_L3:; /* "View.MemoryView":736 * * * dst.memview = p_src.memview # <<<<<<<<<<<<<< * dst.data = p_src.data * */ __pyx_t_3 = __pyx_v_p_src->memview; __pyx_v_dst.memview = __pyx_t_3; /* "View.MemoryView":737 * * dst.memview = p_src.memview * dst.data = p_src.data # <<<<<<<<<<<<<< * * */ __pyx_t_4 = __pyx_v_p_src->data; __pyx_v_dst.data = __pyx_t_4; /* "View.MemoryView":742 * * * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<< * cdef int *p_suboffset_dim = &suboffset_dim * cdef Py_ssize_t start, stop, step, cindex */ __pyx_v_p_dst = (&__pyx_v_dst); /* "View.MemoryView":743 * * cdef __Pyx_memviewslice *p_dst = &dst * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<< * cdef Py_ssize_t start, stop, step, cindex * cdef bint have_start, have_stop, have_step */ __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim); /* "View.MemoryView":747 * cdef bint have_start, have_stop, have_step * * for dim, index in enumerate(indices): # <<<<<<<<<<<<<< * if PyIndex_Check(index): * cindex = index */ __pyx_t_5 = 0; if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) { __pyx_t_2 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 747, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(13, 747, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { if (likely(PyList_CheckExact(__pyx_t_2))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(13, 747, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_8 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(13, 747, __pyx_L1_error) #else __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(13, 747, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(13, 747, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(13, 747, __pyx_L1_error) #else __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(13, 747, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); #endif } } else { __pyx_t_8 = __pyx_t_7(__pyx_t_2); if (unlikely(!__pyx_t_8)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(13, 747, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_8); } __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_8); __pyx_t_8 = 0; __pyx_v_dim = __pyx_t_5; __pyx_t_5 = (__pyx_t_5 + 1); /* "View.MemoryView":748 * * for dim, index in enumerate(indices): * if PyIndex_Check(index): # <<<<<<<<<<<<<< * cindex = index * slice_memviewslice( */ __pyx_t_1 = (PyIndex_Check(__pyx_v_index) != 0); if (__pyx_t_1) { /* "View.MemoryView":749 * for dim, index in enumerate(indices): * if PyIndex_Check(index): * cindex = index # <<<<<<<<<<<<<< * slice_memviewslice( * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], */ __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(13, 749, __pyx_L1_error) __pyx_v_cindex = __pyx_t_9; /* "View.MemoryView":750 * if PyIndex_Check(index): * cindex = index * slice_memviewslice( # <<<<<<<<<<<<<< * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], * dim, new_ndim, p_suboffset_dim, */ __pyx_t_10 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_cindex, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(13, 750, __pyx_L1_error) /* "View.MemoryView":748 * * for dim, index in enumerate(indices): * if PyIndex_Check(index): # <<<<<<<<<<<<<< * cindex = index * slice_memviewslice( */ goto __pyx_L6; } /* "View.MemoryView":756 * 0, 0, 0, # have_{start,stop,step} * False) * elif index is None: # <<<<<<<<<<<<<< * p_dst.shape[new_ndim] = 1 * p_dst.strides[new_ndim] = 0 */ __pyx_t_1 = (__pyx_v_index == Py_None); if (__pyx_t_1) { /* "View.MemoryView":757 * False) * elif index is None: * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<< * p_dst.strides[new_ndim] = 0 * p_dst.suboffsets[new_ndim] = -1 */ (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1; /* "View.MemoryView":758 * elif index is None: * p_dst.shape[new_ndim] = 1 * p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<< * p_dst.suboffsets[new_ndim] = -1 * new_ndim += 1 */ (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0; /* "View.MemoryView":759 * p_dst.shape[new_ndim] = 1 * p_dst.strides[new_ndim] = 0 * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<< * new_ndim += 1 * else: */ (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L; /* "View.MemoryView":760 * p_dst.strides[new_ndim] = 0 * p_dst.suboffsets[new_ndim] = -1 * new_ndim += 1 # <<<<<<<<<<<<<< * else: * start = index.start or 0 */ __pyx_v_new_ndim = (__pyx_v_new_ndim + 1); /* "View.MemoryView":756 * 0, 0, 0, # have_{start,stop,step} * False) * elif index is None: # <<<<<<<<<<<<<< * p_dst.shape[new_ndim] = 1 * p_dst.strides[new_ndim] = 0 */ goto __pyx_L6; } /* "View.MemoryView":762 * new_ndim += 1 * else: * start = index.start or 0 # <<<<<<<<<<<<<< * stop = index.stop or 0 * step = index.step or 0 */ /*else*/ { __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_8)) __PYX_ERR(13, 762, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(13, 762, __pyx_L1_error) if (!__pyx_t_1) { __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else { __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(13, 762, __pyx_L1_error) __pyx_t_9 = __pyx_t_11; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L7_bool_binop_done; } __pyx_t_9 = 0; __pyx_L7_bool_binop_done:; __pyx_v_start = __pyx_t_9; /* "View.MemoryView":763 * else: * start = index.start or 0 * stop = index.stop or 0 # <<<<<<<<<<<<<< * step = index.step or 0 * */ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_8)) __PYX_ERR(13, 763, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(13, 763, __pyx_L1_error) if (!__pyx_t_1) { __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else { __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(13, 763, __pyx_L1_error) __pyx_t_9 = __pyx_t_11; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L9_bool_binop_done; } __pyx_t_9 = 0; __pyx_L9_bool_binop_done:; __pyx_v_stop = __pyx_t_9; /* "View.MemoryView":764 * start = index.start or 0 * stop = index.stop or 0 * step = index.step or 0 # <<<<<<<<<<<<<< * * have_start = index.start is not None */ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_8)) __PYX_ERR(13, 764, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(13, 764, __pyx_L1_error) if (!__pyx_t_1) { __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else { __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(13, 764, __pyx_L1_error) __pyx_t_9 = __pyx_t_11; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L11_bool_binop_done; } __pyx_t_9 = 0; __pyx_L11_bool_binop_done:; __pyx_v_step = __pyx_t_9; /* "View.MemoryView":766 * step = index.step or 0 * * have_start = index.start is not None # <<<<<<<<<<<<<< * have_stop = index.stop is not None * have_step = index.step is not None */ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_8)) __PYX_ERR(13, 766, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_1 = (__pyx_t_8 != Py_None); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v_have_start = __pyx_t_1; /* "View.MemoryView":767 * * have_start = index.start is not None * have_stop = index.stop is not None # <<<<<<<<<<<<<< * have_step = index.step is not None * */ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_8)) __PYX_ERR(13, 767, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_1 = (__pyx_t_8 != Py_None); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v_have_stop = __pyx_t_1; /* "View.MemoryView":768 * have_start = index.start is not None * have_stop = index.stop is not None * have_step = index.step is not None # <<<<<<<<<<<<<< * * slice_memviewslice( */ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_8)) __PYX_ERR(13, 768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_1 = (__pyx_t_8 != Py_None); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v_have_step = __pyx_t_1; /* "View.MemoryView":770 * have_step = index.step is not None * * slice_memviewslice( # <<<<<<<<<<<<<< * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], * dim, new_ndim, p_suboffset_dim, */ __pyx_t_10 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(13, 770, __pyx_L1_error) /* "View.MemoryView":776 * have_start, have_stop, have_step, * True) * new_ndim += 1 # <<<<<<<<<<<<<< * * if isinstance(memview, _memoryviewslice): */ __pyx_v_new_ndim = (__pyx_v_new_ndim + 1); } __pyx_L6:; /* "View.MemoryView":747 * cdef bint have_start, have_stop, have_step * * for dim, index in enumerate(indices): # <<<<<<<<<<<<<< * if PyIndex_Check(index): * cindex = index */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "View.MemoryView":778 * new_ndim += 1 * * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< * return memoryview_fromslice(dst, new_ndim, * memviewsliceobj.to_object_func, */ __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); if (__pyx_t_1) { /* "View.MemoryView":779 * * if isinstance(memview, _memoryviewslice): * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<< * memviewsliceobj.to_object_func, * memviewsliceobj.to_dtype_func, */ __Pyx_XDECREF((PyObject *)__pyx_r); /* "View.MemoryView":780 * if isinstance(memview, _memoryviewslice): * return memoryview_fromslice(dst, new_ndim, * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<< * memviewsliceobj.to_dtype_func, * memview.dtype_is_object) */ if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(13, 780, __pyx_L1_error) } /* "View.MemoryView":781 * return memoryview_fromslice(dst, new_ndim, * memviewsliceobj.to_object_func, * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<< * memview.dtype_is_object) * else: */ if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(13, 781, __pyx_L1_error) } /* "View.MemoryView":779 * * if isinstance(memview, _memoryviewslice): * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<< * memviewsliceobj.to_object_func, * memviewsliceobj.to_dtype_func, */ __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 779, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_memoryview_type))))) __PYX_ERR(13, 779, __pyx_L1_error) __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; /* "View.MemoryView":778 * new_ndim += 1 * * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< * return memoryview_fromslice(dst, new_ndim, * memviewsliceobj.to_object_func, */ } /* "View.MemoryView":784 * memview.dtype_is_object) * else: * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<< * memview.dtype_is_object) * */ /*else*/ { __Pyx_XDECREF((PyObject *)__pyx_r); /* "View.MemoryView":785 * else: * return memoryview_fromslice(dst, new_ndim, NULL, NULL, * memview.dtype_is_object) # <<<<<<<<<<<<<< * * */ __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 784, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "View.MemoryView":784 * memview.dtype_is_object) * else: * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<< * memview.dtype_is_object) * */ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_memoryview_type))))) __PYX_ERR(13, 784, __pyx_L1_error) __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; } /* "View.MemoryView":711 * * @cname('__pyx_memview_slice') * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<< * cdef int new_ndim = 0, suboffset_dim = -1, dim * cdef bint negative_step */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj); __Pyx_XDECREF(__pyx_v_index); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":793 * * @cname('__pyx_memoryview_slice_memviewslice') * cdef int slice_memviewslice( # <<<<<<<<<<<<<< * __Pyx_memviewslice *dst, * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset, */ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset, int __pyx_v_dim, int __pyx_v_new_ndim, int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step, int __pyx_v_have_start, int __pyx_v_have_stop, int __pyx_v_have_step, int __pyx_v_is_slice) { Py_ssize_t __pyx_v_new_shape; int __pyx_v_negative_step; int __pyx_r; int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save; #endif /* "View.MemoryView":813 * cdef bint negative_step * * if not is_slice: # <<<<<<<<<<<<<< * * if start < 0: */ __pyx_t_1 = (!__pyx_v_is_slice); if (__pyx_t_1) { /* "View.MemoryView":815 * if not is_slice: * * if start < 0: # <<<<<<<<<<<<<< * start += shape * if not 0 <= start < shape: */ __pyx_t_1 = (__pyx_v_start < 0); if (__pyx_t_1) { /* "View.MemoryView":816 * * if start < 0: * start += shape # <<<<<<<<<<<<<< * if not 0 <= start < shape: * _err_dim(PyExc_IndexError, "Index out of bounds (axis %d)", dim) */ __pyx_v_start = (__pyx_v_start + __pyx_v_shape); /* "View.MemoryView":815 * if not is_slice: * * if start < 0: # <<<<<<<<<<<<<< * start += shape * if not 0 <= start < shape: */ } /* "View.MemoryView":817 * if start < 0: * start += shape * if not 0 <= start < shape: # <<<<<<<<<<<<<< * _err_dim(PyExc_IndexError, "Index out of bounds (axis %d)", dim) * else: */ __pyx_t_1 = (0 <= __pyx_v_start); if (__pyx_t_1) { __pyx_t_1 = (__pyx_v_start < __pyx_v_shape); } __pyx_t_2 = (!__pyx_t_1); if (__pyx_t_2) { /* "View.MemoryView":818 * start += shape * if not 0 <= start < shape: * _err_dim(PyExc_IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<< * else: * */ __pyx_t_3 = __pyx_memoryview_err_dim(PyExc_IndexError, __pyx_kp_s_Index_out_of_bounds_axis_d, __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(13, 818, __pyx_L1_error) /* "View.MemoryView":817 * if start < 0: * start += shape * if not 0 <= start < shape: # <<<<<<<<<<<<<< * _err_dim(PyExc_IndexError, "Index out of bounds (axis %d)", dim) * else: */ } /* "View.MemoryView":813 * cdef bint negative_step * * if not is_slice: # <<<<<<<<<<<<<< * * if start < 0: */ goto __pyx_L3; } /* "View.MemoryView":821 * else: * * if have_step: # <<<<<<<<<<<<<< * negative_step = step < 0 * if step == 0: */ /*else*/ { __pyx_t_2 = (__pyx_v_have_step != 0); if (__pyx_t_2) { /* "View.MemoryView":822 * * if have_step: * negative_step = step < 0 # <<<<<<<<<<<<<< * if step == 0: * _err_dim(PyExc_ValueError, "Step may not be zero (axis %d)", dim) */ __pyx_v_negative_step = (__pyx_v_step < 0); /* "View.MemoryView":823 * if have_step: * negative_step = step < 0 * if step == 0: # <<<<<<<<<<<<<< * _err_dim(PyExc_ValueError, "Step may not be zero (axis %d)", dim) * else: */ __pyx_t_2 = (__pyx_v_step == 0); if (__pyx_t_2) { /* "View.MemoryView":824 * negative_step = step < 0 * if step == 0: * _err_dim(PyExc_ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<< * else: * negative_step = False */ __pyx_t_3 = __pyx_memoryview_err_dim(PyExc_ValueError, __pyx_kp_s_Step_may_not_be_zero_axis_d, __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(13, 824, __pyx_L1_error) /* "View.MemoryView":823 * if have_step: * negative_step = step < 0 * if step == 0: # <<<<<<<<<<<<<< * _err_dim(PyExc_ValueError, "Step may not be zero (axis %d)", dim) * else: */ } /* "View.MemoryView":821 * else: * * if have_step: # <<<<<<<<<<<<<< * negative_step = step < 0 * if step == 0: */ goto __pyx_L6; } /* "View.MemoryView":826 * _err_dim(PyExc_ValueError, "Step may not be zero (axis %d)", dim) * else: * negative_step = False # <<<<<<<<<<<<<< * step = 1 * */ /*else*/ { __pyx_v_negative_step = 0; /* "View.MemoryView":827 * else: * negative_step = False * step = 1 # <<<<<<<<<<<<<< * * */ __pyx_v_step = 1; } __pyx_L6:; /* "View.MemoryView":830 * * * if have_start: # <<<<<<<<<<<<<< * if start < 0: * start += shape */ __pyx_t_2 = (__pyx_v_have_start != 0); if (__pyx_t_2) { /* "View.MemoryView":831 * * if have_start: * if start < 0: # <<<<<<<<<<<<<< * start += shape * if start < 0: */ __pyx_t_2 = (__pyx_v_start < 0); if (__pyx_t_2) { /* "View.MemoryView":832 * if have_start: * if start < 0: * start += shape # <<<<<<<<<<<<<< * if start < 0: * start = 0 */ __pyx_v_start = (__pyx_v_start + __pyx_v_shape); /* "View.MemoryView":833 * if start < 0: * start += shape * if start < 0: # <<<<<<<<<<<<<< * start = 0 * elif start >= shape: */ __pyx_t_2 = (__pyx_v_start < 0); if (__pyx_t_2) { /* "View.MemoryView":834 * start += shape * if start < 0: * start = 0 # <<<<<<<<<<<<<< * elif start >= shape: * if negative_step: */ __pyx_v_start = 0; /* "View.MemoryView":833 * if start < 0: * start += shape * if start < 0: # <<<<<<<<<<<<<< * start = 0 * elif start >= shape: */ } /* "View.MemoryView":831 * * if have_start: * if start < 0: # <<<<<<<<<<<<<< * start += shape * if start < 0: */ goto __pyx_L9; } /* "View.MemoryView":835 * if start < 0: * start = 0 * elif start >= shape: # <<<<<<<<<<<<<< * if negative_step: * start = shape - 1 */ __pyx_t_2 = (__pyx_v_start >= __pyx_v_shape); if (__pyx_t_2) { /* "View.MemoryView":836 * start = 0 * elif start >= shape: * if negative_step: # <<<<<<<<<<<<<< * start = shape - 1 * else: */ if (__pyx_v_negative_step) { /* "View.MemoryView":837 * elif start >= shape: * if negative_step: * start = shape - 1 # <<<<<<<<<<<<<< * else: * start = shape */ __pyx_v_start = (__pyx_v_shape - 1); /* "View.MemoryView":836 * start = 0 * elif start >= shape: * if negative_step: # <<<<<<<<<<<<<< * start = shape - 1 * else: */ goto __pyx_L11; } /* "View.MemoryView":839 * start = shape - 1 * else: * start = shape # <<<<<<<<<<<<<< * else: * if negative_step: */ /*else*/ { __pyx_v_start = __pyx_v_shape; } __pyx_L11:; /* "View.MemoryView":835 * if start < 0: * start = 0 * elif start >= shape: # <<<<<<<<<<<<<< * if negative_step: * start = shape - 1 */ } __pyx_L9:; /* "View.MemoryView":830 * * * if have_start: # <<<<<<<<<<<<<< * if start < 0: * start += shape */ goto __pyx_L8; } /* "View.MemoryView":841 * start = shape * else: * if negative_step: # <<<<<<<<<<<<<< * start = shape - 1 * else: */ /*else*/ { if (__pyx_v_negative_step) { /* "View.MemoryView":842 * else: * if negative_step: * start = shape - 1 # <<<<<<<<<<<<<< * else: * start = 0 */ __pyx_v_start = (__pyx_v_shape - 1); /* "View.MemoryView":841 * start = shape * else: * if negative_step: # <<<<<<<<<<<<<< * start = shape - 1 * else: */ goto __pyx_L12; } /* "View.MemoryView":844 * start = shape - 1 * else: * start = 0 # <<<<<<<<<<<<<< * * if have_stop: */ /*else*/ { __pyx_v_start = 0; } __pyx_L12:; } __pyx_L8:; /* "View.MemoryView":846 * start = 0 * * if have_stop: # <<<<<<<<<<<<<< * if stop < 0: * stop += shape */ __pyx_t_2 = (__pyx_v_have_stop != 0); if (__pyx_t_2) { /* "View.MemoryView":847 * * if have_stop: * if stop < 0: # <<<<<<<<<<<<<< * stop += shape * if stop < 0: */ __pyx_t_2 = (__pyx_v_stop < 0); if (__pyx_t_2) { /* "View.MemoryView":848 * if have_stop: * if stop < 0: * stop += shape # <<<<<<<<<<<<<< * if stop < 0: * stop = 0 */ __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape); /* "View.MemoryView":849 * if stop < 0: * stop += shape * if stop < 0: # <<<<<<<<<<<<<< * stop = 0 * elif stop > shape: */ __pyx_t_2 = (__pyx_v_stop < 0); if (__pyx_t_2) { /* "View.MemoryView":850 * stop += shape * if stop < 0: * stop = 0 # <<<<<<<<<<<<<< * elif stop > shape: * stop = shape */ __pyx_v_stop = 0; /* "View.MemoryView":849 * if stop < 0: * stop += shape * if stop < 0: # <<<<<<<<<<<<<< * stop = 0 * elif stop > shape: */ } /* "View.MemoryView":847 * * if have_stop: * if stop < 0: # <<<<<<<<<<<<<< * stop += shape * if stop < 0: */ goto __pyx_L14; } /* "View.MemoryView":851 * if stop < 0: * stop = 0 * elif stop > shape: # <<<<<<<<<<<<<< * stop = shape * else: */ __pyx_t_2 = (__pyx_v_stop > __pyx_v_shape); if (__pyx_t_2) { /* "View.MemoryView":852 * stop = 0 * elif stop > shape: * stop = shape # <<<<<<<<<<<<<< * else: * if negative_step: */ __pyx_v_stop = __pyx_v_shape; /* "View.MemoryView":851 * if stop < 0: * stop = 0 * elif stop > shape: # <<<<<<<<<<<<<< * stop = shape * else: */ } __pyx_L14:; /* "View.MemoryView":846 * start = 0 * * if have_stop: # <<<<<<<<<<<<<< * if stop < 0: * stop += shape */ goto __pyx_L13; } /* "View.MemoryView":854 * stop = shape * else: * if negative_step: # <<<<<<<<<<<<<< * stop = -1 * else: */ /*else*/ { if (__pyx_v_negative_step) { /* "View.MemoryView":855 * else: * if negative_step: * stop = -1 # <<<<<<<<<<<<<< * else: * stop = shape */ __pyx_v_stop = -1L; /* "View.MemoryView":854 * stop = shape * else: * if negative_step: # <<<<<<<<<<<<<< * stop = -1 * else: */ goto __pyx_L16; } /* "View.MemoryView":857 * stop = -1 * else: * stop = shape # <<<<<<<<<<<<<< * * */ /*else*/ { __pyx_v_stop = __pyx_v_shape; } __pyx_L16:; } __pyx_L13:; /* "View.MemoryView":861 * * with cython.cdivision(True): * new_shape = (stop - start) // step # <<<<<<<<<<<<<< * * if (stop - start) - step * new_shape: */ __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step); /* "View.MemoryView":863 * new_shape = (stop - start) // step * * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<< * new_shape += 1 * */ __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0); if (__pyx_t_2) { /* "View.MemoryView":864 * * if (stop - start) - step * new_shape: * new_shape += 1 # <<<<<<<<<<<<<< * * if new_shape < 0: */ __pyx_v_new_shape = (__pyx_v_new_shape + 1); /* "View.MemoryView":863 * new_shape = (stop - start) // step * * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<< * new_shape += 1 * */ } /* "View.MemoryView":866 * new_shape += 1 * * if new_shape < 0: # <<<<<<<<<<<<<< * new_shape = 0 * */ __pyx_t_2 = (__pyx_v_new_shape < 0); if (__pyx_t_2) { /* "View.MemoryView":867 * * if new_shape < 0: * new_shape = 0 # <<<<<<<<<<<<<< * * */ __pyx_v_new_shape = 0; /* "View.MemoryView":866 * new_shape += 1 * * if new_shape < 0: # <<<<<<<<<<<<<< * new_shape = 0 * */ } /* "View.MemoryView":870 * * * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<< * dst.shape[new_ndim] = new_shape * dst.suboffsets[new_ndim] = suboffset */ (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step); /* "View.MemoryView":871 * * dst.strides[new_ndim] = stride * step * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<< * dst.suboffsets[new_ndim] = suboffset * */ (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape; /* "View.MemoryView":872 * dst.strides[new_ndim] = stride * step * dst.shape[new_ndim] = new_shape * dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<< * * */ (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset; } __pyx_L3:; /* "View.MemoryView":875 * * * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<< * dst.data += start * stride * else: */ __pyx_t_2 = ((__pyx_v_suboffset_dim[0]) < 0); if (__pyx_t_2) { /* "View.MemoryView":876 * * if suboffset_dim[0] < 0: * dst.data += start * stride # <<<<<<<<<<<<<< * else: * dst.suboffsets[suboffset_dim[0]] += start * stride */ __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride)); /* "View.MemoryView":875 * * * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<< * dst.data += start * stride * else: */ goto __pyx_L19; } /* "View.MemoryView":878 * dst.data += start * stride * else: * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<< * * if suboffset >= 0: */ /*else*/ { __pyx_t_3 = (__pyx_v_suboffset_dim[0]); (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride)); } __pyx_L19:; /* "View.MemoryView":880 * dst.suboffsets[suboffset_dim[0]] += start * stride * * if suboffset >= 0: # <<<<<<<<<<<<<< * if not is_slice: * if new_ndim == 0: */ __pyx_t_2 = (__pyx_v_suboffset >= 0); if (__pyx_t_2) { /* "View.MemoryView":881 * * if suboffset >= 0: * if not is_slice: # <<<<<<<<<<<<<< * if new_ndim == 0: * dst.data = ( dst.data)[0] + suboffset */ __pyx_t_2 = (!__pyx_v_is_slice); if (__pyx_t_2) { /* "View.MemoryView":882 * if suboffset >= 0: * if not is_slice: * if new_ndim == 0: # <<<<<<<<<<<<<< * dst.data = ( dst.data)[0] + suboffset * else: */ __pyx_t_2 = (__pyx_v_new_ndim == 0); if (__pyx_t_2) { /* "View.MemoryView":883 * if not is_slice: * if new_ndim == 0: * dst.data = ( dst.data)[0] + suboffset # <<<<<<<<<<<<<< * else: * _err_dim(PyExc_IndexError, "All dimensions preceding dimension %d " */ __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset); /* "View.MemoryView":882 * if suboffset >= 0: * if not is_slice: * if new_ndim == 0: # <<<<<<<<<<<<<< * dst.data = ( dst.data)[0] + suboffset * else: */ goto __pyx_L22; } /* "View.MemoryView":885 * dst.data = ( dst.data)[0] + suboffset * else: * _err_dim(PyExc_IndexError, "All dimensions preceding dimension %d " # <<<<<<<<<<<<<< * "must be indexed and not sliced", dim) * else: */ /*else*/ { /* "View.MemoryView":886 * else: * _err_dim(PyExc_IndexError, "All dimensions preceding dimension %d " * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<< * else: * suboffset_dim[0] = new_ndim */ __pyx_t_3 = __pyx_memoryview_err_dim(PyExc_IndexError, __pyx_kp_s_All_dimensions_preceding_dimensi, __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(13, 885, __pyx_L1_error) } __pyx_L22:; /* "View.MemoryView":881 * * if suboffset >= 0: * if not is_slice: # <<<<<<<<<<<<<< * if new_ndim == 0: * dst.data = ( dst.data)[0] + suboffset */ goto __pyx_L21; } /* "View.MemoryView":888 * "must be indexed and not sliced", dim) * else: * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<< * * return 0 */ /*else*/ { (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim; } __pyx_L21:; /* "View.MemoryView":880 * dst.suboffsets[suboffset_dim[0]] += start * stride * * if suboffset >= 0: # <<<<<<<<<<<<<< * if not is_slice: * if new_ndim == 0: */ } /* "View.MemoryView":890 * suboffset_dim[0] = new_ndim * * return 0 # <<<<<<<<<<<<<< * * */ __pyx_r = 0; goto __pyx_L0; /* "View.MemoryView":793 * * @cname('__pyx_memoryview_slice_memviewslice') * cdef int slice_memviewslice( # <<<<<<<<<<<<<< * __Pyx_memviewslice *dst, * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset, */ /* function exit code */ __pyx_L1_error:; #ifdef WITH_THREAD __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif __pyx_L0:; return __pyx_r; } /* "View.MemoryView":896 * * @cname('__pyx_pybuffer_index') * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<< * Py_ssize_t dim) except NULL: * cdef Py_ssize_t shape, stride, suboffset = -1 */ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) { Py_ssize_t __pyx_v_shape; Py_ssize_t __pyx_v_stride; Py_ssize_t __pyx_v_suboffset; Py_ssize_t __pyx_v_itemsize; char *__pyx_v_resultp; char *__pyx_r; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; Py_UCS4 __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pybuffer_index", 1); /* "View.MemoryView":898 * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, * Py_ssize_t dim) except NULL: * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<< * cdef Py_ssize_t itemsize = view.itemsize * cdef char *resultp */ __pyx_v_suboffset = -1L; /* "View.MemoryView":899 * Py_ssize_t dim) except NULL: * cdef Py_ssize_t shape, stride, suboffset = -1 * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<< * cdef char *resultp * */ __pyx_t_1 = __pyx_v_view->itemsize; __pyx_v_itemsize = __pyx_t_1; /* "View.MemoryView":902 * cdef char *resultp * * if view.ndim == 0: # <<<<<<<<<<<<<< * shape = view.len // itemsize * stride = itemsize */ __pyx_t_2 = (__pyx_v_view->ndim == 0); if (__pyx_t_2) { /* "View.MemoryView":903 * * if view.ndim == 0: * shape = view.len // itemsize # <<<<<<<<<<<<<< * stride = itemsize * else: */ if (unlikely(__pyx_v_itemsize == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); __PYX_ERR(13, 903, __pyx_L1_error) } else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) { PyErr_SetString(PyExc_OverflowError, "value too large to perform division"); __PYX_ERR(13, 903, __pyx_L1_error) } __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize); /* "View.MemoryView":904 * if view.ndim == 0: * shape = view.len // itemsize * stride = itemsize # <<<<<<<<<<<<<< * else: * shape = view.shape[dim] */ __pyx_v_stride = __pyx_v_itemsize; /* "View.MemoryView":902 * cdef char *resultp * * if view.ndim == 0: # <<<<<<<<<<<<<< * shape = view.len // itemsize * stride = itemsize */ goto __pyx_L3; } /* "View.MemoryView":906 * stride = itemsize * else: * shape = view.shape[dim] # <<<<<<<<<<<<<< * stride = view.strides[dim] * if view.suboffsets != NULL: */ /*else*/ { __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]); /* "View.MemoryView":907 * else: * shape = view.shape[dim] * stride = view.strides[dim] # <<<<<<<<<<<<<< * if view.suboffsets != NULL: * suboffset = view.suboffsets[dim] */ __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]); /* "View.MemoryView":908 * shape = view.shape[dim] * stride = view.strides[dim] * if view.suboffsets != NULL: # <<<<<<<<<<<<<< * suboffset = view.suboffsets[dim] * */ __pyx_t_2 = (__pyx_v_view->suboffsets != NULL); if (__pyx_t_2) { /* "View.MemoryView":909 * stride = view.strides[dim] * if view.suboffsets != NULL: * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<< * * if index < 0: */ __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]); /* "View.MemoryView":908 * shape = view.shape[dim] * stride = view.strides[dim] * if view.suboffsets != NULL: # <<<<<<<<<<<<<< * suboffset = view.suboffsets[dim] * */ } } __pyx_L3:; /* "View.MemoryView":911 * suboffset = view.suboffsets[dim] * * if index < 0: # <<<<<<<<<<<<<< * index += view.shape[dim] * if index < 0: */ __pyx_t_2 = (__pyx_v_index < 0); if (__pyx_t_2) { /* "View.MemoryView":912 * * if index < 0: * index += view.shape[dim] # <<<<<<<<<<<<<< * if index < 0: * raise IndexError, f"Out of bounds on buffer access (axis {dim})" */ __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim])); /* "View.MemoryView":913 * if index < 0: * index += view.shape[dim] * if index < 0: # <<<<<<<<<<<<<< * raise IndexError, f"Out of bounds on buffer access (axis {dim})" * */ __pyx_t_2 = (__pyx_v_index < 0); if (unlikely(__pyx_t_2)) { /* "View.MemoryView":914 * index += view.shape[dim] * if index < 0: * raise IndexError, f"Out of bounds on buffer access (axis {dim})" # <<<<<<<<<<<<<< * * if index >= shape: */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = 0; __pyx_t_4 = 127; __Pyx_INCREF(__pyx_kp_u_Out_of_bounds_on_buffer_access_a); __pyx_t_1 += 37; __Pyx_GIVEREF(__pyx_kp_u_Out_of_bounds_on_buffer_access_a); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_Out_of_bounds_on_buffer_access_a); __pyx_t_5 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_dim, 0, ' ', 'd'); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5); __pyx_t_5 = 0; __Pyx_INCREF(__pyx_kp_u__7); __pyx_t_1 += 1; __Pyx_GIVEREF(__pyx_kp_u__7); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u__7); __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_builtin_IndexError, __pyx_t_5, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(13, 914, __pyx_L1_error) /* "View.MemoryView":913 * if index < 0: * index += view.shape[dim] * if index < 0: # <<<<<<<<<<<<<< * raise IndexError, f"Out of bounds on buffer access (axis {dim})" * */ } /* "View.MemoryView":911 * suboffset = view.suboffsets[dim] * * if index < 0: # <<<<<<<<<<<<<< * index += view.shape[dim] * if index < 0: */ } /* "View.MemoryView":916 * raise IndexError, f"Out of bounds on buffer access (axis {dim})" * * if index >= shape: # <<<<<<<<<<<<<< * raise IndexError, f"Out of bounds on buffer access (axis {dim})" * */ __pyx_t_2 = (__pyx_v_index >= __pyx_v_shape); if (unlikely(__pyx_t_2)) { /* "View.MemoryView":917 * * if index >= shape: * raise IndexError, f"Out of bounds on buffer access (axis {dim})" # <<<<<<<<<<<<<< * * resultp = bufp + index * stride */ __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 917, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = 0; __pyx_t_4 = 127; __Pyx_INCREF(__pyx_kp_u_Out_of_bounds_on_buffer_access_a); __pyx_t_1 += 37; __Pyx_GIVEREF(__pyx_kp_u_Out_of_bounds_on_buffer_access_a); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_u_Out_of_bounds_on_buffer_access_a); __pyx_t_3 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_dim, 0, ' ', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 917, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3); __pyx_t_3 = 0; __Pyx_INCREF(__pyx_kp_u__7); __pyx_t_1 += 1; __Pyx_GIVEREF(__pyx_kp_u__7); PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_kp_u__7); __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_5, 3, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 917, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_builtin_IndexError, __pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(13, 917, __pyx_L1_error) /* "View.MemoryView":916 * raise IndexError, f"Out of bounds on buffer access (axis {dim})" * * if index >= shape: # <<<<<<<<<<<<<< * raise IndexError, f"Out of bounds on buffer access (axis {dim})" * */ } /* "View.MemoryView":919 * raise IndexError, f"Out of bounds on buffer access (axis {dim})" * * resultp = bufp + index * stride # <<<<<<<<<<<<<< * if suboffset >= 0: * resultp = ( resultp)[0] + suboffset */ __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride)); /* "View.MemoryView":920 * * resultp = bufp + index * stride * if suboffset >= 0: # <<<<<<<<<<<<<< * resultp = ( resultp)[0] + suboffset * */ __pyx_t_2 = (__pyx_v_suboffset >= 0); if (__pyx_t_2) { /* "View.MemoryView":921 * resultp = bufp + index * stride * if suboffset >= 0: * resultp = ( resultp)[0] + suboffset # <<<<<<<<<<<<<< * * return resultp */ __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset); /* "View.MemoryView":920 * * resultp = bufp + index * stride * if suboffset >= 0: # <<<<<<<<<<<<<< * resultp = ( resultp)[0] + suboffset * */ } /* "View.MemoryView":923 * resultp = ( resultp)[0] + suboffset * * return resultp # <<<<<<<<<<<<<< * * */ __pyx_r = __pyx_v_resultp; goto __pyx_L0; /* "View.MemoryView":896 * * @cname('__pyx_pybuffer_index') * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<< * Py_ssize_t dim) except NULL: * cdef Py_ssize_t shape, stride, suboffset = -1 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":929 * * @cname('__pyx_memslice_transpose') * cdef int transpose_memslice(__Pyx_memviewslice *memslice) except -1 nogil: # <<<<<<<<<<<<<< * cdef int ndim = memslice.memview.view.ndim * */ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { int __pyx_v_ndim; Py_ssize_t *__pyx_v_shape; Py_ssize_t *__pyx_v_strides; int __pyx_v_i; int __pyx_v_j; int __pyx_r; int __pyx_t_1; Py_ssize_t *__pyx_t_2; long __pyx_t_3; long __pyx_t_4; Py_ssize_t __pyx_t_5; Py_ssize_t __pyx_t_6; int __pyx_t_7; int __pyx_t_8; int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save; #endif /* "View.MemoryView":930 * @cname('__pyx_memslice_transpose') * cdef int transpose_memslice(__Pyx_memviewslice *memslice) except -1 nogil: * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<< * * cdef Py_ssize_t *shape = memslice.shape */ __pyx_t_1 = __pyx_v_memslice->memview->view.ndim; __pyx_v_ndim = __pyx_t_1; /* "View.MemoryView":932 * cdef int ndim = memslice.memview.view.ndim * * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<< * cdef Py_ssize_t *strides = memslice.strides * */ __pyx_t_2 = __pyx_v_memslice->shape; __pyx_v_shape = __pyx_t_2; /* "View.MemoryView":933 * * cdef Py_ssize_t *shape = memslice.shape * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<< * * */ __pyx_t_2 = __pyx_v_memslice->strides; __pyx_v_strides = __pyx_t_2; /* "View.MemoryView":937 * * cdef int i, j * for i in range(ndim // 2): # <<<<<<<<<<<<<< * j = ndim - 1 - i * strides[i], strides[j] = strides[j], strides[i] */ __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2); __pyx_t_4 = __pyx_t_3; for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; /* "View.MemoryView":938 * cdef int i, j * for i in range(ndim // 2): * j = ndim - 1 - i # <<<<<<<<<<<<<< * strides[i], strides[j] = strides[j], strides[i] * shape[i], shape[j] = shape[j], shape[i] */ __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i); /* "View.MemoryView":939 * for i in range(ndim // 2): * j = ndim - 1 - i * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<< * shape[i], shape[j] = shape[j], shape[i] * */ __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]); __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]); (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5; (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6; /* "View.MemoryView":940 * j = ndim - 1 - i * strides[i], strides[j] = strides[j], strides[i] * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<< * * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: */ __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]); __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]); (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6; (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5; /* "View.MemoryView":942 * shape[i], shape[j] = shape[j], shape[i] * * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<< * _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions") * */ __pyx_t_8 = ((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0); if (!__pyx_t_8) { } else { __pyx_t_7 = __pyx_t_8; goto __pyx_L6_bool_binop_done; } __pyx_t_8 = ((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0); __pyx_t_7 = __pyx_t_8; __pyx_L6_bool_binop_done:; if (__pyx_t_7) { /* "View.MemoryView":943 * * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: * _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<< * * return 0 */ __pyx_t_9 = __pyx_memoryview_err(PyExc_ValueError, __pyx_kp_s_Cannot_transpose_memoryview_with); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(13, 943, __pyx_L1_error) /* "View.MemoryView":942 * shape[i], shape[j] = shape[j], shape[i] * * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<< * _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions") * */ } } /* "View.MemoryView":945 * _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions") * * return 0 # <<<<<<<<<<<<<< * * */ __pyx_r = 0; goto __pyx_L0; /* "View.MemoryView":929 * * @cname('__pyx_memslice_transpose') * cdef int transpose_memslice(__Pyx_memviewslice *memslice) except -1 nogil: # <<<<<<<<<<<<<< * cdef int ndim = memslice.memview.view.ndim * */ /* function exit code */ __pyx_L1_error:; #ifdef WITH_THREAD __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif __pyx_L0:; return __pyx_r; } /* "View.MemoryView":963 * cdef int (*to_dtype_func)(char *, object) except 0 * * def __dealloc__(self): # <<<<<<<<<<<<<< * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1) * */ /* Python wrapper */ static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) { /* "View.MemoryView":964 * * def __dealloc__(self): * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<< * * cdef convert_item_to_object(self, char *itemp): */ __PYX_XCLEAR_MEMVIEW((&__pyx_v_self->from_slice), 1); /* "View.MemoryView":963 * cdef int (*to_dtype_func)(char *, object) except 0 * * def __dealloc__(self): # <<<<<<<<<<<<<< * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1) * */ /* function exit code */ } /* "View.MemoryView":966 * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1) * * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< * if self.to_object_func != NULL: * return self.to_object_func(itemp) */ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("convert_item_to_object", 1); /* "View.MemoryView":967 * * cdef convert_item_to_object(self, char *itemp): * if self.to_object_func != NULL: # <<<<<<<<<<<<<< * return self.to_object_func(itemp) * else: */ __pyx_t_1 = (__pyx_v_self->to_object_func != NULL); if (__pyx_t_1) { /* "View.MemoryView":968 * cdef convert_item_to_object(self, char *itemp): * if self.to_object_func != NULL: * return self.to_object_func(itemp) # <<<<<<<<<<<<<< * else: * return memoryview.convert_item_to_object(self, itemp) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 968, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "View.MemoryView":967 * * cdef convert_item_to_object(self, char *itemp): * if self.to_object_func != NULL: # <<<<<<<<<<<<<< * return self.to_object_func(itemp) * else: */ } /* "View.MemoryView":970 * return self.to_object_func(itemp) * else: * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<< * * cdef assign_item_from_object(self, char *itemp, object value): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 970, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; } /* "View.MemoryView":966 * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1) * * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< * if self.to_object_func != NULL: * return self.to_object_func(itemp) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":972 * return memoryview.convert_item_to_object(self, itemp) * * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< * if self.to_dtype_func != NULL: * self.to_dtype_func(itemp, value) */ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("assign_item_from_object", 1); /* "View.MemoryView":973 * * cdef assign_item_from_object(self, char *itemp, object value): * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<< * self.to_dtype_func(itemp, value) * else: */ __pyx_t_1 = (__pyx_v_self->to_dtype_func != NULL); if (__pyx_t_1) { /* "View.MemoryView":974 * cdef assign_item_from_object(self, char *itemp, object value): * if self.to_dtype_func != NULL: * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<< * else: * memoryview.assign_item_from_object(self, itemp, value) */ __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(13, 974, __pyx_L1_error) /* "View.MemoryView":973 * * cdef assign_item_from_object(self, char *itemp, object value): * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<< * self.to_dtype_func(itemp, value) * else: */ goto __pyx_L3; } /* "View.MemoryView":976 * self.to_dtype_func(itemp, value) * else: * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<< * * cdef _get_base(self): */ /*else*/ { __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 976, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_L3:; /* "View.MemoryView":972 * return memoryview.convert_item_to_object(self, itemp) * * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< * if self.to_dtype_func != NULL: * self.to_dtype_func(itemp, value) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":978 * memoryview.assign_item_from_object(self, itemp, value) * * cdef _get_base(self): # <<<<<<<<<<<<<< * return self.from_object * */ static PyObject *__pyx_memoryviewslice__get_base(struct __pyx_memoryviewslice_obj *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_get_base", 1); /* "View.MemoryView":979 * * cdef _get_base(self): * return self.from_object # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->from_object); __pyx_r = __pyx_v_self->from_object; goto __pyx_L0; /* "View.MemoryView":978 * memoryview.assign_item_from_object(self, itemp, value) * * cdef _get_base(self): # <<<<<<<<<<<<<< * return self.from_object * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(13, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* Python wrapper */ static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(13, 3, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(13, 3, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v___pyx_state = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(13, 3, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":4 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(13, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":999 * * @cname('__pyx_memoryview_fromslice') * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<< * int ndim, * object (*to_object_func)(char *), */ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice, int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(char *), int (*__pyx_v_to_dtype_func)(char *, PyObject *), int __pyx_v_dtype_is_object) { struct __pyx_memoryviewslice_obj *__pyx_v_result = 0; Py_ssize_t __pyx_v_suboffset; PyObject *__pyx_v_length = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; __Pyx_TypeInfo *__pyx_t_4; Py_buffer __pyx_t_5; Py_ssize_t *__pyx_t_6; Py_ssize_t *__pyx_t_7; Py_ssize_t *__pyx_t_8; Py_ssize_t __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("memoryview_fromslice", 1); /* "View.MemoryView":1007 * cdef _memoryviewslice result * * if memviewslice.memview == Py_None: # <<<<<<<<<<<<<< * return None * */ __pyx_t_1 = (((PyObject *)__pyx_v_memviewslice.memview) == Py_None); if (__pyx_t_1) { /* "View.MemoryView":1008 * * if memviewslice.memview == Py_None: * return None # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "View.MemoryView":1007 * cdef _memoryviewslice result * * if memviewslice.memview == Py_None: # <<<<<<<<<<<<<< * return None * */ } /* "View.MemoryView":1013 * * * result = _memoryviewslice.__new__(_memoryviewslice, None, 0, dtype_is_object) # <<<<<<<<<<<<<< * * result.from_slice = memviewslice */ __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 1013, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 1013, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None)) __PYX_ERR(13, 1013, __pyx_L1_error); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0)) __PYX_ERR(13, 1013, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2)) __PYX_ERR(13, 1013, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_2 = ((PyObject *)__pyx_tp_new__memoryviewslice(((PyTypeObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 1013, __pyx_L1_error) __Pyx_GOTREF((PyObject *)__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2); __pyx_t_2 = 0; /* "View.MemoryView":1015 * result = _memoryviewslice.__new__(_memoryviewslice, None, 0, dtype_is_object) * * result.from_slice = memviewslice # <<<<<<<<<<<<<< * __PYX_INC_MEMVIEW(&memviewslice, 1) * */ __pyx_v_result->from_slice = __pyx_v_memviewslice; /* "View.MemoryView":1016 * * result.from_slice = memviewslice * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<< * * result.from_object = ( memviewslice.memview)._get_base() */ __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1); /* "View.MemoryView":1018 * __PYX_INC_MEMVIEW(&memviewslice, 1) * * result.from_object = ( memviewslice.memview)._get_base() # <<<<<<<<<<<<<< * result.typeinfo = memviewslice.memview.typeinfo * */ __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->__pyx_vtab)->_get_base(((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 1018, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_result->from_object); __Pyx_DECREF(__pyx_v_result->from_object); __pyx_v_result->from_object = __pyx_t_2; __pyx_t_2 = 0; /* "View.MemoryView":1019 * * result.from_object = ( memviewslice.memview)._get_base() * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<< * * result.view = memviewslice.memview.view */ __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo; __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4; /* "View.MemoryView":1021 * result.typeinfo = memviewslice.memview.typeinfo * * result.view = memviewslice.memview.view # <<<<<<<<<<<<<< * result.view.buf = memviewslice.data * result.view.ndim = ndim */ __pyx_t_5 = __pyx_v_memviewslice.memview->view; __pyx_v_result->__pyx_base.view = __pyx_t_5; /* "View.MemoryView":1022 * * result.view = memviewslice.memview.view * result.view.buf = memviewslice.data # <<<<<<<<<<<<<< * result.view.ndim = ndim * (<__pyx_buffer *> &result.view).obj = Py_None */ __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data); /* "View.MemoryView":1023 * result.view = memviewslice.memview.view * result.view.buf = memviewslice.data * result.view.ndim = ndim # <<<<<<<<<<<<<< * (<__pyx_buffer *> &result.view).obj = Py_None * Py_INCREF(Py_None) */ __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim; /* "View.MemoryView":1024 * result.view.buf = memviewslice.data * result.view.ndim = ndim * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<< * Py_INCREF(Py_None) * */ ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None; /* "View.MemoryView":1025 * result.view.ndim = ndim * (<__pyx_buffer *> &result.view).obj = Py_None * Py_INCREF(Py_None) # <<<<<<<<<<<<<< * * if (memviewslice.memview).flags & PyBUF_WRITABLE: */ Py_INCREF(Py_None); /* "View.MemoryView":1027 * Py_INCREF(Py_None) * * if (memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<< * result.flags = PyBUF_RECORDS * else: */ __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0); if (__pyx_t_1) { /* "View.MemoryView":1028 * * if (memviewslice.memview).flags & PyBUF_WRITABLE: * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<< * else: * result.flags = PyBUF_RECORDS_RO */ __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS; /* "View.MemoryView":1027 * Py_INCREF(Py_None) * * if (memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<< * result.flags = PyBUF_RECORDS * else: */ goto __pyx_L4; } /* "View.MemoryView":1030 * result.flags = PyBUF_RECORDS * else: * result.flags = PyBUF_RECORDS_RO # <<<<<<<<<<<<<< * * result.view.shape = result.from_slice.shape */ /*else*/ { __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO; } __pyx_L4:; /* "View.MemoryView":1032 * result.flags = PyBUF_RECORDS_RO * * result.view.shape = result.from_slice.shape # <<<<<<<<<<<<<< * result.view.strides = result.from_slice.strides * */ __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape); /* "View.MemoryView":1033 * * result.view.shape = result.from_slice.shape * result.view.strides = result.from_slice.strides # <<<<<<<<<<<<<< * * */ __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides); /* "View.MemoryView":1036 * * * result.view.suboffsets = NULL # <<<<<<<<<<<<<< * for suboffset in result.from_slice.suboffsets[:ndim]: * if suboffset >= 0: */ __pyx_v_result->__pyx_base.view.suboffsets = NULL; /* "View.MemoryView":1037 * * result.view.suboffsets = NULL * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<< * if suboffset >= 0: * result.view.suboffsets = result.from_slice.suboffsets */ __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim); for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) { __pyx_t_6 = __pyx_t_8; __pyx_v_suboffset = (__pyx_t_6[0]); /* "View.MemoryView":1038 * result.view.suboffsets = NULL * for suboffset in result.from_slice.suboffsets[:ndim]: * if suboffset >= 0: # <<<<<<<<<<<<<< * result.view.suboffsets = result.from_slice.suboffsets * break */ __pyx_t_1 = (__pyx_v_suboffset >= 0); if (__pyx_t_1) { /* "View.MemoryView":1039 * for suboffset in result.from_slice.suboffsets[:ndim]: * if suboffset >= 0: * result.view.suboffsets = result.from_slice.suboffsets # <<<<<<<<<<<<<< * break * */ __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets); /* "View.MemoryView":1040 * if suboffset >= 0: * result.view.suboffsets = result.from_slice.suboffsets * break # <<<<<<<<<<<<<< * * result.view.len = result.view.itemsize */ goto __pyx_L6_break; /* "View.MemoryView":1038 * result.view.suboffsets = NULL * for suboffset in result.from_slice.suboffsets[:ndim]: * if suboffset >= 0: # <<<<<<<<<<<<<< * result.view.suboffsets = result.from_slice.suboffsets * break */ } } __pyx_L6_break:; /* "View.MemoryView":1042 * break * * result.view.len = result.view.itemsize # <<<<<<<<<<<<<< * for length in result.view.shape[:ndim]: * result.view.len *= length */ __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize; __pyx_v_result->__pyx_base.view.len = __pyx_t_9; /* "View.MemoryView":1043 * * result.view.len = result.view.itemsize * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<< * result.view.len *= length * */ __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim); for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) { __pyx_t_6 = __pyx_t_8; __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 1043, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2); __pyx_t_2 = 0; /* "View.MemoryView":1044 * result.view.len = result.view.itemsize * for length in result.view.shape[:ndim]: * result.view.len *= length # <<<<<<<<<<<<<< * * result.to_object_func = to_object_func */ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 1044, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 1044, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(13, 1044, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_result->__pyx_base.view.len = __pyx_t_9; } /* "View.MemoryView":1046 * result.view.len *= length * * result.to_object_func = to_object_func # <<<<<<<<<<<<<< * result.to_dtype_func = to_dtype_func * */ __pyx_v_result->to_object_func = __pyx_v_to_object_func; /* "View.MemoryView":1047 * * result.to_object_func = to_object_func * result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<< * * return result */ __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func; /* "View.MemoryView":1049 * result.to_dtype_func = to_dtype_func * * return result # <<<<<<<<<<<<<< * * @cname('__pyx_memoryview_get_slice_from_memoryview') */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_result); __pyx_r = ((PyObject *)__pyx_v_result); goto __pyx_L0; /* "View.MemoryView":999 * * @cname('__pyx_memoryview_fromslice') * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<< * int ndim, * object (*to_object_func)(char *), */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_result); __Pyx_XDECREF(__pyx_v_length); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":1052 * * @cname('__pyx_memoryview_get_slice_from_memoryview') * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<< * __Pyx_memviewslice *mslice) except NULL: * cdef _memoryviewslice obj */ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) { struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0; __Pyx_memviewslice *__pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_slice_from_memview", 1); /* "View.MemoryView":1055 * __Pyx_memviewslice *mslice) except NULL: * cdef _memoryviewslice obj * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< * obj = memview * return &obj.from_slice */ __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); if (__pyx_t_1) { /* "View.MemoryView":1056 * cdef _memoryviewslice obj * if isinstance(memview, _memoryviewslice): * obj = memview # <<<<<<<<<<<<<< * return &obj.from_slice * else: */ if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(13, 1056, __pyx_L1_error) __pyx_t_2 = ((PyObject *)__pyx_v_memview); __Pyx_INCREF(__pyx_t_2); __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2); __pyx_t_2 = 0; /* "View.MemoryView":1057 * if isinstance(memview, _memoryviewslice): * obj = memview * return &obj.from_slice # <<<<<<<<<<<<<< * else: * slice_copy(memview, mslice) */ __pyx_r = (&__pyx_v_obj->from_slice); goto __pyx_L0; /* "View.MemoryView":1055 * __Pyx_memviewslice *mslice) except NULL: * cdef _memoryviewslice obj * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< * obj = memview * return &obj.from_slice */ } /* "View.MemoryView":1059 * return &obj.from_slice * else: * slice_copy(memview, mslice) # <<<<<<<<<<<<<< * return mslice * */ /*else*/ { __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice); /* "View.MemoryView":1060 * else: * slice_copy(memview, mslice) * return mslice # <<<<<<<<<<<<<< * * @cname('__pyx_memoryview_slice_copy') */ __pyx_r = __pyx_v_mslice; goto __pyx_L0; } /* "View.MemoryView":1052 * * @cname('__pyx_memoryview_get_slice_from_memoryview') * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<< * __Pyx_memviewslice *mslice) except NULL: * cdef _memoryviewslice obj */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_obj); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":1063 * * @cname('__pyx_memoryview_slice_copy') * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst) noexcept: # <<<<<<<<<<<<<< * cdef int dim * cdef (Py_ssize_t*) shape, strides, suboffsets */ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) { int __pyx_v_dim; Py_ssize_t *__pyx_v_shape; Py_ssize_t *__pyx_v_strides; Py_ssize_t *__pyx_v_suboffsets; Py_ssize_t *__pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; Py_ssize_t __pyx_t_5; int __pyx_t_6; /* "View.MemoryView":1067 * cdef (Py_ssize_t*) shape, strides, suboffsets * * shape = memview.view.shape # <<<<<<<<<<<<<< * strides = memview.view.strides * suboffsets = memview.view.suboffsets */ __pyx_t_1 = __pyx_v_memview->view.shape; __pyx_v_shape = __pyx_t_1; /* "View.MemoryView":1068 * * shape = memview.view.shape * strides = memview.view.strides # <<<<<<<<<<<<<< * suboffsets = memview.view.suboffsets * */ __pyx_t_1 = __pyx_v_memview->view.strides; __pyx_v_strides = __pyx_t_1; /* "View.MemoryView":1069 * shape = memview.view.shape * strides = memview.view.strides * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<< * * dst.memview = <__pyx_memoryview *> memview */ __pyx_t_1 = __pyx_v_memview->view.suboffsets; __pyx_v_suboffsets = __pyx_t_1; /* "View.MemoryView":1071 * suboffsets = memview.view.suboffsets * * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<< * dst.data = memview.view.buf * */ __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview); /* "View.MemoryView":1072 * * dst.memview = <__pyx_memoryview *> memview * dst.data = memview.view.buf # <<<<<<<<<<<<<< * * for dim in range(memview.view.ndim): */ __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf); /* "View.MemoryView":1074 * dst.data = memview.view.buf * * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<< * dst.shape[dim] = shape[dim] * dst.strides[dim] = strides[dim] */ __pyx_t_2 = __pyx_v_memview->view.ndim; __pyx_t_3 = __pyx_t_2; for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_dim = __pyx_t_4; /* "View.MemoryView":1075 * * for dim in range(memview.view.ndim): * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<< * dst.strides[dim] = strides[dim] * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 */ (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]); /* "View.MemoryView":1076 * for dim in range(memview.view.ndim): * dst.shape[dim] = shape[dim] * dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<< * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 * */ (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]); /* "View.MemoryView":1077 * dst.shape[dim] = shape[dim] * dst.strides[dim] = strides[dim] * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<< * * @cname('__pyx_memoryview_copy_object') */ __pyx_t_6 = (__pyx_v_suboffsets != 0); if (__pyx_t_6) { __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]); } else { __pyx_t_5 = -1L; } (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5; } /* "View.MemoryView":1063 * * @cname('__pyx_memoryview_slice_copy') * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst) noexcept: # <<<<<<<<<<<<<< * cdef int dim * cdef (Py_ssize_t*) shape, strides, suboffsets */ /* function exit code */ } /* "View.MemoryView":1080 * * @cname('__pyx_memoryview_copy_object') * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<< * "Create a new memoryview object" * cdef __Pyx_memviewslice memviewslice */ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) { __Pyx_memviewslice __pyx_v_memviewslice; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("memoryview_copy", 1); /* "View.MemoryView":1083 * "Create a new memoryview object" * cdef __Pyx_memviewslice memviewslice * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<< * return memoryview_copy_from_slice(memview, &memviewslice) * */ __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice)); /* "View.MemoryView":1084 * cdef __Pyx_memviewslice memviewslice * slice_copy(memview, &memviewslice) * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<< * * @cname('__pyx_memoryview_copy_object_from_slice') */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 1084, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "View.MemoryView":1080 * * @cname('__pyx_memoryview_copy_object') * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<< * "Create a new memoryview object" * cdef __Pyx_memviewslice memviewslice */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":1087 * * @cname('__pyx_memoryview_copy_object_from_slice') * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<< * """ * Create a new memoryview object from a given memoryview object and slice. */ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) { PyObject *(*__pyx_v_to_object_func)(char *); int (*__pyx_v_to_dtype_func)(char *, PyObject *); PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *(*__pyx_t_2)(char *); int (*__pyx_t_3)(char *, PyObject *); PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 1); /* "View.MemoryView":1094 * cdef int (*to_dtype_func)(char *, object) except 0 * * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< * to_object_func = (<_memoryviewslice> memview).to_object_func * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func */ __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); if (__pyx_t_1) { /* "View.MemoryView":1095 * * if isinstance(memview, _memoryviewslice): * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<< * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func * else: */ __pyx_t_2 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func; __pyx_v_to_object_func = __pyx_t_2; /* "View.MemoryView":1096 * if isinstance(memview, _memoryviewslice): * to_object_func = (<_memoryviewslice> memview).to_object_func * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<< * else: * to_object_func = NULL */ __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func; __pyx_v_to_dtype_func = __pyx_t_3; /* "View.MemoryView":1094 * cdef int (*to_dtype_func)(char *, object) except 0 * * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< * to_object_func = (<_memoryviewslice> memview).to_object_func * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func */ goto __pyx_L3; } /* "View.MemoryView":1098 * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func * else: * to_object_func = NULL # <<<<<<<<<<<<<< * to_dtype_func = NULL * */ /*else*/ { __pyx_v_to_object_func = NULL; /* "View.MemoryView":1099 * else: * to_object_func = NULL * to_dtype_func = NULL # <<<<<<<<<<<<<< * * return memoryview_fromslice(memviewslice[0], memview.view.ndim, */ __pyx_v_to_dtype_func = NULL; } __pyx_L3:; /* "View.MemoryView":1101 * to_dtype_func = NULL * * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<< * to_object_func, to_dtype_func, * memview.dtype_is_object) */ __Pyx_XDECREF(__pyx_r); /* "View.MemoryView":1103 * return memoryview_fromslice(memviewslice[0], memview.view.ndim, * to_object_func, to_dtype_func, * memview.dtype_is_object) # <<<<<<<<<<<<<< * * */ __pyx_t_4 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 1101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "View.MemoryView":1087 * * @cname('__pyx_memoryview_copy_object_from_slice') * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<< * """ * Create a new memoryview object from a given memoryview object and slice. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":1109 * * * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) noexcept nogil: # <<<<<<<<<<<<<< * return -arg if arg < 0 else arg * */ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) { Py_ssize_t __pyx_r; Py_ssize_t __pyx_t_1; int __pyx_t_2; /* "View.MemoryView":1110 * * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) noexcept nogil: * return -arg if arg < 0 else arg # <<<<<<<<<<<<<< * * @cname('__pyx_get_best_slice_order') */ __pyx_t_2 = (__pyx_v_arg < 0); if (__pyx_t_2) { __pyx_t_1 = (-__pyx_v_arg); } else { __pyx_t_1 = __pyx_v_arg; } __pyx_r = __pyx_t_1; goto __pyx_L0; /* "View.MemoryView":1109 * * * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) noexcept nogil: # <<<<<<<<<<<<<< * return -arg if arg < 0 else arg * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "View.MemoryView":1113 * * @cname('__pyx_get_best_slice_order') * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) noexcept nogil: # <<<<<<<<<<<<<< * """ * Figure out the best memory access order for a given slice. */ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) { int __pyx_v_i; Py_ssize_t __pyx_v_c_stride; Py_ssize_t __pyx_v_f_stride; char __pyx_r; int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; /* "View.MemoryView":1118 * """ * cdef int i * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<< * cdef Py_ssize_t f_stride = 0 * */ __pyx_v_c_stride = 0; /* "View.MemoryView":1119 * cdef int i * cdef Py_ssize_t c_stride = 0 * cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<< * * for i in range(ndim - 1, -1, -1): */ __pyx_v_f_stride = 0; /* "View.MemoryView":1121 * cdef Py_ssize_t f_stride = 0 * * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<< * if mslice.shape[i] > 1: * c_stride = mslice.strides[i] */ for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) { __pyx_v_i = __pyx_t_1; /* "View.MemoryView":1122 * * for i in range(ndim - 1, -1, -1): * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< * c_stride = mslice.strides[i] * break */ __pyx_t_2 = ((__pyx_v_mslice->shape[__pyx_v_i]) > 1); if (__pyx_t_2) { /* "View.MemoryView":1123 * for i in range(ndim - 1, -1, -1): * if mslice.shape[i] > 1: * c_stride = mslice.strides[i] # <<<<<<<<<<<<<< * break * */ __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]); /* "View.MemoryView":1124 * if mslice.shape[i] > 1: * c_stride = mslice.strides[i] * break # <<<<<<<<<<<<<< * * for i in range(ndim): */ goto __pyx_L4_break; /* "View.MemoryView":1122 * * for i in range(ndim - 1, -1, -1): * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< * c_stride = mslice.strides[i] * break */ } } __pyx_L4_break:; /* "View.MemoryView":1126 * break * * for i in range(ndim): # <<<<<<<<<<<<<< * if mslice.shape[i] > 1: * f_stride = mslice.strides[i] */ __pyx_t_1 = __pyx_v_ndim; __pyx_t_3 = __pyx_t_1; for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; /* "View.MemoryView":1127 * * for i in range(ndim): * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< * f_stride = mslice.strides[i] * break */ __pyx_t_2 = ((__pyx_v_mslice->shape[__pyx_v_i]) > 1); if (__pyx_t_2) { /* "View.MemoryView":1128 * for i in range(ndim): * if mslice.shape[i] > 1: * f_stride = mslice.strides[i] # <<<<<<<<<<<<<< * break * */ __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]); /* "View.MemoryView":1129 * if mslice.shape[i] > 1: * f_stride = mslice.strides[i] * break # <<<<<<<<<<<<<< * * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): */ goto __pyx_L7_break; /* "View.MemoryView":1127 * * for i in range(ndim): * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< * f_stride = mslice.strides[i] * break */ } } __pyx_L7_break:; /* "View.MemoryView":1131 * break * * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<< * return 'C' * else: */ __pyx_t_2 = (abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)); if (__pyx_t_2) { /* "View.MemoryView":1132 * * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): * return 'C' # <<<<<<<<<<<<<< * else: * return 'F' */ __pyx_r = 'C'; goto __pyx_L0; /* "View.MemoryView":1131 * break * * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<< * return 'C' * else: */ } /* "View.MemoryView":1134 * return 'C' * else: * return 'F' # <<<<<<<<<<<<<< * * @cython.cdivision(True) */ /*else*/ { __pyx_r = 'F'; goto __pyx_L0; } /* "View.MemoryView":1113 * * @cname('__pyx_get_best_slice_order') * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) noexcept nogil: # <<<<<<<<<<<<<< * """ * Figure out the best memory access order for a given slice. */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "View.MemoryView":1137 * * @cython.cdivision(True) * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<< * char *dst_data, Py_ssize_t *dst_strides, * Py_ssize_t *src_shape, Py_ssize_t *dst_shape, */ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) { CYTHON_UNUSED Py_ssize_t __pyx_v_i; CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent; Py_ssize_t __pyx_v_dst_extent; Py_ssize_t __pyx_v_src_stride; Py_ssize_t __pyx_v_dst_stride; int __pyx_t_1; int __pyx_t_2; Py_ssize_t __pyx_t_3; Py_ssize_t __pyx_t_4; Py_ssize_t __pyx_t_5; /* "View.MemoryView":1144 * * cdef Py_ssize_t i * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<< * cdef Py_ssize_t dst_extent = dst_shape[0] * cdef Py_ssize_t src_stride = src_strides[0] */ __pyx_v_src_extent = (__pyx_v_src_shape[0]); /* "View.MemoryView":1145 * cdef Py_ssize_t i * cdef Py_ssize_t src_extent = src_shape[0] * cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<< * cdef Py_ssize_t src_stride = src_strides[0] * cdef Py_ssize_t dst_stride = dst_strides[0] */ __pyx_v_dst_extent = (__pyx_v_dst_shape[0]); /* "View.MemoryView":1146 * cdef Py_ssize_t src_extent = src_shape[0] * cdef Py_ssize_t dst_extent = dst_shape[0] * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<< * cdef Py_ssize_t dst_stride = dst_strides[0] * */ __pyx_v_src_stride = (__pyx_v_src_strides[0]); /* "View.MemoryView":1147 * cdef Py_ssize_t dst_extent = dst_shape[0] * cdef Py_ssize_t src_stride = src_strides[0] * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<< * * if ndim == 1: */ __pyx_v_dst_stride = (__pyx_v_dst_strides[0]); /* "View.MemoryView":1149 * cdef Py_ssize_t dst_stride = dst_strides[0] * * if ndim == 1: # <<<<<<<<<<<<<< * if (src_stride > 0 and dst_stride > 0 and * src_stride == itemsize == dst_stride): */ __pyx_t_1 = (__pyx_v_ndim == 1); if (__pyx_t_1) { /* "View.MemoryView":1150 * * if ndim == 1: * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<< * src_stride == itemsize == dst_stride): * memcpy(dst_data, src_data, itemsize * dst_extent) */ __pyx_t_2 = (__pyx_v_src_stride > 0); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L5_bool_binop_done; } __pyx_t_2 = (__pyx_v_dst_stride > 0); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L5_bool_binop_done; } /* "View.MemoryView":1151 * if ndim == 1: * if (src_stride > 0 and dst_stride > 0 and * src_stride == itemsize == dst_stride): # <<<<<<<<<<<<<< * memcpy(dst_data, src_data, itemsize * dst_extent) * else: */ __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize); if (__pyx_t_2) { __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride)); } __pyx_t_1 = __pyx_t_2; __pyx_L5_bool_binop_done:; /* "View.MemoryView":1150 * * if ndim == 1: * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<< * src_stride == itemsize == dst_stride): * memcpy(dst_data, src_data, itemsize * dst_extent) */ if (__pyx_t_1) { /* "View.MemoryView":1152 * if (src_stride > 0 and dst_stride > 0 and * src_stride == itemsize == dst_stride): * memcpy(dst_data, src_data, itemsize * dst_extent) # <<<<<<<<<<<<<< * else: * for i in range(dst_extent): */ (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent))); /* "View.MemoryView":1150 * * if ndim == 1: * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<< * src_stride == itemsize == dst_stride): * memcpy(dst_data, src_data, itemsize * dst_extent) */ goto __pyx_L4; } /* "View.MemoryView":1154 * memcpy(dst_data, src_data, itemsize * dst_extent) * else: * for i in range(dst_extent): # <<<<<<<<<<<<<< * memcpy(dst_data, src_data, itemsize) * src_data += src_stride */ /*else*/ { __pyx_t_3 = __pyx_v_dst_extent; __pyx_t_4 = __pyx_t_3; for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { __pyx_v_i = __pyx_t_5; /* "View.MemoryView":1155 * else: * for i in range(dst_extent): * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<< * src_data += src_stride * dst_data += dst_stride */ (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize)); /* "View.MemoryView":1156 * for i in range(dst_extent): * memcpy(dst_data, src_data, itemsize) * src_data += src_stride # <<<<<<<<<<<<<< * dst_data += dst_stride * else: */ __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride); /* "View.MemoryView":1157 * memcpy(dst_data, src_data, itemsize) * src_data += src_stride * dst_data += dst_stride # <<<<<<<<<<<<<< * else: * for i in range(dst_extent): */ __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride); } } __pyx_L4:; /* "View.MemoryView":1149 * cdef Py_ssize_t dst_stride = dst_strides[0] * * if ndim == 1: # <<<<<<<<<<<<<< * if (src_stride > 0 and dst_stride > 0 and * src_stride == itemsize == dst_stride): */ goto __pyx_L3; } /* "View.MemoryView":1159 * dst_data += dst_stride * else: * for i in range(dst_extent): # <<<<<<<<<<<<<< * _copy_strided_to_strided(src_data, src_strides + 1, * dst_data, dst_strides + 1, */ /*else*/ { __pyx_t_3 = __pyx_v_dst_extent; __pyx_t_4 = __pyx_t_3; for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { __pyx_v_i = __pyx_t_5; /* "View.MemoryView":1160 * else: * for i in range(dst_extent): * _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<< * dst_data, dst_strides + 1, * src_shape + 1, dst_shape + 1, */ _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize); /* "View.MemoryView":1164 * src_shape + 1, dst_shape + 1, * ndim - 1, itemsize) * src_data += src_stride # <<<<<<<<<<<<<< * dst_data += dst_stride * */ __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride); /* "View.MemoryView":1165 * ndim - 1, itemsize) * src_data += src_stride * dst_data += dst_stride # <<<<<<<<<<<<<< * * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, */ __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride); } } __pyx_L3:; /* "View.MemoryView":1137 * * @cython.cdivision(True) * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<< * char *dst_data, Py_ssize_t *dst_strides, * Py_ssize_t *src_shape, Py_ssize_t *dst_shape, */ /* function exit code */ } /* "View.MemoryView":1167 * dst_data += dst_stride * * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< * __Pyx_memviewslice *dst, * int ndim, size_t itemsize) noexcept nogil: */ static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) { /* "View.MemoryView":1170 * __Pyx_memviewslice *dst, * int ndim, size_t itemsize) noexcept nogil: * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<< * src.shape, dst.shape, ndim, itemsize) * */ _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize); /* "View.MemoryView":1167 * dst_data += dst_stride * * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< * __Pyx_memviewslice *dst, * int ndim, size_t itemsize) noexcept nogil: */ /* function exit code */ } /* "View.MemoryView":1174 * * @cname('__pyx_memoryview_slice_get_size') * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) noexcept nogil: # <<<<<<<<<<<<<< * "Return the size of the memory occupied by the slice in number of bytes" * cdef Py_ssize_t shape, size = src.memview.view.itemsize */ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) { Py_ssize_t __pyx_v_shape; Py_ssize_t __pyx_v_size; Py_ssize_t __pyx_r; Py_ssize_t __pyx_t_1; Py_ssize_t *__pyx_t_2; Py_ssize_t *__pyx_t_3; Py_ssize_t *__pyx_t_4; /* "View.MemoryView":1176 * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) noexcept nogil: * "Return the size of the memory occupied by the slice in number of bytes" * cdef Py_ssize_t shape, size = src.memview.view.itemsize # <<<<<<<<<<<<<< * * for shape in src.shape[:ndim]: */ __pyx_t_1 = __pyx_v_src->memview->view.itemsize; __pyx_v_size = __pyx_t_1; /* "View.MemoryView":1178 * cdef Py_ssize_t shape, size = src.memview.view.itemsize * * for shape in src.shape[:ndim]: # <<<<<<<<<<<<<< * size *= shape * */ __pyx_t_3 = (__pyx_v_src->shape + __pyx_v_ndim); for (__pyx_t_4 = __pyx_v_src->shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) { __pyx_t_2 = __pyx_t_4; __pyx_v_shape = (__pyx_t_2[0]); /* "View.MemoryView":1179 * * for shape in src.shape[:ndim]: * size *= shape # <<<<<<<<<<<<<< * * return size */ __pyx_v_size = (__pyx_v_size * __pyx_v_shape); } /* "View.MemoryView":1181 * size *= shape * * return size # <<<<<<<<<<<<<< * * @cname('__pyx_fill_contig_strides_array') */ __pyx_r = __pyx_v_size; goto __pyx_L0; /* "View.MemoryView":1174 * * @cname('__pyx_memoryview_slice_get_size') * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) noexcept nogil: # <<<<<<<<<<<<<< * "Return the size of the memory occupied by the slice in number of bytes" * cdef Py_ssize_t shape, size = src.memview.view.itemsize */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "View.MemoryView":1184 * * @cname('__pyx_fill_contig_strides_array') * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<< * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride, * int ndim, char order) noexcept nogil: */ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) { int __pyx_v_idx; Py_ssize_t __pyx_r; int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; /* "View.MemoryView":1193 * cdef int idx * * if order == 'F': # <<<<<<<<<<<<<< * for idx in range(ndim): * strides[idx] = stride */ __pyx_t_1 = (__pyx_v_order == 'F'); if (__pyx_t_1) { /* "View.MemoryView":1194 * * if order == 'F': * for idx in range(ndim): # <<<<<<<<<<<<<< * strides[idx] = stride * stride *= shape[idx] */ __pyx_t_2 = __pyx_v_ndim; __pyx_t_3 = __pyx_t_2; for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_idx = __pyx_t_4; /* "View.MemoryView":1195 * if order == 'F': * for idx in range(ndim): * strides[idx] = stride # <<<<<<<<<<<<<< * stride *= shape[idx] * else: */ (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride; /* "View.MemoryView":1196 * for idx in range(ndim): * strides[idx] = stride * stride *= shape[idx] # <<<<<<<<<<<<<< * else: * for idx in range(ndim - 1, -1, -1): */ __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx])); } /* "View.MemoryView":1193 * cdef int idx * * if order == 'F': # <<<<<<<<<<<<<< * for idx in range(ndim): * strides[idx] = stride */ goto __pyx_L3; } /* "View.MemoryView":1198 * stride *= shape[idx] * else: * for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<< * strides[idx] = stride * stride *= shape[idx] */ /*else*/ { for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) { __pyx_v_idx = __pyx_t_2; /* "View.MemoryView":1199 * else: * for idx in range(ndim - 1, -1, -1): * strides[idx] = stride # <<<<<<<<<<<<<< * stride *= shape[idx] * */ (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride; /* "View.MemoryView":1200 * for idx in range(ndim - 1, -1, -1): * strides[idx] = stride * stride *= shape[idx] # <<<<<<<<<<<<<< * * return stride */ __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx])); } } __pyx_L3:; /* "View.MemoryView":1202 * stride *= shape[idx] * * return stride # <<<<<<<<<<<<<< * * @cname('__pyx_memoryview_copy_data_to_temp') */ __pyx_r = __pyx_v_stride; goto __pyx_L0; /* "View.MemoryView":1184 * * @cname('__pyx_fill_contig_strides_array') * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<< * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride, * int ndim, char order) noexcept nogil: */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "View.MemoryView":1205 * * @cname('__pyx_memoryview_copy_data_to_temp') * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< * __Pyx_memviewslice *tmpslice, * char order, */ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice, char __pyx_v_order, int __pyx_v_ndim) { int __pyx_v_i; void *__pyx_v_result; size_t __pyx_v_itemsize; size_t __pyx_v_size; void *__pyx_r; Py_ssize_t __pyx_t_1; int __pyx_t_2; int __pyx_t_3; struct __pyx_memoryview_obj *__pyx_t_4; int __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save; #endif /* "View.MemoryView":1216 * cdef void *result * * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<< * cdef size_t size = slice_get_size(src, ndim) * */ __pyx_t_1 = __pyx_v_src->memview->view.itemsize; __pyx_v_itemsize = __pyx_t_1; /* "View.MemoryView":1217 * * cdef size_t itemsize = src.memview.view.itemsize * cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<< * * result = malloc(size) */ __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim); /* "View.MemoryView":1219 * cdef size_t size = slice_get_size(src, ndim) * * result = malloc(size) # <<<<<<<<<<<<<< * if not result: * _err_no_memory() */ __pyx_v_result = malloc(__pyx_v_size); /* "View.MemoryView":1220 * * result = malloc(size) * if not result: # <<<<<<<<<<<<<< * _err_no_memory() * */ __pyx_t_2 = (!(__pyx_v_result != 0)); if (__pyx_t_2) { /* "View.MemoryView":1221 * result = malloc(size) * if not result: * _err_no_memory() # <<<<<<<<<<<<<< * * */ __pyx_t_3 = __pyx_memoryview_err_no_memory(); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(13, 1221, __pyx_L1_error) /* "View.MemoryView":1220 * * result = malloc(size) * if not result: # <<<<<<<<<<<<<< * _err_no_memory() * */ } /* "View.MemoryView":1224 * * * tmpslice.data = result # <<<<<<<<<<<<<< * tmpslice.memview = src.memview * for i in range(ndim): */ __pyx_v_tmpslice->data = ((char *)__pyx_v_result); /* "View.MemoryView":1225 * * tmpslice.data = result * tmpslice.memview = src.memview # <<<<<<<<<<<<<< * for i in range(ndim): * tmpslice.shape[i] = src.shape[i] */ __pyx_t_4 = __pyx_v_src->memview; __pyx_v_tmpslice->memview = __pyx_t_4; /* "View.MemoryView":1226 * tmpslice.data = result * tmpslice.memview = src.memview * for i in range(ndim): # <<<<<<<<<<<<<< * tmpslice.shape[i] = src.shape[i] * tmpslice.suboffsets[i] = -1 */ __pyx_t_3 = __pyx_v_ndim; __pyx_t_5 = __pyx_t_3; for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; /* "View.MemoryView":1227 * tmpslice.memview = src.memview * for i in range(ndim): * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<< * tmpslice.suboffsets[i] = -1 * */ (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]); /* "View.MemoryView":1228 * for i in range(ndim): * tmpslice.shape[i] = src.shape[i] * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<< * * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, ndim, order) */ (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L; } /* "View.MemoryView":1230 * tmpslice.suboffsets[i] = -1 * * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, ndim, order) # <<<<<<<<<<<<<< * * */ (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order)); /* "View.MemoryView":1233 * * * for i in range(ndim): # <<<<<<<<<<<<<< * if tmpslice.shape[i] == 1: * tmpslice.strides[i] = 0 */ __pyx_t_3 = __pyx_v_ndim; __pyx_t_5 = __pyx_t_3; for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; /* "View.MemoryView":1234 * * for i in range(ndim): * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<< * tmpslice.strides[i] = 0 * */ __pyx_t_2 = ((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1); if (__pyx_t_2) { /* "View.MemoryView":1235 * for i in range(ndim): * if tmpslice.shape[i] == 1: * tmpslice.strides[i] = 0 # <<<<<<<<<<<<<< * * if slice_is_contig(src[0], order, ndim): */ (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0; /* "View.MemoryView":1234 * * for i in range(ndim): * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<< * tmpslice.strides[i] = 0 * */ } } /* "View.MemoryView":1237 * tmpslice.strides[i] = 0 * * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<< * memcpy(result, src.data, size) * else: */ __pyx_t_2 = __pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim); if (__pyx_t_2) { /* "View.MemoryView":1238 * * if slice_is_contig(src[0], order, ndim): * memcpy(result, src.data, size) # <<<<<<<<<<<<<< * else: * copy_strided_to_strided(src, tmpslice, ndim, itemsize) */ (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size)); /* "View.MemoryView":1237 * tmpslice.strides[i] = 0 * * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<< * memcpy(result, src.data, size) * else: */ goto __pyx_L9; } /* "View.MemoryView":1240 * memcpy(result, src.data, size) * else: * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<< * * return result */ /*else*/ { copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize); } __pyx_L9:; /* "View.MemoryView":1242 * copy_strided_to_strided(src, tmpslice, ndim, itemsize) * * return result # <<<<<<<<<<<<<< * * */ __pyx_r = __pyx_v_result; goto __pyx_L0; /* "View.MemoryView":1205 * * @cname('__pyx_memoryview_copy_data_to_temp') * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< * __Pyx_memviewslice *tmpslice, * char order, */ /* function exit code */ __pyx_L1_error:; #ifdef WITH_THREAD __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif __pyx_L0:; return __pyx_r; } /* "View.MemoryView":1247 * * @cname('__pyx_memoryview_err_extents') * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<< * Py_ssize_t extent2) except -1 with gil: * raise ValueError, f"got differing extents in dimension {i} (got {extent1} and {extent2})" */ static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; Py_UCS4 __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("_err_extents", 0); /* "View.MemoryView":1249 * cdef int _err_extents(int i, Py_ssize_t extent1, * Py_ssize_t extent2) except -1 with gil: * raise ValueError, f"got differing extents in dimension {i} (got {extent1} and {extent2})" # <<<<<<<<<<<<<< * * @cname('__pyx_memoryview_err_dim') */ __pyx_t_1 = PyTuple_New(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 1249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = 127; __Pyx_INCREF(__pyx_kp_u_got_differing_extents_in_dimensi); __pyx_t_2 += 35; __Pyx_GIVEREF(__pyx_kp_u_got_differing_extents_in_dimensi); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_got_differing_extents_in_dimensi); __pyx_t_4 = __Pyx_PyUnicode_From_int(__pyx_v_i, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 1249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4); __pyx_t_4 = 0; __Pyx_INCREF(__pyx_kp_u_got); __pyx_t_2 += 6; __Pyx_GIVEREF(__pyx_kp_u_got); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_got); __pyx_t_4 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_extent1, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 1249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_4); __pyx_t_4 = 0; __Pyx_INCREF(__pyx_kp_u_and); __pyx_t_2 += 5; __Pyx_GIVEREF(__pyx_kp_u_and); PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u_and); __pyx_t_4 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_extent2, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 1249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_4); __pyx_t_4 = 0; __Pyx_INCREF(__pyx_kp_u__7); __pyx_t_2 += 1; __Pyx_GIVEREF(__pyx_kp_u__7); PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_kp_u__7); __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 7, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 1249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_4, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(13, 1249, __pyx_L1_error) /* "View.MemoryView":1247 * * @cname('__pyx_memoryview_err_extents') * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<< * Py_ssize_t extent2) except -1 with gil: * raise ValueError, f"got differing extents in dimension {i} (got {extent1} and {extent2})" */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "View.MemoryView":1252 * * @cname('__pyx_memoryview_err_dim') * cdef int _err_dim(PyObject *error, str msg, int dim) except -1 with gil: # <<<<<<<<<<<<<< * raise error, msg % dim * */ static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, PyObject *__pyx_v_msg, int __pyx_v_dim) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("_err_dim", 0); __Pyx_INCREF(__pyx_v_msg); /* "View.MemoryView":1253 * @cname('__pyx_memoryview_err_dim') * cdef int _err_dim(PyObject *error, str msg, int dim) except -1 with gil: * raise error, msg % dim # <<<<<<<<<<<<<< * * @cname('__pyx_memoryview_err') */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 1253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyString_FormatSafe(__pyx_v_msg, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 1253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(((PyObject *)__pyx_v_error), __pyx_t_2, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(13, 1253, __pyx_L1_error) /* "View.MemoryView":1252 * * @cname('__pyx_memoryview_err_dim') * cdef int _err_dim(PyObject *error, str msg, int dim) except -1 with gil: # <<<<<<<<<<<<<< * raise error, msg % dim * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __Pyx_XDECREF(__pyx_v_msg); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "View.MemoryView":1256 * * @cname('__pyx_memoryview_err') * cdef int _err(PyObject *error, str msg) except -1 with gil: # <<<<<<<<<<<<<< * raise error, msg * */ static int __pyx_memoryview_err(PyObject *__pyx_v_error, PyObject *__pyx_v_msg) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("_err", 0); __Pyx_INCREF(__pyx_v_msg); /* "View.MemoryView":1257 * @cname('__pyx_memoryview_err') * cdef int _err(PyObject *error, str msg) except -1 with gil: * raise error, msg # <<<<<<<<<<<<<< * * @cname('__pyx_memoryview_err_no_memory') */ __Pyx_Raise(((PyObject *)__pyx_v_error), __pyx_v_msg, 0, 0); __PYX_ERR(13, 1257, __pyx_L1_error) /* "View.MemoryView":1256 * * @cname('__pyx_memoryview_err') * cdef int _err(PyObject *error, str msg) except -1 with gil: # <<<<<<<<<<<<<< * raise error, msg * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __Pyx_XDECREF(__pyx_v_msg); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "View.MemoryView":1260 * * @cname('__pyx_memoryview_err_no_memory') * cdef int _err_no_memory() except -1 with gil: # <<<<<<<<<<<<<< * raise MemoryError * */ static int __pyx_memoryview_err_no_memory(void) { int __pyx_r; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif /* "View.MemoryView":1261 * @cname('__pyx_memoryview_err_no_memory') * cdef int _err_no_memory() except -1 with gil: * raise MemoryError # <<<<<<<<<<<<<< * * */ PyErr_NoMemory(); __PYX_ERR(13, 1261, __pyx_L1_error) /* "View.MemoryView":1260 * * @cname('__pyx_memoryview_err_no_memory') * cdef int _err_no_memory() except -1 with gil: # <<<<<<<<<<<<<< * raise MemoryError * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("View.MemoryView._err_no_memory", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "View.MemoryView":1265 * * @cname('__pyx_memoryview_copy_contents') * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<< * __Pyx_memviewslice dst, * int src_ndim, int dst_ndim, */ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) { void *__pyx_v_tmpdata; size_t __pyx_v_itemsize; int __pyx_v_i; char __pyx_v_order; int __pyx_v_broadcasting; int __pyx_v_direct_copy; __Pyx_memviewslice __pyx_v_tmp; int __pyx_v_ndim; int __pyx_r; Py_ssize_t __pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; int __pyx_t_5; int __pyx_t_6; void *__pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save; #endif /* "View.MemoryView":1273 * Check for overlapping memory and verify the shapes. * """ * cdef void *tmpdata = NULL # <<<<<<<<<<<<<< * cdef size_t itemsize = src.memview.view.itemsize * cdef int i */ __pyx_v_tmpdata = NULL; /* "View.MemoryView":1274 * """ * cdef void *tmpdata = NULL * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<< * cdef int i * cdef char order = get_best_order(&src, src_ndim) */ __pyx_t_1 = __pyx_v_src.memview->view.itemsize; __pyx_v_itemsize = __pyx_t_1; /* "View.MemoryView":1276 * cdef size_t itemsize = src.memview.view.itemsize * cdef int i * cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<< * cdef bint broadcasting = False * cdef bint direct_copy = False */ __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim); /* "View.MemoryView":1277 * cdef int i * cdef char order = get_best_order(&src, src_ndim) * cdef bint broadcasting = False # <<<<<<<<<<<<<< * cdef bint direct_copy = False * cdef __Pyx_memviewslice tmp */ __pyx_v_broadcasting = 0; /* "View.MemoryView":1278 * cdef char order = get_best_order(&src, src_ndim) * cdef bint broadcasting = False * cdef bint direct_copy = False # <<<<<<<<<<<<<< * cdef __Pyx_memviewslice tmp * */ __pyx_v_direct_copy = 0; /* "View.MemoryView":1281 * cdef __Pyx_memviewslice tmp * * if src_ndim < dst_ndim: # <<<<<<<<<<<<<< * broadcast_leading(&src, src_ndim, dst_ndim) * elif dst_ndim < src_ndim: */ __pyx_t_2 = (__pyx_v_src_ndim < __pyx_v_dst_ndim); if (__pyx_t_2) { /* "View.MemoryView":1282 * * if src_ndim < dst_ndim: * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<< * elif dst_ndim < src_ndim: * broadcast_leading(&dst, dst_ndim, src_ndim) */ __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim); /* "View.MemoryView":1281 * cdef __Pyx_memviewslice tmp * * if src_ndim < dst_ndim: # <<<<<<<<<<<<<< * broadcast_leading(&src, src_ndim, dst_ndim) * elif dst_ndim < src_ndim: */ goto __pyx_L3; } /* "View.MemoryView":1283 * if src_ndim < dst_ndim: * broadcast_leading(&src, src_ndim, dst_ndim) * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<< * broadcast_leading(&dst, dst_ndim, src_ndim) * */ __pyx_t_2 = (__pyx_v_dst_ndim < __pyx_v_src_ndim); if (__pyx_t_2) { /* "View.MemoryView":1284 * broadcast_leading(&src, src_ndim, dst_ndim) * elif dst_ndim < src_ndim: * broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<< * * cdef int ndim = max(src_ndim, dst_ndim) */ __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim); /* "View.MemoryView":1283 * if src_ndim < dst_ndim: * broadcast_leading(&src, src_ndim, dst_ndim) * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<< * broadcast_leading(&dst, dst_ndim, src_ndim) * */ } __pyx_L3:; /* "View.MemoryView":1286 * broadcast_leading(&dst, dst_ndim, src_ndim) * * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<< * * for i in range(ndim): */ __pyx_t_3 = __pyx_v_dst_ndim; __pyx_t_4 = __pyx_v_src_ndim; __pyx_t_2 = (__pyx_t_3 > __pyx_t_4); if (__pyx_t_2) { __pyx_t_5 = __pyx_t_3; } else { __pyx_t_5 = __pyx_t_4; } __pyx_v_ndim = __pyx_t_5; /* "View.MemoryView":1288 * cdef int ndim = max(src_ndim, dst_ndim) * * for i in range(ndim): # <<<<<<<<<<<<<< * if src.shape[i] != dst.shape[i]: * if src.shape[i] == 1: */ __pyx_t_5 = __pyx_v_ndim; __pyx_t_3 = __pyx_t_5; for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; /* "View.MemoryView":1289 * * for i in range(ndim): * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<< * if src.shape[i] == 1: * broadcasting = True */ __pyx_t_2 = ((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])); if (__pyx_t_2) { /* "View.MemoryView":1290 * for i in range(ndim): * if src.shape[i] != dst.shape[i]: * if src.shape[i] == 1: # <<<<<<<<<<<<<< * broadcasting = True * src.strides[i] = 0 */ __pyx_t_2 = ((__pyx_v_src.shape[__pyx_v_i]) == 1); if (__pyx_t_2) { /* "View.MemoryView":1291 * if src.shape[i] != dst.shape[i]: * if src.shape[i] == 1: * broadcasting = True # <<<<<<<<<<<<<< * src.strides[i] = 0 * else: */ __pyx_v_broadcasting = 1; /* "View.MemoryView":1292 * if src.shape[i] == 1: * broadcasting = True * src.strides[i] = 0 # <<<<<<<<<<<<<< * else: * _err_extents(i, dst.shape[i], src.shape[i]) */ (__pyx_v_src.strides[__pyx_v_i]) = 0; /* "View.MemoryView":1290 * for i in range(ndim): * if src.shape[i] != dst.shape[i]: * if src.shape[i] == 1: # <<<<<<<<<<<<<< * broadcasting = True * src.strides[i] = 0 */ goto __pyx_L7; } /* "View.MemoryView":1294 * src.strides[i] = 0 * else: * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<< * * if src.suboffsets[i] >= 0: */ /*else*/ { __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(13, 1294, __pyx_L1_error) } __pyx_L7:; /* "View.MemoryView":1289 * * for i in range(ndim): * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<< * if src.shape[i] == 1: * broadcasting = True */ } /* "View.MemoryView":1296 * _err_extents(i, dst.shape[i], src.shape[i]) * * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<< * _err_dim(PyExc_ValueError, "Dimension %d is not direct", i) * */ __pyx_t_2 = ((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0); if (__pyx_t_2) { /* "View.MemoryView":1297 * * if src.suboffsets[i] >= 0: * _err_dim(PyExc_ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<< * * if slices_overlap(&src, &dst, ndim, itemsize): */ __pyx_t_6 = __pyx_memoryview_err_dim(PyExc_ValueError, __pyx_kp_s_Dimension_d_is_not_direct, __pyx_v_i); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(13, 1297, __pyx_L1_error) /* "View.MemoryView":1296 * _err_extents(i, dst.shape[i], src.shape[i]) * * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<< * _err_dim(PyExc_ValueError, "Dimension %d is not direct", i) * */ } } /* "View.MemoryView":1299 * _err_dim(PyExc_ValueError, "Dimension %d is not direct", i) * * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<< * * if not slice_is_contig(src, order, ndim): */ __pyx_t_2 = __pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize); if (__pyx_t_2) { /* "View.MemoryView":1301 * if slices_overlap(&src, &dst, ndim, itemsize): * * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<< * order = get_best_order(&dst, ndim) * */ __pyx_t_2 = (!__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim)); if (__pyx_t_2) { /* "View.MemoryView":1302 * * if not slice_is_contig(src, order, ndim): * order = get_best_order(&dst, ndim) # <<<<<<<<<<<<<< * * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) */ __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim); /* "View.MemoryView":1301 * if slices_overlap(&src, &dst, ndim, itemsize): * * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<< * order = get_best_order(&dst, ndim) * */ } /* "View.MemoryView":1304 * order = get_best_order(&dst, ndim) * * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<< * src = tmp * */ __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(13, 1304, __pyx_L1_error) __pyx_v_tmpdata = __pyx_t_7; /* "View.MemoryView":1305 * * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) * src = tmp # <<<<<<<<<<<<<< * * if not broadcasting: */ __pyx_v_src = __pyx_v_tmp; /* "View.MemoryView":1299 * _err_dim(PyExc_ValueError, "Dimension %d is not direct", i) * * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<< * * if not slice_is_contig(src, order, ndim): */ } /* "View.MemoryView":1307 * src = tmp * * if not broadcasting: # <<<<<<<<<<<<<< * * */ __pyx_t_2 = (!__pyx_v_broadcasting); if (__pyx_t_2) { /* "View.MemoryView":1310 * * * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<< * direct_copy = slice_is_contig(dst, 'C', ndim) * elif slice_is_contig(src, 'F', ndim): */ __pyx_t_2 = __pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim); if (__pyx_t_2) { /* "View.MemoryView":1311 * * if slice_is_contig(src, 'C', ndim): * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<< * elif slice_is_contig(src, 'F', ndim): * direct_copy = slice_is_contig(dst, 'F', ndim) */ __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim); /* "View.MemoryView":1310 * * * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<< * direct_copy = slice_is_contig(dst, 'C', ndim) * elif slice_is_contig(src, 'F', ndim): */ goto __pyx_L12; } /* "View.MemoryView":1312 * if slice_is_contig(src, 'C', ndim): * direct_copy = slice_is_contig(dst, 'C', ndim) * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<< * direct_copy = slice_is_contig(dst, 'F', ndim) * */ __pyx_t_2 = __pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim); if (__pyx_t_2) { /* "View.MemoryView":1313 * direct_copy = slice_is_contig(dst, 'C', ndim) * elif slice_is_contig(src, 'F', ndim): * direct_copy = slice_is_contig(dst, 'F', ndim) # <<<<<<<<<<<<<< * * if direct_copy: */ __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim); /* "View.MemoryView":1312 * if slice_is_contig(src, 'C', ndim): * direct_copy = slice_is_contig(dst, 'C', ndim) * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<< * direct_copy = slice_is_contig(dst, 'F', ndim) * */ } __pyx_L12:; /* "View.MemoryView":1315 * direct_copy = slice_is_contig(dst, 'F', ndim) * * if direct_copy: # <<<<<<<<<<<<<< * * refcount_copying(&dst, dtype_is_object, ndim, inc=False) */ if (__pyx_v_direct_copy) { /* "View.MemoryView":1317 * if direct_copy: * * refcount_copying(&dst, dtype_is_object, ndim, inc=False) # <<<<<<<<<<<<<< * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) * refcount_copying(&dst, dtype_is_object, ndim, inc=True) */ __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0); /* "View.MemoryView":1318 * * refcount_copying(&dst, dtype_is_object, ndim, inc=False) * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<< * refcount_copying(&dst, dtype_is_object, ndim, inc=True) * free(tmpdata) */ (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim))); /* "View.MemoryView":1319 * refcount_copying(&dst, dtype_is_object, ndim, inc=False) * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) * refcount_copying(&dst, dtype_is_object, ndim, inc=True) # <<<<<<<<<<<<<< * free(tmpdata) * return 0 */ __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1); /* "View.MemoryView":1320 * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) * refcount_copying(&dst, dtype_is_object, ndim, inc=True) * free(tmpdata) # <<<<<<<<<<<<<< * return 0 * */ free(__pyx_v_tmpdata); /* "View.MemoryView":1321 * refcount_copying(&dst, dtype_is_object, ndim, inc=True) * free(tmpdata) * return 0 # <<<<<<<<<<<<<< * * if order == 'F' == get_best_order(&dst, ndim): */ __pyx_r = 0; goto __pyx_L0; /* "View.MemoryView":1315 * direct_copy = slice_is_contig(dst, 'F', ndim) * * if direct_copy: # <<<<<<<<<<<<<< * * refcount_copying(&dst, dtype_is_object, ndim, inc=False) */ } /* "View.MemoryView":1307 * src = tmp * * if not broadcasting: # <<<<<<<<<<<<<< * * */ } /* "View.MemoryView":1323 * return 0 * * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<< * * */ __pyx_t_2 = (__pyx_v_order == 'F'); if (__pyx_t_2) { __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim)); } if (__pyx_t_2) { /* "View.MemoryView":1326 * * * transpose_memslice(&src) # <<<<<<<<<<<<<< * transpose_memslice(&dst) * */ __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(13, 1326, __pyx_L1_error) /* "View.MemoryView":1327 * * transpose_memslice(&src) * transpose_memslice(&dst) # <<<<<<<<<<<<<< * * refcount_copying(&dst, dtype_is_object, ndim, inc=False) */ __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(13, 1327, __pyx_L1_error) /* "View.MemoryView":1323 * return 0 * * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<< * * */ } /* "View.MemoryView":1329 * transpose_memslice(&dst) * * refcount_copying(&dst, dtype_is_object, ndim, inc=False) # <<<<<<<<<<<<<< * copy_strided_to_strided(&src, &dst, ndim, itemsize) * refcount_copying(&dst, dtype_is_object, ndim, inc=True) */ __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0); /* "View.MemoryView":1330 * * refcount_copying(&dst, dtype_is_object, ndim, inc=False) * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<< * refcount_copying(&dst, dtype_is_object, ndim, inc=True) * */ copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize); /* "View.MemoryView":1331 * refcount_copying(&dst, dtype_is_object, ndim, inc=False) * copy_strided_to_strided(&src, &dst, ndim, itemsize) * refcount_copying(&dst, dtype_is_object, ndim, inc=True) # <<<<<<<<<<<<<< * * free(tmpdata) */ __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1); /* "View.MemoryView":1333 * refcount_copying(&dst, dtype_is_object, ndim, inc=True) * * free(tmpdata) # <<<<<<<<<<<<<< * return 0 * */ free(__pyx_v_tmpdata); /* "View.MemoryView":1334 * * free(tmpdata) * return 0 # <<<<<<<<<<<<<< * * @cname('__pyx_memoryview_broadcast_leading') */ __pyx_r = 0; goto __pyx_L0; /* "View.MemoryView":1265 * * @cname('__pyx_memoryview_copy_contents') * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<< * __Pyx_memviewslice dst, * int src_ndim, int dst_ndim, */ /* function exit code */ __pyx_L1_error:; #ifdef WITH_THREAD __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif __pyx_L0:; return __pyx_r; } /* "View.MemoryView":1337 * * @cname('__pyx_memoryview_broadcast_leading') * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<< * int ndim, * int ndim_other) noexcept nogil: */ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) { int __pyx_v_i; int __pyx_v_offset; int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; /* "View.MemoryView":1341 * int ndim_other) noexcept nogil: * cdef int i * cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<< * * for i in range(ndim - 1, -1, -1): */ __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim); /* "View.MemoryView":1343 * cdef int offset = ndim_other - ndim * * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<< * mslice.shape[i + offset] = mslice.shape[i] * mslice.strides[i + offset] = mslice.strides[i] */ for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) { __pyx_v_i = __pyx_t_1; /* "View.MemoryView":1344 * * for i in range(ndim - 1, -1, -1): * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<< * mslice.strides[i + offset] = mslice.strides[i] * mslice.suboffsets[i + offset] = mslice.suboffsets[i] */ (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]); /* "View.MemoryView":1345 * for i in range(ndim - 1, -1, -1): * mslice.shape[i + offset] = mslice.shape[i] * mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<< * mslice.suboffsets[i + offset] = mslice.suboffsets[i] * */ (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]); /* "View.MemoryView":1346 * mslice.shape[i + offset] = mslice.shape[i] * mslice.strides[i + offset] = mslice.strides[i] * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<< * * for i in range(offset): */ (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]); } /* "View.MemoryView":1348 * mslice.suboffsets[i + offset] = mslice.suboffsets[i] * * for i in range(offset): # <<<<<<<<<<<<<< * mslice.shape[i] = 1 * mslice.strides[i] = mslice.strides[0] */ __pyx_t_1 = __pyx_v_offset; __pyx_t_2 = __pyx_t_1; for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { __pyx_v_i = __pyx_t_3; /* "View.MemoryView":1349 * * for i in range(offset): * mslice.shape[i] = 1 # <<<<<<<<<<<<<< * mslice.strides[i] = mslice.strides[0] * mslice.suboffsets[i] = -1 */ (__pyx_v_mslice->shape[__pyx_v_i]) = 1; /* "View.MemoryView":1350 * for i in range(offset): * mslice.shape[i] = 1 * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<< * mslice.suboffsets[i] = -1 * */ (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]); /* "View.MemoryView":1351 * mslice.shape[i] = 1 * mslice.strides[i] = mslice.strides[0] * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<< * * */ (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L; } /* "View.MemoryView":1337 * * @cname('__pyx_memoryview_broadcast_leading') * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<< * int ndim, * int ndim_other) noexcept nogil: */ /* function exit code */ } /* "View.MemoryView":1359 * * @cname('__pyx_memoryview_refcount_copying') * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, int ndim, bint inc) noexcept nogil: # <<<<<<<<<<<<<< * * if dtype_is_object: */ static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) { /* "View.MemoryView":1361 * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, int ndim, bint inc) noexcept nogil: * * if dtype_is_object: # <<<<<<<<<<<<<< * refcount_objects_in_slice_with_gil(dst.data, dst.shape, dst.strides, ndim, inc) * */ if (__pyx_v_dtype_is_object) { /* "View.MemoryView":1362 * * if dtype_is_object: * refcount_objects_in_slice_with_gil(dst.data, dst.shape, dst.strides, ndim, inc) # <<<<<<<<<<<<<< * * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil') */ __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc); /* "View.MemoryView":1361 * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, int ndim, bint inc) noexcept nogil: * * if dtype_is_object: # <<<<<<<<<<<<<< * refcount_objects_in_slice_with_gil(dst.data, dst.shape, dst.strides, ndim, inc) * */ } /* "View.MemoryView":1359 * * @cname('__pyx_memoryview_refcount_copying') * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, int ndim, bint inc) noexcept nogil: # <<<<<<<<<<<<<< * * if dtype_is_object: */ /* function exit code */ } /* "View.MemoryView":1365 * * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil') * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< * Py_ssize_t *strides, int ndim, * bint inc) noexcept with gil: */ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) { #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif /* "View.MemoryView":1368 * Py_ssize_t *strides, int ndim, * bint inc) noexcept with gil: * refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<< * * @cname('__pyx_memoryview_refcount_objects_in_slice') */ __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc); /* "View.MemoryView":1365 * * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil') * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< * Py_ssize_t *strides, int ndim, * bint inc) noexcept with gil: */ /* function exit code */ #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } /* "View.MemoryView":1371 * * @cname('__pyx_memoryview_refcount_objects_in_slice') * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< * Py_ssize_t *strides, int ndim, bint inc) noexcept: * cdef Py_ssize_t i */ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) { CYTHON_UNUSED Py_ssize_t __pyx_v_i; Py_ssize_t __pyx_v_stride; Py_ssize_t __pyx_t_1; Py_ssize_t __pyx_t_2; Py_ssize_t __pyx_t_3; int __pyx_t_4; /* "View.MemoryView":1374 * Py_ssize_t *strides, int ndim, bint inc) noexcept: * cdef Py_ssize_t i * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<< * * for i in range(shape[0]): */ __pyx_v_stride = (__pyx_v_strides[0]); /* "View.MemoryView":1376 * cdef Py_ssize_t stride = strides[0] * * for i in range(shape[0]): # <<<<<<<<<<<<<< * if ndim == 1: * if inc: */ __pyx_t_1 = (__pyx_v_shape[0]); __pyx_t_2 = __pyx_t_1; for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { __pyx_v_i = __pyx_t_3; /* "View.MemoryView":1377 * * for i in range(shape[0]): * if ndim == 1: # <<<<<<<<<<<<<< * if inc: * Py_INCREF(( data)[0]) */ __pyx_t_4 = (__pyx_v_ndim == 1); if (__pyx_t_4) { /* "View.MemoryView":1378 * for i in range(shape[0]): * if ndim == 1: * if inc: # <<<<<<<<<<<<<< * Py_INCREF(( data)[0]) * else: */ if (__pyx_v_inc) { /* "View.MemoryView":1379 * if ndim == 1: * if inc: * Py_INCREF(( data)[0]) # <<<<<<<<<<<<<< * else: * Py_DECREF(( data)[0]) */ Py_INCREF((((PyObject **)__pyx_v_data)[0])); /* "View.MemoryView":1378 * for i in range(shape[0]): * if ndim == 1: * if inc: # <<<<<<<<<<<<<< * Py_INCREF(( data)[0]) * else: */ goto __pyx_L6; } /* "View.MemoryView":1381 * Py_INCREF(( data)[0]) * else: * Py_DECREF(( data)[0]) # <<<<<<<<<<<<<< * else: * refcount_objects_in_slice(data, shape + 1, strides + 1, ndim - 1, inc) */ /*else*/ { Py_DECREF((((PyObject **)__pyx_v_data)[0])); } __pyx_L6:; /* "View.MemoryView":1377 * * for i in range(shape[0]): * if ndim == 1: # <<<<<<<<<<<<<< * if inc: * Py_INCREF(( data)[0]) */ goto __pyx_L5; } /* "View.MemoryView":1383 * Py_DECREF(( data)[0]) * else: * refcount_objects_in_slice(data, shape + 1, strides + 1, ndim - 1, inc) # <<<<<<<<<<<<<< * * data += stride */ /*else*/ { __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc); } __pyx_L5:; /* "View.MemoryView":1385 * refcount_objects_in_slice(data, shape + 1, strides + 1, ndim - 1, inc) * * data += stride # <<<<<<<<<<<<<< * * */ __pyx_v_data = (__pyx_v_data + __pyx_v_stride); } /* "View.MemoryView":1371 * * @cname('__pyx_memoryview_refcount_objects_in_slice') * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< * Py_ssize_t *strides, int ndim, bint inc) noexcept: * cdef Py_ssize_t i */ /* function exit code */ } /* "View.MemoryView":1391 * * @cname('__pyx_memoryview_slice_assign_scalar') * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<< * size_t itemsize, void *item, * bint dtype_is_object) noexcept nogil: */ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) { /* "View.MemoryView":1394 * size_t itemsize, void *item, * bint dtype_is_object) noexcept nogil: * refcount_copying(dst, dtype_is_object, ndim, inc=False) # <<<<<<<<<<<<<< * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, itemsize, item) * refcount_copying(dst, dtype_is_object, ndim, inc=True) */ __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0); /* "View.MemoryView":1395 * bint dtype_is_object) noexcept nogil: * refcount_copying(dst, dtype_is_object, ndim, inc=False) * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, itemsize, item) # <<<<<<<<<<<<<< * refcount_copying(dst, dtype_is_object, ndim, inc=True) * */ __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item); /* "View.MemoryView":1396 * refcount_copying(dst, dtype_is_object, ndim, inc=False) * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, itemsize, item) * refcount_copying(dst, dtype_is_object, ndim, inc=True) # <<<<<<<<<<<<<< * * */ __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1); /* "View.MemoryView":1391 * * @cname('__pyx_memoryview_slice_assign_scalar') * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<< * size_t itemsize, void *item, * bint dtype_is_object) noexcept nogil: */ /* function exit code */ } /* "View.MemoryView":1400 * * @cname('__pyx_memoryview__slice_assign_scalar') * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< * Py_ssize_t *strides, int ndim, * size_t itemsize, void *item) noexcept nogil: */ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) { CYTHON_UNUSED Py_ssize_t __pyx_v_i; Py_ssize_t __pyx_v_stride; Py_ssize_t __pyx_v_extent; int __pyx_t_1; Py_ssize_t __pyx_t_2; Py_ssize_t __pyx_t_3; Py_ssize_t __pyx_t_4; /* "View.MemoryView":1404 * size_t itemsize, void *item) noexcept nogil: * cdef Py_ssize_t i * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<< * cdef Py_ssize_t extent = shape[0] * */ __pyx_v_stride = (__pyx_v_strides[0]); /* "View.MemoryView":1405 * cdef Py_ssize_t i * cdef Py_ssize_t stride = strides[0] * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<< * * if ndim == 1: */ __pyx_v_extent = (__pyx_v_shape[0]); /* "View.MemoryView":1407 * cdef Py_ssize_t extent = shape[0] * * if ndim == 1: # <<<<<<<<<<<<<< * for i in range(extent): * memcpy(data, item, itemsize) */ __pyx_t_1 = (__pyx_v_ndim == 1); if (__pyx_t_1) { /* "View.MemoryView":1408 * * if ndim == 1: * for i in range(extent): # <<<<<<<<<<<<<< * memcpy(data, item, itemsize) * data += stride */ __pyx_t_2 = __pyx_v_extent; __pyx_t_3 = __pyx_t_2; for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; /* "View.MemoryView":1409 * if ndim == 1: * for i in range(extent): * memcpy(data, item, itemsize) # <<<<<<<<<<<<<< * data += stride * else: */ (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize)); /* "View.MemoryView":1410 * for i in range(extent): * memcpy(data, item, itemsize) * data += stride # <<<<<<<<<<<<<< * else: * for i in range(extent): */ __pyx_v_data = (__pyx_v_data + __pyx_v_stride); } /* "View.MemoryView":1407 * cdef Py_ssize_t extent = shape[0] * * if ndim == 1: # <<<<<<<<<<<<<< * for i in range(extent): * memcpy(data, item, itemsize) */ goto __pyx_L3; } /* "View.MemoryView":1412 * data += stride * else: * for i in range(extent): # <<<<<<<<<<<<<< * _slice_assign_scalar(data, shape + 1, strides + 1, ndim - 1, itemsize, item) * data += stride */ /*else*/ { __pyx_t_2 = __pyx_v_extent; __pyx_t_3 = __pyx_t_2; for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; /* "View.MemoryView":1413 * else: * for i in range(extent): * _slice_assign_scalar(data, shape + 1, strides + 1, ndim - 1, itemsize, item) # <<<<<<<<<<<<<< * data += stride * */ __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item); /* "View.MemoryView":1414 * for i in range(extent): * _slice_assign_scalar(data, shape + 1, strides + 1, ndim - 1, itemsize, item) * data += stride # <<<<<<<<<<<<<< * * */ __pyx_v_data = (__pyx_v_data + __pyx_v_stride); } } __pyx_L3:; /* "View.MemoryView":1400 * * @cname('__pyx_memoryview__slice_assign_scalar') * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< * Py_ssize_t *strides, int ndim, * size_t itemsize, void *item) noexcept nogil: */ /* function exit code */ } /* "(tree fragment)":1 * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ /* Python wrapper */ static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {"__pyx_unpickle_Enum", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v___pyx_type = 0; long __pyx_v___pyx_checksum; PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_unpickle_Enum (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(13, 1, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_checksum)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(13, 1, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(13, 1, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(13, 1, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(13, 1, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__pyx_unpickle_Enum") < 0)) __PYX_ERR(13, 1, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v___pyx_type = values[0]; __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(13, 1, __pyx_L3_error) __pyx_v___pyx_state = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, __pyx_nargs); __PYX_ERR(13, 1, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_v___pyx_PickleError = 0; PyObject *__pyx_v___pyx_result = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 1); /* "(tree fragment)":4 * cdef object __pyx_PickleError * cdef object __pyx_result * if __pyx_checksum not in (0x82a3537, 0x6ae9995, 0xb068931): # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum */ __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__8, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(13, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "(tree fragment)":5 * cdef object __pyx_result * if __pyx_checksum not in (0x82a3537, 0x6ae9995, 0xb068931): * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<< * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum * __pyx_result = Enum.__new__(__pyx_type) */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_PickleError); __Pyx_GIVEREF(__pyx_n_s_PickleError); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError)) __PYX_ERR(13, 5, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_1); __pyx_v___pyx_PickleError = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":6 * if __pyx_checksum not in (0x82a3537, 0x6ae9995, 0xb068931): * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum # <<<<<<<<<<<<<< * __pyx_result = Enum.__new__(__pyx_type) * if __pyx_state is not None: */ __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_v___pyx_PickleError, __pyx_t_1, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(13, 6, __pyx_L1_error) /* "(tree fragment)":4 * cdef object __pyx_PickleError * cdef object __pyx_result * if __pyx_checksum not in (0x82a3537, 0x6ae9995, 0xb068931): # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum */ } /* "(tree fragment)":7 * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum * __pyx_result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<< * if __pyx_state is not None: * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v___pyx_type}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v___pyx_result = __pyx_t_1; __pyx_t_1 = 0; /* "(tree fragment)":8 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum * __pyx_result = Enum.__new__(__pyx_type) * if __pyx_state is not None: # <<<<<<<<<<<<<< * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) * return __pyx_result */ __pyx_t_2 = (__pyx_v___pyx_state != Py_None); if (__pyx_t_2) { /* "(tree fragment)":9 * __pyx_result = Enum.__new__(__pyx_type) * if __pyx_state is not None: * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) # <<<<<<<<<<<<<< * return __pyx_result * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): */ if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(13, 9, __pyx_L1_error) __pyx_t_1 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":8 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum * __pyx_result = Enum.__new__(__pyx_type) * if __pyx_state is not None: # <<<<<<<<<<<<<< * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) * return __pyx_result */ } /* "(tree fragment)":10 * if __pyx_state is not None: * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) * return __pyx_result # <<<<<<<<<<<<<< * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): * __pyx_result.name = __pyx_state[0] */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v___pyx_result); __pyx_r = __pyx_v___pyx_result; goto __pyx_L0; /* "(tree fragment)":1 * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v___pyx_PickleError); __Pyx_XDECREF(__pyx_v___pyx_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":11 * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) * return __pyx_result * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< * __pyx_result.name = __pyx_state[0] * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): */ static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; Py_ssize_t __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 1); /* "(tree fragment)":12 * return __pyx_result * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): * __pyx_result.name = __pyx_state[0] # <<<<<<<<<<<<<< * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): * __pyx_result.__dict__.update(__pyx_state[1]) */ if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(13, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->name); __Pyx_DECREF(__pyx_v___pyx_result->name); __pyx_v___pyx_result->name = __pyx_t_1; __pyx_t_1 = 0; /* "(tree fragment)":13 * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): * __pyx_result.name = __pyx_state[0] * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< * __pyx_result.__dict__.update(__pyx_state[1]) */ if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(13, 13, __pyx_L1_error) } __pyx_t_3 = __Pyx_PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(13, 13, __pyx_L1_error) __pyx_t_4 = (__pyx_t_3 > 1); if (__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(13, 13, __pyx_L1_error) __pyx_t_2 = __pyx_t_4; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { /* "(tree fragment)":14 * __pyx_result.name = __pyx_state[0] * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<< */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_update); if (unlikely(!__pyx_t_6)) __PYX_ERR(13, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(13, 14, __pyx_L1_error) } __pyx_t_5 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_5}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":13 * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): * __pyx_result.name = __pyx_state[0] * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< * __pyx_result.__dict__.update(__pyx_state[1]) */ } /* "(tree fragment)":11 * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) * return __pyx_result * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< * __pyx_result.name = __pyx_state[0] * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "BufferFormatFromTypeInfo":1450 * * @cname('__pyx_format_from_typeinfo') * cdef bytes format_from_typeinfo(__Pyx_TypeInfo *type): # <<<<<<<<<<<<<< * cdef __Pyx_StructField *field * cdef __pyx_typeinfo_string fmt */ static PyObject *__pyx_format_from_typeinfo(__Pyx_TypeInfo *__pyx_v_type) { __Pyx_StructField *__pyx_v_field; struct __pyx_typeinfo_string __pyx_v_fmt; PyObject *__pyx_v_part = 0; PyObject *__pyx_v_result = 0; PyObject *__pyx_v_alignment = NULL; PyObject *__pyx_v_parts = NULL; PyObject *__pyx_v_extents = NULL; Py_ssize_t __pyx_7genexpr__pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; __Pyx_StructField *__pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_t_7; int __pyx_t_8; Py_ssize_t __pyx_t_9; Py_UCS4 __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("format_from_typeinfo", 1); /* "BufferFormatFromTypeInfo":1456 * cdef Py_ssize_t i * * if type.typegroup == 'S': # <<<<<<<<<<<<<< * assert type.fields != NULL * assert type.fields.type != NULL */ __pyx_t_1 = (__pyx_v_type->typegroup == 'S'); if (__pyx_t_1) { /* "BufferFormatFromTypeInfo":1457 * * if type.typegroup == 'S': * assert type.fields != NULL # <<<<<<<<<<<<<< * assert type.fields.type != NULL * */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_1 = (__pyx_v_type->fields != NULL); if (unlikely(!__pyx_t_1)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(13, 1457, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(13, 1457, __pyx_L1_error) #endif /* "BufferFormatFromTypeInfo":1458 * if type.typegroup == 'S': * assert type.fields != NULL * assert type.fields.type != NULL # <<<<<<<<<<<<<< * * if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT: */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_1 = (__pyx_v_type->fields->type != NULL); if (unlikely(!__pyx_t_1)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(13, 1458, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(13, 1458, __pyx_L1_error) #endif /* "BufferFormatFromTypeInfo":1460 * assert type.fields.type != NULL * * if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT: # <<<<<<<<<<<<<< * alignment = b'^' * else: */ __pyx_t_1 = ((__pyx_v_type->flags & __PYX_BUF_FLAGS_PACKED_STRUCT) != 0); if (__pyx_t_1) { /* "BufferFormatFromTypeInfo":1461 * * if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT: * alignment = b'^' # <<<<<<<<<<<<<< * else: * alignment = b'' */ __Pyx_INCREF(__pyx_kp_b__9); __pyx_v_alignment = __pyx_kp_b__9; /* "BufferFormatFromTypeInfo":1460 * assert type.fields.type != NULL * * if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT: # <<<<<<<<<<<<<< * alignment = b'^' * else: */ goto __pyx_L4; } /* "BufferFormatFromTypeInfo":1463 * alignment = b'^' * else: * alignment = b'' # <<<<<<<<<<<<<< * * parts = [b"T{"] */ /*else*/ { __Pyx_INCREF(__pyx_kp_b__10); __pyx_v_alignment = __pyx_kp_b__10; } __pyx_L4:; /* "BufferFormatFromTypeInfo":1465 * alignment = b'' * * parts = [b"T{"] # <<<<<<<<<<<<<< * field = type.fields * */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 1465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_kp_b_T); __Pyx_GIVEREF(__pyx_kp_b_T); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_kp_b_T)) __PYX_ERR(13, 1465, __pyx_L1_error); __pyx_v_parts = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "BufferFormatFromTypeInfo":1466 * * parts = [b"T{"] * field = type.fields # <<<<<<<<<<<<<< * * while field.type: */ __pyx_t_3 = __pyx_v_type->fields; __pyx_v_field = __pyx_t_3; /* "BufferFormatFromTypeInfo":1468 * field = type.fields * * while field.type: # <<<<<<<<<<<<<< * part = format_from_typeinfo(field.type) * parts.append(part + b':' + field.name + b':') */ while (1) { __pyx_t_1 = (__pyx_v_field->type != 0); if (!__pyx_t_1) break; /* "BufferFormatFromTypeInfo":1469 * * while field.type: * part = format_from_typeinfo(field.type) # <<<<<<<<<<<<<< * parts.append(part + b':' + field.name + b':') * field += 1 */ __pyx_t_2 = __pyx_format_from_typeinfo(__pyx_v_field->type); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 1469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_part, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; /* "BufferFormatFromTypeInfo":1470 * while field.type: * part = format_from_typeinfo(field.type) * parts.append(part + b':' + field.name + b':') # <<<<<<<<<<<<<< * field += 1 * */ __pyx_t_2 = PyNumber_Add(__pyx_v_part, __pyx_kp_b__11); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 1470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_field->name); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 1470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyNumber_Add(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 1470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_kp_b__11); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 1470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_parts, __pyx_t_4); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(13, 1470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "BufferFormatFromTypeInfo":1471 * part = format_from_typeinfo(field.type) * parts.append(part + b':' + field.name + b':') * field += 1 # <<<<<<<<<<<<<< * * result = alignment.join(parts) + b'}' */ __pyx_v_field = (__pyx_v_field + 1); } /* "BufferFormatFromTypeInfo":1473 * field += 1 * * result = alignment.join(parts) + b'}' # <<<<<<<<<<<<<< * else: * fmt = __Pyx_TypeInfoToFormat(type) */ __pyx_t_4 = __Pyx_PyBytes_Join(__pyx_v_alignment, __pyx_v_parts); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 1473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_kp_b__12); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 1473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!(likely(PyBytes_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_5))) __PYX_ERR(13, 1473, __pyx_L1_error) __pyx_v_result = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; /* "BufferFormatFromTypeInfo":1456 * cdef Py_ssize_t i * * if type.typegroup == 'S': # <<<<<<<<<<<<<< * assert type.fields != NULL * assert type.fields.type != NULL */ goto __pyx_L3; } /* "BufferFormatFromTypeInfo":1475 * result = alignment.join(parts) + b'}' * else: * fmt = __Pyx_TypeInfoToFormat(type) # <<<<<<<<<<<<<< * result = fmt.string * if type.arraysize[0]: */ /*else*/ { __pyx_v_fmt = __Pyx_TypeInfoToFormat(__pyx_v_type); /* "BufferFormatFromTypeInfo":1476 * else: * fmt = __Pyx_TypeInfoToFormat(type) * result = fmt.string # <<<<<<<<<<<<<< * if type.arraysize[0]: * extents = [f"{type.arraysize[i]}" for i in range(type.ndim)] */ __pyx_t_5 = __Pyx_PyObject_FromString(__pyx_v_fmt.string); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 1476, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_v_result = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; /* "BufferFormatFromTypeInfo":1477 * fmt = __Pyx_TypeInfoToFormat(type) * result = fmt.string * if type.arraysize[0]: # <<<<<<<<<<<<<< * extents = [f"{type.arraysize[i]}" for i in range(type.ndim)] * result = f"({u','.join(extents)})".encode('ascii') + result */ __pyx_t_1 = ((__pyx_v_type->arraysize[0]) != 0); if (__pyx_t_1) { /* "BufferFormatFromTypeInfo":1478 * result = fmt.string * if type.arraysize[0]: * extents = [f"{type.arraysize[i]}" for i in range(type.ndim)] # <<<<<<<<<<<<<< * result = f"({u','.join(extents)})".encode('ascii') + result * */ { /* enter inner scope */ __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 1478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = __pyx_v_type->ndim; __pyx_t_8 = __pyx_t_7; for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) { __pyx_7genexpr__pyx_v_i = __pyx_t_9; __pyx_t_4 = __Pyx_PyUnicode_From_size_t((__pyx_v_type->arraysize[__pyx_7genexpr__pyx_v_i]), 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 1478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_4))) __PYX_ERR(13, 1478, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } } /* exit inner scope */ __pyx_v_extents = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; /* "BufferFormatFromTypeInfo":1479 * if type.arraysize[0]: * extents = [f"{type.arraysize[i]}" for i in range(type.ndim)] * result = f"({u','.join(extents)})".encode('ascii') + result # <<<<<<<<<<<<<< * * return result */ __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 1479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_9 = 0; __pyx_t_10 = 127; __Pyx_INCREF(__pyx_kp_u__13); __pyx_t_9 += 1; __Pyx_GIVEREF(__pyx_kp_u__13); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_u__13); __pyx_t_4 = PyUnicode_Join(__pyx_kp_u__14, __pyx_v_extents); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 1479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_10 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_10) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_10; __pyx_t_9 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); __pyx_t_4 = 0; __Pyx_INCREF(__pyx_kp_u__7); __pyx_t_9 += 1; __Pyx_GIVEREF(__pyx_kp_u__7); PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_kp_u__7); __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_5, 3, __pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 1479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyUnicode_AsASCIIString(((PyObject*)__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 1479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 1479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (!(likely(PyBytes_CheckExact(__pyx_t_4)) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_4))) __PYX_ERR(13, 1479, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0; /* "BufferFormatFromTypeInfo":1477 * fmt = __Pyx_TypeInfoToFormat(type) * result = fmt.string * if type.arraysize[0]: # <<<<<<<<<<<<<< * extents = [f"{type.arraysize[i]}" for i in range(type.ndim)] * result = f"({u','.join(extents)})".encode('ascii') + result */ } } __pyx_L3:; /* "BufferFormatFromTypeInfo":1481 * result = f"({u','.join(extents)})".encode('ascii') + result * * return result # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_result); __pyx_r = __pyx_v_result; goto __pyx_L0; /* "BufferFormatFromTypeInfo":1450 * * @cname('__pyx_format_from_typeinfo') * cdef bytes format_from_typeinfo(__Pyx_TypeInfo *type): # <<<<<<<<<<<<<< * cdef __Pyx_StructField *field * cdef __pyx_typeinfo_string fmt */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("BufferFormatFromTypeInfo.format_from_typeinfo", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_part); __Pyx_XDECREF(__pyx_v_result); __Pyx_XDECREF(__pyx_v_alignment); __Pyx_XDECREF(__pyx_v_parts); __Pyx_XDECREF(__pyx_v_extents); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PETSc.pyx":30 * # -------------------------------------------------------------------- * * cdef inline object bytes2str(const char p[]): # <<<<<<<<<<<<<< * if p == NULL: * return None */ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_bytes2str(char const *__pyx_v_p) { PyObject *__pyx_v_s = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("bytes2str", 1); /* "petsc4py/PETSc/PETSc.pyx":31 * * cdef inline object bytes2str(const char p[]): * if p == NULL: # <<<<<<<<<<<<<< * return None * cdef bytes s = p */ __pyx_t_1 = (__pyx_v_p == NULL); if (__pyx_t_1) { /* "petsc4py/PETSc/PETSc.pyx":32 * cdef inline object bytes2str(const char p[]): * if p == NULL: * return None # <<<<<<<<<<<<<< * cdef bytes s = p * if isinstance(s, str): */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "petsc4py/PETSc/PETSc.pyx":31 * * cdef inline object bytes2str(const char p[]): * if p == NULL: # <<<<<<<<<<<<<< * return None * cdef bytes s = p */ } /* "petsc4py/PETSc/PETSc.pyx":33 * if p == NULL: * return None * cdef bytes s = p # <<<<<<<<<<<<<< * if isinstance(s, str): * return s */ __pyx_t_2 = __Pyx_PyBytes_FromString(((char *)__pyx_v_p)); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_s = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/PETSc.pyx":34 * return None * cdef bytes s = p * if isinstance(s, str): # <<<<<<<<<<<<<< * return s * else: */ __pyx_t_1 = PyString_Check(__pyx_v_s); if (__pyx_t_1) { /* "petsc4py/PETSc/PETSc.pyx":35 * cdef bytes s = p * if isinstance(s, str): * return s # <<<<<<<<<<<<<< * else: * return s.decode() */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_s); __pyx_r = __pyx_v_s; goto __pyx_L0; /* "petsc4py/PETSc/PETSc.pyx":34 * return None * cdef bytes s = p * if isinstance(s, str): # <<<<<<<<<<<<<< * return s * else: */ } /* "petsc4py/PETSc/PETSc.pyx":37 * return s * else: * return s.decode() # <<<<<<<<<<<<<< * * cdef inline object str2bytes(object s, const char *p[]): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_decode_bytes(__pyx_v_s, 0, PY_SSIZE_T_MAX, NULL, NULL, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; } /* "petsc4py/PETSc/PETSc.pyx":30 * # -------------------------------------------------------------------- * * cdef inline object bytes2str(const char p[]): # <<<<<<<<<<<<<< * if p == NULL: * return None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.bytes2str", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_s); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PETSc.pyx":39 * return s.decode() * * cdef inline object str2bytes(object s, const char *p[]): # <<<<<<<<<<<<<< * if s is None: * p[0] = NULL */ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_str2bytes(PyObject *__pyx_v_s, char const **__pyx_v_p) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; char *__pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("str2bytes", 0); __Pyx_INCREF(__pyx_v_s); /* "petsc4py/PETSc/PETSc.pyx":40 * * cdef inline object str2bytes(object s, const char *p[]): * if s is None: # <<<<<<<<<<<<<< * p[0] = NULL * return None */ __pyx_t_1 = (__pyx_v_s == Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/PETSc.pyx":41 * cdef inline object str2bytes(object s, const char *p[]): * if s is None: * p[0] = NULL # <<<<<<<<<<<<<< * return None * if not isinstance(s, bytes): */ (__pyx_v_p[0]) = NULL; /* "petsc4py/PETSc/PETSc.pyx":42 * if s is None: * p[0] = NULL * return None # <<<<<<<<<<<<<< * if not isinstance(s, bytes): * s = s.encode() */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "petsc4py/PETSc/PETSc.pyx":40 * * cdef inline object str2bytes(object s, const char *p[]): * if s is None: # <<<<<<<<<<<<<< * p[0] = NULL * return None */ } /* "petsc4py/PETSc/PETSc.pyx":43 * p[0] = NULL * return None * if not isinstance(s, bytes): # <<<<<<<<<<<<<< * s = s.encode() * p[0] = (s) */ __pyx_t_1 = PyBytes_Check(__pyx_v_s); __pyx_t_2 = (!__pyx_t_1); if (__pyx_t_2) { /* "petsc4py/PETSc/PETSc.pyx":44 * return None * if not isinstance(s, bytes): * s = s.encode() # <<<<<<<<<<<<<< * p[0] = (s) * return s */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF_SET(__pyx_v_s, __pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/PETSc.pyx":43 * p[0] = NULL * return None * if not isinstance(s, bytes): # <<<<<<<<<<<<<< * s = s.encode() * p[0] = (s) */ } /* "petsc4py/PETSc/PETSc.pyx":45 * if not isinstance(s, bytes): * s = s.encode() * p[0] = (s) # <<<<<<<<<<<<<< * return s * */ __pyx_t_7 = __Pyx_PyObject_AsWritableString(__pyx_v_s); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(12, 45, __pyx_L1_error) (__pyx_v_p[0]) = ((char const *)((char *)__pyx_t_7)); /* "petsc4py/PETSc/PETSc.pyx":46 * s = s.encode() * p[0] = (s) * return s # <<<<<<<<<<<<<< * * cdef inline object S_(const char p[]): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_s); __pyx_r = __pyx_v_s; goto __pyx_L0; /* "petsc4py/PETSc/PETSc.pyx":39 * return s.decode() * * cdef inline object str2bytes(object s, const char *p[]): # <<<<<<<<<<<<<< * if s is None: * p[0] = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.str2bytes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_s); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PETSc.pyx":48 * return s * * cdef inline object S_(const char p[]): # <<<<<<<<<<<<<< * if p == NULL: return None * cdef object s = p */ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_S_(char const *__pyx_v_p) { PyObject *__pyx_v_s = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("S_", 1); /* "petsc4py/PETSc/PETSc.pyx":49 * * cdef inline object S_(const char p[]): * if p == NULL: return None # <<<<<<<<<<<<<< * cdef object s = p * return s if isinstance(s, str) else s.decode() */ __pyx_t_1 = (__pyx_v_p == NULL); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } /* "petsc4py/PETSc/PETSc.pyx":50 * cdef inline object S_(const char p[]): * if p == NULL: return None * cdef object s = p # <<<<<<<<<<<<<< * return s if isinstance(s, str) else s.decode() * */ __pyx_t_2 = __Pyx_PyBytes_FromString(((char *)__pyx_v_p)); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_s = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/PETSc.pyx":51 * if p == NULL: return None * cdef object s = p * return s if isinstance(s, str) else s.decode() # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyString_Check(__pyx_v_s); if (__pyx_t_1) { __Pyx_INCREF(__pyx_v_s); __pyx_t_2 = __pyx_v_s; } else { __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_decode); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_t_2 = __pyx_t_3; __pyx_t_3 = 0; } __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/PETSc.pyx":48 * return s * * cdef inline object S_(const char p[]): # <<<<<<<<<<<<<< * if p == NULL: return None * cdef object s = p */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.S_", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_s); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PETSc.pyx":67 * cdef object PetscError = PyExc_RuntimeError * * cdef inline int SETERR(PetscErrorCode ierr) except -1 nogil: # <<<<<<<<<<<<<< * if (PetscError) != NULL: * with gil: PyErr_SetObject(PetscError, ierr) */ static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_SETERR(PetscErrorCode __pyx_v_ierr) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save; #endif __Pyx_RefNannySetupContext("SETERR", 1); /* "petsc4py/PETSc/PETSc.pyx":68 * * cdef inline int SETERR(PetscErrorCode ierr) except -1 nogil: * if (PetscError) != NULL: # <<<<<<<<<<<<<< * with gil: PyErr_SetObject(PetscError, ierr) * else: */ __pyx_t_1 = (((void *)__pyx_v_8petsc4py_5PETSc_PetscError) != NULL); if (__pyx_t_1) { /* "petsc4py/PETSc/PETSc.pyx":69 * cdef inline int SETERR(PetscErrorCode ierr) except -1 nogil: * if (PetscError) != NULL: * with gil: PyErr_SetObject(PetscError, ierr) # <<<<<<<<<<<<<< * else: * with gil: PyErr_SetObject(PyExc_RuntimeError, ierr) */ { #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif /*try:*/ { __pyx_t_2 = __pyx_v_8petsc4py_5PETSc_PetscError; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_long(((long)__pyx_v_ierr)); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 69, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_3); PyErr_SetObject(__pyx_t_2, __pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif goto __pyx_L6; } __pyx_L5_error: { #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif goto __pyx_L1_error; } __pyx_L6:; } } /* "petsc4py/PETSc/PETSc.pyx":68 * * cdef inline int SETERR(PetscErrorCode ierr) except -1 nogil: * if (PetscError) != NULL: # <<<<<<<<<<<<<< * with gil: PyErr_SetObject(PetscError, ierr) * else: */ goto __pyx_L3; } /* "petsc4py/PETSc/PETSc.pyx":71 * with gil: PyErr_SetObject(PetscError, ierr) * else: * with gil: PyErr_SetObject(PyExc_RuntimeError, ierr) # <<<<<<<<<<<<<< * return 0 * */ /*else*/ { { #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif /*try:*/ { __pyx_t_3 = ((PyObject *)PyExc_RuntimeError); __Pyx_INCREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyInt_From_long(((long)__pyx_v_ierr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 71, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); PyErr_SetObject(__pyx_t_3, __pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif goto __pyx_L9; } __pyx_L8_error: { #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif goto __pyx_L1_error; } __pyx_L9:; } } } __pyx_L3:; /* "petsc4py/PETSc/PETSc.pyx":72 * else: * with gil: PyErr_SetObject(PyExc_RuntimeError, ierr) * return 0 # <<<<<<<<<<<<<< * * cdef inline PetscErrorCode CHKERR(PetscErrorCode ierr) except PETSC_ERR_PYTHON nogil: */ __pyx_r = 0; goto __pyx_L0; /* "petsc4py/PETSc/PETSc.pyx":67 * cdef object PetscError = PyExc_RuntimeError * * cdef inline int SETERR(PetscErrorCode ierr) except -1 nogil: # <<<<<<<<<<<<<< * if (PetscError) != NULL: * with gil: PyErr_SetObject(PetscError, ierr) */ /* function exit code */ __pyx_L1_error:; #ifdef WITH_THREAD __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SETERR", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif __pyx_L0:; __Pyx_RefNannyFinishContextNogil() return __pyx_r; } /* "petsc4py/PETSc/PETSc.pyx":74 * return 0 * * cdef inline PetscErrorCode CHKERR(PetscErrorCode ierr) except PETSC_ERR_PYTHON nogil: # <<<<<<<<<<<<<< * if ierr == PETSC_SUCCESS: * return ierr # no error */ static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_CHKERR(PetscErrorCode __pyx_v_ierr) { PetscErrorCode __pyx_r; int __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save; #endif /* "petsc4py/PETSc/PETSc.pyx":75 * * cdef inline PetscErrorCode CHKERR(PetscErrorCode ierr) except PETSC_ERR_PYTHON nogil: * if ierr == PETSC_SUCCESS: # <<<<<<<<<<<<<< * return ierr # no error * if ierr == PETSC_ERR_PYTHON: */ __pyx_t_1 = (__pyx_v_ierr == PETSC_SUCCESS); if (__pyx_t_1) { /* "petsc4py/PETSc/PETSc.pyx":76 * cdef inline PetscErrorCode CHKERR(PetscErrorCode ierr) except PETSC_ERR_PYTHON nogil: * if ierr == PETSC_SUCCESS: * return ierr # no error # <<<<<<<<<<<<<< * if ierr == PETSC_ERR_PYTHON: * return ierr # error in python code */ __pyx_r = __pyx_v_ierr; goto __pyx_L0; /* "petsc4py/PETSc/PETSc.pyx":75 * * cdef inline PetscErrorCode CHKERR(PetscErrorCode ierr) except PETSC_ERR_PYTHON nogil: * if ierr == PETSC_SUCCESS: # <<<<<<<<<<<<<< * return ierr # no error * if ierr == PETSC_ERR_PYTHON: */ } /* "petsc4py/PETSc/PETSc.pyx":77 * if ierr == PETSC_SUCCESS: * return ierr # no error * if ierr == PETSC_ERR_PYTHON: # <<<<<<<<<<<<<< * return ierr # error in python code * SETERR(ierr) */ __pyx_t_1 = (__pyx_v_ierr == PETSC_ERR_PYTHON); if (__pyx_t_1) { /* "petsc4py/PETSc/PETSc.pyx":78 * return ierr # no error * if ierr == PETSC_ERR_PYTHON: * return ierr # error in python code # <<<<<<<<<<<<<< * SETERR(ierr) * return PETSC_ERR_PYTHON */ __pyx_r = __pyx_v_ierr; goto __pyx_L0; /* "petsc4py/PETSc/PETSc.pyx":77 * if ierr == PETSC_SUCCESS: * return ierr # no error * if ierr == PETSC_ERR_PYTHON: # <<<<<<<<<<<<<< * return ierr # error in python code * SETERR(ierr) */ } /* "petsc4py/PETSc/PETSc.pyx":79 * if ierr == PETSC_ERR_PYTHON: * return ierr # error in python code * SETERR(ierr) # <<<<<<<<<<<<<< * return PETSC_ERR_PYTHON * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_SETERR(__pyx_v_ierr); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(12, 79, __pyx_L1_error) ((void)__pyx_t_2); /* "petsc4py/PETSc/PETSc.pyx":80 * return ierr # error in python code * SETERR(ierr) * return PETSC_ERR_PYTHON # <<<<<<<<<<<<<< * * # SETERRMPI Support */ __pyx_r = PETSC_ERR_PYTHON; goto __pyx_L0; /* "petsc4py/PETSc/PETSc.pyx":74 * return 0 * * cdef inline PetscErrorCode CHKERR(PetscErrorCode ierr) except PETSC_ERR_PYTHON nogil: # <<<<<<<<<<<<<< * if ierr == PETSC_SUCCESS: * return ierr # no error */ /* function exit code */ __pyx_L1_error:; #ifdef WITH_THREAD __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_AddTraceback("petsc4py.PETSc.CHKERR", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/PETSc.pyx":92 * PetscErrorCode PetscERROR(MPI_Comm, char[], PetscErrorCode, int, char[], char[]) * * cdef inline int SETERRMPI(int ierr) except -1 nogil: # <<<<<<<<<<<<<< * cdef char mpi_err_str[MPI_MAX_ERROR_STRING] * cdef int result_len = sizeof(mpi_err_str) */ static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_SETERRMPI(int __pyx_v_ierr) { char __pyx_v_mpi_err_str[MPI_MAX_ERROR_STRING]; int __pyx_v_result_len; char __pyx_v_error_str[(MPI_MAX_ERROR_STRING + 64)]; int __pyx_r; int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save; #endif /* "petsc4py/PETSc/PETSc.pyx":94 * cdef inline int SETERRMPI(int ierr) except -1 nogil: * cdef char mpi_err_str[MPI_MAX_ERROR_STRING] * cdef int result_len = sizeof(mpi_err_str) # <<<<<<<<<<<<<< * * memset(mpi_err_str, 0, result_len) */ __pyx_v_result_len = ((int)(sizeof(__pyx_v_mpi_err_str))); /* "petsc4py/PETSc/PETSc.pyx":96 * cdef int result_len = sizeof(mpi_err_str) * * memset(mpi_err_str, 0, result_len) # <<<<<<<<<<<<<< * MPI_Error_string(ierr, mpi_err_str, &result_len); * result_len */ ((void)memset(__pyx_v_mpi_err_str, 0, __pyx_v_result_len)); /* "petsc4py/PETSc/PETSc.pyx":97 * * memset(mpi_err_str, 0, result_len) * MPI_Error_string(ierr, mpi_err_str, &result_len); # <<<<<<<<<<<<<< * result_len * */ ((void)MPI_Error_string(__pyx_v_ierr, __pyx_v_mpi_err_str, (&__pyx_v_result_len))); /* "petsc4py/PETSc/PETSc.pyx":98 * memset(mpi_err_str, 0, result_len) * MPI_Error_string(ierr, mpi_err_str, &result_len); * result_len # <<<<<<<<<<<<<< * * cdef char error_str[MPI_MAX_ERROR_STRING+64] */ ((void)__pyx_v_result_len); /* "petsc4py/PETSc/PETSc.pyx":101 * * cdef char error_str[MPI_MAX_ERROR_STRING+64] * PetscSNPrintf(error_str, sizeof(error_str), b"MPI Error %s %d", mpi_err_str, ierr) # <<<<<<<<<<<<<< * * PetscERROR(PETSC_COMM_SELF, "Unknown Python Function", PETSC_ERR_MPI, PETSC_ERROR_INITIAL, "%s", error_str) */ ((void)PetscSNPrintf(__pyx_v_error_str, (sizeof(__pyx_v_error_str)), ((char *)"MPI Error %s %d"), __pyx_v_mpi_err_str, __pyx_v_ierr)); /* "petsc4py/PETSc/PETSc.pyx":103 * PetscSNPrintf(error_str, sizeof(error_str), b"MPI Error %s %d", mpi_err_str, ierr) * * PetscERROR(PETSC_COMM_SELF, "Unknown Python Function", PETSC_ERR_MPI, PETSC_ERROR_INITIAL, "%s", error_str) # <<<<<<<<<<<<<< * SETERR(PETSC_ERR_MPI) * return ierr */ ((void)PetscERROR(PETSC_COMM_SELF, ((char *)"Unknown Python Function"), PETSC_ERR_MPI, PETSC_ERROR_INITIAL, ((char *)"%s"), __pyx_v_error_str)); /* "petsc4py/PETSc/PETSc.pyx":104 * * PetscERROR(PETSC_COMM_SELF, "Unknown Python Function", PETSC_ERR_MPI, PETSC_ERROR_INITIAL, "%s", error_str) * SETERR(PETSC_ERR_MPI) # <<<<<<<<<<<<<< * return ierr * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_SETERR(PETSC_ERR_MPI); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(12, 104, __pyx_L1_error) ((void)__pyx_t_1); /* "petsc4py/PETSc/PETSc.pyx":105 * PetscERROR(PETSC_COMM_SELF, "Unknown Python Function", PETSC_ERR_MPI, PETSC_ERROR_INITIAL, "%s", error_str) * SETERR(PETSC_ERR_MPI) * return ierr # <<<<<<<<<<<<<< * * cdef inline PetscErrorCode CHKERRMPI(int ierr) except PETSC_ERR_PYTHON nogil: */ __pyx_r = __pyx_v_ierr; goto __pyx_L0; /* "petsc4py/PETSc/PETSc.pyx":92 * PetscErrorCode PetscERROR(MPI_Comm, char[], PetscErrorCode, int, char[], char[]) * * cdef inline int SETERRMPI(int ierr) except -1 nogil: # <<<<<<<<<<<<<< * cdef char mpi_err_str[MPI_MAX_ERROR_STRING] * cdef int result_len = sizeof(mpi_err_str) */ /* function exit code */ __pyx_L1_error:; #ifdef WITH_THREAD __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_AddTraceback("petsc4py.PETSc.SETERRMPI", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/PETSc.pyx":107 * return ierr * * cdef inline PetscErrorCode CHKERRMPI(int ierr) except PETSC_ERR_PYTHON nogil: # <<<<<<<<<<<<<< * if ierr == MPI_SUCCESS: * return PETSC_SUCCESS */ static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_CHKERRMPI(int __pyx_v_ierr) { PetscErrorCode __pyx_r; int __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save; #endif /* "petsc4py/PETSc/PETSc.pyx":108 * * cdef inline PetscErrorCode CHKERRMPI(int ierr) except PETSC_ERR_PYTHON nogil: * if ierr == MPI_SUCCESS: # <<<<<<<<<<<<<< * return PETSC_SUCCESS * SETERRMPI(ierr) */ __pyx_t_1 = (__pyx_v_ierr == MPI_SUCCESS); if (__pyx_t_1) { /* "petsc4py/PETSc/PETSc.pyx":109 * cdef inline PetscErrorCode CHKERRMPI(int ierr) except PETSC_ERR_PYTHON nogil: * if ierr == MPI_SUCCESS: * return PETSC_SUCCESS # <<<<<<<<<<<<<< * SETERRMPI(ierr) * return PETSC_ERR_PYTHON */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/PETSc.pyx":108 * * cdef inline PetscErrorCode CHKERRMPI(int ierr) except PETSC_ERR_PYTHON nogil: * if ierr == MPI_SUCCESS: # <<<<<<<<<<<<<< * return PETSC_SUCCESS * SETERRMPI(ierr) */ } /* "petsc4py/PETSc/PETSc.pyx":110 * if ierr == MPI_SUCCESS: * return PETSC_SUCCESS * SETERRMPI(ierr) # <<<<<<<<<<<<<< * return PETSC_ERR_PYTHON * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_SETERRMPI(__pyx_v_ierr); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(12, 110, __pyx_L1_error) ((void)__pyx_t_2); /* "petsc4py/PETSc/PETSc.pyx":111 * return PETSC_SUCCESS * SETERRMPI(ierr) * return PETSC_ERR_PYTHON # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_r = PETSC_ERR_PYTHON; goto __pyx_L0; /* "petsc4py/PETSc/PETSc.pyx":107 * return ierr * * cdef inline PetscErrorCode CHKERRMPI(int ierr) except PETSC_ERR_PYTHON nogil: # <<<<<<<<<<<<<< * if ierr == MPI_SUCCESS: * return PETSC_SUCCESS */ /* function exit code */ __pyx_L1_error:; #ifdef WITH_THREAD __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_AddTraceback("petsc4py.PETSc.CHKERRMPI", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/PETSc.pyx":131 * void PyPetscBuffer_Release(Py_buffer*) * * cdef inline object toBool(PetscBool value): # <<<<<<<<<<<<<< * return True if value else False * cdef inline PetscBool asBool(object value) except? 0: */ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toBool(PetscBool __pyx_v_value) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("toBool", 1); /* "petsc4py/PETSc/PETSc.pyx":132 * * cdef inline object toBool(PetscBool value): * return True if value else False # <<<<<<<<<<<<<< * cdef inline PetscBool asBool(object value) except? 0: * return PETSC_TRUE if value else PETSC_FALSE */ __Pyx_XDECREF(__pyx_r); if (__pyx_v_value) { __Pyx_INCREF(Py_True); __pyx_t_1 = Py_True; } else { __Pyx_INCREF(Py_False); __pyx_t_1 = Py_False; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/PETSc.pyx":131 * void PyPetscBuffer_Release(Py_buffer*) * * cdef inline object toBool(PetscBool value): # <<<<<<<<<<<<<< * return True if value else False * cdef inline PetscBool asBool(object value) except? 0: */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PETSc.pyx":133 * cdef inline object toBool(PetscBool value): * return True if value else False * cdef inline PetscBool asBool(object value) except? 0: # <<<<<<<<<<<<<< * return PETSC_TRUE if value else PETSC_FALSE * */ static CYTHON_INLINE PetscBool __pyx_f_8petsc4py_5PETSc_asBool(PyObject *__pyx_v_value) { PetscBool __pyx_r; PetscBool __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "petsc4py/PETSc/PETSc.pyx":134 * return True if value else False * cdef inline PetscBool asBool(object value) except? 0: * return PETSC_TRUE if value else PETSC_FALSE # <<<<<<<<<<<<<< * * cdef inline object toInt(PetscInt value): */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(12, 134, __pyx_L1_error) if (__pyx_t_2) { __pyx_t_1 = PETSC_TRUE; } else { __pyx_t_1 = PETSC_FALSE; } __pyx_r = __pyx_t_1; goto __pyx_L0; /* "petsc4py/PETSc/PETSc.pyx":133 * cdef inline object toBool(PetscBool value): * return True if value else False * cdef inline PetscBool asBool(object value) except? 0: # <<<<<<<<<<<<<< * return PETSC_TRUE if value else PETSC_FALSE * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.asBool", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = ((PetscBool)0); __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/PETSc.pyx":136 * return PETSC_TRUE if value else PETSC_FALSE * * cdef inline object toInt(PetscInt value): # <<<<<<<<<<<<<< * return value * cdef inline PetscInt asInt(object value) except? -1: */ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toInt(PetscInt __pyx_v_value) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("toInt", 1); /* "petsc4py/PETSc/PETSc.pyx":137 * * cdef inline object toInt(PetscInt value): * return value # <<<<<<<<<<<<<< * cdef inline PetscInt asInt(object value) except? -1: * return value */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_PetscInt(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/PETSc.pyx":136 * return PETSC_TRUE if value else PETSC_FALSE * * cdef inline object toInt(PetscInt value): # <<<<<<<<<<<<<< * return value * cdef inline PetscInt asInt(object value) except? -1: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.toInt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PETSc.pyx":138 * cdef inline object toInt(PetscInt value): * return value * cdef inline PetscInt asInt(object value) except? -1: # <<<<<<<<<<<<<< * return value * */ static CYTHON_INLINE PetscInt __pyx_f_8petsc4py_5PETSc_asInt(PyObject *__pyx_v_value) { PetscInt __pyx_r; PetscInt __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "petsc4py/PETSc/PETSc.pyx":139 * return value * cdef inline PetscInt asInt(object value) except? -1: * return value # <<<<<<<<<<<<<< * * cdef inline object toReal(PetscReal value): */ __pyx_t_1 = __Pyx_PyInt_As_PetscInt(__pyx_v_value); if (unlikely((__pyx_t_1 == ((PetscInt)-1)) && PyErr_Occurred())) __PYX_ERR(12, 139, __pyx_L1_error) __pyx_r = __pyx_t_1; goto __pyx_L0; /* "petsc4py/PETSc/PETSc.pyx":138 * cdef inline object toInt(PetscInt value): * return value * cdef inline PetscInt asInt(object value) except? -1: # <<<<<<<<<<<<<< * return value * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.asInt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1L; __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/PETSc.pyx":141 * return value * * cdef inline object toReal(PetscReal value): # <<<<<<<<<<<<<< * return value * cdef inline PetscReal asReal(object value) except? -1: */ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toReal(PetscReal __pyx_v_value) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("toReal", 1); /* "petsc4py/PETSc/PETSc.pyx":142 * * cdef inline object toReal(PetscReal value): * return value # <<<<<<<<<<<<<< * cdef inline PetscReal asReal(object value) except? -1: * return value */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/PETSc.pyx":141 * return value * * cdef inline object toReal(PetscReal value): # <<<<<<<<<<<<<< * return value * cdef inline PetscReal asReal(object value) except? -1: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.toReal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PETSc.pyx":143 * cdef inline object toReal(PetscReal value): * return value * cdef inline PetscReal asReal(object value) except? -1: # <<<<<<<<<<<<<< * return value * */ static CYTHON_INLINE PetscReal __pyx_f_8petsc4py_5PETSc_asReal(PyObject *__pyx_v_value) { PetscReal __pyx_r; PetscReal __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "petsc4py/PETSc/PETSc.pyx":144 * return value * cdef inline PetscReal asReal(object value) except? -1: * return value # <<<<<<<<<<<<<< * * cdef inline object toScalar(PetscScalar value): */ __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == ((PetscReal)-1)) && PyErr_Occurred())) __PYX_ERR(12, 144, __pyx_L1_error) __pyx_r = __pyx_t_1; goto __pyx_L0; /* "petsc4py/PETSc/PETSc.pyx":143 * cdef inline object toReal(PetscReal value): * return value * cdef inline PetscReal asReal(object value) except? -1: # <<<<<<<<<<<<<< * return value * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.asReal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1.0; __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/PETSc.pyx":146 * return value * * cdef inline object toScalar(PetscScalar value): # <<<<<<<<<<<<<< * return PyPetscScalar_FromPetscScalar(value) * cdef inline PetscScalar asScalar(object value) except? -1.0: */ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toScalar(PetscScalar __pyx_v_value) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("toScalar", 1); /* "petsc4py/PETSc/PETSc.pyx":147 * * cdef inline object toScalar(PetscScalar value): * return PyPetscScalar_FromPetscScalar(value) # <<<<<<<<<<<<<< * cdef inline PetscScalar asScalar(object value) except? -1.0: * return PyPetscScalar_AsPetscScalar(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyPetscScalar_FromPetscScalar(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/PETSc.pyx":146 * return value * * cdef inline object toScalar(PetscScalar value): # <<<<<<<<<<<<<< * return PyPetscScalar_FromPetscScalar(value) * cdef inline PetscScalar asScalar(object value) except? -1.0: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.toScalar", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PETSc.pyx":148 * cdef inline object toScalar(PetscScalar value): * return PyPetscScalar_FromPetscScalar(value) * cdef inline PetscScalar asScalar(object value) except? -1.0: # <<<<<<<<<<<<<< * return PyPetscScalar_AsPetscScalar(value) * */ static CYTHON_INLINE PetscScalar __pyx_f_8petsc4py_5PETSc_asScalar(PyObject *__pyx_v_value) { PetscScalar __pyx_r; PetscScalar __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "petsc4py/PETSc/PETSc.pyx":149 * return PyPetscScalar_FromPetscScalar(value) * cdef inline PetscScalar asScalar(object value) except? -1.0: * return PyPetscScalar_AsPetscScalar(value) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_t_1 = PyPetscScalar_AsPetscScalar(__pyx_v_value); if (unlikely(__pyx_t_1 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(12, 149, __pyx_L1_error) __pyx_r = __pyx_t_1; goto __pyx_L0; /* "petsc4py/PETSc/PETSc.pyx":148 * cdef inline object toScalar(PetscScalar value): * return PyPetscScalar_FromPetscScalar(value) * cdef inline PetscScalar asScalar(object value) except? -1.0: # <<<<<<<<<<<<<< * return PyPetscScalar_AsPetscScalar(value) * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.asScalar", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = ((PetscScalar)(-1.0)); __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/arraynpy.pxi":69 * # -------------------------------------------------------------------- * * cdef inline ndarray asarray(object ob): # <<<<<<<<<<<<<< * return PyArray_FROM_O(ob) * */ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_asarray(PyObject *__pyx_v_ob) { PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("asarray", 1); /* "petsc4py/PETSc/arraynpy.pxi":70 * * cdef inline ndarray asarray(object ob): * return PyArray_FROM_O(ob) # <<<<<<<<<<<<<< * * cdef inline ndarray arange(start, stop, stride): */ __Pyx_XDECREF((PyObject *)__pyx_r); __pyx_t_1 = ((PyObject *)PyArray_FROM_O(__pyx_v_ob)); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/arraynpy.pxi":69 * # -------------------------------------------------------------------- * * cdef inline ndarray asarray(object ob): # <<<<<<<<<<<<<< * return PyArray_FROM_O(ob) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.asarray", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/arraynpy.pxi":72 * return PyArray_FROM_O(ob) * * cdef inline ndarray arange(start, stop, stride): # <<<<<<<<<<<<<< * cdef dtype descr = PyArray_DescrFromType(NPY_PETSC_INT) * return PyArray_ArangeObj(start, stop, stride, descr) */ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_arange(PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_stride) { PyArray_Descr *__pyx_v_descr = 0; PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("arange", 1); /* "petsc4py/PETSc/arraynpy.pxi":73 * * cdef inline ndarray arange(start, stop, stride): * cdef dtype descr = PyArray_DescrFromType(NPY_PETSC_INT) # <<<<<<<<<<<<<< * return PyArray_ArangeObj(start, stop, stride, descr) * */ __pyx_t_1 = ((PyObject *)PyArray_DescrFromType(NPY_PETSC_INT)); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_descr = ((PyArray_Descr *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/arraynpy.pxi":74 * cdef inline ndarray arange(start, stop, stride): * cdef dtype descr = PyArray_DescrFromType(NPY_PETSC_INT) * return PyArray_ArangeObj(start, stop, stride, descr) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF((PyObject *)__pyx_r); __pyx_t_2 = ((PyObject *)PyArray_ArangeObj(__pyx_v_start, __pyx_v_stop, __pyx_v_stride, __pyx_v_descr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/arraynpy.pxi":72 * return PyArray_FROM_O(ob) * * cdef inline ndarray arange(start, stop, stride): # <<<<<<<<<<<<<< * cdef dtype descr = PyArray_DescrFromType(NPY_PETSC_INT) * return PyArray_ArangeObj(start, stop, stride, descr) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.arange", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_descr); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/arraynpy.pxi":78 * # -------------------------------------------------------------------- * * cdef inline ndarray empty_i(PetscInt size): # <<<<<<<<<<<<<< * cdef npy_intp s = size * return PyArray_EMPTY(1, &s, NPY_PETSC_INT, 0) */ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_empty_i(PetscInt __pyx_v_size) { npy_intp __pyx_v_s; PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("empty_i", 1); /* "petsc4py/PETSc/arraynpy.pxi":79 * * cdef inline ndarray empty_i(PetscInt size): * cdef npy_intp s = size # <<<<<<<<<<<<<< * return PyArray_EMPTY(1, &s, NPY_PETSC_INT, 0) * */ __pyx_v_s = ((npy_intp)__pyx_v_size); /* "petsc4py/PETSc/arraynpy.pxi":80 * cdef inline ndarray empty_i(PetscInt size): * cdef npy_intp s = size * return PyArray_EMPTY(1, &s, NPY_PETSC_INT, 0) # <<<<<<<<<<<<<< * * cdef inline ndarray empty_r(PetscInt size): */ __Pyx_XDECREF((PyObject *)__pyx_r); __pyx_t_1 = ((PyObject *)PyArray_EMPTY(1, (&__pyx_v_s), NPY_PETSC_INT, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/arraynpy.pxi":78 * # -------------------------------------------------------------------- * * cdef inline ndarray empty_i(PetscInt size): # <<<<<<<<<<<<<< * cdef npy_intp s = size * return PyArray_EMPTY(1, &s, NPY_PETSC_INT, 0) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.empty_i", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/arraynpy.pxi":82 * return PyArray_EMPTY(1, &s, NPY_PETSC_INT, 0) * * cdef inline ndarray empty_r(PetscInt size): # <<<<<<<<<<<<<< * cdef npy_intp s = size * return PyArray_EMPTY(1, &s, NPY_PETSC_REAL, 0) */ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_empty_r(PetscInt __pyx_v_size) { npy_intp __pyx_v_s; PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("empty_r", 1); /* "petsc4py/PETSc/arraynpy.pxi":83 * * cdef inline ndarray empty_r(PetscInt size): * cdef npy_intp s = size # <<<<<<<<<<<<<< * return PyArray_EMPTY(1, &s, NPY_PETSC_REAL, 0) * */ __pyx_v_s = ((npy_intp)__pyx_v_size); /* "petsc4py/PETSc/arraynpy.pxi":84 * cdef inline ndarray empty_r(PetscInt size): * cdef npy_intp s = size * return PyArray_EMPTY(1, &s, NPY_PETSC_REAL, 0) # <<<<<<<<<<<<<< * * cdef inline ndarray empty_s(PetscInt size): */ __Pyx_XDECREF((PyObject *)__pyx_r); __pyx_t_1 = ((PyObject *)PyArray_EMPTY(1, (&__pyx_v_s), NPY_PETSC_REAL, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/arraynpy.pxi":82 * return PyArray_EMPTY(1, &s, NPY_PETSC_INT, 0) * * cdef inline ndarray empty_r(PetscInt size): # <<<<<<<<<<<<<< * cdef npy_intp s = size * return PyArray_EMPTY(1, &s, NPY_PETSC_REAL, 0) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.empty_r", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/arraynpy.pxi":86 * return PyArray_EMPTY(1, &s, NPY_PETSC_REAL, 0) * * cdef inline ndarray empty_s(PetscInt size): # <<<<<<<<<<<<<< * cdef npy_intp s = size * return PyArray_EMPTY(1, &s, NPY_PETSC_SCALAR, 0) */ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_empty_s(PetscInt __pyx_v_size) { npy_intp __pyx_v_s; PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("empty_s", 1); /* "petsc4py/PETSc/arraynpy.pxi":87 * * cdef inline ndarray empty_s(PetscInt size): * cdef npy_intp s = size # <<<<<<<<<<<<<< * return PyArray_EMPTY(1, &s, NPY_PETSC_SCALAR, 0) * */ __pyx_v_s = ((npy_intp)__pyx_v_size); /* "petsc4py/PETSc/arraynpy.pxi":88 * cdef inline ndarray empty_s(PetscInt size): * cdef npy_intp s = size * return PyArray_EMPTY(1, &s, NPY_PETSC_SCALAR, 0) # <<<<<<<<<<<<<< * * cdef inline ndarray empty_c(PetscInt size): */ __Pyx_XDECREF((PyObject *)__pyx_r); __pyx_t_1 = ((PyObject *)PyArray_EMPTY(1, (&__pyx_v_s), NPY_PETSC_SCALAR, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/arraynpy.pxi":86 * return PyArray_EMPTY(1, &s, NPY_PETSC_REAL, 0) * * cdef inline ndarray empty_s(PetscInt size): # <<<<<<<<<<<<<< * cdef npy_intp s = size * return PyArray_EMPTY(1, &s, NPY_PETSC_SCALAR, 0) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.empty_s", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/arraynpy.pxi":90 * return PyArray_EMPTY(1, &s, NPY_PETSC_SCALAR, 0) * * cdef inline ndarray empty_c(PetscInt size): # <<<<<<<<<<<<<< * cdef npy_intp s = size * return PyArray_EMPTY(1, &s, NPY_PETSC_COMPLEX, 0) */ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_empty_c(PetscInt __pyx_v_size) { npy_intp __pyx_v_s; PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("empty_c", 1); /* "petsc4py/PETSc/arraynpy.pxi":91 * * cdef inline ndarray empty_c(PetscInt size): * cdef npy_intp s = size # <<<<<<<<<<<<<< * return PyArray_EMPTY(1, &s, NPY_PETSC_COMPLEX, 0) * */ __pyx_v_s = ((npy_intp)__pyx_v_size); /* "petsc4py/PETSc/arraynpy.pxi":92 * cdef inline ndarray empty_c(PetscInt size): * cdef npy_intp s = size * return PyArray_EMPTY(1, &s, NPY_PETSC_COMPLEX, 0) # <<<<<<<<<<<<<< * * cdef inline ndarray empty_p(PetscInt size): */ __Pyx_XDECREF((PyObject *)__pyx_r); __pyx_t_1 = ((PyObject *)PyArray_EMPTY(1, (&__pyx_v_s), NPY_PETSC_COMPLEX, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/arraynpy.pxi":90 * return PyArray_EMPTY(1, &s, NPY_PETSC_SCALAR, 0) * * cdef inline ndarray empty_c(PetscInt size): # <<<<<<<<<<<<<< * cdef npy_intp s = size * return PyArray_EMPTY(1, &s, NPY_PETSC_COMPLEX, 0) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.empty_c", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/arraynpy.pxi":94 * return PyArray_EMPTY(1, &s, NPY_PETSC_COMPLEX, 0) * * cdef inline ndarray empty_p(PetscInt size): # <<<<<<<<<<<<<< * cdef npy_intp s = size * return PyArray_EMPTY(1, &s, NPY_INTP, 0) */ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_empty_p(PetscInt __pyx_v_size) { npy_intp __pyx_v_s; PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("empty_p", 1); /* "petsc4py/PETSc/arraynpy.pxi":95 * * cdef inline ndarray empty_p(PetscInt size): * cdef npy_intp s = size # <<<<<<<<<<<<<< * return PyArray_EMPTY(1, &s, NPY_INTP, 0) * */ __pyx_v_s = ((npy_intp)__pyx_v_size); /* "petsc4py/PETSc/arraynpy.pxi":96 * cdef inline ndarray empty_p(PetscInt size): * cdef npy_intp s = size * return PyArray_EMPTY(1, &s, NPY_INTP, 0) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF((PyObject *)__pyx_r); __pyx_t_1 = ((PyObject *)PyArray_EMPTY(1, (&__pyx_v_s), NPY_INTP, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/arraynpy.pxi":94 * return PyArray_EMPTY(1, &s, NPY_PETSC_COMPLEX, 0) * * cdef inline ndarray empty_p(PetscInt size): # <<<<<<<<<<<<<< * cdef npy_intp s = size * return PyArray_EMPTY(1, &s, NPY_INTP, 0) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.empty_p", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/arraynpy.pxi":100 * # -------------------------------------------------------------------- * * cdef inline ndarray array_i(PetscInt size, const PetscInt* data): # <<<<<<<<<<<<<< * cdef npy_intp s = size * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_INT, 0) */ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_array_i(PetscInt __pyx_v_size, PetscInt const *__pyx_v_data) { npy_intp __pyx_v_s; PyArrayObject *__pyx_v_ary = 0; PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("array_i", 1); /* "petsc4py/PETSc/arraynpy.pxi":101 * * cdef inline ndarray array_i(PetscInt size, const PetscInt* data): * cdef npy_intp s = size # <<<<<<<<<<<<<< * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_INT, 0) * if data != NULL: */ __pyx_v_s = ((npy_intp)__pyx_v_size); /* "petsc4py/PETSc/arraynpy.pxi":102 * cdef inline ndarray array_i(PetscInt size, const PetscInt* data): * cdef npy_intp s = size * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_INT, 0) # <<<<<<<<<<<<<< * if data != NULL: * memcpy(PyArray_DATA(ary), data, size*sizeof(PetscInt)) */ __pyx_t_1 = ((PyObject *)PyArray_EMPTY(1, (&__pyx_v_s), NPY_PETSC_INT, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ary = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/arraynpy.pxi":103 * cdef npy_intp s = size * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_INT, 0) * if data != NULL: # <<<<<<<<<<<<<< * memcpy(PyArray_DATA(ary), data, size*sizeof(PetscInt)) * return ary */ __pyx_t_2 = (__pyx_v_data != NULL); if (__pyx_t_2) { /* "petsc4py/PETSc/arraynpy.pxi":104 * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_INT, 0) * if data != NULL: * memcpy(PyArray_DATA(ary), data, size*sizeof(PetscInt)) # <<<<<<<<<<<<<< * return ary * */ (void)(memcpy(PyArray_DATA(__pyx_v_ary), __pyx_v_data, (((size_t)__pyx_v_size) * (sizeof(PetscInt))))); /* "petsc4py/PETSc/arraynpy.pxi":103 * cdef npy_intp s = size * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_INT, 0) * if data != NULL: # <<<<<<<<<<<<<< * memcpy(PyArray_DATA(ary), data, size*sizeof(PetscInt)) * return ary */ } /* "petsc4py/PETSc/arraynpy.pxi":105 * if data != NULL: * memcpy(PyArray_DATA(ary), data, size*sizeof(PetscInt)) * return ary # <<<<<<<<<<<<<< * * cdef inline ndarray array_r(PetscInt size, const PetscReal* data): */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_ary); __pyx_r = __pyx_v_ary; goto __pyx_L0; /* "petsc4py/PETSc/arraynpy.pxi":100 * # -------------------------------------------------------------------- * * cdef inline ndarray array_i(PetscInt size, const PetscInt* data): # <<<<<<<<<<<<<< * cdef npy_intp s = size * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_INT, 0) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.array_i", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ary); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/arraynpy.pxi":107 * return ary * * cdef inline ndarray array_r(PetscInt size, const PetscReal* data): # <<<<<<<<<<<<<< * cdef npy_intp s = size * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_REAL, 0) */ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_array_r(PetscInt __pyx_v_size, PetscReal const *__pyx_v_data) { npy_intp __pyx_v_s; PyArrayObject *__pyx_v_ary = 0; PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("array_r", 1); /* "petsc4py/PETSc/arraynpy.pxi":108 * * cdef inline ndarray array_r(PetscInt size, const PetscReal* data): * cdef npy_intp s = size # <<<<<<<<<<<<<< * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_REAL, 0) * if data != NULL: */ __pyx_v_s = ((npy_intp)__pyx_v_size); /* "petsc4py/PETSc/arraynpy.pxi":109 * cdef inline ndarray array_r(PetscInt size, const PetscReal* data): * cdef npy_intp s = size * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_REAL, 0) # <<<<<<<<<<<<<< * if data != NULL: * memcpy(PyArray_DATA(ary), data, size*sizeof(PetscReal)) */ __pyx_t_1 = ((PyObject *)PyArray_EMPTY(1, (&__pyx_v_s), NPY_PETSC_REAL, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ary = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/arraynpy.pxi":110 * cdef npy_intp s = size * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_REAL, 0) * if data != NULL: # <<<<<<<<<<<<<< * memcpy(PyArray_DATA(ary), data, size*sizeof(PetscReal)) * return ary */ __pyx_t_2 = (__pyx_v_data != NULL); if (__pyx_t_2) { /* "petsc4py/PETSc/arraynpy.pxi":111 * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_REAL, 0) * if data != NULL: * memcpy(PyArray_DATA(ary), data, size*sizeof(PetscReal)) # <<<<<<<<<<<<<< * return ary * */ (void)(memcpy(PyArray_DATA(__pyx_v_ary), __pyx_v_data, (((size_t)__pyx_v_size) * (sizeof(PetscReal))))); /* "petsc4py/PETSc/arraynpy.pxi":110 * cdef npy_intp s = size * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_REAL, 0) * if data != NULL: # <<<<<<<<<<<<<< * memcpy(PyArray_DATA(ary), data, size*sizeof(PetscReal)) * return ary */ } /* "petsc4py/PETSc/arraynpy.pxi":112 * if data != NULL: * memcpy(PyArray_DATA(ary), data, size*sizeof(PetscReal)) * return ary # <<<<<<<<<<<<<< * * cdef inline ndarray array_b(PetscInt size, const PetscBool* data): */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_ary); __pyx_r = __pyx_v_ary; goto __pyx_L0; /* "petsc4py/PETSc/arraynpy.pxi":107 * return ary * * cdef inline ndarray array_r(PetscInt size, const PetscReal* data): # <<<<<<<<<<<<<< * cdef npy_intp s = size * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_REAL, 0) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.array_r", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ary); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/arraynpy.pxi":114 * return ary * * cdef inline ndarray array_b(PetscInt size, const PetscBool* data): # <<<<<<<<<<<<<< * cdef npy_intp s = size * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_BOOL, 0) */ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_array_b(PetscInt __pyx_v_size, PetscBool const *__pyx_v_data) { npy_intp __pyx_v_s; PyArrayObject *__pyx_v_ary = 0; PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("array_b", 1); /* "petsc4py/PETSc/arraynpy.pxi":115 * * cdef inline ndarray array_b(PetscInt size, const PetscBool* data): * cdef npy_intp s = size # <<<<<<<<<<<<<< * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_BOOL, 0) * if data != NULL: */ __pyx_v_s = ((npy_intp)__pyx_v_size); /* "petsc4py/PETSc/arraynpy.pxi":116 * cdef inline ndarray array_b(PetscInt size, const PetscBool* data): * cdef npy_intp s = size * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_BOOL, 0) # <<<<<<<<<<<<<< * if data != NULL: * memcpy(PyArray_DATA(ary), data, size*sizeof(PetscBool)) */ __pyx_t_1 = ((PyObject *)PyArray_EMPTY(1, (&__pyx_v_s), NPY_PETSC_BOOL, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ary = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/arraynpy.pxi":117 * cdef npy_intp s = size * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_BOOL, 0) * if data != NULL: # <<<<<<<<<<<<<< * memcpy(PyArray_DATA(ary), data, size*sizeof(PetscBool)) * return ary */ __pyx_t_2 = (__pyx_v_data != NULL); if (__pyx_t_2) { /* "petsc4py/PETSc/arraynpy.pxi":118 * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_BOOL, 0) * if data != NULL: * memcpy(PyArray_DATA(ary), data, size*sizeof(PetscBool)) # <<<<<<<<<<<<<< * return ary * */ (void)(memcpy(PyArray_DATA(__pyx_v_ary), __pyx_v_data, (((size_t)__pyx_v_size) * (sizeof(PetscBool))))); /* "petsc4py/PETSc/arraynpy.pxi":117 * cdef npy_intp s = size * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_BOOL, 0) * if data != NULL: # <<<<<<<<<<<<<< * memcpy(PyArray_DATA(ary), data, size*sizeof(PetscBool)) * return ary */ } /* "petsc4py/PETSc/arraynpy.pxi":119 * if data != NULL: * memcpy(PyArray_DATA(ary), data, size*sizeof(PetscBool)) * return ary # <<<<<<<<<<<<<< * * cdef inline ndarray array_s(PetscInt size, const PetscScalar* data): */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_ary); __pyx_r = __pyx_v_ary; goto __pyx_L0; /* "petsc4py/PETSc/arraynpy.pxi":114 * return ary * * cdef inline ndarray array_b(PetscInt size, const PetscBool* data): # <<<<<<<<<<<<<< * cdef npy_intp s = size * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_BOOL, 0) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.array_b", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ary); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/arraynpy.pxi":121 * return ary * * cdef inline ndarray array_s(PetscInt size, const PetscScalar* data): # <<<<<<<<<<<<<< * cdef npy_intp s = size * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_SCALAR, 0) */ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_array_s(PetscInt __pyx_v_size, PetscScalar const *__pyx_v_data) { npy_intp __pyx_v_s; PyArrayObject *__pyx_v_ary = 0; PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("array_s", 1); /* "petsc4py/PETSc/arraynpy.pxi":122 * * cdef inline ndarray array_s(PetscInt size, const PetscScalar* data): * cdef npy_intp s = size # <<<<<<<<<<<<<< * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_SCALAR, 0) * if data != NULL: */ __pyx_v_s = ((npy_intp)__pyx_v_size); /* "petsc4py/PETSc/arraynpy.pxi":123 * cdef inline ndarray array_s(PetscInt size, const PetscScalar* data): * cdef npy_intp s = size * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_SCALAR, 0) # <<<<<<<<<<<<<< * if data != NULL: * memcpy(PyArray_DATA(ary), data, size*sizeof(PetscScalar)) */ __pyx_t_1 = ((PyObject *)PyArray_EMPTY(1, (&__pyx_v_s), NPY_PETSC_SCALAR, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ary = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/arraynpy.pxi":124 * cdef npy_intp s = size * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_SCALAR, 0) * if data != NULL: # <<<<<<<<<<<<<< * memcpy(PyArray_DATA(ary), data, size*sizeof(PetscScalar)) * return ary */ __pyx_t_2 = (__pyx_v_data != NULL); if (__pyx_t_2) { /* "petsc4py/PETSc/arraynpy.pxi":125 * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_SCALAR, 0) * if data != NULL: * memcpy(PyArray_DATA(ary), data, size*sizeof(PetscScalar)) # <<<<<<<<<<<<<< * return ary * */ (void)(memcpy(PyArray_DATA(__pyx_v_ary), __pyx_v_data, (((size_t)__pyx_v_size) * (sizeof(PetscScalar))))); /* "petsc4py/PETSc/arraynpy.pxi":124 * cdef npy_intp s = size * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_SCALAR, 0) * if data != NULL: # <<<<<<<<<<<<<< * memcpy(PyArray_DATA(ary), data, size*sizeof(PetscScalar)) * return ary */ } /* "petsc4py/PETSc/arraynpy.pxi":126 * if data != NULL: * memcpy(PyArray_DATA(ary), data, size*sizeof(PetscScalar)) * return ary # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_ary); __pyx_r = __pyx_v_ary; goto __pyx_L0; /* "petsc4py/PETSc/arraynpy.pxi":121 * return ary * * cdef inline ndarray array_s(PetscInt size, const PetscScalar* data): # <<<<<<<<<<<<<< * cdef npy_intp s = size * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_SCALAR, 0) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.array_s", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ary); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/arraynpy.pxi":130 * # -------------------------------------------------------------------- * * cdef inline ndarray iarray(object ob, int typenum): # <<<<<<<<<<<<<< * cdef ndarray ary = PyArray_FROM_OTF( * ob, typenum, NPY_ARRAY_ALIGNED|NPY_ARRAY_NOTSWAPPED) */ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_iarray(PyObject *__pyx_v_ob, int __pyx_v_typenum) { PyArrayObject *__pyx_v_ary = 0; PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("iarray", 1); /* "petsc4py/PETSc/arraynpy.pxi":131 * * cdef inline ndarray iarray(object ob, int typenum): * cdef ndarray ary = PyArray_FROM_OTF( # <<<<<<<<<<<<<< * ob, typenum, NPY_ARRAY_ALIGNED|NPY_ARRAY_NOTSWAPPED) * if PyArray_ISCONTIGUOUS(ary): return ary */ __pyx_t_1 = ((PyObject *)PyArray_FROM_OTF(__pyx_v_ob, __pyx_v_typenum, (NPY_ARRAY_ALIGNED | NPY_ARRAY_NOTSWAPPED))); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ary = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/arraynpy.pxi":133 * cdef ndarray ary = PyArray_FROM_OTF( * ob, typenum, NPY_ARRAY_ALIGNED|NPY_ARRAY_NOTSWAPPED) * if PyArray_ISCONTIGUOUS(ary): return ary # <<<<<<<<<<<<<< * if PyArray_ISFORTRAN(ary): return ary * return PyArray_Copy(ary) */ __pyx_t_2 = PyArray_ISCONTIGUOUS(__pyx_v_ary); if (__pyx_t_2) { __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_ary); __pyx_r = __pyx_v_ary; goto __pyx_L0; } /* "petsc4py/PETSc/arraynpy.pxi":134 * ob, typenum, NPY_ARRAY_ALIGNED|NPY_ARRAY_NOTSWAPPED) * if PyArray_ISCONTIGUOUS(ary): return ary * if PyArray_ISFORTRAN(ary): return ary # <<<<<<<<<<<<<< * return PyArray_Copy(ary) * */ __pyx_t_2 = PyArray_ISFORTRAN(__pyx_v_ary); if (__pyx_t_2) { __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_ary); __pyx_r = __pyx_v_ary; goto __pyx_L0; } /* "petsc4py/PETSc/arraynpy.pxi":135 * if PyArray_ISCONTIGUOUS(ary): return ary * if PyArray_ISFORTRAN(ary): return ary * return PyArray_Copy(ary) # <<<<<<<<<<<<<< * * cdef inline ndarray iarray_i(object ob, PetscInt* size, PetscInt** data): */ __Pyx_XDECREF((PyObject *)__pyx_r); __pyx_t_1 = ((PyObject *)PyArray_Copy(__pyx_v_ary)); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/arraynpy.pxi":130 * # -------------------------------------------------------------------- * * cdef inline ndarray iarray(object ob, int typenum): # <<<<<<<<<<<<<< * cdef ndarray ary = PyArray_FROM_OTF( * ob, typenum, NPY_ARRAY_ALIGNED|NPY_ARRAY_NOTSWAPPED) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.iarray", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ary); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/arraynpy.pxi":137 * return PyArray_Copy(ary) * * cdef inline ndarray iarray_i(object ob, PetscInt* size, PetscInt** data): # <<<<<<<<<<<<<< * cdef ndarray ary = iarray(ob, NPY_PETSC_INT) * if size != NULL: size[0] = PyArray_SIZE(ary) */ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_iarray_i(PyObject *__pyx_v_ob, PetscInt *__pyx_v_size, PetscInt **__pyx_v_data) { PyArrayObject *__pyx_v_ary = 0; PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("iarray_i", 1); /* "petsc4py/PETSc/arraynpy.pxi":138 * * cdef inline ndarray iarray_i(object ob, PetscInt* size, PetscInt** data): * cdef ndarray ary = iarray(ob, NPY_PETSC_INT) # <<<<<<<<<<<<<< * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray(__pyx_v_ob, NPY_PETSC_INT)); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ary = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/arraynpy.pxi":139 * cdef inline ndarray iarray_i(object ob, PetscInt* size, PetscInt** data): * cdef ndarray ary = iarray(ob, NPY_PETSC_INT) * if size != NULL: size[0] = PyArray_SIZE(ary) # <<<<<<<<<<<<<< * if data != NULL: data[0] = PyArray_DATA(ary) * return ary */ __pyx_t_2 = (__pyx_v_size != NULL); if (__pyx_t_2) { (__pyx_v_size[0]) = ((PetscInt)PyArray_SIZE(__pyx_v_ary)); } /* "petsc4py/PETSc/arraynpy.pxi":140 * cdef ndarray ary = iarray(ob, NPY_PETSC_INT) * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) # <<<<<<<<<<<<<< * return ary * */ __pyx_t_2 = (__pyx_v_data != NULL); if (__pyx_t_2) { (__pyx_v_data[0]) = ((PetscInt *)PyArray_DATA(__pyx_v_ary)); } /* "petsc4py/PETSc/arraynpy.pxi":141 * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) * return ary # <<<<<<<<<<<<<< * * cdef inline ndarray iarray_r(object ob, PetscInt* size, PetscReal** data): */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_ary); __pyx_r = __pyx_v_ary; goto __pyx_L0; /* "petsc4py/PETSc/arraynpy.pxi":137 * return PyArray_Copy(ary) * * cdef inline ndarray iarray_i(object ob, PetscInt* size, PetscInt** data): # <<<<<<<<<<<<<< * cdef ndarray ary = iarray(ob, NPY_PETSC_INT) * if size != NULL: size[0] = PyArray_SIZE(ary) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.iarray_i", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ary); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/arraynpy.pxi":143 * return ary * * cdef inline ndarray iarray_r(object ob, PetscInt* size, PetscReal** data): # <<<<<<<<<<<<<< * cdef ndarray ary = iarray(ob, NPY_PETSC_REAL) * if size != NULL: size[0] = PyArray_SIZE(ary) */ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_iarray_r(PyObject *__pyx_v_ob, PetscInt *__pyx_v_size, PetscReal **__pyx_v_data) { PyArrayObject *__pyx_v_ary = 0; PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("iarray_r", 1); /* "petsc4py/PETSc/arraynpy.pxi":144 * * cdef inline ndarray iarray_r(object ob, PetscInt* size, PetscReal** data): * cdef ndarray ary = iarray(ob, NPY_PETSC_REAL) # <<<<<<<<<<<<<< * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray(__pyx_v_ob, NPY_PETSC_REAL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ary = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/arraynpy.pxi":145 * cdef inline ndarray iarray_r(object ob, PetscInt* size, PetscReal** data): * cdef ndarray ary = iarray(ob, NPY_PETSC_REAL) * if size != NULL: size[0] = PyArray_SIZE(ary) # <<<<<<<<<<<<<< * if data != NULL: data[0] = PyArray_DATA(ary) * return ary */ __pyx_t_2 = (__pyx_v_size != NULL); if (__pyx_t_2) { (__pyx_v_size[0]) = ((PetscInt)PyArray_SIZE(__pyx_v_ary)); } /* "petsc4py/PETSc/arraynpy.pxi":146 * cdef ndarray ary = iarray(ob, NPY_PETSC_REAL) * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) # <<<<<<<<<<<<<< * return ary * */ __pyx_t_2 = (__pyx_v_data != NULL); if (__pyx_t_2) { (__pyx_v_data[0]) = ((PetscReal *)PyArray_DATA(__pyx_v_ary)); } /* "petsc4py/PETSc/arraynpy.pxi":147 * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) * return ary # <<<<<<<<<<<<<< * * cdef inline ndarray iarray_b(object ob, PetscInt* size, PetscBool** data): */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_ary); __pyx_r = __pyx_v_ary; goto __pyx_L0; /* "petsc4py/PETSc/arraynpy.pxi":143 * return ary * * cdef inline ndarray iarray_r(object ob, PetscInt* size, PetscReal** data): # <<<<<<<<<<<<<< * cdef ndarray ary = iarray(ob, NPY_PETSC_REAL) * if size != NULL: size[0] = PyArray_SIZE(ary) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.iarray_r", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ary); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/arraynpy.pxi":149 * return ary * * cdef inline ndarray iarray_b(object ob, PetscInt* size, PetscBool** data): # <<<<<<<<<<<<<< * cdef ndarray ary = iarray(ob, NPY_PETSC_BOOL) * if size != NULL: size[0] = PyArray_SIZE(ary) */ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_iarray_b(PyObject *__pyx_v_ob, PetscInt *__pyx_v_size, PetscBool **__pyx_v_data) { PyArrayObject *__pyx_v_ary = 0; PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("iarray_b", 1); /* "petsc4py/PETSc/arraynpy.pxi":150 * * cdef inline ndarray iarray_b(object ob, PetscInt* size, PetscBool** data): * cdef ndarray ary = iarray(ob, NPY_PETSC_BOOL) # <<<<<<<<<<<<<< * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray(__pyx_v_ob, NPY_PETSC_BOOL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ary = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/arraynpy.pxi":151 * cdef inline ndarray iarray_b(object ob, PetscInt* size, PetscBool** data): * cdef ndarray ary = iarray(ob, NPY_PETSC_BOOL) * if size != NULL: size[0] = PyArray_SIZE(ary) # <<<<<<<<<<<<<< * if data != NULL: data[0] = PyArray_DATA(ary) * return ary */ __pyx_t_2 = (__pyx_v_size != NULL); if (__pyx_t_2) { (__pyx_v_size[0]) = ((PetscInt)PyArray_SIZE(__pyx_v_ary)); } /* "petsc4py/PETSc/arraynpy.pxi":152 * cdef ndarray ary = iarray(ob, NPY_PETSC_BOOL) * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) # <<<<<<<<<<<<<< * return ary * */ __pyx_t_2 = (__pyx_v_data != NULL); if (__pyx_t_2) { (__pyx_v_data[0]) = ((PetscBool *)PyArray_DATA(__pyx_v_ary)); } /* "petsc4py/PETSc/arraynpy.pxi":153 * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) * return ary # <<<<<<<<<<<<<< * * cdef inline ndarray iarray_s(object ob, PetscInt* size, PetscScalar** data): */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_ary); __pyx_r = __pyx_v_ary; goto __pyx_L0; /* "petsc4py/PETSc/arraynpy.pxi":149 * return ary * * cdef inline ndarray iarray_b(object ob, PetscInt* size, PetscBool** data): # <<<<<<<<<<<<<< * cdef ndarray ary = iarray(ob, NPY_PETSC_BOOL) * if size != NULL: size[0] = PyArray_SIZE(ary) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.iarray_b", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ary); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/arraynpy.pxi":155 * return ary * * cdef inline ndarray iarray_s(object ob, PetscInt* size, PetscScalar** data): # <<<<<<<<<<<<<< * cdef ndarray ary = iarray(ob, NPY_PETSC_SCALAR) * if size != NULL: size[0] = PyArray_SIZE(ary) */ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_iarray_s(PyObject *__pyx_v_ob, PetscInt *__pyx_v_size, PetscScalar **__pyx_v_data) { PyArrayObject *__pyx_v_ary = 0; PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("iarray_s", 1); /* "petsc4py/PETSc/arraynpy.pxi":156 * * cdef inline ndarray iarray_s(object ob, PetscInt* size, PetscScalar** data): * cdef ndarray ary = iarray(ob, NPY_PETSC_SCALAR) # <<<<<<<<<<<<<< * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray(__pyx_v_ob, NPY_PETSC_SCALAR)); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ary = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/arraynpy.pxi":157 * cdef inline ndarray iarray_s(object ob, PetscInt* size, PetscScalar** data): * cdef ndarray ary = iarray(ob, NPY_PETSC_SCALAR) * if size != NULL: size[0] = PyArray_SIZE(ary) # <<<<<<<<<<<<<< * if data != NULL: data[0] = PyArray_DATA(ary) * return ary */ __pyx_t_2 = (__pyx_v_size != NULL); if (__pyx_t_2) { (__pyx_v_size[0]) = ((PetscInt)PyArray_SIZE(__pyx_v_ary)); } /* "petsc4py/PETSc/arraynpy.pxi":158 * cdef ndarray ary = iarray(ob, NPY_PETSC_SCALAR) * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) # <<<<<<<<<<<<<< * return ary * */ __pyx_t_2 = (__pyx_v_data != NULL); if (__pyx_t_2) { (__pyx_v_data[0]) = ((PetscScalar *)PyArray_DATA(__pyx_v_ary)); } /* "petsc4py/PETSc/arraynpy.pxi":159 * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) * return ary # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_ary); __pyx_r = __pyx_v_ary; goto __pyx_L0; /* "petsc4py/PETSc/arraynpy.pxi":155 * return ary * * cdef inline ndarray iarray_s(object ob, PetscInt* size, PetscScalar** data): # <<<<<<<<<<<<<< * cdef ndarray ary = iarray(ob, NPY_PETSC_SCALAR) * if size != NULL: size[0] = PyArray_SIZE(ary) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.iarray_s", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ary); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/arraynpy.pxi":163 * # -------------------------------------------------------------------- * * cdef inline ndarray oarray(object ob, int typenum): # <<<<<<<<<<<<<< * cdef ndarray ary = PyArray_FROM_OTF( * ob, typenum, NPY_ARRAY_ALIGNED|NPY_ARRAY_WRITEABLE|NPY_ARRAY_NOTSWAPPED) */ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_oarray(PyObject *__pyx_v_ob, int __pyx_v_typenum) { PyArrayObject *__pyx_v_ary = 0; PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("oarray", 1); /* "petsc4py/PETSc/arraynpy.pxi":164 * * cdef inline ndarray oarray(object ob, int typenum): * cdef ndarray ary = PyArray_FROM_OTF( # <<<<<<<<<<<<<< * ob, typenum, NPY_ARRAY_ALIGNED|NPY_ARRAY_WRITEABLE|NPY_ARRAY_NOTSWAPPED) * if PyArray_ISCONTIGUOUS(ary): return ary */ __pyx_t_1 = ((PyObject *)PyArray_FROM_OTF(__pyx_v_ob, __pyx_v_typenum, ((NPY_ARRAY_ALIGNED | NPY_ARRAY_WRITEABLE) | NPY_ARRAY_NOTSWAPPED))); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ary = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/arraynpy.pxi":166 * cdef ndarray ary = PyArray_FROM_OTF( * ob, typenum, NPY_ARRAY_ALIGNED|NPY_ARRAY_WRITEABLE|NPY_ARRAY_NOTSWAPPED) * if PyArray_ISCONTIGUOUS(ary): return ary # <<<<<<<<<<<<<< * if PyArray_ISFORTRAN(ary): return ary * return PyArray_Copy(ary) */ __pyx_t_2 = PyArray_ISCONTIGUOUS(__pyx_v_ary); if (__pyx_t_2) { __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_ary); __pyx_r = __pyx_v_ary; goto __pyx_L0; } /* "petsc4py/PETSc/arraynpy.pxi":167 * ob, typenum, NPY_ARRAY_ALIGNED|NPY_ARRAY_WRITEABLE|NPY_ARRAY_NOTSWAPPED) * if PyArray_ISCONTIGUOUS(ary): return ary * if PyArray_ISFORTRAN(ary): return ary # <<<<<<<<<<<<<< * return PyArray_Copy(ary) * */ __pyx_t_2 = PyArray_ISFORTRAN(__pyx_v_ary); if (__pyx_t_2) { __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_ary); __pyx_r = __pyx_v_ary; goto __pyx_L0; } /* "petsc4py/PETSc/arraynpy.pxi":168 * if PyArray_ISCONTIGUOUS(ary): return ary * if PyArray_ISFORTRAN(ary): return ary * return PyArray_Copy(ary) # <<<<<<<<<<<<<< * * cdef inline ndarray oarray_i(object ob, PetscInt* size, PetscInt** data): */ __Pyx_XDECREF((PyObject *)__pyx_r); __pyx_t_1 = ((PyObject *)PyArray_Copy(__pyx_v_ary)); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/arraynpy.pxi":163 * # -------------------------------------------------------------------- * * cdef inline ndarray oarray(object ob, int typenum): # <<<<<<<<<<<<<< * cdef ndarray ary = PyArray_FROM_OTF( * ob, typenum, NPY_ARRAY_ALIGNED|NPY_ARRAY_WRITEABLE|NPY_ARRAY_NOTSWAPPED) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.oarray", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ary); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/arraynpy.pxi":170 * return PyArray_Copy(ary) * * cdef inline ndarray oarray_i(object ob, PetscInt* size, PetscInt** data): # <<<<<<<<<<<<<< * cdef ndarray ary = oarray(ob, NPY_PETSC_INT) * if size != NULL: size[0] = PyArray_SIZE(ary) */ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_oarray_i(PyObject *__pyx_v_ob, PetscInt *__pyx_v_size, PetscInt **__pyx_v_data) { PyArrayObject *__pyx_v_ary = 0; PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("oarray_i", 1); /* "petsc4py/PETSc/arraynpy.pxi":171 * * cdef inline ndarray oarray_i(object ob, PetscInt* size, PetscInt** data): * cdef ndarray ary = oarray(ob, NPY_PETSC_INT) # <<<<<<<<<<<<<< * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray(__pyx_v_ob, NPY_PETSC_INT)); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ary = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/arraynpy.pxi":172 * cdef inline ndarray oarray_i(object ob, PetscInt* size, PetscInt** data): * cdef ndarray ary = oarray(ob, NPY_PETSC_INT) * if size != NULL: size[0] = PyArray_SIZE(ary) # <<<<<<<<<<<<<< * if data != NULL: data[0] = PyArray_DATA(ary) * return ary */ __pyx_t_2 = (__pyx_v_size != NULL); if (__pyx_t_2) { (__pyx_v_size[0]) = ((PetscInt)PyArray_SIZE(__pyx_v_ary)); } /* "petsc4py/PETSc/arraynpy.pxi":173 * cdef ndarray ary = oarray(ob, NPY_PETSC_INT) * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) # <<<<<<<<<<<<<< * return ary * */ __pyx_t_2 = (__pyx_v_data != NULL); if (__pyx_t_2) { (__pyx_v_data[0]) = ((PetscInt *)PyArray_DATA(__pyx_v_ary)); } /* "petsc4py/PETSc/arraynpy.pxi":174 * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) * return ary # <<<<<<<<<<<<<< * * cdef inline ndarray oarray_r(object ob, PetscInt* size, PetscReal** data): */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_ary); __pyx_r = __pyx_v_ary; goto __pyx_L0; /* "petsc4py/PETSc/arraynpy.pxi":170 * return PyArray_Copy(ary) * * cdef inline ndarray oarray_i(object ob, PetscInt* size, PetscInt** data): # <<<<<<<<<<<<<< * cdef ndarray ary = oarray(ob, NPY_PETSC_INT) * if size != NULL: size[0] = PyArray_SIZE(ary) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.oarray_i", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ary); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/arraynpy.pxi":176 * return ary * * cdef inline ndarray oarray_r(object ob, PetscInt* size, PetscReal** data): # <<<<<<<<<<<<<< * cdef ndarray ary = oarray(ob, NPY_PETSC_REAL) * if size != NULL: size[0] = PyArray_SIZE(ary) */ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_oarray_r(PyObject *__pyx_v_ob, PetscInt *__pyx_v_size, PetscReal **__pyx_v_data) { PyArrayObject *__pyx_v_ary = 0; PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("oarray_r", 1); /* "petsc4py/PETSc/arraynpy.pxi":177 * * cdef inline ndarray oarray_r(object ob, PetscInt* size, PetscReal** data): * cdef ndarray ary = oarray(ob, NPY_PETSC_REAL) # <<<<<<<<<<<<<< * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray(__pyx_v_ob, NPY_PETSC_REAL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ary = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/arraynpy.pxi":178 * cdef inline ndarray oarray_r(object ob, PetscInt* size, PetscReal** data): * cdef ndarray ary = oarray(ob, NPY_PETSC_REAL) * if size != NULL: size[0] = PyArray_SIZE(ary) # <<<<<<<<<<<<<< * if data != NULL: data[0] = PyArray_DATA(ary) * return ary */ __pyx_t_2 = (__pyx_v_size != NULL); if (__pyx_t_2) { (__pyx_v_size[0]) = ((PetscInt)PyArray_SIZE(__pyx_v_ary)); } /* "petsc4py/PETSc/arraynpy.pxi":179 * cdef ndarray ary = oarray(ob, NPY_PETSC_REAL) * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) # <<<<<<<<<<<<<< * return ary * */ __pyx_t_2 = (__pyx_v_data != NULL); if (__pyx_t_2) { (__pyx_v_data[0]) = ((PetscReal *)PyArray_DATA(__pyx_v_ary)); } /* "petsc4py/PETSc/arraynpy.pxi":180 * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) * return ary # <<<<<<<<<<<<<< * * cdef inline ndarray oarray_s(object ob, PetscInt* size, PetscScalar** data): */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_ary); __pyx_r = __pyx_v_ary; goto __pyx_L0; /* "petsc4py/PETSc/arraynpy.pxi":176 * return ary * * cdef inline ndarray oarray_r(object ob, PetscInt* size, PetscReal** data): # <<<<<<<<<<<<<< * cdef ndarray ary = oarray(ob, NPY_PETSC_REAL) * if size != NULL: size[0] = PyArray_SIZE(ary) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.oarray_r", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ary); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/arraynpy.pxi":182 * return ary * * cdef inline ndarray oarray_s(object ob, PetscInt* size, PetscScalar** data): # <<<<<<<<<<<<<< * cdef ndarray ary = oarray(ob, NPY_PETSC_SCALAR) * if size != NULL: size[0] = PyArray_SIZE(ary) */ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_oarray_s(PyObject *__pyx_v_ob, PetscInt *__pyx_v_size, PetscScalar **__pyx_v_data) { PyArrayObject *__pyx_v_ary = 0; PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("oarray_s", 1); /* "petsc4py/PETSc/arraynpy.pxi":183 * * cdef inline ndarray oarray_s(object ob, PetscInt* size, PetscScalar** data): * cdef ndarray ary = oarray(ob, NPY_PETSC_SCALAR) # <<<<<<<<<<<<<< * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray(__pyx_v_ob, NPY_PETSC_SCALAR)); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ary = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/arraynpy.pxi":184 * cdef inline ndarray oarray_s(object ob, PetscInt* size, PetscScalar** data): * cdef ndarray ary = oarray(ob, NPY_PETSC_SCALAR) * if size != NULL: size[0] = PyArray_SIZE(ary) # <<<<<<<<<<<<<< * if data != NULL: data[0] = PyArray_DATA(ary) * return ary */ __pyx_t_2 = (__pyx_v_size != NULL); if (__pyx_t_2) { (__pyx_v_size[0]) = ((PetscInt)PyArray_SIZE(__pyx_v_ary)); } /* "petsc4py/PETSc/arraynpy.pxi":185 * cdef ndarray ary = oarray(ob, NPY_PETSC_SCALAR) * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) # <<<<<<<<<<<<<< * return ary * */ __pyx_t_2 = (__pyx_v_data != NULL); if (__pyx_t_2) { (__pyx_v_data[0]) = ((PetscScalar *)PyArray_DATA(__pyx_v_ary)); } /* "petsc4py/PETSc/arraynpy.pxi":186 * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) * return ary # <<<<<<<<<<<<<< * * cdef inline ndarray oarray_p(object ob, PetscInt* size, void** data): */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_ary); __pyx_r = __pyx_v_ary; goto __pyx_L0; /* "petsc4py/PETSc/arraynpy.pxi":182 * return ary * * cdef inline ndarray oarray_s(object ob, PetscInt* size, PetscScalar** data): # <<<<<<<<<<<<<< * cdef ndarray ary = oarray(ob, NPY_PETSC_SCALAR) * if size != NULL: size[0] = PyArray_SIZE(ary) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.oarray_s", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ary); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/arraynpy.pxi":188 * return ary * * cdef inline ndarray oarray_p(object ob, PetscInt* size, void** data): # <<<<<<<<<<<<<< * cdef ndarray ary = oarray(ob, NPY_INTP) * if size != NULL: size[0] = PyArray_SIZE(ary) */ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_oarray_p(PyObject *__pyx_v_ob, PetscInt *__pyx_v_size, void **__pyx_v_data) { PyArrayObject *__pyx_v_ary = 0; PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("oarray_p", 1); /* "petsc4py/PETSc/arraynpy.pxi":189 * * cdef inline ndarray oarray_p(object ob, PetscInt* size, void** data): * cdef ndarray ary = oarray(ob, NPY_INTP) # <<<<<<<<<<<<<< * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray(__pyx_v_ob, NPY_INTP)); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ary = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/arraynpy.pxi":190 * cdef inline ndarray oarray_p(object ob, PetscInt* size, void** data): * cdef ndarray ary = oarray(ob, NPY_INTP) * if size != NULL: size[0] = PyArray_SIZE(ary) # <<<<<<<<<<<<<< * if data != NULL: data[0] = PyArray_DATA(ary) * return ary */ __pyx_t_2 = (__pyx_v_size != NULL); if (__pyx_t_2) { (__pyx_v_size[0]) = ((PetscInt)PyArray_SIZE(__pyx_v_ary)); } /* "petsc4py/PETSc/arraynpy.pxi":191 * cdef ndarray ary = oarray(ob, NPY_INTP) * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) # <<<<<<<<<<<<<< * return ary * */ __pyx_t_2 = (__pyx_v_data != NULL); if (__pyx_t_2) { (__pyx_v_data[0]) = ((void *)PyArray_DATA(__pyx_v_ary)); } /* "petsc4py/PETSc/arraynpy.pxi":192 * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) * return ary # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_ary); __pyx_r = __pyx_v_ary; goto __pyx_L0; /* "petsc4py/PETSc/arraynpy.pxi":188 * return ary * * cdef inline ndarray oarray_p(object ob, PetscInt* size, void** data): # <<<<<<<<<<<<<< * cdef ndarray ary = oarray(ob, NPY_INTP) * if size != NULL: size[0] = PyArray_SIZE(ary) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.oarray_p", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ary); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/arraynpy.pxi":196 * # -------------------------------------------------------------------- * * cdef inline ndarray ocarray_s(object ob, PetscInt* size, PetscScalar** data): # <<<<<<<<<<<<<< * cdef ndarray ary = PyArray_FROM_OTF( * ob, NPY_PETSC_SCALAR, NPY_ARRAY_CARRAY|NPY_ARRAY_NOTSWAPPED) */ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_ocarray_s(PyObject *__pyx_v_ob, PetscInt *__pyx_v_size, PetscScalar **__pyx_v_data) { PyArrayObject *__pyx_v_ary = 0; PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("ocarray_s", 1); /* "petsc4py/PETSc/arraynpy.pxi":197 * * cdef inline ndarray ocarray_s(object ob, PetscInt* size, PetscScalar** data): * cdef ndarray ary = PyArray_FROM_OTF( # <<<<<<<<<<<<<< * ob, NPY_PETSC_SCALAR, NPY_ARRAY_CARRAY|NPY_ARRAY_NOTSWAPPED) * if size != NULL: size[0] = PyArray_SIZE(ary) */ __pyx_t_1 = ((PyObject *)PyArray_FROM_OTF(__pyx_v_ob, NPY_PETSC_SCALAR, (NPY_ARRAY_CARRAY | NPY_ARRAY_NOTSWAPPED))); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ary = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/arraynpy.pxi":199 * cdef ndarray ary = PyArray_FROM_OTF( * ob, NPY_PETSC_SCALAR, NPY_ARRAY_CARRAY|NPY_ARRAY_NOTSWAPPED) * if size != NULL: size[0] = PyArray_SIZE(ary) # <<<<<<<<<<<<<< * if data != NULL: data[0] = PyArray_DATA(ary) * return ary */ __pyx_t_2 = (__pyx_v_size != NULL); if (__pyx_t_2) { (__pyx_v_size[0]) = ((PetscInt)PyArray_SIZE(__pyx_v_ary)); } /* "petsc4py/PETSc/arraynpy.pxi":200 * ob, NPY_PETSC_SCALAR, NPY_ARRAY_CARRAY|NPY_ARRAY_NOTSWAPPED) * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) # <<<<<<<<<<<<<< * return ary * */ __pyx_t_2 = (__pyx_v_data != NULL); if (__pyx_t_2) { (__pyx_v_data[0]) = ((PetscScalar *)PyArray_DATA(__pyx_v_ary)); } /* "petsc4py/PETSc/arraynpy.pxi":201 * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) * return ary # <<<<<<<<<<<<<< * * cdef inline ndarray ofarray_s(object ob, PetscInt* size, PetscScalar** data): */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_ary); __pyx_r = __pyx_v_ary; goto __pyx_L0; /* "petsc4py/PETSc/arraynpy.pxi":196 * # -------------------------------------------------------------------- * * cdef inline ndarray ocarray_s(object ob, PetscInt* size, PetscScalar** data): # <<<<<<<<<<<<<< * cdef ndarray ary = PyArray_FROM_OTF( * ob, NPY_PETSC_SCALAR, NPY_ARRAY_CARRAY|NPY_ARRAY_NOTSWAPPED) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.ocarray_s", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ary); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/arraynpy.pxi":203 * return ary * * cdef inline ndarray ofarray_s(object ob, PetscInt* size, PetscScalar** data): # <<<<<<<<<<<<<< * cdef ndarray ary = PyArray_FROM_OTF( * ob, NPY_PETSC_SCALAR, NPY_ARRAY_FARRAY|NPY_ARRAY_NOTSWAPPED) */ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_ofarray_s(PyObject *__pyx_v_ob, PetscInt *__pyx_v_size, PetscScalar **__pyx_v_data) { PyArrayObject *__pyx_v_ary = 0; PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("ofarray_s", 1); /* "petsc4py/PETSc/arraynpy.pxi":204 * * cdef inline ndarray ofarray_s(object ob, PetscInt* size, PetscScalar** data): * cdef ndarray ary = PyArray_FROM_OTF( # <<<<<<<<<<<<<< * ob, NPY_PETSC_SCALAR, NPY_ARRAY_FARRAY|NPY_ARRAY_NOTSWAPPED) * if size != NULL: size[0] = PyArray_SIZE(ary) */ __pyx_t_1 = ((PyObject *)PyArray_FROM_OTF(__pyx_v_ob, NPY_PETSC_SCALAR, (NPY_ARRAY_FARRAY | NPY_ARRAY_NOTSWAPPED))); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ary = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/arraynpy.pxi":206 * cdef ndarray ary = PyArray_FROM_OTF( * ob, NPY_PETSC_SCALAR, NPY_ARRAY_FARRAY|NPY_ARRAY_NOTSWAPPED) * if size != NULL: size[0] = PyArray_SIZE(ary) # <<<<<<<<<<<<<< * if data != NULL: data[0] = PyArray_DATA(ary) * return ary */ __pyx_t_2 = (__pyx_v_size != NULL); if (__pyx_t_2) { (__pyx_v_size[0]) = ((PetscInt)PyArray_SIZE(__pyx_v_ary)); } /* "petsc4py/PETSc/arraynpy.pxi":207 * ob, NPY_PETSC_SCALAR, NPY_ARRAY_FARRAY|NPY_ARRAY_NOTSWAPPED) * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) # <<<<<<<<<<<<<< * return ary * */ __pyx_t_2 = (__pyx_v_data != NULL); if (__pyx_t_2) { (__pyx_v_data[0]) = ((PetscScalar *)PyArray_DATA(__pyx_v_ary)); } /* "petsc4py/PETSc/arraynpy.pxi":208 * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) * return ary # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_ary); __pyx_r = __pyx_v_ary; goto __pyx_L0; /* "petsc4py/PETSc/arraynpy.pxi":203 * return ary * * cdef inline ndarray ofarray_s(object ob, PetscInt* size, PetscScalar** data): # <<<<<<<<<<<<<< * cdef ndarray ary = PyArray_FROM_OTF( * ob, NPY_PETSC_SCALAR, NPY_ARRAY_FARRAY|NPY_ARRAY_NOTSWAPPED) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.ofarray_s", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ary); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/dlpack.pxi":64 * dlpack_manager_del_obj del_obj * * cdef void pycapsule_deleter(object dltensor) noexcept: # <<<<<<<<<<<<<< * cdef DLManagedTensor* dlm_tensor = NULL * # we do not call a used capsule's deleter */ static void __pyx_f_8petsc4py_5PETSc_pycapsule_deleter(PyObject *__pyx_v_dltensor) { struct __pyx_t_8petsc4py_5PETSc_DLManagedTensor *__pyx_v_dlm_tensor; int __pyx_t_1; void *__pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "petsc4py/PETSc/dlpack.pxi":65 * * cdef void pycapsule_deleter(object dltensor) noexcept: * cdef DLManagedTensor* dlm_tensor = NULL # <<<<<<<<<<<<<< * # we do not call a used capsule's deleter * if PyCapsule_IsValid(dltensor, b'dltensor'): */ __pyx_v_dlm_tensor = NULL; /* "petsc4py/PETSc/dlpack.pxi":67 * cdef DLManagedTensor* dlm_tensor = NULL * # we do not call a used capsule's deleter * if PyCapsule_IsValid(dltensor, b'dltensor'): # <<<<<<<<<<<<<< * dlm_tensor = PyCapsule_GetPointer(dltensor, b'dltensor') * manager_deleter(dlm_tensor) */ __pyx_t_1 = PyCapsule_IsValid(__pyx_v_dltensor, ((char const *)"dltensor")); if (__pyx_t_1) { /* "petsc4py/PETSc/dlpack.pxi":68 * # we do not call a used capsule's deleter * if PyCapsule_IsValid(dltensor, b'dltensor'): * dlm_tensor = PyCapsule_GetPointer(dltensor, b'dltensor') # <<<<<<<<<<<<<< * manager_deleter(dlm_tensor) * */ __pyx_t_2 = PyCapsule_GetPointer(__pyx_v_dltensor, ((char const *)"dltensor")); if (unlikely(__pyx_t_2 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(16, 68, __pyx_L1_error) __pyx_v_dlm_tensor = ((struct __pyx_t_8petsc4py_5PETSc_DLManagedTensor *)__pyx_t_2); /* "petsc4py/PETSc/dlpack.pxi":69 * if PyCapsule_IsValid(dltensor, b'dltensor'): * dlm_tensor = PyCapsule_GetPointer(dltensor, b'dltensor') * manager_deleter(dlm_tensor) # <<<<<<<<<<<<<< * * cdef void manager_deleter(DLManagedTensor* tensor) noexcept nogil: */ __pyx_f_8petsc4py_5PETSc_manager_deleter(__pyx_v_dlm_tensor); /* "petsc4py/PETSc/dlpack.pxi":67 * cdef DLManagedTensor* dlm_tensor = NULL * # we do not call a used capsule's deleter * if PyCapsule_IsValid(dltensor, b'dltensor'): # <<<<<<<<<<<<<< * dlm_tensor = PyCapsule_GetPointer(dltensor, b'dltensor') * manager_deleter(dlm_tensor) */ } /* "petsc4py/PETSc/dlpack.pxi":64 * dlpack_manager_del_obj del_obj * * cdef void pycapsule_deleter(object dltensor) noexcept: # <<<<<<<<<<<<<< * cdef DLManagedTensor* dlm_tensor = NULL * # we do not call a used capsule's deleter */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_WriteUnraisable("petsc4py.PETSc.pycapsule_deleter", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_L0:; } /* "petsc4py/PETSc/dlpack.pxi":71 * manager_deleter(dlm_tensor) * * cdef void manager_deleter(DLManagedTensor* tensor) noexcept nogil: # <<<<<<<<<<<<<< * if tensor.manager_ctx is NULL: * return */ static void __pyx_f_8petsc4py_5PETSc_manager_deleter(struct __pyx_t_8petsc4py_5PETSc_DLManagedTensor *__pyx_v_tensor) { int __pyx_t_1; /* "petsc4py/PETSc/dlpack.pxi":72 * * cdef void manager_deleter(DLManagedTensor* tensor) noexcept nogil: * if tensor.manager_ctx is NULL: # <<<<<<<<<<<<<< * return * free(tensor.dl_tensor.shape) */ __pyx_t_1 = (__pyx_v_tensor->manager_ctx == NULL); if (__pyx_t_1) { /* "petsc4py/PETSc/dlpack.pxi":73 * cdef void manager_deleter(DLManagedTensor* tensor) noexcept nogil: * if tensor.manager_ctx is NULL: * return # <<<<<<<<<<<<<< * free(tensor.dl_tensor.shape) * if tensor.del_obj is not NULL: */ goto __pyx_L0; /* "petsc4py/PETSc/dlpack.pxi":72 * * cdef void manager_deleter(DLManagedTensor* tensor) noexcept nogil: * if tensor.manager_ctx is NULL: # <<<<<<<<<<<<<< * return * free(tensor.dl_tensor.shape) */ } /* "petsc4py/PETSc/dlpack.pxi":74 * if tensor.manager_ctx is NULL: * return * free(tensor.dl_tensor.shape) # <<<<<<<<<<<<<< * if tensor.del_obj is not NULL: * tensor.del_obj(&tensor.manager_ctx) */ free(__pyx_v_tensor->dl_tensor.shape); /* "petsc4py/PETSc/dlpack.pxi":75 * return * free(tensor.dl_tensor.shape) * if tensor.del_obj is not NULL: # <<<<<<<<<<<<<< * tensor.del_obj(&tensor.manager_ctx) * free(tensor) */ __pyx_t_1 = (__pyx_v_tensor->del_obj != NULL); if (__pyx_t_1) { /* "petsc4py/PETSc/dlpack.pxi":76 * free(tensor.dl_tensor.shape) * if tensor.del_obj is not NULL: * tensor.del_obj(&tensor.manager_ctx) # <<<<<<<<<<<<<< * free(tensor) * */ (void)(__pyx_v_tensor->del_obj((&__pyx_v_tensor->manager_ctx))); /* "petsc4py/PETSc/dlpack.pxi":75 * return * free(tensor.dl_tensor.shape) * if tensor.del_obj is not NULL: # <<<<<<<<<<<<<< * tensor.del_obj(&tensor.manager_ctx) * free(tensor) */ } /* "petsc4py/PETSc/dlpack.pxi":77 * if tensor.del_obj is not NULL: * tensor.del_obj(&tensor.manager_ctx) * free(tensor) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ free(__pyx_v_tensor); /* "petsc4py/PETSc/dlpack.pxi":71 * manager_deleter(dlm_tensor) * * cdef void manager_deleter(DLManagedTensor* tensor) noexcept nogil: # <<<<<<<<<<<<<< * if tensor.manager_ctx is NULL: * return */ /* function exit code */ __pyx_L0:; } /* "petsc4py/PETSc/petscdef.pxi":43 * PETSC_USE_POINTER * * cdef inline PetscInsertMode insertmode(object mode) \ # <<<<<<<<<<<<<< * except (-1): * if mode is None: return PETSC_INSERT_VALUES */ static CYTHON_INLINE InsertMode __pyx_f_8petsc4py_5PETSc_insertmode(PyObject *__pyx_v_mode) { InsertMode __pyx_r; int __pyx_t_1; InsertMode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "petsc4py/PETSc/petscdef.pxi":45 * cdef inline PetscInsertMode insertmode(object mode) \ * except (-1): * if mode is None: return PETSC_INSERT_VALUES # <<<<<<<<<<<<<< * elif mode is True: return PETSC_ADD_VALUES * elif mode is False: return PETSC_INSERT_VALUES */ __pyx_t_1 = (__pyx_v_mode == Py_None); if (__pyx_t_1) { __pyx_r = INSERT_VALUES; goto __pyx_L0; } /* "petsc4py/PETSc/petscdef.pxi":46 * except (-1): * if mode is None: return PETSC_INSERT_VALUES * elif mode is True: return PETSC_ADD_VALUES # <<<<<<<<<<<<<< * elif mode is False: return PETSC_INSERT_VALUES * else: return mode */ __pyx_t_1 = (__pyx_v_mode == Py_True); if (__pyx_t_1) { __pyx_r = ADD_VALUES; goto __pyx_L0; } /* "petsc4py/PETSc/petscdef.pxi":47 * if mode is None: return PETSC_INSERT_VALUES * elif mode is True: return PETSC_ADD_VALUES * elif mode is False: return PETSC_INSERT_VALUES # <<<<<<<<<<<<<< * else: return mode * */ __pyx_t_1 = (__pyx_v_mode == Py_False); if (__pyx_t_1) { __pyx_r = INSERT_VALUES; goto __pyx_L0; } /* "petsc4py/PETSc/petscdef.pxi":48 * elif mode is True: return PETSC_ADD_VALUES * elif mode is False: return PETSC_INSERT_VALUES * else: return mode # <<<<<<<<<<<<<< * * cdef inline PetscScatterMode scattermode(object mode) \ */ /*else*/ { __pyx_t_2 = ((InsertMode)__Pyx_PyInt_As_InsertMode(__pyx_v_mode)); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 48, __pyx_L1_error) __pyx_r = __pyx_t_2; goto __pyx_L0; } /* "petsc4py/PETSc/petscdef.pxi":43 * PETSC_USE_POINTER * * cdef inline PetscInsertMode insertmode(object mode) \ # <<<<<<<<<<<<<< * except (-1): * if mode is None: return PETSC_INSERT_VALUES */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.insertmode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = ((InsertMode)-1L); __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/petscdef.pxi":50 * else: return mode * * cdef inline PetscScatterMode scattermode(object mode) \ # <<<<<<<<<<<<<< * except (-1): * if mode is None: return PETSC_SCATTER_FORWARD */ static CYTHON_INLINE ScatterMode __pyx_f_8petsc4py_5PETSc_scattermode(PyObject *__pyx_v_mode) { ScatterMode __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; ScatterMode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("scattermode", 1); /* "petsc4py/PETSc/petscdef.pxi":52 * cdef inline PetscScatterMode scattermode(object mode) \ * except (-1): * if mode is None: return PETSC_SCATTER_FORWARD # <<<<<<<<<<<<<< * if mode is False: return PETSC_SCATTER_FORWARD * if mode is True: return PETSC_SCATTER_REVERSE */ __pyx_t_1 = (__pyx_v_mode == Py_None); if (__pyx_t_1) { __pyx_r = SCATTER_FORWARD; goto __pyx_L0; } /* "petsc4py/PETSc/petscdef.pxi":53 * except (-1): * if mode is None: return PETSC_SCATTER_FORWARD * if mode is False: return PETSC_SCATTER_FORWARD # <<<<<<<<<<<<<< * if mode is True: return PETSC_SCATTER_REVERSE * if isinstance(mode, str): */ __pyx_t_1 = (__pyx_v_mode == Py_False); if (__pyx_t_1) { __pyx_r = SCATTER_FORWARD; goto __pyx_L0; } /* "petsc4py/PETSc/petscdef.pxi":54 * if mode is None: return PETSC_SCATTER_FORWARD * if mode is False: return PETSC_SCATTER_FORWARD * if mode is True: return PETSC_SCATTER_REVERSE # <<<<<<<<<<<<<< * if isinstance(mode, str): * if mode == 'forward': return PETSC_SCATTER_FORWARD */ __pyx_t_1 = (__pyx_v_mode == Py_True); if (__pyx_t_1) { __pyx_r = SCATTER_REVERSE; goto __pyx_L0; } /* "petsc4py/PETSc/petscdef.pxi":55 * if mode is False: return PETSC_SCATTER_FORWARD * if mode is True: return PETSC_SCATTER_REVERSE * if isinstance(mode, str): # <<<<<<<<<<<<<< * if mode == 'forward': return PETSC_SCATTER_FORWARD * if mode == 'reverse': return PETSC_SCATTER_REVERSE */ __pyx_t_1 = PyString_Check(__pyx_v_mode); if (__pyx_t_1) { /* "petsc4py/PETSc/petscdef.pxi":56 * if mode is True: return PETSC_SCATTER_REVERSE * if isinstance(mode, str): * if mode == 'forward': return PETSC_SCATTER_FORWARD # <<<<<<<<<<<<<< * if mode == 'reverse': return PETSC_SCATTER_REVERSE * else: raise ValueError("unknown scatter mode: %s" % mode) */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_forward, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(3, 56, __pyx_L1_error) if (__pyx_t_1) { __pyx_r = SCATTER_FORWARD; goto __pyx_L0; } /* "petsc4py/PETSc/petscdef.pxi":57 * if isinstance(mode, str): * if mode == 'forward': return PETSC_SCATTER_FORWARD * if mode == 'reverse': return PETSC_SCATTER_REVERSE # <<<<<<<<<<<<<< * else: raise ValueError("unknown scatter mode: %s" % mode) * return mode */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_reverse, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(3, 57, __pyx_L1_error) if (likely(__pyx_t_1)) { __pyx_r = SCATTER_REVERSE; goto __pyx_L0; } /* "petsc4py/PETSc/petscdef.pxi":58 * if mode == 'forward': return PETSC_SCATTER_FORWARD * if mode == 'reverse': return PETSC_SCATTER_REVERSE * else: raise ValueError("unknown scatter mode: %s" % mode) # <<<<<<<<<<<<<< * return mode * */ /*else*/ { __pyx_t_2 = __Pyx_PyString_FormatSafe(__pyx_kp_s_unknown_scatter_mode_s, __pyx_v_mode); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(3, 58, __pyx_L1_error) } /* "petsc4py/PETSc/petscdef.pxi":55 * if mode is False: return PETSC_SCATTER_FORWARD * if mode is True: return PETSC_SCATTER_REVERSE * if isinstance(mode, str): # <<<<<<<<<<<<<< * if mode == 'forward': return PETSC_SCATTER_FORWARD * if mode == 'reverse': return PETSC_SCATTER_REVERSE */ } /* "petsc4py/PETSc/petscdef.pxi":59 * if mode == 'reverse': return PETSC_SCATTER_REVERSE * else: raise ValueError("unknown scatter mode: %s" % mode) * return mode # <<<<<<<<<<<<<< * */ __pyx_t_4 = ((ScatterMode)__Pyx_PyInt_As_ScatterMode(__pyx_v_mode)); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 59, __pyx_L1_error) __pyx_r = __pyx_t_4; goto __pyx_L0; /* "petsc4py/PETSc/petscdef.pxi":50 * else: return mode * * cdef inline PetscScatterMode scattermode(object mode) \ # <<<<<<<<<<<<<< * except (-1): * if mode is None: return PETSC_SCATTER_FORWARD */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.scattermode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = ((ScatterMode)-1L); __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscopt.pxi":38 * # * * cdef getprefix(prefix, deft=None): # <<<<<<<<<<<<<< * if prefix is None: * prefix = deft */ static PyObject *__pyx_f_8petsc4py_5PETSc_getprefix(PyObject *__pyx_v_prefix, struct __pyx_opt_args_8petsc4py_5PETSc_getprefix *__pyx_optional_args) { PyObject *__pyx_v_deft = ((PyObject *)Py_None); PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getprefix", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_deft = __pyx_optional_args->deft; } } __Pyx_INCREF(__pyx_v_prefix); /* "petsc4py/PETSc/petscopt.pxi":39 * * cdef getprefix(prefix, deft=None): * if prefix is None: # <<<<<<<<<<<<<< * prefix = deft * elif isinstance(prefix, Options): */ __pyx_t_1 = (__pyx_v_prefix == Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/petscopt.pxi":40 * cdef getprefix(prefix, deft=None): * if prefix is None: * prefix = deft # <<<<<<<<<<<<<< * elif isinstance(prefix, Options): * prefix = prefix.prefix */ __Pyx_INCREF(__pyx_v_deft); __Pyx_DECREF_SET(__pyx_v_prefix, __pyx_v_deft); /* "petsc4py/PETSc/petscopt.pxi":39 * * cdef getprefix(prefix, deft=None): * if prefix is None: # <<<<<<<<<<<<<< * prefix = deft * elif isinstance(prefix, Options): */ goto __pyx_L3; } /* "petsc4py/PETSc/petscopt.pxi":41 * if prefix is None: * prefix = deft * elif isinstance(prefix, Options): # <<<<<<<<<<<<<< * prefix = prefix.prefix * elif isinstance(prefix, Object): */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_prefix, __pyx_ptype_8petsc4py_5PETSc_Options); if (__pyx_t_1) { /* "petsc4py/PETSc/petscopt.pxi":42 * prefix = deft * elif isinstance(prefix, Options): * prefix = prefix.prefix # <<<<<<<<<<<<<< * elif isinstance(prefix, Object): * prefix = prefix.getOptionsPrefix() */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_prefix, __pyx_n_s_prefix); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_prefix, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscopt.pxi":41 * if prefix is None: * prefix = deft * elif isinstance(prefix, Options): # <<<<<<<<<<<<<< * prefix = prefix.prefix * elif isinstance(prefix, Object): */ goto __pyx_L3; } /* "petsc4py/PETSc/petscopt.pxi":43 * elif isinstance(prefix, Options): * prefix = prefix.prefix * elif isinstance(prefix, Object): # <<<<<<<<<<<<<< * prefix = prefix.getOptionsPrefix() * elif not isinstance(prefix, str): */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_prefix, __pyx_ptype_8petsc4py_5PETSc_Object); if (__pyx_t_1) { /* "petsc4py/PETSc/petscopt.pxi":44 * prefix = prefix.prefix * elif isinstance(prefix, Object): * prefix = prefix.getOptionsPrefix() # <<<<<<<<<<<<<< * elif not isinstance(prefix, str): * raise TypeError('option prefix must be string') */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_prefix, __pyx_n_s_getOptionsPrefix); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF_SET(__pyx_v_prefix, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscopt.pxi":43 * elif isinstance(prefix, Options): * prefix = prefix.prefix * elif isinstance(prefix, Object): # <<<<<<<<<<<<<< * prefix = prefix.getOptionsPrefix() * elif not isinstance(prefix, str): */ goto __pyx_L3; } /* "petsc4py/PETSc/petscopt.pxi":45 * elif isinstance(prefix, Object): * prefix = prefix.getOptionsPrefix() * elif not isinstance(prefix, str): # <<<<<<<<<<<<<< * raise TypeError('option prefix must be string') * if not prefix: */ __pyx_t_1 = PyString_Check(__pyx_v_prefix); __pyx_t_6 = (!__pyx_t_1); if (unlikely(__pyx_t_6)) { /* "petsc4py/PETSc/petscopt.pxi":46 * prefix = prefix.getOptionsPrefix() * elif not isinstance(prefix, str): * raise TypeError('option prefix must be string') # <<<<<<<<<<<<<< * if not prefix: * return None */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(4, 46, __pyx_L1_error) /* "petsc4py/PETSc/petscopt.pxi":45 * elif isinstance(prefix, Object): * prefix = prefix.getOptionsPrefix() * elif not isinstance(prefix, str): # <<<<<<<<<<<<<< * raise TypeError('option prefix must be string') * if not prefix: */ } __pyx_L3:; /* "petsc4py/PETSc/petscopt.pxi":47 * elif not isinstance(prefix, str): * raise TypeError('option prefix must be string') * if not prefix: # <<<<<<<<<<<<<< * return None * if prefix.count(' '): */ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_prefix); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(4, 47, __pyx_L1_error) __pyx_t_1 = (!__pyx_t_6); if (__pyx_t_1) { /* "petsc4py/PETSc/petscopt.pxi":48 * raise TypeError('option prefix must be string') * if not prefix: * return None # <<<<<<<<<<<<<< * if prefix.count(' '): * raise ValueError('option prefix should not have spaces') */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "petsc4py/PETSc/petscopt.pxi":47 * elif not isinstance(prefix, str): * raise TypeError('option prefix must be string') * if not prefix: # <<<<<<<<<<<<<< * return None * if prefix.count(' '): */ } /* "petsc4py/PETSc/petscopt.pxi":49 * if not prefix: * return None * if prefix.count(' '): # <<<<<<<<<<<<<< * raise ValueError('option prefix should not have spaces') * if prefix.startswith('-'): */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_prefix, __pyx_n_s_count); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_s__16}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 49, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(__pyx_t_1)) { /* "petsc4py/PETSc/petscopt.pxi":50 * return None * if prefix.count(' '): * raise ValueError('option prefix should not have spaces') # <<<<<<<<<<<<<< * if prefix.startswith('-'): * raise ValueError('option prefix should not start with a hyphen') */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(4, 50, __pyx_L1_error) /* "petsc4py/PETSc/petscopt.pxi":49 * if not prefix: * return None * if prefix.count(' '): # <<<<<<<<<<<<<< * raise ValueError('option prefix should not have spaces') * if prefix.startswith('-'): */ } /* "petsc4py/PETSc/petscopt.pxi":51 * if prefix.count(' '): * raise ValueError('option prefix should not have spaces') * if prefix.startswith('-'): # <<<<<<<<<<<<<< * raise ValueError('option prefix should not start with a hyphen') * return prefix */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_prefix, __pyx_n_s_startswith); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_s__18}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 51, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(__pyx_t_1)) { /* "petsc4py/PETSc/petscopt.pxi":52 * raise ValueError('option prefix should not have spaces') * if prefix.startswith('-'): * raise ValueError('option prefix should not start with a hyphen') # <<<<<<<<<<<<<< * return prefix * */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(4, 52, __pyx_L1_error) /* "petsc4py/PETSc/petscopt.pxi":51 * if prefix.count(' '): * raise ValueError('option prefix should not have spaces') * if prefix.startswith('-'): # <<<<<<<<<<<<<< * raise ValueError('option prefix should not start with a hyphen') * return prefix */ } /* "petsc4py/PETSc/petscopt.pxi":53 * if prefix.startswith('-'): * raise ValueError('option prefix should not start with a hyphen') * return prefix # <<<<<<<<<<<<<< * * # */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_prefix); __pyx_r = __pyx_v_prefix; goto __pyx_L0; /* "petsc4py/PETSc/petscopt.pxi":38 * # * * cdef getprefix(prefix, deft=None): # <<<<<<<<<<<<<< * if prefix is None: * prefix = deft */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.getprefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_prefix); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscopt.pxi":57 * # * * cdef opt2str(const char *pre, const char *name): # <<<<<<<<<<<<<< * p = bytes2str(pre) if pre!=NULL else None * n = bytes2str(name) if name[0]!=c'-' else bytes2str(&name[1]) */ static PyObject *__pyx_f_8petsc4py_5PETSc_opt2str(char const *__pyx_v_pre, char const *__pyx_v_name) { PyObject *__pyx_v_p = NULL; PyObject *__pyx_v_n = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("opt2str", 1); /* "petsc4py/PETSc/petscopt.pxi":58 * * cdef opt2str(const char *pre, const char *name): * p = bytes2str(pre) if pre!=NULL else None # <<<<<<<<<<<<<< * n = bytes2str(name) if name[0]!=c'-' else bytes2str(&name[1]) * return '(prefix:%s, name:%s)' % (p, n) */ __pyx_t_2 = (__pyx_v_pre != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_pre); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_p = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/petscopt.pxi":59 * cdef opt2str(const char *pre, const char *name): * p = bytes2str(pre) if pre!=NULL else None * n = bytes2str(name) if name[0]!=c'-' else bytes2str(&name[1]) # <<<<<<<<<<<<<< * return '(prefix:%s, name:%s)' % (p, n) * */ __pyx_t_2 = ((__pyx_v_name[0]) != '-'); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_bytes2str((&(__pyx_v_name[1]))); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } __pyx_v_n = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/petscopt.pxi":60 * p = bytes2str(pre) if pre!=NULL else None * n = bytes2str(name) if name[0]!=c'-' else bytes2str(&name[1]) * return '(prefix:%s, name:%s)' % (p, n) # <<<<<<<<<<<<<< * * cdef getopt_Bool(PetscOptions opt, const char *pre, const char *name, object deft): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_p); __Pyx_GIVEREF(__pyx_v_p); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_p)) __PYX_ERR(4, 60, __pyx_L1_error); __Pyx_INCREF(__pyx_v_n); __Pyx_GIVEREF(__pyx_v_n); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_n)) __PYX_ERR(4, 60, __pyx_L1_error); __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_prefix_s_name_s, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "petsc4py/PETSc/petscopt.pxi":57 * # * * cdef opt2str(const char *pre, const char *name): # <<<<<<<<<<<<<< * p = bytes2str(pre) if pre!=NULL else None * n = bytes2str(name) if name[0]!=c'-' else bytes2str(&name[1]) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.opt2str", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_p); __Pyx_XDECREF(__pyx_v_n); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscopt.pxi":62 * return '(prefix:%s, name:%s)' % (p, n) * * cdef getopt_Bool(PetscOptions opt, const char *pre, const char *name, object deft): # <<<<<<<<<<<<<< * cdef PetscBool value = PETSC_FALSE * cdef PetscBool flag = PETSC_FALSE */ static PyObject *__pyx_f_8petsc4py_5PETSc_getopt_Bool(PetscOptions __pyx_v_opt, char const *__pyx_v_pre, char const *__pyx_v_name, PyObject *__pyx_v_deft) { PetscBool __pyx_v_value; PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getopt_Bool", 1); /* "petsc4py/PETSc/petscopt.pxi":63 * * cdef getopt_Bool(PetscOptions opt, const char *pre, const char *name, object deft): * cdef PetscBool value = PETSC_FALSE # <<<<<<<<<<<<<< * cdef PetscBool flag = PETSC_FALSE * CHKERR( PetscOptionsGetBool(opt, pre, name, &value, &flag) ) */ __pyx_v_value = PETSC_FALSE; /* "petsc4py/PETSc/petscopt.pxi":64 * cdef getopt_Bool(PetscOptions opt, const char *pre, const char *name, object deft): * cdef PetscBool value = PETSC_FALSE * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( PetscOptionsGetBool(opt, pre, name, &value, &flag) ) * if flag==PETSC_TRUE: return toBool(value) */ __pyx_v_flag = PETSC_FALSE; /* "petsc4py/PETSc/petscopt.pxi":65 * cdef PetscBool value = PETSC_FALSE * cdef PetscBool flag = PETSC_FALSE * CHKERR( PetscOptionsGetBool(opt, pre, name, &value, &flag) ) # <<<<<<<<<<<<<< * if flag==PETSC_TRUE: return toBool(value) * if deft is not None: return deft */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsGetBool(__pyx_v_opt, __pyx_v_pre, __pyx_v_name, (&__pyx_v_value), (&__pyx_v_flag))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(4, 65, __pyx_L1_error) /* "petsc4py/PETSc/petscopt.pxi":66 * cdef PetscBool flag = PETSC_FALSE * CHKERR( PetscOptionsGetBool(opt, pre, name, &value, &flag) ) * if flag==PETSC_TRUE: return toBool(value) # <<<<<<<<<<<<<< * if deft is not None: return deft * raise KeyError(opt2str(pre, name)) */ __pyx_t_2 = (__pyx_v_flag == PETSC_TRUE); if (__pyx_t_2) { __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } /* "petsc4py/PETSc/petscopt.pxi":67 * CHKERR( PetscOptionsGetBool(opt, pre, name, &value, &flag) ) * if flag==PETSC_TRUE: return toBool(value) * if deft is not None: return deft # <<<<<<<<<<<<<< * raise KeyError(opt2str(pre, name)) * */ __pyx_t_2 = (__pyx_v_deft != Py_None); if (__pyx_t_2) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_deft); __pyx_r = __pyx_v_deft; goto __pyx_L0; } /* "petsc4py/PETSc/petscopt.pxi":68 * if flag==PETSC_TRUE: return toBool(value) * if deft is not None: return deft * raise KeyError(opt2str(pre, name)) # <<<<<<<<<<<<<< * * cdef getopt_Int(PetscOptions opt, const char *pre, const char *name, object deft): */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_opt2str(__pyx_v_pre, __pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(4, 68, __pyx_L1_error) /* "petsc4py/PETSc/petscopt.pxi":62 * return '(prefix:%s, name:%s)' % (p, n) * * cdef getopt_Bool(PetscOptions opt, const char *pre, const char *name, object deft): # <<<<<<<<<<<<<< * cdef PetscBool value = PETSC_FALSE * cdef PetscBool flag = PETSC_FALSE */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.getopt_Bool", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscopt.pxi":70 * raise KeyError(opt2str(pre, name)) * * cdef getopt_Int(PetscOptions opt, const char *pre, const char *name, object deft): # <<<<<<<<<<<<<< * cdef PetscInt value = 0 * cdef PetscBool flag = PETSC_FALSE */ static PyObject *__pyx_f_8petsc4py_5PETSc_getopt_Int(PetscOptions __pyx_v_opt, char const *__pyx_v_pre, char const *__pyx_v_name, PyObject *__pyx_v_deft) { PetscInt __pyx_v_value; PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getopt_Int", 1); /* "petsc4py/PETSc/petscopt.pxi":71 * * cdef getopt_Int(PetscOptions opt, const char *pre, const char *name, object deft): * cdef PetscInt value = 0 # <<<<<<<<<<<<<< * cdef PetscBool flag = PETSC_FALSE * CHKERR( PetscOptionsGetInt(opt, pre, name, &value, &flag) ) */ __pyx_v_value = 0; /* "petsc4py/PETSc/petscopt.pxi":72 * cdef getopt_Int(PetscOptions opt, const char *pre, const char *name, object deft): * cdef PetscInt value = 0 * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( PetscOptionsGetInt(opt, pre, name, &value, &flag) ) * if flag==PETSC_TRUE: return toInt(value) */ __pyx_v_flag = PETSC_FALSE; /* "petsc4py/PETSc/petscopt.pxi":73 * cdef PetscInt value = 0 * cdef PetscBool flag = PETSC_FALSE * CHKERR( PetscOptionsGetInt(opt, pre, name, &value, &flag) ) # <<<<<<<<<<<<<< * if flag==PETSC_TRUE: return toInt(value) * if deft is not None: return deft */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsGetInt(__pyx_v_opt, __pyx_v_pre, __pyx_v_name, (&__pyx_v_value), (&__pyx_v_flag))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(4, 73, __pyx_L1_error) /* "petsc4py/PETSc/petscopt.pxi":74 * cdef PetscBool flag = PETSC_FALSE * CHKERR( PetscOptionsGetInt(opt, pre, name, &value, &flag) ) * if flag==PETSC_TRUE: return toInt(value) # <<<<<<<<<<<<<< * if deft is not None: return deft * raise KeyError(opt2str(pre, name)) */ __pyx_t_2 = (__pyx_v_flag == PETSC_TRUE); if (__pyx_t_2) { __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } /* "petsc4py/PETSc/petscopt.pxi":75 * CHKERR( PetscOptionsGetInt(opt, pre, name, &value, &flag) ) * if flag==PETSC_TRUE: return toInt(value) * if deft is not None: return deft # <<<<<<<<<<<<<< * raise KeyError(opt2str(pre, name)) * */ __pyx_t_2 = (__pyx_v_deft != Py_None); if (__pyx_t_2) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_deft); __pyx_r = __pyx_v_deft; goto __pyx_L0; } /* "petsc4py/PETSc/petscopt.pxi":76 * if flag==PETSC_TRUE: return toInt(value) * if deft is not None: return deft * raise KeyError(opt2str(pre, name)) # <<<<<<<<<<<<<< * * cdef getopt_Real(PetscOptions opt, const char *pre, const char *name, object deft): */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_opt2str(__pyx_v_pre, __pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(4, 76, __pyx_L1_error) /* "petsc4py/PETSc/petscopt.pxi":70 * raise KeyError(opt2str(pre, name)) * * cdef getopt_Int(PetscOptions opt, const char *pre, const char *name, object deft): # <<<<<<<<<<<<<< * cdef PetscInt value = 0 * cdef PetscBool flag = PETSC_FALSE */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.getopt_Int", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscopt.pxi":78 * raise KeyError(opt2str(pre, name)) * * cdef getopt_Real(PetscOptions opt, const char *pre, const char *name, object deft): # <<<<<<<<<<<<<< * cdef PetscReal value = 0 * cdef PetscBool flag = PETSC_FALSE */ static PyObject *__pyx_f_8petsc4py_5PETSc_getopt_Real(PetscOptions __pyx_v_opt, char const *__pyx_v_pre, char const *__pyx_v_name, PyObject *__pyx_v_deft) { PetscReal __pyx_v_value; PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getopt_Real", 1); /* "petsc4py/PETSc/petscopt.pxi":79 * * cdef getopt_Real(PetscOptions opt, const char *pre, const char *name, object deft): * cdef PetscReal value = 0 # <<<<<<<<<<<<<< * cdef PetscBool flag = PETSC_FALSE * CHKERR( PetscOptionsGetReal(opt, pre, name, &value, &flag) ) */ __pyx_v_value = 0.0; /* "petsc4py/PETSc/petscopt.pxi":80 * cdef getopt_Real(PetscOptions opt, const char *pre, const char *name, object deft): * cdef PetscReal value = 0 * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( PetscOptionsGetReal(opt, pre, name, &value, &flag) ) * if flag==PETSC_TRUE: return toReal(value) */ __pyx_v_flag = PETSC_FALSE; /* "petsc4py/PETSc/petscopt.pxi":81 * cdef PetscReal value = 0 * cdef PetscBool flag = PETSC_FALSE * CHKERR( PetscOptionsGetReal(opt, pre, name, &value, &flag) ) # <<<<<<<<<<<<<< * if flag==PETSC_TRUE: return toReal(value) * if deft is not None: return deft */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsGetReal(__pyx_v_opt, __pyx_v_pre, __pyx_v_name, (&__pyx_v_value), (&__pyx_v_flag))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(4, 81, __pyx_L1_error) /* "petsc4py/PETSc/petscopt.pxi":82 * cdef PetscBool flag = PETSC_FALSE * CHKERR( PetscOptionsGetReal(opt, pre, name, &value, &flag) ) * if flag==PETSC_TRUE: return toReal(value) # <<<<<<<<<<<<<< * if deft is not None: return deft * raise KeyError(opt2str(pre, name)) */ __pyx_t_2 = (__pyx_v_flag == PETSC_TRUE); if (__pyx_t_2) { __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } /* "petsc4py/PETSc/petscopt.pxi":83 * CHKERR( PetscOptionsGetReal(opt, pre, name, &value, &flag) ) * if flag==PETSC_TRUE: return toReal(value) * if deft is not None: return deft # <<<<<<<<<<<<<< * raise KeyError(opt2str(pre, name)) * */ __pyx_t_2 = (__pyx_v_deft != Py_None); if (__pyx_t_2) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_deft); __pyx_r = __pyx_v_deft; goto __pyx_L0; } /* "petsc4py/PETSc/petscopt.pxi":84 * if flag==PETSC_TRUE: return toReal(value) * if deft is not None: return deft * raise KeyError(opt2str(pre, name)) # <<<<<<<<<<<<<< * * cdef getopt_Scalar(PetscOptions opt, const char *pre, const char *name, object deft): */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_opt2str(__pyx_v_pre, __pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(4, 84, __pyx_L1_error) /* "petsc4py/PETSc/petscopt.pxi":78 * raise KeyError(opt2str(pre, name)) * * cdef getopt_Real(PetscOptions opt, const char *pre, const char *name, object deft): # <<<<<<<<<<<<<< * cdef PetscReal value = 0 * cdef PetscBool flag = PETSC_FALSE */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.getopt_Real", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscopt.pxi":86 * raise KeyError(opt2str(pre, name)) * * cdef getopt_Scalar(PetscOptions opt, const char *pre, const char *name, object deft): # <<<<<<<<<<<<<< * cdef PetscScalar value = 0 * cdef PetscBool flag = PETSC_FALSE */ static PyObject *__pyx_f_8petsc4py_5PETSc_getopt_Scalar(PetscOptions __pyx_v_opt, char const *__pyx_v_pre, char const *__pyx_v_name, PyObject *__pyx_v_deft) { PetscScalar __pyx_v_value; PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getopt_Scalar", 1); /* "petsc4py/PETSc/petscopt.pxi":87 * * cdef getopt_Scalar(PetscOptions opt, const char *pre, const char *name, object deft): * cdef PetscScalar value = 0 # <<<<<<<<<<<<<< * cdef PetscBool flag = PETSC_FALSE * CHKERR( PetscOptionsGetScalar(opt, pre, name, &value, &flag) ) */ __pyx_v_value = 0.0; /* "petsc4py/PETSc/petscopt.pxi":88 * cdef getopt_Scalar(PetscOptions opt, const char *pre, const char *name, object deft): * cdef PetscScalar value = 0 * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( PetscOptionsGetScalar(opt, pre, name, &value, &flag) ) * if flag==PETSC_TRUE: return toScalar(value) */ __pyx_v_flag = PETSC_FALSE; /* "petsc4py/PETSc/petscopt.pxi":89 * cdef PetscScalar value = 0 * cdef PetscBool flag = PETSC_FALSE * CHKERR( PetscOptionsGetScalar(opt, pre, name, &value, &flag) ) # <<<<<<<<<<<<<< * if flag==PETSC_TRUE: return toScalar(value) * if deft is not None: return deft */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsGetScalar(__pyx_v_opt, __pyx_v_pre, __pyx_v_name, (&__pyx_v_value), (&__pyx_v_flag))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(4, 89, __pyx_L1_error) /* "petsc4py/PETSc/petscopt.pxi":90 * cdef PetscBool flag = PETSC_FALSE * CHKERR( PetscOptionsGetScalar(opt, pre, name, &value, &flag) ) * if flag==PETSC_TRUE: return toScalar(value) # <<<<<<<<<<<<<< * if deft is not None: return deft * raise KeyError(opt2str(pre, name)) */ __pyx_t_2 = (__pyx_v_flag == PETSC_TRUE); if (__pyx_t_2) { __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toScalar(__pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } /* "petsc4py/PETSc/petscopt.pxi":91 * CHKERR( PetscOptionsGetScalar(opt, pre, name, &value, &flag) ) * if flag==PETSC_TRUE: return toScalar(value) * if deft is not None: return deft # <<<<<<<<<<<<<< * raise KeyError(opt2str(pre, name)) * */ __pyx_t_2 = (__pyx_v_deft != Py_None); if (__pyx_t_2) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_deft); __pyx_r = __pyx_v_deft; goto __pyx_L0; } /* "petsc4py/PETSc/petscopt.pxi":92 * if flag==PETSC_TRUE: return toScalar(value) * if deft is not None: return deft * raise KeyError(opt2str(pre, name)) # <<<<<<<<<<<<<< * * cdef getopt_String(PetscOptions opt, const char *pre, const char *name, object deft): */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_opt2str(__pyx_v_pre, __pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(4, 92, __pyx_L1_error) /* "petsc4py/PETSc/petscopt.pxi":86 * raise KeyError(opt2str(pre, name)) * * cdef getopt_Scalar(PetscOptions opt, const char *pre, const char *name, object deft): # <<<<<<<<<<<<<< * cdef PetscScalar value = 0 * cdef PetscBool flag = PETSC_FALSE */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.getopt_Scalar", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscopt.pxi":94 * raise KeyError(opt2str(pre, name)) * * cdef getopt_String(PetscOptions opt, const char *pre, const char *name, object deft): # <<<<<<<<<<<<<< * cdef char value[1024+1] * cdef PetscBool flag = PETSC_FALSE */ static PyObject *__pyx_f_8petsc4py_5PETSc_getopt_String(PetscOptions __pyx_v_opt, char const *__pyx_v_pre, char const *__pyx_v_name, PyObject *__pyx_v_deft) { char __pyx_v_value[(0x400 + 1)]; PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getopt_String", 1); /* "petsc4py/PETSc/petscopt.pxi":96 * cdef getopt_String(PetscOptions opt, const char *pre, const char *name, object deft): * cdef char value[1024+1] * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( PetscOptionsGetString(opt, pre, name, value, 1024, &flag) ) * if flag==PETSC_TRUE: return bytes2str(value) */ __pyx_v_flag = PETSC_FALSE; /* "petsc4py/PETSc/petscopt.pxi":97 * cdef char value[1024+1] * cdef PetscBool flag = PETSC_FALSE * CHKERR( PetscOptionsGetString(opt, pre, name, value, 1024, &flag) ) # <<<<<<<<<<<<<< * if flag==PETSC_TRUE: return bytes2str(value) * if deft is not None: return deft */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsGetString(__pyx_v_opt, __pyx_v_pre, __pyx_v_name, __pyx_v_value, 0x400, (&__pyx_v_flag))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(4, 97, __pyx_L1_error) /* "petsc4py/PETSc/petscopt.pxi":98 * cdef PetscBool flag = PETSC_FALSE * CHKERR( PetscOptionsGetString(opt, pre, name, value, 1024, &flag) ) * if flag==PETSC_TRUE: return bytes2str(value) # <<<<<<<<<<<<<< * if deft is not None: return deft * raise KeyError(opt2str(pre, name)) */ __pyx_t_2 = (__pyx_v_flag == PETSC_TRUE); if (__pyx_t_2) { __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } /* "petsc4py/PETSc/petscopt.pxi":99 * CHKERR( PetscOptionsGetString(opt, pre, name, value, 1024, &flag) ) * if flag==PETSC_TRUE: return bytes2str(value) * if deft is not None: return deft # <<<<<<<<<<<<<< * raise KeyError(opt2str(pre, name)) * */ __pyx_t_2 = (__pyx_v_deft != Py_None); if (__pyx_t_2) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_deft); __pyx_r = __pyx_v_deft; goto __pyx_L0; } /* "petsc4py/PETSc/petscopt.pxi":100 * if flag==PETSC_TRUE: return bytes2str(value) * if deft is not None: return deft * raise KeyError(opt2str(pre, name)) # <<<<<<<<<<<<<< * * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_opt2str(__pyx_v_pre, __pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(4, 100, __pyx_L1_error) /* "petsc4py/PETSc/petscopt.pxi":94 * raise KeyError(opt2str(pre, name)) * * cdef getopt_String(PetscOptions opt, const char *pre, const char *name, object deft): # <<<<<<<<<<<<<< * cdef char value[1024+1] * cdef PetscBool flag = PETSC_FALSE */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.getopt_String", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscopt.pxi":110 * OPT_STRING * * cdef getpair(prefix, name, const char **pr, const char **nm): # <<<<<<<<<<<<<< * # -- * cdef const char *p = NULL */ static PyObject *__pyx_f_8petsc4py_5PETSc_getpair(PyObject *__pyx_v_prefix, PyObject *__pyx_v_name, char const **__pyx_v_pr, char const **__pyx_v_nm) { char const *__pyx_v_p; char const *__pyx_v_n; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getpair", 0); __Pyx_INCREF(__pyx_v_prefix); __Pyx_INCREF(__pyx_v_name); /* "petsc4py/PETSc/petscopt.pxi":112 * cdef getpair(prefix, name, const char **pr, const char **nm): * # -- * cdef const char *p = NULL # <<<<<<<<<<<<<< * prefix = str2bytes(prefix, &p) * if p != NULL and p[0] == c'-': */ __pyx_v_p = NULL; /* "petsc4py/PETSc/petscopt.pxi":113 * # -- * cdef const char *p = NULL * prefix = str2bytes(prefix, &p) # <<<<<<<<<<<<<< * if p != NULL and p[0] == c'-': * p = &p[1] */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_prefix, (&__pyx_v_p)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_prefix, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscopt.pxi":114 * cdef const char *p = NULL * prefix = str2bytes(prefix, &p) * if p != NULL and p[0] == c'-': # <<<<<<<<<<<<<< * p = &p[1] * # -- */ __pyx_t_3 = (__pyx_v_p != NULL); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = ((__pyx_v_p[0]) == '-'); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { /* "petsc4py/PETSc/petscopt.pxi":115 * prefix = str2bytes(prefix, &p) * if p != NULL and p[0] == c'-': * p = &p[1] # <<<<<<<<<<<<<< * # -- * cdef const char *n = NULL */ __pyx_v_p = (&(__pyx_v_p[1])); /* "petsc4py/PETSc/petscopt.pxi":114 * cdef const char *p = NULL * prefix = str2bytes(prefix, &p) * if p != NULL and p[0] == c'-': # <<<<<<<<<<<<<< * p = &p[1] * # -- */ } /* "petsc4py/PETSc/petscopt.pxi":117 * p = &p[1] * # -- * cdef const char *n = NULL # <<<<<<<<<<<<<< * name = str2bytes(name, &n) * if n != NULL and n[0] != c'-': */ __pyx_v_n = NULL; /* "petsc4py/PETSc/petscopt.pxi":118 * # -- * cdef const char *n = NULL * name = str2bytes(name, &n) # <<<<<<<<<<<<<< * if n != NULL and n[0] != c'-': * name = b'-' + name */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_n)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscopt.pxi":119 * cdef const char *n = NULL * name = str2bytes(name, &n) * if n != NULL and n[0] != c'-': # <<<<<<<<<<<<<< * name = b'-' + name * name = str2bytes(name, &n) */ __pyx_t_3 = (__pyx_v_n != NULL); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L7_bool_binop_done; } __pyx_t_3 = ((__pyx_v_n[0]) != '-'); __pyx_t_2 = __pyx_t_3; __pyx_L7_bool_binop_done:; if (__pyx_t_2) { /* "petsc4py/PETSc/petscopt.pxi":120 * name = str2bytes(name, &n) * if n != NULL and n[0] != c'-': * name = b'-' + name # <<<<<<<<<<<<<< * name = str2bytes(name, &n) * # -- */ __pyx_t_1 = PyNumber_Add(__pyx_kp_b__18, __pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscopt.pxi":121 * if n != NULL and n[0] != c'-': * name = b'-' + name * name = str2bytes(name, &n) # <<<<<<<<<<<<<< * # -- * pr[0] = p */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_n)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscopt.pxi":119 * cdef const char *n = NULL * name = str2bytes(name, &n) * if n != NULL and n[0] != c'-': # <<<<<<<<<<<<<< * name = b'-' + name * name = str2bytes(name, &n) */ } /* "petsc4py/PETSc/petscopt.pxi":123 * name = str2bytes(name, &n) * # -- * pr[0] = p # <<<<<<<<<<<<<< * nm[0] = n * return (prefix, name) */ (__pyx_v_pr[0]) = __pyx_v_p; /* "petsc4py/PETSc/petscopt.pxi":124 * # -- * pr[0] = p * nm[0] = n # <<<<<<<<<<<<<< * return (prefix, name) * */ (__pyx_v_nm[0]) = __pyx_v_n; /* "petsc4py/PETSc/petscopt.pxi":125 * pr[0] = p * nm[0] = n * return (prefix, name) # <<<<<<<<<<<<<< * * cdef getopt(PetscOptions opt, PetscOptType otype, prefix, name, deft): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_prefix); __Pyx_GIVEREF(__pyx_v_prefix); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_prefix)) __PYX_ERR(4, 125, __pyx_L1_error); __Pyx_INCREF(__pyx_v_name); __Pyx_GIVEREF(__pyx_v_name); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_name)) __PYX_ERR(4, 125, __pyx_L1_error); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/petscopt.pxi":110 * OPT_STRING * * cdef getpair(prefix, name, const char **pr, const char **nm): # <<<<<<<<<<<<<< * # -- * cdef const char *p = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.getpair", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_prefix); __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscopt.pxi":127 * return (prefix, name) * * cdef getopt(PetscOptions opt, PetscOptType otype, prefix, name, deft): # <<<<<<<<<<<<<< * cdef const char *pr = NULL * cdef const char *nm = NULL */ static PyObject *__pyx_f_8petsc4py_5PETSc_getopt(PetscOptions __pyx_v_opt, enum __pyx_t_8petsc4py_5PETSc_PetscOptType __pyx_v_otype, PyObject *__pyx_v_prefix, PyObject *__pyx_v_name, PyObject *__pyx_v_deft) { char const *__pyx_v_pr; char const *__pyx_v_nm; CYTHON_UNUSED PyObject *__pyx_v_tmp = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getopt", 1); /* "petsc4py/PETSc/petscopt.pxi":128 * * cdef getopt(PetscOptions opt, PetscOptType otype, prefix, name, deft): * cdef const char *pr = NULL # <<<<<<<<<<<<<< * cdef const char *nm = NULL * tmp = getpair(prefix, name, &pr, &nm) */ __pyx_v_pr = NULL; /* "petsc4py/PETSc/petscopt.pxi":129 * cdef getopt(PetscOptions opt, PetscOptType otype, prefix, name, deft): * cdef const char *pr = NULL * cdef const char *nm = NULL # <<<<<<<<<<<<<< * tmp = getpair(prefix, name, &pr, &nm) * if otype == OPT_BOOL : return getopt_Bool (opt, pr, nm, deft) */ __pyx_v_nm = NULL; /* "petsc4py/PETSc/petscopt.pxi":130 * cdef const char *pr = NULL * cdef const char *nm = NULL * tmp = getpair(prefix, name, &pr, &nm) # <<<<<<<<<<<<<< * if otype == OPT_BOOL : return getopt_Bool (opt, pr, nm, deft) * if otype == OPT_INT : return getopt_Int (opt, pr, nm, deft) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_getpair(__pyx_v_prefix, __pyx_v_name, (&__pyx_v_pr), (&__pyx_v_nm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_tmp = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/petscopt.pxi":131 * cdef const char *nm = NULL * tmp = getpair(prefix, name, &pr, &nm) * if otype == OPT_BOOL : return getopt_Bool (opt, pr, nm, deft) # <<<<<<<<<<<<<< * if otype == OPT_INT : return getopt_Int (opt, pr, nm, deft) * if otype == OPT_REAL : return getopt_Real (opt, pr, nm, deft) */ __pyx_t_2 = (__pyx_v_otype == __pyx_e_8petsc4py_5PETSc_OPT_BOOL); if (__pyx_t_2) { __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_getopt_Bool(__pyx_v_opt, __pyx_v_pr, __pyx_v_nm, __pyx_v_deft); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; } /* "petsc4py/PETSc/petscopt.pxi":132 * tmp = getpair(prefix, name, &pr, &nm) * if otype == OPT_BOOL : return getopt_Bool (opt, pr, nm, deft) * if otype == OPT_INT : return getopt_Int (opt, pr, nm, deft) # <<<<<<<<<<<<<< * if otype == OPT_REAL : return getopt_Real (opt, pr, nm, deft) * if otype == OPT_SCALAR : return getopt_Scalar (opt, pr, nm, deft) */ __pyx_t_2 = (__pyx_v_otype == __pyx_e_8petsc4py_5PETSc_OPT_INT); if (__pyx_t_2) { __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_getopt_Int(__pyx_v_opt, __pyx_v_pr, __pyx_v_nm, __pyx_v_deft); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; } /* "petsc4py/PETSc/petscopt.pxi":133 * if otype == OPT_BOOL : return getopt_Bool (opt, pr, nm, deft) * if otype == OPT_INT : return getopt_Int (opt, pr, nm, deft) * if otype == OPT_REAL : return getopt_Real (opt, pr, nm, deft) # <<<<<<<<<<<<<< * if otype == OPT_SCALAR : return getopt_Scalar (opt, pr, nm, deft) * if otype == OPT_STRING : return getopt_String (opt, pr, nm, deft) */ __pyx_t_2 = (__pyx_v_otype == __pyx_e_8petsc4py_5PETSc_OPT_REAL); if (__pyx_t_2) { __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_getopt_Real(__pyx_v_opt, __pyx_v_pr, __pyx_v_nm, __pyx_v_deft); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; } /* "petsc4py/PETSc/petscopt.pxi":134 * if otype == OPT_INT : return getopt_Int (opt, pr, nm, deft) * if otype == OPT_REAL : return getopt_Real (opt, pr, nm, deft) * if otype == OPT_SCALAR : return getopt_Scalar (opt, pr, nm, deft) # <<<<<<<<<<<<<< * if otype == OPT_STRING : return getopt_String (opt, pr, nm, deft) * */ __pyx_t_2 = (__pyx_v_otype == __pyx_e_8petsc4py_5PETSc_OPT_SCALAR); if (__pyx_t_2) { __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_getopt_Scalar(__pyx_v_opt, __pyx_v_pr, __pyx_v_nm, __pyx_v_deft); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; } /* "petsc4py/PETSc/petscopt.pxi":135 * if otype == OPT_REAL : return getopt_Real (opt, pr, nm, deft) * if otype == OPT_SCALAR : return getopt_Scalar (opt, pr, nm, deft) * if otype == OPT_STRING : return getopt_String (opt, pr, nm, deft) # <<<<<<<<<<<<<< * * */ __pyx_t_2 = (__pyx_v_otype == __pyx_e_8petsc4py_5PETSc_OPT_STRING); if (__pyx_t_2) { __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_getopt_String(__pyx_v_opt, __pyx_v_pr, __pyx_v_nm, __pyx_v_deft); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; } /* "petsc4py/PETSc/petscopt.pxi":127 * return (prefix, name) * * cdef getopt(PetscOptions opt, PetscOptType otype, prefix, name, deft): # <<<<<<<<<<<<<< * cdef const char *pr = NULL * cdef const char *nm = NULL */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.getopt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_tmp); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscopt.pxi":140 * # simple minded options parser * * cdef tokenize(options): # <<<<<<<<<<<<<< * cdef PetscToken t = NULL * cdef const char *s = NULL */ static PyObject *__pyx_f_8petsc4py_5PETSc_tokenize(PyObject *__pyx_v_options) { PetscToken __pyx_v_t; char const *__pyx_v_s; char const *__pyx_v_p; PyObject *__pyx_v_tokens = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_t_3; int __pyx_t_4; int __pyx_t_5; int __pyx_t_6; char const *__pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("tokenize", 0); __Pyx_INCREF(__pyx_v_options); /* "petsc4py/PETSc/petscopt.pxi":141 * * cdef tokenize(options): * cdef PetscToken t = NULL # <<<<<<<<<<<<<< * cdef const char *s = NULL * cdef const char *p = NULL */ __pyx_v_t = NULL; /* "petsc4py/PETSc/petscopt.pxi":142 * cdef tokenize(options): * cdef PetscToken t = NULL * cdef const char *s = NULL # <<<<<<<<<<<<<< * cdef const char *p = NULL * options = str2bytes(options, &s) */ __pyx_v_s = NULL; /* "petsc4py/PETSc/petscopt.pxi":143 * cdef PetscToken t = NULL * cdef const char *s = NULL * cdef const char *p = NULL # <<<<<<<<<<<<<< * options = str2bytes(options, &s) * cdef list tokens = [] */ __pyx_v_p = NULL; /* "petsc4py/PETSc/petscopt.pxi":144 * cdef const char *s = NULL * cdef const char *p = NULL * options = str2bytes(options, &s) # <<<<<<<<<<<<<< * cdef list tokens = [] * CHKERR( PetscTokenCreate(s, c' ', &t) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_options, (&__pyx_v_s)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_options, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscopt.pxi":145 * cdef const char *p = NULL * options = str2bytes(options, &s) * cdef list tokens = [] # <<<<<<<<<<<<<< * CHKERR( PetscTokenCreate(s, c' ', &t) ) * try: */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_tokens = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscopt.pxi":146 * options = str2bytes(options, &s) * cdef list tokens = [] * CHKERR( PetscTokenCreate(s, c' ', &t) ) # <<<<<<<<<<<<<< * try: * CHKERR( PetscTokenFind(t, &p) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscTokenCreate(__pyx_v_s, ' ', (&__pyx_v_t))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(4, 146, __pyx_L1_error) /* "petsc4py/PETSc/petscopt.pxi":147 * cdef list tokens = [] * CHKERR( PetscTokenCreate(s, c' ', &t) ) * try: # <<<<<<<<<<<<<< * CHKERR( PetscTokenFind(t, &p) ) * while p != NULL: */ /*try:*/ { /* "petsc4py/PETSc/petscopt.pxi":148 * CHKERR( PetscTokenCreate(s, c' ', &t) ) * try: * CHKERR( PetscTokenFind(t, &p) ) # <<<<<<<<<<<<<< * while p != NULL: * tokens.append(bytes2str(p)) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscTokenFind(__pyx_v_t, ((char **)(&__pyx_v_p)))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(4, 148, __pyx_L4_error) /* "petsc4py/PETSc/petscopt.pxi":149 * try: * CHKERR( PetscTokenFind(t, &p) ) * while p != NULL: # <<<<<<<<<<<<<< * tokens.append(bytes2str(p)) * CHKERR( PetscTokenFind(t, &p) ) */ while (1) { __pyx_t_3 = (__pyx_v_p != NULL); if (!__pyx_t_3) break; /* "petsc4py/PETSc/petscopt.pxi":150 * CHKERR( PetscTokenFind(t, &p) ) * while p != NULL: * tokens.append(bytes2str(p)) # <<<<<<<<<<<<<< * CHKERR( PetscTokenFind(t, &p) ) * finally: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_p); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 150, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_tokens, __pyx_t_1); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(4, 150, __pyx_L4_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscopt.pxi":151 * while p != NULL: * tokens.append(bytes2str(p)) * CHKERR( PetscTokenFind(t, &p) ) # <<<<<<<<<<<<<< * finally: * CHKERR( PetscTokenDestroy(&t) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscTokenFind(__pyx_v_t, ((char **)(&__pyx_v_p)))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(4, 151, __pyx_L4_error) } } /* "petsc4py/PETSc/petscopt.pxi":153 * CHKERR( PetscTokenFind(t, &p) ) * finally: * CHKERR( PetscTokenDestroy(&t) ) # <<<<<<<<<<<<<< * return tokens * */ /*finally:*/ { /*normal exit:*/{ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscTokenDestroy((&__pyx_v_t))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(4, 153, __pyx_L1_error) goto __pyx_L5; } __pyx_L4_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10) < 0)) __Pyx_ErrFetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); __pyx_t_5 = __pyx_lineno; __pyx_t_6 = __pyx_clineno; __pyx_t_7 = __pyx_filename; { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscTokenDestroy((&__pyx_v_t))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(4, 153, __pyx_L9_error) } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); } __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ErrRestore(__pyx_t_8, __pyx_t_9, __pyx_t_10); __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_lineno = __pyx_t_5; __pyx_clineno = __pyx_t_6; __pyx_filename = __pyx_t_7; goto __pyx_L1_error; __pyx_L9_error:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); } __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; goto __pyx_L1_error; } __pyx_L5:; } /* "petsc4py/PETSc/petscopt.pxi":154 * finally: * CHKERR( PetscTokenDestroy(&t) ) * return tokens # <<<<<<<<<<<<<< * * cdef bint iskey(key): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_tokens); __pyx_r = __pyx_v_tokens; goto __pyx_L0; /* "petsc4py/PETSc/petscopt.pxi":140 * # simple minded options parser * * cdef tokenize(options): # <<<<<<<<<<<<<< * cdef PetscToken t = NULL * cdef const char *s = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.tokenize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_tokens); __Pyx_XDECREF(__pyx_v_options); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscopt.pxi":156 * return tokens * * cdef bint iskey(key): # <<<<<<<<<<<<<< * cdef const char *k = NULL * cdef PetscBool b = PETSC_FALSE */ static int __pyx_f_8petsc4py_5PETSc_iskey(PyObject *__pyx_v_key) { char const *__pyx_v_k; PetscBool __pyx_v_b; int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("iskey", 0); __Pyx_INCREF(__pyx_v_key); /* "petsc4py/PETSc/petscopt.pxi":157 * * cdef bint iskey(key): * cdef const char *k = NULL # <<<<<<<<<<<<<< * cdef PetscBool b = PETSC_FALSE * if key: */ __pyx_v_k = NULL; /* "petsc4py/PETSc/petscopt.pxi":158 * cdef bint iskey(key): * cdef const char *k = NULL * cdef PetscBool b = PETSC_FALSE # <<<<<<<<<<<<<< * if key: * key = str2bytes(key, &k) */ __pyx_v_b = PETSC_FALSE; /* "petsc4py/PETSc/petscopt.pxi":159 * cdef const char *k = NULL * cdef PetscBool b = PETSC_FALSE * if key: # <<<<<<<<<<<<<< * key = str2bytes(key, &k) * CHKERR( PetscOptionsValidKey(k, &b) ) */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_key); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 159, __pyx_L1_error) if (__pyx_t_1) { /* "petsc4py/PETSc/petscopt.pxi":160 * cdef PetscBool b = PETSC_FALSE * if key: * key = str2bytes(key, &k) # <<<<<<<<<<<<<< * CHKERR( PetscOptionsValidKey(k, &b) ) * if b == PETSC_TRUE: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_key, (&__pyx_v_k)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_key, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscopt.pxi":161 * if key: * key = str2bytes(key, &k) * CHKERR( PetscOptionsValidKey(k, &b) ) # <<<<<<<<<<<<<< * if b == PETSC_TRUE: * return True */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsValidKey(__pyx_v_k, (&__pyx_v_b))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(4, 161, __pyx_L1_error) /* "petsc4py/PETSc/petscopt.pxi":162 * key = str2bytes(key, &k) * CHKERR( PetscOptionsValidKey(k, &b) ) * if b == PETSC_TRUE: # <<<<<<<<<<<<<< * return True * return False */ __pyx_t_1 = (__pyx_v_b == PETSC_TRUE); if (__pyx_t_1) { /* "petsc4py/PETSc/petscopt.pxi":163 * CHKERR( PetscOptionsValidKey(k, &b) ) * if b == PETSC_TRUE: * return True # <<<<<<<<<<<<<< * return False * */ __pyx_r = 1; goto __pyx_L0; /* "petsc4py/PETSc/petscopt.pxi":162 * key = str2bytes(key, &k) * CHKERR( PetscOptionsValidKey(k, &b) ) * if b == PETSC_TRUE: # <<<<<<<<<<<<<< * return True * return False */ } /* "petsc4py/PETSc/petscopt.pxi":159 * cdef const char *k = NULL * cdef PetscBool b = PETSC_FALSE * if key: # <<<<<<<<<<<<<< * key = str2bytes(key, &k) * CHKERR( PetscOptionsValidKey(k, &b) ) */ } /* "petsc4py/PETSc/petscopt.pxi":164 * if b == PETSC_TRUE: * return True * return False # <<<<<<<<<<<<<< * * cdef gettok(tokens): */ __pyx_r = 0; goto __pyx_L0; /* "petsc4py/PETSc/petscopt.pxi":156 * return tokens * * cdef bint iskey(key): # <<<<<<<<<<<<<< * cdef const char *k = NULL * cdef PetscBool b = PETSC_FALSE */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.iskey", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_key); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscopt.pxi":166 * return False * * cdef gettok(tokens): # <<<<<<<<<<<<<< * if tokens: * return tokens.pop(0) */ static PyObject *__pyx_f_8petsc4py_5PETSc_gettok(PyObject *__pyx_v_tokens) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("gettok", 1); /* "petsc4py/PETSc/petscopt.pxi":167 * * cdef gettok(tokens): * if tokens: # <<<<<<<<<<<<<< * return tokens.pop(0) * else: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_tokens); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 167, __pyx_L1_error) if (__pyx_t_1) { /* "petsc4py/PETSc/petscopt.pxi":168 * cdef gettok(tokens): * if tokens: * return tokens.pop(0) # <<<<<<<<<<<<<< * else: * return None */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_PopIndex(__pyx_v_tokens, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/petscopt.pxi":167 * * cdef gettok(tokens): * if tokens: # <<<<<<<<<<<<<< * return tokens.pop(0) * else: */ } /* "petsc4py/PETSc/petscopt.pxi":170 * return tokens.pop(0) * else: * return None # <<<<<<<<<<<<<< * * cdef getkey(key, prefix): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } /* "petsc4py/PETSc/petscopt.pxi":166 * return False * * cdef gettok(tokens): # <<<<<<<<<<<<<< * if tokens: * return tokens.pop(0) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.gettok", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscopt.pxi":172 * return None * * cdef getkey(key, prefix): # <<<<<<<<<<<<<< * if not iskey(key): * return None */ static PyObject *__pyx_f_8petsc4py_5PETSc_getkey(PyObject *__pyx_v_key, PyObject *__pyx_v_prefix) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getkey", 0); __Pyx_INCREF(__pyx_v_key); /* "petsc4py/PETSc/petscopt.pxi":173 * * cdef getkey(key, prefix): * if not iskey(key): # <<<<<<<<<<<<<< * return None * key = key[1:] */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_iskey(__pyx_v_key); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(4, 173, __pyx_L1_error) __pyx_t_2 = (!__pyx_t_1); if (__pyx_t_2) { /* "petsc4py/PETSc/petscopt.pxi":174 * cdef getkey(key, prefix): * if not iskey(key): * return None # <<<<<<<<<<<<<< * key = key[1:] * if key[0] == '-': */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "petsc4py/PETSc/petscopt.pxi":173 * * cdef getkey(key, prefix): * if not iskey(key): # <<<<<<<<<<<<<< * return None * key = key[1:] */ } /* "petsc4py/PETSc/petscopt.pxi":175 * if not iskey(key): * return None * key = key[1:] # <<<<<<<<<<<<<< * if key[0] == '-': * key = key[1:] */ __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_key, 1, 0, NULL, NULL, &__pyx_slice__20, 1, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_key, __pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/petscopt.pxi":176 * return None * key = key[1:] * if key[0] == '-': # <<<<<<<<<<<<<< * key = key[1:] * if not key.startswith(prefix): */ __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_key, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_kp_s__18, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(4, 176, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { /* "petsc4py/PETSc/petscopt.pxi":177 * key = key[1:] * if key[0] == '-': * key = key[1:] # <<<<<<<<<<<<<< * if not key.startswith(prefix): * return None */ __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_key, 1, 0, NULL, NULL, &__pyx_slice__20, 1, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_key, __pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/petscopt.pxi":176 * return None * key = key[1:] * if key[0] == '-': # <<<<<<<<<<<<<< * key = key[1:] * if not key.startswith(prefix): */ } /* "petsc4py/PETSc/petscopt.pxi":178 * if key[0] == '-': * key = key[1:] * if not key.startswith(prefix): # <<<<<<<<<<<<<< * return None * return key.replace(prefix, '', 1) */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_startswith); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_prefix}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(4, 178, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = (!__pyx_t_2); if (__pyx_t_1) { /* "petsc4py/PETSc/petscopt.pxi":179 * key = key[1:] * if not key.startswith(prefix): * return None # <<<<<<<<<<<<<< * return key.replace(prefix, '', 1) * */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "petsc4py/PETSc/petscopt.pxi":178 * if key[0] == '-': * key = key[1:] * if not key.startswith(prefix): # <<<<<<<<<<<<<< * return None * return key.replace(prefix, '', 1) */ } /* "petsc4py/PETSc/petscopt.pxi":180 * if not key.startswith(prefix): * return None * return key.replace(prefix, '', 1) # <<<<<<<<<<<<<< * * cdef parseopt(options, prefix): */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_replace); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_5, __pyx_v_prefix, __pyx_kp_s__10, __pyx_int_1}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 3+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "petsc4py/PETSc/petscopt.pxi":172 * return None * * cdef getkey(key, prefix): # <<<<<<<<<<<<<< * if not iskey(key): * return None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.getkey", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_key); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscopt.pxi":182 * return key.replace(prefix, '', 1) * * cdef parseopt(options, prefix): # <<<<<<<<<<<<<< * if isinstance(options, str): * tokens = tokenize(options) */ static PyObject *__pyx_f_8petsc4py_5PETSc_parseopt(PyObject *__pyx_v_options, PyObject *__pyx_v_prefix) { PyObject *__pyx_v_tokens = NULL; PyObject *__pyx_v_opts = NULL; PyObject *__pyx_v_first = NULL; PyObject *__pyx_v_key = NULL; PyObject *__pyx_v_second = NULL; PyObject *__pyx_v_value = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("parseopt", 0); __Pyx_INCREF(__pyx_v_prefix); /* "petsc4py/PETSc/petscopt.pxi":183 * * cdef parseopt(options, prefix): * if isinstance(options, str): # <<<<<<<<<<<<<< * tokens = tokenize(options) * else: */ __pyx_t_1 = PyString_Check(__pyx_v_options); if (__pyx_t_1) { /* "petsc4py/PETSc/petscopt.pxi":184 * cdef parseopt(options, prefix): * if isinstance(options, str): * tokens = tokenize(options) # <<<<<<<<<<<<<< * else: * tokens = list(options) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_tokenize(__pyx_v_options); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_tokens = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/petscopt.pxi":183 * * cdef parseopt(options, prefix): * if isinstance(options, str): # <<<<<<<<<<<<<< * tokens = tokenize(options) * else: */ goto __pyx_L3; } /* "petsc4py/PETSc/petscopt.pxi":186 * tokens = tokenize(options) * else: * tokens = list(options) # <<<<<<<<<<<<<< * prefix = prefix or '' * # parser loop */ /*else*/ { __pyx_t_2 = PySequence_List(__pyx_v_options); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_tokens = __pyx_t_2; __pyx_t_2 = 0; } __pyx_L3:; /* "petsc4py/PETSc/petscopt.pxi":187 * else: * tokens = list(options) * prefix = prefix or '' # <<<<<<<<<<<<<< * # parser loop * opts = {} */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_prefix); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 187, __pyx_L1_error) if (!__pyx_t_1) { } else { __Pyx_INCREF(__pyx_v_prefix); __pyx_t_2 = __pyx_v_prefix; goto __pyx_L4_bool_binop_done; } __Pyx_INCREF(__pyx_kp_s__10); __pyx_t_2 = __pyx_kp_s__10; __pyx_L4_bool_binop_done:; __Pyx_DECREF_SET(__pyx_v_prefix, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscopt.pxi":189 * prefix = prefix or '' * # parser loop * opts = {} # <<<<<<<<<<<<<< * first = gettok(tokens) * while first: */ __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_opts = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscopt.pxi":190 * # parser loop * opts = {} * first = gettok(tokens) # <<<<<<<<<<<<<< * while first: * key = getkey(first, prefix) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_gettok(__pyx_v_tokens); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_first = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/petscopt.pxi":191 * opts = {} * first = gettok(tokens) * while first: # <<<<<<<<<<<<<< * key = getkey(first, prefix) * if not key: */ while (1) { __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_first); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 191, __pyx_L1_error) if (!__pyx_t_1) break; /* "petsc4py/PETSc/petscopt.pxi":192 * first = gettok(tokens) * while first: * key = getkey(first, prefix) # <<<<<<<<<<<<<< * if not key: * first = gettok(tokens) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_getkey(__pyx_v_first, __pyx_v_prefix); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscopt.pxi":193 * while first: * key = getkey(first, prefix) * if not key: # <<<<<<<<<<<<<< * first = gettok(tokens) * else: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_key); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 193, __pyx_L1_error) __pyx_t_3 = (!__pyx_t_1); if (__pyx_t_3) { /* "petsc4py/PETSc/petscopt.pxi":194 * key = getkey(first, prefix) * if not key: * first = gettok(tokens) # <<<<<<<<<<<<<< * else: * second = gettok(tokens) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_gettok(__pyx_v_tokens); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_first, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscopt.pxi":193 * while first: * key = getkey(first, prefix) * if not key: # <<<<<<<<<<<<<< * first = gettok(tokens) * else: */ goto __pyx_L8; } /* "petsc4py/PETSc/petscopt.pxi":196 * first = gettok(tokens) * else: * second = gettok(tokens) # <<<<<<<<<<<<<< * if getkey(second, prefix): * value = None */ /*else*/ { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_gettok(__pyx_v_tokens); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_second, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscopt.pxi":197 * else: * second = gettok(tokens) * if getkey(second, prefix): # <<<<<<<<<<<<<< * value = None * first = second */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_getkey(__pyx_v_second, __pyx_v_prefix); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(4, 197, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { /* "petsc4py/PETSc/petscopt.pxi":198 * second = gettok(tokens) * if getkey(second, prefix): * value = None # <<<<<<<<<<<<<< * first = second * else: */ __Pyx_INCREF(Py_None); __Pyx_XDECREF_SET(__pyx_v_value, Py_None); /* "petsc4py/PETSc/petscopt.pxi":199 * if getkey(second, prefix): * value = None * first = second # <<<<<<<<<<<<<< * else: * value = second */ __Pyx_INCREF(__pyx_v_second); __Pyx_DECREF_SET(__pyx_v_first, __pyx_v_second); /* "petsc4py/PETSc/petscopt.pxi":197 * else: * second = gettok(tokens) * if getkey(second, prefix): # <<<<<<<<<<<<<< * value = None * first = second */ goto __pyx_L9; } /* "petsc4py/PETSc/petscopt.pxi":201 * first = second * else: * value = second # <<<<<<<<<<<<<< * first = gettok(tokens) * opts[key] = value */ /*else*/ { __Pyx_INCREF(__pyx_v_second); __Pyx_XDECREF_SET(__pyx_v_value, __pyx_v_second); /* "petsc4py/PETSc/petscopt.pxi":202 * else: * value = second * first = gettok(tokens) # <<<<<<<<<<<<<< * opts[key] = value * # we are done */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_gettok(__pyx_v_tokens); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_first, __pyx_t_2); __pyx_t_2 = 0; } __pyx_L9:; /* "petsc4py/PETSc/petscopt.pxi":203 * value = second * first = gettok(tokens) * opts[key] = value # <<<<<<<<<<<<<< * # we are done * return opts */ if (unlikely((PyDict_SetItem(__pyx_v_opts, __pyx_v_key, __pyx_v_value) < 0))) __PYX_ERR(4, 203, __pyx_L1_error) } __pyx_L8:; } /* "petsc4py/PETSc/petscopt.pxi":205 * opts[key] = value * # we are done * return opts # <<<<<<<<<<<<<< * * # */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_opts); __pyx_r = __pyx_v_opts; goto __pyx_L0; /* "petsc4py/PETSc/petscopt.pxi":182 * return key.replace(prefix, '', 1) * * cdef parseopt(options, prefix): # <<<<<<<<<<<<<< * if isinstance(options, str): * tokens = tokenize(options) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.parseopt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_tokens); __Pyx_XDECREF(__pyx_v_opts); __Pyx_XDECREF(__pyx_v_first); __Pyx_XDECREF(__pyx_v_key); __Pyx_XDECREF(__pyx_v_second); __Pyx_XDECREF(__pyx_v_value); __Pyx_XDECREF(__pyx_v_prefix); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscmpi.pxi":44 * ctypedef MPI_Op* PyMPIOpGet(object) except NULL * * cdef inline MPI_Comm mpi4py_Comm_Get( # <<<<<<<<<<<<<< * object comm, * ) except? MPI_COMM_NULL: */ static CYTHON_INLINE MPI_Comm __pyx_f_8petsc4py_5PETSc_mpi4py_Comm_Get(PyObject *__pyx_v_comm) { PyObject *__pyx_v_MPI = NULL; __pyx_t_8petsc4py_5PETSc_PyMPICommGet *__pyx_v_commget; MPI_Comm *__pyx_v_ptr; MPI_Comm __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; void *__pyx_t_3; int __pyx_t_4; MPI_Comm *__pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mpi4py_Comm_Get", 1); /* "petsc4py/PETSc/petscmpi.pxi":47 * object comm, * ) except? MPI_COMM_NULL: * from mpi4py import MPI # <<<<<<<<<<<<<< * cdef PyMPICommGet *commget = \ * Cython_ImportFunction( */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_MPI); __Pyx_GIVEREF(__pyx_n_s_MPI); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_MPI)) __PYX_ERR(17, 47, __pyx_L1_error); __pyx_t_2 = __Pyx_Import(__pyx_n_s_mpi4py, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_MPI); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_1); __pyx_v_MPI = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscmpi.pxi":49 * from mpi4py import MPI * cdef PyMPICommGet *commget = \ * Cython_ImportFunction( # <<<<<<<<<<<<<< * MPI, b"PyMPIComm_Get", b"MPI_Comm *(PyObject *)") * if commget == NULL: return MPI_COMM_NULL */ __pyx_t_3 = Cython_ImportFunction(__pyx_v_MPI, ((char *)"PyMPIComm_Get"), ((char *)"MPI_Comm *(PyObject *)")); if (unlikely(__pyx_t_3 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(17, 49, __pyx_L1_error) __pyx_v_commget = ((__pyx_t_8petsc4py_5PETSc_PyMPICommGet *)__pyx_t_3); /* "petsc4py/PETSc/petscmpi.pxi":51 * Cython_ImportFunction( * MPI, b"PyMPIComm_Get", b"MPI_Comm *(PyObject *)") * if commget == NULL: return MPI_COMM_NULL # <<<<<<<<<<<<<< * cdef MPI_Comm *ptr = commget(comm) * if ptr == NULL: return MPI_COMM_NULL */ __pyx_t_4 = (__pyx_v_commget == NULL); if (__pyx_t_4) { __pyx_r = MPI_COMM_NULL; goto __pyx_L0; } /* "petsc4py/PETSc/petscmpi.pxi":52 * MPI, b"PyMPIComm_Get", b"MPI_Comm *(PyObject *)") * if commget == NULL: return MPI_COMM_NULL * cdef MPI_Comm *ptr = commget(comm) # <<<<<<<<<<<<<< * if ptr == NULL: return MPI_COMM_NULL * return ptr[0] */ __pyx_t_5 = __pyx_v_commget(__pyx_v_comm); if (unlikely(__pyx_t_5 == ((MPI_Comm *)NULL))) __PYX_ERR(17, 52, __pyx_L1_error) __pyx_v_ptr = __pyx_t_5; /* "petsc4py/PETSc/petscmpi.pxi":53 * if commget == NULL: return MPI_COMM_NULL * cdef MPI_Comm *ptr = commget(comm) * if ptr == NULL: return MPI_COMM_NULL # <<<<<<<<<<<<<< * return ptr[0] * */ __pyx_t_4 = (__pyx_v_ptr == NULL); if (__pyx_t_4) { __pyx_r = MPI_COMM_NULL; goto __pyx_L0; } /* "petsc4py/PETSc/petscmpi.pxi":54 * cdef MPI_Comm *ptr = commget(comm) * if ptr == NULL: return MPI_COMM_NULL * return ptr[0] # <<<<<<<<<<<<<< * * cdef inline object mpi4py_Comm_New(MPI_Comm comm): */ __pyx_r = (__pyx_v_ptr[0]); goto __pyx_L0; /* "petsc4py/PETSc/petscmpi.pxi":44 * ctypedef MPI_Op* PyMPIOpGet(object) except NULL * * cdef inline MPI_Comm mpi4py_Comm_Get( # <<<<<<<<<<<<<< * object comm, * ) except? MPI_COMM_NULL: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.mpi4py_Comm_Get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = MPI_COMM_NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_MPI); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscmpi.pxi":56 * return ptr[0] * * cdef inline object mpi4py_Comm_New(MPI_Comm comm): # <<<<<<<<<<<<<< * from mpi4py import MPI * cdef PyMPICommNew *commnew = \ */ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_mpi4py_Comm_New(MPI_Comm __pyx_v_comm) { PyObject *__pyx_v_MPI = NULL; __pyx_t_8petsc4py_5PETSc_PyMPICommNew *__pyx_v_commnew; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; void *__pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mpi4py_Comm_New", 1); /* "petsc4py/PETSc/petscmpi.pxi":57 * * cdef inline object mpi4py_Comm_New(MPI_Comm comm): * from mpi4py import MPI # <<<<<<<<<<<<<< * cdef PyMPICommNew *commnew = \ * Cython_ImportFunction( */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_MPI); __Pyx_GIVEREF(__pyx_n_s_MPI); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_MPI)) __PYX_ERR(17, 57, __pyx_L1_error); __pyx_t_2 = __Pyx_Import(__pyx_n_s_mpi4py, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_MPI); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_1); __pyx_v_MPI = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscmpi.pxi":59 * from mpi4py import MPI * cdef PyMPICommNew *commnew = \ * Cython_ImportFunction( # <<<<<<<<<<<<<< * MPI, b"PyMPIComm_New", b"PyObject *(MPI_Comm)") * if commnew == NULL: return None */ __pyx_t_3 = Cython_ImportFunction(__pyx_v_MPI, ((char *)"PyMPIComm_New"), ((char *)"PyObject *(MPI_Comm)")); if (unlikely(__pyx_t_3 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(17, 59, __pyx_L1_error) __pyx_v_commnew = ((__pyx_t_8petsc4py_5PETSc_PyMPICommNew *)__pyx_t_3); /* "petsc4py/PETSc/petscmpi.pxi":61 * Cython_ImportFunction( * MPI, b"PyMPIComm_New", b"PyObject *(MPI_Comm)") * if commnew == NULL: return None # <<<<<<<<<<<<<< * return commnew(comm) * */ __pyx_t_4 = (__pyx_v_commnew == NULL); if (__pyx_t_4) { __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } /* "petsc4py/PETSc/petscmpi.pxi":62 * MPI, b"PyMPIComm_New", b"PyObject *(MPI_Comm)") * if commnew == NULL: return None * return commnew(comm) # <<<<<<<<<<<<<< * * cdef inline MPI_Datatype mpi4py_Datatype_Get( */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_v_commnew(__pyx_v_comm); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/petscmpi.pxi":56 * return ptr[0] * * cdef inline object mpi4py_Comm_New(MPI_Comm comm): # <<<<<<<<<<<<<< * from mpi4py import MPI * cdef PyMPICommNew *commnew = \ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.mpi4py_Comm_New", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_MPI); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscmpi.pxi":64 * return commnew(comm) * * cdef inline MPI_Datatype mpi4py_Datatype_Get( # <<<<<<<<<<<<<< * object datatype, * ) except? MPI_DATATYPE_NULL: */ static CYTHON_INLINE MPI_Datatype __pyx_f_8petsc4py_5PETSc_mpi4py_Datatype_Get(PyObject *__pyx_v_datatype) { PyObject *__pyx_v_MPI = NULL; __pyx_t_8petsc4py_5PETSc_PyMPIDatatypeGet *__pyx_v_datatypeget; MPI_Datatype *__pyx_v_ptr; MPI_Datatype __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; void *__pyx_t_3; int __pyx_t_4; MPI_Datatype *__pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mpi4py_Datatype_Get", 1); /* "petsc4py/PETSc/petscmpi.pxi":67 * object datatype, * ) except? MPI_DATATYPE_NULL: * from mpi4py import MPI # <<<<<<<<<<<<<< * cdef PyMPIDatatypeGet *datatypeget = \ * Cython_ImportFunction( */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_MPI); __Pyx_GIVEREF(__pyx_n_s_MPI); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_MPI)) __PYX_ERR(17, 67, __pyx_L1_error); __pyx_t_2 = __Pyx_Import(__pyx_n_s_mpi4py, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_MPI); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_1); __pyx_v_MPI = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscmpi.pxi":69 * from mpi4py import MPI * cdef PyMPIDatatypeGet *datatypeget = \ * Cython_ImportFunction( # <<<<<<<<<<<<<< * MPI, b"PyMPIDatatype_Get", b"MPI_Datatype *(PyObject *)") * if datatypeget == NULL: return MPI_DATATYPE_NULL */ __pyx_t_3 = Cython_ImportFunction(__pyx_v_MPI, ((char *)"PyMPIDatatype_Get"), ((char *)"MPI_Datatype *(PyObject *)")); if (unlikely(__pyx_t_3 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(17, 69, __pyx_L1_error) __pyx_v_datatypeget = ((__pyx_t_8petsc4py_5PETSc_PyMPIDatatypeGet *)__pyx_t_3); /* "petsc4py/PETSc/petscmpi.pxi":71 * Cython_ImportFunction( * MPI, b"PyMPIDatatype_Get", b"MPI_Datatype *(PyObject *)") * if datatypeget == NULL: return MPI_DATATYPE_NULL # <<<<<<<<<<<<<< * cdef MPI_Datatype *ptr = datatypeget(datatype) * if ptr == NULL: return MPI_DATATYPE_NULL */ __pyx_t_4 = (__pyx_v_datatypeget == NULL); if (__pyx_t_4) { __pyx_r = MPI_DATATYPE_NULL; goto __pyx_L0; } /* "petsc4py/PETSc/petscmpi.pxi":72 * MPI, b"PyMPIDatatype_Get", b"MPI_Datatype *(PyObject *)") * if datatypeget == NULL: return MPI_DATATYPE_NULL * cdef MPI_Datatype *ptr = datatypeget(datatype) # <<<<<<<<<<<<<< * if ptr == NULL: return MPI_DATATYPE_NULL * return ptr[0] */ __pyx_t_5 = __pyx_v_datatypeget(__pyx_v_datatype); if (unlikely(__pyx_t_5 == ((MPI_Datatype *)NULL))) __PYX_ERR(17, 72, __pyx_L1_error) __pyx_v_ptr = __pyx_t_5; /* "petsc4py/PETSc/petscmpi.pxi":73 * if datatypeget == NULL: return MPI_DATATYPE_NULL * cdef MPI_Datatype *ptr = datatypeget(datatype) * if ptr == NULL: return MPI_DATATYPE_NULL # <<<<<<<<<<<<<< * return ptr[0] * */ __pyx_t_4 = (__pyx_v_ptr == NULL); if (__pyx_t_4) { __pyx_r = MPI_DATATYPE_NULL; goto __pyx_L0; } /* "petsc4py/PETSc/petscmpi.pxi":74 * cdef MPI_Datatype *ptr = datatypeget(datatype) * if ptr == NULL: return MPI_DATATYPE_NULL * return ptr[0] # <<<<<<<<<<<<<< * * cdef inline MPI_Op mpi4py_Op_Get( */ __pyx_r = (__pyx_v_ptr[0]); goto __pyx_L0; /* "petsc4py/PETSc/petscmpi.pxi":64 * return commnew(comm) * * cdef inline MPI_Datatype mpi4py_Datatype_Get( # <<<<<<<<<<<<<< * object datatype, * ) except? MPI_DATATYPE_NULL: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.mpi4py_Datatype_Get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = MPI_DATATYPE_NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_MPI); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscmpi.pxi":76 * return ptr[0] * * cdef inline MPI_Op mpi4py_Op_Get( # <<<<<<<<<<<<<< * object op, * ) except? MPI_OP_NULL: */ static CYTHON_INLINE MPI_Op __pyx_f_8petsc4py_5PETSc_mpi4py_Op_Get(PyObject *__pyx_v_op) { PyObject *__pyx_v_MPI = NULL; __pyx_t_8petsc4py_5PETSc_PyMPIOpGet *__pyx_v_opget; MPI_Op *__pyx_v_ptr; MPI_Op __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; void *__pyx_t_3; int __pyx_t_4; MPI_Op *__pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mpi4py_Op_Get", 1); /* "petsc4py/PETSc/petscmpi.pxi":79 * object op, * ) except? MPI_OP_NULL: * from mpi4py import MPI # <<<<<<<<<<<<<< * cdef PyMPIOpGet *opget = \ * Cython_ImportFunction( */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_MPI); __Pyx_GIVEREF(__pyx_n_s_MPI); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_MPI)) __PYX_ERR(17, 79, __pyx_L1_error); __pyx_t_2 = __Pyx_Import(__pyx_n_s_mpi4py, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_MPI); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_1); __pyx_v_MPI = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscmpi.pxi":81 * from mpi4py import MPI * cdef PyMPIOpGet *opget = \ * Cython_ImportFunction( # <<<<<<<<<<<<<< * MPI, b"PyMPIOp_Get", b"MPI_Op *(PyObject *)") * if opget == NULL: return MPI_OP_NULL */ __pyx_t_3 = Cython_ImportFunction(__pyx_v_MPI, ((char *)"PyMPIOp_Get"), ((char *)"MPI_Op *(PyObject *)")); if (unlikely(__pyx_t_3 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(17, 81, __pyx_L1_error) __pyx_v_opget = ((__pyx_t_8petsc4py_5PETSc_PyMPIOpGet *)__pyx_t_3); /* "petsc4py/PETSc/petscmpi.pxi":83 * Cython_ImportFunction( * MPI, b"PyMPIOp_Get", b"MPI_Op *(PyObject *)") * if opget == NULL: return MPI_OP_NULL # <<<<<<<<<<<<<< * cdef MPI_Op *ptr = opget(op) * if ptr == NULL: return MPI_OP_NULL */ __pyx_t_4 = (__pyx_v_opget == NULL); if (__pyx_t_4) { __pyx_r = MPI_OP_NULL; goto __pyx_L0; } /* "petsc4py/PETSc/petscmpi.pxi":84 * MPI, b"PyMPIOp_Get", b"MPI_Op *(PyObject *)") * if opget == NULL: return MPI_OP_NULL * cdef MPI_Op *ptr = opget(op) # <<<<<<<<<<<<<< * if ptr == NULL: return MPI_OP_NULL * return ptr[0] */ __pyx_t_5 = __pyx_v_opget(__pyx_v_op); if (unlikely(__pyx_t_5 == ((MPI_Op *)NULL))) __PYX_ERR(17, 84, __pyx_L1_error) __pyx_v_ptr = __pyx_t_5; /* "petsc4py/PETSc/petscmpi.pxi":85 * if opget == NULL: return MPI_OP_NULL * cdef MPI_Op *ptr = opget(op) * if ptr == NULL: return MPI_OP_NULL # <<<<<<<<<<<<<< * return ptr[0] * */ __pyx_t_4 = (__pyx_v_ptr == NULL); if (__pyx_t_4) { __pyx_r = MPI_OP_NULL; goto __pyx_L0; } /* "petsc4py/PETSc/petscmpi.pxi":86 * cdef MPI_Op *ptr = opget(op) * if ptr == NULL: return MPI_OP_NULL * return ptr[0] # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_r = (__pyx_v_ptr[0]); goto __pyx_L0; /* "petsc4py/PETSc/petscmpi.pxi":76 * return ptr[0] * * cdef inline MPI_Op mpi4py_Op_Get( # <<<<<<<<<<<<<< * object op, * ) except? MPI_OP_NULL: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.mpi4py_Op_Get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = MPI_OP_NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_MPI); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscmpi.pxi":90 * # -------------------------------------------------------------------- * * cdef inline PetscErrorCode PetscCommDEALLOC(MPI_Comm* comm): # <<<<<<<<<<<<<< * if comm == NULL: return PETSC_SUCCESS * cdef MPI_Comm tmp = comm[0] */ static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_PetscCommDEALLOC(MPI_Comm *__pyx_v_comm) { MPI_Comm __pyx_v_tmp; PetscErrorCode __pyx_r; int __pyx_t_1; /* "petsc4py/PETSc/petscmpi.pxi":91 * * cdef inline PetscErrorCode PetscCommDEALLOC(MPI_Comm* comm): * if comm == NULL: return PETSC_SUCCESS # <<<<<<<<<<<<<< * cdef MPI_Comm tmp = comm[0] * if tmp == MPI_COMM_NULL: return PETSC_SUCCESS */ __pyx_t_1 = (__pyx_v_comm == NULL); if (__pyx_t_1) { __pyx_r = PETSC_SUCCESS; goto __pyx_L0; } /* "petsc4py/PETSc/petscmpi.pxi":92 * cdef inline PetscErrorCode PetscCommDEALLOC(MPI_Comm* comm): * if comm == NULL: return PETSC_SUCCESS * cdef MPI_Comm tmp = comm[0] # <<<<<<<<<<<<<< * if tmp == MPI_COMM_NULL: return PETSC_SUCCESS * comm[0] = MPI_COMM_NULL */ __pyx_v_tmp = (__pyx_v_comm[0]); /* "petsc4py/PETSc/petscmpi.pxi":93 * if comm == NULL: return PETSC_SUCCESS * cdef MPI_Comm tmp = comm[0] * if tmp == MPI_COMM_NULL: return PETSC_SUCCESS # <<<<<<<<<<<<<< * comm[0] = MPI_COMM_NULL * if not (PetscInitializeCalled): return PETSC_SUCCESS */ __pyx_t_1 = (__pyx_v_tmp == MPI_COMM_NULL); if (__pyx_t_1) { __pyx_r = PETSC_SUCCESS; goto __pyx_L0; } /* "petsc4py/PETSc/petscmpi.pxi":94 * cdef MPI_Comm tmp = comm[0] * if tmp == MPI_COMM_NULL: return PETSC_SUCCESS * comm[0] = MPI_COMM_NULL # <<<<<<<<<<<<<< * if not (PetscInitializeCalled): return PETSC_SUCCESS * if (PetscFinalizeCalled): return PETSC_SUCCESS */ (__pyx_v_comm[0]) = MPI_COMM_NULL; /* "petsc4py/PETSc/petscmpi.pxi":95 * if tmp == MPI_COMM_NULL: return PETSC_SUCCESS * comm[0] = MPI_COMM_NULL * if not (PetscInitializeCalled): return PETSC_SUCCESS # <<<<<<<<<<<<<< * if (PetscFinalizeCalled): return PETSC_SUCCESS * return PetscCommDestroy(&tmp) */ __pyx_t_1 = (!(((int)PetscInitializeCalled) != 0)); if (__pyx_t_1) { __pyx_r = PETSC_SUCCESS; goto __pyx_L0; } /* "petsc4py/PETSc/petscmpi.pxi":96 * comm[0] = MPI_COMM_NULL * if not (PetscInitializeCalled): return PETSC_SUCCESS * if (PetscFinalizeCalled): return PETSC_SUCCESS # <<<<<<<<<<<<<< * return PetscCommDestroy(&tmp) * */ __pyx_t_1 = (((int)PetscFinalizeCalled) != 0); if (__pyx_t_1) { __pyx_r = PETSC_SUCCESS; goto __pyx_L0; } /* "petsc4py/PETSc/petscmpi.pxi":97 * if not (PetscInitializeCalled): return PETSC_SUCCESS * if (PetscFinalizeCalled): return PETSC_SUCCESS * return PetscCommDestroy(&tmp) # <<<<<<<<<<<<<< * * cdef inline MPI_Comm def_Comm( */ __pyx_r = PetscCommDestroy((&__pyx_v_tmp)); goto __pyx_L0; /* "petsc4py/PETSc/petscmpi.pxi":90 * # -------------------------------------------------------------------- * * cdef inline PetscErrorCode PetscCommDEALLOC(MPI_Comm* comm): # <<<<<<<<<<<<<< * if comm == NULL: return PETSC_SUCCESS * cdef MPI_Comm tmp = comm[0] */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/petscmpi.pxi":99 * return PetscCommDestroy(&tmp) * * cdef inline MPI_Comm def_Comm( # <<<<<<<<<<<<<< * object comm, MPI_Comm defv, * ) except? MPI_COMM_NULL: */ static CYTHON_INLINE MPI_Comm __pyx_f_8petsc4py_5PETSc_def_Comm(PyObject *__pyx_v_comm, MPI_Comm __pyx_v_defv) { MPI_Comm __pyx_v_retv; MPI_Comm __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; MPI_Comm __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("def_Comm", 1); /* "petsc4py/PETSc/petscmpi.pxi":102 * object comm, MPI_Comm defv, * ) except? MPI_COMM_NULL: * cdef MPI_Comm retv = MPI_COMM_NULL # <<<<<<<<<<<<<< * if comm is None: * retv = defv */ __pyx_v_retv = MPI_COMM_NULL; /* "petsc4py/PETSc/petscmpi.pxi":103 * ) except? MPI_COMM_NULL: * cdef MPI_Comm retv = MPI_COMM_NULL * if comm is None: # <<<<<<<<<<<<<< * retv = defv * elif isinstance(comm, Comm): */ __pyx_t_1 = (__pyx_v_comm == Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/petscmpi.pxi":104 * cdef MPI_Comm retv = MPI_COMM_NULL * if comm is None: * retv = defv # <<<<<<<<<<<<<< * elif isinstance(comm, Comm): * retv = (comm).comm */ __pyx_v_retv = __pyx_v_defv; /* "petsc4py/PETSc/petscmpi.pxi":103 * ) except? MPI_COMM_NULL: * cdef MPI_Comm retv = MPI_COMM_NULL * if comm is None: # <<<<<<<<<<<<<< * retv = defv * elif isinstance(comm, Comm): */ goto __pyx_L3; } /* "petsc4py/PETSc/petscmpi.pxi":105 * if comm is None: * retv = defv * elif isinstance(comm, Comm): # <<<<<<<<<<<<<< * retv = (comm).comm * elif type(comm).__module__ == 'mpi4py.MPI': */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_comm, __pyx_ptype_8petsc4py_5PETSc_Comm); if (__pyx_t_1) { /* "petsc4py/PETSc/petscmpi.pxi":106 * retv = defv * elif isinstance(comm, Comm): * retv = (comm).comm # <<<<<<<<<<<<<< * elif type(comm).__module__ == 'mpi4py.MPI': * retv = mpi4py_Comm_Get(comm) */ __pyx_t_2 = ((struct PyPetscCommObject *)__pyx_v_comm)->comm; __pyx_v_retv = __pyx_t_2; /* "petsc4py/PETSc/petscmpi.pxi":105 * if comm is None: * retv = defv * elif isinstance(comm, Comm): # <<<<<<<<<<<<<< * retv = (comm).comm * elif type(comm).__module__ == 'mpi4py.MPI': */ goto __pyx_L3; } /* "petsc4py/PETSc/petscmpi.pxi":107 * elif isinstance(comm, Comm): * retv = (comm).comm * elif type(comm).__module__ == 'mpi4py.MPI': # <<<<<<<<<<<<<< * retv = mpi4py_Comm_Get(comm) * else: */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_comm)), __pyx_n_s_module); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_kp_s_mpi4py_MPI, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(17, 107, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { /* "petsc4py/PETSc/petscmpi.pxi":108 * retv = (comm).comm * elif type(comm).__module__ == 'mpi4py.MPI': * retv = mpi4py_Comm_Get(comm) # <<<<<<<<<<<<<< * else: * retv = (comm).comm */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_mpi4py_Comm_Get(__pyx_v_comm); if (unlikely(__pyx_t_2 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(17, 108, __pyx_L1_error) __pyx_v_retv = __pyx_t_2; /* "petsc4py/PETSc/petscmpi.pxi":107 * elif isinstance(comm, Comm): * retv = (comm).comm * elif type(comm).__module__ == 'mpi4py.MPI': # <<<<<<<<<<<<<< * retv = mpi4py_Comm_Get(comm) * else: */ goto __pyx_L3; } /* "petsc4py/PETSc/petscmpi.pxi":110 * retv = mpi4py_Comm_Get(comm) * else: * retv = (comm).comm # <<<<<<<<<<<<<< * return retv * */ /*else*/ { if (!(likely(__Pyx_TypeTest(__pyx_v_comm, __pyx_ptype_8petsc4py_5PETSc_Comm)))) __PYX_ERR(17, 110, __pyx_L1_error) __pyx_t_2 = ((struct PyPetscCommObject *)__pyx_v_comm)->comm; __pyx_v_retv = __pyx_t_2; } __pyx_L3:; /* "petsc4py/PETSc/petscmpi.pxi":111 * else: * retv = (comm).comm * return retv # <<<<<<<<<<<<<< * * cdef inline Comm new_Comm(MPI_Comm comm): */ __pyx_r = __pyx_v_retv; goto __pyx_L0; /* "petsc4py/PETSc/petscmpi.pxi":99 * return PetscCommDestroy(&tmp) * * cdef inline MPI_Comm def_Comm( # <<<<<<<<<<<<<< * object comm, MPI_Comm defv, * ) except? MPI_COMM_NULL: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.def_Comm", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = MPI_COMM_NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscmpi.pxi":113 * return retv * * cdef inline Comm new_Comm(MPI_Comm comm): # <<<<<<<<<<<<<< * cdef Comm ob = Comm() * ob.comm = comm */ static CYTHON_INLINE struct PyPetscCommObject *__pyx_f_8petsc4py_5PETSc_new_Comm(MPI_Comm __pyx_v_comm) { struct PyPetscCommObject *__pyx_v_ob = 0; struct PyPetscCommObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("new_Comm", 1); /* "petsc4py/PETSc/petscmpi.pxi":114 * * cdef inline Comm new_Comm(MPI_Comm comm): * cdef Comm ob = Comm() # <<<<<<<<<<<<<< * ob.comm = comm * return ob */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Comm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_ob = ((struct PyPetscCommObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscmpi.pxi":115 * cdef inline Comm new_Comm(MPI_Comm comm): * cdef Comm ob = Comm() * ob.comm = comm # <<<<<<<<<<<<<< * return ob * */ __pyx_v_ob->comm = __pyx_v_comm; /* "petsc4py/PETSc/petscmpi.pxi":116 * cdef Comm ob = Comm() * ob.comm = comm * return ob # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_ob); __pyx_r = __pyx_v_ob; goto __pyx_L0; /* "petsc4py/PETSc/petscmpi.pxi":113 * return retv * * cdef inline Comm new_Comm(MPI_Comm comm): # <<<<<<<<<<<<<< * cdef Comm ob = Comm() * ob.comm = comm */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.new_Comm", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscmpi.pxi":120 * # -------------------------------------------------------------------- * * cdef inline int comm_size(MPI_Comm comm) except ? -1: # <<<<<<<<<<<<<< * if comm == MPI_COMM_NULL: raise ValueError("null communicator") * cdef int size = 0 */ static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_comm_size(MPI_Comm __pyx_v_comm) { int __pyx_v_size; int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("comm_size", 1); /* "petsc4py/PETSc/petscmpi.pxi":121 * * cdef inline int comm_size(MPI_Comm comm) except ? -1: * if comm == MPI_COMM_NULL: raise ValueError("null communicator") # <<<<<<<<<<<<<< * cdef int size = 0 * CHKERR( MPI_Comm_size(comm, &size) ) */ __pyx_t_1 = (__pyx_v_comm == MPI_COMM_NULL); if (unlikely(__pyx_t_1)) { __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(17, 121, __pyx_L1_error) } /* "petsc4py/PETSc/petscmpi.pxi":122 * cdef inline int comm_size(MPI_Comm comm) except ? -1: * if comm == MPI_COMM_NULL: raise ValueError("null communicator") * cdef int size = 0 # <<<<<<<<<<<<<< * CHKERR( MPI_Comm_size(comm, &size) ) * return size */ __pyx_v_size = 0; /* "petsc4py/PETSc/petscmpi.pxi":123 * if comm == MPI_COMM_NULL: raise ValueError("null communicator") * cdef int size = 0 * CHKERR( MPI_Comm_size(comm, &size) ) # <<<<<<<<<<<<<< * return size * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(((PetscErrorCode)MPI_Comm_size(__pyx_v_comm, (&__pyx_v_size)))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(17, 123, __pyx_L1_error) /* "petsc4py/PETSc/petscmpi.pxi":124 * cdef int size = 0 * CHKERR( MPI_Comm_size(comm, &size) ) * return size # <<<<<<<<<<<<<< * * cdef inline int comm_rank(MPI_Comm comm) except ? -1: */ __pyx_r = __pyx_v_size; goto __pyx_L0; /* "petsc4py/PETSc/petscmpi.pxi":120 * # -------------------------------------------------------------------- * * cdef inline int comm_size(MPI_Comm comm) except ? -1: # <<<<<<<<<<<<<< * if comm == MPI_COMM_NULL: raise ValueError("null communicator") * cdef int size = 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.comm_size", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscmpi.pxi":126 * return size * * cdef inline int comm_rank(MPI_Comm comm) except ? -1: # <<<<<<<<<<<<<< * if comm == MPI_COMM_NULL: raise ValueError("null communicator") * cdef int rank = 0 */ static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_comm_rank(MPI_Comm __pyx_v_comm) { int __pyx_v_rank; int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("comm_rank", 1); /* "petsc4py/PETSc/petscmpi.pxi":127 * * cdef inline int comm_rank(MPI_Comm comm) except ? -1: * if comm == MPI_COMM_NULL: raise ValueError("null communicator") # <<<<<<<<<<<<<< * cdef int rank = 0 * CHKERR( MPI_Comm_rank(comm, &rank) ) */ __pyx_t_1 = (__pyx_v_comm == MPI_COMM_NULL); if (unlikely(__pyx_t_1)) { __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(17, 127, __pyx_L1_error) } /* "petsc4py/PETSc/petscmpi.pxi":128 * cdef inline int comm_rank(MPI_Comm comm) except ? -1: * if comm == MPI_COMM_NULL: raise ValueError("null communicator") * cdef int rank = 0 # <<<<<<<<<<<<<< * CHKERR( MPI_Comm_rank(comm, &rank) ) * return rank */ __pyx_v_rank = 0; /* "petsc4py/PETSc/petscmpi.pxi":129 * if comm == MPI_COMM_NULL: raise ValueError("null communicator") * cdef int rank = 0 * CHKERR( MPI_Comm_rank(comm, &rank) ) # <<<<<<<<<<<<<< * return rank * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(((PetscErrorCode)MPI_Comm_rank(__pyx_v_comm, (&__pyx_v_rank)))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(17, 129, __pyx_L1_error) /* "petsc4py/PETSc/petscmpi.pxi":130 * cdef int rank = 0 * CHKERR( MPI_Comm_rank(comm, &rank) ) * return rank # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_r = __pyx_v_rank; goto __pyx_L0; /* "petsc4py/PETSc/petscmpi.pxi":126 * return size * * cdef inline int comm_rank(MPI_Comm comm) except ? -1: # <<<<<<<<<<<<<< * if comm == MPI_COMM_NULL: raise ValueError("null communicator") * cdef int rank = 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.comm_rank", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscsys.pxi":57 * * * cdef inline PetscErrorCode Sys_Sizes( # <<<<<<<<<<<<<< * object size, object bsize, * PetscInt *_b, */ static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_Sys_Sizes(PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PetscInt *__pyx_v__b, PetscInt *__pyx_v__n, PetscInt *__pyx_v__N) { PetscInt __pyx_v_bs; PetscInt __pyx_v_b; PetscInt __pyx_v_n; PetscInt __pyx_v_N; PyObject *__pyx_v_on = 0; PyObject *__pyx_v_oN = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscInt __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *(*__pyx_t_9)(PyObject *); int __pyx_t_10; int __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("Sys_Sizes", 1); /* "petsc4py/PETSc/petscsys.pxi":64 * ) except PETSC_ERR_PYTHON: * # get block size * cdef PetscInt bs=PETSC_DECIDE, b=PETSC_DECIDE # <<<<<<<<<<<<<< * if bsize is not None: bs = b = asInt(bsize) * if bs == PETSC_DECIDE: bs = 1 */ __pyx_v_bs = PETSC_DECIDE; __pyx_v_b = PETSC_DECIDE; /* "petsc4py/PETSc/petscsys.pxi":65 * # get block size * cdef PetscInt bs=PETSC_DECIDE, b=PETSC_DECIDE * if bsize is not None: bs = b = asInt(bsize) # <<<<<<<<<<<<<< * if bs == PETSC_DECIDE: bs = 1 * # unpack and get local and global sizes */ __pyx_t_1 = (__pyx_v_bsize != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_bsize); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(18, 65, __pyx_L1_error) __pyx_v_bs = __pyx_t_2; __pyx_v_b = __pyx_t_2; } /* "petsc4py/PETSc/petscsys.pxi":66 * cdef PetscInt bs=PETSC_DECIDE, b=PETSC_DECIDE * if bsize is not None: bs = b = asInt(bsize) * if bs == PETSC_DECIDE: bs = 1 # <<<<<<<<<<<<<< * # unpack and get local and global sizes * cdef PetscInt n=PETSC_DECIDE, N=PETSC_DECIDE */ __pyx_t_1 = (__pyx_v_bs == PETSC_DECIDE); if (__pyx_t_1) { __pyx_v_bs = 1; } /* "petsc4py/PETSc/petscsys.pxi":68 * if bs == PETSC_DECIDE: bs = 1 * # unpack and get local and global sizes * cdef PetscInt n=PETSC_DECIDE, N=PETSC_DECIDE # <<<<<<<<<<<<<< * cdef object on, oN * try: */ __pyx_v_n = PETSC_DECIDE; __pyx_v_N = PETSC_DECIDE; /* "petsc4py/PETSc/petscsys.pxi":70 * cdef PetscInt n=PETSC_DECIDE, N=PETSC_DECIDE * cdef object on, oN * try: # <<<<<<<<<<<<<< * on, oN = size * except (TypeError, ValueError): */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_5); /*try:*/ { /* "petsc4py/PETSc/petscsys.pxi":71 * cdef object on, oN * try: * on, oN = size # <<<<<<<<<<<<<< * except (TypeError, ValueError): * on = None; oN = size */ if ((likely(PyTuple_CheckExact(__pyx_v_size))) || (PyList_CheckExact(__pyx_v_size))) { PyObject* sequence = __pyx_v_size; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(18, 71, __pyx_L5_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_6 = PyList_GET_ITEM(sequence, 0); __pyx_t_7 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); #else __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(18, 71, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(18, 71, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { Py_ssize_t index = -1; __pyx_t_8 = PyObject_GetIter(__pyx_v_size); if (unlikely(!__pyx_t_8)) __PYX_ERR(18, 71, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); index = 0; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L11_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L11_unpacking_failed; __Pyx_GOTREF(__pyx_t_7); if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(18, 71, __pyx_L5_error) __pyx_t_9 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L12_unpacking_done; __pyx_L11_unpacking_failed:; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_9 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(18, 71, __pyx_L5_error) __pyx_L12_unpacking_done:; } __pyx_v_on = __pyx_t_6; __pyx_t_6 = 0; __pyx_v_oN = __pyx_t_7; __pyx_t_7 = 0; /* "petsc4py/PETSc/petscsys.pxi":70 * cdef PetscInt n=PETSC_DECIDE, N=PETSC_DECIDE * cdef object on, oN * try: # <<<<<<<<<<<<<< * on, oN = size * except (TypeError, ValueError): */ } __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L10_try_end; __pyx_L5_error:; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; /* "petsc4py/PETSc/petscsys.pxi":72 * try: * on, oN = size * except (TypeError, ValueError): # <<<<<<<<<<<<<< * on = None; oN = size * if on is not None: n = asInt(on) */ __pyx_t_10 = __Pyx_PyErr_ExceptionMatches2(__pyx_builtin_TypeError, __pyx_builtin_ValueError); if (__pyx_t_10) { __Pyx_AddTraceback("petsc4py.PETSc.Sys_Sizes", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_6, &__pyx_t_8) < 0) __PYX_ERR(18, 72, __pyx_L7_except_error) __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_8); /* "petsc4py/PETSc/petscsys.pxi":73 * on, oN = size * except (TypeError, ValueError): * on = None; oN = size # <<<<<<<<<<<<<< * if on is not None: n = asInt(on) * if oN is not None: N = asInt(oN) */ __Pyx_INCREF(Py_None); __Pyx_XDECREF_SET(__pyx_v_on, Py_None); __Pyx_INCREF(__pyx_v_size); __Pyx_XDECREF_SET(__pyx_v_oN, __pyx_v_size); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L6_exception_handled; } goto __pyx_L7_except_error; /* "petsc4py/PETSc/petscsys.pxi":70 * cdef PetscInt n=PETSC_DECIDE, N=PETSC_DECIDE * cdef object on, oN * try: # <<<<<<<<<<<<<< * on, oN = size * except (TypeError, ValueError): */ __pyx_L7_except_error:; __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); goto __pyx_L1_error; __pyx_L6_exception_handled:; __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); __pyx_L10_try_end:; } /* "petsc4py/PETSc/petscsys.pxi":74 * except (TypeError, ValueError): * on = None; oN = size * if on is not None: n = asInt(on) # <<<<<<<<<<<<<< * if oN is not None: N = asInt(oN) * # check block, local, and and global sizes */ __pyx_t_1 = (__pyx_v_on != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_on); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(18, 74, __pyx_L1_error) __pyx_v_n = __pyx_t_2; } /* "petsc4py/PETSc/petscsys.pxi":75 * on = None; oN = size * if on is not None: n = asInt(on) * if oN is not None: N = asInt(oN) # <<<<<<<<<<<<<< * # check block, local, and and global sizes * if (bs < 1): raise ValueError( */ __pyx_t_1 = (__pyx_v_oN != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_oN); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(18, 75, __pyx_L1_error) __pyx_v_N = __pyx_t_2; } /* "petsc4py/PETSc/petscsys.pxi":77 * if oN is not None: N = asInt(oN) * # check block, local, and and global sizes * if (bs < 1): raise ValueError( # <<<<<<<<<<<<<< * "block size %d must be positive" % toInt(bs)) * if n==PETSC_DECIDE and N==PETSC_DECIDE: raise ValueError( */ __pyx_t_1 = (__pyx_v_bs < 1); if (unlikely(__pyx_t_1)) { /* "petsc4py/PETSc/petscsys.pxi":78 * # check block, local, and and global sizes * if (bs < 1): raise ValueError( * "block size %d must be positive" % toInt(bs)) # <<<<<<<<<<<<<< * if n==PETSC_DECIDE and N==PETSC_DECIDE: raise ValueError( * "local and global sizes cannot be both 'DECIDE'") */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_bs); if (unlikely(!__pyx_t_8)) __PYX_ERR(18, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_6 = __Pyx_PyString_FormatSafe(__pyx_kp_s_block_size_d_must_be_positive, __pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(18, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "petsc4py/PETSc/petscsys.pxi":77 * if oN is not None: N = asInt(oN) * # check block, local, and and global sizes * if (bs < 1): raise ValueError( # <<<<<<<<<<<<<< * "block size %d must be positive" % toInt(bs)) * if n==PETSC_DECIDE and N==PETSC_DECIDE: raise ValueError( */ __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(18, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __PYX_ERR(18, 77, __pyx_L1_error) } /* "petsc4py/PETSc/petscsys.pxi":79 * if (bs < 1): raise ValueError( * "block size %d must be positive" % toInt(bs)) * if n==PETSC_DECIDE and N==PETSC_DECIDE: raise ValueError( # <<<<<<<<<<<<<< * "local and global sizes cannot be both 'DECIDE'") * if (n > 0) and (n % bs): raise ValueError( */ __pyx_t_11 = (__pyx_v_n == PETSC_DECIDE); if (__pyx_t_11) { } else { __pyx_t_1 = __pyx_t_11; goto __pyx_L19_bool_binop_done; } __pyx_t_11 = (__pyx_v_N == PETSC_DECIDE); __pyx_t_1 = __pyx_t_11; __pyx_L19_bool_binop_done:; if (unlikely(__pyx_t_1)) { __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(18, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __PYX_ERR(18, 79, __pyx_L1_error) } /* "petsc4py/PETSc/petscsys.pxi":81 * if n==PETSC_DECIDE and N==PETSC_DECIDE: raise ValueError( * "local and global sizes cannot be both 'DECIDE'") * if (n > 0) and (n % bs): raise ValueError( # <<<<<<<<<<<<<< * "local size %d not divisible by block size %d" % * (toInt(n), toInt(bs)) ) */ __pyx_t_11 = (__pyx_v_n > 0); if (__pyx_t_11) { } else { __pyx_t_1 = __pyx_t_11; goto __pyx_L22_bool_binop_done; } __pyx_t_11 = ((__pyx_v_n % __pyx_v_bs) != 0); __pyx_t_1 = __pyx_t_11; __pyx_L22_bool_binop_done:; if (unlikely(__pyx_t_1)) { /* "petsc4py/PETSc/petscsys.pxi":83 * if (n > 0) and (n % bs): raise ValueError( * "local size %d not divisible by block size %d" % * (toInt(n), toInt(bs)) ) # <<<<<<<<<<<<<< * if (N > 0) and (N % bs): raise ValueError( * "global size %d not divisible by block size %d" % */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_8)) __PYX_ERR(18, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_bs); if (unlikely(!__pyx_t_6)) __PYX_ERR(18, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(18, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_8); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8)) __PYX_ERR(18, 83, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6)) __PYX_ERR(18, 83, __pyx_L1_error); __pyx_t_8 = 0; __pyx_t_6 = 0; /* "petsc4py/PETSc/petscsys.pxi":82 * "local and global sizes cannot be both 'DECIDE'") * if (n > 0) and (n % bs): raise ValueError( * "local size %d not divisible by block size %d" % # <<<<<<<<<<<<<< * (toInt(n), toInt(bs)) ) * if (N > 0) and (N % bs): raise ValueError( */ __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_local_size_d_not_divisible_by_bl, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(18, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "petsc4py/PETSc/petscsys.pxi":81 * if n==PETSC_DECIDE and N==PETSC_DECIDE: raise ValueError( * "local and global sizes cannot be both 'DECIDE'") * if (n > 0) and (n % bs): raise ValueError( # <<<<<<<<<<<<<< * "local size %d not divisible by block size %d" % * (toInt(n), toInt(bs)) ) */ __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(18, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __PYX_ERR(18, 81, __pyx_L1_error) } /* "petsc4py/PETSc/petscsys.pxi":84 * "local size %d not divisible by block size %d" % * (toInt(n), toInt(bs)) ) * if (N > 0) and (N % bs): raise ValueError( # <<<<<<<<<<<<<< * "global size %d not divisible by block size %d" % * (toInt(N), toInt(bs)) ) */ __pyx_t_11 = (__pyx_v_N > 0); if (__pyx_t_11) { } else { __pyx_t_1 = __pyx_t_11; goto __pyx_L25_bool_binop_done; } __pyx_t_11 = ((__pyx_v_N % __pyx_v_bs) != 0); __pyx_t_1 = __pyx_t_11; __pyx_L25_bool_binop_done:; if (unlikely(__pyx_t_1)) { /* "petsc4py/PETSc/petscsys.pxi":86 * if (N > 0) and (N % bs): raise ValueError( * "global size %d not divisible by block size %d" % * (toInt(N), toInt(bs)) ) # <<<<<<<<<<<<<< * # return result to the caller * if _b != NULL: _b[0] = b */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_N); if (unlikely(!__pyx_t_7)) __PYX_ERR(18, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_bs); if (unlikely(!__pyx_t_6)) __PYX_ERR(18, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(18, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7)) __PYX_ERR(18, 86, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6)) __PYX_ERR(18, 86, __pyx_L1_error); __pyx_t_7 = 0; __pyx_t_6 = 0; /* "petsc4py/PETSc/petscsys.pxi":85 * (toInt(n), toInt(bs)) ) * if (N > 0) and (N % bs): raise ValueError( * "global size %d not divisible by block size %d" % # <<<<<<<<<<<<<< * (toInt(N), toInt(bs)) ) * # return result to the caller */ __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_global_size_d_not_divisible_by_b, __pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(18, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "petsc4py/PETSc/petscsys.pxi":84 * "local size %d not divisible by block size %d" % * (toInt(n), toInt(bs)) ) * if (N > 0) and (N % bs): raise ValueError( # <<<<<<<<<<<<<< * "global size %d not divisible by block size %d" % * (toInt(N), toInt(bs)) ) */ __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(18, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __PYX_ERR(18, 84, __pyx_L1_error) } /* "petsc4py/PETSc/petscsys.pxi":88 * (toInt(N), toInt(bs)) ) * # return result to the caller * if _b != NULL: _b[0] = b # <<<<<<<<<<<<<< * if _n != NULL: _n[0] = n * if _N != NULL: _N[0] = N */ __pyx_t_1 = (__pyx_v__b != NULL); if (__pyx_t_1) { (__pyx_v__b[0]) = __pyx_v_b; } /* "petsc4py/PETSc/petscsys.pxi":89 * # return result to the caller * if _b != NULL: _b[0] = b * if _n != NULL: _n[0] = n # <<<<<<<<<<<<<< * if _N != NULL: _N[0] = N * return PETSC_SUCCESS */ __pyx_t_1 = (__pyx_v__n != NULL); if (__pyx_t_1) { (__pyx_v__n[0]) = __pyx_v_n; } /* "petsc4py/PETSc/petscsys.pxi":90 * if _b != NULL: _b[0] = b * if _n != NULL: _n[0] = n * if _N != NULL: _N[0] = N # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_1 = (__pyx_v__N != NULL); if (__pyx_t_1) { (__pyx_v__N[0]) = __pyx_v_N; } /* "petsc4py/PETSc/petscsys.pxi":91 * if _n != NULL: _n[0] = n * if _N != NULL: _N[0] = N * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * cdef inline PetscErrorCode Sys_Layout( */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petscsys.pxi":57 * * * cdef inline PetscErrorCode Sys_Sizes( # <<<<<<<<<<<<<< * object size, object bsize, * PetscInt *_b, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("petsc4py.PETSc.Sys_Sizes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_on); __Pyx_XDECREF(__pyx_v_oN); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscsys.pxi":93 * return PETSC_SUCCESS * * cdef inline PetscErrorCode Sys_Layout( # <<<<<<<<<<<<<< * MPI_Comm comm, * PetscInt bs, */ static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_Sys_Layout(MPI_Comm __pyx_v_comm, PetscInt __pyx_v_bs, PetscInt *__pyx_v__n, PetscInt *__pyx_v__N) { PetscInt __pyx_v_n; PetscInt __pyx_v_N; PetscErrorCode __pyx_r; int __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "petsc4py/PETSc/petscsys.pxi":99 * PetscInt *_N, * ) except PETSC_ERR_PYTHON: * cdef PetscInt n = _n[0] # <<<<<<<<<<<<<< * cdef PetscInt N = _N[0] * if bs < 0: bs = 1 */ __pyx_v_n = (__pyx_v__n[0]); /* "petsc4py/PETSc/petscsys.pxi":100 * ) except PETSC_ERR_PYTHON: * cdef PetscInt n = _n[0] * cdef PetscInt N = _N[0] # <<<<<<<<<<<<<< * if bs < 0: bs = 1 * if n > 0: n = n // bs */ __pyx_v_N = (__pyx_v__N[0]); /* "petsc4py/PETSc/petscsys.pxi":101 * cdef PetscInt n = _n[0] * cdef PetscInt N = _N[0] * if bs < 0: bs = 1 # <<<<<<<<<<<<<< * if n > 0: n = n // bs * if N > 0: N = N // bs */ __pyx_t_1 = (__pyx_v_bs < 0); if (__pyx_t_1) { __pyx_v_bs = 1; } /* "petsc4py/PETSc/petscsys.pxi":102 * cdef PetscInt N = _N[0] * if bs < 0: bs = 1 * if n > 0: n = n // bs # <<<<<<<<<<<<<< * if N > 0: N = N // bs * CHKERR( PetscSplitOwnership(comm, &n, &N) ) */ __pyx_t_1 = (__pyx_v_n > 0); if (__pyx_t_1) { __pyx_v_n = (__pyx_v_n / __pyx_v_bs); } /* "petsc4py/PETSc/petscsys.pxi":103 * if bs < 0: bs = 1 * if n > 0: n = n // bs * if N > 0: N = N // bs # <<<<<<<<<<<<<< * CHKERR( PetscSplitOwnership(comm, &n, &N) ) * _n[0] = n * bs */ __pyx_t_1 = (__pyx_v_N > 0); if (__pyx_t_1) { __pyx_v_N = (__pyx_v_N / __pyx_v_bs); } /* "petsc4py/PETSc/petscsys.pxi":104 * if n > 0: n = n // bs * if N > 0: N = N // bs * CHKERR( PetscSplitOwnership(comm, &n, &N) ) # <<<<<<<<<<<<<< * _n[0] = n * bs * _N[0] = N * bs */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSplitOwnership(__pyx_v_comm, (&__pyx_v_n), (&__pyx_v_N))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(18, 104, __pyx_L1_error) /* "petsc4py/PETSc/petscsys.pxi":105 * if N > 0: N = N // bs * CHKERR( PetscSplitOwnership(comm, &n, &N) ) * _n[0] = n * bs # <<<<<<<<<<<<<< * _N[0] = N * bs * return PETSC_SUCCESS */ (__pyx_v__n[0]) = (__pyx_v_n * __pyx_v_bs); /* "petsc4py/PETSc/petscsys.pxi":106 * CHKERR( PetscSplitOwnership(comm, &n, &N) ) * _n[0] = n * bs * _N[0] = N * bs # <<<<<<<<<<<<<< * return PETSC_SUCCESS */ (__pyx_v__N[0]) = (__pyx_v_N * __pyx_v_bs); /* "petsc4py/PETSc/petscsys.pxi":107 * _n[0] = n * bs * _N[0] = N * bs * return PETSC_SUCCESS # <<<<<<<<<<<<<< */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petscsys.pxi":93 * return PETSC_SUCCESS * * cdef inline PetscErrorCode Sys_Layout( # <<<<<<<<<<<<<< * MPI_Comm comm, * PetscInt bs, */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Sys_Layout", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/petsclog.pxi":59 * * * cdef inline int event_args2objs(object args, PetscObject o[4]) except -1: # <<<<<<<<<<<<<< * o[0] = o[1] = o[2] = o[3] = NULL * cdef Py_ssize_t i=0, n = len(args) */ static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_event_args2objs(PyObject *__pyx_v_args, PetscObject *__pyx_v_o) { Py_ssize_t __pyx_v_i; Py_ssize_t __pyx_v_n; struct PyPetscObjectObject *__pyx_v_tmp = 0; int __pyx_r; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("event_args2objs", 1); /* "petsc4py/PETSc/petsclog.pxi":60 * * cdef inline int event_args2objs(object args, PetscObject o[4]) except -1: * o[0] = o[1] = o[2] = o[3] = NULL # <<<<<<<<<<<<<< * cdef Py_ssize_t i=0, n = len(args) * cdef Object tmp = None */ (__pyx_v_o[0]) = NULL; (__pyx_v_o[1]) = NULL; (__pyx_v_o[2]) = NULL; (__pyx_v_o[3]) = NULL; /* "petsc4py/PETSc/petsclog.pxi":61 * cdef inline int event_args2objs(object args, PetscObject o[4]) except -1: * o[0] = o[1] = o[2] = o[3] = NULL * cdef Py_ssize_t i=0, n = len(args) # <<<<<<<<<<<<<< * cdef Object tmp = None * if n > 4: n = 4 */ __pyx_v_i = 0; __pyx_t_1 = PyObject_Length(__pyx_v_args); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(19, 61, __pyx_L1_error) __pyx_v_n = __pyx_t_1; /* "petsc4py/PETSc/petsclog.pxi":62 * o[0] = o[1] = o[2] = o[3] = NULL * cdef Py_ssize_t i=0, n = len(args) * cdef Object tmp = None # <<<<<<<<<<<<<< * if n > 4: n = 4 * for 0 <= i < n: */ __Pyx_INCREF(Py_None); __pyx_v_tmp = ((struct PyPetscObjectObject *)Py_None); /* "petsc4py/PETSc/petsclog.pxi":63 * cdef Py_ssize_t i=0, n = len(args) * cdef Object tmp = None * if n > 4: n = 4 # <<<<<<<<<<<<<< * for 0 <= i < n: * tmp = args[i] */ __pyx_t_2 = (__pyx_v_n > 4); if (__pyx_t_2) { __pyx_v_n = 4; } /* "petsc4py/PETSc/petsclog.pxi":64 * cdef Object tmp = None * if n > 4: n = 4 * for 0 <= i < n: # <<<<<<<<<<<<<< * tmp = args[i] * if tmp is not None: */ __pyx_t_1 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { /* "petsc4py/PETSc/petsclog.pxi":65 * if n > 4: n = 4 * for 0 <= i < n: * tmp = args[i] # <<<<<<<<<<<<<< * if tmp is not None: * o[i] = tmp.obj[0] */ __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_args, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_8petsc4py_5PETSc_Object))))) __PYX_ERR(19, 65, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_tmp, ((struct PyPetscObjectObject *)__pyx_t_3)); __pyx_t_3 = 0; /* "petsc4py/PETSc/petsclog.pxi":66 * for 0 <= i < n: * tmp = args[i] * if tmp is not None: # <<<<<<<<<<<<<< * o[i] = tmp.obj[0] * return 0 */ __pyx_t_2 = (((PyObject *)__pyx_v_tmp) != Py_None); if (__pyx_t_2) { /* "petsc4py/PETSc/petsclog.pxi":67 * tmp = args[i] * if tmp is not None: * o[i] = tmp.obj[0] # <<<<<<<<<<<<<< * return 0 */ (__pyx_v_o[__pyx_v_i]) = (__pyx_v_tmp->obj[0]); /* "petsc4py/PETSc/petsclog.pxi":66 * for 0 <= i < n: * tmp = args[i] * if tmp is not None: # <<<<<<<<<<<<<< * o[i] = tmp.obj[0] * return 0 */ } } /* "petsc4py/PETSc/petsclog.pxi":68 * if tmp is not None: * o[i] = tmp.obj[0] * return 0 # <<<<<<<<<<<<<< */ __pyx_r = 0; goto __pyx_L0; /* "petsc4py/PETSc/petsclog.pxi":59 * * * cdef inline int event_args2objs(object args, PetscObject o[4]) except -1: # <<<<<<<<<<<<<< * o[0] = o[1] = o[2] = o[3] = NULL * cdef Py_ssize_t i=0, n = len(args) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.event_args2objs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_tmp); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscobj.pxi":50 * # -------------------------------------------------------------------- * * cdef inline PetscErrorCode PetscINCREF(PetscObject *obj) noexcept nogil: # <<<<<<<<<<<<<< * if obj == NULL: return PETSC_SUCCESS * if obj[0] == NULL: return PETSC_SUCCESS */ static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_PetscINCREF(PetscObject *__pyx_v_obj) { PetscErrorCode __pyx_r; int __pyx_t_1; /* "petsc4py/PETSc/petscobj.pxi":51 * * cdef inline PetscErrorCode PetscINCREF(PetscObject *obj) noexcept nogil: * if obj == NULL: return PETSC_SUCCESS # <<<<<<<<<<<<<< * if obj[0] == NULL: return PETSC_SUCCESS * return PetscObjectReference(obj[0]) */ __pyx_t_1 = (__pyx_v_obj == NULL); if (__pyx_t_1) { __pyx_r = PETSC_SUCCESS; goto __pyx_L0; } /* "petsc4py/PETSc/petscobj.pxi":52 * cdef inline PetscErrorCode PetscINCREF(PetscObject *obj) noexcept nogil: * if obj == NULL: return PETSC_SUCCESS * if obj[0] == NULL: return PETSC_SUCCESS # <<<<<<<<<<<<<< * return PetscObjectReference(obj[0]) * */ __pyx_t_1 = ((__pyx_v_obj[0]) == NULL); if (__pyx_t_1) { __pyx_r = PETSC_SUCCESS; goto __pyx_L0; } /* "petsc4py/PETSc/petscobj.pxi":53 * if obj == NULL: return PETSC_SUCCESS * if obj[0] == NULL: return PETSC_SUCCESS * return PetscObjectReference(obj[0]) # <<<<<<<<<<<<<< * * cdef inline PetscErrorCode PetscCLEAR(PetscObject* obj) noexcept nogil: */ __pyx_r = PetscObjectReference((__pyx_v_obj[0])); goto __pyx_L0; /* "petsc4py/PETSc/petscobj.pxi":50 * # -------------------------------------------------------------------- * * cdef inline PetscErrorCode PetscINCREF(PetscObject *obj) noexcept nogil: # <<<<<<<<<<<<<< * if obj == NULL: return PETSC_SUCCESS * if obj[0] == NULL: return PETSC_SUCCESS */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/petscobj.pxi":55 * return PetscObjectReference(obj[0]) * * cdef inline PetscErrorCode PetscCLEAR(PetscObject* obj) noexcept nogil: # <<<<<<<<<<<<<< * if obj == NULL: return PETSC_SUCCESS * if obj[0] == NULL: return PETSC_SUCCESS */ static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_PetscCLEAR(PetscObject *__pyx_v_obj) { PetscObject __pyx_v_tmp; PetscErrorCode __pyx_r; int __pyx_t_1; /* "petsc4py/PETSc/petscobj.pxi":56 * * cdef inline PetscErrorCode PetscCLEAR(PetscObject* obj) noexcept nogil: * if obj == NULL: return PETSC_SUCCESS # <<<<<<<<<<<<<< * if obj[0] == NULL: return PETSC_SUCCESS * cdef PetscObject tmp */ __pyx_t_1 = (__pyx_v_obj == NULL); if (__pyx_t_1) { __pyx_r = PETSC_SUCCESS; goto __pyx_L0; } /* "petsc4py/PETSc/petscobj.pxi":57 * cdef inline PetscErrorCode PetscCLEAR(PetscObject* obj) noexcept nogil: * if obj == NULL: return PETSC_SUCCESS * if obj[0] == NULL: return PETSC_SUCCESS # <<<<<<<<<<<<<< * cdef PetscObject tmp * tmp = obj[0]; obj[0] = NULL */ __pyx_t_1 = ((__pyx_v_obj[0]) == NULL); if (__pyx_t_1) { __pyx_r = PETSC_SUCCESS; goto __pyx_L0; } /* "petsc4py/PETSc/petscobj.pxi":59 * if obj[0] == NULL: return PETSC_SUCCESS * cdef PetscObject tmp * tmp = obj[0]; obj[0] = NULL # <<<<<<<<<<<<<< * return PetscObjectDestroy(&tmp) * */ __pyx_v_tmp = (__pyx_v_obj[0]); (__pyx_v_obj[0]) = NULL; /* "petsc4py/PETSc/petscobj.pxi":60 * cdef PetscObject tmp * tmp = obj[0]; obj[0] = NULL * return PetscObjectDestroy(&tmp) # <<<<<<<<<<<<<< * * cdef inline PetscErrorCode PetscDEALLOC(PetscObject* obj) noexcept nogil: */ __pyx_r = PetscObjectDestroy((&__pyx_v_tmp)); goto __pyx_L0; /* "petsc4py/PETSc/petscobj.pxi":55 * return PetscObjectReference(obj[0]) * * cdef inline PetscErrorCode PetscCLEAR(PetscObject* obj) noexcept nogil: # <<<<<<<<<<<<<< * if obj == NULL: return PETSC_SUCCESS * if obj[0] == NULL: return PETSC_SUCCESS */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/petscobj.pxi":62 * return PetscObjectDestroy(&tmp) * * cdef inline PetscErrorCode PetscDEALLOC(PetscObject* obj) noexcept nogil: # <<<<<<<<<<<<<< * if obj == NULL: return PETSC_SUCCESS * if obj[0] == NULL: return PETSC_SUCCESS */ static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_PetscDEALLOC(PetscObject *__pyx_v_obj) { PetscObject __pyx_v_tmp; PetscErrorCode __pyx_r; int __pyx_t_1; /* "petsc4py/PETSc/petscobj.pxi":63 * * cdef inline PetscErrorCode PetscDEALLOC(PetscObject* obj) noexcept nogil: * if obj == NULL: return PETSC_SUCCESS # <<<<<<<<<<<<<< * if obj[0] == NULL: return PETSC_SUCCESS * cdef PetscObject tmp */ __pyx_t_1 = (__pyx_v_obj == NULL); if (__pyx_t_1) { __pyx_r = PETSC_SUCCESS; goto __pyx_L0; } /* "petsc4py/PETSc/petscobj.pxi":64 * cdef inline PetscErrorCode PetscDEALLOC(PetscObject* obj) noexcept nogil: * if obj == NULL: return PETSC_SUCCESS * if obj[0] == NULL: return PETSC_SUCCESS # <<<<<<<<<<<<<< * cdef PetscObject tmp * tmp = obj[0]; obj[0] = NULL */ __pyx_t_1 = ((__pyx_v_obj[0]) == NULL); if (__pyx_t_1) { __pyx_r = PETSC_SUCCESS; goto __pyx_L0; } /* "petsc4py/PETSc/petscobj.pxi":66 * if obj[0] == NULL: return PETSC_SUCCESS * cdef PetscObject tmp * tmp = obj[0]; obj[0] = NULL # <<<<<<<<<<<<<< * if not (PetscInitializeCalled): return PETSC_SUCCESS * if (PetscFinalizeCalled): return PETSC_SUCCESS */ __pyx_v_tmp = (__pyx_v_obj[0]); (__pyx_v_obj[0]) = NULL; /* "petsc4py/PETSc/petscobj.pxi":67 * cdef PetscObject tmp * tmp = obj[0]; obj[0] = NULL * if not (PetscInitializeCalled): return PETSC_SUCCESS # <<<<<<<<<<<<<< * if (PetscFinalizeCalled): return PETSC_SUCCESS * return PetscObjectDelayedDestroy(&tmp) */ __pyx_t_1 = (!(((int)PetscInitializeCalled) != 0)); if (__pyx_t_1) { __pyx_r = PETSC_SUCCESS; goto __pyx_L0; } /* "petsc4py/PETSc/petscobj.pxi":68 * tmp = obj[0]; obj[0] = NULL * if not (PetscInitializeCalled): return PETSC_SUCCESS * if (PetscFinalizeCalled): return PETSC_SUCCESS # <<<<<<<<<<<<<< * return PetscObjectDelayedDestroy(&tmp) * */ __pyx_t_1 = (((int)PetscFinalizeCalled) != 0); if (__pyx_t_1) { __pyx_r = PETSC_SUCCESS; goto __pyx_L0; } /* "petsc4py/PETSc/petscobj.pxi":69 * if not (PetscInitializeCalled): return PETSC_SUCCESS * if (PetscFinalizeCalled): return PETSC_SUCCESS * return PetscObjectDelayedDestroy(&tmp) # <<<<<<<<<<<<<< * * cdef inline PetscErrorCode PetscINCSTATE(PetscObject *obj) noexcept nogil: */ __pyx_r = PetscObjectDelayedDestroy((&__pyx_v_tmp)); goto __pyx_L0; /* "petsc4py/PETSc/petscobj.pxi":62 * return PetscObjectDestroy(&tmp) * * cdef inline PetscErrorCode PetscDEALLOC(PetscObject* obj) noexcept nogil: # <<<<<<<<<<<<<< * if obj == NULL: return PETSC_SUCCESS * if obj[0] == NULL: return PETSC_SUCCESS */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/petscobj.pxi":71 * return PetscObjectDelayedDestroy(&tmp) * * cdef inline PetscErrorCode PetscINCSTATE(PetscObject *obj) noexcept nogil: # <<<<<<<<<<<<<< * if obj == NULL: return PETSC_SUCCESS * if obj[0] == NULL: return PETSC_SUCCESS */ static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_PetscINCSTATE(PetscObject *__pyx_v_obj) { PetscErrorCode __pyx_r; int __pyx_t_1; /* "petsc4py/PETSc/petscobj.pxi":72 * * cdef inline PetscErrorCode PetscINCSTATE(PetscObject *obj) noexcept nogil: * if obj == NULL: return PETSC_SUCCESS # <<<<<<<<<<<<<< * if obj[0] == NULL: return PETSC_SUCCESS * return PetscObjectStateIncrease(obj[0]) */ __pyx_t_1 = (__pyx_v_obj == NULL); if (__pyx_t_1) { __pyx_r = PETSC_SUCCESS; goto __pyx_L0; } /* "petsc4py/PETSc/petscobj.pxi":73 * cdef inline PetscErrorCode PetscINCSTATE(PetscObject *obj) noexcept nogil: * if obj == NULL: return PETSC_SUCCESS * if obj[0] == NULL: return PETSC_SUCCESS # <<<<<<<<<<<<<< * return PetscObjectStateIncrease(obj[0]) * */ __pyx_t_1 = ((__pyx_v_obj[0]) == NULL); if (__pyx_t_1) { __pyx_r = PETSC_SUCCESS; goto __pyx_L0; } /* "petsc4py/PETSc/petscobj.pxi":74 * if obj == NULL: return PETSC_SUCCESS * if obj[0] == NULL: return PETSC_SUCCESS * return PetscObjectStateIncrease(obj[0]) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_r = PetscObjectStateIncrease((__pyx_v_obj[0])); goto __pyx_L0; /* "petsc4py/PETSc/petscobj.pxi":71 * return PetscObjectDelayedDestroy(&tmp) * * cdef inline PetscErrorCode PetscINCSTATE(PetscObject *obj) noexcept nogil: # <<<<<<<<<<<<<< * if obj == NULL: return PETSC_SUCCESS * if obj[0] == NULL: return PETSC_SUCCESS */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/petscobj.pxi":94 * PetscErrorCode (*python_destroy)(void*) noexcept nogil * * cdef inline void Py_DecRef(PyObject *ob) noexcept with gil: # <<<<<<<<<<<<<< * _Py_DecRef(ob) * */ static CYTHON_INLINE void __pyx_f_8petsc4py_5PETSc_Py_DecRef(PyObject *__pyx_v_ob) { #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif /* "petsc4py/PETSc/petscobj.pxi":95 * * cdef inline void Py_DecRef(PyObject *ob) noexcept with gil: * _Py_DecRef(ob) # <<<<<<<<<<<<<< * * cdef PetscErrorCode PetscDelPyDict(void* ptr) noexcept nogil: */ Py_DECREF(__pyx_v_ob); /* "petsc4py/PETSc/petscobj.pxi":94 * PetscErrorCode (*python_destroy)(void*) noexcept nogil * * cdef inline void Py_DecRef(PyObject *ob) noexcept with gil: # <<<<<<<<<<<<<< * _Py_DecRef(ob) * */ /* function exit code */ #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } /* "petsc4py/PETSc/petscobj.pxi":97 * _Py_DecRef(ob) * * cdef PetscErrorCode PetscDelPyDict(void* ptr) noexcept nogil: # <<<<<<<<<<<<<< * if ptr != NULL and Py_IsInitialized(): * Py_DecRef(ptr) */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PetscDelPyDict(void *__pyx_v_ptr) { PetscErrorCode __pyx_r; int __pyx_t_1; int __pyx_t_2; /* "petsc4py/PETSc/petscobj.pxi":98 * * cdef PetscErrorCode PetscDelPyDict(void* ptr) noexcept nogil: * if ptr != NULL and Py_IsInitialized(): # <<<<<<<<<<<<<< * Py_DecRef(ptr) * return PETSC_SUCCESS */ __pyx_t_2 = (__pyx_v_ptr != NULL); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = (Py_IsInitialized() != 0); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "petsc4py/PETSc/petscobj.pxi":99 * cdef PetscErrorCode PetscDelPyDict(void* ptr) noexcept nogil: * if ptr != NULL and Py_IsInitialized(): * Py_DecRef(ptr) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_f_8petsc4py_5PETSc_Py_DecRef(((PyObject *)__pyx_v_ptr)); /* "petsc4py/PETSc/petscobj.pxi":98 * * cdef PetscErrorCode PetscDelPyDict(void* ptr) noexcept nogil: * if ptr != NULL and Py_IsInitialized(): # <<<<<<<<<<<<<< * Py_DecRef(ptr) * return PETSC_SUCCESS */ } /* "petsc4py/PETSc/petscobj.pxi":100 * if ptr != NULL and Py_IsInitialized(): * Py_DecRef(ptr) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * cdef object PetscGetPyDict(PetscObject obj, bint create): */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petscobj.pxi":97 * _Py_DecRef(ob) * * cdef PetscErrorCode PetscDelPyDict(void* ptr) noexcept nogil: # <<<<<<<<<<<<<< * if ptr != NULL and Py_IsInitialized(): * Py_DecRef(ptr) */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/petscobj.pxi":102 * return PETSC_SUCCESS * * cdef object PetscGetPyDict(PetscObject obj, bint create): # <<<<<<<<<<<<<< * if obj.python_context != NULL: * return obj.python_context */ static PyObject *__pyx_f_8petsc4py_5PETSc_PetscGetPyDict(PetscObject __pyx_v_obj, int __pyx_v_create) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PetscGetPyDict", 1); /* "petsc4py/PETSc/petscobj.pxi":103 * * cdef object PetscGetPyDict(PetscObject obj, bint create): * if obj.python_context != NULL: # <<<<<<<<<<<<<< * return obj.python_context * if create: */ __pyx_t_1 = (__pyx_v_obj->python_context != NULL); if (__pyx_t_1) { /* "petsc4py/PETSc/petscobj.pxi":104 * cdef object PetscGetPyDict(PetscObject obj, bint create): * if obj.python_context != NULL: * return obj.python_context # <<<<<<<<<<<<<< * if create: * obj.python_destroy = PetscDelPyDict */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_obj->python_context)); __pyx_r = ((PyObject *)__pyx_v_obj->python_context); goto __pyx_L0; /* "petsc4py/PETSc/petscobj.pxi":103 * * cdef object PetscGetPyDict(PetscObject obj, bint create): * if obj.python_context != NULL: # <<<<<<<<<<<<<< * return obj.python_context * if create: */ } /* "petsc4py/PETSc/petscobj.pxi":105 * if obj.python_context != NULL: * return obj.python_context * if create: # <<<<<<<<<<<<<< * obj.python_destroy = PetscDelPyDict * obj.python_context = PyDict_New() */ if (__pyx_v_create) { /* "petsc4py/PETSc/petscobj.pxi":106 * return obj.python_context * if create: * obj.python_destroy = PetscDelPyDict # <<<<<<<<<<<<<< * obj.python_context = PyDict_New() * return obj.python_context */ __pyx_v_obj->python_destroy = __pyx_f_8petsc4py_5PETSc_PetscDelPyDict; /* "petsc4py/PETSc/petscobj.pxi":107 * if create: * obj.python_destroy = PetscDelPyDict * obj.python_context = PyDict_New() # <<<<<<<<<<<<<< * return obj.python_context * return None */ __pyx_t_2 = PyDict_New(); if (unlikely(__pyx_t_2 == ((PyObject *)NULL))) __PYX_ERR(20, 107, __pyx_L1_error) __pyx_v_obj->python_context = ((void *)__pyx_t_2); /* "petsc4py/PETSc/petscobj.pxi":108 * obj.python_destroy = PetscDelPyDict * obj.python_context = PyDict_New() * return obj.python_context # <<<<<<<<<<<<<< * return None * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_obj->python_context)); __pyx_r = ((PyObject *)__pyx_v_obj->python_context); goto __pyx_L0; /* "petsc4py/PETSc/petscobj.pxi":105 * if obj.python_context != NULL: * return obj.python_context * if create: # <<<<<<<<<<<<<< * obj.python_destroy = PetscDelPyDict * obj.python_context = PyDict_New() */ } /* "petsc4py/PETSc/petscobj.pxi":109 * obj.python_context = PyDict_New() * return obj.python_context * return None # <<<<<<<<<<<<<< * * cdef inline object PetscGetPyObj(PetscObject o, char name[]): */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "petsc4py/PETSc/petscobj.pxi":102 * return PETSC_SUCCESS * * cdef object PetscGetPyDict(PetscObject obj, bint create): # <<<<<<<<<<<<<< * if obj.python_context != NULL: * return obj.python_context */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PetscGetPyDict", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscobj.pxi":111 * return None * * cdef inline object PetscGetPyObj(PetscObject o, char name[]): # <<<<<<<<<<<<<< * cdef object dct = PetscGetPyDict(o, False) * if dct is None: return None */ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_PetscGetPyObj(PetscObject __pyx_v_o, char *__pyx_v_name) { PyObject *__pyx_v_dct = 0; PyObject *__pyx_v_key = 0; PyObject *__pyx_v_d; PyObject *__pyx_v_k; PyObject *__pyx_v_v; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PetscGetPyObj", 1); /* "petsc4py/PETSc/petscobj.pxi":112 * * cdef inline object PetscGetPyObj(PetscObject o, char name[]): * cdef object dct = PetscGetPyDict(o, False) # <<<<<<<<<<<<<< * if dct is None: return None * cdef object key = bytes2str(name) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_PetscGetPyDict(__pyx_v_o, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_dct = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/petscobj.pxi":113 * cdef inline object PetscGetPyObj(PetscObject o, char name[]): * cdef object dct = PetscGetPyDict(o, False) * if dct is None: return None # <<<<<<<<<<<<<< * cdef object key = bytes2str(name) * cdef PyObject *d = dct */ __pyx_t_2 = (__pyx_v_dct == Py_None); if (__pyx_t_2) { __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } /* "petsc4py/PETSc/petscobj.pxi":114 * cdef object dct = PetscGetPyDict(o, False) * if dct is None: return None * cdef object key = bytes2str(name) # <<<<<<<<<<<<<< * cdef PyObject *d = dct * cdef PyObject *k = key */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_key = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/petscobj.pxi":115 * if dct is None: return None * cdef object key = bytes2str(name) * cdef PyObject *d = dct # <<<<<<<<<<<<<< * cdef PyObject *k = key * cdef PyObject *v = NULL */ __pyx_v_d = ((PyObject *)__pyx_v_dct); /* "petsc4py/PETSc/petscobj.pxi":116 * cdef object key = bytes2str(name) * cdef PyObject *d = dct * cdef PyObject *k = key # <<<<<<<<<<<<<< * cdef PyObject *v = NULL * v = PyDict_GetItem(d, k) */ __pyx_v_k = ((PyObject *)__pyx_v_key); /* "petsc4py/PETSc/petscobj.pxi":117 * cdef PyObject *d = dct * cdef PyObject *k = key * cdef PyObject *v = NULL # <<<<<<<<<<<<<< * v = PyDict_GetItem(d, k) * if v != NULL: return v */ __pyx_v_v = NULL; /* "petsc4py/PETSc/petscobj.pxi":118 * cdef PyObject *k = key * cdef PyObject *v = NULL * v = PyDict_GetItem(d, k) # <<<<<<<<<<<<<< * if v != NULL: return v * return None */ __pyx_t_3 = PyDict_GetItem(__pyx_v_d, __pyx_v_k); if (unlikely(PyErr_Occurred())) __PYX_ERR(20, 118, __pyx_L1_error) __pyx_v_v = __pyx_t_3; /* "petsc4py/PETSc/petscobj.pxi":119 * cdef PyObject *v = NULL * v = PyDict_GetItem(d, k) * if v != NULL: return v # <<<<<<<<<<<<<< * return None * */ __pyx_t_2 = (__pyx_v_v != NULL); if (__pyx_t_2) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_v)); __pyx_r = ((PyObject *)__pyx_v_v); goto __pyx_L0; } /* "petsc4py/PETSc/petscobj.pxi":120 * v = PyDict_GetItem(d, k) * if v != NULL: return v * return None # <<<<<<<<<<<<<< * * cdef inline object PetscSetPyObj(PetscObject o, char name[], object p): */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "petsc4py/PETSc/petscobj.pxi":111 * return None * * cdef inline object PetscGetPyObj(PetscObject o, char name[]): # <<<<<<<<<<<<<< * cdef object dct = PetscGetPyDict(o, False) * if dct is None: return None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PetscGetPyObj", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_dct); __Pyx_XDECREF(__pyx_v_key); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscobj.pxi":122 * return None * * cdef inline object PetscSetPyObj(PetscObject o, char name[], object p): # <<<<<<<<<<<<<< * cdef object dct * if p is not None: */ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_PetscSetPyObj(PetscObject __pyx_v_o, char *__pyx_v_name, PyObject *__pyx_v_p) { PyObject *__pyx_v_dct = 0; PyObject *__pyx_v_key = 0; PyObject *__pyx_v_d; PyObject *__pyx_v_k; PyObject *__pyx_v_v; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PetscSetPyObj", 1); /* "petsc4py/PETSc/petscobj.pxi":124 * cdef inline object PetscSetPyObj(PetscObject o, char name[], object p): * cdef object dct * if p is not None: # <<<<<<<<<<<<<< * dct = PetscGetPyDict(o, True) * else: */ __pyx_t_1 = (__pyx_v_p != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/petscobj.pxi":125 * cdef object dct * if p is not None: * dct = PetscGetPyDict(o, True) # <<<<<<<<<<<<<< * else: * dct = PetscGetPyDict(o, False) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_PetscGetPyDict(__pyx_v_o, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(20, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_dct = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/petscobj.pxi":124 * cdef inline object PetscSetPyObj(PetscObject o, char name[], object p): * cdef object dct * if p is not None: # <<<<<<<<<<<<<< * dct = PetscGetPyDict(o, True) * else: */ goto __pyx_L3; } /* "petsc4py/PETSc/petscobj.pxi":127 * dct = PetscGetPyDict(o, True) * else: * dct = PetscGetPyDict(o, False) # <<<<<<<<<<<<<< * if dct is None: return None * cdef str key = bytes2str(name) */ /*else*/ { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_PetscGetPyDict(__pyx_v_o, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(20, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_dct = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/petscobj.pxi":128 * else: * dct = PetscGetPyDict(o, False) * if dct is None: return None # <<<<<<<<<<<<<< * cdef str key = bytes2str(name) * cdef PyObject *d = dct */ __pyx_t_1 = (__pyx_v_dct == Py_None); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } } __pyx_L3:; /* "petsc4py/PETSc/petscobj.pxi":129 * dct = PetscGetPyDict(o, False) * if dct is None: return None * cdef str key = bytes2str(name) # <<<<<<<<<<<<<< * cdef PyObject *d = dct * cdef PyObject *k = key */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(20, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (!(likely(PyString_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_2))) __PYX_ERR(20, 129, __pyx_L1_error) __pyx_v_key = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscobj.pxi":130 * if dct is None: return None * cdef str key = bytes2str(name) * cdef PyObject *d = dct # <<<<<<<<<<<<<< * cdef PyObject *k = key * cdef PyObject *v = p */ __pyx_v_d = ((PyObject *)__pyx_v_dct); /* "petsc4py/PETSc/petscobj.pxi":131 * cdef str key = bytes2str(name) * cdef PyObject *d = dct * cdef PyObject *k = key # <<<<<<<<<<<<<< * cdef PyObject *v = p * PyDict_SetItem(d, k, v) */ __pyx_v_k = ((PyObject *)__pyx_v_key); /* "petsc4py/PETSc/petscobj.pxi":132 * cdef PyObject *d = dct * cdef PyObject *k = key * cdef PyObject *v = p # <<<<<<<<<<<<<< * PyDict_SetItem(d, k, v) * if v == None: */ __pyx_v_v = ((PyObject *)__pyx_v_p); /* "petsc4py/PETSc/petscobj.pxi":133 * cdef PyObject *k = key * cdef PyObject *v = p * PyDict_SetItem(d, k, v) # <<<<<<<<<<<<<< * if v == None: * PyDict_DelItem(d, k) */ __pyx_t_3 = PyDict_SetItem(__pyx_v_d, __pyx_v_k, __pyx_v_v); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(20, 133, __pyx_L1_error) /* "petsc4py/PETSc/petscobj.pxi":134 * cdef PyObject *v = p * PyDict_SetItem(d, k, v) * if v == None: # <<<<<<<<<<<<<< * PyDict_DelItem(d, k) * return None */ __pyx_t_1 = (__pyx_v_v == ((PyObject *)Py_None)); if (__pyx_t_1) { /* "petsc4py/PETSc/petscobj.pxi":135 * PyDict_SetItem(d, k, v) * if v == None: * PyDict_DelItem(d, k) # <<<<<<<<<<<<<< * return None * */ __pyx_t_3 = PyDict_DelItem(__pyx_v_d, __pyx_v_k); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(20, 135, __pyx_L1_error) /* "petsc4py/PETSc/petscobj.pxi":134 * cdef PyObject *v = p * PyDict_SetItem(d, k, v) * if v == None: # <<<<<<<<<<<<<< * PyDict_DelItem(d, k) * return None */ } /* "petsc4py/PETSc/petscobj.pxi":136 * if v == None: * PyDict_DelItem(d, k) * return None # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "petsc4py/PETSc/petscobj.pxi":122 * return None * * cdef inline object PetscSetPyObj(PetscObject o, char name[], object p): # <<<<<<<<<<<<<< * cdef object dct * if p is not None: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.PetscSetPyObj", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_dct); __Pyx_XDECREF(__pyx_v_key); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscobj.pxi":143 * object PyLong_FromVoidPtr(void*) * * cdef inline Py_intptr_t Object_toFortran(PetscObject o) nogil: # <<<<<<<<<<<<<< * return o * */ static CYTHON_INLINE Py_intptr_t __pyx_f_8petsc4py_5PETSc_Object_toFortran(PetscObject __pyx_v_o) { Py_intptr_t __pyx_r; /* "petsc4py/PETSc/petscobj.pxi":144 * * cdef inline Py_intptr_t Object_toFortran(PetscObject o) nogil: * return o # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_r = ((Py_intptr_t)__pyx_v_o); goto __pyx_L0; /* "petsc4py/PETSc/petscobj.pxi":143 * object PyLong_FromVoidPtr(void*) * * cdef inline Py_intptr_t Object_toFortran(PetscObject o) nogil: # <<<<<<<<<<<<<< * return o * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/petscobj.pxi":148 * # -------------------------------------------------------------------- * * cdef inline type subtype_DM(PetscDM dm): # <<<<<<<<<<<<<< * cdef PetscObject obj = dm * if obj == NULL: return DM */ static CYTHON_INLINE PyTypeObject *__pyx_f_8petsc4py_5PETSc_subtype_DM(DM __pyx_v_dm) { PetscObject __pyx_v_obj; PetscBool __pyx_v_match; PyTypeObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("subtype_DM", 1); /* "petsc4py/PETSc/petscobj.pxi":149 * * cdef inline type subtype_DM(PetscDM dm): * cdef PetscObject obj = dm # <<<<<<<<<<<<<< * if obj == NULL: return DM * # --- */ __pyx_v_obj = ((PetscObject)__pyx_v_dm); /* "petsc4py/PETSc/petscobj.pxi":150 * cdef inline type subtype_DM(PetscDM dm): * cdef PetscObject obj = dm * if obj == NULL: return DM # <<<<<<<<<<<<<< * # --- * cdef PetscBool match = PETSC_FALSE */ __pyx_t_1 = (__pyx_v_obj == NULL); if (__pyx_t_1) { __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM); __pyx_r = __pyx_ptype_8petsc4py_5PETSc_DM; goto __pyx_L0; } /* "petsc4py/PETSc/petscobj.pxi":152 * if obj == NULL: return DM * # --- * cdef PetscBool match = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( PetscObjectTypeCompare(obj, b"da", &match) ) * if match == PETSC_TRUE: return DMDA */ __pyx_v_match = PETSC_FALSE; /* "petsc4py/PETSc/petscobj.pxi":153 * # --- * cdef PetscBool match = PETSC_FALSE * CHKERR( PetscObjectTypeCompare(obj, b"da", &match) ) # <<<<<<<<<<<<<< * if match == PETSC_TRUE: return DMDA * CHKERR( PetscObjectTypeCompare(obj, b"plex", &match) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectTypeCompare(__pyx_v_obj, ((char *)"da"), (&__pyx_v_match))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(20, 153, __pyx_L1_error) /* "petsc4py/PETSc/petscobj.pxi":154 * cdef PetscBool match = PETSC_FALSE * CHKERR( PetscObjectTypeCompare(obj, b"da", &match) ) * if match == PETSC_TRUE: return DMDA # <<<<<<<<<<<<<< * CHKERR( PetscObjectTypeCompare(obj, b"plex", &match) ) * if match == PETSC_TRUE: return DMPlex */ __pyx_t_1 = (__pyx_v_match == PETSC_TRUE); if (__pyx_t_1) { __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DMDA); __pyx_r = __pyx_ptype_8petsc4py_5PETSc_DMDA; goto __pyx_L0; } /* "petsc4py/PETSc/petscobj.pxi":155 * CHKERR( PetscObjectTypeCompare(obj, b"da", &match) ) * if match == PETSC_TRUE: return DMDA * CHKERR( PetscObjectTypeCompare(obj, b"plex", &match) ) # <<<<<<<<<<<<<< * if match == PETSC_TRUE: return DMPlex * CHKERR( PetscObjectTypeCompare(obj, b"composite", &match) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectTypeCompare(__pyx_v_obj, ((char *)"plex"), (&__pyx_v_match))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(20, 155, __pyx_L1_error) /* "petsc4py/PETSc/petscobj.pxi":156 * if match == PETSC_TRUE: return DMDA * CHKERR( PetscObjectTypeCompare(obj, b"plex", &match) ) * if match == PETSC_TRUE: return DMPlex # <<<<<<<<<<<<<< * CHKERR( PetscObjectTypeCompare(obj, b"composite", &match) ) * if match == PETSC_TRUE: return DMComposite */ __pyx_t_1 = (__pyx_v_match == PETSC_TRUE); if (__pyx_t_1) { __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DMPlex); __pyx_r = __pyx_ptype_8petsc4py_5PETSc_DMPlex; goto __pyx_L0; } /* "petsc4py/PETSc/petscobj.pxi":157 * CHKERR( PetscObjectTypeCompare(obj, b"plex", &match) ) * if match == PETSC_TRUE: return DMPlex * CHKERR( PetscObjectTypeCompare(obj, b"composite", &match) ) # <<<<<<<<<<<<<< * if match == PETSC_TRUE: return DMComposite * CHKERR( PetscObjectTypeCompare(obj, b"shell", &match) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectTypeCompare(__pyx_v_obj, ((char *)"composite"), (&__pyx_v_match))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(20, 157, __pyx_L1_error) /* "petsc4py/PETSc/petscobj.pxi":158 * if match == PETSC_TRUE: return DMPlex * CHKERR( PetscObjectTypeCompare(obj, b"composite", &match) ) * if match == PETSC_TRUE: return DMComposite # <<<<<<<<<<<<<< * CHKERR( PetscObjectTypeCompare(obj, b"shell", &match) ) * if match == PETSC_TRUE: return DMShell */ __pyx_t_1 = (__pyx_v_match == PETSC_TRUE); if (__pyx_t_1) { __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DMComposite); __pyx_r = __pyx_ptype_8petsc4py_5PETSc_DMComposite; goto __pyx_L0; } /* "petsc4py/PETSc/petscobj.pxi":159 * CHKERR( PetscObjectTypeCompare(obj, b"composite", &match) ) * if match == PETSC_TRUE: return DMComposite * CHKERR( PetscObjectTypeCompare(obj, b"shell", &match) ) # <<<<<<<<<<<<<< * if match == PETSC_TRUE: return DMShell * CHKERR( PetscObjectTypeCompare(obj, b"stag", &match) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectTypeCompare(__pyx_v_obj, ((char *)"shell"), (&__pyx_v_match))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(20, 159, __pyx_L1_error) /* "petsc4py/PETSc/petscobj.pxi":160 * if match == PETSC_TRUE: return DMComposite * CHKERR( PetscObjectTypeCompare(obj, b"shell", &match) ) * if match == PETSC_TRUE: return DMShell # <<<<<<<<<<<<<< * CHKERR( PetscObjectTypeCompare(obj, b"stag", &match) ) * if match == PETSC_TRUE: return DMStag */ __pyx_t_1 = (__pyx_v_match == PETSC_TRUE); if (__pyx_t_1) { __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DMShell); __pyx_r = __pyx_ptype_8petsc4py_5PETSc_DMShell; goto __pyx_L0; } /* "petsc4py/PETSc/petscobj.pxi":161 * CHKERR( PetscObjectTypeCompare(obj, b"shell", &match) ) * if match == PETSC_TRUE: return DMShell * CHKERR( PetscObjectTypeCompare(obj, b"stag", &match) ) # <<<<<<<<<<<<<< * if match == PETSC_TRUE: return DMStag * CHKERR( PetscObjectTypeCompare(obj, b"swarm", &match) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectTypeCompare(__pyx_v_obj, ((char *)"stag"), (&__pyx_v_match))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(20, 161, __pyx_L1_error) /* "petsc4py/PETSc/petscobj.pxi":162 * if match == PETSC_TRUE: return DMShell * CHKERR( PetscObjectTypeCompare(obj, b"stag", &match) ) * if match == PETSC_TRUE: return DMStag # <<<<<<<<<<<<<< * CHKERR( PetscObjectTypeCompare(obj, b"swarm", &match) ) * if match == PETSC_TRUE: return DMSwarm */ __pyx_t_1 = (__pyx_v_match == PETSC_TRUE); if (__pyx_t_1) { __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DMStag); __pyx_r = __pyx_ptype_8petsc4py_5PETSc_DMStag; goto __pyx_L0; } /* "petsc4py/PETSc/petscobj.pxi":163 * CHKERR( PetscObjectTypeCompare(obj, b"stag", &match) ) * if match == PETSC_TRUE: return DMStag * CHKERR( PetscObjectTypeCompare(obj, b"swarm", &match) ) # <<<<<<<<<<<<<< * if match == PETSC_TRUE: return DMSwarm * # --- */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectTypeCompare(__pyx_v_obj, ((char *)"swarm"), (&__pyx_v_match))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(20, 163, __pyx_L1_error) /* "petsc4py/PETSc/petscobj.pxi":164 * if match == PETSC_TRUE: return DMStag * CHKERR( PetscObjectTypeCompare(obj, b"swarm", &match) ) * if match == PETSC_TRUE: return DMSwarm # <<<<<<<<<<<<<< * # --- * return DM */ __pyx_t_1 = (__pyx_v_match == PETSC_TRUE); if (__pyx_t_1) { __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DMSwarm); __pyx_r = __pyx_ptype_8petsc4py_5PETSc_DMSwarm; goto __pyx_L0; } /* "petsc4py/PETSc/petscobj.pxi":166 * if match == PETSC_TRUE: return DMSwarm * # --- * return DM # <<<<<<<<<<<<<< * * cdef inline type subtype_Object(PetscObject obj): */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM); __pyx_r = __pyx_ptype_8petsc4py_5PETSc_DM; goto __pyx_L0; /* "petsc4py/PETSc/petscobj.pxi":148 * # -------------------------------------------------------------------- * * cdef inline type subtype_DM(PetscDM dm): # <<<<<<<<<<<<<< * cdef PetscObject obj = dm * if obj == NULL: return DM */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.subtype_DM", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscobj.pxi":168 * return DM * * cdef inline type subtype_Object(PetscObject obj): # <<<<<<<<<<<<<< * cdef type klass = Object * if obj == NULL: return klass */ static CYTHON_INLINE PyTypeObject *__pyx_f_8petsc4py_5PETSc_subtype_Object(PetscObject __pyx_v_obj) { PyTypeObject *__pyx_v_klass = 0; PetscClassId __pyx_v_classid; PyTypeObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("subtype_Object", 1); /* "petsc4py/PETSc/petscobj.pxi":169 * * cdef inline type subtype_Object(PetscObject obj): * cdef type klass = Object # <<<<<<<<<<<<<< * if obj == NULL: return klass * cdef PetscClassId classid = 0 */ __Pyx_INCREF((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Object); __pyx_v_klass = __pyx_ptype_8petsc4py_5PETSc_Object; /* "petsc4py/PETSc/petscobj.pxi":170 * cdef inline type subtype_Object(PetscObject obj): * cdef type klass = Object * if obj == NULL: return klass # <<<<<<<<<<<<<< * cdef PetscClassId classid = 0 * CHKERR( PetscObjectGetClassId(obj,&classid) ) */ __pyx_t_1 = (__pyx_v_obj == NULL); if (__pyx_t_1) { __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_klass); __pyx_r = __pyx_v_klass; goto __pyx_L0; } /* "petsc4py/PETSc/petscobj.pxi":171 * cdef type klass = Object * if obj == NULL: return klass * cdef PetscClassId classid = 0 # <<<<<<<<<<<<<< * CHKERR( PetscObjectGetClassId(obj,&classid) ) * if classid == PETSC_DM_CLASSID: */ __pyx_v_classid = 0; /* "petsc4py/PETSc/petscobj.pxi":172 * if obj == NULL: return klass * cdef PetscClassId classid = 0 * CHKERR( PetscObjectGetClassId(obj,&classid) ) # <<<<<<<<<<<<<< * if classid == PETSC_DM_CLASSID: * klass = subtype_DM(obj) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectGetClassId(__pyx_v_obj, (&__pyx_v_classid))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(20, 172, __pyx_L1_error) /* "petsc4py/PETSc/petscobj.pxi":173 * cdef PetscClassId classid = 0 * CHKERR( PetscObjectGetClassId(obj,&classid) ) * if classid == PETSC_DM_CLASSID: # <<<<<<<<<<<<<< * klass = subtype_DM(obj) * else: */ __pyx_t_1 = (__pyx_v_classid == DM_CLASSID); if (__pyx_t_1) { /* "petsc4py/PETSc/petscobj.pxi":174 * CHKERR( PetscObjectGetClassId(obj,&classid) ) * if classid == PETSC_DM_CLASSID: * klass = subtype_DM(obj) # <<<<<<<<<<<<<< * else: * klass = PyPetscType_Lookup(classid) */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(((DM)__pyx_v_obj))); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_klass, ((PyTypeObject*)__pyx_t_3)); __pyx_t_3 = 0; /* "petsc4py/PETSc/petscobj.pxi":173 * cdef PetscClassId classid = 0 * CHKERR( PetscObjectGetClassId(obj,&classid) ) * if classid == PETSC_DM_CLASSID: # <<<<<<<<<<<<<< * klass = subtype_DM(obj) * else: */ goto __pyx_L4; } /* "petsc4py/PETSc/petscobj.pxi":176 * klass = subtype_DM(obj) * else: * klass = PyPetscType_Lookup(classid) # <<<<<<<<<<<<<< * return klass * */ /*else*/ { __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyPetscType_Lookup(__pyx_v_classid)); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_klass, ((PyTypeObject*)__pyx_t_3)); __pyx_t_3 = 0; } __pyx_L4:; /* "petsc4py/PETSc/petscobj.pxi":177 * else: * klass = PyPetscType_Lookup(classid) * return klass # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_klass); __pyx_r = __pyx_v_klass; goto __pyx_L0; /* "petsc4py/PETSc/petscobj.pxi":168 * return DM * * cdef inline type subtype_Object(PetscObject obj): # <<<<<<<<<<<<<< * cdef type klass = Object * if obj == NULL: return klass */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.subtype_Object", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_klass); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscvwr.pxi":147 * # --- * * cdef inline PetscFileMode filemode(object mode) except (-1): # <<<<<<<<<<<<<< * if mode is None: * return PETSC_FILE_MODE_READ */ static CYTHON_INLINE PetscFileMode __pyx_f_8petsc4py_5PETSc_filemode(PyObject *__pyx_v_mode) { PetscFileMode __pyx_r; int __pyx_t_1; PetscFileMode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "petsc4py/PETSc/petscvwr.pxi":148 * * cdef inline PetscFileMode filemode(object mode) except (-1): * if mode is None: # <<<<<<<<<<<<<< * return PETSC_FILE_MODE_READ * if isinstance(mode, str): */ __pyx_t_1 = (__pyx_v_mode == Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/petscvwr.pxi":149 * cdef inline PetscFileMode filemode(object mode) except (-1): * if mode is None: * return PETSC_FILE_MODE_READ # <<<<<<<<<<<<<< * if isinstance(mode, str): * if mode == 'r' : return PETSC_FILE_MODE_READ */ __pyx_r = FILE_MODE_READ; goto __pyx_L0; /* "petsc4py/PETSc/petscvwr.pxi":148 * * cdef inline PetscFileMode filemode(object mode) except (-1): * if mode is None: # <<<<<<<<<<<<<< * return PETSC_FILE_MODE_READ * if isinstance(mode, str): */ } /* "petsc4py/PETSc/petscvwr.pxi":150 * if mode is None: * return PETSC_FILE_MODE_READ * if isinstance(mode, str): # <<<<<<<<<<<<<< * if mode == 'r' : return PETSC_FILE_MODE_READ * elif mode == 'w' : return PETSC_FILE_MODE_WRITE */ __pyx_t_1 = PyString_Check(__pyx_v_mode); if (__pyx_t_1) { /* "petsc4py/PETSc/petscvwr.pxi":151 * return PETSC_FILE_MODE_READ * if isinstance(mode, str): * if mode == 'r' : return PETSC_FILE_MODE_READ # <<<<<<<<<<<<<< * elif mode == 'w' : return PETSC_FILE_MODE_WRITE * elif mode == 'a' : return PETSC_FILE_MODE_APPEND */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_r, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(21, 151, __pyx_L1_error) if (__pyx_t_1) { __pyx_r = FILE_MODE_READ; goto __pyx_L0; } /* "petsc4py/PETSc/petscvwr.pxi":152 * if isinstance(mode, str): * if mode == 'r' : return PETSC_FILE_MODE_READ * elif mode == 'w' : return PETSC_FILE_MODE_WRITE # <<<<<<<<<<<<<< * elif mode == 'a' : return PETSC_FILE_MODE_APPEND * elif mode == 'r+' : return PETSC_FILE_MODE_UPDATE */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_w, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(21, 152, __pyx_L1_error) if (__pyx_t_1) { __pyx_r = FILE_MODE_WRITE; goto __pyx_L0; } /* "petsc4py/PETSc/petscvwr.pxi":153 * if mode == 'r' : return PETSC_FILE_MODE_READ * elif mode == 'w' : return PETSC_FILE_MODE_WRITE * elif mode == 'a' : return PETSC_FILE_MODE_APPEND # <<<<<<<<<<<<<< * elif mode == 'r+' : return PETSC_FILE_MODE_UPDATE * elif mode == 'w+' : return PETSC_FILE_MODE_UPDATE */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_a, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(21, 153, __pyx_L1_error) if (__pyx_t_1) { __pyx_r = FILE_MODE_APPEND; goto __pyx_L0; } /* "petsc4py/PETSc/petscvwr.pxi":154 * elif mode == 'w' : return PETSC_FILE_MODE_WRITE * elif mode == 'a' : return PETSC_FILE_MODE_APPEND * elif mode == 'r+' : return PETSC_FILE_MODE_UPDATE # <<<<<<<<<<<<<< * elif mode == 'w+' : return PETSC_FILE_MODE_UPDATE * elif mode == 'a+' : return PETSC_FILE_MODE_APPEND_UPDATE */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_kp_s_r_2, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(21, 154, __pyx_L1_error) if (__pyx_t_1) { __pyx_r = FILE_MODE_UPDATE; goto __pyx_L0; } /* "petsc4py/PETSc/petscvwr.pxi":155 * elif mode == 'a' : return PETSC_FILE_MODE_APPEND * elif mode == 'r+' : return PETSC_FILE_MODE_UPDATE * elif mode == 'w+' : return PETSC_FILE_MODE_UPDATE # <<<<<<<<<<<<<< * elif mode == 'a+' : return PETSC_FILE_MODE_APPEND_UPDATE * elif mode == 'u' : return PETSC_FILE_MODE_UPDATE */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_kp_s_w_2, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(21, 155, __pyx_L1_error) if (__pyx_t_1) { __pyx_r = FILE_MODE_UPDATE; goto __pyx_L0; } /* "petsc4py/PETSc/petscvwr.pxi":156 * elif mode == 'r+' : return PETSC_FILE_MODE_UPDATE * elif mode == 'w+' : return PETSC_FILE_MODE_UPDATE * elif mode == 'a+' : return PETSC_FILE_MODE_APPEND_UPDATE # <<<<<<<<<<<<<< * elif mode == 'u' : return PETSC_FILE_MODE_UPDATE * elif mode == 'au' : return PETSC_FILE_MODE_APPEND_UPDATE */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_kp_s_a_2, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(21, 156, __pyx_L1_error) if (__pyx_t_1) { __pyx_r = FILE_MODE_APPEND_UPDATE; goto __pyx_L0; } /* "petsc4py/PETSc/petscvwr.pxi":157 * elif mode == 'w+' : return PETSC_FILE_MODE_UPDATE * elif mode == 'a+' : return PETSC_FILE_MODE_APPEND_UPDATE * elif mode == 'u' : return PETSC_FILE_MODE_UPDATE # <<<<<<<<<<<<<< * elif mode == 'au' : return PETSC_FILE_MODE_APPEND_UPDATE * elif mode == 'ua' : return PETSC_FILE_MODE_APPEND_UPDATE */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_u, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(21, 157, __pyx_L1_error) if (__pyx_t_1) { __pyx_r = FILE_MODE_UPDATE; goto __pyx_L0; } /* "petsc4py/PETSc/petscvwr.pxi":158 * elif mode == 'a+' : return PETSC_FILE_MODE_APPEND_UPDATE * elif mode == 'u' : return PETSC_FILE_MODE_UPDATE * elif mode == 'au' : return PETSC_FILE_MODE_APPEND_UPDATE # <<<<<<<<<<<<<< * elif mode == 'ua' : return PETSC_FILE_MODE_APPEND_UPDATE * return mode */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_au, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(21, 158, __pyx_L1_error) if (__pyx_t_1) { __pyx_r = FILE_MODE_APPEND_UPDATE; goto __pyx_L0; } /* "petsc4py/PETSc/petscvwr.pxi":159 * elif mode == 'u' : return PETSC_FILE_MODE_UPDATE * elif mode == 'au' : return PETSC_FILE_MODE_APPEND_UPDATE * elif mode == 'ua' : return PETSC_FILE_MODE_APPEND_UPDATE # <<<<<<<<<<<<<< * return mode */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_ua, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(21, 159, __pyx_L1_error) if (__pyx_t_1) { __pyx_r = FILE_MODE_APPEND_UPDATE; goto __pyx_L0; } /* "petsc4py/PETSc/petscvwr.pxi":150 * if mode is None: * return PETSC_FILE_MODE_READ * if isinstance(mode, str): # <<<<<<<<<<<<<< * if mode == 'r' : return PETSC_FILE_MODE_READ * elif mode == 'w' : return PETSC_FILE_MODE_WRITE */ } /* "petsc4py/PETSc/petscvwr.pxi":160 * elif mode == 'au' : return PETSC_FILE_MODE_APPEND_UPDATE * elif mode == 'ua' : return PETSC_FILE_MODE_APPEND_UPDATE * return mode # <<<<<<<<<<<<<< */ __pyx_t_2 = ((PetscFileMode)__Pyx_PyInt_As_PetscFileMode(__pyx_v_mode)); if (unlikely(PyErr_Occurred())) __PYX_ERR(21, 160, __pyx_L1_error) __pyx_r = __pyx_t_2; goto __pyx_L0; /* "petsc4py/PETSc/petscvwr.pxi":147 * # --- * * cdef inline PetscFileMode filemode(object mode) except (-1): # <<<<<<<<<<<<<< * if mode is None: * return PETSC_FILE_MODE_READ */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.filemode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = ((PetscFileMode)-1L); __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/petscdevice.pxi":66 * PetscErrorCode PetscDeviceContextSetCurrentContext(PetscDeviceContext) * * cdef inline PetscDeviceType asDeviceType(object dtype) except (-1): # <<<<<<<<<<<<<< * if isinstance(dtype, str): * dtype = dtype.upper() */ static CYTHON_INLINE PetscDeviceType __pyx_f_8petsc4py_5PETSc_asDeviceType(PyObject *__pyx_v_dtype) { PetscDeviceType __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PetscDeviceType __pyx_t_9; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("asDeviceType", 0); __Pyx_INCREF(__pyx_v_dtype); /* "petsc4py/PETSc/petscdevice.pxi":67 * * cdef inline PetscDeviceType asDeviceType(object dtype) except (-1): * if isinstance(dtype, str): # <<<<<<<<<<<<<< * dtype = dtype.upper() * try: */ __pyx_t_1 = PyString_Check(__pyx_v_dtype); if (__pyx_t_1) { /* "petsc4py/PETSc/petscdevice.pxi":68 * cdef inline PetscDeviceType asDeviceType(object dtype) except (-1): * if isinstance(dtype, str): * dtype = dtype.upper() # <<<<<<<<<<<<<< * try: * return getattr(Device.Type, dtype) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_upper); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF_SET(__pyx_v_dtype, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscdevice.pxi":69 * if isinstance(dtype, str): * dtype = dtype.upper() * try: # <<<<<<<<<<<<<< * return getattr(Device.Type, dtype) * except AttributeError: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); /*try:*/ { /* "petsc4py/PETSc/petscdevice.pxi":70 * dtype = dtype.upper() * try: * return getattr(Device.Type, dtype) # <<<<<<<<<<<<<< * except AttributeError: * raise ValueError("unknown device type: %s" % dtype) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Device), __pyx_n_s_Type); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 70, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetAttr(__pyx_t_2, __pyx_v_dtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 70, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_9 = ((PetscDeviceType)__Pyx_PyInt_As_PetscDeviceType(__pyx_t_3)); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 70, __pyx_L4_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_9; goto __pyx_L8_try_return; /* "petsc4py/PETSc/petscdevice.pxi":69 * if isinstance(dtype, str): * dtype = dtype.upper() * try: # <<<<<<<<<<<<<< * return getattr(Device.Type, dtype) * except AttributeError: */ } __pyx_L4_error:; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/petscdevice.pxi":71 * try: * return getattr(Device.Type, dtype) * except AttributeError: # <<<<<<<<<<<<<< * raise ValueError("unknown device type: %s" % dtype) * return dtype */ __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError); if (__pyx_t_5) { __Pyx_AddTraceback("petsc4py.PETSc.asDeviceType", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_4) < 0) __PYX_ERR(5, 71, __pyx_L6_except_error) __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_4); /* "petsc4py/PETSc/petscdevice.pxi":72 * return getattr(Device.Type, dtype) * except AttributeError: * raise ValueError("unknown device type: %s" % dtype) # <<<<<<<<<<<<<< * return dtype * */ __pyx_t_10 = __Pyx_PyString_FormatSafe(__pyx_kp_s_unknown_device_type_s, __pyx_v_dtype); if (unlikely(!__pyx_t_10)) __PYX_ERR(5, 72, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(5, 72, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_Raise(__pyx_t_11, 0, 0, 0); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __PYX_ERR(5, 72, __pyx_L6_except_error) } goto __pyx_L6_except_error; /* "petsc4py/PETSc/petscdevice.pxi":69 * if isinstance(dtype, str): * dtype = dtype.upper() * try: # <<<<<<<<<<<<<< * return getattr(Device.Type, dtype) * except AttributeError: */ __pyx_L6_except_error:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); goto __pyx_L1_error; __pyx_L8_try_return:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); goto __pyx_L0; } /* "petsc4py/PETSc/petscdevice.pxi":67 * * cdef inline PetscDeviceType asDeviceType(object dtype) except (-1): * if isinstance(dtype, str): # <<<<<<<<<<<<<< * dtype = dtype.upper() * try: */ } /* "petsc4py/PETSc/petscdevice.pxi":73 * except AttributeError: * raise ValueError("unknown device type: %s" % dtype) * return dtype # <<<<<<<<<<<<<< * * cdef inline str toDeviceType(PetscDeviceType dtype): */ __pyx_t_9 = ((PetscDeviceType)__Pyx_PyInt_As_PetscDeviceType(__pyx_v_dtype)); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 73, __pyx_L1_error) __pyx_r = __pyx_t_9; goto __pyx_L0; /* "petsc4py/PETSc/petscdevice.pxi":66 * PetscErrorCode PetscDeviceContextSetCurrentContext(PetscDeviceContext) * * cdef inline PetscDeviceType asDeviceType(object dtype) except (-1): # <<<<<<<<<<<<<< * if isinstance(dtype, str): * dtype = dtype.upper() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("petsc4py.PETSc.asDeviceType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = ((PetscDeviceType)-1L); __pyx_L0:; __Pyx_XDECREF(__pyx_v_dtype); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscdevice.pxi":75 * return dtype * * cdef inline str toDeviceType(PetscDeviceType dtype): # <<<<<<<<<<<<<< * try: * return Device.Type.__enum2str[dtype] */ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toDeviceType(PetscDeviceType __pyx_v_dtype) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("toDeviceType", 1); /* "petsc4py/PETSc/petscdevice.pxi":76 * * cdef inline str toDeviceType(PetscDeviceType dtype): * try: # <<<<<<<<<<<<<< * return Device.Type.__enum2str[dtype] * except KeyError: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { /* "petsc4py/PETSc/petscdevice.pxi":77 * cdef inline str toDeviceType(PetscDeviceType dtype): * try: * return Device.Type.__enum2str[dtype] # <<<<<<<<<<<<<< * except KeyError: * raise NotImplementedError("unhandled PetscDeviceType %d" % dtype) */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Device), __pyx_n_s_Type); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 77, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_enum2str); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 77, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_From_PetscDeviceType(__pyx_v_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 77, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 77, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!(likely(PyString_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_6))) __PYX_ERR(5, 77, __pyx_L3_error) __pyx_r = ((PyObject*)__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L7_try_return; /* "petsc4py/PETSc/petscdevice.pxi":76 * * cdef inline str toDeviceType(PetscDeviceType dtype): * try: # <<<<<<<<<<<<<< * return Device.Type.__enum2str[dtype] * except KeyError: */ } __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; /* "petsc4py/PETSc/petscdevice.pxi":78 * try: * return Device.Type.__enum2str[dtype] * except KeyError: # <<<<<<<<<<<<<< * raise NotImplementedError("unhandled PetscDeviceType %d" % dtype) * */ __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_7) { __Pyx_AddTraceback("petsc4py.PETSc.toDeviceType", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_4, &__pyx_t_5) < 0) __PYX_ERR(5, 78, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_5); /* "petsc4py/PETSc/petscdevice.pxi":79 * return Device.Type.__enum2str[dtype] * except KeyError: * raise NotImplementedError("unhandled PetscDeviceType %d" % dtype) # <<<<<<<<<<<<<< * * cdef inline PetscStreamType asStreamType(object stype) except (-1): */ __pyx_t_8 = __Pyx_PyInt_From_int(((int)__pyx_v_dtype)); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 79, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_unhandled_PetscDeviceType_d, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 79, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_NotImplementedError, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 79, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __PYX_ERR(5, 79, __pyx_L5_except_error) } goto __pyx_L5_except_error; /* "petsc4py/PETSc/petscdevice.pxi":76 * * cdef inline str toDeviceType(PetscDeviceType dtype): * try: # <<<<<<<<<<<<<< * return Device.Type.__enum2str[dtype] * except KeyError: */ __pyx_L5_except_error:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; __pyx_L7_try_return:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L0; } /* "petsc4py/PETSc/petscdevice.pxi":75 * return dtype * * cdef inline str toDeviceType(PetscDeviceType dtype): # <<<<<<<<<<<<<< * try: * return Device.Type.__enum2str[dtype] */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("petsc4py.PETSc.toDeviceType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscdevice.pxi":81 * raise NotImplementedError("unhandled PetscDeviceType %d" % dtype) * * cdef inline PetscStreamType asStreamType(object stype) except (-1): # <<<<<<<<<<<<<< * if isinstance(stype, str): * stype = stype.upper() */ static CYTHON_INLINE PetscStreamType __pyx_f_8petsc4py_5PETSc_asStreamType(PyObject *__pyx_v_stype) { PetscStreamType __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PetscStreamType __pyx_t_9; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("asStreamType", 0); __Pyx_INCREF(__pyx_v_stype); /* "petsc4py/PETSc/petscdevice.pxi":82 * * cdef inline PetscStreamType asStreamType(object stype) except (-1): * if isinstance(stype, str): # <<<<<<<<<<<<<< * stype = stype.upper() * try: */ __pyx_t_1 = PyString_Check(__pyx_v_stype); if (__pyx_t_1) { /* "petsc4py/PETSc/petscdevice.pxi":83 * cdef inline PetscStreamType asStreamType(object stype) except (-1): * if isinstance(stype, str): * stype = stype.upper() # <<<<<<<<<<<<<< * try: * return getattr(DeviceContext.StreamType, stype) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_stype, __pyx_n_s_upper); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF_SET(__pyx_v_stype, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscdevice.pxi":84 * if isinstance(stype, str): * stype = stype.upper() * try: # <<<<<<<<<<<<<< * return getattr(DeviceContext.StreamType, stype) * except AttributeError: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); /*try:*/ { /* "petsc4py/PETSc/petscdevice.pxi":85 * stype = stype.upper() * try: * return getattr(DeviceContext.StreamType, stype) # <<<<<<<<<<<<<< * except AttributeError: * raise ValueError("unknown stream type: %s" % stype) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DeviceContext), __pyx_n_s_StreamType); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 85, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetAttr(__pyx_t_2, __pyx_v_stype); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 85, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_9 = ((PetscStreamType)__Pyx_PyInt_As_PetscStreamType(__pyx_t_3)); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 85, __pyx_L4_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_9; goto __pyx_L8_try_return; /* "petsc4py/PETSc/petscdevice.pxi":84 * if isinstance(stype, str): * stype = stype.upper() * try: # <<<<<<<<<<<<<< * return getattr(DeviceContext.StreamType, stype) * except AttributeError: */ } __pyx_L4_error:; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/petscdevice.pxi":86 * try: * return getattr(DeviceContext.StreamType, stype) * except AttributeError: # <<<<<<<<<<<<<< * raise ValueError("unknown stream type: %s" % stype) * return stype */ __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError); if (__pyx_t_5) { __Pyx_AddTraceback("petsc4py.PETSc.asStreamType", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_4) < 0) __PYX_ERR(5, 86, __pyx_L6_except_error) __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_4); /* "petsc4py/PETSc/petscdevice.pxi":87 * return getattr(DeviceContext.StreamType, stype) * except AttributeError: * raise ValueError("unknown stream type: %s" % stype) # <<<<<<<<<<<<<< * return stype * */ __pyx_t_10 = __Pyx_PyString_FormatSafe(__pyx_kp_s_unknown_stream_type_s, __pyx_v_stype); if (unlikely(!__pyx_t_10)) __PYX_ERR(5, 87, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(5, 87, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_Raise(__pyx_t_11, 0, 0, 0); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __PYX_ERR(5, 87, __pyx_L6_except_error) } goto __pyx_L6_except_error; /* "petsc4py/PETSc/petscdevice.pxi":84 * if isinstance(stype, str): * stype = stype.upper() * try: # <<<<<<<<<<<<<< * return getattr(DeviceContext.StreamType, stype) * except AttributeError: */ __pyx_L6_except_error:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); goto __pyx_L1_error; __pyx_L8_try_return:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); goto __pyx_L0; } /* "petsc4py/PETSc/petscdevice.pxi":82 * * cdef inline PetscStreamType asStreamType(object stype) except (-1): * if isinstance(stype, str): # <<<<<<<<<<<<<< * stype = stype.upper() * try: */ } /* "petsc4py/PETSc/petscdevice.pxi":88 * except AttributeError: * raise ValueError("unknown stream type: %s" % stype) * return stype # <<<<<<<<<<<<<< * * cdef inline str toStreamType(PetscStreamType stype): */ __pyx_t_9 = ((PetscStreamType)__Pyx_PyInt_As_PetscStreamType(__pyx_v_stype)); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 88, __pyx_L1_error) __pyx_r = __pyx_t_9; goto __pyx_L0; /* "petsc4py/PETSc/petscdevice.pxi":81 * raise NotImplementedError("unhandled PetscDeviceType %d" % dtype) * * cdef inline PetscStreamType asStreamType(object stype) except (-1): # <<<<<<<<<<<<<< * if isinstance(stype, str): * stype = stype.upper() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("petsc4py.PETSc.asStreamType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = ((PetscStreamType)-1L); __pyx_L0:; __Pyx_XDECREF(__pyx_v_stype); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscdevice.pxi":90 * return stype * * cdef inline str toStreamType(PetscStreamType stype): # <<<<<<<<<<<<<< * try: * return DeviceContext.StreamType.__enum2str[stype] */ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toStreamType(PetscStreamType __pyx_v_stype) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("toStreamType", 1); /* "petsc4py/PETSc/petscdevice.pxi":91 * * cdef inline str toStreamType(PetscStreamType stype): * try: # <<<<<<<<<<<<<< * return DeviceContext.StreamType.__enum2str[stype] * except KeyError: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { /* "petsc4py/PETSc/petscdevice.pxi":92 * cdef inline str toStreamType(PetscStreamType stype): * try: * return DeviceContext.StreamType.__enum2str[stype] # <<<<<<<<<<<<<< * except KeyError: * raise NotImplementedError("unhandled PetscStreamType %d" % stype) */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DeviceContext), __pyx_n_s_StreamType); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 92, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_enum2str); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 92, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_From_PetscStreamType(__pyx_v_stype); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 92, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 92, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!(likely(PyString_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_6))) __PYX_ERR(5, 92, __pyx_L3_error) __pyx_r = ((PyObject*)__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L7_try_return; /* "petsc4py/PETSc/petscdevice.pxi":91 * * cdef inline str toStreamType(PetscStreamType stype): * try: # <<<<<<<<<<<<<< * return DeviceContext.StreamType.__enum2str[stype] * except KeyError: */ } __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; /* "petsc4py/PETSc/petscdevice.pxi":93 * try: * return DeviceContext.StreamType.__enum2str[stype] * except KeyError: # <<<<<<<<<<<<<< * raise NotImplementedError("unhandled PetscStreamType %d" % stype) * */ __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_7) { __Pyx_AddTraceback("petsc4py.PETSc.toStreamType", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_4, &__pyx_t_5) < 0) __PYX_ERR(5, 93, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_5); /* "petsc4py/PETSc/petscdevice.pxi":94 * return DeviceContext.StreamType.__enum2str[stype] * except KeyError: * raise NotImplementedError("unhandled PetscStreamType %d" % stype) # <<<<<<<<<<<<<< * * cdef inline PetscDeviceContextJoinMode asJoinMode(object jmode) except (-1): */ __pyx_t_8 = __Pyx_PyInt_From_int(((int)__pyx_v_stype)); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 94, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_unhandled_PetscStreamType_d, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 94, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_NotImplementedError, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 94, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __PYX_ERR(5, 94, __pyx_L5_except_error) } goto __pyx_L5_except_error; /* "petsc4py/PETSc/petscdevice.pxi":91 * * cdef inline str toStreamType(PetscStreamType stype): * try: # <<<<<<<<<<<<<< * return DeviceContext.StreamType.__enum2str[stype] * except KeyError: */ __pyx_L5_except_error:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; __pyx_L7_try_return:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L0; } /* "petsc4py/PETSc/petscdevice.pxi":90 * return stype * * cdef inline str toStreamType(PetscStreamType stype): # <<<<<<<<<<<<<< * try: * return DeviceContext.StreamType.__enum2str[stype] */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("petsc4py.PETSc.toStreamType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscdevice.pxi":96 * raise NotImplementedError("unhandled PetscStreamType %d" % stype) * * cdef inline PetscDeviceContextJoinMode asJoinMode(object jmode) except (-1): # <<<<<<<<<<<<<< * if isinstance(jmode, str): * jmode = jmode.upper() */ static CYTHON_INLINE PetscDeviceContextJoinMode __pyx_f_8petsc4py_5PETSc_asJoinMode(PyObject *__pyx_v_jmode) { PetscDeviceContextJoinMode __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PetscDeviceContextJoinMode __pyx_t_9; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("asJoinMode", 0); __Pyx_INCREF(__pyx_v_jmode); /* "petsc4py/PETSc/petscdevice.pxi":97 * * cdef inline PetscDeviceContextJoinMode asJoinMode(object jmode) except (-1): * if isinstance(jmode, str): # <<<<<<<<<<<<<< * jmode = jmode.upper() * try: */ __pyx_t_1 = PyString_Check(__pyx_v_jmode); if (__pyx_t_1) { /* "petsc4py/PETSc/petscdevice.pxi":98 * cdef inline PetscDeviceContextJoinMode asJoinMode(object jmode) except (-1): * if isinstance(jmode, str): * jmode = jmode.upper() # <<<<<<<<<<<<<< * try: * return getattr(DeviceContext.JoinMode, jmode) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_jmode, __pyx_n_s_upper); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF_SET(__pyx_v_jmode, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscdevice.pxi":99 * if isinstance(jmode, str): * jmode = jmode.upper() * try: # <<<<<<<<<<<<<< * return getattr(DeviceContext.JoinMode, jmode) * except AttributeError: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); /*try:*/ { /* "petsc4py/PETSc/petscdevice.pxi":100 * jmode = jmode.upper() * try: * return getattr(DeviceContext.JoinMode, jmode) # <<<<<<<<<<<<<< * except AttributeError: * raise ValueError("unknown join mode: %s" % jmode) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DeviceContext), __pyx_n_s_JoinMode); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 100, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetAttr(__pyx_t_2, __pyx_v_jmode); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 100, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_9 = ((PetscDeviceContextJoinMode)__Pyx_PyInt_As_PetscDeviceContextJoinMode(__pyx_t_3)); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 100, __pyx_L4_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_9; goto __pyx_L8_try_return; /* "petsc4py/PETSc/petscdevice.pxi":99 * if isinstance(jmode, str): * jmode = jmode.upper() * try: # <<<<<<<<<<<<<< * return getattr(DeviceContext.JoinMode, jmode) * except AttributeError: */ } __pyx_L4_error:; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/petscdevice.pxi":101 * try: * return getattr(DeviceContext.JoinMode, jmode) * except AttributeError: # <<<<<<<<<<<<<< * raise ValueError("unknown join mode: %s" % jmode) * return jmode */ __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError); if (__pyx_t_5) { __Pyx_AddTraceback("petsc4py.PETSc.asJoinMode", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_4) < 0) __PYX_ERR(5, 101, __pyx_L6_except_error) __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_4); /* "petsc4py/PETSc/petscdevice.pxi":102 * return getattr(DeviceContext.JoinMode, jmode) * except AttributeError: * raise ValueError("unknown join mode: %s" % jmode) # <<<<<<<<<<<<<< * return jmode * */ __pyx_t_10 = __Pyx_PyString_FormatSafe(__pyx_kp_s_unknown_join_mode_s, __pyx_v_jmode); if (unlikely(!__pyx_t_10)) __PYX_ERR(5, 102, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(5, 102, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_Raise(__pyx_t_11, 0, 0, 0); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __PYX_ERR(5, 102, __pyx_L6_except_error) } goto __pyx_L6_except_error; /* "petsc4py/PETSc/petscdevice.pxi":99 * if isinstance(jmode, str): * jmode = jmode.upper() * try: # <<<<<<<<<<<<<< * return getattr(DeviceContext.JoinMode, jmode) * except AttributeError: */ __pyx_L6_except_error:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); goto __pyx_L1_error; __pyx_L8_try_return:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); goto __pyx_L0; } /* "petsc4py/PETSc/petscdevice.pxi":97 * * cdef inline PetscDeviceContextJoinMode asJoinMode(object jmode) except (-1): * if isinstance(jmode, str): # <<<<<<<<<<<<<< * jmode = jmode.upper() * try: */ } /* "petsc4py/PETSc/petscdevice.pxi":103 * except AttributeError: * raise ValueError("unknown join mode: %s" % jmode) * return jmode # <<<<<<<<<<<<<< * * cdef inline str toJoinMode(PetscDeviceContextJoinMode jmode): */ __pyx_t_9 = ((PetscDeviceContextJoinMode)__Pyx_PyInt_As_PetscDeviceContextJoinMode(__pyx_v_jmode)); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 103, __pyx_L1_error) __pyx_r = __pyx_t_9; goto __pyx_L0; /* "petsc4py/PETSc/petscdevice.pxi":96 * raise NotImplementedError("unhandled PetscStreamType %d" % stype) * * cdef inline PetscDeviceContextJoinMode asJoinMode(object jmode) except (-1): # <<<<<<<<<<<<<< * if isinstance(jmode, str): * jmode = jmode.upper() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("petsc4py.PETSc.asJoinMode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = ((PetscDeviceContextJoinMode)-1L); __pyx_L0:; __Pyx_XDECREF(__pyx_v_jmode); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscdevice.pxi":105 * return jmode * * cdef inline str toJoinMode(PetscDeviceContextJoinMode jmode): # <<<<<<<<<<<<<< * try: * return DeviceContext.JoinMode.__enum2str[jmode] */ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toJoinMode(PetscDeviceContextJoinMode __pyx_v_jmode) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("toJoinMode", 1); /* "petsc4py/PETSc/petscdevice.pxi":106 * * cdef inline str toJoinMode(PetscDeviceContextJoinMode jmode): * try: # <<<<<<<<<<<<<< * return DeviceContext.JoinMode.__enum2str[jmode] * except KeyError: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { /* "petsc4py/PETSc/petscdevice.pxi":107 * cdef inline str toJoinMode(PetscDeviceContextJoinMode jmode): * try: * return DeviceContext.JoinMode.__enum2str[jmode] # <<<<<<<<<<<<<< * except KeyError: * raise NotImplementedError("unhandled PetscDeviceContextJoinMode %d" % jmode) */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DeviceContext), __pyx_n_s_JoinMode); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 107, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_enum2str); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 107, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_From_PetscDeviceContextJoinMode(__pyx_v_jmode); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 107, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 107, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!(likely(PyString_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_6))) __PYX_ERR(5, 107, __pyx_L3_error) __pyx_r = ((PyObject*)__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L7_try_return; /* "petsc4py/PETSc/petscdevice.pxi":106 * * cdef inline str toJoinMode(PetscDeviceContextJoinMode jmode): * try: # <<<<<<<<<<<<<< * return DeviceContext.JoinMode.__enum2str[jmode] * except KeyError: */ } __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; /* "petsc4py/PETSc/petscdevice.pxi":108 * try: * return DeviceContext.JoinMode.__enum2str[jmode] * except KeyError: # <<<<<<<<<<<<<< * raise NotImplementedError("unhandled PetscDeviceContextJoinMode %d" % jmode) */ __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_7) { __Pyx_AddTraceback("petsc4py.PETSc.toJoinMode", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_4, &__pyx_t_5) < 0) __PYX_ERR(5, 108, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_5); /* "petsc4py/PETSc/petscdevice.pxi":109 * return DeviceContext.JoinMode.__enum2str[jmode] * except KeyError: * raise NotImplementedError("unhandled PetscDeviceContextJoinMode %d" % jmode) # <<<<<<<<<<<<<< */ __pyx_t_8 = __Pyx_PyInt_From_int(((int)__pyx_v_jmode)); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 109, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_unhandled_PetscDeviceContextJoin, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 109, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_NotImplementedError, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 109, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __PYX_ERR(5, 109, __pyx_L5_except_error) } goto __pyx_L5_except_error; /* "petsc4py/PETSc/petscdevice.pxi":106 * * cdef inline str toJoinMode(PetscDeviceContextJoinMode jmode): * try: # <<<<<<<<<<<<<< * return DeviceContext.JoinMode.__enum2str[jmode] * except KeyError: */ __pyx_L5_except_error:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; __pyx_L7_try_return:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L0; } /* "petsc4py/PETSc/petscdevice.pxi":105 * return jmode * * cdef inline str toJoinMode(PetscDeviceContextJoinMode jmode): # <<<<<<<<<<<<<< * try: * return DeviceContext.JoinMode.__enum2str[jmode] */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("petsc4py.PETSc.toJoinMode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscis.pxi":97 * # -------------------------------------------------------------------- * * cdef inline IS ref_IS(PetscIS iset): # <<<<<<<<<<<<<< * cdef IS ob = IS() * ob.iset = iset */ static CYTHON_INLINE struct PyPetscISObject *__pyx_f_8petsc4py_5PETSc_ref_IS(IS __pyx_v_iset) { struct PyPetscISObject *__pyx_v_ob = 0; struct PyPetscISObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("ref_IS", 1); /* "petsc4py/PETSc/petscis.pxi":98 * * cdef inline IS ref_IS(PetscIS iset): * cdef IS ob = IS() # <<<<<<<<<<<<<< * ob.iset = iset * CHKERR( PetscINCREF(ob.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_ob = ((struct PyPetscISObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscis.pxi":99 * cdef inline IS ref_IS(PetscIS iset): * cdef IS ob = IS() * ob.iset = iset # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(ob.obj) ) * return ob */ __pyx_v_ob->iset = __pyx_v_iset; /* "petsc4py/PETSc/petscis.pxi":100 * cdef IS ob = IS() * ob.iset = iset * CHKERR( PetscINCREF(ob.obj) ) # <<<<<<<<<<<<<< * return ob * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ob->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(6, 100, __pyx_L1_error) /* "petsc4py/PETSc/petscis.pxi":101 * ob.iset = iset * CHKERR( PetscINCREF(ob.obj) ) * return ob # <<<<<<<<<<<<<< * * cdef inline LGMap ref_LGMap(PetscLGMap lgm): */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_ob); __pyx_r = __pyx_v_ob; goto __pyx_L0; /* "petsc4py/PETSc/petscis.pxi":97 * # -------------------------------------------------------------------- * * cdef inline IS ref_IS(PetscIS iset): # <<<<<<<<<<<<<< * cdef IS ob = IS() * ob.iset = iset */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.ref_IS", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscis.pxi":103 * return ob * * cdef inline LGMap ref_LGMap(PetscLGMap lgm): # <<<<<<<<<<<<<< * cdef LGMap ob = LGMap() * ob.lgm = lgm */ static CYTHON_INLINE struct PyPetscLGMapObject *__pyx_f_8petsc4py_5PETSc_ref_LGMap(ISLocalToGlobalMapping __pyx_v_lgm) { struct PyPetscLGMapObject *__pyx_v_ob = 0; struct PyPetscLGMapObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("ref_LGMap", 1); /* "petsc4py/PETSc/petscis.pxi":104 * * cdef inline LGMap ref_LGMap(PetscLGMap lgm): * cdef LGMap ob = LGMap() # <<<<<<<<<<<<<< * ob.lgm = lgm * CHKERR( PetscINCREF(ob.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_LGMap)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_ob = ((struct PyPetscLGMapObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscis.pxi":105 * cdef inline LGMap ref_LGMap(PetscLGMap lgm): * cdef LGMap ob = LGMap() * ob.lgm = lgm # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(ob.obj) ) * return ob */ __pyx_v_ob->lgm = __pyx_v_lgm; /* "petsc4py/PETSc/petscis.pxi":106 * cdef LGMap ob = LGMap() * ob.lgm = lgm * CHKERR( PetscINCREF(ob.obj) ) # <<<<<<<<<<<<<< * return ob * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ob->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(6, 106, __pyx_L1_error) /* "petsc4py/PETSc/petscis.pxi":107 * ob.lgm = lgm * CHKERR( PetscINCREF(ob.obj) ) * return ob # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_ob); __pyx_r = __pyx_v_ob; goto __pyx_L0; /* "petsc4py/PETSc/petscis.pxi":103 * return ob * * cdef inline LGMap ref_LGMap(PetscLGMap lgm): # <<<<<<<<<<<<<< * cdef LGMap ob = LGMap() * ob.lgm = lgm */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.ref_LGMap", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscis.pxi":118 * cdef bint hasarray * * def __cinit__(self, IS iset): # <<<<<<<<<<<<<< * cdef PetscIS i = iset.iset * CHKERR( PetscINCREF(&i) ) */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_10_IS_buffer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_10_IS_buffer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscISObject *__pyx_v_iset = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_iset,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_iset)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 118, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__cinit__") < 0)) __PYX_ERR(6, 118, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); } __pyx_v_iset = ((struct PyPetscISObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, __pyx_nargs); __PYX_ERR(6, 118, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc._IS_buffer.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iset), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "iset", 0))) __PYX_ERR(6, 118, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_10_IS_buffer___cinit__(((struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *)__pyx_v_self), __pyx_v_iset); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = -1; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_10_IS_buffer___cinit__(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset) { IS __pyx_v_i; int __pyx_r; IS __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "petsc4py/PETSc/petscis.pxi":119 * * def __cinit__(self, IS iset): * cdef PetscIS i = iset.iset # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(&i) ) * self.iset = i */ __pyx_t_1 = __pyx_v_iset->iset; __pyx_v_i = __pyx_t_1; /* "petsc4py/PETSc/petscis.pxi":120 * def __cinit__(self, IS iset): * cdef PetscIS i = iset.iset * CHKERR( PetscINCREF(&i) ) # <<<<<<<<<<<<<< * self.iset = i * self.size = 0 */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(((PetscObject *)(&__pyx_v_i)))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(6, 120, __pyx_L1_error) /* "petsc4py/PETSc/petscis.pxi":121 * cdef PetscIS i = iset.iset * CHKERR( PetscINCREF(&i) ) * self.iset = i # <<<<<<<<<<<<<< * self.size = 0 * self.data = NULL */ __pyx_v_self->iset = __pyx_v_i; /* "petsc4py/PETSc/petscis.pxi":122 * CHKERR( PetscINCREF(&i) ) * self.iset = i * self.size = 0 # <<<<<<<<<<<<<< * self.data = NULL * self.hasarray = 0 */ __pyx_v_self->size = 0; /* "petsc4py/PETSc/petscis.pxi":123 * self.iset = i * self.size = 0 * self.data = NULL # <<<<<<<<<<<<<< * self.hasarray = 0 * */ __pyx_v_self->data = NULL; /* "petsc4py/PETSc/petscis.pxi":124 * self.size = 0 * self.data = NULL * self.hasarray = 0 # <<<<<<<<<<<<<< * * def __dealloc__(self): */ __pyx_v_self->hasarray = 0; /* "petsc4py/PETSc/petscis.pxi":118 * cdef bint hasarray * * def __cinit__(self, IS iset): # <<<<<<<<<<<<<< * cdef PetscIS i = iset.iset * CHKERR( PetscINCREF(&i) ) */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc._IS_buffer.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/petscis.pxi":126 * self.hasarray = 0 * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self.hasarray and self.iset != NULL: * CHKERR( ISRestoreIndices(self.iset, &self.data) ) */ /* Python wrapper */ static void __pyx_pw_8petsc4py_5PETSc_10_IS_buffer_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_8petsc4py_5PETSc_10_IS_buffer_3__dealloc__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_pf_8petsc4py_5PETSc_10_IS_buffer_2__dealloc__(((struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_8petsc4py_5PETSc_10_IS_buffer_2__dealloc__(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self) { int __pyx_t_1; int __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "petsc4py/PETSc/petscis.pxi":127 * * def __dealloc__(self): * if self.hasarray and self.iset != NULL: # <<<<<<<<<<<<<< * CHKERR( ISRestoreIndices(self.iset, &self.data) ) * CHKERR( ISDestroy(&self.iset) ) */ if (__pyx_v_self->hasarray) { } else { __pyx_t_1 = __pyx_v_self->hasarray; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = (__pyx_v_self->iset != NULL); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "petsc4py/PETSc/petscis.pxi":128 * def __dealloc__(self): * if self.hasarray and self.iset != NULL: * CHKERR( ISRestoreIndices(self.iset, &self.data) ) # <<<<<<<<<<<<<< * CHKERR( ISDestroy(&self.iset) ) * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISRestoreIndices(__pyx_v_self->iset, (&__pyx_v_self->data))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(6, 128, __pyx_L1_error) /* "petsc4py/PETSc/petscis.pxi":127 * * def __dealloc__(self): * if self.hasarray and self.iset != NULL: # <<<<<<<<<<<<<< * CHKERR( ISRestoreIndices(self.iset, &self.data) ) * CHKERR( ISDestroy(&self.iset) ) */ } /* "petsc4py/PETSc/petscis.pxi":129 * if self.hasarray and self.iset != NULL: * CHKERR( ISRestoreIndices(self.iset, &self.data) ) * CHKERR( ISDestroy(&self.iset) ) # <<<<<<<<<<<<<< * * # */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISDestroy((&__pyx_v_self->iset))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(6, 129, __pyx_L1_error) /* "petsc4py/PETSc/petscis.pxi":126 * self.hasarray = 0 * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self.hasarray and self.iset != NULL: * CHKERR( ISRestoreIndices(self.iset, &self.data) ) */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_WriteUnraisable("petsc4py.PETSc._IS_buffer.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_L0:; } /* "petsc4py/PETSc/petscis.pxi":133 * # * * cdef int acquire(self) except -1: # <<<<<<<<<<<<<< * if not self.hasarray and self.iset != NULL: * CHKERR( ISGetLocalSize(self.iset, &self.size) ) */ static int __pyx_f_8petsc4py_5PETSc_10_IS_buffer_acquire(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self) { int __pyx_r; int __pyx_t_1; int __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "petsc4py/PETSc/petscis.pxi":134 * * cdef int acquire(self) except -1: * if not self.hasarray and self.iset != NULL: # <<<<<<<<<<<<<< * CHKERR( ISGetLocalSize(self.iset, &self.size) ) * CHKERR( ISGetIndices(self.iset, &self.data) ) */ __pyx_t_2 = (!__pyx_v_self->hasarray); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = (__pyx_v_self->iset != NULL); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "petsc4py/PETSc/petscis.pxi":135 * cdef int acquire(self) except -1: * if not self.hasarray and self.iset != NULL: * CHKERR( ISGetLocalSize(self.iset, &self.size) ) # <<<<<<<<<<<<<< * CHKERR( ISGetIndices(self.iset, &self.data) ) * self.hasarray = 1 */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISGetLocalSize(__pyx_v_self->iset, (&__pyx_v_self->size))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(6, 135, __pyx_L1_error) /* "petsc4py/PETSc/petscis.pxi":136 * if not self.hasarray and self.iset != NULL: * CHKERR( ISGetLocalSize(self.iset, &self.size) ) * CHKERR( ISGetIndices(self.iset, &self.data) ) # <<<<<<<<<<<<<< * self.hasarray = 1 * return 0 */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISGetIndices(__pyx_v_self->iset, (&__pyx_v_self->data))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(6, 136, __pyx_L1_error) /* "petsc4py/PETSc/petscis.pxi":137 * CHKERR( ISGetLocalSize(self.iset, &self.size) ) * CHKERR( ISGetIndices(self.iset, &self.data) ) * self.hasarray = 1 # <<<<<<<<<<<<<< * return 0 * */ __pyx_v_self->hasarray = 1; /* "petsc4py/PETSc/petscis.pxi":134 * * cdef int acquire(self) except -1: * if not self.hasarray and self.iset != NULL: # <<<<<<<<<<<<<< * CHKERR( ISGetLocalSize(self.iset, &self.size) ) * CHKERR( ISGetIndices(self.iset, &self.data) ) */ } /* "petsc4py/PETSc/petscis.pxi":138 * CHKERR( ISGetIndices(self.iset, &self.data) ) * self.hasarray = 1 * return 0 # <<<<<<<<<<<<<< * * cdef int release(self) except -1: */ __pyx_r = 0; goto __pyx_L0; /* "petsc4py/PETSc/petscis.pxi":133 * # * * cdef int acquire(self) except -1: # <<<<<<<<<<<<<< * if not self.hasarray and self.iset != NULL: * CHKERR( ISGetLocalSize(self.iset, &self.size) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc._IS_buffer.acquire", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/petscis.pxi":140 * return 0 * * cdef int release(self) except -1: # <<<<<<<<<<<<<< * if self.hasarray and self.iset != NULL: * self.size = 0 */ static int __pyx_f_8petsc4py_5PETSc_10_IS_buffer_release(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self) { int __pyx_r; int __pyx_t_1; int __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "petsc4py/PETSc/petscis.pxi":141 * * cdef int release(self) except -1: * if self.hasarray and self.iset != NULL: # <<<<<<<<<<<<<< * self.size = 0 * CHKERR( ISRestoreIndices(self.iset, &self.data) ) */ if (__pyx_v_self->hasarray) { } else { __pyx_t_1 = __pyx_v_self->hasarray; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = (__pyx_v_self->iset != NULL); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "petsc4py/PETSc/petscis.pxi":142 * cdef int release(self) except -1: * if self.hasarray and self.iset != NULL: * self.size = 0 # <<<<<<<<<<<<<< * CHKERR( ISRestoreIndices(self.iset, &self.data) ) * self.hasarray = 0 */ __pyx_v_self->size = 0; /* "petsc4py/PETSc/petscis.pxi":143 * if self.hasarray and self.iset != NULL: * self.size = 0 * CHKERR( ISRestoreIndices(self.iset, &self.data) ) # <<<<<<<<<<<<<< * self.hasarray = 0 * self.data = NULL */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISRestoreIndices(__pyx_v_self->iset, (&__pyx_v_self->data))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(6, 143, __pyx_L1_error) /* "petsc4py/PETSc/petscis.pxi":144 * self.size = 0 * CHKERR( ISRestoreIndices(self.iset, &self.data) ) * self.hasarray = 0 # <<<<<<<<<<<<<< * self.data = NULL * return 0 */ __pyx_v_self->hasarray = 0; /* "petsc4py/PETSc/petscis.pxi":145 * CHKERR( ISRestoreIndices(self.iset, &self.data) ) * self.hasarray = 0 * self.data = NULL # <<<<<<<<<<<<<< * return 0 * */ __pyx_v_self->data = NULL; /* "petsc4py/PETSc/petscis.pxi":141 * * cdef int release(self) except -1: * if self.hasarray and self.iset != NULL: # <<<<<<<<<<<<<< * self.size = 0 * CHKERR( ISRestoreIndices(self.iset, &self.data) ) */ } /* "petsc4py/PETSc/petscis.pxi":146 * self.hasarray = 0 * self.data = NULL * return 0 # <<<<<<<<<<<<<< * * # buffer interface (PEP 3118) */ __pyx_r = 0; goto __pyx_L0; /* "petsc4py/PETSc/petscis.pxi":140 * return 0 * * cdef int release(self) except -1: # <<<<<<<<<<<<<< * if self.hasarray and self.iset != NULL: * self.size = 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc._IS_buffer.release", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/petscis.pxi":150 * # buffer interface (PEP 3118) * * cdef int acquirebuffer(self, Py_buffer *view, int flags) except -1: # <<<<<<<<<<<<<< * self.acquire() * PyPetscBuffer_FillInfo(view, self.data, self.size, */ static int __pyx_f_8petsc4py_5PETSc_10_IS_buffer_acquirebuffer(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self, Py_buffer *__pyx_v_view, int __pyx_v_flags) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("acquirebuffer", 1); /* "petsc4py/PETSc/petscis.pxi":151 * * cdef int acquirebuffer(self, Py_buffer *view, int flags) except -1: * self.acquire() # <<<<<<<<<<<<<< * PyPetscBuffer_FillInfo(view, self.data, self.size, * c'i', 1, flags) */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__IS_buffer *)__pyx_v_self->__pyx_vtab)->acquire(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 151, __pyx_L1_error) /* "petsc4py/PETSc/petscis.pxi":152 * cdef int acquirebuffer(self, Py_buffer *view, int flags) except -1: * self.acquire() * PyPetscBuffer_FillInfo(view, self.data, self.size, # <<<<<<<<<<<<<< * c'i', 1, flags) * view.obj = self */ __pyx_t_1 = PyPetscBuffer_FillInfo(__pyx_v_view, ((void *)__pyx_v_self->data), __pyx_v_self->size, 'i', 1, __pyx_v_flags); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 152, __pyx_L1_error) /* "petsc4py/PETSc/petscis.pxi":154 * PyPetscBuffer_FillInfo(view, self.data, self.size, * c'i', 1, flags) * view.obj = self # <<<<<<<<<<<<<< * return 0 * */ __Pyx_INCREF((PyObject *)__pyx_v_self); __Pyx_GIVEREF((PyObject *)__pyx_v_self); __Pyx_GOTREF(__pyx_v_view->obj); __Pyx_DECREF(__pyx_v_view->obj); __pyx_v_view->obj = ((PyObject *)__pyx_v_self); /* "petsc4py/PETSc/petscis.pxi":155 * c'i', 1, flags) * view.obj = self * return 0 # <<<<<<<<<<<<<< * * cdef int releasebuffer(self, Py_buffer *view) except -1: */ __pyx_r = 0; goto __pyx_L0; /* "petsc4py/PETSc/petscis.pxi":150 * # buffer interface (PEP 3118) * * cdef int acquirebuffer(self, Py_buffer *view, int flags) except -1: # <<<<<<<<<<<<<< * self.acquire() * PyPetscBuffer_FillInfo(view, self.data, self.size, */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc._IS_buffer.acquirebuffer", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscis.pxi":157 * return 0 * * cdef int releasebuffer(self, Py_buffer *view) except -1: # <<<<<<<<<<<<<< * PyPetscBuffer_Release(view) * self.release() */ static int __pyx_f_8petsc4py_5PETSc_10_IS_buffer_releasebuffer(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self, Py_buffer *__pyx_v_view) { int __pyx_r; int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "petsc4py/PETSc/petscis.pxi":158 * * cdef int releasebuffer(self, Py_buffer *view) except -1: * PyPetscBuffer_Release(view) # <<<<<<<<<<<<<< * self.release() * return 0 */ PyPetscBuffer_Release(__pyx_v_view); /* "petsc4py/PETSc/petscis.pxi":159 * cdef int releasebuffer(self, Py_buffer *view) except -1: * PyPetscBuffer_Release(view) * self.release() # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__IS_buffer *)__pyx_v_self->__pyx_vtab)->release(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 159, __pyx_L1_error) /* "petsc4py/PETSc/petscis.pxi":160 * PyPetscBuffer_Release(view) * self.release() * return 0 # <<<<<<<<<<<<<< * * def __getbuffer__(self, Py_buffer *view, int flags): */ __pyx_r = 0; goto __pyx_L0; /* "petsc4py/PETSc/petscis.pxi":157 * return 0 * * cdef int releasebuffer(self, Py_buffer *view) except -1: # <<<<<<<<<<<<<< * PyPetscBuffer_Release(view) * self.release() */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc._IS_buffer.releasebuffer", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/petscis.pxi":162 * return 0 * * def __getbuffer__(self, Py_buffer *view, int flags): # <<<<<<<<<<<<<< * self.acquirebuffer(view, flags) * */ /* Python wrapper */ CYTHON_UNUSED static int __pyx_pw_8petsc4py_5PETSc_10_IS_buffer_5__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_view, int __pyx_v_flags); /*proto*/ CYTHON_UNUSED static int __pyx_pw_8petsc4py_5PETSc_10_IS_buffer_5__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_view, int __pyx_v_flags) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_10_IS_buffer_4__getbuffer__(((struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *)__pyx_v_self), ((Py_buffer *)__pyx_v_view), ((int)__pyx_v_flags)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_10_IS_buffer_4__getbuffer__(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self, Py_buffer *__pyx_v_view, int __pyx_v_flags) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; if (unlikely(__pyx_v_view == NULL)) { PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete"); return -1; } __Pyx_RefNannySetupContext("__getbuffer__", 0); __pyx_v_view->obj = Py_None; __Pyx_INCREF(Py_None); __Pyx_GIVEREF(__pyx_v_view->obj); /* "petsc4py/PETSc/petscis.pxi":163 * * def __getbuffer__(self, Py_buffer *view, int flags): * self.acquirebuffer(view, flags) # <<<<<<<<<<<<<< * * def __releasebuffer__(self, Py_buffer *view): */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__IS_buffer *)__pyx_v_self->__pyx_vtab)->acquirebuffer(__pyx_v_self, __pyx_v_view, __pyx_v_flags); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 163, __pyx_L1_error) /* "petsc4py/PETSc/petscis.pxi":162 * return 0 * * def __getbuffer__(self, Py_buffer *view, int flags): # <<<<<<<<<<<<<< * self.acquirebuffer(view, flags) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc._IS_buffer.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; if (__pyx_v_view->obj != NULL) { __Pyx_GOTREF(__pyx_v_view->obj); __Pyx_DECREF(__pyx_v_view->obj); __pyx_v_view->obj = 0; } goto __pyx_L2; __pyx_L0:; if (__pyx_v_view->obj == Py_None) { __Pyx_GOTREF(__pyx_v_view->obj); __Pyx_DECREF(__pyx_v_view->obj); __pyx_v_view->obj = 0; } __pyx_L2:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscis.pxi":165 * self.acquirebuffer(view, flags) * * def __releasebuffer__(self, Py_buffer *view): # <<<<<<<<<<<<<< * self.releasebuffer(view) * */ /* Python wrapper */ CYTHON_UNUSED static void __pyx_pw_8petsc4py_5PETSc_10_IS_buffer_7__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_view); /*proto*/ CYTHON_UNUSED static void __pyx_pw_8petsc4py_5PETSc_10_IS_buffer_7__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_view) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_pf_8petsc4py_5PETSc_10_IS_buffer_6__releasebuffer__(((struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *)__pyx_v_self), ((Py_buffer *)__pyx_v_view)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_8petsc4py_5PETSc_10_IS_buffer_6__releasebuffer__(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self, Py_buffer *__pyx_v_view) { int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "petsc4py/PETSc/petscis.pxi":166 * * def __releasebuffer__(self, Py_buffer *view): * self.releasebuffer(view) # <<<<<<<<<<<<<< * * # 'with' statement (PEP 343) */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__IS_buffer *)__pyx_v_self->__pyx_vtab)->releasebuffer(__pyx_v_self, __pyx_v_view); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 166, __pyx_L1_error) /* "petsc4py/PETSc/petscis.pxi":165 * self.acquirebuffer(view, flags) * * def __releasebuffer__(self, Py_buffer *view): # <<<<<<<<<<<<<< * self.releasebuffer(view) * */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_WriteUnraisable("petsc4py.PETSc._IS_buffer.__releasebuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_L0:; } /* "petsc4py/PETSc/petscis.pxi":170 * # 'with' statement (PEP 343) * * cdef object enter(self): # <<<<<<<<<<<<<< * self.acquire() * return asarray(self) */ static PyObject *__pyx_f_8petsc4py_5PETSc_10_IS_buffer_enter(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("enter", 1); /* "petsc4py/PETSc/petscis.pxi":171 * * cdef object enter(self): * self.acquire() # <<<<<<<<<<<<<< * return asarray(self) * */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__IS_buffer *)__pyx_v_self->__pyx_vtab)->acquire(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 171, __pyx_L1_error) /* "petsc4py/PETSc/petscis.pxi":172 * cdef object enter(self): * self.acquire() * return asarray(self) # <<<<<<<<<<<<<< * * cdef object exit(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_asarray(((PyObject *)__pyx_v_self))); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/petscis.pxi":170 * # 'with' statement (PEP 343) * * cdef object enter(self): # <<<<<<<<<<<<<< * self.acquire() * return asarray(self) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc._IS_buffer.enter", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscis.pxi":174 * return asarray(self) * * cdef object exit(self): # <<<<<<<<<<<<<< * self.release() * return None */ static PyObject *__pyx_f_8petsc4py_5PETSc_10_IS_buffer_exit(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("exit", 1); /* "petsc4py/PETSc/petscis.pxi":175 * * cdef object exit(self): * self.release() # <<<<<<<<<<<<<< * return None * */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__IS_buffer *)__pyx_v_self->__pyx_vtab)->release(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 175, __pyx_L1_error) /* "petsc4py/PETSc/petscis.pxi":176 * cdef object exit(self): * self.release() * return None # <<<<<<<<<<<<<< * * def __enter__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "petsc4py/PETSc/petscis.pxi":174 * return asarray(self) * * cdef object exit(self): # <<<<<<<<<<<<<< * self.release() * return None */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc._IS_buffer.exit", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscis.pxi":178 * return None * * def __enter__(self): # <<<<<<<<<<<<<< * return self.enter() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_10_IS_buffer_9__enter__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_10_IS_buffer_8__enter__, "_IS_buffer.__enter__(self)\nSource code at petsc4py/PETSc/petscis.pxi:178"); static PyObject *__pyx_pw_8petsc4py_5PETSc_10_IS_buffer_9__enter__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__enter__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__enter__", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_10_IS_buffer_8__enter__(((struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_10_IS_buffer_8__enter__(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__enter__", 1); /* "petsc4py/PETSc/petscis.pxi":179 * * def __enter__(self): * return self.enter() # <<<<<<<<<<<<<< * * def __exit__(self, *exc): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__IS_buffer *)__pyx_v_self->__pyx_vtab)->enter(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/petscis.pxi":178 * return None * * def __enter__(self): # <<<<<<<<<<<<<< * return self.enter() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc._IS_buffer.__enter__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscis.pxi":181 * return self.enter() * * def __exit__(self, *exc): # <<<<<<<<<<<<<< * return self.exit() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_10_IS_buffer_11__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_10_IS_buffer_10__exit__, "_IS_buffer.__exit__(self, *exc)\nSource code at petsc4py/PETSc/petscis.pxi:181"); static PyObject *__pyx_pw_8petsc4py_5PETSc_10_IS_buffer_11__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED PyObject *__pyx_v_exc = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__exit__", 0))) return NULL; __Pyx_INCREF(__pyx_args); __pyx_v_exc = __pyx_args; __pyx_r = __pyx_pf_8petsc4py_5PETSc_10_IS_buffer_10__exit__(((struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *)__pyx_v_self), __pyx_v_exc); /* function exit code */ __Pyx_DECREF(__pyx_v_exc); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_10_IS_buffer_10__exit__(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__exit__", 1); /* "petsc4py/PETSc/petscis.pxi":182 * * def __exit__(self, *exc): * return self.exit() # <<<<<<<<<<<<<< * * # buffer interface (legacy) */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__IS_buffer *)__pyx_v_self->__pyx_vtab)->exit(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/petscis.pxi":181 * return self.enter() * * def __exit__(self, *exc): # <<<<<<<<<<<<<< * return self.exit() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc._IS_buffer.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscis.pxi":186 * # buffer interface (legacy) * * cdef Py_ssize_t getbuffer(self, void **p) except -1: # <<<<<<<<<<<<<< * cdef PetscInt n = 0 * if p != NULL: */ static Py_ssize_t __pyx_f_8petsc4py_5PETSc_10_IS_buffer_getbuffer(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self, void **__pyx_v_p) { PetscInt __pyx_v_n; Py_ssize_t __pyx_r; int __pyx_t_1; int __pyx_t_2; PetscInt __pyx_t_3; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "petsc4py/PETSc/petscis.pxi":187 * * cdef Py_ssize_t getbuffer(self, void **p) except -1: * cdef PetscInt n = 0 # <<<<<<<<<<<<<< * if p != NULL: * self.acquire() */ __pyx_v_n = 0; /* "petsc4py/PETSc/petscis.pxi":188 * cdef Py_ssize_t getbuffer(self, void **p) except -1: * cdef PetscInt n = 0 * if p != NULL: # <<<<<<<<<<<<<< * self.acquire() * p[0] = self.data */ __pyx_t_1 = (__pyx_v_p != NULL); if (__pyx_t_1) { /* "petsc4py/PETSc/petscis.pxi":189 * cdef PetscInt n = 0 * if p != NULL: * self.acquire() # <<<<<<<<<<<<<< * p[0] = self.data * n = self.size */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__IS_buffer *)__pyx_v_self->__pyx_vtab)->acquire(__pyx_v_self); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(6, 189, __pyx_L1_error) /* "petsc4py/PETSc/petscis.pxi":190 * if p != NULL: * self.acquire() * p[0] = self.data # <<<<<<<<<<<<<< * n = self.size * elif self.iset != NULL: */ (__pyx_v_p[0]) = ((void *)__pyx_v_self->data); /* "petsc4py/PETSc/petscis.pxi":191 * self.acquire() * p[0] = self.data * n = self.size # <<<<<<<<<<<<<< * elif self.iset != NULL: * CHKERR( ISGetLocalSize(self.iset, &n) ) */ __pyx_t_3 = __pyx_v_self->size; __pyx_v_n = __pyx_t_3; /* "petsc4py/PETSc/petscis.pxi":188 * cdef Py_ssize_t getbuffer(self, void **p) except -1: * cdef PetscInt n = 0 * if p != NULL: # <<<<<<<<<<<<<< * self.acquire() * p[0] = self.data */ goto __pyx_L3; } /* "petsc4py/PETSc/petscis.pxi":192 * p[0] = self.data * n = self.size * elif self.iset != NULL: # <<<<<<<<<<<<<< * CHKERR( ISGetLocalSize(self.iset, &n) ) * return (n*sizeof(PetscInt)) */ __pyx_t_1 = (__pyx_v_self->iset != NULL); if (__pyx_t_1) { /* "petsc4py/PETSc/petscis.pxi":193 * n = self.size * elif self.iset != NULL: * CHKERR( ISGetLocalSize(self.iset, &n) ) # <<<<<<<<<<<<<< * return (n*sizeof(PetscInt)) * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISGetLocalSize(__pyx_v_self->iset, (&__pyx_v_n))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(6, 193, __pyx_L1_error) /* "petsc4py/PETSc/petscis.pxi":192 * p[0] = self.data * n = self.size * elif self.iset != NULL: # <<<<<<<<<<<<<< * CHKERR( ISGetLocalSize(self.iset, &n) ) * return (n*sizeof(PetscInt)) */ } __pyx_L3:; /* "petsc4py/PETSc/petscis.pxi":194 * elif self.iset != NULL: * CHKERR( ISGetLocalSize(self.iset, &n) ) * return (n*sizeof(PetscInt)) # <<<<<<<<<<<<<< * * def __getsegcount__(self, Py_ssize_t *lenp): */ __pyx_r = ((Py_ssize_t)(((size_t)__pyx_v_n) * (sizeof(PetscInt)))); goto __pyx_L0; /* "petsc4py/PETSc/petscis.pxi":186 * # buffer interface (legacy) * * cdef Py_ssize_t getbuffer(self, void **p) except -1: # <<<<<<<<<<<<<< * cdef PetscInt n = 0 * if p != NULL: */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc._IS_buffer.getbuffer", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1L; __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/petscis.pxi":196 * return (n*sizeof(PetscInt)) * * def __getsegcount__(self, Py_ssize_t *lenp): # <<<<<<<<<<<<<< * if lenp != NULL: * lenp[0] = self.getbuffer(NULL) */ /* Python wrapper */ #if PY_MAJOR_VERSION < 3 static Py_ssize_t __pyx_pw_8petsc4py_5PETSc_10_IS_buffer_13__getsegcount__(PyObject *__pyx_v_self, Py_ssize_t *__pyx_v_lenp); /*proto*/ static Py_ssize_t __pyx_pw_8petsc4py_5PETSc_10_IS_buffer_13__getsegcount__(PyObject *__pyx_v_self, Py_ssize_t *__pyx_v_lenp) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getsegcount__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_10_IS_buffer_12__getsegcount__(((struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *)__pyx_v_self), ((Py_ssize_t *)__pyx_v_lenp)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } #endif /*!(#if PY_MAJOR_VERSION < 3)*/ #if PY_MAJOR_VERSION < 3 static Py_ssize_t __pyx_pf_8petsc4py_5PETSc_10_IS_buffer_12__getsegcount__(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self, Py_ssize_t *__pyx_v_lenp) { Py_ssize_t __pyx_r; int __pyx_t_1; Py_ssize_t __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "petsc4py/PETSc/petscis.pxi":197 * * def __getsegcount__(self, Py_ssize_t *lenp): * if lenp != NULL: # <<<<<<<<<<<<<< * lenp[0] = self.getbuffer(NULL) * return 1 */ __pyx_t_1 = (__pyx_v_lenp != NULL); if (__pyx_t_1) { /* "petsc4py/PETSc/petscis.pxi":198 * def __getsegcount__(self, Py_ssize_t *lenp): * if lenp != NULL: * lenp[0] = self.getbuffer(NULL) # <<<<<<<<<<<<<< * return 1 * */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__IS_buffer *)__pyx_v_self->__pyx_vtab)->getbuffer(__pyx_v_self, NULL); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1L))) __PYX_ERR(6, 198, __pyx_L1_error) (__pyx_v_lenp[0]) = __pyx_t_2; /* "petsc4py/PETSc/petscis.pxi":197 * * def __getsegcount__(self, Py_ssize_t *lenp): * if lenp != NULL: # <<<<<<<<<<<<<< * lenp[0] = self.getbuffer(NULL) * return 1 */ } /* "petsc4py/PETSc/petscis.pxi":199 * if lenp != NULL: * lenp[0] = self.getbuffer(NULL) * return 1 # <<<<<<<<<<<<<< * * def __getreadbuffer__(self, Py_ssize_t idx, void **p): */ __pyx_r = 1; goto __pyx_L0; /* "petsc4py/PETSc/petscis.pxi":196 * return (n*sizeof(PetscInt)) * * def __getsegcount__(self, Py_ssize_t *lenp): # <<<<<<<<<<<<<< * if lenp != NULL: * lenp[0] = self.getbuffer(NULL) */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc._IS_buffer.__getsegcount__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } #endif /*!(#if PY_MAJOR_VERSION < 3)*/ /* "petsc4py/PETSc/petscis.pxi":201 * return 1 * * def __getreadbuffer__(self, Py_ssize_t idx, void **p): # <<<<<<<<<<<<<< * if idx != 0: raise SystemError( * "accessing non-existent buffer segment") */ /* Python wrapper */ #if PY_MAJOR_VERSION < 3 static Py_ssize_t __pyx_pw_8petsc4py_5PETSc_10_IS_buffer_15__getreadbuffer__(PyObject *__pyx_v_self, Py_ssize_t __pyx_v_idx, void **__pyx_v_p); /*proto*/ static Py_ssize_t __pyx_pw_8petsc4py_5PETSc_10_IS_buffer_15__getreadbuffer__(PyObject *__pyx_v_self, Py_ssize_t __pyx_v_idx, void **__pyx_v_p) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getreadbuffer__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_10_IS_buffer_14__getreadbuffer__(((struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *)__pyx_v_self), ((Py_ssize_t)__pyx_v_idx), ((void **)__pyx_v_p)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } #endif /*!(#if PY_MAJOR_VERSION < 3)*/ #if PY_MAJOR_VERSION < 3 static Py_ssize_t __pyx_pf_8petsc4py_5PETSc_10_IS_buffer_14__getreadbuffer__(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self, Py_ssize_t __pyx_v_idx, void **__pyx_v_p) { Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getreadbuffer__", 1); /* "petsc4py/PETSc/petscis.pxi":202 * * def __getreadbuffer__(self, Py_ssize_t idx, void **p): * if idx != 0: raise SystemError( # <<<<<<<<<<<<<< * "accessing non-existent buffer segment") * return self.getbuffer(p) */ __pyx_t_1 = (__pyx_v_idx != 0); if (unlikely(__pyx_t_1)) { __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_SystemError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(6, 202, __pyx_L1_error) } /* "petsc4py/PETSc/petscis.pxi":204 * if idx != 0: raise SystemError( * "accessing non-existent buffer segment") * return self.getbuffer(p) # <<<<<<<<<<<<<< * * # NumPy array interface (legacy) */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__IS_buffer *)__pyx_v_self->__pyx_vtab)->getbuffer(__pyx_v_self, __pyx_v_p); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1L))) __PYX_ERR(6, 204, __pyx_L1_error) __pyx_r = __pyx_t_3; goto __pyx_L0; /* "petsc4py/PETSc/petscis.pxi":201 * return 1 * * def __getreadbuffer__(self, Py_ssize_t idx, void **p): # <<<<<<<<<<<<<< * if idx != 0: raise SystemError( * "accessing non-existent buffer segment") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc._IS_buffer.__getreadbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } #endif /*!(#if PY_MAJOR_VERSION < 3)*/ /* "petsc4py/PETSc/petscis.pxi":209 * * property __array_interface__: * def __get__(self): # <<<<<<<<<<<<<< * cdef PetscInt n = 0 * if self.iset != NULL: */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_10_IS_buffer_19__array_interface___1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_10_IS_buffer_19__array_interface___1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_10_IS_buffer_19__array_interface_____get__(((struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_10_IS_buffer_19__array_interface_____get__(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self) { PetscInt __pyx_v_n; PyObject *__pyx_v_size = 0; PyArray_Descr *__pyx_v_descr = 0; PyObject *__pyx_v_typestr = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/petscis.pxi":210 * property __array_interface__: * def __get__(self): * cdef PetscInt n = 0 # <<<<<<<<<<<<<< * if self.iset != NULL: * CHKERR( ISGetLocalSize(self.iset, &n) ) */ __pyx_v_n = 0; /* "petsc4py/PETSc/petscis.pxi":211 * def __get__(self): * cdef PetscInt n = 0 * if self.iset != NULL: # <<<<<<<<<<<<<< * CHKERR( ISGetLocalSize(self.iset, &n) ) * cdef object size = toInt(n) */ __pyx_t_1 = (__pyx_v_self->iset != NULL); if (__pyx_t_1) { /* "petsc4py/PETSc/petscis.pxi":212 * cdef PetscInt n = 0 * if self.iset != NULL: * CHKERR( ISGetLocalSize(self.iset, &n) ) # <<<<<<<<<<<<<< * cdef object size = toInt(n) * cdef dtype descr = PyArray_DescrFromType(NPY_PETSC_INT) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISGetLocalSize(__pyx_v_self->iset, (&__pyx_v_n))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(6, 212, __pyx_L1_error) /* "petsc4py/PETSc/petscis.pxi":211 * def __get__(self): * cdef PetscInt n = 0 * if self.iset != NULL: # <<<<<<<<<<<<<< * CHKERR( ISGetLocalSize(self.iset, &n) ) * cdef object size = toInt(n) */ } /* "petsc4py/PETSc/petscis.pxi":213 * if self.iset != NULL: * CHKERR( ISGetLocalSize(self.iset, &n) ) * cdef object size = toInt(n) # <<<<<<<<<<<<<< * cdef dtype descr = PyArray_DescrFromType(NPY_PETSC_INT) * cdef str typestr = "=%c%d" % (descr.kind, descr.itemsize) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_size = __pyx_t_3; __pyx_t_3 = 0; /* "petsc4py/PETSc/petscis.pxi":214 * CHKERR( ISGetLocalSize(self.iset, &n) ) * cdef object size = toInt(n) * cdef dtype descr = PyArray_DescrFromType(NPY_PETSC_INT) # <<<<<<<<<<<<<< * cdef str typestr = "=%c%d" % (descr.kind, descr.itemsize) * return dict(version=3, */ __pyx_t_3 = ((PyObject *)PyArray_DescrFromType(NPY_PETSC_INT)); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/petscis.pxi":215 * cdef object size = toInt(n) * cdef dtype descr = PyArray_DescrFromType(NPY_PETSC_INT) * cdef str typestr = "=%c%d" % (descr.kind, descr.itemsize) # <<<<<<<<<<<<<< * return dict(version=3, * data=self, */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_descr), __pyx_n_s_kind); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_descr), __pyx_n_s_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3)) __PYX_ERR(6, 215, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4)) __PYX_ERR(6, 215, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_c_d, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_typestr = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/petscis.pxi":216 * cdef dtype descr = PyArray_DescrFromType(NPY_PETSC_INT) * cdef str typestr = "=%c%d" % (descr.kind, descr.itemsize) * return dict(version=3, # <<<<<<<<<<<<<< * data=self, * shape=(size,), */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_version, __pyx_int_3) < 0) __PYX_ERR(6, 216, __pyx_L1_error) /* "petsc4py/PETSc/petscis.pxi":217 * cdef str typestr = "=%c%d" % (descr.kind, descr.itemsize) * return dict(version=3, * data=self, # <<<<<<<<<<<<<< * shape=(size,), * typestr=typestr) */ if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_data, ((PyObject *)__pyx_v_self)) < 0) __PYX_ERR(6, 216, __pyx_L1_error) /* "petsc4py/PETSc/petscis.pxi":218 * return dict(version=3, * data=self, * shape=(size,), # <<<<<<<<<<<<<< * typestr=typestr) * */ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_size); __Pyx_GIVEREF(__pyx_v_size); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_size)) __PYX_ERR(6, 218, __pyx_L1_error); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_shape, __pyx_t_5) < 0) __PYX_ERR(6, 216, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/petscis.pxi":219 * data=self, * shape=(size,), * typestr=typestr) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_typestr, __pyx_v_typestr) < 0) __PYX_ERR(6, 216, __pyx_L1_error) __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "petsc4py/PETSc/petscis.pxi":209 * * property __array_interface__: * def __get__(self): # <<<<<<<<<<<<<< * cdef PetscInt n = 0 * if self.iset != NULL: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc._IS_buffer.__array_interface__.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_size); __Pyx_XDECREF((PyObject *)__pyx_v_descr); __Pyx_XDECREF(__pyx_v_typestr); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscvec.pxi":219 * # -------------------------------------------------------------------- * * cdef inline Vec ref_Vec(PetscVec vec): # <<<<<<<<<<<<<< * cdef Vec ob = Vec() * ob.vec = vec */ static CYTHON_INLINE struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_ref_Vec(Vec __pyx_v_vec) { struct PyPetscVecObject *__pyx_v_ob = 0; struct PyPetscVecObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("ref_Vec", 1); /* "petsc4py/PETSc/petscvec.pxi":220 * * cdef inline Vec ref_Vec(PetscVec vec): * cdef Vec ob = Vec() # <<<<<<<<<<<<<< * ob.vec = vec * CHKERR( PetscINCREF(ob.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_ob = ((struct PyPetscVecObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscvec.pxi":221 * cdef inline Vec ref_Vec(PetscVec vec): * cdef Vec ob = Vec() * ob.vec = vec # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(ob.obj) ) * return ob */ __pyx_v_ob->vec = __pyx_v_vec; /* "petsc4py/PETSc/petscvec.pxi":222 * cdef Vec ob = Vec() * ob.vec = vec * CHKERR( PetscINCREF(ob.obj) ) # <<<<<<<<<<<<<< * return ob * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ob->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 222, __pyx_L1_error) /* "petsc4py/PETSc/petscvec.pxi":223 * ob.vec = vec * CHKERR( PetscINCREF(ob.obj) ) * return ob # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_ob); __pyx_r = __pyx_v_ob; goto __pyx_L0; /* "petsc4py/PETSc/petscvec.pxi":219 * # -------------------------------------------------------------------- * * cdef inline Vec ref_Vec(PetscVec vec): # <<<<<<<<<<<<<< * cdef Vec ob = Vec() * ob.vec = vec */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.ref_Vec", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscvec.pxi":229 * # unary operations * * cdef Vec vec_pos(Vec self): # <<<<<<<<<<<<<< * cdef Vec vec = type(self)() * CHKERR( VecDuplicate(self.vec, &vec.vec) ) */ static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_vec_pos(struct PyPetscVecObject *__pyx_v_self) { struct PyPetscVecObject *__pyx_v_vec = 0; struct PyPetscVecObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PetscErrorCode __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("vec_pos", 1); /* "petsc4py/PETSc/petscvec.pxi":230 * * cdef Vec vec_pos(Vec self): * cdef Vec vec = type(self)() # <<<<<<<<<<<<<< * CHKERR( VecDuplicate(self.vec, &vec.vec) ) * CHKERR( VecCopy(self.vec, vec.vec) ) */ __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __pyx_t_2 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(7, 230, __pyx_L1_error) __pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscvec.pxi":231 * cdef Vec vec_pos(Vec self): * cdef Vec vec = type(self)() * CHKERR( VecDuplicate(self.vec, &vec.vec) ) # <<<<<<<<<<<<<< * CHKERR( VecCopy(self.vec, vec.vec) ) * return vec */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecDuplicate(__pyx_v_self->vec, (&__pyx_v_vec->vec))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 231, __pyx_L1_error) /* "petsc4py/PETSc/petscvec.pxi":232 * cdef Vec vec = type(self)() * CHKERR( VecDuplicate(self.vec, &vec.vec) ) * CHKERR( VecCopy(self.vec, vec.vec) ) # <<<<<<<<<<<<<< * return vec * */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCopy(__pyx_v_self->vec, __pyx_v_vec->vec)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 232, __pyx_L1_error) /* "petsc4py/PETSc/petscvec.pxi":233 * CHKERR( VecDuplicate(self.vec, &vec.vec) ) * CHKERR( VecCopy(self.vec, vec.vec) ) * return vec # <<<<<<<<<<<<<< * * cdef Vec vec_neg(Vec self): */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_vec); __pyx_r = __pyx_v_vec; goto __pyx_L0; /* "petsc4py/PETSc/petscvec.pxi":229 * # unary operations * * cdef Vec vec_pos(Vec self): # <<<<<<<<<<<<<< * cdef Vec vec = type(self)() * CHKERR( VecDuplicate(self.vec, &vec.vec) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.vec_pos", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_vec); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscvec.pxi":235 * return vec * * cdef Vec vec_neg(Vec self): # <<<<<<<<<<<<<< * cdef Vec vec = vec_pos(self) * CHKERR( VecScale(vec.vec, -1) ) */ static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_vec_neg(struct PyPetscVecObject *__pyx_v_self) { struct PyPetscVecObject *__pyx_v_vec = 0; struct PyPetscVecObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("vec_neg", 1); /* "petsc4py/PETSc/petscvec.pxi":236 * * cdef Vec vec_neg(Vec self): * cdef Vec vec = vec_pos(self) # <<<<<<<<<<<<<< * CHKERR( VecScale(vec.vec, -1) ) * return vec */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_pos(__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscvec.pxi":237 * cdef Vec vec_neg(Vec self): * cdef Vec vec = vec_pos(self) * CHKERR( VecScale(vec.vec, -1) ) # <<<<<<<<<<<<<< * return vec * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecScale(__pyx_v_vec->vec, -1.0)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 237, __pyx_L1_error) /* "petsc4py/PETSc/petscvec.pxi":238 * cdef Vec vec = vec_pos(self) * CHKERR( VecScale(vec.vec, -1) ) * return vec # <<<<<<<<<<<<<< * * cdef Vec vec_abs(Vec self): */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_vec); __pyx_r = __pyx_v_vec; goto __pyx_L0; /* "petsc4py/PETSc/petscvec.pxi":235 * return vec * * cdef Vec vec_neg(Vec self): # <<<<<<<<<<<<<< * cdef Vec vec = vec_pos(self) * CHKERR( VecScale(vec.vec, -1) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.vec_neg", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_vec); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscvec.pxi":240 * return vec * * cdef Vec vec_abs(Vec self): # <<<<<<<<<<<<<< * cdef Vec vec = vec_pos(self) * CHKERR( VecAbs(vec.vec) ) */ static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_vec_abs(struct PyPetscVecObject *__pyx_v_self) { struct PyPetscVecObject *__pyx_v_vec = 0; struct PyPetscVecObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("vec_abs", 1); /* "petsc4py/PETSc/petscvec.pxi":241 * * cdef Vec vec_abs(Vec self): * cdef Vec vec = vec_pos(self) # <<<<<<<<<<<<<< * CHKERR( VecAbs(vec.vec) ) * return vec */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_pos(__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscvec.pxi":242 * cdef Vec vec_abs(Vec self): * cdef Vec vec = vec_pos(self) * CHKERR( VecAbs(vec.vec) ) # <<<<<<<<<<<<<< * return vec * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecAbs(__pyx_v_vec->vec)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 242, __pyx_L1_error) /* "petsc4py/PETSc/petscvec.pxi":243 * cdef Vec vec = vec_pos(self) * CHKERR( VecAbs(vec.vec) ) * return vec # <<<<<<<<<<<<<< * * # inplace binary operations */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_vec); __pyx_r = __pyx_v_vec; goto __pyx_L0; /* "petsc4py/PETSc/petscvec.pxi":240 * return vec * * cdef Vec vec_abs(Vec self): # <<<<<<<<<<<<<< * cdef Vec vec = vec_pos(self) * CHKERR( VecAbs(vec.vec) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.vec_abs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_vec); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscvec.pxi":247 * # inplace binary operations * * cdef Vec vec_iadd(Vec self, other): # <<<<<<<<<<<<<< * cdef PetscScalar alpha = 1 * cdef Vec vec */ static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_vec_iadd(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other) { PetscScalar __pyx_v_alpha; struct PyPetscVecObject *__pyx_v_vec = 0; struct PyPetscVecObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); PetscScalar __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("vec_iadd", 0); __Pyx_INCREF(__pyx_v_other); /* "petsc4py/PETSc/petscvec.pxi":248 * * cdef Vec vec_iadd(Vec self, other): * cdef PetscScalar alpha = 1 # <<<<<<<<<<<<<< * cdef Vec vec * if isinstance(other, Vec): */ __pyx_v_alpha = 1.0; /* "petsc4py/PETSc/petscvec.pxi":250 * cdef PetscScalar alpha = 1 * cdef Vec vec * if isinstance(other, Vec): # <<<<<<<<<<<<<< * alpha = 1; vec = other * CHKERR( VecAXPY(self.vec, alpha, vec.vec) ) */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Vec); if (__pyx_t_1) { /* "petsc4py/PETSc/petscvec.pxi":251 * cdef Vec vec * if isinstance(other, Vec): * alpha = 1; vec = other # <<<<<<<<<<<<<< * CHKERR( VecAXPY(self.vec, alpha, vec.vec) ) * elif isinstance(other, (tuple, list)): */ __pyx_v_alpha = 1.0; if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(7, 251, __pyx_L1_error) __pyx_t_2 = __pyx_v_other; __Pyx_INCREF(__pyx_t_2); __pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscvec.pxi":252 * if isinstance(other, Vec): * alpha = 1; vec = other * CHKERR( VecAXPY(self.vec, alpha, vec.vec) ) # <<<<<<<<<<<<<< * elif isinstance(other, (tuple, list)): * other, vec = other */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecAXPY(__pyx_v_self->vec, __pyx_v_alpha, __pyx_v_vec->vec)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 252, __pyx_L1_error) /* "petsc4py/PETSc/petscvec.pxi":250 * cdef PetscScalar alpha = 1 * cdef Vec vec * if isinstance(other, Vec): # <<<<<<<<<<<<<< * alpha = 1; vec = other * CHKERR( VecAXPY(self.vec, alpha, vec.vec) ) */ goto __pyx_L3; } /* "petsc4py/PETSc/petscvec.pxi":253 * alpha = 1; vec = other * CHKERR( VecAXPY(self.vec, alpha, vec.vec) ) * elif isinstance(other, (tuple, list)): # <<<<<<<<<<<<<< * other, vec = other * alpha = asScalar(other) */ __pyx_t_4 = PyTuple_Check(__pyx_v_other); if (!__pyx_t_4) { } else { __pyx_t_1 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = PyList_Check(__pyx_v_other); __pyx_t_1 = __pyx_t_4; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "petsc4py/PETSc/petscvec.pxi":254 * CHKERR( VecAXPY(self.vec, alpha, vec.vec) ) * elif isinstance(other, (tuple, list)): * other, vec = other # <<<<<<<<<<<<<< * alpha = asScalar(other) * CHKERR( VecAXPY(self.vec, alpha, vec.vec) ) */ if ((likely(PyTuple_CheckExact(__pyx_v_other))) || (PyList_CheckExact(__pyx_v_other))) { PyObject* sequence = __pyx_v_other; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(7, 254, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_other); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); index = 0; __pyx_t_2 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_2)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(7, 254, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L7_unpacking_done; __pyx_L6_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(7, 254, __pyx_L1_error) __pyx_L7_unpacking_done:; } if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(7, 254, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_other, __pyx_t_2); __pyx_t_2 = 0; __pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/petscvec.pxi":255 * elif isinstance(other, (tuple, list)): * other, vec = other * alpha = asScalar(other) # <<<<<<<<<<<<<< * CHKERR( VecAXPY(self.vec, alpha, vec.vec) ) * else: */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_other); if (unlikely(__pyx_t_8 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(7, 255, __pyx_L1_error) __pyx_v_alpha = __pyx_t_8; /* "petsc4py/PETSc/petscvec.pxi":256 * other, vec = other * alpha = asScalar(other) * CHKERR( VecAXPY(self.vec, alpha, vec.vec) ) # <<<<<<<<<<<<<< * else: * alpha = asScalar(other) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecAXPY(__pyx_v_self->vec, __pyx_v_alpha, __pyx_v_vec->vec)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 256, __pyx_L1_error) /* "petsc4py/PETSc/petscvec.pxi":253 * alpha = 1; vec = other * CHKERR( VecAXPY(self.vec, alpha, vec.vec) ) * elif isinstance(other, (tuple, list)): # <<<<<<<<<<<<<< * other, vec = other * alpha = asScalar(other) */ goto __pyx_L3; } /* "petsc4py/PETSc/petscvec.pxi":258 * CHKERR( VecAXPY(self.vec, alpha, vec.vec) ) * else: * alpha = asScalar(other) # <<<<<<<<<<<<<< * CHKERR( VecShift(self.vec, alpha) ) * return self */ /*else*/ { __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_other); if (unlikely(__pyx_t_8 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(7, 258, __pyx_L1_error) __pyx_v_alpha = __pyx_t_8; /* "petsc4py/PETSc/petscvec.pxi":259 * else: * alpha = asScalar(other) * CHKERR( VecShift(self.vec, alpha) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecShift(__pyx_v_self->vec, __pyx_v_alpha)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 259, __pyx_L1_error) } __pyx_L3:; /* "petsc4py/PETSc/petscvec.pxi":260 * alpha = asScalar(other) * CHKERR( VecShift(self.vec, alpha) ) * return self # <<<<<<<<<<<<<< * * cdef Vec vec_isub(Vec self, other): */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = __pyx_v_self; goto __pyx_L0; /* "petsc4py/PETSc/petscvec.pxi":247 * # inplace binary operations * * cdef Vec vec_iadd(Vec self, other): # <<<<<<<<<<<<<< * cdef PetscScalar alpha = 1 * cdef Vec vec */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.vec_iadd", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_vec); __Pyx_XDECREF(__pyx_v_other); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscvec.pxi":262 * return self * * cdef Vec vec_isub(Vec self, other): # <<<<<<<<<<<<<< * cdef PetscScalar alpha = 1 * cdef Vec vec */ static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_vec_isub(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other) { PetscScalar __pyx_v_alpha; struct PyPetscVecObject *__pyx_v_vec = 0; struct PyPetscVecObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); PetscScalar __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("vec_isub", 0); __Pyx_INCREF(__pyx_v_other); /* "petsc4py/PETSc/petscvec.pxi":263 * * cdef Vec vec_isub(Vec self, other): * cdef PetscScalar alpha = 1 # <<<<<<<<<<<<<< * cdef Vec vec * if isinstance(other, Vec): */ __pyx_v_alpha = 1.0; /* "petsc4py/PETSc/petscvec.pxi":265 * cdef PetscScalar alpha = 1 * cdef Vec vec * if isinstance(other, Vec): # <<<<<<<<<<<<<< * alpha = 1; vec = other * CHKERR( VecAXPY(self.vec, -alpha, vec.vec) ) */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Vec); if (__pyx_t_1) { /* "petsc4py/PETSc/petscvec.pxi":266 * cdef Vec vec * if isinstance(other, Vec): * alpha = 1; vec = other # <<<<<<<<<<<<<< * CHKERR( VecAXPY(self.vec, -alpha, vec.vec) ) * elif isinstance(other, (tuple, list)): */ __pyx_v_alpha = 1.0; if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(7, 266, __pyx_L1_error) __pyx_t_2 = __pyx_v_other; __Pyx_INCREF(__pyx_t_2); __pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscvec.pxi":267 * if isinstance(other, Vec): * alpha = 1; vec = other * CHKERR( VecAXPY(self.vec, -alpha, vec.vec) ) # <<<<<<<<<<<<<< * elif isinstance(other, (tuple, list)): * other, vec = other */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecAXPY(__pyx_v_self->vec, (-__pyx_v_alpha), __pyx_v_vec->vec)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 267, __pyx_L1_error) /* "petsc4py/PETSc/petscvec.pxi":265 * cdef PetscScalar alpha = 1 * cdef Vec vec * if isinstance(other, Vec): # <<<<<<<<<<<<<< * alpha = 1; vec = other * CHKERR( VecAXPY(self.vec, -alpha, vec.vec) ) */ goto __pyx_L3; } /* "petsc4py/PETSc/petscvec.pxi":268 * alpha = 1; vec = other * CHKERR( VecAXPY(self.vec, -alpha, vec.vec) ) * elif isinstance(other, (tuple, list)): # <<<<<<<<<<<<<< * other, vec = other * alpha = asScalar(other) */ __pyx_t_4 = PyTuple_Check(__pyx_v_other); if (!__pyx_t_4) { } else { __pyx_t_1 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = PyList_Check(__pyx_v_other); __pyx_t_1 = __pyx_t_4; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "petsc4py/PETSc/petscvec.pxi":269 * CHKERR( VecAXPY(self.vec, -alpha, vec.vec) ) * elif isinstance(other, (tuple, list)): * other, vec = other # <<<<<<<<<<<<<< * alpha = asScalar(other) * CHKERR( VecAXPY(self.vec, -alpha, vec.vec) ) */ if ((likely(PyTuple_CheckExact(__pyx_v_other))) || (PyList_CheckExact(__pyx_v_other))) { PyObject* sequence = __pyx_v_other; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(7, 269, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_other); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); index = 0; __pyx_t_2 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_2)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(7, 269, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L7_unpacking_done; __pyx_L6_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(7, 269, __pyx_L1_error) __pyx_L7_unpacking_done:; } if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(7, 269, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_other, __pyx_t_2); __pyx_t_2 = 0; __pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/petscvec.pxi":270 * elif isinstance(other, (tuple, list)): * other, vec = other * alpha = asScalar(other) # <<<<<<<<<<<<<< * CHKERR( VecAXPY(self.vec, -alpha, vec.vec) ) * else: */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_other); if (unlikely(__pyx_t_8 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(7, 270, __pyx_L1_error) __pyx_v_alpha = __pyx_t_8; /* "petsc4py/PETSc/petscvec.pxi":271 * other, vec = other * alpha = asScalar(other) * CHKERR( VecAXPY(self.vec, -alpha, vec.vec) ) # <<<<<<<<<<<<<< * else: * alpha = asScalar(other) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecAXPY(__pyx_v_self->vec, (-__pyx_v_alpha), __pyx_v_vec->vec)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 271, __pyx_L1_error) /* "petsc4py/PETSc/petscvec.pxi":268 * alpha = 1; vec = other * CHKERR( VecAXPY(self.vec, -alpha, vec.vec) ) * elif isinstance(other, (tuple, list)): # <<<<<<<<<<<<<< * other, vec = other * alpha = asScalar(other) */ goto __pyx_L3; } /* "petsc4py/PETSc/petscvec.pxi":273 * CHKERR( VecAXPY(self.vec, -alpha, vec.vec) ) * else: * alpha = asScalar(other) # <<<<<<<<<<<<<< * CHKERR( VecShift(self.vec, -alpha) ) * return self */ /*else*/ { __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_other); if (unlikely(__pyx_t_8 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(7, 273, __pyx_L1_error) __pyx_v_alpha = __pyx_t_8; /* "petsc4py/PETSc/petscvec.pxi":274 * else: * alpha = asScalar(other) * CHKERR( VecShift(self.vec, -alpha) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecShift(__pyx_v_self->vec, (-__pyx_v_alpha))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 274, __pyx_L1_error) } __pyx_L3:; /* "petsc4py/PETSc/petscvec.pxi":275 * alpha = asScalar(other) * CHKERR( VecShift(self.vec, -alpha) ) * return self # <<<<<<<<<<<<<< * * cdef Vec vec_imul(Vec self, other): */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = __pyx_v_self; goto __pyx_L0; /* "petsc4py/PETSc/petscvec.pxi":262 * return self * * cdef Vec vec_isub(Vec self, other): # <<<<<<<<<<<<<< * cdef PetscScalar alpha = 1 * cdef Vec vec */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.vec_isub", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_vec); __Pyx_XDECREF(__pyx_v_other); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscvec.pxi":277 * return self * * cdef Vec vec_imul(Vec self, other): # <<<<<<<<<<<<<< * cdef PetscScalar alpha = 1 * cdef Vec vec */ static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_vec_imul(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other) { PetscScalar __pyx_v_alpha; struct PyPetscVecObject *__pyx_v_vec = 0; struct PyPetscVecObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; PetscScalar __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("vec_imul", 1); /* "petsc4py/PETSc/petscvec.pxi":278 * * cdef Vec vec_imul(Vec self, other): * cdef PetscScalar alpha = 1 # <<<<<<<<<<<<<< * cdef Vec vec * if isinstance(other, Vec): */ __pyx_v_alpha = 1.0; /* "petsc4py/PETSc/petscvec.pxi":280 * cdef PetscScalar alpha = 1 * cdef Vec vec * if isinstance(other, Vec): # <<<<<<<<<<<<<< * vec = other * CHKERR( VecPointwiseMult(self.vec, self.vec, vec.vec) ) */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Vec); if (__pyx_t_1) { /* "petsc4py/PETSc/petscvec.pxi":281 * cdef Vec vec * if isinstance(other, Vec): * vec = other # <<<<<<<<<<<<<< * CHKERR( VecPointwiseMult(self.vec, self.vec, vec.vec) ) * else: */ if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(7, 281, __pyx_L1_error) __pyx_t_2 = __pyx_v_other; __Pyx_INCREF(__pyx_t_2); __pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscvec.pxi":282 * if isinstance(other, Vec): * vec = other * CHKERR( VecPointwiseMult(self.vec, self.vec, vec.vec) ) # <<<<<<<<<<<<<< * else: * alpha = asScalar(other) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecPointwiseMult(__pyx_v_self->vec, __pyx_v_self->vec, __pyx_v_vec->vec)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 282, __pyx_L1_error) /* "petsc4py/PETSc/petscvec.pxi":280 * cdef PetscScalar alpha = 1 * cdef Vec vec * if isinstance(other, Vec): # <<<<<<<<<<<<<< * vec = other * CHKERR( VecPointwiseMult(self.vec, self.vec, vec.vec) ) */ goto __pyx_L3; } /* "petsc4py/PETSc/petscvec.pxi":284 * CHKERR( VecPointwiseMult(self.vec, self.vec, vec.vec) ) * else: * alpha = asScalar(other) # <<<<<<<<<<<<<< * CHKERR( VecScale(self.vec, alpha) ) * return self */ /*else*/ { __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_other); if (unlikely(__pyx_t_4 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(7, 284, __pyx_L1_error) __pyx_v_alpha = __pyx_t_4; /* "petsc4py/PETSc/petscvec.pxi":285 * else: * alpha = asScalar(other) * CHKERR( VecScale(self.vec, alpha) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecScale(__pyx_v_self->vec, __pyx_v_alpha)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 285, __pyx_L1_error) } __pyx_L3:; /* "petsc4py/PETSc/petscvec.pxi":286 * alpha = asScalar(other) * CHKERR( VecScale(self.vec, alpha) ) * return self # <<<<<<<<<<<<<< * * cdef Vec vec_idiv(Vec self, other): */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = __pyx_v_self; goto __pyx_L0; /* "petsc4py/PETSc/petscvec.pxi":277 * return self * * cdef Vec vec_imul(Vec self, other): # <<<<<<<<<<<<<< * cdef PetscScalar alpha = 1 * cdef Vec vec */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.vec_imul", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_vec); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscvec.pxi":288 * return self * * cdef Vec vec_idiv(Vec self, other): # <<<<<<<<<<<<<< * cdef PetscScalar one = 1 * cdef PetscScalar alpha = 1 */ static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_vec_idiv(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other) { PetscScalar __pyx_v_one; PetscScalar __pyx_v_alpha; struct PyPetscVecObject *__pyx_v_vec = 0; struct PyPetscVecObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; PetscScalar __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("vec_idiv", 1); /* "petsc4py/PETSc/petscvec.pxi":289 * * cdef Vec vec_idiv(Vec self, other): * cdef PetscScalar one = 1 # <<<<<<<<<<<<<< * cdef PetscScalar alpha = 1 * cdef Vec vec */ __pyx_v_one = 1.0; /* "petsc4py/PETSc/petscvec.pxi":290 * cdef Vec vec_idiv(Vec self, other): * cdef PetscScalar one = 1 * cdef PetscScalar alpha = 1 # <<<<<<<<<<<<<< * cdef Vec vec * if isinstance(other, Vec): */ __pyx_v_alpha = 1.0; /* "petsc4py/PETSc/petscvec.pxi":292 * cdef PetscScalar alpha = 1 * cdef Vec vec * if isinstance(other, Vec): # <<<<<<<<<<<<<< * vec = other * CHKERR( VecPointwiseDivide(self.vec, self.vec, vec.vec) ) */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Vec); if (__pyx_t_1) { /* "petsc4py/PETSc/petscvec.pxi":293 * cdef Vec vec * if isinstance(other, Vec): * vec = other # <<<<<<<<<<<<<< * CHKERR( VecPointwiseDivide(self.vec, self.vec, vec.vec) ) * else: */ if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(7, 293, __pyx_L1_error) __pyx_t_2 = __pyx_v_other; __Pyx_INCREF(__pyx_t_2); __pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscvec.pxi":294 * if isinstance(other, Vec): * vec = other * CHKERR( VecPointwiseDivide(self.vec, self.vec, vec.vec) ) # <<<<<<<<<<<<<< * else: * alpha = asScalar(other) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecPointwiseDivide(__pyx_v_self->vec, __pyx_v_self->vec, __pyx_v_vec->vec)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 294, __pyx_L1_error) /* "petsc4py/PETSc/petscvec.pxi":292 * cdef PetscScalar alpha = 1 * cdef Vec vec * if isinstance(other, Vec): # <<<<<<<<<<<<<< * vec = other * CHKERR( VecPointwiseDivide(self.vec, self.vec, vec.vec) ) */ goto __pyx_L3; } /* "petsc4py/PETSc/petscvec.pxi":296 * CHKERR( VecPointwiseDivide(self.vec, self.vec, vec.vec) ) * else: * alpha = asScalar(other) # <<<<<<<<<<<<<< * CHKERR( VecScale(self.vec, one/alpha) ) * return self */ /*else*/ { __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_other); if (unlikely(__pyx_t_4 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(7, 296, __pyx_L1_error) __pyx_v_alpha = __pyx_t_4; /* "petsc4py/PETSc/petscvec.pxi":297 * else: * alpha = asScalar(other) * CHKERR( VecScale(self.vec, one/alpha) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecScale(__pyx_v_self->vec, (__pyx_v_one / __pyx_v_alpha))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 297, __pyx_L1_error) } __pyx_L3:; /* "petsc4py/PETSc/petscvec.pxi":298 * alpha = asScalar(other) * CHKERR( VecScale(self.vec, one/alpha) ) * return self # <<<<<<<<<<<<<< * * # binary operations */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = __pyx_v_self; goto __pyx_L0; /* "petsc4py/PETSc/petscvec.pxi":288 * return self * * cdef Vec vec_idiv(Vec self, other): # <<<<<<<<<<<<<< * cdef PetscScalar one = 1 * cdef PetscScalar alpha = 1 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.vec_idiv", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_vec); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscvec.pxi":302 * # binary operations * * cdef Vec vec_add(Vec self, other): # <<<<<<<<<<<<<< * return vec_iadd(vec_pos(self), other) * */ static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_vec_add(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other) { struct PyPetscVecObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("vec_add", 1); /* "petsc4py/PETSc/petscvec.pxi":303 * * cdef Vec vec_add(Vec self, other): * return vec_iadd(vec_pos(self), other) # <<<<<<<<<<<<<< * * cdef Vec vec_sub(Vec self, other): */ __Pyx_XDECREF((PyObject *)__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_pos(__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_iadd(((struct PyPetscVecObject *)__pyx_t_1), __pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = ((struct PyPetscVecObject *)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/petscvec.pxi":302 * # binary operations * * cdef Vec vec_add(Vec self, other): # <<<<<<<<<<<<<< * return vec_iadd(vec_pos(self), other) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.vec_add", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscvec.pxi":305 * return vec_iadd(vec_pos(self), other) * * cdef Vec vec_sub(Vec self, other): # <<<<<<<<<<<<<< * return vec_isub(vec_pos(self), other) * */ static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_vec_sub(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other) { struct PyPetscVecObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("vec_sub", 1); /* "petsc4py/PETSc/petscvec.pxi":306 * * cdef Vec vec_sub(Vec self, other): * return vec_isub(vec_pos(self), other) # <<<<<<<<<<<<<< * * cdef Vec vec_mul(Vec self, other): */ __Pyx_XDECREF((PyObject *)__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_pos(__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_isub(((struct PyPetscVecObject *)__pyx_t_1), __pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = ((struct PyPetscVecObject *)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/petscvec.pxi":305 * return vec_iadd(vec_pos(self), other) * * cdef Vec vec_sub(Vec self, other): # <<<<<<<<<<<<<< * return vec_isub(vec_pos(self), other) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.vec_sub", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscvec.pxi":308 * return vec_isub(vec_pos(self), other) * * cdef Vec vec_mul(Vec self, other): # <<<<<<<<<<<<<< * return vec_imul(vec_pos(self), other) * */ static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_vec_mul(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other) { struct PyPetscVecObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("vec_mul", 1); /* "petsc4py/PETSc/petscvec.pxi":309 * * cdef Vec vec_mul(Vec self, other): * return vec_imul(vec_pos(self), other) # <<<<<<<<<<<<<< * * cdef Vec vec_div(Vec self, other): */ __Pyx_XDECREF((PyObject *)__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_pos(__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_imul(((struct PyPetscVecObject *)__pyx_t_1), __pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = ((struct PyPetscVecObject *)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/petscvec.pxi":308 * return vec_isub(vec_pos(self), other) * * cdef Vec vec_mul(Vec self, other): # <<<<<<<<<<<<<< * return vec_imul(vec_pos(self), other) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.vec_mul", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscvec.pxi":311 * return vec_imul(vec_pos(self), other) * * cdef Vec vec_div(Vec self, other): # <<<<<<<<<<<<<< * return vec_idiv(vec_pos(self), other) * */ static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_vec_div(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other) { struct PyPetscVecObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("vec_div", 1); /* "petsc4py/PETSc/petscvec.pxi":312 * * cdef Vec vec_div(Vec self, other): * return vec_idiv(vec_pos(self), other) # <<<<<<<<<<<<<< * * cdef object vec_matmul(Vec self, other): */ __Pyx_XDECREF((PyObject *)__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_pos(__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_idiv(((struct PyPetscVecObject *)__pyx_t_1), __pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = ((struct PyPetscVecObject *)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/petscvec.pxi":311 * return vec_imul(vec_pos(self), other) * * cdef Vec vec_div(Vec self, other): # <<<<<<<<<<<<<< * return vec_idiv(vec_pos(self), other) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.vec_div", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscvec.pxi":314 * return vec_idiv(vec_pos(self), other) * * cdef object vec_matmul(Vec self, other): # <<<<<<<<<<<<<< * if isinstance(other, Vec): * return self.dot(other) */ static PyObject *__pyx_f_8petsc4py_5PETSc_vec_matmul(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_v_result = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("vec_matmul", 1); /* "petsc4py/PETSc/petscvec.pxi":315 * * cdef object vec_matmul(Vec self, other): * if isinstance(other, Vec): # <<<<<<<<<<<<<< * return self.dot(other) * if isinstance(other, Mat): */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Vec); if (__pyx_t_1) { /* "petsc4py/PETSc/petscvec.pxi":316 * cdef object vec_matmul(Vec self, other): * if isinstance(other, Vec): * return self.dot(other) # <<<<<<<<<<<<<< * if isinstance(other, Mat): * result = other.createVecRight() */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dot); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_other}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/petscvec.pxi":315 * * cdef object vec_matmul(Vec self, other): * if isinstance(other, Vec): # <<<<<<<<<<<<<< * return self.dot(other) * if isinstance(other, Mat): */ } /* "petsc4py/PETSc/petscvec.pxi":317 * if isinstance(other, Vec): * return self.dot(other) * if isinstance(other, Mat): # <<<<<<<<<<<<<< * result = other.createVecRight() * other.multTranspose(self, result) */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Mat); if (__pyx_t_1) { /* "petsc4py/PETSc/petscvec.pxi":318 * return self.dot(other) * if isinstance(other, Mat): * result = other.createVecRight() # <<<<<<<<<<<<<< * other.multTranspose(self, result) * return result */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_createVecRight); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_result = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/petscvec.pxi":319 * if isinstance(other, Mat): * result = other.createVecRight() * other.multTranspose(self, result) # <<<<<<<<<<<<<< * return result * return NotImplemented */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_multTranspose); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_4, ((PyObject *)__pyx_v_self), __pyx_v_result}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscvec.pxi":320 * result = other.createVecRight() * other.multTranspose(self, result) * return result # <<<<<<<<<<<<<< * return NotImplemented * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_result); __pyx_r = __pyx_v_result; goto __pyx_L0; /* "petsc4py/PETSc/petscvec.pxi":317 * if isinstance(other, Vec): * return self.dot(other) * if isinstance(other, Mat): # <<<<<<<<<<<<<< * result = other.createVecRight() * other.multTranspose(self, result) */ } /* "petsc4py/PETSc/petscvec.pxi":321 * other.multTranspose(self, result) * return result * return NotImplemented # <<<<<<<<<<<<<< * * # reflected binary operations */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_builtin_NotImplemented); __pyx_r = __pyx_builtin_NotImplemented; goto __pyx_L0; /* "petsc4py/PETSc/petscvec.pxi":314 * return vec_idiv(vec_pos(self), other) * * cdef object vec_matmul(Vec self, other): # <<<<<<<<<<<<<< * if isinstance(other, Vec): * return self.dot(other) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.vec_matmul", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscvec.pxi":325 * # reflected binary operations * * cdef Vec vec_radd(Vec self, other): # <<<<<<<<<<<<<< * return vec_add(self, other) * */ static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_vec_radd(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other) { struct PyPetscVecObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("vec_radd", 1); /* "petsc4py/PETSc/petscvec.pxi":326 * * cdef Vec vec_radd(Vec self, other): * return vec_add(self, other) # <<<<<<<<<<<<<< * * cdef Vec vec_rsub(Vec self, other): */ __Pyx_XDECREF((PyObject *)__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_add(__pyx_v_self, __pyx_v_other)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/petscvec.pxi":325 * # reflected binary operations * * cdef Vec vec_radd(Vec self, other): # <<<<<<<<<<<<<< * return vec_add(self, other) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.vec_radd", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscvec.pxi":328 * return vec_add(self, other) * * cdef Vec vec_rsub(Vec self, other): # <<<<<<<<<<<<<< * cdef Vec vec = vec_sub(self, other) * CHKERR( VecScale(vec.vec, -1) ) */ static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_vec_rsub(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other) { struct PyPetscVecObject *__pyx_v_vec = 0; struct PyPetscVecObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("vec_rsub", 1); /* "petsc4py/PETSc/petscvec.pxi":329 * * cdef Vec vec_rsub(Vec self, other): * cdef Vec vec = vec_sub(self, other) # <<<<<<<<<<<<<< * CHKERR( VecScale(vec.vec, -1) ) * return vec */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_sub(__pyx_v_self, __pyx_v_other)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscvec.pxi":330 * cdef Vec vec_rsub(Vec self, other): * cdef Vec vec = vec_sub(self, other) * CHKERR( VecScale(vec.vec, -1) ) # <<<<<<<<<<<<<< * return vec * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecScale(__pyx_v_vec->vec, -1.0)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 330, __pyx_L1_error) /* "petsc4py/PETSc/petscvec.pxi":331 * cdef Vec vec = vec_sub(self, other) * CHKERR( VecScale(vec.vec, -1) ) * return vec # <<<<<<<<<<<<<< * * cdef Vec vec_rmul(Vec self, other): */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_vec); __pyx_r = __pyx_v_vec; goto __pyx_L0; /* "petsc4py/PETSc/petscvec.pxi":328 * return vec_add(self, other) * * cdef Vec vec_rsub(Vec self, other): # <<<<<<<<<<<<<< * cdef Vec vec = vec_sub(self, other) * CHKERR( VecScale(vec.vec, -1) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.vec_rsub", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_vec); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscvec.pxi":333 * return vec * * cdef Vec vec_rmul(Vec self, other): # <<<<<<<<<<<<<< * return vec_mul(self, other) * */ static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_vec_rmul(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other) { struct PyPetscVecObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("vec_rmul", 1); /* "petsc4py/PETSc/petscvec.pxi":334 * * cdef Vec vec_rmul(Vec self, other): * return vec_mul(self, other) # <<<<<<<<<<<<<< * * cdef Vec vec_rdiv(Vec self, other): */ __Pyx_XDECREF((PyObject *)__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_mul(__pyx_v_self, __pyx_v_other)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/petscvec.pxi":333 * return vec * * cdef Vec vec_rmul(Vec self, other): # <<<<<<<<<<<<<< * return vec_mul(self, other) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.vec_rmul", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscvec.pxi":336 * return vec_mul(self, other) * * cdef Vec vec_rdiv(Vec self, other): # <<<<<<<<<<<<<< * cdef Vec vec = vec_div(self, other) * CHKERR( VecReciprocal(vec.vec) ) */ static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_vec_rdiv(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other) { struct PyPetscVecObject *__pyx_v_vec = 0; struct PyPetscVecObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("vec_rdiv", 1); /* "petsc4py/PETSc/petscvec.pxi":337 * * cdef Vec vec_rdiv(Vec self, other): * cdef Vec vec = vec_div(self, other) # <<<<<<<<<<<<<< * CHKERR( VecReciprocal(vec.vec) ) * return vec */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_div(__pyx_v_self, __pyx_v_other)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscvec.pxi":338 * cdef Vec vec_rdiv(Vec self, other): * cdef Vec vec = vec_div(self, other) * CHKERR( VecReciprocal(vec.vec) ) # <<<<<<<<<<<<<< * return vec * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecReciprocal(__pyx_v_vec->vec)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 338, __pyx_L1_error) /* "petsc4py/PETSc/petscvec.pxi":339 * cdef Vec vec = vec_div(self, other) * CHKERR( VecReciprocal(vec.vec) ) * return vec # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_vec); __pyx_r = __pyx_v_vec; goto __pyx_L0; /* "petsc4py/PETSc/petscvec.pxi":336 * return vec_mul(self, other) * * cdef Vec vec_rdiv(Vec self, other): # <<<<<<<<<<<<<< * cdef Vec vec = vec_div(self, other) * CHKERR( VecReciprocal(vec.vec) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.vec_rdiv", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_vec); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscvec.pxi":343 * # -------------------------------------------------------------------- * * cdef inline int Vec_Sizes(object size, object bsize, # <<<<<<<<<<<<<< * PetscInt *b, PetscInt *n, PetscInt *N) except -1: * Sys_Sizes(size, bsize, b, n, N) */ static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_Vec_Sizes(PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PetscInt *__pyx_v_b, PetscInt *__pyx_v_n, PetscInt *__pyx_v_N) { int __pyx_r; PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "petsc4py/PETSc/petscvec.pxi":345 * cdef inline int Vec_Sizes(object size, object bsize, * PetscInt *b, PetscInt *n, PetscInt *N) except -1: * Sys_Sizes(size, bsize, b, n, N) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_Sys_Sizes(__pyx_v_size, __pyx_v_bsize, __pyx_v_b, __pyx_v_n, __pyx_v_N); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 345, __pyx_L1_error) /* "petsc4py/PETSc/petscvec.pxi":346 * PetscInt *b, PetscInt *n, PetscInt *N) except -1: * Sys_Sizes(size, bsize, b, n, N) * return 0 # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_r = 0; goto __pyx_L0; /* "petsc4py/PETSc/petscvec.pxi":343 * # -------------------------------------------------------------------- * * cdef inline int Vec_Sizes(object size, object bsize, # <<<<<<<<<<<<<< * PetscInt *b, PetscInt *n, PetscInt *N) except -1: * Sys_Sizes(size, bsize, b, n, N) */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec_Sizes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/petscvec.pxi":354 * const PetscScalar*,PetscInsertMode) * * cdef inline VecSetValuesFcn* vecsetvalues_fcn(int blocked, int local): # <<<<<<<<<<<<<< * cdef VecSetValuesFcn *setvalues = NULL * if blocked and local: setvalues = VecSetValuesBlockedLocal */ static CYTHON_INLINE __pyx_t_8petsc4py_5PETSc_VecSetValuesFcn *__pyx_f_8petsc4py_5PETSc_vecsetvalues_fcn(int __pyx_v_blocked, int __pyx_v_local) { __pyx_t_8petsc4py_5PETSc_VecSetValuesFcn *__pyx_v_setvalues; __pyx_t_8petsc4py_5PETSc_VecSetValuesFcn *__pyx_r; int __pyx_t_1; int __pyx_t_2; /* "petsc4py/PETSc/petscvec.pxi":355 * * cdef inline VecSetValuesFcn* vecsetvalues_fcn(int blocked, int local): * cdef VecSetValuesFcn *setvalues = NULL # <<<<<<<<<<<<<< * if blocked and local: setvalues = VecSetValuesBlockedLocal * elif blocked: setvalues = VecSetValuesBlocked */ __pyx_v_setvalues = NULL; /* "petsc4py/PETSc/petscvec.pxi":356 * cdef inline VecSetValuesFcn* vecsetvalues_fcn(int blocked, int local): * cdef VecSetValuesFcn *setvalues = NULL * if blocked and local: setvalues = VecSetValuesBlockedLocal # <<<<<<<<<<<<<< * elif blocked: setvalues = VecSetValuesBlocked * elif local: setvalues = VecSetValuesLocal */ __pyx_t_2 = (__pyx_v_blocked != 0); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = (__pyx_v_local != 0); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { __pyx_v_setvalues = VecSetValuesBlockedLocal; goto __pyx_L3; } /* "petsc4py/PETSc/petscvec.pxi":357 * cdef VecSetValuesFcn *setvalues = NULL * if blocked and local: setvalues = VecSetValuesBlockedLocal * elif blocked: setvalues = VecSetValuesBlocked # <<<<<<<<<<<<<< * elif local: setvalues = VecSetValuesLocal * else: setvalues = VecSetValues */ __pyx_t_1 = (__pyx_v_blocked != 0); if (__pyx_t_1) { __pyx_v_setvalues = VecSetValuesBlocked; goto __pyx_L3; } /* "petsc4py/PETSc/petscvec.pxi":358 * if blocked and local: setvalues = VecSetValuesBlockedLocal * elif blocked: setvalues = VecSetValuesBlocked * elif local: setvalues = VecSetValuesLocal # <<<<<<<<<<<<<< * else: setvalues = VecSetValues * return setvalues */ __pyx_t_1 = (__pyx_v_local != 0); if (__pyx_t_1) { __pyx_v_setvalues = VecSetValuesLocal; goto __pyx_L3; } /* "petsc4py/PETSc/petscvec.pxi":359 * elif blocked: setvalues = VecSetValuesBlocked * elif local: setvalues = VecSetValuesLocal * else: setvalues = VecSetValues # <<<<<<<<<<<<<< * return setvalues * */ /*else*/ { __pyx_v_setvalues = VecSetValues; } __pyx_L3:; /* "petsc4py/PETSc/petscvec.pxi":360 * elif local: setvalues = VecSetValuesLocal * else: setvalues = VecSetValues * return setvalues # <<<<<<<<<<<<<< * * cdef inline int vecsetvalues(PetscVec V, */ __pyx_r = __pyx_v_setvalues; goto __pyx_L0; /* "petsc4py/PETSc/petscvec.pxi":354 * const PetscScalar*,PetscInsertMode) * * cdef inline VecSetValuesFcn* vecsetvalues_fcn(int blocked, int local): # <<<<<<<<<<<<<< * cdef VecSetValuesFcn *setvalues = NULL * if blocked and local: setvalues = VecSetValuesBlockedLocal */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/petscvec.pxi":362 * return setvalues * * cdef inline int vecsetvalues(PetscVec V, # <<<<<<<<<<<<<< * object oi, object ov, object oim, * int blocked, int local) except -1: */ static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_vecsetvalues(Vec __pyx_v_V, PyObject *__pyx_v_oi, PyObject *__pyx_v_ov, PyObject *__pyx_v_oim, int __pyx_v_blocked, int __pyx_v_local) { PetscInt __pyx_v_bs; PetscInt __pyx_v_ni; PetscInt __pyx_v_nv; PetscInt *__pyx_v_i; PetscScalar *__pyx_v_v; CYTHON_UNUSED PyObject *__pyx_v_tmp1 = 0; CYTHON_UNUSED PyObject *__pyx_v_tmp2 = 0; __pyx_t_8petsc4py_5PETSc_VecSetValuesFcn *__pyx_v_setvalues; InsertMode __pyx_v_addv; int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; __pyx_t_8petsc4py_5PETSc_VecSetValuesFcn *__pyx_t_7; InsertMode __pyx_t_8; PetscErrorCode __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("vecsetvalues", 1); /* "petsc4py/PETSc/petscvec.pxi":366 * int blocked, int local) except -1: * # block size * cdef PetscInt bs=1 # <<<<<<<<<<<<<< * if blocked: * CHKERR( VecGetBlockSize(V, &bs) ) */ __pyx_v_bs = 1; /* "petsc4py/PETSc/petscvec.pxi":367 * # block size * cdef PetscInt bs=1 * if blocked: # <<<<<<<<<<<<<< * CHKERR( VecGetBlockSize(V, &bs) ) * if bs < 1: bs = 1 */ __pyx_t_1 = (__pyx_v_blocked != 0); if (__pyx_t_1) { /* "petsc4py/PETSc/petscvec.pxi":368 * cdef PetscInt bs=1 * if blocked: * CHKERR( VecGetBlockSize(V, &bs) ) # <<<<<<<<<<<<<< * if bs < 1: bs = 1 * # indices and values */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetBlockSize(__pyx_v_V, (&__pyx_v_bs))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 368, __pyx_L1_error) /* "petsc4py/PETSc/petscvec.pxi":369 * if blocked: * CHKERR( VecGetBlockSize(V, &bs) ) * if bs < 1: bs = 1 # <<<<<<<<<<<<<< * # indices and values * cdef PetscInt ni=0, nv=0 */ __pyx_t_1 = (__pyx_v_bs < 1); if (__pyx_t_1) { __pyx_v_bs = 1; } /* "petsc4py/PETSc/petscvec.pxi":367 * # block size * cdef PetscInt bs=1 * if blocked: # <<<<<<<<<<<<<< * CHKERR( VecGetBlockSize(V, &bs) ) * if bs < 1: bs = 1 */ } /* "petsc4py/PETSc/petscvec.pxi":371 * if bs < 1: bs = 1 * # indices and values * cdef PetscInt ni=0, nv=0 # <<<<<<<<<<<<<< * cdef PetscInt *i=NULL * cdef PetscScalar *v=NULL */ __pyx_v_ni = 0; __pyx_v_nv = 0; /* "petsc4py/PETSc/petscvec.pxi":372 * # indices and values * cdef PetscInt ni=0, nv=0 * cdef PetscInt *i=NULL # <<<<<<<<<<<<<< * cdef PetscScalar *v=NULL * cdef object tmp1 = iarray_i(oi, &ni, &i) */ __pyx_v_i = NULL; /* "petsc4py/PETSc/petscvec.pxi":373 * cdef PetscInt ni=0, nv=0 * cdef PetscInt *i=NULL * cdef PetscScalar *v=NULL # <<<<<<<<<<<<<< * cdef object tmp1 = iarray_i(oi, &ni, &i) * cdef object tmp2 = iarray_s(ov, &nv, &v) */ __pyx_v_v = NULL; /* "petsc4py/PETSc/petscvec.pxi":374 * cdef PetscInt *i=NULL * cdef PetscScalar *v=NULL * cdef object tmp1 = iarray_i(oi, &ni, &i) # <<<<<<<<<<<<<< * cdef object tmp2 = iarray_s(ov, &nv, &v) * if ni*bs != nv: raise ValueError( */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_oi, (&__pyx_v_ni), (&__pyx_v_i))); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_tmp1 = __pyx_t_3; __pyx_t_3 = 0; /* "petsc4py/PETSc/petscvec.pxi":375 * cdef PetscScalar *v=NULL * cdef object tmp1 = iarray_i(oi, &ni, &i) * cdef object tmp2 = iarray_s(ov, &nv, &v) # <<<<<<<<<<<<<< * if ni*bs != nv: raise ValueError( * "incompatible array sizes: ni=%d, nv=%d, bs=%d" % */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_s(__pyx_v_ov, (&__pyx_v_nv), (&__pyx_v_v))); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_tmp2 = __pyx_t_3; __pyx_t_3 = 0; /* "petsc4py/PETSc/petscvec.pxi":376 * cdef object tmp1 = iarray_i(oi, &ni, &i) * cdef object tmp2 = iarray_s(ov, &nv, &v) * if ni*bs != nv: raise ValueError( # <<<<<<<<<<<<<< * "incompatible array sizes: ni=%d, nv=%d, bs=%d" % * (toInt(ni), toInt(nv), toInt(bs)) ) */ __pyx_t_1 = ((__pyx_v_ni * __pyx_v_bs) != __pyx_v_nv); if (unlikely(__pyx_t_1)) { /* "petsc4py/PETSc/petscvec.pxi":378 * if ni*bs != nv: raise ValueError( * "incompatible array sizes: ni=%d, nv=%d, bs=%d" % * (toInt(ni), toInt(nv), toInt(bs)) ) # <<<<<<<<<<<<<< * # VecSetValuesXXX function and insert mode * cdef VecSetValuesFcn *setvalues = vecsetvalues_fcn(blocked, local) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ni); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nv); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_bs); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3)) __PYX_ERR(7, 378, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4)) __PYX_ERR(7, 378, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_5)) __PYX_ERR(7, 378, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; /* "petsc4py/PETSc/petscvec.pxi":377 * cdef object tmp2 = iarray_s(ov, &nv, &v) * if ni*bs != nv: raise ValueError( * "incompatible array sizes: ni=%d, nv=%d, bs=%d" % # <<<<<<<<<<<<<< * (toInt(ni), toInt(nv), toInt(bs)) ) * # VecSetValuesXXX function and insert mode */ __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_incompatible_array_sizes_ni_d_nv, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "petsc4py/PETSc/petscvec.pxi":376 * cdef object tmp1 = iarray_i(oi, &ni, &i) * cdef object tmp2 = iarray_s(ov, &nv, &v) * if ni*bs != nv: raise ValueError( # <<<<<<<<<<<<<< * "incompatible array sizes: ni=%d, nv=%d, bs=%d" % * (toInt(ni), toInt(nv), toInt(bs)) ) */ __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __PYX_ERR(7, 376, __pyx_L1_error) } /* "petsc4py/PETSc/petscvec.pxi":380 * (toInt(ni), toInt(nv), toInt(bs)) ) * # VecSetValuesXXX function and insert mode * cdef VecSetValuesFcn *setvalues = vecsetvalues_fcn(blocked, local) # <<<<<<<<<<<<<< * cdef PetscInsertMode addv = insertmode(oim) * # actual call */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_vecsetvalues_fcn(__pyx_v_blocked, __pyx_v_local); if (unlikely(__pyx_t_7 == ((__pyx_t_8petsc4py_5PETSc_VecSetValuesFcn *)NULL) && PyErr_Occurred())) __PYX_ERR(7, 380, __pyx_L1_error) __pyx_v_setvalues = __pyx_t_7; /* "petsc4py/PETSc/petscvec.pxi":381 * # VecSetValuesXXX function and insert mode * cdef VecSetValuesFcn *setvalues = vecsetvalues_fcn(blocked, local) * cdef PetscInsertMode addv = insertmode(oim) # <<<<<<<<<<<<<< * # actual call * CHKERR( setvalues(V, ni, i, v, addv) ) */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_insertmode(__pyx_v_oim); if (unlikely(__pyx_t_8 == ((InsertMode)((InsertMode)-1L)))) __PYX_ERR(7, 381, __pyx_L1_error) __pyx_v_addv = __pyx_t_8; /* "petsc4py/PETSc/petscvec.pxi":383 * cdef PetscInsertMode addv = insertmode(oim) * # actual call * CHKERR( setvalues(V, ni, i, v, addv) ) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_2 = __pyx_v_setvalues(__pyx_v_V, __pyx_v_ni, __pyx_v_i, __pyx_v_v, __pyx_v_addv); if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 383, __pyx_L1_error) __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_t_2); if (unlikely(__pyx_t_9 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 383, __pyx_L1_error) /* "petsc4py/PETSc/petscvec.pxi":384 * # actual call * CHKERR( setvalues(V, ni, i, v, addv) ) * return 0 # <<<<<<<<<<<<<< * * cdef object vecgetvalues(PetscVec vec, object oindices, object values): */ __pyx_r = 0; goto __pyx_L0; /* "petsc4py/PETSc/petscvec.pxi":362 * return setvalues * * cdef inline int vecsetvalues(PetscVec V, # <<<<<<<<<<<<<< * object oi, object ov, object oim, * int blocked, int local) except -1: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.vecsetvalues", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_tmp1); __Pyx_XDECREF(__pyx_v_tmp2); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscvec.pxi":386 * return 0 * * cdef object vecgetvalues(PetscVec vec, object oindices, object values): # <<<<<<<<<<<<<< * cdef PetscInt ni=0, nv=0 * cdef PetscInt *i=NULL */ static PyObject *__pyx_f_8petsc4py_5PETSc_vecgetvalues(Vec __pyx_v_vec, PyObject *__pyx_v_oindices, PyObject *__pyx_v_values) { PetscInt __pyx_v_ni; PetscInt __pyx_v_nv; PetscInt *__pyx_v_i; PetscScalar *__pyx_v_v; PyObject *__pyx_v_indices = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PetscErrorCode __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("vecgetvalues", 0); __Pyx_INCREF(__pyx_v_values); /* "petsc4py/PETSc/petscvec.pxi":387 * * cdef object vecgetvalues(PetscVec vec, object oindices, object values): * cdef PetscInt ni=0, nv=0 # <<<<<<<<<<<<<< * cdef PetscInt *i=NULL * cdef PetscScalar *v=NULL */ __pyx_v_ni = 0; __pyx_v_nv = 0; /* "petsc4py/PETSc/petscvec.pxi":388 * cdef object vecgetvalues(PetscVec vec, object oindices, object values): * cdef PetscInt ni=0, nv=0 * cdef PetscInt *i=NULL # <<<<<<<<<<<<<< * cdef PetscScalar *v=NULL * cdef object indices = iarray_i(oindices, &ni, &i) */ __pyx_v_i = NULL; /* "petsc4py/PETSc/petscvec.pxi":389 * cdef PetscInt ni=0, nv=0 * cdef PetscInt *i=NULL * cdef PetscScalar *v=NULL # <<<<<<<<<<<<<< * cdef object indices = iarray_i(oindices, &ni, &i) * if values is None: */ __pyx_v_v = NULL; /* "petsc4py/PETSc/petscvec.pxi":390 * cdef PetscInt *i=NULL * cdef PetscScalar *v=NULL * cdef object indices = iarray_i(oindices, &ni, &i) # <<<<<<<<<<<<<< * if values is None: * values = empty_s(ni) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_oindices, (&__pyx_v_ni), (&__pyx_v_i))); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_indices = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/petscvec.pxi":391 * cdef PetscScalar *v=NULL * cdef object indices = iarray_i(oindices, &ni, &i) * if values is None: # <<<<<<<<<<<<<< * values = empty_s(ni) * values.shape = indices.shape */ __pyx_t_2 = (__pyx_v_values == Py_None); if (__pyx_t_2) { /* "petsc4py/PETSc/petscvec.pxi":392 * cdef object indices = iarray_i(oindices, &ni, &i) * if values is None: * values = empty_s(ni) # <<<<<<<<<<<<<< * values.shape = indices.shape * values = oarray_s(values, &nv, &v) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_s(__pyx_v_ni)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_values, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscvec.pxi":393 * if values is None: * values = empty_s(ni) * values.shape = indices.shape # <<<<<<<<<<<<<< * values = oarray_s(values, &nv, &v) * if (ni != nv): raise ValueError( */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_indices, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_PyObject_SetAttrStr(__pyx_v_values, __pyx_n_s_shape, __pyx_t_1) < 0) __PYX_ERR(7, 393, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscvec.pxi":391 * cdef PetscScalar *v=NULL * cdef object indices = iarray_i(oindices, &ni, &i) * if values is None: # <<<<<<<<<<<<<< * values = empty_s(ni) * values.shape = indices.shape */ } /* "petsc4py/PETSc/petscvec.pxi":394 * values = empty_s(ni) * values.shape = indices.shape * values = oarray_s(values, &nv, &v) # <<<<<<<<<<<<<< * if (ni != nv): raise ValueError( * ("incompatible array sizes: " */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_s(__pyx_v_values, (&__pyx_v_nv), (&__pyx_v_v))); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 394, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_values, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscvec.pxi":395 * values.shape = indices.shape * values = oarray_s(values, &nv, &v) * if (ni != nv): raise ValueError( # <<<<<<<<<<<<<< * ("incompatible array sizes: " * "ni=%d, nv=%d") % (toInt(ni), toInt(nv))) */ __pyx_t_2 = (__pyx_v_ni != __pyx_v_nv); if (unlikely(__pyx_t_2)) { /* "petsc4py/PETSc/petscvec.pxi":397 * if (ni != nv): raise ValueError( * ("incompatible array sizes: " * "ni=%d, nv=%d") % (toInt(ni), toInt(nv))) # <<<<<<<<<<<<<< * CHKERR( VecGetValues(vec, ni, i, v) ) * return values */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ni); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 397, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nv); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 397, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 397, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1)) __PYX_ERR(7, 397, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(7, 397, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_incompatible_array_sizes_ni_d_nv_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 397, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/petscvec.pxi":395 * values.shape = indices.shape * values = oarray_s(values, &nv, &v) * if (ni != nv): raise ValueError( # <<<<<<<<<<<<<< * ("incompatible array sizes: " * "ni=%d, nv=%d") % (toInt(ni), toInt(nv))) */ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(7, 395, __pyx_L1_error) } /* "petsc4py/PETSc/petscvec.pxi":398 * ("incompatible array sizes: " * "ni=%d, nv=%d") % (toInt(ni), toInt(nv))) * CHKERR( VecGetValues(vec, ni, i, v) ) # <<<<<<<<<<<<<< * return values * */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetValues(__pyx_v_vec, __pyx_v_ni, __pyx_v_i, __pyx_v_v)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 398, __pyx_L1_error) /* "petsc4py/PETSc/petscvec.pxi":399 * "ni=%d, nv=%d") % (toInt(ni), toInt(nv))) * CHKERR( VecGetValues(vec, ni, i, v) ) * return values # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_values); __pyx_r = __pyx_v_values; goto __pyx_L0; /* "petsc4py/PETSc/petscvec.pxi":386 * return 0 * * cdef object vecgetvalues(PetscVec vec, object oindices, object values): # <<<<<<<<<<<<<< * cdef PetscInt ni=0, nv=0 * cdef PetscInt *i=NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.vecgetvalues", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_indices); __Pyx_XDECREF(__pyx_v_values); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscvec.pxi":403 * # -------------------------------------------------------------------- * * cdef inline _Vec_buffer vec_getbuffer_r(Vec self): # <<<<<<<<<<<<<< * cdef _Vec_buffer buf = _Vec_buffer(self) * buf.readonly = 1 */ static CYTHON_INLINE struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_f_8petsc4py_5PETSc_vec_getbuffer_r(struct PyPetscVecObject *__pyx_v_self) { struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_buf = 0; struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("vec_getbuffer_r", 1); /* "petsc4py/PETSc/petscvec.pxi":404 * * cdef inline _Vec_buffer vec_getbuffer_r(Vec self): * cdef _Vec_buffer buf = _Vec_buffer(self) # <<<<<<<<<<<<<< * buf.readonly = 1 * return buf */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc__Vec_buffer), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_buf = ((struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscvec.pxi":405 * cdef inline _Vec_buffer vec_getbuffer_r(Vec self): * cdef _Vec_buffer buf = _Vec_buffer(self) * buf.readonly = 1 # <<<<<<<<<<<<<< * return buf * */ __pyx_v_buf->readonly = 1; /* "petsc4py/PETSc/petscvec.pxi":406 * cdef _Vec_buffer buf = _Vec_buffer(self) * buf.readonly = 1 * return buf # <<<<<<<<<<<<<< * * cdef inline _Vec_buffer vec_getbuffer_w(Vec self): */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_buf); __pyx_r = __pyx_v_buf; goto __pyx_L0; /* "petsc4py/PETSc/petscvec.pxi":403 * # -------------------------------------------------------------------- * * cdef inline _Vec_buffer vec_getbuffer_r(Vec self): # <<<<<<<<<<<<<< * cdef _Vec_buffer buf = _Vec_buffer(self) * buf.readonly = 1 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.vec_getbuffer_r", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_buf); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscvec.pxi":408 * return buf * * cdef inline _Vec_buffer vec_getbuffer_w(Vec self): # <<<<<<<<<<<<<< * cdef _Vec_buffer buf = _Vec_buffer(self) * buf.readonly = 0 */ static CYTHON_INLINE struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_f_8petsc4py_5PETSc_vec_getbuffer_w(struct PyPetscVecObject *__pyx_v_self) { struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_buf = 0; struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("vec_getbuffer_w", 1); /* "petsc4py/PETSc/petscvec.pxi":409 * * cdef inline _Vec_buffer vec_getbuffer_w(Vec self): * cdef _Vec_buffer buf = _Vec_buffer(self) # <<<<<<<<<<<<<< * buf.readonly = 0 * return buf */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc__Vec_buffer), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_buf = ((struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscvec.pxi":410 * cdef inline _Vec_buffer vec_getbuffer_w(Vec self): * cdef _Vec_buffer buf = _Vec_buffer(self) * buf.readonly = 0 # <<<<<<<<<<<<<< * return buf * */ __pyx_v_buf->readonly = 0; /* "petsc4py/PETSc/petscvec.pxi":411 * cdef _Vec_buffer buf = _Vec_buffer(self) * buf.readonly = 0 * return buf # <<<<<<<<<<<<<< * * cdef inline ndarray vec_getarray_r(Vec self): */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_buf); __pyx_r = __pyx_v_buf; goto __pyx_L0; /* "petsc4py/PETSc/petscvec.pxi":408 * return buf * * cdef inline _Vec_buffer vec_getbuffer_w(Vec self): # <<<<<<<<<<<<<< * cdef _Vec_buffer buf = _Vec_buffer(self) * buf.readonly = 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.vec_getbuffer_w", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_buf); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscvec.pxi":413 * return buf * * cdef inline ndarray vec_getarray_r(Vec self): # <<<<<<<<<<<<<< * return asarray(vec_getbuffer_r(self)) * */ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_vec_getarray_r(struct PyPetscVecObject *__pyx_v_self) { PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("vec_getarray_r", 1); /* "petsc4py/PETSc/petscvec.pxi":414 * * cdef inline ndarray vec_getarray_r(Vec self): * return asarray(vec_getbuffer_r(self)) # <<<<<<<<<<<<<< * * cdef inline ndarray vec_getarray_w(Vec self): */ __Pyx_XDECREF((PyObject *)__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_getbuffer_r(__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_asarray(__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/petscvec.pxi":413 * return buf * * cdef inline ndarray vec_getarray_r(Vec self): # <<<<<<<<<<<<<< * return asarray(vec_getbuffer_r(self)) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.vec_getarray_r", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscvec.pxi":416 * return asarray(vec_getbuffer_r(self)) * * cdef inline ndarray vec_getarray_w(Vec self): # <<<<<<<<<<<<<< * return asarray(vec_getbuffer_w(self)) * */ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_vec_getarray_w(struct PyPetscVecObject *__pyx_v_self) { PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("vec_getarray_w", 1); /* "petsc4py/PETSc/petscvec.pxi":417 * * cdef inline ndarray vec_getarray_w(Vec self): * return asarray(vec_getbuffer_w(self)) # <<<<<<<<<<<<<< * * cdef inline int vec_setarray(Vec self, object o) except -1: */ __Pyx_XDECREF((PyObject *)__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_getbuffer_w(__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_asarray(__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/petscvec.pxi":416 * return asarray(vec_getbuffer_r(self)) * * cdef inline ndarray vec_getarray_w(Vec self): # <<<<<<<<<<<<<< * return asarray(vec_getbuffer_w(self)) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.vec_getarray_w", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscvec.pxi":419 * return asarray(vec_getbuffer_w(self)) * * cdef inline int vec_setarray(Vec self, object o) except -1: # <<<<<<<<<<<<<< * cdef PetscInt na=0, nv=0, i=0 * cdef PetscScalar *va=NULL, *vv=NULL */ static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_vec_setarray(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_o) { PetscInt __pyx_v_na; PetscInt __pyx_v_nv; PetscInt __pyx_v_i; PetscScalar *__pyx_v_va; PetscScalar *__pyx_v_vv; PyArrayObject *__pyx_v_ary = 0; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PetscInt __pyx_t_7; int __pyx_t_8; int __pyx_t_9; char const *__pyx_t_10; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("vec_setarray", 1); /* "petsc4py/PETSc/petscvec.pxi":420 * * cdef inline int vec_setarray(Vec self, object o) except -1: * cdef PetscInt na=0, nv=0, i=0 # <<<<<<<<<<<<<< * cdef PetscScalar *va=NULL, *vv=NULL * cdef ndarray ary = iarray_s(o, &na, &va) */ __pyx_v_na = 0; __pyx_v_nv = 0; __pyx_v_i = 0; /* "petsc4py/PETSc/petscvec.pxi":421 * cdef inline int vec_setarray(Vec self, object o) except -1: * cdef PetscInt na=0, nv=0, i=0 * cdef PetscScalar *va=NULL, *vv=NULL # <<<<<<<<<<<<<< * cdef ndarray ary = iarray_s(o, &na, &va) * CHKERR( VecGetLocalSize(self.vec, &nv) ) */ __pyx_v_va = NULL; __pyx_v_vv = NULL; /* "petsc4py/PETSc/petscvec.pxi":422 * cdef PetscInt na=0, nv=0, i=0 * cdef PetscScalar *va=NULL, *vv=NULL * cdef ndarray ary = iarray_s(o, &na, &va) # <<<<<<<<<<<<<< * CHKERR( VecGetLocalSize(self.vec, &nv) ) * if (na != nv) and PyArray_NDIM(ary) > 0: raise ValueError( */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_s(__pyx_v_o, (&__pyx_v_na), (&__pyx_v_va))); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ary = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscvec.pxi":423 * cdef PetscScalar *va=NULL, *vv=NULL * cdef ndarray ary = iarray_s(o, &na, &va) * CHKERR( VecGetLocalSize(self.vec, &nv) ) # <<<<<<<<<<<<<< * if (na != nv) and PyArray_NDIM(ary) > 0: raise ValueError( * "array size %d incompatible with vector local size %d" % */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetLocalSize(__pyx_v_self->vec, (&__pyx_v_nv))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 423, __pyx_L1_error) /* "petsc4py/PETSc/petscvec.pxi":424 * cdef ndarray ary = iarray_s(o, &na, &va) * CHKERR( VecGetLocalSize(self.vec, &nv) ) * if (na != nv) and PyArray_NDIM(ary) > 0: raise ValueError( # <<<<<<<<<<<<<< * "array size %d incompatible with vector local size %d" % * (toInt(na), toInt(nv)) ) */ __pyx_t_4 = (__pyx_v_na != __pyx_v_nv); if (__pyx_t_4) { } else { __pyx_t_3 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = (PyArray_NDIM(__pyx_v_ary) > 0); __pyx_t_3 = __pyx_t_4; __pyx_L4_bool_binop_done:; if (unlikely(__pyx_t_3)) { /* "petsc4py/PETSc/petscvec.pxi":426 * if (na != nv) and PyArray_NDIM(ary) > 0: raise ValueError( * "array size %d incompatible with vector local size %d" % * (toInt(na), toInt(nv)) ) # <<<<<<<<<<<<<< * CHKERR( VecGetArray(self.vec, &vv) ) * try: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_na); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 426, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nv); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 426, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 426, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1)) __PYX_ERR(7, 426, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5)) __PYX_ERR(7, 426, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_5 = 0; /* "petsc4py/PETSc/petscvec.pxi":425 * CHKERR( VecGetLocalSize(self.vec, &nv) ) * if (na != nv) and PyArray_NDIM(ary) > 0: raise ValueError( * "array size %d incompatible with vector local size %d" % # <<<<<<<<<<<<<< * (toInt(na), toInt(nv)) ) * CHKERR( VecGetArray(self.vec, &vv) ) */ __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_array_size_d_incompatible_with_v, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "petsc4py/PETSc/petscvec.pxi":424 * cdef ndarray ary = iarray_s(o, &na, &va) * CHKERR( VecGetLocalSize(self.vec, &nv) ) * if (na != nv) and PyArray_NDIM(ary) > 0: raise ValueError( # <<<<<<<<<<<<<< * "array size %d incompatible with vector local size %d" % * (toInt(na), toInt(nv)) ) */ __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 424, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __PYX_ERR(7, 424, __pyx_L1_error) } /* "petsc4py/PETSc/petscvec.pxi":427 * "array size %d incompatible with vector local size %d" % * (toInt(na), toInt(nv)) ) * CHKERR( VecGetArray(self.vec, &vv) ) # <<<<<<<<<<<<<< * try: * if PyArray_NDIM(ary) == 0: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetArray(__pyx_v_self->vec, (&__pyx_v_vv))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 427, __pyx_L1_error) /* "petsc4py/PETSc/petscvec.pxi":428 * (toInt(na), toInt(nv)) ) * CHKERR( VecGetArray(self.vec, &vv) ) * try: # <<<<<<<<<<<<<< * if PyArray_NDIM(ary) == 0: * for i from 0 <= i < nv: */ /*try:*/ { /* "petsc4py/PETSc/petscvec.pxi":429 * CHKERR( VecGetArray(self.vec, &vv) ) * try: * if PyArray_NDIM(ary) == 0: # <<<<<<<<<<<<<< * for i from 0 <= i < nv: * vv[i] = va[0] */ __pyx_t_3 = (PyArray_NDIM(__pyx_v_ary) == 0); if (__pyx_t_3) { /* "petsc4py/PETSc/petscvec.pxi":430 * try: * if PyArray_NDIM(ary) == 0: * for i from 0 <= i < nv: # <<<<<<<<<<<<<< * vv[i] = va[0] * else: */ __pyx_t_7 = __pyx_v_nv; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) { /* "petsc4py/PETSc/petscvec.pxi":431 * if PyArray_NDIM(ary) == 0: * for i from 0 <= i < nv: * vv[i] = va[0] # <<<<<<<<<<<<<< * else: * CHKERR( PetscMemcpy(vv, va, nv*sizeof(PetscScalar)) ) */ (__pyx_v_vv[__pyx_v_i]) = (__pyx_v_va[0]); } /* "petsc4py/PETSc/petscvec.pxi":429 * CHKERR( VecGetArray(self.vec, &vv) ) * try: * if PyArray_NDIM(ary) == 0: # <<<<<<<<<<<<<< * for i from 0 <= i < nv: * vv[i] = va[0] */ goto __pyx_L9; } /* "petsc4py/PETSc/petscvec.pxi":433 * vv[i] = va[0] * else: * CHKERR( PetscMemcpy(vv, va, nv*sizeof(PetscScalar)) ) # <<<<<<<<<<<<<< * finally: * CHKERR( VecRestoreArray(self.vec, &vv) ) */ /*else*/ { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMemcpy(__pyx_v_vv, __pyx_v_va, (((size_t)__pyx_v_nv) * (sizeof(PetscScalar))))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 433, __pyx_L7_error) } __pyx_L9:; } /* "petsc4py/PETSc/petscvec.pxi":435 * CHKERR( PetscMemcpy(vv, va, nv*sizeof(PetscScalar)) ) * finally: * CHKERR( VecRestoreArray(self.vec, &vv) ) # <<<<<<<<<<<<<< * return 0 * */ /*finally:*/ { /*normal exit:*/{ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecRestoreArray(__pyx_v_self->vec, (&__pyx_v_vv))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 435, __pyx_L1_error) goto __pyx_L8; } __pyx_L7_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13) < 0)) __Pyx_ErrFetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_16); __pyx_t_8 = __pyx_lineno; __pyx_t_9 = __pyx_clineno; __pyx_t_10 = __pyx_filename; { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecRestoreArray(__pyx_v_self->vec, (&__pyx_v_vv))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 435, __pyx_L13_error) } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16); } __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ErrRestore(__pyx_t_11, __pyx_t_12, __pyx_t_13); __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_9; __pyx_filename = __pyx_t_10; goto __pyx_L1_error; __pyx_L13_error:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16); } __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; goto __pyx_L1_error; } __pyx_L8:; } /* "petsc4py/PETSc/petscvec.pxi":436 * finally: * CHKERR( VecRestoreArray(self.vec, &vv) ) * return 0 # <<<<<<<<<<<<<< * * cdef object vec_getitem(Vec self, object i): */ __pyx_r = 0; goto __pyx_L0; /* "petsc4py/PETSc/petscvec.pxi":419 * return asarray(vec_getbuffer_w(self)) * * cdef inline int vec_setarray(Vec self, object o) except -1: # <<<<<<<<<<<<<< * cdef PetscInt na=0, nv=0, i=0 * cdef PetscScalar *va=NULL, *vv=NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.vec_setarray", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ary); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscvec.pxi":438 * return 0 * * cdef object vec_getitem(Vec self, object i): # <<<<<<<<<<<<<< * cdef PetscInt N=0 * if i is Ellipsis: */ static PyObject *__pyx_f_8petsc4py_5PETSc_vec_getitem(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_i) { PetscInt __pyx_v_N; PyObject *__pyx_v_start = NULL; PyObject *__pyx_v_stop = NULL; PyObject *__pyx_v_stride = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *(*__pyx_t_9)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("vec_getitem", 0); __Pyx_INCREF(__pyx_v_i); /* "petsc4py/PETSc/petscvec.pxi":439 * * cdef object vec_getitem(Vec self, object i): * cdef PetscInt N=0 # <<<<<<<<<<<<<< * if i is Ellipsis: * return asarray(self) */ __pyx_v_N = 0; /* "petsc4py/PETSc/petscvec.pxi":440 * cdef object vec_getitem(Vec self, object i): * cdef PetscInt N=0 * if i is Ellipsis: # <<<<<<<<<<<<<< * return asarray(self) * if isinstance(i, slice): */ __pyx_t_1 = (__pyx_v_i == __pyx_builtin_Ellipsis); if (__pyx_t_1) { /* "petsc4py/PETSc/petscvec.pxi":441 * cdef PetscInt N=0 * if i is Ellipsis: * return asarray(self) # <<<<<<<<<<<<<< * if isinstance(i, slice): * CHKERR( VecGetSize(self.vec, &N) ) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_asarray(((PyObject *)__pyx_v_self))); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 441, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/petscvec.pxi":440 * cdef object vec_getitem(Vec self, object i): * cdef PetscInt N=0 * if i is Ellipsis: # <<<<<<<<<<<<<< * return asarray(self) * if isinstance(i, slice): */ } /* "petsc4py/PETSc/petscvec.pxi":442 * if i is Ellipsis: * return asarray(self) * if isinstance(i, slice): # <<<<<<<<<<<<<< * CHKERR( VecGetSize(self.vec, &N) ) * start, stop, stride = i.indices(toInt(N)) */ __pyx_t_1 = PySlice_Check(__pyx_v_i); if (__pyx_t_1) { /* "petsc4py/PETSc/petscvec.pxi":443 * return asarray(self) * if isinstance(i, slice): * CHKERR( VecGetSize(self.vec, &N) ) # <<<<<<<<<<<<<< * start, stop, stride = i.indices(toInt(N)) * i = arange(start, stop, stride) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetSize(__pyx_v_self->vec, (&__pyx_v_N))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 443, __pyx_L1_error) /* "petsc4py/PETSc/petscvec.pxi":444 * if isinstance(i, slice): * CHKERR( VecGetSize(self.vec, &N) ) * start, stop, stride = i.indices(toInt(N)) # <<<<<<<<<<<<<< * i = arange(start, stop, stride) * return vecgetvalues(self.vec, i, None) */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_indices); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_N); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_5}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { PyObject* sequence = __pyx_t_2; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(7, 444, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_4 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); index = 0; __pyx_t_4 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 1; __pyx_t_5 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 2; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 3) < 0) __PYX_ERR(7, 444, __pyx_L1_error) __pyx_t_9 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_9 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(7, 444, __pyx_L1_error) __pyx_L6_unpacking_done:; } __pyx_v_start = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_stop = __pyx_t_5; __pyx_t_5 = 0; __pyx_v_stride = __pyx_t_6; __pyx_t_6 = 0; /* "petsc4py/PETSc/petscvec.pxi":445 * CHKERR( VecGetSize(self.vec, &N) ) * start, stop, stride = i.indices(toInt(N)) * i = arange(start, stop, stride) # <<<<<<<<<<<<<< * return vecgetvalues(self.vec, i, None) * */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_arange(__pyx_v_start, __pyx_v_stop, __pyx_v_stride)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_i, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscvec.pxi":442 * if i is Ellipsis: * return asarray(self) * if isinstance(i, slice): # <<<<<<<<<<<<<< * CHKERR( VecGetSize(self.vec, &N) ) * start, stop, stride = i.indices(toInt(N)) */ } /* "petsc4py/PETSc/petscvec.pxi":446 * start, stop, stride = i.indices(toInt(N)) * i = arange(start, stop, stride) * return vecgetvalues(self.vec, i, None) # <<<<<<<<<<<<<< * * cdef int vec_setitem(Vec self, object i, object v) except -1: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_vecgetvalues(__pyx_v_self->vec, __pyx_v_i, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 446, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/petscvec.pxi":438 * return 0 * * cdef object vec_getitem(Vec self, object i): # <<<<<<<<<<<<<< * cdef PetscInt N=0 * if i is Ellipsis: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("petsc4py.PETSc.vec_getitem", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_start); __Pyx_XDECREF(__pyx_v_stop); __Pyx_XDECREF(__pyx_v_stride); __Pyx_XDECREF(__pyx_v_i); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscvec.pxi":448 * return vecgetvalues(self.vec, i, None) * * cdef int vec_setitem(Vec self, object i, object v) except -1: # <<<<<<<<<<<<<< * cdef PetscInt N=0 * if i is Ellipsis: */ static int __pyx_f_8petsc4py_5PETSc_vec_setitem(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_i, PyObject *__pyx_v_v) { PetscInt __pyx_v_N; PyObject *__pyx_v_start = NULL; PyObject *__pyx_v_stop = NULL; PyObject *__pyx_v_stride = NULL; int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PetscErrorCode __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *(*__pyx_t_9)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("vec_setitem", 0); __Pyx_INCREF(__pyx_v_i); /* "petsc4py/PETSc/petscvec.pxi":449 * * cdef int vec_setitem(Vec self, object i, object v) except -1: * cdef PetscInt N=0 # <<<<<<<<<<<<<< * if i is Ellipsis: * return vec_setarray(self, v) */ __pyx_v_N = 0; /* "petsc4py/PETSc/petscvec.pxi":450 * cdef int vec_setitem(Vec self, object i, object v) except -1: * cdef PetscInt N=0 * if i is Ellipsis: # <<<<<<<<<<<<<< * return vec_setarray(self, v) * if isinstance(i, slice): */ __pyx_t_1 = (__pyx_v_i == __pyx_builtin_Ellipsis); if (__pyx_t_1) { /* "petsc4py/PETSc/petscvec.pxi":451 * cdef PetscInt N=0 * if i is Ellipsis: * return vec_setarray(self, v) # <<<<<<<<<<<<<< * if isinstance(i, slice): * CHKERR( VecGetSize(self.vec, &N) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_vec_setarray(__pyx_v_self, __pyx_v_v); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(7, 451, __pyx_L1_error) __pyx_r = __pyx_t_2; goto __pyx_L0; /* "petsc4py/PETSc/petscvec.pxi":450 * cdef int vec_setitem(Vec self, object i, object v) except -1: * cdef PetscInt N=0 * if i is Ellipsis: # <<<<<<<<<<<<<< * return vec_setarray(self, v) * if isinstance(i, slice): */ } /* "petsc4py/PETSc/petscvec.pxi":452 * if i is Ellipsis: * return vec_setarray(self, v) * if isinstance(i, slice): # <<<<<<<<<<<<<< * CHKERR( VecGetSize(self.vec, &N) ) * start, stop, stride = i.indices(toInt(N)) */ __pyx_t_1 = PySlice_Check(__pyx_v_i); if (__pyx_t_1) { /* "petsc4py/PETSc/petscvec.pxi":453 * return vec_setarray(self, v) * if isinstance(i, slice): * CHKERR( VecGetSize(self.vec, &N) ) # <<<<<<<<<<<<<< * start, stop, stride = i.indices(toInt(N)) * i = arange(start, stop, stride) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetSize(__pyx_v_self->vec, (&__pyx_v_N))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 453, __pyx_L1_error) /* "petsc4py/PETSc/petscvec.pxi":454 * if isinstance(i, slice): * CHKERR( VecGetSize(self.vec, &N) ) * start, stop, stride = i.indices(toInt(N)) # <<<<<<<<<<<<<< * i = arange(start, stop, stride) * vecsetvalues(self.vec, i, v, None, 0, 0) */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_indices); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 454, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_N); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 454, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_2 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_2 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_6}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_2, 1+__pyx_t_2); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 454, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { PyObject* sequence = __pyx_t_4; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(7, 454, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_7 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_6 = PyList_GET_ITEM(sequence, 1); __pyx_t_7 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); #else __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 454, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 454, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 454, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { Py_ssize_t index = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 454, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); index = 0; __pyx_t_5 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 1; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); index = 2; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_7); if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 3) < 0) __PYX_ERR(7, 454, __pyx_L1_error) __pyx_t_9 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_9 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(7, 454, __pyx_L1_error) __pyx_L6_unpacking_done:; } __pyx_v_start = __pyx_t_5; __pyx_t_5 = 0; __pyx_v_stop = __pyx_t_6; __pyx_t_6 = 0; __pyx_v_stride = __pyx_t_7; __pyx_t_7 = 0; /* "petsc4py/PETSc/petscvec.pxi":455 * CHKERR( VecGetSize(self.vec, &N) ) * start, stop, stride = i.indices(toInt(N)) * i = arange(start, stop, stride) # <<<<<<<<<<<<<< * vecsetvalues(self.vec, i, v, None, 0, 0) * return 0 */ __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_arange(__pyx_v_start, __pyx_v_stop, __pyx_v_stride)); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 455, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_i, __pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/petscvec.pxi":452 * if i is Ellipsis: * return vec_setarray(self, v) * if isinstance(i, slice): # <<<<<<<<<<<<<< * CHKERR( VecGetSize(self.vec, &N) ) * start, stop, stride = i.indices(toInt(N)) */ } /* "petsc4py/PETSc/petscvec.pxi":456 * start, stop, stride = i.indices(toInt(N)) * i = arange(start, stop, stride) * vecsetvalues(self.vec, i, v, None, 0, 0) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_vecsetvalues(__pyx_v_self->vec, __pyx_v_i, __pyx_v_v, Py_None, 0, 0); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(7, 456, __pyx_L1_error) /* "petsc4py/PETSc/petscvec.pxi":457 * i = arange(start, stop, stride) * vecsetvalues(self.vec, i, v, None, 0, 0) * return 0 # <<<<<<<<<<<<<< * * cdef vec_get_dlpack_ctx(Vec self): */ __pyx_r = 0; goto __pyx_L0; /* "petsc4py/PETSc/petscvec.pxi":448 * return vecgetvalues(self.vec, i, None) * * cdef int vec_setitem(Vec self, object i, object v) except -1: # <<<<<<<<<<<<<< * cdef PetscInt N=0 * if i is Ellipsis: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("petsc4py.PETSc.vec_setitem", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_start); __Pyx_XDECREF(__pyx_v_stop); __Pyx_XDECREF(__pyx_v_stride); __Pyx_XDECREF(__pyx_v_i); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscvec.pxi":459 * return 0 * * cdef vec_get_dlpack_ctx(Vec self): # <<<<<<<<<<<<<< * cdef object ctx0 = self.get_attr('__dltensor_ctx__') * cdef PetscInt n = 0 */ static PyObject *__pyx_f_8petsc4py_5PETSc_vec_get_dlpack_ctx(struct PyPetscVecObject *__pyx_v_self) { PyObject *__pyx_v_ctx0 = 0; PetscInt __pyx_v_n; int64_t __pyx_v_ndim; int64_t *__pyx_v_shape_arr; int64_t *__pyx_v_strides_arr; PyObject *__pyx_v_s1 = 0; PyObject *__pyx_v_s2 = 0; PetscInt __pyx_v_devId; PetscMemType __pyx_v_mtype; CYTHON_UNUSED PyObject *__pyx_v__ = NULL; PyObject *__pyx_v_devType_ = NULL; PyObject *__pyx_v_dtype = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PetscErrorCode __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *(*__pyx_t_9)(PyObject *); int64_t __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("vec_get_dlpack_ctx", 1); /* "petsc4py/PETSc/petscvec.pxi":460 * * cdef vec_get_dlpack_ctx(Vec self): * cdef object ctx0 = self.get_attr('__dltensor_ctx__') # <<<<<<<<<<<<<< * cdef PetscInt n = 0 * cdef int64_t ndim = 1 */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Vec *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__dltensor_ctx__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 460, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ctx0 = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/petscvec.pxi":461 * cdef vec_get_dlpack_ctx(Vec self): * cdef object ctx0 = self.get_attr('__dltensor_ctx__') * cdef PetscInt n = 0 # <<<<<<<<<<<<<< * cdef int64_t ndim = 1 * cdef int64_t* shape_arr = NULL */ __pyx_v_n = 0; /* "petsc4py/PETSc/petscvec.pxi":462 * cdef object ctx0 = self.get_attr('__dltensor_ctx__') * cdef PetscInt n = 0 * cdef int64_t ndim = 1 # <<<<<<<<<<<<<< * cdef int64_t* shape_arr = NULL * cdef int64_t* strides_arr = NULL */ __pyx_v_ndim = 1; /* "petsc4py/PETSc/petscvec.pxi":463 * cdef PetscInt n = 0 * cdef int64_t ndim = 1 * cdef int64_t* shape_arr = NULL # <<<<<<<<<<<<<< * cdef int64_t* strides_arr = NULL * cdef object s1 = None */ __pyx_v_shape_arr = NULL; /* "petsc4py/PETSc/petscvec.pxi":464 * cdef int64_t ndim = 1 * cdef int64_t* shape_arr = NULL * cdef int64_t* strides_arr = NULL # <<<<<<<<<<<<<< * cdef object s1 = None * cdef object s2 = None */ __pyx_v_strides_arr = NULL; /* "petsc4py/PETSc/petscvec.pxi":465 * cdef int64_t* shape_arr = NULL * cdef int64_t* strides_arr = NULL * cdef object s1 = None # <<<<<<<<<<<<<< * cdef object s2 = None * cdef PetscInt devId = 0 */ __Pyx_INCREF(Py_None); __pyx_v_s1 = Py_None; /* "petsc4py/PETSc/petscvec.pxi":466 * cdef int64_t* strides_arr = NULL * cdef object s1 = None * cdef object s2 = None # <<<<<<<<<<<<<< * cdef PetscInt devId = 0 * cdef PetscMemType mtype = PETSC_MEMTYPE_HOST */ __Pyx_INCREF(Py_None); __pyx_v_s2 = Py_None; /* "petsc4py/PETSc/petscvec.pxi":467 * cdef object s1 = None * cdef object s2 = None * cdef PetscInt devId = 0 # <<<<<<<<<<<<<< * cdef PetscMemType mtype = PETSC_MEMTYPE_HOST * if ctx0 is None: # First time in, create a linear memory view */ __pyx_v_devId = 0; /* "petsc4py/PETSc/petscvec.pxi":468 * cdef object s2 = None * cdef PetscInt devId = 0 * cdef PetscMemType mtype = PETSC_MEMTYPE_HOST # <<<<<<<<<<<<<< * if ctx0 is None: # First time in, create a linear memory view * s1 = oarray_p(empty_p(ndim), NULL, &shape_arr) */ __pyx_v_mtype = PETSC_MEMTYPE_HOST; /* "petsc4py/PETSc/petscvec.pxi":469 * cdef PetscInt devId = 0 * cdef PetscMemType mtype = PETSC_MEMTYPE_HOST * if ctx0 is None: # First time in, create a linear memory view # <<<<<<<<<<<<<< * s1 = oarray_p(empty_p(ndim), NULL, &shape_arr) * s2 = oarray_p(empty_p(ndim), NULL, &strides_arr) */ __pyx_t_2 = (__pyx_v_ctx0 == Py_None); if (__pyx_t_2) { /* "petsc4py/PETSc/petscvec.pxi":470 * cdef PetscMemType mtype = PETSC_MEMTYPE_HOST * if ctx0 is None: # First time in, create a linear memory view * s1 = oarray_p(empty_p(ndim), NULL, &shape_arr) # <<<<<<<<<<<<<< * s2 = oarray_p(empty_p(ndim), NULL, &strides_arr) * CHKERR( VecGetLocalSize(self.vec, &n) ) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_1, NULL, ((void **)(&__pyx_v_shape_arr)))); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_s1, __pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/petscvec.pxi":471 * if ctx0 is None: # First time in, create a linear memory view * s1 = oarray_p(empty_p(ndim), NULL, &shape_arr) * s2 = oarray_p(empty_p(ndim), NULL, &strides_arr) # <<<<<<<<<<<<<< * CHKERR( VecGetLocalSize(self.vec, &n) ) * shape_arr[0] = n */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_ndim)); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_3, NULL, ((void **)(&__pyx_v_strides_arr)))); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_s2, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscvec.pxi":472 * s1 = oarray_p(empty_p(ndim), NULL, &shape_arr) * s2 = oarray_p(empty_p(ndim), NULL, &strides_arr) * CHKERR( VecGetLocalSize(self.vec, &n) ) # <<<<<<<<<<<<<< * shape_arr[0] = n * strides_arr[0] = 1 */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetLocalSize(__pyx_v_self->vec, (&__pyx_v_n))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 472, __pyx_L1_error) /* "petsc4py/PETSc/petscvec.pxi":473 * s2 = oarray_p(empty_p(ndim), NULL, &strides_arr) * CHKERR( VecGetLocalSize(self.vec, &n) ) * shape_arr[0] = n # <<<<<<<<<<<<<< * strides_arr[0] = 1 * else: */ (__pyx_v_shape_arr[0]) = ((int64_t)__pyx_v_n); /* "petsc4py/PETSc/petscvec.pxi":474 * CHKERR( VecGetLocalSize(self.vec, &n) ) * shape_arr[0] = n * strides_arr[0] = 1 # <<<<<<<<<<<<<< * else: * (_, _, ndim, s1, s2) = ctx0 */ (__pyx_v_strides_arr[0]) = 1; /* "petsc4py/PETSc/petscvec.pxi":469 * cdef PetscInt devId = 0 * cdef PetscMemType mtype = PETSC_MEMTYPE_HOST * if ctx0 is None: # First time in, create a linear memory view # <<<<<<<<<<<<<< * s1 = oarray_p(empty_p(ndim), NULL, &shape_arr) * s2 = oarray_p(empty_p(ndim), NULL, &strides_arr) */ goto __pyx_L3; } /* "petsc4py/PETSc/petscvec.pxi":476 * strides_arr[0] = 1 * else: * (_, _, ndim, s1, s2) = ctx0 # <<<<<<<<<<<<<< * * devType_ = { PETSC_MEMTYPE_HOST : kDLCPU, PETSC_MEMTYPE_CUDA : kDLCUDA, PETSC_MEMTYPE_HIP : kDLROCM } */ /*else*/ { if ((likely(PyTuple_CheckExact(__pyx_v_ctx0))) || (PyList_CheckExact(__pyx_v_ctx0))) { PyObject* sequence = __pyx_v_ctx0; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 5)) { if (size > 5) __Pyx_RaiseTooManyValuesError(5); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(7, 476, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 3); __pyx_t_7 = PyTuple_GET_ITEM(sequence, 4); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); __pyx_t_5 = PyList_GET_ITEM(sequence, 2); __pyx_t_6 = PyList_GET_ITEM(sequence, 3); __pyx_t_7 = PyList_GET_ITEM(sequence, 4); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); #else { Py_ssize_t i; PyObject** temps[5] = {&__pyx_t_1,&__pyx_t_3,&__pyx_t_5,&__pyx_t_6,&__pyx_t_7}; for (i=0; i < 5; i++) { PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(7, 476, __pyx_L1_error) __Pyx_GOTREF(item); *(temps[i]) = item; } } #endif } else { Py_ssize_t index = -1; PyObject** temps[5] = {&__pyx_t_1,&__pyx_t_3,&__pyx_t_5,&__pyx_t_6,&__pyx_t_7}; __pyx_t_8 = PyObject_GetIter(__pyx_v_ctx0); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 476, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); for (index=0; index < 5; index++) { PyObject* item = __pyx_t_9(__pyx_t_8); if (unlikely(!item)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(item); *(temps[index]) = item; } if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 5) < 0) __PYX_ERR(7, 476, __pyx_L1_error) __pyx_t_9 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L5_unpacking_done; __pyx_L4_unpacking_failed:; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_9 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(7, 476, __pyx_L1_error) __pyx_L5_unpacking_done:; } __pyx_t_10 = __Pyx_PyInt_As_int64_t(__pyx_t_5); if (unlikely((__pyx_t_10 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(7, 476, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v__ = __pyx_t_1; __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v__, __pyx_t_3); __pyx_t_3 = 0; __pyx_v_ndim = __pyx_t_10; __Pyx_DECREF_SET(__pyx_v_s1, __pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF_SET(__pyx_v_s2, __pyx_t_7); __pyx_t_7 = 0; } __pyx_L3:; /* "petsc4py/PETSc/petscvec.pxi":478 * (_, _, ndim, s1, s2) = ctx0 * * devType_ = { PETSC_MEMTYPE_HOST : kDLCPU, PETSC_MEMTYPE_CUDA : kDLCUDA, PETSC_MEMTYPE_HIP : kDLROCM } # <<<<<<<<<<<<<< * CHKERR( VecGetCurrentMemType(self.vec, &mtype) ) * dtype = devType_.get(mtype, kDLCPU) */ __pyx_t_7 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = __Pyx_PyInt_From_PetscMemType(PETSC_MEMTYPE_HOST); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyInt_From_enum____pyx_t_8petsc4py_5PETSc_PetscDLDeviceType(__pyx_e_8petsc4py_5PETSc_kDLCPU); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_7, __pyx_t_6, __pyx_t_5) < 0) __PYX_ERR(7, 478, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyInt_From_PetscMemType(PETSC_MEMTYPE_CUDA); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyInt_From_enum____pyx_t_8petsc4py_5PETSc_PetscDLDeviceType(__pyx_e_8petsc4py_5PETSc_kDLCUDA); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_7, __pyx_t_5, __pyx_t_6) < 0) __PYX_ERR(7, 478, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyInt_From_PetscMemType(PETSC_MEMTYPE_HIP); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyInt_From_enum____pyx_t_8petsc4py_5PETSc_PetscDLDeviceType(__pyx_e_8petsc4py_5PETSc_kDLROCM); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_7, __pyx_t_6, __pyx_t_5) < 0) __PYX_ERR(7, 478, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_devType_ = ((PyObject*)__pyx_t_7); __pyx_t_7 = 0; /* "petsc4py/PETSc/petscvec.pxi":479 * * devType_ = { PETSC_MEMTYPE_HOST : kDLCPU, PETSC_MEMTYPE_CUDA : kDLCUDA, PETSC_MEMTYPE_HIP : kDLROCM } * CHKERR( VecGetCurrentMemType(self.vec, &mtype) ) # <<<<<<<<<<<<<< * dtype = devType_.get(mtype, kDLCPU) * if dtype != kDLCPU: */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetCurrentMemType(__pyx_v_self->vec, (&__pyx_v_mtype))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 479, __pyx_L1_error) /* "petsc4py/PETSc/petscvec.pxi":480 * devType_ = { PETSC_MEMTYPE_HOST : kDLCPU, PETSC_MEMTYPE_CUDA : kDLCUDA, PETSC_MEMTYPE_HIP : kDLROCM } * CHKERR( VecGetCurrentMemType(self.vec, &mtype) ) * dtype = devType_.get(mtype, kDLCPU) # <<<<<<<<<<<<<< * if dtype != kDLCPU: * CHKERR( PetscObjectGetDeviceId(self.vec, &devId) ) */ __pyx_t_7 = __Pyx_PyInt_From_PetscMemType(__pyx_v_mtype); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_5 = __Pyx_PyInt_From_enum____pyx_t_8petsc4py_5PETSc_PetscDLDeviceType(__pyx_e_8petsc4py_5PETSc_kDLCPU); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyDict_GetItemDefault(__pyx_v_devType_, __pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_dtype = __pyx_t_6; __pyx_t_6 = 0; /* "petsc4py/PETSc/petscvec.pxi":481 * CHKERR( VecGetCurrentMemType(self.vec, &mtype) ) * dtype = devType_.get(mtype, kDLCPU) * if dtype != kDLCPU: # <<<<<<<<<<<<<< * CHKERR( PetscObjectGetDeviceId(self.vec, &devId) ) * ctx0 = (dtype, devId, ndim, s1, s2) */ __pyx_t_6 = __Pyx_PyInt_From_enum____pyx_t_8petsc4py_5PETSc_PetscDLDeviceType(__pyx_e_8petsc4py_5PETSc_kDLCPU); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 481, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = PyObject_RichCompare(__pyx_v_dtype, __pyx_t_6, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 481, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(7, 481, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_2) { /* "petsc4py/PETSc/petscvec.pxi":482 * dtype = devType_.get(mtype, kDLCPU) * if dtype != kDLCPU: * CHKERR( PetscObjectGetDeviceId(self.vec, &devId) ) # <<<<<<<<<<<<<< * ctx0 = (dtype, devId, ndim, s1, s2) * self.set_attr('__dltensor_ctx__', ctx0) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectGetDeviceId(((PetscObject)__pyx_v_self->vec), (&__pyx_v_devId))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 482, __pyx_L1_error) /* "petsc4py/PETSc/petscvec.pxi":481 * CHKERR( VecGetCurrentMemType(self.vec, &mtype) ) * dtype = devType_.get(mtype, kDLCPU) * if dtype != kDLCPU: # <<<<<<<<<<<<<< * CHKERR( PetscObjectGetDeviceId(self.vec, &devId) ) * ctx0 = (dtype, devId, ndim, s1, s2) */ } /* "petsc4py/PETSc/petscvec.pxi":483 * if dtype != kDLCPU: * CHKERR( PetscObjectGetDeviceId(self.vec, &devId) ) * ctx0 = (dtype, devId, ndim, s1, s2) # <<<<<<<<<<<<<< * self.set_attr('__dltensor_ctx__', ctx0) * return ctx0 */ __pyx_t_5 = __Pyx_PyInt_From_PetscInt(__pyx_v_devId); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 483, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyInt_From_int64_t(__pyx_v_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 483, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PyTuple_New(5); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 483, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_v_dtype); __Pyx_GIVEREF(__pyx_v_dtype); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_dtype)) __PYX_ERR(7, 483, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_5)) __PYX_ERR(7, 483, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_6)) __PYX_ERR(7, 483, __pyx_L1_error); __Pyx_INCREF(__pyx_v_s1); __Pyx_GIVEREF(__pyx_v_s1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_v_s1)) __PYX_ERR(7, 483, __pyx_L1_error); __Pyx_INCREF(__pyx_v_s2); __Pyx_GIVEREF(__pyx_v_s2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 4, __pyx_v_s2)) __PYX_ERR(7, 483, __pyx_L1_error); __pyx_t_5 = 0; __pyx_t_6 = 0; __Pyx_DECREF_SET(__pyx_v_ctx0, __pyx_t_7); __pyx_t_7 = 0; /* "petsc4py/PETSc/petscvec.pxi":484 * CHKERR( PetscObjectGetDeviceId(self.vec, &devId) ) * ctx0 = (dtype, devId, ndim, s1, s2) * self.set_attr('__dltensor_ctx__', ctx0) # <<<<<<<<<<<<<< * return ctx0 * */ __pyx_t_7 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Vec *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__dltensor_ctx__"), __pyx_v_ctx0); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 484, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "petsc4py/PETSc/petscvec.pxi":485 * ctx0 = (dtype, devId, ndim, s1, s2) * self.set_attr('__dltensor_ctx__', ctx0) * return ctx0 # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_ctx0); __pyx_r = __pyx_v_ctx0; goto __pyx_L0; /* "petsc4py/PETSc/petscvec.pxi":459 * return 0 * * cdef vec_get_dlpack_ctx(Vec self): # <<<<<<<<<<<<<< * cdef object ctx0 = self.get_attr('__dltensor_ctx__') * cdef PetscInt n = 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("petsc4py.PETSc.vec_get_dlpack_ctx", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ctx0); __Pyx_XDECREF(__pyx_v_s1); __Pyx_XDECREF(__pyx_v_s2); __Pyx_XDECREF(__pyx_v__); __Pyx_XDECREF(__pyx_v_devType_); __Pyx_XDECREF(__pyx_v_dtype); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscvec.pxi":489 * # -------------------------------------------------------------------- * * cdef int Vec_AcquireArray(PetscVec v, PetscScalar *a[], int ro) except -1 nogil: # <<<<<<<<<<<<<< * if ro: CHKERR( VecGetArrayRead(v, a) ) * else: CHKERR( VecGetArray(v, a) ) */ static int __pyx_f_8petsc4py_5PETSc_Vec_AcquireArray(Vec __pyx_v_v, PetscScalar **__pyx_v_a, int __pyx_v_ro) { int __pyx_r; int __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save; #endif /* "petsc4py/PETSc/petscvec.pxi":490 * * cdef int Vec_AcquireArray(PetscVec v, PetscScalar *a[], int ro) except -1 nogil: * if ro: CHKERR( VecGetArrayRead(v, a) ) # <<<<<<<<<<<<<< * else: CHKERR( VecGetArray(v, a) ) * return 0 */ __pyx_t_1 = (__pyx_v_ro != 0); if (__pyx_t_1) { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetArrayRead(__pyx_v_v, ((PetscScalar const **)__pyx_v_a))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 490, __pyx_L1_error) goto __pyx_L3; } /* "petsc4py/PETSc/petscvec.pxi":491 * cdef int Vec_AcquireArray(PetscVec v, PetscScalar *a[], int ro) except -1 nogil: * if ro: CHKERR( VecGetArrayRead(v, a) ) * else: CHKERR( VecGetArray(v, a) ) # <<<<<<<<<<<<<< * return 0 * */ /*else*/ { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetArray(__pyx_v_v, __pyx_v_a)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 491, __pyx_L1_error) } __pyx_L3:; /* "petsc4py/PETSc/petscvec.pxi":492 * if ro: CHKERR( VecGetArrayRead(v, a) ) * else: CHKERR( VecGetArray(v, a) ) * return 0 # <<<<<<<<<<<<<< * * cdef int Vec_ReleaseArray(PetscVec v, PetscScalar *a[], int ro) except -1 nogil: */ __pyx_r = 0; goto __pyx_L0; /* "petsc4py/PETSc/petscvec.pxi":489 * # -------------------------------------------------------------------- * * cdef int Vec_AcquireArray(PetscVec v, PetscScalar *a[], int ro) except -1 nogil: # <<<<<<<<<<<<<< * if ro: CHKERR( VecGetArrayRead(v, a) ) * else: CHKERR( VecGetArray(v, a) ) */ /* function exit code */ __pyx_L1_error:; #ifdef WITH_THREAD __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_AddTraceback("petsc4py.PETSc.Vec_AcquireArray", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/petscvec.pxi":494 * return 0 * * cdef int Vec_ReleaseArray(PetscVec v, PetscScalar *a[], int ro) except -1 nogil: # <<<<<<<<<<<<<< * if ro: CHKERR( VecRestoreArrayRead(v, a) ) * else: CHKERR( VecRestoreArray(v, a) ) */ static int __pyx_f_8petsc4py_5PETSc_Vec_ReleaseArray(Vec __pyx_v_v, PetscScalar **__pyx_v_a, int __pyx_v_ro) { int __pyx_r; int __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save; #endif /* "petsc4py/PETSc/petscvec.pxi":495 * * cdef int Vec_ReleaseArray(PetscVec v, PetscScalar *a[], int ro) except -1 nogil: * if ro: CHKERR( VecRestoreArrayRead(v, a) ) # <<<<<<<<<<<<<< * else: CHKERR( VecRestoreArray(v, a) ) * return 0 */ __pyx_t_1 = (__pyx_v_ro != 0); if (__pyx_t_1) { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecRestoreArrayRead(__pyx_v_v, ((PetscScalar const **)__pyx_v_a))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 495, __pyx_L1_error) goto __pyx_L3; } /* "petsc4py/PETSc/petscvec.pxi":496 * cdef int Vec_ReleaseArray(PetscVec v, PetscScalar *a[], int ro) except -1 nogil: * if ro: CHKERR( VecRestoreArrayRead(v, a) ) * else: CHKERR( VecRestoreArray(v, a) ) # <<<<<<<<<<<<<< * return 0 * */ /*else*/ { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecRestoreArray(__pyx_v_v, __pyx_v_a)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 496, __pyx_L1_error) } __pyx_L3:; /* "petsc4py/PETSc/petscvec.pxi":497 * if ro: CHKERR( VecRestoreArrayRead(v, a) ) * else: CHKERR( VecRestoreArray(v, a) ) * return 0 # <<<<<<<<<<<<<< * * cdef class _Vec_buffer: */ __pyx_r = 0; goto __pyx_L0; /* "petsc4py/PETSc/petscvec.pxi":494 * return 0 * * cdef int Vec_ReleaseArray(PetscVec v, PetscScalar *a[], int ro) except -1 nogil: # <<<<<<<<<<<<<< * if ro: CHKERR( VecRestoreArrayRead(v, a) ) * else: CHKERR( VecRestoreArray(v, a) ) */ /* function exit code */ __pyx_L1_error:; #ifdef WITH_THREAD __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_AddTraceback("petsc4py.PETSc.Vec_ReleaseArray", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/petscvec.pxi":507 * cdef bint hasarray * * def __cinit__(self, Vec vec, bint readonly=0): # <<<<<<<<<<<<<< * cdef PetscVec v = vec.vec * CHKERR( PetscINCREF(&v) ) */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_vec = 0; int __pyx_v_readonly; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec,&__pyx_n_s_readonly,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vec)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 507, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_readonly); if (value) { values[1] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 507, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__cinit__") < 0)) __PYX_ERR(7, 507, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_vec = ((struct PyPetscVecObject *)values[0]); if (values[1]) { __pyx_v_readonly = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_readonly == (int)-1) && PyErr_Occurred())) __PYX_ERR(7, 507, __pyx_L3_error) } else { __pyx_v_readonly = ((int)0); } } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 2, __pyx_nargs); __PYX_ERR(7, 507, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc._Vec_buffer.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(7, 507, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_11_Vec_buffer___cinit__(((struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_self), __pyx_v_vec, __pyx_v_readonly); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = -1; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_11_Vec_buffer___cinit__(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec, int __pyx_v_readonly) { Vec __pyx_v_v; int __pyx_r; Vec __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "petsc4py/PETSc/petscvec.pxi":508 * * def __cinit__(self, Vec vec, bint readonly=0): * cdef PetscVec v = vec.vec # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(&v) ) * self.vec = v */ __pyx_t_1 = __pyx_v_vec->vec; __pyx_v_v = __pyx_t_1; /* "petsc4py/PETSc/petscvec.pxi":509 * def __cinit__(self, Vec vec, bint readonly=0): * cdef PetscVec v = vec.vec * CHKERR( PetscINCREF(&v) ) # <<<<<<<<<<<<<< * self.vec = v * self.size = 0 */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(((PetscObject *)(&__pyx_v_v)))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 509, __pyx_L1_error) /* "petsc4py/PETSc/petscvec.pxi":510 * cdef PetscVec v = vec.vec * CHKERR( PetscINCREF(&v) ) * self.vec = v # <<<<<<<<<<<<<< * self.size = 0 * self.data = NULL */ __pyx_v_self->vec = __pyx_v_v; /* "petsc4py/PETSc/petscvec.pxi":511 * CHKERR( PetscINCREF(&v) ) * self.vec = v * self.size = 0 # <<<<<<<<<<<<<< * self.data = NULL * self.readonly = 1 if readonly else 0 */ __pyx_v_self->size = 0; /* "petsc4py/PETSc/petscvec.pxi":512 * self.vec = v * self.size = 0 * self.data = NULL # <<<<<<<<<<<<<< * self.readonly = 1 if readonly else 0 * self.hasarray = 0 */ __pyx_v_self->data = NULL; /* "petsc4py/PETSc/petscvec.pxi":513 * self.size = 0 * self.data = NULL * self.readonly = 1 if readonly else 0 # <<<<<<<<<<<<<< * self.hasarray = 0 * */ if (__pyx_v_readonly) { __pyx_t_3 = 1; } else { __pyx_t_3 = 0; } __pyx_v_self->readonly = __pyx_t_3; /* "petsc4py/PETSc/petscvec.pxi":514 * self.data = NULL * self.readonly = 1 if readonly else 0 * self.hasarray = 0 # <<<<<<<<<<<<<< * * def __dealloc__(self): */ __pyx_v_self->hasarray = 0; /* "petsc4py/PETSc/petscvec.pxi":507 * cdef bint hasarray * * def __cinit__(self, Vec vec, bint readonly=0): # <<<<<<<<<<<<<< * cdef PetscVec v = vec.vec * CHKERR( PetscINCREF(&v) ) */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc._Vec_buffer.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/petscvec.pxi":516 * self.hasarray = 0 * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self.hasarray and self.vec != NULL: * Vec_ReleaseArray(self.vec, &self.data, self.readonly) */ /* Python wrapper */ static void __pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_3__dealloc__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_2__dealloc__(((struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_2__dealloc__(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self) { int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "petsc4py/PETSc/petscvec.pxi":517 * * def __dealloc__(self): * if self.hasarray and self.vec != NULL: # <<<<<<<<<<<<<< * Vec_ReleaseArray(self.vec, &self.data, self.readonly) * CHKERR( VecDestroy(&self.vec) ) */ if (__pyx_v_self->hasarray) { } else { __pyx_t_1 = __pyx_v_self->hasarray; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = (__pyx_v_self->vec != NULL); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "petsc4py/PETSc/petscvec.pxi":518 * def __dealloc__(self): * if self.hasarray and self.vec != NULL: * Vec_ReleaseArray(self.vec, &self.data, self.readonly) # <<<<<<<<<<<<<< * CHKERR( VecDestroy(&self.vec) ) * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_Vec_ReleaseArray(__pyx_v_self->vec, (&__pyx_v_self->data), __pyx_v_self->readonly); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(7, 518, __pyx_L1_error) /* "petsc4py/PETSc/petscvec.pxi":517 * * def __dealloc__(self): * if self.hasarray and self.vec != NULL: # <<<<<<<<<<<<<< * Vec_ReleaseArray(self.vec, &self.data, self.readonly) * CHKERR( VecDestroy(&self.vec) ) */ } /* "petsc4py/PETSc/petscvec.pxi":519 * if self.hasarray and self.vec != NULL: * Vec_ReleaseArray(self.vec, &self.data, self.readonly) * CHKERR( VecDestroy(&self.vec) ) # <<<<<<<<<<<<<< * * # */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecDestroy((&__pyx_v_self->vec))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 519, __pyx_L1_error) /* "petsc4py/PETSc/petscvec.pxi":516 * self.hasarray = 0 * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self.hasarray and self.vec != NULL: * Vec_ReleaseArray(self.vec, &self.data, self.readonly) */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_WriteUnraisable("petsc4py.PETSc._Vec_buffer.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_L0:; } /* "petsc4py/PETSc/petscvec.pxi":523 * # * * cdef int acquire(self) except -1 nogil: # <<<<<<<<<<<<<< * if not self.hasarray and self.vec != NULL: * CHKERR( VecGetLocalSize(self.vec, &self.size) ) */ static int __pyx_f_8petsc4py_5PETSc_11_Vec_buffer_acquire(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self) { int __pyx_r; int __pyx_t_1; int __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save; #endif /* "petsc4py/PETSc/petscvec.pxi":524 * * cdef int acquire(self) except -1 nogil: * if not self.hasarray and self.vec != NULL: # <<<<<<<<<<<<<< * CHKERR( VecGetLocalSize(self.vec, &self.size) ) * Vec_AcquireArray(self.vec, &self.data, self.readonly) */ __pyx_t_2 = (!__pyx_v_self->hasarray); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = (__pyx_v_self->vec != NULL); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "petsc4py/PETSc/petscvec.pxi":525 * cdef int acquire(self) except -1 nogil: * if not self.hasarray and self.vec != NULL: * CHKERR( VecGetLocalSize(self.vec, &self.size) ) # <<<<<<<<<<<<<< * Vec_AcquireArray(self.vec, &self.data, self.readonly) * self.hasarray = 1 */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetLocalSize(__pyx_v_self->vec, (&__pyx_v_self->size))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 525, __pyx_L1_error) /* "petsc4py/PETSc/petscvec.pxi":526 * if not self.hasarray and self.vec != NULL: * CHKERR( VecGetLocalSize(self.vec, &self.size) ) * Vec_AcquireArray(self.vec, &self.data, self.readonly) # <<<<<<<<<<<<<< * self.hasarray = 1 * return 0 */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_Vec_AcquireArray(__pyx_v_self->vec, (&__pyx_v_self->data), __pyx_v_self->readonly); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(7, 526, __pyx_L1_error) /* "petsc4py/PETSc/petscvec.pxi":527 * CHKERR( VecGetLocalSize(self.vec, &self.size) ) * Vec_AcquireArray(self.vec, &self.data, self.readonly) * self.hasarray = 1 # <<<<<<<<<<<<<< * return 0 * */ __pyx_v_self->hasarray = 1; /* "petsc4py/PETSc/petscvec.pxi":524 * * cdef int acquire(self) except -1 nogil: * if not self.hasarray and self.vec != NULL: # <<<<<<<<<<<<<< * CHKERR( VecGetLocalSize(self.vec, &self.size) ) * Vec_AcquireArray(self.vec, &self.data, self.readonly) */ } /* "petsc4py/PETSc/petscvec.pxi":528 * Vec_AcquireArray(self.vec, &self.data, self.readonly) * self.hasarray = 1 * return 0 # <<<<<<<<<<<<<< * * cdef int release(self) except -1 nogil: */ __pyx_r = 0; goto __pyx_L0; /* "petsc4py/PETSc/petscvec.pxi":523 * # * * cdef int acquire(self) except -1 nogil: # <<<<<<<<<<<<<< * if not self.hasarray and self.vec != NULL: * CHKERR( VecGetLocalSize(self.vec, &self.size) ) */ /* function exit code */ __pyx_L1_error:; #ifdef WITH_THREAD __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_AddTraceback("petsc4py.PETSc._Vec_buffer.acquire", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/petscvec.pxi":530 * return 0 * * cdef int release(self) except -1 nogil: # <<<<<<<<<<<<<< * if self.hasarray and self.vec != NULL: * self.size = 0 */ static int __pyx_f_8petsc4py_5PETSc_11_Vec_buffer_release(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self) { int __pyx_r; int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save; #endif /* "petsc4py/PETSc/petscvec.pxi":531 * * cdef int release(self) except -1 nogil: * if self.hasarray and self.vec != NULL: # <<<<<<<<<<<<<< * self.size = 0 * Vec_ReleaseArray(self.vec, &self.data, self.readonly) */ if (__pyx_v_self->hasarray) { } else { __pyx_t_1 = __pyx_v_self->hasarray; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = (__pyx_v_self->vec != NULL); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "petsc4py/PETSc/petscvec.pxi":532 * cdef int release(self) except -1 nogil: * if self.hasarray and self.vec != NULL: * self.size = 0 # <<<<<<<<<<<<<< * Vec_ReleaseArray(self.vec, &self.data, self.readonly) * self.hasarray = 0 */ __pyx_v_self->size = 0; /* "petsc4py/PETSc/petscvec.pxi":533 * if self.hasarray and self.vec != NULL: * self.size = 0 * Vec_ReleaseArray(self.vec, &self.data, self.readonly) # <<<<<<<<<<<<<< * self.hasarray = 0 * return 0 */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_Vec_ReleaseArray(__pyx_v_self->vec, (&__pyx_v_self->data), __pyx_v_self->readonly); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(7, 533, __pyx_L1_error) /* "petsc4py/PETSc/petscvec.pxi":534 * self.size = 0 * Vec_ReleaseArray(self.vec, &self.data, self.readonly) * self.hasarray = 0 # <<<<<<<<<<<<<< * return 0 * */ __pyx_v_self->hasarray = 0; /* "petsc4py/PETSc/petscvec.pxi":531 * * cdef int release(self) except -1 nogil: * if self.hasarray and self.vec != NULL: # <<<<<<<<<<<<<< * self.size = 0 * Vec_ReleaseArray(self.vec, &self.data, self.readonly) */ } /* "petsc4py/PETSc/petscvec.pxi":535 * Vec_ReleaseArray(self.vec, &self.data, self.readonly) * self.hasarray = 0 * return 0 # <<<<<<<<<<<<<< * * # buffer interface (PEP 3118) */ __pyx_r = 0; goto __pyx_L0; /* "petsc4py/PETSc/petscvec.pxi":530 * return 0 * * cdef int release(self) except -1 nogil: # <<<<<<<<<<<<<< * if self.hasarray and self.vec != NULL: * self.size = 0 */ /* function exit code */ __pyx_L1_error:; #ifdef WITH_THREAD __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_AddTraceback("petsc4py.PETSc._Vec_buffer.release", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/petscvec.pxi":539 * # buffer interface (PEP 3118) * * cdef int acquirebuffer(self, Py_buffer *view, int flags) except -1: # <<<<<<<<<<<<<< * self.acquire() * PyPetscBuffer_FillInfo(view, self.data, self.size, */ static int __pyx_f_8petsc4py_5PETSc_11_Vec_buffer_acquirebuffer(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self, Py_buffer *__pyx_v_view, int __pyx_v_flags) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("acquirebuffer", 1); /* "petsc4py/PETSc/petscvec.pxi":540 * * cdef int acquirebuffer(self, Py_buffer *view, int flags) except -1: * self.acquire() # <<<<<<<<<<<<<< * PyPetscBuffer_FillInfo(view, self.data, self.size, * c's', self.readonly, flags) */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_self->__pyx_vtab)->acquire(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 540, __pyx_L1_error) /* "petsc4py/PETSc/petscvec.pxi":541 * cdef int acquirebuffer(self, Py_buffer *view, int flags) except -1: * self.acquire() * PyPetscBuffer_FillInfo(view, self.data, self.size, # <<<<<<<<<<<<<< * c's', self.readonly, flags) * view.obj = self */ __pyx_t_1 = PyPetscBuffer_FillInfo(__pyx_v_view, ((void *)__pyx_v_self->data), __pyx_v_self->size, 's', __pyx_v_self->readonly, __pyx_v_flags); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 541, __pyx_L1_error) /* "petsc4py/PETSc/petscvec.pxi":543 * PyPetscBuffer_FillInfo(view, self.data, self.size, * c's', self.readonly, flags) * view.obj = self # <<<<<<<<<<<<<< * return 0 * */ __Pyx_INCREF((PyObject *)__pyx_v_self); __Pyx_GIVEREF((PyObject *)__pyx_v_self); __Pyx_GOTREF(__pyx_v_view->obj); __Pyx_DECREF(__pyx_v_view->obj); __pyx_v_view->obj = ((PyObject *)__pyx_v_self); /* "petsc4py/PETSc/petscvec.pxi":544 * c's', self.readonly, flags) * view.obj = self * return 0 # <<<<<<<<<<<<<< * * cdef int releasebuffer(self, Py_buffer *view) except -1: */ __pyx_r = 0; goto __pyx_L0; /* "petsc4py/PETSc/petscvec.pxi":539 * # buffer interface (PEP 3118) * * cdef int acquirebuffer(self, Py_buffer *view, int flags) except -1: # <<<<<<<<<<<<<< * self.acquire() * PyPetscBuffer_FillInfo(view, self.data, self.size, */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc._Vec_buffer.acquirebuffer", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscvec.pxi":546 * return 0 * * cdef int releasebuffer(self, Py_buffer *view) except -1: # <<<<<<<<<<<<<< * PyPetscBuffer_Release(view) * self.release() */ static int __pyx_f_8petsc4py_5PETSc_11_Vec_buffer_releasebuffer(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self, Py_buffer *__pyx_v_view) { int __pyx_r; int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "petsc4py/PETSc/petscvec.pxi":547 * * cdef int releasebuffer(self, Py_buffer *view) except -1: * PyPetscBuffer_Release(view) # <<<<<<<<<<<<<< * self.release() * return 0 */ PyPetscBuffer_Release(__pyx_v_view); /* "petsc4py/PETSc/petscvec.pxi":548 * cdef int releasebuffer(self, Py_buffer *view) except -1: * PyPetscBuffer_Release(view) * self.release() # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_self->__pyx_vtab)->release(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 548, __pyx_L1_error) /* "petsc4py/PETSc/petscvec.pxi":549 * PyPetscBuffer_Release(view) * self.release() * return 0 # <<<<<<<<<<<<<< * * def __getbuffer__(self, Py_buffer *view, int flags): */ __pyx_r = 0; goto __pyx_L0; /* "petsc4py/PETSc/petscvec.pxi":546 * return 0 * * cdef int releasebuffer(self, Py_buffer *view) except -1: # <<<<<<<<<<<<<< * PyPetscBuffer_Release(view) * self.release() */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc._Vec_buffer.releasebuffer", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/petscvec.pxi":551 * return 0 * * def __getbuffer__(self, Py_buffer *view, int flags): # <<<<<<<<<<<<<< * self.acquirebuffer(view, flags) * */ /* Python wrapper */ CYTHON_UNUSED static int __pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_5__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_view, int __pyx_v_flags); /*proto*/ CYTHON_UNUSED static int __pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_5__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_view, int __pyx_v_flags) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_4__getbuffer__(((struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_self), ((Py_buffer *)__pyx_v_view), ((int)__pyx_v_flags)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_4__getbuffer__(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self, Py_buffer *__pyx_v_view, int __pyx_v_flags) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; if (unlikely(__pyx_v_view == NULL)) { PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete"); return -1; } __Pyx_RefNannySetupContext("__getbuffer__", 0); __pyx_v_view->obj = Py_None; __Pyx_INCREF(Py_None); __Pyx_GIVEREF(__pyx_v_view->obj); /* "petsc4py/PETSc/petscvec.pxi":552 * * def __getbuffer__(self, Py_buffer *view, int flags): * self.acquirebuffer(view, flags) # <<<<<<<<<<<<<< * * def __releasebuffer__(self, Py_buffer *view): */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_self->__pyx_vtab)->acquirebuffer(__pyx_v_self, __pyx_v_view, __pyx_v_flags); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 552, __pyx_L1_error) /* "petsc4py/PETSc/petscvec.pxi":551 * return 0 * * def __getbuffer__(self, Py_buffer *view, int flags): # <<<<<<<<<<<<<< * self.acquirebuffer(view, flags) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc._Vec_buffer.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; if (__pyx_v_view->obj != NULL) { __Pyx_GOTREF(__pyx_v_view->obj); __Pyx_DECREF(__pyx_v_view->obj); __pyx_v_view->obj = 0; } goto __pyx_L2; __pyx_L0:; if (__pyx_v_view->obj == Py_None) { __Pyx_GOTREF(__pyx_v_view->obj); __Pyx_DECREF(__pyx_v_view->obj); __pyx_v_view->obj = 0; } __pyx_L2:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscvec.pxi":554 * self.acquirebuffer(view, flags) * * def __releasebuffer__(self, Py_buffer *view): # <<<<<<<<<<<<<< * self.releasebuffer(view) * */ /* Python wrapper */ CYTHON_UNUSED static void __pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_7__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_view); /*proto*/ CYTHON_UNUSED static void __pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_7__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_view) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_6__releasebuffer__(((struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_self), ((Py_buffer *)__pyx_v_view)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_6__releasebuffer__(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self, Py_buffer *__pyx_v_view) { int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "petsc4py/PETSc/petscvec.pxi":555 * * def __releasebuffer__(self, Py_buffer *view): * self.releasebuffer(view) # <<<<<<<<<<<<<< * * # 'with' statement (PEP 343) */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_self->__pyx_vtab)->releasebuffer(__pyx_v_self, __pyx_v_view); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 555, __pyx_L1_error) /* "petsc4py/PETSc/petscvec.pxi":554 * self.acquirebuffer(view, flags) * * def __releasebuffer__(self, Py_buffer *view): # <<<<<<<<<<<<<< * self.releasebuffer(view) * */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_WriteUnraisable("petsc4py.PETSc._Vec_buffer.__releasebuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_L0:; } /* "petsc4py/PETSc/petscvec.pxi":559 * # 'with' statement (PEP 343) * * cdef object enter(self): # <<<<<<<<<<<<<< * self.acquire() * return asarray(self) */ static PyObject *__pyx_f_8petsc4py_5PETSc_11_Vec_buffer_enter(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("enter", 1); /* "petsc4py/PETSc/petscvec.pxi":560 * * cdef object enter(self): * self.acquire() # <<<<<<<<<<<<<< * return asarray(self) * */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_self->__pyx_vtab)->acquire(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 560, __pyx_L1_error) /* "petsc4py/PETSc/petscvec.pxi":561 * cdef object enter(self): * self.acquire() * return asarray(self) # <<<<<<<<<<<<<< * * cdef object exit(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_asarray(((PyObject *)__pyx_v_self))); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 561, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/petscvec.pxi":559 * # 'with' statement (PEP 343) * * cdef object enter(self): # <<<<<<<<<<<<<< * self.acquire() * return asarray(self) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc._Vec_buffer.enter", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscvec.pxi":563 * return asarray(self) * * cdef object exit(self): # <<<<<<<<<<<<<< * self.release() * return None */ static PyObject *__pyx_f_8petsc4py_5PETSc_11_Vec_buffer_exit(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("exit", 1); /* "petsc4py/PETSc/petscvec.pxi":564 * * cdef object exit(self): * self.release() # <<<<<<<<<<<<<< * return None * */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_self->__pyx_vtab)->release(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 564, __pyx_L1_error) /* "petsc4py/PETSc/petscvec.pxi":565 * cdef object exit(self): * self.release() * return None # <<<<<<<<<<<<<< * * def __enter__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "petsc4py/PETSc/petscvec.pxi":563 * return asarray(self) * * cdef object exit(self): # <<<<<<<<<<<<<< * self.release() * return None */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc._Vec_buffer.exit", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscvec.pxi":567 * return None * * def __enter__(self): # <<<<<<<<<<<<<< * return self.enter() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_9__enter__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_11_Vec_buffer_8__enter__, "_Vec_buffer.__enter__(self)\nSource code at petsc4py/PETSc/petscvec.pxi:567"); static PyObject *__pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_9__enter__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__enter__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__enter__", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_8__enter__(((struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_8__enter__(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__enter__", 1); /* "petsc4py/PETSc/petscvec.pxi":568 * * def __enter__(self): * return self.enter() # <<<<<<<<<<<<<< * * def __exit__(self, *exc): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_self->__pyx_vtab)->enter(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/petscvec.pxi":567 * return None * * def __enter__(self): # <<<<<<<<<<<<<< * return self.enter() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc._Vec_buffer.__enter__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscvec.pxi":570 * return self.enter() * * def __exit__(self, *exc): # <<<<<<<<<<<<<< * return self.exit() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_11__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_11_Vec_buffer_10__exit__, "_Vec_buffer.__exit__(self, *exc)\nSource code at petsc4py/PETSc/petscvec.pxi:570"); static PyObject *__pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_11__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED PyObject *__pyx_v_exc = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__exit__", 0))) return NULL; __Pyx_INCREF(__pyx_args); __pyx_v_exc = __pyx_args; __pyx_r = __pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_10__exit__(((struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_self), __pyx_v_exc); /* function exit code */ __Pyx_DECREF(__pyx_v_exc); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_10__exit__(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__exit__", 1); /* "petsc4py/PETSc/petscvec.pxi":571 * * def __exit__(self, *exc): * return self.exit() # <<<<<<<<<<<<<< * * # buffer interface (legacy) */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_self->__pyx_vtab)->exit(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 571, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/petscvec.pxi":570 * return self.enter() * * def __exit__(self, *exc): # <<<<<<<<<<<<<< * return self.exit() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc._Vec_buffer.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscvec.pxi":575 * # buffer interface (legacy) * * cdef Py_ssize_t getbuffer(self, void **p) except -1: # <<<<<<<<<<<<<< * cdef PetscInt n = 0 * if p != NULL: */ static Py_ssize_t __pyx_f_8petsc4py_5PETSc_11_Vec_buffer_getbuffer(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self, void **__pyx_v_p) { PetscInt __pyx_v_n; Py_ssize_t __pyx_r; int __pyx_t_1; int __pyx_t_2; PetscInt __pyx_t_3; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "petsc4py/PETSc/petscvec.pxi":576 * * cdef Py_ssize_t getbuffer(self, void **p) except -1: * cdef PetscInt n = 0 # <<<<<<<<<<<<<< * if p != NULL: * self.acquire() */ __pyx_v_n = 0; /* "petsc4py/PETSc/petscvec.pxi":577 * cdef Py_ssize_t getbuffer(self, void **p) except -1: * cdef PetscInt n = 0 * if p != NULL: # <<<<<<<<<<<<<< * self.acquire() * p[0] = self.data */ __pyx_t_1 = (__pyx_v_p != NULL); if (__pyx_t_1) { /* "petsc4py/PETSc/petscvec.pxi":578 * cdef PetscInt n = 0 * if p != NULL: * self.acquire() # <<<<<<<<<<<<<< * p[0] = self.data * n = self.size */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_self->__pyx_vtab)->acquire(__pyx_v_self); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(7, 578, __pyx_L1_error) /* "petsc4py/PETSc/petscvec.pxi":579 * if p != NULL: * self.acquire() * p[0] = self.data # <<<<<<<<<<<<<< * n = self.size * elif self.vec != NULL: */ (__pyx_v_p[0]) = ((void *)__pyx_v_self->data); /* "petsc4py/PETSc/petscvec.pxi":580 * self.acquire() * p[0] = self.data * n = self.size # <<<<<<<<<<<<<< * elif self.vec != NULL: * CHKERR( VecGetLocalSize(self.vec, &n) ) */ __pyx_t_3 = __pyx_v_self->size; __pyx_v_n = __pyx_t_3; /* "petsc4py/PETSc/petscvec.pxi":577 * cdef Py_ssize_t getbuffer(self, void **p) except -1: * cdef PetscInt n = 0 * if p != NULL: # <<<<<<<<<<<<<< * self.acquire() * p[0] = self.data */ goto __pyx_L3; } /* "petsc4py/PETSc/petscvec.pxi":581 * p[0] = self.data * n = self.size * elif self.vec != NULL: # <<<<<<<<<<<<<< * CHKERR( VecGetLocalSize(self.vec, &n) ) * return (n*sizeof(PetscScalar)) */ __pyx_t_1 = (__pyx_v_self->vec != NULL); if (__pyx_t_1) { /* "petsc4py/PETSc/petscvec.pxi":582 * n = self.size * elif self.vec != NULL: * CHKERR( VecGetLocalSize(self.vec, &n) ) # <<<<<<<<<<<<<< * return (n*sizeof(PetscScalar)) * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetLocalSize(__pyx_v_self->vec, (&__pyx_v_n))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 582, __pyx_L1_error) /* "petsc4py/PETSc/petscvec.pxi":581 * p[0] = self.data * n = self.size * elif self.vec != NULL: # <<<<<<<<<<<<<< * CHKERR( VecGetLocalSize(self.vec, &n) ) * return (n*sizeof(PetscScalar)) */ } __pyx_L3:; /* "petsc4py/PETSc/petscvec.pxi":583 * elif self.vec != NULL: * CHKERR( VecGetLocalSize(self.vec, &n) ) * return (n*sizeof(PetscScalar)) # <<<<<<<<<<<<<< * * def __getsegcount__(self, Py_ssize_t *lenp): */ __pyx_r = ((Py_ssize_t)(((size_t)__pyx_v_n) * (sizeof(PetscScalar)))); goto __pyx_L0; /* "petsc4py/PETSc/petscvec.pxi":575 * # buffer interface (legacy) * * cdef Py_ssize_t getbuffer(self, void **p) except -1: # <<<<<<<<<<<<<< * cdef PetscInt n = 0 * if p != NULL: */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc._Vec_buffer.getbuffer", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1L; __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/petscvec.pxi":585 * return (n*sizeof(PetscScalar)) * * def __getsegcount__(self, Py_ssize_t *lenp): # <<<<<<<<<<<<<< * if lenp != NULL: * lenp[0] = self.getbuffer(NULL) */ /* Python wrapper */ #if PY_MAJOR_VERSION < 3 static Py_ssize_t __pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_13__getsegcount__(PyObject *__pyx_v_self, Py_ssize_t *__pyx_v_lenp); /*proto*/ static Py_ssize_t __pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_13__getsegcount__(PyObject *__pyx_v_self, Py_ssize_t *__pyx_v_lenp) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getsegcount__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_12__getsegcount__(((struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_self), ((Py_ssize_t *)__pyx_v_lenp)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } #endif /*!(#if PY_MAJOR_VERSION < 3)*/ #if PY_MAJOR_VERSION < 3 static Py_ssize_t __pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_12__getsegcount__(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self, Py_ssize_t *__pyx_v_lenp) { Py_ssize_t __pyx_r; int __pyx_t_1; Py_ssize_t __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "petsc4py/PETSc/petscvec.pxi":586 * * def __getsegcount__(self, Py_ssize_t *lenp): * if lenp != NULL: # <<<<<<<<<<<<<< * lenp[0] = self.getbuffer(NULL) * return 1 */ __pyx_t_1 = (__pyx_v_lenp != NULL); if (__pyx_t_1) { /* "petsc4py/PETSc/petscvec.pxi":587 * def __getsegcount__(self, Py_ssize_t *lenp): * if lenp != NULL: * lenp[0] = self.getbuffer(NULL) # <<<<<<<<<<<<<< * return 1 * */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_self->__pyx_vtab)->getbuffer(__pyx_v_self, NULL); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1L))) __PYX_ERR(7, 587, __pyx_L1_error) (__pyx_v_lenp[0]) = __pyx_t_2; /* "petsc4py/PETSc/petscvec.pxi":586 * * def __getsegcount__(self, Py_ssize_t *lenp): * if lenp != NULL: # <<<<<<<<<<<<<< * lenp[0] = self.getbuffer(NULL) * return 1 */ } /* "petsc4py/PETSc/petscvec.pxi":588 * if lenp != NULL: * lenp[0] = self.getbuffer(NULL) * return 1 # <<<<<<<<<<<<<< * * def __getreadbuffer__(self, Py_ssize_t idx, void **p): */ __pyx_r = 1; goto __pyx_L0; /* "petsc4py/PETSc/petscvec.pxi":585 * return (n*sizeof(PetscScalar)) * * def __getsegcount__(self, Py_ssize_t *lenp): # <<<<<<<<<<<<<< * if lenp != NULL: * lenp[0] = self.getbuffer(NULL) */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc._Vec_buffer.__getsegcount__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } #endif /*!(#if PY_MAJOR_VERSION < 3)*/ /* "petsc4py/PETSc/petscvec.pxi":590 * return 1 * * def __getreadbuffer__(self, Py_ssize_t idx, void **p): # <<<<<<<<<<<<<< * if idx != 0: raise SystemError( * "accessing non-existent buffer segment") */ /* Python wrapper */ #if PY_MAJOR_VERSION < 3 static Py_ssize_t __pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_15__getreadbuffer__(PyObject *__pyx_v_self, Py_ssize_t __pyx_v_idx, void **__pyx_v_p); /*proto*/ static Py_ssize_t __pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_15__getreadbuffer__(PyObject *__pyx_v_self, Py_ssize_t __pyx_v_idx, void **__pyx_v_p) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getreadbuffer__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_14__getreadbuffer__(((struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_self), ((Py_ssize_t)__pyx_v_idx), ((void **)__pyx_v_p)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } #endif /*!(#if PY_MAJOR_VERSION < 3)*/ #if PY_MAJOR_VERSION < 3 static Py_ssize_t __pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_14__getreadbuffer__(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self, Py_ssize_t __pyx_v_idx, void **__pyx_v_p) { Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getreadbuffer__", 1); /* "petsc4py/PETSc/petscvec.pxi":591 * * def __getreadbuffer__(self, Py_ssize_t idx, void **p): * if idx != 0: raise SystemError( # <<<<<<<<<<<<<< * "accessing non-existent buffer segment") * return self.getbuffer(p) */ __pyx_t_1 = (__pyx_v_idx != 0); if (unlikely(__pyx_t_1)) { __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_SystemError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 591, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(7, 591, __pyx_L1_error) } /* "petsc4py/PETSc/petscvec.pxi":593 * if idx != 0: raise SystemError( * "accessing non-existent buffer segment") * return self.getbuffer(p) # <<<<<<<<<<<<<< * * def __getwritebuffer__(self, Py_ssize_t idx, void **p): */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_self->__pyx_vtab)->getbuffer(__pyx_v_self, __pyx_v_p); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1L))) __PYX_ERR(7, 593, __pyx_L1_error) __pyx_r = __pyx_t_3; goto __pyx_L0; /* "petsc4py/PETSc/petscvec.pxi":590 * return 1 * * def __getreadbuffer__(self, Py_ssize_t idx, void **p): # <<<<<<<<<<<<<< * if idx != 0: raise SystemError( * "accessing non-existent buffer segment") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc._Vec_buffer.__getreadbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } #endif /*!(#if PY_MAJOR_VERSION < 3)*/ /* "petsc4py/PETSc/petscvec.pxi":595 * return self.getbuffer(p) * * def __getwritebuffer__(self, Py_ssize_t idx, void **p): # <<<<<<<<<<<<<< * if idx != 0: raise SystemError( * "accessing non-existent buffer segment") */ /* Python wrapper */ #if PY_MAJOR_VERSION < 3 static Py_ssize_t __pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_17__getwritebuffer__(PyObject *__pyx_v_self, Py_ssize_t __pyx_v_idx, void **__pyx_v_p); /*proto*/ static Py_ssize_t __pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_17__getwritebuffer__(PyObject *__pyx_v_self, Py_ssize_t __pyx_v_idx, void **__pyx_v_p) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getwritebuffer__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_16__getwritebuffer__(((struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_self), ((Py_ssize_t)__pyx_v_idx), ((void **)__pyx_v_p)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } #endif /*!(#if PY_MAJOR_VERSION < 3)*/ #if PY_MAJOR_VERSION < 3 static Py_ssize_t __pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_16__getwritebuffer__(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self, Py_ssize_t __pyx_v_idx, void **__pyx_v_p) { Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getwritebuffer__", 1); /* "petsc4py/PETSc/petscvec.pxi":596 * * def __getwritebuffer__(self, Py_ssize_t idx, void **p): * if idx != 0: raise SystemError( # <<<<<<<<<<<<<< * "accessing non-existent buffer segment") * if self.readonly: raise TypeError( */ __pyx_t_1 = (__pyx_v_idx != 0); if (unlikely(__pyx_t_1)) { __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_SystemError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 596, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(7, 596, __pyx_L1_error) } /* "petsc4py/PETSc/petscvec.pxi":598 * if idx != 0: raise SystemError( * "accessing non-existent buffer segment") * if self.readonly: raise TypeError( # <<<<<<<<<<<<<< * "Object is not writable.") * return self.getbuffer(p) */ if (unlikely(__pyx_v_self->readonly)) { __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(7, 598, __pyx_L1_error) } /* "petsc4py/PETSc/petscvec.pxi":600 * if self.readonly: raise TypeError( * "Object is not writable.") * return self.getbuffer(p) # <<<<<<<<<<<<<< * * # NumPy array interface (legacy) */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_self->__pyx_vtab)->getbuffer(__pyx_v_self, __pyx_v_p); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1L))) __PYX_ERR(7, 600, __pyx_L1_error) __pyx_r = __pyx_t_3; goto __pyx_L0; /* "petsc4py/PETSc/petscvec.pxi":595 * return self.getbuffer(p) * * def __getwritebuffer__(self, Py_ssize_t idx, void **p): # <<<<<<<<<<<<<< * if idx != 0: raise SystemError( * "accessing non-existent buffer segment") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc._Vec_buffer.__getwritebuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } #endif /*!(#if PY_MAJOR_VERSION < 3)*/ /* "petsc4py/PETSc/petscvec.pxi":605 * * property __array_interface__: * def __get__(self): # <<<<<<<<<<<<<< * cdef PetscInt n = 0 * if self.vec != NULL: */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_19__array_interface___1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_19__array_interface___1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_19__array_interface_____get__(((struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_19__array_interface_____get__(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self) { PetscInt __pyx_v_n; PyObject *__pyx_v_size = 0; PyArray_Descr *__pyx_v_descr = 0; PyObject *__pyx_v_typestr = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/petscvec.pxi":606 * property __array_interface__: * def __get__(self): * cdef PetscInt n = 0 # <<<<<<<<<<<<<< * if self.vec != NULL: * CHKERR( VecGetLocalSize(self.vec, &n) ) */ __pyx_v_n = 0; /* "petsc4py/PETSc/petscvec.pxi":607 * def __get__(self): * cdef PetscInt n = 0 * if self.vec != NULL: # <<<<<<<<<<<<<< * CHKERR( VecGetLocalSize(self.vec, &n) ) * cdef object size = toInt(n) */ __pyx_t_1 = (__pyx_v_self->vec != NULL); if (__pyx_t_1) { /* "petsc4py/PETSc/petscvec.pxi":608 * cdef PetscInt n = 0 * if self.vec != NULL: * CHKERR( VecGetLocalSize(self.vec, &n) ) # <<<<<<<<<<<<<< * cdef object size = toInt(n) * cdef dtype descr = PyArray_DescrFromType(NPY_PETSC_SCALAR) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetLocalSize(__pyx_v_self->vec, (&__pyx_v_n))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 608, __pyx_L1_error) /* "petsc4py/PETSc/petscvec.pxi":607 * def __get__(self): * cdef PetscInt n = 0 * if self.vec != NULL: # <<<<<<<<<<<<<< * CHKERR( VecGetLocalSize(self.vec, &n) ) * cdef object size = toInt(n) */ } /* "petsc4py/PETSc/petscvec.pxi":609 * if self.vec != NULL: * CHKERR( VecGetLocalSize(self.vec, &n) ) * cdef object size = toInt(n) # <<<<<<<<<<<<<< * cdef dtype descr = PyArray_DescrFromType(NPY_PETSC_SCALAR) * cdef str typestr = "=%c%d" % (descr.kind, descr.itemsize) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 609, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_size = __pyx_t_3; __pyx_t_3 = 0; /* "petsc4py/PETSc/petscvec.pxi":610 * CHKERR( VecGetLocalSize(self.vec, &n) ) * cdef object size = toInt(n) * cdef dtype descr = PyArray_DescrFromType(NPY_PETSC_SCALAR) # <<<<<<<<<<<<<< * cdef str typestr = "=%c%d" % (descr.kind, descr.itemsize) * return dict(version=3, */ __pyx_t_3 = ((PyObject *)PyArray_DescrFromType(NPY_PETSC_SCALAR)); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 610, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/petscvec.pxi":611 * cdef object size = toInt(n) * cdef dtype descr = PyArray_DescrFromType(NPY_PETSC_SCALAR) * cdef str typestr = "=%c%d" % (descr.kind, descr.itemsize) # <<<<<<<<<<<<<< * return dict(version=3, * data=self, */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_descr), __pyx_n_s_kind); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 611, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_descr), __pyx_n_s_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 611, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 611, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3)) __PYX_ERR(7, 611, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4)) __PYX_ERR(7, 611, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_c_d, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 611, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_typestr = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/petscvec.pxi":612 * cdef dtype descr = PyArray_DescrFromType(NPY_PETSC_SCALAR) * cdef str typestr = "=%c%d" % (descr.kind, descr.itemsize) * return dict(version=3, # <<<<<<<<<<<<<< * data=self, * shape=(size,), */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 612, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_version, __pyx_int_3) < 0) __PYX_ERR(7, 612, __pyx_L1_error) /* "petsc4py/PETSc/petscvec.pxi":613 * cdef str typestr = "=%c%d" % (descr.kind, descr.itemsize) * return dict(version=3, * data=self, # <<<<<<<<<<<<<< * shape=(size,), * typestr=typestr) */ if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_data, ((PyObject *)__pyx_v_self)) < 0) __PYX_ERR(7, 612, __pyx_L1_error) /* "petsc4py/PETSc/petscvec.pxi":614 * return dict(version=3, * data=self, * shape=(size,), # <<<<<<<<<<<<<< * typestr=typestr) * */ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_size); __Pyx_GIVEREF(__pyx_v_size); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_size)) __PYX_ERR(7, 614, __pyx_L1_error); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_shape, __pyx_t_5) < 0) __PYX_ERR(7, 612, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/petscvec.pxi":615 * data=self, * shape=(size,), * typestr=typestr) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_typestr, __pyx_v_typestr) < 0) __PYX_ERR(7, 612, __pyx_L1_error) __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "petsc4py/PETSc/petscvec.pxi":605 * * property __array_interface__: * def __get__(self): # <<<<<<<<<<<<<< * cdef PetscInt n = 0 * if self.vec != NULL: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc._Vec_buffer.__array_interface__.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_size); __Pyx_XDECREF((PyObject *)__pyx_v_descr); __Pyx_XDECREF(__pyx_v_typestr); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscvec.pxi":626 * cdef Vec lvec * * def __init__(self, Vec gvec): # <<<<<<<<<<<<<< * self.gvec = gvec * self.lvec = Vec() */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_14_Vec_LocalForm_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_14_Vec_LocalForm_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_gvec = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gvec,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gvec)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 626, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(7, 626, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); } __pyx_v_gvec = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(7, 626, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc._Vec_LocalForm.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gvec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "gvec", 0))) __PYX_ERR(7, 626, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_14_Vec_LocalForm___init__(((struct __pyx_obj_8petsc4py_5PETSc__Vec_LocalForm *)__pyx_v_self), __pyx_v_gvec); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = -1; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_14_Vec_LocalForm___init__(struct __pyx_obj_8petsc4py_5PETSc__Vec_LocalForm *__pyx_v_self, struct PyPetscVecObject *__pyx_v_gvec) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 1); /* "petsc4py/PETSc/petscvec.pxi":627 * * def __init__(self, Vec gvec): * self.gvec = gvec # <<<<<<<<<<<<<< * self.lvec = Vec() * */ __Pyx_INCREF((PyObject *)__pyx_v_gvec); __Pyx_GIVEREF((PyObject *)__pyx_v_gvec); __Pyx_GOTREF((PyObject *)__pyx_v_self->gvec); __Pyx_DECREF((PyObject *)__pyx_v_self->gvec); __pyx_v_self->gvec = __pyx_v_gvec; /* "petsc4py/PETSc/petscvec.pxi":628 * def __init__(self, Vec gvec): * self.gvec = gvec * self.lvec = Vec() # <<<<<<<<<<<<<< * * def __enter__(self): */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 628, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF((PyObject *)__pyx_v_self->lvec); __Pyx_DECREF((PyObject *)__pyx_v_self->lvec); __pyx_v_self->lvec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscvec.pxi":626 * cdef Vec lvec * * def __init__(self, Vec gvec): # <<<<<<<<<<<<<< * self.gvec = gvec * self.lvec = Vec() */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc._Vec_LocalForm.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscvec.pxi":630 * self.lvec = Vec() * * def __enter__(self): # <<<<<<<<<<<<<< * cdef PetscVec gvec = self.gvec.vec * CHKERR( VecGhostGetLocalForm(gvec, &self.lvec.vec) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_14_Vec_LocalForm_3__enter__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_14_Vec_LocalForm_2__enter__, "_Vec_LocalForm.__enter__(self)\nSource code at petsc4py/PETSc/petscvec.pxi:630"); static PyObject *__pyx_pw_8petsc4py_5PETSc_14_Vec_LocalForm_3__enter__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__enter__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__enter__", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_14_Vec_LocalForm_2__enter__(((struct __pyx_obj_8petsc4py_5PETSc__Vec_LocalForm *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_14_Vec_LocalForm_2__enter__(struct __pyx_obj_8petsc4py_5PETSc__Vec_LocalForm *__pyx_v_self) { Vec __pyx_v_gvec; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Vec __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__enter__", 1); /* "petsc4py/PETSc/petscvec.pxi":631 * * def __enter__(self): * cdef PetscVec gvec = self.gvec.vec # <<<<<<<<<<<<<< * CHKERR( VecGhostGetLocalForm(gvec, &self.lvec.vec) ) * return self.lvec */ __pyx_t_1 = __pyx_v_self->gvec->vec; __pyx_v_gvec = __pyx_t_1; /* "petsc4py/PETSc/petscvec.pxi":632 * def __enter__(self): * cdef PetscVec gvec = self.gvec.vec * CHKERR( VecGhostGetLocalForm(gvec, &self.lvec.vec) ) # <<<<<<<<<<<<<< * return self.lvec * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGhostGetLocalForm(__pyx_v_gvec, (&__pyx_v_self->lvec->vec))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 632, __pyx_L1_error) /* "petsc4py/PETSc/petscvec.pxi":633 * cdef PetscVec gvec = self.gvec.vec * CHKERR( VecGhostGetLocalForm(gvec, &self.lvec.vec) ) * return self.lvec # <<<<<<<<<<<<<< * * def __exit__(self, *exc): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self->lvec); __pyx_r = ((PyObject *)__pyx_v_self->lvec); goto __pyx_L0; /* "petsc4py/PETSc/petscvec.pxi":630 * self.lvec = Vec() * * def __enter__(self): # <<<<<<<<<<<<<< * cdef PetscVec gvec = self.gvec.vec * CHKERR( VecGhostGetLocalForm(gvec, &self.lvec.vec) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc._Vec_LocalForm.__enter__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscvec.pxi":635 * return self.lvec * * def __exit__(self, *exc): # <<<<<<<<<<<<<< * cdef PetscVec gvec = self.gvec.vec * CHKERR( VecGhostRestoreLocalForm(gvec, &self.lvec.vec) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_14_Vec_LocalForm_5__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_14_Vec_LocalForm_4__exit__, "_Vec_LocalForm.__exit__(self, *exc)\nSource code at petsc4py/PETSc/petscvec.pxi:635"); static PyObject *__pyx_pw_8petsc4py_5PETSc_14_Vec_LocalForm_5__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED PyObject *__pyx_v_exc = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__exit__", 0))) return NULL; __Pyx_INCREF(__pyx_args); __pyx_v_exc = __pyx_args; __pyx_r = __pyx_pf_8petsc4py_5PETSc_14_Vec_LocalForm_4__exit__(((struct __pyx_obj_8petsc4py_5PETSc__Vec_LocalForm *)__pyx_v_self), __pyx_v_exc); /* function exit code */ __Pyx_DECREF(__pyx_v_exc); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_14_Vec_LocalForm_4__exit__(struct __pyx_obj_8petsc4py_5PETSc__Vec_LocalForm *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc) { Vec __pyx_v_gvec; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Vec __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__exit__", 1); /* "petsc4py/PETSc/petscvec.pxi":636 * * def __exit__(self, *exc): * cdef PetscVec gvec = self.gvec.vec # <<<<<<<<<<<<<< * CHKERR( VecGhostRestoreLocalForm(gvec, &self.lvec.vec) ) * self.lvec.vec = NULL */ __pyx_t_1 = __pyx_v_self->gvec->vec; __pyx_v_gvec = __pyx_t_1; /* "petsc4py/PETSc/petscvec.pxi":637 * def __exit__(self, *exc): * cdef PetscVec gvec = self.gvec.vec * CHKERR( VecGhostRestoreLocalForm(gvec, &self.lvec.vec) ) # <<<<<<<<<<<<<< * self.lvec.vec = NULL */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGhostRestoreLocalForm(__pyx_v_gvec, (&__pyx_v_self->lvec->vec))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 637, __pyx_L1_error) /* "petsc4py/PETSc/petscvec.pxi":638 * cdef PetscVec gvec = self.gvec.vec * CHKERR( VecGhostRestoreLocalForm(gvec, &self.lvec.vec) ) * self.lvec.vec = NULL # <<<<<<<<<<<<<< */ __pyx_v_self->lvec->vec = NULL; /* "petsc4py/PETSc/petscvec.pxi":635 * return self.lvec * * def __exit__(self, *exc): # <<<<<<<<<<<<<< * cdef PetscVec gvec = self.gvec.vec * CHKERR( VecGhostRestoreLocalForm(gvec, &self.lvec.vec) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc._Vec_LocalForm.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscmat.pxi":536 * PetscErrorCode MatGetNearNullSpace(PetscMat,PetscNullSpace*) * * cdef inline NullSpace ref_NullSpace(PetscNullSpace nsp): # <<<<<<<<<<<<<< * cdef NullSpace ob = NullSpace() * ob.nsp = nsp */ static CYTHON_INLINE struct PyPetscNullSpaceObject *__pyx_f_8petsc4py_5PETSc_ref_NullSpace(MatNullSpace __pyx_v_nsp) { struct PyPetscNullSpaceObject *__pyx_v_ob = 0; struct PyPetscNullSpaceObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("ref_NullSpace", 1); /* "petsc4py/PETSc/petscmat.pxi":537 * * cdef inline NullSpace ref_NullSpace(PetscNullSpace nsp): * cdef NullSpace ob = NullSpace() # <<<<<<<<<<<<<< * ob.nsp = nsp * CHKERR( PetscINCREF(ob.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_NullSpace)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_ob = ((struct PyPetscNullSpaceObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscmat.pxi":538 * cdef inline NullSpace ref_NullSpace(PetscNullSpace nsp): * cdef NullSpace ob = NullSpace() * ob.nsp = nsp # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(ob.obj) ) * return ob */ __pyx_v_ob->nsp = __pyx_v_nsp; /* "petsc4py/PETSc/petscmat.pxi":539 * cdef NullSpace ob = NullSpace() * ob.nsp = nsp * CHKERR( PetscINCREF(ob.obj) ) # <<<<<<<<<<<<<< * return ob * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ob->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(8, 539, __pyx_L1_error) /* "petsc4py/PETSc/petscmat.pxi":540 * ob.nsp = nsp * CHKERR( PetscINCREF(ob.obj) ) * return ob # <<<<<<<<<<<<<< * * cdef PetscErrorCode NullSpace_Function( */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_ob); __pyx_r = __pyx_v_ob; goto __pyx_L0; /* "petsc4py/PETSc/petscmat.pxi":536 * PetscErrorCode MatGetNearNullSpace(PetscMat,PetscNullSpace*) * * cdef inline NullSpace ref_NullSpace(PetscNullSpace nsp): # <<<<<<<<<<<<<< * cdef NullSpace ob = NullSpace() * ob.nsp = nsp */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.ref_NullSpace", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscmat.pxi":542 * return ob * * cdef PetscErrorCode NullSpace_Function( # <<<<<<<<<<<<<< * PetscNullSpace n, * PetscVec v, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_NullSpace_Function(MatNullSpace __pyx_v_n, Vec __pyx_v_v, CYTHON_UNUSED void *__pyx_v_ctx) { struct PyPetscNullSpaceObject *__pyx_v_nsp = 0; struct PyPetscVecObject *__pyx_v_vec = 0; PyObject *__pyx_v_function = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *(*__pyx_t_6)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("NullSpace_Function", 0); /* "petsc4py/PETSc/petscmat.pxi":547 * void * ctx, * ) except PETSC_ERR_PYTHON with gil: * cdef NullSpace nsp = ref_NullSpace(n) # <<<<<<<<<<<<<< * cdef Vec vec = ref_Vec(v) * (function, args, kargs) = nsp.get_attr('__function__') */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_NullSpace(__pyx_v_n)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_nsp = ((struct PyPetscNullSpaceObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscmat.pxi":548 * ) except PETSC_ERR_PYTHON with gil: * cdef NullSpace nsp = ref_NullSpace(n) * cdef Vec vec = ref_Vec(v) # <<<<<<<<<<<<<< * (function, args, kargs) = nsp.get_attr('__function__') * function(nsp, vec, *args, **kargs) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_v)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 548, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscmat.pxi":549 * cdef NullSpace nsp = ref_NullSpace(n) * cdef Vec vec = ref_Vec(v) * (function, args, kargs) = nsp.get_attr('__function__') # <<<<<<<<<<<<<< * function(nsp, vec, *args, **kargs) * return PETSC_SUCCESS */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_NullSpace *)__pyx_v_nsp->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_nsp), ((char *)"__function__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 549, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(8, 549, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); __pyx_t_4 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 549, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 549, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 549, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 549, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 2; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 3) < 0) __PYX_ERR(8, 549, __pyx_L1_error) __pyx_t_6 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(8, 549, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_function = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_args = __pyx_t_3; __pyx_t_3 = 0; __pyx_v_kargs = __pyx_t_4; __pyx_t_4 = 0; /* "petsc4py/PETSc/petscmat.pxi":550 * cdef Vec vec = ref_Vec(v) * (function, args, kargs) = nsp.get_attr('__function__') * function(nsp, vec, *args, **kargs) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF((PyObject *)__pyx_v_nsp); __Pyx_GIVEREF((PyObject *)__pyx_v_nsp); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_nsp))) __PYX_ERR(8, 550, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_vec); __Pyx_GIVEREF((PyObject *)__pyx_v_vec); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_vec))) __PYX_ERR(8, 550, __pyx_L1_error); __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(8, 550, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_4 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } else { __pyx_t_4 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_function, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscmat.pxi":551 * (function, args, kargs) = nsp.get_attr('__function__') * function(nsp, vec, *args, **kargs) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * # ----------------------------------------------------------------------------- */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petscmat.pxi":542 * return ob * * cdef PetscErrorCode NullSpace_Function( # <<<<<<<<<<<<<< * PetscNullSpace n, * PetscVec v, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.NullSpace_Function", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_nsp); __Pyx_XDECREF((PyObject *)__pyx_v_vec); __Pyx_XDECREF(__pyx_v_function); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petscmat.pxi":555 * # ----------------------------------------------------------------------------- * * cdef inline Mat ref_Mat(PetscMat mat): # <<<<<<<<<<<<<< * cdef Mat ob = Mat() * ob.mat = mat */ static CYTHON_INLINE struct PyPetscMatObject *__pyx_f_8petsc4py_5PETSc_ref_Mat(Mat __pyx_v_mat) { struct PyPetscMatObject *__pyx_v_ob = 0; struct PyPetscMatObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("ref_Mat", 1); /* "petsc4py/PETSc/petscmat.pxi":556 * * cdef inline Mat ref_Mat(PetscMat mat): * cdef Mat ob = Mat() # <<<<<<<<<<<<<< * ob.mat = mat * CHKERR( PetscINCREF(ob.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_ob = ((struct PyPetscMatObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscmat.pxi":557 * cdef inline Mat ref_Mat(PetscMat mat): * cdef Mat ob = Mat() * ob.mat = mat # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(ob.obj) ) * return ob */ __pyx_v_ob->mat = __pyx_v_mat; /* "petsc4py/PETSc/petscmat.pxi":558 * cdef Mat ob = Mat() * ob.mat = mat * CHKERR( PetscINCREF(ob.obj) ) # <<<<<<<<<<<<<< * return ob * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ob->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(8, 558, __pyx_L1_error) /* "petsc4py/PETSc/petscmat.pxi":559 * ob.mat = mat * CHKERR( PetscINCREF(ob.obj) ) * return ob # <<<<<<<<<<<<<< * * # ----------------------------------------------------------------------------- */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_ob); __pyx_r = __pyx_v_ob; goto __pyx_L0; /* "petsc4py/PETSc/petscmat.pxi":555 * # ----------------------------------------------------------------------------- * * cdef inline Mat ref_Mat(PetscMat mat): # <<<<<<<<<<<<<< * cdef Mat ob = Mat() * ob.mat = mat */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.ref_Mat", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscmat.pxi":565 * # unary operations * * cdef Mat mat_pos(Mat self): # <<<<<<<<<<<<<< * cdef Mat mat = type(self)() * CHKERR( MatDuplicate(self.mat, MAT_COPY_VALUES, &mat.mat) ) */ static struct PyPetscMatObject *__pyx_f_8petsc4py_5PETSc_mat_pos(struct PyPetscMatObject *__pyx_v_self) { struct PyPetscMatObject *__pyx_v_mat = 0; struct PyPetscMatObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PetscErrorCode __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mat_pos", 1); /* "petsc4py/PETSc/petscmat.pxi":566 * * cdef Mat mat_pos(Mat self): * cdef Mat mat = type(self)() # <<<<<<<<<<<<<< * CHKERR( MatDuplicate(self.mat, MAT_COPY_VALUES, &mat.mat) ) * return mat */ __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __pyx_t_2 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(8, 566, __pyx_L1_error) __pyx_v_mat = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscmat.pxi":567 * cdef Mat mat_pos(Mat self): * cdef Mat mat = type(self)() * CHKERR( MatDuplicate(self.mat, MAT_COPY_VALUES, &mat.mat) ) # <<<<<<<<<<<<<< * return mat * */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDuplicate(__pyx_v_self->mat, MAT_COPY_VALUES, (&__pyx_v_mat->mat))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(8, 567, __pyx_L1_error) /* "petsc4py/PETSc/petscmat.pxi":568 * cdef Mat mat = type(self)() * CHKERR( MatDuplicate(self.mat, MAT_COPY_VALUES, &mat.mat) ) * return mat # <<<<<<<<<<<<<< * * cdef Mat mat_neg(Mat self): */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_mat); __pyx_r = __pyx_v_mat; goto __pyx_L0; /* "petsc4py/PETSc/petscmat.pxi":565 * # unary operations * * cdef Mat mat_pos(Mat self): # <<<<<<<<<<<<<< * cdef Mat mat = type(self)() * CHKERR( MatDuplicate(self.mat, MAT_COPY_VALUES, &mat.mat) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.mat_pos", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_mat); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscmat.pxi":570 * return mat * * cdef Mat mat_neg(Mat self): # <<<<<<<<<<<<<< * cdef Mat mat = mat_pos(self) * CHKERR( MatScale(mat.mat, -1) ) */ static struct PyPetscMatObject *__pyx_f_8petsc4py_5PETSc_mat_neg(struct PyPetscMatObject *__pyx_v_self) { struct PyPetscMatObject *__pyx_v_mat = 0; struct PyPetscMatObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mat_neg", 1); /* "petsc4py/PETSc/petscmat.pxi":571 * * cdef Mat mat_neg(Mat self): * cdef Mat mat = mat_pos(self) # <<<<<<<<<<<<<< * CHKERR( MatScale(mat.mat, -1) ) * return mat */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_pos(__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 571, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_mat = ((struct PyPetscMatObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscmat.pxi":572 * cdef Mat mat_neg(Mat self): * cdef Mat mat = mat_pos(self) * CHKERR( MatScale(mat.mat, -1) ) # <<<<<<<<<<<<<< * return mat * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatScale(__pyx_v_mat->mat, -1.0)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(8, 572, __pyx_L1_error) /* "petsc4py/PETSc/petscmat.pxi":573 * cdef Mat mat = mat_pos(self) * CHKERR( MatScale(mat.mat, -1) ) * return mat # <<<<<<<<<<<<<< * * # inplace binary operations */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_mat); __pyx_r = __pyx_v_mat; goto __pyx_L0; /* "petsc4py/PETSc/petscmat.pxi":570 * return mat * * cdef Mat mat_neg(Mat self): # <<<<<<<<<<<<<< * cdef Mat mat = mat_pos(self) * CHKERR( MatScale(mat.mat, -1) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.mat_neg", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_mat); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscmat.pxi":577 * # inplace binary operations * * cdef Mat mat_iadd(Mat self, other): # <<<<<<<<<<<<<< * if isinstance(other, Mat): * self.axpy(1, other) */ static struct PyPetscMatObject *__pyx_f_8petsc4py_5PETSc_mat_iadd(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_v_alpha = NULL; PyObject *__pyx_v_mat = NULL; struct PyPetscMatObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_t_6; PyObject *(*__pyx_t_7)(PyObject *); PyObject *__pyx_t_8 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mat_iadd", 1); /* "petsc4py/PETSc/petscmat.pxi":578 * * cdef Mat mat_iadd(Mat self, other): * if isinstance(other, Mat): # <<<<<<<<<<<<<< * self.axpy(1, other) * elif isinstance(other, (tuple, list)): */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Mat); if (__pyx_t_1) { /* "petsc4py/PETSc/petscmat.pxi":579 * cdef Mat mat_iadd(Mat self, other): * if isinstance(other, Mat): * self.axpy(1, other) # <<<<<<<<<<<<<< * elif isinstance(other, (tuple, list)): * alpha, mat = other */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_axpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_int_1, __pyx_v_other}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscmat.pxi":578 * * cdef Mat mat_iadd(Mat self, other): * if isinstance(other, Mat): # <<<<<<<<<<<<<< * self.axpy(1, other) * elif isinstance(other, (tuple, list)): */ goto __pyx_L3; } /* "petsc4py/PETSc/petscmat.pxi":580 * if isinstance(other, Mat): * self.axpy(1, other) * elif isinstance(other, (tuple, list)): # <<<<<<<<<<<<<< * alpha, mat = other * self.axpy(alpha, mat) */ __pyx_t_6 = PyTuple_Check(__pyx_v_other); if (!__pyx_t_6) { } else { __pyx_t_1 = __pyx_t_6; goto __pyx_L4_bool_binop_done; } __pyx_t_6 = PyList_Check(__pyx_v_other); __pyx_t_1 = __pyx_t_6; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "petsc4py/PETSc/petscmat.pxi":581 * self.axpy(1, other) * elif isinstance(other, (tuple, list)): * alpha, mat = other # <<<<<<<<<<<<<< * self.axpy(alpha, mat) * elif isinstance(other, Vec): */ if ((likely(PyTuple_CheckExact(__pyx_v_other))) || (PyList_CheckExact(__pyx_v_other))) { PyObject* sequence = __pyx_v_other; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(8, 581, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { Py_ssize_t index = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_other); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); index = 0; __pyx_t_2 = __pyx_t_7(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_3 = __pyx_t_7(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_4), 2) < 0) __PYX_ERR(8, 581, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L7_unpacking_done; __pyx_L6_unpacking_failed:; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(8, 581, __pyx_L1_error) __pyx_L7_unpacking_done:; } __pyx_v_alpha = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_mat = __pyx_t_3; __pyx_t_3 = 0; /* "petsc4py/PETSc/petscmat.pxi":582 * elif isinstance(other, (tuple, list)): * alpha, mat = other * self.axpy(alpha, mat) # <<<<<<<<<<<<<< * elif isinstance(other, Vec): * self.setDiagonal(other, PETSC_ADD_VALUES) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_axpy); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_alpha, __pyx_v_mat}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/petscmat.pxi":580 * if isinstance(other, Mat): * self.axpy(1, other) * elif isinstance(other, (tuple, list)): # <<<<<<<<<<<<<< * alpha, mat = other * self.axpy(alpha, mat) */ goto __pyx_L3; } /* "petsc4py/PETSc/petscmat.pxi":583 * alpha, mat = other * self.axpy(alpha, mat) * elif isinstance(other, Vec): # <<<<<<<<<<<<<< * self.setDiagonal(other, PETSC_ADD_VALUES) * else: */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Vec); if (__pyx_t_1) { /* "petsc4py/PETSc/petscmat.pxi":584 * self.axpy(alpha, mat) * elif isinstance(other, Vec): * self.setDiagonal(other, PETSC_ADD_VALUES) # <<<<<<<<<<<<<< * else: * self.shift(other) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setDiagonal); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyInt_From_InsertMode(ADD_VALUES); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_v_other, __pyx_t_4}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/petscmat.pxi":583 * alpha, mat = other * self.axpy(alpha, mat) * elif isinstance(other, Vec): # <<<<<<<<<<<<<< * self.setDiagonal(other, PETSC_ADD_VALUES) * else: */ goto __pyx_L3; } /* "petsc4py/PETSc/petscmat.pxi":586 * self.setDiagonal(other, PETSC_ADD_VALUES) * else: * self.shift(other) # <<<<<<<<<<<<<< * return self * */ /*else*/ { __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_shift); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 586, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_other}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 586, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_L3:; /* "petsc4py/PETSc/petscmat.pxi":587 * else: * self.shift(other) * return self # <<<<<<<<<<<<<< * * cdef Mat mat_isub(Mat self, other): */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = __pyx_v_self; goto __pyx_L0; /* "petsc4py/PETSc/petscmat.pxi":577 * # inplace binary operations * * cdef Mat mat_iadd(Mat self, other): # <<<<<<<<<<<<<< * if isinstance(other, Mat): * self.axpy(1, other) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("petsc4py.PETSc.mat_iadd", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_alpha); __Pyx_XDECREF(__pyx_v_mat); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscmat.pxi":589 * return self * * cdef Mat mat_isub(Mat self, other): # <<<<<<<<<<<<<< * if isinstance(other, Mat): * self.axpy(-1, other) */ static struct PyPetscMatObject *__pyx_f_8petsc4py_5PETSc_mat_isub(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_v_alpha = NULL; PyObject *__pyx_v_mat = NULL; PyObject *__pyx_v_diag = NULL; struct PyPetscMatObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_t_6; PyObject *(*__pyx_t_7)(PyObject *); PyObject *__pyx_t_8 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mat_isub", 1); /* "petsc4py/PETSc/petscmat.pxi":590 * * cdef Mat mat_isub(Mat self, other): * if isinstance(other, Mat): # <<<<<<<<<<<<<< * self.axpy(-1, other) * elif isinstance(other, (tuple, list)): */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Mat); if (__pyx_t_1) { /* "petsc4py/PETSc/petscmat.pxi":591 * cdef Mat mat_isub(Mat self, other): * if isinstance(other, Mat): * self.axpy(-1, other) # <<<<<<<<<<<<<< * elif isinstance(other, (tuple, list)): * alpha, mat = other */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_axpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 591, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_int_neg_1, __pyx_v_other}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 591, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscmat.pxi":590 * * cdef Mat mat_isub(Mat self, other): * if isinstance(other, Mat): # <<<<<<<<<<<<<< * self.axpy(-1, other) * elif isinstance(other, (tuple, list)): */ goto __pyx_L3; } /* "petsc4py/PETSc/petscmat.pxi":592 * if isinstance(other, Mat): * self.axpy(-1, other) * elif isinstance(other, (tuple, list)): # <<<<<<<<<<<<<< * alpha, mat = other * self.axpy(-alpha, mat) */ __pyx_t_6 = PyTuple_Check(__pyx_v_other); if (!__pyx_t_6) { } else { __pyx_t_1 = __pyx_t_6; goto __pyx_L4_bool_binop_done; } __pyx_t_6 = PyList_Check(__pyx_v_other); __pyx_t_1 = __pyx_t_6; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "petsc4py/PETSc/petscmat.pxi":593 * self.axpy(-1, other) * elif isinstance(other, (tuple, list)): * alpha, mat = other # <<<<<<<<<<<<<< * self.axpy(-alpha, mat) * elif isinstance(other, Vec): */ if ((likely(PyTuple_CheckExact(__pyx_v_other))) || (PyList_CheckExact(__pyx_v_other))) { PyObject* sequence = __pyx_v_other; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(8, 593, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { Py_ssize_t index = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_other); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); index = 0; __pyx_t_2 = __pyx_t_7(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_3 = __pyx_t_7(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_4), 2) < 0) __PYX_ERR(8, 593, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L7_unpacking_done; __pyx_L6_unpacking_failed:; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(8, 593, __pyx_L1_error) __pyx_L7_unpacking_done:; } __pyx_v_alpha = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_mat = __pyx_t_3; __pyx_t_3 = 0; /* "petsc4py/PETSc/petscmat.pxi":594 * elif isinstance(other, (tuple, list)): * alpha, mat = other * self.axpy(-alpha, mat) # <<<<<<<<<<<<<< * elif isinstance(other, Vec): * diag = other.copy() */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_axpy); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 594, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyNumber_Negative(__pyx_v_alpha); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 594, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_t_4, __pyx_v_mat}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 594, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/petscmat.pxi":592 * if isinstance(other, Mat): * self.axpy(-1, other) * elif isinstance(other, (tuple, list)): # <<<<<<<<<<<<<< * alpha, mat = other * self.axpy(-alpha, mat) */ goto __pyx_L3; } /* "petsc4py/PETSc/petscmat.pxi":595 * alpha, mat = other * self.axpy(-alpha, mat) * elif isinstance(other, Vec): # <<<<<<<<<<<<<< * diag = other.copy() * diag.scale(-1) */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Vec); if (__pyx_t_1) { /* "petsc4py/PETSc/petscmat.pxi":596 * self.axpy(-alpha, mat) * elif isinstance(other, Vec): * diag = other.copy() # <<<<<<<<<<<<<< * diag.scale(-1) * self.setDiagonal(diag, PETSC_ADD_VALUES) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 596, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 596, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_diag = __pyx_t_3; __pyx_t_3 = 0; /* "petsc4py/PETSc/petscmat.pxi":597 * elif isinstance(other, Vec): * diag = other.copy() * diag.scale(-1) # <<<<<<<<<<<<<< * self.setDiagonal(diag, PETSC_ADD_VALUES) * diag.destroy() */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_diag, __pyx_n_s_scale); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 597, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_int_neg_1}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 597, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/petscmat.pxi":598 * diag = other.copy() * diag.scale(-1) * self.setDiagonal(diag, PETSC_ADD_VALUES) # <<<<<<<<<<<<<< * diag.destroy() * else: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setDiagonal); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyInt_From_InsertMode(ADD_VALUES); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_v_diag, __pyx_t_4}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/petscmat.pxi":599 * diag.scale(-1) * self.setDiagonal(diag, PETSC_ADD_VALUES) * diag.destroy() # <<<<<<<<<<<<<< * else: * self.shift(-other) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_diag, __pyx_n_s_destroy); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/petscmat.pxi":595 * alpha, mat = other * self.axpy(-alpha, mat) * elif isinstance(other, Vec): # <<<<<<<<<<<<<< * diag = other.copy() * diag.scale(-1) */ goto __pyx_L3; } /* "petsc4py/PETSc/petscmat.pxi":601 * diag.destroy() * else: * self.shift(-other) # <<<<<<<<<<<<<< * return self * */ /*else*/ { __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_shift); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 601, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyNumber_Negative(__pyx_v_other); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 601, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_4}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 601, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_L3:; /* "petsc4py/PETSc/petscmat.pxi":602 * else: * self.shift(-other) * return self # <<<<<<<<<<<<<< * * cdef Mat mat_imul(Mat self, other): */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = __pyx_v_self; goto __pyx_L0; /* "petsc4py/PETSc/petscmat.pxi":589 * return self * * cdef Mat mat_isub(Mat self, other): # <<<<<<<<<<<<<< * if isinstance(other, Mat): * self.axpy(-1, other) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("petsc4py.PETSc.mat_isub", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_alpha); __Pyx_XDECREF(__pyx_v_mat); __Pyx_XDECREF(__pyx_v_diag); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscmat.pxi":604 * return self * * cdef Mat mat_imul(Mat self, other): # <<<<<<<<<<<<<< * if isinstance(other, (tuple, list)): * L, R = other */ static struct PyPetscMatObject *__pyx_f_8petsc4py_5PETSc_mat_imul(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_v_L = NULL; PyObject *__pyx_v_R = NULL; struct PyPetscMatObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *(*__pyx_t_6)(PyObject *); int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mat_imul", 1); /* "petsc4py/PETSc/petscmat.pxi":605 * * cdef Mat mat_imul(Mat self, other): * if isinstance(other, (tuple, list)): # <<<<<<<<<<<<<< * L, R = other * self.diagonalScale(L, R) */ __pyx_t_2 = PyTuple_Check(__pyx_v_other); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = PyList_Check(__pyx_v_other); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "petsc4py/PETSc/petscmat.pxi":606 * cdef Mat mat_imul(Mat self, other): * if isinstance(other, (tuple, list)): * L, R = other # <<<<<<<<<<<<<< * self.diagonalScale(L, R) * else: */ if ((likely(PyTuple_CheckExact(__pyx_v_other))) || (PyList_CheckExact(__pyx_v_other))) { PyObject* sequence = __pyx_v_other; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(8, 606, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_3 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); #else __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 606, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 606, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { Py_ssize_t index = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_other); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 606, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); index = 0; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 1; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(8, 606, __pyx_L1_error) __pyx_t_6 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L7_unpacking_done; __pyx_L6_unpacking_failed:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(8, 606, __pyx_L1_error) __pyx_L7_unpacking_done:; } __pyx_v_L = __pyx_t_3; __pyx_t_3 = 0; __pyx_v_R = __pyx_t_4; __pyx_t_4 = 0; /* "petsc4py/PETSc/petscmat.pxi":607 * if isinstance(other, (tuple, list)): * L, R = other * self.diagonalScale(L, R) # <<<<<<<<<<<<<< * else: * self.scale(other) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_diagonalScale); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 607, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_L, __pyx_v_R}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 607, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/petscmat.pxi":605 * * cdef Mat mat_imul(Mat self, other): * if isinstance(other, (tuple, list)): # <<<<<<<<<<<<<< * L, R = other * self.diagonalScale(L, R) */ goto __pyx_L3; } /* "petsc4py/PETSc/petscmat.pxi":609 * self.diagonalScale(L, R) * else: * self.scale(other) # <<<<<<<<<<<<<< * return self * */ /*else*/ { __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_scale); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 609, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_other}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 609, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_L3:; /* "petsc4py/PETSc/petscmat.pxi":610 * else: * self.scale(other) * return self # <<<<<<<<<<<<<< * * cdef Mat mat_idiv(Mat self, other): */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = __pyx_v_self; goto __pyx_L0; /* "petsc4py/PETSc/petscmat.pxi":604 * return self * * cdef Mat mat_imul(Mat self, other): # <<<<<<<<<<<<<< * if isinstance(other, (tuple, list)): * L, R = other */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.mat_imul", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_L); __Pyx_XDECREF(__pyx_v_R); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscmat.pxi":612 * return self * * cdef Mat mat_idiv(Mat self, other): # <<<<<<<<<<<<<< * if isinstance(other, (tuple, list)): * L, R = other */ static struct PyPetscMatObject *__pyx_f_8petsc4py_5PETSc_mat_idiv(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_v_L = NULL; PyObject *__pyx_v_R = NULL; struct PyPetscMatObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *(*__pyx_t_6)(PyObject *); int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mat_idiv", 0); __Pyx_INCREF(__pyx_v_other); /* "petsc4py/PETSc/petscmat.pxi":613 * * cdef Mat mat_idiv(Mat self, other): * if isinstance(other, (tuple, list)): # <<<<<<<<<<<<<< * L, R = other * if isinstance(L, Vec): */ __pyx_t_2 = PyTuple_Check(__pyx_v_other); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = PyList_Check(__pyx_v_other); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "petsc4py/PETSc/petscmat.pxi":614 * cdef Mat mat_idiv(Mat self, other): * if isinstance(other, (tuple, list)): * L, R = other # <<<<<<<<<<<<<< * if isinstance(L, Vec): * L = L.copy() */ if ((likely(PyTuple_CheckExact(__pyx_v_other))) || (PyList_CheckExact(__pyx_v_other))) { PyObject* sequence = __pyx_v_other; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(8, 614, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_3 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); #else __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { Py_ssize_t index = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_other); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); index = 0; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 1; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(8, 614, __pyx_L1_error) __pyx_t_6 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L7_unpacking_done; __pyx_L6_unpacking_failed:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(8, 614, __pyx_L1_error) __pyx_L7_unpacking_done:; } __pyx_v_L = __pyx_t_3; __pyx_t_3 = 0; __pyx_v_R = __pyx_t_4; __pyx_t_4 = 0; /* "petsc4py/PETSc/petscmat.pxi":615 * if isinstance(other, (tuple, list)): * L, R = other * if isinstance(L, Vec): # <<<<<<<<<<<<<< * L = L.copy() * L.reciprocal() */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_L, __pyx_ptype_8petsc4py_5PETSc_Vec); if (__pyx_t_1) { /* "petsc4py/PETSc/petscmat.pxi":616 * L, R = other * if isinstance(L, Vec): * L = L.copy() # <<<<<<<<<<<<<< * L.reciprocal() * if isinstance(R, Vec): */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_L, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 616, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 616, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF_SET(__pyx_v_L, __pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/petscmat.pxi":617 * if isinstance(L, Vec): * L = L.copy() * L.reciprocal() # <<<<<<<<<<<<<< * if isinstance(R, Vec): * R = R.copy() */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_L, __pyx_n_s_reciprocal); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/petscmat.pxi":615 * if isinstance(other, (tuple, list)): * L, R = other * if isinstance(L, Vec): # <<<<<<<<<<<<<< * L = L.copy() * L.reciprocal() */ } /* "petsc4py/PETSc/petscmat.pxi":618 * L = L.copy() * L.reciprocal() * if isinstance(R, Vec): # <<<<<<<<<<<<<< * R = R.copy() * R.reciprocal() */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_R, __pyx_ptype_8petsc4py_5PETSc_Vec); if (__pyx_t_1) { /* "petsc4py/PETSc/petscmat.pxi":619 * L.reciprocal() * if isinstance(R, Vec): * R = R.copy() # <<<<<<<<<<<<<< * R.reciprocal() * self.diagonalScale(L, R) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_R, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF_SET(__pyx_v_R, __pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/petscmat.pxi":620 * if isinstance(R, Vec): * R = R.copy() * R.reciprocal() # <<<<<<<<<<<<<< * self.diagonalScale(L, R) * else: */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_R, __pyx_n_s_reciprocal); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 620, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 620, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/petscmat.pxi":618 * L = L.copy() * L.reciprocal() * if isinstance(R, Vec): # <<<<<<<<<<<<<< * R = R.copy() * R.reciprocal() */ } /* "petsc4py/PETSc/petscmat.pxi":621 * R = R.copy() * R.reciprocal() * self.diagonalScale(L, R) # <<<<<<<<<<<<<< * else: * other = 1/other */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_diagonalScale); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 621, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_L, __pyx_v_R}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 621, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/petscmat.pxi":613 * * cdef Mat mat_idiv(Mat self, other): * if isinstance(other, (tuple, list)): # <<<<<<<<<<<<<< * L, R = other * if isinstance(L, Vec): */ goto __pyx_L3; } /* "petsc4py/PETSc/petscmat.pxi":623 * self.diagonalScale(L, R) * else: * other = 1/other # <<<<<<<<<<<<<< * self.scale(other) * return self */ /*else*/ { __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_int_1, __pyx_v_other); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 623, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_other, __pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/petscmat.pxi":624 * else: * other = 1/other * self.scale(other) # <<<<<<<<<<<<<< * return self * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_scale); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 624, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_other}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 624, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_L3:; /* "petsc4py/PETSc/petscmat.pxi":625 * other = 1/other * self.scale(other) * return self # <<<<<<<<<<<<<< * * # binary operations */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = __pyx_v_self; goto __pyx_L0; /* "petsc4py/PETSc/petscmat.pxi":612 * return self * * cdef Mat mat_idiv(Mat self, other): # <<<<<<<<<<<<<< * if isinstance(other, (tuple, list)): * L, R = other */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.mat_idiv", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_L); __Pyx_XDECREF(__pyx_v_R); __Pyx_XDECREF(__pyx_v_other); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscmat.pxi":629 * # binary operations * * cdef Mat mat_add(Mat self, other): # <<<<<<<<<<<<<< * return mat_iadd(mat_pos(self), other) * */ static struct PyPetscMatObject *__pyx_f_8petsc4py_5PETSc_mat_add(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other) { struct PyPetscMatObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mat_add", 1); /* "petsc4py/PETSc/petscmat.pxi":630 * * cdef Mat mat_add(Mat self, other): * return mat_iadd(mat_pos(self), other) # <<<<<<<<<<<<<< * * cdef Mat mat_sub(Mat self, other): */ __Pyx_XDECREF((PyObject *)__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_pos(__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 630, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_iadd(((struct PyPetscMatObject *)__pyx_t_1), __pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 630, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = ((struct PyPetscMatObject *)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/petscmat.pxi":629 * # binary operations * * cdef Mat mat_add(Mat self, other): # <<<<<<<<<<<<<< * return mat_iadd(mat_pos(self), other) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.mat_add", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscmat.pxi":632 * return mat_iadd(mat_pos(self), other) * * cdef Mat mat_sub(Mat self, other): # <<<<<<<<<<<<<< * return mat_isub(mat_pos(self), other) * */ static struct PyPetscMatObject *__pyx_f_8petsc4py_5PETSc_mat_sub(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other) { struct PyPetscMatObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mat_sub", 1); /* "petsc4py/PETSc/petscmat.pxi":633 * * cdef Mat mat_sub(Mat self, other): * return mat_isub(mat_pos(self), other) # <<<<<<<<<<<<<< * * cdef Vec mat_mul_vec(Mat self, Vec other): */ __Pyx_XDECREF((PyObject *)__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_pos(__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 633, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_isub(((struct PyPetscMatObject *)__pyx_t_1), __pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 633, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = ((struct PyPetscMatObject *)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/petscmat.pxi":632 * return mat_iadd(mat_pos(self), other) * * cdef Mat mat_sub(Mat self, other): # <<<<<<<<<<<<<< * return mat_isub(mat_pos(self), other) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.mat_sub", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscmat.pxi":635 * return mat_isub(mat_pos(self), other) * * cdef Vec mat_mul_vec(Mat self, Vec other): # <<<<<<<<<<<<<< * #CHKERR( MatMult(self.mat, other.vec, result.vec) ) * cdef Vec result = self.createVecLeft() */ static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_mat_mul_vec(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_other) { struct PyPetscVecObject *__pyx_v_result = 0; struct PyPetscVecObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mat_mul_vec", 1); /* "petsc4py/PETSc/petscmat.pxi":637 * cdef Vec mat_mul_vec(Mat self, Vec other): * #CHKERR( MatMult(self.mat, other.vec, result.vec) ) * cdef Vec result = self.createVecLeft() # <<<<<<<<<<<<<< * self.mult(other, result) * return result */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_createVecLeft); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 637, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 637, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(8, 637, __pyx_L1_error) __pyx_v_result = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscmat.pxi":638 * #CHKERR( MatMult(self.mat, other.vec, result.vec) ) * cdef Vec result = self.createVecLeft() * self.mult(other, result) # <<<<<<<<<<<<<< * return result * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mult); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 638, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, ((PyObject *)__pyx_v_other), ((PyObject *)__pyx_v_result)}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 638, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscmat.pxi":639 * cdef Vec result = self.createVecLeft() * self.mult(other, result) * return result # <<<<<<<<<<<<<< * * cdef Mat mat_mul_mat(Mat self, Mat other): */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_result); __pyx_r = __pyx_v_result; goto __pyx_L0; /* "petsc4py/PETSc/petscmat.pxi":635 * return mat_isub(mat_pos(self), other) * * cdef Vec mat_mul_vec(Mat self, Vec other): # <<<<<<<<<<<<<< * #CHKERR( MatMult(self.mat, other.vec, result.vec) ) * cdef Vec result = self.createVecLeft() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.mat_mul_vec", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_result); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscmat.pxi":641 * return result * * cdef Mat mat_mul_mat(Mat self, Mat other): # <<<<<<<<<<<<<< * return self.matMult(other) * */ static struct PyPetscMatObject *__pyx_f_8petsc4py_5PETSc_mat_mul_mat(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_other) { struct PyPetscMatObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mat_mul_mat", 1); /* "petsc4py/PETSc/petscmat.pxi":642 * * cdef Mat mat_mul_mat(Mat self, Mat other): * return self.matMult(other) # <<<<<<<<<<<<<< * * cdef object mat_mul(Mat self, other): */ __Pyx_XDECREF((PyObject *)__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_matMult); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 642, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_v_other)}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 642, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(8, 642, __pyx_L1_error) __pyx_r = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/petscmat.pxi":641 * return result * * cdef Mat mat_mul_mat(Mat self, Mat other): # <<<<<<<<<<<<<< * return self.matMult(other) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.mat_mul_mat", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscmat.pxi":644 * return self.matMult(other) * * cdef object mat_mul(Mat self, other): # <<<<<<<<<<<<<< * if isinstance(other, Vec): * return mat_mul_vec(self, other) */ static PyObject *__pyx_f_8petsc4py_5PETSc_mat_mul(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mat_mul", 1); /* "petsc4py/PETSc/petscmat.pxi":645 * * cdef object mat_mul(Mat self, other): * if isinstance(other, Vec): # <<<<<<<<<<<<<< * return mat_mul_vec(self, other) * elif isinstance(other, Mat): */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Vec); if (__pyx_t_1) { /* "petsc4py/PETSc/petscmat.pxi":646 * cdef object mat_mul(Mat self, other): * if isinstance(other, Vec): * return mat_mul_vec(self, other) # <<<<<<<<<<<<<< * elif isinstance(other, Mat): * return mat_mul_mat(self, other) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_mul_vec(__pyx_v_self, ((struct PyPetscVecObject *)__pyx_v_other))); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/petscmat.pxi":645 * * cdef object mat_mul(Mat self, other): * if isinstance(other, Vec): # <<<<<<<<<<<<<< * return mat_mul_vec(self, other) * elif isinstance(other, Mat): */ } /* "petsc4py/PETSc/petscmat.pxi":647 * if isinstance(other, Vec): * return mat_mul_vec(self, other) * elif isinstance(other, Mat): # <<<<<<<<<<<<<< * return mat_mul_mat(self, other) * else: */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Mat); if (__pyx_t_1) { /* "petsc4py/PETSc/petscmat.pxi":648 * return mat_mul_vec(self, other) * elif isinstance(other, Mat): * return mat_mul_mat(self, other) # <<<<<<<<<<<<<< * else: * return mat_imul(mat_pos(self), other) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_mul_mat(__pyx_v_self, ((struct PyPetscMatObject *)__pyx_v_other))); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/petscmat.pxi":647 * if isinstance(other, Vec): * return mat_mul_vec(self, other) * elif isinstance(other, Mat): # <<<<<<<<<<<<<< * return mat_mul_mat(self, other) * else: */ } /* "petsc4py/PETSc/petscmat.pxi":650 * return mat_mul_mat(self, other) * else: * return mat_imul(mat_pos(self), other) # <<<<<<<<<<<<<< * * cdef Mat mat_div(Mat self, other): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_pos(__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 650, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_imul(((struct PyPetscMatObject *)__pyx_t_2), __pyx_v_other)); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 650, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } /* "petsc4py/PETSc/petscmat.pxi":644 * return self.matMult(other) * * cdef object mat_mul(Mat self, other): # <<<<<<<<<<<<<< * if isinstance(other, Vec): * return mat_mul_vec(self, other) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.mat_mul", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscmat.pxi":652 * return mat_imul(mat_pos(self), other) * * cdef Mat mat_div(Mat self, other): # <<<<<<<<<<<<<< * return mat_idiv(mat_pos(self), other) * */ static struct PyPetscMatObject *__pyx_f_8petsc4py_5PETSc_mat_div(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other) { struct PyPetscMatObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mat_div", 1); /* "petsc4py/PETSc/petscmat.pxi":653 * * cdef Mat mat_div(Mat self, other): * return mat_idiv(mat_pos(self), other) # <<<<<<<<<<<<<< * * cdef object mat_matmul(Mat self, other): */ __Pyx_XDECREF((PyObject *)__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_pos(__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_idiv(((struct PyPetscMatObject *)__pyx_t_1), __pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = ((struct PyPetscMatObject *)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/petscmat.pxi":652 * return mat_imul(mat_pos(self), other) * * cdef Mat mat_div(Mat self, other): # <<<<<<<<<<<<<< * return mat_idiv(mat_pos(self), other) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.mat_div", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscmat.pxi":655 * return mat_idiv(mat_pos(self), other) * * cdef object mat_matmul(Mat self, other): # <<<<<<<<<<<<<< * if isinstance(other, Vec): * return mat_mul_vec(self, other) */ static PyObject *__pyx_f_8petsc4py_5PETSc_mat_matmul(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mat_matmul", 1); /* "petsc4py/PETSc/petscmat.pxi":656 * * cdef object mat_matmul(Mat self, other): * if isinstance(other, Vec): # <<<<<<<<<<<<<< * return mat_mul_vec(self, other) * if isinstance(other, Mat): */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Vec); if (__pyx_t_1) { /* "petsc4py/PETSc/petscmat.pxi":657 * cdef object mat_matmul(Mat self, other): * if isinstance(other, Vec): * return mat_mul_vec(self, other) # <<<<<<<<<<<<<< * if isinstance(other, Mat): * return mat_mul_mat(self, other) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_mul_vec(__pyx_v_self, ((struct PyPetscVecObject *)__pyx_v_other))); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 657, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/petscmat.pxi":656 * * cdef object mat_matmul(Mat self, other): * if isinstance(other, Vec): # <<<<<<<<<<<<<< * return mat_mul_vec(self, other) * if isinstance(other, Mat): */ } /* "petsc4py/PETSc/petscmat.pxi":658 * if isinstance(other, Vec): * return mat_mul_vec(self, other) * if isinstance(other, Mat): # <<<<<<<<<<<<<< * return mat_mul_mat(self, other) * return NotImplemented */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Mat); if (__pyx_t_1) { /* "petsc4py/PETSc/petscmat.pxi":659 * return mat_mul_vec(self, other) * if isinstance(other, Mat): * return mat_mul_mat(self, other) # <<<<<<<<<<<<<< * return NotImplemented * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_mul_mat(__pyx_v_self, ((struct PyPetscMatObject *)__pyx_v_other))); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 659, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/petscmat.pxi":658 * if isinstance(other, Vec): * return mat_mul_vec(self, other) * if isinstance(other, Mat): # <<<<<<<<<<<<<< * return mat_mul_mat(self, other) * return NotImplemented */ } /* "petsc4py/PETSc/petscmat.pxi":660 * if isinstance(other, Mat): * return mat_mul_mat(self, other) * return NotImplemented # <<<<<<<<<<<<<< * * # reflected binary operations */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_builtin_NotImplemented); __pyx_r = __pyx_builtin_NotImplemented; goto __pyx_L0; /* "petsc4py/PETSc/petscmat.pxi":655 * return mat_idiv(mat_pos(self), other) * * cdef object mat_matmul(Mat self, other): # <<<<<<<<<<<<<< * if isinstance(other, Vec): * return mat_mul_vec(self, other) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.mat_matmul", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscmat.pxi":664 * # reflected binary operations * * cdef Mat mat_radd(Mat self, other): # <<<<<<<<<<<<<< * return mat_add(self, other) * */ static struct PyPetscMatObject *__pyx_f_8petsc4py_5PETSc_mat_radd(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other) { struct PyPetscMatObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mat_radd", 1); /* "petsc4py/PETSc/petscmat.pxi":665 * * cdef Mat mat_radd(Mat self, other): * return mat_add(self, other) # <<<<<<<<<<<<<< * * cdef Mat mat_rsub(Mat self, other): */ __Pyx_XDECREF((PyObject *)__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_add(__pyx_v_self, __pyx_v_other)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/petscmat.pxi":664 * # reflected binary operations * * cdef Mat mat_radd(Mat self, other): # <<<<<<<<<<<<<< * return mat_add(self, other) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.mat_radd", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscmat.pxi":667 * return mat_add(self, other) * * cdef Mat mat_rsub(Mat self, other): # <<<<<<<<<<<<<< * cdef Mat mat = mat_sub(self, other) * mat.scale(-1) */ static struct PyPetscMatObject *__pyx_f_8petsc4py_5PETSc_mat_rsub(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other) { struct PyPetscMatObject *__pyx_v_mat = 0; struct PyPetscMatObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mat_rsub", 1); /* "petsc4py/PETSc/petscmat.pxi":668 * * cdef Mat mat_rsub(Mat self, other): * cdef Mat mat = mat_sub(self, other) # <<<<<<<<<<<<<< * mat.scale(-1) * return mat */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_sub(__pyx_v_self, __pyx_v_other)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_mat = ((struct PyPetscMatObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscmat.pxi":669 * cdef Mat mat_rsub(Mat self, other): * cdef Mat mat = mat_sub(self, other) * mat.scale(-1) # <<<<<<<<<<<<<< * return mat * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_mat), __pyx_n_s_scale); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 669, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_int_neg_1}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 669, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscmat.pxi":670 * cdef Mat mat = mat_sub(self, other) * mat.scale(-1) * return mat # <<<<<<<<<<<<<< * * cdef Mat mat_rmul(Mat self, other): */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_mat); __pyx_r = __pyx_v_mat; goto __pyx_L0; /* "petsc4py/PETSc/petscmat.pxi":667 * return mat_add(self, other) * * cdef Mat mat_rsub(Mat self, other): # <<<<<<<<<<<<<< * cdef Mat mat = mat_sub(self, other) * mat.scale(-1) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.mat_rsub", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_mat); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscmat.pxi":672 * return mat * * cdef Mat mat_rmul(Mat self, other): # <<<<<<<<<<<<<< * return mat_mul(self, other) * */ static struct PyPetscMatObject *__pyx_f_8petsc4py_5PETSc_mat_rmul(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other) { struct PyPetscMatObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mat_rmul", 1); /* "petsc4py/PETSc/petscmat.pxi":673 * * cdef Mat mat_rmul(Mat self, other): * return mat_mul(self, other) # <<<<<<<<<<<<<< * * cdef Mat mat_rdiv(Mat self, other): */ __Pyx_XDECREF((PyObject *)__pyx_r); __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_mat_mul(__pyx_v_self, __pyx_v_other); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 673, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(8, 673, __pyx_L1_error) __pyx_r = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/petscmat.pxi":672 * return mat * * cdef Mat mat_rmul(Mat self, other): # <<<<<<<<<<<<<< * return mat_mul(self, other) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.mat_rmul", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscmat.pxi":675 * return mat_mul(self, other) * * cdef Mat mat_rdiv(Mat self, other): # <<<<<<<<<<<<<< * self; other; # unused * return NotImplemented */ static struct PyPetscMatObject *__pyx_f_8petsc4py_5PETSc_mat_rdiv(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other) { struct PyPetscMatObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mat_rdiv", 1); /* "petsc4py/PETSc/petscmat.pxi":676 * * cdef Mat mat_rdiv(Mat self, other): * self; other; # unused # <<<<<<<<<<<<<< * return NotImplemented * */ ((void)__pyx_v_self); ((void)__pyx_v_other); /* "petsc4py/PETSc/petscmat.pxi":677 * cdef Mat mat_rdiv(Mat self, other): * self; other; # unused * return NotImplemented # <<<<<<<<<<<<<< * * # ----------------------------------------------------------------------------- */ __Pyx_XDECREF((PyObject *)__pyx_r); if (!(likely(((__pyx_builtin_NotImplemented) == Py_None) || likely(__Pyx_TypeTest(__pyx_builtin_NotImplemented, __pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(8, 677, __pyx_L1_error) __Pyx_INCREF(__pyx_builtin_NotImplemented); __pyx_r = ((struct PyPetscMatObject *)__pyx_builtin_NotImplemented); goto __pyx_L0; /* "petsc4py/PETSc/petscmat.pxi":675 * return mat_mul(self, other) * * cdef Mat mat_rdiv(Mat self, other): # <<<<<<<<<<<<<< * self; other; # unused * return NotImplemented */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.mat_rdiv", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscmat.pxi":681 * # ----------------------------------------------------------------------------- * * cdef inline PetscMatStructure matstructure(object structure) \ # <<<<<<<<<<<<<< * except (-1): * if structure is None: return MAT_DIFFERENT_NONZERO_PATTERN */ static CYTHON_INLINE MatStructure __pyx_f_8petsc4py_5PETSc_matstructure(PyObject *__pyx_v_structure) { MatStructure __pyx_r; int __pyx_t_1; MatStructure __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "petsc4py/PETSc/petscmat.pxi":683 * cdef inline PetscMatStructure matstructure(object structure) \ * except (-1): * if structure is None: return MAT_DIFFERENT_NONZERO_PATTERN # <<<<<<<<<<<<<< * elif structure is False: return MAT_DIFFERENT_NONZERO_PATTERN * elif structure is True: return MAT_SAME_NONZERO_PATTERN */ __pyx_t_1 = (__pyx_v_structure == Py_None); if (__pyx_t_1) { __pyx_r = DIFFERENT_NONZERO_PATTERN; goto __pyx_L0; } /* "petsc4py/PETSc/petscmat.pxi":684 * except (-1): * if structure is None: return MAT_DIFFERENT_NONZERO_PATTERN * elif structure is False: return MAT_DIFFERENT_NONZERO_PATTERN # <<<<<<<<<<<<<< * elif structure is True: return MAT_SAME_NONZERO_PATTERN * else: return structure */ __pyx_t_1 = (__pyx_v_structure == Py_False); if (__pyx_t_1) { __pyx_r = DIFFERENT_NONZERO_PATTERN; goto __pyx_L0; } /* "petsc4py/PETSc/petscmat.pxi":685 * if structure is None: return MAT_DIFFERENT_NONZERO_PATTERN * elif structure is False: return MAT_DIFFERENT_NONZERO_PATTERN * elif structure is True: return MAT_SAME_NONZERO_PATTERN # <<<<<<<<<<<<<< * else: return structure * */ __pyx_t_1 = (__pyx_v_structure == Py_True); if (__pyx_t_1) { __pyx_r = SAME_NONZERO_PATTERN; goto __pyx_L0; } /* "petsc4py/PETSc/petscmat.pxi":686 * elif structure is False: return MAT_DIFFERENT_NONZERO_PATTERN * elif structure is True: return MAT_SAME_NONZERO_PATTERN * else: return structure # <<<<<<<<<<<<<< * * cdef inline PetscMatAssemblyType assemblytype(object assembly) \ */ /*else*/ { __pyx_t_2 = ((MatStructure)__Pyx_PyInt_As_MatStructure(__pyx_v_structure)); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 686, __pyx_L1_error) __pyx_r = __pyx_t_2; goto __pyx_L0; } /* "petsc4py/PETSc/petscmat.pxi":681 * # ----------------------------------------------------------------------------- * * cdef inline PetscMatStructure matstructure(object structure) \ # <<<<<<<<<<<<<< * except (-1): * if structure is None: return MAT_DIFFERENT_NONZERO_PATTERN */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.matstructure", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = ((MatStructure)-1L); __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/petscmat.pxi":688 * else: return structure * * cdef inline PetscMatAssemblyType assemblytype(object assembly) \ # <<<<<<<<<<<<<< * except (-1): * if assembly is None: return MAT_FINAL_ASSEMBLY */ static CYTHON_INLINE MatAssemblyType __pyx_f_8petsc4py_5PETSc_assemblytype(PyObject *__pyx_v_assembly) { MatAssemblyType __pyx_r; int __pyx_t_1; MatAssemblyType __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "petsc4py/PETSc/petscmat.pxi":690 * cdef inline PetscMatAssemblyType assemblytype(object assembly) \ * except (-1): * if assembly is None: return MAT_FINAL_ASSEMBLY # <<<<<<<<<<<<<< * elif assembly is False: return MAT_FINAL_ASSEMBLY * elif assembly is True: return MAT_FLUSH_ASSEMBLY */ __pyx_t_1 = (__pyx_v_assembly == Py_None); if (__pyx_t_1) { __pyx_r = MAT_FINAL_ASSEMBLY; goto __pyx_L0; } /* "petsc4py/PETSc/petscmat.pxi":691 * except (-1): * if assembly is None: return MAT_FINAL_ASSEMBLY * elif assembly is False: return MAT_FINAL_ASSEMBLY # <<<<<<<<<<<<<< * elif assembly is True: return MAT_FLUSH_ASSEMBLY * else: return assembly */ __pyx_t_1 = (__pyx_v_assembly == Py_False); if (__pyx_t_1) { __pyx_r = MAT_FINAL_ASSEMBLY; goto __pyx_L0; } /* "petsc4py/PETSc/petscmat.pxi":692 * if assembly is None: return MAT_FINAL_ASSEMBLY * elif assembly is False: return MAT_FINAL_ASSEMBLY * elif assembly is True: return MAT_FLUSH_ASSEMBLY # <<<<<<<<<<<<<< * else: return assembly * */ __pyx_t_1 = (__pyx_v_assembly == Py_True); if (__pyx_t_1) { __pyx_r = MAT_FLUSH_ASSEMBLY; goto __pyx_L0; } /* "petsc4py/PETSc/petscmat.pxi":693 * elif assembly is False: return MAT_FINAL_ASSEMBLY * elif assembly is True: return MAT_FLUSH_ASSEMBLY * else: return assembly # <<<<<<<<<<<<<< * * cdef inline PetscMatInfoType infotype(object info) \ */ /*else*/ { __pyx_t_2 = ((MatAssemblyType)__Pyx_PyInt_As_MatAssemblyType(__pyx_v_assembly)); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 693, __pyx_L1_error) __pyx_r = __pyx_t_2; goto __pyx_L0; } /* "petsc4py/PETSc/petscmat.pxi":688 * else: return structure * * cdef inline PetscMatAssemblyType assemblytype(object assembly) \ # <<<<<<<<<<<<<< * except (-1): * if assembly is None: return MAT_FINAL_ASSEMBLY */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.assemblytype", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = ((MatAssemblyType)-1L); __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/petscmat.pxi":695 * else: return assembly * * cdef inline PetscMatInfoType infotype(object info) \ # <<<<<<<<<<<<<< * except (-1): * if info is None: return MAT_GLOBAL_SUM */ static CYTHON_INLINE MatInfoType __pyx_f_8petsc4py_5PETSc_infotype(PyObject *__pyx_v_info) { MatInfoType __pyx_r; int __pyx_t_1; MatInfoType __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "petsc4py/PETSc/petscmat.pxi":697 * cdef inline PetscMatInfoType infotype(object info) \ * except (-1): * if info is None: return MAT_GLOBAL_SUM # <<<<<<<<<<<<<< * else: return info * */ __pyx_t_1 = (__pyx_v_info == Py_None); if (__pyx_t_1) { __pyx_r = MAT_GLOBAL_SUM; goto __pyx_L0; } /* "petsc4py/PETSc/petscmat.pxi":698 * except (-1): * if info is None: return MAT_GLOBAL_SUM * else: return info # <<<<<<<<<<<<<< * * # ----------------------------------------------------------------------------- */ /*else*/ { __pyx_t_2 = ((MatInfoType)__Pyx_PyInt_As_MatInfoType(__pyx_v_info)); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 698, __pyx_L1_error) __pyx_r = __pyx_t_2; goto __pyx_L0; } /* "petsc4py/PETSc/petscmat.pxi":695 * else: return assembly * * cdef inline PetscMatInfoType infotype(object info) \ # <<<<<<<<<<<<<< * except (-1): * if info is None: return MAT_GLOBAL_SUM */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.infotype", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = ((MatInfoType)-1L); __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/petscmat.pxi":702 * # ----------------------------------------------------------------------------- * * cdef inline PetscErrorCode Mat_Sizes( # <<<<<<<<<<<<<< * object size, object bsize, * PetscInt *r, PetscInt *c, */ static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_Mat_Sizes(PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PetscInt *__pyx_v_r, PetscInt *__pyx_v_c, PetscInt *__pyx_v_m, PetscInt *__pyx_v_n, PetscInt *__pyx_v_M, PetscInt *__pyx_v_N) { PyObject *__pyx_v_rsize = 0; PyObject *__pyx_v_csize = 0; PyObject *__pyx_v_rbsize = 0; PyObject *__pyx_v_cbsize = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); int __pyx_t_8; PetscErrorCode __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("Mat_Sizes", 1); /* "petsc4py/PETSc/petscmat.pxi":710 * # unpack row and column sizes * cdef object rsize, csize * try: # <<<<<<<<<<<<<< * rsize , csize = size * except (TypeError, ValueError): */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { /* "petsc4py/PETSc/petscmat.pxi":711 * cdef object rsize, csize * try: * rsize , csize = size # <<<<<<<<<<<<<< * except (TypeError, ValueError): * rsize = csize = size */ if ((likely(PyTuple_CheckExact(__pyx_v_size))) || (PyList_CheckExact(__pyx_v_size))) { PyObject* sequence = __pyx_v_size; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(8, 711, __pyx_L3_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_4 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 711, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 711, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 711, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); index = 0; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L9_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L9_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(8, 711, __pyx_L3_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L10_unpacking_done; __pyx_L9_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(8, 711, __pyx_L3_error) __pyx_L10_unpacking_done:; } __pyx_v_rsize = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_csize = __pyx_t_5; __pyx_t_5 = 0; /* "petsc4py/PETSc/petscmat.pxi":710 * # unpack row and column sizes * cdef object rsize, csize * try: # <<<<<<<<<<<<<< * rsize , csize = size * except (TypeError, ValueError): */ } __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; /* "petsc4py/PETSc/petscmat.pxi":712 * try: * rsize , csize = size * except (TypeError, ValueError): # <<<<<<<<<<<<<< * rsize = csize = size * # unpack row and column block sizes */ __pyx_t_8 = __Pyx_PyErr_ExceptionMatches2(__pyx_builtin_TypeError, __pyx_builtin_ValueError); if (__pyx_t_8) { __Pyx_AddTraceback("petsc4py.PETSc.Mat_Sizes", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_6) < 0) __PYX_ERR(8, 712, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_6); /* "petsc4py/PETSc/petscmat.pxi":713 * rsize , csize = size * except (TypeError, ValueError): * rsize = csize = size # <<<<<<<<<<<<<< * # unpack row and column block sizes * cdef object rbsize, cbsize */ __Pyx_INCREF(__pyx_v_size); __Pyx_XDECREF_SET(__pyx_v_rsize, __pyx_v_size); __Pyx_INCREF(__pyx_v_size); __Pyx_XDECREF_SET(__pyx_v_csize, __pyx_v_size); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L4_exception_handled; } goto __pyx_L5_except_error; /* "petsc4py/PETSc/petscmat.pxi":710 * # unpack row and column sizes * cdef object rsize, csize * try: # <<<<<<<<<<<<<< * rsize , csize = size * except (TypeError, ValueError): */ __pyx_L5_except_error:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; __pyx_L4_exception_handled:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); __pyx_L8_try_end:; } /* "petsc4py/PETSc/petscmat.pxi":716 * # unpack row and column block sizes * cdef object rbsize, cbsize * try: # <<<<<<<<<<<<<< * rbsize , cbsize = bsize * except (TypeError, ValueError): */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_1); /*try:*/ { /* "petsc4py/PETSc/petscmat.pxi":717 * cdef object rbsize, cbsize * try: * rbsize , cbsize = bsize # <<<<<<<<<<<<<< * except (TypeError, ValueError): * rbsize = cbsize = bsize */ if ((likely(PyTuple_CheckExact(__pyx_v_bsize))) || (PyList_CheckExact(__pyx_v_bsize))) { PyObject* sequence = __pyx_v_bsize; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(8, 717, __pyx_L13_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_6 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_4); #else __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 717, __pyx_L13_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 717, __pyx_L13_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { Py_ssize_t index = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_bsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 717, __pyx_L13_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); index = 0; __pyx_t_6 = __pyx_t_7(__pyx_t_5); if (unlikely(!__pyx_t_6)) goto __pyx_L19_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L19_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_5), 2) < 0) __PYX_ERR(8, 717, __pyx_L13_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L20_unpacking_done; __pyx_L19_unpacking_failed:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(8, 717, __pyx_L13_error) __pyx_L20_unpacking_done:; } __pyx_v_rbsize = __pyx_t_6; __pyx_t_6 = 0; __pyx_v_cbsize = __pyx_t_4; __pyx_t_4 = 0; /* "petsc4py/PETSc/petscmat.pxi":716 * # unpack row and column block sizes * cdef object rbsize, cbsize * try: # <<<<<<<<<<<<<< * rbsize , cbsize = bsize * except (TypeError, ValueError): */ } __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L18_try_end; __pyx_L13_error:; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; /* "petsc4py/PETSc/petscmat.pxi":718 * try: * rbsize , cbsize = bsize * except (TypeError, ValueError): # <<<<<<<<<<<<<< * rbsize = cbsize = bsize * # split row and column sizes */ __pyx_t_8 = __Pyx_PyErr_ExceptionMatches2(__pyx_builtin_TypeError, __pyx_builtin_ValueError); if (__pyx_t_8) { __Pyx_AddTraceback("petsc4py.PETSc.Mat_Sizes", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_5) < 0) __PYX_ERR(8, 718, __pyx_L15_except_error) __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_5); /* "petsc4py/PETSc/petscmat.pxi":719 * rbsize , cbsize = bsize * except (TypeError, ValueError): * rbsize = cbsize = bsize # <<<<<<<<<<<<<< * # split row and column sizes * Sys_Sizes(rsize, rbsize, r, m, M) */ __Pyx_INCREF(__pyx_v_bsize); __Pyx_XDECREF_SET(__pyx_v_rbsize, __pyx_v_bsize); __Pyx_INCREF(__pyx_v_bsize); __Pyx_XDECREF_SET(__pyx_v_cbsize, __pyx_v_bsize); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L14_exception_handled; } goto __pyx_L15_except_error; /* "petsc4py/PETSc/petscmat.pxi":716 * # unpack row and column block sizes * cdef object rbsize, cbsize * try: # <<<<<<<<<<<<<< * rbsize , cbsize = bsize * except (TypeError, ValueError): */ __pyx_L15_except_error:; __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_1); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1); goto __pyx_L1_error; __pyx_L14_exception_handled:; __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_1); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1); __pyx_L18_try_end:; } /* "petsc4py/PETSc/petscmat.pxi":721 * rbsize = cbsize = bsize * # split row and column sizes * Sys_Sizes(rsize, rbsize, r, m, M) # <<<<<<<<<<<<<< * Sys_Sizes(csize, cbsize, c, n, N) * return PETSC_SUCCESS */ __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_Sys_Sizes(__pyx_v_rsize, __pyx_v_rbsize, __pyx_v_r, __pyx_v_m, __pyx_v_M); if (unlikely(__pyx_t_9 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(8, 721, __pyx_L1_error) /* "petsc4py/PETSc/petscmat.pxi":722 * # split row and column sizes * Sys_Sizes(rsize, rbsize, r, m, M) * Sys_Sizes(csize, cbsize, c, n, N) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_Sys_Sizes(__pyx_v_csize, __pyx_v_cbsize, __pyx_v_c, __pyx_v_n, __pyx_v_N); if (unlikely(__pyx_t_9 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(8, 722, __pyx_L1_error) /* "petsc4py/PETSc/petscmat.pxi":723 * Sys_Sizes(rsize, rbsize, r, m, M) * Sys_Sizes(csize, cbsize, c, n, N) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * cdef inline PetscErrorCode Mat_Create( */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petscmat.pxi":702 * # ----------------------------------------------------------------------------- * * cdef inline PetscErrorCode Mat_Sizes( # <<<<<<<<<<<<<< * object size, object bsize, * PetscInt *r, PetscInt *c, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.Mat_Sizes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rsize); __Pyx_XDECREF(__pyx_v_csize); __Pyx_XDECREF(__pyx_v_rbsize); __Pyx_XDECREF(__pyx_v_cbsize); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscmat.pxi":725 * return PETSC_SUCCESS * * cdef inline PetscErrorCode Mat_Create( # <<<<<<<<<<<<<< * PetscMatType mtype, * object comm, */ static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_Mat_Create(MatType __pyx_v_mtype, PyObject *__pyx_v_comm, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, Mat *__pyx_v_A) { MPI_Comm __pyx_v_ccomm; PetscInt __pyx_v_rbs; PetscInt __pyx_v_cbs; PetscInt __pyx_v_m; PetscInt __pyx_v_n; PetscInt __pyx_v_M; PetscInt __pyx_v_N; Mat __pyx_v_mat; PetscErrorCode __pyx_r; MPI_Comm __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "petsc4py/PETSc/petscmat.pxi":733 * ) except PETSC_ERR_PYTHON: * # communicator * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * # sizes and block sizes * cdef PetscInt rbs = 0, cbs = 0, m = 0, n = 0, M = 0, N = 0 */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(8, 733, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/petscmat.pxi":735 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * # sizes and block sizes * cdef PetscInt rbs = 0, cbs = 0, m = 0, n = 0, M = 0, N = 0 # <<<<<<<<<<<<<< * Mat_Sizes(size, bsize, &rbs, &cbs, &m, &n, &M, &N) * if rbs == PETSC_DECIDE: rbs = 1 */ __pyx_v_rbs = 0; __pyx_v_cbs = 0; __pyx_v_m = 0; __pyx_v_n = 0; __pyx_v_M = 0; __pyx_v_N = 0; /* "petsc4py/PETSc/petscmat.pxi":736 * # sizes and block sizes * cdef PetscInt rbs = 0, cbs = 0, m = 0, n = 0, M = 0, N = 0 * Mat_Sizes(size, bsize, &rbs, &cbs, &m, &n, &M, &N) # <<<<<<<<<<<<<< * if rbs == PETSC_DECIDE: rbs = 1 * if cbs == PETSC_DECIDE: cbs = rbs */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_Mat_Sizes(__pyx_v_size, __pyx_v_bsize, (&__pyx_v_rbs), (&__pyx_v_cbs), (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_M), (&__pyx_v_N)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(8, 736, __pyx_L1_error) /* "petsc4py/PETSc/petscmat.pxi":737 * cdef PetscInt rbs = 0, cbs = 0, m = 0, n = 0, M = 0, N = 0 * Mat_Sizes(size, bsize, &rbs, &cbs, &m, &n, &M, &N) * if rbs == PETSC_DECIDE: rbs = 1 # <<<<<<<<<<<<<< * if cbs == PETSC_DECIDE: cbs = rbs * Sys_Layout(ccomm, rbs, &m, &M) */ __pyx_t_3 = (__pyx_v_rbs == PETSC_DECIDE); if (__pyx_t_3) { __pyx_v_rbs = 1; } /* "petsc4py/PETSc/petscmat.pxi":738 * Mat_Sizes(size, bsize, &rbs, &cbs, &m, &n, &M, &N) * if rbs == PETSC_DECIDE: rbs = 1 * if cbs == PETSC_DECIDE: cbs = rbs # <<<<<<<<<<<<<< * Sys_Layout(ccomm, rbs, &m, &M) * Sys_Layout(ccomm, cbs, &n, &N) */ __pyx_t_3 = (__pyx_v_cbs == PETSC_DECIDE); if (__pyx_t_3) { __pyx_v_cbs = __pyx_v_rbs; } /* "petsc4py/PETSc/petscmat.pxi":739 * if rbs == PETSC_DECIDE: rbs = 1 * if cbs == PETSC_DECIDE: cbs = rbs * Sys_Layout(ccomm, rbs, &m, &M) # <<<<<<<<<<<<<< * Sys_Layout(ccomm, cbs, &n, &N) * # create matrix and set sizes */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_Sys_Layout(__pyx_v_ccomm, __pyx_v_rbs, (&__pyx_v_m), (&__pyx_v_M)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(8, 739, __pyx_L1_error) /* "petsc4py/PETSc/petscmat.pxi":740 * if cbs == PETSC_DECIDE: cbs = rbs * Sys_Layout(ccomm, rbs, &m, &M) * Sys_Layout(ccomm, cbs, &n, &N) # <<<<<<<<<<<<<< * # create matrix and set sizes * cdef PetscMat mat = NULL */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_Sys_Layout(__pyx_v_ccomm, __pyx_v_cbs, (&__pyx_v_n), (&__pyx_v_N)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(8, 740, __pyx_L1_error) /* "petsc4py/PETSc/petscmat.pxi":742 * Sys_Layout(ccomm, cbs, &n, &N) * # create matrix and set sizes * cdef PetscMat mat = NULL # <<<<<<<<<<<<<< * CHKERR( MatCreate(ccomm, &mat) ) * CHKERR( MatSetSizes(mat, m, n, M, N) ) */ __pyx_v_mat = NULL; /* "petsc4py/PETSc/petscmat.pxi":743 * # create matrix and set sizes * cdef PetscMat mat = NULL * CHKERR( MatCreate(ccomm, &mat) ) # <<<<<<<<<<<<<< * CHKERR( MatSetSizes(mat, m, n, M, N) ) * CHKERR( MatSetBlockSizes(mat, rbs, cbs) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreate(__pyx_v_ccomm, (&__pyx_v_mat))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(8, 743, __pyx_L1_error) /* "petsc4py/PETSc/petscmat.pxi":744 * cdef PetscMat mat = NULL * CHKERR( MatCreate(ccomm, &mat) ) * CHKERR( MatSetSizes(mat, m, n, M, N) ) # <<<<<<<<<<<<<< * CHKERR( MatSetBlockSizes(mat, rbs, cbs) ) * CHKERR( MatSetType(mat, mtype) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSetSizes(__pyx_v_mat, __pyx_v_m, __pyx_v_n, __pyx_v_M, __pyx_v_N)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(8, 744, __pyx_L1_error) /* "petsc4py/PETSc/petscmat.pxi":745 * CHKERR( MatCreate(ccomm, &mat) ) * CHKERR( MatSetSizes(mat, m, n, M, N) ) * CHKERR( MatSetBlockSizes(mat, rbs, cbs) ) # <<<<<<<<<<<<<< * CHKERR( MatSetType(mat, mtype) ) * A[0] = mat */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSetBlockSizes(__pyx_v_mat, __pyx_v_rbs, __pyx_v_cbs)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(8, 745, __pyx_L1_error) /* "petsc4py/PETSc/petscmat.pxi":746 * CHKERR( MatSetSizes(mat, m, n, M, N) ) * CHKERR( MatSetBlockSizes(mat, rbs, cbs) ) * CHKERR( MatSetType(mat, mtype) ) # <<<<<<<<<<<<<< * A[0] = mat * return PETSC_SUCCESS */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSetType(__pyx_v_mat, __pyx_v_mtype)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(8, 746, __pyx_L1_error) /* "petsc4py/PETSc/petscmat.pxi":747 * CHKERR( MatSetBlockSizes(mat, rbs, cbs) ) * CHKERR( MatSetType(mat, mtype) ) * A[0] = mat # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ (__pyx_v_A[0]) = __pyx_v_mat; /* "petsc4py/PETSc/petscmat.pxi":748 * CHKERR( MatSetType(mat, mtype) ) * A[0] = mat * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * cdef inline PetscErrorCode Mat_AllocAIJ_NNZ( PetscMat A, object NNZ) except PETSC_ERR_PYTHON: */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petscmat.pxi":725 * return PETSC_SUCCESS * * cdef inline PetscErrorCode Mat_Create( # <<<<<<<<<<<<<< * PetscMatType mtype, * object comm, */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat_Create", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/petscmat.pxi":750 * return PETSC_SUCCESS * * cdef inline PetscErrorCode Mat_AllocAIJ_NNZ( PetscMat A, object NNZ) except PETSC_ERR_PYTHON: # <<<<<<<<<<<<<< * # * cdef PetscBool aij=PETSC_FALSE, baij=PETSC_FALSE, sbaij=PETSC_FALSE, aijis=PETSC_FALSE */ static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_Mat_AllocAIJ_NNZ(Mat __pyx_v_A, PyObject *__pyx_v_NNZ) { PetscBool __pyx_v_aij; PetscBool __pyx_v_baij; PetscBool __pyx_v_sbaij; PetscBool __pyx_v_aijis; PetscInt __pyx_v_m; PetscInt __pyx_v_bs; PyObject *__pyx_v_od_nnz = 0; PyObject *__pyx_v_oo_nnz = 0; PetscInt __pyx_v_d_nz; PetscInt __pyx_v_d_n; PetscInt *__pyx_v_d_nnz; PetscInt __pyx_v_o_nz; PetscInt __pyx_v_o_n; PetscInt *__pyx_v_o_nnz; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *(*__pyx_t_10)(PyObject *); int __pyx_t_11; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("Mat_AllocAIJ_NNZ", 1); /* "petsc4py/PETSc/petscmat.pxi":752 * cdef inline PetscErrorCode Mat_AllocAIJ_NNZ( PetscMat A, object NNZ) except PETSC_ERR_PYTHON: * # * cdef PetscBool aij=PETSC_FALSE, baij=PETSC_FALSE, sbaij=PETSC_FALSE, aijis=PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( MatHasPreallocationAIJ(A, &aij, &baij, &sbaij, &aijis)) * # local row size and block size */ __pyx_v_aij = PETSC_FALSE; __pyx_v_baij = PETSC_FALSE; __pyx_v_sbaij = PETSC_FALSE; __pyx_v_aijis = PETSC_FALSE; /* "petsc4py/PETSc/petscmat.pxi":753 * # * cdef PetscBool aij=PETSC_FALSE, baij=PETSC_FALSE, sbaij=PETSC_FALSE, aijis=PETSC_FALSE * CHKERR( MatHasPreallocationAIJ(A, &aij, &baij, &sbaij, &aijis)) # <<<<<<<<<<<<<< * # local row size and block size * cdef PetscInt m=0, bs=1 */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatHasPreallocationAIJ(__pyx_v_A, (&__pyx_v_aij), (&__pyx_v_baij), (&__pyx_v_sbaij), (&__pyx_v_aijis))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(8, 753, __pyx_L1_error) /* "petsc4py/PETSc/petscmat.pxi":755 * CHKERR( MatHasPreallocationAIJ(A, &aij, &baij, &sbaij, &aijis)) * # local row size and block size * cdef PetscInt m=0, bs=1 # <<<<<<<<<<<<<< * CHKERR( MatGetLocalSize(A, &m, NULL) ) * if baij == PETSC_TRUE or sbaij == PETSC_TRUE: */ __pyx_v_m = 0; __pyx_v_bs = 1; /* "petsc4py/PETSc/petscmat.pxi":756 * # local row size and block size * cdef PetscInt m=0, bs=1 * CHKERR( MatGetLocalSize(A, &m, NULL) ) # <<<<<<<<<<<<<< * if baij == PETSC_TRUE or sbaij == PETSC_TRUE: * CHKERR( MatGetBlockSize(A, &bs) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetLocalSize(__pyx_v_A, (&__pyx_v_m), NULL)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(8, 756, __pyx_L1_error) /* "petsc4py/PETSc/petscmat.pxi":757 * cdef PetscInt m=0, bs=1 * CHKERR( MatGetLocalSize(A, &m, NULL) ) * if baij == PETSC_TRUE or sbaij == PETSC_TRUE: # <<<<<<<<<<<<<< * CHKERR( MatGetBlockSize(A, &bs) ) * assert bs > 0, "block size not set" */ __pyx_t_3 = (__pyx_v_baij == PETSC_TRUE); if (!__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = (__pyx_v_sbaij == PETSC_TRUE); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { /* "petsc4py/PETSc/petscmat.pxi":758 * CHKERR( MatGetLocalSize(A, &m, NULL) ) * if baij == PETSC_TRUE or sbaij == PETSC_TRUE: * CHKERR( MatGetBlockSize(A, &bs) ) # <<<<<<<<<<<<<< * assert bs > 0, "block size not set" * # unpack NNZ argument */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetBlockSize(__pyx_v_A, (&__pyx_v_bs))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(8, 758, __pyx_L1_error) /* "petsc4py/PETSc/petscmat.pxi":759 * if baij == PETSC_TRUE or sbaij == PETSC_TRUE: * CHKERR( MatGetBlockSize(A, &bs) ) * assert bs > 0, "block size not set" # <<<<<<<<<<<<<< * # unpack NNZ argument * cdef object od_nnz, oo_nnz */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_2 = (__pyx_v_bs > 0); if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_kp_s_block_size_not_set, 0, 0); __PYX_ERR(8, 759, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(8, 759, __pyx_L1_error) #endif /* "petsc4py/PETSc/petscmat.pxi":757 * cdef PetscInt m=0, bs=1 * CHKERR( MatGetLocalSize(A, &m, NULL) ) * if baij == PETSC_TRUE or sbaij == PETSC_TRUE: # <<<<<<<<<<<<<< * CHKERR( MatGetBlockSize(A, &bs) ) * assert bs > 0, "block size not set" */ } /* "petsc4py/PETSc/petscmat.pxi":762 * # unpack NNZ argument * cdef object od_nnz, oo_nnz * try: # <<<<<<<<<<<<<< * od_nnz, oo_nnz = NNZ * except (TypeError, ValueError): */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); /*try:*/ { /* "petsc4py/PETSc/petscmat.pxi":763 * cdef object od_nnz, oo_nnz * try: * od_nnz, oo_nnz = NNZ # <<<<<<<<<<<<<< * except (TypeError, ValueError): * od_nnz, oo_nnz = NNZ, None */ if ((likely(PyTuple_CheckExact(__pyx_v_NNZ))) || (PyList_CheckExact(__pyx_v_NNZ))) { PyObject* sequence = __pyx_v_NNZ; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(8, 763, __pyx_L6_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_7 = PyList_GET_ITEM(sequence, 0); __pyx_t_8 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); #else __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 763, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 763, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_8); #endif } else { Py_ssize_t index = -1; __pyx_t_9 = PyObject_GetIter(__pyx_v_NNZ); if (unlikely(!__pyx_t_9)) __PYX_ERR(8, 763, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); index = 0; __pyx_t_7 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_7)) goto __pyx_L12_unpacking_failed; __Pyx_GOTREF(__pyx_t_7); index = 1; __pyx_t_8 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L12_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(8, 763, __pyx_L6_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L13_unpacking_done; __pyx_L12_unpacking_failed:; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(8, 763, __pyx_L6_error) __pyx_L13_unpacking_done:; } __pyx_v_od_nnz = __pyx_t_7; __pyx_t_7 = 0; __pyx_v_oo_nnz = __pyx_t_8; __pyx_t_8 = 0; /* "petsc4py/PETSc/petscmat.pxi":762 * # unpack NNZ argument * cdef object od_nnz, oo_nnz * try: # <<<<<<<<<<<<<< * od_nnz, oo_nnz = NNZ * except (TypeError, ValueError): */ } __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L11_try_end; __pyx_L6_error:; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; /* "petsc4py/PETSc/petscmat.pxi":764 * try: * od_nnz, oo_nnz = NNZ * except (TypeError, ValueError): # <<<<<<<<<<<<<< * od_nnz, oo_nnz = NNZ, None * # diagonal and off-diagonal number of nonzeros */ __pyx_t_11 = __Pyx_PyErr_ExceptionMatches2(__pyx_builtin_TypeError, __pyx_builtin_ValueError); if (__pyx_t_11) { __Pyx_AddTraceback("petsc4py.PETSc.Mat_AllocAIJ_NNZ", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_9) < 0) __PYX_ERR(8, 764, __pyx_L8_except_error) __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_9); /* "petsc4py/PETSc/petscmat.pxi":765 * od_nnz, oo_nnz = NNZ * except (TypeError, ValueError): * od_nnz, oo_nnz = NNZ, None # <<<<<<<<<<<<<< * # diagonal and off-diagonal number of nonzeros * cdef PetscInt d_nz=PETSC_DECIDE, d_n=0, *d_nnz=NULL */ __pyx_t_12 = __pyx_v_NNZ; __Pyx_INCREF(__pyx_t_12); __pyx_t_13 = Py_None; __Pyx_INCREF(__pyx_t_13); __Pyx_XDECREF_SET(__pyx_v_od_nnz, __pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF_SET(__pyx_v_oo_nnz, __pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L7_exception_handled; } goto __pyx_L8_except_error; /* "petsc4py/PETSc/petscmat.pxi":762 * # unpack NNZ argument * cdef object od_nnz, oo_nnz * try: # <<<<<<<<<<<<<< * od_nnz, oo_nnz = NNZ * except (TypeError, ValueError): */ __pyx_L8_except_error:; __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); goto __pyx_L1_error; __pyx_L7_exception_handled:; __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); __pyx_L11_try_end:; } /* "petsc4py/PETSc/petscmat.pxi":767 * od_nnz, oo_nnz = NNZ, None * # diagonal and off-diagonal number of nonzeros * cdef PetscInt d_nz=PETSC_DECIDE, d_n=0, *d_nnz=NULL # <<<<<<<<<<<<<< * if od_nnz is not None: * od_nnz = iarray_i(od_nnz, &d_n, &d_nnz) */ __pyx_v_d_nz = PETSC_DECIDE; __pyx_v_d_n = 0; __pyx_v_d_nnz = NULL; /* "petsc4py/PETSc/petscmat.pxi":768 * # diagonal and off-diagonal number of nonzeros * cdef PetscInt d_nz=PETSC_DECIDE, d_n=0, *d_nnz=NULL * if od_nnz is not None: # <<<<<<<<<<<<<< * od_nnz = iarray_i(od_nnz, &d_n, &d_nnz) * if d_n == 0: d_nnz = NULL # just in case */ __pyx_t_2 = (__pyx_v_od_nnz != Py_None); if (__pyx_t_2) { /* "petsc4py/PETSc/petscmat.pxi":769 * cdef PetscInt d_nz=PETSC_DECIDE, d_n=0, *d_nnz=NULL * if od_nnz is not None: * od_nnz = iarray_i(od_nnz, &d_n, &d_nnz) # <<<<<<<<<<<<<< * if d_n == 0: d_nnz = NULL # just in case * elif d_n == 1: d_nz = d_nnz[0]; d_n=0; d_nnz = NULL */ __pyx_t_9 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_od_nnz, (&__pyx_v_d_n), (&__pyx_v_d_nnz))); if (unlikely(!__pyx_t_9)) __PYX_ERR(8, 769, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF_SET(__pyx_v_od_nnz, __pyx_t_9); __pyx_t_9 = 0; /* "petsc4py/PETSc/petscmat.pxi":770 * if od_nnz is not None: * od_nnz = iarray_i(od_nnz, &d_n, &d_nnz) * if d_n == 0: d_nnz = NULL # just in case # <<<<<<<<<<<<<< * elif d_n == 1: d_nz = d_nnz[0]; d_n=0; d_nnz = NULL * cdef PetscInt o_nz=PETSC_DECIDE, o_n=0, *o_nnz=NULL */ __pyx_t_2 = (__pyx_v_d_n == 0); if (__pyx_t_2) { __pyx_v_d_nnz = NULL; goto __pyx_L17; } /* "petsc4py/PETSc/petscmat.pxi":771 * od_nnz = iarray_i(od_nnz, &d_n, &d_nnz) * if d_n == 0: d_nnz = NULL # just in case * elif d_n == 1: d_nz = d_nnz[0]; d_n=0; d_nnz = NULL # <<<<<<<<<<<<<< * cdef PetscInt o_nz=PETSC_DECIDE, o_n=0, *o_nnz=NULL * if oo_nnz is not None: */ __pyx_t_2 = (__pyx_v_d_n == 1); if (__pyx_t_2) { __pyx_v_d_nz = (__pyx_v_d_nnz[0]); __pyx_v_d_n = 0; __pyx_v_d_nnz = NULL; } __pyx_L17:; /* "petsc4py/PETSc/petscmat.pxi":768 * # diagonal and off-diagonal number of nonzeros * cdef PetscInt d_nz=PETSC_DECIDE, d_n=0, *d_nnz=NULL * if od_nnz is not None: # <<<<<<<<<<<<<< * od_nnz = iarray_i(od_nnz, &d_n, &d_nnz) * if d_n == 0: d_nnz = NULL # just in case */ } /* "petsc4py/PETSc/petscmat.pxi":772 * if d_n == 0: d_nnz = NULL # just in case * elif d_n == 1: d_nz = d_nnz[0]; d_n=0; d_nnz = NULL * cdef PetscInt o_nz=PETSC_DECIDE, o_n=0, *o_nnz=NULL # <<<<<<<<<<<<<< * if oo_nnz is not None: * oo_nnz = iarray_i(oo_nnz, &o_n, &o_nnz) */ __pyx_v_o_nz = PETSC_DECIDE; __pyx_v_o_n = 0; __pyx_v_o_nnz = NULL; /* "petsc4py/PETSc/petscmat.pxi":773 * elif d_n == 1: d_nz = d_nnz[0]; d_n=0; d_nnz = NULL * cdef PetscInt o_nz=PETSC_DECIDE, o_n=0, *o_nnz=NULL * if oo_nnz is not None: # <<<<<<<<<<<<<< * oo_nnz = iarray_i(oo_nnz, &o_n, &o_nnz) * if o_n == 0: o_nnz = NULL # just in case */ __pyx_t_2 = (__pyx_v_oo_nnz != Py_None); if (__pyx_t_2) { /* "petsc4py/PETSc/petscmat.pxi":774 * cdef PetscInt o_nz=PETSC_DECIDE, o_n=0, *o_nnz=NULL * if oo_nnz is not None: * oo_nnz = iarray_i(oo_nnz, &o_n, &o_nnz) # <<<<<<<<<<<<<< * if o_n == 0: o_nnz = NULL # just in case * elif o_n == 1: o_nz = o_nnz[0]; o_n=0; o_nnz = NULL */ __pyx_t_9 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_oo_nnz, (&__pyx_v_o_n), (&__pyx_v_o_nnz))); if (unlikely(!__pyx_t_9)) __PYX_ERR(8, 774, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF_SET(__pyx_v_oo_nnz, __pyx_t_9); __pyx_t_9 = 0; /* "petsc4py/PETSc/petscmat.pxi":775 * if oo_nnz is not None: * oo_nnz = iarray_i(oo_nnz, &o_n, &o_nnz) * if o_n == 0: o_nnz = NULL # just in case # <<<<<<<<<<<<<< * elif o_n == 1: o_nz = o_nnz[0]; o_n=0; o_nnz = NULL * if m == PETSC_DECIDE: */ __pyx_t_2 = (__pyx_v_o_n == 0); if (__pyx_t_2) { __pyx_v_o_nnz = NULL; goto __pyx_L19; } /* "petsc4py/PETSc/petscmat.pxi":776 * oo_nnz = iarray_i(oo_nnz, &o_n, &o_nnz) * if o_n == 0: o_nnz = NULL # just in case * elif o_n == 1: o_nz = o_nnz[0]; o_n=0; o_nnz = NULL # <<<<<<<<<<<<<< * if m == PETSC_DECIDE: * if d_n > 1 and d_n*bs > m: m = d_n*bs */ __pyx_t_2 = (__pyx_v_o_n == 1); if (__pyx_t_2) { __pyx_v_o_nz = (__pyx_v_o_nnz[0]); __pyx_v_o_n = 0; __pyx_v_o_nnz = NULL; } __pyx_L19:; /* "petsc4py/PETSc/petscmat.pxi":773 * elif d_n == 1: d_nz = d_nnz[0]; d_n=0; d_nnz = NULL * cdef PetscInt o_nz=PETSC_DECIDE, o_n=0, *o_nnz=NULL * if oo_nnz is not None: # <<<<<<<<<<<<<< * oo_nnz = iarray_i(oo_nnz, &o_n, &o_nnz) * if o_n == 0: o_nnz = NULL # just in case */ } /* "petsc4py/PETSc/petscmat.pxi":777 * if o_n == 0: o_nnz = NULL # just in case * elif o_n == 1: o_nz = o_nnz[0]; o_n=0; o_nnz = NULL * if m == PETSC_DECIDE: # <<<<<<<<<<<<<< * if d_n > 1 and d_n*bs > m: m = d_n*bs * if o_n > 1 and o_n*bs > m: m = o_n*bs */ __pyx_t_2 = (__pyx_v_m == PETSC_DECIDE); if (__pyx_t_2) { /* "petsc4py/PETSc/petscmat.pxi":778 * elif o_n == 1: o_nz = o_nnz[0]; o_n=0; o_nnz = NULL * if m == PETSC_DECIDE: * if d_n > 1 and d_n*bs > m: m = d_n*bs # <<<<<<<<<<<<<< * if o_n > 1 and o_n*bs > m: m = o_n*bs * # check array sizes */ __pyx_t_3 = (__pyx_v_d_n > 1); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L22_bool_binop_done; } __pyx_t_3 = ((__pyx_v_d_n * __pyx_v_bs) > __pyx_v_m); __pyx_t_2 = __pyx_t_3; __pyx_L22_bool_binop_done:; if (__pyx_t_2) { __pyx_v_m = (__pyx_v_d_n * __pyx_v_bs); } /* "petsc4py/PETSc/petscmat.pxi":779 * if m == PETSC_DECIDE: * if d_n > 1 and d_n*bs > m: m = d_n*bs * if o_n > 1 and o_n*bs > m: m = o_n*bs # <<<<<<<<<<<<<< * # check array sizes * if d_n > 1 and d_n*bs != m: raise ValueError( */ __pyx_t_3 = (__pyx_v_o_n > 1); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L25_bool_binop_done; } __pyx_t_3 = ((__pyx_v_o_n * __pyx_v_bs) > __pyx_v_m); __pyx_t_2 = __pyx_t_3; __pyx_L25_bool_binop_done:; if (__pyx_t_2) { __pyx_v_m = (__pyx_v_o_n * __pyx_v_bs); } /* "petsc4py/PETSc/petscmat.pxi":777 * if o_n == 0: o_nnz = NULL # just in case * elif o_n == 1: o_nz = o_nnz[0]; o_n=0; o_nnz = NULL * if m == PETSC_DECIDE: # <<<<<<<<<<<<<< * if d_n > 1 and d_n*bs > m: m = d_n*bs * if o_n > 1 and o_n*bs > m: m = o_n*bs */ } /* "petsc4py/PETSc/petscmat.pxi":781 * if o_n > 1 and o_n*bs > m: m = o_n*bs * # check array sizes * if d_n > 1 and d_n*bs != m: raise ValueError( # <<<<<<<<<<<<<< * "size(d_nnz) is %d, expected %d" % * (toInt(d_n), toInt(m//bs)) ) */ __pyx_t_3 = (__pyx_v_d_n > 1); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L28_bool_binop_done; } __pyx_t_3 = ((__pyx_v_d_n * __pyx_v_bs) != __pyx_v_m); __pyx_t_2 = __pyx_t_3; __pyx_L28_bool_binop_done:; if (unlikely(__pyx_t_2)) { /* "petsc4py/PETSc/petscmat.pxi":783 * if d_n > 1 and d_n*bs != m: raise ValueError( * "size(d_nnz) is %d, expected %d" % * (toInt(d_n), toInt(m//bs)) ) # <<<<<<<<<<<<<< * if o_n > 1 and o_n*bs != m: raise ValueError( * "size(o_nnz) is %d, expected %d" % */ __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_d_n); if (unlikely(!__pyx_t_9)) __PYX_ERR(8, 783, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_m / __pyx_v_bs)); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 783, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 783, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_9); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9)) __PYX_ERR(8, 783, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7)) __PYX_ERR(8, 783, __pyx_L1_error); __pyx_t_9 = 0; __pyx_t_7 = 0; /* "petsc4py/PETSc/petscmat.pxi":782 * # check array sizes * if d_n > 1 and d_n*bs != m: raise ValueError( * "size(d_nnz) is %d, expected %d" % # <<<<<<<<<<<<<< * (toInt(d_n), toInt(m//bs)) ) * if o_n > 1 and o_n*bs != m: raise ValueError( */ __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_size_d_nnz_is_d_expected_d, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 782, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "petsc4py/PETSc/petscmat.pxi":781 * if o_n > 1 and o_n*bs > m: m = o_n*bs * # check array sizes * if d_n > 1 and d_n*bs != m: raise ValueError( # <<<<<<<<<<<<<< * "size(d_nnz) is %d, expected %d" % * (toInt(d_n), toInt(m//bs)) ) */ __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 781, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __PYX_ERR(8, 781, __pyx_L1_error) } /* "petsc4py/PETSc/petscmat.pxi":784 * "size(d_nnz) is %d, expected %d" % * (toInt(d_n), toInt(m//bs)) ) * if o_n > 1 and o_n*bs != m: raise ValueError( # <<<<<<<<<<<<<< * "size(o_nnz) is %d, expected %d" % * (toInt(o_n), toInt(m//bs)) ) */ __pyx_t_3 = (__pyx_v_o_n > 1); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L31_bool_binop_done; } __pyx_t_3 = ((__pyx_v_o_n * __pyx_v_bs) != __pyx_v_m); __pyx_t_2 = __pyx_t_3; __pyx_L31_bool_binop_done:; if (unlikely(__pyx_t_2)) { /* "petsc4py/PETSc/petscmat.pxi":786 * if o_n > 1 and o_n*bs != m: raise ValueError( * "size(o_nnz) is %d, expected %d" % * (toInt(o_n), toInt(m//bs)) ) # <<<<<<<<<<<<<< * # preallocate * if aij == PETSC_TRUE: */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_o_n); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 786, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_m / __pyx_v_bs)); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 786, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(8, 786, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_8); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8)) __PYX_ERR(8, 786, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_7)) __PYX_ERR(8, 786, __pyx_L1_error); __pyx_t_8 = 0; __pyx_t_7 = 0; /* "petsc4py/PETSc/petscmat.pxi":785 * (toInt(d_n), toInt(m//bs)) ) * if o_n > 1 and o_n*bs != m: raise ValueError( * "size(o_nnz) is %d, expected %d" % # <<<<<<<<<<<<<< * (toInt(o_n), toInt(m//bs)) ) * # preallocate */ __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_size_o_nnz_is_d_expected_d, __pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 785, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "petsc4py/PETSc/petscmat.pxi":784 * "size(d_nnz) is %d, expected %d" % * (toInt(d_n), toInt(m//bs)) ) * if o_n > 1 and o_n*bs != m: raise ValueError( # <<<<<<<<<<<<<< * "size(o_nnz) is %d, expected %d" % * (toInt(o_n), toInt(m//bs)) ) */ __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(8, 784, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __PYX_ERR(8, 784, __pyx_L1_error) } /* "petsc4py/PETSc/petscmat.pxi":788 * (toInt(o_n), toInt(m//bs)) ) * # preallocate * if aij == PETSC_TRUE: # <<<<<<<<<<<<<< * CHKERR( MatSeqAIJSetPreallocation(A, d_nz, d_nnz) ) * CHKERR( MatMPIAIJSetPreallocation(A, d_nz, d_nnz, o_nz, o_nnz) ) */ __pyx_t_2 = (__pyx_v_aij == PETSC_TRUE); if (__pyx_t_2) { /* "petsc4py/PETSc/petscmat.pxi":789 * # preallocate * if aij == PETSC_TRUE: * CHKERR( MatSeqAIJSetPreallocation(A, d_nz, d_nnz) ) # <<<<<<<<<<<<<< * CHKERR( MatMPIAIJSetPreallocation(A, d_nz, d_nnz, o_nz, o_nnz) ) * if baij == PETSC_TRUE: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSeqAIJSetPreallocation(__pyx_v_A, __pyx_v_d_nz, __pyx_v_d_nnz)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(8, 789, __pyx_L1_error) /* "petsc4py/PETSc/petscmat.pxi":790 * if aij == PETSC_TRUE: * CHKERR( MatSeqAIJSetPreallocation(A, d_nz, d_nnz) ) * CHKERR( MatMPIAIJSetPreallocation(A, d_nz, d_nnz, o_nz, o_nnz) ) # <<<<<<<<<<<<<< * if baij == PETSC_TRUE: * CHKERR( MatSeqBAIJSetPreallocation(A, bs, d_nz, d_nnz) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatMPIAIJSetPreallocation(__pyx_v_A, __pyx_v_d_nz, __pyx_v_d_nnz, __pyx_v_o_nz, __pyx_v_o_nnz)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(8, 790, __pyx_L1_error) /* "petsc4py/PETSc/petscmat.pxi":788 * (toInt(o_n), toInt(m//bs)) ) * # preallocate * if aij == PETSC_TRUE: # <<<<<<<<<<<<<< * CHKERR( MatSeqAIJSetPreallocation(A, d_nz, d_nnz) ) * CHKERR( MatMPIAIJSetPreallocation(A, d_nz, d_nnz, o_nz, o_nnz) ) */ } /* "petsc4py/PETSc/petscmat.pxi":791 * CHKERR( MatSeqAIJSetPreallocation(A, d_nz, d_nnz) ) * CHKERR( MatMPIAIJSetPreallocation(A, d_nz, d_nnz, o_nz, o_nnz) ) * if baij == PETSC_TRUE: # <<<<<<<<<<<<<< * CHKERR( MatSeqBAIJSetPreallocation(A, bs, d_nz, d_nnz) ) * CHKERR( MatMPIBAIJSetPreallocation(A, bs, d_nz, d_nnz, o_nz, o_nnz) ) */ __pyx_t_2 = (__pyx_v_baij == PETSC_TRUE); if (__pyx_t_2) { /* "petsc4py/PETSc/petscmat.pxi":792 * CHKERR( MatMPIAIJSetPreallocation(A, d_nz, d_nnz, o_nz, o_nnz) ) * if baij == PETSC_TRUE: * CHKERR( MatSeqBAIJSetPreallocation(A, bs, d_nz, d_nnz) ) # <<<<<<<<<<<<<< * CHKERR( MatMPIBAIJSetPreallocation(A, bs, d_nz, d_nnz, o_nz, o_nnz) ) * if sbaij == PETSC_TRUE: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSeqBAIJSetPreallocation(__pyx_v_A, __pyx_v_bs, __pyx_v_d_nz, __pyx_v_d_nnz)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(8, 792, __pyx_L1_error) /* "petsc4py/PETSc/petscmat.pxi":793 * if baij == PETSC_TRUE: * CHKERR( MatSeqBAIJSetPreallocation(A, bs, d_nz, d_nnz) ) * CHKERR( MatMPIBAIJSetPreallocation(A, bs, d_nz, d_nnz, o_nz, o_nnz) ) # <<<<<<<<<<<<<< * if sbaij == PETSC_TRUE: * CHKERR( MatSeqSBAIJSetPreallocation(A, bs, d_nz, d_nnz) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatMPIBAIJSetPreallocation(__pyx_v_A, __pyx_v_bs, __pyx_v_d_nz, __pyx_v_d_nnz, __pyx_v_o_nz, __pyx_v_o_nnz)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(8, 793, __pyx_L1_error) /* "petsc4py/PETSc/petscmat.pxi":791 * CHKERR( MatSeqAIJSetPreallocation(A, d_nz, d_nnz) ) * CHKERR( MatMPIAIJSetPreallocation(A, d_nz, d_nnz, o_nz, o_nnz) ) * if baij == PETSC_TRUE: # <<<<<<<<<<<<<< * CHKERR( MatSeqBAIJSetPreallocation(A, bs, d_nz, d_nnz) ) * CHKERR( MatMPIBAIJSetPreallocation(A, bs, d_nz, d_nnz, o_nz, o_nnz) ) */ } /* "petsc4py/PETSc/petscmat.pxi":794 * CHKERR( MatSeqBAIJSetPreallocation(A, bs, d_nz, d_nnz) ) * CHKERR( MatMPIBAIJSetPreallocation(A, bs, d_nz, d_nnz, o_nz, o_nnz) ) * if sbaij == PETSC_TRUE: # <<<<<<<<<<<<<< * CHKERR( MatSeqSBAIJSetPreallocation(A, bs, d_nz, d_nnz) ) * CHKERR( MatMPISBAIJSetPreallocation(A, bs, d_nz, d_nnz, o_nz, o_nnz) ) */ __pyx_t_2 = (__pyx_v_sbaij == PETSC_TRUE); if (__pyx_t_2) { /* "petsc4py/PETSc/petscmat.pxi":795 * CHKERR( MatMPIBAIJSetPreallocation(A, bs, d_nz, d_nnz, o_nz, o_nnz) ) * if sbaij == PETSC_TRUE: * CHKERR( MatSeqSBAIJSetPreallocation(A, bs, d_nz, d_nnz) ) # <<<<<<<<<<<<<< * CHKERR( MatMPISBAIJSetPreallocation(A, bs, d_nz, d_nnz, o_nz, o_nnz) ) * if aijis == PETSC_TRUE: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSeqSBAIJSetPreallocation(__pyx_v_A, __pyx_v_bs, __pyx_v_d_nz, __pyx_v_d_nnz)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(8, 795, __pyx_L1_error) /* "petsc4py/PETSc/petscmat.pxi":796 * if sbaij == PETSC_TRUE: * CHKERR( MatSeqSBAIJSetPreallocation(A, bs, d_nz, d_nnz) ) * CHKERR( MatMPISBAIJSetPreallocation(A, bs, d_nz, d_nnz, o_nz, o_nnz) ) # <<<<<<<<<<<<<< * if aijis == PETSC_TRUE: * CHKERR( MatISSetPreallocation(A, d_nz, d_nnz, o_nz, o_nnz) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatMPISBAIJSetPreallocation(__pyx_v_A, __pyx_v_bs, __pyx_v_d_nz, __pyx_v_d_nnz, __pyx_v_o_nz, __pyx_v_o_nnz)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(8, 796, __pyx_L1_error) /* "petsc4py/PETSc/petscmat.pxi":794 * CHKERR( MatSeqBAIJSetPreallocation(A, bs, d_nz, d_nnz) ) * CHKERR( MatMPIBAIJSetPreallocation(A, bs, d_nz, d_nnz, o_nz, o_nnz) ) * if sbaij == PETSC_TRUE: # <<<<<<<<<<<<<< * CHKERR( MatSeqSBAIJSetPreallocation(A, bs, d_nz, d_nnz) ) * CHKERR( MatMPISBAIJSetPreallocation(A, bs, d_nz, d_nnz, o_nz, o_nnz) ) */ } /* "petsc4py/PETSc/petscmat.pxi":797 * CHKERR( MatSeqSBAIJSetPreallocation(A, bs, d_nz, d_nnz) ) * CHKERR( MatMPISBAIJSetPreallocation(A, bs, d_nz, d_nnz, o_nz, o_nnz) ) * if aijis == PETSC_TRUE: # <<<<<<<<<<<<<< * CHKERR( MatISSetPreallocation(A, d_nz, d_nnz, o_nz, o_nnz) ) * return PETSC_SUCCESS */ __pyx_t_2 = (__pyx_v_aijis == PETSC_TRUE); if (__pyx_t_2) { /* "petsc4py/PETSc/petscmat.pxi":798 * CHKERR( MatMPISBAIJSetPreallocation(A, bs, d_nz, d_nnz, o_nz, o_nnz) ) * if aijis == PETSC_TRUE: * CHKERR( MatISSetPreallocation(A, d_nz, d_nnz, o_nz, o_nnz) ) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatISSetPreallocation(__pyx_v_A, __pyx_v_d_nz, __pyx_v_d_nnz, __pyx_v_o_nz, __pyx_v_o_nnz)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(8, 798, __pyx_L1_error) /* "petsc4py/PETSc/petscmat.pxi":797 * CHKERR( MatSeqSBAIJSetPreallocation(A, bs, d_nz, d_nnz) ) * CHKERR( MatMPISBAIJSetPreallocation(A, bs, d_nz, d_nnz, o_nz, o_nnz) ) * if aijis == PETSC_TRUE: # <<<<<<<<<<<<<< * CHKERR( MatISSetPreallocation(A, d_nz, d_nnz, o_nz, o_nnz) ) * return PETSC_SUCCESS */ } /* "petsc4py/PETSc/petscmat.pxi":799 * if aijis == PETSC_TRUE: * CHKERR( MatISSetPreallocation(A, d_nz, d_nnz, o_nz, o_nnz) ) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * cdef inline PetscErrorCode Mat_AllocAIJ_CSR(PetscMat A, object CSR) except PETSC_ERR_PYTHON: */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petscmat.pxi":750 * return PETSC_SUCCESS * * cdef inline PetscErrorCode Mat_AllocAIJ_NNZ( PetscMat A, object NNZ) except PETSC_ERR_PYTHON: # <<<<<<<<<<<<<< * # * cdef PetscBool aij=PETSC_FALSE, baij=PETSC_FALSE, sbaij=PETSC_FALSE, aijis=PETSC_FALSE */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_AddTraceback("petsc4py.PETSc.Mat_AllocAIJ_NNZ", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_od_nnz); __Pyx_XDECREF(__pyx_v_oo_nnz); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscmat.pxi":801 * return PETSC_SUCCESS * * cdef inline PetscErrorCode Mat_AllocAIJ_CSR(PetscMat A, object CSR) except PETSC_ERR_PYTHON: # <<<<<<<<<<<<<< * # * cdef PetscBool aij=PETSC_FALSE, baij=PETSC_FALSE, sbaij=PETSC_FALSE, aijis=PETSC_FALSE */ static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_Mat_AllocAIJ_CSR(Mat __pyx_v_A, PyObject *__pyx_v_CSR) { PetscBool __pyx_v_aij; PetscBool __pyx_v_baij; PetscBool __pyx_v_sbaij; PetscBool __pyx_v_aijis; PetscInt __pyx_v_m; PetscInt __pyx_v_bs; PyObject *__pyx_v_oi = 0; PyObject *__pyx_v_oj = 0; PyObject *__pyx_v_ov = 0; PetscInt __pyx_v_ni; PetscInt *__pyx_v_i; PetscInt __pyx_v_nj; PetscInt *__pyx_v_j; PetscInt __pyx_v_nv; PetscScalar *__pyx_v_v; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *(*__pyx_t_11)(PyObject *); int __pyx_t_12; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("Mat_AllocAIJ_CSR", 1); /* "petsc4py/PETSc/petscmat.pxi":803 * cdef inline PetscErrorCode Mat_AllocAIJ_CSR(PetscMat A, object CSR) except PETSC_ERR_PYTHON: * # * cdef PetscBool aij=PETSC_FALSE, baij=PETSC_FALSE, sbaij=PETSC_FALSE, aijis=PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( MatHasPreallocationAIJ(A, &aij, &baij, &sbaij, &aijis)) * # local row size and block size */ __pyx_v_aij = PETSC_FALSE; __pyx_v_baij = PETSC_FALSE; __pyx_v_sbaij = PETSC_FALSE; __pyx_v_aijis = PETSC_FALSE; /* "petsc4py/PETSc/petscmat.pxi":804 * # * cdef PetscBool aij=PETSC_FALSE, baij=PETSC_FALSE, sbaij=PETSC_FALSE, aijis=PETSC_FALSE * CHKERR( MatHasPreallocationAIJ(A, &aij, &baij, &sbaij, &aijis)) # <<<<<<<<<<<<<< * # local row size and block size * cdef PetscInt m=0, bs = 1 */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatHasPreallocationAIJ(__pyx_v_A, (&__pyx_v_aij), (&__pyx_v_baij), (&__pyx_v_sbaij), (&__pyx_v_aijis))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(8, 804, __pyx_L1_error) /* "petsc4py/PETSc/petscmat.pxi":806 * CHKERR( MatHasPreallocationAIJ(A, &aij, &baij, &sbaij, &aijis)) * # local row size and block size * cdef PetscInt m=0, bs = 1 # <<<<<<<<<<<<<< * CHKERR( MatGetLocalSize(A, &m, NULL) ) * if baij == PETSC_TRUE or sbaij == PETSC_TRUE: */ __pyx_v_m = 0; __pyx_v_bs = 1; /* "petsc4py/PETSc/petscmat.pxi":807 * # local row size and block size * cdef PetscInt m=0, bs = 1 * CHKERR( MatGetLocalSize(A, &m, NULL) ) # <<<<<<<<<<<<<< * if baij == PETSC_TRUE or sbaij == PETSC_TRUE: * CHKERR( MatGetBlockSize(A, &bs) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetLocalSize(__pyx_v_A, (&__pyx_v_m), NULL)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(8, 807, __pyx_L1_error) /* "petsc4py/PETSc/petscmat.pxi":808 * cdef PetscInt m=0, bs = 1 * CHKERR( MatGetLocalSize(A, &m, NULL) ) * if baij == PETSC_TRUE or sbaij == PETSC_TRUE: # <<<<<<<<<<<<<< * CHKERR( MatGetBlockSize(A, &bs) ) * assert bs > 0, "block size not set" */ __pyx_t_3 = (__pyx_v_baij == PETSC_TRUE); if (!__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = (__pyx_v_sbaij == PETSC_TRUE); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { /* "petsc4py/PETSc/petscmat.pxi":809 * CHKERR( MatGetLocalSize(A, &m, NULL) ) * if baij == PETSC_TRUE or sbaij == PETSC_TRUE: * CHKERR( MatGetBlockSize(A, &bs) ) # <<<<<<<<<<<<<< * assert bs > 0, "block size not set" * # unpack CSR argument */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetBlockSize(__pyx_v_A, (&__pyx_v_bs))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(8, 809, __pyx_L1_error) /* "petsc4py/PETSc/petscmat.pxi":810 * if baij == PETSC_TRUE or sbaij == PETSC_TRUE: * CHKERR( MatGetBlockSize(A, &bs) ) * assert bs > 0, "block size not set" # <<<<<<<<<<<<<< * # unpack CSR argument * cdef object oi, oj, ov */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_2 = (__pyx_v_bs > 0); if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_kp_s_block_size_not_set, 0, 0); __PYX_ERR(8, 810, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(8, 810, __pyx_L1_error) #endif /* "petsc4py/PETSc/petscmat.pxi":808 * cdef PetscInt m=0, bs = 1 * CHKERR( MatGetLocalSize(A, &m, NULL) ) * if baij == PETSC_TRUE or sbaij == PETSC_TRUE: # <<<<<<<<<<<<<< * CHKERR( MatGetBlockSize(A, &bs) ) * assert bs > 0, "block size not set" */ } /* "petsc4py/PETSc/petscmat.pxi":813 * # unpack CSR argument * cdef object oi, oj, ov * try: # <<<<<<<<<<<<<< * oi, oj, ov = CSR * except (TypeError, ValueError): */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); /*try:*/ { /* "petsc4py/PETSc/petscmat.pxi":814 * cdef object oi, oj, ov * try: * oi, oj, ov = CSR # <<<<<<<<<<<<<< * except (TypeError, ValueError): * oi, oj = CSR; ov = None */ if ((likely(PyTuple_CheckExact(__pyx_v_CSR))) || (PyList_CheckExact(__pyx_v_CSR))) { PyObject* sequence = __pyx_v_CSR; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(8, 814, __pyx_L6_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_9 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_7 = PyList_GET_ITEM(sequence, 0); __pyx_t_8 = PyList_GET_ITEM(sequence, 1); __pyx_t_9 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); #else __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 814, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 814, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_9)) __PYX_ERR(8, 814, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_9); #endif } else { Py_ssize_t index = -1; __pyx_t_10 = PyObject_GetIter(__pyx_v_CSR); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 814, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); index = 0; __pyx_t_7 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_7)) goto __pyx_L12_unpacking_failed; __Pyx_GOTREF(__pyx_t_7); index = 1; __pyx_t_8 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_8)) goto __pyx_L12_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); index = 2; __pyx_t_9 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_9)) goto __pyx_L12_unpacking_failed; __Pyx_GOTREF(__pyx_t_9); if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 3) < 0) __PYX_ERR(8, 814, __pyx_L6_error) __pyx_t_11 = NULL; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L13_unpacking_done; __pyx_L12_unpacking_failed:; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(8, 814, __pyx_L6_error) __pyx_L13_unpacking_done:; } __pyx_v_oi = __pyx_t_7; __pyx_t_7 = 0; __pyx_v_oj = __pyx_t_8; __pyx_t_8 = 0; __pyx_v_ov = __pyx_t_9; __pyx_t_9 = 0; /* "petsc4py/PETSc/petscmat.pxi":813 * # unpack CSR argument * cdef object oi, oj, ov * try: # <<<<<<<<<<<<<< * oi, oj, ov = CSR * except (TypeError, ValueError): */ } __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L11_try_end; __pyx_L6_error:; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; /* "petsc4py/PETSc/petscmat.pxi":815 * try: * oi, oj, ov = CSR * except (TypeError, ValueError): # <<<<<<<<<<<<<< * oi, oj = CSR; ov = None * # rows, cols, and values */ __pyx_t_12 = __Pyx_PyErr_ExceptionMatches2(__pyx_builtin_TypeError, __pyx_builtin_ValueError); if (__pyx_t_12) { __Pyx_AddTraceback("petsc4py.PETSc.Mat_AllocAIJ_CSR", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7) < 0) __PYX_ERR(8, 815, __pyx_L8_except_error) __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_7); /* "petsc4py/PETSc/petscmat.pxi":816 * oi, oj, ov = CSR * except (TypeError, ValueError): * oi, oj = CSR; ov = None # <<<<<<<<<<<<<< * # rows, cols, and values * cdef PetscInt ni=0, *i=NULL */ if ((likely(PyTuple_CheckExact(__pyx_v_CSR))) || (PyList_CheckExact(__pyx_v_CSR))) { PyObject* sequence = __pyx_v_CSR; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(8, 816, __pyx_L8_except_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_10 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_13 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_10 = PyList_GET_ITEM(sequence, 0); __pyx_t_13 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(__pyx_t_13); #else __pyx_t_10 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 816, __pyx_L8_except_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_13 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(8, 816, __pyx_L8_except_error) __Pyx_GOTREF(__pyx_t_13); #endif } else { Py_ssize_t index = -1; __pyx_t_14 = PyObject_GetIter(__pyx_v_CSR); if (unlikely(!__pyx_t_14)) __PYX_ERR(8, 816, __pyx_L8_except_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_14); index = 0; __pyx_t_10 = __pyx_t_11(__pyx_t_14); if (unlikely(!__pyx_t_10)) goto __pyx_L16_unpacking_failed; __Pyx_GOTREF(__pyx_t_10); index = 1; __pyx_t_13 = __pyx_t_11(__pyx_t_14); if (unlikely(!__pyx_t_13)) goto __pyx_L16_unpacking_failed; __Pyx_GOTREF(__pyx_t_13); if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_14), 2) < 0) __PYX_ERR(8, 816, __pyx_L8_except_error) __pyx_t_11 = NULL; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; goto __pyx_L17_unpacking_done; __pyx_L16_unpacking_failed:; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(8, 816, __pyx_L8_except_error) __pyx_L17_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_oi, __pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF_SET(__pyx_v_oj, __pyx_t_13); __pyx_t_13 = 0; __Pyx_INCREF(Py_None); __Pyx_XDECREF_SET(__pyx_v_ov, Py_None); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L7_exception_handled; } goto __pyx_L8_except_error; /* "petsc4py/PETSc/petscmat.pxi":813 * # unpack CSR argument * cdef object oi, oj, ov * try: # <<<<<<<<<<<<<< * oi, oj, ov = CSR * except (TypeError, ValueError): */ __pyx_L8_except_error:; __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); goto __pyx_L1_error; __pyx_L7_exception_handled:; __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); __pyx_L11_try_end:; } /* "petsc4py/PETSc/petscmat.pxi":818 * oi, oj = CSR; ov = None * # rows, cols, and values * cdef PetscInt ni=0, *i=NULL # <<<<<<<<<<<<<< * cdef PetscInt nj=0, *j=NULL * cdef PetscInt nv=0 */ __pyx_v_ni = 0; __pyx_v_i = NULL; /* "petsc4py/PETSc/petscmat.pxi":819 * # rows, cols, and values * cdef PetscInt ni=0, *i=NULL * cdef PetscInt nj=0, *j=NULL # <<<<<<<<<<<<<< * cdef PetscInt nv=0 * cdef PetscScalar *v=NULL */ __pyx_v_nj = 0; __pyx_v_j = NULL; /* "petsc4py/PETSc/petscmat.pxi":820 * cdef PetscInt ni=0, *i=NULL * cdef PetscInt nj=0, *j=NULL * cdef PetscInt nv=0 # <<<<<<<<<<<<<< * cdef PetscScalar *v=NULL * oi = iarray_i(oi, &ni, &i) */ __pyx_v_nv = 0; /* "petsc4py/PETSc/petscmat.pxi":821 * cdef PetscInt nj=0, *j=NULL * cdef PetscInt nv=0 * cdef PetscScalar *v=NULL # <<<<<<<<<<<<<< * oi = iarray_i(oi, &ni, &i) * oj = iarray_i(oj, &nj, &j) */ __pyx_v_v = NULL; /* "petsc4py/PETSc/petscmat.pxi":822 * cdef PetscInt nv=0 * cdef PetscScalar *v=NULL * oi = iarray_i(oi, &ni, &i) # <<<<<<<<<<<<<< * oj = iarray_i(oj, &nj, &j) * if ov is not None: */ __pyx_t_7 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_oi, (&__pyx_v_ni), (&__pyx_v_i))); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 822, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF_SET(__pyx_v_oi, __pyx_t_7); __pyx_t_7 = 0; /* "petsc4py/PETSc/petscmat.pxi":823 * cdef PetscScalar *v=NULL * oi = iarray_i(oi, &ni, &i) * oj = iarray_i(oj, &nj, &j) # <<<<<<<<<<<<<< * if ov is not None: * ov = iarray_s(ov, &nv, &v) */ __pyx_t_7 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_oj, (&__pyx_v_nj), (&__pyx_v_j))); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 823, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF_SET(__pyx_v_oj, __pyx_t_7); __pyx_t_7 = 0; /* "petsc4py/PETSc/petscmat.pxi":824 * oi = iarray_i(oi, &ni, &i) * oj = iarray_i(oj, &nj, &j) * if ov is not None: # <<<<<<<<<<<<<< * ov = iarray_s(ov, &nv, &v) * if m == PETSC_DECIDE: m = (ni-1)*bs */ __pyx_t_2 = (__pyx_v_ov != Py_None); if (__pyx_t_2) { /* "petsc4py/PETSc/petscmat.pxi":825 * oj = iarray_i(oj, &nj, &j) * if ov is not None: * ov = iarray_s(ov, &nv, &v) # <<<<<<<<<<<<<< * if m == PETSC_DECIDE: m = (ni-1)*bs * # check array sizes */ __pyx_t_7 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_s(__pyx_v_ov, (&__pyx_v_nv), (&__pyx_v_v))); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 825, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF_SET(__pyx_v_ov, __pyx_t_7); __pyx_t_7 = 0; /* "petsc4py/PETSc/petscmat.pxi":824 * oi = iarray_i(oi, &ni, &i) * oj = iarray_i(oj, &nj, &j) * if ov is not None: # <<<<<<<<<<<<<< * ov = iarray_s(ov, &nv, &v) * if m == PETSC_DECIDE: m = (ni-1)*bs */ } /* "petsc4py/PETSc/petscmat.pxi":826 * if ov is not None: * ov = iarray_s(ov, &nv, &v) * if m == PETSC_DECIDE: m = (ni-1)*bs # <<<<<<<<<<<<<< * # check array sizes * if ((ni-1)*bs != m): */ __pyx_t_2 = (__pyx_v_m == PETSC_DECIDE); if (__pyx_t_2) { __pyx_v_m = ((__pyx_v_ni - 1) * __pyx_v_bs); } /* "petsc4py/PETSc/petscmat.pxi":828 * if m == PETSC_DECIDE: m = (ni-1)*bs * # check array sizes * if ((ni-1)*bs != m): # <<<<<<<<<<<<<< * raise ValueError("size(I) is %d, expected %d" % * (toInt(ni), toInt(m//bs+1)) ) */ __pyx_t_2 = (((__pyx_v_ni - 1) * __pyx_v_bs) != __pyx_v_m); if (unlikely(__pyx_t_2)) { /* "petsc4py/PETSc/petscmat.pxi":830 * if ((ni-1)*bs != m): * raise ValueError("size(I) is %d, expected %d" % * (toInt(ni), toInt(m//bs+1)) ) # <<<<<<<<<<<<<< * if (i[0] != 0): * raise ValueError("I[0] is %d, expected %d" % */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ni); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 830, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_toInt(((__pyx_v_m / __pyx_v_bs) + 1)); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 830, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(8, 830, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7)) __PYX_ERR(8, 830, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_8)) __PYX_ERR(8, 830, __pyx_L1_error); __pyx_t_7 = 0; __pyx_t_8 = 0; /* "petsc4py/PETSc/petscmat.pxi":829 * # check array sizes * if ((ni-1)*bs != m): * raise ValueError("size(I) is %d, expected %d" % # <<<<<<<<<<<<<< * (toInt(ni), toInt(m//bs+1)) ) * if (i[0] != 0): */ __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_size_I_is_d_expected_d, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 829, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(8, 829, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __PYX_ERR(8, 829, __pyx_L1_error) /* "petsc4py/PETSc/petscmat.pxi":828 * if m == PETSC_DECIDE: m = (ni-1)*bs * # check array sizes * if ((ni-1)*bs != m): # <<<<<<<<<<<<<< * raise ValueError("size(I) is %d, expected %d" % * (toInt(ni), toInt(m//bs+1)) ) */ } /* "petsc4py/PETSc/petscmat.pxi":831 * raise ValueError("size(I) is %d, expected %d" % * (toInt(ni), toInt(m//bs+1)) ) * if (i[0] != 0): # <<<<<<<<<<<<<< * raise ValueError("I[0] is %d, expected %d" % * (toInt(i[0]), toInt(0)) ) */ __pyx_t_2 = ((__pyx_v_i[0]) != 0); if (unlikely(__pyx_t_2)) { /* "petsc4py/PETSc/petscmat.pxi":833 * if (i[0] != 0): * raise ValueError("I[0] is %d, expected %d" % * (toInt(i[0]), toInt(0)) ) # <<<<<<<<<<<<<< * if (i[ni-1] != nj): * raise ValueError("size(J) is %d, expected %d" % */ __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_i[0])); if (unlikely(!__pyx_t_9)) __PYX_ERR(8, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_toInt(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_9); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_9)) __PYX_ERR(8, 833, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_8)) __PYX_ERR(8, 833, __pyx_L1_error); __pyx_t_9 = 0; __pyx_t_8 = 0; /* "petsc4py/PETSc/petscmat.pxi":832 * (toInt(ni), toInt(m//bs+1)) ) * if (i[0] != 0): * raise ValueError("I[0] is %d, expected %d" % # <<<<<<<<<<<<<< * (toInt(i[0]), toInt(0)) ) * if (i[ni-1] != nj): */ __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_I_0_is_d_expected_d, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __PYX_ERR(8, 832, __pyx_L1_error) /* "petsc4py/PETSc/petscmat.pxi":831 * raise ValueError("size(I) is %d, expected %d" % * (toInt(ni), toInt(m//bs+1)) ) * if (i[0] != 0): # <<<<<<<<<<<<<< * raise ValueError("I[0] is %d, expected %d" % * (toInt(i[0]), toInt(0)) ) */ } /* "petsc4py/PETSc/petscmat.pxi":834 * raise ValueError("I[0] is %d, expected %d" % * (toInt(i[0]), toInt(0)) ) * if (i[ni-1] != nj): # <<<<<<<<<<<<<< * raise ValueError("size(J) is %d, expected %d" % * (toInt(nj), toInt(i[ni-1])) ) */ __pyx_t_2 = ((__pyx_v_i[(__pyx_v_ni - 1)]) != __pyx_v_nj); if (unlikely(__pyx_t_2)) { /* "petsc4py/PETSc/petscmat.pxi":836 * if (i[ni-1] != nj): * raise ValueError("size(J) is %d, expected %d" % * (toInt(nj), toInt(i[ni-1])) ) # <<<<<<<<<<<<<< * if v != NULL and (nj*bs*bs != nv): * raise ValueError("size(V) is %d, expected %d" % */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nj); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 836, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_i[(__pyx_v_ni - 1)])); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 836, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(8, 836, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7)) __PYX_ERR(8, 836, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_8)) __PYX_ERR(8, 836, __pyx_L1_error); __pyx_t_7 = 0; __pyx_t_8 = 0; /* "petsc4py/PETSc/petscmat.pxi":835 * (toInt(i[0]), toInt(0)) ) * if (i[ni-1] != nj): * raise ValueError("size(J) is %d, expected %d" % # <<<<<<<<<<<<<< * (toInt(nj), toInt(i[ni-1])) ) * if v != NULL and (nj*bs*bs != nv): */ __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_size_J_is_d_expected_d, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 835, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(8, 835, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __PYX_ERR(8, 835, __pyx_L1_error) /* "petsc4py/PETSc/petscmat.pxi":834 * raise ValueError("I[0] is %d, expected %d" % * (toInt(i[0]), toInt(0)) ) * if (i[ni-1] != nj): # <<<<<<<<<<<<<< * raise ValueError("size(J) is %d, expected %d" % * (toInt(nj), toInt(i[ni-1])) ) */ } /* "petsc4py/PETSc/petscmat.pxi":837 * raise ValueError("size(J) is %d, expected %d" % * (toInt(nj), toInt(i[ni-1])) ) * if v != NULL and (nj*bs*bs != nv): # <<<<<<<<<<<<<< * raise ValueError("size(V) is %d, expected %d" % * (toInt(nv), toInt(nj*bs*bs)) ) */ __pyx_t_3 = (__pyx_v_v != NULL); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L24_bool_binop_done; } __pyx_t_3 = (((__pyx_v_nj * __pyx_v_bs) * __pyx_v_bs) != __pyx_v_nv); __pyx_t_2 = __pyx_t_3; __pyx_L24_bool_binop_done:; if (unlikely(__pyx_t_2)) { /* "petsc4py/PETSc/petscmat.pxi":839 * if v != NULL and (nj*bs*bs != nv): * raise ValueError("size(V) is %d, expected %d" % * (toInt(nv), toInt(nj*bs*bs)) ) # <<<<<<<<<<<<<< * # preallocate * if aij == PETSC_TRUE: */ __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nv); if (unlikely(!__pyx_t_9)) __PYX_ERR(8, 839, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_toInt(((__pyx_v_nj * __pyx_v_bs) * __pyx_v_bs)); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 839, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 839, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_9); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_9)) __PYX_ERR(8, 839, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_8)) __PYX_ERR(8, 839, __pyx_L1_error); __pyx_t_9 = 0; __pyx_t_8 = 0; /* "petsc4py/PETSc/petscmat.pxi":838 * (toInt(nj), toInt(i[ni-1])) ) * if v != NULL and (nj*bs*bs != nv): * raise ValueError("size(V) is %d, expected %d" % # <<<<<<<<<<<<<< * (toInt(nv), toInt(nj*bs*bs)) ) * # preallocate */ __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_size_V_is_d_expected_d, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 838, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 838, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __PYX_ERR(8, 838, __pyx_L1_error) /* "petsc4py/PETSc/petscmat.pxi":837 * raise ValueError("size(J) is %d, expected %d" % * (toInt(nj), toInt(i[ni-1])) ) * if v != NULL and (nj*bs*bs != nv): # <<<<<<<<<<<<<< * raise ValueError("size(V) is %d, expected %d" % * (toInt(nv), toInt(nj*bs*bs)) ) */ } /* "petsc4py/PETSc/petscmat.pxi":841 * (toInt(nv), toInt(nj*bs*bs)) ) * # preallocate * if aij == PETSC_TRUE: # <<<<<<<<<<<<<< * CHKERR( MatSeqAIJSetPreallocationCSR(A, i, j, v) ) * CHKERR( MatMPIAIJSetPreallocationCSR(A, i, j, v) ) */ __pyx_t_2 = (__pyx_v_aij == PETSC_TRUE); if (__pyx_t_2) { /* "petsc4py/PETSc/petscmat.pxi":842 * # preallocate * if aij == PETSC_TRUE: * CHKERR( MatSeqAIJSetPreallocationCSR(A, i, j, v) ) # <<<<<<<<<<<<<< * CHKERR( MatMPIAIJSetPreallocationCSR(A, i, j, v) ) * if baij == PETSC_TRUE: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSeqAIJSetPreallocationCSR(__pyx_v_A, __pyx_v_i, __pyx_v_j, __pyx_v_v)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(8, 842, __pyx_L1_error) /* "petsc4py/PETSc/petscmat.pxi":843 * if aij == PETSC_TRUE: * CHKERR( MatSeqAIJSetPreallocationCSR(A, i, j, v) ) * CHKERR( MatMPIAIJSetPreallocationCSR(A, i, j, v) ) # <<<<<<<<<<<<<< * if baij == PETSC_TRUE: * CHKERR( MatSeqBAIJSetPreallocationCSR(A, bs, i, j, v) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatMPIAIJSetPreallocationCSR(__pyx_v_A, __pyx_v_i, __pyx_v_j, __pyx_v_v)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(8, 843, __pyx_L1_error) /* "petsc4py/PETSc/petscmat.pxi":841 * (toInt(nv), toInt(nj*bs*bs)) ) * # preallocate * if aij == PETSC_TRUE: # <<<<<<<<<<<<<< * CHKERR( MatSeqAIJSetPreallocationCSR(A, i, j, v) ) * CHKERR( MatMPIAIJSetPreallocationCSR(A, i, j, v) ) */ } /* "petsc4py/PETSc/petscmat.pxi":844 * CHKERR( MatSeqAIJSetPreallocationCSR(A, i, j, v) ) * CHKERR( MatMPIAIJSetPreallocationCSR(A, i, j, v) ) * if baij == PETSC_TRUE: # <<<<<<<<<<<<<< * CHKERR( MatSeqBAIJSetPreallocationCSR(A, bs, i, j, v) ) * CHKERR( MatMPIBAIJSetPreallocationCSR(A, bs, i, j, v) ) */ __pyx_t_2 = (__pyx_v_baij == PETSC_TRUE); if (__pyx_t_2) { /* "petsc4py/PETSc/petscmat.pxi":845 * CHKERR( MatMPIAIJSetPreallocationCSR(A, i, j, v) ) * if baij == PETSC_TRUE: * CHKERR( MatSeqBAIJSetPreallocationCSR(A, bs, i, j, v) ) # <<<<<<<<<<<<<< * CHKERR( MatMPIBAIJSetPreallocationCSR(A, bs, i, j, v) ) * if sbaij == PETSC_TRUE: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSeqBAIJSetPreallocationCSR(__pyx_v_A, __pyx_v_bs, __pyx_v_i, __pyx_v_j, __pyx_v_v)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(8, 845, __pyx_L1_error) /* "petsc4py/PETSc/petscmat.pxi":846 * if baij == PETSC_TRUE: * CHKERR( MatSeqBAIJSetPreallocationCSR(A, bs, i, j, v) ) * CHKERR( MatMPIBAIJSetPreallocationCSR(A, bs, i, j, v) ) # <<<<<<<<<<<<<< * if sbaij == PETSC_TRUE: * CHKERR( MatSeqSBAIJSetPreallocationCSR(A, bs, i, j, v) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatMPIBAIJSetPreallocationCSR(__pyx_v_A, __pyx_v_bs, __pyx_v_i, __pyx_v_j, __pyx_v_v)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(8, 846, __pyx_L1_error) /* "petsc4py/PETSc/petscmat.pxi":844 * CHKERR( MatSeqAIJSetPreallocationCSR(A, i, j, v) ) * CHKERR( MatMPIAIJSetPreallocationCSR(A, i, j, v) ) * if baij == PETSC_TRUE: # <<<<<<<<<<<<<< * CHKERR( MatSeqBAIJSetPreallocationCSR(A, bs, i, j, v) ) * CHKERR( MatMPIBAIJSetPreallocationCSR(A, bs, i, j, v) ) */ } /* "petsc4py/PETSc/petscmat.pxi":847 * CHKERR( MatSeqBAIJSetPreallocationCSR(A, bs, i, j, v) ) * CHKERR( MatMPIBAIJSetPreallocationCSR(A, bs, i, j, v) ) * if sbaij == PETSC_TRUE: # <<<<<<<<<<<<<< * CHKERR( MatSeqSBAIJSetPreallocationCSR(A, bs, i, j, v) ) * CHKERR( MatMPISBAIJSetPreallocationCSR(A, bs, i, j, v) ) */ __pyx_t_2 = (__pyx_v_sbaij == PETSC_TRUE); if (__pyx_t_2) { /* "petsc4py/PETSc/petscmat.pxi":848 * CHKERR( MatMPIBAIJSetPreallocationCSR(A, bs, i, j, v) ) * if sbaij == PETSC_TRUE: * CHKERR( MatSeqSBAIJSetPreallocationCSR(A, bs, i, j, v) ) # <<<<<<<<<<<<<< * CHKERR( MatMPISBAIJSetPreallocationCSR(A, bs, i, j, v) ) * return PETSC_SUCCESS */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSeqSBAIJSetPreallocationCSR(__pyx_v_A, __pyx_v_bs, __pyx_v_i, __pyx_v_j, __pyx_v_v)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(8, 848, __pyx_L1_error) /* "petsc4py/PETSc/petscmat.pxi":849 * if sbaij == PETSC_TRUE: * CHKERR( MatSeqSBAIJSetPreallocationCSR(A, bs, i, j, v) ) * CHKERR( MatMPISBAIJSetPreallocationCSR(A, bs, i, j, v) ) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatMPISBAIJSetPreallocationCSR(__pyx_v_A, __pyx_v_bs, __pyx_v_i, __pyx_v_j, __pyx_v_v)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(8, 849, __pyx_L1_error) /* "petsc4py/PETSc/petscmat.pxi":847 * CHKERR( MatSeqBAIJSetPreallocationCSR(A, bs, i, j, v) ) * CHKERR( MatMPIBAIJSetPreallocationCSR(A, bs, i, j, v) ) * if sbaij == PETSC_TRUE: # <<<<<<<<<<<<<< * CHKERR( MatSeqSBAIJSetPreallocationCSR(A, bs, i, j, v) ) * CHKERR( MatMPISBAIJSetPreallocationCSR(A, bs, i, j, v) ) */ } /* "petsc4py/PETSc/petscmat.pxi":850 * CHKERR( MatSeqSBAIJSetPreallocationCSR(A, bs, i, j, v) ) * CHKERR( MatMPISBAIJSetPreallocationCSR(A, bs, i, j, v) ) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * cdef inline PetscErrorCode Mat_AllocAIJ(PetscMat A,object NNZ, object CSR) except PETSC_ERR_PYTHON: */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petscmat.pxi":801 * return PETSC_SUCCESS * * cdef inline PetscErrorCode Mat_AllocAIJ_CSR(PetscMat A, object CSR) except PETSC_ERR_PYTHON: # <<<<<<<<<<<<<< * # * cdef PetscBool aij=PETSC_FALSE, baij=PETSC_FALSE, sbaij=PETSC_FALSE, aijis=PETSC_FALSE */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_13); __Pyx_XDECREF(__pyx_t_14); __Pyx_AddTraceback("petsc4py.PETSc.Mat_AllocAIJ_CSR", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_oi); __Pyx_XDECREF(__pyx_v_oj); __Pyx_XDECREF(__pyx_v_ov); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscmat.pxi":852 * return PETSC_SUCCESS * * cdef inline PetscErrorCode Mat_AllocAIJ(PetscMat A,object NNZ, object CSR) except PETSC_ERR_PYTHON: # <<<<<<<<<<<<<< * if CSR is not None: * return Mat_AllocAIJ_CSR(A, CSR) */ static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_Mat_AllocAIJ(Mat __pyx_v_A, PyObject *__pyx_v_NNZ, PyObject *__pyx_v_CSR) { PetscErrorCode __pyx_r; int __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "petsc4py/PETSc/petscmat.pxi":853 * * cdef inline PetscErrorCode Mat_AllocAIJ(PetscMat A,object NNZ, object CSR) except PETSC_ERR_PYTHON: * if CSR is not None: # <<<<<<<<<<<<<< * return Mat_AllocAIJ_CSR(A, CSR) * if NNZ is not None: */ __pyx_t_1 = (__pyx_v_CSR != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/petscmat.pxi":854 * cdef inline PetscErrorCode Mat_AllocAIJ(PetscMat A,object NNZ, object CSR) except PETSC_ERR_PYTHON: * if CSR is not None: * return Mat_AllocAIJ_CSR(A, CSR) # <<<<<<<<<<<<<< * if NNZ is not None: * return Mat_AllocAIJ_NNZ(A, NNZ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_Mat_AllocAIJ_CSR(__pyx_v_A, __pyx_v_CSR); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(8, 854, __pyx_L1_error) __pyx_r = __pyx_t_2; goto __pyx_L0; /* "petsc4py/PETSc/petscmat.pxi":853 * * cdef inline PetscErrorCode Mat_AllocAIJ(PetscMat A,object NNZ, object CSR) except PETSC_ERR_PYTHON: * if CSR is not None: # <<<<<<<<<<<<<< * return Mat_AllocAIJ_CSR(A, CSR) * if NNZ is not None: */ } /* "petsc4py/PETSc/petscmat.pxi":855 * if CSR is not None: * return Mat_AllocAIJ_CSR(A, CSR) * if NNZ is not None: # <<<<<<<<<<<<<< * return Mat_AllocAIJ_NNZ(A, NNZ) * return PETSC_SUCCESS */ __pyx_t_1 = (__pyx_v_NNZ != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/petscmat.pxi":856 * return Mat_AllocAIJ_CSR(A, CSR) * if NNZ is not None: * return Mat_AllocAIJ_NNZ(A, NNZ) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_Mat_AllocAIJ_NNZ(__pyx_v_A, __pyx_v_NNZ); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(8, 856, __pyx_L1_error) __pyx_r = __pyx_t_2; goto __pyx_L0; /* "petsc4py/PETSc/petscmat.pxi":855 * if CSR is not None: * return Mat_AllocAIJ_CSR(A, CSR) * if NNZ is not None: # <<<<<<<<<<<<<< * return Mat_AllocAIJ_NNZ(A, NNZ) * return PETSC_SUCCESS */ } /* "petsc4py/PETSc/petscmat.pxi":857 * if NNZ is not None: * return Mat_AllocAIJ_NNZ(A, NNZ) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * cdef inline object Mat_AllocDense(PetscMat A, object array): */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petscmat.pxi":852 * return PETSC_SUCCESS * * cdef inline PetscErrorCode Mat_AllocAIJ(PetscMat A,object NNZ, object CSR) except PETSC_ERR_PYTHON: # <<<<<<<<<<<<<< * if CSR is not None: * return Mat_AllocAIJ_CSR(A, CSR) */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat_AllocAIJ", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/petscmat.pxi":859 * return PETSC_SUCCESS * * cdef inline object Mat_AllocDense(PetscMat A, object array): # <<<<<<<<<<<<<< * cdef PetscInt m=0, N=0 * CHKERR( MatGetLocalSize(A, &m, NULL) ) */ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_Mat_AllocDense(Mat __pyx_v_A, PyObject *__pyx_v_array) { PetscInt __pyx_v_m; PetscInt __pyx_v_N; PetscInt __pyx_v_size; PetscScalar *__pyx_v_data; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("Mat_AllocDense", 0); __Pyx_INCREF(__pyx_v_array); /* "petsc4py/PETSc/petscmat.pxi":860 * * cdef inline object Mat_AllocDense(PetscMat A, object array): * cdef PetscInt m=0, N=0 # <<<<<<<<<<<<<< * CHKERR( MatGetLocalSize(A, &m, NULL) ) * CHKERR( MatGetSize(A, NULL, &N) ) */ __pyx_v_m = 0; __pyx_v_N = 0; /* "petsc4py/PETSc/petscmat.pxi":861 * cdef inline object Mat_AllocDense(PetscMat A, object array): * cdef PetscInt m=0, N=0 * CHKERR( MatGetLocalSize(A, &m, NULL) ) # <<<<<<<<<<<<<< * CHKERR( MatGetSize(A, NULL, &N) ) * cdef PetscInt size=0 */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetLocalSize(__pyx_v_A, (&__pyx_v_m), NULL)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(8, 861, __pyx_L1_error) /* "petsc4py/PETSc/petscmat.pxi":862 * cdef PetscInt m=0, N=0 * CHKERR( MatGetLocalSize(A, &m, NULL) ) * CHKERR( MatGetSize(A, NULL, &N) ) # <<<<<<<<<<<<<< * cdef PetscInt size=0 * cdef PetscScalar *data=NULL */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetSize(__pyx_v_A, NULL, (&__pyx_v_N))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(8, 862, __pyx_L1_error) /* "petsc4py/PETSc/petscmat.pxi":863 * CHKERR( MatGetLocalSize(A, &m, NULL) ) * CHKERR( MatGetSize(A, NULL, &N) ) * cdef PetscInt size=0 # <<<<<<<<<<<<<< * cdef PetscScalar *data=NULL * if array is not None: */ __pyx_v_size = 0; /* "petsc4py/PETSc/petscmat.pxi":864 * CHKERR( MatGetSize(A, NULL, &N) ) * cdef PetscInt size=0 * cdef PetscScalar *data=NULL # <<<<<<<<<<<<<< * if array is not None: * array = ofarray_s(array, &size, &data) */ __pyx_v_data = NULL; /* "petsc4py/PETSc/petscmat.pxi":865 * cdef PetscInt size=0 * cdef PetscScalar *data=NULL * if array is not None: # <<<<<<<<<<<<<< * array = ofarray_s(array, &size, &data) * if m*N != size: raise ValueError( */ __pyx_t_2 = (__pyx_v_array != Py_None); if (__pyx_t_2) { /* "petsc4py/PETSc/petscmat.pxi":866 * cdef PetscScalar *data=NULL * if array is not None: * array = ofarray_s(array, &size, &data) # <<<<<<<<<<<<<< * if m*N != size: raise ValueError( * "size(array) is %d, expected %dx%d=%d" % */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ofarray_s(__pyx_v_array, (&__pyx_v_size), (&__pyx_v_data))); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 866, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_array, __pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/petscmat.pxi":867 * if array is not None: * array = ofarray_s(array, &size, &data) * if m*N != size: raise ValueError( # <<<<<<<<<<<<<< * "size(array) is %d, expected %dx%d=%d" % * (toInt(size), toInt(m), toInt(N), toInt(m*N)) ) */ __pyx_t_2 = ((__pyx_v_m * __pyx_v_N) != __pyx_v_size); if (unlikely(__pyx_t_2)) { /* "petsc4py/PETSc/petscmat.pxi":869 * if m*N != size: raise ValueError( * "size(array) is %d, expected %dx%d=%d" % * (toInt(size), toInt(m), toInt(N), toInt(m*N)) ) # <<<<<<<<<<<<<< * CHKERR( MatSeqDenseSetPreallocation(A, data) ) * CHKERR( MatMPIDenseSetPreallocation(A, data) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 869, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_m); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 869, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_N); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 869, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_m * __pyx_v_N)); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 869, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PyTuple_New(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 869, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3)) __PYX_ERR(8, 869, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4)) __PYX_ERR(8, 869, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_5)) __PYX_ERR(8, 869, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_6)) __PYX_ERR(8, 869, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0; /* "petsc4py/PETSc/petscmat.pxi":868 * array = ofarray_s(array, &size, &data) * if m*N != size: raise ValueError( * "size(array) is %d, expected %dx%d=%d" % # <<<<<<<<<<<<<< * (toInt(size), toInt(m), toInt(N), toInt(m*N)) ) * CHKERR( MatSeqDenseSetPreallocation(A, data) ) */ __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_size_array_is_d_expected_dx_d_d, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 868, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "petsc4py/PETSc/petscmat.pxi":867 * if array is not None: * array = ofarray_s(array, &size, &data) * if m*N != size: raise ValueError( # <<<<<<<<<<<<<< * "size(array) is %d, expected %dx%d=%d" % * (toInt(size), toInt(m), toInt(N), toInt(m*N)) ) */ __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __PYX_ERR(8, 867, __pyx_L1_error) } /* "petsc4py/PETSc/petscmat.pxi":865 * cdef PetscInt size=0 * cdef PetscScalar *data=NULL * if array is not None: # <<<<<<<<<<<<<< * array = ofarray_s(array, &size, &data) * if m*N != size: raise ValueError( */ } /* "petsc4py/PETSc/petscmat.pxi":870 * "size(array) is %d, expected %dx%d=%d" % * (toInt(size), toInt(m), toInt(N), toInt(m*N)) ) * CHKERR( MatSeqDenseSetPreallocation(A, data) ) # <<<<<<<<<<<<<< * CHKERR( MatMPIDenseSetPreallocation(A, data) ) * return array */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSeqDenseSetPreallocation(__pyx_v_A, __pyx_v_data)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(8, 870, __pyx_L1_error) /* "petsc4py/PETSc/petscmat.pxi":871 * (toInt(size), toInt(m), toInt(N), toInt(m*N)) ) * CHKERR( MatSeqDenseSetPreallocation(A, data) ) * CHKERR( MatMPIDenseSetPreallocation(A, data) ) # <<<<<<<<<<<<<< * return array * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatMPIDenseSetPreallocation(__pyx_v_A, __pyx_v_data)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(8, 871, __pyx_L1_error) /* "petsc4py/PETSc/petscmat.pxi":872 * CHKERR( MatSeqDenseSetPreallocation(A, data) ) * CHKERR( MatMPIDenseSetPreallocation(A, data) ) * return array # <<<<<<<<<<<<<< * * # ----------------------------------------------------------------------------- */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_array); __pyx_r = __pyx_v_array; goto __pyx_L0; /* "petsc4py/PETSc/petscmat.pxi":859 * return PETSC_SUCCESS * * cdef inline object Mat_AllocDense(PetscMat A, object array): # <<<<<<<<<<<<<< * cdef PetscInt m=0, N=0 * CHKERR( MatGetLocalSize(A, &m, NULL) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.Mat_AllocDense", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_array); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscmat.pxi":881 * const PetscScalar*,PetscInsertMode) * * cdef inline MatSetValuesFcn* matsetvalues_fcn(int blocked, int local): # <<<<<<<<<<<<<< * cdef MatSetValuesFcn *setvalues = NULL * if blocked and local: setvalues = MatSetValuesBlockedLocal */ static CYTHON_INLINE __pyx_t_8petsc4py_5PETSc_MatSetValuesFcn *__pyx_f_8petsc4py_5PETSc_matsetvalues_fcn(int __pyx_v_blocked, int __pyx_v_local) { __pyx_t_8petsc4py_5PETSc_MatSetValuesFcn *__pyx_v_setvalues; __pyx_t_8petsc4py_5PETSc_MatSetValuesFcn *__pyx_r; int __pyx_t_1; int __pyx_t_2; /* "petsc4py/PETSc/petscmat.pxi":882 * * cdef inline MatSetValuesFcn* matsetvalues_fcn(int blocked, int local): * cdef MatSetValuesFcn *setvalues = NULL # <<<<<<<<<<<<<< * if blocked and local: setvalues = MatSetValuesBlockedLocal * elif blocked: setvalues = MatSetValuesBlocked */ __pyx_v_setvalues = NULL; /* "petsc4py/PETSc/petscmat.pxi":883 * cdef inline MatSetValuesFcn* matsetvalues_fcn(int blocked, int local): * cdef MatSetValuesFcn *setvalues = NULL * if blocked and local: setvalues = MatSetValuesBlockedLocal # <<<<<<<<<<<<<< * elif blocked: setvalues = MatSetValuesBlocked * elif local: setvalues = MatSetValuesLocal */ __pyx_t_2 = (__pyx_v_blocked != 0); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = (__pyx_v_local != 0); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { __pyx_v_setvalues = MatSetValuesBlockedLocal; goto __pyx_L3; } /* "petsc4py/PETSc/petscmat.pxi":884 * cdef MatSetValuesFcn *setvalues = NULL * if blocked and local: setvalues = MatSetValuesBlockedLocal * elif blocked: setvalues = MatSetValuesBlocked # <<<<<<<<<<<<<< * elif local: setvalues = MatSetValuesLocal * else: setvalues = MatSetValues */ __pyx_t_1 = (__pyx_v_blocked != 0); if (__pyx_t_1) { __pyx_v_setvalues = MatSetValuesBlocked; goto __pyx_L3; } /* "petsc4py/PETSc/petscmat.pxi":885 * if blocked and local: setvalues = MatSetValuesBlockedLocal * elif blocked: setvalues = MatSetValuesBlocked * elif local: setvalues = MatSetValuesLocal # <<<<<<<<<<<<<< * else: setvalues = MatSetValues * return setvalues */ __pyx_t_1 = (__pyx_v_local != 0); if (__pyx_t_1) { __pyx_v_setvalues = MatSetValuesLocal; goto __pyx_L3; } /* "petsc4py/PETSc/petscmat.pxi":886 * elif blocked: setvalues = MatSetValuesBlocked * elif local: setvalues = MatSetValuesLocal * else: setvalues = MatSetValues # <<<<<<<<<<<<<< * return setvalues * */ /*else*/ { __pyx_v_setvalues = MatSetValues; } __pyx_L3:; /* "petsc4py/PETSc/petscmat.pxi":887 * elif local: setvalues = MatSetValuesLocal * else: setvalues = MatSetValues * return setvalues # <<<<<<<<<<<<<< * * cdef inline PetscErrorCode matsetvalues(PetscMat A, */ __pyx_r = __pyx_v_setvalues; goto __pyx_L0; /* "petsc4py/PETSc/petscmat.pxi":881 * const PetscScalar*,PetscInsertMode) * * cdef inline MatSetValuesFcn* matsetvalues_fcn(int blocked, int local): # <<<<<<<<<<<<<< * cdef MatSetValuesFcn *setvalues = NULL * if blocked and local: setvalues = MatSetValuesBlockedLocal */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/petscmat.pxi":889 * return setvalues * * cdef inline PetscErrorCode matsetvalues(PetscMat A, # <<<<<<<<<<<<<< * object oi, object oj, object ov, * object oaddv, int blocked, int local) except PETSC_ERR_PYTHON: */ static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_matsetvalues(Mat __pyx_v_A, PyObject *__pyx_v_oi, PyObject *__pyx_v_oj, PyObject *__pyx_v_ov, PyObject *__pyx_v_oaddv, int __pyx_v_blocked, int __pyx_v_local) { PetscInt __pyx_v_rbs; PetscInt __pyx_v_cbs; PetscInt __pyx_v_ni; PetscInt *__pyx_v_i; PetscInt __pyx_v_nj; PetscInt *__pyx_v_j; PetscInt __pyx_v_nv; PetscScalar *__pyx_v_v; __pyx_t_8petsc4py_5PETSc_MatSetValuesFcn *__pyx_v_setvalues; InsertMode __pyx_v_addv; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; __pyx_t_8petsc4py_5PETSc_MatSetValuesFcn *__pyx_t_7; InsertMode __pyx_t_8; PetscErrorCode __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("matsetvalues", 0); __Pyx_INCREF(__pyx_v_oi); __Pyx_INCREF(__pyx_v_oj); __Pyx_INCREF(__pyx_v_ov); /* "petsc4py/PETSc/petscmat.pxi":893 * object oaddv, int blocked, int local) except PETSC_ERR_PYTHON: * # block size * cdef PetscInt rbs=1, cbs=1 # <<<<<<<<<<<<<< * if blocked: CHKERR( MatGetBlockSizes(A, &rbs, &cbs) ) * if rbs < 1: rbs = 1 */ __pyx_v_rbs = 1; __pyx_v_cbs = 1; /* "petsc4py/PETSc/petscmat.pxi":894 * # block size * cdef PetscInt rbs=1, cbs=1 * if blocked: CHKERR( MatGetBlockSizes(A, &rbs, &cbs) ) # <<<<<<<<<<<<<< * if rbs < 1: rbs = 1 * if cbs < 1: cbs = 1 */ __pyx_t_1 = (__pyx_v_blocked != 0); if (__pyx_t_1) { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetBlockSizes(__pyx_v_A, (&__pyx_v_rbs), (&__pyx_v_cbs))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(8, 894, __pyx_L1_error) } /* "petsc4py/PETSc/petscmat.pxi":895 * cdef PetscInt rbs=1, cbs=1 * if blocked: CHKERR( MatGetBlockSizes(A, &rbs, &cbs) ) * if rbs < 1: rbs = 1 # <<<<<<<<<<<<<< * if cbs < 1: cbs = 1 * # rows, cols, and values */ __pyx_t_1 = (__pyx_v_rbs < 1); if (__pyx_t_1) { __pyx_v_rbs = 1; } /* "petsc4py/PETSc/petscmat.pxi":896 * if blocked: CHKERR( MatGetBlockSizes(A, &rbs, &cbs) ) * if rbs < 1: rbs = 1 * if cbs < 1: cbs = 1 # <<<<<<<<<<<<<< * # rows, cols, and values * cdef PetscInt ni=0, *i=NULL */ __pyx_t_1 = (__pyx_v_cbs < 1); if (__pyx_t_1) { __pyx_v_cbs = 1; } /* "petsc4py/PETSc/petscmat.pxi":898 * if cbs < 1: cbs = 1 * # rows, cols, and values * cdef PetscInt ni=0, *i=NULL # <<<<<<<<<<<<<< * cdef PetscInt nj=0, *j=NULL * cdef PetscInt nv=0 */ __pyx_v_ni = 0; __pyx_v_i = NULL; /* "petsc4py/PETSc/petscmat.pxi":899 * # rows, cols, and values * cdef PetscInt ni=0, *i=NULL * cdef PetscInt nj=0, *j=NULL # <<<<<<<<<<<<<< * cdef PetscInt nv=0 * cdef PetscScalar *v=NULL */ __pyx_v_nj = 0; __pyx_v_j = NULL; /* "petsc4py/PETSc/petscmat.pxi":900 * cdef PetscInt ni=0, *i=NULL * cdef PetscInt nj=0, *j=NULL * cdef PetscInt nv=0 # <<<<<<<<<<<<<< * cdef PetscScalar *v=NULL * oi = iarray_i(oi, &ni, &i) */ __pyx_v_nv = 0; /* "petsc4py/PETSc/petscmat.pxi":901 * cdef PetscInt nj=0, *j=NULL * cdef PetscInt nv=0 * cdef PetscScalar *v=NULL # <<<<<<<<<<<<<< * oi = iarray_i(oi, &ni, &i) * oj = iarray_i(oj, &nj, &j) */ __pyx_v_v = NULL; /* "petsc4py/PETSc/petscmat.pxi":902 * cdef PetscInt nv=0 * cdef PetscScalar *v=NULL * oi = iarray_i(oi, &ni, &i) # <<<<<<<<<<<<<< * oj = iarray_i(oj, &nj, &j) * ov = iarray_s(ov, &nv, &v) */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_oi, (&__pyx_v_ni), (&__pyx_v_i))); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 902, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_oi, __pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/petscmat.pxi":903 * cdef PetscScalar *v=NULL * oi = iarray_i(oi, &ni, &i) * oj = iarray_i(oj, &nj, &j) # <<<<<<<<<<<<<< * ov = iarray_s(ov, &nv, &v) * if ni*nj*rbs*cbs != nv: raise ValueError( */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_oj, (&__pyx_v_nj), (&__pyx_v_j))); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 903, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_oj, __pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/petscmat.pxi":904 * oi = iarray_i(oi, &ni, &i) * oj = iarray_i(oj, &nj, &j) * ov = iarray_s(ov, &nv, &v) # <<<<<<<<<<<<<< * if ni*nj*rbs*cbs != nv: raise ValueError( * "incompatible array sizes: ni=%d, nj=%d, nv=%d" % */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_s(__pyx_v_ov, (&__pyx_v_nv), (&__pyx_v_v))); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 904, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_ov, __pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/petscmat.pxi":905 * oj = iarray_i(oj, &nj, &j) * ov = iarray_s(ov, &nv, &v) * if ni*nj*rbs*cbs != nv: raise ValueError( # <<<<<<<<<<<<<< * "incompatible array sizes: ni=%d, nj=%d, nv=%d" % * (toInt(ni), toInt(nj), toInt(nv)) ) */ __pyx_t_1 = ((((__pyx_v_ni * __pyx_v_nj) * __pyx_v_rbs) * __pyx_v_cbs) != __pyx_v_nv); if (unlikely(__pyx_t_1)) { /* "petsc4py/PETSc/petscmat.pxi":907 * if ni*nj*rbs*cbs != nv: raise ValueError( * "incompatible array sizes: ni=%d, nj=%d, nv=%d" % * (toInt(ni), toInt(nj), toInt(nv)) ) # <<<<<<<<<<<<<< * # MatSetValuesXXX function and insert mode * cdef MatSetValuesFcn *setvalues = matsetvalues_fcn(blocked, local) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ni); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 907, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nj); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 907, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nv); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 907, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 907, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3)) __PYX_ERR(8, 907, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4)) __PYX_ERR(8, 907, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_5)) __PYX_ERR(8, 907, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; /* "petsc4py/PETSc/petscmat.pxi":906 * ov = iarray_s(ov, &nv, &v) * if ni*nj*rbs*cbs != nv: raise ValueError( * "incompatible array sizes: ni=%d, nj=%d, nv=%d" % # <<<<<<<<<<<<<< * (toInt(ni), toInt(nj), toInt(nv)) ) * # MatSetValuesXXX function and insert mode */ __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_incompatible_array_sizes_ni_d_nj, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 906, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "petsc4py/PETSc/petscmat.pxi":905 * oj = iarray_i(oj, &nj, &j) * ov = iarray_s(ov, &nv, &v) * if ni*nj*rbs*cbs != nv: raise ValueError( # <<<<<<<<<<<<<< * "incompatible array sizes: ni=%d, nj=%d, nv=%d" % * (toInt(ni), toInt(nj), toInt(nv)) ) */ __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 905, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __PYX_ERR(8, 905, __pyx_L1_error) } /* "petsc4py/PETSc/petscmat.pxi":909 * (toInt(ni), toInt(nj), toInt(nv)) ) * # MatSetValuesXXX function and insert mode * cdef MatSetValuesFcn *setvalues = matsetvalues_fcn(blocked, local) # <<<<<<<<<<<<<< * cdef PetscInsertMode addv = insertmode(oaddv) * # actual call */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_matsetvalues_fcn(__pyx_v_blocked, __pyx_v_local); if (unlikely(__pyx_t_7 == ((__pyx_t_8petsc4py_5PETSc_MatSetValuesFcn *)NULL) && PyErr_Occurred())) __PYX_ERR(8, 909, __pyx_L1_error) __pyx_v_setvalues = __pyx_t_7; /* "petsc4py/PETSc/petscmat.pxi":910 * # MatSetValuesXXX function and insert mode * cdef MatSetValuesFcn *setvalues = matsetvalues_fcn(blocked, local) * cdef PetscInsertMode addv = insertmode(oaddv) # <<<<<<<<<<<<<< * # actual call * CHKERR( setvalues(A, ni, i, nj, j, v, addv) ) */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_insertmode(__pyx_v_oaddv); if (unlikely(__pyx_t_8 == ((InsertMode)((InsertMode)-1L)))) __PYX_ERR(8, 910, __pyx_L1_error) __pyx_v_addv = __pyx_t_8; /* "petsc4py/PETSc/petscmat.pxi":912 * cdef PetscInsertMode addv = insertmode(oaddv) * # actual call * CHKERR( setvalues(A, ni, i, nj, j, v, addv) ) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_2 = __pyx_v_setvalues(__pyx_v_A, __pyx_v_ni, __pyx_v_i, __pyx_v_nj, __pyx_v_j, __pyx_v_v, __pyx_v_addv); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 912, __pyx_L1_error) __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_t_2); if (unlikely(__pyx_t_9 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(8, 912, __pyx_L1_error) /* "petsc4py/PETSc/petscmat.pxi":913 * # actual call * CHKERR( setvalues(A, ni, i, nj, j, v, addv) ) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * cdef inline PetscErrorCode matsetvalues_rcv(PetscMat A, */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petscmat.pxi":889 * return setvalues * * cdef inline PetscErrorCode matsetvalues(PetscMat A, # <<<<<<<<<<<<<< * object oi, object oj, object ov, * object oaddv, int blocked, int local) except PETSC_ERR_PYTHON: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.matsetvalues", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_oi); __Pyx_XDECREF(__pyx_v_oj); __Pyx_XDECREF(__pyx_v_ov); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscmat.pxi":915 * return PETSC_SUCCESS * * cdef inline PetscErrorCode matsetvalues_rcv(PetscMat A, # <<<<<<<<<<<<<< * object oi, object oj, object ov, * object oaddv, */ static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_matsetvalues_rcv(Mat __pyx_v_A, PyObject *__pyx_v_oi, PyObject *__pyx_v_oj, PyObject *__pyx_v_ov, PyObject *__pyx_v_oaddv, int __pyx_v_blocked, int __pyx_v_local) { PetscInt __pyx_v_rbs; PetscInt __pyx_v_cbs; PetscInt __pyx_v_ni; PetscInt *__pyx_v_i; PetscInt __pyx_v_nj; PetscInt *__pyx_v_j; PetscInt __pyx_v_nv; PetscScalar *__pyx_v_v; PyArrayObject *__pyx_v_ai = 0; PyArrayObject *__pyx_v_aj = 0; PyArrayObject *__pyx_v_av = 0; Py_ssize_t __pyx_v_nm; Py_ssize_t __pyx_v_si; Py_ssize_t __pyx_v_sj; Py_ssize_t __pyx_v_sv; __pyx_t_8petsc4py_5PETSc_MatSetValuesFcn *__pyx_v_setvalues; InsertMode __pyx_v_addv; Py_ssize_t __pyx_v_k; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; __pyx_t_8petsc4py_5PETSc_MatSetValuesFcn *__pyx_t_8; InsertMode __pyx_t_9; Py_ssize_t __pyx_t_10; PetscErrorCode __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("matsetvalues_rcv", 1); /* "petsc4py/PETSc/petscmat.pxi":920 * int blocked, int local) except PETSC_ERR_PYTHON: * # block size * cdef PetscInt rbs=1, cbs=1 # <<<<<<<<<<<<<< * if blocked: CHKERR( MatGetBlockSizes(A, &rbs, &cbs) ) * if rbs < 1: rbs = 1 */ __pyx_v_rbs = 1; __pyx_v_cbs = 1; /* "petsc4py/PETSc/petscmat.pxi":921 * # block size * cdef PetscInt rbs=1, cbs=1 * if blocked: CHKERR( MatGetBlockSizes(A, &rbs, &cbs) ) # <<<<<<<<<<<<<< * if rbs < 1: rbs = 1 * if cbs < 1: cbs = 1 */ __pyx_t_1 = (__pyx_v_blocked != 0); if (__pyx_t_1) { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetBlockSizes(__pyx_v_A, (&__pyx_v_rbs), (&__pyx_v_cbs))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(8, 921, __pyx_L1_error) } /* "petsc4py/PETSc/petscmat.pxi":922 * cdef PetscInt rbs=1, cbs=1 * if blocked: CHKERR( MatGetBlockSizes(A, &rbs, &cbs) ) * if rbs < 1: rbs = 1 # <<<<<<<<<<<<<< * if cbs < 1: cbs = 1 * # rows, cols, and values */ __pyx_t_1 = (__pyx_v_rbs < 1); if (__pyx_t_1) { __pyx_v_rbs = 1; } /* "petsc4py/PETSc/petscmat.pxi":923 * if blocked: CHKERR( MatGetBlockSizes(A, &rbs, &cbs) ) * if rbs < 1: rbs = 1 * if cbs < 1: cbs = 1 # <<<<<<<<<<<<<< * # rows, cols, and values * cdef PetscInt ni=0, *i=NULL */ __pyx_t_1 = (__pyx_v_cbs < 1); if (__pyx_t_1) { __pyx_v_cbs = 1; } /* "petsc4py/PETSc/petscmat.pxi":925 * if cbs < 1: cbs = 1 * # rows, cols, and values * cdef PetscInt ni=0, *i=NULL # <<<<<<<<<<<<<< * cdef PetscInt nj=0, *j=NULL * cdef PetscInt nv=0 */ __pyx_v_ni = 0; __pyx_v_i = NULL; /* "petsc4py/PETSc/petscmat.pxi":926 * # rows, cols, and values * cdef PetscInt ni=0, *i=NULL * cdef PetscInt nj=0, *j=NULL # <<<<<<<<<<<<<< * cdef PetscInt nv=0 * cdef PetscScalar *v=NULL */ __pyx_v_nj = 0; __pyx_v_j = NULL; /* "petsc4py/PETSc/petscmat.pxi":927 * cdef PetscInt ni=0, *i=NULL * cdef PetscInt nj=0, *j=NULL * cdef PetscInt nv=0 # <<<<<<<<<<<<<< * cdef PetscScalar *v=NULL * cdef ndarray ai = iarray_i(oi, &ni, &i) */ __pyx_v_nv = 0; /* "petsc4py/PETSc/petscmat.pxi":928 * cdef PetscInt nj=0, *j=NULL * cdef PetscInt nv=0 * cdef PetscScalar *v=NULL # <<<<<<<<<<<<<< * cdef ndarray ai = iarray_i(oi, &ni, &i) * cdef ndarray aj = iarray_i(oj, &nj, &j) */ __pyx_v_v = NULL; /* "petsc4py/PETSc/petscmat.pxi":929 * cdef PetscInt nv=0 * cdef PetscScalar *v=NULL * cdef ndarray ai = iarray_i(oi, &ni, &i) # <<<<<<<<<<<<<< * cdef ndarray aj = iarray_i(oj, &nj, &j) * cdef ndarray av = iarray_s(ov, &nv, &v) */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_oi, (&__pyx_v_ni), (&__pyx_v_i))); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 929, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_ai = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/petscmat.pxi":930 * cdef PetscScalar *v=NULL * cdef ndarray ai = iarray_i(oi, &ni, &i) * cdef ndarray aj = iarray_i(oj, &nj, &j) # <<<<<<<<<<<<<< * cdef ndarray av = iarray_s(ov, &nv, &v) * # check various dimensions */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_oj, (&__pyx_v_nj), (&__pyx_v_j))); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 930, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_aj = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/petscmat.pxi":931 * cdef ndarray ai = iarray_i(oi, &ni, &i) * cdef ndarray aj = iarray_i(oj, &nj, &j) * cdef ndarray av = iarray_s(ov, &nv, &v) # <<<<<<<<<<<<<< * # check various dimensions * if PyArray_NDIM(ai) != 2: raise ValueError( */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_s(__pyx_v_ov, (&__pyx_v_nv), (&__pyx_v_v))); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 931, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_av = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/petscmat.pxi":933 * cdef ndarray av = iarray_s(ov, &nv, &v) * # check various dimensions * if PyArray_NDIM(ai) != 2: raise ValueError( # <<<<<<<<<<<<<< * ("row indices must have two dimensions: " * "rows.ndim=%d") % (PyArray_NDIM(ai)) ) */ __pyx_t_1 = (PyArray_NDIM(__pyx_v_ai) != 2); if (unlikely(__pyx_t_1)) { /* "petsc4py/PETSc/petscmat.pxi":935 * if PyArray_NDIM(ai) != 2: raise ValueError( * ("row indices must have two dimensions: " * "rows.ndim=%d") % (PyArray_NDIM(ai)) ) # <<<<<<<<<<<<<< * elif not PyArray_ISCONTIGUOUS(ai): raise ValueError( * "expecting a C-contiguous array") */ __pyx_t_3 = __Pyx_PyInt_From_int(PyArray_NDIM(__pyx_v_ai)); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 935, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_row_indices_must_have_two_dimens, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 935, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/petscmat.pxi":933 * cdef ndarray av = iarray_s(ov, &nv, &v) * # check various dimensions * if PyArray_NDIM(ai) != 2: raise ValueError( # <<<<<<<<<<<<<< * ("row indices must have two dimensions: " * "rows.ndim=%d") % (PyArray_NDIM(ai)) ) */ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 933, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(8, 933, __pyx_L1_error) } /* "petsc4py/PETSc/petscmat.pxi":936 * ("row indices must have two dimensions: " * "rows.ndim=%d") % (PyArray_NDIM(ai)) ) * elif not PyArray_ISCONTIGUOUS(ai): raise ValueError( # <<<<<<<<<<<<<< * "expecting a C-contiguous array") * if PyArray_NDIM(aj) != 2: raise ValueError( */ __pyx_t_1 = (!PyArray_ISCONTIGUOUS(__pyx_v_ai)); if (unlikely(__pyx_t_1)) { __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 936, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(8, 936, __pyx_L1_error) } /* "petsc4py/PETSc/petscmat.pxi":938 * elif not PyArray_ISCONTIGUOUS(ai): raise ValueError( * "expecting a C-contiguous array") * if PyArray_NDIM(aj) != 2: raise ValueError( # <<<<<<<<<<<<<< * ("column indices must have two dimensions: " * "cols.ndim=%d") % (PyArray_NDIM(aj)) ) */ __pyx_t_1 = (PyArray_NDIM(__pyx_v_aj) != 2); if (unlikely(__pyx_t_1)) { /* "petsc4py/PETSc/petscmat.pxi":940 * if PyArray_NDIM(aj) != 2: raise ValueError( * ("column indices must have two dimensions: " * "cols.ndim=%d") % (PyArray_NDIM(aj)) ) # <<<<<<<<<<<<<< * elif not PyArray_ISCONTIGUOUS(aj): raise ValueError( * "expecting a C-contiguous array") */ __pyx_t_3 = __Pyx_PyInt_From_int(PyArray_NDIM(__pyx_v_aj)); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 940, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_column_indices_must_have_two_dim, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 940, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/petscmat.pxi":938 * elif not PyArray_ISCONTIGUOUS(ai): raise ValueError( * "expecting a C-contiguous array") * if PyArray_NDIM(aj) != 2: raise ValueError( # <<<<<<<<<<<<<< * ("column indices must have two dimensions: " * "cols.ndim=%d") % (PyArray_NDIM(aj)) ) */ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 938, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(8, 938, __pyx_L1_error) } /* "petsc4py/PETSc/petscmat.pxi":941 * ("column indices must have two dimensions: " * "cols.ndim=%d") % (PyArray_NDIM(aj)) ) * elif not PyArray_ISCONTIGUOUS(aj): raise ValueError( # <<<<<<<<<<<<<< * "expecting a C-contiguous array") * if PyArray_NDIM(av) < 2: raise ValueError( */ __pyx_t_1 = (!PyArray_ISCONTIGUOUS(__pyx_v_aj)); if (unlikely(__pyx_t_1)) { __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 941, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(8, 941, __pyx_L1_error) } /* "petsc4py/PETSc/petscmat.pxi":943 * elif not PyArray_ISCONTIGUOUS(aj): raise ValueError( * "expecting a C-contiguous array") * if PyArray_NDIM(av) < 2: raise ValueError( # <<<<<<<<<<<<<< * ("values must have two or more dimensions: " * "vals.ndim=%d") % (PyArray_NDIM(av)) ) */ __pyx_t_1 = (PyArray_NDIM(__pyx_v_av) < 2); if (unlikely(__pyx_t_1)) { /* "petsc4py/PETSc/petscmat.pxi":945 * if PyArray_NDIM(av) < 2: raise ValueError( * ("values must have two or more dimensions: " * "vals.ndim=%d") % (PyArray_NDIM(av)) ) # <<<<<<<<<<<<<< * elif not PyArray_ISCONTIGUOUS(av): raise ValueError( * "expecting a C-contiguous array") */ __pyx_t_3 = __Pyx_PyInt_From_int(PyArray_NDIM(__pyx_v_av)); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 945, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_values_must_have_two_or_more_dim, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 945, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/petscmat.pxi":943 * elif not PyArray_ISCONTIGUOUS(aj): raise ValueError( * "expecting a C-contiguous array") * if PyArray_NDIM(av) < 2: raise ValueError( # <<<<<<<<<<<<<< * ("values must have two or more dimensions: " * "vals.ndim=%d") % (PyArray_NDIM(av)) ) */ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 943, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(8, 943, __pyx_L1_error) } /* "petsc4py/PETSc/petscmat.pxi":946 * ("values must have two or more dimensions: " * "vals.ndim=%d") % (PyArray_NDIM(av)) ) * elif not PyArray_ISCONTIGUOUS(av): raise ValueError( # <<<<<<<<<<<<<< * "expecting a C-contiguous array") * # check various shapes */ __pyx_t_1 = (!PyArray_ISCONTIGUOUS(__pyx_v_av)); if (unlikely(__pyx_t_1)) { __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 946, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(8, 946, __pyx_L1_error) } /* "petsc4py/PETSc/petscmat.pxi":949 * "expecting a C-contiguous array") * # check various shapes * cdef Py_ssize_t nm = PyArray_DIM(ai, 0) # <<<<<<<<<<<<<< * cdef Py_ssize_t si = PyArray_DIM(ai, 1) * cdef Py_ssize_t sj = PyArray_DIM(aj, 1) */ __pyx_v_nm = PyArray_DIM(__pyx_v_ai, 0); /* "petsc4py/PETSc/petscmat.pxi":950 * # check various shapes * cdef Py_ssize_t nm = PyArray_DIM(ai, 0) * cdef Py_ssize_t si = PyArray_DIM(ai, 1) # <<<<<<<<<<<<<< * cdef Py_ssize_t sj = PyArray_DIM(aj, 1) * cdef Py_ssize_t sv = PyArray_MultiplyList(PyArray_DIMS(av)+1, PyArray_NDIM(av)-1) */ __pyx_v_si = PyArray_DIM(__pyx_v_ai, 1); /* "petsc4py/PETSc/petscmat.pxi":951 * cdef Py_ssize_t nm = PyArray_DIM(ai, 0) * cdef Py_ssize_t si = PyArray_DIM(ai, 1) * cdef Py_ssize_t sj = PyArray_DIM(aj, 1) # <<<<<<<<<<<<<< * cdef Py_ssize_t sv = PyArray_MultiplyList(PyArray_DIMS(av)+1, PyArray_NDIM(av)-1) * if ((nm != PyArray_DIM(aj, 0)) or */ __pyx_v_sj = PyArray_DIM(__pyx_v_aj, 1); /* "petsc4py/PETSc/petscmat.pxi":952 * cdef Py_ssize_t si = PyArray_DIM(ai, 1) * cdef Py_ssize_t sj = PyArray_DIM(aj, 1) * cdef Py_ssize_t sv = PyArray_MultiplyList(PyArray_DIMS(av)+1, PyArray_NDIM(av)-1) # <<<<<<<<<<<<<< * if ((nm != PyArray_DIM(aj, 0)) or * (nm != PyArray_DIM(av, 0)) or */ __pyx_v_sv = PyArray_MultiplyList((PyArray_DIMS(__pyx_v_av) + 1), (PyArray_NDIM(__pyx_v_av) - 1)); /* "petsc4py/PETSc/petscmat.pxi":953 * cdef Py_ssize_t sj = PyArray_DIM(aj, 1) * cdef Py_ssize_t sv = PyArray_MultiplyList(PyArray_DIMS(av)+1, PyArray_NDIM(av)-1) * if ((nm != PyArray_DIM(aj, 0)) or # <<<<<<<<<<<<<< * (nm != PyArray_DIM(av, 0)) or * (si*rbs * sj*cbs != sv)): raise ValueError( */ __pyx_t_5 = (__pyx_v_nm != PyArray_DIM(__pyx_v_aj, 0)); if (!__pyx_t_5) { } else { __pyx_t_1 = __pyx_t_5; goto __pyx_L10_bool_binop_done; } /* "petsc4py/PETSc/petscmat.pxi":954 * cdef Py_ssize_t sv = PyArray_MultiplyList(PyArray_DIMS(av)+1, PyArray_NDIM(av)-1) * if ((nm != PyArray_DIM(aj, 0)) or * (nm != PyArray_DIM(av, 0)) or # <<<<<<<<<<<<<< * (si*rbs * sj*cbs != sv)): raise ValueError( * ("input arrays have incompatible shapes: " */ __pyx_t_5 = (__pyx_v_nm != PyArray_DIM(__pyx_v_av, 0)); if (!__pyx_t_5) { } else { __pyx_t_1 = __pyx_t_5; goto __pyx_L10_bool_binop_done; } /* "petsc4py/PETSc/petscmat.pxi":955 * if ((nm != PyArray_DIM(aj, 0)) or * (nm != PyArray_DIM(av, 0)) or * (si*rbs * sj*cbs != sv)): raise ValueError( # <<<<<<<<<<<<<< * ("input arrays have incompatible shapes: " * "rows.shape=%s, cols.shape=%s, vals.shape=%s") % */ __pyx_t_5 = ((((__pyx_v_si * __pyx_v_rbs) * __pyx_v_sj) * __pyx_v_cbs) != __pyx_v_sv); __pyx_t_1 = __pyx_t_5; __pyx_L10_bool_binop_done:; /* "petsc4py/PETSc/petscmat.pxi":953 * cdef Py_ssize_t sj = PyArray_DIM(aj, 1) * cdef Py_ssize_t sv = PyArray_MultiplyList(PyArray_DIMS(av)+1, PyArray_NDIM(av)-1) * if ((nm != PyArray_DIM(aj, 0)) or # <<<<<<<<<<<<<< * (nm != PyArray_DIM(av, 0)) or * (si*rbs * sj*cbs != sv)): raise ValueError( */ if (unlikely(__pyx_t_1)) { /* "petsc4py/PETSc/petscmat.pxi":958 * ("input arrays have incompatible shapes: " * "rows.shape=%s, cols.shape=%s, vals.shape=%s") % * (ai.shape, aj.shape, av.shape)) # <<<<<<<<<<<<<< * # MatSetValuesXXX function and insert mode * cdef MatSetValuesFcn *setvalues = \ */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ai), __pyx_n_s_shape); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 958, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_aj), __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 958, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_av), __pyx_n_s_shape); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 958, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 958, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3)) __PYX_ERR(8, 958, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4)) __PYX_ERR(8, 958, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_6)) __PYX_ERR(8, 958, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_6 = 0; /* "petsc4py/PETSc/petscmat.pxi":957 * (si*rbs * sj*cbs != sv)): raise ValueError( * ("input arrays have incompatible shapes: " * "rows.shape=%s, cols.shape=%s, vals.shape=%s") % # <<<<<<<<<<<<<< * (ai.shape, aj.shape, av.shape)) * # MatSetValuesXXX function and insert mode */ __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_input_arrays_have_incompatible_s, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 957, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "petsc4py/PETSc/petscmat.pxi":955 * if ((nm != PyArray_DIM(aj, 0)) or * (nm != PyArray_DIM(av, 0)) or * (si*rbs * sj*cbs != sv)): raise ValueError( # <<<<<<<<<<<<<< * ("input arrays have incompatible shapes: " * "rows.shape=%s, cols.shape=%s, vals.shape=%s") % */ __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 955, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __PYX_ERR(8, 955, __pyx_L1_error) /* "petsc4py/PETSc/petscmat.pxi":953 * cdef Py_ssize_t sj = PyArray_DIM(aj, 1) * cdef Py_ssize_t sv = PyArray_MultiplyList(PyArray_DIMS(av)+1, PyArray_NDIM(av)-1) * if ((nm != PyArray_DIM(aj, 0)) or # <<<<<<<<<<<<<< * (nm != PyArray_DIM(av, 0)) or * (si*rbs * sj*cbs != sv)): raise ValueError( */ } /* "petsc4py/PETSc/petscmat.pxi":961 * # MatSetValuesXXX function and insert mode * cdef MatSetValuesFcn *setvalues = \ * matsetvalues_fcn(blocked, local) # <<<<<<<<<<<<<< * cdef PetscInsertMode addv = insertmode(oaddv) * # actual calls */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_matsetvalues_fcn(__pyx_v_blocked, __pyx_v_local); if (unlikely(__pyx_t_8 == ((__pyx_t_8petsc4py_5PETSc_MatSetValuesFcn *)NULL) && PyErr_Occurred())) __PYX_ERR(8, 961, __pyx_L1_error) __pyx_v_setvalues = __pyx_t_8; /* "petsc4py/PETSc/petscmat.pxi":962 * cdef MatSetValuesFcn *setvalues = \ * matsetvalues_fcn(blocked, local) * cdef PetscInsertMode addv = insertmode(oaddv) # <<<<<<<<<<<<<< * # actual calls * cdef Py_ssize_t k=0 */ __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_insertmode(__pyx_v_oaddv); if (unlikely(__pyx_t_9 == ((InsertMode)((InsertMode)-1L)))) __PYX_ERR(8, 962, __pyx_L1_error) __pyx_v_addv = __pyx_t_9; /* "petsc4py/PETSc/petscmat.pxi":964 * cdef PetscInsertMode addv = insertmode(oaddv) * # actual calls * cdef Py_ssize_t k=0 # <<<<<<<<<<<<<< * for k from 0 <= k < nm: * CHKERR( setvalues(A, */ __pyx_v_k = 0; /* "petsc4py/PETSc/petscmat.pxi":965 * # actual calls * cdef Py_ssize_t k=0 * for k from 0 <= k < nm: # <<<<<<<<<<<<<< * CHKERR( setvalues(A, * si, &i[k*si], */ __pyx_t_10 = __pyx_v_nm; for (__pyx_v_k = 0; __pyx_v_k < __pyx_t_10; __pyx_v_k++) { /* "petsc4py/PETSc/petscmat.pxi":966 * cdef Py_ssize_t k=0 * for k from 0 <= k < nm: * CHKERR( setvalues(A, # <<<<<<<<<<<<<< * si, &i[k*si], * sj, &j[k*sj], */ __pyx_t_2 = __pyx_v_setvalues(__pyx_v_A, ((PetscInt)__pyx_v_si), (&(__pyx_v_i[(__pyx_v_k * __pyx_v_si)])), ((PetscInt)__pyx_v_sj), (&(__pyx_v_j[(__pyx_v_k * __pyx_v_sj)])), (&(__pyx_v_v[(__pyx_v_k * __pyx_v_sv)])), __pyx_v_addv); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 966, __pyx_L1_error) __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_t_2); if (unlikely(__pyx_t_11 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(8, 966, __pyx_L1_error) } /* "petsc4py/PETSc/petscmat.pxi":970 * sj, &j[k*sj], * &v[k*sv], addv) ) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * cdef inline PetscErrorCode matsetvalues_ijv(PetscMat A, */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petscmat.pxi":915 * return PETSC_SUCCESS * * cdef inline PetscErrorCode matsetvalues_rcv(PetscMat A, # <<<<<<<<<<<<<< * object oi, object oj, object ov, * object oaddv, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.matsetvalues_rcv", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ai); __Pyx_XDECREF((PyObject *)__pyx_v_aj); __Pyx_XDECREF((PyObject *)__pyx_v_av); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscmat.pxi":972 * return PETSC_SUCCESS * * cdef inline PetscErrorCode matsetvalues_ijv(PetscMat A, # <<<<<<<<<<<<<< * object oi, object oj, object ov, * object oaddv, */ static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_matsetvalues_ijv(Mat __pyx_v_A, PyObject *__pyx_v_oi, PyObject *__pyx_v_oj, PyObject *__pyx_v_ov, PyObject *__pyx_v_oaddv, PyObject *__pyx_v_om, int __pyx_v_blocked, int __pyx_v_local) { PetscInt __pyx_v_rbs; PetscInt __pyx_v_cbs; PetscInt __pyx_v_ni; PetscInt *__pyx_v_i; PetscInt __pyx_v_nj; PetscInt *__pyx_v_j; PetscInt __pyx_v_nv; PetscScalar *__pyx_v_v; PetscInt __pyx_v_nm; PetscInt *__pyx_v_m; PetscInt __pyx_v_rs; PetscInt __pyx_v_re; __pyx_t_8petsc4py_5PETSc_MatSetValuesFcn *__pyx_v_setvalues; InsertMode __pyx_v_addv; PetscInt __pyx_v_k; PetscInt __pyx_v_l; PetscInt __pyx_v_irow; PetscInt __pyx_v_ncol; PetscInt *__pyx_v_icol; PetscScalar *__pyx_v_sval; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; __pyx_t_8petsc4py_5PETSc_MatSetValuesFcn *__pyx_t_6; InsertMode __pyx_t_7; PetscInt __pyx_t_8; PetscInt __pyx_t_9; PetscErrorCode __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("matsetvalues_ijv", 0); __Pyx_INCREF(__pyx_v_oi); __Pyx_INCREF(__pyx_v_oj); __Pyx_INCREF(__pyx_v_ov); __Pyx_INCREF(__pyx_v_om); /* "petsc4py/PETSc/petscmat.pxi":978 * int blocked, int local) except PETSC_ERR_PYTHON: * # block size * cdef PetscInt rbs=1, cbs=1 # <<<<<<<<<<<<<< * if blocked: CHKERR( MatGetBlockSizes(A, &rbs, &cbs) ) * if rbs < 1: rbs = 1 */ __pyx_v_rbs = 1; __pyx_v_cbs = 1; /* "petsc4py/PETSc/petscmat.pxi":979 * # block size * cdef PetscInt rbs=1, cbs=1 * if blocked: CHKERR( MatGetBlockSizes(A, &rbs, &cbs) ) # <<<<<<<<<<<<<< * if rbs < 1: rbs = 1 * if cbs < 1: cbs = 1 */ __pyx_t_1 = (__pyx_v_blocked != 0); if (__pyx_t_1) { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetBlockSizes(__pyx_v_A, (&__pyx_v_rbs), (&__pyx_v_cbs))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(8, 979, __pyx_L1_error) } /* "petsc4py/PETSc/petscmat.pxi":980 * cdef PetscInt rbs=1, cbs=1 * if blocked: CHKERR( MatGetBlockSizes(A, &rbs, &cbs) ) * if rbs < 1: rbs = 1 # <<<<<<<<<<<<<< * if cbs < 1: cbs = 1 * # column pointers, column indices, and values */ __pyx_t_1 = (__pyx_v_rbs < 1); if (__pyx_t_1) { __pyx_v_rbs = 1; } /* "petsc4py/PETSc/petscmat.pxi":981 * if blocked: CHKERR( MatGetBlockSizes(A, &rbs, &cbs) ) * if rbs < 1: rbs = 1 * if cbs < 1: cbs = 1 # <<<<<<<<<<<<<< * # column pointers, column indices, and values * cdef PetscInt ni=0, *i=NULL */ __pyx_t_1 = (__pyx_v_cbs < 1); if (__pyx_t_1) { __pyx_v_cbs = 1; } /* "petsc4py/PETSc/petscmat.pxi":983 * if cbs < 1: cbs = 1 * # column pointers, column indices, and values * cdef PetscInt ni=0, *i=NULL # <<<<<<<<<<<<<< * cdef PetscInt nj=0, *j=NULL * cdef PetscInt nv=0 */ __pyx_v_ni = 0; __pyx_v_i = NULL; /* "petsc4py/PETSc/petscmat.pxi":984 * # column pointers, column indices, and values * cdef PetscInt ni=0, *i=NULL * cdef PetscInt nj=0, *j=NULL # <<<<<<<<<<<<<< * cdef PetscInt nv=0 * cdef PetscScalar *v=NULL */ __pyx_v_nj = 0; __pyx_v_j = NULL; /* "petsc4py/PETSc/petscmat.pxi":985 * cdef PetscInt ni=0, *i=NULL * cdef PetscInt nj=0, *j=NULL * cdef PetscInt nv=0 # <<<<<<<<<<<<<< * cdef PetscScalar *v=NULL * oi = iarray_i(oi, &ni, &i) */ __pyx_v_nv = 0; /* "petsc4py/PETSc/petscmat.pxi":986 * cdef PetscInt nj=0, *j=NULL * cdef PetscInt nv=0 * cdef PetscScalar *v=NULL # <<<<<<<<<<<<<< * oi = iarray_i(oi, &ni, &i) * oj = iarray_i(oj, &nj, &j) */ __pyx_v_v = NULL; /* "petsc4py/PETSc/petscmat.pxi":987 * cdef PetscInt nv=0 * cdef PetscScalar *v=NULL * oi = iarray_i(oi, &ni, &i) # <<<<<<<<<<<<<< * oj = iarray_i(oj, &nj, &j) * ov = iarray_s(ov, &nv, &v) */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_oi, (&__pyx_v_ni), (&__pyx_v_i))); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 987, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_oi, __pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/petscmat.pxi":988 * cdef PetscScalar *v=NULL * oi = iarray_i(oi, &ni, &i) * oj = iarray_i(oj, &nj, &j) # <<<<<<<<<<<<<< * ov = iarray_s(ov, &nv, &v) * # row indices */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_oj, (&__pyx_v_nj), (&__pyx_v_j))); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 988, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_oj, __pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/petscmat.pxi":989 * oi = iarray_i(oi, &ni, &i) * oj = iarray_i(oj, &nj, &j) * ov = iarray_s(ov, &nv, &v) # <<<<<<<<<<<<<< * # row indices * cdef PetscInt nm=0, *m=NULL */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_s(__pyx_v_ov, (&__pyx_v_nv), (&__pyx_v_v))); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 989, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_ov, __pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/petscmat.pxi":991 * ov = iarray_s(ov, &nv, &v) * # row indices * cdef PetscInt nm=0, *m=NULL # <<<<<<<<<<<<<< * cdef PetscInt rs=0, re=ni-1 * if om is not None: */ __pyx_v_nm = 0; __pyx_v_m = NULL; /* "petsc4py/PETSc/petscmat.pxi":992 * # row indices * cdef PetscInt nm=0, *m=NULL * cdef PetscInt rs=0, re=ni-1 # <<<<<<<<<<<<<< * if om is not None: * om = iarray_i(om, &nm, &m) */ __pyx_v_rs = 0; __pyx_v_re = (__pyx_v_ni - 1); /* "petsc4py/PETSc/petscmat.pxi":993 * cdef PetscInt nm=0, *m=NULL * cdef PetscInt rs=0, re=ni-1 * if om is not None: # <<<<<<<<<<<<<< * om = iarray_i(om, &nm, &m) * else: */ __pyx_t_1 = (__pyx_v_om != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/petscmat.pxi":994 * cdef PetscInt rs=0, re=ni-1 * if om is not None: * om = iarray_i(om, &nm, &m) # <<<<<<<<<<<<<< * else: * if not local: */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_om, (&__pyx_v_nm), (&__pyx_v_m))); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 994, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_om, __pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/petscmat.pxi":993 * cdef PetscInt nm=0, *m=NULL * cdef PetscInt rs=0, re=ni-1 * if om is not None: # <<<<<<<<<<<<<< * om = iarray_i(om, &nm, &m) * else: */ goto __pyx_L6; } /* "petsc4py/PETSc/petscmat.pxi":996 * om = iarray_i(om, &nm, &m) * else: * if not local: # <<<<<<<<<<<<<< * CHKERR( MatGetOwnershipRange(A, &rs, &re) ) * rs //= rbs; re //= rbs */ /*else*/ { __pyx_t_1 = (!(__pyx_v_local != 0)); if (__pyx_t_1) { /* "petsc4py/PETSc/petscmat.pxi":997 * else: * if not local: * CHKERR( MatGetOwnershipRange(A, &rs, &re) ) # <<<<<<<<<<<<<< * rs //= rbs; re //= rbs * nm = re - rs */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetOwnershipRange(__pyx_v_A, (&__pyx_v_rs), (&__pyx_v_re))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(8, 997, __pyx_L1_error) /* "petsc4py/PETSc/petscmat.pxi":998 * if not local: * CHKERR( MatGetOwnershipRange(A, &rs, &re) ) * rs //= rbs; re //= rbs # <<<<<<<<<<<<<< * nm = re - rs * # check various sizes */ __pyx_v_rs = (__pyx_v_rs / __pyx_v_rbs); __pyx_v_re = (__pyx_v_re / __pyx_v_rbs); /* "petsc4py/PETSc/petscmat.pxi":996 * om = iarray_i(om, &nm, &m) * else: * if not local: # <<<<<<<<<<<<<< * CHKERR( MatGetOwnershipRange(A, &rs, &re) ) * rs //= rbs; re //= rbs */ } /* "petsc4py/PETSc/petscmat.pxi":999 * CHKERR( MatGetOwnershipRange(A, &rs, &re) ) * rs //= rbs; re //= rbs * nm = re - rs # <<<<<<<<<<<<<< * # check various sizes * if (ni-1 != nm): raise ValueError( */ __pyx_v_nm = (__pyx_v_re - __pyx_v_rs); } __pyx_L6:; /* "petsc4py/PETSc/petscmat.pxi":1001 * nm = re - rs * # check various sizes * if (ni-1 != nm): raise ValueError( # <<<<<<<<<<<<<< * "size(I) is %d, expected %d" % * (toInt(ni), toInt(nm+1)) ) */ __pyx_t_1 = ((__pyx_v_ni - 1) != __pyx_v_nm); if (unlikely(__pyx_t_1)) { /* "petsc4py/PETSc/petscmat.pxi":1003 * if (ni-1 != nm): raise ValueError( * "size(I) is %d, expected %d" % * (toInt(ni), toInt(nm+1)) ) # <<<<<<<<<<<<<< * if (i[0] != 0):raise ValueError( * "I[0] is %d, expected %d" % */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ni); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1003, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_nm + 1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 1003, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 1003, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3)) __PYX_ERR(8, 1003, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4)) __PYX_ERR(8, 1003, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_4 = 0; /* "petsc4py/PETSc/petscmat.pxi":1002 * # check various sizes * if (ni-1 != nm): raise ValueError( * "size(I) is %d, expected %d" % # <<<<<<<<<<<<<< * (toInt(ni), toInt(nm+1)) ) * if (i[0] != 0):raise ValueError( */ __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_size_I_is_d_expected_d, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 1002, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/petscmat.pxi":1001 * nm = re - rs * # check various sizes * if (ni-1 != nm): raise ValueError( # <<<<<<<<<<<<<< * "size(I) is %d, expected %d" % * (toInt(ni), toInt(nm+1)) ) */ __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 1001, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(8, 1001, __pyx_L1_error) } /* "petsc4py/PETSc/petscmat.pxi":1004 * "size(I) is %d, expected %d" % * (toInt(ni), toInt(nm+1)) ) * if (i[0] != 0):raise ValueError( # <<<<<<<<<<<<<< * "I[0] is %d, expected %d" % * (toInt(i[0]), 0) ) */ __pyx_t_1 = ((__pyx_v_i[0]) != 0); if (unlikely(__pyx_t_1)) { /* "petsc4py/PETSc/petscmat.pxi":1006 * if (i[0] != 0):raise ValueError( * "I[0] is %d, expected %d" % * (toInt(i[0]), 0) ) # <<<<<<<<<<<<<< * if (i[ni-1] != nj): raise ValueError( * "size(J) is %d, expected %d" % */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_i[0])); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 1006, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 1006, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5)) __PYX_ERR(8, 1006, __pyx_L1_error); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_0)) __PYX_ERR(8, 1006, __pyx_L1_error); __pyx_t_5 = 0; /* "petsc4py/PETSc/petscmat.pxi":1005 * (toInt(ni), toInt(nm+1)) ) * if (i[0] != 0):raise ValueError( * "I[0] is %d, expected %d" % # <<<<<<<<<<<<<< * (toInt(i[0]), 0) ) * if (i[ni-1] != nj): raise ValueError( */ __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_I_0_is_d_expected_d, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 1005, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/petscmat.pxi":1004 * "size(I) is %d, expected %d" % * (toInt(ni), toInt(nm+1)) ) * if (i[0] != 0):raise ValueError( # <<<<<<<<<<<<<< * "I[0] is %d, expected %d" % * (toInt(i[0]), 0) ) */ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 1004, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(8, 1004, __pyx_L1_error) } /* "petsc4py/PETSc/petscmat.pxi":1007 * "I[0] is %d, expected %d" % * (toInt(i[0]), 0) ) * if (i[ni-1] != nj): raise ValueError( # <<<<<<<<<<<<<< * "size(J) is %d, expected %d" % * (toInt(nj), toInt(i[ni-1])) ) */ __pyx_t_1 = ((__pyx_v_i[(__pyx_v_ni - 1)]) != __pyx_v_nj); if (unlikely(__pyx_t_1)) { /* "petsc4py/PETSc/petscmat.pxi":1009 * if (i[ni-1] != nj): raise ValueError( * "size(J) is %d, expected %d" % * (toInt(nj), toInt(i[ni-1])) ) # <<<<<<<<<<<<<< * if (nj*rbs*cbs != nv): raise ValueError( * "size(V) is %d, expected %d" % */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nj); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 1009, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_i[(__pyx_v_ni - 1)])); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 1009, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1009, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(8, 1009, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5)) __PYX_ERR(8, 1009, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_5 = 0; /* "petsc4py/PETSc/petscmat.pxi":1008 * (toInt(i[0]), 0) ) * if (i[ni-1] != nj): raise ValueError( * "size(J) is %d, expected %d" % # <<<<<<<<<<<<<< * (toInt(nj), toInt(i[ni-1])) ) * if (nj*rbs*cbs != nv): raise ValueError( */ __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_size_J_is_d_expected_d, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 1008, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/petscmat.pxi":1007 * "I[0] is %d, expected %d" % * (toInt(i[0]), 0) ) * if (i[ni-1] != nj): raise ValueError( # <<<<<<<<<<<<<< * "size(J) is %d, expected %d" % * (toInt(nj), toInt(i[ni-1])) ) */ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1007, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(8, 1007, __pyx_L1_error) } /* "petsc4py/PETSc/petscmat.pxi":1010 * "size(J) is %d, expected %d" % * (toInt(nj), toInt(i[ni-1])) ) * if (nj*rbs*cbs != nv): raise ValueError( # <<<<<<<<<<<<<< * "size(V) is %d, expected %d" % * (toInt(nv), toInt(nj*rbs*cbs)) ) */ __pyx_t_1 = (((__pyx_v_nj * __pyx_v_rbs) * __pyx_v_cbs) != __pyx_v_nv); if (unlikely(__pyx_t_1)) { /* "petsc4py/PETSc/petscmat.pxi":1012 * if (nj*rbs*cbs != nv): raise ValueError( * "size(V) is %d, expected %d" % * (toInt(nv), toInt(nj*rbs*cbs)) ) # <<<<<<<<<<<<<< * # MatSetValuesXXX function and insert mode * cdef MatSetValuesFcn *setvalues = \ */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nv); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1012, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(((__pyx_v_nj * __pyx_v_rbs) * __pyx_v_cbs)); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 1012, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 1012, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(8, 1012, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5)) __PYX_ERR(8, 1012, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_5 = 0; /* "petsc4py/PETSc/petscmat.pxi":1011 * (toInt(nj), toInt(i[ni-1])) ) * if (nj*rbs*cbs != nv): raise ValueError( * "size(V) is %d, expected %d" % # <<<<<<<<<<<<<< * (toInt(nv), toInt(nj*rbs*cbs)) ) * # MatSetValuesXXX function and insert mode */ __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_size_V_is_d_expected_d, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 1011, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/petscmat.pxi":1010 * "size(J) is %d, expected %d" % * (toInt(nj), toInt(i[ni-1])) ) * if (nj*rbs*cbs != nv): raise ValueError( # <<<<<<<<<<<<<< * "size(V) is %d, expected %d" % * (toInt(nv), toInt(nj*rbs*cbs)) ) */ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 1010, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(8, 1010, __pyx_L1_error) } /* "petsc4py/PETSc/petscmat.pxi":1015 * # MatSetValuesXXX function and insert mode * cdef MatSetValuesFcn *setvalues = \ * matsetvalues_fcn(blocked, local) # <<<<<<<<<<<<<< * cdef PetscInsertMode addv = insertmode(oaddv) * # actual call */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_matsetvalues_fcn(__pyx_v_blocked, __pyx_v_local); if (unlikely(__pyx_t_6 == ((__pyx_t_8petsc4py_5PETSc_MatSetValuesFcn *)NULL) && PyErr_Occurred())) __PYX_ERR(8, 1015, __pyx_L1_error) __pyx_v_setvalues = __pyx_t_6; /* "petsc4py/PETSc/petscmat.pxi":1016 * cdef MatSetValuesFcn *setvalues = \ * matsetvalues_fcn(blocked, local) * cdef PetscInsertMode addv = insertmode(oaddv) # <<<<<<<<<<<<<< * # actual call * cdef PetscInt k=0, l=0 */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_insertmode(__pyx_v_oaddv); if (unlikely(__pyx_t_7 == ((InsertMode)((InsertMode)-1L)))) __PYX_ERR(8, 1016, __pyx_L1_error) __pyx_v_addv = __pyx_t_7; /* "petsc4py/PETSc/petscmat.pxi":1018 * cdef PetscInsertMode addv = insertmode(oaddv) * # actual call * cdef PetscInt k=0, l=0 # <<<<<<<<<<<<<< * cdef PetscInt irow=0, ncol=0, *icol=NULL * cdef PetscScalar *sval=NULL */ __pyx_v_k = 0; __pyx_v_l = 0; /* "petsc4py/PETSc/petscmat.pxi":1019 * # actual call * cdef PetscInt k=0, l=0 * cdef PetscInt irow=0, ncol=0, *icol=NULL # <<<<<<<<<<<<<< * cdef PetscScalar *sval=NULL * for k from 0 <= k < nm: */ __pyx_v_irow = 0; __pyx_v_ncol = 0; __pyx_v_icol = NULL; /* "petsc4py/PETSc/petscmat.pxi":1020 * cdef PetscInt k=0, l=0 * cdef PetscInt irow=0, ncol=0, *icol=NULL * cdef PetscScalar *sval=NULL # <<<<<<<<<<<<<< * for k from 0 <= k < nm: * irow = m[k] if m!=NULL else rs+k */ __pyx_v_sval = NULL; /* "petsc4py/PETSc/petscmat.pxi":1021 * cdef PetscInt irow=0, ncol=0, *icol=NULL * cdef PetscScalar *sval=NULL * for k from 0 <= k < nm: # <<<<<<<<<<<<<< * irow = m[k] if m!=NULL else rs+k * ncol = i[k+1] - i[k] */ __pyx_t_8 = __pyx_v_nm; for (__pyx_v_k = 0; __pyx_v_k < __pyx_t_8; __pyx_v_k++) { /* "petsc4py/PETSc/petscmat.pxi":1022 * cdef PetscScalar *sval=NULL * for k from 0 <= k < nm: * irow = m[k] if m!=NULL else rs+k # <<<<<<<<<<<<<< * ncol = i[k+1] - i[k] * icol = j + i[k] */ __pyx_t_1 = (__pyx_v_m != NULL); if (__pyx_t_1) { __pyx_t_9 = (__pyx_v_m[__pyx_v_k]); } else { __pyx_t_9 = (__pyx_v_rs + __pyx_v_k); } __pyx_v_irow = __pyx_t_9; /* "petsc4py/PETSc/petscmat.pxi":1023 * for k from 0 <= k < nm: * irow = m[k] if m!=NULL else rs+k * ncol = i[k+1] - i[k] # <<<<<<<<<<<<<< * icol = j + i[k] * if blocked: */ __pyx_v_ncol = ((__pyx_v_i[(__pyx_v_k + 1)]) - (__pyx_v_i[__pyx_v_k])); /* "petsc4py/PETSc/petscmat.pxi":1024 * irow = m[k] if m!=NULL else rs+k * ncol = i[k+1] - i[k] * icol = j + i[k] # <<<<<<<<<<<<<< * if blocked: * sval = v + i[k]*rbs*cbs */ __pyx_v_icol = (__pyx_v_j + (__pyx_v_i[__pyx_v_k])); /* "petsc4py/PETSc/petscmat.pxi":1025 * ncol = i[k+1] - i[k] * icol = j + i[k] * if blocked: # <<<<<<<<<<<<<< * sval = v + i[k]*rbs*cbs * for l from 0 <= l < ncol: */ __pyx_t_1 = (__pyx_v_blocked != 0); if (__pyx_t_1) { /* "petsc4py/PETSc/petscmat.pxi":1026 * icol = j + i[k] * if blocked: * sval = v + i[k]*rbs*cbs # <<<<<<<<<<<<<< * for l from 0 <= l < ncol: * CHKERR( setvalues(A, 1, &irow, 1, &icol[l], */ __pyx_v_sval = (__pyx_v_v + (((__pyx_v_i[__pyx_v_k]) * __pyx_v_rbs) * __pyx_v_cbs)); /* "petsc4py/PETSc/petscmat.pxi":1027 * if blocked: * sval = v + i[k]*rbs*cbs * for l from 0 <= l < ncol: # <<<<<<<<<<<<<< * CHKERR( setvalues(A, 1, &irow, 1, &icol[l], * &sval[l*rbs*cbs], addv) ) */ __pyx_t_9 = __pyx_v_ncol; for (__pyx_v_l = 0; __pyx_v_l < __pyx_t_9; __pyx_v_l++) { /* "petsc4py/PETSc/petscmat.pxi":1028 * sval = v + i[k]*rbs*cbs * for l from 0 <= l < ncol: * CHKERR( setvalues(A, 1, &irow, 1, &icol[l], # <<<<<<<<<<<<<< * &sval[l*rbs*cbs], addv) ) * else: */ __pyx_t_2 = __pyx_v_setvalues(__pyx_v_A, 1, (&__pyx_v_irow), 1, (&(__pyx_v_icol[__pyx_v_l])), (&(__pyx_v_sval[((__pyx_v_l * __pyx_v_rbs) * __pyx_v_cbs)])), __pyx_v_addv); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 1028, __pyx_L1_error) __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_t_2); if (unlikely(__pyx_t_10 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(8, 1028, __pyx_L1_error) } /* "petsc4py/PETSc/petscmat.pxi":1025 * ncol = i[k+1] - i[k] * icol = j + i[k] * if blocked: # <<<<<<<<<<<<<< * sval = v + i[k]*rbs*cbs * for l from 0 <= l < ncol: */ goto __pyx_L14; } /* "petsc4py/PETSc/petscmat.pxi":1031 * &sval[l*rbs*cbs], addv) ) * else: * sval = v + i[k] # <<<<<<<<<<<<<< * CHKERR( setvalues(A, 1, &irow, ncol, icol, sval, addv) ) * return PETSC_SUCCESS */ /*else*/ { __pyx_v_sval = (__pyx_v_v + (__pyx_v_i[__pyx_v_k])); /* "petsc4py/PETSc/petscmat.pxi":1032 * else: * sval = v + i[k] * CHKERR( setvalues(A, 1, &irow, ncol, icol, sval, addv) ) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_10 = __pyx_v_setvalues(__pyx_v_A, 1, (&__pyx_v_irow), __pyx_v_ncol, __pyx_v_icol, __pyx_v_sval, __pyx_v_addv); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 1032, __pyx_L1_error) __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_t_10); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(8, 1032, __pyx_L1_error) } __pyx_L14:; } /* "petsc4py/PETSc/petscmat.pxi":1033 * sval = v + i[k] * CHKERR( setvalues(A, 1, &irow, ncol, icol, sval, addv) ) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * cdef inline PetscErrorCode matsetvalues_csr(PetscMat A, */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petscmat.pxi":972 * return PETSC_SUCCESS * * cdef inline PetscErrorCode matsetvalues_ijv(PetscMat A, # <<<<<<<<<<<<<< * object oi, object oj, object ov, * object oaddv, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.matsetvalues_ijv", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_oi); __Pyx_XDECREF(__pyx_v_oj); __Pyx_XDECREF(__pyx_v_ov); __Pyx_XDECREF(__pyx_v_om); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscmat.pxi":1035 * return PETSC_SUCCESS * * cdef inline PetscErrorCode matsetvalues_csr(PetscMat A, # <<<<<<<<<<<<<< * object oi, object oj, object ov, * object oaddv, */ static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_matsetvalues_csr(Mat __pyx_v_A, PyObject *__pyx_v_oi, PyObject *__pyx_v_oj, PyObject *__pyx_v_ov, PyObject *__pyx_v_oaddv, int __pyx_v_blocked, int __pyx_v_local) { PetscErrorCode __pyx_r; PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "petsc4py/PETSc/petscmat.pxi":1039 * object oaddv, * int blocked, int local) except PETSC_ERR_PYTHON: * matsetvalues_ijv(A, oi, oj, ov, oaddv, None, blocked, local) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_matsetvalues_ijv(__pyx_v_A, __pyx_v_oi, __pyx_v_oj, __pyx_v_ov, __pyx_v_oaddv, Py_None, __pyx_v_blocked, __pyx_v_local); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(8, 1039, __pyx_L1_error) /* "petsc4py/PETSc/petscmat.pxi":1040 * int blocked, int local) except PETSC_ERR_PYTHON: * matsetvalues_ijv(A, oi, oj, ov, oaddv, None, blocked, local) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * cdef inline matgetvalues(PetscMat mat, */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petscmat.pxi":1035 * return PETSC_SUCCESS * * cdef inline PetscErrorCode matsetvalues_csr(PetscMat A, # <<<<<<<<<<<<<< * object oi, object oj, object ov, * object oaddv, */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.matsetvalues_csr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/petscmat.pxi":1042 * return PETSC_SUCCESS * * cdef inline matgetvalues(PetscMat mat, # <<<<<<<<<<<<<< * object orows, object ocols, object values): * cdef PetscInt ni=0, nj=0, nv=0 */ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_matgetvalues(Mat __pyx_v_mat, PyObject *__pyx_v_orows, PyObject *__pyx_v_ocols, PyObject *__pyx_v_values) { PetscInt __pyx_v_ni; PetscInt __pyx_v_nj; PetscInt __pyx_v_nv; PetscInt *__pyx_v_i; PetscInt *__pyx_v_j; PetscScalar *__pyx_v_v; PyArrayObject *__pyx_v_rows = 0; PyArrayObject *__pyx_v_cols = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PetscErrorCode __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("matgetvalues", 0); __Pyx_INCREF(__pyx_v_values); /* "petsc4py/PETSc/petscmat.pxi":1044 * cdef inline matgetvalues(PetscMat mat, * object orows, object ocols, object values): * cdef PetscInt ni=0, nj=0, nv=0 # <<<<<<<<<<<<<< * cdef PetscInt *i=NULL, *j=NULL * cdef PetscScalar *v=NULL */ __pyx_v_ni = 0; __pyx_v_nj = 0; __pyx_v_nv = 0; /* "petsc4py/PETSc/petscmat.pxi":1045 * object orows, object ocols, object values): * cdef PetscInt ni=0, nj=0, nv=0 * cdef PetscInt *i=NULL, *j=NULL # <<<<<<<<<<<<<< * cdef PetscScalar *v=NULL * cdef ndarray rows = iarray_i(orows, &ni, &i) */ __pyx_v_i = NULL; __pyx_v_j = NULL; /* "petsc4py/PETSc/petscmat.pxi":1046 * cdef PetscInt ni=0, nj=0, nv=0 * cdef PetscInt *i=NULL, *j=NULL * cdef PetscScalar *v=NULL # <<<<<<<<<<<<<< * cdef ndarray rows = iarray_i(orows, &ni, &i) * cdef ndarray cols = iarray_i(ocols, &nj, &j) */ __pyx_v_v = NULL; /* "petsc4py/PETSc/petscmat.pxi":1047 * cdef PetscInt *i=NULL, *j=NULL * cdef PetscScalar *v=NULL * cdef ndarray rows = iarray_i(orows, &ni, &i) # <<<<<<<<<<<<<< * cdef ndarray cols = iarray_i(ocols, &nj, &j) * if values is None: */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_orows, (&__pyx_v_ni), (&__pyx_v_i))); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 1047, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_rows = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscmat.pxi":1048 * cdef PetscScalar *v=NULL * cdef ndarray rows = iarray_i(orows, &ni, &i) * cdef ndarray cols = iarray_i(ocols, &nj, &j) # <<<<<<<<<<<<<< * if values is None: * values = empty_s(ni*nj) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_ocols, (&__pyx_v_nj), (&__pyx_v_j))); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 1048, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_cols = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscmat.pxi":1049 * cdef ndarray rows = iarray_i(orows, &ni, &i) * cdef ndarray cols = iarray_i(ocols, &nj, &j) * if values is None: # <<<<<<<<<<<<<< * values = empty_s(ni*nj) * values.shape = rows.shape + cols.shape */ __pyx_t_2 = (__pyx_v_values == Py_None); if (__pyx_t_2) { /* "petsc4py/PETSc/petscmat.pxi":1050 * cdef ndarray cols = iarray_i(ocols, &nj, &j) * if values is None: * values = empty_s(ni*nj) # <<<<<<<<<<<<<< * values.shape = rows.shape + cols.shape * values = oarray_s(values, &nv, &v) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_s((__pyx_v_ni * __pyx_v_nj))); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 1050, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_values, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscmat.pxi":1051 * if values is None: * values = empty_s(ni*nj) * values.shape = rows.shape + cols.shape # <<<<<<<<<<<<<< * values = oarray_s(values, &nv, &v) * if (ni*nj != nv): raise ValueError( */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_rows), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 1051, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_cols), __pyx_n_s_shape); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1051, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 1051, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_values, __pyx_n_s_shape, __pyx_t_4) < 0) __PYX_ERR(8, 1051, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/petscmat.pxi":1049 * cdef ndarray rows = iarray_i(orows, &ni, &i) * cdef ndarray cols = iarray_i(ocols, &nj, &j) * if values is None: # <<<<<<<<<<<<<< * values = empty_s(ni*nj) * values.shape = rows.shape + cols.shape */ } /* "petsc4py/PETSc/petscmat.pxi":1052 * values = empty_s(ni*nj) * values.shape = rows.shape + cols.shape * values = oarray_s(values, &nv, &v) # <<<<<<<<<<<<<< * if (ni*nj != nv): raise ValueError( * "incompatible array sizes: ni=%d, nj=%d, nv=%d" % */ __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_s(__pyx_v_values, (&__pyx_v_nv), (&__pyx_v_v))); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 1052, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_values, __pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/petscmat.pxi":1053 * values.shape = rows.shape + cols.shape * values = oarray_s(values, &nv, &v) * if (ni*nj != nv): raise ValueError( # <<<<<<<<<<<<<< * "incompatible array sizes: ni=%d, nj=%d, nv=%d" % * (toInt(ni), toInt(nj), toInt(nv))) */ __pyx_t_2 = ((__pyx_v_ni * __pyx_v_nj) != __pyx_v_nv); if (unlikely(__pyx_t_2)) { /* "petsc4py/PETSc/petscmat.pxi":1055 * if (ni*nj != nv): raise ValueError( * "incompatible array sizes: ni=%d, nj=%d, nv=%d" % * (toInt(ni), toInt(nj), toInt(nv))) # <<<<<<<<<<<<<< * CHKERR( MatGetValues(mat, ni, i, nj, j, v) ) * return values */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ni); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 1055, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nj); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1055, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nv); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 1055, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 1055, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4)) __PYX_ERR(8, 1055, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3)) __PYX_ERR(8, 1055, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_1)) __PYX_ERR(8, 1055, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_3 = 0; __pyx_t_1 = 0; /* "petsc4py/PETSc/petscmat.pxi":1054 * values = oarray_s(values, &nv, &v) * if (ni*nj != nv): raise ValueError( * "incompatible array sizes: ni=%d, nj=%d, nv=%d" % # <<<<<<<<<<<<<< * (toInt(ni), toInt(nj), toInt(nv))) * CHKERR( MatGetValues(mat, ni, i, nj, j, v) ) */ __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_incompatible_array_sizes_ni_d_nj, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 1054, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/petscmat.pxi":1053 * values.shape = rows.shape + cols.shape * values = oarray_s(values, &nv, &v) * if (ni*nj != nv): raise ValueError( # <<<<<<<<<<<<<< * "incompatible array sizes: ni=%d, nj=%d, nv=%d" % * (toInt(ni), toInt(nj), toInt(nv))) */ __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 1053, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(8, 1053, __pyx_L1_error) } /* "petsc4py/PETSc/petscmat.pxi":1056 * "incompatible array sizes: ni=%d, nj=%d, nv=%d" % * (toInt(ni), toInt(nj), toInt(nv))) * CHKERR( MatGetValues(mat, ni, i, nj, j, v) ) # <<<<<<<<<<<<<< * return values * */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetValues(__pyx_v_mat, __pyx_v_ni, __pyx_v_i, __pyx_v_nj, __pyx_v_j, __pyx_v_v)); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(8, 1056, __pyx_L1_error) /* "petsc4py/PETSc/petscmat.pxi":1057 * (toInt(ni), toInt(nj), toInt(nv))) * CHKERR( MatGetValues(mat, ni, i, nj, j, v) ) * return values # <<<<<<<<<<<<<< * * # ----------------------------------------------------------------------------- */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_values); __pyx_r = __pyx_v_values; goto __pyx_L0; /* "petsc4py/PETSc/petscmat.pxi":1042 * return PETSC_SUCCESS * * cdef inline matgetvalues(PetscMat mat, # <<<<<<<<<<<<<< * object orows, object ocols, object values): * cdef PetscInt ni=0, nj=0, nv=0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.matgetvalues", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_rows); __Pyx_XDECREF((PyObject *)__pyx_v_cols); __Pyx_XDECREF(__pyx_v_values); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscmat.pxi":1064 * PetscErrorCode MatFactorInfoDefaults(PetscBool,PetscBool,PetscMatFactorInfo*) * * cdef inline PetscMatFactorShiftType matfactorshifttype(object st) \ # <<<<<<<<<<<<<< * except (-1): * if isinstance(st, str): */ static CYTHON_INLINE MatFactorShiftType __pyx_f_8petsc4py_5PETSc_matfactorshifttype(PyObject *__pyx_v_st) { MatFactorShiftType __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; MatFactorShiftType __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("matfactorshifttype", 1); /* "petsc4py/PETSc/petscmat.pxi":1066 * cdef inline PetscMatFactorShiftType matfactorshifttype(object st) \ * except (-1): * if isinstance(st, str): # <<<<<<<<<<<<<< * if st == "none": return MAT_SHIFT_NONE * if st == "nonzero": return MAT_SHIFT_NONZERO */ __pyx_t_1 = PyString_Check(__pyx_v_st); if (__pyx_t_1) { /* "petsc4py/PETSc/petscmat.pxi":1067 * except (-1): * if isinstance(st, str): * if st == "none": return MAT_SHIFT_NONE # <<<<<<<<<<<<<< * if st == "nonzero": return MAT_SHIFT_NONZERO * if st == "positive_definite": return MAT_SHIFT_POSITIVE_DEFINITE */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_st, __pyx_n_s_none, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(8, 1067, __pyx_L1_error) if (__pyx_t_1) { __pyx_r = MAT_SHIFT_NONE; goto __pyx_L0; } /* "petsc4py/PETSc/petscmat.pxi":1068 * if isinstance(st, str): * if st == "none": return MAT_SHIFT_NONE * if st == "nonzero": return MAT_SHIFT_NONZERO # <<<<<<<<<<<<<< * if st == "positive_definite": return MAT_SHIFT_POSITIVE_DEFINITE * if st == "inblocks": return MAT_SHIFT_INBLOCKS */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_st, __pyx_n_s_nonzero, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(8, 1068, __pyx_L1_error) if (__pyx_t_1) { __pyx_r = MAT_SHIFT_NONZERO; goto __pyx_L0; } /* "petsc4py/PETSc/petscmat.pxi":1069 * if st == "none": return MAT_SHIFT_NONE * if st == "nonzero": return MAT_SHIFT_NONZERO * if st == "positive_definite": return MAT_SHIFT_POSITIVE_DEFINITE # <<<<<<<<<<<<<< * if st == "inblocks": return MAT_SHIFT_INBLOCKS * if st == "na": return MAT_SHIFT_NONZERO */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_st, __pyx_n_s_positive_definite, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(8, 1069, __pyx_L1_error) if (__pyx_t_1) { __pyx_r = MAT_SHIFT_POSITIVE_DEFINITE; goto __pyx_L0; } /* "petsc4py/PETSc/petscmat.pxi":1070 * if st == "nonzero": return MAT_SHIFT_NONZERO * if st == "positive_definite": return MAT_SHIFT_POSITIVE_DEFINITE * if st == "inblocks": return MAT_SHIFT_INBLOCKS # <<<<<<<<<<<<<< * if st == "na": return MAT_SHIFT_NONZERO * if st == "pd": return MAT_SHIFT_POSITIVE_DEFINITE */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_st, __pyx_n_s_inblocks, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(8, 1070, __pyx_L1_error) if (__pyx_t_1) { __pyx_r = MAT_SHIFT_INBLOCKS; goto __pyx_L0; } /* "petsc4py/PETSc/petscmat.pxi":1071 * if st == "positive_definite": return MAT_SHIFT_POSITIVE_DEFINITE * if st == "inblocks": return MAT_SHIFT_INBLOCKS * if st == "na": return MAT_SHIFT_NONZERO # <<<<<<<<<<<<<< * if st == "pd": return MAT_SHIFT_POSITIVE_DEFINITE * else: raise ValueError("unknown shift type: %s" % st) */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_st, __pyx_n_s_na, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(8, 1071, __pyx_L1_error) if (__pyx_t_1) { __pyx_r = MAT_SHIFT_NONZERO; goto __pyx_L0; } /* "petsc4py/PETSc/petscmat.pxi":1072 * if st == "inblocks": return MAT_SHIFT_INBLOCKS * if st == "na": return MAT_SHIFT_NONZERO * if st == "pd": return MAT_SHIFT_POSITIVE_DEFINITE # <<<<<<<<<<<<<< * else: raise ValueError("unknown shift type: %s" % st) * return st */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_st, __pyx_n_s_pd, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(8, 1072, __pyx_L1_error) if (likely(__pyx_t_1)) { __pyx_r = MAT_SHIFT_POSITIVE_DEFINITE; goto __pyx_L0; } /* "petsc4py/PETSc/petscmat.pxi":1073 * if st == "na": return MAT_SHIFT_NONZERO * if st == "pd": return MAT_SHIFT_POSITIVE_DEFINITE * else: raise ValueError("unknown shift type: %s" % st) # <<<<<<<<<<<<<< * return st * */ /*else*/ { __pyx_t_2 = __Pyx_PyString_FormatSafe(__pyx_kp_s_unknown_shift_type_s, __pyx_v_st); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 1073, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1073, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(8, 1073, __pyx_L1_error) } /* "petsc4py/PETSc/petscmat.pxi":1066 * cdef inline PetscMatFactorShiftType matfactorshifttype(object st) \ * except (-1): * if isinstance(st, str): # <<<<<<<<<<<<<< * if st == "none": return MAT_SHIFT_NONE * if st == "nonzero": return MAT_SHIFT_NONZERO */ } /* "petsc4py/PETSc/petscmat.pxi":1074 * if st == "pd": return MAT_SHIFT_POSITIVE_DEFINITE * else: raise ValueError("unknown shift type: %s" % st) * return st # <<<<<<<<<<<<<< * * cdef PetscErrorCode matfactorinfo(PetscBool inc, PetscBool chol, object opts, */ __pyx_t_4 = ((MatFactorShiftType)__Pyx_PyInt_As_MatFactorShiftType(__pyx_v_st)); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 1074, __pyx_L1_error) __pyx_r = __pyx_t_4; goto __pyx_L0; /* "petsc4py/PETSc/petscmat.pxi":1064 * PetscErrorCode MatFactorInfoDefaults(PetscBool,PetscBool,PetscMatFactorInfo*) * * cdef inline PetscMatFactorShiftType matfactorshifttype(object st) \ # <<<<<<<<<<<<<< * except (-1): * if isinstance(st, str): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.matfactorshifttype", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = ((MatFactorShiftType)-1L); __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscmat.pxi":1076 * return st * * cdef PetscErrorCode matfactorinfo(PetscBool inc, PetscBool chol, object opts, # <<<<<<<<<<<<<< * PetscMatFactorInfo *info) except PETSC_ERR_PYTHON: * CHKERR( MatFactorInfoDefaults(inc,chol,info) ) */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_matfactorinfo(PetscBool __pyx_v_inc, PetscBool __pyx_v_chol, PyObject *__pyx_v_opts, MatFactorInfo *__pyx_v_info) { PyObject *__pyx_v_options = 0; PyObject *__pyx_v_fill = 0; PyObject *__pyx_v_zeropivot = 0; PyObject *__pyx_v_levels = 0; PyObject *__pyx_v_diagonal_fill = 0; PyObject *__pyx_v_dt = 0; PyObject *__pyx_v_dtcol = 0; PyObject *__pyx_v_dtcount = 0; PyObject *__pyx_v_shifttype = 0; PyObject *__pyx_v_shiftamount = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PetscReal __pyx_t_4; PetscInt __pyx_t_5; int __pyx_t_6; MatFactorShiftType __pyx_t_7; PyObject *__pyx_t_8 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("matfactorinfo", 1); /* "petsc4py/PETSc/petscmat.pxi":1078 * cdef PetscErrorCode matfactorinfo(PetscBool inc, PetscBool chol, object opts, * PetscMatFactorInfo *info) except PETSC_ERR_PYTHON: * CHKERR( MatFactorInfoDefaults(inc,chol,info) ) # <<<<<<<<<<<<<< * if opts is None: return PETSC_SUCCESS * cdef dict options = dict(opts) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatFactorInfoDefaults(__pyx_v_inc, __pyx_v_chol, __pyx_v_info)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(8, 1078, __pyx_L1_error) /* "petsc4py/PETSc/petscmat.pxi":1079 * PetscMatFactorInfo *info) except PETSC_ERR_PYTHON: * CHKERR( MatFactorInfoDefaults(inc,chol,info) ) * if opts is None: return PETSC_SUCCESS # <<<<<<<<<<<<<< * cdef dict options = dict(opts) * # */ __pyx_t_2 = (__pyx_v_opts == Py_None); if (__pyx_t_2) { __pyx_r = PETSC_SUCCESS; goto __pyx_L0; } /* "petsc4py/PETSc/petscmat.pxi":1080 * CHKERR( MatFactorInfoDefaults(inc,chol,info) ) * if opts is None: return PETSC_SUCCESS * cdef dict options = dict(opts) # <<<<<<<<<<<<<< * # * cdef fill = options.pop('fill', None) */ __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyDict_Type)), __pyx_v_opts); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1080, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_options = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/petscmat.pxi":1082 * cdef dict options = dict(opts) * # * cdef fill = options.pop('fill', None) # <<<<<<<<<<<<<< * if fill is not None: * info.fill = asReal(fill) */ __pyx_t_3 = __Pyx_PyDict_Pop(__pyx_v_options, __pyx_n_s_fill, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1082, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_fill = __pyx_t_3; __pyx_t_3 = 0; /* "petsc4py/PETSc/petscmat.pxi":1083 * # * cdef fill = options.pop('fill', None) * if fill is not None: # <<<<<<<<<<<<<< * info.fill = asReal(fill) * # */ __pyx_t_2 = (__pyx_v_fill != Py_None); if (__pyx_t_2) { /* "petsc4py/PETSc/petscmat.pxi":1084 * cdef fill = options.pop('fill', None) * if fill is not None: * info.fill = asReal(fill) # <<<<<<<<<<<<<< * # * cdef zeropivot = options.pop('zeropivot', None) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_fill); if (unlikely(__pyx_t_4 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(8, 1084, __pyx_L1_error) __pyx_v_info->fill = __pyx_t_4; /* "petsc4py/PETSc/petscmat.pxi":1083 * # * cdef fill = options.pop('fill', None) * if fill is not None: # <<<<<<<<<<<<<< * info.fill = asReal(fill) * # */ } /* "petsc4py/PETSc/petscmat.pxi":1086 * info.fill = asReal(fill) * # * cdef zeropivot = options.pop('zeropivot', None) # <<<<<<<<<<<<<< * if zeropivot is not None: * info.zeropivot = asReal(zeropivot) */ __pyx_t_3 = __Pyx_PyDict_Pop(__pyx_v_options, __pyx_n_s_zeropivot, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1086, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_zeropivot = __pyx_t_3; __pyx_t_3 = 0; /* "petsc4py/PETSc/petscmat.pxi":1087 * # * cdef zeropivot = options.pop('zeropivot', None) * if zeropivot is not None: # <<<<<<<<<<<<<< * info.zeropivot = asReal(zeropivot) * # */ __pyx_t_2 = (__pyx_v_zeropivot != Py_None); if (__pyx_t_2) { /* "petsc4py/PETSc/petscmat.pxi":1088 * cdef zeropivot = options.pop('zeropivot', None) * if zeropivot is not None: * info.zeropivot = asReal(zeropivot) # <<<<<<<<<<<<<< * # * cdef levels = options.pop('levels', None) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_zeropivot); if (unlikely(__pyx_t_4 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(8, 1088, __pyx_L1_error) __pyx_v_info->zeropivot = __pyx_t_4; /* "petsc4py/PETSc/petscmat.pxi":1087 * # * cdef zeropivot = options.pop('zeropivot', None) * if zeropivot is not None: # <<<<<<<<<<<<<< * info.zeropivot = asReal(zeropivot) * # */ } /* "petsc4py/PETSc/petscmat.pxi":1090 * info.zeropivot = asReal(zeropivot) * # * cdef levels = options.pop('levels', None) # <<<<<<<<<<<<<< * if levels is not None: * info.levels = asInt(levels) */ __pyx_t_3 = __Pyx_PyDict_Pop(__pyx_v_options, __pyx_n_s_levels, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1090, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_levels = __pyx_t_3; __pyx_t_3 = 0; /* "petsc4py/PETSc/petscmat.pxi":1091 * # * cdef levels = options.pop('levels', None) * if levels is not None: # <<<<<<<<<<<<<< * info.levels = asInt(levels) * cdef diagonal_fill = options.pop('diagonal_fill', None) */ __pyx_t_2 = (__pyx_v_levels != Py_None); if (__pyx_t_2) { /* "petsc4py/PETSc/petscmat.pxi":1092 * cdef levels = options.pop('levels', None) * if levels is not None: * info.levels = asInt(levels) # <<<<<<<<<<<<<< * cdef diagonal_fill = options.pop('diagonal_fill', None) * if diagonal_fill is not None: */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_levels); if (unlikely(__pyx_t_5 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(8, 1092, __pyx_L1_error) __pyx_v_info->levels = ((PetscReal)__pyx_t_5); /* "petsc4py/PETSc/petscmat.pxi":1091 * # * cdef levels = options.pop('levels', None) * if levels is not None: # <<<<<<<<<<<<<< * info.levels = asInt(levels) * cdef diagonal_fill = options.pop('diagonal_fill', None) */ } /* "petsc4py/PETSc/petscmat.pxi":1093 * if levels is not None: * info.levels = asInt(levels) * cdef diagonal_fill = options.pop('diagonal_fill', None) # <<<<<<<<<<<<<< * if diagonal_fill is not None: * info.diagonal_fill = (diagonal_fill) */ __pyx_t_3 = __Pyx_PyDict_Pop(__pyx_v_options, __pyx_n_s_diagonal_fill, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1093, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_diagonal_fill = __pyx_t_3; __pyx_t_3 = 0; /* "petsc4py/PETSc/petscmat.pxi":1094 * info.levels = asInt(levels) * cdef diagonal_fill = options.pop('diagonal_fill', None) * if diagonal_fill is not None: # <<<<<<<<<<<<<< * info.diagonal_fill = (diagonal_fill) * # */ __pyx_t_2 = (__pyx_v_diagonal_fill != Py_None); if (__pyx_t_2) { /* "petsc4py/PETSc/petscmat.pxi":1095 * cdef diagonal_fill = options.pop('diagonal_fill', None) * if diagonal_fill is not None: * info.diagonal_fill = (diagonal_fill) # <<<<<<<<<<<<<< * # * cdef dt = options.pop('dt', None) */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_diagonal_fill); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(8, 1095, __pyx_L1_error) __pyx_v_info->diagonal_fill = ((PetscReal)__pyx_t_2); /* "petsc4py/PETSc/petscmat.pxi":1094 * info.levels = asInt(levels) * cdef diagonal_fill = options.pop('diagonal_fill', None) * if diagonal_fill is not None: # <<<<<<<<<<<<<< * info.diagonal_fill = (diagonal_fill) * # */ } /* "petsc4py/PETSc/petscmat.pxi":1097 * info.diagonal_fill = (diagonal_fill) * # * cdef dt = options.pop('dt', None) # <<<<<<<<<<<<<< * if dt is not None: * info.dt = asReal(dt) */ __pyx_t_3 = __Pyx_PyDict_Pop(__pyx_v_options, __pyx_n_s_dt, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1097, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_dt = __pyx_t_3; __pyx_t_3 = 0; /* "petsc4py/PETSc/petscmat.pxi":1098 * # * cdef dt = options.pop('dt', None) * if dt is not None: # <<<<<<<<<<<<<< * info.dt = asReal(dt) * cdef dtcol = options.pop('dtcol', None) */ __pyx_t_2 = (__pyx_v_dt != Py_None); if (__pyx_t_2) { /* "petsc4py/PETSc/petscmat.pxi":1099 * cdef dt = options.pop('dt', None) * if dt is not None: * info.dt = asReal(dt) # <<<<<<<<<<<<<< * cdef dtcol = options.pop('dtcol', None) * if dtcol is not None: */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_dt); if (unlikely(__pyx_t_4 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(8, 1099, __pyx_L1_error) __pyx_v_info->dt = __pyx_t_4; /* "petsc4py/PETSc/petscmat.pxi":1098 * # * cdef dt = options.pop('dt', None) * if dt is not None: # <<<<<<<<<<<<<< * info.dt = asReal(dt) * cdef dtcol = options.pop('dtcol', None) */ } /* "petsc4py/PETSc/petscmat.pxi":1100 * if dt is not None: * info.dt = asReal(dt) * cdef dtcol = options.pop('dtcol', None) # <<<<<<<<<<<<<< * if dtcol is not None: * info.dtcol = asReal(dtcol) */ __pyx_t_3 = __Pyx_PyDict_Pop(__pyx_v_options, __pyx_n_s_dtcol, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_dtcol = __pyx_t_3; __pyx_t_3 = 0; /* "petsc4py/PETSc/petscmat.pxi":1101 * info.dt = asReal(dt) * cdef dtcol = options.pop('dtcol', None) * if dtcol is not None: # <<<<<<<<<<<<<< * info.dtcol = asReal(dtcol) * cdef dtcount = options.pop('dtcount', None) */ __pyx_t_2 = (__pyx_v_dtcol != Py_None); if (__pyx_t_2) { /* "petsc4py/PETSc/petscmat.pxi":1102 * cdef dtcol = options.pop('dtcol', None) * if dtcol is not None: * info.dtcol = asReal(dtcol) # <<<<<<<<<<<<<< * cdef dtcount = options.pop('dtcount', None) * if dtcount is not None: */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_dtcol); if (unlikely(__pyx_t_4 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(8, 1102, __pyx_L1_error) __pyx_v_info->dtcol = __pyx_t_4; /* "petsc4py/PETSc/petscmat.pxi":1101 * info.dt = asReal(dt) * cdef dtcol = options.pop('dtcol', None) * if dtcol is not None: # <<<<<<<<<<<<<< * info.dtcol = asReal(dtcol) * cdef dtcount = options.pop('dtcount', None) */ } /* "petsc4py/PETSc/petscmat.pxi":1103 * if dtcol is not None: * info.dtcol = asReal(dtcol) * cdef dtcount = options.pop('dtcount', None) # <<<<<<<<<<<<<< * if dtcount is not None: * info.dtcount = asInt(dtcount) */ __pyx_t_3 = __Pyx_PyDict_Pop(__pyx_v_options, __pyx_n_s_dtcount, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_dtcount = __pyx_t_3; __pyx_t_3 = 0; /* "petsc4py/PETSc/petscmat.pxi":1104 * info.dtcol = asReal(dtcol) * cdef dtcount = options.pop('dtcount', None) * if dtcount is not None: # <<<<<<<<<<<<<< * info.dtcount = asInt(dtcount) * if ((dt is not None) or */ __pyx_t_2 = (__pyx_v_dtcount != Py_None); if (__pyx_t_2) { /* "petsc4py/PETSc/petscmat.pxi":1105 * cdef dtcount = options.pop('dtcount', None) * if dtcount is not None: * info.dtcount = asInt(dtcount) # <<<<<<<<<<<<<< * if ((dt is not None) or * (dtcol is not None) or */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_dtcount); if (unlikely(__pyx_t_5 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(8, 1105, __pyx_L1_error) __pyx_v_info->dtcount = ((PetscReal)__pyx_t_5); /* "petsc4py/PETSc/petscmat.pxi":1104 * info.dtcol = asReal(dtcol) * cdef dtcount = options.pop('dtcount', None) * if dtcount is not None: # <<<<<<<<<<<<<< * info.dtcount = asInt(dtcount) * if ((dt is not None) or */ } /* "petsc4py/PETSc/petscmat.pxi":1106 * if dtcount is not None: * info.dtcount = asInt(dtcount) * if ((dt is not None) or # <<<<<<<<<<<<<< * (dtcol is not None) or * (dtcount is not None)): */ __pyx_t_6 = (__pyx_v_dt != Py_None); if (!__pyx_t_6) { } else { __pyx_t_2 = __pyx_t_6; goto __pyx_L12_bool_binop_done; } /* "petsc4py/PETSc/petscmat.pxi":1107 * info.dtcount = asInt(dtcount) * if ((dt is not None) or * (dtcol is not None) or # <<<<<<<<<<<<<< * (dtcount is not None)): * info.usedt = PETSC_TRUE */ __pyx_t_6 = (__pyx_v_dtcol != Py_None); if (!__pyx_t_6) { } else { __pyx_t_2 = __pyx_t_6; goto __pyx_L12_bool_binop_done; } /* "petsc4py/PETSc/petscmat.pxi":1108 * if ((dt is not None) or * (dtcol is not None) or * (dtcount is not None)): # <<<<<<<<<<<<<< * info.usedt = PETSC_TRUE * # */ __pyx_t_6 = (__pyx_v_dtcount != Py_None); __pyx_t_2 = __pyx_t_6; __pyx_L12_bool_binop_done:; /* "petsc4py/PETSc/petscmat.pxi":1106 * if dtcount is not None: * info.dtcount = asInt(dtcount) * if ((dt is not None) or # <<<<<<<<<<<<<< * (dtcol is not None) or * (dtcount is not None)): */ if (__pyx_t_2) { /* "petsc4py/PETSc/petscmat.pxi":1109 * (dtcol is not None) or * (dtcount is not None)): * info.usedt = PETSC_TRUE # <<<<<<<<<<<<<< * # * cdef shifttype = options.pop('shifttype', None) */ __pyx_v_info->usedt = ((PetscReal)PETSC_TRUE); /* "petsc4py/PETSc/petscmat.pxi":1106 * if dtcount is not None: * info.dtcount = asInt(dtcount) * if ((dt is not None) or # <<<<<<<<<<<<<< * (dtcol is not None) or * (dtcount is not None)): */ } /* "petsc4py/PETSc/petscmat.pxi":1111 * info.usedt = PETSC_TRUE * # * cdef shifttype = options.pop('shifttype', None) # <<<<<<<<<<<<<< * if shifttype is not None: * info.shifttype = matfactorshifttype(shifttype) */ __pyx_t_3 = __Pyx_PyDict_Pop(__pyx_v_options, __pyx_n_s_shifttype, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_shifttype = __pyx_t_3; __pyx_t_3 = 0; /* "petsc4py/PETSc/petscmat.pxi":1112 * # * cdef shifttype = options.pop('shifttype', None) * if shifttype is not None: # <<<<<<<<<<<<<< * info.shifttype = matfactorshifttype(shifttype) * cdef shiftamount = options.pop('shiftamount', None) */ __pyx_t_2 = (__pyx_v_shifttype != Py_None); if (__pyx_t_2) { /* "petsc4py/PETSc/petscmat.pxi":1113 * cdef shifttype = options.pop('shifttype', None) * if shifttype is not None: * info.shifttype = matfactorshifttype(shifttype) # <<<<<<<<<<<<<< * cdef shiftamount = options.pop('shiftamount', None) * if shiftamount is not None: */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_matfactorshifttype(__pyx_v_shifttype); if (unlikely(__pyx_t_7 == ((MatFactorShiftType)((MatFactorShiftType)-1L)))) __PYX_ERR(8, 1113, __pyx_L1_error) __pyx_v_info->shifttype = ((PetscReal)__pyx_t_7); /* "petsc4py/PETSc/petscmat.pxi":1112 * # * cdef shifttype = options.pop('shifttype', None) * if shifttype is not None: # <<<<<<<<<<<<<< * info.shifttype = matfactorshifttype(shifttype) * cdef shiftamount = options.pop('shiftamount', None) */ } /* "petsc4py/PETSc/petscmat.pxi":1114 * if shifttype is not None: * info.shifttype = matfactorshifttype(shifttype) * cdef shiftamount = options.pop('shiftamount', None) # <<<<<<<<<<<<<< * if shiftamount is not None: * info.shiftamount = asReal(shiftamount) */ __pyx_t_3 = __Pyx_PyDict_Pop(__pyx_v_options, __pyx_n_s_shiftamount, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_shiftamount = __pyx_t_3; __pyx_t_3 = 0; /* "petsc4py/PETSc/petscmat.pxi":1115 * info.shifttype = matfactorshifttype(shifttype) * cdef shiftamount = options.pop('shiftamount', None) * if shiftamount is not None: # <<<<<<<<<<<<<< * info.shiftamount = asReal(shiftamount) * # */ __pyx_t_2 = (__pyx_v_shiftamount != Py_None); if (__pyx_t_2) { /* "petsc4py/PETSc/petscmat.pxi":1116 * cdef shiftamount = options.pop('shiftamount', None) * if shiftamount is not None: * info.shiftamount = asReal(shiftamount) # <<<<<<<<<<<<<< * # * if options: */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_shiftamount); if (unlikely(__pyx_t_4 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(8, 1116, __pyx_L1_error) __pyx_v_info->shiftamount = __pyx_t_4; /* "petsc4py/PETSc/petscmat.pxi":1115 * info.shifttype = matfactorshifttype(shifttype) * cdef shiftamount = options.pop('shiftamount', None) * if shiftamount is not None: # <<<<<<<<<<<<<< * info.shiftamount = asReal(shiftamount) * # */ } /* "petsc4py/PETSc/petscmat.pxi":1118 * info.shiftamount = asReal(shiftamount) * # * if options: # <<<<<<<<<<<<<< * raise ValueError("unknown options: %s" * % list(options.keys())) */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_options); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(8, 1118, __pyx_L1_error) if (unlikely(__pyx_t_2)) { /* "petsc4py/PETSc/petscmat.pxi":1120 * if options: * raise ValueError("unknown options: %s" * % list(options.keys())) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_3 = __Pyx_PyDict_Keys(__pyx_v_options); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = __Pyx_PySequence_ListKeepNew(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 1120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_unknown_options_s, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "petsc4py/PETSc/petscmat.pxi":1119 * # * if options: * raise ValueError("unknown options: %s" # <<<<<<<<<<<<<< * % list(options.keys())) * return PETSC_SUCCESS */ __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 1119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __PYX_ERR(8, 1119, __pyx_L1_error) /* "petsc4py/PETSc/petscmat.pxi":1118 * info.shiftamount = asReal(shiftamount) * # * if options: # <<<<<<<<<<<<<< * raise ValueError("unknown options: %s" * % list(options.keys())) */ } /* "petsc4py/PETSc/petscmat.pxi":1121 * raise ValueError("unknown options: %s" * % list(options.keys())) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * # ----------------------------------------------------------------------------- */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petscmat.pxi":1076 * return st * * cdef PetscErrorCode matfactorinfo(PetscBool inc, PetscBool chol, object opts, # <<<<<<<<<<<<<< * PetscMatFactorInfo *info) except PETSC_ERR_PYTHON: * CHKERR( MatFactorInfoDefaults(inc,chol,info) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("petsc4py.PETSc.matfactorinfo", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_options); __Pyx_XDECREF(__pyx_v_fill); __Pyx_XDECREF(__pyx_v_zeropivot); __Pyx_XDECREF(__pyx_v_levels); __Pyx_XDECREF(__pyx_v_diagonal_fill); __Pyx_XDECREF(__pyx_v_dt); __Pyx_XDECREF(__pyx_v_dtcol); __Pyx_XDECREF(__pyx_v_dtcount); __Pyx_XDECREF(__pyx_v_shifttype); __Pyx_XDECREF(__pyx_v_shiftamount); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscmat.pxi":1125 * # ----------------------------------------------------------------------------- * * cdef object mat_getitem(Mat self, object ij): # <<<<<<<<<<<<<< * cdef PetscInt M=0, N=0 * rows, cols = ij */ static PyObject *__pyx_f_8petsc4py_5PETSc_mat_getitem(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_ij) { PetscInt __pyx_v_M; PetscInt __pyx_v_N; PyObject *__pyx_v_rows = NULL; PyObject *__pyx_v_cols = NULL; PyObject *__pyx_v_start = NULL; PyObject *__pyx_v_stop = NULL; PyObject *__pyx_v_stride = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); int __pyx_t_5; PetscErrorCode __pyx_t_6; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mat_getitem", 1); /* "petsc4py/PETSc/petscmat.pxi":1126 * * cdef object mat_getitem(Mat self, object ij): * cdef PetscInt M=0, N=0 # <<<<<<<<<<<<<< * rows, cols = ij * if isinstance(rows, slice): */ __pyx_v_M = 0; __pyx_v_N = 0; /* "petsc4py/PETSc/petscmat.pxi":1127 * cdef object mat_getitem(Mat self, object ij): * cdef PetscInt M=0, N=0 * rows, cols = ij # <<<<<<<<<<<<<< * if isinstance(rows, slice): * CHKERR( MatGetSize(self.mat, &M, NULL) ) */ if ((likely(PyTuple_CheckExact(__pyx_v_ij))) || (PyList_CheckExact(__pyx_v_ij))) { PyObject* sequence = __pyx_v_ij; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(8, 1127, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 1127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 1127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_ij); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(8, 1127, __pyx_L1_error) __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(8, 1127, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_rows = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_cols = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/petscmat.pxi":1128 * cdef PetscInt M=0, N=0 * rows, cols = ij * if isinstance(rows, slice): # <<<<<<<<<<<<<< * CHKERR( MatGetSize(self.mat, &M, NULL) ) * start, stop, stride = rows.indices(toInt(M)) */ __pyx_t_5 = PySlice_Check(__pyx_v_rows); if (__pyx_t_5) { /* "petsc4py/PETSc/petscmat.pxi":1129 * rows, cols = ij * if isinstance(rows, slice): * CHKERR( MatGetSize(self.mat, &M, NULL) ) # <<<<<<<<<<<<<< * start, stop, stride = rows.indices(toInt(M)) * rows = arange(start, stop, stride) */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetSize(__pyx_v_self->mat, (&__pyx_v_M), NULL)); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(8, 1129, __pyx_L1_error) /* "petsc4py/PETSc/petscmat.pxi":1130 * if isinstance(rows, slice): * CHKERR( MatGetSize(self.mat, &M, NULL) ) * start, stop, stride = rows.indices(toInt(M)) # <<<<<<<<<<<<<< * rows = arange(start, stop, stride) * if isinstance(cols, slice): */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rows, __pyx_n_s_indices); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 1130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_M); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_3}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 1130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { PyObject* sequence = __pyx_t_2; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(8, 1130, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_7 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); __pyx_t_7 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_7); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 1130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 1130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(8, 1130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_9); if (unlikely(!__pyx_t_1)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_3 = __pyx_t_4(__pyx_t_9); if (unlikely(!__pyx_t_3)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 2; __pyx_t_7 = __pyx_t_4(__pyx_t_9); if (unlikely(!__pyx_t_7)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_7); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_9), 3) < 0) __PYX_ERR(8, 1130, __pyx_L1_error) __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L7_unpacking_done; __pyx_L6_unpacking_failed:; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(8, 1130, __pyx_L1_error) __pyx_L7_unpacking_done:; } __pyx_v_start = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_stop = __pyx_t_3; __pyx_t_3 = 0; __pyx_v_stride = __pyx_t_7; __pyx_t_7 = 0; /* "petsc4py/PETSc/petscmat.pxi":1131 * CHKERR( MatGetSize(self.mat, &M, NULL) ) * start, stop, stride = rows.indices(toInt(M)) * rows = arange(start, stop, stride) # <<<<<<<<<<<<<< * if isinstance(cols, slice): * CHKERR( MatGetSize(self.mat, NULL, &N) ) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_arange(__pyx_v_start, __pyx_v_stop, __pyx_v_stride)); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 1131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_rows, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscmat.pxi":1128 * cdef PetscInt M=0, N=0 * rows, cols = ij * if isinstance(rows, slice): # <<<<<<<<<<<<<< * CHKERR( MatGetSize(self.mat, &M, NULL) ) * start, stop, stride = rows.indices(toInt(M)) */ } /* "petsc4py/PETSc/petscmat.pxi":1132 * start, stop, stride = rows.indices(toInt(M)) * rows = arange(start, stop, stride) * if isinstance(cols, slice): # <<<<<<<<<<<<<< * CHKERR( MatGetSize(self.mat, NULL, &N) ) * start, stop, stride = cols.indices(toInt(N)) */ __pyx_t_5 = PySlice_Check(__pyx_v_cols); if (__pyx_t_5) { /* "petsc4py/PETSc/petscmat.pxi":1133 * rows = arange(start, stop, stride) * if isinstance(cols, slice): * CHKERR( MatGetSize(self.mat, NULL, &N) ) # <<<<<<<<<<<<<< * start, stop, stride = cols.indices(toInt(N)) * cols = arange(start, stop, stride) */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetSize(__pyx_v_self->mat, NULL, (&__pyx_v_N))); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(8, 1133, __pyx_L1_error) /* "petsc4py/PETSc/petscmat.pxi":1134 * if isinstance(cols, slice): * CHKERR( MatGetSize(self.mat, NULL, &N) ) * start, stop, stride = cols.indices(toInt(N)) # <<<<<<<<<<<<<< * cols = arange(start, stop, stride) * return matgetvalues(self.mat, rows, cols, None) */ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_cols, __pyx_n_s_indices); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 1134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_N); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_3}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 1134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { PyObject* sequence = __pyx_t_2; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(8, 1134, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_7 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); __pyx_t_1 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_1); #else __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 1134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 1134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(8, 1134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); index = 0; __pyx_t_7 = __pyx_t_4(__pyx_t_9); if (unlikely(!__pyx_t_7)) goto __pyx_L9_unpacking_failed; __Pyx_GOTREF(__pyx_t_7); index = 1; __pyx_t_3 = __pyx_t_4(__pyx_t_9); if (unlikely(!__pyx_t_3)) goto __pyx_L9_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 2; __pyx_t_1 = __pyx_t_4(__pyx_t_9); if (unlikely(!__pyx_t_1)) goto __pyx_L9_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_9), 3) < 0) __PYX_ERR(8, 1134, __pyx_L1_error) __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L10_unpacking_done; __pyx_L9_unpacking_failed:; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(8, 1134, __pyx_L1_error) __pyx_L10_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_start, __pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF_SET(__pyx_v_stop, __pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_stride, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscmat.pxi":1135 * CHKERR( MatGetSize(self.mat, NULL, &N) ) * start, stop, stride = cols.indices(toInt(N)) * cols = arange(start, stop, stride) # <<<<<<<<<<<<<< * return matgetvalues(self.mat, rows, cols, None) * */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_arange(__pyx_v_start, __pyx_v_stop, __pyx_v_stride)); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 1135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_cols, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscmat.pxi":1132 * start, stop, stride = rows.indices(toInt(M)) * rows = arange(start, stop, stride) * if isinstance(cols, slice): # <<<<<<<<<<<<<< * CHKERR( MatGetSize(self.mat, NULL, &N) ) * start, stop, stride = cols.indices(toInt(N)) */ } /* "petsc4py/PETSc/petscmat.pxi":1136 * start, stop, stride = cols.indices(toInt(N)) * cols = arange(start, stop, stride) * return matgetvalues(self.mat, rows, cols, None) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_matgetvalues(__pyx_v_self->mat, __pyx_v_rows, __pyx_v_cols, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 1136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/petscmat.pxi":1125 * # ----------------------------------------------------------------------------- * * cdef object mat_getitem(Mat self, object ij): # <<<<<<<<<<<<<< * cdef PetscInt M=0, N=0 * rows, cols = ij */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("petsc4py.PETSc.mat_getitem", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rows); __Pyx_XDECREF(__pyx_v_cols); __Pyx_XDECREF(__pyx_v_start); __Pyx_XDECREF(__pyx_v_stop); __Pyx_XDECREF(__pyx_v_stride); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscmat.pxi":1139 * * * cdef PetscErrorCode mat_setitem(Mat self, object ij, object v) except PETSC_ERR_PYTHON: # <<<<<<<<<<<<<< * cdef PetscInt M=0, N=0 * rows, cols = ij */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_mat_setitem(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_ij, PyObject *__pyx_v_v) { PetscInt __pyx_v_M; PetscInt __pyx_v_N; PyObject *__pyx_v_rows = NULL; PyObject *__pyx_v_cols = NULL; PyObject *__pyx_v_start = NULL; PyObject *__pyx_v_stop = NULL; PyObject *__pyx_v_stride = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); int __pyx_t_5; PetscErrorCode __pyx_t_6; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mat_setitem", 1); /* "petsc4py/PETSc/petscmat.pxi":1140 * * cdef PetscErrorCode mat_setitem(Mat self, object ij, object v) except PETSC_ERR_PYTHON: * cdef PetscInt M=0, N=0 # <<<<<<<<<<<<<< * rows, cols = ij * if isinstance(rows, slice): */ __pyx_v_M = 0; __pyx_v_N = 0; /* "petsc4py/PETSc/petscmat.pxi":1141 * cdef PetscErrorCode mat_setitem(Mat self, object ij, object v) except PETSC_ERR_PYTHON: * cdef PetscInt M=0, N=0 * rows, cols = ij # <<<<<<<<<<<<<< * if isinstance(rows, slice): * CHKERR( MatGetSize(self.mat, &M, NULL) ) */ if ((likely(PyTuple_CheckExact(__pyx_v_ij))) || (PyList_CheckExact(__pyx_v_ij))) { PyObject* sequence = __pyx_v_ij; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(8, 1141, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 1141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 1141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_ij); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(8, 1141, __pyx_L1_error) __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(8, 1141, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_rows = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_cols = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/petscmat.pxi":1142 * cdef PetscInt M=0, N=0 * rows, cols = ij * if isinstance(rows, slice): # <<<<<<<<<<<<<< * CHKERR( MatGetSize(self.mat, &M, NULL) ) * start, stop, stride = rows.indices(toInt(M)) */ __pyx_t_5 = PySlice_Check(__pyx_v_rows); if (__pyx_t_5) { /* "petsc4py/PETSc/petscmat.pxi":1143 * rows, cols = ij * if isinstance(rows, slice): * CHKERR( MatGetSize(self.mat, &M, NULL) ) # <<<<<<<<<<<<<< * start, stop, stride = rows.indices(toInt(M)) * rows = arange(start, stop, stride) */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetSize(__pyx_v_self->mat, (&__pyx_v_M), NULL)); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(8, 1143, __pyx_L1_error) /* "petsc4py/PETSc/petscmat.pxi":1144 * if isinstance(rows, slice): * CHKERR( MatGetSize(self.mat, &M, NULL) ) * start, stop, stride = rows.indices(toInt(M)) # <<<<<<<<<<<<<< * rows = arange(start, stop, stride) * if isinstance(cols, slice): */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rows, __pyx_n_s_indices); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 1144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_M); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_3}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 1144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { PyObject* sequence = __pyx_t_2; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(8, 1144, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_7 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); __pyx_t_7 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_7); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 1144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 1144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(8, 1144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_9); if (unlikely(!__pyx_t_1)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_3 = __pyx_t_4(__pyx_t_9); if (unlikely(!__pyx_t_3)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 2; __pyx_t_7 = __pyx_t_4(__pyx_t_9); if (unlikely(!__pyx_t_7)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_7); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_9), 3) < 0) __PYX_ERR(8, 1144, __pyx_L1_error) __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L7_unpacking_done; __pyx_L6_unpacking_failed:; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(8, 1144, __pyx_L1_error) __pyx_L7_unpacking_done:; } __pyx_v_start = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_stop = __pyx_t_3; __pyx_t_3 = 0; __pyx_v_stride = __pyx_t_7; __pyx_t_7 = 0; /* "petsc4py/PETSc/petscmat.pxi":1145 * CHKERR( MatGetSize(self.mat, &M, NULL) ) * start, stop, stride = rows.indices(toInt(M)) * rows = arange(start, stop, stride) # <<<<<<<<<<<<<< * if isinstance(cols, slice): * CHKERR( MatGetSize(self.mat, NULL, &N) ) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_arange(__pyx_v_start, __pyx_v_stop, __pyx_v_stride)); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 1145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_rows, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscmat.pxi":1142 * cdef PetscInt M=0, N=0 * rows, cols = ij * if isinstance(rows, slice): # <<<<<<<<<<<<<< * CHKERR( MatGetSize(self.mat, &M, NULL) ) * start, stop, stride = rows.indices(toInt(M)) */ } /* "petsc4py/PETSc/petscmat.pxi":1146 * start, stop, stride = rows.indices(toInt(M)) * rows = arange(start, stop, stride) * if isinstance(cols, slice): # <<<<<<<<<<<<<< * CHKERR( MatGetSize(self.mat, NULL, &N) ) * start, stop, stride = cols.indices(toInt(N)) */ __pyx_t_5 = PySlice_Check(__pyx_v_cols); if (__pyx_t_5) { /* "petsc4py/PETSc/petscmat.pxi":1147 * rows = arange(start, stop, stride) * if isinstance(cols, slice): * CHKERR( MatGetSize(self.mat, NULL, &N) ) # <<<<<<<<<<<<<< * start, stop, stride = cols.indices(toInt(N)) * cols = arange(start, stop, stride) */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetSize(__pyx_v_self->mat, NULL, (&__pyx_v_N))); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(8, 1147, __pyx_L1_error) /* "petsc4py/PETSc/petscmat.pxi":1148 * if isinstance(cols, slice): * CHKERR( MatGetSize(self.mat, NULL, &N) ) * start, stop, stride = cols.indices(toInt(N)) # <<<<<<<<<<<<<< * cols = arange(start, stop, stride) * matsetvalues(self.mat, rows, cols, v, None, 0, 0) */ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_cols, __pyx_n_s_indices); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 1148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_N); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_3}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 1148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { PyObject* sequence = __pyx_t_2; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(8, 1148, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_7 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); __pyx_t_1 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_1); #else __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 1148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 1148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(8, 1148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); index = 0; __pyx_t_7 = __pyx_t_4(__pyx_t_9); if (unlikely(!__pyx_t_7)) goto __pyx_L9_unpacking_failed; __Pyx_GOTREF(__pyx_t_7); index = 1; __pyx_t_3 = __pyx_t_4(__pyx_t_9); if (unlikely(!__pyx_t_3)) goto __pyx_L9_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 2; __pyx_t_1 = __pyx_t_4(__pyx_t_9); if (unlikely(!__pyx_t_1)) goto __pyx_L9_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_9), 3) < 0) __PYX_ERR(8, 1148, __pyx_L1_error) __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L10_unpacking_done; __pyx_L9_unpacking_failed:; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(8, 1148, __pyx_L1_error) __pyx_L10_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_start, __pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF_SET(__pyx_v_stop, __pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_stride, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscmat.pxi":1149 * CHKERR( MatGetSize(self.mat, NULL, &N) ) * start, stop, stride = cols.indices(toInt(N)) * cols = arange(start, stop, stride) # <<<<<<<<<<<<<< * matsetvalues(self.mat, rows, cols, v, None, 0, 0) * return PETSC_SUCCESS */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_arange(__pyx_v_start, __pyx_v_stop, __pyx_v_stride)); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 1149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_cols, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscmat.pxi":1146 * start, stop, stride = rows.indices(toInt(M)) * rows = arange(start, stop, stride) * if isinstance(cols, slice): # <<<<<<<<<<<<<< * CHKERR( MatGetSize(self.mat, NULL, &N) ) * start, stop, stride = cols.indices(toInt(N)) */ } /* "petsc4py/PETSc/petscmat.pxi":1150 * start, stop, stride = cols.indices(toInt(N)) * cols = arange(start, stop, stride) * matsetvalues(self.mat, rows, cols, v, None, 0, 0) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_matsetvalues(__pyx_v_self->mat, __pyx_v_rows, __pyx_v_cols, __pyx_v_v, Py_None, 0, 0); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(8, 1150, __pyx_L1_error) /* "petsc4py/PETSc/petscmat.pxi":1151 * cols = arange(start, stop, stride) * matsetvalues(self.mat, rows, cols, v, None, 0, 0) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * # ----------------------------------------------------------------------------- */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petscmat.pxi":1139 * * * cdef PetscErrorCode mat_setitem(Mat self, object ij, object v) except PETSC_ERR_PYTHON: # <<<<<<<<<<<<<< * cdef PetscInt M=0, N=0 * rows, cols = ij */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("petsc4py.PETSc.mat_setitem", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rows); __Pyx_XDECREF(__pyx_v_cols); __Pyx_XDECREF(__pyx_v_start); __Pyx_XDECREF(__pyx_v_stop); __Pyx_XDECREF(__pyx_v_stride); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscmat.pxi":1155 * # ----------------------------------------------------------------------------- * * cdef matsetvaluestencil(PetscMat A, # <<<<<<<<<<<<<< * MatStencil r, MatStencil c, object value, * PetscInsertMode im, int blocked): */ static PyObject *__pyx_f_8petsc4py_5PETSc_matsetvaluestencil(Mat __pyx_v_A, struct __pyx_obj_8petsc4py_5PETSc_MatStencil *__pyx_v_r, struct __pyx_obj_8petsc4py_5PETSc_MatStencil *__pyx_v_c, PyObject *__pyx_v_value, InsertMode __pyx_v_im, int __pyx_v_blocked) { PetscInt __pyx_v_rbs; PetscInt __pyx_v_cbs; PetscInt __pyx_v_nv; PetscScalar *__pyx_v_v; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("matsetvaluestencil", 0); __Pyx_INCREF(__pyx_v_value); /* "petsc4py/PETSc/petscmat.pxi":1159 * PetscInsertMode im, int blocked): * # block size * cdef PetscInt rbs=1, cbs=1 # <<<<<<<<<<<<<< * if blocked: CHKERR( MatGetBlockSizes(A, &rbs, &cbs) ) * if rbs < 1: rbs = 1 */ __pyx_v_rbs = 1; __pyx_v_cbs = 1; /* "petsc4py/PETSc/petscmat.pxi":1160 * # block size * cdef PetscInt rbs=1, cbs=1 * if blocked: CHKERR( MatGetBlockSizes(A, &rbs, &cbs) ) # <<<<<<<<<<<<<< * if rbs < 1: rbs = 1 * if cbs < 1: cbs = 1 */ __pyx_t_1 = (__pyx_v_blocked != 0); if (__pyx_t_1) { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetBlockSizes(__pyx_v_A, (&__pyx_v_rbs), (&__pyx_v_cbs))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(8, 1160, __pyx_L1_error) } /* "petsc4py/PETSc/petscmat.pxi":1161 * cdef PetscInt rbs=1, cbs=1 * if blocked: CHKERR( MatGetBlockSizes(A, &rbs, &cbs) ) * if rbs < 1: rbs = 1 # <<<<<<<<<<<<<< * if cbs < 1: cbs = 1 * # values */ __pyx_t_1 = (__pyx_v_rbs < 1); if (__pyx_t_1) { __pyx_v_rbs = 1; } /* "petsc4py/PETSc/petscmat.pxi":1162 * if blocked: CHKERR( MatGetBlockSizes(A, &rbs, &cbs) ) * if rbs < 1: rbs = 1 * if cbs < 1: cbs = 1 # <<<<<<<<<<<<<< * # values * cdef PetscInt nv = 1 */ __pyx_t_1 = (__pyx_v_cbs < 1); if (__pyx_t_1) { __pyx_v_cbs = 1; } /* "petsc4py/PETSc/petscmat.pxi":1164 * if cbs < 1: cbs = 1 * # values * cdef PetscInt nv = 1 # <<<<<<<<<<<<<< * cdef PetscScalar *v = NULL * value = iarray_s(value, &nv, &v) */ __pyx_v_nv = 1; /* "petsc4py/PETSc/petscmat.pxi":1165 * # values * cdef PetscInt nv = 1 * cdef PetscScalar *v = NULL # <<<<<<<<<<<<<< * value = iarray_s(value, &nv, &v) * if rbs*cbs != nv: raise ValueError( */ __pyx_v_v = NULL; /* "petsc4py/PETSc/petscmat.pxi":1166 * cdef PetscInt nv = 1 * cdef PetscScalar *v = NULL * value = iarray_s(value, &nv, &v) # <<<<<<<<<<<<<< * if rbs*cbs != nv: raise ValueError( * "incompatible array sizes: nv=%d" % toInt(nv) ) */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_s(__pyx_v_value, (&__pyx_v_nv), (&__pyx_v_v))); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1166, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/petscmat.pxi":1167 * cdef PetscScalar *v = NULL * value = iarray_s(value, &nv, &v) * if rbs*cbs != nv: raise ValueError( # <<<<<<<<<<<<<< * "incompatible array sizes: nv=%d" % toInt(nv) ) * if blocked: */ __pyx_t_1 = ((__pyx_v_rbs * __pyx_v_cbs) != __pyx_v_nv); if (unlikely(__pyx_t_1)) { /* "petsc4py/PETSc/petscmat.pxi":1168 * value = iarray_s(value, &nv, &v) * if rbs*cbs != nv: raise ValueError( * "incompatible array sizes: nv=%d" % toInt(nv) ) # <<<<<<<<<<<<<< * if blocked: * CHKERR( MatSetValuesBlockedStencil(A, */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nv); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyString_FormatSafe(__pyx_kp_s_incompatible_array_sizes_nv_d, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 1168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/petscmat.pxi":1167 * cdef PetscScalar *v = NULL * value = iarray_s(value, &nv, &v) * if rbs*cbs != nv: raise ValueError( # <<<<<<<<<<<<<< * "incompatible array sizes: nv=%d" % toInt(nv) ) * if blocked: */ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(8, 1167, __pyx_L1_error) } /* "petsc4py/PETSc/petscmat.pxi":1169 * if rbs*cbs != nv: raise ValueError( * "incompatible array sizes: nv=%d" % toInt(nv) ) * if blocked: # <<<<<<<<<<<<<< * CHKERR( MatSetValuesBlockedStencil(A, * 1, &r.stencil, */ __pyx_t_1 = (__pyx_v_blocked != 0); if (__pyx_t_1) { /* "petsc4py/PETSc/petscmat.pxi":1170 * "incompatible array sizes: nv=%d" % toInt(nv) ) * if blocked: * CHKERR( MatSetValuesBlockedStencil(A, # <<<<<<<<<<<<<< * 1, &r.stencil, * 1, &c.stencil, */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSetValuesBlockedStencil(__pyx_v_A, 1, (&__pyx_v_r->stencil), 1, (&__pyx_v_c->stencil), __pyx_v_v, __pyx_v_im)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(8, 1170, __pyx_L1_error) /* "petsc4py/PETSc/petscmat.pxi":1169 * if rbs*cbs != nv: raise ValueError( * "incompatible array sizes: nv=%d" % toInt(nv) ) * if blocked: # <<<<<<<<<<<<<< * CHKERR( MatSetValuesBlockedStencil(A, * 1, &r.stencil, */ goto __pyx_L7; } /* "petsc4py/PETSc/petscmat.pxi":1175 * v, im) ) * else: * CHKERR( MatSetValuesStencil(A, # <<<<<<<<<<<<<< * 1, &r.stencil, * 1, &c.stencil, */ /*else*/ { /* "petsc4py/PETSc/petscmat.pxi":1178 * 1, &r.stencil, * 1, &c.stencil, * v, im) ) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSetValuesStencil(__pyx_v_A, 1, (&__pyx_v_r->stencil), 1, (&__pyx_v_c->stencil), __pyx_v_v, __pyx_v_im)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(8, 1175, __pyx_L1_error) } __pyx_L7:; /* "petsc4py/PETSc/petscmat.pxi":1179 * 1, &c.stencil, * v, im) ) * return 0 # <<<<<<<<<<<<<< * * cdef mat_get_dlpack_ctx(Mat self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_int_0); __pyx_r = __pyx_int_0; goto __pyx_L0; /* "petsc4py/PETSc/petscmat.pxi":1155 * # ----------------------------------------------------------------------------- * * cdef matsetvaluestencil(PetscMat A, # <<<<<<<<<<<<<< * MatStencil r, MatStencil c, object value, * PetscInsertMode im, int blocked): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.matsetvaluestencil", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_value); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscmat.pxi":1181 * return 0 * * cdef mat_get_dlpack_ctx(Mat self): # <<<<<<<<<<<<<< * if 'dense' not in self.getType(): * raise NotImplementedError("Not for type {}".format(self.getType())) */ static PyObject *__pyx_f_8petsc4py_5PETSc_mat_get_dlpack_ctx(struct PyPetscMatObject *__pyx_v_self) { PyObject *__pyx_v_ctx0 = 0; PetscInt __pyx_v_n; PetscInt __pyx_v_m; PetscInt __pyx_v_lda; int64_t __pyx_v_ndim; int64_t *__pyx_v_shape_arr; int64_t *__pyx_v_strides_arr; PyObject *__pyx_v_s1 = 0; PyObject *__pyx_v_s2 = 0; PetscInt __pyx_v_devId; PetscMemType __pyx_v_mtype; CYTHON_UNUSED PyObject *__pyx_v__ = NULL; PyObject *__pyx_v_devType_ = NULL; PyObject *__pyx_v_dtype = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PetscErrorCode __pyx_t_8; PyObject *__pyx_t_9 = NULL; PyObject *(*__pyx_t_10)(PyObject *); int64_t __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mat_get_dlpack_ctx", 1); /* "petsc4py/PETSc/petscmat.pxi":1182 * * cdef mat_get_dlpack_ctx(Mat self): * if 'dense' not in self.getType(): # <<<<<<<<<<<<<< * raise NotImplementedError("Not for type {}".format(self.getType())) * cdef object ctx0 = self.get_attr('__dltensor_ctx__') */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getType); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 1182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 1182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_dense, __pyx_t_1, Py_NE)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(8, 1182, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_t_5)) { /* "petsc4py/PETSc/petscmat.pxi":1183 * cdef mat_get_dlpack_ctx(Mat self): * if 'dense' not in self.getType(): * raise NotImplementedError("Not for type {}".format(self.getType())) # <<<<<<<<<<<<<< * cdef object ctx0 = self.get_attr('__dltensor_ctx__') * cdef PetscInt n = 0, m = 0, lda = 0 */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Not_for_type, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 1183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getType); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 1183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_t_6 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 1183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_NotImplementedError, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 1183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(8, 1183, __pyx_L1_error) /* "petsc4py/PETSc/petscmat.pxi":1182 * * cdef mat_get_dlpack_ctx(Mat self): * if 'dense' not in self.getType(): # <<<<<<<<<<<<<< * raise NotImplementedError("Not for type {}".format(self.getType())) * cdef object ctx0 = self.get_attr('__dltensor_ctx__') */ } /* "petsc4py/PETSc/petscmat.pxi":1184 * if 'dense' not in self.getType(): * raise NotImplementedError("Not for type {}".format(self.getType())) * cdef object ctx0 = self.get_attr('__dltensor_ctx__') # <<<<<<<<<<<<<< * cdef PetscInt n = 0, m = 0, lda = 0 * cdef int64_t ndim = 2 */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Mat *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__dltensor_ctx__")); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 1184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_ctx0 = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/petscmat.pxi":1185 * raise NotImplementedError("Not for type {}".format(self.getType())) * cdef object ctx0 = self.get_attr('__dltensor_ctx__') * cdef PetscInt n = 0, m = 0, lda = 0 # <<<<<<<<<<<<<< * cdef int64_t ndim = 2 * cdef int64_t* shape_arr = NULL */ __pyx_v_n = 0; __pyx_v_m = 0; __pyx_v_lda = 0; /* "petsc4py/PETSc/petscmat.pxi":1186 * cdef object ctx0 = self.get_attr('__dltensor_ctx__') * cdef PetscInt n = 0, m = 0, lda = 0 * cdef int64_t ndim = 2 # <<<<<<<<<<<<<< * cdef int64_t* shape_arr = NULL * cdef int64_t* strides_arr = NULL */ __pyx_v_ndim = 2; /* "petsc4py/PETSc/petscmat.pxi":1187 * cdef PetscInt n = 0, m = 0, lda = 0 * cdef int64_t ndim = 2 * cdef int64_t* shape_arr = NULL # <<<<<<<<<<<<<< * cdef int64_t* strides_arr = NULL * cdef object s1 = None */ __pyx_v_shape_arr = NULL; /* "petsc4py/PETSc/petscmat.pxi":1188 * cdef int64_t ndim = 2 * cdef int64_t* shape_arr = NULL * cdef int64_t* strides_arr = NULL # <<<<<<<<<<<<<< * cdef object s1 = None * cdef object s2 = None */ __pyx_v_strides_arr = NULL; /* "petsc4py/PETSc/petscmat.pxi":1189 * cdef int64_t* shape_arr = NULL * cdef int64_t* strides_arr = NULL * cdef object s1 = None # <<<<<<<<<<<<<< * cdef object s2 = None * cdef PetscInt devId = 0 */ __Pyx_INCREF(Py_None); __pyx_v_s1 = Py_None; /* "petsc4py/PETSc/petscmat.pxi":1190 * cdef int64_t* strides_arr = NULL * cdef object s1 = None * cdef object s2 = None # <<<<<<<<<<<<<< * cdef PetscInt devId = 0 * cdef PetscMemType mtype = PETSC_MEMTYPE_HOST */ __Pyx_INCREF(Py_None); __pyx_v_s2 = Py_None; /* "petsc4py/PETSc/petscmat.pxi":1191 * cdef object s1 = None * cdef object s2 = None * cdef PetscInt devId = 0 # <<<<<<<<<<<<<< * cdef PetscMemType mtype = PETSC_MEMTYPE_HOST * if ctx0 is None: # First time in, create a linear memory view */ __pyx_v_devId = 0; /* "petsc4py/PETSc/petscmat.pxi":1192 * cdef object s2 = None * cdef PetscInt devId = 0 * cdef PetscMemType mtype = PETSC_MEMTYPE_HOST # <<<<<<<<<<<<<< * if ctx0 is None: # First time in, create a linear memory view * s1 = oarray_p(empty_p(ndim), NULL, &shape_arr) */ __pyx_v_mtype = PETSC_MEMTYPE_HOST; /* "petsc4py/PETSc/petscmat.pxi":1193 * cdef PetscInt devId = 0 * cdef PetscMemType mtype = PETSC_MEMTYPE_HOST * if ctx0 is None: # First time in, create a linear memory view # <<<<<<<<<<<<<< * s1 = oarray_p(empty_p(ndim), NULL, &shape_arr) * s2 = oarray_p(empty_p(ndim), NULL, &strides_arr) */ __pyx_t_5 = (__pyx_v_ctx0 == Py_None); if (__pyx_t_5) { /* "petsc4py/PETSc/petscmat.pxi":1194 * cdef PetscMemType mtype = PETSC_MEMTYPE_HOST * if ctx0 is None: # First time in, create a linear memory view * s1 = oarray_p(empty_p(ndim), NULL, &shape_arr) # <<<<<<<<<<<<<< * s2 = oarray_p(empty_p(ndim), NULL, &strides_arr) * CHKERR( MatGetSize(self.mat, NULL, &n) ) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 1194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_2, NULL, ((void **)(&__pyx_v_shape_arr)))); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 1194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_s1, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscmat.pxi":1195 * if ctx0 is None: # First time in, create a linear memory view * s1 = oarray_p(empty_p(ndim), NULL, &shape_arr) * s2 = oarray_p(empty_p(ndim), NULL, &strides_arr) # <<<<<<<<<<<<<< * CHKERR( MatGetSize(self.mat, NULL, &n) ) * CHKERR( MatGetLocalSize(self.mat, &m, NULL) ) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 1195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_1, NULL, ((void **)(&__pyx_v_strides_arr)))); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 1195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_s2, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscmat.pxi":1196 * s1 = oarray_p(empty_p(ndim), NULL, &shape_arr) * s2 = oarray_p(empty_p(ndim), NULL, &strides_arr) * CHKERR( MatGetSize(self.mat, NULL, &n) ) # <<<<<<<<<<<<<< * CHKERR( MatGetLocalSize(self.mat, &m, NULL) ) * CHKERR( MatDenseGetLDA(self.mat, &lda) ) */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetSize(__pyx_v_self->mat, NULL, (&__pyx_v_n))); if (unlikely(__pyx_t_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(8, 1196, __pyx_L1_error) /* "petsc4py/PETSc/petscmat.pxi":1197 * s2 = oarray_p(empty_p(ndim), NULL, &strides_arr) * CHKERR( MatGetSize(self.mat, NULL, &n) ) * CHKERR( MatGetLocalSize(self.mat, &m, NULL) ) # <<<<<<<<<<<<<< * CHKERR( MatDenseGetLDA(self.mat, &lda) ) * shape_arr[0] = m */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetLocalSize(__pyx_v_self->mat, (&__pyx_v_m), NULL)); if (unlikely(__pyx_t_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(8, 1197, __pyx_L1_error) /* "petsc4py/PETSc/petscmat.pxi":1198 * CHKERR( MatGetSize(self.mat, NULL, &n) ) * CHKERR( MatGetLocalSize(self.mat, &m, NULL) ) * CHKERR( MatDenseGetLDA(self.mat, &lda) ) # <<<<<<<<<<<<<< * shape_arr[0] = m * shape_arr[1] = n */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDenseGetLDA(__pyx_v_self->mat, (&__pyx_v_lda))); if (unlikely(__pyx_t_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(8, 1198, __pyx_L1_error) /* "petsc4py/PETSc/petscmat.pxi":1199 * CHKERR( MatGetLocalSize(self.mat, &m, NULL) ) * CHKERR( MatDenseGetLDA(self.mat, &lda) ) * shape_arr[0] = m # <<<<<<<<<<<<<< * shape_arr[1] = n * strides_arr[0] = 1 */ (__pyx_v_shape_arr[0]) = ((int64_t)__pyx_v_m); /* "petsc4py/PETSc/petscmat.pxi":1200 * CHKERR( MatDenseGetLDA(self.mat, &lda) ) * shape_arr[0] = m * shape_arr[1] = n # <<<<<<<<<<<<<< * strides_arr[0] = 1 * strides_arr[1] = lda */ (__pyx_v_shape_arr[1]) = ((int64_t)__pyx_v_n); /* "petsc4py/PETSc/petscmat.pxi":1201 * shape_arr[0] = m * shape_arr[1] = n * strides_arr[0] = 1 # <<<<<<<<<<<<<< * strides_arr[1] = lda * else: */ (__pyx_v_strides_arr[0]) = 1; /* "petsc4py/PETSc/petscmat.pxi":1202 * shape_arr[1] = n * strides_arr[0] = 1 * strides_arr[1] = lda # <<<<<<<<<<<<<< * else: * (_, _, ndim, s1, s2) = ctx0 */ (__pyx_v_strides_arr[1]) = ((int64_t)__pyx_v_lda); /* "petsc4py/PETSc/petscmat.pxi":1193 * cdef PetscInt devId = 0 * cdef PetscMemType mtype = PETSC_MEMTYPE_HOST * if ctx0 is None: # First time in, create a linear memory view # <<<<<<<<<<<<<< * s1 = oarray_p(empty_p(ndim), NULL, &shape_arr) * s2 = oarray_p(empty_p(ndim), NULL, &strides_arr) */ goto __pyx_L4; } /* "petsc4py/PETSc/petscmat.pxi":1204 * strides_arr[1] = lda * else: * (_, _, ndim, s1, s2) = ctx0 # <<<<<<<<<<<<<< * * devType_ = { PETSC_MEMTYPE_HOST : kDLCPU, PETSC_MEMTYPE_CUDA : kDLCUDA } */ /*else*/ { if ((likely(PyTuple_CheckExact(__pyx_v_ctx0))) || (PyList_CheckExact(__pyx_v_ctx0))) { PyObject* sequence = __pyx_v_ctx0; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 5)) { if (size > 5) __Pyx_RaiseTooManyValuesError(5); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(8, 1204, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 3); __pyx_t_7 = PyTuple_GET_ITEM(sequence, 4); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_1 = PyList_GET_ITEM(sequence, 1); __pyx_t_3 = PyList_GET_ITEM(sequence, 2); __pyx_t_6 = PyList_GET_ITEM(sequence, 3); __pyx_t_7 = PyList_GET_ITEM(sequence, 4); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); #else { Py_ssize_t i; PyObject** temps[5] = {&__pyx_t_2,&__pyx_t_1,&__pyx_t_3,&__pyx_t_6,&__pyx_t_7}; for (i=0; i < 5; i++) { PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(8, 1204, __pyx_L1_error) __Pyx_GOTREF(item); *(temps[i]) = item; } } #endif } else { Py_ssize_t index = -1; PyObject** temps[5] = {&__pyx_t_2,&__pyx_t_1,&__pyx_t_3,&__pyx_t_6,&__pyx_t_7}; __pyx_t_9 = PyObject_GetIter(__pyx_v_ctx0); if (unlikely(!__pyx_t_9)) __PYX_ERR(8, 1204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); for (index=0; index < 5; index++) { PyObject* item = __pyx_t_10(__pyx_t_9); if (unlikely(!item)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(item); *(temps[index]) = item; } if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 5) < 0) __PYX_ERR(8, 1204, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(8, 1204, __pyx_L1_error) __pyx_L6_unpacking_done:; } __pyx_t_11 = __Pyx_PyInt_As_int64_t(__pyx_t_3); if (unlikely((__pyx_t_11 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(8, 1204, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v__ = __pyx_t_2; __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v__, __pyx_t_1); __pyx_t_1 = 0; __pyx_v_ndim = __pyx_t_11; __Pyx_DECREF_SET(__pyx_v_s1, __pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF_SET(__pyx_v_s2, __pyx_t_7); __pyx_t_7 = 0; } __pyx_L4:; /* "petsc4py/PETSc/petscmat.pxi":1206 * (_, _, ndim, s1, s2) = ctx0 * * devType_ = { PETSC_MEMTYPE_HOST : kDLCPU, PETSC_MEMTYPE_CUDA : kDLCUDA } # <<<<<<<<<<<<<< * CHKERR( MatGetCurrentMemType(self.mat, &mtype) ) * dtype = devType_.get(mtype, kDLCPU) */ __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 1206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = __Pyx_PyInt_From_PetscMemType(PETSC_MEMTYPE_HOST); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 1206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = __Pyx_PyInt_From_enum____pyx_t_8petsc4py_5PETSc_PetscDLDeviceType(__pyx_e_8petsc4py_5PETSc_kDLCPU); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_7, __pyx_t_6, __pyx_t_3) < 0) __PYX_ERR(8, 1206, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_PetscMemType(PETSC_MEMTYPE_CUDA); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyInt_From_enum____pyx_t_8petsc4py_5PETSc_PetscDLDeviceType(__pyx_e_8petsc4py_5PETSc_kDLCUDA); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 1206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_7, __pyx_t_3, __pyx_t_6) < 0) __PYX_ERR(8, 1206, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_devType_ = ((PyObject*)__pyx_t_7); __pyx_t_7 = 0; /* "petsc4py/PETSc/petscmat.pxi":1207 * * devType_ = { PETSC_MEMTYPE_HOST : kDLCPU, PETSC_MEMTYPE_CUDA : kDLCUDA } * CHKERR( MatGetCurrentMemType(self.mat, &mtype) ) # <<<<<<<<<<<<<< * dtype = devType_.get(mtype, kDLCPU) * if dtype != kDLCPU: */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetCurrentMemType(__pyx_v_self->mat, (&__pyx_v_mtype))); if (unlikely(__pyx_t_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(8, 1207, __pyx_L1_error) /* "petsc4py/PETSc/petscmat.pxi":1208 * devType_ = { PETSC_MEMTYPE_HOST : kDLCPU, PETSC_MEMTYPE_CUDA : kDLCUDA } * CHKERR( MatGetCurrentMemType(self.mat, &mtype) ) * dtype = devType_.get(mtype, kDLCPU) # <<<<<<<<<<<<<< * if dtype != kDLCPU: * CHKERR( PetscObjectGetDeviceId(self.mat, &devId) ) */ __pyx_t_7 = __Pyx_PyInt_From_PetscMemType(__pyx_v_mtype); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 1208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = __Pyx_PyInt_From_enum____pyx_t_8petsc4py_5PETSc_PetscDLDeviceType(__pyx_e_8petsc4py_5PETSc_kDLCPU); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 1208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = __Pyx_PyDict_GetItemDefault(__pyx_v_devType_, __pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_dtype = __pyx_t_3; __pyx_t_3 = 0; /* "petsc4py/PETSc/petscmat.pxi":1209 * CHKERR( MatGetCurrentMemType(self.mat, &mtype) ) * dtype = devType_.get(mtype, kDLCPU) * if dtype != kDLCPU: # <<<<<<<<<<<<<< * CHKERR( PetscObjectGetDeviceId(self.mat, &devId) ) * ctx0 = (dtype, devId, ndim, s1, s2) */ __pyx_t_3 = __Pyx_PyInt_From_enum____pyx_t_8petsc4py_5PETSc_PetscDLDeviceType(__pyx_e_8petsc4py_5PETSc_kDLCPU); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = PyObject_RichCompare(__pyx_v_dtype, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 1209, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(8, 1209, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_5) { /* "petsc4py/PETSc/petscmat.pxi":1210 * dtype = devType_.get(mtype, kDLCPU) * if dtype != kDLCPU: * CHKERR( PetscObjectGetDeviceId(self.mat, &devId) ) # <<<<<<<<<<<<<< * ctx0 = (dtype, devId, ndim, s1, s2) * self.set_attr('__dltensor_ctx__', ctx0) */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectGetDeviceId(((PetscObject)__pyx_v_self->mat), (&__pyx_v_devId))); if (unlikely(__pyx_t_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(8, 1210, __pyx_L1_error) /* "petsc4py/PETSc/petscmat.pxi":1209 * CHKERR( MatGetCurrentMemType(self.mat, &mtype) ) * dtype = devType_.get(mtype, kDLCPU) * if dtype != kDLCPU: # <<<<<<<<<<<<<< * CHKERR( PetscObjectGetDeviceId(self.mat, &devId) ) * ctx0 = (dtype, devId, ndim, s1, s2) */ } /* "petsc4py/PETSc/petscmat.pxi":1211 * if dtype != kDLCPU: * CHKERR( PetscObjectGetDeviceId(self.mat, &devId) ) * ctx0 = (dtype, devId, ndim, s1, s2) # <<<<<<<<<<<<<< * self.set_attr('__dltensor_ctx__', ctx0) * return ctx0 */ __pyx_t_6 = __Pyx_PyInt_From_PetscInt(__pyx_v_devId); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 1211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = PyTuple_New(5); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 1211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_v_dtype); __Pyx_GIVEREF(__pyx_v_dtype); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_dtype)) __PYX_ERR(8, 1211, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6)) __PYX_ERR(8, 1211, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_3)) __PYX_ERR(8, 1211, __pyx_L1_error); __Pyx_INCREF(__pyx_v_s1); __Pyx_GIVEREF(__pyx_v_s1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_v_s1)) __PYX_ERR(8, 1211, __pyx_L1_error); __Pyx_INCREF(__pyx_v_s2); __Pyx_GIVEREF(__pyx_v_s2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 4, __pyx_v_s2)) __PYX_ERR(8, 1211, __pyx_L1_error); __pyx_t_6 = 0; __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_ctx0, __pyx_t_7); __pyx_t_7 = 0; /* "petsc4py/PETSc/petscmat.pxi":1212 * CHKERR( PetscObjectGetDeviceId(self.mat, &devId) ) * ctx0 = (dtype, devId, ndim, s1, s2) * self.set_attr('__dltensor_ctx__', ctx0) # <<<<<<<<<<<<<< * return ctx0 * */ __pyx_t_7 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Mat *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__dltensor_ctx__"), __pyx_v_ctx0); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 1212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "petsc4py/PETSc/petscmat.pxi":1213 * ctx0 = (dtype, devId, ndim, s1, s2) * self.set_attr('__dltensor_ctx__', ctx0) * return ctx0 # <<<<<<<<<<<<<< * * # ----------------------------------------------------------------------------- */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_ctx0); __pyx_r = __pyx_v_ctx0; goto __pyx_L0; /* "petsc4py/PETSc/petscmat.pxi":1181 * return 0 * * cdef mat_get_dlpack_ctx(Mat self): # <<<<<<<<<<<<<< * if 'dense' not in self.getType(): * raise NotImplementedError("Not for type {}".format(self.getType())) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("petsc4py.PETSc.mat_get_dlpack_ctx", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ctx0); __Pyx_XDECREF(__pyx_v_s1); __Pyx_XDECREF(__pyx_v_s2); __Pyx_XDECREF(__pyx_v__); __Pyx_XDECREF(__pyx_v_devType_); __Pyx_XDECREF(__pyx_v_dtype); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscpc.pxi":362 * # -------------------------------------------------------------------- * * cdef inline PC ref_PC(PetscPC pc): # <<<<<<<<<<<<<< * cdef PC ob = PC() * ob.pc = pc */ static CYTHON_INLINE struct PyPetscPCObject *__pyx_f_8petsc4py_5PETSc_ref_PC(PC __pyx_v_pc) { struct PyPetscPCObject *__pyx_v_ob = 0; struct PyPetscPCObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("ref_PC", 1); /* "petsc4py/PETSc/petscpc.pxi":363 * * cdef inline PC ref_PC(PetscPC pc): * cdef PC ob = PC() # <<<<<<<<<<<<<< * ob.pc = pc * CHKERR( PetscINCREF(ob.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_PC)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_ob = ((struct PyPetscPCObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscpc.pxi":364 * cdef inline PC ref_PC(PetscPC pc): * cdef PC ob = PC() * ob.pc = pc # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(ob.obj) ) * return ob */ __pyx_v_ob->pc = __pyx_v_pc; /* "petsc4py/PETSc/petscpc.pxi":365 * cdef PC ob = PC() * ob.pc = pc * CHKERR( PetscINCREF(ob.obj) ) # <<<<<<<<<<<<<< * return ob * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ob->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(9, 365, __pyx_L1_error) /* "petsc4py/PETSc/petscpc.pxi":366 * ob.pc = pc * CHKERR( PetscINCREF(ob.obj) ) * return ob # <<<<<<<<<<<<<< * * cdef PetscErrorCode PCPatch_ComputeOperator( */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_ob); __pyx_r = __pyx_v_ob; goto __pyx_L0; /* "petsc4py/PETSc/petscpc.pxi":362 * # -------------------------------------------------------------------- * * cdef inline PC ref_PC(PetscPC pc): # <<<<<<<<<<<<<< * cdef PC ob = PC() * ob.pc = pc */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.ref_PC", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscpc.pxi":368 * return ob * * cdef PetscErrorCode PCPatch_ComputeOperator( # <<<<<<<<<<<<<< * PetscPC pc, * PetscInt point, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCPatch_ComputeOperator(PC __pyx_v_pc, PetscInt __pyx_v_point, Vec __pyx_v_vec, Mat __pyx_v_mat, IS __pyx_v_cells, CYTHON_UNUSED PetscInt __pyx_v_ndof, PetscInt const *__pyx_v_dofmap, PetscInt const *__pyx_v_dofmapWithAll, void *__pyx_v_ctx) { struct PyPetscVecObject *__pyx_v_Vec = 0; struct PyPetscMatObject *__pyx_v_Mat = 0; struct PyPetscPCObject *__pyx_v_Pc = 0; struct PyPetscISObject *__pyx_v_Is = 0; PyObject *__pyx_v_context = 0; PyObject *__pyx_v_op = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; __Pyx_memviewslice __pyx_v_pydofs = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_memviewslice __pyx_v_pydofsWithAll = { 0, 0, { 0 }, { 0 }, { 0 } }; PyArrayObject *__pyx_v_dofsall = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); struct __pyx_array_obj *__pyx_t_8 = NULL; __Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } }; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("PCPatch_ComputeOperator", 0); /* "petsc4py/PETSc/petscpc.pxi":378 * const PetscInt *dofmapWithAll, * void *ctx) except PETSC_ERR_PYTHON with gil: * cdef Vec Vec = ref_Vec(vec) # <<<<<<<<<<<<<< * cdef Mat Mat = ref_Mat(mat) * cdef PC Pc = ref_PC(pc) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Vec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscpc.pxi":379 * void *ctx) except PETSC_ERR_PYTHON with gil: * cdef Vec Vec = ref_Vec(vec) * cdef Mat Mat = ref_Mat(mat) # <<<<<<<<<<<<<< * cdef PC Pc = ref_PC(pc) * cdef IS Is = ref_IS(cells) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Mat = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscpc.pxi":380 * cdef Vec Vec = ref_Vec(vec) * cdef Mat Mat = ref_Mat(mat) * cdef PC Pc = ref_PC(pc) # <<<<<<<<<<<<<< * cdef IS Is = ref_IS(cells) * cdef object context = Pc.get_attr("__patch_compute_operator__") */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_PC(__pyx_v_pc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Pc = ((struct PyPetscPCObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscpc.pxi":381 * cdef Mat Mat = ref_Mat(mat) * cdef PC Pc = ref_PC(pc) * cdef IS Is = ref_IS(cells) # <<<<<<<<<<<<<< * cdef object context = Pc.get_attr("__patch_compute_operator__") * if context is None and ctx != NULL: context = ctx */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_IS(__pyx_v_cells)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Is = ((struct PyPetscISObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscpc.pxi":382 * cdef PC Pc = ref_PC(pc) * cdef IS Is = ref_IS(cells) * cdef object context = Pc.get_attr("__patch_compute_operator__") # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_PC *)__pyx_v_Pc->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Pc), ((char *)"__patch_compute_operator__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 382, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/petscpc.pxi":383 * cdef IS Is = ref_IS(cells) * cdef object context = Pc.get_attr("__patch_compute_operator__") * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple * (op, args, kargs) = context */ __pyx_t_3 = (__pyx_v_context == Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = (__pyx_v_ctx != NULL); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1); __pyx_t_1 = 0; } /* "petsc4py/PETSc/petscpc.pxi":384 * cdef object context = Pc.get_attr("__patch_compute_operator__") * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # <<<<<<<<<<<<<< * (op, args, kargs) = context * cdef PetscInt[:] pydofs = dofmap */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_3 = (__pyx_v_context != Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_2 = __pyx_t_3; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(9, 384, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(9, 384, __pyx_L1_error) #endif /* "petsc4py/PETSc/petscpc.pxi":385 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple * (op, args, kargs) = context # <<<<<<<<<<<<<< * cdef PetscInt[:] pydofs = dofmap * cdef PetscInt[:] pydofsWithAll */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(9, 385, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); __pyx_t_5 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 385, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 385, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 385, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 385, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); index = 0; __pyx_t_1 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 2; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(9, 385, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(9, 385, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_op = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_kargs = __pyx_t_5; __pyx_t_5 = 0; /* "petsc4py/PETSc/petscpc.pxi":386 * assert context is not None and type(context) is tuple * (op, args, kargs) = context * cdef PetscInt[:] pydofs = dofmap # <<<<<<<<<<<<<< * cdef PetscInt[:] pydofsWithAll * if dofmapWithAll != NULL: */ if (!__pyx_v_dofmap) { PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer"); __PYX_ERR(9, 386, __pyx_L1_error) } __pyx_t_4 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_nn_PetscInt); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_ndof)); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_8 = __pyx_array_new(__pyx_t_5, sizeof(PetscInt), PyBytes_AS_STRING(__pyx_t_4), (char *) "c", (char *) __pyx_v_dofmap); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 386, __pyx_L1_error) __Pyx_GOTREF((PyObject *)__pyx_t_8); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_PetscInt(((PyObject *)__pyx_t_8), PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(9, 386, __pyx_L1_error) __Pyx_DECREF((PyObject *)__pyx_t_8); __pyx_t_8 = 0; __pyx_v_pydofs = __pyx_t_9; __pyx_t_9.memview = NULL; __pyx_t_9.data = NULL; /* "petsc4py/PETSc/petscpc.pxi":388 * cdef PetscInt[:] pydofs = dofmap * cdef PetscInt[:] pydofsWithAll * if dofmapWithAll != NULL: # <<<<<<<<<<<<<< * pydofsWithAll = dofmapWithAll * dofsall = asarray(pydofsWithAll) */ __pyx_t_2 = (__pyx_v_dofmapWithAll != NULL); if (__pyx_t_2) { /* "petsc4py/PETSc/petscpc.pxi":389 * cdef PetscInt[:] pydofsWithAll * if dofmapWithAll != NULL: * pydofsWithAll = dofmapWithAll # <<<<<<<<<<<<<< * dofsall = asarray(pydofsWithAll) * else: */ if (!__pyx_v_dofmapWithAll) { PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer"); __PYX_ERR(9, 389, __pyx_L1_error) } __pyx_t_5 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_nn_PetscInt); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_ndof)); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = __pyx_array_new(__pyx_t_4, sizeof(PetscInt), PyBytes_AS_STRING(__pyx_t_5), (char *) "c", (char *) __pyx_v_dofmapWithAll); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 389, __pyx_L1_error) __Pyx_GOTREF((PyObject *)__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_PetscInt(((PyObject *)__pyx_t_8), PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(9, 389, __pyx_L1_error) __Pyx_DECREF((PyObject *)__pyx_t_8); __pyx_t_8 = 0; __pyx_v_pydofsWithAll = __pyx_t_9; __pyx_t_9.memview = NULL; __pyx_t_9.data = NULL; /* "petsc4py/PETSc/petscpc.pxi":390 * if dofmapWithAll != NULL: * pydofsWithAll = dofmapWithAll * dofsall = asarray(pydofsWithAll) # <<<<<<<<<<<<<< * else: * dofsall = None */ __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_pydofsWithAll, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn_PetscInt, (int (*)(char *, PyObject *)) __pyx_memview_set_nn_PetscInt, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_asarray(__pyx_t_5)); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_dofsall = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/petscpc.pxi":388 * cdef PetscInt[:] pydofs = dofmap * cdef PetscInt[:] pydofsWithAll * if dofmapWithAll != NULL: # <<<<<<<<<<<<<< * pydofsWithAll = dofmapWithAll * dofsall = asarray(pydofsWithAll) */ goto __pyx_L10; } /* "petsc4py/PETSc/petscpc.pxi":392 * dofsall = asarray(pydofsWithAll) * else: * dofsall = None # <<<<<<<<<<<<<< * op(Pc, toInt(point), Vec, Mat, Is, asarray(pydofs), dofsall, *args, **kargs) * return PETSC_SUCCESS */ /*else*/ { __Pyx_INCREF(Py_None); __pyx_v_dofsall = ((PyArrayObject *)Py_None); } __pyx_L10:; /* "petsc4py/PETSc/petscpc.pxi":393 * else: * dofsall = None * op(Pc, toInt(point), Vec, Mat, Is, asarray(pydofs), dofsall, *args, **kargs) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_point); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_pydofs, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn_PetscInt, (int (*)(char *, PyObject *)) __pyx_memview_set_nn_PetscInt, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_asarray(__pyx_t_5)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyTuple_New(7); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF((PyObject *)__pyx_v_Pc); __Pyx_GIVEREF((PyObject *)__pyx_v_Pc); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_Pc))) __PYX_ERR(9, 393, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4)) __PYX_ERR(9, 393, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_Vec); __Pyx_GIVEREF((PyObject *)__pyx_v_Vec); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, ((PyObject *)__pyx_v_Vec))) __PYX_ERR(9, 393, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_Mat); __Pyx_GIVEREF((PyObject *)__pyx_v_Mat); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 3, ((PyObject *)__pyx_v_Mat))) __PYX_ERR(9, 393, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_Is); __Pyx_GIVEREF((PyObject *)__pyx_v_Is); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 4, ((PyObject *)__pyx_v_Is))) __PYX_ERR(9, 393, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 5, __pyx_t_1)) __PYX_ERR(9, 393, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_dofsall); __Pyx_GIVEREF((PyObject *)__pyx_v_dofsall); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 6, ((PyObject *)__pyx_v_dofsall))) __PYX_ERR(9, 393, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(9, 393, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_1 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_1 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_op, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/petscpc.pxi":394 * dofsall = None * op(Pc, toInt(point), Vec, Mat, Is, asarray(pydofs), dofsall, *args, **kargs) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * cdef PetscErrorCode PCPatch_ComputeFunction( */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petscpc.pxi":368 * return ob * * cdef PetscErrorCode PCPatch_ComputeOperator( # <<<<<<<<<<<<<< * PetscPC pc, * PetscInt point, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF((PyObject *)__pyx_t_8); __PYX_XCLEAR_MEMVIEW(&__pyx_t_9, 1); __Pyx_AddTraceback("petsc4py.PETSc.PCPatch_ComputeOperator", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Vec); __Pyx_XDECREF((PyObject *)__pyx_v_Mat); __Pyx_XDECREF((PyObject *)__pyx_v_Pc); __Pyx_XDECREF((PyObject *)__pyx_v_Is); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_op); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __PYX_XCLEAR_MEMVIEW(&__pyx_v_pydofs, 1); __PYX_XCLEAR_MEMVIEW(&__pyx_v_pydofsWithAll, 1); __Pyx_XDECREF((PyObject *)__pyx_v_dofsall); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petscpc.pxi":396 * return PETSC_SUCCESS * * cdef PetscErrorCode PCPatch_ComputeFunction( # <<<<<<<<<<<<<< * PetscPC pc, * PetscInt point, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCPatch_ComputeFunction(PC __pyx_v_pc, PetscInt __pyx_v_point, Vec __pyx_v_vec, Vec __pyx_v_out, IS __pyx_v_cells, CYTHON_UNUSED PetscInt __pyx_v_ndof, PetscInt const *__pyx_v_dofmap, PetscInt const *__pyx_v_dofmapWithAll, void *__pyx_v_ctx) { struct PyPetscVecObject *__pyx_v_Out = 0; struct PyPetscVecObject *__pyx_v_Vec = 0; struct PyPetscPCObject *__pyx_v_Pc = 0; struct PyPetscISObject *__pyx_v_Is = 0; PyObject *__pyx_v_context = 0; PyObject *__pyx_v_op = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; __Pyx_memviewslice __pyx_v_pydofs = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_memviewslice __pyx_v_pydofsWithAll = { 0, 0, { 0 }, { 0 }, { 0 } }; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); struct __pyx_array_obj *__pyx_t_8 = NULL; __Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } }; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("PCPatch_ComputeFunction", 0); /* "petsc4py/PETSc/petscpc.pxi":406 * const PetscInt *dofmapWithAll, * void *ctx) except PETSC_ERR_PYTHON with gil: * cdef Vec Out = ref_Vec(out) # <<<<<<<<<<<<<< * cdef Vec Vec = ref_Vec(vec) * cdef PC Pc = ref_PC(pc) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_out)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Out = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscpc.pxi":407 * void *ctx) except PETSC_ERR_PYTHON with gil: * cdef Vec Out = ref_Vec(out) * cdef Vec Vec = ref_Vec(vec) # <<<<<<<<<<<<<< * cdef PC Pc = ref_PC(pc) * cdef IS Is = ref_IS(cells) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 407, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Vec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscpc.pxi":408 * cdef Vec Out = ref_Vec(out) * cdef Vec Vec = ref_Vec(vec) * cdef PC Pc = ref_PC(pc) # <<<<<<<<<<<<<< * cdef IS Is = ref_IS(cells) * cdef object context = Pc.get_attr("__patch_compute_function__") */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_PC(__pyx_v_pc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Pc = ((struct PyPetscPCObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscpc.pxi":409 * cdef Vec Vec = ref_Vec(vec) * cdef PC Pc = ref_PC(pc) * cdef IS Is = ref_IS(cells) # <<<<<<<<<<<<<< * cdef object context = Pc.get_attr("__patch_compute_function__") * if context is None and ctx != NULL: context = ctx */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_IS(__pyx_v_cells)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Is = ((struct PyPetscISObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscpc.pxi":410 * cdef PC Pc = ref_PC(pc) * cdef IS Is = ref_IS(cells) * cdef object context = Pc.get_attr("__patch_compute_function__") # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_PC *)__pyx_v_Pc->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Pc), ((char *)"__patch_compute_function__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/petscpc.pxi":411 * cdef IS Is = ref_IS(cells) * cdef object context = Pc.get_attr("__patch_compute_function__") * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple * (op, args, kargs) = context */ __pyx_t_3 = (__pyx_v_context == Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = (__pyx_v_ctx != NULL); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1); __pyx_t_1 = 0; } /* "petsc4py/PETSc/petscpc.pxi":412 * cdef object context = Pc.get_attr("__patch_compute_function__") * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # <<<<<<<<<<<<<< * (op, args, kargs) = context * cdef PetscInt[:] pydofs = dofmap */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_3 = (__pyx_v_context != Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_2 = __pyx_t_3; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(9, 412, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(9, 412, __pyx_L1_error) #endif /* "petsc4py/PETSc/petscpc.pxi":413 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple * (op, args, kargs) = context # <<<<<<<<<<<<<< * cdef PetscInt[:] pydofs = dofmap * cdef PetscInt[:] pydofsWithAll = dofmapWithAll */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(9, 413, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); __pyx_t_5 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); index = 0; __pyx_t_1 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 2; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(9, 413, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(9, 413, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_op = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_kargs = __pyx_t_5; __pyx_t_5 = 0; /* "petsc4py/PETSc/petscpc.pxi":414 * assert context is not None and type(context) is tuple * (op, args, kargs) = context * cdef PetscInt[:] pydofs = dofmap # <<<<<<<<<<<<<< * cdef PetscInt[:] pydofsWithAll = dofmapWithAll * op(Pc, toInt(point), Vec, Out, Is, asarray(pydofs), asarray(pydofsWithAll), *args, **kargs) */ if (!__pyx_v_dofmap) { PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer"); __PYX_ERR(9, 414, __pyx_L1_error) } __pyx_t_4 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_nn_PetscInt); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_ndof)); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_8 = __pyx_array_new(__pyx_t_5, sizeof(PetscInt), PyBytes_AS_STRING(__pyx_t_4), (char *) "c", (char *) __pyx_v_dofmap); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 414, __pyx_L1_error) __Pyx_GOTREF((PyObject *)__pyx_t_8); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_PetscInt(((PyObject *)__pyx_t_8), PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(9, 414, __pyx_L1_error) __Pyx_DECREF((PyObject *)__pyx_t_8); __pyx_t_8 = 0; __pyx_v_pydofs = __pyx_t_9; __pyx_t_9.memview = NULL; __pyx_t_9.data = NULL; /* "petsc4py/PETSc/petscpc.pxi":415 * (op, args, kargs) = context * cdef PetscInt[:] pydofs = dofmap * cdef PetscInt[:] pydofsWithAll = dofmapWithAll # <<<<<<<<<<<<<< * op(Pc, toInt(point), Vec, Out, Is, asarray(pydofs), asarray(pydofsWithAll), *args, **kargs) * return PETSC_SUCCESS */ if (!__pyx_v_dofmapWithAll) { PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer"); __PYX_ERR(9, 415, __pyx_L1_error) } __pyx_t_5 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_nn_PetscInt); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 415, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_ndof)); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 415, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = __pyx_array_new(__pyx_t_4, sizeof(PetscInt), PyBytes_AS_STRING(__pyx_t_5), (char *) "c", (char *) __pyx_v_dofmapWithAll); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 415, __pyx_L1_error) __Pyx_GOTREF((PyObject *)__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_PetscInt(((PyObject *)__pyx_t_8), PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(9, 415, __pyx_L1_error) __Pyx_DECREF((PyObject *)__pyx_t_8); __pyx_t_8 = 0; __pyx_v_pydofsWithAll = __pyx_t_9; __pyx_t_9.memview = NULL; __pyx_t_9.data = NULL; /* "petsc4py/PETSc/petscpc.pxi":416 * cdef PetscInt[:] pydofs = dofmap * cdef PetscInt[:] pydofsWithAll = dofmapWithAll * op(Pc, toInt(point), Vec, Out, Is, asarray(pydofs), asarray(pydofsWithAll), *args, **kargs) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_point); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_pydofs, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn_PetscInt, (int (*)(char *, PyObject *)) __pyx_memview_set_nn_PetscInt, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_asarray(__pyx_t_4)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_pydofsWithAll, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn_PetscInt, (int (*)(char *, PyObject *)) __pyx_memview_set_nn_PetscInt, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_asarray(__pyx_t_4)); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(7); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF((PyObject *)__pyx_v_Pc); __Pyx_GIVEREF((PyObject *)__pyx_v_Pc); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_Pc))) __PYX_ERR(9, 416, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5)) __PYX_ERR(9, 416, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_Vec); __Pyx_GIVEREF((PyObject *)__pyx_v_Vec); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, ((PyObject *)__pyx_v_Vec))) __PYX_ERR(9, 416, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_Out); __Pyx_GIVEREF((PyObject *)__pyx_v_Out); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 3, ((PyObject *)__pyx_v_Out))) __PYX_ERR(9, 416, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_Is); __Pyx_GIVEREF((PyObject *)__pyx_v_Is); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 4, ((PyObject *)__pyx_v_Is))) __PYX_ERR(9, 416, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_t_1)) __PYX_ERR(9, 416, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 6, __pyx_t_6)) __PYX_ERR(9, 416, __pyx_L1_error); __pyx_t_5 = 0; __pyx_t_1 = 0; __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(9, 416, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_6 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } else { __pyx_t_6 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } __pyx_t_4 = __Pyx_PyObject_Call(__pyx_v_op, __pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/petscpc.pxi":417 * cdef PetscInt[:] pydofsWithAll = dofmapWithAll * op(Pc, toInt(point), Vec, Out, Is, asarray(pydofs), asarray(pydofsWithAll), *args, **kargs) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * cdef PetscErrorCode PCPatch_ComputeOperatorInteriorFacets( */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petscpc.pxi":396 * return PETSC_SUCCESS * * cdef PetscErrorCode PCPatch_ComputeFunction( # <<<<<<<<<<<<<< * PetscPC pc, * PetscInt point, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF((PyObject *)__pyx_t_8); __PYX_XCLEAR_MEMVIEW(&__pyx_t_9, 1); __Pyx_AddTraceback("petsc4py.PETSc.PCPatch_ComputeFunction", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Out); __Pyx_XDECREF((PyObject *)__pyx_v_Vec); __Pyx_XDECREF((PyObject *)__pyx_v_Pc); __Pyx_XDECREF((PyObject *)__pyx_v_Is); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_op); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __PYX_XCLEAR_MEMVIEW(&__pyx_v_pydofs, 1); __PYX_XCLEAR_MEMVIEW(&__pyx_v_pydofsWithAll, 1); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petscpc.pxi":419 * return PETSC_SUCCESS * * cdef PetscErrorCode PCPatch_ComputeOperatorInteriorFacets( # <<<<<<<<<<<<<< * PetscPC pc, * PetscInt point, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCPatch_ComputeOperatorInteriorFacets(PC __pyx_v_pc, PetscInt __pyx_v_point, Vec __pyx_v_vec, Mat __pyx_v_mat, IS __pyx_v_facets, CYTHON_UNUSED PetscInt __pyx_v_ndof, PetscInt const *__pyx_v_dofmap, PetscInt const *__pyx_v_dofmapWithAll, void *__pyx_v_ctx) { struct PyPetscVecObject *__pyx_v_Vec = 0; struct PyPetscMatObject *__pyx_v_Mat = 0; struct PyPetscPCObject *__pyx_v_Pc = 0; struct PyPetscISObject *__pyx_v_Is = 0; PyObject *__pyx_v_context = 0; PyObject *__pyx_v_op = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; __Pyx_memviewslice __pyx_v_pydofs = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_memviewslice __pyx_v_pydofsWithAll = { 0, 0, { 0 }, { 0 }, { 0 } }; PyArrayObject *__pyx_v_dofsall = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); struct __pyx_array_obj *__pyx_t_8 = NULL; __Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } }; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("PCPatch_ComputeOperatorInteriorFacets", 0); /* "petsc4py/PETSc/petscpc.pxi":429 * const PetscInt *dofmapWithAll, * void *ctx) except PETSC_ERR_PYTHON with gil: * cdef Vec Vec = ref_Vec(vec) # <<<<<<<<<<<<<< * cdef Mat Mat = ref_Mat(mat) * cdef PC Pc = ref_PC(pc) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Vec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscpc.pxi":430 * void *ctx) except PETSC_ERR_PYTHON with gil: * cdef Vec Vec = ref_Vec(vec) * cdef Mat Mat = ref_Mat(mat) # <<<<<<<<<<<<<< * cdef PC Pc = ref_PC(pc) * cdef IS Is = ref_IS(facets) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Mat = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscpc.pxi":431 * cdef Vec Vec = ref_Vec(vec) * cdef Mat Mat = ref_Mat(mat) * cdef PC Pc = ref_PC(pc) # <<<<<<<<<<<<<< * cdef IS Is = ref_IS(facets) * cdef object context = Pc.get_attr("__patch_compute_operator_interior_facets__") */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_PC(__pyx_v_pc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 431, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Pc = ((struct PyPetscPCObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscpc.pxi":432 * cdef Mat Mat = ref_Mat(mat) * cdef PC Pc = ref_PC(pc) * cdef IS Is = ref_IS(facets) # <<<<<<<<<<<<<< * cdef object context = Pc.get_attr("__patch_compute_operator_interior_facets__") * if context is None and ctx != NULL: context = ctx */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_IS(__pyx_v_facets)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 432, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Is = ((struct PyPetscISObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscpc.pxi":433 * cdef PC Pc = ref_PC(pc) * cdef IS Is = ref_IS(facets) * cdef object context = Pc.get_attr("__patch_compute_operator_interior_facets__") # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_PC *)__pyx_v_Pc->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Pc), ((char *)"__patch_compute_operator_interior_facets__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 433, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/petscpc.pxi":434 * cdef IS Is = ref_IS(facets) * cdef object context = Pc.get_attr("__patch_compute_operator_interior_facets__") * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple * (op, args, kargs) = context */ __pyx_t_3 = (__pyx_v_context == Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = (__pyx_v_ctx != NULL); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1); __pyx_t_1 = 0; } /* "petsc4py/PETSc/petscpc.pxi":435 * cdef object context = Pc.get_attr("__patch_compute_operator_interior_facets__") * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # <<<<<<<<<<<<<< * (op, args, kargs) = context * cdef PetscInt[:] pydofs = dofmap */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_3 = (__pyx_v_context != Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_2 = __pyx_t_3; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(9, 435, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(9, 435, __pyx_L1_error) #endif /* "petsc4py/PETSc/petscpc.pxi":436 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple * (op, args, kargs) = context # <<<<<<<<<<<<<< * cdef PetscInt[:] pydofs = dofmap * cdef PetscInt[:] pydofsWithAll */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(9, 436, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); __pyx_t_5 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); index = 0; __pyx_t_1 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 2; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(9, 436, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(9, 436, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_op = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_kargs = __pyx_t_5; __pyx_t_5 = 0; /* "petsc4py/PETSc/petscpc.pxi":437 * assert context is not None and type(context) is tuple * (op, args, kargs) = context * cdef PetscInt[:] pydofs = dofmap # <<<<<<<<<<<<<< * cdef PetscInt[:] pydofsWithAll * if dofmapWithAll != NULL: */ if (!__pyx_v_dofmap) { PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer"); __PYX_ERR(9, 437, __pyx_L1_error) } __pyx_t_4 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_nn_PetscInt); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 437, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_ndof)); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 437, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_8 = __pyx_array_new(__pyx_t_5, sizeof(PetscInt), PyBytes_AS_STRING(__pyx_t_4), (char *) "c", (char *) __pyx_v_dofmap); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 437, __pyx_L1_error) __Pyx_GOTREF((PyObject *)__pyx_t_8); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_PetscInt(((PyObject *)__pyx_t_8), PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(9, 437, __pyx_L1_error) __Pyx_DECREF((PyObject *)__pyx_t_8); __pyx_t_8 = 0; __pyx_v_pydofs = __pyx_t_9; __pyx_t_9.memview = NULL; __pyx_t_9.data = NULL; /* "petsc4py/PETSc/petscpc.pxi":439 * cdef PetscInt[:] pydofs = dofmap * cdef PetscInt[:] pydofsWithAll * if dofmapWithAll != NULL: # <<<<<<<<<<<<<< * pydofsWithAll = dofmapWithAll * dofsall = asarray(pydofsWithAll) */ __pyx_t_2 = (__pyx_v_dofmapWithAll != NULL); if (__pyx_t_2) { /* "petsc4py/PETSc/petscpc.pxi":440 * cdef PetscInt[:] pydofsWithAll * if dofmapWithAll != NULL: * pydofsWithAll = dofmapWithAll # <<<<<<<<<<<<<< * dofsall = asarray(pydofsWithAll) * else: */ if (!__pyx_v_dofmapWithAll) { PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer"); __PYX_ERR(9, 440, __pyx_L1_error) } __pyx_t_5 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_nn_PetscInt); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_ndof)); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = __pyx_array_new(__pyx_t_4, sizeof(PetscInt), PyBytes_AS_STRING(__pyx_t_5), (char *) "c", (char *) __pyx_v_dofmapWithAll); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 440, __pyx_L1_error) __Pyx_GOTREF((PyObject *)__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_PetscInt(((PyObject *)__pyx_t_8), PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(9, 440, __pyx_L1_error) __Pyx_DECREF((PyObject *)__pyx_t_8); __pyx_t_8 = 0; __pyx_v_pydofsWithAll = __pyx_t_9; __pyx_t_9.memview = NULL; __pyx_t_9.data = NULL; /* "petsc4py/PETSc/petscpc.pxi":441 * if dofmapWithAll != NULL: * pydofsWithAll = dofmapWithAll * dofsall = asarray(pydofsWithAll) # <<<<<<<<<<<<<< * else: * dofsall = None */ __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_pydofsWithAll, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn_PetscInt, (int (*)(char *, PyObject *)) __pyx_memview_set_nn_PetscInt, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 441, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_asarray(__pyx_t_5)); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 441, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_dofsall = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/petscpc.pxi":439 * cdef PetscInt[:] pydofs = dofmap * cdef PetscInt[:] pydofsWithAll * if dofmapWithAll != NULL: # <<<<<<<<<<<<<< * pydofsWithAll = dofmapWithAll * dofsall = asarray(pydofsWithAll) */ goto __pyx_L10; } /* "petsc4py/PETSc/petscpc.pxi":443 * dofsall = asarray(pydofsWithAll) * else: * dofsall = None # <<<<<<<<<<<<<< * op(Pc, toInt(point), Vec, Mat, Is, asarray(pydofs), dofsall, *args, **kargs) * return PETSC_SUCCESS */ /*else*/ { __Pyx_INCREF(Py_None); __pyx_v_dofsall = ((PyArrayObject *)Py_None); } __pyx_L10:; /* "petsc4py/PETSc/petscpc.pxi":444 * else: * dofsall = None * op(Pc, toInt(point), Vec, Mat, Is, asarray(pydofs), dofsall, *args, **kargs) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_point); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_pydofs, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn_PetscInt, (int (*)(char *, PyObject *)) __pyx_memview_set_nn_PetscInt, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_asarray(__pyx_t_5)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyTuple_New(7); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF((PyObject *)__pyx_v_Pc); __Pyx_GIVEREF((PyObject *)__pyx_v_Pc); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_Pc))) __PYX_ERR(9, 444, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4)) __PYX_ERR(9, 444, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_Vec); __Pyx_GIVEREF((PyObject *)__pyx_v_Vec); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, ((PyObject *)__pyx_v_Vec))) __PYX_ERR(9, 444, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_Mat); __Pyx_GIVEREF((PyObject *)__pyx_v_Mat); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 3, ((PyObject *)__pyx_v_Mat))) __PYX_ERR(9, 444, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_Is); __Pyx_GIVEREF((PyObject *)__pyx_v_Is); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 4, ((PyObject *)__pyx_v_Is))) __PYX_ERR(9, 444, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 5, __pyx_t_1)) __PYX_ERR(9, 444, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_dofsall); __Pyx_GIVEREF((PyObject *)__pyx_v_dofsall); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 6, ((PyObject *)__pyx_v_dofsall))) __PYX_ERR(9, 444, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(9, 444, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_1 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_1 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_op, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/petscpc.pxi":445 * dofsall = None * op(Pc, toInt(point), Vec, Mat, Is, asarray(pydofs), dofsall, *args, **kargs) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * cdef PetscErrorCode PCPatch_ComputeFunctionInteriorFacets( */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petscpc.pxi":419 * return PETSC_SUCCESS * * cdef PetscErrorCode PCPatch_ComputeOperatorInteriorFacets( # <<<<<<<<<<<<<< * PetscPC pc, * PetscInt point, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF((PyObject *)__pyx_t_8); __PYX_XCLEAR_MEMVIEW(&__pyx_t_9, 1); __Pyx_AddTraceback("petsc4py.PETSc.PCPatch_ComputeOperatorInteriorFacets", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Vec); __Pyx_XDECREF((PyObject *)__pyx_v_Mat); __Pyx_XDECREF((PyObject *)__pyx_v_Pc); __Pyx_XDECREF((PyObject *)__pyx_v_Is); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_op); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __PYX_XCLEAR_MEMVIEW(&__pyx_v_pydofs, 1); __PYX_XCLEAR_MEMVIEW(&__pyx_v_pydofsWithAll, 1); __Pyx_XDECREF((PyObject *)__pyx_v_dofsall); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petscpc.pxi":447 * return PETSC_SUCCESS * * cdef PetscErrorCode PCPatch_ComputeFunctionInteriorFacets( # <<<<<<<<<<<<<< * PetscPC pc, * PetscInt point, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCPatch_ComputeFunctionInteriorFacets(PC __pyx_v_pc, PetscInt __pyx_v_point, Vec __pyx_v_vec, Vec __pyx_v_out, IS __pyx_v_facets, CYTHON_UNUSED PetscInt __pyx_v_ndof, PetscInt const *__pyx_v_dofmap, PetscInt const *__pyx_v_dofmapWithAll, void *__pyx_v_ctx) { struct PyPetscVecObject *__pyx_v_Out = 0; struct PyPetscVecObject *__pyx_v_Vec = 0; struct PyPetscPCObject *__pyx_v_Pc = 0; struct PyPetscISObject *__pyx_v_Is = 0; PyObject *__pyx_v_context = 0; PyObject *__pyx_v_op = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; __Pyx_memviewslice __pyx_v_pydofs = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_memviewslice __pyx_v_pydofsWithAll = { 0, 0, { 0 }, { 0 }, { 0 } }; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); struct __pyx_array_obj *__pyx_t_8 = NULL; __Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } }; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("PCPatch_ComputeFunctionInteriorFacets", 0); /* "petsc4py/PETSc/petscpc.pxi":457 * const PetscInt *dofmapWithAll, * void *ctx) except PETSC_ERR_PYTHON with gil: * cdef Vec Out = ref_Vec(out) # <<<<<<<<<<<<<< * cdef Vec Vec = ref_Vec(vec) * cdef PC Pc = ref_PC(pc) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_out)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 457, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Out = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscpc.pxi":458 * void *ctx) except PETSC_ERR_PYTHON with gil: * cdef Vec Out = ref_Vec(out) * cdef Vec Vec = ref_Vec(vec) # <<<<<<<<<<<<<< * cdef PC Pc = ref_PC(pc) * cdef IS Is = ref_IS(facets) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Vec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscpc.pxi":459 * cdef Vec Out = ref_Vec(out) * cdef Vec Vec = ref_Vec(vec) * cdef PC Pc = ref_PC(pc) # <<<<<<<<<<<<<< * cdef IS Is = ref_IS(facets) * cdef object context = Pc.get_attr("__patch_compute_function_interior_facets__") */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_PC(__pyx_v_pc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 459, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Pc = ((struct PyPetscPCObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscpc.pxi":460 * cdef Vec Vec = ref_Vec(vec) * cdef PC Pc = ref_PC(pc) * cdef IS Is = ref_IS(facets) # <<<<<<<<<<<<<< * cdef object context = Pc.get_attr("__patch_compute_function_interior_facets__") * if context is None and ctx != NULL: context = ctx */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_IS(__pyx_v_facets)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 460, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Is = ((struct PyPetscISObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscpc.pxi":461 * cdef PC Pc = ref_PC(pc) * cdef IS Is = ref_IS(facets) * cdef object context = Pc.get_attr("__patch_compute_function_interior_facets__") # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_PC *)__pyx_v_Pc->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Pc), ((char *)"__patch_compute_function_interior_facets__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 461, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/petscpc.pxi":462 * cdef IS Is = ref_IS(facets) * cdef object context = Pc.get_attr("__patch_compute_function_interior_facets__") * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple * (op, args, kargs) = context */ __pyx_t_3 = (__pyx_v_context == Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = (__pyx_v_ctx != NULL); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1); __pyx_t_1 = 0; } /* "petsc4py/PETSc/petscpc.pxi":463 * cdef object context = Pc.get_attr("__patch_compute_function_interior_facets__") * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # <<<<<<<<<<<<<< * (op, args, kargs) = context * cdef PetscInt[:] pydofs = dofmap */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_3 = (__pyx_v_context != Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_2 = __pyx_t_3; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(9, 463, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(9, 463, __pyx_L1_error) #endif /* "petsc4py/PETSc/petscpc.pxi":464 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple * (op, args, kargs) = context # <<<<<<<<<<<<<< * cdef PetscInt[:] pydofs = dofmap * cdef PetscInt[:] pydofsWithAll = dofmapWithAll */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(9, 464, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); __pyx_t_5 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); index = 0; __pyx_t_1 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 2; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(9, 464, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(9, 464, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_op = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_kargs = __pyx_t_5; __pyx_t_5 = 0; /* "petsc4py/PETSc/petscpc.pxi":465 * assert context is not None and type(context) is tuple * (op, args, kargs) = context * cdef PetscInt[:] pydofs = dofmap # <<<<<<<<<<<<<< * cdef PetscInt[:] pydofsWithAll = dofmapWithAll * op(Pc, toInt(point), Vec, Out, Is, asarray(pydofs), asarray(pydofsWithAll), *args, **kargs) */ if (!__pyx_v_dofmap) { PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer"); __PYX_ERR(9, 465, __pyx_L1_error) } __pyx_t_4 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_nn_PetscInt); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_ndof)); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_8 = __pyx_array_new(__pyx_t_5, sizeof(PetscInt), PyBytes_AS_STRING(__pyx_t_4), (char *) "c", (char *) __pyx_v_dofmap); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 465, __pyx_L1_error) __Pyx_GOTREF((PyObject *)__pyx_t_8); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_PetscInt(((PyObject *)__pyx_t_8), PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(9, 465, __pyx_L1_error) __Pyx_DECREF((PyObject *)__pyx_t_8); __pyx_t_8 = 0; __pyx_v_pydofs = __pyx_t_9; __pyx_t_9.memview = NULL; __pyx_t_9.data = NULL; /* "petsc4py/PETSc/petscpc.pxi":466 * (op, args, kargs) = context * cdef PetscInt[:] pydofs = dofmap * cdef PetscInt[:] pydofsWithAll = dofmapWithAll # <<<<<<<<<<<<<< * op(Pc, toInt(point), Vec, Out, Is, asarray(pydofs), asarray(pydofsWithAll), *args, **kargs) * return PETSC_SUCCESS */ if (!__pyx_v_dofmapWithAll) { PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer"); __PYX_ERR(9, 466, __pyx_L1_error) } __pyx_t_5 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_nn_PetscInt); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_ndof)); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = __pyx_array_new(__pyx_t_4, sizeof(PetscInt), PyBytes_AS_STRING(__pyx_t_5), (char *) "c", (char *) __pyx_v_dofmapWithAll); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 466, __pyx_L1_error) __Pyx_GOTREF((PyObject *)__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_PetscInt(((PyObject *)__pyx_t_8), PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(9, 466, __pyx_L1_error) __Pyx_DECREF((PyObject *)__pyx_t_8); __pyx_t_8 = 0; __pyx_v_pydofsWithAll = __pyx_t_9; __pyx_t_9.memview = NULL; __pyx_t_9.data = NULL; /* "petsc4py/PETSc/petscpc.pxi":467 * cdef PetscInt[:] pydofs = dofmap * cdef PetscInt[:] pydofsWithAll = dofmapWithAll * op(Pc, toInt(point), Vec, Out, Is, asarray(pydofs), asarray(pydofsWithAll), *args, **kargs) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_point); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_pydofs, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn_PetscInt, (int (*)(char *, PyObject *)) __pyx_memview_set_nn_PetscInt, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_asarray(__pyx_t_4)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_pydofsWithAll, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn_PetscInt, (int (*)(char *, PyObject *)) __pyx_memview_set_nn_PetscInt, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_asarray(__pyx_t_4)); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(7); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF((PyObject *)__pyx_v_Pc); __Pyx_GIVEREF((PyObject *)__pyx_v_Pc); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_Pc))) __PYX_ERR(9, 467, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5)) __PYX_ERR(9, 467, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_Vec); __Pyx_GIVEREF((PyObject *)__pyx_v_Vec); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, ((PyObject *)__pyx_v_Vec))) __PYX_ERR(9, 467, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_Out); __Pyx_GIVEREF((PyObject *)__pyx_v_Out); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 3, ((PyObject *)__pyx_v_Out))) __PYX_ERR(9, 467, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_Is); __Pyx_GIVEREF((PyObject *)__pyx_v_Is); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 4, ((PyObject *)__pyx_v_Is))) __PYX_ERR(9, 467, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_t_1)) __PYX_ERR(9, 467, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 6, __pyx_t_6)) __PYX_ERR(9, 467, __pyx_L1_error); __pyx_t_5 = 0; __pyx_t_1 = 0; __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(9, 467, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_6 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } else { __pyx_t_6 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } __pyx_t_4 = __Pyx_PyObject_Call(__pyx_v_op, __pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/petscpc.pxi":468 * cdef PetscInt[:] pydofsWithAll = dofmapWithAll * op(Pc, toInt(point), Vec, Out, Is, asarray(pydofs), asarray(pydofsWithAll), *args, **kargs) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * cdef PetscErrorCode PCPatch_UserConstructOperator( */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petscpc.pxi":447 * return PETSC_SUCCESS * * cdef PetscErrorCode PCPatch_ComputeFunctionInteriorFacets( # <<<<<<<<<<<<<< * PetscPC pc, * PetscInt point, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF((PyObject *)__pyx_t_8); __PYX_XCLEAR_MEMVIEW(&__pyx_t_9, 1); __Pyx_AddTraceback("petsc4py.PETSc.PCPatch_ComputeFunctionInteriorFacets", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Out); __Pyx_XDECREF((PyObject *)__pyx_v_Vec); __Pyx_XDECREF((PyObject *)__pyx_v_Pc); __Pyx_XDECREF((PyObject *)__pyx_v_Is); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_op); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __PYX_XCLEAR_MEMVIEW(&__pyx_v_pydofs, 1); __PYX_XCLEAR_MEMVIEW(&__pyx_v_pydofsWithAll, 1); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petscpc.pxi":470 * return PETSC_SUCCESS * * cdef PetscErrorCode PCPatch_UserConstructOperator( # <<<<<<<<<<<<<< * PetscPC pc, * PetscInt *n, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCPatch_UserConstructOperator(PC __pyx_v_pc, PetscInt *__pyx_v_n, IS **__pyx_v_userIS, IS *__pyx_v_userIterationSet, void *__pyx_v_ctx) { struct PyPetscPCObject *__pyx_v_Pc = 0; PetscInt __pyx_v_i; PyObject *__pyx_v_context = 0; PyObject *__pyx_v_op = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PyObject *__pyx_v_patches = NULL; PyObject *__pyx_v_iterationSet = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); Py_ssize_t __pyx_t_8; PetscErrorCode __pyx_t_9; PetscInt __pyx_t_10; PetscInt __pyx_t_11; PetscInt __pyx_t_12; IS __pyx_t_13; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("PCPatch_UserConstructOperator", 0); /* "petsc4py/PETSc/petscpc.pxi":476 * PetscIS *userIterationSet, * void *ctx) except PETSC_ERR_PYTHON with gil: * cdef PC Pc = ref_PC(pc) # <<<<<<<<<<<<<< * cdef PetscInt i * cdef object context = Pc.get_attr("__patch_construction_operator__") */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_PC(__pyx_v_pc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 476, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Pc = ((struct PyPetscPCObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscpc.pxi":478 * cdef PC Pc = ref_PC(pc) * cdef PetscInt i * cdef object context = Pc.get_attr("__patch_construction_operator__") # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_PC *)__pyx_v_Pc->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Pc), ((char *)"__patch_construction_operator__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/petscpc.pxi":479 * cdef PetscInt i * cdef object context = Pc.get_attr("__patch_construction_operator__") * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple * (op, args, kargs) = context */ __pyx_t_3 = (__pyx_v_context == Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = (__pyx_v_ctx != NULL); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1); __pyx_t_1 = 0; } /* "petsc4py/PETSc/petscpc.pxi":480 * cdef object context = Pc.get_attr("__patch_construction_operator__") * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # <<<<<<<<<<<<<< * (op, args, kargs) = context * (patches, iterationSet) = op(Pc, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_3 = (__pyx_v_context != Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_2 = __pyx_t_3; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(9, 480, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(9, 480, __pyx_L1_error) #endif /* "petsc4py/PETSc/petscpc.pxi":481 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple * (op, args, kargs) = context # <<<<<<<<<<<<<< * (patches, iterationSet) = op(Pc, *args, **kargs) * n[0] = len(patches) */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(9, 481, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); __pyx_t_5 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 481, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 481, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 481, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 481, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); index = 0; __pyx_t_1 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 2; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(9, 481, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(9, 481, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_op = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_kargs = __pyx_t_5; __pyx_t_5 = 0; /* "petsc4py/PETSc/petscpc.pxi":482 * assert context is not None and type(context) is tuple * (op, args, kargs) = context * (patches, iterationSet) = op(Pc, *args, **kargs) # <<<<<<<<<<<<<< * n[0] = len(patches) * CHKERR(PetscMalloc(n[0]*sizeof(PetscIS), userIS)) */ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 482, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF((PyObject *)__pyx_v_Pc); __Pyx_GIVEREF((PyObject *)__pyx_v_Pc); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_Pc))) __PYX_ERR(9, 482, __pyx_L1_error); __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 482, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 482, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(9, 482, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_4 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 482, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } else { __pyx_t_4 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 482, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_op, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 482, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) { PyObject* sequence = __pyx_t_5; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(9, 482, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_4 = PyList_GET_ITEM(sequence, 0); __pyx_t_1 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_1); #else __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 482, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 482, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 482, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); index = 0; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L10_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 1; __pyx_t_1 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L10_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(9, 482, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L11_unpacking_done; __pyx_L10_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(9, 482, __pyx_L1_error) __pyx_L11_unpacking_done:; } __pyx_v_patches = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_iterationSet = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/petscpc.pxi":483 * (op, args, kargs) = context * (patches, iterationSet) = op(Pc, *args, **kargs) * n[0] = len(patches) # <<<<<<<<<<<<<< * CHKERR(PetscMalloc(n[0]*sizeof(PetscIS), userIS)) * for i in range(n[0]): */ __pyx_t_8 = PyObject_Length(__pyx_v_patches); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(9, 483, __pyx_L1_error) (__pyx_v_n[0]) = __pyx_t_8; /* "petsc4py/PETSc/petscpc.pxi":484 * (patches, iterationSet) = op(Pc, *args, **kargs) * n[0] = len(patches) * CHKERR(PetscMalloc(n[0]*sizeof(PetscIS), userIS)) # <<<<<<<<<<<<<< * for i in range(n[0]): * userIS[0][i] = (patches[i]).iset */ __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((((size_t)(__pyx_v_n[0])) * (sizeof(IS))), __pyx_v_userIS)); if (unlikely(__pyx_t_9 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(9, 484, __pyx_L1_error) /* "petsc4py/PETSc/petscpc.pxi":485 * n[0] = len(patches) * CHKERR(PetscMalloc(n[0]*sizeof(PetscIS), userIS)) * for i in range(n[0]): # <<<<<<<<<<<<<< * userIS[0][i] = (patches[i]).iset * CHKERR( PetscINCREF(&(userIS[0][i])) ) */ __pyx_t_10 = (__pyx_v_n[0]); __pyx_t_11 = __pyx_t_10; for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { __pyx_v_i = __pyx_t_12; /* "petsc4py/PETSc/petscpc.pxi":486 * CHKERR(PetscMalloc(n[0]*sizeof(PetscIS), userIS)) * for i in range(n[0]): * userIS[0][i] = (patches[i]).iset # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(&(userIS[0][i])) ) * userIterationSet[0] = (iterationSet).iset */ __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_patches, __pyx_v_i, PetscInt, 1, __Pyx_PyInt_From_PetscInt, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 486, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (!(likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(9, 486, __pyx_L1_error) __pyx_t_13 = ((struct PyPetscISObject *)__pyx_t_5)->iset; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; ((__pyx_v_userIS[0])[__pyx_v_i]) = __pyx_t_13; /* "petsc4py/PETSc/petscpc.pxi":487 * for i in range(n[0]): * userIS[0][i] = (patches[i]).iset * CHKERR( PetscINCREF(&(userIS[0][i])) ) # <<<<<<<<<<<<<< * userIterationSet[0] = (iterationSet).iset * CHKERR( PetscINCREF(&(userIterationSet[0])) ) */ __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(((PetscObject *)(&((__pyx_v_userIS[0])[__pyx_v_i]))))); if (unlikely(__pyx_t_9 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(9, 487, __pyx_L1_error) } /* "petsc4py/PETSc/petscpc.pxi":488 * userIS[0][i] = (patches[i]).iset * CHKERR( PetscINCREF(&(userIS[0][i])) ) * userIterationSet[0] = (iterationSet).iset # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(&(userIterationSet[0])) ) * return PETSC_SUCCESS */ if (!(likely(__Pyx_TypeTest(__pyx_v_iterationSet, __pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(9, 488, __pyx_L1_error) __pyx_t_13 = ((struct PyPetscISObject *)__pyx_v_iterationSet)->iset; (__pyx_v_userIterationSet[0]) = __pyx_t_13; /* "petsc4py/PETSc/petscpc.pxi":489 * CHKERR( PetscINCREF(&(userIS[0][i])) ) * userIterationSet[0] = (iterationSet).iset * CHKERR( PetscINCREF(&(userIterationSet[0])) ) # <<<<<<<<<<<<<< * return PETSC_SUCCESS */ __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(((PetscObject *)(&(__pyx_v_userIterationSet[0]))))); if (unlikely(__pyx_t_9 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(9, 489, __pyx_L1_error) /* "petsc4py/PETSc/petscpc.pxi":490 * userIterationSet[0] = (iterationSet).iset * CHKERR( PetscINCREF(&(userIterationSet[0])) ) * return PETSC_SUCCESS # <<<<<<<<<<<<<< */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petscpc.pxi":470 * return PETSC_SUCCESS * * cdef PetscErrorCode PCPatch_UserConstructOperator( # <<<<<<<<<<<<<< * PetscPC pc, * PetscInt *n, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.PCPatch_UserConstructOperator", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Pc); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_op); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XDECREF(__pyx_v_patches); __Pyx_XDECREF(__pyx_v_iterationSet); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petscksp.pxi":221 * # ----------------------------------------------------------------------------- * * cdef inline KSP ref_KSP(PetscKSP ksp): # <<<<<<<<<<<<<< * cdef KSP ob = KSP() * ob.ksp = ksp */ static CYTHON_INLINE struct PyPetscKSPObject *__pyx_f_8petsc4py_5PETSc_ref_KSP(KSP __pyx_v_ksp) { struct PyPetscKSPObject *__pyx_v_ob = 0; struct PyPetscKSPObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("ref_KSP", 1); /* "petsc4py/PETSc/petscksp.pxi":222 * * cdef inline KSP ref_KSP(PetscKSP ksp): * cdef KSP ob = KSP() # <<<<<<<<<<<<<< * ob.ksp = ksp * CHKERR( PetscINCREF(ob.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_KSP)); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_ob = ((struct PyPetscKSPObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscksp.pxi":223 * cdef inline KSP ref_KSP(PetscKSP ksp): * cdef KSP ob = KSP() * ob.ksp = ksp # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(ob.obj) ) * return ob */ __pyx_v_ob->ksp = __pyx_v_ksp; /* "petsc4py/PETSc/petscksp.pxi":224 * cdef KSP ob = KSP() * ob.ksp = ksp * CHKERR( PetscINCREF(ob.obj) ) # <<<<<<<<<<<<<< * return ob * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ob->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(22, 224, __pyx_L1_error) /* "petsc4py/PETSc/petscksp.pxi":225 * ob.ksp = ksp * CHKERR( PetscINCREF(ob.obj) ) * return ob # <<<<<<<<<<<<<< * * # ----------------------------------------------------------------------------- */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_ob); __pyx_r = __pyx_v_ob; goto __pyx_L0; /* "petsc4py/PETSc/petscksp.pxi":221 * # ----------------------------------------------------------------------------- * * cdef inline KSP ref_KSP(PetscKSP ksp): # <<<<<<<<<<<<<< * cdef KSP ob = KSP() * ob.ksp = ksp */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.ref_KSP", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscksp.pxi":229 * # ----------------------------------------------------------------------------- * * cdef PetscErrorCode KSP_Converged( # <<<<<<<<<<<<<< * PetscKSP ksp, * PetscInt its, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_KSP_Converged(KSP __pyx_v_ksp, PetscInt __pyx_v_its, PetscReal __pyx_v_rnm, KSPConvergedReason *__pyx_v_r, CYTHON_UNUSED void *__pyx_v_ctx) { struct PyPetscKSPObject *__pyx_v_Ksp = 0; PyObject *__pyx_v_converged = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PyObject *__pyx_v_reason = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *(*__pyx_t_6)(PyObject *); int __pyx_t_7; KSPConvergedReason __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("KSP_Converged", 0); /* "petsc4py/PETSc/petscksp.pxi":236 * void* ctx, * ) except PETSC_ERR_PYTHON with gil: * cdef KSP Ksp = ref_KSP(ksp) # <<<<<<<<<<<<<< * (converged, args, kargs) = Ksp.get_attr('__converged__') * reason = converged(Ksp, toInt(its), toReal(rnm), *args, **kargs) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_KSP(__pyx_v_ksp)); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Ksp = ((struct PyPetscKSPObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscksp.pxi":237 * ) except PETSC_ERR_PYTHON with gil: * cdef KSP Ksp = ref_KSP(ksp) * (converged, args, kargs) = Ksp.get_attr('__converged__') # <<<<<<<<<<<<<< * reason = converged(Ksp, toInt(its), toReal(rnm), *args, **kargs) * if reason is None: r[0] = KSP_CONVERGED_ITERATING */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_KSP *)__pyx_v_Ksp->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Ksp), ((char *)"__converged__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(22, 237, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); __pyx_t_4 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(22, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(22, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(22, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(22, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 2; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 3) < 0) __PYX_ERR(22, 237, __pyx_L1_error) __pyx_t_6 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(22, 237, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_converged = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_args = __pyx_t_3; __pyx_t_3 = 0; __pyx_v_kargs = __pyx_t_4; __pyx_t_4 = 0; /* "petsc4py/PETSc/petscksp.pxi":238 * cdef KSP Ksp = ref_KSP(ksp) * (converged, args, kargs) = Ksp.get_attr('__converged__') * reason = converged(Ksp, toInt(its), toReal(rnm), *args, **kargs) # <<<<<<<<<<<<<< * if reason is None: r[0] = KSP_CONVERGED_ITERATING * elif reason is False: r[0] = KSP_CONVERGED_ITERATING */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_its); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_rnm); if (unlikely(!__pyx_t_4)) __PYX_ERR(22, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(22, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF((PyObject *)__pyx_v_Ksp); __Pyx_GIVEREF((PyObject *)__pyx_v_Ksp); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_Ksp))) __PYX_ERR(22, 238, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(22, 238, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_4)) __PYX_ERR(22, 238, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(22, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(22, 238, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_4 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(22, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } else { __pyx_t_4 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(22, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_converged, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(22, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_reason = __pyx_t_3; __pyx_t_3 = 0; /* "petsc4py/PETSc/petscksp.pxi":239 * (converged, args, kargs) = Ksp.get_attr('__converged__') * reason = converged(Ksp, toInt(its), toReal(rnm), *args, **kargs) * if reason is None: r[0] = KSP_CONVERGED_ITERATING # <<<<<<<<<<<<<< * elif reason is False: r[0] = KSP_CONVERGED_ITERATING * elif reason is True: r[0] = KSP_CONVERGED_ITS # XXX ? */ __pyx_t_7 = (__pyx_v_reason == Py_None); if (__pyx_t_7) { (__pyx_v_r[0]) = KSP_CONVERGED_ITERATING; goto __pyx_L5; } /* "petsc4py/PETSc/petscksp.pxi":240 * reason = converged(Ksp, toInt(its), toReal(rnm), *args, **kargs) * if reason is None: r[0] = KSP_CONVERGED_ITERATING * elif reason is False: r[0] = KSP_CONVERGED_ITERATING # <<<<<<<<<<<<<< * elif reason is True: r[0] = KSP_CONVERGED_ITS # XXX ? * else: r[0] = reason */ __pyx_t_7 = (__pyx_v_reason == Py_False); if (__pyx_t_7) { (__pyx_v_r[0]) = KSP_CONVERGED_ITERATING; goto __pyx_L5; } /* "petsc4py/PETSc/petscksp.pxi":241 * if reason is None: r[0] = KSP_CONVERGED_ITERATING * elif reason is False: r[0] = KSP_CONVERGED_ITERATING * elif reason is True: r[0] = KSP_CONVERGED_ITS # XXX ? # <<<<<<<<<<<<<< * else: r[0] = reason * return PETSC_SUCCESS */ __pyx_t_7 = (__pyx_v_reason == Py_True); if (__pyx_t_7) { (__pyx_v_r[0]) = KSP_CONVERGED_ITS; goto __pyx_L5; } /* "petsc4py/PETSc/petscksp.pxi":242 * elif reason is False: r[0] = KSP_CONVERGED_ITERATING * elif reason is True: r[0] = KSP_CONVERGED_ITS # XXX ? * else: r[0] = reason # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ /*else*/ { __pyx_t_8 = ((KSPConvergedReason)__Pyx_PyInt_As_KSPConvergedReason(__pyx_v_reason)); if (unlikely(PyErr_Occurred())) __PYX_ERR(22, 242, __pyx_L1_error) (__pyx_v_r[0]) = __pyx_t_8; } __pyx_L5:; /* "petsc4py/PETSc/petscksp.pxi":243 * elif reason is True: r[0] = KSP_CONVERGED_ITS # XXX ? * else: r[0] = reason * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * # ----------------------------------------------------------------------------- */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petscksp.pxi":229 * # ----------------------------------------------------------------------------- * * cdef PetscErrorCode KSP_Converged( # <<<<<<<<<<<<<< * PetscKSP ksp, * PetscInt its, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.KSP_Converged", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Ksp); __Pyx_XDECREF(__pyx_v_converged); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XDECREF(__pyx_v_reason); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petscksp.pxi":247 * # ----------------------------------------------------------------------------- * * cdef PetscErrorCode KSP_Monitor( # <<<<<<<<<<<<<< * PetscKSP ksp, * PetscInt its, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_KSP_Monitor(KSP __pyx_v_ksp, PetscInt __pyx_v_its, PetscReal __pyx_v_rnm, CYTHON_UNUSED void *__pyx_v_ctx) { struct PyPetscKSPObject *__pyx_v_Ksp = 0; PyObject *__pyx_v_monitorlist = 0; PyObject *__pyx_v_monitor = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; Py_ssize_t __pyx_t_3; PyObject *(*__pyx_t_4)(PyObject *); PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *(*__pyx_t_10)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("KSP_Monitor", 0); /* "petsc4py/PETSc/petscksp.pxi":253 * void* ctx, * ) except PETSC_ERR_PYTHON with gil: * cdef KSP Ksp = ref_KSP(ksp) # <<<<<<<<<<<<<< * cdef object monitorlist = Ksp.get_attr('__monitor__') * if monitorlist is None: return PETSC_SUCCESS */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_KSP(__pyx_v_ksp)); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Ksp = ((struct PyPetscKSPObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscksp.pxi":254 * ) except PETSC_ERR_PYTHON with gil: * cdef KSP Ksp = ref_KSP(ksp) * cdef object monitorlist = Ksp.get_attr('__monitor__') # <<<<<<<<<<<<<< * if monitorlist is None: return PETSC_SUCCESS * for (monitor, args, kargs) in monitorlist: */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_KSP *)__pyx_v_Ksp->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Ksp), ((char *)"__monitor__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_monitorlist = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/petscksp.pxi":255 * cdef KSP Ksp = ref_KSP(ksp) * cdef object monitorlist = Ksp.get_attr('__monitor__') * if monitorlist is None: return PETSC_SUCCESS # <<<<<<<<<<<<<< * for (monitor, args, kargs) in monitorlist: * monitor(Ksp, toInt(its), toReal(rnm), *args, **kargs) */ __pyx_t_2 = (__pyx_v_monitorlist == Py_None); if (__pyx_t_2) { __pyx_r = PETSC_SUCCESS; goto __pyx_L0; } /* "petsc4py/PETSc/petscksp.pxi":256 * cdef object monitorlist = Ksp.get_attr('__monitor__') * if monitorlist is None: return PETSC_SUCCESS * for (monitor, args, kargs) in monitorlist: # <<<<<<<<<<<<<< * monitor(Ksp, toInt(its), toReal(rnm), *args, **kargs) * return PETSC_SUCCESS */ if (likely(PyList_CheckExact(__pyx_v_monitorlist)) || PyTuple_CheckExact(__pyx_v_monitorlist)) { __pyx_t_1 = __pyx_v_monitorlist; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_monitorlist); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(22, 256, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(22, 256, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(22, 256, __pyx_L1_error) #else __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(22, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(22, 256, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(22, 256, __pyx_L1_error) #else __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(22, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } } else { __pyx_t_5 = __pyx_t_4(__pyx_t_1); if (unlikely(!__pyx_t_5)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(22, 256, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_5); } if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) { PyObject* sequence = __pyx_t_5; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(22, 256, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_6 = PyList_GET_ITEM(sequence, 0); __pyx_t_7 = PyList_GET_ITEM(sequence, 1); __pyx_t_8 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); #else __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(22, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(22, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_8)) __PYX_ERR(22, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); #endif __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { Py_ssize_t index = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(22, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_10 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); index = 0; __pyx_t_6 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_6)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); index = 1; __pyx_t_7 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_7)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_7); index = 2; __pyx_t_8 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 3) < 0) __PYX_ERR(22, 256, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L7_unpacking_done; __pyx_L6_unpacking_failed:; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(22, 256, __pyx_L1_error) __pyx_L7_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_monitor, __pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF_SET(__pyx_v_args, __pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF_SET(__pyx_v_kargs, __pyx_t_8); __pyx_t_8 = 0; /* "petsc4py/PETSc/petscksp.pxi":257 * if monitorlist is None: return PETSC_SUCCESS * for (monitor, args, kargs) in monitorlist: * monitor(Ksp, toInt(its), toReal(rnm), *args, **kargs) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_its); if (unlikely(!__pyx_t_5)) __PYX_ERR(22, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_rnm); if (unlikely(!__pyx_t_8)) __PYX_ERR(22, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(22, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF((PyObject *)__pyx_v_Ksp); __Pyx_GIVEREF((PyObject *)__pyx_v_Ksp); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_v_Ksp))) __PYX_ERR(22, 257, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_5)) __PYX_ERR(22, 257, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_8)) __PYX_ERR(22, 257, __pyx_L1_error); __pyx_t_5 = 0; __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_8)) __PYX_ERR(22, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_5 = PyNumber_Add(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(22, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(22, 257, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_8 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_8)) __PYX_ERR(22, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } else { __pyx_t_8 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_8)) __PYX_ERR(22, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } __pyx_t_7 = __Pyx_PyObject_Call(__pyx_v_monitor, __pyx_t_5, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(22, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "petsc4py/PETSc/petscksp.pxi":256 * cdef object monitorlist = Ksp.get_attr('__monitor__') * if monitorlist is None: return PETSC_SUCCESS * for (monitor, args, kargs) in monitorlist: # <<<<<<<<<<<<<< * monitor(Ksp, toInt(its), toReal(rnm), *args, **kargs) * return PETSC_SUCCESS */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscksp.pxi":258 * for (monitor, args, kargs) in monitorlist: * monitor(Ksp, toInt(its), toReal(rnm), *args, **kargs) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * # ----------------------------------------------------------------------------- */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petscksp.pxi":247 * # ----------------------------------------------------------------------------- * * cdef PetscErrorCode KSP_Monitor( # <<<<<<<<<<<<<< * PetscKSP ksp, * PetscInt its, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("petsc4py.PETSc.KSP_Monitor", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Ksp); __Pyx_XDECREF(__pyx_v_monitorlist); __Pyx_XDECREF(__pyx_v_monitor); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petscksp.pxi":262 * # ----------------------------------------------------------------------------- * * cdef PetscErrorCode KSP_ComputeRHS( # <<<<<<<<<<<<<< * PetscKSP ksp, * PetscVec rhs, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_KSP_ComputeRHS(KSP __pyx_v_ksp, Vec __pyx_v_rhs, void *__pyx_v_ctx) { struct PyPetscKSPObject *__pyx_v_Ksp = 0; struct PyPetscVecObject *__pyx_v_Rhs = 0; PyObject *__pyx_v_context = 0; PyObject *__pyx_v_computerhs = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("KSP_ComputeRHS", 0); /* "petsc4py/PETSc/petscksp.pxi":267 * void* ctx, * ) except PETSC_ERR_PYTHON with gil: * cdef KSP Ksp = ref_KSP(ksp) # <<<<<<<<<<<<<< * cdef Vec Rhs = ref_Vec(rhs) * cdef object context = Ksp.get_attr('__rhs__') */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_KSP(__pyx_v_ksp)); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Ksp = ((struct PyPetscKSPObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscksp.pxi":268 * ) except PETSC_ERR_PYTHON with gil: * cdef KSP Ksp = ref_KSP(ksp) * cdef Vec Rhs = ref_Vec(rhs) # <<<<<<<<<<<<<< * cdef object context = Ksp.get_attr('__rhs__') * if context is None and ctx != NULL: context = ctx */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_rhs)); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Rhs = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscksp.pxi":269 * cdef KSP Ksp = ref_KSP(ksp) * cdef Vec Rhs = ref_Vec(rhs) * cdef object context = Ksp.get_attr('__rhs__') # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_KSP *)__pyx_v_Ksp->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Ksp), ((char *)"__rhs__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/petscksp.pxi":270 * cdef Vec Rhs = ref_Vec(rhs) * cdef object context = Ksp.get_attr('__rhs__') * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple # sanity check * (computerhs, args, kargs) = context */ __pyx_t_3 = (__pyx_v_context == Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = (__pyx_v_ctx != NULL); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1); __pyx_t_1 = 0; } /* "petsc4py/PETSc/petscksp.pxi":271 * cdef object context = Ksp.get_attr('__rhs__') * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check # <<<<<<<<<<<<<< * (computerhs, args, kargs) = context * computerhs(Ksp, Rhs, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_3 = (__pyx_v_context != Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_2 = __pyx_t_3; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(22, 271, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(22, 271, __pyx_L1_error) #endif /* "petsc4py/PETSc/petscksp.pxi":272 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check * (computerhs, args, kargs) = context # <<<<<<<<<<<<<< * computerhs(Ksp, Rhs, *args, **kargs) * return PETSC_SUCCESS */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(22, 272, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); __pyx_t_5 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(22, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(22, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_6)) __PYX_ERR(22, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); index = 0; __pyx_t_1 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 2; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(22, 272, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(22, 272, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_computerhs = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_kargs = __pyx_t_5; __pyx_t_5 = 0; /* "petsc4py/PETSc/petscksp.pxi":273 * assert context is not None and type(context) is tuple # sanity check * (computerhs, args, kargs) = context * computerhs(Ksp, Rhs, *args, **kargs) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(22, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF((PyObject *)__pyx_v_Ksp); __Pyx_GIVEREF((PyObject *)__pyx_v_Ksp); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_Ksp))) __PYX_ERR(22, 273, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_Rhs); __Pyx_GIVEREF((PyObject *)__pyx_v_Rhs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_Rhs))) __PYX_ERR(22, 273, __pyx_L1_error); __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(22, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(22, 273, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_4 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(22, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } else { __pyx_t_4 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(22, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_computerhs, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(22, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/petscksp.pxi":274 * (computerhs, args, kargs) = context * computerhs(Ksp, Rhs, *args, **kargs) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * cdef PetscErrorCode KSP_ComputeOps( */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petscksp.pxi":262 * # ----------------------------------------------------------------------------- * * cdef PetscErrorCode KSP_ComputeRHS( # <<<<<<<<<<<<<< * PetscKSP ksp, * PetscVec rhs, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.KSP_ComputeRHS", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Ksp); __Pyx_XDECREF((PyObject *)__pyx_v_Rhs); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_computerhs); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petscksp.pxi":276 * return PETSC_SUCCESS * * cdef PetscErrorCode KSP_ComputeOps( # <<<<<<<<<<<<<< * PetscKSP ksp, * PetscMat A, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_KSP_ComputeOps(KSP __pyx_v_ksp, Mat __pyx_v_A, Mat __pyx_v_B, void *__pyx_v_ctx) { struct PyPetscKSPObject *__pyx_v_Ksp = 0; struct PyPetscMatObject *__pyx_v_Amat = 0; struct PyPetscMatObject *__pyx_v_Bmat = 0; PyObject *__pyx_v_context = 0; PyObject *__pyx_v_computeops = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("KSP_ComputeOps", 0); /* "petsc4py/PETSc/petscksp.pxi":282 * void* ctx, * ) except PETSC_ERR_PYTHON with gil: * cdef KSP Ksp = ref_KSP(ksp) # <<<<<<<<<<<<<< * cdef Mat Amat = ref_Mat(A) * cdef Mat Bmat = ref_Mat(B) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_KSP(__pyx_v_ksp)); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Ksp = ((struct PyPetscKSPObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscksp.pxi":283 * ) except PETSC_ERR_PYTHON with gil: * cdef KSP Ksp = ref_KSP(ksp) * cdef Mat Amat = ref_Mat(A) # <<<<<<<<<<<<<< * cdef Mat Bmat = ref_Mat(B) * cdef object context = Ksp.get_attr('__operators__') */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v_A)); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Amat = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscksp.pxi":284 * cdef KSP Ksp = ref_KSP(ksp) * cdef Mat Amat = ref_Mat(A) * cdef Mat Bmat = ref_Mat(B) # <<<<<<<<<<<<<< * cdef object context = Ksp.get_attr('__operators__') * if context is None and ctx != NULL: context = ctx */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v_B)); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Bmat = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscksp.pxi":285 * cdef Mat Amat = ref_Mat(A) * cdef Mat Bmat = ref_Mat(B) * cdef object context = Ksp.get_attr('__operators__') # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_KSP *)__pyx_v_Ksp->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Ksp), ((char *)"__operators__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/petscksp.pxi":286 * cdef Mat Bmat = ref_Mat(B) * cdef object context = Ksp.get_attr('__operators__') * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple # sanity check * (computeops, args, kargs) = context */ __pyx_t_3 = (__pyx_v_context == Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = (__pyx_v_ctx != NULL); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1); __pyx_t_1 = 0; } /* "petsc4py/PETSc/petscksp.pxi":287 * cdef object context = Ksp.get_attr('__operators__') * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check # <<<<<<<<<<<<<< * (computeops, args, kargs) = context * computeops(Ksp, Amat, Bmat, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_3 = (__pyx_v_context != Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_2 = __pyx_t_3; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(22, 287, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(22, 287, __pyx_L1_error) #endif /* "petsc4py/PETSc/petscksp.pxi":288 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check * (computeops, args, kargs) = context # <<<<<<<<<<<<<< * computeops(Ksp, Amat, Bmat, *args, **kargs) * return PETSC_SUCCESS */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(22, 288, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); __pyx_t_5 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(22, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(22, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_6)) __PYX_ERR(22, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); index = 0; __pyx_t_1 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 2; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(22, 288, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(22, 288, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_computeops = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_kargs = __pyx_t_5; __pyx_t_5 = 0; /* "petsc4py/PETSc/petscksp.pxi":289 * assert context is not None and type(context) is tuple # sanity check * (computeops, args, kargs) = context * computeops(Ksp, Amat, Bmat, *args, **kargs) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(22, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF((PyObject *)__pyx_v_Ksp); __Pyx_GIVEREF((PyObject *)__pyx_v_Ksp); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_Ksp))) __PYX_ERR(22, 289, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_Amat); __Pyx_GIVEREF((PyObject *)__pyx_v_Amat); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_Amat))) __PYX_ERR(22, 289, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_Bmat); __Pyx_GIVEREF((PyObject *)__pyx_v_Bmat); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, ((PyObject *)__pyx_v_Bmat))) __PYX_ERR(22, 289, __pyx_L1_error); __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(22, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(22, 289, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_4 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(22, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } else { __pyx_t_4 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(22, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_computeops, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(22, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/petscksp.pxi":290 * (computeops, args, kargs) = context * computeops(Ksp, Amat, Bmat, *args, **kargs) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * # ----------------------------------------------------------------------------- */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petscksp.pxi":276 * return PETSC_SUCCESS * * cdef PetscErrorCode KSP_ComputeOps( # <<<<<<<<<<<<<< * PetscKSP ksp, * PetscMat A, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.KSP_ComputeOps", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Ksp); __Pyx_XDECREF((PyObject *)__pyx_v_Amat); __Pyx_XDECREF((PyObject *)__pyx_v_Bmat); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_computeops); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petscsnes.pxi":264 * # ----------------------------------------------------------------------------- * * cdef inline SNES ref_SNES(PetscSNES snes): # <<<<<<<<<<<<<< * cdef SNES ob = SNES() * ob.snes = snes */ static CYTHON_INLINE struct PyPetscSNESObject *__pyx_f_8petsc4py_5PETSc_ref_SNES(SNES __pyx_v_snes) { struct PyPetscSNESObject *__pyx_v_ob = 0; struct PyPetscSNESObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("ref_SNES", 1); /* "petsc4py/PETSc/petscsnes.pxi":265 * * cdef inline SNES ref_SNES(PetscSNES snes): * cdef SNES ob = SNES() # <<<<<<<<<<<<<< * ob.snes = snes * CHKERR( PetscINCREF(ob.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SNES)); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_ob = ((struct PyPetscSNESObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscsnes.pxi":266 * cdef inline SNES ref_SNES(PetscSNES snes): * cdef SNES ob = SNES() * ob.snes = snes # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(ob.obj) ) * return ob */ __pyx_v_ob->snes = __pyx_v_snes; /* "petsc4py/PETSc/petscsnes.pxi":267 * cdef SNES ob = SNES() * ob.snes = snes * CHKERR( PetscINCREF(ob.obj) ) # <<<<<<<<<<<<<< * return ob * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ob->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(23, 267, __pyx_L1_error) /* "petsc4py/PETSc/petscsnes.pxi":268 * ob.snes = snes * CHKERR( PetscINCREF(ob.obj) ) * return ob # <<<<<<<<<<<<<< * * # ----------------------------------------------------------------------------- */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_ob); __pyx_r = __pyx_v_ob; goto __pyx_L0; /* "petsc4py/PETSc/petscsnes.pxi":264 * # ----------------------------------------------------------------------------- * * cdef inline SNES ref_SNES(PetscSNES snes): # <<<<<<<<<<<<<< * cdef SNES ob = SNES() * ob.snes = snes */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.ref_SNES", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscsnes.pxi":272 * # ----------------------------------------------------------------------------- * * cdef PetscErrorCode SNES_InitialGuess( # <<<<<<<<<<<<<< * PetscSNES snes, * PetscVec x, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNES_InitialGuess(SNES __pyx_v_snes, Vec __pyx_v_x, void *__pyx_v_ctx) { struct PyPetscSNESObject *__pyx_v_Snes = 0; struct PyPetscVecObject *__pyx_v_Xvec = 0; PyObject *__pyx_v_context = 0; PyObject *__pyx_v_initialguess = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("SNES_InitialGuess", 0); /* "petsc4py/PETSc/petscsnes.pxi":277 * void* ctx, * ) except PETSC_ERR_PYTHON with gil: * cdef SNES Snes = ref_SNES(snes) # <<<<<<<<<<<<<< * cdef Vec Xvec = ref_Vec(x) * cdef object context = Snes.get_attr('__initialguess__') */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_SNES(__pyx_v_snes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Snes = ((struct PyPetscSNESObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscsnes.pxi":278 * ) except PETSC_ERR_PYTHON with gil: * cdef SNES Snes = ref_SNES(snes) * cdef Vec Xvec = ref_Vec(x) # <<<<<<<<<<<<<< * cdef object context = Snes.get_attr('__initialguess__') * if context is None and ctx != NULL: context = ctx */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Xvec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscsnes.pxi":279 * cdef SNES Snes = ref_SNES(snes) * cdef Vec Xvec = ref_Vec(x) * cdef object context = Snes.get_attr('__initialguess__') # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_Snes->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Snes), ((char *)"__initialguess__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/petscsnes.pxi":280 * cdef Vec Xvec = ref_Vec(x) * cdef object context = Snes.get_attr('__initialguess__') * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple # sanity check * (initialguess, args, kargs) = context */ __pyx_t_3 = (__pyx_v_context == Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = (__pyx_v_ctx != NULL); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1); __pyx_t_1 = 0; } /* "petsc4py/PETSc/petscsnes.pxi":281 * cdef object context = Snes.get_attr('__initialguess__') * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check # <<<<<<<<<<<<<< * (initialguess, args, kargs) = context * initialguess(Snes, Xvec, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_3 = (__pyx_v_context != Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_2 = __pyx_t_3; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(23, 281, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(23, 281, __pyx_L1_error) #endif /* "petsc4py/PETSc/petscsnes.pxi":282 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check * (initialguess, args, kargs) = context # <<<<<<<<<<<<<< * initialguess(Snes, Xvec, *args, **kargs) * return PETSC_SUCCESS */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(23, 282, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); __pyx_t_5 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_6)) __PYX_ERR(23, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); index = 0; __pyx_t_1 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 2; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(23, 282, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(23, 282, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_initialguess = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_kargs = __pyx_t_5; __pyx_t_5 = 0; /* "petsc4py/PETSc/petscsnes.pxi":283 * assert context is not None and type(context) is tuple # sanity check * (initialguess, args, kargs) = context * initialguess(Snes, Xvec, *args, **kargs) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF((PyObject *)__pyx_v_Snes); __Pyx_GIVEREF((PyObject *)__pyx_v_Snes); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_Snes))) __PYX_ERR(23, 283, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_Xvec); __Pyx_GIVEREF((PyObject *)__pyx_v_Xvec); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_Xvec))) __PYX_ERR(23, 283, __pyx_L1_error); __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(23, 283, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_4 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } else { __pyx_t_4 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_initialguess, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/petscsnes.pxi":284 * (initialguess, args, kargs) = context * initialguess(Snes, Xvec, *args, **kargs) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * # ----------------------------------------------------------------------------- */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petscsnes.pxi":272 * # ----------------------------------------------------------------------------- * * cdef PetscErrorCode SNES_InitialGuess( # <<<<<<<<<<<<<< * PetscSNES snes, * PetscVec x, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.SNES_InitialGuess", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Snes); __Pyx_XDECREF((PyObject *)__pyx_v_Xvec); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_initialguess); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petscsnes.pxi":288 * # ----------------------------------------------------------------------------- * * cdef PetscErrorCode SNES_PreCheck( # <<<<<<<<<<<<<< * PetscSNESLineSearch linesearch, * PetscVec x, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNES_PreCheck(SNESLineSearch __pyx_v_linesearch, Vec __pyx_v_x, Vec __pyx_v_y, PetscBool *__pyx_v_changed, void *__pyx_v_ctx) { SNES __pyx_v_snes; PyObject *__pyx_v_b = 0; struct PyPetscSNESObject *__pyx_v_Snes = 0; struct PyPetscVecObject *__pyx_v_Xvec = 0; struct PyPetscVecObject *__pyx_v_Yvec = 0; PyObject *__pyx_v_context = 0; PyObject *__pyx_v_precheck = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); PetscBool __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("SNES_PreCheck", 0); /* "petsc4py/PETSc/petscsnes.pxi":295 * void* ctx * ) except PETSC_ERR_PYTHON with gil: * cdef PetscSNES snes = NULL; # <<<<<<<<<<<<<< * CHKERR( SNESLineSearchGetSNES(linesearch, &snes) ); * cdef object b = False */ __pyx_v_snes = NULL; /* "petsc4py/PETSc/petscsnes.pxi":296 * ) except PETSC_ERR_PYTHON with gil: * cdef PetscSNES snes = NULL; * CHKERR( SNESLineSearchGetSNES(linesearch, &snes) ); # <<<<<<<<<<<<<< * cdef object b = False * cdef SNES Snes = ref_SNES(snes) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESLineSearchGetSNES(__pyx_v_linesearch, (&__pyx_v_snes))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(23, 296, __pyx_L1_error) /* "petsc4py/PETSc/petscsnes.pxi":297 * cdef PetscSNES snes = NULL; * CHKERR( SNESLineSearchGetSNES(linesearch, &snes) ); * cdef object b = False # <<<<<<<<<<<<<< * cdef SNES Snes = ref_SNES(snes) * cdef Vec Xvec = ref_Vec(x) */ __Pyx_INCREF(Py_False); __pyx_v_b = Py_False; /* "petsc4py/PETSc/petscsnes.pxi":298 * CHKERR( SNESLineSearchGetSNES(linesearch, &snes) ); * cdef object b = False * cdef SNES Snes = ref_SNES(snes) # <<<<<<<<<<<<<< * cdef Vec Xvec = ref_Vec(x) * cdef Vec Yvec = ref_Vec(y) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_SNES(__pyx_v_snes)); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_Snes = ((struct PyPetscSNESObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscsnes.pxi":299 * cdef object b = False * cdef SNES Snes = ref_SNES(snes) * cdef Vec Xvec = ref_Vec(x) # <<<<<<<<<<<<<< * cdef Vec Yvec = ref_Vec(y) * cdef object context = Snes.get_attr('__precheck__') */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_x)); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_Xvec = ((struct PyPetscVecObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscsnes.pxi":300 * cdef SNES Snes = ref_SNES(snes) * cdef Vec Xvec = ref_Vec(x) * cdef Vec Yvec = ref_Vec(y) # <<<<<<<<<<<<<< * cdef object context = Snes.get_attr('__precheck__') * if context is None and ctx != NULL: context = ctx */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_y)); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_Yvec = ((struct PyPetscVecObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscsnes.pxi":301 * cdef Vec Xvec = ref_Vec(x) * cdef Vec Yvec = ref_Vec(y) * cdef object context = Snes.get_attr('__precheck__') # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_Snes->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Snes), ((char *)"__precheck__")); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_context = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/petscsnes.pxi":302 * cdef Vec Yvec = ref_Vec(y) * cdef object context = Snes.get_attr('__precheck__') * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple # sanity check * (precheck, args, kargs) = context */ __pyx_t_4 = (__pyx_v_context == Py_None); if (__pyx_t_4) { } else { __pyx_t_3 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = (__pyx_v_ctx != NULL); __pyx_t_3 = __pyx_t_4; __pyx_L4_bool_binop_done:; if (__pyx_t_3) { __pyx_t_2 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_2); __pyx_t_2 = 0; } /* "petsc4py/PETSc/petscsnes.pxi":303 * cdef object context = Snes.get_attr('__precheck__') * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check # <<<<<<<<<<<<<< * (precheck, args, kargs) = context * b = precheck(Xvec, Yvec, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_4 = (__pyx_v_context != Py_None); if (__pyx_t_4) { } else { __pyx_t_3 = __pyx_t_4; goto __pyx_L6_bool_binop_done; } __pyx_t_4 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_3 = __pyx_t_4; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_3)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(23, 303, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(23, 303, __pyx_L1_error) #endif /* "petsc4py/PETSc/petscsnes.pxi":304 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check * (precheck, args, kargs) = context # <<<<<<<<<<<<<< * b = precheck(Xvec, Yvec, *args, **kargs) * changed[0] = asBool(b) */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(23, 304, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(23, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(23, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); index = 0; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(23, 304, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(23, 304, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_precheck = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_args = __pyx_t_5; __pyx_t_5 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "petsc4py/PETSc/petscsnes.pxi":305 * assert context is not None and type(context) is tuple # sanity check * (precheck, args, kargs) = context * b = precheck(Xvec, Yvec, *args, **kargs) # <<<<<<<<<<<<<< * changed[0] = asBool(b) * return PETSC_SUCCESS */ __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(23, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF((PyObject *)__pyx_v_Xvec); __Pyx_GIVEREF((PyObject *)__pyx_v_Xvec); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_Xvec))) __PYX_ERR(23, 305, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_Yvec); __Pyx_GIVEREF((PyObject *)__pyx_v_Yvec); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_Yvec))) __PYX_ERR(23, 305, __pyx_L1_error); __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = PyNumber_Add(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(23, 305, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_5 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } else { __pyx_t_5 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_precheck, __pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(23, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_b, __pyx_t_6); __pyx_t_6 = 0; /* "petsc4py/PETSc/petscsnes.pxi":306 * (precheck, args, kargs) = context * b = precheck(Xvec, Yvec, *args, **kargs) * changed[0] = asBool(b) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_asBool(__pyx_v_b); if (unlikely(__pyx_t_9 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(23, 306, __pyx_L1_error) (__pyx_v_changed[0]) = __pyx_t_9; /* "petsc4py/PETSc/petscsnes.pxi":307 * b = precheck(Xvec, Yvec, *args, **kargs) * changed[0] = asBool(b) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * # ----------------------------------------------------------------------------- */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petscsnes.pxi":288 * # ----------------------------------------------------------------------------- * * cdef PetscErrorCode SNES_PreCheck( # <<<<<<<<<<<<<< * PetscSNESLineSearch linesearch, * PetscVec x, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.SNES_PreCheck", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_b); __Pyx_XDECREF((PyObject *)__pyx_v_Snes); __Pyx_XDECREF((PyObject *)__pyx_v_Xvec); __Pyx_XDECREF((PyObject *)__pyx_v_Yvec); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_precheck); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petscsnes.pxi":312 * * * cdef PetscErrorCode SNES_Function( # <<<<<<<<<<<<<< * PetscSNES snes, * PetscVec x, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNES_Function(SNES __pyx_v_snes, Vec __pyx_v_x, Vec __pyx_v_f, void *__pyx_v_ctx) { struct PyPetscSNESObject *__pyx_v_Snes = 0; struct PyPetscVecObject *__pyx_v_Xvec = 0; struct PyPetscVecObject *__pyx_v_Fvec = 0; PyObject *__pyx_v_context = 0; PyObject *__pyx_v_function = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("SNES_Function", 0); /* "petsc4py/PETSc/petscsnes.pxi":318 * void* ctx, * ) except PETSC_ERR_PYTHON with gil: * cdef SNES Snes = ref_SNES(snes) # <<<<<<<<<<<<<< * cdef Vec Xvec = ref_Vec(x) * cdef Vec Fvec = ref_Vec(f) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_SNES(__pyx_v_snes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Snes = ((struct PyPetscSNESObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscsnes.pxi":319 * ) except PETSC_ERR_PYTHON with gil: * cdef SNES Snes = ref_SNES(snes) * cdef Vec Xvec = ref_Vec(x) # <<<<<<<<<<<<<< * cdef Vec Fvec = ref_Vec(f) * cdef object context = Snes.get_attr('__function__') */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Xvec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscsnes.pxi":320 * cdef SNES Snes = ref_SNES(snes) * cdef Vec Xvec = ref_Vec(x) * cdef Vec Fvec = ref_Vec(f) # <<<<<<<<<<<<<< * cdef object context = Snes.get_attr('__function__') * if context is None and ctx != NULL: context = ctx */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_f)); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Fvec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscsnes.pxi":321 * cdef Vec Xvec = ref_Vec(x) * cdef Vec Fvec = ref_Vec(f) * cdef object context = Snes.get_attr('__function__') # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_Snes->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Snes), ((char *)"__function__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/petscsnes.pxi":322 * cdef Vec Fvec = ref_Vec(f) * cdef object context = Snes.get_attr('__function__') * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple # sanity check * (function, args, kargs) = context */ __pyx_t_3 = (__pyx_v_context == Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = (__pyx_v_ctx != NULL); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1); __pyx_t_1 = 0; } /* "petsc4py/PETSc/petscsnes.pxi":323 * cdef object context = Snes.get_attr('__function__') * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check # <<<<<<<<<<<<<< * (function, args, kargs) = context * function(Snes, Xvec, Fvec, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_3 = (__pyx_v_context != Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_2 = __pyx_t_3; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(23, 323, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(23, 323, __pyx_L1_error) #endif /* "petsc4py/PETSc/petscsnes.pxi":324 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check * (function, args, kargs) = context # <<<<<<<<<<<<<< * function(Snes, Xvec, Fvec, *args, **kargs) * return PETSC_SUCCESS */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(23, 324, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); __pyx_t_5 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 324, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 324, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 324, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_6)) __PYX_ERR(23, 324, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); index = 0; __pyx_t_1 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 2; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(23, 324, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(23, 324, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_function = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_kargs = __pyx_t_5; __pyx_t_5 = 0; /* "petsc4py/PETSc/petscsnes.pxi":325 * assert context is not None and type(context) is tuple # sanity check * (function, args, kargs) = context * function(Snes, Xvec, Fvec, *args, **kargs) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF((PyObject *)__pyx_v_Snes); __Pyx_GIVEREF((PyObject *)__pyx_v_Snes); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_Snes))) __PYX_ERR(23, 325, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_Xvec); __Pyx_GIVEREF((PyObject *)__pyx_v_Xvec); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_Xvec))) __PYX_ERR(23, 325, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_Fvec); __Pyx_GIVEREF((PyObject *)__pyx_v_Fvec); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, ((PyObject *)__pyx_v_Fvec))) __PYX_ERR(23, 325, __pyx_L1_error); __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(23, 325, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_4 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } else { __pyx_t_4 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_function, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/petscsnes.pxi":326 * (function, args, kargs) = context * function(Snes, Xvec, Fvec, *args, **kargs) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * # ----------------------------------------------------------------------------- */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petscsnes.pxi":312 * * * cdef PetscErrorCode SNES_Function( # <<<<<<<<<<<<<< * PetscSNES snes, * PetscVec x, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.SNES_Function", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Snes); __Pyx_XDECREF((PyObject *)__pyx_v_Xvec); __Pyx_XDECREF((PyObject *)__pyx_v_Fvec); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_function); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petscsnes.pxi":330 * # ----------------------------------------------------------------------------- * * cdef PetscErrorCode SNES_Update( # <<<<<<<<<<<<<< * PetscSNES snes, * PetscInt its, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNES_Update(SNES __pyx_v_snes, PetscInt __pyx_v_its) { struct PyPetscSNESObject *__pyx_v_Snes = 0; PyObject *__pyx_v_context = 0; PyObject *__pyx_v_update = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("SNES_Update", 0); /* "petsc4py/PETSc/petscsnes.pxi":334 * PetscInt its, * ) except PETSC_ERR_PYTHON with gil: * cdef SNES Snes = ref_SNES(snes) # <<<<<<<<<<<<<< * cdef object context = Snes.get_attr('__update__') * assert context is not None and type(context) is tuple # sanity check */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_SNES(__pyx_v_snes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Snes = ((struct PyPetscSNESObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscsnes.pxi":335 * ) except PETSC_ERR_PYTHON with gil: * cdef SNES Snes = ref_SNES(snes) * cdef object context = Snes.get_attr('__update__') # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple # sanity check * (update, args, kargs) = context */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_Snes->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Snes), ((char *)"__update__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/petscsnes.pxi":336 * cdef SNES Snes = ref_SNES(snes) * cdef object context = Snes.get_attr('__update__') * assert context is not None and type(context) is tuple # sanity check # <<<<<<<<<<<<<< * (update, args, kargs) = context * update(Snes, toInt(its), *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_3 = (__pyx_v_context != Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L3_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_2 = __pyx_t_3; __pyx_L3_bool_binop_done:; if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(23, 336, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(23, 336, __pyx_L1_error) #endif /* "petsc4py/PETSc/petscsnes.pxi":337 * cdef object context = Snes.get_attr('__update__') * assert context is not None and type(context) is tuple # sanity check * (update, args, kargs) = context # <<<<<<<<<<<<<< * update(Snes, toInt(its), *args, **kargs) * return PETSC_SUCCESS */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(23, 337, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); __pyx_t_5 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_6)) __PYX_ERR(23, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); index = 0; __pyx_t_1 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 2; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(23, 337, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(23, 337, __pyx_L1_error) __pyx_L6_unpacking_done:; } __pyx_v_update = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_kargs = __pyx_t_5; __pyx_t_5 = 0; /* "petsc4py/PETSc/petscsnes.pxi":338 * assert context is not None and type(context) is tuple # sanity check * (update, args, kargs) = context * update(Snes, toInt(its), *args, **kargs) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_its); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF((PyObject *)__pyx_v_Snes); __Pyx_GIVEREF((PyObject *)__pyx_v_Snes); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_Snes))) __PYX_ERR(23, 338, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5)) __PYX_ERR(23, 338, __pyx_L1_error); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(23, 338, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_5 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } else { __pyx_t_5 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_4 = __Pyx_PyObject_Call(__pyx_v_update, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/petscsnes.pxi":339 * (update, args, kargs) = context * update(Snes, toInt(its), *args, **kargs) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * # ----------------------------------------------------------------------------- */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petscsnes.pxi":330 * # ----------------------------------------------------------------------------- * * cdef PetscErrorCode SNES_Update( # <<<<<<<<<<<<<< * PetscSNES snes, * PetscInt its, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.SNES_Update", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Snes); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_update); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petscsnes.pxi":343 * # ----------------------------------------------------------------------------- * * cdef PetscErrorCode SNES_Jacobian( # <<<<<<<<<<<<<< * PetscSNES snes, * PetscVec x, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNES_Jacobian(SNES __pyx_v_snes, Vec __pyx_v_x, Mat __pyx_v_J, Mat __pyx_v_P, void *__pyx_v_ctx) { struct PyPetscSNESObject *__pyx_v_Snes = 0; struct PyPetscVecObject *__pyx_v_Xvec = 0; struct PyPetscMatObject *__pyx_v_Jmat = 0; struct PyPetscMatObject *__pyx_v_Pmat = 0; PyObject *__pyx_v_context = 0; PyObject *__pyx_v_jacobian = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("SNES_Jacobian", 0); /* "petsc4py/PETSc/petscsnes.pxi":350 * void* ctx, * ) except PETSC_ERR_PYTHON with gil: * cdef SNES Snes = ref_SNES(snes) # <<<<<<<<<<<<<< * cdef Vec Xvec = ref_Vec(x) * cdef Mat Jmat = ref_Mat(J) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_SNES(__pyx_v_snes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Snes = ((struct PyPetscSNESObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscsnes.pxi":351 * ) except PETSC_ERR_PYTHON with gil: * cdef SNES Snes = ref_SNES(snes) * cdef Vec Xvec = ref_Vec(x) # <<<<<<<<<<<<<< * cdef Mat Jmat = ref_Mat(J) * cdef Mat Pmat = ref_Mat(P) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Xvec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscsnes.pxi":352 * cdef SNES Snes = ref_SNES(snes) * cdef Vec Xvec = ref_Vec(x) * cdef Mat Jmat = ref_Mat(J) # <<<<<<<<<<<<<< * cdef Mat Pmat = ref_Mat(P) * cdef object context = Snes.get_attr('__jacobian__') */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v_J)); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Jmat = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscsnes.pxi":353 * cdef Vec Xvec = ref_Vec(x) * cdef Mat Jmat = ref_Mat(J) * cdef Mat Pmat = ref_Mat(P) # <<<<<<<<<<<<<< * cdef object context = Snes.get_attr('__jacobian__') * if context is None and ctx != NULL: context = ctx */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v_P)); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Pmat = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscsnes.pxi":354 * cdef Mat Jmat = ref_Mat(J) * cdef Mat Pmat = ref_Mat(P) * cdef object context = Snes.get_attr('__jacobian__') # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_Snes->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Snes), ((char *)"__jacobian__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/petscsnes.pxi":355 * cdef Mat Pmat = ref_Mat(P) * cdef object context = Snes.get_attr('__jacobian__') * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple # sanity check * (jacobian, args, kargs) = context */ __pyx_t_3 = (__pyx_v_context == Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = (__pyx_v_ctx != NULL); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1); __pyx_t_1 = 0; } /* "petsc4py/PETSc/petscsnes.pxi":356 * cdef object context = Snes.get_attr('__jacobian__') * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check # <<<<<<<<<<<<<< * (jacobian, args, kargs) = context * jacobian(Snes, Xvec, Jmat, Pmat, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_3 = (__pyx_v_context != Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_2 = __pyx_t_3; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(23, 356, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(23, 356, __pyx_L1_error) #endif /* "petsc4py/PETSc/petscsnes.pxi":357 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check * (jacobian, args, kargs) = context # <<<<<<<<<<<<<< * jacobian(Snes, Xvec, Jmat, Pmat, *args, **kargs) * return PETSC_SUCCESS */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(23, 357, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); __pyx_t_5 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_6)) __PYX_ERR(23, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); index = 0; __pyx_t_1 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 2; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(23, 357, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(23, 357, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_jacobian = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_kargs = __pyx_t_5; __pyx_t_5 = 0; /* "petsc4py/PETSc/petscsnes.pxi":358 * assert context is not None and type(context) is tuple # sanity check * (jacobian, args, kargs) = context * jacobian(Snes, Xvec, Jmat, Pmat, *args, **kargs) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF((PyObject *)__pyx_v_Snes); __Pyx_GIVEREF((PyObject *)__pyx_v_Snes); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_Snes))) __PYX_ERR(23, 358, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_Xvec); __Pyx_GIVEREF((PyObject *)__pyx_v_Xvec); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_Xvec))) __PYX_ERR(23, 358, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_Jmat); __Pyx_GIVEREF((PyObject *)__pyx_v_Jmat); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, ((PyObject *)__pyx_v_Jmat))) __PYX_ERR(23, 358, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_Pmat); __Pyx_GIVEREF((PyObject *)__pyx_v_Pmat); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 3, ((PyObject *)__pyx_v_Pmat))) __PYX_ERR(23, 358, __pyx_L1_error); __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(23, 358, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_4 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } else { __pyx_t_4 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_jacobian, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/petscsnes.pxi":359 * (jacobian, args, kargs) = context * jacobian(Snes, Xvec, Jmat, Pmat, *args, **kargs) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * # ----------------------------------------------------------------------------- */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petscsnes.pxi":343 * # ----------------------------------------------------------------------------- * * cdef PetscErrorCode SNES_Jacobian( # <<<<<<<<<<<<<< * PetscSNES snes, * PetscVec x, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.SNES_Jacobian", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Snes); __Pyx_XDECREF((PyObject *)__pyx_v_Xvec); __Pyx_XDECREF((PyObject *)__pyx_v_Jmat); __Pyx_XDECREF((PyObject *)__pyx_v_Pmat); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_jacobian); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petscsnes.pxi":363 * # ----------------------------------------------------------------------------- * * cdef PetscErrorCode SNES_Objective( # <<<<<<<<<<<<<< * PetscSNES snes, * PetscVec x, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNES_Objective(SNES __pyx_v_snes, Vec __pyx_v_x, PetscReal *__pyx_v_o, void *__pyx_v_ctx) { struct PyPetscSNESObject *__pyx_v_Snes = 0; struct PyPetscVecObject *__pyx_v_Xvec = 0; PyObject *__pyx_v_context = 0; PyObject *__pyx_v_objective = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PyObject *__pyx_v_obj = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); PetscReal __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("SNES_Objective", 0); /* "petsc4py/PETSc/petscsnes.pxi":369 * void* ctx, * ) except PETSC_ERR_PYTHON with gil: * cdef SNES Snes = ref_SNES(snes) # <<<<<<<<<<<<<< * cdef Vec Xvec = ref_Vec(x) * cdef object context = Snes.get_attr('__objective__') */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_SNES(__pyx_v_snes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 369, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Snes = ((struct PyPetscSNESObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscsnes.pxi":370 * ) except PETSC_ERR_PYTHON with gil: * cdef SNES Snes = ref_SNES(snes) * cdef Vec Xvec = ref_Vec(x) # <<<<<<<<<<<<<< * cdef object context = Snes.get_attr('__objective__') * if context is None and ctx != NULL: context = ctx */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 370, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Xvec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscsnes.pxi":371 * cdef SNES Snes = ref_SNES(snes) * cdef Vec Xvec = ref_Vec(x) * cdef object context = Snes.get_attr('__objective__') # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_Snes->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Snes), ((char *)"__objective__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 371, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/petscsnes.pxi":372 * cdef Vec Xvec = ref_Vec(x) * cdef object context = Snes.get_attr('__objective__') * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple # sanity check * (objective, args, kargs) = context */ __pyx_t_3 = (__pyx_v_context == Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = (__pyx_v_ctx != NULL); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1); __pyx_t_1 = 0; } /* "petsc4py/PETSc/petscsnes.pxi":373 * cdef object context = Snes.get_attr('__objective__') * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check # <<<<<<<<<<<<<< * (objective, args, kargs) = context * obj = objective(Snes, Xvec, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_3 = (__pyx_v_context != Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_2 = __pyx_t_3; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(23, 373, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(23, 373, __pyx_L1_error) #endif /* "petsc4py/PETSc/petscsnes.pxi":374 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check * (objective, args, kargs) = context # <<<<<<<<<<<<<< * obj = objective(Snes, Xvec, *args, **kargs) * o[0] = asReal(obj) */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(23, 374, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); __pyx_t_5 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_6)) __PYX_ERR(23, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); index = 0; __pyx_t_1 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 2; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(23, 374, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(23, 374, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_objective = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_kargs = __pyx_t_5; __pyx_t_5 = 0; /* "petsc4py/PETSc/petscsnes.pxi":375 * assert context is not None and type(context) is tuple # sanity check * (objective, args, kargs) = context * obj = objective(Snes, Xvec, *args, **kargs) # <<<<<<<<<<<<<< * o[0] = asReal(obj) * return PETSC_SUCCESS */ __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF((PyObject *)__pyx_v_Snes); __Pyx_GIVEREF((PyObject *)__pyx_v_Snes); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_Snes))) __PYX_ERR(23, 375, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_Xvec); __Pyx_GIVEREF((PyObject *)__pyx_v_Xvec); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_Xvec))) __PYX_ERR(23, 375, __pyx_L1_error); __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(23, 375, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_4 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } else { __pyx_t_4 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_objective, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_obj = __pyx_t_5; __pyx_t_5 = 0; /* "petsc4py/PETSc/petscsnes.pxi":376 * (objective, args, kargs) = context * obj = objective(Snes, Xvec, *args, **kargs) * o[0] = asReal(obj) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_obj); if (unlikely(__pyx_t_8 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(23, 376, __pyx_L1_error) (__pyx_v_o[0]) = __pyx_t_8; /* "petsc4py/PETSc/petscsnes.pxi":377 * obj = objective(Snes, Xvec, *args, **kargs) * o[0] = asReal(obj) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * # ----------------------------------------------------------------------------- */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petscsnes.pxi":363 * # ----------------------------------------------------------------------------- * * cdef PetscErrorCode SNES_Objective( # <<<<<<<<<<<<<< * PetscSNES snes, * PetscVec x, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.SNES_Objective", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Snes); __Pyx_XDECREF((PyObject *)__pyx_v_Xvec); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_objective); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XDECREF(__pyx_v_obj); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petscsnes.pxi":381 * # ----------------------------------------------------------------------------- * * cdef PetscErrorCode SNES_NGS( # <<<<<<<<<<<<<< * PetscSNES snes, * PetscVec x, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNES_NGS(SNES __pyx_v_snes, Vec __pyx_v_x, Vec __pyx_v_b, void *__pyx_v_ctx) { struct PyPetscSNESObject *__pyx_v_Snes = 0; struct PyPetscVecObject *__pyx_v_Xvec = 0; struct PyPetscVecObject *__pyx_v_Bvec = 0; PyObject *__pyx_v_context = 0; PyObject *__pyx_v_ngs = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("SNES_NGS", 0); /* "petsc4py/PETSc/petscsnes.pxi":387 * void* ctx, * ) except PETSC_ERR_PYTHON with gil: * cdef SNES Snes = ref_SNES(snes) # <<<<<<<<<<<<<< * cdef Vec Xvec = ref_Vec(x) * cdef Vec Bvec = ref_Vec(b) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_SNES(__pyx_v_snes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Snes = ((struct PyPetscSNESObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscsnes.pxi":388 * ) except PETSC_ERR_PYTHON with gil: * cdef SNES Snes = ref_SNES(snes) * cdef Vec Xvec = ref_Vec(x) # <<<<<<<<<<<<<< * cdef Vec Bvec = ref_Vec(b) * cdef object context = Snes.get_attr('__ngs__') */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 388, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Xvec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscsnes.pxi":389 * cdef SNES Snes = ref_SNES(snes) * cdef Vec Xvec = ref_Vec(x) * cdef Vec Bvec = ref_Vec(b) # <<<<<<<<<<<<<< * cdef object context = Snes.get_attr('__ngs__') * if context is None and ctx != NULL: context = ctx */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Bvec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscsnes.pxi":390 * cdef Vec Xvec = ref_Vec(x) * cdef Vec Bvec = ref_Vec(b) * cdef object context = Snes.get_attr('__ngs__') # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_Snes->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Snes), ((char *)"__ngs__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/petscsnes.pxi":391 * cdef Vec Bvec = ref_Vec(b) * cdef object context = Snes.get_attr('__ngs__') * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple # sanity check * (ngs, args, kargs) = context */ __pyx_t_3 = (__pyx_v_context == Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = (__pyx_v_ctx != NULL); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1); __pyx_t_1 = 0; } /* "petsc4py/PETSc/petscsnes.pxi":392 * cdef object context = Snes.get_attr('__ngs__') * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check # <<<<<<<<<<<<<< * (ngs, args, kargs) = context * ngs(Snes, Xvec, Bvec, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_3 = (__pyx_v_context != Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_2 = __pyx_t_3; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(23, 392, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(23, 392, __pyx_L1_error) #endif /* "petsc4py/PETSc/petscsnes.pxi":393 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check * (ngs, args, kargs) = context # <<<<<<<<<<<<<< * ngs(Snes, Xvec, Bvec, *args, **kargs) * return PETSC_SUCCESS */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(23, 393, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); __pyx_t_5 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_6)) __PYX_ERR(23, 393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); index = 0; __pyx_t_1 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 2; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(23, 393, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(23, 393, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_ngs = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_kargs = __pyx_t_5; __pyx_t_5 = 0; /* "petsc4py/PETSc/petscsnes.pxi":394 * assert context is not None and type(context) is tuple # sanity check * (ngs, args, kargs) = context * ngs(Snes, Xvec, Bvec, *args, **kargs) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 394, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF((PyObject *)__pyx_v_Snes); __Pyx_GIVEREF((PyObject *)__pyx_v_Snes); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_Snes))) __PYX_ERR(23, 394, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_Xvec); __Pyx_GIVEREF((PyObject *)__pyx_v_Xvec); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_Xvec))) __PYX_ERR(23, 394, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_Bvec); __Pyx_GIVEREF((PyObject *)__pyx_v_Bvec); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, ((PyObject *)__pyx_v_Bvec))) __PYX_ERR(23, 394, __pyx_L1_error); __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 394, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 394, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(23, 394, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_4 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 394, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } else { __pyx_t_4 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 394, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_ngs, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 394, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/petscsnes.pxi":395 * (ngs, args, kargs) = context * ngs(Snes, Xvec, Bvec, *args, **kargs) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * # ----------------------------------------------------------------------------- */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petscsnes.pxi":381 * # ----------------------------------------------------------------------------- * * cdef PetscErrorCode SNES_NGS( # <<<<<<<<<<<<<< * PetscSNES snes, * PetscVec x, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.SNES_NGS", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Snes); __Pyx_XDECREF((PyObject *)__pyx_v_Xvec); __Pyx_XDECREF((PyObject *)__pyx_v_Bvec); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_ngs); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petscsnes.pxi":399 * # ----------------------------------------------------------------------------- * * cdef PetscErrorCode SNES_Converged( # <<<<<<<<<<<<<< * PetscSNES snes, * PetscInt iters, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNES_Converged(SNES __pyx_v_snes, PetscInt __pyx_v_iters, PetscReal __pyx_v_xnorm, PetscReal __pyx_v_gnorm, PetscReal __pyx_v_fnorm, SNESConvergedReason *__pyx_v_r, void *__pyx_v_ctx) { struct PyPetscSNESObject *__pyx_v_Snes = 0; PyObject *__pyx_v_it = 0; PyObject *__pyx_v_xn = 0; PyObject *__pyx_v_gn = 0; PyObject *__pyx_v_fn = 0; PyObject *__pyx_v_context = 0; PyObject *__pyx_v_converged = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PyObject *__pyx_v_reason = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); SNESConvergedReason __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("SNES_Converged", 0); /* "petsc4py/PETSc/petscsnes.pxi":408 * void* ctx, * ) except PETSC_ERR_PYTHON with gil: * cdef SNES Snes = ref_SNES(snes) # <<<<<<<<<<<<<< * cdef object it = toInt(iters) * cdef object xn = toReal(xnorm) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_SNES(__pyx_v_snes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Snes = ((struct PyPetscSNESObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscsnes.pxi":409 * ) except PETSC_ERR_PYTHON with gil: * cdef SNES Snes = ref_SNES(snes) * cdef object it = toInt(iters) # <<<<<<<<<<<<<< * cdef object xn = toReal(xnorm) * cdef object gn = toReal(gnorm) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_iters); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_it = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/petscsnes.pxi":410 * cdef SNES Snes = ref_SNES(snes) * cdef object it = toInt(iters) * cdef object xn = toReal(xnorm) # <<<<<<<<<<<<<< * cdef object gn = toReal(gnorm) * cdef object fn = toReal(fnorm) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_xnorm); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_xn = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/petscsnes.pxi":411 * cdef object it = toInt(iters) * cdef object xn = toReal(xnorm) * cdef object gn = toReal(gnorm) # <<<<<<<<<<<<<< * cdef object fn = toReal(fnorm) * cdef object context = Snes.get_attr('__converged__') */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_gnorm); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_gn = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/petscsnes.pxi":412 * cdef object xn = toReal(xnorm) * cdef object gn = toReal(gnorm) * cdef object fn = toReal(fnorm) # <<<<<<<<<<<<<< * cdef object context = Snes.get_attr('__converged__') * if context is None and ctx != NULL: context = ctx */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_fnorm); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_fn = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/petscsnes.pxi":413 * cdef object gn = toReal(gnorm) * cdef object fn = toReal(fnorm) * cdef object context = Snes.get_attr('__converged__') # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_Snes->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Snes), ((char *)"__converged__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/petscsnes.pxi":414 * cdef object fn = toReal(fnorm) * cdef object context = Snes.get_attr('__converged__') * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple # sanity check * (converged, args, kargs) = context */ __pyx_t_3 = (__pyx_v_context == Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = (__pyx_v_ctx != NULL); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1); __pyx_t_1 = 0; } /* "petsc4py/PETSc/petscsnes.pxi":415 * cdef object context = Snes.get_attr('__converged__') * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check # <<<<<<<<<<<<<< * (converged, args, kargs) = context * reason = converged(Snes, it, (xn, gn, fn), *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_3 = (__pyx_v_context != Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_2 = __pyx_t_3; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(23, 415, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(23, 415, __pyx_L1_error) #endif /* "petsc4py/PETSc/petscsnes.pxi":416 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check * (converged, args, kargs) = context # <<<<<<<<<<<<<< * reason = converged(Snes, it, (xn, gn, fn), *args, **kargs) * if reason is None: r[0] = SNES_CONVERGED_ITERATING */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(23, 416, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); __pyx_t_5 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_6)) __PYX_ERR(23, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); index = 0; __pyx_t_1 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 2; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(23, 416, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(23, 416, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_converged = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_kargs = __pyx_t_5; __pyx_t_5 = 0; /* "petsc4py/PETSc/petscsnes.pxi":417 * assert context is not None and type(context) is tuple # sanity check * (converged, args, kargs) = context * reason = converged(Snes, it, (xn, gn, fn), *args, **kargs) # <<<<<<<<<<<<<< * if reason is None: r[0] = SNES_CONVERGED_ITERATING * elif reason is False: r[0] = SNES_CONVERGED_ITERATING */ __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_xn); __Pyx_GIVEREF(__pyx_v_xn); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_xn)) __PYX_ERR(23, 417, __pyx_L1_error); __Pyx_INCREF(__pyx_v_gn); __Pyx_GIVEREF(__pyx_v_gn); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_gn)) __PYX_ERR(23, 417, __pyx_L1_error); __Pyx_INCREF(__pyx_v_fn); __Pyx_GIVEREF(__pyx_v_fn); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_fn)) __PYX_ERR(23, 417, __pyx_L1_error); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF((PyObject *)__pyx_v_Snes); __Pyx_GIVEREF((PyObject *)__pyx_v_Snes); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_Snes))) __PYX_ERR(23, 417, __pyx_L1_error); __Pyx_INCREF(__pyx_v_it); __Pyx_GIVEREF(__pyx_v_it); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_it)) __PYX_ERR(23, 417, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_5)) __PYX_ERR(23, 417, __pyx_L1_error); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(23, 417, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_5 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } else { __pyx_t_5 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_4 = __Pyx_PyObject_Call(__pyx_v_converged, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_reason = __pyx_t_4; __pyx_t_4 = 0; /* "petsc4py/PETSc/petscsnes.pxi":418 * (converged, args, kargs) = context * reason = converged(Snes, it, (xn, gn, fn), *args, **kargs) * if reason is None: r[0] = SNES_CONVERGED_ITERATING # <<<<<<<<<<<<<< * elif reason is False: r[0] = SNES_CONVERGED_ITERATING * elif reason is True: r[0] = SNES_CONVERGED_ITS # XXX ? */ __pyx_t_2 = (__pyx_v_reason == Py_None); if (__pyx_t_2) { (__pyx_v_r[0]) = SNES_CONVERGED_ITERATING; goto __pyx_L10; } /* "petsc4py/PETSc/petscsnes.pxi":419 * reason = converged(Snes, it, (xn, gn, fn), *args, **kargs) * if reason is None: r[0] = SNES_CONVERGED_ITERATING * elif reason is False: r[0] = SNES_CONVERGED_ITERATING # <<<<<<<<<<<<<< * elif reason is True: r[0] = SNES_CONVERGED_ITS # XXX ? * else: r[0] = reason */ __pyx_t_2 = (__pyx_v_reason == Py_False); if (__pyx_t_2) { (__pyx_v_r[0]) = SNES_CONVERGED_ITERATING; goto __pyx_L10; } /* "petsc4py/PETSc/petscsnes.pxi":420 * if reason is None: r[0] = SNES_CONVERGED_ITERATING * elif reason is False: r[0] = SNES_CONVERGED_ITERATING * elif reason is True: r[0] = SNES_CONVERGED_ITS # XXX ? # <<<<<<<<<<<<<< * else: r[0] = reason * return PETSC_SUCCESS */ __pyx_t_2 = (__pyx_v_reason == Py_True); if (__pyx_t_2) { (__pyx_v_r[0]) = SNES_CONVERGED_ITS; goto __pyx_L10; } /* "petsc4py/PETSc/petscsnes.pxi":421 * elif reason is False: r[0] = SNES_CONVERGED_ITERATING * elif reason is True: r[0] = SNES_CONVERGED_ITS # XXX ? * else: r[0] = reason # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ /*else*/ { __pyx_t_8 = ((SNESConvergedReason)__Pyx_PyInt_As_SNESConvergedReason(__pyx_v_reason)); if (unlikely(PyErr_Occurred())) __PYX_ERR(23, 421, __pyx_L1_error) (__pyx_v_r[0]) = __pyx_t_8; } __pyx_L10:; /* "petsc4py/PETSc/petscsnes.pxi":422 * elif reason is True: r[0] = SNES_CONVERGED_ITS # XXX ? * else: r[0] = reason * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * # ----------------------------------------------------------------------------- */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petscsnes.pxi":399 * # ----------------------------------------------------------------------------- * * cdef PetscErrorCode SNES_Converged( # <<<<<<<<<<<<<< * PetscSNES snes, * PetscInt iters, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.SNES_Converged", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Snes); __Pyx_XDECREF(__pyx_v_it); __Pyx_XDECREF(__pyx_v_xn); __Pyx_XDECREF(__pyx_v_gn); __Pyx_XDECREF(__pyx_v_fn); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_converged); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XDECREF(__pyx_v_reason); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petscsnes.pxi":426 * # ----------------------------------------------------------------------------- * * cdef PetscErrorCode SNES_Monitor( # <<<<<<<<<<<<<< * PetscSNES snes, * PetscInt iters, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNES_Monitor(SNES __pyx_v_snes, PetscInt __pyx_v_iters, PetscReal __pyx_v_rnorm, CYTHON_UNUSED void *__pyx_v_ctx) { struct PyPetscSNESObject *__pyx_v_Snes = 0; PyObject *__pyx_v_monitorlist = 0; PyObject *__pyx_v_it = 0; PyObject *__pyx_v_rn = 0; PyObject *__pyx_v_monitor = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; Py_ssize_t __pyx_t_3; PyObject *(*__pyx_t_4)(PyObject *); PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *(*__pyx_t_10)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("SNES_Monitor", 0); /* "petsc4py/PETSc/petscsnes.pxi":432 * void* ctx, * ) except PETSC_ERR_PYTHON with gil: * cdef SNES Snes = ref_SNES(snes) # <<<<<<<<<<<<<< * cdef object monitorlist = Snes.get_attr('__monitor__') * if monitorlist is None: return PETSC_SUCCESS */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_SNES(__pyx_v_snes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 432, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Snes = ((struct PyPetscSNESObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscsnes.pxi":433 * ) except PETSC_ERR_PYTHON with gil: * cdef SNES Snes = ref_SNES(snes) * cdef object monitorlist = Snes.get_attr('__monitor__') # <<<<<<<<<<<<<< * if monitorlist is None: return PETSC_SUCCESS * cdef object it = toInt(iters) */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_Snes->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Snes), ((char *)"__monitor__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 433, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_monitorlist = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/petscsnes.pxi":434 * cdef SNES Snes = ref_SNES(snes) * cdef object monitorlist = Snes.get_attr('__monitor__') * if monitorlist is None: return PETSC_SUCCESS # <<<<<<<<<<<<<< * cdef object it = toInt(iters) * cdef object rn = toReal(rnorm) */ __pyx_t_2 = (__pyx_v_monitorlist == Py_None); if (__pyx_t_2) { __pyx_r = PETSC_SUCCESS; goto __pyx_L0; } /* "petsc4py/PETSc/petscsnes.pxi":435 * cdef object monitorlist = Snes.get_attr('__monitor__') * if monitorlist is None: return PETSC_SUCCESS * cdef object it = toInt(iters) # <<<<<<<<<<<<<< * cdef object rn = toReal(rnorm) * for (monitor, args, kargs) in monitorlist: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_iters); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 435, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_it = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/petscsnes.pxi":436 * if monitorlist is None: return PETSC_SUCCESS * cdef object it = toInt(iters) * cdef object rn = toReal(rnorm) # <<<<<<<<<<<<<< * for (monitor, args, kargs) in monitorlist: * monitor(Snes, it, rn, *args, **kargs) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_rnorm); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_rn = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/petscsnes.pxi":437 * cdef object it = toInt(iters) * cdef object rn = toReal(rnorm) * for (monitor, args, kargs) in monitorlist: # <<<<<<<<<<<<<< * monitor(Snes, it, rn, *args, **kargs) * return PETSC_SUCCESS */ if (likely(PyList_CheckExact(__pyx_v_monitorlist)) || PyTuple_CheckExact(__pyx_v_monitorlist)) { __pyx_t_1 = __pyx_v_monitorlist; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_monitorlist); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 437, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 437, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(23, 437, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(23, 437, __pyx_L1_error) #else __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 437, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(23, 437, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(23, 437, __pyx_L1_error) #else __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 437, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } } else { __pyx_t_5 = __pyx_t_4(__pyx_t_1); if (unlikely(!__pyx_t_5)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(23, 437, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_5); } if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) { PyObject* sequence = __pyx_t_5; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(23, 437, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_6 = PyList_GET_ITEM(sequence, 0); __pyx_t_7 = PyList_GET_ITEM(sequence, 1); __pyx_t_8 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); #else __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(23, 437, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(23, 437, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_8)) __PYX_ERR(23, 437, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); #endif __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { Py_ssize_t index = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(23, 437, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_10 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); index = 0; __pyx_t_6 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_6)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); index = 1; __pyx_t_7 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_7)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_7); index = 2; __pyx_t_8 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 3) < 0) __PYX_ERR(23, 437, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L7_unpacking_done; __pyx_L6_unpacking_failed:; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(23, 437, __pyx_L1_error) __pyx_L7_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_monitor, __pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF_SET(__pyx_v_args, __pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF_SET(__pyx_v_kargs, __pyx_t_8); __pyx_t_8 = 0; /* "petsc4py/PETSc/petscsnes.pxi":438 * cdef object rn = toReal(rnorm) * for (monitor, args, kargs) in monitorlist: * monitor(Snes, it, rn, *args, **kargs) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF((PyObject *)__pyx_v_Snes); __Pyx_GIVEREF((PyObject *)__pyx_v_Snes); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_Snes))) __PYX_ERR(23, 438, __pyx_L1_error); __Pyx_INCREF(__pyx_v_it); __Pyx_GIVEREF(__pyx_v_it); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_it)) __PYX_ERR(23, 438, __pyx_L1_error); __Pyx_INCREF(__pyx_v_rn); __Pyx_GIVEREF(__pyx_v_rn); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_rn)) __PYX_ERR(23, 438, __pyx_L1_error); __pyx_t_8 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_8)) __PYX_ERR(23, 438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = PyNumber_Add(__pyx_t_5, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(23, 438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(23, 438, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_8 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_8)) __PYX_ERR(23, 438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } else { __pyx_t_8 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_8)) __PYX_ERR(23, 438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_monitor, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/petscsnes.pxi":437 * cdef object it = toInt(iters) * cdef object rn = toReal(rnorm) * for (monitor, args, kargs) in monitorlist: # <<<<<<<<<<<<<< * monitor(Snes, it, rn, *args, **kargs) * return PETSC_SUCCESS */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscsnes.pxi":439 * for (monitor, args, kargs) in monitorlist: * monitor(Snes, it, rn, *args, **kargs) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * # ----------------------------------------------------------------------------- */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petscsnes.pxi":426 * # ----------------------------------------------------------------------------- * * cdef PetscErrorCode SNES_Monitor( # <<<<<<<<<<<<<< * PetscSNES snes, * PetscInt iters, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("petsc4py.PETSc.SNES_Monitor", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Snes); __Pyx_XDECREF(__pyx_v_monitorlist); __Pyx_XDECREF(__pyx_v_it); __Pyx_XDECREF(__pyx_v_rn); __Pyx_XDECREF(__pyx_v_monitor); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petscts.pxi":353 * # ----------------------------------------------------------------------------- * * cdef inline TS ref_TS(PetscTS ts): # <<<<<<<<<<<<<< * cdef TS ob = TS() * ob.ts = ts */ static CYTHON_INLINE struct PyPetscTSObject *__pyx_f_8petsc4py_5PETSc_ref_TS(TS __pyx_v_ts) { struct PyPetscTSObject *__pyx_v_ob = 0; struct PyPetscTSObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("ref_TS", 1); /* "petsc4py/PETSc/petscts.pxi":354 * * cdef inline TS ref_TS(PetscTS ts): * cdef TS ob = TS() # <<<<<<<<<<<<<< * ob.ts = ts * CHKERR( PetscINCREF(ob.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_TS)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_ob = ((struct PyPetscTSObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscts.pxi":355 * cdef inline TS ref_TS(PetscTS ts): * cdef TS ob = TS() * ob.ts = ts # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(ob.obj) ) * return ob */ __pyx_v_ob->ts = __pyx_v_ts; /* "petsc4py/PETSc/petscts.pxi":356 * cdef TS ob = TS() * ob.ts = ts * CHKERR( PetscINCREF(ob.obj) ) # <<<<<<<<<<<<<< * return ob * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ob->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(24, 356, __pyx_L1_error) /* "petsc4py/PETSc/petscts.pxi":357 * ob.ts = ts * CHKERR( PetscINCREF(ob.obj) ) * return ob # <<<<<<<<<<<<<< * * # ----------------------------------------------------------------------------- */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_ob); __pyx_r = __pyx_v_ob; goto __pyx_L0; /* "petsc4py/PETSc/petscts.pxi":353 * # ----------------------------------------------------------------------------- * * cdef inline TS ref_TS(PetscTS ts): # <<<<<<<<<<<<<< * cdef TS ob = TS() * ob.ts = ts */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.ref_TS", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscts.pxi":361 * # ----------------------------------------------------------------------------- * * cdef PetscErrorCode TS_RHSFunction( # <<<<<<<<<<<<<< * PetscTS ts, * PetscReal t, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TS_RHSFunction(TS __pyx_v_ts, PetscReal __pyx_v_t, Vec __pyx_v_x, Vec __pyx_v_f, void *__pyx_v_ctx) { struct PyPetscTSObject *__pyx_v_Ts = 0; struct PyPetscVecObject *__pyx_v_Xvec = 0; struct PyPetscVecObject *__pyx_v_Fvec = 0; PyObject *__pyx_v_context = 0; PyObject *__pyx_v_function = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TS_RHSFunction", 0); /* "petsc4py/PETSc/petscts.pxi":368 * void* ctx, * ) except PETSC_ERR_PYTHON with gil: * cdef TS Ts = ref_TS(ts) # <<<<<<<<<<<<<< * cdef Vec Xvec = ref_Vec(x) * cdef Vec Fvec = ref_Vec(f) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TS(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Ts = ((struct PyPetscTSObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscts.pxi":369 * ) except PETSC_ERR_PYTHON with gil: * cdef TS Ts = ref_TS(ts) * cdef Vec Xvec = ref_Vec(x) # <<<<<<<<<<<<<< * cdef Vec Fvec = ref_Vec(f) * cdef object context = Ts.get_attr('__rhsfunction__') */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 369, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Xvec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscts.pxi":370 * cdef TS Ts = ref_TS(ts) * cdef Vec Xvec = ref_Vec(x) * cdef Vec Fvec = ref_Vec(f) # <<<<<<<<<<<<<< * cdef object context = Ts.get_attr('__rhsfunction__') * if context is None and ctx != NULL: context = ctx */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_f)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 370, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Fvec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscts.pxi":371 * cdef Vec Xvec = ref_Vec(x) * cdef Vec Fvec = ref_Vec(f) * cdef object context = Ts.get_attr('__rhsfunction__') # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_Ts->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Ts), ((char *)"__rhsfunction__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 371, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/petscts.pxi":372 * cdef Vec Fvec = ref_Vec(f) * cdef object context = Ts.get_attr('__rhsfunction__') * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple # sanity check * (function, args, kargs) = context */ __pyx_t_3 = (__pyx_v_context == Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = (__pyx_v_ctx != NULL); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1); __pyx_t_1 = 0; } /* "petsc4py/PETSc/petscts.pxi":373 * cdef object context = Ts.get_attr('__rhsfunction__') * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check # <<<<<<<<<<<<<< * (function, args, kargs) = context * function(Ts, toReal(t), Xvec, Fvec, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_3 = (__pyx_v_context != Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_2 = __pyx_t_3; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(24, 373, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(24, 373, __pyx_L1_error) #endif /* "petsc4py/PETSc/petscts.pxi":374 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check * (function, args, kargs) = context # <<<<<<<<<<<<<< * function(Ts, toReal(t), Xvec, Fvec, *args, **kargs) * return PETSC_SUCCESS */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(24, 374, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); __pyx_t_5 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_6)) __PYX_ERR(24, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); index = 0; __pyx_t_1 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 2; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(24, 374, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(24, 374, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_function = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_kargs = __pyx_t_5; __pyx_t_5 = 0; /* "petsc4py/PETSc/petscts.pxi":375 * assert context is not None and type(context) is tuple # sanity check * (function, args, kargs) = context * function(Ts, toReal(t), Xvec, Fvec, *args, **kargs) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_t); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF((PyObject *)__pyx_v_Ts); __Pyx_GIVEREF((PyObject *)__pyx_v_Ts); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_Ts))) __PYX_ERR(24, 375, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5)) __PYX_ERR(24, 375, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_Xvec); __Pyx_GIVEREF((PyObject *)__pyx_v_Xvec); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, ((PyObject *)__pyx_v_Xvec))) __PYX_ERR(24, 375, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_Fvec); __Pyx_GIVEREF((PyObject *)__pyx_v_Fvec); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 3, ((PyObject *)__pyx_v_Fvec))) __PYX_ERR(24, 375, __pyx_L1_error); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(24, 375, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_5 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } else { __pyx_t_5 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_4 = __Pyx_PyObject_Call(__pyx_v_function, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/petscts.pxi":376 * (function, args, kargs) = context * function(Ts, toReal(t), Xvec, Fvec, *args, **kargs) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * cdef PetscErrorCode TS_RHSJacobian( */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petscts.pxi":361 * # ----------------------------------------------------------------------------- * * cdef PetscErrorCode TS_RHSFunction( # <<<<<<<<<<<<<< * PetscTS ts, * PetscReal t, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.TS_RHSFunction", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Ts); __Pyx_XDECREF((PyObject *)__pyx_v_Xvec); __Pyx_XDECREF((PyObject *)__pyx_v_Fvec); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_function); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petscts.pxi":378 * return PETSC_SUCCESS * * cdef PetscErrorCode TS_RHSJacobian( # <<<<<<<<<<<<<< * PetscTS ts, * PetscReal t, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TS_RHSJacobian(TS __pyx_v_ts, PetscReal __pyx_v_t, Vec __pyx_v_x, Mat __pyx_v_J, Mat __pyx_v_P, void *__pyx_v_ctx) { struct PyPetscTSObject *__pyx_v_Ts = 0; struct PyPetscVecObject *__pyx_v_Xvec = 0; struct PyPetscMatObject *__pyx_v_Jmat = 0; struct PyPetscMatObject *__pyx_v_Pmat = 0; PyObject *__pyx_v_context = 0; PyObject *__pyx_v_jacobian = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TS_RHSJacobian", 0); /* "petsc4py/PETSc/petscts.pxi":386 * void* ctx, * ) except PETSC_ERR_PYTHON with gil: * cdef TS Ts = ref_TS(ts) # <<<<<<<<<<<<<< * cdef Vec Xvec = ref_Vec(x) * cdef Mat Jmat = ref_Mat(J) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TS(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Ts = ((struct PyPetscTSObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscts.pxi":387 * ) except PETSC_ERR_PYTHON with gil: * cdef TS Ts = ref_TS(ts) * cdef Vec Xvec = ref_Vec(x) # <<<<<<<<<<<<<< * cdef Mat Jmat = ref_Mat(J) * cdef Mat Pmat = ref_Mat(P) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Xvec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscts.pxi":388 * cdef TS Ts = ref_TS(ts) * cdef Vec Xvec = ref_Vec(x) * cdef Mat Jmat = ref_Mat(J) # <<<<<<<<<<<<<< * cdef Mat Pmat = ref_Mat(P) * cdef object context = Ts.get_attr('__rhsjacobian__') */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v_J)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 388, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Jmat = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscts.pxi":389 * cdef Vec Xvec = ref_Vec(x) * cdef Mat Jmat = ref_Mat(J) * cdef Mat Pmat = ref_Mat(P) # <<<<<<<<<<<<<< * cdef object context = Ts.get_attr('__rhsjacobian__') * if context is None and ctx != NULL: context = ctx */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v_P)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Pmat = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscts.pxi":390 * cdef Mat Jmat = ref_Mat(J) * cdef Mat Pmat = ref_Mat(P) * cdef object context = Ts.get_attr('__rhsjacobian__') # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_Ts->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Ts), ((char *)"__rhsjacobian__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/petscts.pxi":391 * cdef Mat Pmat = ref_Mat(P) * cdef object context = Ts.get_attr('__rhsjacobian__') * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple # sanity check * (jacobian, args, kargs) = context */ __pyx_t_3 = (__pyx_v_context == Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = (__pyx_v_ctx != NULL); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1); __pyx_t_1 = 0; } /* "petsc4py/PETSc/petscts.pxi":392 * cdef object context = Ts.get_attr('__rhsjacobian__') * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check # <<<<<<<<<<<<<< * (jacobian, args, kargs) = context * jacobian(Ts, toReal(t), Xvec, Jmat, Pmat, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_3 = (__pyx_v_context != Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_2 = __pyx_t_3; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(24, 392, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(24, 392, __pyx_L1_error) #endif /* "petsc4py/PETSc/petscts.pxi":393 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check * (jacobian, args, kargs) = context # <<<<<<<<<<<<<< * jacobian(Ts, toReal(t), Xvec, Jmat, Pmat, *args, **kargs) * return PETSC_SUCCESS */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(24, 393, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); __pyx_t_5 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_6)) __PYX_ERR(24, 393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); index = 0; __pyx_t_1 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 2; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(24, 393, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(24, 393, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_jacobian = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_kargs = __pyx_t_5; __pyx_t_5 = 0; /* "petsc4py/PETSc/petscts.pxi":394 * assert context is not None and type(context) is tuple # sanity check * (jacobian, args, kargs) = context * jacobian(Ts, toReal(t), Xvec, Jmat, Pmat, *args, **kargs) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_t); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 394, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = PyTuple_New(5); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 394, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF((PyObject *)__pyx_v_Ts); __Pyx_GIVEREF((PyObject *)__pyx_v_Ts); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_Ts))) __PYX_ERR(24, 394, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5)) __PYX_ERR(24, 394, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_Xvec); __Pyx_GIVEREF((PyObject *)__pyx_v_Xvec); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, ((PyObject *)__pyx_v_Xvec))) __PYX_ERR(24, 394, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_Jmat); __Pyx_GIVEREF((PyObject *)__pyx_v_Jmat); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 3, ((PyObject *)__pyx_v_Jmat))) __PYX_ERR(24, 394, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_Pmat); __Pyx_GIVEREF((PyObject *)__pyx_v_Pmat); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 4, ((PyObject *)__pyx_v_Pmat))) __PYX_ERR(24, 394, __pyx_L1_error); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 394, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 394, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(24, 394, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_5 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 394, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } else { __pyx_t_5 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 394, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_4 = __Pyx_PyObject_Call(__pyx_v_jacobian, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 394, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/petscts.pxi":395 * (jacobian, args, kargs) = context * jacobian(Ts, toReal(t), Xvec, Jmat, Pmat, *args, **kargs) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * cdef PetscErrorCode TS_RHSJacobianP( */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petscts.pxi":378 * return PETSC_SUCCESS * * cdef PetscErrorCode TS_RHSJacobian( # <<<<<<<<<<<<<< * PetscTS ts, * PetscReal t, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.TS_RHSJacobian", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Ts); __Pyx_XDECREF((PyObject *)__pyx_v_Xvec); __Pyx_XDECREF((PyObject *)__pyx_v_Jmat); __Pyx_XDECREF((PyObject *)__pyx_v_Pmat); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_jacobian); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petscts.pxi":397 * return PETSC_SUCCESS * * cdef PetscErrorCode TS_RHSJacobianP( # <<<<<<<<<<<<<< * PetscTS ts, * PetscReal t, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TS_RHSJacobianP(TS __pyx_v_ts, PetscReal __pyx_v_t, Vec __pyx_v_x, Mat __pyx_v_J, void *__pyx_v_ctx) { struct PyPetscTSObject *__pyx_v_Ts = 0; struct PyPetscVecObject *__pyx_v_Xvec = 0; struct PyPetscMatObject *__pyx_v_Jmat = 0; PyObject *__pyx_v_context = 0; PyObject *__pyx_v_jacobianp = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TS_RHSJacobianP", 0); /* "petsc4py/PETSc/petscts.pxi":404 * void* ctx, * ) except PETSC_ERR_PYTHON with gil: * cdef TS Ts = ref_TS(ts) # <<<<<<<<<<<<<< * cdef Vec Xvec = ref_Vec(x) * cdef Mat Jmat = ref_Mat(J) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TS(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Ts = ((struct PyPetscTSObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscts.pxi":405 * ) except PETSC_ERR_PYTHON with gil: * cdef TS Ts = ref_TS(ts) * cdef Vec Xvec = ref_Vec(x) # <<<<<<<<<<<<<< * cdef Mat Jmat = ref_Mat(J) * cdef object context = Ts.get_attr('__rhsjacobianp__') */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Xvec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscts.pxi":406 * cdef TS Ts = ref_TS(ts) * cdef Vec Xvec = ref_Vec(x) * cdef Mat Jmat = ref_Mat(J) # <<<<<<<<<<<<<< * cdef object context = Ts.get_attr('__rhsjacobianp__') * if context is None and ctx != NULL: context = ctx */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v_J)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Jmat = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscts.pxi":407 * cdef Vec Xvec = ref_Vec(x) * cdef Mat Jmat = ref_Mat(J) * cdef object context = Ts.get_attr('__rhsjacobianp__') # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_Ts->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Ts), ((char *)"__rhsjacobianp__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 407, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/petscts.pxi":408 * cdef Mat Jmat = ref_Mat(J) * cdef object context = Ts.get_attr('__rhsjacobianp__') * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple # sanity check * (jacobianp, args, kargs) = context */ __pyx_t_3 = (__pyx_v_context == Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = (__pyx_v_ctx != NULL); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1); __pyx_t_1 = 0; } /* "petsc4py/PETSc/petscts.pxi":409 * cdef object context = Ts.get_attr('__rhsjacobianp__') * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check # <<<<<<<<<<<<<< * (jacobianp, args, kargs) = context * jacobianp(Ts, toReal(t), Xvec, Jmat, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_3 = (__pyx_v_context != Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_2 = __pyx_t_3; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(24, 409, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(24, 409, __pyx_L1_error) #endif /* "petsc4py/PETSc/petscts.pxi":410 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check * (jacobianp, args, kargs) = context # <<<<<<<<<<<<<< * jacobianp(Ts, toReal(t), Xvec, Jmat, *args, **kargs) * return PETSC_SUCCESS */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(24, 410, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); __pyx_t_5 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_6)) __PYX_ERR(24, 410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); index = 0; __pyx_t_1 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 2; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(24, 410, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(24, 410, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_jacobianp = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_kargs = __pyx_t_5; __pyx_t_5 = 0; /* "petsc4py/PETSc/petscts.pxi":411 * assert context is not None and type(context) is tuple # sanity check * (jacobianp, args, kargs) = context * jacobianp(Ts, toReal(t), Xvec, Jmat, *args, **kargs) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_t); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF((PyObject *)__pyx_v_Ts); __Pyx_GIVEREF((PyObject *)__pyx_v_Ts); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_Ts))) __PYX_ERR(24, 411, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5)) __PYX_ERR(24, 411, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_Xvec); __Pyx_GIVEREF((PyObject *)__pyx_v_Xvec); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, ((PyObject *)__pyx_v_Xvec))) __PYX_ERR(24, 411, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_Jmat); __Pyx_GIVEREF((PyObject *)__pyx_v_Jmat); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 3, ((PyObject *)__pyx_v_Jmat))) __PYX_ERR(24, 411, __pyx_L1_error); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(24, 411, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_5 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } else { __pyx_t_5 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_4 = __Pyx_PyObject_Call(__pyx_v_jacobianp, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/petscts.pxi":412 * (jacobianp, args, kargs) = context * jacobianp(Ts, toReal(t), Xvec, Jmat, *args, **kargs) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * # ----------------------------------------------------------------------------- */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petscts.pxi":397 * return PETSC_SUCCESS * * cdef PetscErrorCode TS_RHSJacobianP( # <<<<<<<<<<<<<< * PetscTS ts, * PetscReal t, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.TS_RHSJacobianP", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Ts); __Pyx_XDECREF((PyObject *)__pyx_v_Xvec); __Pyx_XDECREF((PyObject *)__pyx_v_Jmat); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_jacobianp); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petscts.pxi":416 * # ----------------------------------------------------------------------------- * * cdef PetscErrorCode TS_IFunction( # <<<<<<<<<<<<<< * PetscTS ts, * PetscReal t, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TS_IFunction(TS __pyx_v_ts, PetscReal __pyx_v_t, Vec __pyx_v_x, Vec __pyx_v_xdot, Vec __pyx_v_f, void *__pyx_v_ctx) { struct PyPetscTSObject *__pyx_v_Ts = 0; struct PyPetscVecObject *__pyx_v_Xvec = 0; struct PyPetscVecObject *__pyx_v_XDvec = 0; struct PyPetscVecObject *__pyx_v_Fvec = 0; PyObject *__pyx_v_context = 0; PyObject *__pyx_v_function = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TS_IFunction", 0); /* "petsc4py/PETSc/petscts.pxi":424 * void* ctx, * ) except PETSC_ERR_PYTHON with gil: * cdef TS Ts = ref_TS(ts) # <<<<<<<<<<<<<< * cdef Vec Xvec = ref_Vec(x) * cdef Vec XDvec = ref_Vec(xdot) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TS(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 424, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Ts = ((struct PyPetscTSObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscts.pxi":425 * ) except PETSC_ERR_PYTHON with gil: * cdef TS Ts = ref_TS(ts) * cdef Vec Xvec = ref_Vec(x) # <<<<<<<<<<<<<< * cdef Vec XDvec = ref_Vec(xdot) * cdef Vec Fvec = ref_Vec(f) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Xvec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscts.pxi":426 * cdef TS Ts = ref_TS(ts) * cdef Vec Xvec = ref_Vec(x) * cdef Vec XDvec = ref_Vec(xdot) # <<<<<<<<<<<<<< * cdef Vec Fvec = ref_Vec(f) * cdef object context = Ts.get_attr('__ifunction__') */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_xdot)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 426, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_XDvec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscts.pxi":427 * cdef Vec Xvec = ref_Vec(x) * cdef Vec XDvec = ref_Vec(xdot) * cdef Vec Fvec = ref_Vec(f) # <<<<<<<<<<<<<< * cdef object context = Ts.get_attr('__ifunction__') * if context is None and ctx != NULL: context = ctx */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_f)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Fvec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscts.pxi":428 * cdef Vec XDvec = ref_Vec(xdot) * cdef Vec Fvec = ref_Vec(f) * cdef object context = Ts.get_attr('__ifunction__') # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_Ts->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Ts), ((char *)"__ifunction__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/petscts.pxi":429 * cdef Vec Fvec = ref_Vec(f) * cdef object context = Ts.get_attr('__ifunction__') * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple # sanity check * (function, args, kargs) = context */ __pyx_t_3 = (__pyx_v_context == Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = (__pyx_v_ctx != NULL); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1); __pyx_t_1 = 0; } /* "petsc4py/PETSc/petscts.pxi":430 * cdef object context = Ts.get_attr('__ifunction__') * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check # <<<<<<<<<<<<<< * (function, args, kargs) = context * function(Ts, toReal(t), Xvec, XDvec, Fvec, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_3 = (__pyx_v_context != Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_2 = __pyx_t_3; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(24, 430, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(24, 430, __pyx_L1_error) #endif /* "petsc4py/PETSc/petscts.pxi":431 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check * (function, args, kargs) = context # <<<<<<<<<<<<<< * function(Ts, toReal(t), Xvec, XDvec, Fvec, *args, **kargs) * return PETSC_SUCCESS */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(24, 431, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); __pyx_t_5 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 431, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 431, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 431, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_6)) __PYX_ERR(24, 431, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); index = 0; __pyx_t_1 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 2; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(24, 431, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(24, 431, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_function = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_kargs = __pyx_t_5; __pyx_t_5 = 0; /* "petsc4py/PETSc/petscts.pxi":432 * assert context is not None and type(context) is tuple # sanity check * (function, args, kargs) = context * function(Ts, toReal(t), Xvec, XDvec, Fvec, *args, **kargs) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_t); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 432, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = PyTuple_New(5); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 432, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF((PyObject *)__pyx_v_Ts); __Pyx_GIVEREF((PyObject *)__pyx_v_Ts); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_Ts))) __PYX_ERR(24, 432, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5)) __PYX_ERR(24, 432, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_Xvec); __Pyx_GIVEREF((PyObject *)__pyx_v_Xvec); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, ((PyObject *)__pyx_v_Xvec))) __PYX_ERR(24, 432, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_XDvec); __Pyx_GIVEREF((PyObject *)__pyx_v_XDvec); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 3, ((PyObject *)__pyx_v_XDvec))) __PYX_ERR(24, 432, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_Fvec); __Pyx_GIVEREF((PyObject *)__pyx_v_Fvec); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 4, ((PyObject *)__pyx_v_Fvec))) __PYX_ERR(24, 432, __pyx_L1_error); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 432, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 432, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(24, 432, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_5 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 432, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } else { __pyx_t_5 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 432, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_4 = __Pyx_PyObject_Call(__pyx_v_function, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 432, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/petscts.pxi":433 * (function, args, kargs) = context * function(Ts, toReal(t), Xvec, XDvec, Fvec, *args, **kargs) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * cdef PetscErrorCode TS_IJacobian( */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petscts.pxi":416 * # ----------------------------------------------------------------------------- * * cdef PetscErrorCode TS_IFunction( # <<<<<<<<<<<<<< * PetscTS ts, * PetscReal t, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.TS_IFunction", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Ts); __Pyx_XDECREF((PyObject *)__pyx_v_Xvec); __Pyx_XDECREF((PyObject *)__pyx_v_XDvec); __Pyx_XDECREF((PyObject *)__pyx_v_Fvec); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_function); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petscts.pxi":435 * return PETSC_SUCCESS * * cdef PetscErrorCode TS_IJacobian( # <<<<<<<<<<<<<< * PetscTS ts, * PetscReal t, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TS_IJacobian(TS __pyx_v_ts, PetscReal __pyx_v_t, Vec __pyx_v_x, Vec __pyx_v_xdot, PetscReal __pyx_v_a, Mat __pyx_v_J, Mat __pyx_v_P, void *__pyx_v_ctx) { struct PyPetscTSObject *__pyx_v_Ts = 0; struct PyPetscVecObject *__pyx_v_Xvec = 0; struct PyPetscVecObject *__pyx_v_XDvec = 0; struct PyPetscMatObject *__pyx_v_Jmat = 0; struct PyPetscMatObject *__pyx_v_Pmat = 0; PyObject *__pyx_v_context = 0; PyObject *__pyx_v_jacobian = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TS_IJacobian", 0); /* "petsc4py/PETSc/petscts.pxi":445 * void* ctx, * ) except PETSC_ERR_PYTHON with gil: * cdef TS Ts = ref_TS(ts) # <<<<<<<<<<<<<< * cdef Vec Xvec = ref_Vec(x) * cdef Vec XDvec = ref_Vec(xdot) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TS(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Ts = ((struct PyPetscTSObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscts.pxi":446 * ) except PETSC_ERR_PYTHON with gil: * cdef TS Ts = ref_TS(ts) * cdef Vec Xvec = ref_Vec(x) # <<<<<<<<<<<<<< * cdef Vec XDvec = ref_Vec(xdot) * cdef Mat Jmat = ref_Mat(J) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 446, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Xvec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscts.pxi":447 * cdef TS Ts = ref_TS(ts) * cdef Vec Xvec = ref_Vec(x) * cdef Vec XDvec = ref_Vec(xdot) # <<<<<<<<<<<<<< * cdef Mat Jmat = ref_Mat(J) * cdef Mat Pmat = ref_Mat(P) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_xdot)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 447, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_XDvec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscts.pxi":448 * cdef Vec Xvec = ref_Vec(x) * cdef Vec XDvec = ref_Vec(xdot) * cdef Mat Jmat = ref_Mat(J) # <<<<<<<<<<<<<< * cdef Mat Pmat = ref_Mat(P) * cdef object context = Ts.get_attr('__ijacobian__') */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v_J)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 448, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Jmat = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscts.pxi":449 * cdef Vec XDvec = ref_Vec(xdot) * cdef Mat Jmat = ref_Mat(J) * cdef Mat Pmat = ref_Mat(P) # <<<<<<<<<<<<<< * cdef object context = Ts.get_attr('__ijacobian__') * if context is None and ctx != NULL: context = ctx */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v_P)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 449, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Pmat = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscts.pxi":450 * cdef Mat Jmat = ref_Mat(J) * cdef Mat Pmat = ref_Mat(P) * cdef object context = Ts.get_attr('__ijacobian__') # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_Ts->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Ts), ((char *)"__ijacobian__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 450, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/petscts.pxi":451 * cdef Mat Pmat = ref_Mat(P) * cdef object context = Ts.get_attr('__ijacobian__') * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple # sanity check * (jacobian, args, kargs) = context */ __pyx_t_3 = (__pyx_v_context == Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = (__pyx_v_ctx != NULL); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1); __pyx_t_1 = 0; } /* "petsc4py/PETSc/petscts.pxi":452 * cdef object context = Ts.get_attr('__ijacobian__') * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check # <<<<<<<<<<<<<< * (jacobian, args, kargs) = context * jacobian(Ts, toReal(t), Xvec, XDvec, toReal(a), Jmat, Pmat, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_3 = (__pyx_v_context != Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_2 = __pyx_t_3; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(24, 452, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(24, 452, __pyx_L1_error) #endif /* "petsc4py/PETSc/petscts.pxi":453 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check * (jacobian, args, kargs) = context # <<<<<<<<<<<<<< * jacobian(Ts, toReal(t), Xvec, XDvec, toReal(a), Jmat, Pmat, *args, **kargs) * return PETSC_SUCCESS */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(24, 453, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); __pyx_t_5 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_6)) __PYX_ERR(24, 453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); index = 0; __pyx_t_1 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 2; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(24, 453, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(24, 453, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_jacobian = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_kargs = __pyx_t_5; __pyx_t_5 = 0; /* "petsc4py/PETSc/petscts.pxi":454 * assert context is not None and type(context) is tuple # sanity check * (jacobian, args, kargs) = context * jacobian(Ts, toReal(t), Xvec, XDvec, toReal(a), Jmat, Pmat, *args, **kargs) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_t); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 454, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_a); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 454, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyTuple_New(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 454, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF((PyObject *)__pyx_v_Ts); __Pyx_GIVEREF((PyObject *)__pyx_v_Ts); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_Ts))) __PYX_ERR(24, 454, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5)) __PYX_ERR(24, 454, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_Xvec); __Pyx_GIVEREF((PyObject *)__pyx_v_Xvec); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_Xvec))) __PYX_ERR(24, 454, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_XDvec); __Pyx_GIVEREF((PyObject *)__pyx_v_XDvec); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_XDvec))) __PYX_ERR(24, 454, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_t_4)) __PYX_ERR(24, 454, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_Jmat); __Pyx_GIVEREF((PyObject *)__pyx_v_Jmat); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 5, ((PyObject *)__pyx_v_Jmat))) __PYX_ERR(24, 454, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_Pmat); __Pyx_GIVEREF((PyObject *)__pyx_v_Pmat); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 6, ((PyObject *)__pyx_v_Pmat))) __PYX_ERR(24, 454, __pyx_L1_error); __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 454, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 454, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(24, 454, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_4 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 454, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } else { __pyx_t_4 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 454, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_jacobian, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 454, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscts.pxi":455 * (jacobian, args, kargs) = context * jacobian(Ts, toReal(t), Xvec, XDvec, toReal(a), Jmat, Pmat, *args, **kargs) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * cdef PetscErrorCode TS_IJacobianP( */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petscts.pxi":435 * return PETSC_SUCCESS * * cdef PetscErrorCode TS_IJacobian( # <<<<<<<<<<<<<< * PetscTS ts, * PetscReal t, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.TS_IJacobian", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Ts); __Pyx_XDECREF((PyObject *)__pyx_v_Xvec); __Pyx_XDECREF((PyObject *)__pyx_v_XDvec); __Pyx_XDECREF((PyObject *)__pyx_v_Jmat); __Pyx_XDECREF((PyObject *)__pyx_v_Pmat); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_jacobian); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petscts.pxi":457 * return PETSC_SUCCESS * * cdef PetscErrorCode TS_IJacobianP( # <<<<<<<<<<<<<< * PetscTS ts, * PetscReal t, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TS_IJacobianP(TS __pyx_v_ts, PetscReal __pyx_v_t, Vec __pyx_v_x, Vec __pyx_v_xdot, PetscReal __pyx_v_a, Mat __pyx_v_J, void *__pyx_v_ctx) { struct PyPetscTSObject *__pyx_v_Ts = 0; struct PyPetscVecObject *__pyx_v_Xvec = 0; struct PyPetscVecObject *__pyx_v_XDvec = 0; struct PyPetscMatObject *__pyx_v_Jmat = 0; PyObject *__pyx_v_context = 0; PyObject *__pyx_v_jacobian = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TS_IJacobianP", 0); /* "petsc4py/PETSc/petscts.pxi":466 * void* ctx, * ) except PETSC_ERR_PYTHON with gil: * cdef TS Ts = ref_TS(ts) # <<<<<<<<<<<<<< * cdef Vec Xvec = ref_Vec(x) * cdef Vec XDvec = ref_Vec(xdot) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TS(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Ts = ((struct PyPetscTSObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscts.pxi":467 * ) except PETSC_ERR_PYTHON with gil: * cdef TS Ts = ref_TS(ts) * cdef Vec Xvec = ref_Vec(x) # <<<<<<<<<<<<<< * cdef Vec XDvec = ref_Vec(xdot) * cdef Mat Jmat = ref_Mat(J) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Xvec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscts.pxi":468 * cdef TS Ts = ref_TS(ts) * cdef Vec Xvec = ref_Vec(x) * cdef Vec XDvec = ref_Vec(xdot) # <<<<<<<<<<<<<< * cdef Mat Jmat = ref_Mat(J) * cdef object context = Ts.get_attr('__ijacobianp__') */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_xdot)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 468, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_XDvec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscts.pxi":469 * cdef Vec Xvec = ref_Vec(x) * cdef Vec XDvec = ref_Vec(xdot) * cdef Mat Jmat = ref_Mat(J) # <<<<<<<<<<<<<< * cdef object context = Ts.get_attr('__ijacobianp__') * if context is None and ctx != NULL: context = ctx */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v_J)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Jmat = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscts.pxi":470 * cdef Vec XDvec = ref_Vec(xdot) * cdef Mat Jmat = ref_Mat(J) * cdef object context = Ts.get_attr('__ijacobianp__') # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_Ts->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Ts), ((char *)"__ijacobianp__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/petscts.pxi":471 * cdef Mat Jmat = ref_Mat(J) * cdef object context = Ts.get_attr('__ijacobianp__') * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple # sanity check * (jacobian, args, kargs) = context */ __pyx_t_3 = (__pyx_v_context == Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = (__pyx_v_ctx != NULL); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1); __pyx_t_1 = 0; } /* "petsc4py/PETSc/petscts.pxi":472 * cdef object context = Ts.get_attr('__ijacobianp__') * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check # <<<<<<<<<<<<<< * (jacobian, args, kargs) = context * jacobian(Ts, toReal(t), Xvec, XDvec, toReal(a), Jmat, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_3 = (__pyx_v_context != Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_2 = __pyx_t_3; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(24, 472, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(24, 472, __pyx_L1_error) #endif /* "petsc4py/PETSc/petscts.pxi":473 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check * (jacobian, args, kargs) = context # <<<<<<<<<<<<<< * jacobian(Ts, toReal(t), Xvec, XDvec, toReal(a), Jmat, *args, **kargs) * return PETSC_SUCCESS */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(24, 473, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); __pyx_t_5 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_6)) __PYX_ERR(24, 473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); index = 0; __pyx_t_1 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 2; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(24, 473, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(24, 473, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_jacobian = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_kargs = __pyx_t_5; __pyx_t_5 = 0; /* "petsc4py/PETSc/petscts.pxi":474 * assert context is not None and type(context) is tuple # sanity check * (jacobian, args, kargs) = context * jacobian(Ts, toReal(t), Xvec, XDvec, toReal(a), Jmat, *args, **kargs) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_t); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_a); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyTuple_New(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF((PyObject *)__pyx_v_Ts); __Pyx_GIVEREF((PyObject *)__pyx_v_Ts); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_Ts))) __PYX_ERR(24, 474, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5)) __PYX_ERR(24, 474, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_Xvec); __Pyx_GIVEREF((PyObject *)__pyx_v_Xvec); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_Xvec))) __PYX_ERR(24, 474, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_XDvec); __Pyx_GIVEREF((PyObject *)__pyx_v_XDvec); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_XDvec))) __PYX_ERR(24, 474, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_t_4)) __PYX_ERR(24, 474, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_Jmat); __Pyx_GIVEREF((PyObject *)__pyx_v_Jmat); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 5, ((PyObject *)__pyx_v_Jmat))) __PYX_ERR(24, 474, __pyx_L1_error); __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(24, 474, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_4 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } else { __pyx_t_4 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_jacobian, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscts.pxi":475 * (jacobian, args, kargs) = context * jacobian(Ts, toReal(t), Xvec, XDvec, toReal(a), Jmat, *args, **kargs) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * cdef PetscErrorCode TS_I2Function( */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petscts.pxi":457 * return PETSC_SUCCESS * * cdef PetscErrorCode TS_IJacobianP( # <<<<<<<<<<<<<< * PetscTS ts, * PetscReal t, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.TS_IJacobianP", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Ts); __Pyx_XDECREF((PyObject *)__pyx_v_Xvec); __Pyx_XDECREF((PyObject *)__pyx_v_XDvec); __Pyx_XDECREF((PyObject *)__pyx_v_Jmat); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_jacobian); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petscts.pxi":477 * return PETSC_SUCCESS * * cdef PetscErrorCode TS_I2Function( # <<<<<<<<<<<<<< * PetscTS ts, * PetscReal t, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TS_I2Function(TS __pyx_v_ts, PetscReal __pyx_v_t, Vec __pyx_v_x, Vec __pyx_v_xdot, Vec __pyx_v_xdotdot, Vec __pyx_v_f, void *__pyx_v_ctx) { struct PyPetscTSObject *__pyx_v_Ts = 0; struct PyPetscVecObject *__pyx_v_Xvec = 0; struct PyPetscVecObject *__pyx_v_XDvec = 0; struct PyPetscVecObject *__pyx_v_XDDvec = 0; struct PyPetscVecObject *__pyx_v_Fvec = 0; PyObject *__pyx_v_context = 0; PyObject *__pyx_v_function = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TS_I2Function", 0); /* "petsc4py/PETSc/petscts.pxi":486 * void* ctx, * ) except PETSC_ERR_PYTHON with gil: * cdef TS Ts = ref_TS(ts) # <<<<<<<<<<<<<< * cdef Vec Xvec = ref_Vec(x) * cdef Vec XDvec = ref_Vec(xdot) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TS(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 486, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Ts = ((struct PyPetscTSObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscts.pxi":487 * ) except PETSC_ERR_PYTHON with gil: * cdef TS Ts = ref_TS(ts) * cdef Vec Xvec = ref_Vec(x) # <<<<<<<<<<<<<< * cdef Vec XDvec = ref_Vec(xdot) * cdef Vec XDDvec = ref_Vec(xdotdot) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Xvec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscts.pxi":488 * cdef TS Ts = ref_TS(ts) * cdef Vec Xvec = ref_Vec(x) * cdef Vec XDvec = ref_Vec(xdot) # <<<<<<<<<<<<<< * cdef Vec XDDvec = ref_Vec(xdotdot) * cdef Vec Fvec = ref_Vec(f) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_xdot)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 488, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_XDvec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscts.pxi":489 * cdef Vec Xvec = ref_Vec(x) * cdef Vec XDvec = ref_Vec(xdot) * cdef Vec XDDvec = ref_Vec(xdotdot) # <<<<<<<<<<<<<< * cdef Vec Fvec = ref_Vec(f) * cdef object context = Ts.get_attr('__i2function__') */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_xdotdot)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 489, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_XDDvec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscts.pxi":490 * cdef Vec XDvec = ref_Vec(xdot) * cdef Vec XDDvec = ref_Vec(xdotdot) * cdef Vec Fvec = ref_Vec(f) # <<<<<<<<<<<<<< * cdef object context = Ts.get_attr('__i2function__') * if context is None and ctx != NULL: context = ctx */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_f)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 490, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Fvec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscts.pxi":491 * cdef Vec XDDvec = ref_Vec(xdotdot) * cdef Vec Fvec = ref_Vec(f) * cdef object context = Ts.get_attr('__i2function__') # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_Ts->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Ts), ((char *)"__i2function__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 491, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/petscts.pxi":492 * cdef Vec Fvec = ref_Vec(f) * cdef object context = Ts.get_attr('__i2function__') * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple # sanity check * (function, args, kargs) = context */ __pyx_t_3 = (__pyx_v_context == Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = (__pyx_v_ctx != NULL); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1); __pyx_t_1 = 0; } /* "petsc4py/PETSc/petscts.pxi":493 * cdef object context = Ts.get_attr('__i2function__') * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check # <<<<<<<<<<<<<< * (function, args, kargs) = context * function(Ts, toReal(t), Xvec, XDvec, XDDvec, Fvec, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_3 = (__pyx_v_context != Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_2 = __pyx_t_3; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(24, 493, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(24, 493, __pyx_L1_error) #endif /* "petsc4py/PETSc/petscts.pxi":494 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check * (function, args, kargs) = context # <<<<<<<<<<<<<< * function(Ts, toReal(t), Xvec, XDvec, XDDvec, Fvec, *args, **kargs) * return PETSC_SUCCESS */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(24, 494, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); __pyx_t_5 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 494, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 494, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 494, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_6)) __PYX_ERR(24, 494, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); index = 0; __pyx_t_1 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 2; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(24, 494, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(24, 494, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_function = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_kargs = __pyx_t_5; __pyx_t_5 = 0; /* "petsc4py/PETSc/petscts.pxi":495 * assert context is not None and type(context) is tuple # sanity check * (function, args, kargs) = context * function(Ts, toReal(t), Xvec, XDvec, XDDvec, Fvec, *args, **kargs) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_t); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 495, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = PyTuple_New(6); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 495, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF((PyObject *)__pyx_v_Ts); __Pyx_GIVEREF((PyObject *)__pyx_v_Ts); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_Ts))) __PYX_ERR(24, 495, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5)) __PYX_ERR(24, 495, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_Xvec); __Pyx_GIVEREF((PyObject *)__pyx_v_Xvec); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, ((PyObject *)__pyx_v_Xvec))) __PYX_ERR(24, 495, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_XDvec); __Pyx_GIVEREF((PyObject *)__pyx_v_XDvec); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 3, ((PyObject *)__pyx_v_XDvec))) __PYX_ERR(24, 495, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_XDDvec); __Pyx_GIVEREF((PyObject *)__pyx_v_XDDvec); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 4, ((PyObject *)__pyx_v_XDDvec))) __PYX_ERR(24, 495, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_Fvec); __Pyx_GIVEREF((PyObject *)__pyx_v_Fvec); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 5, ((PyObject *)__pyx_v_Fvec))) __PYX_ERR(24, 495, __pyx_L1_error); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 495, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 495, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(24, 495, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_5 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 495, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } else { __pyx_t_5 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 495, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_4 = __Pyx_PyObject_Call(__pyx_v_function, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 495, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/petscts.pxi":496 * (function, args, kargs) = context * function(Ts, toReal(t), Xvec, XDvec, XDDvec, Fvec, *args, **kargs) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * cdef PetscErrorCode TS_I2Jacobian( */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petscts.pxi":477 * return PETSC_SUCCESS * * cdef PetscErrorCode TS_I2Function( # <<<<<<<<<<<<<< * PetscTS ts, * PetscReal t, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.TS_I2Function", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Ts); __Pyx_XDECREF((PyObject *)__pyx_v_Xvec); __Pyx_XDECREF((PyObject *)__pyx_v_XDvec); __Pyx_XDECREF((PyObject *)__pyx_v_XDDvec); __Pyx_XDECREF((PyObject *)__pyx_v_Fvec); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_function); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petscts.pxi":498 * return PETSC_SUCCESS * * cdef PetscErrorCode TS_I2Jacobian( # <<<<<<<<<<<<<< * PetscTS ts, * PetscReal t, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TS_I2Jacobian(TS __pyx_v_ts, PetscReal __pyx_v_t, Vec __pyx_v_x, Vec __pyx_v_xdot, Vec __pyx_v_xdotdot, PetscReal __pyx_v_v, PetscReal __pyx_v_a, Mat __pyx_v_J, Mat __pyx_v_P, void *__pyx_v_ctx) { struct PyPetscTSObject *__pyx_v_Ts = 0; struct PyPetscVecObject *__pyx_v_Xvec = 0; struct PyPetscVecObject *__pyx_v_XDvec = 0; struct PyPetscVecObject *__pyx_v_XDDvec = 0; struct PyPetscMatObject *__pyx_v_Jmat = 0; struct PyPetscMatObject *__pyx_v_Pmat = 0; PyObject *__pyx_v_context = 0; PyObject *__pyx_v_jacobian = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TS_I2Jacobian", 0); /* "petsc4py/PETSc/petscts.pxi":510 * void* ctx, * ) except PETSC_ERR_PYTHON with gil: * cdef TS Ts = ref_TS(ts) # <<<<<<<<<<<<<< * cdef Vec Xvec = ref_Vec(x) * cdef Vec XDvec = ref_Vec(xdot) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TS(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 510, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Ts = ((struct PyPetscTSObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscts.pxi":511 * ) except PETSC_ERR_PYTHON with gil: * cdef TS Ts = ref_TS(ts) * cdef Vec Xvec = ref_Vec(x) # <<<<<<<<<<<<<< * cdef Vec XDvec = ref_Vec(xdot) * cdef Vec XDDvec = ref_Vec(xdotdot) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 511, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Xvec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscts.pxi":512 * cdef TS Ts = ref_TS(ts) * cdef Vec Xvec = ref_Vec(x) * cdef Vec XDvec = ref_Vec(xdot) # <<<<<<<<<<<<<< * cdef Vec XDDvec = ref_Vec(xdotdot) * cdef Mat Jmat = ref_Mat(J) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_xdot)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 512, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_XDvec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscts.pxi":513 * cdef Vec Xvec = ref_Vec(x) * cdef Vec XDvec = ref_Vec(xdot) * cdef Vec XDDvec = ref_Vec(xdotdot) # <<<<<<<<<<<<<< * cdef Mat Jmat = ref_Mat(J) * cdef Mat Pmat = ref_Mat(P) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_xdotdot)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 513, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_XDDvec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscts.pxi":514 * cdef Vec XDvec = ref_Vec(xdot) * cdef Vec XDDvec = ref_Vec(xdotdot) * cdef Mat Jmat = ref_Mat(J) # <<<<<<<<<<<<<< * cdef Mat Pmat = ref_Mat(P) * cdef object context = Ts.get_attr('__i2jacobian__') */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v_J)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Jmat = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscts.pxi":515 * cdef Vec XDDvec = ref_Vec(xdotdot) * cdef Mat Jmat = ref_Mat(J) * cdef Mat Pmat = ref_Mat(P) # <<<<<<<<<<<<<< * cdef object context = Ts.get_attr('__i2jacobian__') * if context is None and ctx != NULL: context = ctx */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v_P)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 515, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Pmat = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscts.pxi":516 * cdef Mat Jmat = ref_Mat(J) * cdef Mat Pmat = ref_Mat(P) * cdef object context = Ts.get_attr('__i2jacobian__') # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_Ts->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Ts), ((char *)"__i2jacobian__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 516, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/petscts.pxi":517 * cdef Mat Pmat = ref_Mat(P) * cdef object context = Ts.get_attr('__i2jacobian__') * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple # sanity check * (jacobian, args, kargs) = context */ __pyx_t_3 = (__pyx_v_context == Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = (__pyx_v_ctx != NULL); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1); __pyx_t_1 = 0; } /* "petsc4py/PETSc/petscts.pxi":518 * cdef object context = Ts.get_attr('__i2jacobian__') * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check # <<<<<<<<<<<<<< * (jacobian, args, kargs) = context * jacobian(Ts, toReal(t), Xvec, XDvec, XDDvec, toReal(v), toReal(a), Jmat, Pmat, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_3 = (__pyx_v_context != Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_2 = __pyx_t_3; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(24, 518, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(24, 518, __pyx_L1_error) #endif /* "petsc4py/PETSc/petscts.pxi":519 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check * (jacobian, args, kargs) = context # <<<<<<<<<<<<<< * jacobian(Ts, toReal(t), Xvec, XDvec, XDDvec, toReal(v), toReal(a), Jmat, Pmat, *args, **kargs) * return PETSC_SUCCESS */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(24, 519, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); __pyx_t_5 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 519, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 519, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 519, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_6)) __PYX_ERR(24, 519, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); index = 0; __pyx_t_1 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 2; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(24, 519, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(24, 519, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_jacobian = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_kargs = __pyx_t_5; __pyx_t_5 = 0; /* "petsc4py/PETSc/petscts.pxi":520 * assert context is not None and type(context) is tuple # sanity check * (jacobian, args, kargs) = context * jacobian(Ts, toReal(t), Xvec, XDvec, XDDvec, toReal(v), toReal(a), Jmat, Pmat, *args, **kargs) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_t); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_v); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_a); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PyTuple_New(9); if (unlikely(!__pyx_t_6)) __PYX_ERR(24, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF((PyObject *)__pyx_v_Ts); __Pyx_GIVEREF((PyObject *)__pyx_v_Ts); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_Ts))) __PYX_ERR(24, 520, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5)) __PYX_ERR(24, 520, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_Xvec); __Pyx_GIVEREF((PyObject *)__pyx_v_Xvec); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, ((PyObject *)__pyx_v_Xvec))) __PYX_ERR(24, 520, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_XDvec); __Pyx_GIVEREF((PyObject *)__pyx_v_XDvec); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 3, ((PyObject *)__pyx_v_XDvec))) __PYX_ERR(24, 520, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_XDDvec); __Pyx_GIVEREF((PyObject *)__pyx_v_XDDvec); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 4, ((PyObject *)__pyx_v_XDDvec))) __PYX_ERR(24, 520, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 5, __pyx_t_4)) __PYX_ERR(24, 520, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 6, __pyx_t_1)) __PYX_ERR(24, 520, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_Jmat); __Pyx_GIVEREF((PyObject *)__pyx_v_Jmat); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 7, ((PyObject *)__pyx_v_Jmat))) __PYX_ERR(24, 520, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_Pmat); __Pyx_GIVEREF((PyObject *)__pyx_v_Pmat); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 8, ((PyObject *)__pyx_v_Pmat))) __PYX_ERR(24, 520, __pyx_L1_error); __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyNumber_Add(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(24, 520, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_1 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_1 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_jacobian, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(24, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "petsc4py/PETSc/petscts.pxi":521 * (jacobian, args, kargs) = context * jacobian(Ts, toReal(t), Xvec, XDvec, XDDvec, toReal(v), toReal(a), Jmat, Pmat, *args, **kargs) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * # ----------------------------------------------------------------------------- */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petscts.pxi":498 * return PETSC_SUCCESS * * cdef PetscErrorCode TS_I2Jacobian( # <<<<<<<<<<<<<< * PetscTS ts, * PetscReal t, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.TS_I2Jacobian", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Ts); __Pyx_XDECREF((PyObject *)__pyx_v_Xvec); __Pyx_XDECREF((PyObject *)__pyx_v_XDvec); __Pyx_XDECREF((PyObject *)__pyx_v_XDDvec); __Pyx_XDECREF((PyObject *)__pyx_v_Jmat); __Pyx_XDECREF((PyObject *)__pyx_v_Pmat); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_jacobian); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petscts.pxi":525 * # ----------------------------------------------------------------------------- * * cdef PetscErrorCode TS_Monitor( # <<<<<<<<<<<<<< * PetscTS ts, * PetscInt step, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TS_Monitor(TS __pyx_v_ts, PetscInt __pyx_v_step, PetscReal __pyx_v_time, Vec __pyx_v_u, CYTHON_UNUSED void *__pyx_v_ctx) { struct PyPetscTSObject *__pyx_v_Ts = 0; struct PyPetscVecObject *__pyx_v_Vu = 0; PyObject *__pyx_v_monitorlist = 0; PyObject *__pyx_v_monitor = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; Py_ssize_t __pyx_t_3; PyObject *(*__pyx_t_4)(PyObject *); PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *(*__pyx_t_10)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TS_Monitor", 0); /* "petsc4py/PETSc/petscts.pxi":532 * void* ctx, * ) except PETSC_ERR_PYTHON with gil: * cdef TS Ts = ref_TS(ts) # <<<<<<<<<<<<<< * cdef Vec Vu = ref_Vec(u) * cdef object monitorlist = Ts.get_attr('__monitor__') */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TS(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 532, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Ts = ((struct PyPetscTSObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscts.pxi":533 * ) except PETSC_ERR_PYTHON with gil: * cdef TS Ts = ref_TS(ts) * cdef Vec Vu = ref_Vec(u) # <<<<<<<<<<<<<< * cdef object monitorlist = Ts.get_attr('__monitor__') * if monitorlist is None: return PETSC_SUCCESS */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_u)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 533, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Vu = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscts.pxi":534 * cdef TS Ts = ref_TS(ts) * cdef Vec Vu = ref_Vec(u) * cdef object monitorlist = Ts.get_attr('__monitor__') # <<<<<<<<<<<<<< * if monitorlist is None: return PETSC_SUCCESS * for (monitor, args, kargs) in monitorlist: */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_Ts->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Ts), ((char *)"__monitor__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 534, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_monitorlist = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/petscts.pxi":535 * cdef Vec Vu = ref_Vec(u) * cdef object monitorlist = Ts.get_attr('__monitor__') * if monitorlist is None: return PETSC_SUCCESS # <<<<<<<<<<<<<< * for (monitor, args, kargs) in monitorlist: * monitor(Ts, toInt(step), toReal(time), Vu, *args, **kargs) */ __pyx_t_2 = (__pyx_v_monitorlist == Py_None); if (__pyx_t_2) { __pyx_r = PETSC_SUCCESS; goto __pyx_L0; } /* "petsc4py/PETSc/petscts.pxi":536 * cdef object monitorlist = Ts.get_attr('__monitor__') * if monitorlist is None: return PETSC_SUCCESS * for (monitor, args, kargs) in monitorlist: # <<<<<<<<<<<<<< * monitor(Ts, toInt(step), toReal(time), Vu, *args, **kargs) * return PETSC_SUCCESS */ if (likely(PyList_CheckExact(__pyx_v_monitorlist)) || PyTuple_CheckExact(__pyx_v_monitorlist)) { __pyx_t_1 = __pyx_v_monitorlist; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_monitorlist); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 536, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 536, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(24, 536, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(24, 536, __pyx_L1_error) #else __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 536, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(24, 536, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(24, 536, __pyx_L1_error) #else __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 536, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } } else { __pyx_t_5 = __pyx_t_4(__pyx_t_1); if (unlikely(!__pyx_t_5)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(24, 536, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_5); } if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) { PyObject* sequence = __pyx_t_5; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(24, 536, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_6 = PyList_GET_ITEM(sequence, 0); __pyx_t_7 = PyList_GET_ITEM(sequence, 1); __pyx_t_8 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); #else __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(24, 536, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(24, 536, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_8)) __PYX_ERR(24, 536, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); #endif __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { Py_ssize_t index = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(24, 536, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_10 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); index = 0; __pyx_t_6 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_6)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); index = 1; __pyx_t_7 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_7)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_7); index = 2; __pyx_t_8 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 3) < 0) __PYX_ERR(24, 536, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L7_unpacking_done; __pyx_L6_unpacking_failed:; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(24, 536, __pyx_L1_error) __pyx_L7_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_monitor, __pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF_SET(__pyx_v_args, __pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF_SET(__pyx_v_kargs, __pyx_t_8); __pyx_t_8 = 0; /* "petsc4py/PETSc/petscts.pxi":537 * if monitorlist is None: return PETSC_SUCCESS * for (monitor, args, kargs) in monitorlist: * monitor(Ts, toInt(step), toReal(time), Vu, *args, **kargs) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_step); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_time); if (unlikely(!__pyx_t_8)) __PYX_ERR(24, 537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = PyTuple_New(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(24, 537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF((PyObject *)__pyx_v_Ts); __Pyx_GIVEREF((PyObject *)__pyx_v_Ts); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_v_Ts))) __PYX_ERR(24, 537, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_5)) __PYX_ERR(24, 537, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_8)) __PYX_ERR(24, 537, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_Vu); __Pyx_GIVEREF((PyObject *)__pyx_v_Vu); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 3, ((PyObject *)__pyx_v_Vu))) __PYX_ERR(24, 537, __pyx_L1_error); __pyx_t_5 = 0; __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_8)) __PYX_ERR(24, 537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_5 = PyNumber_Add(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(24, 537, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_8 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_8)) __PYX_ERR(24, 537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } else { __pyx_t_8 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_8)) __PYX_ERR(24, 537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } __pyx_t_7 = __Pyx_PyObject_Call(__pyx_v_monitor, __pyx_t_5, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(24, 537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "petsc4py/PETSc/petscts.pxi":536 * cdef object monitorlist = Ts.get_attr('__monitor__') * if monitorlist is None: return PETSC_SUCCESS * for (monitor, args, kargs) in monitorlist: # <<<<<<<<<<<<<< * monitor(Ts, toInt(step), toReal(time), Vu, *args, **kargs) * return PETSC_SUCCESS */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscts.pxi":538 * for (monitor, args, kargs) in monitorlist: * monitor(Ts, toInt(step), toReal(time), Vu, *args, **kargs) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * # ----------------------------------------------------------------------------- */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petscts.pxi":525 * # ----------------------------------------------------------------------------- * * cdef PetscErrorCode TS_Monitor( # <<<<<<<<<<<<<< * PetscTS ts, * PetscInt step, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("petsc4py.PETSc.TS_Monitor", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Ts); __Pyx_XDECREF((PyObject *)__pyx_v_Vu); __Pyx_XDECREF(__pyx_v_monitorlist); __Pyx_XDECREF(__pyx_v_monitor); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petscts.pxi":542 * # ----------------------------------------------------------------------------- * * cdef PetscErrorCode TS_EventHandler( # <<<<<<<<<<<<<< * PetscTS ts, * PetscReal time, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TS_EventHandler(TS __pyx_v_ts, PetscReal __pyx_v_time, Vec __pyx_v_u, PetscScalar *__pyx_v_fvalue, CYTHON_UNUSED void *__pyx_v_ctx) { struct PyPetscTSObject *__pyx_v_Ts = 0; struct PyPetscVecObject *__pyx_v_Vu = 0; PyObject *__pyx_v_context = 0; PyObject *__pyx_v_eventhandler = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PetscInt __pyx_v_nevents; npy_intp __pyx_v_s; PyArrayObject *__pyx_v_fvalue_array = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *(*__pyx_t_6)(PyObject *); PetscErrorCode __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TS_EventHandler", 0); /* "petsc4py/PETSc/petscts.pxi":549 * void* ctx, * ) except PETSC_ERR_PYTHON with gil: * cdef TS Ts = ref_TS(ts) # <<<<<<<<<<<<<< * cdef Vec Vu = ref_Vec(u) * cdef object context = Ts.get_attr('__eventhandler__') */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TS(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 549, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Ts = ((struct PyPetscTSObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscts.pxi":550 * ) except PETSC_ERR_PYTHON with gil: * cdef TS Ts = ref_TS(ts) * cdef Vec Vu = ref_Vec(u) # <<<<<<<<<<<<<< * cdef object context = Ts.get_attr('__eventhandler__') * if context is None: return PETSC_SUCCESS */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_u)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Vu = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscts.pxi":551 * cdef TS Ts = ref_TS(ts) * cdef Vec Vu = ref_Vec(u) * cdef object context = Ts.get_attr('__eventhandler__') # <<<<<<<<<<<<<< * if context is None: return PETSC_SUCCESS * (eventhandler, args, kargs) = context */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_Ts->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Ts), ((char *)"__eventhandler__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/petscts.pxi":552 * cdef Vec Vu = ref_Vec(u) * cdef object context = Ts.get_attr('__eventhandler__') * if context is None: return PETSC_SUCCESS # <<<<<<<<<<<<<< * (eventhandler, args, kargs) = context * cdef PetscInt nevents = 0 */ __pyx_t_2 = (__pyx_v_context == Py_None); if (__pyx_t_2) { __pyx_r = PETSC_SUCCESS; goto __pyx_L0; } /* "petsc4py/PETSc/petscts.pxi":553 * cdef object context = Ts.get_attr('__eventhandler__') * if context is None: return PETSC_SUCCESS * (eventhandler, args, kargs) = context # <<<<<<<<<<<<<< * cdef PetscInt nevents = 0 * CHKERR( TSGetNumEvents(ts, &nevents) ) */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(24, 553, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); __pyx_t_4 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(24, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { Py_ssize_t index = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); index = 0; __pyx_t_1 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_1)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 2; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 3) < 0) __PYX_ERR(24, 553, __pyx_L1_error) __pyx_t_6 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L5_unpacking_done; __pyx_L4_unpacking_failed:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(24, 553, __pyx_L1_error) __pyx_L5_unpacking_done:; } __pyx_v_eventhandler = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_3; __pyx_t_3 = 0; __pyx_v_kargs = __pyx_t_4; __pyx_t_4 = 0; /* "petsc4py/PETSc/petscts.pxi":554 * if context is None: return PETSC_SUCCESS * (eventhandler, args, kargs) = context * cdef PetscInt nevents = 0 # <<<<<<<<<<<<<< * CHKERR( TSGetNumEvents(ts, &nevents) ) * cdef npy_intp s = nevents */ __pyx_v_nevents = 0; /* "petsc4py/PETSc/petscts.pxi":555 * (eventhandler, args, kargs) = context * cdef PetscInt nevents = 0 * CHKERR( TSGetNumEvents(ts, &nevents) ) # <<<<<<<<<<<<<< * cdef npy_intp s = nevents * fvalue_array = PyArray_SimpleNewFromData(1, &s, NPY_PETSC_SCALAR, fvalue) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetNumEvents(__pyx_v_ts, (&__pyx_v_nevents))); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(24, 555, __pyx_L1_error) /* "petsc4py/PETSc/petscts.pxi":556 * cdef PetscInt nevents = 0 * CHKERR( TSGetNumEvents(ts, &nevents) ) * cdef npy_intp s = nevents # <<<<<<<<<<<<<< * fvalue_array = PyArray_SimpleNewFromData(1, &s, NPY_PETSC_SCALAR, fvalue) * eventhandler(Ts, toReal(time), Vu, fvalue_array, *args, **kargs) */ __pyx_v_s = ((npy_intp)__pyx_v_nevents); /* "petsc4py/PETSc/petscts.pxi":557 * CHKERR( TSGetNumEvents(ts, &nevents) ) * cdef npy_intp s = nevents * fvalue_array = PyArray_SimpleNewFromData(1, &s, NPY_PETSC_SCALAR, fvalue) # <<<<<<<<<<<<<< * eventhandler(Ts, toReal(time), Vu, fvalue_array, *args, **kargs) * return PETSC_SUCCESS */ __pyx_t_4 = ((PyObject *)PyArray_SimpleNewFromData(1, (&__pyx_v_s), NPY_PETSC_SCALAR, __pyx_v_fvalue)); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 557, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_fvalue_array = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/petscts.pxi":558 * cdef npy_intp s = nevents * fvalue_array = PyArray_SimpleNewFromData(1, &s, NPY_PETSC_SCALAR, fvalue) * eventhandler(Ts, toReal(time), Vu, fvalue_array, *args, **kargs) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_time); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(24, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF((PyObject *)__pyx_v_Ts); __Pyx_GIVEREF((PyObject *)__pyx_v_Ts); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_Ts))) __PYX_ERR(24, 558, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4)) __PYX_ERR(24, 558, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_Vu); __Pyx_GIVEREF((PyObject *)__pyx_v_Vu); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_v_Vu))) __PYX_ERR(24, 558, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_fvalue_array); __Pyx_GIVEREF((PyObject *)__pyx_v_fvalue_array); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 3, ((PyObject *)__pyx_v_fvalue_array))) __PYX_ERR(24, 558, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(24, 558, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_4 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } else { __pyx_t_4 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_eventhandler, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(24, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/petscts.pxi":559 * fvalue_array = PyArray_SimpleNewFromData(1, &s, NPY_PETSC_SCALAR, fvalue) * eventhandler(Ts, toReal(time), Vu, fvalue_array, *args, **kargs) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * cdef PetscErrorCode TS_PostEvent( */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petscts.pxi":542 * # ----------------------------------------------------------------------------- * * cdef PetscErrorCode TS_EventHandler( # <<<<<<<<<<<<<< * PetscTS ts, * PetscReal time, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.TS_EventHandler", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Ts); __Pyx_XDECREF((PyObject *)__pyx_v_Vu); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_eventhandler); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XDECREF((PyObject *)__pyx_v_fvalue_array); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petscts.pxi":561 * return PETSC_SUCCESS * * cdef PetscErrorCode TS_PostEvent( # <<<<<<<<<<<<<< * PetscTS ts, * PetscInt nevents_zero, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TS_PostEvent(TS __pyx_v_ts, PetscInt __pyx_v_nevents_zero, PetscInt *__pyx_v_events_zero, PetscReal __pyx_v_time, Vec __pyx_v_u, PetscBool __pyx_v_forward, CYTHON_UNUSED void *__pyx_v_ctx) { struct PyPetscTSObject *__pyx_v_Ts = 0; struct PyPetscVecObject *__pyx_v_Vu = 0; PyObject *__pyx_v_context = 0; PyObject *__pyx_v_postevent = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; npy_intp __pyx_v_s; PyArrayObject *__pyx_v_events_zero_array = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *(*__pyx_t_6)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TS_PostEvent", 0); /* "petsc4py/PETSc/petscts.pxi":570 * void* ctx, * ) except PETSC_ERR_PYTHON with gil: * cdef TS Ts = ref_TS(ts) # <<<<<<<<<<<<<< * cdef Vec Vu = ref_Vec(u) * cdef object context = Ts.get_attr('__postevent__') */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TS(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 570, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Ts = ((struct PyPetscTSObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscts.pxi":571 * ) except PETSC_ERR_PYTHON with gil: * cdef TS Ts = ref_TS(ts) * cdef Vec Vu = ref_Vec(u) # <<<<<<<<<<<<<< * cdef object context = Ts.get_attr('__postevent__') * if context is None: return PETSC_SUCCESS */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_u)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 571, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Vu = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscts.pxi":572 * cdef TS Ts = ref_TS(ts) * cdef Vec Vu = ref_Vec(u) * cdef object context = Ts.get_attr('__postevent__') # <<<<<<<<<<<<<< * if context is None: return PETSC_SUCCESS * (postevent, args, kargs) = context */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_Ts->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Ts), ((char *)"__postevent__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/petscts.pxi":573 * cdef Vec Vu = ref_Vec(u) * cdef object context = Ts.get_attr('__postevent__') * if context is None: return PETSC_SUCCESS # <<<<<<<<<<<<<< * (postevent, args, kargs) = context * cdef npy_intp s = nevents_zero */ __pyx_t_2 = (__pyx_v_context == Py_None); if (__pyx_t_2) { __pyx_r = PETSC_SUCCESS; goto __pyx_L0; } /* "petsc4py/PETSc/petscts.pxi":574 * cdef object context = Ts.get_attr('__postevent__') * if context is None: return PETSC_SUCCESS * (postevent, args, kargs) = context # <<<<<<<<<<<<<< * cdef npy_intp s = nevents_zero * events_zero_array = PyArray_SimpleNewFromData(1, &s, NPY_PETSC_INT, events_zero) */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(24, 574, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); __pyx_t_4 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 574, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(24, 574, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 574, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { Py_ssize_t index = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 574, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); index = 0; __pyx_t_1 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_1)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 2; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 3) < 0) __PYX_ERR(24, 574, __pyx_L1_error) __pyx_t_6 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L5_unpacking_done; __pyx_L4_unpacking_failed:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(24, 574, __pyx_L1_error) __pyx_L5_unpacking_done:; } __pyx_v_postevent = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_3; __pyx_t_3 = 0; __pyx_v_kargs = __pyx_t_4; __pyx_t_4 = 0; /* "petsc4py/PETSc/petscts.pxi":575 * if context is None: return PETSC_SUCCESS * (postevent, args, kargs) = context * cdef npy_intp s = nevents_zero # <<<<<<<<<<<<<< * events_zero_array = PyArray_SimpleNewFromData(1, &s, NPY_PETSC_INT, events_zero) * postevent(Ts, events_zero_array, toReal(time), Vu, toBool(forward), *args, **kargs) */ __pyx_v_s = ((npy_intp)__pyx_v_nevents_zero); /* "petsc4py/PETSc/petscts.pxi":576 * (postevent, args, kargs) = context * cdef npy_intp s = nevents_zero * events_zero_array = PyArray_SimpleNewFromData(1, &s, NPY_PETSC_INT, events_zero) # <<<<<<<<<<<<<< * postevent(Ts, events_zero_array, toReal(time), Vu, toBool(forward), *args, **kargs) * return PETSC_SUCCESS */ __pyx_t_4 = ((PyObject *)PyArray_SimpleNewFromData(1, (&__pyx_v_s), NPY_PETSC_INT, __pyx_v_events_zero)); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 576, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_events_zero_array = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/petscts.pxi":577 * cdef npy_intp s = nevents_zero * events_zero_array = PyArray_SimpleNewFromData(1, &s, NPY_PETSC_INT, events_zero) * postevent(Ts, events_zero_array, toReal(time), Vu, toBool(forward), *args, **kargs) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_time); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_forward); if (unlikely(!__pyx_t_3)) __PYX_ERR(24, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF((PyObject *)__pyx_v_Ts); __Pyx_GIVEREF((PyObject *)__pyx_v_Ts); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_Ts))) __PYX_ERR(24, 577, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_events_zero_array); __Pyx_GIVEREF((PyObject *)__pyx_v_events_zero_array); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_events_zero_array))) __PYX_ERR(24, 577, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_4)) __PYX_ERR(24, 577, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_Vu); __Pyx_GIVEREF((PyObject *)__pyx_v_Vu); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_Vu))) __PYX_ERR(24, 577, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_t_3)) __PYX_ERR(24, 577, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(24, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(24, 577, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_3 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_3)) __PYX_ERR(24, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } else { __pyx_t_3 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_3)) __PYX_ERR(24, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_postevent, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscts.pxi":578 * events_zero_array = PyArray_SimpleNewFromData(1, &s, NPY_PETSC_INT, events_zero) * postevent(Ts, events_zero_array, toReal(time), Vu, toBool(forward), *args, **kargs) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * cdef PetscErrorCode TS_PreStep( */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petscts.pxi":561 * return PETSC_SUCCESS * * cdef PetscErrorCode TS_PostEvent( # <<<<<<<<<<<<<< * PetscTS ts, * PetscInt nevents_zero, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.TS_PostEvent", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Ts); __Pyx_XDECREF((PyObject *)__pyx_v_Vu); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_postevent); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XDECREF((PyObject *)__pyx_v_events_zero_array); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petscts.pxi":580 * return PETSC_SUCCESS * * cdef PetscErrorCode TS_PreStep( # <<<<<<<<<<<<<< * PetscTS ts, * ) except PETSC_ERR_PYTHON with gil: */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TS_PreStep(TS __pyx_v_ts) { struct PyPetscTSObject *__pyx_v_Ts = 0; PyObject *__pyx_v_prestep = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *(*__pyx_t_6)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TS_PreStep", 0); /* "petsc4py/PETSc/petscts.pxi":583 * PetscTS ts, * ) except PETSC_ERR_PYTHON with gil: * cdef TS Ts = ref_TS(ts) # <<<<<<<<<<<<<< * (prestep, args, kargs) = Ts.get_attr('__prestep__') * prestep(Ts, *args, **kargs) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TS(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Ts = ((struct PyPetscTSObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscts.pxi":584 * ) except PETSC_ERR_PYTHON with gil: * cdef TS Ts = ref_TS(ts) * (prestep, args, kargs) = Ts.get_attr('__prestep__') # <<<<<<<<<<<<<< * prestep(Ts, *args, **kargs) * return PETSC_SUCCESS */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_Ts->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Ts), ((char *)"__prestep__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(24, 584, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); __pyx_t_4 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(24, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(24, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 2; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 3) < 0) __PYX_ERR(24, 584, __pyx_L1_error) __pyx_t_6 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(24, 584, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_prestep = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_args = __pyx_t_3; __pyx_t_3 = 0; __pyx_v_kargs = __pyx_t_4; __pyx_t_4 = 0; /* "petsc4py/PETSc/petscts.pxi":585 * cdef TS Ts = ref_TS(ts) * (prestep, args, kargs) = Ts.get_attr('__prestep__') * prestep(Ts, *args, **kargs) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF((PyObject *)__pyx_v_Ts); __Pyx_GIVEREF((PyObject *)__pyx_v_Ts); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_Ts))) __PYX_ERR(24, 585, __pyx_L1_error); __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(24, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(24, 585, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_4 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } else { __pyx_t_4 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_prestep, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscts.pxi":586 * (prestep, args, kargs) = Ts.get_attr('__prestep__') * prestep(Ts, *args, **kargs) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * cdef PetscErrorCode TS_PostStep( */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petscts.pxi":580 * return PETSC_SUCCESS * * cdef PetscErrorCode TS_PreStep( # <<<<<<<<<<<<<< * PetscTS ts, * ) except PETSC_ERR_PYTHON with gil: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.TS_PreStep", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Ts); __Pyx_XDECREF(__pyx_v_prestep); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petscts.pxi":588 * return PETSC_SUCCESS * * cdef PetscErrorCode TS_PostStep( # <<<<<<<<<<<<<< * PetscTS ts, * ) except PETSC_ERR_PYTHON with gil: */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TS_PostStep(TS __pyx_v_ts) { struct PyPetscTSObject *__pyx_v_Ts = 0; PyObject *__pyx_v_poststep = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *(*__pyx_t_6)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TS_PostStep", 0); /* "petsc4py/PETSc/petscts.pxi":591 * PetscTS ts, * ) except PETSC_ERR_PYTHON with gil: * cdef TS Ts = ref_TS(ts) # <<<<<<<<<<<<<< * (poststep, args, kargs) = Ts.get_attr('__poststep__') * poststep(Ts, *args, **kargs) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TS(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 591, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Ts = ((struct PyPetscTSObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscts.pxi":592 * ) except PETSC_ERR_PYTHON with gil: * cdef TS Ts = ref_TS(ts) * (poststep, args, kargs) = Ts.get_attr('__poststep__') # <<<<<<<<<<<<<< * poststep(Ts, *args, **kargs) * return PETSC_SUCCESS */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_Ts->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Ts), ((char *)"__poststep__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(24, 592, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); __pyx_t_4 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(24, 592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(24, 592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 2; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 3) < 0) __PYX_ERR(24, 592, __pyx_L1_error) __pyx_t_6 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(24, 592, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_poststep = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_args = __pyx_t_3; __pyx_t_3 = 0; __pyx_v_kargs = __pyx_t_4; __pyx_t_4 = 0; /* "petsc4py/PETSc/petscts.pxi":593 * cdef TS Ts = ref_TS(ts) * (poststep, args, kargs) = Ts.get_attr('__poststep__') * poststep(Ts, *args, **kargs) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF((PyObject *)__pyx_v_Ts); __Pyx_GIVEREF((PyObject *)__pyx_v_Ts); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_Ts))) __PYX_ERR(24, 593, __pyx_L1_error); __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(24, 593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(24, 593, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_4 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } else { __pyx_t_4 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_poststep, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscts.pxi":594 * (poststep, args, kargs) = Ts.get_attr('__poststep__') * poststep(Ts, *args, **kargs) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * # ----------------------------------------------------------------------------- */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petscts.pxi":588 * return PETSC_SUCCESS * * cdef PetscErrorCode TS_PostStep( # <<<<<<<<<<<<<< * PetscTS ts, * ) except PETSC_ERR_PYTHON with gil: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.TS_PostStep", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Ts); __Pyx_XDECREF(__pyx_v_poststep); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petsctao.pxi":245 * # -------------------------------------------------------------------- * * cdef inline TAO ref_TAO(PetscTAO tao): # <<<<<<<<<<<<<< * cdef TAO ob = TAO() * ob.tao = tao */ static CYTHON_INLINE struct PyPetscTAOObject *__pyx_f_8petsc4py_5PETSc_ref_TAO(Tao __pyx_v_tao) { struct PyPetscTAOObject *__pyx_v_ob = 0; struct PyPetscTAOObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("ref_TAO", 1); /* "petsc4py/PETSc/petsctao.pxi":246 * * cdef inline TAO ref_TAO(PetscTAO tao): * cdef TAO ob = TAO() # <<<<<<<<<<<<<< * ob.tao = tao * CHKERR( PetscINCREF(ob.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_TAO)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_ob = ((struct PyPetscTAOObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petsctao.pxi":247 * cdef inline TAO ref_TAO(PetscTAO tao): * cdef TAO ob = TAO() * ob.tao = tao # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(ob.obj) ) * return ob */ __pyx_v_ob->tao = __pyx_v_tao; /* "petsc4py/PETSc/petsctao.pxi":248 * cdef TAO ob = TAO() * ob.tao = tao * CHKERR( PetscINCREF(ob.obj) ) # <<<<<<<<<<<<<< * return ob * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ob->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(25, 248, __pyx_L1_error) /* "petsc4py/PETSc/petsctao.pxi":249 * ob.tao = tao * CHKERR( PetscINCREF(ob.obj) ) * return ob # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_ob); __pyx_r = __pyx_v_ob; goto __pyx_L0; /* "petsc4py/PETSc/petsctao.pxi":245 * # -------------------------------------------------------------------- * * cdef inline TAO ref_TAO(PetscTAO tao): # <<<<<<<<<<<<<< * cdef TAO ob = TAO() * ob.tao = tao */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.ref_TAO", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petsctao.pxi":253 * # -------------------------------------------------------------------- * * cdef PetscErrorCode TAO_Objective(PetscTAO _tao, # <<<<<<<<<<<<<< * PetscVec _x, PetscReal *_f, * void *ctx) except PETSC_ERR_PYTHON with gil: */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TAO_Objective(Tao __pyx_v__tao, Vec __pyx_v__x, PetscReal *__pyx_v__f, void *__pyx_v_ctx) { struct PyPetscTAOObject *__pyx_v_tao = 0; struct PyPetscVecObject *__pyx_v_x = 0; PyObject *__pyx_v_context = NULL; PyObject *__pyx_v_objective = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PyObject *__pyx_v_retv = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); PetscReal __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TAO_Objective", 0); /* "petsc4py/PETSc/petsctao.pxi":257 * void *ctx) except PETSC_ERR_PYTHON with gil: * * cdef TAO tao = ref_TAO(_tao) # <<<<<<<<<<<<<< * cdef Vec x = ref_Vec(_x) * context = tao.get_attr("__objective__") */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TAO(__pyx_v__tao)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":258 * * cdef TAO tao = ref_TAO(_tao) * cdef Vec x = ref_Vec(_x) # <<<<<<<<<<<<<< * context = tao.get_attr("__objective__") * if context is None and ctx != NULL: context = ctx */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v__x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_x = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":259 * cdef TAO tao = ref_TAO(_tao) * cdef Vec x = ref_Vec(_x) * context = tao.get_attr("__objective__") # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_tao->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_tao), ((char *)"__objective__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":260 * cdef Vec x = ref_Vec(_x) * context = tao.get_attr("__objective__") * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple # sanity check * (objective, args, kargs) = context */ __pyx_t_3 = (__pyx_v_context == Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = (__pyx_v_ctx != NULL); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1); __pyx_t_1 = 0; } /* "petsc4py/PETSc/petsctao.pxi":261 * context = tao.get_attr("__objective__") * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check # <<<<<<<<<<<<<< * (objective, args, kargs) = context * retv = objective(tao, x, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_3 = (__pyx_v_context != Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_2 = __pyx_t_3; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(25, 261, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(25, 261, __pyx_L1_error) #endif /* "petsc4py/PETSc/petsctao.pxi":262 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check * (objective, args, kargs) = context # <<<<<<<<<<<<<< * retv = objective(tao, x, *args, **kargs) * _f[0] = asReal(retv) */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(25, 262, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); __pyx_t_5 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); index = 0; __pyx_t_1 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 2; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(25, 262, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(25, 262, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_objective = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_kargs = __pyx_t_5; __pyx_t_5 = 0; /* "petsc4py/PETSc/petsctao.pxi":263 * assert context is not None and type(context) is tuple # sanity check * (objective, args, kargs) = context * retv = objective(tao, x, *args, **kargs) # <<<<<<<<<<<<<< * _f[0] = asReal(retv) * return PETSC_SUCCESS */ __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF((PyObject *)__pyx_v_tao); __Pyx_GIVEREF((PyObject *)__pyx_v_tao); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_tao))) __PYX_ERR(25, 263, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_x); __Pyx_GIVEREF((PyObject *)__pyx_v_x); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_x))) __PYX_ERR(25, 263, __pyx_L1_error); __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(25, 263, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_4 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } else { __pyx_t_4 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_objective, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_retv = __pyx_t_5; __pyx_t_5 = 0; /* "petsc4py/PETSc/petsctao.pxi":264 * (objective, args, kargs) = context * retv = objective(tao, x, *args, **kargs) * _f[0] = asReal(retv) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_retv); if (unlikely(__pyx_t_8 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(25, 264, __pyx_L1_error) (__pyx_v__f[0]) = __pyx_t_8; /* "petsc4py/PETSc/petsctao.pxi":265 * retv = objective(tao, x, *args, **kargs) * _f[0] = asReal(retv) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * cdef PetscErrorCode TAO_Residual(PetscTAO _tao, */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petsctao.pxi":253 * # -------------------------------------------------------------------- * * cdef PetscErrorCode TAO_Objective(PetscTAO _tao, # <<<<<<<<<<<<<< * PetscVec _x, PetscReal *_f, * void *ctx) except PETSC_ERR_PYTHON with gil: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.TAO_Objective", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_tao); __Pyx_XDECREF((PyObject *)__pyx_v_x); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_objective); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XDECREF(__pyx_v_retv); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petsctao.pxi":267 * return PETSC_SUCCESS * * cdef PetscErrorCode TAO_Residual(PetscTAO _tao, # <<<<<<<<<<<<<< * PetscVec _x, PetscVec _r, * void *ctx) except PETSC_ERR_PYTHON with gil: */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TAO_Residual(Tao __pyx_v__tao, Vec __pyx_v__x, Vec __pyx_v__r, void *__pyx_v_ctx) { struct PyPetscTAOObject *__pyx_v_tao = 0; struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_r = 0; PyObject *__pyx_v_context = NULL; PyObject *__pyx_v_residual = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TAO_Residual", 0); /* "petsc4py/PETSc/petsctao.pxi":271 * void *ctx) except PETSC_ERR_PYTHON with gil: * * cdef TAO tao = ref_TAO(_tao) # <<<<<<<<<<<<<< * cdef Vec x = ref_Vec(_x) * cdef Vec r = ref_Vec(_r) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TAO(__pyx_v__tao)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":272 * * cdef TAO tao = ref_TAO(_tao) * cdef Vec x = ref_Vec(_x) # <<<<<<<<<<<<<< * cdef Vec r = ref_Vec(_r) * context = tao.get_attr("__residual__") */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v__x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_x = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":273 * cdef TAO tao = ref_TAO(_tao) * cdef Vec x = ref_Vec(_x) * cdef Vec r = ref_Vec(_r) # <<<<<<<<<<<<<< * context = tao.get_attr("__residual__") * if context is None and ctx != NULL: context = ctx */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v__r)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_r = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":274 * cdef Vec x = ref_Vec(_x) * cdef Vec r = ref_Vec(_r) * context = tao.get_attr("__residual__") # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_tao->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_tao), ((char *)"__residual__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":275 * cdef Vec r = ref_Vec(_r) * context = tao.get_attr("__residual__") * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple # sanity check * (residual, args, kargs) = context */ __pyx_t_3 = (__pyx_v_context == Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = (__pyx_v_ctx != NULL); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1); __pyx_t_1 = 0; } /* "petsc4py/PETSc/petsctao.pxi":276 * context = tao.get_attr("__residual__") * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check # <<<<<<<<<<<<<< * (residual, args, kargs) = context * residual(tao, x, r, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_3 = (__pyx_v_context != Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_2 = __pyx_t_3; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(25, 276, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(25, 276, __pyx_L1_error) #endif /* "petsc4py/PETSc/petsctao.pxi":277 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check * (residual, args, kargs) = context # <<<<<<<<<<<<<< * residual(tao, x, r, *args, **kargs) * return PETSC_SUCCESS */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(25, 277, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); __pyx_t_5 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); index = 0; __pyx_t_1 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 2; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(25, 277, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(25, 277, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_residual = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_kargs = __pyx_t_5; __pyx_t_5 = 0; /* "petsc4py/PETSc/petsctao.pxi":278 * assert context is not None and type(context) is tuple # sanity check * (residual, args, kargs) = context * residual(tao, x, r, *args, **kargs) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF((PyObject *)__pyx_v_tao); __Pyx_GIVEREF((PyObject *)__pyx_v_tao); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_tao))) __PYX_ERR(25, 278, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_x); __Pyx_GIVEREF((PyObject *)__pyx_v_x); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_x))) __PYX_ERR(25, 278, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_r); __Pyx_GIVEREF((PyObject *)__pyx_v_r); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, ((PyObject *)__pyx_v_r))) __PYX_ERR(25, 278, __pyx_L1_error); __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(25, 278, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_4 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } else { __pyx_t_4 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_residual, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/petsctao.pxi":279 * (residual, args, kargs) = context * residual(tao, x, r, *args, **kargs) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * cdef PetscErrorCode TAO_Gradient(PetscTAO _tao, */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petsctao.pxi":267 * return PETSC_SUCCESS * * cdef PetscErrorCode TAO_Residual(PetscTAO _tao, # <<<<<<<<<<<<<< * PetscVec _x, PetscVec _r, * void *ctx) except PETSC_ERR_PYTHON with gil: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.TAO_Residual", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_tao); __Pyx_XDECREF((PyObject *)__pyx_v_x); __Pyx_XDECREF((PyObject *)__pyx_v_r); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_residual); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petsctao.pxi":281 * return PETSC_SUCCESS * * cdef PetscErrorCode TAO_Gradient(PetscTAO _tao, # <<<<<<<<<<<<<< * PetscVec _x, PetscVec _g, * void *ctx) except PETSC_ERR_PYTHON with gil: */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TAO_Gradient(Tao __pyx_v__tao, Vec __pyx_v__x, Vec __pyx_v__g, void *__pyx_v_ctx) { struct PyPetscTAOObject *__pyx_v_tao = 0; struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_g = 0; PyObject *__pyx_v_context = NULL; PyObject *__pyx_v_gradient = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TAO_Gradient", 0); /* "petsc4py/PETSc/petsctao.pxi":285 * void *ctx) except PETSC_ERR_PYTHON with gil: * * cdef TAO tao = ref_TAO(_tao) # <<<<<<<<<<<<<< * cdef Vec x = ref_Vec(_x) * cdef Vec g = ref_Vec(_g) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TAO(__pyx_v__tao)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":286 * * cdef TAO tao = ref_TAO(_tao) * cdef Vec x = ref_Vec(_x) # <<<<<<<<<<<<<< * cdef Vec g = ref_Vec(_g) * context = tao.get_attr("__gradient__") */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v__x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_x = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":287 * cdef TAO tao = ref_TAO(_tao) * cdef Vec x = ref_Vec(_x) * cdef Vec g = ref_Vec(_g) # <<<<<<<<<<<<<< * context = tao.get_attr("__gradient__") * if context is None and ctx != NULL: context = ctx */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v__g)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_g = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":288 * cdef Vec x = ref_Vec(_x) * cdef Vec g = ref_Vec(_g) * context = tao.get_attr("__gradient__") # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_tao->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_tao), ((char *)"__gradient__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":289 * cdef Vec g = ref_Vec(_g) * context = tao.get_attr("__gradient__") * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple # sanity check * (gradient, args, kargs) = context */ __pyx_t_3 = (__pyx_v_context == Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = (__pyx_v_ctx != NULL); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1); __pyx_t_1 = 0; } /* "petsc4py/PETSc/petsctao.pxi":290 * context = tao.get_attr("__gradient__") * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check # <<<<<<<<<<<<<< * (gradient, args, kargs) = context * gradient(tao, x, g, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_3 = (__pyx_v_context != Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_2 = __pyx_t_3; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(25, 290, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(25, 290, __pyx_L1_error) #endif /* "petsc4py/PETSc/petsctao.pxi":291 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check * (gradient, args, kargs) = context # <<<<<<<<<<<<<< * gradient(tao, x, g, *args, **kargs) * return PETSC_SUCCESS */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(25, 291, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); __pyx_t_5 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); index = 0; __pyx_t_1 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 2; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(25, 291, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(25, 291, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_gradient = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_kargs = __pyx_t_5; __pyx_t_5 = 0; /* "petsc4py/PETSc/petsctao.pxi":292 * assert context is not None and type(context) is tuple # sanity check * (gradient, args, kargs) = context * gradient(tao, x, g, *args, **kargs) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF((PyObject *)__pyx_v_tao); __Pyx_GIVEREF((PyObject *)__pyx_v_tao); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_tao))) __PYX_ERR(25, 292, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_x); __Pyx_GIVEREF((PyObject *)__pyx_v_x); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_x))) __PYX_ERR(25, 292, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_g); __Pyx_GIVEREF((PyObject *)__pyx_v_g); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, ((PyObject *)__pyx_v_g))) __PYX_ERR(25, 292, __pyx_L1_error); __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(25, 292, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_4 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } else { __pyx_t_4 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_gradient, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/petsctao.pxi":293 * (gradient, args, kargs) = context * gradient(tao, x, g, *args, **kargs) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * cdef PetscErrorCode TAO_ObjGrad(PetscTAO _tao, */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petsctao.pxi":281 * return PETSC_SUCCESS * * cdef PetscErrorCode TAO_Gradient(PetscTAO _tao, # <<<<<<<<<<<<<< * PetscVec _x, PetscVec _g, * void *ctx) except PETSC_ERR_PYTHON with gil: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.TAO_Gradient", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_tao); __Pyx_XDECREF((PyObject *)__pyx_v_x); __Pyx_XDECREF((PyObject *)__pyx_v_g); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_gradient); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petsctao.pxi":295 * return PETSC_SUCCESS * * cdef PetscErrorCode TAO_ObjGrad(PetscTAO _tao, # <<<<<<<<<<<<<< * PetscVec _x, PetscReal *_f, PetscVec _g, * void *ctx) except PETSC_ERR_PYTHON with gil: */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TAO_ObjGrad(Tao __pyx_v__tao, Vec __pyx_v__x, PetscReal *__pyx_v__f, Vec __pyx_v__g, void *__pyx_v_ctx) { struct PyPetscTAOObject *__pyx_v_tao = 0; struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_g = 0; PyObject *__pyx_v_context = NULL; PyObject *__pyx_v_objgrad = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PyObject *__pyx_v_retv = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); PetscReal __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TAO_ObjGrad", 0); /* "petsc4py/PETSc/petsctao.pxi":299 * void *ctx) except PETSC_ERR_PYTHON with gil: * * cdef TAO tao = ref_TAO(_tao) # <<<<<<<<<<<<<< * cdef Vec x = ref_Vec(_x) * cdef Vec g = ref_Vec(_g) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TAO(__pyx_v__tao)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":300 * * cdef TAO tao = ref_TAO(_tao) * cdef Vec x = ref_Vec(_x) # <<<<<<<<<<<<<< * cdef Vec g = ref_Vec(_g) * context = tao.get_attr("__objgrad__") */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v__x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_x = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":301 * cdef TAO tao = ref_TAO(_tao) * cdef Vec x = ref_Vec(_x) * cdef Vec g = ref_Vec(_g) # <<<<<<<<<<<<<< * context = tao.get_attr("__objgrad__") * if context is None and ctx != NULL: context = ctx */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v__g)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_g = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":302 * cdef Vec x = ref_Vec(_x) * cdef Vec g = ref_Vec(_g) * context = tao.get_attr("__objgrad__") # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_tao->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_tao), ((char *)"__objgrad__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":303 * cdef Vec g = ref_Vec(_g) * context = tao.get_attr("__objgrad__") * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple # sanity check * (objgrad, args, kargs) = context */ __pyx_t_3 = (__pyx_v_context == Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = (__pyx_v_ctx != NULL); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1); __pyx_t_1 = 0; } /* "petsc4py/PETSc/petsctao.pxi":304 * context = tao.get_attr("__objgrad__") * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check # <<<<<<<<<<<<<< * (objgrad, args, kargs) = context * retv = objgrad(tao, x, g, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_3 = (__pyx_v_context != Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_2 = __pyx_t_3; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(25, 304, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(25, 304, __pyx_L1_error) #endif /* "petsc4py/PETSc/petsctao.pxi":305 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check * (objgrad, args, kargs) = context # <<<<<<<<<<<<<< * retv = objgrad(tao, x, g, *args, **kargs) * _f[0] = asReal(retv) */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(25, 305, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); __pyx_t_5 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); index = 0; __pyx_t_1 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 2; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(25, 305, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(25, 305, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_objgrad = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_kargs = __pyx_t_5; __pyx_t_5 = 0; /* "petsc4py/PETSc/petsctao.pxi":306 * assert context is not None and type(context) is tuple # sanity check * (objgrad, args, kargs) = context * retv = objgrad(tao, x, g, *args, **kargs) # <<<<<<<<<<<<<< * _f[0] = asReal(retv) * return PETSC_SUCCESS */ __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF((PyObject *)__pyx_v_tao); __Pyx_GIVEREF((PyObject *)__pyx_v_tao); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_tao))) __PYX_ERR(25, 306, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_x); __Pyx_GIVEREF((PyObject *)__pyx_v_x); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_x))) __PYX_ERR(25, 306, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_g); __Pyx_GIVEREF((PyObject *)__pyx_v_g); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, ((PyObject *)__pyx_v_g))) __PYX_ERR(25, 306, __pyx_L1_error); __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(25, 306, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_4 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } else { __pyx_t_4 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_objgrad, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_retv = __pyx_t_5; __pyx_t_5 = 0; /* "petsc4py/PETSc/petsctao.pxi":307 * (objgrad, args, kargs) = context * retv = objgrad(tao, x, g, *args, **kargs) * _f[0] = asReal(retv) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_retv); if (unlikely(__pyx_t_8 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(25, 307, __pyx_L1_error) (__pyx_v__f[0]) = __pyx_t_8; /* "petsc4py/PETSc/petsctao.pxi":308 * retv = objgrad(tao, x, g, *args, **kargs) * _f[0] = asReal(retv) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petsctao.pxi":295 * return PETSC_SUCCESS * * cdef PetscErrorCode TAO_ObjGrad(PetscTAO _tao, # <<<<<<<<<<<<<< * PetscVec _x, PetscReal *_f, PetscVec _g, * void *ctx) except PETSC_ERR_PYTHON with gil: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.TAO_ObjGrad", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_tao); __Pyx_XDECREF((PyObject *)__pyx_v_x); __Pyx_XDECREF((PyObject *)__pyx_v_g); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_objgrad); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XDECREF(__pyx_v_retv); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petsctao.pxi":311 * * * cdef PetscErrorCode TAO_BRGNRegObjGrad(PetscTAO _tao, # <<<<<<<<<<<<<< * PetscVec _x, PetscReal *_f, PetscVec _g, * void *ctx) except PETSC_ERR_PYTHON with gil: */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TAO_BRGNRegObjGrad(Tao __pyx_v__tao, Vec __pyx_v__x, PetscReal *__pyx_v__f, Vec __pyx_v__g, void *__pyx_v_ctx) { struct PyPetscTAOObject *__pyx_v_tao = 0; struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_g = 0; PyObject *__pyx_v_context = NULL; PyObject *__pyx_v_objgrad = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PyObject *__pyx_v_retv = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); PetscReal __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TAO_BRGNRegObjGrad", 0); /* "petsc4py/PETSc/petsctao.pxi":315 * void *ctx) except PETSC_ERR_PYTHON with gil: * * cdef TAO tao = ref_TAO(_tao) # <<<<<<<<<<<<<< * cdef Vec x = ref_Vec(_x) * cdef Vec g = ref_Vec(_g) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TAO(__pyx_v__tao)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 315, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":316 * * cdef TAO tao = ref_TAO(_tao) * cdef Vec x = ref_Vec(_x) # <<<<<<<<<<<<<< * cdef Vec g = ref_Vec(_g) * context = tao.get_attr("__brgnregobjgrad__") */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v__x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_x = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":317 * cdef TAO tao = ref_TAO(_tao) * cdef Vec x = ref_Vec(_x) * cdef Vec g = ref_Vec(_g) # <<<<<<<<<<<<<< * context = tao.get_attr("__brgnregobjgrad__") * if context is None and ctx != NULL: context = ctx */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v__g)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_g = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":318 * cdef Vec x = ref_Vec(_x) * cdef Vec g = ref_Vec(_g) * context = tao.get_attr("__brgnregobjgrad__") # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_tao->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_tao), ((char *)"__brgnregobjgrad__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":319 * cdef Vec g = ref_Vec(_g) * context = tao.get_attr("__brgnregobjgrad__") * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple # sanity check * (objgrad, args, kargs) = context */ __pyx_t_3 = (__pyx_v_context == Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = (__pyx_v_ctx != NULL); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1); __pyx_t_1 = 0; } /* "petsc4py/PETSc/petsctao.pxi":320 * context = tao.get_attr("__brgnregobjgrad__") * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check # <<<<<<<<<<<<<< * (objgrad, args, kargs) = context * retv = objgrad(tao, x, g, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_3 = (__pyx_v_context != Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_2 = __pyx_t_3; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(25, 320, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(25, 320, __pyx_L1_error) #endif /* "petsc4py/PETSc/petsctao.pxi":321 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check * (objgrad, args, kargs) = context # <<<<<<<<<<<<<< * retv = objgrad(tao, x, g, *args, **kargs) * _f[0] = asReal(retv) */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(25, 321, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); __pyx_t_5 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); index = 0; __pyx_t_1 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 2; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(25, 321, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(25, 321, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_objgrad = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_kargs = __pyx_t_5; __pyx_t_5 = 0; /* "petsc4py/PETSc/petsctao.pxi":322 * assert context is not None and type(context) is tuple # sanity check * (objgrad, args, kargs) = context * retv = objgrad(tao, x, g, *args, **kargs) # <<<<<<<<<<<<<< * _f[0] = asReal(retv) * return PETSC_SUCCESS */ __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF((PyObject *)__pyx_v_tao); __Pyx_GIVEREF((PyObject *)__pyx_v_tao); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_tao))) __PYX_ERR(25, 322, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_x); __Pyx_GIVEREF((PyObject *)__pyx_v_x); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_x))) __PYX_ERR(25, 322, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_g); __Pyx_GIVEREF((PyObject *)__pyx_v_g); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, ((PyObject *)__pyx_v_g))) __PYX_ERR(25, 322, __pyx_L1_error); __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(25, 322, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_4 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } else { __pyx_t_4 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_objgrad, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_retv = __pyx_t_5; __pyx_t_5 = 0; /* "petsc4py/PETSc/petsctao.pxi":323 * (objgrad, args, kargs) = context * retv = objgrad(tao, x, g, *args, **kargs) * _f[0] = asReal(retv) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_retv); if (unlikely(__pyx_t_8 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(25, 323, __pyx_L1_error) (__pyx_v__f[0]) = __pyx_t_8; /* "petsc4py/PETSc/petsctao.pxi":324 * retv = objgrad(tao, x, g, *args, **kargs) * _f[0] = asReal(retv) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * cdef PetscErrorCode TAO_Constraints(PetscTAO _tao, */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petsctao.pxi":311 * * * cdef PetscErrorCode TAO_BRGNRegObjGrad(PetscTAO _tao, # <<<<<<<<<<<<<< * PetscVec _x, PetscReal *_f, PetscVec _g, * void *ctx) except PETSC_ERR_PYTHON with gil: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.TAO_BRGNRegObjGrad", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_tao); __Pyx_XDECREF((PyObject *)__pyx_v_x); __Pyx_XDECREF((PyObject *)__pyx_v_g); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_objgrad); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XDECREF(__pyx_v_retv); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petsctao.pxi":326 * return PETSC_SUCCESS * * cdef PetscErrorCode TAO_Constraints(PetscTAO _tao, # <<<<<<<<<<<<<< * PetscVec _x, PetscVec _r, * void *ctx) except PETSC_ERR_PYTHON with gil: */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TAO_Constraints(Tao __pyx_v__tao, Vec __pyx_v__x, Vec __pyx_v__r, void *__pyx_v_ctx) { struct PyPetscTAOObject *__pyx_v_tao = 0; struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_r = 0; PyObject *__pyx_v_context = NULL; PyObject *__pyx_v_constraints = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TAO_Constraints", 0); /* "petsc4py/PETSc/petsctao.pxi":330 * void *ctx) except PETSC_ERR_PYTHON with gil: * * cdef TAO tao = ref_TAO(_tao) # <<<<<<<<<<<<<< * cdef Vec x = ref_Vec(_x) * cdef Vec r = ref_Vec(_r) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TAO(__pyx_v__tao)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":331 * * cdef TAO tao = ref_TAO(_tao) * cdef Vec x = ref_Vec(_x) # <<<<<<<<<<<<<< * cdef Vec r = ref_Vec(_r) * context = tao.get_attr("__constraints__") */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v__x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_x = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":332 * cdef TAO tao = ref_TAO(_tao) * cdef Vec x = ref_Vec(_x) * cdef Vec r = ref_Vec(_r) # <<<<<<<<<<<<<< * context = tao.get_attr("__constraints__") * if context is None and ctx != NULL: context = ctx */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v__r)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_r = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":333 * cdef Vec x = ref_Vec(_x) * cdef Vec r = ref_Vec(_r) * context = tao.get_attr("__constraints__") # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_tao->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_tao), ((char *)"__constraints__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":334 * cdef Vec r = ref_Vec(_r) * context = tao.get_attr("__constraints__") * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple # sanity check * (constraints, args, kargs) = context */ __pyx_t_3 = (__pyx_v_context == Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = (__pyx_v_ctx != NULL); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1); __pyx_t_1 = 0; } /* "petsc4py/PETSc/petsctao.pxi":335 * context = tao.get_attr("__constraints__") * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check # <<<<<<<<<<<<<< * (constraints, args, kargs) = context * constraints(tao, x, r, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_3 = (__pyx_v_context != Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_2 = __pyx_t_3; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(25, 335, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(25, 335, __pyx_L1_error) #endif /* "petsc4py/PETSc/petsctao.pxi":336 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check * (constraints, args, kargs) = context # <<<<<<<<<<<<<< * constraints(tao, x, r, *args, **kargs) * return PETSC_SUCCESS */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(25, 336, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); __pyx_t_5 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); index = 0; __pyx_t_1 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 2; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(25, 336, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(25, 336, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_constraints = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_kargs = __pyx_t_5; __pyx_t_5 = 0; /* "petsc4py/PETSc/petsctao.pxi":337 * assert context is not None and type(context) is tuple # sanity check * (constraints, args, kargs) = context * constraints(tao, x, r, *args, **kargs) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF((PyObject *)__pyx_v_tao); __Pyx_GIVEREF((PyObject *)__pyx_v_tao); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_tao))) __PYX_ERR(25, 337, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_x); __Pyx_GIVEREF((PyObject *)__pyx_v_x); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_x))) __PYX_ERR(25, 337, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_r); __Pyx_GIVEREF((PyObject *)__pyx_v_r); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, ((PyObject *)__pyx_v_r))) __PYX_ERR(25, 337, __pyx_L1_error); __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(25, 337, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_4 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } else { __pyx_t_4 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_constraints, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/petsctao.pxi":338 * (constraints, args, kargs) = context * constraints(tao, x, r, *args, **kargs) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * cdef PetscErrorCode TAO_VarBounds(PetscTAO _tao, */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petsctao.pxi":326 * return PETSC_SUCCESS * * cdef PetscErrorCode TAO_Constraints(PetscTAO _tao, # <<<<<<<<<<<<<< * PetscVec _x, PetscVec _r, * void *ctx) except PETSC_ERR_PYTHON with gil: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.TAO_Constraints", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_tao); __Pyx_XDECREF((PyObject *)__pyx_v_x); __Pyx_XDECREF((PyObject *)__pyx_v_r); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_constraints); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petsctao.pxi":340 * return PETSC_SUCCESS * * cdef PetscErrorCode TAO_VarBounds(PetscTAO _tao, # <<<<<<<<<<<<<< * PetscVec _xl, PetscVec _xu, * void *ctx) except PETSC_ERR_PYTHON with gil: */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TAO_VarBounds(Tao __pyx_v__tao, Vec __pyx_v__xl, Vec __pyx_v__xu, void *__pyx_v_ctx) { struct PyPetscTAOObject *__pyx_v_tao = 0; struct PyPetscVecObject *__pyx_v_xl = 0; struct PyPetscVecObject *__pyx_v_xu = 0; PyObject *__pyx_v_context = NULL; PyObject *__pyx_v_varbounds = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TAO_VarBounds", 0); /* "petsc4py/PETSc/petsctao.pxi":344 * void *ctx) except PETSC_ERR_PYTHON with gil: * * cdef TAO tao = ref_TAO(_tao) # <<<<<<<<<<<<<< * cdef Vec xl = ref_Vec(_xl) * cdef Vec xu = ref_Vec(_xu) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TAO(__pyx_v__tao)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":345 * * cdef TAO tao = ref_TAO(_tao) * cdef Vec xl = ref_Vec(_xl) # <<<<<<<<<<<<<< * cdef Vec xu = ref_Vec(_xu) * context = tao.get_attr("__varbounds__") */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v__xl)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 345, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_xl = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":346 * cdef TAO tao = ref_TAO(_tao) * cdef Vec xl = ref_Vec(_xl) * cdef Vec xu = ref_Vec(_xu) # <<<<<<<<<<<<<< * context = tao.get_attr("__varbounds__") * if context is None and ctx != NULL: context = ctx */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v__xu)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_xu = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":347 * cdef Vec xl = ref_Vec(_xl) * cdef Vec xu = ref_Vec(_xu) * context = tao.get_attr("__varbounds__") # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_tao->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_tao), ((char *)"__varbounds__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 347, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":348 * cdef Vec xu = ref_Vec(_xu) * context = tao.get_attr("__varbounds__") * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple # sanity check * (varbounds, args, kargs) = context */ __pyx_t_3 = (__pyx_v_context == Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = (__pyx_v_ctx != NULL); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1); __pyx_t_1 = 0; } /* "petsc4py/PETSc/petsctao.pxi":349 * context = tao.get_attr("__varbounds__") * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check # <<<<<<<<<<<<<< * (varbounds, args, kargs) = context * varbounds(tao, xl, xu, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_3 = (__pyx_v_context != Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_2 = __pyx_t_3; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(25, 349, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(25, 349, __pyx_L1_error) #endif /* "petsc4py/PETSc/petsctao.pxi":350 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check * (varbounds, args, kargs) = context # <<<<<<<<<<<<<< * varbounds(tao, xl, xu, *args, **kargs) * return PETSC_SUCCESS */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(25, 350, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); __pyx_t_5 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); index = 0; __pyx_t_1 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 2; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(25, 350, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(25, 350, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_varbounds = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_kargs = __pyx_t_5; __pyx_t_5 = 0; /* "petsc4py/PETSc/petsctao.pxi":351 * assert context is not None and type(context) is tuple # sanity check * (varbounds, args, kargs) = context * varbounds(tao, xl, xu, *args, **kargs) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF((PyObject *)__pyx_v_tao); __Pyx_GIVEREF((PyObject *)__pyx_v_tao); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_tao))) __PYX_ERR(25, 351, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_xl); __Pyx_GIVEREF((PyObject *)__pyx_v_xl); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_xl))) __PYX_ERR(25, 351, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_xu); __Pyx_GIVEREF((PyObject *)__pyx_v_xu); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, ((PyObject *)__pyx_v_xu))) __PYX_ERR(25, 351, __pyx_L1_error); __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(25, 351, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_4 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } else { __pyx_t_4 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_varbounds, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/petsctao.pxi":352 * (varbounds, args, kargs) = context * varbounds(tao, xl, xu, *args, **kargs) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * cdef PetscErrorCode TAO_Hessian(PetscTAO _tao, */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petsctao.pxi":340 * return PETSC_SUCCESS * * cdef PetscErrorCode TAO_VarBounds(PetscTAO _tao, # <<<<<<<<<<<<<< * PetscVec _xl, PetscVec _xu, * void *ctx) except PETSC_ERR_PYTHON with gil: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.TAO_VarBounds", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_tao); __Pyx_XDECREF((PyObject *)__pyx_v_xl); __Pyx_XDECREF((PyObject *)__pyx_v_xu); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_varbounds); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petsctao.pxi":354 * return PETSC_SUCCESS * * cdef PetscErrorCode TAO_Hessian(PetscTAO _tao, # <<<<<<<<<<<<<< * PetscVec _x, * PetscMat _H, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TAO_Hessian(Tao __pyx_v__tao, Vec __pyx_v__x, Mat __pyx_v__H, Mat __pyx_v__P, void *__pyx_v_ctx) { struct PyPetscTAOObject *__pyx_v_tao = 0; struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscMatObject *__pyx_v_H = 0; struct PyPetscMatObject *__pyx_v_P = 0; PyObject *__pyx_v_context = NULL; PyObject *__pyx_v_hessian = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TAO_Hessian", 0); /* "petsc4py/PETSc/petsctao.pxi":359 * PetscMat _P, * void* ctx) except PETSC_ERR_PYTHON with gil: * cdef TAO tao = ref_TAO(_tao) # <<<<<<<<<<<<<< * cdef Vec x = ref_Vec(_x) * cdef Mat H = ref_Mat(_H) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TAO(__pyx_v__tao)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":360 * void* ctx) except PETSC_ERR_PYTHON with gil: * cdef TAO tao = ref_TAO(_tao) * cdef Vec x = ref_Vec(_x) # <<<<<<<<<<<<<< * cdef Mat H = ref_Mat(_H) * cdef Mat P = ref_Mat(_P) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v__x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_x = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":361 * cdef TAO tao = ref_TAO(_tao) * cdef Vec x = ref_Vec(_x) * cdef Mat H = ref_Mat(_H) # <<<<<<<<<<<<<< * cdef Mat P = ref_Mat(_P) * context = tao.get_attr("__hessian__") */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v__H)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_H = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":362 * cdef Vec x = ref_Vec(_x) * cdef Mat H = ref_Mat(_H) * cdef Mat P = ref_Mat(_P) # <<<<<<<<<<<<<< * context = tao.get_attr("__hessian__") * if context is None and ctx != NULL: context = ctx */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v__P)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_P = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":363 * cdef Mat H = ref_Mat(_H) * cdef Mat P = ref_Mat(_P) * context = tao.get_attr("__hessian__") # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_tao->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_tao), ((char *)"__hessian__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":364 * cdef Mat P = ref_Mat(_P) * context = tao.get_attr("__hessian__") * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple # sanity check * (hessian, args, kargs) = context */ __pyx_t_3 = (__pyx_v_context == Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = (__pyx_v_ctx != NULL); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1); __pyx_t_1 = 0; } /* "petsc4py/PETSc/petsctao.pxi":365 * context = tao.get_attr("__hessian__") * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check # <<<<<<<<<<<<<< * (hessian, args, kargs) = context * hessian(tao, x, H, P, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_3 = (__pyx_v_context != Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_2 = __pyx_t_3; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(25, 365, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(25, 365, __pyx_L1_error) #endif /* "petsc4py/PETSc/petsctao.pxi":366 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check * (hessian, args, kargs) = context # <<<<<<<<<<<<<< * hessian(tao, x, H, P, *args, **kargs) * return PETSC_SUCCESS */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(25, 366, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); __pyx_t_5 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); index = 0; __pyx_t_1 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 2; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(25, 366, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(25, 366, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_hessian = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_kargs = __pyx_t_5; __pyx_t_5 = 0; /* "petsc4py/PETSc/petsctao.pxi":367 * assert context is not None and type(context) is tuple # sanity check * (hessian, args, kargs) = context * hessian(tao, x, H, P, *args, **kargs) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF((PyObject *)__pyx_v_tao); __Pyx_GIVEREF((PyObject *)__pyx_v_tao); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_tao))) __PYX_ERR(25, 367, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_x); __Pyx_GIVEREF((PyObject *)__pyx_v_x); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_x))) __PYX_ERR(25, 367, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_H); __Pyx_GIVEREF((PyObject *)__pyx_v_H); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, ((PyObject *)__pyx_v_H))) __PYX_ERR(25, 367, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_P); __Pyx_GIVEREF((PyObject *)__pyx_v_P); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 3, ((PyObject *)__pyx_v_P))) __PYX_ERR(25, 367, __pyx_L1_error); __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(25, 367, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_4 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } else { __pyx_t_4 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_hessian, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/petsctao.pxi":368 * (hessian, args, kargs) = context * hessian(tao, x, H, P, *args, **kargs) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * cdef PetscErrorCode TAO_BRGNRegHessian(PetscTAO _tao, */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petsctao.pxi":354 * return PETSC_SUCCESS * * cdef PetscErrorCode TAO_Hessian(PetscTAO _tao, # <<<<<<<<<<<<<< * PetscVec _x, * PetscMat _H, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.TAO_Hessian", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_tao); __Pyx_XDECREF((PyObject *)__pyx_v_x); __Pyx_XDECREF((PyObject *)__pyx_v_H); __Pyx_XDECREF((PyObject *)__pyx_v_P); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_hessian); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petsctao.pxi":370 * return PETSC_SUCCESS * * cdef PetscErrorCode TAO_BRGNRegHessian(PetscTAO _tao, # <<<<<<<<<<<<<< * PetscVec _x, * PetscMat _H, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TAO_BRGNRegHessian(Tao __pyx_v__tao, Vec __pyx_v__x, Mat __pyx_v__H, void *__pyx_v_ctx) { struct PyPetscTAOObject *__pyx_v_tao = 0; struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscMatObject *__pyx_v_H = 0; PyObject *__pyx_v_context = NULL; PyObject *__pyx_v_hessian = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TAO_BRGNRegHessian", 0); /* "petsc4py/PETSc/petsctao.pxi":374 * PetscMat _H, * void* ctx) except PETSC_ERR_PYTHON with gil: * cdef TAO tao = ref_TAO(_tao) # <<<<<<<<<<<<<< * cdef Vec x = ref_Vec(_x) * cdef Mat H = ref_Mat(_H) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TAO(__pyx_v__tao)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":375 * void* ctx) except PETSC_ERR_PYTHON with gil: * cdef TAO tao = ref_TAO(_tao) * cdef Vec x = ref_Vec(_x) # <<<<<<<<<<<<<< * cdef Mat H = ref_Mat(_H) * context = tao.get_attr("__brgnreghessian__") */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v__x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_x = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":376 * cdef TAO tao = ref_TAO(_tao) * cdef Vec x = ref_Vec(_x) * cdef Mat H = ref_Mat(_H) # <<<<<<<<<<<<<< * context = tao.get_attr("__brgnreghessian__") * if context is None and ctx != NULL: context = ctx */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v__H)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_H = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":377 * cdef Vec x = ref_Vec(_x) * cdef Mat H = ref_Mat(_H) * context = tao.get_attr("__brgnreghessian__") # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_tao->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_tao), ((char *)"__brgnreghessian__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":378 * cdef Mat H = ref_Mat(_H) * context = tao.get_attr("__brgnreghessian__") * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple # sanity check * (hessian, args, kargs) = context */ __pyx_t_3 = (__pyx_v_context == Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = (__pyx_v_ctx != NULL); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1); __pyx_t_1 = 0; } /* "petsc4py/PETSc/petsctao.pxi":379 * context = tao.get_attr("__brgnreghessian__") * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check # <<<<<<<<<<<<<< * (hessian, args, kargs) = context * hessian(tao, x, H, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_3 = (__pyx_v_context != Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_2 = __pyx_t_3; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(25, 379, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(25, 379, __pyx_L1_error) #endif /* "petsc4py/PETSc/petsctao.pxi":380 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check * (hessian, args, kargs) = context # <<<<<<<<<<<<<< * hessian(tao, x, H, *args, **kargs) * return PETSC_SUCCESS */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(25, 380, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); __pyx_t_5 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); index = 0; __pyx_t_1 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 2; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(25, 380, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(25, 380, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_hessian = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_kargs = __pyx_t_5; __pyx_t_5 = 0; /* "petsc4py/PETSc/petsctao.pxi":381 * assert context is not None and type(context) is tuple # sanity check * (hessian, args, kargs) = context * hessian(tao, x, H, *args, **kargs) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF((PyObject *)__pyx_v_tao); __Pyx_GIVEREF((PyObject *)__pyx_v_tao); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_tao))) __PYX_ERR(25, 381, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_x); __Pyx_GIVEREF((PyObject *)__pyx_v_x); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_x))) __PYX_ERR(25, 381, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_H); __Pyx_GIVEREF((PyObject *)__pyx_v_H); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, ((PyObject *)__pyx_v_H))) __PYX_ERR(25, 381, __pyx_L1_error); __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(25, 381, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_4 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } else { __pyx_t_4 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_hessian, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/petsctao.pxi":382 * (hessian, args, kargs) = context * hessian(tao, x, H, *args, **kargs) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * cdef PetscErrorCode TAO_Jacobian(PetscTAO _tao, */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petsctao.pxi":370 * return PETSC_SUCCESS * * cdef PetscErrorCode TAO_BRGNRegHessian(PetscTAO _tao, # <<<<<<<<<<<<<< * PetscVec _x, * PetscMat _H, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.TAO_BRGNRegHessian", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_tao); __Pyx_XDECREF((PyObject *)__pyx_v_x); __Pyx_XDECREF((PyObject *)__pyx_v_H); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_hessian); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petsctao.pxi":384 * return PETSC_SUCCESS * * cdef PetscErrorCode TAO_Jacobian(PetscTAO _tao, # <<<<<<<<<<<<<< * PetscVec _x, * PetscMat _J, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TAO_Jacobian(Tao __pyx_v__tao, Vec __pyx_v__x, Mat __pyx_v__J, Mat __pyx_v__P, void *__pyx_v_ctx) { struct PyPetscTAOObject *__pyx_v_tao = 0; struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscMatObject *__pyx_v_J = 0; struct PyPetscMatObject *__pyx_v_P = 0; PyObject *__pyx_v_context = NULL; PyObject *__pyx_v_jacobian = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TAO_Jacobian", 0); /* "petsc4py/PETSc/petsctao.pxi":389 * PetscMat _P, * void* ctx) except PETSC_ERR_PYTHON with gil: * cdef TAO tao = ref_TAO(_tao) # <<<<<<<<<<<<<< * cdef Vec x = ref_Vec(_x) * cdef Mat J = ref_Mat(_J) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TAO(__pyx_v__tao)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":390 * void* ctx) except PETSC_ERR_PYTHON with gil: * cdef TAO tao = ref_TAO(_tao) * cdef Vec x = ref_Vec(_x) # <<<<<<<<<<<<<< * cdef Mat J = ref_Mat(_J) * cdef Mat P = ref_Mat(_P) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v__x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_x = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":391 * cdef TAO tao = ref_TAO(_tao) * cdef Vec x = ref_Vec(_x) * cdef Mat J = ref_Mat(_J) # <<<<<<<<<<<<<< * cdef Mat P = ref_Mat(_P) * context = tao.get_attr("__jacobian__") */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v__J)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_J = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":392 * cdef Vec x = ref_Vec(_x) * cdef Mat J = ref_Mat(_J) * cdef Mat P = ref_Mat(_P) # <<<<<<<<<<<<<< * context = tao.get_attr("__jacobian__") * if context is None and ctx != NULL: context = ctx */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v__P)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_P = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":393 * cdef Mat J = ref_Mat(_J) * cdef Mat P = ref_Mat(_P) * context = tao.get_attr("__jacobian__") # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_tao->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_tao), ((char *)"__jacobian__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":394 * cdef Mat P = ref_Mat(_P) * context = tao.get_attr("__jacobian__") * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple # sanity check * (jacobian, args, kargs) = context */ __pyx_t_3 = (__pyx_v_context == Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = (__pyx_v_ctx != NULL); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1); __pyx_t_1 = 0; } /* "petsc4py/PETSc/petsctao.pxi":395 * context = tao.get_attr("__jacobian__") * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check # <<<<<<<<<<<<<< * (jacobian, args, kargs) = context * jacobian(tao, x, J, P, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_3 = (__pyx_v_context != Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_2 = __pyx_t_3; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(25, 395, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(25, 395, __pyx_L1_error) #endif /* "petsc4py/PETSc/petsctao.pxi":396 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check * (jacobian, args, kargs) = context # <<<<<<<<<<<<<< * jacobian(tao, x, J, P, *args, **kargs) * return PETSC_SUCCESS */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(25, 396, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); __pyx_t_5 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 396, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 396, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 396, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 396, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); index = 0; __pyx_t_1 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 2; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(25, 396, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(25, 396, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_jacobian = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_kargs = __pyx_t_5; __pyx_t_5 = 0; /* "petsc4py/PETSc/petsctao.pxi":397 * assert context is not None and type(context) is tuple # sanity check * (jacobian, args, kargs) = context * jacobian(tao, x, J, P, *args, **kargs) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 397, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF((PyObject *)__pyx_v_tao); __Pyx_GIVEREF((PyObject *)__pyx_v_tao); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_tao))) __PYX_ERR(25, 397, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_x); __Pyx_GIVEREF((PyObject *)__pyx_v_x); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_x))) __PYX_ERR(25, 397, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_J); __Pyx_GIVEREF((PyObject *)__pyx_v_J); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, ((PyObject *)__pyx_v_J))) __PYX_ERR(25, 397, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_P); __Pyx_GIVEREF((PyObject *)__pyx_v_P); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 3, ((PyObject *)__pyx_v_P))) __PYX_ERR(25, 397, __pyx_L1_error); __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 397, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 397, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(25, 397, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_4 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 397, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } else { __pyx_t_4 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 397, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_jacobian, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 397, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/petsctao.pxi":398 * (jacobian, args, kargs) = context * jacobian(tao, x, J, P, *args, **kargs) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * cdef PetscErrorCode TAO_JacobianResidual(PetscTAO _tao, */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petsctao.pxi":384 * return PETSC_SUCCESS * * cdef PetscErrorCode TAO_Jacobian(PetscTAO _tao, # <<<<<<<<<<<<<< * PetscVec _x, * PetscMat _J, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.TAO_Jacobian", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_tao); __Pyx_XDECREF((PyObject *)__pyx_v_x); __Pyx_XDECREF((PyObject *)__pyx_v_J); __Pyx_XDECREF((PyObject *)__pyx_v_P); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_jacobian); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petsctao.pxi":400 * return PETSC_SUCCESS * * cdef PetscErrorCode TAO_JacobianResidual(PetscTAO _tao, # <<<<<<<<<<<<<< * PetscVec _x, * PetscMat _J, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TAO_JacobianResidual(Tao __pyx_v__tao, Vec __pyx_v__x, Mat __pyx_v__J, Mat __pyx_v__P, void *__pyx_v_ctx) { struct PyPetscTAOObject *__pyx_v_tao = 0; struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscMatObject *__pyx_v_J = 0; struct PyPetscMatObject *__pyx_v_P = 0; PyObject *__pyx_v_context = NULL; PyObject *__pyx_v_jacobian = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TAO_JacobianResidual", 0); /* "petsc4py/PETSc/petsctao.pxi":405 * PetscMat _P, * void* ctx) except PETSC_ERR_PYTHON with gil: * cdef TAO tao = ref_TAO(_tao) # <<<<<<<<<<<<<< * cdef Vec x = ref_Vec(_x) * cdef Mat J = ref_Mat(_J) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TAO(__pyx_v__tao)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":406 * void* ctx) except PETSC_ERR_PYTHON with gil: * cdef TAO tao = ref_TAO(_tao) * cdef Vec x = ref_Vec(_x) # <<<<<<<<<<<<<< * cdef Mat J = ref_Mat(_J) * cdef Mat P = ref_Mat(_P) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v__x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_x = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":407 * cdef TAO tao = ref_TAO(_tao) * cdef Vec x = ref_Vec(_x) * cdef Mat J = ref_Mat(_J) # <<<<<<<<<<<<<< * cdef Mat P = ref_Mat(_P) * context = tao.get_attr("__jacobian_residual__") */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v__J)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 407, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_J = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":408 * cdef Vec x = ref_Vec(_x) * cdef Mat J = ref_Mat(_J) * cdef Mat P = ref_Mat(_P) # <<<<<<<<<<<<<< * context = tao.get_attr("__jacobian_residual__") * if context is None and ctx != NULL: context = ctx */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v__P)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_P = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":409 * cdef Mat J = ref_Mat(_J) * cdef Mat P = ref_Mat(_P) * context = tao.get_attr("__jacobian_residual__") # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_tao->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_tao), ((char *)"__jacobian_residual__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":410 * cdef Mat P = ref_Mat(_P) * context = tao.get_attr("__jacobian_residual__") * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple # sanity check * (jacobian, args, kargs) = context */ __pyx_t_3 = (__pyx_v_context == Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = (__pyx_v_ctx != NULL); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1); __pyx_t_1 = 0; } /* "petsc4py/PETSc/petsctao.pxi":411 * context = tao.get_attr("__jacobian_residual__") * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check # <<<<<<<<<<<<<< * (jacobian, args, kargs) = context * jacobian(tao, x, J, P, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_3 = (__pyx_v_context != Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_2 = __pyx_t_3; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(25, 411, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(25, 411, __pyx_L1_error) #endif /* "petsc4py/PETSc/petsctao.pxi":412 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check * (jacobian, args, kargs) = context # <<<<<<<<<<<<<< * jacobian(tao, x, J, P, *args, **kargs) * return PETSC_SUCCESS */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(25, 412, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); __pyx_t_5 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); index = 0; __pyx_t_1 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 2; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(25, 412, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(25, 412, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_jacobian = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_kargs = __pyx_t_5; __pyx_t_5 = 0; /* "petsc4py/PETSc/petsctao.pxi":413 * assert context is not None and type(context) is tuple # sanity check * (jacobian, args, kargs) = context * jacobian(tao, x, J, P, *args, **kargs) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF((PyObject *)__pyx_v_tao); __Pyx_GIVEREF((PyObject *)__pyx_v_tao); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_tao))) __PYX_ERR(25, 413, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_x); __Pyx_GIVEREF((PyObject *)__pyx_v_x); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_x))) __PYX_ERR(25, 413, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_J); __Pyx_GIVEREF((PyObject *)__pyx_v_J); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, ((PyObject *)__pyx_v_J))) __PYX_ERR(25, 413, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_P); __Pyx_GIVEREF((PyObject *)__pyx_v_P); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 3, ((PyObject *)__pyx_v_P))) __PYX_ERR(25, 413, __pyx_L1_error); __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(25, 413, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_4 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } else { __pyx_t_4 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_jacobian, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/petsctao.pxi":414 * (jacobian, args, kargs) = context * jacobian(tao, x, J, P, *args, **kargs) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * cdef PetscErrorCode TAO_JacobianState(PetscTAO _tao, */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petsctao.pxi":400 * return PETSC_SUCCESS * * cdef PetscErrorCode TAO_JacobianResidual(PetscTAO _tao, # <<<<<<<<<<<<<< * PetscVec _x, * PetscMat _J, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.TAO_JacobianResidual", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_tao); __Pyx_XDECREF((PyObject *)__pyx_v_x); __Pyx_XDECREF((PyObject *)__pyx_v_J); __Pyx_XDECREF((PyObject *)__pyx_v_P); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_jacobian); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petsctao.pxi":416 * return PETSC_SUCCESS * * cdef PetscErrorCode TAO_JacobianState(PetscTAO _tao, # <<<<<<<<<<<<<< * PetscVec _x, * PetscMat _J, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TAO_JacobianState(Tao __pyx_v__tao, Vec __pyx_v__x, Mat __pyx_v__J, Mat __pyx_v__P, Mat __pyx_v__I, void *__pyx_v_ctx) { struct PyPetscTAOObject *__pyx_v_tao = 0; struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscMatObject *__pyx_v_J = 0; struct PyPetscMatObject *__pyx_v_P = 0; struct PyPetscMatObject *__pyx_v_I = 0; PyObject *__pyx_v_context = NULL; PyObject *__pyx_v_jacobian = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TAO_JacobianState", 0); /* "petsc4py/PETSc/petsctao.pxi":422 * PetscMat _I, * void* ctx) except PETSC_ERR_PYTHON with gil: * cdef TAO tao = ref_TAO(_tao) # <<<<<<<<<<<<<< * cdef Vec x = ref_Vec(_x) * cdef Mat J = ref_Mat(_J) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TAO(__pyx_v__tao)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":423 * void* ctx) except PETSC_ERR_PYTHON with gil: * cdef TAO tao = ref_TAO(_tao) * cdef Vec x = ref_Vec(_x) # <<<<<<<<<<<<<< * cdef Mat J = ref_Mat(_J) * cdef Mat P = ref_Mat(_P) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v__x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_x = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":424 * cdef TAO tao = ref_TAO(_tao) * cdef Vec x = ref_Vec(_x) * cdef Mat J = ref_Mat(_J) # <<<<<<<<<<<<<< * cdef Mat P = ref_Mat(_P) * cdef Mat I = ref_Mat(_I) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v__J)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 424, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_J = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":425 * cdef Vec x = ref_Vec(_x) * cdef Mat J = ref_Mat(_J) * cdef Mat P = ref_Mat(_P) # <<<<<<<<<<<<<< * cdef Mat I = ref_Mat(_I) * context = tao.get_attr("__jacobian_state__") */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v__P)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_P = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":426 * cdef Mat J = ref_Mat(_J) * cdef Mat P = ref_Mat(_P) * cdef Mat I = ref_Mat(_I) # <<<<<<<<<<<<<< * context = tao.get_attr("__jacobian_state__") * if context is None and ctx != NULL: context = ctx */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v__I)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 426, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_I = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":427 * cdef Mat P = ref_Mat(_P) * cdef Mat I = ref_Mat(_I) * context = tao.get_attr("__jacobian_state__") # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_tao->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_tao), ((char *)"__jacobian_state__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":428 * cdef Mat I = ref_Mat(_I) * context = tao.get_attr("__jacobian_state__") * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple # sanity check * (jacobian, args, kargs) = context */ __pyx_t_3 = (__pyx_v_context == Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = (__pyx_v_ctx != NULL); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1); __pyx_t_1 = 0; } /* "petsc4py/PETSc/petsctao.pxi":429 * context = tao.get_attr("__jacobian_state__") * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check # <<<<<<<<<<<<<< * (jacobian, args, kargs) = context * jacobian(tao, x, J, P, I, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_3 = (__pyx_v_context != Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_2 = __pyx_t_3; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(25, 429, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(25, 429, __pyx_L1_error) #endif /* "petsc4py/PETSc/petsctao.pxi":430 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check * (jacobian, args, kargs) = context # <<<<<<<<<<<<<< * jacobian(tao, x, J, P, I, *args, **kargs) * return PETSC_SUCCESS */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(25, 430, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); __pyx_t_5 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); index = 0; __pyx_t_1 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 2; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(25, 430, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(25, 430, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_jacobian = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_kargs = __pyx_t_5; __pyx_t_5 = 0; /* "petsc4py/PETSc/petsctao.pxi":431 * assert context is not None and type(context) is tuple # sanity check * (jacobian, args, kargs) = context * jacobian(tao, x, J, P, I, *args, **kargs) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_5 = PyTuple_New(5); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 431, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF((PyObject *)__pyx_v_tao); __Pyx_GIVEREF((PyObject *)__pyx_v_tao); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_tao))) __PYX_ERR(25, 431, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_x); __Pyx_GIVEREF((PyObject *)__pyx_v_x); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_x))) __PYX_ERR(25, 431, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_J); __Pyx_GIVEREF((PyObject *)__pyx_v_J); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, ((PyObject *)__pyx_v_J))) __PYX_ERR(25, 431, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_P); __Pyx_GIVEREF((PyObject *)__pyx_v_P); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 3, ((PyObject *)__pyx_v_P))) __PYX_ERR(25, 431, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_I); __Pyx_GIVEREF((PyObject *)__pyx_v_I); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 4, ((PyObject *)__pyx_v_I))) __PYX_ERR(25, 431, __pyx_L1_error); __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 431, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 431, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(25, 431, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_4 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 431, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } else { __pyx_t_4 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 431, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_jacobian, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 431, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/petsctao.pxi":432 * (jacobian, args, kargs) = context * jacobian(tao, x, J, P, I, *args, **kargs) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * cdef PetscErrorCode TAO_JacobianDesign(PetscTAO _tao, */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petsctao.pxi":416 * return PETSC_SUCCESS * * cdef PetscErrorCode TAO_JacobianState(PetscTAO _tao, # <<<<<<<<<<<<<< * PetscVec _x, * PetscMat _J, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.TAO_JacobianState", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_tao); __Pyx_XDECREF((PyObject *)__pyx_v_x); __Pyx_XDECREF((PyObject *)__pyx_v_J); __Pyx_XDECREF((PyObject *)__pyx_v_P); __Pyx_XDECREF((PyObject *)__pyx_v_I); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_jacobian); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petsctao.pxi":434 * return PETSC_SUCCESS * * cdef PetscErrorCode TAO_JacobianDesign(PetscTAO _tao, # <<<<<<<<<<<<<< * PetscVec _x, * PetscMat _J, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TAO_JacobianDesign(Tao __pyx_v__tao, Vec __pyx_v__x, Mat __pyx_v__J, void *__pyx_v_ctx) { struct PyPetscTAOObject *__pyx_v_tao = 0; struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscMatObject *__pyx_v_J = 0; PyObject *__pyx_v_context = NULL; PyObject *__pyx_v_jacobian = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TAO_JacobianDesign", 0); /* "petsc4py/PETSc/petsctao.pxi":438 * PetscMat _J, * void* ctx) except PETSC_ERR_PYTHON with gil: * cdef TAO tao = ref_TAO(_tao) # <<<<<<<<<<<<<< * cdef Vec x = ref_Vec(_x) * cdef Mat J = ref_Mat(_J) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TAO(__pyx_v__tao)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":439 * void* ctx) except PETSC_ERR_PYTHON with gil: * cdef TAO tao = ref_TAO(_tao) * cdef Vec x = ref_Vec(_x) # <<<<<<<<<<<<<< * cdef Mat J = ref_Mat(_J) * context = tao.get_attr("__jacobian_design__") */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v__x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 439, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_x = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":440 * cdef TAO tao = ref_TAO(_tao) * cdef Vec x = ref_Vec(_x) * cdef Mat J = ref_Mat(_J) # <<<<<<<<<<<<<< * context = tao.get_attr("__jacobian_design__") * if context is None and ctx != NULL: context = ctx */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v__J)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_J = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":441 * cdef Vec x = ref_Vec(_x) * cdef Mat J = ref_Mat(_J) * context = tao.get_attr("__jacobian_design__") # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_tao->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_tao), ((char *)"__jacobian_design__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 441, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":442 * cdef Mat J = ref_Mat(_J) * context = tao.get_attr("__jacobian_design__") * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple # sanity check * (jacobian, args, kargs) = context */ __pyx_t_3 = (__pyx_v_context == Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = (__pyx_v_ctx != NULL); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1); __pyx_t_1 = 0; } /* "petsc4py/PETSc/petsctao.pxi":443 * context = tao.get_attr("__jacobian_design__") * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check # <<<<<<<<<<<<<< * (jacobian, args, kargs) = context * jacobian(tao, x, J, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_3 = (__pyx_v_context != Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_2 = __pyx_t_3; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(25, 443, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(25, 443, __pyx_L1_error) #endif /* "petsc4py/PETSc/petsctao.pxi":444 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check * (jacobian, args, kargs) = context # <<<<<<<<<<<<<< * jacobian(tao, x, J, *args, **kargs) * return PETSC_SUCCESS */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(25, 444, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); __pyx_t_5 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); index = 0; __pyx_t_1 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 2; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(25, 444, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(25, 444, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_jacobian = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_kargs = __pyx_t_5; __pyx_t_5 = 0; /* "petsc4py/PETSc/petsctao.pxi":445 * assert context is not None and type(context) is tuple # sanity check * (jacobian, args, kargs) = context * jacobian(tao, x, J, *args, **kargs) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF((PyObject *)__pyx_v_tao); __Pyx_GIVEREF((PyObject *)__pyx_v_tao); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_tao))) __PYX_ERR(25, 445, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_x); __Pyx_GIVEREF((PyObject *)__pyx_v_x); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_x))) __PYX_ERR(25, 445, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_J); __Pyx_GIVEREF((PyObject *)__pyx_v_J); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, ((PyObject *)__pyx_v_J))) __PYX_ERR(25, 445, __pyx_L1_error); __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(25, 445, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_4 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } else { __pyx_t_4 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_jacobian, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/petsctao.pxi":446 * (jacobian, args, kargs) = context * jacobian(tao, x, J, *args, **kargs) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * cdef PetscErrorCode TAO_EqualityConstraints(PetscTAO _tao, */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petsctao.pxi":434 * return PETSC_SUCCESS * * cdef PetscErrorCode TAO_JacobianDesign(PetscTAO _tao, # <<<<<<<<<<<<<< * PetscVec _x, * PetscMat _J, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.TAO_JacobianDesign", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_tao); __Pyx_XDECREF((PyObject *)__pyx_v_x); __Pyx_XDECREF((PyObject *)__pyx_v_J); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_jacobian); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petsctao.pxi":448 * return PETSC_SUCCESS * * cdef PetscErrorCode TAO_EqualityConstraints(PetscTAO _tao, # <<<<<<<<<<<<<< * PetscVec _x, * PetscVec _c, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TAO_EqualityConstraints(Tao __pyx_v__tao, Vec __pyx_v__x, Vec __pyx_v__c, void *__pyx_v_ctx) { struct PyPetscTAOObject *__pyx_v_tao = 0; struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_c = 0; PyObject *__pyx_v_context = NULL; PyObject *__pyx_v_f = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TAO_EqualityConstraints", 0); /* "petsc4py/PETSc/petsctao.pxi":452 * PetscVec _c, * void* ctx) except PETSC_ERR_PYTHON with gil: * cdef TAO tao = ref_TAO(_tao) # <<<<<<<<<<<<<< * cdef Vec x = ref_Vec(_x) * cdef Vec c = ref_Vec(_c) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TAO(__pyx_v__tao)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":453 * void* ctx) except PETSC_ERR_PYTHON with gil: * cdef TAO tao = ref_TAO(_tao) * cdef Vec x = ref_Vec(_x) # <<<<<<<<<<<<<< * cdef Vec c = ref_Vec(_c) * context = tao.get_attr("__equality_constraints__") */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v__x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_x = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":454 * cdef TAO tao = ref_TAO(_tao) * cdef Vec x = ref_Vec(_x) * cdef Vec c = ref_Vec(_c) # <<<<<<<<<<<<<< * context = tao.get_attr("__equality_constraints__") * if context is None and ctx != NULL: context = ctx */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v__c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 454, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_c = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":455 * cdef Vec x = ref_Vec(_x) * cdef Vec c = ref_Vec(_c) * context = tao.get_attr("__equality_constraints__") # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_tao->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_tao), ((char *)"__equality_constraints__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 455, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":456 * cdef Vec c = ref_Vec(_c) * context = tao.get_attr("__equality_constraints__") * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple # sanity check * (f, args, kargs) = context */ __pyx_t_3 = (__pyx_v_context == Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = (__pyx_v_ctx != NULL); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1); __pyx_t_1 = 0; } /* "petsc4py/PETSc/petsctao.pxi":457 * context = tao.get_attr("__equality_constraints__") * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check # <<<<<<<<<<<<<< * (f, args, kargs) = context * f(tao, x, c, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_3 = (__pyx_v_context != Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_2 = __pyx_t_3; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(25, 457, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(25, 457, __pyx_L1_error) #endif /* "petsc4py/PETSc/petsctao.pxi":458 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check * (f, args, kargs) = context # <<<<<<<<<<<<<< * f(tao, x, c, *args, **kargs) * return PETSC_SUCCESS */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(25, 458, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); __pyx_t_5 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); index = 0; __pyx_t_1 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 2; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(25, 458, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(25, 458, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_f = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_kargs = __pyx_t_5; __pyx_t_5 = 0; /* "petsc4py/PETSc/petsctao.pxi":459 * assert context is not None and type(context) is tuple # sanity check * (f, args, kargs) = context * f(tao, x, c, *args, **kargs) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 459, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF((PyObject *)__pyx_v_tao); __Pyx_GIVEREF((PyObject *)__pyx_v_tao); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_tao))) __PYX_ERR(25, 459, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_x); __Pyx_GIVEREF((PyObject *)__pyx_v_x); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_x))) __PYX_ERR(25, 459, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_c); __Pyx_GIVEREF((PyObject *)__pyx_v_c); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, ((PyObject *)__pyx_v_c))) __PYX_ERR(25, 459, __pyx_L1_error); __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 459, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 459, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(25, 459, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_4 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 459, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } else { __pyx_t_4 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 459, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_f, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 459, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/petsctao.pxi":460 * (f, args, kargs) = context * f(tao, x, c, *args, **kargs) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * cdef PetscErrorCode TAO_JacobianEquality(PetscTAO _tao, */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petsctao.pxi":448 * return PETSC_SUCCESS * * cdef PetscErrorCode TAO_EqualityConstraints(PetscTAO _tao, # <<<<<<<<<<<<<< * PetscVec _x, * PetscVec _c, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.TAO_EqualityConstraints", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_tao); __Pyx_XDECREF((PyObject *)__pyx_v_x); __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_f); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petsctao.pxi":462 * return PETSC_SUCCESS * * cdef PetscErrorCode TAO_JacobianEquality(PetscTAO _tao, # <<<<<<<<<<<<<< * PetscVec _x, * PetscMat _J, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TAO_JacobianEquality(Tao __pyx_v__tao, Vec __pyx_v__x, Mat __pyx_v__J, Mat __pyx_v__P, void *__pyx_v_ctx) { struct PyPetscTAOObject *__pyx_v_tao = 0; struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscMatObject *__pyx_v_J = 0; struct PyPetscMatObject *__pyx_v_P = 0; PyObject *__pyx_v_context = NULL; PyObject *__pyx_v_jacobian = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TAO_JacobianEquality", 0); /* "petsc4py/PETSc/petsctao.pxi":467 * PetscMat _P, * void* ctx) except PETSC_ERR_PYTHON with gil: * cdef TAO tao = ref_TAO(_tao) # <<<<<<<<<<<<<< * cdef Vec x = ref_Vec(_x) * cdef Mat J = ref_Mat(_J) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TAO(__pyx_v__tao)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":468 * void* ctx) except PETSC_ERR_PYTHON with gil: * cdef TAO tao = ref_TAO(_tao) * cdef Vec x = ref_Vec(_x) # <<<<<<<<<<<<<< * cdef Mat J = ref_Mat(_J) * cdef Mat P = ref_Mat(_P) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v__x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 468, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_x = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":469 * cdef TAO tao = ref_TAO(_tao) * cdef Vec x = ref_Vec(_x) * cdef Mat J = ref_Mat(_J) # <<<<<<<<<<<<<< * cdef Mat P = ref_Mat(_P) * context = tao.get_attr("__jacobian_equality__") */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v__J)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_J = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":470 * cdef Vec x = ref_Vec(_x) * cdef Mat J = ref_Mat(_J) * cdef Mat P = ref_Mat(_P) # <<<<<<<<<<<<<< * context = tao.get_attr("__jacobian_equality__") * if context is None and ctx != NULL: context = ctx */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v__P)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_P = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":471 * cdef Mat J = ref_Mat(_J) * cdef Mat P = ref_Mat(_P) * context = tao.get_attr("__jacobian_equality__") # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_tao->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_tao), ((char *)"__jacobian_equality__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":472 * cdef Mat P = ref_Mat(_P) * context = tao.get_attr("__jacobian_equality__") * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple # sanity check * (jacobian, args, kargs) = context */ __pyx_t_3 = (__pyx_v_context == Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = (__pyx_v_ctx != NULL); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1); __pyx_t_1 = 0; } /* "petsc4py/PETSc/petsctao.pxi":473 * context = tao.get_attr("__jacobian_equality__") * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check # <<<<<<<<<<<<<< * (jacobian, args, kargs) = context * jacobian(tao, x, J, P, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_3 = (__pyx_v_context != Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_2 = __pyx_t_3; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(25, 473, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(25, 473, __pyx_L1_error) #endif /* "petsc4py/PETSc/petsctao.pxi":474 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check * (jacobian, args, kargs) = context # <<<<<<<<<<<<<< * jacobian(tao, x, J, P, *args, **kargs) * return PETSC_SUCCESS */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(25, 474, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); __pyx_t_5 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); index = 0; __pyx_t_1 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 2; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(25, 474, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(25, 474, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_jacobian = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_kargs = __pyx_t_5; __pyx_t_5 = 0; /* "petsc4py/PETSc/petsctao.pxi":475 * assert context is not None and type(context) is tuple # sanity check * (jacobian, args, kargs) = context * jacobian(tao, x, J, P, *args, **kargs) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF((PyObject *)__pyx_v_tao); __Pyx_GIVEREF((PyObject *)__pyx_v_tao); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_tao))) __PYX_ERR(25, 475, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_x); __Pyx_GIVEREF((PyObject *)__pyx_v_x); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_x))) __PYX_ERR(25, 475, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_J); __Pyx_GIVEREF((PyObject *)__pyx_v_J); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, ((PyObject *)__pyx_v_J))) __PYX_ERR(25, 475, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_P); __Pyx_GIVEREF((PyObject *)__pyx_v_P); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 3, ((PyObject *)__pyx_v_P))) __PYX_ERR(25, 475, __pyx_L1_error); __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(25, 475, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_4 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } else { __pyx_t_4 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_jacobian, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/petsctao.pxi":476 * (jacobian, args, kargs) = context * jacobian(tao, x, J, P, *args, **kargs) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * # ctx is unused */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petsctao.pxi":462 * return PETSC_SUCCESS * * cdef PetscErrorCode TAO_JacobianEquality(PetscTAO _tao, # <<<<<<<<<<<<<< * PetscVec _x, * PetscMat _J, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.TAO_JacobianEquality", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_tao); __Pyx_XDECREF((PyObject *)__pyx_v_x); __Pyx_XDECREF((PyObject *)__pyx_v_J); __Pyx_XDECREF((PyObject *)__pyx_v_P); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_jacobian); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petsctao.pxi":479 * * # ctx is unused * cdef PetscErrorCode TAO_Update( # <<<<<<<<<<<<<< * PetscTAO _tao, * PetscInt its, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TAO_Update(Tao __pyx_v__tao, PetscInt __pyx_v_its, CYTHON_UNUSED void *__pyx_v_ctx) { struct PyPetscTAOObject *__pyx_v_tao = 0; PyObject *__pyx_v_update = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *(*__pyx_t_6)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TAO_Update", 0); /* "petsc4py/PETSc/petsctao.pxi":483 * PetscInt its, * void* ctx) except PETSC_ERR_PYTHON with gil: * cdef TAO tao = ref_TAO(_tao) # <<<<<<<<<<<<<< * (update, args, kargs) = tao.get_attr('__update__') * update(tao, toInt(its), *args, **kargs) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TAO(__pyx_v__tao)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 483, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":484 * void* ctx) except PETSC_ERR_PYTHON with gil: * cdef TAO tao = ref_TAO(_tao) * (update, args, kargs) = tao.get_attr('__update__') # <<<<<<<<<<<<<< * update(tao, toInt(its), *args, **kargs) * return PETSC_SUCCESS */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_tao->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_tao), ((char *)"__update__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 484, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(25, 484, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); __pyx_t_4 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 484, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(25, 484, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 484, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 484, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 2; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 3) < 0) __PYX_ERR(25, 484, __pyx_L1_error) __pyx_t_6 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(25, 484, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_update = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_args = __pyx_t_3; __pyx_t_3 = 0; __pyx_v_kargs = __pyx_t_4; __pyx_t_4 = 0; /* "petsc4py/PETSc/petsctao.pxi":485 * cdef TAO tao = ref_TAO(_tao) * (update, args, kargs) = tao.get_attr('__update__') * update(tao, toInt(its), *args, **kargs) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_its); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF((PyObject *)__pyx_v_tao); __Pyx_GIVEREF((PyObject *)__pyx_v_tao); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_tao))) __PYX_ERR(25, 485, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(25, 485, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(25, 485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(25, 485, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_1 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_1 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_t_4 = __Pyx_PyObject_Call(__pyx_v_update, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/petsctao.pxi":486 * (update, args, kargs) = tao.get_attr('__update__') * update(tao, toInt(its), *args, **kargs) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * cdef PetscErrorCode TAO_Converged(PetscTAO _tao, */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petsctao.pxi":479 * * # ctx is unused * cdef PetscErrorCode TAO_Update( # <<<<<<<<<<<<<< * PetscTAO _tao, * PetscInt its, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.TAO_Update", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_tao); __Pyx_XDECREF(__pyx_v_update); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petsctao.pxi":488 * return PETSC_SUCCESS * * cdef PetscErrorCode TAO_Converged(PetscTAO _tao, # <<<<<<<<<<<<<< * void* ctx) except PETSC_ERR_PYTHON with gil: * # call first the default convergence test */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TAO_Converged(Tao __pyx_v__tao, CYTHON_UNUSED void *__pyx_v_ctx) { struct PyPetscTAOObject *__pyx_v_tao = 0; PyObject *__pyx_v_converged = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PyObject *__pyx_v_reason = NULL; TaoConvergedReason __pyx_v_creason; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); int __pyx_t_9; int __pyx_t_10; TaoConvergedReason __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TAO_Converged", 0); /* "petsc4py/PETSc/petsctao.pxi":491 * void* ctx) except PETSC_ERR_PYTHON with gil: * # call first the default convergence test * CHKERR( TaoDefaultConvergenceTest(_tao, NULL) ) # <<<<<<<<<<<<<< * # call next the user-provided convergence test * cdef TAO tao = ref_TAO(_tao) */ __pyx_t_1 = TaoDefaultConvergenceTest(__pyx_v__tao, NULL); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(25, 491, __pyx_L1_error) __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_t_1); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(25, 491, __pyx_L1_error) /* "petsc4py/PETSc/petsctao.pxi":493 * CHKERR( TaoDefaultConvergenceTest(_tao, NULL) ) * # call next the user-provided convergence test * cdef TAO tao = ref_TAO(_tao) # <<<<<<<<<<<<<< * (converged, args, kargs) = tao.get_attr('__converged__') * reason = converged(tao, *args, **kargs) */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TAO(__pyx_v__tao)); if (unlikely(!__pyx_t_3)) __PYX_ERR(25, 493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/petsctao.pxi":494 * # call next the user-provided convergence test * cdef TAO tao = ref_TAO(_tao) * (converged, args, kargs) = tao.get_attr('__converged__') # <<<<<<<<<<<<<< * reason = converged(tao, *args, **kargs) * if reason is None: return PETSC_SUCCESS */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_tao->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_tao), ((char *)"__converged__")); if (unlikely(!__pyx_t_3)) __PYX_ERR(25, 494, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { PyObject* sequence = __pyx_t_3; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(25, 494, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_4 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 494, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 494, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 494, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(25, 494, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); index = 0; __pyx_t_4 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(25, 494, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(25, 494, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_converged = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_args = __pyx_t_5; __pyx_t_5 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "petsc4py/PETSc/petsctao.pxi":495 * cdef TAO tao = ref_TAO(_tao) * (converged, args, kargs) = tao.get_attr('__converged__') * reason = converged(tao, *args, **kargs) # <<<<<<<<<<<<<< * if reason is None: return PETSC_SUCCESS * # handle value of convergence reason */ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(25, 495, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF((PyObject *)__pyx_v_tao); __Pyx_GIVEREF((PyObject *)__pyx_v_tao); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_tao))) __PYX_ERR(25, 495, __pyx_L1_error); __pyx_t_6 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 495, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = PyNumber_Add(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 495, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(25, 495, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_6 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 495, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } else { __pyx_t_6 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 495, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_converged, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(25, 495, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_reason = __pyx_t_3; __pyx_t_3 = 0; /* "petsc4py/PETSc/petsctao.pxi":496 * (converged, args, kargs) = tao.get_attr('__converged__') * reason = converged(tao, *args, **kargs) * if reason is None: return PETSC_SUCCESS # <<<<<<<<<<<<<< * # handle value of convergence reason * cdef PetscTAOConvergedReason creason = TAO_CONTINUE_ITERATING */ __pyx_t_9 = (__pyx_v_reason == Py_None); if (__pyx_t_9) { __pyx_r = PETSC_SUCCESS; goto __pyx_L0; } /* "petsc4py/PETSc/petsctao.pxi":498 * if reason is None: return PETSC_SUCCESS * # handle value of convergence reason * cdef PetscTAOConvergedReason creason = TAO_CONTINUE_ITERATING # <<<<<<<<<<<<<< * if reason is False or reason == -1: * creason = TAO_DIVERGED_USER */ __pyx_v_creason = TAO_CONTINUE_ITERATING; /* "petsc4py/PETSc/petsctao.pxi":499 * # handle value of convergence reason * cdef PetscTAOConvergedReason creason = TAO_CONTINUE_ITERATING * if reason is False or reason == -1: # <<<<<<<<<<<<<< * creason = TAO_DIVERGED_USER * elif reason is True or reason == 1: */ __pyx_t_10 = (__pyx_v_reason == Py_False); if (!__pyx_t_10) { } else { __pyx_t_9 = __pyx_t_10; goto __pyx_L7_bool_binop_done; } __pyx_t_10 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_reason, __pyx_int_neg_1, -1L, 0)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(25, 499, __pyx_L1_error) __pyx_t_9 = __pyx_t_10; __pyx_L7_bool_binop_done:; if (__pyx_t_9) { /* "petsc4py/PETSc/petsctao.pxi":500 * cdef PetscTAOConvergedReason creason = TAO_CONTINUE_ITERATING * if reason is False or reason == -1: * creason = TAO_DIVERGED_USER # <<<<<<<<<<<<<< * elif reason is True or reason == 1: * creason = TAO_CONVERGED_USER */ __pyx_v_creason = TAO_DIVERGED_USER; /* "petsc4py/PETSc/petsctao.pxi":499 * # handle value of convergence reason * cdef PetscTAOConvergedReason creason = TAO_CONTINUE_ITERATING * if reason is False or reason == -1: # <<<<<<<<<<<<<< * creason = TAO_DIVERGED_USER * elif reason is True or reason == 1: */ goto __pyx_L6; } /* "petsc4py/PETSc/petsctao.pxi":501 * if reason is False or reason == -1: * creason = TAO_DIVERGED_USER * elif reason is True or reason == 1: # <<<<<<<<<<<<<< * creason = TAO_CONVERGED_USER * else: */ __pyx_t_10 = (__pyx_v_reason == Py_True); if (!__pyx_t_10) { } else { __pyx_t_9 = __pyx_t_10; goto __pyx_L9_bool_binop_done; } __pyx_t_10 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_reason, __pyx_int_1, 1, 0)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(25, 501, __pyx_L1_error) __pyx_t_9 = __pyx_t_10; __pyx_L9_bool_binop_done:; if (__pyx_t_9) { /* "petsc4py/PETSc/petsctao.pxi":502 * creason = TAO_DIVERGED_USER * elif reason is True or reason == 1: * creason = TAO_CONVERGED_USER # <<<<<<<<<<<<<< * else: * creason = reason */ __pyx_v_creason = TAO_CONVERGED_USER; /* "petsc4py/PETSc/petsctao.pxi":501 * if reason is False or reason == -1: * creason = TAO_DIVERGED_USER * elif reason is True or reason == 1: # <<<<<<<<<<<<<< * creason = TAO_CONVERGED_USER * else: */ goto __pyx_L6; } /* "petsc4py/PETSc/petsctao.pxi":504 * creason = TAO_CONVERGED_USER * else: * creason = reason # <<<<<<<<<<<<<< * assert creason >= TAO_DIVERGED_USER * assert creason <= TAO_CONVERGED_USER */ /*else*/ { __pyx_t_11 = ((TaoConvergedReason)__Pyx_PyInt_As_TaoConvergedReason(__pyx_v_reason)); if (unlikely(PyErr_Occurred())) __PYX_ERR(25, 504, __pyx_L1_error) __pyx_v_creason = __pyx_t_11; /* "petsc4py/PETSc/petsctao.pxi":505 * else: * creason = reason * assert creason >= TAO_DIVERGED_USER # <<<<<<<<<<<<<< * assert creason <= TAO_CONVERGED_USER * CHKERR( TaoSetConvergedReason(_tao, creason) ) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_9 = (__pyx_v_creason >= TAO_DIVERGED_USER); if (unlikely(!__pyx_t_9)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(25, 505, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(25, 505, __pyx_L1_error) #endif /* "petsc4py/PETSc/petsctao.pxi":506 * creason = reason * assert creason >= TAO_DIVERGED_USER * assert creason <= TAO_CONVERGED_USER # <<<<<<<<<<<<<< * CHKERR( TaoSetConvergedReason(_tao, creason) ) * return PETSC_SUCCESS */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_9 = (__pyx_v_creason <= TAO_CONVERGED_USER); if (unlikely(!__pyx_t_9)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(25, 506, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(25, 506, __pyx_L1_error) #endif } __pyx_L6:; /* "petsc4py/PETSc/petsctao.pxi":507 * assert creason >= TAO_DIVERGED_USER * assert creason <= TAO_CONVERGED_USER * CHKERR( TaoSetConvergedReason(_tao, creason) ) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSetConvergedReason(__pyx_v__tao, __pyx_v_creason)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(25, 507, __pyx_L1_error) /* "petsc4py/PETSc/petsctao.pxi":508 * assert creason <= TAO_CONVERGED_USER * CHKERR( TaoSetConvergedReason(_tao, creason) ) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * cdef PetscErrorCode TAO_Monitor(PetscTAO _tao, */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petsctao.pxi":488 * return PETSC_SUCCESS * * cdef PetscErrorCode TAO_Converged(PetscTAO _tao, # <<<<<<<<<<<<<< * void* ctx) except PETSC_ERR_PYTHON with gil: * # call first the default convergence test */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.TAO_Converged", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_tao); __Pyx_XDECREF(__pyx_v_converged); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XDECREF(__pyx_v_reason); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petsctao.pxi":510 * return PETSC_SUCCESS * * cdef PetscErrorCode TAO_Monitor(PetscTAO _tao, # <<<<<<<<<<<<<< * void* ctx) except PETSC_ERR_PYTHON with gil: * cdef TAO tao = ref_TAO(_tao) */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TAO_Monitor(Tao __pyx_v__tao, CYTHON_UNUSED void *__pyx_v_ctx) { struct PyPetscTAOObject *__pyx_v_tao = 0; PyObject *__pyx_v_monitorlist = 0; PyObject *__pyx_v_monitor = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; Py_ssize_t __pyx_t_3; PyObject *(*__pyx_t_4)(PyObject *); PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *(*__pyx_t_10)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TAO_Monitor", 0); /* "petsc4py/PETSc/petsctao.pxi":512 * cdef PetscErrorCode TAO_Monitor(PetscTAO _tao, * void* ctx) except PETSC_ERR_PYTHON with gil: * cdef TAO tao = ref_TAO(_tao) # <<<<<<<<<<<<<< * cdef object monitorlist = tao.get_attr('__monitor__') * if monitorlist is None: return PETSC_SUCCESS */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TAO(__pyx_v__tao)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 512, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":513 * void* ctx) except PETSC_ERR_PYTHON with gil: * cdef TAO tao = ref_TAO(_tao) * cdef object monitorlist = tao.get_attr('__monitor__') # <<<<<<<<<<<<<< * if monitorlist is None: return PETSC_SUCCESS * for (monitor, args, kargs) in monitorlist: */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_tao->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_tao), ((char *)"__monitor__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 513, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_monitorlist = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":514 * cdef TAO tao = ref_TAO(_tao) * cdef object monitorlist = tao.get_attr('__monitor__') * if monitorlist is None: return PETSC_SUCCESS # <<<<<<<<<<<<<< * for (monitor, args, kargs) in monitorlist: * monitor(tao, *args, **kargs) */ __pyx_t_2 = (__pyx_v_monitorlist == Py_None); if (__pyx_t_2) { __pyx_r = PETSC_SUCCESS; goto __pyx_L0; } /* "petsc4py/PETSc/petsctao.pxi":515 * cdef object monitorlist = tao.get_attr('__monitor__') * if monitorlist is None: return PETSC_SUCCESS * for (monitor, args, kargs) in monitorlist: # <<<<<<<<<<<<<< * monitor(tao, *args, **kargs) * return PETSC_SUCCESS */ if (likely(PyList_CheckExact(__pyx_v_monitorlist)) || PyTuple_CheckExact(__pyx_v_monitorlist)) { __pyx_t_1 = __pyx_v_monitorlist; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_monitorlist); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 515, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 515, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(25, 515, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(25, 515, __pyx_L1_error) #else __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 515, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(25, 515, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(25, 515, __pyx_L1_error) #else __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 515, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } } else { __pyx_t_5 = __pyx_t_4(__pyx_t_1); if (unlikely(!__pyx_t_5)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(25, 515, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_5); } if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) { PyObject* sequence = __pyx_t_5; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(25, 515, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_6 = PyList_GET_ITEM(sequence, 0); __pyx_t_7 = PyList_GET_ITEM(sequence, 1); __pyx_t_8 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); #else __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 515, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(25, 515, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_8)) __PYX_ERR(25, 515, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); #endif __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { Py_ssize_t index = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(25, 515, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_10 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); index = 0; __pyx_t_6 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_6)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); index = 1; __pyx_t_7 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_7)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_7); index = 2; __pyx_t_8 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 3) < 0) __PYX_ERR(25, 515, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L7_unpacking_done; __pyx_L6_unpacking_failed:; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(25, 515, __pyx_L1_error) __pyx_L7_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_monitor, __pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF_SET(__pyx_v_args, __pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF_SET(__pyx_v_kargs, __pyx_t_8); __pyx_t_8 = 0; /* "petsc4py/PETSc/petsctao.pxi":516 * if monitorlist is None: return PETSC_SUCCESS * for (monitor, args, kargs) in monitorlist: * monitor(tao, *args, **kargs) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 516, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF((PyObject *)__pyx_v_tao); __Pyx_GIVEREF((PyObject *)__pyx_v_tao); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_tao))) __PYX_ERR(25, 516, __pyx_L1_error); __pyx_t_8 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_8)) __PYX_ERR(25, 516, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = PyNumber_Add(__pyx_t_5, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(25, 516, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(25, 516, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_8 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_8)) __PYX_ERR(25, 516, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } else { __pyx_t_8 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_8)) __PYX_ERR(25, 516, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_monitor, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 516, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/petsctao.pxi":515 * cdef object monitorlist = tao.get_attr('__monitor__') * if monitorlist is None: return PETSC_SUCCESS * for (monitor, args, kargs) in monitorlist: # <<<<<<<<<<<<<< * monitor(tao, *args, **kargs) * return PETSC_SUCCESS */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":517 * for (monitor, args, kargs) in monitorlist: * monitor(tao, *args, **kargs) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petsctao.pxi":510 * return PETSC_SUCCESS * * cdef PetscErrorCode TAO_Monitor(PetscTAO _tao, # <<<<<<<<<<<<<< * void* ctx) except PETSC_ERR_PYTHON with gil: * cdef TAO tao = ref_TAO(_tao) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("petsc4py.PETSc.TAO_Monitor", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_tao); __Pyx_XDECREF(__pyx_v_monitorlist); __Pyx_XDECREF(__pyx_v_monitor); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petsctao.pxi":521 * # -------------------------------------------------------------------- * * cdef inline TAOLineSearch ref_TAOLS(PetscTAOLineSearch taols): # <<<<<<<<<<<<<< * cdef TAOLineSearch ob = TAOLineSearch() * ob.taols = taols */ static CYTHON_INLINE struct PyPetscTAOLineSearchObject *__pyx_f_8petsc4py_5PETSc_ref_TAOLS(TaoLineSearch __pyx_v_taols) { struct PyPetscTAOLineSearchObject *__pyx_v_ob = 0; struct PyPetscTAOLineSearchObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("ref_TAOLS", 1); /* "petsc4py/PETSc/petsctao.pxi":522 * * cdef inline TAOLineSearch ref_TAOLS(PetscTAOLineSearch taols): * cdef TAOLineSearch ob = TAOLineSearch() # <<<<<<<<<<<<<< * ob.taols = taols * CHKERR( PetscINCREF(ob.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_TAOLineSearch)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_ob = ((struct PyPetscTAOLineSearchObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petsctao.pxi":523 * cdef inline TAOLineSearch ref_TAOLS(PetscTAOLineSearch taols): * cdef TAOLineSearch ob = TAOLineSearch() * ob.taols = taols # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(ob.obj) ) * return ob */ __pyx_v_ob->taols = __pyx_v_taols; /* "petsc4py/PETSc/petsctao.pxi":524 * cdef TAOLineSearch ob = TAOLineSearch() * ob.taols = taols * CHKERR( PetscINCREF(ob.obj) ) # <<<<<<<<<<<<<< * return ob * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ob->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(25, 524, __pyx_L1_error) /* "petsc4py/PETSc/petsctao.pxi":525 * ob.taols = taols * CHKERR( PetscINCREF(ob.obj) ) * return ob # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_ob); __pyx_r = __pyx_v_ob; goto __pyx_L0; /* "petsc4py/PETSc/petsctao.pxi":521 * # -------------------------------------------------------------------- * * cdef inline TAOLineSearch ref_TAOLS(PetscTAOLineSearch taols): # <<<<<<<<<<<<<< * cdef TAOLineSearch ob = TAOLineSearch() * ob.taols = taols */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.ref_TAOLS", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petsctao.pxi":529 * # -------------------------------------------------------------------- * * cdef PetscErrorCode TAOLS_Objective(PetscTAOLineSearch _ls, # <<<<<<<<<<<<<< * PetscVec _x, * PetscReal *_f, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TAOLS_Objective(TaoLineSearch __pyx_v__ls, Vec __pyx_v__x, PetscReal *__pyx_v__f, CYTHON_UNUSED void *__pyx_v_ctx) { struct PyPetscTAOLineSearchObject *__pyx_v_ls = 0; struct PyPetscVecObject *__pyx_v_x = 0; PyObject *__pyx_v_objective = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PyObject *__pyx_v_retv = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *(*__pyx_t_6)(PyObject *); PetscReal __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TAOLS_Objective", 0); /* "petsc4py/PETSc/petsctao.pxi":534 * void *ctx) except PETSC_ERR_PYTHON with gil: * * cdef TAOLineSearch ls = ref_TAOLS(_ls) # <<<<<<<<<<<<<< * cdef Vec x = ref_Vec(_x) * (objective, args, kargs) = ls.get_attr("__objective__") */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TAOLS(__pyx_v__ls)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 534, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ls = ((struct PyPetscTAOLineSearchObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":535 * * cdef TAOLineSearch ls = ref_TAOLS(_ls) * cdef Vec x = ref_Vec(_x) # <<<<<<<<<<<<<< * (objective, args, kargs) = ls.get_attr("__objective__") * retv = objective(ls, x, *args, **kargs) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v__x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_x = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":536 * cdef TAOLineSearch ls = ref_TAOLS(_ls) * cdef Vec x = ref_Vec(_x) * (objective, args, kargs) = ls.get_attr("__objective__") # <<<<<<<<<<<<<< * retv = objective(ls, x, *args, **kargs) * _f[0] = asReal(retv) */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAOLineSearch *)__pyx_v_ls->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_ls), ((char *)"__objective__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 536, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(25, 536, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); __pyx_t_4 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 536, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(25, 536, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 536, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 536, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 2; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 3) < 0) __PYX_ERR(25, 536, __pyx_L1_error) __pyx_t_6 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(25, 536, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_objective = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_args = __pyx_t_3; __pyx_t_3 = 0; __pyx_v_kargs = __pyx_t_4; __pyx_t_4 = 0; /* "petsc4py/PETSc/petsctao.pxi":537 * cdef Vec x = ref_Vec(_x) * (objective, args, kargs) = ls.get_attr("__objective__") * retv = objective(ls, x, *args, **kargs) # <<<<<<<<<<<<<< * _f[0] = asReal(retv) * return PETSC_SUCCESS */ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF((PyObject *)__pyx_v_ls); __Pyx_GIVEREF((PyObject *)__pyx_v_ls); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_ls))) __PYX_ERR(25, 537, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_x); __Pyx_GIVEREF((PyObject *)__pyx_v_x); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_x))) __PYX_ERR(25, 537, __pyx_L1_error); __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(25, 537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(25, 537, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_4 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } else { __pyx_t_4 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_objective, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_retv = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":538 * (objective, args, kargs) = ls.get_attr("__objective__") * retv = objective(ls, x, *args, **kargs) * _f[0] = asReal(retv) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_retv); if (unlikely(__pyx_t_7 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(25, 538, __pyx_L1_error) (__pyx_v__f[0]) = __pyx_t_7; /* "petsc4py/PETSc/petsctao.pxi":539 * retv = objective(ls, x, *args, **kargs) * _f[0] = asReal(retv) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * cdef PetscErrorCode TAOLS_Gradient(PetscTAOLineSearch _ls, */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petsctao.pxi":529 * # -------------------------------------------------------------------- * * cdef PetscErrorCode TAOLS_Objective(PetscTAOLineSearch _ls, # <<<<<<<<<<<<<< * PetscVec _x, * PetscReal *_f, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.TAOLS_Objective", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ls); __Pyx_XDECREF((PyObject *)__pyx_v_x); __Pyx_XDECREF(__pyx_v_objective); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XDECREF(__pyx_v_retv); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petsctao.pxi":541 * return PETSC_SUCCESS * * cdef PetscErrorCode TAOLS_Gradient(PetscTAOLineSearch _ls, # <<<<<<<<<<<<<< * PetscVec _x, * PetscVec _g, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TAOLS_Gradient(TaoLineSearch __pyx_v__ls, Vec __pyx_v__x, Vec __pyx_v__g, CYTHON_UNUSED void *__pyx_v_ctx) { struct PyPetscTAOLineSearchObject *__pyx_v_ls = 0; struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_g = 0; PyObject *__pyx_v_gradient = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *(*__pyx_t_6)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TAOLS_Gradient", 0); /* "petsc4py/PETSc/petsctao.pxi":546 * void *ctx) except PETSC_ERR_PYTHON with gil: * * cdef TAOLineSearch ls = ref_TAOLS(_ls) # <<<<<<<<<<<<<< * cdef Vec x = ref_Vec(_x) * cdef Vec g = ref_Vec(_g) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TAOLS(__pyx_v__ls)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 546, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ls = ((struct PyPetscTAOLineSearchObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":547 * * cdef TAOLineSearch ls = ref_TAOLS(_ls) * cdef Vec x = ref_Vec(_x) # <<<<<<<<<<<<<< * cdef Vec g = ref_Vec(_g) * (gradient, args, kargs) = ls.get_attr("__gradient__") */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v__x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_x = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":548 * cdef TAOLineSearch ls = ref_TAOLS(_ls) * cdef Vec x = ref_Vec(_x) * cdef Vec g = ref_Vec(_g) # <<<<<<<<<<<<<< * (gradient, args, kargs) = ls.get_attr("__gradient__") * gradient(ls, x, g, *args, **kargs) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v__g)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 548, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_g = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":549 * cdef Vec x = ref_Vec(_x) * cdef Vec g = ref_Vec(_g) * (gradient, args, kargs) = ls.get_attr("__gradient__") # <<<<<<<<<<<<<< * gradient(ls, x, g, *args, **kargs) * return PETSC_SUCCESS */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAOLineSearch *)__pyx_v_ls->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_ls), ((char *)"__gradient__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 549, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(25, 549, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); __pyx_t_4 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 549, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(25, 549, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 549, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 549, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 2; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 3) < 0) __PYX_ERR(25, 549, __pyx_L1_error) __pyx_t_6 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(25, 549, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_gradient = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_args = __pyx_t_3; __pyx_t_3 = 0; __pyx_v_kargs = __pyx_t_4; __pyx_t_4 = 0; /* "petsc4py/PETSc/petsctao.pxi":550 * cdef Vec g = ref_Vec(_g) * (gradient, args, kargs) = ls.get_attr("__gradient__") * gradient(ls, x, g, *args, **kargs) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF((PyObject *)__pyx_v_ls); __Pyx_GIVEREF((PyObject *)__pyx_v_ls); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_ls))) __PYX_ERR(25, 550, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_x); __Pyx_GIVEREF((PyObject *)__pyx_v_x); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_x))) __PYX_ERR(25, 550, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_g); __Pyx_GIVEREF((PyObject *)__pyx_v_g); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_g))) __PYX_ERR(25, 550, __pyx_L1_error); __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(25, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(25, 550, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_4 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } else { __pyx_t_4 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_gradient, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":551 * (gradient, args, kargs) = ls.get_attr("__gradient__") * gradient(ls, x, g, *args, **kargs) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petsctao.pxi":541 * return PETSC_SUCCESS * * cdef PetscErrorCode TAOLS_Gradient(PetscTAOLineSearch _ls, # <<<<<<<<<<<<<< * PetscVec _x, * PetscVec _g, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.TAOLS_Gradient", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ls); __Pyx_XDECREF((PyObject *)__pyx_v_x); __Pyx_XDECREF((PyObject *)__pyx_v_g); __Pyx_XDECREF(__pyx_v_gradient); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petsctao.pxi":554 * * * cdef PetscErrorCode TAOLS_ObjGrad(PetscTAOLineSearch _ls, # <<<<<<<<<<<<<< * PetscVec _x, * PetscReal *_f, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TAOLS_ObjGrad(TaoLineSearch __pyx_v__ls, Vec __pyx_v__x, PetscReal *__pyx_v__f, Vec __pyx_v__g, CYTHON_UNUSED void *__pyx_v_ctx) { struct PyPetscTAOLineSearchObject *__pyx_v_ls = 0; struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_g = 0; PyObject *__pyx_v_objgrad = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PyObject *__pyx_v_retv = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *(*__pyx_t_6)(PyObject *); PetscReal __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TAOLS_ObjGrad", 0); /* "petsc4py/PETSc/petsctao.pxi":560 * void *ctx) except PETSC_ERR_PYTHON with gil: * * cdef TAOLineSearch ls = ref_TAOLS(_ls) # <<<<<<<<<<<<<< * cdef Vec x = ref_Vec(_x) * cdef Vec g = ref_Vec(_g) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TAOLS(__pyx_v__ls)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 560, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ls = ((struct PyPetscTAOLineSearchObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":561 * * cdef TAOLineSearch ls = ref_TAOLS(_ls) * cdef Vec x = ref_Vec(_x) # <<<<<<<<<<<<<< * cdef Vec g = ref_Vec(_g) * (objgrad, args, kargs) = ls.get_attr("__objgrad__") */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v__x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 561, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_x = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":562 * cdef TAOLineSearch ls = ref_TAOLS(_ls) * cdef Vec x = ref_Vec(_x) * cdef Vec g = ref_Vec(_g) # <<<<<<<<<<<<<< * (objgrad, args, kargs) = ls.get_attr("__objgrad__") * retv = objgrad(ls, x, g, *args, **kargs) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v__g)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_g = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":563 * cdef Vec x = ref_Vec(_x) * cdef Vec g = ref_Vec(_g) * (objgrad, args, kargs) = ls.get_attr("__objgrad__") # <<<<<<<<<<<<<< * retv = objgrad(ls, x, g, *args, **kargs) * _f[0] = asReal(retv) */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAOLineSearch *)__pyx_v_ls->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_ls), ((char *)"__objgrad__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(25, 563, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); __pyx_t_4 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(25, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 2; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 3) < 0) __PYX_ERR(25, 563, __pyx_L1_error) __pyx_t_6 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(25, 563, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_objgrad = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_args = __pyx_t_3; __pyx_t_3 = 0; __pyx_v_kargs = __pyx_t_4; __pyx_t_4 = 0; /* "petsc4py/PETSc/petsctao.pxi":564 * cdef Vec g = ref_Vec(_g) * (objgrad, args, kargs) = ls.get_attr("__objgrad__") * retv = objgrad(ls, x, g, *args, **kargs) # <<<<<<<<<<<<<< * _f[0] = asReal(retv) * return PETSC_SUCCESS */ __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF((PyObject *)__pyx_v_ls); __Pyx_GIVEREF((PyObject *)__pyx_v_ls); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_ls))) __PYX_ERR(25, 564, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_x); __Pyx_GIVEREF((PyObject *)__pyx_v_x); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_x))) __PYX_ERR(25, 564, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_g); __Pyx_GIVEREF((PyObject *)__pyx_v_g); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_g))) __PYX_ERR(25, 564, __pyx_L1_error); __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(25, 564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(25, 564, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_4 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } else { __pyx_t_4 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_objgrad, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_retv = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/petsctao.pxi":565 * (objgrad, args, kargs) = ls.get_attr("__objgrad__") * retv = objgrad(ls, x, g, *args, **kargs) * _f[0] = asReal(retv) # <<<<<<<<<<<<<< * return PETSC_SUCCESS */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_retv); if (unlikely(__pyx_t_7 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(25, 565, __pyx_L1_error) (__pyx_v__f[0]) = __pyx_t_7; /* "petsc4py/PETSc/petsctao.pxi":566 * retv = objgrad(ls, x, g, *args, **kargs) * _f[0] = asReal(retv) * return PETSC_SUCCESS # <<<<<<<<<<<<<< */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petsctao.pxi":554 * * * cdef PetscErrorCode TAOLS_ObjGrad(PetscTAOLineSearch _ls, # <<<<<<<<<<<<<< * PetscVec _x, * PetscReal *_f, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.TAOLS_ObjGrad", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ls); __Pyx_XDECREF((PyObject *)__pyx_v_x); __Pyx_XDECREF((PyObject *)__pyx_v_g); __Pyx_XDECREF(__pyx_v_objgrad); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XDECREF(__pyx_v_retv); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petscdm.pxi":192 * # -------------------------------------------------------------------- * * cdef inline PetscDMBoundaryType asBoundaryType(object boundary) \ # <<<<<<<<<<<<<< * except (-1): * if boundary is None: */ static CYTHON_INLINE DMBoundaryType __pyx_f_8petsc4py_5PETSc_asBoundaryType(PyObject *__pyx_v_boundary) { DMBoundaryType __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; DMBoundaryType __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("asBoundaryType", 1); /* "petsc4py/PETSc/petscdm.pxi":194 * cdef inline PetscDMBoundaryType asBoundaryType(object boundary) \ * except (-1): * if boundary is None: # <<<<<<<<<<<<<< * return DM_BOUNDARY_NONE * if boundary is False: */ __pyx_t_1 = (__pyx_v_boundary == Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/petscdm.pxi":195 * except (-1): * if boundary is None: * return DM_BOUNDARY_NONE # <<<<<<<<<<<<<< * if boundary is False: * return DM_BOUNDARY_NONE */ __pyx_r = DM_BOUNDARY_NONE; goto __pyx_L0; /* "petsc4py/PETSc/petscdm.pxi":194 * cdef inline PetscDMBoundaryType asBoundaryType(object boundary) \ * except (-1): * if boundary is None: # <<<<<<<<<<<<<< * return DM_BOUNDARY_NONE * if boundary is False: */ } /* "petsc4py/PETSc/petscdm.pxi":196 * if boundary is None: * return DM_BOUNDARY_NONE * if boundary is False: # <<<<<<<<<<<<<< * return DM_BOUNDARY_NONE * if boundary is True: */ __pyx_t_1 = (__pyx_v_boundary == Py_False); if (__pyx_t_1) { /* "petsc4py/PETSc/petscdm.pxi":197 * return DM_BOUNDARY_NONE * if boundary is False: * return DM_BOUNDARY_NONE # <<<<<<<<<<<<<< * if boundary is True: * return DM_BOUNDARY_PERIODIC */ __pyx_r = DM_BOUNDARY_NONE; goto __pyx_L0; /* "petsc4py/PETSc/petscdm.pxi":196 * if boundary is None: * return DM_BOUNDARY_NONE * if boundary is False: # <<<<<<<<<<<<<< * return DM_BOUNDARY_NONE * if boundary is True: */ } /* "petsc4py/PETSc/petscdm.pxi":198 * if boundary is False: * return DM_BOUNDARY_NONE * if boundary is True: # <<<<<<<<<<<<<< * return DM_BOUNDARY_PERIODIC * if isinstance(boundary, str): */ __pyx_t_1 = (__pyx_v_boundary == Py_True); if (__pyx_t_1) { /* "petsc4py/PETSc/petscdm.pxi":199 * return DM_BOUNDARY_NONE * if boundary is True: * return DM_BOUNDARY_PERIODIC # <<<<<<<<<<<<<< * if isinstance(boundary, str): * if boundary == 'none': */ __pyx_r = DM_BOUNDARY_PERIODIC; goto __pyx_L0; /* "petsc4py/PETSc/petscdm.pxi":198 * if boundary is False: * return DM_BOUNDARY_NONE * if boundary is True: # <<<<<<<<<<<<<< * return DM_BOUNDARY_PERIODIC * if isinstance(boundary, str): */ } /* "petsc4py/PETSc/petscdm.pxi":200 * if boundary is True: * return DM_BOUNDARY_PERIODIC * if isinstance(boundary, str): # <<<<<<<<<<<<<< * if boundary == 'none': * return DM_BOUNDARY_NONE */ __pyx_t_1 = PyString_Check(__pyx_v_boundary); if (__pyx_t_1) { /* "petsc4py/PETSc/petscdm.pxi":201 * return DM_BOUNDARY_PERIODIC * if isinstance(boundary, str): * if boundary == 'none': # <<<<<<<<<<<<<< * return DM_BOUNDARY_NONE * elif boundary == 'ghosted': */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_boundary, __pyx_n_s_none, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(26, 201, __pyx_L1_error) if (__pyx_t_1) { /* "petsc4py/PETSc/petscdm.pxi":202 * if isinstance(boundary, str): * if boundary == 'none': * return DM_BOUNDARY_NONE # <<<<<<<<<<<<<< * elif boundary == 'ghosted': * return DM_BOUNDARY_GHOSTED */ __pyx_r = DM_BOUNDARY_NONE; goto __pyx_L0; /* "petsc4py/PETSc/petscdm.pxi":201 * return DM_BOUNDARY_PERIODIC * if isinstance(boundary, str): * if boundary == 'none': # <<<<<<<<<<<<<< * return DM_BOUNDARY_NONE * elif boundary == 'ghosted': */ } /* "petsc4py/PETSc/petscdm.pxi":203 * if boundary == 'none': * return DM_BOUNDARY_NONE * elif boundary == 'ghosted': # <<<<<<<<<<<<<< * return DM_BOUNDARY_GHOSTED * elif boundary == 'mirror': */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_boundary, __pyx_n_s_ghosted, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(26, 203, __pyx_L1_error) if (__pyx_t_1) { /* "petsc4py/PETSc/petscdm.pxi":204 * return DM_BOUNDARY_NONE * elif boundary == 'ghosted': * return DM_BOUNDARY_GHOSTED # <<<<<<<<<<<<<< * elif boundary == 'mirror': * return DM_BOUNDARY_MIRROR */ __pyx_r = DM_BOUNDARY_GHOSTED; goto __pyx_L0; /* "petsc4py/PETSc/petscdm.pxi":203 * if boundary == 'none': * return DM_BOUNDARY_NONE * elif boundary == 'ghosted': # <<<<<<<<<<<<<< * return DM_BOUNDARY_GHOSTED * elif boundary == 'mirror': */ } /* "petsc4py/PETSc/petscdm.pxi":205 * elif boundary == 'ghosted': * return DM_BOUNDARY_GHOSTED * elif boundary == 'mirror': # <<<<<<<<<<<<<< * return DM_BOUNDARY_MIRROR * elif boundary == 'periodic': */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_boundary, __pyx_n_s_mirror, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(26, 205, __pyx_L1_error) if (__pyx_t_1) { /* "petsc4py/PETSc/petscdm.pxi":206 * return DM_BOUNDARY_GHOSTED * elif boundary == 'mirror': * return DM_BOUNDARY_MIRROR # <<<<<<<<<<<<<< * elif boundary == 'periodic': * return DM_BOUNDARY_PERIODIC */ __pyx_r = DM_BOUNDARY_MIRROR; goto __pyx_L0; /* "petsc4py/PETSc/petscdm.pxi":205 * elif boundary == 'ghosted': * return DM_BOUNDARY_GHOSTED * elif boundary == 'mirror': # <<<<<<<<<<<<<< * return DM_BOUNDARY_MIRROR * elif boundary == 'periodic': */ } /* "petsc4py/PETSc/petscdm.pxi":207 * elif boundary == 'mirror': * return DM_BOUNDARY_MIRROR * elif boundary == 'periodic': # <<<<<<<<<<<<<< * return DM_BOUNDARY_PERIODIC * elif boundary == 'twist': */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_boundary, __pyx_n_s_periodic, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(26, 207, __pyx_L1_error) if (__pyx_t_1) { /* "petsc4py/PETSc/petscdm.pxi":208 * return DM_BOUNDARY_MIRROR * elif boundary == 'periodic': * return DM_BOUNDARY_PERIODIC # <<<<<<<<<<<<<< * elif boundary == 'twist': * return DM_BOUNDARY_TWIST */ __pyx_r = DM_BOUNDARY_PERIODIC; goto __pyx_L0; /* "petsc4py/PETSc/petscdm.pxi":207 * elif boundary == 'mirror': * return DM_BOUNDARY_MIRROR * elif boundary == 'periodic': # <<<<<<<<<<<<<< * return DM_BOUNDARY_PERIODIC * elif boundary == 'twist': */ } /* "petsc4py/PETSc/petscdm.pxi":209 * elif boundary == 'periodic': * return DM_BOUNDARY_PERIODIC * elif boundary == 'twist': # <<<<<<<<<<<<<< * return DM_BOUNDARY_TWIST * else: */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_boundary, __pyx_n_s_twist, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(26, 209, __pyx_L1_error) if (likely(__pyx_t_1)) { /* "petsc4py/PETSc/petscdm.pxi":210 * return DM_BOUNDARY_PERIODIC * elif boundary == 'twist': * return DM_BOUNDARY_TWIST # <<<<<<<<<<<<<< * else: * raise ValueError("unknown boundary type: %s" % boundary) */ __pyx_r = DM_BOUNDARY_TWIST; goto __pyx_L0; /* "petsc4py/PETSc/petscdm.pxi":209 * elif boundary == 'periodic': * return DM_BOUNDARY_PERIODIC * elif boundary == 'twist': # <<<<<<<<<<<<<< * return DM_BOUNDARY_TWIST * else: */ } /* "petsc4py/PETSc/petscdm.pxi":212 * return DM_BOUNDARY_TWIST * else: * raise ValueError("unknown boundary type: %s" % boundary) # <<<<<<<<<<<<<< * return boundary * */ /*else*/ { __pyx_t_2 = __Pyx_PyString_FormatSafe(__pyx_kp_s_unknown_boundary_type_s, __pyx_v_boundary); if (unlikely(!__pyx_t_2)) __PYX_ERR(26, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(26, 212, __pyx_L1_error) } /* "petsc4py/PETSc/petscdm.pxi":200 * if boundary is True: * return DM_BOUNDARY_PERIODIC * if isinstance(boundary, str): # <<<<<<<<<<<<<< * if boundary == 'none': * return DM_BOUNDARY_NONE */ } /* "petsc4py/PETSc/petscdm.pxi":213 * else: * raise ValueError("unknown boundary type: %s" % boundary) * return boundary # <<<<<<<<<<<<<< * * cdef inline PetscInt asBoundary(object boundary, */ __pyx_t_4 = ((DMBoundaryType)__Pyx_PyInt_As_DMBoundaryType(__pyx_v_boundary)); if (unlikely(PyErr_Occurred())) __PYX_ERR(26, 213, __pyx_L1_error) __pyx_r = __pyx_t_4; goto __pyx_L0; /* "petsc4py/PETSc/petscdm.pxi":192 * # -------------------------------------------------------------------- * * cdef inline PetscDMBoundaryType asBoundaryType(object boundary) \ # <<<<<<<<<<<<<< * except (-1): * if boundary is None: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.asBoundaryType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = ((DMBoundaryType)-1L); __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscdm.pxi":215 * return boundary * * cdef inline PetscInt asBoundary(object boundary, # <<<<<<<<<<<<<< * PetscDMBoundaryType *_x, * PetscDMBoundaryType *_y, */ static CYTHON_INLINE PetscInt __pyx_f_8petsc4py_5PETSc_asBoundary(PyObject *__pyx_v_boundary, DMBoundaryType *__pyx_v__x, DMBoundaryType *__pyx_v__y, DMBoundaryType *__pyx_v__z) { PetscInt __pyx_v_dim; PyObject *__pyx_v_x = 0; PyObject *__pyx_v_y = 0; PyObject *__pyx_v_z = 0; PetscInt __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; DMBoundaryType __pyx_t_4; Py_ssize_t __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("asBoundary", 0); __Pyx_INCREF(__pyx_v_boundary); /* "petsc4py/PETSc/petscdm.pxi":219 * PetscDMBoundaryType *_y, * PetscDMBoundaryType *_z) except -1: * cdef PetscInt dim = 0 # <<<<<<<<<<<<<< * cdef object x=None, y=None, z=None * if (boundary is None or */ __pyx_v_dim = 0; /* "petsc4py/PETSc/petscdm.pxi":220 * PetscDMBoundaryType *_z) except -1: * cdef PetscInt dim = 0 * cdef object x=None, y=None, z=None # <<<<<<<<<<<<<< * if (boundary is None or * isinstance(boundary, str) or */ __Pyx_INCREF(Py_None); __pyx_v_x = Py_None; __Pyx_INCREF(Py_None); __pyx_v_y = Py_None; __Pyx_INCREF(Py_None); __pyx_v_z = Py_None; /* "petsc4py/PETSc/petscdm.pxi":221 * cdef PetscInt dim = 0 * cdef object x=None, y=None, z=None * if (boundary is None or # <<<<<<<<<<<<<< * isinstance(boundary, str) or * isinstance(boundary, int)): */ __pyx_t_2 = (__pyx_v_boundary == Py_None); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } /* "petsc4py/PETSc/petscdm.pxi":222 * cdef object x=None, y=None, z=None * if (boundary is None or * isinstance(boundary, str) or # <<<<<<<<<<<<<< * isinstance(boundary, int)): * _x[0] = _y[0] = _z[0] = asBoundaryType(boundary) */ __pyx_t_2 = PyString_Check(__pyx_v_boundary); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } /* "petsc4py/PETSc/petscdm.pxi":223 * if (boundary is None or * isinstance(boundary, str) or * isinstance(boundary, int)): # <<<<<<<<<<<<<< * _x[0] = _y[0] = _z[0] = asBoundaryType(boundary) * else: */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_int); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyObject_IsInstance(__pyx_v_boundary, __pyx_t_3); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(26, 223, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; /* "petsc4py/PETSc/petscdm.pxi":221 * cdef PetscInt dim = 0 * cdef object x=None, y=None, z=None * if (boundary is None or # <<<<<<<<<<<<<< * isinstance(boundary, str) or * isinstance(boundary, int)): */ if (__pyx_t_1) { /* "petsc4py/PETSc/petscdm.pxi":224 * isinstance(boundary, str) or * isinstance(boundary, int)): * _x[0] = _y[0] = _z[0] = asBoundaryType(boundary) # <<<<<<<<<<<<<< * else: * _x[0] = _y[0] = _z[0] = DM_BOUNDARY_NONE */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asBoundaryType(__pyx_v_boundary); if (unlikely(__pyx_t_4 == ((DMBoundaryType)((DMBoundaryType)-1L)))) __PYX_ERR(26, 224, __pyx_L1_error) (__pyx_v__x[0]) = __pyx_t_4; (__pyx_v__y[0]) = __pyx_t_4; (__pyx_v__z[0]) = __pyx_t_4; /* "petsc4py/PETSc/petscdm.pxi":221 * cdef PetscInt dim = 0 * cdef object x=None, y=None, z=None * if (boundary is None or # <<<<<<<<<<<<<< * isinstance(boundary, str) or * isinstance(boundary, int)): */ goto __pyx_L3; } /* "petsc4py/PETSc/petscdm.pxi":226 * _x[0] = _y[0] = _z[0] = asBoundaryType(boundary) * else: * _x[0] = _y[0] = _z[0] = DM_BOUNDARY_NONE # <<<<<<<<<<<<<< * boundary = tuple(boundary) * dim = len(boundary) */ /*else*/ { (__pyx_v__x[0]) = DM_BOUNDARY_NONE; (__pyx_v__y[0]) = DM_BOUNDARY_NONE; (__pyx_v__z[0]) = DM_BOUNDARY_NONE; /* "petsc4py/PETSc/petscdm.pxi":227 * else: * _x[0] = _y[0] = _z[0] = DM_BOUNDARY_NONE * boundary = tuple(boundary) # <<<<<<<<<<<<<< * dim = len(boundary) * if dim == 0: pass */ __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_v_boundary); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_boundary, __pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/petscdm.pxi":228 * _x[0] = _y[0] = _z[0] = DM_BOUNDARY_NONE * boundary = tuple(boundary) * dim = len(boundary) # <<<<<<<<<<<<<< * if dim == 0: pass * elif dim == 1: (x,) = boundary */ __pyx_t_5 = PyObject_Length(__pyx_v_boundary); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(26, 228, __pyx_L1_error) __pyx_v_dim = ((PetscInt)__pyx_t_5); /* "petsc4py/PETSc/petscdm.pxi":229 * boundary = tuple(boundary) * dim = len(boundary) * if dim == 0: pass # <<<<<<<<<<<<<< * elif dim == 1: (x,) = boundary * elif dim == 2: (x, y) = boundary */ __pyx_t_1 = (__pyx_v_dim == 0); if (__pyx_t_1) { goto __pyx_L7; } /* "petsc4py/PETSc/petscdm.pxi":230 * dim = len(boundary) * if dim == 0: pass * elif dim == 1: (x,) = boundary # <<<<<<<<<<<<<< * elif dim == 2: (x, y) = boundary * elif dim == 3: (x, y, z) = boundary */ __pyx_t_1 = (__pyx_v_dim == 1); if (__pyx_t_1) { if ((likely(PyTuple_CheckExact(__pyx_v_boundary))) || (PyList_CheckExact(__pyx_v_boundary))) { PyObject* sequence = __pyx_v_boundary; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 1)) { if (size > 1) __Pyx_RaiseTooManyValuesError(1); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(26, 230, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); } else { __pyx_t_3 = PyList_GET_ITEM(sequence, 0); } __Pyx_INCREF(__pyx_t_3); #else __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_boundary); if (unlikely(!__pyx_t_6)) __PYX_ERR(26, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); index = 0; __pyx_t_3 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 1) < 0) __PYX_ERR(26, 230, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(26, 230, __pyx_L1_error) __pyx_L9_unpacking_done:; } __Pyx_DECREF_SET(__pyx_v_x, __pyx_t_3); __pyx_t_3 = 0; goto __pyx_L7; } /* "petsc4py/PETSc/petscdm.pxi":231 * if dim == 0: pass * elif dim == 1: (x,) = boundary * elif dim == 2: (x, y) = boundary # <<<<<<<<<<<<<< * elif dim == 3: (x, y, z) = boundary * if dim >= 1: _x[0] = asBoundaryType(x) */ __pyx_t_1 = (__pyx_v_dim == 2); if (__pyx_t_1) { if ((likely(PyTuple_CheckExact(__pyx_v_boundary))) || (PyList_CheckExact(__pyx_v_boundary))) { PyObject* sequence = __pyx_v_boundary; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(26, 231, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_3 = PyList_GET_ITEM(sequence, 0); __pyx_t_6 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(26, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_8 = PyObject_GetIter(__pyx_v_boundary); if (unlikely(!__pyx_t_8)) __PYX_ERR(26, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); index = 0; __pyx_t_3 = __pyx_t_7(__pyx_t_8); if (unlikely(!__pyx_t_3)) goto __pyx_L10_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 1; __pyx_t_6 = __pyx_t_7(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L10_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_8), 2) < 0) __PYX_ERR(26, 231, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L11_unpacking_done; __pyx_L10_unpacking_failed:; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(26, 231, __pyx_L1_error) __pyx_L11_unpacking_done:; } __Pyx_DECREF_SET(__pyx_v_x, __pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_y, __pyx_t_6); __pyx_t_6 = 0; goto __pyx_L7; } /* "petsc4py/PETSc/petscdm.pxi":232 * elif dim == 1: (x,) = boundary * elif dim == 2: (x, y) = boundary * elif dim == 3: (x, y, z) = boundary # <<<<<<<<<<<<<< * if dim >= 1: _x[0] = asBoundaryType(x) * if dim >= 2: _y[0] = asBoundaryType(y) */ __pyx_t_1 = (__pyx_v_dim == 3); if (__pyx_t_1) { if ((likely(PyTuple_CheckExact(__pyx_v_boundary))) || (PyList_CheckExact(__pyx_v_boundary))) { PyObject* sequence = __pyx_v_boundary; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(26, 232, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_6 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); __pyx_t_8 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_8); #else __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(26, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_8)) __PYX_ERR(26, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); #endif } else { Py_ssize_t index = -1; __pyx_t_9 = PyObject_GetIter(__pyx_v_boundary); if (unlikely(!__pyx_t_9)) __PYX_ERR(26, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); index = 0; __pyx_t_6 = __pyx_t_7(__pyx_t_9); if (unlikely(!__pyx_t_6)) goto __pyx_L12_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); index = 1; __pyx_t_3 = __pyx_t_7(__pyx_t_9); if (unlikely(!__pyx_t_3)) goto __pyx_L12_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 2; __pyx_t_8 = __pyx_t_7(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L12_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_9), 3) < 0) __PYX_ERR(26, 232, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L13_unpacking_done; __pyx_L12_unpacking_failed:; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(26, 232, __pyx_L1_error) __pyx_L13_unpacking_done:; } __Pyx_DECREF_SET(__pyx_v_x, __pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF_SET(__pyx_v_y, __pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_z, __pyx_t_8); __pyx_t_8 = 0; } __pyx_L7:; /* "petsc4py/PETSc/petscdm.pxi":233 * elif dim == 2: (x, y) = boundary * elif dim == 3: (x, y, z) = boundary * if dim >= 1: _x[0] = asBoundaryType(x) # <<<<<<<<<<<<<< * if dim >= 2: _y[0] = asBoundaryType(y) * if dim >= 3: _z[0] = asBoundaryType(z) */ __pyx_t_1 = (__pyx_v_dim >= 1); if (__pyx_t_1) { __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asBoundaryType(__pyx_v_x); if (unlikely(__pyx_t_4 == ((DMBoundaryType)((DMBoundaryType)-1L)))) __PYX_ERR(26, 233, __pyx_L1_error) (__pyx_v__x[0]) = __pyx_t_4; } /* "petsc4py/PETSc/petscdm.pxi":234 * elif dim == 3: (x, y, z) = boundary * if dim >= 1: _x[0] = asBoundaryType(x) * if dim >= 2: _y[0] = asBoundaryType(y) # <<<<<<<<<<<<<< * if dim >= 3: _z[0] = asBoundaryType(z) * return dim */ __pyx_t_1 = (__pyx_v_dim >= 2); if (__pyx_t_1) { __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asBoundaryType(__pyx_v_y); if (unlikely(__pyx_t_4 == ((DMBoundaryType)((DMBoundaryType)-1L)))) __PYX_ERR(26, 234, __pyx_L1_error) (__pyx_v__y[0]) = __pyx_t_4; } /* "petsc4py/PETSc/petscdm.pxi":235 * if dim >= 1: _x[0] = asBoundaryType(x) * if dim >= 2: _y[0] = asBoundaryType(y) * if dim >= 3: _z[0] = asBoundaryType(z) # <<<<<<<<<<<<<< * return dim * */ __pyx_t_1 = (__pyx_v_dim >= 3); if (__pyx_t_1) { __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asBoundaryType(__pyx_v_z); if (unlikely(__pyx_t_4 == ((DMBoundaryType)((DMBoundaryType)-1L)))) __PYX_ERR(26, 235, __pyx_L1_error) (__pyx_v__z[0]) = __pyx_t_4; } } __pyx_L3:; /* "petsc4py/PETSc/petscdm.pxi":236 * if dim >= 2: _y[0] = asBoundaryType(y) * if dim >= 3: _z[0] = asBoundaryType(z) * return dim # <<<<<<<<<<<<<< * * cdef inline object toBoundary(PetscInt dim, */ __pyx_r = __pyx_v_dim; goto __pyx_L0; /* "petsc4py/PETSc/petscdm.pxi":215 * return boundary * * cdef inline PetscInt asBoundary(object boundary, # <<<<<<<<<<<<<< * PetscDMBoundaryType *_x, * PetscDMBoundaryType *_y, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("petsc4py.PETSc.asBoundary", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1L; __pyx_L0:; __Pyx_XDECREF(__pyx_v_x); __Pyx_XDECREF(__pyx_v_y); __Pyx_XDECREF(__pyx_v_z); __Pyx_XDECREF(__pyx_v_boundary); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscdm.pxi":238 * return dim * * cdef inline object toBoundary(PetscInt dim, # <<<<<<<<<<<<<< * PetscDMBoundaryType x, * PetscDMBoundaryType y, */ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toBoundary(PetscInt __pyx_v_dim, DMBoundaryType __pyx_v_x, DMBoundaryType __pyx_v_y, DMBoundaryType __pyx_v_z) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("toBoundary", 1); /* "petsc4py/PETSc/petscdm.pxi":242 * PetscDMBoundaryType y, * PetscDMBoundaryType z): * if dim == 0: return () # <<<<<<<<<<<<<< * elif dim == 1: return (x,) * elif dim == 2: return (x, y) */ __pyx_t_1 = (__pyx_v_dim == 0); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_empty_tuple); __pyx_r = __pyx_empty_tuple; goto __pyx_L0; } /* "petsc4py/PETSc/petscdm.pxi":243 * PetscDMBoundaryType z): * if dim == 0: return () * elif dim == 1: return (x,) # <<<<<<<<<<<<<< * elif dim == 2: return (x, y) * elif dim == 3: return (x, y, z) */ __pyx_t_1 = (__pyx_v_dim == 1); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_DMBoundaryType(__pyx_v_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(26, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(26, 243, __pyx_L1_error); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } /* "petsc4py/PETSc/petscdm.pxi":244 * if dim == 0: return () * elif dim == 1: return (x,) * elif dim == 2: return (x, y) # <<<<<<<<<<<<<< * elif dim == 3: return (x, y, z) * */ __pyx_t_1 = (__pyx_v_dim == 2); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyInt_From_DMBoundaryType(__pyx_v_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyInt_From_DMBoundaryType(__pyx_v_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(26, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(26, 244, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2)) __PYX_ERR(26, 244, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; } /* "petsc4py/PETSc/petscdm.pxi":245 * elif dim == 1: return (x,) * elif dim == 2: return (x, y) * elif dim == 3: return (x, y, z) # <<<<<<<<<<<<<< * * # ----------------------------------------------------------------------------- */ __pyx_t_1 = (__pyx_v_dim == 3); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PyInt_From_DMBoundaryType(__pyx_v_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyInt_From_DMBoundaryType(__pyx_v_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(26, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_DMBoundaryType(__pyx_v_z); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(26, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4)) __PYX_ERR(26, 245, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2)) __PYX_ERR(26, 245, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3)) __PYX_ERR(26, 245, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; } /* "petsc4py/PETSc/petscdm.pxi":238 * return dim * * cdef inline object toBoundary(PetscInt dim, # <<<<<<<<<<<<<< * PetscDMBoundaryType x, * PetscDMBoundaryType y, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.toBoundary", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscdm.pxi":249 * # ----------------------------------------------------------------------------- * * cdef inline DM ref_DM(PetscDM dm): # <<<<<<<<<<<<<< * cdef DM ob = DM() * ob.dm = dm */ static CYTHON_INLINE struct PyPetscDMObject *__pyx_f_8petsc4py_5PETSc_ref_DM(DM __pyx_v_dm) { struct PyPetscDMObject *__pyx_v_ob = 0; struct PyPetscDMObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("ref_DM", 1); /* "petsc4py/PETSc/petscdm.pxi":250 * * cdef inline DM ref_DM(PetscDM dm): * cdef DM ob = DM() # <<<<<<<<<<<<<< * ob.dm = dm * CHKERR( PetscINCREF(ob.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM)); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_ob = ((struct PyPetscDMObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscdm.pxi":251 * cdef inline DM ref_DM(PetscDM dm): * cdef DM ob = DM() * ob.dm = dm # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(ob.obj) ) * return ob */ __pyx_v_ob->dm = __pyx_v_dm; /* "petsc4py/PETSc/petscdm.pxi":252 * cdef DM ob = DM() * ob.dm = dm * CHKERR( PetscINCREF(ob.obj) ) # <<<<<<<<<<<<<< * return ob * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ob->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(26, 252, __pyx_L1_error) /* "petsc4py/PETSc/petscdm.pxi":253 * ob.dm = dm * CHKERR( PetscINCREF(ob.obj) ) * return ob # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_ob); __pyx_r = __pyx_v_ob; goto __pyx_L0; /* "petsc4py/PETSc/petscdm.pxi":249 * # ----------------------------------------------------------------------------- * * cdef inline DM ref_DM(PetscDM dm): # <<<<<<<<<<<<<< * cdef DM ob = DM() * ob.dm = dm */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.ref_DM", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscdm.pxi":257 * # -------------------------------------------------------------------- * * cdef PetscErrorCode DM_PyCoarsenHook( # <<<<<<<<<<<<<< * PetscDM fine, * PetscDM coarse, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_DM_PyCoarsenHook(DM __pyx_v_fine, DM __pyx_v_coarse, CYTHON_UNUSED void *__pyx_v_ctx) { struct PyPetscDMObject *__pyx_v_Fine = 0; struct PyPetscDMObject *__pyx_v_Coarse = 0; PyObject *__pyx_v_hooks = 0; PyObject *__pyx_v_hook = NULL; PyObject *__pyx_v_hookop = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *(*__pyx_t_5)(PyObject *); PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *(*__pyx_t_10)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("DM_PyCoarsenHook", 0); /* "petsc4py/PETSc/petscdm.pxi":263 * ) except PETSC_ERR_PYTHON with gil: * * cdef DM Fine = ref_DM(fine) # <<<<<<<<<<<<<< * cdef DM Coarse = ref_DM(coarse) * cdef object hooks = Fine.get_attr('__coarsenhooks__') */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_DM(__pyx_v_fine)); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Fine = ((struct PyPetscDMObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscdm.pxi":264 * * cdef DM Fine = ref_DM(fine) * cdef DM Coarse = ref_DM(coarse) # <<<<<<<<<<<<<< * cdef object hooks = Fine.get_attr('__coarsenhooks__') * assert hooks is not None and type(hooks) is list */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_DM(__pyx_v_coarse)); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 264, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Coarse = ((struct PyPetscDMObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscdm.pxi":265 * cdef DM Fine = ref_DM(fine) * cdef DM Coarse = ref_DM(coarse) * cdef object hooks = Fine.get_attr('__coarsenhooks__') # <<<<<<<<<<<<<< * assert hooks is not None and type(hooks) is list * for hook in hooks: */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_Fine->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Fine), ((char *)"__coarsenhooks__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_hooks = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/petscdm.pxi":266 * cdef DM Coarse = ref_DM(coarse) * cdef object hooks = Fine.get_attr('__coarsenhooks__') * assert hooks is not None and type(hooks) is list # <<<<<<<<<<<<<< * for hook in hooks: * (hookop, args, kargs) = hook */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_3 = (__pyx_v_hooks != Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L3_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_hooks)) == ((PyObject *)(&PyList_Type))); __pyx_t_2 = __pyx_t_3; __pyx_L3_bool_binop_done:; if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(26, 266, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(26, 266, __pyx_L1_error) #endif /* "petsc4py/PETSc/petscdm.pxi":267 * cdef object hooks = Fine.get_attr('__coarsenhooks__') * assert hooks is not None and type(hooks) is list * for hook in hooks: # <<<<<<<<<<<<<< * (hookop, args, kargs) = hook * hookop(Fine, Coarse, *args, **kargs) */ if (likely(PyList_CheckExact(__pyx_v_hooks)) || PyTuple_CheckExact(__pyx_v_hooks)) { __pyx_t_1 = __pyx_v_hooks; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_hooks); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(26, 267, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_5)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(26, 267, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(26, 267, __pyx_L1_error) #else __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(26, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(26, 267, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(26, 267, __pyx_L1_error) #else __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(26, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } } else { __pyx_t_6 = __pyx_t_5(__pyx_t_1); if (unlikely(!__pyx_t_6)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(26, 267, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_6); } __Pyx_XDECREF_SET(__pyx_v_hook, __pyx_t_6); __pyx_t_6 = 0; /* "petsc4py/PETSc/petscdm.pxi":268 * assert hooks is not None and type(hooks) is list * for hook in hooks: * (hookop, args, kargs) = hook # <<<<<<<<<<<<<< * hookop(Fine, Coarse, *args, **kargs) * return PETSC_SUCCESS */ if ((likely(PyTuple_CheckExact(__pyx_v_hook))) || (PyList_CheckExact(__pyx_v_hook))) { PyObject* sequence = __pyx_v_hook; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(26, 268, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_6 = PyList_GET_ITEM(sequence, 0); __pyx_t_7 = PyList_GET_ITEM(sequence, 1); __pyx_t_8 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); #else __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(26, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(26, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_8)) __PYX_ERR(26, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); #endif } else { Py_ssize_t index = -1; __pyx_t_9 = PyObject_GetIter(__pyx_v_hook); if (unlikely(!__pyx_t_9)) __PYX_ERR(26, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); index = 0; __pyx_t_6 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_6)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); index = 1; __pyx_t_7 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_7)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_7); index = 2; __pyx_t_8 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 3) < 0) __PYX_ERR(26, 268, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L8_unpacking_done; __pyx_L7_unpacking_failed:; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(26, 268, __pyx_L1_error) __pyx_L8_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_hookop, __pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF_SET(__pyx_v_args, __pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF_SET(__pyx_v_kargs, __pyx_t_8); __pyx_t_8 = 0; /* "petsc4py/PETSc/petscdm.pxi":269 * for hook in hooks: * (hookop, args, kargs) = hook * hookop(Fine, Coarse, *args, **kargs) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(26, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF((PyObject *)__pyx_v_Fine); __Pyx_GIVEREF((PyObject *)__pyx_v_Fine); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_v_Fine))) __PYX_ERR(26, 269, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_Coarse); __Pyx_GIVEREF((PyObject *)__pyx_v_Coarse); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, ((PyObject *)__pyx_v_Coarse))) __PYX_ERR(26, 269, __pyx_L1_error); __pyx_t_7 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_7)) __PYX_ERR(26, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = PyNumber_Add(__pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(26, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(26, 269, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_7 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_7)) __PYX_ERR(26, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } else { __pyx_t_7 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_7)) __PYX_ERR(26, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } __pyx_t_8 = __Pyx_PyObject_Call(__pyx_v_hookop, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(26, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "petsc4py/PETSc/petscdm.pxi":267 * cdef object hooks = Fine.get_attr('__coarsenhooks__') * assert hooks is not None and type(hooks) is list * for hook in hooks: # <<<<<<<<<<<<<< * (hookop, args, kargs) = hook * hookop(Fine, Coarse, *args, **kargs) */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscdm.pxi":270 * (hookop, args, kargs) = hook * hookop(Fine, Coarse, *args, **kargs) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * cdef PetscErrorCode DM_PyRestrictHook( */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petscdm.pxi":257 * # -------------------------------------------------------------------- * * cdef PetscErrorCode DM_PyCoarsenHook( # <<<<<<<<<<<<<< * PetscDM fine, * PetscDM coarse, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("petsc4py.PETSc.DM_PyCoarsenHook", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Fine); __Pyx_XDECREF((PyObject *)__pyx_v_Coarse); __Pyx_XDECREF(__pyx_v_hooks); __Pyx_XDECREF(__pyx_v_hook); __Pyx_XDECREF(__pyx_v_hookop); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petscdm.pxi":272 * return PETSC_SUCCESS * * cdef PetscErrorCode DM_PyRestrictHook( # <<<<<<<<<<<<<< * PetscDM fine, * PetscMat mrestrict, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_DM_PyRestrictHook(DM __pyx_v_fine, Mat __pyx_v_mrestrict, Vec __pyx_v_rscale, Mat __pyx_v_inject, DM __pyx_v_coarse, CYTHON_UNUSED void *__pyx_v_ctx) { struct PyPetscDMObject *__pyx_v_Fine = 0; struct PyPetscMatObject *__pyx_v_Mrestrict = 0; struct PyPetscVecObject *__pyx_v_Rscale = 0; struct PyPetscMatObject *__pyx_v_Inject = 0; struct PyPetscDMObject *__pyx_v_Coarse = 0; PyObject *__pyx_v_hooks = 0; PyObject *__pyx_v_hook = NULL; PyObject *__pyx_v_hookop = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *(*__pyx_t_5)(PyObject *); PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *(*__pyx_t_10)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("DM_PyRestrictHook", 0); /* "petsc4py/PETSc/petscdm.pxi":281 * ) except PETSC_ERR_PYTHON with gil: * * cdef DM Fine = ref_DM(fine) # <<<<<<<<<<<<<< * cdef Mat Mrestrict = ref_Mat(mrestrict) * cdef Vec Rscale = ref_Vec(rscale) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_DM(__pyx_v_fine)); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Fine = ((struct PyPetscDMObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscdm.pxi":282 * * cdef DM Fine = ref_DM(fine) * cdef Mat Mrestrict = ref_Mat(mrestrict) # <<<<<<<<<<<<<< * cdef Vec Rscale = ref_Vec(rscale) * cdef Mat Inject = ref_Mat(inject) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v_mrestrict)); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Mrestrict = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscdm.pxi":283 * cdef DM Fine = ref_DM(fine) * cdef Mat Mrestrict = ref_Mat(mrestrict) * cdef Vec Rscale = ref_Vec(rscale) # <<<<<<<<<<<<<< * cdef Mat Inject = ref_Mat(inject) * cdef DM Coarse = ref_DM(coarse) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_rscale)); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Rscale = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscdm.pxi":284 * cdef Mat Mrestrict = ref_Mat(mrestrict) * cdef Vec Rscale = ref_Vec(rscale) * cdef Mat Inject = ref_Mat(inject) # <<<<<<<<<<<<<< * cdef DM Coarse = ref_DM(coarse) * cdef object hooks = Fine.get_attr('__restricthooks__') */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v_inject)); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Inject = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscdm.pxi":285 * cdef Vec Rscale = ref_Vec(rscale) * cdef Mat Inject = ref_Mat(inject) * cdef DM Coarse = ref_DM(coarse) # <<<<<<<<<<<<<< * cdef object hooks = Fine.get_attr('__restricthooks__') * assert hooks is not None and type(hooks) is list */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_DM(__pyx_v_coarse)); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Coarse = ((struct PyPetscDMObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscdm.pxi":286 * cdef Mat Inject = ref_Mat(inject) * cdef DM Coarse = ref_DM(coarse) * cdef object hooks = Fine.get_attr('__restricthooks__') # <<<<<<<<<<<<<< * assert hooks is not None and type(hooks) is list * for hook in hooks: */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_Fine->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Fine), ((char *)"__restricthooks__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_hooks = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/petscdm.pxi":287 * cdef DM Coarse = ref_DM(coarse) * cdef object hooks = Fine.get_attr('__restricthooks__') * assert hooks is not None and type(hooks) is list # <<<<<<<<<<<<<< * for hook in hooks: * (hookop, args, kargs) = hook */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_3 = (__pyx_v_hooks != Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L3_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_hooks)) == ((PyObject *)(&PyList_Type))); __pyx_t_2 = __pyx_t_3; __pyx_L3_bool_binop_done:; if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(26, 287, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(26, 287, __pyx_L1_error) #endif /* "petsc4py/PETSc/petscdm.pxi":288 * cdef object hooks = Fine.get_attr('__restricthooks__') * assert hooks is not None and type(hooks) is list * for hook in hooks: # <<<<<<<<<<<<<< * (hookop, args, kargs) = hook * hookop(Fine, Mrestrict, Rscale, Inject, Coarse, *args, **kargs) */ if (likely(PyList_CheckExact(__pyx_v_hooks)) || PyTuple_CheckExact(__pyx_v_hooks)) { __pyx_t_1 = __pyx_v_hooks; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_hooks); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(26, 288, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_5)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(26, 288, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(26, 288, __pyx_L1_error) #else __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(26, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(26, 288, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(26, 288, __pyx_L1_error) #else __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(26, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } } else { __pyx_t_6 = __pyx_t_5(__pyx_t_1); if (unlikely(!__pyx_t_6)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(26, 288, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_6); } __Pyx_XDECREF_SET(__pyx_v_hook, __pyx_t_6); __pyx_t_6 = 0; /* "petsc4py/PETSc/petscdm.pxi":289 * assert hooks is not None and type(hooks) is list * for hook in hooks: * (hookop, args, kargs) = hook # <<<<<<<<<<<<<< * hookop(Fine, Mrestrict, Rscale, Inject, Coarse, *args, **kargs) * return PETSC_SUCCESS */ if ((likely(PyTuple_CheckExact(__pyx_v_hook))) || (PyList_CheckExact(__pyx_v_hook))) { PyObject* sequence = __pyx_v_hook; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(26, 289, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_6 = PyList_GET_ITEM(sequence, 0); __pyx_t_7 = PyList_GET_ITEM(sequence, 1); __pyx_t_8 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); #else __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(26, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(26, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_8)) __PYX_ERR(26, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); #endif } else { Py_ssize_t index = -1; __pyx_t_9 = PyObject_GetIter(__pyx_v_hook); if (unlikely(!__pyx_t_9)) __PYX_ERR(26, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); index = 0; __pyx_t_6 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_6)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); index = 1; __pyx_t_7 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_7)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_7); index = 2; __pyx_t_8 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 3) < 0) __PYX_ERR(26, 289, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L8_unpacking_done; __pyx_L7_unpacking_failed:; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(26, 289, __pyx_L1_error) __pyx_L8_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_hookop, __pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF_SET(__pyx_v_args, __pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF_SET(__pyx_v_kargs, __pyx_t_8); __pyx_t_8 = 0; /* "petsc4py/PETSc/petscdm.pxi":290 * for hook in hooks: * (hookop, args, kargs) = hook * hookop(Fine, Mrestrict, Rscale, Inject, Coarse, *args, **kargs) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * # ----------------------------------------------------------------------------- */ __pyx_t_8 = PyTuple_New(5); if (unlikely(!__pyx_t_8)) __PYX_ERR(26, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF((PyObject *)__pyx_v_Fine); __Pyx_GIVEREF((PyObject *)__pyx_v_Fine); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_v_Fine))) __PYX_ERR(26, 290, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_Mrestrict); __Pyx_GIVEREF((PyObject *)__pyx_v_Mrestrict); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, ((PyObject *)__pyx_v_Mrestrict))) __PYX_ERR(26, 290, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_Rscale); __Pyx_GIVEREF((PyObject *)__pyx_v_Rscale); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, ((PyObject *)__pyx_v_Rscale))) __PYX_ERR(26, 290, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_Inject); __Pyx_GIVEREF((PyObject *)__pyx_v_Inject); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 3, ((PyObject *)__pyx_v_Inject))) __PYX_ERR(26, 290, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_Coarse); __Pyx_GIVEREF((PyObject *)__pyx_v_Coarse); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 4, ((PyObject *)__pyx_v_Coarse))) __PYX_ERR(26, 290, __pyx_L1_error); __pyx_t_7 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_7)) __PYX_ERR(26, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = PyNumber_Add(__pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(26, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(26, 290, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_7 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_7)) __PYX_ERR(26, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } else { __pyx_t_7 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_7)) __PYX_ERR(26, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } __pyx_t_8 = __Pyx_PyObject_Call(__pyx_v_hookop, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(26, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "petsc4py/PETSc/petscdm.pxi":288 * cdef object hooks = Fine.get_attr('__restricthooks__') * assert hooks is not None and type(hooks) is list * for hook in hooks: # <<<<<<<<<<<<<< * (hookop, args, kargs) = hook * hookop(Fine, Mrestrict, Rscale, Inject, Coarse, *args, **kargs) */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscdm.pxi":291 * (hookop, args, kargs) = hook * hookop(Fine, Mrestrict, Rscale, Inject, Coarse, *args, **kargs) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * # ----------------------------------------------------------------------------- */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petscdm.pxi":272 * return PETSC_SUCCESS * * cdef PetscErrorCode DM_PyRestrictHook( # <<<<<<<<<<<<<< * PetscDM fine, * PetscMat mrestrict, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("petsc4py.PETSc.DM_PyRestrictHook", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Fine); __Pyx_XDECREF((PyObject *)__pyx_v_Mrestrict); __Pyx_XDECREF((PyObject *)__pyx_v_Rscale); __Pyx_XDECREF((PyObject *)__pyx_v_Inject); __Pyx_XDECREF((PyObject *)__pyx_v_Coarse); __Pyx_XDECREF(__pyx_v_hooks); __Pyx_XDECREF(__pyx_v_hook); __Pyx_XDECREF(__pyx_v_hookop); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petscdmda.pxi":88 * # -------------------------------------------------------------------- * * cdef inline PetscDMDAStencilType asStencil(object stencil) \ # <<<<<<<<<<<<<< * except (-1): * if isinstance(stencil, str): */ static CYTHON_INLINE DMDAStencilType __pyx_f_8petsc4py_5PETSc_asStencil(PyObject *__pyx_v_stencil) { DMDAStencilType __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; DMDAStencilType __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("asStencil", 1); /* "petsc4py/PETSc/petscdmda.pxi":90 * cdef inline PetscDMDAStencilType asStencil(object stencil) \ * except (-1): * if isinstance(stencil, str): # <<<<<<<<<<<<<< * if stencil == "star": return DMDA_STENCIL_STAR * elif stencil == "box": return DMDA_STENCIL_BOX */ __pyx_t_1 = PyString_Check(__pyx_v_stencil); if (__pyx_t_1) { /* "petsc4py/PETSc/petscdmda.pxi":91 * except (-1): * if isinstance(stencil, str): * if stencil == "star": return DMDA_STENCIL_STAR # <<<<<<<<<<<<<< * elif stencil == "box": return DMDA_STENCIL_BOX * else: raise ValueError("unknown stencil type: %s" % stencil) */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_stencil, __pyx_n_s_star, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(10, 91, __pyx_L1_error) if (__pyx_t_1) { __pyx_r = DMDA_STENCIL_STAR; goto __pyx_L0; } /* "petsc4py/PETSc/petscdmda.pxi":92 * if isinstance(stencil, str): * if stencil == "star": return DMDA_STENCIL_STAR * elif stencil == "box": return DMDA_STENCIL_BOX # <<<<<<<<<<<<<< * else: raise ValueError("unknown stencil type: %s" % stencil) * return stencil */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_stencil, __pyx_n_s_box, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(10, 92, __pyx_L1_error) if (likely(__pyx_t_1)) { __pyx_r = DMDA_STENCIL_BOX; goto __pyx_L0; } /* "petsc4py/PETSc/petscdmda.pxi":93 * if stencil == "star": return DMDA_STENCIL_STAR * elif stencil == "box": return DMDA_STENCIL_BOX * else: raise ValueError("unknown stencil type: %s" % stencil) # <<<<<<<<<<<<<< * return stencil * */ /*else*/ { __pyx_t_2 = __Pyx_PyString_FormatSafe(__pyx_kp_s_unknown_stencil_type_s, __pyx_v_stencil); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(10, 93, __pyx_L1_error) } /* "petsc4py/PETSc/petscdmda.pxi":90 * cdef inline PetscDMDAStencilType asStencil(object stencil) \ * except (-1): * if isinstance(stencil, str): # <<<<<<<<<<<<<< * if stencil == "star": return DMDA_STENCIL_STAR * elif stencil == "box": return DMDA_STENCIL_BOX */ } /* "petsc4py/PETSc/petscdmda.pxi":94 * elif stencil == "box": return DMDA_STENCIL_BOX * else: raise ValueError("unknown stencil type: %s" % stencil) * return stencil # <<<<<<<<<<<<<< * * cdef inline object toStencil(PetscDMDAStencilType stype): */ __pyx_t_4 = ((DMDAStencilType)__Pyx_PyInt_As_DMDAStencilType(__pyx_v_stencil)); if (unlikely(PyErr_Occurred())) __PYX_ERR(10, 94, __pyx_L1_error) __pyx_r = __pyx_t_4; goto __pyx_L0; /* "petsc4py/PETSc/petscdmda.pxi":88 * # -------------------------------------------------------------------- * * cdef inline PetscDMDAStencilType asStencil(object stencil) \ # <<<<<<<<<<<<<< * except (-1): * if isinstance(stencil, str): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.asStencil", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = ((DMDAStencilType)-1L); __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscdmda.pxi":96 * return stencil * * cdef inline object toStencil(PetscDMDAStencilType stype): # <<<<<<<<<<<<<< * if stype == DMDA_STENCIL_STAR: return "star" * elif stype == DMDA_STENCIL_BOX: return "box" */ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toStencil(DMDAStencilType __pyx_v_stype) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("toStencil", 1); /* "petsc4py/PETSc/petscdmda.pxi":97 * * cdef inline object toStencil(PetscDMDAStencilType stype): * if stype == DMDA_STENCIL_STAR: return "star" # <<<<<<<<<<<<<< * elif stype == DMDA_STENCIL_BOX: return "box" * */ __pyx_t_1 = (__pyx_v_stype == DMDA_STENCIL_STAR); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_n_s_star); __pyx_r = __pyx_n_s_star; goto __pyx_L0; } /* "petsc4py/PETSc/petscdmda.pxi":98 * cdef inline object toStencil(PetscDMDAStencilType stype): * if stype == DMDA_STENCIL_STAR: return "star" * elif stype == DMDA_STENCIL_BOX: return "box" # <<<<<<<<<<<<<< * * cdef inline PetscDMDAInterpolationType dainterpolationtype(object itype) \ */ __pyx_t_1 = (__pyx_v_stype == DMDA_STENCIL_BOX); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_n_s_box); __pyx_r = __pyx_n_s_box; goto __pyx_L0; } /* "petsc4py/PETSc/petscdmda.pxi":96 * return stencil * * cdef inline object toStencil(PetscDMDAStencilType stype): # <<<<<<<<<<<<<< * if stype == DMDA_STENCIL_STAR: return "star" * elif stype == DMDA_STENCIL_BOX: return "box" */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscdmda.pxi":100 * elif stype == DMDA_STENCIL_BOX: return "box" * * cdef inline PetscDMDAInterpolationType dainterpolationtype(object itype) \ # <<<<<<<<<<<<<< * except (-1): * if (isinstance(itype, str)): */ static CYTHON_INLINE DMDAInterpolationType __pyx_f_8petsc4py_5PETSc_dainterpolationtype(PyObject *__pyx_v_itype) { DMDAInterpolationType __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; DMDAInterpolationType __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("dainterpolationtype", 1); /* "petsc4py/PETSc/petscdmda.pxi":102 * cdef inline PetscDMDAInterpolationType dainterpolationtype(object itype) \ * except (-1): * if (isinstance(itype, str)): # <<<<<<<<<<<<<< * if itype in ("q0", "Q0"): return DMDA_INTERPOLATION_Q0 * if itype in ("q1", "Q1"): return DMDA_INTERPOLATION_Q1 */ __pyx_t_1 = PyString_Check(__pyx_v_itype); if (__pyx_t_1) { /* "petsc4py/PETSc/petscdmda.pxi":103 * except (-1): * if (isinstance(itype, str)): * if itype in ("q0", "Q0"): return DMDA_INTERPOLATION_Q0 # <<<<<<<<<<<<<< * if itype in ("q1", "Q1"): return DMDA_INTERPOLATION_Q1 * else: raise ValueError("unknown interpolation type: %s" % itype) */ __Pyx_INCREF(__pyx_v_itype); __pyx_t_2 = __pyx_v_itype; __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_q0, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(10, 103, __pyx_L1_error) if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L5_bool_binop_done; } __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_Q0, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(10, 103, __pyx_L1_error) __pyx_t_1 = __pyx_t_3; __pyx_L5_bool_binop_done:; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = __pyx_t_1; if (__pyx_t_3) { __pyx_r = DMDA_Q0; goto __pyx_L0; } /* "petsc4py/PETSc/petscdmda.pxi":104 * if (isinstance(itype, str)): * if itype in ("q0", "Q0"): return DMDA_INTERPOLATION_Q0 * if itype in ("q1", "Q1"): return DMDA_INTERPOLATION_Q1 # <<<<<<<<<<<<<< * else: raise ValueError("unknown interpolation type: %s" % itype) * return itype */ __Pyx_INCREF(__pyx_v_itype); __pyx_t_2 = __pyx_v_itype; __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_q1, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(10, 104, __pyx_L1_error) if (!__pyx_t_1) { } else { __pyx_t_3 = __pyx_t_1; goto __pyx_L8_bool_binop_done; } __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_Q1, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(10, 104, __pyx_L1_error) __pyx_t_3 = __pyx_t_1; __pyx_L8_bool_binop_done:; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_1 = __pyx_t_3; if (likely(__pyx_t_1)) { __pyx_r = DMDA_Q1; goto __pyx_L0; } /* "petsc4py/PETSc/petscdmda.pxi":105 * if itype in ("q0", "Q0"): return DMDA_INTERPOLATION_Q0 * if itype in ("q1", "Q1"): return DMDA_INTERPOLATION_Q1 * else: raise ValueError("unknown interpolation type: %s" % itype) # <<<<<<<<<<<<<< * return itype * */ /*else*/ { __pyx_t_2 = __Pyx_PyString_FormatSafe(__pyx_kp_s_unknown_interpolation_type_s, __pyx_v_itype); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(10, 105, __pyx_L1_error) } /* "petsc4py/PETSc/petscdmda.pxi":102 * cdef inline PetscDMDAInterpolationType dainterpolationtype(object itype) \ * except (-1): * if (isinstance(itype, str)): # <<<<<<<<<<<<<< * if itype in ("q0", "Q0"): return DMDA_INTERPOLATION_Q0 * if itype in ("q1", "Q1"): return DMDA_INTERPOLATION_Q1 */ } /* "petsc4py/PETSc/petscdmda.pxi":106 * if itype in ("q1", "Q1"): return DMDA_INTERPOLATION_Q1 * else: raise ValueError("unknown interpolation type: %s" % itype) * return itype # <<<<<<<<<<<<<< * * cdef inline PetscDMDAElementType daelementtype(object etype) \ */ __pyx_t_5 = ((DMDAInterpolationType)__Pyx_PyInt_As_DMDAInterpolationType(__pyx_v_itype)); if (unlikely(PyErr_Occurred())) __PYX_ERR(10, 106, __pyx_L1_error) __pyx_r = __pyx_t_5; goto __pyx_L0; /* "petsc4py/PETSc/petscdmda.pxi":100 * elif stype == DMDA_STENCIL_BOX: return "box" * * cdef inline PetscDMDAInterpolationType dainterpolationtype(object itype) \ # <<<<<<<<<<<<<< * except (-1): * if (isinstance(itype, str)): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.dainterpolationtype", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = ((DMDAInterpolationType)-1L); __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscdmda.pxi":108 * return itype * * cdef inline PetscDMDAElementType daelementtype(object etype) \ # <<<<<<<<<<<<<< * except (-1): * if (isinstance(etype, str)): */ static CYTHON_INLINE DMDAElementType __pyx_f_8petsc4py_5PETSc_daelementtype(PyObject *__pyx_v_etype) { DMDAElementType __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; DMDAElementType __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("daelementtype", 1); /* "petsc4py/PETSc/petscdmda.pxi":110 * cdef inline PetscDMDAElementType daelementtype(object etype) \ * except (-1): * if (isinstance(etype, str)): # <<<<<<<<<<<<<< * if etype in ("p1", "P1"): return DMDA_ELEMENT_P1 * if etype in ("q1", "Q1"): return DMDA_ELEMENT_Q1 */ __pyx_t_1 = PyString_Check(__pyx_v_etype); if (__pyx_t_1) { /* "petsc4py/PETSc/petscdmda.pxi":111 * except (-1): * if (isinstance(etype, str)): * if etype in ("p1", "P1"): return DMDA_ELEMENT_P1 # <<<<<<<<<<<<<< * if etype in ("q1", "Q1"): return DMDA_ELEMENT_Q1 * else: raise ValueError("unknown element type: %s" % etype) */ __Pyx_INCREF(__pyx_v_etype); __pyx_t_2 = __pyx_v_etype; __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_p1, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(10, 111, __pyx_L1_error) if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L5_bool_binop_done; } __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_P1, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(10, 111, __pyx_L1_error) __pyx_t_1 = __pyx_t_3; __pyx_L5_bool_binop_done:; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = __pyx_t_1; if (__pyx_t_3) { __pyx_r = DMDA_ELEMENT_P1; goto __pyx_L0; } /* "petsc4py/PETSc/petscdmda.pxi":112 * if (isinstance(etype, str)): * if etype in ("p1", "P1"): return DMDA_ELEMENT_P1 * if etype in ("q1", "Q1"): return DMDA_ELEMENT_Q1 # <<<<<<<<<<<<<< * else: raise ValueError("unknown element type: %s" % etype) * return etype */ __Pyx_INCREF(__pyx_v_etype); __pyx_t_2 = __pyx_v_etype; __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_q1, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(10, 112, __pyx_L1_error) if (!__pyx_t_1) { } else { __pyx_t_3 = __pyx_t_1; goto __pyx_L8_bool_binop_done; } __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_Q1, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(10, 112, __pyx_L1_error) __pyx_t_3 = __pyx_t_1; __pyx_L8_bool_binop_done:; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_1 = __pyx_t_3; if (likely(__pyx_t_1)) { __pyx_r = DMDA_ELEMENT_Q1; goto __pyx_L0; } /* "petsc4py/PETSc/petscdmda.pxi":113 * if etype in ("p1", "P1"): return DMDA_ELEMENT_P1 * if etype in ("q1", "Q1"): return DMDA_ELEMENT_Q1 * else: raise ValueError("unknown element type: %s" % etype) # <<<<<<<<<<<<<< * return etype * */ /*else*/ { __pyx_t_2 = __Pyx_PyString_FormatSafe(__pyx_kp_s_unknown_element_type_s, __pyx_v_etype); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(10, 113, __pyx_L1_error) } /* "petsc4py/PETSc/petscdmda.pxi":110 * cdef inline PetscDMDAElementType daelementtype(object etype) \ * except (-1): * if (isinstance(etype, str)): # <<<<<<<<<<<<<< * if etype in ("p1", "P1"): return DMDA_ELEMENT_P1 * if etype in ("q1", "Q1"): return DMDA_ELEMENT_Q1 */ } /* "petsc4py/PETSc/petscdmda.pxi":114 * if etype in ("q1", "Q1"): return DMDA_ELEMENT_Q1 * else: raise ValueError("unknown element type: %s" % etype) * return etype # <<<<<<<<<<<<<< * * cdef inline PetscErrorCode DMDAGetDim(PetscDM da, PetscInt *dim) noexcept nogil: */ __pyx_t_5 = ((DMDAElementType)__Pyx_PyInt_As_DMDAElementType(__pyx_v_etype)); if (unlikely(PyErr_Occurred())) __PYX_ERR(10, 114, __pyx_L1_error) __pyx_r = __pyx_t_5; goto __pyx_L0; /* "petsc4py/PETSc/petscdmda.pxi":108 * return itype * * cdef inline PetscDMDAElementType daelementtype(object etype) \ # <<<<<<<<<<<<<< * except (-1): * if (isinstance(etype, str)): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.daelementtype", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = ((DMDAElementType)-1L); __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscdmda.pxi":116 * return etype * * cdef inline PetscErrorCode DMDAGetDim(PetscDM da, PetscInt *dim) noexcept nogil: # <<<<<<<<<<<<<< * return DMDAGetInfo(da, dim, * NULL, NULL, NULL, */ static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_DMDAGetDim(DM __pyx_v_da, PetscInt *__pyx_v_dim) { PetscErrorCode __pyx_r; /* "petsc4py/PETSc/petscdmda.pxi":117 * * cdef inline PetscErrorCode DMDAGetDim(PetscDM da, PetscInt *dim) noexcept nogil: * return DMDAGetInfo(da, dim, # <<<<<<<<<<<<<< * NULL, NULL, NULL, * NULL, NULL, NULL, */ __pyx_r = DMDAGetInfo(__pyx_v_da, __pyx_v_dim, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); goto __pyx_L0; /* "petsc4py/PETSc/petscdmda.pxi":116 * return etype * * cdef inline PetscErrorCode DMDAGetDim(PetscDM da, PetscInt *dim) noexcept nogil: # <<<<<<<<<<<<<< * return DMDAGetInfo(da, dim, * NULL, NULL, NULL, */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/petscdmda.pxi":124 * NULL) * * cdef inline PetscInt asDims(dims, # <<<<<<<<<<<<<< * PetscInt *_M, * PetscInt *_N, */ static CYTHON_INLINE PetscInt __pyx_f_8petsc4py_5PETSc_asDims(PyObject *__pyx_v_dims, PetscInt *__pyx_v__M, PetscInt *__pyx_v__N, PetscInt *__pyx_v__P) { PetscInt __pyx_v_dim; PyObject *__pyx_v_M = 0; PyObject *__pyx_v_N = 0; PyObject *__pyx_v_P = 0; PetscInt __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *(*__pyx_t_5)(PyObject *); PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PetscInt __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("asDims", 0); __Pyx_INCREF(__pyx_v_dims); /* "petsc4py/PETSc/petscdmda.pxi":128 * PetscInt *_N, * PetscInt *_P) except? -1: * cdef PetscInt dim = PETSC_DECIDE # <<<<<<<<<<<<<< * cdef object M=None, N=None, P=None * dims = tuple(dims) */ __pyx_v_dim = PETSC_DECIDE; /* "petsc4py/PETSc/petscdmda.pxi":129 * PetscInt *_P) except? -1: * cdef PetscInt dim = PETSC_DECIDE * cdef object M=None, N=None, P=None # <<<<<<<<<<<<<< * dims = tuple(dims) * dim = len(dims) */ __Pyx_INCREF(Py_None); __pyx_v_M = Py_None; __Pyx_INCREF(Py_None); __pyx_v_N = Py_None; __Pyx_INCREF(Py_None); __pyx_v_P = Py_None; /* "petsc4py/PETSc/petscdmda.pxi":130 * cdef PetscInt dim = PETSC_DECIDE * cdef object M=None, N=None, P=None * dims = tuple(dims) # <<<<<<<<<<<<<< * dim = len(dims) * if dim == 0: pass */ __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_dims); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_dims, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscdmda.pxi":131 * cdef object M=None, N=None, P=None * dims = tuple(dims) * dim = len(dims) # <<<<<<<<<<<<<< * if dim == 0: pass * elif dim == 1: M, = dims */ __pyx_t_2 = PyObject_Length(__pyx_v_dims); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(10, 131, __pyx_L1_error) __pyx_v_dim = ((PetscInt)__pyx_t_2); /* "petsc4py/PETSc/petscdmda.pxi":132 * dims = tuple(dims) * dim = len(dims) * if dim == 0: pass # <<<<<<<<<<<<<< * elif dim == 1: M, = dims * elif dim == 2: M, N = dims */ __pyx_t_3 = (__pyx_v_dim == 0); if (__pyx_t_3) { goto __pyx_L3; } /* "petsc4py/PETSc/petscdmda.pxi":133 * dim = len(dims) * if dim == 0: pass * elif dim == 1: M, = dims # <<<<<<<<<<<<<< * elif dim == 2: M, N = dims * elif dim == 3: M, N, P = dims */ __pyx_t_3 = (__pyx_v_dim == 1); if (__pyx_t_3) { if ((likely(PyTuple_CheckExact(__pyx_v_dims))) || (PyList_CheckExact(__pyx_v_dims))) { PyObject* sequence = __pyx_v_dims; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 1)) { if (size > 1) __Pyx_RaiseTooManyValuesError(1); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(10, 133, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); } __Pyx_INCREF(__pyx_t_1); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { Py_ssize_t index = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_dims); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); index = 0; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 1) < 0) __PYX_ERR(10, 133, __pyx_L1_error) __pyx_t_5 = NULL; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L5_unpacking_done; __pyx_L4_unpacking_failed:; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(10, 133, __pyx_L1_error) __pyx_L5_unpacking_done:; } __Pyx_DECREF_SET(__pyx_v_M, __pyx_t_1); __pyx_t_1 = 0; goto __pyx_L3; } /* "petsc4py/PETSc/petscdmda.pxi":134 * if dim == 0: pass * elif dim == 1: M, = dims * elif dim == 2: M, N = dims # <<<<<<<<<<<<<< * elif dim == 3: M, N, P = dims * if dim >= 1: _M[0] = asInt(M) */ __pyx_t_3 = (__pyx_v_dim == 2); if (__pyx_t_3) { if ((likely(PyTuple_CheckExact(__pyx_v_dims))) || (PyList_CheckExact(__pyx_v_dims))) { PyObject* sequence = __pyx_v_dims; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(10, 134, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_dims); if (unlikely(!__pyx_t_6)) __PYX_ERR(10, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); index = 0; __pyx_t_1 = __pyx_t_5(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_4 = __pyx_t_5(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_6), 2) < 0) __PYX_ERR(10, 134, __pyx_L1_error) __pyx_t_5 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L7_unpacking_done; __pyx_L6_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_5 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(10, 134, __pyx_L1_error) __pyx_L7_unpacking_done:; } __Pyx_DECREF_SET(__pyx_v_M, __pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_N, __pyx_t_4); __pyx_t_4 = 0; goto __pyx_L3; } /* "petsc4py/PETSc/petscdmda.pxi":135 * elif dim == 1: M, = dims * elif dim == 2: M, N = dims * elif dim == 3: M, N, P = dims # <<<<<<<<<<<<<< * if dim >= 1: _M[0] = asInt(M) * if dim >= 2: _N[0] = asInt(N) */ __pyx_t_3 = (__pyx_v_dim == 3); if (__pyx_t_3) { if ((likely(PyTuple_CheckExact(__pyx_v_dims))) || (PyList_CheckExact(__pyx_v_dims))) { PyObject* sequence = __pyx_v_dims; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(10, 135, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_4 = PyList_GET_ITEM(sequence, 0); __pyx_t_1 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(10, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_dims); if (unlikely(!__pyx_t_7)) __PYX_ERR(10, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); index = 0; __pyx_t_4 = __pyx_t_5(__pyx_t_7); if (unlikely(!__pyx_t_4)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 1; __pyx_t_1 = __pyx_t_5(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 2; __pyx_t_6 = __pyx_t_5(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_7), 3) < 0) __PYX_ERR(10, 135, __pyx_L1_error) __pyx_t_5 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_5 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(10, 135, __pyx_L1_error) __pyx_L9_unpacking_done:; } __Pyx_DECREF_SET(__pyx_v_M, __pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_N, __pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_P, __pyx_t_6); __pyx_t_6 = 0; } __pyx_L3:; /* "petsc4py/PETSc/petscdmda.pxi":136 * elif dim == 2: M, N = dims * elif dim == 3: M, N, P = dims * if dim >= 1: _M[0] = asInt(M) # <<<<<<<<<<<<<< * if dim >= 2: _N[0] = asInt(N) * if dim >= 3: _P[0] = asInt(P) */ __pyx_t_3 = (__pyx_v_dim >= 1); if (__pyx_t_3) { __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_M); if (unlikely(__pyx_t_8 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(10, 136, __pyx_L1_error) (__pyx_v__M[0]) = __pyx_t_8; } /* "petsc4py/PETSc/petscdmda.pxi":137 * elif dim == 3: M, N, P = dims * if dim >= 1: _M[0] = asInt(M) * if dim >= 2: _N[0] = asInt(N) # <<<<<<<<<<<<<< * if dim >= 3: _P[0] = asInt(P) * return dim */ __pyx_t_3 = (__pyx_v_dim >= 2); if (__pyx_t_3) { __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_N); if (unlikely(__pyx_t_8 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(10, 137, __pyx_L1_error) (__pyx_v__N[0]) = __pyx_t_8; } /* "petsc4py/PETSc/petscdmda.pxi":138 * if dim >= 1: _M[0] = asInt(M) * if dim >= 2: _N[0] = asInt(N) * if dim >= 3: _P[0] = asInt(P) # <<<<<<<<<<<<<< * return dim * */ __pyx_t_3 = (__pyx_v_dim >= 3); if (__pyx_t_3) { __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_P); if (unlikely(__pyx_t_8 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(10, 138, __pyx_L1_error) (__pyx_v__P[0]) = __pyx_t_8; } /* "petsc4py/PETSc/petscdmda.pxi":139 * if dim >= 2: _N[0] = asInt(N) * if dim >= 3: _P[0] = asInt(P) * return dim # <<<<<<<<<<<<<< * * cdef inline tuple toDims(PetscInt dim, */ __pyx_r = __pyx_v_dim; goto __pyx_L0; /* "petsc4py/PETSc/petscdmda.pxi":124 * NULL) * * cdef inline PetscInt asDims(dims, # <<<<<<<<<<<<<< * PetscInt *_M, * PetscInt *_N, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.asDims", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1L; __pyx_L0:; __Pyx_XDECREF(__pyx_v_M); __Pyx_XDECREF(__pyx_v_N); __Pyx_XDECREF(__pyx_v_P); __Pyx_XDECREF(__pyx_v_dims); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscdmda.pxi":141 * return dim * * cdef inline tuple toDims(PetscInt dim, # <<<<<<<<<<<<<< * PetscInt M, * PetscInt N, */ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toDims(PetscInt __pyx_v_dim, PetscInt __pyx_v_M, PetscInt __pyx_v_N, PetscInt __pyx_v_P) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("toDims", 1); /* "petsc4py/PETSc/petscdmda.pxi":145 * PetscInt N, * PetscInt P): * if dim == 0: return () # <<<<<<<<<<<<<< * elif dim == 1: return (toInt(M),) * elif dim == 2: return (toInt(M), toInt(N)) */ __pyx_t_1 = (__pyx_v_dim == 0); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_empty_tuple); __pyx_r = __pyx_empty_tuple; goto __pyx_L0; } /* "petsc4py/PETSc/petscdmda.pxi":146 * PetscInt P): * if dim == 0: return () * elif dim == 1: return (toInt(M),) # <<<<<<<<<<<<<< * elif dim == 2: return (toInt(M), toInt(N)) * elif dim == 3: return (toInt(M), toInt(N), toInt(P)) */ __pyx_t_1 = (__pyx_v_dim == 1); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_M); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(10, 146, __pyx_L1_error); __pyx_t_2 = 0; __pyx_r = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; } /* "petsc4py/PETSc/petscdmda.pxi":147 * if dim == 0: return () * elif dim == 1: return (toInt(M),) * elif dim == 2: return (toInt(M), toInt(N)) # <<<<<<<<<<<<<< * elif dim == 3: return (toInt(M), toInt(N), toInt(P)) * */ __pyx_t_1 = (__pyx_v_dim == 2); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_M); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_N); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(10, 147, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2)) __PYX_ERR(10, 147, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_r = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L0; } /* "petsc4py/PETSc/petscdmda.pxi":148 * elif dim == 1: return (toInt(M),) * elif dim == 2: return (toInt(M), toInt(N)) * elif dim == 3: return (toInt(M), toInt(N), toInt(P)) # <<<<<<<<<<<<<< * * cdef inline tuple asOwnershipRanges(object ownership_ranges, */ __pyx_t_1 = (__pyx_v_dim == 3); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_M); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_N); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_P); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(10, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4)) __PYX_ERR(10, 148, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2)) __PYX_ERR(10, 148, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3)) __PYX_ERR(10, 148, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L0; } /* "petsc4py/PETSc/petscdmda.pxi":141 * return dim * * cdef inline tuple toDims(PetscInt dim, # <<<<<<<<<<<<<< * PetscInt M, * PetscInt N, */ /* function exit code */ __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.toDims", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscdmda.pxi":150 * elif dim == 3: return (toInt(M), toInt(N), toInt(P)) * * cdef inline tuple asOwnershipRanges(object ownership_ranges, # <<<<<<<<<<<<<< * PetscInt dim, * PetscInt *m, PetscInt *n, PetscInt *p, */ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_asOwnershipRanges(PyObject *__pyx_v_ownership_ranges, PetscInt __pyx_v_dim, PetscInt *__pyx_v_m, PetscInt *__pyx_v_n, PetscInt *__pyx_v_p, PetscInt **__pyx_v__x, PetscInt **__pyx_v__y, PetscInt **__pyx_v__z) { PyObject *__pyx_v_ranges = 0; PetscInt __pyx_v_rdim; PetscInt __pyx_v_nlx; PetscInt __pyx_v_nly; PetscInt __pyx_v_nlz; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("asOwnershipRanges", 1); /* "petsc4py/PETSc/petscdmda.pxi":156 * PetscInt **_y, * PetscInt **_z): * cdef object ranges = list(ownership_ranges) # <<<<<<<<<<<<<< * cdef PetscInt rdim = len(ranges) * cdef PetscInt nlx=0, nly=0, nlz=0 */ __pyx_t_1 = PySequence_List(__pyx_v_ownership_ranges); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ranges = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/petscdmda.pxi":157 * PetscInt **_z): * cdef object ranges = list(ownership_ranges) * cdef PetscInt rdim = len(ranges) # <<<<<<<<<<<<<< * cdef PetscInt nlx=0, nly=0, nlz=0 * if dim == PETSC_DECIDE: dim = rdim */ __pyx_t_2 = PyObject_Length(__pyx_v_ranges); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(10, 157, __pyx_L1_error) __pyx_v_rdim = ((PetscInt)__pyx_t_2); /* "petsc4py/PETSc/petscdmda.pxi":158 * cdef object ranges = list(ownership_ranges) * cdef PetscInt rdim = len(ranges) * cdef PetscInt nlx=0, nly=0, nlz=0 # <<<<<<<<<<<<<< * if dim == PETSC_DECIDE: dim = rdim * elif dim != rdim: raise ValueError( */ __pyx_v_nlx = 0; __pyx_v_nly = 0; __pyx_v_nlz = 0; /* "petsc4py/PETSc/petscdmda.pxi":159 * cdef PetscInt rdim = len(ranges) * cdef PetscInt nlx=0, nly=0, nlz=0 * if dim == PETSC_DECIDE: dim = rdim # <<<<<<<<<<<<<< * elif dim != rdim: raise ValueError( * "number of dimensions %d and number ownership ranges %d" % */ __pyx_t_3 = (__pyx_v_dim == PETSC_DECIDE); if (__pyx_t_3) { __pyx_v_dim = __pyx_v_rdim; goto __pyx_L3; } /* "petsc4py/PETSc/petscdmda.pxi":160 * cdef PetscInt nlx=0, nly=0, nlz=0 * if dim == PETSC_DECIDE: dim = rdim * elif dim != rdim: raise ValueError( # <<<<<<<<<<<<<< * "number of dimensions %d and number ownership ranges %d" % * (toInt(dim), toInt(rdim))) */ __pyx_t_3 = (__pyx_v_dim != __pyx_v_rdim); if (unlikely(__pyx_t_3)) { /* "petsc4py/PETSc/petscdmda.pxi":162 * elif dim != rdim: raise ValueError( * "number of dimensions %d and number ownership ranges %d" % * (toInt(dim), toInt(rdim))) # <<<<<<<<<<<<<< * if dim >= 1: * ranges[0] = iarray_i(ranges[0], &nlx, _x) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_dim); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_rdim); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(10, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1)) __PYX_ERR(10, 162, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4)) __PYX_ERR(10, 162, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_4 = 0; /* "petsc4py/PETSc/petscdmda.pxi":161 * if dim == PETSC_DECIDE: dim = rdim * elif dim != rdim: raise ValueError( * "number of dimensions %d and number ownership ranges %d" % # <<<<<<<<<<<<<< * (toInt(dim), toInt(rdim))) * if dim >= 1: */ __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_number_of_dimensions_d_and_numbe, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/petscdmda.pxi":160 * cdef PetscInt nlx=0, nly=0, nlz=0 * if dim == PETSC_DECIDE: dim = rdim * elif dim != rdim: raise ValueError( # <<<<<<<<<<<<<< * "number of dimensions %d and number ownership ranges %d" % * (toInt(dim), toInt(rdim))) */ __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(10, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(10, 160, __pyx_L1_error) } __pyx_L3:; /* "petsc4py/PETSc/petscdmda.pxi":163 * "number of dimensions %d and number ownership ranges %d" % * (toInt(dim), toInt(rdim))) * if dim >= 1: # <<<<<<<<<<<<<< * ranges[0] = iarray_i(ranges[0], &nlx, _x) * if m[0] == PETSC_DECIDE: m[0] = nlx */ __pyx_t_3 = (__pyx_v_dim >= 1); if (__pyx_t_3) { /* "petsc4py/PETSc/petscdmda.pxi":164 * (toInt(dim), toInt(rdim))) * if dim >= 1: * ranges[0] = iarray_i(ranges[0], &nlx, _x) # <<<<<<<<<<<<<< * if m[0] == PETSC_DECIDE: m[0] = nlx * elif m[0] != nlx: raise ValueError( */ __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_ranges, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(10, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_t_5, (&__pyx_v_nlx), __pyx_v__x)); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely((__Pyx_SetItemInt(__pyx_v_ranges, 0, __pyx_t_4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0))) __PYX_ERR(10, 164, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/petscdmda.pxi":165 * if dim >= 1: * ranges[0] = iarray_i(ranges[0], &nlx, _x) * if m[0] == PETSC_DECIDE: m[0] = nlx # <<<<<<<<<<<<<< * elif m[0] != nlx: raise ValueError( * "ownership range size %d and number or processors %d" % */ __pyx_t_3 = ((__pyx_v_m[0]) == PETSC_DECIDE); if (__pyx_t_3) { (__pyx_v_m[0]) = __pyx_v_nlx; goto __pyx_L5; } /* "petsc4py/PETSc/petscdmda.pxi":166 * ranges[0] = iarray_i(ranges[0], &nlx, _x) * if m[0] == PETSC_DECIDE: m[0] = nlx * elif m[0] != nlx: raise ValueError( # <<<<<<<<<<<<<< * "ownership range size %d and number or processors %d" % * (toInt(nlx), toInt(m[0]))) */ __pyx_t_3 = ((__pyx_v_m[0]) != __pyx_v_nlx); if (unlikely(__pyx_t_3)) { /* "petsc4py/PETSc/petscdmda.pxi":168 * elif m[0] != nlx: raise ValueError( * "ownership range size %d and number or processors %d" % * (toInt(nlx), toInt(m[0]))) # <<<<<<<<<<<<<< * if dim >= 2: * ranges[1] = iarray_i(ranges[1], &nly, _y) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nlx); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_m[0])); if (unlikely(!__pyx_t_5)) __PYX_ERR(10, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4)) __PYX_ERR(10, 168, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5)) __PYX_ERR(10, 168, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_5 = 0; /* "petsc4py/PETSc/petscdmda.pxi":167 * if m[0] == PETSC_DECIDE: m[0] = nlx * elif m[0] != nlx: raise ValueError( * "ownership range size %d and number or processors %d" % # <<<<<<<<<<<<<< * (toInt(nlx), toInt(m[0]))) * if dim >= 2: */ __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_ownership_range_size_d_and_numbe, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(10, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscdmda.pxi":166 * ranges[0] = iarray_i(ranges[0], &nlx, _x) * if m[0] == PETSC_DECIDE: m[0] = nlx * elif m[0] != nlx: raise ValueError( # <<<<<<<<<<<<<< * "ownership range size %d and number or processors %d" % * (toInt(nlx), toInt(m[0]))) */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 166, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(10, 166, __pyx_L1_error) } __pyx_L5:; /* "petsc4py/PETSc/petscdmda.pxi":163 * "number of dimensions %d and number ownership ranges %d" % * (toInt(dim), toInt(rdim))) * if dim >= 1: # <<<<<<<<<<<<<< * ranges[0] = iarray_i(ranges[0], &nlx, _x) * if m[0] == PETSC_DECIDE: m[0] = nlx */ } /* "petsc4py/PETSc/petscdmda.pxi":169 * "ownership range size %d and number or processors %d" % * (toInt(nlx), toInt(m[0]))) * if dim >= 2: # <<<<<<<<<<<<<< * ranges[1] = iarray_i(ranges[1], &nly, _y) * if n[0] == PETSC_DECIDE: n[0] = nly */ __pyx_t_3 = (__pyx_v_dim >= 2); if (__pyx_t_3) { /* "petsc4py/PETSc/petscdmda.pxi":170 * (toInt(nlx), toInt(m[0]))) * if dim >= 2: * ranges[1] = iarray_i(ranges[1], &nly, _y) # <<<<<<<<<<<<<< * if n[0] == PETSC_DECIDE: n[0] = nly * elif n[0] != nly: raise ValueError( */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_ranges, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_t_1, (&__pyx_v_nly), __pyx_v__y)); if (unlikely(!__pyx_t_5)) __PYX_ERR(10, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely((__Pyx_SetItemInt(__pyx_v_ranges, 1, __pyx_t_5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0))) __PYX_ERR(10, 170, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/petscdmda.pxi":171 * if dim >= 2: * ranges[1] = iarray_i(ranges[1], &nly, _y) * if n[0] == PETSC_DECIDE: n[0] = nly # <<<<<<<<<<<<<< * elif n[0] != nly: raise ValueError( * "ownership range size %d and number or processors %d" % */ __pyx_t_3 = ((__pyx_v_n[0]) == PETSC_DECIDE); if (__pyx_t_3) { (__pyx_v_n[0]) = __pyx_v_nly; goto __pyx_L7; } /* "petsc4py/PETSc/petscdmda.pxi":172 * ranges[1] = iarray_i(ranges[1], &nly, _y) * if n[0] == PETSC_DECIDE: n[0] = nly * elif n[0] != nly: raise ValueError( # <<<<<<<<<<<<<< * "ownership range size %d and number or processors %d" % * (toInt(nly), toInt(n[0]))) */ __pyx_t_3 = ((__pyx_v_n[0]) != __pyx_v_nly); if (unlikely(__pyx_t_3)) { /* "petsc4py/PETSc/petscdmda.pxi":174 * elif n[0] != nly: raise ValueError( * "ownership range size %d and number or processors %d" % * (toInt(nly), toInt(n[0]))) # <<<<<<<<<<<<<< * if dim >= 3: * ranges[2] = iarray_i(ranges[2], &nlz, _z) */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nly); if (unlikely(!__pyx_t_5)) __PYX_ERR(10, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_n[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5)) __PYX_ERR(10, 174, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(10, 174, __pyx_L1_error); __pyx_t_5 = 0; __pyx_t_1 = 0; /* "petsc4py/PETSc/petscdmda.pxi":173 * if n[0] == PETSC_DECIDE: n[0] = nly * elif n[0] != nly: raise ValueError( * "ownership range size %d and number or processors %d" % # <<<<<<<<<<<<<< * (toInt(nly), toInt(n[0]))) * if dim >= 3: */ __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_ownership_range_size_d_and_numbe, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/petscdmda.pxi":172 * ranges[1] = iarray_i(ranges[1], &nly, _y) * if n[0] == PETSC_DECIDE: n[0] = nly * elif n[0] != nly: raise ValueError( # <<<<<<<<<<<<<< * "ownership range size %d and number or processors %d" % * (toInt(nly), toInt(n[0]))) */ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(10, 172, __pyx_L1_error) } __pyx_L7:; /* "petsc4py/PETSc/petscdmda.pxi":169 * "ownership range size %d and number or processors %d" % * (toInt(nlx), toInt(m[0]))) * if dim >= 2: # <<<<<<<<<<<<<< * ranges[1] = iarray_i(ranges[1], &nly, _y) * if n[0] == PETSC_DECIDE: n[0] = nly */ } /* "petsc4py/PETSc/petscdmda.pxi":175 * "ownership range size %d and number or processors %d" % * (toInt(nly), toInt(n[0]))) * if dim >= 3: # <<<<<<<<<<<<<< * ranges[2] = iarray_i(ranges[2], &nlz, _z) * if p[0] == PETSC_DECIDE: p[0] = nlz */ __pyx_t_3 = (__pyx_v_dim >= 3); if (__pyx_t_3) { /* "petsc4py/PETSc/petscdmda.pxi":176 * (toInt(nly), toInt(n[0]))) * if dim >= 3: * ranges[2] = iarray_i(ranges[2], &nlz, _z) # <<<<<<<<<<<<<< * if p[0] == PETSC_DECIDE: p[0] = nlz * elif p[0] != nlz: raise ValueError( */ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_ranges, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_t_4, (&__pyx_v_nlz), __pyx_v__z)); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely((__Pyx_SetItemInt(__pyx_v_ranges, 2, __pyx_t_1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0))) __PYX_ERR(10, 176, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscdmda.pxi":177 * if dim >= 3: * ranges[2] = iarray_i(ranges[2], &nlz, _z) * if p[0] == PETSC_DECIDE: p[0] = nlz # <<<<<<<<<<<<<< * elif p[0] != nlz: raise ValueError( * "ownership range size %d and number or processors %d" % */ __pyx_t_3 = ((__pyx_v_p[0]) == PETSC_DECIDE); if (__pyx_t_3) { (__pyx_v_p[0]) = __pyx_v_nlz; goto __pyx_L9; } /* "petsc4py/PETSc/petscdmda.pxi":178 * ranges[2] = iarray_i(ranges[2], &nlz, _z) * if p[0] == PETSC_DECIDE: p[0] = nlz * elif p[0] != nlz: raise ValueError( # <<<<<<<<<<<<<< * "ownership range size %d and number or processors %d" % * (toInt(nlz), toInt(p[0]))) */ __pyx_t_3 = ((__pyx_v_p[0]) != __pyx_v_nlz); if (unlikely(__pyx_t_3)) { /* "petsc4py/PETSc/petscdmda.pxi":180 * elif p[0] != nlz: raise ValueError( * "ownership range size %d and number or processors %d" % * (toInt(nlz), toInt(p[0]))) # <<<<<<<<<<<<<< * return tuple(ranges) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nlz); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_p[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(10, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1)) __PYX_ERR(10, 180, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4)) __PYX_ERR(10, 180, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_4 = 0; /* "petsc4py/PETSc/petscdmda.pxi":179 * if p[0] == PETSC_DECIDE: p[0] = nlz * elif p[0] != nlz: raise ValueError( * "ownership range size %d and number or processors %d" % # <<<<<<<<<<<<<< * (toInt(nlz), toInt(p[0]))) * return tuple(ranges) */ __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_ownership_range_size_d_and_numbe, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/petscdmda.pxi":178 * ranges[2] = iarray_i(ranges[2], &nlz, _z) * if p[0] == PETSC_DECIDE: p[0] = nlz * elif p[0] != nlz: raise ValueError( # <<<<<<<<<<<<<< * "ownership range size %d and number or processors %d" % * (toInt(nlz), toInt(p[0]))) */ __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(10, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(10, 178, __pyx_L1_error) } __pyx_L9:; /* "petsc4py/PETSc/petscdmda.pxi":175 * "ownership range size %d and number or processors %d" % * (toInt(nly), toInt(n[0]))) * if dim >= 3: # <<<<<<<<<<<<<< * ranges[2] = iarray_i(ranges[2], &nlz, _z) * if p[0] == PETSC_DECIDE: p[0] = nlz */ } /* "petsc4py/PETSc/petscdmda.pxi":181 * "ownership range size %d and number or processors %d" % * (toInt(nlz), toInt(p[0]))) * return tuple(ranges) # <<<<<<<<<<<<<< * * cdef inline tuple toOwnershipRanges(PetscInt dim, */ __Pyx_XDECREF(__pyx_r); __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_ranges); if (unlikely(!__pyx_t_5)) __PYX_ERR(10, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_r = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L0; /* "petsc4py/PETSc/petscdmda.pxi":150 * elif dim == 3: return (toInt(M), toInt(N), toInt(P)) * * cdef inline tuple asOwnershipRanges(object ownership_ranges, # <<<<<<<<<<<<<< * PetscInt dim, * PetscInt *m, PetscInt *n, PetscInt *p, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.asOwnershipRanges", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ranges); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscdmda.pxi":183 * return tuple(ranges) * * cdef inline tuple toOwnershipRanges(PetscInt dim, # <<<<<<<<<<<<<< * PetscInt m, PetscInt n, PetscInt p, * const PetscInt *lx, */ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toOwnershipRanges(PetscInt __pyx_v_dim, PetscInt __pyx_v_m, PetscInt __pyx_v_n, PetscInt __pyx_v_p, PetscInt const *__pyx_v_lx, PetscInt const *__pyx_v_ly, PetscInt const *__pyx_v_lz) { PyObject *__pyx_v_ranges = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("toOwnershipRanges", 1); /* "petsc4py/PETSc/petscdmda.pxi":189 * const PetscInt *lz): * # Returns tuple of arrays containing ownership ranges as Python arrays * ranges = [array_i(m, lx)] # <<<<<<<<<<<<<< * if dim > 1: * ranges.append(array_i(n, ly)) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i(__pyx_v_m, __pyx_v_lx)); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(10, 189, __pyx_L1_error); __pyx_t_1 = 0; __pyx_v_ranges = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscdmda.pxi":190 * # Returns tuple of arrays containing ownership ranges as Python arrays * ranges = [array_i(m, lx)] * if dim > 1: # <<<<<<<<<<<<<< * ranges.append(array_i(n, ly)) * if dim > 2: */ __pyx_t_3 = (__pyx_v_dim > 1); if (__pyx_t_3) { /* "petsc4py/PETSc/petscdmda.pxi":191 * ranges = [array_i(m, lx)] * if dim > 1: * ranges.append(array_i(n, ly)) # <<<<<<<<<<<<<< * if dim > 2: * ranges.append(array_i(p, lz)) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i(__pyx_v_n, __pyx_v_ly)); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_ranges, __pyx_t_2); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(10, 191, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscdmda.pxi":190 * # Returns tuple of arrays containing ownership ranges as Python arrays * ranges = [array_i(m, lx)] * if dim > 1: # <<<<<<<<<<<<<< * ranges.append(array_i(n, ly)) * if dim > 2: */ } /* "petsc4py/PETSc/petscdmda.pxi":192 * if dim > 1: * ranges.append(array_i(n, ly)) * if dim > 2: # <<<<<<<<<<<<<< * ranges.append(array_i(p, lz)) * return tuple(ranges) */ __pyx_t_3 = (__pyx_v_dim > 2); if (__pyx_t_3) { /* "petsc4py/PETSc/petscdmda.pxi":193 * ranges.append(array_i(n, ly)) * if dim > 2: * ranges.append(array_i(p, lz)) # <<<<<<<<<<<<<< * return tuple(ranges) * */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i(__pyx_v_p, __pyx_v_lz)); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_ranges, __pyx_t_2); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(10, 193, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscdmda.pxi":192 * if dim > 1: * ranges.append(array_i(n, ly)) * if dim > 2: # <<<<<<<<<<<<<< * ranges.append(array_i(p, lz)) * return tuple(ranges) */ } /* "petsc4py/PETSc/petscdmda.pxi":194 * if dim > 2: * ranges.append(array_i(p, lz)) * return tuple(ranges) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyList_AsTuple(__pyx_v_ranges); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/petscdmda.pxi":183 * return tuple(ranges) * * cdef inline tuple toOwnershipRanges(PetscInt dim, # <<<<<<<<<<<<<< * PetscInt m, PetscInt n, PetscInt p, * const PetscInt *lx, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.toOwnershipRanges", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ranges); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscdmda.pxi":205 * cdef readonly ndarray array * * def __cinit__(self, DMDA da, Vec vec, bint DOF=False): # <<<<<<<<<<<<<< * # * cdef PetscInt dim=0, dof=0 */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_15_DMDA_Vec_array_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_15_DMDA_Vec_array_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_da = 0; struct PyPetscVecObject *__pyx_v_vec = 0; int __pyx_v_DOF; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_da,&__pyx_n_s_vec,&__pyx_n_s_DOF,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_da)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(10, 205, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vec)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(10, 205, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(10, 205, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_DOF); if (value) { values[2] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(10, 205, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__cinit__") < 0)) __PYX_ERR(10, 205, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_da = ((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)values[0]); __pyx_v_vec = ((struct PyPetscVecObject *)values[1]); if (values[2]) { __pyx_v_DOF = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_DOF == (int)-1) && PyErr_Occurred())) __PYX_ERR(10, 205, __pyx_L3_error) } else { __pyx_v_DOF = ((int)0); } } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, __pyx_nargs); __PYX_ERR(10, 205, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc._DMDA_Vec_array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_da), __pyx_ptype_8petsc4py_5PETSc_DMDA, 0, "da", 0))) __PYX_ERR(10, 205, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(10, 205, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array___cinit__(((struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *)__pyx_v_self), __pyx_v_da, __pyx_v_vec, __pyx_v_DOF); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = -1; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array___cinit__(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *__pyx_v_self, struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_da, struct PyPetscVecObject *__pyx_v_vec, int __pyx_v_DOF) { PetscInt __pyx_v_dim; PetscInt __pyx_v_dof; PetscInt __pyx_v_lxs; PetscInt __pyx_v_lys; PetscInt __pyx_v_lzs; PetscInt __pyx_v_lxm; PetscInt __pyx_v_lym; PetscInt __pyx_v_lzm; PetscInt __pyx_v_gxs; PetscInt __pyx_v_gys; PetscInt __pyx_v_gzs; PetscInt __pyx_v_gxm; PetscInt __pyx_v_gym; PetscInt __pyx_v_gzm; PetscInt __pyx_v_n; PetscInt __pyx_v_xs; PetscInt __pyx_v_ys; PetscInt __pyx_v_zs; PetscInt __pyx_v_xm; PetscInt __pyx_v_ym; PetscInt __pyx_v_zm; PyObject *__pyx_v_starts = 0; PyObject *__pyx_v_sizes = 0; Py_ssize_t __pyx_v_k; Py_ssize_t __pyx_v_f; Py_ssize_t __pyx_v_d; PyObject *__pyx_v_shape = 0; PyObject *__pyx_v_strides = 0; int __pyx_r; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_t_2; PetscInt __pyx_t_3; PetscInt __pyx_t_4; PetscInt __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 1); /* "petsc4py/PETSc/petscdmda.pxi":207 * def __cinit__(self, DMDA da, Vec vec, bint DOF=False): * # * cdef PetscInt dim=0, dof=0 # <<<<<<<<<<<<<< * CHKERR( DMDAGetInfo(da.dm, * &dim, NULL, NULL, NULL, NULL, NULL, NULL, */ __pyx_v_dim = 0; __pyx_v_dof = 0; /* "petsc4py/PETSc/petscdmda.pxi":208 * # * cdef PetscInt dim=0, dof=0 * CHKERR( DMDAGetInfo(da.dm, # <<<<<<<<<<<<<< * &dim, NULL, NULL, NULL, NULL, NULL, NULL, * &dof, NULL, NULL, NULL, NULL, NULL) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDAGetInfo(__pyx_v_da->__pyx_base.dm, (&__pyx_v_dim), NULL, NULL, NULL, NULL, NULL, NULL, (&__pyx_v_dof), NULL, NULL, NULL, NULL, NULL)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(10, 208, __pyx_L1_error) /* "petsc4py/PETSc/petscdmda.pxi":211 * &dim, NULL, NULL, NULL, NULL, NULL, NULL, * &dof, NULL, NULL, NULL, NULL, NULL) ) * cdef PetscInt lxs=0, lys=0, lzs=0 # <<<<<<<<<<<<<< * cdef PetscInt lxm=0, lym=0, lzm=0 * CHKERR( DMDAGetCorners(da.dm, */ __pyx_v_lxs = 0; __pyx_v_lys = 0; __pyx_v_lzs = 0; /* "petsc4py/PETSc/petscdmda.pxi":212 * &dof, NULL, NULL, NULL, NULL, NULL) ) * cdef PetscInt lxs=0, lys=0, lzs=0 * cdef PetscInt lxm=0, lym=0, lzm=0 # <<<<<<<<<<<<<< * CHKERR( DMDAGetCorners(da.dm, * &lxs, &lys, &lzs, */ __pyx_v_lxm = 0; __pyx_v_lym = 0; __pyx_v_lzm = 0; /* "petsc4py/PETSc/petscdmda.pxi":213 * cdef PetscInt lxs=0, lys=0, lzs=0 * cdef PetscInt lxm=0, lym=0, lzm=0 * CHKERR( DMDAGetCorners(da.dm, # <<<<<<<<<<<<<< * &lxs, &lys, &lzs, * &lxm, &lym, &lzm) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDAGetCorners(__pyx_v_da->__pyx_base.dm, (&__pyx_v_lxs), (&__pyx_v_lys), (&__pyx_v_lzs), (&__pyx_v_lxm), (&__pyx_v_lym), (&__pyx_v_lzm))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(10, 213, __pyx_L1_error) /* "petsc4py/PETSc/petscdmda.pxi":216 * &lxs, &lys, &lzs, * &lxm, &lym, &lzm) ) * cdef PetscInt gxs=0, gys=0, gzs=0 # <<<<<<<<<<<<<< * cdef PetscInt gxm=0, gym=0, gzm=0 * CHKERR( DMDAGetGhostCorners(da.dm, */ __pyx_v_gxs = 0; __pyx_v_gys = 0; __pyx_v_gzs = 0; /* "petsc4py/PETSc/petscdmda.pxi":217 * &lxm, &lym, &lzm) ) * cdef PetscInt gxs=0, gys=0, gzs=0 * cdef PetscInt gxm=0, gym=0, gzm=0 # <<<<<<<<<<<<<< * CHKERR( DMDAGetGhostCorners(da.dm, * &gxs, &gys, &gzs, */ __pyx_v_gxm = 0; __pyx_v_gym = 0; __pyx_v_gzm = 0; /* "petsc4py/PETSc/petscdmda.pxi":218 * cdef PetscInt gxs=0, gys=0, gzs=0 * cdef PetscInt gxm=0, gym=0, gzm=0 * CHKERR( DMDAGetGhostCorners(da.dm, # <<<<<<<<<<<<<< * &gxs, &gys, &gzs, * &gxm, &gym, &gzm) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDAGetGhostCorners(__pyx_v_da->__pyx_base.dm, (&__pyx_v_gxs), (&__pyx_v_gys), (&__pyx_v_gzs), (&__pyx_v_gxm), (&__pyx_v_gym), (&__pyx_v_gzm))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(10, 218, __pyx_L1_error) /* "petsc4py/PETSc/petscdmda.pxi":222 * &gxm, &gym, &gzm) ) * # * cdef PetscInt n=0 # <<<<<<<<<<<<<< * CHKERR( VecGetLocalSize(vec.vec, &n) ) * cdef PetscInt xs, ys, zs, xm, ym, zm */ __pyx_v_n = 0; /* "petsc4py/PETSc/petscdmda.pxi":223 * # * cdef PetscInt n=0 * CHKERR( VecGetLocalSize(vec.vec, &n) ) # <<<<<<<<<<<<<< * cdef PetscInt xs, ys, zs, xm, ym, zm * if (n == lxm*lym*lzm*dof): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetLocalSize(__pyx_v_vec->vec, (&__pyx_v_n))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(10, 223, __pyx_L1_error) /* "petsc4py/PETSc/petscdmda.pxi":225 * CHKERR( VecGetLocalSize(vec.vec, &n) ) * cdef PetscInt xs, ys, zs, xm, ym, zm * if (n == lxm*lym*lzm*dof): # <<<<<<<<<<<<<< * xs, ys, zs = lxs, lys, lzs * xm, ym, zm = lxm, lym, lzm */ __pyx_t_2 = (__pyx_v_n == (((__pyx_v_lxm * __pyx_v_lym) * __pyx_v_lzm) * __pyx_v_dof)); if (__pyx_t_2) { /* "petsc4py/PETSc/petscdmda.pxi":226 * cdef PetscInt xs, ys, zs, xm, ym, zm * if (n == lxm*lym*lzm*dof): * xs, ys, zs = lxs, lys, lzs # <<<<<<<<<<<<<< * xm, ym, zm = lxm, lym, lzm * elif (n == gxm*gym*gzm*dof): */ __pyx_t_3 = __pyx_v_lxs; __pyx_t_4 = __pyx_v_lys; __pyx_t_5 = __pyx_v_lzs; __pyx_v_xs = __pyx_t_3; __pyx_v_ys = __pyx_t_4; __pyx_v_zs = __pyx_t_5; /* "petsc4py/PETSc/petscdmda.pxi":227 * if (n == lxm*lym*lzm*dof): * xs, ys, zs = lxs, lys, lzs * xm, ym, zm = lxm, lym, lzm # <<<<<<<<<<<<<< * elif (n == gxm*gym*gzm*dof): * xs, ys, zs = gxs, gys, gzs */ __pyx_t_5 = __pyx_v_lxm; __pyx_t_4 = __pyx_v_lym; __pyx_t_3 = __pyx_v_lzm; __pyx_v_xm = __pyx_t_5; __pyx_v_ym = __pyx_t_4; __pyx_v_zm = __pyx_t_3; /* "petsc4py/PETSc/petscdmda.pxi":225 * CHKERR( VecGetLocalSize(vec.vec, &n) ) * cdef PetscInt xs, ys, zs, xm, ym, zm * if (n == lxm*lym*lzm*dof): # <<<<<<<<<<<<<< * xs, ys, zs = lxs, lys, lzs * xm, ym, zm = lxm, lym, lzm */ goto __pyx_L3; } /* "petsc4py/PETSc/petscdmda.pxi":228 * xs, ys, zs = lxs, lys, lzs * xm, ym, zm = lxm, lym, lzm * elif (n == gxm*gym*gzm*dof): # <<<<<<<<<<<<<< * xs, ys, zs = gxs, gys, gzs * xm, ym, zm = gxm, gym, gzm */ __pyx_t_2 = (__pyx_v_n == (((__pyx_v_gxm * __pyx_v_gym) * __pyx_v_gzm) * __pyx_v_dof)); if (likely(__pyx_t_2)) { /* "petsc4py/PETSc/petscdmda.pxi":229 * xm, ym, zm = lxm, lym, lzm * elif (n == gxm*gym*gzm*dof): * xs, ys, zs = gxs, gys, gzs # <<<<<<<<<<<<<< * xm, ym, zm = gxm, gym, gzm * else: */ __pyx_t_3 = __pyx_v_gxs; __pyx_t_4 = __pyx_v_gys; __pyx_t_5 = __pyx_v_gzs; __pyx_v_xs = __pyx_t_3; __pyx_v_ys = __pyx_t_4; __pyx_v_zs = __pyx_t_5; /* "petsc4py/PETSc/petscdmda.pxi":230 * elif (n == gxm*gym*gzm*dof): * xs, ys, zs = gxs, gys, gzs * xm, ym, zm = gxm, gym, gzm # <<<<<<<<<<<<<< * else: * raise ValueError( */ __pyx_t_5 = __pyx_v_gxm; __pyx_t_4 = __pyx_v_gym; __pyx_t_3 = __pyx_v_gzm; __pyx_v_xm = __pyx_t_5; __pyx_v_ym = __pyx_t_4; __pyx_v_zm = __pyx_t_3; /* "petsc4py/PETSc/petscdmda.pxi":228 * xs, ys, zs = lxs, lys, lzs * xm, ym, zm = lxm, lym, lzm * elif (n == gxm*gym*gzm*dof): # <<<<<<<<<<<<<< * xs, ys, zs = gxs, gys, gzs * xm, ym, zm = gxm, gym, gzm */ goto __pyx_L3; } /* "petsc4py/PETSc/petscdmda.pxi":232 * xm, ym, zm = gxm, gym, gzm * else: * raise ValueError( # <<<<<<<<<<<<<< * "Vector local size %d is not compatible " * "with DMDA local sizes %s" */ /*else*/ { /* "petsc4py/PETSc/petscdmda.pxi":235 * "Vector local size %d is not compatible " * "with DMDA local sizes %s" * % (n, toDims(dim, lxm, lym, lzm))) # <<<<<<<<<<<<<< * # * cdef tuple starts = toDims(dim, xs, ys, zs) */ __pyx_t_6 = PyInt_FromSsize_t(((Py_ssize_t)__pyx_v_n)); if (unlikely(!__pyx_t_6)) __PYX_ERR(10, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_toDims(__pyx_v_dim, __pyx_v_lxm, __pyx_v_lym, __pyx_v_lzm); if (unlikely(!__pyx_t_7)) __PYX_ERR(10, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(10, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_6); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6)) __PYX_ERR(10, 235, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7)) __PYX_ERR(10, 235, __pyx_L1_error); __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_Vector_local_size_d_is_not_compa, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(10, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "petsc4py/PETSc/petscdmda.pxi":232 * xm, ym, zm = gxm, gym, gzm * else: * raise ValueError( # <<<<<<<<<<<<<< * "Vector local size %d is not compatible " * "with DMDA local sizes %s" */ __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(10, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __PYX_ERR(10, 232, __pyx_L1_error) } __pyx_L3:; /* "petsc4py/PETSc/petscdmda.pxi":237 * % (n, toDims(dim, lxm, lym, lzm))) * # * cdef tuple starts = toDims(dim, xs, ys, zs) # <<<<<<<<<<<<<< * cdef tuple sizes = toDims(dim, xm, ym, zm) * cdef Py_ssize_t k = sizeof(PetscScalar) */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_toDims(__pyx_v_dim, __pyx_v_xs, __pyx_v_ys, __pyx_v_zs); if (unlikely(!__pyx_t_8)) __PYX_ERR(10, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_v_starts = ((PyObject*)__pyx_t_8); __pyx_t_8 = 0; /* "petsc4py/PETSc/petscdmda.pxi":238 * # * cdef tuple starts = toDims(dim, xs, ys, zs) * cdef tuple sizes = toDims(dim, xm, ym, zm) # <<<<<<<<<<<<<< * cdef Py_ssize_t k = sizeof(PetscScalar) * cdef Py_ssize_t f = dof */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_toDims(__pyx_v_dim, __pyx_v_xm, __pyx_v_ym, __pyx_v_zm); if (unlikely(!__pyx_t_8)) __PYX_ERR(10, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_v_sizes = ((PyObject*)__pyx_t_8); __pyx_t_8 = 0; /* "petsc4py/PETSc/petscdmda.pxi":239 * cdef tuple starts = toDims(dim, xs, ys, zs) * cdef tuple sizes = toDims(dim, xm, ym, zm) * cdef Py_ssize_t k = sizeof(PetscScalar) # <<<<<<<<<<<<<< * cdef Py_ssize_t f = dof * cdef Py_ssize_t d = dim */ __pyx_v_k = ((Py_ssize_t)(sizeof(PetscScalar))); /* "petsc4py/PETSc/petscdmda.pxi":240 * cdef tuple sizes = toDims(dim, xm, ym, zm) * cdef Py_ssize_t k = sizeof(PetscScalar) * cdef Py_ssize_t f = dof # <<<<<<<<<<<<<< * cdef Py_ssize_t d = dim * cdef tuple shape = toDims(dim, xm, ym, zm) */ __pyx_v_f = ((Py_ssize_t)__pyx_v_dof); /* "petsc4py/PETSc/petscdmda.pxi":241 * cdef Py_ssize_t k = sizeof(PetscScalar) * cdef Py_ssize_t f = dof * cdef Py_ssize_t d = dim # <<<<<<<<<<<<<< * cdef tuple shape = toDims(dim, xm, ym, zm) * cdef tuple strides = (k*f, k*f*xm, k*f*xm*ym)[:d] */ __pyx_v_d = ((Py_ssize_t)__pyx_v_dim); /* "petsc4py/PETSc/petscdmda.pxi":242 * cdef Py_ssize_t f = dof * cdef Py_ssize_t d = dim * cdef tuple shape = toDims(dim, xm, ym, zm) # <<<<<<<<<<<<<< * cdef tuple strides = (k*f, k*f*xm, k*f*xm*ym)[:d] * if DOF or f > 1: shape += (f,) */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_toDims(__pyx_v_dim, __pyx_v_xm, __pyx_v_ym, __pyx_v_zm); if (unlikely(!__pyx_t_8)) __PYX_ERR(10, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_v_shape = ((PyObject*)__pyx_t_8); __pyx_t_8 = 0; /* "petsc4py/PETSc/petscdmda.pxi":243 * cdef Py_ssize_t d = dim * cdef tuple shape = toDims(dim, xm, ym, zm) * cdef tuple strides = (k*f, k*f*xm, k*f*xm*ym)[:d] # <<<<<<<<<<<<<< * if DOF or f > 1: shape += (f,) * if DOF or f > 1: strides += (k,) */ __pyx_t_8 = PyInt_FromSsize_t((__pyx_v_k * __pyx_v_f)); if (unlikely(!__pyx_t_8)) __PYX_ERR(10, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = PyInt_FromSsize_t(((__pyx_v_k * __pyx_v_f) * __pyx_v_xm)); if (unlikely(!__pyx_t_7)) __PYX_ERR(10, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = PyInt_FromSsize_t((((__pyx_v_k * __pyx_v_f) * __pyx_v_xm) * __pyx_v_ym)); if (unlikely(!__pyx_t_6)) __PYX_ERR(10, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(10, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_8); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8)) __PYX_ERR(10, 243, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_7)) __PYX_ERR(10, 243, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_6)) __PYX_ERR(10, 243, __pyx_L1_error); __pyx_t_8 = 0; __pyx_t_7 = 0; __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_t_9, 0, __pyx_v_d, NULL, NULL, NULL, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(10, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (!(likely(PyTuple_CheckExact(__pyx_t_6)) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_6))) __PYX_ERR(10, 243, __pyx_L1_error) __pyx_v_strides = ((PyObject*)__pyx_t_6); __pyx_t_6 = 0; /* "petsc4py/PETSc/petscdmda.pxi":244 * cdef tuple shape = toDims(dim, xm, ym, zm) * cdef tuple strides = (k*f, k*f*xm, k*f*xm*ym)[:d] * if DOF or f > 1: shape += (f,) # <<<<<<<<<<<<<< * if DOF or f > 1: strides += (k,) * # */ if (!__pyx_v_DOF) { } else { __pyx_t_2 = __pyx_v_DOF; goto __pyx_L5_bool_binop_done; } __pyx_t_10 = (__pyx_v_f > 1); __pyx_t_2 = __pyx_t_10; __pyx_L5_bool_binop_done:; if (__pyx_t_2) { __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_f); if (unlikely(!__pyx_t_6)) __PYX_ERR(10, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(10, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_6); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6)) __PYX_ERR(10, 244, __pyx_L1_error); __pyx_t_6 = 0; __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_shape, __pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(10, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF_SET(__pyx_v_shape, ((PyObject*)__pyx_t_6)); __pyx_t_6 = 0; } /* "petsc4py/PETSc/petscdmda.pxi":245 * cdef tuple strides = (k*f, k*f*xm, k*f*xm*ym)[:d] * if DOF or f > 1: shape += (f,) * if DOF or f > 1: strides += (k,) # <<<<<<<<<<<<<< * # * self.vecbuf = _Vec_buffer(vec) */ if (!__pyx_v_DOF) { } else { __pyx_t_2 = __pyx_v_DOF; goto __pyx_L8_bool_binop_done; } __pyx_t_10 = (__pyx_v_f > 1); __pyx_t_2 = __pyx_t_10; __pyx_L8_bool_binop_done:; if (__pyx_t_2) { __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_k); if (unlikely(!__pyx_t_6)) __PYX_ERR(10, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(10, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_6); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6)) __PYX_ERR(10, 245, __pyx_L1_error); __pyx_t_6 = 0; __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_strides, __pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(10, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF_SET(__pyx_v_strides, ((PyObject*)__pyx_t_6)); __pyx_t_6 = 0; } /* "petsc4py/PETSc/petscdmda.pxi":247 * if DOF or f > 1: strides += (k,) * # * self.vecbuf = _Vec_buffer(vec) # <<<<<<<<<<<<<< * self.starts = starts * self.sizes = sizes */ __pyx_t_6 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc__Vec_buffer), ((PyObject *)__pyx_v_vec)); if (unlikely(!__pyx_t_6)) __PYX_ERR(10, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __Pyx_GOTREF((PyObject *)__pyx_v_self->vecbuf); __Pyx_DECREF((PyObject *)__pyx_v_self->vecbuf); __pyx_v_self->vecbuf = ((struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *)__pyx_t_6); __pyx_t_6 = 0; /* "petsc4py/PETSc/petscdmda.pxi":248 * # * self.vecbuf = _Vec_buffer(vec) * self.starts = starts # <<<<<<<<<<<<<< * self.sizes = sizes * self.shape = shape */ __Pyx_INCREF(__pyx_v_starts); __Pyx_GIVEREF(__pyx_v_starts); __Pyx_GOTREF(__pyx_v_self->starts); __Pyx_DECREF(__pyx_v_self->starts); __pyx_v_self->starts = __pyx_v_starts; /* "petsc4py/PETSc/petscdmda.pxi":249 * self.vecbuf = _Vec_buffer(vec) * self.starts = starts * self.sizes = sizes # <<<<<<<<<<<<<< * self.shape = shape * self.strides = strides */ __Pyx_INCREF(__pyx_v_sizes); __Pyx_GIVEREF(__pyx_v_sizes); __Pyx_GOTREF(__pyx_v_self->sizes); __Pyx_DECREF(__pyx_v_self->sizes); __pyx_v_self->sizes = __pyx_v_sizes; /* "petsc4py/PETSc/petscdmda.pxi":250 * self.starts = starts * self.sizes = sizes * self.shape = shape # <<<<<<<<<<<<<< * self.strides = strides * */ __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); __Pyx_GOTREF(__pyx_v_self->shape); __Pyx_DECREF(__pyx_v_self->shape); __pyx_v_self->shape = __pyx_v_shape; /* "petsc4py/PETSc/petscdmda.pxi":251 * self.sizes = sizes * self.shape = shape * self.strides = strides # <<<<<<<<<<<<<< * * cdef int acquire(self) except -1: */ __Pyx_INCREF(__pyx_v_strides); __Pyx_GIVEREF(__pyx_v_strides); __Pyx_GOTREF(__pyx_v_self->strides); __Pyx_DECREF(__pyx_v_self->strides); __pyx_v_self->strides = __pyx_v_strides; /* "petsc4py/PETSc/petscdmda.pxi":205 * cdef readonly ndarray array * * def __cinit__(self, DMDA da, Vec vec, bint DOF=False): # <<<<<<<<<<<<<< * # * cdef PetscInt dim=0, dof=0 */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("petsc4py.PETSc._DMDA_Vec_array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_starts); __Pyx_XDECREF(__pyx_v_sizes); __Pyx_XDECREF(__pyx_v_shape); __Pyx_XDECREF(__pyx_v_strides); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscdmda.pxi":253 * self.strides = strides * * cdef int acquire(self) except -1: # <<<<<<<<<<<<<< * self.vecbuf.acquire() * if self.array is None: */ static int __pyx_f_8petsc4py_5PETSc_15_DMDA_Vec_array_acquire(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("acquire", 1); /* "petsc4py/PETSc/petscdmda.pxi":254 * * cdef int acquire(self) except -1: * self.vecbuf.acquire() # <<<<<<<<<<<<<< * if self.array is None: * self.array = asarray(self.vecbuf) */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_self->vecbuf->__pyx_vtab)->acquire(__pyx_v_self->vecbuf); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(10, 254, __pyx_L1_error) /* "petsc4py/PETSc/petscdmda.pxi":255 * cdef int acquire(self) except -1: * self.vecbuf.acquire() * if self.array is None: # <<<<<<<<<<<<<< * self.array = asarray(self.vecbuf) * self.array.shape = self.shape */ __pyx_t_2 = (((PyObject *)__pyx_v_self->array) == Py_None); if (__pyx_t_2) { /* "petsc4py/PETSc/petscdmda.pxi":256 * self.vecbuf.acquire() * if self.array is None: * self.array = asarray(self.vecbuf) # <<<<<<<<<<<<<< * self.array.shape = self.shape * self.array.strides = self.strides */ __pyx_t_3 = ((PyObject *)__pyx_v_self->vecbuf); __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_asarray(__pyx_t_3)); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GIVEREF(__pyx_t_4); __Pyx_GOTREF((PyObject *)__pyx_v_self->array); __Pyx_DECREF((PyObject *)__pyx_v_self->array); __pyx_v_self->array = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/petscdmda.pxi":257 * if self.array is None: * self.array = asarray(self.vecbuf) * self.array.shape = self.shape # <<<<<<<<<<<<<< * self.array.strides = self.strides * return 0 */ __pyx_t_4 = __pyx_v_self->shape; __Pyx_INCREF(__pyx_t_4); if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self->array), __pyx_n_s_shape, __pyx_t_4) < 0) __PYX_ERR(10, 257, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/petscdmda.pxi":258 * self.array = asarray(self.vecbuf) * self.array.shape = self.shape * self.array.strides = self.strides # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_4 = __pyx_v_self->strides; __Pyx_INCREF(__pyx_t_4); if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self->array), __pyx_n_s_strides, __pyx_t_4) < 0) __PYX_ERR(10, 258, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/petscdmda.pxi":255 * cdef int acquire(self) except -1: * self.vecbuf.acquire() * if self.array is None: # <<<<<<<<<<<<<< * self.array = asarray(self.vecbuf) * self.array.shape = self.shape */ } /* "petsc4py/PETSc/petscdmda.pxi":259 * self.array.shape = self.shape * self.array.strides = self.strides * return 0 # <<<<<<<<<<<<<< * * cdef int release(self) except -1: */ __pyx_r = 0; goto __pyx_L0; /* "petsc4py/PETSc/petscdmda.pxi":253 * self.strides = strides * * cdef int acquire(self) except -1: # <<<<<<<<<<<<<< * self.vecbuf.acquire() * if self.array is None: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc._DMDA_Vec_array.acquire", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscdmda.pxi":261 * return 0 * * cdef int release(self) except -1: # <<<<<<<<<<<<<< * self.vecbuf.release() * self.array = None */ static int __pyx_f_8petsc4py_5PETSc_15_DMDA_Vec_array_release(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("release", 1); /* "petsc4py/PETSc/petscdmda.pxi":262 * * cdef int release(self) except -1: * self.vecbuf.release() # <<<<<<<<<<<<<< * self.array = None * return 0 */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_self->vecbuf->__pyx_vtab)->release(__pyx_v_self->vecbuf); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(10, 262, __pyx_L1_error) /* "petsc4py/PETSc/petscdmda.pxi":263 * cdef int release(self) except -1: * self.vecbuf.release() * self.array = None # <<<<<<<<<<<<<< * return 0 * */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF((PyObject *)__pyx_v_self->array); __Pyx_DECREF((PyObject *)__pyx_v_self->array); __pyx_v_self->array = ((PyArrayObject *)Py_None); /* "petsc4py/PETSc/petscdmda.pxi":264 * self.vecbuf.release() * self.array = None * return 0 # <<<<<<<<<<<<<< * * # */ __pyx_r = 0; goto __pyx_L0; /* "petsc4py/PETSc/petscdmda.pxi":261 * return 0 * * cdef int release(self) except -1: # <<<<<<<<<<<<<< * self.vecbuf.release() * self.array = None */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc._DMDA_Vec_array.release", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscdmda.pxi":268 * # * * def __getitem__(self, index): # <<<<<<<<<<<<<< * self.acquire() * index = adjust_index_exp(self.starts, index) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_15_DMDA_Vec_array_3__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_15_DMDA_Vec_array_3__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array_2__getitem__(((struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *)__pyx_v_self), ((PyObject *)__pyx_v_index)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array_2__getitem__(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *__pyx_v_self, PyObject *__pyx_v_index) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getitem__", 0); __Pyx_INCREF(__pyx_v_index); /* "petsc4py/PETSc/petscdmda.pxi":269 * * def __getitem__(self, index): * self.acquire() # <<<<<<<<<<<<<< * index = adjust_index_exp(self.starts, index) * return self.array[index] */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__DMDA_Vec_array *)__pyx_v_self->__pyx_vtab)->acquire(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(10, 269, __pyx_L1_error) /* "petsc4py/PETSc/petscdmda.pxi":270 * def __getitem__(self, index): * self.acquire() * index = adjust_index_exp(self.starts, index) # <<<<<<<<<<<<<< * return self.array[index] * */ __pyx_t_2 = __pyx_v_self->starts; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_adjust_index_exp(__pyx_t_2, __pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/petscdmda.pxi":271 * self.acquire() * index = adjust_index_exp(self.starts, index) * return self.array[index] # <<<<<<<<<<<<<< * * def __setitem__(self, index, value): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->array), __pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "petsc4py/PETSc/petscdmda.pxi":268 * # * * def __getitem__(self, index): # <<<<<<<<<<<<<< * self.acquire() * index = adjust_index_exp(self.starts, index) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc._DMDA_Vec_array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_index); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscdmda.pxi":273 * return self.array[index] * * def __setitem__(self, index, value): # <<<<<<<<<<<<<< * self.acquire() * index = adjust_index_exp(self.starts, index) */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_15_DMDA_Vec_array_5__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_15_DMDA_Vec_array_5__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array_4__setitem__(((struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array_4__setitem__(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setitem__", 0); __Pyx_INCREF(__pyx_v_index); /* "petsc4py/PETSc/petscdmda.pxi":274 * * def __setitem__(self, index, value): * self.acquire() # <<<<<<<<<<<<<< * index = adjust_index_exp(self.starts, index) * self.array[index] = value */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__DMDA_Vec_array *)__pyx_v_self->__pyx_vtab)->acquire(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(10, 274, __pyx_L1_error) /* "petsc4py/PETSc/petscdmda.pxi":275 * def __setitem__(self, index, value): * self.acquire() * index = adjust_index_exp(self.starts, index) # <<<<<<<<<<<<<< * self.array[index] = value * */ __pyx_t_2 = __pyx_v_self->starts; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_adjust_index_exp(__pyx_t_2, __pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/petscdmda.pxi":276 * self.acquire() * index = adjust_index_exp(self.starts, index) * self.array[index] = value # <<<<<<<<<<<<<< * * # 'with' statement (PEP 343) */ if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_self->array), __pyx_v_index, __pyx_v_value) < 0))) __PYX_ERR(10, 276, __pyx_L1_error) /* "petsc4py/PETSc/petscdmda.pxi":273 * return self.array[index] * * def __setitem__(self, index, value): # <<<<<<<<<<<<<< * self.acquire() * index = adjust_index_exp(self.starts, index) */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc._DMDA_Vec_array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_index); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscdmda.pxi":280 * # 'with' statement (PEP 343) * * def __enter__(self): # <<<<<<<<<<<<<< * self.acquire() * return self */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_15_DMDA_Vec_array_7__enter__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_15_DMDA_Vec_array_6__enter__, "_DMDA_Vec_array.__enter__(self)\nSource code at petsc4py/PETSc/petscdmda.pxi:280"); static PyObject *__pyx_pw_8petsc4py_5PETSc_15_DMDA_Vec_array_7__enter__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__enter__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__enter__", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array_6__enter__(((struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array_6__enter__(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__enter__", 1); /* "petsc4py/PETSc/petscdmda.pxi":281 * * def __enter__(self): * self.acquire() # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__DMDA_Vec_array *)__pyx_v_self->__pyx_vtab)->acquire(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(10, 281, __pyx_L1_error) /* "petsc4py/PETSc/petscdmda.pxi":282 * def __enter__(self): * self.acquire() * return self # <<<<<<<<<<<<<< * * def __exit__(self, *exc): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/petscdmda.pxi":280 * # 'with' statement (PEP 343) * * def __enter__(self): # <<<<<<<<<<<<<< * self.acquire() * return self */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc._DMDA_Vec_array.__enter__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscdmda.pxi":284 * return self * * def __exit__(self, *exc): # <<<<<<<<<<<<<< * self.release() * return None */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_15_DMDA_Vec_array_9__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_15_DMDA_Vec_array_8__exit__, "_DMDA_Vec_array.__exit__(self, *exc)\nSource code at petsc4py/PETSc/petscdmda.pxi:284"); static PyObject *__pyx_pw_8petsc4py_5PETSc_15_DMDA_Vec_array_9__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED PyObject *__pyx_v_exc = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__exit__", 0))) return NULL; __Pyx_INCREF(__pyx_args); __pyx_v_exc = __pyx_args; __pyx_r = __pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array_8__exit__(((struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *)__pyx_v_self), __pyx_v_exc); /* function exit code */ __Pyx_DECREF(__pyx_v_exc); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array_8__exit__(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__exit__", 1); /* "petsc4py/PETSc/petscdmda.pxi":285 * * def __exit__(self, *exc): * self.release() # <<<<<<<<<<<<<< * return None * */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__DMDA_Vec_array *)__pyx_v_self->__pyx_vtab)->release(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(10, 285, __pyx_L1_error) /* "petsc4py/PETSc/petscdmda.pxi":286 * def __exit__(self, *exc): * self.release() * return None # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "petsc4py/PETSc/petscdmda.pxi":284 * return self * * def __exit__(self, *exc): # <<<<<<<<<<<<<< * self.release() * return None */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc._DMDA_Vec_array.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscdmda.pxi":201 * * cdef _Vec_buffer vecbuf * cdef readonly tuple starts, sizes # <<<<<<<<<<<<<< * cdef readonly tuple shape, strides * cdef readonly ndarray array */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_15_DMDA_Vec_array_6starts_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_15_DMDA_Vec_array_6starts_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array_6starts___get__(((struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array_6starts___get__(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 1); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->starts); __pyx_r = __pyx_v_self->starts; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_15_DMDA_Vec_array_5sizes_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_15_DMDA_Vec_array_5sizes_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array_5sizes___get__(((struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array_5sizes___get__(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 1); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->sizes); __pyx_r = __pyx_v_self->sizes; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscdmda.pxi":202 * cdef _Vec_buffer vecbuf * cdef readonly tuple starts, sizes * cdef readonly tuple shape, strides # <<<<<<<<<<<<<< * cdef readonly ndarray array * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_15_DMDA_Vec_array_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_15_DMDA_Vec_array_5shape_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array_5shape___get__(((struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array_5shape___get__(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 1); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->shape); __pyx_r = __pyx_v_self->shape; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_15_DMDA_Vec_array_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_15_DMDA_Vec_array_7strides_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array_7strides___get__(((struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array_7strides___get__(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 1); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->strides); __pyx_r = __pyx_v_self->strides; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscdmda.pxi":203 * cdef readonly tuple starts, sizes * cdef readonly tuple shape, strides * cdef readonly ndarray array # <<<<<<<<<<<<<< * * def __cinit__(self, DMDA da, Vec vec, bint DOF=False): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_15_DMDA_Vec_array_5array_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_15_DMDA_Vec_array_5array_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array_5array___get__(((struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array_5array___get__(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 1); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self->array); __pyx_r = ((PyObject *)__pyx_v_self->array); goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscdmda.pxi":289 * * * cdef object adjust_index_exp(object starts, object index): # <<<<<<<<<<<<<< * if not isinstance(index, tuple): * return adjust_index(starts[0], index) */ static PyObject *__pyx_f_8petsc4py_5PETSc_adjust_index_exp(PyObject *__pyx_v_starts, PyObject *__pyx_v_index) { PyObject *__pyx_v_i = NULL; PyObject *__pyx_v_start = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; Py_ssize_t __pyx_t_5; PyObject *(*__pyx_t_6)(PyObject *); PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("adjust_index_exp", 0); __Pyx_INCREF(__pyx_v_index); /* "petsc4py/PETSc/petscdmda.pxi":290 * * cdef object adjust_index_exp(object starts, object index): * if not isinstance(index, tuple): # <<<<<<<<<<<<<< * return adjust_index(starts[0], index) * index = list(index) */ __pyx_t_1 = PyTuple_Check(__pyx_v_index); __pyx_t_2 = (!__pyx_t_1); if (__pyx_t_2) { /* "petsc4py/PETSc/petscdmda.pxi":291 * cdef object adjust_index_exp(object starts, object index): * if not isinstance(index, tuple): * return adjust_index(starts[0], index) # <<<<<<<<<<<<<< * index = list(index) * for i, start in enumerate(starts): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_starts, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_adjust_index(__pyx_t_3, __pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "petsc4py/PETSc/petscdmda.pxi":290 * * cdef object adjust_index_exp(object starts, object index): * if not isinstance(index, tuple): # <<<<<<<<<<<<<< * return adjust_index(starts[0], index) * index = list(index) */ } /* "petsc4py/PETSc/petscdmda.pxi":292 * if not isinstance(index, tuple): * return adjust_index(starts[0], index) * index = list(index) # <<<<<<<<<<<<<< * for i, start in enumerate(starts): * index[i] = adjust_index(start, index[i]) */ __pyx_t_4 = PySequence_List(__pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/petscdmda.pxi":293 * return adjust_index(starts[0], index) * index = list(index) * for i, start in enumerate(starts): # <<<<<<<<<<<<<< * index[i] = adjust_index(start, index[i]) * index = tuple(index) */ __Pyx_INCREF(__pyx_int_0); __pyx_t_4 = __pyx_int_0; if (likely(PyList_CheckExact(__pyx_v_starts)) || PyTuple_CheckExact(__pyx_v_starts)) { __pyx_t_3 = __pyx_v_starts; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_starts); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(10, 293, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_3))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(10, 293, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_7 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(10, 293, __pyx_L1_error) #else __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(10, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(10, 293, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(10, 293, __pyx_L1_error) #else __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(10, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } } else { __pyx_t_7 = __pyx_t_6(__pyx_t_3); if (unlikely(!__pyx_t_7)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(10, 293, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_7); } __Pyx_XDECREF_SET(__pyx_v_start, __pyx_t_7); __pyx_t_7 = 0; __Pyx_INCREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_4); __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_4, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(10, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = __pyx_t_7; __pyx_t_7 = 0; /* "petsc4py/PETSc/petscdmda.pxi":294 * index = list(index) * for i, start in enumerate(starts): * index[i] = adjust_index(start, index[i]) # <<<<<<<<<<<<<< * index = tuple(index) * return index */ __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_index, __pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(10, 294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_adjust_index(__pyx_v_start, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(10, 294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely((PyObject_SetItem(__pyx_v_index, __pyx_v_i, __pyx_t_8) < 0))) __PYX_ERR(10, 294, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "petsc4py/PETSc/petscdmda.pxi":293 * return adjust_index(starts[0], index) * index = list(index) * for i, start in enumerate(starts): # <<<<<<<<<<<<<< * index[i] = adjust_index(start, index[i]) * index = tuple(index) */ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/petscdmda.pxi":295 * for i, start in enumerate(starts): * index[i] = adjust_index(start, index[i]) * index = tuple(index) # <<<<<<<<<<<<<< * return index * */ __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/petscdmda.pxi":296 * index[i] = adjust_index(start, index[i]) * index = tuple(index) * return index # <<<<<<<<<<<<<< * * cdef object adjust_index(object lbound, object index): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_index); __pyx_r = __pyx_v_index; goto __pyx_L0; /* "petsc4py/PETSc/petscdmda.pxi":289 * * * cdef object adjust_index_exp(object starts, object index): # <<<<<<<<<<<<<< * if not isinstance(index, tuple): * return adjust_index(starts[0], index) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("petsc4py.PETSc.adjust_index_exp", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_i); __Pyx_XDECREF(__pyx_v_start); __Pyx_XDECREF(__pyx_v_index); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscdmda.pxi":298 * return index * * cdef object adjust_index(object lbound, object index): # <<<<<<<<<<<<<< * if index is None: * return index */ static PyObject *__pyx_f_8petsc4py_5PETSc_adjust_index(PyObject *__pyx_v_lbound, PyObject *__pyx_v_index) { PyObject *__pyx_v_start = NULL; PyObject *__pyx_v_stop = NULL; PyObject *__pyx_v_step = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("adjust_index", 1); /* "petsc4py/PETSc/petscdmda.pxi":299 * * cdef object adjust_index(object lbound, object index): * if index is None: # <<<<<<<<<<<<<< * return index * if index is Ellipsis: */ __pyx_t_1 = (__pyx_v_index == Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/petscdmda.pxi":300 * cdef object adjust_index(object lbound, object index): * if index is None: * return index # <<<<<<<<<<<<<< * if index is Ellipsis: * return index */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_index); __pyx_r = __pyx_v_index; goto __pyx_L0; /* "petsc4py/PETSc/petscdmda.pxi":299 * * cdef object adjust_index(object lbound, object index): * if index is None: # <<<<<<<<<<<<<< * return index * if index is Ellipsis: */ } /* "petsc4py/PETSc/petscdmda.pxi":301 * if index is None: * return index * if index is Ellipsis: # <<<<<<<<<<<<<< * return index * if isinstance(index, slice): */ __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis); if (__pyx_t_1) { /* "petsc4py/PETSc/petscdmda.pxi":302 * return index * if index is Ellipsis: * return index # <<<<<<<<<<<<<< * if isinstance(index, slice): * start = index.start */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_index); __pyx_r = __pyx_v_index; goto __pyx_L0; /* "petsc4py/PETSc/petscdmda.pxi":301 * if index is None: * return index * if index is Ellipsis: # <<<<<<<<<<<<<< * return index * if isinstance(index, slice): */ } /* "petsc4py/PETSc/petscdmda.pxi":303 * if index is Ellipsis: * return index * if isinstance(index, slice): # <<<<<<<<<<<<<< * start = index.start * stop = index.stop */ __pyx_t_1 = PySlice_Check(__pyx_v_index); if (__pyx_t_1) { /* "petsc4py/PETSc/petscdmda.pxi":304 * return index * if isinstance(index, slice): * start = index.start # <<<<<<<<<<<<<< * stop = index.stop * step = index.step */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_start = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/petscdmda.pxi":305 * if isinstance(index, slice): * start = index.start * stop = index.stop # <<<<<<<<<<<<<< * step = index.step * if start is not None: start -= lbound */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_stop = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/petscdmda.pxi":306 * start = index.start * stop = index.stop * step = index.step # <<<<<<<<<<<<<< * if start is not None: start -= lbound * if stop is not None: stop -= lbound */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_step = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/petscdmda.pxi":307 * stop = index.stop * step = index.step * if start is not None: start -= lbound # <<<<<<<<<<<<<< * if stop is not None: stop -= lbound * return slice(start, stop, step) */ __pyx_t_1 = (__pyx_v_start != Py_None); if (__pyx_t_1) { __pyx_t_2 = PyNumber_InPlaceSubtract(__pyx_v_start, __pyx_v_lbound); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_start, __pyx_t_2); __pyx_t_2 = 0; } /* "petsc4py/PETSc/petscdmda.pxi":308 * step = index.step * if start is not None: start -= lbound * if stop is not None: stop -= lbound # <<<<<<<<<<<<<< * return slice(start, stop, step) * try: */ __pyx_t_1 = (__pyx_v_stop != Py_None); if (__pyx_t_1) { __pyx_t_2 = PyNumber_InPlaceSubtract(__pyx_v_stop, __pyx_v_lbound); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_stop, __pyx_t_2); __pyx_t_2 = 0; } /* "petsc4py/PETSc/petscdmda.pxi":309 * if start is not None: start -= lbound * if stop is not None: stop -= lbound * return slice(start, stop, step) # <<<<<<<<<<<<<< * try: * return index - lbound */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PySlice_New(__pyx_v_start, __pyx_v_stop, __pyx_v_step); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/petscdmda.pxi":303 * if index is Ellipsis: * return index * if isinstance(index, slice): # <<<<<<<<<<<<<< * start = index.start * stop = index.stop */ } /* "petsc4py/PETSc/petscdmda.pxi":310 * if stop is not None: stop -= lbound * return slice(start, stop, step) * try: # <<<<<<<<<<<<<< * return index - lbound * except TypeError: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_5); /*try:*/ { /* "petsc4py/PETSc/petscdmda.pxi":311 * return slice(start, stop, step) * try: * return index - lbound # <<<<<<<<<<<<<< * except TypeError: * return index */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyNumber_Subtract(__pyx_v_index, __pyx_v_lbound); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 311, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L12_try_return; /* "petsc4py/PETSc/petscdmda.pxi":310 * if stop is not None: stop -= lbound * return slice(start, stop, step) * try: # <<<<<<<<<<<<<< * return index - lbound * except TypeError: */ } __pyx_L8_error:; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscdmda.pxi":312 * try: * return index - lbound * except TypeError: # <<<<<<<<<<<<<< * return index * */ __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError); if (__pyx_t_6) { __Pyx_AddTraceback("petsc4py.PETSc.adjust_index", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(10, 312, __pyx_L10_except_error) __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); /* "petsc4py/PETSc/petscdmda.pxi":313 * return index - lbound * except TypeError: * return index # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_index); __pyx_r = __pyx_v_index; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L11_except_return; } goto __pyx_L10_except_error; /* "petsc4py/PETSc/petscdmda.pxi":310 * if stop is not None: stop -= lbound * return slice(start, stop, step) * try: # <<<<<<<<<<<<<< * return index - lbound * except TypeError: */ __pyx_L10_except_error:; __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); goto __pyx_L1_error; __pyx_L12_try_return:; __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); goto __pyx_L0; __pyx_L11_except_return:; __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); goto __pyx_L0; } /* "petsc4py/PETSc/petscdmda.pxi":298 * return index * * cdef object adjust_index(object lbound, object index): # <<<<<<<<<<<<<< * if index is None: * return index */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("petsc4py.PETSc.adjust_index", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_start); __Pyx_XDECREF(__pyx_v_stop); __Pyx_XDECREF(__pyx_v_step); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscdmstag.pxi":85 * # -------------------------------------------------------------------- * * cdef inline PetscDMStagStencilType asStagStencil(object stencil) \ # <<<<<<<<<<<<<< * except (-1): * if isinstance(stencil, str): */ static CYTHON_INLINE DMStagStencilType __pyx_f_8petsc4py_5PETSc_asStagStencil(PyObject *__pyx_v_stencil) { DMStagStencilType __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; DMStagStencilType __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("asStagStencil", 1); /* "petsc4py/PETSc/petscdmstag.pxi":87 * cdef inline PetscDMStagStencilType asStagStencil(object stencil) \ * except (-1): * if isinstance(stencil, str): # <<<<<<<<<<<<<< * if stencil == "star": return DMSTAG_STENCIL_STAR * elif stencil == "box": return DMSTAG_STENCIL_BOX */ __pyx_t_1 = PyString_Check(__pyx_v_stencil); if (__pyx_t_1) { /* "petsc4py/PETSc/petscdmstag.pxi":88 * except (-1): * if isinstance(stencil, str): * if stencil == "star": return DMSTAG_STENCIL_STAR # <<<<<<<<<<<<<< * elif stencil == "box": return DMSTAG_STENCIL_BOX * elif stencil == "none": return DMSTAG_STENCIL_NONE */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_stencil, __pyx_n_s_star, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(27, 88, __pyx_L1_error) if (__pyx_t_1) { __pyx_r = DMSTAG_STENCIL_STAR; goto __pyx_L0; } /* "petsc4py/PETSc/petscdmstag.pxi":89 * if isinstance(stencil, str): * if stencil == "star": return DMSTAG_STENCIL_STAR * elif stencil == "box": return DMSTAG_STENCIL_BOX # <<<<<<<<<<<<<< * elif stencil == "none": return DMSTAG_STENCIL_NONE * else: raise ValueError("unknown stencil type: %s" % stencil) */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_stencil, __pyx_n_s_box, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(27, 89, __pyx_L1_error) if (__pyx_t_1) { __pyx_r = DMSTAG_STENCIL_BOX; goto __pyx_L0; } /* "petsc4py/PETSc/petscdmstag.pxi":90 * if stencil == "star": return DMSTAG_STENCIL_STAR * elif stencil == "box": return DMSTAG_STENCIL_BOX * elif stencil == "none": return DMSTAG_STENCIL_NONE # <<<<<<<<<<<<<< * else: raise ValueError("unknown stencil type: %s" % stencil) * return stencil */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_stencil, __pyx_n_s_none, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(27, 90, __pyx_L1_error) if (likely(__pyx_t_1)) { __pyx_r = DMSTAG_STENCIL_NONE; goto __pyx_L0; } /* "petsc4py/PETSc/petscdmstag.pxi":91 * elif stencil == "box": return DMSTAG_STENCIL_BOX * elif stencil == "none": return DMSTAG_STENCIL_NONE * else: raise ValueError("unknown stencil type: %s" % stencil) # <<<<<<<<<<<<<< * return stencil * */ /*else*/ { __pyx_t_2 = __Pyx_PyString_FormatSafe(__pyx_kp_s_unknown_stencil_type_s, __pyx_v_stencil); if (unlikely(!__pyx_t_2)) __PYX_ERR(27, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(27, 91, __pyx_L1_error) } /* "petsc4py/PETSc/petscdmstag.pxi":87 * cdef inline PetscDMStagStencilType asStagStencil(object stencil) \ * except (-1): * if isinstance(stencil, str): # <<<<<<<<<<<<<< * if stencil == "star": return DMSTAG_STENCIL_STAR * elif stencil == "box": return DMSTAG_STENCIL_BOX */ } /* "petsc4py/PETSc/petscdmstag.pxi":92 * elif stencil == "none": return DMSTAG_STENCIL_NONE * else: raise ValueError("unknown stencil type: %s" % stencil) * return stencil # <<<<<<<<<<<<<< * * cdef inline object toStagStencil(PetscDMStagStencilType stype): */ __pyx_t_4 = ((DMStagStencilType)__Pyx_PyInt_As_DMStagStencilType(__pyx_v_stencil)); if (unlikely(PyErr_Occurred())) __PYX_ERR(27, 92, __pyx_L1_error) __pyx_r = __pyx_t_4; goto __pyx_L0; /* "petsc4py/PETSc/petscdmstag.pxi":85 * # -------------------------------------------------------------------- * * cdef inline PetscDMStagStencilType asStagStencil(object stencil) \ # <<<<<<<<<<<<<< * except (-1): * if isinstance(stencil, str): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.asStagStencil", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = ((DMStagStencilType)-1L); __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscdmstag.pxi":94 * return stencil * * cdef inline object toStagStencil(PetscDMStagStencilType stype): # <<<<<<<<<<<<<< * if stype == DMSTAG_STENCIL_STAR: return "star" * elif stype == DMSTAG_STENCIL_BOX: return "box" */ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toStagStencil(DMStagStencilType __pyx_v_stype) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("toStagStencil", 1); /* "petsc4py/PETSc/petscdmstag.pxi":95 * * cdef inline object toStagStencil(PetscDMStagStencilType stype): * if stype == DMSTAG_STENCIL_STAR: return "star" # <<<<<<<<<<<<<< * elif stype == DMSTAG_STENCIL_BOX: return "box" * elif stype == DMSTAG_STENCIL_NONE: return "none" */ __pyx_t_1 = (__pyx_v_stype == DMSTAG_STENCIL_STAR); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_n_s_star); __pyx_r = __pyx_n_s_star; goto __pyx_L0; } /* "petsc4py/PETSc/petscdmstag.pxi":96 * cdef inline object toStagStencil(PetscDMStagStencilType stype): * if stype == DMSTAG_STENCIL_STAR: return "star" * elif stype == DMSTAG_STENCIL_BOX: return "box" # <<<<<<<<<<<<<< * elif stype == DMSTAG_STENCIL_NONE: return "none" * */ __pyx_t_1 = (__pyx_v_stype == DMSTAG_STENCIL_BOX); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_n_s_box); __pyx_r = __pyx_n_s_box; goto __pyx_L0; } /* "petsc4py/PETSc/petscdmstag.pxi":97 * if stype == DMSTAG_STENCIL_STAR: return "star" * elif stype == DMSTAG_STENCIL_BOX: return "box" * elif stype == DMSTAG_STENCIL_NONE: return "none" # <<<<<<<<<<<<<< * * cdef inline PetscDMStagStencilLocation asStagStencilLocation(object stencil_location) \ */ __pyx_t_1 = (__pyx_v_stype == DMSTAG_STENCIL_NONE); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_n_s_none); __pyx_r = __pyx_n_s_none; goto __pyx_L0; } /* "petsc4py/PETSc/petscdmstag.pxi":94 * return stencil * * cdef inline object toStagStencil(PetscDMStagStencilType stype): # <<<<<<<<<<<<<< * if stype == DMSTAG_STENCIL_STAR: return "star" * elif stype == DMSTAG_STENCIL_BOX: return "box" */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscdmstag.pxi":99 * elif stype == DMSTAG_STENCIL_NONE: return "none" * * cdef inline PetscDMStagStencilLocation asStagStencilLocation(object stencil_location) \ # <<<<<<<<<<<<<< * except (-1): * if isinstance(stencil_location, str): */ static CYTHON_INLINE DMStagStencilLocation __pyx_f_8petsc4py_5PETSc_asStagStencilLocation(PyObject *__pyx_v_stencil_location) { DMStagStencilLocation __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; DMStagStencilLocation __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("asStagStencilLocation", 1); /* "petsc4py/PETSc/petscdmstag.pxi":101 * cdef inline PetscDMStagStencilLocation asStagStencilLocation(object stencil_location) \ * except (-1): * if isinstance(stencil_location, str): # <<<<<<<<<<<<<< * if stencil_location == "null": return DMSTAG_NULL_LOCATION * elif stencil_location == "back_down_left": return DMSTAG_BACK_DOWN_LEFT */ __pyx_t_1 = PyString_Check(__pyx_v_stencil_location); if (__pyx_t_1) { /* "petsc4py/PETSc/petscdmstag.pxi":102 * except (-1): * if isinstance(stencil_location, str): * if stencil_location == "null": return DMSTAG_NULL_LOCATION # <<<<<<<<<<<<<< * elif stencil_location == "back_down_left": return DMSTAG_BACK_DOWN_LEFT * elif stencil_location == "back_down": return DMSTAG_BACK_DOWN */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_null, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(27, 102, __pyx_L1_error) if (__pyx_t_1) { __pyx_r = DMSTAG_NULL_LOCATION; goto __pyx_L0; } /* "petsc4py/PETSc/petscdmstag.pxi":103 * if isinstance(stencil_location, str): * if stencil_location == "null": return DMSTAG_NULL_LOCATION * elif stencil_location == "back_down_left": return DMSTAG_BACK_DOWN_LEFT # <<<<<<<<<<<<<< * elif stencil_location == "back_down": return DMSTAG_BACK_DOWN * elif stencil_location == "back_down_right": return DMSTAG_BACK_DOWN_RIGHT */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_back_down_left, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(27, 103, __pyx_L1_error) if (__pyx_t_1) { __pyx_r = DMSTAG_BACK_DOWN_LEFT; goto __pyx_L0; } /* "petsc4py/PETSc/petscdmstag.pxi":104 * if stencil_location == "null": return DMSTAG_NULL_LOCATION * elif stencil_location == "back_down_left": return DMSTAG_BACK_DOWN_LEFT * elif stencil_location == "back_down": return DMSTAG_BACK_DOWN # <<<<<<<<<<<<<< * elif stencil_location == "back_down_right": return DMSTAG_BACK_DOWN_RIGHT * elif stencil_location == "back_left": return DMSTAG_BACK_LEFT */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_back_down, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(27, 104, __pyx_L1_error) if (__pyx_t_1) { __pyx_r = DMSTAG_BACK_DOWN; goto __pyx_L0; } /* "petsc4py/PETSc/petscdmstag.pxi":105 * elif stencil_location == "back_down_left": return DMSTAG_BACK_DOWN_LEFT * elif stencil_location == "back_down": return DMSTAG_BACK_DOWN * elif stencil_location == "back_down_right": return DMSTAG_BACK_DOWN_RIGHT # <<<<<<<<<<<<<< * elif stencil_location == "back_left": return DMSTAG_BACK_LEFT * elif stencil_location == "back": return DMSTAG_BACK */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_back_down_right, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(27, 105, __pyx_L1_error) if (__pyx_t_1) { __pyx_r = DMSTAG_BACK_DOWN_RIGHT; goto __pyx_L0; } /* "petsc4py/PETSc/petscdmstag.pxi":106 * elif stencil_location == "back_down": return DMSTAG_BACK_DOWN * elif stencil_location == "back_down_right": return DMSTAG_BACK_DOWN_RIGHT * elif stencil_location == "back_left": return DMSTAG_BACK_LEFT # <<<<<<<<<<<<<< * elif stencil_location == "back": return DMSTAG_BACK * elif stencil_location == "back_right": return DMSTAG_BACK_RIGHT */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_back_left, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(27, 106, __pyx_L1_error) if (__pyx_t_1) { __pyx_r = DMSTAG_BACK_LEFT; goto __pyx_L0; } /* "petsc4py/PETSc/petscdmstag.pxi":107 * elif stencil_location == "back_down_right": return DMSTAG_BACK_DOWN_RIGHT * elif stencil_location == "back_left": return DMSTAG_BACK_LEFT * elif stencil_location == "back": return DMSTAG_BACK # <<<<<<<<<<<<<< * elif stencil_location == "back_right": return DMSTAG_BACK_RIGHT * elif stencil_location == "back_up_left": return DMSTAG_BACK_UP_LEFT */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_back, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(27, 107, __pyx_L1_error) if (__pyx_t_1) { __pyx_r = DMSTAG_BACK; goto __pyx_L0; } /* "petsc4py/PETSc/petscdmstag.pxi":108 * elif stencil_location == "back_left": return DMSTAG_BACK_LEFT * elif stencil_location == "back": return DMSTAG_BACK * elif stencil_location == "back_right": return DMSTAG_BACK_RIGHT # <<<<<<<<<<<<<< * elif stencil_location == "back_up_left": return DMSTAG_BACK_UP_LEFT * elif stencil_location == "back_up": return DMSTAG_BACK_UP */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_back_right, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(27, 108, __pyx_L1_error) if (__pyx_t_1) { __pyx_r = DMSTAG_BACK_RIGHT; goto __pyx_L0; } /* "petsc4py/PETSc/petscdmstag.pxi":109 * elif stencil_location == "back": return DMSTAG_BACK * elif stencil_location == "back_right": return DMSTAG_BACK_RIGHT * elif stencil_location == "back_up_left": return DMSTAG_BACK_UP_LEFT # <<<<<<<<<<<<<< * elif stencil_location == "back_up": return DMSTAG_BACK_UP * elif stencil_location == "back_up_right": return DMSTAG_BACK_UP_RIGHT */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_back_up_left, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(27, 109, __pyx_L1_error) if (__pyx_t_1) { __pyx_r = DMSTAG_BACK_UP_LEFT; goto __pyx_L0; } /* "petsc4py/PETSc/petscdmstag.pxi":110 * elif stencil_location == "back_right": return DMSTAG_BACK_RIGHT * elif stencil_location == "back_up_left": return DMSTAG_BACK_UP_LEFT * elif stencil_location == "back_up": return DMSTAG_BACK_UP # <<<<<<<<<<<<<< * elif stencil_location == "back_up_right": return DMSTAG_BACK_UP_RIGHT * elif stencil_location == "down_left": return DMSTAG_DOWN_LEFT */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_back_up, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(27, 110, __pyx_L1_error) if (__pyx_t_1) { __pyx_r = DMSTAG_BACK_UP; goto __pyx_L0; } /* "petsc4py/PETSc/petscdmstag.pxi":111 * elif stencil_location == "back_up_left": return DMSTAG_BACK_UP_LEFT * elif stencil_location == "back_up": return DMSTAG_BACK_UP * elif stencil_location == "back_up_right": return DMSTAG_BACK_UP_RIGHT # <<<<<<<<<<<<<< * elif stencil_location == "down_left": return DMSTAG_DOWN_LEFT * elif stencil_location == "down": return DMSTAG_DOWN */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_back_up_right, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(27, 111, __pyx_L1_error) if (__pyx_t_1) { __pyx_r = DMSTAG_BACK_UP_RIGHT; goto __pyx_L0; } /* "petsc4py/PETSc/petscdmstag.pxi":112 * elif stencil_location == "back_up": return DMSTAG_BACK_UP * elif stencil_location == "back_up_right": return DMSTAG_BACK_UP_RIGHT * elif stencil_location == "down_left": return DMSTAG_DOWN_LEFT # <<<<<<<<<<<<<< * elif stencil_location == "down": return DMSTAG_DOWN * elif stencil_location == "down_right": return DMSTAG_DOWN_RIGHT */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_down_left, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(27, 112, __pyx_L1_error) if (__pyx_t_1) { __pyx_r = DMSTAG_DOWN_LEFT; goto __pyx_L0; } /* "petsc4py/PETSc/petscdmstag.pxi":113 * elif stencil_location == "back_up_right": return DMSTAG_BACK_UP_RIGHT * elif stencil_location == "down_left": return DMSTAG_DOWN_LEFT * elif stencil_location == "down": return DMSTAG_DOWN # <<<<<<<<<<<<<< * elif stencil_location == "down_right": return DMSTAG_DOWN_RIGHT * elif stencil_location == "left": return DMSTAG_LEFT */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_down, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(27, 113, __pyx_L1_error) if (__pyx_t_1) { __pyx_r = DMSTAG_DOWN; goto __pyx_L0; } /* "petsc4py/PETSc/petscdmstag.pxi":114 * elif stencil_location == "down_left": return DMSTAG_DOWN_LEFT * elif stencil_location == "down": return DMSTAG_DOWN * elif stencil_location == "down_right": return DMSTAG_DOWN_RIGHT # <<<<<<<<<<<<<< * elif stencil_location == "left": return DMSTAG_LEFT * elif stencil_location == "element": return DMSTAG_ELEMENT */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_down_right, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(27, 114, __pyx_L1_error) if (__pyx_t_1) { __pyx_r = DMSTAG_DOWN_RIGHT; goto __pyx_L0; } /* "petsc4py/PETSc/petscdmstag.pxi":115 * elif stencil_location == "down": return DMSTAG_DOWN * elif stencil_location == "down_right": return DMSTAG_DOWN_RIGHT * elif stencil_location == "left": return DMSTAG_LEFT # <<<<<<<<<<<<<< * elif stencil_location == "element": return DMSTAG_ELEMENT * elif stencil_location == "right": return DMSTAG_RIGHT */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_left, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(27, 115, __pyx_L1_error) if (__pyx_t_1) { __pyx_r = DMSTAG_LEFT; goto __pyx_L0; } /* "petsc4py/PETSc/petscdmstag.pxi":116 * elif stencil_location == "down_right": return DMSTAG_DOWN_RIGHT * elif stencil_location == "left": return DMSTAG_LEFT * elif stencil_location == "element": return DMSTAG_ELEMENT # <<<<<<<<<<<<<< * elif stencil_location == "right": return DMSTAG_RIGHT * elif stencil_location == "up_left": return DMSTAG_UP_LEFT */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_element, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(27, 116, __pyx_L1_error) if (__pyx_t_1) { __pyx_r = DMSTAG_ELEMENT; goto __pyx_L0; } /* "petsc4py/PETSc/petscdmstag.pxi":117 * elif stencil_location == "left": return DMSTAG_LEFT * elif stencil_location == "element": return DMSTAG_ELEMENT * elif stencil_location == "right": return DMSTAG_RIGHT # <<<<<<<<<<<<<< * elif stencil_location == "up_left": return DMSTAG_UP_LEFT * elif stencil_location == "up": return DMSTAG_UP */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_right, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(27, 117, __pyx_L1_error) if (__pyx_t_1) { __pyx_r = DMSTAG_RIGHT; goto __pyx_L0; } /* "petsc4py/PETSc/petscdmstag.pxi":118 * elif stencil_location == "element": return DMSTAG_ELEMENT * elif stencil_location == "right": return DMSTAG_RIGHT * elif stencil_location == "up_left": return DMSTAG_UP_LEFT # <<<<<<<<<<<<<< * elif stencil_location == "up": return DMSTAG_UP * elif stencil_location == "up_right": return DMSTAG_UP_RIGHT */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_up_left, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(27, 118, __pyx_L1_error) if (__pyx_t_1) { __pyx_r = DMSTAG_UP_LEFT; goto __pyx_L0; } /* "petsc4py/PETSc/petscdmstag.pxi":119 * elif stencil_location == "right": return DMSTAG_RIGHT * elif stencil_location == "up_left": return DMSTAG_UP_LEFT * elif stencil_location == "up": return DMSTAG_UP # <<<<<<<<<<<<<< * elif stencil_location == "up_right": return DMSTAG_UP_RIGHT * elif stencil_location == "front_down_left": return DMSTAG_FRONT_DOWN_LEFT */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_up, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(27, 119, __pyx_L1_error) if (__pyx_t_1) { __pyx_r = DMSTAG_UP; goto __pyx_L0; } /* "petsc4py/PETSc/petscdmstag.pxi":120 * elif stencil_location == "up_left": return DMSTAG_UP_LEFT * elif stencil_location == "up": return DMSTAG_UP * elif stencil_location == "up_right": return DMSTAG_UP_RIGHT # <<<<<<<<<<<<<< * elif stencil_location == "front_down_left": return DMSTAG_FRONT_DOWN_LEFT * elif stencil_location == "front_down": return DMSTAG_FRONT_DOWN */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_up_right, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(27, 120, __pyx_L1_error) if (__pyx_t_1) { __pyx_r = DMSTAG_UP_RIGHT; goto __pyx_L0; } /* "petsc4py/PETSc/petscdmstag.pxi":121 * elif stencil_location == "up": return DMSTAG_UP * elif stencil_location == "up_right": return DMSTAG_UP_RIGHT * elif stencil_location == "front_down_left": return DMSTAG_FRONT_DOWN_LEFT # <<<<<<<<<<<<<< * elif stencil_location == "front_down": return DMSTAG_FRONT_DOWN * elif stencil_location == "front_down_right": return DMSTAG_FRONT_DOWN_RIGHT */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_front_down_left, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(27, 121, __pyx_L1_error) if (__pyx_t_1) { __pyx_r = DMSTAG_FRONT_DOWN_LEFT; goto __pyx_L0; } /* "petsc4py/PETSc/petscdmstag.pxi":122 * elif stencil_location == "up_right": return DMSTAG_UP_RIGHT * elif stencil_location == "front_down_left": return DMSTAG_FRONT_DOWN_LEFT * elif stencil_location == "front_down": return DMSTAG_FRONT_DOWN # <<<<<<<<<<<<<< * elif stencil_location == "front_down_right": return DMSTAG_FRONT_DOWN_RIGHT * elif stencil_location == "front_left": return DMSTAG_FRONT_LEFT */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_front_down, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(27, 122, __pyx_L1_error) if (__pyx_t_1) { __pyx_r = DMSTAG_FRONT_DOWN; goto __pyx_L0; } /* "petsc4py/PETSc/petscdmstag.pxi":123 * elif stencil_location == "front_down_left": return DMSTAG_FRONT_DOWN_LEFT * elif stencil_location == "front_down": return DMSTAG_FRONT_DOWN * elif stencil_location == "front_down_right": return DMSTAG_FRONT_DOWN_RIGHT # <<<<<<<<<<<<<< * elif stencil_location == "front_left": return DMSTAG_FRONT_LEFT * elif stencil_location == "front": return DMSTAG_FRONT */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_front_down_right, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(27, 123, __pyx_L1_error) if (__pyx_t_1) { __pyx_r = DMSTAG_FRONT_DOWN_RIGHT; goto __pyx_L0; } /* "petsc4py/PETSc/petscdmstag.pxi":124 * elif stencil_location == "front_down": return DMSTAG_FRONT_DOWN * elif stencil_location == "front_down_right": return DMSTAG_FRONT_DOWN_RIGHT * elif stencil_location == "front_left": return DMSTAG_FRONT_LEFT # <<<<<<<<<<<<<< * elif stencil_location == "front": return DMSTAG_FRONT * elif stencil_location == "front_right": return DMSTAG_FRONT_RIGHT */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_front_left, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(27, 124, __pyx_L1_error) if (__pyx_t_1) { __pyx_r = DMSTAG_FRONT_LEFT; goto __pyx_L0; } /* "petsc4py/PETSc/petscdmstag.pxi":125 * elif stencil_location == "front_down_right": return DMSTAG_FRONT_DOWN_RIGHT * elif stencil_location == "front_left": return DMSTAG_FRONT_LEFT * elif stencil_location == "front": return DMSTAG_FRONT # <<<<<<<<<<<<<< * elif stencil_location == "front_right": return DMSTAG_FRONT_RIGHT * elif stencil_location == "front_up_left": return DMSTAG_FRONT_UP_LEFT */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_front, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(27, 125, __pyx_L1_error) if (__pyx_t_1) { __pyx_r = DMSTAG_FRONT; goto __pyx_L0; } /* "petsc4py/PETSc/petscdmstag.pxi":126 * elif stencil_location == "front_left": return DMSTAG_FRONT_LEFT * elif stencil_location == "front": return DMSTAG_FRONT * elif stencil_location == "front_right": return DMSTAG_FRONT_RIGHT # <<<<<<<<<<<<<< * elif stencil_location == "front_up_left": return DMSTAG_FRONT_UP_LEFT * elif stencil_location == "front_up": return DMSTAG_FRONT_UP */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_front_right, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(27, 126, __pyx_L1_error) if (__pyx_t_1) { __pyx_r = DMSTAG_FRONT_RIGHT; goto __pyx_L0; } /* "petsc4py/PETSc/petscdmstag.pxi":127 * elif stencil_location == "front": return DMSTAG_FRONT * elif stencil_location == "front_right": return DMSTAG_FRONT_RIGHT * elif stencil_location == "front_up_left": return DMSTAG_FRONT_UP_LEFT # <<<<<<<<<<<<<< * elif stencil_location == "front_up": return DMSTAG_FRONT_UP * elif stencil_location == "front_up_right": return DMSTAG_FRONT_UP_RIGHT */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_front_up_left, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(27, 127, __pyx_L1_error) if (__pyx_t_1) { __pyx_r = DMSTAG_FRONT_UP_LEFT; goto __pyx_L0; } /* "petsc4py/PETSc/petscdmstag.pxi":128 * elif stencil_location == "front_right": return DMSTAG_FRONT_RIGHT * elif stencil_location == "front_up_left": return DMSTAG_FRONT_UP_LEFT * elif stencil_location == "front_up": return DMSTAG_FRONT_UP # <<<<<<<<<<<<<< * elif stencil_location == "front_up_right": return DMSTAG_FRONT_UP_RIGHT * else: raise ValueError("unknown stencil location type: %s" % stencil_location) */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_front_up, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(27, 128, __pyx_L1_error) if (__pyx_t_1) { __pyx_r = DMSTAG_FRONT_UP; goto __pyx_L0; } /* "petsc4py/PETSc/petscdmstag.pxi":129 * elif stencil_location == "front_up_left": return DMSTAG_FRONT_UP_LEFT * elif stencil_location == "front_up": return DMSTAG_FRONT_UP * elif stencil_location == "front_up_right": return DMSTAG_FRONT_UP_RIGHT # <<<<<<<<<<<<<< * else: raise ValueError("unknown stencil location type: %s" % stencil_location) * return stencil_location */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_front_up_right, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(27, 129, __pyx_L1_error) if (likely(__pyx_t_1)) { __pyx_r = DMSTAG_FRONT_UP_RIGHT; goto __pyx_L0; } /* "petsc4py/PETSc/petscdmstag.pxi":130 * elif stencil_location == "front_up": return DMSTAG_FRONT_UP * elif stencil_location == "front_up_right": return DMSTAG_FRONT_UP_RIGHT * else: raise ValueError("unknown stencil location type: %s" % stencil_location) # <<<<<<<<<<<<<< * return stencil_location * */ /*else*/ { __pyx_t_2 = __Pyx_PyString_FormatSafe(__pyx_kp_s_unknown_stencil_location_type_s, __pyx_v_stencil_location); if (unlikely(!__pyx_t_2)) __PYX_ERR(27, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(27, 130, __pyx_L1_error) } /* "petsc4py/PETSc/petscdmstag.pxi":101 * cdef inline PetscDMStagStencilLocation asStagStencilLocation(object stencil_location) \ * except (-1): * if isinstance(stencil_location, str): # <<<<<<<<<<<<<< * if stencil_location == "null": return DMSTAG_NULL_LOCATION * elif stencil_location == "back_down_left": return DMSTAG_BACK_DOWN_LEFT */ } /* "petsc4py/PETSc/petscdmstag.pxi":131 * elif stencil_location == "front_up_right": return DMSTAG_FRONT_UP_RIGHT * else: raise ValueError("unknown stencil location type: %s" % stencil_location) * return stencil_location # <<<<<<<<<<<<<< * * */ __pyx_t_4 = ((DMStagStencilLocation)__Pyx_PyInt_As_DMStagStencilLocation(__pyx_v_stencil_location)); if (unlikely(PyErr_Occurred())) __PYX_ERR(27, 131, __pyx_L1_error) __pyx_r = __pyx_t_4; goto __pyx_L0; /* "petsc4py/PETSc/petscdmstag.pxi":99 * elif stype == DMSTAG_STENCIL_NONE: return "none" * * cdef inline PetscDMStagStencilLocation asStagStencilLocation(object stencil_location) \ # <<<<<<<<<<<<<< * except (-1): * if isinstance(stencil_location, str): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.asStagStencilLocation", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = ((DMStagStencilLocation)-1L); __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscdmstag.pxi":134 * * * cdef inline PetscInt asStagDims(dims, # <<<<<<<<<<<<<< * PetscInt *_M, * PetscInt *_N, */ static CYTHON_INLINE PetscInt __pyx_f_8petsc4py_5PETSc_asStagDims(PyObject *__pyx_v_dims, PetscInt *__pyx_v__M, PetscInt *__pyx_v__N, PetscInt *__pyx_v__P) { PetscInt __pyx_v_dim; PyObject *__pyx_v_M = 0; PyObject *__pyx_v_N = 0; PyObject *__pyx_v_P = 0; PetscInt __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *(*__pyx_t_5)(PyObject *); PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PetscInt __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("asStagDims", 0); __Pyx_INCREF(__pyx_v_dims); /* "petsc4py/PETSc/petscdmstag.pxi":138 * PetscInt *_N, * PetscInt *_P) except? -1: * cdef PetscInt dim = PETSC_DECIDE # <<<<<<<<<<<<<< * cdef object M=None, N=None, P=None * dims = tuple(dims) */ __pyx_v_dim = PETSC_DECIDE; /* "petsc4py/PETSc/petscdmstag.pxi":139 * PetscInt *_P) except? -1: * cdef PetscInt dim = PETSC_DECIDE * cdef object M=None, N=None, P=None # <<<<<<<<<<<<<< * dims = tuple(dims) * dim = len(dims) */ __Pyx_INCREF(Py_None); __pyx_v_M = Py_None; __Pyx_INCREF(Py_None); __pyx_v_N = Py_None; __Pyx_INCREF(Py_None); __pyx_v_P = Py_None; /* "petsc4py/PETSc/petscdmstag.pxi":140 * cdef PetscInt dim = PETSC_DECIDE * cdef object M=None, N=None, P=None * dims = tuple(dims) # <<<<<<<<<<<<<< * dim = len(dims) * if dim == 0: pass */ __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_dims); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_dims, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscdmstag.pxi":141 * cdef object M=None, N=None, P=None * dims = tuple(dims) * dim = len(dims) # <<<<<<<<<<<<<< * if dim == 0: pass * elif dim == 1: M, = dims */ __pyx_t_2 = PyObject_Length(__pyx_v_dims); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(27, 141, __pyx_L1_error) __pyx_v_dim = ((PetscInt)__pyx_t_2); /* "petsc4py/PETSc/petscdmstag.pxi":142 * dims = tuple(dims) * dim = len(dims) * if dim == 0: pass # <<<<<<<<<<<<<< * elif dim == 1: M, = dims * elif dim == 2: M, N = dims */ __pyx_t_3 = (__pyx_v_dim == 0); if (__pyx_t_3) { goto __pyx_L3; } /* "petsc4py/PETSc/petscdmstag.pxi":143 * dim = len(dims) * if dim == 0: pass * elif dim == 1: M, = dims # <<<<<<<<<<<<<< * elif dim == 2: M, N = dims * elif dim == 3: M, N, P = dims */ __pyx_t_3 = (__pyx_v_dim == 1); if (__pyx_t_3) { if ((likely(PyTuple_CheckExact(__pyx_v_dims))) || (PyList_CheckExact(__pyx_v_dims))) { PyObject* sequence = __pyx_v_dims; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 1)) { if (size > 1) __Pyx_RaiseTooManyValuesError(1); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(27, 143, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); } __Pyx_INCREF(__pyx_t_1); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { Py_ssize_t index = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_dims); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); index = 0; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 1) < 0) __PYX_ERR(27, 143, __pyx_L1_error) __pyx_t_5 = NULL; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L5_unpacking_done; __pyx_L4_unpacking_failed:; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(27, 143, __pyx_L1_error) __pyx_L5_unpacking_done:; } __Pyx_DECREF_SET(__pyx_v_M, __pyx_t_1); __pyx_t_1 = 0; goto __pyx_L3; } /* "petsc4py/PETSc/petscdmstag.pxi":144 * if dim == 0: pass * elif dim == 1: M, = dims * elif dim == 2: M, N = dims # <<<<<<<<<<<<<< * elif dim == 3: M, N, P = dims * if dim >= 1: _M[0] = asInt(M) */ __pyx_t_3 = (__pyx_v_dim == 2); if (__pyx_t_3) { if ((likely(PyTuple_CheckExact(__pyx_v_dims))) || (PyList_CheckExact(__pyx_v_dims))) { PyObject* sequence = __pyx_v_dims; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(27, 144, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_dims); if (unlikely(!__pyx_t_6)) __PYX_ERR(27, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); index = 0; __pyx_t_1 = __pyx_t_5(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_4 = __pyx_t_5(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_6), 2) < 0) __PYX_ERR(27, 144, __pyx_L1_error) __pyx_t_5 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L7_unpacking_done; __pyx_L6_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_5 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(27, 144, __pyx_L1_error) __pyx_L7_unpacking_done:; } __Pyx_DECREF_SET(__pyx_v_M, __pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_N, __pyx_t_4); __pyx_t_4 = 0; goto __pyx_L3; } /* "petsc4py/PETSc/petscdmstag.pxi":145 * elif dim == 1: M, = dims * elif dim == 2: M, N = dims * elif dim == 3: M, N, P = dims # <<<<<<<<<<<<<< * if dim >= 1: _M[0] = asInt(M) * if dim >= 2: _N[0] = asInt(N) */ __pyx_t_3 = (__pyx_v_dim == 3); if (__pyx_t_3) { if ((likely(PyTuple_CheckExact(__pyx_v_dims))) || (PyList_CheckExact(__pyx_v_dims))) { PyObject* sequence = __pyx_v_dims; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(27, 145, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_4 = PyList_GET_ITEM(sequence, 0); __pyx_t_1 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(27, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_dims); if (unlikely(!__pyx_t_7)) __PYX_ERR(27, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); index = 0; __pyx_t_4 = __pyx_t_5(__pyx_t_7); if (unlikely(!__pyx_t_4)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 1; __pyx_t_1 = __pyx_t_5(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 2; __pyx_t_6 = __pyx_t_5(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_7), 3) < 0) __PYX_ERR(27, 145, __pyx_L1_error) __pyx_t_5 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_5 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(27, 145, __pyx_L1_error) __pyx_L9_unpacking_done:; } __Pyx_DECREF_SET(__pyx_v_M, __pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_N, __pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_P, __pyx_t_6); __pyx_t_6 = 0; } __pyx_L3:; /* "petsc4py/PETSc/petscdmstag.pxi":146 * elif dim == 2: M, N = dims * elif dim == 3: M, N, P = dims * if dim >= 1: _M[0] = asInt(M) # <<<<<<<<<<<<<< * if dim >= 2: _N[0] = asInt(N) * if dim >= 3: _P[0] = asInt(P) */ __pyx_t_3 = (__pyx_v_dim >= 1); if (__pyx_t_3) { __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_M); if (unlikely(__pyx_t_8 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(27, 146, __pyx_L1_error) (__pyx_v__M[0]) = __pyx_t_8; } /* "petsc4py/PETSc/petscdmstag.pxi":147 * elif dim == 3: M, N, P = dims * if dim >= 1: _M[0] = asInt(M) * if dim >= 2: _N[0] = asInt(N) # <<<<<<<<<<<<<< * if dim >= 3: _P[0] = asInt(P) * return dim */ __pyx_t_3 = (__pyx_v_dim >= 2); if (__pyx_t_3) { __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_N); if (unlikely(__pyx_t_8 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(27, 147, __pyx_L1_error) (__pyx_v__N[0]) = __pyx_t_8; } /* "petsc4py/PETSc/petscdmstag.pxi":148 * if dim >= 1: _M[0] = asInt(M) * if dim >= 2: _N[0] = asInt(N) * if dim >= 3: _P[0] = asInt(P) # <<<<<<<<<<<<<< * return dim * */ __pyx_t_3 = (__pyx_v_dim >= 3); if (__pyx_t_3) { __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_P); if (unlikely(__pyx_t_8 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(27, 148, __pyx_L1_error) (__pyx_v__P[0]) = __pyx_t_8; } /* "petsc4py/PETSc/petscdmstag.pxi":149 * if dim >= 2: _N[0] = asInt(N) * if dim >= 3: _P[0] = asInt(P) * return dim # <<<<<<<<<<<<<< * * cdef inline tuple toStagDims(PetscInt dim, */ __pyx_r = __pyx_v_dim; goto __pyx_L0; /* "petsc4py/PETSc/petscdmstag.pxi":134 * * * cdef inline PetscInt asStagDims(dims, # <<<<<<<<<<<<<< * PetscInt *_M, * PetscInt *_N, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.asStagDims", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1L; __pyx_L0:; __Pyx_XDECREF(__pyx_v_M); __Pyx_XDECREF(__pyx_v_N); __Pyx_XDECREF(__pyx_v_P); __Pyx_XDECREF(__pyx_v_dims); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscdmstag.pxi":151 * return dim * * cdef inline tuple toStagDims(PetscInt dim, # <<<<<<<<<<<<<< * PetscInt M, * PetscInt N, */ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toStagDims(PetscInt __pyx_v_dim, PetscInt __pyx_v_M, PetscInt __pyx_v_N, PetscInt __pyx_v_P) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("toStagDims", 1); /* "petsc4py/PETSc/petscdmstag.pxi":155 * PetscInt N, * PetscInt P): * if dim == 0: return () # <<<<<<<<<<<<<< * elif dim == 1: return (toInt(M),) * elif dim == 2: return (toInt(M), toInt(N)) */ __pyx_t_1 = (__pyx_v_dim == 0); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_empty_tuple); __pyx_r = __pyx_empty_tuple; goto __pyx_L0; } /* "petsc4py/PETSc/petscdmstag.pxi":156 * PetscInt P): * if dim == 0: return () * elif dim == 1: return (toInt(M),) # <<<<<<<<<<<<<< * elif dim == 2: return (toInt(M), toInt(N)) * elif dim == 3: return (toInt(M), toInt(N), toInt(P)) */ __pyx_t_1 = (__pyx_v_dim == 1); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_M); if (unlikely(!__pyx_t_2)) __PYX_ERR(27, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(27, 156, __pyx_L1_error); __pyx_t_2 = 0; __pyx_r = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; } /* "petsc4py/PETSc/petscdmstag.pxi":157 * if dim == 0: return () * elif dim == 1: return (toInt(M),) * elif dim == 2: return (toInt(M), toInt(N)) # <<<<<<<<<<<<<< * elif dim == 3: return (toInt(M), toInt(N), toInt(P)) * */ __pyx_t_1 = (__pyx_v_dim == 2); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_M); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_N); if (unlikely(!__pyx_t_2)) __PYX_ERR(27, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(27, 157, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2)) __PYX_ERR(27, 157, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_r = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L0; } /* "petsc4py/PETSc/petscdmstag.pxi":158 * elif dim == 1: return (toInt(M),) * elif dim == 2: return (toInt(M), toInt(N)) * elif dim == 3: return (toInt(M), toInt(N), toInt(P)) # <<<<<<<<<<<<<< * * cdef inline PetscInt asDofs(dofs, */ __pyx_t_1 = (__pyx_v_dim == 3); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_M); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_N); if (unlikely(!__pyx_t_2)) __PYX_ERR(27, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_P); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(27, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4)) __PYX_ERR(27, 158, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2)) __PYX_ERR(27, 158, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3)) __PYX_ERR(27, 158, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L0; } /* "petsc4py/PETSc/petscdmstag.pxi":151 * return dim * * cdef inline tuple toStagDims(PetscInt dim, # <<<<<<<<<<<<<< * PetscInt M, * PetscInt N, */ /* function exit code */ __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.toStagDims", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscdmstag.pxi":160 * elif dim == 3: return (toInt(M), toInt(N), toInt(P)) * * cdef inline PetscInt asDofs(dofs, # <<<<<<<<<<<<<< * PetscInt *_dof0, * PetscInt *_dof1, */ static CYTHON_INLINE PetscInt __pyx_f_8petsc4py_5PETSc_asDofs(PyObject *__pyx_v_dofs, PetscInt *__pyx_v__dof0, PetscInt *__pyx_v__dof1, PetscInt *__pyx_v__dof2, PetscInt *__pyx_v__dof3) { PetscInt __pyx_v_ndofs; PyObject *__pyx_v_dof0 = 0; PyObject *__pyx_v_dof1 = 0; PyObject *__pyx_v_dof2 = 0; PyObject *__pyx_v_dof3 = 0; PetscInt __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *(*__pyx_t_6)(PyObject *); PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PetscInt __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("asDofs", 0); __Pyx_INCREF(__pyx_v_dofs); /* "petsc4py/PETSc/petscdmstag.pxi":165 * PetscInt *_dof2, * PetscInt *_dof3) except? -1: * cdef PetscInt ndofs = PETSC_DECIDE # <<<<<<<<<<<<<< * cdef object dof0=None, dof1=None, dof2=None, dof3=None * dofs = tuple(dofs) */ __pyx_v_ndofs = PETSC_DECIDE; /* "petsc4py/PETSc/petscdmstag.pxi":166 * PetscInt *_dof3) except? -1: * cdef PetscInt ndofs = PETSC_DECIDE * cdef object dof0=None, dof1=None, dof2=None, dof3=None # <<<<<<<<<<<<<< * dofs = tuple(dofs) * ndofs = len(dofs) */ __Pyx_INCREF(Py_None); __pyx_v_dof0 = Py_None; __Pyx_INCREF(Py_None); __pyx_v_dof1 = Py_None; __Pyx_INCREF(Py_None); __pyx_v_dof2 = Py_None; __Pyx_INCREF(Py_None); __pyx_v_dof3 = Py_None; /* "petsc4py/PETSc/petscdmstag.pxi":167 * cdef PetscInt ndofs = PETSC_DECIDE * cdef object dof0=None, dof1=None, dof2=None, dof3=None * dofs = tuple(dofs) # <<<<<<<<<<<<<< * ndofs = len(dofs) * if ndofs == 2: dof0, dof1 = dofs */ __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_dofs); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_dofs, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscdmstag.pxi":168 * cdef object dof0=None, dof1=None, dof2=None, dof3=None * dofs = tuple(dofs) * ndofs = len(dofs) # <<<<<<<<<<<<<< * if ndofs == 2: dof0, dof1 = dofs * elif ndofs == 3: dof0, dof1, dof2 = dofs */ __pyx_t_2 = PyObject_Length(__pyx_v_dofs); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(27, 168, __pyx_L1_error) __pyx_v_ndofs = ((PetscInt)__pyx_t_2); /* "petsc4py/PETSc/petscdmstag.pxi":169 * dofs = tuple(dofs) * ndofs = len(dofs) * if ndofs == 2: dof0, dof1 = dofs # <<<<<<<<<<<<<< * elif ndofs == 3: dof0, dof1, dof2 = dofs * elif ndofs == 4: dof0, dof1, dof2, dof3 = dofs */ __pyx_t_3 = (__pyx_v_ndofs == 2); if (__pyx_t_3) { if ((likely(PyTuple_CheckExact(__pyx_v_dofs))) || (PyList_CheckExact(__pyx_v_dofs))) { PyObject* sequence = __pyx_v_dofs; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(27, 169, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { Py_ssize_t index = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_dofs); if (unlikely(!__pyx_t_5)) __PYX_ERR(27, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); index = 0; __pyx_t_1 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_1)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(27, 169, __pyx_L1_error) __pyx_t_6 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L5_unpacking_done; __pyx_L4_unpacking_failed:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(27, 169, __pyx_L1_error) __pyx_L5_unpacking_done:; } __Pyx_DECREF_SET(__pyx_v_dof0, __pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_dof1, __pyx_t_4); __pyx_t_4 = 0; goto __pyx_L3; } /* "petsc4py/PETSc/petscdmstag.pxi":170 * ndofs = len(dofs) * if ndofs == 2: dof0, dof1 = dofs * elif ndofs == 3: dof0, dof1, dof2 = dofs # <<<<<<<<<<<<<< * elif ndofs == 4: dof0, dof1, dof2, dof3 = dofs * if ndofs >= 2: _dof0[0] = asInt(dof0) */ __pyx_t_3 = (__pyx_v_ndofs == 3); if (__pyx_t_3) { if ((likely(PyTuple_CheckExact(__pyx_v_dofs))) || (PyList_CheckExact(__pyx_v_dofs))) { PyObject* sequence = __pyx_v_dofs; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(27, 170, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_4 = PyList_GET_ITEM(sequence, 0); __pyx_t_1 = PyList_GET_ITEM(sequence, 1); __pyx_t_5 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(27, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_dofs); if (unlikely(!__pyx_t_7)) __PYX_ERR(27, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); index = 0; __pyx_t_4 = __pyx_t_6(__pyx_t_7); if (unlikely(!__pyx_t_4)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 1; __pyx_t_1 = __pyx_t_6(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 2; __pyx_t_5 = __pyx_t_6(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_7), 3) < 0) __PYX_ERR(27, 170, __pyx_L1_error) __pyx_t_6 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L7_unpacking_done; __pyx_L6_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_6 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(27, 170, __pyx_L1_error) __pyx_L7_unpacking_done:; } __Pyx_DECREF_SET(__pyx_v_dof0, __pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_dof1, __pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_dof2, __pyx_t_5); __pyx_t_5 = 0; goto __pyx_L3; } /* "petsc4py/PETSc/petscdmstag.pxi":171 * if ndofs == 2: dof0, dof1 = dofs * elif ndofs == 3: dof0, dof1, dof2 = dofs * elif ndofs == 4: dof0, dof1, dof2, dof3 = dofs # <<<<<<<<<<<<<< * if ndofs >= 2: _dof0[0] = asInt(dof0) * if ndofs >= 2: _dof1[0] = asInt(dof1) */ __pyx_t_3 = (__pyx_v_ndofs == 4); if (__pyx_t_3) { if ((likely(PyTuple_CheckExact(__pyx_v_dofs))) || (PyList_CheckExact(__pyx_v_dofs))) { PyObject* sequence = __pyx_v_dofs; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 4)) { if (size > 4) __Pyx_RaiseTooManyValuesError(4); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(27, 171, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_7 = PyTuple_GET_ITEM(sequence, 3); } else { __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_1 = PyList_GET_ITEM(sequence, 1); __pyx_t_4 = PyList_GET_ITEM(sequence, 2); __pyx_t_7 = PyList_GET_ITEM(sequence, 3); } __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_7); #else { Py_ssize_t i; PyObject** temps[4] = {&__pyx_t_5,&__pyx_t_1,&__pyx_t_4,&__pyx_t_7}; for (i=0; i < 4; i++) { PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(27, 171, __pyx_L1_error) __Pyx_GOTREF(item); *(temps[i]) = item; } } #endif } else { Py_ssize_t index = -1; PyObject** temps[4] = {&__pyx_t_5,&__pyx_t_1,&__pyx_t_4,&__pyx_t_7}; __pyx_t_8 = PyObject_GetIter(__pyx_v_dofs); if (unlikely(!__pyx_t_8)) __PYX_ERR(27, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); for (index=0; index < 4; index++) { PyObject* item = __pyx_t_6(__pyx_t_8); if (unlikely(!item)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(item); *(temps[index]) = item; } if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_8), 4) < 0) __PYX_ERR(27, 171, __pyx_L1_error) __pyx_t_6 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_6 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(27, 171, __pyx_L1_error) __pyx_L9_unpacking_done:; } __Pyx_DECREF_SET(__pyx_v_dof0, __pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_dof1, __pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_dof2, __pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_dof3, __pyx_t_7); __pyx_t_7 = 0; } __pyx_L3:; /* "petsc4py/PETSc/petscdmstag.pxi":172 * elif ndofs == 3: dof0, dof1, dof2 = dofs * elif ndofs == 4: dof0, dof1, dof2, dof3 = dofs * if ndofs >= 2: _dof0[0] = asInt(dof0) # <<<<<<<<<<<<<< * if ndofs >= 2: _dof1[0] = asInt(dof1) * if ndofs >= 3: _dof2[0] = asInt(dof2) */ __pyx_t_3 = (__pyx_v_ndofs >= 2); if (__pyx_t_3) { __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_dof0); if (unlikely(__pyx_t_9 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(27, 172, __pyx_L1_error) (__pyx_v__dof0[0]) = __pyx_t_9; } /* "petsc4py/PETSc/petscdmstag.pxi":173 * elif ndofs == 4: dof0, dof1, dof2, dof3 = dofs * if ndofs >= 2: _dof0[0] = asInt(dof0) * if ndofs >= 2: _dof1[0] = asInt(dof1) # <<<<<<<<<<<<<< * if ndofs >= 3: _dof2[0] = asInt(dof2) * if ndofs >= 4: _dof3[0] = asInt(dof3) */ __pyx_t_3 = (__pyx_v_ndofs >= 2); if (__pyx_t_3) { __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_dof1); if (unlikely(__pyx_t_9 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(27, 173, __pyx_L1_error) (__pyx_v__dof1[0]) = __pyx_t_9; } /* "petsc4py/PETSc/petscdmstag.pxi":174 * if ndofs >= 2: _dof0[0] = asInt(dof0) * if ndofs >= 2: _dof1[0] = asInt(dof1) * if ndofs >= 3: _dof2[0] = asInt(dof2) # <<<<<<<<<<<<<< * if ndofs >= 4: _dof3[0] = asInt(dof3) * return ndofs */ __pyx_t_3 = (__pyx_v_ndofs >= 3); if (__pyx_t_3) { __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_dof2); if (unlikely(__pyx_t_9 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(27, 174, __pyx_L1_error) (__pyx_v__dof2[0]) = __pyx_t_9; } /* "petsc4py/PETSc/petscdmstag.pxi":175 * if ndofs >= 2: _dof1[0] = asInt(dof1) * if ndofs >= 3: _dof2[0] = asInt(dof2) * if ndofs >= 4: _dof3[0] = asInt(dof3) # <<<<<<<<<<<<<< * return ndofs * */ __pyx_t_3 = (__pyx_v_ndofs >= 4); if (__pyx_t_3) { __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_dof3); if (unlikely(__pyx_t_9 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(27, 175, __pyx_L1_error) (__pyx_v__dof3[0]) = __pyx_t_9; } /* "petsc4py/PETSc/petscdmstag.pxi":176 * if ndofs >= 3: _dof2[0] = asInt(dof2) * if ndofs >= 4: _dof3[0] = asInt(dof3) * return ndofs # <<<<<<<<<<<<<< * * cdef inline tuple toDofs(PetscInt ndofs, */ __pyx_r = __pyx_v_ndofs; goto __pyx_L0; /* "petsc4py/PETSc/petscdmstag.pxi":160 * elif dim == 3: return (toInt(M), toInt(N), toInt(P)) * * cdef inline PetscInt asDofs(dofs, # <<<<<<<<<<<<<< * PetscInt *_dof0, * PetscInt *_dof1, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("petsc4py.PETSc.asDofs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1L; __pyx_L0:; __Pyx_XDECREF(__pyx_v_dof0); __Pyx_XDECREF(__pyx_v_dof1); __Pyx_XDECREF(__pyx_v_dof2); __Pyx_XDECREF(__pyx_v_dof3); __Pyx_XDECREF(__pyx_v_dofs); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscdmstag.pxi":178 * return ndofs * * cdef inline tuple toDofs(PetscInt ndofs, # <<<<<<<<<<<<<< * PetscInt dof0, * PetscInt dof1, */ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toDofs(PetscInt __pyx_v_ndofs, PetscInt __pyx_v_dof0, PetscInt __pyx_v_dof1, PetscInt __pyx_v_dof2, PetscInt __pyx_v_dof3) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("toDofs", 1); /* "petsc4py/PETSc/petscdmstag.pxi":183 * PetscInt dof2, * PetscInt dof3): * if ndofs == 2: return (toInt(dof0), toInt(dof1)) # <<<<<<<<<<<<<< * elif ndofs == 3: return (toInt(dof0), toInt(dof1), toInt(dof2)) * elif ndofs == 4: return (toInt(dof0), toInt(dof1), toInt(dof2), toInt(dof3)) */ __pyx_t_1 = (__pyx_v_ndofs == 2); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_dof0); if (unlikely(!__pyx_t_2)) __PYX_ERR(27, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_dof1); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(27, 183, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(27, 183, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L0; } /* "petsc4py/PETSc/petscdmstag.pxi":184 * PetscInt dof3): * if ndofs == 2: return (toInt(dof0), toInt(dof1)) * elif ndofs == 3: return (toInt(dof0), toInt(dof1), toInt(dof2)) # <<<<<<<<<<<<<< * elif ndofs == 4: return (toInt(dof0), toInt(dof1), toInt(dof2), toInt(dof3)) * */ __pyx_t_1 = (__pyx_v_ndofs == 3); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_dof0); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_dof1); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_dof2); if (unlikely(!__pyx_t_2)) __PYX_ERR(27, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(27, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4)) __PYX_ERR(27, 184, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3)) __PYX_ERR(27, 184, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_2)) __PYX_ERR(27, 184, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_r = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L0; } /* "petsc4py/PETSc/petscdmstag.pxi":185 * if ndofs == 2: return (toInt(dof0), toInt(dof1)) * elif ndofs == 3: return (toInt(dof0), toInt(dof1), toInt(dof2)) * elif ndofs == 4: return (toInt(dof0), toInt(dof1), toInt(dof2), toInt(dof3)) # <<<<<<<<<<<<<< * * cdef inline tuple asStagOwnershipRanges(object ownership_ranges, */ __pyx_t_1 = (__pyx_v_ndofs == 4); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_dof0); if (unlikely(!__pyx_t_5)) __PYX_ERR(27, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_dof1); if (unlikely(!__pyx_t_2)) __PYX_ERR(27, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_dof2); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_dof3); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(27, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5)) __PYX_ERR(27, 185, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2)) __PYX_ERR(27, 185, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_3)) __PYX_ERR(27, 185, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_4)) __PYX_ERR(27, 185, __pyx_L1_error); __pyx_t_5 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_r = ((PyObject*)__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L0; } /* "petsc4py/PETSc/petscdmstag.pxi":178 * return ndofs * * cdef inline tuple toDofs(PetscInt ndofs, # <<<<<<<<<<<<<< * PetscInt dof0, * PetscInt dof1, */ /* function exit code */ __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.toDofs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscdmstag.pxi":187 * elif ndofs == 4: return (toInt(dof0), toInt(dof1), toInt(dof2), toInt(dof3)) * * cdef inline tuple asStagOwnershipRanges(object ownership_ranges, # <<<<<<<<<<<<<< * PetscInt dim, * PetscInt *m, PetscInt *n, PetscInt *p, */ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_asStagOwnershipRanges(PyObject *__pyx_v_ownership_ranges, PetscInt __pyx_v_dim, PetscInt *__pyx_v_m, PetscInt *__pyx_v_n, PetscInt *__pyx_v_p, PetscInt **__pyx_v__x, PetscInt **__pyx_v__y, PetscInt **__pyx_v__z) { PyObject *__pyx_v_ranges = 0; PetscInt __pyx_v_rdim; PetscInt __pyx_v_nlx; PetscInt __pyx_v_nly; PetscInt __pyx_v_nlz; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("asStagOwnershipRanges", 1); /* "petsc4py/PETSc/petscdmstag.pxi":193 * PetscInt **_y, * PetscInt **_z): * cdef object ranges = list(ownership_ranges) # <<<<<<<<<<<<<< * cdef PetscInt rdim = len(ranges) * cdef PetscInt nlx=0, nly=0, nlz=0 */ __pyx_t_1 = PySequence_List(__pyx_v_ownership_ranges); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ranges = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/petscdmstag.pxi":194 * PetscInt **_z): * cdef object ranges = list(ownership_ranges) * cdef PetscInt rdim = len(ranges) # <<<<<<<<<<<<<< * cdef PetscInt nlx=0, nly=0, nlz=0 * if dim == PETSC_DECIDE: dim = rdim */ __pyx_t_2 = PyObject_Length(__pyx_v_ranges); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(27, 194, __pyx_L1_error) __pyx_v_rdim = ((PetscInt)__pyx_t_2); /* "petsc4py/PETSc/petscdmstag.pxi":195 * cdef object ranges = list(ownership_ranges) * cdef PetscInt rdim = len(ranges) * cdef PetscInt nlx=0, nly=0, nlz=0 # <<<<<<<<<<<<<< * if dim == PETSC_DECIDE: dim = rdim * elif dim != rdim: raise ValueError( */ __pyx_v_nlx = 0; __pyx_v_nly = 0; __pyx_v_nlz = 0; /* "petsc4py/PETSc/petscdmstag.pxi":196 * cdef PetscInt rdim = len(ranges) * cdef PetscInt nlx=0, nly=0, nlz=0 * if dim == PETSC_DECIDE: dim = rdim # <<<<<<<<<<<<<< * elif dim != rdim: raise ValueError( * "number of dimensions %d and number ownership ranges %d" % */ __pyx_t_3 = (__pyx_v_dim == PETSC_DECIDE); if (__pyx_t_3) { __pyx_v_dim = __pyx_v_rdim; goto __pyx_L3; } /* "petsc4py/PETSc/petscdmstag.pxi":197 * cdef PetscInt nlx=0, nly=0, nlz=0 * if dim == PETSC_DECIDE: dim = rdim * elif dim != rdim: raise ValueError( # <<<<<<<<<<<<<< * "number of dimensions %d and number ownership ranges %d" % * (toInt(dim), toInt(rdim))) */ __pyx_t_3 = (__pyx_v_dim != __pyx_v_rdim); if (unlikely(__pyx_t_3)) { /* "petsc4py/PETSc/petscdmstag.pxi":199 * elif dim != rdim: raise ValueError( * "number of dimensions %d and number ownership ranges %d" % * (toInt(dim), toInt(rdim))) # <<<<<<<<<<<<<< * if dim >= 1: * ranges[0] = iarray_i(ranges[0], &nlx, _x) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_dim); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_rdim); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(27, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1)) __PYX_ERR(27, 199, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4)) __PYX_ERR(27, 199, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_4 = 0; /* "petsc4py/PETSc/petscdmstag.pxi":198 * if dim == PETSC_DECIDE: dim = rdim * elif dim != rdim: raise ValueError( * "number of dimensions %d and number ownership ranges %d" % # <<<<<<<<<<<<<< * (toInt(dim), toInt(rdim))) * if dim >= 1: */ __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_number_of_dimensions_d_and_numbe, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/petscdmstag.pxi":197 * cdef PetscInt nlx=0, nly=0, nlz=0 * if dim == PETSC_DECIDE: dim = rdim * elif dim != rdim: raise ValueError( # <<<<<<<<<<<<<< * "number of dimensions %d and number ownership ranges %d" % * (toInt(dim), toInt(rdim))) */ __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(27, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(27, 197, __pyx_L1_error) } __pyx_L3:; /* "petsc4py/PETSc/petscdmstag.pxi":200 * "number of dimensions %d and number ownership ranges %d" % * (toInt(dim), toInt(rdim))) * if dim >= 1: # <<<<<<<<<<<<<< * ranges[0] = iarray_i(ranges[0], &nlx, _x) * if m[0] == PETSC_DECIDE: m[0] = nlx */ __pyx_t_3 = (__pyx_v_dim >= 1); if (__pyx_t_3) { /* "petsc4py/PETSc/petscdmstag.pxi":201 * (toInt(dim), toInt(rdim))) * if dim >= 1: * ranges[0] = iarray_i(ranges[0], &nlx, _x) # <<<<<<<<<<<<<< * if m[0] == PETSC_DECIDE: m[0] = nlx * elif m[0] != nlx: raise ValueError( */ __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_ranges, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(27, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_t_5, (&__pyx_v_nlx), __pyx_v__x)); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely((__Pyx_SetItemInt(__pyx_v_ranges, 0, __pyx_t_4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0))) __PYX_ERR(27, 201, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/petscdmstag.pxi":202 * if dim >= 1: * ranges[0] = iarray_i(ranges[0], &nlx, _x) * if m[0] == PETSC_DECIDE: m[0] = nlx # <<<<<<<<<<<<<< * elif m[0] != nlx: raise ValueError( * "ownership range size %d and number or processors %d" % */ __pyx_t_3 = ((__pyx_v_m[0]) == PETSC_DECIDE); if (__pyx_t_3) { (__pyx_v_m[0]) = __pyx_v_nlx; goto __pyx_L5; } /* "petsc4py/PETSc/petscdmstag.pxi":203 * ranges[0] = iarray_i(ranges[0], &nlx, _x) * if m[0] == PETSC_DECIDE: m[0] = nlx * elif m[0] != nlx: raise ValueError( # <<<<<<<<<<<<<< * "ownership range size %d and number or processors %d" % * (toInt(nlx), toInt(m[0]))) */ __pyx_t_3 = ((__pyx_v_m[0]) != __pyx_v_nlx); if (unlikely(__pyx_t_3)) { /* "petsc4py/PETSc/petscdmstag.pxi":205 * elif m[0] != nlx: raise ValueError( * "ownership range size %d and number or processors %d" % * (toInt(nlx), toInt(m[0]))) # <<<<<<<<<<<<<< * if dim >= 2: * ranges[1] = iarray_i(ranges[1], &nly, _y) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nlx); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_m[0])); if (unlikely(!__pyx_t_5)) __PYX_ERR(27, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4)) __PYX_ERR(27, 205, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5)) __PYX_ERR(27, 205, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_5 = 0; /* "petsc4py/PETSc/petscdmstag.pxi":204 * if m[0] == PETSC_DECIDE: m[0] = nlx * elif m[0] != nlx: raise ValueError( * "ownership range size %d and number or processors %d" % # <<<<<<<<<<<<<< * (toInt(nlx), toInt(m[0]))) * if dim >= 2: */ __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_ownership_range_size_d_and_numbe, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(27, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscdmstag.pxi":203 * ranges[0] = iarray_i(ranges[0], &nlx, _x) * if m[0] == PETSC_DECIDE: m[0] = nlx * elif m[0] != nlx: raise ValueError( # <<<<<<<<<<<<<< * "ownership range size %d and number or processors %d" % * (toInt(nlx), toInt(m[0]))) */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(27, 203, __pyx_L1_error) } __pyx_L5:; /* "petsc4py/PETSc/petscdmstag.pxi":200 * "number of dimensions %d and number ownership ranges %d" % * (toInt(dim), toInt(rdim))) * if dim >= 1: # <<<<<<<<<<<<<< * ranges[0] = iarray_i(ranges[0], &nlx, _x) * if m[0] == PETSC_DECIDE: m[0] = nlx */ } /* "petsc4py/PETSc/petscdmstag.pxi":206 * "ownership range size %d and number or processors %d" % * (toInt(nlx), toInt(m[0]))) * if dim >= 2: # <<<<<<<<<<<<<< * ranges[1] = iarray_i(ranges[1], &nly, _y) * if n[0] == PETSC_DECIDE: n[0] = nly */ __pyx_t_3 = (__pyx_v_dim >= 2); if (__pyx_t_3) { /* "petsc4py/PETSc/petscdmstag.pxi":207 * (toInt(nlx), toInt(m[0]))) * if dim >= 2: * ranges[1] = iarray_i(ranges[1], &nly, _y) # <<<<<<<<<<<<<< * if n[0] == PETSC_DECIDE: n[0] = nly * elif n[0] != nly: raise ValueError( */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_ranges, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_t_1, (&__pyx_v_nly), __pyx_v__y)); if (unlikely(!__pyx_t_5)) __PYX_ERR(27, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely((__Pyx_SetItemInt(__pyx_v_ranges, 1, __pyx_t_5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0))) __PYX_ERR(27, 207, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/petscdmstag.pxi":208 * if dim >= 2: * ranges[1] = iarray_i(ranges[1], &nly, _y) * if n[0] == PETSC_DECIDE: n[0] = nly # <<<<<<<<<<<<<< * elif n[0] != nly: raise ValueError( * "ownership range size %d and number or processors %d" % */ __pyx_t_3 = ((__pyx_v_n[0]) == PETSC_DECIDE); if (__pyx_t_3) { (__pyx_v_n[0]) = __pyx_v_nly; goto __pyx_L7; } /* "petsc4py/PETSc/petscdmstag.pxi":209 * ranges[1] = iarray_i(ranges[1], &nly, _y) * if n[0] == PETSC_DECIDE: n[0] = nly * elif n[0] != nly: raise ValueError( # <<<<<<<<<<<<<< * "ownership range size %d and number or processors %d" % * (toInt(nly), toInt(n[0]))) */ __pyx_t_3 = ((__pyx_v_n[0]) != __pyx_v_nly); if (unlikely(__pyx_t_3)) { /* "petsc4py/PETSc/petscdmstag.pxi":211 * elif n[0] != nly: raise ValueError( * "ownership range size %d and number or processors %d" % * (toInt(nly), toInt(n[0]))) # <<<<<<<<<<<<<< * if dim >= 3: * ranges[2] = iarray_i(ranges[2], &nlz, _z) */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nly); if (unlikely(!__pyx_t_5)) __PYX_ERR(27, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_n[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5)) __PYX_ERR(27, 211, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(27, 211, __pyx_L1_error); __pyx_t_5 = 0; __pyx_t_1 = 0; /* "petsc4py/PETSc/petscdmstag.pxi":210 * if n[0] == PETSC_DECIDE: n[0] = nly * elif n[0] != nly: raise ValueError( * "ownership range size %d and number or processors %d" % # <<<<<<<<<<<<<< * (toInt(nly), toInt(n[0]))) * if dim >= 3: */ __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_ownership_range_size_d_and_numbe, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/petscdmstag.pxi":209 * ranges[1] = iarray_i(ranges[1], &nly, _y) * if n[0] == PETSC_DECIDE: n[0] = nly * elif n[0] != nly: raise ValueError( # <<<<<<<<<<<<<< * "ownership range size %d and number or processors %d" % * (toInt(nly), toInt(n[0]))) */ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(27, 209, __pyx_L1_error) } __pyx_L7:; /* "petsc4py/PETSc/petscdmstag.pxi":206 * "ownership range size %d and number or processors %d" % * (toInt(nlx), toInt(m[0]))) * if dim >= 2: # <<<<<<<<<<<<<< * ranges[1] = iarray_i(ranges[1], &nly, _y) * if n[0] == PETSC_DECIDE: n[0] = nly */ } /* "petsc4py/PETSc/petscdmstag.pxi":212 * "ownership range size %d and number or processors %d" % * (toInt(nly), toInt(n[0]))) * if dim >= 3: # <<<<<<<<<<<<<< * ranges[2] = iarray_i(ranges[2], &nlz, _z) * if p[0] == PETSC_DECIDE: p[0] = nlz */ __pyx_t_3 = (__pyx_v_dim >= 3); if (__pyx_t_3) { /* "petsc4py/PETSc/petscdmstag.pxi":213 * (toInt(nly), toInt(n[0]))) * if dim >= 3: * ranges[2] = iarray_i(ranges[2], &nlz, _z) # <<<<<<<<<<<<<< * if p[0] == PETSC_DECIDE: p[0] = nlz * elif p[0] != nlz: raise ValueError( */ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_ranges, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_t_4, (&__pyx_v_nlz), __pyx_v__z)); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely((__Pyx_SetItemInt(__pyx_v_ranges, 2, __pyx_t_1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0))) __PYX_ERR(27, 213, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscdmstag.pxi":214 * if dim >= 3: * ranges[2] = iarray_i(ranges[2], &nlz, _z) * if p[0] == PETSC_DECIDE: p[0] = nlz # <<<<<<<<<<<<<< * elif p[0] != nlz: raise ValueError( * "ownership range size %d and number or processors %d" % */ __pyx_t_3 = ((__pyx_v_p[0]) == PETSC_DECIDE); if (__pyx_t_3) { (__pyx_v_p[0]) = __pyx_v_nlz; goto __pyx_L9; } /* "petsc4py/PETSc/petscdmstag.pxi":215 * ranges[2] = iarray_i(ranges[2], &nlz, _z) * if p[0] == PETSC_DECIDE: p[0] = nlz * elif p[0] != nlz: raise ValueError( # <<<<<<<<<<<<<< * "ownership range size %d and number or processors %d" % * (toInt(nlz), toInt(p[0]))) */ __pyx_t_3 = ((__pyx_v_p[0]) != __pyx_v_nlz); if (unlikely(__pyx_t_3)) { /* "petsc4py/PETSc/petscdmstag.pxi":217 * elif p[0] != nlz: raise ValueError( * "ownership range size %d and number or processors %d" % * (toInt(nlz), toInt(p[0]))) # <<<<<<<<<<<<<< * return tuple(ranges) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nlz); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_p[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(27, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1)) __PYX_ERR(27, 217, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4)) __PYX_ERR(27, 217, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_4 = 0; /* "petsc4py/PETSc/petscdmstag.pxi":216 * if p[0] == PETSC_DECIDE: p[0] = nlz * elif p[0] != nlz: raise ValueError( * "ownership range size %d and number or processors %d" % # <<<<<<<<<<<<<< * (toInt(nlz), toInt(p[0]))) * return tuple(ranges) */ __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_ownership_range_size_d_and_numbe, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/petscdmstag.pxi":215 * ranges[2] = iarray_i(ranges[2], &nlz, _z) * if p[0] == PETSC_DECIDE: p[0] = nlz * elif p[0] != nlz: raise ValueError( # <<<<<<<<<<<<<< * "ownership range size %d and number or processors %d" % * (toInt(nlz), toInt(p[0]))) */ __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(27, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(27, 215, __pyx_L1_error) } __pyx_L9:; /* "petsc4py/PETSc/petscdmstag.pxi":212 * "ownership range size %d and number or processors %d" % * (toInt(nly), toInt(n[0]))) * if dim >= 3: # <<<<<<<<<<<<<< * ranges[2] = iarray_i(ranges[2], &nlz, _z) * if p[0] == PETSC_DECIDE: p[0] = nlz */ } /* "petsc4py/PETSc/petscdmstag.pxi":218 * "ownership range size %d and number or processors %d" % * (toInt(nlz), toInt(p[0]))) * return tuple(ranges) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_ranges); if (unlikely(!__pyx_t_5)) __PYX_ERR(27, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_r = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L0; /* "petsc4py/PETSc/petscdmstag.pxi":187 * elif ndofs == 4: return (toInt(dof0), toInt(dof1), toInt(dof2), toInt(dof3)) * * cdef inline tuple asStagOwnershipRanges(object ownership_ranges, # <<<<<<<<<<<<<< * PetscInt dim, * PetscInt *m, PetscInt *n, PetscInt *p, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.asStagOwnershipRanges", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ranges); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscdmstag.pxi":221 * * * cdef inline tuple toStagOwnershipRanges(PetscInt dim, # <<<<<<<<<<<<<< * PetscInt m, PetscInt n, PetscInt p, * const PetscInt *lx, */ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toStagOwnershipRanges(PetscInt __pyx_v_dim, PetscInt __pyx_v_m, PetscInt __pyx_v_n, PetscInt __pyx_v_p, PetscInt const *__pyx_v_lx, PetscInt const *__pyx_v_ly, PetscInt const *__pyx_v_lz) { PyObject *__pyx_v_ranges = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("toStagOwnershipRanges", 1); /* "petsc4py/PETSc/petscdmstag.pxi":227 * const PetscInt *lz): * # Returns tuple of arrays containing ownership ranges as Python arrays * ranges = [array_i(m, lx)] # <<<<<<<<<<<<<< * if dim > 1: * ranges.append(array_i(n, ly)) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i(__pyx_v_m, __pyx_v_lx)); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(27, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(27, 227, __pyx_L1_error); __pyx_t_1 = 0; __pyx_v_ranges = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscdmstag.pxi":228 * # Returns tuple of arrays containing ownership ranges as Python arrays * ranges = [array_i(m, lx)] * if dim > 1: # <<<<<<<<<<<<<< * ranges.append(array_i(n, ly)) * if dim > 2: */ __pyx_t_3 = (__pyx_v_dim > 1); if (__pyx_t_3) { /* "petsc4py/PETSc/petscdmstag.pxi":229 * ranges = [array_i(m, lx)] * if dim > 1: * ranges.append(array_i(n, ly)) # <<<<<<<<<<<<<< * if dim > 2: * ranges.append(array_i(p, lz)) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i(__pyx_v_n, __pyx_v_ly)); if (unlikely(!__pyx_t_2)) __PYX_ERR(27, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_ranges, __pyx_t_2); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(27, 229, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscdmstag.pxi":228 * # Returns tuple of arrays containing ownership ranges as Python arrays * ranges = [array_i(m, lx)] * if dim > 1: # <<<<<<<<<<<<<< * ranges.append(array_i(n, ly)) * if dim > 2: */ } /* "petsc4py/PETSc/petscdmstag.pxi":230 * if dim > 1: * ranges.append(array_i(n, ly)) * if dim > 2: # <<<<<<<<<<<<<< * ranges.append(array_i(p, lz)) * return tuple(ranges) */ __pyx_t_3 = (__pyx_v_dim > 2); if (__pyx_t_3) { /* "petsc4py/PETSc/petscdmstag.pxi":231 * ranges.append(array_i(n, ly)) * if dim > 2: * ranges.append(array_i(p, lz)) # <<<<<<<<<<<<<< * return tuple(ranges) * */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i(__pyx_v_p, __pyx_v_lz)); if (unlikely(!__pyx_t_2)) __PYX_ERR(27, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_ranges, __pyx_t_2); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(27, 231, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscdmstag.pxi":230 * if dim > 1: * ranges.append(array_i(n, ly)) * if dim > 2: # <<<<<<<<<<<<<< * ranges.append(array_i(p, lz)) * return tuple(ranges) */ } /* "petsc4py/PETSc/petscdmstag.pxi":232 * if dim > 2: * ranges.append(array_i(p, lz)) * return tuple(ranges) # <<<<<<<<<<<<<< * * cdef inline object toStagBoundary(PetscDMBoundaryType btype): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyList_AsTuple(__pyx_v_ranges); if (unlikely(!__pyx_t_2)) __PYX_ERR(27, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/petscdmstag.pxi":221 * * * cdef inline tuple toStagOwnershipRanges(PetscInt dim, # <<<<<<<<<<<<<< * PetscInt m, PetscInt n, PetscInt p, * const PetscInt *lx, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.toStagOwnershipRanges", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ranges); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscdmstag.pxi":234 * return tuple(ranges) * * cdef inline object toStagBoundary(PetscDMBoundaryType btype): # <<<<<<<<<<<<<< * if btype == DM_BOUNDARY_NONE: return "none" * elif btype == DM_BOUNDARY_PERIODIC: return "periodic" */ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toStagBoundary(DMBoundaryType __pyx_v_btype) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("toStagBoundary", 1); /* "petsc4py/PETSc/petscdmstag.pxi":235 * * cdef inline object toStagBoundary(PetscDMBoundaryType btype): * if btype == DM_BOUNDARY_NONE: return "none" # <<<<<<<<<<<<<< * elif btype == DM_BOUNDARY_PERIODIC: return "periodic" * elif btype == DM_BOUNDARY_GHOSTED: return "ghosted" */ __pyx_t_1 = (__pyx_v_btype == DM_BOUNDARY_NONE); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_n_s_none); __pyx_r = __pyx_n_s_none; goto __pyx_L0; } /* "petsc4py/PETSc/petscdmstag.pxi":236 * cdef inline object toStagBoundary(PetscDMBoundaryType btype): * if btype == DM_BOUNDARY_NONE: return "none" * elif btype == DM_BOUNDARY_PERIODIC: return "periodic" # <<<<<<<<<<<<<< * elif btype == DM_BOUNDARY_GHOSTED: return "ghosted" * */ __pyx_t_1 = (__pyx_v_btype == DM_BOUNDARY_PERIODIC); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_n_s_periodic); __pyx_r = __pyx_n_s_periodic; goto __pyx_L0; } /* "petsc4py/PETSc/petscdmstag.pxi":237 * if btype == DM_BOUNDARY_NONE: return "none" * elif btype == DM_BOUNDARY_PERIODIC: return "periodic" * elif btype == DM_BOUNDARY_GHOSTED: return "ghosted" # <<<<<<<<<<<<<< * * cdef inline tuple toStagBoundaryTypes(PetscInt dim, PetscDMBoundaryType btx, PetscDMBoundaryType bty, PetscDMBoundaryType btz): */ __pyx_t_1 = (__pyx_v_btype == DM_BOUNDARY_GHOSTED); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_n_s_ghosted); __pyx_r = __pyx_n_s_ghosted; goto __pyx_L0; } /* "petsc4py/PETSc/petscdmstag.pxi":234 * return tuple(ranges) * * cdef inline object toStagBoundary(PetscDMBoundaryType btype): # <<<<<<<<<<<<<< * if btype == DM_BOUNDARY_NONE: return "none" * elif btype == DM_BOUNDARY_PERIODIC: return "periodic" */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscdmstag.pxi":239 * elif btype == DM_BOUNDARY_GHOSTED: return "ghosted" * * cdef inline tuple toStagBoundaryTypes(PetscInt dim, PetscDMBoundaryType btx, PetscDMBoundaryType bty, PetscDMBoundaryType btz): # <<<<<<<<<<<<<< * if dim == 1: return (toStagBoundary(btx), ) * if dim == 2: return (toStagBoundary(btx), toStagBoundary(bty)) */ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toStagBoundaryTypes(PetscInt __pyx_v_dim, DMBoundaryType __pyx_v_btx, DMBoundaryType __pyx_v_bty, DMBoundaryType __pyx_v_btz) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("toStagBoundaryTypes", 1); /* "petsc4py/PETSc/petscdmstag.pxi":240 * * cdef inline tuple toStagBoundaryTypes(PetscInt dim, PetscDMBoundaryType btx, PetscDMBoundaryType bty, PetscDMBoundaryType btz): * if dim == 1: return (toStagBoundary(btx), ) # <<<<<<<<<<<<<< * if dim == 2: return (toStagBoundary(btx), toStagBoundary(bty)) * if dim == 3: return (toStagBoundary(btx), toStagBoundary(bty), toStagBoundary(btz)) */ __pyx_t_1 = (__pyx_v_dim == 1); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toStagBoundary(__pyx_v_btx); if (unlikely(!__pyx_t_2)) __PYX_ERR(27, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(27, 240, __pyx_L1_error); __pyx_t_2 = 0; __pyx_r = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; } /* "petsc4py/PETSc/petscdmstag.pxi":241 * cdef inline tuple toStagBoundaryTypes(PetscInt dim, PetscDMBoundaryType btx, PetscDMBoundaryType bty, PetscDMBoundaryType btz): * if dim == 1: return (toStagBoundary(btx), ) * if dim == 2: return (toStagBoundary(btx), toStagBoundary(bty)) # <<<<<<<<<<<<<< * if dim == 3: return (toStagBoundary(btx), toStagBoundary(bty), toStagBoundary(btz)) * */ __pyx_t_1 = (__pyx_v_dim == 2); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toStagBoundary(__pyx_v_btx); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toStagBoundary(__pyx_v_bty); if (unlikely(!__pyx_t_2)) __PYX_ERR(27, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(27, 241, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2)) __PYX_ERR(27, 241, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_r = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L0; } /* "petsc4py/PETSc/petscdmstag.pxi":242 * if dim == 1: return (toStagBoundary(btx), ) * if dim == 2: return (toStagBoundary(btx), toStagBoundary(bty)) * if dim == 3: return (toStagBoundary(btx), toStagBoundary(bty), toStagBoundary(btz)) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_t_1 = (__pyx_v_dim == 3); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toStagBoundary(__pyx_v_btx); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toStagBoundary(__pyx_v_bty); if (unlikely(!__pyx_t_2)) __PYX_ERR(27, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toStagBoundary(__pyx_v_btz); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(27, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4)) __PYX_ERR(27, 242, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2)) __PYX_ERR(27, 242, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3)) __PYX_ERR(27, 242, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L0; } /* "petsc4py/PETSc/petscdmstag.pxi":239 * elif btype == DM_BOUNDARY_GHOSTED: return "ghosted" * * cdef inline tuple toStagBoundaryTypes(PetscInt dim, PetscDMBoundaryType btx, PetscDMBoundaryType bty, PetscDMBoundaryType btz): # <<<<<<<<<<<<<< * if dim == 1: return (toStagBoundary(btx), ) * if dim == 2: return (toStagBoundary(btx), toStagBoundary(bty)) */ /* function exit code */ __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.toStagBoundaryTypes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscdmcomposite.pxi":27 * cdef object access * * def __cinit__(self, DM dm, Vec gvec, locs=None): # <<<<<<<<<<<<<< * self.dm = dm.dm * CHKERR( PetscINCREF(&self.dm) ) */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_19_DMComposite_access_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_19_DMComposite_access_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscDMObject *__pyx_v_dm = 0; struct PyPetscVecObject *__pyx_v_gvec = 0; PyObject *__pyx_v_locs = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dm,&__pyx_n_s_gvec,&__pyx_n_s_locs,0}; values[2] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dm)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(28, 27, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gvec)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(28, 27, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(28, 27, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_locs); if (value) { values[2] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(28, 27, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__cinit__") < 0)) __PYX_ERR(28, 27, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_dm = ((struct PyPetscDMObject *)values[0]); __pyx_v_gvec = ((struct PyPetscVecObject *)values[1]); __pyx_v_locs = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, __pyx_nargs); __PYX_ERR(28, 27, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc._DMComposite_access.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_ptype_8petsc4py_5PETSc_DM, 0, "dm", 0))) __PYX_ERR(28, 27, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gvec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "gvec", 0))) __PYX_ERR(28, 27, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_19_DMComposite_access___cinit__(((struct __pyx_obj_8petsc4py_5PETSc__DMComposite_access *)__pyx_v_self), __pyx_v_dm, __pyx_v_gvec, __pyx_v_locs); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = -1; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_19_DMComposite_access___cinit__(struct __pyx_obj_8petsc4py_5PETSc__DMComposite_access *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm, struct PyPetscVecObject *__pyx_v_gvec, PyObject *__pyx_v_locs) { int __pyx_r; __Pyx_RefNannyDeclarations DM __pyx_t_1; PetscErrorCode __pyx_t_2; Vec __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); __Pyx_INCREF(__pyx_v_locs); /* "petsc4py/PETSc/petscdmcomposite.pxi":28 * * def __cinit__(self, DM dm, Vec gvec, locs=None): * self.dm = dm.dm # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(&self.dm) ) * self.gvec = gvec.vec */ __pyx_t_1 = __pyx_v_dm->dm; __pyx_v_self->dm = __pyx_t_1; /* "petsc4py/PETSc/petscdmcomposite.pxi":29 * def __cinit__(self, DM dm, Vec gvec, locs=None): * self.dm = dm.dm * CHKERR( PetscINCREF(&self.dm) ) # <<<<<<<<<<<<<< * self.gvec = gvec.vec * CHKERR( PetscINCREF(&self.gvec) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(((PetscObject *)(&__pyx_v_self->dm)))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(28, 29, __pyx_L1_error) /* "petsc4py/PETSc/petscdmcomposite.pxi":30 * self.dm = dm.dm * CHKERR( PetscINCREF(&self.dm) ) * self.gvec = gvec.vec # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(&self.gvec) ) * if locs is None: */ __pyx_t_3 = __pyx_v_gvec->vec; __pyx_v_self->gvec = __pyx_t_3; /* "petsc4py/PETSc/petscdmcomposite.pxi":31 * CHKERR( PetscINCREF(&self.dm) ) * self.gvec = gvec.vec * CHKERR( PetscINCREF(&self.gvec) ) # <<<<<<<<<<<<<< * if locs is None: * CHKERR( DMCompositeGetNumberDM(self.dm, &self.nlocs) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(((PetscObject *)(&__pyx_v_self->gvec)))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(28, 31, __pyx_L1_error) /* "petsc4py/PETSc/petscdmcomposite.pxi":32 * self.gvec = gvec.vec * CHKERR( PetscINCREF(&self.gvec) ) * if locs is None: # <<<<<<<<<<<<<< * CHKERR( DMCompositeGetNumberDM(self.dm, &self.nlocs) ) * locs = arange(0, self.nlocs, 1) */ __pyx_t_4 = (__pyx_v_locs == Py_None); if (__pyx_t_4) { /* "petsc4py/PETSc/petscdmcomposite.pxi":33 * CHKERR( PetscINCREF(&self.gvec) ) * if locs is None: * CHKERR( DMCompositeGetNumberDM(self.dm, &self.nlocs) ) # <<<<<<<<<<<<<< * locs = arange(0, self.nlocs, 1) * self.locs_mem = iarray_i(locs, &self.nlocs, &self.locs) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCompositeGetNumberDM(__pyx_v_self->dm, (&__pyx_v_self->nlocs))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(28, 33, __pyx_L1_error) /* "petsc4py/PETSc/petscdmcomposite.pxi":34 * if locs is None: * CHKERR( DMCompositeGetNumberDM(self.dm, &self.nlocs) ) * locs = arange(0, self.nlocs, 1) # <<<<<<<<<<<<<< * self.locs_mem = iarray_i(locs, &self.nlocs, &self.locs) * self.vecs_mem = oarray_p(empty_p(self.nlocs), NULL, &self.vecs) */ __pyx_t_5 = __Pyx_PyInt_From_long(((long)__pyx_v_self->nlocs)); if (unlikely(!__pyx_t_5)) __PYX_ERR(28, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_arange(__pyx_int_0, __pyx_t_5, __pyx_int_1)); if (unlikely(!__pyx_t_6)) __PYX_ERR(28, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_locs, __pyx_t_6); __pyx_t_6 = 0; /* "petsc4py/PETSc/petscdmcomposite.pxi":32 * self.gvec = gvec.vec * CHKERR( PetscINCREF(&self.gvec) ) * if locs is None: # <<<<<<<<<<<<<< * CHKERR( DMCompositeGetNumberDM(self.dm, &self.nlocs) ) * locs = arange(0, self.nlocs, 1) */ } /* "petsc4py/PETSc/petscdmcomposite.pxi":35 * CHKERR( DMCompositeGetNumberDM(self.dm, &self.nlocs) ) * locs = arange(0, self.nlocs, 1) * self.locs_mem = iarray_i(locs, &self.nlocs, &self.locs) # <<<<<<<<<<<<<< * self.vecs_mem = oarray_p(empty_p(self.nlocs), NULL, &self.vecs) * self.access = None */ __pyx_t_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_locs, (&__pyx_v_self->nlocs), (&__pyx_v_self->locs))); if (unlikely(!__pyx_t_6)) __PYX_ERR(28, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __Pyx_GOTREF(__pyx_v_self->locs_mem); __Pyx_DECREF(__pyx_v_self->locs_mem); __pyx_v_self->locs_mem = __pyx_t_6; __pyx_t_6 = 0; /* "petsc4py/PETSc/petscdmcomposite.pxi":36 * locs = arange(0, self.nlocs, 1) * self.locs_mem = iarray_i(locs, &self.nlocs, &self.locs) * self.vecs_mem = oarray_p(empty_p(self.nlocs), NULL, &self.vecs) # <<<<<<<<<<<<<< * self.access = None * */ __pyx_t_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_self->nlocs)); if (unlikely(!__pyx_t_6)) __PYX_ERR(28, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_6, NULL, ((void **)(&__pyx_v_self->vecs)))); if (unlikely(!__pyx_t_5)) __PYX_ERR(28, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GIVEREF(__pyx_t_5); __Pyx_GOTREF(__pyx_v_self->vecs_mem); __Pyx_DECREF(__pyx_v_self->vecs_mem); __pyx_v_self->vecs_mem = __pyx_t_5; __pyx_t_5 = 0; /* "petsc4py/PETSc/petscdmcomposite.pxi":37 * self.locs_mem = iarray_i(locs, &self.nlocs, &self.locs) * self.vecs_mem = oarray_p(empty_p(self.nlocs), NULL, &self.vecs) * self.access = None # <<<<<<<<<<<<<< * * def __dealloc__(self): */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->access); __Pyx_DECREF(__pyx_v_self->access); __pyx_v_self->access = Py_None; /* "petsc4py/PETSc/petscdmcomposite.pxi":27 * cdef object access * * def __cinit__(self, DM dm, Vec gvec, locs=None): # <<<<<<<<<<<<<< * self.dm = dm.dm * CHKERR( PetscINCREF(&self.dm) ) */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc._DMComposite_access.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_locs); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscdmcomposite.pxi":39 * self.access = None * * def __dealloc__(self): # <<<<<<<<<<<<<< * CHKERR( DMDestroy(&self.dm) ) * CHKERR( VecDestroy(&self.gvec) ) */ /* Python wrapper */ static void __pyx_pw_8petsc4py_5PETSc_19_DMComposite_access_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_8petsc4py_5PETSc_19_DMComposite_access_3__dealloc__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_pf_8petsc4py_5PETSc_19_DMComposite_access_2__dealloc__(((struct __pyx_obj_8petsc4py_5PETSc__DMComposite_access *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_8petsc4py_5PETSc_19_DMComposite_access_2__dealloc__(struct __pyx_obj_8petsc4py_5PETSc__DMComposite_access *__pyx_v_self) { PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "petsc4py/PETSc/petscdmcomposite.pxi":40 * * def __dealloc__(self): * CHKERR( DMDestroy(&self.dm) ) # <<<<<<<<<<<<<< * CHKERR( VecDestroy(&self.gvec) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDestroy((&__pyx_v_self->dm))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(28, 40, __pyx_L1_error) /* "petsc4py/PETSc/petscdmcomposite.pxi":41 * def __dealloc__(self): * CHKERR( DMDestroy(&self.dm) ) * CHKERR( VecDestroy(&self.gvec) ) # <<<<<<<<<<<<<< * * def __enter__(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecDestroy((&__pyx_v_self->gvec))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(28, 41, __pyx_L1_error) /* "petsc4py/PETSc/petscdmcomposite.pxi":39 * self.access = None * * def __dealloc__(self): # <<<<<<<<<<<<<< * CHKERR( DMDestroy(&self.dm) ) * CHKERR( VecDestroy(&self.gvec) ) */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_WriteUnraisable("petsc4py.PETSc._DMComposite_access.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_L0:; } /* "petsc4py/PETSc/petscdmcomposite.pxi":43 * CHKERR( VecDestroy(&self.gvec) ) * * def __enter__(self): # <<<<<<<<<<<<<< * cdef Py_ssize_t i, n = self.nlocs * CHKERR( DMCompositeGetAccessArray(self.dm, self.gvec, self.nlocs, self.locs, self.vecs) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_19_DMComposite_access_5__enter__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_19_DMComposite_access_4__enter__, "_DMComposite_access.__enter__(self)\nSource code at petsc4py/PETSc/petscdmcomposite.pxi:43"); static PyObject *__pyx_pw_8petsc4py_5PETSc_19_DMComposite_access_5__enter__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__enter__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__enter__", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_19_DMComposite_access_4__enter__(((struct __pyx_obj_8petsc4py_5PETSc__DMComposite_access *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_19_DMComposite_access_4__enter__(struct __pyx_obj_8petsc4py_5PETSc__DMComposite_access *__pyx_v_self) { Py_ssize_t __pyx_v_n; Py_ssize_t __pyx_7genexpr__pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__enter__", 1); /* "petsc4py/PETSc/petscdmcomposite.pxi":44 * * def __enter__(self): * cdef Py_ssize_t i, n = self.nlocs # <<<<<<<<<<<<<< * CHKERR( DMCompositeGetAccessArray(self.dm, self.gvec, self.nlocs, self.locs, self.vecs) ) * self.access = [ref_Vec(self.vecs[i]) for i from 0 <= i < n] */ __pyx_t_1 = __pyx_v_self->nlocs; __pyx_v_n = __pyx_t_1; /* "petsc4py/PETSc/petscdmcomposite.pxi":45 * def __enter__(self): * cdef Py_ssize_t i, n = self.nlocs * CHKERR( DMCompositeGetAccessArray(self.dm, self.gvec, self.nlocs, self.locs, self.vecs) ) # <<<<<<<<<<<<<< * self.access = [ref_Vec(self.vecs[i]) for i from 0 <= i < n] * return tuple(self.access) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCompositeGetAccessArray(__pyx_v_self->dm, __pyx_v_self->gvec, __pyx_v_self->nlocs, __pyx_v_self->locs, __pyx_v_self->vecs)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(28, 45, __pyx_L1_error) /* "petsc4py/PETSc/petscdmcomposite.pxi":46 * cdef Py_ssize_t i, n = self.nlocs * CHKERR( DMCompositeGetAccessArray(self.dm, self.gvec, self.nlocs, self.locs, self.vecs) ) * self.access = [ref_Vec(self.vecs[i]) for i from 0 <= i < n] # <<<<<<<<<<<<<< * return tuple(self.access) * */ { /* enter inner scope */ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_v_n; for (__pyx_7genexpr__pyx_v_i = 0; __pyx_7genexpr__pyx_v_i < __pyx_t_4; __pyx_7genexpr__pyx_v_i++) { __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec((__pyx_v_self->vecs[__pyx_7genexpr__pyx_v_i]))); if (unlikely(!__pyx_t_5)) __PYX_ERR(28, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_5))) __PYX_ERR(28, 46, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } } /* exit inner scope */ __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->access); __Pyx_DECREF(__pyx_v_self->access); __pyx_v_self->access = __pyx_t_3; __pyx_t_3 = 0; /* "petsc4py/PETSc/petscdmcomposite.pxi":47 * CHKERR( DMCompositeGetAccessArray(self.dm, self.gvec, self.nlocs, self.locs, self.vecs) ) * self.access = [ref_Vec(self.vecs[i]) for i from 0 <= i < n] * return tuple(self.access) # <<<<<<<<<<<<<< * * def __exit__(self, *exc): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_v_self->access); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "petsc4py/PETSc/petscdmcomposite.pxi":43 * CHKERR( VecDestroy(&self.gvec) ) * * def __enter__(self): # <<<<<<<<<<<<<< * cdef Py_ssize_t i, n = self.nlocs * CHKERR( DMCompositeGetAccessArray(self.dm, self.gvec, self.nlocs, self.locs, self.vecs) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc._DMComposite_access.__enter__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscdmcomposite.pxi":49 * return tuple(self.access) * * def __exit__(self, *exc): # <<<<<<<<<<<<<< * cdef Py_ssize_t i, n = self.nlocs * for i from 0 <= i < n: (self.access[i]).vec = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_19_DMComposite_access_7__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_19_DMComposite_access_6__exit__, "_DMComposite_access.__exit__(self, *exc)\nSource code at petsc4py/PETSc/petscdmcomposite.pxi:49"); static PyObject *__pyx_pw_8petsc4py_5PETSc_19_DMComposite_access_7__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED PyObject *__pyx_v_exc = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__exit__", 0))) return NULL; __Pyx_INCREF(__pyx_args); __pyx_v_exc = __pyx_args; __pyx_r = __pyx_pf_8petsc4py_5PETSc_19_DMComposite_access_6__exit__(((struct __pyx_obj_8petsc4py_5PETSc__DMComposite_access *)__pyx_v_self), __pyx_v_exc); /* function exit code */ __Pyx_DECREF(__pyx_v_exc); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_19_DMComposite_access_6__exit__(struct __pyx_obj_8petsc4py_5PETSc__DMComposite_access *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc) { Py_ssize_t __pyx_v_i; Py_ssize_t __pyx_v_n; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; Py_ssize_t __pyx_t_2; PyObject *__pyx_t_3 = NULL; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__exit__", 1); /* "petsc4py/PETSc/petscdmcomposite.pxi":50 * * def __exit__(self, *exc): * cdef Py_ssize_t i, n = self.nlocs # <<<<<<<<<<<<<< * for i from 0 <= i < n: (self.access[i]).vec = NULL * CHKERR( DMCompositeRestoreAccessArray(self.dm, self.gvec, self.nlocs, self.locs, self.vecs) ) */ __pyx_t_1 = __pyx_v_self->nlocs; __pyx_v_n = __pyx_t_1; /* "petsc4py/PETSc/petscdmcomposite.pxi":51 * def __exit__(self, *exc): * cdef Py_ssize_t i, n = self.nlocs * for i from 0 <= i < n: (self.access[i]).vec = NULL # <<<<<<<<<<<<<< * CHKERR( DMCompositeRestoreAccessArray(self.dm, self.gvec, self.nlocs, self.locs, self.vecs) ) * self.access = None */ __pyx_t_2 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_self->access, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); ((struct PyPetscVecObject *)__pyx_t_3)->vec = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } /* "petsc4py/PETSc/petscdmcomposite.pxi":52 * cdef Py_ssize_t i, n = self.nlocs * for i from 0 <= i < n: (self.access[i]).vec = NULL * CHKERR( DMCompositeRestoreAccessArray(self.dm, self.gvec, self.nlocs, self.locs, self.vecs) ) # <<<<<<<<<<<<<< * self.access = None */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCompositeRestoreAccessArray(__pyx_v_self->dm, __pyx_v_self->gvec, __pyx_v_self->nlocs, __pyx_v_self->locs, __pyx_v_self->vecs)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(28, 52, __pyx_L1_error) /* "petsc4py/PETSc/petscdmcomposite.pxi":53 * for i from 0 <= i < n: (self.access[i]).vec = NULL * CHKERR( DMCompositeRestoreAccessArray(self.dm, self.gvec, self.nlocs, self.locs, self.vecs) ) * self.access = None # <<<<<<<<<<<<<< */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->access); __Pyx_DECREF(__pyx_v_self->access); __pyx_v_self->access = Py_None; /* "petsc4py/PETSc/petscdmcomposite.pxi":49 * return tuple(self.access) * * def __exit__(self, *exc): # <<<<<<<<<<<<<< * cdef Py_ssize_t i, n = self.nlocs * for i from 0 <= i < n: (self.access[i]).vec = NULL */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc._DMComposite_access.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscdmshell.pxi":74 * * * cdef PetscErrorCode DMSHELL_CreateGlobalVector( # <<<<<<<<<<<<<< * PetscDM dm, * PetscVec *v) except PETSC_ERR_PYTHON with gil: */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_DMSHELL_CreateGlobalVector(DM __pyx_v_dm, Vec *__pyx_v_v) { struct PyPetscDMObject *__pyx_v_Dm = 0; struct PyPetscVecObject *__pyx_v_vec = 0; PyObject *__pyx_v_context = NULL; PyObject *__pyx_v_create_gvec = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; DM __pyx_v_odm; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); Vec __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("DMSHELL_CreateGlobalVector", 0); /* "petsc4py/PETSc/petscdmshell.pxi":77 * PetscDM dm, * PetscVec *v) except PETSC_ERR_PYTHON with gil: * cdef DM Dm = subtype_DM(dm)() # <<<<<<<<<<<<<< * cdef Vec vec * Dm.dm = dm */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(29, 77, __pyx_L1_error) __pyx_v_Dm = ((struct PyPetscDMObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":79 * cdef DM Dm = subtype_DM(dm)() * cdef Vec vec * Dm.dm = dm # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(Dm.obj) ) * context = Dm.get_attr('__create_global_vector__') */ __pyx_v_Dm->dm = __pyx_v_dm; /* "petsc4py/PETSc/petscdmshell.pxi":80 * cdef Vec vec * Dm.dm = dm * CHKERR( PetscINCREF(Dm.obj) ) # <<<<<<<<<<<<<< * context = Dm.get_attr('__create_global_vector__') * assert context is not None and type(context) is tuple */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dm->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 80, __pyx_L1_error) /* "petsc4py/PETSc/petscdmshell.pxi":81 * Dm.dm = dm * CHKERR( PetscINCREF(Dm.obj) ) * context = Dm.get_attr('__create_global_vector__') # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple * (create_gvec, args, kargs) = context */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_Dm->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Dm), ((char *)"__create_global_vector__")); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_context = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":82 * CHKERR( PetscINCREF(Dm.obj) ) * context = Dm.get_attr('__create_global_vector__') * assert context is not None and type(context) is tuple # <<<<<<<<<<<<<< * (create_gvec, args, kargs) = context * vec = create_gvec(Dm, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_5 = (__pyx_v_context != Py_None); if (__pyx_t_5) { } else { __pyx_t_4 = __pyx_t_5; goto __pyx_L3_bool_binop_done; } __pyx_t_5 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_4 = __pyx_t_5; __pyx_L3_bool_binop_done:; if (unlikely(!__pyx_t_4)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(29, 82, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(29, 82, __pyx_L1_error) #endif /* "petsc4py/PETSc/petscdmshell.pxi":83 * context = Dm.get_attr('__create_global_vector__') * assert context is not None and type(context) is tuple * (create_gvec, args, kargs) = context # <<<<<<<<<<<<<< * vec = create_gvec(Dm, *args, **kargs) * CHKERR( PetscINCREF(vec.obj) ) */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(29, 83, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_1 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(29, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); index = 0; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(29, 83, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(29, 83, __pyx_L1_error) __pyx_L6_unpacking_done:; } __pyx_v_create_gvec = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_args = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":84 * assert context is not None and type(context) is tuple * (create_gvec, args, kargs) = context * vec = create_gvec(Dm, *args, **kargs) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(vec.obj) ) * v[0] = vec.vec */ __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF((PyObject *)__pyx_v_Dm); __Pyx_GIVEREF((PyObject *)__pyx_v_Dm); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_Dm))) __PYX_ERR(29, 84, __pyx_L1_error); __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyNumber_Add(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(29, 84, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_1 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_1 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_create_gvec, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(29, 84, __pyx_L1_error) __pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_6); __pyx_t_6 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":85 * (create_gvec, args, kargs) = context * vec = create_gvec(Dm, *args, **kargs) * CHKERR( PetscINCREF(vec.obj) ) # <<<<<<<<<<<<<< * v[0] = vec.vec * cdef PetscDM odm = NULL */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_vec->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 85, __pyx_L1_error) /* "petsc4py/PETSc/petscdmshell.pxi":86 * vec = create_gvec(Dm, *args, **kargs) * CHKERR( PetscINCREF(vec.obj) ) * v[0] = vec.vec # <<<<<<<<<<<<<< * cdef PetscDM odm = NULL * CHKERR( VecGetDM(v[0], &odm) ) */ __pyx_t_9 = __pyx_v_vec->vec; (__pyx_v_v[0]) = __pyx_t_9; /* "petsc4py/PETSc/petscdmshell.pxi":87 * CHKERR( PetscINCREF(vec.obj) ) * v[0] = vec.vec * cdef PetscDM odm = NULL # <<<<<<<<<<<<<< * CHKERR( VecGetDM(v[0], &odm) ) * if odm == NULL: */ __pyx_v_odm = NULL; /* "petsc4py/PETSc/petscdmshell.pxi":88 * v[0] = vec.vec * cdef PetscDM odm = NULL * CHKERR( VecGetDM(v[0], &odm) ) # <<<<<<<<<<<<<< * if odm == NULL: * CHKERR( VecSetDM(v[0], dm) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetDM((__pyx_v_v[0]), (&__pyx_v_odm))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 88, __pyx_L1_error) /* "petsc4py/PETSc/petscdmshell.pxi":89 * cdef PetscDM odm = NULL * CHKERR( VecGetDM(v[0], &odm) ) * if odm == NULL: # <<<<<<<<<<<<<< * CHKERR( VecSetDM(v[0], dm) ) * return PETSC_SUCCESS */ __pyx_t_4 = (__pyx_v_odm == NULL); if (__pyx_t_4) { /* "petsc4py/PETSc/petscdmshell.pxi":90 * CHKERR( VecGetDM(v[0], &odm) ) * if odm == NULL: * CHKERR( VecSetDM(v[0], dm) ) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecSetDM((__pyx_v_v[0]), __pyx_v_dm)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 90, __pyx_L1_error) /* "petsc4py/PETSc/petscdmshell.pxi":89 * cdef PetscDM odm = NULL * CHKERR( VecGetDM(v[0], &odm) ) * if odm == NULL: # <<<<<<<<<<<<<< * CHKERR( VecSetDM(v[0], dm) ) * return PETSC_SUCCESS */ } /* "petsc4py/PETSc/petscdmshell.pxi":91 * if odm == NULL: * CHKERR( VecSetDM(v[0], dm) ) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * cdef PetscErrorCode DMSHELL_CreateLocalVector( */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petscdmshell.pxi":74 * * * cdef PetscErrorCode DMSHELL_CreateGlobalVector( # <<<<<<<<<<<<<< * PetscDM dm, * PetscVec *v) except PETSC_ERR_PYTHON with gil: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.DMSHELL_CreateGlobalVector", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Dm); __Pyx_XDECREF((PyObject *)__pyx_v_vec); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_create_gvec); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petscdmshell.pxi":93 * return PETSC_SUCCESS * * cdef PetscErrorCode DMSHELL_CreateLocalVector( # <<<<<<<<<<<<<< * PetscDM dm, * PetscVec *v) except PETSC_ERR_PYTHON with gil: */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_DMSHELL_CreateLocalVector(DM __pyx_v_dm, Vec *__pyx_v_v) { struct PyPetscDMObject *__pyx_v_Dm = 0; struct PyPetscVecObject *__pyx_v_vec = 0; PyObject *__pyx_v_context = NULL; PyObject *__pyx_v_create_lvec = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; DM __pyx_v_odm; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); Vec __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("DMSHELL_CreateLocalVector", 0); /* "petsc4py/PETSc/petscdmshell.pxi":96 * PetscDM dm, * PetscVec *v) except PETSC_ERR_PYTHON with gil: * cdef DM Dm = subtype_DM(dm)() # <<<<<<<<<<<<<< * cdef Vec vec * Dm.dm = dm */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(29, 96, __pyx_L1_error) __pyx_v_Dm = ((struct PyPetscDMObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":98 * cdef DM Dm = subtype_DM(dm)() * cdef Vec vec * Dm.dm = dm # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(Dm.obj) ) * context = Dm.get_attr('__create_local_vector__') */ __pyx_v_Dm->dm = __pyx_v_dm; /* "petsc4py/PETSc/petscdmshell.pxi":99 * cdef Vec vec * Dm.dm = dm * CHKERR( PetscINCREF(Dm.obj) ) # <<<<<<<<<<<<<< * context = Dm.get_attr('__create_local_vector__') * assert context is not None and type(context) is tuple */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dm->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 99, __pyx_L1_error) /* "petsc4py/PETSc/petscdmshell.pxi":100 * Dm.dm = dm * CHKERR( PetscINCREF(Dm.obj) ) * context = Dm.get_attr('__create_local_vector__') # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple * (create_lvec, args, kargs) = context */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_Dm->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Dm), ((char *)"__create_local_vector__")); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_context = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":101 * CHKERR( PetscINCREF(Dm.obj) ) * context = Dm.get_attr('__create_local_vector__') * assert context is not None and type(context) is tuple # <<<<<<<<<<<<<< * (create_lvec, args, kargs) = context * vec = create_lvec(Dm, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_5 = (__pyx_v_context != Py_None); if (__pyx_t_5) { } else { __pyx_t_4 = __pyx_t_5; goto __pyx_L3_bool_binop_done; } __pyx_t_5 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_4 = __pyx_t_5; __pyx_L3_bool_binop_done:; if (unlikely(!__pyx_t_4)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(29, 101, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(29, 101, __pyx_L1_error) #endif /* "petsc4py/PETSc/petscdmshell.pxi":102 * context = Dm.get_attr('__create_local_vector__') * assert context is not None and type(context) is tuple * (create_lvec, args, kargs) = context # <<<<<<<<<<<<<< * vec = create_lvec(Dm, *args, **kargs) * CHKERR( PetscINCREF(vec.obj) ) */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(29, 102, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_1 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(29, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); index = 0; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(29, 102, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(29, 102, __pyx_L1_error) __pyx_L6_unpacking_done:; } __pyx_v_create_lvec = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_args = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":103 * assert context is not None and type(context) is tuple * (create_lvec, args, kargs) = context * vec = create_lvec(Dm, *args, **kargs) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(vec.obj) ) * v[0] = vec.vec */ __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF((PyObject *)__pyx_v_Dm); __Pyx_GIVEREF((PyObject *)__pyx_v_Dm); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_Dm))) __PYX_ERR(29, 103, __pyx_L1_error); __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyNumber_Add(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(29, 103, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_1 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_1 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_create_lvec, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(29, 103, __pyx_L1_error) __pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_6); __pyx_t_6 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":104 * (create_lvec, args, kargs) = context * vec = create_lvec(Dm, *args, **kargs) * CHKERR( PetscINCREF(vec.obj) ) # <<<<<<<<<<<<<< * v[0] = vec.vec * cdef PetscDM odm = NULL */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_vec->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 104, __pyx_L1_error) /* "petsc4py/PETSc/petscdmshell.pxi":105 * vec = create_lvec(Dm, *args, **kargs) * CHKERR( PetscINCREF(vec.obj) ) * v[0] = vec.vec # <<<<<<<<<<<<<< * cdef PetscDM odm = NULL * CHKERR( VecGetDM(v[0], &odm) ) */ __pyx_t_9 = __pyx_v_vec->vec; (__pyx_v_v[0]) = __pyx_t_9; /* "petsc4py/PETSc/petscdmshell.pxi":106 * CHKERR( PetscINCREF(vec.obj) ) * v[0] = vec.vec * cdef PetscDM odm = NULL # <<<<<<<<<<<<<< * CHKERR( VecGetDM(v[0], &odm) ) * if odm == NULL: */ __pyx_v_odm = NULL; /* "petsc4py/PETSc/petscdmshell.pxi":107 * v[0] = vec.vec * cdef PetscDM odm = NULL * CHKERR( VecGetDM(v[0], &odm) ) # <<<<<<<<<<<<<< * if odm == NULL: * CHKERR( VecSetDM(v[0], dm) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetDM((__pyx_v_v[0]), (&__pyx_v_odm))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 107, __pyx_L1_error) /* "petsc4py/PETSc/petscdmshell.pxi":108 * cdef PetscDM odm = NULL * CHKERR( VecGetDM(v[0], &odm) ) * if odm == NULL: # <<<<<<<<<<<<<< * CHKERR( VecSetDM(v[0], dm) ) * return PETSC_SUCCESS */ __pyx_t_4 = (__pyx_v_odm == NULL); if (__pyx_t_4) { /* "petsc4py/PETSc/petscdmshell.pxi":109 * CHKERR( VecGetDM(v[0], &odm) ) * if odm == NULL: * CHKERR( VecSetDM(v[0], dm) ) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecSetDM((__pyx_v_v[0]), __pyx_v_dm)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 109, __pyx_L1_error) /* "petsc4py/PETSc/petscdmshell.pxi":108 * cdef PetscDM odm = NULL * CHKERR( VecGetDM(v[0], &odm) ) * if odm == NULL: # <<<<<<<<<<<<<< * CHKERR( VecSetDM(v[0], dm) ) * return PETSC_SUCCESS */ } /* "petsc4py/PETSc/petscdmshell.pxi":110 * if odm == NULL: * CHKERR( VecSetDM(v[0], dm) ) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * cdef PetscErrorCode DMSHELL_GlobalToLocalBegin( */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petscdmshell.pxi":93 * return PETSC_SUCCESS * * cdef PetscErrorCode DMSHELL_CreateLocalVector( # <<<<<<<<<<<<<< * PetscDM dm, * PetscVec *v) except PETSC_ERR_PYTHON with gil: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.DMSHELL_CreateLocalVector", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Dm); __Pyx_XDECREF((PyObject *)__pyx_v_vec); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_create_lvec); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petscdmshell.pxi":112 * return PETSC_SUCCESS * * cdef PetscErrorCode DMSHELL_GlobalToLocalBegin( # <<<<<<<<<<<<<< * PetscDM dm, * PetscVec g, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_DMSHELL_GlobalToLocalBegin(DM __pyx_v_dm, Vec __pyx_v_g, InsertMode __pyx_v_mode, Vec __pyx_v_l) { struct PyPetscDMObject *__pyx_v_Dm = 0; struct PyPetscVecObject *__pyx_v_gvec = 0; struct PyPetscVecObject *__pyx_v_lvec = 0; PyObject *__pyx_v_context = NULL; PyObject *__pyx_v_begin = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("DMSHELL_GlobalToLocalBegin", 0); /* "petsc4py/PETSc/petscdmshell.pxi":117 * PetscInsertMode mode, * PetscVec l) except PETSC_ERR_PYTHON with gil: * cdef DM Dm = subtype_DM(dm)() # <<<<<<<<<<<<<< * cdef Vec gvec = ref_Vec(g) * cdef Vec lvec = ref_Vec(l) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(29, 117, __pyx_L1_error) __pyx_v_Dm = ((struct PyPetscDMObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":118 * PetscVec l) except PETSC_ERR_PYTHON with gil: * cdef DM Dm = subtype_DM(dm)() * cdef Vec gvec = ref_Vec(g) # <<<<<<<<<<<<<< * cdef Vec lvec = ref_Vec(l) * Dm.dm = dm */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_g)); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_gvec = ((struct PyPetscVecObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":119 * cdef DM Dm = subtype_DM(dm)() * cdef Vec gvec = ref_Vec(g) * cdef Vec lvec = ref_Vec(l) # <<<<<<<<<<<<<< * Dm.dm = dm * CHKERR( PetscINCREF(Dm.obj) ) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_l)); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_lvec = ((struct PyPetscVecObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":120 * cdef Vec gvec = ref_Vec(g) * cdef Vec lvec = ref_Vec(l) * Dm.dm = dm # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(Dm.obj) ) * context = Dm.get_attr('__g2l_begin__') */ __pyx_v_Dm->dm = __pyx_v_dm; /* "petsc4py/PETSc/petscdmshell.pxi":121 * cdef Vec lvec = ref_Vec(l) * Dm.dm = dm * CHKERR( PetscINCREF(Dm.obj) ) # <<<<<<<<<<<<<< * context = Dm.get_attr('__g2l_begin__') * assert context is not None and type(context) is tuple */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dm->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 121, __pyx_L1_error) /* "petsc4py/PETSc/petscdmshell.pxi":122 * Dm.dm = dm * CHKERR( PetscINCREF(Dm.obj) ) * context = Dm.get_attr('__g2l_begin__') # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple * (begin, args, kargs) = context */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_Dm->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Dm), ((char *)"__g2l_begin__")); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_context = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":123 * CHKERR( PetscINCREF(Dm.obj) ) * context = Dm.get_attr('__g2l_begin__') * assert context is not None and type(context) is tuple # <<<<<<<<<<<<<< * (begin, args, kargs) = context * begin(Dm, gvec, mode, lvec, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_5 = (__pyx_v_context != Py_None); if (__pyx_t_5) { } else { __pyx_t_4 = __pyx_t_5; goto __pyx_L3_bool_binop_done; } __pyx_t_5 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_4 = __pyx_t_5; __pyx_L3_bool_binop_done:; if (unlikely(!__pyx_t_4)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(29, 123, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(29, 123, __pyx_L1_error) #endif /* "petsc4py/PETSc/petscdmshell.pxi":124 * context = Dm.get_attr('__g2l_begin__') * assert context is not None and type(context) is tuple * (begin, args, kargs) = context # <<<<<<<<<<<<<< * begin(Dm, gvec, mode, lvec, *args, **kargs) * return PETSC_SUCCESS */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(29, 124, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_1 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(29, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); index = 0; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(29, 124, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(29, 124, __pyx_L1_error) __pyx_L6_unpacking_done:; } __pyx_v_begin = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_args = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":125 * assert context is not None and type(context) is tuple * (begin, args, kargs) = context * begin(Dm, gvec, mode, lvec, *args, **kargs) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_6 = __Pyx_PyInt_From_InsertMode(__pyx_v_mode); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF((PyObject *)__pyx_v_Dm); __Pyx_GIVEREF((PyObject *)__pyx_v_Dm); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_Dm))) __PYX_ERR(29, 125, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_gvec); __Pyx_GIVEREF((PyObject *)__pyx_v_gvec); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_gvec))) __PYX_ERR(29, 125, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_6)) __PYX_ERR(29, 125, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_lvec); __Pyx_GIVEREF((PyObject *)__pyx_v_lvec); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_lvec))) __PYX_ERR(29, 125, __pyx_L1_error); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(29, 125, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_6 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } else { __pyx_t_6 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_begin, __pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":126 * (begin, args, kargs) = context * begin(Dm, gvec, mode, lvec, *args, **kargs) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * cdef PetscErrorCode DMSHELL_GlobalToLocalEnd( */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petscdmshell.pxi":112 * return PETSC_SUCCESS * * cdef PetscErrorCode DMSHELL_GlobalToLocalBegin( # <<<<<<<<<<<<<< * PetscDM dm, * PetscVec g, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.DMSHELL_GlobalToLocalBegin", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Dm); __Pyx_XDECREF((PyObject *)__pyx_v_gvec); __Pyx_XDECREF((PyObject *)__pyx_v_lvec); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_begin); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petscdmshell.pxi":128 * return PETSC_SUCCESS * * cdef PetscErrorCode DMSHELL_GlobalToLocalEnd( # <<<<<<<<<<<<<< * PetscDM dm, * PetscVec g, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_DMSHELL_GlobalToLocalEnd(DM __pyx_v_dm, Vec __pyx_v_g, InsertMode __pyx_v_mode, Vec __pyx_v_l) { struct PyPetscDMObject *__pyx_v_Dm = 0; struct PyPetscVecObject *__pyx_v_gvec = 0; struct PyPetscVecObject *__pyx_v_lvec = 0; PyObject *__pyx_v_context = NULL; PyObject *__pyx_v_end = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("DMSHELL_GlobalToLocalEnd", 0); /* "petsc4py/PETSc/petscdmshell.pxi":133 * PetscInsertMode mode, * PetscVec l) except PETSC_ERR_PYTHON with gil: * cdef DM Dm = subtype_DM(dm)() # <<<<<<<<<<<<<< * cdef Vec gvec = ref_Vec(g) * cdef Vec lvec = ref_Vec(l) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(29, 133, __pyx_L1_error) __pyx_v_Dm = ((struct PyPetscDMObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":134 * PetscVec l) except PETSC_ERR_PYTHON with gil: * cdef DM Dm = subtype_DM(dm)() * cdef Vec gvec = ref_Vec(g) # <<<<<<<<<<<<<< * cdef Vec lvec = ref_Vec(l) * Dm.dm = dm */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_g)); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_gvec = ((struct PyPetscVecObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":135 * cdef DM Dm = subtype_DM(dm)() * cdef Vec gvec = ref_Vec(g) * cdef Vec lvec = ref_Vec(l) # <<<<<<<<<<<<<< * Dm.dm = dm * CHKERR( PetscINCREF(Dm.obj) ) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_l)); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_lvec = ((struct PyPetscVecObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":136 * cdef Vec gvec = ref_Vec(g) * cdef Vec lvec = ref_Vec(l) * Dm.dm = dm # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(Dm.obj) ) * context = Dm.get_attr('__g2l_end__') */ __pyx_v_Dm->dm = __pyx_v_dm; /* "petsc4py/PETSc/petscdmshell.pxi":137 * cdef Vec lvec = ref_Vec(l) * Dm.dm = dm * CHKERR( PetscINCREF(Dm.obj) ) # <<<<<<<<<<<<<< * context = Dm.get_attr('__g2l_end__') * assert context is not None and type(context) is tuple */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dm->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 137, __pyx_L1_error) /* "petsc4py/PETSc/petscdmshell.pxi":138 * Dm.dm = dm * CHKERR( PetscINCREF(Dm.obj) ) * context = Dm.get_attr('__g2l_end__') # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple * (end, args, kargs) = context */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_Dm->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Dm), ((char *)"__g2l_end__")); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_context = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":139 * CHKERR( PetscINCREF(Dm.obj) ) * context = Dm.get_attr('__g2l_end__') * assert context is not None and type(context) is tuple # <<<<<<<<<<<<<< * (end, args, kargs) = context * end(Dm, gvec, mode, lvec, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_5 = (__pyx_v_context != Py_None); if (__pyx_t_5) { } else { __pyx_t_4 = __pyx_t_5; goto __pyx_L3_bool_binop_done; } __pyx_t_5 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_4 = __pyx_t_5; __pyx_L3_bool_binop_done:; if (unlikely(!__pyx_t_4)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(29, 139, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(29, 139, __pyx_L1_error) #endif /* "petsc4py/PETSc/petscdmshell.pxi":140 * context = Dm.get_attr('__g2l_end__') * assert context is not None and type(context) is tuple * (end, args, kargs) = context # <<<<<<<<<<<<<< * end(Dm, gvec, mode, lvec, *args, **kargs) * return PETSC_SUCCESS */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(29, 140, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_1 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(29, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); index = 0; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(29, 140, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(29, 140, __pyx_L1_error) __pyx_L6_unpacking_done:; } __pyx_v_end = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_args = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":141 * assert context is not None and type(context) is tuple * (end, args, kargs) = context * end(Dm, gvec, mode, lvec, *args, **kargs) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_6 = __Pyx_PyInt_From_InsertMode(__pyx_v_mode); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF((PyObject *)__pyx_v_Dm); __Pyx_GIVEREF((PyObject *)__pyx_v_Dm); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_Dm))) __PYX_ERR(29, 141, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_gvec); __Pyx_GIVEREF((PyObject *)__pyx_v_gvec); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_gvec))) __PYX_ERR(29, 141, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_6)) __PYX_ERR(29, 141, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_lvec); __Pyx_GIVEREF((PyObject *)__pyx_v_lvec); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_lvec))) __PYX_ERR(29, 141, __pyx_L1_error); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(29, 141, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_6 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } else { __pyx_t_6 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_end, __pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":142 * (end, args, kargs) = context * end(Dm, gvec, mode, lvec, *args, **kargs) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * cdef PetscErrorCode DMSHELL_LocalToGlobalBegin( */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petscdmshell.pxi":128 * return PETSC_SUCCESS * * cdef PetscErrorCode DMSHELL_GlobalToLocalEnd( # <<<<<<<<<<<<<< * PetscDM dm, * PetscVec g, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.DMSHELL_GlobalToLocalEnd", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Dm); __Pyx_XDECREF((PyObject *)__pyx_v_gvec); __Pyx_XDECREF((PyObject *)__pyx_v_lvec); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_end); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petscdmshell.pxi":144 * return PETSC_SUCCESS * * cdef PetscErrorCode DMSHELL_LocalToGlobalBegin( # <<<<<<<<<<<<<< * PetscDM dm, * PetscVec g, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_DMSHELL_LocalToGlobalBegin(DM __pyx_v_dm, Vec __pyx_v_g, InsertMode __pyx_v_mode, Vec __pyx_v_l) { struct PyPetscDMObject *__pyx_v_Dm = 0; struct PyPetscVecObject *__pyx_v_gvec = 0; struct PyPetscVecObject *__pyx_v_lvec = 0; PyObject *__pyx_v_context = NULL; PyObject *__pyx_v_begin = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("DMSHELL_LocalToGlobalBegin", 0); /* "petsc4py/PETSc/petscdmshell.pxi":149 * PetscInsertMode mode, * PetscVec l) except PETSC_ERR_PYTHON with gil: * cdef DM Dm = subtype_DM(dm)() # <<<<<<<<<<<<<< * cdef Vec gvec = ref_Vec(g) * cdef Vec lvec = ref_Vec(l) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(29, 149, __pyx_L1_error) __pyx_v_Dm = ((struct PyPetscDMObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":150 * PetscVec l) except PETSC_ERR_PYTHON with gil: * cdef DM Dm = subtype_DM(dm)() * cdef Vec gvec = ref_Vec(g) # <<<<<<<<<<<<<< * cdef Vec lvec = ref_Vec(l) * Dm.dm = dm */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_g)); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_gvec = ((struct PyPetscVecObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":151 * cdef DM Dm = subtype_DM(dm)() * cdef Vec gvec = ref_Vec(g) * cdef Vec lvec = ref_Vec(l) # <<<<<<<<<<<<<< * Dm.dm = dm * CHKERR( PetscINCREF(Dm.obj) ) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_l)); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_lvec = ((struct PyPetscVecObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":152 * cdef Vec gvec = ref_Vec(g) * cdef Vec lvec = ref_Vec(l) * Dm.dm = dm # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(Dm.obj) ) * context = Dm.get_attr('__l2g_begin__') */ __pyx_v_Dm->dm = __pyx_v_dm; /* "petsc4py/PETSc/petscdmshell.pxi":153 * cdef Vec lvec = ref_Vec(l) * Dm.dm = dm * CHKERR( PetscINCREF(Dm.obj) ) # <<<<<<<<<<<<<< * context = Dm.get_attr('__l2g_begin__') * assert context is not None and type(context) is tuple */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dm->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 153, __pyx_L1_error) /* "petsc4py/PETSc/petscdmshell.pxi":154 * Dm.dm = dm * CHKERR( PetscINCREF(Dm.obj) ) * context = Dm.get_attr('__l2g_begin__') # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple * (begin, args, kargs) = context */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_Dm->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Dm), ((char *)"__l2g_begin__")); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_context = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":155 * CHKERR( PetscINCREF(Dm.obj) ) * context = Dm.get_attr('__l2g_begin__') * assert context is not None and type(context) is tuple # <<<<<<<<<<<<<< * (begin, args, kargs) = context * begin(Dm, gvec, mode, lvec, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_5 = (__pyx_v_context != Py_None); if (__pyx_t_5) { } else { __pyx_t_4 = __pyx_t_5; goto __pyx_L3_bool_binop_done; } __pyx_t_5 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_4 = __pyx_t_5; __pyx_L3_bool_binop_done:; if (unlikely(!__pyx_t_4)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(29, 155, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(29, 155, __pyx_L1_error) #endif /* "petsc4py/PETSc/petscdmshell.pxi":156 * context = Dm.get_attr('__l2g_begin__') * assert context is not None and type(context) is tuple * (begin, args, kargs) = context # <<<<<<<<<<<<<< * begin(Dm, gvec, mode, lvec, *args, **kargs) * return PETSC_SUCCESS */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(29, 156, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_1 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(29, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); index = 0; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(29, 156, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(29, 156, __pyx_L1_error) __pyx_L6_unpacking_done:; } __pyx_v_begin = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_args = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":157 * assert context is not None and type(context) is tuple * (begin, args, kargs) = context * begin(Dm, gvec, mode, lvec, *args, **kargs) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_6 = __Pyx_PyInt_From_InsertMode(__pyx_v_mode); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF((PyObject *)__pyx_v_Dm); __Pyx_GIVEREF((PyObject *)__pyx_v_Dm); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_Dm))) __PYX_ERR(29, 157, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_gvec); __Pyx_GIVEREF((PyObject *)__pyx_v_gvec); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_gvec))) __PYX_ERR(29, 157, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_6)) __PYX_ERR(29, 157, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_lvec); __Pyx_GIVEREF((PyObject *)__pyx_v_lvec); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_lvec))) __PYX_ERR(29, 157, __pyx_L1_error); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(29, 157, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_6 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } else { __pyx_t_6 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_begin, __pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":158 * (begin, args, kargs) = context * begin(Dm, gvec, mode, lvec, *args, **kargs) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * cdef PetscErrorCode DMSHELL_LocalToGlobalEnd( */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petscdmshell.pxi":144 * return PETSC_SUCCESS * * cdef PetscErrorCode DMSHELL_LocalToGlobalBegin( # <<<<<<<<<<<<<< * PetscDM dm, * PetscVec g, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.DMSHELL_LocalToGlobalBegin", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Dm); __Pyx_XDECREF((PyObject *)__pyx_v_gvec); __Pyx_XDECREF((PyObject *)__pyx_v_lvec); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_begin); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petscdmshell.pxi":160 * return PETSC_SUCCESS * * cdef PetscErrorCode DMSHELL_LocalToGlobalEnd( # <<<<<<<<<<<<<< * PetscDM dm, * PetscVec g, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_DMSHELL_LocalToGlobalEnd(DM __pyx_v_dm, Vec __pyx_v_g, InsertMode __pyx_v_mode, Vec __pyx_v_l) { struct PyPetscDMObject *__pyx_v_Dm = 0; struct PyPetscVecObject *__pyx_v_gvec = 0; struct PyPetscVecObject *__pyx_v_lvec = 0; PyObject *__pyx_v_context = NULL; PyObject *__pyx_v_end = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("DMSHELL_LocalToGlobalEnd", 0); /* "petsc4py/PETSc/petscdmshell.pxi":165 * PetscInsertMode mode, * PetscVec l) except PETSC_ERR_PYTHON with gil: * cdef DM Dm = subtype_DM(dm)() # <<<<<<<<<<<<<< * cdef Vec gvec = ref_Vec(g) * cdef Vec lvec = ref_Vec(l) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(29, 165, __pyx_L1_error) __pyx_v_Dm = ((struct PyPetscDMObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":166 * PetscVec l) except PETSC_ERR_PYTHON with gil: * cdef DM Dm = subtype_DM(dm)() * cdef Vec gvec = ref_Vec(g) # <<<<<<<<<<<<<< * cdef Vec lvec = ref_Vec(l) * Dm.dm = dm */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_g)); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 166, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_gvec = ((struct PyPetscVecObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":167 * cdef DM Dm = subtype_DM(dm)() * cdef Vec gvec = ref_Vec(g) * cdef Vec lvec = ref_Vec(l) # <<<<<<<<<<<<<< * Dm.dm = dm * CHKERR( PetscINCREF(Dm.obj) ) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_l)); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_lvec = ((struct PyPetscVecObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":168 * cdef Vec gvec = ref_Vec(g) * cdef Vec lvec = ref_Vec(l) * Dm.dm = dm # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(Dm.obj) ) * context = Dm.get_attr('__l2g_end__') */ __pyx_v_Dm->dm = __pyx_v_dm; /* "petsc4py/PETSc/petscdmshell.pxi":169 * cdef Vec lvec = ref_Vec(l) * Dm.dm = dm * CHKERR( PetscINCREF(Dm.obj) ) # <<<<<<<<<<<<<< * context = Dm.get_attr('__l2g_end__') * assert context is not None and type(context) is tuple */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dm->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 169, __pyx_L1_error) /* "petsc4py/PETSc/petscdmshell.pxi":170 * Dm.dm = dm * CHKERR( PetscINCREF(Dm.obj) ) * context = Dm.get_attr('__l2g_end__') # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple * (end, args, kargs) = context */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_Dm->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Dm), ((char *)"__l2g_end__")); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_context = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":171 * CHKERR( PetscINCREF(Dm.obj) ) * context = Dm.get_attr('__l2g_end__') * assert context is not None and type(context) is tuple # <<<<<<<<<<<<<< * (end, args, kargs) = context * end(Dm, gvec, mode, lvec, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_5 = (__pyx_v_context != Py_None); if (__pyx_t_5) { } else { __pyx_t_4 = __pyx_t_5; goto __pyx_L3_bool_binop_done; } __pyx_t_5 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_4 = __pyx_t_5; __pyx_L3_bool_binop_done:; if (unlikely(!__pyx_t_4)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(29, 171, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(29, 171, __pyx_L1_error) #endif /* "petsc4py/PETSc/petscdmshell.pxi":172 * context = Dm.get_attr('__l2g_end__') * assert context is not None and type(context) is tuple * (end, args, kargs) = context # <<<<<<<<<<<<<< * end(Dm, gvec, mode, lvec, *args, **kargs) * return PETSC_SUCCESS */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(29, 172, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_1 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(29, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); index = 0; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(29, 172, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(29, 172, __pyx_L1_error) __pyx_L6_unpacking_done:; } __pyx_v_end = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_args = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":173 * assert context is not None and type(context) is tuple * (end, args, kargs) = context * end(Dm, gvec, mode, lvec, *args, **kargs) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_6 = __Pyx_PyInt_From_InsertMode(__pyx_v_mode); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF((PyObject *)__pyx_v_Dm); __Pyx_GIVEREF((PyObject *)__pyx_v_Dm); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_Dm))) __PYX_ERR(29, 173, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_gvec); __Pyx_GIVEREF((PyObject *)__pyx_v_gvec); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_gvec))) __PYX_ERR(29, 173, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_6)) __PYX_ERR(29, 173, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_lvec); __Pyx_GIVEREF((PyObject *)__pyx_v_lvec); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_lvec))) __PYX_ERR(29, 173, __pyx_L1_error); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(29, 173, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_6 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } else { __pyx_t_6 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_end, __pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":174 * (end, args, kargs) = context * end(Dm, gvec, mode, lvec, *args, **kargs) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * cdef PetscErrorCode DMSHELL_LocalToLocalBegin( */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petscdmshell.pxi":160 * return PETSC_SUCCESS * * cdef PetscErrorCode DMSHELL_LocalToGlobalEnd( # <<<<<<<<<<<<<< * PetscDM dm, * PetscVec g, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.DMSHELL_LocalToGlobalEnd", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Dm); __Pyx_XDECREF((PyObject *)__pyx_v_gvec); __Pyx_XDECREF((PyObject *)__pyx_v_lvec); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_end); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petscdmshell.pxi":176 * return PETSC_SUCCESS * * cdef PetscErrorCode DMSHELL_LocalToLocalBegin( # <<<<<<<<<<<<<< * PetscDM dm, * PetscVec g, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_DMSHELL_LocalToLocalBegin(DM __pyx_v_dm, Vec __pyx_v_g, InsertMode __pyx_v_mode, Vec __pyx_v_l) { struct PyPetscDMObject *__pyx_v_Dm = 0; struct PyPetscVecObject *__pyx_v_gvec = 0; struct PyPetscVecObject *__pyx_v_lvec = 0; PyObject *__pyx_v_context = NULL; PyObject *__pyx_v_begin = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("DMSHELL_LocalToLocalBegin", 0); /* "petsc4py/PETSc/petscdmshell.pxi":181 * PetscInsertMode mode, * PetscVec l) except PETSC_ERR_PYTHON with gil: * cdef DM Dm = subtype_DM(dm)() # <<<<<<<<<<<<<< * cdef Vec gvec = ref_Vec(g) * cdef Vec lvec = ref_Vec(l) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(29, 181, __pyx_L1_error) __pyx_v_Dm = ((struct PyPetscDMObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":182 * PetscVec l) except PETSC_ERR_PYTHON with gil: * cdef DM Dm = subtype_DM(dm)() * cdef Vec gvec = ref_Vec(g) # <<<<<<<<<<<<<< * cdef Vec lvec = ref_Vec(l) * Dm.dm = dm */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_g)); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_gvec = ((struct PyPetscVecObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":183 * cdef DM Dm = subtype_DM(dm)() * cdef Vec gvec = ref_Vec(g) * cdef Vec lvec = ref_Vec(l) # <<<<<<<<<<<<<< * Dm.dm = dm * CHKERR( PetscINCREF(Dm.obj) ) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_l)); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_lvec = ((struct PyPetscVecObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":184 * cdef Vec gvec = ref_Vec(g) * cdef Vec lvec = ref_Vec(l) * Dm.dm = dm # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(Dm.obj) ) * context = Dm.get_attr('__l2l_begin__') */ __pyx_v_Dm->dm = __pyx_v_dm; /* "petsc4py/PETSc/petscdmshell.pxi":185 * cdef Vec lvec = ref_Vec(l) * Dm.dm = dm * CHKERR( PetscINCREF(Dm.obj) ) # <<<<<<<<<<<<<< * context = Dm.get_attr('__l2l_begin__') * assert context is not None and type(context) is tuple */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dm->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 185, __pyx_L1_error) /* "petsc4py/PETSc/petscdmshell.pxi":186 * Dm.dm = dm * CHKERR( PetscINCREF(Dm.obj) ) * context = Dm.get_attr('__l2l_begin__') # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple * (begin, args, kargs) = context */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_Dm->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Dm), ((char *)"__l2l_begin__")); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_context = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":187 * CHKERR( PetscINCREF(Dm.obj) ) * context = Dm.get_attr('__l2l_begin__') * assert context is not None and type(context) is tuple # <<<<<<<<<<<<<< * (begin, args, kargs) = context * begin(Dm, gvec, mode, lvec, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_5 = (__pyx_v_context != Py_None); if (__pyx_t_5) { } else { __pyx_t_4 = __pyx_t_5; goto __pyx_L3_bool_binop_done; } __pyx_t_5 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_4 = __pyx_t_5; __pyx_L3_bool_binop_done:; if (unlikely(!__pyx_t_4)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(29, 187, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(29, 187, __pyx_L1_error) #endif /* "petsc4py/PETSc/petscdmshell.pxi":188 * context = Dm.get_attr('__l2l_begin__') * assert context is not None and type(context) is tuple * (begin, args, kargs) = context # <<<<<<<<<<<<<< * begin(Dm, gvec, mode, lvec, *args, **kargs) * return PETSC_SUCCESS */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(29, 188, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_1 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(29, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); index = 0; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(29, 188, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(29, 188, __pyx_L1_error) __pyx_L6_unpacking_done:; } __pyx_v_begin = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_args = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":189 * assert context is not None and type(context) is tuple * (begin, args, kargs) = context * begin(Dm, gvec, mode, lvec, *args, **kargs) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_6 = __Pyx_PyInt_From_InsertMode(__pyx_v_mode); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF((PyObject *)__pyx_v_Dm); __Pyx_GIVEREF((PyObject *)__pyx_v_Dm); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_Dm))) __PYX_ERR(29, 189, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_gvec); __Pyx_GIVEREF((PyObject *)__pyx_v_gvec); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_gvec))) __PYX_ERR(29, 189, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_6)) __PYX_ERR(29, 189, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_lvec); __Pyx_GIVEREF((PyObject *)__pyx_v_lvec); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_lvec))) __PYX_ERR(29, 189, __pyx_L1_error); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(29, 189, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_6 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } else { __pyx_t_6 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_begin, __pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":190 * (begin, args, kargs) = context * begin(Dm, gvec, mode, lvec, *args, **kargs) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * cdef PetscErrorCode DMSHELL_LocalToLocalEnd( */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petscdmshell.pxi":176 * return PETSC_SUCCESS * * cdef PetscErrorCode DMSHELL_LocalToLocalBegin( # <<<<<<<<<<<<<< * PetscDM dm, * PetscVec g, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.DMSHELL_LocalToLocalBegin", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Dm); __Pyx_XDECREF((PyObject *)__pyx_v_gvec); __Pyx_XDECREF((PyObject *)__pyx_v_lvec); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_begin); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petscdmshell.pxi":192 * return PETSC_SUCCESS * * cdef PetscErrorCode DMSHELL_LocalToLocalEnd( # <<<<<<<<<<<<<< * PetscDM dm, * PetscVec g, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_DMSHELL_LocalToLocalEnd(DM __pyx_v_dm, Vec __pyx_v_g, InsertMode __pyx_v_mode, Vec __pyx_v_l) { struct PyPetscDMObject *__pyx_v_Dm = 0; struct PyPetscVecObject *__pyx_v_gvec = 0; struct PyPetscVecObject *__pyx_v_lvec = 0; PyObject *__pyx_v_context = NULL; PyObject *__pyx_v_end = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("DMSHELL_LocalToLocalEnd", 0); /* "petsc4py/PETSc/petscdmshell.pxi":197 * PetscInsertMode mode, * PetscVec l) except PETSC_ERR_PYTHON with gil: * cdef DM Dm = subtype_DM(dm)() # <<<<<<<<<<<<<< * cdef Vec gvec = ref_Vec(g) * cdef Vec lvec = ref_Vec(l) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(29, 197, __pyx_L1_error) __pyx_v_Dm = ((struct PyPetscDMObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":198 * PetscVec l) except PETSC_ERR_PYTHON with gil: * cdef DM Dm = subtype_DM(dm)() * cdef Vec gvec = ref_Vec(g) # <<<<<<<<<<<<<< * cdef Vec lvec = ref_Vec(l) * Dm.dm = dm */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_g)); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_gvec = ((struct PyPetscVecObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":199 * cdef DM Dm = subtype_DM(dm)() * cdef Vec gvec = ref_Vec(g) * cdef Vec lvec = ref_Vec(l) # <<<<<<<<<<<<<< * Dm.dm = dm * CHKERR( PetscINCREF(Dm.obj) ) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_l)); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_lvec = ((struct PyPetscVecObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":200 * cdef Vec gvec = ref_Vec(g) * cdef Vec lvec = ref_Vec(l) * Dm.dm = dm # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(Dm.obj) ) * context = Dm.get_attr('__l2l_end__') */ __pyx_v_Dm->dm = __pyx_v_dm; /* "petsc4py/PETSc/petscdmshell.pxi":201 * cdef Vec lvec = ref_Vec(l) * Dm.dm = dm * CHKERR( PetscINCREF(Dm.obj) ) # <<<<<<<<<<<<<< * context = Dm.get_attr('__l2l_end__') * assert context is not None and type(context) is tuple */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dm->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 201, __pyx_L1_error) /* "petsc4py/PETSc/petscdmshell.pxi":202 * Dm.dm = dm * CHKERR( PetscINCREF(Dm.obj) ) * context = Dm.get_attr('__l2l_end__') # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple * (end, args, kargs) = context */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_Dm->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Dm), ((char *)"__l2l_end__")); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_context = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":203 * CHKERR( PetscINCREF(Dm.obj) ) * context = Dm.get_attr('__l2l_end__') * assert context is not None and type(context) is tuple # <<<<<<<<<<<<<< * (end, args, kargs) = context * end(Dm, gvec, mode, lvec, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_5 = (__pyx_v_context != Py_None); if (__pyx_t_5) { } else { __pyx_t_4 = __pyx_t_5; goto __pyx_L3_bool_binop_done; } __pyx_t_5 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_4 = __pyx_t_5; __pyx_L3_bool_binop_done:; if (unlikely(!__pyx_t_4)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(29, 203, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(29, 203, __pyx_L1_error) #endif /* "petsc4py/PETSc/petscdmshell.pxi":204 * context = Dm.get_attr('__l2l_end__') * assert context is not None and type(context) is tuple * (end, args, kargs) = context # <<<<<<<<<<<<<< * end(Dm, gvec, mode, lvec, *args, **kargs) * return PETSC_SUCCESS */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(29, 204, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_1 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(29, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); index = 0; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(29, 204, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(29, 204, __pyx_L1_error) __pyx_L6_unpacking_done:; } __pyx_v_end = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_args = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":205 * assert context is not None and type(context) is tuple * (end, args, kargs) = context * end(Dm, gvec, mode, lvec, *args, **kargs) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_6 = __Pyx_PyInt_From_InsertMode(__pyx_v_mode); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF((PyObject *)__pyx_v_Dm); __Pyx_GIVEREF((PyObject *)__pyx_v_Dm); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_Dm))) __PYX_ERR(29, 205, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_gvec); __Pyx_GIVEREF((PyObject *)__pyx_v_gvec); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_gvec))) __PYX_ERR(29, 205, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_6)) __PYX_ERR(29, 205, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_lvec); __Pyx_GIVEREF((PyObject *)__pyx_v_lvec); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_lvec))) __PYX_ERR(29, 205, __pyx_L1_error); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(29, 205, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_6 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } else { __pyx_t_6 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_end, __pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":206 * (end, args, kargs) = context * end(Dm, gvec, mode, lvec, *args, **kargs) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * cdef PetscErrorCode DMSHELL_CreateMatrix( */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petscdmshell.pxi":192 * return PETSC_SUCCESS * * cdef PetscErrorCode DMSHELL_LocalToLocalEnd( # <<<<<<<<<<<<<< * PetscDM dm, * PetscVec g, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.DMSHELL_LocalToLocalEnd", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Dm); __Pyx_XDECREF((PyObject *)__pyx_v_gvec); __Pyx_XDECREF((PyObject *)__pyx_v_lvec); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_end); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petscdmshell.pxi":208 * return PETSC_SUCCESS * * cdef PetscErrorCode DMSHELL_CreateMatrix( # <<<<<<<<<<<<<< * PetscDM dm, * PetscMat *cmat) except PETSC_ERR_PYTHON with gil: */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_DMSHELL_CreateMatrix(DM __pyx_v_dm, Mat *__pyx_v_cmat) { struct PyPetscDMObject *__pyx_v_Dm = 0; struct PyPetscMatObject *__pyx_v_mat = 0; PyObject *__pyx_v_context = NULL; PyObject *__pyx_v_matrix = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; DM __pyx_v_odm; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); Mat __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("DMSHELL_CreateMatrix", 0); /* "petsc4py/PETSc/petscdmshell.pxi":211 * PetscDM dm, * PetscMat *cmat) except PETSC_ERR_PYTHON with gil: * cdef DM Dm = subtype_DM(dm)() # <<<<<<<<<<<<<< * cdef Mat mat * Dm.dm = dm */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(29, 211, __pyx_L1_error) __pyx_v_Dm = ((struct PyPetscDMObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":213 * cdef DM Dm = subtype_DM(dm)() * cdef Mat mat * Dm.dm = dm # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(Dm.obj) ) * context = Dm.get_attr('__create_matrix__') */ __pyx_v_Dm->dm = __pyx_v_dm; /* "petsc4py/PETSc/petscdmshell.pxi":214 * cdef Mat mat * Dm.dm = dm * CHKERR( PetscINCREF(Dm.obj) ) # <<<<<<<<<<<<<< * context = Dm.get_attr('__create_matrix__') * assert context is not None and type(context) is tuple */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dm->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 214, __pyx_L1_error) /* "petsc4py/PETSc/petscdmshell.pxi":215 * Dm.dm = dm * CHKERR( PetscINCREF(Dm.obj) ) * context = Dm.get_attr('__create_matrix__') # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple * (matrix, args, kargs) = context */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_Dm->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Dm), ((char *)"__create_matrix__")); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_context = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":216 * CHKERR( PetscINCREF(Dm.obj) ) * context = Dm.get_attr('__create_matrix__') * assert context is not None and type(context) is tuple # <<<<<<<<<<<<<< * (matrix, args, kargs) = context * mat = matrix(Dm, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_5 = (__pyx_v_context != Py_None); if (__pyx_t_5) { } else { __pyx_t_4 = __pyx_t_5; goto __pyx_L3_bool_binop_done; } __pyx_t_5 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_4 = __pyx_t_5; __pyx_L3_bool_binop_done:; if (unlikely(!__pyx_t_4)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(29, 216, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(29, 216, __pyx_L1_error) #endif /* "petsc4py/PETSc/petscdmshell.pxi":217 * context = Dm.get_attr('__create_matrix__') * assert context is not None and type(context) is tuple * (matrix, args, kargs) = context # <<<<<<<<<<<<<< * mat = matrix(Dm, *args, **kargs) * CHKERR( PetscINCREF(mat.obj) ) */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(29, 217, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_1 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(29, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); index = 0; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(29, 217, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(29, 217, __pyx_L1_error) __pyx_L6_unpacking_done:; } __pyx_v_matrix = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_args = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":218 * assert context is not None and type(context) is tuple * (matrix, args, kargs) = context * mat = matrix(Dm, *args, **kargs) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(mat.obj) ) * cmat[0] = mat.mat */ __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF((PyObject *)__pyx_v_Dm); __Pyx_GIVEREF((PyObject *)__pyx_v_Dm); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_Dm))) __PYX_ERR(29, 218, __pyx_L1_error); __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyNumber_Add(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(29, 218, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_1 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_1 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_matrix, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(29, 218, __pyx_L1_error) __pyx_v_mat = ((struct PyPetscMatObject *)__pyx_t_6); __pyx_t_6 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":219 * (matrix, args, kargs) = context * mat = matrix(Dm, *args, **kargs) * CHKERR( PetscINCREF(mat.obj) ) # <<<<<<<<<<<<<< * cmat[0] = mat.mat * cdef PetscDM odm = NULL */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_mat->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 219, __pyx_L1_error) /* "petsc4py/PETSc/petscdmshell.pxi":220 * mat = matrix(Dm, *args, **kargs) * CHKERR( PetscINCREF(mat.obj) ) * cmat[0] = mat.mat # <<<<<<<<<<<<<< * cdef PetscDM odm = NULL * CHKERR( MatGetDM(cmat[0], &odm) ) */ __pyx_t_9 = __pyx_v_mat->mat; (__pyx_v_cmat[0]) = __pyx_t_9; /* "petsc4py/PETSc/petscdmshell.pxi":221 * CHKERR( PetscINCREF(mat.obj) ) * cmat[0] = mat.mat * cdef PetscDM odm = NULL # <<<<<<<<<<<<<< * CHKERR( MatGetDM(cmat[0], &odm) ) * if odm == NULL: */ __pyx_v_odm = NULL; /* "petsc4py/PETSc/petscdmshell.pxi":222 * cmat[0] = mat.mat * cdef PetscDM odm = NULL * CHKERR( MatGetDM(cmat[0], &odm) ) # <<<<<<<<<<<<<< * if odm == NULL: * CHKERR( MatSetDM(cmat[0], dm) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetDM((__pyx_v_cmat[0]), (&__pyx_v_odm))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 222, __pyx_L1_error) /* "petsc4py/PETSc/petscdmshell.pxi":223 * cdef PetscDM odm = NULL * CHKERR( MatGetDM(cmat[0], &odm) ) * if odm == NULL: # <<<<<<<<<<<<<< * CHKERR( MatSetDM(cmat[0], dm) ) * return PETSC_SUCCESS */ __pyx_t_4 = (__pyx_v_odm == NULL); if (__pyx_t_4) { /* "petsc4py/PETSc/petscdmshell.pxi":224 * CHKERR( MatGetDM(cmat[0], &odm) ) * if odm == NULL: * CHKERR( MatSetDM(cmat[0], dm) ) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSetDM((__pyx_v_cmat[0]), __pyx_v_dm)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 224, __pyx_L1_error) /* "petsc4py/PETSc/petscdmshell.pxi":223 * cdef PetscDM odm = NULL * CHKERR( MatGetDM(cmat[0], &odm) ) * if odm == NULL: # <<<<<<<<<<<<<< * CHKERR( MatSetDM(cmat[0], dm) ) * return PETSC_SUCCESS */ } /* "petsc4py/PETSc/petscdmshell.pxi":225 * if odm == NULL: * CHKERR( MatSetDM(cmat[0], dm) ) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * cdef PetscErrorCode DMSHELL_Coarsen( */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petscdmshell.pxi":208 * return PETSC_SUCCESS * * cdef PetscErrorCode DMSHELL_CreateMatrix( # <<<<<<<<<<<<<< * PetscDM dm, * PetscMat *cmat) except PETSC_ERR_PYTHON with gil: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.DMSHELL_CreateMatrix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Dm); __Pyx_XDECREF((PyObject *)__pyx_v_mat); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_matrix); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petscdmshell.pxi":227 * return PETSC_SUCCESS * * cdef PetscErrorCode DMSHELL_Coarsen( # <<<<<<<<<<<<<< * PetscDM dm, * MPI_Comm comm, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_DMSHELL_Coarsen(DM __pyx_v_dm, MPI_Comm __pyx_v_comm, DM *__pyx_v_dmc) { struct PyPetscDMObject *__pyx_v_Dm = 0; struct PyPetscDMObject *__pyx_v_Dmc = 0; struct PyPetscCommObject *__pyx_v_Comm = 0; PyObject *__pyx_v_context = NULL; PyObject *__pyx_v_coarsen = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); DM __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("DMSHELL_Coarsen", 0); /* "petsc4py/PETSc/petscdmshell.pxi":231 * MPI_Comm comm, * PetscDM *dmc) except PETSC_ERR_PYTHON with gil: * cdef DM Dm = subtype_DM(dm)() # <<<<<<<<<<<<<< * cdef DM Dmc * cdef Comm Comm = new_Comm(comm) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(29, 231, __pyx_L1_error) __pyx_v_Dm = ((struct PyPetscDMObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":233 * cdef DM Dm = subtype_DM(dm)() * cdef DM Dmc * cdef Comm Comm = new_Comm(comm) # <<<<<<<<<<<<<< * Dm.dm = dm * CHKERR( PetscINCREF(Dm.obj) ) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_new_Comm(__pyx_v_comm)); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_Comm = ((struct PyPetscCommObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":234 * cdef DM Dmc * cdef Comm Comm = new_Comm(comm) * Dm.dm = dm # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(Dm.obj) ) * context = Dm.get_attr('__coarsen__') */ __pyx_v_Dm->dm = __pyx_v_dm; /* "petsc4py/PETSc/petscdmshell.pxi":235 * cdef Comm Comm = new_Comm(comm) * Dm.dm = dm * CHKERR( PetscINCREF(Dm.obj) ) # <<<<<<<<<<<<<< * context = Dm.get_attr('__coarsen__') * assert context is not None and type(context) is tuple */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dm->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 235, __pyx_L1_error) /* "petsc4py/PETSc/petscdmshell.pxi":236 * Dm.dm = dm * CHKERR( PetscINCREF(Dm.obj) ) * context = Dm.get_attr('__coarsen__') # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple * (coarsen, args, kargs) = context */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_Dm->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Dm), ((char *)"__coarsen__")); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_context = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":237 * CHKERR( PetscINCREF(Dm.obj) ) * context = Dm.get_attr('__coarsen__') * assert context is not None and type(context) is tuple # <<<<<<<<<<<<<< * (coarsen, args, kargs) = context * Dmc = coarsen(Dm, Comm, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_5 = (__pyx_v_context != Py_None); if (__pyx_t_5) { } else { __pyx_t_4 = __pyx_t_5; goto __pyx_L3_bool_binop_done; } __pyx_t_5 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_4 = __pyx_t_5; __pyx_L3_bool_binop_done:; if (unlikely(!__pyx_t_4)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(29, 237, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(29, 237, __pyx_L1_error) #endif /* "petsc4py/PETSc/petscdmshell.pxi":238 * context = Dm.get_attr('__coarsen__') * assert context is not None and type(context) is tuple * (coarsen, args, kargs) = context # <<<<<<<<<<<<<< * Dmc = coarsen(Dm, Comm, *args, **kargs) * CHKERR( PetscINCREF(Dmc.obj) ) */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(29, 238, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_1 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(29, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); index = 0; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(29, 238, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(29, 238, __pyx_L1_error) __pyx_L6_unpacking_done:; } __pyx_v_coarsen = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_args = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":239 * assert context is not None and type(context) is tuple * (coarsen, args, kargs) = context * Dmc = coarsen(Dm, Comm, *args, **kargs) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(Dmc.obj) ) * dmc[0] = Dmc.dm */ __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF((PyObject *)__pyx_v_Dm); __Pyx_GIVEREF((PyObject *)__pyx_v_Dm); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_Dm))) __PYX_ERR(29, 239, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_Comm); __Pyx_GIVEREF((PyObject *)__pyx_v_Comm); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_Comm))) __PYX_ERR(29, 239, __pyx_L1_error); __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyNumber_Add(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(29, 239, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_1 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_1 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_coarsen, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(29, 239, __pyx_L1_error) __pyx_v_Dmc = ((struct PyPetscDMObject *)__pyx_t_6); __pyx_t_6 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":240 * (coarsen, args, kargs) = context * Dmc = coarsen(Dm, Comm, *args, **kargs) * CHKERR( PetscINCREF(Dmc.obj) ) # <<<<<<<<<<<<<< * dmc[0] = Dmc.dm * return PETSC_SUCCESS */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dmc->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 240, __pyx_L1_error) /* "petsc4py/PETSc/petscdmshell.pxi":241 * Dmc = coarsen(Dm, Comm, *args, **kargs) * CHKERR( PetscINCREF(Dmc.obj) ) * dmc[0] = Dmc.dm # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_9 = __pyx_v_Dmc->dm; (__pyx_v_dmc[0]) = __pyx_t_9; /* "petsc4py/PETSc/petscdmshell.pxi":242 * CHKERR( PetscINCREF(Dmc.obj) ) * dmc[0] = Dmc.dm * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * cdef PetscErrorCode DMSHELL_Refine( */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petscdmshell.pxi":227 * return PETSC_SUCCESS * * cdef PetscErrorCode DMSHELL_Coarsen( # <<<<<<<<<<<<<< * PetscDM dm, * MPI_Comm comm, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.DMSHELL_Coarsen", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Dm); __Pyx_XDECREF((PyObject *)__pyx_v_Dmc); __Pyx_XDECREF((PyObject *)__pyx_v_Comm); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_coarsen); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petscdmshell.pxi":244 * return PETSC_SUCCESS * * cdef PetscErrorCode DMSHELL_Refine( # <<<<<<<<<<<<<< * PetscDM dm, * MPI_Comm comm, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_DMSHELL_Refine(DM __pyx_v_dm, MPI_Comm __pyx_v_comm, DM *__pyx_v_dmf) { struct PyPetscDMObject *__pyx_v_Dm = 0; struct PyPetscDMObject *__pyx_v_Dmf = 0; struct PyPetscCommObject *__pyx_v_Comm = 0; PyObject *__pyx_v_context = NULL; PyObject *__pyx_v_refine = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); DM __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("DMSHELL_Refine", 0); /* "petsc4py/PETSc/petscdmshell.pxi":248 * MPI_Comm comm, * PetscDM *dmf) except PETSC_ERR_PYTHON with gil: * cdef DM Dm = subtype_DM(dm)() # <<<<<<<<<<<<<< * cdef DM Dmf * cdef Comm Comm = new_Comm(comm) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(29, 248, __pyx_L1_error) __pyx_v_Dm = ((struct PyPetscDMObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":250 * cdef DM Dm = subtype_DM(dm)() * cdef DM Dmf * cdef Comm Comm = new_Comm(comm) # <<<<<<<<<<<<<< * Dm.dm = dm * CHKERR( PetscINCREF(Dm.obj) ) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_new_Comm(__pyx_v_comm)); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_Comm = ((struct PyPetscCommObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":251 * cdef DM Dmf * cdef Comm Comm = new_Comm(comm) * Dm.dm = dm # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(Dm.obj) ) * context = Dm.get_attr('__refine__') */ __pyx_v_Dm->dm = __pyx_v_dm; /* "petsc4py/PETSc/petscdmshell.pxi":252 * cdef Comm Comm = new_Comm(comm) * Dm.dm = dm * CHKERR( PetscINCREF(Dm.obj) ) # <<<<<<<<<<<<<< * context = Dm.get_attr('__refine__') * assert context is not None and type(context) is tuple */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dm->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 252, __pyx_L1_error) /* "petsc4py/PETSc/petscdmshell.pxi":253 * Dm.dm = dm * CHKERR( PetscINCREF(Dm.obj) ) * context = Dm.get_attr('__refine__') # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple * (refine, args, kargs) = context */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_Dm->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Dm), ((char *)"__refine__")); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_context = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":254 * CHKERR( PetscINCREF(Dm.obj) ) * context = Dm.get_attr('__refine__') * assert context is not None and type(context) is tuple # <<<<<<<<<<<<<< * (refine, args, kargs) = context * Dmf = refine(Dm, Comm, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_5 = (__pyx_v_context != Py_None); if (__pyx_t_5) { } else { __pyx_t_4 = __pyx_t_5; goto __pyx_L3_bool_binop_done; } __pyx_t_5 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_4 = __pyx_t_5; __pyx_L3_bool_binop_done:; if (unlikely(!__pyx_t_4)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(29, 254, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(29, 254, __pyx_L1_error) #endif /* "petsc4py/PETSc/petscdmshell.pxi":255 * context = Dm.get_attr('__refine__') * assert context is not None and type(context) is tuple * (refine, args, kargs) = context # <<<<<<<<<<<<<< * Dmf = refine(Dm, Comm, *args, **kargs) * CHKERR( PetscINCREF(Dmf.obj) ) */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(29, 255, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_1 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(29, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); index = 0; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(29, 255, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(29, 255, __pyx_L1_error) __pyx_L6_unpacking_done:; } __pyx_v_refine = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_args = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":256 * assert context is not None and type(context) is tuple * (refine, args, kargs) = context * Dmf = refine(Dm, Comm, *args, **kargs) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(Dmf.obj) ) * dmf[0] = Dmf.dm */ __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF((PyObject *)__pyx_v_Dm); __Pyx_GIVEREF((PyObject *)__pyx_v_Dm); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_Dm))) __PYX_ERR(29, 256, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_Comm); __Pyx_GIVEREF((PyObject *)__pyx_v_Comm); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_Comm))) __PYX_ERR(29, 256, __pyx_L1_error); __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyNumber_Add(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(29, 256, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_1 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_1 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_refine, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(29, 256, __pyx_L1_error) __pyx_v_Dmf = ((struct PyPetscDMObject *)__pyx_t_6); __pyx_t_6 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":257 * (refine, args, kargs) = context * Dmf = refine(Dm, Comm, *args, **kargs) * CHKERR( PetscINCREF(Dmf.obj) ) # <<<<<<<<<<<<<< * dmf[0] = Dmf.dm * return PETSC_SUCCESS */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dmf->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 257, __pyx_L1_error) /* "petsc4py/PETSc/petscdmshell.pxi":258 * Dmf = refine(Dm, Comm, *args, **kargs) * CHKERR( PetscINCREF(Dmf.obj) ) * dmf[0] = Dmf.dm # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_9 = __pyx_v_Dmf->dm; (__pyx_v_dmf[0]) = __pyx_t_9; /* "petsc4py/PETSc/petscdmshell.pxi":259 * CHKERR( PetscINCREF(Dmf.obj) ) * dmf[0] = Dmf.dm * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * cdef PetscErrorCode DMSHELL_CreateInterpolation( */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petscdmshell.pxi":244 * return PETSC_SUCCESS * * cdef PetscErrorCode DMSHELL_Refine( # <<<<<<<<<<<<<< * PetscDM dm, * MPI_Comm comm, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.DMSHELL_Refine", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Dm); __Pyx_XDECREF((PyObject *)__pyx_v_Dmf); __Pyx_XDECREF((PyObject *)__pyx_v_Comm); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_refine); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petscdmshell.pxi":261 * return PETSC_SUCCESS * * cdef PetscErrorCode DMSHELL_CreateInterpolation( # <<<<<<<<<<<<<< * PetscDM dmc, * PetscDM dmf, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_DMSHELL_CreateInterpolation(DM __pyx_v_dmc, DM __pyx_v_dmf, Mat *__pyx_v_cmat, Vec *__pyx_v_cvec) { struct PyPetscDMObject *__pyx_v_Dmc = 0; struct PyPetscDMObject *__pyx_v_Dmf = 0; struct PyPetscMatObject *__pyx_v_mat = 0; struct PyPetscVecObject *__pyx_v_vec = 0; PyObject *__pyx_v_context = NULL; PyObject *__pyx_v_interpolation = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); Mat __pyx_t_9; Vec __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("DMSHELL_CreateInterpolation", 0); /* "petsc4py/PETSc/petscdmshell.pxi":266 * PetscMat *cmat, * PetscVec *cvec) except PETSC_ERR_PYTHON with gil: * cdef DM Dmc = subtype_DM(dmc)() # <<<<<<<<<<<<<< * cdef DM Dmf = subtype_DM(dmf)() * cdef Mat mat */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dmc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(29, 266, __pyx_L1_error) __pyx_v_Dmc = ((struct PyPetscDMObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":267 * PetscVec *cvec) except PETSC_ERR_PYTHON with gil: * cdef DM Dmc = subtype_DM(dmc)() * cdef DM Dmf = subtype_DM(dmf)() # <<<<<<<<<<<<<< * cdef Mat mat * cdef Vec vec */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dmf)); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(29, 267, __pyx_L1_error) __pyx_v_Dmf = ((struct PyPetscDMObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":270 * cdef Mat mat * cdef Vec vec * Dmc.dm = dmc # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(Dmc.obj) ) * Dmf.dm = dmf */ __pyx_v_Dmc->dm = __pyx_v_dmc; /* "petsc4py/PETSc/petscdmshell.pxi":271 * cdef Vec vec * Dmc.dm = dmc * CHKERR( PetscINCREF(Dmc.obj) ) # <<<<<<<<<<<<<< * Dmf.dm = dmf * CHKERR( PetscINCREF(Dmf.obj) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dmc->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 271, __pyx_L1_error) /* "petsc4py/PETSc/petscdmshell.pxi":272 * Dmc.dm = dmc * CHKERR( PetscINCREF(Dmc.obj) ) * Dmf.dm = dmf # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(Dmf.obj) ) * context = Dmc.get_attr('__create_interpolation__') */ __pyx_v_Dmf->dm = __pyx_v_dmf; /* "petsc4py/PETSc/petscdmshell.pxi":273 * CHKERR( PetscINCREF(Dmc.obj) ) * Dmf.dm = dmf * CHKERR( PetscINCREF(Dmf.obj) ) # <<<<<<<<<<<<<< * context = Dmc.get_attr('__create_interpolation__') * assert context is not None and type(context) is tuple */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dmf->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 273, __pyx_L1_error) /* "petsc4py/PETSc/petscdmshell.pxi":274 * Dmf.dm = dmf * CHKERR( PetscINCREF(Dmf.obj) ) * context = Dmc.get_attr('__create_interpolation__') # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple * (interpolation, args, kargs) = context */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_Dmc->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Dmc), ((char *)"__create_interpolation__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":275 * CHKERR( PetscINCREF(Dmf.obj) ) * context = Dmc.get_attr('__create_interpolation__') * assert context is not None and type(context) is tuple # <<<<<<<<<<<<<< * (interpolation, args, kargs) = context * mat, vec = interpolation(Dmc, Dmf, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_5 = (__pyx_v_context != Py_None); if (__pyx_t_5) { } else { __pyx_t_4 = __pyx_t_5; goto __pyx_L3_bool_binop_done; } __pyx_t_5 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_4 = __pyx_t_5; __pyx_L3_bool_binop_done:; if (unlikely(!__pyx_t_4)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(29, 275, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(29, 275, __pyx_L1_error) #endif /* "petsc4py/PETSc/petscdmshell.pxi":276 * context = Dmc.get_attr('__create_interpolation__') * assert context is not None and type(context) is tuple * (interpolation, args, kargs) = context # <<<<<<<<<<<<<< * mat, vec = interpolation(Dmc, Dmf, *args, **kargs) * CHKERR( PetscINCREF(mat.obj) ) */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(29, 276, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(29, 276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(29, 276, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(29, 276, __pyx_L1_error) __pyx_L6_unpacking_done:; } __pyx_v_interpolation = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":277 * assert context is not None and type(context) is tuple * (interpolation, args, kargs) = context * mat, vec = interpolation(Dmc, Dmf, *args, **kargs) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(mat.obj) ) * cmat[0] = mat.mat */ __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF((PyObject *)__pyx_v_Dmc); __Pyx_GIVEREF((PyObject *)__pyx_v_Dmc); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_Dmc))) __PYX_ERR(29, 277, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_Dmf); __Pyx_GIVEREF((PyObject *)__pyx_v_Dmf); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_Dmf))) __PYX_ERR(29, 277, __pyx_L1_error); __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(29, 277, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_2 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } else { __pyx_t_2 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_interpolation, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { PyObject* sequence = __pyx_t_6; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(29, 277, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_1 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(29, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); index = 0; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(29, 277, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L8_unpacking_done; __pyx_L7_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(29, 277, __pyx_L1_error) __pyx_L8_unpacking_done:; } if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(29, 277, __pyx_L1_error) if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(29, 277, __pyx_L1_error) __pyx_v_mat = ((struct PyPetscMatObject *)__pyx_t_2); __pyx_t_2 = 0; __pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":278 * (interpolation, args, kargs) = context * mat, vec = interpolation(Dmc, Dmf, *args, **kargs) * CHKERR( PetscINCREF(mat.obj) ) # <<<<<<<<<<<<<< * cmat[0] = mat.mat * if cvec == NULL: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_mat->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 278, __pyx_L1_error) /* "petsc4py/PETSc/petscdmshell.pxi":279 * mat, vec = interpolation(Dmc, Dmf, *args, **kargs) * CHKERR( PetscINCREF(mat.obj) ) * cmat[0] = mat.mat # <<<<<<<<<<<<<< * if cvec == NULL: * return PETSC_SUCCESS */ __pyx_t_9 = __pyx_v_mat->mat; (__pyx_v_cmat[0]) = __pyx_t_9; /* "petsc4py/PETSc/petscdmshell.pxi":280 * CHKERR( PetscINCREF(mat.obj) ) * cmat[0] = mat.mat * if cvec == NULL: # <<<<<<<<<<<<<< * return PETSC_SUCCESS * if vec is None: */ __pyx_t_4 = (__pyx_v_cvec == NULL); if (__pyx_t_4) { /* "petsc4py/PETSc/petscdmshell.pxi":281 * cmat[0] = mat.mat * if cvec == NULL: * return PETSC_SUCCESS # <<<<<<<<<<<<<< * if vec is None: * cvec[0] = NULL */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petscdmshell.pxi":280 * CHKERR( PetscINCREF(mat.obj) ) * cmat[0] = mat.mat * if cvec == NULL: # <<<<<<<<<<<<<< * return PETSC_SUCCESS * if vec is None: */ } /* "petsc4py/PETSc/petscdmshell.pxi":282 * if cvec == NULL: * return PETSC_SUCCESS * if vec is None: # <<<<<<<<<<<<<< * cvec[0] = NULL * else: */ __pyx_t_4 = (((PyObject *)__pyx_v_vec) == Py_None); if (__pyx_t_4) { /* "petsc4py/PETSc/petscdmshell.pxi":283 * return PETSC_SUCCESS * if vec is None: * cvec[0] = NULL # <<<<<<<<<<<<<< * else: * CHKERR( PetscINCREF(vec.obj) ) */ (__pyx_v_cvec[0]) = NULL; /* "petsc4py/PETSc/petscdmshell.pxi":282 * if cvec == NULL: * return PETSC_SUCCESS * if vec is None: # <<<<<<<<<<<<<< * cvec[0] = NULL * else: */ goto __pyx_L10; } /* "petsc4py/PETSc/petscdmshell.pxi":285 * cvec[0] = NULL * else: * CHKERR( PetscINCREF(vec.obj) ) # <<<<<<<<<<<<<< * cvec[0] = vec.vec * return PETSC_SUCCESS */ /*else*/ { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_vec->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 285, __pyx_L1_error) /* "petsc4py/PETSc/petscdmshell.pxi":286 * else: * CHKERR( PetscINCREF(vec.obj) ) * cvec[0] = vec.vec # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_10 = __pyx_v_vec->vec; (__pyx_v_cvec[0]) = __pyx_t_10; } __pyx_L10:; /* "petsc4py/PETSc/petscdmshell.pxi":287 * CHKERR( PetscINCREF(vec.obj) ) * cvec[0] = vec.vec * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * cdef PetscErrorCode DMSHELL_CreateInjection( */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petscdmshell.pxi":261 * return PETSC_SUCCESS * * cdef PetscErrorCode DMSHELL_CreateInterpolation( # <<<<<<<<<<<<<< * PetscDM dmc, * PetscDM dmf, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.DMSHELL_CreateInterpolation", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Dmc); __Pyx_XDECREF((PyObject *)__pyx_v_Dmf); __Pyx_XDECREF((PyObject *)__pyx_v_mat); __Pyx_XDECREF((PyObject *)__pyx_v_vec); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_interpolation); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petscdmshell.pxi":289 * return PETSC_SUCCESS * * cdef PetscErrorCode DMSHELL_CreateInjection( # <<<<<<<<<<<<<< * PetscDM dmc, * PetscDM dmf, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_DMSHELL_CreateInjection(DM __pyx_v_dmc, DM __pyx_v_dmf, Mat *__pyx_v_cmat) { struct PyPetscDMObject *__pyx_v_Dmc = 0; struct PyPetscDMObject *__pyx_v_Dmf = 0; struct PyPetscMatObject *__pyx_v_mat = 0; PyObject *__pyx_v_context = NULL; PyObject *__pyx_v_injection = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); Mat __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("DMSHELL_CreateInjection", 0); /* "petsc4py/PETSc/petscdmshell.pxi":293 * PetscDM dmf, * PetscMat *cmat) except PETSC_ERR_PYTHON with gil: * cdef DM Dmc = subtype_DM(dmc)() # <<<<<<<<<<<<<< * cdef DM Dmf = subtype_DM(dmf)() * cdef Mat mat */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dmc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(29, 293, __pyx_L1_error) __pyx_v_Dmc = ((struct PyPetscDMObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":294 * PetscMat *cmat) except PETSC_ERR_PYTHON with gil: * cdef DM Dmc = subtype_DM(dmc)() * cdef DM Dmf = subtype_DM(dmf)() # <<<<<<<<<<<<<< * cdef Mat mat * Dmc.dm = dmc */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dmf)); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(29, 294, __pyx_L1_error) __pyx_v_Dmf = ((struct PyPetscDMObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":296 * cdef DM Dmf = subtype_DM(dmf)() * cdef Mat mat * Dmc.dm = dmc # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(Dmc.obj) ) * Dmf.dm = dmf */ __pyx_v_Dmc->dm = __pyx_v_dmc; /* "petsc4py/PETSc/petscdmshell.pxi":297 * cdef Mat mat * Dmc.dm = dmc * CHKERR( PetscINCREF(Dmc.obj) ) # <<<<<<<<<<<<<< * Dmf.dm = dmf * CHKERR( PetscINCREF(Dmf.obj) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dmc->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 297, __pyx_L1_error) /* "petsc4py/PETSc/petscdmshell.pxi":298 * Dmc.dm = dmc * CHKERR( PetscINCREF(Dmc.obj) ) * Dmf.dm = dmf # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(Dmf.obj) ) * context = Dmc.get_attr('__create_injection__') */ __pyx_v_Dmf->dm = __pyx_v_dmf; /* "petsc4py/PETSc/petscdmshell.pxi":299 * CHKERR( PetscINCREF(Dmc.obj) ) * Dmf.dm = dmf * CHKERR( PetscINCREF(Dmf.obj) ) # <<<<<<<<<<<<<< * context = Dmc.get_attr('__create_injection__') * assert context is not None and type(context) is tuple */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dmf->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 299, __pyx_L1_error) /* "petsc4py/PETSc/petscdmshell.pxi":300 * Dmf.dm = dmf * CHKERR( PetscINCREF(Dmf.obj) ) * context = Dmc.get_attr('__create_injection__') # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple * (injection, args, kargs) = context */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_Dmc->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Dmc), ((char *)"__create_injection__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":301 * CHKERR( PetscINCREF(Dmf.obj) ) * context = Dmc.get_attr('__create_injection__') * assert context is not None and type(context) is tuple # <<<<<<<<<<<<<< * (injection, args, kargs) = context * mat = injection(Dmc, Dmf, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_5 = (__pyx_v_context != Py_None); if (__pyx_t_5) { } else { __pyx_t_4 = __pyx_t_5; goto __pyx_L3_bool_binop_done; } __pyx_t_5 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_4 = __pyx_t_5; __pyx_L3_bool_binop_done:; if (unlikely(!__pyx_t_4)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(29, 301, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(29, 301, __pyx_L1_error) #endif /* "petsc4py/PETSc/petscdmshell.pxi":302 * context = Dmc.get_attr('__create_injection__') * assert context is not None and type(context) is tuple * (injection, args, kargs) = context # <<<<<<<<<<<<<< * mat = injection(Dmc, Dmf, *args, **kargs) * CHKERR( PetscINCREF(mat.obj) ) */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(29, 302, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(29, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(29, 302, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(29, 302, __pyx_L1_error) __pyx_L6_unpacking_done:; } __pyx_v_injection = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":303 * assert context is not None and type(context) is tuple * (injection, args, kargs) = context * mat = injection(Dmc, Dmf, *args, **kargs) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(mat.obj) ) * cmat[0] = mat.mat */ __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF((PyObject *)__pyx_v_Dmc); __Pyx_GIVEREF((PyObject *)__pyx_v_Dmc); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_Dmc))) __PYX_ERR(29, 303, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_Dmf); __Pyx_GIVEREF((PyObject *)__pyx_v_Dmf); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_Dmf))) __PYX_ERR(29, 303, __pyx_L1_error); __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(29, 303, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_2 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } else { __pyx_t_2 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_injection, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(29, 303, __pyx_L1_error) __pyx_v_mat = ((struct PyPetscMatObject *)__pyx_t_6); __pyx_t_6 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":304 * (injection, args, kargs) = context * mat = injection(Dmc, Dmf, *args, **kargs) * CHKERR( PetscINCREF(mat.obj) ) # <<<<<<<<<<<<<< * cmat[0] = mat.mat * return PETSC_SUCCESS */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_mat->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 304, __pyx_L1_error) /* "petsc4py/PETSc/petscdmshell.pxi":305 * mat = injection(Dmc, Dmf, *args, **kargs) * CHKERR( PetscINCREF(mat.obj) ) * cmat[0] = mat.mat # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_9 = __pyx_v_mat->mat; (__pyx_v_cmat[0]) = __pyx_t_9; /* "petsc4py/PETSc/petscdmshell.pxi":306 * CHKERR( PetscINCREF(mat.obj) ) * cmat[0] = mat.mat * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * cdef PetscErrorCode DMSHELL_CreateRestriction( */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petscdmshell.pxi":289 * return PETSC_SUCCESS * * cdef PetscErrorCode DMSHELL_CreateInjection( # <<<<<<<<<<<<<< * PetscDM dmc, * PetscDM dmf, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.DMSHELL_CreateInjection", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Dmc); __Pyx_XDECREF((PyObject *)__pyx_v_Dmf); __Pyx_XDECREF((PyObject *)__pyx_v_mat); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_injection); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petscdmshell.pxi":308 * return PETSC_SUCCESS * * cdef PetscErrorCode DMSHELL_CreateRestriction( # <<<<<<<<<<<<<< * PetscDM dmf, * PetscDM dmc, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_DMSHELL_CreateRestriction(DM __pyx_v_dmf, DM __pyx_v_dmc, Mat *__pyx_v_cmat) { struct PyPetscDMObject *__pyx_v_Dmf = 0; struct PyPetscDMObject *__pyx_v_Dmc = 0; struct PyPetscMatObject *__pyx_v_mat = 0; PyObject *__pyx_v_context = NULL; PyObject *__pyx_v_restriction = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); Mat __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("DMSHELL_CreateRestriction", 0); /* "petsc4py/PETSc/petscdmshell.pxi":312 * PetscDM dmc, * PetscMat *cmat) except PETSC_ERR_PYTHON with gil: * cdef DM Dmf = subtype_DM(dmf)() # <<<<<<<<<<<<<< * cdef DM Dmc = subtype_DM(dmc)() * cdef Mat mat */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dmf)); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(29, 312, __pyx_L1_error) __pyx_v_Dmf = ((struct PyPetscDMObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":313 * PetscMat *cmat) except PETSC_ERR_PYTHON with gil: * cdef DM Dmf = subtype_DM(dmf)() * cdef DM Dmc = subtype_DM(dmc)() # <<<<<<<<<<<<<< * cdef Mat mat * Dmf.dm = dmf */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dmc)); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(29, 313, __pyx_L1_error) __pyx_v_Dmc = ((struct PyPetscDMObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":315 * cdef DM Dmc = subtype_DM(dmc)() * cdef Mat mat * Dmf.dm = dmf # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(Dmf.obj) ) * Dmc.dm = dmc */ __pyx_v_Dmf->dm = __pyx_v_dmf; /* "petsc4py/PETSc/petscdmshell.pxi":316 * cdef Mat mat * Dmf.dm = dmf * CHKERR( PetscINCREF(Dmf.obj) ) # <<<<<<<<<<<<<< * Dmc.dm = dmc * CHKERR( PetscINCREF(Dmc.obj) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dmf->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 316, __pyx_L1_error) /* "petsc4py/PETSc/petscdmshell.pxi":317 * Dmf.dm = dmf * CHKERR( PetscINCREF(Dmf.obj) ) * Dmc.dm = dmc # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(Dmc.obj) ) * context = Dmf.get_attr('__create_restriction__') */ __pyx_v_Dmc->dm = __pyx_v_dmc; /* "petsc4py/PETSc/petscdmshell.pxi":318 * CHKERR( PetscINCREF(Dmf.obj) ) * Dmc.dm = dmc * CHKERR( PetscINCREF(Dmc.obj) ) # <<<<<<<<<<<<<< * context = Dmf.get_attr('__create_restriction__') * assert context is not None and type(context) is tuple */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dmc->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 318, __pyx_L1_error) /* "petsc4py/PETSc/petscdmshell.pxi":319 * Dmc.dm = dmc * CHKERR( PetscINCREF(Dmc.obj) ) * context = Dmf.get_attr('__create_restriction__') # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple * (restriction, args, kargs) = context */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_Dmf->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Dmf), ((char *)"__create_restriction__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":320 * CHKERR( PetscINCREF(Dmc.obj) ) * context = Dmf.get_attr('__create_restriction__') * assert context is not None and type(context) is tuple # <<<<<<<<<<<<<< * (restriction, args, kargs) = context * mat = restriction(Dmf, Dmc, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_5 = (__pyx_v_context != Py_None); if (__pyx_t_5) { } else { __pyx_t_4 = __pyx_t_5; goto __pyx_L3_bool_binop_done; } __pyx_t_5 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_4 = __pyx_t_5; __pyx_L3_bool_binop_done:; if (unlikely(!__pyx_t_4)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(29, 320, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(29, 320, __pyx_L1_error) #endif /* "petsc4py/PETSc/petscdmshell.pxi":321 * context = Dmf.get_attr('__create_restriction__') * assert context is not None and type(context) is tuple * (restriction, args, kargs) = context # <<<<<<<<<<<<<< * mat = restriction(Dmf, Dmc, *args, **kargs) * CHKERR( PetscINCREF(mat.obj) ) */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(29, 321, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(29, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(29, 321, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(29, 321, __pyx_L1_error) __pyx_L6_unpacking_done:; } __pyx_v_restriction = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":322 * assert context is not None and type(context) is tuple * (restriction, args, kargs) = context * mat = restriction(Dmf, Dmc, *args, **kargs) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(mat.obj) ) * cmat[0] = mat.mat */ __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF((PyObject *)__pyx_v_Dmf); __Pyx_GIVEREF((PyObject *)__pyx_v_Dmf); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_Dmf))) __PYX_ERR(29, 322, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_Dmc); __Pyx_GIVEREF((PyObject *)__pyx_v_Dmc); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_Dmc))) __PYX_ERR(29, 322, __pyx_L1_error); __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(29, 322, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_2 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } else { __pyx_t_2 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_restriction, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(29, 322, __pyx_L1_error) __pyx_v_mat = ((struct PyPetscMatObject *)__pyx_t_6); __pyx_t_6 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":323 * (restriction, args, kargs) = context * mat = restriction(Dmf, Dmc, *args, **kargs) * CHKERR( PetscINCREF(mat.obj) ) # <<<<<<<<<<<<<< * cmat[0] = mat.mat * return PETSC_SUCCESS */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_mat->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 323, __pyx_L1_error) /* "petsc4py/PETSc/petscdmshell.pxi":324 * mat = restriction(Dmf, Dmc, *args, **kargs) * CHKERR( PetscINCREF(mat.obj) ) * cmat[0] = mat.mat # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_9 = __pyx_v_mat->mat; (__pyx_v_cmat[0]) = __pyx_t_9; /* "petsc4py/PETSc/petscdmshell.pxi":325 * CHKERR( PetscINCREF(mat.obj) ) * cmat[0] = mat.mat * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * cdef PetscErrorCode DMSHELL_CreateFieldDecomposition( */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petscdmshell.pxi":308 * return PETSC_SUCCESS * * cdef PetscErrorCode DMSHELL_CreateRestriction( # <<<<<<<<<<<<<< * PetscDM dmf, * PetscDM dmc, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.DMSHELL_CreateRestriction", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Dmf); __Pyx_XDECREF((PyObject *)__pyx_v_Dmc); __Pyx_XDECREF((PyObject *)__pyx_v_mat); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_restriction); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petscdmshell.pxi":327 * return PETSC_SUCCESS * * cdef PetscErrorCode DMSHELL_CreateFieldDecomposition( # <<<<<<<<<<<<<< * PetscDM dm, * PetscInt *clen, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_DMSHELL_CreateFieldDecomposition(DM __pyx_v_dm, PetscInt *__pyx_v_clen, char ***__pyx_v_namelist, IS **__pyx_v_islist, DM **__pyx_v_dmlist) { struct PyPetscDMObject *__pyx_v_Dm = 0; int __pyx_v_i; char const *__pyx_v_cname; PyObject *__pyx_v_context = NULL; PyObject *__pyx_v_decomp = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PyObject *__pyx_v_names = NULL; PyObject *__pyx_v_ises = NULL; PyObject *__pyx_v_dms = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); PyObject *__pyx_t_9 = NULL; Py_ssize_t __pyx_t_10; Py_ssize_t __pyx_t_11; int __pyx_t_12; IS __pyx_t_13; DM __pyx_t_14; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("DMSHELL_CreateFieldDecomposition", 0); /* "petsc4py/PETSc/petscdmshell.pxi":333 * PetscIS **islist, * PetscDM **dmlist) except PETSC_ERR_PYTHON with gil: * cdef DM Dm = subtype_DM(dm)() # <<<<<<<<<<<<<< * cdef int i * cdef const char *cname = NULL */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(29, 333, __pyx_L1_error) __pyx_v_Dm = ((struct PyPetscDMObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":335 * cdef DM Dm = subtype_DM(dm)() * cdef int i * cdef const char *cname = NULL # <<<<<<<<<<<<<< * Dm.dm = dm * CHKERR( PetscINCREF(Dm.obj) ) */ __pyx_v_cname = NULL; /* "petsc4py/PETSc/petscdmshell.pxi":336 * cdef int i * cdef const char *cname = NULL * Dm.dm = dm # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(Dm.obj) ) * context = Dm.get_attr('__create_field_decomp__') */ __pyx_v_Dm->dm = __pyx_v_dm; /* "petsc4py/PETSc/petscdmshell.pxi":337 * cdef const char *cname = NULL * Dm.dm = dm * CHKERR( PetscINCREF(Dm.obj) ) # <<<<<<<<<<<<<< * context = Dm.get_attr('__create_field_decomp__') * assert context is not None and type(context) is tuple */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dm->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 337, __pyx_L1_error) /* "petsc4py/PETSc/petscdmshell.pxi":338 * Dm.dm = dm * CHKERR( PetscINCREF(Dm.obj) ) * context = Dm.get_attr('__create_field_decomp__') # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple * (decomp, args, kargs) = context */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_Dm->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Dm), ((char *)"__create_field_decomp__")); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_context = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":339 * CHKERR( PetscINCREF(Dm.obj) ) * context = Dm.get_attr('__create_field_decomp__') * assert context is not None and type(context) is tuple # <<<<<<<<<<<<<< * (decomp, args, kargs) = context * names, ises, dms = decomp(Dm, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_5 = (__pyx_v_context != Py_None); if (__pyx_t_5) { } else { __pyx_t_4 = __pyx_t_5; goto __pyx_L3_bool_binop_done; } __pyx_t_5 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_4 = __pyx_t_5; __pyx_L3_bool_binop_done:; if (unlikely(!__pyx_t_4)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(29, 339, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(29, 339, __pyx_L1_error) #endif /* "petsc4py/PETSc/petscdmshell.pxi":340 * context = Dm.get_attr('__create_field_decomp__') * assert context is not None and type(context) is tuple * (decomp, args, kargs) = context # <<<<<<<<<<<<<< * names, ises, dms = decomp(Dm, *args, **kargs) * */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(29, 340, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_1 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(29, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); index = 0; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(29, 340, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(29, 340, __pyx_L1_error) __pyx_L6_unpacking_done:; } __pyx_v_decomp = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_args = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":341 * assert context is not None and type(context) is tuple * (decomp, args, kargs) = context * names, ises, dms = decomp(Dm, *args, **kargs) # <<<<<<<<<<<<<< * * if clen != NULL: */ __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF((PyObject *)__pyx_v_Dm); __Pyx_GIVEREF((PyObject *)__pyx_v_Dm); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_Dm))) __PYX_ERR(29, 341, __pyx_L1_error); __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyNumber_Add(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(29, 341, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_1 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_1 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_decomp, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { PyObject* sequence = __pyx_t_6; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(29, 341, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_7 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); __pyx_t_7 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_7); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_7)) __PYX_ERR(29, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { Py_ssize_t index = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(29, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_9); if (unlikely(!__pyx_t_1)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_8(__pyx_t_9); if (unlikely(!__pyx_t_2)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 2; __pyx_t_7 = __pyx_t_8(__pyx_t_9); if (unlikely(!__pyx_t_7)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_7); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_9), 3) < 0) __PYX_ERR(29, 341, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L8_unpacking_done; __pyx_L7_unpacking_failed:; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(29, 341, __pyx_L1_error) __pyx_L8_unpacking_done:; } __pyx_v_names = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_ises = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_dms = __pyx_t_7; __pyx_t_7 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":343 * names, ises, dms = decomp(Dm, *args, **kargs) * * if clen != NULL: # <<<<<<<<<<<<<< * if names is not None: * clen[0] = len(names) */ __pyx_t_4 = (__pyx_v_clen != NULL); if (__pyx_t_4) { /* "petsc4py/PETSc/petscdmshell.pxi":344 * * if clen != NULL: * if names is not None: # <<<<<<<<<<<<<< * clen[0] = len(names) * elif ises is not None: */ __pyx_t_4 = (__pyx_v_names != Py_None); if (__pyx_t_4) { /* "petsc4py/PETSc/petscdmshell.pxi":345 * if clen != NULL: * if names is not None: * clen[0] = len(names) # <<<<<<<<<<<<<< * elif ises is not None: * clen[0] = len(ises) */ __pyx_t_10 = PyObject_Length(__pyx_v_names); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(29, 345, __pyx_L1_error) (__pyx_v_clen[0]) = ((PetscInt)__pyx_t_10); /* "petsc4py/PETSc/petscdmshell.pxi":344 * * if clen != NULL: * if names is not None: # <<<<<<<<<<<<<< * clen[0] = len(names) * elif ises is not None: */ goto __pyx_L10; } /* "petsc4py/PETSc/petscdmshell.pxi":346 * if names is not None: * clen[0] = len(names) * elif ises is not None: # <<<<<<<<<<<<<< * clen[0] = len(ises) * elif dms is not None: */ __pyx_t_4 = (__pyx_v_ises != Py_None); if (__pyx_t_4) { /* "petsc4py/PETSc/petscdmshell.pxi":347 * clen[0] = len(names) * elif ises is not None: * clen[0] = len(ises) # <<<<<<<<<<<<<< * elif dms is not None: * clen[0] = len(dms) */ __pyx_t_10 = PyObject_Length(__pyx_v_ises); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(29, 347, __pyx_L1_error) (__pyx_v_clen[0]) = ((PetscInt)__pyx_t_10); /* "petsc4py/PETSc/petscdmshell.pxi":346 * if names is not None: * clen[0] = len(names) * elif ises is not None: # <<<<<<<<<<<<<< * clen[0] = len(ises) * elif dms is not None: */ goto __pyx_L10; } /* "petsc4py/PETSc/petscdmshell.pxi":348 * elif ises is not None: * clen[0] = len(ises) * elif dms is not None: # <<<<<<<<<<<<<< * clen[0] = len(dms) * else: */ __pyx_t_4 = (__pyx_v_dms != Py_None); if (__pyx_t_4) { /* "petsc4py/PETSc/petscdmshell.pxi":349 * clen[0] = len(ises) * elif dms is not None: * clen[0] = len(dms) # <<<<<<<<<<<<<< * else: * clen[0] = 0 */ __pyx_t_10 = PyObject_Length(__pyx_v_dms); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(29, 349, __pyx_L1_error) (__pyx_v_clen[0]) = ((PetscInt)__pyx_t_10); /* "petsc4py/PETSc/petscdmshell.pxi":348 * elif ises is not None: * clen[0] = len(ises) * elif dms is not None: # <<<<<<<<<<<<<< * clen[0] = len(dms) * else: */ goto __pyx_L10; } /* "petsc4py/PETSc/petscdmshell.pxi":351 * clen[0] = len(dms) * else: * clen[0] = 0 # <<<<<<<<<<<<<< * * if namelist != NULL and names is not None: */ /*else*/ { (__pyx_v_clen[0]) = 0; } __pyx_L10:; /* "petsc4py/PETSc/petscdmshell.pxi":343 * names, ises, dms = decomp(Dm, *args, **kargs) * * if clen != NULL: # <<<<<<<<<<<<<< * if names is not None: * clen[0] = len(names) */ } /* "petsc4py/PETSc/petscdmshell.pxi":353 * clen[0] = 0 * * if namelist != NULL and names is not None: # <<<<<<<<<<<<<< * CHKERR( PetscMalloc(len(names)*sizeof(char**), namelist) ) * for i in range(len(names)): */ __pyx_t_5 = (__pyx_v_namelist != NULL); if (__pyx_t_5) { } else { __pyx_t_4 = __pyx_t_5; goto __pyx_L12_bool_binop_done; } __pyx_t_5 = (__pyx_v_names != Py_None); __pyx_t_4 = __pyx_t_5; __pyx_L12_bool_binop_done:; if (__pyx_t_4) { /* "petsc4py/PETSc/petscdmshell.pxi":354 * * if namelist != NULL and names is not None: * CHKERR( PetscMalloc(len(names)*sizeof(char**), namelist) ) # <<<<<<<<<<<<<< * for i in range(len(names)): * names[i] = str2bytes(names[i], &cname) */ __pyx_t_10 = PyObject_Length(__pyx_v_names); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(29, 354, __pyx_L1_error) __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((__pyx_t_10 * (sizeof(char **))), __pyx_v_namelist)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 354, __pyx_L1_error) /* "petsc4py/PETSc/petscdmshell.pxi":355 * if namelist != NULL and names is not None: * CHKERR( PetscMalloc(len(names)*sizeof(char**), namelist) ) * for i in range(len(names)): # <<<<<<<<<<<<<< * names[i] = str2bytes(names[i], &cname) * CHKERR( PetscStrallocpy(cname, &(namelist[0][i])) ) */ __pyx_t_10 = PyObject_Length(__pyx_v_names); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(29, 355, __pyx_L1_error) __pyx_t_11 = __pyx_t_10; for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { __pyx_v_i = __pyx_t_12; /* "petsc4py/PETSc/petscdmshell.pxi":356 * CHKERR( PetscMalloc(len(names)*sizeof(char**), namelist) ) * for i in range(len(names)): * names[i] = str2bytes(names[i], &cname) # <<<<<<<<<<<<<< * CHKERR( PetscStrallocpy(cname, &(namelist[0][i])) ) * */ __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_names, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_t_6, (&__pyx_v_cname)); if (unlikely(!__pyx_t_7)) __PYX_ERR(29, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely((__Pyx_SetItemInt(__pyx_v_names, __pyx_v_i, __pyx_t_7, int, 1, __Pyx_PyInt_From_int, 0, 1, 1) < 0))) __PYX_ERR(29, 356, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":357 * for i in range(len(names)): * names[i] = str2bytes(names[i], &cname) * CHKERR( PetscStrallocpy(cname, &(namelist[0][i])) ) # <<<<<<<<<<<<<< * * if islist != NULL and ises is not None: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscStrallocpy(__pyx_v_cname, (&((__pyx_v_namelist[0])[__pyx_v_i])))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 357, __pyx_L1_error) } /* "petsc4py/PETSc/petscdmshell.pxi":353 * clen[0] = 0 * * if namelist != NULL and names is not None: # <<<<<<<<<<<<<< * CHKERR( PetscMalloc(len(names)*sizeof(char**), namelist) ) * for i in range(len(names)): */ } /* "petsc4py/PETSc/petscdmshell.pxi":359 * CHKERR( PetscStrallocpy(cname, &(namelist[0][i])) ) * * if islist != NULL and ises is not None: # <<<<<<<<<<<<<< * CHKERR( PetscMalloc(len(ises)*sizeof(PetscIS), islist) ) * for i in range(len(ises)): */ __pyx_t_5 = (__pyx_v_islist != NULL); if (__pyx_t_5) { } else { __pyx_t_4 = __pyx_t_5; goto __pyx_L17_bool_binop_done; } __pyx_t_5 = (__pyx_v_ises != Py_None); __pyx_t_4 = __pyx_t_5; __pyx_L17_bool_binop_done:; if (__pyx_t_4) { /* "petsc4py/PETSc/petscdmshell.pxi":360 * * if islist != NULL and ises is not None: * CHKERR( PetscMalloc(len(ises)*sizeof(PetscIS), islist) ) # <<<<<<<<<<<<<< * for i in range(len(ises)): * islist[0][i] = (ises[i]).iset */ __pyx_t_10 = PyObject_Length(__pyx_v_ises); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(29, 360, __pyx_L1_error) __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((__pyx_t_10 * (sizeof(IS))), __pyx_v_islist)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 360, __pyx_L1_error) /* "petsc4py/PETSc/petscdmshell.pxi":361 * if islist != NULL and ises is not None: * CHKERR( PetscMalloc(len(ises)*sizeof(PetscIS), islist) ) * for i in range(len(ises)): # <<<<<<<<<<<<<< * islist[0][i] = (ises[i]).iset * CHKERR( PetscINCREF((ises[i]).obj) ) */ __pyx_t_10 = PyObject_Length(__pyx_v_ises); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(29, 361, __pyx_L1_error) __pyx_t_11 = __pyx_t_10; for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { __pyx_v_i = __pyx_t_12; /* "petsc4py/PETSc/petscdmshell.pxi":362 * CHKERR( PetscMalloc(len(ises)*sizeof(PetscIS), islist) ) * for i in range(len(ises)): * islist[0][i] = (ises[i]).iset # <<<<<<<<<<<<<< * CHKERR( PetscINCREF((ises[i]).obj) ) * */ __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_ises, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(29, 362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (!(likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(29, 362, __pyx_L1_error) __pyx_t_13 = ((struct PyPetscISObject *)__pyx_t_7)->iset; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; ((__pyx_v_islist[0])[__pyx_v_i]) = __pyx_t_13; /* "petsc4py/PETSc/petscdmshell.pxi":363 * for i in range(len(ises)): * islist[0][i] = (ises[i]).iset * CHKERR( PetscINCREF((ises[i]).obj) ) # <<<<<<<<<<<<<< * * if dmlist != NULL and dms is not None: */ __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_ises, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(29, 363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (!(likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(29, 363, __pyx_L1_error) __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(((struct PyPetscISObject *)__pyx_t_7)->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 363, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } /* "petsc4py/PETSc/petscdmshell.pxi":359 * CHKERR( PetscStrallocpy(cname, &(namelist[0][i])) ) * * if islist != NULL and ises is not None: # <<<<<<<<<<<<<< * CHKERR( PetscMalloc(len(ises)*sizeof(PetscIS), islist) ) * for i in range(len(ises)): */ } /* "petsc4py/PETSc/petscdmshell.pxi":365 * CHKERR( PetscINCREF((ises[i]).obj) ) * * if dmlist != NULL and dms is not None: # <<<<<<<<<<<<<< * CHKERR( PetscMalloc(len(dms)*sizeof(PetscDM), dmlist) ) * for i in range(len(dms)): */ __pyx_t_5 = (__pyx_v_dmlist != NULL); if (__pyx_t_5) { } else { __pyx_t_4 = __pyx_t_5; goto __pyx_L22_bool_binop_done; } __pyx_t_5 = (__pyx_v_dms != Py_None); __pyx_t_4 = __pyx_t_5; __pyx_L22_bool_binop_done:; if (__pyx_t_4) { /* "petsc4py/PETSc/petscdmshell.pxi":366 * * if dmlist != NULL and dms is not None: * CHKERR( PetscMalloc(len(dms)*sizeof(PetscDM), dmlist) ) # <<<<<<<<<<<<<< * for i in range(len(dms)): * dmlist[0][i] = (dms[i]).dm */ __pyx_t_10 = PyObject_Length(__pyx_v_dms); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(29, 366, __pyx_L1_error) __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((__pyx_t_10 * (sizeof(DM))), __pyx_v_dmlist)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 366, __pyx_L1_error) /* "petsc4py/PETSc/petscdmshell.pxi":367 * if dmlist != NULL and dms is not None: * CHKERR( PetscMalloc(len(dms)*sizeof(PetscDM), dmlist) ) * for i in range(len(dms)): # <<<<<<<<<<<<<< * dmlist[0][i] = (dms[i]).dm * CHKERR( PetscINCREF((dms[i]).obj) ) */ __pyx_t_10 = PyObject_Length(__pyx_v_dms); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(29, 367, __pyx_L1_error) __pyx_t_11 = __pyx_t_10; for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { __pyx_v_i = __pyx_t_12; /* "petsc4py/PETSc/petscdmshell.pxi":368 * CHKERR( PetscMalloc(len(dms)*sizeof(PetscDM), dmlist) ) * for i in range(len(dms)): * dmlist[0][i] = (dms[i]).dm # <<<<<<<<<<<<<< * CHKERR( PetscINCREF((dms[i]).obj) ) * return PETSC_SUCCESS */ __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_dms, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(29, 368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (!(likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_8petsc4py_5PETSc_DM)))) __PYX_ERR(29, 368, __pyx_L1_error) __pyx_t_14 = ((struct PyPetscDMObject *)__pyx_t_7)->dm; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; ((__pyx_v_dmlist[0])[__pyx_v_i]) = __pyx_t_14; /* "petsc4py/PETSc/petscdmshell.pxi":369 * for i in range(len(dms)): * dmlist[0][i] = (dms[i]).dm * CHKERR( PetscINCREF((dms[i]).obj) ) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_dms, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(29, 369, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (!(likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_8petsc4py_5PETSc_DM)))) __PYX_ERR(29, 369, __pyx_L1_error) __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(((struct PyPetscDMObject *)__pyx_t_7)->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 369, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } /* "petsc4py/PETSc/petscdmshell.pxi":365 * CHKERR( PetscINCREF((ises[i]).obj) ) * * if dmlist != NULL and dms is not None: # <<<<<<<<<<<<<< * CHKERR( PetscMalloc(len(dms)*sizeof(PetscDM), dmlist) ) * for i in range(len(dms)): */ } /* "petsc4py/PETSc/petscdmshell.pxi":370 * dmlist[0][i] = (dms[i]).dm * CHKERR( PetscINCREF((dms[i]).obj) ) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * cdef PetscErrorCode DMSHELL_CreateDomainDecomposition( */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petscdmshell.pxi":327 * return PETSC_SUCCESS * * cdef PetscErrorCode DMSHELL_CreateFieldDecomposition( # <<<<<<<<<<<<<< * PetscDM dm, * PetscInt *clen, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("petsc4py.PETSc.DMSHELL_CreateFieldDecomposition", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Dm); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_decomp); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XDECREF(__pyx_v_names); __Pyx_XDECREF(__pyx_v_ises); __Pyx_XDECREF(__pyx_v_dms); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petscdmshell.pxi":372 * return PETSC_SUCCESS * * cdef PetscErrorCode DMSHELL_CreateDomainDecomposition( # <<<<<<<<<<<<<< * PetscDM dm, * PetscInt *clen, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_DMSHELL_CreateDomainDecomposition(DM __pyx_v_dm, PetscInt *__pyx_v_clen, char ***__pyx_v_namelist, IS **__pyx_v_innerislist, IS **__pyx_v_outerislist, DM **__pyx_v_dmlist) { struct PyPetscDMObject *__pyx_v_Dm = 0; int __pyx_v_i; char const *__pyx_v_cname; PyObject *__pyx_v_context = NULL; PyObject *__pyx_v_decomp = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PyObject *__pyx_v_names = NULL; PyObject *__pyx_v_innerises = NULL; PyObject *__pyx_v_outerises = NULL; PyObject *__pyx_v_dms = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; Py_ssize_t __pyx_t_11; Py_ssize_t __pyx_t_12; int __pyx_t_13; IS __pyx_t_14; DM __pyx_t_15; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("DMSHELL_CreateDomainDecomposition", 0); /* "petsc4py/PETSc/petscdmshell.pxi":379 * PetscIS **outerislist, * PetscDM **dmlist) except PETSC_ERR_PYTHON with gil: * cdef DM Dm = subtype_DM(dm)() # <<<<<<<<<<<<<< * cdef int i * cdef const char *cname = NULL */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(29, 379, __pyx_L1_error) __pyx_v_Dm = ((struct PyPetscDMObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":381 * cdef DM Dm = subtype_DM(dm)() * cdef int i * cdef const char *cname = NULL # <<<<<<<<<<<<<< * Dm.dm = dm * CHKERR( PetscINCREF(Dm.obj) ) */ __pyx_v_cname = NULL; /* "petsc4py/PETSc/petscdmshell.pxi":382 * cdef int i * cdef const char *cname = NULL * Dm.dm = dm # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(Dm.obj) ) * context = Dm.get_attr('__create_domain_decomp__') */ __pyx_v_Dm->dm = __pyx_v_dm; /* "petsc4py/PETSc/petscdmshell.pxi":383 * cdef const char *cname = NULL * Dm.dm = dm * CHKERR( PetscINCREF(Dm.obj) ) # <<<<<<<<<<<<<< * context = Dm.get_attr('__create_domain_decomp__') * assert context is not None and type(context) is tuple */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dm->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 383, __pyx_L1_error) /* "petsc4py/PETSc/petscdmshell.pxi":384 * Dm.dm = dm * CHKERR( PetscINCREF(Dm.obj) ) * context = Dm.get_attr('__create_domain_decomp__') # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple * (decomp, args, kargs) = context */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_Dm->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Dm), ((char *)"__create_domain_decomp__")); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 384, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_context = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":385 * CHKERR( PetscINCREF(Dm.obj) ) * context = Dm.get_attr('__create_domain_decomp__') * assert context is not None and type(context) is tuple # <<<<<<<<<<<<<< * (decomp, args, kargs) = context * names, innerises, outerises, dms = decomp(Dm, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_5 = (__pyx_v_context != Py_None); if (__pyx_t_5) { } else { __pyx_t_4 = __pyx_t_5; goto __pyx_L3_bool_binop_done; } __pyx_t_5 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_4 = __pyx_t_5; __pyx_L3_bool_binop_done:; if (unlikely(!__pyx_t_4)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(29, 385, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(29, 385, __pyx_L1_error) #endif /* "petsc4py/PETSc/petscdmshell.pxi":386 * context = Dm.get_attr('__create_domain_decomp__') * assert context is not None and type(context) is tuple * (decomp, args, kargs) = context # <<<<<<<<<<<<<< * names, innerises, outerises, dms = decomp(Dm, *args, **kargs) * */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(29, 386, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_1 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(29, 386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); index = 0; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(29, 386, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(29, 386, __pyx_L1_error) __pyx_L6_unpacking_done:; } __pyx_v_decomp = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_args = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":387 * assert context is not None and type(context) is tuple * (decomp, args, kargs) = context * names, innerises, outerises, dms = decomp(Dm, *args, **kargs) # <<<<<<<<<<<<<< * * if clen != NULL: */ __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF((PyObject *)__pyx_v_Dm); __Pyx_GIVEREF((PyObject *)__pyx_v_Dm); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_Dm))) __PYX_ERR(29, 387, __pyx_L1_error); __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyNumber_Add(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(29, 387, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_1 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_1 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_decomp, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { PyObject* sequence = __pyx_t_6; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 4)) { if (size > 4) __Pyx_RaiseTooManyValuesError(4); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(29, 387, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_7 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_9 = PyTuple_GET_ITEM(sequence, 3); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); __pyx_t_7 = PyList_GET_ITEM(sequence, 2); __pyx_t_9 = PyList_GET_ITEM(sequence, 3); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_9); #else { Py_ssize_t i; PyObject** temps[4] = {&__pyx_t_1,&__pyx_t_2,&__pyx_t_7,&__pyx_t_9}; for (i=0; i < 4; i++) { PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(29, 387, __pyx_L1_error) __Pyx_GOTREF(item); *(temps[i]) = item; } } #endif __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { Py_ssize_t index = -1; PyObject** temps[4] = {&__pyx_t_1,&__pyx_t_2,&__pyx_t_7,&__pyx_t_9}; __pyx_t_10 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(29, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); for (index=0; index < 4; index++) { PyObject* item = __pyx_t_8(__pyx_t_10); if (unlikely(!item)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(item); *(temps[index]) = item; } if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_10), 4) < 0) __PYX_ERR(29, 387, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L8_unpacking_done; __pyx_L7_unpacking_failed:; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(29, 387, __pyx_L1_error) __pyx_L8_unpacking_done:; } __pyx_v_names = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_innerises = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_outerises = __pyx_t_7; __pyx_t_7 = 0; __pyx_v_dms = __pyx_t_9; __pyx_t_9 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":389 * names, innerises, outerises, dms = decomp(Dm, *args, **kargs) * * if clen != NULL: # <<<<<<<<<<<<<< * if names is not None: * clen[0] = len(names) */ __pyx_t_4 = (__pyx_v_clen != NULL); if (__pyx_t_4) { /* "petsc4py/PETSc/petscdmshell.pxi":390 * * if clen != NULL: * if names is not None: # <<<<<<<<<<<<<< * clen[0] = len(names) * elif innerises is not None: */ __pyx_t_4 = (__pyx_v_names != Py_None); if (__pyx_t_4) { /* "petsc4py/PETSc/petscdmshell.pxi":391 * if clen != NULL: * if names is not None: * clen[0] = len(names) # <<<<<<<<<<<<<< * elif innerises is not None: * clen[0] = len(innerises) */ __pyx_t_11 = PyObject_Length(__pyx_v_names); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(29, 391, __pyx_L1_error) (__pyx_v_clen[0]) = ((PetscInt)__pyx_t_11); /* "petsc4py/PETSc/petscdmshell.pxi":390 * * if clen != NULL: * if names is not None: # <<<<<<<<<<<<<< * clen[0] = len(names) * elif innerises is not None: */ goto __pyx_L10; } /* "petsc4py/PETSc/petscdmshell.pxi":392 * if names is not None: * clen[0] = len(names) * elif innerises is not None: # <<<<<<<<<<<<<< * clen[0] = len(innerises) * elif outerises is not None: */ __pyx_t_4 = (__pyx_v_innerises != Py_None); if (__pyx_t_4) { /* "petsc4py/PETSc/petscdmshell.pxi":393 * clen[0] = len(names) * elif innerises is not None: * clen[0] = len(innerises) # <<<<<<<<<<<<<< * elif outerises is not None: * clen[0] = len(outerises) */ __pyx_t_11 = PyObject_Length(__pyx_v_innerises); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(29, 393, __pyx_L1_error) (__pyx_v_clen[0]) = ((PetscInt)__pyx_t_11); /* "petsc4py/PETSc/petscdmshell.pxi":392 * if names is not None: * clen[0] = len(names) * elif innerises is not None: # <<<<<<<<<<<<<< * clen[0] = len(innerises) * elif outerises is not None: */ goto __pyx_L10; } /* "petsc4py/PETSc/petscdmshell.pxi":394 * elif innerises is not None: * clen[0] = len(innerises) * elif outerises is not None: # <<<<<<<<<<<<<< * clen[0] = len(outerises) * elif dms is not None: */ __pyx_t_4 = (__pyx_v_outerises != Py_None); if (__pyx_t_4) { /* "petsc4py/PETSc/petscdmshell.pxi":395 * clen[0] = len(innerises) * elif outerises is not None: * clen[0] = len(outerises) # <<<<<<<<<<<<<< * elif dms is not None: * clen[0] = len(dms) */ __pyx_t_11 = PyObject_Length(__pyx_v_outerises); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(29, 395, __pyx_L1_error) (__pyx_v_clen[0]) = ((PetscInt)__pyx_t_11); /* "petsc4py/PETSc/petscdmshell.pxi":394 * elif innerises is not None: * clen[0] = len(innerises) * elif outerises is not None: # <<<<<<<<<<<<<< * clen[0] = len(outerises) * elif dms is not None: */ goto __pyx_L10; } /* "petsc4py/PETSc/petscdmshell.pxi":396 * elif outerises is not None: * clen[0] = len(outerises) * elif dms is not None: # <<<<<<<<<<<<<< * clen[0] = len(dms) * else: */ __pyx_t_4 = (__pyx_v_dms != Py_None); if (__pyx_t_4) { /* "petsc4py/PETSc/petscdmshell.pxi":397 * clen[0] = len(outerises) * elif dms is not None: * clen[0] = len(dms) # <<<<<<<<<<<<<< * else: * clen[0] = 0 */ __pyx_t_11 = PyObject_Length(__pyx_v_dms); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(29, 397, __pyx_L1_error) (__pyx_v_clen[0]) = ((PetscInt)__pyx_t_11); /* "petsc4py/PETSc/petscdmshell.pxi":396 * elif outerises is not None: * clen[0] = len(outerises) * elif dms is not None: # <<<<<<<<<<<<<< * clen[0] = len(dms) * else: */ goto __pyx_L10; } /* "petsc4py/PETSc/petscdmshell.pxi":399 * clen[0] = len(dms) * else: * clen[0] = 0 # <<<<<<<<<<<<<< * * if namelist != NULL and names is not None: */ /*else*/ { (__pyx_v_clen[0]) = 0; } __pyx_L10:; /* "petsc4py/PETSc/petscdmshell.pxi":389 * names, innerises, outerises, dms = decomp(Dm, *args, **kargs) * * if clen != NULL: # <<<<<<<<<<<<<< * if names is not None: * clen[0] = len(names) */ } /* "petsc4py/PETSc/petscdmshell.pxi":401 * clen[0] = 0 * * if namelist != NULL and names is not None: # <<<<<<<<<<<<<< * CHKERR( PetscMalloc(len(names)*sizeof(char**), namelist) ) * for i in range(len(names)): */ __pyx_t_5 = (__pyx_v_namelist != NULL); if (__pyx_t_5) { } else { __pyx_t_4 = __pyx_t_5; goto __pyx_L12_bool_binop_done; } __pyx_t_5 = (__pyx_v_names != Py_None); __pyx_t_4 = __pyx_t_5; __pyx_L12_bool_binop_done:; if (__pyx_t_4) { /* "petsc4py/PETSc/petscdmshell.pxi":402 * * if namelist != NULL and names is not None: * CHKERR( PetscMalloc(len(names)*sizeof(char**), namelist) ) # <<<<<<<<<<<<<< * for i in range(len(names)): * names[i] = str2bytes(names[i], &cname) */ __pyx_t_11 = PyObject_Length(__pyx_v_names); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(29, 402, __pyx_L1_error) __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((__pyx_t_11 * (sizeof(char **))), __pyx_v_namelist)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 402, __pyx_L1_error) /* "petsc4py/PETSc/petscdmshell.pxi":403 * if namelist != NULL and names is not None: * CHKERR( PetscMalloc(len(names)*sizeof(char**), namelist) ) * for i in range(len(names)): # <<<<<<<<<<<<<< * names[i] = str2bytes(names[i], &cname) * CHKERR( PetscStrallocpy(cname, &(namelist[0][i])) ) */ __pyx_t_11 = PyObject_Length(__pyx_v_names); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(29, 403, __pyx_L1_error) __pyx_t_12 = __pyx_t_11; for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) { __pyx_v_i = __pyx_t_13; /* "petsc4py/PETSc/petscdmshell.pxi":404 * CHKERR( PetscMalloc(len(names)*sizeof(char**), namelist) ) * for i in range(len(names)): * names[i] = str2bytes(names[i], &cname) # <<<<<<<<<<<<<< * CHKERR( PetscStrallocpy(cname, &(namelist[0][i])) ) * */ __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_names, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_t_6, (&__pyx_v_cname)); if (unlikely(!__pyx_t_9)) __PYX_ERR(29, 404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely((__Pyx_SetItemInt(__pyx_v_names, __pyx_v_i, __pyx_t_9, int, 1, __Pyx_PyInt_From_int, 0, 1, 1) < 0))) __PYX_ERR(29, 404, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":405 * for i in range(len(names)): * names[i] = str2bytes(names[i], &cname) * CHKERR( PetscStrallocpy(cname, &(namelist[0][i])) ) # <<<<<<<<<<<<<< * * if innerislist != NULL and innerises is not None: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscStrallocpy(__pyx_v_cname, (&((__pyx_v_namelist[0])[__pyx_v_i])))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 405, __pyx_L1_error) } /* "petsc4py/PETSc/petscdmshell.pxi":401 * clen[0] = 0 * * if namelist != NULL and names is not None: # <<<<<<<<<<<<<< * CHKERR( PetscMalloc(len(names)*sizeof(char**), namelist) ) * for i in range(len(names)): */ } /* "petsc4py/PETSc/petscdmshell.pxi":407 * CHKERR( PetscStrallocpy(cname, &(namelist[0][i])) ) * * if innerislist != NULL and innerises is not None: # <<<<<<<<<<<<<< * CHKERR( PetscMalloc(len(innerises)*sizeof(PetscIS), innerislist) ) * for i in range(len(innerises)): */ __pyx_t_5 = (__pyx_v_innerislist != NULL); if (__pyx_t_5) { } else { __pyx_t_4 = __pyx_t_5; goto __pyx_L17_bool_binop_done; } __pyx_t_5 = (__pyx_v_innerises != Py_None); __pyx_t_4 = __pyx_t_5; __pyx_L17_bool_binop_done:; if (__pyx_t_4) { /* "petsc4py/PETSc/petscdmshell.pxi":408 * * if innerislist != NULL and innerises is not None: * CHKERR( PetscMalloc(len(innerises)*sizeof(PetscIS), innerislist) ) # <<<<<<<<<<<<<< * for i in range(len(innerises)): * innerislist[0][i] = (innerises[i]).iset */ __pyx_t_11 = PyObject_Length(__pyx_v_innerises); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(29, 408, __pyx_L1_error) __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((__pyx_t_11 * (sizeof(IS))), __pyx_v_innerislist)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 408, __pyx_L1_error) /* "petsc4py/PETSc/petscdmshell.pxi":409 * if innerislist != NULL and innerises is not None: * CHKERR( PetscMalloc(len(innerises)*sizeof(PetscIS), innerislist) ) * for i in range(len(innerises)): # <<<<<<<<<<<<<< * innerislist[0][i] = (innerises[i]).iset * CHKERR( PetscINCREF((innerises[i]).obj) ) */ __pyx_t_11 = PyObject_Length(__pyx_v_innerises); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(29, 409, __pyx_L1_error) __pyx_t_12 = __pyx_t_11; for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) { __pyx_v_i = __pyx_t_13; /* "petsc4py/PETSc/petscdmshell.pxi":410 * CHKERR( PetscMalloc(len(innerises)*sizeof(PetscIS), innerislist) ) * for i in range(len(innerises)): * innerislist[0][i] = (innerises[i]).iset # <<<<<<<<<<<<<< * CHKERR( PetscINCREF((innerises[i]).obj) ) * */ __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_innerises, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(29, 410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (!(likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(29, 410, __pyx_L1_error) __pyx_t_14 = ((struct PyPetscISObject *)__pyx_t_9)->iset; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; ((__pyx_v_innerislist[0])[__pyx_v_i]) = __pyx_t_14; /* "petsc4py/PETSc/petscdmshell.pxi":411 * for i in range(len(innerises)): * innerislist[0][i] = (innerises[i]).iset * CHKERR( PetscINCREF((innerises[i]).obj) ) # <<<<<<<<<<<<<< * * if outerislist != NULL and outerises is not None: */ __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_innerises, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(29, 411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (!(likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(29, 411, __pyx_L1_error) __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(((struct PyPetscISObject *)__pyx_t_9)->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 411, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } /* "petsc4py/PETSc/petscdmshell.pxi":407 * CHKERR( PetscStrallocpy(cname, &(namelist[0][i])) ) * * if innerislist != NULL and innerises is not None: # <<<<<<<<<<<<<< * CHKERR( PetscMalloc(len(innerises)*sizeof(PetscIS), innerislist) ) * for i in range(len(innerises)): */ } /* "petsc4py/PETSc/petscdmshell.pxi":413 * CHKERR( PetscINCREF((innerises[i]).obj) ) * * if outerislist != NULL and outerises is not None: # <<<<<<<<<<<<<< * CHKERR( PetscMalloc(len(outerises)*sizeof(PetscIS), outerislist) ) * for i in range(len(outerises)): */ __pyx_t_5 = (__pyx_v_outerislist != NULL); if (__pyx_t_5) { } else { __pyx_t_4 = __pyx_t_5; goto __pyx_L22_bool_binop_done; } __pyx_t_5 = (__pyx_v_outerises != Py_None); __pyx_t_4 = __pyx_t_5; __pyx_L22_bool_binop_done:; if (__pyx_t_4) { /* "petsc4py/PETSc/petscdmshell.pxi":414 * * if outerislist != NULL and outerises is not None: * CHKERR( PetscMalloc(len(outerises)*sizeof(PetscIS), outerislist) ) # <<<<<<<<<<<<<< * for i in range(len(outerises)): * outerislist[0][i] = (outerises[i]).iset */ __pyx_t_11 = PyObject_Length(__pyx_v_outerises); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(29, 414, __pyx_L1_error) __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((__pyx_t_11 * (sizeof(IS))), __pyx_v_outerislist)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 414, __pyx_L1_error) /* "petsc4py/PETSc/petscdmshell.pxi":415 * if outerislist != NULL and outerises is not None: * CHKERR( PetscMalloc(len(outerises)*sizeof(PetscIS), outerislist) ) * for i in range(len(outerises)): # <<<<<<<<<<<<<< * outerislist[0][i] = (outerises[i]).iset * CHKERR( PetscINCREF((outerises[i]).obj) ) */ __pyx_t_11 = PyObject_Length(__pyx_v_outerises); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(29, 415, __pyx_L1_error) __pyx_t_12 = __pyx_t_11; for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) { __pyx_v_i = __pyx_t_13; /* "petsc4py/PETSc/petscdmshell.pxi":416 * CHKERR( PetscMalloc(len(outerises)*sizeof(PetscIS), outerislist) ) * for i in range(len(outerises)): * outerislist[0][i] = (outerises[i]).iset # <<<<<<<<<<<<<< * CHKERR( PetscINCREF((outerises[i]).obj) ) * */ __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_outerises, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(29, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (!(likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(29, 416, __pyx_L1_error) __pyx_t_14 = ((struct PyPetscISObject *)__pyx_t_9)->iset; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; ((__pyx_v_outerislist[0])[__pyx_v_i]) = __pyx_t_14; /* "petsc4py/PETSc/petscdmshell.pxi":417 * for i in range(len(outerises)): * outerislist[0][i] = (outerises[i]).iset * CHKERR( PetscINCREF((outerises[i]).obj) ) # <<<<<<<<<<<<<< * * if dmlist != NULL and dms is not None: */ __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_outerises, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(29, 417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (!(likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(29, 417, __pyx_L1_error) __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(((struct PyPetscISObject *)__pyx_t_9)->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 417, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } /* "petsc4py/PETSc/petscdmshell.pxi":413 * CHKERR( PetscINCREF((innerises[i]).obj) ) * * if outerislist != NULL and outerises is not None: # <<<<<<<<<<<<<< * CHKERR( PetscMalloc(len(outerises)*sizeof(PetscIS), outerislist) ) * for i in range(len(outerises)): */ } /* "petsc4py/PETSc/petscdmshell.pxi":419 * CHKERR( PetscINCREF((outerises[i]).obj) ) * * if dmlist != NULL and dms is not None: # <<<<<<<<<<<<<< * CHKERR( PetscMalloc(len(dms)*sizeof(PetscDM), dmlist) ) * for i in range(len(dms)): */ __pyx_t_5 = (__pyx_v_dmlist != NULL); if (__pyx_t_5) { } else { __pyx_t_4 = __pyx_t_5; goto __pyx_L27_bool_binop_done; } __pyx_t_5 = (__pyx_v_dms != Py_None); __pyx_t_4 = __pyx_t_5; __pyx_L27_bool_binop_done:; if (__pyx_t_4) { /* "petsc4py/PETSc/petscdmshell.pxi":420 * * if dmlist != NULL and dms is not None: * CHKERR( PetscMalloc(len(dms)*sizeof(PetscDM), dmlist) ) # <<<<<<<<<<<<<< * for i in range(len(dms)): * dmlist[0][i] = (dms[i]).dm */ __pyx_t_11 = PyObject_Length(__pyx_v_dms); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(29, 420, __pyx_L1_error) __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((__pyx_t_11 * (sizeof(DM))), __pyx_v_dmlist)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 420, __pyx_L1_error) /* "petsc4py/PETSc/petscdmshell.pxi":421 * if dmlist != NULL and dms is not None: * CHKERR( PetscMalloc(len(dms)*sizeof(PetscDM), dmlist) ) * for i in range(len(dms)): # <<<<<<<<<<<<<< * dmlist[0][i] = (dms[i]).dm * CHKERR( PetscINCREF((dms[i]).obj) ) */ __pyx_t_11 = PyObject_Length(__pyx_v_dms); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(29, 421, __pyx_L1_error) __pyx_t_12 = __pyx_t_11; for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) { __pyx_v_i = __pyx_t_13; /* "petsc4py/PETSc/petscdmshell.pxi":422 * CHKERR( PetscMalloc(len(dms)*sizeof(PetscDM), dmlist) ) * for i in range(len(dms)): * dmlist[0][i] = (dms[i]).dm # <<<<<<<<<<<<<< * CHKERR( PetscINCREF((dms[i]).obj) ) * return PETSC_SUCCESS */ __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_dms, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(29, 422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (!(likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_8petsc4py_5PETSc_DM)))) __PYX_ERR(29, 422, __pyx_L1_error) __pyx_t_15 = ((struct PyPetscDMObject *)__pyx_t_9)->dm; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; ((__pyx_v_dmlist[0])[__pyx_v_i]) = __pyx_t_15; /* "petsc4py/PETSc/petscdmshell.pxi":423 * for i in range(len(dms)): * dmlist[0][i] = (dms[i]).dm * CHKERR( PetscINCREF((dms[i]).obj) ) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_dms, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(29, 423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (!(likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_8petsc4py_5PETSc_DM)))) __PYX_ERR(29, 423, __pyx_L1_error) __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(((struct PyPetscDMObject *)__pyx_t_9)->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 423, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } /* "petsc4py/PETSc/petscdmshell.pxi":419 * CHKERR( PetscINCREF((outerises[i]).obj) ) * * if dmlist != NULL and dms is not None: # <<<<<<<<<<<<<< * CHKERR( PetscMalloc(len(dms)*sizeof(PetscDM), dmlist) ) * for i in range(len(dms)): */ } /* "petsc4py/PETSc/petscdmshell.pxi":424 * dmlist[0][i] = (dms[i]).dm * CHKERR( PetscINCREF((dms[i]).obj) ) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * cdef PetscErrorCode DMSHELL_CreateDomainDecompositionScatters( */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petscdmshell.pxi":372 * return PETSC_SUCCESS * * cdef PetscErrorCode DMSHELL_CreateDomainDecomposition( # <<<<<<<<<<<<<< * PetscDM dm, * PetscInt *clen, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("petsc4py.PETSc.DMSHELL_CreateDomainDecomposition", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Dm); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_decomp); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XDECREF(__pyx_v_names); __Pyx_XDECREF(__pyx_v_innerises); __Pyx_XDECREF(__pyx_v_outerises); __Pyx_XDECREF(__pyx_v_dms); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petscdmshell.pxi":426 * return PETSC_SUCCESS * * cdef PetscErrorCode DMSHELL_CreateDomainDecompositionScatters( # <<<<<<<<<<<<<< * PetscDM dm, * PetscInt clen, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_DMSHELL_CreateDomainDecompositionScatters(DM __pyx_v_dm, PetscInt __pyx_v_clen, DM *__pyx_v_subdms, VecScatter **__pyx_v_iscat, VecScatter **__pyx_v_oscat, VecScatter **__pyx_v_gscat) { struct PyPetscDMObject *__pyx_v_Dm = 0; int __pyx_v_i; CYTHON_UNUSED char const *__pyx_v_cname; struct PyPetscDMObject *__pyx_v_subdm = 0; PyObject *__pyx_v_psubdms = NULL; PyObject *__pyx_v_context = NULL; PyObject *__pyx_v_scatters = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PyObject *__pyx_v_iscatter = NULL; PyObject *__pyx_v_oscatter = NULL; PyObject *__pyx_v_gscatter = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; PetscInt __pyx_t_4; int __pyx_t_5; int __pyx_t_6; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *(*__pyx_t_10)(PyObject *); PyObject *__pyx_t_11 = NULL; Py_ssize_t __pyx_t_12; PetscInt __pyx_t_13; int __pyx_t_14; VecScatter __pyx_t_15; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("DMSHELL_CreateDomainDecompositionScatters", 0); /* "petsc4py/PETSc/petscdmshell.pxi":434 * PetscScatter** gscat) except PETSC_ERR_PYTHON with gil: * * cdef DM Dm = subtype_DM(dm)() # <<<<<<<<<<<<<< * cdef int i * cdef const char *cname = NULL */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 434, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 434, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(29, 434, __pyx_L1_error) __pyx_v_Dm = ((struct PyPetscDMObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":436 * cdef DM Dm = subtype_DM(dm)() * cdef int i * cdef const char *cname = NULL # <<<<<<<<<<<<<< * cdef DM subdm = None * */ __pyx_v_cname = NULL; /* "petsc4py/PETSc/petscdmshell.pxi":437 * cdef int i * cdef const char *cname = NULL * cdef DM subdm = None # <<<<<<<<<<<<<< * * Dm.dm = dm */ __Pyx_INCREF(Py_None); __pyx_v_subdm = ((struct PyPetscDMObject *)Py_None); /* "petsc4py/PETSc/petscdmshell.pxi":439 * cdef DM subdm = None * * Dm.dm = dm # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(Dm.obj) ) * */ __pyx_v_Dm->dm = __pyx_v_dm; /* "petsc4py/PETSc/petscdmshell.pxi":440 * * Dm.dm = dm * CHKERR( PetscINCREF(Dm.obj) ) # <<<<<<<<<<<<<< * * psubdms = [] */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dm->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 440, __pyx_L1_error) /* "petsc4py/PETSc/petscdmshell.pxi":442 * CHKERR( PetscINCREF(Dm.obj) ) * * psubdms = [] # <<<<<<<<<<<<<< * for i from 0 <= i < clen: * subdm = subtype_DM(subdms[i])() */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_psubdms = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":443 * * psubdms = [] * for i from 0 <= i < clen: # <<<<<<<<<<<<<< * subdm = subtype_DM(subdms[i])() * subdm.dm = subdms[i] */ __pyx_t_4 = __pyx_v_clen; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { /* "petsc4py/PETSc/petscdmshell.pxi":444 * psubdms = [] * for i from 0 <= i < clen: * subdm = subtype_DM(subdms[i])() # <<<<<<<<<<<<<< * subdm.dm = subdms[i] * CHKERR( PetscINCREF(subdm.obj) ) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM((__pyx_v_subdms[__pyx_v_i]))); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(29, 444, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_subdm, ((struct PyPetscDMObject *)__pyx_t_1)); __pyx_t_1 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":445 * for i from 0 <= i < clen: * subdm = subtype_DM(subdms[i])() * subdm.dm = subdms[i] # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(subdm.obj) ) * psubdms.append(subdm) */ __pyx_v_subdm->dm = (__pyx_v_subdms[__pyx_v_i]); /* "petsc4py/PETSc/petscdmshell.pxi":446 * subdm = subtype_DM(subdms[i])() * subdm.dm = subdms[i] * CHKERR( PetscINCREF(subdm.obj) ) # <<<<<<<<<<<<<< * psubdms.append(subdm) * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_subdm->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 446, __pyx_L1_error) /* "petsc4py/PETSc/petscdmshell.pxi":447 * subdm.dm = subdms[i] * CHKERR( PetscINCREF(subdm.obj) ) * psubdms.append(subdm) # <<<<<<<<<<<<<< * * context = Dm.get_attr('__create_domain_decomp_scatters__') */ __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_psubdms, ((PyObject *)__pyx_v_subdm)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(29, 447, __pyx_L1_error) } /* "petsc4py/PETSc/petscdmshell.pxi":449 * psubdms.append(subdm) * * context = Dm.get_attr('__create_domain_decomp_scatters__') # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple * (scatters, args, kargs) = context */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_Dm->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Dm), ((char *)"__create_domain_decomp_scatters__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 449, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":450 * * context = Dm.get_attr('__create_domain_decomp_scatters__') * assert context is not None and type(context) is tuple # <<<<<<<<<<<<<< * (scatters, args, kargs) = context * (iscatter, oscatter, gscatter) = scatters(Dm, psubdms, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_7 = (__pyx_v_context != Py_None); if (__pyx_t_7) { } else { __pyx_t_6 = __pyx_t_7; goto __pyx_L5_bool_binop_done; } __pyx_t_7 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_6 = __pyx_t_7; __pyx_L5_bool_binop_done:; if (unlikely(!__pyx_t_6)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(29, 450, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(29, 450, __pyx_L1_error) #endif /* "petsc4py/PETSc/petscdmshell.pxi":451 * context = Dm.get_attr('__create_domain_decomp_scatters__') * assert context is not None and type(context) is tuple * (scatters, args, kargs) = context # <<<<<<<<<<<<<< * (iscatter, oscatter, gscatter) = scatters(Dm, psubdms, *args, **kargs) * */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(29, 451, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); __pyx_t_8 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_8); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_8 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_8)) __PYX_ERR(29, 451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); #endif } else { Py_ssize_t index = -1; __pyx_t_9 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_9)) __PYX_ERR(29, 451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); index = 0; __pyx_t_1 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_1)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_2)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 2; __pyx_t_8 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 3) < 0) __PYX_ERR(29, 451, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L8_unpacking_done; __pyx_L7_unpacking_failed:; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(29, 451, __pyx_L1_error) __pyx_L8_unpacking_done:; } __pyx_v_scatters = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_kargs = __pyx_t_8; __pyx_t_8 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":452 * assert context is not None and type(context) is tuple * (scatters, args, kargs) = context * (iscatter, oscatter, gscatter) = scatters(Dm, psubdms, *args, **kargs) # <<<<<<<<<<<<<< * * assert len(iscatter) == clen */ __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(29, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF((PyObject *)__pyx_v_Dm); __Pyx_GIVEREF((PyObject *)__pyx_v_Dm); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_v_Dm))) __PYX_ERR(29, 452, __pyx_L1_error); __Pyx_INCREF(__pyx_v_psubdms); __Pyx_GIVEREF(__pyx_v_psubdms); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_psubdms)) __PYX_ERR(29, 452, __pyx_L1_error); __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyNumber_Add(__pyx_t_8, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(29, 452, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_2 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } else { __pyx_t_2 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_t_8 = __Pyx_PyObject_Call(__pyx_v_scatters, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(29, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_8))) || (PyList_CheckExact(__pyx_t_8))) { PyObject* sequence = __pyx_t_8; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(29, 452, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_9 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_1 = PyList_GET_ITEM(sequence, 1); __pyx_t_9 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_9); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_9)) __PYX_ERR(29, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else { Py_ssize_t index = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(29, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_10 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_11); index = 0; __pyx_t_2 = __pyx_t_10(__pyx_t_11); if (unlikely(!__pyx_t_2)) goto __pyx_L9_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_1 = __pyx_t_10(__pyx_t_11); if (unlikely(!__pyx_t_1)) goto __pyx_L9_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 2; __pyx_t_9 = __pyx_t_10(__pyx_t_11); if (unlikely(!__pyx_t_9)) goto __pyx_L9_unpacking_failed; __Pyx_GOTREF(__pyx_t_9); if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_11), 3) < 0) __PYX_ERR(29, 452, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; goto __pyx_L10_unpacking_done; __pyx_L9_unpacking_failed:; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(29, 452, __pyx_L1_error) __pyx_L10_unpacking_done:; } __pyx_v_iscatter = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_oscatter = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_gscatter = __pyx_t_9; __pyx_t_9 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":454 * (iscatter, oscatter, gscatter) = scatters(Dm, psubdms, *args, **kargs) * * assert len(iscatter) == clen # <<<<<<<<<<<<<< * assert len(oscatter) == clen * assert len(gscatter) == clen */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_12 = PyObject_Length(__pyx_v_iscatter); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(29, 454, __pyx_L1_error) __pyx_t_6 = (__pyx_t_12 == __pyx_v_clen); if (unlikely(!__pyx_t_6)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(29, 454, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(29, 454, __pyx_L1_error) #endif /* "petsc4py/PETSc/petscdmshell.pxi":455 * * assert len(iscatter) == clen * assert len(oscatter) == clen # <<<<<<<<<<<<<< * assert len(gscatter) == clen * */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_12 = PyObject_Length(__pyx_v_oscatter); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(29, 455, __pyx_L1_error) __pyx_t_6 = (__pyx_t_12 == __pyx_v_clen); if (unlikely(!__pyx_t_6)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(29, 455, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(29, 455, __pyx_L1_error) #endif /* "petsc4py/PETSc/petscdmshell.pxi":456 * assert len(iscatter) == clen * assert len(oscatter) == clen * assert len(gscatter) == clen # <<<<<<<<<<<<<< * * CHKERR ( PetscMalloc(clen*sizeof(PetscScatter), iscat) ) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_12 = PyObject_Length(__pyx_v_gscatter); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(29, 456, __pyx_L1_error) __pyx_t_6 = (__pyx_t_12 == __pyx_v_clen); if (unlikely(!__pyx_t_6)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(29, 456, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(29, 456, __pyx_L1_error) #endif /* "petsc4py/PETSc/petscdmshell.pxi":458 * assert len(gscatter) == clen * * CHKERR ( PetscMalloc(clen*sizeof(PetscScatter), iscat) ) # <<<<<<<<<<<<<< * CHKERR ( PetscMalloc(clen*sizeof(PetscScatter), oscat) ) * CHKERR ( PetscMalloc(clen*sizeof(PetscScatter), gscat) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((__pyx_v_clen * (sizeof(VecScatter))), __pyx_v_iscat)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 458, __pyx_L1_error) /* "petsc4py/PETSc/petscdmshell.pxi":459 * * CHKERR ( PetscMalloc(clen*sizeof(PetscScatter), iscat) ) * CHKERR ( PetscMalloc(clen*sizeof(PetscScatter), oscat) ) # <<<<<<<<<<<<<< * CHKERR ( PetscMalloc(clen*sizeof(PetscScatter), gscat) ) * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((__pyx_v_clen * (sizeof(VecScatter))), __pyx_v_oscat)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 459, __pyx_L1_error) /* "petsc4py/PETSc/petscdmshell.pxi":460 * CHKERR ( PetscMalloc(clen*sizeof(PetscScatter), iscat) ) * CHKERR ( PetscMalloc(clen*sizeof(PetscScatter), oscat) ) * CHKERR ( PetscMalloc(clen*sizeof(PetscScatter), gscat) ) # <<<<<<<<<<<<<< * * for i in range(clen): */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((__pyx_v_clen * (sizeof(VecScatter))), __pyx_v_gscat)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 460, __pyx_L1_error) /* "petsc4py/PETSc/petscdmshell.pxi":462 * CHKERR ( PetscMalloc(clen*sizeof(PetscScatter), gscat) ) * * for i in range(clen): # <<<<<<<<<<<<<< * iscat[0][i] = (iscatter[i]).sct * CHKERR( PetscINCREF((iscatter[i]).obj) ) */ __pyx_t_4 = __pyx_v_clen; __pyx_t_13 = __pyx_t_4; for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { __pyx_v_i = __pyx_t_14; /* "petsc4py/PETSc/petscdmshell.pxi":463 * * for i in range(clen): * iscat[0][i] = (iscatter[i]).sct # <<<<<<<<<<<<<< * CHKERR( PetscINCREF((iscatter[i]).obj) ) * */ __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_iscatter, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(29, 463, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (!(likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_8petsc4py_5PETSc_Scatter)))) __PYX_ERR(29, 463, __pyx_L1_error) __pyx_t_15 = ((struct PyPetscScatterObject *)__pyx_t_8)->sct; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; ((__pyx_v_iscat[0])[__pyx_v_i]) = __pyx_t_15; /* "petsc4py/PETSc/petscdmshell.pxi":464 * for i in range(clen): * iscat[0][i] = (iscatter[i]).sct * CHKERR( PetscINCREF((iscatter[i]).obj) ) # <<<<<<<<<<<<<< * * oscat[0][i] = (oscatter[i]).sct */ __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_iscatter, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(29, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (!(likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_8petsc4py_5PETSc_Scatter)))) __PYX_ERR(29, 464, __pyx_L1_error) __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(((struct PyPetscScatterObject *)__pyx_t_8)->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 464, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":466 * CHKERR( PetscINCREF((iscatter[i]).obj) ) * * oscat[0][i] = (oscatter[i]).sct # <<<<<<<<<<<<<< * CHKERR( PetscINCREF((oscatter[i]).obj) ) * */ __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_oscatter, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(29, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (!(likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_8petsc4py_5PETSc_Scatter)))) __PYX_ERR(29, 466, __pyx_L1_error) __pyx_t_15 = ((struct PyPetscScatterObject *)__pyx_t_8)->sct; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; ((__pyx_v_oscat[0])[__pyx_v_i]) = __pyx_t_15; /* "petsc4py/PETSc/petscdmshell.pxi":467 * * oscat[0][i] = (oscatter[i]).sct * CHKERR( PetscINCREF((oscatter[i]).obj) ) # <<<<<<<<<<<<<< * * gscat[0][i] = (gscatter[i]).sct */ __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_oscatter, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(29, 467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (!(likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_8petsc4py_5PETSc_Scatter)))) __PYX_ERR(29, 467, __pyx_L1_error) __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(((struct PyPetscScatterObject *)__pyx_t_8)->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 467, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":469 * CHKERR( PetscINCREF((oscatter[i]).obj) ) * * gscat[0][i] = (gscatter[i]).sct # <<<<<<<<<<<<<< * CHKERR( PetscINCREF((gscatter[i]).obj) ) * */ __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_gscatter, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(29, 469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (!(likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_8petsc4py_5PETSc_Scatter)))) __PYX_ERR(29, 469, __pyx_L1_error) __pyx_t_15 = ((struct PyPetscScatterObject *)__pyx_t_8)->sct; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; ((__pyx_v_gscat[0])[__pyx_v_i]) = __pyx_t_15; /* "petsc4py/PETSc/petscdmshell.pxi":470 * * gscat[0][i] = (gscatter[i]).sct * CHKERR( PetscINCREF((gscatter[i]).obj) ) # <<<<<<<<<<<<<< * * return PETSC_SUCCESS */ __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_gscatter, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(29, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (!(likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_8petsc4py_5PETSc_Scatter)))) __PYX_ERR(29, 470, __pyx_L1_error) __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(((struct PyPetscScatterObject *)__pyx_t_8)->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } /* "petsc4py/PETSc/petscdmshell.pxi":472 * CHKERR( PetscINCREF((gscatter[i]).obj) ) * * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * cdef PetscErrorCode DMSHELL_CreateSubDM( */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petscdmshell.pxi":426 * return PETSC_SUCCESS * * cdef PetscErrorCode DMSHELL_CreateDomainDecompositionScatters( # <<<<<<<<<<<<<< * PetscDM dm, * PetscInt clen, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("petsc4py.PETSc.DMSHELL_CreateDomainDecompositionScatters", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Dm); __Pyx_XDECREF((PyObject *)__pyx_v_subdm); __Pyx_XDECREF(__pyx_v_psubdms); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_scatters); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XDECREF(__pyx_v_iscatter); __Pyx_XDECREF(__pyx_v_oscatter); __Pyx_XDECREF(__pyx_v_gscatter); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petscdmshell.pxi":474 * return PETSC_SUCCESS * * cdef PetscErrorCode DMSHELL_CreateSubDM( # <<<<<<<<<<<<<< * PetscDM cdm, * PetscInt numFields, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_DMSHELL_CreateSubDM(DM __pyx_v_cdm, PetscInt __pyx_v_numFields, PetscInt const *__pyx_v_cfields, IS *__pyx_v_ciset, DM *__pyx_v_csubdm) { struct PyPetscDMObject *__pyx_v_dm = 0; struct PyPetscISObject *__pyx_v_iset = 0; struct PyPetscDMObject *__pyx_v_subdm = 0; PyObject *__pyx_v_context = NULL; PyObject *__pyx_v_create_subdm = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PyArrayObject *__pyx_v_fields = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); IS __pyx_t_9; DM __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("DMSHELL_CreateSubDM", 0); /* "petsc4py/PETSc/petscdmshell.pxi":480 * PetscIS *ciset, * PetscDM *csubdm) except PETSC_ERR_PYTHON with gil: * cdef DM dm = subtype_DM(cdm)() # <<<<<<<<<<<<<< * cdef IS iset * cdef DM subdm */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_cdm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(29, 480, __pyx_L1_error) __pyx_v_dm = ((struct PyPetscDMObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":483 * cdef IS iset * cdef DM subdm * dm.dm = cdm # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(dm.obj) ) * context = dm.get_attr('__create_subdm__') */ __pyx_v_dm->dm = __pyx_v_cdm; /* "petsc4py/PETSc/petscdmshell.pxi":484 * cdef DM subdm * dm.dm = cdm * CHKERR( PetscINCREF(dm.obj) ) # <<<<<<<<<<<<<< * context = dm.get_attr('__create_subdm__') * assert context is not None and type(context) is tuple */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_dm->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 484, __pyx_L1_error) /* "petsc4py/PETSc/petscdmshell.pxi":485 * dm.dm = cdm * CHKERR( PetscINCREF(dm.obj) ) * context = dm.get_attr('__create_subdm__') # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple * (create_subdm, args, kargs) = context */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_dm->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_dm), ((char *)"__create_subdm__")); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_context = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":486 * CHKERR( PetscINCREF(dm.obj) ) * context = dm.get_attr('__create_subdm__') * assert context is not None and type(context) is tuple # <<<<<<<<<<<<<< * (create_subdm, args, kargs) = context * */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_5 = (__pyx_v_context != Py_None); if (__pyx_t_5) { } else { __pyx_t_4 = __pyx_t_5; goto __pyx_L3_bool_binop_done; } __pyx_t_5 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_4 = __pyx_t_5; __pyx_L3_bool_binop_done:; if (unlikely(!__pyx_t_4)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(29, 486, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(29, 486, __pyx_L1_error) #endif /* "petsc4py/PETSc/petscdmshell.pxi":487 * context = dm.get_attr('__create_subdm__') * assert context is not None and type(context) is tuple * (create_subdm, args, kargs) = context # <<<<<<<<<<<<<< * * fields = array_i(numFields, cfields) */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(29, 487, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_1 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(29, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); index = 0; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(29, 487, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(29, 487, __pyx_L1_error) __pyx_L6_unpacking_done:; } __pyx_v_create_subdm = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_args = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":489 * (create_subdm, args, kargs) = context * * fields = array_i(numFields, cfields) # <<<<<<<<<<<<<< * * iset, subdm = create_subdm(dm, fields, *args, **kargs) */ __pyx_t_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i(__pyx_v_numFields, __pyx_v_cfields)); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 489, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_fields = ((PyArrayObject *)__pyx_t_6); __pyx_t_6 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":491 * fields = array_i(numFields, cfields) * * iset, subdm = create_subdm(dm, fields, *args, **kargs) # <<<<<<<<<<<<<< * * CHKERR( PetscINCREF(iset.obj) ) */ __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 491, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF((PyObject *)__pyx_v_dm); __Pyx_GIVEREF((PyObject *)__pyx_v_dm); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_dm))) __PYX_ERR(29, 491, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_fields); __Pyx_GIVEREF((PyObject *)__pyx_v_fields); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_fields))) __PYX_ERR(29, 491, __pyx_L1_error); __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 491, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyNumber_Add(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 491, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(29, 491, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_1 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 491, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_1 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 491, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_create_subdm, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 491, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { PyObject* sequence = __pyx_t_6; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(29, 491, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 491, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 491, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(29, 491, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(29, 491, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L8_unpacking_done; __pyx_L7_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(29, 491, __pyx_L1_error) __pyx_L8_unpacking_done:; } if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_IS))))) __PYX_ERR(29, 491, __pyx_L1_error) if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(29, 491, __pyx_L1_error) __pyx_v_iset = ((struct PyPetscISObject *)__pyx_t_1); __pyx_t_1 = 0; __pyx_v_subdm = ((struct PyPetscDMObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/petscdmshell.pxi":493 * iset, subdm = create_subdm(dm, fields, *args, **kargs) * * CHKERR( PetscINCREF(iset.obj) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(subdm.obj) ) * ciset[0] = iset.iset */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_iset->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 493, __pyx_L1_error) /* "petsc4py/PETSc/petscdmshell.pxi":494 * * CHKERR( PetscINCREF(iset.obj) ) * CHKERR( PetscINCREF(subdm.obj) ) # <<<<<<<<<<<<<< * ciset[0] = iset.iset * csubdm[0] = subdm.dm */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_subdm->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 494, __pyx_L1_error) /* "petsc4py/PETSc/petscdmshell.pxi":495 * CHKERR( PetscINCREF(iset.obj) ) * CHKERR( PetscINCREF(subdm.obj) ) * ciset[0] = iset.iset # <<<<<<<<<<<<<< * csubdm[0] = subdm.dm * return PETSC_SUCCESS */ __pyx_t_9 = __pyx_v_iset->iset; (__pyx_v_ciset[0]) = __pyx_t_9; /* "petsc4py/PETSc/petscdmshell.pxi":496 * CHKERR( PetscINCREF(subdm.obj) ) * ciset[0] = iset.iset * csubdm[0] = subdm.dm # <<<<<<<<<<<<<< * return PETSC_SUCCESS */ __pyx_t_10 = __pyx_v_subdm->dm; (__pyx_v_csubdm[0]) = __pyx_t_10; /* "petsc4py/PETSc/petscdmshell.pxi":497 * ciset[0] = iset.iset * csubdm[0] = subdm.dm * return PETSC_SUCCESS # <<<<<<<<<<<<<< */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/petscdmshell.pxi":474 * return PETSC_SUCCESS * * cdef PetscErrorCode DMSHELL_CreateSubDM( # <<<<<<<<<<<<<< * PetscDM cdm, * PetscInt numFields, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.DMSHELL_CreateSubDM", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_dm); __Pyx_XDECREF((PyObject *)__pyx_v_iset); __Pyx_XDECREF((PyObject *)__pyx_v_subdm); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_create_subdm); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XDECREF((PyObject *)__pyx_v_fields); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/petscpyappctx.pxi":3 * cdef set appctx_registry = set() * * cdef inline object registerAppCtx(void *appctx): # <<<<<<<<<<<<<< * cdef object key = appctx * appctx_registry.add(key) */ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_registerAppCtx(void *__pyx_v_appctx) { PyObject *__pyx_v_key = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("registerAppCtx", 1); /* "petsc4py/PETSc/petscpyappctx.pxi":4 * * cdef inline object registerAppCtx(void *appctx): * cdef object key = appctx # <<<<<<<<<<<<<< * appctx_registry.add(key) * */ __pyx_t_1 = __Pyx_PyInt_FromSize_t(((Py_uintptr_t)__pyx_v_appctx)); if (unlikely(!__pyx_t_1)) __PYX_ERR(30, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_key = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/petscpyappctx.pxi":5 * cdef inline object registerAppCtx(void *appctx): * cdef object key = appctx * appctx_registry.add(key) # <<<<<<<<<<<<<< * * cdef inline object toAppCtx(void *appctx): */ if (unlikely(__pyx_v_8petsc4py_5PETSc_appctx_registry == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add"); __PYX_ERR(30, 5, __pyx_L1_error) } __pyx_t_2 = PySet_Add(__pyx_v_8petsc4py_5PETSc_appctx_registry, __pyx_v_key); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(30, 5, __pyx_L1_error) /* "petsc4py/PETSc/petscpyappctx.pxi":3 * cdef set appctx_registry = set() * * cdef inline object registerAppCtx(void *appctx): # <<<<<<<<<<<<<< * cdef object key = appctx * appctx_registry.add(key) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.registerAppCtx", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_key); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/petscpyappctx.pxi":7 * appctx_registry.add(key) * * cdef inline object toAppCtx(void *appctx): # <<<<<<<<<<<<<< * cdef object key = appctx * if key in appctx_registry: */ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toAppCtx(void *__pyx_v_appctx) { PyObject *__pyx_v_key = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("toAppCtx", 1); /* "petsc4py/PETSc/petscpyappctx.pxi":8 * * cdef inline object toAppCtx(void *appctx): * cdef object key = appctx # <<<<<<<<<<<<<< * if key in appctx_registry: * return appctx */ __pyx_t_1 = __Pyx_PyInt_FromSize_t(((Py_uintptr_t)__pyx_v_appctx)); if (unlikely(!__pyx_t_1)) __PYX_ERR(30, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_key = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/petscpyappctx.pxi":9 * cdef inline object toAppCtx(void *appctx): * cdef object key = appctx * if key in appctx_registry: # <<<<<<<<<<<<<< * return appctx * else: */ if (unlikely(__pyx_v_8petsc4py_5PETSc_appctx_registry == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(30, 9, __pyx_L1_error) } __pyx_t_2 = (__Pyx_PySet_ContainsTF(__pyx_v_key, __pyx_v_8petsc4py_5PETSc_appctx_registry, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(30, 9, __pyx_L1_error) if (__pyx_t_2) { /* "petsc4py/PETSc/petscpyappctx.pxi":10 * cdef object key = appctx * if key in appctx_registry: * return appctx # <<<<<<<<<<<<<< * else: * if appctx != NULL: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_appctx)); __pyx_r = ((PyObject *)__pyx_v_appctx); goto __pyx_L0; /* "petsc4py/PETSc/petscpyappctx.pxi":9 * cdef inline object toAppCtx(void *appctx): * cdef object key = appctx * if key in appctx_registry: # <<<<<<<<<<<<<< * return appctx * else: */ } /* "petsc4py/PETSc/petscpyappctx.pxi":12 * return appctx * else: * if appctx != NULL: # <<<<<<<<<<<<<< * return PyLong_FromVoidPtr(appctx) * else: */ /*else*/ { __pyx_t_2 = (__pyx_v_appctx != NULL); if (__pyx_t_2) { /* "petsc4py/PETSc/petscpyappctx.pxi":13 * else: * if appctx != NULL: * return PyLong_FromVoidPtr(appctx) # <<<<<<<<<<<<<< * else: * return None */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyLong_FromVoidPtr(__pyx_v_appctx); if (unlikely(!__pyx_t_1)) __PYX_ERR(30, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/petscpyappctx.pxi":12 * return appctx * else: * if appctx != NULL: # <<<<<<<<<<<<<< * return PyLong_FromVoidPtr(appctx) * else: */ } /* "petsc4py/PETSc/petscpyappctx.pxi":15 * return PyLong_FromVoidPtr(appctx) * else: * return None # <<<<<<<<<<<<<< */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } } /* "petsc4py/PETSc/petscpyappctx.pxi":7 * appctx_registry.add(key) * * cdef inline object toAppCtx(void *appctx): # <<<<<<<<<<<<<< * cdef object key = appctx * if key in appctx_registry: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.toAppCtx", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_key); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Error.pyx":15 * _traceback_ = [] * * def __init__(self, int ierr=0): # <<<<<<<<<<<<<< * self.ierr = ierr * RuntimeError.__init__(self, self.ierr) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5Error_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_5Error___init__, "Error.__init__(self, ierr: int = 0)\nSource code at petsc4py/PETSc/Error.pyx:15"); static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_5Error_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Error_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Error___init__}; static PyObject *__pyx_pw_8petsc4py_5PETSc_5Error_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; int __pyx_v_ierr; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_ierr,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 15, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ierr); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 15, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(1, 15, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; if (values[1]) { __pyx_v_ierr = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_ierr == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 15, __pyx_L3_error) } else { __pyx_v_ierr = ((int)((int)0)); } } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, __pyx_nargs); __PYX_ERR(1, 15, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Error.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_5Error___init__(__pyx_self, __pyx_v_self, __pyx_v_ierr); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5Error___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, int __pyx_v_ierr) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 1); /* "petsc4py/PETSc/Error.pyx":16 * * def __init__(self, int ierr=0): * self.ierr = ierr # <<<<<<<<<<<<<< * RuntimeError.__init__(self, self.ierr) * */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ierr); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_ierr, __pyx_t_1) < 0) __PYX_ERR(1, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Error.pyx":17 * def __init__(self, int ierr=0): * self.ierr = ierr * RuntimeError.__init__(self, self.ierr) # <<<<<<<<<<<<<< * * def __bool__(self): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_builtin_RuntimeError, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ierr); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_self, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Error.pyx":15 * _traceback_ = [] * * def __init__(self, int ierr=0): # <<<<<<<<<<<<<< * self.ierr = ierr * RuntimeError.__init__(self, self.ierr) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.Error.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Error.pyx":19 * RuntimeError.__init__(self, self.ierr) * * def __bool__(self): # <<<<<<<<<<<<<< * cdef int ierr = self.ierr * return ierr != 0 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5Error_3__bool__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_5Error_2__bool__, "Error.__bool__(self)\nSource code at petsc4py/PETSc/Error.pyx:19"); static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_5Error_3__bool__ = {"__bool__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Error_3__bool__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Error_2__bool__}; static PyObject *__pyx_pw_8petsc4py_5PETSc_5Error_3__bool__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__bool__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 19, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__bool__") < 0)) __PYX_ERR(1, 19, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__bool__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 19, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Error.__bool__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_5Error_2__bool__(__pyx_self, __pyx_v_self); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5Error_2__bool__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { int __pyx_v_ierr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__bool__", 1); /* "petsc4py/PETSc/Error.pyx":20 * * def __bool__(self): * cdef int ierr = self.ierr # <<<<<<<<<<<<<< * return ierr != 0 * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ierr); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 20, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_ierr = __pyx_t_2; /* "petsc4py/PETSc/Error.pyx":21 * def __bool__(self): * cdef int ierr = self.ierr * return ierr != 0 # <<<<<<<<<<<<<< * * def __repr__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_ierr != 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Error.pyx":19 * RuntimeError.__init__(self, self.ierr) * * def __bool__(self): # <<<<<<<<<<<<<< * cdef int ierr = self.ierr * return ierr != 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Error.__bool__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Error.pyx":23 * return ierr != 0 * * def __repr__(self): # <<<<<<<<<<<<<< * return 'PETSc.Error(%d)' % self.ierr * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5Error_5__repr__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_5Error_4__repr__, "Error.__repr__(self)\nSource code at petsc4py/PETSc/Error.pyx:23"); static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_5Error_5__repr__ = {"__repr__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Error_5__repr__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Error_4__repr__}; static PyObject *__pyx_pw_8petsc4py_5PETSc_5Error_5__repr__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 23, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__repr__") < 0)) __PYX_ERR(1, 23, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__repr__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 23, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Error.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_5Error_4__repr__(__pyx_self, __pyx_v_self); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5Error_4__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__repr__", 1); /* "petsc4py/PETSc/Error.pyx":24 * * def __repr__(self): * return 'PETSc.Error(%d)' % self.ierr # <<<<<<<<<<<<<< * * def __str__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ierr); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyString_FormatSafe(__pyx_kp_s_PETSc_Error_d, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Error.pyx":23 * return ierr != 0 * * def __repr__(self): # <<<<<<<<<<<<<< * return 'PETSc.Error(%d)' % self.ierr * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Error.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Error.pyx":26 * return 'PETSc.Error(%d)' % self.ierr * * def __str__(self): # <<<<<<<<<<<<<< * cdef int csize=1, crank=0 * if not (PetscFinalizeCalled): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5Error_7__str__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_5Error_6__str__, "Error.__str__(self)\nSource code at petsc4py/PETSc/Error.pyx:26"); static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_5Error_7__str__ = {"__str__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Error_7__str__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Error_6__str__}; static PyObject *__pyx_pw_8petsc4py_5PETSc_5Error_7__str__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 26, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__str__") < 0)) __PYX_ERR(1, 26, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__str__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 26, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Error.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_5Error_6__str__(__pyx_self, __pyx_v_self); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5Error_6__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { int __pyx_v_csize; int __pyx_v_crank; Py_ssize_t __pyx_v_width; int __pyx_v_rank; PyObject *__pyx_v_tblist = NULL; PyObject *__pyx_v_entry = NULL; PyObject *__pyx_v_tbline = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; int __pyx_t_5; PyObject *(*__pyx_t_6)(PyObject *); PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__str__", 1); /* "petsc4py/PETSc/Error.pyx":27 * * def __str__(self): * cdef int csize=1, crank=0 # <<<<<<<<<<<<<< * if not (PetscFinalizeCalled): * MPI_Comm_size(PETSC_COMM_WORLD, &csize) */ __pyx_v_csize = 1; __pyx_v_crank = 0; /* "petsc4py/PETSc/Error.pyx":28 * def __str__(self): * cdef int csize=1, crank=0 * if not (PetscFinalizeCalled): # <<<<<<<<<<<<<< * MPI_Comm_size(PETSC_COMM_WORLD, &csize) * MPI_Comm_rank(PETSC_COMM_WORLD, &crank) */ __pyx_t_1 = (!(((int)PetscFinalizeCalled) != 0)); if (__pyx_t_1) { /* "petsc4py/PETSc/Error.pyx":29 * cdef int csize=1, crank=0 * if not (PetscFinalizeCalled): * MPI_Comm_size(PETSC_COMM_WORLD, &csize) # <<<<<<<<<<<<<< * MPI_Comm_rank(PETSC_COMM_WORLD, &crank) * width, rank = len(str(csize-1)), crank */ (void)(MPI_Comm_size(PETSC_COMM_WORLD, (&__pyx_v_csize))); /* "petsc4py/PETSc/Error.pyx":30 * if not (PetscFinalizeCalled): * MPI_Comm_size(PETSC_COMM_WORLD, &csize) * MPI_Comm_rank(PETSC_COMM_WORLD, &crank) # <<<<<<<<<<<<<< * width, rank = len(str(csize-1)), crank * tblist = ['error code %d' % self.ierr] */ (void)(MPI_Comm_rank(PETSC_COMM_WORLD, (&__pyx_v_crank))); /* "petsc4py/PETSc/Error.pyx":28 * def __str__(self): * cdef int csize=1, crank=0 * if not (PetscFinalizeCalled): # <<<<<<<<<<<<<< * MPI_Comm_size(PETSC_COMM_WORLD, &csize) * MPI_Comm_rank(PETSC_COMM_WORLD, &crank) */ } /* "petsc4py/PETSc/Error.pyx":31 * MPI_Comm_size(PETSC_COMM_WORLD, &csize) * MPI_Comm_rank(PETSC_COMM_WORLD, &crank) * width, rank = len(str(csize-1)), crank # <<<<<<<<<<<<<< * tblist = ['error code %d' % self.ierr] * for entry in self._traceback_: */ __pyx_t_2 = __Pyx_PyInt_From_long((__pyx_v_csize - 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_Str(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(1, 31, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = __pyx_v_crank; __pyx_v_width = __pyx_t_4; __pyx_v_rank = __pyx_t_5; /* "petsc4py/PETSc/Error.pyx":32 * MPI_Comm_rank(PETSC_COMM_WORLD, &crank) * width, rank = len(str(csize-1)), crank * tblist = ['error code %d' % self.ierr] # <<<<<<<<<<<<<< * for entry in self._traceback_: * tbline = '[%*d] %s' % (width, rank, entry) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ierr); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyString_FormatSafe(__pyx_kp_s_error_code_d, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(1, 32, __pyx_L1_error); __pyx_t_2 = 0; __pyx_v_tblist = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/Error.pyx":33 * width, rank = len(str(csize-1)), crank * tblist = ['error code %d' % self.ierr] * for entry in self._traceback_: # <<<<<<<<<<<<<< * tbline = '[%*d] %s' % (width, rank, entry) * tblist.append(tbline) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_traceback); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; __pyx_t_6 = NULL; } else { __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 33, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_2))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 33, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(1, 33, __pyx_L1_error) #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 33, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(1, 33, __pyx_L1_error) #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } } else { __pyx_t_3 = __pyx_t_6(__pyx_t_2); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(1, 33, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_3); } __Pyx_XDECREF_SET(__pyx_v_entry, __pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/Error.pyx":34 * tblist = ['error code %d' % self.ierr] * for entry in self._traceback_: * tbline = '[%*d] %s' % (width, rank, entry) # <<<<<<<<<<<<<< * tblist.append(tbline) * return '\n'.join(tblist) */ __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_width); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_rank); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3)) __PYX_ERR(1, 34, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7)) __PYX_ERR(1, 34, __pyx_L1_error); __Pyx_INCREF(__pyx_v_entry); __Pyx_GIVEREF(__pyx_v_entry); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_v_entry)) __PYX_ERR(1, 34, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_d_s, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF_SET(__pyx_v_tbline, ((PyObject*)__pyx_t_7)); __pyx_t_7 = 0; /* "petsc4py/PETSc/Error.pyx":35 * for entry in self._traceback_: * tbline = '[%*d] %s' % (width, rank, entry) * tblist.append(tbline) # <<<<<<<<<<<<<< * return '\n'.join(tblist) * */ __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_tblist, __pyx_v_tbline); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 35, __pyx_L1_error) /* "petsc4py/PETSc/Error.pyx":33 * width, rank = len(str(csize-1)), crank * tblist = ['error code %d' % self.ierr] * for entry in self._traceback_: # <<<<<<<<<<<<<< * tbline = '[%*d] %s' % (width, rank, entry) * tblist.append(tbline) */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/Error.pyx":36 * tbline = '[%*d] %s' % (width, rank, entry) * tblist.append(tbline) * return '\n'.join(tblist) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyString_Join(__pyx_kp_s__26, __pyx_v_tblist); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Error.pyx":26 * return 'PETSc.Error(%d)' % self.ierr * * def __str__(self): # <<<<<<<<<<<<<< * cdef int csize=1, crank=0 * if not (PetscFinalizeCalled): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("petsc4py.PETSc.Error.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_tblist); __Pyx_XDECREF(__pyx_v_entry); __Pyx_XDECREF(__pyx_v_tbline); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Options.pyx":8 * cdef object _prefix * * def __init__(self, prefix=None): # <<<<<<<<<<<<<< * self.opt = NULL * self.prefix = prefix */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_7Options_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_7Options_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_prefix = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_prefix,0}; values[0] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_prefix); if (value) { values[0] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(31, 8, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(31, 8, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_prefix = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, __pyx_nargs); __PYX_ERR(31, 8, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Options.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options___init__(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self), __pyx_v_prefix); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_7Options___init__(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_prefix) { int __pyx_r; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "petsc4py/PETSc/Options.pyx":9 * * def __init__(self, prefix=None): * self.opt = NULL # <<<<<<<<<<<<<< * self.prefix = prefix * */ __pyx_v_self->opt = NULL; /* "petsc4py/PETSc/Options.pyx":10 * def __init__(self, prefix=None): * self.opt = NULL * self.prefix = prefix # <<<<<<<<<<<<<< * * def __dealloc__(self): */ if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_prefix, __pyx_v_prefix) < 0) __PYX_ERR(31, 10, __pyx_L1_error) /* "petsc4py/PETSc/Options.pyx":8 * cdef object _prefix * * def __init__(self, prefix=None): # <<<<<<<<<<<<<< * self.opt = NULL * self.prefix = prefix */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Options.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/Options.pyx":12 * self.prefix = prefix * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self.opt == NULL: return * CHKERR( PetscOptionsDestroy(&self.opt) ) */ /* Python wrapper */ static void __pyx_pw_8petsc4py_5PETSc_7Options_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_8petsc4py_5PETSc_7Options_3__dealloc__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_pf_8petsc4py_5PETSc_7Options_2__dealloc__(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_8petsc4py_5PETSc_7Options_2__dealloc__(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self) { int __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "petsc4py/PETSc/Options.pyx":13 * * def __dealloc__(self): * if self.opt == NULL: return # <<<<<<<<<<<<<< * CHKERR( PetscOptionsDestroy(&self.opt) ) * */ __pyx_t_1 = (__pyx_v_self->opt == NULL); if (__pyx_t_1) { goto __pyx_L0; } /* "petsc4py/PETSc/Options.pyx":14 * def __dealloc__(self): * if self.opt == NULL: return * CHKERR( PetscOptionsDestroy(&self.opt) ) # <<<<<<<<<<<<<< * * def __contains__(self, item): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsDestroy((&__pyx_v_self->opt))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(31, 14, __pyx_L1_error) /* "petsc4py/PETSc/Options.pyx":12 * self.prefix = prefix * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self.opt == NULL: return * CHKERR( PetscOptionsDestroy(&self.opt) ) */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_WriteUnraisable("petsc4py.PETSc.Options.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_L0:; } /* "petsc4py/PETSc/Options.pyx":16 * CHKERR( PetscOptionsDestroy(&self.opt) ) * * def __contains__(self, item): # <<<<<<<<<<<<<< * return self.hasName(item) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_7Options_5__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_7Options_5__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__contains__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options_4__contains__(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self), ((PyObject *)__pyx_v_item)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_7Options_4__contains__(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_item) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__contains__", 1); /* "petsc4py/PETSc/Options.pyx":17 * * def __contains__(self, item): * return self.hasName(item) # <<<<<<<<<<<<<< * * def __getitem__(self, item): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_hasName); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_item}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(31, 17, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_4; goto __pyx_L0; /* "petsc4py/PETSc/Options.pyx":16 * CHKERR( PetscOptionsDestroy(&self.opt) ) * * def __contains__(self, item): # <<<<<<<<<<<<<< * return self.hasName(item) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Options.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Options.pyx":19 * return self.hasName(item) * * def __getitem__(self, item): # <<<<<<<<<<<<<< * return self.getString(item) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_7__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_7__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options_6__getitem__(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self), ((PyObject *)__pyx_v_item)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_6__getitem__(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_item) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getitem__", 1); /* "petsc4py/PETSc/Options.pyx":20 * * def __getitem__(self, item): * return self.getString(item) # <<<<<<<<<<<<<< * * def __setitem__(self, item, value): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getString); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_item}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Options.pyx":19 * return self.hasName(item) * * def __getitem__(self, item): # <<<<<<<<<<<<<< * return self.getString(item) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Options.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Options.pyx":22 * return self.getString(item) * * def __setitem__(self, item, value): # <<<<<<<<<<<<<< * self.setValue(item, value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_7Options_9__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_7Options_9__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options_8__setitem__(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_7Options_8__setitem__(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setitem__", 1); /* "petsc4py/PETSc/Options.pyx":23 * * def __setitem__(self, item, value): * self.setValue(item, value) # <<<<<<<<<<<<<< * * def __delitem__(self, item): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setValue); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_item, __pyx_v_value}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Options.pyx":22 * return self.getString(item) * * def __setitem__(self, item, value): # <<<<<<<<<<<<<< * self.setValue(item, value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Options.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Options.pyx":25 * self.setValue(item, value) * * def __delitem__(self, item): # <<<<<<<<<<<<<< * self.delValue(item) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_7Options_11__delitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_7Options_11__delitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__delitem__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options_10__delitem__(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self), ((PyObject *)__pyx_v_item)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_7Options_10__delitem__(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_item) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__delitem__", 1); /* "petsc4py/PETSc/Options.pyx":26 * * def __delitem__(self, item): * self.delValue(item) # <<<<<<<<<<<<<< * * property prefix: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_delValue); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_item}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Options.pyx":25 * self.setValue(item, value) * * def __delitem__(self, item): # <<<<<<<<<<<<<< * self.delValue(item) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Options.__delitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Options.pyx":29 * * property prefix: * def __get__(self): # <<<<<<<<<<<<<< * return self._prefix * def __set__(self, prefix): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_6prefix_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_6prefix_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options_6prefix___get__(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_6prefix___get__(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/Options.pyx":30 * property prefix: * def __get__(self): * return self._prefix # <<<<<<<<<<<<<< * def __set__(self, prefix): * self._prefix = getprefix(prefix) */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_prefix); __pyx_r = __pyx_v_self->_prefix; goto __pyx_L0; /* "petsc4py/PETSc/Options.pyx":29 * * property prefix: * def __get__(self): # <<<<<<<<<<<<<< * return self._prefix * def __set__(self, prefix): */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Options.pyx":31 * def __get__(self): * return self._prefix * def __set__(self, prefix): # <<<<<<<<<<<<<< * self._prefix = getprefix(prefix) * def __del__(self): */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_7Options_6prefix_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_prefix); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_7Options_6prefix_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_prefix) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options_6prefix_2__set__(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self), ((PyObject *)__pyx_v_prefix)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_7Options_6prefix_2__set__(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_prefix) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "petsc4py/PETSc/Options.pyx":32 * return self._prefix * def __set__(self, prefix): * self._prefix = getprefix(prefix) # <<<<<<<<<<<<<< * def __del__(self): * self._prefix = None */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_getprefix(__pyx_v_prefix, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->_prefix); __Pyx_DECREF(__pyx_v_self->_prefix); __pyx_v_self->_prefix = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/Options.pyx":31 * def __get__(self): * return self._prefix * def __set__(self, prefix): # <<<<<<<<<<<<<< * self._prefix = getprefix(prefix) * def __del__(self): */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Options.prefix.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Options.pyx":33 * def __set__(self, prefix): * self._prefix = getprefix(prefix) * def __del__(self): # <<<<<<<<<<<<<< * self._prefix = None * # */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_7Options_6prefix_5__del__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_7Options_6prefix_5__del__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options_6prefix_4__del__(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_7Options_6prefix_4__del__(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__", 1); /* "petsc4py/PETSc/Options.pyx":34 * self._prefix = getprefix(prefix) * def __del__(self): * self._prefix = None # <<<<<<<<<<<<<< * # * */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->_prefix); __Pyx_DECREF(__pyx_v_self->_prefix); __pyx_v_self->_prefix = Py_None; /* "petsc4py/PETSc/Options.pyx":33 * def __set__(self, prefix): * self._prefix = getprefix(prefix) * def __del__(self): # <<<<<<<<<<<<<< * self._prefix = None * # */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Options.pyx":37 * # * * def create(self): # <<<<<<<<<<<<<< * if self.opt != NULL: return * CHKERR( PetscOptionsCreate(&self.opt) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_13create(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7Options_12create, "Options.create(self)\nSource code at petsc4py/PETSc/Options.pyx:37"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_13create(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("create", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "create", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options_12create(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_12create(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create", 1); /* "petsc4py/PETSc/Options.pyx":38 * * def create(self): * if self.opt != NULL: return # <<<<<<<<<<<<<< * CHKERR( PetscOptionsCreate(&self.opt) ) * return self */ __pyx_t_1 = (__pyx_v_self->opt != NULL); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } /* "petsc4py/PETSc/Options.pyx":39 * def create(self): * if self.opt != NULL: return * CHKERR( PetscOptionsCreate(&self.opt) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsCreate((&__pyx_v_self->opt))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(31, 39, __pyx_L1_error) /* "petsc4py/PETSc/Options.pyx":40 * if self.opt != NULL: return * CHKERR( PetscOptionsCreate(&self.opt) ) * return self # <<<<<<<<<<<<<< * * def destroy(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Options.pyx":37 * # * * def create(self): # <<<<<<<<<<<<<< * if self.opt != NULL: return * CHKERR( PetscOptionsCreate(&self.opt) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Options.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Options.pyx":42 * return self * * def destroy(self): # <<<<<<<<<<<<<< * if self.opt == NULL: return * CHKERR( PetscOptionsDestroy(&self.opt) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_15destroy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7Options_14destroy, "Options.destroy(self)\nSource code at petsc4py/PETSc/Options.pyx:42"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_15destroy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("destroy (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options_14destroy(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_14destroy(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("destroy", 1); /* "petsc4py/PETSc/Options.pyx":43 * * def destroy(self): * if self.opt == NULL: return # <<<<<<<<<<<<<< * CHKERR( PetscOptionsDestroy(&self.opt) ) * return self */ __pyx_t_1 = (__pyx_v_self->opt == NULL); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } /* "petsc4py/PETSc/Options.pyx":44 * def destroy(self): * if self.opt == NULL: return * CHKERR( PetscOptionsDestroy(&self.opt) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsDestroy((&__pyx_v_self->opt))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(31, 44, __pyx_L1_error) /* "petsc4py/PETSc/Options.pyx":45 * if self.opt == NULL: return * CHKERR( PetscOptionsDestroy(&self.opt) ) * return self # <<<<<<<<<<<<<< * * def clear(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Options.pyx":42 * return self * * def destroy(self): # <<<<<<<<<<<<<< * if self.opt == NULL: return * CHKERR( PetscOptionsDestroy(&self.opt) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Options.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Options.pyx":47 * return self * * def clear(self): # <<<<<<<<<<<<<< * if self.opt == NULL: return * CHKERR( PetscOptionsClear(self.opt) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_17clear(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7Options_16clear, "Options.clear(self)\nSource code at petsc4py/PETSc/Options.pyx:47"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_17clear(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("clear (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("clear", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "clear", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options_16clear(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_16clear(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("clear", 1); /* "petsc4py/PETSc/Options.pyx":48 * * def clear(self): * if self.opt == NULL: return # <<<<<<<<<<<<<< * CHKERR( PetscOptionsClear(self.opt) ) * return self */ __pyx_t_1 = (__pyx_v_self->opt == NULL); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } /* "petsc4py/PETSc/Options.pyx":49 * def clear(self): * if self.opt == NULL: return * CHKERR( PetscOptionsClear(self.opt) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsClear(__pyx_v_self->opt)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(31, 49, __pyx_L1_error) /* "petsc4py/PETSc/Options.pyx":50 * if self.opt == NULL: return * CHKERR( PetscOptionsClear(self.opt) ) * return self # <<<<<<<<<<<<<< * * def view(self, Viewer viewer=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Options.pyx":47 * return self * * def clear(self): # <<<<<<<<<<<<<< * if self.opt == NULL: return * CHKERR( PetscOptionsClear(self.opt) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Options.clear", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Options.pyx":52 * return self * * def view(self, Viewer viewer=None): # <<<<<<<<<<<<<< * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_19view(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7Options_18view, "Options.view(self, viewer: Viewer | None = None)\nSource code at petsc4py/PETSc/Options.pyx:52"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_19view(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscViewerObject *__pyx_v_viewer = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("view (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscViewerObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_viewer); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(31, 52, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "view") < 0)) __PYX_ERR(31, 52, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, __pyx_nargs); __PYX_ERR(31, 52, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Options.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(31, 52, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options_18view(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self), __pyx_v_viewer); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_18view(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer) { PetscViewer __pyx_v_vwr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscViewer __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("view", 1); /* "petsc4py/PETSc/Options.pyx":53 * * def view(self, Viewer viewer=None): * cdef PetscViewer vwr = NULL # <<<<<<<<<<<<<< * if viewer is not None: vwr = viewer.vwr * CHKERR( PetscOptionsView(self.opt, vwr) ) */ __pyx_v_vwr = NULL; /* "petsc4py/PETSc/Options.pyx":54 * def view(self, Viewer viewer=None): * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr # <<<<<<<<<<<<<< * CHKERR( PetscOptionsView(self.opt, vwr) ) * */ __pyx_t_1 = (((PyObject *)__pyx_v_viewer) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_viewer->vwr; __pyx_v_vwr = __pyx_t_2; } /* "petsc4py/PETSc/Options.pyx":55 * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr * CHKERR( PetscOptionsView(self.opt, vwr) ) # <<<<<<<<<<<<<< * * def prefixPush(self, prefix): */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsView(__pyx_v_self->opt, __pyx_v_vwr)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(31, 55, __pyx_L1_error) /* "petsc4py/PETSc/Options.pyx":52 * return self * * def view(self, Viewer viewer=None): # <<<<<<<<<<<<<< * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Options.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Options.pyx":57 * CHKERR( PetscOptionsView(self.opt, vwr) ) * * def prefixPush(self, prefix): # <<<<<<<<<<<<<< * prefix = getprefix(prefix) * cdef const char *cprefix = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_21prefixPush(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7Options_20prefixPush, "Options.prefixPush(self, prefix)\nSource code at petsc4py/PETSc/Options.pyx:57"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_21prefixPush(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_prefix = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("prefixPush (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_prefix,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_prefix)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(31, 57, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "prefixPush") < 0)) __PYX_ERR(31, 57, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_prefix = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("prefixPush", 1, 1, 1, __pyx_nargs); __PYX_ERR(31, 57, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Options.prefixPush", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options_20prefixPush(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self), __pyx_v_prefix); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_20prefixPush(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_prefix) { char const *__pyx_v_cprefix; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("prefixPush", 0); __Pyx_INCREF(__pyx_v_prefix); /* "petsc4py/PETSc/Options.pyx":58 * * def prefixPush(self, prefix): * prefix = getprefix(prefix) # <<<<<<<<<<<<<< * cdef const char *cprefix = NULL * prefix = str2bytes(prefix, &cprefix) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_getprefix(__pyx_v_prefix, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_prefix, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Options.pyx":59 * def prefixPush(self, prefix): * prefix = getprefix(prefix) * cdef const char *cprefix = NULL # <<<<<<<<<<<<<< * prefix = str2bytes(prefix, &cprefix) * CHKERR( PetscOptionsPrefixPush(self.opt, cprefix) ) */ __pyx_v_cprefix = NULL; /* "petsc4py/PETSc/Options.pyx":60 * prefix = getprefix(prefix) * cdef const char *cprefix = NULL * prefix = str2bytes(prefix, &cprefix) # <<<<<<<<<<<<<< * CHKERR( PetscOptionsPrefixPush(self.opt, cprefix) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_prefix, (&__pyx_v_cprefix)); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_prefix, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Options.pyx":61 * cdef const char *cprefix = NULL * prefix = str2bytes(prefix, &cprefix) * CHKERR( PetscOptionsPrefixPush(self.opt, cprefix) ) # <<<<<<<<<<<<<< * * def prefixPop(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsPrefixPush(__pyx_v_self->opt, __pyx_v_cprefix)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(31, 61, __pyx_L1_error) /* "petsc4py/PETSc/Options.pyx":57 * CHKERR( PetscOptionsView(self.opt, vwr) ) * * def prefixPush(self, prefix): # <<<<<<<<<<<<<< * prefix = getprefix(prefix) * cdef const char *cprefix = NULL */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Options.prefixPush", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_prefix); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Options.pyx":63 * CHKERR( PetscOptionsPrefixPush(self.opt, cprefix) ) * * def prefixPop(self): # <<<<<<<<<<<<<< * CHKERR( PetscOptionsPrefixPop(self.opt) ) * # */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_23prefixPop(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7Options_22prefixPop, "Options.prefixPop(self)\nSource code at petsc4py/PETSc/Options.pyx:63"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_23prefixPop(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("prefixPop (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("prefixPop", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "prefixPop", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options_22prefixPop(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_22prefixPop(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("prefixPop", 1); /* "petsc4py/PETSc/Options.pyx":64 * * def prefixPop(self): * CHKERR( PetscOptionsPrefixPop(self.opt) ) # <<<<<<<<<<<<<< * # * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsPrefixPop(__pyx_v_self->opt)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(31, 64, __pyx_L1_error) /* "petsc4py/PETSc/Options.pyx":63 * CHKERR( PetscOptionsPrefixPush(self.opt, cprefix) ) * * def prefixPop(self): # <<<<<<<<<<<<<< * CHKERR( PetscOptionsPrefixPop(self.opt) ) * # */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Options.prefixPop", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Options.pyx":67 * # * * def hasName(self, name): # <<<<<<<<<<<<<< * cdef const char *pr = NULL * cdef const char *nm = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_25hasName(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7Options_24hasName, "Options.hasName(self, name)\nSource code at petsc4py/PETSc/Options.pyx:67"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_25hasName(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_name = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("hasName (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(31, 67, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "hasName") < 0)) __PYX_ERR(31, 67, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_name = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("hasName", 1, 1, 1, __pyx_nargs); __PYX_ERR(31, 67, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Options.hasName", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options_24hasName(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self), __pyx_v_name); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_24hasName(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_name) { char const *__pyx_v_pr; char const *__pyx_v_nm; CYTHON_UNUSED PyObject *__pyx_v_tmp = NULL; PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("hasName", 1); /* "petsc4py/PETSc/Options.pyx":68 * * def hasName(self, name): * cdef const char *pr = NULL # <<<<<<<<<<<<<< * cdef const char *nm = NULL * tmp = getpair(self.prefix, name, &pr, &nm) */ __pyx_v_pr = NULL; /* "petsc4py/PETSc/Options.pyx":69 * def hasName(self, name): * cdef const char *pr = NULL * cdef const char *nm = NULL # <<<<<<<<<<<<<< * tmp = getpair(self.prefix, name, &pr, &nm) * cdef PetscBool flag = PETSC_FALSE */ __pyx_v_nm = NULL; /* "petsc4py/PETSc/Options.pyx":70 * cdef const char *pr = NULL * cdef const char *nm = NULL * tmp = getpair(self.prefix, name, &pr, &nm) # <<<<<<<<<<<<<< * cdef PetscBool flag = PETSC_FALSE * CHKERR( PetscOptionsHasName(self.opt, pr, nm, &flag) ) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_prefix); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_getpair(__pyx_t_1, __pyx_v_name, (&__pyx_v_pr), (&__pyx_v_nm)); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_tmp = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/Options.pyx":71 * cdef const char *nm = NULL * tmp = getpair(self.prefix, name, &pr, &nm) * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( PetscOptionsHasName(self.opt, pr, nm, &flag) ) * return toBool(flag) */ __pyx_v_flag = PETSC_FALSE; /* "petsc4py/PETSc/Options.pyx":72 * tmp = getpair(self.prefix, name, &pr, &nm) * cdef PetscBool flag = PETSC_FALSE * CHKERR( PetscOptionsHasName(self.opt, pr, nm, &flag) ) # <<<<<<<<<<<<<< * return toBool(flag) * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsHasName(__pyx_v_self->opt, __pyx_v_pr, __pyx_v_nm, (&__pyx_v_flag))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(31, 72, __pyx_L1_error) /* "petsc4py/PETSc/Options.pyx":73 * cdef PetscBool flag = PETSC_FALSE * CHKERR( PetscOptionsHasName(self.opt, pr, nm, &flag) ) * return toBool(flag) # <<<<<<<<<<<<<< * * def setValue(self, name, value): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Options.pyx":67 * # * * def hasName(self, name): # <<<<<<<<<<<<<< * cdef const char *pr = NULL * cdef const char *nm = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Options.hasName", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_tmp); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Options.pyx":75 * return toBool(flag) * * def setValue(self, name, value): # <<<<<<<<<<<<<< * cdef const char *pr = NULL * cdef const char *nm = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_27setValue(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7Options_26setValue, "Options.setValue(self, name, value)\nSource code at petsc4py/PETSc/Options.pyx:75"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_27setValue(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_name = 0; PyObject *__pyx_v_value = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setValue (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_value,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(31, 75, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(31, 75, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setValue", 1, 2, 2, 1); __PYX_ERR(31, 75, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setValue") < 0)) __PYX_ERR(31, 75, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_name = values[0]; __pyx_v_value = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setValue", 1, 2, 2, __pyx_nargs); __PYX_ERR(31, 75, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Options.setValue", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options_26setValue(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self), __pyx_v_name, __pyx_v_value); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_26setValue(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value) { char const *__pyx_v_pr; char const *__pyx_v_nm; CYTHON_UNUSED PyObject *__pyx_v_tmp = NULL; PyObject *__pyx_v_option = NULL; char const *__pyx_v_key; char const *__pyx_v_val; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PetscErrorCode __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setValue", 0); __Pyx_INCREF(__pyx_v_value); /* "petsc4py/PETSc/Options.pyx":76 * * def setValue(self, name, value): * cdef const char *pr = NULL # <<<<<<<<<<<<<< * cdef const char *nm = NULL * tmp = getpair(self.prefix, name, &pr, &nm) */ __pyx_v_pr = NULL; /* "petsc4py/PETSc/Options.pyx":77 * def setValue(self, name, value): * cdef const char *pr = NULL * cdef const char *nm = NULL # <<<<<<<<<<<<<< * tmp = getpair(self.prefix, name, &pr, &nm) * if pr == NULL: */ __pyx_v_nm = NULL; /* "petsc4py/PETSc/Options.pyx":78 * cdef const char *pr = NULL * cdef const char *nm = NULL * tmp = getpair(self.prefix, name, &pr, &nm) # <<<<<<<<<<<<<< * if pr == NULL: * option = bytes2str(nm) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_prefix); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_getpair(__pyx_t_1, __pyx_v_name, (&__pyx_v_pr), (&__pyx_v_nm)); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_tmp = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/Options.pyx":79 * cdef const char *nm = NULL * tmp = getpair(self.prefix, name, &pr, &nm) * if pr == NULL: # <<<<<<<<<<<<<< * option = bytes2str(nm) * else: */ __pyx_t_3 = (__pyx_v_pr == NULL); if (__pyx_t_3) { /* "petsc4py/PETSc/Options.pyx":80 * tmp = getpair(self.prefix, name, &pr, &nm) * if pr == NULL: * option = bytes2str(nm) # <<<<<<<<<<<<<< * else: * option = '-%s%s' % (bytes2str(pr), bytes2str(&nm[1])) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_nm); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_option = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/Options.pyx":79 * cdef const char *nm = NULL * tmp = getpair(self.prefix, name, &pr, &nm) * if pr == NULL: # <<<<<<<<<<<<<< * option = bytes2str(nm) * else: */ goto __pyx_L3; } /* "petsc4py/PETSc/Options.pyx":82 * option = bytes2str(nm) * else: * option = '-%s%s' % (bytes2str(pr), bytes2str(&nm[1])) # <<<<<<<<<<<<<< * if type(value) is bool: * value = str(value).lower() */ /*else*/ { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_pr); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_bytes2str((&(__pyx_v_nm[1]))); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(31, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(31, 82, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(31, 82, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_s_s, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_option = __pyx_t_1; __pyx_t_1 = 0; } __pyx_L3:; /* "petsc4py/PETSc/Options.pyx":83 * else: * option = '-%s%s' % (bytes2str(pr), bytes2str(&nm[1])) * if type(value) is bool: # <<<<<<<<<<<<<< * value = str(value).lower() * elif value is not None : */ __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_value)) == ((PyObject*)&PyBool_Type)); if (__pyx_t_3) { /* "petsc4py/PETSc/Options.pyx":84 * option = '-%s%s' % (bytes2str(pr), bytes2str(&nm[1])) * if type(value) is bool: * value = str(value).lower() # <<<<<<<<<<<<<< * elif value is not None : * value = str(value) */ __pyx_t_4 = __Pyx_PyObject_Str(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(31, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_lower); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Options.pyx":83 * else: * option = '-%s%s' % (bytes2str(pr), bytes2str(&nm[1])) * if type(value) is bool: # <<<<<<<<<<<<<< * value = str(value).lower() * elif value is not None : */ goto __pyx_L4; } /* "petsc4py/PETSc/Options.pyx":85 * if type(value) is bool: * value = str(value).lower() * elif value is not None : # <<<<<<<<<<<<<< * value = str(value) * cdef const char *key = NULL */ __pyx_t_3 = (__pyx_v_value != Py_None); if (__pyx_t_3) { /* "petsc4py/PETSc/Options.pyx":86 * value = str(value).lower() * elif value is not None : * value = str(value) # <<<<<<<<<<<<<< * cdef const char *key = NULL * cdef const char *val = NULL */ __pyx_t_1 = __Pyx_PyObject_Str(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Options.pyx":85 * if type(value) is bool: * value = str(value).lower() * elif value is not None : # <<<<<<<<<<<<<< * value = str(value) * cdef const char *key = NULL */ } __pyx_L4:; /* "petsc4py/PETSc/Options.pyx":87 * elif value is not None : * value = str(value) * cdef const char *key = NULL # <<<<<<<<<<<<<< * cdef const char *val = NULL * option = str2bytes(option, &key) */ __pyx_v_key = NULL; /* "petsc4py/PETSc/Options.pyx":88 * value = str(value) * cdef const char *key = NULL * cdef const char *val = NULL # <<<<<<<<<<<<<< * option = str2bytes(option, &key) * value = str2bytes(value, &val) */ __pyx_v_val = NULL; /* "petsc4py/PETSc/Options.pyx":89 * cdef const char *key = NULL * cdef const char *val = NULL * option = str2bytes(option, &key) # <<<<<<<<<<<<<< * value = str2bytes(value, &val) * CHKERR( PetscOptionsSetValue(self.opt, key, val) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_option, (&__pyx_v_key)); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_option, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Options.pyx":90 * cdef const char *val = NULL * option = str2bytes(option, &key) * value = str2bytes(value, &val) # <<<<<<<<<<<<<< * CHKERR( PetscOptionsSetValue(self.opt, key, val) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_value, (&__pyx_v_val)); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Options.pyx":91 * option = str2bytes(option, &key) * value = str2bytes(value, &val) * CHKERR( PetscOptionsSetValue(self.opt, key, val) ) # <<<<<<<<<<<<<< * * def delValue(self, name): */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsSetValue(__pyx_v_self->opt, __pyx_v_key, __pyx_v_val)); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(31, 91, __pyx_L1_error) /* "petsc4py/PETSc/Options.pyx":75 * return toBool(flag) * * def setValue(self, name, value): # <<<<<<<<<<<<<< * cdef const char *pr = NULL * cdef const char *nm = NULL */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.Options.setValue", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_tmp); __Pyx_XDECREF(__pyx_v_option); __Pyx_XDECREF(__pyx_v_value); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Options.pyx":93 * CHKERR( PetscOptionsSetValue(self.opt, key, val) ) * * def delValue(self, name): # <<<<<<<<<<<<<< * cdef const char *pr = NULL * cdef const char *nm = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_29delValue(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7Options_28delValue, "Options.delValue(self, name)\nSource code at petsc4py/PETSc/Options.pyx:93"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_29delValue(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_name = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("delValue (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(31, 93, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "delValue") < 0)) __PYX_ERR(31, 93, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_name = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("delValue", 1, 1, 1, __pyx_nargs); __PYX_ERR(31, 93, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Options.delValue", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options_28delValue(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self), __pyx_v_name); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_28delValue(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_name) { char const *__pyx_v_pr; char const *__pyx_v_nm; CYTHON_UNUSED PyObject *__pyx_v_tmp = NULL; PyObject *__pyx_v_option = NULL; char const *__pyx_v_key; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PetscErrorCode __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("delValue", 1); /* "petsc4py/PETSc/Options.pyx":94 * * def delValue(self, name): * cdef const char *pr = NULL # <<<<<<<<<<<<<< * cdef const char *nm = NULL * tmp = getpair(self.prefix, name, &pr, &nm) */ __pyx_v_pr = NULL; /* "petsc4py/PETSc/Options.pyx":95 * def delValue(self, name): * cdef const char *pr = NULL * cdef const char *nm = NULL # <<<<<<<<<<<<<< * tmp = getpair(self.prefix, name, &pr, &nm) * if pr == NULL: */ __pyx_v_nm = NULL; /* "petsc4py/PETSc/Options.pyx":96 * cdef const char *pr = NULL * cdef const char *nm = NULL * tmp = getpair(self.prefix, name, &pr, &nm) # <<<<<<<<<<<<<< * if pr == NULL: * option = bytes2str(nm) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_prefix); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_getpair(__pyx_t_1, __pyx_v_name, (&__pyx_v_pr), (&__pyx_v_nm)); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_tmp = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/Options.pyx":97 * cdef const char *nm = NULL * tmp = getpair(self.prefix, name, &pr, &nm) * if pr == NULL: # <<<<<<<<<<<<<< * option = bytes2str(nm) * else: */ __pyx_t_3 = (__pyx_v_pr == NULL); if (__pyx_t_3) { /* "petsc4py/PETSc/Options.pyx":98 * tmp = getpair(self.prefix, name, &pr, &nm) * if pr == NULL: * option = bytes2str(nm) # <<<<<<<<<<<<<< * else: * option = '-%s%s' % (bytes2str(pr), bytes2str(&nm[1])) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_nm); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_option = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/Options.pyx":97 * cdef const char *nm = NULL * tmp = getpair(self.prefix, name, &pr, &nm) * if pr == NULL: # <<<<<<<<<<<<<< * option = bytes2str(nm) * else: */ goto __pyx_L3; } /* "petsc4py/PETSc/Options.pyx":100 * option = bytes2str(nm) * else: * option = '-%s%s' % (bytes2str(pr), bytes2str(&nm[1])) # <<<<<<<<<<<<<< * cdef const char *key = NULL * option = str2bytes(option, &key) */ /*else*/ { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_pr); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_bytes2str((&(__pyx_v_nm[1]))); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(31, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(31, 100, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(31, 100, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_s_s, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_option = __pyx_t_1; __pyx_t_1 = 0; } __pyx_L3:; /* "petsc4py/PETSc/Options.pyx":101 * else: * option = '-%s%s' % (bytes2str(pr), bytes2str(&nm[1])) * cdef const char *key = NULL # <<<<<<<<<<<<<< * option = str2bytes(option, &key) * CHKERR( PetscOptionsClearValue(self.opt, key) ) */ __pyx_v_key = NULL; /* "petsc4py/PETSc/Options.pyx":102 * option = '-%s%s' % (bytes2str(pr), bytes2str(&nm[1])) * cdef const char *key = NULL * option = str2bytes(option, &key) # <<<<<<<<<<<<<< * CHKERR( PetscOptionsClearValue(self.opt, key) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_option, (&__pyx_v_key)); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_option, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Options.pyx":103 * cdef const char *key = NULL * option = str2bytes(option, &key) * CHKERR( PetscOptionsClearValue(self.opt, key) ) # <<<<<<<<<<<<<< * * # */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsClearValue(__pyx_v_self->opt, __pyx_v_key)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(31, 103, __pyx_L1_error) /* "petsc4py/PETSc/Options.pyx":93 * CHKERR( PetscOptionsSetValue(self.opt, key, val) ) * * def delValue(self, name): # <<<<<<<<<<<<<< * cdef const char *pr = NULL * cdef const char *nm = NULL */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.Options.delValue", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_tmp); __Pyx_XDECREF(__pyx_v_option); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Options.pyx":107 * # * * def getBool(self, name, default=None): # <<<<<<<<<<<<<< * return getopt(self.opt, OPT_BOOL, self.prefix, name, default) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_31getBool(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7Options_30getBool, "Options.getBool(self, name, default=None)\nSource code at petsc4py/PETSc/Options.pyx:107"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_31getBool(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_name = 0; PyObject *__pyx_v_default = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getBool (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_default,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(31, 107, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_default); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(31, 107, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getBool") < 0)) __PYX_ERR(31, 107, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_name = values[0]; __pyx_v_default = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getBool", 0, 1, 2, __pyx_nargs); __PYX_ERR(31, 107, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Options.getBool", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options_30getBool(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self), __pyx_v_name, __pyx_v_default); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_30getBool(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_default) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getBool", 1); /* "petsc4py/PETSc/Options.pyx":108 * * def getBool(self, name, default=None): * return getopt(self.opt, OPT_BOOL, self.prefix, name, default) # <<<<<<<<<<<<<< * * def getInt(self, name, default=None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_prefix); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_getopt(__pyx_v_self->opt, __pyx_e_8petsc4py_5PETSc_OPT_BOOL, __pyx_t_1, __pyx_v_name, __pyx_v_default); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Options.pyx":107 * # * * def getBool(self, name, default=None): # <<<<<<<<<<<<<< * return getopt(self.opt, OPT_BOOL, self.prefix, name, default) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Options.getBool", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Options.pyx":110 * return getopt(self.opt, OPT_BOOL, self.prefix, name, default) * * def getInt(self, name, default=None): # <<<<<<<<<<<<<< * return getopt(self.opt, OPT_INT, self.prefix, name, default) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_33getInt(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7Options_32getInt, "Options.getInt(self, name, default=None)\nSource code at petsc4py/PETSc/Options.pyx:110"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_33getInt(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_name = 0; PyObject *__pyx_v_default = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getInt (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_default,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(31, 110, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_default); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(31, 110, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getInt") < 0)) __PYX_ERR(31, 110, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_name = values[0]; __pyx_v_default = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getInt", 0, 1, 2, __pyx_nargs); __PYX_ERR(31, 110, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Options.getInt", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options_32getInt(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self), __pyx_v_name, __pyx_v_default); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_32getInt(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_default) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getInt", 1); /* "petsc4py/PETSc/Options.pyx":111 * * def getInt(self, name, default=None): * return getopt(self.opt, OPT_INT, self.prefix, name, default) # <<<<<<<<<<<<<< * * def getReal(self, name, default=None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_prefix); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_getopt(__pyx_v_self->opt, __pyx_e_8petsc4py_5PETSc_OPT_INT, __pyx_t_1, __pyx_v_name, __pyx_v_default); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Options.pyx":110 * return getopt(self.opt, OPT_BOOL, self.prefix, name, default) * * def getInt(self, name, default=None): # <<<<<<<<<<<<<< * return getopt(self.opt, OPT_INT, self.prefix, name, default) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Options.getInt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Options.pyx":113 * return getopt(self.opt, OPT_INT, self.prefix, name, default) * * def getReal(self, name, default=None): # <<<<<<<<<<<<<< * return getopt(self.opt, OPT_REAL, self.prefix, name, default) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_35getReal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7Options_34getReal, "Options.getReal(self, name, default=None)\nSource code at petsc4py/PETSc/Options.pyx:113"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_35getReal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_name = 0; PyObject *__pyx_v_default = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getReal (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_default,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(31, 113, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_default); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(31, 113, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getReal") < 0)) __PYX_ERR(31, 113, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_name = values[0]; __pyx_v_default = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getReal", 0, 1, 2, __pyx_nargs); __PYX_ERR(31, 113, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Options.getReal", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options_34getReal(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self), __pyx_v_name, __pyx_v_default); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_34getReal(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_default) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getReal", 1); /* "petsc4py/PETSc/Options.pyx":114 * * def getReal(self, name, default=None): * return getopt(self.opt, OPT_REAL, self.prefix, name, default) # <<<<<<<<<<<<<< * * def getScalar(self, name, default=None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_prefix); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_getopt(__pyx_v_self->opt, __pyx_e_8petsc4py_5PETSc_OPT_REAL, __pyx_t_1, __pyx_v_name, __pyx_v_default); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Options.pyx":113 * return getopt(self.opt, OPT_INT, self.prefix, name, default) * * def getReal(self, name, default=None): # <<<<<<<<<<<<<< * return getopt(self.opt, OPT_REAL, self.prefix, name, default) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Options.getReal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Options.pyx":116 * return getopt(self.opt, OPT_REAL, self.prefix, name, default) * * def getScalar(self, name, default=None): # <<<<<<<<<<<<<< * return getopt(self.opt, OPT_SCALAR, self.prefix, name, default) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_37getScalar(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7Options_36getScalar, "Options.getScalar(self, name, default=None)\nSource code at petsc4py/PETSc/Options.pyx:116"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_37getScalar(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_name = 0; PyObject *__pyx_v_default = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getScalar (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_default,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(31, 116, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_default); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(31, 116, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getScalar") < 0)) __PYX_ERR(31, 116, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_name = values[0]; __pyx_v_default = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getScalar", 0, 1, 2, __pyx_nargs); __PYX_ERR(31, 116, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Options.getScalar", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options_36getScalar(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self), __pyx_v_name, __pyx_v_default); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_36getScalar(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_default) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getScalar", 1); /* "petsc4py/PETSc/Options.pyx":117 * * def getScalar(self, name, default=None): * return getopt(self.opt, OPT_SCALAR, self.prefix, name, default) # <<<<<<<<<<<<<< * * def getString(self, name, default=None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_prefix); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_getopt(__pyx_v_self->opt, __pyx_e_8petsc4py_5PETSc_OPT_SCALAR, __pyx_t_1, __pyx_v_name, __pyx_v_default); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Options.pyx":116 * return getopt(self.opt, OPT_REAL, self.prefix, name, default) * * def getScalar(self, name, default=None): # <<<<<<<<<<<<<< * return getopt(self.opt, OPT_SCALAR, self.prefix, name, default) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Options.getScalar", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Options.pyx":119 * return getopt(self.opt, OPT_SCALAR, self.prefix, name, default) * * def getString(self, name, default=None): # <<<<<<<<<<<<<< * return getopt(self.opt, OPT_STRING, self.prefix, name, default) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_39getString(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7Options_38getString, "Options.getString(self, name, default=None)\nSource code at petsc4py/PETSc/Options.pyx:119"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_39getString(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_name = 0; PyObject *__pyx_v_default = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getString (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_default,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(31, 119, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_default); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(31, 119, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getString") < 0)) __PYX_ERR(31, 119, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_name = values[0]; __pyx_v_default = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getString", 0, 1, 2, __pyx_nargs); __PYX_ERR(31, 119, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Options.getString", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options_38getString(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self), __pyx_v_name, __pyx_v_default); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_38getString(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_default) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getString", 1); /* "petsc4py/PETSc/Options.pyx":120 * * def getString(self, name, default=None): * return getopt(self.opt, OPT_STRING, self.prefix, name, default) # <<<<<<<<<<<<<< * * # */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_prefix); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_getopt(__pyx_v_self->opt, __pyx_e_8petsc4py_5PETSc_OPT_STRING, __pyx_t_1, __pyx_v_name, __pyx_v_default); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Options.pyx":119 * return getopt(self.opt, OPT_SCALAR, self.prefix, name, default) * * def getString(self, name, default=None): # <<<<<<<<<<<<<< * return getopt(self.opt, OPT_STRING, self.prefix, name, default) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Options.getString", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Options.pyx":124 * # * * def insertString(self, string): # <<<<<<<<<<<<<< * cdef const char *cstring = NULL * string = str2bytes(string, &cstring) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_41insertString(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7Options_40insertString, "Options.insertString(self, string)\nSource code at petsc4py/PETSc/Options.pyx:124"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_41insertString(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_string = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("insertString (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_string,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_string)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(31, 124, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "insertString") < 0)) __PYX_ERR(31, 124, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_string = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("insertString", 1, 1, 1, __pyx_nargs); __PYX_ERR(31, 124, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Options.insertString", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options_40insertString(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self), __pyx_v_string); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_40insertString(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_string) { char const *__pyx_v_cstring; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("insertString", 0); __Pyx_INCREF(__pyx_v_string); /* "petsc4py/PETSc/Options.pyx":125 * * def insertString(self, string): * cdef const char *cstring = NULL # <<<<<<<<<<<<<< * string = str2bytes(string, &cstring) * CHKERR( PetscOptionsInsertString(self.opt, cstring) ) */ __pyx_v_cstring = NULL; /* "petsc4py/PETSc/Options.pyx":126 * def insertString(self, string): * cdef const char *cstring = NULL * string = str2bytes(string, &cstring) # <<<<<<<<<<<<<< * CHKERR( PetscOptionsInsertString(self.opt, cstring) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_string, (&__pyx_v_cstring)); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_string, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Options.pyx":127 * cdef const char *cstring = NULL * string = str2bytes(string, &cstring) * CHKERR( PetscOptionsInsertString(self.opt, cstring) ) # <<<<<<<<<<<<<< * * def getAll(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsInsertString(__pyx_v_self->opt, __pyx_v_cstring)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(31, 127, __pyx_L1_error) /* "petsc4py/PETSc/Options.pyx":124 * # * * def insertString(self, string): # <<<<<<<<<<<<<< * cdef const char *cstring = NULL * string = str2bytes(string, &cstring) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Options.insertString", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_string); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Options.pyx":129 * CHKERR( PetscOptionsInsertString(self.opt, cstring) ) * * def getAll(self): # <<<<<<<<<<<<<< * cdef char *allopts = NULL * CHKERR( PetscOptionsGetAll(self.opt, &allopts) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_43getAll(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7Options_42getAll, "Options.getAll(self)\nSource code at petsc4py/PETSc/Options.pyx:129"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_43getAll(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getAll (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getAll", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getAll", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options_42getAll(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_42getAll(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self) { char *__pyx_v_allopts; PyObject *__pyx_v_options = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getAll", 1); /* "petsc4py/PETSc/Options.pyx":130 * * def getAll(self): * cdef char *allopts = NULL # <<<<<<<<<<<<<< * CHKERR( PetscOptionsGetAll(self.opt, &allopts) ) * options = bytes2str(allopts) */ __pyx_v_allopts = NULL; /* "petsc4py/PETSc/Options.pyx":131 * def getAll(self): * cdef char *allopts = NULL * CHKERR( PetscOptionsGetAll(self.opt, &allopts) ) # <<<<<<<<<<<<<< * options = bytes2str(allopts) * CHKERR( PetscFree(allopts) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsGetAll(__pyx_v_self->opt, (&__pyx_v_allopts))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(31, 131, __pyx_L1_error) /* "petsc4py/PETSc/Options.pyx":132 * cdef char *allopts = NULL * CHKERR( PetscOptionsGetAll(self.opt, &allopts) ) * options = bytes2str(allopts) # <<<<<<<<<<<<<< * CHKERR( PetscFree(allopts) ) * return parseopt(options, self.prefix) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_allopts); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_options = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/Options.pyx":133 * CHKERR( PetscOptionsGetAll(self.opt, &allopts) ) * options = bytes2str(allopts) * CHKERR( PetscFree(allopts) ) # <<<<<<<<<<<<<< * return parseopt(options, self.prefix) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_allopts)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(31, 133, __pyx_L1_error) /* "petsc4py/PETSc/Options.pyx":134 * options = bytes2str(allopts) * CHKERR( PetscFree(allopts) ) * return parseopt(options, self.prefix) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_prefix); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_parseopt(__pyx_v_options, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(31, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Options.pyx":129 * CHKERR( PetscOptionsInsertString(self.opt, cstring) ) * * def getAll(self): # <<<<<<<<<<<<<< * cdef char *allopts = NULL * CHKERR( PetscOptionsGetAll(self.opt, &allopts) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Options.getAll", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_options); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Sys.pyx":7 * """System utilities.""" * * @classmethod # <<<<<<<<<<<<<< * def getVersion( * cls, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_1getVersion(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Sys_getVersion, "Sys.getVersion(cls, devel: bool = False, date: bool = False, author: bool = False) -> tuple[int, int, int]\nReturn PETSc version information.\n\n Not collective.\n\n Parameters\n ----------\n devel\n Additionally, return whether using an in-development version.\n date\n Additionally, return date information.\n author\n Additionally, return author information.\n\n Returns\n -------\n major : int\n Major version number.\n minor : int\n Minor version number.\n micro : int\n Micro (or patch) version number.\n\n See Also\n --------\n petsc.PetscGetVersion, petsc.PetscGetVersionNumber\n\n \nSource code at petsc4py/PETSc/Sys.pyx:7"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_1getVersion(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_devel = 0; PyObject *__pyx_v_date = 0; PyObject *__pyx_v_author = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getVersion (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_devel,&__pyx_n_s_date,&__pyx_n_s_author,0}; /* "petsc4py/PETSc/Sys.pyx":10 * def getVersion( * cls, * devel: bool = False, # <<<<<<<<<<<<<< * date: bool = False, * author: bool = False, */ values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False)); /* "petsc4py/PETSc/Sys.pyx":11 * cls, * devel: bool = False, * date: bool = False, # <<<<<<<<<<<<<< * author: bool = False, * ) -> tuple[int, int, int]: */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False)); /* "petsc4py/PETSc/Sys.pyx":12 * devel: bool = False, * date: bool = False, * author: bool = False, # <<<<<<<<<<<<<< * ) -> tuple[int, int, int]: * """Return PETSc version information. */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_devel); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(32, 7, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_date); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(32, 7, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_author); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(32, 7, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getVersion") < 0)) __PYX_ERR(32, 7, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_devel = values[0]; __pyx_v_date = values[1]; __pyx_v_author = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getVersion", 0, 0, 3, __pyx_nargs); __PYX_ERR(32, 7, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Sys.getVersion", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Sys_getVersion(((PyTypeObject*)__pyx_v_cls), __pyx_v_devel, __pyx_v_date, __pyx_v_author); /* "petsc4py/PETSc/Sys.pyx":7 * """System utilities.""" * * @classmethod # <<<<<<<<<<<<<< * def getVersion( * cls, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_getVersion(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_devel, PyObject *__pyx_v_date, PyObject *__pyx_v_author) { char __pyx_v_cversion[0x100]; PetscInt __pyx_v_major; PetscInt __pyx_v_minor; PetscInt __pyx_v_micro; PetscInt __pyx_v_release; PyObject *__pyx_v_out = NULL; PyObject *__pyx_v_version = NULL; PyObject *__pyx_v_vstr = NULL; PyObject *__pyx_8genexpr1__pyx_v_s = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_t_7; int __pyx_t_8; int __pyx_t_9; Py_ssize_t __pyx_t_10; PyObject *(*__pyx_t_11)(PyObject *); PyObject *__pyx_t_12 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getVersion", 0); __Pyx_INCREF(__pyx_v_date); __Pyx_INCREF(__pyx_v_author); /* "petsc4py/PETSc/Sys.pyx":42 * """ * cdef char cversion[256] * cdef PetscInt major=0, minor=0, micro=0, release=0 # <<<<<<<<<<<<<< * CHKERR( PetscGetVersion(cversion, sizeof(cversion)) ) * CHKERR( PetscGetVersionNumber(&major, &minor, µ, &release) ) */ __pyx_v_major = 0; __pyx_v_minor = 0; __pyx_v_micro = 0; __pyx_v_release = 0; /* "petsc4py/PETSc/Sys.pyx":43 * cdef char cversion[256] * cdef PetscInt major=0, minor=0, micro=0, release=0 * CHKERR( PetscGetVersion(cversion, sizeof(cversion)) ) # <<<<<<<<<<<<<< * CHKERR( PetscGetVersionNumber(&major, &minor, µ, &release) ) * out = version = (toInt(major), toInt(minor), toInt(micro)) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscGetVersion(__pyx_v_cversion, (sizeof(__pyx_v_cversion)))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(32, 43, __pyx_L1_error) /* "petsc4py/PETSc/Sys.pyx":44 * cdef PetscInt major=0, minor=0, micro=0, release=0 * CHKERR( PetscGetVersion(cversion, sizeof(cversion)) ) * CHKERR( PetscGetVersionNumber(&major, &minor, µ, &release) ) # <<<<<<<<<<<<<< * out = version = (toInt(major), toInt(minor), toInt(micro)) * if devel or date or author: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscGetVersionNumber((&__pyx_v_major), (&__pyx_v_minor), (&__pyx_v_micro), (&__pyx_v_release))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(32, 44, __pyx_L1_error) /* "petsc4py/PETSc/Sys.pyx":45 * CHKERR( PetscGetVersion(cversion, sizeof(cversion)) ) * CHKERR( PetscGetVersionNumber(&major, &minor, µ, &release) ) * out = version = (toInt(major), toInt(minor), toInt(micro)) # <<<<<<<<<<<<<< * if devel or date or author: * out = [version] */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_major); if (unlikely(!__pyx_t_2)) __PYX_ERR(32, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_minor); if (unlikely(!__pyx_t_3)) __PYX_ERR(32, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_micro); if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(32, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2)) __PYX_ERR(32, 45, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3)) __PYX_ERR(32, 45, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4)) __PYX_ERR(32, 45, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __Pyx_INCREF(__pyx_t_5); __pyx_v_out = __pyx_t_5; __Pyx_INCREF(__pyx_t_5); __pyx_v_version = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/Sys.pyx":46 * CHKERR( PetscGetVersionNumber(&major, &minor, µ, &release) ) * out = version = (toInt(major), toInt(minor), toInt(micro)) * if devel or date or author: # <<<<<<<<<<<<<< * out = [version] * if devel: */ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_devel); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(32, 46, __pyx_L1_error) if (!__pyx_t_7) { } else { __pyx_t_6 = __pyx_t_7; goto __pyx_L4_bool_binop_done; } __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_date); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(32, 46, __pyx_L1_error) if (!__pyx_t_7) { } else { __pyx_t_6 = __pyx_t_7; goto __pyx_L4_bool_binop_done; } __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_author); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(32, 46, __pyx_L1_error) __pyx_t_6 = __pyx_t_7; __pyx_L4_bool_binop_done:; if (__pyx_t_6) { /* "petsc4py/PETSc/Sys.pyx":47 * out = version = (toInt(major), toInt(minor), toInt(micro)) * if devel or date or author: * out = [version] # <<<<<<<<<<<<<< * if devel: * out.append(not release) */ __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(32, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_version); __Pyx_GIVEREF(__pyx_v_version); if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 0, __pyx_v_version)) __PYX_ERR(32, 47, __pyx_L1_error); __Pyx_DECREF_SET(__pyx_v_out, __pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/Sys.pyx":48 * if devel or date or author: * out = [version] * if devel: # <<<<<<<<<<<<<< * out.append(not release) * if date: */ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_devel); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(32, 48, __pyx_L1_error) if (__pyx_t_6) { /* "petsc4py/PETSc/Sys.pyx":49 * out = [version] * if devel: * out.append(not release) # <<<<<<<<<<<<<< * if date: * vstr = bytes2str(cversion) */ __pyx_t_5 = __Pyx_PyBool_FromLong((!(__pyx_v_release != 0))); if (unlikely(!__pyx_t_5)) __PYX_ERR(32, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_8 = __Pyx_PyObject_Append(__pyx_v_out, __pyx_t_5); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(32, 49, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/Sys.pyx":48 * if devel or date or author: * out = [version] * if devel: # <<<<<<<<<<<<<< * out.append(not release) * if date: */ } /* "petsc4py/PETSc/Sys.pyx":50 * if devel: * out.append(not release) * if date: # <<<<<<<<<<<<<< * vstr = bytes2str(cversion) * if release != 0: */ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_date); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(32, 50, __pyx_L1_error) if (__pyx_t_6) { /* "petsc4py/PETSc/Sys.pyx":51 * out.append(not release) * if date: * vstr = bytes2str(cversion) # <<<<<<<<<<<<<< * if release != 0: * date = vstr.split(",", 1)[-1].strip() */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cversion); if (unlikely(!__pyx_t_5)) __PYX_ERR(32, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_v_vstr = __pyx_t_5; __pyx_t_5 = 0; /* "petsc4py/PETSc/Sys.pyx":52 * if date: * vstr = bytes2str(cversion) * if release != 0: # <<<<<<<<<<<<<< * date = vstr.split(",", 1)[-1].strip() * else: */ __pyx_t_6 = (__pyx_v_release != 0); if (__pyx_t_6) { /* "petsc4py/PETSc/Sys.pyx":53 * vstr = bytes2str(cversion) * if release != 0: * date = vstr.split(",", 1)[-1].strip() # <<<<<<<<<<<<<< * else: * date = vstr.split("GIT Date:")[-1].strip() */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_vstr, __pyx_n_s_split); if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(32, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_strip); if (unlikely(!__pyx_t_3)) __PYX_ERR(32, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_9, 0+__pyx_t_9); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(32, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF_SET(__pyx_v_date, __pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/Sys.pyx":52 * if date: * vstr = bytes2str(cversion) * if release != 0: # <<<<<<<<<<<<<< * date = vstr.split(",", 1)[-1].strip() * else: */ goto __pyx_L9; } /* "petsc4py/PETSc/Sys.pyx":55 * date = vstr.split(",", 1)[-1].strip() * else: * date = vstr.split("GIT Date:")[-1].strip() # <<<<<<<<<<<<<< * out.append(date) * if author: */ /*else*/ { __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_vstr, __pyx_n_s_split); if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_kp_s_GIT_Date}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(32, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_strip); if (unlikely(!__pyx_t_3)) __PYX_ERR(32, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_9, 0+__pyx_t_9); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(32, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF_SET(__pyx_v_date, __pyx_t_5); __pyx_t_5 = 0; } __pyx_L9:; /* "petsc4py/PETSc/Sys.pyx":56 * else: * date = vstr.split("GIT Date:")[-1].strip() * out.append(date) # <<<<<<<<<<<<<< * if author: * author = bytes2str(PETSC_AUTHOR_INFO).split('\n') */ __pyx_t_8 = __Pyx_PyObject_Append(__pyx_v_out, __pyx_v_date); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(32, 56, __pyx_L1_error) /* "petsc4py/PETSc/Sys.pyx":50 * if devel: * out.append(not release) * if date: # <<<<<<<<<<<<<< * vstr = bytes2str(cversion) * if release != 0: */ } /* "petsc4py/PETSc/Sys.pyx":57 * date = vstr.split("GIT Date:")[-1].strip() * out.append(date) * if author: # <<<<<<<<<<<<<< * author = bytes2str(PETSC_AUTHOR_INFO).split('\n') * author = tuple([s.strip() for s in author if s]) */ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_author); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(32, 57, __pyx_L1_error) if (__pyx_t_6) { /* "petsc4py/PETSc/Sys.pyx":58 * out.append(date) * if author: * author = bytes2str(PETSC_AUTHOR_INFO).split('\n') # <<<<<<<<<<<<<< * author = tuple([s.strip() for s in author if s]) * out.append(author) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_bytes2str(PETSC_AUTHOR_INFO); if (unlikely(!__pyx_t_3)) __PYX_ERR(32, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_split); if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_s__26}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(32, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF_SET(__pyx_v_author, __pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/Sys.pyx":59 * if author: * author = bytes2str(PETSC_AUTHOR_INFO).split('\n') * author = tuple([s.strip() for s in author if s]) # <<<<<<<<<<<<<< * out.append(author) * return tuple(out) */ { /* enter inner scope */ __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(32, 59, __pyx_L13_error) __Pyx_GOTREF(__pyx_t_5); if (likely(PyList_CheckExact(__pyx_v_author)) || PyTuple_CheckExact(__pyx_v_author)) { __pyx_t_4 = __pyx_v_author; __Pyx_INCREF(__pyx_t_4); __pyx_t_10 = 0; __pyx_t_11 = NULL; } else { __pyx_t_10 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_author); if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 59, __pyx_L13_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(32, 59, __pyx_L13_error) } for (;;) { if (likely(!__pyx_t_11)) { if (likely(PyList_CheckExact(__pyx_t_4))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(32, 59, __pyx_L13_error) #endif if (__pyx_t_10 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(32, 59, __pyx_L13_error) #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) __PYX_ERR(32, 59, __pyx_L13_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(32, 59, __pyx_L13_error) #endif if (__pyx_t_10 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(32, 59, __pyx_L13_error) #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) __PYX_ERR(32, 59, __pyx_L13_error) __Pyx_GOTREF(__pyx_t_3); #endif } } else { __pyx_t_3 = __pyx_t_11(__pyx_t_4); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(32, 59, __pyx_L13_error) } break; } __Pyx_GOTREF(__pyx_t_3); } __Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_s, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_8genexpr1__pyx_v_s); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(32, 59, __pyx_L13_error) if (__pyx_t_6) { __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr1__pyx_v_s, __pyx_n_s_strip); if (unlikely(!__pyx_t_2)) __PYX_ERR(32, 59, __pyx_L13_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_12 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_12)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_12, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_9, 0+__pyx_t_9); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(32, 59, __pyx_L13_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_3))) __PYX_ERR(32, 59, __pyx_L13_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_s); __pyx_8genexpr1__pyx_v_s = 0; goto __pyx_L18_exit_scope; __pyx_L13_error:; __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_s); __pyx_8genexpr1__pyx_v_s = 0; goto __pyx_L1_error; __pyx_L18_exit_scope:; } /* exit inner scope */ __pyx_t_4 = PyList_AsTuple(((PyObject*)__pyx_t_5)); if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_author, __pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/Sys.pyx":60 * author = bytes2str(PETSC_AUTHOR_INFO).split('\n') * author = tuple([s.strip() for s in author if s]) * out.append(author) # <<<<<<<<<<<<<< * return tuple(out) * */ __pyx_t_8 = __Pyx_PyObject_Append(__pyx_v_out, __pyx_v_author); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(32, 60, __pyx_L1_error) /* "petsc4py/PETSc/Sys.pyx":57 * date = vstr.split("GIT Date:")[-1].strip() * out.append(date) * if author: # <<<<<<<<<<<<<< * author = bytes2str(PETSC_AUTHOR_INFO).split('\n') * author = tuple([s.strip() for s in author if s]) */ } /* "petsc4py/PETSc/Sys.pyx":46 * CHKERR( PetscGetVersionNumber(&major, &minor, µ, &release) ) * out = version = (toInt(major), toInt(minor), toInt(micro)) * if devel or date or author: # <<<<<<<<<<<<<< * out = [version] * if devel: */ } /* "petsc4py/PETSc/Sys.pyx":61 * author = tuple([s.strip() for s in author if s]) * out.append(author) * return tuple(out) # <<<<<<<<<<<<<< * * @classmethod */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_out); if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Sys.pyx":7 * """System utilities.""" * * @classmethod # <<<<<<<<<<<<<< * def getVersion( * cls, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_12); __Pyx_AddTraceback("petsc4py.PETSc.Sys.getVersion", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_out); __Pyx_XDECREF(__pyx_v_version); __Pyx_XDECREF(__pyx_v_vstr); __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_s); __Pyx_XDECREF(__pyx_v_date); __Pyx_XDECREF(__pyx_v_author); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Sys.pyx":63 * return tuple(out) * * @classmethod # <<<<<<<<<<<<<< * def getVersionInfo(cls) -> dict[str, bool | int | str]: * """Return PETSc version information. */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_3getVersionInfo(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Sys_2getVersionInfo, "Sys.getVersionInfo(cls) -> dict[str, bool | int | str]\nReturn PETSc version information.\n\n Not collective.\n\n Returns\n -------\n info : dict\n Dictionary with version information.\n\n See Also\n --------\n petsc.PetscGetVersion, petsc.PetscGetVersionNumber\n\n \nSource code at petsc4py/PETSc/Sys.pyx:63"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_3getVersionInfo(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getVersionInfo (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getVersionInfo", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getVersionInfo", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Sys_2getVersionInfo(((PyTypeObject*)__pyx_v_cls)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_2getVersionInfo(PyTypeObject *__pyx_v_cls) { PyObject *__pyx_v_version = NULL; PyObject *__pyx_v_dev = NULL; PyObject *__pyx_v_date = NULL; PyObject *__pyx_v_author = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getVersionInfo", 1); /* "petsc4py/PETSc/Sys.pyx":79 * * """ * version, dev, date, author = cls.getVersion(True, True, True) # <<<<<<<<<<<<<< * return dict(major = version[0], * minor = version[1], */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_cls), __pyx_n_s_getVersion); if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(32, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { PyObject* sequence = __pyx_t_2; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 4)) { if (size > 4) __Pyx_RaiseTooManyValuesError(4); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(32, 79, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 3); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); __pyx_t_4 = PyList_GET_ITEM(sequence, 2); __pyx_t_5 = PyList_GET_ITEM(sequence, 3); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else { Py_ssize_t i; PyObject** temps[4] = {&__pyx_t_1,&__pyx_t_3,&__pyx_t_4,&__pyx_t_5}; for (i=0; i < 4; i++) { PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(32, 79, __pyx_L1_error) __Pyx_GOTREF(item); *(temps[i]) = item; } } #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; PyObject** temps[4] = {&__pyx_t_1,&__pyx_t_3,&__pyx_t_4,&__pyx_t_5}; __pyx_t_6 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(32, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); for (index=0; index < 4; index++) { PyObject* item = __pyx_t_7(__pyx_t_6); if (unlikely(!item)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(item); *(temps[index]) = item; } if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 4) < 0) __PYX_ERR(32, 79, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(32, 79, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_version = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_dev = __pyx_t_3; __pyx_t_3 = 0; __pyx_v_date = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_author = __pyx_t_5; __pyx_t_5 = 0; /* "petsc4py/PETSc/Sys.pyx":80 * """ * version, dev, date, author = cls.getVersion(True, True, True) * return dict(major = version[0], # <<<<<<<<<<<<<< * minor = version[1], * subminor = version[2], */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_2)) __PYX_ERR(32, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_version, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(32, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_major, __pyx_t_5) < 0) __PYX_ERR(32, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/Sys.pyx":81 * version, dev, date, author = cls.getVersion(True, True, True) * return dict(major = version[0], * minor = version[1], # <<<<<<<<<<<<<< * subminor = version[2], * release = not dev, */ __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_version, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(32, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_minor, __pyx_t_5) < 0) __PYX_ERR(32, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/Sys.pyx":82 * return dict(major = version[0], * minor = version[1], * subminor = version[2], # <<<<<<<<<<<<<< * release = not dev, * date = date, */ __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_version, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(32, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_subminor, __pyx_t_5) < 0) __PYX_ERR(32, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/Sys.pyx":83 * minor = version[1], * subminor = version[2], * release = not dev, # <<<<<<<<<<<<<< * date = date, * authorinfo = author) */ __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_dev); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(32, 83, __pyx_L1_error) __pyx_t_5 = __Pyx_PyBool_FromLong((!__pyx_t_8)); if (unlikely(!__pyx_t_5)) __PYX_ERR(32, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_release, __pyx_t_5) < 0) __PYX_ERR(32, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/Sys.pyx":84 * subminor = version[2], * release = not dev, * date = date, # <<<<<<<<<<<<<< * authorinfo = author) * */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_date, __pyx_v_date) < 0) __PYX_ERR(32, 80, __pyx_L1_error) /* "petsc4py/PETSc/Sys.pyx":85 * release = not dev, * date = date, * authorinfo = author) # <<<<<<<<<<<<<< * * # --- xxx --- */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_authorinfo, __pyx_v_author) < 0) __PYX_ERR(32, 80, __pyx_L1_error) __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Sys.pyx":63 * return tuple(out) * * @classmethod # <<<<<<<<<<<<<< * def getVersionInfo(cls) -> dict[str, bool | int | str]: * """Return PETSc version information. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.Sys.getVersionInfo", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_version); __Pyx_XDECREF(__pyx_v_dev); __Pyx_XDECREF(__pyx_v_date); __Pyx_XDECREF(__pyx_v_author); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Sys.pyx":89 * # --- xxx --- * * @classmethod # <<<<<<<<<<<<<< * def isInitialized(cls) -> bool: * """Return whether PETSc has been initialized. */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_5isInitialized(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Sys_4isInitialized, "Sys.isInitialized(cls) -> bool\nReturn whether PETSc has been initialized.\n\n Not collective.\n\n See Also\n --------\n isFinalized\n\n \nSource code at petsc4py/PETSc/Sys.pyx:89"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_5isInitialized(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("isInitialized (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("isInitialized", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "isInitialized", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Sys_4isInitialized(((PyTypeObject*)__pyx_v_cls)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_4isInitialized(CYTHON_UNUSED PyTypeObject *__pyx_v_cls) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("isInitialized", 1); /* "petsc4py/PETSc/Sys.pyx":100 * * """ * return toBool(PetscInitializeCalled) # <<<<<<<<<<<<<< * * @classmethod */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toBool(PetscInitializeCalled); if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Sys.pyx":89 * # --- xxx --- * * @classmethod # <<<<<<<<<<<<<< * def isInitialized(cls) -> bool: * """Return whether PETSc has been initialized. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Sys.isInitialized", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Sys.pyx":102 * return toBool(PetscInitializeCalled) * * @classmethod # <<<<<<<<<<<<<< * def isFinalized(cls) -> bool: * """Return whether PETSc has been finalized. */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_7isFinalized(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Sys_6isFinalized, "Sys.isFinalized(cls) -> bool\nReturn whether PETSc has been finalized.\n\n Not collective.\n\n See Also\n --------\n isInitialized\n\n \nSource code at petsc4py/PETSc/Sys.pyx:102"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_7isFinalized(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("isFinalized (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("isFinalized", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "isFinalized", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Sys_6isFinalized(((PyTypeObject*)__pyx_v_cls)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_6isFinalized(CYTHON_UNUSED PyTypeObject *__pyx_v_cls) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("isFinalized", 1); /* "petsc4py/PETSc/Sys.pyx":113 * * """ * return toBool(PetscFinalizeCalled) # <<<<<<<<<<<<<< * * # --- xxx --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toBool(PetscFinalizeCalled); if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Sys.pyx":102 * return toBool(PetscInitializeCalled) * * @classmethod # <<<<<<<<<<<<<< * def isFinalized(cls) -> bool: * """Return whether PETSc has been finalized. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Sys.isFinalized", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Sys.pyx":117 * # --- xxx --- * * @classmethod # <<<<<<<<<<<<<< * def getDefaultComm(cls) -> Comm: * """Get the default MPI communicator used to create PETSc objects. */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_9getDefaultComm(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Sys_8getDefaultComm, "Sys.getDefaultComm(cls) -> Comm\nGet the default MPI communicator used to create PETSc objects.\n\n Not collective.\n\n See Also\n --------\n setDefaultComm\n\n \nSource code at petsc4py/PETSc/Sys.pyx:117"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_9getDefaultComm(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getDefaultComm (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getDefaultComm", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getDefaultComm", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Sys_8getDefaultComm(((PyTypeObject*)__pyx_v_cls)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_8getDefaultComm(CYTHON_UNUSED PyTypeObject *__pyx_v_cls) { struct PyPetscCommObject *__pyx_v_comm = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getDefaultComm", 1); /* "petsc4py/PETSc/Sys.pyx":128 * * """ * cdef Comm comm = Comm() # <<<<<<<<<<<<<< * comm.comm = PETSC_COMM_DEFAULT * return comm */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Comm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_comm = ((struct PyPetscCommObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Sys.pyx":129 * """ * cdef Comm comm = Comm() * comm.comm = PETSC_COMM_DEFAULT # <<<<<<<<<<<<<< * return comm * */ __pyx_v_comm->comm = __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT; /* "petsc4py/PETSc/Sys.pyx":130 * cdef Comm comm = Comm() * comm.comm = PETSC_COMM_DEFAULT * return comm # <<<<<<<<<<<<<< * * @classmethod */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_comm); __pyx_r = ((PyObject *)__pyx_v_comm); goto __pyx_L0; /* "petsc4py/PETSc/Sys.pyx":117 * # --- xxx --- * * @classmethod # <<<<<<<<<<<<<< * def getDefaultComm(cls) -> Comm: * """Get the default MPI communicator used to create PETSc objects. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Sys.getDefaultComm", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_comm); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Sys.pyx":132 * return comm * * @classmethod # <<<<<<<<<<<<<< * def setDefaultComm(cls, comm: Comm | None) -> None: * """Set the default MPI communicator used to create PETSc objects. */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_11setDefaultComm(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Sys_10setDefaultComm, "Sys.setDefaultComm(cls, comm: Comm | None) -> None\nSet the default MPI communicator used to create PETSc objects.\n\n Logically collective.\n\n Parameters\n ----------\n comm\n MPI communicator. If set to `None`, uses `COMM_WORLD`.\n\n See Also\n --------\n getDefaultComm\n\n \nSource code at petsc4py/PETSc/Sys.pyx:132"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_11setDefaultComm(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setDefaultComm (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(32, 132, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setDefaultComm") < 0)) __PYX_ERR(32, 132, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_comm = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setDefaultComm", 1, 1, 1, __pyx_nargs); __PYX_ERR(32, 132, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Sys.setDefaultComm", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Sys_10setDefaultComm(((PyTypeObject*)__pyx_v_cls), __pyx_v_comm); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_10setDefaultComm(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setDefaultComm", 1); /* "petsc4py/PETSc/Sys.pyx":148 * * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_WORLD) # <<<<<<<<<<<<<< * if ccomm == MPI_COMM_NULL: * raise ValueError("null communicator") */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, PETSC_COMM_WORLD); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(32, 148, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/Sys.pyx":149 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_WORLD) * if ccomm == MPI_COMM_NULL: # <<<<<<<<<<<<<< * raise ValueError("null communicator") * global PETSC_COMM_DEFAULT */ __pyx_t_2 = (__pyx_v_ccomm == MPI_COMM_NULL); if (unlikely(__pyx_t_2)) { /* "petsc4py/PETSc/Sys.pyx":150 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_WORLD) * if ccomm == MPI_COMM_NULL: * raise ValueError("null communicator") # <<<<<<<<<<<<<< * global PETSC_COMM_DEFAULT * PETSC_COMM_DEFAULT = ccomm */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(32, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(32, 150, __pyx_L1_error) /* "petsc4py/PETSc/Sys.pyx":149 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_WORLD) * if ccomm == MPI_COMM_NULL: # <<<<<<<<<<<<<< * raise ValueError("null communicator") * global PETSC_COMM_DEFAULT */ } /* "petsc4py/PETSc/Sys.pyx":152 * raise ValueError("null communicator") * global PETSC_COMM_DEFAULT * PETSC_COMM_DEFAULT = ccomm # <<<<<<<<<<<<<< * * # --- xxx --- */ __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT = __pyx_v_ccomm; /* "petsc4py/PETSc/Sys.pyx":132 * return comm * * @classmethod # <<<<<<<<<<<<<< * def setDefaultComm(cls, comm: Comm | None) -> None: * """Set the default MPI communicator used to create PETSc objects. */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Sys.setDefaultComm", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Sys.pyx":156 * # --- xxx --- * * @classmethod # <<<<<<<<<<<<<< * def Print( * cls, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_13Print(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Sys_12Print, "Sys.Print(cls, *args: Any, sep: str = ' ', end: str = '\\n', comm: Comm | None = None, **kwargs: Any) -> None\nPrint output from the first processor of a communicator.\n\n Collective.\n\n Parameters\n ----------\n *args\n Positional arguments.\n sep\n String inserted between values, by default a space.\n end\n String appended after the last value, by default a newline.\n comm\n MPI communicator, defaults to `getDefaultComm`.\n **kwargs\n Keyword arguments.\n\n See Also\n --------\n petsc.PetscPrintf\n\n \nSource code at petsc4py/PETSc/Sys.pyx:156"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_13Print(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_sep = 0; PyObject *__pyx_v_end = 0; PyObject *__pyx_v_comm = 0; PyObject *__pyx_v_args = 0; CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("Print (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL; __Pyx_GOTREF(__pyx_v_kwargs); __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sep,&__pyx_n_s_end,&__pyx_n_s_comm,0}; values[0] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)__pyx_kp_s__16)); values[1] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)__pyx_kp_s__26)); /* "petsc4py/PETSc/Sys.pyx":162 * sep: str = ' ', * end: str = '\n', * comm: Comm | None = None, # <<<<<<<<<<<<<< * **kwargs: Any, * ) -> None: */ values[2] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { default: case 0: break; } kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); if (kw_args > 0 && (kw_args <= 3)) { Py_ssize_t index; for (index = 0; index < 3 && kw_args > 0; index++) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]); if (value) { values[index] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(32, 156, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, __pyx_v_kwargs, values + 0, 0, "Print") < 0)) __PYX_ERR(32, 156, __pyx_L3_error) } } else if (unlikely(__pyx_nargs < 0)) { goto __pyx_L5_argtuple_error; } else { } __pyx_v_sep = values[0]; __pyx_v_end = values[1]; __pyx_v_comm = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("Print", 0, 0, 0, __pyx_nargs); __PYX_ERR(32, 156, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; __Pyx_AddTraceback("petsc4py.PETSc.Sys.Print", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Sys_12Print(((PyTypeObject*)__pyx_v_cls), __pyx_v_sep, __pyx_v_end, __pyx_v_comm, __pyx_v_args, __pyx_v_kwargs); /* "petsc4py/PETSc/Sys.pyx":156 * # --- xxx --- * * @classmethod # <<<<<<<<<<<<<< * def Print( * cls, */ /* function exit code */ __Pyx_DECREF(__pyx_v_args); __Pyx_DECREF(__pyx_v_kwargs); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_12Print(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_sep, PyObject *__pyx_v_end, PyObject *__pyx_v_comm, PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs) { MPI_Comm __pyx_v_ccomm; PyObject *__pyx_v_format = NULL; PyObject *__pyx_v_message = NULL; char const *__pyx_v_m; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; Py_ssize_t __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PetscErrorCode __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("Print", 0); __Pyx_INCREF(__pyx_v_args); /* "petsc4py/PETSc/Sys.pyx":187 * * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * if comm_rank(ccomm) == 0: * if not args: args = ('',) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(32, 187, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/Sys.pyx":188 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * if comm_rank(ccomm) == 0: # <<<<<<<<<<<<<< * if not args: args = ('',) * format = ['%s', sep] * len(args) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_comm_rank(__pyx_v_ccomm); if (unlikely(__pyx_t_2 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(32, 188, __pyx_L1_error) __pyx_t_3 = (__pyx_t_2 == 0); if (__pyx_t_3) { /* "petsc4py/PETSc/Sys.pyx":189 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * if comm_rank(ccomm) == 0: * if not args: args = ('',) # <<<<<<<<<<<<<< * format = ['%s', sep] * len(args) * format[-1] = end */ __pyx_t_3 = (PyTuple_GET_SIZE(__pyx_v_args) != 0); __pyx_t_4 = (!__pyx_t_3); if (__pyx_t_4) { __Pyx_INCREF(__pyx_tuple__29); __Pyx_DECREF_SET(__pyx_v_args, __pyx_tuple__29); } /* "petsc4py/PETSc/Sys.pyx":190 * if comm_rank(ccomm) == 0: * if not args: args = ('',) * format = ['%s', sep] * len(args) # <<<<<<<<<<<<<< * format[-1] = end * message = ''.join(format) % args */ __pyx_t_5 = __Pyx_PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(32, 190, __pyx_L1_error) __pyx_t_6 = PyList_New(2 * ((__pyx_t_5<0) ? 0:__pyx_t_5)); if (unlikely(!__pyx_t_6)) __PYX_ERR(32, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < __pyx_t_5; __pyx_temp++) { __Pyx_INCREF(__pyx_kp_s_s); __Pyx_GIVEREF(__pyx_kp_s_s); if (__Pyx_PyList_SET_ITEM(__pyx_t_6, __pyx_temp * 2, __pyx_kp_s_s)) __PYX_ERR(32, 190, __pyx_L1_error); __Pyx_INCREF(__pyx_v_sep); __Pyx_GIVEREF(__pyx_v_sep); if (__Pyx_PyList_SET_ITEM(__pyx_t_6, __pyx_temp * 2 + 1, __pyx_v_sep)) __PYX_ERR(32, 190, __pyx_L1_error); } } __pyx_v_format = ((PyObject*)__pyx_t_6); __pyx_t_6 = 0; /* "petsc4py/PETSc/Sys.pyx":191 * if not args: args = ('',) * format = ['%s', sep] * len(args) * format[-1] = end # <<<<<<<<<<<<<< * message = ''.join(format) % args * else: */ if (unlikely((__Pyx_SetItemInt(__pyx_v_format, -1L, __pyx_v_end, long, 1, __Pyx_PyInt_From_long, 1, 1, 1) < 0))) __PYX_ERR(32, 191, __pyx_L1_error) /* "petsc4py/PETSc/Sys.pyx":192 * format = ['%s', sep] * len(args) * format[-1] = end * message = ''.join(format) % args # <<<<<<<<<<<<<< * else: * message = '' */ __pyx_t_6 = __Pyx_PyString_Join(__pyx_kp_s__10, __pyx_v_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(32, 192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PyNumber_Remainder(__pyx_t_6, __pyx_v_args); if (unlikely(!__pyx_t_7)) __PYX_ERR(32, 192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_message = __pyx_t_7; __pyx_t_7 = 0; /* "petsc4py/PETSc/Sys.pyx":188 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * if comm_rank(ccomm) == 0: # <<<<<<<<<<<<<< * if not args: args = ('',) * format = ['%s', sep] * len(args) */ goto __pyx_L3; } /* "petsc4py/PETSc/Sys.pyx":194 * message = ''.join(format) % args * else: * message = '' # <<<<<<<<<<<<<< * cdef const char *m = NULL * message = str2bytes(message, &m) */ /*else*/ { __Pyx_INCREF(__pyx_kp_s__10); __pyx_v_message = __pyx_kp_s__10; } __pyx_L3:; /* "petsc4py/PETSc/Sys.pyx":195 * else: * message = '' * cdef const char *m = NULL # <<<<<<<<<<<<<< * message = str2bytes(message, &m) * CHKERR( PetscPrintf(ccomm, '%s', m) ) */ __pyx_v_m = NULL; /* "petsc4py/PETSc/Sys.pyx":196 * message = '' * cdef const char *m = NULL * message = str2bytes(message, &m) # <<<<<<<<<<<<<< * CHKERR( PetscPrintf(ccomm, '%s', m) ) * */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_message, (&__pyx_v_m)); if (unlikely(!__pyx_t_7)) __PYX_ERR(32, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF_SET(__pyx_v_message, __pyx_t_7); __pyx_t_7 = 0; /* "petsc4py/PETSc/Sys.pyx":197 * cdef const char *m = NULL * message = str2bytes(message, &m) * CHKERR( PetscPrintf(ccomm, '%s', m) ) # <<<<<<<<<<<<<< * * @classmethod */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscPrintf(__pyx_v_ccomm, ((char *)"%s"), __pyx_v_m)); if (unlikely(__pyx_t_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(32, 197, __pyx_L1_error) /* "petsc4py/PETSc/Sys.pyx":156 * # --- xxx --- * * @classmethod # <<<<<<<<<<<<<< * def Print( * cls, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.Sys.Print", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_format); __Pyx_XDECREF(__pyx_v_message); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Sys.pyx":199 * CHKERR( PetscPrintf(ccomm, '%s', m) ) * * @classmethod # <<<<<<<<<<<<<< * def syncPrint( * cls, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_15syncPrint(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Sys_14syncPrint, "Sys.syncPrint(cls, *args: Any, sep: str = ' ', end: str = '\\n', flush: bool = False, comm: Comm | None = None, **kwargs: Any) -> None\nPrint synchronized output from several processors of a communicator.\n\n Not collective.\n\n Parameters\n ----------\n *args\n Positional arguments.\n sep\n String inserted between values, by default a space.\n end\n String appended after the last value, by default a newline.\n flush\n Whether to flush output with `syncFlush`.\n comm\n MPI communicator, defaults to `getDefaultComm`.\n **kwargs\n Keyword arguments.\n\n See Also\n --------\n petsc.PetscSynchronizedPrintf, petsc.PetscSynchronizedFlush\n\n \nSource code at petsc4py/PETSc/Sys.pyx:199"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_15syncPrint(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_sep = 0; PyObject *__pyx_v_end = 0; PyObject *__pyx_v_flush = 0; PyObject *__pyx_v_comm = 0; PyObject *__pyx_v_args = 0; CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("syncPrint (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL; __Pyx_GOTREF(__pyx_v_kwargs); __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sep,&__pyx_n_s_end,&__pyx_n_s_flush,&__pyx_n_s_comm,0}; values[0] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)__pyx_kp_s__16)); values[1] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)__pyx_kp_s__26)); /* "petsc4py/PETSc/Sys.pyx":205 * sep: str = ' ', * end: str = '\n', * flush: bool = False, # <<<<<<<<<<<<<< * comm: Comm | None = None, * **kwargs: Any, */ values[2] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)Py_False)); /* "petsc4py/PETSc/Sys.pyx":206 * end: str = '\n', * flush: bool = False, * comm: Comm | None = None, # <<<<<<<<<<<<<< * **kwargs: Any, * ) -> None: */ values[3] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { default: case 0: break; } kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); if (kw_args > 0 && (kw_args <= 4)) { Py_ssize_t index; for (index = 0; index < 4 && kw_args > 0; index++) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]); if (value) { values[index] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(32, 199, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, __pyx_v_kwargs, values + 0, 0, "syncPrint") < 0)) __PYX_ERR(32, 199, __pyx_L3_error) } } else if (unlikely(__pyx_nargs < 0)) { goto __pyx_L5_argtuple_error; } else { } __pyx_v_sep = values[0]; __pyx_v_end = values[1]; __pyx_v_flush = values[2]; __pyx_v_comm = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("syncPrint", 0, 0, 0, __pyx_nargs); __PYX_ERR(32, 199, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; __Pyx_AddTraceback("petsc4py.PETSc.Sys.syncPrint", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Sys_14syncPrint(((PyTypeObject*)__pyx_v_cls), __pyx_v_sep, __pyx_v_end, __pyx_v_flush, __pyx_v_comm, __pyx_v_args, __pyx_v_kwargs); /* "petsc4py/PETSc/Sys.pyx":199 * CHKERR( PetscPrintf(ccomm, '%s', m) ) * * @classmethod # <<<<<<<<<<<<<< * def syncPrint( * cls, */ /* function exit code */ __Pyx_DECREF(__pyx_v_args); __Pyx_DECREF(__pyx_v_kwargs); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_14syncPrint(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_sep, PyObject *__pyx_v_end, PyObject *__pyx_v_flush, PyObject *__pyx_v_comm, PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs) { MPI_Comm __pyx_v_ccomm; PyObject *__pyx_v_format = NULL; PyObject *__pyx_v_message = NULL; char const *__pyx_v_m; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; int __pyx_t_2; int __pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PetscErrorCode __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("syncPrint", 0); __Pyx_INCREF(__pyx_v_args); /* "petsc4py/PETSc/Sys.pyx":233 * * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * if not args: args = ('',) * format = ['%s', sep] * len(args) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(32, 233, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/Sys.pyx":234 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * if not args: args = ('',) # <<<<<<<<<<<<<< * format = ['%s', sep] * len(args) * format[-1] = end */ __pyx_t_2 = (PyTuple_GET_SIZE(__pyx_v_args) != 0); __pyx_t_3 = (!__pyx_t_2); if (__pyx_t_3) { __Pyx_INCREF(__pyx_tuple__29); __Pyx_DECREF_SET(__pyx_v_args, __pyx_tuple__29); } /* "petsc4py/PETSc/Sys.pyx":235 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * if not args: args = ('',) * format = ['%s', sep] * len(args) # <<<<<<<<<<<<<< * format[-1] = end * message = ''.join(format) % args */ __pyx_t_4 = __Pyx_PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(32, 235, __pyx_L1_error) __pyx_t_5 = PyList_New(2 * ((__pyx_t_4<0) ? 0:__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(32, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < __pyx_t_4; __pyx_temp++) { __Pyx_INCREF(__pyx_kp_s_s); __Pyx_GIVEREF(__pyx_kp_s_s); if (__Pyx_PyList_SET_ITEM(__pyx_t_5, __pyx_temp * 2, __pyx_kp_s_s)) __PYX_ERR(32, 235, __pyx_L1_error); __Pyx_INCREF(__pyx_v_sep); __Pyx_GIVEREF(__pyx_v_sep); if (__Pyx_PyList_SET_ITEM(__pyx_t_5, __pyx_temp * 2 + 1, __pyx_v_sep)) __PYX_ERR(32, 235, __pyx_L1_error); } } __pyx_v_format = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/Sys.pyx":236 * if not args: args = ('',) * format = ['%s', sep] * len(args) * format[-1] = end # <<<<<<<<<<<<<< * message = ''.join(format) % args * cdef const char *m = NULL */ if (unlikely((__Pyx_SetItemInt(__pyx_v_format, -1L, __pyx_v_end, long, 1, __Pyx_PyInt_From_long, 1, 1, 1) < 0))) __PYX_ERR(32, 236, __pyx_L1_error) /* "petsc4py/PETSc/Sys.pyx":237 * format = ['%s', sep] * len(args) * format[-1] = end * message = ''.join(format) % args # <<<<<<<<<<<<<< * cdef const char *m = NULL * message = str2bytes(message, &m) */ __pyx_t_5 = __Pyx_PyString_Join(__pyx_kp_s__10, __pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(32, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyNumber_Remainder(__pyx_t_5, __pyx_v_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(32, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_message = __pyx_t_6; __pyx_t_6 = 0; /* "petsc4py/PETSc/Sys.pyx":238 * format[-1] = end * message = ''.join(format) % args * cdef const char *m = NULL # <<<<<<<<<<<<<< * message = str2bytes(message, &m) * CHKERR( PetscSynchronizedPrintf(ccomm, '%s', m) ) */ __pyx_v_m = NULL; /* "petsc4py/PETSc/Sys.pyx":239 * message = ''.join(format) % args * cdef const char *m = NULL * message = str2bytes(message, &m) # <<<<<<<<<<<<<< * CHKERR( PetscSynchronizedPrintf(ccomm, '%s', m) ) * if flush: CHKERR( PetscSynchronizedFlush(ccomm, PETSC_STDOUT) ) */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_message, (&__pyx_v_m)); if (unlikely(!__pyx_t_6)) __PYX_ERR(32, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF_SET(__pyx_v_message, __pyx_t_6); __pyx_t_6 = 0; /* "petsc4py/PETSc/Sys.pyx":240 * cdef const char *m = NULL * message = str2bytes(message, &m) * CHKERR( PetscSynchronizedPrintf(ccomm, '%s', m) ) # <<<<<<<<<<<<<< * if flush: CHKERR( PetscSynchronizedFlush(ccomm, PETSC_STDOUT) ) * */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSynchronizedPrintf(__pyx_v_ccomm, ((char *)"%s"), __pyx_v_m)); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(32, 240, __pyx_L1_error) /* "petsc4py/PETSc/Sys.pyx":241 * message = str2bytes(message, &m) * CHKERR( PetscSynchronizedPrintf(ccomm, '%s', m) ) * if flush: CHKERR( PetscSynchronizedFlush(ccomm, PETSC_STDOUT) ) # <<<<<<<<<<<<<< * * @classmethod */ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_flush); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(32, 241, __pyx_L1_error) if (__pyx_t_3) { __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSynchronizedFlush(__pyx_v_ccomm, PETSC_STDOUT)); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(32, 241, __pyx_L1_error) } /* "petsc4py/PETSc/Sys.pyx":199 * CHKERR( PetscPrintf(ccomm, '%s', m) ) * * @classmethod # <<<<<<<<<<<<<< * def syncPrint( * cls, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.Sys.syncPrint", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_format); __Pyx_XDECREF(__pyx_v_message); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Sys.pyx":243 * if flush: CHKERR( PetscSynchronizedFlush(ccomm, PETSC_STDOUT) ) * * @classmethod # <<<<<<<<<<<<<< * def syncFlush(cls, comm: Comm | None = None) -> None: * """Flush output from previous `syncPrint` calls. */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_17syncFlush(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Sys_16syncFlush, "Sys.syncFlush(cls, comm: Comm | None = None) -> None\nFlush output from previous `syncPrint` calls.\n\n Collective.\n\n Parameters\n ----------\n comm\n MPI communicator, defaults to `getDefaultComm`.\n\n See Also\n --------\n petsc.PetscSynchronizedPrintf, petsc.PetscSynchronizedFlush\n\n \nSource code at petsc4py/PETSc/Sys.pyx:243"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_17syncFlush(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("syncFlush (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0}; /* "petsc4py/PETSc/Sys.pyx":244 * * @classmethod * def syncFlush(cls, comm: Comm | None = None) -> None: # <<<<<<<<<<<<<< * """Flush output from previous `syncPrint` calls. * */ values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(32, 243, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "syncFlush") < 0)) __PYX_ERR(32, 243, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_comm = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("syncFlush", 0, 0, 1, __pyx_nargs); __PYX_ERR(32, 243, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Sys.syncFlush", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Sys_16syncFlush(((PyTypeObject*)__pyx_v_cls), __pyx_v_comm); /* "petsc4py/PETSc/Sys.pyx":243 * if flush: CHKERR( PetscSynchronizedFlush(ccomm, PETSC_STDOUT) ) * * @classmethod # <<<<<<<<<<<<<< * def syncFlush(cls, comm: Comm | None = None) -> None: * """Flush output from previous `syncPrint` calls. */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_16syncFlush(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("syncFlush", 1); /* "petsc4py/PETSc/Sys.pyx":259 * * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * CHKERR( PetscSynchronizedFlush(ccomm, PETSC_STDOUT) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(32, 259, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/Sys.pyx":260 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * CHKERR( PetscSynchronizedFlush(ccomm, PETSC_STDOUT) ) # <<<<<<<<<<<<<< * * # --- xxx --- */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSynchronizedFlush(__pyx_v_ccomm, PETSC_STDOUT)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(32, 260, __pyx_L1_error) /* "petsc4py/PETSc/Sys.pyx":243 * if flush: CHKERR( PetscSynchronizedFlush(ccomm, PETSC_STDOUT) ) * * @classmethod # <<<<<<<<<<<<<< * def syncFlush(cls, comm: Comm | None = None) -> None: * """Flush output from previous `syncPrint` calls. */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Sys.syncFlush", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Sys.pyx":264 * # --- xxx --- * * @classmethod # <<<<<<<<<<<<<< * def splitOwnership( * cls, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_19splitOwnership(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Sys_18splitOwnership, "Sys.splitOwnership(cls, size: int | tuple[int, int], bsize: int | None = None, comm: Comm | None = None) -> tuple[int, int]\nGiven a global (or local) size determines a local (or global) size.\n\n Collective.\n\n Parameters\n ----------\n size\n Global size ``N`` or 2-tuple ``(n, N)`` with local and global\n sizes. Either of ``n`` or ``N`` (but not both) can be `None`.\n bsize\n Block size, defaults to ``1``.\n comm\n MPI communicator, defaults to `getDefaultComm`.\n\n Returns\n -------\n n : int\n The local size.\n N : int\n The global size.\n\n Notes\n -----\n The ``size`` argument corresponds to the full size of the\n vector. That is, an array with 10 blocks and a block size of 3 will\n have a ``size`` of 30, not 10.\n\n See Also\n --------\n petsc.PetscSplitOwnership\n\n \nSource code at petsc4py/PETSc/Sys.pyx:264"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_19splitOwnership(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_size = 0; PyObject *__pyx_v_bsize = 0; PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("splitOwnership (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_bsize,&__pyx_n_s_comm,0}; /* "petsc4py/PETSc/Sys.pyx":268 * cls, * size: int | tuple[int, int], * bsize: int | None = None, # <<<<<<<<<<<<<< * comm: Comm | None = None * ) -> tuple[int, int]: */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Sys.pyx":269 * size: int | tuple[int, int], * bsize: int | None = None, * comm: Comm | None = None # <<<<<<<<<<<<<< * ) -> tuple[int, int]: * """Given a global (or local) size determines a local (or global) size. */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(32, 264, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_bsize); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(32, 264, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(32, 264, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "splitOwnership") < 0)) __PYX_ERR(32, 264, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_size = values[0]; __pyx_v_bsize = values[1]; __pyx_v_comm = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("splitOwnership", 0, 1, 3, __pyx_nargs); __PYX_ERR(32, 264, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Sys.splitOwnership", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Sys_18splitOwnership(((PyTypeObject*)__pyx_v_cls), __pyx_v_size, __pyx_v_bsize, __pyx_v_comm); /* "petsc4py/PETSc/Sys.pyx":264 * # --- xxx --- * * @classmethod # <<<<<<<<<<<<<< * def splitOwnership( * cls, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_18splitOwnership(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PetscInt __pyx_v_bs; PetscInt __pyx_v_n; PetscInt __pyx_v_N; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("splitOwnership", 1); /* "petsc4py/PETSc/Sys.pyx":303 * * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscInt bs=0, n=0, N=0 * Sys_Sizes(size, bsize, &bs, &n, &N) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(32, 303, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/Sys.pyx":304 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt bs=0, n=0, N=0 # <<<<<<<<<<<<<< * Sys_Sizes(size, bsize, &bs, &n, &N) * if bs == PETSC_DECIDE: bs = 1 */ __pyx_v_bs = 0; __pyx_v_n = 0; __pyx_v_N = 0; /* "petsc4py/PETSc/Sys.pyx":305 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt bs=0, n=0, N=0 * Sys_Sizes(size, bsize, &bs, &n, &N) # <<<<<<<<<<<<<< * if bs == PETSC_DECIDE: bs = 1 * if n > 0: n = n // bs */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_Sys_Sizes(__pyx_v_size, __pyx_v_bsize, (&__pyx_v_bs), (&__pyx_v_n), (&__pyx_v_N)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(32, 305, __pyx_L1_error) /* "petsc4py/PETSc/Sys.pyx":306 * cdef PetscInt bs=0, n=0, N=0 * Sys_Sizes(size, bsize, &bs, &n, &N) * if bs == PETSC_DECIDE: bs = 1 # <<<<<<<<<<<<<< * if n > 0: n = n // bs * if N > 0: N = N // bs */ __pyx_t_3 = (__pyx_v_bs == PETSC_DECIDE); if (__pyx_t_3) { __pyx_v_bs = 1; } /* "petsc4py/PETSc/Sys.pyx":307 * Sys_Sizes(size, bsize, &bs, &n, &N) * if bs == PETSC_DECIDE: bs = 1 * if n > 0: n = n // bs # <<<<<<<<<<<<<< * if N > 0: N = N // bs * CHKERR( PetscSplitOwnership(ccomm, &n, &N) ) */ __pyx_t_3 = (__pyx_v_n > 0); if (__pyx_t_3) { __pyx_v_n = (__pyx_v_n / __pyx_v_bs); } /* "petsc4py/PETSc/Sys.pyx":308 * if bs == PETSC_DECIDE: bs = 1 * if n > 0: n = n // bs * if N > 0: N = N // bs # <<<<<<<<<<<<<< * CHKERR( PetscSplitOwnership(ccomm, &n, &N) ) * n = n * bs */ __pyx_t_3 = (__pyx_v_N > 0); if (__pyx_t_3) { __pyx_v_N = (__pyx_v_N / __pyx_v_bs); } /* "petsc4py/PETSc/Sys.pyx":309 * if n > 0: n = n // bs * if N > 0: N = N // bs * CHKERR( PetscSplitOwnership(ccomm, &n, &N) ) # <<<<<<<<<<<<<< * n = n * bs * N = N * bs */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSplitOwnership(__pyx_v_ccomm, (&__pyx_v_n), (&__pyx_v_N))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(32, 309, __pyx_L1_error) /* "petsc4py/PETSc/Sys.pyx":310 * if N > 0: N = N // bs * CHKERR( PetscSplitOwnership(ccomm, &n, &N) ) * n = n * bs # <<<<<<<<<<<<<< * N = N * bs * return (toInt(n), toInt(N)) */ __pyx_v_n = (__pyx_v_n * __pyx_v_bs); /* "petsc4py/PETSc/Sys.pyx":311 * CHKERR( PetscSplitOwnership(ccomm, &n, &N) ) * n = n * bs * N = N * bs # <<<<<<<<<<<<<< * return (toInt(n), toInt(N)) * */ __pyx_v_N = (__pyx_v_N * __pyx_v_bs); /* "petsc4py/PETSc/Sys.pyx":312 * n = n * bs * N = N * bs * return (toInt(n), toInt(N)) # <<<<<<<<<<<<<< * * @classmethod */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_N); if (unlikely(!__pyx_t_5)) __PYX_ERR(32, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(32, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4)) __PYX_ERR(32, 312, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5)) __PYX_ERR(32, 312, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Sys.pyx":264 * # --- xxx --- * * @classmethod # <<<<<<<<<<<<<< * def splitOwnership( * cls, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.Sys.splitOwnership", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Sys.pyx":314 * return (toInt(n), toInt(N)) * * @classmethod # <<<<<<<<<<<<<< * def sleep(cls, seconds: float = 1.0) -> None: * """Sleep some number of seconds. */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_21sleep(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Sys_20sleep, "Sys.sleep(cls, seconds: float = 1.0) -> None\nSleep some number of seconds.\n\n Not collective.\n\n Parameters\n ----------\n seconds\n Time to sleep in seconds.\n\n See Also\n --------\n petsc.PetscSleep\n\n \nSource code at petsc4py/PETSc/Sys.pyx:314"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_21sleep(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_seconds = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("sleep (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_seconds,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_float_1_0)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_seconds); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(32, 314, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "sleep") < 0)) __PYX_ERR(32, 314, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_seconds = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("sleep", 0, 0, 1, __pyx_nargs); __PYX_ERR(32, 314, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Sys.sleep", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Sys_20sleep(((PyTypeObject*)__pyx_v_cls), __pyx_v_seconds); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_20sleep(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_seconds) { PetscReal __pyx_v_s; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("sleep", 1); /* "petsc4py/PETSc/Sys.pyx":330 * * """ * cdef PetscReal s = asReal(seconds) # <<<<<<<<<<<<<< * CHKERR( PetscSleep(s) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_seconds); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(32, 330, __pyx_L1_error) __pyx_v_s = __pyx_t_1; /* "petsc4py/PETSc/Sys.pyx":331 * """ * cdef PetscReal s = asReal(seconds) * CHKERR( PetscSleep(s) ) # <<<<<<<<<<<<<< * * # --- xxx --- */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSleep(__pyx_v_s)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(32, 331, __pyx_L1_error) /* "petsc4py/PETSc/Sys.pyx":314 * return (toInt(n), toInt(N)) * * @classmethod # <<<<<<<<<<<<<< * def sleep(cls, seconds: float = 1.0) -> None: * """Sleep some number of seconds. */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Sys.sleep", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Sys.pyx":335 * # --- xxx --- * * @classmethod # <<<<<<<<<<<<<< * def pushErrorHandler(cls, errhandler: str) -> None: * """Set the current error handler. */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_23pushErrorHandler(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Sys_22pushErrorHandler, "Sys.pushErrorHandler(cls, errhandler: str) -> None\nSet the current error handler.\n\n Logically collective.\n\n Parameters\n ----------\n errhandler\n The name of the error handler.\n\n See Also\n --------\n petsc.PetscPushErrorHandler\n\n \nSource code at petsc4py/PETSc/Sys.pyx:335"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_23pushErrorHandler(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_errhandler = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pushErrorHandler (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_errhandler,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_errhandler)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(32, 335, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "pushErrorHandler") < 0)) __PYX_ERR(32, 335, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_errhandler = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("pushErrorHandler", 1, 1, 1, __pyx_nargs); __PYX_ERR(32, 335, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Sys.pushErrorHandler", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Sys_22pushErrorHandler(((PyTypeObject*)__pyx_v_cls), __pyx_v_errhandler); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_22pushErrorHandler(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_errhandler) { PetscErrorHandlerFunction __pyx_v_handler; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pushErrorHandler", 1); /* "petsc4py/PETSc/Sys.pyx":351 * * """ * cdef PetscErrorHandlerFunction handler = NULL # <<<<<<<<<<<<<< * if errhandler == "python": * handler = PetscPythonErrorHandler */ __pyx_v_handler = NULL; /* "petsc4py/PETSc/Sys.pyx":352 * """ * cdef PetscErrorHandlerFunction handler = NULL * if errhandler == "python": # <<<<<<<<<<<<<< * handler = PetscPythonErrorHandler * elif errhandler == "debugger": */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_errhandler, __pyx_n_s_python, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(32, 352, __pyx_L1_error) if (__pyx_t_1) { /* "petsc4py/PETSc/Sys.pyx":353 * cdef PetscErrorHandlerFunction handler = NULL * if errhandler == "python": * handler = PetscPythonErrorHandler # <<<<<<<<<<<<<< * elif errhandler == "debugger": * handler = PetscAttachDebuggerErrorHandler */ __pyx_v_handler = ((PetscErrorHandlerFunction)__pyx_f_8petsc4py_5PETSc_PetscPythonErrorHandler); /* "petsc4py/PETSc/Sys.pyx":352 * """ * cdef PetscErrorHandlerFunction handler = NULL * if errhandler == "python": # <<<<<<<<<<<<<< * handler = PetscPythonErrorHandler * elif errhandler == "debugger": */ goto __pyx_L3; } /* "petsc4py/PETSc/Sys.pyx":354 * if errhandler == "python": * handler = PetscPythonErrorHandler * elif errhandler == "debugger": # <<<<<<<<<<<<<< * handler = PetscAttachDebuggerErrorHandler * elif errhandler == "emacs": */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_errhandler, __pyx_n_s_debugger, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(32, 354, __pyx_L1_error) if (__pyx_t_1) { /* "petsc4py/PETSc/Sys.pyx":355 * handler = PetscPythonErrorHandler * elif errhandler == "debugger": * handler = PetscAttachDebuggerErrorHandler # <<<<<<<<<<<<<< * elif errhandler == "emacs": * handler = PetscEmacsClientErrorHandler */ __pyx_v_handler = PetscAttachDebuggerErrorHandler; /* "petsc4py/PETSc/Sys.pyx":354 * if errhandler == "python": * handler = PetscPythonErrorHandler * elif errhandler == "debugger": # <<<<<<<<<<<<<< * handler = PetscAttachDebuggerErrorHandler * elif errhandler == "emacs": */ goto __pyx_L3; } /* "petsc4py/PETSc/Sys.pyx":356 * elif errhandler == "debugger": * handler = PetscAttachDebuggerErrorHandler * elif errhandler == "emacs": # <<<<<<<<<<<<<< * handler = PetscEmacsClientErrorHandler * elif errhandler == "traceback": */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_errhandler, __pyx_n_s_emacs, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(32, 356, __pyx_L1_error) if (__pyx_t_1) { /* "petsc4py/PETSc/Sys.pyx":357 * handler = PetscAttachDebuggerErrorHandler * elif errhandler == "emacs": * handler = PetscEmacsClientErrorHandler # <<<<<<<<<<<<<< * elif errhandler == "traceback": * handler = PetscTraceBackErrorHandler */ __pyx_v_handler = PetscEmacsClientErrorHandler; /* "petsc4py/PETSc/Sys.pyx":356 * elif errhandler == "debugger": * handler = PetscAttachDebuggerErrorHandler * elif errhandler == "emacs": # <<<<<<<<<<<<<< * handler = PetscEmacsClientErrorHandler * elif errhandler == "traceback": */ goto __pyx_L3; } /* "petsc4py/PETSc/Sys.pyx":358 * elif errhandler == "emacs": * handler = PetscEmacsClientErrorHandler * elif errhandler == "traceback": # <<<<<<<<<<<<<< * handler = PetscTraceBackErrorHandler * elif errhandler == "ignore": */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_errhandler, __pyx_n_s_traceback_2, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(32, 358, __pyx_L1_error) if (__pyx_t_1) { /* "petsc4py/PETSc/Sys.pyx":359 * handler = PetscEmacsClientErrorHandler * elif errhandler == "traceback": * handler = PetscTraceBackErrorHandler # <<<<<<<<<<<<<< * elif errhandler == "ignore": * handler = PetscIgnoreErrorHandler */ __pyx_v_handler = PetscTraceBackErrorHandler; /* "petsc4py/PETSc/Sys.pyx":358 * elif errhandler == "emacs": * handler = PetscEmacsClientErrorHandler * elif errhandler == "traceback": # <<<<<<<<<<<<<< * handler = PetscTraceBackErrorHandler * elif errhandler == "ignore": */ goto __pyx_L3; } /* "petsc4py/PETSc/Sys.pyx":360 * elif errhandler == "traceback": * handler = PetscTraceBackErrorHandler * elif errhandler == "ignore": # <<<<<<<<<<<<<< * handler = PetscIgnoreErrorHandler * elif errhandler == "mpiabort": */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_errhandler, __pyx_n_s_ignore, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(32, 360, __pyx_L1_error) if (__pyx_t_1) { /* "petsc4py/PETSc/Sys.pyx":361 * handler = PetscTraceBackErrorHandler * elif errhandler == "ignore": * handler = PetscIgnoreErrorHandler # <<<<<<<<<<<<<< * elif errhandler == "mpiabort": * handler = PetscMPIAbortErrorHandler */ __pyx_v_handler = PetscIgnoreErrorHandler; /* "petsc4py/PETSc/Sys.pyx":360 * elif errhandler == "traceback": * handler = PetscTraceBackErrorHandler * elif errhandler == "ignore": # <<<<<<<<<<<<<< * handler = PetscIgnoreErrorHandler * elif errhandler == "mpiabort": */ goto __pyx_L3; } /* "petsc4py/PETSc/Sys.pyx":362 * elif errhandler == "ignore": * handler = PetscIgnoreErrorHandler * elif errhandler == "mpiabort": # <<<<<<<<<<<<<< * handler = PetscMPIAbortErrorHandler * elif errhandler == "abort": */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_errhandler, __pyx_n_s_mpiabort, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(32, 362, __pyx_L1_error) if (__pyx_t_1) { /* "petsc4py/PETSc/Sys.pyx":363 * handler = PetscIgnoreErrorHandler * elif errhandler == "mpiabort": * handler = PetscMPIAbortErrorHandler # <<<<<<<<<<<<<< * elif errhandler == "abort": * handler = PetscAbortErrorHandler */ __pyx_v_handler = PetscMPIAbortErrorHandler; /* "petsc4py/PETSc/Sys.pyx":362 * elif errhandler == "ignore": * handler = PetscIgnoreErrorHandler * elif errhandler == "mpiabort": # <<<<<<<<<<<<<< * handler = PetscMPIAbortErrorHandler * elif errhandler == "abort": */ goto __pyx_L3; } /* "petsc4py/PETSc/Sys.pyx":364 * elif errhandler == "mpiabort": * handler = PetscMPIAbortErrorHandler * elif errhandler == "abort": # <<<<<<<<<<<<<< * handler = PetscAbortErrorHandler * else: */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_errhandler, __pyx_n_s_abort, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(32, 364, __pyx_L1_error) if (likely(__pyx_t_1)) { /* "petsc4py/PETSc/Sys.pyx":365 * handler = PetscMPIAbortErrorHandler * elif errhandler == "abort": * handler = PetscAbortErrorHandler # <<<<<<<<<<<<<< * else: * raise ValueError(f"unknown error handler: {errhandler!r}") */ __pyx_v_handler = PetscAbortErrorHandler; /* "petsc4py/PETSc/Sys.pyx":364 * elif errhandler == "mpiabort": * handler = PetscMPIAbortErrorHandler * elif errhandler == "abort": # <<<<<<<<<<<<<< * handler = PetscAbortErrorHandler * else: */ goto __pyx_L3; } /* "petsc4py/PETSc/Sys.pyx":367 * handler = PetscAbortErrorHandler * else: * raise ValueError(f"unknown error handler: {errhandler!r}") # <<<<<<<<<<<<<< * CHKERR( PetscPushErrorHandler(handler, NULL) ) * */ /*else*/ { __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_errhandler), __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(32, 367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u_unknown_error_handler, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(32, 367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(32, 367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(32, 367, __pyx_L1_error) } __pyx_L3:; /* "petsc4py/PETSc/Sys.pyx":368 * else: * raise ValueError(f"unknown error handler: {errhandler!r}") * CHKERR( PetscPushErrorHandler(handler, NULL) ) # <<<<<<<<<<<<<< * * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscPushErrorHandler(__pyx_v_handler, NULL)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(32, 368, __pyx_L1_error) /* "petsc4py/PETSc/Sys.pyx":335 * # --- xxx --- * * @classmethod # <<<<<<<<<<<<<< * def pushErrorHandler(cls, errhandler: str) -> None: * """Set the current error handler. */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Sys.pushErrorHandler", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Sys.pyx":371 * * * @classmethod # <<<<<<<<<<<<<< * def popErrorHandler(cls) -> None: * """Remove the current error handler. */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_25popErrorHandler(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Sys_24popErrorHandler, "Sys.popErrorHandler(cls) -> None\nRemove the current error handler.\n\n Logically collective.\n\n See Also\n --------\n petsc.PetscPopErrorHandler\n\n \nSource code at petsc4py/PETSc/Sys.pyx:371"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_25popErrorHandler(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("popErrorHandler (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("popErrorHandler", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "popErrorHandler", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Sys_24popErrorHandler(((PyTypeObject*)__pyx_v_cls)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_24popErrorHandler(CYTHON_UNUSED PyTypeObject *__pyx_v_cls) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("popErrorHandler", 1); /* "petsc4py/PETSc/Sys.pyx":382 * * """ * CHKERR( PetscPopErrorHandler() ) # <<<<<<<<<<<<<< * * @classmethod */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscPopErrorHandler()); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(32, 382, __pyx_L1_error) /* "petsc4py/PETSc/Sys.pyx":371 * * * @classmethod # <<<<<<<<<<<<<< * def popErrorHandler(cls) -> None: * """Remove the current error handler. */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Sys.popErrorHandler", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Sys.pyx":384 * CHKERR( PetscPopErrorHandler() ) * * @classmethod # <<<<<<<<<<<<<< * def popSignalHandler(cls) -> None: * """Remove the current signal handler. */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_27popSignalHandler(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Sys_26popSignalHandler, "Sys.popSignalHandler(cls) -> None\nRemove the current signal handler.\n\n Logically collective.\n\n See Also\n --------\n petsc.PetscPopSignalHandler\n\n \nSource code at petsc4py/PETSc/Sys.pyx:384"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_27popSignalHandler(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("popSignalHandler (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("popSignalHandler", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "popSignalHandler", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Sys_26popSignalHandler(((PyTypeObject*)__pyx_v_cls)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_26popSignalHandler(CYTHON_UNUSED PyTypeObject *__pyx_v_cls) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("popSignalHandler", 1); /* "petsc4py/PETSc/Sys.pyx":395 * * """ * CHKERR( PetscPopSignalHandler() ) # <<<<<<<<<<<<<< * * @classmethod */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscPopSignalHandler()); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(32, 395, __pyx_L1_error) /* "petsc4py/PETSc/Sys.pyx":384 * CHKERR( PetscPopErrorHandler() ) * * @classmethod # <<<<<<<<<<<<<< * def popSignalHandler(cls) -> None: * """Remove the current signal handler. */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Sys.popSignalHandler", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Sys.pyx":397 * CHKERR( PetscPopSignalHandler() ) * * @classmethod # <<<<<<<<<<<<<< * def infoAllow( * cls, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_29infoAllow(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Sys_28infoAllow, "Sys.infoAllow(cls, flag: bool, filename: str | None = None, mode: str = 'w') -> None\nEnables or disables PETSc info messages.\n\n Not collective.\n\n Parameters\n ----------\n flag\n Whether to enable info messages.\n filename\n Name of a file where to dump output.\n mode\n Write mode for file, by default ``\"w\"``.\n\n See Also\n --------\n petsc.PetscInfoAllow, petsc.PetscInfoSetFile\n\n \nSource code at petsc4py/PETSc/Sys.pyx:397"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_29infoAllow(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_flag = 0; PyObject *__pyx_v_filename = 0; PyObject *__pyx_v_mode = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("infoAllow (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,&__pyx_n_s_filename,&__pyx_n_s_mode,0}; /* "petsc4py/PETSc/Sys.pyx":401 * cls, * flag: bool, * filename: str | None = None, # <<<<<<<<<<<<<< * mode: str = "w", * ) -> None: */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_n_s_w)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flag)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(32, 397, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_filename); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(32, 397, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mode); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(32, 397, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "infoAllow") < 0)) __PYX_ERR(32, 397, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_flag = values[0]; __pyx_v_filename = values[1]; __pyx_v_mode = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("infoAllow", 0, 1, 3, __pyx_nargs); __PYX_ERR(32, 397, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Sys.infoAllow", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Sys_28infoAllow(((PyTypeObject*)__pyx_v_cls), __pyx_v_flag, __pyx_v_filename, __pyx_v_mode); /* "petsc4py/PETSc/Sys.pyx":397 * CHKERR( PetscPopSignalHandler() ) * * @classmethod # <<<<<<<<<<<<<< * def infoAllow( * cls, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_28infoAllow(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_flag, PyObject *__pyx_v_filename, PyObject *__pyx_v_mode) { PetscBool __pyx_v_tval; char const *__pyx_v_cfilename; char const *__pyx_v_cmode; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("infoAllow", 0); __Pyx_INCREF(__pyx_v_filename); __Pyx_INCREF(__pyx_v_mode); /* "petsc4py/PETSc/Sys.pyx":422 * * """ * cdef PetscBool tval = PETSC_FALSE # <<<<<<<<<<<<<< * cdef const char *cfilename = NULL * cdef const char *cmode = NULL */ __pyx_v_tval = PETSC_FALSE; /* "petsc4py/PETSc/Sys.pyx":423 * """ * cdef PetscBool tval = PETSC_FALSE * cdef const char *cfilename = NULL # <<<<<<<<<<<<<< * cdef const char *cmode = NULL * if flag: tval = PETSC_TRUE */ __pyx_v_cfilename = NULL; /* "petsc4py/PETSc/Sys.pyx":424 * cdef PetscBool tval = PETSC_FALSE * cdef const char *cfilename = NULL * cdef const char *cmode = NULL # <<<<<<<<<<<<<< * if flag: tval = PETSC_TRUE * CHKERR( PetscInfoAllow(tval) ) */ __pyx_v_cmode = NULL; /* "petsc4py/PETSc/Sys.pyx":425 * cdef const char *cfilename = NULL * cdef const char *cmode = NULL * if flag: tval = PETSC_TRUE # <<<<<<<<<<<<<< * CHKERR( PetscInfoAllow(tval) ) * if filename is not None: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_flag); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(32, 425, __pyx_L1_error) if (__pyx_t_1) { __pyx_v_tval = PETSC_TRUE; } /* "petsc4py/PETSc/Sys.pyx":426 * cdef const char *cmode = NULL * if flag: tval = PETSC_TRUE * CHKERR( PetscInfoAllow(tval) ) # <<<<<<<<<<<<<< * if filename is not None: * filename = str2bytes(filename, &cfilename) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscInfoAllow(__pyx_v_tval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(32, 426, __pyx_L1_error) /* "petsc4py/PETSc/Sys.pyx":427 * if flag: tval = PETSC_TRUE * CHKERR( PetscInfoAllow(tval) ) * if filename is not None: # <<<<<<<<<<<<<< * filename = str2bytes(filename, &cfilename) * mode = str2bytes(mode, &cmode) */ __pyx_t_1 = (__pyx_v_filename != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/Sys.pyx":428 * CHKERR( PetscInfoAllow(tval) ) * if filename is not None: * filename = str2bytes(filename, &cfilename) # <<<<<<<<<<<<<< * mode = str2bytes(mode, &cmode) * CHKERR( PetscInfoSetFile(cfilename, cmode) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_filename, (&__pyx_v_cfilename)); if (unlikely(!__pyx_t_3)) __PYX_ERR(32, 428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_filename, __pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/Sys.pyx":429 * if filename is not None: * filename = str2bytes(filename, &cfilename) * mode = str2bytes(mode, &cmode) # <<<<<<<<<<<<<< * CHKERR( PetscInfoSetFile(cfilename, cmode) ) * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_mode, (&__pyx_v_cmode)); if (unlikely(!__pyx_t_3)) __PYX_ERR(32, 429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_mode, __pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/Sys.pyx":430 * filename = str2bytes(filename, &cfilename) * mode = str2bytes(mode, &cmode) * CHKERR( PetscInfoSetFile(cfilename, cmode) ) # <<<<<<<<<<<<<< * * @classmethod */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscInfoSetFile(__pyx_v_cfilename, __pyx_v_cmode)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(32, 430, __pyx_L1_error) /* "petsc4py/PETSc/Sys.pyx":427 * if flag: tval = PETSC_TRUE * CHKERR( PetscInfoAllow(tval) ) * if filename is not None: # <<<<<<<<<<<<<< * filename = str2bytes(filename, &cfilename) * mode = str2bytes(mode, &cmode) */ } /* "petsc4py/PETSc/Sys.pyx":397 * CHKERR( PetscPopSignalHandler() ) * * @classmethod # <<<<<<<<<<<<<< * def infoAllow( * cls, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Sys.infoAllow", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_filename); __Pyx_XDECREF(__pyx_v_mode); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Sys.pyx":432 * CHKERR( PetscInfoSetFile(cfilename, cmode) ) * * @classmethod # <<<<<<<<<<<<<< * def registerCitation(cls, citation: str) -> None: * """Register BibTeX citation. */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_31registerCitation(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Sys_30registerCitation, "Sys.registerCitation(cls, citation: str) -> None\nRegister BibTeX citation.\n\n Not collective.\n\n Parameters\n ----------\n citation\n The BibTex citation entry to register.\n\n See Also\n --------\n petsc.PetscCitationsRegister\n\n \nSource code at petsc4py/PETSc/Sys.pyx:432"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_31registerCitation(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_citation = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("registerCitation (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_citation,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_citation)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(32, 432, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "registerCitation") < 0)) __PYX_ERR(32, 432, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_citation = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("registerCitation", 1, 1, 1, __pyx_nargs); __PYX_ERR(32, 432, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Sys.registerCitation", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Sys_30registerCitation(((PyTypeObject*)__pyx_v_cls), __pyx_v_citation); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_30registerCitation(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_citation) { char const *__pyx_v_cit; PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PetscBool __pyx_t_4; PetscErrorCode __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("registerCitation", 0); __Pyx_INCREF(__pyx_v_citation); /* "petsc4py/PETSc/Sys.pyx":448 * * """ * if not citation: raise ValueError("empty citation") # <<<<<<<<<<<<<< * cdef const char *cit = NULL * citation = str2bytes(citation, &cit) */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_citation); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(32, 448, __pyx_L1_error) __pyx_t_2 = (!__pyx_t_1); if (unlikely(__pyx_t_2)) { __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(32, 448, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(32, 448, __pyx_L1_error) } /* "petsc4py/PETSc/Sys.pyx":449 * """ * if not citation: raise ValueError("empty citation") * cdef const char *cit = NULL # <<<<<<<<<<<<<< * citation = str2bytes(citation, &cit) * cdef PetscBool flag = get_citation(citation) */ __pyx_v_cit = NULL; /* "petsc4py/PETSc/Sys.pyx":450 * if not citation: raise ValueError("empty citation") * cdef const char *cit = NULL * citation = str2bytes(citation, &cit) # <<<<<<<<<<<<<< * cdef PetscBool flag = get_citation(citation) * CHKERR( PetscCitationsRegister(cit, &flag) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_citation, (&__pyx_v_cit)); if (unlikely(!__pyx_t_3)) __PYX_ERR(32, 450, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_citation, __pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/Sys.pyx":451 * cdef const char *cit = NULL * citation = str2bytes(citation, &cit) * cdef PetscBool flag = get_citation(citation) # <<<<<<<<<<<<<< * CHKERR( PetscCitationsRegister(cit, &flag) ) * set_citation(citation, toBool(flag)) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_get_citation(__pyx_v_citation); if (unlikely(PyErr_Occurred())) __PYX_ERR(32, 451, __pyx_L1_error) __pyx_v_flag = __pyx_t_4; /* "petsc4py/PETSc/Sys.pyx":452 * citation = str2bytes(citation, &cit) * cdef PetscBool flag = get_citation(citation) * CHKERR( PetscCitationsRegister(cit, &flag) ) # <<<<<<<<<<<<<< * set_citation(citation, toBool(flag)) * */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscCitationsRegister(__pyx_v_cit, (&__pyx_v_flag))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(32, 452, __pyx_L1_error) /* "petsc4py/PETSc/Sys.pyx":453 * cdef PetscBool flag = get_citation(citation) * CHKERR( PetscCitationsRegister(cit, &flag) ) * set_citation(citation, toBool(flag)) # <<<<<<<<<<<<<< * * @classmethod */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_3)) __PYX_ERR(32, 453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(32, 453, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_set_citation(__pyx_v_citation, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(32, 453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/Sys.pyx":432 * CHKERR( PetscInfoSetFile(cfilename, cmode) ) * * @classmethod # <<<<<<<<<<<<<< * def registerCitation(cls, citation: str) -> None: * """Register BibTeX citation. */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Sys.registerCitation", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_citation); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Sys.pyx":455 * set_citation(citation, toBool(flag)) * * @classmethod # <<<<<<<<<<<<<< * def hasExternalPackage(cls, package: str) -> bool: * """Return whether PETSc has support for external package. */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_33hasExternalPackage(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Sys_32hasExternalPackage, "Sys.hasExternalPackage(cls, package: str) -> bool\nReturn whether PETSc has support for external package.\n\n Not collective.\n\n Parameters\n ----------\n package\n The external package name.\n\n See Also\n --------\n petsc.PetscHasExternalPackage\n\n \nSource code at petsc4py/PETSc/Sys.pyx:455"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_33hasExternalPackage(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_package = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("hasExternalPackage (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_package,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_package)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(32, 455, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "hasExternalPackage") < 0)) __PYX_ERR(32, 455, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_package = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("hasExternalPackage", 1, 1, 1, __pyx_nargs); __PYX_ERR(32, 455, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Sys.hasExternalPackage", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Sys_32hasExternalPackage(((PyTypeObject*)__pyx_v_cls), __pyx_v_package); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_32hasExternalPackage(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_package) { char const *__pyx_v_cpackage; PetscBool __pyx_v_has; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("hasExternalPackage", 0); __Pyx_INCREF(__pyx_v_package); /* "petsc4py/PETSc/Sys.pyx":471 * * """ * cdef const char *cpackage = NULL # <<<<<<<<<<<<<< * package = str2bytes(package, &cpackage) * cdef PetscBool has = PETSC_FALSE */ __pyx_v_cpackage = NULL; /* "petsc4py/PETSc/Sys.pyx":472 * """ * cdef const char *cpackage = NULL * package = str2bytes(package, &cpackage) # <<<<<<<<<<<<<< * cdef PetscBool has = PETSC_FALSE * CHKERR( PetscHasExternalPackage(cpackage, &has) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_package, (&__pyx_v_cpackage)); if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 472, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_package, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Sys.pyx":473 * cdef const char *cpackage = NULL * package = str2bytes(package, &cpackage) * cdef PetscBool has = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( PetscHasExternalPackage(cpackage, &has) ) * return toBool(has) */ __pyx_v_has = PETSC_FALSE; /* "petsc4py/PETSc/Sys.pyx":474 * package = str2bytes(package, &cpackage) * cdef PetscBool has = PETSC_FALSE * CHKERR( PetscHasExternalPackage(cpackage, &has) ) # <<<<<<<<<<<<<< * return toBool(has) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscHasExternalPackage(__pyx_v_cpackage, (&__pyx_v_has))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(32, 474, __pyx_L1_error) /* "petsc4py/PETSc/Sys.pyx":475 * cdef PetscBool has = PETSC_FALSE * CHKERR( PetscHasExternalPackage(cpackage, &has) ) * return toBool(has) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_has); if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Sys.pyx":455 * set_citation(citation, toBool(flag)) * * @classmethod # <<<<<<<<<<<<<< * def hasExternalPackage(cls, package: str) -> bool: * """Return whether PETSc has support for external package. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Sys.hasExternalPackage", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_package); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Sys.pyx":480 * cdef dict citations_registry = { } * * cdef PetscBool get_citation(object citation): # <<<<<<<<<<<<<< * cdef bint is_set = citations_registry.get(citation) * return PETSC_TRUE if is_set else PETSC_FALSE */ static PetscBool __pyx_f_8petsc4py_5PETSc_get_citation(PyObject *__pyx_v_citation) { int __pyx_v_is_set; PetscBool __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PetscBool __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_citation", 1); /* "petsc4py/PETSc/Sys.pyx":481 * * cdef PetscBool get_citation(object citation): * cdef bint is_set = citations_registry.get(citation) # <<<<<<<<<<<<<< * return PETSC_TRUE if is_set else PETSC_FALSE * */ if (unlikely(__pyx_v_8petsc4py_5PETSc_citations_registry == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(32, 481, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_8petsc4py_5PETSc_citations_registry, __pyx_v_citation, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 481, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(32, 481, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_is_set = __pyx_t_2; /* "petsc4py/PETSc/Sys.pyx":482 * cdef PetscBool get_citation(object citation): * cdef bint is_set = citations_registry.get(citation) * return PETSC_TRUE if is_set else PETSC_FALSE # <<<<<<<<<<<<<< * * cdef set_citation(object citation, bint is_set): */ if (__pyx_v_is_set) { __pyx_t_3 = PETSC_TRUE; } else { __pyx_t_3 = PETSC_FALSE; } __pyx_r = __pyx_t_3; goto __pyx_L0; /* "petsc4py/PETSc/Sys.pyx":480 * cdef dict citations_registry = { } * * cdef PetscBool get_citation(object citation): # <<<<<<<<<<<<<< * cdef bint is_set = citations_registry.get(citation) * return PETSC_TRUE if is_set else PETSC_FALSE */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.get_citation", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = (PetscBool) 0; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Sys.pyx":484 * return PETSC_TRUE if is_set else PETSC_FALSE * * cdef set_citation(object citation, bint is_set): # <<<<<<<<<<<<<< * citations_registry[citation] = is_set * */ static PyObject *__pyx_f_8petsc4py_5PETSc_set_citation(PyObject *__pyx_v_citation, int __pyx_v_is_set) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_citation", 1); /* "petsc4py/PETSc/Sys.pyx":485 * * cdef set_citation(object citation, bint is_set): * citations_registry[citation] = is_set # <<<<<<<<<<<<<< * * # ------------------------------------------------------------------------------ */ __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_is_set); if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(__pyx_v_8petsc4py_5PETSc_citations_registry == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(32, 485, __pyx_L1_error) } if (unlikely((PyDict_SetItem(__pyx_v_8petsc4py_5PETSc_citations_registry, __pyx_v_citation, __pyx_t_1) < 0))) __PYX_ERR(32, 485, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Sys.pyx":484 * return PETSC_TRUE if is_set else PETSC_FALSE * * cdef set_citation(object citation, bint is_set): # <<<<<<<<<<<<<< * citations_registry[citation] = is_set * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.set_citation", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":11 * """Logging support.""" * * @classmethod # <<<<<<<<<<<<<< * def Stage(cls, name): * if not name: raise ValueError("empty name") */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_1Stage(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Log_Stage, "Log.Stage(cls, name)\nSource code at petsc4py/PETSc/Log.pyx:11"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_1Stage(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_name = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("Stage (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(33, 11, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "Stage") < 0)) __PYX_ERR(33, 11, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_name = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("Stage", 1, 1, 1, __pyx_nargs); __PYX_ERR(33, 11, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Log.Stage", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Log_Stage(((PyTypeObject*)__pyx_v_cls), __pyx_v_name); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_Stage(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_name) { char const *__pyx_v_cname; PetscLogStage __pyx_v_stageid; struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_stage = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("Stage", 0); __Pyx_INCREF(__pyx_v_name); /* "petsc4py/PETSc/Log.pyx":13 * @classmethod * def Stage(cls, name): * if not name: raise ValueError("empty name") # <<<<<<<<<<<<<< * cdef const char *cname = NULL * name = str2bytes(name, &cname) */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_name); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(33, 13, __pyx_L1_error) __pyx_t_2 = (!__pyx_t_1); if (unlikely(__pyx_t_2)) { __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(33, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(33, 13, __pyx_L1_error) } /* "petsc4py/PETSc/Log.pyx":14 * def Stage(cls, name): * if not name: raise ValueError("empty name") * cdef const char *cname = NULL # <<<<<<<<<<<<<< * name = str2bytes(name, &cname) * cdef PetscLogStage stageid = -1 */ __pyx_v_cname = NULL; /* "petsc4py/PETSc/Log.pyx":15 * if not name: raise ValueError("empty name") * cdef const char *cname = NULL * name = str2bytes(name, &cname) # <<<<<<<<<<<<<< * cdef PetscLogStage stageid = -1 * cdef LogStage stage = get_LogStage(name) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cname)); if (unlikely(!__pyx_t_3)) __PYX_ERR(33, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/Log.pyx":16 * cdef const char *cname = NULL * name = str2bytes(name, &cname) * cdef PetscLogStage stageid = -1 # <<<<<<<<<<<<<< * cdef LogStage stage = get_LogStage(name) * if stage is not None: return stage */ __pyx_v_stageid = -1; /* "petsc4py/PETSc/Log.pyx":17 * name = str2bytes(name, &cname) * cdef PetscLogStage stageid = -1 * cdef LogStage stage = get_LogStage(name) # <<<<<<<<<<<<<< * if stage is not None: return stage * CHKERR( PetscLogStageFindId(cname, &stageid) ) */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_get_LogStage(__pyx_v_name)); if (unlikely(!__pyx_t_3)) __PYX_ERR(33, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_stage = ((struct __pyx_obj_8petsc4py_5PETSc_LogStage *)__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/Log.pyx":18 * cdef PetscLogStage stageid = -1 * cdef LogStage stage = get_LogStage(name) * if stage is not None: return stage # <<<<<<<<<<<<<< * CHKERR( PetscLogStageFindId(cname, &stageid) ) * if stageid == -1: */ __pyx_t_2 = (((PyObject *)__pyx_v_stage) != Py_None); if (__pyx_t_2) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_stage); __pyx_r = ((PyObject *)__pyx_v_stage); goto __pyx_L0; } /* "petsc4py/PETSc/Log.pyx":19 * cdef LogStage stage = get_LogStage(name) * if stage is not None: return stage * CHKERR( PetscLogStageFindId(cname, &stageid) ) # <<<<<<<<<<<<<< * if stageid == -1: * CHKERR( PetscLogStageRegister(cname, &stageid) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogStageFindId(__pyx_v_cname, (&__pyx_v_stageid))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(33, 19, __pyx_L1_error) /* "petsc4py/PETSc/Log.pyx":20 * if stage is not None: return stage * CHKERR( PetscLogStageFindId(cname, &stageid) ) * if stageid == -1: # <<<<<<<<<<<<<< * CHKERR( PetscLogStageRegister(cname, &stageid) ) * stage = reg_LogStage(name, stageid) */ __pyx_t_2 = (__pyx_v_stageid == -1L); if (__pyx_t_2) { /* "petsc4py/PETSc/Log.pyx":21 * CHKERR( PetscLogStageFindId(cname, &stageid) ) * if stageid == -1: * CHKERR( PetscLogStageRegister(cname, &stageid) ) # <<<<<<<<<<<<<< * stage = reg_LogStage(name, stageid) * return stage */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogStageRegister(__pyx_v_cname, (&__pyx_v_stageid))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(33, 21, __pyx_L1_error) /* "petsc4py/PETSc/Log.pyx":20 * if stage is not None: return stage * CHKERR( PetscLogStageFindId(cname, &stageid) ) * if stageid == -1: # <<<<<<<<<<<<<< * CHKERR( PetscLogStageRegister(cname, &stageid) ) * stage = reg_LogStage(name, stageid) */ } /* "petsc4py/PETSc/Log.pyx":22 * if stageid == -1: * CHKERR( PetscLogStageRegister(cname, &stageid) ) * stage = reg_LogStage(name, stageid) # <<<<<<<<<<<<<< * return stage * */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_reg_LogStage(__pyx_v_name, __pyx_v_stageid)); if (unlikely(!__pyx_t_3)) __PYX_ERR(33, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_stage, ((struct __pyx_obj_8petsc4py_5PETSc_LogStage *)__pyx_t_3)); __pyx_t_3 = 0; /* "petsc4py/PETSc/Log.pyx":23 * CHKERR( PetscLogStageRegister(cname, &stageid) ) * stage = reg_LogStage(name, stageid) * return stage # <<<<<<<<<<<<<< * * @classmethod */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_stage); __pyx_r = ((PyObject *)__pyx_v_stage); goto __pyx_L0; /* "petsc4py/PETSc/Log.pyx":11 * """Logging support.""" * * @classmethod # <<<<<<<<<<<<<< * def Stage(cls, name): * if not name: raise ValueError("empty name") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Log.Stage", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_stage); __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":25 * return stage * * @classmethod # <<<<<<<<<<<<<< * def Class(cls, name): * if not name: raise ValueError("empty name") */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_3Class(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Log_2Class, "Log.Class(cls, name)\nSource code at petsc4py/PETSc/Log.pyx:25"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_3Class(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_name = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("Class (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(33, 25, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "Class") < 0)) __PYX_ERR(33, 25, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_name = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("Class", 1, 1, 1, __pyx_nargs); __PYX_ERR(33, 25, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Log.Class", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Log_2Class(((PyTypeObject*)__pyx_v_cls), __pyx_v_name); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_2Class(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_name) { char const *__pyx_v_cname; PetscClassId __pyx_v_classid; struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_klass = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("Class", 0); __Pyx_INCREF(__pyx_v_name); /* "petsc4py/PETSc/Log.pyx":27 * @classmethod * def Class(cls, name): * if not name: raise ValueError("empty name") # <<<<<<<<<<<<<< * cdef const char *cname = NULL * name = str2bytes(name, &cname) */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_name); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(33, 27, __pyx_L1_error) __pyx_t_2 = (!__pyx_t_1); if (unlikely(__pyx_t_2)) { __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(33, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(33, 27, __pyx_L1_error) } /* "petsc4py/PETSc/Log.pyx":28 * def Class(cls, name): * if not name: raise ValueError("empty name") * cdef const char *cname = NULL # <<<<<<<<<<<<<< * name = str2bytes(name, &cname) * cdef PetscLogClass classid = -1 */ __pyx_v_cname = NULL; /* "petsc4py/PETSc/Log.pyx":29 * if not name: raise ValueError("empty name") * cdef const char *cname = NULL * name = str2bytes(name, &cname) # <<<<<<<<<<<<<< * cdef PetscLogClass classid = -1 * cdef LogClass klass = get_LogClass(name) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cname)); if (unlikely(!__pyx_t_3)) __PYX_ERR(33, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/Log.pyx":30 * cdef const char *cname = NULL * name = str2bytes(name, &cname) * cdef PetscLogClass classid = -1 # <<<<<<<<<<<<<< * cdef LogClass klass = get_LogClass(name) * if klass is not None: return klass */ __pyx_v_classid = -1; /* "petsc4py/PETSc/Log.pyx":31 * name = str2bytes(name, &cname) * cdef PetscLogClass classid = -1 * cdef LogClass klass = get_LogClass(name) # <<<<<<<<<<<<<< * if klass is not None: return klass * CHKERR( PetscLogClassFindId(cname, &classid) ) */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_get_LogClass(__pyx_v_name)); if (unlikely(!__pyx_t_3)) __PYX_ERR(33, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_klass = ((struct __pyx_obj_8petsc4py_5PETSc_LogClass *)__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/Log.pyx":32 * cdef PetscLogClass classid = -1 * cdef LogClass klass = get_LogClass(name) * if klass is not None: return klass # <<<<<<<<<<<<<< * CHKERR( PetscLogClassFindId(cname, &classid) ) * if classid == -1: */ __pyx_t_2 = (((PyObject *)__pyx_v_klass) != Py_None); if (__pyx_t_2) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_klass); __pyx_r = ((PyObject *)__pyx_v_klass); goto __pyx_L0; } /* "petsc4py/PETSc/Log.pyx":33 * cdef LogClass klass = get_LogClass(name) * if klass is not None: return klass * CHKERR( PetscLogClassFindId(cname, &classid) ) # <<<<<<<<<<<<<< * if classid == -1: * CHKERR( PetscLogClassRegister(cname, &classid) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogClassFindId(__pyx_v_cname, (&__pyx_v_classid))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(33, 33, __pyx_L1_error) /* "petsc4py/PETSc/Log.pyx":34 * if klass is not None: return klass * CHKERR( PetscLogClassFindId(cname, &classid) ) * if classid == -1: # <<<<<<<<<<<<<< * CHKERR( PetscLogClassRegister(cname, &classid) ) * klass = reg_LogClass(name, classid) */ __pyx_t_2 = (__pyx_v_classid == -1L); if (__pyx_t_2) { /* "petsc4py/PETSc/Log.pyx":35 * CHKERR( PetscLogClassFindId(cname, &classid) ) * if classid == -1: * CHKERR( PetscLogClassRegister(cname, &classid) ) # <<<<<<<<<<<<<< * klass = reg_LogClass(name, classid) * return klass */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscClassIdRegister(__pyx_v_cname, (&__pyx_v_classid))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(33, 35, __pyx_L1_error) /* "petsc4py/PETSc/Log.pyx":34 * if klass is not None: return klass * CHKERR( PetscLogClassFindId(cname, &classid) ) * if classid == -1: # <<<<<<<<<<<<<< * CHKERR( PetscLogClassRegister(cname, &classid) ) * klass = reg_LogClass(name, classid) */ } /* "petsc4py/PETSc/Log.pyx":36 * if classid == -1: * CHKERR( PetscLogClassRegister(cname, &classid) ) * klass = reg_LogClass(name, classid) # <<<<<<<<<<<<<< * return klass * */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_reg_LogClass(__pyx_v_name, __pyx_v_classid)); if (unlikely(!__pyx_t_3)) __PYX_ERR(33, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_klass, ((struct __pyx_obj_8petsc4py_5PETSc_LogClass *)__pyx_t_3)); __pyx_t_3 = 0; /* "petsc4py/PETSc/Log.pyx":37 * CHKERR( PetscLogClassRegister(cname, &classid) ) * klass = reg_LogClass(name, classid) * return klass # <<<<<<<<<<<<<< * * @classmethod */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_klass); __pyx_r = ((PyObject *)__pyx_v_klass); goto __pyx_L0; /* "petsc4py/PETSc/Log.pyx":25 * return stage * * @classmethod # <<<<<<<<<<<<<< * def Class(cls, name): * if not name: raise ValueError("empty name") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Log.Class", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_klass); __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":39 * return klass * * @classmethod # <<<<<<<<<<<<<< * def Event(cls, name, klass=None): * if not name: raise ValueError("empty name") */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_5Event(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Log_4Event, "Log.Event(cls, name, klass=None)\nSource code at petsc4py/PETSc/Log.pyx:39"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_5Event(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_name = 0; PyObject *__pyx_v_klass = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("Event (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_klass,0}; /* "petsc4py/PETSc/Log.pyx":40 * * @classmethod * def Event(cls, name, klass=None): # <<<<<<<<<<<<<< * if not name: raise ValueError("empty name") * cdef const char *cname = NULL */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(33, 39, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_klass); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(33, 39, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "Event") < 0)) __PYX_ERR(33, 39, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_name = values[0]; __pyx_v_klass = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("Event", 0, 1, 2, __pyx_nargs); __PYX_ERR(33, 39, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Log.Event", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Log_4Event(((PyTypeObject*)__pyx_v_cls), __pyx_v_name, __pyx_v_klass); /* "petsc4py/PETSc/Log.pyx":39 * return klass * * @classmethod # <<<<<<<<<<<<<< * def Event(cls, name, klass=None): * if not name: raise ValueError("empty name") */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_4Event(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_name, PyObject *__pyx_v_klass) { char const *__pyx_v_cname; PetscClassId __pyx_v_classid; PetscLogEvent __pyx_v_eventid; struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_event = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PetscClassId __pyx_t_4; PetscErrorCode __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("Event", 0); __Pyx_INCREF(__pyx_v_name); /* "petsc4py/PETSc/Log.pyx":41 * @classmethod * def Event(cls, name, klass=None): * if not name: raise ValueError("empty name") # <<<<<<<<<<<<<< * cdef const char *cname = NULL * name = str2bytes(name, &cname) */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_name); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(33, 41, __pyx_L1_error) __pyx_t_2 = (!__pyx_t_1); if (unlikely(__pyx_t_2)) { __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(33, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(33, 41, __pyx_L1_error) } /* "petsc4py/PETSc/Log.pyx":42 * def Event(cls, name, klass=None): * if not name: raise ValueError("empty name") * cdef const char *cname = NULL # <<<<<<<<<<<<<< * name = str2bytes(name, &cname) * cdef PetscLogClass classid = PETSC_OBJECT_CLASSID */ __pyx_v_cname = NULL; /* "petsc4py/PETSc/Log.pyx":43 * if not name: raise ValueError("empty name") * cdef const char *cname = NULL * name = str2bytes(name, &cname) # <<<<<<<<<<<<<< * cdef PetscLogClass classid = PETSC_OBJECT_CLASSID * cdef PetscLogEvent eventid = -1 */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cname)); if (unlikely(!__pyx_t_3)) __PYX_ERR(33, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/Log.pyx":44 * cdef const char *cname = NULL * name = str2bytes(name, &cname) * cdef PetscLogClass classid = PETSC_OBJECT_CLASSID # <<<<<<<<<<<<<< * cdef PetscLogEvent eventid = -1 * if klass is not None: classid = klass */ __pyx_v_classid = PETSC_OBJECT_CLASSID; /* "petsc4py/PETSc/Log.pyx":45 * name = str2bytes(name, &cname) * cdef PetscLogClass classid = PETSC_OBJECT_CLASSID * cdef PetscLogEvent eventid = -1 # <<<<<<<<<<<<<< * if klass is not None: classid = klass * cdef LogEvent event = get_LogEvent(name) */ __pyx_v_eventid = -1; /* "petsc4py/PETSc/Log.pyx":46 * cdef PetscLogClass classid = PETSC_OBJECT_CLASSID * cdef PetscLogEvent eventid = -1 * if klass is not None: classid = klass # <<<<<<<<<<<<<< * cdef LogEvent event = get_LogEvent(name) * if event is not None: return event */ __pyx_t_2 = (__pyx_v_klass != Py_None); if (__pyx_t_2) { __pyx_t_4 = __Pyx_PyInt_As_PetscClassId(__pyx_v_klass); if (unlikely((__pyx_t_4 == ((PetscClassId)-1)) && PyErr_Occurred())) __PYX_ERR(33, 46, __pyx_L1_error) __pyx_v_classid = __pyx_t_4; } /* "petsc4py/PETSc/Log.pyx":47 * cdef PetscLogEvent eventid = -1 * if klass is not None: classid = klass * cdef LogEvent event = get_LogEvent(name) # <<<<<<<<<<<<<< * if event is not None: return event * CHKERR( PetscLogEventFindId(cname, &eventid) ) */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_get_LogEvent(__pyx_v_name)); if (unlikely(!__pyx_t_3)) __PYX_ERR(33, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_event = ((struct __pyx_obj_8petsc4py_5PETSc_LogEvent *)__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/Log.pyx":48 * if klass is not None: classid = klass * cdef LogEvent event = get_LogEvent(name) * if event is not None: return event # <<<<<<<<<<<<<< * CHKERR( PetscLogEventFindId(cname, &eventid) ) * if eventid == -1: */ __pyx_t_2 = (((PyObject *)__pyx_v_event) != Py_None); if (__pyx_t_2) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_event); __pyx_r = ((PyObject *)__pyx_v_event); goto __pyx_L0; } /* "petsc4py/PETSc/Log.pyx":49 * cdef LogEvent event = get_LogEvent(name) * if event is not None: return event * CHKERR( PetscLogEventFindId(cname, &eventid) ) # <<<<<<<<<<<<<< * if eventid == -1: * CHKERR( PetscLogEventRegister(cname, classid, &eventid) ) */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogEventFindId(__pyx_v_cname, (&__pyx_v_eventid))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(33, 49, __pyx_L1_error) /* "petsc4py/PETSc/Log.pyx":50 * if event is not None: return event * CHKERR( PetscLogEventFindId(cname, &eventid) ) * if eventid == -1: # <<<<<<<<<<<<<< * CHKERR( PetscLogEventRegister(cname, classid, &eventid) ) * event = reg_LogEvent(name, eventid) */ __pyx_t_2 = (__pyx_v_eventid == -1L); if (__pyx_t_2) { /* "petsc4py/PETSc/Log.pyx":51 * CHKERR( PetscLogEventFindId(cname, &eventid) ) * if eventid == -1: * CHKERR( PetscLogEventRegister(cname, classid, &eventid) ) # <<<<<<<<<<<<<< * event = reg_LogEvent(name, eventid) * return event */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogEventRegister(__pyx_v_cname, __pyx_v_classid, (&__pyx_v_eventid))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(33, 51, __pyx_L1_error) /* "petsc4py/PETSc/Log.pyx":50 * if event is not None: return event * CHKERR( PetscLogEventFindId(cname, &eventid) ) * if eventid == -1: # <<<<<<<<<<<<<< * CHKERR( PetscLogEventRegister(cname, classid, &eventid) ) * event = reg_LogEvent(name, eventid) */ } /* "petsc4py/PETSc/Log.pyx":52 * if eventid == -1: * CHKERR( PetscLogEventRegister(cname, classid, &eventid) ) * event = reg_LogEvent(name, eventid) # <<<<<<<<<<<<<< * return event * */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_reg_LogEvent(__pyx_v_name, __pyx_v_eventid)); if (unlikely(!__pyx_t_3)) __PYX_ERR(33, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_event, ((struct __pyx_obj_8petsc4py_5PETSc_LogEvent *)__pyx_t_3)); __pyx_t_3 = 0; /* "petsc4py/PETSc/Log.pyx":53 * CHKERR( PetscLogEventRegister(cname, classid, &eventid) ) * event = reg_LogEvent(name, eventid) * return event # <<<<<<<<<<<<<< * * @classmethod */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_event); __pyx_r = ((PyObject *)__pyx_v_event); goto __pyx_L0; /* "petsc4py/PETSc/Log.pyx":39 * return klass * * @classmethod # <<<<<<<<<<<<<< * def Event(cls, name, klass=None): * if not name: raise ValueError("empty name") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Log.Event", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_event); __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":55 * return event * * @classmethod # <<<<<<<<<<<<<< * def begin(cls): * """Turn on logging of objects and events. */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_7begin(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Log_6begin, "Log.begin(cls)\nTurn on logging of objects and events.\n\n Collective.\n\n See Also\n --------\n petsc.PetscLogDefaultBegin\n\n \nSource code at petsc4py/PETSc/Log.pyx:55"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_7begin(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("begin (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("begin", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "begin", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Log_6begin(((PyTypeObject*)__pyx_v_cls)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_6begin(CYTHON_UNUSED PyTypeObject *__pyx_v_cls) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("begin", 1); /* "petsc4py/PETSc/Log.pyx":66 * * """ * CHKERR( PetscLogDefaultBegin() ) # <<<<<<<<<<<<<< * * @classmethod */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogDefaultBegin()); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(33, 66, __pyx_L1_error) /* "petsc4py/PETSc/Log.pyx":55 * return event * * @classmethod # <<<<<<<<<<<<<< * def begin(cls): * """Turn on logging of objects and events. */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Log.begin", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":68 * CHKERR( PetscLogDefaultBegin() ) * * @classmethod # <<<<<<<<<<<<<< * def view(cls, Viewer viewer=None) -> None: * """Print the log. */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_9view(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Log_8view, "Log.view(cls, viewer: Viewer | None = None) -> None\nPrint the log.\n\n Collective.\n\n Parameters\n ----------\n viewer\n A `Viewer` instance or `None` for the default viewer.\n\n See Also\n --------\n petsc_options, petsc.PetscLogView\n\n \nSource code at petsc4py/PETSc/Log.pyx:68"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_9view(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscViewerObject *__pyx_v_viewer = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("view (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0}; /* "petsc4py/PETSc/Log.pyx":69 * * @classmethod * def view(cls, Viewer viewer=None) -> None: # <<<<<<<<<<<<<< * """Print the log. * */ values[0] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscViewerObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_viewer); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(33, 68, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "view") < 0)) __PYX_ERR(33, 68, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, __pyx_nargs); __PYX_ERR(33, 68, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Log.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(33, 69, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Log_8view(((PyTypeObject*)__pyx_v_cls), __pyx_v_viewer); /* "petsc4py/PETSc/Log.pyx":68 * CHKERR( PetscLogDefaultBegin() ) * * @classmethod # <<<<<<<<<<<<<< * def view(cls, Viewer viewer=None) -> None: * """Print the log. */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_8view(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, struct PyPetscViewerObject *__pyx_v_viewer) { PetscViewer __pyx_v_vwr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscViewer __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("view", 1); /* "petsc4py/PETSc/Log.pyx":84 * * """ * cdef PetscViewer vwr = NULL # <<<<<<<<<<<<<< * if viewer is not None: vwr = viewer.vwr * if vwr == NULL: vwr = PETSC_VIEWER_STDOUT_WORLD */ __pyx_v_vwr = NULL; /* "petsc4py/PETSc/Log.pyx":85 * """ * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr # <<<<<<<<<<<<<< * if vwr == NULL: vwr = PETSC_VIEWER_STDOUT_WORLD * CHKERR( PetscLogView(vwr) ) */ __pyx_t_1 = (((PyObject *)__pyx_v_viewer) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_viewer->vwr; __pyx_v_vwr = __pyx_t_2; } /* "petsc4py/PETSc/Log.pyx":86 * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr * if vwr == NULL: vwr = PETSC_VIEWER_STDOUT_WORLD # <<<<<<<<<<<<<< * CHKERR( PetscLogView(vwr) ) * */ __pyx_t_1 = (__pyx_v_vwr == NULL); if (__pyx_t_1) { __pyx_v_vwr = PETSC_VIEWER_STDOUT_WORLD; } /* "petsc4py/PETSc/Log.pyx":87 * if viewer is not None: vwr = viewer.vwr * if vwr == NULL: vwr = PETSC_VIEWER_STDOUT_WORLD * CHKERR( PetscLogView(vwr) ) # <<<<<<<<<<<<<< * * @classmethod */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogView(__pyx_v_vwr)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(33, 87, __pyx_L1_error) /* "petsc4py/PETSc/Log.pyx":68 * CHKERR( PetscLogDefaultBegin() ) * * @classmethod # <<<<<<<<<<<<<< * def view(cls, Viewer viewer=None) -> None: * """Print the log. */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Log.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":89 * CHKERR( PetscLogView(vwr) ) * * @classmethod # <<<<<<<<<<<<<< * def logFlops(cls, flops: float) -> None: * """Add floating point operations to the current event. */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_11logFlops(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Log_10logFlops, "Log.logFlops(cls, flops: float) -> None\nAdd floating point operations to the current event.\n\n Not collective.\n\n Parameters\n ----------\n flops\n The number of flops to log.\n\n See Also\n --------\n petsc.PetscLogFlops\n\n \nSource code at petsc4py/PETSc/Log.pyx:89"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_11logFlops(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_flops = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("logFlops (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flops,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flops)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(33, 89, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "logFlops") < 0)) __PYX_ERR(33, 89, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_flops = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("logFlops", 1, 1, 1, __pyx_nargs); __PYX_ERR(33, 89, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Log.logFlops", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Log_10logFlops(((PyTypeObject*)__pyx_v_cls), __pyx_v_flops); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_10logFlops(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_flops) { PetscLogDouble __pyx_v_cflops; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscLogDouble __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("logFlops", 1); /* "petsc4py/PETSc/Log.pyx":105 * * """ * cdef PetscLogDouble cflops=flops # <<<<<<<<<<<<<< * CHKERR( PetscLogFlops(cflops) ) * */ __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_flops); if (unlikely((__pyx_t_1 == ((PetscLogDouble)-1)) && PyErr_Occurred())) __PYX_ERR(33, 105, __pyx_L1_error) __pyx_v_cflops = __pyx_t_1; /* "petsc4py/PETSc/Log.pyx":106 * """ * cdef PetscLogDouble cflops=flops * CHKERR( PetscLogFlops(cflops) ) # <<<<<<<<<<<<<< * * @classmethod */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogFlops(__pyx_v_cflops)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(33, 106, __pyx_L1_error) /* "petsc4py/PETSc/Log.pyx":89 * CHKERR( PetscLogView(vwr) ) * * @classmethod # <<<<<<<<<<<<<< * def logFlops(cls, flops: float) -> None: * """Add floating point operations to the current event. */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Log.logFlops", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":108 * CHKERR( PetscLogFlops(cflops) ) * * @classmethod # <<<<<<<<<<<<<< * def addFlops(cls, flops: float) -> None: * """Add floating point operations to the current event. */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_13addFlops(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Log_12addFlops, "Log.addFlops(cls, flops: float) -> None\nAdd floating point operations to the current event.\n\n Not collective.\n\n Parameters\n ----------\n flops\n The number of flops to log.\n\n Notes\n -----\n This method exists for backward compatibility.\n\n See Also\n --------\n logFlops, petsc.PetscLogFlops\n\n \nSource code at petsc4py/PETSc/Log.pyx:108"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_13addFlops(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_flops = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("addFlops (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flops,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flops)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(33, 108, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "addFlops") < 0)) __PYX_ERR(33, 108, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_flops = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("addFlops", 1, 1, 1, __pyx_nargs); __PYX_ERR(33, 108, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Log.addFlops", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Log_12addFlops(((PyTypeObject*)__pyx_v_cls), __pyx_v_flops); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_12addFlops(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_flops) { PetscLogDouble __pyx_v_cflops; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscLogDouble __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("addFlops", 1); /* "petsc4py/PETSc/Log.pyx":128 * * """ * cdef PetscLogDouble cflops=flops # <<<<<<<<<<<<<< * CHKERR( PetscLogFlops(cflops) ) * */ __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_flops); if (unlikely((__pyx_t_1 == ((PetscLogDouble)-1)) && PyErr_Occurred())) __PYX_ERR(33, 128, __pyx_L1_error) __pyx_v_cflops = __pyx_t_1; /* "petsc4py/PETSc/Log.pyx":129 * """ * cdef PetscLogDouble cflops=flops * CHKERR( PetscLogFlops(cflops) ) # <<<<<<<<<<<<<< * * @classmethod */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogFlops(__pyx_v_cflops)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(33, 129, __pyx_L1_error) /* "petsc4py/PETSc/Log.pyx":108 * CHKERR( PetscLogFlops(cflops) ) * * @classmethod # <<<<<<<<<<<<<< * def addFlops(cls, flops: float) -> None: * """Add floating point operations to the current event. */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Log.addFlops", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":131 * CHKERR( PetscLogFlops(cflops) ) * * @classmethod # <<<<<<<<<<<<<< * def getFlops(cls) -> float: * """Return the number of flops used on this processor since the program began. */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_15getFlops(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Log_14getFlops, "Log.getFlops(cls) -> float\nReturn the number of flops used on this processor since the program began.\n\n Not collective.\n\n Returns\n -------\n float\n Number of floating point operations.\n\n See Also\n --------\n petsc.PetscGetFlops\n\n \nSource code at petsc4py/PETSc/Log.pyx:131"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_15getFlops(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getFlops (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getFlops", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getFlops", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Log_14getFlops(((PyTypeObject*)__pyx_v_cls)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_14getFlops(CYTHON_UNUSED PyTypeObject *__pyx_v_cls) { PetscLogDouble __pyx_v_cflops; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getFlops", 1); /* "petsc4py/PETSc/Log.pyx":147 * * """ * cdef PetscLogDouble cflops=0 # <<<<<<<<<<<<<< * CHKERR( PetscGetFlops(&cflops) ) * return cflops */ __pyx_v_cflops = 0.0; /* "petsc4py/PETSc/Log.pyx":148 * """ * cdef PetscLogDouble cflops=0 * CHKERR( PetscGetFlops(&cflops) ) # <<<<<<<<<<<<<< * return cflops * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscGetFlops((&__pyx_v_cflops))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(33, 148, __pyx_L1_error) /* "petsc4py/PETSc/Log.pyx":149 * cdef PetscLogDouble cflops=0 * CHKERR( PetscGetFlops(&cflops) ) * return cflops # <<<<<<<<<<<<<< * * @classmethod */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyFloat_FromDouble(__pyx_v_cflops); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Log.pyx":131 * CHKERR( PetscLogFlops(cflops) ) * * @classmethod # <<<<<<<<<<<<<< * def getFlops(cls) -> float: * """Return the number of flops used on this processor since the program began. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Log.getFlops", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":151 * return cflops * * @classmethod # <<<<<<<<<<<<<< * def getTime(cls) -> float: * """Return the current time of day in seconds. */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_17getTime(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Log_16getTime, "Log.getTime(cls) -> float\nReturn the current time of day in seconds.\n\n Collective.\n\n Returns\n -------\n wctime : float\n Current time.\n\n See Also\n --------\n petsc.PetscTime\n\n \nSource code at petsc4py/PETSc/Log.pyx:151"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_17getTime(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getTime (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getTime", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getTime", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Log_16getTime(((PyTypeObject*)__pyx_v_cls)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_16getTime(CYTHON_UNUSED PyTypeObject *__pyx_v_cls) { PetscLogDouble __pyx_v_wctime; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getTime", 1); /* "petsc4py/PETSc/Log.pyx":167 * * """ * cdef PetscLogDouble wctime=0 # <<<<<<<<<<<<<< * CHKERR( PetscTime(&wctime) ) * return wctime */ __pyx_v_wctime = 0.0; /* "petsc4py/PETSc/Log.pyx":168 * """ * cdef PetscLogDouble wctime=0 * CHKERR( PetscTime(&wctime) ) # <<<<<<<<<<<<<< * return wctime * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscTime((&__pyx_v_wctime))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(33, 168, __pyx_L1_error) /* "petsc4py/PETSc/Log.pyx":169 * cdef PetscLogDouble wctime=0 * CHKERR( PetscTime(&wctime) ) * return wctime # <<<<<<<<<<<<<< * * @classmethod */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyFloat_FromDouble(__pyx_v_wctime); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Log.pyx":151 * return cflops * * @classmethod # <<<<<<<<<<<<<< * def getTime(cls) -> float: * """Return the current time of day in seconds. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Log.getTime", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":171 * return wctime * * @classmethod # <<<<<<<<<<<<<< * def getCPUTime(cls) -> float: * """Return the CPU time.""" */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_19getCPUTime(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Log_18getCPUTime, "Log.getCPUTime(cls) -> float\nReturn the CPU time.\nSource code at petsc4py/PETSc/Log.pyx:171"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_19getCPUTime(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getCPUTime (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getCPUTime", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getCPUTime", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Log_18getCPUTime(((PyTypeObject*)__pyx_v_cls)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_18getCPUTime(CYTHON_UNUSED PyTypeObject *__pyx_v_cls) { PetscLogDouble __pyx_v_cputime; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getCPUTime", 1); /* "petsc4py/PETSc/Log.pyx":174 * def getCPUTime(cls) -> float: * """Return the CPU time.""" * cdef PetscLogDouble cputime=0 # <<<<<<<<<<<<<< * CHKERR( PetscGetCPUTime(&cputime) ) * return cputime */ __pyx_v_cputime = 0.0; /* "petsc4py/PETSc/Log.pyx":175 * """Return the CPU time.""" * cdef PetscLogDouble cputime=0 * CHKERR( PetscGetCPUTime(&cputime) ) # <<<<<<<<<<<<<< * return cputime * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscGetCPUTime((&__pyx_v_cputime))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(33, 175, __pyx_L1_error) /* "petsc4py/PETSc/Log.pyx":176 * cdef PetscLogDouble cputime=0 * CHKERR( PetscGetCPUTime(&cputime) ) * return cputime # <<<<<<<<<<<<<< * * @classmethod */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyFloat_FromDouble(__pyx_v_cputime); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Log.pyx":171 * return wctime * * @classmethod # <<<<<<<<<<<<<< * def getCPUTime(cls) -> float: * """Return the CPU time.""" */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Log.getCPUTime", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":178 * return cputime * * @classmethod # <<<<<<<<<<<<<< * def EventDecorator(cls, name=None, klass=None): * """Decorate a function with a `PETSc` event.""" */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_21EventDecorator(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Log_20EventDecorator, "Log.EventDecorator(cls, name=None, klass=None)\nDecorate a function with a `PETSc` event.\nSource code at petsc4py/PETSc/Log.pyx:178"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_21EventDecorator(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_name = 0; PyObject *__pyx_v_klass = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("EventDecorator (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_klass,0}; /* "petsc4py/PETSc/Log.pyx":179 * * @classmethod * def EventDecorator(cls, name=None, klass=None): # <<<<<<<<<<<<<< * """Decorate a function with a `PETSc` event.""" * def decorator(func): */ values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(33, 178, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_klass); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(33, 178, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "EventDecorator") < 0)) __PYX_ERR(33, 178, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_name = values[0]; __pyx_v_klass = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("EventDecorator", 0, 0, 2, __pyx_nargs); __PYX_ERR(33, 178, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Log.EventDecorator", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Log_20EventDecorator(((PyTypeObject*)__pyx_v_cls), __pyx_v_name, __pyx_v_klass); /* "petsc4py/PETSc/Log.pyx":178 * return cputime * * @classmethod # <<<<<<<<<<<<<< * def EventDecorator(cls, name=None, klass=None): * """Decorate a function with a `PETSc` event.""" */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":181 * def EventDecorator(cls, name=None, klass=None): * """Decorate a function with a `PETSc` event.""" * def decorator(func): # <<<<<<<<<<<<<< * @functools.wraps(func) * def wrapped_func(*args, **kwargs): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_14EventDecorator_1decorator(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Log_14EventDecorator_1decorator = {"decorator", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Log_14EventDecorator_1decorator, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_14EventDecorator_1decorator(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_func = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("decorator (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_func)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(33, 181, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "decorator") < 0)) __PYX_ERR(33, 181, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_func = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("decorator", 1, 1, 1, __pyx_nargs); __PYX_ERR(33, 181, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Log.EventDecorator.decorator", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Log_14EventDecorator_decorator(__pyx_self, __pyx_v_func); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":182 * """Decorate a function with a `PETSc` event.""" * def decorator(func): * @functools.wraps(func) # <<<<<<<<<<<<<< * def wrapped_func(*args, **kwargs): * if name: */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_14EventDecorator_9decorator_1wrapped_func(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Log_14EventDecorator_9decorator_1wrapped_func = {"wrapped_func", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Log_14EventDecorator_9decorator_1wrapped_func, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_14EventDecorator_9decorator_1wrapped_func(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kwargs = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("wrapped_func (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "wrapped_func", 1))) return NULL; if (unlikely(__pyx_kwds)) { __pyx_v_kwargs = __Pyx_KwargsAsDict_VARARGS(__pyx_kwds, __pyx_kwvalues); if (unlikely(!__pyx_v_kwargs)) return NULL; __Pyx_GOTREF(__pyx_v_kwargs); } else { __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL; __Pyx_GOTREF(__pyx_v_kwargs); } __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Log_14EventDecorator_9decorator_wrapped_func(__pyx_self, __pyx_v_args, __pyx_v_kwargs); /* function exit code */ __Pyx_DECREF(__pyx_v_args); __Pyx_DECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_14EventDecorator_9decorator_wrapped_func(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct_1_decorator *__pyx_cur_scope; struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct_1_decorator *__pyx_outer_scope; PyObject *__pyx_v_name_ = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("wrapped_func", 1); __pyx_outer_scope = (struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct_1_decorator *) __Pyx_CyFunction_GetClosure(__pyx_self); __pyx_cur_scope = __pyx_outer_scope; /* "petsc4py/PETSc/Log.pyx":184 * @functools.wraps(func) * def wrapped_func(*args, **kwargs): * if name: # <<<<<<<<<<<<<< * name_ = name * else: */ if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_name)) { __Pyx_RaiseClosureNameError("name"); __PYX_ERR(33, 184, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_name); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(33, 184, __pyx_L1_error) if (__pyx_t_1) { /* "petsc4py/PETSc/Log.pyx":185 * def wrapped_func(*args, **kwargs): * if name: * name_ = name # <<<<<<<<<<<<<< * else: * name_ = ".".join([func.__module__, getattr(func, "__qualname__", func.__name__)]) */ if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_name)) { __Pyx_RaiseClosureNameError("name"); __PYX_ERR(33, 185, __pyx_L1_error) } __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_name); __pyx_v_name_ = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_name; /* "petsc4py/PETSc/Log.pyx":184 * @functools.wraps(func) * def wrapped_func(*args, **kwargs): * if name: # <<<<<<<<<<<<<< * name_ = name * else: */ goto __pyx_L3; } /* "petsc4py/PETSc/Log.pyx":187 * name_ = name * else: * name_ = ".".join([func.__module__, getattr(func, "__qualname__", func.__name__)]) # <<<<<<<<<<<<<< * with cls.Event(name_, klass): * return func(*args, **kwargs) */ /*else*/ { if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); __PYX_ERR(33, 187, __pyx_L1_error) } __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_func, __pyx_n_s_module); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); __PYX_ERR(33, 187, __pyx_L1_error) } __pyx_t_3 = __pyx_cur_scope->__pyx_v_func; __Pyx_INCREF(__pyx_t_3); if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); __PYX_ERR(33, 187, __pyx_L1_error) } __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_func, __pyx_n_s_name_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(33, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_GetAttr3(__pyx_t_3, __pyx_n_s_qualname, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(33, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(33, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(33, 187, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_5)) __PYX_ERR(33, 187, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyString_Join(__pyx_kp_s__2, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(33, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_name_ = __pyx_t_5; __pyx_t_5 = 0; } __pyx_L3:; /* "petsc4py/PETSc/Log.pyx":188 * else: * name_ = ".".join([func.__module__, getattr(func, "__qualname__", func.__name__)]) * with cls.Event(name_, klass): # <<<<<<<<<<<<<< * return func(*args, **kwargs) * return wrapped_func */ /*with:*/ { if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_cls)) { __Pyx_RaiseClosureNameError("cls"); __PYX_ERR(33, 188, __pyx_L1_error) } __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_outer_scope->__pyx_v_cls), __pyx_n_s_Event); if (unlikely(!__pyx_t_4)) __PYX_ERR(33, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_klass)) { __Pyx_RaiseClosureNameError("klass"); __PYX_ERR(33, 188, __pyx_L1_error) } __pyx_t_2 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_name_, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_klass}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(33, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_t_7 = __Pyx_PyObject_LookupSpecial(__pyx_t_5, __pyx_n_s_exit); if (unlikely(!__pyx_t_7)) __PYX_ERR(33, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_5, __pyx_n_s_enter); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 188, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(33, 188, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /*try:*/ { { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); /*try:*/ { /* "petsc4py/PETSc/Log.pyx":189 * name_ = ".".join([func.__module__, getattr(func, "__qualname__", func.__name__)]) * with cls.Event(name_, klass): * return func(*args, **kwargs) # <<<<<<<<<<<<<< * return wrapped_func * return decorator */ __Pyx_XDECREF(__pyx_r); if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); __PYX_ERR(33, 189, __pyx_L8_error) } __pyx_t_5 = PyDict_Copy(__pyx_v_kwargs); if (unlikely(!__pyx_t_5)) __PYX_ERR(33, 189, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_func, __pyx_v_args, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(33, 189, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L12_try_return; /* "petsc4py/PETSc/Log.pyx":188 * else: * name_ = ".".join([func.__module__, getattr(func, "__qualname__", func.__name__)]) * with cls.Event(name_, klass): # <<<<<<<<<<<<<< * return func(*args, **kwargs) * return wrapped_func */ } __pyx_L8_error:; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /*except:*/ { __Pyx_AddTraceback("petsc4py.PETSc.Log.EventDecorator.decorator.wrapped_func", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_2) < 0) __PYX_ERR(33, 188, __pyx_L10_except_error) __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_Pack(3, __pyx_t_4, __pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(33, 188, __pyx_L10_except_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_3, NULL); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_11)) __PYX_ERR(33, 188, __pyx_L10_except_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_11); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (__pyx_t_1 < 0) __PYX_ERR(33, 188, __pyx_L10_except_error) __pyx_t_12 = (!__pyx_t_1); if (unlikely(__pyx_t_12)) { __Pyx_GIVEREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_5, __pyx_t_2); __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_2 = 0; __PYX_ERR(33, 188, __pyx_L10_except_error) } __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L9_exception_handled; } __pyx_L10_except_error:; __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); goto __pyx_L1_error; __pyx_L12_try_return:; __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); goto __pyx_L5_return; __pyx_L9_exception_handled:; __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_7) { __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__32, NULL); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_10)) __PYX_ERR(33, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } goto __pyx_L7; } __pyx_L5_return: { __pyx_t_10 = __pyx_r; __pyx_r = 0; if (__pyx_t_7) { __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__32, NULL); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(33, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __pyx_r = __pyx_t_10; __pyx_t_10 = 0; goto __pyx_L0; } __pyx_L7:; } goto __pyx_L17; __pyx_L4_error:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L1_error; __pyx_L17:; } /* "petsc4py/PETSc/Log.pyx":182 * """Decorate a function with a `PETSc` event.""" * def decorator(func): * @functools.wraps(func) # <<<<<<<<<<<<<< * def wrapped_func(*args, **kwargs): * if name: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.Log.EventDecorator.decorator.wrapped_func", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name_); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":181 * def EventDecorator(cls, name=None, klass=None): * """Decorate a function with a `PETSc` event.""" * def decorator(func): # <<<<<<<<<<<<<< * @functools.wraps(func) * def wrapped_func(*args, **kwargs): */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_14EventDecorator_decorator(PyObject *__pyx_self, PyObject *__pyx_v_func) { struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct_1_decorator *__pyx_cur_scope; PyObject *__pyx_v_wrapped_func = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("decorator", 0); __pyx_cur_scope = (struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct_1_decorator *)__pyx_tp_new_8petsc4py_5PETSc___pyx_scope_struct_1_decorator(__pyx_ptype_8petsc4py_5PETSc___pyx_scope_struct_1_decorator, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct_1_decorator *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(33, 181, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator *) __Pyx_CyFunction_GetClosure(__pyx_self); __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope); __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope); __pyx_cur_scope->__pyx_v_func = __pyx_v_func; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func); /* "petsc4py/PETSc/Log.pyx":182 * """Decorate a function with a `PETSc` event.""" * def decorator(func): * @functools.wraps(func) # <<<<<<<<<<<<<< * def wrapped_func(*args, **kwargs): * if name: */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_8petsc4py_5PETSc_functools, __pyx_n_s_wraps); if (unlikely(!__pyx_t_3)) __PYX_ERR(33, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_cur_scope->__pyx_v_func}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Log_14EventDecorator_9decorator_1wrapped_func, 0, __pyx_n_s_EventDecorator_locals_decorator, ((PyObject*)__pyx_cur_scope), __pyx_n_s_petsc4py_PETSc, __pyx_d, ((PyObject *)__pyx_codeobj__34)); if (unlikely(!__pyx_t_3)) __PYX_ERR(33, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_wrapped_func = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/Log.pyx":190 * with cls.Event(name_, klass): * return func(*args, **kwargs) * return wrapped_func # <<<<<<<<<<<<<< * return decorator * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_wrapped_func); __pyx_r = __pyx_v_wrapped_func; goto __pyx_L0; /* "petsc4py/PETSc/Log.pyx":181 * def EventDecorator(cls, name=None, klass=None): * """Decorate a function with a `PETSc` event.""" * def decorator(func): # <<<<<<<<<<<<<< * @functools.wraps(func) * def wrapped_func(*args, **kwargs): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.Log.EventDecorator.decorator", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_wrapped_func); __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":178 * return cputime * * @classmethod # <<<<<<<<<<<<<< * def EventDecorator(cls, name=None, klass=None): * """Decorate a function with a `PETSc` event.""" */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_20EventDecorator(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_name, PyObject *__pyx_v_klass) { struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator *__pyx_cur_scope; PyObject *__pyx_v_decorator = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("EventDecorator", 0); __pyx_cur_scope = (struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator *)__pyx_tp_new_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator(__pyx_ptype_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(33, 178, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } __pyx_cur_scope->__pyx_v_cls = __pyx_v_cls; __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_cls); __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_cls); __pyx_cur_scope->__pyx_v_name = __pyx_v_name; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_name); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_name); __pyx_cur_scope->__pyx_v_klass = __pyx_v_klass; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_klass); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_klass); /* "petsc4py/PETSc/Log.pyx":181 * def EventDecorator(cls, name=None, klass=None): * """Decorate a function with a `PETSc` event.""" * def decorator(func): # <<<<<<<<<<<<<< * @functools.wraps(func) * def wrapped_func(*args, **kwargs): */ __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Log_14EventDecorator_1decorator, 0, __pyx_n_s_EventDecorator_locals_decorator_2, ((PyObject*)__pyx_cur_scope), __pyx_n_s_petsc4py_PETSc, __pyx_d, ((PyObject *)__pyx_codeobj__36)); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_decorator = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/Log.pyx":191 * return func(*args, **kwargs) * return wrapped_func * return decorator # <<<<<<<<<<<<<< * * @classmethod */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_decorator); __pyx_r = __pyx_v_decorator; goto __pyx_L0; /* "petsc4py/PETSc/Log.pyx":178 * return cputime * * @classmethod # <<<<<<<<<<<<<< * def EventDecorator(cls, name=None, klass=None): * """Decorate a function with a `PETSc` event.""" */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Log.EventDecorator", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_decorator); __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":193 * return decorator * * @classmethod # <<<<<<<<<<<<<< * def isActive(cls) -> bool: * """Return whether logging is currently in progress. */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_23isActive(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Log_22isActive, "Log.isActive(cls) -> bool\nReturn whether logging is currently in progress.\n\n Not collective.\n\n See Also\n --------\n petsc.PetscLogIsActive\n\n \nSource code at petsc4py/PETSc/Log.pyx:193"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_23isActive(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("isActive (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("isActive", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "isActive", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Log_22isActive(((PyTypeObject*)__pyx_v_cls)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_22isActive(CYTHON_UNUSED PyTypeObject *__pyx_v_cls) { PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("isActive", 1); /* "petsc4py/PETSc/Log.pyx":204 * * """ * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( PetscLogIsActive(&flag) ) * return toBool(flag) */ __pyx_v_flag = PETSC_FALSE; /* "petsc4py/PETSc/Log.pyx":205 * """ * cdef PetscBool flag = PETSC_FALSE * CHKERR( PetscLogIsActive(&flag) ) # <<<<<<<<<<<<<< * return toBool(flag) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogIsActive((&__pyx_v_flag))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(33, 205, __pyx_L1_error) /* "petsc4py/PETSc/Log.pyx":206 * cdef PetscBool flag = PETSC_FALSE * CHKERR( PetscLogIsActive(&flag) ) * return toBool(flag) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Log.pyx":193 * return decorator * * @classmethod # <<<<<<<<<<<<<< * def isActive(cls) -> bool: * """Return whether logging is currently in progress. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Log.isActive", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":215 * cdef readonly PetscLogStage id * * def __cinit__(self): # <<<<<<<<<<<<<< * self.id = 0 * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_8LogStage_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_8LogStage_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogStage___cinit__(((struct __pyx_obj_8petsc4py_5PETSc_LogStage *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_8LogStage___cinit__(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self) { int __pyx_r; /* "petsc4py/PETSc/Log.pyx":216 * * def __cinit__(self): * self.id = 0 # <<<<<<<<<<<<<< * * def __int__(self): */ __pyx_v_self->id = 0; /* "petsc4py/PETSc/Log.pyx":215 * cdef readonly PetscLogStage id * * def __cinit__(self): # <<<<<<<<<<<<<< * self.id = 0 * */ /* function exit code */ __pyx_r = 0; return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":218 * self.id = 0 * * def __int__(self): # <<<<<<<<<<<<<< * return self.id * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_3__int__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_3__int__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__int__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogStage_2__int__(((struct __pyx_obj_8petsc4py_5PETSc_LogStage *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_2__int__(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__int__", 1); /* "petsc4py/PETSc/Log.pyx":219 * * def __int__(self): * return self.id # <<<<<<<<<<<<<< * * def __enter__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(((int)__pyx_v_self->id)); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Log.pyx":218 * self.id = 0 * * def __int__(self): # <<<<<<<<<<<<<< * return self.id * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.LogStage.__int__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":221 * return self.id * * def __enter__(self): # <<<<<<<<<<<<<< * self.push() * return self */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_5__enter__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_8LogStage_4__enter__, "LogStage.__enter__(self)\nSource code at petsc4py/PETSc/Log.pyx:221"); static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_5__enter__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__enter__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__enter__", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogStage_4__enter__(((struct __pyx_obj_8petsc4py_5PETSc_LogStage *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_4__enter__(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__enter__", 1); /* "petsc4py/PETSc/Log.pyx":222 * * def __enter__(self): * self.push() # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_push); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Log.pyx":223 * def __enter__(self): * self.push() * return self # <<<<<<<<<<<<<< * * def __exit__(self, *exc): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Log.pyx":221 * return self.id * * def __enter__(self): # <<<<<<<<<<<<<< * self.push() * return self */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.LogStage.__enter__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":225 * return self * * def __exit__(self, *exc): # <<<<<<<<<<<<<< * self.pop() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_7__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_8LogStage_6__exit__, "LogStage.__exit__(self, *exc)\nSource code at petsc4py/PETSc/Log.pyx:225"); static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_7__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED PyObject *__pyx_v_exc = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__exit__", 0))) return NULL; __Pyx_INCREF(__pyx_args); __pyx_v_exc = __pyx_args; __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogStage_6__exit__(((struct __pyx_obj_8petsc4py_5PETSc_LogStage *)__pyx_v_self), __pyx_v_exc); /* function exit code */ __Pyx_DECREF(__pyx_v_exc); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_6__exit__(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__exit__", 1); /* "petsc4py/PETSc/Log.pyx":226 * * def __exit__(self, *exc): * self.pop() # <<<<<<<<<<<<<< * * # */ __pyx_t_1 = __Pyx_PyObject_Pop(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Log.pyx":225 * return self * * def __exit__(self, *exc): # <<<<<<<<<<<<<< * self.pop() * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.LogStage.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":230 * # * * def push(self) -> None: # <<<<<<<<<<<<<< * """Push a stage on the logging stack. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_9push(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_8LogStage_8push, "LogStage.push(self) -> None\nPush a stage on the logging stack.\n\n Logically collective.\n\n See Also\n --------\n LogStage.pop, petsc.PetscLogStagePush\n\n \nSource code at petsc4py/PETSc/Log.pyx:230"); static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_9push(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("push (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("push", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "push", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogStage_8push(((struct __pyx_obj_8petsc4py_5PETSc_LogStage *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_8push(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("push", 1); /* "petsc4py/PETSc/Log.pyx":240 * * """ * CHKERR( PetscLogStagePush(self.id) ) # <<<<<<<<<<<<<< * * def pop(self) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogStagePush(__pyx_v_self->id)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(33, 240, __pyx_L1_error) /* "petsc4py/PETSc/Log.pyx":230 * # * * def push(self) -> None: # <<<<<<<<<<<<<< * """Push a stage on the logging stack. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.LogStage.push", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":242 * CHKERR( PetscLogStagePush(self.id) ) * * def pop(self) -> None: # <<<<<<<<<<<<<< * """Pop a stage from the logging stack. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_11pop(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_8LogStage_10pop, "LogStage.pop(self) -> None\nPop a stage from the logging stack.\n\n Logically collective.\n\n See Also\n --------\n LogStage.push, petsc.PetscLogStagePop\n\n \nSource code at petsc4py/PETSc/Log.pyx:242"); static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_11pop(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pop (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("pop", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "pop", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogStage_10pop(((struct __pyx_obj_8petsc4py_5PETSc_LogStage *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_10pop(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pop", 1); /* "petsc4py/PETSc/Log.pyx":252 * * """ * self # unused # <<<<<<<<<<<<<< * CHKERR( PetscLogStagePop() ) * */ ((void)__pyx_v_self); /* "petsc4py/PETSc/Log.pyx":253 * """ * self # unused * CHKERR( PetscLogStagePop() ) # <<<<<<<<<<<<<< * * # */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogStagePop()); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(33, 253, __pyx_L1_error) /* "petsc4py/PETSc/Log.pyx":242 * CHKERR( PetscLogStagePush(self.id) ) * * def pop(self) -> None: # <<<<<<<<<<<<<< * """Pop a stage from the logging stack. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.LogStage.pop", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":257 * # * * def getName(self): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * CHKERR( PetscLogStageFindName(self.id, &cval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_13getName(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_8LogStage_12getName, "LogStage.getName(self)\nSource code at petsc4py/PETSc/Log.pyx:257"); static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_13getName(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getName (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getName", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getName", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogStage_12getName(((struct __pyx_obj_8petsc4py_5PETSc_LogStage *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_12getName(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getName", 1); /* "petsc4py/PETSc/Log.pyx":258 * * def getName(self): * cdef const char *cval = NULL # <<<<<<<<<<<<<< * CHKERR( PetscLogStageFindName(self.id, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/Log.pyx":259 * def getName(self): * cdef const char *cval = NULL * CHKERR( PetscLogStageFindName(self.id, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogStageFindName(__pyx_v_self->id, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(33, 259, __pyx_L1_error) /* "petsc4py/PETSc/Log.pyx":260 * cdef const char *cval = NULL * CHKERR( PetscLogStageFindName(self.id, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * property name: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Log.pyx":257 * # * * def getName(self): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * CHKERR( PetscLogStageFindName(self.id, &cval) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.LogStage.getName", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":263 * * property name: * def __get__(self): # <<<<<<<<<<<<<< * return self.getName() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_4name_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_4name_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogStage_4name___get__(((struct __pyx_obj_8petsc4py_5PETSc_LogStage *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_4name___get__(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/Log.pyx":264 * property name: * def __get__(self): * return self.getName() # <<<<<<<<<<<<<< * def __set__(self, value): * self; value; # unused */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getName); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 264, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 264, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Log.pyx":263 * * property name: * def __get__(self): # <<<<<<<<<<<<<< * return self.getName() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.LogStage.name.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":265 * def __get__(self): * return self.getName() * def __set__(self, value): # <<<<<<<<<<<<<< * self; value; # unused * raise TypeError("readonly attribute") */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_8LogStage_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_8LogStage_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogStage_4name_2__set__(((struct __pyx_obj_8petsc4py_5PETSc_LogStage *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_8LogStage_4name_2__set__(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "petsc4py/PETSc/Log.pyx":266 * return self.getName() * def __set__(self, value): * self; value; # unused # <<<<<<<<<<<<<< * raise TypeError("readonly attribute") * */ ((void)__pyx_v_self); ((void)__pyx_v_value); /* "petsc4py/PETSc/Log.pyx":267 * def __set__(self, value): * self; value; # unused * raise TypeError("readonly attribute") # <<<<<<<<<<<<<< * * # */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(33, 267, __pyx_L1_error) /* "petsc4py/PETSc/Log.pyx":265 * def __get__(self): * return self.getName() * def __set__(self, value): # <<<<<<<<<<<<<< * self; value; # unused * raise TypeError("readonly attribute") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.LogStage.name.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":271 * # * * def activate(self) -> None: # <<<<<<<<<<<<<< * """Activate the stage. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_15activate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_8LogStage_14activate, "LogStage.activate(self) -> None\nActivate the stage.\n\n Logically collective.\n\n See Also\n --------\n petsc.PetscLogStageSetActive\n\n \nSource code at petsc4py/PETSc/Log.pyx:271"); static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_15activate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("activate (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("activate", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "activate", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogStage_14activate(((struct __pyx_obj_8petsc4py_5PETSc_LogStage *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_14activate(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("activate", 1); /* "petsc4py/PETSc/Log.pyx":281 * * """ * CHKERR( PetscLogStageSetActive(self.id, PETSC_TRUE) ) # <<<<<<<<<<<<<< * * def deactivate(self) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogStageSetActive(__pyx_v_self->id, PETSC_TRUE)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(33, 281, __pyx_L1_error) /* "petsc4py/PETSc/Log.pyx":271 * # * * def activate(self) -> None: # <<<<<<<<<<<<<< * """Activate the stage. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.LogStage.activate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":283 * CHKERR( PetscLogStageSetActive(self.id, PETSC_TRUE) ) * * def deactivate(self) -> None: # <<<<<<<<<<<<<< * """Deactivate the stage. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_17deactivate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_8LogStage_16deactivate, "LogStage.deactivate(self) -> None\nDeactivate the stage.\n\n Logically collective.\n\n See Also\n --------\n petsc.PetscLogStageSetActive\n\n \nSource code at petsc4py/PETSc/Log.pyx:283"); static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_17deactivate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("deactivate (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("deactivate", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "deactivate", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogStage_16deactivate(((struct __pyx_obj_8petsc4py_5PETSc_LogStage *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_16deactivate(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("deactivate", 1); /* "petsc4py/PETSc/Log.pyx":293 * * """ * CHKERR( PetscLogStageSetActive(self.id, PETSC_FALSE) ) # <<<<<<<<<<<<<< * * def getActive(self) -> bool: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogStageSetActive(__pyx_v_self->id, PETSC_FALSE)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(33, 293, __pyx_L1_error) /* "petsc4py/PETSc/Log.pyx":283 * CHKERR( PetscLogStageSetActive(self.id, PETSC_TRUE) ) * * def deactivate(self) -> None: # <<<<<<<<<<<<<< * """Deactivate the stage. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.LogStage.deactivate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":295 * CHKERR( PetscLogStageSetActive(self.id, PETSC_FALSE) ) * * def getActive(self) -> bool: # <<<<<<<<<<<<<< * """Check if the stage is activated. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_19getActive(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_8LogStage_18getActive, "LogStage.getActive(self) -> bool\nCheck if the stage is activated.\n\n Not collective.\n\n See Also\n --------\n petsc.PetscLogStageGetActive\n\n \nSource code at petsc4py/PETSc/Log.pyx:295"); static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_19getActive(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getActive (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getActive", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getActive", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogStage_18getActive(((struct __pyx_obj_8petsc4py_5PETSc_LogStage *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_18getActive(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self) { PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getActive", 1); /* "petsc4py/PETSc/Log.pyx":305 * * """ * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( PetscLogStageGetActive(self.id, &flag) ) * return toBool(flag) */ __pyx_v_flag = PETSC_FALSE; /* "petsc4py/PETSc/Log.pyx":306 * """ * cdef PetscBool flag = PETSC_FALSE * CHKERR( PetscLogStageGetActive(self.id, &flag) ) # <<<<<<<<<<<<<< * return toBool(flag) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogStageGetActive(__pyx_v_self->id, (&__pyx_v_flag))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(33, 306, __pyx_L1_error) /* "petsc4py/PETSc/Log.pyx":307 * cdef PetscBool flag = PETSC_FALSE * CHKERR( PetscLogStageGetActive(self.id, &flag) ) * return toBool(flag) # <<<<<<<<<<<<<< * * def setActive(self, flag: bool) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Log.pyx":295 * CHKERR( PetscLogStageSetActive(self.id, PETSC_FALSE) ) * * def getActive(self) -> bool: # <<<<<<<<<<<<<< * """Check if the stage is activated. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.LogStage.getActive", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":309 * return toBool(flag) * * def setActive(self, flag: bool) -> None: # <<<<<<<<<<<<<< * """Activate or deactivate the current stage. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_21setActive(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_8LogStage_20setActive, "LogStage.setActive(self, flag: bool) -> None\nActivate or deactivate the current stage.\n\n Logically collective.\n\n See Also\n --------\n petsc.PetscLogStageSetActive\n\n \nSource code at petsc4py/PETSc/Log.pyx:309"); static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_21setActive(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_flag = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setActive (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flag)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(33, 309, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setActive") < 0)) __PYX_ERR(33, 309, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_flag = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setActive", 1, 1, 1, __pyx_nargs); __PYX_ERR(33, 309, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.LogStage.setActive", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogStage_20setActive(((struct __pyx_obj_8petsc4py_5PETSc_LogStage *)__pyx_v_self), __pyx_v_flag); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_20setActive(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self, PyObject *__pyx_v_flag) { PetscBool __pyx_v_tval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setActive", 1); /* "petsc4py/PETSc/Log.pyx":319 * * """ * cdef PetscBool tval = PETSC_FALSE # <<<<<<<<<<<<<< * if flag: tval = PETSC_TRUE * CHKERR( PetscLogStageSetActive(self.id, tval) ) */ __pyx_v_tval = PETSC_FALSE; /* "petsc4py/PETSc/Log.pyx":320 * """ * cdef PetscBool tval = PETSC_FALSE * if flag: tval = PETSC_TRUE # <<<<<<<<<<<<<< * CHKERR( PetscLogStageSetActive(self.id, tval) ) * */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_flag); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(33, 320, __pyx_L1_error) if (__pyx_t_1) { __pyx_v_tval = PETSC_TRUE; } /* "petsc4py/PETSc/Log.pyx":321 * cdef PetscBool tval = PETSC_FALSE * if flag: tval = PETSC_TRUE * CHKERR( PetscLogStageSetActive(self.id, tval) ) # <<<<<<<<<<<<<< * * property active: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogStageSetActive(__pyx_v_self->id, __pyx_v_tval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(33, 321, __pyx_L1_error) /* "petsc4py/PETSc/Log.pyx":309 * return toBool(flag) * * def setActive(self, flag: bool) -> None: # <<<<<<<<<<<<<< * """Activate or deactivate the current stage. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.LogStage.setActive", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":324 * * property active: * def __get__(self): # <<<<<<<<<<<<<< * return self.getActive() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_6active_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_6active_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogStage_6active___get__(((struct __pyx_obj_8petsc4py_5PETSc_LogStage *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_6active___get__(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/Log.pyx":325 * property active: * def __get__(self): * return self.getActive() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setActive(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getActive); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Log.pyx":324 * * property active: * def __get__(self): # <<<<<<<<<<<<<< * return self.getActive() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.LogStage.active.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":326 * def __get__(self): * return self.getActive() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setActive(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_8LogStage_6active_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_8LogStage_6active_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogStage_6active_2__set__(((struct __pyx_obj_8petsc4py_5PETSc_LogStage *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_8LogStage_6active_2__set__(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "petsc4py/PETSc/Log.pyx":327 * return self.getActive() * def __set__(self, value): * self.setActive(value) # <<<<<<<<<<<<<< * * # */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setActive); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_value}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Log.pyx":326 * def __get__(self): * return self.getActive() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setActive(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.LogStage.active.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":331 * # * * def getVisible(self) -> bool: # <<<<<<<<<<<<<< * """Return whether the stage is visible. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_23getVisible(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_8LogStage_22getVisible, "LogStage.getVisible(self) -> bool\nReturn whether the stage is visible.\n\n Not collective.\n\n See Also\n --------\n LogStage.setVisible, petsc.PetscLogStageSetVisible\n\n \nSource code at petsc4py/PETSc/Log.pyx:331"); static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_23getVisible(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getVisible (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getVisible", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getVisible", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogStage_22getVisible(((struct __pyx_obj_8petsc4py_5PETSc_LogStage *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_22getVisible(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self) { PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getVisible", 1); /* "petsc4py/PETSc/Log.pyx":341 * * """ * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( PetscLogStageGetVisible(self.id, &flag) ) * return toBool(flag) */ __pyx_v_flag = PETSC_FALSE; /* "petsc4py/PETSc/Log.pyx":342 * """ * cdef PetscBool flag = PETSC_FALSE * CHKERR( PetscLogStageGetVisible(self.id, &flag) ) # <<<<<<<<<<<<<< * return toBool(flag) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogStageGetVisible(__pyx_v_self->id, (&__pyx_v_flag))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(33, 342, __pyx_L1_error) /* "petsc4py/PETSc/Log.pyx":343 * cdef PetscBool flag = PETSC_FALSE * CHKERR( PetscLogStageGetVisible(self.id, &flag) ) * return toBool(flag) # <<<<<<<<<<<<<< * * def setVisible(self, flag: bool) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Log.pyx":331 * # * * def getVisible(self) -> bool: # <<<<<<<<<<<<<< * """Return whether the stage is visible. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.LogStage.getVisible", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":345 * return toBool(flag) * * def setVisible(self, flag: bool) -> None: # <<<<<<<<<<<<<< * """Set the visibility of the stage. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_25setVisible(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_8LogStage_24setVisible, "LogStage.setVisible(self, flag: bool) -> None\nSet the visibility of the stage.\n\n Logically collective.\n\n Parameters\n ----------\n flag\n `True` to make the stage visible, `False` otherwise.\n\n See Also\n --------\n LogStage.getVisible, petsc.PetscLogStageSetVisible\n\n \nSource code at petsc4py/PETSc/Log.pyx:345"); static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_25setVisible(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_flag = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setVisible (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flag)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(33, 345, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setVisible") < 0)) __PYX_ERR(33, 345, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_flag = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setVisible", 1, 1, 1, __pyx_nargs); __PYX_ERR(33, 345, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.LogStage.setVisible", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogStage_24setVisible(((struct __pyx_obj_8petsc4py_5PETSc_LogStage *)__pyx_v_self), __pyx_v_flag); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_24setVisible(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self, PyObject *__pyx_v_flag) { PetscBool __pyx_v_tval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setVisible", 1); /* "petsc4py/PETSc/Log.pyx":360 * * """ * cdef PetscBool tval = PETSC_FALSE # <<<<<<<<<<<<<< * if flag: tval = PETSC_TRUE * CHKERR( PetscLogStageSetVisible(self.id, tval) ) */ __pyx_v_tval = PETSC_FALSE; /* "petsc4py/PETSc/Log.pyx":361 * """ * cdef PetscBool tval = PETSC_FALSE * if flag: tval = PETSC_TRUE # <<<<<<<<<<<<<< * CHKERR( PetscLogStageSetVisible(self.id, tval) ) * */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_flag); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(33, 361, __pyx_L1_error) if (__pyx_t_1) { __pyx_v_tval = PETSC_TRUE; } /* "petsc4py/PETSc/Log.pyx":362 * cdef PetscBool tval = PETSC_FALSE * if flag: tval = PETSC_TRUE * CHKERR( PetscLogStageSetVisible(self.id, tval) ) # <<<<<<<<<<<<<< * * property visible: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogStageSetVisible(__pyx_v_self->id, __pyx_v_tval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(33, 362, __pyx_L1_error) /* "petsc4py/PETSc/Log.pyx":345 * return toBool(flag) * * def setVisible(self, flag: bool) -> None: # <<<<<<<<<<<<<< * """Set the visibility of the stage. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.LogStage.setVisible", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":365 * * property visible: * def __get__(self): # <<<<<<<<<<<<<< * return self.getVisible() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_7visible_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_7visible_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogStage_7visible___get__(((struct __pyx_obj_8petsc4py_5PETSc_LogStage *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_7visible___get__(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/Log.pyx":366 * property visible: * def __get__(self): * return self.getVisible() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setVisible(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getVisible); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Log.pyx":365 * * property visible: * def __get__(self): # <<<<<<<<<<<<<< * return self.getVisible() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.LogStage.visible.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":367 * def __get__(self): * return self.getVisible() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setVisible(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_8LogStage_7visible_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_8LogStage_7visible_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogStage_7visible_2__set__(((struct __pyx_obj_8petsc4py_5PETSc_LogStage *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_8LogStage_7visible_2__set__(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "petsc4py/PETSc/Log.pyx":368 * return self.getVisible() * def __set__(self, value): * self.setVisible(value) # <<<<<<<<<<<<<< * * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setVisible); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_value}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Log.pyx":367 * def __get__(self): * return self.getVisible() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setVisible(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.LogStage.visible.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":213 * """Logging support for different stages.""" * * cdef readonly PetscLogStage id # <<<<<<<<<<<<<< * * def __cinit__(self): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_2id_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_2id_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogStage_2id___get__(((struct __pyx_obj_8petsc4py_5PETSc_LogStage *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_2id___get__(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_PetscLogStage(__pyx_v_self->id); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.LogStage.id.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":373 * cdef dict stage_registry = { } * * cdef LogStage get_LogStage(object name): # <<<<<<<<<<<<<< * return stage_registry.get(name) * */ static struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_f_8petsc4py_5PETSc_get_LogStage(PyObject *__pyx_v_name) { struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_LogStage", 1); /* "petsc4py/PETSc/Log.pyx":374 * * cdef LogStage get_LogStage(object name): * return stage_registry.get(name) # <<<<<<<<<<<<<< * * cdef LogStage reg_LogStage(object name, PetscLogStage stageid): */ __Pyx_XDECREF((PyObject *)__pyx_r); if (unlikely(__pyx_v_8petsc4py_5PETSc_stage_registry == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(33, 374, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_8petsc4py_5PETSc_stage_registry, __pyx_v_name, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_LogStage))))) __PYX_ERR(33, 374, __pyx_L1_error) __pyx_r = ((struct __pyx_obj_8petsc4py_5PETSc_LogStage *)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Log.pyx":373 * cdef dict stage_registry = { } * * cdef LogStage get_LogStage(object name): # <<<<<<<<<<<<<< * return stage_registry.get(name) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.get_LogStage", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":376 * return stage_registry.get(name) * * cdef LogStage reg_LogStage(object name, PetscLogStage stageid): # <<<<<<<<<<<<<< * cdef LogStage stage = LogStage() * stage.id = stageid */ static struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_f_8petsc4py_5PETSc_reg_LogStage(PyObject *__pyx_v_name, PetscLogStage __pyx_v_stageid) { struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_stage = 0; struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("reg_LogStage", 1); /* "petsc4py/PETSc/Log.pyx":377 * * cdef LogStage reg_LogStage(object name, PetscLogStage stageid): * cdef LogStage stage = LogStage() # <<<<<<<<<<<<<< * stage.id = stageid * stage_registry[name] = stage */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_LogStage)); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_stage = ((struct __pyx_obj_8petsc4py_5PETSc_LogStage *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Log.pyx":378 * cdef LogStage reg_LogStage(object name, PetscLogStage stageid): * cdef LogStage stage = LogStage() * stage.id = stageid # <<<<<<<<<<<<<< * stage_registry[name] = stage * return stage */ __pyx_v_stage->id = __pyx_v_stageid; /* "petsc4py/PETSc/Log.pyx":379 * cdef LogStage stage = LogStage() * stage.id = stageid * stage_registry[name] = stage # <<<<<<<<<<<<<< * return stage * */ if (unlikely(__pyx_v_8petsc4py_5PETSc_stage_registry == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(33, 379, __pyx_L1_error) } if (unlikely((PyDict_SetItem(__pyx_v_8petsc4py_5PETSc_stage_registry, __pyx_v_name, ((PyObject *)__pyx_v_stage)) < 0))) __PYX_ERR(33, 379, __pyx_L1_error) /* "petsc4py/PETSc/Log.pyx":380 * stage.id = stageid * stage_registry[name] = stage * return stage # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_stage); __pyx_r = __pyx_v_stage; goto __pyx_L0; /* "petsc4py/PETSc/Log.pyx":376 * return stage_registry.get(name) * * cdef LogStage reg_LogStage(object name, PetscLogStage stageid): # <<<<<<<<<<<<<< * cdef LogStage stage = LogStage() * stage.id = stageid */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.reg_LogStage", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_stage); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":388 * cdef readonly PetscLogClass id * * def __cinit__(self): # <<<<<<<<<<<<<< * self.id = PETSC_OBJECT_CLASSID * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_8LogClass_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_8LogClass_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogClass___cinit__(((struct __pyx_obj_8petsc4py_5PETSc_LogClass *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_8LogClass___cinit__(struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_self) { int __pyx_r; /* "petsc4py/PETSc/Log.pyx":389 * * def __cinit__(self): * self.id = PETSC_OBJECT_CLASSID # <<<<<<<<<<<<<< * * def __int__(self): */ __pyx_v_self->id = PETSC_OBJECT_CLASSID; /* "petsc4py/PETSc/Log.pyx":388 * cdef readonly PetscLogClass id * * def __cinit__(self): # <<<<<<<<<<<<<< * self.id = PETSC_OBJECT_CLASSID * */ /* function exit code */ __pyx_r = 0; return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":391 * self.id = PETSC_OBJECT_CLASSID * * def __int__(self): # <<<<<<<<<<<<<< * return self.id * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogClass_3__int__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogClass_3__int__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__int__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogClass_2__int__(((struct __pyx_obj_8petsc4py_5PETSc_LogClass *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogClass_2__int__(struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__int__", 1); /* "petsc4py/PETSc/Log.pyx":392 * * def __int__(self): * return self.id # <<<<<<<<<<<<<< * * # */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(((int)__pyx_v_self->id)); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Log.pyx":391 * self.id = PETSC_OBJECT_CLASSID * * def __int__(self): # <<<<<<<<<<<<<< * return self.id * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.LogClass.__int__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":396 * # * * def getName(self): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * CHKERR( PetscLogClassFindName(self.id, &cval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogClass_5getName(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_8LogClass_4getName, "LogClass.getName(self)\nSource code at petsc4py/PETSc/Log.pyx:396"); static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogClass_5getName(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getName (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getName", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getName", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogClass_4getName(((struct __pyx_obj_8petsc4py_5PETSc_LogClass *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogClass_4getName(struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_self) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getName", 1); /* "petsc4py/PETSc/Log.pyx":397 * * def getName(self): * cdef const char *cval = NULL # <<<<<<<<<<<<<< * CHKERR( PetscLogClassFindName(self.id, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/Log.pyx":398 * def getName(self): * cdef const char *cval = NULL * CHKERR( PetscLogClassFindName(self.id, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogClassFindName(__pyx_v_self->id, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(33, 398, __pyx_L1_error) /* "petsc4py/PETSc/Log.pyx":399 * cdef const char *cval = NULL * CHKERR( PetscLogClassFindName(self.id, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * property name: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Log.pyx":396 * # * * def getName(self): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * CHKERR( PetscLogClassFindName(self.id, &cval) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.LogClass.getName", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":402 * * property name: * def __get__(self): # <<<<<<<<<<<<<< * return self.getName() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogClass_4name_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogClass_4name_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogClass_4name___get__(((struct __pyx_obj_8petsc4py_5PETSc_LogClass *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogClass_4name___get__(struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/Log.pyx":403 * property name: * def __get__(self): * return self.getName() # <<<<<<<<<<<<<< * def __set__(self, value): * self; value; # unused */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getName); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Log.pyx":402 * * property name: * def __get__(self): # <<<<<<<<<<<<<< * return self.getName() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.LogClass.name.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":404 * def __get__(self): * return self.getName() * def __set__(self, value): # <<<<<<<<<<<<<< * self; value; # unused * raise TypeError("readonly attribute") */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_8LogClass_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_8LogClass_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogClass_4name_2__set__(((struct __pyx_obj_8petsc4py_5PETSc_LogClass *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_8LogClass_4name_2__set__(struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "petsc4py/PETSc/Log.pyx":405 * return self.getName() * def __set__(self, value): * self; value; # unused # <<<<<<<<<<<<<< * raise TypeError("readonly attribute") * */ ((void)__pyx_v_self); ((void)__pyx_v_value); /* "petsc4py/PETSc/Log.pyx":406 * def __set__(self, value): * self; value; # unused * raise TypeError("readonly attribute") # <<<<<<<<<<<<<< * * # */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(33, 406, __pyx_L1_error) /* "petsc4py/PETSc/Log.pyx":404 * def __get__(self): * return self.getName() * def __set__(self, value): # <<<<<<<<<<<<<< * self; value; # unused * raise TypeError("readonly attribute") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.LogClass.name.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":410 * # * * def activate(self): # <<<<<<<<<<<<<< * CHKERR( PetscLogClassActivate(self.id) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogClass_7activate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_8LogClass_6activate, "LogClass.activate(self)\nSource code at petsc4py/PETSc/Log.pyx:410"); static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogClass_7activate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("activate (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("activate", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "activate", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogClass_6activate(((struct __pyx_obj_8petsc4py_5PETSc_LogClass *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogClass_6activate(struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("activate", 1); /* "petsc4py/PETSc/Log.pyx":411 * * def activate(self): * CHKERR( PetscLogClassActivate(self.id) ) # <<<<<<<<<<<<<< * * def deactivate(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogEventActivateClass(__pyx_v_self->id)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(33, 411, __pyx_L1_error) /* "petsc4py/PETSc/Log.pyx":410 * # * * def activate(self): # <<<<<<<<<<<<<< * CHKERR( PetscLogClassActivate(self.id) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.LogClass.activate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":413 * CHKERR( PetscLogClassActivate(self.id) ) * * def deactivate(self): # <<<<<<<<<<<<<< * CHKERR( PetscLogClassDeactivate(self.id) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogClass_9deactivate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_8LogClass_8deactivate, "LogClass.deactivate(self)\nSource code at petsc4py/PETSc/Log.pyx:413"); static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogClass_9deactivate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("deactivate (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("deactivate", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "deactivate", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogClass_8deactivate(((struct __pyx_obj_8petsc4py_5PETSc_LogClass *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogClass_8deactivate(struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("deactivate", 1); /* "petsc4py/PETSc/Log.pyx":414 * * def deactivate(self): * CHKERR( PetscLogClassDeactivate(self.id) ) # <<<<<<<<<<<<<< * * def getActive(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogEventDeactivateClass(__pyx_v_self->id)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(33, 414, __pyx_L1_error) /* "petsc4py/PETSc/Log.pyx":413 * CHKERR( PetscLogClassActivate(self.id) ) * * def deactivate(self): # <<<<<<<<<<<<<< * CHKERR( PetscLogClassDeactivate(self.id) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.LogClass.deactivate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":416 * CHKERR( PetscLogClassDeactivate(self.id) ) * * def getActive(self): # <<<<<<<<<<<<<< * self # unused * raise NotImplementedError */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogClass_11getActive(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_8LogClass_10getActive, "LogClass.getActive(self)\nSource code at petsc4py/PETSc/Log.pyx:416"); static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogClass_11getActive(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getActive (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getActive", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getActive", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogClass_10getActive(((struct __pyx_obj_8petsc4py_5PETSc_LogClass *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogClass_10getActive(struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getActive", 1); /* "petsc4py/PETSc/Log.pyx":417 * * def getActive(self): * self # unused # <<<<<<<<<<<<<< * raise NotImplementedError * */ ((void)__pyx_v_self); /* "petsc4py/PETSc/Log.pyx":418 * def getActive(self): * self # unused * raise NotImplementedError # <<<<<<<<<<<<<< * * def setActive(self, flag): */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); __PYX_ERR(33, 418, __pyx_L1_error) /* "petsc4py/PETSc/Log.pyx":416 * CHKERR( PetscLogClassDeactivate(self.id) ) * * def getActive(self): # <<<<<<<<<<<<<< * self # unused * raise NotImplementedError */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.LogClass.getActive", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":420 * raise NotImplementedError * * def setActive(self, flag): # <<<<<<<<<<<<<< * if flag: * CHKERR( PetscLogClassActivate(self.id) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogClass_13setActive(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_8LogClass_12setActive, "LogClass.setActive(self, flag)\nSource code at petsc4py/PETSc/Log.pyx:420"); static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogClass_13setActive(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_flag = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setActive (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flag)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(33, 420, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setActive") < 0)) __PYX_ERR(33, 420, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_flag = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setActive", 1, 1, 1, __pyx_nargs); __PYX_ERR(33, 420, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.LogClass.setActive", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogClass_12setActive(((struct __pyx_obj_8petsc4py_5PETSc_LogClass *)__pyx_v_self), __pyx_v_flag); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogClass_12setActive(struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_self, PyObject *__pyx_v_flag) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setActive", 1); /* "petsc4py/PETSc/Log.pyx":421 * * def setActive(self, flag): * if flag: # <<<<<<<<<<<<<< * CHKERR( PetscLogClassActivate(self.id) ) * else: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_flag); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(33, 421, __pyx_L1_error) if (__pyx_t_1) { /* "petsc4py/PETSc/Log.pyx":422 * def setActive(self, flag): * if flag: * CHKERR( PetscLogClassActivate(self.id) ) # <<<<<<<<<<<<<< * else: * CHKERR( PetscLogClassDeactivate(self.id) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogEventActivateClass(__pyx_v_self->id)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(33, 422, __pyx_L1_error) /* "petsc4py/PETSc/Log.pyx":421 * * def setActive(self, flag): * if flag: # <<<<<<<<<<<<<< * CHKERR( PetscLogClassActivate(self.id) ) * else: */ goto __pyx_L3; } /* "petsc4py/PETSc/Log.pyx":424 * CHKERR( PetscLogClassActivate(self.id) ) * else: * CHKERR( PetscLogClassDeactivate(self.id) ) # <<<<<<<<<<<<<< * * property active: */ /*else*/ { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogEventDeactivateClass(__pyx_v_self->id)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(33, 424, __pyx_L1_error) } __pyx_L3:; /* "petsc4py/PETSc/Log.pyx":420 * raise NotImplementedError * * def setActive(self, flag): # <<<<<<<<<<<<<< * if flag: * CHKERR( PetscLogClassActivate(self.id) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.LogClass.setActive", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":427 * * property active: * def __get__(self): # <<<<<<<<<<<<<< * return self.getActive() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogClass_6active_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogClass_6active_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogClass_6active___get__(((struct __pyx_obj_8petsc4py_5PETSc_LogClass *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogClass_6active___get__(struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/Log.pyx":428 * property active: * def __get__(self): * return self.getActive() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setActive(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getActive); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Log.pyx":427 * * property active: * def __get__(self): # <<<<<<<<<<<<<< * return self.getActive() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.LogClass.active.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":429 * def __get__(self): * return self.getActive() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setActive(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_8LogClass_6active_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_8LogClass_6active_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogClass_6active_2__set__(((struct __pyx_obj_8petsc4py_5PETSc_LogClass *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_8LogClass_6active_2__set__(struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "petsc4py/PETSc/Log.pyx":430 * return self.getActive() * def __set__(self, value): * self.setActive(value) # <<<<<<<<<<<<<< * * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setActive); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_value}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Log.pyx":429 * def __get__(self): * return self.getActive() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setActive(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.LogClass.active.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":386 * cdef class LogClass: * * cdef readonly PetscLogClass id # <<<<<<<<<<<<<< * * def __cinit__(self): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogClass_2id_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogClass_2id_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogClass_2id___get__(((struct __pyx_obj_8petsc4py_5PETSc_LogClass *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogClass_2id___get__(struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_PetscClassId(__pyx_v_self->id); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.LogClass.id.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":435 * cdef dict class_registry = { } * * cdef LogClass get_LogClass(object name): # <<<<<<<<<<<<<< * return class_registry.get(name) * */ static struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_f_8petsc4py_5PETSc_get_LogClass(PyObject *__pyx_v_name) { struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_LogClass", 1); /* "petsc4py/PETSc/Log.pyx":436 * * cdef LogClass get_LogClass(object name): * return class_registry.get(name) # <<<<<<<<<<<<<< * * cdef LogClass reg_LogClass(object name, PetscLogClass classid): */ __Pyx_XDECREF((PyObject *)__pyx_r); if (unlikely(__pyx_v_8petsc4py_5PETSc_class_registry == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(33, 436, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_8petsc4py_5PETSc_class_registry, __pyx_v_name, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_LogClass))))) __PYX_ERR(33, 436, __pyx_L1_error) __pyx_r = ((struct __pyx_obj_8petsc4py_5PETSc_LogClass *)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Log.pyx":435 * cdef dict class_registry = { } * * cdef LogClass get_LogClass(object name): # <<<<<<<<<<<<<< * return class_registry.get(name) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.get_LogClass", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":438 * return class_registry.get(name) * * cdef LogClass reg_LogClass(object name, PetscLogClass classid): # <<<<<<<<<<<<<< * cdef LogClass klass = LogClass() * klass.id = classid */ static struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_f_8petsc4py_5PETSc_reg_LogClass(PyObject *__pyx_v_name, PetscClassId __pyx_v_classid) { struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_klass = 0; struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("reg_LogClass", 1); /* "petsc4py/PETSc/Log.pyx":439 * * cdef LogClass reg_LogClass(object name, PetscLogClass classid): * cdef LogClass klass = LogClass() # <<<<<<<<<<<<<< * klass.id = classid * class_registry[name] = klass */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_LogClass)); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 439, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_klass = ((struct __pyx_obj_8petsc4py_5PETSc_LogClass *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Log.pyx":440 * cdef LogClass reg_LogClass(object name, PetscLogClass classid): * cdef LogClass klass = LogClass() * klass.id = classid # <<<<<<<<<<<<<< * class_registry[name] = klass * return klass */ __pyx_v_klass->id = __pyx_v_classid; /* "petsc4py/PETSc/Log.pyx":441 * cdef LogClass klass = LogClass() * klass.id = classid * class_registry[name] = klass # <<<<<<<<<<<<<< * return klass * */ if (unlikely(__pyx_v_8petsc4py_5PETSc_class_registry == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(33, 441, __pyx_L1_error) } if (unlikely((PyDict_SetItem(__pyx_v_8petsc4py_5PETSc_class_registry, __pyx_v_name, ((PyObject *)__pyx_v_klass)) < 0))) __PYX_ERR(33, 441, __pyx_L1_error) /* "petsc4py/PETSc/Log.pyx":442 * klass.id = classid * class_registry[name] = klass * return klass # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_klass); __pyx_r = __pyx_v_klass; goto __pyx_L0; /* "petsc4py/PETSc/Log.pyx":438 * return class_registry.get(name) * * cdef LogClass reg_LogClass(object name, PetscLogClass classid): # <<<<<<<<<<<<<< * cdef LogClass klass = LogClass() * klass.id = classid */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.reg_LogClass", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_klass); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":450 * cdef readonly PetscLogEvent id * * def __cinit__(self): # <<<<<<<<<<<<<< * self.id = 0 * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_8LogEvent_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_8LogEvent_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogEvent___cinit__(((struct __pyx_obj_8petsc4py_5PETSc_LogEvent *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_8LogEvent___cinit__(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self) { int __pyx_r; /* "petsc4py/PETSc/Log.pyx":451 * * def __cinit__(self): * self.id = 0 # <<<<<<<<<<<<<< * * def __int__(self): */ __pyx_v_self->id = 0; /* "petsc4py/PETSc/Log.pyx":450 * cdef readonly PetscLogEvent id * * def __cinit__(self): # <<<<<<<<<<<<<< * self.id = 0 * */ /* function exit code */ __pyx_r = 0; return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":453 * self.id = 0 * * def __int__(self): # <<<<<<<<<<<<<< * return self.id * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_3__int__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_3__int__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__int__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogEvent_2__int__(((struct __pyx_obj_8petsc4py_5PETSc_LogEvent *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_2__int__(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__int__", 1); /* "petsc4py/PETSc/Log.pyx":454 * * def __int__(self): * return self.id # <<<<<<<<<<<<<< * * def __enter__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(((int)__pyx_v_self->id)); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 454, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Log.pyx":453 * self.id = 0 * * def __int__(self): # <<<<<<<<<<<<<< * return self.id * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.LogEvent.__int__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":456 * return self.id * * def __enter__(self): # <<<<<<<<<<<<<< * self.begin() * return self */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_5__enter__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_8LogEvent_4__enter__, "LogEvent.__enter__(self)\nSource code at petsc4py/PETSc/Log.pyx:456"); static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_5__enter__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__enter__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__enter__", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogEvent_4__enter__(((struct __pyx_obj_8petsc4py_5PETSc_LogEvent *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_4__enter__(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__enter__", 1); /* "petsc4py/PETSc/Log.pyx":457 * * def __enter__(self): * self.begin() # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_begin); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 457, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 457, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Log.pyx":458 * def __enter__(self): * self.begin() * return self # <<<<<<<<<<<<<< * * def __exit__(self, *exc): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Log.pyx":456 * return self.id * * def __enter__(self): # <<<<<<<<<<<<<< * self.begin() * return self */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.LogEvent.__enter__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":460 * return self * * def __exit__(self, *exc): # <<<<<<<<<<<<<< * self.end() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_7__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_8LogEvent_6__exit__, "LogEvent.__exit__(self, *exc)\nSource code at petsc4py/PETSc/Log.pyx:460"); static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_7__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED PyObject *__pyx_v_exc = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__exit__", 0))) return NULL; __Pyx_INCREF(__pyx_args); __pyx_v_exc = __pyx_args; __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogEvent_6__exit__(((struct __pyx_obj_8petsc4py_5PETSc_LogEvent *)__pyx_v_self), __pyx_v_exc); /* function exit code */ __Pyx_DECREF(__pyx_v_exc); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_6__exit__(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__exit__", 1); /* "petsc4py/PETSc/Log.pyx":461 * * def __exit__(self, *exc): * self.end() # <<<<<<<<<<<<<< * * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_end); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 461, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 461, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Log.pyx":460 * return self * * def __exit__(self, *exc): # <<<<<<<<<<<<<< * self.end() * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.LogEvent.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":465 * * * def begin(self, *objs) -> None: # <<<<<<<<<<<<<< * """Log the beginning of a user event. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_9begin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_8LogEvent_8begin, "LogEvent.begin(self, *objs) -> None\nLog the beginning of a user event.\n\n Collective.\n\n Parameters\n ----------\n *objs\n objects associated with the event\n\n See Also\n --------\n petsc.PetscLogEventBegin\n\n \nSource code at petsc4py/PETSc/Log.pyx:465"); static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_9begin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_objs = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("begin (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "begin", 0))) return NULL; __Pyx_INCREF(__pyx_args); __pyx_v_objs = __pyx_args; __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogEvent_8begin(((struct __pyx_obj_8petsc4py_5PETSc_LogEvent *)__pyx_v_self), __pyx_v_objs); /* function exit code */ __Pyx_DECREF(__pyx_v_objs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_8begin(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self, PyObject *__pyx_v_objs) { PetscObject __pyx_v_o[4]; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("begin", 1); /* "petsc4py/PETSc/Log.pyx":481 * """ * cdef PetscObject o[4] * event_args2objs(objs, o) # <<<<<<<<<<<<<< * CHKERR( PetscLogEventBegin(self.id, o[0], o[1], o[2], o[3]) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_event_args2objs(__pyx_v_objs, __pyx_v_o); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(33, 481, __pyx_L1_error) /* "petsc4py/PETSc/Log.pyx":482 * cdef PetscObject o[4] * event_args2objs(objs, o) * CHKERR( PetscLogEventBegin(self.id, o[0], o[1], o[2], o[3]) ) # <<<<<<<<<<<<<< * * def end(self, *objs) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogEventBegin(__pyx_v_self->id, (__pyx_v_o[0]), (__pyx_v_o[1]), (__pyx_v_o[2]), (__pyx_v_o[3]))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(33, 482, __pyx_L1_error) /* "petsc4py/PETSc/Log.pyx":465 * * * def begin(self, *objs) -> None: # <<<<<<<<<<<<<< * """Log the beginning of a user event. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.LogEvent.begin", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":484 * CHKERR( PetscLogEventBegin(self.id, o[0], o[1], o[2], o[3]) ) * * def end(self, *objs) -> None: # <<<<<<<<<<<<<< * """Log the end of a user event. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_11end(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_8LogEvent_10end, "LogEvent.end(self, *objs) -> None\nLog the end of a user event.\n\n Collective.\n\n Parameters\n ----------\n *objs\n Objects associated with the event.\n\n See Also\n --------\n petsc.PetscLogEventEnd\n\n \nSource code at petsc4py/PETSc/Log.pyx:484"); static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_11end(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_objs = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("end (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "end", 0))) return NULL; __Pyx_INCREF(__pyx_args); __pyx_v_objs = __pyx_args; __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogEvent_10end(((struct __pyx_obj_8petsc4py_5PETSc_LogEvent *)__pyx_v_self), __pyx_v_objs); /* function exit code */ __Pyx_DECREF(__pyx_v_objs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_10end(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self, PyObject *__pyx_v_objs) { PetscObject __pyx_v_o[4]; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("end", 1); /* "petsc4py/PETSc/Log.pyx":500 * """ * cdef PetscObject o[4] * event_args2objs(objs, o) # <<<<<<<<<<<<<< * CHKERR( PetscLogEventEnd(self.id, o[0], o[1], o[2], o[3]) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_event_args2objs(__pyx_v_objs, __pyx_v_o); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(33, 500, __pyx_L1_error) /* "petsc4py/PETSc/Log.pyx":501 * cdef PetscObject o[4] * event_args2objs(objs, o) * CHKERR( PetscLogEventEnd(self.id, o[0], o[1], o[2], o[3]) ) # <<<<<<<<<<<<<< * * # */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogEventEnd(__pyx_v_self->id, (__pyx_v_o[0]), (__pyx_v_o[1]), (__pyx_v_o[2]), (__pyx_v_o[3]))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(33, 501, __pyx_L1_error) /* "petsc4py/PETSc/Log.pyx":484 * CHKERR( PetscLogEventBegin(self.id, o[0], o[1], o[2], o[3]) ) * * def end(self, *objs) -> None: # <<<<<<<<<<<<<< * """Log the end of a user event. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.LogEvent.end", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":504 * * # * def getName(self): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * CHKERR( PetscLogEventFindName(self.id, &cval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_13getName(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_8LogEvent_12getName, "LogEvent.getName(self)\nSource code at petsc4py/PETSc/Log.pyx:504"); static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_13getName(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getName (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getName", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getName", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogEvent_12getName(((struct __pyx_obj_8petsc4py_5PETSc_LogEvent *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_12getName(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getName", 1); /* "petsc4py/PETSc/Log.pyx":505 * # * def getName(self): * cdef const char *cval = NULL # <<<<<<<<<<<<<< * CHKERR( PetscLogEventFindName(self.id, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/Log.pyx":506 * def getName(self): * cdef const char *cval = NULL * CHKERR( PetscLogEventFindName(self.id, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogEventFindName(__pyx_v_self->id, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(33, 506, __pyx_L1_error) /* "petsc4py/PETSc/Log.pyx":507 * cdef const char *cval = NULL * CHKERR( PetscLogEventFindName(self.id, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * property name: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 507, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Log.pyx":504 * * # * def getName(self): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * CHKERR( PetscLogEventFindName(self.id, &cval) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.LogEvent.getName", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":510 * * property name: * def __get__(self): # <<<<<<<<<<<<<< * return self.getName() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_4name_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_4name_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogEvent_4name___get__(((struct __pyx_obj_8petsc4py_5PETSc_LogEvent *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_4name___get__(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/Log.pyx":511 * property name: * def __get__(self): * return self.getName() # <<<<<<<<<<<<<< * def __set__(self, value): * self; value; # unused */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getName); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 511, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 511, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Log.pyx":510 * * property name: * def __get__(self): # <<<<<<<<<<<<<< * return self.getName() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.LogEvent.name.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":512 * def __get__(self): * return self.getName() * def __set__(self, value): # <<<<<<<<<<<<<< * self; value; # unused * raise TypeError("readonly attribute") */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_8LogEvent_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_8LogEvent_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogEvent_4name_2__set__(((struct __pyx_obj_8petsc4py_5PETSc_LogEvent *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_8LogEvent_4name_2__set__(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "petsc4py/PETSc/Log.pyx":513 * return self.getName() * def __set__(self, value): * self; value; # unused # <<<<<<<<<<<<<< * raise TypeError("readonly attribute") * */ ((void)__pyx_v_self); ((void)__pyx_v_value); /* "petsc4py/PETSc/Log.pyx":514 * def __set__(self, value): * self; value; # unused * raise TypeError("readonly attribute") # <<<<<<<<<<<<<< * * # */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(33, 514, __pyx_L1_error) /* "petsc4py/PETSc/Log.pyx":512 * def __get__(self): * return self.getName() * def __set__(self, value): # <<<<<<<<<<<<<< * self; value; # unused * raise TypeError("readonly attribute") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.LogEvent.name.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":518 * # * * def activate(self) -> None: # <<<<<<<<<<<<<< * """Indicate that the event should be logged. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_15activate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_8LogEvent_14activate, "LogEvent.activate(self) -> None\nIndicate that the event should be logged.\n\n Logically collective.\n\n See Also\n --------\n petsc.PetscLogEventActivate\n\n \nSource code at petsc4py/PETSc/Log.pyx:518"); static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_15activate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("activate (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("activate", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "activate", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogEvent_14activate(((struct __pyx_obj_8petsc4py_5PETSc_LogEvent *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_14activate(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("activate", 1); /* "petsc4py/PETSc/Log.pyx":528 * * """ * CHKERR( PetscLogEventActivate(self.id) ) # <<<<<<<<<<<<<< * * def deactivate(self) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogEventActivate(__pyx_v_self->id)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(33, 528, __pyx_L1_error) /* "petsc4py/PETSc/Log.pyx":518 * # * * def activate(self) -> None: # <<<<<<<<<<<<<< * """Indicate that the event should be logged. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.LogEvent.activate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":530 * CHKERR( PetscLogEventActivate(self.id) ) * * def deactivate(self) -> None: # <<<<<<<<<<<<<< * """Indicate that the event should not be logged. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_17deactivate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_8LogEvent_16deactivate, "LogEvent.deactivate(self) -> None\nIndicate that the event should not be logged.\n\n Logically collective.\n\n See Also\n --------\n petsc.PetscLogEventDeactivate\n\n \nSource code at petsc4py/PETSc/Log.pyx:530"); static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_17deactivate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("deactivate (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("deactivate", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "deactivate", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogEvent_16deactivate(((struct __pyx_obj_8petsc4py_5PETSc_LogEvent *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_16deactivate(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("deactivate", 1); /* "petsc4py/PETSc/Log.pyx":540 * * """ * CHKERR( PetscLogEventDeactivate(self.id) ) # <<<<<<<<<<<<<< * * def getActive(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogEventDeactivate(__pyx_v_self->id)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(33, 540, __pyx_L1_error) /* "petsc4py/PETSc/Log.pyx":530 * CHKERR( PetscLogEventActivate(self.id) ) * * def deactivate(self) -> None: # <<<<<<<<<<<<<< * """Indicate that the event should not be logged. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.LogEvent.deactivate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":542 * CHKERR( PetscLogEventDeactivate(self.id) ) * * def getActive(self): # <<<<<<<<<<<<<< * self # unused * raise NotImplementedError */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_19getActive(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_8LogEvent_18getActive, "LogEvent.getActive(self)\nSource code at petsc4py/PETSc/Log.pyx:542"); static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_19getActive(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getActive (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getActive", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getActive", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogEvent_18getActive(((struct __pyx_obj_8petsc4py_5PETSc_LogEvent *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_18getActive(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getActive", 1); /* "petsc4py/PETSc/Log.pyx":543 * * def getActive(self): * self # unused # <<<<<<<<<<<<<< * raise NotImplementedError * */ ((void)__pyx_v_self); /* "petsc4py/PETSc/Log.pyx":544 * def getActive(self): * self # unused * raise NotImplementedError # <<<<<<<<<<<<<< * * def setActive(self, flag: bool) -> None: */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); __PYX_ERR(33, 544, __pyx_L1_error) /* "petsc4py/PETSc/Log.pyx":542 * CHKERR( PetscLogEventDeactivate(self.id) ) * * def getActive(self): # <<<<<<<<<<<<<< * self # unused * raise NotImplementedError */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.LogEvent.getActive", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":546 * raise NotImplementedError * * def setActive(self, flag: bool) -> None: # <<<<<<<<<<<<<< * """Indicate whether or not the event should be logged. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_21setActive(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_8LogEvent_20setActive, "LogEvent.setActive(self, flag: bool) -> None\nIndicate whether or not the event should be logged.\n\n Logically collective.\n\n Parameters\n ----------\n flag\n Activate or deactivate the event.\n\n See Also\n --------\n petsc.PetscLogEventDeactivate, petsc.PetscLogEventActivate\n\n \nSource code at petsc4py/PETSc/Log.pyx:546"); static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_21setActive(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_flag = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setActive (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flag)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(33, 546, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setActive") < 0)) __PYX_ERR(33, 546, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_flag = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setActive", 1, 1, 1, __pyx_nargs); __PYX_ERR(33, 546, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.LogEvent.setActive", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogEvent_20setActive(((struct __pyx_obj_8petsc4py_5PETSc_LogEvent *)__pyx_v_self), __pyx_v_flag); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_20setActive(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self, PyObject *__pyx_v_flag) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setActive", 1); /* "petsc4py/PETSc/Log.pyx":561 * * """ * if flag: # <<<<<<<<<<<<<< * CHKERR( PetscLogEventActivate(self.id) ) * else: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_flag); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(33, 561, __pyx_L1_error) if (__pyx_t_1) { /* "petsc4py/PETSc/Log.pyx":562 * """ * if flag: * CHKERR( PetscLogEventActivate(self.id) ) # <<<<<<<<<<<<<< * else: * CHKERR( PetscLogEventDeactivate(self.id) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogEventActivate(__pyx_v_self->id)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(33, 562, __pyx_L1_error) /* "petsc4py/PETSc/Log.pyx":561 * * """ * if flag: # <<<<<<<<<<<<<< * CHKERR( PetscLogEventActivate(self.id) ) * else: */ goto __pyx_L3; } /* "petsc4py/PETSc/Log.pyx":564 * CHKERR( PetscLogEventActivate(self.id) ) * else: * CHKERR( PetscLogEventDeactivate(self.id) ) # <<<<<<<<<<<<<< * * property active: */ /*else*/ { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogEventDeactivate(__pyx_v_self->id)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(33, 564, __pyx_L1_error) } __pyx_L3:; /* "petsc4py/PETSc/Log.pyx":546 * raise NotImplementedError * * def setActive(self, flag: bool) -> None: # <<<<<<<<<<<<<< * """Indicate whether or not the event should be logged. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.LogEvent.setActive", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":567 * * property active: * def __get__(self): # <<<<<<<<<<<<<< * return self.getActive() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_6active_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_6active_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogEvent_6active___get__(((struct __pyx_obj_8petsc4py_5PETSc_LogEvent *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_6active___get__(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/Log.pyx":568 * property active: * def __get__(self): * return self.getActive() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setActive(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getActive); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Log.pyx":567 * * property active: * def __get__(self): # <<<<<<<<<<<<<< * return self.getActive() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.LogEvent.active.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":569 * def __get__(self): * return self.getActive() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setActive(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_8LogEvent_6active_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_8LogEvent_6active_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogEvent_6active_2__set__(((struct __pyx_obj_8petsc4py_5PETSc_LogEvent *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_8LogEvent_6active_2__set__(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "petsc4py/PETSc/Log.pyx":570 * return self.getActive() * def __set__(self, value): * self.setActive(value) # <<<<<<<<<<<<<< * * def getActiveAll(self): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setActive); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 570, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_value}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 570, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Log.pyx":569 * def __get__(self): * return self.getActive() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setActive(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.LogEvent.active.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":572 * self.setActive(value) * * def getActiveAll(self): # <<<<<<<<<<<<<< * self # unused * raise NotImplementedError */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_23getActiveAll(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_8LogEvent_22getActiveAll, "LogEvent.getActiveAll(self)\nSource code at petsc4py/PETSc/Log.pyx:572"); static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_23getActiveAll(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getActiveAll (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getActiveAll", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getActiveAll", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogEvent_22getActiveAll(((struct __pyx_obj_8petsc4py_5PETSc_LogEvent *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_22getActiveAll(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getActiveAll", 1); /* "petsc4py/PETSc/Log.pyx":573 * * def getActiveAll(self): * self # unused # <<<<<<<<<<<<<< * raise NotImplementedError * */ ((void)__pyx_v_self); /* "petsc4py/PETSc/Log.pyx":574 * def getActiveAll(self): * self # unused * raise NotImplementedError # <<<<<<<<<<<<<< * * def setActiveAll(self, flag: bool) -> None: */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); __PYX_ERR(33, 574, __pyx_L1_error) /* "petsc4py/PETSc/Log.pyx":572 * self.setActive(value) * * def getActiveAll(self): # <<<<<<<<<<<<<< * self # unused * raise NotImplementedError */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.LogEvent.getActiveAll", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":576 * raise NotImplementedError * * def setActiveAll(self, flag: bool) -> None: # <<<<<<<<<<<<<< * """Turn on logging of all events. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_25setActiveAll(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_8LogEvent_24setActiveAll, "LogEvent.setActiveAll(self, flag: bool) -> None\nTurn on logging of all events.\n\n Logically collective.\n\n Parameters\n ----------\n flag\n Activate (if `True`) or deactivate (if `False`) the logging of all events.\n\n See Also\n --------\n petsc.PetscLogEventSetActiveAll\n\n \nSource code at petsc4py/PETSc/Log.pyx:576"); static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_25setActiveAll(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_flag = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setActiveAll (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flag)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(33, 576, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setActiveAll") < 0)) __PYX_ERR(33, 576, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_flag = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setActiveAll", 1, 1, 1, __pyx_nargs); __PYX_ERR(33, 576, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.LogEvent.setActiveAll", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogEvent_24setActiveAll(((struct __pyx_obj_8petsc4py_5PETSc_LogEvent *)__pyx_v_self), __pyx_v_flag); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_24setActiveAll(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self, PyObject *__pyx_v_flag) { PetscBool __pyx_v_tval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setActiveAll", 1); /* "petsc4py/PETSc/Log.pyx":591 * * """ * cdef PetscBool tval = PETSC_FALSE # <<<<<<<<<<<<<< * if flag: tval = PETSC_TRUE * CHKERR( PetscLogEventSetActiveAll(self.id, tval) ) */ __pyx_v_tval = PETSC_FALSE; /* "petsc4py/PETSc/Log.pyx":592 * """ * cdef PetscBool tval = PETSC_FALSE * if flag: tval = PETSC_TRUE # <<<<<<<<<<<<<< * CHKERR( PetscLogEventSetActiveAll(self.id, tval) ) * */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_flag); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(33, 592, __pyx_L1_error) if (__pyx_t_1) { __pyx_v_tval = PETSC_TRUE; } /* "petsc4py/PETSc/Log.pyx":593 * cdef PetscBool tval = PETSC_FALSE * if flag: tval = PETSC_TRUE * CHKERR( PetscLogEventSetActiveAll(self.id, tval) ) # <<<<<<<<<<<<<< * * property active_all: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogEventSetActiveAll(__pyx_v_self->id, __pyx_v_tval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(33, 593, __pyx_L1_error) /* "petsc4py/PETSc/Log.pyx":576 * raise NotImplementedError * * def setActiveAll(self, flag: bool) -> None: # <<<<<<<<<<<<<< * """Turn on logging of all events. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.LogEvent.setActiveAll", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":596 * * property active_all: * def __get__(self): # <<<<<<<<<<<<<< * self.getActiveAll() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_10active_all_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_10active_all_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogEvent_10active_all___get__(((struct __pyx_obj_8petsc4py_5PETSc_LogEvent *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_10active_all___get__(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/Log.pyx":597 * property active_all: * def __get__(self): * self.getActiveAll() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setActiveAll(value) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getActiveAll); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 597, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 597, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Log.pyx":596 * * property active_all: * def __get__(self): # <<<<<<<<<<<<<< * self.getActiveAll() * def __set__(self, value): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.LogEvent.active_all.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":598 * def __get__(self): * self.getActiveAll() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setActiveAll(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_8LogEvent_10active_all_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_8LogEvent_10active_all_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogEvent_10active_all_2__set__(((struct __pyx_obj_8petsc4py_5PETSc_LogEvent *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_8LogEvent_10active_all_2__set__(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "petsc4py/PETSc/Log.pyx":599 * self.getActiveAll() * def __set__(self, value): * self.setActiveAll(value) # <<<<<<<<<<<<<< * * # */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setActiveAll); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_value}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Log.pyx":598 * def __get__(self): * self.getActiveAll() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setActiveAll(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.LogEvent.active_all.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":603 * # * * def getPerfInfo(self, stage: int | None = None) -> dict: # <<<<<<<<<<<<<< * """Get the performance information about the given event in the given event. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_27getPerfInfo(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_8LogEvent_26getPerfInfo, "LogEvent.getPerfInfo(self, stage: int | None = None) -> dict\nGet the performance information about the given event in the given event.\n\n Not collective.\n\n Parameters\n ----------\n stage\n The stage number.\n\n Returns\n -------\n info : dict\n This structure is filled with the performance information.\n\n See Also\n --------\n petsc.PetscLogEventGetPerfInfo\n\n \nSource code at petsc4py/PETSc/Log.pyx:603"); static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_27getPerfInfo(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_stage = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getPerfInfo (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stage,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_stage); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(33, 603, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getPerfInfo") < 0)) __PYX_ERR(33, 603, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_stage = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getPerfInfo", 0, 0, 1, __pyx_nargs); __PYX_ERR(33, 603, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.LogEvent.getPerfInfo", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogEvent_26getPerfInfo(((struct __pyx_obj_8petsc4py_5PETSc_LogEvent *)__pyx_v_self), __pyx_v_stage); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_26getPerfInfo(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self, PyObject *__pyx_v_stage) { PetscEventPerfInfo __pyx_v_info; PetscInt __pyx_v_cstage; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscInt __pyx_t_2; PetscErrorCode __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getPerfInfo", 1); /* "petsc4py/PETSc/Log.pyx":624 * """ * cdef PetscEventPerfInfo info * cdef PetscInt cstage = PETSC_DETERMINE # <<<<<<<<<<<<<< * if stage is not None: cstage = asInt(stage) * CHKERR( PetscLogEventGetPerfInfo(cstage, self.id, &info) ) */ __pyx_v_cstage = PETSC_DETERMINE; /* "petsc4py/PETSc/Log.pyx":625 * cdef PetscEventPerfInfo info * cdef PetscInt cstage = PETSC_DETERMINE * if stage is not None: cstage = asInt(stage) # <<<<<<<<<<<<<< * CHKERR( PetscLogEventGetPerfInfo(cstage, self.id, &info) ) * return info */ __pyx_t_1 = (__pyx_v_stage != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_stage); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(33, 625, __pyx_L1_error) __pyx_v_cstage = __pyx_t_2; } /* "petsc4py/PETSc/Log.pyx":626 * cdef PetscInt cstage = PETSC_DETERMINE * if stage is not None: cstage = asInt(stage) * CHKERR( PetscLogEventGetPerfInfo(cstage, self.id, &info) ) # <<<<<<<<<<<<<< * return info * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogEventGetPerfInfo(__pyx_v_cstage, __pyx_v_self->id, (&__pyx_v_info))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(33, 626, __pyx_L1_error) /* "petsc4py/PETSc/Log.pyx":627 * if stage is not None: cstage = asInt(stage) * CHKERR( PetscLogEventGetPerfInfo(cstage, self.id, &info) ) * return info # <<<<<<<<<<<<<< * * cdef dict event_registry = { } */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __pyx_convert__to_py_PetscEventPerfInfo(__pyx_v_info); if (unlikely(!__pyx_t_4)) __PYX_ERR(33, 627, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Log.pyx":603 * # * * def getPerfInfo(self, stage: int | None = None) -> dict: # <<<<<<<<<<<<<< * """Get the performance information about the given event in the given event. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.LogEvent.getPerfInfo", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":448 * cdef class LogEvent: * * cdef readonly PetscLogEvent id # <<<<<<<<<<<<<< * * def __cinit__(self): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_2id_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_2id_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogEvent_2id___get__(((struct __pyx_obj_8petsc4py_5PETSc_LogEvent *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_2id___get__(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_PetscLogEvent(__pyx_v_self->id); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 448, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.LogEvent.id.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":631 * cdef dict event_registry = { } * * cdef LogEvent get_LogEvent(object name): # <<<<<<<<<<<<<< * return event_registry.get(name) * */ static struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_f_8petsc4py_5PETSc_get_LogEvent(PyObject *__pyx_v_name) { struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_LogEvent", 1); /* "petsc4py/PETSc/Log.pyx":632 * * cdef LogEvent get_LogEvent(object name): * return event_registry.get(name) # <<<<<<<<<<<<<< * * cdef LogEvent reg_LogEvent(object name, PetscLogEvent eventid): */ __Pyx_XDECREF((PyObject *)__pyx_r); if (unlikely(__pyx_v_8petsc4py_5PETSc_event_registry == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(33, 632, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_8petsc4py_5PETSc_event_registry, __pyx_v_name, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 632, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_LogEvent))))) __PYX_ERR(33, 632, __pyx_L1_error) __pyx_r = ((struct __pyx_obj_8petsc4py_5PETSc_LogEvent *)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Log.pyx":631 * cdef dict event_registry = { } * * cdef LogEvent get_LogEvent(object name): # <<<<<<<<<<<<<< * return event_registry.get(name) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.get_LogEvent", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Log.pyx":634 * return event_registry.get(name) * * cdef LogEvent reg_LogEvent(object name, PetscLogEvent eventid): # <<<<<<<<<<<<<< * cdef LogEvent event = LogEvent() * event.id = eventid */ static struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_f_8petsc4py_5PETSc_reg_LogEvent(PyObject *__pyx_v_name, PetscLogEvent __pyx_v_eventid) { struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_event = 0; struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("reg_LogEvent", 1); /* "petsc4py/PETSc/Log.pyx":635 * * cdef LogEvent reg_LogEvent(object name, PetscLogEvent eventid): * cdef LogEvent event = LogEvent() # <<<<<<<<<<<<<< * event.id = eventid * event_registry[name] = event */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_LogEvent)); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 635, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_event = ((struct __pyx_obj_8petsc4py_5PETSc_LogEvent *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Log.pyx":636 * cdef LogEvent reg_LogEvent(object name, PetscLogEvent eventid): * cdef LogEvent event = LogEvent() * event.id = eventid # <<<<<<<<<<<<<< * event_registry[name] = event * return event */ __pyx_v_event->id = __pyx_v_eventid; /* "petsc4py/PETSc/Log.pyx":637 * cdef LogEvent event = LogEvent() * event.id = eventid * event_registry[name] = event # <<<<<<<<<<<<<< * return event * */ if (unlikely(__pyx_v_8petsc4py_5PETSc_event_registry == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(33, 637, __pyx_L1_error) } if (unlikely((PyDict_SetItem(__pyx_v_8petsc4py_5PETSc_event_registry, __pyx_v_name, ((PyObject *)__pyx_v_event)) < 0))) __PYX_ERR(33, 637, __pyx_L1_error) /* "petsc4py/PETSc/Log.pyx":638 * event.id = eventid * event_registry[name] = event * return event # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_event); __pyx_r = __pyx_v_event; goto __pyx_L0; /* "petsc4py/PETSc/Log.pyx":634 * return event_registry.get(name) * * cdef LogEvent reg_LogEvent(object name, PetscLogEvent eventid): # <<<<<<<<<<<<<< * cdef LogEvent event = LogEvent() * event.id = eventid */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.reg_LogEvent", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_event); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Comm.pyx":23 * # * * def __cinit__(self, comm=None): # <<<<<<<<<<<<<< * self.comm = def_Comm(comm, MPI_COMM_NULL) * self.isdup = 0 */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_4Comm_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_4Comm_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_comm = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0}; values[0] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[0] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(34, 23, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__cinit__") < 0)) __PYX_ERR(34, 23, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_comm = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 1, __pyx_nargs); __PYX_ERR(34, 23, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Comm.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4Comm___cinit__(((struct PyPetscCommObject *)__pyx_v_self), __pyx_v_comm); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_4Comm___cinit__(struct PyPetscCommObject *__pyx_v_self, PyObject *__pyx_v_comm) { int __pyx_r; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 1); /* "petsc4py/PETSc/Comm.pyx":24 * * def __cinit__(self, comm=None): * self.comm = def_Comm(comm, MPI_COMM_NULL) # <<<<<<<<<<<<<< * self.isdup = 0 * if self.comm != MPI_COMM_NULL: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, MPI_COMM_NULL); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(34, 24, __pyx_L1_error) __pyx_v_self->comm = __pyx_t_1; /* "petsc4py/PETSc/Comm.pyx":25 * def __cinit__(self, comm=None): * self.comm = def_Comm(comm, MPI_COMM_NULL) * self.isdup = 0 # <<<<<<<<<<<<<< * if self.comm != MPI_COMM_NULL: * self.base = comm */ __pyx_v_self->isdup = 0; /* "petsc4py/PETSc/Comm.pyx":26 * self.comm = def_Comm(comm, MPI_COMM_NULL) * self.isdup = 0 * if self.comm != MPI_COMM_NULL: # <<<<<<<<<<<<<< * self.base = comm * else: */ __pyx_t_2 = (__pyx_v_self->comm != MPI_COMM_NULL); if (__pyx_t_2) { /* "petsc4py/PETSc/Comm.pyx":27 * self.isdup = 0 * if self.comm != MPI_COMM_NULL: * self.base = comm # <<<<<<<<<<<<<< * else: * self.base = None */ __Pyx_INCREF(__pyx_v_comm); __Pyx_GIVEREF(__pyx_v_comm); __Pyx_GOTREF(__pyx_v_self->base); __Pyx_DECREF(__pyx_v_self->base); __pyx_v_self->base = __pyx_v_comm; /* "petsc4py/PETSc/Comm.pyx":26 * self.comm = def_Comm(comm, MPI_COMM_NULL) * self.isdup = 0 * if self.comm != MPI_COMM_NULL: # <<<<<<<<<<<<<< * self.base = comm * else: */ goto __pyx_L3; } /* "petsc4py/PETSc/Comm.pyx":29 * self.base = comm * else: * self.base = None # <<<<<<<<<<<<<< * * def __dealloc__(self): */ /*else*/ { __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->base); __Pyx_DECREF(__pyx_v_self->base); __pyx_v_self->base = Py_None; } __pyx_L3:; /* "petsc4py/PETSc/Comm.pyx":23 * # * * def __cinit__(self, comm=None): # <<<<<<<<<<<<<< * self.comm = def_Comm(comm, MPI_COMM_NULL) * self.isdup = 0 */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Comm.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Comm.pyx":31 * self.base = None * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self.isdup: * CHKERR( PetscCommDEALLOC(&self.comm) ) */ /* Python wrapper */ static void __pyx_pw_8petsc4py_5PETSc_4Comm_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_8petsc4py_5PETSc_4Comm_3__dealloc__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_pf_8petsc4py_5PETSc_4Comm_2__dealloc__(((struct PyPetscCommObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_8petsc4py_5PETSc_4Comm_2__dealloc__(struct PyPetscCommObject *__pyx_v_self) { __Pyx_RefNannyDeclarations int __pyx_t_1; PetscErrorCode __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__dealloc__", 1); /* "petsc4py/PETSc/Comm.pyx":32 * * def __dealloc__(self): * if self.isdup: # <<<<<<<<<<<<<< * CHKERR( PetscCommDEALLOC(&self.comm) ) * self.comm = MPI_COMM_NULL */ __pyx_t_1 = (__pyx_v_self->isdup != 0); if (__pyx_t_1) { /* "petsc4py/PETSc/Comm.pyx":33 * def __dealloc__(self): * if self.isdup: * CHKERR( PetscCommDEALLOC(&self.comm) ) # <<<<<<<<<<<<<< * self.comm = MPI_COMM_NULL * self.isdup = 0 */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_PetscCommDEALLOC((&__pyx_v_self->comm)); if (unlikely(PyErr_Occurred())) __PYX_ERR(34, 33, __pyx_L1_error) __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_t_2); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(34, 33, __pyx_L1_error) /* "petsc4py/PETSc/Comm.pyx":32 * * def __dealloc__(self): * if self.isdup: # <<<<<<<<<<<<<< * CHKERR( PetscCommDEALLOC(&self.comm) ) * self.comm = MPI_COMM_NULL */ } /* "petsc4py/PETSc/Comm.pyx":34 * if self.isdup: * CHKERR( PetscCommDEALLOC(&self.comm) ) * self.comm = MPI_COMM_NULL # <<<<<<<<<<<<<< * self.isdup = 0 * self.base = None */ __pyx_v_self->comm = MPI_COMM_NULL; /* "petsc4py/PETSc/Comm.pyx":35 * CHKERR( PetscCommDEALLOC(&self.comm) ) * self.comm = MPI_COMM_NULL * self.isdup = 0 # <<<<<<<<<<<<<< * self.base = None * */ __pyx_v_self->isdup = 0; /* "petsc4py/PETSc/Comm.pyx":36 * self.comm = MPI_COMM_NULL * self.isdup = 0 * self.base = None # <<<<<<<<<<<<<< * * def __richcmp__(self, other, int op): */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->base); __Pyx_DECREF(__pyx_v_self->base); __pyx_v_self->base = Py_None; /* "petsc4py/PETSc/Comm.pyx":31 * self.base = None * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self.isdup: * CHKERR( PetscCommDEALLOC(&self.comm) ) */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_WriteUnraisable("petsc4py.PETSc.Comm.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_L0:; __Pyx_RefNannyFinishContext(); } /* "petsc4py/PETSc/Comm.pyx":38 * self.base = None * * def __richcmp__(self, other, int op): # <<<<<<<<<<<<<< * if not isinstance(self, Comm): return NotImplemented * if not isinstance(other, Comm): return NotImplemented */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4Comm_5__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4Comm_5__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__richcmp__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4Comm_4__richcmp__(((struct PyPetscCommObject *)__pyx_v_self), ((PyObject *)__pyx_v_other), ((int)__pyx_v_op)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4Comm_4__richcmp__(struct PyPetscCommObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op) { struct PyPetscCommObject *__pyx_v_s = 0; struct PyPetscCommObject *__pyx_v_o = 0; int __pyx_v_eq; MPI_Comm __pyx_v_comm1; MPI_Comm __pyx_v_comm2; int __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; MPI_Comm __pyx_t_4; PetscErrorCode __pyx_t_5; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__richcmp__", 1); /* "petsc4py/PETSc/Comm.pyx":39 * * def __richcmp__(self, other, int op): * if not isinstance(self, Comm): return NotImplemented # <<<<<<<<<<<<<< * if not isinstance(other, Comm): return NotImplemented * if op!=2 and op!=3: raise TypeError("only '==' and '!='") */ __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_self), __pyx_ptype_8petsc4py_5PETSc_Comm); __pyx_t_2 = (!__pyx_t_1); if (__pyx_t_2) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_builtin_NotImplemented); __pyx_r = __pyx_builtin_NotImplemented; goto __pyx_L0; } /* "petsc4py/PETSc/Comm.pyx":40 * def __richcmp__(self, other, int op): * if not isinstance(self, Comm): return NotImplemented * if not isinstance(other, Comm): return NotImplemented # <<<<<<<<<<<<<< * if op!=2 and op!=3: raise TypeError("only '==' and '!='") * cdef Comm s = self */ __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Comm); __pyx_t_1 = (!__pyx_t_2); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_builtin_NotImplemented); __pyx_r = __pyx_builtin_NotImplemented; goto __pyx_L0; } /* "petsc4py/PETSc/Comm.pyx":41 * if not isinstance(self, Comm): return NotImplemented * if not isinstance(other, Comm): return NotImplemented * if op!=2 and op!=3: raise TypeError("only '==' and '!='") # <<<<<<<<<<<<<< * cdef Comm s = self * cdef Comm o = other */ __pyx_t_2 = (__pyx_v_op != 2); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; } __pyx_t_2 = (__pyx_v_op != 3); __pyx_t_1 = __pyx_t_2; __pyx_L6_bool_binop_done:; if (unlikely(__pyx_t_1)) { __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(34, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(34, 41, __pyx_L1_error) } /* "petsc4py/PETSc/Comm.pyx":42 * if not isinstance(other, Comm): return NotImplemented * if op!=2 and op!=3: raise TypeError("only '==' and '!='") * cdef Comm s = self # <<<<<<<<<<<<<< * cdef Comm o = other * cdef int eq = (op == 2) */ __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_v_s = __pyx_v_self; /* "petsc4py/PETSc/Comm.pyx":43 * if op!=2 and op!=3: raise TypeError("only '==' and '!='") * cdef Comm s = self * cdef Comm o = other # <<<<<<<<<<<<<< * cdef int eq = (op == 2) * cdef MPI_Comm comm1 = s.comm */ if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Comm))))) __PYX_ERR(34, 43, __pyx_L1_error) __pyx_t_3 = __pyx_v_other; __Pyx_INCREF(__pyx_t_3); __pyx_v_o = ((struct PyPetscCommObject *)__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/Comm.pyx":44 * cdef Comm s = self * cdef Comm o = other * cdef int eq = (op == 2) # <<<<<<<<<<<<<< * cdef MPI_Comm comm1 = s.comm * cdef MPI_Comm comm2 = o.comm */ __pyx_v_eq = (__pyx_v_op == 2); /* "petsc4py/PETSc/Comm.pyx":45 * cdef Comm o = other * cdef int eq = (op == 2) * cdef MPI_Comm comm1 = s.comm # <<<<<<<<<<<<<< * cdef MPI_Comm comm2 = o.comm * cdef int flag = 0 */ __pyx_t_4 = __pyx_v_s->comm; __pyx_v_comm1 = __pyx_t_4; /* "petsc4py/PETSc/Comm.pyx":46 * cdef int eq = (op == 2) * cdef MPI_Comm comm1 = s.comm * cdef MPI_Comm comm2 = o.comm # <<<<<<<<<<<<<< * cdef int flag = 0 * if comm1 != MPI_COMM_NULL and comm2 != MPI_COMM_NULL: */ __pyx_t_4 = __pyx_v_o->comm; __pyx_v_comm2 = __pyx_t_4; /* "petsc4py/PETSc/Comm.pyx":47 * cdef MPI_Comm comm1 = s.comm * cdef MPI_Comm comm2 = o.comm * cdef int flag = 0 # <<<<<<<<<<<<<< * if comm1 != MPI_COMM_NULL and comm2 != MPI_COMM_NULL: * CHKERR( MPI_Comm_compare(comm1, comm2, &flag) ) */ __pyx_v_flag = 0; /* "petsc4py/PETSc/Comm.pyx":48 * cdef MPI_Comm comm2 = o.comm * cdef int flag = 0 * if comm1 != MPI_COMM_NULL and comm2 != MPI_COMM_NULL: # <<<<<<<<<<<<<< * CHKERR( MPI_Comm_compare(comm1, comm2, &flag) ) * if eq: return (flag==MPI_IDENT or flag==MPI_CONGRUENT) */ __pyx_t_2 = (__pyx_v_comm1 != MPI_COMM_NULL); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L9_bool_binop_done; } __pyx_t_2 = (__pyx_v_comm2 != MPI_COMM_NULL); __pyx_t_1 = __pyx_t_2; __pyx_L9_bool_binop_done:; if (__pyx_t_1) { /* "petsc4py/PETSc/Comm.pyx":49 * cdef int flag = 0 * if comm1 != MPI_COMM_NULL and comm2 != MPI_COMM_NULL: * CHKERR( MPI_Comm_compare(comm1, comm2, &flag) ) # <<<<<<<<<<<<<< * if eq: return (flag==MPI_IDENT or flag==MPI_CONGRUENT) * else: return (flag!=MPI_IDENT and flag!=MPI_CONGRUENT) */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(((PetscErrorCode)MPI_Comm_compare(__pyx_v_comm1, __pyx_v_comm2, (&__pyx_v_flag)))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(34, 49, __pyx_L1_error) /* "petsc4py/PETSc/Comm.pyx":50 * if comm1 != MPI_COMM_NULL and comm2 != MPI_COMM_NULL: * CHKERR( MPI_Comm_compare(comm1, comm2, &flag) ) * if eq: return (flag==MPI_IDENT or flag==MPI_CONGRUENT) # <<<<<<<<<<<<<< * else: return (flag!=MPI_IDENT and flag!=MPI_CONGRUENT) * else: */ __pyx_t_1 = (__pyx_v_eq != 0); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_t_1 = (__pyx_v_flag == ((int)MPI_IDENT)); if (!__pyx_t_1) { } else { __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(34, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L12_bool_binop_done; } __pyx_t_1 = (__pyx_v_flag == ((int)MPI_CONGRUENT)); __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(34, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = __pyx_t_6; __pyx_t_6 = 0; __pyx_L12_bool_binop_done:; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } /* "petsc4py/PETSc/Comm.pyx":51 * CHKERR( MPI_Comm_compare(comm1, comm2, &flag) ) * if eq: return (flag==MPI_IDENT or flag==MPI_CONGRUENT) * else: return (flag!=MPI_IDENT and flag!=MPI_CONGRUENT) # <<<<<<<<<<<<<< * else: * if eq: return (comm1 == comm2) */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_1 = (__pyx_v_flag != ((int)MPI_IDENT)); if (__pyx_t_1) { } else { __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(34, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L14_bool_binop_done; } __pyx_t_1 = (__pyx_v_flag != ((int)MPI_CONGRUENT)); __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(34, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = __pyx_t_6; __pyx_t_6 = 0; __pyx_L14_bool_binop_done:; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } /* "petsc4py/PETSc/Comm.pyx":48 * cdef MPI_Comm comm2 = o.comm * cdef int flag = 0 * if comm1 != MPI_COMM_NULL and comm2 != MPI_COMM_NULL: # <<<<<<<<<<<<<< * CHKERR( MPI_Comm_compare(comm1, comm2, &flag) ) * if eq: return (flag==MPI_IDENT or flag==MPI_CONGRUENT) */ } /* "petsc4py/PETSc/Comm.pyx":53 * else: return (flag!=MPI_IDENT and flag!=MPI_CONGRUENT) * else: * if eq: return (comm1 == comm2) # <<<<<<<<<<<<<< * else: return (comm1 != comm2) * */ /*else*/ { __pyx_t_1 = (__pyx_v_eq != 0); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyBool_FromLong((__pyx_v_comm1 == __pyx_v_comm2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(34, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } /* "petsc4py/PETSc/Comm.pyx":54 * else: * if eq: return (comm1 == comm2) * else: return (comm1 != comm2) # <<<<<<<<<<<<<< * * def __bool__(self) -> bool: */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyBool_FromLong((__pyx_v_comm1 != __pyx_v_comm2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(34, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } } /* "petsc4py/PETSc/Comm.pyx":38 * self.base = None * * def __richcmp__(self, other, int op): # <<<<<<<<<<<<<< * if not isinstance(self, Comm): return NotImplemented * if not isinstance(other, Comm): return NotImplemented */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.Comm.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_s); __Pyx_XDECREF((PyObject *)__pyx_v_o); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Comm.pyx":56 * else: return (comm1 != comm2) * * def __bool__(self) -> bool: # <<<<<<<<<<<<<< * return self.comm != MPI_COMM_NULL * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_4Comm_7__bool__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_4Comm_7__bool__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__bool__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4Comm_6__bool__(((struct PyPetscCommObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_4Comm_6__bool__(struct PyPetscCommObject *__pyx_v_self) { int __pyx_r; /* "petsc4py/PETSc/Comm.pyx":57 * * def __bool__(self) -> bool: * return self.comm != MPI_COMM_NULL # <<<<<<<<<<<<<< * * # */ __pyx_r = (__pyx_v_self->comm != MPI_COMM_NULL); goto __pyx_L0; /* "petsc4py/PETSc/Comm.pyx":56 * else: return (comm1 != comm2) * * def __bool__(self) -> bool: # <<<<<<<<<<<<<< * return self.comm != MPI_COMM_NULL * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/Comm.pyx":61 * # * * def destroy(self) -> None: # <<<<<<<<<<<<<< * """Destroy the communicator. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4Comm_9destroy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4Comm_8destroy, "Comm.destroy(self) -> None\nDestroy the communicator.\n\n Collective.\n\n See Also\n --------\n petsc.PetscCommDestroy\n\n \nSource code at petsc4py/PETSc/Comm.pyx:61"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4Comm_9destroy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("destroy (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4Comm_8destroy(((struct PyPetscCommObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4Comm_8destroy(struct PyPetscCommObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("destroy", 1); /* "petsc4py/PETSc/Comm.pyx":71 * * """ * if self.comm == MPI_COMM_NULL: return # <<<<<<<<<<<<<< * if not self.isdup: * raise ValueError("communicator not owned") */ __pyx_t_1 = (__pyx_v_self->comm == MPI_COMM_NULL); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } /* "petsc4py/PETSc/Comm.pyx":72 * """ * if self.comm == MPI_COMM_NULL: return * if not self.isdup: # <<<<<<<<<<<<<< * raise ValueError("communicator not owned") * CHKERR( PetscCommDestroy(&self.comm) ) */ __pyx_t_1 = (!(__pyx_v_self->isdup != 0)); if (unlikely(__pyx_t_1)) { /* "petsc4py/PETSc/Comm.pyx":73 * if self.comm == MPI_COMM_NULL: return * if not self.isdup: * raise ValueError("communicator not owned") # <<<<<<<<<<<<<< * CHKERR( PetscCommDestroy(&self.comm) ) * self.comm = MPI_COMM_NULL */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(34, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(34, 73, __pyx_L1_error) /* "petsc4py/PETSc/Comm.pyx":72 * """ * if self.comm == MPI_COMM_NULL: return * if not self.isdup: # <<<<<<<<<<<<<< * raise ValueError("communicator not owned") * CHKERR( PetscCommDestroy(&self.comm) ) */ } /* "petsc4py/PETSc/Comm.pyx":74 * if not self.isdup: * raise ValueError("communicator not owned") * CHKERR( PetscCommDestroy(&self.comm) ) # <<<<<<<<<<<<<< * self.comm = MPI_COMM_NULL * self.isdup = 0 */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscCommDestroy((&__pyx_v_self->comm))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(34, 74, __pyx_L1_error) /* "petsc4py/PETSc/Comm.pyx":75 * raise ValueError("communicator not owned") * CHKERR( PetscCommDestroy(&self.comm) ) * self.comm = MPI_COMM_NULL # <<<<<<<<<<<<<< * self.isdup = 0 * self.base = None */ __pyx_v_self->comm = MPI_COMM_NULL; /* "petsc4py/PETSc/Comm.pyx":76 * CHKERR( PetscCommDestroy(&self.comm) ) * self.comm = MPI_COMM_NULL * self.isdup = 0 # <<<<<<<<<<<<<< * self.base = None * */ __pyx_v_self->isdup = 0; /* "petsc4py/PETSc/Comm.pyx":77 * self.comm = MPI_COMM_NULL * self.isdup = 0 * self.base = None # <<<<<<<<<<<<<< * * def duplicate(self) -> Self: */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->base); __Pyx_DECREF(__pyx_v_self->base); __pyx_v_self->base = Py_None; /* "petsc4py/PETSc/Comm.pyx":61 * # * * def destroy(self) -> None: # <<<<<<<<<<<<<< * """Destroy the communicator. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Comm.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Comm.pyx":79 * self.base = None * * def duplicate(self) -> Self: # <<<<<<<<<<<<<< * """Duplicate the communicator. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4Comm_11duplicate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4Comm_10duplicate, "Comm.duplicate(self) -> Self\nDuplicate the communicator.\n\n Collective.\n\n See Also\n --------\n petsc.PetscCommDuplicate\n\n \nSource code at petsc4py/PETSc/Comm.pyx:79"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4Comm_11duplicate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("duplicate (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("duplicate", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "duplicate", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4Comm_10duplicate(((struct PyPetscCommObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4Comm_10duplicate(struct PyPetscCommObject *__pyx_v_self) { MPI_Comm __pyx_v_newcomm; struct PyPetscCommObject *__pyx_v_comm = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("duplicate", 1); /* "petsc4py/PETSc/Comm.pyx":89 * * """ * if self.comm == MPI_COMM_NULL: # <<<<<<<<<<<<<< * raise ValueError("null communicator") * cdef MPI_Comm newcomm = MPI_COMM_NULL */ __pyx_t_1 = (__pyx_v_self->comm == MPI_COMM_NULL); if (unlikely(__pyx_t_1)) { /* "petsc4py/PETSc/Comm.pyx":90 * """ * if self.comm == MPI_COMM_NULL: * raise ValueError("null communicator") # <<<<<<<<<<<<<< * cdef MPI_Comm newcomm = MPI_COMM_NULL * CHKERR( PetscCommDuplicate(self.comm, &newcomm, NULL) ) */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(34, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(34, 90, __pyx_L1_error) /* "petsc4py/PETSc/Comm.pyx":89 * * """ * if self.comm == MPI_COMM_NULL: # <<<<<<<<<<<<<< * raise ValueError("null communicator") * cdef MPI_Comm newcomm = MPI_COMM_NULL */ } /* "petsc4py/PETSc/Comm.pyx":91 * if self.comm == MPI_COMM_NULL: * raise ValueError("null communicator") * cdef MPI_Comm newcomm = MPI_COMM_NULL # <<<<<<<<<<<<<< * CHKERR( PetscCommDuplicate(self.comm, &newcomm, NULL) ) * cdef Comm comm = type(self)() */ __pyx_v_newcomm = MPI_COMM_NULL; /* "petsc4py/PETSc/Comm.pyx":92 * raise ValueError("null communicator") * cdef MPI_Comm newcomm = MPI_COMM_NULL * CHKERR( PetscCommDuplicate(self.comm, &newcomm, NULL) ) # <<<<<<<<<<<<<< * cdef Comm comm = type(self)() * comm.comm = newcomm */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscCommDuplicate(__pyx_v_self->comm, (&__pyx_v_newcomm), NULL)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(34, 92, __pyx_L1_error) /* "petsc4py/PETSc/Comm.pyx":93 * cdef MPI_Comm newcomm = MPI_COMM_NULL * CHKERR( PetscCommDuplicate(self.comm, &newcomm, NULL) ) * cdef Comm comm = type(self)() # <<<<<<<<<<<<<< * comm.comm = newcomm * comm.isdup = 1 */ __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __pyx_t_4 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(34, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_Comm))))) __PYX_ERR(34, 93, __pyx_L1_error) __pyx_v_comm = ((struct PyPetscCommObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/Comm.pyx":94 * CHKERR( PetscCommDuplicate(self.comm, &newcomm, NULL) ) * cdef Comm comm = type(self)() * comm.comm = newcomm # <<<<<<<<<<<<<< * comm.isdup = 1 * comm.base = self.base */ __pyx_v_comm->comm = __pyx_v_newcomm; /* "petsc4py/PETSc/Comm.pyx":95 * cdef Comm comm = type(self)() * comm.comm = newcomm * comm.isdup = 1 # <<<<<<<<<<<<<< * comm.base = self.base * return comm */ __pyx_v_comm->isdup = 1; /* "petsc4py/PETSc/Comm.pyx":96 * comm.comm = newcomm * comm.isdup = 1 * comm.base = self.base # <<<<<<<<<<<<<< * return comm * */ __pyx_t_2 = __pyx_v_self->base; __Pyx_INCREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_comm->base); __Pyx_DECREF(__pyx_v_comm->base); __pyx_v_comm->base = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/Comm.pyx":97 * comm.isdup = 1 * comm.base = self.base * return comm # <<<<<<<<<<<<<< * * def getSize(self) -> int: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_comm); __pyx_r = ((PyObject *)__pyx_v_comm); goto __pyx_L0; /* "petsc4py/PETSc/Comm.pyx":79 * self.base = None * * def duplicate(self) -> Self: # <<<<<<<<<<<<<< * """Duplicate the communicator. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.Comm.duplicate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_comm); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Comm.pyx":99 * return comm * * def getSize(self) -> int: # <<<<<<<<<<<<<< * """Return the number of processes in the communicator. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4Comm_13getSize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4Comm_12getSize, "Comm.getSize(self) -> int\nReturn the number of processes in the communicator.\n\n Not collective.\n\n \nSource code at petsc4py/PETSc/Comm.pyx:99"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4Comm_13getSize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSize (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getSize", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getSize", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4Comm_12getSize(((struct PyPetscCommObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4Comm_12getSize(struct PyPetscCommObject *__pyx_v_self) { int __pyx_v_size; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSize", 1); /* "petsc4py/PETSc/Comm.pyx":105 * * """ * if self.comm == MPI_COMM_NULL: # <<<<<<<<<<<<<< * raise ValueError("null communicator") * cdef int size=0 */ __pyx_t_1 = (__pyx_v_self->comm == MPI_COMM_NULL); if (unlikely(__pyx_t_1)) { /* "petsc4py/PETSc/Comm.pyx":106 * """ * if self.comm == MPI_COMM_NULL: * raise ValueError("null communicator") # <<<<<<<<<<<<<< * cdef int size=0 * CHKERRMPI( MPI_Comm_size(self.comm, &size) ) */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(34, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(34, 106, __pyx_L1_error) /* "petsc4py/PETSc/Comm.pyx":105 * * """ * if self.comm == MPI_COMM_NULL: # <<<<<<<<<<<<<< * raise ValueError("null communicator") * cdef int size=0 */ } /* "petsc4py/PETSc/Comm.pyx":107 * if self.comm == MPI_COMM_NULL: * raise ValueError("null communicator") * cdef int size=0 # <<<<<<<<<<<<<< * CHKERRMPI( MPI_Comm_size(self.comm, &size) ) * return size */ __pyx_v_size = 0; /* "petsc4py/PETSc/Comm.pyx":108 * raise ValueError("null communicator") * cdef int size=0 * CHKERRMPI( MPI_Comm_size(self.comm, &size) ) # <<<<<<<<<<<<<< * return size * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERRMPI(MPI_Comm_size(__pyx_v_self->comm, (&__pyx_v_size))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(34, 108, __pyx_L1_error) /* "petsc4py/PETSc/Comm.pyx":109 * cdef int size=0 * CHKERRMPI( MPI_Comm_size(self.comm, &size) ) * return size # <<<<<<<<<<<<<< * * def getRank(self) -> int: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(34, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Comm.pyx":99 * return comm * * def getSize(self) -> int: # <<<<<<<<<<<<<< * """Return the number of processes in the communicator. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Comm.getSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Comm.pyx":111 * return size * * def getRank(self) -> int: # <<<<<<<<<<<<<< * """Return the rank of the calling processes in the communicator. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4Comm_15getRank(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4Comm_14getRank, "Comm.getRank(self) -> int\nReturn the rank of the calling processes in the communicator.\n\n Not collective.\n\n \nSource code at petsc4py/PETSc/Comm.pyx:111"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4Comm_15getRank(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getRank (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getRank", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getRank", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4Comm_14getRank(((struct PyPetscCommObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4Comm_14getRank(struct PyPetscCommObject *__pyx_v_self) { int __pyx_v_rank; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getRank", 1); /* "petsc4py/PETSc/Comm.pyx":117 * * """ * if self.comm == MPI_COMM_NULL: # <<<<<<<<<<<<<< * raise ValueError("null communicator") * cdef int rank=0 */ __pyx_t_1 = (__pyx_v_self->comm == MPI_COMM_NULL); if (unlikely(__pyx_t_1)) { /* "petsc4py/PETSc/Comm.pyx":118 * """ * if self.comm == MPI_COMM_NULL: * raise ValueError("null communicator") # <<<<<<<<<<<<<< * cdef int rank=0 * CHKERRMPI( MPI_Comm_rank(self.comm, &rank) ) */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(34, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(34, 118, __pyx_L1_error) /* "petsc4py/PETSc/Comm.pyx":117 * * """ * if self.comm == MPI_COMM_NULL: # <<<<<<<<<<<<<< * raise ValueError("null communicator") * cdef int rank=0 */ } /* "petsc4py/PETSc/Comm.pyx":119 * if self.comm == MPI_COMM_NULL: * raise ValueError("null communicator") * cdef int rank=0 # <<<<<<<<<<<<<< * CHKERRMPI( MPI_Comm_rank(self.comm, &rank) ) * return rank */ __pyx_v_rank = 0; /* "petsc4py/PETSc/Comm.pyx":120 * raise ValueError("null communicator") * cdef int rank=0 * CHKERRMPI( MPI_Comm_rank(self.comm, &rank) ) # <<<<<<<<<<<<<< * return rank * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERRMPI(MPI_Comm_rank(__pyx_v_self->comm, (&__pyx_v_rank))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(34, 120, __pyx_L1_error) /* "petsc4py/PETSc/Comm.pyx":121 * cdef int rank=0 * CHKERRMPI( MPI_Comm_rank(self.comm, &rank) ) * return rank # <<<<<<<<<<<<<< * * def barrier(self) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rank); if (unlikely(!__pyx_t_2)) __PYX_ERR(34, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Comm.pyx":111 * return size * * def getRank(self) -> int: # <<<<<<<<<<<<<< * """Return the rank of the calling processes in the communicator. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Comm.getRank", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Comm.pyx":123 * return rank * * def barrier(self) -> None: # <<<<<<<<<<<<<< * """Barrier synchronization. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4Comm_17barrier(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4Comm_16barrier, "Comm.barrier(self) -> None\nBarrier synchronization.\n\n Collective.\n\n \nSource code at petsc4py/PETSc/Comm.pyx:123"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4Comm_17barrier(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("barrier (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("barrier", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "barrier", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4Comm_16barrier(((struct PyPetscCommObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4Comm_16barrier(struct PyPetscCommObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("barrier", 1); /* "petsc4py/PETSc/Comm.pyx":129 * * """ * if self.comm == MPI_COMM_NULL: # <<<<<<<<<<<<<< * raise ValueError("null communicator") * CHKERRMPI( MPI_Barrier(self.comm) ) */ __pyx_t_1 = (__pyx_v_self->comm == MPI_COMM_NULL); if (unlikely(__pyx_t_1)) { /* "petsc4py/PETSc/Comm.pyx":130 * """ * if self.comm == MPI_COMM_NULL: * raise ValueError("null communicator") # <<<<<<<<<<<<<< * CHKERRMPI( MPI_Barrier(self.comm) ) * */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(34, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(34, 130, __pyx_L1_error) /* "petsc4py/PETSc/Comm.pyx":129 * * """ * if self.comm == MPI_COMM_NULL: # <<<<<<<<<<<<<< * raise ValueError("null communicator") * CHKERRMPI( MPI_Barrier(self.comm) ) */ } /* "petsc4py/PETSc/Comm.pyx":131 * if self.comm == MPI_COMM_NULL: * raise ValueError("null communicator") * CHKERRMPI( MPI_Barrier(self.comm) ) # <<<<<<<<<<<<<< * * # --- properties --- */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERRMPI(MPI_Barrier(__pyx_v_self->comm)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(34, 131, __pyx_L1_error) /* "petsc4py/PETSc/Comm.pyx":123 * return rank * * def barrier(self) -> None: # <<<<<<<<<<<<<< * """Barrier synchronization. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Comm.barrier", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Comm.pyx":137 * property size: * """Communicator size.""" * def __get__(self) -> int: # <<<<<<<<<<<<<< * return self.getSize() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4Comm_4size_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4Comm_4size_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4Comm_4size___get__(((struct PyPetscCommObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4Comm_4size___get__(struct PyPetscCommObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/Comm.pyx":138 * """Communicator size.""" * def __get__(self) -> int: * return self.getSize() # <<<<<<<<<<<<<< * * property rank: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getSize); if (unlikely(!__pyx_t_2)) __PYX_ERR(34, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(34, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Comm.pyx":137 * property size: * """Communicator size.""" * def __get__(self) -> int: # <<<<<<<<<<<<<< * return self.getSize() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Comm.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Comm.pyx":142 * property rank: * """Communicator rank.""" * def __get__(self) -> int: # <<<<<<<<<<<<<< * return self.getRank() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4Comm_4rank_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4Comm_4rank_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4Comm_4rank___get__(((struct PyPetscCommObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4Comm_4rank___get__(struct PyPetscCommObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/Comm.pyx":143 * """Communicator rank.""" * def __get__(self) -> int: * return self.getRank() # <<<<<<<<<<<<<< * * # --- Fortran support --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getRank); if (unlikely(!__pyx_t_2)) __PYX_ERR(34, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(34, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Comm.pyx":142 * property rank: * """Communicator rank.""" * def __get__(self) -> int: # <<<<<<<<<<<<<< * return self.getRank() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Comm.rank.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Comm.pyx":149 * property fortran: * """Fortran handle.""" * def __get__(self) -> int: # <<<<<<<<<<<<<< * cdef MPI_Comm comm = self.comm * return MPI_Comm_c2f(comm) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4Comm_7fortran_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4Comm_7fortran_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4Comm_7fortran___get__(((struct PyPetscCommObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4Comm_7fortran___get__(struct PyPetscCommObject *__pyx_v_self) { MPI_Comm __pyx_v_comm; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/Comm.pyx":150 * """Fortran handle.""" * def __get__(self) -> int: * cdef MPI_Comm comm = self.comm # <<<<<<<<<<<<<< * return MPI_Comm_c2f(comm) * */ __pyx_t_1 = __pyx_v_self->comm; __pyx_v_comm = __pyx_t_1; /* "petsc4py/PETSc/Comm.pyx":151 * def __get__(self) -> int: * cdef MPI_Comm comm = self.comm * return MPI_Comm_c2f(comm) # <<<<<<<<<<<<<< * * # --- mpi4py support --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_MPI_Fint(MPI_Comm_c2f(__pyx_v_comm)); if (unlikely(!__pyx_t_2)) __PYX_ERR(34, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Comm.pyx":149 * property fortran: * """Fortran handle.""" * def __get__(self) -> int: # <<<<<<<<<<<<<< * cdef MPI_Comm comm = self.comm * return MPI_Comm_c2f(comm) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Comm.fortran.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Comm.pyx":155 * # --- mpi4py support --- * * def tompi4py(self) -> Intracomm: # <<<<<<<<<<<<<< * """Convert communicator to `mpi4py`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4Comm_19tompi4py(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4Comm_18tompi4py, "Comm.tompi4py(self) -> Intracomm\nConvert communicator to `mpi4py`.\n\n Not collective.\n\n See Also\n --------\n mpi4py.MPI.Comm, mpi4py.MPI.Intracomm\n\n \nSource code at petsc4py/PETSc/Comm.pyx:155"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4Comm_19tompi4py(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("tompi4py (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("tompi4py", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "tompi4py", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4Comm_18tompi4py(((struct PyPetscCommObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4Comm_18tompi4py(struct PyPetscCommObject *__pyx_v_self) { MPI_Comm __pyx_v_comm; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("tompi4py", 1); /* "petsc4py/PETSc/Comm.pyx":165 * * """ * cdef MPI_Comm comm = self.comm # <<<<<<<<<<<<<< * return mpi4py_Comm_New(comm) * */ __pyx_t_1 = __pyx_v_self->comm; __pyx_v_comm = __pyx_t_1; /* "petsc4py/PETSc/Comm.pyx":166 * """ * cdef MPI_Comm comm = self.comm * return mpi4py_Comm_New(comm) # <<<<<<<<<<<<<< * * # --- mpi4py compatibility API --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_mpi4py_Comm_New(__pyx_v_comm); if (unlikely(!__pyx_t_2)) __PYX_ERR(34, 166, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Comm.pyx":155 * # --- mpi4py support --- * * def tompi4py(self) -> Intracomm: # <<<<<<<<<<<<<< * """Convert communicator to `mpi4py`. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Comm.tompi4py", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Comm.pyx":191 * cdef MPI_Comm PETSC_COMM_DEFAULT = MPI_COMM_NULL * * cdef MPI_Comm GetComm( # <<<<<<<<<<<<<< * object comm, MPI_Comm defv, * ) except? MPI_COMM_NULL: */ static MPI_Comm __pyx_f_8petsc4py_5PETSc_GetComm(PyObject *__pyx_v_comm, MPI_Comm __pyx_v_defv) { MPI_Comm __pyx_r; MPI_Comm __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "petsc4py/PETSc/Comm.pyx":194 * object comm, MPI_Comm defv, * ) except? MPI_COMM_NULL: * return def_Comm(comm, defv) # <<<<<<<<<<<<<< * * cdef MPI_Comm GetCommDefault(): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_defv); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(34, 194, __pyx_L1_error) __pyx_r = __pyx_t_1; goto __pyx_L0; /* "petsc4py/PETSc/Comm.pyx":191 * cdef MPI_Comm PETSC_COMM_DEFAULT = MPI_COMM_NULL * * cdef MPI_Comm GetComm( # <<<<<<<<<<<<<< * object comm, MPI_Comm defv, * ) except? MPI_COMM_NULL: */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.GetComm", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = MPI_COMM_NULL; __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/Comm.pyx":196 * return def_Comm(comm, defv) * * cdef MPI_Comm GetCommDefault(): # <<<<<<<<<<<<<< * return PETSC_COMM_DEFAULT * */ static MPI_Comm __pyx_f_8petsc4py_5PETSc_GetCommDefault(void) { MPI_Comm __pyx_r; /* "petsc4py/PETSc/Comm.pyx":197 * * cdef MPI_Comm GetCommDefault(): * return PETSC_COMM_DEFAULT # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_r = __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT; goto __pyx_L0; /* "petsc4py/PETSc/Comm.pyx":196 * return def_Comm(comm, defv) * * cdef MPI_Comm GetCommDefault(): # <<<<<<<<<<<<<< * return PETSC_COMM_DEFAULT * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/Object.pyx":7 * # --- special methods --- * * def __cinit__(self): # <<<<<<<<<<<<<< * self.oval = NULL * self.obj = &self.oval */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_6Object_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_6Object_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object___cinit__(((struct PyPetscObjectObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_6Object___cinit__(struct PyPetscObjectObject *__pyx_v_self) { int __pyx_r; /* "petsc4py/PETSc/Object.pyx":8 * * def __cinit__(self): * self.oval = NULL # <<<<<<<<<<<<<< * self.obj = &self.oval * */ __pyx_v_self->oval = NULL; /* "petsc4py/PETSc/Object.pyx":9 * def __cinit__(self): * self.oval = NULL * self.obj = &self.oval # <<<<<<<<<<<<<< * * def __dealloc__(self): */ __pyx_v_self->obj = (&__pyx_v_self->oval); /* "petsc4py/PETSc/Object.pyx":7 * # --- special methods --- * * def __cinit__(self): # <<<<<<<<<<<<<< * self.oval = NULL * self.obj = &self.oval */ /* function exit code */ __pyx_r = 0; return __pyx_r; } /* "petsc4py/PETSc/Object.pyx":11 * self.obj = &self.oval * * def __dealloc__(self): # <<<<<<<<<<<<<< * CHKERR( PetscDEALLOC(&self.obj[0]) ) * self.obj = NULL */ /* Python wrapper */ static void __pyx_pw_8petsc4py_5PETSc_6Object_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_8petsc4py_5PETSc_6Object_3__dealloc__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_pf_8petsc4py_5PETSc_6Object_2__dealloc__(((struct PyPetscObjectObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_8petsc4py_5PETSc_6Object_2__dealloc__(struct PyPetscObjectObject *__pyx_v_self) { PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "petsc4py/PETSc/Object.pyx":12 * * def __dealloc__(self): * CHKERR( PetscDEALLOC(&self.obj[0]) ) # <<<<<<<<<<<<<< * self.obj = NULL * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscDEALLOC((&(__pyx_v_self->obj[0])))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(35, 12, __pyx_L1_error) /* "petsc4py/PETSc/Object.pyx":13 * def __dealloc__(self): * CHKERR( PetscDEALLOC(&self.obj[0]) ) * self.obj = NULL # <<<<<<<<<<<<<< * * def __richcmp__(self, other, int op): */ __pyx_v_self->obj = NULL; /* "petsc4py/PETSc/Object.pyx":11 * self.obj = &self.oval * * def __dealloc__(self): # <<<<<<<<<<<<<< * CHKERR( PetscDEALLOC(&self.obj[0]) ) * self.obj = NULL */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_WriteUnraisable("petsc4py.PETSc.Object.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_L0:; } /* "petsc4py/PETSc/Object.pyx":15 * self.obj = NULL * * def __richcmp__(self, other, int op): # <<<<<<<<<<<<<< * if not isinstance(self, Object): return NotImplemented * if not isinstance(other, Object): return NotImplemented */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_5__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_5__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__richcmp__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_4__richcmp__(((struct PyPetscObjectObject *)__pyx_v_self), ((PyObject *)__pyx_v_other), ((int)__pyx_v_op)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_4__richcmp__(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op) { struct PyPetscObjectObject *__pyx_v_s = 0; struct PyPetscObjectObject *__pyx_v_o = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__richcmp__", 1); /* "petsc4py/PETSc/Object.pyx":16 * * def __richcmp__(self, other, int op): * if not isinstance(self, Object): return NotImplemented # <<<<<<<<<<<<<< * if not isinstance(other, Object): return NotImplemented * cdef Object s = self, o = other */ __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_self), __pyx_ptype_8petsc4py_5PETSc_Object); __pyx_t_2 = (!__pyx_t_1); if (__pyx_t_2) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_builtin_NotImplemented); __pyx_r = __pyx_builtin_NotImplemented; goto __pyx_L0; } /* "petsc4py/PETSc/Object.pyx":17 * def __richcmp__(self, other, int op): * if not isinstance(self, Object): return NotImplemented * if not isinstance(other, Object): return NotImplemented # <<<<<<<<<<<<<< * cdef Object s = self, o = other * if op == 2: return (s.obj[0] == o.obj[0]) */ __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Object); __pyx_t_1 = (!__pyx_t_2); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_builtin_NotImplemented); __pyx_r = __pyx_builtin_NotImplemented; goto __pyx_L0; } /* "petsc4py/PETSc/Object.pyx":18 * if not isinstance(self, Object): return NotImplemented * if not isinstance(other, Object): return NotImplemented * cdef Object s = self, o = other # <<<<<<<<<<<<<< * if op == 2: return (s.obj[0] == o.obj[0]) * elif op == 3: return (s.obj[0] != o.obj[0]) */ __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_v_s = __pyx_v_self; if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Object))))) __PYX_ERR(35, 18, __pyx_L1_error) __pyx_t_3 = __pyx_v_other; __Pyx_INCREF(__pyx_t_3); __pyx_v_o = ((struct PyPetscObjectObject *)__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/Object.pyx":19 * if not isinstance(other, Object): return NotImplemented * cdef Object s = self, o = other * if op == 2: return (s.obj[0] == o.obj[0]) # <<<<<<<<<<<<<< * elif op == 3: return (s.obj[0] != o.obj[0]) * else: raise TypeError("only '==' and '!='") */ __pyx_t_1 = (__pyx_v_op == 2); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyBool_FromLong(((__pyx_v_s->obj[0]) == (__pyx_v_o->obj[0]))); if (unlikely(!__pyx_t_3)) __PYX_ERR(35, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } /* "petsc4py/PETSc/Object.pyx":20 * cdef Object s = self, o = other * if op == 2: return (s.obj[0] == o.obj[0]) * elif op == 3: return (s.obj[0] != o.obj[0]) # <<<<<<<<<<<<<< * else: raise TypeError("only '==' and '!='") * */ __pyx_t_1 = (__pyx_v_op == 3); if (likely(__pyx_t_1)) { __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyBool_FromLong(((__pyx_v_s->obj[0]) != (__pyx_v_o->obj[0]))); if (unlikely(!__pyx_t_3)) __PYX_ERR(35, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } /* "petsc4py/PETSc/Object.pyx":21 * if op == 2: return (s.obj[0] == o.obj[0]) * elif op == 3: return (s.obj[0] != o.obj[0]) * else: raise TypeError("only '==' and '!='") # <<<<<<<<<<<<<< * * def __bool__(self): */ /*else*/ { __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(35, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(35, 21, __pyx_L1_error) } /* "petsc4py/PETSc/Object.pyx":15 * self.obj = NULL * * def __richcmp__(self, other, int op): # <<<<<<<<<<<<<< * if not isinstance(self, Object): return NotImplemented * if not isinstance(other, Object): return NotImplemented */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Object.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_s); __Pyx_XDECREF((PyObject *)__pyx_v_o); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Object.pyx":23 * else: raise TypeError("only '==' and '!='") * * def __bool__(self): # <<<<<<<<<<<<<< * return self.obj[0] != NULL * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_6Object_7__bool__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_6Object_7__bool__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__bool__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_6__bool__(((struct PyPetscObjectObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_6Object_6__bool__(struct PyPetscObjectObject *__pyx_v_self) { int __pyx_r; /* "petsc4py/PETSc/Object.pyx":24 * * def __bool__(self): * return self.obj[0] != NULL # <<<<<<<<<<<<<< * * def __copy__(self): */ __pyx_r = ((__pyx_v_self->obj[0]) != NULL); goto __pyx_L0; /* "petsc4py/PETSc/Object.pyx":23 * else: raise TypeError("only '==' and '!='") * * def __bool__(self): # <<<<<<<<<<<<<< * return self.obj[0] != NULL * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/Object.pyx":26 * return self.obj[0] != NULL * * def __copy__(self): # <<<<<<<<<<<<<< * cdef Object obj = type(self)() * cdef PetscObject o = self.obj[0] */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_9__copy__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Object_8__copy__, "Object.__copy__(self)\nSource code at petsc4py/PETSc/Object.pyx:26"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_9__copy__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__copy__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__copy__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__copy__", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_8__copy__(((struct PyPetscObjectObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_8__copy__(struct PyPetscObjectObject *__pyx_v_self) { struct PyPetscObjectObject *__pyx_v_obj = 0; PetscObject __pyx_v_o; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; PetscErrorCode __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__copy__", 1); /* "petsc4py/PETSc/Object.pyx":27 * * def __copy__(self): * cdef Object obj = type(self)() # <<<<<<<<<<<<<< * cdef PetscObject o = self.obj[0] * if o != NULL: */ __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __pyx_t_2 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(35, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_Object))))) __PYX_ERR(35, 27, __pyx_L1_error) __pyx_v_obj = ((struct PyPetscObjectObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Object.pyx":28 * def __copy__(self): * cdef Object obj = type(self)() * cdef PetscObject o = self.obj[0] # <<<<<<<<<<<<<< * if o != NULL: * CHKERR( PetscObjectReference(o) ) */ __pyx_v_o = (__pyx_v_self->obj[0]); /* "petsc4py/PETSc/Object.pyx":29 * cdef Object obj = type(self)() * cdef PetscObject o = self.obj[0] * if o != NULL: # <<<<<<<<<<<<<< * CHKERR( PetscObjectReference(o) ) * obj.obj[0] = o */ __pyx_t_5 = (__pyx_v_o != NULL); if (__pyx_t_5) { /* "petsc4py/PETSc/Object.pyx":30 * cdef PetscObject o = self.obj[0] * if o != NULL: * CHKERR( PetscObjectReference(o) ) # <<<<<<<<<<<<<< * obj.obj[0] = o * return obj */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectReference(__pyx_v_o)); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(35, 30, __pyx_L1_error) /* "petsc4py/PETSc/Object.pyx":29 * cdef Object obj = type(self)() * cdef PetscObject o = self.obj[0] * if o != NULL: # <<<<<<<<<<<<<< * CHKERR( PetscObjectReference(o) ) * obj.obj[0] = o */ } /* "petsc4py/PETSc/Object.pyx":31 * if o != NULL: * CHKERR( PetscObjectReference(o) ) * obj.obj[0] = o # <<<<<<<<<<<<<< * return obj * */ (__pyx_v_obj->obj[0]) = __pyx_v_o; /* "petsc4py/PETSc/Object.pyx":32 * CHKERR( PetscObjectReference(o) ) * obj.obj[0] = o * return obj # <<<<<<<<<<<<<< * * def __deepcopy__(self, dict memo): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_obj); __pyx_r = ((PyObject *)__pyx_v_obj); goto __pyx_L0; /* "petsc4py/PETSc/Object.pyx":26 * return self.obj[0] != NULL * * def __copy__(self): # <<<<<<<<<<<<<< * cdef Object obj = type(self)() * cdef PetscObject o = self.obj[0] */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Object.__copy__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_obj); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Object.pyx":34 * return obj * * def __deepcopy__(self, dict memo): # <<<<<<<<<<<<<< * cdef object obj_copy = None * try: */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_11__deepcopy__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Object_10__deepcopy__, "Object.__deepcopy__(self, memo: dict)\nSource code at petsc4py/PETSc/Object.pyx:34"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_11__deepcopy__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_memo = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__deepcopy__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_memo,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_memo)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(35, 34, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__deepcopy__") < 0)) __PYX_ERR(35, 34, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_memo = ((PyObject*)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__deepcopy__", 1, 1, 1, __pyx_nargs); __PYX_ERR(35, 34, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Object.__deepcopy__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_memo), (&PyDict_Type), 0, "memo", 1))) __PYX_ERR(35, 34, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_10__deepcopy__(((struct PyPetscObjectObject *)__pyx_v_self), __pyx_v_memo); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_10__deepcopy__(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_memo) { PyObject *__pyx_v_obj_copy = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__deepcopy__", 1); /* "petsc4py/PETSc/Object.pyx":35 * * def __deepcopy__(self, dict memo): * cdef object obj_copy = None # <<<<<<<<<<<<<< * try: * obj_copy = self.copy */ __Pyx_INCREF(Py_None); __pyx_v_obj_copy = Py_None; /* "petsc4py/PETSc/Object.pyx":36 * def __deepcopy__(self, dict memo): * cdef object obj_copy = None * try: # <<<<<<<<<<<<<< * obj_copy = self.copy * except AttributeError: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { /* "petsc4py/PETSc/Object.pyx":37 * cdef object obj_copy = None * try: * obj_copy = self.copy # <<<<<<<<<<<<<< * except AttributeError: * raise NotImplementedError */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy); if (unlikely(!__pyx_t_4)) __PYX_ERR(35, 37, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_obj_copy, __pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/Object.pyx":36 * def __deepcopy__(self, dict memo): * cdef object obj_copy = None * try: # <<<<<<<<<<<<<< * obj_copy = self.copy * except AttributeError: */ } __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/Object.pyx":38 * try: * obj_copy = self.copy * except AttributeError: # <<<<<<<<<<<<<< * raise NotImplementedError * memo # unused */ __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError); if (__pyx_t_5) { __Pyx_AddTraceback("petsc4py.PETSc.Object.__deepcopy__", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(35, 38, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); /* "petsc4py/PETSc/Object.pyx":39 * obj_copy = self.copy * except AttributeError: * raise NotImplementedError # <<<<<<<<<<<<<< * memo # unused * return obj_copy() */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); __PYX_ERR(35, 39, __pyx_L5_except_error) } goto __pyx_L5_except_error; /* "petsc4py/PETSc/Object.pyx":36 * def __deepcopy__(self, dict memo): * cdef object obj_copy = None * try: # <<<<<<<<<<<<<< * obj_copy = self.copy * except AttributeError: */ __pyx_L5_except_error:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; __pyx_L8_try_end:; } /* "petsc4py/PETSc/Object.pyx":40 * except AttributeError: * raise NotImplementedError * memo # unused # <<<<<<<<<<<<<< * return obj_copy() * */ ((void)__pyx_v_memo); /* "petsc4py/PETSc/Object.pyx":41 * raise NotImplementedError * memo # unused * return obj_copy() # <<<<<<<<<<<<<< * * # --- attribute management --- */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_obj_copy); __pyx_t_6 = __pyx_v_obj_copy; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(35, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_r = __pyx_t_7; __pyx_t_7 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Object.pyx":34 * return obj * * def __deepcopy__(self, dict memo): # <<<<<<<<<<<<<< * cdef object obj_copy = None * try: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.Object.__deepcopy__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_obj_copy); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Object.pyx":45 * # --- attribute management --- * * cdef object get_attr(self, char name[]): # <<<<<<<<<<<<<< * return PetscGetPyObj(self.obj[0], name) * */ static PyObject *__pyx_f_8petsc4py_5PETSc_6Object_get_attr(struct PyPetscObjectObject *__pyx_v_self, char *__pyx_v_name) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_attr", 1); /* "petsc4py/PETSc/Object.pyx":46 * * cdef object get_attr(self, char name[]): * return PetscGetPyObj(self.obj[0], name) # <<<<<<<<<<<<<< * * cdef object set_attr(self, char name[], object attr): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_PetscGetPyObj((__pyx_v_self->obj[0]), __pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(35, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Object.pyx":45 * # --- attribute management --- * * cdef object get_attr(self, char name[]): # <<<<<<<<<<<<<< * return PetscGetPyObj(self.obj[0], name) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Object.get_attr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Object.pyx":48 * return PetscGetPyObj(self.obj[0], name) * * cdef object set_attr(self, char name[], object attr): # <<<<<<<<<<<<<< * return PetscSetPyObj(self.obj[0], name, attr) * */ static PyObject *__pyx_f_8petsc4py_5PETSc_6Object_set_attr(struct PyPetscObjectObject *__pyx_v_self, char *__pyx_v_name, PyObject *__pyx_v_attr) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_attr", 1); /* "petsc4py/PETSc/Object.pyx":49 * * cdef object set_attr(self, char name[], object attr): * return PetscSetPyObj(self.obj[0], name, attr) # <<<<<<<<<<<<<< * * cdef object get_dict(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_PetscSetPyObj((__pyx_v_self->obj[0]), __pyx_v_name, __pyx_v_attr); if (unlikely(!__pyx_t_1)) __PYX_ERR(35, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Object.pyx":48 * return PetscGetPyObj(self.obj[0], name) * * cdef object set_attr(self, char name[], object attr): # <<<<<<<<<<<<<< * return PetscSetPyObj(self.obj[0], name, attr) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Object.set_attr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Object.pyx":51 * return PetscSetPyObj(self.obj[0], name, attr) * * cdef object get_dict(self): # <<<<<<<<<<<<<< * return PetscGetPyDict(self.obj[0], True) * */ static PyObject *__pyx_f_8petsc4py_5PETSc_6Object_get_dict(struct PyPetscObjectObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_dict", 1); /* "petsc4py/PETSc/Object.pyx":52 * * cdef object get_dict(self): * return PetscGetPyDict(self.obj[0], True) # <<<<<<<<<<<<<< * * # */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_PetscGetPyDict((__pyx_v_self->obj[0]), 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(35, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Object.pyx":51 * return PetscSetPyObj(self.obj[0], name, attr) * * cdef object get_dict(self): # <<<<<<<<<<<<<< * return PetscGetPyDict(self.obj[0], True) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Object.get_dict", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Object.pyx":56 * # * * def view(self, Viewer viewer=None): # <<<<<<<<<<<<<< * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_13view(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Object_12view, "Object.view(self, viewer: Viewer | None = None)\nSource code at petsc4py/PETSc/Object.pyx:56"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_13view(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscViewerObject *__pyx_v_viewer = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("view (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscViewerObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_viewer); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(35, 56, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "view") < 0)) __PYX_ERR(35, 56, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, __pyx_nargs); __PYX_ERR(35, 56, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Object.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(35, 56, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_12view(((struct PyPetscObjectObject *)__pyx_v_self), __pyx_v_viewer); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_12view(struct PyPetscObjectObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer) { PetscViewer __pyx_v_vwr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscViewer __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("view", 1); /* "petsc4py/PETSc/Object.pyx":57 * * def view(self, Viewer viewer=None): * cdef PetscViewer vwr = NULL # <<<<<<<<<<<<<< * if viewer is not None: vwr = viewer.vwr * CHKERR( PetscObjectView(self.obj[0], vwr) ) */ __pyx_v_vwr = NULL; /* "petsc4py/PETSc/Object.pyx":58 * def view(self, Viewer viewer=None): * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr # <<<<<<<<<<<<<< * CHKERR( PetscObjectView(self.obj[0], vwr) ) * */ __pyx_t_1 = (((PyObject *)__pyx_v_viewer) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_viewer->vwr; __pyx_v_vwr = __pyx_t_2; } /* "petsc4py/PETSc/Object.pyx":59 * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr * CHKERR( PetscObjectView(self.obj[0], vwr) ) # <<<<<<<<<<<<<< * * def destroy(self): */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectView((__pyx_v_self->obj[0]), __pyx_v_vwr)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(35, 59, __pyx_L1_error) /* "petsc4py/PETSc/Object.pyx":56 * # * * def view(self, Viewer viewer=None): # <<<<<<<<<<<<<< * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Object.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Object.pyx":61 * CHKERR( PetscObjectView(self.obj[0], vwr) ) * * def destroy(self): # <<<<<<<<<<<<<< * CHKERR( PetscObjectDestroy(&self.obj[0]) ) * return self */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_15destroy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Object_14destroy, "Object.destroy(self)\nSource code at petsc4py/PETSc/Object.pyx:61"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_15destroy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("destroy (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_14destroy(((struct PyPetscObjectObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_14destroy(struct PyPetscObjectObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("destroy", 1); /* "petsc4py/PETSc/Object.pyx":62 * * def destroy(self): * CHKERR( PetscObjectDestroy(&self.obj[0]) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectDestroy((&(__pyx_v_self->obj[0])))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(35, 62, __pyx_L1_error) /* "petsc4py/PETSc/Object.pyx":63 * def destroy(self): * CHKERR( PetscObjectDestroy(&self.obj[0]) ) * return self # <<<<<<<<<<<<<< * * def getType(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Object.pyx":61 * CHKERR( PetscObjectView(self.obj[0], vwr) ) * * def destroy(self): # <<<<<<<<<<<<<< * CHKERR( PetscObjectDestroy(&self.obj[0]) ) * return self */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Object.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Object.pyx":65 * return self * * def getType(self): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * CHKERR( PetscObjectGetType(self.obj[0], &cval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_17getType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Object_16getType, "Object.getType(self)\nSource code at petsc4py/PETSc/Object.pyx:65"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_17getType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getType", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_16getType(((struct PyPetscObjectObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_16getType(struct PyPetscObjectObject *__pyx_v_self) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getType", 1); /* "petsc4py/PETSc/Object.pyx":66 * * def getType(self): * cdef const char *cval = NULL # <<<<<<<<<<<<<< * CHKERR( PetscObjectGetType(self.obj[0], &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/Object.pyx":67 * def getType(self): * cdef const char *cval = NULL * CHKERR( PetscObjectGetType(self.obj[0], &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectGetType((__pyx_v_self->obj[0]), (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(35, 67, __pyx_L1_error) /* "petsc4py/PETSc/Object.pyx":68 * cdef const char *cval = NULL * CHKERR( PetscObjectGetType(self.obj[0], &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * # */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(35, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Object.pyx":65 * return self * * def getType(self): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * CHKERR( PetscObjectGetType(self.obj[0], &cval) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Object.getType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Object.pyx":72 * # * * def setOptionsPrefix(self, prefix): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * prefix = str2bytes(prefix, &cval) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_19setOptionsPrefix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Object_18setOptionsPrefix, "Object.setOptionsPrefix(self, prefix)\nSource code at petsc4py/PETSc/Object.pyx:72"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_19setOptionsPrefix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_prefix = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setOptionsPrefix (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_prefix,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_prefix)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(35, 72, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setOptionsPrefix") < 0)) __PYX_ERR(35, 72, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_prefix = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setOptionsPrefix", 1, 1, 1, __pyx_nargs); __PYX_ERR(35, 72, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Object.setOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_18setOptionsPrefix(((struct PyPetscObjectObject *)__pyx_v_self), __pyx_v_prefix); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_18setOptionsPrefix(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_prefix) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setOptionsPrefix", 0); __Pyx_INCREF(__pyx_v_prefix); /* "petsc4py/PETSc/Object.pyx":73 * * def setOptionsPrefix(self, prefix): * cdef const char *cval = NULL # <<<<<<<<<<<<<< * prefix = str2bytes(prefix, &cval) * CHKERR( PetscObjectSetOptionsPrefix(self.obj[0], cval) ) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/Object.pyx":74 * def setOptionsPrefix(self, prefix): * cdef const char *cval = NULL * prefix = str2bytes(prefix, &cval) # <<<<<<<<<<<<<< * CHKERR( PetscObjectSetOptionsPrefix(self.obj[0], cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_prefix, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(35, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_prefix, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Object.pyx":75 * cdef const char *cval = NULL * prefix = str2bytes(prefix, &cval) * CHKERR( PetscObjectSetOptionsPrefix(self.obj[0], cval) ) # <<<<<<<<<<<<<< * * def getOptionsPrefix(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectSetOptionsPrefix((__pyx_v_self->obj[0]), __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(35, 75, __pyx_L1_error) /* "petsc4py/PETSc/Object.pyx":72 * # * * def setOptionsPrefix(self, prefix): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * prefix = str2bytes(prefix, &cval) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Object.setOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_prefix); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Object.pyx":77 * CHKERR( PetscObjectSetOptionsPrefix(self.obj[0], cval) ) * * def getOptionsPrefix(self): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * CHKERR( PetscObjectGetOptionsPrefix(self.obj[0], &cval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_21getOptionsPrefix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Object_20getOptionsPrefix, "Object.getOptionsPrefix(self)\nSource code at petsc4py/PETSc/Object.pyx:77"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_21getOptionsPrefix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getOptionsPrefix (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getOptionsPrefix", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getOptionsPrefix", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_20getOptionsPrefix(((struct PyPetscObjectObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_20getOptionsPrefix(struct PyPetscObjectObject *__pyx_v_self) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getOptionsPrefix", 1); /* "petsc4py/PETSc/Object.pyx":78 * * def getOptionsPrefix(self): * cdef const char *cval = NULL # <<<<<<<<<<<<<< * CHKERR( PetscObjectGetOptionsPrefix(self.obj[0], &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/Object.pyx":79 * def getOptionsPrefix(self): * cdef const char *cval = NULL * CHKERR( PetscObjectGetOptionsPrefix(self.obj[0], &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectGetOptionsPrefix((__pyx_v_self->obj[0]), (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(35, 79, __pyx_L1_error) /* "petsc4py/PETSc/Object.pyx":80 * cdef const char *cval = NULL * CHKERR( PetscObjectGetOptionsPrefix(self.obj[0], &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * def appendOptionsPrefix(self, prefix): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(35, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Object.pyx":77 * CHKERR( PetscObjectSetOptionsPrefix(self.obj[0], cval) ) * * def getOptionsPrefix(self): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * CHKERR( PetscObjectGetOptionsPrefix(self.obj[0], &cval) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Object.getOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Object.pyx":82 * return bytes2str(cval) * * def appendOptionsPrefix(self, prefix): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * prefix = str2bytes(prefix, &cval) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_23appendOptionsPrefix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Object_22appendOptionsPrefix, "Object.appendOptionsPrefix(self, prefix)\nSource code at petsc4py/PETSc/Object.pyx:82"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_23appendOptionsPrefix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_prefix = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("appendOptionsPrefix (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_prefix,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_prefix)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(35, 82, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "appendOptionsPrefix") < 0)) __PYX_ERR(35, 82, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_prefix = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("appendOptionsPrefix", 1, 1, 1, __pyx_nargs); __PYX_ERR(35, 82, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Object.appendOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_22appendOptionsPrefix(((struct PyPetscObjectObject *)__pyx_v_self), __pyx_v_prefix); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_22appendOptionsPrefix(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_prefix) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("appendOptionsPrefix", 0); __Pyx_INCREF(__pyx_v_prefix); /* "petsc4py/PETSc/Object.pyx":83 * * def appendOptionsPrefix(self, prefix): * cdef const char *cval = NULL # <<<<<<<<<<<<<< * prefix = str2bytes(prefix, &cval) * CHKERR( PetscObjectAppendOptionsPrefix(self.obj[0], cval) ) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/Object.pyx":84 * def appendOptionsPrefix(self, prefix): * cdef const char *cval = NULL * prefix = str2bytes(prefix, &cval) # <<<<<<<<<<<<<< * CHKERR( PetscObjectAppendOptionsPrefix(self.obj[0], cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_prefix, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(35, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_prefix, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Object.pyx":85 * cdef const char *cval = NULL * prefix = str2bytes(prefix, &cval) * CHKERR( PetscObjectAppendOptionsPrefix(self.obj[0], cval) ) # <<<<<<<<<<<<<< * * def setFromOptions(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectAppendOptionsPrefix((__pyx_v_self->obj[0]), __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(35, 85, __pyx_L1_error) /* "petsc4py/PETSc/Object.pyx":82 * return bytes2str(cval) * * def appendOptionsPrefix(self, prefix): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * prefix = str2bytes(prefix, &cval) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Object.appendOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_prefix); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Object.pyx":87 * CHKERR( PetscObjectAppendOptionsPrefix(self.obj[0], cval) ) * * def setFromOptions(self): # <<<<<<<<<<<<<< * CHKERR( PetscObjectSetFromOptions(self.obj[0]) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_25setFromOptions(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Object_24setFromOptions, "Object.setFromOptions(self)\nSource code at petsc4py/PETSc/Object.pyx:87"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_25setFromOptions(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFromOptions (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("setFromOptions", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setFromOptions", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_24setFromOptions(((struct PyPetscObjectObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_24setFromOptions(struct PyPetscObjectObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFromOptions", 1); /* "petsc4py/PETSc/Object.pyx":88 * * def setFromOptions(self): * CHKERR( PetscObjectSetFromOptions(self.obj[0]) ) # <<<<<<<<<<<<<< * * def viewFromOptions(self, name, Object prefix=None): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectSetFromOptions((__pyx_v_self->obj[0]))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(35, 88, __pyx_L1_error) /* "petsc4py/PETSc/Object.pyx":87 * CHKERR( PetscObjectAppendOptionsPrefix(self.obj[0], cval) ) * * def setFromOptions(self): # <<<<<<<<<<<<<< * CHKERR( PetscObjectSetFromOptions(self.obj[0]) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Object.setFromOptions", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Object.pyx":90 * CHKERR( PetscObjectSetFromOptions(self.obj[0]) ) * * def viewFromOptions(self, name, Object prefix=None): # <<<<<<<<<<<<<< * cdef PetscObject pobj = NULL * cdef const char *cval = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_27viewFromOptions(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Object_26viewFromOptions, "Object.viewFromOptions(self, name, prefix: Object | None = None)\nSource code at petsc4py/PETSc/Object.pyx:90"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_27viewFromOptions(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_name = 0; struct PyPetscObjectObject *__pyx_v_prefix = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("viewFromOptions (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_prefix,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscObjectObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(35, 90, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_prefix); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(35, 90, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "viewFromOptions") < 0)) __PYX_ERR(35, 90, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_name = values[0]; __pyx_v_prefix = ((struct PyPetscObjectObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("viewFromOptions", 0, 1, 2, __pyx_nargs); __PYX_ERR(35, 90, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Object.viewFromOptions", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_prefix), __pyx_ptype_8petsc4py_5PETSc_Object, 1, "prefix", 0))) __PYX_ERR(35, 90, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_26viewFromOptions(((struct PyPetscObjectObject *)__pyx_v_self), __pyx_v_name, __pyx_v_prefix); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_26viewFromOptions(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_name, struct PyPetscObjectObject *__pyx_v_prefix) { PetscObject __pyx_v_pobj; char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscObject __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("viewFromOptions", 0); __Pyx_INCREF(__pyx_v_name); /* "petsc4py/PETSc/Object.pyx":91 * * def viewFromOptions(self, name, Object prefix=None): * cdef PetscObject pobj = NULL # <<<<<<<<<<<<<< * cdef const char *cval = NULL * pobj = prefix.obj[0] if prefix is not None else NULL */ __pyx_v_pobj = NULL; /* "petsc4py/PETSc/Object.pyx":92 * def viewFromOptions(self, name, Object prefix=None): * cdef PetscObject pobj = NULL * cdef const char *cval = NULL # <<<<<<<<<<<<<< * pobj = prefix.obj[0] if prefix is not None else NULL * name = str2bytes(name, &cval) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/Object.pyx":93 * cdef PetscObject pobj = NULL * cdef const char *cval = NULL * pobj = prefix.obj[0] if prefix is not None else NULL # <<<<<<<<<<<<<< * name = str2bytes(name, &cval) * CHKERR( PetscObjectViewFromOptions(self.obj[0], pobj, cval) ) */ __pyx_t_2 = (((PyObject *)__pyx_v_prefix) != Py_None); if (__pyx_t_2) { __pyx_t_1 = (__pyx_v_prefix->obj[0]); } else { __pyx_t_1 = NULL; } __pyx_v_pobj = __pyx_t_1; /* "petsc4py/PETSc/Object.pyx":94 * cdef const char *cval = NULL * pobj = prefix.obj[0] if prefix is not None else NULL * name = str2bytes(name, &cval) # <<<<<<<<<<<<<< * CHKERR( PetscObjectViewFromOptions(self.obj[0], pobj, cval) ) * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cval)); if (unlikely(!__pyx_t_3)) __PYX_ERR(35, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/Object.pyx":95 * pobj = prefix.obj[0] if prefix is not None else NULL * name = str2bytes(name, &cval) * CHKERR( PetscObjectViewFromOptions(self.obj[0], pobj, cval) ) # <<<<<<<<<<<<<< * * # */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectViewFromOptions((__pyx_v_self->obj[0]), __pyx_v_pobj, __pyx_v_cval)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(35, 95, __pyx_L1_error) /* "petsc4py/PETSc/Object.pyx":90 * CHKERR( PetscObjectSetFromOptions(self.obj[0]) ) * * def viewFromOptions(self, name, Object prefix=None): # <<<<<<<<<<<<<< * cdef PetscObject pobj = NULL * cdef const char *cval = NULL */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Object.viewFromOptions", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Object.pyx":99 * # * * def getComm(self): # <<<<<<<<<<<<<< * cdef Comm comm = Comm() * CHKERR( PetscObjectGetComm(self.obj[0], &comm.comm) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_29getComm(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Object_28getComm, "Object.getComm(self)\nSource code at petsc4py/PETSc/Object.pyx:99"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_29getComm(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getComm (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getComm", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getComm", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_28getComm(((struct PyPetscObjectObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_28getComm(struct PyPetscObjectObject *__pyx_v_self) { struct PyPetscCommObject *__pyx_v_comm = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getComm", 1); /* "petsc4py/PETSc/Object.pyx":100 * * def getComm(self): * cdef Comm comm = Comm() # <<<<<<<<<<<<<< * CHKERR( PetscObjectGetComm(self.obj[0], &comm.comm) ) * return comm */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Comm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(35, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_comm = ((struct PyPetscCommObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Object.pyx":101 * def getComm(self): * cdef Comm comm = Comm() * CHKERR( PetscObjectGetComm(self.obj[0], &comm.comm) ) # <<<<<<<<<<<<<< * return comm * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectGetComm((__pyx_v_self->obj[0]), (&__pyx_v_comm->comm))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(35, 101, __pyx_L1_error) /* "petsc4py/PETSc/Object.pyx":102 * cdef Comm comm = Comm() * CHKERR( PetscObjectGetComm(self.obj[0], &comm.comm) ) * return comm # <<<<<<<<<<<<<< * * def getName(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_comm); __pyx_r = ((PyObject *)__pyx_v_comm); goto __pyx_L0; /* "petsc4py/PETSc/Object.pyx":99 * # * * def getComm(self): # <<<<<<<<<<<<<< * cdef Comm comm = Comm() * CHKERR( PetscObjectGetComm(self.obj[0], &comm.comm) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Object.getComm", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_comm); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Object.pyx":104 * return comm * * def getName(self): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * CHKERR( PetscObjectGetName(self.obj[0], &cval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_31getName(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Object_30getName, "Object.getName(self)\nSource code at petsc4py/PETSc/Object.pyx:104"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_31getName(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getName (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getName", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getName", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_30getName(((struct PyPetscObjectObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_30getName(struct PyPetscObjectObject *__pyx_v_self) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getName", 1); /* "petsc4py/PETSc/Object.pyx":105 * * def getName(self): * cdef const char *cval = NULL # <<<<<<<<<<<<<< * CHKERR( PetscObjectGetName(self.obj[0], &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/Object.pyx":106 * def getName(self): * cdef const char *cval = NULL * CHKERR( PetscObjectGetName(self.obj[0], &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectGetName((__pyx_v_self->obj[0]), (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(35, 106, __pyx_L1_error) /* "petsc4py/PETSc/Object.pyx":107 * cdef const char *cval = NULL * CHKERR( PetscObjectGetName(self.obj[0], &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * def setName(self, name): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(35, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Object.pyx":104 * return comm * * def getName(self): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * CHKERR( PetscObjectGetName(self.obj[0], &cval) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Object.getName", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Object.pyx":109 * return bytes2str(cval) * * def setName(self, name): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * name = str2bytes(name, &cval) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_33setName(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Object_32setName, "Object.setName(self, name)\nSource code at petsc4py/PETSc/Object.pyx:109"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_33setName(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_name = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setName (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(35, 109, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setName") < 0)) __PYX_ERR(35, 109, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_name = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setName", 1, 1, 1, __pyx_nargs); __PYX_ERR(35, 109, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Object.setName", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_32setName(((struct PyPetscObjectObject *)__pyx_v_self), __pyx_v_name); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_32setName(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_name) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setName", 0); __Pyx_INCREF(__pyx_v_name); /* "petsc4py/PETSc/Object.pyx":110 * * def setName(self, name): * cdef const char *cval = NULL # <<<<<<<<<<<<<< * name = str2bytes(name, &cval) * CHKERR( PetscObjectSetName(self.obj[0], cval) ) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/Object.pyx":111 * def setName(self, name): * cdef const char *cval = NULL * name = str2bytes(name, &cval) # <<<<<<<<<<<<<< * CHKERR( PetscObjectSetName(self.obj[0], cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(35, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Object.pyx":112 * cdef const char *cval = NULL * name = str2bytes(name, &cval) * CHKERR( PetscObjectSetName(self.obj[0], cval) ) # <<<<<<<<<<<<<< * * def getClassId(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectSetName((__pyx_v_self->obj[0]), __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(35, 112, __pyx_L1_error) /* "petsc4py/PETSc/Object.pyx":109 * return bytes2str(cval) * * def setName(self, name): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * name = str2bytes(name, &cval) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Object.setName", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Object.pyx":114 * CHKERR( PetscObjectSetName(self.obj[0], cval) ) * * def getClassId(self): # <<<<<<<<<<<<<< * cdef PetscClassId classid = 0 * CHKERR( PetscObjectGetClassId(self.obj[0], &classid) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_35getClassId(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Object_34getClassId, "Object.getClassId(self)\nSource code at petsc4py/PETSc/Object.pyx:114"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_35getClassId(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getClassId (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getClassId", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getClassId", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_34getClassId(((struct PyPetscObjectObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_34getClassId(struct PyPetscObjectObject *__pyx_v_self) { PetscClassId __pyx_v_classid; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getClassId", 1); /* "petsc4py/PETSc/Object.pyx":115 * * def getClassId(self): * cdef PetscClassId classid = 0 # <<<<<<<<<<<<<< * CHKERR( PetscObjectGetClassId(self.obj[0], &classid) ) * return classid */ __pyx_v_classid = 0; /* "petsc4py/PETSc/Object.pyx":116 * def getClassId(self): * cdef PetscClassId classid = 0 * CHKERR( PetscObjectGetClassId(self.obj[0], &classid) ) # <<<<<<<<<<<<<< * return classid * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectGetClassId((__pyx_v_self->obj[0]), (&__pyx_v_classid))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(35, 116, __pyx_L1_error) /* "petsc4py/PETSc/Object.pyx":117 * cdef PetscClassId classid = 0 * CHKERR( PetscObjectGetClassId(self.obj[0], &classid) ) * return classid # <<<<<<<<<<<<<< * * def getClassName(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_long(((long)__pyx_v_classid)); if (unlikely(!__pyx_t_2)) __PYX_ERR(35, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Object.pyx":114 * CHKERR( PetscObjectSetName(self.obj[0], cval) ) * * def getClassId(self): # <<<<<<<<<<<<<< * cdef PetscClassId classid = 0 * CHKERR( PetscObjectGetClassId(self.obj[0], &classid) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Object.getClassId", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Object.pyx":119 * return classid * * def getClassName(self): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * CHKERR( PetscObjectGetClassName(self.obj[0], &cval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_37getClassName(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Object_36getClassName, "Object.getClassName(self)\nSource code at petsc4py/PETSc/Object.pyx:119"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_37getClassName(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getClassName (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getClassName", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getClassName", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_36getClassName(((struct PyPetscObjectObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_36getClassName(struct PyPetscObjectObject *__pyx_v_self) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getClassName", 1); /* "petsc4py/PETSc/Object.pyx":120 * * def getClassName(self): * cdef const char *cval = NULL # <<<<<<<<<<<<<< * CHKERR( PetscObjectGetClassName(self.obj[0], &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/Object.pyx":121 * def getClassName(self): * cdef const char *cval = NULL * CHKERR( PetscObjectGetClassName(self.obj[0], &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectGetClassName((__pyx_v_self->obj[0]), (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(35, 121, __pyx_L1_error) /* "petsc4py/PETSc/Object.pyx":122 * cdef const char *cval = NULL * CHKERR( PetscObjectGetClassName(self.obj[0], &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * def getRefCount(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(35, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Object.pyx":119 * return classid * * def getClassName(self): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * CHKERR( PetscObjectGetClassName(self.obj[0], &cval) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Object.getClassName", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Object.pyx":124 * return bytes2str(cval) * * def getRefCount(self): # <<<<<<<<<<<<<< * if self.obj[0] == NULL: return 0 * cdef PetscInt refcnt = 0 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_39getRefCount(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Object_38getRefCount, "Object.getRefCount(self)\nSource code at petsc4py/PETSc/Object.pyx:124"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_39getRefCount(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getRefCount (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getRefCount", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getRefCount", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_38getRefCount(((struct PyPetscObjectObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_38getRefCount(struct PyPetscObjectObject *__pyx_v_self) { PetscInt __pyx_v_refcnt; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getRefCount", 1); /* "petsc4py/PETSc/Object.pyx":125 * * def getRefCount(self): * if self.obj[0] == NULL: return 0 # <<<<<<<<<<<<<< * cdef PetscInt refcnt = 0 * CHKERR( PetscObjectGetReference(self.obj[0], &refcnt) ) */ __pyx_t_1 = ((__pyx_v_self->obj[0]) == NULL); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_int_0); __pyx_r = __pyx_int_0; goto __pyx_L0; } /* "petsc4py/PETSc/Object.pyx":126 * def getRefCount(self): * if self.obj[0] == NULL: return 0 * cdef PetscInt refcnt = 0 # <<<<<<<<<<<<<< * CHKERR( PetscObjectGetReference(self.obj[0], &refcnt) ) * return toInt(refcnt) */ __pyx_v_refcnt = 0; /* "petsc4py/PETSc/Object.pyx":127 * if self.obj[0] == NULL: return 0 * cdef PetscInt refcnt = 0 * CHKERR( PetscObjectGetReference(self.obj[0], &refcnt) ) # <<<<<<<<<<<<<< * return toInt(refcnt) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectGetReference((__pyx_v_self->obj[0]), (&__pyx_v_refcnt))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(35, 127, __pyx_L1_error) /* "petsc4py/PETSc/Object.pyx":128 * cdef PetscInt refcnt = 0 * CHKERR( PetscObjectGetReference(self.obj[0], &refcnt) ) * return toInt(refcnt) # <<<<<<<<<<<<<< * * # --- general support --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_refcnt); if (unlikely(!__pyx_t_3)) __PYX_ERR(35, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Object.pyx":124 * return bytes2str(cval) * * def getRefCount(self): # <<<<<<<<<<<<<< * if self.obj[0] == NULL: return 0 * cdef PetscInt refcnt = 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Object.getRefCount", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Object.pyx":132 * # --- general support --- * * def compose(self, name, Object obj or None): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * cdef PetscObject cobj = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_41compose(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Object_40compose, "Object.compose(self, name, obj: Object)\nSource code at petsc4py/PETSc/Object.pyx:132"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_41compose(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_name = 0; struct PyPetscObjectObject *__pyx_v_obj = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("compose (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_obj,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(35, 132, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_obj)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(35, 132, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("compose", 1, 2, 2, 1); __PYX_ERR(35, 132, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "compose") < 0)) __PYX_ERR(35, 132, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_name = values[0]; __pyx_v_obj = ((struct PyPetscObjectObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("compose", 1, 2, 2, __pyx_nargs); __PYX_ERR(35, 132, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Object.compose", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_obj), __pyx_ptype_8petsc4py_5PETSc_Object, 1, "obj", 0))) __PYX_ERR(35, 132, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_40compose(((struct PyPetscObjectObject *)__pyx_v_self), __pyx_v_name, __pyx_v_obj); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_40compose(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_name, struct PyPetscObjectObject *__pyx_v_obj) { char const *__pyx_v_cval; PetscObject __pyx_v_cobj; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("compose", 0); __Pyx_INCREF(__pyx_v_name); /* "petsc4py/PETSc/Object.pyx":133 * * def compose(self, name, Object obj or None): * cdef const char *cval = NULL # <<<<<<<<<<<<<< * cdef PetscObject cobj = NULL * name = str2bytes(name, &cval) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/Object.pyx":134 * def compose(self, name, Object obj or None): * cdef const char *cval = NULL * cdef PetscObject cobj = NULL # <<<<<<<<<<<<<< * name = str2bytes(name, &cval) * if obj is not None: cobj = obj.obj[0] */ __pyx_v_cobj = NULL; /* "petsc4py/PETSc/Object.pyx":135 * cdef const char *cval = NULL * cdef PetscObject cobj = NULL * name = str2bytes(name, &cval) # <<<<<<<<<<<<<< * if obj is not None: cobj = obj.obj[0] * CHKERR( PetscObjectCompose(self.obj[0], cval, cobj) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(35, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Object.pyx":136 * cdef PetscObject cobj = NULL * name = str2bytes(name, &cval) * if obj is not None: cobj = obj.obj[0] # <<<<<<<<<<<<<< * CHKERR( PetscObjectCompose(self.obj[0], cval, cobj) ) * */ __pyx_t_2 = (((PyObject *)__pyx_v_obj) != Py_None); if (__pyx_t_2) { __pyx_v_cobj = (__pyx_v_obj->obj[0]); } /* "petsc4py/PETSc/Object.pyx":137 * name = str2bytes(name, &cval) * if obj is not None: cobj = obj.obj[0] * CHKERR( PetscObjectCompose(self.obj[0], cval, cobj) ) # <<<<<<<<<<<<<< * * def query(self, name): */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectCompose((__pyx_v_self->obj[0]), __pyx_v_cval, __pyx_v_cobj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(35, 137, __pyx_L1_error) /* "petsc4py/PETSc/Object.pyx":132 * # --- general support --- * * def compose(self, name, Object obj or None): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * cdef PetscObject cobj = NULL */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Object.compose", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Object.pyx":139 * CHKERR( PetscObjectCompose(self.obj[0], cval, cobj) ) * * def query(self, name): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * cdef PetscObject cobj = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_43query(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Object_42query, "Object.query(self, name)\nSource code at petsc4py/PETSc/Object.pyx:139"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_43query(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_name = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("query (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(35, 139, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "query") < 0)) __PYX_ERR(35, 139, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_name = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("query", 1, 1, 1, __pyx_nargs); __PYX_ERR(35, 139, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Object.query", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_42query(((struct PyPetscObjectObject *)__pyx_v_self), __pyx_v_name); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_42query(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_name) { char const *__pyx_v_cval; PetscObject __pyx_v_cobj; struct PyPetscObjectObject *__pyx_v_obj = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("query", 0); __Pyx_INCREF(__pyx_v_name); /* "petsc4py/PETSc/Object.pyx":140 * * def query(self, name): * cdef const char *cval = NULL # <<<<<<<<<<<<<< * cdef PetscObject cobj = NULL * name = str2bytes(name, &cval) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/Object.pyx":141 * def query(self, name): * cdef const char *cval = NULL * cdef PetscObject cobj = NULL # <<<<<<<<<<<<<< * name = str2bytes(name, &cval) * CHKERR( PetscObjectQuery(self.obj[0], cval, &cobj) ) */ __pyx_v_cobj = NULL; /* "petsc4py/PETSc/Object.pyx":142 * cdef const char *cval = NULL * cdef PetscObject cobj = NULL * name = str2bytes(name, &cval) # <<<<<<<<<<<<<< * CHKERR( PetscObjectQuery(self.obj[0], cval, &cobj) ) * if cobj == NULL: return None */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(35, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Object.pyx":143 * cdef PetscObject cobj = NULL * name = str2bytes(name, &cval) * CHKERR( PetscObjectQuery(self.obj[0], cval, &cobj) ) # <<<<<<<<<<<<<< * if cobj == NULL: return None * cdef Object obj = subtype_Object(cobj)() */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectQuery((__pyx_v_self->obj[0]), __pyx_v_cval, (&__pyx_v_cobj))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(35, 143, __pyx_L1_error) /* "petsc4py/PETSc/Object.pyx":144 * name = str2bytes(name, &cval) * CHKERR( PetscObjectQuery(self.obj[0], cval, &cobj) ) * if cobj == NULL: return None # <<<<<<<<<<<<<< * cdef Object obj = subtype_Object(cobj)() * obj.obj[0] = cobj */ __pyx_t_3 = (__pyx_v_cobj == NULL); if (__pyx_t_3) { __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } /* "petsc4py/PETSc/Object.pyx":145 * CHKERR( PetscObjectQuery(self.obj[0], cval, &cobj) ) * if cobj == NULL: return None * cdef Object obj = subtype_Object(cobj)() # <<<<<<<<<<<<<< * obj.obj[0] = cobj * CHKERR( PetscINCREF(obj.obj) ) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_Object(__pyx_v_cobj)); if (unlikely(!__pyx_t_1)) __PYX_ERR(35, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(35, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_8petsc4py_5PETSc_Object))))) __PYX_ERR(35, 145, __pyx_L1_error) __pyx_v_obj = ((struct PyPetscObjectObject *)__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/Object.pyx":146 * if cobj == NULL: return None * cdef Object obj = subtype_Object(cobj)() * obj.obj[0] = cobj # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(obj.obj) ) * return obj */ (__pyx_v_obj->obj[0]) = __pyx_v_cobj; /* "petsc4py/PETSc/Object.pyx":147 * cdef Object obj = subtype_Object(cobj)() * obj.obj[0] = cobj * CHKERR( PetscINCREF(obj.obj) ) # <<<<<<<<<<<<<< * return obj * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_obj->obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(35, 147, __pyx_L1_error) /* "petsc4py/PETSc/Object.pyx":148 * obj.obj[0] = cobj * CHKERR( PetscINCREF(obj.obj) ) * return obj # <<<<<<<<<<<<<< * * def incRef(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_obj); __pyx_r = ((PyObject *)__pyx_v_obj); goto __pyx_L0; /* "petsc4py/PETSc/Object.pyx":139 * CHKERR( PetscObjectCompose(self.obj[0], cval, cobj) ) * * def query(self, name): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * cdef PetscObject cobj = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.Object.query", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_obj); __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Object.pyx":150 * return obj * * def incRef(self): # <<<<<<<<<<<<<< * cdef PetscObject obj = self.obj[0] * cdef PetscInt refct = 0 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_45incRef(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Object_44incRef, "Object.incRef(self)\nSource code at petsc4py/PETSc/Object.pyx:150"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_45incRef(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("incRef (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("incRef", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "incRef", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_44incRef(((struct PyPetscObjectObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_44incRef(struct PyPetscObjectObject *__pyx_v_self) { PetscObject __pyx_v_obj; PetscInt __pyx_v_refct; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("incRef", 1); /* "petsc4py/PETSc/Object.pyx":151 * * def incRef(self): * cdef PetscObject obj = self.obj[0] # <<<<<<<<<<<<<< * cdef PetscInt refct = 0 * if obj != NULL: */ __pyx_v_obj = (__pyx_v_self->obj[0]); /* "petsc4py/PETSc/Object.pyx":152 * def incRef(self): * cdef PetscObject obj = self.obj[0] * cdef PetscInt refct = 0 # <<<<<<<<<<<<<< * if obj != NULL: * CHKERR( PetscObjectReference(obj) ) */ __pyx_v_refct = 0; /* "petsc4py/PETSc/Object.pyx":153 * cdef PetscObject obj = self.obj[0] * cdef PetscInt refct = 0 * if obj != NULL: # <<<<<<<<<<<<<< * CHKERR( PetscObjectReference(obj) ) * CHKERR( PetscObjectGetReference(obj, &refct) ) */ __pyx_t_1 = (__pyx_v_obj != NULL); if (__pyx_t_1) { /* "petsc4py/PETSc/Object.pyx":154 * cdef PetscInt refct = 0 * if obj != NULL: * CHKERR( PetscObjectReference(obj) ) # <<<<<<<<<<<<<< * CHKERR( PetscObjectGetReference(obj, &refct) ) * return (refct) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectReference(__pyx_v_obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(35, 154, __pyx_L1_error) /* "petsc4py/PETSc/Object.pyx":155 * if obj != NULL: * CHKERR( PetscObjectReference(obj) ) * CHKERR( PetscObjectGetReference(obj, &refct) ) # <<<<<<<<<<<<<< * return (refct) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectGetReference(__pyx_v_obj, (&__pyx_v_refct))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(35, 155, __pyx_L1_error) /* "petsc4py/PETSc/Object.pyx":153 * cdef PetscObject obj = self.obj[0] * cdef PetscInt refct = 0 * if obj != NULL: # <<<<<<<<<<<<<< * CHKERR( PetscObjectReference(obj) ) * CHKERR( PetscObjectGetReference(obj, &refct) ) */ } /* "petsc4py/PETSc/Object.pyx":156 * CHKERR( PetscObjectReference(obj) ) * CHKERR( PetscObjectGetReference(obj, &refct) ) * return (refct) # <<<<<<<<<<<<<< * * def decRef(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyInt_From_long(((long)__pyx_v_refct)); if (unlikely(!__pyx_t_3)) __PYX_ERR(35, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Object.pyx":150 * return obj * * def incRef(self): # <<<<<<<<<<<<<< * cdef PetscObject obj = self.obj[0] * cdef PetscInt refct = 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Object.incRef", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Object.pyx":158 * return (refct) * * def decRef(self): # <<<<<<<<<<<<<< * cdef PetscObject obj = self.obj[0] * cdef PetscInt refct = 0 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_47decRef(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Object_46decRef, "Object.decRef(self)\nSource code at petsc4py/PETSc/Object.pyx:158"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_47decRef(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("decRef (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("decRef", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "decRef", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_46decRef(((struct PyPetscObjectObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_46decRef(struct PyPetscObjectObject *__pyx_v_self) { PetscObject __pyx_v_obj; PetscInt __pyx_v_refct; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("decRef", 1); /* "petsc4py/PETSc/Object.pyx":159 * * def decRef(self): * cdef PetscObject obj = self.obj[0] # <<<<<<<<<<<<<< * cdef PetscInt refct = 0 * if obj != NULL: */ __pyx_v_obj = (__pyx_v_self->obj[0]); /* "petsc4py/PETSc/Object.pyx":160 * def decRef(self): * cdef PetscObject obj = self.obj[0] * cdef PetscInt refct = 0 # <<<<<<<<<<<<<< * if obj != NULL: * CHKERR( PetscObjectGetReference(obj, &refct) ) */ __pyx_v_refct = 0; /* "petsc4py/PETSc/Object.pyx":161 * cdef PetscObject obj = self.obj[0] * cdef PetscInt refct = 0 * if obj != NULL: # <<<<<<<<<<<<<< * CHKERR( PetscObjectGetReference(obj, &refct) ) * CHKERR( PetscObjectDereference(obj) ) */ __pyx_t_1 = (__pyx_v_obj != NULL); if (__pyx_t_1) { /* "petsc4py/PETSc/Object.pyx":162 * cdef PetscInt refct = 0 * if obj != NULL: * CHKERR( PetscObjectGetReference(obj, &refct) ) # <<<<<<<<<<<<<< * CHKERR( PetscObjectDereference(obj) ) * if refct == 1: self.obj[0] = NULL */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectGetReference(__pyx_v_obj, (&__pyx_v_refct))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(35, 162, __pyx_L1_error) /* "petsc4py/PETSc/Object.pyx":163 * if obj != NULL: * CHKERR( PetscObjectGetReference(obj, &refct) ) * CHKERR( PetscObjectDereference(obj) ) # <<<<<<<<<<<<<< * if refct == 1: self.obj[0] = NULL * refct -= 1 */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectDereference(__pyx_v_obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(35, 163, __pyx_L1_error) /* "petsc4py/PETSc/Object.pyx":164 * CHKERR( PetscObjectGetReference(obj, &refct) ) * CHKERR( PetscObjectDereference(obj) ) * if refct == 1: self.obj[0] = NULL # <<<<<<<<<<<<<< * refct -= 1 * return (refct) */ __pyx_t_1 = (__pyx_v_refct == 1); if (__pyx_t_1) { (__pyx_v_self->obj[0]) = NULL; } /* "petsc4py/PETSc/Object.pyx":165 * CHKERR( PetscObjectDereference(obj) ) * if refct == 1: self.obj[0] = NULL * refct -= 1 # <<<<<<<<<<<<<< * return (refct) * */ __pyx_v_refct = (__pyx_v_refct - 1); /* "petsc4py/PETSc/Object.pyx":161 * cdef PetscObject obj = self.obj[0] * cdef PetscInt refct = 0 * if obj != NULL: # <<<<<<<<<<<<<< * CHKERR( PetscObjectGetReference(obj, &refct) ) * CHKERR( PetscObjectDereference(obj) ) */ } /* "petsc4py/PETSc/Object.pyx":166 * if refct == 1: self.obj[0] = NULL * refct -= 1 * return (refct) # <<<<<<<<<<<<<< * * def getAttr(self, name): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyInt_From_long(((long)__pyx_v_refct)); if (unlikely(!__pyx_t_3)) __PYX_ERR(35, 166, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Object.pyx":158 * return (refct) * * def decRef(self): # <<<<<<<<<<<<<< * cdef PetscObject obj = self.obj[0] * cdef PetscInt refct = 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Object.decRef", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Object.pyx":168 * return (refct) * * def getAttr(self, name): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * name = str2bytes(name, &cval) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_49getAttr(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Object_48getAttr, "Object.getAttr(self, name)\nSource code at petsc4py/PETSc/Object.pyx:168"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_49getAttr(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_name = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getAttr (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(35, 168, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getAttr") < 0)) __PYX_ERR(35, 168, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_name = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getAttr", 1, 1, 1, __pyx_nargs); __PYX_ERR(35, 168, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Object.getAttr", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_48getAttr(((struct PyPetscObjectObject *)__pyx_v_self), __pyx_v_name); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_48getAttr(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_name) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getAttr", 0); __Pyx_INCREF(__pyx_v_name); /* "petsc4py/PETSc/Object.pyx":169 * * def getAttr(self, name): * cdef const char *cval = NULL # <<<<<<<<<<<<<< * name = str2bytes(name, &cval) * return self.get_attr(cval) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/Object.pyx":170 * def getAttr(self, name): * cdef const char *cval = NULL * name = str2bytes(name, &cval) # <<<<<<<<<<<<<< * return self.get_attr(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(35, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Object.pyx":171 * cdef const char *cval = NULL * name = str2bytes(name, &cval) * return self.get_attr(cval) # <<<<<<<<<<<<<< * * def setAttr(self, name, attr): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Object *)__pyx_v_self->__pyx_vtab)->get_attr(__pyx_v_self, ((char *)__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(35, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Object.pyx":168 * return (refct) * * def getAttr(self, name): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * name = str2bytes(name, &cval) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Object.getAttr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Object.pyx":173 * return self.get_attr(cval) * * def setAttr(self, name, attr): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * name = str2bytes(name, &cval) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_51setAttr(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Object_50setAttr, "Object.setAttr(self, name, attr)\nSource code at petsc4py/PETSc/Object.pyx:173"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_51setAttr(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_name = 0; PyObject *__pyx_v_attr = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setAttr (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_attr,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(35, 173, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_attr)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(35, 173, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setAttr", 1, 2, 2, 1); __PYX_ERR(35, 173, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setAttr") < 0)) __PYX_ERR(35, 173, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_name = values[0]; __pyx_v_attr = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setAttr", 1, 2, 2, __pyx_nargs); __PYX_ERR(35, 173, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Object.setAttr", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_50setAttr(((struct PyPetscObjectObject *)__pyx_v_self), __pyx_v_name, __pyx_v_attr); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_50setAttr(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_attr) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setAttr", 0); __Pyx_INCREF(__pyx_v_name); /* "petsc4py/PETSc/Object.pyx":174 * * def setAttr(self, name, attr): * cdef const char *cval = NULL # <<<<<<<<<<<<<< * name = str2bytes(name, &cval) * self.set_attr(cval, attr) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/Object.pyx":175 * def setAttr(self, name, attr): * cdef const char *cval = NULL * name = str2bytes(name, &cval) # <<<<<<<<<<<<<< * self.set_attr(cval, attr) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(35, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Object.pyx":176 * cdef const char *cval = NULL * name = str2bytes(name, &cval) * self.set_attr(cval, attr) # <<<<<<<<<<<<<< * * def getDict(self): */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Object *)__pyx_v_self->__pyx_vtab)->set_attr(__pyx_v_self, ((char *)__pyx_v_cval), __pyx_v_attr); if (unlikely(!__pyx_t_1)) __PYX_ERR(35, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Object.pyx":173 * return self.get_attr(cval) * * def setAttr(self, name, attr): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * name = str2bytes(name, &cval) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Object.setAttr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Object.pyx":178 * self.set_attr(cval, attr) * * def getDict(self): # <<<<<<<<<<<<<< * return self.get_dict() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_53getDict(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Object_52getDict, "Object.getDict(self)\nSource code at petsc4py/PETSc/Object.pyx:178"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_53getDict(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getDict (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getDict", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getDict", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_52getDict(((struct PyPetscObjectObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_52getDict(struct PyPetscObjectObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getDict", 1); /* "petsc4py/PETSc/Object.pyx":179 * * def getDict(self): * return self.get_dict() # <<<<<<<<<<<<<< * * # --- state manipulation --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Object *)__pyx_v_self->__pyx_vtab)->get_dict(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(35, 179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Object.pyx":178 * self.set_attr(cval, attr) * * def getDict(self): # <<<<<<<<<<<<<< * return self.get_dict() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Object.getDict", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Object.pyx":182 * * # --- state manipulation --- * def stateIncrease(self): # <<<<<<<<<<<<<< * PetscINCSTATE(self.obj) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_55stateIncrease(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Object_54stateIncrease, "Object.stateIncrease(self)\nSource code at petsc4py/PETSc/Object.pyx:182"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_55stateIncrease(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("stateIncrease (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("stateIncrease", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "stateIncrease", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_54stateIncrease(((struct PyPetscObjectObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_54stateIncrease(struct PyPetscObjectObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("stateIncrease", 1); /* "petsc4py/PETSc/Object.pyx":183 * # --- state manipulation --- * def stateIncrease(self): * PetscINCSTATE(self.obj) # <<<<<<<<<<<<<< * * def stateGet(self): */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCSTATE(__pyx_v_self->obj)); /* "petsc4py/PETSc/Object.pyx":182 * * # --- state manipulation --- * def stateIncrease(self): # <<<<<<<<<<<<<< * PetscINCSTATE(self.obj) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Object.pyx":185 * PetscINCSTATE(self.obj) * * def stateGet(self): # <<<<<<<<<<<<<< * cdef PetscObjectState state = 0 * CHKERR( PetscObjectStateGet(self.obj[0], &state) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_57stateGet(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Object_56stateGet, "Object.stateGet(self)\nSource code at petsc4py/PETSc/Object.pyx:185"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_57stateGet(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("stateGet (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("stateGet", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "stateGet", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_56stateGet(((struct PyPetscObjectObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_56stateGet(struct PyPetscObjectObject *__pyx_v_self) { PetscObjectState __pyx_v_state; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("stateGet", 1); /* "petsc4py/PETSc/Object.pyx":186 * * def stateGet(self): * cdef PetscObjectState state = 0 # <<<<<<<<<<<<<< * CHKERR( PetscObjectStateGet(self.obj[0], &state) ) * return toInt(state) */ __pyx_v_state = 0; /* "petsc4py/PETSc/Object.pyx":187 * def stateGet(self): * cdef PetscObjectState state = 0 * CHKERR( PetscObjectStateGet(self.obj[0], &state) ) # <<<<<<<<<<<<<< * return toInt(state) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectStateGet((__pyx_v_self->obj[0]), (&__pyx_v_state))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(35, 187, __pyx_L1_error) /* "petsc4py/PETSc/Object.pyx":188 * cdef PetscObjectState state = 0 * CHKERR( PetscObjectStateGet(self.obj[0], &state) ) * return toInt(state) # <<<<<<<<<<<<<< * * def stateSet(self, state): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_state); if (unlikely(!__pyx_t_2)) __PYX_ERR(35, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Object.pyx":185 * PetscINCSTATE(self.obj) * * def stateGet(self): # <<<<<<<<<<<<<< * cdef PetscObjectState state = 0 * CHKERR( PetscObjectStateGet(self.obj[0], &state) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Object.stateGet", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Object.pyx":190 * return toInt(state) * * def stateSet(self, state): # <<<<<<<<<<<<<< * cdef PetscObjectState cstate = asInt(state) * CHKERR( PetscObjectStateSet(self.obj[0], cstate) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_59stateSet(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Object_58stateSet, "Object.stateSet(self, state)\nSource code at petsc4py/PETSc/Object.pyx:190"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_59stateSet(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("stateSet (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(35, 190, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "stateSet") < 0)) __PYX_ERR(35, 190, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_state = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("stateSet", 1, 1, 1, __pyx_nargs); __PYX_ERR(35, 190, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Object.stateSet", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_58stateSet(((struct PyPetscObjectObject *)__pyx_v_self), __pyx_v_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_58stateSet(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_state) { PetscObjectState __pyx_v_cstate; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("stateSet", 1); /* "petsc4py/PETSc/Object.pyx":191 * * def stateSet(self, state): * cdef PetscObjectState cstate = asInt(state) # <<<<<<<<<<<<<< * CHKERR( PetscObjectStateSet(self.obj[0], cstate) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_state); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(35, 191, __pyx_L1_error) __pyx_v_cstate = __pyx_t_1; /* "petsc4py/PETSc/Object.pyx":192 * def stateSet(self, state): * cdef PetscObjectState cstate = asInt(state) * CHKERR( PetscObjectStateSet(self.obj[0], cstate) ) # <<<<<<<<<<<<<< * * # --- tab level --- */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectStateSet((__pyx_v_self->obj[0]), __pyx_v_cstate)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(35, 192, __pyx_L1_error) /* "petsc4py/PETSc/Object.pyx":190 * return toInt(state) * * def stateSet(self, state): # <<<<<<<<<<<<<< * cdef PetscObjectState cstate = asInt(state) * CHKERR( PetscObjectStateSet(self.obj[0], cstate) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Object.stateSet", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Object.pyx":196 * # --- tab level --- * * def incrementTabLevel(self, tab, Object parent=None): # <<<<<<<<<<<<<< * cdef PetscInt ctab = asInt(tab) * cdef PetscObject cobj = NULL if parent is None else parent.obj[0] */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_61incrementTabLevel(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Object_60incrementTabLevel, "Object.incrementTabLevel(self, tab, parent: Object | None = None)\nSource code at petsc4py/PETSc/Object.pyx:196"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_61incrementTabLevel(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_tab = 0; struct PyPetscObjectObject *__pyx_v_parent = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("incrementTabLevel (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tab,&__pyx_n_s_parent,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscObjectObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_tab)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(35, 196, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_parent); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(35, 196, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "incrementTabLevel") < 0)) __PYX_ERR(35, 196, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_tab = values[0]; __pyx_v_parent = ((struct PyPetscObjectObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("incrementTabLevel", 0, 1, 2, __pyx_nargs); __PYX_ERR(35, 196, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Object.incrementTabLevel", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent), __pyx_ptype_8petsc4py_5PETSc_Object, 1, "parent", 0))) __PYX_ERR(35, 196, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_60incrementTabLevel(((struct PyPetscObjectObject *)__pyx_v_self), __pyx_v_tab, __pyx_v_parent); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_60incrementTabLevel(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_tab, struct PyPetscObjectObject *__pyx_v_parent) { PetscInt __pyx_v_ctab; PetscObject __pyx_v_cobj; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscObject __pyx_t_2; int __pyx_t_3; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("incrementTabLevel", 1); /* "petsc4py/PETSc/Object.pyx":197 * * def incrementTabLevel(self, tab, Object parent=None): * cdef PetscInt ctab = asInt(tab) # <<<<<<<<<<<<<< * cdef PetscObject cobj = NULL if parent is None else parent.obj[0] * CHKERR( PetscObjectIncrementTabLevel(self.obj[0], cobj, ctab) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_tab); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(35, 197, __pyx_L1_error) __pyx_v_ctab = __pyx_t_1; /* "petsc4py/PETSc/Object.pyx":198 * def incrementTabLevel(self, tab, Object parent=None): * cdef PetscInt ctab = asInt(tab) * cdef PetscObject cobj = NULL if parent is None else parent.obj[0] # <<<<<<<<<<<<<< * CHKERR( PetscObjectIncrementTabLevel(self.obj[0], cobj, ctab) ) * */ __pyx_t_3 = (((PyObject *)__pyx_v_parent) == Py_None); if (__pyx_t_3) { __pyx_t_2 = ((PetscObject)NULL); } else { __pyx_t_2 = (__pyx_v_parent->obj[0]); } __pyx_v_cobj = __pyx_t_2; /* "petsc4py/PETSc/Object.pyx":199 * cdef PetscInt ctab = asInt(tab) * cdef PetscObject cobj = NULL if parent is None else parent.obj[0] * CHKERR( PetscObjectIncrementTabLevel(self.obj[0], cobj, ctab) ) # <<<<<<<<<<<<<< * * def setTabLevel(self, level): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectIncrementTabLevel((__pyx_v_self->obj[0]), __pyx_v_cobj, __pyx_v_ctab)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(35, 199, __pyx_L1_error) /* "petsc4py/PETSc/Object.pyx":196 * # --- tab level --- * * def incrementTabLevel(self, tab, Object parent=None): # <<<<<<<<<<<<<< * cdef PetscInt ctab = asInt(tab) * cdef PetscObject cobj = NULL if parent is None else parent.obj[0] */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Object.incrementTabLevel", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Object.pyx":201 * CHKERR( PetscObjectIncrementTabLevel(self.obj[0], cobj, ctab) ) * * def setTabLevel(self, level): # <<<<<<<<<<<<<< * cdef PetscInt clevel = asInt(level) * CHKERR( PetscObjectSetTabLevel(self.obj[0], clevel) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_63setTabLevel(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Object_62setTabLevel, "Object.setTabLevel(self, level)\nSource code at petsc4py/PETSc/Object.pyx:201"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_63setTabLevel(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_level = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setTabLevel (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_level)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(35, 201, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setTabLevel") < 0)) __PYX_ERR(35, 201, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_level = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setTabLevel", 1, 1, 1, __pyx_nargs); __PYX_ERR(35, 201, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Object.setTabLevel", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_62setTabLevel(((struct PyPetscObjectObject *)__pyx_v_self), __pyx_v_level); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_62setTabLevel(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_level) { PetscInt __pyx_v_clevel; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setTabLevel", 1); /* "petsc4py/PETSc/Object.pyx":202 * * def setTabLevel(self, level): * cdef PetscInt clevel = asInt(level) # <<<<<<<<<<<<<< * CHKERR( PetscObjectSetTabLevel(self.obj[0], clevel) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_level); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(35, 202, __pyx_L1_error) __pyx_v_clevel = __pyx_t_1; /* "petsc4py/PETSc/Object.pyx":203 * def setTabLevel(self, level): * cdef PetscInt clevel = asInt(level) * CHKERR( PetscObjectSetTabLevel(self.obj[0], clevel) ) # <<<<<<<<<<<<<< * * def getTabLevel(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectSetTabLevel((__pyx_v_self->obj[0]), __pyx_v_clevel)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(35, 203, __pyx_L1_error) /* "petsc4py/PETSc/Object.pyx":201 * CHKERR( PetscObjectIncrementTabLevel(self.obj[0], cobj, ctab) ) * * def setTabLevel(self, level): # <<<<<<<<<<<<<< * cdef PetscInt clevel = asInt(level) * CHKERR( PetscObjectSetTabLevel(self.obj[0], clevel) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Object.setTabLevel", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Object.pyx":205 * CHKERR( PetscObjectSetTabLevel(self.obj[0], clevel) ) * * def getTabLevel(self): # <<<<<<<<<<<<<< * cdef PetscInt clevel = 0 * CHKERR( PetscObjectGetTabLevel(self.obj[0], &clevel) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_65getTabLevel(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Object_64getTabLevel, "Object.getTabLevel(self)\nSource code at petsc4py/PETSc/Object.pyx:205"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_65getTabLevel(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getTabLevel (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getTabLevel", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getTabLevel", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_64getTabLevel(((struct PyPetscObjectObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_64getTabLevel(struct PyPetscObjectObject *__pyx_v_self) { PetscInt __pyx_v_clevel; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getTabLevel", 1); /* "petsc4py/PETSc/Object.pyx":206 * * def getTabLevel(self): * cdef PetscInt clevel = 0 # <<<<<<<<<<<<<< * CHKERR( PetscObjectGetTabLevel(self.obj[0], &clevel) ) * return toInt(clevel) */ __pyx_v_clevel = 0; /* "petsc4py/PETSc/Object.pyx":207 * def getTabLevel(self): * cdef PetscInt clevel = 0 * CHKERR( PetscObjectGetTabLevel(self.obj[0], &clevel) ) # <<<<<<<<<<<<<< * return toInt(clevel) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectGetTabLevel((__pyx_v_self->obj[0]), (&__pyx_v_clevel))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(35, 207, __pyx_L1_error) /* "petsc4py/PETSc/Object.pyx":208 * cdef PetscInt clevel = 0 * CHKERR( PetscObjectGetTabLevel(self.obj[0], &clevel) ) * return toInt(clevel) # <<<<<<<<<<<<<< * * # --- properties --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_clevel); if (unlikely(!__pyx_t_2)) __PYX_ERR(35, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Object.pyx":205 * CHKERR( PetscObjectSetTabLevel(self.obj[0], clevel) ) * * def getTabLevel(self): # <<<<<<<<<<<<<< * cdef PetscInt clevel = 0 * CHKERR( PetscObjectGetTabLevel(self.obj[0], &clevel) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Object.getTabLevel", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Object.pyx":213 * * property type: * def __get__(self): # <<<<<<<<<<<<<< * return self.getType() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_4type_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_4type_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_4type___get__(((struct PyPetscObjectObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_4type___get__(struct PyPetscObjectObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/Object.pyx":214 * property type: * def __get__(self): * return self.getType() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setType(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getType); if (unlikely(!__pyx_t_2)) __PYX_ERR(35, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(35, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Object.pyx":213 * * property type: * def __get__(self): # <<<<<<<<<<<<<< * return self.getType() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Object.type.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Object.pyx":215 * def __get__(self): * return self.getType() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setType(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_6Object_4type_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_6Object_4type_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_4type_2__set__(((struct PyPetscObjectObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_6Object_4type_2__set__(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "petsc4py/PETSc/Object.pyx":216 * return self.getType() * def __set__(self, value): * self.setType(value) # <<<<<<<<<<<<<< * * property prefix: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setType); if (unlikely(!__pyx_t_2)) __PYX_ERR(35, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_value}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(35, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Object.pyx":215 * def __get__(self): * return self.getType() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setType(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Object.type.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Object.pyx":219 * * property prefix: * def __get__(self): # <<<<<<<<<<<<<< * return self.getOptionsPrefix() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_6prefix_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_6prefix_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_6prefix___get__(((struct PyPetscObjectObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_6prefix___get__(struct PyPetscObjectObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/Object.pyx":220 * property prefix: * def __get__(self): * return self.getOptionsPrefix() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setOptionsPrefix(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getOptionsPrefix); if (unlikely(!__pyx_t_2)) __PYX_ERR(35, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(35, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Object.pyx":219 * * property prefix: * def __get__(self): # <<<<<<<<<<<<<< * return self.getOptionsPrefix() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Object.prefix.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Object.pyx":221 * def __get__(self): * return self.getOptionsPrefix() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setOptionsPrefix(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_6Object_6prefix_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_6Object_6prefix_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_6prefix_2__set__(((struct PyPetscObjectObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_6Object_6prefix_2__set__(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "petsc4py/PETSc/Object.pyx":222 * return self.getOptionsPrefix() * def __set__(self, value): * self.setOptionsPrefix(value) # <<<<<<<<<<<<<< * * property comm: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setOptionsPrefix); if (unlikely(!__pyx_t_2)) __PYX_ERR(35, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_value}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(35, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Object.pyx":221 * def __get__(self): * return self.getOptionsPrefix() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setOptionsPrefix(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Object.prefix.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Object.pyx":225 * * property comm: * def __get__(self): # <<<<<<<<<<<<<< * return self.getComm() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_4comm_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_4comm_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_4comm___get__(((struct PyPetscObjectObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_4comm___get__(struct PyPetscObjectObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/Object.pyx":226 * property comm: * def __get__(self): * return self.getComm() # <<<<<<<<<<<<<< * * property name: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getComm); if (unlikely(!__pyx_t_2)) __PYX_ERR(35, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(35, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Object.pyx":225 * * property comm: * def __get__(self): # <<<<<<<<<<<<<< * return self.getComm() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Object.comm.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Object.pyx":229 * * property name: * def __get__(self): # <<<<<<<<<<<<<< * return self.getName() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_4name_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_4name_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_4name___get__(((struct PyPetscObjectObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_4name___get__(struct PyPetscObjectObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/Object.pyx":230 * property name: * def __get__(self): * return self.getName() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setName(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getName); if (unlikely(!__pyx_t_2)) __PYX_ERR(35, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(35, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Object.pyx":229 * * property name: * def __get__(self): # <<<<<<<<<<<<<< * return self.getName() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Object.name.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Object.pyx":231 * def __get__(self): * return self.getName() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setName(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_6Object_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_6Object_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_4name_2__set__(((struct PyPetscObjectObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_6Object_4name_2__set__(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "petsc4py/PETSc/Object.pyx":232 * return self.getName() * def __set__(self, value): * self.setName(value) # <<<<<<<<<<<<<< * * property classid: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setName); if (unlikely(!__pyx_t_2)) __PYX_ERR(35, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_value}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(35, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Object.pyx":231 * def __get__(self): * return self.getName() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setName(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Object.name.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Object.pyx":235 * * property classid: * def __get__(self): # <<<<<<<<<<<<<< * return self.getClassId() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_7classid_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_7classid_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_7classid___get__(((struct PyPetscObjectObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_7classid___get__(struct PyPetscObjectObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/Object.pyx":236 * property classid: * def __get__(self): * return self.getClassId() # <<<<<<<<<<<<<< * * property klass: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getClassId); if (unlikely(!__pyx_t_2)) __PYX_ERR(35, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(35, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Object.pyx":235 * * property classid: * def __get__(self): # <<<<<<<<<<<<<< * return self.getClassId() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Object.classid.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Object.pyx":239 * * property klass: * def __get__(self): # <<<<<<<<<<<<<< * return self.getClassName() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_5klass_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_5klass_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_5klass___get__(((struct PyPetscObjectObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_5klass___get__(struct PyPetscObjectObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/Object.pyx":240 * property klass: * def __get__(self): * return self.getClassName() # <<<<<<<<<<<<<< * * property refcount: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getClassName); if (unlikely(!__pyx_t_2)) __PYX_ERR(35, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(35, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Object.pyx":239 * * property klass: * def __get__(self): # <<<<<<<<<<<<<< * return self.getClassName() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Object.klass.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Object.pyx":243 * * property refcount: * def __get__(self): # <<<<<<<<<<<<<< * return self.getRefCount() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_8refcount_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_8refcount_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_8refcount___get__(((struct PyPetscObjectObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_8refcount___get__(struct PyPetscObjectObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/Object.pyx":244 * property refcount: * def __get__(self): * return self.getRefCount() # <<<<<<<<<<<<<< * * # --- ctypes support --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getRefCount); if (unlikely(!__pyx_t_2)) __PYX_ERR(35, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(35, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Object.pyx":243 * * property refcount: * def __get__(self): # <<<<<<<<<<<<<< * return self.getRefCount() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Object.refcount.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Object.pyx":249 * * property handle: * def __get__(self): # <<<<<<<<<<<<<< * cdef PetscObject obj = self.obj[0] * return PyLong_FromVoidPtr(obj) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_6handle_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_6handle_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_6handle___get__(((struct PyPetscObjectObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_6handle___get__(struct PyPetscObjectObject *__pyx_v_self) { PetscObject __pyx_v_obj; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/Object.pyx":250 * property handle: * def __get__(self): * cdef PetscObject obj = self.obj[0] # <<<<<<<<<<<<<< * return PyLong_FromVoidPtr(obj) * */ __pyx_v_obj = (__pyx_v_self->obj[0]); /* "petsc4py/PETSc/Object.pyx":251 * def __get__(self): * cdef PetscObject obj = self.obj[0] * return PyLong_FromVoidPtr(obj) # <<<<<<<<<<<<<< * * # --- Fortran support --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyLong_FromVoidPtr(((void *)__pyx_v_obj)); if (unlikely(!__pyx_t_1)) __PYX_ERR(35, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Object.pyx":249 * * property handle: * def __get__(self): # <<<<<<<<<<<<<< * cdef PetscObject obj = self.obj[0] * return PyLong_FromVoidPtr(obj) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Object.handle.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Object.pyx":256 * * property fortran: * def __get__(self): # <<<<<<<<<<<<<< * cdef PetscObject obj = self.obj[0] * return Object_toFortran(obj) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_7fortran_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_7fortran_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_7fortran___get__(((struct PyPetscObjectObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_7fortran___get__(struct PyPetscObjectObject *__pyx_v_self) { PetscObject __pyx_v_obj; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Py_intptr_t __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/Object.pyx":257 * property fortran: * def __get__(self): * cdef PetscObject obj = self.obj[0] # <<<<<<<<<<<<<< * return Object_toFortran(obj) * */ __pyx_v_obj = (__pyx_v_self->obj[0]); /* "petsc4py/PETSc/Object.pyx":258 * def __get__(self): * cdef PetscObject obj = self.obj[0] * return Object_toFortran(obj) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_Object_toFortran(__pyx_v_obj); if (unlikely(__pyx_t_1 == ((Py_intptr_t)-1) && PyErr_Occurred())) __PYX_ERR(35, 258, __pyx_L1_error) __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(35, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Object.pyx":256 * * property fortran: * def __get__(self): # <<<<<<<<<<<<<< * cdef PetscObject obj = self.obj[0] * return Object_toFortran(obj) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Object.fortran.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/cyclicgc.pxi":22 * PetscErrorCode PetscGarbageView(MPI_Comm,PetscViewer); * * cdef int tp_traverse(PyObject *o, visitproc visit, void *arg) noexcept: # <<<<<<<<<<<<<< * ## printf("%s.tp_traverse(%p)\n", Py_TYPE(o).tp_name, o) * cdef PetscObject p = (o).obj[0] */ static int __pyx_f_8petsc4py_5PETSc_tp_traverse(PyObject *__pyx_v_o, visitproc __pyx_v_visit, void *__pyx_v_arg) { PetscObject __pyx_v_p; PyObject *__pyx_v_d; int __pyx_r; int __pyx_t_1; /* "petsc4py/PETSc/cyclicgc.pxi":24 * cdef int tp_traverse(PyObject *o, visitproc visit, void *arg) noexcept: * ## printf("%s.tp_traverse(%p)\n", Py_TYPE(o).tp_name, o) * cdef PetscObject p = (o).obj[0] # <<<<<<<<<<<<<< * if p == NULL: return 0 * cdef PyObject *d = p.python_context */ __pyx_v_p = (((struct PyPetscObjectObject *)__pyx_v_o)->obj[0]); /* "petsc4py/PETSc/cyclicgc.pxi":25 * ## printf("%s.tp_traverse(%p)\n", Py_TYPE(o).tp_name, o) * cdef PetscObject p = (o).obj[0] * if p == NULL: return 0 # <<<<<<<<<<<<<< * cdef PyObject *d = p.python_context * if d == NULL: return 0 */ __pyx_t_1 = (__pyx_v_p == NULL); if (__pyx_t_1) { __pyx_r = 0; goto __pyx_L0; } /* "petsc4py/PETSc/cyclicgc.pxi":26 * cdef PetscObject p = (o).obj[0] * if p == NULL: return 0 * cdef PyObject *d = p.python_context # <<<<<<<<<<<<<< * if d == NULL: return 0 * return visit(d, arg) */ __pyx_v_d = ((PyObject *)__pyx_v_p->python_context); /* "petsc4py/PETSc/cyclicgc.pxi":27 * if p == NULL: return 0 * cdef PyObject *d = p.python_context * if d == NULL: return 0 # <<<<<<<<<<<<<< * return visit(d, arg) * */ __pyx_t_1 = (__pyx_v_d == NULL); if (__pyx_t_1) { __pyx_r = 0; goto __pyx_L0; } /* "petsc4py/PETSc/cyclicgc.pxi":28 * cdef PyObject *d = p.python_context * if d == NULL: return 0 * return visit(d, arg) # <<<<<<<<<<<<<< * * cdef int tp_clear(PyObject *o) noexcept: */ __pyx_r = __pyx_v_visit(__pyx_v_d, __pyx_v_arg); goto __pyx_L0; /* "petsc4py/PETSc/cyclicgc.pxi":22 * PetscErrorCode PetscGarbageView(MPI_Comm,PetscViewer); * * cdef int tp_traverse(PyObject *o, visitproc visit, void *arg) noexcept: # <<<<<<<<<<<<<< * ## printf("%s.tp_traverse(%p)\n", Py_TYPE(o).tp_name, o) * cdef PetscObject p = (o).obj[0] */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/cyclicgc.pxi":30 * return visit(d, arg) * * cdef int tp_clear(PyObject *o) noexcept: # <<<<<<<<<<<<<< * ## printf("%s.tp_clear(%p)\n", Py_TYPE(o).tp_name, o) * cdef PetscObject *p = (o).obj */ static int __pyx_f_8petsc4py_5PETSc_tp_clear(PyObject *__pyx_v_o) { PetscObject *__pyx_v_p; int __pyx_r; PetscObject *__pyx_t_1; /* "petsc4py/PETSc/cyclicgc.pxi":32 * cdef int tp_clear(PyObject *o) noexcept: * ## printf("%s.tp_clear(%p)\n", Py_TYPE(o).tp_name, o) * cdef PetscObject *p = (o).obj # <<<<<<<<<<<<<< * PetscDEALLOC(p) * return 0 */ __pyx_t_1 = ((struct PyPetscObjectObject *)__pyx_v_o)->obj; __pyx_v_p = __pyx_t_1; /* "petsc4py/PETSc/cyclicgc.pxi":33 * ## printf("%s.tp_clear(%p)\n", Py_TYPE(o).tp_name, o) * cdef PetscObject *p = (o).obj * PetscDEALLOC(p) # <<<<<<<<<<<<<< * return 0 * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscDEALLOC(__pyx_v_p)); /* "petsc4py/PETSc/cyclicgc.pxi":34 * cdef PetscObject *p = (o).obj * PetscDEALLOC(p) * return 0 # <<<<<<<<<<<<<< * * cdef inline void TypeEnableGC(PyTypeObject *t) noexcept: */ __pyx_r = 0; goto __pyx_L0; /* "petsc4py/PETSc/cyclicgc.pxi":30 * return visit(d, arg) * * cdef int tp_clear(PyObject *o) noexcept: # <<<<<<<<<<<<<< * ## printf("%s.tp_clear(%p)\n", Py_TYPE(o).tp_name, o) * cdef PetscObject *p = (o).obj */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/cyclicgc.pxi":36 * return 0 * * cdef inline void TypeEnableGC(PyTypeObject *t) noexcept: # <<<<<<<<<<<<<< * ## printf("%s: enforcing GC support\n", t.tp_name) * t.tp_traverse = tp_traverse */ static CYTHON_INLINE void __pyx_f_8petsc4py_5PETSc_TypeEnableGC(PyTypeObject *__pyx_v_t) { /* "petsc4py/PETSc/cyclicgc.pxi":38 * cdef inline void TypeEnableGC(PyTypeObject *t) noexcept: * ## printf("%s: enforcing GC support\n", t.tp_name) * t.tp_traverse = tp_traverse # <<<<<<<<<<<<<< * t.tp_clear = tp_clear * */ __pyx_v_t->tp_traverse = __pyx_f_8petsc4py_5PETSc_tp_traverse; /* "petsc4py/PETSc/cyclicgc.pxi":39 * ## printf("%s: enforcing GC support\n", t.tp_name) * t.tp_traverse = tp_traverse * t.tp_clear = tp_clear # <<<<<<<<<<<<<< * * def garbage_cleanup(comm=None): */ __pyx_v_t->tp_clear = __pyx_f_8petsc4py_5PETSc_tp_clear; /* "petsc4py/PETSc/cyclicgc.pxi":36 * return 0 * * cdef inline void TypeEnableGC(PyTypeObject *t) noexcept: # <<<<<<<<<<<<<< * ## printf("%s: enforcing GC support\n", t.tp_name) * t.tp_traverse = tp_traverse */ /* function exit code */ } /* "petsc4py/PETSc/cyclicgc.pxi":41 * t.tp_clear = tp_clear * * def garbage_cleanup(comm=None): # <<<<<<<<<<<<<< * """Clean up unused PETSc objects. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_1garbage_cleanup(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_garbage_cleanup, "garbage_cleanup(comm=None)\nClean up unused PETSc objects.\n\n Collective.\n\n Notes\n -----\n If the communicator ``comm`` if not provided or it is `None`,\n then `COMM_WORLD` is used.\n\n \nSource code at petsc4py/PETSc/cyclicgc.pxi:41"); static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_1garbage_cleanup = {"garbage_cleanup", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_1garbage_cleanup, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_garbage_cleanup}; static PyObject *__pyx_pw_8petsc4py_5PETSc_1garbage_cleanup(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("garbage_cleanup (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(36, 41, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "garbage_cleanup") < 0)) __PYX_ERR(36, 41, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_comm = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("garbage_cleanup", 0, 0, 1, __pyx_nargs); __PYX_ERR(36, 41, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.garbage_cleanup", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_garbage_cleanup(__pyx_self, __pyx_v_comm); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_garbage_cleanup(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; MPI_Comm __pyx_t_3; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("garbage_cleanup", 1); /* "petsc4py/PETSc/cyclicgc.pxi":52 * * """ * if not (PetscInitializeCalled): return # <<<<<<<<<<<<<< * if (PetscFinalizeCalled): return * cdef MPI_Comm ccomm = MPI_COMM_NULL */ __pyx_t_1 = (!(((int)PetscInitializeCalled) != 0)); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } /* "petsc4py/PETSc/cyclicgc.pxi":53 * """ * if not (PetscInitializeCalled): return * if (PetscFinalizeCalled): return # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = MPI_COMM_NULL * if comm is None: */ __pyx_t_1 = (((int)PetscFinalizeCalled) != 0); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } /* "petsc4py/PETSc/cyclicgc.pxi":54 * if not (PetscInitializeCalled): return * if (PetscFinalizeCalled): return * cdef MPI_Comm ccomm = MPI_COMM_NULL # <<<<<<<<<<<<<< * if comm is None: * ccomm = GetComm(COMM_WORLD, MPI_COMM_NULL) */ __pyx_v_ccomm = MPI_COMM_NULL; /* "petsc4py/PETSc/cyclicgc.pxi":55 * if (PetscFinalizeCalled): return * cdef MPI_Comm ccomm = MPI_COMM_NULL * if comm is None: # <<<<<<<<<<<<<< * ccomm = GetComm(COMM_WORLD, MPI_COMM_NULL) * CHKERR( PetscGarbageCleanup(ccomm) ) */ __pyx_t_1 = (__pyx_v_comm == Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/cyclicgc.pxi":56 * cdef MPI_Comm ccomm = MPI_COMM_NULL * if comm is None: * ccomm = GetComm(COMM_WORLD, MPI_COMM_NULL) # <<<<<<<<<<<<<< * CHKERR( PetscGarbageCleanup(ccomm) ) * else: */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_COMM_WORLD); if (unlikely(!__pyx_t_2)) __PYX_ERR(36, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_GetComm(__pyx_t_2, MPI_COMM_NULL); if (unlikely(__pyx_t_3 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(36, 56, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_ccomm = __pyx_t_3; /* "petsc4py/PETSc/cyclicgc.pxi":57 * if comm is None: * ccomm = GetComm(COMM_WORLD, MPI_COMM_NULL) * CHKERR( PetscGarbageCleanup(ccomm) ) # <<<<<<<<<<<<<< * else: * ccomm = GetComm(comm, MPI_COMM_NULL) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscGarbageCleanup(__pyx_v_ccomm)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(36, 57, __pyx_L1_error) /* "petsc4py/PETSc/cyclicgc.pxi":55 * if (PetscFinalizeCalled): return * cdef MPI_Comm ccomm = MPI_COMM_NULL * if comm is None: # <<<<<<<<<<<<<< * ccomm = GetComm(COMM_WORLD, MPI_COMM_NULL) * CHKERR( PetscGarbageCleanup(ccomm) ) */ goto __pyx_L5; } /* "petsc4py/PETSc/cyclicgc.pxi":59 * CHKERR( PetscGarbageCleanup(ccomm) ) * else: * ccomm = GetComm(comm, MPI_COMM_NULL) # <<<<<<<<<<<<<< * if ccomm == MPI_COMM_NULL: * raise ValueError("null communicator") */ /*else*/ { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_GetComm(__pyx_v_comm, MPI_COMM_NULL); if (unlikely(__pyx_t_3 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(36, 59, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_3; /* "petsc4py/PETSc/cyclicgc.pxi":60 * else: * ccomm = GetComm(comm, MPI_COMM_NULL) * if ccomm == MPI_COMM_NULL: # <<<<<<<<<<<<<< * raise ValueError("null communicator") * CHKERR( PetscGarbageCleanup(ccomm) ) */ __pyx_t_1 = (__pyx_v_ccomm == MPI_COMM_NULL); if (unlikely(__pyx_t_1)) { /* "petsc4py/PETSc/cyclicgc.pxi":61 * ccomm = GetComm(comm, MPI_COMM_NULL) * if ccomm == MPI_COMM_NULL: * raise ValueError("null communicator") # <<<<<<<<<<<<<< * CHKERR( PetscGarbageCleanup(ccomm) ) * */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(36, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(36, 61, __pyx_L1_error) /* "petsc4py/PETSc/cyclicgc.pxi":60 * else: * ccomm = GetComm(comm, MPI_COMM_NULL) * if ccomm == MPI_COMM_NULL: # <<<<<<<<<<<<<< * raise ValueError("null communicator") * CHKERR( PetscGarbageCleanup(ccomm) ) */ } /* "petsc4py/PETSc/cyclicgc.pxi":62 * if ccomm == MPI_COMM_NULL: * raise ValueError("null communicator") * CHKERR( PetscGarbageCleanup(ccomm) ) # <<<<<<<<<<<<<< * * def garbage_view(comm=None): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscGarbageCleanup(__pyx_v_ccomm)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(36, 62, __pyx_L1_error) } __pyx_L5:; /* "petsc4py/PETSc/cyclicgc.pxi":41 * t.tp_clear = tp_clear * * def garbage_cleanup(comm=None): # <<<<<<<<<<<<<< * """Clean up unused PETSc objects. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.garbage_cleanup", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/cyclicgc.pxi":64 * CHKERR( PetscGarbageCleanup(ccomm) ) * * def garbage_view(comm=None): # <<<<<<<<<<<<<< * """Print summary of the garbage PETSc objects. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3garbage_view(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2garbage_view, "garbage_view(comm=None)\nPrint summary of the garbage PETSc objects.\n\n Collective.\n\n Notes\n -----\n Print out garbage summary on each rank of the communicator ``comm``.\n If no communicator is provided then `COMM_WORLD` is used.\n\n \nSource code at petsc4py/PETSc/cyclicgc.pxi:64"); static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3garbage_view = {"garbage_view", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3garbage_view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2garbage_view}; static PyObject *__pyx_pw_8petsc4py_5PETSc_3garbage_view(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("garbage_view (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(36, 64, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "garbage_view") < 0)) __PYX_ERR(36, 64, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_comm = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("garbage_view", 0, 0, 1, __pyx_nargs); __PYX_ERR(36, 64, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.garbage_view", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2garbage_view(__pyx_self, __pyx_v_comm); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2garbage_view(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; MPI_Comm __pyx_t_3; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("garbage_view", 0); __Pyx_INCREF(__pyx_v_comm); /* "petsc4py/PETSc/cyclicgc.pxi":75 * * """ * if not (PetscInitializeCalled): return # <<<<<<<<<<<<<< * if (PetscFinalizeCalled): return * cdef MPI_Comm ccomm = MPI_COMM_NULL */ __pyx_t_1 = (!(((int)PetscInitializeCalled) != 0)); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } /* "petsc4py/PETSc/cyclicgc.pxi":76 * """ * if not (PetscInitializeCalled): return * if (PetscFinalizeCalled): return # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = MPI_COMM_NULL * if comm is None: */ __pyx_t_1 = (((int)PetscFinalizeCalled) != 0); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } /* "petsc4py/PETSc/cyclicgc.pxi":77 * if not (PetscInitializeCalled): return * if (PetscFinalizeCalled): return * cdef MPI_Comm ccomm = MPI_COMM_NULL # <<<<<<<<<<<<<< * if comm is None: * comm = COMM_WORLD */ __pyx_v_ccomm = MPI_COMM_NULL; /* "petsc4py/PETSc/cyclicgc.pxi":78 * if (PetscFinalizeCalled): return * cdef MPI_Comm ccomm = MPI_COMM_NULL * if comm is None: # <<<<<<<<<<<<<< * comm = COMM_WORLD * ccomm = GetComm(comm, MPI_COMM_NULL) */ __pyx_t_1 = (__pyx_v_comm == Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/cyclicgc.pxi":79 * cdef MPI_Comm ccomm = MPI_COMM_NULL * if comm is None: * comm = COMM_WORLD # <<<<<<<<<<<<<< * ccomm = GetComm(comm, MPI_COMM_NULL) * if ccomm == MPI_COMM_NULL: */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_COMM_WORLD); if (unlikely(!__pyx_t_2)) __PYX_ERR(36, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_comm, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/cyclicgc.pxi":78 * if (PetscFinalizeCalled): return * cdef MPI_Comm ccomm = MPI_COMM_NULL * if comm is None: # <<<<<<<<<<<<<< * comm = COMM_WORLD * ccomm = GetComm(comm, MPI_COMM_NULL) */ } /* "petsc4py/PETSc/cyclicgc.pxi":80 * if comm is None: * comm = COMM_WORLD * ccomm = GetComm(comm, MPI_COMM_NULL) # <<<<<<<<<<<<<< * if ccomm == MPI_COMM_NULL: * raise ValueError("null communicator") */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_GetComm(__pyx_v_comm, MPI_COMM_NULL); if (unlikely(__pyx_t_3 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(36, 80, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_3; /* "petsc4py/PETSc/cyclicgc.pxi":81 * comm = COMM_WORLD * ccomm = GetComm(comm, MPI_COMM_NULL) * if ccomm == MPI_COMM_NULL: # <<<<<<<<<<<<<< * raise ValueError("null communicator") * CHKERR( PetscGarbageView(ccomm, NULL) ) */ __pyx_t_1 = (__pyx_v_ccomm == MPI_COMM_NULL); if (unlikely(__pyx_t_1)) { /* "petsc4py/PETSc/cyclicgc.pxi":82 * ccomm = GetComm(comm, MPI_COMM_NULL) * if ccomm == MPI_COMM_NULL: * raise ValueError("null communicator") # <<<<<<<<<<<<<< * CHKERR( PetscGarbageView(ccomm, NULL) ) * */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(36, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(36, 82, __pyx_L1_error) /* "petsc4py/PETSc/cyclicgc.pxi":81 * comm = COMM_WORLD * ccomm = GetComm(comm, MPI_COMM_NULL) * if ccomm == MPI_COMM_NULL: # <<<<<<<<<<<<<< * raise ValueError("null communicator") * CHKERR( PetscGarbageView(ccomm, NULL) ) */ } /* "petsc4py/PETSc/cyclicgc.pxi":83 * if ccomm == MPI_COMM_NULL: * raise ValueError("null communicator") * CHKERR( PetscGarbageView(ccomm, NULL) ) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscGarbageView(__pyx_v_ccomm, NULL)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(36, 83, __pyx_L1_error) /* "petsc4py/PETSc/cyclicgc.pxi":64 * CHKERR( PetscGarbageCleanup(ccomm) ) * * def garbage_view(comm=None): # <<<<<<<<<<<<<< * """Print summary of the garbage PETSc objects. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.garbage_view", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_comm); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Object.pyx":267 * __type_registry__ = type_registry * * cdef int PyPetscType_Register(int classid, type cls) except -1: # <<<<<<<<<<<<<< * global type_registry * cdef object key = classid */ static int __pyx_f_8petsc4py_5PETSc_PyPetscType_Register(int __pyx_v_classid, PyTypeObject *__pyx_v_cls) { PyObject *__pyx_v_key = 0; PyObject *__pyx_v_value = 0; char const *__pyx_v_dummy; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscType_Register", 1); /* "petsc4py/PETSc/Object.pyx":269 * cdef int PyPetscType_Register(int classid, type cls) except -1: * global type_registry * cdef object key = classid # <<<<<<<<<<<<<< * cdef object value = cls * cdef const char *dummy = NULL */ __pyx_t_1 = __Pyx_PyInt_From_long(((long)__pyx_v_classid)); if (unlikely(!__pyx_t_1)) __PYX_ERR(35, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_key = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/Object.pyx":270 * global type_registry * cdef object key = classid * cdef object value = cls # <<<<<<<<<<<<<< * cdef const char *dummy = NULL * if key not in type_registry: */ __Pyx_INCREF((PyObject *)__pyx_v_cls); __pyx_v_value = ((PyObject *)__pyx_v_cls); /* "petsc4py/PETSc/Object.pyx":271 * cdef object key = classid * cdef object value = cls * cdef const char *dummy = NULL # <<<<<<<<<<<<<< * if key not in type_registry: * type_registry[key] = cls */ __pyx_v_dummy = NULL; /* "petsc4py/PETSc/Object.pyx":272 * cdef object value = cls * cdef const char *dummy = NULL * if key not in type_registry: # <<<<<<<<<<<<<< * type_registry[key] = cls * reg_LogClass(str2bytes(cls.__name__, &dummy), */ if (unlikely(__pyx_v_8petsc4py_5PETSc_type_registry == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(35, 272, __pyx_L1_error) } __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_v_key, __pyx_v_8petsc4py_5PETSc_type_registry, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(35, 272, __pyx_L1_error) if (__pyx_t_2) { /* "petsc4py/PETSc/Object.pyx":273 * cdef const char *dummy = NULL * if key not in type_registry: * type_registry[key] = cls # <<<<<<<<<<<<<< * reg_LogClass(str2bytes(cls.__name__, &dummy), * classid) */ if (unlikely(__pyx_v_8petsc4py_5PETSc_type_registry == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(35, 273, __pyx_L1_error) } if (unlikely((PyDict_SetItem(__pyx_v_8petsc4py_5PETSc_type_registry, __pyx_v_key, ((PyObject *)__pyx_v_cls)) < 0))) __PYX_ERR(35, 273, __pyx_L1_error) /* "petsc4py/PETSc/Object.pyx":274 * if key not in type_registry: * type_registry[key] = cls * reg_LogClass(str2bytes(cls.__name__, &dummy), # <<<<<<<<<<<<<< * classid) * TypeEnableGC(cls) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_cls), __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(35, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_t_1, (&__pyx_v_dummy)); if (unlikely(!__pyx_t_3)) __PYX_ERR(35, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Object.pyx":275 * type_registry[key] = cls * reg_LogClass(str2bytes(cls.__name__, &dummy), * classid) # <<<<<<<<<<<<<< * TypeEnableGC(cls) * else: */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_reg_LogClass(__pyx_t_3, ((PetscClassId)__pyx_v_classid))); if (unlikely(!__pyx_t_1)) __PYX_ERR(35, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Object.pyx":276 * reg_LogClass(str2bytes(cls.__name__, &dummy), * classid) * TypeEnableGC(cls) # <<<<<<<<<<<<<< * else: * value = type_registry[key] */ __pyx_f_8petsc4py_5PETSc_TypeEnableGC(((PyTypeObject *)__pyx_v_cls)); /* "petsc4py/PETSc/Object.pyx":272 * cdef object value = cls * cdef const char *dummy = NULL * if key not in type_registry: # <<<<<<<<<<<<<< * type_registry[key] = cls * reg_LogClass(str2bytes(cls.__name__, &dummy), */ goto __pyx_L3; } /* "petsc4py/PETSc/Object.pyx":278 * TypeEnableGC(cls) * else: * value = type_registry[key] # <<<<<<<<<<<<<< * if cls is not value: * raise ValueError( */ /*else*/ { if (unlikely(__pyx_v_8petsc4py_5PETSc_type_registry == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(35, 278, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_8petsc4py_5PETSc_type_registry, __pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(35, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Object.pyx":279 * else: * value = type_registry[key] * if cls is not value: # <<<<<<<<<<<<<< * raise ValueError( * "key: %d, cannot register: %s, " \ */ __pyx_t_2 = (__pyx_v_cls != ((PyTypeObject*)__pyx_v_value)); if (unlikely(__pyx_t_2)) { /* "petsc4py/PETSc/Object.pyx":282 * raise ValueError( * "key: %d, cannot register: %s, " \ * "already registered: %s" % (key, cls, value)) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(35, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_key)) __PYX_ERR(35, 282, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_cls); __Pyx_GIVEREF((PyObject *)__pyx_v_cls); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_cls))) __PYX_ERR(35, 282, __pyx_L1_error); __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_value)) __PYX_ERR(35, 282, __pyx_L1_error); __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_key_d_cannot_register_s_already, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(35, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Object.pyx":280 * value = type_registry[key] * if cls is not value: * raise ValueError( # <<<<<<<<<<<<<< * "key: %d, cannot register: %s, " \ * "already registered: %s" % (key, cls, value)) */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(35, 280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(35, 280, __pyx_L1_error) /* "petsc4py/PETSc/Object.pyx":279 * else: * value = type_registry[key] * if cls is not value: # <<<<<<<<<<<<<< * raise ValueError( * "key: %d, cannot register: %s, " \ */ } } __pyx_L3:; /* "petsc4py/PETSc/Object.pyx":283 * "key: %d, cannot register: %s, " \ * "already registered: %s" % (key, cls, value)) * return 0 # <<<<<<<<<<<<<< * * cdef type PyPetscType_Lookup(int classid): */ __pyx_r = 0; goto __pyx_L0; /* "petsc4py/PETSc/Object.pyx":267 * __type_registry__ = type_registry * * cdef int PyPetscType_Register(int classid, type cls) except -1: # <<<<<<<<<<<<<< * global type_registry * cdef object key = classid */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscType_Register", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_key); __Pyx_XDECREF(__pyx_v_value); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Object.pyx":285 * return 0 * * cdef type PyPetscType_Lookup(int classid): # <<<<<<<<<<<<<< * global type_registry * cdef object key = classid */ static PyTypeObject *__pyx_f_8petsc4py_5PETSc_PyPetscType_Lookup(int __pyx_v_classid) { PyObject *__pyx_v_key = 0; PyTypeObject *__pyx_v_cls = 0; PyTypeObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscType_Lookup", 1); /* "petsc4py/PETSc/Object.pyx":287 * cdef type PyPetscType_Lookup(int classid): * global type_registry * cdef object key = classid # <<<<<<<<<<<<<< * cdef type cls = Object * try: */ __pyx_t_1 = __Pyx_PyInt_From_long(((long)__pyx_v_classid)); if (unlikely(!__pyx_t_1)) __PYX_ERR(35, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_key = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/Object.pyx":288 * global type_registry * cdef object key = classid * cdef type cls = Object # <<<<<<<<<<<<<< * try: * cls = type_registry[key] */ __Pyx_INCREF((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Object); __pyx_v_cls = __pyx_ptype_8petsc4py_5PETSc_Object; /* "petsc4py/PETSc/Object.pyx":289 * cdef object key = classid * cdef type cls = Object * try: # <<<<<<<<<<<<<< * cls = type_registry[key] * except KeyError: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_4); /*try:*/ { /* "petsc4py/PETSc/Object.pyx":290 * cdef type cls = Object * try: * cls = type_registry[key] # <<<<<<<<<<<<<< * except KeyError: * cls = Object */ if (unlikely(__pyx_v_8petsc4py_5PETSc_type_registry == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(35, 290, __pyx_L3_error) } __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_8petsc4py_5PETSc_type_registry, __pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(35, 290, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyType_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("type", __pyx_t_1))) __PYX_ERR(35, 290, __pyx_L3_error) __Pyx_DECREF_SET(__pyx_v_cls, ((PyTypeObject*)__pyx_t_1)); __pyx_t_1 = 0; /* "petsc4py/PETSc/Object.pyx":289 * cdef object key = classid * cdef type cls = Object * try: # <<<<<<<<<<<<<< * cls = type_registry[key] * except KeyError: */ } __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Object.pyx":291 * try: * cls = type_registry[key] * except KeyError: # <<<<<<<<<<<<<< * cls = Object * return cls */ __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_5) { __Pyx_AddTraceback("petsc4py.PETSc.PyPetscType_Lookup", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(35, 291, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); /* "petsc4py/PETSc/Object.pyx":292 * cls = type_registry[key] * except KeyError: * cls = Object # <<<<<<<<<<<<<< * return cls * */ __Pyx_INCREF((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Object); __Pyx_DECREF_SET(__pyx_v_cls, __pyx_ptype_8petsc4py_5PETSc_Object); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L4_exception_handled; } goto __pyx_L5_except_error; /* "petsc4py/PETSc/Object.pyx":289 * cdef object key = classid * cdef type cls = Object * try: # <<<<<<<<<<<<<< * cls = type_registry[key] * except KeyError: */ __pyx_L5_except_error:; __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); goto __pyx_L1_error; __pyx_L4_exception_handled:; __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); __pyx_L8_try_end:; } /* "petsc4py/PETSc/Object.pyx":293 * except KeyError: * cls = Object * return cls # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_cls); __pyx_r = __pyx_v_cls; goto __pyx_L0; /* "petsc4py/PETSc/Object.pyx":285 * return 0 * * cdef type PyPetscType_Lookup(int classid): # <<<<<<<<<<<<<< * global type_registry * cdef object key = classid */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscType_Lookup", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_key); __Pyx_XDECREF((PyObject *)__pyx_v_cls); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Viewer.pyx":123 * # * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.vwr * self.vwr = NULL */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_6Viewer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_6Viewer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer___cinit__(((struct PyPetscViewerObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_6Viewer___cinit__(struct PyPetscViewerObject *__pyx_v_self) { int __pyx_r; /* "petsc4py/PETSc/Viewer.pyx":124 * * def __cinit__(self): * self.obj = &self.vwr # <<<<<<<<<<<<<< * self.vwr = NULL * */ __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->vwr)); /* "petsc4py/PETSc/Viewer.pyx":125 * def __cinit__(self): * self.obj = &self.vwr * self.vwr = NULL # <<<<<<<<<<<<<< * * def __call__(self, Object obj) -> None: */ __pyx_v_self->vwr = NULL; /* "petsc4py/PETSc/Viewer.pyx":123 * # * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.vwr * self.vwr = NULL */ /* function exit code */ __pyx_r = 0; return __pyx_r; } /* "petsc4py/PETSc/Viewer.pyx":127 * self.vwr = NULL * * def __call__(self, Object obj) -> None: # <<<<<<<<<<<<<< * """View a generic object.""" * assert obj.obj != NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Viewer_2__call__, "View a generic object."); #if CYTHON_UPDATE_DESCRIPTOR_DOC struct wrapperbase __pyx_wrapperbase_8petsc4py_5PETSc_6Viewer_2__call__; #endif static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscObjectObject *__pyx_v_obj = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_obj)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(37, 127, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__call__") < 0)) __PYX_ERR(37, 127, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); } __pyx_v_obj = ((struct PyPetscObjectObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, __pyx_nargs); __PYX_ERR(37, 127, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Viewer.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_obj), __pyx_ptype_8petsc4py_5PETSc_Object, 0, "obj", 0))) __PYX_ERR(37, 127, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_2__call__(((struct PyPetscViewerObject *)__pyx_v_self), __pyx_v_obj); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_2__call__(struct PyPetscViewerObject *__pyx_v_self, struct PyPetscObjectObject *__pyx_v_obj) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 1); /* "petsc4py/PETSc/Viewer.pyx":129 * def __call__(self, Object obj) -> None: * """View a generic object.""" * assert obj.obj != NULL # <<<<<<<<<<<<<< * CHKERR( PetscObjectView(obj.obj[0], self.vwr) ) * */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_1 = (__pyx_v_obj->obj != NULL); if (unlikely(!__pyx_t_1)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(37, 129, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(37, 129, __pyx_L1_error) #endif /* "petsc4py/PETSc/Viewer.pyx":130 * """View a generic object.""" * assert obj.obj != NULL * CHKERR( PetscObjectView(obj.obj[0], self.vwr) ) # <<<<<<<<<<<<<< * * # */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectView((__pyx_v_obj->obj[0]), __pyx_v_self->vwr)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 130, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":127 * self.vwr = NULL * * def __call__(self, Object obj) -> None: # <<<<<<<<<<<<<< * """View a generic object.""" * assert obj.obj != NULL */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Viewer.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Viewer.pyx":134 * # * * def view(self, obj: Viewer | Object | None = None) -> None: # <<<<<<<<<<<<<< * """View the viewer. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_5view(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Viewer_4view, "Viewer.view(self, obj: Viewer | Object | None = None) -> None\nView the viewer.\n\n Collective.\n\n Parameters\n ----------\n obj\n A `Viewer` instance or `None` for the default viewer.\n If none of the above applies, it assumes ``obj`` is an instance of `Object`\n and it calls the generic view for ``obj``.\n\n Notes\n -----\n\n See Also\n --------\n petsc.PetscViewerView\n\n \nSource code at petsc4py/PETSc/Viewer.pyx:134"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_5view(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_obj = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("view (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_obj); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(37, 134, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "view") < 0)) __PYX_ERR(37, 134, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_obj = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, __pyx_nargs); __PYX_ERR(37, 134, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Viewer.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_4view(((struct PyPetscViewerObject *)__pyx_v_self), __pyx_v_obj); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_4view(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_obj) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("view", 1); /* "petsc4py/PETSc/Viewer.pyx":154 * * """ * if obj is None: # <<<<<<<<<<<<<< * CHKERR( PetscViewerView(self.vwr, NULL) ) * elif isinstance(obj, Viewer): */ __pyx_t_1 = (__pyx_v_obj == Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/Viewer.pyx":155 * """ * if obj is None: * CHKERR( PetscViewerView(self.vwr, NULL) ) # <<<<<<<<<<<<<< * elif isinstance(obj, Viewer): * CHKERR( PetscViewerView(self.vwr, (obj).vwr) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerView(__pyx_v_self->vwr, NULL)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 155, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":154 * * """ * if obj is None: # <<<<<<<<<<<<<< * CHKERR( PetscViewerView(self.vwr, NULL) ) * elif isinstance(obj, Viewer): */ goto __pyx_L3; } /* "petsc4py/PETSc/Viewer.pyx":156 * if obj is None: * CHKERR( PetscViewerView(self.vwr, NULL) ) * elif isinstance(obj, Viewer): # <<<<<<<<<<<<<< * CHKERR( PetscViewerView(self.vwr, (obj).vwr) ) * else: */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_ptype_8petsc4py_5PETSc_Viewer); if (__pyx_t_1) { /* "petsc4py/PETSc/Viewer.pyx":157 * CHKERR( PetscViewerView(self.vwr, NULL) ) * elif isinstance(obj, Viewer): * CHKERR( PetscViewerView(self.vwr, (obj).vwr) ) # <<<<<<<<<<<<<< * else: * assert (obj).obj != NULL */ if (!(likely(__Pyx_TypeTest(__pyx_v_obj, __pyx_ptype_8petsc4py_5PETSc_Viewer)))) __PYX_ERR(37, 157, __pyx_L1_error) __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerView(__pyx_v_self->vwr, ((struct PyPetscViewerObject *)__pyx_v_obj)->vwr)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 157, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":156 * if obj is None: * CHKERR( PetscViewerView(self.vwr, NULL) ) * elif isinstance(obj, Viewer): # <<<<<<<<<<<<<< * CHKERR( PetscViewerView(self.vwr, (obj).vwr) ) * else: */ goto __pyx_L3; } /* "petsc4py/PETSc/Viewer.pyx":159 * CHKERR( PetscViewerView(self.vwr, (obj).vwr) ) * else: * assert (obj).obj != NULL # <<<<<<<<<<<<<< * CHKERR( PetscObjectView((obj).obj[0], self.vwr) ) * */ /*else*/ { #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { if (!(likely(__Pyx_TypeTest(__pyx_v_obj, __pyx_ptype_8petsc4py_5PETSc_Object)))) __PYX_ERR(37, 159, __pyx_L1_error) __pyx_t_1 = (((struct PyPetscObjectObject *)__pyx_v_obj)->obj != NULL); if (unlikely(!__pyx_t_1)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(37, 159, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(37, 159, __pyx_L1_error) #endif /* "petsc4py/PETSc/Viewer.pyx":160 * else: * assert (obj).obj != NULL * CHKERR( PetscObjectView((obj).obj[0], self.vwr) ) # <<<<<<<<<<<<<< * * def destroy(self) -> Self: */ if (!(likely(__Pyx_TypeTest(__pyx_v_obj, __pyx_ptype_8petsc4py_5PETSc_Object)))) __PYX_ERR(37, 160, __pyx_L1_error) __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectView((((struct PyPetscObjectObject *)__pyx_v_obj)->obj[0]), __pyx_v_self->vwr)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 160, __pyx_L1_error) } __pyx_L3:; /* "petsc4py/PETSc/Viewer.pyx":134 * # * * def view(self, obj: Viewer | Object | None = None) -> None: # <<<<<<<<<<<<<< * """View the viewer. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Viewer.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Viewer.pyx":162 * CHKERR( PetscObjectView((obj).obj[0], self.vwr) ) * * def destroy(self) -> Self: # <<<<<<<<<<<<<< * """Destroy the viewer. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_7destroy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Viewer_6destroy, "Viewer.destroy(self) -> Self\nDestroy the viewer.\n\n Collective.\n\n See Also\n --------\n petsc.PetscViewerDestroy\n\n \nSource code at petsc4py/PETSc/Viewer.pyx:162"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_7destroy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("destroy (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_6destroy(((struct PyPetscViewerObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_6destroy(struct PyPetscViewerObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("destroy", 1); /* "petsc4py/PETSc/Viewer.pyx":172 * * """ * CHKERR( PetscViewerDestroy(&self.vwr) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerDestroy((&__pyx_v_self->vwr))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 172, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":173 * """ * CHKERR( PetscViewerDestroy(&self.vwr) ) * return self # <<<<<<<<<<<<<< * * def create(self, comm: Comm | None = None) -> Self: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Viewer.pyx":162 * CHKERR( PetscObjectView((obj).obj[0], self.vwr) ) * * def destroy(self) -> Self: # <<<<<<<<<<<<<< * """Destroy the viewer. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Viewer.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Viewer.pyx":175 * return self * * def create(self, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Create a viewer. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_9create(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Viewer_8create, "Viewer.create(self, comm: Comm | None = None) -> Self\nCreate a viewer.\n\n Collective.\n\n Parameters\n ----------\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n Sys.getDefaultComm, petsc.PetscViewerCreate\n\n \nSource code at petsc4py/PETSc/Viewer.pyx:175"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_9create(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(37, 175, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "create") < 0)) __PYX_ERR(37, 175, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_comm = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, __pyx_nargs); __PYX_ERR(37, 175, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Viewer.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_8create(((struct PyPetscViewerObject *)__pyx_v_self), __pyx_v_comm); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_8create(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PetscViewer __pyx_v_newvwr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create", 1); /* "petsc4py/PETSc/Viewer.pyx":190 * * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscViewer newvwr = NULL * CHKERR( PetscViewerCreate(ccomm, &newvwr) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(37, 190, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/Viewer.pyx":191 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscViewer newvwr = NULL # <<<<<<<<<<<<<< * CHKERR( PetscViewerCreate(ccomm, &newvwr) ) * CHKERR( PetscCLEAR(self.obj) ); self.vwr = newvwr */ __pyx_v_newvwr = NULL; /* "petsc4py/PETSc/Viewer.pyx":192 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscViewer newvwr = NULL * CHKERR( PetscViewerCreate(ccomm, &newvwr) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.vwr = newvwr * return self */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerCreate(__pyx_v_ccomm, (&__pyx_v_newvwr))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 192, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":193 * cdef PetscViewer newvwr = NULL * CHKERR( PetscViewerCreate(ccomm, &newvwr) ) * CHKERR( PetscCLEAR(self.obj) ); self.vwr = newvwr # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 193, __pyx_L1_error) __pyx_v_self->vwr = __pyx_v_newvwr; /* "petsc4py/PETSc/Viewer.pyx":194 * CHKERR( PetscViewerCreate(ccomm, &newvwr) ) * CHKERR( PetscCLEAR(self.obj) ); self.vwr = newvwr * return self # <<<<<<<<<<<<<< * * def createASCII( */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Viewer.pyx":175 * return self * * def create(self, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Create a viewer. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Viewer.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Viewer.pyx":196 * return self * * def createASCII( # <<<<<<<<<<<<<< * self, * name: str, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_11createASCII(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Viewer_10createASCII, "Viewer.createASCII(self, name: str, mode: FileMode | str | None = None, comm: Comm | None = None) -> Self\nCreate a viewer of type `Type.ASCII`.\n\n Collective.\n\n Parameters\n ----------\n name\n The filename associated with the viewer.\n mode\n The mode type.\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n create, setType, setFileMode, setFileName, Sys.getDefaultComm\n setASCIITab, addASCIITab, subtractASCIITab, getASCIITab\n\n \nSource code at petsc4py/PETSc/Viewer.pyx:196"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_11createASCII(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_name = 0; PyObject *__pyx_v_mode = 0; PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createASCII (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_mode,&__pyx_n_s_comm,0}; /* "petsc4py/PETSc/Viewer.pyx":199 * self, * name: str, * mode: FileMode | str | None = None, # <<<<<<<<<<<<<< * comm: Comm | None = None, * ) -> Self: */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Viewer.pyx":200 * name: str, * mode: FileMode | str | None = None, * comm: Comm | None = None, # <<<<<<<<<<<<<< * ) -> Self: * """Create a viewer of type `Type.ASCII`. */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(37, 196, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mode); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(37, 196, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(37, 196, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createASCII") < 0)) __PYX_ERR(37, 196, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_name = values[0]; __pyx_v_mode = values[1]; __pyx_v_comm = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createASCII", 0, 1, 3, __pyx_nargs); __PYX_ERR(37, 196, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Viewer.createASCII", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_10createASCII(((struct PyPetscViewerObject *)__pyx_v_self), __pyx_v_name, __pyx_v_mode, __pyx_v_comm); /* "petsc4py/PETSc/Viewer.pyx":196 * return self * * def createASCII( # <<<<<<<<<<<<<< * self, * name: str, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_10createASCII(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_mode, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; char const *__pyx_v_cname; PetscFileMode __pyx_v_cmode; PetscViewer __pyx_v_newvwr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PetscFileMode __pyx_t_4; PetscErrorCode __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createASCII", 0); __Pyx_INCREF(__pyx_v_name); /* "petsc4py/PETSc/Viewer.pyx":221 * * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef const char *cname = NULL * name = str2bytes(name, &cname) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(37, 221, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/Viewer.pyx":222 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef const char *cname = NULL # <<<<<<<<<<<<<< * name = str2bytes(name, &cname) * cdef PetscFileMode cmode = PETSC_FILE_MODE_WRITE */ __pyx_v_cname = NULL; /* "petsc4py/PETSc/Viewer.pyx":223 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef const char *cname = NULL * name = str2bytes(name, &cname) # <<<<<<<<<<<<<< * cdef PetscFileMode cmode = PETSC_FILE_MODE_WRITE * if mode is not None: cmode = filemode(mode) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cname)); if (unlikely(!__pyx_t_2)) __PYX_ERR(37, 223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/Viewer.pyx":224 * cdef const char *cname = NULL * name = str2bytes(name, &cname) * cdef PetscFileMode cmode = PETSC_FILE_MODE_WRITE # <<<<<<<<<<<<<< * if mode is not None: cmode = filemode(mode) * cdef PetscViewer newvwr = NULL */ __pyx_v_cmode = FILE_MODE_WRITE; /* "petsc4py/PETSc/Viewer.pyx":225 * name = str2bytes(name, &cname) * cdef PetscFileMode cmode = PETSC_FILE_MODE_WRITE * if mode is not None: cmode = filemode(mode) # <<<<<<<<<<<<<< * cdef PetscViewer newvwr = NULL * CHKERR( PetscViewerCreate(ccomm, &newvwr) ) */ __pyx_t_3 = (__pyx_v_mode != Py_None); if (__pyx_t_3) { __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_filemode(__pyx_v_mode); if (unlikely(__pyx_t_4 == ((PetscFileMode)((PetscFileMode)-1L)))) __PYX_ERR(37, 225, __pyx_L1_error) __pyx_v_cmode = __pyx_t_4; } /* "petsc4py/PETSc/Viewer.pyx":226 * cdef PetscFileMode cmode = PETSC_FILE_MODE_WRITE * if mode is not None: cmode = filemode(mode) * cdef PetscViewer newvwr = NULL # <<<<<<<<<<<<<< * CHKERR( PetscViewerCreate(ccomm, &newvwr) ) * CHKERR( PetscCLEAR(self.obj) ); self.vwr = newvwr */ __pyx_v_newvwr = NULL; /* "petsc4py/PETSc/Viewer.pyx":227 * if mode is not None: cmode = filemode(mode) * cdef PetscViewer newvwr = NULL * CHKERR( PetscViewerCreate(ccomm, &newvwr) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.vwr = newvwr * CHKERR( PetscViewerSetType(self.vwr, PETSCVIEWERASCII) ) */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerCreate(__pyx_v_ccomm, (&__pyx_v_newvwr))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 227, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":228 * cdef PetscViewer newvwr = NULL * CHKERR( PetscViewerCreate(ccomm, &newvwr) ) * CHKERR( PetscCLEAR(self.obj) ); self.vwr = newvwr # <<<<<<<<<<<<<< * CHKERR( PetscViewerSetType(self.vwr, PETSCVIEWERASCII) ) * CHKERR( PetscViewerFileSetMode(self.vwr, cmode) ) */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 228, __pyx_L1_error) __pyx_v_self->vwr = __pyx_v_newvwr; /* "petsc4py/PETSc/Viewer.pyx":229 * CHKERR( PetscViewerCreate(ccomm, &newvwr) ) * CHKERR( PetscCLEAR(self.obj) ); self.vwr = newvwr * CHKERR( PetscViewerSetType(self.vwr, PETSCVIEWERASCII) ) # <<<<<<<<<<<<<< * CHKERR( PetscViewerFileSetMode(self.vwr, cmode) ) * CHKERR( PetscViewerFileSetName(self.vwr, cname) ) */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerSetType(__pyx_v_self->vwr, PETSCVIEWERASCII)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 229, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":230 * CHKERR( PetscCLEAR(self.obj) ); self.vwr = newvwr * CHKERR( PetscViewerSetType(self.vwr, PETSCVIEWERASCII) ) * CHKERR( PetscViewerFileSetMode(self.vwr, cmode) ) # <<<<<<<<<<<<<< * CHKERR( PetscViewerFileSetName(self.vwr, cname) ) * return self */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerFileSetMode(__pyx_v_self->vwr, __pyx_v_cmode)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 230, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":231 * CHKERR( PetscViewerSetType(self.vwr, PETSCVIEWERASCII) ) * CHKERR( PetscViewerFileSetMode(self.vwr, cmode) ) * CHKERR( PetscViewerFileSetName(self.vwr, cname) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerFileSetName(__pyx_v_self->vwr, __pyx_v_cname)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 231, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":232 * CHKERR( PetscViewerFileSetMode(self.vwr, cmode) ) * CHKERR( PetscViewerFileSetName(self.vwr, cname) ) * return self # <<<<<<<<<<<<<< * * def createBinary( */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Viewer.pyx":196 * return self * * def createASCII( # <<<<<<<<<<<<<< * self, * name: str, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Viewer.createASCII", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Viewer.pyx":234 * return self * * def createBinary( # <<<<<<<<<<<<<< * self, * name: str, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_13createBinary(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Viewer_12createBinary, "Viewer.createBinary(self, name: str, mode: FileMode | str | None = None, comm: Comm | None = None) -> Self\nCreate a viewer of type `Type.BINARY`.\n\n Collective.\n\n Parameters\n ----------\n name\n The filename associated with the viewer.\n mode\n The mode type.\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n create, setType, setFileMode, setFileName, Sys.getDefaultComm\n\n \nSource code at petsc4py/PETSc/Viewer.pyx:234"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_13createBinary(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_name = 0; PyObject *__pyx_v_mode = 0; PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createBinary (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_mode,&__pyx_n_s_comm,0}; /* "petsc4py/PETSc/Viewer.pyx":237 * self, * name: str, * mode: FileMode | str | None = None, # <<<<<<<<<<<<<< * comm: Comm | None = None, * ) -> Self: */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Viewer.pyx":238 * name: str, * mode: FileMode | str | None = None, * comm: Comm | None = None, # <<<<<<<<<<<<<< * ) -> Self: * """Create a viewer of type `Type.BINARY`. */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(37, 234, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mode); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(37, 234, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(37, 234, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createBinary") < 0)) __PYX_ERR(37, 234, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_name = values[0]; __pyx_v_mode = values[1]; __pyx_v_comm = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createBinary", 0, 1, 3, __pyx_nargs); __PYX_ERR(37, 234, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Viewer.createBinary", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_12createBinary(((struct PyPetscViewerObject *)__pyx_v_self), __pyx_v_name, __pyx_v_mode, __pyx_v_comm); /* "petsc4py/PETSc/Viewer.pyx":234 * return self * * def createBinary( # <<<<<<<<<<<<<< * self, * name: str, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_12createBinary(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_mode, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; char const *__pyx_v_cname; PetscFileMode __pyx_v_cmode; PetscViewer __pyx_v_newvwr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscFileMode __pyx_t_3; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createBinary", 0); __Pyx_INCREF(__pyx_v_name); /* "petsc4py/PETSc/Viewer.pyx":258 * * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef const char *cname = NULL * name = str2bytes(name, &cname) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(37, 258, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/Viewer.pyx":259 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef const char *cname = NULL # <<<<<<<<<<<<<< * name = str2bytes(name, &cname) * cdef PetscFileMode cmode = filemode(mode) */ __pyx_v_cname = NULL; /* "petsc4py/PETSc/Viewer.pyx":260 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef const char *cname = NULL * name = str2bytes(name, &cname) # <<<<<<<<<<<<<< * cdef PetscFileMode cmode = filemode(mode) * cdef PetscViewer newvwr = NULL */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cname)); if (unlikely(!__pyx_t_2)) __PYX_ERR(37, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/Viewer.pyx":261 * cdef const char *cname = NULL * name = str2bytes(name, &cname) * cdef PetscFileMode cmode = filemode(mode) # <<<<<<<<<<<<<< * cdef PetscViewer newvwr = NULL * CHKERR( PetscViewerBinaryOpen(ccomm, cname, cmode, &newvwr) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_filemode(__pyx_v_mode); if (unlikely(__pyx_t_3 == ((PetscFileMode)((PetscFileMode)-1L)))) __PYX_ERR(37, 261, __pyx_L1_error) __pyx_v_cmode = __pyx_t_3; /* "petsc4py/PETSc/Viewer.pyx":262 * name = str2bytes(name, &cname) * cdef PetscFileMode cmode = filemode(mode) * cdef PetscViewer newvwr = NULL # <<<<<<<<<<<<<< * CHKERR( PetscViewerBinaryOpen(ccomm, cname, cmode, &newvwr) ) * CHKERR( PetscCLEAR(self.obj) ); self.vwr = newvwr */ __pyx_v_newvwr = NULL; /* "petsc4py/PETSc/Viewer.pyx":263 * cdef PetscFileMode cmode = filemode(mode) * cdef PetscViewer newvwr = NULL * CHKERR( PetscViewerBinaryOpen(ccomm, cname, cmode, &newvwr) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.vwr = newvwr * return self */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerBinaryOpen(__pyx_v_ccomm, __pyx_v_cname, __pyx_v_cmode, (&__pyx_v_newvwr))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 263, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":264 * cdef PetscViewer newvwr = NULL * CHKERR( PetscViewerBinaryOpen(ccomm, cname, cmode, &newvwr) ) * CHKERR( PetscCLEAR(self.obj) ); self.vwr = newvwr # <<<<<<<<<<<<<< * return self * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 264, __pyx_L1_error) __pyx_v_self->vwr = __pyx_v_newvwr; /* "petsc4py/PETSc/Viewer.pyx":265 * CHKERR( PetscViewerBinaryOpen(ccomm, cname, cmode, &newvwr) ) * CHKERR( PetscCLEAR(self.obj) ); self.vwr = newvwr * return self # <<<<<<<<<<<<<< * * def createMPIIO( */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Viewer.pyx":234 * return self * * def createBinary( # <<<<<<<<<<<<<< * self, * name: str, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Viewer.createBinary", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Viewer.pyx":267 * return self * * def createMPIIO( # <<<<<<<<<<<<<< * self, * name: str, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_15createMPIIO(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Viewer_14createMPIIO, "Viewer.createMPIIO(self, name: str, mode: FileMode | str | None = None, comm: Comm | None = None) -> Self\nCreate a viewer of type `Type.BINARY` supporting MPI-IO.\n\n Collective.\n\n Parameters\n ----------\n name\n The filename associated with the viewer.\n mode\n The mode type.\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n create, setType, setFileMode, setFileName, Sys.getDefaultComm\n\n \nSource code at petsc4py/PETSc/Viewer.pyx:267"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_15createMPIIO(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_name = 0; PyObject *__pyx_v_mode = 0; PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createMPIIO (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_mode,&__pyx_n_s_comm,0}; /* "petsc4py/PETSc/Viewer.pyx":270 * self, * name: str, * mode: FileMode | str | None = None, # <<<<<<<<<<<<<< * comm: Comm | None = None, * ) -> Self: */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Viewer.pyx":271 * name: str, * mode: FileMode | str | None = None, * comm: Comm | None = None, # <<<<<<<<<<<<<< * ) -> Self: * """Create a viewer of type `Type.BINARY` supporting MPI-IO. */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(37, 267, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mode); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(37, 267, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(37, 267, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createMPIIO") < 0)) __PYX_ERR(37, 267, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_name = values[0]; __pyx_v_mode = values[1]; __pyx_v_comm = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createMPIIO", 0, 1, 3, __pyx_nargs); __PYX_ERR(37, 267, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Viewer.createMPIIO", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_14createMPIIO(((struct PyPetscViewerObject *)__pyx_v_self), __pyx_v_name, __pyx_v_mode, __pyx_v_comm); /* "petsc4py/PETSc/Viewer.pyx":267 * return self * * def createMPIIO( # <<<<<<<<<<<<<< * self, * name: str, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_14createMPIIO(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_mode, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; char const *__pyx_v_cname; PetscFileMode __pyx_v_cmode; PetscViewer __pyx_v_newvwr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscFileMode __pyx_t_3; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createMPIIO", 0); __Pyx_INCREF(__pyx_v_name); /* "petsc4py/PETSc/Viewer.pyx":291 * * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef const char *cname = NULL * name = str2bytes(name, &cname) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(37, 291, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/Viewer.pyx":292 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef const char *cname = NULL # <<<<<<<<<<<<<< * name = str2bytes(name, &cname) * cdef PetscFileMode cmode = filemode(mode) */ __pyx_v_cname = NULL; /* "petsc4py/PETSc/Viewer.pyx":293 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef const char *cname = NULL * name = str2bytes(name, &cname) # <<<<<<<<<<<<<< * cdef PetscFileMode cmode = filemode(mode) * cdef PetscViewer newvwr = NULL */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cname)); if (unlikely(!__pyx_t_2)) __PYX_ERR(37, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/Viewer.pyx":294 * cdef const char *cname = NULL * name = str2bytes(name, &cname) * cdef PetscFileMode cmode = filemode(mode) # <<<<<<<<<<<<<< * cdef PetscViewer newvwr = NULL * CHKERR( PetscViewerCreate(ccomm, &newvwr) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_filemode(__pyx_v_mode); if (unlikely(__pyx_t_3 == ((PetscFileMode)((PetscFileMode)-1L)))) __PYX_ERR(37, 294, __pyx_L1_error) __pyx_v_cmode = __pyx_t_3; /* "petsc4py/PETSc/Viewer.pyx":295 * name = str2bytes(name, &cname) * cdef PetscFileMode cmode = filemode(mode) * cdef PetscViewer newvwr = NULL # <<<<<<<<<<<<<< * CHKERR( PetscViewerCreate(ccomm, &newvwr) ) * CHKERR( PetscCLEAR(self.obj) ); self.vwr = newvwr */ __pyx_v_newvwr = NULL; /* "petsc4py/PETSc/Viewer.pyx":296 * cdef PetscFileMode cmode = filemode(mode) * cdef PetscViewer newvwr = NULL * CHKERR( PetscViewerCreate(ccomm, &newvwr) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.vwr = newvwr * CHKERR( PetscViewerSetType(self.vwr, PETSCVIEWERBINARY) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerCreate(__pyx_v_ccomm, (&__pyx_v_newvwr))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 296, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":297 * cdef PetscViewer newvwr = NULL * CHKERR( PetscViewerCreate(ccomm, &newvwr) ) * CHKERR( PetscCLEAR(self.obj) ); self.vwr = newvwr # <<<<<<<<<<<<<< * CHKERR( PetscViewerSetType(self.vwr, PETSCVIEWERBINARY) ) * CHKERR( PetscViewerBinarySetUseMPIIO(self.vwr, PETSC_TRUE) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 297, __pyx_L1_error) __pyx_v_self->vwr = __pyx_v_newvwr; /* "petsc4py/PETSc/Viewer.pyx":298 * CHKERR( PetscViewerCreate(ccomm, &newvwr) ) * CHKERR( PetscCLEAR(self.obj) ); self.vwr = newvwr * CHKERR( PetscViewerSetType(self.vwr, PETSCVIEWERBINARY) ) # <<<<<<<<<<<<<< * CHKERR( PetscViewerBinarySetUseMPIIO(self.vwr, PETSC_TRUE) ) * CHKERR( PetscViewerFileSetMode(self.vwr, cmode) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerSetType(__pyx_v_self->vwr, PETSCVIEWERBINARY)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 298, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":299 * CHKERR( PetscCLEAR(self.obj) ); self.vwr = newvwr * CHKERR( PetscViewerSetType(self.vwr, PETSCVIEWERBINARY) ) * CHKERR( PetscViewerBinarySetUseMPIIO(self.vwr, PETSC_TRUE) ) # <<<<<<<<<<<<<< * CHKERR( PetscViewerFileSetMode(self.vwr, cmode) ) * CHKERR( PetscViewerFileSetName(self.vwr, cname) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerBinarySetUseMPIIO(__pyx_v_self->vwr, PETSC_TRUE)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 299, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":300 * CHKERR( PetscViewerSetType(self.vwr, PETSCVIEWERBINARY) ) * CHKERR( PetscViewerBinarySetUseMPIIO(self.vwr, PETSC_TRUE) ) * CHKERR( PetscViewerFileSetMode(self.vwr, cmode) ) # <<<<<<<<<<<<<< * CHKERR( PetscViewerFileSetName(self.vwr, cname) ) * return self */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerFileSetMode(__pyx_v_self->vwr, __pyx_v_cmode)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 300, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":301 * CHKERR( PetscViewerBinarySetUseMPIIO(self.vwr, PETSC_TRUE) ) * CHKERR( PetscViewerFileSetMode(self.vwr, cmode) ) * CHKERR( PetscViewerFileSetName(self.vwr, cname) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerFileSetName(__pyx_v_self->vwr, __pyx_v_cname)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 301, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":302 * CHKERR( PetscViewerFileSetMode(self.vwr, cmode) ) * CHKERR( PetscViewerFileSetName(self.vwr, cname) ) * return self # <<<<<<<<<<<<<< * * def createVTK( */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Viewer.pyx":267 * return self * * def createMPIIO( # <<<<<<<<<<<<<< * self, * name: str, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Viewer.createMPIIO", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Viewer.pyx":304 * return self * * def createVTK( # <<<<<<<<<<<<<< * self, * name: str, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_17createVTK(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Viewer_16createVTK, "Viewer.createVTK(self, name: str, mode: FileMode | str | None = None, comm: Comm | None = None) -> Self\nCreate a viewer of type `Type.VTK`.\n\n Collective.\n\n Parameters\n ----------\n name\n The filename associated with the viewer.\n mode\n The mode type.\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n create, setType, setFileMode, setFileName, Sys.getDefaultComm\n\n \nSource code at petsc4py/PETSc/Viewer.pyx:304"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_17createVTK(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_name = 0; PyObject *__pyx_v_mode = 0; PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createVTK (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_mode,&__pyx_n_s_comm,0}; /* "petsc4py/PETSc/Viewer.pyx":307 * self, * name: str, * mode: FileMode | str | None = None, # <<<<<<<<<<<<<< * comm: Comm | None = None, * ) -> Self: */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Viewer.pyx":308 * name: str, * mode: FileMode | str | None = None, * comm: Comm | None = None, # <<<<<<<<<<<<<< * ) -> Self: * """Create a viewer of type `Type.VTK`. */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(37, 304, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mode); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(37, 304, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(37, 304, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createVTK") < 0)) __PYX_ERR(37, 304, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_name = values[0]; __pyx_v_mode = values[1]; __pyx_v_comm = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createVTK", 0, 1, 3, __pyx_nargs); __PYX_ERR(37, 304, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Viewer.createVTK", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_16createVTK(((struct PyPetscViewerObject *)__pyx_v_self), __pyx_v_name, __pyx_v_mode, __pyx_v_comm); /* "petsc4py/PETSc/Viewer.pyx":304 * return self * * def createVTK( # <<<<<<<<<<<<<< * self, * name: str, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_16createVTK(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_mode, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; char const *__pyx_v_cname; PetscFileMode __pyx_v_cmode; PetscViewer __pyx_v_newvwr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscFileMode __pyx_t_3; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createVTK", 0); __Pyx_INCREF(__pyx_v_name); /* "petsc4py/PETSc/Viewer.pyx":328 * * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef const char *cname = NULL * name = str2bytes(name, &cname) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(37, 328, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/Viewer.pyx":329 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef const char *cname = NULL # <<<<<<<<<<<<<< * name = str2bytes(name, &cname) * cdef PetscFileMode cmode = filemode(mode) */ __pyx_v_cname = NULL; /* "petsc4py/PETSc/Viewer.pyx":330 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef const char *cname = NULL * name = str2bytes(name, &cname) # <<<<<<<<<<<<<< * cdef PetscFileMode cmode = filemode(mode) * cdef PetscViewer newvwr = NULL */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cname)); if (unlikely(!__pyx_t_2)) __PYX_ERR(37, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/Viewer.pyx":331 * cdef const char *cname = NULL * name = str2bytes(name, &cname) * cdef PetscFileMode cmode = filemode(mode) # <<<<<<<<<<<<<< * cdef PetscViewer newvwr = NULL * CHKERR( PetscViewerCreate(ccomm, &newvwr) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_filemode(__pyx_v_mode); if (unlikely(__pyx_t_3 == ((PetscFileMode)((PetscFileMode)-1L)))) __PYX_ERR(37, 331, __pyx_L1_error) __pyx_v_cmode = __pyx_t_3; /* "petsc4py/PETSc/Viewer.pyx":332 * name = str2bytes(name, &cname) * cdef PetscFileMode cmode = filemode(mode) * cdef PetscViewer newvwr = NULL # <<<<<<<<<<<<<< * CHKERR( PetscViewerCreate(ccomm, &newvwr) ) * CHKERR( PetscCLEAR(self.obj) ); self.vwr = newvwr */ __pyx_v_newvwr = NULL; /* "petsc4py/PETSc/Viewer.pyx":333 * cdef PetscFileMode cmode = filemode(mode) * cdef PetscViewer newvwr = NULL * CHKERR( PetscViewerCreate(ccomm, &newvwr) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.vwr = newvwr * CHKERR( PetscViewerSetType(self.vwr, PETSCVIEWERVTK) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerCreate(__pyx_v_ccomm, (&__pyx_v_newvwr))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 333, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":334 * cdef PetscViewer newvwr = NULL * CHKERR( PetscViewerCreate(ccomm, &newvwr) ) * CHKERR( PetscCLEAR(self.obj) ); self.vwr = newvwr # <<<<<<<<<<<<<< * CHKERR( PetscViewerSetType(self.vwr, PETSCVIEWERVTK) ) * CHKERR( PetscViewerFileSetMode(self.vwr, cmode) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 334, __pyx_L1_error) __pyx_v_self->vwr = __pyx_v_newvwr; /* "petsc4py/PETSc/Viewer.pyx":335 * CHKERR( PetscViewerCreate(ccomm, &newvwr) ) * CHKERR( PetscCLEAR(self.obj) ); self.vwr = newvwr * CHKERR( PetscViewerSetType(self.vwr, PETSCVIEWERVTK) ) # <<<<<<<<<<<<<< * CHKERR( PetscViewerFileSetMode(self.vwr, cmode) ) * CHKERR( PetscViewerFileSetName(self.vwr, cname) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerSetType(__pyx_v_self->vwr, PETSCVIEWERVTK)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 335, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":336 * CHKERR( PetscCLEAR(self.obj) ); self.vwr = newvwr * CHKERR( PetscViewerSetType(self.vwr, PETSCVIEWERVTK) ) * CHKERR( PetscViewerFileSetMode(self.vwr, cmode) ) # <<<<<<<<<<<<<< * CHKERR( PetscViewerFileSetName(self.vwr, cname) ) * return self */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerFileSetMode(__pyx_v_self->vwr, __pyx_v_cmode)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 336, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":337 * CHKERR( PetscViewerSetType(self.vwr, PETSCVIEWERVTK) ) * CHKERR( PetscViewerFileSetMode(self.vwr, cmode) ) * CHKERR( PetscViewerFileSetName(self.vwr, cname) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerFileSetName(__pyx_v_self->vwr, __pyx_v_cname)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 337, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":338 * CHKERR( PetscViewerFileSetMode(self.vwr, cmode) ) * CHKERR( PetscViewerFileSetName(self.vwr, cname) ) * return self # <<<<<<<<<<<<<< * * def createHDF5( */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Viewer.pyx":304 * return self * * def createVTK( # <<<<<<<<<<<<<< * self, * name: str, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Viewer.createVTK", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Viewer.pyx":340 * return self * * def createHDF5( # <<<<<<<<<<<<<< * self, * name: str, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_19createHDF5(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Viewer_18createHDF5, "Viewer.createHDF5(self, name: str, mode: FileMode | str | None = None, comm: Comm | None = None) -> Self\nCreate a viewer of type `Type.HDF5`.\n\n Collective.\n\n Parameters\n ----------\n name\n The filename associated with the viewer.\n mode\n The mode type.\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n create, setType, setFileMode, setFileName, Sys.getDefaultComm\n\n \nSource code at petsc4py/PETSc/Viewer.pyx:340"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_19createHDF5(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_name = 0; PyObject *__pyx_v_mode = 0; PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createHDF5 (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_mode,&__pyx_n_s_comm,0}; /* "petsc4py/PETSc/Viewer.pyx":343 * self, * name: str, * mode: FileMode | str | None = None, # <<<<<<<<<<<<<< * comm: Comm | None = None, * ) -> Self: */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Viewer.pyx":344 * name: str, * mode: FileMode | str | None = None, * comm: Comm | None = None, # <<<<<<<<<<<<<< * ) -> Self: * """Create a viewer of type `Type.HDF5`. */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(37, 340, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mode); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(37, 340, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(37, 340, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createHDF5") < 0)) __PYX_ERR(37, 340, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_name = values[0]; __pyx_v_mode = values[1]; __pyx_v_comm = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createHDF5", 0, 1, 3, __pyx_nargs); __PYX_ERR(37, 340, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Viewer.createHDF5", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_18createHDF5(((struct PyPetscViewerObject *)__pyx_v_self), __pyx_v_name, __pyx_v_mode, __pyx_v_comm); /* "petsc4py/PETSc/Viewer.pyx":340 * return self * * def createHDF5( # <<<<<<<<<<<<<< * self, * name: str, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_18createHDF5(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_mode, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; char const *__pyx_v_cname; PetscFileMode __pyx_v_cmode; PetscViewer __pyx_v_newvwr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscFileMode __pyx_t_3; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createHDF5", 0); __Pyx_INCREF(__pyx_v_name); /* "petsc4py/PETSc/Viewer.pyx":364 * * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef const char *cname = NULL * name = str2bytes(name, &cname) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(37, 364, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/Viewer.pyx":365 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef const char *cname = NULL # <<<<<<<<<<<<<< * name = str2bytes(name, &cname) * cdef PetscFileMode cmode = filemode(mode) */ __pyx_v_cname = NULL; /* "petsc4py/PETSc/Viewer.pyx":366 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef const char *cname = NULL * name = str2bytes(name, &cname) # <<<<<<<<<<<<<< * cdef PetscFileMode cmode = filemode(mode) * cdef PetscViewer newvwr = NULL */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cname)); if (unlikely(!__pyx_t_2)) __PYX_ERR(37, 366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/Viewer.pyx":367 * cdef const char *cname = NULL * name = str2bytes(name, &cname) * cdef PetscFileMode cmode = filemode(mode) # <<<<<<<<<<<<<< * cdef PetscViewer newvwr = NULL * CHKERR( PetscViewerCreate(ccomm, &newvwr) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_filemode(__pyx_v_mode); if (unlikely(__pyx_t_3 == ((PetscFileMode)((PetscFileMode)-1L)))) __PYX_ERR(37, 367, __pyx_L1_error) __pyx_v_cmode = __pyx_t_3; /* "petsc4py/PETSc/Viewer.pyx":368 * name = str2bytes(name, &cname) * cdef PetscFileMode cmode = filemode(mode) * cdef PetscViewer newvwr = NULL # <<<<<<<<<<<<<< * CHKERR( PetscViewerCreate(ccomm, &newvwr) ) * CHKERR( PetscCLEAR(self.obj) ); self.vwr = newvwr */ __pyx_v_newvwr = NULL; /* "petsc4py/PETSc/Viewer.pyx":369 * cdef PetscFileMode cmode = filemode(mode) * cdef PetscViewer newvwr = NULL * CHKERR( PetscViewerCreate(ccomm, &newvwr) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.vwr = newvwr * CHKERR( PetscViewerSetType(self.vwr, PETSCVIEWERHDF5) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerCreate(__pyx_v_ccomm, (&__pyx_v_newvwr))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 369, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":370 * cdef PetscViewer newvwr = NULL * CHKERR( PetscViewerCreate(ccomm, &newvwr) ) * CHKERR( PetscCLEAR(self.obj) ); self.vwr = newvwr # <<<<<<<<<<<<<< * CHKERR( PetscViewerSetType(self.vwr, PETSCVIEWERHDF5) ) * CHKERR( PetscViewerFileSetMode(self.vwr, cmode) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 370, __pyx_L1_error) __pyx_v_self->vwr = __pyx_v_newvwr; /* "petsc4py/PETSc/Viewer.pyx":371 * CHKERR( PetscViewerCreate(ccomm, &newvwr) ) * CHKERR( PetscCLEAR(self.obj) ); self.vwr = newvwr * CHKERR( PetscViewerSetType(self.vwr, PETSCVIEWERHDF5) ) # <<<<<<<<<<<<<< * CHKERR( PetscViewerFileSetMode(self.vwr, cmode) ) * CHKERR( PetscViewerFileSetName(self.vwr, cname) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerSetType(__pyx_v_self->vwr, PETSCVIEWERHDF5)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 371, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":372 * CHKERR( PetscCLEAR(self.obj) ); self.vwr = newvwr * CHKERR( PetscViewerSetType(self.vwr, PETSCVIEWERHDF5) ) * CHKERR( PetscViewerFileSetMode(self.vwr, cmode) ) # <<<<<<<<<<<<<< * CHKERR( PetscViewerFileSetName(self.vwr, cname) ) * return self */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerFileSetMode(__pyx_v_self->vwr, __pyx_v_cmode)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 372, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":373 * CHKERR( PetscViewerSetType(self.vwr, PETSCVIEWERHDF5) ) * CHKERR( PetscViewerFileSetMode(self.vwr, cmode) ) * CHKERR( PetscViewerFileSetName(self.vwr, cname) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerFileSetName(__pyx_v_self->vwr, __pyx_v_cname)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 373, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":374 * CHKERR( PetscViewerFileSetMode(self.vwr, cmode) ) * CHKERR( PetscViewerFileSetName(self.vwr, cname) ) * return self # <<<<<<<<<<<<<< * * def createDraw( */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Viewer.pyx":340 * return self * * def createHDF5( # <<<<<<<<<<<<<< * self, * name: str, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Viewer.createHDF5", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Viewer.pyx":376 * return self * * def createDraw( # <<<<<<<<<<<<<< * self, * display: str | None = None, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_21createDraw(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Viewer_20createDraw, "Viewer.createDraw(self, display: str | None = None, title: str | None = None, position: tuple[int, int] | None = None, size: tuple[int, int] | int | None = None, comm: Comm | None = None) -> Self\nCreate a `Type.DRAW` viewer.\n\n Collective.\n\n Parameters\n ----------\n display\n The X display to use or `None` for the local machine.\n title\n The window title or `None` for no title.\n position\n Screen coordinates of the upper left corner, or `None` for default.\n size\n Window size or `None` for default.\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n Sys.getDefaultComm, petsc.PetscViewerDrawOpen\n\n \nSource code at petsc4py/PETSc/Viewer.pyx:376"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_21createDraw(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_display = 0; PyObject *__pyx_v_title = 0; PyObject *__pyx_v_position = 0; PyObject *__pyx_v_size = 0; PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createDraw (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_display,&__pyx_n_s_title,&__pyx_n_s_position,&__pyx_n_s_size,&__pyx_n_s_comm,0}; /* "petsc4py/PETSc/Viewer.pyx":378 * def createDraw( * self, * display: str | None = None, # <<<<<<<<<<<<<< * title: str | None = None, * position: tuple[int, int] | None = None, */ values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Viewer.pyx":379 * self, * display: str | None = None, * title: str | None = None, # <<<<<<<<<<<<<< * position: tuple[int, int] | None = None, * size: tuple[int, int] | int | None = None, */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Viewer.pyx":380 * display: str | None = None, * title: str | None = None, * position: tuple[int, int] | None = None, # <<<<<<<<<<<<<< * size: tuple[int, int] | int | None = None, * comm: Comm | None = None, */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Viewer.pyx":381 * title: str | None = None, * position: tuple[int, int] | None = None, * size: tuple[int, int] | int | None = None, # <<<<<<<<<<<<<< * comm: Comm | None = None, * ) -> Self: */ values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Viewer.pyx":382 * position: tuple[int, int] | None = None, * size: tuple[int, int] | int | None = None, * comm: Comm | None = None, # <<<<<<<<<<<<<< * ) -> Self: * """Create a `Type.DRAW` viewer. */ values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_display); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(37, 376, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_title); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(37, 376, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_position); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(37, 376, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(37, 376, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(37, 376, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createDraw") < 0)) __PYX_ERR(37, 376, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_display = values[0]; __pyx_v_title = values[1]; __pyx_v_position = values[2]; __pyx_v_size = values[3]; __pyx_v_comm = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createDraw", 0, 0, 5, __pyx_nargs); __PYX_ERR(37, 376, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Viewer.createDraw", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_20createDraw(((struct PyPetscViewerObject *)__pyx_v_self), __pyx_v_display, __pyx_v_title, __pyx_v_position, __pyx_v_size, __pyx_v_comm); /* "petsc4py/PETSc/Viewer.pyx":376 * return self * * def createDraw( # <<<<<<<<<<<<<< * self, * display: str | None = None, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_20createDraw(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_display, PyObject *__pyx_v_title, PyObject *__pyx_v_position, PyObject *__pyx_v_size, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; char const *__pyx_v_cdisplay; char const *__pyx_v_ctitle; int __pyx_v_x; int __pyx_v_y; int __pyx_v_h; int __pyx_v_w; PetscViewer __pyx_v_newvwr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); int __pyx_t_8; int __pyx_t_9; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PetscErrorCode __pyx_t_13; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createDraw", 0); __Pyx_INCREF(__pyx_v_display); __Pyx_INCREF(__pyx_v_title); /* "petsc4py/PETSc/Viewer.pyx":406 * * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef const char *cdisplay = NULL * cdef const char *ctitle = NULL */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(37, 406, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/Viewer.pyx":407 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef const char *cdisplay = NULL # <<<<<<<<<<<<<< * cdef const char *ctitle = NULL * display = str2bytes(display, &cdisplay) */ __pyx_v_cdisplay = NULL; /* "petsc4py/PETSc/Viewer.pyx":408 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef const char *cdisplay = NULL * cdef const char *ctitle = NULL # <<<<<<<<<<<<<< * display = str2bytes(display, &cdisplay) * title = str2bytes(title, &ctitle) */ __pyx_v_ctitle = NULL; /* "petsc4py/PETSc/Viewer.pyx":409 * cdef const char *cdisplay = NULL * cdef const char *ctitle = NULL * display = str2bytes(display, &cdisplay) # <<<<<<<<<<<<<< * title = str2bytes(title, &ctitle) * cdef int x, y, h, w */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_display, (&__pyx_v_cdisplay)); if (unlikely(!__pyx_t_2)) __PYX_ERR(37, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_display, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/Viewer.pyx":410 * cdef const char *ctitle = NULL * display = str2bytes(display, &cdisplay) * title = str2bytes(title, &ctitle) # <<<<<<<<<<<<<< * cdef int x, y, h, w * x = y = h = w = PETSC_DECIDE */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_title, (&__pyx_v_ctitle)); if (unlikely(!__pyx_t_2)) __PYX_ERR(37, 410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_title, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/Viewer.pyx":412 * title = str2bytes(title, &ctitle) * cdef int x, y, h, w * x = y = h = w = PETSC_DECIDE # <<<<<<<<<<<<<< * if position not in (None, PETSC_DECIDE): * x, y = position */ __pyx_v_x = PETSC_DECIDE; __pyx_v_y = PETSC_DECIDE; __pyx_v_h = PETSC_DECIDE; __pyx_v_w = PETSC_DECIDE; /* "petsc4py/PETSc/Viewer.pyx":413 * cdef int x, y, h, w * x = y = h = w = PETSC_DECIDE * if position not in (None, PETSC_DECIDE): # <<<<<<<<<<<<<< * x, y = position * if size not in (None, PETSC_DECIDE): */ __Pyx_INCREF(__pyx_v_position); __pyx_t_2 = __pyx_v_position; __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, Py_None, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 413, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(37, 413, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { } else { __pyx_t_3 = __pyx_t_5; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = __Pyx_PyInt_From___pyx_anon_enum(PETSC_DECIDE); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(37, 413, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(37, 413, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_3 = __pyx_t_5; __pyx_L4_bool_binop_done:; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_5 = __pyx_t_3; if (__pyx_t_5) { /* "petsc4py/PETSc/Viewer.pyx":414 * x = y = h = w = PETSC_DECIDE * if position not in (None, PETSC_DECIDE): * x, y = position # <<<<<<<<<<<<<< * if size not in (None, PETSC_DECIDE): * try: */ if ((likely(PyTuple_CheckExact(__pyx_v_position))) || (PyList_CheckExact(__pyx_v_position))) { PyObject* sequence = __pyx_v_position; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(37, 414, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_6 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(37, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(37, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_position); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); index = 0; __pyx_t_2 = __pyx_t_7(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_6 = __pyx_t_7(__pyx_t_4); if (unlikely(!__pyx_t_6)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_4), 2) < 0) __PYX_ERR(37, 414, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L7_unpacking_done; __pyx_L6_unpacking_failed:; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(37, 414, __pyx_L1_error) __pyx_L7_unpacking_done:; } __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(37, 414, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(37, 414, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_x = __pyx_t_8; __pyx_v_y = __pyx_t_9; /* "petsc4py/PETSc/Viewer.pyx":413 * cdef int x, y, h, w * x = y = h = w = PETSC_DECIDE * if position not in (None, PETSC_DECIDE): # <<<<<<<<<<<<<< * x, y = position * if size not in (None, PETSC_DECIDE): */ } /* "petsc4py/PETSc/Viewer.pyx":415 * if position not in (None, PETSC_DECIDE): * x, y = position * if size not in (None, PETSC_DECIDE): # <<<<<<<<<<<<<< * try: * w, h = size */ __Pyx_INCREF(__pyx_v_size); __pyx_t_6 = __pyx_v_size; __pyx_t_2 = PyObject_RichCompare(__pyx_t_6, Py_None, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(37, 415, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(37, 415, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { } else { __pyx_t_5 = __pyx_t_3; goto __pyx_L9_bool_binop_done; } __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(PETSC_DECIDE); if (unlikely(!__pyx_t_2)) __PYX_ERR(37, 415, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 415, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(37, 415, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = __pyx_t_3; __pyx_L9_bool_binop_done:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_3 = __pyx_t_5; if (__pyx_t_3) { /* "petsc4py/PETSc/Viewer.pyx":416 * x, y = position * if size not in (None, PETSC_DECIDE): * try: # <<<<<<<<<<<<<< * w, h = size * except TypeError: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); /*try:*/ { /* "petsc4py/PETSc/Viewer.pyx":417 * if size not in (None, PETSC_DECIDE): * try: * w, h = size # <<<<<<<<<<<<<< * except TypeError: * w = h = size */ if ((likely(PyTuple_CheckExact(__pyx_v_size))) || (PyList_CheckExact(__pyx_v_size))) { PyObject* sequence = __pyx_v_size; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(37, 417, __pyx_L11_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_6 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_4); #else __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(37, 417, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 417, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { Py_ssize_t index = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(37, 417, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); index = 0; __pyx_t_6 = __pyx_t_7(__pyx_t_2); if (unlikely(!__pyx_t_6)) goto __pyx_L17_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_2); if (unlikely(!__pyx_t_4)) goto __pyx_L17_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_2), 2) < 0) __PYX_ERR(37, 417, __pyx_L11_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L18_unpacking_done; __pyx_L17_unpacking_failed:; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(37, 417, __pyx_L11_error) __pyx_L18_unpacking_done:; } __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(37, 417, __pyx_L11_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(37, 417, __pyx_L11_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_w = __pyx_t_9; __pyx_v_h = __pyx_t_8; /* "petsc4py/PETSc/Viewer.pyx":416 * x, y = position * if size not in (None, PETSC_DECIDE): * try: # <<<<<<<<<<<<<< * w, h = size * except TypeError: */ } __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; goto __pyx_L16_try_end; __pyx_L11_error:; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; /* "petsc4py/PETSc/Viewer.pyx":418 * try: * w, h = size * except TypeError: # <<<<<<<<<<<<<< * w = h = size * cdef PetscViewer newvwr = NULL */ __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError); if (__pyx_t_8) { __Pyx_AddTraceback("petsc4py.PETSc.Viewer.createDraw", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_2) < 0) __PYX_ERR(37, 418, __pyx_L13_except_error) __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_2); /* "petsc4py/PETSc/Viewer.pyx":419 * w, h = size * except TypeError: * w = h = size # <<<<<<<<<<<<<< * cdef PetscViewer newvwr = NULL * CHKERR( PetscViewerDrawOpen(ccomm, cdisplay, ctitle, */ __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_size); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(37, 419, __pyx_L13_except_error) __pyx_v_w = __pyx_t_8; __pyx_v_h = __pyx_t_8; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L12_exception_handled; } goto __pyx_L13_except_error; /* "petsc4py/PETSc/Viewer.pyx":416 * x, y = position * if size not in (None, PETSC_DECIDE): * try: # <<<<<<<<<<<<<< * w, h = size * except TypeError: */ __pyx_L13_except_error:; __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); goto __pyx_L1_error; __pyx_L12_exception_handled:; __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); __pyx_L16_try_end:; } /* "petsc4py/PETSc/Viewer.pyx":415 * if position not in (None, PETSC_DECIDE): * x, y = position * if size not in (None, PETSC_DECIDE): # <<<<<<<<<<<<<< * try: * w, h = size */ } /* "petsc4py/PETSc/Viewer.pyx":420 * except TypeError: * w = h = size * cdef PetscViewer newvwr = NULL # <<<<<<<<<<<<<< * CHKERR( PetscViewerDrawOpen(ccomm, cdisplay, ctitle, * x, y, w, h, &newvwr) ) */ __pyx_v_newvwr = NULL; /* "petsc4py/PETSc/Viewer.pyx":421 * w = h = size * cdef PetscViewer newvwr = NULL * CHKERR( PetscViewerDrawOpen(ccomm, cdisplay, ctitle, # <<<<<<<<<<<<<< * x, y, w, h, &newvwr) ) * CHKERR( PetscCLEAR(self.obj) ); self.vwr = newvwr */ __pyx_t_13 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerDrawOpen(__pyx_v_ccomm, __pyx_v_cdisplay, __pyx_v_ctitle, __pyx_v_x, __pyx_v_y, __pyx_v_w, __pyx_v_h, (&__pyx_v_newvwr))); if (unlikely(__pyx_t_13 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 421, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":423 * CHKERR( PetscViewerDrawOpen(ccomm, cdisplay, ctitle, * x, y, w, h, &newvwr) ) * CHKERR( PetscCLEAR(self.obj) ); self.vwr = newvwr # <<<<<<<<<<<<<< * return self * */ __pyx_t_13 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_13 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 423, __pyx_L1_error) __pyx_v_self->vwr = __pyx_v_newvwr; /* "petsc4py/PETSc/Viewer.pyx":424 * x, y, w, h, &newvwr) ) * CHKERR( PetscCLEAR(self.obj) ); self.vwr = newvwr * return self # <<<<<<<<<<<<<< * * def setType(self, vwr_type: Type | str) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Viewer.pyx":376 * return self * * def createDraw( # <<<<<<<<<<<<<< * self, * display: str | None = None, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.Viewer.createDraw", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_display); __Pyx_XDECREF(__pyx_v_title); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Viewer.pyx":426 * return self * * def setType(self, vwr_type: Type | str) -> None: # <<<<<<<<<<<<<< * """Set the type of the viewer. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_23setType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Viewer_22setType, "Viewer.setType(self, vwr_type: Type | str) -> None\nSet the type of the viewer.\n\n Logically collective.\n\n Parameters\n ----------\n vwr_type\n The type of the viewer.\n\n See Also\n --------\n getType, petsc.PetscViewerSetType\n\n \nSource code at petsc4py/PETSc/Viewer.pyx:426"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_23setType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_vwr_type = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vwr_type,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vwr_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(37, 426, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setType") < 0)) __PYX_ERR(37, 426, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_vwr_type = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, __pyx_nargs); __PYX_ERR(37, 426, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Viewer.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_22setType(((struct PyPetscViewerObject *)__pyx_v_self), __pyx_v_vwr_type); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_22setType(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_vwr_type) { PetscViewerType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setType", 0); __Pyx_INCREF(__pyx_v_vwr_type); /* "petsc4py/PETSc/Viewer.pyx":441 * * """ * cdef PetscViewerType cval = NULL # <<<<<<<<<<<<<< * vwr_type = str2bytes(vwr_type, &cval) * CHKERR( PetscViewerSetType(self.vwr, cval) ) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/Viewer.pyx":442 * """ * cdef PetscViewerType cval = NULL * vwr_type = str2bytes(vwr_type, &cval) # <<<<<<<<<<<<<< * CHKERR( PetscViewerSetType(self.vwr, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_vwr_type, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(37, 442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_vwr_type, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Viewer.pyx":443 * cdef PetscViewerType cval = NULL * vwr_type = str2bytes(vwr_type, &cval) * CHKERR( PetscViewerSetType(self.vwr, cval) ) # <<<<<<<<<<<<<< * * def getType(self) -> str: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerSetType(__pyx_v_self->vwr, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 443, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":426 * return self * * def setType(self, vwr_type: Type | str) -> None: # <<<<<<<<<<<<<< * """Set the type of the viewer. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Viewer.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_vwr_type); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Viewer.pyx":445 * CHKERR( PetscViewerSetType(self.vwr, cval) ) * * def getType(self) -> str: # <<<<<<<<<<<<<< * """Return the type of the viewer. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_25getType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Viewer_24getType, "Viewer.getType(self) -> str\nReturn the type of the viewer.\n\n Not collective.\n\n See Also\n --------\n setType, petsc.PetscViewerGetType\n\n \nSource code at petsc4py/PETSc/Viewer.pyx:445"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_25getType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getType", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_24getType(((struct PyPetscViewerObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_24getType(struct PyPetscViewerObject *__pyx_v_self) { PetscViewerType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getType", 1); /* "petsc4py/PETSc/Viewer.pyx":455 * * """ * cdef PetscViewerType cval = NULL # <<<<<<<<<<<<<< * CHKERR( PetscViewerGetType(self.vwr, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/Viewer.pyx":456 * """ * cdef PetscViewerType cval = NULL * CHKERR( PetscViewerGetType(self.vwr, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerGetType(__pyx_v_self->vwr, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 456, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":457 * cdef PetscViewerType cval = NULL * CHKERR( PetscViewerGetType(self.vwr, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * def getFormat(self) -> Format: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(37, 457, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Viewer.pyx":445 * CHKERR( PetscViewerSetType(self.vwr, cval) ) * * def getType(self) -> str: # <<<<<<<<<<<<<< * """Return the type of the viewer. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Viewer.getType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Viewer.pyx":459 * return bytes2str(cval) * * def getFormat(self) -> Format: # <<<<<<<<<<<<<< * """Return the format of the viewer. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_27getFormat(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Viewer_26getFormat, "Viewer.getFormat(self) -> Format\nReturn the format of the viewer.\n\n Not collective.\n\n See Also\n --------\n pushFormat, popFormat, petsc.PetscViewerGetFormat\n\n \nSource code at petsc4py/PETSc/Viewer.pyx:459"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_27getFormat(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getFormat (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getFormat", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getFormat", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_26getFormat(((struct PyPetscViewerObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_26getFormat(struct PyPetscViewerObject *__pyx_v_self) { PetscViewerFormat __pyx_v_format; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getFormat", 1); /* "petsc4py/PETSc/Viewer.pyx":469 * * """ * cdef PetscViewerFormat format = PETSC_VIEWER_DEFAULT # <<<<<<<<<<<<<< * CHKERR( PetscViewerGetFormat(self.vwr, &format) ) * return format */ __pyx_v_format = PETSC_VIEWER_DEFAULT; /* "petsc4py/PETSc/Viewer.pyx":470 * """ * cdef PetscViewerFormat format = PETSC_VIEWER_DEFAULT * CHKERR( PetscViewerGetFormat(self.vwr, &format) ) # <<<<<<<<<<<<<< * return format * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerGetFormat(__pyx_v_self->vwr, (&__pyx_v_format))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 470, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":471 * cdef PetscViewerFormat format = PETSC_VIEWER_DEFAULT * CHKERR( PetscViewerGetFormat(self.vwr, &format) ) * return format # <<<<<<<<<<<<<< * * def pushFormat(self, format: Format) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_PetscViewerFormat(__pyx_v_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(37, 471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Viewer.pyx":459 * return bytes2str(cval) * * def getFormat(self) -> Format: # <<<<<<<<<<<<<< * """Return the format of the viewer. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Viewer.getFormat", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Viewer.pyx":473 * return format * * def pushFormat(self, format: Format) -> None: # <<<<<<<<<<<<<< * """Push format to the viewer. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_29pushFormat(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Viewer_28pushFormat, "Viewer.pushFormat(self, format: Format) -> None\nPush format to the viewer.\n\n Collective.\n\n See Also\n --------\n popFormat, petsc.PetscViewerPushFormat\n\n \nSource code at petsc4py/PETSc/Viewer.pyx:473"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_29pushFormat(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_format = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pushFormat (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_format,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_format)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(37, 473, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "pushFormat") < 0)) __PYX_ERR(37, 473, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_format = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("pushFormat", 1, 1, 1, __pyx_nargs); __PYX_ERR(37, 473, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Viewer.pushFormat", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_28pushFormat(((struct PyPetscViewerObject *)__pyx_v_self), __pyx_v_format); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_28pushFormat(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_format) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscViewerFormat __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pushFormat", 1); /* "petsc4py/PETSc/Viewer.pyx":483 * * """ * CHKERR( PetscViewerPushFormat(self.vwr, format) ) # <<<<<<<<<<<<<< * * def popFormat(self) -> None: */ __pyx_t_1 = ((PetscViewerFormat)__Pyx_PyInt_As_PetscViewerFormat(__pyx_v_format)); if (unlikely(PyErr_Occurred())) __PYX_ERR(37, 483, __pyx_L1_error) __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerPushFormat(__pyx_v_self->vwr, __pyx_t_1)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 483, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":473 * return format * * def pushFormat(self, format: Format) -> None: # <<<<<<<<<<<<<< * """Push format to the viewer. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Viewer.pushFormat", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Viewer.pyx":485 * CHKERR( PetscViewerPushFormat(self.vwr, format) ) * * def popFormat(self) -> None: # <<<<<<<<<<<<<< * """Pop format from the viewer. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_31popFormat(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Viewer_30popFormat, "Viewer.popFormat(self) -> None\nPop format from the viewer.\n\n Collective.\n\n See Also\n --------\n pushFormat, petsc.PetscViewerPopFormat\n\n \nSource code at petsc4py/PETSc/Viewer.pyx:485"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_31popFormat(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("popFormat (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("popFormat", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "popFormat", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_30popFormat(((struct PyPetscViewerObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_30popFormat(struct PyPetscViewerObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("popFormat", 1); /* "petsc4py/PETSc/Viewer.pyx":495 * * """ * CHKERR( PetscViewerPopFormat(self.vwr) ) # <<<<<<<<<<<<<< * * def getSubViewer(self, comm: Comm | None = None) -> Viewer: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerPopFormat(__pyx_v_self->vwr)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 495, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":485 * CHKERR( PetscViewerPushFormat(self.vwr, format) ) * * def popFormat(self) -> None: # <<<<<<<<<<<<<< * """Pop format from the viewer. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Viewer.popFormat", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Viewer.pyx":497 * CHKERR( PetscViewerPopFormat(self.vwr) ) * * def getSubViewer(self, comm: Comm | None = None) -> Viewer: # <<<<<<<<<<<<<< * """Return a viewer defined on a subcommunicator. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_33getSubViewer(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Viewer_32getSubViewer, "Viewer.getSubViewer(self, comm: Comm | None = None) -> Viewer\nReturn a viewer defined on a subcommunicator.\n\n Collective.\n\n Parameters\n ----------\n comm\n The subcommunicator. If `None`, uses `COMM_SELF`.\n\n Notes\n -----\n Users must call `restoreSubViewer` when done.\n\n See Also\n --------\n restoreSubViewer, petsc.PetscViewerGetSubViewer\n\n \nSource code at petsc4py/PETSc/Viewer.pyx:497"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_33getSubViewer(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSubViewer (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(37, 497, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getSubViewer") < 0)) __PYX_ERR(37, 497, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_comm = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getSubViewer", 0, 0, 1, __pyx_nargs); __PYX_ERR(37, 497, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Viewer.getSubViewer", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_32getSubViewer(((struct PyPetscViewerObject *)__pyx_v_self), __pyx_v_comm); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_32getSubViewer(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; struct PyPetscViewerObject *__pyx_v_sub = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSubViewer", 1); /* "petsc4py/PETSc/Viewer.pyx":516 * * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_SELF) # <<<<<<<<<<<<<< * cdef Viewer sub = Viewer() * CHKERR( PetscViewerGetSubViewer(self.vwr, ccomm, &sub.vwr) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, PETSC_COMM_SELF); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(37, 516, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/Viewer.pyx":517 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_SELF) * cdef Viewer sub = Viewer() # <<<<<<<<<<<<<< * CHKERR( PetscViewerGetSubViewer(self.vwr, ccomm, &sub.vwr) ) * return sub */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Viewer)); if (unlikely(!__pyx_t_2)) __PYX_ERR(37, 517, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_sub = ((struct PyPetscViewerObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/Viewer.pyx":518 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_SELF) * cdef Viewer sub = Viewer() * CHKERR( PetscViewerGetSubViewer(self.vwr, ccomm, &sub.vwr) ) # <<<<<<<<<<<<<< * return sub * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerGetSubViewer(__pyx_v_self->vwr, __pyx_v_ccomm, (&__pyx_v_sub->vwr))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 518, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":519 * cdef Viewer sub = Viewer() * CHKERR( PetscViewerGetSubViewer(self.vwr, ccomm, &sub.vwr) ) * return sub # <<<<<<<<<<<<<< * * def restoreSubViewer(self, Viewer sub) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_sub); __pyx_r = ((PyObject *)__pyx_v_sub); goto __pyx_L0; /* "petsc4py/PETSc/Viewer.pyx":497 * CHKERR( PetscViewerPopFormat(self.vwr) ) * * def getSubViewer(self, comm: Comm | None = None) -> Viewer: # <<<<<<<<<<<<<< * """Return a viewer defined on a subcommunicator. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Viewer.getSubViewer", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_sub); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Viewer.pyx":521 * return sub * * def restoreSubViewer(self, Viewer sub) -> None: # <<<<<<<<<<<<<< * """Restore a viewer defined on a subcommunicator. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_35restoreSubViewer(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Viewer_34restoreSubViewer, "Viewer.restoreSubViewer(self, sub: Viewer) -> None\nRestore a viewer defined on a subcommunicator.\n\n Collective.\n\n Parameters\n ----------\n sub\n The subviewer obtained from `getSubViewer`.\n\n See Also\n --------\n getSubViewer, petsc.PetscViewerRestoreSubViewer\n\n \nSource code at petsc4py/PETSc/Viewer.pyx:521"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_35restoreSubViewer(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscViewerObject *__pyx_v_sub = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("restoreSubViewer (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sub,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sub)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(37, 521, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "restoreSubViewer") < 0)) __PYX_ERR(37, 521, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_sub = ((struct PyPetscViewerObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("restoreSubViewer", 1, 1, 1, __pyx_nargs); __PYX_ERR(37, 521, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Viewer.restoreSubViewer", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sub), __pyx_ptype_8petsc4py_5PETSc_Viewer, 0, "sub", 0))) __PYX_ERR(37, 521, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_34restoreSubViewer(((struct PyPetscViewerObject *)__pyx_v_self), __pyx_v_sub); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_34restoreSubViewer(struct PyPetscViewerObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_sub) { MPI_Comm __pyx_v_ccomm; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; MPI_Comm __pyx_t_5; PetscErrorCode __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("restoreSubViewer", 1); /* "petsc4py/PETSc/Viewer.pyx":536 * * """ * cdef MPI_Comm ccomm = def_Comm(sub.getComm(), PETSC_COMM_SELF) # <<<<<<<<<<<<<< * CHKERR( PetscViewerRestoreSubViewer(self.vwr, ccomm, &sub.vwr) ) * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sub), __pyx_n_s_getComm); if (unlikely(!__pyx_t_2)) __PYX_ERR(37, 536, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(37, 536, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_t_1, PETSC_COMM_SELF); if (unlikely(__pyx_t_5 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(37, 536, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_ccomm = __pyx_t_5; /* "petsc4py/PETSc/Viewer.pyx":537 * """ * cdef MPI_Comm ccomm = def_Comm(sub.getComm(), PETSC_COMM_SELF) * CHKERR( PetscViewerRestoreSubViewer(self.vwr, ccomm, &sub.vwr) ) # <<<<<<<<<<<<<< * * @classmethod */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerRestoreSubViewer(__pyx_v_self->vwr, __pyx_v_ccomm, (&__pyx_v_sub->vwr))); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 537, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":521 * return sub * * def restoreSubViewer(self, Viewer sub) -> None: # <<<<<<<<<<<<<< * """Restore a viewer defined on a subcommunicator. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Viewer.restoreSubViewer", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Viewer.pyx":539 * CHKERR( PetscViewerRestoreSubViewer(self.vwr, ccomm, &sub.vwr) ) * * @classmethod # <<<<<<<<<<<<<< * def STDOUT(cls, comm: Comm | None = None) -> Viewer: * """Return the standard output viewer associated with the communicator. */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_37STDOUT(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Viewer_36STDOUT, "Viewer.STDOUT(cls, comm: Comm | None = None) -> Viewer\nReturn the standard output viewer associated with the communicator.\n\n Collective.\n\n Parameters\n ----------\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n \nSource code at petsc4py/PETSc/Viewer.pyx:539"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_37STDOUT(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("STDOUT (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0}; /* "petsc4py/PETSc/Viewer.pyx":540 * * @classmethod * def STDOUT(cls, comm: Comm | None = None) -> Viewer: # <<<<<<<<<<<<<< * """Return the standard output viewer associated with the communicator. * */ values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(37, 539, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "STDOUT") < 0)) __PYX_ERR(37, 539, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_comm = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("STDOUT", 0, 0, 1, __pyx_nargs); __PYX_ERR(37, 539, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Viewer.STDOUT", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_36STDOUT(((PyTypeObject*)__pyx_v_cls), __pyx_v_comm); /* "petsc4py/PETSc/Viewer.pyx":539 * CHKERR( PetscViewerRestoreSubViewer(self.vwr, ccomm, &sub.vwr) ) * * @classmethod # <<<<<<<<<<<<<< * def STDOUT(cls, comm: Comm | None = None) -> Viewer: * """Return the standard output viewer associated with the communicator. */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_36STDOUT(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; struct PyPetscViewerObject *__pyx_v_viewer = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscViewer __pyx_t_3; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("STDOUT", 1); /* "petsc4py/PETSc/Viewer.pyx":551 * * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef Viewer viewer = Viewer() * viewer.vwr = PETSC_VIEWER_STDOUT_(ccomm) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(37, 551, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/Viewer.pyx":552 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef Viewer viewer = Viewer() # <<<<<<<<<<<<<< * viewer.vwr = PETSC_VIEWER_STDOUT_(ccomm) * CHKERR( PetscINCREF(viewer.obj) ) */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Viewer)); if (unlikely(!__pyx_t_2)) __PYX_ERR(37, 552, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_viewer = ((struct PyPetscViewerObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/Viewer.pyx":553 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef Viewer viewer = Viewer() * viewer.vwr = PETSC_VIEWER_STDOUT_(ccomm) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(viewer.obj) ) * return viewer */ __pyx_t_3 = PETSC_VIEWER_STDOUT_(__pyx_v_ccomm); if (unlikely(__pyx_t_3 == ((PetscViewer)NULL) && PyErr_Occurred())) __PYX_ERR(37, 553, __pyx_L1_error) __pyx_v_viewer->vwr = __pyx_t_3; /* "petsc4py/PETSc/Viewer.pyx":554 * cdef Viewer viewer = Viewer() * viewer.vwr = PETSC_VIEWER_STDOUT_(ccomm) * CHKERR( PetscINCREF(viewer.obj) ) # <<<<<<<<<<<<<< * return viewer * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_viewer->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 554, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":555 * viewer.vwr = PETSC_VIEWER_STDOUT_(ccomm) * CHKERR( PetscINCREF(viewer.obj) ) * return viewer # <<<<<<<<<<<<<< * * @classmethod */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_viewer); __pyx_r = ((PyObject *)__pyx_v_viewer); goto __pyx_L0; /* "petsc4py/PETSc/Viewer.pyx":539 * CHKERR( PetscViewerRestoreSubViewer(self.vwr, ccomm, &sub.vwr) ) * * @classmethod # <<<<<<<<<<<<<< * def STDOUT(cls, comm: Comm | None = None) -> Viewer: * """Return the standard output viewer associated with the communicator. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Viewer.STDOUT", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_viewer); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Viewer.pyx":557 * return viewer * * @classmethod # <<<<<<<<<<<<<< * def STDERR(cls, comm: Comm | None = None) -> Viewer: * """Return the standard error viewer associated with the communicator. */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_39STDERR(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Viewer_38STDERR, "Viewer.STDERR(cls, comm: Comm | None = None) -> Viewer\nReturn the standard error viewer associated with the communicator.\n\n Collective.\n\n Parameters\n ----------\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n \nSource code at petsc4py/PETSc/Viewer.pyx:557"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_39STDERR(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("STDERR (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0}; /* "petsc4py/PETSc/Viewer.pyx":558 * * @classmethod * def STDERR(cls, comm: Comm | None = None) -> Viewer: # <<<<<<<<<<<<<< * """Return the standard error viewer associated with the communicator. * */ values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(37, 557, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "STDERR") < 0)) __PYX_ERR(37, 557, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_comm = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("STDERR", 0, 0, 1, __pyx_nargs); __PYX_ERR(37, 557, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Viewer.STDERR", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_38STDERR(((PyTypeObject*)__pyx_v_cls), __pyx_v_comm); /* "petsc4py/PETSc/Viewer.pyx":557 * return viewer * * @classmethod # <<<<<<<<<<<<<< * def STDERR(cls, comm: Comm | None = None) -> Viewer: * """Return the standard error viewer associated with the communicator. */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_38STDERR(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; struct PyPetscViewerObject *__pyx_v_viewer = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscViewer __pyx_t_3; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("STDERR", 1); /* "petsc4py/PETSc/Viewer.pyx":569 * * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef Viewer viewer = Viewer() * viewer.vwr = PETSC_VIEWER_STDERR_(ccomm) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(37, 569, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/Viewer.pyx":570 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef Viewer viewer = Viewer() # <<<<<<<<<<<<<< * viewer.vwr = PETSC_VIEWER_STDERR_(ccomm) * CHKERR( PetscINCREF(viewer.obj) ) */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Viewer)); if (unlikely(!__pyx_t_2)) __PYX_ERR(37, 570, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_viewer = ((struct PyPetscViewerObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/Viewer.pyx":571 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef Viewer viewer = Viewer() * viewer.vwr = PETSC_VIEWER_STDERR_(ccomm) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(viewer.obj) ) * return viewer */ __pyx_t_3 = PETSC_VIEWER_STDERR_(__pyx_v_ccomm); if (unlikely(__pyx_t_3 == ((PetscViewer)NULL) && PyErr_Occurred())) __PYX_ERR(37, 571, __pyx_L1_error) __pyx_v_viewer->vwr = __pyx_t_3; /* "petsc4py/PETSc/Viewer.pyx":572 * cdef Viewer viewer = Viewer() * viewer.vwr = PETSC_VIEWER_STDERR_(ccomm) * CHKERR( PetscINCREF(viewer.obj) ) # <<<<<<<<<<<<<< * return viewer * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_viewer->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 572, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":573 * viewer.vwr = PETSC_VIEWER_STDERR_(ccomm) * CHKERR( PetscINCREF(viewer.obj) ) * return viewer # <<<<<<<<<<<<<< * * @classmethod */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_viewer); __pyx_r = ((PyObject *)__pyx_v_viewer); goto __pyx_L0; /* "petsc4py/PETSc/Viewer.pyx":557 * return viewer * * @classmethod # <<<<<<<<<<<<<< * def STDERR(cls, comm: Comm | None = None) -> Viewer: * """Return the standard error viewer associated with the communicator. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Viewer.STDERR", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_viewer); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Viewer.pyx":575 * return viewer * * @classmethod # <<<<<<<<<<<<<< * def ASCII(cls, name : str, comm: Comm | None = None) -> Viewer: * """Return an ASCII viewer associated with the communicator. */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_41ASCII(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Viewer_40ASCII, "Viewer.ASCII(cls, name: str, comm: Comm | None = None) -> Viewer\nReturn an ASCII viewer associated with the communicator.\n\n Collective.\n\n Parameters\n ----------\n name\n The filename.\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n \nSource code at petsc4py/PETSc/Viewer.pyx:575"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_41ASCII(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_name = 0; PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("ASCII (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_comm,0}; /* "petsc4py/PETSc/Viewer.pyx":576 * * @classmethod * def ASCII(cls, name : str, comm: Comm | None = None) -> Viewer: # <<<<<<<<<<<<<< * """Return an ASCII viewer associated with the communicator. * */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(37, 575, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(37, 575, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "ASCII") < 0)) __PYX_ERR(37, 575, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_name = values[0]; __pyx_v_comm = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("ASCII", 0, 1, 2, __pyx_nargs); __PYX_ERR(37, 575, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Viewer.ASCII", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_40ASCII(((PyTypeObject*)__pyx_v_cls), __pyx_v_name, __pyx_v_comm); /* "petsc4py/PETSc/Viewer.pyx":575 * return viewer * * @classmethod # <<<<<<<<<<<<<< * def ASCII(cls, name : str, comm: Comm | None = None) -> Viewer: * """Return an ASCII viewer associated with the communicator. */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_40ASCII(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_name, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; char const *__pyx_v_cname; struct PyPetscViewerObject *__pyx_v_viewer = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("ASCII", 0); __Pyx_INCREF(__pyx_v_name); /* "petsc4py/PETSc/Viewer.pyx":589 * * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef const char *cname = NULL * name = str2bytes(name, &cname) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(37, 589, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/Viewer.pyx":590 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef const char *cname = NULL # <<<<<<<<<<<<<< * name = str2bytes(name, &cname) * cdef Viewer viewer = Viewer() */ __pyx_v_cname = NULL; /* "petsc4py/PETSc/Viewer.pyx":591 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef const char *cname = NULL * name = str2bytes(name, &cname) # <<<<<<<<<<<<<< * cdef Viewer viewer = Viewer() * CHKERR( PetscViewerASCIIOpen(ccomm, cname, &viewer.vwr) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cname)); if (unlikely(!__pyx_t_2)) __PYX_ERR(37, 591, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/Viewer.pyx":592 * cdef const char *cname = NULL * name = str2bytes(name, &cname) * cdef Viewer viewer = Viewer() # <<<<<<<<<<<<<< * CHKERR( PetscViewerASCIIOpen(ccomm, cname, &viewer.vwr) ) * return viewer */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Viewer)); if (unlikely(!__pyx_t_2)) __PYX_ERR(37, 592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_viewer = ((struct PyPetscViewerObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/Viewer.pyx":593 * name = str2bytes(name, &cname) * cdef Viewer viewer = Viewer() * CHKERR( PetscViewerASCIIOpen(ccomm, cname, &viewer.vwr) ) # <<<<<<<<<<<<<< * return viewer * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerASCIIOpen(__pyx_v_ccomm, __pyx_v_cname, (&__pyx_v_viewer->vwr))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 593, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":594 * cdef Viewer viewer = Viewer() * CHKERR( PetscViewerASCIIOpen(ccomm, cname, &viewer.vwr) ) * return viewer # <<<<<<<<<<<<<< * * @classmethod */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_viewer); __pyx_r = ((PyObject *)__pyx_v_viewer); goto __pyx_L0; /* "petsc4py/PETSc/Viewer.pyx":575 * return viewer * * @classmethod # <<<<<<<<<<<<<< * def ASCII(cls, name : str, comm: Comm | None = None) -> Viewer: * """Return an ASCII viewer associated with the communicator. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Viewer.ASCII", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_viewer); __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Viewer.pyx":596 * return viewer * * @classmethod # <<<<<<<<<<<<<< * def BINARY(cls, comm: Comm | None = None) -> Viewer: * """Return the default `Type.BINARY` viewer associated with the communicator. */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_43BINARY(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Viewer_42BINARY, "Viewer.BINARY(cls, comm: Comm | None = None) -> Viewer\nReturn the default `Type.BINARY` viewer associated with the communicator.\n\n Collective.\n\n Parameters\n ----------\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n \nSource code at petsc4py/PETSc/Viewer.pyx:596"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_43BINARY(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("BINARY (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0}; /* "petsc4py/PETSc/Viewer.pyx":597 * * @classmethod * def BINARY(cls, comm: Comm | None = None) -> Viewer: # <<<<<<<<<<<<<< * """Return the default `Type.BINARY` viewer associated with the communicator. * */ values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(37, 596, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "BINARY") < 0)) __PYX_ERR(37, 596, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_comm = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("BINARY", 0, 0, 1, __pyx_nargs); __PYX_ERR(37, 596, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Viewer.BINARY", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_42BINARY(((PyTypeObject*)__pyx_v_cls), __pyx_v_comm); /* "petsc4py/PETSc/Viewer.pyx":596 * return viewer * * @classmethod # <<<<<<<<<<<<<< * def BINARY(cls, comm: Comm | None = None) -> Viewer: * """Return the default `Type.BINARY` viewer associated with the communicator. */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_42BINARY(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; struct PyPetscViewerObject *__pyx_v_viewer = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscViewer __pyx_t_3; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("BINARY", 1); /* "petsc4py/PETSc/Viewer.pyx":608 * * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef Viewer viewer = Viewer() * viewer.vwr = PETSC_VIEWER_BINARY_(ccomm) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(37, 608, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/Viewer.pyx":609 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef Viewer viewer = Viewer() # <<<<<<<<<<<<<< * viewer.vwr = PETSC_VIEWER_BINARY_(ccomm) * CHKERR( PetscINCREF(viewer.obj) ) */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Viewer)); if (unlikely(!__pyx_t_2)) __PYX_ERR(37, 609, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_viewer = ((struct PyPetscViewerObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/Viewer.pyx":610 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef Viewer viewer = Viewer() * viewer.vwr = PETSC_VIEWER_BINARY_(ccomm) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(viewer.obj) ) * return viewer */ __pyx_t_3 = PETSC_VIEWER_BINARY_(__pyx_v_ccomm); if (unlikely(__pyx_t_3 == ((PetscViewer)NULL) && PyErr_Occurred())) __PYX_ERR(37, 610, __pyx_L1_error) __pyx_v_viewer->vwr = __pyx_t_3; /* "petsc4py/PETSc/Viewer.pyx":611 * cdef Viewer viewer = Viewer() * viewer.vwr = PETSC_VIEWER_BINARY_(ccomm) * CHKERR( PetscINCREF(viewer.obj) ) # <<<<<<<<<<<<<< * return viewer * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_viewer->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 611, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":612 * viewer.vwr = PETSC_VIEWER_BINARY_(ccomm) * CHKERR( PetscINCREF(viewer.obj) ) * return viewer # <<<<<<<<<<<<<< * * @classmethod */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_viewer); __pyx_r = ((PyObject *)__pyx_v_viewer); goto __pyx_L0; /* "petsc4py/PETSc/Viewer.pyx":596 * return viewer * * @classmethod # <<<<<<<<<<<<<< * def BINARY(cls, comm: Comm | None = None) -> Viewer: * """Return the default `Type.BINARY` viewer associated with the communicator. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Viewer.BINARY", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_viewer); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Viewer.pyx":614 * return viewer * * @classmethod # <<<<<<<<<<<<<< * def DRAW(cls, comm: Comm | None = None) -> Viewer: * """Return the default `Type.DRAW` viewer associated with the communicator. */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_45DRAW(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Viewer_44DRAW, "Viewer.DRAW(cls, comm: Comm | None = None) -> Viewer\nReturn the default `Type.DRAW` viewer associated with the communicator.\n\n Collective.\n\n Parameters\n ----------\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n \nSource code at petsc4py/PETSc/Viewer.pyx:614"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_45DRAW(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("DRAW (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0}; /* "petsc4py/PETSc/Viewer.pyx":615 * * @classmethod * def DRAW(cls, comm: Comm | None = None) -> Viewer: # <<<<<<<<<<<<<< * """Return the default `Type.DRAW` viewer associated with the communicator. * */ values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(37, 614, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "DRAW") < 0)) __PYX_ERR(37, 614, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_comm = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("DRAW", 0, 0, 1, __pyx_nargs); __PYX_ERR(37, 614, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Viewer.DRAW", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_44DRAW(((PyTypeObject*)__pyx_v_cls), __pyx_v_comm); /* "petsc4py/PETSc/Viewer.pyx":614 * return viewer * * @classmethod # <<<<<<<<<<<<<< * def DRAW(cls, comm: Comm | None = None) -> Viewer: * """Return the default `Type.DRAW` viewer associated with the communicator. */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_44DRAW(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; struct PyPetscViewerObject *__pyx_v_viewer = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscViewer __pyx_t_3; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("DRAW", 1); /* "petsc4py/PETSc/Viewer.pyx":626 * * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef Viewer viewer = Viewer() * viewer.vwr = PETSC_VIEWER_DRAW_(ccomm) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(37, 626, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/Viewer.pyx":627 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef Viewer viewer = Viewer() # <<<<<<<<<<<<<< * viewer.vwr = PETSC_VIEWER_DRAW_(ccomm) * CHKERR( PetscINCREF(viewer.obj) ) */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Viewer)); if (unlikely(!__pyx_t_2)) __PYX_ERR(37, 627, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_viewer = ((struct PyPetscViewerObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/Viewer.pyx":628 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef Viewer viewer = Viewer() * viewer.vwr = PETSC_VIEWER_DRAW_(ccomm) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(viewer.obj) ) * return viewer */ __pyx_t_3 = PETSC_VIEWER_DRAW_(__pyx_v_ccomm); if (unlikely(__pyx_t_3 == ((PetscViewer)NULL) && PyErr_Occurred())) __PYX_ERR(37, 628, __pyx_L1_error) __pyx_v_viewer->vwr = __pyx_t_3; /* "petsc4py/PETSc/Viewer.pyx":629 * cdef Viewer viewer = Viewer() * viewer.vwr = PETSC_VIEWER_DRAW_(ccomm) * CHKERR( PetscINCREF(viewer.obj) ) # <<<<<<<<<<<<<< * return viewer * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_viewer->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 629, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":630 * viewer.vwr = PETSC_VIEWER_DRAW_(ccomm) * CHKERR( PetscINCREF(viewer.obj) ) * return viewer # <<<<<<<<<<<<<< * * # --- ASCII viewers --- */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_viewer); __pyx_r = ((PyObject *)__pyx_v_viewer); goto __pyx_L0; /* "petsc4py/PETSc/Viewer.pyx":614 * return viewer * * @classmethod # <<<<<<<<<<<<<< * def DRAW(cls, comm: Comm | None = None) -> Viewer: * """Return the default `Type.DRAW` viewer associated with the communicator. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Viewer.DRAW", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_viewer); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Viewer.pyx":634 * # --- ASCII viewers --- * * def setASCIITab(self, tabs : int) -> None: # <<<<<<<<<<<<<< * """Set ASCII tab level. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_47setASCIITab(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Viewer_46setASCIITab, "Viewer.setASCIITab(self, tabs: int) -> None\nSet ASCII tab level.\n\n Collective.\n\n See Also\n --------\n getASCIITab, petsc.PetscViewerASCIISetTab\n\n \nSource code at petsc4py/PETSc/Viewer.pyx:634"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_47setASCIITab(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_tabs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setASCIITab (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tabs,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_tabs)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(37, 634, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setASCIITab") < 0)) __PYX_ERR(37, 634, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_tabs = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setASCIITab", 1, 1, 1, __pyx_nargs); __PYX_ERR(37, 634, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Viewer.setASCIITab", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_46setASCIITab(((struct PyPetscViewerObject *)__pyx_v_self), __pyx_v_tabs); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_46setASCIITab(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_tabs) { PetscInt __pyx_v_ctabs; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setASCIITab", 1); /* "petsc4py/PETSc/Viewer.pyx":644 * * """ * cdef PetscInt ctabs = asInt(tabs) # <<<<<<<<<<<<<< * CHKERR( PetscViewerASCIISetTab(self.vwr, ctabs) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_tabs); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(37, 644, __pyx_L1_error) __pyx_v_ctabs = __pyx_t_1; /* "petsc4py/PETSc/Viewer.pyx":645 * """ * cdef PetscInt ctabs = asInt(tabs) * CHKERR( PetscViewerASCIISetTab(self.vwr, ctabs) ) # <<<<<<<<<<<<<< * * def getASCIITab(self) -> int: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerASCIISetTab(__pyx_v_self->vwr, __pyx_v_ctabs)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 645, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":634 * # --- ASCII viewers --- * * def setASCIITab(self, tabs : int) -> None: # <<<<<<<<<<<<<< * """Set ASCII tab level. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Viewer.setASCIITab", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Viewer.pyx":647 * CHKERR( PetscViewerASCIISetTab(self.vwr, ctabs) ) * * def getASCIITab(self) -> int: # <<<<<<<<<<<<<< * """Return the ASCII tab level. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_49getASCIITab(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Viewer_48getASCIITab, "Viewer.getASCIITab(self) -> int\nReturn the ASCII tab level.\n\n Not collective.\n\n See Also\n --------\n setASCIITab, petsc.PetscViewerASCIIGetTab\n\n \nSource code at petsc4py/PETSc/Viewer.pyx:647"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_49getASCIITab(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getASCIITab (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getASCIITab", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getASCIITab", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_48getASCIITab(((struct PyPetscViewerObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_48getASCIITab(struct PyPetscViewerObject *__pyx_v_self) { PetscInt __pyx_v_tabs; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getASCIITab", 1); /* "petsc4py/PETSc/Viewer.pyx":657 * * """ * cdef PetscInt tabs = 0 # <<<<<<<<<<<<<< * CHKERR( PetscViewerASCIIGetTab(self.vwr, &tabs) ) * return toInt(tabs) */ __pyx_v_tabs = 0; /* "petsc4py/PETSc/Viewer.pyx":658 * """ * cdef PetscInt tabs = 0 * CHKERR( PetscViewerASCIIGetTab(self.vwr, &tabs) ) # <<<<<<<<<<<<<< * return toInt(tabs) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerASCIIGetTab(__pyx_v_self->vwr, (&__pyx_v_tabs))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 658, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":659 * cdef PetscInt tabs = 0 * CHKERR( PetscViewerASCIIGetTab(self.vwr, &tabs) ) * return toInt(tabs) # <<<<<<<<<<<<<< * * def addASCIITab(self, tabs: int): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_tabs); if (unlikely(!__pyx_t_2)) __PYX_ERR(37, 659, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Viewer.pyx":647 * CHKERR( PetscViewerASCIISetTab(self.vwr, ctabs) ) * * def getASCIITab(self) -> int: # <<<<<<<<<<<<<< * """Return the ASCII tab level. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Viewer.getASCIITab", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Viewer.pyx":661 * return toInt(tabs) * * def addASCIITab(self, tabs: int): # <<<<<<<<<<<<<< * """Increment the ASCII tab level. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_51addASCIITab(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Viewer_50addASCIITab, "Viewer.addASCIITab(self, tabs: int)\nIncrement the ASCII tab level.\n\n Collective.\n\n See Also\n --------\n petsc.PetscViewerASCIIAddTab\n\n \nSource code at petsc4py/PETSc/Viewer.pyx:661"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_51addASCIITab(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_tabs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("addASCIITab (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tabs,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_tabs)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(37, 661, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "addASCIITab") < 0)) __PYX_ERR(37, 661, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_tabs = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("addASCIITab", 1, 1, 1, __pyx_nargs); __PYX_ERR(37, 661, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Viewer.addASCIITab", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_50addASCIITab(((struct PyPetscViewerObject *)__pyx_v_self), __pyx_v_tabs); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_50addASCIITab(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_tabs) { PetscInt __pyx_v_ctabs; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("addASCIITab", 1); /* "petsc4py/PETSc/Viewer.pyx":671 * * """ * cdef PetscInt ctabs = asInt(tabs) # <<<<<<<<<<<<<< * CHKERR( PetscViewerASCIIAddTab(self.vwr, ctabs) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_tabs); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(37, 671, __pyx_L1_error) __pyx_v_ctabs = __pyx_t_1; /* "petsc4py/PETSc/Viewer.pyx":672 * """ * cdef PetscInt ctabs = asInt(tabs) * CHKERR( PetscViewerASCIIAddTab(self.vwr, ctabs) ) # <<<<<<<<<<<<<< * * def subtractASCIITab(self, tabs: int) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerASCIIAddTab(__pyx_v_self->vwr, __pyx_v_ctabs)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 672, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":661 * return toInt(tabs) * * def addASCIITab(self, tabs: int): # <<<<<<<<<<<<<< * """Increment the ASCII tab level. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Viewer.addASCIITab", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Viewer.pyx":674 * CHKERR( PetscViewerASCIIAddTab(self.vwr, ctabs) ) * * def subtractASCIITab(self, tabs: int) -> None: # <<<<<<<<<<<<<< * """Decrement the ASCII tab level. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_53subtractASCIITab(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Viewer_52subtractASCIITab, "Viewer.subtractASCIITab(self, tabs: int) -> None\nDecrement the ASCII tab level.\n\n Collective.\n\n See Also\n --------\n petsc.PetscViewerASCIISubtractTab\n\n \nSource code at petsc4py/PETSc/Viewer.pyx:674"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_53subtractASCIITab(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_tabs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("subtractASCIITab (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tabs,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_tabs)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(37, 674, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "subtractASCIITab") < 0)) __PYX_ERR(37, 674, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_tabs = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("subtractASCIITab", 1, 1, 1, __pyx_nargs); __PYX_ERR(37, 674, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Viewer.subtractASCIITab", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_52subtractASCIITab(((struct PyPetscViewerObject *)__pyx_v_self), __pyx_v_tabs); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_52subtractASCIITab(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_tabs) { PetscInt __pyx_v_ctabs; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("subtractASCIITab", 1); /* "petsc4py/PETSc/Viewer.pyx":684 * * """ * cdef PetscInt ctabs = asInt(tabs) # <<<<<<<<<<<<<< * CHKERR( PetscViewerASCIISubtractTab(self.vwr, ctabs) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_tabs); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(37, 684, __pyx_L1_error) __pyx_v_ctabs = __pyx_t_1; /* "petsc4py/PETSc/Viewer.pyx":685 * """ * cdef PetscInt ctabs = asInt(tabs) * CHKERR( PetscViewerASCIISubtractTab(self.vwr, ctabs) ) # <<<<<<<<<<<<<< * * def pushASCIISynchronized(self) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerASCIISubtractTab(__pyx_v_self->vwr, __pyx_v_ctabs)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 685, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":674 * CHKERR( PetscViewerASCIIAddTab(self.vwr, ctabs) ) * * def subtractASCIITab(self, tabs: int) -> None: # <<<<<<<<<<<<<< * """Decrement the ASCII tab level. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Viewer.subtractASCIITab", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Viewer.pyx":687 * CHKERR( PetscViewerASCIISubtractTab(self.vwr, ctabs) ) * * def pushASCIISynchronized(self) -> None: # <<<<<<<<<<<<<< * """Allow ASCII synchronized calls. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_55pushASCIISynchronized(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Viewer_54pushASCIISynchronized, "Viewer.pushASCIISynchronized(self) -> None\nAllow ASCII synchronized calls.\n\n Collective.\n\n See Also\n --------\n printfASCIISynchronized, popASCIISynchronized\n petsc.PetscViewerASCIIPushSynchronized\n\n \nSource code at petsc4py/PETSc/Viewer.pyx:687"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_55pushASCIISynchronized(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pushASCIISynchronized (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("pushASCIISynchronized", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "pushASCIISynchronized", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_54pushASCIISynchronized(((struct PyPetscViewerObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_54pushASCIISynchronized(struct PyPetscViewerObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pushASCIISynchronized", 1); /* "petsc4py/PETSc/Viewer.pyx":698 * * """ * CHKERR( PetscViewerASCIIPushSynchronized(self.vwr) ) # <<<<<<<<<<<<<< * * def popASCIISynchronized(self) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerASCIIPushSynchronized(__pyx_v_self->vwr)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 698, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":687 * CHKERR( PetscViewerASCIISubtractTab(self.vwr, ctabs) ) * * def pushASCIISynchronized(self) -> None: # <<<<<<<<<<<<<< * """Allow ASCII synchronized calls. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Viewer.pushASCIISynchronized", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Viewer.pyx":700 * CHKERR( PetscViewerASCIIPushSynchronized(self.vwr) ) * * def popASCIISynchronized(self) -> None: # <<<<<<<<<<<<<< * """Disallow ASCII synchronized calls. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_57popASCIISynchronized(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Viewer_56popASCIISynchronized, "Viewer.popASCIISynchronized(self) -> None\nDisallow ASCII synchronized calls.\n\n Collective.\n\n See Also\n --------\n printfASCIISynchronized, pushASCIISynchronized\n petsc.PetscViewerASCIIPopSynchronized\n\n \nSource code at petsc4py/PETSc/Viewer.pyx:700"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_57popASCIISynchronized(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("popASCIISynchronized (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("popASCIISynchronized", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "popASCIISynchronized", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_56popASCIISynchronized(((struct PyPetscViewerObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_56popASCIISynchronized(struct PyPetscViewerObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("popASCIISynchronized", 1); /* "petsc4py/PETSc/Viewer.pyx":711 * * """ * CHKERR( PetscViewerASCIIPopSynchronized(self.vwr) ) # <<<<<<<<<<<<<< * * def pushASCIITab(self) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerASCIIPopSynchronized(__pyx_v_self->vwr)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 711, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":700 * CHKERR( PetscViewerASCIIPushSynchronized(self.vwr) ) * * def popASCIISynchronized(self) -> None: # <<<<<<<<<<<<<< * """Disallow ASCII synchronized calls. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Viewer.popASCIISynchronized", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Viewer.pyx":713 * CHKERR( PetscViewerASCIIPopSynchronized(self.vwr) ) * * def pushASCIITab(self) -> None: # <<<<<<<<<<<<<< * """Push an additional tab level. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_59pushASCIITab(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Viewer_58pushASCIITab, "Viewer.pushASCIITab(self) -> None\nPush an additional tab level.\n\n Collective.\n\n See Also\n --------\n popASCIITab, petsc.PetscViewerASCIIPushTab\n\n \nSource code at petsc4py/PETSc/Viewer.pyx:713"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_59pushASCIITab(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pushASCIITab (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("pushASCIITab", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "pushASCIITab", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_58pushASCIITab(((struct PyPetscViewerObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_58pushASCIITab(struct PyPetscViewerObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pushASCIITab", 1); /* "petsc4py/PETSc/Viewer.pyx":723 * * """ * CHKERR( PetscViewerASCIIPushTab(self.vwr) ) # <<<<<<<<<<<<<< * * def popASCIITab(self) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerASCIIPushTab(__pyx_v_self->vwr)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 723, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":713 * CHKERR( PetscViewerASCIIPopSynchronized(self.vwr) ) * * def pushASCIITab(self) -> None: # <<<<<<<<<<<<<< * """Push an additional tab level. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Viewer.pushASCIITab", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Viewer.pyx":725 * CHKERR( PetscViewerASCIIPushTab(self.vwr) ) * * def popASCIITab(self) -> None: # <<<<<<<<<<<<<< * """Pop an additional tab level pushed via `pushASCIITab`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_61popASCIITab(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Viewer_60popASCIITab, "Viewer.popASCIITab(self) -> None\nPop an additional tab level pushed via `pushASCIITab`.\n\n Collective.\n\n See Also\n --------\n pushASCIITab, petsc.PetscViewerASCIIPopTab\n\n \nSource code at petsc4py/PETSc/Viewer.pyx:725"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_61popASCIITab(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("popASCIITab (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("popASCIITab", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "popASCIITab", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_60popASCIITab(((struct PyPetscViewerObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_60popASCIITab(struct PyPetscViewerObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("popASCIITab", 1); /* "petsc4py/PETSc/Viewer.pyx":735 * * """ * CHKERR( PetscViewerASCIIPopTab(self.vwr) ) # <<<<<<<<<<<<<< * * def useASCIITabs(self, flag: bool) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerASCIIPopTab(__pyx_v_self->vwr)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 735, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":725 * CHKERR( PetscViewerASCIIPushTab(self.vwr) ) * * def popASCIITab(self) -> None: # <<<<<<<<<<<<<< * """Pop an additional tab level pushed via `pushASCIITab`. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Viewer.popASCIITab", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Viewer.pyx":737 * CHKERR( PetscViewerASCIIPopTab(self.vwr) ) * * def useASCIITabs(self, flag: bool) -> None: # <<<<<<<<<<<<<< * """Enable/disable the use of ASCII tabs. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_63useASCIITabs(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Viewer_62useASCIITabs, "Viewer.useASCIITabs(self, flag: bool) -> None\nEnable/disable the use of ASCII tabs.\n\n Collective.\n\n See Also\n --------\n petsc.PetscViewerASCIIUseTabs\n\n \nSource code at petsc4py/PETSc/Viewer.pyx:737"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_63useASCIITabs(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_flag = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("useASCIITabs (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flag)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(37, 737, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "useASCIITabs") < 0)) __PYX_ERR(37, 737, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_flag = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("useASCIITabs", 1, 1, 1, __pyx_nargs); __PYX_ERR(37, 737, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Viewer.useASCIITabs", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_62useASCIITabs(((struct PyPetscViewerObject *)__pyx_v_self), __pyx_v_flag); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_62useASCIITabs(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_flag) { PetscBool __pyx_v_flg; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("useASCIITabs", 1); /* "petsc4py/PETSc/Viewer.pyx":747 * * """ * cdef PetscBool flg = asBool(flag) # <<<<<<<<<<<<<< * CHKERR( PetscViewerASCIIUseTabs(self.vwr, flg) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asBool(__pyx_v_flag); if (unlikely(__pyx_t_1 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(37, 747, __pyx_L1_error) __pyx_v_flg = __pyx_t_1; /* "petsc4py/PETSc/Viewer.pyx":748 * """ * cdef PetscBool flg = asBool(flag) * CHKERR( PetscViewerASCIIUseTabs(self.vwr, flg) ) # <<<<<<<<<<<<<< * * def printfASCII(self, msg: str) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerASCIIUseTabs(__pyx_v_self->vwr, __pyx_v_flg)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 748, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":737 * CHKERR( PetscViewerASCIIPopTab(self.vwr) ) * * def useASCIITabs(self, flag: bool) -> None: # <<<<<<<<<<<<<< * """Enable/disable the use of ASCII tabs. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Viewer.useASCIITabs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Viewer.pyx":750 * CHKERR( PetscViewerASCIIUseTabs(self.vwr, flg) ) * * def printfASCII(self, msg: str) -> None: # <<<<<<<<<<<<<< * """Print a message. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_65printfASCII(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Viewer_64printfASCII, "Viewer.printfASCII(self, msg: str) -> None\nPrint a message.\n\n Collective.\n\n See Also\n --------\n petsc.PetscViewerASCIIPrintf\n\n \nSource code at petsc4py/PETSc/Viewer.pyx:750"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_65printfASCII(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_msg = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("printfASCII (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_msg,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_msg)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(37, 750, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "printfASCII") < 0)) __PYX_ERR(37, 750, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_msg = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("printfASCII", 1, 1, 1, __pyx_nargs); __PYX_ERR(37, 750, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Viewer.printfASCII", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_64printfASCII(((struct PyPetscViewerObject *)__pyx_v_self), __pyx_v_msg); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_64printfASCII(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_msg) { char const *__pyx_v_cmsg; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("printfASCII", 0); __Pyx_INCREF(__pyx_v_msg); /* "petsc4py/PETSc/Viewer.pyx":760 * * """ * cdef const char *cmsg = NULL # <<<<<<<<<<<<<< * msg = str2bytes(msg, &cmsg) * CHKERR( PetscViewerASCIIPrintf(self.vwr, '%s', cmsg) ) */ __pyx_v_cmsg = NULL; /* "petsc4py/PETSc/Viewer.pyx":761 * """ * cdef const char *cmsg = NULL * msg = str2bytes(msg, &cmsg) # <<<<<<<<<<<<<< * CHKERR( PetscViewerASCIIPrintf(self.vwr, '%s', cmsg) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_msg, (&__pyx_v_cmsg)); if (unlikely(!__pyx_t_1)) __PYX_ERR(37, 761, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_msg, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Viewer.pyx":762 * cdef const char *cmsg = NULL * msg = str2bytes(msg, &cmsg) * CHKERR( PetscViewerASCIIPrintf(self.vwr, '%s', cmsg) ) # <<<<<<<<<<<<<< * * def printfASCIISynchronized(self, msg: str) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerASCIIPrintf(__pyx_v_self->vwr, ((char *)"%s"), __pyx_v_cmsg)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 762, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":750 * CHKERR( PetscViewerASCIIUseTabs(self.vwr, flg) ) * * def printfASCII(self, msg: str) -> None: # <<<<<<<<<<<<<< * """Print a message. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Viewer.printfASCII", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_msg); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Viewer.pyx":764 * CHKERR( PetscViewerASCIIPrintf(self.vwr, '%s', cmsg) ) * * def printfASCIISynchronized(self, msg: str) -> None: # <<<<<<<<<<<<<< * """Print a synchronized message. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_67printfASCIISynchronized(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Viewer_66printfASCIISynchronized, "Viewer.printfASCIISynchronized(self, msg: str) -> None\nPrint a synchronized message.\n\n Collective.\n\n See Also\n --------\n pushASCIISynchronized, petsc.PetscViewerASCIISynchronizedPrintf\n\n \nSource code at petsc4py/PETSc/Viewer.pyx:764"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_67printfASCIISynchronized(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_msg = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("printfASCIISynchronized (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_msg,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_msg)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(37, 764, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "printfASCIISynchronized") < 0)) __PYX_ERR(37, 764, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_msg = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("printfASCIISynchronized", 1, 1, 1, __pyx_nargs); __PYX_ERR(37, 764, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Viewer.printfASCIISynchronized", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_66printfASCIISynchronized(((struct PyPetscViewerObject *)__pyx_v_self), __pyx_v_msg); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_66printfASCIISynchronized(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_msg) { char const *__pyx_v_cmsg; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("printfASCIISynchronized", 0); __Pyx_INCREF(__pyx_v_msg); /* "petsc4py/PETSc/Viewer.pyx":774 * * """ * cdef const char *cmsg = NULL # <<<<<<<<<<<<<< * msg = str2bytes(msg, &cmsg) * CHKERR( PetscViewerASCIISynchronizedPrintf(self.vwr, '%s', cmsg) ) */ __pyx_v_cmsg = NULL; /* "petsc4py/PETSc/Viewer.pyx":775 * """ * cdef const char *cmsg = NULL * msg = str2bytes(msg, &cmsg) # <<<<<<<<<<<<<< * CHKERR( PetscViewerASCIISynchronizedPrintf(self.vwr, '%s', cmsg) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_msg, (&__pyx_v_cmsg)); if (unlikely(!__pyx_t_1)) __PYX_ERR(37, 775, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_msg, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Viewer.pyx":776 * cdef const char *cmsg = NULL * msg = str2bytes(msg, &cmsg) * CHKERR( PetscViewerASCIISynchronizedPrintf(self.vwr, '%s', cmsg) ) # <<<<<<<<<<<<<< * * # --- methods specific to file viewers --- */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerASCIISynchronizedPrintf(__pyx_v_self->vwr, ((char *)"%s"), __pyx_v_cmsg)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 776, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":764 * CHKERR( PetscViewerASCIIPrintf(self.vwr, '%s', cmsg) ) * * def printfASCIISynchronized(self, msg: str) -> None: # <<<<<<<<<<<<<< * """Print a synchronized message. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Viewer.printfASCIISynchronized", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_msg); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Viewer.pyx":780 * # --- methods specific to file viewers --- * * def flush(self) -> None: # <<<<<<<<<<<<<< * """Flush the viewer. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_69flush(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Viewer_68flush, "Viewer.flush(self) -> None\nFlush the viewer.\n\n Collective.\n\n See Also\n --------\n petsc.PetscViewerFlush\n\n \nSource code at petsc4py/PETSc/Viewer.pyx:780"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_69flush(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("flush (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("flush", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "flush", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_68flush(((struct PyPetscViewerObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_68flush(struct PyPetscViewerObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("flush", 1); /* "petsc4py/PETSc/Viewer.pyx":790 * * """ * CHKERR( PetscViewerFlush(self.vwr) ) # <<<<<<<<<<<<<< * * def setFileMode(self, mode: FileMode | str) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerFlush(__pyx_v_self->vwr)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 790, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":780 * # --- methods specific to file viewers --- * * def flush(self) -> None: # <<<<<<<<<<<<<< * """Flush the viewer. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Viewer.flush", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Viewer.pyx":792 * CHKERR( PetscViewerFlush(self.vwr) ) * * def setFileMode(self, mode: FileMode | str) -> None: # <<<<<<<<<<<<<< * """Set file mode. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_71setFileMode(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Viewer_70setFileMode, "Viewer.setFileMode(self, mode: FileMode | str) -> None\nSet file mode.\n\n Collective.\n\n See Also\n --------\n getFileMode, petsc.PetscViewerFileSetMode\n\n \nSource code at petsc4py/PETSc/Viewer.pyx:792"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_71setFileMode(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_mode = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFileMode (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mode,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mode)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(37, 792, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setFileMode") < 0)) __PYX_ERR(37, 792, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_mode = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setFileMode", 1, 1, 1, __pyx_nargs); __PYX_ERR(37, 792, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Viewer.setFileMode", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_70setFileMode(((struct PyPetscViewerObject *)__pyx_v_self), __pyx_v_mode); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_70setFileMode(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_mode) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscFileMode __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFileMode", 1); /* "petsc4py/PETSc/Viewer.pyx":802 * * """ * CHKERR( PetscViewerFileSetMode(self.vwr, filemode(mode)) ) # <<<<<<<<<<<<<< * * def getFileMode(self) -> FileMode: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_filemode(__pyx_v_mode); if (unlikely(__pyx_t_1 == ((PetscFileMode)((PetscFileMode)-1L)))) __PYX_ERR(37, 802, __pyx_L1_error) __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerFileSetMode(__pyx_v_self->vwr, __pyx_t_1)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 802, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":792 * CHKERR( PetscViewerFlush(self.vwr) ) * * def setFileMode(self, mode: FileMode | str) -> None: # <<<<<<<<<<<<<< * """Set file mode. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Viewer.setFileMode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Viewer.pyx":804 * CHKERR( PetscViewerFileSetMode(self.vwr, filemode(mode)) ) * * def getFileMode(self) -> FileMode: # <<<<<<<<<<<<<< * """Return the file mode. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_73getFileMode(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Viewer_72getFileMode, "Viewer.getFileMode(self) -> FileMode\nReturn the file mode.\n\n Not collective.\n\n See Also\n --------\n setFileMode, petsc.PetscViewerFileGetMode\n\n \nSource code at petsc4py/PETSc/Viewer.pyx:804"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_73getFileMode(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getFileMode (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getFileMode", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getFileMode", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_72getFileMode(((struct PyPetscViewerObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_72getFileMode(struct PyPetscViewerObject *__pyx_v_self) { PetscFileMode __pyx_v_mode; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getFileMode", 1); /* "petsc4py/PETSc/Viewer.pyx":814 * * """ * cdef PetscFileMode mode = PETSC_FILE_MODE_READ # <<<<<<<<<<<<<< * CHKERR( PetscViewerFileGetMode(self.vwr, &mode) ) * return mode */ __pyx_v_mode = FILE_MODE_READ; /* "petsc4py/PETSc/Viewer.pyx":815 * """ * cdef PetscFileMode mode = PETSC_FILE_MODE_READ * CHKERR( PetscViewerFileGetMode(self.vwr, &mode) ) # <<<<<<<<<<<<<< * return mode * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerFileGetMode(__pyx_v_self->vwr, (&__pyx_v_mode))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 815, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":816 * cdef PetscFileMode mode = PETSC_FILE_MODE_READ * CHKERR( PetscViewerFileGetMode(self.vwr, &mode) ) * return mode # <<<<<<<<<<<<<< * * def setFileName(self, name: str) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_PetscFileMode(__pyx_v_mode); if (unlikely(!__pyx_t_2)) __PYX_ERR(37, 816, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Viewer.pyx":804 * CHKERR( PetscViewerFileSetMode(self.vwr, filemode(mode)) ) * * def getFileMode(self) -> FileMode: # <<<<<<<<<<<<<< * """Return the file mode. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Viewer.getFileMode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Viewer.pyx":818 * return mode * * def setFileName(self, name: str) -> None: # <<<<<<<<<<<<<< * """Set file name. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_75setFileName(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Viewer_74setFileName, "Viewer.setFileName(self, name: str) -> None\nSet file name.\n\n Collective.\n\n See Also\n --------\n getFileName, petsc.PetscViewerFileSetName\n\n \nSource code at petsc4py/PETSc/Viewer.pyx:818"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_75setFileName(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_name = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFileName (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(37, 818, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setFileName") < 0)) __PYX_ERR(37, 818, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_name = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setFileName", 1, 1, 1, __pyx_nargs); __PYX_ERR(37, 818, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Viewer.setFileName", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_74setFileName(((struct PyPetscViewerObject *)__pyx_v_self), __pyx_v_name); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_74setFileName(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_name) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFileName", 0); __Pyx_INCREF(__pyx_v_name); /* "petsc4py/PETSc/Viewer.pyx":828 * * """ * cdef const char *cval = NULL # <<<<<<<<<<<<<< * name = str2bytes(name, &cval) * CHKERR( PetscViewerFileSetName(self.vwr, cval) ) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/Viewer.pyx":829 * """ * cdef const char *cval = NULL * name = str2bytes(name, &cval) # <<<<<<<<<<<<<< * CHKERR( PetscViewerFileSetName(self.vwr, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(37, 829, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Viewer.pyx":830 * cdef const char *cval = NULL * name = str2bytes(name, &cval) * CHKERR( PetscViewerFileSetName(self.vwr, cval) ) # <<<<<<<<<<<<<< * * def getFileName(self) -> str: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerFileSetName(__pyx_v_self->vwr, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 830, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":818 * return mode * * def setFileName(self, name: str) -> None: # <<<<<<<<<<<<<< * """Set file name. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Viewer.setFileName", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Viewer.pyx":832 * CHKERR( PetscViewerFileSetName(self.vwr, cval) ) * * def getFileName(self) -> str: # <<<<<<<<<<<<<< * """Return file name. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_77getFileName(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Viewer_76getFileName, "Viewer.getFileName(self) -> str\nReturn file name.\n\n Not collective.\n\n See Also\n --------\n setFileName, petsc.PetscViewerFileGetName\n\n \nSource code at petsc4py/PETSc/Viewer.pyx:832"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_77getFileName(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getFileName (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getFileName", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getFileName", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_76getFileName(((struct PyPetscViewerObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_76getFileName(struct PyPetscViewerObject *__pyx_v_self) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getFileName", 1); /* "petsc4py/PETSc/Viewer.pyx":842 * * """ * cdef const char *cval = NULL # <<<<<<<<<<<<<< * CHKERR( PetscViewerFileGetName(self.vwr, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/Viewer.pyx":843 * """ * cdef const char *cval = NULL * CHKERR( PetscViewerFileGetName(self.vwr, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerFileGetName(__pyx_v_self->vwr, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 843, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":844 * cdef const char *cval = NULL * CHKERR( PetscViewerFileGetName(self.vwr, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * # --- methods specific to draw viewers --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(37, 844, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Viewer.pyx":832 * CHKERR( PetscViewerFileSetName(self.vwr, cval) ) * * def getFileName(self) -> str: # <<<<<<<<<<<<<< * """Return file name. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Viewer.getFileName", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Viewer.pyx":848 * # --- methods specific to draw viewers --- * * def setDrawInfo( # <<<<<<<<<<<<<< * self, * display: str | None = None, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_79setDrawInfo(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Viewer_78setDrawInfo, "Viewer.setDrawInfo(self, display: str | None = None, title: str | None = None, position: tuple[int, int] | None = None, size: tuple[int, int] | int | None = None) -> None\nSet window information for a `Type.DRAW` viewer.\n\n Collective.\n\n Parameters\n ----------\n display\n The X display to use or `None` for the local machine.\n title\n The window title or `None` for no title.\n position\n Screen coordinates of the upper left corner, or `None` for default.\n size\n Window size or `None` for default.\n\n \nSource code at petsc4py/PETSc/Viewer.pyx:848"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_79setDrawInfo(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_display = 0; PyObject *__pyx_v_title = 0; PyObject *__pyx_v_position = 0; PyObject *__pyx_v_size = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setDrawInfo (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_display,&__pyx_n_s_title,&__pyx_n_s_position,&__pyx_n_s_size,0}; /* "petsc4py/PETSc/Viewer.pyx":850 * def setDrawInfo( * self, * display: str | None = None, # <<<<<<<<<<<<<< * title: str | None = None, * position: tuple[int, int] | None = None, */ values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Viewer.pyx":851 * self, * display: str | None = None, * title: str | None = None, # <<<<<<<<<<<<<< * position: tuple[int, int] | None = None, * size: tuple[int, int] | int | None = None, */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Viewer.pyx":852 * display: str | None = None, * title: str | None = None, * position: tuple[int, int] | None = None, # <<<<<<<<<<<<<< * size: tuple[int, int] | int | None = None, * ) -> None: */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Viewer.pyx":853 * title: str | None = None, * position: tuple[int, int] | None = None, * size: tuple[int, int] | int | None = None, # <<<<<<<<<<<<<< * ) -> None: * """Set window information for a `Type.DRAW` viewer. */ values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_display); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(37, 848, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_title); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(37, 848, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_position); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(37, 848, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(37, 848, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setDrawInfo") < 0)) __PYX_ERR(37, 848, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_display = values[0]; __pyx_v_title = values[1]; __pyx_v_position = values[2]; __pyx_v_size = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setDrawInfo", 0, 0, 4, __pyx_nargs); __PYX_ERR(37, 848, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Viewer.setDrawInfo", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_78setDrawInfo(((struct PyPetscViewerObject *)__pyx_v_self), __pyx_v_display, __pyx_v_title, __pyx_v_position, __pyx_v_size); /* "petsc4py/PETSc/Viewer.pyx":848 * # --- methods specific to draw viewers --- * * def setDrawInfo( # <<<<<<<<<<<<<< * self, * display: str | None = None, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_78setDrawInfo(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_display, PyObject *__pyx_v_title, PyObject *__pyx_v_position, PyObject *__pyx_v_size) { char const *__pyx_v_cdisplay; char const *__pyx_v_ctitle; int __pyx_v_x; int __pyx_v_y; int __pyx_v_h; int __pyx_v_w; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *(*__pyx_t_6)(PyObject *); int __pyx_t_7; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PetscErrorCode __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setDrawInfo", 0); __Pyx_INCREF(__pyx_v_display); __Pyx_INCREF(__pyx_v_title); /* "petsc4py/PETSc/Viewer.pyx":875 * # -------- * # petsc.PetscViewerDrawSetInfo * cdef const char *cdisplay = NULL # <<<<<<<<<<<<<< * cdef const char *ctitle = NULL * display = str2bytes(display, &cdisplay) */ __pyx_v_cdisplay = NULL; /* "petsc4py/PETSc/Viewer.pyx":876 * # petsc.PetscViewerDrawSetInfo * cdef const char *cdisplay = NULL * cdef const char *ctitle = NULL # <<<<<<<<<<<<<< * display = str2bytes(display, &cdisplay) * title = str2bytes(title, &ctitle) */ __pyx_v_ctitle = NULL; /* "petsc4py/PETSc/Viewer.pyx":877 * cdef const char *cdisplay = NULL * cdef const char *ctitle = NULL * display = str2bytes(display, &cdisplay) # <<<<<<<<<<<<<< * title = str2bytes(title, &ctitle) * cdef int x, y, h, w */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_display, (&__pyx_v_cdisplay)); if (unlikely(!__pyx_t_1)) __PYX_ERR(37, 877, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_display, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Viewer.pyx":878 * cdef const char *ctitle = NULL * display = str2bytes(display, &cdisplay) * title = str2bytes(title, &ctitle) # <<<<<<<<<<<<<< * cdef int x, y, h, w * x = y = h = w = PETSC_DECIDE */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_title, (&__pyx_v_ctitle)); if (unlikely(!__pyx_t_1)) __PYX_ERR(37, 878, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_title, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Viewer.pyx":880 * title = str2bytes(title, &ctitle) * cdef int x, y, h, w * x = y = h = w = PETSC_DECIDE # <<<<<<<<<<<<<< * if position not in (None, PETSC_DECIDE): * x, y = position */ __pyx_v_x = PETSC_DECIDE; __pyx_v_y = PETSC_DECIDE; __pyx_v_h = PETSC_DECIDE; __pyx_v_w = PETSC_DECIDE; /* "petsc4py/PETSc/Viewer.pyx":881 * cdef int x, y, h, w * x = y = h = w = PETSC_DECIDE * if position not in (None, PETSC_DECIDE): # <<<<<<<<<<<<<< * x, y = position * if size not in (None, PETSC_DECIDE): */ __Pyx_INCREF(__pyx_v_position); __pyx_t_1 = __pyx_v_position; __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, Py_None, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(37, 881, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(37, 881, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = __Pyx_PyInt_From___pyx_anon_enum(PETSC_DECIDE); if (unlikely(!__pyx_t_3)) __PYX_ERR(37, 881, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(37, 881, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(37, 881, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __pyx_t_4; __pyx_L4_bool_binop_done:; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_4 = __pyx_t_2; if (__pyx_t_4) { /* "petsc4py/PETSc/Viewer.pyx":882 * x = y = h = w = PETSC_DECIDE * if position not in (None, PETSC_DECIDE): * x, y = position # <<<<<<<<<<<<<< * if size not in (None, PETSC_DECIDE): * try: */ if ((likely(PyTuple_CheckExact(__pyx_v_position))) || (PyList_CheckExact(__pyx_v_position))) { PyObject* sequence = __pyx_v_position; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(37, 882, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(37, 882, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(37, 882, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_position); if (unlikely(!__pyx_t_3)) __PYX_ERR(37, 882, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); index = 0; __pyx_t_1 = __pyx_t_6(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_5 = __pyx_t_6(__pyx_t_3); if (unlikely(!__pyx_t_5)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_3), 2) < 0) __PYX_ERR(37, 882, __pyx_L1_error) __pyx_t_6 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L7_unpacking_done; __pyx_L6_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(37, 882, __pyx_L1_error) __pyx_L7_unpacking_done:; } __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(37, 882, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(37, 882, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_x = __pyx_t_7; __pyx_v_y = __pyx_t_8; /* "petsc4py/PETSc/Viewer.pyx":881 * cdef int x, y, h, w * x = y = h = w = PETSC_DECIDE * if position not in (None, PETSC_DECIDE): # <<<<<<<<<<<<<< * x, y = position * if size not in (None, PETSC_DECIDE): */ } /* "petsc4py/PETSc/Viewer.pyx":883 * if position not in (None, PETSC_DECIDE): * x, y = position * if size not in (None, PETSC_DECIDE): # <<<<<<<<<<<<<< * try: * w, h = size */ __Pyx_INCREF(__pyx_v_size); __pyx_t_5 = __pyx_v_size; __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, Py_None, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(37, 883, __pyx_L1_error) __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(37, 883, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { } else { __pyx_t_4 = __pyx_t_2; goto __pyx_L9_bool_binop_done; } __pyx_t_1 = __Pyx_PyInt_From___pyx_anon_enum(PETSC_DECIDE); if (unlikely(!__pyx_t_1)) __PYX_ERR(37, 883, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(37, 883, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(37, 883, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = __pyx_t_2; __pyx_L9_bool_binop_done:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __pyx_t_4; if (__pyx_t_2) { /* "petsc4py/PETSc/Viewer.pyx":884 * x, y = position * if size not in (None, PETSC_DECIDE): * try: # <<<<<<<<<<<<<< * w, h = size * except TypeError: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); /*try:*/ { /* "petsc4py/PETSc/Viewer.pyx":885 * if size not in (None, PETSC_DECIDE): * try: * w, h = size # <<<<<<<<<<<<<< * except TypeError: * w = h = size */ if ((likely(PyTuple_CheckExact(__pyx_v_size))) || (PyList_CheckExact(__pyx_v_size))) { PyObject* sequence = __pyx_v_size; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(37, 885, __pyx_L11_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); #else __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(37, 885, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(37, 885, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { Py_ssize_t index = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(37, 885, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); index = 0; __pyx_t_5 = __pyx_t_6(__pyx_t_1); if (unlikely(!__pyx_t_5)) goto __pyx_L17_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_1); if (unlikely(!__pyx_t_3)) goto __pyx_L17_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_1), 2) < 0) __PYX_ERR(37, 885, __pyx_L11_error) __pyx_t_6 = NULL; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L18_unpacking_done; __pyx_L17_unpacking_failed:; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(37, 885, __pyx_L11_error) __pyx_L18_unpacking_done:; } __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(37, 885, __pyx_L11_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(37, 885, __pyx_L11_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_w = __pyx_t_8; __pyx_v_h = __pyx_t_7; /* "petsc4py/PETSc/Viewer.pyx":884 * x, y = position * if size not in (None, PETSC_DECIDE): * try: # <<<<<<<<<<<<<< * w, h = size * except TypeError: */ } __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; goto __pyx_L16_try_end; __pyx_L11_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/Viewer.pyx":886 * try: * w, h = size * except TypeError: # <<<<<<<<<<<<<< * w = h = size * CHKERR( PetscViewerDrawSetInfo(self.vwr, */ __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError); if (__pyx_t_7) { __Pyx_AddTraceback("petsc4py.PETSc.Viewer.setDrawInfo", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(37, 886, __pyx_L13_except_error) __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_1); /* "petsc4py/PETSc/Viewer.pyx":887 * w, h = size * except TypeError: * w = h = size # <<<<<<<<<<<<<< * CHKERR( PetscViewerDrawSetInfo(self.vwr, * cdisplay, ctitle, */ __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_size); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(37, 887, __pyx_L13_except_error) __pyx_v_w = __pyx_t_7; __pyx_v_h = __pyx_t_7; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L12_exception_handled; } goto __pyx_L13_except_error; /* "petsc4py/PETSc/Viewer.pyx":884 * x, y = position * if size not in (None, PETSC_DECIDE): * try: # <<<<<<<<<<<<<< * w, h = size * except TypeError: */ __pyx_L13_except_error:; __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); goto __pyx_L1_error; __pyx_L12_exception_handled:; __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); __pyx_L16_try_end:; } /* "petsc4py/PETSc/Viewer.pyx":883 * if position not in (None, PETSC_DECIDE): * x, y = position * if size not in (None, PETSC_DECIDE): # <<<<<<<<<<<<<< * try: * w, h = size */ } /* "petsc4py/PETSc/Viewer.pyx":888 * except TypeError: * w = h = size * CHKERR( PetscViewerDrawSetInfo(self.vwr, # <<<<<<<<<<<<<< * cdisplay, ctitle, * x, y, w, h) ) */ __pyx_t_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerDrawSetInfo(__pyx_v_self->vwr, __pyx_v_cdisplay, __pyx_v_ctitle, __pyx_v_x, __pyx_v_y, __pyx_v_w, __pyx_v_h)); if (unlikely(__pyx_t_12 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 888, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":848 * # --- methods specific to draw viewers --- * * def setDrawInfo( # <<<<<<<<<<<<<< * self, * display: str | None = None, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.Viewer.setDrawInfo", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_display); __Pyx_XDECREF(__pyx_v_title); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Viewer.pyx":892 * x, y, w, h) ) * * def clearDraw(self) -> None: # <<<<<<<<<<<<<< * """Reset graphics. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_81clearDraw(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Viewer_80clearDraw, "Viewer.clearDraw(self) -> None\nReset graphics.\n\n Not collective.\n\n See Also\n --------\n petsc.PetscViewerDrawClear\n\n \nSource code at petsc4py/PETSc/Viewer.pyx:892"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_81clearDraw(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("clearDraw (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("clearDraw", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "clearDraw", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_80clearDraw(((struct PyPetscViewerObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_80clearDraw(struct PyPetscViewerObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("clearDraw", 1); /* "petsc4py/PETSc/Viewer.pyx":902 * * """ * CHKERR( PetscViewerDrawClear(self.vwr) ) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerDrawClear(__pyx_v_self->vwr)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 902, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":892 * x, y, w, h) ) * * def clearDraw(self) -> None: # <<<<<<<<<<<<<< * """Reset graphics. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Viewer.clearDraw", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Viewer.pyx":908 * cdef class ViewerHDF5(Viewer): * * def create(self, name, mode=None, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef const char *cname = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_1create(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_10ViewerHDF5_create, "ViewerHDF5.create(self, name, mode=None, comm=None)\nSource code at petsc4py/PETSc/Viewer.pyx:908"); static PyObject *__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_1create(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_name = 0; PyObject *__pyx_v_mode = 0; PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_mode,&__pyx_n_s_comm,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(37, 908, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mode); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(37, 908, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(37, 908, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "create") < 0)) __PYX_ERR(37, 908, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_name = values[0]; __pyx_v_mode = values[1]; __pyx_v_comm = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("create", 0, 1, 3, __pyx_nargs); __PYX_ERR(37, 908, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.ViewerHDF5.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_10ViewerHDF5_create(((struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *)__pyx_v_self), __pyx_v_name, __pyx_v_mode, __pyx_v_comm); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_10ViewerHDF5_create(struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_mode, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; char const *__pyx_v_cname; PetscFileMode __pyx_v_cmode; PetscViewer __pyx_v_newvwr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscFileMode __pyx_t_3; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create", 0); __Pyx_INCREF(__pyx_v_name); /* "petsc4py/PETSc/Viewer.pyx":909 * * def create(self, name, mode=None, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef const char *cname = NULL * name = str2bytes(name, &cname) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(37, 909, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/Viewer.pyx":910 * def create(self, name, mode=None, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef const char *cname = NULL # <<<<<<<<<<<<<< * name = str2bytes(name, &cname) * cdef PetscFileMode cmode = filemode(mode) */ __pyx_v_cname = NULL; /* "petsc4py/PETSc/Viewer.pyx":911 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef const char *cname = NULL * name = str2bytes(name, &cname) # <<<<<<<<<<<<<< * cdef PetscFileMode cmode = filemode(mode) * cdef PetscViewer newvwr = NULL */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cname)); if (unlikely(!__pyx_t_2)) __PYX_ERR(37, 911, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/Viewer.pyx":912 * cdef const char *cname = NULL * name = str2bytes(name, &cname) * cdef PetscFileMode cmode = filemode(mode) # <<<<<<<<<<<<<< * cdef PetscViewer newvwr = NULL * CHKERR( PetscViewerCreate(ccomm, &newvwr) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_filemode(__pyx_v_mode); if (unlikely(__pyx_t_3 == ((PetscFileMode)((PetscFileMode)-1L)))) __PYX_ERR(37, 912, __pyx_L1_error) __pyx_v_cmode = __pyx_t_3; /* "petsc4py/PETSc/Viewer.pyx":913 * name = str2bytes(name, &cname) * cdef PetscFileMode cmode = filemode(mode) * cdef PetscViewer newvwr = NULL # <<<<<<<<<<<<<< * CHKERR( PetscViewerCreate(ccomm, &newvwr) ) * CHKERR( PetscCLEAR(self.obj) ); self.vwr = newvwr */ __pyx_v_newvwr = NULL; /* "petsc4py/PETSc/Viewer.pyx":914 * cdef PetscFileMode cmode = filemode(mode) * cdef PetscViewer newvwr = NULL * CHKERR( PetscViewerCreate(ccomm, &newvwr) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.vwr = newvwr * CHKERR( PetscViewerSetType(self.vwr, PETSCVIEWERHDF5) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerCreate(__pyx_v_ccomm, (&__pyx_v_newvwr))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 914, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":915 * cdef PetscViewer newvwr = NULL * CHKERR( PetscViewerCreate(ccomm, &newvwr) ) * CHKERR( PetscCLEAR(self.obj) ); self.vwr = newvwr # <<<<<<<<<<<<<< * CHKERR( PetscViewerSetType(self.vwr, PETSCVIEWERHDF5) ) * CHKERR( PetscViewerFileSetMode(self.vwr, cmode) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 915, __pyx_L1_error) __pyx_v_self->__pyx_base.vwr = __pyx_v_newvwr; /* "petsc4py/PETSc/Viewer.pyx":916 * CHKERR( PetscViewerCreate(ccomm, &newvwr) ) * CHKERR( PetscCLEAR(self.obj) ); self.vwr = newvwr * CHKERR( PetscViewerSetType(self.vwr, PETSCVIEWERHDF5) ) # <<<<<<<<<<<<<< * CHKERR( PetscViewerFileSetMode(self.vwr, cmode) ) * CHKERR( PetscViewerFileSetName(self.vwr, cname) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerSetType(__pyx_v_self->__pyx_base.vwr, PETSCVIEWERHDF5)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 916, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":917 * CHKERR( PetscCLEAR(self.obj) ); self.vwr = newvwr * CHKERR( PetscViewerSetType(self.vwr, PETSCVIEWERHDF5) ) * CHKERR( PetscViewerFileSetMode(self.vwr, cmode) ) # <<<<<<<<<<<<<< * CHKERR( PetscViewerFileSetName(self.vwr, cname) ) * return self */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerFileSetMode(__pyx_v_self->__pyx_base.vwr, __pyx_v_cmode)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 917, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":918 * CHKERR( PetscViewerSetType(self.vwr, PETSCVIEWERHDF5) ) * CHKERR( PetscViewerFileSetMode(self.vwr, cmode) ) * CHKERR( PetscViewerFileSetName(self.vwr, cname) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerFileSetName(__pyx_v_self->__pyx_base.vwr, __pyx_v_cname)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 918, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":919 * CHKERR( PetscViewerFileSetMode(self.vwr, cmode) ) * CHKERR( PetscViewerFileSetName(self.vwr, cname) ) * return self # <<<<<<<<<<<<<< * * def pushTimestepping(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Viewer.pyx":908 * cdef class ViewerHDF5(Viewer): * * def create(self, name, mode=None, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef const char *cname = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.ViewerHDF5.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Viewer.pyx":921 * return self * * def pushTimestepping(self): # <<<<<<<<<<<<<< * CHKERR( PetscViewerHDF5PushTimestepping(self.vwr) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_3pushTimestepping(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_10ViewerHDF5_2pushTimestepping, "ViewerHDF5.pushTimestepping(self)\nSource code at petsc4py/PETSc/Viewer.pyx:921"); static PyObject *__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_3pushTimestepping(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pushTimestepping (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("pushTimestepping", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "pushTimestepping", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_10ViewerHDF5_2pushTimestepping(((struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_10ViewerHDF5_2pushTimestepping(struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pushTimestepping", 1); /* "petsc4py/PETSc/Viewer.pyx":922 * * def pushTimestepping(self): * CHKERR( PetscViewerHDF5PushTimestepping(self.vwr) ) # <<<<<<<<<<<<<< * * def popTimestepping(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerHDF5PushTimestepping(__pyx_v_self->__pyx_base.vwr)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 922, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":921 * return self * * def pushTimestepping(self): # <<<<<<<<<<<<<< * CHKERR( PetscViewerHDF5PushTimestepping(self.vwr) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.ViewerHDF5.pushTimestepping", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Viewer.pyx":924 * CHKERR( PetscViewerHDF5PushTimestepping(self.vwr) ) * * def popTimestepping(self): # <<<<<<<<<<<<<< * CHKERR( PetscViewerHDF5PopTimestepping(self.vwr) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_5popTimestepping(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_10ViewerHDF5_4popTimestepping, "ViewerHDF5.popTimestepping(self)\nSource code at petsc4py/PETSc/Viewer.pyx:924"); static PyObject *__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_5popTimestepping(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("popTimestepping (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("popTimestepping", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "popTimestepping", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_10ViewerHDF5_4popTimestepping(((struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_10ViewerHDF5_4popTimestepping(struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("popTimestepping", 1); /* "petsc4py/PETSc/Viewer.pyx":925 * * def popTimestepping(self): * CHKERR( PetscViewerHDF5PopTimestepping(self.vwr) ) # <<<<<<<<<<<<<< * * def getTimestep(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerHDF5PopTimestepping(__pyx_v_self->__pyx_base.vwr)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 925, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":924 * CHKERR( PetscViewerHDF5PushTimestepping(self.vwr) ) * * def popTimestepping(self): # <<<<<<<<<<<<<< * CHKERR( PetscViewerHDF5PopTimestepping(self.vwr) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.ViewerHDF5.popTimestepping", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Viewer.pyx":927 * CHKERR( PetscViewerHDF5PopTimestepping(self.vwr) ) * * def getTimestep(self): # <<<<<<<<<<<<<< * cdef PetscInt ctimestep = 0 * CHKERR( PetscViewerHDF5GetTimestep(self.vwr, &ctimestep) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_7getTimestep(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_10ViewerHDF5_6getTimestep, "ViewerHDF5.getTimestep(self)\nSource code at petsc4py/PETSc/Viewer.pyx:927"); static PyObject *__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_7getTimestep(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getTimestep (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getTimestep", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getTimestep", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_10ViewerHDF5_6getTimestep(((struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_10ViewerHDF5_6getTimestep(struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *__pyx_v_self) { PetscInt __pyx_v_ctimestep; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getTimestep", 1); /* "petsc4py/PETSc/Viewer.pyx":928 * * def getTimestep(self): * cdef PetscInt ctimestep = 0 # <<<<<<<<<<<<<< * CHKERR( PetscViewerHDF5GetTimestep(self.vwr, &ctimestep) ) * return toInt(ctimestep) */ __pyx_v_ctimestep = 0; /* "petsc4py/PETSc/Viewer.pyx":929 * def getTimestep(self): * cdef PetscInt ctimestep = 0 * CHKERR( PetscViewerHDF5GetTimestep(self.vwr, &ctimestep) ) # <<<<<<<<<<<<<< * return toInt(ctimestep) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerHDF5GetTimestep(__pyx_v_self->__pyx_base.vwr, (&__pyx_v_ctimestep))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 929, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":930 * cdef PetscInt ctimestep = 0 * CHKERR( PetscViewerHDF5GetTimestep(self.vwr, &ctimestep) ) * return toInt(ctimestep) # <<<<<<<<<<<<<< * * def setTimestep(self, timestep): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ctimestep); if (unlikely(!__pyx_t_2)) __PYX_ERR(37, 930, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Viewer.pyx":927 * CHKERR( PetscViewerHDF5PopTimestepping(self.vwr) ) * * def getTimestep(self): # <<<<<<<<<<<<<< * cdef PetscInt ctimestep = 0 * CHKERR( PetscViewerHDF5GetTimestep(self.vwr, &ctimestep) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.ViewerHDF5.getTimestep", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Viewer.pyx":932 * return toInt(ctimestep) * * def setTimestep(self, timestep): # <<<<<<<<<<<<<< * CHKERR( PetscViewerHDF5SetTimestep(self.vwr, asInt(timestep)) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_9setTimestep(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_10ViewerHDF5_8setTimestep, "ViewerHDF5.setTimestep(self, timestep)\nSource code at petsc4py/PETSc/Viewer.pyx:932"); static PyObject *__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_9setTimestep(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_timestep = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setTimestep (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_timestep,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_timestep)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(37, 932, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setTimestep") < 0)) __PYX_ERR(37, 932, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_timestep = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setTimestep", 1, 1, 1, __pyx_nargs); __PYX_ERR(37, 932, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.ViewerHDF5.setTimestep", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_10ViewerHDF5_8setTimestep(((struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *)__pyx_v_self), __pyx_v_timestep); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_10ViewerHDF5_8setTimestep(struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *__pyx_v_self, PyObject *__pyx_v_timestep) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setTimestep", 1); /* "petsc4py/PETSc/Viewer.pyx":933 * * def setTimestep(self, timestep): * CHKERR( PetscViewerHDF5SetTimestep(self.vwr, asInt(timestep)) ) # <<<<<<<<<<<<<< * * def incrementTimestep(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_timestep); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(37, 933, __pyx_L1_error) __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerHDF5SetTimestep(__pyx_v_self->__pyx_base.vwr, __pyx_t_1)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 933, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":932 * return toInt(ctimestep) * * def setTimestep(self, timestep): # <<<<<<<<<<<<<< * CHKERR( PetscViewerHDF5SetTimestep(self.vwr, asInt(timestep)) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.ViewerHDF5.setTimestep", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Viewer.pyx":935 * CHKERR( PetscViewerHDF5SetTimestep(self.vwr, asInt(timestep)) ) * * def incrementTimestep(self): # <<<<<<<<<<<<<< * CHKERR( PetscViewerHDF5IncrementTimestep(self.vwr) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_11incrementTimestep(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_10ViewerHDF5_10incrementTimestep, "ViewerHDF5.incrementTimestep(self)\nSource code at petsc4py/PETSc/Viewer.pyx:935"); static PyObject *__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_11incrementTimestep(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("incrementTimestep (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("incrementTimestep", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "incrementTimestep", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_10ViewerHDF5_10incrementTimestep(((struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_10ViewerHDF5_10incrementTimestep(struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("incrementTimestep", 1); /* "petsc4py/PETSc/Viewer.pyx":936 * * def incrementTimestep(self): * CHKERR( PetscViewerHDF5IncrementTimestep(self.vwr) ) # <<<<<<<<<<<<<< * * def pushGroup(self, group): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerHDF5IncrementTimestep(__pyx_v_self->__pyx_base.vwr)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 936, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":935 * CHKERR( PetscViewerHDF5SetTimestep(self.vwr, asInt(timestep)) ) * * def incrementTimestep(self): # <<<<<<<<<<<<<< * CHKERR( PetscViewerHDF5IncrementTimestep(self.vwr) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.ViewerHDF5.incrementTimestep", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Viewer.pyx":938 * CHKERR( PetscViewerHDF5IncrementTimestep(self.vwr) ) * * def pushGroup(self, group): # <<<<<<<<<<<<<< * cdef const char *cgroup = NULL * group = str2bytes(group, &cgroup) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_13pushGroup(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_10ViewerHDF5_12pushGroup, "ViewerHDF5.pushGroup(self, group)\nSource code at petsc4py/PETSc/Viewer.pyx:938"); static PyObject *__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_13pushGroup(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_group = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pushGroup (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_group,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_group)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(37, 938, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "pushGroup") < 0)) __PYX_ERR(37, 938, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_group = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("pushGroup", 1, 1, 1, __pyx_nargs); __PYX_ERR(37, 938, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.ViewerHDF5.pushGroup", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_10ViewerHDF5_12pushGroup(((struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *)__pyx_v_self), __pyx_v_group); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_10ViewerHDF5_12pushGroup(struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *__pyx_v_self, PyObject *__pyx_v_group) { char const *__pyx_v_cgroup; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pushGroup", 0); __Pyx_INCREF(__pyx_v_group); /* "petsc4py/PETSc/Viewer.pyx":939 * * def pushGroup(self, group): * cdef const char *cgroup = NULL # <<<<<<<<<<<<<< * group = str2bytes(group, &cgroup) * CHKERR( PetscViewerHDF5PushGroup(self.vwr, cgroup) ) */ __pyx_v_cgroup = NULL; /* "petsc4py/PETSc/Viewer.pyx":940 * def pushGroup(self, group): * cdef const char *cgroup = NULL * group = str2bytes(group, &cgroup) # <<<<<<<<<<<<<< * CHKERR( PetscViewerHDF5PushGroup(self.vwr, cgroup) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_group, (&__pyx_v_cgroup)); if (unlikely(!__pyx_t_1)) __PYX_ERR(37, 940, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_group, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Viewer.pyx":941 * cdef const char *cgroup = NULL * group = str2bytes(group, &cgroup) * CHKERR( PetscViewerHDF5PushGroup(self.vwr, cgroup) ) # <<<<<<<<<<<<<< * * def popGroup(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerHDF5PushGroup(__pyx_v_self->__pyx_base.vwr, __pyx_v_cgroup)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 941, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":938 * CHKERR( PetscViewerHDF5IncrementTimestep(self.vwr) ) * * def pushGroup(self, group): # <<<<<<<<<<<<<< * cdef const char *cgroup = NULL * group = str2bytes(group, &cgroup) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.ViewerHDF5.pushGroup", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_group); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Viewer.pyx":943 * CHKERR( PetscViewerHDF5PushGroup(self.vwr, cgroup) ) * * def popGroup(self): # <<<<<<<<<<<<<< * CHKERR( PetscViewerHDF5PopGroup(self.vwr) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_15popGroup(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_10ViewerHDF5_14popGroup, "ViewerHDF5.popGroup(self)\nSource code at petsc4py/PETSc/Viewer.pyx:943"); static PyObject *__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_15popGroup(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("popGroup (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("popGroup", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "popGroup", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_10ViewerHDF5_14popGroup(((struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_10ViewerHDF5_14popGroup(struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("popGroup", 1); /* "petsc4py/PETSc/Viewer.pyx":944 * * def popGroup(self): * CHKERR( PetscViewerHDF5PopGroup(self.vwr) ) # <<<<<<<<<<<<<< * * def getGroup(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerHDF5PopGroup(__pyx_v_self->__pyx_base.vwr)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 944, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":943 * CHKERR( PetscViewerHDF5PushGroup(self.vwr, cgroup) ) * * def popGroup(self): # <<<<<<<<<<<<<< * CHKERR( PetscViewerHDF5PopGroup(self.vwr) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.ViewerHDF5.popGroup", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Viewer.pyx":946 * CHKERR( PetscViewerHDF5PopGroup(self.vwr) ) * * def getGroup(self): # <<<<<<<<<<<<<< * cdef char *cgroup = NULL * CHKERR( PetscViewerHDF5GetGroup(self.vwr, NULL, &cgroup) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_17getGroup(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_10ViewerHDF5_16getGroup, "ViewerHDF5.getGroup(self)\nSource code at petsc4py/PETSc/Viewer.pyx:946"); static PyObject *__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_17getGroup(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getGroup (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getGroup", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getGroup", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_10ViewerHDF5_16getGroup(((struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_10ViewerHDF5_16getGroup(struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *__pyx_v_self) { char *__pyx_v_cgroup; PyObject *__pyx_v_group = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getGroup", 1); /* "petsc4py/PETSc/Viewer.pyx":947 * * def getGroup(self): * cdef char *cgroup = NULL # <<<<<<<<<<<<<< * CHKERR( PetscViewerHDF5GetGroup(self.vwr, NULL, &cgroup) ) * group = bytes2str(cgroup) */ __pyx_v_cgroup = NULL; /* "petsc4py/PETSc/Viewer.pyx":948 * def getGroup(self): * cdef char *cgroup = NULL * CHKERR( PetscViewerHDF5GetGroup(self.vwr, NULL, &cgroup) ) # <<<<<<<<<<<<<< * group = bytes2str(cgroup) * CHKERR( PetscFree(cgroup) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerHDF5GetGroup(__pyx_v_self->__pyx_base.vwr, NULL, (&__pyx_v_cgroup))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 948, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":949 * cdef char *cgroup = NULL * CHKERR( PetscViewerHDF5GetGroup(self.vwr, NULL, &cgroup) ) * group = bytes2str(cgroup) # <<<<<<<<<<<<<< * CHKERR( PetscFree(cgroup) ) * return group */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cgroup); if (unlikely(!__pyx_t_2)) __PYX_ERR(37, 949, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_group = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/Viewer.pyx":950 * CHKERR( PetscViewerHDF5GetGroup(self.vwr, NULL, &cgroup) ) * group = bytes2str(cgroup) * CHKERR( PetscFree(cgroup) ) # <<<<<<<<<<<<<< * return group * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_cgroup)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 950, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":951 * group = bytes2str(cgroup) * CHKERR( PetscFree(cgroup) ) * return group # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_group); __pyx_r = __pyx_v_group; goto __pyx_L0; /* "petsc4py/PETSc/Viewer.pyx":946 * CHKERR( PetscViewerHDF5PopGroup(self.vwr) ) * * def getGroup(self): # <<<<<<<<<<<<<< * cdef char *cgroup = NULL * CHKERR( PetscViewerHDF5GetGroup(self.vwr, NULL, &cgroup) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.ViewerHDF5.getGroup", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_group); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Random.pyx":24 * Type = RandomType * * def __cinit__(self) -> None: # <<<<<<<<<<<<<< * self.obj = &self.rnd * self.rnd = NULL */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_6Random_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_6Random_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Random___cinit__(((struct PyPetscRandomObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_6Random___cinit__(struct PyPetscRandomObject *__pyx_v_self) { int __pyx_r; /* "petsc4py/PETSc/Random.pyx":25 * * def __cinit__(self) -> None: * self.obj = &self.rnd # <<<<<<<<<<<<<< * self.rnd = NULL * */ __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->rnd)); /* "petsc4py/PETSc/Random.pyx":26 * def __cinit__(self) -> None: * self.obj = &self.rnd * self.rnd = NULL # <<<<<<<<<<<<<< * * def __call__(self) -> Scalar: */ __pyx_v_self->rnd = NULL; /* "petsc4py/PETSc/Random.pyx":24 * Type = RandomType * * def __cinit__(self) -> None: # <<<<<<<<<<<<<< * self.obj = &self.rnd * self.rnd = NULL */ /* function exit code */ __pyx_r = 0; return __pyx_r; } /* "petsc4py/PETSc/Random.pyx":28 * self.rnd = NULL * * def __call__(self) -> Scalar: # <<<<<<<<<<<<<< * """Generate a scalar random number. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Random_2__call__, "Generate a scalar random number.\n\n Not collective.\n\n See Also\n --------\n petsc.PetscRandomGetValue\n\n "); #if CYTHON_UPDATE_DESCRIPTOR_DOC struct wrapperbase __pyx_wrapperbase_8petsc4py_5PETSc_6Random_2__call__; #endif static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__call__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__call__", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Random_2__call__(((struct PyPetscRandomObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_2__call__(struct PyPetscRandomObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 1); /* "petsc4py/PETSc/Random.pyx":38 * * """ * return self.getValue() # <<<<<<<<<<<<<< * * def view(self, Viewer viewer=None) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getValue); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Random.pyx":28 * self.rnd = NULL * * def __call__(self) -> Scalar: # <<<<<<<<<<<<<< * """Generate a scalar random number. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Random.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Random.pyx":40 * return self.getValue() * * def view(self, Viewer viewer=None) -> None: # <<<<<<<<<<<<<< * """View a random number generator object. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_5view(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Random_4view, "Random.view(self, viewer: Viewer | None = None) -> None\nView a random number generator object.\n\n Collective.\n\n Parameters\n ----------\n viewer\n A `Viewer` instance or `None` for the default viewer.\n\n See Also\n --------\n petsc.PetscRandomView\n\n \nSource code at petsc4py/PETSc/Random.pyx:40"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_5view(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscViewerObject *__pyx_v_viewer = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("view (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscViewerObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_viewer); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(38, 40, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "view") < 0)) __PYX_ERR(38, 40, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, __pyx_nargs); __PYX_ERR(38, 40, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Random.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(38, 40, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Random_4view(((struct PyPetscRandomObject *)__pyx_v_self), __pyx_v_viewer); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_4view(struct PyPetscRandomObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer) { PetscViewer __pyx_v_vwr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscViewer __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("view", 1); /* "petsc4py/PETSc/Random.pyx":55 * * """ * assert self.obj != NULL # <<<<<<<<<<<<<< * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_1 = (__pyx_v_self->__pyx_base.obj != NULL); if (unlikely(!__pyx_t_1)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(38, 55, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(38, 55, __pyx_L1_error) #endif /* "petsc4py/PETSc/Random.pyx":56 * """ * assert self.obj != NULL * cdef PetscViewer vwr = NULL # <<<<<<<<<<<<<< * if viewer is not None: vwr = viewer.vwr * CHKERR( PetscRandomView(self.rnd, vwr) ) */ __pyx_v_vwr = NULL; /* "petsc4py/PETSc/Random.pyx":57 * assert self.obj != NULL * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr # <<<<<<<<<<<<<< * CHKERR( PetscRandomView(self.rnd, vwr) ) * */ __pyx_t_1 = (((PyObject *)__pyx_v_viewer) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_viewer->vwr; __pyx_v_vwr = __pyx_t_2; } /* "petsc4py/PETSc/Random.pyx":58 * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr * CHKERR( PetscRandomView(self.rnd, vwr) ) # <<<<<<<<<<<<<< * * def destroy(self) -> Self: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscRandomView(__pyx_v_self->rnd, __pyx_v_vwr)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(38, 58, __pyx_L1_error) /* "petsc4py/PETSc/Random.pyx":40 * return self.getValue() * * def view(self, Viewer viewer=None) -> None: # <<<<<<<<<<<<<< * """View a random number generator object. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Random.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Random.pyx":60 * CHKERR( PetscRandomView(self.rnd, vwr) ) * * def destroy(self) -> Self: # <<<<<<<<<<<<<< * """Destroy the random number generator object. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_7destroy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Random_6destroy, "Random.destroy(self) -> Self\nDestroy the random number generator object.\n\n Collective.\n\n See Also\n --------\n petsc.PetscRandomDestroy\n\n \nSource code at petsc4py/PETSc/Random.pyx:60"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_7destroy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("destroy (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Random_6destroy(((struct PyPetscRandomObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_6destroy(struct PyPetscRandomObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("destroy", 1); /* "petsc4py/PETSc/Random.pyx":70 * * """ * CHKERR( PetscRandomDestroy(&self.rnd) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscRandomDestroy((&__pyx_v_self->rnd))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(38, 70, __pyx_L1_error) /* "petsc4py/PETSc/Random.pyx":71 * """ * CHKERR( PetscRandomDestroy(&self.rnd) ) * return self # <<<<<<<<<<<<<< * * def create(self, comm: Comm | None = None) -> Self: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Random.pyx":60 * CHKERR( PetscRandomView(self.rnd, vwr) ) * * def destroy(self) -> Self: # <<<<<<<<<<<<<< * """Destroy the random number generator object. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Random.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Random.pyx":73 * return self * * def create(self, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Create a random number generator object. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_9create(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Random_8create, "Random.create(self, comm: Comm | None = None) -> Self\nCreate a random number generator object.\n\n Collective.\n\n Parameters\n ----------\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n Sys.getDefaultComm, petsc.PetscRandomCreate\n\n \nSource code at petsc4py/PETSc/Random.pyx:73"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_9create(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(38, 73, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "create") < 0)) __PYX_ERR(38, 73, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_comm = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, __pyx_nargs); __PYX_ERR(38, 73, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Random.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Random_8create(((struct PyPetscRandomObject *)__pyx_v_self), __pyx_v_comm); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_8create(struct PyPetscRandomObject *__pyx_v_self, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create", 1); /* "petsc4py/PETSc/Random.pyx":88 * * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * CHKERR( PetscRandomCreate(ccomm, &self.rnd) ) * return self */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(38, 88, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/Random.pyx":89 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * CHKERR( PetscRandomCreate(ccomm, &self.rnd) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscRandomCreate(__pyx_v_ccomm, (&__pyx_v_self->rnd))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(38, 89, __pyx_L1_error) /* "petsc4py/PETSc/Random.pyx":90 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * CHKERR( PetscRandomCreate(ccomm, &self.rnd) ) * return self # <<<<<<<<<<<<<< * * def setType(self, rnd_type: Random.Type | str) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Random.pyx":73 * return self * * def create(self, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Create a random number generator object. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Random.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Random.pyx":92 * return self * * def setType(self, rnd_type: Random.Type | str) -> None: # <<<<<<<<<<<<<< * """Set the type of the random number generator object. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_11setType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Random_10setType, "Random.setType(self, rnd_type: Random.Type | str) -> None\nSet the type of the random number generator object.\n\n Collective.\n\n Parameters\n ----------\n rnd_type\n The type of the generator.\n\n See Also\n --------\n getType, petsc.PetscRandomSetType\n\n \nSource code at petsc4py/PETSc/Random.pyx:92"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_11setType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_rnd_type = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rnd_type,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(38, 92, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setType") < 0)) __PYX_ERR(38, 92, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_rnd_type = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, __pyx_nargs); __PYX_ERR(38, 92, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Random.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Random_10setType(((struct PyPetscRandomObject *)__pyx_v_self), __pyx_v_rnd_type); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_10setType(struct PyPetscRandomObject *__pyx_v_self, PyObject *__pyx_v_rnd_type) { PetscRandomType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setType", 0); __Pyx_INCREF(__pyx_v_rnd_type); /* "petsc4py/PETSc/Random.pyx":107 * * """ * cdef PetscRandomType cval = NULL # <<<<<<<<<<<<<< * rnd_type = str2bytes(rnd_type, &cval) * CHKERR( PetscRandomSetType(self.rnd, cval) ) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/Random.pyx":108 * """ * cdef PetscRandomType cval = NULL * rnd_type = str2bytes(rnd_type, &cval) # <<<<<<<<<<<<<< * CHKERR( PetscRandomSetType(self.rnd, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_rnd_type, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_rnd_type, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Random.pyx":109 * cdef PetscRandomType cval = NULL * rnd_type = str2bytes(rnd_type, &cval) * CHKERR( PetscRandomSetType(self.rnd, cval) ) # <<<<<<<<<<<<<< * * def getType(self) -> str: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscRandomSetType(__pyx_v_self->rnd, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(38, 109, __pyx_L1_error) /* "petsc4py/PETSc/Random.pyx":92 * return self * * def setType(self, rnd_type: Random.Type | str) -> None: # <<<<<<<<<<<<<< * """Set the type of the random number generator object. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Random.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rnd_type); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Random.pyx":111 * CHKERR( PetscRandomSetType(self.rnd, cval) ) * * def getType(self) -> str: # <<<<<<<<<<<<<< * """Return the type of the random number generator object. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_13getType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Random_12getType, "Random.getType(self) -> str\nReturn the type of the random number generator object.\n\n Not collective.\n\n See Also\n --------\n setType, petsc.PetscRandomGetType\n\n \nSource code at petsc4py/PETSc/Random.pyx:111"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_13getType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getType", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Random_12getType(((struct PyPetscRandomObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_12getType(struct PyPetscRandomObject *__pyx_v_self) { PetscRandomType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getType", 1); /* "petsc4py/PETSc/Random.pyx":121 * * """ * cdef PetscRandomType cval = NULL # <<<<<<<<<<<<<< * CHKERR( PetscRandomGetType(self.rnd, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/Random.pyx":122 * """ * cdef PetscRandomType cval = NULL * CHKERR( PetscRandomGetType(self.rnd, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscRandomGetType(__pyx_v_self->rnd, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(38, 122, __pyx_L1_error) /* "petsc4py/PETSc/Random.pyx":123 * cdef PetscRandomType cval = NULL * CHKERR( PetscRandomGetType(self.rnd, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * def setFromOptions(self) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Random.pyx":111 * CHKERR( PetscRandomSetType(self.rnd, cval) ) * * def getType(self) -> str: # <<<<<<<<<<<<<< * """Return the type of the random number generator object. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Random.getType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Random.pyx":125 * return bytes2str(cval) * * def setFromOptions(self) -> None: # <<<<<<<<<<<<<< * """Configure the random number generator from the options database. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_15setFromOptions(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Random_14setFromOptions, "Random.setFromOptions(self) -> None\nConfigure the random number generator from the options database.\n\n Collective.\n\n See Also\n --------\n petsc_options, petsc.PetscRandomSetFromOptions\n\n \nSource code at petsc4py/PETSc/Random.pyx:125"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_15setFromOptions(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFromOptions (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("setFromOptions", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setFromOptions", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Random_14setFromOptions(((struct PyPetscRandomObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_14setFromOptions(struct PyPetscRandomObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFromOptions", 1); /* "petsc4py/PETSc/Random.pyx":135 * * """ * CHKERR( PetscRandomSetFromOptions(self.rnd) ) # <<<<<<<<<<<<<< * * def getValue(self) -> Scalar: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscRandomSetFromOptions(__pyx_v_self->rnd)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(38, 135, __pyx_L1_error) /* "petsc4py/PETSc/Random.pyx":125 * return bytes2str(cval) * * def setFromOptions(self) -> None: # <<<<<<<<<<<<<< * """Configure the random number generator from the options database. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Random.setFromOptions", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Random.pyx":137 * CHKERR( PetscRandomSetFromOptions(self.rnd) ) * * def getValue(self) -> Scalar: # <<<<<<<<<<<<<< * """Generate a scalar random number. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_17getValue(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Random_16getValue, "Random.getValue(self) -> Scalar\nGenerate a scalar random number.\n\n Not collective.\n\n See Also\n --------\n petsc.PetscRandomGetValue\n\n \nSource code at petsc4py/PETSc/Random.pyx:137"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_17getValue(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getValue (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getValue", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getValue", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Random_16getValue(((struct PyPetscRandomObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_16getValue(struct PyPetscRandomObject *__pyx_v_self) { PetscScalar __pyx_v_sval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getValue", 1); /* "petsc4py/PETSc/Random.pyx":147 * * """ * cdef PetscScalar sval = 0 # <<<<<<<<<<<<<< * CHKERR( PetscRandomGetValue(self.rnd, &sval) ) * return toScalar(sval) */ __pyx_v_sval = 0.0; /* "petsc4py/PETSc/Random.pyx":148 * """ * cdef PetscScalar sval = 0 * CHKERR( PetscRandomGetValue(self.rnd, &sval) ) # <<<<<<<<<<<<<< * return toScalar(sval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscRandomGetValue(__pyx_v_self->rnd, (&__pyx_v_sval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(38, 148, __pyx_L1_error) /* "petsc4py/PETSc/Random.pyx":149 * cdef PetscScalar sval = 0 * CHKERR( PetscRandomGetValue(self.rnd, &sval) ) * return toScalar(sval) # <<<<<<<<<<<<<< * * def getValueReal(self) -> float: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toScalar(__pyx_v_sval); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Random.pyx":137 * CHKERR( PetscRandomSetFromOptions(self.rnd) ) * * def getValue(self) -> Scalar: # <<<<<<<<<<<<<< * """Generate a scalar random number. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Random.getValue", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Random.pyx":151 * return toScalar(sval) * * def getValueReal(self) -> float: # <<<<<<<<<<<<<< * """Generate a real random number. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_19getValueReal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Random_18getValueReal, "Random.getValueReal(self) -> float\nGenerate a real random number.\n\n Not collective.\n\n See Also\n --------\n petsc.PetscRandomGetValueReal\n\n \nSource code at petsc4py/PETSc/Random.pyx:151"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_19getValueReal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getValueReal (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getValueReal", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getValueReal", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Random_18getValueReal(((struct PyPetscRandomObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_18getValueReal(struct PyPetscRandomObject *__pyx_v_self) { PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getValueReal", 1); /* "petsc4py/PETSc/Random.pyx":161 * * """ * cdef PetscReal rval = 0 # <<<<<<<<<<<<<< * CHKERR( PetscRandomGetValueReal(self.rnd, &rval) ) * return toReal(rval) */ __pyx_v_rval = 0.0; /* "petsc4py/PETSc/Random.pyx":162 * """ * cdef PetscReal rval = 0 * CHKERR( PetscRandomGetValueReal(self.rnd, &rval) ) # <<<<<<<<<<<<<< * return toReal(rval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscRandomGetValueReal(__pyx_v_self->rnd, (&__pyx_v_rval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(38, 162, __pyx_L1_error) /* "petsc4py/PETSc/Random.pyx":163 * cdef PetscReal rval = 0 * CHKERR( PetscRandomGetValueReal(self.rnd, &rval) ) * return toReal(rval) # <<<<<<<<<<<<<< * * def getSeed(self) -> int: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_rval); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Random.pyx":151 * return toScalar(sval) * * def getValueReal(self) -> float: # <<<<<<<<<<<<<< * """Generate a real random number. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Random.getValueReal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Random.pyx":165 * return toReal(rval) * * def getSeed(self) -> int: # <<<<<<<<<<<<<< * """Return the random number generator seed. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_21getSeed(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Random_20getSeed, "Random.getSeed(self) -> int\nReturn the random number generator seed.\n\n Not collective.\n\n See Also\n --------\n setSeed, petsc.PetscRandomGetSeed\n\n \nSource code at petsc4py/PETSc/Random.pyx:165"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_21getSeed(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSeed (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getSeed", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getSeed", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Random_20getSeed(((struct PyPetscRandomObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_20getSeed(struct PyPetscRandomObject *__pyx_v_self) { unsigned long __pyx_v_seed; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSeed", 1); /* "petsc4py/PETSc/Random.pyx":175 * * """ * cdef unsigned long seed = 0 # <<<<<<<<<<<<<< * CHKERR( PetscRandomGetSeed(self.rnd, &seed) ) * return seed */ __pyx_v_seed = 0; /* "petsc4py/PETSc/Random.pyx":176 * """ * cdef unsigned long seed = 0 * CHKERR( PetscRandomGetSeed(self.rnd, &seed) ) # <<<<<<<<<<<<<< * return seed * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscRandomGetSeed(__pyx_v_self->rnd, (&__pyx_v_seed))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(38, 176, __pyx_L1_error) /* "petsc4py/PETSc/Random.pyx":177 * cdef unsigned long seed = 0 * CHKERR( PetscRandomGetSeed(self.rnd, &seed) ) * return seed # <<<<<<<<<<<<<< * * def setSeed(self, seed: int | None = None) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_unsigned_long(__pyx_v_seed); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Random.pyx":165 * return toReal(rval) * * def getSeed(self) -> int: # <<<<<<<<<<<<<< * """Return the random number generator seed. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Random.getSeed", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Random.pyx":179 * return seed * * def setSeed(self, seed: int | None = None) -> None: # <<<<<<<<<<<<<< * """Set the seed of random number generator. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_23setSeed(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Random_22setSeed, "Random.setSeed(self, seed: int | None = None) -> None\nSet the seed of random number generator.\n\n Not collective.\n\n Parameters\n ----------\n seed\n The value for the seed. If `None`, it only seeds the generator.\n\n See Also\n --------\n getSeed, petsc.PetscRandomSetSeed, petsc.PetscRandomSeed\n\n \nSource code at petsc4py/PETSc/Random.pyx:179"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_23setSeed(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_seed = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setSeed (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_seed,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_seed); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(38, 179, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setSeed") < 0)) __PYX_ERR(38, 179, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_seed = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setSeed", 0, 0, 1, __pyx_nargs); __PYX_ERR(38, 179, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Random.setSeed", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Random_22setSeed(((struct PyPetscRandomObject *)__pyx_v_self), __pyx_v_seed); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_22setSeed(struct PyPetscRandomObject *__pyx_v_self, PyObject *__pyx_v_seed) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; unsigned long __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setSeed", 1); /* "petsc4py/PETSc/Random.pyx":194 * * """ * if seed is not None: # <<<<<<<<<<<<<< * CHKERR( PetscRandomSetSeed(self.rnd, seed) ) * CHKERR( PetscRandomSeed(self.rnd) ) */ __pyx_t_1 = (__pyx_v_seed != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/Random.pyx":195 * """ * if seed is not None: * CHKERR( PetscRandomSetSeed(self.rnd, seed) ) # <<<<<<<<<<<<<< * CHKERR( PetscRandomSeed(self.rnd) ) * */ __pyx_t_2 = __Pyx_PyInt_As_unsigned_long(__pyx_v_seed); if (unlikely((__pyx_t_2 == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(38, 195, __pyx_L1_error) __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscRandomSetSeed(__pyx_v_self->rnd, __pyx_t_2)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(38, 195, __pyx_L1_error) /* "petsc4py/PETSc/Random.pyx":194 * * """ * if seed is not None: # <<<<<<<<<<<<<< * CHKERR( PetscRandomSetSeed(self.rnd, seed) ) * CHKERR( PetscRandomSeed(self.rnd) ) */ } /* "petsc4py/PETSc/Random.pyx":196 * if seed is not None: * CHKERR( PetscRandomSetSeed(self.rnd, seed) ) * CHKERR( PetscRandomSeed(self.rnd) ) # <<<<<<<<<<<<<< * * def getInterval(self) -> tuple[Scalar, Scalar]: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscRandomSeed(__pyx_v_self->rnd)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(38, 196, __pyx_L1_error) /* "petsc4py/PETSc/Random.pyx":179 * return seed * * def setSeed(self, seed: int | None = None) -> None: # <<<<<<<<<<<<<< * """Set the seed of random number generator. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Random.setSeed", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Random.pyx":198 * CHKERR( PetscRandomSeed(self.rnd) ) * * def getInterval(self) -> tuple[Scalar, Scalar]: # <<<<<<<<<<<<<< * """Return the interval containing the random numbers generated. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_25getInterval(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Random_24getInterval, "Random.getInterval(self) -> tuple[Scalar, Scalar]\nReturn the interval containing the random numbers generated.\n\n Not collective.\n\n See Also\n --------\n setInterval, petsc.PetscRandomGetInterval\n\n \nSource code at petsc4py/PETSc/Random.pyx:198"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_25getInterval(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getInterval (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getInterval", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getInterval", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Random_24getInterval(((struct PyPetscRandomObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_24getInterval(struct PyPetscRandomObject *__pyx_v_self) { PetscScalar __pyx_v_sval1; PetscScalar __pyx_v_sval2; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getInterval", 1); /* "petsc4py/PETSc/Random.pyx":208 * * """ * cdef PetscScalar sval1 = 0 # <<<<<<<<<<<<<< * cdef PetscScalar sval2 = 1 * CHKERR( PetscRandomGetInterval(self.rnd, &sval1, &sval2) ) */ __pyx_v_sval1 = 0.0; /* "petsc4py/PETSc/Random.pyx":209 * """ * cdef PetscScalar sval1 = 0 * cdef PetscScalar sval2 = 1 # <<<<<<<<<<<<<< * CHKERR( PetscRandomGetInterval(self.rnd, &sval1, &sval2) ) * return (toScalar(sval1), toScalar(sval2)) */ __pyx_v_sval2 = 1.0; /* "petsc4py/PETSc/Random.pyx":210 * cdef PetscScalar sval1 = 0 * cdef PetscScalar sval2 = 1 * CHKERR( PetscRandomGetInterval(self.rnd, &sval1, &sval2) ) # <<<<<<<<<<<<<< * return (toScalar(sval1), toScalar(sval2)) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscRandomGetInterval(__pyx_v_self->rnd, (&__pyx_v_sval1), (&__pyx_v_sval2))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(38, 210, __pyx_L1_error) /* "petsc4py/PETSc/Random.pyx":211 * cdef PetscScalar sval2 = 1 * CHKERR( PetscRandomGetInterval(self.rnd, &sval1, &sval2) ) * return (toScalar(sval1), toScalar(sval2)) # <<<<<<<<<<<<<< * * def setInterval(self, interval: tuple[Scalar, Scalar]) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toScalar(__pyx_v_sval1); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toScalar(__pyx_v_sval2); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(38, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(38, 211, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(38, 211, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Random.pyx":198 * CHKERR( PetscRandomSeed(self.rnd) ) * * def getInterval(self) -> tuple[Scalar, Scalar]: # <<<<<<<<<<<<<< * """Return the interval containing the random numbers generated. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.Random.getInterval", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Random.pyx":213 * return (toScalar(sval1), toScalar(sval2)) * * def setInterval(self, interval: tuple[Scalar, Scalar]) -> None: # <<<<<<<<<<<<<< * """Set the interval of the random number generator. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_27setInterval(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Random_26setInterval, "Random.setInterval(self, interval: tuple[Scalar, Scalar]) -> None\nSet the interval of the random number generator.\n\n Not collective.\n\n See Also\n --------\n getInterval, petsc.PetscRandomSetInterval\n\n \nSource code at petsc4py/PETSc/Random.pyx:213"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_27setInterval(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_interval = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setInterval (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_interval,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_interval)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(38, 213, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setInterval") < 0)) __PYX_ERR(38, 213, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_interval = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setInterval", 1, 1, 1, __pyx_nargs); __PYX_ERR(38, 213, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Random.setInterval", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Random_26setInterval(((struct PyPetscRandomObject *)__pyx_v_self), __pyx_v_interval); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_26setInterval(struct PyPetscRandomObject *__pyx_v_self, PyObject *__pyx_v_interval) { PetscScalar __pyx_v_sval1; PetscScalar __pyx_v_sval2; PyObject *__pyx_v_low = NULL; PyObject *__pyx_v_high = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); PetscScalar __pyx_t_5; PetscErrorCode __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setInterval", 1); /* "petsc4py/PETSc/Random.pyx":223 * * """ * cdef PetscScalar sval1 = 0 # <<<<<<<<<<<<<< * cdef PetscScalar sval2 = 1 * low, high = interval */ __pyx_v_sval1 = 0.0; /* "petsc4py/PETSc/Random.pyx":224 * """ * cdef PetscScalar sval1 = 0 * cdef PetscScalar sval2 = 1 # <<<<<<<<<<<<<< * low, high = interval * sval1 = asScalar(low) */ __pyx_v_sval2 = 1.0; /* "petsc4py/PETSc/Random.pyx":225 * cdef PetscScalar sval1 = 0 * cdef PetscScalar sval2 = 1 * low, high = interval # <<<<<<<<<<<<<< * sval1 = asScalar(low) * sval2 = asScalar(high) */ if ((likely(PyTuple_CheckExact(__pyx_v_interval))) || (PyList_CheckExact(__pyx_v_interval))) { PyObject* sequence = __pyx_v_interval; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(38, 225, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_interval); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(38, 225, __pyx_L1_error) __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(38, 225, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_low = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_high = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/Random.pyx":226 * cdef PetscScalar sval2 = 1 * low, high = interval * sval1 = asScalar(low) # <<<<<<<<<<<<<< * sval2 = asScalar(high) * CHKERR( PetscRandomSetInterval(self.rnd, sval1, sval2) ) */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_low); if (unlikely(__pyx_t_5 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(38, 226, __pyx_L1_error) __pyx_v_sval1 = __pyx_t_5; /* "petsc4py/PETSc/Random.pyx":227 * low, high = interval * sval1 = asScalar(low) * sval2 = asScalar(high) # <<<<<<<<<<<<<< * CHKERR( PetscRandomSetInterval(self.rnd, sval1, sval2) ) * */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_high); if (unlikely(__pyx_t_5 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(38, 227, __pyx_L1_error) __pyx_v_sval2 = __pyx_t_5; /* "petsc4py/PETSc/Random.pyx":228 * sval1 = asScalar(low) * sval2 = asScalar(high) * CHKERR( PetscRandomSetInterval(self.rnd, sval1, sval2) ) # <<<<<<<<<<<<<< * * # */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscRandomSetInterval(__pyx_v_self->rnd, __pyx_v_sval1, __pyx_v_sval2)); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(38, 228, __pyx_L1_error) /* "petsc4py/PETSc/Random.pyx":213 * return (toScalar(sval1), toScalar(sval2)) * * def setInterval(self, interval: tuple[Scalar, Scalar]) -> None: # <<<<<<<<<<<<<< * """Set the interval of the random number generator. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Random.setInterval", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_low); __Pyx_XDECREF(__pyx_v_high); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Random.pyx":234 * property seed: * """The seed of the random number generator.""" * def __get__(self) -> int: # <<<<<<<<<<<<<< * return self.getSeed() * def __set__(self, value: int | None) -> None: */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_4seed_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_4seed_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Random_4seed___get__(((struct PyPetscRandomObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_4seed___get__(struct PyPetscRandomObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/Random.pyx":235 * """The seed of the random number generator.""" * def __get__(self) -> int: * return self.getSeed() # <<<<<<<<<<<<<< * def __set__(self, value: int | None) -> None: * self.setSeed(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getSeed); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Random.pyx":234 * property seed: * """The seed of the random number generator.""" * def __get__(self) -> int: # <<<<<<<<<<<<<< * return self.getSeed() * def __set__(self, value: int | None) -> None: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Random.seed.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Random.pyx":236 * def __get__(self) -> int: * return self.getSeed() * def __set__(self, value: int | None) -> None: # <<<<<<<<<<<<<< * self.setSeed(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_6Random_4seed_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_6Random_4seed_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Random_4seed_2__set__(((struct PyPetscRandomObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_6Random_4seed_2__set__(struct PyPetscRandomObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "petsc4py/PETSc/Random.pyx":237 * return self.getSeed() * def __set__(self, value: int | None) -> None: * self.setSeed(value) # <<<<<<<<<<<<<< * * property interval: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setSeed); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_value}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Random.pyx":236 * def __get__(self) -> int: * return self.getSeed() * def __set__(self, value: int | None) -> None: # <<<<<<<<<<<<<< * self.setSeed(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Random.seed.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Random.pyx":241 * property interval: * """The interval of the generated random numbers.""" * def __get__(self) -> tuple[Scalar, Scalar]: # <<<<<<<<<<<<<< * return self.getInterval() * def __set__(self, value: tuple[Scalar, Scalar]): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_8interval_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_8interval_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Random_8interval___get__(((struct PyPetscRandomObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_8interval___get__(struct PyPetscRandomObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/Random.pyx":242 * """The interval of the generated random numbers.""" * def __get__(self) -> tuple[Scalar, Scalar]: * return self.getInterval() # <<<<<<<<<<<<<< * def __set__(self, value: tuple[Scalar, Scalar]): * self.setInterval(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getInterval); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Random.pyx":241 * property interval: * """The interval of the generated random numbers.""" * def __get__(self) -> tuple[Scalar, Scalar]: # <<<<<<<<<<<<<< * return self.getInterval() * def __set__(self, value: tuple[Scalar, Scalar]): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Random.interval.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Random.pyx":243 * def __get__(self) -> tuple[Scalar, Scalar]: * return self.getInterval() * def __set__(self, value: tuple[Scalar, Scalar]): # <<<<<<<<<<<<<< * self.setInterval(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_6Random_8interval_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_6Random_8interval_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Random_8interval_2__set__(((struct PyPetscRandomObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_6Random_8interval_2__set__(struct PyPetscRandomObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "petsc4py/PETSc/Random.pyx":244 * return self.getInterval() * def __set__(self, value: tuple[Scalar, Scalar]): * self.setInterval(value) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setInterval); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_value}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Random.pyx":243 * def __get__(self) -> tuple[Scalar, Scalar]: * return self.getInterval() * def __set__(self, value: tuple[Scalar, Scalar]): # <<<<<<<<<<<<<< * self.setInterval(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Random.interval.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Device.pyx":4 * * class staticproperty(property): * def __get__(self, *args, **kwargs): # <<<<<<<<<<<<<< * return self.fget.__get__(*args, **kwargs)() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_14staticproperty_1__get__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_14staticproperty___get__, "staticproperty.__get__(self, *args, **kwargs)\nSource code at petsc4py/PETSc/Device.pyx:4"); static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_14staticproperty_1__get__ = {"__get__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_14staticproperty_1__get__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_14staticproperty___get__}; static PyObject *__pyx_pw_8petsc4py_5PETSc_14staticproperty_1__get__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kwargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL; __Pyx_GOTREF(__pyx_v_kwargs); __pyx_v_args = __Pyx_ArgsSlice_FASTCALL(__pyx_args, 1, __pyx_nargs); if (unlikely(!__pyx_v_args)) { __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; __Pyx_RefNannyFinishContext(); return NULL; } __Pyx_GOTREF(__pyx_v_args); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { default: case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 4, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; const Py_ssize_t used_pos_args = (kwd_pos_args < 1) ? kwd_pos_args : 1; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, __pyx_v_kwargs, values + 0, used_pos_args, "__get__") < 0)) __PYX_ERR(2, 4, __pyx_L3_error) } } else if (unlikely(__pyx_nargs < 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__get__", 0, 1, 1, __pyx_nargs); __PYX_ERR(2, 4, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; __Pyx_AddTraceback("petsc4py.PETSc.staticproperty.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_14staticproperty___get__(__pyx_self, __pyx_v_self, __pyx_v_args, __pyx_v_kwargs); /* function exit code */ __Pyx_DECREF(__pyx_v_args); __Pyx_DECREF(__pyx_v_kwargs); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_14staticproperty___get__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/Device.pyx":5 * class staticproperty(property): * def __get__(self, *args, **kwargs): * return self.fget.__get__(*args, **kwargs)() # <<<<<<<<<<<<<< * * cdef object make_enum_class(str class_name, str class_docstring, tuple args): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_fget); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_get); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyDict_Copy(__pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_v_args, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Device.pyx":4 * * class staticproperty(property): * def __get__(self, *args, **kwargs): # <<<<<<<<<<<<<< * return self.fget.__get__(*args, **kwargs)() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.staticproperty.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Device.pyx":7 * return self.fget.__get__(*args, **kwargs)() * * cdef object make_enum_class(str class_name, str class_docstring, tuple args): # <<<<<<<<<<<<<< * cdef dict enum2str = {} * cdef dict attrs = {} */ static PyObject *__pyx_f_8petsc4py_5PETSc_make_enum_class(PyObject *__pyx_v_class_name, PyObject *__pyx_v_class_docstring, PyObject *__pyx_v_args) { PyObject *__pyx_v_enum2str = 0; PyObject *__pyx_v_attrs = 0; PyObject *__pyx_v_name = NULL; PyObject *__pyx_v_c_enum = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("make_enum_class", 1); /* "petsc4py/PETSc/Device.pyx":8 * * cdef object make_enum_class(str class_name, str class_docstring, tuple args): * cdef dict enum2str = {} # <<<<<<<<<<<<<< * cdef dict attrs = {} * */ __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_enum2str = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Device.pyx":9 * cdef object make_enum_class(str class_name, str class_docstring, tuple args): * cdef dict enum2str = {} * cdef dict attrs = {} # <<<<<<<<<<<<<< * * for name, c_enum in args: */ __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_attrs = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Device.pyx":11 * cdef dict attrs = {} * * for name, c_enum in args: # <<<<<<<<<<<<<< * enum2str[c_enum] = name * attrs[name] = c_enum */ if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(2, 11, __pyx_L1_error) } __pyx_t_1 = __pyx_v_args; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 11, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(2, 11, __pyx_L1_error) #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { PyObject* sequence = __pyx_t_3; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(2, 11, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_4 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); index = 0; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(2, 11, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(2, 11, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF_SET(__pyx_v_c_enum, __pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/Device.pyx":12 * * for name, c_enum in args: * enum2str[c_enum] = name # <<<<<<<<<<<<<< * attrs[name] = c_enum * */ if (unlikely((PyDict_SetItem(__pyx_v_enum2str, __pyx_v_c_enum, __pyx_v_name) < 0))) __PYX_ERR(2, 12, __pyx_L1_error) /* "petsc4py/PETSc/Device.pyx":13 * for name, c_enum in args: * enum2str[c_enum] = name * attrs[name] = c_enum # <<<<<<<<<<<<<< * * attrs['__enum2str'] = enum2str */ if (unlikely((PyDict_SetItem(__pyx_v_attrs, __pyx_v_name, __pyx_v_c_enum) < 0))) __PYX_ERR(2, 13, __pyx_L1_error) /* "petsc4py/PETSc/Device.pyx":11 * cdef dict attrs = {} * * for name, c_enum in args: # <<<<<<<<<<<<<< * enum2str[c_enum] = name * attrs[name] = c_enum */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Device.pyx":15 * attrs[name] = c_enum * * attrs['__enum2str'] = enum2str # <<<<<<<<<<<<<< * attrs['__doc__'] = class_docstring * return type(class_name, (object, ), attrs) */ if (unlikely((PyDict_SetItem(__pyx_v_attrs, __pyx_n_s_enum2str, __pyx_v_enum2str) < 0))) __PYX_ERR(2, 15, __pyx_L1_error) /* "petsc4py/PETSc/Device.pyx":16 * * attrs['__enum2str'] = enum2str * attrs['__doc__'] = class_docstring # <<<<<<<<<<<<<< * return type(class_name, (object, ), attrs) * */ if (unlikely((PyDict_SetItem(__pyx_v_attrs, __pyx_n_s_doc, __pyx_v_class_docstring) < 0))) __PYX_ERR(2, 16, __pyx_L1_error) /* "petsc4py/PETSc/Device.pyx":17 * attrs['__enum2str'] = enum2str * attrs['__doc__'] = class_docstring * return type(class_name, (object, ), attrs) # <<<<<<<<<<<<<< * * DeviceType = make_enum_class( */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_class_name); __Pyx_GIVEREF(__pyx_v_class_name); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_class_name)) __PYX_ERR(2, 17, __pyx_L1_error); __Pyx_INCREF(__pyx_tuple__40); __Pyx_GIVEREF(__pyx_tuple__40); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_tuple__40)) __PYX_ERR(2, 17, __pyx_L1_error); __Pyx_INCREF(__pyx_v_attrs); __Pyx_GIVEREF(__pyx_v_attrs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_attrs)) __PYX_ERR(2, 17, __pyx_L1_error); __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)(&PyType_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Device.pyx":7 * return self.fget.__get__(*args, **kwargs)() * * cdef object make_enum_class(str class_name, str class_docstring, tuple args): # <<<<<<<<<<<<<< * cdef dict enum2str = {} * cdef dict attrs = {} */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.make_enum_class", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_enum2str); __Pyx_XDECREF(__pyx_v_attrs); __Pyx_XDECREF(__pyx_v_name); __Pyx_XDECREF(__pyx_v_c_enum); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Device.pyx":84 * Type = DeviceType * * def __cinit__(self): # <<<<<<<<<<<<<< * self.device = NULL * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_6Device_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_6Device_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Device___cinit__(((struct PyPetscDeviceObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_6Device___cinit__(struct PyPetscDeviceObject *__pyx_v_self) { int __pyx_r; /* "petsc4py/PETSc/Device.pyx":85 * * def __cinit__(self): * self.device = NULL # <<<<<<<<<<<<<< * * def __dealloc__(self): */ __pyx_v_self->device = NULL; /* "petsc4py/PETSc/Device.pyx":84 * Type = DeviceType * * def __cinit__(self): # <<<<<<<<<<<<<< * self.device = NULL * */ /* function exit code */ __pyx_r = 0; return __pyx_r; } /* "petsc4py/PETSc/Device.pyx":87 * self.device = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< * self.destroy() * */ /* Python wrapper */ static void __pyx_pw_8petsc4py_5PETSc_6Device_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_8petsc4py_5PETSc_6Device_3__dealloc__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_pf_8petsc4py_5PETSc_6Device_2__dealloc__(((struct PyPetscDeviceObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_8petsc4py_5PETSc_6Device_2__dealloc__(struct PyPetscDeviceObject *__pyx_v_self) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__dealloc__", 1); /* "petsc4py/PETSc/Device.pyx":88 * * def __dealloc__(self): * self.destroy() # <<<<<<<<<<<<<< * * @classmethod */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_destroy); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Device.pyx":87 * self.device = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< * self.destroy() * */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_WriteUnraisable("petsc4py.PETSc.Device.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_L0:; __Pyx_RefNannyFinishContext(); } /* "petsc4py/PETSc/Device.pyx":90 * self.destroy() * * @classmethod # <<<<<<<<<<<<<< * def create(cls, dtype: Type | None = None, device_id: int = DECIDE) -> Device: * """Create a device object. */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Device_5create(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Device_4create, "Device.create(cls, dtype: Type | None = None, device_id: int = DECIDE) -> Device\nCreate a device object.\n\n Not collective.\n\n Parameters\n ----------\n dtype\n The type of device to create (or `None` for the default).\n\n device_id\n The numeric id of the device to create.\n\n See Also\n --------\n destroy, petsc.PetscDeviceCreate\n\n \nSource code at petsc4py/PETSc/Device.pyx:90"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Device_5create(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_dtype = 0; PyObject *__pyx_v_device_id = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dtype,&__pyx_n_s_device_id,0}; /* "petsc4py/PETSc/Device.pyx":91 * * @classmethod * def create(cls, dtype: Type | None = None, device_id: int = DECIDE) -> Device: # <<<<<<<<<<<<<< * """Create a device object. * */ values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[1] = __Pyx_Arg_NewRef_FASTCALL(__pyx_k__41); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dtype); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 90, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_device_id); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 90, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "create") < 0)) __PYX_ERR(2, 90, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_dtype = values[0]; __pyx_v_device_id = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("create", 0, 0, 2, __pyx_nargs); __PYX_ERR(2, 90, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Device.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Device_4create(((PyTypeObject*)__pyx_v_cls), __pyx_v_dtype, __pyx_v_device_id); /* "petsc4py/PETSc/Device.pyx":90 * self.destroy() * * @classmethod # <<<<<<<<<<<<<< * def create(cls, dtype: Type | None = None, device_id: int = DECIDE) -> Device: * """Create a device object. */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Device_4create(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_dtype, PyObject *__pyx_v_device_id) { PetscInt __pyx_v_cdevice_id; PetscDeviceType __pyx_v_cdevice_type; struct PyPetscDeviceObject *__pyx_v_device = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PetscDeviceType __pyx_t_6; PetscErrorCode __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create", 1); /* "petsc4py/PETSc/Device.pyx":109 * * """ * cdef PetscInt cdevice_id = asInt(device_id) # <<<<<<<<<<<<<< * cdef PetscDeviceType cdevice_type = asDeviceType(dtype if dtype is not None else cls.Type.DEFAULT) * cdef Device device = cls() */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_device_id); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(2, 109, __pyx_L1_error) __pyx_v_cdevice_id = __pyx_t_1; /* "petsc4py/PETSc/Device.pyx":110 * """ * cdef PetscInt cdevice_id = asInt(device_id) * cdef PetscDeviceType cdevice_type = asDeviceType(dtype if dtype is not None else cls.Type.DEFAULT) # <<<<<<<<<<<<<< * cdef Device device = cls() * */ __pyx_t_3 = (__pyx_v_dtype != Py_None); if (__pyx_t_3) { __Pyx_INCREF(__pyx_v_dtype); __pyx_t_2 = __pyx_v_dtype; } else { __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_cls), __pyx_n_s_Type); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_DEFAULT); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __pyx_t_5; __pyx_t_5 = 0; } __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_asDeviceType(__pyx_t_2); if (unlikely(__pyx_t_6 == ((PetscDeviceType)((PetscDeviceType)-1L)))) __PYX_ERR(2, 110, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_cdevice_type = __pyx_t_6; /* "petsc4py/PETSc/Device.pyx":111 * cdef PetscInt cdevice_id = asInt(device_id) * cdef PetscDeviceType cdevice_type = asDeviceType(dtype if dtype is not None else cls.Type.DEFAULT) * cdef Device device = cls() # <<<<<<<<<<<<<< * * CHKERR(PetscDeviceCreate(cdevice_type, cdevice_id, &device.device)) */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_v_cls)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_Device))))) __PYX_ERR(2, 111, __pyx_L1_error) __pyx_v_device = ((struct PyPetscDeviceObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/Device.pyx":113 * cdef Device device = cls() * * CHKERR(PetscDeviceCreate(cdevice_type, cdevice_id, &device.device)) # <<<<<<<<<<<<<< * return device * */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDeviceCreate(__pyx_v_cdevice_type, __pyx_v_cdevice_id, (&__pyx_v_device->device))); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(2, 113, __pyx_L1_error) /* "petsc4py/PETSc/Device.pyx":114 * * CHKERR(PetscDeviceCreate(cdevice_type, cdevice_id, &device.device)) * return device # <<<<<<<<<<<<<< * * def destroy(self) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_device); __pyx_r = ((PyObject *)__pyx_v_device); goto __pyx_L0; /* "petsc4py/PETSc/Device.pyx":90 * self.destroy() * * @classmethod # <<<<<<<<<<<<<< * def create(cls, dtype: Type | None = None, device_id: int = DECIDE) -> Device: * """Create a device object. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.Device.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_device); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Device.pyx":116 * return device * * def destroy(self) -> None: # <<<<<<<<<<<<<< * """Destroy a device object. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Device_7destroy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Device_6destroy, "Device.destroy(self) -> None\nDestroy a device object.\n\n Not collective.\n\n See Also\n --------\n create, petsc.PetscDeviceDestroy\n\n \nSource code at petsc4py/PETSc/Device.pyx:116"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Device_7destroy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("destroy (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Device_6destroy(((struct PyPetscDeviceObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Device_6destroy(struct PyPetscDeviceObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("destroy", 1); /* "petsc4py/PETSc/Device.pyx":126 * * """ * CHKERR(PetscDeviceDestroy(&self.device)) # <<<<<<<<<<<<<< * * def configure(self) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDeviceDestroy((&__pyx_v_self->device))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(2, 126, __pyx_L1_error) /* "petsc4py/PETSc/Device.pyx":116 * return device * * def destroy(self) -> None: # <<<<<<<<<<<<<< * """Destroy a device object. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Device.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Device.pyx":128 * CHKERR(PetscDeviceDestroy(&self.device)) * * def configure(self) -> None: # <<<<<<<<<<<<<< * """Configure and setup a device object. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Device_9configure(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Device_8configure, "Device.configure(self) -> None\nConfigure and setup a device object.\n\n Not collective.\n\n See Also\n --------\n create, petsc.PetscDeviceConfigure\n\n \nSource code at petsc4py/PETSc/Device.pyx:128"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Device_9configure(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("configure (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("configure", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "configure", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Device_8configure(((struct PyPetscDeviceObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Device_8configure(struct PyPetscDeviceObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("configure", 1); /* "petsc4py/PETSc/Device.pyx":138 * * """ * CHKERR(PetscDeviceConfigure(self.device)) # <<<<<<<<<<<<<< * * def view(self, Viewer viewer=None) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDeviceConfigure(__pyx_v_self->device)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(2, 138, __pyx_L1_error) /* "petsc4py/PETSc/Device.pyx":128 * CHKERR(PetscDeviceDestroy(&self.device)) * * def configure(self) -> None: # <<<<<<<<<<<<<< * """Configure and setup a device object. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Device.configure", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Device.pyx":140 * CHKERR(PetscDeviceConfigure(self.device)) * * def view(self, Viewer viewer=None) -> None: # <<<<<<<<<<<<<< * """View a device object. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Device_11view(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Device_10view, "Device.view(self, viewer: Viewer | None = None) -> None\nView a device object.\n\n Collective.\n\n Parameters\n ----------\n viewer\n A `Viewer` instance or `None` for the default viewer.\n\n See Also\n --------\n petsc.PetscDeviceView\n\n \nSource code at petsc4py/PETSc/Device.pyx:140"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Device_11view(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscViewerObject *__pyx_v_viewer = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("view (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscViewerObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_viewer); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 140, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "view") < 0)) __PYX_ERR(2, 140, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, __pyx_nargs); __PYX_ERR(2, 140, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Device.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(2, 140, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Device_10view(((struct PyPetscDeviceObject *)__pyx_v_self), __pyx_v_viewer); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Device_10view(struct PyPetscDeviceObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer) { PetscViewer __pyx_v_vwr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscViewer __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("view", 1); /* "petsc4py/PETSc/Device.pyx":155 * * """ * cdef PetscViewer vwr = NULL # <<<<<<<<<<<<<< * * if viewer is not None: */ __pyx_v_vwr = NULL; /* "petsc4py/PETSc/Device.pyx":157 * cdef PetscViewer vwr = NULL * * if viewer is not None: # <<<<<<<<<<<<<< * vwr = viewer.vwr * CHKERR(PetscDeviceView(self.device, vwr)) */ __pyx_t_1 = (((PyObject *)__pyx_v_viewer) != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/Device.pyx":158 * * if viewer is not None: * vwr = viewer.vwr # <<<<<<<<<<<<<< * CHKERR(PetscDeviceView(self.device, vwr)) * */ __pyx_t_2 = __pyx_v_viewer->vwr; __pyx_v_vwr = __pyx_t_2; /* "petsc4py/PETSc/Device.pyx":157 * cdef PetscViewer vwr = NULL * * if viewer is not None: # <<<<<<<<<<<<<< * vwr = viewer.vwr * CHKERR(PetscDeviceView(self.device, vwr)) */ } /* "petsc4py/PETSc/Device.pyx":159 * if viewer is not None: * vwr = viewer.vwr * CHKERR(PetscDeviceView(self.device, vwr)) # <<<<<<<<<<<<<< * * def getDeviceType(self) -> str: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDeviceView(__pyx_v_self->device, __pyx_v_vwr)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(2, 159, __pyx_L1_error) /* "petsc4py/PETSc/Device.pyx":140 * CHKERR(PetscDeviceConfigure(self.device)) * * def view(self, Viewer viewer=None) -> None: # <<<<<<<<<<<<<< * """View a device object. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Device.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Device.pyx":161 * CHKERR(PetscDeviceView(self.device, vwr)) * * def getDeviceType(self) -> str: # <<<<<<<<<<<<<< * """Return the type of the device. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Device_13getDeviceType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Device_12getDeviceType, "Device.getDeviceType(self) -> str\nReturn the type of the device.\n\n Not collective.\n\n See Also\n --------\n type, petsc.PetscDeviceGetType\n\n \nSource code at petsc4py/PETSc/Device.pyx:161"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Device_13getDeviceType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getDeviceType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getDeviceType", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getDeviceType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Device_12getDeviceType(((struct PyPetscDeviceObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Device_12getDeviceType(struct PyPetscDeviceObject *__pyx_v_self) { PetscDeviceType __pyx_v_cdtype; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getDeviceType", 1); /* "petsc4py/PETSc/Device.pyx":173 * cdef PetscDeviceType cdtype * * CHKERR(PetscDeviceGetType(self.device, &cdtype)) # <<<<<<<<<<<<<< * return toDeviceType(cdtype) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDeviceGetType(__pyx_v_self->device, (&__pyx_v_cdtype))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(2, 173, __pyx_L1_error) /* "petsc4py/PETSc/Device.pyx":174 * * CHKERR(PetscDeviceGetType(self.device, &cdtype)) * return toDeviceType(cdtype) # <<<<<<<<<<<<<< * * def getDeviceId(self) -> int: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toDeviceType(__pyx_v_cdtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Device.pyx":161 * CHKERR(PetscDeviceView(self.device, vwr)) * * def getDeviceType(self) -> str: # <<<<<<<<<<<<<< * """Return the type of the device. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Device.getDeviceType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Device.pyx":176 * return toDeviceType(cdtype) * * def getDeviceId(self) -> int: # <<<<<<<<<<<<<< * """Return the device id. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Device_15getDeviceId(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Device_14getDeviceId, "Device.getDeviceId(self) -> int\nReturn the device id.\n\n Not collective.\n\n See Also\n --------\n create, petsc.PetscDeviceGetDeviceId\n\n \nSource code at petsc4py/PETSc/Device.pyx:176"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6Device_15getDeviceId(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getDeviceId (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getDeviceId", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getDeviceId", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Device_14getDeviceId(((struct PyPetscDeviceObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Device_14getDeviceId(struct PyPetscDeviceObject *__pyx_v_self) { PetscInt __pyx_v_cdevice_id; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getDeviceId", 1); /* "petsc4py/PETSc/Device.pyx":186 * * """ * cdef PetscInt cdevice_id = 0 # <<<<<<<<<<<<<< * * CHKERR(PetscDeviceGetDeviceId(self.device, &cdevice_id)) */ __pyx_v_cdevice_id = 0; /* "petsc4py/PETSc/Device.pyx":188 * cdef PetscInt cdevice_id = 0 * * CHKERR(PetscDeviceGetDeviceId(self.device, &cdevice_id)) # <<<<<<<<<<<<<< * return toInt(cdevice_id) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDeviceGetDeviceId(__pyx_v_self->device, (&__pyx_v_cdevice_id))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(2, 188, __pyx_L1_error) /* "petsc4py/PETSc/Device.pyx":189 * * CHKERR(PetscDeviceGetDeviceId(self.device, &cdevice_id)) * return toInt(cdevice_id) # <<<<<<<<<<<<<< * * @staticmethod */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_cdevice_id); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Device.pyx":176 * return toDeviceType(cdtype) * * def getDeviceId(self) -> int: # <<<<<<<<<<<<<< * """Return the device id. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Device.getDeviceId", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Device.pyx":191 * return toInt(cdevice_id) * * @staticmethod # <<<<<<<<<<<<<< * def setDefaultType(device_type: Type | str) -> None: * """Set the device type to be used as the default in subsequent calls to `create`. */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Device_17setDefaultType(CYTHON_UNUSED PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6Device_16setDefaultType, "Device.setDefaultType(device_type: Type | str) -> None\nSet the device type to be used as the default in subsequent calls to `create`.\n\n Not collective.\n\n See Also\n --------\n create, petsc.PetscDeviceSetDefaultDeviceType\n\n \nSource code at petsc4py/PETSc/Device.pyx:191"); static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Device_17setDefaultType = {"setDefaultType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Device_17setDefaultType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Device_16setDefaultType}; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Device_17setDefaultType(CYTHON_UNUSED PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_device_type = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setDefaultType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_device_type,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_device_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 191, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setDefaultType") < 0)) __PYX_ERR(2, 191, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_device_type = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setDefaultType", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 191, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Device.setDefaultType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Device_16setDefaultType(__pyx_v_device_type); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Device_16setDefaultType(PyObject *__pyx_v_device_type) { PetscDeviceType __pyx_v_cdevice_type; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscDeviceType __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setDefaultType", 1); /* "petsc4py/PETSc/Device.pyx":202 * * """ * cdef PetscDeviceType cdevice_type = asDeviceType(device_type) # <<<<<<<<<<<<<< * * CHKERR(PetscDeviceSetDefaultDeviceType(cdevice_type)) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asDeviceType(__pyx_v_device_type); if (unlikely(__pyx_t_1 == ((PetscDeviceType)((PetscDeviceType)-1L)))) __PYX_ERR(2, 202, __pyx_L1_error) __pyx_v_cdevice_type = __pyx_t_1; /* "petsc4py/PETSc/Device.pyx":204 * cdef PetscDeviceType cdevice_type = asDeviceType(device_type) * * CHKERR(PetscDeviceSetDefaultDeviceType(cdevice_type)) # <<<<<<<<<<<<<< * * property type: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDeviceSetDefaultDeviceType(__pyx_v_cdevice_type)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(2, 204, __pyx_L1_error) /* "petsc4py/PETSc/Device.pyx":191 * return toInt(cdevice_id) * * @staticmethod # <<<<<<<<<<<<<< * def setDefaultType(device_type: Type | str) -> None: * """Set the device type to be used as the default in subsequent calls to `create`. */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Device.setDefaultType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Device.pyx":208 * property type: * """The device type.""" * def __get__(self) -> str: # <<<<<<<<<<<<<< * return self.getDeviceType() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Device_4type_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Device_4type_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Device_4type___get__(((struct PyPetscDeviceObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Device_4type___get__(struct PyPetscDeviceObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/Device.pyx":209 * """The device type.""" * def __get__(self) -> str: * return self.getDeviceType() # <<<<<<<<<<<<<< * * property device_id: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getDeviceType); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Device.pyx":208 * property type: * """The device type.""" * def __get__(self) -> str: # <<<<<<<<<<<<<< * return self.getDeviceType() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Device.type.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Device.pyx":213 * property device_id: * """The device id.""" * def __get__(self) -> int: # <<<<<<<<<<<<<< * return self.getDeviceId() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Device_9device_id_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Device_9device_id_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Device_9device_id___get__(((struct PyPetscDeviceObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Device_9device_id___get__(struct PyPetscDeviceObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/Device.pyx":214 * """The device id.""" * def __get__(self) -> int: * return self.getDeviceId() # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getDeviceId); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Device.pyx":213 * property device_id: * """The device id.""" * def __get__(self) -> int: # <<<<<<<<<<<<<< * return self.getDeviceId() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Device.device_id.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Device.pyx":232 * StreamType = StreamType * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.dctx * self.dctx = NULL */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_13DeviceContext_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_13DeviceContext_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_8petsc4py_5PETSc_13DeviceContext___cinit__(((struct PyPetscDeviceContextObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_13DeviceContext___cinit__(struct PyPetscDeviceContextObject *__pyx_v_self) { int __pyx_r; /* "petsc4py/PETSc/Device.pyx":233 * * def __cinit__(self): * self.obj = &self.dctx # <<<<<<<<<<<<<< * self.dctx = NULL * */ __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->dctx)); /* "petsc4py/PETSc/Device.pyx":234 * def __cinit__(self): * self.obj = &self.dctx * self.dctx = NULL # <<<<<<<<<<<<<< * * def __dealloc__(self): */ __pyx_v_self->dctx = NULL; /* "petsc4py/PETSc/Device.pyx":232 * StreamType = StreamType * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.dctx * self.dctx = NULL */ /* function exit code */ __pyx_r = 0; return __pyx_r; } /* "petsc4py/PETSc/Device.pyx":236 * self.dctx = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< * self.destroy() * */ /* Python wrapper */ static void __pyx_pw_8petsc4py_5PETSc_13DeviceContext_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_8petsc4py_5PETSc_13DeviceContext_3__dealloc__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_pf_8petsc4py_5PETSc_13DeviceContext_2__dealloc__(((struct PyPetscDeviceContextObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_8petsc4py_5PETSc_13DeviceContext_2__dealloc__(struct PyPetscDeviceContextObject *__pyx_v_self) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__dealloc__", 1); /* "petsc4py/PETSc/Device.pyx":237 * * def __dealloc__(self): * self.destroy() # <<<<<<<<<<<<<< * * @classmethod */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_destroy); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Device.pyx":236 * self.dctx = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< * self.destroy() * */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_WriteUnraisable("petsc4py.PETSc.DeviceContext.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_L0:; __Pyx_RefNannyFinishContext(); } /* "petsc4py/PETSc/Device.pyx":239 * self.destroy() * * @classmethod # <<<<<<<<<<<<<< * def create(cls) -> DeviceContext: * """Create an empty DeviceContext. */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_5create(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_13DeviceContext_4create, "DeviceContext.create(cls) -> DeviceContext\nCreate an empty DeviceContext.\n\n Not collective.\n\n See Also\n --------\n Device, petsc.PetscDeviceContextCreate\n\n \nSource code at petsc4py/PETSc/Device.pyx:239"); static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_5create(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("create", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "create", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_13DeviceContext_4create(((PyTypeObject*)__pyx_v_cls)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_13DeviceContext_4create(PyTypeObject *__pyx_v_cls) { struct PyPetscDeviceContextObject *__pyx_v_dctx = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create", 1); /* "petsc4py/PETSc/Device.pyx":250 * * """ * cdef DeviceContext dctx = cls() # <<<<<<<<<<<<<< * * CHKERR(PetscDeviceContextCreate(&dctx.dctx)) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_v_cls)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_DeviceContext))))) __PYX_ERR(2, 250, __pyx_L1_error) __pyx_v_dctx = ((struct PyPetscDeviceContextObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Device.pyx":252 * cdef DeviceContext dctx = cls() * * CHKERR(PetscDeviceContextCreate(&dctx.dctx)) # <<<<<<<<<<<<<< * return dctx * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDeviceContextCreate((&__pyx_v_dctx->dctx))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(2, 252, __pyx_L1_error) /* "petsc4py/PETSc/Device.pyx":253 * * CHKERR(PetscDeviceContextCreate(&dctx.dctx)) * return dctx # <<<<<<<<<<<<<< * * def getStreamType(self) -> str: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_dctx); __pyx_r = ((PyObject *)__pyx_v_dctx); goto __pyx_L0; /* "petsc4py/PETSc/Device.pyx":239 * self.destroy() * * @classmethod # <<<<<<<<<<<<<< * def create(cls) -> DeviceContext: * """Create an empty DeviceContext. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DeviceContext.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_dctx); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Device.pyx":255 * return dctx * * def getStreamType(self) -> str: # <<<<<<<<<<<<<< * """Return the `StreamType`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_7getStreamType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_13DeviceContext_6getStreamType, "DeviceContext.getStreamType(self) -> str\nReturn the `StreamType`.\n\n Not collective.\n\n See Also\n --------\n stream_type, setStreamType, petsc.PetscDeviceContextGetStreamType\n\n \nSource code at petsc4py/PETSc/Device.pyx:255"); static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_7getStreamType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getStreamType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getStreamType", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getStreamType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_13DeviceContext_6getStreamType(((struct PyPetscDeviceContextObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_13DeviceContext_6getStreamType(struct PyPetscDeviceContextObject *__pyx_v_self) { PetscStreamType __pyx_v_cstream_type; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getStreamType", 1); /* "petsc4py/PETSc/Device.pyx":265 * * """ * cdef PetscStreamType cstream_type = PETSC_STREAM_DEFAULT_BLOCKING # <<<<<<<<<<<<<< * * CHKERR(PetscDeviceContextGetStreamType(self.dctx, &cstream_type)) */ __pyx_v_cstream_type = PETSC_STREAM_DEFAULT_BLOCKING; /* "petsc4py/PETSc/Device.pyx":267 * cdef PetscStreamType cstream_type = PETSC_STREAM_DEFAULT_BLOCKING * * CHKERR(PetscDeviceContextGetStreamType(self.dctx, &cstream_type)) # <<<<<<<<<<<<<< * return toStreamType(cstream_type) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDeviceContextGetStreamType(__pyx_v_self->dctx, (&__pyx_v_cstream_type))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(2, 267, __pyx_L1_error) /* "petsc4py/PETSc/Device.pyx":268 * * CHKERR(PetscDeviceContextGetStreamType(self.dctx, &cstream_type)) * return toStreamType(cstream_type) # <<<<<<<<<<<<<< * * def setStreamType(self, stream_type: StreamType | str) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toStreamType(__pyx_v_cstream_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Device.pyx":255 * return dctx * * def getStreamType(self) -> str: # <<<<<<<<<<<<<< * """Return the `StreamType`. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DeviceContext.getStreamType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Device.pyx":270 * return toStreamType(cstream_type) * * def setStreamType(self, stream_type: StreamType | str) -> None: # <<<<<<<<<<<<<< * """Set the `StreamType`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_9setStreamType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_13DeviceContext_8setStreamType, "DeviceContext.setStreamType(self, stream_type: StreamType | str) -> None\nSet the `StreamType`.\n\n Not collective.\n\n Parameters\n ----------\n stream_type\n The type of stream to set\n\n See Also\n --------\n stream_type, getStreamType, petsc.PetscDeviceContextSetStreamType\n\n \nSource code at petsc4py/PETSc/Device.pyx:270"); static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_9setStreamType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_stream_type = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setStreamType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stream_type,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_stream_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 270, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setStreamType") < 0)) __PYX_ERR(2, 270, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_stream_type = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setStreamType", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 270, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DeviceContext.setStreamType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_13DeviceContext_8setStreamType(((struct PyPetscDeviceContextObject *)__pyx_v_self), __pyx_v_stream_type); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_13DeviceContext_8setStreamType(struct PyPetscDeviceContextObject *__pyx_v_self, PyObject *__pyx_v_stream_type) { PetscStreamType __pyx_v_cstream_type; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscStreamType __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setStreamType", 1); /* "petsc4py/PETSc/Device.pyx":285 * * """ * cdef PetscStreamType cstream_type = asStreamType(stream_type) # <<<<<<<<<<<<<< * * CHKERR(PetscDeviceContextSetStreamType(self.dctx, cstream_type)) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asStreamType(__pyx_v_stream_type); if (unlikely(__pyx_t_1 == ((PetscStreamType)((PetscStreamType)-1L)))) __PYX_ERR(2, 285, __pyx_L1_error) __pyx_v_cstream_type = __pyx_t_1; /* "petsc4py/PETSc/Device.pyx":287 * cdef PetscStreamType cstream_type = asStreamType(stream_type) * * CHKERR(PetscDeviceContextSetStreamType(self.dctx, cstream_type)) # <<<<<<<<<<<<<< * * def getDevice(self) -> Device: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDeviceContextSetStreamType(__pyx_v_self->dctx, __pyx_v_cstream_type)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(2, 287, __pyx_L1_error) /* "petsc4py/PETSc/Device.pyx":270 * return toStreamType(cstream_type) * * def setStreamType(self, stream_type: StreamType | str) -> None: # <<<<<<<<<<<<<< * """Set the `StreamType`. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DeviceContext.setStreamType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Device.pyx":289 * CHKERR(PetscDeviceContextSetStreamType(self.dctx, cstream_type)) * * def getDevice(self) -> Device: # <<<<<<<<<<<<<< * """Get the `Device` which this instance is attached to. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_11getDevice(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_13DeviceContext_10getDevice, "DeviceContext.getDevice(self) -> Device\nGet the `Device` which this instance is attached to.\n\n Not collective.\n\n See Also\n --------\n setDevice, device, Device, petsc.PetscDeviceContextGetDevice\n\n \nSource code at petsc4py/PETSc/Device.pyx:289"); static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_11getDevice(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getDevice (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getDevice", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getDevice", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_13DeviceContext_10getDevice(((struct PyPetscDeviceContextObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_13DeviceContext_10getDevice(struct PyPetscDeviceContextObject *__pyx_v_self) { PetscDevice __pyx_v_device; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getDevice", 1); /* "petsc4py/PETSc/Device.pyx":299 * * """ * cdef PetscDevice device = NULL # <<<<<<<<<<<<<< * * CHKERR(PetscDeviceContextGetDevice(self.dctx, &device)) */ __pyx_v_device = NULL; /* "petsc4py/PETSc/Device.pyx":301 * cdef PetscDevice device = NULL * * CHKERR(PetscDeviceContextGetDevice(self.dctx, &device)) # <<<<<<<<<<<<<< * return PyPetscDevice_New(device) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDeviceContextGetDevice(__pyx_v_self->dctx, (&__pyx_v_device))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(2, 301, __pyx_L1_error) /* "petsc4py/PETSc/Device.pyx":302 * * CHKERR(PetscDeviceContextGetDevice(self.dctx, &device)) * return PyPetscDevice_New(device) # <<<<<<<<<<<<<< * * def setDevice(self, Device device not None) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyPetscDevice_New(__pyx_v_device)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Device.pyx":289 * CHKERR(PetscDeviceContextSetStreamType(self.dctx, cstream_type)) * * def getDevice(self) -> Device: # <<<<<<<<<<<<<< * """Get the `Device` which this instance is attached to. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DeviceContext.getDevice", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Device.pyx":304 * return PyPetscDevice_New(device) * * def setDevice(self, Device device not None) -> None: # <<<<<<<<<<<<<< * """Set the `Device` which this `DeviceContext` is attached to. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_13setDevice(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_13DeviceContext_12setDevice, "DeviceContext.setDevice(self, device: Device) -> None\nSet the `Device` which this `DeviceContext` is attached to.\n\n Collective.\n\n Parameters\n ----------\n device\n The `Device` to which this instance is attached to.\n\n See Also\n --------\n getDevice, device, Device, petsc.PetscDeviceContextSetDevice\n\n \nSource code at petsc4py/PETSc/Device.pyx:304"); static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_13setDevice(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscDeviceObject *__pyx_v_device = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setDevice (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_device,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_device)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 304, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setDevice") < 0)) __PYX_ERR(2, 304, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_device = ((struct PyPetscDeviceObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setDevice", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 304, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DeviceContext.setDevice", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_device), __pyx_ptype_8petsc4py_5PETSc_Device, 0, "device", 0))) __PYX_ERR(2, 304, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_13DeviceContext_12setDevice(((struct PyPetscDeviceContextObject *)__pyx_v_self), __pyx_v_device); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_13DeviceContext_12setDevice(struct PyPetscDeviceContextObject *__pyx_v_self, struct PyPetscDeviceObject *__pyx_v_device) { PetscDevice __pyx_v_cdevice; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscDevice __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setDevice", 1); /* "petsc4py/PETSc/Device.pyx":319 * * """ * cdef PetscDevice cdevice = PyPetscDevice_Get(device) # <<<<<<<<<<<<<< * * CHKERR(PetscDeviceContextSetDevice(self.dctx, cdevice)) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_PyPetscDevice_Get(((PyObject *)__pyx_v_device)); if (unlikely(__pyx_t_1 == ((PetscDevice)NULL) && PyErr_Occurred())) __PYX_ERR(2, 319, __pyx_L1_error) __pyx_v_cdevice = __pyx_t_1; /* "petsc4py/PETSc/Device.pyx":321 * cdef PetscDevice cdevice = PyPetscDevice_Get(device) * * CHKERR(PetscDeviceContextSetDevice(self.dctx, cdevice)) # <<<<<<<<<<<<<< * * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDeviceContextSetDevice(__pyx_v_self->dctx, __pyx_v_cdevice)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(2, 321, __pyx_L1_error) /* "petsc4py/PETSc/Device.pyx":304 * return PyPetscDevice_New(device) * * def setDevice(self, Device device not None) -> None: # <<<<<<<<<<<<<< * """Set the `Device` which this `DeviceContext` is attached to. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DeviceContext.setDevice", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Device.pyx":324 * * * def setUp(self) -> None: # <<<<<<<<<<<<<< * """Set up the internal data structures for using the device context. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_15setUp(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_13DeviceContext_14setUp, "DeviceContext.setUp(self) -> None\nSet up the internal data structures for using the device context.\n\n Not collective.\n\n See Also\n --------\n create, petsc.PetscDeviceContextSetUp\n\n \nSource code at petsc4py/PETSc/Device.pyx:324"); static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_15setUp(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setUp (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("setUp", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setUp", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_13DeviceContext_14setUp(((struct PyPetscDeviceContextObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_13DeviceContext_14setUp(struct PyPetscDeviceContextObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setUp", 1); /* "petsc4py/PETSc/Device.pyx":334 * * """ * CHKERR(PetscDeviceContextSetUp(self.dctx)) # <<<<<<<<<<<<<< * * def duplicate(self) -> DeviceContext: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDeviceContextSetUp(__pyx_v_self->dctx)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(2, 334, __pyx_L1_error) /* "petsc4py/PETSc/Device.pyx":324 * * * def setUp(self) -> None: # <<<<<<<<<<<<<< * """Set up the internal data structures for using the device context. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DeviceContext.setUp", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Device.pyx":336 * CHKERR(PetscDeviceContextSetUp(self.dctx)) * * def duplicate(self) -> DeviceContext: # <<<<<<<<<<<<<< * """Duplicate a the device context. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_17duplicate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_13DeviceContext_16duplicate, "DeviceContext.duplicate(self) -> DeviceContext\nDuplicate a the device context.\n\n Not collective.\n\n See Also\n --------\n create, petsc.PetscDeviceContextDuplicate\n\n \nSource code at petsc4py/PETSc/Device.pyx:336"); static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_17duplicate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("duplicate (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("duplicate", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "duplicate", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_13DeviceContext_16duplicate(((struct PyPetscDeviceContextObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_13DeviceContext_16duplicate(struct PyPetscDeviceContextObject *__pyx_v_self) { PetscDeviceContext __pyx_v_octx; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("duplicate", 1); /* "petsc4py/PETSc/Device.pyx":346 * * """ * cdef PetscDeviceContext octx = NULL # <<<<<<<<<<<<<< * * CHKERR(PetscDeviceContextDuplicate(self.dctx, &octx)) */ __pyx_v_octx = NULL; /* "petsc4py/PETSc/Device.pyx":348 * cdef PetscDeviceContext octx = NULL * * CHKERR(PetscDeviceContextDuplicate(self.dctx, &octx)) # <<<<<<<<<<<<<< * return PyPetscDeviceContext_New(octx) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDeviceContextDuplicate(__pyx_v_self->dctx, (&__pyx_v_octx))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(2, 348, __pyx_L1_error) /* "petsc4py/PETSc/Device.pyx":349 * * CHKERR(PetscDeviceContextDuplicate(self.dctx, &octx)) * return PyPetscDeviceContext_New(octx) # <<<<<<<<<<<<<< * * def idle(self) -> bool: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyPetscDeviceContext_New(__pyx_v_octx)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Device.pyx":336 * CHKERR(PetscDeviceContextSetUp(self.dctx)) * * def duplicate(self) -> DeviceContext: # <<<<<<<<<<<<<< * """Duplicate a the device context. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DeviceContext.duplicate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Device.pyx":351 * return PyPetscDeviceContext_New(octx) * * def idle(self) -> bool: # <<<<<<<<<<<<<< * """Return whether the underlying stream for the device context is idle. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_19idle(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_13DeviceContext_18idle, "DeviceContext.idle(self) -> bool\nReturn whether the underlying stream for the device context is idle.\n\n Not collective.\n\n See Also\n --------\n synchronize, petsc.PetscDeviceContextQueryIdle\n\n \nSource code at petsc4py/PETSc/Device.pyx:351"); static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_19idle(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("idle (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("idle", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "idle", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_13DeviceContext_18idle(((struct PyPetscDeviceContextObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_13DeviceContext_18idle(struct PyPetscDeviceContextObject *__pyx_v_self) { PetscBool __pyx_v_is_idle; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("idle", 1); /* "petsc4py/PETSc/Device.pyx":361 * * """ * cdef PetscBool is_idle = PETSC_FALSE # <<<<<<<<<<<<<< * * CHKERR(PetscDeviceContextQueryIdle(self.dctx, &is_idle)) */ __pyx_v_is_idle = PETSC_FALSE; /* "petsc4py/PETSc/Device.pyx":363 * cdef PetscBool is_idle = PETSC_FALSE * * CHKERR(PetscDeviceContextQueryIdle(self.dctx, &is_idle)) # <<<<<<<<<<<<<< * return toBool(is_idle) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDeviceContextQueryIdle(__pyx_v_self->dctx, (&__pyx_v_is_idle))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(2, 363, __pyx_L1_error) /* "petsc4py/PETSc/Device.pyx":364 * * CHKERR(PetscDeviceContextQueryIdle(self.dctx, &is_idle)) * return toBool(is_idle) # <<<<<<<<<<<<<< * * def waitFor(self, other: DeviceContext | None) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_is_idle); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Device.pyx":351 * return PyPetscDeviceContext_New(octx) * * def idle(self) -> bool: # <<<<<<<<<<<<<< * """Return whether the underlying stream for the device context is idle. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DeviceContext.idle", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Device.pyx":366 * return toBool(is_idle) * * def waitFor(self, other: DeviceContext | None) -> None: # <<<<<<<<<<<<<< * """Make this instance wait for ``other``. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_21waitFor(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_13DeviceContext_20waitFor, "DeviceContext.waitFor(self, other: DeviceContext | None) -> None\nMake this instance wait for ``other``.\n\n Not collective.\n\n Parameters\n ----------\n other\n The other `DeviceContext` to wait for\n\n See Also\n --------\n fork, join, petsc.PetscDeviceContextWaitForContext\n\n \nSource code at petsc4py/PETSc/Device.pyx:366"); static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_21waitFor(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_other = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("waitFor (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_other)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 366, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "waitFor") < 0)) __PYX_ERR(2, 366, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_other = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("waitFor", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 366, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DeviceContext.waitFor", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_13DeviceContext_20waitFor(((struct PyPetscDeviceContextObject *)__pyx_v_self), __pyx_v_other); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_13DeviceContext_20waitFor(struct PyPetscDeviceContextObject *__pyx_v_self, PyObject *__pyx_v_other) { PetscDeviceContext __pyx_v_cother; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscDeviceContext __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("waitFor", 1); /* "petsc4py/PETSc/Device.pyx":381 * * """ * cdef PetscDeviceContext cother = NULL # <<<<<<<<<<<<<< * * if other is not None: */ __pyx_v_cother = NULL; /* "petsc4py/PETSc/Device.pyx":383 * cdef PetscDeviceContext cother = NULL * * if other is not None: # <<<<<<<<<<<<<< * cother = PyPetscDeviceContext_Get(other) * CHKERR(PetscDeviceContextWaitForContext(self.dctx, cother)) */ __pyx_t_1 = (__pyx_v_other != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/Device.pyx":384 * * if other is not None: * cother = PyPetscDeviceContext_Get(other) # <<<<<<<<<<<<<< * CHKERR(PetscDeviceContextWaitForContext(self.dctx, cother)) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_PyPetscDeviceContext_Get(__pyx_v_other); if (unlikely(__pyx_t_2 == ((PetscDeviceContext)NULL) && PyErr_Occurred())) __PYX_ERR(2, 384, __pyx_L1_error) __pyx_v_cother = __pyx_t_2; /* "petsc4py/PETSc/Device.pyx":383 * cdef PetscDeviceContext cother = NULL * * if other is not None: # <<<<<<<<<<<<<< * cother = PyPetscDeviceContext_Get(other) * CHKERR(PetscDeviceContextWaitForContext(self.dctx, cother)) */ } /* "petsc4py/PETSc/Device.pyx":385 * if other is not None: * cother = PyPetscDeviceContext_Get(other) * CHKERR(PetscDeviceContextWaitForContext(self.dctx, cother)) # <<<<<<<<<<<<<< * * def fork(self, n: int, stream_type: DeviceContext.StreamType | str | None = None) -> list[DeviceContext]: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDeviceContextWaitForContext(__pyx_v_self->dctx, __pyx_v_cother)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(2, 385, __pyx_L1_error) /* "petsc4py/PETSc/Device.pyx":366 * return toBool(is_idle) * * def waitFor(self, other: DeviceContext | None) -> None: # <<<<<<<<<<<<<< * """Make this instance wait for ``other``. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DeviceContext.waitFor", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Device.pyx":387 * CHKERR(PetscDeviceContextWaitForContext(self.dctx, cother)) * * def fork(self, n: int, stream_type: DeviceContext.StreamType | str | None = None) -> list[DeviceContext]: # <<<<<<<<<<<<<< * """Create multiple device contexts which are all logically dependent on this one. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_23fork(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_13DeviceContext_22fork, "DeviceContext.fork(self, n: int, stream_type: DeviceContext.StreamType | str | None = None) -> list[DeviceContext]\nCreate multiple device contexts which are all logically dependent on this one.\n\n Not collective.\n\n Parameters\n ----------\n n\n The number of device contexts to create.\n stream_type\n The type of stream of the forked device context.\n\n See Also\n --------\n join, waitFor, petsc.PetscDeviceContextFork\n\n \nSource code at petsc4py/PETSc/Device.pyx:387"); static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_23fork(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_n = 0; PyObject *__pyx_v_stream_type = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("fork (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,&__pyx_n_s_stream_type,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 387, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_stream_type); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 387, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "fork") < 0)) __PYX_ERR(2, 387, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_n = values[0]; __pyx_v_stream_type = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("fork", 0, 1, 2, __pyx_nargs); __PYX_ERR(2, 387, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DeviceContext.fork", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_13DeviceContext_22fork(((struct PyPetscDeviceContextObject *)__pyx_v_self), __pyx_v_n, __pyx_v_stream_type); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_13DeviceContext_22fork(struct PyPetscDeviceContextObject *__pyx_v_self, PyObject *__pyx_v_n, PyObject *__pyx_v_stream_type) { PetscDeviceContext *__pyx_v_subctx; PetscStreamType __pyx_v_cstream_type; PetscInt __pyx_v_cn; PetscInt __pyx_8genexpr2__pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; PetscErrorCode __pyx_t_3; PetscStreamType __pyx_t_4; PyObject *__pyx_t_5 = NULL; PetscInt __pyx_t_6; PetscInt __pyx_t_7; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int __pyx_t_10; char const *__pyx_t_11; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("fork", 1); /* "petsc4py/PETSc/Device.pyx":404 * * """ * cdef PetscDeviceContext *subctx = NULL # <<<<<<<<<<<<<< * cdef PetscStreamType cstream_type = PETSC_STREAM_DEFAULT_BLOCKING * cdef PetscInt cn = asInt(n) */ __pyx_v_subctx = NULL; /* "petsc4py/PETSc/Device.pyx":405 * """ * cdef PetscDeviceContext *subctx = NULL * cdef PetscStreamType cstream_type = PETSC_STREAM_DEFAULT_BLOCKING # <<<<<<<<<<<<<< * cdef PetscInt cn = asInt(n) * try: */ __pyx_v_cstream_type = PETSC_STREAM_DEFAULT_BLOCKING; /* "petsc4py/PETSc/Device.pyx":406 * cdef PetscDeviceContext *subctx = NULL * cdef PetscStreamType cstream_type = PETSC_STREAM_DEFAULT_BLOCKING * cdef PetscInt cn = asInt(n) # <<<<<<<<<<<<<< * try: * if stream_type is None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_n); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(2, 406, __pyx_L1_error) __pyx_v_cn = __pyx_t_1; /* "petsc4py/PETSc/Device.pyx":407 * cdef PetscStreamType cstream_type = PETSC_STREAM_DEFAULT_BLOCKING * cdef PetscInt cn = asInt(n) * try: # <<<<<<<<<<<<<< * if stream_type is None: * CHKERR(PetscDeviceContextFork(self.dctx, cn, &subctx)) */ /*try:*/ { /* "petsc4py/PETSc/Device.pyx":408 * cdef PetscInt cn = asInt(n) * try: * if stream_type is None: # <<<<<<<<<<<<<< * CHKERR(PetscDeviceContextFork(self.dctx, cn, &subctx)) * else: */ __pyx_t_2 = (__pyx_v_stream_type == Py_None); if (__pyx_t_2) { /* "petsc4py/PETSc/Device.pyx":409 * try: * if stream_type is None: * CHKERR(PetscDeviceContextFork(self.dctx, cn, &subctx)) # <<<<<<<<<<<<<< * else: * cstream_type = asStreamType(stream_type) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDeviceContextFork(__pyx_v_self->dctx, __pyx_v_cn, (&__pyx_v_subctx))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(2, 409, __pyx_L4_error) /* "petsc4py/PETSc/Device.pyx":408 * cdef PetscInt cn = asInt(n) * try: * if stream_type is None: # <<<<<<<<<<<<<< * CHKERR(PetscDeviceContextFork(self.dctx, cn, &subctx)) * else: */ goto __pyx_L6; } /* "petsc4py/PETSc/Device.pyx":411 * CHKERR(PetscDeviceContextFork(self.dctx, cn, &subctx)) * else: * cstream_type = asStreamType(stream_type) # <<<<<<<<<<<<<< * CHKERR(PetscDeviceContextForkWithStreamType(self.dctx, cstream_type, cn, &subctx)) * return [PyPetscDeviceContext_New(subctx[i]) for i in range(cn)] */ /*else*/ { __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asStreamType(__pyx_v_stream_type); if (unlikely(__pyx_t_4 == ((PetscStreamType)((PetscStreamType)-1L)))) __PYX_ERR(2, 411, __pyx_L4_error) __pyx_v_cstream_type = __pyx_t_4; /* "petsc4py/PETSc/Device.pyx":412 * else: * cstream_type = asStreamType(stream_type) * CHKERR(PetscDeviceContextForkWithStreamType(self.dctx, cstream_type, cn, &subctx)) # <<<<<<<<<<<<<< * return [PyPetscDeviceContext_New(subctx[i]) for i in range(cn)] * finally: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDeviceContextForkWithStreamType(__pyx_v_self->dctx, __pyx_v_cstream_type, __pyx_v_cn, (&__pyx_v_subctx))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(2, 412, __pyx_L4_error) /* "petsc4py/PETSc/Device.pyx":413 * cstream_type = asStreamType(stream_type) * CHKERR(PetscDeviceContextForkWithStreamType(self.dctx, cstream_type, cn, &subctx)) * return [PyPetscDeviceContext_New(subctx[i]) for i in range(cn)] # <<<<<<<<<<<<<< * finally: * CHKERR(PetscFree(subctx)) */ __Pyx_XDECREF(__pyx_r); { /* enter inner scope */ __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 413, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __pyx_v_cn; __pyx_t_6 = __pyx_t_1; for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_8genexpr2__pyx_v_i = __pyx_t_7; __pyx_t_8 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyPetscDeviceContext_New((__pyx_v_subctx[__pyx_8genexpr2__pyx_v_i]))); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 413, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_8); if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_8))) __PYX_ERR(2, 413, __pyx_L4_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } } /* exit inner scope */ __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L3_return; } __pyx_L6:; } /* "petsc4py/PETSc/Device.pyx":415 * return [PyPetscDeviceContext_New(subctx[i]) for i in range(cn)] * finally: * CHKERR(PetscFree(subctx)) # <<<<<<<<<<<<<< * * def join(self, join_mode: DeviceJoinMode | str, py_sub_ctxs: list[DeviceContext]) -> None: */ /*finally:*/ { /*normal exit:*/{ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_subctx)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(2, 415, __pyx_L1_error) goto __pyx_L5; } __pyx_L4_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14) < 0)) __Pyx_ErrFetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); __pyx_t_9 = __pyx_lineno; __pyx_t_10 = __pyx_clineno; __pyx_t_11 = __pyx_filename; { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_subctx)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(2, 415, __pyx_L10_error) } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17); } __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_ErrRestore(__pyx_t_12, __pyx_t_13, __pyx_t_14); __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_10; __pyx_filename = __pyx_t_11; goto __pyx_L1_error; __pyx_L10_error:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17); } __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; goto __pyx_L1_error; } __pyx_L3_return: { __pyx_t_17 = __pyx_r; __pyx_r = 0; __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_subctx)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(2, 415, __pyx_L1_error) __pyx_r = __pyx_t_17; __pyx_t_17 = 0; goto __pyx_L0; } __pyx_L5:; } /* "petsc4py/PETSc/Device.pyx":387 * CHKERR(PetscDeviceContextWaitForContext(self.dctx, cother)) * * def fork(self, n: int, stream_type: DeviceContext.StreamType | str | None = None) -> list[DeviceContext]: # <<<<<<<<<<<<<< * """Create multiple device contexts which are all logically dependent on this one. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("petsc4py.PETSc.DeviceContext.fork", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Device.pyx":417 * CHKERR(PetscFree(subctx)) * * def join(self, join_mode: DeviceJoinMode | str, py_sub_ctxs: list[DeviceContext]) -> None: # <<<<<<<<<<<<<< * """Join a set of device contexts on this one. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_25join(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_13DeviceContext_24join, "DeviceContext.join(self, join_mode: DeviceJoinMode | str, py_sub_ctxs: list[DeviceContext]) -> None\nJoin a set of device contexts on this one.\n\n Not collective.\n\n Parameters\n ----------\n join_mode\n The type of join to perform.\n py_sub_ctxs\n The list of device contexts to join.\n\n See Also\n --------\n fork, waitFor, petsc.PetscDeviceContextJoin\n\n \nSource code at petsc4py/PETSc/Device.pyx:417"); static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_25join(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_join_mode = 0; PyObject *__pyx_v_py_sub_ctxs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("join (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_join_mode,&__pyx_n_s_py_sub_ctxs,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_join_mode)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 417, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_py_sub_ctxs)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 417, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("join", 1, 2, 2, 1); __PYX_ERR(2, 417, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "join") < 0)) __PYX_ERR(2, 417, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_join_mode = values[0]; __pyx_v_py_sub_ctxs = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("join", 1, 2, 2, __pyx_nargs); __PYX_ERR(2, 417, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DeviceContext.join", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_13DeviceContext_24join(((struct PyPetscDeviceContextObject *)__pyx_v_self), __pyx_v_join_mode, __pyx_v_py_sub_ctxs); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_13DeviceContext_24join(struct PyPetscDeviceContextObject *__pyx_v_self, PyObject *__pyx_v_join_mode, PyObject *__pyx_v_py_sub_ctxs) { PetscDeviceContext *__pyx_v_np_subctx_copy; PetscDeviceContext *__pyx_v_np_subctx; PetscInt __pyx_v_nsub; PetscDeviceContextJoinMode __pyx_v_cjoin_mode; CYTHON_UNUSED PyArrayObject *__pyx_v_tmp = NULL; PetscInt __pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscDeviceContextJoinMode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_t_4; int __pyx_t_5; char const *__pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; int __pyx_t_13; PetscInt __pyx_t_14; PetscInt __pyx_t_15; PetscInt __pyx_t_16; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("join", 1); /* "petsc4py/PETSc/Device.pyx":434 * * """ * cdef PetscDeviceContext *np_subctx_copy = NULL # <<<<<<<<<<<<<< * cdef PetscDeviceContext *np_subctx = NULL * cdef PetscInt nsub = 0 */ __pyx_v_np_subctx_copy = NULL; /* "petsc4py/PETSc/Device.pyx":435 * """ * cdef PetscDeviceContext *np_subctx_copy = NULL * cdef PetscDeviceContext *np_subctx = NULL # <<<<<<<<<<<<<< * cdef PetscInt nsub = 0 * cdef PetscDeviceContextJoinMode cjoin_mode = asJoinMode(join_mode) */ __pyx_v_np_subctx = NULL; /* "petsc4py/PETSc/Device.pyx":436 * cdef PetscDeviceContext *np_subctx_copy = NULL * cdef PetscDeviceContext *np_subctx = NULL * cdef PetscInt nsub = 0 # <<<<<<<<<<<<<< * cdef PetscDeviceContextJoinMode cjoin_mode = asJoinMode(join_mode) * */ __pyx_v_nsub = 0; /* "petsc4py/PETSc/Device.pyx":437 * cdef PetscDeviceContext *np_subctx = NULL * cdef PetscInt nsub = 0 * cdef PetscDeviceContextJoinMode cjoin_mode = asJoinMode(join_mode) # <<<<<<<<<<<<<< * * tmp = oarray_p(py_sub_ctxs, &nsub, &np_subctx) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asJoinMode(__pyx_v_join_mode); if (unlikely(__pyx_t_1 == ((PetscDeviceContextJoinMode)((PetscDeviceContextJoinMode)-1L)))) __PYX_ERR(2, 437, __pyx_L1_error) __pyx_v_cjoin_mode = __pyx_t_1; /* "petsc4py/PETSc/Device.pyx":439 * cdef PetscDeviceContextJoinMode cjoin_mode = asJoinMode(join_mode) * * tmp = oarray_p(py_sub_ctxs, &nsub, &np_subctx) # <<<<<<<<<<<<<< * try: * CHKERR(PetscMalloc((nsub) * sizeof(PetscDeviceContext *), &np_subctx_copy)) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_v_py_sub_ctxs, (&__pyx_v_nsub), ((void **)(&__pyx_v_np_subctx)))); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 439, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_tmp = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/Device.pyx":440 * * tmp = oarray_p(py_sub_ctxs, &nsub, &np_subctx) * try: # <<<<<<<<<<<<<< * CHKERR(PetscMalloc((nsub) * sizeof(PetscDeviceContext *), &np_subctx_copy)) * CHKERR(PetscMemcpy(np_subctx_copy, np_subctx, (nsub) * sizeof(PetscDeviceContext *))) */ /*try:*/ { /* "petsc4py/PETSc/Device.pyx":441 * tmp = oarray_p(py_sub_ctxs, &nsub, &np_subctx) * try: * CHKERR(PetscMalloc((nsub) * sizeof(PetscDeviceContext *), &np_subctx_copy)) # <<<<<<<<<<<<<< * CHKERR(PetscMemcpy(np_subctx_copy, np_subctx, (nsub) * sizeof(PetscDeviceContext *))) * CHKERR(PetscDeviceContextJoin(self.dctx, nsub, cjoin_mode, &np_subctx_copy)) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((((size_t)__pyx_v_nsub) * (sizeof(PetscDeviceContext *))), (&__pyx_v_np_subctx_copy))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(2, 441, __pyx_L4_error) /* "petsc4py/PETSc/Device.pyx":442 * try: * CHKERR(PetscMalloc((nsub) * sizeof(PetscDeviceContext *), &np_subctx_copy)) * CHKERR(PetscMemcpy(np_subctx_copy, np_subctx, (nsub) * sizeof(PetscDeviceContext *))) # <<<<<<<<<<<<<< * CHKERR(PetscDeviceContextJoin(self.dctx, nsub, cjoin_mode, &np_subctx_copy)) * finally: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMemcpy(__pyx_v_np_subctx_copy, __pyx_v_np_subctx, (((size_t)__pyx_v_nsub) * (sizeof(PetscDeviceContext *))))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(2, 442, __pyx_L4_error) /* "petsc4py/PETSc/Device.pyx":443 * CHKERR(PetscMalloc((nsub) * sizeof(PetscDeviceContext *), &np_subctx_copy)) * CHKERR(PetscMemcpy(np_subctx_copy, np_subctx, (nsub) * sizeof(PetscDeviceContext *))) * CHKERR(PetscDeviceContextJoin(self.dctx, nsub, cjoin_mode, &np_subctx_copy)) # <<<<<<<<<<<<<< * finally: * CHKERR(PetscFree(np_subctx_copy)) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDeviceContextJoin(__pyx_v_self->dctx, __pyx_v_nsub, __pyx_v_cjoin_mode, (&__pyx_v_np_subctx_copy))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(2, 443, __pyx_L4_error) } /* "petsc4py/PETSc/Device.pyx":445 * CHKERR(PetscDeviceContextJoin(self.dctx, nsub, cjoin_mode, &np_subctx_copy)) * finally: * CHKERR(PetscFree(np_subctx_copy)) # <<<<<<<<<<<<<< * * if cjoin_mode == PETSC_DEVICE_CONTEXT_JOIN_DESTROY: */ /*finally:*/ { /*normal exit:*/{ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_np_subctx_copy)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(2, 445, __pyx_L1_error) goto __pyx_L5; } __pyx_L4_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename; { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_np_subctx_copy)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(2, 445, __pyx_L7_error) } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); } __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9); __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6; goto __pyx_L1_error; __pyx_L7_error:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); } __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; goto __pyx_L1_error; } __pyx_L5:; } /* "petsc4py/PETSc/Device.pyx":447 * CHKERR(PetscFree(np_subctx_copy)) * * if cjoin_mode == PETSC_DEVICE_CONTEXT_JOIN_DESTROY: # <<<<<<<<<<<<<< * for i in range(nsub): * py_sub_ctxs[i] = None */ __pyx_t_13 = (__pyx_v_cjoin_mode == PETSC_DEVICE_CONTEXT_JOIN_DESTROY); if (__pyx_t_13) { /* "petsc4py/PETSc/Device.pyx":448 * * if cjoin_mode == PETSC_DEVICE_CONTEXT_JOIN_DESTROY: * for i in range(nsub): # <<<<<<<<<<<<<< * py_sub_ctxs[i] = None * */ __pyx_t_14 = __pyx_v_nsub; __pyx_t_15 = __pyx_t_14; for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { __pyx_v_i = __pyx_t_16; /* "petsc4py/PETSc/Device.pyx":449 * if cjoin_mode == PETSC_DEVICE_CONTEXT_JOIN_DESTROY: * for i in range(nsub): * py_sub_ctxs[i] = None # <<<<<<<<<<<<<< * * def synchronize(self) -> None: */ if (unlikely((__Pyx_SetItemInt(__pyx_v_py_sub_ctxs, __pyx_v_i, Py_None, PetscInt, 1, __Pyx_PyInt_From_PetscInt, 0, 1, 1) < 0))) __PYX_ERR(2, 449, __pyx_L1_error) } /* "petsc4py/PETSc/Device.pyx":447 * CHKERR(PetscFree(np_subctx_copy)) * * if cjoin_mode == PETSC_DEVICE_CONTEXT_JOIN_DESTROY: # <<<<<<<<<<<<<< * for i in range(nsub): * py_sub_ctxs[i] = None */ } /* "petsc4py/PETSc/Device.pyx":417 * CHKERR(PetscFree(subctx)) * * def join(self, join_mode: DeviceJoinMode | str, py_sub_ctxs: list[DeviceContext]) -> None: # <<<<<<<<<<<<<< * """Join a set of device contexts on this one. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DeviceContext.join", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_tmp); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Device.pyx":451 * py_sub_ctxs[i] = None * * def synchronize(self) -> None: # <<<<<<<<<<<<<< * """Synchronize a device context. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_27synchronize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_13DeviceContext_26synchronize, "DeviceContext.synchronize(self) -> None\nSynchronize a device context.\n\n Not collective.\n\n Notes\n -----\n The underlying stream is considered idle after this routine returns,\n i.e. `idle` will return ``True``.\n\n See Also\n --------\n idle, petsc.PetscDeviceContextSynchronize\n\n \nSource code at petsc4py/PETSc/Device.pyx:451"); static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_27synchronize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("synchronize (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("synchronize", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "synchronize", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_13DeviceContext_26synchronize(((struct PyPetscDeviceContextObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_13DeviceContext_26synchronize(struct PyPetscDeviceContextObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("synchronize", 1); /* "petsc4py/PETSc/Device.pyx":466 * * """ * CHKERR(PetscDeviceContextSynchronize(self.dctx)) # <<<<<<<<<<<<<< * * def setFromOptions(self, comm: Comm | None = None) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDeviceContextSynchronize(__pyx_v_self->dctx)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(2, 466, __pyx_L1_error) /* "petsc4py/PETSc/Device.pyx":451 * py_sub_ctxs[i] = None * * def synchronize(self) -> None: # <<<<<<<<<<<<<< * """Synchronize a device context. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DeviceContext.synchronize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Device.pyx":468 * CHKERR(PetscDeviceContextSynchronize(self.dctx)) * * def setFromOptions(self, comm: Comm | None = None) -> None: # <<<<<<<<<<<<<< * """Configure the `DeviceContext` from the options database. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_29setFromOptions(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_13DeviceContext_28setFromOptions, "DeviceContext.setFromOptions(self, comm: Comm | None = None) -> None\nConfigure the `DeviceContext` from the options database.\n\n Collective.\n\n Parameters\n ----------\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n Sys.getDefaultComm, petsc.PetscDeviceContextSetFromOptions\n\n \nSource code at petsc4py/PETSc/Device.pyx:468"); static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_29setFromOptions(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFromOptions (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 468, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setFromOptions") < 0)) __PYX_ERR(2, 468, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_comm = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setFromOptions", 0, 0, 1, __pyx_nargs); __PYX_ERR(2, 468, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DeviceContext.setFromOptions", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_13DeviceContext_28setFromOptions(((struct PyPetscDeviceContextObject *)__pyx_v_self), __pyx_v_comm); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_13DeviceContext_28setFromOptions(struct PyPetscDeviceContextObject *__pyx_v_self, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFromOptions", 1); /* "petsc4py/PETSc/Device.pyx":483 * * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * * CHKERR(PetscDeviceContextSetFromOptions(ccomm, self.dctx)) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(2, 483, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/Device.pyx":485 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * * CHKERR(PetscDeviceContextSetFromOptions(ccomm, self.dctx)) # <<<<<<<<<<<<<< * * @staticmethod */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDeviceContextSetFromOptions(__pyx_v_ccomm, __pyx_v_self->dctx)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(2, 485, __pyx_L1_error) /* "petsc4py/PETSc/Device.pyx":468 * CHKERR(PetscDeviceContextSynchronize(self.dctx)) * * def setFromOptions(self, comm: Comm | None = None) -> None: # <<<<<<<<<<<<<< * """Configure the `DeviceContext` from the options database. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DeviceContext.setFromOptions", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Device.pyx":487 * CHKERR(PetscDeviceContextSetFromOptions(ccomm, self.dctx)) * * @staticmethod # <<<<<<<<<<<<<< * def getCurrent() -> DeviceContext: * """Return the current device context. */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_31getCurrent(CYTHON_UNUSED PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_13DeviceContext_30getCurrent, "DeviceContext.getCurrent() -> DeviceContext\nReturn the current device context.\n\n Not collective.\n\n See Also\n --------\n current, setCurrent, petsc.PetscDeviceContextGetCurrentContext\n\n \nSource code at petsc4py/PETSc/Device.pyx:487"); static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_13DeviceContext_31getCurrent = {"getCurrent", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13DeviceContext_31getCurrent, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13DeviceContext_30getCurrent}; static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_31getCurrent(CYTHON_UNUSED PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getCurrent (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getCurrent", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getCurrent", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_13DeviceContext_30getCurrent(); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_13DeviceContext_30getCurrent(void) { PetscDeviceContext __pyx_v_dctx; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getCurrent", 1); /* "petsc4py/PETSc/Device.pyx":498 * * """ * cdef PetscDeviceContext dctx = NULL # <<<<<<<<<<<<<< * * CHKERR(PetscDeviceContextGetCurrentContext(&dctx)) */ __pyx_v_dctx = NULL; /* "petsc4py/PETSc/Device.pyx":500 * cdef PetscDeviceContext dctx = NULL * * CHKERR(PetscDeviceContextGetCurrentContext(&dctx)) # <<<<<<<<<<<<<< * return PyPetscDeviceContext_New(dctx) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDeviceContextGetCurrentContext((&__pyx_v_dctx))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(2, 500, __pyx_L1_error) /* "petsc4py/PETSc/Device.pyx":501 * * CHKERR(PetscDeviceContextGetCurrentContext(&dctx)) * return PyPetscDeviceContext_New(dctx) # <<<<<<<<<<<<<< * * @staticmethod */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyPetscDeviceContext_New(__pyx_v_dctx)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Device.pyx":487 * CHKERR(PetscDeviceContextSetFromOptions(ccomm, self.dctx)) * * @staticmethod # <<<<<<<<<<<<<< * def getCurrent() -> DeviceContext: * """Return the current device context. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DeviceContext.getCurrent", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Device.pyx":503 * return PyPetscDeviceContext_New(dctx) * * @staticmethod # <<<<<<<<<<<<<< * def setCurrent(dctx: DeviceContext | None) -> None: * """Set the current device context. */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_33setCurrent(CYTHON_UNUSED PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_13DeviceContext_32setCurrent, "DeviceContext.setCurrent(dctx: DeviceContext | None) -> None\nSet the current device context.\n\n Not collective.\n\n Parameters\n ----------\n dctx\n The `DeviceContext` to set as current (or `None` to use\n the default context).\n\n See Also\n --------\n current, getCurrent, petsc.PetscDeviceContextSetCurrentContext\n\n \nSource code at petsc4py/PETSc/Device.pyx:503"); static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_13DeviceContext_33setCurrent = {"setCurrent", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13DeviceContext_33setCurrent, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13DeviceContext_32setCurrent}; static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_33setCurrent(CYTHON_UNUSED PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_dctx = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setCurrent (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dctx,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dctx)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 503, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setCurrent") < 0)) __PYX_ERR(2, 503, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_dctx = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setCurrent", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 503, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DeviceContext.setCurrent", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_13DeviceContext_32setCurrent(__pyx_v_dctx); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_13DeviceContext_32setCurrent(PyObject *__pyx_v_dctx) { PetscDeviceContext __pyx_v_cdctx; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscDeviceContext __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setCurrent", 1); /* "petsc4py/PETSc/Device.pyx":520 * * """ * cdef PetscDeviceContext cdctx = NULL # <<<<<<<<<<<<<< * * if dctx is not None: */ __pyx_v_cdctx = NULL; /* "petsc4py/PETSc/Device.pyx":522 * cdef PetscDeviceContext cdctx = NULL * * if dctx is not None: # <<<<<<<<<<<<<< * cdctx = PyPetscDeviceContext_Get(dctx) * CHKERR(PetscDeviceContextSetCurrentContext(cdctx)) */ __pyx_t_1 = (__pyx_v_dctx != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/Device.pyx":523 * * if dctx is not None: * cdctx = PyPetscDeviceContext_Get(dctx) # <<<<<<<<<<<<<< * CHKERR(PetscDeviceContextSetCurrentContext(cdctx)) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_PyPetscDeviceContext_Get(__pyx_v_dctx); if (unlikely(__pyx_t_2 == ((PetscDeviceContext)NULL) && PyErr_Occurred())) __PYX_ERR(2, 523, __pyx_L1_error) __pyx_v_cdctx = __pyx_t_2; /* "petsc4py/PETSc/Device.pyx":522 * cdef PetscDeviceContext cdctx = NULL * * if dctx is not None: # <<<<<<<<<<<<<< * cdctx = PyPetscDeviceContext_Get(dctx) * CHKERR(PetscDeviceContextSetCurrentContext(cdctx)) */ } /* "petsc4py/PETSc/Device.pyx":524 * if dctx is not None: * cdctx = PyPetscDeviceContext_Get(dctx) * CHKERR(PetscDeviceContextSetCurrentContext(cdctx)) # <<<<<<<<<<<<<< * * property stream_type: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDeviceContextSetCurrentContext(__pyx_v_cdctx)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(2, 524, __pyx_L1_error) /* "petsc4py/PETSc/Device.pyx":503 * return PyPetscDeviceContext_New(dctx) * * @staticmethod # <<<<<<<<<<<<<< * def setCurrent(dctx: DeviceContext | None) -> None: * """Set the current device context. */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DeviceContext.setCurrent", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Device.pyx":528 * property stream_type: * """The stream type.""" * def __get__(self) -> str: # <<<<<<<<<<<<<< * return self.getStreamType() * def __set__(self, stype: StreamType | str) -> None: */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_11stream_type_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_11stream_type_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_13DeviceContext_11stream_type___get__(((struct PyPetscDeviceContextObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_13DeviceContext_11stream_type___get__(struct PyPetscDeviceContextObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/Device.pyx":529 * """The stream type.""" * def __get__(self) -> str: * return self.getStreamType() # <<<<<<<<<<<<<< * def __set__(self, stype: StreamType | str) -> None: * self.setStreamType(stype) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getStreamType); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 529, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 529, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Device.pyx":528 * property stream_type: * """The stream type.""" * def __get__(self) -> str: # <<<<<<<<<<<<<< * return self.getStreamType() * def __set__(self, stype: StreamType | str) -> None: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DeviceContext.stream_type.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Device.pyx":530 * def __get__(self) -> str: * return self.getStreamType() * def __set__(self, stype: StreamType | str) -> None: # <<<<<<<<<<<<<< * self.setStreamType(stype) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_13DeviceContext_11stream_type_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_stype); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_13DeviceContext_11stream_type_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_stype) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_13DeviceContext_11stream_type_2__set__(((struct PyPetscDeviceContextObject *)__pyx_v_self), ((PyObject *)__pyx_v_stype)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_13DeviceContext_11stream_type_2__set__(struct PyPetscDeviceContextObject *__pyx_v_self, PyObject *__pyx_v_stype) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "petsc4py/PETSc/Device.pyx":531 * return self.getStreamType() * def __set__(self, stype: StreamType | str) -> None: * self.setStreamType(stype) # <<<<<<<<<<<<<< * * property device: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setStreamType); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_stype}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Device.pyx":530 * def __get__(self) -> str: * return self.getStreamType() * def __set__(self, stype: StreamType | str) -> None: # <<<<<<<<<<<<<< * self.setStreamType(stype) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DeviceContext.stream_type.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Device.pyx":535 * property device: * """The device associated to the device context.""" * def __get__(self) -> Device: # <<<<<<<<<<<<<< * return self.getDevice() * def __set__(self, Device device) -> None: */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_6device_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_6device_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_13DeviceContext_6device___get__(((struct PyPetscDeviceContextObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_13DeviceContext_6device___get__(struct PyPetscDeviceContextObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/Device.pyx":536 * """The device associated to the device context.""" * def __get__(self) -> Device: * return self.getDevice() # <<<<<<<<<<<<<< * def __set__(self, Device device) -> None: * self.setDevice(device) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getDevice); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 536, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 536, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Device.pyx":535 * property device: * """The device associated to the device context.""" * def __get__(self) -> Device: # <<<<<<<<<<<<<< * return self.getDevice() * def __set__(self, Device device) -> None: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DeviceContext.device.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Device.pyx":537 * def __get__(self) -> Device: * return self.getDevice() * def __set__(self, Device device) -> None: # <<<<<<<<<<<<<< * self.setDevice(device) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_13DeviceContext_6device_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_device); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_13DeviceContext_6device_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_device) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_device), __pyx_ptype_8petsc4py_5PETSc_Device, 0, "device", 0))) __PYX_ERR(2, 537, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_13DeviceContext_6device_2__set__(((struct PyPetscDeviceContextObject *)__pyx_v_self), ((struct PyPetscDeviceObject *)__pyx_v_device)); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_13DeviceContext_6device_2__set__(struct PyPetscDeviceContextObject *__pyx_v_self, struct PyPetscDeviceObject *__pyx_v_device) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "petsc4py/PETSc/Device.pyx":538 * return self.getDevice() * def __set__(self, Device device) -> None: * self.setDevice(device) # <<<<<<<<<<<<<< * * property current: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setDevice); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_v_device)}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Device.pyx":537 * def __get__(self) -> Device: * return self.getDevice() * def __set__(self, Device device) -> None: # <<<<<<<<<<<<<< * self.setDevice(device) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DeviceContext.device.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Device.pyx":542 * property current: * """The current global device context.""" * def __get__(self) -> DeviceContext: # <<<<<<<<<<<<<< * return self.getCurrent() * def __set__(self, dctx: DeviceContext | None) -> None: */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_7current_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_7current_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_13DeviceContext_7current___get__(((struct PyPetscDeviceContextObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_13DeviceContext_7current___get__(struct PyPetscDeviceContextObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/Device.pyx":543 * """The current global device context.""" * def __get__(self) -> DeviceContext: * return self.getCurrent() # <<<<<<<<<<<<<< * def __set__(self, dctx: DeviceContext | None) -> None: * self.setCurrent(dctx) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getCurrent); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Device.pyx":542 * property current: * """The current global device context.""" * def __get__(self) -> DeviceContext: # <<<<<<<<<<<<<< * return self.getCurrent() * def __set__(self, dctx: DeviceContext | None) -> None: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DeviceContext.current.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Device.pyx":544 * def __get__(self) -> DeviceContext: * return self.getCurrent() * def __set__(self, dctx: DeviceContext | None) -> None: # <<<<<<<<<<<<<< * self.setCurrent(dctx) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_13DeviceContext_7current_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_dctx); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_13DeviceContext_7current_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_dctx) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_13DeviceContext_7current_2__set__(((struct PyPetscDeviceContextObject *)__pyx_v_self), ((PyObject *)__pyx_v_dctx)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_13DeviceContext_7current_2__set__(struct PyPetscDeviceContextObject *__pyx_v_self, PyObject *__pyx_v_dctx) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "petsc4py/PETSc/Device.pyx":545 * return self.getCurrent() * def __set__(self, dctx: DeviceContext | None) -> None: * self.setCurrent(dctx) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setCurrent); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_dctx}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Device.pyx":544 * def __get__(self) -> DeviceContext: * return self.getCurrent() * def __set__(self, dctx: DeviceContext | None) -> None: # <<<<<<<<<<<<<< * self.setCurrent(dctx) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DeviceContext.current.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":26 * # * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.iset * self.iset = NULL */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_2IS_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_2IS_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS___cinit__(((struct PyPetscISObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_2IS___cinit__(struct PyPetscISObject *__pyx_v_self) { int __pyx_r; /* "petsc4py/PETSc/IS.pyx":27 * * def __cinit__(self): * self.obj = &self.iset # <<<<<<<<<<<<<< * self.iset = NULL * */ __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->iset)); /* "petsc4py/PETSc/IS.pyx":28 * def __cinit__(self): * self.obj = &self.iset * self.iset = NULL # <<<<<<<<<<<<<< * * # buffer interface (PEP 3118) */ __pyx_v_self->iset = NULL; /* "petsc4py/PETSc/IS.pyx":26 * # * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.iset * self.iset = NULL */ /* function exit code */ __pyx_r = 0; return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":32 * # buffer interface (PEP 3118) * * def __getbuffer__(self, Py_buffer *view, int flags): # <<<<<<<<<<<<<< * cdef _IS_buffer buf = _IS_buffer(self) * buf.acquirebuffer(view, flags) */ /* Python wrapper */ CYTHON_UNUSED static int __pyx_pw_8petsc4py_5PETSc_2IS_3__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_view, int __pyx_v_flags); /*proto*/ CYTHON_UNUSED static int __pyx_pw_8petsc4py_5PETSc_2IS_3__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_view, int __pyx_v_flags) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_2__getbuffer__(((struct PyPetscISObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_view), ((int)__pyx_v_flags)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_2IS_2__getbuffer__(struct PyPetscISObject *__pyx_v_self, Py_buffer *__pyx_v_view, int __pyx_v_flags) { struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_buf = 0; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; if (unlikely(__pyx_v_view == NULL)) { PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete"); return -1; } __Pyx_RefNannySetupContext("__getbuffer__", 0); __pyx_v_view->obj = Py_None; __Pyx_INCREF(Py_None); __Pyx_GIVEREF(__pyx_v_view->obj); /* "petsc4py/PETSc/IS.pyx":33 * * def __getbuffer__(self, Py_buffer *view, int flags): * cdef _IS_buffer buf = _IS_buffer(self) # <<<<<<<<<<<<<< * buf.acquirebuffer(view, flags) * */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc__IS_buffer), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_buf = ((struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/IS.pyx":34 * def __getbuffer__(self, Py_buffer *view, int flags): * cdef _IS_buffer buf = _IS_buffer(self) * buf.acquirebuffer(view, flags) # <<<<<<<<<<<<<< * * def __releasebuffer__(self, Py_buffer *view): */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__IS_buffer *)__pyx_v_buf->__pyx_vtab)->acquirebuffer(__pyx_v_buf, __pyx_v_view, __pyx_v_flags); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(39, 34, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":32 * # buffer interface (PEP 3118) * * def __getbuffer__(self, Py_buffer *view, int flags): # <<<<<<<<<<<<<< * cdef _IS_buffer buf = _IS_buffer(self) * buf.acquirebuffer(view, flags) */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.IS.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; if (__pyx_v_view->obj != NULL) { __Pyx_GOTREF(__pyx_v_view->obj); __Pyx_DECREF(__pyx_v_view->obj); __pyx_v_view->obj = 0; } goto __pyx_L2; __pyx_L0:; if (__pyx_v_view->obj == Py_None) { __Pyx_GOTREF(__pyx_v_view->obj); __Pyx_DECREF(__pyx_v_view->obj); __pyx_v_view->obj = 0; } __pyx_L2:; __Pyx_XDECREF((PyObject *)__pyx_v_buf); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":36 * buf.acquirebuffer(view, flags) * * def __releasebuffer__(self, Py_buffer *view): # <<<<<<<<<<<<<< * cdef _IS_buffer buf = <_IS_buffer>(view.obj) * buf.releasebuffer(view) */ /* Python wrapper */ CYTHON_UNUSED static void __pyx_pw_8petsc4py_5PETSc_2IS_5__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_view); /*proto*/ CYTHON_UNUSED static void __pyx_pw_8petsc4py_5PETSc_2IS_5__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_view) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_pf_8petsc4py_5PETSc_2IS_4__releasebuffer__(((struct PyPetscISObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_view)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_8petsc4py_5PETSc_2IS_4__releasebuffer__(struct PyPetscISObject *__pyx_v_self, Py_buffer *__pyx_v_view) { struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_buf = 0; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__releasebuffer__", 1); /* "petsc4py/PETSc/IS.pyx":37 * * def __releasebuffer__(self, Py_buffer *view): * cdef _IS_buffer buf = <_IS_buffer>(view.obj) # <<<<<<<<<<<<<< * buf.releasebuffer(view) * self # unused */ __pyx_t_1 = __pyx_v_view->obj; __Pyx_INCREF(__pyx_t_1); __pyx_v_buf = ((struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/IS.pyx":38 * def __releasebuffer__(self, Py_buffer *view): * cdef _IS_buffer buf = <_IS_buffer>(view.obj) * buf.releasebuffer(view) # <<<<<<<<<<<<<< * self # unused * */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__IS_buffer *)__pyx_v_buf->__pyx_vtab)->releasebuffer(__pyx_v_buf, __pyx_v_view); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(39, 38, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":39 * cdef _IS_buffer buf = <_IS_buffer>(view.obj) * buf.releasebuffer(view) * self # unused # <<<<<<<<<<<<<< * * */ ((void)__pyx_v_self); /* "petsc4py/PETSc/IS.pyx":36 * buf.acquirebuffer(view, flags) * * def __releasebuffer__(self, Py_buffer *view): # <<<<<<<<<<<<<< * cdef _IS_buffer buf = <_IS_buffer>(view.obj) * buf.releasebuffer(view) */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_WriteUnraisable("petsc4py.PETSc.IS.__releasebuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_buf); __Pyx_RefNannyFinishContext(); } /* "petsc4py/PETSc/IS.pyx":44 * # 'with' statement (PEP 343) * * def __enter__(self): # <<<<<<<<<<<<<< * cdef _IS_buffer buf = _IS_buffer(self) * self.set_attr('__buffer__', buf) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_7__enter__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2IS_6__enter__, "IS.__enter__(self)\nSource code at petsc4py/PETSc/IS.pyx:44"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_7__enter__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__enter__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__enter__", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_6__enter__(((struct PyPetscISObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_6__enter__(struct PyPetscISObject *__pyx_v_self) { struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_buf = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__enter__", 1); /* "petsc4py/PETSc/IS.pyx":45 * * def __enter__(self): * cdef _IS_buffer buf = _IS_buffer(self) # <<<<<<<<<<<<<< * self.set_attr('__buffer__', buf) * return buf.enter() */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc__IS_buffer), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_buf = ((struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/IS.pyx":46 * def __enter__(self): * cdef _IS_buffer buf = _IS_buffer(self) * self.set_attr('__buffer__', buf) # <<<<<<<<<<<<<< * return buf.enter() * */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_IS *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__buffer__"), ((PyObject *)__pyx_v_buf)); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/IS.pyx":47 * cdef _IS_buffer buf = _IS_buffer(self) * self.set_attr('__buffer__', buf) * return buf.enter() # <<<<<<<<<<<<<< * * def __exit__(self, *exc): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__IS_buffer *)__pyx_v_buf->__pyx_vtab)->enter(__pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/IS.pyx":44 * # 'with' statement (PEP 343) * * def __enter__(self): # <<<<<<<<<<<<<< * cdef _IS_buffer buf = _IS_buffer(self) * self.set_attr('__buffer__', buf) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.IS.__enter__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_buf); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":49 * return buf.enter() * * def __exit__(self, *exc): # <<<<<<<<<<<<<< * cdef _IS_buffer buf = self.get_attr('__buffer__') * self.set_attr('__buffer__', None) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_9__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2IS_8__exit__, "IS.__exit__(self, *exc)\nSource code at petsc4py/PETSc/IS.pyx:49"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_9__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED PyObject *__pyx_v_exc = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__exit__", 0))) return NULL; __Pyx_INCREF(__pyx_args); __pyx_v_exc = __pyx_args; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_8__exit__(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_exc); /* function exit code */ __Pyx_DECREF(__pyx_v_exc); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_8__exit__(struct PyPetscISObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc) { struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_buf = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__exit__", 1); /* "petsc4py/PETSc/IS.pyx":50 * * def __exit__(self, *exc): * cdef _IS_buffer buf = self.get_attr('__buffer__') # <<<<<<<<<<<<<< * self.set_attr('__buffer__', None) * return buf.exit() */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_IS *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__buffer__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc__IS_buffer))))) __PYX_ERR(39, 50, __pyx_L1_error) __pyx_v_buf = ((struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/IS.pyx":51 * def __exit__(self, *exc): * cdef _IS_buffer buf = self.get_attr('__buffer__') * self.set_attr('__buffer__', None) # <<<<<<<<<<<<<< * return buf.exit() * # */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_IS *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__buffer__"), Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/IS.pyx":52 * cdef _IS_buffer buf = self.get_attr('__buffer__') * self.set_attr('__buffer__', None) * return buf.exit() # <<<<<<<<<<<<<< * # * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__IS_buffer *)__pyx_v_buf->__pyx_vtab)->exit(__pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/IS.pyx":49 * return buf.enter() * * def __exit__(self, *exc): # <<<<<<<<<<<<<< * cdef _IS_buffer buf = self.get_attr('__buffer__') * self.set_attr('__buffer__', None) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.IS.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_buf); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":55 * # * * def view(self, Viewer viewer=None) -> None: # <<<<<<<<<<<<<< * """Display the index set. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_11view(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2IS_10view, "IS.view(self, viewer: Viewer | None = None) -> None\nDisplay the index set.\n\n Collective.\n\n Parameters\n ----------\n viewer\n Viewer used to display the IS.\n\n See Also\n --------\n petsc.ISView\n\n \nSource code at petsc4py/PETSc/IS.pyx:55"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_11view(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscViewerObject *__pyx_v_viewer = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("view (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscViewerObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_viewer); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 55, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "view") < 0)) __PYX_ERR(39, 55, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, __pyx_nargs); __PYX_ERR(39, 55, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.IS.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(39, 55, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_10view(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_viewer); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_10view(struct PyPetscISObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer) { PetscViewer __pyx_v_cviewer; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscViewer __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("view", 1); /* "petsc4py/PETSc/IS.pyx":70 * * """ * cdef PetscViewer cviewer = NULL # <<<<<<<<<<<<<< * if viewer is not None: cviewer = viewer.vwr * CHKERR( ISView(self.iset, cviewer) ) */ __pyx_v_cviewer = NULL; /* "petsc4py/PETSc/IS.pyx":71 * """ * cdef PetscViewer cviewer = NULL * if viewer is not None: cviewer = viewer.vwr # <<<<<<<<<<<<<< * CHKERR( ISView(self.iset, cviewer) ) * */ __pyx_t_1 = (((PyObject *)__pyx_v_viewer) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_viewer->vwr; __pyx_v_cviewer = __pyx_t_2; } /* "petsc4py/PETSc/IS.pyx":72 * cdef PetscViewer cviewer = NULL * if viewer is not None: cviewer = viewer.vwr * CHKERR( ISView(self.iset, cviewer) ) # <<<<<<<<<<<<<< * * def destroy(self) -> Self: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISView(__pyx_v_self->iset, __pyx_v_cviewer)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 72, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":55 * # * * def view(self, Viewer viewer=None) -> None: # <<<<<<<<<<<<<< * """Display the index set. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.IS.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":74 * CHKERR( ISView(self.iset, cviewer) ) * * def destroy(self) -> Self: # <<<<<<<<<<<<<< * """Destroy the index set. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_13destroy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2IS_12destroy, "IS.destroy(self) -> Self\nDestroy the index set.\n\n Collective.\n\n See Also\n --------\n petsc.ISDestroy\n\n \nSource code at petsc4py/PETSc/IS.pyx:74"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_13destroy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("destroy (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_12destroy(((struct PyPetscISObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_12destroy(struct PyPetscISObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("destroy", 1); /* "petsc4py/PETSc/IS.pyx":84 * * """ * CHKERR( ISDestroy(&self.iset) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISDestroy((&__pyx_v_self->iset))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 84, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":85 * """ * CHKERR( ISDestroy(&self.iset) ) * return self # <<<<<<<<<<<<<< * * def create(self, comm: Comm | None = None) -> Self: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/IS.pyx":74 * CHKERR( ISView(self.iset, cviewer) ) * * def destroy(self) -> Self: # <<<<<<<<<<<<<< * """Destroy the index set. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.IS.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":87 * return self * * def create(self, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Create an IS. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_15create(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2IS_14create, "IS.create(self, comm: Comm | None = None) -> Self\nCreate an IS.\n\n Collective.\n\n Parameters\n ----------\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n petsc.ISCreate\n\n \nSource code at petsc4py/PETSc/IS.pyx:87"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_15create(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 87, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "create") < 0)) __PYX_ERR(39, 87, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_comm = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, __pyx_nargs); __PYX_ERR(39, 87, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.IS.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_14create(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_comm); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_14create(struct PyPetscISObject *__pyx_v_self, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; IS __pyx_v_newiset; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create", 1); /* "petsc4py/PETSc/IS.pyx":102 * * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscIS newiset = NULL * CHKERR( ISCreate(ccomm, &newiset) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(39, 102, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/IS.pyx":103 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscIS newiset = NULL # <<<<<<<<<<<<<< * CHKERR( ISCreate(ccomm, &newiset) ) * CHKERR( PetscCLEAR(self.obj) ); self.iset = newiset */ __pyx_v_newiset = NULL; /* "petsc4py/PETSc/IS.pyx":104 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscIS newiset = NULL * CHKERR( ISCreate(ccomm, &newiset) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.iset = newiset * return self */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISCreate(__pyx_v_ccomm, (&__pyx_v_newiset))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 104, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":105 * cdef PetscIS newiset = NULL * CHKERR( ISCreate(ccomm, &newiset) ) * CHKERR( PetscCLEAR(self.obj) ); self.iset = newiset # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 105, __pyx_L1_error) __pyx_v_self->iset = __pyx_v_newiset; /* "petsc4py/PETSc/IS.pyx":106 * CHKERR( ISCreate(ccomm, &newiset) ) * CHKERR( PetscCLEAR(self.obj) ); self.iset = newiset * return self # <<<<<<<<<<<<<< * * def setType(self, is_type: IS.Type | str) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/IS.pyx":87 * return self * * def create(self, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Create an IS. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.IS.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":108 * return self * * def setType(self, is_type: IS.Type | str) -> None: # <<<<<<<<<<<<<< * """Set the type of the index set. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_17setType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2IS_16setType, "IS.setType(self, is_type: IS.Type | str) -> None\nSet the type of the index set.\n\n Collective.\n\n Parameters\n ----------\n is_type\n The index set type.\n\n See Also\n --------\n petsc.ISSetType\n\n \nSource code at petsc4py/PETSc/IS.pyx:108"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_17setType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_is_type = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_is_type,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_is_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 108, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setType") < 0)) __PYX_ERR(39, 108, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_is_type = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, __pyx_nargs); __PYX_ERR(39, 108, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.IS.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_16setType(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_is_type); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_16setType(struct PyPetscISObject *__pyx_v_self, PyObject *__pyx_v_is_type) { ISType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setType", 0); __Pyx_INCREF(__pyx_v_is_type); /* "petsc4py/PETSc/IS.pyx":123 * * """ * cdef PetscISType cval = NULL # <<<<<<<<<<<<<< * is_type = str2bytes(is_type, &cval) * CHKERR( ISSetType(self.iset, cval) ) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/IS.pyx":124 * """ * cdef PetscISType cval = NULL * is_type = str2bytes(is_type, &cval) # <<<<<<<<<<<<<< * CHKERR( ISSetType(self.iset, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_is_type, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_is_type, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/IS.pyx":125 * cdef PetscISType cval = NULL * is_type = str2bytes(is_type, &cval) * CHKERR( ISSetType(self.iset, cval) ) # <<<<<<<<<<<<<< * * def getType(self) -> str: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISSetType(__pyx_v_self->iset, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 125, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":108 * return self * * def setType(self, is_type: IS.Type | str) -> None: # <<<<<<<<<<<<<< * """Set the type of the index set. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.IS.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_is_type); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":127 * CHKERR( ISSetType(self.iset, cval) ) * * def getType(self) -> str: # <<<<<<<<<<<<<< * """Return the index set type associated with the IS. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_19getType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2IS_18getType, "IS.getType(self) -> str\nReturn the index set type associated with the IS.\n\n Not collective.\n\n See Also\n --------\n petsc.ISGetType\n\n \nSource code at petsc4py/PETSc/IS.pyx:127"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_19getType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getType", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_18getType(((struct PyPetscISObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_18getType(struct PyPetscISObject *__pyx_v_self) { ISType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getType", 1); /* "petsc4py/PETSc/IS.pyx":137 * * """ * cdef PetscISType cval = NULL # <<<<<<<<<<<<<< * CHKERR( ISGetType(self.iset, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/IS.pyx":138 * """ * cdef PetscISType cval = NULL * CHKERR( ISGetType(self.iset, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISGetType(__pyx_v_self->iset, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 138, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":139 * cdef PetscISType cval = NULL * CHKERR( ISGetType(self.iset, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * def createGeneral( */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(39, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/IS.pyx":127 * CHKERR( ISSetType(self.iset, cval) ) * * def getType(self) -> str: # <<<<<<<<<<<<<< * """Return the index set type associated with the IS. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.IS.getType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":141 * return bytes2str(cval) * * def createGeneral( # <<<<<<<<<<<<<< * self, * indices: Sequence[int], */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_21createGeneral(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2IS_20createGeneral, "IS.createGeneral(self, indices: Sequence[int], comm: Comm | None = None) -> Self\nCreate an IS with indices.\n\n Collective.\n\n Parameters\n ----------\n indices\n Integer array.\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n petsc.ISCreateGeneral\n\n \nSource code at petsc4py/PETSc/IS.pyx:141"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_21createGeneral(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_indices = 0; PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createGeneral (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_indices,&__pyx_n_s_comm,0}; /* "petsc4py/PETSc/IS.pyx":144 * self, * indices: Sequence[int], * comm: Comm | None = None # <<<<<<<<<<<<<< * ) -> Self: * """Create an IS with indices. */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_indices)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 141, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 141, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createGeneral") < 0)) __PYX_ERR(39, 141, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_indices = values[0]; __pyx_v_comm = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createGeneral", 0, 1, 2, __pyx_nargs); __PYX_ERR(39, 141, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.IS.createGeneral", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_20createGeneral(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_indices, __pyx_v_comm); /* "petsc4py/PETSc/IS.pyx":141 * return bytes2str(cval) * * def createGeneral( # <<<<<<<<<<<<<< * self, * indices: Sequence[int], */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_20createGeneral(struct PyPetscISObject *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PetscInt __pyx_v_nidx; PetscInt *__pyx_v_idx; PetscCopyMode __pyx_v_cm; IS __pyx_v_newiset; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createGeneral", 0); __Pyx_INCREF(__pyx_v_indices); /* "petsc4py/PETSc/IS.pyx":162 * * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscInt nidx = 0, *idx = NULL * cdef PetscCopyMode cm = PETSC_COPY_VALUES */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(39, 162, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/IS.pyx":163 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt nidx = 0, *idx = NULL # <<<<<<<<<<<<<< * cdef PetscCopyMode cm = PETSC_COPY_VALUES * cdef PetscIS newiset = NULL */ __pyx_v_nidx = 0; __pyx_v_idx = NULL; /* "petsc4py/PETSc/IS.pyx":164 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt nidx = 0, *idx = NULL * cdef PetscCopyMode cm = PETSC_COPY_VALUES # <<<<<<<<<<<<<< * cdef PetscIS newiset = NULL * indices = iarray_i(indices, &nidx, &idx) */ __pyx_v_cm = PETSC_COPY_VALUES; /* "petsc4py/PETSc/IS.pyx":165 * cdef PetscInt nidx = 0, *idx = NULL * cdef PetscCopyMode cm = PETSC_COPY_VALUES * cdef PetscIS newiset = NULL # <<<<<<<<<<<<<< * indices = iarray_i(indices, &nidx, &idx) * CHKERR( ISCreateGeneral(ccomm, nidx, idx, cm, &newiset) ) */ __pyx_v_newiset = NULL; /* "petsc4py/PETSc/IS.pyx":166 * cdef PetscCopyMode cm = PETSC_COPY_VALUES * cdef PetscIS newiset = NULL * indices = iarray_i(indices, &nidx, &idx) # <<<<<<<<<<<<<< * CHKERR( ISCreateGeneral(ccomm, nidx, idx, cm, &newiset) ) * CHKERR( PetscCLEAR(self.obj) ); self.iset = newiset */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_indices, (&__pyx_v_nidx), (&__pyx_v_idx))); if (unlikely(!__pyx_t_2)) __PYX_ERR(39, 166, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_indices, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/IS.pyx":167 * cdef PetscIS newiset = NULL * indices = iarray_i(indices, &nidx, &idx) * CHKERR( ISCreateGeneral(ccomm, nidx, idx, cm, &newiset) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.iset = newiset * return self */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISCreateGeneral(__pyx_v_ccomm, __pyx_v_nidx, __pyx_v_idx, __pyx_v_cm, (&__pyx_v_newiset))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 167, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":168 * indices = iarray_i(indices, &nidx, &idx) * CHKERR( ISCreateGeneral(ccomm, nidx, idx, cm, &newiset) ) * CHKERR( PetscCLEAR(self.obj) ); self.iset = newiset # <<<<<<<<<<<<<< * return self * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 168, __pyx_L1_error) __pyx_v_self->iset = __pyx_v_newiset; /* "petsc4py/PETSc/IS.pyx":169 * CHKERR( ISCreateGeneral(ccomm, nidx, idx, cm, &newiset) ) * CHKERR( PetscCLEAR(self.obj) ); self.iset = newiset * return self # <<<<<<<<<<<<<< * * def createBlock( */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/IS.pyx":141 * return bytes2str(cval) * * def createGeneral( # <<<<<<<<<<<<<< * self, * indices: Sequence[int], */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.IS.createGeneral", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_indices); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":171 * return self * * def createBlock( # <<<<<<<<<<<<<< * self, * bsize: int, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_23createBlock(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2IS_22createBlock, "IS.createBlock(self, bsize: int, indices: Sequence[int], comm: Comm | None = None) -> Self\nCreate a blocked index set.\n\n Collective.\n\n Parameters\n ----------\n bsize\n Block size.\n indices\n Integer array of indices.\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n petsc.ISCreateBlock\n\n \nSource code at petsc4py/PETSc/IS.pyx:171"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_23createBlock(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_bsize = 0; PyObject *__pyx_v_indices = 0; PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createBlock (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_bsize,&__pyx_n_s_indices,&__pyx_n_s_comm,0}; /* "petsc4py/PETSc/IS.pyx":175 * bsize: int, * indices: Sequence[int], * comm: Comm | None = None # <<<<<<<<<<<<<< * ) -> Self: * """Create a blocked index set. */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_bsize)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 171, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_indices)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 171, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("createBlock", 0, 2, 3, 1); __PYX_ERR(39, 171, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 171, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createBlock") < 0)) __PYX_ERR(39, 171, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_bsize = values[0]; __pyx_v_indices = values[1]; __pyx_v_comm = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createBlock", 0, 2, 3, __pyx_nargs); __PYX_ERR(39, 171, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.IS.createBlock", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_22createBlock(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_bsize, __pyx_v_indices, __pyx_v_comm); /* "petsc4py/PETSc/IS.pyx":171 * return self * * def createBlock( # <<<<<<<<<<<<<< * self, * bsize: int, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_22createBlock(struct PyPetscISObject *__pyx_v_self, PyObject *__pyx_v_bsize, PyObject *__pyx_v_indices, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PetscInt __pyx_v_bs; PetscInt __pyx_v_nidx; PetscInt *__pyx_v_idx; PetscCopyMode __pyx_v_cm; IS __pyx_v_newiset; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PetscInt __pyx_t_2; PyObject *__pyx_t_3 = NULL; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createBlock", 0); __Pyx_INCREF(__pyx_v_indices); /* "petsc4py/PETSc/IS.pyx":195 * * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscInt bs = asInt(bsize) * cdef PetscInt nidx = 0, *idx = NULL */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(39, 195, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/IS.pyx":196 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt bs = asInt(bsize) # <<<<<<<<<<<<<< * cdef PetscInt nidx = 0, *idx = NULL * cdef PetscCopyMode cm = PETSC_COPY_VALUES */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_bsize); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(39, 196, __pyx_L1_error) __pyx_v_bs = __pyx_t_2; /* "petsc4py/PETSc/IS.pyx":197 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt bs = asInt(bsize) * cdef PetscInt nidx = 0, *idx = NULL # <<<<<<<<<<<<<< * cdef PetscCopyMode cm = PETSC_COPY_VALUES * cdef PetscIS newiset = NULL */ __pyx_v_nidx = 0; __pyx_v_idx = NULL; /* "petsc4py/PETSc/IS.pyx":198 * cdef PetscInt bs = asInt(bsize) * cdef PetscInt nidx = 0, *idx = NULL * cdef PetscCopyMode cm = PETSC_COPY_VALUES # <<<<<<<<<<<<<< * cdef PetscIS newiset = NULL * indices = iarray_i(indices, &nidx, &idx) */ __pyx_v_cm = PETSC_COPY_VALUES; /* "petsc4py/PETSc/IS.pyx":199 * cdef PetscInt nidx = 0, *idx = NULL * cdef PetscCopyMode cm = PETSC_COPY_VALUES * cdef PetscIS newiset = NULL # <<<<<<<<<<<<<< * indices = iarray_i(indices, &nidx, &idx) * CHKERR( ISCreateBlock(ccomm, bs, nidx, idx, cm, &newiset) ) */ __pyx_v_newiset = NULL; /* "petsc4py/PETSc/IS.pyx":200 * cdef PetscCopyMode cm = PETSC_COPY_VALUES * cdef PetscIS newiset = NULL * indices = iarray_i(indices, &nidx, &idx) # <<<<<<<<<<<<<< * CHKERR( ISCreateBlock(ccomm, bs, nidx, idx, cm, &newiset) ) * CHKERR( PetscCLEAR(self.obj) ); self.iset = newiset */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_indices, (&__pyx_v_nidx), (&__pyx_v_idx))); if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_indices, __pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/IS.pyx":201 * cdef PetscIS newiset = NULL * indices = iarray_i(indices, &nidx, &idx) * CHKERR( ISCreateBlock(ccomm, bs, nidx, idx, cm, &newiset) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.iset = newiset * return self */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISCreateBlock(__pyx_v_ccomm, __pyx_v_bs, __pyx_v_nidx, __pyx_v_idx, __pyx_v_cm, (&__pyx_v_newiset))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 201, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":202 * indices = iarray_i(indices, &nidx, &idx) * CHKERR( ISCreateBlock(ccomm, bs, nidx, idx, cm, &newiset) ) * CHKERR( PetscCLEAR(self.obj) ); self.iset = newiset # <<<<<<<<<<<<<< * return self * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 202, __pyx_L1_error) __pyx_v_self->iset = __pyx_v_newiset; /* "petsc4py/PETSc/IS.pyx":203 * CHKERR( ISCreateBlock(ccomm, bs, nidx, idx, cm, &newiset) ) * CHKERR( PetscCLEAR(self.obj) ); self.iset = newiset * return self # <<<<<<<<<<<<<< * * def createStride( */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/IS.pyx":171 * return self * * def createBlock( # <<<<<<<<<<<<<< * self, * bsize: int, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.IS.createBlock", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_indices); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":205 * return self * * def createStride( # <<<<<<<<<<<<<< * self, * size: int, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_25createStride(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2IS_24createStride, "IS.createStride(self, size: int, first: int = 0, step: int = 0, comm: Comm | None = None) -> Self\nCreate an index set consisting of evenly spaced values.\n\n Collective.\n\n Parameters\n ----------\n size\n The length of the locally owned portion of the index set.\n first\n The first element of the index set.\n step\n The difference between adjacent indices.\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n petsc.ISCreateStride\n\n \nSource code at petsc4py/PETSc/IS.pyx:205"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_25createStride(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_size = 0; PyObject *__pyx_v_first = 0; PyObject *__pyx_v_step = 0; PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createStride (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_first,&__pyx_n_s_step,&__pyx_n_s_comm,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_0)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_0)); /* "petsc4py/PETSc/IS.pyx":210 * first: int=0, * step: int=0, * comm: Comm | None = None # <<<<<<<<<<<<<< * ) -> Self: * """Create an index set consisting of evenly spaced values. */ values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 205, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_first); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 205, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_step); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 205, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 205, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createStride") < 0)) __PYX_ERR(39, 205, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_size = values[0]; __pyx_v_first = values[1]; __pyx_v_step = values[2]; __pyx_v_comm = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createStride", 0, 1, 4, __pyx_nargs); __PYX_ERR(39, 205, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.IS.createStride", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_24createStride(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_size, __pyx_v_first, __pyx_v_step, __pyx_v_comm); /* "petsc4py/PETSc/IS.pyx":205 * return self * * def createStride( # <<<<<<<<<<<<<< * self, * size: int, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_24createStride(struct PyPetscISObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_first, PyObject *__pyx_v_step, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PetscInt __pyx_v_csize; PetscInt __pyx_v_cfirst; PetscInt __pyx_v_cstep; IS __pyx_v_newiset; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PetscInt __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createStride", 1); /* "petsc4py/PETSc/IS.pyx":232 * * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscInt csize = asInt(size) * cdef PetscInt cfirst = asInt(first) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(39, 232, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/IS.pyx":233 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt csize = asInt(size) # <<<<<<<<<<<<<< * cdef PetscInt cfirst = asInt(first) * cdef PetscInt cstep = asInt(step) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_size); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(39, 233, __pyx_L1_error) __pyx_v_csize = __pyx_t_2; /* "petsc4py/PETSc/IS.pyx":234 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt csize = asInt(size) * cdef PetscInt cfirst = asInt(first) # <<<<<<<<<<<<<< * cdef PetscInt cstep = asInt(step) * cdef PetscIS newiset = NULL */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_first); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(39, 234, __pyx_L1_error) __pyx_v_cfirst = __pyx_t_2; /* "petsc4py/PETSc/IS.pyx":235 * cdef PetscInt csize = asInt(size) * cdef PetscInt cfirst = asInt(first) * cdef PetscInt cstep = asInt(step) # <<<<<<<<<<<<<< * cdef PetscIS newiset = NULL * CHKERR( ISCreateStride(ccomm, csize, cfirst, cstep, &newiset) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_step); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(39, 235, __pyx_L1_error) __pyx_v_cstep = __pyx_t_2; /* "petsc4py/PETSc/IS.pyx":236 * cdef PetscInt cfirst = asInt(first) * cdef PetscInt cstep = asInt(step) * cdef PetscIS newiset = NULL # <<<<<<<<<<<<<< * CHKERR( ISCreateStride(ccomm, csize, cfirst, cstep, &newiset) ) * CHKERR( PetscCLEAR(self.obj) ); self.iset = newiset */ __pyx_v_newiset = NULL; /* "petsc4py/PETSc/IS.pyx":237 * cdef PetscInt cstep = asInt(step) * cdef PetscIS newiset = NULL * CHKERR( ISCreateStride(ccomm, csize, cfirst, cstep, &newiset) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.iset = newiset * return self */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISCreateStride(__pyx_v_ccomm, __pyx_v_csize, __pyx_v_cfirst, __pyx_v_cstep, (&__pyx_v_newiset))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 237, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":238 * cdef PetscIS newiset = NULL * CHKERR( ISCreateStride(ccomm, csize, cfirst, cstep, &newiset) ) * CHKERR( PetscCLEAR(self.obj) ); self.iset = newiset # <<<<<<<<<<<<<< * return self * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 238, __pyx_L1_error) __pyx_v_self->iset = __pyx_v_newiset; /* "petsc4py/PETSc/IS.pyx":239 * CHKERR( ISCreateStride(ccomm, csize, cfirst, cstep, &newiset) ) * CHKERR( PetscCLEAR(self.obj) ); self.iset = newiset * return self # <<<<<<<<<<<<<< * * def duplicate(self) -> IS: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/IS.pyx":205 * return self * * def createStride( # <<<<<<<<<<<<<< * self, * size: int, */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.IS.createStride", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":241 * return self * * def duplicate(self) -> IS: # <<<<<<<<<<<<<< * """Create a copy of the index set. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_27duplicate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2IS_26duplicate, "IS.duplicate(self) -> IS\nCreate a copy of the index set.\n\n Collective.\n\n See Also\n --------\n IS.copy, petsc.ISDuplicate\n\n \nSource code at petsc4py/PETSc/IS.pyx:241"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_27duplicate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("duplicate (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("duplicate", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "duplicate", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_26duplicate(((struct PyPetscISObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_26duplicate(struct PyPetscISObject *__pyx_v_self) { struct PyPetscISObject *__pyx_v_iset = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PetscErrorCode __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("duplicate", 1); /* "petsc4py/PETSc/IS.pyx":251 * * """ * cdef IS iset = type(self)() # <<<<<<<<<<<<<< * CHKERR( ISDuplicate(self.iset, &iset.iset) ) * return iset */ __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __pyx_t_2 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_IS))))) __PYX_ERR(39, 251, __pyx_L1_error) __pyx_v_iset = ((struct PyPetscISObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/IS.pyx":252 * """ * cdef IS iset = type(self)() * CHKERR( ISDuplicate(self.iset, &iset.iset) ) # <<<<<<<<<<<<<< * return iset * */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISDuplicate(__pyx_v_self->iset, (&__pyx_v_iset->iset))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 252, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":253 * cdef IS iset = type(self)() * CHKERR( ISDuplicate(self.iset, &iset.iset) ) * return iset # <<<<<<<<<<<<<< * * def copy(self, IS result=None) -> IS: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_iset); __pyx_r = ((PyObject *)__pyx_v_iset); goto __pyx_L0; /* "petsc4py/PETSc/IS.pyx":241 * return self * * def duplicate(self) -> IS: # <<<<<<<<<<<<<< * """Create a copy of the index set. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.IS.duplicate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_iset); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":255 * return iset * * def copy(self, IS result=None) -> IS: # <<<<<<<<<<<<<< * """Copy the contents of the index set into another. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_29copy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2IS_28copy, "IS.copy(self, result: IS | None = None) -> IS\nCopy the contents of the index set into another.\n\n Collective.\n\n Parameters\n ----------\n result\n The target index set. If `None` then `IS.duplicate` is called first.\n\n Returns\n -------\n IS\n The copied index set. If ``result`` is not `None` then this is\n returned here.\n\n See Also\n --------\n IS.duplicate, petsc.ISCopy\n\n \nSource code at petsc4py/PETSc/IS.pyx:255"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_29copy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscISObject *__pyx_v_result = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("copy (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_result,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscISObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_result); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 255, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "copy") < 0)) __PYX_ERR(39, 255, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_result = ((struct PyPetscISObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("copy", 0, 0, 1, __pyx_nargs); __PYX_ERR(39, 255, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.IS.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_result), __pyx_ptype_8petsc4py_5PETSc_IS, 1, "result", 0))) __PYX_ERR(39, 255, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_28copy(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_result); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_28copy(struct PyPetscISObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_result) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PetscErrorCode __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("copy", 0); __Pyx_INCREF((PyObject *)__pyx_v_result); /* "petsc4py/PETSc/IS.pyx":276 * * """ * if result is None: # <<<<<<<<<<<<<< * result = type(self)() * if result.iset == NULL: */ __pyx_t_1 = (((PyObject *)__pyx_v_result) == Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/IS.pyx":277 * """ * if result is None: * result = type(self)() # <<<<<<<<<<<<<< * if result.iset == NULL: * CHKERR( ISDuplicate(self.iset, &result.iset) ) */ __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __pyx_t_3 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(39, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_IS))))) __PYX_ERR(39, 277, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_result, ((struct PyPetscISObject *)__pyx_t_2)); __pyx_t_2 = 0; /* "petsc4py/PETSc/IS.pyx":276 * * """ * if result is None: # <<<<<<<<<<<<<< * result = type(self)() * if result.iset == NULL: */ } /* "petsc4py/PETSc/IS.pyx":278 * if result is None: * result = type(self)() * if result.iset == NULL: # <<<<<<<<<<<<<< * CHKERR( ISDuplicate(self.iset, &result.iset) ) * CHKERR( ISCopy(self.iset, result.iset) ) */ __pyx_t_1 = (__pyx_v_result->iset == NULL); if (__pyx_t_1) { /* "petsc4py/PETSc/IS.pyx":279 * result = type(self)() * if result.iset == NULL: * CHKERR( ISDuplicate(self.iset, &result.iset) ) # <<<<<<<<<<<<<< * CHKERR( ISCopy(self.iset, result.iset) ) * return result */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISDuplicate(__pyx_v_self->iset, (&__pyx_v_result->iset))); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 279, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":278 * if result is None: * result = type(self)() * if result.iset == NULL: # <<<<<<<<<<<<<< * CHKERR( ISDuplicate(self.iset, &result.iset) ) * CHKERR( ISCopy(self.iset, result.iset) ) */ } /* "petsc4py/PETSc/IS.pyx":280 * if result.iset == NULL: * CHKERR( ISDuplicate(self.iset, &result.iset) ) * CHKERR( ISCopy(self.iset, result.iset) ) # <<<<<<<<<<<<<< * return result * */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISCopy(__pyx_v_self->iset, __pyx_v_result->iset)); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 280, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":281 * CHKERR( ISDuplicate(self.iset, &result.iset) ) * CHKERR( ISCopy(self.iset, result.iset) ) * return result # <<<<<<<<<<<<<< * * def load(self, Viewer viewer) -> Self: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_result); __pyx_r = ((PyObject *)__pyx_v_result); goto __pyx_L0; /* "petsc4py/PETSc/IS.pyx":255 * return iset * * def copy(self, IS result=None) -> IS: # <<<<<<<<<<<<<< * """Copy the contents of the index set into another. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.IS.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":283 * return result * * def load(self, Viewer viewer) -> Self: # <<<<<<<<<<<<<< * """Load a stored index set. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_31load(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2IS_30load, "IS.load(self, viewer: Viewer) -> Self\nLoad a stored index set.\n\n Collective.\n\n Parameters\n ----------\n viewer\n Binary file viewer, either `Viewer.Type.BINARY` or `Viewer.Type.HDF5`.\n\n See Also\n --------\n petsc.ISLoad\n\n \nSource code at petsc4py/PETSc/IS.pyx:283"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_31load(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscViewerObject *__pyx_v_viewer = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("load (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_viewer)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 283, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "load") < 0)) __PYX_ERR(39, 283, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("load", 1, 1, 1, __pyx_nargs); __PYX_ERR(39, 283, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.IS.load", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 0, "viewer", 0))) __PYX_ERR(39, 283, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_30load(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_viewer); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_30load(struct PyPetscISObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer) { MPI_Comm __pyx_v_comm; PetscObject __pyx_v_obj; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("load", 1); /* "petsc4py/PETSc/IS.pyx":298 * * """ * cdef MPI_Comm comm = MPI_COMM_NULL # <<<<<<<<<<<<<< * cdef PetscObject obj = (viewer.vwr) * if self.iset == NULL: */ __pyx_v_comm = MPI_COMM_NULL; /* "petsc4py/PETSc/IS.pyx":299 * """ * cdef MPI_Comm comm = MPI_COMM_NULL * cdef PetscObject obj = (viewer.vwr) # <<<<<<<<<<<<<< * if self.iset == NULL: * CHKERR( PetscObjectGetComm(obj, &comm) ) */ __pyx_v_obj = ((PetscObject)__pyx_v_viewer->vwr); /* "petsc4py/PETSc/IS.pyx":300 * cdef MPI_Comm comm = MPI_COMM_NULL * cdef PetscObject obj = (viewer.vwr) * if self.iset == NULL: # <<<<<<<<<<<<<< * CHKERR( PetscObjectGetComm(obj, &comm) ) * CHKERR( ISCreate(comm, &self.iset) ) */ __pyx_t_1 = (__pyx_v_self->iset == NULL); if (__pyx_t_1) { /* "petsc4py/PETSc/IS.pyx":301 * cdef PetscObject obj = (viewer.vwr) * if self.iset == NULL: * CHKERR( PetscObjectGetComm(obj, &comm) ) # <<<<<<<<<<<<<< * CHKERR( ISCreate(comm, &self.iset) ) * CHKERR( ISLoad(self.iset, viewer.vwr) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectGetComm(__pyx_v_obj, (&__pyx_v_comm))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 301, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":302 * if self.iset == NULL: * CHKERR( PetscObjectGetComm(obj, &comm) ) * CHKERR( ISCreate(comm, &self.iset) ) # <<<<<<<<<<<<<< * CHKERR( ISLoad(self.iset, viewer.vwr) ) * return self */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISCreate(__pyx_v_comm, (&__pyx_v_self->iset))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 302, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":300 * cdef MPI_Comm comm = MPI_COMM_NULL * cdef PetscObject obj = (viewer.vwr) * if self.iset == NULL: # <<<<<<<<<<<<<< * CHKERR( PetscObjectGetComm(obj, &comm) ) * CHKERR( ISCreate(comm, &self.iset) ) */ } /* "petsc4py/PETSc/IS.pyx":303 * CHKERR( PetscObjectGetComm(obj, &comm) ) * CHKERR( ISCreate(comm, &self.iset) ) * CHKERR( ISLoad(self.iset, viewer.vwr) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISLoad(__pyx_v_self->iset, __pyx_v_viewer->vwr)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 303, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":304 * CHKERR( ISCreate(comm, &self.iset) ) * CHKERR( ISLoad(self.iset, viewer.vwr) ) * return self # <<<<<<<<<<<<<< * * def allGather(self) -> IS: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/IS.pyx":283 * return result * * def load(self, Viewer viewer) -> Self: # <<<<<<<<<<<<<< * """Load a stored index set. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.IS.load", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":306 * return self * * def allGather(self) -> IS: # <<<<<<<<<<<<<< * """Concatenate index sets stored across processors. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_33allGather(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2IS_32allGather, "IS.allGather(self) -> IS\nConcatenate index sets stored across processors.\n\n Collective.\n\n The returned index set will be the same on every processor.\n\n See Also\n --------\n petsc.ISAllGather\n\n \nSource code at petsc4py/PETSc/IS.pyx:306"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_33allGather(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("allGather (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("allGather", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "allGather", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_32allGather(((struct PyPetscISObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_32allGather(struct PyPetscISObject *__pyx_v_self) { struct PyPetscISObject *__pyx_v_iset = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("allGather", 1); /* "petsc4py/PETSc/IS.pyx":318 * * """ * cdef IS iset = IS() # <<<<<<<<<<<<<< * CHKERR( ISAllGather(self.iset, &iset.iset) ) * return iset */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_iset = ((struct PyPetscISObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/IS.pyx":319 * """ * cdef IS iset = IS() * CHKERR( ISAllGather(self.iset, &iset.iset) ) # <<<<<<<<<<<<<< * return iset * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISAllGather(__pyx_v_self->iset, (&__pyx_v_iset->iset))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 319, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":320 * cdef IS iset = IS() * CHKERR( ISAllGather(self.iset, &iset.iset) ) * return iset # <<<<<<<<<<<<<< * * def toGeneral(self) -> Self: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_iset); __pyx_r = ((PyObject *)__pyx_v_iset); goto __pyx_L0; /* "petsc4py/PETSc/IS.pyx":306 * return self * * def allGather(self) -> IS: # <<<<<<<<<<<<<< * """Concatenate index sets stored across processors. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.IS.allGather", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_iset); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":322 * return iset * * def toGeneral(self) -> Self: # <<<<<<<<<<<<<< * """Convert the index set type to `IS.Type.GENERAL`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_35toGeneral(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2IS_34toGeneral, "IS.toGeneral(self) -> Self\nConvert the index set type to `IS.Type.GENERAL`.\n\n Collective.\n\n See Also\n --------\n petsc.ISToGeneral, petsc.ISType\n\n \nSource code at petsc4py/PETSc/IS.pyx:322"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_35toGeneral(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("toGeneral (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("toGeneral", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "toGeneral", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_34toGeneral(((struct PyPetscISObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_34toGeneral(struct PyPetscISObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("toGeneral", 1); /* "petsc4py/PETSc/IS.pyx":332 * * """ * CHKERR( ISToGeneral(self.iset) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISToGeneral(__pyx_v_self->iset)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 332, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":333 * """ * CHKERR( ISToGeneral(self.iset) ) * return self # <<<<<<<<<<<<<< * * def buildTwoSided(self, IS toindx=None) -> IS: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/IS.pyx":322 * return iset * * def toGeneral(self) -> Self: # <<<<<<<<<<<<<< * """Convert the index set type to `IS.Type.GENERAL`. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.IS.toGeneral", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":335 * return self * * def buildTwoSided(self, IS toindx=None) -> IS: # <<<<<<<<<<<<<< * """Create an index set describing a global mapping. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_37buildTwoSided(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2IS_36buildTwoSided, "IS.buildTwoSided(self, toindx: IS | None = None) -> IS\nCreate an index set describing a global mapping.\n\n Collective.\n\n This function generates an index set that contains new numbers from\n remote or local on the index set.\n\n Parameters\n ----------\n toindx\n Index set describing which indices to send, default is to send\n natural numbering.\n\n Returns\n -------\n IS\n New index set containing the new numbers from remote or local.\n\n See Also\n --------\n petsc.ISBuildTwoSided\n\n \nSource code at petsc4py/PETSc/IS.pyx:335"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_37buildTwoSided(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscISObject *__pyx_v_toindx = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("buildTwoSided (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_toindx,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscISObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_toindx); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 335, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "buildTwoSided") < 0)) __PYX_ERR(39, 335, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_toindx = ((struct PyPetscISObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("buildTwoSided", 0, 0, 1, __pyx_nargs); __PYX_ERR(39, 335, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.IS.buildTwoSided", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_toindx), __pyx_ptype_8petsc4py_5PETSc_IS, 1, "toindx", 0))) __PYX_ERR(39, 335, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_36buildTwoSided(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_toindx); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_36buildTwoSided(struct PyPetscISObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_toindx) { IS __pyx_v_ctoindx; struct PyPetscISObject *__pyx_v_result = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; IS __pyx_t_2; PyObject *__pyx_t_3 = NULL; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("buildTwoSided", 1); /* "petsc4py/PETSc/IS.pyx":359 * * """ * cdef PetscIS ctoindx = NULL # <<<<<<<<<<<<<< * if toindx is not None: ctoindx = toindx.iset * cdef IS result = IS() */ __pyx_v_ctoindx = NULL; /* "petsc4py/PETSc/IS.pyx":360 * """ * cdef PetscIS ctoindx = NULL * if toindx is not None: ctoindx = toindx.iset # <<<<<<<<<<<<<< * cdef IS result = IS() * CHKERR( ISBuildTwoSided(self.iset, ctoindx, &result.iset) ) */ __pyx_t_1 = (((PyObject *)__pyx_v_toindx) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_toindx->iset; __pyx_v_ctoindx = __pyx_t_2; } /* "petsc4py/PETSc/IS.pyx":361 * cdef PetscIS ctoindx = NULL * if toindx is not None: ctoindx = toindx.iset * cdef IS result = IS() # <<<<<<<<<<<<<< * CHKERR( ISBuildTwoSided(self.iset, ctoindx, &result.iset) ) * return result */ __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_result = ((struct PyPetscISObject *)__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/IS.pyx":362 * if toindx is not None: ctoindx = toindx.iset * cdef IS result = IS() * CHKERR( ISBuildTwoSided(self.iset, ctoindx, &result.iset) ) # <<<<<<<<<<<<<< * return result * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISBuildTwoSided(__pyx_v_self->iset, __pyx_v_ctoindx, (&__pyx_v_result->iset))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 362, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":363 * cdef IS result = IS() * CHKERR( ISBuildTwoSided(self.iset, ctoindx, &result.iset) ) * return result # <<<<<<<<<<<<<< * * def invertPermutation(self, nlocal: int | None = None) -> IS: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_result); __pyx_r = ((PyObject *)__pyx_v_result); goto __pyx_L0; /* "petsc4py/PETSc/IS.pyx":335 * return self * * def buildTwoSided(self, IS toindx=None) -> IS: # <<<<<<<<<<<<<< * """Create an index set describing a global mapping. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.IS.buildTwoSided", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":365 * return result * * def invertPermutation(self, nlocal: int | None = None) -> IS: # <<<<<<<<<<<<<< * """Invert the index set. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_39invertPermutation(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2IS_38invertPermutation, "IS.invertPermutation(self, nlocal: int | None = None) -> IS\nInvert the index set.\n\n Collective.\n\n For this to be correct the index set must be a permutation.\n\n Parameters\n ----------\n nlocal\n The number of indices on this processor in the resulting index set,\n defaults to ``PETSC_DECIDE``.\n\n See Also\n --------\n petsc.ISInvertPermutation\n\n \nSource code at petsc4py/PETSc/IS.pyx:365"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_39invertPermutation(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_nlocal = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("invertPermutation (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nlocal,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_nlocal); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 365, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "invertPermutation") < 0)) __PYX_ERR(39, 365, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_nlocal = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("invertPermutation", 0, 0, 1, __pyx_nargs); __PYX_ERR(39, 365, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.IS.invertPermutation", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_38invertPermutation(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_nlocal); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_38invertPermutation(struct PyPetscISObject *__pyx_v_self, PyObject *__pyx_v_nlocal) { PetscInt __pyx_v_cnlocal; struct PyPetscISObject *__pyx_v_iset = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscInt __pyx_t_2; PyObject *__pyx_t_3 = NULL; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("invertPermutation", 1); /* "petsc4py/PETSc/IS.pyx":383 * * """ * cdef PetscInt cnlocal = PETSC_DECIDE # <<<<<<<<<<<<<< * if nlocal is not None: cnlocal = asInt(nlocal) * cdef IS iset = IS() */ __pyx_v_cnlocal = PETSC_DECIDE; /* "petsc4py/PETSc/IS.pyx":384 * """ * cdef PetscInt cnlocal = PETSC_DECIDE * if nlocal is not None: cnlocal = asInt(nlocal) # <<<<<<<<<<<<<< * cdef IS iset = IS() * CHKERR( ISInvertPermutation(self.iset, cnlocal, &iset.iset) ) */ __pyx_t_1 = (__pyx_v_nlocal != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_nlocal); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(39, 384, __pyx_L1_error) __pyx_v_cnlocal = __pyx_t_2; } /* "petsc4py/PETSc/IS.pyx":385 * cdef PetscInt cnlocal = PETSC_DECIDE * if nlocal is not None: cnlocal = asInt(nlocal) * cdef IS iset = IS() # <<<<<<<<<<<<<< * CHKERR( ISInvertPermutation(self.iset, cnlocal, &iset.iset) ) * return iset */ __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 385, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_iset = ((struct PyPetscISObject *)__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/IS.pyx":386 * if nlocal is not None: cnlocal = asInt(nlocal) * cdef IS iset = IS() * CHKERR( ISInvertPermutation(self.iset, cnlocal, &iset.iset) ) # <<<<<<<<<<<<<< * return iset * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISInvertPermutation(__pyx_v_self->iset, __pyx_v_cnlocal, (&__pyx_v_iset->iset))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 386, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":387 * cdef IS iset = IS() * CHKERR( ISInvertPermutation(self.iset, cnlocal, &iset.iset) ) * return iset # <<<<<<<<<<<<<< * * def getSize(self) -> int: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_iset); __pyx_r = ((PyObject *)__pyx_v_iset); goto __pyx_L0; /* "petsc4py/PETSc/IS.pyx":365 * return result * * def invertPermutation(self, nlocal: int | None = None) -> IS: # <<<<<<<<<<<<<< * """Invert the index set. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.IS.invertPermutation", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_iset); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":389 * return iset * * def getSize(self) -> int: # <<<<<<<<<<<<<< * """Return the global length of an index set. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_41getSize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2IS_40getSize, "IS.getSize(self) -> int\nReturn the global length of an index set.\n\n Not collective.\n\n See Also\n --------\n petsc.ISGetSize\n\n \nSource code at petsc4py/PETSc/IS.pyx:389"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_41getSize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSize (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getSize", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getSize", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_40getSize(((struct PyPetscISObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_40getSize(struct PyPetscISObject *__pyx_v_self) { PetscInt __pyx_v_N; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSize", 1); /* "petsc4py/PETSc/IS.pyx":399 * * """ * cdef PetscInt N = 0 # <<<<<<<<<<<<<< * CHKERR( ISGetSize(self.iset, &N) ) * return toInt(N) */ __pyx_v_N = 0; /* "petsc4py/PETSc/IS.pyx":400 * """ * cdef PetscInt N = 0 * CHKERR( ISGetSize(self.iset, &N) ) # <<<<<<<<<<<<<< * return toInt(N) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISGetSize(__pyx_v_self->iset, (&__pyx_v_N))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 400, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":401 * cdef PetscInt N = 0 * CHKERR( ISGetSize(self.iset, &N) ) * return toInt(N) # <<<<<<<<<<<<<< * * def getLocalSize(self) -> int: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_N); if (unlikely(!__pyx_t_2)) __PYX_ERR(39, 401, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/IS.pyx":389 * return iset * * def getSize(self) -> int: # <<<<<<<<<<<<<< * """Return the global length of an index set. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.IS.getSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":403 * return toInt(N) * * def getLocalSize(self) -> int: # <<<<<<<<<<<<<< * """Return the process-local length of the index set. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_43getLocalSize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2IS_42getLocalSize, "IS.getLocalSize(self) -> int\nReturn the process-local length of the index set.\n\n Not collective.\n\n See Also\n --------\n petsc.ISGetLocalSize\n\n \nSource code at petsc4py/PETSc/IS.pyx:403"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_43getLocalSize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getLocalSize (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getLocalSize", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getLocalSize", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_42getLocalSize(((struct PyPetscISObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_42getLocalSize(struct PyPetscISObject *__pyx_v_self) { PetscInt __pyx_v_n; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getLocalSize", 1); /* "petsc4py/PETSc/IS.pyx":413 * * """ * cdef PetscInt n = 0 # <<<<<<<<<<<<<< * CHKERR( ISGetLocalSize(self.iset, &n) ) * return toInt(n) */ __pyx_v_n = 0; /* "petsc4py/PETSc/IS.pyx":414 * """ * cdef PetscInt n = 0 * CHKERR( ISGetLocalSize(self.iset, &n) ) # <<<<<<<<<<<<<< * return toInt(n) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISGetLocalSize(__pyx_v_self->iset, (&__pyx_v_n))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 414, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":415 * cdef PetscInt n = 0 * CHKERR( ISGetLocalSize(self.iset, &n) ) * return toInt(n) # <<<<<<<<<<<<<< * * def getSizes(self) -> tuple[int, int]: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(39, 415, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/IS.pyx":403 * return toInt(N) * * def getLocalSize(self) -> int: # <<<<<<<<<<<<<< * """Return the process-local length of the index set. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.IS.getLocalSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":417 * return toInt(n) * * def getSizes(self) -> tuple[int, int]: # <<<<<<<<<<<<<< * """Return the local and global sizes of the index set. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_45getSizes(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2IS_44getSizes, "IS.getSizes(self) -> tuple[int, int]\nReturn the local and global sizes of the index set.\n\n Not collective.\n\n Returns\n -------\n local_size : int\n The local size.\n global_size : int\n The global size.\n\n See Also\n --------\n IS.getLocalSize, IS.getSize\n\n \nSource code at petsc4py/PETSc/IS.pyx:417"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_45getSizes(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSizes (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getSizes", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getSizes", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_44getSizes(((struct PyPetscISObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_44getSizes(struct PyPetscISObject *__pyx_v_self) { PetscInt __pyx_v_n; PetscInt __pyx_v_N; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSizes", 1); /* "petsc4py/PETSc/IS.pyx":434 * * """ * cdef PetscInt n = 0, N = 0 # <<<<<<<<<<<<<< * CHKERR( ISGetLocalSize(self.iset, &n) ) * CHKERR( ISGetSize(self.iset, &N) ) */ __pyx_v_n = 0; __pyx_v_N = 0; /* "petsc4py/PETSc/IS.pyx":435 * """ * cdef PetscInt n = 0, N = 0 * CHKERR( ISGetLocalSize(self.iset, &n) ) # <<<<<<<<<<<<<< * CHKERR( ISGetSize(self.iset, &N) ) * return (toInt(n), toInt(N)) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISGetLocalSize(__pyx_v_self->iset, (&__pyx_v_n))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 435, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":436 * cdef PetscInt n = 0, N = 0 * CHKERR( ISGetLocalSize(self.iset, &n) ) * CHKERR( ISGetSize(self.iset, &N) ) # <<<<<<<<<<<<<< * return (toInt(n), toInt(N)) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISGetSize(__pyx_v_self->iset, (&__pyx_v_N))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 436, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":437 * CHKERR( ISGetLocalSize(self.iset, &n) ) * CHKERR( ISGetSize(self.iset, &N) ) * return (toInt(n), toInt(N)) # <<<<<<<<<<<<<< * * def getBlockSize(self) -> int: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(39, 437, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_N); if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 437, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(39, 437, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(39, 437, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(39, 437, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "petsc4py/PETSc/IS.pyx":417 * return toInt(n) * * def getSizes(self) -> tuple[int, int]: # <<<<<<<<<<<<<< * """Return the local and global sizes of the index set. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.IS.getSizes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":439 * return (toInt(n), toInt(N)) * * def getBlockSize(self) -> int: # <<<<<<<<<<<<<< * """Return the number of elements in a block. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_47getBlockSize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2IS_46getBlockSize, "IS.getBlockSize(self) -> int\nReturn the number of elements in a block.\n\n Not collective.\n\n See Also\n --------\n petsc.ISGetBlockSize\n\n \nSource code at petsc4py/PETSc/IS.pyx:439"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_47getBlockSize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getBlockSize (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getBlockSize", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getBlockSize", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_46getBlockSize(((struct PyPetscISObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_46getBlockSize(struct PyPetscISObject *__pyx_v_self) { PetscInt __pyx_v_bs; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getBlockSize", 1); /* "petsc4py/PETSc/IS.pyx":449 * * """ * cdef PetscInt bs = 1 # <<<<<<<<<<<<<< * CHKERR( ISGetBlockSize(self.iset, &bs) ) * return toInt(bs) */ __pyx_v_bs = 1; /* "petsc4py/PETSc/IS.pyx":450 * """ * cdef PetscInt bs = 1 * CHKERR( ISGetBlockSize(self.iset, &bs) ) # <<<<<<<<<<<<<< * return toInt(bs) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISGetBlockSize(__pyx_v_self->iset, (&__pyx_v_bs))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 450, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":451 * cdef PetscInt bs = 1 * CHKERR( ISGetBlockSize(self.iset, &bs) ) * return toInt(bs) # <<<<<<<<<<<<<< * * def setBlockSize(self, bs: int) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_bs); if (unlikely(!__pyx_t_2)) __PYX_ERR(39, 451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/IS.pyx":439 * return (toInt(n), toInt(N)) * * def getBlockSize(self) -> int: # <<<<<<<<<<<<<< * """Return the number of elements in a block. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.IS.getBlockSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":453 * return toInt(bs) * * def setBlockSize(self, bs: int) -> None: # <<<<<<<<<<<<<< * """Set the block size of the index set. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_49setBlockSize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2IS_48setBlockSize, "IS.setBlockSize(self, bs: int) -> None\nSet the block size of the index set.\n\n Logically collective.\n\n Parameters\n ----------\n bs\n Block size.\n\n See Also\n --------\n petsc.ISSetBlockSize\n\n \nSource code at petsc4py/PETSc/IS.pyx:453"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_49setBlockSize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_bs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setBlockSize (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_bs,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_bs)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 453, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setBlockSize") < 0)) __PYX_ERR(39, 453, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_bs = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setBlockSize", 1, 1, 1, __pyx_nargs); __PYX_ERR(39, 453, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.IS.setBlockSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_48setBlockSize(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_bs); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_48setBlockSize(struct PyPetscISObject *__pyx_v_self, PyObject *__pyx_v_bs) { PetscInt __pyx_v_cbs; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setBlockSize", 1); /* "petsc4py/PETSc/IS.pyx":468 * * """ * cdef PetscInt cbs = asInt(bs) # <<<<<<<<<<<<<< * CHKERR( ISSetBlockSize(self.iset, cbs) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_bs); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(39, 468, __pyx_L1_error) __pyx_v_cbs = __pyx_t_1; /* "petsc4py/PETSc/IS.pyx":469 * """ * cdef PetscInt cbs = asInt(bs) * CHKERR( ISSetBlockSize(self.iset, cbs) ) # <<<<<<<<<<<<<< * * def sort(self) -> Self: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISSetBlockSize(__pyx_v_self->iset, __pyx_v_cbs)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 469, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":453 * return toInt(bs) * * def setBlockSize(self, bs: int) -> None: # <<<<<<<<<<<<<< * """Set the block size of the index set. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.IS.setBlockSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":471 * CHKERR( ISSetBlockSize(self.iset, cbs) ) * * def sort(self) -> Self: # <<<<<<<<<<<<<< * """Sort the indices of an index set. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_51sort(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2IS_50sort, "IS.sort(self) -> Self\nSort the indices of an index set.\n\n Collective.\n\n See Also\n --------\n petsc.ISSort\n\n \nSource code at petsc4py/PETSc/IS.pyx:471"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_51sort(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("sort (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("sort", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "sort", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_50sort(((struct PyPetscISObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_50sort(struct PyPetscISObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("sort", 1); /* "petsc4py/PETSc/IS.pyx":481 * * """ * CHKERR( ISSort(self.iset) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISSort(__pyx_v_self->iset)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 481, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":482 * """ * CHKERR( ISSort(self.iset) ) * return self # <<<<<<<<<<<<<< * * def isSorted(self) -> bool: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/IS.pyx":471 * CHKERR( ISSetBlockSize(self.iset, cbs) ) * * def sort(self) -> Self: # <<<<<<<<<<<<<< * """Sort the indices of an index set. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.IS.sort", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":484 * return self * * def isSorted(self) -> bool: # <<<<<<<<<<<<<< * """Return whether the indices have been sorted. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_53isSorted(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2IS_52isSorted, "IS.isSorted(self) -> bool\nReturn whether the indices have been sorted.\n\n Collective.\n\n See Also\n --------\n petsc.ISSorted\n\n \nSource code at petsc4py/PETSc/IS.pyx:484"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_53isSorted(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("isSorted (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("isSorted", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "isSorted", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_52isSorted(((struct PyPetscISObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_52isSorted(struct PyPetscISObject *__pyx_v_self) { PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("isSorted", 1); /* "petsc4py/PETSc/IS.pyx":494 * * """ * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( ISSorted(self.iset, &flag) ) * return toBool(flag) */ __pyx_v_flag = PETSC_FALSE; /* "petsc4py/PETSc/IS.pyx":495 * """ * cdef PetscBool flag = PETSC_FALSE * CHKERR( ISSorted(self.iset, &flag) ) # <<<<<<<<<<<<<< * return toBool(flag) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISSorted(__pyx_v_self->iset, (&__pyx_v_flag))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 495, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":496 * cdef PetscBool flag = PETSC_FALSE * CHKERR( ISSorted(self.iset, &flag) ) * return toBool(flag) # <<<<<<<<<<<<<< * * def setPermutation(self) -> Self: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(39, 496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/IS.pyx":484 * return self * * def isSorted(self) -> bool: # <<<<<<<<<<<<<< * """Return whether the indices have been sorted. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.IS.isSorted", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":498 * return toBool(flag) * * def setPermutation(self) -> Self: # <<<<<<<<<<<<<< * """Mark the index set as being a permutation. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_55setPermutation(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2IS_54setPermutation, "IS.setPermutation(self) -> Self\nMark the index set as being a permutation.\n\n Logically collective.\n\n See Also\n --------\n petsc.ISSetPermutation\n\n \nSource code at petsc4py/PETSc/IS.pyx:498"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_55setPermutation(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPermutation (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("setPermutation", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setPermutation", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_54setPermutation(((struct PyPetscISObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_54setPermutation(struct PyPetscISObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPermutation", 1); /* "petsc4py/PETSc/IS.pyx":508 * * """ * CHKERR( ISSetPermutation(self.iset) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISSetPermutation(__pyx_v_self->iset)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 508, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":509 * """ * CHKERR( ISSetPermutation(self.iset) ) * return self # <<<<<<<<<<<<<< * * def isPermutation(self) -> bool: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/IS.pyx":498 * return toBool(flag) * * def setPermutation(self) -> Self: # <<<<<<<<<<<<<< * """Mark the index set as being a permutation. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.IS.setPermutation", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":511 * return self * * def isPermutation(self) -> bool: # <<<<<<<<<<<<<< * """Return whether an index set has been declared to be a permutation. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_57isPermutation(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2IS_56isPermutation, "IS.isPermutation(self) -> bool\nReturn whether an index set has been declared to be a permutation.\n\n Logically collective.\n\n See Also\n --------\n petsc.ISPermutation\n\n \nSource code at petsc4py/PETSc/IS.pyx:511"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_57isPermutation(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("isPermutation (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("isPermutation", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "isPermutation", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_56isPermutation(((struct PyPetscISObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_56isPermutation(struct PyPetscISObject *__pyx_v_self) { PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("isPermutation", 1); /* "petsc4py/PETSc/IS.pyx":521 * * """ * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( ISPermutation(self.iset, &flag) ) * return toBool(flag) */ __pyx_v_flag = PETSC_FALSE; /* "petsc4py/PETSc/IS.pyx":522 * """ * cdef PetscBool flag = PETSC_FALSE * CHKERR( ISPermutation(self.iset, &flag) ) # <<<<<<<<<<<<<< * return toBool(flag) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISPermutation(__pyx_v_self->iset, (&__pyx_v_flag))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 522, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":523 * cdef PetscBool flag = PETSC_FALSE * CHKERR( ISPermutation(self.iset, &flag) ) * return toBool(flag) # <<<<<<<<<<<<<< * * def setIdentity(self) -> Self: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(39, 523, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/IS.pyx":511 * return self * * def isPermutation(self) -> bool: # <<<<<<<<<<<<<< * """Return whether an index set has been declared to be a permutation. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.IS.isPermutation", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":525 * return toBool(flag) * * def setIdentity(self) -> Self: # <<<<<<<<<<<<<< * """Mark the index set as being an identity. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_59setIdentity(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2IS_58setIdentity, "IS.setIdentity(self) -> Self\nMark the index set as being an identity.\n\n Logically collective.\n\n See Also\n --------\n petsc.ISSetIdentity\n\n \nSource code at petsc4py/PETSc/IS.pyx:525"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_59setIdentity(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setIdentity (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("setIdentity", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setIdentity", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_58setIdentity(((struct PyPetscISObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_58setIdentity(struct PyPetscISObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setIdentity", 1); /* "petsc4py/PETSc/IS.pyx":535 * * """ * CHKERR( ISSetIdentity(self.iset) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISSetIdentity(__pyx_v_self->iset)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 535, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":536 * """ * CHKERR( ISSetIdentity(self.iset) ) * return self # <<<<<<<<<<<<<< * * def isIdentity(self) -> bool: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/IS.pyx":525 * return toBool(flag) * * def setIdentity(self) -> Self: # <<<<<<<<<<<<<< * """Mark the index set as being an identity. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.IS.setIdentity", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":538 * return self * * def isIdentity(self) -> bool: # <<<<<<<<<<<<<< * """Return whether the index set has been declared as an identity. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_61isIdentity(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2IS_60isIdentity, "IS.isIdentity(self) -> bool\nReturn whether the index set has been declared as an identity.\n\n Collective.\n\n See Also\n --------\n petsc.ISIdentity\n\n \nSource code at petsc4py/PETSc/IS.pyx:538"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_61isIdentity(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("isIdentity (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("isIdentity", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "isIdentity", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_60isIdentity(((struct PyPetscISObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_60isIdentity(struct PyPetscISObject *__pyx_v_self) { PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("isIdentity", 1); /* "petsc4py/PETSc/IS.pyx":548 * * """ * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( ISIdentity(self.iset, &flag) ) * return toBool(flag) */ __pyx_v_flag = PETSC_FALSE; /* "petsc4py/PETSc/IS.pyx":549 * """ * cdef PetscBool flag = PETSC_FALSE * CHKERR( ISIdentity(self.iset, &flag) ) # <<<<<<<<<<<<<< * return toBool(flag) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISIdentity(__pyx_v_self->iset, (&__pyx_v_flag))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 549, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":550 * cdef PetscBool flag = PETSC_FALSE * CHKERR( ISIdentity(self.iset, &flag) ) * return toBool(flag) # <<<<<<<<<<<<<< * * def equal(self, IS iset) -> bool: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(39, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/IS.pyx":538 * return self * * def isIdentity(self) -> bool: # <<<<<<<<<<<<<< * """Return whether the index set has been declared as an identity. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.IS.isIdentity", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":552 * return toBool(flag) * * def equal(self, IS iset) -> bool: # <<<<<<<<<<<<<< * """Return whether the index sets have the same set of indices or not. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_63equal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2IS_62equal, "IS.equal(self, iset: IS) -> bool\nReturn whether the index sets have the same set of indices or not.\n\n Collective.\n\n Parameters\n ----------\n iset\n The index set to compare indices with.\n\n See Also\n --------\n petsc.ISEqual\n\n \nSource code at petsc4py/PETSc/IS.pyx:552"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_63equal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscISObject *__pyx_v_iset = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("equal (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_iset,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_iset)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 552, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "equal") < 0)) __PYX_ERR(39, 552, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_iset = ((struct PyPetscISObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("equal", 1, 1, 1, __pyx_nargs); __PYX_ERR(39, 552, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.IS.equal", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iset), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "iset", 0))) __PYX_ERR(39, 552, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_62equal(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_iset); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_62equal(struct PyPetscISObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset) { PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("equal", 1); /* "petsc4py/PETSc/IS.pyx":567 * * """ * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( ISEqual(self.iset, iset.iset, &flag) ) * return toBool(flag) */ __pyx_v_flag = PETSC_FALSE; /* "petsc4py/PETSc/IS.pyx":568 * """ * cdef PetscBool flag = PETSC_FALSE * CHKERR( ISEqual(self.iset, iset.iset, &flag) ) # <<<<<<<<<<<<<< * return toBool(flag) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISEqual(__pyx_v_self->iset, __pyx_v_iset->iset, (&__pyx_v_flag))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 568, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":569 * cdef PetscBool flag = PETSC_FALSE * CHKERR( ISEqual(self.iset, iset.iset, &flag) ) * return toBool(flag) # <<<<<<<<<<<<<< * * def sum(self, IS iset) -> IS: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(39, 569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/IS.pyx":552 * return toBool(flag) * * def equal(self, IS iset) -> bool: # <<<<<<<<<<<<<< * """Return whether the index sets have the same set of indices or not. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.IS.equal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":571 * return toBool(flag) * * def sum(self, IS iset) -> IS: # <<<<<<<<<<<<<< * """Return the union of two (sorted) index sets. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_65sum(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2IS_64sum, "IS.sum(self, iset: IS) -> IS\nReturn the union of two (sorted) index sets.\n\n Collective.\n\n Parameters\n ----------\n iset\n The index set to compute the union with.\n\n See Also\n --------\n petsc.ISSum\n\n \nSource code at petsc4py/PETSc/IS.pyx:571"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_65sum(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscISObject *__pyx_v_iset = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("sum (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_iset,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_iset)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 571, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "sum") < 0)) __PYX_ERR(39, 571, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_iset = ((struct PyPetscISObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("sum", 1, 1, 1, __pyx_nargs); __PYX_ERR(39, 571, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.IS.sum", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iset), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "iset", 0))) __PYX_ERR(39, 571, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_64sum(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_iset); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_64sum(struct PyPetscISObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset) { struct PyPetscISObject *__pyx_v_out = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("sum", 1); /* "petsc4py/PETSc/IS.pyx":586 * * """ * cdef IS out = IS() # <<<<<<<<<<<<<< * CHKERR( ISSum(self.iset, iset.iset, &out.iset) ) * return out */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 586, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_out = ((struct PyPetscISObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/IS.pyx":587 * """ * cdef IS out = IS() * CHKERR( ISSum(self.iset, iset.iset, &out.iset) ) # <<<<<<<<<<<<<< * return out * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISSum(__pyx_v_self->iset, __pyx_v_iset->iset, (&__pyx_v_out->iset))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 587, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":588 * cdef IS out = IS() * CHKERR( ISSum(self.iset, iset.iset, &out.iset) ) * return out # <<<<<<<<<<<<<< * * def expand(self, IS iset) -> IS: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_out); __pyx_r = ((PyObject *)__pyx_v_out); goto __pyx_L0; /* "petsc4py/PETSc/IS.pyx":571 * return toBool(flag) * * def sum(self, IS iset) -> IS: # <<<<<<<<<<<<<< * """Return the union of two (sorted) index sets. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.IS.sum", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_out); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":590 * return out * * def expand(self, IS iset) -> IS: # <<<<<<<<<<<<<< * """Return the union of two (possibly unsorted) index sets. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_67expand(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2IS_66expand, "IS.expand(self, iset: IS) -> IS\nReturn the union of two (possibly unsorted) index sets.\n\n Collective.\n\n To compute the union, `expand` concatenates the two index sets\n and removes any duplicates.\n\n Parameters\n ----------\n iset\n Index set to compute the union with.\n\n Returns\n -------\n IS\n The new, combined, index set.\n\n See Also\n --------\n petsc.ISExpand\n\n \nSource code at petsc4py/PETSc/IS.pyx:590"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_67expand(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscISObject *__pyx_v_iset = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("expand (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_iset,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_iset)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 590, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "expand") < 0)) __PYX_ERR(39, 590, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_iset = ((struct PyPetscISObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("expand", 1, 1, 1, __pyx_nargs); __PYX_ERR(39, 590, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.IS.expand", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iset), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "iset", 0))) __PYX_ERR(39, 590, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_66expand(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_iset); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_66expand(struct PyPetscISObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset) { struct PyPetscISObject *__pyx_v_out = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("expand", 1); /* "petsc4py/PETSc/IS.pyx":613 * * """ * cdef IS out = IS() # <<<<<<<<<<<<<< * CHKERR( ISExpand(self.iset, iset.iset, &out.iset) ) * return out */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 613, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_out = ((struct PyPetscISObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/IS.pyx":614 * """ * cdef IS out = IS() * CHKERR( ISExpand(self.iset, iset.iset, &out.iset) ) # <<<<<<<<<<<<<< * return out * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISExpand(__pyx_v_self->iset, __pyx_v_iset->iset, (&__pyx_v_out->iset))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 614, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":615 * cdef IS out = IS() * CHKERR( ISExpand(self.iset, iset.iset, &out.iset) ) * return out # <<<<<<<<<<<<<< * * def union(self, IS iset) -> IS: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_out); __pyx_r = ((PyObject *)__pyx_v_out); goto __pyx_L0; /* "petsc4py/PETSc/IS.pyx":590 * return out * * def expand(self, IS iset) -> IS: # <<<<<<<<<<<<<< * """Return the union of two (possibly unsorted) index sets. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.IS.expand", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_out); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":617 * return out * * def union(self, IS iset) -> IS: # <<<<<<<<<<<<<< * """Return the union of two (possibly unsorted) index sets. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_69union(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2IS_68union, "IS.union(self, iset: IS) -> IS\nReturn the union of two (possibly unsorted) index sets.\n\n Collective.\n\n This function will call either `petsc.ISSum` or `petsc.ISExpand` depending\n on whether or not the input sets are already sorted.\n\n Sequential only (as `petsc.ISSum` is sequential only).\n\n Parameters\n ----------\n iset\n Index set to compute the union with.\n\n Returns\n -------\n IS\n The new, combined, index set.\n\n See Also\n --------\n IS.expand, IS.sum\n\n \nSource code at petsc4py/PETSc/IS.pyx:617"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_69union(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscISObject *__pyx_v_iset = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("union (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_iset,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_iset)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 617, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "union") < 0)) __PYX_ERR(39, 617, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_iset = ((struct PyPetscISObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("union", 1, 1, 1, __pyx_nargs); __PYX_ERR(39, 617, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.IS.union", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iset), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "iset", 0))) __PYX_ERR(39, 617, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_68union(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_iset); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_68union(struct PyPetscISObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset) { PetscBool __pyx_v_flag1; PetscBool __pyx_v_flag2; struct PyPetscISObject *__pyx_v_out = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("union", 1); /* "petsc4py/PETSc/IS.pyx":642 * * """ * cdef PetscBool flag1=PETSC_FALSE, flag2=PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( ISSorted(self.iset, &flag1) ) * CHKERR( ISSorted(iset.iset, &flag2) ) */ __pyx_v_flag1 = PETSC_FALSE; __pyx_v_flag2 = PETSC_FALSE; /* "petsc4py/PETSc/IS.pyx":643 * """ * cdef PetscBool flag1=PETSC_FALSE, flag2=PETSC_FALSE * CHKERR( ISSorted(self.iset, &flag1) ) # <<<<<<<<<<<<<< * CHKERR( ISSorted(iset.iset, &flag2) ) * cdef IS out = IS() */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISSorted(__pyx_v_self->iset, (&__pyx_v_flag1))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 643, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":644 * cdef PetscBool flag1=PETSC_FALSE, flag2=PETSC_FALSE * CHKERR( ISSorted(self.iset, &flag1) ) * CHKERR( ISSorted(iset.iset, &flag2) ) # <<<<<<<<<<<<<< * cdef IS out = IS() * if flag1==PETSC_TRUE and flag2==PETSC_TRUE: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISSorted(__pyx_v_iset->iset, (&__pyx_v_flag2))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 644, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":645 * CHKERR( ISSorted(self.iset, &flag1) ) * CHKERR( ISSorted(iset.iset, &flag2) ) * cdef IS out = IS() # <<<<<<<<<<<<<< * if flag1==PETSC_TRUE and flag2==PETSC_TRUE: * CHKERR( ISSum(self.iset, iset.iset, &out.iset) ) */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_2)) __PYX_ERR(39, 645, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_out = ((struct PyPetscISObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/IS.pyx":646 * CHKERR( ISSorted(iset.iset, &flag2) ) * cdef IS out = IS() * if flag1==PETSC_TRUE and flag2==PETSC_TRUE: # <<<<<<<<<<<<<< * CHKERR( ISSum(self.iset, iset.iset, &out.iset) ) * else: */ __pyx_t_4 = (__pyx_v_flag1 == PETSC_TRUE); if (__pyx_t_4) { } else { __pyx_t_3 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = (__pyx_v_flag2 == PETSC_TRUE); __pyx_t_3 = __pyx_t_4; __pyx_L4_bool_binop_done:; if (__pyx_t_3) { /* "petsc4py/PETSc/IS.pyx":647 * cdef IS out = IS() * if flag1==PETSC_TRUE and flag2==PETSC_TRUE: * CHKERR( ISSum(self.iset, iset.iset, &out.iset) ) # <<<<<<<<<<<<<< * else: * CHKERR( ISExpand(self.iset, iset.iset, &out.iset) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISSum(__pyx_v_self->iset, __pyx_v_iset->iset, (&__pyx_v_out->iset))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 647, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":646 * CHKERR( ISSorted(iset.iset, &flag2) ) * cdef IS out = IS() * if flag1==PETSC_TRUE and flag2==PETSC_TRUE: # <<<<<<<<<<<<<< * CHKERR( ISSum(self.iset, iset.iset, &out.iset) ) * else: */ goto __pyx_L3; } /* "petsc4py/PETSc/IS.pyx":649 * CHKERR( ISSum(self.iset, iset.iset, &out.iset) ) * else: * CHKERR( ISExpand(self.iset, iset.iset, &out.iset) ) # <<<<<<<<<<<<<< * return out * */ /*else*/ { __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISExpand(__pyx_v_self->iset, __pyx_v_iset->iset, (&__pyx_v_out->iset))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 649, __pyx_L1_error) } __pyx_L3:; /* "petsc4py/PETSc/IS.pyx":650 * else: * CHKERR( ISExpand(self.iset, iset.iset, &out.iset) ) * return out # <<<<<<<<<<<<<< * * def difference(self, IS iset: IS) -> IS: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_out); __pyx_r = ((PyObject *)__pyx_v_out); goto __pyx_L0; /* "petsc4py/PETSc/IS.pyx":617 * return out * * def union(self, IS iset) -> IS: # <<<<<<<<<<<<<< * """Return the union of two (possibly unsorted) index sets. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.IS.union", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_out); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":652 * return out * * def difference(self, IS iset: IS) -> IS: # <<<<<<<<<<<<<< * """Return the difference between two index sets. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_71difference(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2IS_70difference, "IS.difference(self, iset: IS) -> IS\nReturn the difference between two index sets.\n\n Collective.\n\n Parameters\n ----------\n iset\n Index set to compute the difference with.\n\n Returns\n -------\n IS\n Index set representing the difference between ``self`` and ``iset``.\n\n See Also\n --------\n petsc.ISDifference\n\n \nSource code at petsc4py/PETSc/IS.pyx:652"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_71difference(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscISObject *__pyx_v_iset = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("difference (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_iset,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_iset)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 652, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "difference") < 0)) __PYX_ERR(39, 652, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_iset = ((struct PyPetscISObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("difference", 1, 1, 1, __pyx_nargs); __PYX_ERR(39, 652, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.IS.difference", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iset), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "iset", 0))) __PYX_ERR(39, 652, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_70difference(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_iset); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_70difference(struct PyPetscISObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset) { struct PyPetscISObject *__pyx_v_out = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("difference", 1); /* "petsc4py/PETSc/IS.pyx":672 * * """ * cdef IS out = IS() # <<<<<<<<<<<<<< * CHKERR( ISDifference(self.iset, iset.iset, &out.iset) ) * return out */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 672, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_out = ((struct PyPetscISObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/IS.pyx":673 * """ * cdef IS out = IS() * CHKERR( ISDifference(self.iset, iset.iset, &out.iset) ) # <<<<<<<<<<<<<< * return out * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISDifference(__pyx_v_self->iset, __pyx_v_iset->iset, (&__pyx_v_out->iset))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 673, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":674 * cdef IS out = IS() * CHKERR( ISDifference(self.iset, iset.iset, &out.iset) ) * return out # <<<<<<<<<<<<<< * * def complement(self, nmin: int, nmax: int) -> IS: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_out); __pyx_r = ((PyObject *)__pyx_v_out); goto __pyx_L0; /* "petsc4py/PETSc/IS.pyx":652 * return out * * def difference(self, IS iset: IS) -> IS: # <<<<<<<<<<<<<< * """Return the difference between two index sets. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.IS.difference", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_out); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":676 * return out * * def complement(self, nmin: int, nmax: int) -> IS: # <<<<<<<<<<<<<< * """Create a complement index set. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_73complement(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2IS_72complement, "IS.complement(self, nmin: int, nmax: int) -> IS\nCreate a complement index set.\n\n Collective.\n\n The complement set of indices is all indices that are not\n in the provided set (and within the provided bounds).\n\n Parameters\n ----------\n nmin\n Minimum index that can be found in the local part of the complement\n index set.\n nmax\n One greater than the maximum index that can be found in the local\n part of the complement index set.\n\n Notes\n -----\n For a parallel index set, this will generate the local part of the\n complement on each process.\n\n To generate the entire complement (on each process) of a parallel\n index set, first call `IS.allGather` and then call this method.\n\n See Also\n --------\n IS.allGather, petsc.ISComplement\n\n \nSource code at petsc4py/PETSc/IS.pyx:676"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_73complement(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_nmin = 0; PyObject *__pyx_v_nmax = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("complement (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nmin,&__pyx_n_s_nmax,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_nmin)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 676, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_nmax)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 676, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("complement", 1, 2, 2, 1); __PYX_ERR(39, 676, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "complement") < 0)) __PYX_ERR(39, 676, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_nmin = values[0]; __pyx_v_nmax = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("complement", 1, 2, 2, __pyx_nargs); __PYX_ERR(39, 676, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.IS.complement", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_72complement(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_nmin, __pyx_v_nmax); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_72complement(struct PyPetscISObject *__pyx_v_self, PyObject *__pyx_v_nmin, PyObject *__pyx_v_nmax) { PetscInt __pyx_v_cnmin; PetscInt __pyx_v_cnmax; struct PyPetscISObject *__pyx_v_out = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("complement", 1); /* "petsc4py/PETSc/IS.pyx":706 * * """ * cdef PetscInt cnmin = asInt(nmin) # <<<<<<<<<<<<<< * cdef PetscInt cnmax = asInt(nmax) * cdef IS out = IS() */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_nmin); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(39, 706, __pyx_L1_error) __pyx_v_cnmin = __pyx_t_1; /* "petsc4py/PETSc/IS.pyx":707 * """ * cdef PetscInt cnmin = asInt(nmin) * cdef PetscInt cnmax = asInt(nmax) # <<<<<<<<<<<<<< * cdef IS out = IS() * CHKERR( ISComplement(self.iset, cnmin, cnmax, &out.iset) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_nmax); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(39, 707, __pyx_L1_error) __pyx_v_cnmax = __pyx_t_1; /* "petsc4py/PETSc/IS.pyx":708 * cdef PetscInt cnmin = asInt(nmin) * cdef PetscInt cnmax = asInt(nmax) * cdef IS out = IS() # <<<<<<<<<<<<<< * CHKERR( ISComplement(self.iset, cnmin, cnmax, &out.iset) ) * return out */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_2)) __PYX_ERR(39, 708, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_out = ((struct PyPetscISObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/IS.pyx":709 * cdef PetscInt cnmax = asInt(nmax) * cdef IS out = IS() * CHKERR( ISComplement(self.iset, cnmin, cnmax, &out.iset) ) # <<<<<<<<<<<<<< * return out * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISComplement(__pyx_v_self->iset, __pyx_v_cnmin, __pyx_v_cnmax, (&__pyx_v_out->iset))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 709, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":710 * cdef IS out = IS() * CHKERR( ISComplement(self.iset, cnmin, cnmax, &out.iset) ) * return out # <<<<<<<<<<<<<< * * def embed(self, IS iset, drop: bool) -> IS: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_out); __pyx_r = ((PyObject *)__pyx_v_out); goto __pyx_L0; /* "petsc4py/PETSc/IS.pyx":676 * return out * * def complement(self, nmin: int, nmax: int) -> IS: # <<<<<<<<<<<<<< * """Create a complement index set. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.IS.complement", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_out); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":712 * return out * * def embed(self, IS iset, drop: bool) -> IS: # <<<<<<<<<<<<<< * """Embed ``self`` into ``iset``. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_75embed(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2IS_74embed, "IS.embed(self, iset: IS, drop: bool) -> IS\nEmbed ``self`` into ``iset``.\n\n Not collective.\n\n The embedding is performed by finding the locations in ``iset`` that\n have the same indices as ``self``.\n\n Parameters\n ----------\n iset\n The index set to embed into.\n drop\n Flag indicating whether to drop indices from ``self`` that are not\n in ``iset``.\n\n Returns\n -------\n IS\n The embedded index set.\n\n See Also\n --------\n petsc.ISEmbed\n\n \nSource code at petsc4py/PETSc/IS.pyx:712"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_75embed(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscISObject *__pyx_v_iset = 0; PyObject *__pyx_v_drop = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("embed (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_iset,&__pyx_n_s_drop,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_iset)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 712, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_drop)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 712, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("embed", 1, 2, 2, 1); __PYX_ERR(39, 712, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "embed") < 0)) __PYX_ERR(39, 712, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_iset = ((struct PyPetscISObject *)values[0]); __pyx_v_drop = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("embed", 1, 2, 2, __pyx_nargs); __PYX_ERR(39, 712, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.IS.embed", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iset), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "iset", 0))) __PYX_ERR(39, 712, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_74embed(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_iset, __pyx_v_drop); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_74embed(struct PyPetscISObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset, PyObject *__pyx_v_drop) { PetscBool __pyx_v_bval; struct PyPetscISObject *__pyx_v_out = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("embed", 1); /* "petsc4py/PETSc/IS.pyx":738 * * """ * cdef PetscBool bval = drop # <<<<<<<<<<<<<< * cdef IS out = IS() * CHKERR( ISEmbed(self.iset, iset.iset, bval, &out.iset) ) */ __pyx_t_1 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_drop)); if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 738, __pyx_L1_error) __pyx_v_bval = __pyx_t_1; /* "petsc4py/PETSc/IS.pyx":739 * """ * cdef PetscBool bval = drop * cdef IS out = IS() # <<<<<<<<<<<<<< * CHKERR( ISEmbed(self.iset, iset.iset, bval, &out.iset) ) * return out */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_2)) __PYX_ERR(39, 739, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_out = ((struct PyPetscISObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/IS.pyx":740 * cdef PetscBool bval = drop * cdef IS out = IS() * CHKERR( ISEmbed(self.iset, iset.iset, bval, &out.iset) ) # <<<<<<<<<<<<<< * return out * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISEmbed(__pyx_v_self->iset, __pyx_v_iset->iset, __pyx_v_bval, (&__pyx_v_out->iset))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 740, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":741 * cdef IS out = IS() * CHKERR( ISEmbed(self.iset, iset.iset, bval, &out.iset) ) * return out # <<<<<<<<<<<<<< * * def renumber(self, IS mult=None) -> tuple[int, IS]: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_out); __pyx_r = ((PyObject *)__pyx_v_out); goto __pyx_L0; /* "petsc4py/PETSc/IS.pyx":712 * return out * * def embed(self, IS iset, drop: bool) -> IS: # <<<<<<<<<<<<<< * """Embed ``self`` into ``iset``. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.IS.embed", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_out); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":743 * return out * * def renumber(self, IS mult=None) -> tuple[int, IS]: # <<<<<<<<<<<<<< * """Renumber the non-negative entries of an index set, starting from 0. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_77renumber(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2IS_76renumber, "IS.renumber(self, mult: IS | None = None) -> tuple[int, IS]\nRenumber the non-negative entries of an index set, starting from 0.\n\n Collective.\n\n Parameters\n ----------\n mult\n The multiplicity of each entry in ``self``, default implies a\n multiplicity of 1.\n\n Returns\n -------\n int\n One past the largest entry of the new index set.\n IS\n The renumbered index set.\n\n See Also\n --------\n petsc.ISRenumber\n\n \nSource code at petsc4py/PETSc/IS.pyx:743"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_77renumber(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscISObject *__pyx_v_mult = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("renumber (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mult,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscISObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mult); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 743, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "renumber") < 0)) __PYX_ERR(39, 743, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_mult = ((struct PyPetscISObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("renumber", 0, 0, 1, __pyx_nargs); __PYX_ERR(39, 743, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.IS.renumber", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mult), __pyx_ptype_8petsc4py_5PETSc_IS, 1, "mult", 0))) __PYX_ERR(39, 743, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_76renumber(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_mult); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_76renumber(struct PyPetscISObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_mult) { IS __pyx_v_mlt; struct PyPetscISObject *__pyx_v_out = 0; PetscInt __pyx_v_n; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; IS __pyx_t_2; PyObject *__pyx_t_3 = NULL; PetscErrorCode __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("renumber", 1); /* "petsc4py/PETSc/IS.pyx":766 * * """ * cdef PetscIS mlt = NULL # <<<<<<<<<<<<<< * if mult is not None: mlt = mult.iset * cdef IS out = IS() */ __pyx_v_mlt = NULL; /* "petsc4py/PETSc/IS.pyx":767 * """ * cdef PetscIS mlt = NULL * if mult is not None: mlt = mult.iset # <<<<<<<<<<<<<< * cdef IS out = IS() * cdef PetscInt n = 0 */ __pyx_t_1 = (((PyObject *)__pyx_v_mult) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_mult->iset; __pyx_v_mlt = __pyx_t_2; } /* "petsc4py/PETSc/IS.pyx":768 * cdef PetscIS mlt = NULL * if mult is not None: mlt = mult.iset * cdef IS out = IS() # <<<<<<<<<<<<<< * cdef PetscInt n = 0 * CHKERR( ISRenumber(self.iset, mlt, &n, &out.iset) ) */ __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_out = ((struct PyPetscISObject *)__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/IS.pyx":769 * if mult is not None: mlt = mult.iset * cdef IS out = IS() * cdef PetscInt n = 0 # <<<<<<<<<<<<<< * CHKERR( ISRenumber(self.iset, mlt, &n, &out.iset) ) * return (toInt(n), out) */ __pyx_v_n = 0; /* "petsc4py/PETSc/IS.pyx":770 * cdef IS out = IS() * cdef PetscInt n = 0 * CHKERR( ISRenumber(self.iset, mlt, &n, &out.iset) ) # <<<<<<<<<<<<<< * return (toInt(n), out) * # */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISRenumber(__pyx_v_self->iset, __pyx_v_mlt, (&__pyx_v_n), (&__pyx_v_out->iset))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 770, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":771 * cdef PetscInt n = 0 * CHKERR( ISRenumber(self.iset, mlt, &n, &out.iset) ) * return (toInt(n), out) # <<<<<<<<<<<<<< * # * */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 771, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(39, 771, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3)) __PYX_ERR(39, 771, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_out); __Pyx_GIVEREF((PyObject *)__pyx_v_out); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_out))) __PYX_ERR(39, 771, __pyx_L1_error); __pyx_t_3 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "petsc4py/PETSc/IS.pyx":743 * return out * * def renumber(self, IS mult=None) -> tuple[int, IS]: # <<<<<<<<<<<<<< * """Renumber the non-negative entries of an index set, starting from 0. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.IS.renumber", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_out); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":774 * # * * def setIndices(self, indices: Sequence[int]) -> None: # <<<<<<<<<<<<<< * """Set the indices of an index set. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_79setIndices(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2IS_78setIndices, "IS.setIndices(self, indices: Sequence[int]) -> None\nSet the indices of an index set.\n\n Logically collective.\n\n The index set is assumed to be of type `IS.Type.GENERAL`.\n\n See Also\n --------\n petsc.ISGeneralSetIndices\n\n \nSource code at petsc4py/PETSc/IS.pyx:774"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_79setIndices(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_indices = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setIndices (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_indices,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_indices)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 774, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setIndices") < 0)) __PYX_ERR(39, 774, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_indices = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setIndices", 1, 1, 1, __pyx_nargs); __PYX_ERR(39, 774, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.IS.setIndices", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_78setIndices(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_indices); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_78setIndices(struct PyPetscISObject *__pyx_v_self, PyObject *__pyx_v_indices) { PetscInt __pyx_v_nidx; PetscInt *__pyx_v_idx; PetscCopyMode __pyx_v_cm; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setIndices", 0); __Pyx_INCREF(__pyx_v_indices); /* "petsc4py/PETSc/IS.pyx":786 * * """ * cdef PetscInt nidx = 0, *idx = NULL # <<<<<<<<<<<<<< * cdef PetscCopyMode cm = PETSC_COPY_VALUES * indices = iarray_i(indices, &nidx, &idx) */ __pyx_v_nidx = 0; __pyx_v_idx = NULL; /* "petsc4py/PETSc/IS.pyx":787 * """ * cdef PetscInt nidx = 0, *idx = NULL * cdef PetscCopyMode cm = PETSC_COPY_VALUES # <<<<<<<<<<<<<< * indices = iarray_i(indices, &nidx, &idx) * CHKERR( ISGeneralSetIndices(self.iset, nidx, idx, cm) ) */ __pyx_v_cm = PETSC_COPY_VALUES; /* "petsc4py/PETSc/IS.pyx":788 * cdef PetscInt nidx = 0, *idx = NULL * cdef PetscCopyMode cm = PETSC_COPY_VALUES * indices = iarray_i(indices, &nidx, &idx) # <<<<<<<<<<<<<< * CHKERR( ISGeneralSetIndices(self.iset, nidx, idx, cm) ) * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_indices, (&__pyx_v_nidx), (&__pyx_v_idx))); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 788, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_indices, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/IS.pyx":789 * cdef PetscCopyMode cm = PETSC_COPY_VALUES * indices = iarray_i(indices, &nidx, &idx) * CHKERR( ISGeneralSetIndices(self.iset, nidx, idx, cm) ) # <<<<<<<<<<<<<< * * def getIndices(self) -> ArrayInt: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISGeneralSetIndices(__pyx_v_self->iset, __pyx_v_nidx, __pyx_v_idx, __pyx_v_cm)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 789, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":774 * # * * def setIndices(self, indices: Sequence[int]) -> None: # <<<<<<<<<<<<<< * """Set the indices of an index set. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.IS.setIndices", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_indices); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":791 * CHKERR( ISGeneralSetIndices(self.iset, nidx, idx, cm) ) * * def getIndices(self) -> ArrayInt: # <<<<<<<<<<<<<< * """Return the indices of the index set. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_81getIndices(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2IS_80getIndices, "IS.getIndices(self) -> ArrayInt\nReturn the indices of the index set.\n\n Not collective.\n\n See Also\n --------\n petsc.ISGetIndices\n\n \nSource code at petsc4py/PETSc/IS.pyx:791"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_81getIndices(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getIndices (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getIndices", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getIndices", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_80getIndices(((struct PyPetscISObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_80getIndices(struct PyPetscISObject *__pyx_v_self) { PetscInt __pyx_v_size; PetscInt const *__pyx_v_indices; PyObject *__pyx_v_oindices = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; char const *__pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getIndices", 1); /* "petsc4py/PETSc/IS.pyx":801 * * """ * cdef PetscInt size = 0 # <<<<<<<<<<<<<< * cdef const PetscInt *indices = NULL * CHKERR( ISGetLocalSize(self.iset, &size) ) */ __pyx_v_size = 0; /* "petsc4py/PETSc/IS.pyx":802 * """ * cdef PetscInt size = 0 * cdef const PetscInt *indices = NULL # <<<<<<<<<<<<<< * CHKERR( ISGetLocalSize(self.iset, &size) ) * CHKERR( ISGetIndices(self.iset, &indices) ) */ __pyx_v_indices = NULL; /* "petsc4py/PETSc/IS.pyx":803 * cdef PetscInt size = 0 * cdef const PetscInt *indices = NULL * CHKERR( ISGetLocalSize(self.iset, &size) ) # <<<<<<<<<<<<<< * CHKERR( ISGetIndices(self.iset, &indices) ) * cdef object oindices = None */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISGetLocalSize(__pyx_v_self->iset, (&__pyx_v_size))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 803, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":804 * cdef const PetscInt *indices = NULL * CHKERR( ISGetLocalSize(self.iset, &size) ) * CHKERR( ISGetIndices(self.iset, &indices) ) # <<<<<<<<<<<<<< * cdef object oindices = None * try: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISGetIndices(__pyx_v_self->iset, (&__pyx_v_indices))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 804, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":805 * CHKERR( ISGetLocalSize(self.iset, &size) ) * CHKERR( ISGetIndices(self.iset, &indices) ) * cdef object oindices = None # <<<<<<<<<<<<<< * try: * oindices = array_i(size, indices) */ __Pyx_INCREF(Py_None); __pyx_v_oindices = Py_None; /* "petsc4py/PETSc/IS.pyx":806 * CHKERR( ISGetIndices(self.iset, &indices) ) * cdef object oindices = None * try: # <<<<<<<<<<<<<< * oindices = array_i(size, indices) * finally: */ /*try:*/ { /* "petsc4py/PETSc/IS.pyx":807 * cdef object oindices = None * try: * oindices = array_i(size, indices) # <<<<<<<<<<<<<< * finally: * CHKERR( ISRestoreIndices(self.iset, &indices) ) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i(__pyx_v_size, __pyx_v_indices)); if (unlikely(!__pyx_t_2)) __PYX_ERR(39, 807, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_oindices, __pyx_t_2); __pyx_t_2 = 0; } /* "petsc4py/PETSc/IS.pyx":809 * oindices = array_i(size, indices) * finally: * CHKERR( ISRestoreIndices(self.iset, &indices) ) # <<<<<<<<<<<<<< * return oindices * */ /*finally:*/ { /*normal exit:*/{ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISRestoreIndices(__pyx_v_self->iset, (&__pyx_v_indices))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 809, __pyx_L1_error) goto __pyx_L5; } __pyx_L4_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __pyx_t_3 = __pyx_lineno; __pyx_t_4 = __pyx_clineno; __pyx_t_5 = __pyx_filename; { __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISRestoreIndices(__pyx_v_self->iset, (&__pyx_v_indices))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 809, __pyx_L7_error) } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); } __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ErrRestore(__pyx_t_6, __pyx_t_7, __pyx_t_8); __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_lineno = __pyx_t_3; __pyx_clineno = __pyx_t_4; __pyx_filename = __pyx_t_5; goto __pyx_L1_error; __pyx_L7_error:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); } __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; goto __pyx_L1_error; } __pyx_L5:; } /* "petsc4py/PETSc/IS.pyx":810 * finally: * CHKERR( ISRestoreIndices(self.iset, &indices) ) * return oindices # <<<<<<<<<<<<<< * * def setBlockIndices(self, bsize: int, indices: Sequence[int]) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_oindices); __pyx_r = __pyx_v_oindices; goto __pyx_L0; /* "petsc4py/PETSc/IS.pyx":791 * CHKERR( ISGeneralSetIndices(self.iset, nidx, idx, cm) ) * * def getIndices(self) -> ArrayInt: # <<<<<<<<<<<<<< * """Return the indices of the index set. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.IS.getIndices", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_oindices); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":812 * return oindices * * def setBlockIndices(self, bsize: int, indices: Sequence[int]) -> None: # <<<<<<<<<<<<<< * """Set the indices for an index set with type `IS.Type.BLOCK`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_83setBlockIndices(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2IS_82setBlockIndices, "IS.setBlockIndices(self, bsize: int, indices: Sequence[int]) -> None\nSet the indices for an index set with type `IS.Type.BLOCK`.\n\n Collective.\n\n Parameters\n ----------\n bsize\n Number of elements in each block.\n indices\n List of integers.\n\n See Also\n --------\n petsc.ISBlockSetIndices\n\n \nSource code at petsc4py/PETSc/IS.pyx:812"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_83setBlockIndices(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_bsize = 0; PyObject *__pyx_v_indices = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setBlockIndices (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_bsize,&__pyx_n_s_indices,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_bsize)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 812, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_indices)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 812, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setBlockIndices", 1, 2, 2, 1); __PYX_ERR(39, 812, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setBlockIndices") < 0)) __PYX_ERR(39, 812, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_bsize = values[0]; __pyx_v_indices = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setBlockIndices", 1, 2, 2, __pyx_nargs); __PYX_ERR(39, 812, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.IS.setBlockIndices", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_82setBlockIndices(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_bsize, __pyx_v_indices); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_82setBlockIndices(struct PyPetscISObject *__pyx_v_self, PyObject *__pyx_v_bsize, PyObject *__pyx_v_indices) { PetscInt __pyx_v_bs; PetscInt __pyx_v_nidx; PetscInt *__pyx_v_idx; PetscCopyMode __pyx_v_cm; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setBlockIndices", 0); __Pyx_INCREF(__pyx_v_indices); /* "petsc4py/PETSc/IS.pyx":829 * * """ * cdef PetscInt bs = asInt(bsize) # <<<<<<<<<<<<<< * cdef PetscInt nidx = 0, *idx = NULL * cdef PetscCopyMode cm = PETSC_COPY_VALUES */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_bsize); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(39, 829, __pyx_L1_error) __pyx_v_bs = __pyx_t_1; /* "petsc4py/PETSc/IS.pyx":830 * """ * cdef PetscInt bs = asInt(bsize) * cdef PetscInt nidx = 0, *idx = NULL # <<<<<<<<<<<<<< * cdef PetscCopyMode cm = PETSC_COPY_VALUES * indices = iarray_i(indices, &nidx, &idx) */ __pyx_v_nidx = 0; __pyx_v_idx = NULL; /* "petsc4py/PETSc/IS.pyx":831 * cdef PetscInt bs = asInt(bsize) * cdef PetscInt nidx = 0, *idx = NULL * cdef PetscCopyMode cm = PETSC_COPY_VALUES # <<<<<<<<<<<<<< * indices = iarray_i(indices, &nidx, &idx) * CHKERR( ISBlockSetIndices(self.iset, bs, nidx, idx, cm) ) */ __pyx_v_cm = PETSC_COPY_VALUES; /* "petsc4py/PETSc/IS.pyx":832 * cdef PetscInt nidx = 0, *idx = NULL * cdef PetscCopyMode cm = PETSC_COPY_VALUES * indices = iarray_i(indices, &nidx, &idx) # <<<<<<<<<<<<<< * CHKERR( ISBlockSetIndices(self.iset, bs, nidx, idx, cm) ) * */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_indices, (&__pyx_v_nidx), (&__pyx_v_idx))); if (unlikely(!__pyx_t_2)) __PYX_ERR(39, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_indices, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/IS.pyx":833 * cdef PetscCopyMode cm = PETSC_COPY_VALUES * indices = iarray_i(indices, &nidx, &idx) * CHKERR( ISBlockSetIndices(self.iset, bs, nidx, idx, cm) ) # <<<<<<<<<<<<<< * * def getBlockIndices(self) -> ArrayInt: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISBlockSetIndices(__pyx_v_self->iset, __pyx_v_bs, __pyx_v_nidx, __pyx_v_idx, __pyx_v_cm)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 833, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":812 * return oindices * * def setBlockIndices(self, bsize: int, indices: Sequence[int]) -> None: # <<<<<<<<<<<<<< * """Set the indices for an index set with type `IS.Type.BLOCK`. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.IS.setBlockIndices", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_indices); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":835 * CHKERR( ISBlockSetIndices(self.iset, bs, nidx, idx, cm) ) * * def getBlockIndices(self) -> ArrayInt: # <<<<<<<<<<<<<< * """Return the indices of an index set with type `IS.Type.BLOCK`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_85getBlockIndices(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2IS_84getBlockIndices, "IS.getBlockIndices(self) -> ArrayInt\nReturn the indices of an index set with type `IS.Type.BLOCK`.\n\n Not collective.\n\n See Also\n --------\n petsc.ISBlockGetIndices\n\n \nSource code at petsc4py/PETSc/IS.pyx:835"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_85getBlockIndices(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getBlockIndices (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getBlockIndices", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getBlockIndices", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_84getBlockIndices(((struct PyPetscISObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_84getBlockIndices(struct PyPetscISObject *__pyx_v_self) { PetscInt __pyx_v_size; PetscInt __pyx_v_bs; PetscInt const *__pyx_v_indices; PyObject *__pyx_v_oindices = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; char const *__pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getBlockIndices", 1); /* "petsc4py/PETSc/IS.pyx":845 * * """ * cdef PetscInt size = 0, bs = 1 # <<<<<<<<<<<<<< * cdef const PetscInt *indices = NULL * CHKERR( ISGetLocalSize(self.iset, &size) ) */ __pyx_v_size = 0; __pyx_v_bs = 1; /* "petsc4py/PETSc/IS.pyx":846 * """ * cdef PetscInt size = 0, bs = 1 * cdef const PetscInt *indices = NULL # <<<<<<<<<<<<<< * CHKERR( ISGetLocalSize(self.iset, &size) ) * CHKERR( ISGetBlockSize(self.iset, &bs) ) */ __pyx_v_indices = NULL; /* "petsc4py/PETSc/IS.pyx":847 * cdef PetscInt size = 0, bs = 1 * cdef const PetscInt *indices = NULL * CHKERR( ISGetLocalSize(self.iset, &size) ) # <<<<<<<<<<<<<< * CHKERR( ISGetBlockSize(self.iset, &bs) ) * CHKERR( ISBlockGetIndices(self.iset, &indices) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISGetLocalSize(__pyx_v_self->iset, (&__pyx_v_size))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 847, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":848 * cdef const PetscInt *indices = NULL * CHKERR( ISGetLocalSize(self.iset, &size) ) * CHKERR( ISGetBlockSize(self.iset, &bs) ) # <<<<<<<<<<<<<< * CHKERR( ISBlockGetIndices(self.iset, &indices) ) * cdef object oindices = None */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISGetBlockSize(__pyx_v_self->iset, (&__pyx_v_bs))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 848, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":849 * CHKERR( ISGetLocalSize(self.iset, &size) ) * CHKERR( ISGetBlockSize(self.iset, &bs) ) * CHKERR( ISBlockGetIndices(self.iset, &indices) ) # <<<<<<<<<<<<<< * cdef object oindices = None * try: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISBlockGetIndices(__pyx_v_self->iset, (&__pyx_v_indices))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 849, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":850 * CHKERR( ISGetBlockSize(self.iset, &bs) ) * CHKERR( ISBlockGetIndices(self.iset, &indices) ) * cdef object oindices = None # <<<<<<<<<<<<<< * try: * oindices = array_i(size//bs, indices) */ __Pyx_INCREF(Py_None); __pyx_v_oindices = Py_None; /* "petsc4py/PETSc/IS.pyx":851 * CHKERR( ISBlockGetIndices(self.iset, &indices) ) * cdef object oindices = None * try: # <<<<<<<<<<<<<< * oindices = array_i(size//bs, indices) * finally: */ /*try:*/ { /* "petsc4py/PETSc/IS.pyx":852 * cdef object oindices = None * try: * oindices = array_i(size//bs, indices) # <<<<<<<<<<<<<< * finally: * CHKERR( ISBlockRestoreIndices(self.iset, &indices) ) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i((__pyx_v_size / __pyx_v_bs), __pyx_v_indices)); if (unlikely(!__pyx_t_2)) __PYX_ERR(39, 852, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_oindices, __pyx_t_2); __pyx_t_2 = 0; } /* "petsc4py/PETSc/IS.pyx":854 * oindices = array_i(size//bs, indices) * finally: * CHKERR( ISBlockRestoreIndices(self.iset, &indices) ) # <<<<<<<<<<<<<< * return oindices * */ /*finally:*/ { /*normal exit:*/{ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISBlockRestoreIndices(__pyx_v_self->iset, (&__pyx_v_indices))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 854, __pyx_L1_error) goto __pyx_L5; } __pyx_L4_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __pyx_t_3 = __pyx_lineno; __pyx_t_4 = __pyx_clineno; __pyx_t_5 = __pyx_filename; { __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISBlockRestoreIndices(__pyx_v_self->iset, (&__pyx_v_indices))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 854, __pyx_L7_error) } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); } __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ErrRestore(__pyx_t_6, __pyx_t_7, __pyx_t_8); __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_lineno = __pyx_t_3; __pyx_clineno = __pyx_t_4; __pyx_filename = __pyx_t_5; goto __pyx_L1_error; __pyx_L7_error:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); } __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; goto __pyx_L1_error; } __pyx_L5:; } /* "petsc4py/PETSc/IS.pyx":855 * finally: * CHKERR( ISBlockRestoreIndices(self.iset, &indices) ) * return oindices # <<<<<<<<<<<<<< * * def setStride(self, size: int, first: int = 0, step: int = 1) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_oindices); __pyx_r = __pyx_v_oindices; goto __pyx_L0; /* "petsc4py/PETSc/IS.pyx":835 * CHKERR( ISBlockSetIndices(self.iset, bs, nidx, idx, cm) ) * * def getBlockIndices(self) -> ArrayInt: # <<<<<<<<<<<<<< * """Return the indices of an index set with type `IS.Type.BLOCK`. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.IS.getBlockIndices", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_oindices); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":857 * return oindices * * def setStride(self, size: int, first: int = 0, step: int = 1) -> None: # <<<<<<<<<<<<<< * """Set the stride information for an index set with type `IS.Type.STRIDE`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_87setStride(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2IS_86setStride, "IS.setStride(self, size: int, first: int = 0, step: int = 1) -> None\nSet the stride information for an index set with type `IS.Type.STRIDE`.\n\n Logically collective.\n\n Parameters\n ----------\n size\n Length of the locally owned portion of the index set.\n first\n First element of the index set.\n step\n Difference between adjacent indices.\n\n See Also\n --------\n petsc.ISStrideSetStride\n\n \nSource code at petsc4py/PETSc/IS.pyx:857"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_87setStride(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_size = 0; PyObject *__pyx_v_first = 0; PyObject *__pyx_v_step = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setStride (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_first,&__pyx_n_s_step,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_0)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_1)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 857, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_first); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 857, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_step); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 857, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setStride") < 0)) __PYX_ERR(39, 857, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_size = values[0]; __pyx_v_first = values[1]; __pyx_v_step = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setStride", 0, 1, 3, __pyx_nargs); __PYX_ERR(39, 857, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.IS.setStride", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_86setStride(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_size, __pyx_v_first, __pyx_v_step); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_86setStride(struct PyPetscISObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_first, PyObject *__pyx_v_step) { PetscInt __pyx_v_csize; PetscInt __pyx_v_cfirst; PetscInt __pyx_v_cstep; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setStride", 1); /* "petsc4py/PETSc/IS.pyx":876 * * """ * cdef PetscInt csize = asInt(size) # <<<<<<<<<<<<<< * cdef PetscInt cfirst = asInt(first) * cdef PetscInt cstep = asInt(step) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_size); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(39, 876, __pyx_L1_error) __pyx_v_csize = __pyx_t_1; /* "petsc4py/PETSc/IS.pyx":877 * """ * cdef PetscInt csize = asInt(size) * cdef PetscInt cfirst = asInt(first) # <<<<<<<<<<<<<< * cdef PetscInt cstep = asInt(step) * CHKERR( ISStrideSetStride(self.iset, csize, cfirst, cstep) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_first); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(39, 877, __pyx_L1_error) __pyx_v_cfirst = __pyx_t_1; /* "petsc4py/PETSc/IS.pyx":878 * cdef PetscInt csize = asInt(size) * cdef PetscInt cfirst = asInt(first) * cdef PetscInt cstep = asInt(step) # <<<<<<<<<<<<<< * CHKERR( ISStrideSetStride(self.iset, csize, cfirst, cstep) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_step); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(39, 878, __pyx_L1_error) __pyx_v_cstep = __pyx_t_1; /* "petsc4py/PETSc/IS.pyx":879 * cdef PetscInt cfirst = asInt(first) * cdef PetscInt cstep = asInt(step) * CHKERR( ISStrideSetStride(self.iset, csize, cfirst, cstep) ) # <<<<<<<<<<<<<< * * def getStride(self) -> tuple[int, int, int]: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISStrideSetStride(__pyx_v_self->iset, __pyx_v_csize, __pyx_v_cfirst, __pyx_v_cstep)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 879, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":857 * return oindices * * def setStride(self, size: int, first: int = 0, step: int = 1) -> None: # <<<<<<<<<<<<<< * """Set the stride information for an index set with type `IS.Type.STRIDE`. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.IS.setStride", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":881 * CHKERR( ISStrideSetStride(self.iset, csize, cfirst, cstep) ) * * def getStride(self) -> tuple[int, int, int]: # <<<<<<<<<<<<<< * """Return size and stride information. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_89getStride(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2IS_88getStride, "IS.getStride(self) -> tuple[int, int, int]\nReturn size and stride information.\n\n Not collective.\n\n Returns\n -------\n size : int\n Length of the locally owned portion of the index set.\n first : int\n First element of the index set.\n step : int\n Difference between adjacent indices.\n\n See Also\n --------\n petsc.ISGetLocalSize, petsc.ISStrideGetInfo\n\n \nSource code at petsc4py/PETSc/IS.pyx:881"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_89getStride(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getStride (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getStride", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getStride", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_88getStride(((struct PyPetscISObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_88getStride(struct PyPetscISObject *__pyx_v_self) { PetscInt __pyx_v_size; PetscInt __pyx_v_first; PetscInt __pyx_v_step; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getStride", 1); /* "petsc4py/PETSc/IS.pyx":900 * * """ * cdef PetscInt size=0, first=0, step=0 # <<<<<<<<<<<<<< * CHKERR( ISGetLocalSize(self.iset, &size) ) * CHKERR( ISStrideGetInfo(self.iset, &first, &step) ) */ __pyx_v_size = 0; __pyx_v_first = 0; __pyx_v_step = 0; /* "petsc4py/PETSc/IS.pyx":901 * """ * cdef PetscInt size=0, first=0, step=0 * CHKERR( ISGetLocalSize(self.iset, &size) ) # <<<<<<<<<<<<<< * CHKERR( ISStrideGetInfo(self.iset, &first, &step) ) * return (toInt(size), toInt(first), toInt(step)) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISGetLocalSize(__pyx_v_self->iset, (&__pyx_v_size))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 901, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":902 * cdef PetscInt size=0, first=0, step=0 * CHKERR( ISGetLocalSize(self.iset, &size) ) * CHKERR( ISStrideGetInfo(self.iset, &first, &step) ) # <<<<<<<<<<<<<< * return (toInt(size), toInt(first), toInt(step)) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISStrideGetInfo(__pyx_v_self->iset, (&__pyx_v_first), (&__pyx_v_step))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 902, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":903 * CHKERR( ISGetLocalSize(self.iset, &size) ) * CHKERR( ISStrideGetInfo(self.iset, &first, &step) ) * return (toInt(size), toInt(first), toInt(step)) # <<<<<<<<<<<<<< * * def getInfo(self) -> tuple[int, int]: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(39, 903, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_first); if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 903, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_step); if (unlikely(!__pyx_t_4)) __PYX_ERR(39, 903, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(39, 903, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2)) __PYX_ERR(39, 903, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3)) __PYX_ERR(39, 903, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4)) __PYX_ERR(39, 903, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "petsc4py/PETSc/IS.pyx":881 * CHKERR( ISStrideSetStride(self.iset, csize, cfirst, cstep) ) * * def getStride(self) -> tuple[int, int, int]: # <<<<<<<<<<<<<< * """Return size and stride information. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.IS.getStride", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":905 * return (toInt(size), toInt(first), toInt(step)) * * def getInfo(self) -> tuple[int, int]: # <<<<<<<<<<<<<< * """Return stride information for an index set with type `IS.Type.STRIDE`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_91getInfo(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2IS_90getInfo, "IS.getInfo(self) -> tuple[int, int]\nReturn stride information for an index set with type `IS.Type.STRIDE`.\n\n Not collective.\n\n Returns\n -------\n first : int\n First element of the index set.\n step : int\n Difference between adjacent indices.\n\n See Also\n --------\n IS.getStride, petsc.ISStrideGetInfo\n\n \nSource code at petsc4py/PETSc/IS.pyx:905"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_91getInfo(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getInfo (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getInfo", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getInfo", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_90getInfo(((struct PyPetscISObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_90getInfo(struct PyPetscISObject *__pyx_v_self) { PetscInt __pyx_v_first; PetscInt __pyx_v_step; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getInfo", 1); /* "petsc4py/PETSc/IS.pyx":922 * * """ * cdef PetscInt first = 0, step = 0 # <<<<<<<<<<<<<< * CHKERR( ISStrideGetInfo(self.iset, &first, &step) ) * return (toInt(first), toInt(step)) */ __pyx_v_first = 0; __pyx_v_step = 0; /* "petsc4py/PETSc/IS.pyx":923 * """ * cdef PetscInt first = 0, step = 0 * CHKERR( ISStrideGetInfo(self.iset, &first, &step) ) # <<<<<<<<<<<<<< * return (toInt(first), toInt(step)) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISStrideGetInfo(__pyx_v_self->iset, (&__pyx_v_first), (&__pyx_v_step))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 923, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":924 * cdef PetscInt first = 0, step = 0 * CHKERR( ISStrideGetInfo(self.iset, &first, &step) ) * return (toInt(first), toInt(step)) # <<<<<<<<<<<<<< * * # */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_first); if (unlikely(!__pyx_t_2)) __PYX_ERR(39, 924, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_step); if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 924, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(39, 924, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(39, 924, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(39, 924, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "petsc4py/PETSc/IS.pyx":905 * return (toInt(size), toInt(first), toInt(step)) * * def getInfo(self) -> tuple[int, int]: # <<<<<<<<<<<<<< * """Return stride information for an index set with type `IS.Type.STRIDE`. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.IS.getInfo", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":938 * * """ * def __get__(self) -> bool: # <<<<<<<<<<<<<< * return self.isPermutation() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_11permutation_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_11permutation_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_11permutation___get__(((struct PyPetscISObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_11permutation___get__(struct PyPetscISObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/IS.pyx":939 * """ * def __get__(self) -> bool: * return self.isPermutation() # <<<<<<<<<<<<<< * * property identity: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_isPermutation); if (unlikely(!__pyx_t_2)) __PYX_ERR(39, 939, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 939, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/IS.pyx":938 * * """ * def __get__(self) -> bool: # <<<<<<<<<<<<<< * return self.isPermutation() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.IS.permutation.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":951 * * """ * def __get__(self) -> bool: # <<<<<<<<<<<<<< * return self.isIdentity() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_8identity_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_8identity_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_8identity___get__(((struct PyPetscISObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_8identity___get__(struct PyPetscISObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/IS.pyx":952 * """ * def __get__(self) -> bool: * return self.isIdentity() # <<<<<<<<<<<<<< * * property sorted: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_isIdentity); if (unlikely(!__pyx_t_2)) __PYX_ERR(39, 952, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 952, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/IS.pyx":951 * * """ * def __get__(self) -> bool: # <<<<<<<<<<<<<< * return self.isIdentity() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.IS.identity.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":964 * * """ * def __get__(self) -> bool: # <<<<<<<<<<<<<< * return self.isSorted() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_6sorted_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_6sorted_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_6sorted___get__(((struct PyPetscISObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_6sorted___get__(struct PyPetscISObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/IS.pyx":965 * """ * def __get__(self) -> bool: * return self.isSorted() # <<<<<<<<<<<<<< * * # */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_isSorted); if (unlikely(!__pyx_t_2)) __PYX_ERR(39, 965, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 965, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/IS.pyx":964 * * """ * def __get__(self) -> bool: # <<<<<<<<<<<<<< * return self.isSorted() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.IS.sorted.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":979 * * """ * def __get__(self) -> tuple[int, int]: # <<<<<<<<<<<<<< * return self.getSizes() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_5sizes_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_5sizes_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_5sizes___get__(((struct PyPetscISObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_5sizes___get__(struct PyPetscISObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/IS.pyx":980 * """ * def __get__(self) -> tuple[int, int]: * return self.getSizes() # <<<<<<<<<<<<<< * * property size: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getSizes); if (unlikely(!__pyx_t_2)) __PYX_ERR(39, 980, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 980, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/IS.pyx":979 * * """ * def __get__(self) -> tuple[int, int]: # <<<<<<<<<<<<<< * return self.getSizes() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.IS.sizes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":992 * * """ * def __get__(self) -> int: # <<<<<<<<<<<<<< * return self.getSize() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_4size_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_4size_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_4size___get__(((struct PyPetscISObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_4size___get__(struct PyPetscISObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/IS.pyx":993 * """ * def __get__(self) -> int: * return self.getSize() # <<<<<<<<<<<<<< * * property local_size: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getSize); if (unlikely(!__pyx_t_2)) __PYX_ERR(39, 993, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 993, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/IS.pyx":992 * * """ * def __get__(self) -> int: # <<<<<<<<<<<<<< * return self.getSize() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.IS.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":1005 * * """ * def __get__(self) -> int: # <<<<<<<<<<<<<< * return self.getLocalSize() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_10local_size_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_10local_size_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_10local_size___get__(((struct PyPetscISObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_10local_size___get__(struct PyPetscISObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/IS.pyx":1006 * """ * def __get__(self) -> int: * return self.getLocalSize() # <<<<<<<<<<<<<< * * property block_size: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getLocalSize); if (unlikely(!__pyx_t_2)) __PYX_ERR(39, 1006, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 1006, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/IS.pyx":1005 * * """ * def __get__(self) -> int: # <<<<<<<<<<<<<< * return self.getLocalSize() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.IS.local_size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":1018 * * """ * def __get__(self) -> int: # <<<<<<<<<<<<<< * return self.getBlockSize() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_10block_size_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_10block_size_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_10block_size___get__(((struct PyPetscISObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_10block_size___get__(struct PyPetscISObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/IS.pyx":1019 * """ * def __get__(self) -> int: * return self.getBlockSize() # <<<<<<<<<<<<<< * * property indices: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getBlockSize); if (unlikely(!__pyx_t_2)) __PYX_ERR(39, 1019, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 1019, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/IS.pyx":1018 * * """ * def __get__(self) -> int: # <<<<<<<<<<<<<< * return self.getBlockSize() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.IS.block_size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":1031 * * """ * def __get__(self) -> ArrayInt: # <<<<<<<<<<<<<< * return self.getIndices() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_7indices_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_7indices_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_7indices___get__(((struct PyPetscISObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_7indices___get__(struct PyPetscISObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/IS.pyx":1032 * """ * def __get__(self) -> ArrayInt: * return self.getIndices() # <<<<<<<<<<<<<< * * property array: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getIndices); if (unlikely(!__pyx_t_2)) __PYX_ERR(39, 1032, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 1032, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/IS.pyx":1031 * * """ * def __get__(self) -> ArrayInt: # <<<<<<<<<<<<<< * return self.getIndices() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.IS.indices.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":1040 * * """ * def __get__(self) -> ArrayInt: # <<<<<<<<<<<<<< * return asarray(self) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_5array_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_5array_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_5array___get__(((struct PyPetscISObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_5array___get__(struct PyPetscISObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/IS.pyx":1041 * """ * def __get__(self) -> ArrayInt: * return asarray(self) # <<<<<<<<<<<<<< * * # --- NumPy array interface (legacy) --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_asarray(((PyObject *)__pyx_v_self))); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 1041, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/IS.pyx":1040 * * """ * def __get__(self) -> ArrayInt: # <<<<<<<<<<<<<< * return asarray(self) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.IS.array.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":1046 * * property __array_interface__: * def __get__(self): # <<<<<<<<<<<<<< * cdef _IS_buffer buf = _IS_buffer(self) * return buf.__array_interface__ */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_19__array_interface___1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_19__array_interface___1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_19__array_interface_____get__(((struct PyPetscISObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_19__array_interface_____get__(struct PyPetscISObject *__pyx_v_self) { struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_buf = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/IS.pyx":1047 * property __array_interface__: * def __get__(self): * cdef _IS_buffer buf = _IS_buffer(self) # <<<<<<<<<<<<<< * return buf.__array_interface__ * */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc__IS_buffer), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 1047, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_buf = ((struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/IS.pyx":1048 * def __get__(self): * cdef _IS_buffer buf = _IS_buffer(self) * return buf.__array_interface__ # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_buf), __pyx_n_s_array_interface); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 1048, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/IS.pyx":1046 * * property __array_interface__: * def __get__(self): # <<<<<<<<<<<<<< * cdef _IS_buffer buf = _IS_buffer(self) * return buf.__array_interface__ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.IS.__array_interface__.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_buf); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":1091 * # * * def __cinit__(self) -> None: # <<<<<<<<<<<<<< * self.obj = &self.lgm * self.lgm = NULL */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_5LGMap_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_5LGMap_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap___cinit__(((struct PyPetscLGMapObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_5LGMap___cinit__(struct PyPetscLGMapObject *__pyx_v_self) { int __pyx_r; /* "petsc4py/PETSc/IS.pyx":1092 * * def __cinit__(self) -> None: * self.obj = &self.lgm # <<<<<<<<<<<<<< * self.lgm = NULL * */ __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->lgm)); /* "petsc4py/PETSc/IS.pyx":1093 * def __cinit__(self) -> None: * self.obj = &self.lgm * self.lgm = NULL # <<<<<<<<<<<<<< * * def __call__( */ __pyx_v_self->lgm = NULL; /* "petsc4py/PETSc/IS.pyx":1091 * # * * def __cinit__(self) -> None: # <<<<<<<<<<<<<< * self.obj = &self.lgm * self.lgm = NULL */ /* function exit code */ __pyx_r = 0; return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":1095 * self.lgm = NULL * * def __call__( # <<<<<<<<<<<<<< * self, * indices: Sequence[int], */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_5LGMap_2__call__, "Convert a locally numbered list of integers to a global numbering.\n\n Not collective.\n\n Parameters\n ----------\n indices\n Input indices in local numbering.\n result\n Array to write the global numbering to. If `None` then a\n new array will be allocated.\n\n See Also\n --------\n IS.apply, petsc.ISLocalToGlobalMappingApply\n\n "); #if CYTHON_UPDATE_DESCRIPTOR_DOC struct wrapperbase __pyx_wrapperbase_8petsc4py_5PETSc_5LGMap_2__call__; #endif static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_indices = 0; PyObject *__pyx_v_result = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_indices,&__pyx_n_s_result,0}; /* "petsc4py/PETSc/IS.pyx":1098 * self, * indices: Sequence[int], * result: ArrayInt | None = None # <<<<<<<<<<<<<< * ) -> None: * """Convert a locally numbered list of integers to a global numbering. */ values[1] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_indices)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 1095, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_result); if (value) { values[1] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 1095, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__call__") < 0)) __PYX_ERR(39, 1095, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_indices = values[0]; __pyx_v_result = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__call__", 0, 1, 2, __pyx_nargs); __PYX_ERR(39, 1095, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.LGMap.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_2__call__(((struct PyPetscLGMapObject *)__pyx_v_self), __pyx_v_indices, __pyx_v_result); /* "petsc4py/PETSc/IS.pyx":1095 * self.lgm = NULL * * def __call__( # <<<<<<<<<<<<<< * self, * indices: Sequence[int], */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_2__call__(struct PyPetscLGMapObject *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_result) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 1); /* "petsc4py/PETSc/IS.pyx":1117 * * """ * self.apply(indices, result) # <<<<<<<<<<<<<< * * # */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_apply); if (unlikely(!__pyx_t_2)) __PYX_ERR(39, 1117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_indices, __pyx_v_result}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 1117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/IS.pyx":1095 * self.lgm = NULL * * def __call__( # <<<<<<<<<<<<<< * self, * indices: Sequence[int], */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.LGMap.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":1121 * # * * def setType(self, lgmap_type: LGMap.Type | str) -> None: # <<<<<<<<<<<<<< * """Set the type of the local-to-global map. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_5setType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_5LGMap_4setType, "LGMap.setType(self, lgmap_type: LGMap.Type | str) -> None\nSet the type of the local-to-global map.\n\n Logically collective.\n\n Parameters\n ----------\n lgmap_type\n The type of the local-to-global mapping.\n\n Notes\n -----\n Use ``-islocaltoglobalmapping_type`` to set the type in the\n options database.\n\n See Also\n --------\n petsc_options, petsc.ISLocalToGlobalMappingSetType\n\n \nSource code at petsc4py/PETSc/IS.pyx:1121"); static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_5setType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_lgmap_type = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_lgmap_type,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_lgmap_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 1121, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setType") < 0)) __PYX_ERR(39, 1121, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_lgmap_type = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, __pyx_nargs); __PYX_ERR(39, 1121, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.LGMap.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_4setType(((struct PyPetscLGMapObject *)__pyx_v_self), __pyx_v_lgmap_type); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_4setType(struct PyPetscLGMapObject *__pyx_v_self, PyObject *__pyx_v_lgmap_type) { ISLocalToGlobalMappingType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setType", 0); __Pyx_INCREF(__pyx_v_lgmap_type); /* "petsc4py/PETSc/IS.pyx":1141 * * """ * cdef PetscISLocalToGlobalMappingType cval = NULL # <<<<<<<<<<<<<< * lgmap_type = str2bytes(lgmap_type, &cval) * CHKERR( ISLocalToGlobalMappingSetType(self.lgm, cval) ) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/IS.pyx":1142 * """ * cdef PetscISLocalToGlobalMappingType cval = NULL * lgmap_type = str2bytes(lgmap_type, &cval) # <<<<<<<<<<<<<< * CHKERR( ISLocalToGlobalMappingSetType(self.lgm, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_lgmap_type, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 1142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_lgmap_type, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/IS.pyx":1143 * cdef PetscISLocalToGlobalMappingType cval = NULL * lgmap_type = str2bytes(lgmap_type, &cval) * CHKERR( ISLocalToGlobalMappingSetType(self.lgm, cval) ) # <<<<<<<<<<<<<< * * def setFromOptions(self) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISLocalToGlobalMappingSetType(__pyx_v_self->lgm, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 1143, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":1121 * # * * def setType(self, lgmap_type: LGMap.Type | str) -> None: # <<<<<<<<<<<<<< * """Set the type of the local-to-global map. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.LGMap.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_lgmap_type); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":1145 * CHKERR( ISLocalToGlobalMappingSetType(self.lgm, cval) ) * * def setFromOptions(self) -> None: # <<<<<<<<<<<<<< * """Set mapping options from the options database. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_7setFromOptions(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_5LGMap_6setFromOptions, "LGMap.setFromOptions(self) -> None\nSet mapping options from the options database.\n\n Not collective.\n\n See Also\n --------\n petsc_options, petsc.ISLocalToGlobalMappingSetFromOptions\n\n \nSource code at petsc4py/PETSc/IS.pyx:1145"); static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_7setFromOptions(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFromOptions (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("setFromOptions", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setFromOptions", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_6setFromOptions(((struct PyPetscLGMapObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_6setFromOptions(struct PyPetscLGMapObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFromOptions", 1); /* "petsc4py/PETSc/IS.pyx":1155 * * """ * CHKERR( ISLocalToGlobalMappingSetFromOptions(self.lgm) ) # <<<<<<<<<<<<<< * * def view(self, Viewer viewer=None) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISLocalToGlobalMappingSetFromOptions(__pyx_v_self->lgm)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 1155, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":1145 * CHKERR( ISLocalToGlobalMappingSetType(self.lgm, cval) ) * * def setFromOptions(self) -> None: # <<<<<<<<<<<<<< * """Set mapping options from the options database. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.LGMap.setFromOptions", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":1157 * CHKERR( ISLocalToGlobalMappingSetFromOptions(self.lgm) ) * * def view(self, Viewer viewer=None) -> None: # <<<<<<<<<<<<<< * """View the local-to-global mapping. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_9view(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_5LGMap_8view, "LGMap.view(self, viewer: Viewer | None = None) -> None\nView the local-to-global mapping.\n\n Not collective.\n\n Parameters\n ----------\n viewer\n Viewer instance, defaults to an instance of `Viewer.Type.ASCII`.\n\n See Also\n --------\n petsc.ISLocalToGlobalMappingView\n\n \nSource code at petsc4py/PETSc/IS.pyx:1157"); static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_9view(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscViewerObject *__pyx_v_viewer = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("view (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscViewerObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_viewer); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 1157, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "view") < 0)) __PYX_ERR(39, 1157, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, __pyx_nargs); __PYX_ERR(39, 1157, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.LGMap.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(39, 1157, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_8view(((struct PyPetscLGMapObject *)__pyx_v_self), __pyx_v_viewer); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_8view(struct PyPetscLGMapObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer) { PetscViewer __pyx_v_cviewer; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscViewer __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("view", 1); /* "petsc4py/PETSc/IS.pyx":1172 * * """ * cdef PetscViewer cviewer = NULL # <<<<<<<<<<<<<< * if viewer is not None: cviewer = viewer.vwr * CHKERR( ISLocalToGlobalMappingView(self.lgm, cviewer) ) */ __pyx_v_cviewer = NULL; /* "petsc4py/PETSc/IS.pyx":1173 * """ * cdef PetscViewer cviewer = NULL * if viewer is not None: cviewer = viewer.vwr # <<<<<<<<<<<<<< * CHKERR( ISLocalToGlobalMappingView(self.lgm, cviewer) ) * */ __pyx_t_1 = (((PyObject *)__pyx_v_viewer) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_viewer->vwr; __pyx_v_cviewer = __pyx_t_2; } /* "petsc4py/PETSc/IS.pyx":1174 * cdef PetscViewer cviewer = NULL * if viewer is not None: cviewer = viewer.vwr * CHKERR( ISLocalToGlobalMappingView(self.lgm, cviewer) ) # <<<<<<<<<<<<<< * * def destroy(self) -> Self: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISLocalToGlobalMappingView(__pyx_v_self->lgm, __pyx_v_cviewer)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 1174, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":1157 * CHKERR( ISLocalToGlobalMappingSetFromOptions(self.lgm) ) * * def view(self, Viewer viewer=None) -> None: # <<<<<<<<<<<<<< * """View the local-to-global mapping. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.LGMap.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":1176 * CHKERR( ISLocalToGlobalMappingView(self.lgm, cviewer) ) * * def destroy(self) -> Self: # <<<<<<<<<<<<<< * """Destroy the local-to-global mapping. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_11destroy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_5LGMap_10destroy, "LGMap.destroy(self) -> Self\nDestroy the local-to-global mapping.\n\n Not collective.\n\n See Also\n --------\n petsc.ISLocalToGlobalMappingDestroy\n\n \nSource code at petsc4py/PETSc/IS.pyx:1176"); static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_11destroy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("destroy (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_10destroy(((struct PyPetscLGMapObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_10destroy(struct PyPetscLGMapObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("destroy", 1); /* "petsc4py/PETSc/IS.pyx":1186 * * """ * CHKERR( ISLocalToGlobalMappingDestroy(&self.lgm) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISLocalToGlobalMappingDestroy((&__pyx_v_self->lgm))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 1186, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":1187 * """ * CHKERR( ISLocalToGlobalMappingDestroy(&self.lgm) ) * return self # <<<<<<<<<<<<<< * * def create( */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/IS.pyx":1176 * CHKERR( ISLocalToGlobalMappingView(self.lgm, cviewer) ) * * def destroy(self) -> Self: # <<<<<<<<<<<<<< * """Destroy the local-to-global mapping. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.LGMap.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":1189 * return self * * def create( # <<<<<<<<<<<<<< * self, * indices: Sequence[int], */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_13create(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_5LGMap_12create, "LGMap.create(self, indices: Sequence[int], bsize: int | None = None, comm: Comm | None = None) -> Self\nCreate a local-to-global mapping.\n\n Not collective.\n\n Parameters\n ----------\n indices\n Global index for each local element.\n bsize\n Block size, defaults to 1.\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n petsc.ISLocalToGlobalMappingCreate\n\n \nSource code at petsc4py/PETSc/IS.pyx:1189"); static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_13create(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_indices = 0; PyObject *__pyx_v_bsize = 0; PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_indices,&__pyx_n_s_bsize,&__pyx_n_s_comm,0}; /* "petsc4py/PETSc/IS.pyx":1192 * self, * indices: Sequence[int], * bsize: int | None = None, # <<<<<<<<<<<<<< * comm: Comm | None = None * ) -> Self: */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/IS.pyx":1193 * indices: Sequence[int], * bsize: int | None = None, * comm: Comm | None = None # <<<<<<<<<<<<<< * ) -> Self: * """Create a local-to-global mapping. */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_indices)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 1189, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_bsize); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 1189, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 1189, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "create") < 0)) __PYX_ERR(39, 1189, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_indices = values[0]; __pyx_v_bsize = values[1]; __pyx_v_comm = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("create", 0, 1, 3, __pyx_nargs); __PYX_ERR(39, 1189, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.LGMap.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_12create(((struct PyPetscLGMapObject *)__pyx_v_self), __pyx_v_indices, __pyx_v_bsize, __pyx_v_comm); /* "petsc4py/PETSc/IS.pyx":1189 * return self * * def create( # <<<<<<<<<<<<<< * self, * indices: Sequence[int], */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_12create(struct PyPetscLGMapObject *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_bsize, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PetscInt __pyx_v_bs; PetscInt __pyx_v_nidx; PetscInt *__pyx_v_idx; PetscCopyMode __pyx_v_cm; ISLocalToGlobalMapping __pyx_v_newlgm; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; int __pyx_t_2; PetscInt __pyx_t_3; PyObject *__pyx_t_4 = NULL; PetscErrorCode __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create", 0); __Pyx_INCREF(__pyx_v_indices); /* "petsc4py/PETSc/IS.pyx":1213 * * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscInt bs = 1, nidx = 0, *idx = NULL * cdef PetscCopyMode cm = PETSC_COPY_VALUES */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(39, 1213, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/IS.pyx":1214 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt bs = 1, nidx = 0, *idx = NULL # <<<<<<<<<<<<<< * cdef PetscCopyMode cm = PETSC_COPY_VALUES * cdef PetscLGMap newlgm = NULL */ __pyx_v_bs = 1; __pyx_v_nidx = 0; __pyx_v_idx = NULL; /* "petsc4py/PETSc/IS.pyx":1215 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt bs = 1, nidx = 0, *idx = NULL * cdef PetscCopyMode cm = PETSC_COPY_VALUES # <<<<<<<<<<<<<< * cdef PetscLGMap newlgm = NULL * if bsize is not None: bs = asInt(bsize) */ __pyx_v_cm = PETSC_COPY_VALUES; /* "petsc4py/PETSc/IS.pyx":1216 * cdef PetscInt bs = 1, nidx = 0, *idx = NULL * cdef PetscCopyMode cm = PETSC_COPY_VALUES * cdef PetscLGMap newlgm = NULL # <<<<<<<<<<<<<< * if bsize is not None: bs = asInt(bsize) * if bs == PETSC_DECIDE: bs = 1 */ __pyx_v_newlgm = NULL; /* "petsc4py/PETSc/IS.pyx":1217 * cdef PetscCopyMode cm = PETSC_COPY_VALUES * cdef PetscLGMap newlgm = NULL * if bsize is not None: bs = asInt(bsize) # <<<<<<<<<<<<<< * if bs == PETSC_DECIDE: bs = 1 * indices = iarray_i(indices, &nidx, &idx) */ __pyx_t_2 = (__pyx_v_bsize != Py_None); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_bsize); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(39, 1217, __pyx_L1_error) __pyx_v_bs = __pyx_t_3; } /* "petsc4py/PETSc/IS.pyx":1218 * cdef PetscLGMap newlgm = NULL * if bsize is not None: bs = asInt(bsize) * if bs == PETSC_DECIDE: bs = 1 # <<<<<<<<<<<<<< * indices = iarray_i(indices, &nidx, &idx) * CHKERR( ISLocalToGlobalMappingCreate( */ __pyx_t_2 = (__pyx_v_bs == PETSC_DECIDE); if (__pyx_t_2) { __pyx_v_bs = 1; } /* "petsc4py/PETSc/IS.pyx":1219 * if bsize is not None: bs = asInt(bsize) * if bs == PETSC_DECIDE: bs = 1 * indices = iarray_i(indices, &nidx, &idx) # <<<<<<<<<<<<<< * CHKERR( ISLocalToGlobalMappingCreate( * ccomm, bs, nidx, idx, cm, &newlgm) ) */ __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_indices, (&__pyx_v_nidx), (&__pyx_v_idx))); if (unlikely(!__pyx_t_4)) __PYX_ERR(39, 1219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_indices, __pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/IS.pyx":1220 * if bs == PETSC_DECIDE: bs = 1 * indices = iarray_i(indices, &nidx, &idx) * CHKERR( ISLocalToGlobalMappingCreate( # <<<<<<<<<<<<<< * ccomm, bs, nidx, idx, cm, &newlgm) ) * CHKERR( PetscCLEAR(self.obj) ); self.lgm = newlgm */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISLocalToGlobalMappingCreate(__pyx_v_ccomm, __pyx_v_bs, __pyx_v_nidx, __pyx_v_idx, __pyx_v_cm, (&__pyx_v_newlgm))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 1220, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":1222 * CHKERR( ISLocalToGlobalMappingCreate( * ccomm, bs, nidx, idx, cm, &newlgm) ) * CHKERR( PetscCLEAR(self.obj) ); self.lgm = newlgm # <<<<<<<<<<<<<< * return self * */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 1222, __pyx_L1_error) __pyx_v_self->lgm = __pyx_v_newlgm; /* "petsc4py/PETSc/IS.pyx":1223 * ccomm, bs, nidx, idx, cm, &newlgm) ) * CHKERR( PetscCLEAR(self.obj) ); self.lgm = newlgm * return self # <<<<<<<<<<<<<< * * def createIS(self, IS iset) -> Self: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/IS.pyx":1189 * return self * * def create( # <<<<<<<<<<<<<< * self, * indices: Sequence[int], */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.LGMap.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_indices); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":1225 * return self * * def createIS(self, IS iset) -> Self: # <<<<<<<<<<<<<< * """Create a local-to-global mapping from an index set. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_15createIS(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_5LGMap_14createIS, "LGMap.createIS(self, iset: IS) -> Self\nCreate a local-to-global mapping from an index set.\n\n Not collective.\n\n Parameters\n ----------\n iset\n Index set containing the global numbers for each local number.\n\n See Also\n --------\n petsc.ISLocalToGlobalMappingCreateIS\n\n \nSource code at petsc4py/PETSc/IS.pyx:1225"); static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_15createIS(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscISObject *__pyx_v_iset = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createIS (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_iset,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_iset)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 1225, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createIS") < 0)) __PYX_ERR(39, 1225, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_iset = ((struct PyPetscISObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createIS", 1, 1, 1, __pyx_nargs); __PYX_ERR(39, 1225, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.LGMap.createIS", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iset), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "iset", 0))) __PYX_ERR(39, 1225, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_14createIS(((struct PyPetscLGMapObject *)__pyx_v_self), __pyx_v_iset); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_14createIS(struct PyPetscLGMapObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset) { ISLocalToGlobalMapping __pyx_v_newlgm; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createIS", 1); /* "petsc4py/PETSc/IS.pyx":1240 * * """ * cdef PetscLGMap newlgm = NULL # <<<<<<<<<<<<<< * CHKERR( ISLocalToGlobalMappingCreateIS( * iset.iset, &newlgm) ) */ __pyx_v_newlgm = NULL; /* "petsc4py/PETSc/IS.pyx":1241 * """ * cdef PetscLGMap newlgm = NULL * CHKERR( ISLocalToGlobalMappingCreateIS( # <<<<<<<<<<<<<< * iset.iset, &newlgm) ) * CHKERR( PetscCLEAR(self.obj) ); self.lgm = newlgm */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISLocalToGlobalMappingCreateIS(__pyx_v_iset->iset, (&__pyx_v_newlgm))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 1241, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":1243 * CHKERR( ISLocalToGlobalMappingCreateIS( * iset.iset, &newlgm) ) * CHKERR( PetscCLEAR(self.obj) ); self.lgm = newlgm # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 1243, __pyx_L1_error) __pyx_v_self->lgm = __pyx_v_newlgm; /* "petsc4py/PETSc/IS.pyx":1244 * iset.iset, &newlgm) ) * CHKERR( PetscCLEAR(self.obj) ); self.lgm = newlgm * return self # <<<<<<<<<<<<<< * * def createSF(self, SF sf, start: int) -> Self: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/IS.pyx":1225 * return self * * def createIS(self, IS iset) -> Self: # <<<<<<<<<<<<<< * """Create a local-to-global mapping from an index set. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.LGMap.createIS", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":1246 * return self * * def createSF(self, SF sf, start: int) -> Self: # <<<<<<<<<<<<<< * """Create a local-to-global mapping from a star forest. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_17createSF(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_5LGMap_16createSF, "LGMap.createSF(self, sf: SF, start: int) -> Self\nCreate a local-to-global mapping from a star forest.\n\n Collective.\n\n Parameters\n ----------\n sf\n Star forest mapping contiguous local indices to (rank, offset).\n start\n First global index on this process.\n\n See Also\n --------\n petsc.ISLocalToGlobalMappingCreateSF\n\n \nSource code at petsc4py/PETSc/IS.pyx:1246"); static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_17createSF(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscSFObject *__pyx_v_sf = 0; PyObject *__pyx_v_start = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createSF (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sf,&__pyx_n_s_start,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sf)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 1246, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_start)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 1246, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("createSF", 1, 2, 2, 1); __PYX_ERR(39, 1246, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createSF") < 0)) __PYX_ERR(39, 1246, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_sf = ((struct PyPetscSFObject *)values[0]); __pyx_v_start = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createSF", 1, 2, 2, __pyx_nargs); __PYX_ERR(39, 1246, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.LGMap.createSF", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sf), __pyx_ptype_8petsc4py_5PETSc_SF, 0, "sf", 0))) __PYX_ERR(39, 1246, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_16createSF(((struct PyPetscLGMapObject *)__pyx_v_self), __pyx_v_sf, __pyx_v_start); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_16createSF(struct PyPetscLGMapObject *__pyx_v_self, struct PyPetscSFObject *__pyx_v_sf, PyObject *__pyx_v_start) { ISLocalToGlobalMapping __pyx_v_newlgm; PetscInt __pyx_v_cstart; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createSF", 1); /* "petsc4py/PETSc/IS.pyx":1263 * * """ * cdef PetscLGMap newlgm = NULL # <<<<<<<<<<<<<< * cdef PetscInt cstart = asInt(start) * CHKERR( ISLocalToGlobalMappingCreateSF(sf.sf, cstart, &newlgm) ) */ __pyx_v_newlgm = NULL; /* "petsc4py/PETSc/IS.pyx":1264 * """ * cdef PetscLGMap newlgm = NULL * cdef PetscInt cstart = asInt(start) # <<<<<<<<<<<<<< * CHKERR( ISLocalToGlobalMappingCreateSF(sf.sf, cstart, &newlgm) ) * CHKERR( PetscCLEAR(self.obj) ); self.lgm = newlgm */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_start); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(39, 1264, __pyx_L1_error) __pyx_v_cstart = __pyx_t_1; /* "petsc4py/PETSc/IS.pyx":1265 * cdef PetscLGMap newlgm = NULL * cdef PetscInt cstart = asInt(start) * CHKERR( ISLocalToGlobalMappingCreateSF(sf.sf, cstart, &newlgm) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.lgm = newlgm * return self */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISLocalToGlobalMappingCreateSF(__pyx_v_sf->sf, __pyx_v_cstart, (&__pyx_v_newlgm))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 1265, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":1266 * cdef PetscInt cstart = asInt(start) * CHKERR( ISLocalToGlobalMappingCreateSF(sf.sf, cstart, &newlgm) ) * CHKERR( PetscCLEAR(self.obj) ); self.lgm = newlgm # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 1266, __pyx_L1_error) __pyx_v_self->lgm = __pyx_v_newlgm; /* "petsc4py/PETSc/IS.pyx":1267 * CHKERR( ISLocalToGlobalMappingCreateSF(sf.sf, cstart, &newlgm) ) * CHKERR( PetscCLEAR(self.obj) ); self.lgm = newlgm * return self # <<<<<<<<<<<<<< * * def getSize(self) -> int: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/IS.pyx":1246 * return self * * def createSF(self, SF sf, start: int) -> Self: # <<<<<<<<<<<<<< * """Create a local-to-global mapping from a star forest. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.LGMap.createSF", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":1269 * return self * * def getSize(self) -> int: # <<<<<<<<<<<<<< * """Return the local size of the local-to-global mapping. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_19getSize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_5LGMap_18getSize, "LGMap.getSize(self) -> int\nReturn the local size of the local-to-global mapping.\n\n Not collective.\n\n See Also\n --------\n petsc.ISLocalToGlobalMappingGetSize\n\n \nSource code at petsc4py/PETSc/IS.pyx:1269"); static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_19getSize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSize (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getSize", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getSize", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_18getSize(((struct PyPetscLGMapObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_18getSize(struct PyPetscLGMapObject *__pyx_v_self) { PetscInt __pyx_v_n; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSize", 1); /* "petsc4py/PETSc/IS.pyx":1279 * * """ * cdef PetscInt n = 0 # <<<<<<<<<<<<<< * CHKERR( ISLocalToGlobalMappingGetSize(self.lgm, &n) ) * return toInt(n) */ __pyx_v_n = 0; /* "petsc4py/PETSc/IS.pyx":1280 * """ * cdef PetscInt n = 0 * CHKERR( ISLocalToGlobalMappingGetSize(self.lgm, &n) ) # <<<<<<<<<<<<<< * return toInt(n) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISLocalToGlobalMappingGetSize(__pyx_v_self->lgm, (&__pyx_v_n))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 1280, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":1281 * cdef PetscInt n = 0 * CHKERR( ISLocalToGlobalMappingGetSize(self.lgm, &n) ) * return toInt(n) # <<<<<<<<<<<<<< * * def getBlockSize(self) -> int: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(39, 1281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/IS.pyx":1269 * return self * * def getSize(self) -> int: # <<<<<<<<<<<<<< * """Return the local size of the local-to-global mapping. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.LGMap.getSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":1283 * return toInt(n) * * def getBlockSize(self) -> int: # <<<<<<<<<<<<<< * """Return the block size of the local-to-global mapping. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_21getBlockSize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_5LGMap_20getBlockSize, "LGMap.getBlockSize(self) -> int\nReturn the block size of the local-to-global mapping.\n\n Not collective.\n\n See Also\n --------\n petsc.ISLocalToGlobalMappingGetBlockSize\n\n \nSource code at petsc4py/PETSc/IS.pyx:1283"); static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_21getBlockSize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getBlockSize (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getBlockSize", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getBlockSize", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_20getBlockSize(((struct PyPetscLGMapObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_20getBlockSize(struct PyPetscLGMapObject *__pyx_v_self) { PetscInt __pyx_v_bs; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getBlockSize", 1); /* "petsc4py/PETSc/IS.pyx":1293 * * """ * cdef PetscInt bs = 1 # <<<<<<<<<<<<<< * CHKERR( ISLocalToGlobalMappingGetBlockSize(self.lgm, &bs) ) * return toInt(bs) */ __pyx_v_bs = 1; /* "petsc4py/PETSc/IS.pyx":1294 * """ * cdef PetscInt bs = 1 * CHKERR( ISLocalToGlobalMappingGetBlockSize(self.lgm, &bs) ) # <<<<<<<<<<<<<< * return toInt(bs) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISLocalToGlobalMappingGetBlockSize(__pyx_v_self->lgm, (&__pyx_v_bs))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 1294, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":1295 * cdef PetscInt bs = 1 * CHKERR( ISLocalToGlobalMappingGetBlockSize(self.lgm, &bs) ) * return toInt(bs) # <<<<<<<<<<<<<< * * def getIndices(self) -> ArrayInt: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_bs); if (unlikely(!__pyx_t_2)) __PYX_ERR(39, 1295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/IS.pyx":1283 * return toInt(n) * * def getBlockSize(self) -> int: # <<<<<<<<<<<<<< * """Return the block size of the local-to-global mapping. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.LGMap.getBlockSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":1297 * return toInt(bs) * * def getIndices(self) -> ArrayInt: # <<<<<<<<<<<<<< * """Return the global indices for each local point in the mapping. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_23getIndices(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_5LGMap_22getIndices, "LGMap.getIndices(self) -> ArrayInt\nReturn the global indices for each local point in the mapping.\n\n Not collective.\n\n See Also\n --------\n petsc.ISLocalToGlobalMappingGetIndices\n\n \nSource code at petsc4py/PETSc/IS.pyx:1297"); static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_23getIndices(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getIndices (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getIndices", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getIndices", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_22getIndices(((struct PyPetscLGMapObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_22getIndices(struct PyPetscLGMapObject *__pyx_v_self) { PetscInt __pyx_v_size; PetscInt const *__pyx_v_indices; PyObject *__pyx_v_oindices = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; char const *__pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getIndices", 1); /* "petsc4py/PETSc/IS.pyx":1307 * * """ * cdef PetscInt size = 0 # <<<<<<<<<<<<<< * cdef const PetscInt *indices = NULL * CHKERR( ISLocalToGlobalMappingGetSize( */ __pyx_v_size = 0; /* "petsc4py/PETSc/IS.pyx":1308 * """ * cdef PetscInt size = 0 * cdef const PetscInt *indices = NULL # <<<<<<<<<<<<<< * CHKERR( ISLocalToGlobalMappingGetSize( * self.lgm, &size) ) */ __pyx_v_indices = NULL; /* "petsc4py/PETSc/IS.pyx":1309 * cdef PetscInt size = 0 * cdef const PetscInt *indices = NULL * CHKERR( ISLocalToGlobalMappingGetSize( # <<<<<<<<<<<<<< * self.lgm, &size) ) * CHKERR( ISLocalToGlobalMappingGetIndices( */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISLocalToGlobalMappingGetSize(__pyx_v_self->lgm, (&__pyx_v_size))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 1309, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":1311 * CHKERR( ISLocalToGlobalMappingGetSize( * self.lgm, &size) ) * CHKERR( ISLocalToGlobalMappingGetIndices( # <<<<<<<<<<<<<< * self.lgm, &indices) ) * cdef object oindices = None */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISLocalToGlobalMappingGetIndices(__pyx_v_self->lgm, (&__pyx_v_indices))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 1311, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":1313 * CHKERR( ISLocalToGlobalMappingGetIndices( * self.lgm, &indices) ) * cdef object oindices = None # <<<<<<<<<<<<<< * try: * oindices = array_i(size, indices) */ __Pyx_INCREF(Py_None); __pyx_v_oindices = Py_None; /* "petsc4py/PETSc/IS.pyx":1314 * self.lgm, &indices) ) * cdef object oindices = None * try: # <<<<<<<<<<<<<< * oindices = array_i(size, indices) * finally: */ /*try:*/ { /* "petsc4py/PETSc/IS.pyx":1315 * cdef object oindices = None * try: * oindices = array_i(size, indices) # <<<<<<<<<<<<<< * finally: * CHKERR( ISLocalToGlobalMappingRestoreIndices( */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i(__pyx_v_size, __pyx_v_indices)); if (unlikely(!__pyx_t_2)) __PYX_ERR(39, 1315, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_oindices, __pyx_t_2); __pyx_t_2 = 0; } /* "petsc4py/PETSc/IS.pyx":1317 * oindices = array_i(size, indices) * finally: * CHKERR( ISLocalToGlobalMappingRestoreIndices( # <<<<<<<<<<<<<< * self.lgm, &indices) ) * return oindices */ /*finally:*/ { /*normal exit:*/{ /* "petsc4py/PETSc/IS.pyx":1318 * finally: * CHKERR( ISLocalToGlobalMappingRestoreIndices( * self.lgm, &indices) ) # <<<<<<<<<<<<<< * return oindices * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISLocalToGlobalMappingRestoreIndices(__pyx_v_self->lgm, (&__pyx_v_indices))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 1317, __pyx_L1_error) goto __pyx_L5; } __pyx_L4_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __pyx_t_3 = __pyx_lineno; __pyx_t_4 = __pyx_clineno; __pyx_t_5 = __pyx_filename; { /* "petsc4py/PETSc/IS.pyx":1317 * oindices = array_i(size, indices) * finally: * CHKERR( ISLocalToGlobalMappingRestoreIndices( # <<<<<<<<<<<<<< * self.lgm, &indices) ) * return oindices */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISLocalToGlobalMappingRestoreIndices(__pyx_v_self->lgm, (&__pyx_v_indices))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 1317, __pyx_L7_error) } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); } __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ErrRestore(__pyx_t_6, __pyx_t_7, __pyx_t_8); __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_lineno = __pyx_t_3; __pyx_clineno = __pyx_t_4; __pyx_filename = __pyx_t_5; goto __pyx_L1_error; __pyx_L7_error:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); } __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; goto __pyx_L1_error; } __pyx_L5:; } /* "petsc4py/PETSc/IS.pyx":1319 * CHKERR( ISLocalToGlobalMappingRestoreIndices( * self.lgm, &indices) ) * return oindices # <<<<<<<<<<<<<< * * def getBlockIndices(self) -> ArrayInt: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_oindices); __pyx_r = __pyx_v_oindices; goto __pyx_L0; /* "petsc4py/PETSc/IS.pyx":1297 * return toInt(bs) * * def getIndices(self) -> ArrayInt: # <<<<<<<<<<<<<< * """Return the global indices for each local point in the mapping. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.LGMap.getIndices", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_oindices); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":1321 * return oindices * * def getBlockIndices(self) -> ArrayInt: # <<<<<<<<<<<<<< * """Return the global indices for each local block. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_25getBlockIndices(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_5LGMap_24getBlockIndices, "LGMap.getBlockIndices(self) -> ArrayInt\nReturn the global indices for each local block.\n\n Not collective.\n\n See Also\n --------\n petsc.ISLocalToGlobalMappingGetBlockIndices\n\n \nSource code at petsc4py/PETSc/IS.pyx:1321"); static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_25getBlockIndices(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getBlockIndices (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getBlockIndices", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getBlockIndices", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_24getBlockIndices(((struct PyPetscLGMapObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_24getBlockIndices(struct PyPetscLGMapObject *__pyx_v_self) { PetscInt __pyx_v_size; PetscInt __pyx_v_bs; PetscInt const *__pyx_v_indices; PyObject *__pyx_v_oindices = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; char const *__pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getBlockIndices", 1); /* "petsc4py/PETSc/IS.pyx":1331 * * """ * cdef PetscInt size = 0, bs = 1 # <<<<<<<<<<<<<< * cdef const PetscInt *indices = NULL * CHKERR( ISLocalToGlobalMappingGetSize( */ __pyx_v_size = 0; __pyx_v_bs = 1; /* "petsc4py/PETSc/IS.pyx":1332 * """ * cdef PetscInt size = 0, bs = 1 * cdef const PetscInt *indices = NULL # <<<<<<<<<<<<<< * CHKERR( ISLocalToGlobalMappingGetSize( * self.lgm, &size) ) */ __pyx_v_indices = NULL; /* "petsc4py/PETSc/IS.pyx":1333 * cdef PetscInt size = 0, bs = 1 * cdef const PetscInt *indices = NULL * CHKERR( ISLocalToGlobalMappingGetSize( # <<<<<<<<<<<<<< * self.lgm, &size) ) * CHKERR( ISLocalToGlobalMappingGetBlockSize( */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISLocalToGlobalMappingGetSize(__pyx_v_self->lgm, (&__pyx_v_size))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 1333, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":1335 * CHKERR( ISLocalToGlobalMappingGetSize( * self.lgm, &size) ) * CHKERR( ISLocalToGlobalMappingGetBlockSize( # <<<<<<<<<<<<<< * self.lgm, &bs) ) * CHKERR( ISLocalToGlobalMappingGetBlockIndices( */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISLocalToGlobalMappingGetBlockSize(__pyx_v_self->lgm, (&__pyx_v_bs))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 1335, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":1337 * CHKERR( ISLocalToGlobalMappingGetBlockSize( * self.lgm, &bs) ) * CHKERR( ISLocalToGlobalMappingGetBlockIndices( # <<<<<<<<<<<<<< * self.lgm, &indices) ) * cdef object oindices = None */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISLocalToGlobalMappingGetBlockIndices(__pyx_v_self->lgm, (&__pyx_v_indices))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 1337, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":1339 * CHKERR( ISLocalToGlobalMappingGetBlockIndices( * self.lgm, &indices) ) * cdef object oindices = None # <<<<<<<<<<<<<< * try: * oindices = array_i(size//bs, indices) */ __Pyx_INCREF(Py_None); __pyx_v_oindices = Py_None; /* "petsc4py/PETSc/IS.pyx":1340 * self.lgm, &indices) ) * cdef object oindices = None * try: # <<<<<<<<<<<<<< * oindices = array_i(size//bs, indices) * finally: */ /*try:*/ { /* "petsc4py/PETSc/IS.pyx":1341 * cdef object oindices = None * try: * oindices = array_i(size//bs, indices) # <<<<<<<<<<<<<< * finally: * CHKERR( ISLocalToGlobalMappingRestoreBlockIndices( */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i((__pyx_v_size / __pyx_v_bs), __pyx_v_indices)); if (unlikely(!__pyx_t_2)) __PYX_ERR(39, 1341, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_oindices, __pyx_t_2); __pyx_t_2 = 0; } /* "petsc4py/PETSc/IS.pyx":1343 * oindices = array_i(size//bs, indices) * finally: * CHKERR( ISLocalToGlobalMappingRestoreBlockIndices( # <<<<<<<<<<<<<< * self.lgm, &indices) ) * return oindices */ /*finally:*/ { /*normal exit:*/{ /* "petsc4py/PETSc/IS.pyx":1344 * finally: * CHKERR( ISLocalToGlobalMappingRestoreBlockIndices( * self.lgm, &indices) ) # <<<<<<<<<<<<<< * return oindices * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISLocalToGlobalMappingRestoreBlockIndices(__pyx_v_self->lgm, (&__pyx_v_indices))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 1343, __pyx_L1_error) goto __pyx_L5; } __pyx_L4_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __pyx_t_3 = __pyx_lineno; __pyx_t_4 = __pyx_clineno; __pyx_t_5 = __pyx_filename; { /* "petsc4py/PETSc/IS.pyx":1343 * oindices = array_i(size//bs, indices) * finally: * CHKERR( ISLocalToGlobalMappingRestoreBlockIndices( # <<<<<<<<<<<<<< * self.lgm, &indices) ) * return oindices */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISLocalToGlobalMappingRestoreBlockIndices(__pyx_v_self->lgm, (&__pyx_v_indices))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 1343, __pyx_L7_error) } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); } __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ErrRestore(__pyx_t_6, __pyx_t_7, __pyx_t_8); __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_lineno = __pyx_t_3; __pyx_clineno = __pyx_t_4; __pyx_filename = __pyx_t_5; goto __pyx_L1_error; __pyx_L7_error:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); } __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; goto __pyx_L1_error; } __pyx_L5:; } /* "petsc4py/PETSc/IS.pyx":1345 * CHKERR( ISLocalToGlobalMappingRestoreBlockIndices( * self.lgm, &indices) ) * return oindices # <<<<<<<<<<<<<< * * def getInfo(self) -> dict[int, ArrayInt]: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_oindices); __pyx_r = __pyx_v_oindices; goto __pyx_L0; /* "petsc4py/PETSc/IS.pyx":1321 * return oindices * * def getBlockIndices(self) -> ArrayInt: # <<<<<<<<<<<<<< * """Return the global indices for each local block. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.LGMap.getBlockIndices", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_oindices); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":1347 * return oindices * * def getInfo(self) -> dict[int, ArrayInt]: # <<<<<<<<<<<<<< * """Determine the indices shared with neighboring processes. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_27getInfo(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_5LGMap_26getInfo, "LGMap.getInfo(self) -> dict[int, ArrayInt]\nDetermine the indices shared with neighboring processes.\n\n Collective.\n\n Returns\n -------\n dict\n Mapping from neighboring processor number to an array of shared\n indices (in local numbering).\n\n See Also\n --------\n petsc.ISLocalToGlobalMappingGetInfo\n\n \nSource code at petsc4py/PETSc/IS.pyx:1347"); static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_27getInfo(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getInfo (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getInfo", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getInfo", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_26getInfo(((struct PyPetscLGMapObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_26getInfo(struct PyPetscLGMapObject *__pyx_v_self) { PetscInt __pyx_v_i; PetscInt __pyx_v_nproc; PetscInt *__pyx_v_procs; PetscInt *__pyx_v_numprocs; PetscInt **__pyx_v_indices; PyObject *__pyx_v_neighs = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; PetscInt __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_t_6; char const *__pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getInfo", 1); /* "petsc4py/PETSc/IS.pyx":1363 * * """ * cdef PetscInt i, nproc = 0, *procs = NULL, # <<<<<<<<<<<<<< * cdef PetscInt *numprocs = NULL, **indices = NULL * cdef object neighs = { } */ __pyx_v_nproc = 0; __pyx_v_procs = NULL; /* "petsc4py/PETSc/IS.pyx":1364 * """ * cdef PetscInt i, nproc = 0, *procs = NULL, * cdef PetscInt *numprocs = NULL, **indices = NULL # <<<<<<<<<<<<<< * cdef object neighs = { } * CHKERR( ISLocalToGlobalMappingGetInfo( */ __pyx_v_numprocs = NULL; __pyx_v_indices = NULL; /* "petsc4py/PETSc/IS.pyx":1365 * cdef PetscInt i, nproc = 0, *procs = NULL, * cdef PetscInt *numprocs = NULL, **indices = NULL * cdef object neighs = { } # <<<<<<<<<<<<<< * CHKERR( ISLocalToGlobalMappingGetInfo( * self.lgm, &nproc, &procs, &numprocs, &indices) ) */ __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 1365, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_neighs = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/IS.pyx":1366 * cdef PetscInt *numprocs = NULL, **indices = NULL * cdef object neighs = { } * CHKERR( ISLocalToGlobalMappingGetInfo( # <<<<<<<<<<<<<< * self.lgm, &nproc, &procs, &numprocs, &indices) ) * try: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISLocalToGlobalMappingGetInfo(__pyx_v_self->lgm, (&__pyx_v_nproc), (&__pyx_v_procs), (&__pyx_v_numprocs), (&__pyx_v_indices))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 1366, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":1368 * CHKERR( ISLocalToGlobalMappingGetInfo( * self.lgm, &nproc, &procs, &numprocs, &indices) ) * try: # <<<<<<<<<<<<<< * for i from 0 <= i < nproc: * neighs[toInt(procs[i])] = array_i(numprocs[i], indices[i]) */ /*try:*/ { /* "petsc4py/PETSc/IS.pyx":1369 * self.lgm, &nproc, &procs, &numprocs, &indices) ) * try: * for i from 0 <= i < nproc: # <<<<<<<<<<<<<< * neighs[toInt(procs[i])] = array_i(numprocs[i], indices[i]) * finally: */ __pyx_t_3 = __pyx_v_nproc; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { /* "petsc4py/PETSc/IS.pyx":1370 * try: * for i from 0 <= i < nproc: * neighs[toInt(procs[i])] = array_i(numprocs[i], indices[i]) # <<<<<<<<<<<<<< * finally: * ISLocalToGlobalMappingRestoreInfo( */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i((__pyx_v_numprocs[__pyx_v_i]), (__pyx_v_indices[__pyx_v_i]))); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 1370, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_procs[__pyx_v_i])); if (unlikely(!__pyx_t_4)) __PYX_ERR(39, 1370, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_4); if (unlikely((PyObject_SetItem(__pyx_v_neighs, __pyx_t_4, __pyx_t_1) < 0))) __PYX_ERR(39, 1370, __pyx_L4_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } } /* "petsc4py/PETSc/IS.pyx":1372 * neighs[toInt(procs[i])] = array_i(numprocs[i], indices[i]) * finally: * ISLocalToGlobalMappingRestoreInfo( # <<<<<<<<<<<<<< * self.lgm, &nproc, &procs, &numprocs, &indices) * return neighs */ /*finally:*/ { /*normal exit:*/{ /* "petsc4py/PETSc/IS.pyx":1373 * finally: * ISLocalToGlobalMappingRestoreInfo( * self.lgm, &nproc, &procs, &numprocs, &indices) # <<<<<<<<<<<<<< * return neighs * */ (void)(ISLocalToGlobalMappingRestoreInfo(__pyx_v_self->lgm, (&__pyx_v_nproc), (&__pyx_v_procs), (&__pyx_v_numprocs), (&__pyx_v_indices))); goto __pyx_L5; } __pyx_L4_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10) < 0)) __Pyx_ErrFetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); __pyx_t_5 = __pyx_lineno; __pyx_t_6 = __pyx_clineno; __pyx_t_7 = __pyx_filename; { /* "petsc4py/PETSc/IS.pyx":1372 * neighs[toInt(procs[i])] = array_i(numprocs[i], indices[i]) * finally: * ISLocalToGlobalMappingRestoreInfo( # <<<<<<<<<<<<<< * self.lgm, &nproc, &procs, &numprocs, &indices) * return neighs */ (void)(ISLocalToGlobalMappingRestoreInfo(__pyx_v_self->lgm, (&__pyx_v_nproc), (&__pyx_v_procs), (&__pyx_v_numprocs), (&__pyx_v_indices))); } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); } __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ErrRestore(__pyx_t_8, __pyx_t_9, __pyx_t_10); __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_lineno = __pyx_t_5; __pyx_clineno = __pyx_t_6; __pyx_filename = __pyx_t_7; goto __pyx_L1_error; } __pyx_L5:; } /* "petsc4py/PETSc/IS.pyx":1374 * ISLocalToGlobalMappingRestoreInfo( * self.lgm, &nproc, &procs, &numprocs, &indices) * return neighs # <<<<<<<<<<<<<< * * def getBlockInfo(self) -> dict[int, ArrayInt]: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_neighs); __pyx_r = __pyx_v_neighs; goto __pyx_L0; /* "petsc4py/PETSc/IS.pyx":1347 * return oindices * * def getInfo(self) -> dict[int, ArrayInt]: # <<<<<<<<<<<<<< * """Determine the indices shared with neighboring processes. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.LGMap.getInfo", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_neighs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":1376 * return neighs * * def getBlockInfo(self) -> dict[int, ArrayInt]: # <<<<<<<<<<<<<< * """Determine the block indices shared with neighboring processes. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_29getBlockInfo(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_5LGMap_28getBlockInfo, "LGMap.getBlockInfo(self) -> dict[int, ArrayInt]\nDetermine the block indices shared with neighboring processes.\n\n Collective.\n\n Returns\n -------\n dict\n Mapping from neighboring processor number to an array of shared\n block indices (in local numbering).\n\n See Also\n --------\n petsc.ISLocalToGlobalMappingGetBlockInfo\n\n \nSource code at petsc4py/PETSc/IS.pyx:1376"); static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_29getBlockInfo(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getBlockInfo (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getBlockInfo", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getBlockInfo", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_28getBlockInfo(((struct PyPetscLGMapObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_28getBlockInfo(struct PyPetscLGMapObject *__pyx_v_self) { PetscInt __pyx_v_i; PetscInt __pyx_v_nproc; PetscInt *__pyx_v_procs; PetscInt *__pyx_v_numprocs; PetscInt **__pyx_v_indices; PyObject *__pyx_v_neighs = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; PetscInt __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_t_6; char const *__pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getBlockInfo", 1); /* "petsc4py/PETSc/IS.pyx":1392 * * """ * cdef PetscInt i, nproc = 0, *procs = NULL, # <<<<<<<<<<<<<< * cdef PetscInt *numprocs = NULL, **indices = NULL * cdef object neighs = { } */ __pyx_v_nproc = 0; __pyx_v_procs = NULL; /* "petsc4py/PETSc/IS.pyx":1393 * """ * cdef PetscInt i, nproc = 0, *procs = NULL, * cdef PetscInt *numprocs = NULL, **indices = NULL # <<<<<<<<<<<<<< * cdef object neighs = { } * CHKERR( ISLocalToGlobalMappingGetBlockInfo( */ __pyx_v_numprocs = NULL; __pyx_v_indices = NULL; /* "petsc4py/PETSc/IS.pyx":1394 * cdef PetscInt i, nproc = 0, *procs = NULL, * cdef PetscInt *numprocs = NULL, **indices = NULL * cdef object neighs = { } # <<<<<<<<<<<<<< * CHKERR( ISLocalToGlobalMappingGetBlockInfo( * self.lgm, &nproc, &procs, &numprocs, &indices) ) */ __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 1394, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_neighs = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/IS.pyx":1395 * cdef PetscInt *numprocs = NULL, **indices = NULL * cdef object neighs = { } * CHKERR( ISLocalToGlobalMappingGetBlockInfo( # <<<<<<<<<<<<<< * self.lgm, &nproc, &procs, &numprocs, &indices) ) * try: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISLocalToGlobalMappingGetBlockInfo(__pyx_v_self->lgm, (&__pyx_v_nproc), (&__pyx_v_procs), (&__pyx_v_numprocs), (&__pyx_v_indices))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 1395, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":1397 * CHKERR( ISLocalToGlobalMappingGetBlockInfo( * self.lgm, &nproc, &procs, &numprocs, &indices) ) * try: # <<<<<<<<<<<<<< * for i from 0 <= i < nproc: * neighs[toInt(procs[i])] = array_i(numprocs[i], indices[i]) */ /*try:*/ { /* "petsc4py/PETSc/IS.pyx":1398 * self.lgm, &nproc, &procs, &numprocs, &indices) ) * try: * for i from 0 <= i < nproc: # <<<<<<<<<<<<<< * neighs[toInt(procs[i])] = array_i(numprocs[i], indices[i]) * finally: */ __pyx_t_3 = __pyx_v_nproc; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { /* "petsc4py/PETSc/IS.pyx":1399 * try: * for i from 0 <= i < nproc: * neighs[toInt(procs[i])] = array_i(numprocs[i], indices[i]) # <<<<<<<<<<<<<< * finally: * ISLocalToGlobalMappingRestoreBlockInfo( */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i((__pyx_v_numprocs[__pyx_v_i]), (__pyx_v_indices[__pyx_v_i]))); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 1399, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_procs[__pyx_v_i])); if (unlikely(!__pyx_t_4)) __PYX_ERR(39, 1399, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_4); if (unlikely((PyObject_SetItem(__pyx_v_neighs, __pyx_t_4, __pyx_t_1) < 0))) __PYX_ERR(39, 1399, __pyx_L4_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } } /* "petsc4py/PETSc/IS.pyx":1401 * neighs[toInt(procs[i])] = array_i(numprocs[i], indices[i]) * finally: * ISLocalToGlobalMappingRestoreBlockInfo( # <<<<<<<<<<<<<< * self.lgm, &nproc, &procs, &numprocs, &indices) * return neighs */ /*finally:*/ { /*normal exit:*/{ /* "petsc4py/PETSc/IS.pyx":1402 * finally: * ISLocalToGlobalMappingRestoreBlockInfo( * self.lgm, &nproc, &procs, &numprocs, &indices) # <<<<<<<<<<<<<< * return neighs * */ (void)(ISLocalToGlobalMappingRestoreBlockInfo(__pyx_v_self->lgm, (&__pyx_v_nproc), (&__pyx_v_procs), (&__pyx_v_numprocs), (&__pyx_v_indices))); goto __pyx_L5; } __pyx_L4_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10) < 0)) __Pyx_ErrFetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); __pyx_t_5 = __pyx_lineno; __pyx_t_6 = __pyx_clineno; __pyx_t_7 = __pyx_filename; { /* "petsc4py/PETSc/IS.pyx":1401 * neighs[toInt(procs[i])] = array_i(numprocs[i], indices[i]) * finally: * ISLocalToGlobalMappingRestoreBlockInfo( # <<<<<<<<<<<<<< * self.lgm, &nproc, &procs, &numprocs, &indices) * return neighs */ (void)(ISLocalToGlobalMappingRestoreBlockInfo(__pyx_v_self->lgm, (&__pyx_v_nproc), (&__pyx_v_procs), (&__pyx_v_numprocs), (&__pyx_v_indices))); } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); } __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ErrRestore(__pyx_t_8, __pyx_t_9, __pyx_t_10); __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_lineno = __pyx_t_5; __pyx_clineno = __pyx_t_6; __pyx_filename = __pyx_t_7; goto __pyx_L1_error; } __pyx_L5:; } /* "petsc4py/PETSc/IS.pyx":1403 * ISLocalToGlobalMappingRestoreBlockInfo( * self.lgm, &nproc, &procs, &numprocs, &indices) * return neighs # <<<<<<<<<<<<<< * * # */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_neighs); __pyx_r = __pyx_v_neighs; goto __pyx_L0; /* "petsc4py/PETSc/IS.pyx":1376 * return neighs * * def getBlockInfo(self) -> dict[int, ArrayInt]: # <<<<<<<<<<<<<< * """Determine the block indices shared with neighboring processes. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.LGMap.getBlockInfo", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_neighs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":1407 * # * * def apply( # <<<<<<<<<<<<<< * self, * indices: Sequence[int], */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_31apply(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_5LGMap_30apply, "LGMap.apply(self, indices: Sequence[int], result: ArrayInt | None = None) -> ArrayInt\nConvert a locally numbered list of integers to a global numbering.\n\n Not collective.\n\n Parameters\n ----------\n indices\n Input indices in local numbering.\n result\n Array to write the global numbering to. If `None` then a\n new array will be allocated.\n\n Returns\n -------\n ArrayInt\n Indices in global numbering. If ``result`` is not `None` then this is\n returned here.\n\n See Also\n --------\n LGMap.applyBlock, petsc.ISLocalToGlobalMappingApply\n\n \nSource code at petsc4py/PETSc/IS.pyx:1407"); static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_31apply(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_indices = 0; PyObject *__pyx_v_result = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("apply (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_indices,&__pyx_n_s_result,0}; /* "petsc4py/PETSc/IS.pyx":1410 * self, * indices: Sequence[int], * result: ArrayInt | None = None, # <<<<<<<<<<<<<< * ) -> ArrayInt: * """Convert a locally numbered list of integers to a global numbering. */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_indices)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 1407, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_result); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 1407, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "apply") < 0)) __PYX_ERR(39, 1407, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_indices = values[0]; __pyx_v_result = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("apply", 0, 1, 2, __pyx_nargs); __PYX_ERR(39, 1407, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.LGMap.apply", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_30apply(((struct PyPetscLGMapObject *)__pyx_v_self), __pyx_v_indices, __pyx_v_result); /* "petsc4py/PETSc/IS.pyx":1407 * # * * def apply( # <<<<<<<<<<<<<< * self, * indices: Sequence[int], */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_30apply(struct PyPetscLGMapObject *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_result) { PetscInt __pyx_v_niidx; PetscInt *__pyx_v_iidx; PetscInt __pyx_v_noidx; PetscInt *__pyx_v_oidx; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("apply", 0); __Pyx_INCREF(__pyx_v_indices); __Pyx_INCREF(__pyx_v_result); /* "petsc4py/PETSc/IS.pyx":1435 * * """ * cdef PetscInt niidx = 0, *iidx = NULL # <<<<<<<<<<<<<< * cdef PetscInt noidx = 0, *oidx = NULL * indices = iarray_i(indices, &niidx, &iidx) */ __pyx_v_niidx = 0; __pyx_v_iidx = NULL; /* "petsc4py/PETSc/IS.pyx":1436 * """ * cdef PetscInt niidx = 0, *iidx = NULL * cdef PetscInt noidx = 0, *oidx = NULL # <<<<<<<<<<<<<< * indices = iarray_i(indices, &niidx, &iidx) * if result is None: result = empty_i(niidx) */ __pyx_v_noidx = 0; __pyx_v_oidx = NULL; /* "petsc4py/PETSc/IS.pyx":1437 * cdef PetscInt niidx = 0, *iidx = NULL * cdef PetscInt noidx = 0, *oidx = NULL * indices = iarray_i(indices, &niidx, &iidx) # <<<<<<<<<<<<<< * if result is None: result = empty_i(niidx) * result = oarray_i(result, &noidx, &oidx) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_indices, (&__pyx_v_niidx), (&__pyx_v_iidx))); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 1437, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_indices, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/IS.pyx":1438 * cdef PetscInt noidx = 0, *oidx = NULL * indices = iarray_i(indices, &niidx, &iidx) * if result is None: result = empty_i(niidx) # <<<<<<<<<<<<<< * result = oarray_i(result, &noidx, &oidx) * assert niidx == noidx, "incompatible array sizes" */ __pyx_t_2 = (__pyx_v_result == Py_None); if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_i(__pyx_v_niidx)); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 1438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_1); __pyx_t_1 = 0; } /* "petsc4py/PETSc/IS.pyx":1439 * indices = iarray_i(indices, &niidx, &iidx) * if result is None: result = empty_i(niidx) * result = oarray_i(result, &noidx, &oidx) # <<<<<<<<<<<<<< * assert niidx == noidx, "incompatible array sizes" * CHKERR( ISLocalToGlobalMappingApply( */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_i(__pyx_v_result, (&__pyx_v_noidx), (&__pyx_v_oidx))); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 1439, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/IS.pyx":1440 * if result is None: result = empty_i(niidx) * result = oarray_i(result, &noidx, &oidx) * assert niidx == noidx, "incompatible array sizes" # <<<<<<<<<<<<<< * CHKERR( ISLocalToGlobalMappingApply( * self.lgm, niidx, iidx, oidx) ) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_2 = (__pyx_v_niidx == __pyx_v_noidx); if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_kp_s_incompatible_array_sizes, 0, 0); __PYX_ERR(39, 1440, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(39, 1440, __pyx_L1_error) #endif /* "petsc4py/PETSc/IS.pyx":1441 * result = oarray_i(result, &noidx, &oidx) * assert niidx == noidx, "incompatible array sizes" * CHKERR( ISLocalToGlobalMappingApply( # <<<<<<<<<<<<<< * self.lgm, niidx, iidx, oidx) ) * return result */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISLocalToGlobalMappingApply(__pyx_v_self->lgm, __pyx_v_niidx, __pyx_v_iidx, __pyx_v_oidx)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 1441, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":1443 * CHKERR( ISLocalToGlobalMappingApply( * self.lgm, niidx, iidx, oidx) ) * return result # <<<<<<<<<<<<<< * * def applyBlock( */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_result); __pyx_r = __pyx_v_result; goto __pyx_L0; /* "petsc4py/PETSc/IS.pyx":1407 * # * * def apply( # <<<<<<<<<<<<<< * self, * indices: Sequence[int], */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.LGMap.apply", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_indices); __Pyx_XDECREF(__pyx_v_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":1445 * return result * * def applyBlock( # <<<<<<<<<<<<<< * self, * indices: Sequence[int], */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_33applyBlock(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_5LGMap_32applyBlock, "LGMap.applyBlock(self, indices: Sequence[int], result: ArrayInt | None = None) -> ArrayInt\nConvert a local block numbering to a global block numbering.\n\n Not collective.\n\n Parameters\n ----------\n indices\n Input block indices in local numbering.\n result\n Array to write the global numbering to. If `None` then a\n new array will be allocated.\n\n Returns\n -------\n ArrayInt\n Block indices in global numbering. If ``result`` is not `None`\n then this is returned here.\n\n See Also\n --------\n LGMap.apply, petsc.ISLocalToGlobalMappingApplyBlock\n\n \nSource code at petsc4py/PETSc/IS.pyx:1445"); static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_33applyBlock(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_indices = 0; PyObject *__pyx_v_result = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("applyBlock (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_indices,&__pyx_n_s_result,0}; /* "petsc4py/PETSc/IS.pyx":1448 * self, * indices: Sequence[int], * result: ArrayInt | None = None, # <<<<<<<<<<<<<< * ) -> ArrayInt: * """Convert a local block numbering to a global block numbering. */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_indices)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 1445, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_result); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 1445, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "applyBlock") < 0)) __PYX_ERR(39, 1445, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_indices = values[0]; __pyx_v_result = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("applyBlock", 0, 1, 2, __pyx_nargs); __PYX_ERR(39, 1445, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.LGMap.applyBlock", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_32applyBlock(((struct PyPetscLGMapObject *)__pyx_v_self), __pyx_v_indices, __pyx_v_result); /* "petsc4py/PETSc/IS.pyx":1445 * return result * * def applyBlock( # <<<<<<<<<<<<<< * self, * indices: Sequence[int], */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_32applyBlock(struct PyPetscLGMapObject *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_result) { PetscInt __pyx_v_niidx; PetscInt *__pyx_v_iidx; PetscInt __pyx_v_noidx; PetscInt *__pyx_v_oidx; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("applyBlock", 0); __Pyx_INCREF(__pyx_v_indices); __Pyx_INCREF(__pyx_v_result); /* "petsc4py/PETSc/IS.pyx":1473 * * """ * cdef PetscInt niidx = 0, *iidx = NULL # <<<<<<<<<<<<<< * cdef PetscInt noidx = 0, *oidx = NULL * indices = iarray_i(indices, &niidx, &iidx) */ __pyx_v_niidx = 0; __pyx_v_iidx = NULL; /* "petsc4py/PETSc/IS.pyx":1474 * """ * cdef PetscInt niidx = 0, *iidx = NULL * cdef PetscInt noidx = 0, *oidx = NULL # <<<<<<<<<<<<<< * indices = iarray_i(indices, &niidx, &iidx) * if result is None: result = empty_i(niidx) */ __pyx_v_noidx = 0; __pyx_v_oidx = NULL; /* "petsc4py/PETSc/IS.pyx":1475 * cdef PetscInt niidx = 0, *iidx = NULL * cdef PetscInt noidx = 0, *oidx = NULL * indices = iarray_i(indices, &niidx, &iidx) # <<<<<<<<<<<<<< * if result is None: result = empty_i(niidx) * result = oarray_i(result, &noidx, &oidx) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_indices, (&__pyx_v_niidx), (&__pyx_v_iidx))); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 1475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_indices, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/IS.pyx":1476 * cdef PetscInt noidx = 0, *oidx = NULL * indices = iarray_i(indices, &niidx, &iidx) * if result is None: result = empty_i(niidx) # <<<<<<<<<<<<<< * result = oarray_i(result, &noidx, &oidx) * assert niidx == noidx, "incompatible array sizes" */ __pyx_t_2 = (__pyx_v_result == Py_None); if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_i(__pyx_v_niidx)); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 1476, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_1); __pyx_t_1 = 0; } /* "petsc4py/PETSc/IS.pyx":1477 * indices = iarray_i(indices, &niidx, &iidx) * if result is None: result = empty_i(niidx) * result = oarray_i(result, &noidx, &oidx) # <<<<<<<<<<<<<< * assert niidx == noidx, "incompatible array sizes" * CHKERR( ISLocalToGlobalMappingApplyBlock( */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_i(__pyx_v_result, (&__pyx_v_noidx), (&__pyx_v_oidx))); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 1477, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/IS.pyx":1478 * if result is None: result = empty_i(niidx) * result = oarray_i(result, &noidx, &oidx) * assert niidx == noidx, "incompatible array sizes" # <<<<<<<<<<<<<< * CHKERR( ISLocalToGlobalMappingApplyBlock( * self.lgm, niidx, iidx, oidx) ) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_2 = (__pyx_v_niidx == __pyx_v_noidx); if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_kp_s_incompatible_array_sizes, 0, 0); __PYX_ERR(39, 1478, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(39, 1478, __pyx_L1_error) #endif /* "petsc4py/PETSc/IS.pyx":1479 * result = oarray_i(result, &noidx, &oidx) * assert niidx == noidx, "incompatible array sizes" * CHKERR( ISLocalToGlobalMappingApplyBlock( # <<<<<<<<<<<<<< * self.lgm, niidx, iidx, oidx) ) * return result */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISLocalToGlobalMappingApplyBlock(__pyx_v_self->lgm, __pyx_v_niidx, __pyx_v_iidx, __pyx_v_oidx)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 1479, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":1481 * CHKERR( ISLocalToGlobalMappingApplyBlock( * self.lgm, niidx, iidx, oidx) ) * return result # <<<<<<<<<<<<<< * * def applyIS(self, IS iset) -> IS: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_result); __pyx_r = __pyx_v_result; goto __pyx_L0; /* "petsc4py/PETSc/IS.pyx":1445 * return result * * def applyBlock( # <<<<<<<<<<<<<< * self, * indices: Sequence[int], */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.LGMap.applyBlock", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_indices); __Pyx_XDECREF(__pyx_v_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":1483 * return result * * def applyIS(self, IS iset) -> IS: # <<<<<<<<<<<<<< * """Create an index set with global numbering from a local numbering. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_35applyIS(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_5LGMap_34applyIS, "LGMap.applyIS(self, iset: IS) -> IS\nCreate an index set with global numbering from a local numbering.\n\n Collective.\n\n Parameters\n ----------\n iset\n Index set with local numbering.\n\n Returns\n -------\n IS\n Index set with global numbering.\n\n See Also\n --------\n petsc.ISLocalToGlobalMappingApplyIS\n\n \nSource code at petsc4py/PETSc/IS.pyx:1483"); static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_35applyIS(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscISObject *__pyx_v_iset = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("applyIS (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_iset,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_iset)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 1483, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "applyIS") < 0)) __PYX_ERR(39, 1483, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_iset = ((struct PyPetscISObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("applyIS", 1, 1, 1, __pyx_nargs); __PYX_ERR(39, 1483, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.LGMap.applyIS", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iset), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "iset", 0))) __PYX_ERR(39, 1483, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_34applyIS(((struct PyPetscLGMapObject *)__pyx_v_self), __pyx_v_iset); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_34applyIS(struct PyPetscLGMapObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset) { struct PyPetscISObject *__pyx_v_result = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("applyIS", 1); /* "petsc4py/PETSc/IS.pyx":1503 * * """ * cdef IS result = IS() # <<<<<<<<<<<<<< * CHKERR( ISLocalToGlobalMappingApplyIS( * self.lgm, iset.iset, &result.iset) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 1503, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_result = ((struct PyPetscISObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/IS.pyx":1504 * """ * cdef IS result = IS() * CHKERR( ISLocalToGlobalMappingApplyIS( # <<<<<<<<<<<<<< * self.lgm, iset.iset, &result.iset) ) * return result */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISLocalToGlobalMappingApplyIS(__pyx_v_self->lgm, __pyx_v_iset->iset, (&__pyx_v_result->iset))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 1504, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":1506 * CHKERR( ISLocalToGlobalMappingApplyIS( * self.lgm, iset.iset, &result.iset) ) * return result # <<<<<<<<<<<<<< * * def applyInverse( */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_result); __pyx_r = ((PyObject *)__pyx_v_result); goto __pyx_L0; /* "petsc4py/PETSc/IS.pyx":1483 * return result * * def applyIS(self, IS iset) -> IS: # <<<<<<<<<<<<<< * """Create an index set with global numbering from a local numbering. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.LGMap.applyIS", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":1508 * return result * * def applyInverse( # <<<<<<<<<<<<<< * self, * indices: Sequence[int], */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_37applyInverse(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_5LGMap_36applyInverse, "LGMap.applyInverse(self, indices: Sequence[int], mode: GLMapMode | str | None = None) -> ArrayInt\nCompute local numbering from global numbering.\n\n Not collective.\n\n Parameters\n ----------\n indices\n Indices with a global numbering.\n mode\n Flag indicating what to do with indices that have no local value,\n defaults to ``\"mask\"``.\n\n Returns\n -------\n ArrayInt\n Indices with a local numbering.\n\n See Also\n --------\n petsc.ISGlobalToLocalMappingApply\n\n \nSource code at petsc4py/PETSc/IS.pyx:1508"); static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_37applyInverse(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_indices = 0; PyObject *__pyx_v_mode = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("applyInverse (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_indices,&__pyx_n_s_mode,0}; /* "petsc4py/PETSc/IS.pyx":1511 * self, * indices: Sequence[int], * mode: GLMapMode | str | None = None, # <<<<<<<<<<<<<< * ) -> ArrayInt: * """Compute local numbering from global numbering. */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_indices)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 1508, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mode); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 1508, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "applyInverse") < 0)) __PYX_ERR(39, 1508, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_indices = values[0]; __pyx_v_mode = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("applyInverse", 0, 1, 2, __pyx_nargs); __PYX_ERR(39, 1508, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.LGMap.applyInverse", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_36applyInverse(((struct PyPetscLGMapObject *)__pyx_v_self), __pyx_v_indices, __pyx_v_mode); /* "petsc4py/PETSc/IS.pyx":1508 * return result * * def applyInverse( # <<<<<<<<<<<<<< * self, * indices: Sequence[int], */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_36applyInverse(struct PyPetscLGMapObject *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_mode) { ISGlobalToLocalMappingMode __pyx_v_cmode; PetscInt __pyx_v_n; PetscInt *__pyx_v_idx; PetscInt __pyx_v_nout; PetscInt *__pyx_v_idxout; PyArrayObject *__pyx_v_result = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; ISGlobalToLocalMappingMode __pyx_t_2; PyObject *__pyx_t_3 = NULL; PetscErrorCode __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("applyInverse", 0); __Pyx_INCREF(__pyx_v_indices); /* "petsc4py/PETSc/IS.pyx":1535 * * """ * cdef PetscGLMapMode cmode = PETSC_IS_GTOLM_MASK # <<<<<<<<<<<<<< * if mode is not None: cmode = mode * cdef PetscInt n = 0, *idx = NULL */ __pyx_v_cmode = IS_GTOLM_MASK; /* "petsc4py/PETSc/IS.pyx":1536 * """ * cdef PetscGLMapMode cmode = PETSC_IS_GTOLM_MASK * if mode is not None: cmode = mode # <<<<<<<<<<<<<< * cdef PetscInt n = 0, *idx = NULL * indices = iarray_i(indices, &n, &idx) */ __pyx_t_1 = (__pyx_v_mode != Py_None); if (__pyx_t_1) { __pyx_t_2 = ((ISGlobalToLocalMappingMode)__Pyx_PyInt_As_ISGlobalToLocalMappingMode(__pyx_v_mode)); if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 1536, __pyx_L1_error) __pyx_v_cmode = __pyx_t_2; } /* "petsc4py/PETSc/IS.pyx":1537 * cdef PetscGLMapMode cmode = PETSC_IS_GTOLM_MASK * if mode is not None: cmode = mode * cdef PetscInt n = 0, *idx = NULL # <<<<<<<<<<<<<< * indices = iarray_i(indices, &n, &idx) * cdef PetscInt nout = n, *idxout = NULL */ __pyx_v_n = 0; __pyx_v_idx = NULL; /* "petsc4py/PETSc/IS.pyx":1538 * if mode is not None: cmode = mode * cdef PetscInt n = 0, *idx = NULL * indices = iarray_i(indices, &n, &idx) # <<<<<<<<<<<<<< * cdef PetscInt nout = n, *idxout = NULL * if cmode != PETSC_IS_GTOLM_MASK: */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_indices, (&__pyx_v_n), (&__pyx_v_idx))); if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 1538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_indices, __pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/IS.pyx":1539 * cdef PetscInt n = 0, *idx = NULL * indices = iarray_i(indices, &n, &idx) * cdef PetscInt nout = n, *idxout = NULL # <<<<<<<<<<<<<< * if cmode != PETSC_IS_GTOLM_MASK: * CHKERR( ISGlobalToLocalMappingApply( */ __pyx_v_nout = __pyx_v_n; __pyx_v_idxout = NULL; /* "petsc4py/PETSc/IS.pyx":1540 * indices = iarray_i(indices, &n, &idx) * cdef PetscInt nout = n, *idxout = NULL * if cmode != PETSC_IS_GTOLM_MASK: # <<<<<<<<<<<<<< * CHKERR( ISGlobalToLocalMappingApply( * self.lgm, cmode, n, idx, &nout, NULL) ) */ __pyx_t_1 = (__pyx_v_cmode != IS_GTOLM_MASK); if (__pyx_t_1) { /* "petsc4py/PETSc/IS.pyx":1541 * cdef PetscInt nout = n, *idxout = NULL * if cmode != PETSC_IS_GTOLM_MASK: * CHKERR( ISGlobalToLocalMappingApply( # <<<<<<<<<<<<<< * self.lgm, cmode, n, idx, &nout, NULL) ) * result = oarray_i(empty_i(nout), &nout, &idxout) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISGlobalToLocalMappingApply(__pyx_v_self->lgm, __pyx_v_cmode, __pyx_v_n, __pyx_v_idx, (&__pyx_v_nout), NULL)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 1541, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":1540 * indices = iarray_i(indices, &n, &idx) * cdef PetscInt nout = n, *idxout = NULL * if cmode != PETSC_IS_GTOLM_MASK: # <<<<<<<<<<<<<< * CHKERR( ISGlobalToLocalMappingApply( * self.lgm, cmode, n, idx, &nout, NULL) ) */ } /* "petsc4py/PETSc/IS.pyx":1543 * CHKERR( ISGlobalToLocalMappingApply( * self.lgm, cmode, n, idx, &nout, NULL) ) * result = oarray_i(empty_i(nout), &nout, &idxout) # <<<<<<<<<<<<<< * CHKERR( ISGlobalToLocalMappingApply( * self.lgm, cmode, n, idx, &nout, idxout) ) */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_i(__pyx_v_nout)); if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 1543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_i(__pyx_t_3, (&__pyx_v_nout), (&__pyx_v_idxout))); if (unlikely(!__pyx_t_5)) __PYX_ERR(39, 1543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_result = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/IS.pyx":1544 * self.lgm, cmode, n, idx, &nout, NULL) ) * result = oarray_i(empty_i(nout), &nout, &idxout) * CHKERR( ISGlobalToLocalMappingApply( # <<<<<<<<<<<<<< * self.lgm, cmode, n, idx, &nout, idxout) ) * return result */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISGlobalToLocalMappingApply(__pyx_v_self->lgm, __pyx_v_cmode, __pyx_v_n, __pyx_v_idx, (&__pyx_v_nout), __pyx_v_idxout)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 1544, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":1546 * CHKERR( ISGlobalToLocalMappingApply( * self.lgm, cmode, n, idx, &nout, idxout) ) * return result # <<<<<<<<<<<<<< * * def applyBlockInverse( */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_result); __pyx_r = ((PyObject *)__pyx_v_result); goto __pyx_L0; /* "petsc4py/PETSc/IS.pyx":1508 * return result * * def applyInverse( # <<<<<<<<<<<<<< * self, * indices: Sequence[int], */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.LGMap.applyInverse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_result); __Pyx_XDECREF(__pyx_v_indices); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":1548 * return result * * def applyBlockInverse( # <<<<<<<<<<<<<< * self, * indices: Sequence[int], */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_39applyBlockInverse(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_5LGMap_38applyBlockInverse, "LGMap.applyBlockInverse(self, indices: Sequence[int], mode: GLMapMode | str | None = None) -> ArrayInt\nCompute blocked local numbering from blocked global numbering.\n\n Not collective.\n\n Parameters\n ----------\n indices\n Indices with a global block numbering.\n mode\n Flag indicating what to do with indices that have no local value,\n defaults to ``\"mask\"``.\n\n Returns\n -------\n ArrayInt\n Indices with a local block numbering.\n\n See Also\n --------\n petsc.ISGlobalToLocalMappingApplyBlock\n\n \nSource code at petsc4py/PETSc/IS.pyx:1548"); static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_39applyBlockInverse(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_indices = 0; PyObject *__pyx_v_mode = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("applyBlockInverse (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_indices,&__pyx_n_s_mode,0}; /* "petsc4py/PETSc/IS.pyx":1551 * self, * indices: Sequence[int], * mode: GLMapMode | str | None = None, # <<<<<<<<<<<<<< * ) -> ArrayInt: * """Compute blocked local numbering from blocked global numbering. */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_indices)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 1548, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mode); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 1548, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "applyBlockInverse") < 0)) __PYX_ERR(39, 1548, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_indices = values[0]; __pyx_v_mode = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("applyBlockInverse", 0, 1, 2, __pyx_nargs); __PYX_ERR(39, 1548, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.LGMap.applyBlockInverse", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_38applyBlockInverse(((struct PyPetscLGMapObject *)__pyx_v_self), __pyx_v_indices, __pyx_v_mode); /* "petsc4py/PETSc/IS.pyx":1548 * return result * * def applyBlockInverse( # <<<<<<<<<<<<<< * self, * indices: Sequence[int], */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_38applyBlockInverse(struct PyPetscLGMapObject *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_mode) { ISGlobalToLocalMappingMode __pyx_v_cmode; PetscInt __pyx_v_n; PetscInt *__pyx_v_idx; PetscInt __pyx_v_nout; PetscInt *__pyx_v_idxout; PyArrayObject *__pyx_v_result = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; ISGlobalToLocalMappingMode __pyx_t_2; PyObject *__pyx_t_3 = NULL; PetscErrorCode __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("applyBlockInverse", 0); __Pyx_INCREF(__pyx_v_indices); /* "petsc4py/PETSc/IS.pyx":1575 * * """ * cdef PetscGLMapMode cmode = PETSC_IS_GTOLM_MASK # <<<<<<<<<<<<<< * if mode is not None: cmode = mode * cdef PetscInt n = 0, *idx = NULL */ __pyx_v_cmode = IS_GTOLM_MASK; /* "petsc4py/PETSc/IS.pyx":1576 * """ * cdef PetscGLMapMode cmode = PETSC_IS_GTOLM_MASK * if mode is not None: cmode = mode # <<<<<<<<<<<<<< * cdef PetscInt n = 0, *idx = NULL * indices = iarray_i(indices, &n, &idx) */ __pyx_t_1 = (__pyx_v_mode != Py_None); if (__pyx_t_1) { __pyx_t_2 = ((ISGlobalToLocalMappingMode)__Pyx_PyInt_As_ISGlobalToLocalMappingMode(__pyx_v_mode)); if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 1576, __pyx_L1_error) __pyx_v_cmode = __pyx_t_2; } /* "petsc4py/PETSc/IS.pyx":1577 * cdef PetscGLMapMode cmode = PETSC_IS_GTOLM_MASK * if mode is not None: cmode = mode * cdef PetscInt n = 0, *idx = NULL # <<<<<<<<<<<<<< * indices = iarray_i(indices, &n, &idx) * cdef PetscInt nout = n, *idxout = NULL */ __pyx_v_n = 0; __pyx_v_idx = NULL; /* "petsc4py/PETSc/IS.pyx":1578 * if mode is not None: cmode = mode * cdef PetscInt n = 0, *idx = NULL * indices = iarray_i(indices, &n, &idx) # <<<<<<<<<<<<<< * cdef PetscInt nout = n, *idxout = NULL * if cmode != PETSC_IS_GTOLM_MASK: */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_indices, (&__pyx_v_n), (&__pyx_v_idx))); if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 1578, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_indices, __pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/IS.pyx":1579 * cdef PetscInt n = 0, *idx = NULL * indices = iarray_i(indices, &n, &idx) * cdef PetscInt nout = n, *idxout = NULL # <<<<<<<<<<<<<< * if cmode != PETSC_IS_GTOLM_MASK: * CHKERR( ISGlobalToLocalMappingApply( */ __pyx_v_nout = __pyx_v_n; __pyx_v_idxout = NULL; /* "petsc4py/PETSc/IS.pyx":1580 * indices = iarray_i(indices, &n, &idx) * cdef PetscInt nout = n, *idxout = NULL * if cmode != PETSC_IS_GTOLM_MASK: # <<<<<<<<<<<<<< * CHKERR( ISGlobalToLocalMappingApply( * self.lgm, cmode, n, idx, &nout, NULL) ) */ __pyx_t_1 = (__pyx_v_cmode != IS_GTOLM_MASK); if (__pyx_t_1) { /* "petsc4py/PETSc/IS.pyx":1581 * cdef PetscInt nout = n, *idxout = NULL * if cmode != PETSC_IS_GTOLM_MASK: * CHKERR( ISGlobalToLocalMappingApply( # <<<<<<<<<<<<<< * self.lgm, cmode, n, idx, &nout, NULL) ) * result = oarray_i(empty_i(nout), &nout, &idxout) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISGlobalToLocalMappingApply(__pyx_v_self->lgm, __pyx_v_cmode, __pyx_v_n, __pyx_v_idx, (&__pyx_v_nout), NULL)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 1581, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":1580 * indices = iarray_i(indices, &n, &idx) * cdef PetscInt nout = n, *idxout = NULL * if cmode != PETSC_IS_GTOLM_MASK: # <<<<<<<<<<<<<< * CHKERR( ISGlobalToLocalMappingApply( * self.lgm, cmode, n, idx, &nout, NULL) ) */ } /* "petsc4py/PETSc/IS.pyx":1583 * CHKERR( ISGlobalToLocalMappingApply( * self.lgm, cmode, n, idx, &nout, NULL) ) * result = oarray_i(empty_i(nout), &nout, &idxout) # <<<<<<<<<<<<<< * CHKERR( ISGlobalToLocalMappingApplyBlock( * self.lgm, cmode, n, idx, &nout, idxout) ) */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_i(__pyx_v_nout)); if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 1583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_i(__pyx_t_3, (&__pyx_v_nout), (&__pyx_v_idxout))); if (unlikely(!__pyx_t_5)) __PYX_ERR(39, 1583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_result = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/IS.pyx":1584 * self.lgm, cmode, n, idx, &nout, NULL) ) * result = oarray_i(empty_i(nout), &nout, &idxout) * CHKERR( ISGlobalToLocalMappingApplyBlock( # <<<<<<<<<<<<<< * self.lgm, cmode, n, idx, &nout, idxout) ) * return result */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISGlobalToLocalMappingApplyBlock(__pyx_v_self->lgm, __pyx_v_cmode, __pyx_v_n, __pyx_v_idx, (&__pyx_v_nout), __pyx_v_idxout)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 1584, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":1586 * CHKERR( ISGlobalToLocalMappingApplyBlock( * self.lgm, cmode, n, idx, &nout, idxout) ) * return result # <<<<<<<<<<<<<< * # * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_result); __pyx_r = ((PyObject *)__pyx_v_result); goto __pyx_L0; /* "petsc4py/PETSc/IS.pyx":1548 * return result * * def applyBlockInverse( # <<<<<<<<<<<<<< * self, * indices: Sequence[int], */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.LGMap.applyBlockInverse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_result); __Pyx_XDECREF(__pyx_v_indices); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":1599 * * """ * def __get__(self) -> int: # <<<<<<<<<<<<<< * return self.getSize() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_4size_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_4size_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_4size___get__(((struct PyPetscLGMapObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_4size___get__(struct PyPetscLGMapObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/IS.pyx":1600 * """ * def __get__(self) -> int: * return self.getSize() # <<<<<<<<<<<<<< * * property block_size: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getSize); if (unlikely(!__pyx_t_2)) __PYX_ERR(39, 1600, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 1600, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/IS.pyx":1599 * * """ * def __get__(self) -> int: # <<<<<<<<<<<<<< * return self.getSize() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.LGMap.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":1612 * * """ * def __get__(self) -> int: # <<<<<<<<<<<<<< * return self.getBlockSize() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_10block_size_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_10block_size_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_10block_size___get__(((struct PyPetscLGMapObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_10block_size___get__(struct PyPetscLGMapObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/IS.pyx":1613 * """ * def __get__(self) -> int: * return self.getBlockSize() # <<<<<<<<<<<<<< * * property indices: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getBlockSize); if (unlikely(!__pyx_t_2)) __PYX_ERR(39, 1613, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 1613, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/IS.pyx":1612 * * """ * def __get__(self) -> int: # <<<<<<<<<<<<<< * return self.getBlockSize() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.LGMap.block_size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":1625 * * """ * def __get__(self) -> ArrayInt: # <<<<<<<<<<<<<< * return self.getIndices() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_7indices_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_7indices_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_7indices___get__(((struct PyPetscLGMapObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_7indices___get__(struct PyPetscLGMapObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/IS.pyx":1626 * """ * def __get__(self) -> ArrayInt: * return self.getIndices() # <<<<<<<<<<<<<< * * property block_indices: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getIndices); if (unlikely(!__pyx_t_2)) __PYX_ERR(39, 1626, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 1626, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/IS.pyx":1625 * * """ * def __get__(self) -> ArrayInt: # <<<<<<<<<<<<<< * return self.getIndices() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.LGMap.indices.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":1638 * * """ * def __get__(self) -> ArrayInt: # <<<<<<<<<<<<<< * return self.getBlockIndices() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_13block_indices_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_13block_indices_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_13block_indices___get__(((struct PyPetscLGMapObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_13block_indices___get__(struct PyPetscLGMapObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/IS.pyx":1639 * """ * def __get__(self) -> ArrayInt: * return self.getBlockIndices() # <<<<<<<<<<<<<< * * property info: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getBlockIndices); if (unlikely(!__pyx_t_2)) __PYX_ERR(39, 1639, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 1639, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/IS.pyx":1638 * * """ * def __get__(self) -> ArrayInt: # <<<<<<<<<<<<<< * return self.getBlockIndices() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.LGMap.block_indices.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":1651 * * """ * def __get__(self) -> dict[int, ArrayInt]: # <<<<<<<<<<<<<< * return self.getInfo() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_4info_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_4info_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_4info___get__(((struct PyPetscLGMapObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_4info___get__(struct PyPetscLGMapObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/IS.pyx":1652 * """ * def __get__(self) -> dict[int, ArrayInt]: * return self.getInfo() # <<<<<<<<<<<<<< * * property block_info: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getInfo); if (unlikely(!__pyx_t_2)) __PYX_ERR(39, 1652, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 1652, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/IS.pyx":1651 * * """ * def __get__(self) -> dict[int, ArrayInt]: # <<<<<<<<<<<<<< * return self.getInfo() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.LGMap.info.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/IS.pyx":1664 * * """ * def __get__(self) -> dict[int, ArrayInt]: # <<<<<<<<<<<<<< * return self.getBlockInfo() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_10block_info_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_10block_info_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_10block_info___get__(((struct PyPetscLGMapObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_10block_info___get__(struct PyPetscLGMapObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/IS.pyx":1665 * """ * def __get__(self) -> dict[int, ArrayInt]: * return self.getBlockInfo() # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getBlockInfo); if (unlikely(!__pyx_t_2)) __PYX_ERR(39, 1665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 1665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/IS.pyx":1664 * * """ * def __get__(self) -> dict[int, ArrayInt]: # <<<<<<<<<<<<<< * return self.getBlockInfo() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.LGMap.block_info.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SF.pyx":25 * Type = SFType * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.sf * self.sf = NULL */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_2SF_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_2SF_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF___cinit__(((struct PyPetscSFObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_2SF___cinit__(struct PyPetscSFObject *__pyx_v_self) { int __pyx_r; /* "petsc4py/PETSc/SF.pyx":26 * * def __cinit__(self): * self.obj = &self.sf # <<<<<<<<<<<<<< * self.sf = NULL * */ __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->sf)); /* "petsc4py/PETSc/SF.pyx":27 * def __cinit__(self): * self.obj = &self.sf * self.sf = NULL # <<<<<<<<<<<<<< * * def __dealloc__(self): */ __pyx_v_self->sf = NULL; /* "petsc4py/PETSc/SF.pyx":25 * Type = SFType * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.sf * self.sf = NULL */ /* function exit code */ __pyx_r = 0; return __pyx_r; } /* "petsc4py/PETSc/SF.pyx":29 * self.sf = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< * CHKERR( PetscSFDestroy(&self.sf) ) * self.sf = NULL */ /* Python wrapper */ static void __pyx_pw_8petsc4py_5PETSc_2SF_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_8petsc4py_5PETSc_2SF_3__dealloc__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_pf_8petsc4py_5PETSc_2SF_2__dealloc__(((struct PyPetscSFObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_8petsc4py_5PETSc_2SF_2__dealloc__(struct PyPetscSFObject *__pyx_v_self) { PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "petsc4py/PETSc/SF.pyx":30 * * def __dealloc__(self): * CHKERR( PetscSFDestroy(&self.sf) ) # <<<<<<<<<<<<<< * self.sf = NULL * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFDestroy((&__pyx_v_self->sf))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 30, __pyx_L1_error) /* "petsc4py/PETSc/SF.pyx":31 * def __dealloc__(self): * CHKERR( PetscSFDestroy(&self.sf) ) * self.sf = NULL # <<<<<<<<<<<<<< * * def view(self, Viewer viewer=None) -> None: */ __pyx_v_self->sf = NULL; /* "petsc4py/PETSc/SF.pyx":29 * self.sf = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< * CHKERR( PetscSFDestroy(&self.sf) ) * self.sf = NULL */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_WriteUnraisable("petsc4py.PETSc.SF.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_L0:; } /* "petsc4py/PETSc/SF.pyx":33 * self.sf = NULL * * def view(self, Viewer viewer=None) -> None: # <<<<<<<<<<<<<< * """View a star forest. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_5view(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2SF_4view, "SF.view(self, viewer: Viewer | None = None) -> None\nView a star forest.\n\n Collective.\n\n Parameters\n ----------\n viewer\n A `Viewer` to display the graph.\n\n See Also\n --------\n petsc.PetscSFView\n\n \nSource code at petsc4py/PETSc/SF.pyx:33"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_5view(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscViewerObject *__pyx_v_viewer = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("view (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscViewerObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_viewer); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(40, 33, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "view") < 0)) __PYX_ERR(40, 33, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, __pyx_nargs); __PYX_ERR(40, 33, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SF.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(40, 33, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_4view(((struct PyPetscSFObject *)__pyx_v_self), __pyx_v_viewer); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_4view(struct PyPetscSFObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer) { PetscViewer __pyx_v_vwr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscViewer __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("view", 1); /* "petsc4py/PETSc/SF.pyx":48 * * """ * cdef PetscViewer vwr = NULL # <<<<<<<<<<<<<< * if viewer is not None: vwr = viewer.vwr * CHKERR( PetscSFView(self.sf, vwr) ) */ __pyx_v_vwr = NULL; /* "petsc4py/PETSc/SF.pyx":49 * """ * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr # <<<<<<<<<<<<<< * CHKERR( PetscSFView(self.sf, vwr) ) * */ __pyx_t_1 = (((PyObject *)__pyx_v_viewer) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_viewer->vwr; __pyx_v_vwr = __pyx_t_2; } /* "petsc4py/PETSc/SF.pyx":50 * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr * CHKERR( PetscSFView(self.sf, vwr) ) # <<<<<<<<<<<<<< * * def destroy(self) -> Self: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFView(__pyx_v_self->sf, __pyx_v_vwr)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 50, __pyx_L1_error) /* "petsc4py/PETSc/SF.pyx":33 * self.sf = NULL * * def view(self, Viewer viewer=None) -> None: # <<<<<<<<<<<<<< * """View a star forest. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SF.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SF.pyx":52 * CHKERR( PetscSFView(self.sf, vwr) ) * * def destroy(self) -> Self: # <<<<<<<<<<<<<< * """Destroy the star forest. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_7destroy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2SF_6destroy, "SF.destroy(self) -> Self\nDestroy the star forest.\n\n Collective.\n\n See Also\n --------\n petsc.PetscSFDestroy\n\n \nSource code at petsc4py/PETSc/SF.pyx:52"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_7destroy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("destroy (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_6destroy(((struct PyPetscSFObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_6destroy(struct PyPetscSFObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("destroy", 1); /* "petsc4py/PETSc/SF.pyx":62 * * """ * CHKERR( PetscSFDestroy(&self.sf) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFDestroy((&__pyx_v_self->sf))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 62, __pyx_L1_error) /* "petsc4py/PETSc/SF.pyx":63 * """ * CHKERR( PetscSFDestroy(&self.sf) ) * return self # <<<<<<<<<<<<<< * * def create(self, comm: Comm | None = None) -> Self: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/SF.pyx":52 * CHKERR( PetscSFView(self.sf, vwr) ) * * def destroy(self) -> Self: # <<<<<<<<<<<<<< * """Destroy the star forest. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SF.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SF.pyx":65 * return self * * def create(self, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Create a star forest communication context. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_9create(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2SF_8create, "SF.create(self, comm: Comm | None = None) -> Self\nCreate a star forest communication context.\n\n Collective.\n\n Parameters\n ----------\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n petsc.PetscSFCreate\n\n \nSource code at petsc4py/PETSc/SF.pyx:65"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_9create(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(40, 65, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "create") < 0)) __PYX_ERR(40, 65, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_comm = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, __pyx_nargs); __PYX_ERR(40, 65, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SF.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_8create(((struct PyPetscSFObject *)__pyx_v_self), __pyx_v_comm); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_8create(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PetscSF __pyx_v_newsf; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create", 1); /* "petsc4py/PETSc/SF.pyx":80 * * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscSF newsf = NULL * CHKERR( PetscSFCreate(ccomm, &newsf) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(40, 80, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/SF.pyx":81 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscSF newsf = NULL # <<<<<<<<<<<<<< * CHKERR( PetscSFCreate(ccomm, &newsf) ) * CHKERR( PetscCLEAR(self.obj) ); self.sf = newsf */ __pyx_v_newsf = NULL; /* "petsc4py/PETSc/SF.pyx":82 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscSF newsf = NULL * CHKERR( PetscSFCreate(ccomm, &newsf) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.sf = newsf * return self */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFCreate(__pyx_v_ccomm, (&__pyx_v_newsf))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 82, __pyx_L1_error) /* "petsc4py/PETSc/SF.pyx":83 * cdef PetscSF newsf = NULL * CHKERR( PetscSFCreate(ccomm, &newsf) ) * CHKERR( PetscCLEAR(self.obj) ); self.sf = newsf # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 83, __pyx_L1_error) __pyx_v_self->sf = __pyx_v_newsf; /* "petsc4py/PETSc/SF.pyx":84 * CHKERR( PetscSFCreate(ccomm, &newsf) ) * CHKERR( PetscCLEAR(self.obj) ); self.sf = newsf * return self # <<<<<<<<<<<<<< * * def setType(self, sf_type: Type | str) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/SF.pyx":65 * return self * * def create(self, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Create a star forest communication context. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SF.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SF.pyx":86 * return self * * def setType(self, sf_type: Type | str) -> None: # <<<<<<<<<<<<<< * """Set the type of the star forest. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_11setType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2SF_10setType, "SF.setType(self, sf_type: Type | str) -> None\nSet the type of the star forest.\n\n Collective.\n\n Parameters\n ----------\n sf_type\n The star forest type.\n\n See Also\n --------\n petsc.PetscSFSetType\n\n \nSource code at petsc4py/PETSc/SF.pyx:86"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_11setType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_sf_type = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sf_type,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sf_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(40, 86, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setType") < 0)) __PYX_ERR(40, 86, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_sf_type = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, __pyx_nargs); __PYX_ERR(40, 86, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SF.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_10setType(((struct PyPetscSFObject *)__pyx_v_self), __pyx_v_sf_type); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_10setType(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_sf_type) { PetscSFType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setType", 0); __Pyx_INCREF(__pyx_v_sf_type); /* "petsc4py/PETSc/SF.pyx":101 * * """ * cdef PetscSFType cval = NULL # <<<<<<<<<<<<<< * sf_type = str2bytes(sf_type, &cval) * CHKERR( PetscSFSetType(self.sf, cval) ) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/SF.pyx":102 * """ * cdef PetscSFType cval = NULL * sf_type = str2bytes(sf_type, &cval) # <<<<<<<<<<<<<< * CHKERR( PetscSFSetType(self.sf, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_sf_type, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_sf_type, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/SF.pyx":103 * cdef PetscSFType cval = NULL * sf_type = str2bytes(sf_type, &cval) * CHKERR( PetscSFSetType(self.sf, cval) ) # <<<<<<<<<<<<<< * * def getType(self) -> str: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFSetType(__pyx_v_self->sf, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 103, __pyx_L1_error) /* "petsc4py/PETSc/SF.pyx":86 * return self * * def setType(self, sf_type: Type | str) -> None: # <<<<<<<<<<<<<< * """Set the type of the star forest. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.SF.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_sf_type); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SF.pyx":105 * CHKERR( PetscSFSetType(self.sf, cval) ) * * def getType(self) -> str: # <<<<<<<<<<<<<< * """Return the type name of the star forest. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_13getType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2SF_12getType, "SF.getType(self) -> str\nReturn the type name of the star forest.\n\n Collective.\n\n See Also\n --------\n petsc.PetscSFGetType\n\n \nSource code at petsc4py/PETSc/SF.pyx:105"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_13getType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getType", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_12getType(((struct PyPetscSFObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_12getType(struct PyPetscSFObject *__pyx_v_self) { PetscSFType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getType", 1); /* "petsc4py/PETSc/SF.pyx":115 * * """ * cdef PetscSFType cval = NULL # <<<<<<<<<<<<<< * CHKERR( PetscSFGetType(self.sf, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/SF.pyx":116 * """ * cdef PetscSFType cval = NULL * CHKERR( PetscSFGetType(self.sf, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFGetType(__pyx_v_self->sf, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 116, __pyx_L1_error) /* "petsc4py/PETSc/SF.pyx":117 * cdef PetscSFType cval = NULL * CHKERR( PetscSFGetType(self.sf, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * def setFromOptions(self) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/SF.pyx":105 * CHKERR( PetscSFSetType(self.sf, cval) ) * * def getType(self) -> str: # <<<<<<<<<<<<<< * """Return the type name of the star forest. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SF.getType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SF.pyx":119 * return bytes2str(cval) * * def setFromOptions(self) -> None: # <<<<<<<<<<<<<< * """Set options using the options database. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_15setFromOptions(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2SF_14setFromOptions, "SF.setFromOptions(self) -> None\nSet options using the options database.\n\n Logically collective.\n\n See Also\n --------\n petsc_options, petsc.PetscSFSetFromOptions\n\n \nSource code at petsc4py/PETSc/SF.pyx:119"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_15setFromOptions(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFromOptions (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("setFromOptions", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setFromOptions", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_14setFromOptions(((struct PyPetscSFObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_14setFromOptions(struct PyPetscSFObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFromOptions", 1); /* "petsc4py/PETSc/SF.pyx":129 * * """ * CHKERR( PetscSFSetFromOptions(self.sf) ) # <<<<<<<<<<<<<< * * def setUp(self) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFSetFromOptions(__pyx_v_self->sf)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 129, __pyx_L1_error) /* "petsc4py/PETSc/SF.pyx":119 * return bytes2str(cval) * * def setFromOptions(self) -> None: # <<<<<<<<<<<<<< * """Set options using the options database. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SF.setFromOptions", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SF.pyx":131 * CHKERR( PetscSFSetFromOptions(self.sf) ) * * def setUp(self) -> None: # <<<<<<<<<<<<<< * """Set up communication structures. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_17setUp(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2SF_16setUp, "SF.setUp(self) -> None\nSet up communication structures.\n\n Collective.\n\n See Also\n --------\n petsc.PetscSFSetUp\n\n \nSource code at petsc4py/PETSc/SF.pyx:131"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_17setUp(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setUp (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("setUp", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setUp", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_16setUp(((struct PyPetscSFObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_16setUp(struct PyPetscSFObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setUp", 1); /* "petsc4py/PETSc/SF.pyx":141 * * """ * CHKERR( PetscSFSetUp(self.sf) ) # <<<<<<<<<<<<<< * * def reset(self) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFSetUp(__pyx_v_self->sf)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 141, __pyx_L1_error) /* "petsc4py/PETSc/SF.pyx":131 * CHKERR( PetscSFSetFromOptions(self.sf) ) * * def setUp(self) -> None: # <<<<<<<<<<<<<< * """Set up communication structures. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SF.setUp", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SF.pyx":143 * CHKERR( PetscSFSetUp(self.sf) ) * * def reset(self) -> None: # <<<<<<<<<<<<<< * """Reset a star forest so that different sizes or neighbors can be used. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_19reset(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2SF_18reset, "SF.reset(self) -> None\nReset a star forest so that different sizes or neighbors can be used.\n\n Collective.\n\n See Also\n --------\n petsc.PetscSFReset\n\n \nSource code at petsc4py/PETSc/SF.pyx:143"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_19reset(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("reset (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("reset", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "reset", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_18reset(((struct PyPetscSFObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_18reset(struct PyPetscSFObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("reset", 1); /* "petsc4py/PETSc/SF.pyx":153 * * """ * CHKERR( PetscSFReset(self.sf) ) # <<<<<<<<<<<<<< * * # */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFReset(__pyx_v_self->sf)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 153, __pyx_L1_error) /* "petsc4py/PETSc/SF.pyx":143 * CHKERR( PetscSFSetUp(self.sf) ) * * def reset(self) -> None: # <<<<<<<<<<<<<< * """Reset a star forest so that different sizes or neighbors can be used. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SF.reset", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SF.pyx":157 * # * * def getGraph(self) -> tuple[int, ArrayInt, ArrayInt]: # <<<<<<<<<<<<<< * """Return star forest graph. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_21getGraph(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2SF_20getGraph, "SF.getGraph(self) -> tuple[int, ArrayInt, ArrayInt]\nReturn star forest graph.\n\n Not collective.\n\n The number of leaves can be determined from the size of ``ilocal``.\n\n Returns\n -------\n nroots : int\n Number of root vertices on the current process (these are possible\n targets for other process to attach leaves).\n ilocal : ArrayInt\n Locations of leaves in leafdata buffers.\n iremote : ArrayInt\n Remote locations of root vertices for each leaf on the current\n process.\n\n See Also\n --------\n petsc.PetscSFGetGraph\n\n \nSource code at petsc4py/PETSc/SF.pyx:157"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_21getGraph(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getGraph (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getGraph", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getGraph", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_20getGraph(((struct PyPetscSFObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_20getGraph(struct PyPetscSFObject *__pyx_v_self) { PetscInt __pyx_v_nroots; PetscInt __pyx_v_nleaves; PetscInt const *__pyx_v_ilocal; PetscSFNode const *__pyx_v_iremote; PyArrayObject *__pyx_v_local = NULL; PyObject *__pyx_v_remote = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getGraph", 1); /* "petsc4py/PETSc/SF.pyx":180 * * """ * cdef PetscInt nroots = 0, nleaves = 0 # <<<<<<<<<<<<<< * cdef const PetscInt *ilocal = NULL * cdef const PetscSFNode *iremote = NULL */ __pyx_v_nroots = 0; __pyx_v_nleaves = 0; /* "petsc4py/PETSc/SF.pyx":181 * """ * cdef PetscInt nroots = 0, nleaves = 0 * cdef const PetscInt *ilocal = NULL # <<<<<<<<<<<<<< * cdef const PetscSFNode *iremote = NULL * CHKERR( PetscSFGetGraph(self.sf, &nroots, &nleaves, &ilocal, &iremote) ) */ __pyx_v_ilocal = NULL; /* "petsc4py/PETSc/SF.pyx":182 * cdef PetscInt nroots = 0, nleaves = 0 * cdef const PetscInt *ilocal = NULL * cdef const PetscSFNode *iremote = NULL # <<<<<<<<<<<<<< * CHKERR( PetscSFGetGraph(self.sf, &nroots, &nleaves, &ilocal, &iremote) ) * if ilocal == NULL: */ __pyx_v_iremote = NULL; /* "petsc4py/PETSc/SF.pyx":183 * cdef const PetscInt *ilocal = NULL * cdef const PetscSFNode *iremote = NULL * CHKERR( PetscSFGetGraph(self.sf, &nroots, &nleaves, &ilocal, &iremote) ) # <<<<<<<<<<<<<< * if ilocal == NULL: * local = arange(0, nleaves, 1) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFGetGraph(__pyx_v_self->sf, (&__pyx_v_nroots), (&__pyx_v_nleaves), (&__pyx_v_ilocal), (&__pyx_v_iremote))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 183, __pyx_L1_error) /* "petsc4py/PETSc/SF.pyx":184 * cdef const PetscSFNode *iremote = NULL * CHKERR( PetscSFGetGraph(self.sf, &nroots, &nleaves, &ilocal, &iremote) ) * if ilocal == NULL: # <<<<<<<<<<<<<< * local = arange(0, nleaves, 1) * else: */ __pyx_t_2 = (__pyx_v_ilocal == NULL); if (__pyx_t_2) { /* "petsc4py/PETSc/SF.pyx":185 * CHKERR( PetscSFGetGraph(self.sf, &nroots, &nleaves, &ilocal, &iremote) ) * if ilocal == NULL: * local = arange(0, nleaves, 1) # <<<<<<<<<<<<<< * else: * local = array_i(nleaves, ilocal) */ __pyx_t_3 = __Pyx_PyInt_From_PetscInt(__pyx_v_nleaves); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_arange(__pyx_int_0, __pyx_t_3, __pyx_int_1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(40, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_local = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/SF.pyx":184 * cdef const PetscSFNode *iremote = NULL * CHKERR( PetscSFGetGraph(self.sf, &nroots, &nleaves, &ilocal, &iremote) ) * if ilocal == NULL: # <<<<<<<<<<<<<< * local = arange(0, nleaves, 1) * else: */ goto __pyx_L3; } /* "petsc4py/PETSc/SF.pyx":187 * local = arange(0, nleaves, 1) * else: * local = array_i(nleaves, ilocal) # <<<<<<<<<<<<<< * remote = array_i(nleaves*2, iremote) * remote = remote.reshape(nleaves, 2) */ /*else*/ { __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i(__pyx_v_nleaves, __pyx_v_ilocal)); if (unlikely(!__pyx_t_4)) __PYX_ERR(40, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_local = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; } __pyx_L3:; /* "petsc4py/PETSc/SF.pyx":188 * else: * local = array_i(nleaves, ilocal) * remote = array_i(nleaves*2, iremote) # <<<<<<<<<<<<<< * remote = remote.reshape(nleaves, 2) * return toInt(nroots), local, remote */ __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i((__pyx_v_nleaves * 2), ((PetscInt const *)__pyx_v_iremote))); if (unlikely(!__pyx_t_4)) __PYX_ERR(40, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_remote = __pyx_t_4; __pyx_t_4 = 0; /* "petsc4py/PETSc/SF.pyx":189 * local = array_i(nleaves, ilocal) * remote = array_i(nleaves*2, iremote) * remote = remote.reshape(nleaves, 2) # <<<<<<<<<<<<<< * return toInt(nroots), local, remote * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_remote, __pyx_n_s_reshape); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyInt_From_PetscInt(__pyx_v_nleaves); if (unlikely(!__pyx_t_5)) __PYX_ERR(40, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_5, __pyx_int_2}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(40, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF_SET(__pyx_v_remote, __pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/SF.pyx":190 * remote = array_i(nleaves*2, iremote) * remote = remote.reshape(nleaves, 2) * return toInt(nroots), local, remote # <<<<<<<<<<<<<< * * def setGraph(self, nroots: int, local: Sequence[int], remote: Sequence[int]) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nroots); if (unlikely(!__pyx_t_4)) __PYX_ERR(40, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(40, 190, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_local); __Pyx_GIVEREF((PyObject *)__pyx_v_local); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_local))) __PYX_ERR(40, 190, __pyx_L1_error); __Pyx_INCREF(__pyx_v_remote); __Pyx_GIVEREF(__pyx_v_remote); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_remote)) __PYX_ERR(40, 190, __pyx_L1_error); __pyx_t_4 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "petsc4py/PETSc/SF.pyx":157 * # * * def getGraph(self) -> tuple[int, ArrayInt, ArrayInt]: # <<<<<<<<<<<<<< * """Return star forest graph. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.SF.getGraph", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_local); __Pyx_XDECREF(__pyx_v_remote); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SF.pyx":192 * return toInt(nroots), local, remote * * def setGraph(self, nroots: int, local: Sequence[int], remote: Sequence[int]) -> None: # <<<<<<<<<<<<<< * """Set star forest graph. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_23setGraph(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2SF_22setGraph, "SF.setGraph(self, nroots: int, local: Sequence[int], remote: Sequence[int]) -> None\nSet star forest graph.\n\n Collective.\n\n The number of leaves argument can be determined from the size of\n ``local`` and/or ``remote``.\n\n Parameters\n ----------\n nroots\n Number of root vertices on the current process (these are possible\n targets for other process to attach leaves).\n local\n Locations of leaves in leafdata buffers, pass `None` for contiguous\n storage.\n remote\n Remote locations of root vertices for each leaf on the current\n process. Should be ``2*nleaves`` long as (rank, index) pairs.\n\n See Also\n --------\n petsc.PetscSFSetGraph\n\n \nSource code at petsc4py/PETSc/SF.pyx:192"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_23setGraph(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_nroots = 0; PyObject *__pyx_v_local = 0; PyObject *__pyx_v_remote = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setGraph (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nroots,&__pyx_n_s_local,&__pyx_n_s_remote,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_nroots)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(40, 192, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_local)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(40, 192, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setGraph", 1, 3, 3, 1); __PYX_ERR(40, 192, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_remote)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(40, 192, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setGraph", 1, 3, 3, 2); __PYX_ERR(40, 192, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setGraph") < 0)) __PYX_ERR(40, 192, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_nroots = values[0]; __pyx_v_local = values[1]; __pyx_v_remote = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setGraph", 1, 3, 3, __pyx_nargs); __PYX_ERR(40, 192, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SF.setGraph", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_22setGraph(((struct PyPetscSFObject *)__pyx_v_self), __pyx_v_nroots, __pyx_v_local, __pyx_v_remote); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_22setGraph(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_nroots, PyObject *__pyx_v_local, PyObject *__pyx_v_remote) { PetscInt __pyx_v_cnroots; PetscInt __pyx_v_nleaves; PetscInt __pyx_v_nremote; PetscInt *__pyx_v_ilocal; PetscSFNode *__pyx_v_iremote; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setGraph", 0); __Pyx_INCREF(__pyx_v_local); __Pyx_INCREF(__pyx_v_remote); /* "petsc4py/PETSc/SF.pyx":217 * * """ * cdef PetscInt cnroots = asInt(nroots) # <<<<<<<<<<<<<< * cdef PetscInt nleaves = 0 * cdef PetscInt nremote = 0 */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_nroots); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(40, 217, __pyx_L1_error) __pyx_v_cnroots = __pyx_t_1; /* "petsc4py/PETSc/SF.pyx":218 * """ * cdef PetscInt cnroots = asInt(nroots) * cdef PetscInt nleaves = 0 # <<<<<<<<<<<<<< * cdef PetscInt nremote = 0 * cdef PetscInt *ilocal = NULL */ __pyx_v_nleaves = 0; /* "petsc4py/PETSc/SF.pyx":219 * cdef PetscInt cnroots = asInt(nroots) * cdef PetscInt nleaves = 0 * cdef PetscInt nremote = 0 # <<<<<<<<<<<<<< * cdef PetscInt *ilocal = NULL * cdef PetscSFNode* iremote = NULL */ __pyx_v_nremote = 0; /* "petsc4py/PETSc/SF.pyx":220 * cdef PetscInt nleaves = 0 * cdef PetscInt nremote = 0 * cdef PetscInt *ilocal = NULL # <<<<<<<<<<<<<< * cdef PetscSFNode* iremote = NULL * remote = iarray_i(remote, &nremote, &iremote) */ __pyx_v_ilocal = NULL; /* "petsc4py/PETSc/SF.pyx":221 * cdef PetscInt nremote = 0 * cdef PetscInt *ilocal = NULL * cdef PetscSFNode* iremote = NULL # <<<<<<<<<<<<<< * remote = iarray_i(remote, &nremote, &iremote) * if local is not None: */ __pyx_v_iremote = NULL; /* "petsc4py/PETSc/SF.pyx":222 * cdef PetscInt *ilocal = NULL * cdef PetscSFNode* iremote = NULL * remote = iarray_i(remote, &nremote, &iremote) # <<<<<<<<<<<<<< * if local is not None: * local = iarray_i(local, &nleaves, &ilocal) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_remote, (&__pyx_v_nremote), ((PetscInt **)(&__pyx_v_iremote)))); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_remote, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/SF.pyx":223 * cdef PetscSFNode* iremote = NULL * remote = iarray_i(remote, &nremote, &iremote) * if local is not None: # <<<<<<<<<<<<<< * local = iarray_i(local, &nleaves, &ilocal) * assert 2*nleaves == nremote */ __pyx_t_3 = (__pyx_v_local != Py_None); if (__pyx_t_3) { /* "petsc4py/PETSc/SF.pyx":224 * remote = iarray_i(remote, &nremote, &iremote) * if local is not None: * local = iarray_i(local, &nleaves, &ilocal) # <<<<<<<<<<<<<< * assert 2*nleaves == nremote * else: */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_local, (&__pyx_v_nleaves), (&__pyx_v_ilocal))); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_local, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/SF.pyx":225 * if local is not None: * local = iarray_i(local, &nleaves, &ilocal) * assert 2*nleaves == nremote # <<<<<<<<<<<<<< * else: * assert nremote % 2 == 0 */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_3 = ((2 * __pyx_v_nleaves) == __pyx_v_nremote); if (unlikely(!__pyx_t_3)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(40, 225, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(40, 225, __pyx_L1_error) #endif /* "petsc4py/PETSc/SF.pyx":223 * cdef PetscSFNode* iremote = NULL * remote = iarray_i(remote, &nremote, &iremote) * if local is not None: # <<<<<<<<<<<<<< * local = iarray_i(local, &nleaves, &ilocal) * assert 2*nleaves == nremote */ goto __pyx_L3; } /* "petsc4py/PETSc/SF.pyx":227 * assert 2*nleaves == nremote * else: * assert nremote % 2 == 0 # <<<<<<<<<<<<<< * nleaves = nremote // 2 * CHKERR( PetscSFSetGraph(self.sf, cnroots, nleaves, ilocal, PETSC_COPY_VALUES, iremote, PETSC_COPY_VALUES) ) */ /*else*/ { #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_3 = ((__pyx_v_nremote % 2) == 0); if (unlikely(!__pyx_t_3)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(40, 227, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(40, 227, __pyx_L1_error) #endif /* "petsc4py/PETSc/SF.pyx":228 * else: * assert nremote % 2 == 0 * nleaves = nremote // 2 # <<<<<<<<<<<<<< * CHKERR( PetscSFSetGraph(self.sf, cnroots, nleaves, ilocal, PETSC_COPY_VALUES, iremote, PETSC_COPY_VALUES) ) * */ __pyx_v_nleaves = (__pyx_v_nremote / 2); } __pyx_L3:; /* "petsc4py/PETSc/SF.pyx":229 * assert nremote % 2 == 0 * nleaves = nremote // 2 * CHKERR( PetscSFSetGraph(self.sf, cnroots, nleaves, ilocal, PETSC_COPY_VALUES, iremote, PETSC_COPY_VALUES) ) # <<<<<<<<<<<<<< * * def setRankOrder(self, flag: bool) -> None: */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFSetGraph(__pyx_v_self->sf, __pyx_v_cnroots, __pyx_v_nleaves, __pyx_v_ilocal, PETSC_COPY_VALUES, __pyx_v_iremote, PETSC_COPY_VALUES)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 229, __pyx_L1_error) /* "petsc4py/PETSc/SF.pyx":192 * return toInt(nroots), local, remote * * def setGraph(self, nroots: int, local: Sequence[int], remote: Sequence[int]) -> None: # <<<<<<<<<<<<<< * """Set star forest graph. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SF.setGraph", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_local); __Pyx_XDECREF(__pyx_v_remote); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SF.pyx":231 * CHKERR( PetscSFSetGraph(self.sf, cnroots, nleaves, ilocal, PETSC_COPY_VALUES, iremote, PETSC_COPY_VALUES) ) * * def setRankOrder(self, flag: bool) -> None: # <<<<<<<<<<<<<< * """Sort multi-points for gathers and scatters by rank order. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_25setRankOrder(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2SF_24setRankOrder, "SF.setRankOrder(self, flag: bool) -> None\nSort multi-points for gathers and scatters by rank order.\n\n Logically collective.\n\n Parameters\n ----------\n flag\n `True` to sort, `False` to skip sorting.\n\n See Also\n --------\n petsc.PetscSFSetRankOrder\n\n \nSource code at petsc4py/PETSc/SF.pyx:231"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_25setRankOrder(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_flag = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setRankOrder (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flag)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(40, 231, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setRankOrder") < 0)) __PYX_ERR(40, 231, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_flag = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setRankOrder", 1, 1, 1, __pyx_nargs); __PYX_ERR(40, 231, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SF.setRankOrder", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_24setRankOrder(((struct PyPetscSFObject *)__pyx_v_self), __pyx_v_flag); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_24setRankOrder(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_flag) { PetscBool __pyx_v_bval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setRankOrder", 1); /* "petsc4py/PETSc/SF.pyx":246 * * """ * cdef PetscBool bval = asBool(flag) # <<<<<<<<<<<<<< * CHKERR( PetscSFSetRankOrder(self.sf, bval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asBool(__pyx_v_flag); if (unlikely(__pyx_t_1 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(40, 246, __pyx_L1_error) __pyx_v_bval = __pyx_t_1; /* "petsc4py/PETSc/SF.pyx":247 * """ * cdef PetscBool bval = asBool(flag) * CHKERR( PetscSFSetRankOrder(self.sf, bval) ) # <<<<<<<<<<<<<< * * def getMulti(self) -> SF: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFSetRankOrder(__pyx_v_self->sf, __pyx_v_bval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 247, __pyx_L1_error) /* "petsc4py/PETSc/SF.pyx":231 * CHKERR( PetscSFSetGraph(self.sf, cnroots, nleaves, ilocal, PETSC_COPY_VALUES, iremote, PETSC_COPY_VALUES) ) * * def setRankOrder(self, flag: bool) -> None: # <<<<<<<<<<<<<< * """Sort multi-points for gathers and scatters by rank order. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SF.setRankOrder", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SF.pyx":249 * CHKERR( PetscSFSetRankOrder(self.sf, bval) ) * * def getMulti(self) -> SF: # <<<<<<<<<<<<<< * """Return the inner SF implementing gathers and scatters. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_27getMulti(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2SF_26getMulti, "SF.getMulti(self) -> SF\nReturn the inner SF implementing gathers and scatters.\n\n Collective.\n\n See Also\n --------\n petsc.PetscSFGetMultiSF\n\n \nSource code at petsc4py/PETSc/SF.pyx:249"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_27getMulti(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getMulti (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getMulti", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getMulti", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_26getMulti(((struct PyPetscSFObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_26getMulti(struct PyPetscSFObject *__pyx_v_self) { struct PyPetscSFObject *__pyx_v_sf = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getMulti", 1); /* "petsc4py/PETSc/SF.pyx":259 * * """ * cdef SF sf = SF() # <<<<<<<<<<<<<< * CHKERR( PetscSFGetMultiSF(self.sf, &sf.sf) ) * CHKERR( PetscINCREF(sf.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SF)); if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_sf = ((struct PyPetscSFObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/SF.pyx":260 * """ * cdef SF sf = SF() * CHKERR( PetscSFGetMultiSF(self.sf, &sf.sf) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(sf.obj) ) * return sf */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFGetMultiSF(__pyx_v_self->sf, (&__pyx_v_sf->sf))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 260, __pyx_L1_error) /* "petsc4py/PETSc/SF.pyx":261 * cdef SF sf = SF() * CHKERR( PetscSFGetMultiSF(self.sf, &sf.sf) ) * CHKERR( PetscINCREF(sf.obj) ) # <<<<<<<<<<<<<< * return sf * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_sf->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 261, __pyx_L1_error) /* "petsc4py/PETSc/SF.pyx":262 * CHKERR( PetscSFGetMultiSF(self.sf, &sf.sf) ) * CHKERR( PetscINCREF(sf.obj) ) * return sf # <<<<<<<<<<<<<< * * def createInverse(self) -> SF: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_sf); __pyx_r = ((PyObject *)__pyx_v_sf); goto __pyx_L0; /* "petsc4py/PETSc/SF.pyx":249 * CHKERR( PetscSFSetRankOrder(self.sf, bval) ) * * def getMulti(self) -> SF: # <<<<<<<<<<<<<< * """Return the inner SF implementing gathers and scatters. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.SF.getMulti", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_sf); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SF.pyx":264 * return sf * * def createInverse(self) -> SF: # <<<<<<<<<<<<<< * """Create the inverse map. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_29createInverse(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2SF_28createInverse, "SF.createInverse(self) -> SF\nCreate the inverse map.\n\n Collective.\n\n Create the inverse map given a PetscSF in which all vertices have\n degree 1.\n\n See Also\n --------\n petsc.PetscSFCreateInverseSF\n\n \nSource code at petsc4py/PETSc/SF.pyx:264"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_29createInverse(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createInverse (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("createInverse", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "createInverse", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_28createInverse(((struct PyPetscSFObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_28createInverse(struct PyPetscSFObject *__pyx_v_self) { struct PyPetscSFObject *__pyx_v_sf = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createInverse", 1); /* "petsc4py/PETSc/SF.pyx":277 * * """ * cdef SF sf = SF() # <<<<<<<<<<<<<< * CHKERR( PetscSFCreateInverseSF(self.sf, &sf.sf) ) * return sf */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SF)); if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_sf = ((struct PyPetscSFObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/SF.pyx":278 * """ * cdef SF sf = SF() * CHKERR( PetscSFCreateInverseSF(self.sf, &sf.sf) ) # <<<<<<<<<<<<<< * return sf * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFCreateInverseSF(__pyx_v_self->sf, (&__pyx_v_sf->sf))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 278, __pyx_L1_error) /* "petsc4py/PETSc/SF.pyx":279 * cdef SF sf = SF() * CHKERR( PetscSFCreateInverseSF(self.sf, &sf.sf) ) * return sf # <<<<<<<<<<<<<< * * def computeDegree(self) -> ArrayInt: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_sf); __pyx_r = ((PyObject *)__pyx_v_sf); goto __pyx_L0; /* "petsc4py/PETSc/SF.pyx":264 * return sf * * def createInverse(self) -> SF: # <<<<<<<<<<<<<< * """Create the inverse map. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.SF.createInverse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_sf); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SF.pyx":281 * return sf * * def computeDegree(self) -> ArrayInt: # <<<<<<<<<<<<<< * """Compute and return the degree of each root vertex. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_31computeDegree(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2SF_30computeDegree, "SF.computeDegree(self) -> ArrayInt\nCompute and return the degree of each root vertex.\n\n Collective.\n\n See Also\n --------\n petsc.PetscSFComputeDegreeBegin, petsc.PetscSFComputeDegreeEnd\n\n \nSource code at petsc4py/PETSc/SF.pyx:281"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_31computeDegree(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("computeDegree (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("computeDegree", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "computeDegree", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_30computeDegree(((struct PyPetscSFObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_30computeDegree(struct PyPetscSFObject *__pyx_v_self) { PetscInt const *__pyx_v_cdegree; PetscInt __pyx_v_nroots; PyArrayObject *__pyx_v_degree = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("computeDegree", 1); /* "petsc4py/PETSc/SF.pyx":291 * * """ * cdef const PetscInt *cdegree = NULL # <<<<<<<<<<<<<< * cdef PetscInt nroots * CHKERR( PetscSFComputeDegreeBegin(self.sf, &cdegree) ) */ __pyx_v_cdegree = NULL; /* "petsc4py/PETSc/SF.pyx":293 * cdef const PetscInt *cdegree = NULL * cdef PetscInt nroots * CHKERR( PetscSFComputeDegreeBegin(self.sf, &cdegree) ) # <<<<<<<<<<<<<< * CHKERR( PetscSFComputeDegreeEnd(self.sf, &cdegree) ) * CHKERR( PetscSFGetGraph(self.sf, &nroots, NULL, NULL, NULL) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFComputeDegreeBegin(__pyx_v_self->sf, (&__pyx_v_cdegree))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 293, __pyx_L1_error) /* "petsc4py/PETSc/SF.pyx":294 * cdef PetscInt nroots * CHKERR( PetscSFComputeDegreeBegin(self.sf, &cdegree) ) * CHKERR( PetscSFComputeDegreeEnd(self.sf, &cdegree) ) # <<<<<<<<<<<<<< * CHKERR( PetscSFGetGraph(self.sf, &nroots, NULL, NULL, NULL) ) * degree = array_i(nroots, cdegree) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFComputeDegreeEnd(__pyx_v_self->sf, (&__pyx_v_cdegree))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 294, __pyx_L1_error) /* "petsc4py/PETSc/SF.pyx":295 * CHKERR( PetscSFComputeDegreeBegin(self.sf, &cdegree) ) * CHKERR( PetscSFComputeDegreeEnd(self.sf, &cdegree) ) * CHKERR( PetscSFGetGraph(self.sf, &nroots, NULL, NULL, NULL) ) # <<<<<<<<<<<<<< * degree = array_i(nroots, cdegree) * return degree */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFGetGraph(__pyx_v_self->sf, (&__pyx_v_nroots), NULL, NULL, NULL)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 295, __pyx_L1_error) /* "petsc4py/PETSc/SF.pyx":296 * CHKERR( PetscSFComputeDegreeEnd(self.sf, &cdegree) ) * CHKERR( PetscSFGetGraph(self.sf, &nroots, NULL, NULL, NULL) ) * degree = array_i(nroots, cdegree) # <<<<<<<<<<<<<< * return degree * */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i(__pyx_v_nroots, __pyx_v_cdegree)); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_degree = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/SF.pyx":297 * CHKERR( PetscSFGetGraph(self.sf, &nroots, NULL, NULL, NULL) ) * degree = array_i(nroots, cdegree) * return degree # <<<<<<<<<<<<<< * * def createEmbeddedRootSF(self, selected: Sequence[int]) -> SF: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_degree); __pyx_r = ((PyObject *)__pyx_v_degree); goto __pyx_L0; /* "petsc4py/PETSc/SF.pyx":281 * return sf * * def computeDegree(self) -> ArrayInt: # <<<<<<<<<<<<<< * """Compute and return the degree of each root vertex. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SF.computeDegree", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_degree); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SF.pyx":299 * return degree * * def createEmbeddedRootSF(self, selected: Sequence[int]) -> SF: # <<<<<<<<<<<<<< * """Remove edges from all but the selected roots. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_33createEmbeddedRootSF(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2SF_32createEmbeddedRootSF, "SF.createEmbeddedRootSF(self, selected: Sequence[int]) -> SF\nRemove edges from all but the selected roots.\n\n Collective.\n\n Does not remap indices.\n\n Parameters\n ----------\n selected\n Indices of the selected roots on this process.\n\n See Also\n --------\n petsc.PetscSFCreateEmbeddedRootSF\n\n \nSource code at petsc4py/PETSc/SF.pyx:299"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_33createEmbeddedRootSF(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_selected = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createEmbeddedRootSF (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_selected,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_selected)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(40, 299, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createEmbeddedRootSF") < 0)) __PYX_ERR(40, 299, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_selected = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createEmbeddedRootSF", 1, 1, 1, __pyx_nargs); __PYX_ERR(40, 299, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SF.createEmbeddedRootSF", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_32createEmbeddedRootSF(((struct PyPetscSFObject *)__pyx_v_self), __pyx_v_selected); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_32createEmbeddedRootSF(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_selected) { PetscInt __pyx_v_nroots; PetscInt *__pyx_v_cselected; struct PyPetscSFObject *__pyx_v_sf = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscInt __pyx_t_3; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createEmbeddedRootSF", 0); __Pyx_INCREF(__pyx_v_selected); /* "petsc4py/PETSc/SF.pyx":316 * * """ * cdef PetscInt nroots = asInt(len(selected)) # <<<<<<<<<<<<<< * cdef PetscInt *cselected = NULL * selected = iarray_i(selected, &nroots, &cselected) */ __pyx_t_1 = PyObject_Length(__pyx_v_selected); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(40, 316, __pyx_L1_error) __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_t_2); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(40, 316, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_nroots = __pyx_t_3; /* "petsc4py/PETSc/SF.pyx":317 * """ * cdef PetscInt nroots = asInt(len(selected)) * cdef PetscInt *cselected = NULL # <<<<<<<<<<<<<< * selected = iarray_i(selected, &nroots, &cselected) * cdef SF sf = SF() */ __pyx_v_cselected = NULL; /* "petsc4py/PETSc/SF.pyx":318 * cdef PetscInt nroots = asInt(len(selected)) * cdef PetscInt *cselected = NULL * selected = iarray_i(selected, &nroots, &cselected) # <<<<<<<<<<<<<< * cdef SF sf = SF() * CHKERR( PetscSFCreateEmbeddedRootSF(self.sf, nroots, cselected, &sf.sf) ) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_selected, (&__pyx_v_nroots), (&__pyx_v_cselected))); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_selected, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/SF.pyx":319 * cdef PetscInt *cselected = NULL * selected = iarray_i(selected, &nroots, &cselected) * cdef SF sf = SF() # <<<<<<<<<<<<<< * CHKERR( PetscSFCreateEmbeddedRootSF(self.sf, nroots, cselected, &sf.sf) ) * return sf */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SF)); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_sf = ((struct PyPetscSFObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/SF.pyx":320 * selected = iarray_i(selected, &nroots, &cselected) * cdef SF sf = SF() * CHKERR( PetscSFCreateEmbeddedRootSF(self.sf, nroots, cselected, &sf.sf) ) # <<<<<<<<<<<<<< * return sf * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFCreateEmbeddedRootSF(__pyx_v_self->sf, __pyx_v_nroots, __pyx_v_cselected, (&__pyx_v_sf->sf))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 320, __pyx_L1_error) /* "petsc4py/PETSc/SF.pyx":321 * cdef SF sf = SF() * CHKERR( PetscSFCreateEmbeddedRootSF(self.sf, nroots, cselected, &sf.sf) ) * return sf # <<<<<<<<<<<<<< * * def createEmbeddedLeafSF(self, selected: Sequence[int]) -> SF: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_sf); __pyx_r = ((PyObject *)__pyx_v_sf); goto __pyx_L0; /* "petsc4py/PETSc/SF.pyx":299 * return degree * * def createEmbeddedRootSF(self, selected: Sequence[int]) -> SF: # <<<<<<<<<<<<<< * """Remove edges from all but the selected roots. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SF.createEmbeddedRootSF", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_sf); __Pyx_XDECREF(__pyx_v_selected); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SF.pyx":323 * return sf * * def createEmbeddedLeafSF(self, selected: Sequence[int]) -> SF: # <<<<<<<<<<<<<< * """Remove edges from all but the selected leaves. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_35createEmbeddedLeafSF(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2SF_34createEmbeddedLeafSF, "SF.createEmbeddedLeafSF(self, selected: Sequence[int]) -> SF\nRemove edges from all but the selected leaves.\n\n Collective.\n\n Does not remap indices.\n\n Parameters\n ----------\n selected\n Indices of the selected roots on this process.\n\n See Also\n --------\n petsc.PetscSFCreateEmbeddedLeafSF\n\n \nSource code at petsc4py/PETSc/SF.pyx:323"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_35createEmbeddedLeafSF(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_selected = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createEmbeddedLeafSF (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_selected,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_selected)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(40, 323, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createEmbeddedLeafSF") < 0)) __PYX_ERR(40, 323, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_selected = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createEmbeddedLeafSF", 1, 1, 1, __pyx_nargs); __PYX_ERR(40, 323, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SF.createEmbeddedLeafSF", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_34createEmbeddedLeafSF(((struct PyPetscSFObject *)__pyx_v_self), __pyx_v_selected); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_34createEmbeddedLeafSF(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_selected) { PetscInt __pyx_v_nleaves; PetscInt *__pyx_v_cselected; struct PyPetscSFObject *__pyx_v_sf = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscInt __pyx_t_3; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createEmbeddedLeafSF", 0); __Pyx_INCREF(__pyx_v_selected); /* "petsc4py/PETSc/SF.pyx":340 * * """ * cdef PetscInt nleaves = asInt(len(selected)) # <<<<<<<<<<<<<< * cdef PetscInt *cselected = NULL * selected = iarray_i(selected, &nleaves, &cselected) */ __pyx_t_1 = PyObject_Length(__pyx_v_selected); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(40, 340, __pyx_L1_error) __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_t_2); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(40, 340, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_nleaves = __pyx_t_3; /* "petsc4py/PETSc/SF.pyx":341 * """ * cdef PetscInt nleaves = asInt(len(selected)) * cdef PetscInt *cselected = NULL # <<<<<<<<<<<<<< * selected = iarray_i(selected, &nleaves, &cselected) * cdef SF sf = SF() */ __pyx_v_cselected = NULL; /* "petsc4py/PETSc/SF.pyx":342 * cdef PetscInt nleaves = asInt(len(selected)) * cdef PetscInt *cselected = NULL * selected = iarray_i(selected, &nleaves, &cselected) # <<<<<<<<<<<<<< * cdef SF sf = SF() * CHKERR( PetscSFCreateEmbeddedLeafSF(self.sf, nleaves, cselected, &sf.sf) ) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_selected, (&__pyx_v_nleaves), (&__pyx_v_cselected))); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_selected, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/SF.pyx":343 * cdef PetscInt *cselected = NULL * selected = iarray_i(selected, &nleaves, &cselected) * cdef SF sf = SF() # <<<<<<<<<<<<<< * CHKERR( PetscSFCreateEmbeddedLeafSF(self.sf, nleaves, cselected, &sf.sf) ) * return sf */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SF)); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_sf = ((struct PyPetscSFObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/SF.pyx":344 * selected = iarray_i(selected, &nleaves, &cselected) * cdef SF sf = SF() * CHKERR( PetscSFCreateEmbeddedLeafSF(self.sf, nleaves, cselected, &sf.sf) ) # <<<<<<<<<<<<<< * return sf * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFCreateEmbeddedLeafSF(__pyx_v_self->sf, __pyx_v_nleaves, __pyx_v_cselected, (&__pyx_v_sf->sf))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 344, __pyx_L1_error) /* "petsc4py/PETSc/SF.pyx":345 * cdef SF sf = SF() * CHKERR( PetscSFCreateEmbeddedLeafSF(self.sf, nleaves, cselected, &sf.sf) ) * return sf # <<<<<<<<<<<<<< * * def createSectionSF(self, Section rootSection, remoteOffsets: Sequence[int] | None, Section leafSection) -> SF: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_sf); __pyx_r = ((PyObject *)__pyx_v_sf); goto __pyx_L0; /* "petsc4py/PETSc/SF.pyx":323 * return sf * * def createEmbeddedLeafSF(self, selected: Sequence[int]) -> SF: # <<<<<<<<<<<<<< * """Remove edges from all but the selected leaves. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SF.createEmbeddedLeafSF", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_sf); __Pyx_XDECREF(__pyx_v_selected); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SF.pyx":347 * return sf * * def createSectionSF(self, Section rootSection, remoteOffsets: Sequence[int] | None, Section leafSection) -> SF: # <<<<<<<<<<<<<< * """Create an expanded `SF` of DOFs. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_37createSectionSF(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2SF_36createSectionSF, "SF.createSectionSF(self, rootSection: Section, remoteOffsets: Sequence[int] | None, leafSection: Section) -> SF\nCreate an expanded `SF` of DOFs.\n\n Collective.\n\n Assumes the input `SF` relates points.\n\n Parameters\n ----------\n rootSection\n Data layout of remote points for outgoing data (this is usually\n the serial section).\n remoteOffsets\n Offsets for point data on remote processes (these are offsets from\n the root section), or `None`.\n leafSection\n Data layout of local points for incoming data (this is the\n distributed section).\n\n See Also\n --------\n petsc.PetscSFCreateSectionSF\n\n \nSource code at petsc4py/PETSc/SF.pyx:347"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_37createSectionSF(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscSectionObject *__pyx_v_rootSection = 0; PyObject *__pyx_v_remoteOffsets = 0; struct PyPetscSectionObject *__pyx_v_leafSection = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createSectionSF (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rootSection,&__pyx_n_s_remoteOffsets,&__pyx_n_s_leafSection,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rootSection)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(40, 347, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_remoteOffsets)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(40, 347, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("createSectionSF", 1, 3, 3, 1); __PYX_ERR(40, 347, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_leafSection)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(40, 347, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("createSectionSF", 1, 3, 3, 2); __PYX_ERR(40, 347, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createSectionSF") < 0)) __PYX_ERR(40, 347, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_rootSection = ((struct PyPetscSectionObject *)values[0]); __pyx_v_remoteOffsets = values[1]; __pyx_v_leafSection = ((struct PyPetscSectionObject *)values[2]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createSectionSF", 1, 3, 3, __pyx_nargs); __PYX_ERR(40, 347, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SF.createSectionSF", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rootSection), __pyx_ptype_8petsc4py_5PETSc_Section, 0, "rootSection", 0))) __PYX_ERR(40, 347, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_leafSection), __pyx_ptype_8petsc4py_5PETSc_Section, 0, "leafSection", 0))) __PYX_ERR(40, 347, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_36createSectionSF(((struct PyPetscSFObject *)__pyx_v_self), __pyx_v_rootSection, __pyx_v_remoteOffsets, __pyx_v_leafSection); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_36createSectionSF(struct PyPetscSFObject *__pyx_v_self, struct PyPetscSectionObject *__pyx_v_rootSection, PyObject *__pyx_v_remoteOffsets, struct PyPetscSectionObject *__pyx_v_leafSection) { struct PyPetscSFObject *__pyx_v_sectionSF = 0; PetscInt __pyx_v_noffsets; PetscInt *__pyx_v_cremoteOffsets; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createSectionSF", 0); __Pyx_INCREF(__pyx_v_remoteOffsets); /* "petsc4py/PETSc/SF.pyx":371 * * """ * cdef SF sectionSF = SF() # <<<<<<<<<<<<<< * cdef PetscInt noffsets = 0 * cdef PetscInt *cremoteOffsets = NULL */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SF)); if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 371, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_sectionSF = ((struct PyPetscSFObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/SF.pyx":372 * """ * cdef SF sectionSF = SF() * cdef PetscInt noffsets = 0 # <<<<<<<<<<<<<< * cdef PetscInt *cremoteOffsets = NULL * if remoteOffsets is not None: */ __pyx_v_noffsets = 0; /* "petsc4py/PETSc/SF.pyx":373 * cdef SF sectionSF = SF() * cdef PetscInt noffsets = 0 * cdef PetscInt *cremoteOffsets = NULL # <<<<<<<<<<<<<< * if remoteOffsets is not None: * remoteOffsets = iarray_i(remoteOffsets, &noffsets, &cremoteOffsets) */ __pyx_v_cremoteOffsets = NULL; /* "petsc4py/PETSc/SF.pyx":374 * cdef PetscInt noffsets = 0 * cdef PetscInt *cremoteOffsets = NULL * if remoteOffsets is not None: # <<<<<<<<<<<<<< * remoteOffsets = iarray_i(remoteOffsets, &noffsets, &cremoteOffsets) * CHKERR( PetscSFCreateSectionSF(self.sf, rootSection.sec, cremoteOffsets, */ __pyx_t_2 = (__pyx_v_remoteOffsets != Py_None); if (__pyx_t_2) { /* "petsc4py/PETSc/SF.pyx":375 * cdef PetscInt *cremoteOffsets = NULL * if remoteOffsets is not None: * remoteOffsets = iarray_i(remoteOffsets, &noffsets, &cremoteOffsets) # <<<<<<<<<<<<<< * CHKERR( PetscSFCreateSectionSF(self.sf, rootSection.sec, cremoteOffsets, * leafSection.sec, §ionSF.sf) ) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_remoteOffsets, (&__pyx_v_noffsets), (&__pyx_v_cremoteOffsets))); if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_remoteOffsets, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/SF.pyx":374 * cdef PetscInt noffsets = 0 * cdef PetscInt *cremoteOffsets = NULL * if remoteOffsets is not None: # <<<<<<<<<<<<<< * remoteOffsets = iarray_i(remoteOffsets, &noffsets, &cremoteOffsets) * CHKERR( PetscSFCreateSectionSF(self.sf, rootSection.sec, cremoteOffsets, */ } /* "petsc4py/PETSc/SF.pyx":376 * if remoteOffsets is not None: * remoteOffsets = iarray_i(remoteOffsets, &noffsets, &cremoteOffsets) * CHKERR( PetscSFCreateSectionSF(self.sf, rootSection.sec, cremoteOffsets, # <<<<<<<<<<<<<< * leafSection.sec, §ionSF.sf) ) * return sectionSF */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFCreateSectionSF(__pyx_v_self->sf, __pyx_v_rootSection->sec, __pyx_v_cremoteOffsets, __pyx_v_leafSection->sec, (&__pyx_v_sectionSF->sf))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 376, __pyx_L1_error) /* "petsc4py/PETSc/SF.pyx":378 * CHKERR( PetscSFCreateSectionSF(self.sf, rootSection.sec, cremoteOffsets, * leafSection.sec, §ionSF.sf) ) * return sectionSF # <<<<<<<<<<<<<< * * def distributeSection(self, Section rootSection, Section leafSection=None) -> tuple[ArrayInt, Section]: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_sectionSF); __pyx_r = ((PyObject *)__pyx_v_sectionSF); goto __pyx_L0; /* "petsc4py/PETSc/SF.pyx":347 * return sf * * def createSectionSF(self, Section rootSection, remoteOffsets: Sequence[int] | None, Section leafSection) -> SF: # <<<<<<<<<<<<<< * """Create an expanded `SF` of DOFs. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.SF.createSectionSF", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_sectionSF); __Pyx_XDECREF(__pyx_v_remoteOffsets); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SF.pyx":380 * return sectionSF * * def distributeSection(self, Section rootSection, Section leafSection=None) -> tuple[ArrayInt, Section]: # <<<<<<<<<<<<<< * """Create a new, reorganized `Section`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_39distributeSection(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2SF_38distributeSection, "SF.distributeSection(self, rootSection: Section, leafSection: Section | None = None) -> tuple[ArrayInt, Section]\nCreate a new, reorganized `Section`.\n\n Collective.\n\n Moves from the root to the leaves of the `SF`.\n\n Parameters\n ----------\n rootSection\n Section defined on root space.\n leafSection\n Section defined on the leaf space.\n\n See Also\n --------\n petsc.PetscSFDistributeSection\n\n \nSource code at petsc4py/PETSc/SF.pyx:380"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_39distributeSection(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscSectionObject *__pyx_v_rootSection = 0; struct PyPetscSectionObject *__pyx_v_leafSection = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("distributeSection (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rootSection,&__pyx_n_s_leafSection,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscSectionObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rootSection)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(40, 380, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_leafSection); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(40, 380, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "distributeSection") < 0)) __PYX_ERR(40, 380, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_rootSection = ((struct PyPetscSectionObject *)values[0]); __pyx_v_leafSection = ((struct PyPetscSectionObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("distributeSection", 0, 1, 2, __pyx_nargs); __PYX_ERR(40, 380, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SF.distributeSection", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rootSection), __pyx_ptype_8petsc4py_5PETSc_Section, 0, "rootSection", 0))) __PYX_ERR(40, 380, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_leafSection), __pyx_ptype_8petsc4py_5PETSc_Section, 1, "leafSection", 0))) __PYX_ERR(40, 380, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_38distributeSection(((struct PyPetscSFObject *)__pyx_v_self), __pyx_v_rootSection, __pyx_v_leafSection); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_38distributeSection(struct PyPetscSFObject *__pyx_v_self, struct PyPetscSectionObject *__pyx_v_rootSection, struct PyPetscSectionObject *__pyx_v_leafSection) { PetscInt __pyx_v_lpStart; PetscInt __pyx_v_lpEnd; PetscInt *__pyx_v_cremoteOffsets; PyArrayObject *__pyx_v_remoteOffsets = 0; MPI_Comm __pyx_v_ccomm; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; MPI_Comm __pyx_t_2; int __pyx_t_3; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("distributeSection", 0); __Pyx_INCREF((PyObject *)__pyx_v_leafSection); /* "petsc4py/PETSc/SF.pyx":401 * cdef PetscInt lpStart * cdef PetscInt lpEnd * cdef PetscInt *cremoteOffsets = NULL # <<<<<<<<<<<<<< * cdef ndarray remoteOffsets * cdef MPI_Comm ccomm = def_Comm(self.comm, PETSC_COMM_DEFAULT) */ __pyx_v_cremoteOffsets = NULL; /* "petsc4py/PETSc/SF.pyx":403 * cdef PetscInt *cremoteOffsets = NULL * cdef ndarray remoteOffsets * cdef MPI_Comm ccomm = def_Comm(self.comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * if leafSection is None: * leafSection = Section() */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_comm); if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_t_1, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_2 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(40, 403, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_ccomm = __pyx_t_2; /* "petsc4py/PETSc/SF.pyx":404 * cdef ndarray remoteOffsets * cdef MPI_Comm ccomm = def_Comm(self.comm, PETSC_COMM_DEFAULT) * if leafSection is None: # <<<<<<<<<<<<<< * leafSection = Section() * if leafSection.sec == NULL: */ __pyx_t_3 = (((PyObject *)__pyx_v_leafSection) == Py_None); if (__pyx_t_3) { /* "petsc4py/PETSc/SF.pyx":405 * cdef MPI_Comm ccomm = def_Comm(self.comm, PETSC_COMM_DEFAULT) * if leafSection is None: * leafSection = Section() # <<<<<<<<<<<<<< * if leafSection.sec == NULL: * CHKERR( PetscSectionCreate(ccomm, &leafSection.sec) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Section)); if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_leafSection, ((struct PyPetscSectionObject *)__pyx_t_1)); __pyx_t_1 = 0; /* "petsc4py/PETSc/SF.pyx":404 * cdef ndarray remoteOffsets * cdef MPI_Comm ccomm = def_Comm(self.comm, PETSC_COMM_DEFAULT) * if leafSection is None: # <<<<<<<<<<<<<< * leafSection = Section() * if leafSection.sec == NULL: */ } /* "petsc4py/PETSc/SF.pyx":406 * if leafSection is None: * leafSection = Section() * if leafSection.sec == NULL: # <<<<<<<<<<<<<< * CHKERR( PetscSectionCreate(ccomm, &leafSection.sec) ) * CHKERR( PetscSFDistributeSection(self.sf, rootSection.sec, */ __pyx_t_3 = (__pyx_v_leafSection->sec == NULL); if (__pyx_t_3) { /* "petsc4py/PETSc/SF.pyx":407 * leafSection = Section() * if leafSection.sec == NULL: * CHKERR( PetscSectionCreate(ccomm, &leafSection.sec) ) # <<<<<<<<<<<<<< * CHKERR( PetscSFDistributeSection(self.sf, rootSection.sec, * &cremoteOffsets, leafSection.sec) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionCreate(__pyx_v_ccomm, (&__pyx_v_leafSection->sec))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 407, __pyx_L1_error) /* "petsc4py/PETSc/SF.pyx":406 * if leafSection is None: * leafSection = Section() * if leafSection.sec == NULL: # <<<<<<<<<<<<<< * CHKERR( PetscSectionCreate(ccomm, &leafSection.sec) ) * CHKERR( PetscSFDistributeSection(self.sf, rootSection.sec, */ } /* "petsc4py/PETSc/SF.pyx":408 * if leafSection.sec == NULL: * CHKERR( PetscSectionCreate(ccomm, &leafSection.sec) ) * CHKERR( PetscSFDistributeSection(self.sf, rootSection.sec, # <<<<<<<<<<<<<< * &cremoteOffsets, leafSection.sec) ) * CHKERR( PetscSectionGetChart(leafSection.sec, &lpStart, &lpEnd) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFDistributeSection(__pyx_v_self->sf, __pyx_v_rootSection->sec, (&__pyx_v_cremoteOffsets), __pyx_v_leafSection->sec)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 408, __pyx_L1_error) /* "petsc4py/PETSc/SF.pyx":410 * CHKERR( PetscSFDistributeSection(self.sf, rootSection.sec, * &cremoteOffsets, leafSection.sec) ) * CHKERR( PetscSectionGetChart(leafSection.sec, &lpStart, &lpEnd) ) # <<<<<<<<<<<<<< * remoteOffsets = array_i(lpEnd-lpStart, cremoteOffsets) * CHKERR( PetscFree(cremoteOffsets) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionGetChart(__pyx_v_leafSection->sec, (&__pyx_v_lpStart), (&__pyx_v_lpEnd))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 410, __pyx_L1_error) /* "petsc4py/PETSc/SF.pyx":411 * &cremoteOffsets, leafSection.sec) ) * CHKERR( PetscSectionGetChart(leafSection.sec, &lpStart, &lpEnd) ) * remoteOffsets = array_i(lpEnd-lpStart, cremoteOffsets) # <<<<<<<<<<<<<< * CHKERR( PetscFree(cremoteOffsets) ) * return (remoteOffsets, leafSection) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i((__pyx_v_lpEnd - __pyx_v_lpStart), __pyx_v_cremoteOffsets)); if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_remoteOffsets = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/SF.pyx":412 * CHKERR( PetscSectionGetChart(leafSection.sec, &lpStart, &lpEnd) ) * remoteOffsets = array_i(lpEnd-lpStart, cremoteOffsets) * CHKERR( PetscFree(cremoteOffsets) ) # <<<<<<<<<<<<<< * return (remoteOffsets, leafSection) * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_cremoteOffsets)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 412, __pyx_L1_error) /* "petsc4py/PETSc/SF.pyx":413 * remoteOffsets = array_i(lpEnd-lpStart, cremoteOffsets) * CHKERR( PetscFree(cremoteOffsets) ) * return (remoteOffsets, leafSection) # <<<<<<<<<<<<<< * * def compose(self, SF sf) -> SF: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF((PyObject *)__pyx_v_remoteOffsets); __Pyx_GIVEREF((PyObject *)__pyx_v_remoteOffsets); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_remoteOffsets))) __PYX_ERR(40, 413, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_leafSection); __Pyx_GIVEREF((PyObject *)__pyx_v_leafSection); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_leafSection))) __PYX_ERR(40, 413, __pyx_L1_error); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/SF.pyx":380 * return sectionSF * * def distributeSection(self, Section rootSection, Section leafSection=None) -> tuple[ArrayInt, Section]: # <<<<<<<<<<<<<< * """Create a new, reorganized `Section`. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.SF.distributeSection", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_remoteOffsets); __Pyx_XDECREF((PyObject *)__pyx_v_leafSection); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SF.pyx":415 * return (remoteOffsets, leafSection) * * def compose(self, SF sf) -> SF: # <<<<<<<<<<<<<< * """Compose a new `SF`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_41compose(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2SF_40compose, "SF.compose(self, sf: SF) -> SF\nCompose a new `SF`.\n\n Collective.\n\n Puts the ``sf`` under this object in a top (roots) down (leaves) view.\n\n Parameters\n ----------\n sf\n `SF` to put under this object.\n\n See Also\n --------\n petsc.PetscSFCompose\n\n \nSource code at petsc4py/PETSc/SF.pyx:415"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_41compose(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscSFObject *__pyx_v_sf = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("compose (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sf,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sf)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(40, 415, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "compose") < 0)) __PYX_ERR(40, 415, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_sf = ((struct PyPetscSFObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("compose", 1, 1, 1, __pyx_nargs); __PYX_ERR(40, 415, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SF.compose", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sf), __pyx_ptype_8petsc4py_5PETSc_SF, 0, "sf", 0))) __PYX_ERR(40, 415, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_40compose(((struct PyPetscSFObject *)__pyx_v_self), __pyx_v_sf); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_40compose(struct PyPetscSFObject *__pyx_v_self, struct PyPetscSFObject *__pyx_v_sf) { struct PyPetscSFObject *__pyx_v_csf = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("compose", 1); /* "petsc4py/PETSc/SF.pyx":432 * * """ * cdef SF csf = SF() # <<<<<<<<<<<<<< * CHKERR( PetscSFCompose(self.sf, sf.sf, &csf.sf)) * return csf */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SF)); if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 432, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_csf = ((struct PyPetscSFObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/SF.pyx":433 * """ * cdef SF csf = SF() * CHKERR( PetscSFCompose(self.sf, sf.sf, &csf.sf)) # <<<<<<<<<<<<<< * return csf * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFCompose(__pyx_v_self->sf, __pyx_v_sf->sf, (&__pyx_v_csf->sf))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 433, __pyx_L1_error) /* "petsc4py/PETSc/SF.pyx":434 * cdef SF csf = SF() * CHKERR( PetscSFCompose(self.sf, sf.sf, &csf.sf)) * return csf # <<<<<<<<<<<<<< * * def bcastBegin(self, unit: Datatype, ndarray rootdata, ndarray leafdata, op: Op) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_csf); __pyx_r = ((PyObject *)__pyx_v_csf); goto __pyx_L0; /* "petsc4py/PETSc/SF.pyx":415 * return (remoteOffsets, leafSection) * * def compose(self, SF sf) -> SF: # <<<<<<<<<<<<<< * """Compose a new `SF`. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.SF.compose", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_csf); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SF.pyx":436 * return csf * * def bcastBegin(self, unit: Datatype, ndarray rootdata, ndarray leafdata, op: Op) -> None: # <<<<<<<<<<<<<< * """Begin pointwise broadcast. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_43bcastBegin(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2SF_42bcastBegin, "SF.bcastBegin(self, unit: Datatype, rootdata: ndarray, leafdata: ndarray, op: Op) -> None\nBegin pointwise broadcast.\n\n Collective.\n\n Root values are reduced to leaf values. This call has to be concluded\n with a call to `bcastEnd`.\n\n Parameters\n ----------\n unit\n MPI datatype.\n rootdata\n Buffer to broadcast.\n leafdata\n Buffer to be reduced with values from each leaf's respective root.\n op\n MPI reduction operation.\n\n See Also\n --------\n bcastEnd, petsc.PetscSFBcastBegin\n\n \nSource code at petsc4py/PETSc/SF.pyx:436"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_43bcastBegin(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_unit = 0; PyArrayObject *__pyx_v_rootdata = 0; PyArrayObject *__pyx_v_leafdata = 0; PyObject *__pyx_v_op = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("bcastBegin (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_unit,&__pyx_n_s_rootdata,&__pyx_n_s_leafdata,&__pyx_n_s_op,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_unit)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(40, 436, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rootdata)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(40, 436, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("bcastBegin", 1, 4, 4, 1); __PYX_ERR(40, 436, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_leafdata)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(40, 436, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("bcastBegin", 1, 4, 4, 2); __PYX_ERR(40, 436, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(40, 436, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("bcastBegin", 1, 4, 4, 3); __PYX_ERR(40, 436, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "bcastBegin") < 0)) __PYX_ERR(40, 436, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 4)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); } __pyx_v_unit = values[0]; __pyx_v_rootdata = ((PyArrayObject *)values[1]); __pyx_v_leafdata = ((PyArrayObject *)values[2]); __pyx_v_op = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("bcastBegin", 1, 4, 4, __pyx_nargs); __PYX_ERR(40, 436, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SF.bcastBegin", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rootdata), __pyx_ptype_8petsc4py_5PETSc_ndarray, 0, "rootdata", 0))) __PYX_ERR(40, 436, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_leafdata), __pyx_ptype_8petsc4py_5PETSc_ndarray, 0, "leafdata", 0))) __PYX_ERR(40, 436, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_42bcastBegin(((struct PyPetscSFObject *)__pyx_v_self), __pyx_v_unit, __pyx_v_rootdata, __pyx_v_leafdata, __pyx_v_op); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_42bcastBegin(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_unit, PyArrayObject *__pyx_v_rootdata, PyArrayObject *__pyx_v_leafdata, PyObject *__pyx_v_op) { MPI_Datatype __pyx_v_dtype; MPI_Op __pyx_v_cop; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Datatype __pyx_t_1; MPI_Op __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("bcastBegin", 1); /* "petsc4py/PETSc/SF.pyx":460 * * """ * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) # <<<<<<<<<<<<<< * cdef MPI_Op cop = mpi4py_Op_Get(op) * CHKERR( PetscSFBcastBegin(self.sf, dtype, PyArray_DATA(rootdata), */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_mpi4py_Datatype_Get(__pyx_v_unit); if (unlikely(__pyx_t_1 == ((MPI_Datatype)MPI_DATATYPE_NULL) && PyErr_Occurred())) __PYX_ERR(40, 460, __pyx_L1_error) __pyx_v_dtype = __pyx_t_1; /* "petsc4py/PETSc/SF.pyx":461 * """ * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) * cdef MPI_Op cop = mpi4py_Op_Get(op) # <<<<<<<<<<<<<< * CHKERR( PetscSFBcastBegin(self.sf, dtype, PyArray_DATA(rootdata), * PyArray_DATA(leafdata), cop) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_mpi4py_Op_Get(__pyx_v_op); if (unlikely(__pyx_t_2 == ((MPI_Op)MPI_OP_NULL) && PyErr_Occurred())) __PYX_ERR(40, 461, __pyx_L1_error) __pyx_v_cop = __pyx_t_2; /* "petsc4py/PETSc/SF.pyx":462 * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) * cdef MPI_Op cop = mpi4py_Op_Get(op) * CHKERR( PetscSFBcastBegin(self.sf, dtype, PyArray_DATA(rootdata), # <<<<<<<<<<<<<< * PyArray_DATA(leafdata), cop) ) * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFBcastBegin(__pyx_v_self->sf, __pyx_v_dtype, ((void const *)PyArray_DATA(__pyx_v_rootdata)), ((void *)PyArray_DATA(__pyx_v_leafdata)), __pyx_v_cop)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 462, __pyx_L1_error) /* "petsc4py/PETSc/SF.pyx":436 * return csf * * def bcastBegin(self, unit: Datatype, ndarray rootdata, ndarray leafdata, op: Op) -> None: # <<<<<<<<<<<<<< * """Begin pointwise broadcast. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SF.bcastBegin", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SF.pyx":465 * PyArray_DATA(leafdata), cop) ) * * def bcastEnd(self, unit: Datatype, ndarray rootdata, ndarray leafdata, op: Op) -> None: # <<<<<<<<<<<<<< * """End a broadcast & reduce operation started with `bcastBegin`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_45bcastEnd(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2SF_44bcastEnd, "SF.bcastEnd(self, unit: Datatype, rootdata: ndarray, leafdata: ndarray, op: Op) -> None\nEnd a broadcast & reduce operation started with `bcastBegin`.\n\n Collective.\n\n Parameters\n ----------\n unit\n MPI datatype.\n rootdata\n Buffer to broadcast.\n leafdata\n Buffer to be reduced with values from each leaf's respective root.\n op\n MPI reduction operation.\n\n See Also\n --------\n bcastBegin, petsc.PetscSFBcastEnd\n\n \nSource code at petsc4py/PETSc/SF.pyx:465"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_45bcastEnd(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_unit = 0; PyArrayObject *__pyx_v_rootdata = 0; PyArrayObject *__pyx_v_leafdata = 0; PyObject *__pyx_v_op = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("bcastEnd (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_unit,&__pyx_n_s_rootdata,&__pyx_n_s_leafdata,&__pyx_n_s_op,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_unit)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(40, 465, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rootdata)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(40, 465, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("bcastEnd", 1, 4, 4, 1); __PYX_ERR(40, 465, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_leafdata)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(40, 465, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("bcastEnd", 1, 4, 4, 2); __PYX_ERR(40, 465, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(40, 465, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("bcastEnd", 1, 4, 4, 3); __PYX_ERR(40, 465, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "bcastEnd") < 0)) __PYX_ERR(40, 465, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 4)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); } __pyx_v_unit = values[0]; __pyx_v_rootdata = ((PyArrayObject *)values[1]); __pyx_v_leafdata = ((PyArrayObject *)values[2]); __pyx_v_op = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("bcastEnd", 1, 4, 4, __pyx_nargs); __PYX_ERR(40, 465, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SF.bcastEnd", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rootdata), __pyx_ptype_8petsc4py_5PETSc_ndarray, 0, "rootdata", 0))) __PYX_ERR(40, 465, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_leafdata), __pyx_ptype_8petsc4py_5PETSc_ndarray, 0, "leafdata", 0))) __PYX_ERR(40, 465, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_44bcastEnd(((struct PyPetscSFObject *)__pyx_v_self), __pyx_v_unit, __pyx_v_rootdata, __pyx_v_leafdata, __pyx_v_op); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_44bcastEnd(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_unit, PyArrayObject *__pyx_v_rootdata, PyArrayObject *__pyx_v_leafdata, PyObject *__pyx_v_op) { MPI_Datatype __pyx_v_dtype; MPI_Op __pyx_v_cop; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Datatype __pyx_t_1; MPI_Op __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("bcastEnd", 1); /* "petsc4py/PETSc/SF.pyx":486 * * """ * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) # <<<<<<<<<<<<<< * cdef MPI_Op cop = mpi4py_Op_Get(op) * CHKERR( PetscSFBcastEnd(self.sf, dtype, PyArray_DATA(rootdata), */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_mpi4py_Datatype_Get(__pyx_v_unit); if (unlikely(__pyx_t_1 == ((MPI_Datatype)MPI_DATATYPE_NULL) && PyErr_Occurred())) __PYX_ERR(40, 486, __pyx_L1_error) __pyx_v_dtype = __pyx_t_1; /* "petsc4py/PETSc/SF.pyx":487 * """ * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) * cdef MPI_Op cop = mpi4py_Op_Get(op) # <<<<<<<<<<<<<< * CHKERR( PetscSFBcastEnd(self.sf, dtype, PyArray_DATA(rootdata), * PyArray_DATA(leafdata), cop) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_mpi4py_Op_Get(__pyx_v_op); if (unlikely(__pyx_t_2 == ((MPI_Op)MPI_OP_NULL) && PyErr_Occurred())) __PYX_ERR(40, 487, __pyx_L1_error) __pyx_v_cop = __pyx_t_2; /* "petsc4py/PETSc/SF.pyx":488 * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) * cdef MPI_Op cop = mpi4py_Op_Get(op) * CHKERR( PetscSFBcastEnd(self.sf, dtype, PyArray_DATA(rootdata), # <<<<<<<<<<<<<< * PyArray_DATA(leafdata), cop) ) * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFBcastEnd(__pyx_v_self->sf, __pyx_v_dtype, ((void const *)PyArray_DATA(__pyx_v_rootdata)), ((void *)PyArray_DATA(__pyx_v_leafdata)), __pyx_v_cop)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 488, __pyx_L1_error) /* "petsc4py/PETSc/SF.pyx":465 * PyArray_DATA(leafdata), cop) ) * * def bcastEnd(self, unit: Datatype, ndarray rootdata, ndarray leafdata, op: Op) -> None: # <<<<<<<<<<<<<< * """End a broadcast & reduce operation started with `bcastBegin`. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SF.bcastEnd", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SF.pyx":491 * PyArray_DATA(leafdata), cop) ) * * def reduceBegin(self, unit: Datatype, ndarray leafdata, ndarray rootdata, op: Op) -> None: # <<<<<<<<<<<<<< * """Begin reduction of leafdata into rootdata. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_47reduceBegin(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2SF_46reduceBegin, "SF.reduceBegin(self, unit: Datatype, leafdata: ndarray, rootdata: ndarray, op: Op) -> None\nBegin reduction of leafdata into rootdata.\n\n Collective.\n\n This call has to be completed with call to `reduceEnd`.\n\n Parameters\n ----------\n unit\n MPI datatype.\n leafdata\n Values to reduce.\n rootdata\n Result of reduction of values from all leaves of each root.\n op\n MPI reduction operation.\n\n See Also\n --------\n reduceEnd, petsc.PetscSFReduceBegin\n\n \nSource code at petsc4py/PETSc/SF.pyx:491"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_47reduceBegin(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_unit = 0; PyArrayObject *__pyx_v_leafdata = 0; PyArrayObject *__pyx_v_rootdata = 0; PyObject *__pyx_v_op = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("reduceBegin (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_unit,&__pyx_n_s_leafdata,&__pyx_n_s_rootdata,&__pyx_n_s_op,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_unit)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(40, 491, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_leafdata)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(40, 491, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("reduceBegin", 1, 4, 4, 1); __PYX_ERR(40, 491, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rootdata)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(40, 491, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("reduceBegin", 1, 4, 4, 2); __PYX_ERR(40, 491, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(40, 491, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("reduceBegin", 1, 4, 4, 3); __PYX_ERR(40, 491, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "reduceBegin") < 0)) __PYX_ERR(40, 491, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 4)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); } __pyx_v_unit = values[0]; __pyx_v_leafdata = ((PyArrayObject *)values[1]); __pyx_v_rootdata = ((PyArrayObject *)values[2]); __pyx_v_op = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("reduceBegin", 1, 4, 4, __pyx_nargs); __PYX_ERR(40, 491, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SF.reduceBegin", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_leafdata), __pyx_ptype_8petsc4py_5PETSc_ndarray, 0, "leafdata", 0))) __PYX_ERR(40, 491, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rootdata), __pyx_ptype_8petsc4py_5PETSc_ndarray, 0, "rootdata", 0))) __PYX_ERR(40, 491, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_46reduceBegin(((struct PyPetscSFObject *)__pyx_v_self), __pyx_v_unit, __pyx_v_leafdata, __pyx_v_rootdata, __pyx_v_op); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_46reduceBegin(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_unit, PyArrayObject *__pyx_v_leafdata, PyArrayObject *__pyx_v_rootdata, PyObject *__pyx_v_op) { MPI_Datatype __pyx_v_dtype; MPI_Op __pyx_v_cop; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Datatype __pyx_t_1; MPI_Op __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("reduceBegin", 1); /* "petsc4py/PETSc/SF.pyx":514 * * """ * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) # <<<<<<<<<<<<<< * cdef MPI_Op cop = mpi4py_Op_Get(op) * CHKERR( PetscSFReduceBegin(self.sf, dtype, PyArray_DATA(leafdata), */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_mpi4py_Datatype_Get(__pyx_v_unit); if (unlikely(__pyx_t_1 == ((MPI_Datatype)MPI_DATATYPE_NULL) && PyErr_Occurred())) __PYX_ERR(40, 514, __pyx_L1_error) __pyx_v_dtype = __pyx_t_1; /* "petsc4py/PETSc/SF.pyx":515 * """ * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) * cdef MPI_Op cop = mpi4py_Op_Get(op) # <<<<<<<<<<<<<< * CHKERR( PetscSFReduceBegin(self.sf, dtype, PyArray_DATA(leafdata), * PyArray_DATA(rootdata), cop) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_mpi4py_Op_Get(__pyx_v_op); if (unlikely(__pyx_t_2 == ((MPI_Op)MPI_OP_NULL) && PyErr_Occurred())) __PYX_ERR(40, 515, __pyx_L1_error) __pyx_v_cop = __pyx_t_2; /* "petsc4py/PETSc/SF.pyx":516 * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) * cdef MPI_Op cop = mpi4py_Op_Get(op) * CHKERR( PetscSFReduceBegin(self.sf, dtype, PyArray_DATA(leafdata), # <<<<<<<<<<<<<< * PyArray_DATA(rootdata), cop) ) * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFReduceBegin(__pyx_v_self->sf, __pyx_v_dtype, ((void const *)PyArray_DATA(__pyx_v_leafdata)), ((void *)PyArray_DATA(__pyx_v_rootdata)), __pyx_v_cop)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 516, __pyx_L1_error) /* "petsc4py/PETSc/SF.pyx":491 * PyArray_DATA(leafdata), cop) ) * * def reduceBegin(self, unit: Datatype, ndarray leafdata, ndarray rootdata, op: Op) -> None: # <<<<<<<<<<<<<< * """Begin reduction of leafdata into rootdata. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SF.reduceBegin", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SF.pyx":519 * PyArray_DATA(rootdata), cop) ) * * def reduceEnd(self, unit: Datatype, ndarray leafdata, ndarray rootdata, op: Op) -> None: # <<<<<<<<<<<<<< * """End a reduction operation started with `reduceBegin`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_49reduceEnd(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2SF_48reduceEnd, "SF.reduceEnd(self, unit: Datatype, leafdata: ndarray, rootdata: ndarray, op: Op) -> None\nEnd a reduction operation started with `reduceBegin`.\n\n Collective.\n\n Parameters\n ----------\n unit\n MPI datatype.\n leafdata\n Values to reduce.\n rootdata\n Result of reduction of values from all leaves of each root.\n op\n MPI reduction operation.\n\n See Also\n --------\n reduceBegin, petsc.PetscSFReduceEnd\n\n \nSource code at petsc4py/PETSc/SF.pyx:519"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_49reduceEnd(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_unit = 0; PyArrayObject *__pyx_v_leafdata = 0; PyArrayObject *__pyx_v_rootdata = 0; PyObject *__pyx_v_op = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("reduceEnd (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_unit,&__pyx_n_s_leafdata,&__pyx_n_s_rootdata,&__pyx_n_s_op,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_unit)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(40, 519, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_leafdata)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(40, 519, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("reduceEnd", 1, 4, 4, 1); __PYX_ERR(40, 519, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rootdata)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(40, 519, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("reduceEnd", 1, 4, 4, 2); __PYX_ERR(40, 519, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(40, 519, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("reduceEnd", 1, 4, 4, 3); __PYX_ERR(40, 519, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "reduceEnd") < 0)) __PYX_ERR(40, 519, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 4)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); } __pyx_v_unit = values[0]; __pyx_v_leafdata = ((PyArrayObject *)values[1]); __pyx_v_rootdata = ((PyArrayObject *)values[2]); __pyx_v_op = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("reduceEnd", 1, 4, 4, __pyx_nargs); __PYX_ERR(40, 519, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SF.reduceEnd", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_leafdata), __pyx_ptype_8petsc4py_5PETSc_ndarray, 0, "leafdata", 0))) __PYX_ERR(40, 519, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rootdata), __pyx_ptype_8petsc4py_5PETSc_ndarray, 0, "rootdata", 0))) __PYX_ERR(40, 519, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_48reduceEnd(((struct PyPetscSFObject *)__pyx_v_self), __pyx_v_unit, __pyx_v_leafdata, __pyx_v_rootdata, __pyx_v_op); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_48reduceEnd(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_unit, PyArrayObject *__pyx_v_leafdata, PyArrayObject *__pyx_v_rootdata, PyObject *__pyx_v_op) { MPI_Datatype __pyx_v_dtype; MPI_Op __pyx_v_cop; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Datatype __pyx_t_1; MPI_Op __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("reduceEnd", 1); /* "petsc4py/PETSc/SF.pyx":540 * * """ * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) # <<<<<<<<<<<<<< * cdef MPI_Op cop = mpi4py_Op_Get(op) * CHKERR( PetscSFReduceEnd(self.sf, dtype, PyArray_DATA(leafdata), */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_mpi4py_Datatype_Get(__pyx_v_unit); if (unlikely(__pyx_t_1 == ((MPI_Datatype)MPI_DATATYPE_NULL) && PyErr_Occurred())) __PYX_ERR(40, 540, __pyx_L1_error) __pyx_v_dtype = __pyx_t_1; /* "petsc4py/PETSc/SF.pyx":541 * """ * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) * cdef MPI_Op cop = mpi4py_Op_Get(op) # <<<<<<<<<<<<<< * CHKERR( PetscSFReduceEnd(self.sf, dtype, PyArray_DATA(leafdata), * PyArray_DATA(rootdata), cop) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_mpi4py_Op_Get(__pyx_v_op); if (unlikely(__pyx_t_2 == ((MPI_Op)MPI_OP_NULL) && PyErr_Occurred())) __PYX_ERR(40, 541, __pyx_L1_error) __pyx_v_cop = __pyx_t_2; /* "petsc4py/PETSc/SF.pyx":542 * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) * cdef MPI_Op cop = mpi4py_Op_Get(op) * CHKERR( PetscSFReduceEnd(self.sf, dtype, PyArray_DATA(leafdata), # <<<<<<<<<<<<<< * PyArray_DATA(rootdata), cop) ) * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFReduceEnd(__pyx_v_self->sf, __pyx_v_dtype, ((void const *)PyArray_DATA(__pyx_v_leafdata)), ((void *)PyArray_DATA(__pyx_v_rootdata)), __pyx_v_cop)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 542, __pyx_L1_error) /* "petsc4py/PETSc/SF.pyx":519 * PyArray_DATA(rootdata), cop) ) * * def reduceEnd(self, unit: Datatype, ndarray leafdata, ndarray rootdata, op: Op) -> None: # <<<<<<<<<<<<<< * """End a reduction operation started with `reduceBegin`. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SF.reduceEnd", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SF.pyx":545 * PyArray_DATA(rootdata), cop) ) * * def scatterBegin(self, unit: Datatype, ndarray multirootdata, ndarray leafdata) -> None: # <<<<<<<<<<<<<< * """Begin pointwise scatter operation. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_51scatterBegin(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2SF_50scatterBegin, "SF.scatterBegin(self, unit: Datatype, multirootdata: ndarray, leafdata: ndarray) -> None\nBegin pointwise scatter operation.\n\n Collective.\n\n Operation is from multi-roots to leaves.\n This call has to be completed with `scatterEnd`.\n\n Parameters\n ----------\n unit\n MPI datatype.\n multirootdata\n Root buffer to send to each leaf, one unit of data per leaf.\n leafdata\n Leaf data to be updated with personal data from each respective root.\n\n See Also\n --------\n scatterEnd, petsc.PetscSFScatterBegin\n\n \nSource code at petsc4py/PETSc/SF.pyx:545"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_51scatterBegin(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_unit = 0; PyArrayObject *__pyx_v_multirootdata = 0; PyArrayObject *__pyx_v_leafdata = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("scatterBegin (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_unit,&__pyx_n_s_multirootdata,&__pyx_n_s_leafdata,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_unit)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(40, 545, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_multirootdata)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(40, 545, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("scatterBegin", 1, 3, 3, 1); __PYX_ERR(40, 545, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_leafdata)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(40, 545, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("scatterBegin", 1, 3, 3, 2); __PYX_ERR(40, 545, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "scatterBegin") < 0)) __PYX_ERR(40, 545, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_unit = values[0]; __pyx_v_multirootdata = ((PyArrayObject *)values[1]); __pyx_v_leafdata = ((PyArrayObject *)values[2]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("scatterBegin", 1, 3, 3, __pyx_nargs); __PYX_ERR(40, 545, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SF.scatterBegin", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_multirootdata), __pyx_ptype_8petsc4py_5PETSc_ndarray, 0, "multirootdata", 0))) __PYX_ERR(40, 545, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_leafdata), __pyx_ptype_8petsc4py_5PETSc_ndarray, 0, "leafdata", 0))) __PYX_ERR(40, 545, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_50scatterBegin(((struct PyPetscSFObject *)__pyx_v_self), __pyx_v_unit, __pyx_v_multirootdata, __pyx_v_leafdata); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_50scatterBegin(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_unit, PyArrayObject *__pyx_v_multirootdata, PyArrayObject *__pyx_v_leafdata) { MPI_Datatype __pyx_v_dtype; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Datatype __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("scatterBegin", 1); /* "petsc4py/PETSc/SF.pyx":567 * * """ * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) # <<<<<<<<<<<<<< * CHKERR( PetscSFScatterBegin(self.sf, dtype, PyArray_DATA(multirootdata), * PyArray_DATA(leafdata)) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_mpi4py_Datatype_Get(__pyx_v_unit); if (unlikely(__pyx_t_1 == ((MPI_Datatype)MPI_DATATYPE_NULL) && PyErr_Occurred())) __PYX_ERR(40, 567, __pyx_L1_error) __pyx_v_dtype = __pyx_t_1; /* "petsc4py/PETSc/SF.pyx":568 * """ * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) * CHKERR( PetscSFScatterBegin(self.sf, dtype, PyArray_DATA(multirootdata), # <<<<<<<<<<<<<< * PyArray_DATA(leafdata)) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFScatterBegin(__pyx_v_self->sf, __pyx_v_dtype, ((void const *)PyArray_DATA(__pyx_v_multirootdata)), ((void *)PyArray_DATA(__pyx_v_leafdata)))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 568, __pyx_L1_error) /* "petsc4py/PETSc/SF.pyx":545 * PyArray_DATA(rootdata), cop) ) * * def scatterBegin(self, unit: Datatype, ndarray multirootdata, ndarray leafdata) -> None: # <<<<<<<<<<<<<< * """Begin pointwise scatter operation. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SF.scatterBegin", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SF.pyx":571 * PyArray_DATA(leafdata)) ) * * def scatterEnd(self, unit: Datatype, ndarray multirootdata, ndarray leafdata) -> None: # <<<<<<<<<<<<<< * """End scatter operation that was started with `scatterBegin`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_53scatterEnd(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2SF_52scatterEnd, "SF.scatterEnd(self, unit: Datatype, multirootdata: ndarray, leafdata: ndarray) -> None\nEnd scatter operation that was started with `scatterBegin`.\n\n Collective.\n\n Parameters\n ----------\n unit\n MPI datatype.\n multirootdata\n Root buffer to send to each leaf, one unit of data per leaf.\n leafdata\n Leaf data to be updated with personal data from each respective root.\n\n See Also\n --------\n scatterBegin, petsc.PetscSFScatterEnd\n\n \nSource code at petsc4py/PETSc/SF.pyx:571"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_53scatterEnd(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_unit = 0; PyArrayObject *__pyx_v_multirootdata = 0; PyArrayObject *__pyx_v_leafdata = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("scatterEnd (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_unit,&__pyx_n_s_multirootdata,&__pyx_n_s_leafdata,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_unit)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(40, 571, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_multirootdata)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(40, 571, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("scatterEnd", 1, 3, 3, 1); __PYX_ERR(40, 571, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_leafdata)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(40, 571, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("scatterEnd", 1, 3, 3, 2); __PYX_ERR(40, 571, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "scatterEnd") < 0)) __PYX_ERR(40, 571, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_unit = values[0]; __pyx_v_multirootdata = ((PyArrayObject *)values[1]); __pyx_v_leafdata = ((PyArrayObject *)values[2]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("scatterEnd", 1, 3, 3, __pyx_nargs); __PYX_ERR(40, 571, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SF.scatterEnd", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_multirootdata), __pyx_ptype_8petsc4py_5PETSc_ndarray, 0, "multirootdata", 0))) __PYX_ERR(40, 571, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_leafdata), __pyx_ptype_8petsc4py_5PETSc_ndarray, 0, "leafdata", 0))) __PYX_ERR(40, 571, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_52scatterEnd(((struct PyPetscSFObject *)__pyx_v_self), __pyx_v_unit, __pyx_v_multirootdata, __pyx_v_leafdata); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_52scatterEnd(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_unit, PyArrayObject *__pyx_v_multirootdata, PyArrayObject *__pyx_v_leafdata) { MPI_Datatype __pyx_v_dtype; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Datatype __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("scatterEnd", 1); /* "petsc4py/PETSc/SF.pyx":590 * * """ * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) # <<<<<<<<<<<<<< * CHKERR( PetscSFScatterEnd(self.sf, dtype, PyArray_DATA(multirootdata), * PyArray_DATA(leafdata)) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_mpi4py_Datatype_Get(__pyx_v_unit); if (unlikely(__pyx_t_1 == ((MPI_Datatype)MPI_DATATYPE_NULL) && PyErr_Occurred())) __PYX_ERR(40, 590, __pyx_L1_error) __pyx_v_dtype = __pyx_t_1; /* "petsc4py/PETSc/SF.pyx":591 * """ * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) * CHKERR( PetscSFScatterEnd(self.sf, dtype, PyArray_DATA(multirootdata), # <<<<<<<<<<<<<< * PyArray_DATA(leafdata)) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFScatterEnd(__pyx_v_self->sf, __pyx_v_dtype, ((void const *)PyArray_DATA(__pyx_v_multirootdata)), ((void *)PyArray_DATA(__pyx_v_leafdata)))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 591, __pyx_L1_error) /* "petsc4py/PETSc/SF.pyx":571 * PyArray_DATA(leafdata)) ) * * def scatterEnd(self, unit: Datatype, ndarray multirootdata, ndarray leafdata) -> None: # <<<<<<<<<<<<<< * """End scatter operation that was started with `scatterBegin`. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SF.scatterEnd", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SF.pyx":594 * PyArray_DATA(leafdata)) ) * * def gatherBegin(self, unit: Datatype, ndarray leafdata, ndarray multirootdata) -> None: # <<<<<<<<<<<<<< * """Begin pointwise gather of all leaves into multi-roots. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_55gatherBegin(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2SF_54gatherBegin, "SF.gatherBegin(self, unit: Datatype, leafdata: ndarray, multirootdata: ndarray) -> None\nBegin pointwise gather of all leaves into multi-roots.\n\n Collective.\n\n This call has to be completed with `gatherEnd`.\n\n Parameters\n ----------\n unit\n MPI datatype.\n leafdata\n Leaf data to gather to roots.\n multirootdata\n Root buffer to gather into, amount of space per root is\n equal to its degree.\n\n See Also\n --------\n gatherEnd, petsc.PetscSFGatherBegin\n\n \nSource code at petsc4py/PETSc/SF.pyx:594"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_55gatherBegin(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_unit = 0; PyArrayObject *__pyx_v_leafdata = 0; PyArrayObject *__pyx_v_multirootdata = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("gatherBegin (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_unit,&__pyx_n_s_leafdata,&__pyx_n_s_multirootdata,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_unit)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(40, 594, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_leafdata)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(40, 594, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("gatherBegin", 1, 3, 3, 1); __PYX_ERR(40, 594, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_multirootdata)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(40, 594, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("gatherBegin", 1, 3, 3, 2); __PYX_ERR(40, 594, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "gatherBegin") < 0)) __PYX_ERR(40, 594, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_unit = values[0]; __pyx_v_leafdata = ((PyArrayObject *)values[1]); __pyx_v_multirootdata = ((PyArrayObject *)values[2]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("gatherBegin", 1, 3, 3, __pyx_nargs); __PYX_ERR(40, 594, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SF.gatherBegin", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_leafdata), __pyx_ptype_8petsc4py_5PETSc_ndarray, 0, "leafdata", 0))) __PYX_ERR(40, 594, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_multirootdata), __pyx_ptype_8petsc4py_5PETSc_ndarray, 0, "multirootdata", 0))) __PYX_ERR(40, 594, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_54gatherBegin(((struct PyPetscSFObject *)__pyx_v_self), __pyx_v_unit, __pyx_v_leafdata, __pyx_v_multirootdata); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_54gatherBegin(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_unit, PyArrayObject *__pyx_v_leafdata, PyArrayObject *__pyx_v_multirootdata) { MPI_Datatype __pyx_v_dtype; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Datatype __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("gatherBegin", 1); /* "petsc4py/PETSc/SF.pyx":616 * * """ * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) # <<<<<<<<<<<<<< * CHKERR( PetscSFGatherBegin(self.sf, dtype, PyArray_DATA(leafdata), * PyArray_DATA(multirootdata)) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_mpi4py_Datatype_Get(__pyx_v_unit); if (unlikely(__pyx_t_1 == ((MPI_Datatype)MPI_DATATYPE_NULL) && PyErr_Occurred())) __PYX_ERR(40, 616, __pyx_L1_error) __pyx_v_dtype = __pyx_t_1; /* "petsc4py/PETSc/SF.pyx":617 * """ * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) * CHKERR( PetscSFGatherBegin(self.sf, dtype, PyArray_DATA(leafdata), # <<<<<<<<<<<<<< * PyArray_DATA(multirootdata)) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFGatherBegin(__pyx_v_self->sf, __pyx_v_dtype, ((void const *)PyArray_DATA(__pyx_v_leafdata)), ((void *)PyArray_DATA(__pyx_v_multirootdata)))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 617, __pyx_L1_error) /* "petsc4py/PETSc/SF.pyx":594 * PyArray_DATA(leafdata)) ) * * def gatherBegin(self, unit: Datatype, ndarray leafdata, ndarray multirootdata) -> None: # <<<<<<<<<<<<<< * """Begin pointwise gather of all leaves into multi-roots. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SF.gatherBegin", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SF.pyx":620 * PyArray_DATA(multirootdata)) ) * * def gatherEnd(self, unit: Datatype, ndarray leafdata, ndarray multirootdata) -> None: # <<<<<<<<<<<<<< * """End gather operation that was started with `gatherBegin`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_57gatherEnd(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2SF_56gatherEnd, "SF.gatherEnd(self, unit: Datatype, leafdata: ndarray, multirootdata: ndarray) -> None\nEnd gather operation that was started with `gatherBegin`.\n\n Collective.\n\n Parameters\n ----------\n unit\n MPI datatype.\n leafdata\n Leaf data to gather to roots.\n multirootdata\n Root buffer to gather into, amount of space per root is\n equal to its degree.\n\n See Also\n --------\n gatherBegin, petsc.PetscSFGatherEnd\n\n \nSource code at petsc4py/PETSc/SF.pyx:620"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_57gatherEnd(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_unit = 0; PyArrayObject *__pyx_v_leafdata = 0; PyArrayObject *__pyx_v_multirootdata = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("gatherEnd (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_unit,&__pyx_n_s_leafdata,&__pyx_n_s_multirootdata,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_unit)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(40, 620, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_leafdata)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(40, 620, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("gatherEnd", 1, 3, 3, 1); __PYX_ERR(40, 620, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_multirootdata)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(40, 620, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("gatherEnd", 1, 3, 3, 2); __PYX_ERR(40, 620, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "gatherEnd") < 0)) __PYX_ERR(40, 620, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_unit = values[0]; __pyx_v_leafdata = ((PyArrayObject *)values[1]); __pyx_v_multirootdata = ((PyArrayObject *)values[2]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("gatherEnd", 1, 3, 3, __pyx_nargs); __PYX_ERR(40, 620, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SF.gatherEnd", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_leafdata), __pyx_ptype_8petsc4py_5PETSc_ndarray, 0, "leafdata", 0))) __PYX_ERR(40, 620, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_multirootdata), __pyx_ptype_8petsc4py_5PETSc_ndarray, 0, "multirootdata", 0))) __PYX_ERR(40, 620, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_56gatherEnd(((struct PyPetscSFObject *)__pyx_v_self), __pyx_v_unit, __pyx_v_leafdata, __pyx_v_multirootdata); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_56gatherEnd(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_unit, PyArrayObject *__pyx_v_leafdata, PyArrayObject *__pyx_v_multirootdata) { MPI_Datatype __pyx_v_dtype; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Datatype __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("gatherEnd", 1); /* "petsc4py/PETSc/SF.pyx":640 * * """ * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) # <<<<<<<<<<<<<< * CHKERR( PetscSFGatherEnd(self.sf, dtype, PyArray_DATA(leafdata), * PyArray_DATA(multirootdata)) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_mpi4py_Datatype_Get(__pyx_v_unit); if (unlikely(__pyx_t_1 == ((MPI_Datatype)MPI_DATATYPE_NULL) && PyErr_Occurred())) __PYX_ERR(40, 640, __pyx_L1_error) __pyx_v_dtype = __pyx_t_1; /* "petsc4py/PETSc/SF.pyx":641 * """ * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) * CHKERR( PetscSFGatherEnd(self.sf, dtype, PyArray_DATA(leafdata), # <<<<<<<<<<<<<< * PyArray_DATA(multirootdata)) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFGatherEnd(__pyx_v_self->sf, __pyx_v_dtype, ((void const *)PyArray_DATA(__pyx_v_leafdata)), ((void *)PyArray_DATA(__pyx_v_multirootdata)))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 641, __pyx_L1_error) /* "petsc4py/PETSc/SF.pyx":620 * PyArray_DATA(multirootdata)) ) * * def gatherEnd(self, unit: Datatype, ndarray leafdata, ndarray multirootdata) -> None: # <<<<<<<<<<<<<< * """End gather operation that was started with `gatherBegin`. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SF.gatherEnd", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SF.pyx":644 * PyArray_DATA(multirootdata)) ) * * def fetchAndOpBegin(self, unit: Datatype, rootdata: ndarray, leafdata: ndarray, leafupdate: ndarray, op: Op) -> None: # <<<<<<<<<<<<<< * """Begin fetch and update operation. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_59fetchAndOpBegin(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2SF_58fetchAndOpBegin, "SF.fetchAndOpBegin(self, unit: Datatype, rootdata: ndarray, leafdata: ndarray, leafupdate: ndarray, op: Op) -> None\nBegin fetch and update operation.\n\n Collective.\n\n This operation fetches values from root and updates atomically\n by applying an operation using the leaf value.\n\n This call has to be completed with `fetchAndOpEnd`.\n\n Parameters\n ----------\n unit\n MPI datatype.\n rootdata\n Root values to be updated, input state is seen by first process\n to perform an update.\n leafdata\n Leaf values to use in reduction.\n leafupdate\n State at each leaf's respective root immediately prior to my atomic\n update.\n op\n MPI reduction operation.\n\n See Also\n --------\n fetchAndOpEnd, petsc.PetscSFFetchAndOpBegin\n\n \nSource code at petsc4py/PETSc/SF.pyx:644"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_59fetchAndOpBegin(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_unit = 0; PyObject *__pyx_v_rootdata = 0; PyObject *__pyx_v_leafdata = 0; PyObject *__pyx_v_leafupdate = 0; PyObject *__pyx_v_op = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("fetchAndOpBegin (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_unit,&__pyx_n_s_rootdata,&__pyx_n_s_leafdata,&__pyx_n_s_leafupdate,&__pyx_n_s_op,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_unit)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(40, 644, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rootdata)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(40, 644, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("fetchAndOpBegin", 1, 5, 5, 1); __PYX_ERR(40, 644, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_leafdata)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(40, 644, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("fetchAndOpBegin", 1, 5, 5, 2); __PYX_ERR(40, 644, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_leafupdate)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(40, 644, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("fetchAndOpBegin", 1, 5, 5, 3); __PYX_ERR(40, 644, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(40, 644, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("fetchAndOpBegin", 1, 5, 5, 4); __PYX_ERR(40, 644, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "fetchAndOpBegin") < 0)) __PYX_ERR(40, 644, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 5)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); } __pyx_v_unit = values[0]; __pyx_v_rootdata = values[1]; __pyx_v_leafdata = values[2]; __pyx_v_leafupdate = values[3]; __pyx_v_op = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("fetchAndOpBegin", 1, 5, 5, __pyx_nargs); __PYX_ERR(40, 644, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SF.fetchAndOpBegin", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_58fetchAndOpBegin(((struct PyPetscSFObject *)__pyx_v_self), __pyx_v_unit, __pyx_v_rootdata, __pyx_v_leafdata, __pyx_v_leafupdate, __pyx_v_op); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_58fetchAndOpBegin(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_unit, PyObject *__pyx_v_rootdata, PyObject *__pyx_v_leafdata, PyObject *__pyx_v_leafupdate, PyObject *__pyx_v_op) { MPI_Datatype __pyx_v_dtype; MPI_Op __pyx_v_cop; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Datatype __pyx_t_1; MPI_Op __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("fetchAndOpBegin", 1); /* "petsc4py/PETSc/SF.pyx":674 * * """ * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) # <<<<<<<<<<<<<< * cdef MPI_Op cop = mpi4py_Op_Get(op) * CHKERR( PetscSFFetchAndOpBegin(self.sf, dtype, PyArray_DATA(rootdata), */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_mpi4py_Datatype_Get(__pyx_v_unit); if (unlikely(__pyx_t_1 == ((MPI_Datatype)MPI_DATATYPE_NULL) && PyErr_Occurred())) __PYX_ERR(40, 674, __pyx_L1_error) __pyx_v_dtype = __pyx_t_1; /* "petsc4py/PETSc/SF.pyx":675 * """ * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) * cdef MPI_Op cop = mpi4py_Op_Get(op) # <<<<<<<<<<<<<< * CHKERR( PetscSFFetchAndOpBegin(self.sf, dtype, PyArray_DATA(rootdata), * PyArray_DATA(leafdata), */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_mpi4py_Op_Get(__pyx_v_op); if (unlikely(__pyx_t_2 == ((MPI_Op)MPI_OP_NULL) && PyErr_Occurred())) __PYX_ERR(40, 675, __pyx_L1_error) __pyx_v_cop = __pyx_t_2; /* "petsc4py/PETSc/SF.pyx":676 * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) * cdef MPI_Op cop = mpi4py_Op_Get(op) * CHKERR( PetscSFFetchAndOpBegin(self.sf, dtype, PyArray_DATA(rootdata), # <<<<<<<<<<<<<< * PyArray_DATA(leafdata), * PyArray_DATA(leafupdate), cop) ) */ if (!(likely(((__pyx_v_rootdata) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_rootdata, __pyx_ptype_8petsc4py_5PETSc_ndarray))))) __PYX_ERR(40, 676, __pyx_L1_error) /* "petsc4py/PETSc/SF.pyx":677 * cdef MPI_Op cop = mpi4py_Op_Get(op) * CHKERR( PetscSFFetchAndOpBegin(self.sf, dtype, PyArray_DATA(rootdata), * PyArray_DATA(leafdata), # <<<<<<<<<<<<<< * PyArray_DATA(leafupdate), cop) ) * */ if (!(likely(((__pyx_v_leafdata) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_leafdata, __pyx_ptype_8petsc4py_5PETSc_ndarray))))) __PYX_ERR(40, 677, __pyx_L1_error) /* "petsc4py/PETSc/SF.pyx":678 * CHKERR( PetscSFFetchAndOpBegin(self.sf, dtype, PyArray_DATA(rootdata), * PyArray_DATA(leafdata), * PyArray_DATA(leafupdate), cop) ) # <<<<<<<<<<<<<< * * def fetchAndOpEnd(self, unit: Datatype, rootdata: ndarray, leafdata: ndarray, leafupdate: ndarray, op: Op) -> None: */ if (!(likely(((__pyx_v_leafupdate) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_leafupdate, __pyx_ptype_8petsc4py_5PETSc_ndarray))))) __PYX_ERR(40, 678, __pyx_L1_error) /* "petsc4py/PETSc/SF.pyx":676 * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) * cdef MPI_Op cop = mpi4py_Op_Get(op) * CHKERR( PetscSFFetchAndOpBegin(self.sf, dtype, PyArray_DATA(rootdata), # <<<<<<<<<<<<<< * PyArray_DATA(leafdata), * PyArray_DATA(leafupdate), cop) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFFetchAndOpBegin(__pyx_v_self->sf, __pyx_v_dtype, ((void *)PyArray_DATA(((PyArrayObject *)__pyx_v_rootdata))), ((void const *)PyArray_DATA(((PyArrayObject *)__pyx_v_leafdata))), ((void *)PyArray_DATA(((PyArrayObject *)__pyx_v_leafupdate))), __pyx_v_cop)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 676, __pyx_L1_error) /* "petsc4py/PETSc/SF.pyx":644 * PyArray_DATA(multirootdata)) ) * * def fetchAndOpBegin(self, unit: Datatype, rootdata: ndarray, leafdata: ndarray, leafupdate: ndarray, op: Op) -> None: # <<<<<<<<<<<<<< * """Begin fetch and update operation. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SF.fetchAndOpBegin", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SF.pyx":680 * PyArray_DATA(leafupdate), cop) ) * * def fetchAndOpEnd(self, unit: Datatype, rootdata: ndarray, leafdata: ndarray, leafupdate: ndarray, op: Op) -> None: # <<<<<<<<<<<<<< * """End operation started in a matching call to `fetchAndOpBegin`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_61fetchAndOpEnd(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2SF_60fetchAndOpEnd, "SF.fetchAndOpEnd(self, unit: Datatype, rootdata: ndarray, leafdata: ndarray, leafupdate: ndarray, op: Op) -> None\nEnd operation started in a matching call to `fetchAndOpBegin`.\n\n Collective.\n\n Parameters\n ----------\n unit\n MPI datatype.\n rootdata\n Root values to be updated, input state is seen by first process\n to perform an update.\n leafdata\n Leaf values to use in reduction.\n leafupdate\n State at each leaf's respective root immediately prior to my atomic\n update.\n op\n MPI reduction operation.\n\n See Also\n --------\n fetchAndOpBegin, petsc.PetscSFFetchAndOpEnd\n\n \nSource code at petsc4py/PETSc/SF.pyx:680"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_61fetchAndOpEnd(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_unit = 0; PyObject *__pyx_v_rootdata = 0; PyObject *__pyx_v_leafdata = 0; PyObject *__pyx_v_leafupdate = 0; PyObject *__pyx_v_op = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("fetchAndOpEnd (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_unit,&__pyx_n_s_rootdata,&__pyx_n_s_leafdata,&__pyx_n_s_leafupdate,&__pyx_n_s_op,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_unit)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(40, 680, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rootdata)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(40, 680, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("fetchAndOpEnd", 1, 5, 5, 1); __PYX_ERR(40, 680, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_leafdata)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(40, 680, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("fetchAndOpEnd", 1, 5, 5, 2); __PYX_ERR(40, 680, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_leafupdate)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(40, 680, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("fetchAndOpEnd", 1, 5, 5, 3); __PYX_ERR(40, 680, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(40, 680, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("fetchAndOpEnd", 1, 5, 5, 4); __PYX_ERR(40, 680, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "fetchAndOpEnd") < 0)) __PYX_ERR(40, 680, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 5)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); } __pyx_v_unit = values[0]; __pyx_v_rootdata = values[1]; __pyx_v_leafdata = values[2]; __pyx_v_leafupdate = values[3]; __pyx_v_op = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("fetchAndOpEnd", 1, 5, 5, __pyx_nargs); __PYX_ERR(40, 680, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SF.fetchAndOpEnd", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_60fetchAndOpEnd(((struct PyPetscSFObject *)__pyx_v_self), __pyx_v_unit, __pyx_v_rootdata, __pyx_v_leafdata, __pyx_v_leafupdate, __pyx_v_op); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_60fetchAndOpEnd(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_unit, PyObject *__pyx_v_rootdata, PyObject *__pyx_v_leafdata, PyObject *__pyx_v_leafupdate, PyObject *__pyx_v_op) { MPI_Datatype __pyx_v_dtype; MPI_Op __pyx_v_cop; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Datatype __pyx_t_1; MPI_Op __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("fetchAndOpEnd", 1); /* "petsc4py/PETSc/SF.pyx":705 * * """ * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) # <<<<<<<<<<<<<< * cdef MPI_Op cop = mpi4py_Op_Get(op) * CHKERR( PetscSFFetchAndOpEnd(self.sf, dtype, PyArray_DATA(rootdata), */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_mpi4py_Datatype_Get(__pyx_v_unit); if (unlikely(__pyx_t_1 == ((MPI_Datatype)MPI_DATATYPE_NULL) && PyErr_Occurred())) __PYX_ERR(40, 705, __pyx_L1_error) __pyx_v_dtype = __pyx_t_1; /* "petsc4py/PETSc/SF.pyx":706 * """ * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) * cdef MPI_Op cop = mpi4py_Op_Get(op) # <<<<<<<<<<<<<< * CHKERR( PetscSFFetchAndOpEnd(self.sf, dtype, PyArray_DATA(rootdata), * PyArray_DATA(leafdata), */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_mpi4py_Op_Get(__pyx_v_op); if (unlikely(__pyx_t_2 == ((MPI_Op)MPI_OP_NULL) && PyErr_Occurred())) __PYX_ERR(40, 706, __pyx_L1_error) __pyx_v_cop = __pyx_t_2; /* "petsc4py/PETSc/SF.pyx":707 * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) * cdef MPI_Op cop = mpi4py_Op_Get(op) * CHKERR( PetscSFFetchAndOpEnd(self.sf, dtype, PyArray_DATA(rootdata), # <<<<<<<<<<<<<< * PyArray_DATA(leafdata), * PyArray_DATA(leafupdate), cop) ) */ if (!(likely(((__pyx_v_rootdata) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_rootdata, __pyx_ptype_8petsc4py_5PETSc_ndarray))))) __PYX_ERR(40, 707, __pyx_L1_error) /* "petsc4py/PETSc/SF.pyx":708 * cdef MPI_Op cop = mpi4py_Op_Get(op) * CHKERR( PetscSFFetchAndOpEnd(self.sf, dtype, PyArray_DATA(rootdata), * PyArray_DATA(leafdata), # <<<<<<<<<<<<<< * PyArray_DATA(leafupdate), cop) ) * */ if (!(likely(((__pyx_v_leafdata) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_leafdata, __pyx_ptype_8petsc4py_5PETSc_ndarray))))) __PYX_ERR(40, 708, __pyx_L1_error) /* "petsc4py/PETSc/SF.pyx":709 * CHKERR( PetscSFFetchAndOpEnd(self.sf, dtype, PyArray_DATA(rootdata), * PyArray_DATA(leafdata), * PyArray_DATA(leafupdate), cop) ) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ if (!(likely(((__pyx_v_leafupdate) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_leafupdate, __pyx_ptype_8petsc4py_5PETSc_ndarray))))) __PYX_ERR(40, 709, __pyx_L1_error) /* "petsc4py/PETSc/SF.pyx":707 * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) * cdef MPI_Op cop = mpi4py_Op_Get(op) * CHKERR( PetscSFFetchAndOpEnd(self.sf, dtype, PyArray_DATA(rootdata), # <<<<<<<<<<<<<< * PyArray_DATA(leafdata), * PyArray_DATA(leafupdate), cop) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFFetchAndOpEnd(__pyx_v_self->sf, __pyx_v_dtype, ((void *)PyArray_DATA(((PyArrayObject *)__pyx_v_rootdata))), ((void const *)PyArray_DATA(((PyArrayObject *)__pyx_v_leafdata))), ((void *)PyArray_DATA(((PyArrayObject *)__pyx_v_leafupdate))), __pyx_v_cop)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 707, __pyx_L1_error) /* "petsc4py/PETSc/SF.pyx":680 * PyArray_DATA(leafupdate), cop) ) * * def fetchAndOpEnd(self, unit: Datatype, rootdata: ndarray, leafdata: ndarray, leafupdate: ndarray, op: Op) -> None: # <<<<<<<<<<<<<< * """End operation started in a matching call to `fetchAndOpBegin`. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SF.fetchAndOpEnd", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":43 * # * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.vec * self.vec = NULL */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_3Vec_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_3Vec_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec___cinit__(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_3Vec___cinit__(struct PyPetscVecObject *__pyx_v_self) { int __pyx_r; /* "petsc4py/PETSc/Vec.pyx":44 * * def __cinit__(self): * self.obj = &self.vec # <<<<<<<<<<<<<< * self.vec = NULL * */ __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->vec)); /* "petsc4py/PETSc/Vec.pyx":45 * def __cinit__(self): * self.obj = &self.vec * self.vec = NULL # <<<<<<<<<<<<<< * * # unary operations */ __pyx_v_self->vec = NULL; /* "petsc4py/PETSc/Vec.pyx":43 * # * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.vec * self.vec = NULL */ /* function exit code */ __pyx_r = 0; return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":49 * # unary operations * * def __pos__(self): # <<<<<<<<<<<<<< * return vec_pos(self) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_3__pos__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_3__pos__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pos__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_2__pos__(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_2__pos__(struct PyPetscVecObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__pos__", 1); /* "petsc4py/PETSc/Vec.pyx":50 * * def __pos__(self): * return vec_pos(self) # <<<<<<<<<<<<<< * * def __neg__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_pos(__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":49 * # unary operations * * def __pos__(self): # <<<<<<<<<<<<<< * return vec_pos(self) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Vec.__pos__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":52 * return vec_pos(self) * * def __neg__(self): # <<<<<<<<<<<<<< * return vec_neg(self) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_5__neg__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_5__neg__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__neg__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_4__neg__(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_4__neg__(struct PyPetscVecObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__neg__", 1); /* "petsc4py/PETSc/Vec.pyx":53 * * def __neg__(self): * return vec_neg(self) # <<<<<<<<<<<<<< * * def __abs__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_neg(__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":52 * return vec_pos(self) * * def __neg__(self): # <<<<<<<<<<<<<< * return vec_neg(self) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Vec.__neg__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":55 * return vec_neg(self) * * def __abs__(self): # <<<<<<<<<<<<<< * return vec_abs(self) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_7__abs__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_7__abs__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__abs__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_6__abs__(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_6__abs__(struct PyPetscVecObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__abs__", 1); /* "petsc4py/PETSc/Vec.pyx":56 * * def __abs__(self): * return vec_abs(self) # <<<<<<<<<<<<<< * * # inplace binary operations */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_abs(__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":55 * return vec_neg(self) * * def __abs__(self): # <<<<<<<<<<<<<< * return vec_abs(self) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Vec.__abs__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":60 * # inplace binary operations * * def __iadd__(self, other): # <<<<<<<<<<<<<< * return vec_iadd(self, other) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_9__iadd__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_9__iadd__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iadd__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_8__iadd__(((struct PyPetscVecObject *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_8__iadd__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__iadd__", 1); /* "petsc4py/PETSc/Vec.pyx":61 * * def __iadd__(self, other): * return vec_iadd(self, other) # <<<<<<<<<<<<<< * * def __isub__(self, other): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_iadd(__pyx_v_self, __pyx_v_other)); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":60 * # inplace binary operations * * def __iadd__(self, other): # <<<<<<<<<<<<<< * return vec_iadd(self, other) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Vec.__iadd__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":63 * return vec_iadd(self, other) * * def __isub__(self, other): # <<<<<<<<<<<<<< * return vec_isub(self, other) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_11__isub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_11__isub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__isub__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_10__isub__(((struct PyPetscVecObject *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_10__isub__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__isub__", 1); /* "petsc4py/PETSc/Vec.pyx":64 * * def __isub__(self, other): * return vec_isub(self, other) # <<<<<<<<<<<<<< * * def __imul__(self, other): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_isub(__pyx_v_self, __pyx_v_other)); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":63 * return vec_iadd(self, other) * * def __isub__(self, other): # <<<<<<<<<<<<<< * return vec_isub(self, other) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Vec.__isub__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":66 * return vec_isub(self, other) * * def __imul__(self, other): # <<<<<<<<<<<<<< * return vec_imul(self, other) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_13__imul__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_13__imul__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__imul__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_12__imul__(((struct PyPetscVecObject *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_12__imul__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__imul__", 1); /* "petsc4py/PETSc/Vec.pyx":67 * * def __imul__(self, other): * return vec_imul(self, other) # <<<<<<<<<<<<<< * * def __idiv__(self, other): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_imul(__pyx_v_self, __pyx_v_other)); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":66 * return vec_isub(self, other) * * def __imul__(self, other): # <<<<<<<<<<<<<< * return vec_imul(self, other) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Vec.__imul__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":69 * return vec_imul(self, other) * * def __idiv__(self, other): # <<<<<<<<<<<<<< * return vec_idiv(self, other) * */ /* Python wrapper */ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_15__idiv__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_15__idiv__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__idiv__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_14__idiv__(((struct PyPetscVecObject *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } #endif /*!(#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000))*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_14__idiv__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__idiv__", 1); /* "petsc4py/PETSc/Vec.pyx":70 * * def __idiv__(self, other): * return vec_idiv(self, other) # <<<<<<<<<<<<<< * * def __itruediv__(self, other): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_idiv(__pyx_v_self, __pyx_v_other)); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":69 * return vec_imul(self, other) * * def __idiv__(self, other): # <<<<<<<<<<<<<< * return vec_idiv(self, other) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Vec.__idiv__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } #endif /*!(#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000))*/ /* "petsc4py/PETSc/Vec.pyx":72 * return vec_idiv(self, other) * * def __itruediv__(self, other): # <<<<<<<<<<<<<< * return vec_idiv(self, other) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_17__itruediv__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_17__itruediv__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__itruediv__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_16__itruediv__(((struct PyPetscVecObject *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_16__itruediv__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__itruediv__", 1); /* "petsc4py/PETSc/Vec.pyx":73 * * def __itruediv__(self, other): * return vec_idiv(self, other) # <<<<<<<<<<<<<< * * # binary operations */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_idiv(__pyx_v_self, __pyx_v_other)); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":72 * return vec_idiv(self, other) * * def __itruediv__(self, other): # <<<<<<<<<<<<<< * return vec_idiv(self, other) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Vec.__itruediv__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":77 * # binary operations * * def __add__(self, other): # <<<<<<<<<<<<<< * return vec_add(self, other) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_19__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_19__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__add__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_18__add__(((struct PyPetscVecObject *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_18__add__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__add__", 1); /* "petsc4py/PETSc/Vec.pyx":78 * * def __add__(self, other): * return vec_add(self, other) # <<<<<<<<<<<<<< * * def __radd__(self, other): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_add(__pyx_v_self, __pyx_v_other)); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":77 * # binary operations * * def __add__(self, other): # <<<<<<<<<<<<<< * return vec_add(self, other) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Vec.__add__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":80 * return vec_add(self, other) * * def __radd__(self, other): # <<<<<<<<<<<<<< * return vec_radd(self, other) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_21__radd__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_21__radd__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__radd__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_20__radd__(((struct PyPetscVecObject *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_20__radd__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__radd__", 1); /* "petsc4py/PETSc/Vec.pyx":81 * * def __radd__(self, other): * return vec_radd(self, other) # <<<<<<<<<<<<<< * * def __sub__(self, other): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_radd(__pyx_v_self, __pyx_v_other)); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":80 * return vec_add(self, other) * * def __radd__(self, other): # <<<<<<<<<<<<<< * return vec_radd(self, other) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Vec.__radd__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":83 * return vec_radd(self, other) * * def __sub__(self, other): # <<<<<<<<<<<<<< * return vec_sub(self, other) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_23__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_23__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__sub__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_22__sub__(((struct PyPetscVecObject *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_22__sub__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__sub__", 1); /* "petsc4py/PETSc/Vec.pyx":84 * * def __sub__(self, other): * return vec_sub(self, other) # <<<<<<<<<<<<<< * * def __rsub__(self, other): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_sub(__pyx_v_self, __pyx_v_other)); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":83 * return vec_radd(self, other) * * def __sub__(self, other): # <<<<<<<<<<<<<< * return vec_sub(self, other) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Vec.__sub__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":86 * return vec_sub(self, other) * * def __rsub__(self, other): # <<<<<<<<<<<<<< * return vec_rsub(self, other) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_25__rsub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_25__rsub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__rsub__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_24__rsub__(((struct PyPetscVecObject *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_24__rsub__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__rsub__", 1); /* "petsc4py/PETSc/Vec.pyx":87 * * def __rsub__(self, other): * return vec_rsub(self, other) # <<<<<<<<<<<<<< * * def __mul__(self, other): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_rsub(__pyx_v_self, __pyx_v_other)); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":86 * return vec_sub(self, other) * * def __rsub__(self, other): # <<<<<<<<<<<<<< * return vec_rsub(self, other) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Vec.__rsub__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":89 * return vec_rsub(self, other) * * def __mul__(self, other): # <<<<<<<<<<<<<< * return vec_mul(self, other) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_27__mul__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_27__mul__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__mul__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_26__mul__(((struct PyPetscVecObject *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_26__mul__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__mul__", 1); /* "petsc4py/PETSc/Vec.pyx":90 * * def __mul__(self, other): * return vec_mul(self, other) # <<<<<<<<<<<<<< * * def __rmul__(self, other): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_mul(__pyx_v_self, __pyx_v_other)); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":89 * return vec_rsub(self, other) * * def __mul__(self, other): # <<<<<<<<<<<<<< * return vec_mul(self, other) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Vec.__mul__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":92 * return vec_mul(self, other) * * def __rmul__(self, other): # <<<<<<<<<<<<<< * return vec_rmul(self, other) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_29__rmul__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_29__rmul__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__rmul__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_28__rmul__(((struct PyPetscVecObject *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_28__rmul__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__rmul__", 1); /* "petsc4py/PETSc/Vec.pyx":93 * * def __rmul__(self, other): * return vec_rmul(self, other) # <<<<<<<<<<<<<< * * def __div__(self, other): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_rmul(__pyx_v_self, __pyx_v_other)); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":92 * return vec_mul(self, other) * * def __rmul__(self, other): # <<<<<<<<<<<<<< * return vec_rmul(self, other) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Vec.__rmul__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":95 * return vec_rmul(self, other) * * def __div__(self, other): # <<<<<<<<<<<<<< * return vec_div(self, other) * */ /* Python wrapper */ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_31__div__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_31__div__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__div__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_30__div__(((struct PyPetscVecObject *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } #endif /*!(#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000))*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_30__div__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__div__", 1); /* "petsc4py/PETSc/Vec.pyx":96 * * def __div__(self, other): * return vec_div(self, other) # <<<<<<<<<<<<<< * * def __rdiv__(self, other): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_div(__pyx_v_self, __pyx_v_other)); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":95 * return vec_rmul(self, other) * * def __div__(self, other): # <<<<<<<<<<<<<< * return vec_div(self, other) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Vec.__div__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } #endif /*!(#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000))*/ /* "petsc4py/PETSc/Vec.pyx":98 * return vec_div(self, other) * * def __rdiv__(self, other): # <<<<<<<<<<<<<< * return vec_rdiv(self, other) * */ /* Python wrapper */ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_33__rdiv__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_33__rdiv__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__rdiv__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_32__rdiv__(((struct PyPetscVecObject *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } #endif /*!(#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000))*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_32__rdiv__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__rdiv__", 1); /* "petsc4py/PETSc/Vec.pyx":99 * * def __rdiv__(self, other): * return vec_rdiv(self, other) # <<<<<<<<<<<<<< * * def __truediv__(self, other): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_rdiv(__pyx_v_self, __pyx_v_other)); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":98 * return vec_div(self, other) * * def __rdiv__(self, other): # <<<<<<<<<<<<<< * return vec_rdiv(self, other) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Vec.__rdiv__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } #endif /*!(#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000))*/ /* "petsc4py/PETSc/Vec.pyx":101 * return vec_rdiv(self, other) * * def __truediv__(self, other): # <<<<<<<<<<<<<< * return vec_div(self, other) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_35__truediv__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_35__truediv__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__truediv__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_34__truediv__(((struct PyPetscVecObject *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_34__truediv__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__truediv__", 1); /* "petsc4py/PETSc/Vec.pyx":102 * * def __truediv__(self, other): * return vec_div(self, other) # <<<<<<<<<<<<<< * * def __rtruediv__(self, other): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_div(__pyx_v_self, __pyx_v_other)); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":101 * return vec_rdiv(self, other) * * def __truediv__(self, other): # <<<<<<<<<<<<<< * return vec_div(self, other) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Vec.__truediv__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":104 * return vec_div(self, other) * * def __rtruediv__(self, other): # <<<<<<<<<<<<<< * return vec_rdiv(self, other) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_37__rtruediv__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_37__rtruediv__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__rtruediv__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_36__rtruediv__(((struct PyPetscVecObject *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_36__rtruediv__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__rtruediv__", 1); /* "petsc4py/PETSc/Vec.pyx":105 * * def __rtruediv__(self, other): * return vec_rdiv(self, other) # <<<<<<<<<<<<<< * * def __matmul__(self, other): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_rdiv(__pyx_v_self, __pyx_v_other)); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":104 * return vec_div(self, other) * * def __rtruediv__(self, other): # <<<<<<<<<<<<<< * return vec_rdiv(self, other) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Vec.__rtruediv__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":107 * return vec_rdiv(self, other) * * def __matmul__(self, other): # <<<<<<<<<<<<<< * return vec_matmul(self, other) * # */ /* Python wrapper */ #if PY_VERSION_HEX >= 0x03050000 static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_39__matmul__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_39__matmul__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__matmul__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_38__matmul__(((struct PyPetscVecObject *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } #endif /*!(#if PY_VERSION_HEX >= 0x03050000)*/ #if PY_VERSION_HEX >= 0x03050000 static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_38__matmul__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__matmul__", 1); /* "petsc4py/PETSc/Vec.pyx":108 * * def __matmul__(self, other): * return vec_matmul(self, other) # <<<<<<<<<<<<<< * # * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_vec_matmul(__pyx_v_self, __pyx_v_other); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":107 * return vec_rdiv(self, other) * * def __matmul__(self, other): # <<<<<<<<<<<<<< * return vec_matmul(self, other) * # */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Vec.__matmul__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } #endif /*!(#if PY_VERSION_HEX >= 0x03050000)*/ /* "petsc4py/PETSc/Vec.pyx":116 * # return size * * def __getitem__(self, i): # <<<<<<<<<<<<<< * return vec_getitem(self, i) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_41__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_41__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_40__getitem__(((struct PyPetscVecObject *)__pyx_v_self), ((PyObject *)__pyx_v_i)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_40__getitem__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_i) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getitem__", 1); /* "petsc4py/PETSc/Vec.pyx":117 * * def __getitem__(self, i): * return vec_getitem(self, i) # <<<<<<<<<<<<<< * * def __setitem__(self, i, v): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_vec_getitem(__pyx_v_self, __pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":116 * # return size * * def __getitem__(self, i): # <<<<<<<<<<<<<< * return vec_getitem(self, i) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Vec.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":119 * return vec_getitem(self, i) * * def __setitem__(self, i, v): # <<<<<<<<<<<<<< * vec_setitem(self, i, v) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_3Vec_43__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i, PyObject *__pyx_v_v); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_3Vec_43__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i, PyObject *__pyx_v_v) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_42__setitem__(((struct PyPetscVecObject *)__pyx_v_self), ((PyObject *)__pyx_v_i), ((PyObject *)__pyx_v_v)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_3Vec_42__setitem__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_i, PyObject *__pyx_v_v) { int __pyx_r; int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "petsc4py/PETSc/Vec.pyx":120 * * def __setitem__(self, i, v): * vec_setitem(self, i, v) # <<<<<<<<<<<<<< * * # buffer interface (PEP 3118) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_vec_setitem(__pyx_v_self, __pyx_v_i, __pyx_v_v); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(41, 120, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":119 * return vec_getitem(self, i) * * def __setitem__(self, i, v): # <<<<<<<<<<<<<< * vec_setitem(self, i, v) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":124 * # buffer interface (PEP 3118) * * def __getbuffer__(self, Py_buffer *view, int flags): # <<<<<<<<<<<<<< * cdef _Vec_buffer buf = _Vec_buffer(self) * buf.acquirebuffer(view, flags) */ /* Python wrapper */ CYTHON_UNUSED static int __pyx_pw_8petsc4py_5PETSc_3Vec_45__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_view, int __pyx_v_flags); /*proto*/ CYTHON_UNUSED static int __pyx_pw_8petsc4py_5PETSc_3Vec_45__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_view, int __pyx_v_flags) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_44__getbuffer__(((struct PyPetscVecObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_view), ((int)__pyx_v_flags)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_3Vec_44__getbuffer__(struct PyPetscVecObject *__pyx_v_self, Py_buffer *__pyx_v_view, int __pyx_v_flags) { struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_buf = 0; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; if (unlikely(__pyx_v_view == NULL)) { PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete"); return -1; } __Pyx_RefNannySetupContext("__getbuffer__", 0); __pyx_v_view->obj = Py_None; __Pyx_INCREF(Py_None); __Pyx_GIVEREF(__pyx_v_view->obj); /* "petsc4py/PETSc/Vec.pyx":125 * * def __getbuffer__(self, Py_buffer *view, int flags): * cdef _Vec_buffer buf = _Vec_buffer(self) # <<<<<<<<<<<<<< * buf.acquirebuffer(view, flags) * */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc__Vec_buffer), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_buf = ((struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Vec.pyx":126 * def __getbuffer__(self, Py_buffer *view, int flags): * cdef _Vec_buffer buf = _Vec_buffer(self) * buf.acquirebuffer(view, flags) # <<<<<<<<<<<<<< * * def __releasebuffer__(self, Py_buffer *view): */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_buf->__pyx_vtab)->acquirebuffer(__pyx_v_buf, __pyx_v_view, __pyx_v_flags); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(41, 126, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":124 * # buffer interface (PEP 3118) * * def __getbuffer__(self, Py_buffer *view, int flags): # <<<<<<<<<<<<<< * cdef _Vec_buffer buf = _Vec_buffer(self) * buf.acquirebuffer(view, flags) */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Vec.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; if (__pyx_v_view->obj != NULL) { __Pyx_GOTREF(__pyx_v_view->obj); __Pyx_DECREF(__pyx_v_view->obj); __pyx_v_view->obj = 0; } goto __pyx_L2; __pyx_L0:; if (__pyx_v_view->obj == Py_None) { __Pyx_GOTREF(__pyx_v_view->obj); __Pyx_DECREF(__pyx_v_view->obj); __pyx_v_view->obj = 0; } __pyx_L2:; __Pyx_XDECREF((PyObject *)__pyx_v_buf); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":128 * buf.acquirebuffer(view, flags) * * def __releasebuffer__(self, Py_buffer *view): # <<<<<<<<<<<<<< * cdef _Vec_buffer buf = <_Vec_buffer>(view.obj) * buf.releasebuffer(view) */ /* Python wrapper */ CYTHON_UNUSED static void __pyx_pw_8petsc4py_5PETSc_3Vec_47__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_view); /*proto*/ CYTHON_UNUSED static void __pyx_pw_8petsc4py_5PETSc_3Vec_47__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_view) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_pf_8petsc4py_5PETSc_3Vec_46__releasebuffer__(((struct PyPetscVecObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_view)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_8petsc4py_5PETSc_3Vec_46__releasebuffer__(struct PyPetscVecObject *__pyx_v_self, Py_buffer *__pyx_v_view) { struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_buf = 0; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__releasebuffer__", 1); /* "petsc4py/PETSc/Vec.pyx":129 * * def __releasebuffer__(self, Py_buffer *view): * cdef _Vec_buffer buf = <_Vec_buffer>(view.obj) # <<<<<<<<<<<<<< * buf.releasebuffer(view) * self # unused */ __pyx_t_1 = __pyx_v_view->obj; __Pyx_INCREF(__pyx_t_1); __pyx_v_buf = ((struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Vec.pyx":130 * def __releasebuffer__(self, Py_buffer *view): * cdef _Vec_buffer buf = <_Vec_buffer>(view.obj) * buf.releasebuffer(view) # <<<<<<<<<<<<<< * self # unused * */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_buf->__pyx_vtab)->releasebuffer(__pyx_v_buf, __pyx_v_view); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(41, 130, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":131 * cdef _Vec_buffer buf = <_Vec_buffer>(view.obj) * buf.releasebuffer(view) * self # unused # <<<<<<<<<<<<<< * * # 'with' statement (PEP 343) */ ((void)__pyx_v_self); /* "petsc4py/PETSc/Vec.pyx":128 * buf.acquirebuffer(view, flags) * * def __releasebuffer__(self, Py_buffer *view): # <<<<<<<<<<<<<< * cdef _Vec_buffer buf = <_Vec_buffer>(view.obj) * buf.releasebuffer(view) */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_WriteUnraisable("petsc4py.PETSc.Vec.__releasebuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_buf); __Pyx_RefNannyFinishContext(); } /* "petsc4py/PETSc/Vec.pyx":135 * # 'with' statement (PEP 343) * * def __enter__(self): # <<<<<<<<<<<<<< * cdef _Vec_buffer buf = _Vec_buffer(self) * self.set_attr('__buffer__', buf) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_49__enter__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_48__enter__, "Vec.__enter__(self)\nSource code at petsc4py/PETSc/Vec.pyx:135"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_49__enter__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__enter__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__enter__", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_48__enter__(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_48__enter__(struct PyPetscVecObject *__pyx_v_self) { struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_buf = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__enter__", 1); /* "petsc4py/PETSc/Vec.pyx":136 * * def __enter__(self): * cdef _Vec_buffer buf = _Vec_buffer(self) # <<<<<<<<<<<<<< * self.set_attr('__buffer__', buf) * return buf.enter() */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc__Vec_buffer), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_buf = ((struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Vec.pyx":137 * def __enter__(self): * cdef _Vec_buffer buf = _Vec_buffer(self) * self.set_attr('__buffer__', buf) # <<<<<<<<<<<<<< * return buf.enter() * */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Vec *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__buffer__"), ((PyObject *)__pyx_v_buf)); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Vec.pyx":138 * cdef _Vec_buffer buf = _Vec_buffer(self) * self.set_attr('__buffer__', buf) * return buf.enter() # <<<<<<<<<<<<<< * * def __exit__(self, *exc): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_buf->__pyx_vtab)->enter(__pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":135 * # 'with' statement (PEP 343) * * def __enter__(self): # <<<<<<<<<<<<<< * cdef _Vec_buffer buf = _Vec_buffer(self) * self.set_attr('__buffer__', buf) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Vec.__enter__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_buf); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":140 * return buf.enter() * * def __exit__(self, *exc): # <<<<<<<<<<<<<< * cdef _Vec_buffer buf = self.get_attr('__buffer__') * self.set_attr('__buffer__', None) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_51__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_50__exit__, "Vec.__exit__(self, *exc)\nSource code at petsc4py/PETSc/Vec.pyx:140"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_51__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED PyObject *__pyx_v_exc = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__exit__", 0))) return NULL; __Pyx_INCREF(__pyx_args); __pyx_v_exc = __pyx_args; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_50__exit__(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_exc); /* function exit code */ __Pyx_DECREF(__pyx_v_exc); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_50__exit__(struct PyPetscVecObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc) { struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_buf = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__exit__", 1); /* "petsc4py/PETSc/Vec.pyx":141 * * def __exit__(self, *exc): * cdef _Vec_buffer buf = self.get_attr('__buffer__') # <<<<<<<<<<<<<< * self.set_attr('__buffer__', None) * return buf.exit() */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Vec *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__buffer__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc__Vec_buffer))))) __PYX_ERR(41, 141, __pyx_L1_error) __pyx_v_buf = ((struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Vec.pyx":142 * def __exit__(self, *exc): * cdef _Vec_buffer buf = self.get_attr('__buffer__') * self.set_attr('__buffer__', None) # <<<<<<<<<<<<<< * return buf.exit() * */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Vec *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__buffer__"), Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Vec.pyx":143 * cdef _Vec_buffer buf = self.get_attr('__buffer__') * self.set_attr('__buffer__', None) * return buf.exit() # <<<<<<<<<<<<<< * * # */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_buf->__pyx_vtab)->exit(__pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":140 * return buf.enter() * * def __exit__(self, *exc): # <<<<<<<<<<<<<< * cdef _Vec_buffer buf = self.get_attr('__buffer__') * self.set_attr('__buffer__', None) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Vec.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_buf); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":147 * # * * def view(self, Viewer viewer=None) -> None: # <<<<<<<<<<<<<< * """Display the vector. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_53view(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_52view, "Vec.view(self, viewer: Viewer | None = None) -> None\nDisplay the vector.\n\n Collective.\n\n Parameters\n ----------\n viewer\n A `Viewer` instance or `None` for the default viewer.\n\n See Also\n --------\n load, petsc.VecView\n\n \nSource code at petsc4py/PETSc/Vec.pyx:147"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_53view(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscViewerObject *__pyx_v_viewer = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("view (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscViewerObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_viewer); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 147, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "view") < 0)) __PYX_ERR(41, 147, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, __pyx_nargs); __PYX_ERR(41, 147, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(41, 147, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_52view(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_viewer); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_52view(struct PyPetscVecObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer) { PetscViewer __pyx_v_vwr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscViewer __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("view", 1); /* "petsc4py/PETSc/Vec.pyx":162 * * """ * cdef PetscViewer vwr = NULL # <<<<<<<<<<<<<< * if viewer is not None: vwr = viewer.vwr * CHKERR( VecView(self.vec, vwr) ) */ __pyx_v_vwr = NULL; /* "petsc4py/PETSc/Vec.pyx":163 * """ * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr # <<<<<<<<<<<<<< * CHKERR( VecView(self.vec, vwr) ) * */ __pyx_t_1 = (((PyObject *)__pyx_v_viewer) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_viewer->vwr; __pyx_v_vwr = __pyx_t_2; } /* "petsc4py/PETSc/Vec.pyx":164 * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr * CHKERR( VecView(self.vec, vwr) ) # <<<<<<<<<<<<<< * * def destroy(self) -> Self: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecView(__pyx_v_self->vec, __pyx_v_vwr)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 164, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":147 * # * * def view(self, Viewer viewer=None) -> None: # <<<<<<<<<<<<<< * """Display the vector. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":166 * CHKERR( VecView(self.vec, vwr) ) * * def destroy(self) -> Self: # <<<<<<<<<<<<<< * """Destroy the vector. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_55destroy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_54destroy, "Vec.destroy(self) -> Self\nDestroy the vector.\n\n Collective.\n\n See Also\n --------\n create, petsc.VecDestroy\n\n \nSource code at petsc4py/PETSc/Vec.pyx:166"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_55destroy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("destroy (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_54destroy(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_54destroy(struct PyPetscVecObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("destroy", 1); /* "petsc4py/PETSc/Vec.pyx":176 * * """ * CHKERR( VecDestroy(&self.vec) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecDestroy((&__pyx_v_self->vec))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 176, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":177 * """ * CHKERR( VecDestroy(&self.vec) ) * return self # <<<<<<<<<<<<<< * * def create(self, comm: Comm | None = None) -> Self: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":166 * CHKERR( VecView(self.vec, vwr) ) * * def destroy(self) -> Self: # <<<<<<<<<<<<<< * """Destroy the vector. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":179 * return self * * def create(self, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Create a vector object. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_57create(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_56create, "Vec.create(self, comm: Comm | None = None) -> Self\nCreate a vector object.\n\n Collective.\n\n After creation the vector type can then be set with `setType`.\n\n Parameters\n ----------\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n destroy, petsc.VecCreate\n\n \nSource code at petsc4py/PETSc/Vec.pyx:179"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_57create(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 179, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "create") < 0)) __PYX_ERR(41, 179, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_comm = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, __pyx_nargs); __PYX_ERR(41, 179, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_56create(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_comm); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_56create(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; Vec __pyx_v_newvec; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create", 1); /* "petsc4py/PETSc/Vec.pyx":196 * * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscVec newvec = NULL * CHKERR( VecCreate(ccomm, &newvec) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(41, 196, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/Vec.pyx":197 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscVec newvec = NULL # <<<<<<<<<<<<<< * CHKERR( VecCreate(ccomm, &newvec) ) * CHKERR( PetscCLEAR(self.obj) ); self.vec = newvec */ __pyx_v_newvec = NULL; /* "petsc4py/PETSc/Vec.pyx":198 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscVec newvec = NULL * CHKERR( VecCreate(ccomm, &newvec) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.vec = newvec * return self */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCreate(__pyx_v_ccomm, (&__pyx_v_newvec))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 198, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":199 * cdef PetscVec newvec = NULL * CHKERR( VecCreate(ccomm, &newvec) ) * CHKERR( PetscCLEAR(self.obj) ); self.vec = newvec # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 199, __pyx_L1_error) __pyx_v_self->vec = __pyx_v_newvec; /* "petsc4py/PETSc/Vec.pyx":200 * CHKERR( VecCreate(ccomm, &newvec) ) * CHKERR( PetscCLEAR(self.obj) ); self.vec = newvec * return self # <<<<<<<<<<<<<< * * def setType(self, vec_type: Type | str) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":179 * return self * * def create(self, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Create a vector object. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":202 * return self * * def setType(self, vec_type: Type | str) -> None: # <<<<<<<<<<<<<< * """Set the vector type. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_59setType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_58setType, "Vec.setType(self, vec_type: Type | str) -> None\nSet the vector type.\n\n Collective.\n\n Parameters\n ----------\n vec_type\n The vector type.\n\n See Also\n --------\n create, getType, petsc.VecSetType\n\n \nSource code at petsc4py/PETSc/Vec.pyx:202"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_59setType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_vec_type = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec_type,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vec_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 202, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setType") < 0)) __PYX_ERR(41, 202, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_vec_type = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, __pyx_nargs); __PYX_ERR(41, 202, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_58setType(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_vec_type); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_58setType(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_vec_type) { VecType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setType", 0); __Pyx_INCREF(__pyx_v_vec_type); /* "petsc4py/PETSc/Vec.pyx":217 * * """ * cdef PetscVecType cval = NULL # <<<<<<<<<<<<<< * vec_type = str2bytes(vec_type, &cval) * CHKERR( VecSetType(self.vec, cval) ) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/Vec.pyx":218 * """ * cdef PetscVecType cval = NULL * vec_type = str2bytes(vec_type, &cval) # <<<<<<<<<<<<<< * CHKERR( VecSetType(self.vec, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_vec_type, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_vec_type, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Vec.pyx":219 * cdef PetscVecType cval = NULL * vec_type = str2bytes(vec_type, &cval) * CHKERR( VecSetType(self.vec, cval) ) # <<<<<<<<<<<<<< * * def setSizes( */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecSetType(__pyx_v_self->vec, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 219, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":202 * return self * * def setType(self, vec_type: Type | str) -> None: # <<<<<<<<<<<<<< * """Set the vector type. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Vec.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_vec_type); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":221 * CHKERR( VecSetType(self.vec, cval) ) * * def setSizes( # <<<<<<<<<<<<<< * self, * size: LayoutSizeSpec, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_61setSizes(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_60setSizes, "Vec.setSizes(self, size: LayoutSizeSpec, bsize: int | None = None) -> None\nSet the local and global sizes of the vector.\n\n Collective.\n\n Parameters\n ----------\n size\n Vector size.\n bsize\n Vector block size. If `None`, ``bsize = 1``.\n\n See Also\n --------\n getSizes, petsc.VecSetSizes\n\n \nSource code at petsc4py/PETSc/Vec.pyx:221"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_61setSizes(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_size = 0; PyObject *__pyx_v_bsize = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setSizes (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_bsize,0}; /* "petsc4py/PETSc/Vec.pyx":224 * self, * size: LayoutSizeSpec, * bsize: int | None = None, # <<<<<<<<<<<<<< * ) -> None: * """Set the local and global sizes of the vector. */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 221, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_bsize); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 221, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setSizes") < 0)) __PYX_ERR(41, 221, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_size = values[0]; __pyx_v_bsize = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setSizes", 0, 1, 2, __pyx_nargs); __PYX_ERR(41, 221, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.setSizes", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_60setSizes(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_size, __pyx_v_bsize); /* "petsc4py/PETSc/Vec.pyx":221 * CHKERR( VecSetType(self.vec, cval) ) * * def setSizes( # <<<<<<<<<<<<<< * self, * size: LayoutSizeSpec, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_60setSizes(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize) { PetscInt __pyx_v_bs; PetscInt __pyx_v_n; PetscInt __pyx_v_N; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setSizes", 1); /* "petsc4py/PETSc/Vec.pyx":242 * * """ * cdef PetscInt bs=0, n=0, N=0 # <<<<<<<<<<<<<< * Vec_Sizes(size, bsize, &bs, &n, &N) * CHKERR( VecSetSizes(self.vec, n, N) ) */ __pyx_v_bs = 0; __pyx_v_n = 0; __pyx_v_N = 0; /* "petsc4py/PETSc/Vec.pyx":243 * """ * cdef PetscInt bs=0, n=0, N=0 * Vec_Sizes(size, bsize, &bs, &n, &N) # <<<<<<<<<<<<<< * CHKERR( VecSetSizes(self.vec, n, N) ) * if bs != PETSC_DECIDE: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_Vec_Sizes(__pyx_v_size, __pyx_v_bsize, (&__pyx_v_bs), (&__pyx_v_n), (&__pyx_v_N)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(41, 243, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":244 * cdef PetscInt bs=0, n=0, N=0 * Vec_Sizes(size, bsize, &bs, &n, &N) * CHKERR( VecSetSizes(self.vec, n, N) ) # <<<<<<<<<<<<<< * if bs != PETSC_DECIDE: * CHKERR( VecSetBlockSize(self.vec, bs) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecSetSizes(__pyx_v_self->vec, __pyx_v_n, __pyx_v_N)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 244, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":245 * Vec_Sizes(size, bsize, &bs, &n, &N) * CHKERR( VecSetSizes(self.vec, n, N) ) * if bs != PETSC_DECIDE: # <<<<<<<<<<<<<< * CHKERR( VecSetBlockSize(self.vec, bs) ) * */ __pyx_t_3 = (__pyx_v_bs != PETSC_DECIDE); if (__pyx_t_3) { /* "petsc4py/PETSc/Vec.pyx":246 * CHKERR( VecSetSizes(self.vec, n, N) ) * if bs != PETSC_DECIDE: * CHKERR( VecSetBlockSize(self.vec, bs) ) # <<<<<<<<<<<<<< * * # */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecSetBlockSize(__pyx_v_self->vec, __pyx_v_bs)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 246, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":245 * Vec_Sizes(size, bsize, &bs, &n, &N) * CHKERR( VecSetSizes(self.vec, n, N) ) * if bs != PETSC_DECIDE: # <<<<<<<<<<<<<< * CHKERR( VecSetBlockSize(self.vec, bs) ) * */ } /* "petsc4py/PETSc/Vec.pyx":221 * CHKERR( VecSetType(self.vec, cval) ) * * def setSizes( # <<<<<<<<<<<<<< * self, * size: LayoutSizeSpec, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.setSizes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":251 * * # FIXME the comm argument is hideous. * def createSeq( # <<<<<<<<<<<<<< * self, * size: LayoutSizeSpec, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_63createSeq(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_62createSeq, "Vec.createSeq(self, size: LayoutSizeSpec, bsize: int | None = None, comm: Comm | None = None) -> Self\nCreate a sequential `Type.SEQ` vector.\n\n Collective.\n\n Parameters\n ----------\n size\n Vector size.\n bsize\n Vector block size. If `None`, ``bsize = 1``.\n comm\n MPI communicator, defaults to `COMM_SELF`.\n\n See Also\n --------\n createMPI, petsc.VecCreateSeq\n\n \nSource code at petsc4py/PETSc/Vec.pyx:251"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_63createSeq(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_size = 0; PyObject *__pyx_v_bsize = 0; PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createSeq (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_bsize,&__pyx_n_s_comm,0}; /* "petsc4py/PETSc/Vec.pyx":254 * self, * size: LayoutSizeSpec, * bsize: int | None = None, # <<<<<<<<<<<<<< * comm: Comm | None = None, * ) -> Self: */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Vec.pyx":255 * size: LayoutSizeSpec, * bsize: int | None = None, * comm: Comm | None = None, # <<<<<<<<<<<<<< * ) -> Self: * """Create a sequential `Type.SEQ` vector. */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 251, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_bsize); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 251, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 251, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createSeq") < 0)) __PYX_ERR(41, 251, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_size = values[0]; __pyx_v_bsize = values[1]; __pyx_v_comm = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createSeq", 0, 1, 3, __pyx_nargs); __PYX_ERR(41, 251, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.createSeq", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_62createSeq(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_size, __pyx_v_bsize, __pyx_v_comm); /* "petsc4py/PETSc/Vec.pyx":251 * * # FIXME the comm argument is hideous. * def createSeq( # <<<<<<<<<<<<<< * self, * size: LayoutSizeSpec, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_62createSeq(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PetscInt __pyx_v_bs; PetscInt __pyx_v_n; PetscInt __pyx_v_N; Vec __pyx_v_newvec; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; int __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createSeq", 1); /* "petsc4py/PETSc/Vec.pyx":275 * * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_SELF) # <<<<<<<<<<<<<< * cdef PetscInt bs=0, n=0, N=0 * Vec_Sizes(size, bsize, &bs, &n, &N) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, PETSC_COMM_SELF); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(41, 275, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/Vec.pyx":276 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_SELF) * cdef PetscInt bs=0, n=0, N=0 # <<<<<<<<<<<<<< * Vec_Sizes(size, bsize, &bs, &n, &N) * Sys_Layout(ccomm, bs, &n, &N) */ __pyx_v_bs = 0; __pyx_v_n = 0; __pyx_v_N = 0; /* "petsc4py/PETSc/Vec.pyx":277 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_SELF) * cdef PetscInt bs=0, n=0, N=0 * Vec_Sizes(size, bsize, &bs, &n, &N) # <<<<<<<<<<<<<< * Sys_Layout(ccomm, bs, &n, &N) * if bs == PETSC_DECIDE: bs = 1 */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_Vec_Sizes(__pyx_v_size, __pyx_v_bsize, (&__pyx_v_bs), (&__pyx_v_n), (&__pyx_v_N)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(41, 277, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":278 * cdef PetscInt bs=0, n=0, N=0 * Vec_Sizes(size, bsize, &bs, &n, &N) * Sys_Layout(ccomm, bs, &n, &N) # <<<<<<<<<<<<<< * if bs == PETSC_DECIDE: bs = 1 * cdef PetscVec newvec = NULL */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_Sys_Layout(__pyx_v_ccomm, __pyx_v_bs, (&__pyx_v_n), (&__pyx_v_N)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 278, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":279 * Vec_Sizes(size, bsize, &bs, &n, &N) * Sys_Layout(ccomm, bs, &n, &N) * if bs == PETSC_DECIDE: bs = 1 # <<<<<<<<<<<<<< * cdef PetscVec newvec = NULL * CHKERR( VecCreate(ccomm,&newvec) ) */ __pyx_t_4 = (__pyx_v_bs == PETSC_DECIDE); if (__pyx_t_4) { __pyx_v_bs = 1; } /* "petsc4py/PETSc/Vec.pyx":280 * Sys_Layout(ccomm, bs, &n, &N) * if bs == PETSC_DECIDE: bs = 1 * cdef PetscVec newvec = NULL # <<<<<<<<<<<<<< * CHKERR( VecCreate(ccomm,&newvec) ) * CHKERR( VecSetSizes(newvec, n, N) ) */ __pyx_v_newvec = NULL; /* "petsc4py/PETSc/Vec.pyx":281 * if bs == PETSC_DECIDE: bs = 1 * cdef PetscVec newvec = NULL * CHKERR( VecCreate(ccomm,&newvec) ) # <<<<<<<<<<<<<< * CHKERR( VecSetSizes(newvec, n, N) ) * CHKERR( VecSetBlockSize(newvec, bs) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCreate(__pyx_v_ccomm, (&__pyx_v_newvec))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 281, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":282 * cdef PetscVec newvec = NULL * CHKERR( VecCreate(ccomm,&newvec) ) * CHKERR( VecSetSizes(newvec, n, N) ) # <<<<<<<<<<<<<< * CHKERR( VecSetBlockSize(newvec, bs) ) * CHKERR( VecSetType(newvec, VECSEQ) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecSetSizes(__pyx_v_newvec, __pyx_v_n, __pyx_v_N)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 282, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":283 * CHKERR( VecCreate(ccomm,&newvec) ) * CHKERR( VecSetSizes(newvec, n, N) ) * CHKERR( VecSetBlockSize(newvec, bs) ) # <<<<<<<<<<<<<< * CHKERR( VecSetType(newvec, VECSEQ) ) * CHKERR( PetscCLEAR(self.obj) ); self.vec = newvec */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecSetBlockSize(__pyx_v_newvec, __pyx_v_bs)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 283, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":284 * CHKERR( VecSetSizes(newvec, n, N) ) * CHKERR( VecSetBlockSize(newvec, bs) ) * CHKERR( VecSetType(newvec, VECSEQ) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.vec = newvec * return self */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecSetType(__pyx_v_newvec, VECSEQ)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 284, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":285 * CHKERR( VecSetBlockSize(newvec, bs) ) * CHKERR( VecSetType(newvec, VECSEQ) ) * CHKERR( PetscCLEAR(self.obj) ); self.vec = newvec # <<<<<<<<<<<<<< * return self * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 285, __pyx_L1_error) __pyx_v_self->vec = __pyx_v_newvec; /* "petsc4py/PETSc/Vec.pyx":286 * CHKERR( VecSetType(newvec, VECSEQ) ) * CHKERR( PetscCLEAR(self.obj) ); self.vec = newvec * return self # <<<<<<<<<<<<<< * * def createMPI( */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":251 * * # FIXME the comm argument is hideous. * def createSeq( # <<<<<<<<<<<<<< * self, * size: LayoutSizeSpec, */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.createSeq", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":288 * return self * * def createMPI( # <<<<<<<<<<<<<< * self, * size: LayoutSizeSpec, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_65createMPI(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_64createMPI, "Vec.createMPI(self, size: LayoutSizeSpec, bsize: int | None = None, comm: Comm | None = None) -> Self\nCreate a parallel `Type.MPI` vector.\n\n Collective.\n\n Parameters\n ----------\n size\n Vector size.\n bsize\n Vector block size. If `None`, ``bsize = 1``.\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n createSeq, petsc.VecCreateMPI\n\n \nSource code at petsc4py/PETSc/Vec.pyx:288"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_65createMPI(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_size = 0; PyObject *__pyx_v_bsize = 0; PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createMPI (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_bsize,&__pyx_n_s_comm,0}; /* "petsc4py/PETSc/Vec.pyx":291 * self, * size: LayoutSizeSpec, * bsize: int | None = None, # <<<<<<<<<<<<<< * comm: Comm | None = None, * ) -> Self: */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Vec.pyx":292 * size: LayoutSizeSpec, * bsize: int | None = None, * comm: Comm | None = None, # <<<<<<<<<<<<<< * ) -> Self: * """Create a parallel `Type.MPI` vector. */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 288, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_bsize); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 288, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 288, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createMPI") < 0)) __PYX_ERR(41, 288, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_size = values[0]; __pyx_v_bsize = values[1]; __pyx_v_comm = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createMPI", 0, 1, 3, __pyx_nargs); __PYX_ERR(41, 288, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.createMPI", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_64createMPI(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_size, __pyx_v_bsize, __pyx_v_comm); /* "petsc4py/PETSc/Vec.pyx":288 * return self * * def createMPI( # <<<<<<<<<<<<<< * self, * size: LayoutSizeSpec, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_64createMPI(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PetscInt __pyx_v_bs; PetscInt __pyx_v_n; PetscInt __pyx_v_N; Vec __pyx_v_newvec; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; int __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createMPI", 1); /* "petsc4py/PETSc/Vec.pyx":312 * * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscInt bs=0, n=0, N=0 * Vec_Sizes(size, bsize, &bs, &n, &N) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(41, 312, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/Vec.pyx":313 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt bs=0, n=0, N=0 # <<<<<<<<<<<<<< * Vec_Sizes(size, bsize, &bs, &n, &N) * Sys_Layout(ccomm, bs, &n, &N) */ __pyx_v_bs = 0; __pyx_v_n = 0; __pyx_v_N = 0; /* "petsc4py/PETSc/Vec.pyx":314 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt bs=0, n=0, N=0 * Vec_Sizes(size, bsize, &bs, &n, &N) # <<<<<<<<<<<<<< * Sys_Layout(ccomm, bs, &n, &N) * if bs == PETSC_DECIDE: bs = 1 */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_Vec_Sizes(__pyx_v_size, __pyx_v_bsize, (&__pyx_v_bs), (&__pyx_v_n), (&__pyx_v_N)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(41, 314, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":315 * cdef PetscInt bs=0, n=0, N=0 * Vec_Sizes(size, bsize, &bs, &n, &N) * Sys_Layout(ccomm, bs, &n, &N) # <<<<<<<<<<<<<< * if bs == PETSC_DECIDE: bs = 1 * cdef PetscVec newvec = NULL */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_Sys_Layout(__pyx_v_ccomm, __pyx_v_bs, (&__pyx_v_n), (&__pyx_v_N)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 315, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":316 * Vec_Sizes(size, bsize, &bs, &n, &N) * Sys_Layout(ccomm, bs, &n, &N) * if bs == PETSC_DECIDE: bs = 1 # <<<<<<<<<<<<<< * cdef PetscVec newvec = NULL * CHKERR( VecCreate(ccomm, &newvec) ) */ __pyx_t_4 = (__pyx_v_bs == PETSC_DECIDE); if (__pyx_t_4) { __pyx_v_bs = 1; } /* "petsc4py/PETSc/Vec.pyx":317 * Sys_Layout(ccomm, bs, &n, &N) * if bs == PETSC_DECIDE: bs = 1 * cdef PetscVec newvec = NULL # <<<<<<<<<<<<<< * CHKERR( VecCreate(ccomm, &newvec) ) * CHKERR( VecSetSizes(newvec, n, N) ) */ __pyx_v_newvec = NULL; /* "petsc4py/PETSc/Vec.pyx":318 * if bs == PETSC_DECIDE: bs = 1 * cdef PetscVec newvec = NULL * CHKERR( VecCreate(ccomm, &newvec) ) # <<<<<<<<<<<<<< * CHKERR( VecSetSizes(newvec, n, N) ) * CHKERR( VecSetBlockSize(newvec, bs) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCreate(__pyx_v_ccomm, (&__pyx_v_newvec))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 318, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":319 * cdef PetscVec newvec = NULL * CHKERR( VecCreate(ccomm, &newvec) ) * CHKERR( VecSetSizes(newvec, n, N) ) # <<<<<<<<<<<<<< * CHKERR( VecSetBlockSize(newvec, bs) ) * CHKERR( VecSetType(newvec, VECMPI) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecSetSizes(__pyx_v_newvec, __pyx_v_n, __pyx_v_N)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 319, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":320 * CHKERR( VecCreate(ccomm, &newvec) ) * CHKERR( VecSetSizes(newvec, n, N) ) * CHKERR( VecSetBlockSize(newvec, bs) ) # <<<<<<<<<<<<<< * CHKERR( VecSetType(newvec, VECMPI) ) * CHKERR( PetscCLEAR(self.obj) ); self.vec = newvec */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecSetBlockSize(__pyx_v_newvec, __pyx_v_bs)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 320, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":321 * CHKERR( VecSetSizes(newvec, n, N) ) * CHKERR( VecSetBlockSize(newvec, bs) ) * CHKERR( VecSetType(newvec, VECMPI) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.vec = newvec * return self */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecSetType(__pyx_v_newvec, VECMPI)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 321, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":322 * CHKERR( VecSetBlockSize(newvec, bs) ) * CHKERR( VecSetType(newvec, VECMPI) ) * CHKERR( PetscCLEAR(self.obj) ); self.vec = newvec # <<<<<<<<<<<<<< * return self * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 322, __pyx_L1_error) __pyx_v_self->vec = __pyx_v_newvec; /* "petsc4py/PETSc/Vec.pyx":323 * CHKERR( VecSetType(newvec, VECMPI) ) * CHKERR( PetscCLEAR(self.obj) ); self.vec = newvec * return self # <<<<<<<<<<<<<< * * def createWithArray( */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":288 * return self * * def createMPI( # <<<<<<<<<<<<<< * self, * size: LayoutSizeSpec, */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.createMPI", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":325 * return self * * def createWithArray( # <<<<<<<<<<<<<< * self, * array: Sequence[Scalar], */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_67createWithArray(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_66createWithArray, "Vec.createWithArray(self, array: Sequence[Scalar], size: LayoutSizeSpec | None = None, bsize: int | None = None, comm: Comm | None = None) -> Self\nCreate a vector using a provided array.\n\n Collective.\n\n This method will create either a `Type.SEQ` or `Type.MPI`\n depending on the size of the communicator.\n\n Parameters\n ----------\n array\n Array to store the vector values. Must be at least as large as\n the local size of the vector.\n size\n Vector size.\n bsize\n Vector block size. If `None`, ``bsize = 1``.\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n petsc.VecCreateSeqWithArray, petsc.VecCreateMPIWithArray\n\n \nSource code at petsc4py/PETSc/Vec.pyx:325"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_67createWithArray(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_array = 0; PyObject *__pyx_v_size = 0; PyObject *__pyx_v_bsize = 0; PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createWithArray (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_array,&__pyx_n_s_size,&__pyx_n_s_bsize,&__pyx_n_s_comm,0}; /* "petsc4py/PETSc/Vec.pyx":328 * self, * array: Sequence[Scalar], * size: LayoutSizeSpec | None = None, # <<<<<<<<<<<<<< * bsize: int | None = None, * comm: Comm | None = None, */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Vec.pyx":329 * array: Sequence[Scalar], * size: LayoutSizeSpec | None = None, * bsize: int | None = None, # <<<<<<<<<<<<<< * comm: Comm | None = None, * ) -> Self: */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Vec.pyx":330 * size: LayoutSizeSpec | None = None, * bsize: int | None = None, * comm: Comm | None = None, # <<<<<<<<<<<<<< * ) -> Self: * """Create a vector using a provided array. */ values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_array)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 325, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 325, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_bsize); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 325, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 325, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createWithArray") < 0)) __PYX_ERR(41, 325, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_array = values[0]; __pyx_v_size = values[1]; __pyx_v_bsize = values[2]; __pyx_v_comm = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createWithArray", 0, 1, 4, __pyx_nargs); __PYX_ERR(41, 325, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.createWithArray", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_66createWithArray(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_array, __pyx_v_size, __pyx_v_bsize, __pyx_v_comm); /* "petsc4py/PETSc/Vec.pyx":325 * return self * * def createWithArray( # <<<<<<<<<<<<<< * self, * array: Sequence[Scalar], */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_66createWithArray(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_array, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PyObject *__pyx_v_comm) { PetscInt __pyx_v_na; PetscScalar *__pyx_v_sa; MPI_Comm __pyx_v_ccomm; PetscInt __pyx_v_bs; PetscInt __pyx_v_n; PetscInt __pyx_v_N; Vec __pyx_v_newvec; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; MPI_Comm __pyx_t_5; int __pyx_t_6; PetscErrorCode __pyx_t_7; PyObject *__pyx_t_8 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createWithArray", 0); __Pyx_INCREF(__pyx_v_array); __Pyx_INCREF(__pyx_v_size); /* "petsc4py/PETSc/Vec.pyx":356 * * """ * cdef PetscInt na=0 # <<<<<<<<<<<<<< * cdef PetscScalar *sa=NULL * array = iarray_s(array, &na, &sa) */ __pyx_v_na = 0; /* "petsc4py/PETSc/Vec.pyx":357 * """ * cdef PetscInt na=0 * cdef PetscScalar *sa=NULL # <<<<<<<<<<<<<< * array = iarray_s(array, &na, &sa) * if size is None: size = (toInt(na), toInt(PETSC_DECIDE)) */ __pyx_v_sa = NULL; /* "petsc4py/PETSc/Vec.pyx":358 * cdef PetscInt na=0 * cdef PetscScalar *sa=NULL * array = iarray_s(array, &na, &sa) # <<<<<<<<<<<<<< * if size is None: size = (toInt(na), toInt(PETSC_DECIDE)) * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_s(__pyx_v_array, (&__pyx_v_na), (&__pyx_v_sa))); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_array, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Vec.pyx":359 * cdef PetscScalar *sa=NULL * array = iarray_s(array, &na, &sa) * if size is None: size = (toInt(na), toInt(PETSC_DECIDE)) # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt bs=0, n=0, N=0 */ __pyx_t_2 = (__pyx_v_size == Py_None); if (__pyx_t_2) { __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_na); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(PETSC_DECIDE); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1)) __PYX_ERR(41, 359, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(41, 359, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_size, __pyx_t_4); __pyx_t_4 = 0; } /* "petsc4py/PETSc/Vec.pyx":360 * array = iarray_s(array, &na, &sa) * if size is None: size = (toInt(na), toInt(PETSC_DECIDE)) * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscInt bs=0, n=0, N=0 * Vec_Sizes(size, bsize, &bs, &n, &N) */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_5 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(41, 360, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_5; /* "petsc4py/PETSc/Vec.pyx":361 * if size is None: size = (toInt(na), toInt(PETSC_DECIDE)) * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt bs=0, n=0, N=0 # <<<<<<<<<<<<<< * Vec_Sizes(size, bsize, &bs, &n, &N) * Sys_Layout(ccomm, bs, &n, &N) */ __pyx_v_bs = 0; __pyx_v_n = 0; __pyx_v_N = 0; /* "petsc4py/PETSc/Vec.pyx":362 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt bs=0, n=0, N=0 * Vec_Sizes(size, bsize, &bs, &n, &N) # <<<<<<<<<<<<<< * Sys_Layout(ccomm, bs, &n, &N) * if bs == PETSC_DECIDE: bs = 1 */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_Vec_Sizes(__pyx_v_size, __pyx_v_bsize, (&__pyx_v_bs), (&__pyx_v_n), (&__pyx_v_N)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(41, 362, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":363 * cdef PetscInt bs=0, n=0, N=0 * Vec_Sizes(size, bsize, &bs, &n, &N) * Sys_Layout(ccomm, bs, &n, &N) # <<<<<<<<<<<<<< * if bs == PETSC_DECIDE: bs = 1 * if na < n: raise ValueError( */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_Sys_Layout(__pyx_v_ccomm, __pyx_v_bs, (&__pyx_v_n), (&__pyx_v_N)); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 363, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":364 * Vec_Sizes(size, bsize, &bs, &n, &N) * Sys_Layout(ccomm, bs, &n, &N) * if bs == PETSC_DECIDE: bs = 1 # <<<<<<<<<<<<<< * if na < n: raise ValueError( * "array size %d and vector local size %d block size %d" % */ __pyx_t_2 = (__pyx_v_bs == PETSC_DECIDE); if (__pyx_t_2) { __pyx_v_bs = 1; } /* "petsc4py/PETSc/Vec.pyx":365 * Sys_Layout(ccomm, bs, &n, &N) * if bs == PETSC_DECIDE: bs = 1 * if na < n: raise ValueError( # <<<<<<<<<<<<<< * "array size %d and vector local size %d block size %d" % * (toInt(na), toInt(n), toInt(bs))) */ __pyx_t_2 = (__pyx_v_na < __pyx_v_n); if (unlikely(__pyx_t_2)) { /* "petsc4py/PETSc/Vec.pyx":367 * if na < n: raise ValueError( * "array size %d and vector local size %d block size %d" % * (toInt(na), toInt(n), toInt(bs))) # <<<<<<<<<<<<<< * cdef PetscVec newvec = NULL * if comm_size(ccomm) == 1: */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_na); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_bs); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(41, 367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4)) __PYX_ERR(41, 367, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_3)) __PYX_ERR(41, 367, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_1)) __PYX_ERR(41, 367, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_3 = 0; __pyx_t_1 = 0; /* "petsc4py/PETSc/Vec.pyx":366 * if bs == PETSC_DECIDE: bs = 1 * if na < n: raise ValueError( * "array size %d and vector local size %d block size %d" % # <<<<<<<<<<<<<< * (toInt(na), toInt(n), toInt(bs))) * cdef PetscVec newvec = NULL */ __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_array_size_d_and_vector_local_si, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "petsc4py/PETSc/Vec.pyx":365 * Sys_Layout(ccomm, bs, &n, &N) * if bs == PETSC_DECIDE: bs = 1 * if na < n: raise ValueError( # <<<<<<<<<<<<<< * "array size %d and vector local size %d block size %d" % * (toInt(na), toInt(n), toInt(bs))) */ __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(41, 365, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __PYX_ERR(41, 365, __pyx_L1_error) } /* "petsc4py/PETSc/Vec.pyx":368 * "array size %d and vector local size %d block size %d" % * (toInt(na), toInt(n), toInt(bs))) * cdef PetscVec newvec = NULL # <<<<<<<<<<<<<< * if comm_size(ccomm) == 1: * CHKERR( VecCreateSeqWithArray(ccomm,bs,N,sa,&newvec) ) */ __pyx_v_newvec = NULL; /* "petsc4py/PETSc/Vec.pyx":369 * (toInt(na), toInt(n), toInt(bs))) * cdef PetscVec newvec = NULL * if comm_size(ccomm) == 1: # <<<<<<<<<<<<<< * CHKERR( VecCreateSeqWithArray(ccomm,bs,N,sa,&newvec) ) * else: */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_comm_size(__pyx_v_ccomm); if (unlikely(__pyx_t_6 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(41, 369, __pyx_L1_error) __pyx_t_2 = (__pyx_t_6 == 1); if (__pyx_t_2) { /* "petsc4py/PETSc/Vec.pyx":370 * cdef PetscVec newvec = NULL * if comm_size(ccomm) == 1: * CHKERR( VecCreateSeqWithArray(ccomm,bs,N,sa,&newvec) ) # <<<<<<<<<<<<<< * else: * CHKERR( VecCreateMPIWithArray(ccomm,bs,n,N,sa,&newvec) ) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCreateSeqWithArray(__pyx_v_ccomm, __pyx_v_bs, __pyx_v_N, __pyx_v_sa, (&__pyx_v_newvec))); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 370, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":369 * (toInt(na), toInt(n), toInt(bs))) * cdef PetscVec newvec = NULL * if comm_size(ccomm) == 1: # <<<<<<<<<<<<<< * CHKERR( VecCreateSeqWithArray(ccomm,bs,N,sa,&newvec) ) * else: */ goto __pyx_L6; } /* "petsc4py/PETSc/Vec.pyx":372 * CHKERR( VecCreateSeqWithArray(ccomm,bs,N,sa,&newvec) ) * else: * CHKERR( VecCreateMPIWithArray(ccomm,bs,n,N,sa,&newvec) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.vec = newvec * self.set_attr('__array__', array) */ /*else*/ { __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCreateMPIWithArray(__pyx_v_ccomm, __pyx_v_bs, __pyx_v_n, __pyx_v_N, __pyx_v_sa, (&__pyx_v_newvec))); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 372, __pyx_L1_error) } __pyx_L6:; /* "petsc4py/PETSc/Vec.pyx":373 * else: * CHKERR( VecCreateMPIWithArray(ccomm,bs,n,N,sa,&newvec) ) * CHKERR( PetscCLEAR(self.obj) ); self.vec = newvec # <<<<<<<<<<<<<< * self.set_attr('__array__', array) * return self */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 373, __pyx_L1_error) __pyx_v_self->vec = __pyx_v_newvec; /* "petsc4py/PETSc/Vec.pyx":374 * CHKERR( VecCreateMPIWithArray(ccomm,bs,n,N,sa,&newvec) ) * CHKERR( PetscCLEAR(self.obj) ); self.vec = newvec * self.set_attr('__array__', array) # <<<<<<<<<<<<<< * return self * */ __pyx_t_8 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Vec *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__array__"), __pyx_v_array); if (unlikely(!__pyx_t_8)) __PYX_ERR(41, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "petsc4py/PETSc/Vec.pyx":375 * CHKERR( PetscCLEAR(self.obj) ); self.vec = newvec * self.set_attr('__array__', array) * return self # <<<<<<<<<<<<<< * * def createCUDAWithArrays( */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":325 * return self * * def createWithArray( # <<<<<<<<<<<<<< * self, * array: Sequence[Scalar], */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("petsc4py.PETSc.Vec.createWithArray", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_array); __Pyx_XDECREF(__pyx_v_size); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":377 * return self * * def createCUDAWithArrays( # <<<<<<<<<<<<<< * self, * cpuarray: Sequence[Scalar] | None = None, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_69createCUDAWithArrays(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_68createCUDAWithArrays, "Vec.createCUDAWithArrays(self, cpuarray: Sequence[Scalar] | None = None, cudahandle: Any | None = None, size: LayoutSizeSpec | None = None, bsize: int | None = None, comm: Comm | None = None) -> Self\nCreate a `Type.CUDA` vector with optional arrays.\n\n Collective.\n\n Parameters\n ----------\n cpuarray\n Host array. Will be lazily allocated if not provided.\n cudahandle\n Address of the array on the GPU. Will be lazily allocated if\n not provided.\n size\n Vector size.\n bsize\n Vector block size. If `None`, ``bsize = 1``.\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n petsc.VecCreateSeqCUDAWithArrays, petsc.VecCreateMPICUDAWithArrays\n\n \nSource code at petsc4py/PETSc/Vec.pyx:377"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_69createCUDAWithArrays(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_cpuarray = 0; PyObject *__pyx_v_cudahandle = 0; PyObject *__pyx_v_size = 0; PyObject *__pyx_v_bsize = 0; PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createCUDAWithArrays (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cpuarray,&__pyx_n_s_cudahandle,&__pyx_n_s_size,&__pyx_n_s_bsize,&__pyx_n_s_comm,0}; /* "petsc4py/PETSc/Vec.pyx":379 * def createCUDAWithArrays( * self, * cpuarray: Sequence[Scalar] | None = None, # <<<<<<<<<<<<<< * cudahandle: Any | None = None, # FIXME What type is appropriate here? * size: LayoutSizeSpec | None = None, */ values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Vec.pyx":380 * self, * cpuarray: Sequence[Scalar] | None = None, * cudahandle: Any | None = None, # FIXME What type is appropriate here? # <<<<<<<<<<<<<< * size: LayoutSizeSpec | None = None, * bsize: int | None = None, */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Vec.pyx":381 * cpuarray: Sequence[Scalar] | None = None, * cudahandle: Any | None = None, # FIXME What type is appropriate here? * size: LayoutSizeSpec | None = None, # <<<<<<<<<<<<<< * bsize: int | None = None, * comm: Comm | None = None, */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Vec.pyx":382 * cudahandle: Any | None = None, # FIXME What type is appropriate here? * size: LayoutSizeSpec | None = None, * bsize: int | None = None, # <<<<<<<<<<<<<< * comm: Comm | None = None, * ) -> Self: */ values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Vec.pyx":383 * size: LayoutSizeSpec | None = None, * bsize: int | None = None, * comm: Comm | None = None, # <<<<<<<<<<<<<< * ) -> Self: * """Create a `Type.CUDA` vector with optional arrays. */ values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_cpuarray); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 377, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_cudahandle); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 377, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 377, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_bsize); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 377, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 377, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createCUDAWithArrays") < 0)) __PYX_ERR(41, 377, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_cpuarray = values[0]; __pyx_v_cudahandle = values[1]; __pyx_v_size = values[2]; __pyx_v_bsize = values[3]; __pyx_v_comm = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createCUDAWithArrays", 0, 0, 5, __pyx_nargs); __PYX_ERR(41, 377, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.createCUDAWithArrays", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_68createCUDAWithArrays(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_cpuarray, __pyx_v_cudahandle, __pyx_v_size, __pyx_v_bsize, __pyx_v_comm); /* "petsc4py/PETSc/Vec.pyx":377 * return self * * def createCUDAWithArrays( # <<<<<<<<<<<<<< * self, * cpuarray: Sequence[Scalar] | None = None, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_68createCUDAWithArrays(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_cpuarray, PyObject *__pyx_v_cudahandle, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PyObject *__pyx_v_comm) { PetscInt __pyx_v_na; PetscScalar *__pyx_v_sa; PetscScalar *__pyx_v_gpuarray; MPI_Comm __pyx_v_ccomm; PetscInt __pyx_v_bs; PetscInt __pyx_v_n; PetscInt __pyx_v_N; Vec __pyx_v_newvec; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; Py_uintptr_t __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; MPI_Comm __pyx_t_6; int __pyx_t_7; PetscErrorCode __pyx_t_8; PyObject *__pyx_t_9 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createCUDAWithArrays", 0); __Pyx_INCREF(__pyx_v_cpuarray); __Pyx_INCREF(__pyx_v_size); /* "petsc4py/PETSc/Vec.pyx":408 * * """ * cdef PetscInt na=0 # <<<<<<<<<<<<<< * cdef PetscScalar *sa=NULL * cdef PetscScalar *gpuarray = NULL */ __pyx_v_na = 0; /* "petsc4py/PETSc/Vec.pyx":409 * """ * cdef PetscInt na=0 * cdef PetscScalar *sa=NULL # <<<<<<<<<<<<<< * cdef PetscScalar *gpuarray = NULL * if cudahandle: */ __pyx_v_sa = NULL; /* "petsc4py/PETSc/Vec.pyx":410 * cdef PetscInt na=0 * cdef PetscScalar *sa=NULL * cdef PetscScalar *gpuarray = NULL # <<<<<<<<<<<<<< * if cudahandle: * gpuarray = (cudahandle) */ __pyx_v_gpuarray = NULL; /* "petsc4py/PETSc/Vec.pyx":411 * cdef PetscScalar *sa=NULL * cdef PetscScalar *gpuarray = NULL * if cudahandle: # <<<<<<<<<<<<<< * gpuarray = (cudahandle) * if cpuarray is not None: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_cudahandle); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(41, 411, __pyx_L1_error) if (__pyx_t_1) { /* "petsc4py/PETSc/Vec.pyx":412 * cdef PetscScalar *gpuarray = NULL * if cudahandle: * gpuarray = (cudahandle) # <<<<<<<<<<<<<< * if cpuarray is not None: * cpuarray = iarray_s(cpuarray, &na, &sa) */ __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_cudahandle); if (unlikely((__pyx_t_2 == ((Py_uintptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(41, 412, __pyx_L1_error) __pyx_v_gpuarray = ((PetscScalar *)((Py_uintptr_t)__pyx_t_2)); /* "petsc4py/PETSc/Vec.pyx":411 * cdef PetscScalar *sa=NULL * cdef PetscScalar *gpuarray = NULL * if cudahandle: # <<<<<<<<<<<<<< * gpuarray = (cudahandle) * if cpuarray is not None: */ } /* "petsc4py/PETSc/Vec.pyx":413 * if cudahandle: * gpuarray = (cudahandle) * if cpuarray is not None: # <<<<<<<<<<<<<< * cpuarray = iarray_s(cpuarray, &na, &sa) * */ __pyx_t_1 = (__pyx_v_cpuarray != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/Vec.pyx":414 * gpuarray = (cudahandle) * if cpuarray is not None: * cpuarray = iarray_s(cpuarray, &na, &sa) # <<<<<<<<<<<<<< * * if size is None: size = (toInt(na), toInt(PETSC_DECIDE)) */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_s(__pyx_v_cpuarray, (&__pyx_v_na), (&__pyx_v_sa))); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_cpuarray, __pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/Vec.pyx":413 * if cudahandle: * gpuarray = (cudahandle) * if cpuarray is not None: # <<<<<<<<<<<<<< * cpuarray = iarray_s(cpuarray, &na, &sa) * */ } /* "petsc4py/PETSc/Vec.pyx":416 * cpuarray = iarray_s(cpuarray, &na, &sa) * * if size is None: size = (toInt(na), toInt(PETSC_DECIDE)) # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt bs=0, n=0, N=0 */ __pyx_t_1 = (__pyx_v_size == Py_None); if (__pyx_t_1) { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_na); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(PETSC_DECIDE); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(41, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3)) __PYX_ERR(41, 416, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4)) __PYX_ERR(41, 416, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_size, __pyx_t_5); __pyx_t_5 = 0; } /* "petsc4py/PETSc/Vec.pyx":417 * * if size is None: size = (toInt(na), toInt(PETSC_DECIDE)) * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscInt bs=0, n=0, N=0 * Vec_Sizes(size, bsize, &bs, &n, &N) */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_6 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(41, 417, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_6; /* "petsc4py/PETSc/Vec.pyx":418 * if size is None: size = (toInt(na), toInt(PETSC_DECIDE)) * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt bs=0, n=0, N=0 # <<<<<<<<<<<<<< * Vec_Sizes(size, bsize, &bs, &n, &N) * Sys_Layout(ccomm, bs, &n, &N) */ __pyx_v_bs = 0; __pyx_v_n = 0; __pyx_v_N = 0; /* "petsc4py/PETSc/Vec.pyx":419 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt bs=0, n=0, N=0 * Vec_Sizes(size, bsize, &bs, &n, &N) # <<<<<<<<<<<<<< * Sys_Layout(ccomm, bs, &n, &N) * if bs == PETSC_DECIDE: bs = 1 */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_Vec_Sizes(__pyx_v_size, __pyx_v_bsize, (&__pyx_v_bs), (&__pyx_v_n), (&__pyx_v_N)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(41, 419, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":420 * cdef PetscInt bs=0, n=0, N=0 * Vec_Sizes(size, bsize, &bs, &n, &N) * Sys_Layout(ccomm, bs, &n, &N) # <<<<<<<<<<<<<< * if bs == PETSC_DECIDE: bs = 1 * if na < n: raise ValueError( */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_Sys_Layout(__pyx_v_ccomm, __pyx_v_bs, (&__pyx_v_n), (&__pyx_v_N)); if (unlikely(__pyx_t_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 420, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":421 * Vec_Sizes(size, bsize, &bs, &n, &N) * Sys_Layout(ccomm, bs, &n, &N) * if bs == PETSC_DECIDE: bs = 1 # <<<<<<<<<<<<<< * if na < n: raise ValueError( * "array size %d and vector local size %d block size %d" % */ __pyx_t_1 = (__pyx_v_bs == PETSC_DECIDE); if (__pyx_t_1) { __pyx_v_bs = 1; } /* "petsc4py/PETSc/Vec.pyx":422 * Sys_Layout(ccomm, bs, &n, &N) * if bs == PETSC_DECIDE: bs = 1 * if na < n: raise ValueError( # <<<<<<<<<<<<<< * "array size %d and vector local size %d block size %d" % * (toInt(na), toInt(n), toInt(bs))) */ __pyx_t_1 = (__pyx_v_na < __pyx_v_n); if (unlikely(__pyx_t_1)) { /* "petsc4py/PETSc/Vec.pyx":424 * if na < n: raise ValueError( * "array size %d and vector local size %d block size %d" % * (toInt(na), toInt(n), toInt(bs))) # <<<<<<<<<<<<<< * cdef PetscVec newvec = NULL * if comm_size(ccomm) == 1: */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_na); if (unlikely(!__pyx_t_5)) __PYX_ERR(41, 424, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 424, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_bs); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 424, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(41, 424, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5)) __PYX_ERR(41, 424, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_4)) __PYX_ERR(41, 424, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_3)) __PYX_ERR(41, 424, __pyx_L1_error); __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_3 = 0; /* "petsc4py/PETSc/Vec.pyx":423 * if bs == PETSC_DECIDE: bs = 1 * if na < n: raise ValueError( * "array size %d and vector local size %d block size %d" % # <<<<<<<<<<<<<< * (toInt(na), toInt(n), toInt(bs))) * cdef PetscVec newvec = NULL */ __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_array_size_d_and_vector_local_si, __pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "petsc4py/PETSc/Vec.pyx":422 * Sys_Layout(ccomm, bs, &n, &N) * if bs == PETSC_DECIDE: bs = 1 * if na < n: raise ValueError( # <<<<<<<<<<<<<< * "array size %d and vector local size %d block size %d" % * (toInt(na), toInt(n), toInt(bs))) */ __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(41, 422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __PYX_ERR(41, 422, __pyx_L1_error) } /* "petsc4py/PETSc/Vec.pyx":425 * "array size %d and vector local size %d block size %d" % * (toInt(na), toInt(n), toInt(bs))) * cdef PetscVec newvec = NULL # <<<<<<<<<<<<<< * if comm_size(ccomm) == 1: * CHKERR( VecCreateSeqCUDAWithArrays(ccomm,bs,N,sa,gpuarray,&newvec) ) */ __pyx_v_newvec = NULL; /* "petsc4py/PETSc/Vec.pyx":426 * (toInt(na), toInt(n), toInt(bs))) * cdef PetscVec newvec = NULL * if comm_size(ccomm) == 1: # <<<<<<<<<<<<<< * CHKERR( VecCreateSeqCUDAWithArrays(ccomm,bs,N,sa,gpuarray,&newvec) ) * else: */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_comm_size(__pyx_v_ccomm); if (unlikely(__pyx_t_7 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(41, 426, __pyx_L1_error) __pyx_t_1 = (__pyx_t_7 == 1); if (__pyx_t_1) { /* "petsc4py/PETSc/Vec.pyx":427 * cdef PetscVec newvec = NULL * if comm_size(ccomm) == 1: * CHKERR( VecCreateSeqCUDAWithArrays(ccomm,bs,N,sa,gpuarray,&newvec) ) # <<<<<<<<<<<<<< * else: * CHKERR( VecCreateMPICUDAWithArrays(ccomm,bs,n,N,sa,gpuarray,&newvec) ) */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCreateSeqCUDAWithArrays(__pyx_v_ccomm, __pyx_v_bs, __pyx_v_N, __pyx_v_sa, __pyx_v_gpuarray, (&__pyx_v_newvec))); if (unlikely(__pyx_t_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 427, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":426 * (toInt(na), toInt(n), toInt(bs))) * cdef PetscVec newvec = NULL * if comm_size(ccomm) == 1: # <<<<<<<<<<<<<< * CHKERR( VecCreateSeqCUDAWithArrays(ccomm,bs,N,sa,gpuarray,&newvec) ) * else: */ goto __pyx_L8; } /* "petsc4py/PETSc/Vec.pyx":429 * CHKERR( VecCreateSeqCUDAWithArrays(ccomm,bs,N,sa,gpuarray,&newvec) ) * else: * CHKERR( VecCreateMPICUDAWithArrays(ccomm,bs,n,N,sa,gpuarray,&newvec) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.vec = newvec * */ /*else*/ { __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCreateMPICUDAWithArrays(__pyx_v_ccomm, __pyx_v_bs, __pyx_v_n, __pyx_v_N, __pyx_v_sa, __pyx_v_gpuarray, (&__pyx_v_newvec))); if (unlikely(__pyx_t_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 429, __pyx_L1_error) } __pyx_L8:; /* "petsc4py/PETSc/Vec.pyx":430 * else: * CHKERR( VecCreateMPICUDAWithArrays(ccomm,bs,n,N,sa,gpuarray,&newvec) ) * CHKERR( PetscCLEAR(self.obj) ); self.vec = newvec # <<<<<<<<<<<<<< * * if cpuarray is not None: */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 430, __pyx_L1_error) __pyx_v_self->vec = __pyx_v_newvec; /* "petsc4py/PETSc/Vec.pyx":432 * CHKERR( PetscCLEAR(self.obj) ); self.vec = newvec * * if cpuarray is not None: # <<<<<<<<<<<<<< * self.set_attr('__array__', cpuarray) * return self */ __pyx_t_1 = (__pyx_v_cpuarray != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/Vec.pyx":433 * * if cpuarray is not None: * self.set_attr('__array__', cpuarray) # <<<<<<<<<<<<<< * return self * */ __pyx_t_9 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Vec *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__array__"), __pyx_v_cpuarray); if (unlikely(!__pyx_t_9)) __PYX_ERR(41, 433, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "petsc4py/PETSc/Vec.pyx":432 * CHKERR( PetscCLEAR(self.obj) ); self.vec = newvec * * if cpuarray is not None: # <<<<<<<<<<<<<< * self.set_attr('__array__', cpuarray) * return self */ } /* "petsc4py/PETSc/Vec.pyx":434 * if cpuarray is not None: * self.set_attr('__array__', cpuarray) * return self # <<<<<<<<<<<<<< * * def createHIPWithArrays( */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":377 * return self * * def createCUDAWithArrays( # <<<<<<<<<<<<<< * self, * cpuarray: Sequence[Scalar] | None = None, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("petsc4py.PETSc.Vec.createCUDAWithArrays", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_cpuarray); __Pyx_XDECREF(__pyx_v_size); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":436 * return self * * def createHIPWithArrays( # <<<<<<<<<<<<<< * self, * cpuarray: Sequence[Scalar] | None = None, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_71createHIPWithArrays(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_70createHIPWithArrays, "Vec.createHIPWithArrays(self, cpuarray: Sequence[Scalar] | None = None, hiphandle: Any | None = None, size: LayoutSizeSpec | None = None, bsize: int | None = None, comm: Comm | None = None) -> Self\nCreate a `Type.HIP` vector with optional arrays.\n\n Collective.\n\n Parameters\n ----------\n cpuarray\n Host array. Will be lazily allocated if not provided.\n hiphandle\n Address of the array on the GPU. Will be lazily allocated if\n not provided.\n size\n Vector size.\n bsize\n Vector block size. If `None`, ``bsize = 1``.\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n petsc.VecCreateSeqHIPWithArrays, petsc.VecCreateMPIHIPWithArrays\n\n \nSource code at petsc4py/PETSc/Vec.pyx:436"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_71createHIPWithArrays(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_cpuarray = 0; PyObject *__pyx_v_hiphandle = 0; PyObject *__pyx_v_size = 0; PyObject *__pyx_v_bsize = 0; PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createHIPWithArrays (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cpuarray,&__pyx_n_s_hiphandle,&__pyx_n_s_size,&__pyx_n_s_bsize,&__pyx_n_s_comm,0}; /* "petsc4py/PETSc/Vec.pyx":438 * def createHIPWithArrays( * self, * cpuarray: Sequence[Scalar] | None = None, # <<<<<<<<<<<<<< * hiphandle: Any | None = None, # FIXME What type is appropriate here? * size: LayoutSizeSpec | None = None, */ values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Vec.pyx":439 * self, * cpuarray: Sequence[Scalar] | None = None, * hiphandle: Any | None = None, # FIXME What type is appropriate here? # <<<<<<<<<<<<<< * size: LayoutSizeSpec | None = None, * bsize: int | None = None, */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Vec.pyx":440 * cpuarray: Sequence[Scalar] | None = None, * hiphandle: Any | None = None, # FIXME What type is appropriate here? * size: LayoutSizeSpec | None = None, # <<<<<<<<<<<<<< * bsize: int | None = None, * comm: Comm | None = None, */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Vec.pyx":441 * hiphandle: Any | None = None, # FIXME What type is appropriate here? * size: LayoutSizeSpec | None = None, * bsize: int | None = None, # <<<<<<<<<<<<<< * comm: Comm | None = None, * ) -> Self: */ values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Vec.pyx":442 * size: LayoutSizeSpec | None = None, * bsize: int | None = None, * comm: Comm | None = None, # <<<<<<<<<<<<<< * ) -> Self: * """Create a `Type.HIP` vector with optional arrays. */ values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_cpuarray); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 436, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_hiphandle); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 436, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 436, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_bsize); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 436, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 436, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createHIPWithArrays") < 0)) __PYX_ERR(41, 436, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_cpuarray = values[0]; __pyx_v_hiphandle = values[1]; __pyx_v_size = values[2]; __pyx_v_bsize = values[3]; __pyx_v_comm = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createHIPWithArrays", 0, 0, 5, __pyx_nargs); __PYX_ERR(41, 436, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.createHIPWithArrays", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_70createHIPWithArrays(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_cpuarray, __pyx_v_hiphandle, __pyx_v_size, __pyx_v_bsize, __pyx_v_comm); /* "petsc4py/PETSc/Vec.pyx":436 * return self * * def createHIPWithArrays( # <<<<<<<<<<<<<< * self, * cpuarray: Sequence[Scalar] | None = None, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_70createHIPWithArrays(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_cpuarray, PyObject *__pyx_v_hiphandle, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PyObject *__pyx_v_comm) { PetscInt __pyx_v_na; PetscScalar *__pyx_v_sa; PetscScalar *__pyx_v_gpuarray; MPI_Comm __pyx_v_ccomm; PetscInt __pyx_v_bs; PetscInt __pyx_v_n; PetscInt __pyx_v_N; Vec __pyx_v_newvec; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; Py_uintptr_t __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; MPI_Comm __pyx_t_6; int __pyx_t_7; PetscErrorCode __pyx_t_8; PyObject *__pyx_t_9 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createHIPWithArrays", 0); __Pyx_INCREF(__pyx_v_cpuarray); __Pyx_INCREF(__pyx_v_size); /* "petsc4py/PETSc/Vec.pyx":467 * * """ * cdef PetscInt na=0 # <<<<<<<<<<<<<< * cdef PetscScalar *sa=NULL * cdef PetscScalar *gpuarray = NULL */ __pyx_v_na = 0; /* "petsc4py/PETSc/Vec.pyx":468 * """ * cdef PetscInt na=0 * cdef PetscScalar *sa=NULL # <<<<<<<<<<<<<< * cdef PetscScalar *gpuarray = NULL * if hiphandle: */ __pyx_v_sa = NULL; /* "petsc4py/PETSc/Vec.pyx":469 * cdef PetscInt na=0 * cdef PetscScalar *sa=NULL * cdef PetscScalar *gpuarray = NULL # <<<<<<<<<<<<<< * if hiphandle: * gpuarray = (hiphandle) */ __pyx_v_gpuarray = NULL; /* "petsc4py/PETSc/Vec.pyx":470 * cdef PetscScalar *sa=NULL * cdef PetscScalar *gpuarray = NULL * if hiphandle: # <<<<<<<<<<<<<< * gpuarray = (hiphandle) * if cpuarray is not None: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_hiphandle); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(41, 470, __pyx_L1_error) if (__pyx_t_1) { /* "petsc4py/PETSc/Vec.pyx":471 * cdef PetscScalar *gpuarray = NULL * if hiphandle: * gpuarray = (hiphandle) # <<<<<<<<<<<<<< * if cpuarray is not None: * cpuarray = iarray_s(cpuarray, &na, &sa) */ __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_hiphandle); if (unlikely((__pyx_t_2 == ((Py_uintptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(41, 471, __pyx_L1_error) __pyx_v_gpuarray = ((PetscScalar *)((Py_uintptr_t)__pyx_t_2)); /* "petsc4py/PETSc/Vec.pyx":470 * cdef PetscScalar *sa=NULL * cdef PetscScalar *gpuarray = NULL * if hiphandle: # <<<<<<<<<<<<<< * gpuarray = (hiphandle) * if cpuarray is not None: */ } /* "petsc4py/PETSc/Vec.pyx":472 * if hiphandle: * gpuarray = (hiphandle) * if cpuarray is not None: # <<<<<<<<<<<<<< * cpuarray = iarray_s(cpuarray, &na, &sa) * */ __pyx_t_1 = (__pyx_v_cpuarray != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/Vec.pyx":473 * gpuarray = (hiphandle) * if cpuarray is not None: * cpuarray = iarray_s(cpuarray, &na, &sa) # <<<<<<<<<<<<<< * * if size is None: size = (toInt(na), toInt(PETSC_DECIDE)) */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_s(__pyx_v_cpuarray, (&__pyx_v_na), (&__pyx_v_sa))); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_cpuarray, __pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/Vec.pyx":472 * if hiphandle: * gpuarray = (hiphandle) * if cpuarray is not None: # <<<<<<<<<<<<<< * cpuarray = iarray_s(cpuarray, &na, &sa) * */ } /* "petsc4py/PETSc/Vec.pyx":475 * cpuarray = iarray_s(cpuarray, &na, &sa) * * if size is None: size = (toInt(na), toInt(PETSC_DECIDE)) # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt bs=0, n=0, N=0 */ __pyx_t_1 = (__pyx_v_size == Py_None); if (__pyx_t_1) { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_na); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(PETSC_DECIDE); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(41, 475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3)) __PYX_ERR(41, 475, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4)) __PYX_ERR(41, 475, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_size, __pyx_t_5); __pyx_t_5 = 0; } /* "petsc4py/PETSc/Vec.pyx":476 * * if size is None: size = (toInt(na), toInt(PETSC_DECIDE)) * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscInt bs=0, n=0, N=0 * Vec_Sizes(size, bsize, &bs, &n, &N) */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_6 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(41, 476, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_6; /* "petsc4py/PETSc/Vec.pyx":477 * if size is None: size = (toInt(na), toInt(PETSC_DECIDE)) * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt bs=0, n=0, N=0 # <<<<<<<<<<<<<< * Vec_Sizes(size, bsize, &bs, &n, &N) * Sys_Layout(ccomm, bs, &n, &N) */ __pyx_v_bs = 0; __pyx_v_n = 0; __pyx_v_N = 0; /* "petsc4py/PETSc/Vec.pyx":478 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt bs=0, n=0, N=0 * Vec_Sizes(size, bsize, &bs, &n, &N) # <<<<<<<<<<<<<< * Sys_Layout(ccomm, bs, &n, &N) * if bs == PETSC_DECIDE: bs = 1 */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_Vec_Sizes(__pyx_v_size, __pyx_v_bsize, (&__pyx_v_bs), (&__pyx_v_n), (&__pyx_v_N)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(41, 478, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":479 * cdef PetscInt bs=0, n=0, N=0 * Vec_Sizes(size, bsize, &bs, &n, &N) * Sys_Layout(ccomm, bs, &n, &N) # <<<<<<<<<<<<<< * if bs == PETSC_DECIDE: bs = 1 * if na < n: raise ValueError( */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_Sys_Layout(__pyx_v_ccomm, __pyx_v_bs, (&__pyx_v_n), (&__pyx_v_N)); if (unlikely(__pyx_t_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 479, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":480 * Vec_Sizes(size, bsize, &bs, &n, &N) * Sys_Layout(ccomm, bs, &n, &N) * if bs == PETSC_DECIDE: bs = 1 # <<<<<<<<<<<<<< * if na < n: raise ValueError( * "array size %d and vector local size %d block size %d" % */ __pyx_t_1 = (__pyx_v_bs == PETSC_DECIDE); if (__pyx_t_1) { __pyx_v_bs = 1; } /* "petsc4py/PETSc/Vec.pyx":481 * Sys_Layout(ccomm, bs, &n, &N) * if bs == PETSC_DECIDE: bs = 1 * if na < n: raise ValueError( # <<<<<<<<<<<<<< * "array size %d and vector local size %d block size %d" % * (toInt(na), toInt(n), toInt(bs))) */ __pyx_t_1 = (__pyx_v_na < __pyx_v_n); if (unlikely(__pyx_t_1)) { /* "petsc4py/PETSc/Vec.pyx":483 * if na < n: raise ValueError( * "array size %d and vector local size %d block size %d" % * (toInt(na), toInt(n), toInt(bs))) # <<<<<<<<<<<<<< * cdef PetscVec newvec = NULL * if comm_size(ccomm) == 1: */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_na); if (unlikely(!__pyx_t_5)) __PYX_ERR(41, 483, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 483, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_bs); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 483, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(41, 483, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5)) __PYX_ERR(41, 483, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_4)) __PYX_ERR(41, 483, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_3)) __PYX_ERR(41, 483, __pyx_L1_error); __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_3 = 0; /* "petsc4py/PETSc/Vec.pyx":482 * if bs == PETSC_DECIDE: bs = 1 * if na < n: raise ValueError( * "array size %d and vector local size %d block size %d" % # <<<<<<<<<<<<<< * (toInt(na), toInt(n), toInt(bs))) * cdef PetscVec newvec = NULL */ __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_array_size_d_and_vector_local_si, __pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 482, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "petsc4py/PETSc/Vec.pyx":481 * Sys_Layout(ccomm, bs, &n, &N) * if bs == PETSC_DECIDE: bs = 1 * if na < n: raise ValueError( # <<<<<<<<<<<<<< * "array size %d and vector local size %d block size %d" % * (toInt(na), toInt(n), toInt(bs))) */ __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(41, 481, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __PYX_ERR(41, 481, __pyx_L1_error) } /* "petsc4py/PETSc/Vec.pyx":484 * "array size %d and vector local size %d block size %d" % * (toInt(na), toInt(n), toInt(bs))) * cdef PetscVec newvec = NULL # <<<<<<<<<<<<<< * if comm_size(ccomm) == 1: * CHKERR( VecCreateSeqHIPWithArrays(ccomm,bs,N,sa,gpuarray,&newvec) ) */ __pyx_v_newvec = NULL; /* "petsc4py/PETSc/Vec.pyx":485 * (toInt(na), toInt(n), toInt(bs))) * cdef PetscVec newvec = NULL * if comm_size(ccomm) == 1: # <<<<<<<<<<<<<< * CHKERR( VecCreateSeqHIPWithArrays(ccomm,bs,N,sa,gpuarray,&newvec) ) * else: */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_comm_size(__pyx_v_ccomm); if (unlikely(__pyx_t_7 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(41, 485, __pyx_L1_error) __pyx_t_1 = (__pyx_t_7 == 1); if (__pyx_t_1) { /* "petsc4py/PETSc/Vec.pyx":486 * cdef PetscVec newvec = NULL * if comm_size(ccomm) == 1: * CHKERR( VecCreateSeqHIPWithArrays(ccomm,bs,N,sa,gpuarray,&newvec) ) # <<<<<<<<<<<<<< * else: * CHKERR( VecCreateMPIHIPWithArrays(ccomm,bs,n,N,sa,gpuarray,&newvec) ) */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCreateSeqHIPWithArrays(__pyx_v_ccomm, __pyx_v_bs, __pyx_v_N, __pyx_v_sa, __pyx_v_gpuarray, (&__pyx_v_newvec))); if (unlikely(__pyx_t_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 486, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":485 * (toInt(na), toInt(n), toInt(bs))) * cdef PetscVec newvec = NULL * if comm_size(ccomm) == 1: # <<<<<<<<<<<<<< * CHKERR( VecCreateSeqHIPWithArrays(ccomm,bs,N,sa,gpuarray,&newvec) ) * else: */ goto __pyx_L8; } /* "petsc4py/PETSc/Vec.pyx":488 * CHKERR( VecCreateSeqHIPWithArrays(ccomm,bs,N,sa,gpuarray,&newvec) ) * else: * CHKERR( VecCreateMPIHIPWithArrays(ccomm,bs,n,N,sa,gpuarray,&newvec) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.vec = newvec * */ /*else*/ { __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCreateMPIHIPWithArrays(__pyx_v_ccomm, __pyx_v_bs, __pyx_v_n, __pyx_v_N, __pyx_v_sa, __pyx_v_gpuarray, (&__pyx_v_newvec))); if (unlikely(__pyx_t_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 488, __pyx_L1_error) } __pyx_L8:; /* "petsc4py/PETSc/Vec.pyx":489 * else: * CHKERR( VecCreateMPIHIPWithArrays(ccomm,bs,n,N,sa,gpuarray,&newvec) ) * CHKERR( PetscCLEAR(self.obj) ); self.vec = newvec # <<<<<<<<<<<<<< * * if cpuarray is not None: */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 489, __pyx_L1_error) __pyx_v_self->vec = __pyx_v_newvec; /* "petsc4py/PETSc/Vec.pyx":491 * CHKERR( PetscCLEAR(self.obj) ); self.vec = newvec * * if cpuarray is not None: # <<<<<<<<<<<<<< * self.set_attr('__array__', cpuarray) * return self */ __pyx_t_1 = (__pyx_v_cpuarray != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/Vec.pyx":492 * * if cpuarray is not None: * self.set_attr('__array__', cpuarray) # <<<<<<<<<<<<<< * return self * */ __pyx_t_9 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Vec *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__array__"), __pyx_v_cpuarray); if (unlikely(!__pyx_t_9)) __PYX_ERR(41, 492, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "petsc4py/PETSc/Vec.pyx":491 * CHKERR( PetscCLEAR(self.obj) ); self.vec = newvec * * if cpuarray is not None: # <<<<<<<<<<<<<< * self.set_attr('__array__', cpuarray) * return self */ } /* "petsc4py/PETSc/Vec.pyx":493 * if cpuarray is not None: * self.set_attr('__array__', cpuarray) * return self # <<<<<<<<<<<<<< * * def createViennaCLWithArrays( */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":436 * return self * * def createHIPWithArrays( # <<<<<<<<<<<<<< * self, * cpuarray: Sequence[Scalar] | None = None, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("petsc4py.PETSc.Vec.createHIPWithArrays", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_cpuarray); __Pyx_XDECREF(__pyx_v_size); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":495 * return self * * def createViennaCLWithArrays( # <<<<<<<<<<<<<< * self, * cpuarray: Sequence[Scalar] | None = None, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_73createViennaCLWithArrays(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_72createViennaCLWithArrays, "Vec.createViennaCLWithArrays(self, cpuarray: Sequence[Scalar] | None = None, viennaclvechandle: Any | None = None, size: LayoutSizeSpec | None = None, bsize: int | None = None, comm: Comm | None = None) -> Self\nCreate a `Type.VIENNACL` vector with optional arrays.\n\n Collective.\n\n Parameters\n ----------\n cpuarray\n Host array. Will be lazily allocated if not provided.\n viennaclvechandle\n Address of the array on the GPU. Will be lazily allocated if\n not provided.\n size\n Vector size.\n bsize\n Vector block size. If `None`, ``bsize = 1``.\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n petsc.VecCreateSeqViennaCLWithArrays\n petsc.VecCreateMPIViennaCLWithArrays\n\n \nSource code at petsc4py/PETSc/Vec.pyx:495"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_73createViennaCLWithArrays(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_cpuarray = 0; PyObject *__pyx_v_viennaclvechandle = 0; PyObject *__pyx_v_size = 0; PyObject *__pyx_v_bsize = 0; PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createViennaCLWithArrays (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cpuarray,&__pyx_n_s_viennaclvechandle,&__pyx_n_s_size,&__pyx_n_s_bsize,&__pyx_n_s_comm,0}; /* "petsc4py/PETSc/Vec.pyx":497 * def createViennaCLWithArrays( * self, * cpuarray: Sequence[Scalar] | None = None, # <<<<<<<<<<<<<< * viennaclvechandle: Any | None = None, # FIXME What type is appropriate here? * size: LayoutSizeSpec | None = None, */ values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Vec.pyx":498 * self, * cpuarray: Sequence[Scalar] | None = None, * viennaclvechandle: Any | None = None, # FIXME What type is appropriate here? # <<<<<<<<<<<<<< * size: LayoutSizeSpec | None = None, * bsize: int | None = None, */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Vec.pyx":499 * cpuarray: Sequence[Scalar] | None = None, * viennaclvechandle: Any | None = None, # FIXME What type is appropriate here? * size: LayoutSizeSpec | None = None, # <<<<<<<<<<<<<< * bsize: int | None = None, * comm: Comm | None = None, */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Vec.pyx":500 * viennaclvechandle: Any | None = None, # FIXME What type is appropriate here? * size: LayoutSizeSpec | None = None, * bsize: int | None = None, # <<<<<<<<<<<<<< * comm: Comm | None = None, * ) -> Self: */ values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Vec.pyx":501 * size: LayoutSizeSpec | None = None, * bsize: int | None = None, * comm: Comm | None = None, # <<<<<<<<<<<<<< * ) -> Self: * """Create a `Type.VIENNACL` vector with optional arrays. */ values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_cpuarray); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 495, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_viennaclvechandle); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 495, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 495, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_bsize); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 495, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 495, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createViennaCLWithArrays") < 0)) __PYX_ERR(41, 495, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_cpuarray = values[0]; __pyx_v_viennaclvechandle = values[1]; __pyx_v_size = values[2]; __pyx_v_bsize = values[3]; __pyx_v_comm = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createViennaCLWithArrays", 0, 0, 5, __pyx_nargs); __PYX_ERR(41, 495, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.createViennaCLWithArrays", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_72createViennaCLWithArrays(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_cpuarray, __pyx_v_viennaclvechandle, __pyx_v_size, __pyx_v_bsize, __pyx_v_comm); /* "petsc4py/PETSc/Vec.pyx":495 * return self * * def createViennaCLWithArrays( # <<<<<<<<<<<<<< * self, * cpuarray: Sequence[Scalar] | None = None, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_72createViennaCLWithArrays(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_cpuarray, PyObject *__pyx_v_viennaclvechandle, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PyObject *__pyx_v_comm) { PetscInt __pyx_v_na; PetscScalar *__pyx_v_sa; PetscScalar *__pyx_v_vclvec; MPI_Comm __pyx_v_ccomm; PetscInt __pyx_v_bs; PetscInt __pyx_v_n; PetscInt __pyx_v_N; Vec __pyx_v_newvec; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; Py_uintptr_t __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; MPI_Comm __pyx_t_6; int __pyx_t_7; PetscErrorCode __pyx_t_8; PyObject *__pyx_t_9 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createViennaCLWithArrays", 0); __Pyx_INCREF(__pyx_v_cpuarray); __Pyx_INCREF(__pyx_v_size); /* "petsc4py/PETSc/Vec.pyx":527 * * """ * cdef PetscInt na=0 # <<<<<<<<<<<<<< * cdef PetscScalar *sa=NULL * cdef PetscScalar *vclvec = NULL */ __pyx_v_na = 0; /* "petsc4py/PETSc/Vec.pyx":528 * """ * cdef PetscInt na=0 * cdef PetscScalar *sa=NULL # <<<<<<<<<<<<<< * cdef PetscScalar *vclvec = NULL * if viennaclvechandle: */ __pyx_v_sa = NULL; /* "petsc4py/PETSc/Vec.pyx":529 * cdef PetscInt na=0 * cdef PetscScalar *sa=NULL * cdef PetscScalar *vclvec = NULL # <<<<<<<<<<<<<< * if viennaclvechandle: * vclvec = (viennaclvechandle) */ __pyx_v_vclvec = NULL; /* "petsc4py/PETSc/Vec.pyx":530 * cdef PetscScalar *sa=NULL * cdef PetscScalar *vclvec = NULL * if viennaclvechandle: # <<<<<<<<<<<<<< * vclvec = (viennaclvechandle) * if cpuarray is not None: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_viennaclvechandle); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(41, 530, __pyx_L1_error) if (__pyx_t_1) { /* "petsc4py/PETSc/Vec.pyx":531 * cdef PetscScalar *vclvec = NULL * if viennaclvechandle: * vclvec = (viennaclvechandle) # <<<<<<<<<<<<<< * if cpuarray is not None: * cpuarray = iarray_s(cpuarray, &na, &sa) */ __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_viennaclvechandle); if (unlikely((__pyx_t_2 == ((Py_uintptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(41, 531, __pyx_L1_error) __pyx_v_vclvec = ((PetscScalar *)((Py_uintptr_t)__pyx_t_2)); /* "petsc4py/PETSc/Vec.pyx":530 * cdef PetscScalar *sa=NULL * cdef PetscScalar *vclvec = NULL * if viennaclvechandle: # <<<<<<<<<<<<<< * vclvec = (viennaclvechandle) * if cpuarray is not None: */ } /* "petsc4py/PETSc/Vec.pyx":532 * if viennaclvechandle: * vclvec = (viennaclvechandle) * if cpuarray is not None: # <<<<<<<<<<<<<< * cpuarray = iarray_s(cpuarray, &na, &sa) * */ __pyx_t_1 = (__pyx_v_cpuarray != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/Vec.pyx":533 * vclvec = (viennaclvechandle) * if cpuarray is not None: * cpuarray = iarray_s(cpuarray, &na, &sa) # <<<<<<<<<<<<<< * * if size is None: size = (toInt(na), toInt(PETSC_DECIDE)) */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_s(__pyx_v_cpuarray, (&__pyx_v_na), (&__pyx_v_sa))); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 533, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_cpuarray, __pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/Vec.pyx":532 * if viennaclvechandle: * vclvec = (viennaclvechandle) * if cpuarray is not None: # <<<<<<<<<<<<<< * cpuarray = iarray_s(cpuarray, &na, &sa) * */ } /* "petsc4py/PETSc/Vec.pyx":535 * cpuarray = iarray_s(cpuarray, &na, &sa) * * if size is None: size = (toInt(na), toInt(PETSC_DECIDE)) # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt bs=0, n=0, N=0 */ __pyx_t_1 = (__pyx_v_size == Py_None); if (__pyx_t_1) { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_na); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(PETSC_DECIDE); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(41, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3)) __PYX_ERR(41, 535, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4)) __PYX_ERR(41, 535, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_size, __pyx_t_5); __pyx_t_5 = 0; } /* "petsc4py/PETSc/Vec.pyx":536 * * if size is None: size = (toInt(na), toInt(PETSC_DECIDE)) * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscInt bs=0, n=0, N=0 * Vec_Sizes(size, bsize, &bs, &n, &N) */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_6 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(41, 536, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_6; /* "petsc4py/PETSc/Vec.pyx":537 * if size is None: size = (toInt(na), toInt(PETSC_DECIDE)) * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt bs=0, n=0, N=0 # <<<<<<<<<<<<<< * Vec_Sizes(size, bsize, &bs, &n, &N) * Sys_Layout(ccomm, bs, &n, &N) */ __pyx_v_bs = 0; __pyx_v_n = 0; __pyx_v_N = 0; /* "petsc4py/PETSc/Vec.pyx":538 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt bs=0, n=0, N=0 * Vec_Sizes(size, bsize, &bs, &n, &N) # <<<<<<<<<<<<<< * Sys_Layout(ccomm, bs, &n, &N) * if bs == PETSC_DECIDE: bs = 1 */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_Vec_Sizes(__pyx_v_size, __pyx_v_bsize, (&__pyx_v_bs), (&__pyx_v_n), (&__pyx_v_N)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(41, 538, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":539 * cdef PetscInt bs=0, n=0, N=0 * Vec_Sizes(size, bsize, &bs, &n, &N) * Sys_Layout(ccomm, bs, &n, &N) # <<<<<<<<<<<<<< * if bs == PETSC_DECIDE: bs = 1 * if na < n: */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_Sys_Layout(__pyx_v_ccomm, __pyx_v_bs, (&__pyx_v_n), (&__pyx_v_N)); if (unlikely(__pyx_t_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 539, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":540 * Vec_Sizes(size, bsize, &bs, &n, &N) * Sys_Layout(ccomm, bs, &n, &N) * if bs == PETSC_DECIDE: bs = 1 # <<<<<<<<<<<<<< * if na < n: * raise ValueError( "array size %d and vector local size %d block size %d" % (toInt(na), toInt(n), toInt(bs))) */ __pyx_t_1 = (__pyx_v_bs == PETSC_DECIDE); if (__pyx_t_1) { __pyx_v_bs = 1; } /* "petsc4py/PETSc/Vec.pyx":541 * Sys_Layout(ccomm, bs, &n, &N) * if bs == PETSC_DECIDE: bs = 1 * if na < n: # <<<<<<<<<<<<<< * raise ValueError( "array size %d and vector local size %d block size %d" % (toInt(na), toInt(n), toInt(bs))) * cdef PetscVec newvec = NULL */ __pyx_t_1 = (__pyx_v_na < __pyx_v_n); if (unlikely(__pyx_t_1)) { /* "petsc4py/PETSc/Vec.pyx":542 * if bs == PETSC_DECIDE: bs = 1 * if na < n: * raise ValueError( "array size %d and vector local size %d block size %d" % (toInt(na), toInt(n), toInt(bs))) # <<<<<<<<<<<<<< * cdef PetscVec newvec = NULL * if comm_size(ccomm) == 1: */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_na); if (unlikely(!__pyx_t_5)) __PYX_ERR(41, 542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_bs); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(41, 542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5)) __PYX_ERR(41, 542, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_4)) __PYX_ERR(41, 542, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_3)) __PYX_ERR(41, 542, __pyx_L1_error); __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_array_size_d_and_vector_local_si, __pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(41, 542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __PYX_ERR(41, 542, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":541 * Sys_Layout(ccomm, bs, &n, &N) * if bs == PETSC_DECIDE: bs = 1 * if na < n: # <<<<<<<<<<<<<< * raise ValueError( "array size %d and vector local size %d block size %d" % (toInt(na), toInt(n), toInt(bs))) * cdef PetscVec newvec = NULL */ } /* "petsc4py/PETSc/Vec.pyx":543 * if na < n: * raise ValueError( "array size %d and vector local size %d block size %d" % (toInt(na), toInt(n), toInt(bs))) * cdef PetscVec newvec = NULL # <<<<<<<<<<<<<< * if comm_size(ccomm) == 1: * CHKERR( VecCreateSeqViennaCLWithArrays(ccomm,bs,N,sa,vclvec,&newvec) ) */ __pyx_v_newvec = NULL; /* "petsc4py/PETSc/Vec.pyx":544 * raise ValueError( "array size %d and vector local size %d block size %d" % (toInt(na), toInt(n), toInt(bs))) * cdef PetscVec newvec = NULL * if comm_size(ccomm) == 1: # <<<<<<<<<<<<<< * CHKERR( VecCreateSeqViennaCLWithArrays(ccomm,bs,N,sa,vclvec,&newvec) ) * else: */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_comm_size(__pyx_v_ccomm); if (unlikely(__pyx_t_7 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(41, 544, __pyx_L1_error) __pyx_t_1 = (__pyx_t_7 == 1); if (__pyx_t_1) { /* "petsc4py/PETSc/Vec.pyx":545 * cdef PetscVec newvec = NULL * if comm_size(ccomm) == 1: * CHKERR( VecCreateSeqViennaCLWithArrays(ccomm,bs,N,sa,vclvec,&newvec) ) # <<<<<<<<<<<<<< * else: * CHKERR( VecCreateMPIViennaCLWithArrays(ccomm,bs,n,N,sa,vclvec,&newvec) ) */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCreateSeqViennaCLWithArrays(__pyx_v_ccomm, __pyx_v_bs, __pyx_v_N, __pyx_v_sa, __pyx_v_vclvec, (&__pyx_v_newvec))); if (unlikely(__pyx_t_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 545, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":544 * raise ValueError( "array size %d and vector local size %d block size %d" % (toInt(na), toInt(n), toInt(bs))) * cdef PetscVec newvec = NULL * if comm_size(ccomm) == 1: # <<<<<<<<<<<<<< * CHKERR( VecCreateSeqViennaCLWithArrays(ccomm,bs,N,sa,vclvec,&newvec) ) * else: */ goto __pyx_L8; } /* "petsc4py/PETSc/Vec.pyx":547 * CHKERR( VecCreateSeqViennaCLWithArrays(ccomm,bs,N,sa,vclvec,&newvec) ) * else: * CHKERR( VecCreateMPIViennaCLWithArrays(ccomm,bs,n,N,sa,vclvec,&newvec) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.vec = newvec * */ /*else*/ { __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCreateMPIViennaCLWithArrays(__pyx_v_ccomm, __pyx_v_bs, __pyx_v_n, __pyx_v_N, __pyx_v_sa, __pyx_v_vclvec, (&__pyx_v_newvec))); if (unlikely(__pyx_t_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 547, __pyx_L1_error) } __pyx_L8:; /* "petsc4py/PETSc/Vec.pyx":548 * else: * CHKERR( VecCreateMPIViennaCLWithArrays(ccomm,bs,n,N,sa,vclvec,&newvec) ) * CHKERR( PetscCLEAR(self.obj) ); self.vec = newvec # <<<<<<<<<<<<<< * * if cpuarray is not None: */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 548, __pyx_L1_error) __pyx_v_self->vec = __pyx_v_newvec; /* "petsc4py/PETSc/Vec.pyx":550 * CHKERR( PetscCLEAR(self.obj) ); self.vec = newvec * * if cpuarray is not None: # <<<<<<<<<<<<<< * self.set_attr('__array__', cpuarray) * return self */ __pyx_t_1 = (__pyx_v_cpuarray != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/Vec.pyx":551 * * if cpuarray is not None: * self.set_attr('__array__', cpuarray) # <<<<<<<<<<<<<< * return self * */ __pyx_t_9 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Vec *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__array__"), __pyx_v_cpuarray); if (unlikely(!__pyx_t_9)) __PYX_ERR(41, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "petsc4py/PETSc/Vec.pyx":550 * CHKERR( PetscCLEAR(self.obj) ); self.vec = newvec * * if cpuarray is not None: # <<<<<<<<<<<<<< * self.set_attr('__array__', cpuarray) * return self */ } /* "petsc4py/PETSc/Vec.pyx":552 * if cpuarray is not None: * self.set_attr('__array__', cpuarray) * return self # <<<<<<<<<<<<<< * * # FIXME: object? Do we need to specify it? Can't we just use Any? */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":495 * return self * * def createViennaCLWithArrays( # <<<<<<<<<<<<<< * self, * cpuarray: Sequence[Scalar] | None = None, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("petsc4py.PETSc.Vec.createViennaCLWithArrays", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_cpuarray); __Pyx_XDECREF(__pyx_v_size); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":555 * * # FIXME: object? Do we need to specify it? Can't we just use Any? * def createWithDLPack( # <<<<<<<<<<<<<< * self, * object dltensor, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_75createWithDLPack(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_74createWithDLPack, "Vec.createWithDLPack(self, dltensor, size: LayoutSizeSpec | None = None, bsize: int | None = None, comm: Comm | None = None) -> Self\nCreate a vector wrapping a DLPack object, sharing the same memory.\n\n Collective.\n\n This operation does not modify the storage of the original tensor and\n should be used with contiguous tensors only. If the tensor is stored in\n row-major order (e.g. PyTorch tensors), the resulting vector will look\n like an unrolled tensor using row-major order.\n\n The resulting vector type will be one of `Type.SEQ`, `Type.MPI`,\n `Type.SEQCUDA`, `Type.MPICUDA`, `Type.SEQHIP` or\n `Type.MPIHIP` depending on the type of ``dltensor`` and the number\n of processes in the communicator.\n\n Parameters\n ----------\n dltensor\n Either an object with a ``__dlpack__`` method or a DLPack tensor object.\n size\n Vector size.\n bsize\n Vector block size. If `None`, ``bsize = 1``.\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n \nSource code at petsc4py/PETSc/Vec.pyx:555"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_75createWithDLPack(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_dltensor = 0; PyObject *__pyx_v_size = 0; PyObject *__pyx_v_bsize = 0; PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createWithDLPack (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dltensor,&__pyx_n_s_size,&__pyx_n_s_bsize,&__pyx_n_s_comm,0}; /* "petsc4py/PETSc/Vec.pyx":558 * self, * object dltensor, * size: LayoutSizeSpec | None = None, # <<<<<<<<<<<<<< * bsize: int | None = None, * comm: Comm | None = None */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Vec.pyx":559 * object dltensor, * size: LayoutSizeSpec | None = None, * bsize: int | None = None, # <<<<<<<<<<<<<< * comm: Comm | None = None * ) -> Self: */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Vec.pyx":560 * size: LayoutSizeSpec | None = None, * bsize: int | None = None, * comm: Comm | None = None # <<<<<<<<<<<<<< * ) -> Self: * """Create a vector wrapping a DLPack object, sharing the same memory. */ values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dltensor)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 555, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 555, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_bsize); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 555, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 555, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createWithDLPack") < 0)) __PYX_ERR(41, 555, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_dltensor = values[0]; __pyx_v_size = values[1]; __pyx_v_bsize = values[2]; __pyx_v_comm = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createWithDLPack", 0, 1, 4, __pyx_nargs); __PYX_ERR(41, 555, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.createWithDLPack", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_74createWithDLPack(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_dltensor, __pyx_v_size, __pyx_v_bsize, __pyx_v_comm); /* "petsc4py/PETSc/Vec.pyx":555 * * # FIXME: object? Do we need to specify it? Can't we just use Any? * def createWithDLPack( # <<<<<<<<<<<<<< * self, * object dltensor, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_74createWithDLPack(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_dltensor, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PyObject *__pyx_v_comm) { struct __pyx_t_8petsc4py_5PETSc_DLManagedTensor *__pyx_v_ptr; int __pyx_v_bits; PetscInt __pyx_v_nz; int64_t __pyx_v_ndim; int64_t *__pyx_v_shape; int64_t *__pyx_v_strides; MPI_Comm __pyx_v_ccomm; PetscInt __pyx_v_bs; PetscInt __pyx_v_n; PetscInt __pyx_v_N; CYTHON_UNUSED __pyx_t_8petsc4py_5PETSc_DLContext *__pyx_v_ctx; PyObject *__pyx_v_s = NULL; Vec __pyx_v_newvec; enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType __pyx_v_dltype; int64_t *__pyx_v_shape_arr; int64_t *__pyx_v_strides_arr; PyObject *__pyx_v_s1 = 0; PyObject *__pyx_v_s2 = 0; int64_t __pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; void *__pyx_t_7; uint8_t __pyx_t_8; PyObject *__pyx_t_9 = NULL; int64_t *__pyx_t_10; int64_t *__pyx_t_11; int64_t *__pyx_t_12; PetscInt __pyx_t_13; PetscErrorCode __pyx_t_14; enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType __pyx_t_15; int __pyx_t_16; int64_t __pyx_t_17; int64_t __pyx_t_18; int64_t __pyx_t_19; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createWithDLPack", 0); __Pyx_INCREF(__pyx_v_dltensor); __Pyx_INCREF(__pyx_v_size); /* "petsc4py/PETSc/Vec.pyx":588 * * """ * cdef DLManagedTensor* ptr = NULL # <<<<<<<<<<<<<< * cdef int bits = 0 * cdef PetscInt nz = 1 */ __pyx_v_ptr = NULL; /* "petsc4py/PETSc/Vec.pyx":589 * """ * cdef DLManagedTensor* ptr = NULL * cdef int bits = 0 # <<<<<<<<<<<<<< * cdef PetscInt nz = 1 * cdef int64_t ndim = 0 */ __pyx_v_bits = 0; /* "petsc4py/PETSc/Vec.pyx":590 * cdef DLManagedTensor* ptr = NULL * cdef int bits = 0 * cdef PetscInt nz = 1 # <<<<<<<<<<<<<< * cdef int64_t ndim = 0 * cdef int64_t* shape = NULL */ __pyx_v_nz = 1; /* "petsc4py/PETSc/Vec.pyx":591 * cdef int bits = 0 * cdef PetscInt nz = 1 * cdef int64_t ndim = 0 # <<<<<<<<<<<<<< * cdef int64_t* shape = NULL * cdef int64_t* strides = NULL */ __pyx_v_ndim = 0; /* "petsc4py/PETSc/Vec.pyx":592 * cdef PetscInt nz = 1 * cdef int64_t ndim = 0 * cdef int64_t* shape = NULL # <<<<<<<<<<<<<< * cdef int64_t* strides = NULL * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) */ __pyx_v_shape = NULL; /* "petsc4py/PETSc/Vec.pyx":593 * cdef int64_t ndim = 0 * cdef int64_t* shape = NULL * cdef int64_t* strides = NULL # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt bs = 0,n = 0,N = 0 */ __pyx_v_strides = NULL; /* "petsc4py/PETSc/Vec.pyx":594 * cdef int64_t* shape = NULL * cdef int64_t* strides = NULL * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscInt bs = 0,n = 0,N = 0 * cdef DLContext* ctx = NULL */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(41, 594, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/Vec.pyx":595 * cdef int64_t* strides = NULL * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt bs = 0,n = 0,N = 0 # <<<<<<<<<<<<<< * cdef DLContext* ctx = NULL * */ __pyx_v_bs = 0; __pyx_v_n = 0; __pyx_v_N = 0; /* "petsc4py/PETSc/Vec.pyx":596 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt bs = 0,n = 0,N = 0 * cdef DLContext* ctx = NULL # <<<<<<<<<<<<<< * * if not PyCapsule_CheckExact(dltensor): */ __pyx_v_ctx = NULL; /* "petsc4py/PETSc/Vec.pyx":598 * cdef DLContext* ctx = NULL * * if not PyCapsule_CheckExact(dltensor): # <<<<<<<<<<<<<< * dltensor = dltensor.__dlpack__() * */ __pyx_t_2 = (!(PyCapsule_CheckExact(__pyx_v_dltensor) != 0)); if (__pyx_t_2) { /* "petsc4py/PETSc/Vec.pyx":599 * * if not PyCapsule_CheckExact(dltensor): * dltensor = dltensor.__dlpack__() # <<<<<<<<<<<<<< * * if PyCapsule_IsValid(dltensor, 'dltensor'): */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_dltensor, __pyx_n_s_dlpack); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF_SET(__pyx_v_dltensor, __pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/Vec.pyx":598 * cdef DLContext* ctx = NULL * * if not PyCapsule_CheckExact(dltensor): # <<<<<<<<<<<<<< * dltensor = dltensor.__dlpack__() * */ } /* "petsc4py/PETSc/Vec.pyx":601 * dltensor = dltensor.__dlpack__() * * if PyCapsule_IsValid(dltensor, 'dltensor'): # <<<<<<<<<<<<<< * ptr = PyCapsule_GetPointer(dltensor, 'dltensor') * bits = ptr.dl_tensor.dtype.bits */ __pyx_t_2 = PyCapsule_IsValid(__pyx_v_dltensor, ((char const *)"dltensor")); if (likely(__pyx_t_2)) { /* "petsc4py/PETSc/Vec.pyx":602 * * if PyCapsule_IsValid(dltensor, 'dltensor'): * ptr = PyCapsule_GetPointer(dltensor, 'dltensor') # <<<<<<<<<<<<<< * bits = ptr.dl_tensor.dtype.bits * if bits != 8*sizeof(PetscScalar): */ __pyx_t_7 = PyCapsule_GetPointer(__pyx_v_dltensor, ((char const *)"dltensor")); if (unlikely(__pyx_t_7 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(41, 602, __pyx_L1_error) __pyx_v_ptr = ((struct __pyx_t_8petsc4py_5PETSc_DLManagedTensor *)__pyx_t_7); /* "petsc4py/PETSc/Vec.pyx":603 * if PyCapsule_IsValid(dltensor, 'dltensor'): * ptr = PyCapsule_GetPointer(dltensor, 'dltensor') * bits = ptr.dl_tensor.dtype.bits # <<<<<<<<<<<<<< * if bits != 8*sizeof(PetscScalar): * raise TypeError("Tensor dtype = {} does not match PETSc precision".format(ptr.dl_tensor.dtype)) */ __pyx_t_8 = __pyx_v_ptr->dl_tensor.dtype.bits; __pyx_v_bits = __pyx_t_8; /* "petsc4py/PETSc/Vec.pyx":604 * ptr = PyCapsule_GetPointer(dltensor, 'dltensor') * bits = ptr.dl_tensor.dtype.bits * if bits != 8*sizeof(PetscScalar): # <<<<<<<<<<<<<< * raise TypeError("Tensor dtype = {} does not match PETSc precision".format(ptr.dl_tensor.dtype)) * ndim = ptr.dl_tensor.ndim */ __pyx_t_2 = (__pyx_v_bits != (8 * (sizeof(PetscScalar)))); if (unlikely(__pyx_t_2)) { /* "petsc4py/PETSc/Vec.pyx":605 * bits = ptr.dl_tensor.dtype.bits * if bits != 8*sizeof(PetscScalar): * raise TypeError("Tensor dtype = {} does not match PETSc precision".format(ptr.dl_tensor.dtype)) # <<<<<<<<<<<<<< * ndim = ptr.dl_tensor.ndim * shape = ptr.dl_tensor.shape */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Tensor_dtype_does_not_match_PETS, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 605, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __pyx_convert__to_py_struct____pyx_t_8petsc4py_5PETSc_DLDataType(__pyx_v_ptr->dl_tensor.dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(41, 605, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_9 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_5}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 605, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 605, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(41, 605, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":604 * ptr = PyCapsule_GetPointer(dltensor, 'dltensor') * bits = ptr.dl_tensor.dtype.bits * if bits != 8*sizeof(PetscScalar): # <<<<<<<<<<<<<< * raise TypeError("Tensor dtype = {} does not match PETSc precision".format(ptr.dl_tensor.dtype)) * ndim = ptr.dl_tensor.ndim */ } /* "petsc4py/PETSc/Vec.pyx":606 * if bits != 8*sizeof(PetscScalar): * raise TypeError("Tensor dtype = {} does not match PETSc precision".format(ptr.dl_tensor.dtype)) * ndim = ptr.dl_tensor.ndim # <<<<<<<<<<<<<< * shape = ptr.dl_tensor.shape * for s in shape[:ndim]: */ __pyx_t_6 = __pyx_v_ptr->dl_tensor.ndim; __pyx_v_ndim = __pyx_t_6; /* "petsc4py/PETSc/Vec.pyx":607 * raise TypeError("Tensor dtype = {} does not match PETSc precision".format(ptr.dl_tensor.dtype)) * ndim = ptr.dl_tensor.ndim * shape = ptr.dl_tensor.shape # <<<<<<<<<<<<<< * for s in shape[:ndim]: * nz = nz*s */ __pyx_t_10 = __pyx_v_ptr->dl_tensor.shape; __pyx_v_shape = __pyx_t_10; /* "petsc4py/PETSc/Vec.pyx":608 * ndim = ptr.dl_tensor.ndim * shape = ptr.dl_tensor.shape * for s in shape[:ndim]: # <<<<<<<<<<<<<< * nz = nz*s * strides = ptr.dl_tensor.strides */ __pyx_t_11 = (__pyx_v_shape + __pyx_v_ndim); for (__pyx_t_12 = __pyx_v_shape; __pyx_t_12 < __pyx_t_11; __pyx_t_12++) { __pyx_t_10 = __pyx_t_12; __pyx_t_4 = __Pyx_PyInt_From_int64_t((__pyx_t_10[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 608, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/Vec.pyx":609 * shape = ptr.dl_tensor.shape * for s in shape[:ndim]: * nz = nz*s # <<<<<<<<<<<<<< * strides = ptr.dl_tensor.strides * PyCapsule_SetName(dltensor, 'used_dltensor') */ __pyx_t_4 = __Pyx_PyInt_From_PetscInt(__pyx_v_nz); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 609, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyNumber_Multiply(__pyx_t_4, __pyx_v_s); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 609, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_13 = __Pyx_PyInt_As_PetscInt(__pyx_t_3); if (unlikely((__pyx_t_13 == ((PetscInt)-1)) && PyErr_Occurred())) __PYX_ERR(41, 609, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_nz = __pyx_t_13; } /* "petsc4py/PETSc/Vec.pyx":610 * for s in shape[:ndim]: * nz = nz*s * strides = ptr.dl_tensor.strides # <<<<<<<<<<<<<< * PyCapsule_SetName(dltensor, 'used_dltensor') * else: */ __pyx_t_10 = __pyx_v_ptr->dl_tensor.strides; __pyx_v_strides = __pyx_t_10; /* "petsc4py/PETSc/Vec.pyx":611 * nz = nz*s * strides = ptr.dl_tensor.strides * PyCapsule_SetName(dltensor, 'used_dltensor') # <<<<<<<<<<<<<< * else: * raise ValueError("Expect a dltensor field, pycapsule.PyCapsule can only be consumed once") */ __pyx_t_6 = PyCapsule_SetName(__pyx_v_dltensor, ((char const *)"used_dltensor")); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(41, 611, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":601 * dltensor = dltensor.__dlpack__() * * if PyCapsule_IsValid(dltensor, 'dltensor'): # <<<<<<<<<<<<<< * ptr = PyCapsule_GetPointer(dltensor, 'dltensor') * bits = ptr.dl_tensor.dtype.bits */ goto __pyx_L4; } /* "petsc4py/PETSc/Vec.pyx":613 * PyCapsule_SetName(dltensor, 'used_dltensor') * else: * raise ValueError("Expect a dltensor field, pycapsule.PyCapsule can only be consumed once") # <<<<<<<<<<<<<< * if size is None: size = (toInt(nz), toInt(PETSC_DECIDE)) * Vec_Sizes(size, bsize, &bs, &n, &N) */ /*else*/ { __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 613, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(41, 613, __pyx_L1_error) } __pyx_L4:; /* "petsc4py/PETSc/Vec.pyx":614 * else: * raise ValueError("Expect a dltensor field, pycapsule.PyCapsule can only be consumed once") * if size is None: size = (toInt(nz), toInt(PETSC_DECIDE)) # <<<<<<<<<<<<<< * Vec_Sizes(size, bsize, &bs, &n, &N) * Sys_Layout(ccomm, bs, &n, &N) */ __pyx_t_2 = (__pyx_v_size == Py_None); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nz); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(PETSC_DECIDE); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(41, 614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3)) __PYX_ERR(41, 614, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4)) __PYX_ERR(41, 614, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_size, __pyx_t_5); __pyx_t_5 = 0; } /* "petsc4py/PETSc/Vec.pyx":615 * raise ValueError("Expect a dltensor field, pycapsule.PyCapsule can only be consumed once") * if size is None: size = (toInt(nz), toInt(PETSC_DECIDE)) * Vec_Sizes(size, bsize, &bs, &n, &N) # <<<<<<<<<<<<<< * Sys_Layout(ccomm, bs, &n, &N) * if bs == PETSC_DECIDE: bs = 1 */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_Vec_Sizes(__pyx_v_size, __pyx_v_bsize, (&__pyx_v_bs), (&__pyx_v_n), (&__pyx_v_N)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(41, 615, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":616 * if size is None: size = (toInt(nz), toInt(PETSC_DECIDE)) * Vec_Sizes(size, bsize, &bs, &n, &N) * Sys_Layout(ccomm, bs, &n, &N) # <<<<<<<<<<<<<< * if bs == PETSC_DECIDE: bs = 1 * if nz < n: raise ValueError( */ __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_Sys_Layout(__pyx_v_ccomm, __pyx_v_bs, (&__pyx_v_n), (&__pyx_v_N)); if (unlikely(__pyx_t_14 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 616, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":617 * Vec_Sizes(size, bsize, &bs, &n, &N) * Sys_Layout(ccomm, bs, &n, &N) * if bs == PETSC_DECIDE: bs = 1 # <<<<<<<<<<<<<< * if nz < n: raise ValueError( * "array size %d and vector local size %d block size %d" % */ __pyx_t_2 = (__pyx_v_bs == PETSC_DECIDE); if (__pyx_t_2) { __pyx_v_bs = 1; } /* "petsc4py/PETSc/Vec.pyx":618 * Sys_Layout(ccomm, bs, &n, &N) * if bs == PETSC_DECIDE: bs = 1 * if nz < n: raise ValueError( # <<<<<<<<<<<<<< * "array size %d and vector local size %d block size %d" % * (toInt(nz), toInt(n), toInt(bs))) */ __pyx_t_2 = (__pyx_v_nz < __pyx_v_n); if (unlikely(__pyx_t_2)) { /* "petsc4py/PETSc/Vec.pyx":620 * if nz < n: raise ValueError( * "array size %d and vector local size %d block size %d" % * (toInt(nz), toInt(n), toInt(bs))) # <<<<<<<<<<<<<< * cdef PetscVec newvec = NULL * cdef PetscDLDeviceType dltype = ptr.dl_tensor.ctx.device_type */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nz); if (unlikely(!__pyx_t_5)) __PYX_ERR(41, 620, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 620, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_bs); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 620, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(41, 620, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5)) __PYX_ERR(41, 620, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_4)) __PYX_ERR(41, 620, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_3)) __PYX_ERR(41, 620, __pyx_L1_error); __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_3 = 0; /* "petsc4py/PETSc/Vec.pyx":619 * if bs == PETSC_DECIDE: bs = 1 * if nz < n: raise ValueError( * "array size %d and vector local size %d block size %d" % # <<<<<<<<<<<<<< * (toInt(nz), toInt(n), toInt(bs))) * cdef PetscVec newvec = NULL */ __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_array_size_d_and_vector_local_si, __pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "petsc4py/PETSc/Vec.pyx":618 * Sys_Layout(ccomm, bs, &n, &N) * if bs == PETSC_DECIDE: bs = 1 * if nz < n: raise ValueError( # <<<<<<<<<<<<<< * "array size %d and vector local size %d block size %d" % * (toInt(nz), toInt(n), toInt(bs))) */ __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(41, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __PYX_ERR(41, 618, __pyx_L1_error) } /* "petsc4py/PETSc/Vec.pyx":621 * "array size %d and vector local size %d block size %d" % * (toInt(nz), toInt(n), toInt(bs))) * cdef PetscVec newvec = NULL # <<<<<<<<<<<<<< * cdef PetscDLDeviceType dltype = ptr.dl_tensor.ctx.device_type * if dltype in [kDLCUDA,kDLCUDAManaged]: */ __pyx_v_newvec = NULL; /* "petsc4py/PETSc/Vec.pyx":622 * (toInt(nz), toInt(n), toInt(bs))) * cdef PetscVec newvec = NULL * cdef PetscDLDeviceType dltype = ptr.dl_tensor.ctx.device_type # <<<<<<<<<<<<<< * if dltype in [kDLCUDA,kDLCUDAManaged]: * if comm_size(ccomm) == 1: */ __pyx_t_15 = __pyx_v_ptr->dl_tensor.ctx.device_type; __pyx_v_dltype = __pyx_t_15; /* "petsc4py/PETSc/Vec.pyx":623 * cdef PetscVec newvec = NULL * cdef PetscDLDeviceType dltype = ptr.dl_tensor.ctx.device_type * if dltype in [kDLCUDA,kDLCUDAManaged]: # <<<<<<<<<<<<<< * if comm_size(ccomm) == 1: * CHKERR( VecCreateSeqCUDAWithArray(ccomm,bs,N,(ptr.dl_tensor.data),&newvec) ) */ __pyx_t_15 = __pyx_v_dltype; __pyx_t_16 = (__pyx_t_15 == __pyx_e_8petsc4py_5PETSc_kDLCUDA); if (!__pyx_t_16) { } else { __pyx_t_2 = __pyx_t_16; goto __pyx_L12_bool_binop_done; } __pyx_t_16 = (__pyx_t_15 == __pyx_e_8petsc4py_5PETSc_kDLCUDAManaged); __pyx_t_2 = __pyx_t_16; __pyx_L12_bool_binop_done:; __pyx_t_16 = __pyx_t_2; if (__pyx_t_16) { /* "petsc4py/PETSc/Vec.pyx":624 * cdef PetscDLDeviceType dltype = ptr.dl_tensor.ctx.device_type * if dltype in [kDLCUDA,kDLCUDAManaged]: * if comm_size(ccomm) == 1: # <<<<<<<<<<<<<< * CHKERR( VecCreateSeqCUDAWithArray(ccomm,bs,N,(ptr.dl_tensor.data),&newvec) ) * else: */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_comm_size(__pyx_v_ccomm); if (unlikely(__pyx_t_6 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(41, 624, __pyx_L1_error) __pyx_t_16 = (__pyx_t_6 == 1); if (__pyx_t_16) { /* "petsc4py/PETSc/Vec.pyx":625 * if dltype in [kDLCUDA,kDLCUDAManaged]: * if comm_size(ccomm) == 1: * CHKERR( VecCreateSeqCUDAWithArray(ccomm,bs,N,(ptr.dl_tensor.data),&newvec) ) # <<<<<<<<<<<<<< * else: * CHKERR( VecCreateMPICUDAWithArray(ccomm,bs,n,N,(ptr.dl_tensor.data),&newvec) ) */ __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCreateSeqCUDAWithArray(__pyx_v_ccomm, __pyx_v_bs, __pyx_v_N, ((PetscScalar *)__pyx_v_ptr->dl_tensor.data), (&__pyx_v_newvec))); if (unlikely(__pyx_t_14 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 625, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":624 * cdef PetscDLDeviceType dltype = ptr.dl_tensor.ctx.device_type * if dltype in [kDLCUDA,kDLCUDAManaged]: * if comm_size(ccomm) == 1: # <<<<<<<<<<<<<< * CHKERR( VecCreateSeqCUDAWithArray(ccomm,bs,N,(ptr.dl_tensor.data),&newvec) ) * else: */ goto __pyx_L14; } /* "petsc4py/PETSc/Vec.pyx":627 * CHKERR( VecCreateSeqCUDAWithArray(ccomm,bs,N,(ptr.dl_tensor.data),&newvec) ) * else: * CHKERR( VecCreateMPICUDAWithArray(ccomm,bs,n,N,(ptr.dl_tensor.data),&newvec) ) # <<<<<<<<<<<<<< * elif dltype in [kDLCPU,kDLCUDAHost,kDLROCMHost]: * if comm_size(ccomm) == 1: */ /*else*/ { __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCreateMPICUDAWithArray(__pyx_v_ccomm, __pyx_v_bs, __pyx_v_n, __pyx_v_N, ((PetscScalar *)__pyx_v_ptr->dl_tensor.data), (&__pyx_v_newvec))); if (unlikely(__pyx_t_14 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 627, __pyx_L1_error) } __pyx_L14:; /* "petsc4py/PETSc/Vec.pyx":623 * cdef PetscVec newvec = NULL * cdef PetscDLDeviceType dltype = ptr.dl_tensor.ctx.device_type * if dltype in [kDLCUDA,kDLCUDAManaged]: # <<<<<<<<<<<<<< * if comm_size(ccomm) == 1: * CHKERR( VecCreateSeqCUDAWithArray(ccomm,bs,N,(ptr.dl_tensor.data),&newvec) ) */ goto __pyx_L11; } /* "petsc4py/PETSc/Vec.pyx":628 * else: * CHKERR( VecCreateMPICUDAWithArray(ccomm,bs,n,N,(ptr.dl_tensor.data),&newvec) ) * elif dltype in [kDLCPU,kDLCUDAHost,kDLROCMHost]: # <<<<<<<<<<<<<< * if comm_size(ccomm) == 1: * CHKERR( VecCreateSeqWithArray(ccomm,bs,N,(ptr.dl_tensor.data),&newvec) ) */ __pyx_t_15 = __pyx_v_dltype; __pyx_t_2 = (__pyx_t_15 == __pyx_e_8petsc4py_5PETSc_kDLCPU); if (!__pyx_t_2) { } else { __pyx_t_16 = __pyx_t_2; goto __pyx_L15_bool_binop_done; } __pyx_t_2 = (__pyx_t_15 == __pyx_e_8petsc4py_5PETSc_kDLCUDAHost); if (!__pyx_t_2) { } else { __pyx_t_16 = __pyx_t_2; goto __pyx_L15_bool_binop_done; } __pyx_t_2 = (__pyx_t_15 == __pyx_e_8petsc4py_5PETSc_kDLROCMHost); __pyx_t_16 = __pyx_t_2; __pyx_L15_bool_binop_done:; __pyx_t_2 = __pyx_t_16; if (__pyx_t_2) { /* "petsc4py/PETSc/Vec.pyx":629 * CHKERR( VecCreateMPICUDAWithArray(ccomm,bs,n,N,(ptr.dl_tensor.data),&newvec) ) * elif dltype in [kDLCPU,kDLCUDAHost,kDLROCMHost]: * if comm_size(ccomm) == 1: # <<<<<<<<<<<<<< * CHKERR( VecCreateSeqWithArray(ccomm,bs,N,(ptr.dl_tensor.data),&newvec) ) * else: */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_comm_size(__pyx_v_ccomm); if (unlikely(__pyx_t_6 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(41, 629, __pyx_L1_error) __pyx_t_2 = (__pyx_t_6 == 1); if (__pyx_t_2) { /* "petsc4py/PETSc/Vec.pyx":630 * elif dltype in [kDLCPU,kDLCUDAHost,kDLROCMHost]: * if comm_size(ccomm) == 1: * CHKERR( VecCreateSeqWithArray(ccomm,bs,N,(ptr.dl_tensor.data),&newvec) ) # <<<<<<<<<<<<<< * else: * CHKERR( VecCreateMPIWithArray(ccomm,bs,n,N,(ptr.dl_tensor.data),&newvec) ) */ __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCreateSeqWithArray(__pyx_v_ccomm, __pyx_v_bs, __pyx_v_N, ((PetscScalar *)__pyx_v_ptr->dl_tensor.data), (&__pyx_v_newvec))); if (unlikely(__pyx_t_14 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 630, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":629 * CHKERR( VecCreateMPICUDAWithArray(ccomm,bs,n,N,(ptr.dl_tensor.data),&newvec) ) * elif dltype in [kDLCPU,kDLCUDAHost,kDLROCMHost]: * if comm_size(ccomm) == 1: # <<<<<<<<<<<<<< * CHKERR( VecCreateSeqWithArray(ccomm,bs,N,(ptr.dl_tensor.data),&newvec) ) * else: */ goto __pyx_L18; } /* "petsc4py/PETSc/Vec.pyx":632 * CHKERR( VecCreateSeqWithArray(ccomm,bs,N,(ptr.dl_tensor.data),&newvec) ) * else: * CHKERR( VecCreateMPIWithArray(ccomm,bs,n,N,(ptr.dl_tensor.data),&newvec) ) # <<<<<<<<<<<<<< * elif dltype == kDLROCM: * if comm_size(ccomm) == 1: */ /*else*/ { __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCreateMPIWithArray(__pyx_v_ccomm, __pyx_v_bs, __pyx_v_n, __pyx_v_N, ((PetscScalar *)__pyx_v_ptr->dl_tensor.data), (&__pyx_v_newvec))); if (unlikely(__pyx_t_14 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 632, __pyx_L1_error) } __pyx_L18:; /* "petsc4py/PETSc/Vec.pyx":628 * else: * CHKERR( VecCreateMPICUDAWithArray(ccomm,bs,n,N,(ptr.dl_tensor.data),&newvec) ) * elif dltype in [kDLCPU,kDLCUDAHost,kDLROCMHost]: # <<<<<<<<<<<<<< * if comm_size(ccomm) == 1: * CHKERR( VecCreateSeqWithArray(ccomm,bs,N,(ptr.dl_tensor.data),&newvec) ) */ goto __pyx_L11; } /* "petsc4py/PETSc/Vec.pyx":633 * else: * CHKERR( VecCreateMPIWithArray(ccomm,bs,n,N,(ptr.dl_tensor.data),&newvec) ) * elif dltype == kDLROCM: # <<<<<<<<<<<<<< * if comm_size(ccomm) == 1: * CHKERR( VecCreateSeqHIPWithArray(ccomm,bs,N,(ptr.dl_tensor.data),&newvec) ) */ __pyx_t_2 = (__pyx_v_dltype == __pyx_e_8petsc4py_5PETSc_kDLROCM); if (likely(__pyx_t_2)) { /* "petsc4py/PETSc/Vec.pyx":634 * CHKERR( VecCreateMPIWithArray(ccomm,bs,n,N,(ptr.dl_tensor.data),&newvec) ) * elif dltype == kDLROCM: * if comm_size(ccomm) == 1: # <<<<<<<<<<<<<< * CHKERR( VecCreateSeqHIPWithArray(ccomm,bs,N,(ptr.dl_tensor.data),&newvec) ) * else: */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_comm_size(__pyx_v_ccomm); if (unlikely(__pyx_t_6 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(41, 634, __pyx_L1_error) __pyx_t_2 = (__pyx_t_6 == 1); if (__pyx_t_2) { /* "petsc4py/PETSc/Vec.pyx":635 * elif dltype == kDLROCM: * if comm_size(ccomm) == 1: * CHKERR( VecCreateSeqHIPWithArray(ccomm,bs,N,(ptr.dl_tensor.data),&newvec) ) # <<<<<<<<<<<<<< * else: * CHKERR( VecCreateMPIHIPWithArray(ccomm,bs,n,N,(ptr.dl_tensor.data),&newvec) ) */ __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCreateSeqHIPWithArray(__pyx_v_ccomm, __pyx_v_bs, __pyx_v_N, ((PetscScalar *)__pyx_v_ptr->dl_tensor.data), (&__pyx_v_newvec))); if (unlikely(__pyx_t_14 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 635, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":634 * CHKERR( VecCreateMPIWithArray(ccomm,bs,n,N,(ptr.dl_tensor.data),&newvec) ) * elif dltype == kDLROCM: * if comm_size(ccomm) == 1: # <<<<<<<<<<<<<< * CHKERR( VecCreateSeqHIPWithArray(ccomm,bs,N,(ptr.dl_tensor.data),&newvec) ) * else: */ goto __pyx_L19; } /* "petsc4py/PETSc/Vec.pyx":637 * CHKERR( VecCreateSeqHIPWithArray(ccomm,bs,N,(ptr.dl_tensor.data),&newvec) ) * else: * CHKERR( VecCreateMPIHIPWithArray(ccomm,bs,n,N,(ptr.dl_tensor.data),&newvec) ) # <<<<<<<<<<<<<< * else: * raise TypeError("Device type {} not supported".format(dltype)) */ /*else*/ { __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCreateMPIHIPWithArray(__pyx_v_ccomm, __pyx_v_bs, __pyx_v_n, __pyx_v_N, ((PetscScalar *)__pyx_v_ptr->dl_tensor.data), (&__pyx_v_newvec))); if (unlikely(__pyx_t_14 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 637, __pyx_L1_error) } __pyx_L19:; /* "petsc4py/PETSc/Vec.pyx":633 * else: * CHKERR( VecCreateMPIWithArray(ccomm,bs,n,N,(ptr.dl_tensor.data),&newvec) ) * elif dltype == kDLROCM: # <<<<<<<<<<<<<< * if comm_size(ccomm) == 1: * CHKERR( VecCreateSeqHIPWithArray(ccomm,bs,N,(ptr.dl_tensor.data),&newvec) ) */ goto __pyx_L11; } /* "petsc4py/PETSc/Vec.pyx":639 * CHKERR( VecCreateMPIHIPWithArray(ccomm,bs,n,N,(ptr.dl_tensor.data),&newvec) ) * else: * raise TypeError("Device type {} not supported".format(dltype)) # <<<<<<<<<<<<<< * * CHKERR( PetscCLEAR(self.obj) ); self.vec = newvec */ /*else*/ { __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Device_type_not_supported, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 639, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_enum____pyx_t_8petsc4py_5PETSc_PetscDLDeviceType(__pyx_v_dltype); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 639, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_4}; __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(41, 639, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 639, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(41, 639, __pyx_L1_error) } __pyx_L11:; /* "petsc4py/PETSc/Vec.pyx":641 * raise TypeError("Device type {} not supported".format(dltype)) * * CHKERR( PetscCLEAR(self.obj) ); self.vec = newvec # <<<<<<<<<<<<<< * self.set_attr('__array__', dltensor) * cdef int64_t* shape_arr = NULL */ __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_14 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 641, __pyx_L1_error) __pyx_v_self->vec = __pyx_v_newvec; /* "petsc4py/PETSc/Vec.pyx":642 * * CHKERR( PetscCLEAR(self.obj) ); self.vec = newvec * self.set_attr('__array__', dltensor) # <<<<<<<<<<<<<< * cdef int64_t* shape_arr = NULL * cdef int64_t* strides_arr = NULL */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Vec *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__array__"), __pyx_v_dltensor); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 642, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/Vec.pyx":643 * CHKERR( PetscCLEAR(self.obj) ); self.vec = newvec * self.set_attr('__array__', dltensor) * cdef int64_t* shape_arr = NULL # <<<<<<<<<<<<<< * cdef int64_t* strides_arr = NULL * cdef object s1 = oarray_p(empty_p(ndim), NULL, &shape_arr) */ __pyx_v_shape_arr = NULL; /* "petsc4py/PETSc/Vec.pyx":644 * self.set_attr('__array__', dltensor) * cdef int64_t* shape_arr = NULL * cdef int64_t* strides_arr = NULL # <<<<<<<<<<<<<< * cdef object s1 = oarray_p(empty_p(ndim), NULL, &shape_arr) * cdef object s2 = oarray_p(empty_p(ndim), NULL, &strides_arr) */ __pyx_v_strides_arr = NULL; /* "petsc4py/PETSc/Vec.pyx":645 * cdef int64_t* shape_arr = NULL * cdef int64_t* strides_arr = NULL * cdef object s1 = oarray_p(empty_p(ndim), NULL, &shape_arr) # <<<<<<<<<<<<<< * cdef object s2 = oarray_p(empty_p(ndim), NULL, &strides_arr) * for i in range(ndim): */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_ndim)); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 645, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_3, NULL, ((void **)(&__pyx_v_shape_arr)))); if (unlikely(!__pyx_t_9)) __PYX_ERR(41, 645, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_s1 = __pyx_t_9; __pyx_t_9 = 0; /* "petsc4py/PETSc/Vec.pyx":646 * cdef int64_t* strides_arr = NULL * cdef object s1 = oarray_p(empty_p(ndim), NULL, &shape_arr) * cdef object s2 = oarray_p(empty_p(ndim), NULL, &strides_arr) # <<<<<<<<<<<<<< * for i in range(ndim): * shape_arr[i] = shape[i] */ __pyx_t_9 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_ndim)); if (unlikely(!__pyx_t_9)) __PYX_ERR(41, 646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_9, NULL, ((void **)(&__pyx_v_strides_arr)))); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_s2 = __pyx_t_3; __pyx_t_3 = 0; /* "petsc4py/PETSc/Vec.pyx":647 * cdef object s1 = oarray_p(empty_p(ndim), NULL, &shape_arr) * cdef object s2 = oarray_p(empty_p(ndim), NULL, &strides_arr) * for i in range(ndim): # <<<<<<<<<<<<<< * shape_arr[i] = shape[i] * strides_arr[i] = strides[i] */ __pyx_t_17 = __pyx_v_ndim; __pyx_t_18 = __pyx_t_17; for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) { __pyx_v_i = __pyx_t_19; /* "petsc4py/PETSc/Vec.pyx":648 * cdef object s2 = oarray_p(empty_p(ndim), NULL, &strides_arr) * for i in range(ndim): * shape_arr[i] = shape[i] # <<<<<<<<<<<<<< * strides_arr[i] = strides[i] * self.set_attr('__dltensor_ctx__', (ptr.dl_tensor.ctx.device_type, ptr.dl_tensor.ctx.device_id, ndim, s1, s2)) */ (__pyx_v_shape_arr[__pyx_v_i]) = (__pyx_v_shape[__pyx_v_i]); /* "petsc4py/PETSc/Vec.pyx":649 * for i in range(ndim): * shape_arr[i] = shape[i] * strides_arr[i] = strides[i] # <<<<<<<<<<<<<< * self.set_attr('__dltensor_ctx__', (ptr.dl_tensor.ctx.device_type, ptr.dl_tensor.ctx.device_id, ndim, s1, s2)) * if ptr.manager_deleter != NULL: */ (__pyx_v_strides_arr[__pyx_v_i]) = (__pyx_v_strides[__pyx_v_i]); } /* "petsc4py/PETSc/Vec.pyx":650 * shape_arr[i] = shape[i] * strides_arr[i] = strides[i] * self.set_attr('__dltensor_ctx__', (ptr.dl_tensor.ctx.device_type, ptr.dl_tensor.ctx.device_id, ndim, s1, s2)) # <<<<<<<<<<<<<< * if ptr.manager_deleter != NULL: * ptr.manager_deleter(ptr) # free the manager */ __pyx_t_3 = __Pyx_PyInt_From_enum____pyx_t_8petsc4py_5PETSc_PetscDLDeviceType(__pyx_v_ptr->dl_tensor.ctx.device_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 650, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_ptr->dl_tensor.ctx.device_id); if (unlikely(!__pyx_t_9)) __PYX_ERR(41, 650, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_4 = __Pyx_PyInt_From_int64_t(__pyx_v_ndim); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 650, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(5); if (unlikely(!__pyx_t_5)) __PYX_ERR(41, 650, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3)) __PYX_ERR(41, 650, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_9); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_9)) __PYX_ERR(41, 650, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4)) __PYX_ERR(41, 650, __pyx_L1_error); __Pyx_INCREF(__pyx_v_s1); __Pyx_GIVEREF(__pyx_v_s1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_v_s1)) __PYX_ERR(41, 650, __pyx_L1_error); __Pyx_INCREF(__pyx_v_s2); __Pyx_GIVEREF(__pyx_v_s2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_v_s2)) __PYX_ERR(41, 650, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_9 = 0; __pyx_t_4 = 0; __pyx_t_4 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Vec *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__dltensor_ctx__"), __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 650, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/Vec.pyx":651 * strides_arr[i] = strides[i] * self.set_attr('__dltensor_ctx__', (ptr.dl_tensor.ctx.device_type, ptr.dl_tensor.ctx.device_id, ndim, s1, s2)) * if ptr.manager_deleter != NULL: # <<<<<<<<<<<<<< * ptr.manager_deleter(ptr) # free the manager * return self */ __pyx_t_2 = (__pyx_v_ptr->manager_deleter != NULL); if (__pyx_t_2) { /* "petsc4py/PETSc/Vec.pyx":652 * self.set_attr('__dltensor_ctx__', (ptr.dl_tensor.ctx.device_type, ptr.dl_tensor.ctx.device_id, ndim, s1, s2)) * if ptr.manager_deleter != NULL: * ptr.manager_deleter(ptr) # free the manager # <<<<<<<<<<<<<< * return self * */ __pyx_v_ptr->manager_deleter(__pyx_v_ptr); /* "petsc4py/PETSc/Vec.pyx":651 * strides_arr[i] = strides[i] * self.set_attr('__dltensor_ctx__', (ptr.dl_tensor.ctx.device_type, ptr.dl_tensor.ctx.device_id, ndim, s1, s2)) * if ptr.manager_deleter != NULL: # <<<<<<<<<<<<<< * ptr.manager_deleter(ptr) # free the manager * return self */ } /* "petsc4py/PETSc/Vec.pyx":653 * if ptr.manager_deleter != NULL: * ptr.manager_deleter(ptr) # free the manager * return self # <<<<<<<<<<<<<< * * def attachDLPackInfo( */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":555 * * # FIXME: object? Do we need to specify it? Can't we just use Any? * def createWithDLPack( # <<<<<<<<<<<<<< * self, * object dltensor, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("petsc4py.PETSc.Vec.createWithDLPack", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_s); __Pyx_XDECREF(__pyx_v_s1); __Pyx_XDECREF(__pyx_v_s2); __Pyx_XDECREF(__pyx_v_dltensor); __Pyx_XDECREF(__pyx_v_size); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":655 * return self * * def attachDLPackInfo( # <<<<<<<<<<<<<< * self, * Vec vec=None, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_77attachDLPackInfo(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_76attachDLPackInfo, "Vec.attachDLPackInfo(self, vec: Vec | None = None, dltensor=None) -> Self\nAttach tensor information from another vector or DLPack tensor.\n\n Logically collective.\n\n This tensor information is required when converting a `Vec` to a\n DLPack object.\n\n Parameters\n ----------\n vec\n Vector with attached tensor information. This is typically created\n by calling `createWithDLPack`.\n dltensor\n DLPack tensor. This will only be used if ``vec`` is `None`.\n\n Notes\n -----\n This operation does not copy any data from ``vec`` or ``dltensor``.\n\n See Also\n --------\n clearDLPackInfo, createWithDLPack\n\n \nSource code at petsc4py/PETSc/Vec.pyx:655"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_77attachDLPackInfo(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_vec = 0; PyObject *__pyx_v_dltensor = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("attachDLPackInfo (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec,&__pyx_n_s_dltensor,0}; /* "petsc4py/PETSc/Vec.pyx":657 * def attachDLPackInfo( * self, * Vec vec=None, # <<<<<<<<<<<<<< * object dltensor=None * ) -> Self: */ values[0] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscVecObject *)Py_None)); /* "petsc4py/PETSc/Vec.pyx":658 * self, * Vec vec=None, * object dltensor=None # <<<<<<<<<<<<<< * ) -> Self: * """Attach tensor information from another vector or DLPack tensor. */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vec); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 655, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dltensor); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 655, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "attachDLPackInfo") < 0)) __PYX_ERR(41, 655, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_vec = ((struct PyPetscVecObject *)values[0]); __pyx_v_dltensor = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("attachDLPackInfo", 0, 0, 2, __pyx_nargs); __PYX_ERR(41, 655, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.attachDLPackInfo", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "vec", 0))) __PYX_ERR(41, 657, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_76attachDLPackInfo(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_vec, __pyx_v_dltensor); /* "petsc4py/PETSc/Vec.pyx":655 * return self * * def attachDLPackInfo( # <<<<<<<<<<<<<< * self, * Vec vec=None, */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_76attachDLPackInfo(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec, PyObject *__pyx_v_dltensor) { CYTHON_UNUSED PyObject *__pyx_v_ctx0 = 0; PyObject *__pyx_v_ctx = 0; struct __pyx_t_8petsc4py_5PETSc_DLManagedTensor *__pyx_v_ptr; int64_t *__pyx_v_shape_arr; int64_t *__pyx_v_strides_arr; PyObject *__pyx_v_s1 = 0; PyObject *__pyx_v_s2 = 0; uint8_t __pyx_v_bits; int __pyx_v_ndim; int64_t *__pyx_v_shape; int64_t *__pyx_v_strides; int __pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; void *__pyx_t_4; uint8_t __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int64_t *__pyx_t_10; int __pyx_t_11; int __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("attachDLPackInfo", 1); /* "petsc4py/PETSc/Vec.pyx":684 * * """ * cdef object ctx0 = self.get_attr('__dltensor_ctx__'), ctx = None # <<<<<<<<<<<<<< * cdef DLManagedTensor* ptr = NULL * cdef int64_t* shape_arr = NULL */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Vec *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__dltensor_ctx__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ctx0 = __pyx_t_1; __pyx_t_1 = 0; __Pyx_INCREF(Py_None); __pyx_v_ctx = Py_None; /* "petsc4py/PETSc/Vec.pyx":685 * """ * cdef object ctx0 = self.get_attr('__dltensor_ctx__'), ctx = None * cdef DLManagedTensor* ptr = NULL # <<<<<<<<<<<<<< * cdef int64_t* shape_arr = NULL * cdef int64_t* strides_arr = NULL */ __pyx_v_ptr = NULL; /* "petsc4py/PETSc/Vec.pyx":686 * cdef object ctx0 = self.get_attr('__dltensor_ctx__'), ctx = None * cdef DLManagedTensor* ptr = NULL * cdef int64_t* shape_arr = NULL # <<<<<<<<<<<<<< * cdef int64_t* strides_arr = NULL * cdef object s1 = None, s2 = None */ __pyx_v_shape_arr = NULL; /* "petsc4py/PETSc/Vec.pyx":687 * cdef DLManagedTensor* ptr = NULL * cdef int64_t* shape_arr = NULL * cdef int64_t* strides_arr = NULL # <<<<<<<<<<<<<< * cdef object s1 = None, s2 = None * */ __pyx_v_strides_arr = NULL; /* "petsc4py/PETSc/Vec.pyx":688 * cdef int64_t* shape_arr = NULL * cdef int64_t* strides_arr = NULL * cdef object s1 = None, s2 = None # <<<<<<<<<<<<<< * * if vec is None and dltensor is None: */ __Pyx_INCREF(Py_None); __pyx_v_s1 = Py_None; __Pyx_INCREF(Py_None); __pyx_v_s2 = Py_None; /* "petsc4py/PETSc/Vec.pyx":690 * cdef object s1 = None, s2 = None * * if vec is None and dltensor is None: # <<<<<<<<<<<<<< * raise ValueError('Missing input parameters') * if vec is not None: */ __pyx_t_3 = (((PyObject *)__pyx_v_vec) == Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = (__pyx_v_dltensor == Py_None); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (unlikely(__pyx_t_2)) { /* "petsc4py/PETSc/Vec.pyx":691 * * if vec is None and dltensor is None: * raise ValueError('Missing input parameters') # <<<<<<<<<<<<<< * if vec is not None: * ctx = (vec).get_attr('__dltensor_ctx__') */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 691, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(41, 691, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":690 * cdef object s1 = None, s2 = None * * if vec is None and dltensor is None: # <<<<<<<<<<<<<< * raise ValueError('Missing input parameters') * if vec is not None: */ } /* "petsc4py/PETSc/Vec.pyx":692 * if vec is None and dltensor is None: * raise ValueError('Missing input parameters') * if vec is not None: # <<<<<<<<<<<<<< * ctx = (vec).get_attr('__dltensor_ctx__') * if ctx is None: */ __pyx_t_2 = (((PyObject *)__pyx_v_vec) != Py_None); if (__pyx_t_2) { /* "petsc4py/PETSc/Vec.pyx":693 * raise ValueError('Missing input parameters') * if vec is not None: * ctx = (vec).get_attr('__dltensor_ctx__') # <<<<<<<<<<<<<< * if ctx is None: * raise ValueError('Input vector has no tensor information') */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Object *)((struct PyPetscObjectObject *)__pyx_v_vec)->__pyx_vtab)->get_attr(((struct PyPetscObjectObject *)__pyx_v_vec), ((char *)"__dltensor_ctx__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 693, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_ctx, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Vec.pyx":694 * if vec is not None: * ctx = (vec).get_attr('__dltensor_ctx__') * if ctx is None: # <<<<<<<<<<<<<< * raise ValueError('Input vector has no tensor information') * self.set_attr('__dltensor_ctx__', ctx) */ __pyx_t_2 = (__pyx_v_ctx == Py_None); if (unlikely(__pyx_t_2)) { /* "petsc4py/PETSc/Vec.pyx":695 * ctx = (vec).get_attr('__dltensor_ctx__') * if ctx is None: * raise ValueError('Input vector has no tensor information') # <<<<<<<<<<<<<< * self.set_attr('__dltensor_ctx__', ctx) * else: */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 695, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(41, 695, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":694 * if vec is not None: * ctx = (vec).get_attr('__dltensor_ctx__') * if ctx is None: # <<<<<<<<<<<<<< * raise ValueError('Input vector has no tensor information') * self.set_attr('__dltensor_ctx__', ctx) */ } /* "petsc4py/PETSc/Vec.pyx":696 * if ctx is None: * raise ValueError('Input vector has no tensor information') * self.set_attr('__dltensor_ctx__', ctx) # <<<<<<<<<<<<<< * else: * if PyCapsule_IsValid(dltensor, 'dltensor'): */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Vec *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__dltensor_ctx__"), __pyx_v_ctx); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 696, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Vec.pyx":692 * if vec is None and dltensor is None: * raise ValueError('Missing input parameters') * if vec is not None: # <<<<<<<<<<<<<< * ctx = (vec).get_attr('__dltensor_ctx__') * if ctx is None: */ goto __pyx_L6; } /* "petsc4py/PETSc/Vec.pyx":698 * self.set_attr('__dltensor_ctx__', ctx) * else: * if PyCapsule_IsValid(dltensor, 'dltensor'): # <<<<<<<<<<<<<< * ptr = PyCapsule_GetPointer(dltensor, 'dltensor') * elif PyCapsule_IsValid(dltensor, 'used_dltensor'): */ /*else*/ { __pyx_t_2 = PyCapsule_IsValid(__pyx_v_dltensor, ((char const *)"dltensor")); if (__pyx_t_2) { /* "petsc4py/PETSc/Vec.pyx":699 * else: * if PyCapsule_IsValid(dltensor, 'dltensor'): * ptr = PyCapsule_GetPointer(dltensor, 'dltensor') # <<<<<<<<<<<<<< * elif PyCapsule_IsValid(dltensor, 'used_dltensor'): * ptr = PyCapsule_GetPointer(dltensor, 'used_dltensor') */ __pyx_t_4 = PyCapsule_GetPointer(__pyx_v_dltensor, ((char const *)"dltensor")); if (unlikely(__pyx_t_4 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(41, 699, __pyx_L1_error) __pyx_v_ptr = ((struct __pyx_t_8petsc4py_5PETSc_DLManagedTensor *)__pyx_t_4); /* "petsc4py/PETSc/Vec.pyx":698 * self.set_attr('__dltensor_ctx__', ctx) * else: * if PyCapsule_IsValid(dltensor, 'dltensor'): # <<<<<<<<<<<<<< * ptr = PyCapsule_GetPointer(dltensor, 'dltensor') * elif PyCapsule_IsValid(dltensor, 'used_dltensor'): */ goto __pyx_L8; } /* "petsc4py/PETSc/Vec.pyx":700 * if PyCapsule_IsValid(dltensor, 'dltensor'): * ptr = PyCapsule_GetPointer(dltensor, 'dltensor') * elif PyCapsule_IsValid(dltensor, 'used_dltensor'): # <<<<<<<<<<<<<< * ptr = PyCapsule_GetPointer(dltensor, 'used_dltensor') * else: */ __pyx_t_2 = PyCapsule_IsValid(__pyx_v_dltensor, ((char const *)"used_dltensor")); if (likely(__pyx_t_2)) { /* "petsc4py/PETSc/Vec.pyx":701 * ptr = PyCapsule_GetPointer(dltensor, 'dltensor') * elif PyCapsule_IsValid(dltensor, 'used_dltensor'): * ptr = PyCapsule_GetPointer(dltensor, 'used_dltensor') # <<<<<<<<<<<<<< * else: * raise ValueError("Expect a dltensor or used_dltensor field") */ __pyx_t_4 = PyCapsule_GetPointer(__pyx_v_dltensor, ((char const *)"used_dltensor")); if (unlikely(__pyx_t_4 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(41, 701, __pyx_L1_error) __pyx_v_ptr = ((struct __pyx_t_8petsc4py_5PETSc_DLManagedTensor *)__pyx_t_4); /* "petsc4py/PETSc/Vec.pyx":700 * if PyCapsule_IsValid(dltensor, 'dltensor'): * ptr = PyCapsule_GetPointer(dltensor, 'dltensor') * elif PyCapsule_IsValid(dltensor, 'used_dltensor'): # <<<<<<<<<<<<<< * ptr = PyCapsule_GetPointer(dltensor, 'used_dltensor') * else: */ goto __pyx_L8; } /* "petsc4py/PETSc/Vec.pyx":703 * ptr = PyCapsule_GetPointer(dltensor, 'used_dltensor') * else: * raise ValueError("Expect a dltensor or used_dltensor field") # <<<<<<<<<<<<<< * bits = ptr.dl_tensor.dtype.bits * if bits != 8*sizeof(PetscScalar): */ /*else*/ { __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 703, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(41, 703, __pyx_L1_error) } __pyx_L8:; /* "petsc4py/PETSc/Vec.pyx":704 * else: * raise ValueError("Expect a dltensor or used_dltensor field") * bits = ptr.dl_tensor.dtype.bits # <<<<<<<<<<<<<< * if bits != 8*sizeof(PetscScalar): * raise TypeError("Tensor dtype = {} does not match PETSc precision".format(ptr.dl_tensor.dtype)) */ __pyx_t_5 = __pyx_v_ptr->dl_tensor.dtype.bits; __pyx_v_bits = __pyx_t_5; /* "petsc4py/PETSc/Vec.pyx":705 * raise ValueError("Expect a dltensor or used_dltensor field") * bits = ptr.dl_tensor.dtype.bits * if bits != 8*sizeof(PetscScalar): # <<<<<<<<<<<<<< * raise TypeError("Tensor dtype = {} does not match PETSc precision".format(ptr.dl_tensor.dtype)) * ndim = ptr.dl_tensor.ndim */ __pyx_t_2 = (__pyx_v_bits != (8 * (sizeof(PetscScalar)))); if (unlikely(__pyx_t_2)) { /* "petsc4py/PETSc/Vec.pyx":706 * bits = ptr.dl_tensor.dtype.bits * if bits != 8*sizeof(PetscScalar): * raise TypeError("Tensor dtype = {} does not match PETSc precision".format(ptr.dl_tensor.dtype)) # <<<<<<<<<<<<<< * ndim = ptr.dl_tensor.ndim * shape = ptr.dl_tensor.shape */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Tensor_dtype_does_not_match_PETS, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(41, 706, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __pyx_convert__to_py_struct____pyx_t_8petsc4py_5PETSc_DLDataType(__pyx_v_ptr->dl_tensor.dtype); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 706, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_7}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 706, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(41, 706, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __PYX_ERR(41, 706, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":705 * raise ValueError("Expect a dltensor or used_dltensor field") * bits = ptr.dl_tensor.dtype.bits * if bits != 8*sizeof(PetscScalar): # <<<<<<<<<<<<<< * raise TypeError("Tensor dtype = {} does not match PETSc precision".format(ptr.dl_tensor.dtype)) * ndim = ptr.dl_tensor.ndim */ } /* "petsc4py/PETSc/Vec.pyx":707 * if bits != 8*sizeof(PetscScalar): * raise TypeError("Tensor dtype = {} does not match PETSc precision".format(ptr.dl_tensor.dtype)) * ndim = ptr.dl_tensor.ndim # <<<<<<<<<<<<<< * shape = ptr.dl_tensor.shape * strides = ptr.dl_tensor.strides */ __pyx_t_9 = __pyx_v_ptr->dl_tensor.ndim; __pyx_v_ndim = __pyx_t_9; /* "petsc4py/PETSc/Vec.pyx":708 * raise TypeError("Tensor dtype = {} does not match PETSc precision".format(ptr.dl_tensor.dtype)) * ndim = ptr.dl_tensor.ndim * shape = ptr.dl_tensor.shape # <<<<<<<<<<<<<< * strides = ptr.dl_tensor.strides * s1 = oarray_p(empty_p(ndim), NULL, &shape_arr) */ __pyx_t_10 = __pyx_v_ptr->dl_tensor.shape; __pyx_v_shape = __pyx_t_10; /* "petsc4py/PETSc/Vec.pyx":709 * ndim = ptr.dl_tensor.ndim * shape = ptr.dl_tensor.shape * strides = ptr.dl_tensor.strides # <<<<<<<<<<<<<< * s1 = oarray_p(empty_p(ndim), NULL, &shape_arr) * s2 = oarray_p(empty_p(ndim), NULL, &strides_arr) */ __pyx_t_10 = __pyx_v_ptr->dl_tensor.strides; __pyx_v_strides = __pyx_t_10; /* "petsc4py/PETSc/Vec.pyx":710 * shape = ptr.dl_tensor.shape * strides = ptr.dl_tensor.strides * s1 = oarray_p(empty_p(ndim), NULL, &shape_arr) # <<<<<<<<<<<<<< * s2 = oarray_p(empty_p(ndim), NULL, &strides_arr) * for i in range(ndim): */ __pyx_t_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_ndim)); if (unlikely(!__pyx_t_6)) __PYX_ERR(41, 710, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_6, NULL, ((void **)(&__pyx_v_shape_arr)))); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 710, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF_SET(__pyx_v_s1, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Vec.pyx":711 * strides = ptr.dl_tensor.strides * s1 = oarray_p(empty_p(ndim), NULL, &shape_arr) * s2 = oarray_p(empty_p(ndim), NULL, &strides_arr) # <<<<<<<<<<<<<< * for i in range(ndim): * shape_arr[i] = shape[i] */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 711, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_1, NULL, ((void **)(&__pyx_v_strides_arr)))); if (unlikely(!__pyx_t_6)) __PYX_ERR(41, 711, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_s2, __pyx_t_6); __pyx_t_6 = 0; /* "petsc4py/PETSc/Vec.pyx":712 * s1 = oarray_p(empty_p(ndim), NULL, &shape_arr) * s2 = oarray_p(empty_p(ndim), NULL, &strides_arr) * for i in range(ndim): # <<<<<<<<<<<<<< * shape_arr[i] = shape[i] * strides_arr[i] = strides[i] */ __pyx_t_9 = __pyx_v_ndim; __pyx_t_11 = __pyx_t_9; for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { __pyx_v_i = __pyx_t_12; /* "petsc4py/PETSc/Vec.pyx":713 * s2 = oarray_p(empty_p(ndim), NULL, &strides_arr) * for i in range(ndim): * shape_arr[i] = shape[i] # <<<<<<<<<<<<<< * strides_arr[i] = strides[i] * self.set_attr('__dltensor_ctx__', (ptr.dl_tensor.ctx.device_type, ptr.dl_tensor.ctx.device_id, ndim, s1, s2)) */ (__pyx_v_shape_arr[__pyx_v_i]) = (__pyx_v_shape[__pyx_v_i]); /* "petsc4py/PETSc/Vec.pyx":714 * for i in range(ndim): * shape_arr[i] = shape[i] * strides_arr[i] = strides[i] # <<<<<<<<<<<<<< * self.set_attr('__dltensor_ctx__', (ptr.dl_tensor.ctx.device_type, ptr.dl_tensor.ctx.device_id, ndim, s1, s2)) * return self */ (__pyx_v_strides_arr[__pyx_v_i]) = (__pyx_v_strides[__pyx_v_i]); } /* "petsc4py/PETSc/Vec.pyx":715 * shape_arr[i] = shape[i] * strides_arr[i] = strides[i] * self.set_attr('__dltensor_ctx__', (ptr.dl_tensor.ctx.device_type, ptr.dl_tensor.ctx.device_id, ndim, s1, s2)) # <<<<<<<<<<<<<< * return self * */ __pyx_t_6 = __Pyx_PyInt_From_enum____pyx_t_8petsc4py_5PETSc_PetscDLDeviceType(__pyx_v_ptr->dl_tensor.ctx.device_type); if (unlikely(!__pyx_t_6)) __PYX_ERR(41, 715, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ptr->dl_tensor.ctx.device_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 715, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_ndim); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 715, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PyTuple_New(5); if (unlikely(!__pyx_t_8)) __PYX_ERR(41, 715, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_6); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6)) __PYX_ERR(41, 715, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_1)) __PYX_ERR(41, 715, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7)) __PYX_ERR(41, 715, __pyx_L1_error); __Pyx_INCREF(__pyx_v_s1); __Pyx_GIVEREF(__pyx_v_s1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_v_s1)) __PYX_ERR(41, 715, __pyx_L1_error); __Pyx_INCREF(__pyx_v_s2); __Pyx_GIVEREF(__pyx_v_s2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 4, __pyx_v_s2)) __PYX_ERR(41, 715, __pyx_L1_error); __pyx_t_6 = 0; __pyx_t_1 = 0; __pyx_t_7 = 0; __pyx_t_7 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Vec *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__dltensor_ctx__"), __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 715, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_L6:; /* "petsc4py/PETSc/Vec.pyx":716 * strides_arr[i] = strides[i] * self.set_attr('__dltensor_ctx__', (ptr.dl_tensor.ctx.device_type, ptr.dl_tensor.ctx.device_id, ndim, s1, s2)) * return self # <<<<<<<<<<<<<< * * def clearDLPackInfo(self) -> Self: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":655 * return self * * def attachDLPackInfo( # <<<<<<<<<<<<<< * self, * Vec vec=None, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("petsc4py.PETSc.Vec.attachDLPackInfo", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ctx0); __Pyx_XDECREF(__pyx_v_ctx); __Pyx_XDECREF(__pyx_v_s1); __Pyx_XDECREF(__pyx_v_s2); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":718 * return self * * def clearDLPackInfo(self) -> Self: # <<<<<<<<<<<<<< * """Clear tensor information. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_79clearDLPackInfo(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_78clearDLPackInfo, "Vec.clearDLPackInfo(self) -> Self\nClear tensor information.\n\n Logically collective.\n\n See Also\n --------\n attachDLPackInfo, createWithDLPack\n\n \nSource code at petsc4py/PETSc/Vec.pyx:718"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_79clearDLPackInfo(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("clearDLPackInfo (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("clearDLPackInfo", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "clearDLPackInfo", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_78clearDLPackInfo(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_78clearDLPackInfo(struct PyPetscVecObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("clearDLPackInfo", 1); /* "petsc4py/PETSc/Vec.pyx":728 * * """ * self.set_attr('__dltensor_ctx__', None) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Vec *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__dltensor_ctx__"), Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 728, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Vec.pyx":729 * """ * self.set_attr('__dltensor_ctx__', None) * return self # <<<<<<<<<<<<<< * * # TODO Stream */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":718 * return self * * def clearDLPackInfo(self) -> Self: # <<<<<<<<<<<<<< * """Clear tensor information. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Vec.clearDLPackInfo", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":732 * * # TODO Stream * def __dlpack__(self, stream=-1): # <<<<<<<<<<<<<< * return self.toDLPack('rw') * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_81__dlpack__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_80__dlpack__, "Vec.__dlpack__(self, stream=-1)\nSource code at petsc4py/PETSc/Vec.pyx:732"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_81__dlpack__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v_stream = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dlpack__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stream,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_neg_1)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_stream); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 732, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__dlpack__") < 0)) __PYX_ERR(41, 732, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_stream = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__dlpack__", 0, 0, 1, __pyx_nargs); __PYX_ERR(41, 732, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.__dlpack__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_80__dlpack__(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_stream); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_80__dlpack__(struct PyPetscVecObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_stream) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__dlpack__", 1); /* "petsc4py/PETSc/Vec.pyx":733 * # TODO Stream * def __dlpack__(self, stream=-1): * return self.toDLPack('rw') # <<<<<<<<<<<<<< * * def __dlpack_device__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_toDLPack); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 733, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_n_s_rw}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 733, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":732 * * # TODO Stream * def __dlpack__(self, stream=-1): # <<<<<<<<<<<<<< * return self.toDLPack('rw') * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Vec.__dlpack__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":735 * return self.toDLPack('rw') * * def __dlpack_device__(self): # <<<<<<<<<<<<<< * (dltype, devId, _, _, _) = vec_get_dlpack_ctx(self) * return (dltype, devId) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_83__dlpack_device__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_82__dlpack_device__, "Vec.__dlpack_device__(self)\nSource code at petsc4py/PETSc/Vec.pyx:735"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_83__dlpack_device__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dlpack_device__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__dlpack_device__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__dlpack_device__", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_82__dlpack_device__(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_82__dlpack_device__(struct PyPetscVecObject *__pyx_v_self) { PyObject *__pyx_v_dltype = NULL; PyObject *__pyx_v_devId = NULL; CYTHON_UNUSED PyObject *__pyx_v__ = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__dlpack_device__", 1); /* "petsc4py/PETSc/Vec.pyx":736 * * def __dlpack_device__(self): * (dltype, devId, _, _, _) = vec_get_dlpack_ctx(self) # <<<<<<<<<<<<<< * return (dltype, devId) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_vec_get_dlpack_ctx(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 736, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 5)) { if (size > 5) __Pyx_RaiseTooManyValuesError(5); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(41, 736, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 3); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 4); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); __pyx_t_4 = PyList_GET_ITEM(sequence, 2); __pyx_t_5 = PyList_GET_ITEM(sequence, 3); __pyx_t_6 = PyList_GET_ITEM(sequence, 4); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else { Py_ssize_t i; PyObject** temps[5] = {&__pyx_t_2,&__pyx_t_3,&__pyx_t_4,&__pyx_t_5,&__pyx_t_6}; for (i=0; i < 5; i++) { PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(41, 736, __pyx_L1_error) __Pyx_GOTREF(item); *(temps[i]) = item; } } #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; PyObject** temps[5] = {&__pyx_t_2,&__pyx_t_3,&__pyx_t_4,&__pyx_t_5,&__pyx_t_6}; __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 736, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); for (index=0; index < 5; index++) { PyObject* item = __pyx_t_8(__pyx_t_7); if (unlikely(!item)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(item); *(temps[index]) = item; } if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 5) < 0) __PYX_ERR(41, 736, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(41, 736, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_dltype = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_devId = __pyx_t_3; __pyx_t_3 = 0; __pyx_v__ = __pyx_t_4; __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v__, __pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v__, __pyx_t_6); __pyx_t_6 = 0; /* "petsc4py/PETSc/Vec.pyx":737 * def __dlpack_device__(self): * (dltype, devId, _, _, _) = vec_get_dlpack_ctx(self) * return (dltype, devId) # <<<<<<<<<<<<<< * * def toDLPack(self, mode: AccessModeSpec = 'rw') -> Any: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 737, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_dltype); __Pyx_GIVEREF(__pyx_v_dltype); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_dltype)) __PYX_ERR(41, 737, __pyx_L1_error); __Pyx_INCREF(__pyx_v_devId); __Pyx_GIVEREF(__pyx_v_devId); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_devId)) __PYX_ERR(41, 737, __pyx_L1_error); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":735 * return self.toDLPack('rw') * * def __dlpack_device__(self): # <<<<<<<<<<<<<< * (dltype, devId, _, _, _) = vec_get_dlpack_ctx(self) * return (dltype, devId) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.Vec.__dlpack_device__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_dltype); __Pyx_XDECREF(__pyx_v_devId); __Pyx_XDECREF(__pyx_v__); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":739 * return (dltype, devId) * * def toDLPack(self, mode: AccessModeSpec = 'rw') -> Any: # <<<<<<<<<<<<<< * """Return a DLPack `PyCapsule` wrapping the vector data. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_85toDLPack(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_84toDLPack, "Vec.toDLPack(self, mode: AccessModeSpec = 'rw') -> Any\nReturn a DLPack `PyCapsule` wrapping the vector data.\n\n Collective.\n\n Parameters\n ----------\n mode\n Access mode for the vector.\n\n Returns\n -------\n `PyCapsule`\n Capsule of a DLPack tensor wrapping a `Vec`.\n\n Notes\n -----\n It is important that the access mode is respected by the consumer\n as this is not enforced internally.\n\n See Also\n --------\n createWithDLPack\n\n \nSource code at petsc4py/PETSc/Vec.pyx:739"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_85toDLPack(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_mode = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("toDLPack (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mode,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_n_s_rw)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mode); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 739, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "toDLPack") < 0)) __PYX_ERR(41, 739, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_mode = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("toDLPack", 0, 0, 1, __pyx_nargs); __PYX_ERR(41, 739, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.toDLPack", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_84toDLPack(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_mode); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_84toDLPack(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_mode) { int64_t __pyx_v_ndim; PyObject *__pyx_v_device_type = NULL; PyObject *__pyx_v_device_id = NULL; PyObject *__pyx_v_shape = NULL; PyObject *__pyx_v_strides = NULL; PyObject *__pyx_v_hostmem = NULL; struct __pyx_t_8petsc4py_5PETSc_DLManagedTensor *__pyx_v_dlm_tensor; struct __pyx_t_8petsc4py_5PETSc_DLTensor *__pyx_v_dl_tensor; PetscScalar *__pyx_v_a; int64_t *__pyx_v_shape_strides; __pyx_t_8petsc4py_5PETSc_DLContext *__pyx_v_ctx; PyObject *__pyx_v_i = NULL; struct __pyx_t_8petsc4py_5PETSc_DLDataType *__pyx_v_dtype; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *(*__pyx_t_10)(PyObject *); int64_t __pyx_t_11; PetscErrorCode __pyx_t_12; enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType __pyx_t_13; int __pyx_t_14; Py_ssize_t __pyx_t_15; PyObject *(*__pyx_t_16)(PyObject *); Py_ssize_t __pyx_t_17; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("toDLPack", 0); __Pyx_INCREF(__pyx_v_mode); /* "petsc4py/PETSc/Vec.pyx":764 * * """ * if mode is None: mode = 'rw' # <<<<<<<<<<<<<< * if mode not in ['rw', 'r', 'w']: * raise ValueError("Invalid mode: expected 'rw', 'r', or 'w'") */ __pyx_t_1 = (__pyx_v_mode == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_n_s_rw); __Pyx_DECREF_SET(__pyx_v_mode, __pyx_n_s_rw); } /* "petsc4py/PETSc/Vec.pyx":765 * """ * if mode is None: mode = 'rw' * if mode not in ['rw', 'r', 'w']: # <<<<<<<<<<<<<< * raise ValueError("Invalid mode: expected 'rw', 'r', or 'w'") * */ __Pyx_INCREF(__pyx_v_mode); __pyx_t_2 = __pyx_v_mode; __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_rw, Py_NE)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(41, 765, __pyx_L1_error) if (__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L5_bool_binop_done; } __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_r, Py_NE)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(41, 765, __pyx_L1_error) if (__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L5_bool_binop_done; } __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_w, Py_NE)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(41, 765, __pyx_L1_error) __pyx_t_1 = __pyx_t_3; __pyx_L5_bool_binop_done:; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = __pyx_t_1; if (unlikely(__pyx_t_3)) { /* "petsc4py/PETSc/Vec.pyx":766 * if mode is None: mode = 'rw' * if mode not in ['rw', 'r', 'w']: * raise ValueError("Invalid mode: expected 'rw', 'r', or 'w'") # <<<<<<<<<<<<<< * * cdef int64_t ndim = 0 */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 766, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(41, 766, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":765 * """ * if mode is None: mode = 'rw' * if mode not in ['rw', 'r', 'w']: # <<<<<<<<<<<<<< * raise ValueError("Invalid mode: expected 'rw', 'r', or 'w'") * */ } /* "petsc4py/PETSc/Vec.pyx":768 * raise ValueError("Invalid mode: expected 'rw', 'r', or 'w'") * * cdef int64_t ndim = 0 # <<<<<<<<<<<<<< * (device_type, device_id, ndim, shape, strides) = vec_get_dlpack_ctx(self) * hostmem = (device_type == kDLCPU) */ __pyx_v_ndim = 0; /* "petsc4py/PETSc/Vec.pyx":769 * * cdef int64_t ndim = 0 * (device_type, device_id, ndim, shape, strides) = vec_get_dlpack_ctx(self) # <<<<<<<<<<<<<< * hostmem = (device_type == kDLCPU) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_vec_get_dlpack_ctx(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 769, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { PyObject* sequence = __pyx_t_2; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 5)) { if (size > 5) __Pyx_RaiseTooManyValuesError(5); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(41, 769, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_7 = PyTuple_GET_ITEM(sequence, 3); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 4); } else { __pyx_t_4 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); __pyx_t_7 = PyList_GET_ITEM(sequence, 3); __pyx_t_8 = PyList_GET_ITEM(sequence, 4); } __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); #else { Py_ssize_t i; PyObject** temps[5] = {&__pyx_t_4,&__pyx_t_5,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8}; for (i=0; i < 5; i++) { PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(41, 769, __pyx_L1_error) __Pyx_GOTREF(item); *(temps[i]) = item; } } #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; PyObject** temps[5] = {&__pyx_t_4,&__pyx_t_5,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8}; __pyx_t_9 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(41, 769, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_10 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); for (index=0; index < 5; index++) { PyObject* item = __pyx_t_10(__pyx_t_9); if (unlikely(!item)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(item); *(temps[index]) = item; } if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 5) < 0) __PYX_ERR(41, 769, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(41, 769, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_t_11 = __Pyx_PyInt_As_int64_t(__pyx_t_6); if (unlikely((__pyx_t_11 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(41, 769, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_device_type = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_device_id = __pyx_t_5; __pyx_t_5 = 0; __pyx_v_ndim = __pyx_t_11; __pyx_v_shape = __pyx_t_7; __pyx_t_7 = 0; __pyx_v_strides = __pyx_t_8; __pyx_t_8 = 0; /* "petsc4py/PETSc/Vec.pyx":770 * cdef int64_t ndim = 0 * (device_type, device_id, ndim, shape, strides) = vec_get_dlpack_ctx(self) * hostmem = (device_type == kDLCPU) # <<<<<<<<<<<<<< * * cdef DLManagedTensor* dlm_tensor = malloc(sizeof(DLManagedTensor)) */ __pyx_t_2 = __Pyx_PyInt_From_enum____pyx_t_8petsc4py_5PETSc_PetscDLDeviceType(__pyx_e_8petsc4py_5PETSc_kDLCPU); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 770, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_8 = PyObject_RichCompare(__pyx_v_device_type, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(41, 770, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_hostmem = __pyx_t_8; __pyx_t_8 = 0; /* "petsc4py/PETSc/Vec.pyx":772 * hostmem = (device_type == kDLCPU) * * cdef DLManagedTensor* dlm_tensor = malloc(sizeof(DLManagedTensor)) # <<<<<<<<<<<<<< * cdef DLTensor* dl_tensor = &dlm_tensor.dl_tensor * cdef PetscScalar *a = NULL */ __pyx_v_dlm_tensor = ((struct __pyx_t_8petsc4py_5PETSc_DLManagedTensor *)malloc((sizeof(struct __pyx_t_8petsc4py_5PETSc_DLManagedTensor)))); /* "petsc4py/PETSc/Vec.pyx":773 * * cdef DLManagedTensor* dlm_tensor = malloc(sizeof(DLManagedTensor)) * cdef DLTensor* dl_tensor = &dlm_tensor.dl_tensor # <<<<<<<<<<<<<< * cdef PetscScalar *a = NULL * cdef int64_t* shape_strides = NULL */ __pyx_v_dl_tensor = (&__pyx_v_dlm_tensor->dl_tensor); /* "petsc4py/PETSc/Vec.pyx":774 * cdef DLManagedTensor* dlm_tensor = malloc(sizeof(DLManagedTensor)) * cdef DLTensor* dl_tensor = &dlm_tensor.dl_tensor * cdef PetscScalar *a = NULL # <<<<<<<<<<<<<< * cdef int64_t* shape_strides = NULL * dl_tensor.byte_offset = 0 */ __pyx_v_a = NULL; /* "petsc4py/PETSc/Vec.pyx":775 * cdef DLTensor* dl_tensor = &dlm_tensor.dl_tensor * cdef PetscScalar *a = NULL * cdef int64_t* shape_strides = NULL # <<<<<<<<<<<<<< * dl_tensor.byte_offset = 0 * */ __pyx_v_shape_strides = NULL; /* "petsc4py/PETSc/Vec.pyx":776 * cdef PetscScalar *a = NULL * cdef int64_t* shape_strides = NULL * dl_tensor.byte_offset = 0 # <<<<<<<<<<<<<< * * # DLPack does not currently play well with our get/restore model */ __pyx_v_dl_tensor->byte_offset = 0; /* "petsc4py/PETSc/Vec.pyx":782 * # and not modify memory requested with read access * # By restoring now, we guarantee the sanity of the ObjectState * if mode == 'w': # <<<<<<<<<<<<<< * if hostmem: * CHKERR( VecGetArrayWrite(self.vec, &a) ) */ __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_w, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(41, 782, __pyx_L1_error) if (__pyx_t_3) { /* "petsc4py/PETSc/Vec.pyx":783 * # By restoring now, we guarantee the sanity of the ObjectState * if mode == 'w': * if hostmem: # <<<<<<<<<<<<<< * CHKERR( VecGetArrayWrite(self.vec, &a) ) * CHKERR( VecRestoreArrayWrite(self.vec, NULL) ) */ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_hostmem); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(41, 783, __pyx_L1_error) if (__pyx_t_3) { /* "petsc4py/PETSc/Vec.pyx":784 * if mode == 'w': * if hostmem: * CHKERR( VecGetArrayWrite(self.vec, &a) ) # <<<<<<<<<<<<<< * CHKERR( VecRestoreArrayWrite(self.vec, NULL) ) * else: */ __pyx_t_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetArrayWrite(__pyx_v_self->vec, ((PetscScalar **)(&__pyx_v_a)))); if (unlikely(__pyx_t_12 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 784, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":785 * if hostmem: * CHKERR( VecGetArrayWrite(self.vec, &a) ) * CHKERR( VecRestoreArrayWrite(self.vec, NULL) ) # <<<<<<<<<<<<<< * else: * CHKERR( VecGetArrayWriteAndMemType(self.vec, &a, NULL) ) */ __pyx_t_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecRestoreArrayWrite(__pyx_v_self->vec, NULL)); if (unlikely(__pyx_t_12 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 785, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":783 * # By restoring now, we guarantee the sanity of the ObjectState * if mode == 'w': * if hostmem: # <<<<<<<<<<<<<< * CHKERR( VecGetArrayWrite(self.vec, &a) ) * CHKERR( VecRestoreArrayWrite(self.vec, NULL) ) */ goto __pyx_L11; } /* "petsc4py/PETSc/Vec.pyx":787 * CHKERR( VecRestoreArrayWrite(self.vec, NULL) ) * else: * CHKERR( VecGetArrayWriteAndMemType(self.vec, &a, NULL) ) # <<<<<<<<<<<<<< * CHKERR( VecRestoreArrayWriteAndMemType(self.vec, NULL) ) * elif mode == 'r': */ /*else*/ { __pyx_t_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetArrayWriteAndMemType(__pyx_v_self->vec, ((PetscScalar **)(&__pyx_v_a)), NULL)); if (unlikely(__pyx_t_12 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 787, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":788 * else: * CHKERR( VecGetArrayWriteAndMemType(self.vec, &a, NULL) ) * CHKERR( VecRestoreArrayWriteAndMemType(self.vec, NULL) ) # <<<<<<<<<<<<<< * elif mode == 'r': * if hostmem: */ __pyx_t_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecRestoreArrayWriteAndMemType(__pyx_v_self->vec, NULL)); if (unlikely(__pyx_t_12 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 788, __pyx_L1_error) } __pyx_L11:; /* "petsc4py/PETSc/Vec.pyx":782 * # and not modify memory requested with read access * # By restoring now, we guarantee the sanity of the ObjectState * if mode == 'w': # <<<<<<<<<<<<<< * if hostmem: * CHKERR( VecGetArrayWrite(self.vec, &a) ) */ goto __pyx_L10; } /* "petsc4py/PETSc/Vec.pyx":789 * CHKERR( VecGetArrayWriteAndMemType(self.vec, &a, NULL) ) * CHKERR( VecRestoreArrayWriteAndMemType(self.vec, NULL) ) * elif mode == 'r': # <<<<<<<<<<<<<< * if hostmem: * CHKERR( VecGetArrayRead(self.vec, &a) ) */ __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_r, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(41, 789, __pyx_L1_error) if (__pyx_t_3) { /* "petsc4py/PETSc/Vec.pyx":790 * CHKERR( VecRestoreArrayWriteAndMemType(self.vec, NULL) ) * elif mode == 'r': * if hostmem: # <<<<<<<<<<<<<< * CHKERR( VecGetArrayRead(self.vec, &a) ) * CHKERR( VecRestoreArrayRead(self.vec, NULL) ) */ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_hostmem); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(41, 790, __pyx_L1_error) if (__pyx_t_3) { /* "petsc4py/PETSc/Vec.pyx":791 * elif mode == 'r': * if hostmem: * CHKERR( VecGetArrayRead(self.vec, &a) ) # <<<<<<<<<<<<<< * CHKERR( VecRestoreArrayRead(self.vec, NULL) ) * else: */ __pyx_t_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetArrayRead(__pyx_v_self->vec, ((PetscScalar const **)(&__pyx_v_a)))); if (unlikely(__pyx_t_12 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 791, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":792 * if hostmem: * CHKERR( VecGetArrayRead(self.vec, &a) ) * CHKERR( VecRestoreArrayRead(self.vec, NULL) ) # <<<<<<<<<<<<<< * else: * CHKERR( VecGetArrayReadAndMemType(self.vec, &a, NULL) ) */ __pyx_t_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecRestoreArrayRead(__pyx_v_self->vec, NULL)); if (unlikely(__pyx_t_12 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 792, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":790 * CHKERR( VecRestoreArrayWriteAndMemType(self.vec, NULL) ) * elif mode == 'r': * if hostmem: # <<<<<<<<<<<<<< * CHKERR( VecGetArrayRead(self.vec, &a) ) * CHKERR( VecRestoreArrayRead(self.vec, NULL) ) */ goto __pyx_L12; } /* "petsc4py/PETSc/Vec.pyx":794 * CHKERR( VecRestoreArrayRead(self.vec, NULL) ) * else: * CHKERR( VecGetArrayReadAndMemType(self.vec, &a, NULL) ) # <<<<<<<<<<<<<< * CHKERR( VecRestoreArrayReadAndMemType(self.vec, NULL) ) * else: */ /*else*/ { __pyx_t_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetArrayReadAndMemType(__pyx_v_self->vec, ((PetscScalar const **)(&__pyx_v_a)), NULL)); if (unlikely(__pyx_t_12 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 794, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":795 * else: * CHKERR( VecGetArrayReadAndMemType(self.vec, &a, NULL) ) * CHKERR( VecRestoreArrayReadAndMemType(self.vec, NULL) ) # <<<<<<<<<<<<<< * else: * if hostmem: */ __pyx_t_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecRestoreArrayReadAndMemType(__pyx_v_self->vec, NULL)); if (unlikely(__pyx_t_12 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 795, __pyx_L1_error) } __pyx_L12:; /* "petsc4py/PETSc/Vec.pyx":789 * CHKERR( VecGetArrayWriteAndMemType(self.vec, &a, NULL) ) * CHKERR( VecRestoreArrayWriteAndMemType(self.vec, NULL) ) * elif mode == 'r': # <<<<<<<<<<<<<< * if hostmem: * CHKERR( VecGetArrayRead(self.vec, &a) ) */ goto __pyx_L10; } /* "petsc4py/PETSc/Vec.pyx":797 * CHKERR( VecRestoreArrayReadAndMemType(self.vec, NULL) ) * else: * if hostmem: # <<<<<<<<<<<<<< * CHKERR( VecGetArray(self.vec, &a) ) * CHKERR( VecRestoreArray(self.vec, NULL) ) */ /*else*/ { __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_hostmem); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(41, 797, __pyx_L1_error) if (__pyx_t_3) { /* "petsc4py/PETSc/Vec.pyx":798 * else: * if hostmem: * CHKERR( VecGetArray(self.vec, &a) ) # <<<<<<<<<<<<<< * CHKERR( VecRestoreArray(self.vec, NULL) ) * else: */ __pyx_t_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetArray(__pyx_v_self->vec, ((PetscScalar **)(&__pyx_v_a)))); if (unlikely(__pyx_t_12 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 798, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":799 * if hostmem: * CHKERR( VecGetArray(self.vec, &a) ) * CHKERR( VecRestoreArray(self.vec, NULL) ) # <<<<<<<<<<<<<< * else: * CHKERR( VecGetArrayAndMemType(self.vec, &a, NULL) ) */ __pyx_t_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecRestoreArray(__pyx_v_self->vec, NULL)); if (unlikely(__pyx_t_12 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 799, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":797 * CHKERR( VecRestoreArrayReadAndMemType(self.vec, NULL) ) * else: * if hostmem: # <<<<<<<<<<<<<< * CHKERR( VecGetArray(self.vec, &a) ) * CHKERR( VecRestoreArray(self.vec, NULL) ) */ goto __pyx_L13; } /* "petsc4py/PETSc/Vec.pyx":801 * CHKERR( VecRestoreArray(self.vec, NULL) ) * else: * CHKERR( VecGetArrayAndMemType(self.vec, &a, NULL) ) # <<<<<<<<<<<<<< * CHKERR( VecRestoreArrayAndMemType(self.vec, NULL) ) * dl_tensor.data = a */ /*else*/ { __pyx_t_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetArrayAndMemType(__pyx_v_self->vec, ((PetscScalar **)(&__pyx_v_a)), NULL)); if (unlikely(__pyx_t_12 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 801, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":802 * else: * CHKERR( VecGetArrayAndMemType(self.vec, &a, NULL) ) * CHKERR( VecRestoreArrayAndMemType(self.vec, NULL) ) # <<<<<<<<<<<<<< * dl_tensor.data = a * */ __pyx_t_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecRestoreArrayAndMemType(__pyx_v_self->vec, NULL)); if (unlikely(__pyx_t_12 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 802, __pyx_L1_error) } __pyx_L13:; } __pyx_L10:; /* "petsc4py/PETSc/Vec.pyx":803 * CHKERR( VecGetArrayAndMemType(self.vec, &a, NULL) ) * CHKERR( VecRestoreArrayAndMemType(self.vec, NULL) ) * dl_tensor.data = a # <<<<<<<<<<<<<< * * cdef DLContext* ctx = &dl_tensor.ctx */ __pyx_v_dl_tensor->data = ((void *)__pyx_v_a); /* "petsc4py/PETSc/Vec.pyx":805 * dl_tensor.data = a * * cdef DLContext* ctx = &dl_tensor.ctx # <<<<<<<<<<<<<< * ctx.device_type = device_type * ctx.device_id = device_id */ __pyx_v_ctx = (&__pyx_v_dl_tensor->ctx); /* "petsc4py/PETSc/Vec.pyx":806 * * cdef DLContext* ctx = &dl_tensor.ctx * ctx.device_type = device_type # <<<<<<<<<<<<<< * ctx.device_id = device_id * shape_strides = malloc(sizeof(int64_t)*2*ndim) */ __pyx_t_13 = ((enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType)__Pyx_PyInt_As_enum____pyx_t_8petsc4py_5PETSc_PetscDLDeviceType(__pyx_v_device_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 806, __pyx_L1_error) __pyx_v_ctx->device_type = __pyx_t_13; /* "petsc4py/PETSc/Vec.pyx":807 * cdef DLContext* ctx = &dl_tensor.ctx * ctx.device_type = device_type * ctx.device_id = device_id # <<<<<<<<<<<<<< * shape_strides = malloc(sizeof(int64_t)*2*ndim) * for i in range(ndim): */ __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_v_device_id); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(41, 807, __pyx_L1_error) __pyx_v_ctx->device_id = __pyx_t_14; /* "petsc4py/PETSc/Vec.pyx":808 * ctx.device_type = device_type * ctx.device_id = device_id * shape_strides = malloc(sizeof(int64_t)*2*ndim) # <<<<<<<<<<<<<< * for i in range(ndim): * shape_strides[i] = shape[i] */ __pyx_v_shape_strides = ((int64_t *)malloc((((sizeof(int64_t)) * 2) * __pyx_v_ndim))); /* "petsc4py/PETSc/Vec.pyx":809 * ctx.device_id = device_id * shape_strides = malloc(sizeof(int64_t)*2*ndim) * for i in range(ndim): # <<<<<<<<<<<<<< * shape_strides[i] = shape[i] * for i in range(ndim): */ __pyx_t_8 = __Pyx_PyInt_From_int64_t(__pyx_v_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(41, 809, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 809, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_8 = __pyx_t_2; __Pyx_INCREF(__pyx_t_8); __pyx_t_15 = 0; __pyx_t_16 = NULL; } else { __pyx_t_15 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(41, 809, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_16 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_16)) __PYX_ERR(41, 809, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { if (likely(!__pyx_t_16)) { if (likely(PyList_CheckExact(__pyx_t_8))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_8); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(41, 809, __pyx_L1_error) #endif if (__pyx_t_15 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_15); __Pyx_INCREF(__pyx_t_2); __pyx_t_15++; if (unlikely((0 < 0))) __PYX_ERR(41, 809, __pyx_L1_error) #else __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 809, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_8); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(41, 809, __pyx_L1_error) #endif if (__pyx_t_15 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_15); __Pyx_INCREF(__pyx_t_2); __pyx_t_15++; if (unlikely((0 < 0))) __PYX_ERR(41, 809, __pyx_L1_error) #else __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 809, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } } else { __pyx_t_2 = __pyx_t_16(__pyx_t_8); if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(41, 809, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_2); } __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/Vec.pyx":810 * shape_strides = malloc(sizeof(int64_t)*2*ndim) * for i in range(ndim): * shape_strides[i] = shape[i] # <<<<<<<<<<<<<< * for i in range(ndim): * shape_strides[i+ndim] = strides[i] */ __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_shape, __pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 810, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_11 = __Pyx_PyInt_As_int64_t(__pyx_t_2); if (unlikely((__pyx_t_11 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(41, 810, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_17 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_17 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(41, 810, __pyx_L1_error) (__pyx_v_shape_strides[__pyx_t_17]) = __pyx_t_11; /* "petsc4py/PETSc/Vec.pyx":809 * ctx.device_id = device_id * shape_strides = malloc(sizeof(int64_t)*2*ndim) * for i in range(ndim): # <<<<<<<<<<<<<< * shape_strides[i] = shape[i] * for i in range(ndim): */ } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "petsc4py/PETSc/Vec.pyx":811 * for i in range(ndim): * shape_strides[i] = shape[i] * for i in range(ndim): # <<<<<<<<<<<<<< * shape_strides[i+ndim] = strides[i] * dl_tensor.ndim = ndim */ __pyx_t_8 = __Pyx_PyInt_From_int64_t(__pyx_v_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(41, 811, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 811, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_8 = __pyx_t_2; __Pyx_INCREF(__pyx_t_8); __pyx_t_15 = 0; __pyx_t_16 = NULL; } else { __pyx_t_15 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(41, 811, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_16 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_16)) __PYX_ERR(41, 811, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { if (likely(!__pyx_t_16)) { if (likely(PyList_CheckExact(__pyx_t_8))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_8); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(41, 811, __pyx_L1_error) #endif if (__pyx_t_15 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_15); __Pyx_INCREF(__pyx_t_2); __pyx_t_15++; if (unlikely((0 < 0))) __PYX_ERR(41, 811, __pyx_L1_error) #else __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 811, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_8); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(41, 811, __pyx_L1_error) #endif if (__pyx_t_15 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_15); __Pyx_INCREF(__pyx_t_2); __pyx_t_15++; if (unlikely((0 < 0))) __PYX_ERR(41, 811, __pyx_L1_error) #else __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 811, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } } else { __pyx_t_2 = __pyx_t_16(__pyx_t_8); if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(41, 811, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_2); } __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/Vec.pyx":812 * shape_strides[i] = shape[i] * for i in range(ndim): * shape_strides[i+ndim] = strides[i] # <<<<<<<<<<<<<< * dl_tensor.ndim = ndim * dl_tensor.shape = shape_strides */ __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_strides, __pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 812, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_11 = __Pyx_PyInt_As_int64_t(__pyx_t_2); if (unlikely((__pyx_t_11 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(41, 812, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 812, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = PyNumber_Add(__pyx_v_i, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 812, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_17 = __Pyx_PyIndex_AsSsize_t(__pyx_t_7); if (unlikely((__pyx_t_17 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(41, 812, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; (__pyx_v_shape_strides[__pyx_t_17]) = __pyx_t_11; /* "petsc4py/PETSc/Vec.pyx":811 * for i in range(ndim): * shape_strides[i] = shape[i] * for i in range(ndim): # <<<<<<<<<<<<<< * shape_strides[i+ndim] = strides[i] * dl_tensor.ndim = ndim */ } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "petsc4py/PETSc/Vec.pyx":813 * for i in range(ndim): * shape_strides[i+ndim] = strides[i] * dl_tensor.ndim = ndim # <<<<<<<<<<<<<< * dl_tensor.shape = shape_strides * dl_tensor.strides = shape_strides + ndim */ __pyx_v_dl_tensor->ndim = __pyx_v_ndim; /* "petsc4py/PETSc/Vec.pyx":814 * shape_strides[i+ndim] = strides[i] * dl_tensor.ndim = ndim * dl_tensor.shape = shape_strides # <<<<<<<<<<<<<< * dl_tensor.strides = shape_strides + ndim * */ __pyx_v_dl_tensor->shape = __pyx_v_shape_strides; /* "petsc4py/PETSc/Vec.pyx":815 * dl_tensor.ndim = ndim * dl_tensor.shape = shape_strides * dl_tensor.strides = shape_strides + ndim # <<<<<<<<<<<<<< * * cdef DLDataType* dtype = &dl_tensor.dtype */ __pyx_v_dl_tensor->strides = (__pyx_v_shape_strides + __pyx_v_ndim); /* "petsc4py/PETSc/Vec.pyx":817 * dl_tensor.strides = shape_strides + ndim * * cdef DLDataType* dtype = &dl_tensor.dtype # <<<<<<<<<<<<<< * dtype.code = DLDataTypeCode.kDLFloat * if sizeof(PetscScalar) == 8: */ __pyx_v_dtype = (&__pyx_v_dl_tensor->dtype); /* "petsc4py/PETSc/Vec.pyx":818 * * cdef DLDataType* dtype = &dl_tensor.dtype * dtype.code = DLDataTypeCode.kDLFloat # <<<<<<<<<<<<<< * if sizeof(PetscScalar) == 8: * dtype.bits = 64 */ __pyx_v_dtype->code = ((uint8_t)__pyx_e_8petsc4py_5PETSc_kDLFloat); /* "petsc4py/PETSc/Vec.pyx":819 * cdef DLDataType* dtype = &dl_tensor.dtype * dtype.code = DLDataTypeCode.kDLFloat * if sizeof(PetscScalar) == 8: # <<<<<<<<<<<<<< * dtype.bits = 64 * elif sizeof(PetscScalar) == 4: */ __pyx_t_3 = ((sizeof(PetscScalar)) == 8); if (__pyx_t_3) { /* "petsc4py/PETSc/Vec.pyx":820 * dtype.code = DLDataTypeCode.kDLFloat * if sizeof(PetscScalar) == 8: * dtype.bits = 64 # <<<<<<<<<<<<<< * elif sizeof(PetscScalar) == 4: * dtype.bits = 32 */ __pyx_v_dtype->bits = ((uint8_t)64); /* "petsc4py/PETSc/Vec.pyx":819 * cdef DLDataType* dtype = &dl_tensor.dtype * dtype.code = DLDataTypeCode.kDLFloat * if sizeof(PetscScalar) == 8: # <<<<<<<<<<<<<< * dtype.bits = 64 * elif sizeof(PetscScalar) == 4: */ goto __pyx_L20; } /* "petsc4py/PETSc/Vec.pyx":821 * if sizeof(PetscScalar) == 8: * dtype.bits = 64 * elif sizeof(PetscScalar) == 4: # <<<<<<<<<<<<<< * dtype.bits = 32 * else: */ __pyx_t_3 = ((sizeof(PetscScalar)) == 4); if (likely(__pyx_t_3)) { /* "petsc4py/PETSc/Vec.pyx":822 * dtype.bits = 64 * elif sizeof(PetscScalar) == 4: * dtype.bits = 32 # <<<<<<<<<<<<<< * else: * raise ValueError('Unsupported PetscScalar type') */ __pyx_v_dtype->bits = ((uint8_t)32); /* "petsc4py/PETSc/Vec.pyx":821 * if sizeof(PetscScalar) == 8: * dtype.bits = 64 * elif sizeof(PetscScalar) == 4: # <<<<<<<<<<<<<< * dtype.bits = 32 * else: */ goto __pyx_L20; } /* "petsc4py/PETSc/Vec.pyx":824 * dtype.bits = 32 * else: * raise ValueError('Unsupported PetscScalar type') # <<<<<<<<<<<<<< * dtype.lanes = 1 * dlm_tensor.manager_ctx = self.vec */ /*else*/ { __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(41, 824, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __PYX_ERR(41, 824, __pyx_L1_error) } __pyx_L20:; /* "petsc4py/PETSc/Vec.pyx":825 * else: * raise ValueError('Unsupported PetscScalar type') * dtype.lanes = 1 # <<<<<<<<<<<<<< * dlm_tensor.manager_ctx = self.vec * CHKERR( PetscObjectReference(self.vec) ) */ __pyx_v_dtype->lanes = ((uint16_t)1); /* "petsc4py/PETSc/Vec.pyx":826 * raise ValueError('Unsupported PetscScalar type') * dtype.lanes = 1 * dlm_tensor.manager_ctx = self.vec # <<<<<<<<<<<<<< * CHKERR( PetscObjectReference(self.vec) ) * dlm_tensor.manager_deleter = manager_deleter */ __pyx_v_dlm_tensor->manager_ctx = ((void *)__pyx_v_self->vec); /* "petsc4py/PETSc/Vec.pyx":827 * dtype.lanes = 1 * dlm_tensor.manager_ctx = self.vec * CHKERR( PetscObjectReference(self.vec) ) # <<<<<<<<<<<<<< * dlm_tensor.manager_deleter = manager_deleter * dlm_tensor.del_obj = PetscDEALLOC */ __pyx_t_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectReference(((PetscObject)__pyx_v_self->vec))); if (unlikely(__pyx_t_12 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 827, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":828 * dlm_tensor.manager_ctx = self.vec * CHKERR( PetscObjectReference(self.vec) ) * dlm_tensor.manager_deleter = manager_deleter # <<<<<<<<<<<<<< * dlm_tensor.del_obj = PetscDEALLOC * return PyCapsule_New(dlm_tensor, 'dltensor', pycapsule_deleter) */ __pyx_v_dlm_tensor->manager_deleter = __pyx_f_8petsc4py_5PETSc_manager_deleter; /* "petsc4py/PETSc/Vec.pyx":829 * CHKERR( PetscObjectReference(self.vec) ) * dlm_tensor.manager_deleter = manager_deleter * dlm_tensor.del_obj = PetscDEALLOC # <<<<<<<<<<<<<< * return PyCapsule_New(dlm_tensor, 'dltensor', pycapsule_deleter) * */ __pyx_v_dlm_tensor->del_obj = ((__pyx_t_8petsc4py_5PETSc_dlpack_manager_del_obj)__pyx_f_8petsc4py_5PETSc_PetscDEALLOC); /* "petsc4py/PETSc/Vec.pyx":830 * dlm_tensor.manager_deleter = manager_deleter * dlm_tensor.del_obj = PetscDEALLOC * return PyCapsule_New(dlm_tensor, 'dltensor', pycapsule_deleter) # <<<<<<<<<<<<<< * * def createGhost( */ __Pyx_XDECREF(__pyx_r); __pyx_t_8 = PyCapsule_New(__pyx_v_dlm_tensor, ((char const *)"dltensor"), __pyx_f_8petsc4py_5PETSc_pycapsule_deleter); if (unlikely(!__pyx_t_8)) __PYX_ERR(41, 830, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_r = __pyx_t_8; __pyx_t_8 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":739 * return (dltype, devId) * * def toDLPack(self, mode: AccessModeSpec = 'rw') -> Any: # <<<<<<<<<<<<<< * """Return a DLPack `PyCapsule` wrapping the vector data. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("petsc4py.PETSc.Vec.toDLPack", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_device_type); __Pyx_XDECREF(__pyx_v_device_id); __Pyx_XDECREF(__pyx_v_shape); __Pyx_XDECREF(__pyx_v_strides); __Pyx_XDECREF(__pyx_v_hostmem); __Pyx_XDECREF(__pyx_v_i); __Pyx_XDECREF(__pyx_v_mode); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":832 * return PyCapsule_New(dlm_tensor, 'dltensor', pycapsule_deleter) * * def createGhost( # <<<<<<<<<<<<<< * self, * ghosts: Sequence[int], */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_87createGhost(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_86createGhost, "Vec.createGhost(self, ghosts: Sequence[int], size: LayoutSizeSpec, bsize: int | None = None, comm: Comm | None = None) -> Self\nCreate a parallel vector with ghost padding on each processor.\n\n Collective.\n\n Parameters\n ----------\n ghosts\n Global indices of ghost points.\n size\n Vector size.\n bsize\n Vector block size. If `None`, ``bsize = 1``.\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n createGhostWithArray, petsc.VecCreateGhost, petsc.VecCreateGhostBlock\n\n \nSource code at petsc4py/PETSc/Vec.pyx:832"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_87createGhost(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_ghosts = 0; PyObject *__pyx_v_size = 0; PyObject *__pyx_v_bsize = 0; PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createGhost (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ghosts,&__pyx_n_s_size,&__pyx_n_s_bsize,&__pyx_n_s_comm,0}; /* "petsc4py/PETSc/Vec.pyx":836 * ghosts: Sequence[int], * size: LayoutSizeSpec, * bsize: int | None = None, # <<<<<<<<<<<<<< * comm: Comm | None = None, * ) -> Self: */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Vec.pyx":837 * size: LayoutSizeSpec, * bsize: int | None = None, * comm: Comm | None = None, # <<<<<<<<<<<<<< * ) -> Self: * """Create a parallel vector with ghost padding on each processor. */ values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ghosts)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 832, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 832, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("createGhost", 0, 2, 4, 1); __PYX_ERR(41, 832, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_bsize); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 832, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 832, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createGhost") < 0)) __PYX_ERR(41, 832, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_ghosts = values[0]; __pyx_v_size = values[1]; __pyx_v_bsize = values[2]; __pyx_v_comm = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createGhost", 0, 2, 4, __pyx_nargs); __PYX_ERR(41, 832, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.createGhost", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_86createGhost(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_ghosts, __pyx_v_size, __pyx_v_bsize, __pyx_v_comm); /* "petsc4py/PETSc/Vec.pyx":832 * return PyCapsule_New(dlm_tensor, 'dltensor', pycapsule_deleter) * * def createGhost( # <<<<<<<<<<<<<< * self, * ghosts: Sequence[int], */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_86createGhost(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_ghosts, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PetscInt __pyx_v_ng; PetscInt *__pyx_v_ig; PetscInt __pyx_v_bs; PetscInt __pyx_v_n; PetscInt __pyx_v_N; Vec __pyx_v_newvec; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PetscErrorCode __pyx_t_4; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createGhost", 0); __Pyx_INCREF(__pyx_v_ghosts); /* "petsc4py/PETSc/Vec.pyx":859 * * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscInt ng=0, *ig=NULL * ghosts = iarray_i(ghosts, &ng, &ig) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(41, 859, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/Vec.pyx":860 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt ng=0, *ig=NULL # <<<<<<<<<<<<<< * ghosts = iarray_i(ghosts, &ng, &ig) * cdef PetscInt bs=0, n=0, N=0 */ __pyx_v_ng = 0; __pyx_v_ig = NULL; /* "petsc4py/PETSc/Vec.pyx":861 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt ng=0, *ig=NULL * ghosts = iarray_i(ghosts, &ng, &ig) # <<<<<<<<<<<<<< * cdef PetscInt bs=0, n=0, N=0 * Vec_Sizes(size, bsize, &bs, &n, &N) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_ghosts, (&__pyx_v_ng), (&__pyx_v_ig))); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 861, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_ghosts, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/Vec.pyx":862 * cdef PetscInt ng=0, *ig=NULL * ghosts = iarray_i(ghosts, &ng, &ig) * cdef PetscInt bs=0, n=0, N=0 # <<<<<<<<<<<<<< * Vec_Sizes(size, bsize, &bs, &n, &N) * Sys_Layout(ccomm, bs, &n, &N) */ __pyx_v_bs = 0; __pyx_v_n = 0; __pyx_v_N = 0; /* "petsc4py/PETSc/Vec.pyx":863 * ghosts = iarray_i(ghosts, &ng, &ig) * cdef PetscInt bs=0, n=0, N=0 * Vec_Sizes(size, bsize, &bs, &n, &N) # <<<<<<<<<<<<<< * Sys_Layout(ccomm, bs, &n, &N) * cdef PetscVec newvec = NULL */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_Vec_Sizes(__pyx_v_size, __pyx_v_bsize, (&__pyx_v_bs), (&__pyx_v_n), (&__pyx_v_N)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(41, 863, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":864 * cdef PetscInt bs=0, n=0, N=0 * Vec_Sizes(size, bsize, &bs, &n, &N) * Sys_Layout(ccomm, bs, &n, &N) # <<<<<<<<<<<<<< * cdef PetscVec newvec = NULL * if bs == PETSC_DECIDE: */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_Sys_Layout(__pyx_v_ccomm, __pyx_v_bs, (&__pyx_v_n), (&__pyx_v_N)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 864, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":865 * Vec_Sizes(size, bsize, &bs, &n, &N) * Sys_Layout(ccomm, bs, &n, &N) * cdef PetscVec newvec = NULL # <<<<<<<<<<<<<< * if bs == PETSC_DECIDE: * CHKERR( VecCreateGhost( */ __pyx_v_newvec = NULL; /* "petsc4py/PETSc/Vec.pyx":866 * Sys_Layout(ccomm, bs, &n, &N) * cdef PetscVec newvec = NULL * if bs == PETSC_DECIDE: # <<<<<<<<<<<<<< * CHKERR( VecCreateGhost( * ccomm, n, N, ng, ig, &newvec) ) */ __pyx_t_5 = (__pyx_v_bs == PETSC_DECIDE); if (__pyx_t_5) { /* "petsc4py/PETSc/Vec.pyx":867 * cdef PetscVec newvec = NULL * if bs == PETSC_DECIDE: * CHKERR( VecCreateGhost( # <<<<<<<<<<<<<< * ccomm, n, N, ng, ig, &newvec) ) * else: */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCreateGhost(__pyx_v_ccomm, __pyx_v_n, __pyx_v_N, __pyx_v_ng, __pyx_v_ig, (&__pyx_v_newvec))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 867, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":866 * Sys_Layout(ccomm, bs, &n, &N) * cdef PetscVec newvec = NULL * if bs == PETSC_DECIDE: # <<<<<<<<<<<<<< * CHKERR( VecCreateGhost( * ccomm, n, N, ng, ig, &newvec) ) */ goto __pyx_L3; } /* "petsc4py/PETSc/Vec.pyx":870 * ccomm, n, N, ng, ig, &newvec) ) * else: * CHKERR( VecCreateGhostBlock( # <<<<<<<<<<<<<< * ccomm, bs, n, N, ng, ig, &newvec) ) * CHKERR( PetscCLEAR(self.obj) ); self.vec = newvec */ /*else*/ { /* "petsc4py/PETSc/Vec.pyx":871 * else: * CHKERR( VecCreateGhostBlock( * ccomm, bs, n, N, ng, ig, &newvec) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.vec = newvec * return self */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCreateGhostBlock(__pyx_v_ccomm, __pyx_v_bs, __pyx_v_n, __pyx_v_N, __pyx_v_ng, __pyx_v_ig, (&__pyx_v_newvec))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 870, __pyx_L1_error) } __pyx_L3:; /* "petsc4py/PETSc/Vec.pyx":872 * CHKERR( VecCreateGhostBlock( * ccomm, bs, n, N, ng, ig, &newvec) ) * CHKERR( PetscCLEAR(self.obj) ); self.vec = newvec # <<<<<<<<<<<<<< * return self * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 872, __pyx_L1_error) __pyx_v_self->vec = __pyx_v_newvec; /* "petsc4py/PETSc/Vec.pyx":873 * ccomm, bs, n, N, ng, ig, &newvec) ) * CHKERR( PetscCLEAR(self.obj) ); self.vec = newvec * return self # <<<<<<<<<<<<<< * * def createGhostWithArray( */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":832 * return PyCapsule_New(dlm_tensor, 'dltensor', pycapsule_deleter) * * def createGhost( # <<<<<<<<<<<<<< * self, * ghosts: Sequence[int], */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Vec.createGhost", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ghosts); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":875 * return self * * def createGhostWithArray( # <<<<<<<<<<<<<< * self, * ghosts: Sequence[int], */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_89createGhostWithArray(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_88createGhostWithArray, "Vec.createGhostWithArray(self, ghosts: Sequence[int], array: Sequence[Scalar], size: LayoutSizeSpec | None = None, bsize: int | None = None, comm: Comm | None = None) -> Self\nCreate a parallel vector with ghost padding and provided arrays.\n\n Collective.\n\n Parameters\n ----------\n ghosts\n Global indices of ghost points.\n array\n Array to store the vector values. Must be at least as large as\n the local size of the vector (including ghost points).\n size\n Vector size.\n bsize\n Vector block size. If `None`, ``bsize = 1``.\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n createGhost, petsc.VecCreateGhostWithArray\n petsc.VecCreateGhostBlockWithArray\n\n \nSource code at petsc4py/PETSc/Vec.pyx:875"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_89createGhostWithArray(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_ghosts = 0; PyObject *__pyx_v_array = 0; PyObject *__pyx_v_size = 0; PyObject *__pyx_v_bsize = 0; PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createGhostWithArray (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ghosts,&__pyx_n_s_array,&__pyx_n_s_size,&__pyx_n_s_bsize,&__pyx_n_s_comm,0}; /* "petsc4py/PETSc/Vec.pyx":879 * ghosts: Sequence[int], * array: Sequence[Scalar], * size: LayoutSizeSpec | None = None, # <<<<<<<<<<<<<< * bsize: int | None = None, * comm: Comm | None = None, */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Vec.pyx":880 * array: Sequence[Scalar], * size: LayoutSizeSpec | None = None, * bsize: int | None = None, # <<<<<<<<<<<<<< * comm: Comm | None = None, * ) -> Self: */ values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Vec.pyx":881 * size: LayoutSizeSpec | None = None, * bsize: int | None = None, * comm: Comm | None = None, # <<<<<<<<<<<<<< * ) -> Self: * """Create a parallel vector with ghost padding and provided arrays. */ values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ghosts)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 875, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_array)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 875, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("createGhostWithArray", 0, 2, 5, 1); __PYX_ERR(41, 875, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 875, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_bsize); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 875, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 875, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createGhostWithArray") < 0)) __PYX_ERR(41, 875, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_ghosts = values[0]; __pyx_v_array = values[1]; __pyx_v_size = values[2]; __pyx_v_bsize = values[3]; __pyx_v_comm = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createGhostWithArray", 0, 2, 5, __pyx_nargs); __PYX_ERR(41, 875, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.createGhostWithArray", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_88createGhostWithArray(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_ghosts, __pyx_v_array, __pyx_v_size, __pyx_v_bsize, __pyx_v_comm); /* "petsc4py/PETSc/Vec.pyx":875 * return self * * def createGhostWithArray( # <<<<<<<<<<<<<< * self, * ghosts: Sequence[int], */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_88createGhostWithArray(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_ghosts, PyObject *__pyx_v_array, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PetscInt __pyx_v_ng; PetscInt *__pyx_v_ig; PetscInt __pyx_v_na; PetscScalar *__pyx_v_sa; PetscInt __pyx_v_b; PetscInt __pyx_v_bs; PetscInt __pyx_v_n; PetscInt __pyx_v_N; Vec __pyx_v_newvec; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscInt __pyx_t_3; int __pyx_t_4; PetscInt __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; PetscErrorCode __pyx_t_9; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createGhostWithArray", 0); __Pyx_INCREF(__pyx_v_ghosts); __Pyx_INCREF(__pyx_v_array); __Pyx_INCREF(__pyx_v_size); /* "petsc4py/PETSc/Vec.pyx":907 * * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscInt ng=0, *ig=NULL * ghosts = iarray_i(ghosts, &ng, &ig) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(41, 907, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/Vec.pyx":908 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt ng=0, *ig=NULL # <<<<<<<<<<<<<< * ghosts = iarray_i(ghosts, &ng, &ig) * cdef PetscInt na=0 */ __pyx_v_ng = 0; __pyx_v_ig = NULL; /* "petsc4py/PETSc/Vec.pyx":909 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt ng=0, *ig=NULL * ghosts = iarray_i(ghosts, &ng, &ig) # <<<<<<<<<<<<<< * cdef PetscInt na=0 * cdef PetscScalar *sa=NULL */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_ghosts, (&__pyx_v_ng), (&__pyx_v_ig))); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 909, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_ghosts, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/Vec.pyx":910 * cdef PetscInt ng=0, *ig=NULL * ghosts = iarray_i(ghosts, &ng, &ig) * cdef PetscInt na=0 # <<<<<<<<<<<<<< * cdef PetscScalar *sa=NULL * array = oarray_s(array, &na, &sa) */ __pyx_v_na = 0; /* "petsc4py/PETSc/Vec.pyx":911 * ghosts = iarray_i(ghosts, &ng, &ig) * cdef PetscInt na=0 * cdef PetscScalar *sa=NULL # <<<<<<<<<<<<<< * array = oarray_s(array, &na, &sa) * cdef PetscInt b = 1 if bsize is None else asInt(bsize) */ __pyx_v_sa = NULL; /* "petsc4py/PETSc/Vec.pyx":912 * cdef PetscInt na=0 * cdef PetscScalar *sa=NULL * array = oarray_s(array, &na, &sa) # <<<<<<<<<<<<<< * cdef PetscInt b = 1 if bsize is None else asInt(bsize) * if size is None: size = (toInt(na-ng*b), toInt(PETSC_DECIDE)) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_s(__pyx_v_array, (&__pyx_v_na), (&__pyx_v_sa))); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 912, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_array, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/Vec.pyx":913 * cdef PetscScalar *sa=NULL * array = oarray_s(array, &na, &sa) * cdef PetscInt b = 1 if bsize is None else asInt(bsize) # <<<<<<<<<<<<<< * if size is None: size = (toInt(na-ng*b), toInt(PETSC_DECIDE)) * cdef PetscInt bs=0, n=0, N=0 */ __pyx_t_4 = (__pyx_v_bsize == Py_None); if (__pyx_t_4) { __pyx_t_3 = 1; } else { __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_bsize); if (unlikely(__pyx_t_5 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(41, 913, __pyx_L1_error) __pyx_t_3 = __pyx_t_5; } __pyx_v_b = __pyx_t_3; /* "petsc4py/PETSc/Vec.pyx":914 * array = oarray_s(array, &na, &sa) * cdef PetscInt b = 1 if bsize is None else asInt(bsize) * if size is None: size = (toInt(na-ng*b), toInt(PETSC_DECIDE)) # <<<<<<<<<<<<<< * cdef PetscInt bs=0, n=0, N=0 * Vec_Sizes(size, bsize, &bs, &n, &N) */ __pyx_t_4 = (__pyx_v_size == Py_None); if (__pyx_t_4) { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_na - (__pyx_v_ng * __pyx_v_b))); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_toInt(PETSC_DECIDE); if (unlikely(!__pyx_t_6)) __PYX_ERR(41, 914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2)) __PYX_ERR(41, 914, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6)) __PYX_ERR(41, 914, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_6 = 0; __Pyx_DECREF_SET(__pyx_v_size, __pyx_t_7); __pyx_t_7 = 0; } /* "petsc4py/PETSc/Vec.pyx":915 * cdef PetscInt b = 1 if bsize is None else asInt(bsize) * if size is None: size = (toInt(na-ng*b), toInt(PETSC_DECIDE)) * cdef PetscInt bs=0, n=0, N=0 # <<<<<<<<<<<<<< * Vec_Sizes(size, bsize, &bs, &n, &N) * Sys_Layout(ccomm, bs, &n, &N) */ __pyx_v_bs = 0; __pyx_v_n = 0; __pyx_v_N = 0; /* "petsc4py/PETSc/Vec.pyx":916 * if size is None: size = (toInt(na-ng*b), toInt(PETSC_DECIDE)) * cdef PetscInt bs=0, n=0, N=0 * Vec_Sizes(size, bsize, &bs, &n, &N) # <<<<<<<<<<<<<< * Sys_Layout(ccomm, bs, &n, &N) * if na < (n+ng*b): raise ValueError( */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_Vec_Sizes(__pyx_v_size, __pyx_v_bsize, (&__pyx_v_bs), (&__pyx_v_n), (&__pyx_v_N)); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(41, 916, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":917 * cdef PetscInt bs=0, n=0, N=0 * Vec_Sizes(size, bsize, &bs, &n, &N) * Sys_Layout(ccomm, bs, &n, &N) # <<<<<<<<<<<<<< * if na < (n+ng*b): raise ValueError( * "ghosts size %d, array size %d, and " */ __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_Sys_Layout(__pyx_v_ccomm, __pyx_v_bs, (&__pyx_v_n), (&__pyx_v_N)); if (unlikely(__pyx_t_9 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 917, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":918 * Vec_Sizes(size, bsize, &bs, &n, &N) * Sys_Layout(ccomm, bs, &n, &N) * if na < (n+ng*b): raise ValueError( # <<<<<<<<<<<<<< * "ghosts size %d, array size %d, and " * "vector local size %d block size %d" % */ __pyx_t_4 = (__pyx_v_na < (__pyx_v_n + (__pyx_v_ng * __pyx_v_b))); if (unlikely(__pyx_t_4)) { /* "petsc4py/PETSc/Vec.pyx":921 * "ghosts size %d, array size %d, and " * "vector local size %d block size %d" % * (toInt(ng), toInt(na), toInt(n), toInt(b))) # <<<<<<<<<<<<<< * cdef PetscVec newvec = NULL * if bs == PETSC_DECIDE: */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ng); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 921, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_na); if (unlikely(!__pyx_t_6)) __PYX_ERR(41, 921, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 921, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_b); if (unlikely(!__pyx_t_10)) __PYX_ERR(41, 921, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = PyTuple_New(4); if (unlikely(!__pyx_t_11)) __PYX_ERR(41, 921, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7)) __PYX_ERR(41, 921, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_6)) __PYX_ERR(41, 921, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_2)) __PYX_ERR(41, 921, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_10); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 3, __pyx_t_10)) __PYX_ERR(41, 921, __pyx_L1_error); __pyx_t_7 = 0; __pyx_t_6 = 0; __pyx_t_2 = 0; __pyx_t_10 = 0; /* "petsc4py/PETSc/Vec.pyx":920 * if na < (n+ng*b): raise ValueError( * "ghosts size %d, array size %d, and " * "vector local size %d block size %d" % # <<<<<<<<<<<<<< * (toInt(ng), toInt(na), toInt(n), toInt(b))) * cdef PetscVec newvec = NULL */ __pyx_t_10 = __Pyx_PyString_Format(__pyx_kp_s_ghosts_size_d_array_size_d_and_v, __pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(41, 920, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Vec.pyx":918 * Vec_Sizes(size, bsize, &bs, &n, &N) * Sys_Layout(ccomm, bs, &n, &N) * if na < (n+ng*b): raise ValueError( # <<<<<<<<<<<<<< * "ghosts size %d, array size %d, and " * "vector local size %d block size %d" % */ __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(41, 918, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_Raise(__pyx_t_11, 0, 0, 0); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __PYX_ERR(41, 918, __pyx_L1_error) } /* "petsc4py/PETSc/Vec.pyx":922 * "vector local size %d block size %d" % * (toInt(ng), toInt(na), toInt(n), toInt(b))) * cdef PetscVec newvec = NULL # <<<<<<<<<<<<<< * if bs == PETSC_DECIDE: * CHKERR( VecCreateGhostWithArray( */ __pyx_v_newvec = NULL; /* "petsc4py/PETSc/Vec.pyx":923 * (toInt(ng), toInt(na), toInt(n), toInt(b))) * cdef PetscVec newvec = NULL * if bs == PETSC_DECIDE: # <<<<<<<<<<<<<< * CHKERR( VecCreateGhostWithArray( * ccomm, n, N, ng, ig, sa, &newvec) ) */ __pyx_t_4 = (__pyx_v_bs == PETSC_DECIDE); if (__pyx_t_4) { /* "petsc4py/PETSc/Vec.pyx":924 * cdef PetscVec newvec = NULL * if bs == PETSC_DECIDE: * CHKERR( VecCreateGhostWithArray( # <<<<<<<<<<<<<< * ccomm, n, N, ng, ig, sa, &newvec) ) * else: */ __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCreateGhostWithArray(__pyx_v_ccomm, __pyx_v_n, __pyx_v_N, __pyx_v_ng, __pyx_v_ig, __pyx_v_sa, (&__pyx_v_newvec))); if (unlikely(__pyx_t_9 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 924, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":923 * (toInt(ng), toInt(na), toInt(n), toInt(b))) * cdef PetscVec newvec = NULL * if bs == PETSC_DECIDE: # <<<<<<<<<<<<<< * CHKERR( VecCreateGhostWithArray( * ccomm, n, N, ng, ig, sa, &newvec) ) */ goto __pyx_L5; } /* "petsc4py/PETSc/Vec.pyx":927 * ccomm, n, N, ng, ig, sa, &newvec) ) * else: * CHKERR( VecCreateGhostBlockWithArray( # <<<<<<<<<<<<<< * ccomm, bs, n, N, ng, ig, sa, &newvec) ) * CHKERR( PetscCLEAR(self.obj) ); self.vec = newvec */ /*else*/ { /* "petsc4py/PETSc/Vec.pyx":928 * else: * CHKERR( VecCreateGhostBlockWithArray( * ccomm, bs, n, N, ng, ig, sa, &newvec) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.vec = newvec * self.set_attr('__array__', array) */ __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCreateGhostBlockWithArray(__pyx_v_ccomm, __pyx_v_bs, __pyx_v_n, __pyx_v_N, __pyx_v_ng, __pyx_v_ig, __pyx_v_sa, (&__pyx_v_newvec))); if (unlikely(__pyx_t_9 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 927, __pyx_L1_error) } __pyx_L5:; /* "petsc4py/PETSc/Vec.pyx":929 * CHKERR( VecCreateGhostBlockWithArray( * ccomm, bs, n, N, ng, ig, sa, &newvec) ) * CHKERR( PetscCLEAR(self.obj) ); self.vec = newvec # <<<<<<<<<<<<<< * self.set_attr('__array__', array) * return self */ __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_9 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 929, __pyx_L1_error) __pyx_v_self->vec = __pyx_v_newvec; /* "petsc4py/PETSc/Vec.pyx":930 * ccomm, bs, n, N, ng, ig, sa, &newvec) ) * CHKERR( PetscCLEAR(self.obj) ); self.vec = newvec * self.set_attr('__array__', array) # <<<<<<<<<<<<<< * return self * */ __pyx_t_11 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Vec *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__array__"), __pyx_v_array); if (unlikely(!__pyx_t_11)) __PYX_ERR(41, 930, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Vec.pyx":931 * CHKERR( PetscCLEAR(self.obj) ); self.vec = newvec * self.set_attr('__array__', array) * return self # <<<<<<<<<<<<<< * * def createShared( */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":875 * return self * * def createGhostWithArray( # <<<<<<<<<<<<<< * self, * ghosts: Sequence[int], */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("petsc4py.PETSc.Vec.createGhostWithArray", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ghosts); __Pyx_XDECREF(__pyx_v_array); __Pyx_XDECREF(__pyx_v_size); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":933 * return self * * def createShared( # <<<<<<<<<<<<<< * self, * size: LayoutSizeSpec, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_91createShared(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_90createShared, "Vec.createShared(self, size: LayoutSizeSpec, bsize: int | None = None, comm: Comm | None = None) -> Self\nCreate a `Type.SHARED` vector that uses shared memory.\n\n Collective.\n\n Parameters\n ----------\n size\n Vector size.\n bsize\n Vector block size. If `None`, ``bsize = 1``.\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n petsc.VecCreateShared\n\n \nSource code at petsc4py/PETSc/Vec.pyx:933"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_91createShared(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_size = 0; PyObject *__pyx_v_bsize = 0; PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createShared (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_bsize,&__pyx_n_s_comm,0}; /* "petsc4py/PETSc/Vec.pyx":936 * self, * size: LayoutSizeSpec, * bsize: int | None = None, # <<<<<<<<<<<<<< * comm: Comm | None = None, * ) -> Self: */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Vec.pyx":937 * size: LayoutSizeSpec, * bsize: int | None = None, * comm: Comm | None = None, # <<<<<<<<<<<<<< * ) -> Self: * """Create a `Type.SHARED` vector that uses shared memory. */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 933, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_bsize); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 933, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 933, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createShared") < 0)) __PYX_ERR(41, 933, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_size = values[0]; __pyx_v_bsize = values[1]; __pyx_v_comm = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createShared", 0, 1, 3, __pyx_nargs); __PYX_ERR(41, 933, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.createShared", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_90createShared(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_size, __pyx_v_bsize, __pyx_v_comm); /* "petsc4py/PETSc/Vec.pyx":933 * return self * * def createShared( # <<<<<<<<<<<<<< * self, * size: LayoutSizeSpec, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_90createShared(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PetscInt __pyx_v_bs; PetscInt __pyx_v_n; PetscInt __pyx_v_N; Vec __pyx_v_newvec; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; int __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createShared", 1); /* "petsc4py/PETSc/Vec.pyx":957 * * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscInt bs=0, n=0, N=0 * Vec_Sizes(size, bsize, &bs, &n, &N) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(41, 957, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/Vec.pyx":958 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt bs=0, n=0, N=0 # <<<<<<<<<<<<<< * Vec_Sizes(size, bsize, &bs, &n, &N) * Sys_Layout(ccomm, bs, &n, &N) */ __pyx_v_bs = 0; __pyx_v_n = 0; __pyx_v_N = 0; /* "petsc4py/PETSc/Vec.pyx":959 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt bs=0, n=0, N=0 * Vec_Sizes(size, bsize, &bs, &n, &N) # <<<<<<<<<<<<<< * Sys_Layout(ccomm, bs, &n, &N) * cdef PetscVec newvec = NULL */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_Vec_Sizes(__pyx_v_size, __pyx_v_bsize, (&__pyx_v_bs), (&__pyx_v_n), (&__pyx_v_N)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(41, 959, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":960 * cdef PetscInt bs=0, n=0, N=0 * Vec_Sizes(size, bsize, &bs, &n, &N) * Sys_Layout(ccomm, bs, &n, &N) # <<<<<<<<<<<<<< * cdef PetscVec newvec = NULL * CHKERR( VecCreateShared(ccomm, n, N, &newvec) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_Sys_Layout(__pyx_v_ccomm, __pyx_v_bs, (&__pyx_v_n), (&__pyx_v_N)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 960, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":961 * Vec_Sizes(size, bsize, &bs, &n, &N) * Sys_Layout(ccomm, bs, &n, &N) * cdef PetscVec newvec = NULL # <<<<<<<<<<<<<< * CHKERR( VecCreateShared(ccomm, n, N, &newvec) ) * CHKERR( PetscCLEAR(self.obj) ); self.vec = newvec */ __pyx_v_newvec = NULL; /* "petsc4py/PETSc/Vec.pyx":962 * Sys_Layout(ccomm, bs, &n, &N) * cdef PetscVec newvec = NULL * CHKERR( VecCreateShared(ccomm, n, N, &newvec) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.vec = newvec * if bs != PETSC_DECIDE: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCreateShared(__pyx_v_ccomm, __pyx_v_n, __pyx_v_N, (&__pyx_v_newvec))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 962, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":963 * cdef PetscVec newvec = NULL * CHKERR( VecCreateShared(ccomm, n, N, &newvec) ) * CHKERR( PetscCLEAR(self.obj) ); self.vec = newvec # <<<<<<<<<<<<<< * if bs != PETSC_DECIDE: * CHKERR( VecSetBlockSize(self.vec, bs) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 963, __pyx_L1_error) __pyx_v_self->vec = __pyx_v_newvec; /* "petsc4py/PETSc/Vec.pyx":964 * CHKERR( VecCreateShared(ccomm, n, N, &newvec) ) * CHKERR( PetscCLEAR(self.obj) ); self.vec = newvec * if bs != PETSC_DECIDE: # <<<<<<<<<<<<<< * CHKERR( VecSetBlockSize(self.vec, bs) ) * return self */ __pyx_t_4 = (__pyx_v_bs != PETSC_DECIDE); if (__pyx_t_4) { /* "petsc4py/PETSc/Vec.pyx":965 * CHKERR( PetscCLEAR(self.obj) ); self.vec = newvec * if bs != PETSC_DECIDE: * CHKERR( VecSetBlockSize(self.vec, bs) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecSetBlockSize(__pyx_v_self->vec, __pyx_v_bs)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 965, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":964 * CHKERR( VecCreateShared(ccomm, n, N, &newvec) ) * CHKERR( PetscCLEAR(self.obj) ); self.vec = newvec * if bs != PETSC_DECIDE: # <<<<<<<<<<<<<< * CHKERR( VecSetBlockSize(self.vec, bs) ) * return self */ } /* "petsc4py/PETSc/Vec.pyx":966 * if bs != PETSC_DECIDE: * CHKERR( VecSetBlockSize(self.vec, bs) ) * return self # <<<<<<<<<<<<<< * * def createNest( */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":933 * return self * * def createShared( # <<<<<<<<<<<<<< * self, * size: LayoutSizeSpec, */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.createShared", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":968 * return self * * def createNest( # <<<<<<<<<<<<<< * self, * vecs: Sequence[Vec], */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_93createNest(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_92createNest, "Vec.createNest(self, vecs: Sequence[Vec], isets: Sequence[IS] = None, comm: Comm | None = None) -> Self\nCreate a `Type.NEST` vector containing multiple nested subvectors.\n\n Collective.\n\n Parameters\n ----------\n vecs\n Iterable of subvectors.\n isets\n Iterable of index sets for each nested subvector.\n Defaults to contiguous ordering.\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n petsc.VecCreateNest\n\n \nSource code at petsc4py/PETSc/Vec.pyx:968"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_93createNest(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_vecs = 0; PyObject *__pyx_v_isets = 0; PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createNest (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vecs,&__pyx_n_s_isets,&__pyx_n_s_comm,0}; /* "petsc4py/PETSc/Vec.pyx":971 * self, * vecs: Sequence[Vec], * isets: Sequence[IS] = None, # <<<<<<<<<<<<<< * comm: Comm | None = None, * ) -> Self: */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Vec.pyx":972 * vecs: Sequence[Vec], * isets: Sequence[IS] = None, * comm: Comm | None = None, # <<<<<<<<<<<<<< * ) -> Self: * """Create a `Type.NEST` vector containing multiple nested subvectors. */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vecs)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 968, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_isets); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 968, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 968, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createNest") < 0)) __PYX_ERR(41, 968, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_vecs = values[0]; __pyx_v_isets = values[1]; __pyx_v_comm = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createNest", 0, 1, 3, __pyx_nargs); __PYX_ERR(41, 968, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.createNest", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_92createNest(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_vecs, __pyx_v_isets, __pyx_v_comm); /* "petsc4py/PETSc/Vec.pyx":968 * return self * * def createNest( # <<<<<<<<<<<<<< * self, * vecs: Sequence[Vec], */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_92createNest(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_vecs, PyObject *__pyx_v_isets, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; Py_ssize_t __pyx_v_i; Py_ssize_t __pyx_v_m; PetscInt __pyx_v_n; Vec *__pyx_v_cvecs; IS *__pyx_v_cisets; CYTHON_UNUSED PyObject *__pyx_v_tmp1 = 0; CYTHON_UNUSED PyObject *__pyx_v_tmp2 = 0; Vec __pyx_v_newvec; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; Py_ssize_t __pyx_t_3; Py_ssize_t __pyx_t_4; MPI_Comm __pyx_t_5; PyObject *__pyx_t_6 = NULL; Vec __pyx_t_7; IS __pyx_t_8; PetscErrorCode __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createNest", 0); __Pyx_INCREF(__pyx_v_vecs); __Pyx_INCREF(__pyx_v_isets); /* "petsc4py/PETSc/Vec.pyx":993 * * """ * vecs = list(vecs) # <<<<<<<<<<<<<< * if isets: * isets = list(isets) */ __pyx_t_1 = PySequence_List(__pyx_v_vecs); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 993, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_vecs, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Vec.pyx":994 * """ * vecs = list(vecs) * if isets: # <<<<<<<<<<<<<< * isets = list(isets) * assert len(isets) == len(vecs) */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_isets); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(41, 994, __pyx_L1_error) if (__pyx_t_2) { /* "petsc4py/PETSc/Vec.pyx":995 * vecs = list(vecs) * if isets: * isets = list(isets) # <<<<<<<<<<<<<< * assert len(isets) == len(vecs) * else: */ __pyx_t_1 = PySequence_List(__pyx_v_isets); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 995, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_isets, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Vec.pyx":996 * if isets: * isets = list(isets) * assert len(isets) == len(vecs) # <<<<<<<<<<<<<< * else: * isets = None */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_3 = PyObject_Length(__pyx_v_isets); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(41, 996, __pyx_L1_error) __pyx_t_4 = PyObject_Length(__pyx_v_vecs); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(41, 996, __pyx_L1_error) __pyx_t_2 = (__pyx_t_3 == __pyx_t_4); if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(41, 996, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(41, 996, __pyx_L1_error) #endif /* "petsc4py/PETSc/Vec.pyx":994 * """ * vecs = list(vecs) * if isets: # <<<<<<<<<<<<<< * isets = list(isets) * assert len(isets) == len(vecs) */ goto __pyx_L3; } /* "petsc4py/PETSc/Vec.pyx":998 * assert len(isets) == len(vecs) * else: * isets = None # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef Py_ssize_t i, m = len(vecs) */ /*else*/ { __Pyx_INCREF(Py_None); __Pyx_DECREF_SET(__pyx_v_isets, Py_None); } __pyx_L3:; /* "petsc4py/PETSc/Vec.pyx":999 * else: * isets = None * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef Py_ssize_t i, m = len(vecs) * cdef PetscInt n = m */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_5 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(41, 999, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_5; /* "petsc4py/PETSc/Vec.pyx":1000 * isets = None * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef Py_ssize_t i, m = len(vecs) # <<<<<<<<<<<<<< * cdef PetscInt n = m * cdef PetscVec *cvecs = NULL */ __pyx_t_4 = PyObject_Length(__pyx_v_vecs); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(41, 1000, __pyx_L1_error) __pyx_v_m = __pyx_t_4; /* "petsc4py/PETSc/Vec.pyx":1001 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef Py_ssize_t i, m = len(vecs) * cdef PetscInt n = m # <<<<<<<<<<<<<< * cdef PetscVec *cvecs = NULL * cdef PetscIS *cisets = NULL */ __pyx_v_n = ((PetscInt)__pyx_v_m); /* "petsc4py/PETSc/Vec.pyx":1002 * cdef Py_ssize_t i, m = len(vecs) * cdef PetscInt n = m * cdef PetscVec *cvecs = NULL # <<<<<<<<<<<<<< * cdef PetscIS *cisets = NULL * cdef object tmp1, tmp2 */ __pyx_v_cvecs = NULL; /* "petsc4py/PETSc/Vec.pyx":1003 * cdef PetscInt n = m * cdef PetscVec *cvecs = NULL * cdef PetscIS *cisets = NULL # <<<<<<<<<<<<<< * cdef object tmp1, tmp2 * tmp1 = oarray_p(empty_p(n), NULL, &cvecs) */ __pyx_v_cisets = NULL; /* "petsc4py/PETSc/Vec.pyx":1005 * cdef PetscIS *cisets = NULL * cdef object tmp1, tmp2 * tmp1 = oarray_p(empty_p(n), NULL, &cvecs) # <<<<<<<<<<<<<< * for i from 0 <= i < m: cvecs[i] = (vecs[i]).vec * if isets is not None: */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_n)); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 1005, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_1, NULL, ((void **)(&__pyx_v_cvecs)))); if (unlikely(!__pyx_t_6)) __PYX_ERR(41, 1005, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_tmp1 = __pyx_t_6; __pyx_t_6 = 0; /* "petsc4py/PETSc/Vec.pyx":1006 * cdef object tmp1, tmp2 * tmp1 = oarray_p(empty_p(n), NULL, &cvecs) * for i from 0 <= i < m: cvecs[i] = (vecs[i]).vec # <<<<<<<<<<<<<< * if isets is not None: * tmp2 = oarray_p(empty_p(n), NULL, &cisets) */ __pyx_t_4 = __pyx_v_m; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_vecs, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(41, 1006, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (!(likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_8petsc4py_5PETSc_Vec)))) __PYX_ERR(41, 1006, __pyx_L1_error) __pyx_t_7 = ((struct PyPetscVecObject *)__pyx_t_6)->vec; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; (__pyx_v_cvecs[__pyx_v_i]) = __pyx_t_7; } /* "petsc4py/PETSc/Vec.pyx":1007 * tmp1 = oarray_p(empty_p(n), NULL, &cvecs) * for i from 0 <= i < m: cvecs[i] = (vecs[i]).vec * if isets is not None: # <<<<<<<<<<<<<< * tmp2 = oarray_p(empty_p(n), NULL, &cisets) * for i from 0 <= i < m: cisets[i] = (isets[i]).iset */ __pyx_t_2 = (__pyx_v_isets != Py_None); if (__pyx_t_2) { /* "petsc4py/PETSc/Vec.pyx":1008 * for i from 0 <= i < m: cvecs[i] = (vecs[i]).vec * if isets is not None: * tmp2 = oarray_p(empty_p(n), NULL, &cisets) # <<<<<<<<<<<<<< * for i from 0 <= i < m: cisets[i] = (isets[i]).iset * cdef PetscVec newvec = NULL */ __pyx_t_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_n)); if (unlikely(!__pyx_t_6)) __PYX_ERR(41, 1008, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_6, NULL, ((void **)(&__pyx_v_cisets)))); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 1008, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_tmp2 = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/Vec.pyx":1009 * if isets is not None: * tmp2 = oarray_p(empty_p(n), NULL, &cisets) * for i from 0 <= i < m: cisets[i] = (isets[i]).iset # <<<<<<<<<<<<<< * cdef PetscVec newvec = NULL * CHKERR( VecCreateNest(ccomm, n, cisets, cvecs,&newvec) ) */ __pyx_t_4 = __pyx_v_m; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_isets, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 1009, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(41, 1009, __pyx_L1_error) __pyx_t_8 = ((struct PyPetscISObject *)__pyx_t_1)->iset; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; (__pyx_v_cisets[__pyx_v_i]) = __pyx_t_8; } /* "petsc4py/PETSc/Vec.pyx":1007 * tmp1 = oarray_p(empty_p(n), NULL, &cvecs) * for i from 0 <= i < m: cvecs[i] = (vecs[i]).vec * if isets is not None: # <<<<<<<<<<<<<< * tmp2 = oarray_p(empty_p(n), NULL, &cisets) * for i from 0 <= i < m: cisets[i] = (isets[i]).iset */ } /* "petsc4py/PETSc/Vec.pyx":1010 * tmp2 = oarray_p(empty_p(n), NULL, &cisets) * for i from 0 <= i < m: cisets[i] = (isets[i]).iset * cdef PetscVec newvec = NULL # <<<<<<<<<<<<<< * CHKERR( VecCreateNest(ccomm, n, cisets, cvecs,&newvec) ) * CHKERR( PetscCLEAR(self.obj) ); self.vec = newvec */ __pyx_v_newvec = NULL; /* "petsc4py/PETSc/Vec.pyx":1011 * for i from 0 <= i < m: cisets[i] = (isets[i]).iset * cdef PetscVec newvec = NULL * CHKERR( VecCreateNest(ccomm, n, cisets, cvecs,&newvec) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.vec = newvec * return self */ __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCreateNest(__pyx_v_ccomm, __pyx_v_n, __pyx_v_cisets, __pyx_v_cvecs, (&__pyx_v_newvec))); if (unlikely(__pyx_t_9 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 1011, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":1012 * cdef PetscVec newvec = NULL * CHKERR( VecCreateNest(ccomm, n, cisets, cvecs,&newvec) ) * CHKERR( PetscCLEAR(self.obj) ); self.vec = newvec # <<<<<<<<<<<<<< * return self * */ __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_9 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 1012, __pyx_L1_error) __pyx_v_self->vec = __pyx_v_newvec; /* "petsc4py/PETSc/Vec.pyx":1013 * CHKERR( VecCreateNest(ccomm, n, cisets, cvecs,&newvec) ) * CHKERR( PetscCLEAR(self.obj) ); self.vec = newvec * return self # <<<<<<<<<<<<<< * * # */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":968 * return self * * def createNest( # <<<<<<<<<<<<<< * self, * vecs: Sequence[Vec], */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.Vec.createNest", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_tmp1); __Pyx_XDECREF(__pyx_v_tmp2); __Pyx_XDECREF(__pyx_v_vecs); __Pyx_XDECREF(__pyx_v_isets); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":1017 * # * * def setOptionsPrefix(self, prefix: str) -> None: # <<<<<<<<<<<<<< * """Set the prefix used for searching for options in the database. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_95setOptionsPrefix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_94setOptionsPrefix, "Vec.setOptionsPrefix(self, prefix: str) -> None\nSet the prefix used for searching for options in the database.\n\n Logically collective.\n\n See Also\n --------\n petsc_options, getOptionsPrefix, petsc.VecSetOptionsPrefix\n\n \nSource code at petsc4py/PETSc/Vec.pyx:1017"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_95setOptionsPrefix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_prefix = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setOptionsPrefix (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_prefix,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_prefix)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 1017, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setOptionsPrefix") < 0)) __PYX_ERR(41, 1017, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_prefix = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setOptionsPrefix", 1, 1, 1, __pyx_nargs); __PYX_ERR(41, 1017, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.setOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_94setOptionsPrefix(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_prefix); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_94setOptionsPrefix(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_prefix) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setOptionsPrefix", 0); __Pyx_INCREF(__pyx_v_prefix); /* "petsc4py/PETSc/Vec.pyx":1027 * * """ * cdef const char *cval = NULL # <<<<<<<<<<<<<< * prefix = str2bytes(prefix, &cval) * CHKERR( VecSetOptionsPrefix(self.vec, cval) ) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/Vec.pyx":1028 * """ * cdef const char *cval = NULL * prefix = str2bytes(prefix, &cval) # <<<<<<<<<<<<<< * CHKERR( VecSetOptionsPrefix(self.vec, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_prefix, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 1028, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_prefix, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Vec.pyx":1029 * cdef const char *cval = NULL * prefix = str2bytes(prefix, &cval) * CHKERR( VecSetOptionsPrefix(self.vec, cval) ) # <<<<<<<<<<<<<< * * def getOptionsPrefix(self) -> str: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecSetOptionsPrefix(__pyx_v_self->vec, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 1029, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":1017 * # * * def setOptionsPrefix(self, prefix: str) -> None: # <<<<<<<<<<<<<< * """Set the prefix used for searching for options in the database. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Vec.setOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_prefix); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":1031 * CHKERR( VecSetOptionsPrefix(self.vec, cval) ) * * def getOptionsPrefix(self) -> str: # <<<<<<<<<<<<<< * """Return the prefix used for searching for options in the database. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_97getOptionsPrefix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_96getOptionsPrefix, "Vec.getOptionsPrefix(self) -> str\nReturn the prefix used for searching for options in the database.\n\n Not collective.\n\n See Also\n --------\n petsc_options, setOptionsPrefix, petsc.VecGetOptionsPrefix\n\n \nSource code at petsc4py/PETSc/Vec.pyx:1031"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_97getOptionsPrefix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getOptionsPrefix (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getOptionsPrefix", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getOptionsPrefix", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_96getOptionsPrefix(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_96getOptionsPrefix(struct PyPetscVecObject *__pyx_v_self) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getOptionsPrefix", 1); /* "petsc4py/PETSc/Vec.pyx":1041 * * """ * cdef const char *cval = NULL # <<<<<<<<<<<<<< * CHKERR( VecGetOptionsPrefix(self.vec, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/Vec.pyx":1042 * """ * cdef const char *cval = NULL * CHKERR( VecGetOptionsPrefix(self.vec, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetOptionsPrefix(__pyx_v_self->vec, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 1042, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":1043 * cdef const char *cval = NULL * CHKERR( VecGetOptionsPrefix(self.vec, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * def appendOptionsPrefix(self, prefix: str) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 1043, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":1031 * CHKERR( VecSetOptionsPrefix(self.vec, cval) ) * * def getOptionsPrefix(self) -> str: # <<<<<<<<<<<<<< * """Return the prefix used for searching for options in the database. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Vec.getOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":1045 * return bytes2str(cval) * * def appendOptionsPrefix(self, prefix: str) -> None: # <<<<<<<<<<<<<< * """Append to the prefix used for searching for options in the database. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_99appendOptionsPrefix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_98appendOptionsPrefix, "Vec.appendOptionsPrefix(self, prefix: str) -> None\nAppend to the prefix used for searching for options in the database.\n\n Logically collective.\n\n See Also\n --------\n petsc_options, setOptionsPrefix, petsc.VecAppendOptionsPrefix\n\n \nSource code at petsc4py/PETSc/Vec.pyx:1045"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_99appendOptionsPrefix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_prefix = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("appendOptionsPrefix (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_prefix,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_prefix)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 1045, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "appendOptionsPrefix") < 0)) __PYX_ERR(41, 1045, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_prefix = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("appendOptionsPrefix", 1, 1, 1, __pyx_nargs); __PYX_ERR(41, 1045, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.appendOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_98appendOptionsPrefix(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_prefix); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_98appendOptionsPrefix(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_prefix) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("appendOptionsPrefix", 0); __Pyx_INCREF(__pyx_v_prefix); /* "petsc4py/PETSc/Vec.pyx":1055 * * """ * cdef const char *cval = NULL # <<<<<<<<<<<<<< * prefix = str2bytes(prefix, &cval) * CHKERR( VecAppendOptionsPrefix(self.vec, cval) ) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/Vec.pyx":1056 * """ * cdef const char *cval = NULL * prefix = str2bytes(prefix, &cval) # <<<<<<<<<<<<<< * CHKERR( VecAppendOptionsPrefix(self.vec, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_prefix, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 1056, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_prefix, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Vec.pyx":1057 * cdef const char *cval = NULL * prefix = str2bytes(prefix, &cval) * CHKERR( VecAppendOptionsPrefix(self.vec, cval) ) # <<<<<<<<<<<<<< * * def setFromOptions(self) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecAppendOptionsPrefix(__pyx_v_self->vec, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 1057, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":1045 * return bytes2str(cval) * * def appendOptionsPrefix(self, prefix: str) -> None: # <<<<<<<<<<<<<< * """Append to the prefix used for searching for options in the database. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Vec.appendOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_prefix); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":1059 * CHKERR( VecAppendOptionsPrefix(self.vec, cval) ) * * def setFromOptions(self) -> None: # <<<<<<<<<<<<<< * """Configure the vector from the options database. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_101setFromOptions(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_100setFromOptions, "Vec.setFromOptions(self) -> None\nConfigure the vector from the options database.\n\n Collective.\n\n See Also\n --------\n petsc_options, petsc.VecSetFromOptions\n\n \nSource code at petsc4py/PETSc/Vec.pyx:1059"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_101setFromOptions(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFromOptions (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("setFromOptions", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setFromOptions", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_100setFromOptions(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_100setFromOptions(struct PyPetscVecObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFromOptions", 1); /* "petsc4py/PETSc/Vec.pyx":1069 * * """ * CHKERR( VecSetFromOptions(self.vec) ) # <<<<<<<<<<<<<< * * def setUp(self) -> Self: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecSetFromOptions(__pyx_v_self->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 1069, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":1059 * CHKERR( VecAppendOptionsPrefix(self.vec, cval) ) * * def setFromOptions(self) -> None: # <<<<<<<<<<<<<< * """Configure the vector from the options database. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.setFromOptions", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":1071 * CHKERR( VecSetFromOptions(self.vec) ) * * def setUp(self) -> Self: # <<<<<<<<<<<<<< * """Set up the internal data structures for using the vector. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_103setUp(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_102setUp, "Vec.setUp(self) -> Self\nSet up the internal data structures for using the vector.\n\n Collective.\n\n See Also\n --------\n create, destroy, petsc.VecSetUp\n\n \nSource code at petsc4py/PETSc/Vec.pyx:1071"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_103setUp(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setUp (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("setUp", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setUp", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_102setUp(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_102setUp(struct PyPetscVecObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setUp", 1); /* "petsc4py/PETSc/Vec.pyx":1081 * * """ * CHKERR( VecSetUp(self.vec) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecSetUp(__pyx_v_self->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 1081, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":1082 * """ * CHKERR( VecSetUp(self.vec) ) * return self # <<<<<<<<<<<<<< * * def setOption(self, option: Option, flag: bool) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":1071 * CHKERR( VecSetFromOptions(self.vec) ) * * def setUp(self) -> Self: # <<<<<<<<<<<<<< * """Set up the internal data structures for using the vector. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.setUp", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":1084 * return self * * def setOption(self, option: Option, flag: bool) -> None: # <<<<<<<<<<<<<< * """Set option. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_105setOption(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_104setOption, "Vec.setOption(self, option: Option, flag: bool) -> None\nSet option.\n\n Collective.\n\n See Also\n --------\n petsc.VecSetOption\n\n \nSource code at petsc4py/PETSc/Vec.pyx:1084"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_105setOption(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_option = 0; PyObject *__pyx_v_flag = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setOption (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_option,&__pyx_n_s_flag,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_option)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 1084, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flag)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 1084, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setOption", 1, 2, 2, 1); __PYX_ERR(41, 1084, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setOption") < 0)) __PYX_ERR(41, 1084, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_option = values[0]; __pyx_v_flag = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setOption", 1, 2, 2, __pyx_nargs); __PYX_ERR(41, 1084, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.setOption", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_104setOption(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_option, __pyx_v_flag); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_104setOption(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_option, PyObject *__pyx_v_flag) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations VecOption __pyx_t_1; PetscBool __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setOption", 1); /* "petsc4py/PETSc/Vec.pyx":1094 * * """ * CHKERR( VecSetOption(self.vec, option, flag) ) # <<<<<<<<<<<<<< * * def getType(self) -> str: */ __pyx_t_1 = ((VecOption)__Pyx_PyInt_As_VecOption(__pyx_v_option)); if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 1094, __pyx_L1_error) __pyx_t_2 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_flag)); if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 1094, __pyx_L1_error) __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecSetOption(__pyx_v_self->vec, __pyx_t_1, __pyx_t_2)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 1094, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":1084 * return self * * def setOption(self, option: Option, flag: bool) -> None: # <<<<<<<<<<<<<< * """Set option. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.setOption", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":1096 * CHKERR( VecSetOption(self.vec, option, flag) ) * * def getType(self) -> str: # <<<<<<<<<<<<<< * """Return the type of the vector. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_107getType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_106getType, "Vec.getType(self) -> str\nReturn the type of the vector.\n\n Not collective.\n\n See Also\n --------\n setType, petsc.VecGetType\n\n \nSource code at petsc4py/PETSc/Vec.pyx:1096"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_107getType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getType", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_106getType(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_106getType(struct PyPetscVecObject *__pyx_v_self) { VecType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getType", 1); /* "petsc4py/PETSc/Vec.pyx":1106 * * """ * cdef PetscVecType cval = NULL # <<<<<<<<<<<<<< * CHKERR( VecGetType(self.vec, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/Vec.pyx":1107 * """ * cdef PetscVecType cval = NULL * CHKERR( VecGetType(self.vec, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetType(__pyx_v_self->vec, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 1107, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":1108 * cdef PetscVecType cval = NULL * CHKERR( VecGetType(self.vec, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * def getSize(self) -> int: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 1108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":1096 * CHKERR( VecSetOption(self.vec, option, flag) ) * * def getType(self) -> str: # <<<<<<<<<<<<<< * """Return the type of the vector. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Vec.getType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":1110 * return bytes2str(cval) * * def getSize(self) -> int: # <<<<<<<<<<<<<< * """Return the global size of the vector. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_109getSize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_108getSize, "Vec.getSize(self) -> int\nReturn the global size of the vector.\n\n Not collective.\n\n See Also\n --------\n setSizes, getLocalSize, petsc.VecGetSize\n\n \nSource code at petsc4py/PETSc/Vec.pyx:1110"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_109getSize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSize (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getSize", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getSize", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_108getSize(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_108getSize(struct PyPetscVecObject *__pyx_v_self) { PetscInt __pyx_v_N; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSize", 1); /* "petsc4py/PETSc/Vec.pyx":1120 * * """ * cdef PetscInt N = 0 # <<<<<<<<<<<<<< * CHKERR( VecGetSize(self.vec, &N) ) * return toInt(N) */ __pyx_v_N = 0; /* "petsc4py/PETSc/Vec.pyx":1121 * """ * cdef PetscInt N = 0 * CHKERR( VecGetSize(self.vec, &N) ) # <<<<<<<<<<<<<< * return toInt(N) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetSize(__pyx_v_self->vec, (&__pyx_v_N))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 1121, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":1122 * cdef PetscInt N = 0 * CHKERR( VecGetSize(self.vec, &N) ) * return toInt(N) # <<<<<<<<<<<<<< * * def getLocalSize(self) -> int: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_N); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 1122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":1110 * return bytes2str(cval) * * def getSize(self) -> int: # <<<<<<<<<<<<<< * """Return the global size of the vector. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Vec.getSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":1124 * return toInt(N) * * def getLocalSize(self) -> int: # <<<<<<<<<<<<<< * """Return the local size of the vector. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_111getLocalSize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_110getLocalSize, "Vec.getLocalSize(self) -> int\nReturn the local size of the vector.\n\n Not collective.\n\n See Also\n --------\n setSizes, getSize, petsc.VecGetLocalSize\n\n \nSource code at petsc4py/PETSc/Vec.pyx:1124"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_111getLocalSize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getLocalSize (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getLocalSize", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getLocalSize", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_110getLocalSize(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_110getLocalSize(struct PyPetscVecObject *__pyx_v_self) { PetscInt __pyx_v_n; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getLocalSize", 1); /* "petsc4py/PETSc/Vec.pyx":1134 * * """ * cdef PetscInt n = 0 # <<<<<<<<<<<<<< * CHKERR( VecGetLocalSize(self.vec, &n) ) * return toInt(n) */ __pyx_v_n = 0; /* "petsc4py/PETSc/Vec.pyx":1135 * """ * cdef PetscInt n = 0 * CHKERR( VecGetLocalSize(self.vec, &n) ) # <<<<<<<<<<<<<< * return toInt(n) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetLocalSize(__pyx_v_self->vec, (&__pyx_v_n))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 1135, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":1136 * cdef PetscInt n = 0 * CHKERR( VecGetLocalSize(self.vec, &n) ) * return toInt(n) # <<<<<<<<<<<<<< * * def getSizes(self) -> LayoutSizeSpec: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 1136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":1124 * return toInt(N) * * def getLocalSize(self) -> int: # <<<<<<<<<<<<<< * """Return the local size of the vector. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Vec.getLocalSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":1138 * return toInt(n) * * def getSizes(self) -> LayoutSizeSpec: # <<<<<<<<<<<<<< * """Return the vector sizes. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_113getSizes(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_112getSizes, "Vec.getSizes(self) -> LayoutSizeSpec\nReturn the vector sizes.\n\n Not collective.\n\n See Also\n --------\n getSize, getLocalSize, petsc.VecGetLocalSize, petsc.VecGetSize\n\n \nSource code at petsc4py/PETSc/Vec.pyx:1138"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_113getSizes(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSizes (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getSizes", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getSizes", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_112getSizes(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_112getSizes(struct PyPetscVecObject *__pyx_v_self) { PetscInt __pyx_v_n; PetscInt __pyx_v_N; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSizes", 1); /* "petsc4py/PETSc/Vec.pyx":1148 * * """ * cdef PetscInt n = 0, N = 0 # <<<<<<<<<<<<<< * CHKERR( VecGetLocalSize(self.vec, &n) ) * CHKERR( VecGetSize(self.vec, &N) ) */ __pyx_v_n = 0; __pyx_v_N = 0; /* "petsc4py/PETSc/Vec.pyx":1149 * """ * cdef PetscInt n = 0, N = 0 * CHKERR( VecGetLocalSize(self.vec, &n) ) # <<<<<<<<<<<<<< * CHKERR( VecGetSize(self.vec, &N) ) * return (toInt(n), toInt(N)) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetLocalSize(__pyx_v_self->vec, (&__pyx_v_n))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 1149, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":1150 * cdef PetscInt n = 0, N = 0 * CHKERR( VecGetLocalSize(self.vec, &n) ) * CHKERR( VecGetSize(self.vec, &N) ) # <<<<<<<<<<<<<< * return (toInt(n), toInt(N)) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetSize(__pyx_v_self->vec, (&__pyx_v_N))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 1150, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":1151 * CHKERR( VecGetLocalSize(self.vec, &n) ) * CHKERR( VecGetSize(self.vec, &N) ) * return (toInt(n), toInt(N)) # <<<<<<<<<<<<<< * * def setBlockSize(self, bsize: int) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 1151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_N); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 1151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 1151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(41, 1151, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(41, 1151, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":1138 * return toInt(n) * * def getSizes(self) -> LayoutSizeSpec: # <<<<<<<<<<<<<< * """Return the vector sizes. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.Vec.getSizes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":1153 * return (toInt(n), toInt(N)) * * def setBlockSize(self, bsize: int) -> None: # <<<<<<<<<<<<<< * """Set the block size of the vector. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_115setBlockSize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_114setBlockSize, "Vec.setBlockSize(self, bsize: int) -> None\nSet the block size of the vector.\n\n Logically collective.\n\n See Also\n --------\n petsc.VecSetBlockSize\n\n \nSource code at petsc4py/PETSc/Vec.pyx:1153"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_115setBlockSize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_bsize = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setBlockSize (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_bsize,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_bsize)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 1153, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setBlockSize") < 0)) __PYX_ERR(41, 1153, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_bsize = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setBlockSize", 1, 1, 1, __pyx_nargs); __PYX_ERR(41, 1153, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.setBlockSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_114setBlockSize(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_bsize); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_114setBlockSize(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_bsize) { PetscInt __pyx_v_bs; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setBlockSize", 1); /* "petsc4py/PETSc/Vec.pyx":1163 * * """ * cdef PetscInt bs = asInt(bsize) # <<<<<<<<<<<<<< * CHKERR( VecSetBlockSize(self.vec, bs) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_bsize); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(41, 1163, __pyx_L1_error) __pyx_v_bs = __pyx_t_1; /* "petsc4py/PETSc/Vec.pyx":1164 * """ * cdef PetscInt bs = asInt(bsize) * CHKERR( VecSetBlockSize(self.vec, bs) ) # <<<<<<<<<<<<<< * * def getBlockSize(self) -> int: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecSetBlockSize(__pyx_v_self->vec, __pyx_v_bs)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 1164, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":1153 * return (toInt(n), toInt(N)) * * def setBlockSize(self, bsize: int) -> None: # <<<<<<<<<<<<<< * """Set the block size of the vector. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.setBlockSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":1166 * CHKERR( VecSetBlockSize(self.vec, bs) ) * * def getBlockSize(self) -> int: # <<<<<<<<<<<<<< * """Return the block size of the vector. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_117getBlockSize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_116getBlockSize, "Vec.getBlockSize(self) -> int\nReturn the block size of the vector.\n\n Not collective.\n\n See Also\n --------\n petsc.VecGetBlockSize\n\n \nSource code at petsc4py/PETSc/Vec.pyx:1166"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_117getBlockSize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getBlockSize (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getBlockSize", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getBlockSize", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_116getBlockSize(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_116getBlockSize(struct PyPetscVecObject *__pyx_v_self) { PetscInt __pyx_v_bs; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getBlockSize", 1); /* "petsc4py/PETSc/Vec.pyx":1176 * * """ * cdef PetscInt bs=0 # <<<<<<<<<<<<<< * CHKERR( VecGetBlockSize(self.vec, &bs) ) * return toInt(bs) */ __pyx_v_bs = 0; /* "petsc4py/PETSc/Vec.pyx":1177 * """ * cdef PetscInt bs=0 * CHKERR( VecGetBlockSize(self.vec, &bs) ) # <<<<<<<<<<<<<< * return toInt(bs) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetBlockSize(__pyx_v_self->vec, (&__pyx_v_bs))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 1177, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":1178 * cdef PetscInt bs=0 * CHKERR( VecGetBlockSize(self.vec, &bs) ) * return toInt(bs) # <<<<<<<<<<<<<< * * def getOwnershipRange(self) -> tuple[int, int]: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_bs); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 1178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":1166 * CHKERR( VecSetBlockSize(self.vec, bs) ) * * def getBlockSize(self) -> int: # <<<<<<<<<<<<<< * """Return the block size of the vector. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Vec.getBlockSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":1180 * return toInt(bs) * * def getOwnershipRange(self) -> tuple[int, int]: # <<<<<<<<<<<<<< * """Return the locally owned range of indices ``(start, end)``. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_119getOwnershipRange(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_118getOwnershipRange, "Vec.getOwnershipRange(self) -> tuple[int, int]\nReturn the locally owned range of indices ``(start, end)``.\n\n Not collective.\n\n Returns\n -------\n start : int\n The first local element.\n end : int\n One more than the last local element.\n\n See Also\n --------\n getOwnershipRanges, petsc.VecGetOwnershipRange\n\n \nSource code at petsc4py/PETSc/Vec.pyx:1180"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_119getOwnershipRange(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getOwnershipRange (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getOwnershipRange", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getOwnershipRange", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_118getOwnershipRange(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_118getOwnershipRange(struct PyPetscVecObject *__pyx_v_self) { PetscInt __pyx_v_low; PetscInt __pyx_v_high; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getOwnershipRange", 1); /* "petsc4py/PETSc/Vec.pyx":1197 * * """ * cdef PetscInt low=0, high=0 # <<<<<<<<<<<<<< * CHKERR( VecGetOwnershipRange(self.vec, &low, &high) ) * return (toInt(low), toInt(high)) */ __pyx_v_low = 0; __pyx_v_high = 0; /* "petsc4py/PETSc/Vec.pyx":1198 * """ * cdef PetscInt low=0, high=0 * CHKERR( VecGetOwnershipRange(self.vec, &low, &high) ) # <<<<<<<<<<<<<< * return (toInt(low), toInt(high)) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetOwnershipRange(__pyx_v_self->vec, (&__pyx_v_low), (&__pyx_v_high))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 1198, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":1199 * cdef PetscInt low=0, high=0 * CHKERR( VecGetOwnershipRange(self.vec, &low, &high) ) * return (toInt(low), toInt(high)) # <<<<<<<<<<<<<< * * def getOwnershipRanges(self) -> ArrayInt: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 1199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_high); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 1199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 1199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(41, 1199, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(41, 1199, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":1180 * return toInt(bs) * * def getOwnershipRange(self) -> tuple[int, int]: # <<<<<<<<<<<<<< * """Return the locally owned range of indices ``(start, end)``. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.Vec.getOwnershipRange", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":1201 * return (toInt(low), toInt(high)) * * def getOwnershipRanges(self) -> ArrayInt: # <<<<<<<<<<<<<< * """Return the range of indices owned by each process. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_121getOwnershipRanges(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_120getOwnershipRanges, "Vec.getOwnershipRanges(self) -> ArrayInt\nReturn the range of indices owned by each process.\n\n Not collective.\n\n The returned array is the result of exclusive scan of the local sizes.\n\n See Also\n --------\n getOwnershipRange, petsc.VecGetOwnershipRanges\n\n \nSource code at petsc4py/PETSc/Vec.pyx:1201"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_121getOwnershipRanges(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getOwnershipRanges (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getOwnershipRanges", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getOwnershipRanges", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_120getOwnershipRanges(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_120getOwnershipRanges(struct PyPetscVecObject *__pyx_v_self) { PetscInt const *__pyx_v_rng; MPI_Comm __pyx_v_comm; int __pyx_v_size; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getOwnershipRanges", 1); /* "petsc4py/PETSc/Vec.pyx":1213 * * """ * cdef const PetscInt *rng = NULL # <<<<<<<<<<<<<< * CHKERR( VecGetOwnershipRanges(self.vec, &rng) ) * cdef MPI_Comm comm = MPI_COMM_NULL */ __pyx_v_rng = NULL; /* "petsc4py/PETSc/Vec.pyx":1214 * """ * cdef const PetscInt *rng = NULL * CHKERR( VecGetOwnershipRanges(self.vec, &rng) ) # <<<<<<<<<<<<<< * cdef MPI_Comm comm = MPI_COMM_NULL * CHKERR( PetscObjectGetComm(self.vec, &comm) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetOwnershipRanges(__pyx_v_self->vec, (&__pyx_v_rng))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 1214, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":1215 * cdef const PetscInt *rng = NULL * CHKERR( VecGetOwnershipRanges(self.vec, &rng) ) * cdef MPI_Comm comm = MPI_COMM_NULL # <<<<<<<<<<<<<< * CHKERR( PetscObjectGetComm(self.vec, &comm) ) * cdef int size = -1 */ __pyx_v_comm = MPI_COMM_NULL; /* "petsc4py/PETSc/Vec.pyx":1216 * CHKERR( VecGetOwnershipRanges(self.vec, &rng) ) * cdef MPI_Comm comm = MPI_COMM_NULL * CHKERR( PetscObjectGetComm(self.vec, &comm) ) # <<<<<<<<<<<<<< * cdef int size = -1 * CHKERR( MPI_Comm_size(comm, &size) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectGetComm(((PetscObject)__pyx_v_self->vec), (&__pyx_v_comm))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 1216, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":1217 * cdef MPI_Comm comm = MPI_COMM_NULL * CHKERR( PetscObjectGetComm(self.vec, &comm) ) * cdef int size = -1 # <<<<<<<<<<<<<< * CHKERR( MPI_Comm_size(comm, &size) ) * return array_i(size+1, rng) */ __pyx_v_size = -1; /* "petsc4py/PETSc/Vec.pyx":1218 * CHKERR( PetscObjectGetComm(self.vec, &comm) ) * cdef int size = -1 * CHKERR( MPI_Comm_size(comm, &size) ) # <<<<<<<<<<<<<< * return array_i(size+1, rng) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(((PetscErrorCode)MPI_Comm_size(__pyx_v_comm, (&__pyx_v_size)))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 1218, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":1219 * cdef int size = -1 * CHKERR( MPI_Comm_size(comm, &size) ) * return array_i(size+1, rng) # <<<<<<<<<<<<<< * * def createLocalVector(self) -> Vec: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i((__pyx_v_size + 1), __pyx_v_rng)); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 1219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":1201 * return (toInt(low), toInt(high)) * * def getOwnershipRanges(self) -> ArrayInt: # <<<<<<<<<<<<<< * """Return the range of indices owned by each process. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Vec.getOwnershipRanges", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":1221 * return array_i(size+1, rng) * * def createLocalVector(self) -> Vec: # <<<<<<<<<<<<<< * """Create a local vector. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_123createLocalVector(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_122createLocalVector, "Vec.createLocalVector(self) -> Vec\nCreate a local vector.\n\n Not collective.\n\n Returns\n -------\n Vec\n The local vector.\n\n See Also\n --------\n getLocalVector, petsc.VecCreateLocalVector\n\n \nSource code at petsc4py/PETSc/Vec.pyx:1221"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_123createLocalVector(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createLocalVector (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("createLocalVector", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "createLocalVector", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_122createLocalVector(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_122createLocalVector(struct PyPetscVecObject *__pyx_v_self) { struct PyPetscVecObject *__pyx_v_lvec = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createLocalVector", 1); /* "petsc4py/PETSc/Vec.pyx":1236 * * """ * lvec = Vec() # <<<<<<<<<<<<<< * CHKERR( VecCreateLocalVector(self.vec, &lvec.vec) ) * return lvec */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 1236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_lvec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Vec.pyx":1237 * """ * lvec = Vec() * CHKERR( VecCreateLocalVector(self.vec, &lvec.vec) ) # <<<<<<<<<<<<<< * return lvec * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCreateLocalVector(__pyx_v_self->vec, (&__pyx_v_lvec->vec))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 1237, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":1238 * lvec = Vec() * CHKERR( VecCreateLocalVector(self.vec, &lvec.vec) ) * return lvec # <<<<<<<<<<<<<< * * def getLocalVector(self, Vec lvec, readonly: bool = False) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_lvec); __pyx_r = ((PyObject *)__pyx_v_lvec); goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":1221 * return array_i(size+1, rng) * * def createLocalVector(self) -> Vec: # <<<<<<<<<<<<<< * """Create a local vector. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Vec.createLocalVector", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_lvec); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":1240 * return lvec * * def getLocalVector(self, Vec lvec, readonly: bool = False) -> None: # <<<<<<<<<<<<<< * """Maps the local portion of the vector into a local vector. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_125getLocalVector(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_124getLocalVector, "Vec.getLocalVector(self, lvec: Vec, readonly: bool = False) -> None\nMaps the local portion of the vector into a local vector.\n\n Logically collective.\n\n Parameters\n ----------\n lvec\n The local vector obtained from `createLocalVector`.\n readonly\n Request read-only access.\n\n See Also\n --------\n createLocalVector, restoreLocalVector, petsc.VecGetLocalVectorRead\n petsc.VecGetLocalVector\n\n \nSource code at petsc4py/PETSc/Vec.pyx:1240"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_125getLocalVector(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_lvec = 0; PyObject *__pyx_v_readonly = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getLocalVector (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_lvec,&__pyx_n_s_readonly,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_lvec)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 1240, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_readonly); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 1240, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getLocalVector") < 0)) __PYX_ERR(41, 1240, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_lvec = ((struct PyPetscVecObject *)values[0]); __pyx_v_readonly = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getLocalVector", 0, 1, 2, __pyx_nargs); __PYX_ERR(41, 1240, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.getLocalVector", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lvec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "lvec", 0))) __PYX_ERR(41, 1240, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_124getLocalVector(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_lvec, __pyx_v_readonly); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_124getLocalVector(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_lvec, PyObject *__pyx_v_readonly) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getLocalVector", 1); /* "petsc4py/PETSc/Vec.pyx":1258 * * """ * if readonly: # <<<<<<<<<<<<<< * CHKERR( VecGetLocalVectorRead(self.vec, lvec.vec) ) * else: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_readonly); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(41, 1258, __pyx_L1_error) if (__pyx_t_1) { /* "petsc4py/PETSc/Vec.pyx":1259 * """ * if readonly: * CHKERR( VecGetLocalVectorRead(self.vec, lvec.vec) ) # <<<<<<<<<<<<<< * else: * CHKERR( VecGetLocalVector(self.vec, lvec.vec) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetLocalVectorRead(__pyx_v_self->vec, __pyx_v_lvec->vec)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 1259, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":1258 * * """ * if readonly: # <<<<<<<<<<<<<< * CHKERR( VecGetLocalVectorRead(self.vec, lvec.vec) ) * else: */ goto __pyx_L3; } /* "petsc4py/PETSc/Vec.pyx":1261 * CHKERR( VecGetLocalVectorRead(self.vec, lvec.vec) ) * else: * CHKERR( VecGetLocalVector(self.vec, lvec.vec) ) # <<<<<<<<<<<<<< * * def restoreLocalVector(self, Vec lvec, readonly: bool = False) -> None: */ /*else*/ { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetLocalVector(__pyx_v_self->vec, __pyx_v_lvec->vec)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 1261, __pyx_L1_error) } __pyx_L3:; /* "petsc4py/PETSc/Vec.pyx":1240 * return lvec * * def getLocalVector(self, Vec lvec, readonly: bool = False) -> None: # <<<<<<<<<<<<<< * """Maps the local portion of the vector into a local vector. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.getLocalVector", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":1263 * CHKERR( VecGetLocalVector(self.vec, lvec.vec) ) * * def restoreLocalVector(self, Vec lvec, readonly: bool = False) -> None: # <<<<<<<<<<<<<< * """Unmap a local access obtained with `getLocalVector`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_127restoreLocalVector(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_126restoreLocalVector, "Vec.restoreLocalVector(self, lvec: Vec, readonly: bool = False) -> None\nUnmap a local access obtained with `getLocalVector`.\n\n Logically collective.\n\n Parameters\n ----------\n lvec\n The local vector.\n readonly\n Request read-only access.\n\n See Also\n --------\n createLocalVector, getLocalVector, petsc.VecRestoreLocalVectorRead\n petsc.VecRestoreLocalVector\n\n \nSource code at petsc4py/PETSc/Vec.pyx:1263"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_127restoreLocalVector(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_lvec = 0; PyObject *__pyx_v_readonly = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("restoreLocalVector (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_lvec,&__pyx_n_s_readonly,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_lvec)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 1263, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_readonly); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 1263, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "restoreLocalVector") < 0)) __PYX_ERR(41, 1263, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_lvec = ((struct PyPetscVecObject *)values[0]); __pyx_v_readonly = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("restoreLocalVector", 0, 1, 2, __pyx_nargs); __PYX_ERR(41, 1263, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.restoreLocalVector", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lvec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "lvec", 0))) __PYX_ERR(41, 1263, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_126restoreLocalVector(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_lvec, __pyx_v_readonly); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_126restoreLocalVector(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_lvec, PyObject *__pyx_v_readonly) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("restoreLocalVector", 1); /* "petsc4py/PETSc/Vec.pyx":1281 * * """ * if readonly: # <<<<<<<<<<<<<< * CHKERR( VecRestoreLocalVectorRead(self.vec, lvec.vec) ) * else: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_readonly); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(41, 1281, __pyx_L1_error) if (__pyx_t_1) { /* "petsc4py/PETSc/Vec.pyx":1282 * """ * if readonly: * CHKERR( VecRestoreLocalVectorRead(self.vec, lvec.vec) ) # <<<<<<<<<<<<<< * else: * CHKERR( VecRestoreLocalVector(self.vec, lvec.vec) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecRestoreLocalVectorRead(__pyx_v_self->vec, __pyx_v_lvec->vec)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 1282, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":1281 * * """ * if readonly: # <<<<<<<<<<<<<< * CHKERR( VecRestoreLocalVectorRead(self.vec, lvec.vec) ) * else: */ goto __pyx_L3; } /* "petsc4py/PETSc/Vec.pyx":1284 * CHKERR( VecRestoreLocalVectorRead(self.vec, lvec.vec) ) * else: * CHKERR( VecRestoreLocalVector(self.vec, lvec.vec) ) # <<<<<<<<<<<<<< * * # FIXME Return type should be more specific */ /*else*/ { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecRestoreLocalVector(__pyx_v_self->vec, __pyx_v_lvec->vec)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 1284, __pyx_L1_error) } __pyx_L3:; /* "petsc4py/PETSc/Vec.pyx":1263 * CHKERR( VecGetLocalVector(self.vec, lvec.vec) ) * * def restoreLocalVector(self, Vec lvec, readonly: bool = False) -> None: # <<<<<<<<<<<<<< * """Unmap a local access obtained with `getLocalVector`. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.restoreLocalVector", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":1287 * * # FIXME Return type should be more specific * def getBuffer(self, readonly: bool = False) -> Any: # <<<<<<<<<<<<<< * """Return a buffered view of the local portion of the vector. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_129getBuffer(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_128getBuffer, "Vec.getBuffer(self, readonly: bool = False) -> Any\nReturn a buffered view of the local portion of the vector.\n\n Logically collective.\n\n Parameters\n ----------\n readonly\n Request read-only access.\n\n Returns\n -------\n typing.Any\n `Buffer object ` wrapping the local portion of\n the vector data. This can be used either as a context manager\n providing access as a numpy array or can be passed to array\n constructors accepting buffered objects such as `numpy.asarray`.\n\n Examples\n --------\n Accessing the data with a context manager:\n\n >>> vec = PETSc.Vec().createWithArray([1, 2, 3])\n >>> with vec.getBuffer() as arr:\n ... arr\n array([1., 2., 3.])\n\n Converting the buffer to an `ndarray`:\n\n >>> buf = PETSc.Vec().createWithArray([1, 2, 3]).getBuffer()\n >>> np.asarray(buf)\n array([1., 2., 3.])\n\n See Also\n --------\n getArray\n\n \nSource code at petsc4py/PETSc/Vec.pyx:1287"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_129getBuffer(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_readonly = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getBuffer (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_readonly,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_readonly); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 1287, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getBuffer") < 0)) __PYX_ERR(41, 1287, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_readonly = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getBuffer", 0, 0, 1, __pyx_nargs); __PYX_ERR(41, 1287, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.getBuffer", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_128getBuffer(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_readonly); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_128getBuffer(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_readonly) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getBuffer", 1); /* "petsc4py/PETSc/Vec.pyx":1325 * * """ * if readonly: # <<<<<<<<<<<<<< * return vec_getbuffer_r(self) * else: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_readonly); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(41, 1325, __pyx_L1_error) if (__pyx_t_1) { /* "petsc4py/PETSc/Vec.pyx":1326 * """ * if readonly: * return vec_getbuffer_r(self) # <<<<<<<<<<<<<< * else: * return vec_getbuffer_w(self) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_getbuffer_r(__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 1326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":1325 * * """ * if readonly: # <<<<<<<<<<<<<< * return vec_getbuffer_r(self) * else: */ } /* "petsc4py/PETSc/Vec.pyx":1328 * return vec_getbuffer_r(self) * else: * return vec_getbuffer_w(self) # <<<<<<<<<<<<<< * * def getArray(self, readonly: bool=False) -> ArrayScalar: */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_getbuffer_w(__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 1328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; } /* "petsc4py/PETSc/Vec.pyx":1287 * * # FIXME Return type should be more specific * def getBuffer(self, readonly: bool = False) -> Any: # <<<<<<<<<<<<<< * """Return a buffered view of the local portion of the vector. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Vec.getBuffer", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":1330 * return vec_getbuffer_w(self) * * def getArray(self, readonly: bool=False) -> ArrayScalar: # <<<<<<<<<<<<<< * """Return local portion of the vector as an `ndarray`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_131getArray(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_130getArray, "Vec.getArray(self, readonly: bool = False) -> ArrayScalar\nReturn local portion of the vector as an `ndarray`.\n\n Logically collective.\n\n Parameters\n ----------\n readonly\n Request read-only access.\n\n See Also\n --------\n setArray, getBuffer\n\n \nSource code at petsc4py/PETSc/Vec.pyx:1330"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_131getArray(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_readonly = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getArray (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_readonly,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_readonly); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 1330, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getArray") < 0)) __PYX_ERR(41, 1330, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_readonly = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getArray", 0, 0, 1, __pyx_nargs); __PYX_ERR(41, 1330, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.getArray", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_130getArray(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_readonly); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_130getArray(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_readonly) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getArray", 1); /* "petsc4py/PETSc/Vec.pyx":1345 * * """ * if readonly: # <<<<<<<<<<<<<< * return vec_getarray_r(self) * else: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_readonly); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(41, 1345, __pyx_L1_error) if (__pyx_t_1) { /* "petsc4py/PETSc/Vec.pyx":1346 * """ * if readonly: * return vec_getarray_r(self) # <<<<<<<<<<<<<< * else: * return vec_getarray_w(self) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_getarray_r(__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 1346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":1345 * * """ * if readonly: # <<<<<<<<<<<<<< * return vec_getarray_r(self) * else: */ } /* "petsc4py/PETSc/Vec.pyx":1348 * return vec_getarray_r(self) * else: * return vec_getarray_w(self) # <<<<<<<<<<<<<< * * def setArray(self, array: Sequence[Scalar]) -> None: */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_getarray_w(__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 1348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; } /* "petsc4py/PETSc/Vec.pyx":1330 * return vec_getbuffer_w(self) * * def getArray(self, readonly: bool=False) -> ArrayScalar: # <<<<<<<<<<<<<< * """Return local portion of the vector as an `ndarray`. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Vec.getArray", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":1350 * return vec_getarray_w(self) * * def setArray(self, array: Sequence[Scalar]) -> None: # <<<<<<<<<<<<<< * """Set values for the local portion of the vector. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_133setArray(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_132setArray, "Vec.setArray(self, array: Sequence[Scalar]) -> None\nSet values for the local portion of the vector.\n\n Logically collective.\n\n See Also\n --------\n placeArray\n\n \nSource code at petsc4py/PETSc/Vec.pyx:1350"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_133setArray(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_array = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setArray (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_array,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_array)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 1350, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setArray") < 0)) __PYX_ERR(41, 1350, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_array = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setArray", 1, 1, 1, __pyx_nargs); __PYX_ERR(41, 1350, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.setArray", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_132setArray(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_array); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_132setArray(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_array) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setArray", 1); /* "petsc4py/PETSc/Vec.pyx":1360 * * """ * vec_setarray(self, array) # <<<<<<<<<<<<<< * * def placeArray(self, array: Sequence[Scalar]) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_vec_setarray(__pyx_v_self, __pyx_v_array); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(41, 1360, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":1350 * return vec_getarray_w(self) * * def setArray(self, array: Sequence[Scalar]) -> None: # <<<<<<<<<<<<<< * """Set values for the local portion of the vector. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.setArray", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":1362 * vec_setarray(self, array) * * def placeArray(self, array: Sequence[Scalar]) -> None: # <<<<<<<<<<<<<< * """Set the local portion of the vector to a provided array. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_135placeArray(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_134placeArray, "Vec.placeArray(self, array: Sequence[Scalar]) -> None\nSet the local portion of the vector to a provided array.\n\n Not collective.\n\n See Also\n --------\n resetArray, setArray, petsc.VecPlaceArray\n\n \nSource code at petsc4py/PETSc/Vec.pyx:1362"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_135placeArray(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_array = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("placeArray (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_array,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_array)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 1362, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "placeArray") < 0)) __PYX_ERR(41, 1362, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_array = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("placeArray", 1, 1, 1, __pyx_nargs); __PYX_ERR(41, 1362, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.placeArray", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_134placeArray(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_array); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_134placeArray(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_array) { PetscInt __pyx_v_nv; PetscInt __pyx_v_na; PetscScalar *__pyx_v_a; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("placeArray", 0); __Pyx_INCREF(__pyx_v_array); /* "petsc4py/PETSc/Vec.pyx":1372 * * """ * cdef PetscInt nv=0 # <<<<<<<<<<<<<< * cdef PetscInt na=0 * cdef PetscScalar *a = NULL */ __pyx_v_nv = 0; /* "petsc4py/PETSc/Vec.pyx":1373 * """ * cdef PetscInt nv=0 * cdef PetscInt na=0 # <<<<<<<<<<<<<< * cdef PetscScalar *a = NULL * CHKERR( VecGetLocalSize(self.vec, &nv) ) */ __pyx_v_na = 0; /* "petsc4py/PETSc/Vec.pyx":1374 * cdef PetscInt nv=0 * cdef PetscInt na=0 * cdef PetscScalar *a = NULL # <<<<<<<<<<<<<< * CHKERR( VecGetLocalSize(self.vec, &nv) ) * array = oarray_s(array, &na, &a) */ __pyx_v_a = NULL; /* "petsc4py/PETSc/Vec.pyx":1375 * cdef PetscInt na=0 * cdef PetscScalar *a = NULL * CHKERR( VecGetLocalSize(self.vec, &nv) ) # <<<<<<<<<<<<<< * array = oarray_s(array, &na, &a) * if (na != nv): raise ValueError( */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetLocalSize(__pyx_v_self->vec, (&__pyx_v_nv))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 1375, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":1376 * cdef PetscScalar *a = NULL * CHKERR( VecGetLocalSize(self.vec, &nv) ) * array = oarray_s(array, &na, &a) # <<<<<<<<<<<<<< * if (na != nv): raise ValueError( * "cannot place input array size %d, vector size %d" % */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_s(__pyx_v_array, (&__pyx_v_na), (&__pyx_v_a))); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 1376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_array, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/Vec.pyx":1377 * CHKERR( VecGetLocalSize(self.vec, &nv) ) * array = oarray_s(array, &na, &a) * if (na != nv): raise ValueError( # <<<<<<<<<<<<<< * "cannot place input array size %d, vector size %d" % * (toInt(na), toInt(nv))) */ __pyx_t_3 = (__pyx_v_na != __pyx_v_nv); if (unlikely(__pyx_t_3)) { /* "petsc4py/PETSc/Vec.pyx":1379 * if (na != nv): raise ValueError( * "cannot place input array size %d, vector size %d" % * (toInt(na), toInt(nv))) # <<<<<<<<<<<<<< * CHKERR( VecPlaceArray(self.vec, a) ) * self.set_attr('__placed_array__', array) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_na); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 1379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nv); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 1379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(41, 1379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2)) __PYX_ERR(41, 1379, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4)) __PYX_ERR(41, 1379, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_4 = 0; /* "petsc4py/PETSc/Vec.pyx":1378 * array = oarray_s(array, &na, &a) * if (na != nv): raise ValueError( * "cannot place input array size %d, vector size %d" % # <<<<<<<<<<<<<< * (toInt(na), toInt(nv))) * CHKERR( VecPlaceArray(self.vec, a) ) */ __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_cannot_place_input_array_size_d, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 1378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/Vec.pyx":1377 * CHKERR( VecGetLocalSize(self.vec, &nv) ) * array = oarray_s(array, &na, &a) * if (na != nv): raise ValueError( # <<<<<<<<<<<<<< * "cannot place input array size %d, vector size %d" % * (toInt(na), toInt(nv))) */ __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(41, 1377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(41, 1377, __pyx_L1_error) } /* "petsc4py/PETSc/Vec.pyx":1380 * "cannot place input array size %d, vector size %d" % * (toInt(na), toInt(nv))) * CHKERR( VecPlaceArray(self.vec, a) ) # <<<<<<<<<<<<<< * self.set_attr('__placed_array__', array) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecPlaceArray(__pyx_v_self->vec, __pyx_v_a)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 1380, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":1381 * (toInt(na), toInt(nv))) * CHKERR( VecPlaceArray(self.vec, a) ) * self.set_attr('__placed_array__', array) # <<<<<<<<<<<<<< * * def resetArray(self, force: bool = False) -> ArrayScalar | None: */ __pyx_t_5 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Vec *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__placed_array__"), __pyx_v_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(41, 1381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/Vec.pyx":1362 * vec_setarray(self, array) * * def placeArray(self, array: Sequence[Scalar]) -> None: # <<<<<<<<<<<<<< * """Set the local portion of the vector to a provided array. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.Vec.placeArray", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_array); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":1383 * self.set_attr('__placed_array__', array) * * def resetArray(self, force: bool = False) -> ArrayScalar | None: # <<<<<<<<<<<<<< * """Reset the vector to use its default array. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_137resetArray(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_136resetArray, "Vec.resetArray(self, force: bool = False) -> ArrayScalar | None\nReset the vector to use its default array.\n\n Not collective.\n\n Parameters\n ----------\n force\n Force the calling of `petsc.VecResetArray` even if no user array\n has been placed with `placeArray`.\n\n Returns\n -------\n ArrayScalar\n The array previously provided by the user with `placeArray`.\n Can be `None` if ``force`` is `True` and no array was placed\n before.\n\n See Also\n --------\n placeArray, petsc.VecResetArray\n\n \nSource code at petsc4py/PETSc/Vec.pyx:1383"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_137resetArray(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_force = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("resetArray (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_force,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_force); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 1383, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "resetArray") < 0)) __PYX_ERR(41, 1383, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_force = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("resetArray", 0, 0, 1, __pyx_nargs); __PYX_ERR(41, 1383, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.resetArray", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_136resetArray(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_force); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_136resetArray(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_force) { PyObject *__pyx_v_array = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PetscErrorCode __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("resetArray", 1); /* "petsc4py/PETSc/Vec.pyx":1406 * * """ * cdef object array = None # <<<<<<<<<<<<<< * array = self.get_attr('__placed_array__') * if array is None and not force: return None */ __Pyx_INCREF(Py_None); __pyx_v_array = Py_None; /* "petsc4py/PETSc/Vec.pyx":1407 * """ * cdef object array = None * array = self.get_attr('__placed_array__') # <<<<<<<<<<<<<< * if array is None and not force: return None * CHKERR( VecResetArray(self.vec) ) */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Vec *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__placed_array__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 1407, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_array, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Vec.pyx":1408 * cdef object array = None * array = self.get_attr('__placed_array__') * if array is None and not force: return None # <<<<<<<<<<<<<< * CHKERR( VecResetArray(self.vec) ) * self.set_attr('__placed_array__', None) */ __pyx_t_3 = (__pyx_v_array == Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_force); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(41, 1408, __pyx_L1_error) __pyx_t_4 = (!__pyx_t_3); __pyx_t_2 = __pyx_t_4; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } /* "petsc4py/PETSc/Vec.pyx":1409 * array = self.get_attr('__placed_array__') * if array is None and not force: return None * CHKERR( VecResetArray(self.vec) ) # <<<<<<<<<<<<<< * self.set_attr('__placed_array__', None) * return array */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecResetArray(__pyx_v_self->vec)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 1409, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":1410 * if array is None and not force: return None * CHKERR( VecResetArray(self.vec) ) * self.set_attr('__placed_array__', None) # <<<<<<<<<<<<<< * return array * */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Vec *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__placed_array__"), Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 1410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Vec.pyx":1411 * CHKERR( VecResetArray(self.vec) ) * self.set_attr('__placed_array__', None) * return array # <<<<<<<<<<<<<< * * def bindToCPU(self, flg: bool) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_array); __pyx_r = __pyx_v_array; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":1383 * self.set_attr('__placed_array__', array) * * def resetArray(self, force: bool = False) -> ArrayScalar | None: # <<<<<<<<<<<<<< * """Reset the vector to use its default array. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Vec.resetArray", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_array); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":1413 * return array * * def bindToCPU(self, flg: bool) -> None: # <<<<<<<<<<<<<< * """Bind vector operations execution on the CPU. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_139bindToCPU(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_138bindToCPU, "Vec.bindToCPU(self, flg: bool) -> None\nBind vector operations execution on the CPU.\n\n Logically collective.\n\n See Also\n --------\n boundToCPU, petsc.VecBindToCPU\n\n \nSource code at petsc4py/PETSc/Vec.pyx:1413"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_139bindToCPU(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_flg = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("bindToCPU (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flg,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flg)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 1413, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "bindToCPU") < 0)) __PYX_ERR(41, 1413, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_flg = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("bindToCPU", 1, 1, 1, __pyx_nargs); __PYX_ERR(41, 1413, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.bindToCPU", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_138bindToCPU(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_flg); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_138bindToCPU(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_flg) { PetscBool __pyx_v_bindFlg; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("bindToCPU", 1); /* "petsc4py/PETSc/Vec.pyx":1423 * * """ * cdef PetscBool bindFlg = asBool(flg) # <<<<<<<<<<<<<< * CHKERR( VecBindToCPU(self.vec, bindFlg) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asBool(__pyx_v_flg); if (unlikely(__pyx_t_1 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(41, 1423, __pyx_L1_error) __pyx_v_bindFlg = __pyx_t_1; /* "petsc4py/PETSc/Vec.pyx":1424 * """ * cdef PetscBool bindFlg = asBool(flg) * CHKERR( VecBindToCPU(self.vec, bindFlg) ) # <<<<<<<<<<<<<< * * def boundToCPU(self) -> bool: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecBindToCPU(__pyx_v_self->vec, __pyx_v_bindFlg)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 1424, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":1413 * return array * * def bindToCPU(self, flg: bool) -> None: # <<<<<<<<<<<<<< * """Bind vector operations execution on the CPU. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.bindToCPU", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":1426 * CHKERR( VecBindToCPU(self.vec, bindFlg) ) * * def boundToCPU(self) -> bool: # <<<<<<<<<<<<<< * """Return whether the vector has been bound to the CPU. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_141boundToCPU(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_140boundToCPU, "Vec.boundToCPU(self) -> bool\nReturn whether the vector has been bound to the CPU.\n\n Not collective.\n\n See Also\n --------\n bindToCPU, petsc.VecBoundToCPU\n\n \nSource code at petsc4py/PETSc/Vec.pyx:1426"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_141boundToCPU(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("boundToCPU (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("boundToCPU", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "boundToCPU", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_140boundToCPU(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_140boundToCPU(struct PyPetscVecObject *__pyx_v_self) { PetscBool __pyx_v_flg; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("boundToCPU", 1); /* "petsc4py/PETSc/Vec.pyx":1436 * * """ * cdef PetscBool flg = PETSC_TRUE # <<<<<<<<<<<<<< * CHKERR( VecBoundToCPU(self.vec, &flg) ) * return toBool(flg) */ __pyx_v_flg = PETSC_TRUE; /* "petsc4py/PETSc/Vec.pyx":1437 * """ * cdef PetscBool flg = PETSC_TRUE * CHKERR( VecBoundToCPU(self.vec, &flg) ) # <<<<<<<<<<<<<< * return toBool(flg) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecBoundToCPU(__pyx_v_self->vec, (&__pyx_v_flg))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 1437, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":1438 * cdef PetscBool flg = PETSC_TRUE * CHKERR( VecBoundToCPU(self.vec, &flg) ) * return toBool(flg) # <<<<<<<<<<<<<< * * def getCUDAHandle( */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flg); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 1438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":1426 * CHKERR( VecBindToCPU(self.vec, bindFlg) ) * * def boundToCPU(self) -> bool: # <<<<<<<<<<<<<< * """Return whether the vector has been bound to the CPU. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Vec.boundToCPU", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":1440 * return toBool(flg) * * def getCUDAHandle( # <<<<<<<<<<<<<< * self, * mode: AccessModeSpec = 'rw', */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_143getCUDAHandle(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_142getCUDAHandle, "Vec.getCUDAHandle(self, mode: AccessModeSpec = 'rw') -> Any\nReturn a pointer to the device buffer.\n\n Not collective.\n\n The returned pointer should be released using `restoreCUDAHandle`\n with the same access mode.\n\n Returns\n -------\n typing.Any\n CUDA device pointer.\n\n Notes\n -----\n This method may incur a host-to-device copy if the device data is\n out of date and ``mode`` is ``\"r\"`` or ``\"rw\"``.\n\n See Also\n --------\n restoreCUDAHandle, petsc.VecCUDAGetArray, petsc.VecCUDAGetArrayRead\n petsc.VecCUDAGetArrayWrite\n\n \nSource code at petsc4py/PETSc/Vec.pyx:1440"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_143getCUDAHandle(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_mode = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getCUDAHandle (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mode,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_n_s_rw)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mode); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 1440, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getCUDAHandle") < 0)) __PYX_ERR(41, 1440, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_mode = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getCUDAHandle", 0, 0, 1, __pyx_nargs); __PYX_ERR(41, 1440, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.getCUDAHandle", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_142getCUDAHandle(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_mode); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_142getCUDAHandle(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_mode) { PetscScalar *__pyx_v_hdl; char const *__pyx_v_m; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getCUDAHandle", 0); __Pyx_INCREF(__pyx_v_mode); /* "petsc4py/PETSc/Vec.pyx":1467 * * """ * cdef PetscScalar *hdl = NULL # <<<<<<<<<<<<<< * cdef const char *m = NULL * if mode is not None: mode = str2bytes(mode, &m) */ __pyx_v_hdl = NULL; /* "petsc4py/PETSc/Vec.pyx":1468 * """ * cdef PetscScalar *hdl = NULL * cdef const char *m = NULL # <<<<<<<<<<<<<< * if mode is not None: mode = str2bytes(mode, &m) * if m == NULL or (m[0] == c'r' and m[1] == c'w'): */ __pyx_v_m = NULL; /* "petsc4py/PETSc/Vec.pyx":1469 * cdef PetscScalar *hdl = NULL * cdef const char *m = NULL * if mode is not None: mode = str2bytes(mode, &m) # <<<<<<<<<<<<<< * if m == NULL or (m[0] == c'r' and m[1] == c'w'): * CHKERR( VecCUDAGetArray(self.vec, &hdl) ) */ __pyx_t_1 = (__pyx_v_mode != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_mode, (&__pyx_v_m)); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 1469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_mode, __pyx_t_2); __pyx_t_2 = 0; } /* "petsc4py/PETSc/Vec.pyx":1470 * cdef const char *m = NULL * if mode is not None: mode = str2bytes(mode, &m) * if m == NULL or (m[0] == c'r' and m[1] == c'w'): # <<<<<<<<<<<<<< * CHKERR( VecCUDAGetArray(self.vec, &hdl) ) * elif m[0] == c'r': */ __pyx_t_3 = (__pyx_v_m == NULL); if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L5_bool_binop_done; } __pyx_t_3 = ((__pyx_v_m[0]) == 'r'); if (__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L5_bool_binop_done; } __pyx_t_3 = ((__pyx_v_m[1]) == 'w'); __pyx_t_1 = __pyx_t_3; __pyx_L5_bool_binop_done:; if (__pyx_t_1) { /* "petsc4py/PETSc/Vec.pyx":1471 * if mode is not None: mode = str2bytes(mode, &m) * if m == NULL or (m[0] == c'r' and m[1] == c'w'): * CHKERR( VecCUDAGetArray(self.vec, &hdl) ) # <<<<<<<<<<<<<< * elif m[0] == c'r': * CHKERR( VecCUDAGetArrayRead(self.vec, &hdl) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCUDAGetArray(__pyx_v_self->vec, (&__pyx_v_hdl))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 1471, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":1470 * cdef const char *m = NULL * if mode is not None: mode = str2bytes(mode, &m) * if m == NULL or (m[0] == c'r' and m[1] == c'w'): # <<<<<<<<<<<<<< * CHKERR( VecCUDAGetArray(self.vec, &hdl) ) * elif m[0] == c'r': */ goto __pyx_L4; } /* "petsc4py/PETSc/Vec.pyx":1472 * if m == NULL or (m[0] == c'r' and m[1] == c'w'): * CHKERR( VecCUDAGetArray(self.vec, &hdl) ) * elif m[0] == c'r': # <<<<<<<<<<<<<< * CHKERR( VecCUDAGetArrayRead(self.vec, &hdl) ) * elif m[0] == c'w': */ __pyx_t_1 = ((__pyx_v_m[0]) == 'r'); if (__pyx_t_1) { /* "petsc4py/PETSc/Vec.pyx":1473 * CHKERR( VecCUDAGetArray(self.vec, &hdl) ) * elif m[0] == c'r': * CHKERR( VecCUDAGetArrayRead(self.vec, &hdl) ) # <<<<<<<<<<<<<< * elif m[0] == c'w': * CHKERR( VecCUDAGetArrayWrite(self.vec, &hdl) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCUDAGetArrayRead(__pyx_v_self->vec, ((PetscScalar const **)(&__pyx_v_hdl)))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 1473, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":1472 * if m == NULL or (m[0] == c'r' and m[1] == c'w'): * CHKERR( VecCUDAGetArray(self.vec, &hdl) ) * elif m[0] == c'r': # <<<<<<<<<<<<<< * CHKERR( VecCUDAGetArrayRead(self.vec, &hdl) ) * elif m[0] == c'w': */ goto __pyx_L4; } /* "petsc4py/PETSc/Vec.pyx":1474 * elif m[0] == c'r': * CHKERR( VecCUDAGetArrayRead(self.vec, &hdl) ) * elif m[0] == c'w': # <<<<<<<<<<<<<< * CHKERR( VecCUDAGetArrayWrite(self.vec, &hdl) ) * else: */ __pyx_t_1 = ((__pyx_v_m[0]) == 'w'); if (likely(__pyx_t_1)) { /* "petsc4py/PETSc/Vec.pyx":1475 * CHKERR( VecCUDAGetArrayRead(self.vec, &hdl) ) * elif m[0] == c'w': * CHKERR( VecCUDAGetArrayWrite(self.vec, &hdl) ) # <<<<<<<<<<<<<< * else: * raise ValueError("Invalid mode: expected 'rw', 'r', or 'w'") */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCUDAGetArrayWrite(__pyx_v_self->vec, (&__pyx_v_hdl))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 1475, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":1474 * elif m[0] == c'r': * CHKERR( VecCUDAGetArrayRead(self.vec, &hdl) ) * elif m[0] == c'w': # <<<<<<<<<<<<<< * CHKERR( VecCUDAGetArrayWrite(self.vec, &hdl) ) * else: */ goto __pyx_L4; } /* "petsc4py/PETSc/Vec.pyx":1477 * CHKERR( VecCUDAGetArrayWrite(self.vec, &hdl) ) * else: * raise ValueError("Invalid mode: expected 'rw', 'r', or 'w'") # <<<<<<<<<<<<<< * return hdl * */ /*else*/ { __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 1477, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(41, 1477, __pyx_L1_error) } __pyx_L4:; /* "petsc4py/PETSc/Vec.pyx":1478 * else: * raise ValueError("Invalid mode: expected 'rw', 'r', or 'w'") * return hdl # <<<<<<<<<<<<<< * * def restoreCUDAHandle( */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_FromSize_t(((Py_uintptr_t)__pyx_v_hdl)); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 1478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":1440 * return toBool(flg) * * def getCUDAHandle( # <<<<<<<<<<<<<< * self, * mode: AccessModeSpec = 'rw', */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Vec.getCUDAHandle", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_mode); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":1480 * return hdl * * def restoreCUDAHandle( # <<<<<<<<<<<<<< * self, * handle: Any, # FIXME What type hint is appropriate? */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_145restoreCUDAHandle(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_144restoreCUDAHandle, "Vec.restoreCUDAHandle(self, handle: Any, mode: AccessModeSpec = 'rw') -> None\nRestore a pointer to the device buffer obtained with `getCUDAHandle`.\n\n Not collective.\n\n Parameters\n ----------\n handle\n CUDA device pointer.\n mode\n Access mode.\n\n See Also\n --------\n getCUDAHandle, petsc.VecCUDARestoreArray\n petsc.VecCUDARestoreArrayRead, petsc.VecCUDARestoreArrayWrite\n\n \nSource code at petsc4py/PETSc/Vec.pyx:1480"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_145restoreCUDAHandle(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_handle = 0; PyObject *__pyx_v_mode = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("restoreCUDAHandle (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_mode,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_n_s_rw)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_handle)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 1480, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mode); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 1480, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "restoreCUDAHandle") < 0)) __PYX_ERR(41, 1480, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_handle = values[0]; __pyx_v_mode = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("restoreCUDAHandle", 0, 1, 2, __pyx_nargs); __PYX_ERR(41, 1480, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.restoreCUDAHandle", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_144restoreCUDAHandle(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_handle, __pyx_v_mode); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_144restoreCUDAHandle(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_handle, PyObject *__pyx_v_mode) { PetscScalar *__pyx_v_hdl; char const *__pyx_v_m; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Py_uintptr_t __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PetscErrorCode __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("restoreCUDAHandle", 0); __Pyx_INCREF(__pyx_v_mode); /* "petsc4py/PETSc/Vec.pyx":1502 * * """ * cdef PetscScalar *hdl = (handle) # <<<<<<<<<<<<<< * cdef const char *m = NULL * if mode is not None: mode = str2bytes(mode, &m) */ __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_handle); if (unlikely((__pyx_t_1 == ((Py_uintptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(41, 1502, __pyx_L1_error) __pyx_v_hdl = ((PetscScalar *)((Py_uintptr_t)__pyx_t_1)); /* "petsc4py/PETSc/Vec.pyx":1503 * """ * cdef PetscScalar *hdl = (handle) * cdef const char *m = NULL # <<<<<<<<<<<<<< * if mode is not None: mode = str2bytes(mode, &m) * if m == NULL or (m[0] == c'r' and m[1] == c'w'): */ __pyx_v_m = NULL; /* "petsc4py/PETSc/Vec.pyx":1504 * cdef PetscScalar *hdl = (handle) * cdef const char *m = NULL * if mode is not None: mode = str2bytes(mode, &m) # <<<<<<<<<<<<<< * if m == NULL or (m[0] == c'r' and m[1] == c'w'): * CHKERR( VecCUDARestoreArray(self.vec, &hdl) ) */ __pyx_t_2 = (__pyx_v_mode != Py_None); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_mode, (&__pyx_v_m)); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 1504, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_mode, __pyx_t_3); __pyx_t_3 = 0; } /* "petsc4py/PETSc/Vec.pyx":1505 * cdef const char *m = NULL * if mode is not None: mode = str2bytes(mode, &m) * if m == NULL or (m[0] == c'r' and m[1] == c'w'): # <<<<<<<<<<<<<< * CHKERR( VecCUDARestoreArray(self.vec, &hdl) ) * elif m[0] == c'r': */ __pyx_t_4 = (__pyx_v_m == NULL); if (!__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L5_bool_binop_done; } __pyx_t_4 = ((__pyx_v_m[0]) == 'r'); if (__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L5_bool_binop_done; } __pyx_t_4 = ((__pyx_v_m[1]) == 'w'); __pyx_t_2 = __pyx_t_4; __pyx_L5_bool_binop_done:; if (__pyx_t_2) { /* "petsc4py/PETSc/Vec.pyx":1506 * if mode is not None: mode = str2bytes(mode, &m) * if m == NULL or (m[0] == c'r' and m[1] == c'w'): * CHKERR( VecCUDARestoreArray(self.vec, &hdl) ) # <<<<<<<<<<<<<< * elif m[0] == c'r': * CHKERR( VecCUDARestoreArrayRead(self.vec, &hdl) ) */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCUDARestoreArray(__pyx_v_self->vec, (&__pyx_v_hdl))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 1506, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":1505 * cdef const char *m = NULL * if mode is not None: mode = str2bytes(mode, &m) * if m == NULL or (m[0] == c'r' and m[1] == c'w'): # <<<<<<<<<<<<<< * CHKERR( VecCUDARestoreArray(self.vec, &hdl) ) * elif m[0] == c'r': */ goto __pyx_L4; } /* "petsc4py/PETSc/Vec.pyx":1507 * if m == NULL or (m[0] == c'r' and m[1] == c'w'): * CHKERR( VecCUDARestoreArray(self.vec, &hdl) ) * elif m[0] == c'r': # <<<<<<<<<<<<<< * CHKERR( VecCUDARestoreArrayRead(self.vec, &hdl) ) * elif m[0] == c'w': */ __pyx_t_2 = ((__pyx_v_m[0]) == 'r'); if (__pyx_t_2) { /* "petsc4py/PETSc/Vec.pyx":1508 * CHKERR( VecCUDARestoreArray(self.vec, &hdl) ) * elif m[0] == c'r': * CHKERR( VecCUDARestoreArrayRead(self.vec, &hdl) ) # <<<<<<<<<<<<<< * elif m[0] == c'w': * CHKERR( VecCUDARestoreArrayWrite(self.vec, &hdl) ) */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCUDARestoreArrayRead(__pyx_v_self->vec, ((PetscScalar const **)(&__pyx_v_hdl)))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 1508, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":1507 * if m == NULL or (m[0] == c'r' and m[1] == c'w'): * CHKERR( VecCUDARestoreArray(self.vec, &hdl) ) * elif m[0] == c'r': # <<<<<<<<<<<<<< * CHKERR( VecCUDARestoreArrayRead(self.vec, &hdl) ) * elif m[0] == c'w': */ goto __pyx_L4; } /* "petsc4py/PETSc/Vec.pyx":1509 * elif m[0] == c'r': * CHKERR( VecCUDARestoreArrayRead(self.vec, &hdl) ) * elif m[0] == c'w': # <<<<<<<<<<<<<< * CHKERR( VecCUDARestoreArrayWrite(self.vec, &hdl) ) * else: */ __pyx_t_2 = ((__pyx_v_m[0]) == 'w'); if (likely(__pyx_t_2)) { /* "petsc4py/PETSc/Vec.pyx":1510 * CHKERR( VecCUDARestoreArrayRead(self.vec, &hdl) ) * elif m[0] == c'w': * CHKERR( VecCUDARestoreArrayWrite(self.vec, &hdl) ) # <<<<<<<<<<<<<< * else: * raise ValueError("Invalid mode: expected 'rw', 'r', or 'w'") */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCUDARestoreArrayWrite(__pyx_v_self->vec, (&__pyx_v_hdl))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 1510, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":1509 * elif m[0] == c'r': * CHKERR( VecCUDARestoreArrayRead(self.vec, &hdl) ) * elif m[0] == c'w': # <<<<<<<<<<<<<< * CHKERR( VecCUDARestoreArrayWrite(self.vec, &hdl) ) * else: */ goto __pyx_L4; } /* "petsc4py/PETSc/Vec.pyx":1512 * CHKERR( VecCUDARestoreArrayWrite(self.vec, &hdl) ) * else: * raise ValueError("Invalid mode: expected 'rw', 'r', or 'w'") # <<<<<<<<<<<<<< * * def getHIPHandle( */ /*else*/ { __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 1512, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(41, 1512, __pyx_L1_error) } __pyx_L4:; /* "petsc4py/PETSc/Vec.pyx":1480 * return hdl * * def restoreCUDAHandle( # <<<<<<<<<<<<<< * self, * handle: Any, # FIXME What type hint is appropriate? */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Vec.restoreCUDAHandle", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_mode); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":1514 * raise ValueError("Invalid mode: expected 'rw', 'r', or 'w'") * * def getHIPHandle( # <<<<<<<<<<<<<< * self, * mode: AccessModeSpec = 'rw', */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_147getHIPHandle(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_146getHIPHandle, "Vec.getHIPHandle(self, mode: AccessModeSpec = 'rw') -> Any\nReturn a pointer to the device buffer.\n\n Not collective.\n\n The returned pointer should be released using `restoreHIPHandle`\n with the same access mode.\n\n Returns\n -------\n typing.Any\n HIP device pointer.\n\n Notes\n -----\n This method may incur a host-to-device copy if the device data is\n out of date and ``mode`` is ``\"r\"`` or ``\"rw\"``.\n\n See Also\n --------\n restoreHIPHandle, petsc.VecHIPGetArray, petsc.VecHIPGetArrayRead\n petsc.VecHIPGetArrayWrite\n\n \nSource code at petsc4py/PETSc/Vec.pyx:1514"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_147getHIPHandle(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_mode = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getHIPHandle (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mode,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_n_s_rw)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mode); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 1514, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getHIPHandle") < 0)) __PYX_ERR(41, 1514, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_mode = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getHIPHandle", 0, 0, 1, __pyx_nargs); __PYX_ERR(41, 1514, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.getHIPHandle", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_146getHIPHandle(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_mode); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_146getHIPHandle(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_mode) { PetscScalar *__pyx_v_hdl; char const *__pyx_v_m; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getHIPHandle", 0); __Pyx_INCREF(__pyx_v_mode); /* "petsc4py/PETSc/Vec.pyx":1541 * * """ * cdef PetscScalar *hdl = NULL # <<<<<<<<<<<<<< * cdef const char *m = NULL * if mode is not None: mode = str2bytes(mode, &m) */ __pyx_v_hdl = NULL; /* "petsc4py/PETSc/Vec.pyx":1542 * """ * cdef PetscScalar *hdl = NULL * cdef const char *m = NULL # <<<<<<<<<<<<<< * if mode is not None: mode = str2bytes(mode, &m) * if m == NULL or (m[0] == c'r' and m[1] == c'w'): */ __pyx_v_m = NULL; /* "petsc4py/PETSc/Vec.pyx":1543 * cdef PetscScalar *hdl = NULL * cdef const char *m = NULL * if mode is not None: mode = str2bytes(mode, &m) # <<<<<<<<<<<<<< * if m == NULL or (m[0] == c'r' and m[1] == c'w'): * CHKERR( VecHIPGetArray(self.vec, &hdl) ) */ __pyx_t_1 = (__pyx_v_mode != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_mode, (&__pyx_v_m)); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 1543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_mode, __pyx_t_2); __pyx_t_2 = 0; } /* "petsc4py/PETSc/Vec.pyx":1544 * cdef const char *m = NULL * if mode is not None: mode = str2bytes(mode, &m) * if m == NULL or (m[0] == c'r' and m[1] == c'w'): # <<<<<<<<<<<<<< * CHKERR( VecHIPGetArray(self.vec, &hdl) ) * elif m[0] == c'r': */ __pyx_t_3 = (__pyx_v_m == NULL); if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L5_bool_binop_done; } __pyx_t_3 = ((__pyx_v_m[0]) == 'r'); if (__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L5_bool_binop_done; } __pyx_t_3 = ((__pyx_v_m[1]) == 'w'); __pyx_t_1 = __pyx_t_3; __pyx_L5_bool_binop_done:; if (__pyx_t_1) { /* "petsc4py/PETSc/Vec.pyx":1545 * if mode is not None: mode = str2bytes(mode, &m) * if m == NULL or (m[0] == c'r' and m[1] == c'w'): * CHKERR( VecHIPGetArray(self.vec, &hdl) ) # <<<<<<<<<<<<<< * elif m[0] == c'r': * CHKERR( VecHIPGetArrayRead(self.vec, &hdl) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecHIPGetArray(__pyx_v_self->vec, (&__pyx_v_hdl))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 1545, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":1544 * cdef const char *m = NULL * if mode is not None: mode = str2bytes(mode, &m) * if m == NULL or (m[0] == c'r' and m[1] == c'w'): # <<<<<<<<<<<<<< * CHKERR( VecHIPGetArray(self.vec, &hdl) ) * elif m[0] == c'r': */ goto __pyx_L4; } /* "petsc4py/PETSc/Vec.pyx":1546 * if m == NULL or (m[0] == c'r' and m[1] == c'w'): * CHKERR( VecHIPGetArray(self.vec, &hdl) ) * elif m[0] == c'r': # <<<<<<<<<<<<<< * CHKERR( VecHIPGetArrayRead(self.vec, &hdl) ) * elif m[0] == c'w': */ __pyx_t_1 = ((__pyx_v_m[0]) == 'r'); if (__pyx_t_1) { /* "petsc4py/PETSc/Vec.pyx":1547 * CHKERR( VecHIPGetArray(self.vec, &hdl) ) * elif m[0] == c'r': * CHKERR( VecHIPGetArrayRead(self.vec, &hdl) ) # <<<<<<<<<<<<<< * elif m[0] == c'w': * CHKERR( VecHIPGetArrayWrite(self.vec, &hdl) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecHIPGetArrayRead(__pyx_v_self->vec, ((PetscScalar const **)(&__pyx_v_hdl)))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 1547, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":1546 * if m == NULL or (m[0] == c'r' and m[1] == c'w'): * CHKERR( VecHIPGetArray(self.vec, &hdl) ) * elif m[0] == c'r': # <<<<<<<<<<<<<< * CHKERR( VecHIPGetArrayRead(self.vec, &hdl) ) * elif m[0] == c'w': */ goto __pyx_L4; } /* "petsc4py/PETSc/Vec.pyx":1548 * elif m[0] == c'r': * CHKERR( VecHIPGetArrayRead(self.vec, &hdl) ) * elif m[0] == c'w': # <<<<<<<<<<<<<< * CHKERR( VecHIPGetArrayWrite(self.vec, &hdl) ) * else: */ __pyx_t_1 = ((__pyx_v_m[0]) == 'w'); if (likely(__pyx_t_1)) { /* "petsc4py/PETSc/Vec.pyx":1549 * CHKERR( VecHIPGetArrayRead(self.vec, &hdl) ) * elif m[0] == c'w': * CHKERR( VecHIPGetArrayWrite(self.vec, &hdl) ) # <<<<<<<<<<<<<< * else: * raise ValueError("Invalid mode: expected 'rw', 'r', or 'w'") */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecHIPGetArrayWrite(__pyx_v_self->vec, (&__pyx_v_hdl))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 1549, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":1548 * elif m[0] == c'r': * CHKERR( VecHIPGetArrayRead(self.vec, &hdl) ) * elif m[0] == c'w': # <<<<<<<<<<<<<< * CHKERR( VecHIPGetArrayWrite(self.vec, &hdl) ) * else: */ goto __pyx_L4; } /* "petsc4py/PETSc/Vec.pyx":1551 * CHKERR( VecHIPGetArrayWrite(self.vec, &hdl) ) * else: * raise ValueError("Invalid mode: expected 'rw', 'r', or 'w'") # <<<<<<<<<<<<<< * return hdl * */ /*else*/ { __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 1551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(41, 1551, __pyx_L1_error) } __pyx_L4:; /* "petsc4py/PETSc/Vec.pyx":1552 * else: * raise ValueError("Invalid mode: expected 'rw', 'r', or 'w'") * return hdl # <<<<<<<<<<<<<< * * def restoreHIPHandle( */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_FromSize_t(((Py_uintptr_t)__pyx_v_hdl)); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 1552, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":1514 * raise ValueError("Invalid mode: expected 'rw', 'r', or 'w'") * * def getHIPHandle( # <<<<<<<<<<<<<< * self, * mode: AccessModeSpec = 'rw', */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Vec.getHIPHandle", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_mode); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":1554 * return hdl * * def restoreHIPHandle( # <<<<<<<<<<<<<< * self, * handle: Any, # FIXME What type hint is appropriate? */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_149restoreHIPHandle(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_148restoreHIPHandle, "Vec.restoreHIPHandle(self, handle: Any, mode: AccessModeSpec = 'rw') -> None\nRestore a pointer to the device buffer obtained with `getHIPHandle`.\n\n Not collective.\n\n Parameters\n ----------\n handle\n HIP device pointer.\n mode\n Access mode.\n\n See Also\n --------\n getHIPHandle, petsc.VecHIPRestoreArray, petsc.VecHIPRestoreArrayRead\n petsc.VecHIPRestoreArrayWrite\n\n \nSource code at petsc4py/PETSc/Vec.pyx:1554"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_149restoreHIPHandle(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_handle = 0; PyObject *__pyx_v_mode = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("restoreHIPHandle (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_mode,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_n_s_rw)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_handle)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 1554, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mode); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 1554, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "restoreHIPHandle") < 0)) __PYX_ERR(41, 1554, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_handle = values[0]; __pyx_v_mode = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("restoreHIPHandle", 0, 1, 2, __pyx_nargs); __PYX_ERR(41, 1554, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.restoreHIPHandle", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_148restoreHIPHandle(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_handle, __pyx_v_mode); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_148restoreHIPHandle(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_handle, PyObject *__pyx_v_mode) { PetscScalar *__pyx_v_hdl; char const *__pyx_v_m; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Py_uintptr_t __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PetscErrorCode __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("restoreHIPHandle", 0); __Pyx_INCREF(__pyx_v_mode); /* "petsc4py/PETSc/Vec.pyx":1576 * * """ * cdef PetscScalar *hdl = (handle) # <<<<<<<<<<<<<< * cdef const char *m = NULL * if mode is not None: mode = str2bytes(mode, &m) */ __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_handle); if (unlikely((__pyx_t_1 == ((Py_uintptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(41, 1576, __pyx_L1_error) __pyx_v_hdl = ((PetscScalar *)((Py_uintptr_t)__pyx_t_1)); /* "petsc4py/PETSc/Vec.pyx":1577 * """ * cdef PetscScalar *hdl = (handle) * cdef const char *m = NULL # <<<<<<<<<<<<<< * if mode is not None: mode = str2bytes(mode, &m) * if m == NULL or (m[0] == c'r' and m[1] == c'w'): */ __pyx_v_m = NULL; /* "petsc4py/PETSc/Vec.pyx":1578 * cdef PetscScalar *hdl = (handle) * cdef const char *m = NULL * if mode is not None: mode = str2bytes(mode, &m) # <<<<<<<<<<<<<< * if m == NULL or (m[0] == c'r' and m[1] == c'w'): * CHKERR( VecHIPRestoreArray(self.vec, &hdl) ) */ __pyx_t_2 = (__pyx_v_mode != Py_None); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_mode, (&__pyx_v_m)); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 1578, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_mode, __pyx_t_3); __pyx_t_3 = 0; } /* "petsc4py/PETSc/Vec.pyx":1579 * cdef const char *m = NULL * if mode is not None: mode = str2bytes(mode, &m) * if m == NULL or (m[0] == c'r' and m[1] == c'w'): # <<<<<<<<<<<<<< * CHKERR( VecHIPRestoreArray(self.vec, &hdl) ) * elif m[0] == c'r': */ __pyx_t_4 = (__pyx_v_m == NULL); if (!__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L5_bool_binop_done; } __pyx_t_4 = ((__pyx_v_m[0]) == 'r'); if (__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L5_bool_binop_done; } __pyx_t_4 = ((__pyx_v_m[1]) == 'w'); __pyx_t_2 = __pyx_t_4; __pyx_L5_bool_binop_done:; if (__pyx_t_2) { /* "petsc4py/PETSc/Vec.pyx":1580 * if mode is not None: mode = str2bytes(mode, &m) * if m == NULL or (m[0] == c'r' and m[1] == c'w'): * CHKERR( VecHIPRestoreArray(self.vec, &hdl) ) # <<<<<<<<<<<<<< * elif m[0] == c'r': * CHKERR( VecHIPRestoreArrayRead(self.vec, &hdl) ) */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecHIPRestoreArray(__pyx_v_self->vec, (&__pyx_v_hdl))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 1580, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":1579 * cdef const char *m = NULL * if mode is not None: mode = str2bytes(mode, &m) * if m == NULL or (m[0] == c'r' and m[1] == c'w'): # <<<<<<<<<<<<<< * CHKERR( VecHIPRestoreArray(self.vec, &hdl) ) * elif m[0] == c'r': */ goto __pyx_L4; } /* "petsc4py/PETSc/Vec.pyx":1581 * if m == NULL or (m[0] == c'r' and m[1] == c'w'): * CHKERR( VecHIPRestoreArray(self.vec, &hdl) ) * elif m[0] == c'r': # <<<<<<<<<<<<<< * CHKERR( VecHIPRestoreArrayRead(self.vec, &hdl) ) * elif m[0] == c'w': */ __pyx_t_2 = ((__pyx_v_m[0]) == 'r'); if (__pyx_t_2) { /* "petsc4py/PETSc/Vec.pyx":1582 * CHKERR( VecHIPRestoreArray(self.vec, &hdl) ) * elif m[0] == c'r': * CHKERR( VecHIPRestoreArrayRead(self.vec, &hdl) ) # <<<<<<<<<<<<<< * elif m[0] == c'w': * CHKERR( VecHIPRestoreArrayWrite(self.vec, &hdl) ) */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecHIPRestoreArrayRead(__pyx_v_self->vec, ((PetscScalar const **)(&__pyx_v_hdl)))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 1582, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":1581 * if m == NULL or (m[0] == c'r' and m[1] == c'w'): * CHKERR( VecHIPRestoreArray(self.vec, &hdl) ) * elif m[0] == c'r': # <<<<<<<<<<<<<< * CHKERR( VecHIPRestoreArrayRead(self.vec, &hdl) ) * elif m[0] == c'w': */ goto __pyx_L4; } /* "petsc4py/PETSc/Vec.pyx":1583 * elif m[0] == c'r': * CHKERR( VecHIPRestoreArrayRead(self.vec, &hdl) ) * elif m[0] == c'w': # <<<<<<<<<<<<<< * CHKERR( VecHIPRestoreArrayWrite(self.vec, &hdl) ) * else: */ __pyx_t_2 = ((__pyx_v_m[0]) == 'w'); if (likely(__pyx_t_2)) { /* "petsc4py/PETSc/Vec.pyx":1584 * CHKERR( VecHIPRestoreArrayRead(self.vec, &hdl) ) * elif m[0] == c'w': * CHKERR( VecHIPRestoreArrayWrite(self.vec, &hdl) ) # <<<<<<<<<<<<<< * else: * raise ValueError("Invalid mode: expected 'rw', 'r', or 'w'") */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecHIPRestoreArrayWrite(__pyx_v_self->vec, (&__pyx_v_hdl))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 1584, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":1583 * elif m[0] == c'r': * CHKERR( VecHIPRestoreArrayRead(self.vec, &hdl) ) * elif m[0] == c'w': # <<<<<<<<<<<<<< * CHKERR( VecHIPRestoreArrayWrite(self.vec, &hdl) ) * else: */ goto __pyx_L4; } /* "petsc4py/PETSc/Vec.pyx":1586 * CHKERR( VecHIPRestoreArrayWrite(self.vec, &hdl) ) * else: * raise ValueError("Invalid mode: expected 'rw', 'r', or 'w'") # <<<<<<<<<<<<<< * * def getOffloadMask(self) -> int: */ /*else*/ { __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 1586, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(41, 1586, __pyx_L1_error) } __pyx_L4:; /* "petsc4py/PETSc/Vec.pyx":1554 * return hdl * * def restoreHIPHandle( # <<<<<<<<<<<<<< * self, * handle: Any, # FIXME What type hint is appropriate? */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Vec.restoreHIPHandle", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_mode); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":1588 * raise ValueError("Invalid mode: expected 'rw', 'r', or 'w'") * * def getOffloadMask(self) -> int: # <<<<<<<<<<<<<< * """Return the offloading status of the vector. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_151getOffloadMask(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_150getOffloadMask, "Vec.getOffloadMask(self) -> int\nReturn the offloading status of the vector.\n\n Not collective.\n\n Common return values include:\n\n - 1: ``PETSC_OFFLOAD_CPU`` - CPU has valid entries\n - 2: ``PETSC_OFFLOAD_GPU`` - GPU has valid entries\n - 3: ``PETSC_OFFLOAD_BOTH`` - CPU and GPU are in sync\n\n Returns\n -------\n int\n Enum value from `petsc.PetscOffloadMask` describing the offloading\n status.\n\n See Also\n --------\n petsc.VecGetOffloadMask, petsc.PetscOffloadMask\n\n \nSource code at petsc4py/PETSc/Vec.pyx:1588"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_151getOffloadMask(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getOffloadMask (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getOffloadMask", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getOffloadMask", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_150getOffloadMask(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_150getOffloadMask(struct PyPetscVecObject *__pyx_v_self) { PetscOffloadMask __pyx_v_mask; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getOffloadMask", 1); /* "petsc4py/PETSc/Vec.pyx":1611 * """ * cdef PetscOffloadMask mask * CHKERR( VecGetOffloadMask(self.vec, &mask) ) # <<<<<<<<<<<<<< * return mask * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetOffloadMask(__pyx_v_self->vec, (&__pyx_v_mask))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 1611, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":1612 * cdef PetscOffloadMask mask * CHKERR( VecGetOffloadMask(self.vec, &mask) ) * return mask # <<<<<<<<<<<<<< * * def getCLContextHandle(self) -> int: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_PetscOffloadMask(__pyx_v_mask); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 1612, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":1588 * raise ValueError("Invalid mode: expected 'rw', 'r', or 'w'") * * def getOffloadMask(self) -> int: # <<<<<<<<<<<<<< * """Return the offloading status of the vector. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Vec.getOffloadMask", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":1614 * return mask * * def getCLContextHandle(self) -> int: # <<<<<<<<<<<<<< * """Return the OpenCL context associated with the vector. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_153getCLContextHandle(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_152getCLContextHandle, "Vec.getCLContextHandle(self) -> int\nReturn the OpenCL context associated with the vector.\n\n Not collective.\n\n Returns\n -------\n int\n Pointer to underlying CL context. This can be used with\n `pyopencl` through `pyopencl.Context.from_int_ptr`.\n\n See Also\n --------\n getCLQueueHandle, petsc.VecViennaCLGetCLContext\n\n \nSource code at petsc4py/PETSc/Vec.pyx:1614"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_153getCLContextHandle(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getCLContextHandle (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getCLContextHandle", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getCLContextHandle", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_152getCLContextHandle(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_152getCLContextHandle(struct PyPetscVecObject *__pyx_v_self) { Py_uintptr_t __pyx_v_ctxhdl; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getCLContextHandle", 1); /* "petsc4py/PETSc/Vec.pyx":1630 * * """ * cdef Py_uintptr_t ctxhdl = 0 # <<<<<<<<<<<<<< * CHKERR( VecViennaCLGetCLContext(self.vec, &ctxhdl) ) * return ctxhdl */ __pyx_v_ctxhdl = 0; /* "petsc4py/PETSc/Vec.pyx":1631 * """ * cdef Py_uintptr_t ctxhdl = 0 * CHKERR( VecViennaCLGetCLContext(self.vec, &ctxhdl) ) # <<<<<<<<<<<<<< * return ctxhdl * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecViennaCLGetCLContext(__pyx_v_self->vec, (&__pyx_v_ctxhdl))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 1631, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":1632 * cdef Py_uintptr_t ctxhdl = 0 * CHKERR( VecViennaCLGetCLContext(self.vec, &ctxhdl) ) * return ctxhdl # <<<<<<<<<<<<<< * * def getCLQueueHandle(self) -> int: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_ctxhdl); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 1632, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":1614 * return mask * * def getCLContextHandle(self) -> int: # <<<<<<<<<<<<<< * """Return the OpenCL context associated with the vector. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Vec.getCLContextHandle", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":1634 * return ctxhdl * * def getCLQueueHandle(self) -> int: # <<<<<<<<<<<<<< * """Return the OpenCL command queue associated with the vector. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_155getCLQueueHandle(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_154getCLQueueHandle, "Vec.getCLQueueHandle(self) -> int\nReturn the OpenCL command queue associated with the vector.\n\n Not collective.\n\n Returns\n -------\n int\n Pointer to underlying CL command queue. This can be used with\n `pyopencl` through `pyopencl.Context.from_int_ptr`.\n\n See Also\n --------\n getCLContextHandle, petsc.VecViennaCLGetCLQueue\n\n \nSource code at petsc4py/PETSc/Vec.pyx:1634"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_155getCLQueueHandle(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getCLQueueHandle (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getCLQueueHandle", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getCLQueueHandle", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_154getCLQueueHandle(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_154getCLQueueHandle(struct PyPetscVecObject *__pyx_v_self) { Py_uintptr_t __pyx_v_queuehdl; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getCLQueueHandle", 1); /* "petsc4py/PETSc/Vec.pyx":1650 * * """ * cdef Py_uintptr_t queuehdl = 0 # <<<<<<<<<<<<<< * CHKERR( VecViennaCLGetCLQueue(self.vec, &queuehdl) ) * return queuehdl */ __pyx_v_queuehdl = 0; /* "petsc4py/PETSc/Vec.pyx":1651 * """ * cdef Py_uintptr_t queuehdl = 0 * CHKERR( VecViennaCLGetCLQueue(self.vec, &queuehdl) ) # <<<<<<<<<<<<<< * return queuehdl * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecViennaCLGetCLQueue(__pyx_v_self->vec, (&__pyx_v_queuehdl))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 1651, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":1652 * cdef Py_uintptr_t queuehdl = 0 * CHKERR( VecViennaCLGetCLQueue(self.vec, &queuehdl) ) * return queuehdl # <<<<<<<<<<<<<< * * def getCLMemHandle( */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_queuehdl); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 1652, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":1634 * return ctxhdl * * def getCLQueueHandle(self) -> int: # <<<<<<<<<<<<<< * """Return the OpenCL command queue associated with the vector. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Vec.getCLQueueHandle", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":1654 * return queuehdl * * def getCLMemHandle( # <<<<<<<<<<<<<< * self, * mode: AccessModeSpec = 'rw', */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_157getCLMemHandle(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_156getCLMemHandle, "Vec.getCLMemHandle(self, mode: AccessModeSpec = 'rw') -> int\nReturn the OpenCL buffer associated with the vector.\n\n Not collective.\n\n Returns\n -------\n int\n Pointer to the device buffer. This can be used with\n `pyopencl` through `pyopencl.Context.from_int_ptr`.\n\n Notes\n -----\n This method may incur a host-to-device copy if the device data is\n out of date and ``mode`` is ``\"r\"`` or ``\"rw\"``.\n\n See Also\n --------\n restoreCLMemHandle, petsc.VecViennaCLGetCLMem\n petsc.VecViennaCLGetCLMemRead, petsc.VecViennaCLGetCLMemWrite\n\n \nSource code at petsc4py/PETSc/Vec.pyx:1654"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_157getCLMemHandle(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_mode = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getCLMemHandle (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mode,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_n_s_rw)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mode); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 1654, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getCLMemHandle") < 0)) __PYX_ERR(41, 1654, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_mode = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getCLMemHandle", 0, 0, 1, __pyx_nargs); __PYX_ERR(41, 1654, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.getCLMemHandle", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_156getCLMemHandle(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_mode); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_156getCLMemHandle(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_mode) { Py_uintptr_t __pyx_v_memhdl; char const *__pyx_v_m; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getCLMemHandle", 0); __Pyx_INCREF(__pyx_v_mode); /* "petsc4py/PETSc/Vec.pyx":1679 * * """ * cdef Py_uintptr_t memhdl = 0 # <<<<<<<<<<<<<< * cdef const char *m = NULL * mode = str2bytes(mode, &m) */ __pyx_v_memhdl = 0; /* "petsc4py/PETSc/Vec.pyx":1680 * """ * cdef Py_uintptr_t memhdl = 0 * cdef const char *m = NULL # <<<<<<<<<<<<<< * mode = str2bytes(mode, &m) * if m == NULL or (m[0] == c'r' and m[1] == c'w'): */ __pyx_v_m = NULL; /* "petsc4py/PETSc/Vec.pyx":1681 * cdef Py_uintptr_t memhdl = 0 * cdef const char *m = NULL * mode = str2bytes(mode, &m) # <<<<<<<<<<<<<< * if m == NULL or (m[0] == c'r' and m[1] == c'w'): * CHKERR( VecViennaCLGetCLMem(self.vec, &memhdl) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_mode, (&__pyx_v_m)); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 1681, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_mode, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Vec.pyx":1682 * cdef const char *m = NULL * mode = str2bytes(mode, &m) * if m == NULL or (m[0] == c'r' and m[1] == c'w'): # <<<<<<<<<<<<<< * CHKERR( VecViennaCLGetCLMem(self.vec, &memhdl) ) * elif m[0] == c'r': */ __pyx_t_3 = (__pyx_v_m == NULL); if (!__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = ((__pyx_v_m[0]) == 'r'); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = ((__pyx_v_m[1]) == 'w'); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { /* "petsc4py/PETSc/Vec.pyx":1683 * mode = str2bytes(mode, &m) * if m == NULL or (m[0] == c'r' and m[1] == c'w'): * CHKERR( VecViennaCLGetCLMem(self.vec, &memhdl) ) # <<<<<<<<<<<<<< * elif m[0] == c'r': * CHKERR( VecViennaCLGetCLMemRead(self.vec, &memhdl) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecViennaCLGetCLMem(__pyx_v_self->vec, (&__pyx_v_memhdl))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 1683, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":1682 * cdef const char *m = NULL * mode = str2bytes(mode, &m) * if m == NULL or (m[0] == c'r' and m[1] == c'w'): # <<<<<<<<<<<<<< * CHKERR( VecViennaCLGetCLMem(self.vec, &memhdl) ) * elif m[0] == c'r': */ goto __pyx_L3; } /* "petsc4py/PETSc/Vec.pyx":1684 * if m == NULL or (m[0] == c'r' and m[1] == c'w'): * CHKERR( VecViennaCLGetCLMem(self.vec, &memhdl) ) * elif m[0] == c'r': # <<<<<<<<<<<<<< * CHKERR( VecViennaCLGetCLMemRead(self.vec, &memhdl) ) * elif m[0] == c'w': */ __pyx_t_2 = ((__pyx_v_m[0]) == 'r'); if (__pyx_t_2) { /* "petsc4py/PETSc/Vec.pyx":1685 * CHKERR( VecViennaCLGetCLMem(self.vec, &memhdl) ) * elif m[0] == c'r': * CHKERR( VecViennaCLGetCLMemRead(self.vec, &memhdl) ) # <<<<<<<<<<<<<< * elif m[0] == c'w': * CHKERR( VecViennaCLGetCLMemWrite(self.vec, &memhdl) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecViennaCLGetCLMemRead(__pyx_v_self->vec, (&__pyx_v_memhdl))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 1685, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":1684 * if m == NULL or (m[0] == c'r' and m[1] == c'w'): * CHKERR( VecViennaCLGetCLMem(self.vec, &memhdl) ) * elif m[0] == c'r': # <<<<<<<<<<<<<< * CHKERR( VecViennaCLGetCLMemRead(self.vec, &memhdl) ) * elif m[0] == c'w': */ goto __pyx_L3; } /* "petsc4py/PETSc/Vec.pyx":1686 * elif m[0] == c'r': * CHKERR( VecViennaCLGetCLMemRead(self.vec, &memhdl) ) * elif m[0] == c'w': # <<<<<<<<<<<<<< * CHKERR( VecViennaCLGetCLMemWrite(self.vec, &memhdl) ) * else: */ __pyx_t_2 = ((__pyx_v_m[0]) == 'w'); if (likely(__pyx_t_2)) { /* "petsc4py/PETSc/Vec.pyx":1687 * CHKERR( VecViennaCLGetCLMemRead(self.vec, &memhdl) ) * elif m[0] == c'w': * CHKERR( VecViennaCLGetCLMemWrite(self.vec, &memhdl) ) # <<<<<<<<<<<<<< * else: * raise ValueError("Invalid mode: expected 'r', 'w' or 'rw'") */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecViennaCLGetCLMemWrite(__pyx_v_self->vec, (&__pyx_v_memhdl))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 1687, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":1686 * elif m[0] == c'r': * CHKERR( VecViennaCLGetCLMemRead(self.vec, &memhdl) ) * elif m[0] == c'w': # <<<<<<<<<<<<<< * CHKERR( VecViennaCLGetCLMemWrite(self.vec, &memhdl) ) * else: */ goto __pyx_L3; } /* "petsc4py/PETSc/Vec.pyx":1689 * CHKERR( VecViennaCLGetCLMemWrite(self.vec, &memhdl) ) * else: * raise ValueError("Invalid mode: expected 'r', 'w' or 'rw'") # <<<<<<<<<<<<<< * return memhdl * */ /*else*/ { __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 1689, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(41, 1689, __pyx_L1_error) } __pyx_L3:; /* "petsc4py/PETSc/Vec.pyx":1690 * else: * raise ValueError("Invalid mode: expected 'r', 'w' or 'rw'") * return memhdl # <<<<<<<<<<<<<< * * def restoreCLMemHandle(self) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_memhdl); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 1690, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":1654 * return queuehdl * * def getCLMemHandle( # <<<<<<<<<<<<<< * self, * mode: AccessModeSpec = 'rw', */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Vec.getCLMemHandle", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_mode); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":1692 * return memhdl * * def restoreCLMemHandle(self) -> None: # <<<<<<<<<<<<<< * """Restore a pointer to the OpenCL buffer obtained with `getCLMemHandle`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_159restoreCLMemHandle(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_158restoreCLMemHandle, "Vec.restoreCLMemHandle(self) -> None\nRestore a pointer to the OpenCL buffer obtained with `getCLMemHandle`.\n\n Not collective.\n\n See Also\n --------\n getCLMemHandle, petsc.VecViennaCLRestoreCLMemWrite\n\n \nSource code at petsc4py/PETSc/Vec.pyx:1692"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_159restoreCLMemHandle(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("restoreCLMemHandle (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("restoreCLMemHandle", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "restoreCLMemHandle", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_158restoreCLMemHandle(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_158restoreCLMemHandle(struct PyPetscVecObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("restoreCLMemHandle", 1); /* "petsc4py/PETSc/Vec.pyx":1702 * * """ * CHKERR( VecViennaCLRestoreCLMemWrite(self.vec) ) # <<<<<<<<<<<<<< * * def duplicate(self, array: Sequence[Scalar] | None = None) -> Vec: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecViennaCLRestoreCLMemWrite(__pyx_v_self->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 1702, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":1692 * return memhdl * * def restoreCLMemHandle(self) -> None: # <<<<<<<<<<<<<< * """Restore a pointer to the OpenCL buffer obtained with `getCLMemHandle`. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.restoreCLMemHandle", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":1704 * CHKERR( VecViennaCLRestoreCLMemWrite(self.vec) ) * * def duplicate(self, array: Sequence[Scalar] | None = None) -> Vec: # <<<<<<<<<<<<<< * """Create a new vector with the same type, optionally with data. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_161duplicate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_160duplicate, "Vec.duplicate(self, array: Sequence[Scalar] | None = None) -> Vec\nCreate a new vector with the same type, optionally with data.\n\n Collective.\n\n Parameters\n ----------\n array\n Optional values to store in the new vector.\n\n See Also\n --------\n copy, petsc.VecDuplicate\n\n \nSource code at petsc4py/PETSc/Vec.pyx:1704"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_161duplicate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_array = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("duplicate (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_array,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_array); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 1704, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "duplicate") < 0)) __PYX_ERR(41, 1704, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_array = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("duplicate", 0, 0, 1, __pyx_nargs); __PYX_ERR(41, 1704, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.duplicate", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_160duplicate(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_array); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_160duplicate(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_array) { struct PyPetscVecObject *__pyx_v_vec = 0; PyObject *__pyx_v_ctx0 = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PetscErrorCode __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("duplicate", 1); /* "petsc4py/PETSc/Vec.pyx":1719 * * """ * cdef Vec vec = type(self)() # <<<<<<<<<<<<<< * CHKERR( VecDuplicate(self.vec, &vec.vec) ) * # duplicate tensor context */ __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __pyx_t_2 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 1719, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(41, 1719, __pyx_L1_error) __pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Vec.pyx":1720 * """ * cdef Vec vec = type(self)() * CHKERR( VecDuplicate(self.vec, &vec.vec) ) # <<<<<<<<<<<<<< * # duplicate tensor context * cdef object ctx0 = self.get_attr('__dltensor_ctx__') */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecDuplicate(__pyx_v_self->vec, (&__pyx_v_vec->vec))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 1720, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":1722 * CHKERR( VecDuplicate(self.vec, &vec.vec) ) * # duplicate tensor context * cdef object ctx0 = self.get_attr('__dltensor_ctx__') # <<<<<<<<<<<<<< * if ctx0 is not None: * vec.set_attr('__dltensor_ctx__', ctx0) */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Vec *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__dltensor_ctx__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 1722, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ctx0 = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/Vec.pyx":1723 * # duplicate tensor context * cdef object ctx0 = self.get_attr('__dltensor_ctx__') * if ctx0 is not None: # <<<<<<<<<<<<<< * vec.set_attr('__dltensor_ctx__', ctx0) * if array is not None: */ __pyx_t_6 = (__pyx_v_ctx0 != Py_None); if (__pyx_t_6) { /* "petsc4py/PETSc/Vec.pyx":1724 * cdef object ctx0 = self.get_attr('__dltensor_ctx__') * if ctx0 is not None: * vec.set_attr('__dltensor_ctx__', ctx0) # <<<<<<<<<<<<<< * if array is not None: * vec_setarray(vec, array) */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Vec *)__pyx_v_vec->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_vec), ((char *)"__dltensor_ctx__"), __pyx_v_ctx0); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 1724, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Vec.pyx":1723 * # duplicate tensor context * cdef object ctx0 = self.get_attr('__dltensor_ctx__') * if ctx0 is not None: # <<<<<<<<<<<<<< * vec.set_attr('__dltensor_ctx__', ctx0) * if array is not None: */ } /* "petsc4py/PETSc/Vec.pyx":1725 * if ctx0 is not None: * vec.set_attr('__dltensor_ctx__', ctx0) * if array is not None: # <<<<<<<<<<<<<< * vec_setarray(vec, array) * return vec */ __pyx_t_6 = (__pyx_v_array != Py_None); if (__pyx_t_6) { /* "petsc4py/PETSc/Vec.pyx":1726 * vec.set_attr('__dltensor_ctx__', ctx0) * if array is not None: * vec_setarray(vec, array) # <<<<<<<<<<<<<< * return vec * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_vec_setarray(__pyx_v_vec, __pyx_v_array); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(41, 1726, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":1725 * if ctx0 is not None: * vec.set_attr('__dltensor_ctx__', ctx0) * if array is not None: # <<<<<<<<<<<<<< * vec_setarray(vec, array) * return vec */ } /* "petsc4py/PETSc/Vec.pyx":1727 * if array is not None: * vec_setarray(vec, array) * return vec # <<<<<<<<<<<<<< * * def copy(self, Vec result=None) -> Vec: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_vec); __pyx_r = ((PyObject *)__pyx_v_vec); goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":1704 * CHKERR( VecViennaCLRestoreCLMemWrite(self.vec) ) * * def duplicate(self, array: Sequence[Scalar] | None = None) -> Vec: # <<<<<<<<<<<<<< * """Create a new vector with the same type, optionally with data. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Vec.duplicate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_vec); __Pyx_XDECREF(__pyx_v_ctx0); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":1729 * return vec * * def copy(self, Vec result=None) -> Vec: # <<<<<<<<<<<<<< * """Return a copy of the vector. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_163copy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_162copy, "Vec.copy(self, result: Vec | None = None) -> Vec\nReturn a copy of the vector.\n\n Logically collective.\n\n This operation copies vector entries to the new vector.\n\n Parameters\n ----------\n result\n Target vector for the copy. If `None` then a new vector is\n created internally.\n\n See Also\n --------\n duplicate, petsc.VecCopy\n\n \nSource code at petsc4py/PETSc/Vec.pyx:1729"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_163copy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_result = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("copy (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_result,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscVecObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_result); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 1729, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "copy") < 0)) __PYX_ERR(41, 1729, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_result = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("copy", 0, 0, 1, __pyx_nargs); __PYX_ERR(41, 1729, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_result), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "result", 0))) __PYX_ERR(41, 1729, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_162copy(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_result); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_162copy(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_result) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PetscErrorCode __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("copy", 0); __Pyx_INCREF((PyObject *)__pyx_v_result); /* "petsc4py/PETSc/Vec.pyx":1747 * * """ * if result is None: # <<<<<<<<<<<<<< * result = type(self)() * if result.vec == NULL: */ __pyx_t_1 = (((PyObject *)__pyx_v_result) == Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/Vec.pyx":1748 * """ * if result is None: * result = type(self)() # <<<<<<<<<<<<<< * if result.vec == NULL: * CHKERR( VecDuplicate(self.vec, &result.vec) ) */ __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __pyx_t_3 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 1748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(41, 1748, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_result, ((struct PyPetscVecObject *)__pyx_t_2)); __pyx_t_2 = 0; /* "petsc4py/PETSc/Vec.pyx":1747 * * """ * if result is None: # <<<<<<<<<<<<<< * result = type(self)() * if result.vec == NULL: */ } /* "petsc4py/PETSc/Vec.pyx":1749 * if result is None: * result = type(self)() * if result.vec == NULL: # <<<<<<<<<<<<<< * CHKERR( VecDuplicate(self.vec, &result.vec) ) * CHKERR( VecCopy(self.vec, result.vec) ) */ __pyx_t_1 = (__pyx_v_result->vec == NULL); if (__pyx_t_1) { /* "petsc4py/PETSc/Vec.pyx":1750 * result = type(self)() * if result.vec == NULL: * CHKERR( VecDuplicate(self.vec, &result.vec) ) # <<<<<<<<<<<<<< * CHKERR( VecCopy(self.vec, result.vec) ) * return result */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecDuplicate(__pyx_v_self->vec, (&__pyx_v_result->vec))); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 1750, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":1749 * if result is None: * result = type(self)() * if result.vec == NULL: # <<<<<<<<<<<<<< * CHKERR( VecDuplicate(self.vec, &result.vec) ) * CHKERR( VecCopy(self.vec, result.vec) ) */ } /* "petsc4py/PETSc/Vec.pyx":1751 * if result.vec == NULL: * CHKERR( VecDuplicate(self.vec, &result.vec) ) * CHKERR( VecCopy(self.vec, result.vec) ) # <<<<<<<<<<<<<< * return result * */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCopy(__pyx_v_self->vec, __pyx_v_result->vec)); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 1751, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":1752 * CHKERR( VecDuplicate(self.vec, &result.vec) ) * CHKERR( VecCopy(self.vec, result.vec) ) * return result # <<<<<<<<<<<<<< * * def chop(self, tol: float) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_result); __pyx_r = ((PyObject *)__pyx_v_result); goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":1729 * return vec * * def copy(self, Vec result=None) -> Vec: # <<<<<<<<<<<<<< * """Return a copy of the vector. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.Vec.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":1754 * return result * * def chop(self, tol: float) -> None: # <<<<<<<<<<<<<< * """Set all vector entries less than some absolute tolerance to zero. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_165chop(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_164chop, "Vec.chop(self, tol: float) -> None\nSet all vector entries less than some absolute tolerance to zero.\n\n Collective.\n\n Parameters\n ----------\n tol\n The absolute tolerance below which entries are set to zero.\n\n See Also\n --------\n petsc.VecFilter\n\n \nSource code at petsc4py/PETSc/Vec.pyx:1754"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_165chop(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_tol = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("chop (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tol,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_tol)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 1754, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "chop") < 0)) __PYX_ERR(41, 1754, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_tol = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("chop", 1, 1, 1, __pyx_nargs); __PYX_ERR(41, 1754, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.chop", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_164chop(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_tol); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_164chop(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_tol) { PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("chop", 1); /* "petsc4py/PETSc/Vec.pyx":1769 * * """ * cdef PetscReal rval = asReal(tol) # <<<<<<<<<<<<<< * CHKERR( VecFilter(self.vec, rval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_tol); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(41, 1769, __pyx_L1_error) __pyx_v_rval = __pyx_t_1; /* "petsc4py/PETSc/Vec.pyx":1770 * """ * cdef PetscReal rval = asReal(tol) * CHKERR( VecFilter(self.vec, rval) ) # <<<<<<<<<<<<<< * * def load(self, Viewer viewer) -> Self: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecFilter(__pyx_v_self->vec, __pyx_v_rval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 1770, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":1754 * return result * * def chop(self, tol: float) -> None: # <<<<<<<<<<<<<< * """Set all vector entries less than some absolute tolerance to zero. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.chop", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":1772 * CHKERR( VecFilter(self.vec, rval) ) * * def load(self, Viewer viewer) -> Self: # <<<<<<<<<<<<<< * """Load a vector. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_167load(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_166load, "Vec.load(self, viewer: Viewer) -> Self\nLoad a vector.\n\n Collective.\n\n See Also\n --------\n view, petsc.VecLoad\n\n \nSource code at petsc4py/PETSc/Vec.pyx:1772"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_167load(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscViewerObject *__pyx_v_viewer = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("load (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_viewer)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 1772, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "load") < 0)) __PYX_ERR(41, 1772, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("load", 1, 1, 1, __pyx_nargs); __PYX_ERR(41, 1772, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.load", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 0, "viewer", 0))) __PYX_ERR(41, 1772, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_166load(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_viewer); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_166load(struct PyPetscVecObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer) { MPI_Comm __pyx_v_comm; PetscObject __pyx_v_obj; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("load", 1); /* "petsc4py/PETSc/Vec.pyx":1782 * * """ * cdef MPI_Comm comm = MPI_COMM_NULL # <<<<<<<<<<<<<< * cdef PetscObject obj = (viewer.vwr) * if self.vec == NULL: */ __pyx_v_comm = MPI_COMM_NULL; /* "petsc4py/PETSc/Vec.pyx":1783 * """ * cdef MPI_Comm comm = MPI_COMM_NULL * cdef PetscObject obj = (viewer.vwr) # <<<<<<<<<<<<<< * if self.vec == NULL: * CHKERR( PetscObjectGetComm(obj, &comm) ) */ __pyx_v_obj = ((PetscObject)__pyx_v_viewer->vwr); /* "petsc4py/PETSc/Vec.pyx":1784 * cdef MPI_Comm comm = MPI_COMM_NULL * cdef PetscObject obj = (viewer.vwr) * if self.vec == NULL: # <<<<<<<<<<<<<< * CHKERR( PetscObjectGetComm(obj, &comm) ) * CHKERR( VecCreate(comm, &self.vec) ) */ __pyx_t_1 = (__pyx_v_self->vec == NULL); if (__pyx_t_1) { /* "petsc4py/PETSc/Vec.pyx":1785 * cdef PetscObject obj = (viewer.vwr) * if self.vec == NULL: * CHKERR( PetscObjectGetComm(obj, &comm) ) # <<<<<<<<<<<<<< * CHKERR( VecCreate(comm, &self.vec) ) * CHKERR( VecLoad(self.vec, viewer.vwr) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectGetComm(__pyx_v_obj, (&__pyx_v_comm))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 1785, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":1786 * if self.vec == NULL: * CHKERR( PetscObjectGetComm(obj, &comm) ) * CHKERR( VecCreate(comm, &self.vec) ) # <<<<<<<<<<<<<< * CHKERR( VecLoad(self.vec, viewer.vwr) ) * return self */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCreate(__pyx_v_comm, (&__pyx_v_self->vec))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 1786, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":1784 * cdef MPI_Comm comm = MPI_COMM_NULL * cdef PetscObject obj = (viewer.vwr) * if self.vec == NULL: # <<<<<<<<<<<<<< * CHKERR( PetscObjectGetComm(obj, &comm) ) * CHKERR( VecCreate(comm, &self.vec) ) */ } /* "petsc4py/PETSc/Vec.pyx":1787 * CHKERR( PetscObjectGetComm(obj, &comm) ) * CHKERR( VecCreate(comm, &self.vec) ) * CHKERR( VecLoad(self.vec, viewer.vwr) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecLoad(__pyx_v_self->vec, __pyx_v_viewer->vwr)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 1787, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":1788 * CHKERR( VecCreate(comm, &self.vec) ) * CHKERR( VecLoad(self.vec, viewer.vwr) ) * return self # <<<<<<<<<<<<<< * * def equal(self, Vec vec) -> bool: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":1772 * CHKERR( VecFilter(self.vec, rval) ) * * def load(self, Viewer viewer) -> Self: # <<<<<<<<<<<<<< * """Load a vector. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.load", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":1790 * return self * * def equal(self, Vec vec) -> bool: # <<<<<<<<<<<<<< * """Return whether the vector is equal to another. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_169equal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_168equal, "Vec.equal(self, vec: Vec) -> bool\nReturn whether the vector is equal to another.\n\n Collective.\n\n Parameters\n ----------\n vec\n Vector to compare with.\n\n See Also\n --------\n petsc.VecEqual\n\n \nSource code at petsc4py/PETSc/Vec.pyx:1790"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_169equal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_vec = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("equal (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vec)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 1790, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "equal") < 0)) __PYX_ERR(41, 1790, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_vec = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("equal", 1, 1, 1, __pyx_nargs); __PYX_ERR(41, 1790, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.equal", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(41, 1790, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_168equal(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_vec); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_168equal(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec) { PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("equal", 1); /* "petsc4py/PETSc/Vec.pyx":1805 * * """ * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( VecEqual(self.vec, vec.vec, &flag) ) * return toBool(flag) */ __pyx_v_flag = PETSC_FALSE; /* "petsc4py/PETSc/Vec.pyx":1806 * """ * cdef PetscBool flag = PETSC_FALSE * CHKERR( VecEqual(self.vec, vec.vec, &flag) ) # <<<<<<<<<<<<<< * return toBool(flag) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecEqual(__pyx_v_self->vec, __pyx_v_vec->vec, (&__pyx_v_flag))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 1806, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":1807 * cdef PetscBool flag = PETSC_FALSE * CHKERR( VecEqual(self.vec, vec.vec, &flag) ) * return toBool(flag) # <<<<<<<<<<<<<< * * def dot(self, Vec vec) -> Scalar: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 1807, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":1790 * return self * * def equal(self, Vec vec) -> bool: # <<<<<<<<<<<<<< * """Return whether the vector is equal to another. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Vec.equal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":1809 * return toBool(flag) * * def dot(self, Vec vec) -> Scalar: # <<<<<<<<<<<<<< * """Return the dot product with ``vec``. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_171dot(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_170dot, "Vec.dot(self, vec: Vec) -> Scalar\nReturn the dot product with ``vec``.\n\n Collective.\n\n For complex numbers this computes y\341\264\264\302\267x with ``self`` as x, ``vec``\n as y and where y\341\264\264 denotes the conjugate transpose of y.\n\n Use `tDot` for the indefinite form y\341\265\200\302\267x where y\341\265\200 denotes the\n transpose of y.\n\n Parameters\n ----------\n vec\n Vector to compute the dot product with.\n\n See Also\n --------\n dotBegin, dotEnd, tDot, petsc.VecDot\n\n \nSource code at petsc4py/PETSc/Vec.pyx:1809"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_171dot(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_vec = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("dot (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vec)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 1809, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "dot") < 0)) __PYX_ERR(41, 1809, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_vec = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("dot", 1, 1, 1, __pyx_nargs); __PYX_ERR(41, 1809, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.dot", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(41, 1809, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_170dot(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_vec); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_170dot(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec) { PetscScalar __pyx_v_sval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("dot", 1); /* "petsc4py/PETSc/Vec.pyx":1830 * * """ * cdef PetscScalar sval = 0 # <<<<<<<<<<<<<< * CHKERR( VecDot(self.vec, vec.vec, &sval) ) * return toScalar(sval) */ __pyx_v_sval = 0.0; /* "petsc4py/PETSc/Vec.pyx":1831 * """ * cdef PetscScalar sval = 0 * CHKERR( VecDot(self.vec, vec.vec, &sval) ) # <<<<<<<<<<<<<< * return toScalar(sval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecDot(__pyx_v_self->vec, __pyx_v_vec->vec, (&__pyx_v_sval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 1831, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":1832 * cdef PetscScalar sval = 0 * CHKERR( VecDot(self.vec, vec.vec, &sval) ) * return toScalar(sval) # <<<<<<<<<<<<<< * * def dotBegin(self, Vec vec) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toScalar(__pyx_v_sval); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 1832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":1809 * return toBool(flag) * * def dot(self, Vec vec) -> Scalar: # <<<<<<<<<<<<<< * """Return the dot product with ``vec``. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Vec.dot", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":1834 * return toScalar(sval) * * def dotBegin(self, Vec vec) -> None: # <<<<<<<<<<<<<< * """Begin computing the dot product. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_173dotBegin(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_172dotBegin, "Vec.dotBegin(self, vec: Vec) -> None\nBegin computing the dot product.\n\n Collective.\n\n This should be paired with a call to `dotEnd`.\n\n Parameters\n ----------\n vec\n Vector to compute the dot product with.\n\n See Also\n --------\n dotEnd, dot, petsc.VecDotBegin\n\n \nSource code at petsc4py/PETSc/Vec.pyx:1834"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_173dotBegin(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_vec = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("dotBegin (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vec)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 1834, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "dotBegin") < 0)) __PYX_ERR(41, 1834, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_vec = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("dotBegin", 1, 1, 1, __pyx_nargs); __PYX_ERR(41, 1834, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.dotBegin", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(41, 1834, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_172dotBegin(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_vec); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_172dotBegin(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec) { PetscScalar __pyx_v_sval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("dotBegin", 1); /* "petsc4py/PETSc/Vec.pyx":1851 * * """ * cdef PetscScalar sval = 0 # <<<<<<<<<<<<<< * CHKERR( VecDotBegin(self.vec, vec.vec, &sval) ) * */ __pyx_v_sval = 0.0; /* "petsc4py/PETSc/Vec.pyx":1852 * """ * cdef PetscScalar sval = 0 * CHKERR( VecDotBegin(self.vec, vec.vec, &sval) ) # <<<<<<<<<<<<<< * * def dotEnd(self, Vec vec) -> Scalar: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecDotBegin(__pyx_v_self->vec, __pyx_v_vec->vec, (&__pyx_v_sval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 1852, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":1834 * return toScalar(sval) * * def dotBegin(self, Vec vec) -> None: # <<<<<<<<<<<<<< * """Begin computing the dot product. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.dotBegin", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":1854 * CHKERR( VecDotBegin(self.vec, vec.vec, &sval) ) * * def dotEnd(self, Vec vec) -> Scalar: # <<<<<<<<<<<<<< * """Finish computing the dot product initiated with `dotBegin`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_175dotEnd(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_174dotEnd, "Vec.dotEnd(self, vec: Vec) -> Scalar\nFinish computing the dot product initiated with `dotBegin`.\n\n Collective.\n\n See Also\n --------\n dotBegin, dot, petsc.VecDotEnd\n\n \nSource code at petsc4py/PETSc/Vec.pyx:1854"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_175dotEnd(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_vec = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("dotEnd (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vec)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 1854, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "dotEnd") < 0)) __PYX_ERR(41, 1854, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_vec = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("dotEnd", 1, 1, 1, __pyx_nargs); __PYX_ERR(41, 1854, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.dotEnd", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(41, 1854, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_174dotEnd(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_vec); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_174dotEnd(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec) { PetscScalar __pyx_v_sval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("dotEnd", 1); /* "petsc4py/PETSc/Vec.pyx":1864 * * """ * cdef PetscScalar sval = 0 # <<<<<<<<<<<<<< * CHKERR( VecDotEnd(self.vec, vec.vec, &sval) ) * return toScalar(sval) */ __pyx_v_sval = 0.0; /* "petsc4py/PETSc/Vec.pyx":1865 * """ * cdef PetscScalar sval = 0 * CHKERR( VecDotEnd(self.vec, vec.vec, &sval) ) # <<<<<<<<<<<<<< * return toScalar(sval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecDotEnd(__pyx_v_self->vec, __pyx_v_vec->vec, (&__pyx_v_sval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 1865, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":1866 * cdef PetscScalar sval = 0 * CHKERR( VecDotEnd(self.vec, vec.vec, &sval) ) * return toScalar(sval) # <<<<<<<<<<<<<< * * def tDot(self, Vec vec) -> Scalar: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toScalar(__pyx_v_sval); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 1866, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":1854 * CHKERR( VecDotBegin(self.vec, vec.vec, &sval) ) * * def dotEnd(self, Vec vec) -> Scalar: # <<<<<<<<<<<<<< * """Finish computing the dot product initiated with `dotBegin`. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Vec.dotEnd", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":1868 * return toScalar(sval) * * def tDot(self, Vec vec) -> Scalar: # <<<<<<<<<<<<<< * """Return the indefinite dot product with ``vec``. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_177tDot(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_176tDot, "Vec.tDot(self, vec: Vec) -> Scalar\nReturn the indefinite dot product with ``vec``.\n\n Collective.\n\n This computes y\341\265\200\302\267x with ``self`` as x, ``vec``\n as y and where y\341\265\200 denotes the transpose of y.\n\n Parameters\n ----------\n vec\n Vector to compute the indefinite dot product with.\n\n See Also\n --------\n tDotBegin, tDotEnd, dot, petsc.VecTDot\n\n \nSource code at petsc4py/PETSc/Vec.pyx:1868"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_177tDot(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_vec = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("tDot (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vec)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 1868, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "tDot") < 0)) __PYX_ERR(41, 1868, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_vec = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("tDot", 1, 1, 1, __pyx_nargs); __PYX_ERR(41, 1868, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.tDot", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(41, 1868, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_176tDot(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_vec); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_176tDot(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec) { PetscScalar __pyx_v_sval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("tDot", 1); /* "petsc4py/PETSc/Vec.pyx":1886 * * """ * cdef PetscScalar sval = 0 # <<<<<<<<<<<<<< * CHKERR( VecTDot(self.vec, vec.vec, &sval) ) * return toScalar(sval) */ __pyx_v_sval = 0.0; /* "petsc4py/PETSc/Vec.pyx":1887 * """ * cdef PetscScalar sval = 0 * CHKERR( VecTDot(self.vec, vec.vec, &sval) ) # <<<<<<<<<<<<<< * return toScalar(sval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecTDot(__pyx_v_self->vec, __pyx_v_vec->vec, (&__pyx_v_sval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 1887, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":1888 * cdef PetscScalar sval = 0 * CHKERR( VecTDot(self.vec, vec.vec, &sval) ) * return toScalar(sval) # <<<<<<<<<<<<<< * * def tDotBegin(self, Vec vec) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toScalar(__pyx_v_sval); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 1888, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":1868 * return toScalar(sval) * * def tDot(self, Vec vec) -> Scalar: # <<<<<<<<<<<<<< * """Return the indefinite dot product with ``vec``. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Vec.tDot", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":1890 * return toScalar(sval) * * def tDotBegin(self, Vec vec) -> None: # <<<<<<<<<<<<<< * """Begin computing the indefinite dot product. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_179tDotBegin(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_178tDotBegin, "Vec.tDotBegin(self, vec: Vec) -> None\nBegin computing the indefinite dot product.\n\n Collective.\n\n This should be paired with a call to `tDotEnd`.\n\n Parameters\n ----------\n vec\n Vector to compute the indefinite dot product with.\n\n See Also\n --------\n tDotEnd, tDot, petsc.VecTDotBegin\n\n \nSource code at petsc4py/PETSc/Vec.pyx:1890"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_179tDotBegin(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_vec = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("tDotBegin (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vec)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 1890, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "tDotBegin") < 0)) __PYX_ERR(41, 1890, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_vec = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("tDotBegin", 1, 1, 1, __pyx_nargs); __PYX_ERR(41, 1890, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.tDotBegin", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(41, 1890, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_178tDotBegin(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_vec); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_178tDotBegin(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec) { PetscScalar __pyx_v_sval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("tDotBegin", 1); /* "petsc4py/PETSc/Vec.pyx":1907 * * """ * cdef PetscScalar sval = 0 # <<<<<<<<<<<<<< * CHKERR( VecTDotBegin(self.vec, vec.vec, &sval) ) * */ __pyx_v_sval = 0.0; /* "petsc4py/PETSc/Vec.pyx":1908 * """ * cdef PetscScalar sval = 0 * CHKERR( VecTDotBegin(self.vec, vec.vec, &sval) ) # <<<<<<<<<<<<<< * * def tDotEnd(self, Vec vec) -> Scalar: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecTDotBegin(__pyx_v_self->vec, __pyx_v_vec->vec, (&__pyx_v_sval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 1908, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":1890 * return toScalar(sval) * * def tDotBegin(self, Vec vec) -> None: # <<<<<<<<<<<<<< * """Begin computing the indefinite dot product. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.tDotBegin", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":1910 * CHKERR( VecTDotBegin(self.vec, vec.vec, &sval) ) * * def tDotEnd(self, Vec vec) -> Scalar: # <<<<<<<<<<<<<< * """Finish computing the indefinite dot product initiated with `tDotBegin`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_181tDotEnd(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_180tDotEnd, "Vec.tDotEnd(self, vec: Vec) -> Scalar\nFinish computing the indefinite dot product initiated with `tDotBegin`.\n\n Collective.\n\n See Also\n --------\n tDotBegin, tDot, petsc.VecTDotEnd\n\n \nSource code at petsc4py/PETSc/Vec.pyx:1910"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_181tDotEnd(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_vec = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("tDotEnd (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vec)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 1910, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "tDotEnd") < 0)) __PYX_ERR(41, 1910, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_vec = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("tDotEnd", 1, 1, 1, __pyx_nargs); __PYX_ERR(41, 1910, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.tDotEnd", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(41, 1910, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_180tDotEnd(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_vec); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_180tDotEnd(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec) { PetscScalar __pyx_v_sval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("tDotEnd", 1); /* "petsc4py/PETSc/Vec.pyx":1920 * * """ * cdef PetscScalar sval = 0 # <<<<<<<<<<<<<< * CHKERR( VecTDotEnd(self.vec, vec.vec, &sval) ) * return toScalar(sval) */ __pyx_v_sval = 0.0; /* "petsc4py/PETSc/Vec.pyx":1921 * """ * cdef PetscScalar sval = 0 * CHKERR( VecTDotEnd(self.vec, vec.vec, &sval) ) # <<<<<<<<<<<<<< * return toScalar(sval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecTDotEnd(__pyx_v_self->vec, __pyx_v_vec->vec, (&__pyx_v_sval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 1921, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":1922 * cdef PetscScalar sval = 0 * CHKERR( VecTDotEnd(self.vec, vec.vec, &sval) ) * return toScalar(sval) # <<<<<<<<<<<<<< * * def mDot(self, vecs, out=None) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toScalar(__pyx_v_sval); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 1922, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":1910 * CHKERR( VecTDotBegin(self.vec, vec.vec, &sval) ) * * def tDotEnd(self, Vec vec) -> Scalar: # <<<<<<<<<<<<<< * """Finish computing the indefinite dot product initiated with `tDotBegin`. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Vec.tDotEnd", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":1924 * return toScalar(sval) * * def mDot(self, vecs, out=None) -> None: # <<<<<<<<<<<<<< * """Not implemented.""" * raise NotImplementedError */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_183mDot(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_182mDot, "Vec.mDot(self, vecs, out=None) -> None\nNot implemented.\nSource code at petsc4py/PETSc/Vec.pyx:1924"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_183mDot(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v_vecs = 0; CYTHON_UNUSED PyObject *__pyx_v_out = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("mDot (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vecs,&__pyx_n_s_out,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vecs)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 1924, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_out); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 1924, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mDot") < 0)) __PYX_ERR(41, 1924, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_vecs = values[0]; __pyx_v_out = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("mDot", 0, 1, 2, __pyx_nargs); __PYX_ERR(41, 1924, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.mDot", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_182mDot(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_vecs, __pyx_v_out); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_182mDot(CYTHON_UNUSED struct PyPetscVecObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_vecs, CYTHON_UNUSED PyObject *__pyx_v_out) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mDot", 1); /* "petsc4py/PETSc/Vec.pyx":1926 * def mDot(self, vecs, out=None) -> None: * """Not implemented.""" * raise NotImplementedError # <<<<<<<<<<<<<< * * def mDotBegin(self, vecs, out=None) -> None: */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); __PYX_ERR(41, 1926, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":1924 * return toScalar(sval) * * def mDot(self, vecs, out=None) -> None: # <<<<<<<<<<<<<< * """Not implemented.""" * raise NotImplementedError */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.mDot", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":1928 * raise NotImplementedError * * def mDotBegin(self, vecs, out=None) -> None: # <<<<<<<<<<<<<< * """Not implemented.""" * raise NotImplementedError */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_185mDotBegin(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_184mDotBegin, "Vec.mDotBegin(self, vecs, out=None) -> None\nNot implemented.\nSource code at petsc4py/PETSc/Vec.pyx:1928"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_185mDotBegin(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v_vecs = 0; CYTHON_UNUSED PyObject *__pyx_v_out = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("mDotBegin (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vecs,&__pyx_n_s_out,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vecs)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 1928, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_out); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 1928, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mDotBegin") < 0)) __PYX_ERR(41, 1928, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_vecs = values[0]; __pyx_v_out = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("mDotBegin", 0, 1, 2, __pyx_nargs); __PYX_ERR(41, 1928, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.mDotBegin", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_184mDotBegin(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_vecs, __pyx_v_out); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_184mDotBegin(CYTHON_UNUSED struct PyPetscVecObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_vecs, CYTHON_UNUSED PyObject *__pyx_v_out) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mDotBegin", 1); /* "petsc4py/PETSc/Vec.pyx":1930 * def mDotBegin(self, vecs, out=None) -> None: * """Not implemented.""" * raise NotImplementedError # <<<<<<<<<<<<<< * * def mDotEnd(self, vecs, out=None) -> None: */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); __PYX_ERR(41, 1930, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":1928 * raise NotImplementedError * * def mDotBegin(self, vecs, out=None) -> None: # <<<<<<<<<<<<<< * """Not implemented.""" * raise NotImplementedError */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.mDotBegin", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":1932 * raise NotImplementedError * * def mDotEnd(self, vecs, out=None) -> None: # <<<<<<<<<<<<<< * """Not implemented.""" * raise NotImplementedError */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_187mDotEnd(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_186mDotEnd, "Vec.mDotEnd(self, vecs, out=None) -> None\nNot implemented.\nSource code at petsc4py/PETSc/Vec.pyx:1932"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_187mDotEnd(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v_vecs = 0; CYTHON_UNUSED PyObject *__pyx_v_out = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("mDotEnd (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vecs,&__pyx_n_s_out,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vecs)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 1932, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_out); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 1932, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mDotEnd") < 0)) __PYX_ERR(41, 1932, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_vecs = values[0]; __pyx_v_out = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("mDotEnd", 0, 1, 2, __pyx_nargs); __PYX_ERR(41, 1932, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.mDotEnd", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_186mDotEnd(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_vecs, __pyx_v_out); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_186mDotEnd(CYTHON_UNUSED struct PyPetscVecObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_vecs, CYTHON_UNUSED PyObject *__pyx_v_out) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mDotEnd", 1); /* "petsc4py/PETSc/Vec.pyx":1934 * def mDotEnd(self, vecs, out=None) -> None: * """Not implemented.""" * raise NotImplementedError # <<<<<<<<<<<<<< * * def mtDot(self, vecs, out=None) -> None: */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); __PYX_ERR(41, 1934, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":1932 * raise NotImplementedError * * def mDotEnd(self, vecs, out=None) -> None: # <<<<<<<<<<<<<< * """Not implemented.""" * raise NotImplementedError */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.mDotEnd", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":1936 * raise NotImplementedError * * def mtDot(self, vecs, out=None) -> None: # <<<<<<<<<<<<<< * """Not implemented.""" * raise NotImplementedError */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_189mtDot(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_188mtDot, "Vec.mtDot(self, vecs, out=None) -> None\nNot implemented.\nSource code at petsc4py/PETSc/Vec.pyx:1936"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_189mtDot(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v_vecs = 0; CYTHON_UNUSED PyObject *__pyx_v_out = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("mtDot (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vecs,&__pyx_n_s_out,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vecs)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 1936, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_out); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 1936, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mtDot") < 0)) __PYX_ERR(41, 1936, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_vecs = values[0]; __pyx_v_out = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("mtDot", 0, 1, 2, __pyx_nargs); __PYX_ERR(41, 1936, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.mtDot", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_188mtDot(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_vecs, __pyx_v_out); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_188mtDot(CYTHON_UNUSED struct PyPetscVecObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_vecs, CYTHON_UNUSED PyObject *__pyx_v_out) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mtDot", 1); /* "petsc4py/PETSc/Vec.pyx":1938 * def mtDot(self, vecs, out=None) -> None: * """Not implemented.""" * raise NotImplementedError # <<<<<<<<<<<<<< * * def mtDotBegin(self, vecs, out=None) -> None: */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); __PYX_ERR(41, 1938, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":1936 * raise NotImplementedError * * def mtDot(self, vecs, out=None) -> None: # <<<<<<<<<<<<<< * """Not implemented.""" * raise NotImplementedError */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.mtDot", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":1940 * raise NotImplementedError * * def mtDotBegin(self, vecs, out=None) -> None: # <<<<<<<<<<<<<< * """Not implemented.""" * raise NotImplementedError */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_191mtDotBegin(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_190mtDotBegin, "Vec.mtDotBegin(self, vecs, out=None) -> None\nNot implemented.\nSource code at petsc4py/PETSc/Vec.pyx:1940"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_191mtDotBegin(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v_vecs = 0; CYTHON_UNUSED PyObject *__pyx_v_out = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("mtDotBegin (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vecs,&__pyx_n_s_out,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vecs)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 1940, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_out); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 1940, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mtDotBegin") < 0)) __PYX_ERR(41, 1940, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_vecs = values[0]; __pyx_v_out = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("mtDotBegin", 0, 1, 2, __pyx_nargs); __PYX_ERR(41, 1940, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.mtDotBegin", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_190mtDotBegin(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_vecs, __pyx_v_out); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_190mtDotBegin(CYTHON_UNUSED struct PyPetscVecObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_vecs, CYTHON_UNUSED PyObject *__pyx_v_out) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mtDotBegin", 1); /* "petsc4py/PETSc/Vec.pyx":1942 * def mtDotBegin(self, vecs, out=None) -> None: * """Not implemented.""" * raise NotImplementedError # <<<<<<<<<<<<<< * * def mtDotEnd(self, vecs, out=None) -> None: */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); __PYX_ERR(41, 1942, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":1940 * raise NotImplementedError * * def mtDotBegin(self, vecs, out=None) -> None: # <<<<<<<<<<<<<< * """Not implemented.""" * raise NotImplementedError */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.mtDotBegin", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":1944 * raise NotImplementedError * * def mtDotEnd(self, vecs, out=None) -> None: # <<<<<<<<<<<<<< * """Not implemented.""" * raise NotImplementedError */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_193mtDotEnd(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_192mtDotEnd, "Vec.mtDotEnd(self, vecs, out=None) -> None\nNot implemented.\nSource code at petsc4py/PETSc/Vec.pyx:1944"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_193mtDotEnd(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v_vecs = 0; CYTHON_UNUSED PyObject *__pyx_v_out = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("mtDotEnd (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vecs,&__pyx_n_s_out,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vecs)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 1944, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_out); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 1944, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mtDotEnd") < 0)) __PYX_ERR(41, 1944, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_vecs = values[0]; __pyx_v_out = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("mtDotEnd", 0, 1, 2, __pyx_nargs); __PYX_ERR(41, 1944, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.mtDotEnd", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_192mtDotEnd(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_vecs, __pyx_v_out); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_192mtDotEnd(CYTHON_UNUSED struct PyPetscVecObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_vecs, CYTHON_UNUSED PyObject *__pyx_v_out) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mtDotEnd", 1); /* "petsc4py/PETSc/Vec.pyx":1946 * def mtDotEnd(self, vecs, out=None) -> None: * """Not implemented.""" * raise NotImplementedError # <<<<<<<<<<<<<< * * def norm( */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); __PYX_ERR(41, 1946, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":1944 * raise NotImplementedError * * def mtDotEnd(self, vecs, out=None) -> None: # <<<<<<<<<<<<<< * """Not implemented.""" * raise NotImplementedError */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.mtDotEnd", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":1948 * raise NotImplementedError * * def norm( # <<<<<<<<<<<<<< * self, * norm_type: NormTypeSpec = None, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_195norm(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_194norm, "Vec.norm(self, norm_type: NormTypeSpec = None) -> float | tuple[float, float]\nCompute the vector norm.\n\n Collective.\n\n A 2-tuple is returned if `NormType.NORM_1_AND_2` is specified.\n\n See Also\n --------\n petsc.VecNorm, petsc.NormType\n\n \nSource code at petsc4py/PETSc/Vec.pyx:1948"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_195norm(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_norm_type = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("norm (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_norm_type,0}; /* "petsc4py/PETSc/Vec.pyx":1950 * def norm( * self, * norm_type: NormTypeSpec = None, # <<<<<<<<<<<<<< * ) -> float | tuple[float, float]: * """Compute the vector norm. */ values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_norm_type); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 1948, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "norm") < 0)) __PYX_ERR(41, 1948, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_norm_type = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("norm", 0, 0, 1, __pyx_nargs); __PYX_ERR(41, 1948, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.norm", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_194norm(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_norm_type); /* "petsc4py/PETSc/Vec.pyx":1948 * raise NotImplementedError * * def norm( # <<<<<<<<<<<<<< * self, * norm_type: NormTypeSpec = None, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_194norm(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_norm_type) { NormType __pyx_v_norm_1_2; NormType __pyx_v_ntype; PetscReal __pyx_v_rval[2]; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; NormType __pyx_t_2; PetscErrorCode __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("norm", 1); /* "petsc4py/PETSc/Vec.pyx":1963 * * """ * cdef PetscNormType norm_1_2 = PETSC_NORM_1_AND_2 # <<<<<<<<<<<<<< * cdef PetscNormType ntype = PETSC_NORM_2 * if norm_type is not None: ntype = norm_type */ __pyx_v_norm_1_2 = NORM_1_AND_2; /* "petsc4py/PETSc/Vec.pyx":1964 * """ * cdef PetscNormType norm_1_2 = PETSC_NORM_1_AND_2 * cdef PetscNormType ntype = PETSC_NORM_2 # <<<<<<<<<<<<<< * if norm_type is not None: ntype = norm_type * cdef PetscReal rval[2] */ __pyx_v_ntype = NORM_2; /* "petsc4py/PETSc/Vec.pyx":1965 * cdef PetscNormType norm_1_2 = PETSC_NORM_1_AND_2 * cdef PetscNormType ntype = PETSC_NORM_2 * if norm_type is not None: ntype = norm_type # <<<<<<<<<<<<<< * cdef PetscReal rval[2] * CHKERR( VecNorm(self.vec, ntype, rval) ) */ __pyx_t_1 = (__pyx_v_norm_type != Py_None); if (__pyx_t_1) { __pyx_t_2 = ((NormType)__Pyx_PyInt_As_NormType(__pyx_v_norm_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 1965, __pyx_L1_error) __pyx_v_ntype = __pyx_t_2; } /* "petsc4py/PETSc/Vec.pyx":1967 * if norm_type is not None: ntype = norm_type * cdef PetscReal rval[2] * CHKERR( VecNorm(self.vec, ntype, rval) ) # <<<<<<<<<<<<<< * if ntype != norm_1_2: return toReal(rval[0]) * else: return (toReal(rval[0]), toReal(rval[1])) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecNorm(__pyx_v_self->vec, __pyx_v_ntype, __pyx_v_rval)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 1967, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":1968 * cdef PetscReal rval[2] * CHKERR( VecNorm(self.vec, ntype, rval) ) * if ntype != norm_1_2: return toReal(rval[0]) # <<<<<<<<<<<<<< * else: return (toReal(rval[0]), toReal(rval[1])) * */ __pyx_t_1 = (__pyx_v_ntype != __pyx_v_norm_1_2); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toReal((__pyx_v_rval[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 1968, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; } /* "petsc4py/PETSc/Vec.pyx":1969 * CHKERR( VecNorm(self.vec, ntype, rval) ) * if ntype != norm_1_2: return toReal(rval[0]) * else: return (toReal(rval[0]), toReal(rval[1])) # <<<<<<<<<<<<<< * * def normBegin( */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toReal((__pyx_v_rval[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 1969, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toReal((__pyx_v_rval[1])); if (unlikely(!__pyx_t_5)) __PYX_ERR(41, 1969, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(41, 1969, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4)) __PYX_ERR(41, 1969, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5)) __PYX_ERR(41, 1969, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; } /* "petsc4py/PETSc/Vec.pyx":1948 * raise NotImplementedError * * def norm( # <<<<<<<<<<<<<< * self, * norm_type: NormTypeSpec = None, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.Vec.norm", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":1971 * else: return (toReal(rval[0]), toReal(rval[1])) * * def normBegin( # <<<<<<<<<<<<<< * self, * norm_type: NormTypeSpec = None, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_197normBegin(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_196normBegin, "Vec.normBegin(self, norm_type: NormTypeSpec = None) -> None\nBegin computing the vector norm.\n\n Collective.\n\n This should be paired with a call to `normEnd`.\n\n See Also\n --------\n normEnd, norm, petsc.VecNormBegin\n\n \nSource code at petsc4py/PETSc/Vec.pyx:1971"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_197normBegin(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_norm_type = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("normBegin (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_norm_type,0}; /* "petsc4py/PETSc/Vec.pyx":1973 * def normBegin( * self, * norm_type: NormTypeSpec = None, # <<<<<<<<<<<<<< * ) -> None: * """Begin computing the vector norm. */ values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_norm_type); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 1971, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "normBegin") < 0)) __PYX_ERR(41, 1971, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_norm_type = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("normBegin", 0, 0, 1, __pyx_nargs); __PYX_ERR(41, 1971, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.normBegin", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_196normBegin(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_norm_type); /* "petsc4py/PETSc/Vec.pyx":1971 * else: return (toReal(rval[0]), toReal(rval[1])) * * def normBegin( # <<<<<<<<<<<<<< * self, * norm_type: NormTypeSpec = None, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_196normBegin(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_norm_type) { NormType __pyx_v_ntype; PetscReal __pyx_v_dummy[2]; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; NormType __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("normBegin", 1); /* "petsc4py/PETSc/Vec.pyx":1986 * * """ * cdef PetscNormType ntype = PETSC_NORM_2 # <<<<<<<<<<<<<< * if norm_type is not None: ntype = norm_type * cdef PetscReal dummy[2] */ __pyx_v_ntype = NORM_2; /* "petsc4py/PETSc/Vec.pyx":1987 * """ * cdef PetscNormType ntype = PETSC_NORM_2 * if norm_type is not None: ntype = norm_type # <<<<<<<<<<<<<< * cdef PetscReal dummy[2] * CHKERR( VecNormBegin(self.vec, ntype, dummy) ) */ __pyx_t_1 = (__pyx_v_norm_type != Py_None); if (__pyx_t_1) { __pyx_t_2 = ((NormType)__Pyx_PyInt_As_NormType(__pyx_v_norm_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 1987, __pyx_L1_error) __pyx_v_ntype = __pyx_t_2; } /* "petsc4py/PETSc/Vec.pyx":1989 * if norm_type is not None: ntype = norm_type * cdef PetscReal dummy[2] * CHKERR( VecNormBegin(self.vec, ntype, dummy) ) # <<<<<<<<<<<<<< * * def normEnd( */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecNormBegin(__pyx_v_self->vec, __pyx_v_ntype, __pyx_v_dummy)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 1989, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":1971 * else: return (toReal(rval[0]), toReal(rval[1])) * * def normBegin( # <<<<<<<<<<<<<< * self, * norm_type: NormTypeSpec = None, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.normBegin", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":1991 * CHKERR( VecNormBegin(self.vec, ntype, dummy) ) * * def normEnd( # <<<<<<<<<<<<<< * self, * norm_type: NormTypeSpec = None, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_199normEnd(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_198normEnd, "Vec.normEnd(self, norm_type: NormTypeSpec = None) -> float | tuple[float, float]\nFinish computations initiated with `normBegin`.\n\n Collective.\n\n See Also\n --------\n normBegin, norm, petsc.VecNormEnd\n\n \nSource code at petsc4py/PETSc/Vec.pyx:1991"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_199normEnd(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_norm_type = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("normEnd (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_norm_type,0}; /* "petsc4py/PETSc/Vec.pyx":1993 * def normEnd( * self, * norm_type: NormTypeSpec = None, # <<<<<<<<<<<<<< * ) -> float | tuple[float, float]: * """Finish computations initiated with `normBegin`. */ values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_norm_type); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 1991, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "normEnd") < 0)) __PYX_ERR(41, 1991, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_norm_type = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("normEnd", 0, 0, 1, __pyx_nargs); __PYX_ERR(41, 1991, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.normEnd", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_198normEnd(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_norm_type); /* "petsc4py/PETSc/Vec.pyx":1991 * CHKERR( VecNormBegin(self.vec, ntype, dummy) ) * * def normEnd( # <<<<<<<<<<<<<< * self, * norm_type: NormTypeSpec = None, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_198normEnd(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_norm_type) { NormType __pyx_v_norm_1_2; NormType __pyx_v_ntype; PetscReal __pyx_v_rval[2]; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; NormType __pyx_t_2; PetscErrorCode __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("normEnd", 1); /* "petsc4py/PETSc/Vec.pyx":2004 * * """ * cdef PetscNormType norm_1_2 = PETSC_NORM_1_AND_2 # <<<<<<<<<<<<<< * cdef PetscNormType ntype = PETSC_NORM_2 * if norm_type is not None: ntype = norm_type */ __pyx_v_norm_1_2 = NORM_1_AND_2; /* "petsc4py/PETSc/Vec.pyx":2005 * """ * cdef PetscNormType norm_1_2 = PETSC_NORM_1_AND_2 * cdef PetscNormType ntype = PETSC_NORM_2 # <<<<<<<<<<<<<< * if norm_type is not None: ntype = norm_type * cdef PetscReal rval[2] */ __pyx_v_ntype = NORM_2; /* "petsc4py/PETSc/Vec.pyx":2006 * cdef PetscNormType norm_1_2 = PETSC_NORM_1_AND_2 * cdef PetscNormType ntype = PETSC_NORM_2 * if norm_type is not None: ntype = norm_type # <<<<<<<<<<<<<< * cdef PetscReal rval[2] * CHKERR( VecNormEnd(self.vec, ntype, rval) ) */ __pyx_t_1 = (__pyx_v_norm_type != Py_None); if (__pyx_t_1) { __pyx_t_2 = ((NormType)__Pyx_PyInt_As_NormType(__pyx_v_norm_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 2006, __pyx_L1_error) __pyx_v_ntype = __pyx_t_2; } /* "petsc4py/PETSc/Vec.pyx":2008 * if norm_type is not None: ntype = norm_type * cdef PetscReal rval[2] * CHKERR( VecNormEnd(self.vec, ntype, rval) ) # <<<<<<<<<<<<<< * if ntype != norm_1_2: return toReal(rval[0]) * else: return (toReal(rval[0]), toReal(rval[1])) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecNormEnd(__pyx_v_self->vec, __pyx_v_ntype, __pyx_v_rval)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 2008, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":2009 * cdef PetscReal rval[2] * CHKERR( VecNormEnd(self.vec, ntype, rval) ) * if ntype != norm_1_2: return toReal(rval[0]) # <<<<<<<<<<<<<< * else: return (toReal(rval[0]), toReal(rval[1])) * */ __pyx_t_1 = (__pyx_v_ntype != __pyx_v_norm_1_2); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toReal((__pyx_v_rval[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 2009, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; } /* "petsc4py/PETSc/Vec.pyx":2010 * CHKERR( VecNormEnd(self.vec, ntype, rval) ) * if ntype != norm_1_2: return toReal(rval[0]) * else: return (toReal(rval[0]), toReal(rval[1])) # <<<<<<<<<<<<<< * * def dotNorm2(self, Vec vec) -> tuple[Scalar, float]: */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toReal((__pyx_v_rval[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 2010, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toReal((__pyx_v_rval[1])); if (unlikely(!__pyx_t_5)) __PYX_ERR(41, 2010, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(41, 2010, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4)) __PYX_ERR(41, 2010, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5)) __PYX_ERR(41, 2010, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; } /* "petsc4py/PETSc/Vec.pyx":1991 * CHKERR( VecNormBegin(self.vec, ntype, dummy) ) * * def normEnd( # <<<<<<<<<<<<<< * self, * norm_type: NormTypeSpec = None, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.Vec.normEnd", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":2012 * else: return (toReal(rval[0]), toReal(rval[1])) * * def dotNorm2(self, Vec vec) -> tuple[Scalar, float]: # <<<<<<<<<<<<<< * """Return the dot product with ``vec`` and its squared norm. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_201dotNorm2(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_200dotNorm2, "Vec.dotNorm2(self, vec: Vec) -> tuple[Scalar, float]\nReturn the dot product with ``vec`` and its squared norm.\n\n Collective.\n\n See Also\n --------\n dot, norm, petsc.VecDotNorm2\n\n \nSource code at petsc4py/PETSc/Vec.pyx:2012"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_201dotNorm2(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_vec = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("dotNorm2 (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vec)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 2012, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "dotNorm2") < 0)) __PYX_ERR(41, 2012, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_vec = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("dotNorm2", 1, 1, 1, __pyx_nargs); __PYX_ERR(41, 2012, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.dotNorm2", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(41, 2012, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_200dotNorm2(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_vec); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_200dotNorm2(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec) { PetscScalar __pyx_v_sval; PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscReal __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("dotNorm2", 1); /* "petsc4py/PETSc/Vec.pyx":2022 * * """ * cdef PetscScalar sval = 0 # <<<<<<<<<<<<<< * cdef PetscReal rval = 0 * CHKERR( VecDotNorm2(self.vec, vec.vec, &sval, &rval) ) */ __pyx_v_sval = 0.0; /* "petsc4py/PETSc/Vec.pyx":2023 * """ * cdef PetscScalar sval = 0 * cdef PetscReal rval = 0 # <<<<<<<<<<<<<< * CHKERR( VecDotNorm2(self.vec, vec.vec, &sval, &rval) ) * return toScalar(sval), toReal(float) */ __pyx_v_rval = 0.0; /* "petsc4py/PETSc/Vec.pyx":2024 * cdef PetscScalar sval = 0 * cdef PetscReal rval = 0 * CHKERR( VecDotNorm2(self.vec, vec.vec, &sval, &rval) ) # <<<<<<<<<<<<<< * return toScalar(sval), toReal(float) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecDotNorm2(__pyx_v_self->vec, __pyx_v_vec->vec, (&__pyx_v_sval), (&__pyx_v_rval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 2024, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":2025 * cdef PetscReal rval = 0 * CHKERR( VecDotNorm2(self.vec, vec.vec, &sval, &rval) ) * return toScalar(sval), toReal(float) # <<<<<<<<<<<<<< * * def sum(self) -> Scalar: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toScalar(__pyx_v_sval); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 2025, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_PyFloat_AsDouble(((PyObject *)(&PyFloat_Type))); if (unlikely((__pyx_t_3 == ((PetscReal)-1)) && PyErr_Occurred())) __PYX_ERR(41, 2025, __pyx_L1_error) __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 2025, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(41, 2025, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2)) __PYX_ERR(41, 2025, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4)) __PYX_ERR(41, 2025, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_4 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":2012 * else: return (toReal(rval[0]), toReal(rval[1])) * * def dotNorm2(self, Vec vec) -> tuple[Scalar, float]: # <<<<<<<<<<<<<< * """Return the dot product with ``vec`` and its squared norm. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.Vec.dotNorm2", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":2027 * return toScalar(sval), toReal(float) * * def sum(self) -> Scalar: # <<<<<<<<<<<<<< * """Return the sum of all the entries of the vector. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_203sum(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_202sum, "Vec.sum(self) -> Scalar\nReturn the sum of all the entries of the vector.\n\n Collective.\n\n See Also\n --------\n petsc.VecSum\n\n \nSource code at petsc4py/PETSc/Vec.pyx:2027"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_203sum(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("sum (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("sum", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "sum", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_202sum(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_202sum(struct PyPetscVecObject *__pyx_v_self) { PetscScalar __pyx_v_sval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("sum", 1); /* "petsc4py/PETSc/Vec.pyx":2037 * * """ * cdef PetscScalar sval = 0 # <<<<<<<<<<<<<< * CHKERR( VecSum(self.vec, &sval) ) * return toScalar(sval) */ __pyx_v_sval = 0.0; /* "petsc4py/PETSc/Vec.pyx":2038 * """ * cdef PetscScalar sval = 0 * CHKERR( VecSum(self.vec, &sval) ) # <<<<<<<<<<<<<< * return toScalar(sval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecSum(__pyx_v_self->vec, (&__pyx_v_sval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 2038, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":2039 * cdef PetscScalar sval = 0 * CHKERR( VecSum(self.vec, &sval) ) * return toScalar(sval) # <<<<<<<<<<<<<< * * def min(self) -> tuple[int, float]: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toScalar(__pyx_v_sval); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 2039, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":2027 * return toScalar(sval), toReal(float) * * def sum(self) -> Scalar: # <<<<<<<<<<<<<< * """Return the sum of all the entries of the vector. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Vec.sum", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":2041 * return toScalar(sval) * * def min(self) -> tuple[int, float]: # <<<<<<<<<<<<<< * """Return the vector entry with minimum real part and its location. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_205min(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_204min, "Vec.min(self) -> tuple[int, float]\nReturn the vector entry with minimum real part and its location.\n\n Collective.\n\n Returns\n -------\n p : int\n Location of the minimum value. If multiple entries exist with the\n same value then the smallest index will be returned.\n val : Scalar\n Minimum value.\n\n See Also\n --------\n max, petsc.VecMin\n\n \nSource code at petsc4py/PETSc/Vec.pyx:2041"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_205min(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("min (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("min", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "min", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_204min(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_204min(struct PyPetscVecObject *__pyx_v_self) { PetscInt __pyx_v_ival; PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("min", 1); /* "petsc4py/PETSc/Vec.pyx":2059 * * """ * cdef PetscInt ival = 0 # <<<<<<<<<<<<<< * cdef PetscReal rval = 0 * CHKERR( VecMin(self.vec, &ival, &rval) ) */ __pyx_v_ival = 0; /* "petsc4py/PETSc/Vec.pyx":2060 * """ * cdef PetscInt ival = 0 * cdef PetscReal rval = 0 # <<<<<<<<<<<<<< * CHKERR( VecMin(self.vec, &ival, &rval) ) * return (toInt(ival), toReal(rval)) */ __pyx_v_rval = 0.0; /* "petsc4py/PETSc/Vec.pyx":2061 * cdef PetscInt ival = 0 * cdef PetscReal rval = 0 * CHKERR( VecMin(self.vec, &ival, &rval) ) # <<<<<<<<<<<<<< * return (toInt(ival), toReal(rval)) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecMin(__pyx_v_self->vec, (&__pyx_v_ival), (&__pyx_v_rval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 2061, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":2062 * cdef PetscReal rval = 0 * CHKERR( VecMin(self.vec, &ival, &rval) ) * return (toInt(ival), toReal(rval)) # <<<<<<<<<<<<<< * * def max(self) -> tuple[int, float]: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ival); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 2062, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_rval); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 2062, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 2062, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(41, 2062, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(41, 2062, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":2041 * return toScalar(sval) * * def min(self) -> tuple[int, float]: # <<<<<<<<<<<<<< * """Return the vector entry with minimum real part and its location. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.Vec.min", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":2064 * return (toInt(ival), toReal(rval)) * * def max(self) -> tuple[int, float]: # <<<<<<<<<<<<<< * """Return the vector entry with maximum real part and its location. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_207max(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_206max, "Vec.max(self) -> tuple[int, float]\nReturn the vector entry with maximum real part and its location.\n\n Collective.\n\n Returns\n -------\n p : int\n Location of the maximum value. If multiple entries exist with the\n same value then the smallest index will be returned.\n val : Scalar\n Minimum value.\n\n See Also\n --------\n min, petsc.VecMax\n\n \nSource code at petsc4py/PETSc/Vec.pyx:2064"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_207max(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("max (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("max", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "max", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_206max(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_206max(struct PyPetscVecObject *__pyx_v_self) { PetscInt __pyx_v_ival; PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("max", 1); /* "petsc4py/PETSc/Vec.pyx":2082 * * """ * cdef PetscInt ival = 0 # <<<<<<<<<<<<<< * cdef PetscReal rval = 0 * CHKERR( VecMax(self.vec, &ival, &rval) ) */ __pyx_v_ival = 0; /* "petsc4py/PETSc/Vec.pyx":2083 * """ * cdef PetscInt ival = 0 * cdef PetscReal rval = 0 # <<<<<<<<<<<<<< * CHKERR( VecMax(self.vec, &ival, &rval) ) * return (toInt(ival), toReal(rval)) */ __pyx_v_rval = 0.0; /* "petsc4py/PETSc/Vec.pyx":2084 * cdef PetscInt ival = 0 * cdef PetscReal rval = 0 * CHKERR( VecMax(self.vec, &ival, &rval) ) # <<<<<<<<<<<<<< * return (toInt(ival), toReal(rval)) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecMax(__pyx_v_self->vec, (&__pyx_v_ival), (&__pyx_v_rval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 2084, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":2085 * cdef PetscReal rval = 0 * CHKERR( VecMax(self.vec, &ival, &rval) ) * return (toInt(ival), toReal(rval)) # <<<<<<<<<<<<<< * * def normalize(self) -> float: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ival); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 2085, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_rval); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 2085, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 2085, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(41, 2085, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(41, 2085, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":2064 * return (toInt(ival), toReal(rval)) * * def max(self) -> tuple[int, float]: # <<<<<<<<<<<<<< * """Return the vector entry with maximum real part and its location. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.Vec.max", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":2087 * return (toInt(ival), toReal(rval)) * * def normalize(self) -> float: # <<<<<<<<<<<<<< * """Normalize the vector by its 2-norm. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_209normalize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_208normalize, "Vec.normalize(self) -> float\nNormalize the vector by its 2-norm.\n\n Collective.\n\n Returns\n -------\n float\n The vector norm before normalization.\n\n See Also\n --------\n norm, petsc.VecNormalize\n\n \nSource code at petsc4py/PETSc/Vec.pyx:2087"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_209normalize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("normalize (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("normalize", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "normalize", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_208normalize(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_208normalize(struct PyPetscVecObject *__pyx_v_self) { PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("normalize", 1); /* "petsc4py/PETSc/Vec.pyx":2102 * * """ * cdef PetscReal rval = 0 # <<<<<<<<<<<<<< * CHKERR( VecNormalize(self.vec, &rval) ) * return toReal(rval) */ __pyx_v_rval = 0.0; /* "petsc4py/PETSc/Vec.pyx":2103 * """ * cdef PetscReal rval = 0 * CHKERR( VecNormalize(self.vec, &rval) ) # <<<<<<<<<<<<<< * return toReal(rval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecNormalize(__pyx_v_self->vec, (&__pyx_v_rval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 2103, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":2104 * cdef PetscReal rval = 0 * CHKERR( VecNormalize(self.vec, &rval) ) * return toReal(rval) # <<<<<<<<<<<<<< * * def reciprocal(self) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_rval); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 2104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":2087 * return (toInt(ival), toReal(rval)) * * def normalize(self) -> float: # <<<<<<<<<<<<<< * """Normalize the vector by its 2-norm. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Vec.normalize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":2106 * return toReal(rval) * * def reciprocal(self) -> None: # <<<<<<<<<<<<<< * """Replace each entry in the vector by its reciprocal. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_211reciprocal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_210reciprocal, "Vec.reciprocal(self) -> None\nReplace each entry in the vector by its reciprocal.\n\n Logically collective.\n\n See Also\n --------\n petsc.VecReciprocal\n\n \nSource code at petsc4py/PETSc/Vec.pyx:2106"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_211reciprocal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("reciprocal (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("reciprocal", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "reciprocal", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_210reciprocal(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_210reciprocal(struct PyPetscVecObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("reciprocal", 1); /* "petsc4py/PETSc/Vec.pyx":2116 * * """ * CHKERR( VecReciprocal(self.vec) ) # <<<<<<<<<<<<<< * * def exp(self) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecReciprocal(__pyx_v_self->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 2116, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":2106 * return toReal(rval) * * def reciprocal(self) -> None: # <<<<<<<<<<<<<< * """Replace each entry in the vector by its reciprocal. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.reciprocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":2118 * CHKERR( VecReciprocal(self.vec) ) * * def exp(self) -> None: # <<<<<<<<<<<<<< * """Replace each entry (x) in the vector by exp(x). * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_213exp(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_212exp, "Vec.exp(self) -> None\nReplace each entry (x\342\202\231) in the vector by exp(x\342\202\231).\n\n Logically collective.\n\n See Also\n --------\n log, petsc.VecExp\n\n \nSource code at petsc4py/PETSc/Vec.pyx:2118"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_213exp(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("exp (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("exp", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "exp", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_212exp(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_212exp(struct PyPetscVecObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("exp", 1); /* "petsc4py/PETSc/Vec.pyx":2128 * * """ * CHKERR( VecExp(self.vec) ) # <<<<<<<<<<<<<< * * def log(self) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecExp(__pyx_v_self->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 2128, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":2118 * CHKERR( VecReciprocal(self.vec) ) * * def exp(self) -> None: # <<<<<<<<<<<<<< * """Replace each entry (x) in the vector by exp(x). * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.exp", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":2130 * CHKERR( VecExp(self.vec) ) * * def log(self) -> None: # <<<<<<<<<<<<<< * """Replace each entry in the vector by its natural logarithm. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_215log(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_214log, "Vec.log(self) -> None\nReplace each entry in the vector by its natural logarithm.\n\n Logically collective.\n\n See Also\n --------\n exp, petsc.VecLog\n\n \nSource code at petsc4py/PETSc/Vec.pyx:2130"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_215log(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("log (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("log", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "log", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_214log(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_214log(struct PyPetscVecObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("log", 1); /* "petsc4py/PETSc/Vec.pyx":2140 * * """ * CHKERR( VecLog(self.vec) ) # <<<<<<<<<<<<<< * * def sqrtabs(self) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecLog(__pyx_v_self->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 2140, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":2130 * CHKERR( VecExp(self.vec) ) * * def log(self) -> None: # <<<<<<<<<<<<<< * """Replace each entry in the vector by its natural logarithm. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.log", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":2142 * CHKERR( VecLog(self.vec) ) * * def sqrtabs(self) -> None: # <<<<<<<<<<<<<< * """Replace each entry (x) in the vector by |x|. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_217sqrtabs(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_216sqrtabs, "Vec.sqrtabs(self) -> None\nReplace each entry (x\342\202\231) in the vector by \342\210\232|x\342\202\231|.\n\n Logically collective.\n\n See Also\n --------\n petsc.VecSqrtAbs\n\n \nSource code at petsc4py/PETSc/Vec.pyx:2142"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_217sqrtabs(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("sqrtabs (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("sqrtabs", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "sqrtabs", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_216sqrtabs(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_216sqrtabs(struct PyPetscVecObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("sqrtabs", 1); /* "petsc4py/PETSc/Vec.pyx":2152 * * """ * CHKERR( VecSqrtAbs(self.vec) ) # <<<<<<<<<<<<<< * * def abs(self) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecSqrtAbs(__pyx_v_self->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 2152, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":2142 * CHKERR( VecLog(self.vec) ) * * def sqrtabs(self) -> None: # <<<<<<<<<<<<<< * """Replace each entry (x) in the vector by |x|. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.sqrtabs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":2154 * CHKERR( VecSqrtAbs(self.vec) ) * * def abs(self) -> None: # <<<<<<<<<<<<<< * """Replace each entry (x) in the vector by abs|x|. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_219abs(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_218abs, "Vec.abs(self) -> None\nReplace each entry (x\342\202\231) in the vector by abs|x\342\202\231|.\n\n Logically collective.\n\n See Also\n --------\n petsc.VecAbs\n\n \nSource code at petsc4py/PETSc/Vec.pyx:2154"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_219abs(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("abs (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("abs", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "abs", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_218abs(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_218abs(struct PyPetscVecObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("abs", 1); /* "petsc4py/PETSc/Vec.pyx":2164 * * """ * CHKERR( VecAbs(self.vec) ) # <<<<<<<<<<<<<< * * def conjugate(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecAbs(__pyx_v_self->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 2164, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":2154 * CHKERR( VecSqrtAbs(self.vec) ) * * def abs(self) -> None: # <<<<<<<<<<<<<< * """Replace each entry (x) in the vector by abs|x|. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.abs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":2166 * CHKERR( VecAbs(self.vec) ) * * def conjugate(self): # <<<<<<<<<<<<<< * """Conjugate the vector. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_221conjugate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_220conjugate, "Vec.conjugate(self)\nConjugate the vector.\n\n Logically collective.\n\n See Also\n --------\n petsc.VecConjugate\n\n \nSource code at petsc4py/PETSc/Vec.pyx:2166"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_221conjugate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("conjugate (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("conjugate", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "conjugate", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_220conjugate(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_220conjugate(struct PyPetscVecObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("conjugate", 1); /* "petsc4py/PETSc/Vec.pyx":2176 * * """ * CHKERR( VecConjugate(self.vec) ) # <<<<<<<<<<<<<< * * def setRandom(self, Random random=None) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecConjugate(__pyx_v_self->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 2176, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":2166 * CHKERR( VecAbs(self.vec) ) * * def conjugate(self): # <<<<<<<<<<<<<< * """Conjugate the vector. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.conjugate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":2178 * CHKERR( VecConjugate(self.vec) ) * * def setRandom(self, Random random=None) -> None: # <<<<<<<<<<<<<< * """Set all components of the vector to random numbers. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_223setRandom(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_222setRandom, "Vec.setRandom(self, random: Random | None = None) -> None\nSet all components of the vector to random numbers.\n\n Collective.\n\n Parameters\n ----------\n random\n Random number generator. If `None` then one will be created\n internally.\n\n See Also\n --------\n petsc.VecSetRandom\n\n \nSource code at petsc4py/PETSc/Vec.pyx:2178"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_223setRandom(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscRandomObject *__pyx_v_random = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setRandom (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_random,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscRandomObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_random); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 2178, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setRandom") < 0)) __PYX_ERR(41, 2178, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_random = ((struct PyPetscRandomObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setRandom", 0, 0, 1, __pyx_nargs); __PYX_ERR(41, 2178, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.setRandom", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_random), __pyx_ptype_8petsc4py_5PETSc_Random, 1, "random", 0))) __PYX_ERR(41, 2178, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_222setRandom(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_random); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_222setRandom(struct PyPetscVecObject *__pyx_v_self, struct PyPetscRandomObject *__pyx_v_random) { PetscRandom __pyx_v_rnd; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscRandom __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setRandom", 1); /* "petsc4py/PETSc/Vec.pyx":2194 * * """ * cdef PetscRandom rnd = NULL # <<<<<<<<<<<<<< * if random is not None: rnd = random.rnd * CHKERR( VecSetRandom(self.vec, rnd) ) */ __pyx_v_rnd = NULL; /* "petsc4py/PETSc/Vec.pyx":2195 * """ * cdef PetscRandom rnd = NULL * if random is not None: rnd = random.rnd # <<<<<<<<<<<<<< * CHKERR( VecSetRandom(self.vec, rnd) ) * */ __pyx_t_1 = (((PyObject *)__pyx_v_random) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_random->rnd; __pyx_v_rnd = __pyx_t_2; } /* "petsc4py/PETSc/Vec.pyx":2196 * cdef PetscRandom rnd = NULL * if random is not None: rnd = random.rnd * CHKERR( VecSetRandom(self.vec, rnd) ) # <<<<<<<<<<<<<< * * def permute(self, IS order, invert: bool = False) -> None: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecSetRandom(__pyx_v_self->vec, __pyx_v_rnd)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 2196, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":2178 * CHKERR( VecConjugate(self.vec) ) * * def setRandom(self, Random random=None) -> None: # <<<<<<<<<<<<<< * """Set all components of the vector to random numbers. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.setRandom", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":2198 * CHKERR( VecSetRandom(self.vec, rnd) ) * * def permute(self, IS order, invert: bool = False) -> None: # <<<<<<<<<<<<<< * """Permute the vector in-place with a provided ordering. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_225permute(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_224permute, "Vec.permute(self, order: IS, invert: bool = False) -> None\nPermute the vector in-place with a provided ordering.\n\n Collective.\n\n Parameters\n ----------\n order\n Ordering for the permutation.\n invert\n Whether to invert the permutation.\n\n See Also\n --------\n petsc.VecPermute\n\n \nSource code at petsc4py/PETSc/Vec.pyx:2198"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_225permute(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscISObject *__pyx_v_order = 0; PyObject *__pyx_v_invert = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("permute (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_order,&__pyx_n_s_invert,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_order)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 2198, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_invert); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 2198, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "permute") < 0)) __PYX_ERR(41, 2198, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_order = ((struct PyPetscISObject *)values[0]); __pyx_v_invert = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("permute", 0, 1, 2, __pyx_nargs); __PYX_ERR(41, 2198, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.permute", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_order), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "order", 0))) __PYX_ERR(41, 2198, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_224permute(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_order, __pyx_v_invert); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_224permute(struct PyPetscVecObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_order, PyObject *__pyx_v_invert) { PetscBool __pyx_v_cinvert; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("permute", 1); /* "petsc4py/PETSc/Vec.pyx":2215 * * """ * cdef PetscBool cinvert = PETSC_FALSE # <<<<<<<<<<<<<< * if invert: cinvert = PETSC_TRUE * CHKERR( VecPermute(self.vec, order.iset, cinvert) ) */ __pyx_v_cinvert = PETSC_FALSE; /* "petsc4py/PETSc/Vec.pyx":2216 * """ * cdef PetscBool cinvert = PETSC_FALSE * if invert: cinvert = PETSC_TRUE # <<<<<<<<<<<<<< * CHKERR( VecPermute(self.vec, order.iset, cinvert) ) * */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_invert); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(41, 2216, __pyx_L1_error) if (__pyx_t_1) { __pyx_v_cinvert = PETSC_TRUE; } /* "petsc4py/PETSc/Vec.pyx":2217 * cdef PetscBool cinvert = PETSC_FALSE * if invert: cinvert = PETSC_TRUE * CHKERR( VecPermute(self.vec, order.iset, cinvert) ) # <<<<<<<<<<<<<< * * def zeroEntries(self) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecPermute(__pyx_v_self->vec, __pyx_v_order->iset, __pyx_v_cinvert)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 2217, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":2198 * CHKERR( VecSetRandom(self.vec, rnd) ) * * def permute(self, IS order, invert: bool = False) -> None: # <<<<<<<<<<<<<< * """Permute the vector in-place with a provided ordering. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.permute", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":2219 * CHKERR( VecPermute(self.vec, order.iset, cinvert) ) * * def zeroEntries(self) -> None: # <<<<<<<<<<<<<< * """Set all entries in the vector to zero. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_227zeroEntries(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_226zeroEntries, "Vec.zeroEntries(self) -> None\nSet all entries in the vector to zero.\n\n Logically collective.\n\n See Also\n --------\n set, petsc.VecZeroEntries\n\n \nSource code at petsc4py/PETSc/Vec.pyx:2219"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_227zeroEntries(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("zeroEntries (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("zeroEntries", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "zeroEntries", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_226zeroEntries(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_226zeroEntries(struct PyPetscVecObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("zeroEntries", 1); /* "petsc4py/PETSc/Vec.pyx":2229 * * """ * CHKERR( VecZeroEntries(self.vec) ) # <<<<<<<<<<<<<< * * def set(self, alpha: Scalar) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecZeroEntries(__pyx_v_self->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 2229, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":2219 * CHKERR( VecPermute(self.vec, order.iset, cinvert) ) * * def zeroEntries(self) -> None: # <<<<<<<<<<<<<< * """Set all entries in the vector to zero. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.zeroEntries", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":2231 * CHKERR( VecZeroEntries(self.vec) ) * * def set(self, alpha: Scalar) -> None: # <<<<<<<<<<<<<< * """Set all components of the vector to the same value. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_229set(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_228set, "Vec.set(self, alpha: Scalar) -> None\nSet all components of the vector to the same value.\n\n Collective.\n\n See Also\n --------\n zeroEntries, isset, petsc.VecSet\n\n \nSource code at petsc4py/PETSc/Vec.pyx:2231"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_229set(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_alpha = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_alpha,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_alpha)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 2231, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set") < 0)) __PYX_ERR(41, 2231, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_alpha = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set", 1, 1, 1, __pyx_nargs); __PYX_ERR(41, 2231, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.set", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_228set(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_alpha); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_228set(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_alpha) { PetscScalar __pyx_v_sval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscScalar __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set", 1); /* "petsc4py/PETSc/Vec.pyx":2241 * * """ * cdef PetscScalar sval = asScalar(alpha) # <<<<<<<<<<<<<< * CHKERR( VecSet(self.vec, sval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_alpha); if (unlikely(__pyx_t_1 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(41, 2241, __pyx_L1_error) __pyx_v_sval = __pyx_t_1; /* "petsc4py/PETSc/Vec.pyx":2242 * """ * cdef PetscScalar sval = asScalar(alpha) * CHKERR( VecSet(self.vec, sval) ) # <<<<<<<<<<<<<< * * def isset(self, IS idx, alpha: Scalar) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecSet(__pyx_v_self->vec, __pyx_v_sval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 2242, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":2231 * CHKERR( VecZeroEntries(self.vec) ) * * def set(self, alpha: Scalar) -> None: # <<<<<<<<<<<<<< * """Set all components of the vector to the same value. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.set", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":2244 * CHKERR( VecSet(self.vec, sval) ) * * def isset(self, IS idx, alpha: Scalar) -> None: # <<<<<<<<<<<<<< * """Set specific elements of the vector to the same value. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_231isset(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_230isset, "Vec.isset(self, idx: IS, alpha: Scalar) -> None\nSet specific elements of the vector to the same value.\n\n Not collective.\n\n Parameters\n ----------\n idx\n Index set specifying the vector entries to set.\n alpha\n Value to set the selected entries to.\n\n See Also\n --------\n set, zeroEntries, petsc.VecISSet\n\n \nSource code at petsc4py/PETSc/Vec.pyx:2244"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_231isset(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscISObject *__pyx_v_idx = 0; PyObject *__pyx_v_alpha = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("isset (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_idx,&__pyx_n_s_alpha,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_idx)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 2244, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_alpha)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 2244, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("isset", 1, 2, 2, 1); __PYX_ERR(41, 2244, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "isset") < 0)) __PYX_ERR(41, 2244, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_idx = ((struct PyPetscISObject *)values[0]); __pyx_v_alpha = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("isset", 1, 2, 2, __pyx_nargs); __PYX_ERR(41, 2244, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.isset", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_idx), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "idx", 0))) __PYX_ERR(41, 2244, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_230isset(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_idx, __pyx_v_alpha); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_230isset(struct PyPetscVecObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_idx, PyObject *__pyx_v_alpha) { PetscScalar __pyx_v_aval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscScalar __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("isset", 1); /* "petsc4py/PETSc/Vec.pyx":2261 * * """ * cdef PetscScalar aval = asScalar(alpha) # <<<<<<<<<<<<<< * CHKERR( VecISSet(self.vec, idx.iset, aval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_alpha); if (unlikely(__pyx_t_1 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(41, 2261, __pyx_L1_error) __pyx_v_aval = __pyx_t_1; /* "petsc4py/PETSc/Vec.pyx":2262 * """ * cdef PetscScalar aval = asScalar(alpha) * CHKERR( VecISSet(self.vec, idx.iset, aval) ) # <<<<<<<<<<<<<< * * def scale(self, alpha: Scalar) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecISSet(__pyx_v_self->vec, __pyx_v_idx->iset, __pyx_v_aval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 2262, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":2244 * CHKERR( VecSet(self.vec, sval) ) * * def isset(self, IS idx, alpha: Scalar) -> None: # <<<<<<<<<<<<<< * """Set specific elements of the vector to the same value. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.isset", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":2264 * CHKERR( VecISSet(self.vec, idx.iset, aval) ) * * def scale(self, alpha: Scalar) -> None: # <<<<<<<<<<<<<< * """Scale all entries of the vector. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_233scale(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_232scale, "Vec.scale(self, alpha: Scalar) -> None\nScale all entries of the vector.\n\n Collective.\n\n This method sets each entry (x\342\202\231) in the vector to \311\221\302\267x\342\202\231.\n\n Parameters\n ----------\n alpha\n The scaling factor.\n\n See Also\n --------\n shift, petsc.VecScale\n\n \nSource code at petsc4py/PETSc/Vec.pyx:2264"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_233scale(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_alpha = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("scale (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_alpha,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_alpha)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 2264, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "scale") < 0)) __PYX_ERR(41, 2264, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_alpha = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("scale", 1, 1, 1, __pyx_nargs); __PYX_ERR(41, 2264, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.scale", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_232scale(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_alpha); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_232scale(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_alpha) { PetscScalar __pyx_v_sval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscScalar __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("scale", 1); /* "petsc4py/PETSc/Vec.pyx":2281 * * """ * cdef PetscScalar sval = asScalar(alpha) # <<<<<<<<<<<<<< * CHKERR( VecScale(self.vec, sval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_alpha); if (unlikely(__pyx_t_1 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(41, 2281, __pyx_L1_error) __pyx_v_sval = __pyx_t_1; /* "petsc4py/PETSc/Vec.pyx":2282 * """ * cdef PetscScalar sval = asScalar(alpha) * CHKERR( VecScale(self.vec, sval) ) # <<<<<<<<<<<<<< * * def shift(self, alpha: Scalar) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecScale(__pyx_v_self->vec, __pyx_v_sval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 2282, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":2264 * CHKERR( VecISSet(self.vec, idx.iset, aval) ) * * def scale(self, alpha: Scalar) -> None: # <<<<<<<<<<<<<< * """Scale all entries of the vector. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.scale", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":2284 * CHKERR( VecScale(self.vec, sval) ) * * def shift(self, alpha: Scalar) -> None: # <<<<<<<<<<<<<< * """Shift all entries in the vector. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_235shift(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_234shift, "Vec.shift(self, alpha: Scalar) -> None\nShift all entries in the vector.\n\n Collective.\n\n This method sets each entry (x\342\202\231) in the vector to x\342\202\231 + \311\221.\n\n Parameters\n ----------\n alpha\n The shift to apply to the vector values.\n\n See Also\n --------\n scale, petsc.VecShift\n\n \nSource code at petsc4py/PETSc/Vec.pyx:2284"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_235shift(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_alpha = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("shift (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_alpha,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_alpha)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 2284, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "shift") < 0)) __PYX_ERR(41, 2284, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_alpha = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("shift", 1, 1, 1, __pyx_nargs); __PYX_ERR(41, 2284, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.shift", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_234shift(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_alpha); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_234shift(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_alpha) { PetscScalar __pyx_v_sval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscScalar __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("shift", 1); /* "petsc4py/PETSc/Vec.pyx":2301 * * """ * cdef PetscScalar sval = asScalar(alpha) # <<<<<<<<<<<<<< * CHKERR( VecShift(self.vec, sval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_alpha); if (unlikely(__pyx_t_1 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(41, 2301, __pyx_L1_error) __pyx_v_sval = __pyx_t_1; /* "petsc4py/PETSc/Vec.pyx":2302 * """ * cdef PetscScalar sval = asScalar(alpha) * CHKERR( VecShift(self.vec, sval) ) # <<<<<<<<<<<<<< * * def swap(self, Vec vec) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecShift(__pyx_v_self->vec, __pyx_v_sval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 2302, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":2284 * CHKERR( VecScale(self.vec, sval) ) * * def shift(self, alpha: Scalar) -> None: # <<<<<<<<<<<<<< * """Shift all entries in the vector. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.shift", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":2304 * CHKERR( VecShift(self.vec, sval) ) * * def swap(self, Vec vec) -> None: # <<<<<<<<<<<<<< * """Swap the content of two vectors. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_237swap(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_236swap, "Vec.swap(self, vec: Vec) -> None\nSwap the content of two vectors.\n\n Logically collective.\n\n Parameters\n ----------\n vec\n The vector to swap data with.\n\n See Also\n --------\n petsc.VecSwap\n\n \nSource code at petsc4py/PETSc/Vec.pyx:2304"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_237swap(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_vec = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("swap (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vec)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 2304, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "swap") < 0)) __PYX_ERR(41, 2304, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_vec = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("swap", 1, 1, 1, __pyx_nargs); __PYX_ERR(41, 2304, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.swap", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(41, 2304, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_236swap(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_vec); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_236swap(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("swap", 1); /* "petsc4py/PETSc/Vec.pyx":2319 * * """ * CHKERR( VecSwap(self.vec, vec.vec) ) # <<<<<<<<<<<<<< * * def axpy(self, alpha: Scalar, Vec x) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecSwap(__pyx_v_self->vec, __pyx_v_vec->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 2319, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":2304 * CHKERR( VecShift(self.vec, sval) ) * * def swap(self, Vec vec) -> None: # <<<<<<<<<<<<<< * """Swap the content of two vectors. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.swap", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":2321 * CHKERR( VecSwap(self.vec, vec.vec) ) * * def axpy(self, alpha: Scalar, Vec x) -> None: # <<<<<<<<<<<<<< * """Compute and store y = x + y. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_239axpy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_238axpy, "Vec.axpy(self, alpha: Scalar, x: Vec) -> None\nCompute and store y = \311\221\302\267x + y.\n\n Logically collective.\n\n Parameters\n ----------\n alpha\n Scale factor.\n x\n Input vector.\n\n See Also\n --------\n isaxpy, petsc.VecAXPY\n\n \nSource code at petsc4py/PETSc/Vec.pyx:2321"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_239axpy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_alpha = 0; struct PyPetscVecObject *__pyx_v_x = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("axpy (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_alpha,&__pyx_n_s_x,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_alpha)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 2321, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 2321, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("axpy", 1, 2, 2, 1); __PYX_ERR(41, 2321, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "axpy") < 0)) __PYX_ERR(41, 2321, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_alpha = values[0]; __pyx_v_x = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("axpy", 1, 2, 2, __pyx_nargs); __PYX_ERR(41, 2321, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.axpy", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(41, 2321, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_238axpy(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_alpha, __pyx_v_x); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_238axpy(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_alpha, struct PyPetscVecObject *__pyx_v_x) { PetscScalar __pyx_v_sval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscScalar __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("axpy", 1); /* "petsc4py/PETSc/Vec.pyx":2338 * * """ * cdef PetscScalar sval = asScalar(alpha) # <<<<<<<<<<<<<< * CHKERR( VecAXPY(self.vec, sval, x.vec) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_alpha); if (unlikely(__pyx_t_1 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(41, 2338, __pyx_L1_error) __pyx_v_sval = __pyx_t_1; /* "petsc4py/PETSc/Vec.pyx":2339 * """ * cdef PetscScalar sval = asScalar(alpha) * CHKERR( VecAXPY(self.vec, sval, x.vec) ) # <<<<<<<<<<<<<< * * def isaxpy(self, IS idx, alpha: Scalar, Vec x) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecAXPY(__pyx_v_self->vec, __pyx_v_sval, __pyx_v_x->vec)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 2339, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":2321 * CHKERR( VecSwap(self.vec, vec.vec) ) * * def axpy(self, alpha: Scalar, Vec x) -> None: # <<<<<<<<<<<<<< * """Compute and store y = x + y. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.axpy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":2341 * CHKERR( VecAXPY(self.vec, sval, x.vec) ) * * def isaxpy(self, IS idx, alpha: Scalar, Vec x) -> None: # <<<<<<<<<<<<<< * """Add a scaled reduced-space vector to a subset of the vector. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_241isaxpy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_240isaxpy, "Vec.isaxpy(self, idx: IS, alpha: Scalar, x: Vec) -> None\nAdd a scaled reduced-space vector to a subset of the vector.\n\n Logically collective.\n\n This is equivalent to ``y[idx[i]] += alpha*x[i]``.\n\n Parameters\n ----------\n idx\n Index set for the reduced space. Negative indices are skipped.\n alpha\n Scale factor.\n x\n Reduced-space vector.\n\n See Also\n --------\n axpy, aypx, axpby, petsc.VecISAXPY\n\n \nSource code at petsc4py/PETSc/Vec.pyx:2341"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_241isaxpy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscISObject *__pyx_v_idx = 0; PyObject *__pyx_v_alpha = 0; struct PyPetscVecObject *__pyx_v_x = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("isaxpy (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_idx,&__pyx_n_s_alpha,&__pyx_n_s_x,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_idx)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 2341, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_alpha)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 2341, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("isaxpy", 1, 3, 3, 1); __PYX_ERR(41, 2341, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 2341, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("isaxpy", 1, 3, 3, 2); __PYX_ERR(41, 2341, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "isaxpy") < 0)) __PYX_ERR(41, 2341, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_idx = ((struct PyPetscISObject *)values[0]); __pyx_v_alpha = values[1]; __pyx_v_x = ((struct PyPetscVecObject *)values[2]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("isaxpy", 1, 3, 3, __pyx_nargs); __PYX_ERR(41, 2341, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.isaxpy", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_idx), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "idx", 0))) __PYX_ERR(41, 2341, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(41, 2341, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_240isaxpy(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_idx, __pyx_v_alpha, __pyx_v_x); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_240isaxpy(struct PyPetscVecObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_idx, PyObject *__pyx_v_alpha, struct PyPetscVecObject *__pyx_v_x) { PetscScalar __pyx_v_sval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscScalar __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("isaxpy", 1); /* "petsc4py/PETSc/Vec.pyx":2362 * * """ * cdef PetscScalar sval = asScalar(alpha) # <<<<<<<<<<<<<< * CHKERR( VecISAXPY(self.vec, idx.iset, sval, x.vec) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_alpha); if (unlikely(__pyx_t_1 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(41, 2362, __pyx_L1_error) __pyx_v_sval = __pyx_t_1; /* "petsc4py/PETSc/Vec.pyx":2363 * """ * cdef PetscScalar sval = asScalar(alpha) * CHKERR( VecISAXPY(self.vec, idx.iset, sval, x.vec) ) # <<<<<<<<<<<<<< * * def aypx(self, alpha: Scalar, Vec x) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecISAXPY(__pyx_v_self->vec, __pyx_v_idx->iset, __pyx_v_sval, __pyx_v_x->vec)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 2363, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":2341 * CHKERR( VecAXPY(self.vec, sval, x.vec) ) * * def isaxpy(self, IS idx, alpha: Scalar, Vec x) -> None: # <<<<<<<<<<<<<< * """Add a scaled reduced-space vector to a subset of the vector. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.isaxpy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":2365 * CHKERR( VecISAXPY(self.vec, idx.iset, sval, x.vec) ) * * def aypx(self, alpha: Scalar, Vec x) -> None: # <<<<<<<<<<<<<< * """Compute and store y = x + y. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_243aypx(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_242aypx, "Vec.aypx(self, alpha: Scalar, x: Vec) -> None\nCompute and store y = x + \311\221\302\267y.\n\n Logically collective.\n\n Parameters\n ----------\n alpha\n Scale factor.\n x\n Input vector, must not be the current vector.\n\n See Also\n --------\n axpy, axpby, petsc.VecAYPX\n\n \nSource code at petsc4py/PETSc/Vec.pyx:2365"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_243aypx(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_alpha = 0; struct PyPetscVecObject *__pyx_v_x = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("aypx (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_alpha,&__pyx_n_s_x,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_alpha)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 2365, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 2365, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("aypx", 1, 2, 2, 1); __PYX_ERR(41, 2365, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "aypx") < 0)) __PYX_ERR(41, 2365, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_alpha = values[0]; __pyx_v_x = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("aypx", 1, 2, 2, __pyx_nargs); __PYX_ERR(41, 2365, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.aypx", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(41, 2365, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_242aypx(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_alpha, __pyx_v_x); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_242aypx(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_alpha, struct PyPetscVecObject *__pyx_v_x) { PetscScalar __pyx_v_sval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscScalar __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("aypx", 1); /* "petsc4py/PETSc/Vec.pyx":2382 * * """ * cdef PetscScalar sval = asScalar(alpha) # <<<<<<<<<<<<<< * CHKERR( VecAYPX(self.vec, sval, x.vec) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_alpha); if (unlikely(__pyx_t_1 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(41, 2382, __pyx_L1_error) __pyx_v_sval = __pyx_t_1; /* "petsc4py/PETSc/Vec.pyx":2383 * """ * cdef PetscScalar sval = asScalar(alpha) * CHKERR( VecAYPX(self.vec, sval, x.vec) ) # <<<<<<<<<<<<<< * * def axpby(self, alpha: Scalar, beta: Scalar, Vec x) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecAYPX(__pyx_v_self->vec, __pyx_v_sval, __pyx_v_x->vec)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 2383, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":2365 * CHKERR( VecISAXPY(self.vec, idx.iset, sval, x.vec) ) * * def aypx(self, alpha: Scalar, Vec x) -> None: # <<<<<<<<<<<<<< * """Compute and store y = x + y. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.aypx", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":2385 * CHKERR( VecAYPX(self.vec, sval, x.vec) ) * * def axpby(self, alpha: Scalar, beta: Scalar, Vec x) -> None: # <<<<<<<<<<<<<< * """Compute and store y = x + y. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_245axpby(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_244axpby, "Vec.axpby(self, alpha: Scalar, beta: Scalar, x: Vec) -> None\nCompute and store y = \311\221\302\267x + \316\262\302\267y.\n\n Logically collective.\n\n Parameters\n ----------\n alpha\n First scale factor.\n beta\n Second scale factor.\n x\n Input vector, must not be the current vector.\n\n See Also\n --------\n axpy, aypx, waxpy, petsc.VecAXPBY\n\n \nSource code at petsc4py/PETSc/Vec.pyx:2385"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_245axpby(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_alpha = 0; PyObject *__pyx_v_beta = 0; struct PyPetscVecObject *__pyx_v_x = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("axpby (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_alpha,&__pyx_n_s_beta,&__pyx_n_s_x,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_alpha)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 2385, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_beta)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 2385, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("axpby", 1, 3, 3, 1); __PYX_ERR(41, 2385, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 2385, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("axpby", 1, 3, 3, 2); __PYX_ERR(41, 2385, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "axpby") < 0)) __PYX_ERR(41, 2385, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_alpha = values[0]; __pyx_v_beta = values[1]; __pyx_v_x = ((struct PyPetscVecObject *)values[2]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("axpby", 1, 3, 3, __pyx_nargs); __PYX_ERR(41, 2385, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.axpby", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(41, 2385, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_244axpby(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_alpha, __pyx_v_beta, __pyx_v_x); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_244axpby(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_alpha, PyObject *__pyx_v_beta, struct PyPetscVecObject *__pyx_v_x) { PetscScalar __pyx_v_sval1; PetscScalar __pyx_v_sval2; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscScalar __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("axpby", 1); /* "petsc4py/PETSc/Vec.pyx":2404 * * """ * cdef PetscScalar sval1 = asScalar(alpha) # <<<<<<<<<<<<<< * cdef PetscScalar sval2 = asScalar(beta) * CHKERR( VecAXPBY(self.vec, sval1, sval2, x.vec) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_alpha); if (unlikely(__pyx_t_1 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(41, 2404, __pyx_L1_error) __pyx_v_sval1 = __pyx_t_1; /* "petsc4py/PETSc/Vec.pyx":2405 * """ * cdef PetscScalar sval1 = asScalar(alpha) * cdef PetscScalar sval2 = asScalar(beta) # <<<<<<<<<<<<<< * CHKERR( VecAXPBY(self.vec, sval1, sval2, x.vec) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_beta); if (unlikely(__pyx_t_1 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(41, 2405, __pyx_L1_error) __pyx_v_sval2 = __pyx_t_1; /* "petsc4py/PETSc/Vec.pyx":2406 * cdef PetscScalar sval1 = asScalar(alpha) * cdef PetscScalar sval2 = asScalar(beta) * CHKERR( VecAXPBY(self.vec, sval1, sval2, x.vec) ) # <<<<<<<<<<<<<< * * def waxpy(self, alpha: Scalar, Vec x, Vec y) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecAXPBY(__pyx_v_self->vec, __pyx_v_sval1, __pyx_v_sval2, __pyx_v_x->vec)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 2406, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":2385 * CHKERR( VecAYPX(self.vec, sval, x.vec) ) * * def axpby(self, alpha: Scalar, beta: Scalar, Vec x) -> None: # <<<<<<<<<<<<<< * """Compute and store y = x + y. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.axpby", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":2408 * CHKERR( VecAXPBY(self.vec, sval1, sval2, x.vec) ) * * def waxpy(self, alpha: Scalar, Vec x, Vec y) -> None: # <<<<<<<<<<<<<< * """Compute and store w = x + y. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_247waxpy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_246waxpy, "Vec.waxpy(self, alpha: Scalar, x: Vec, y: Vec) -> None\nCompute and store w = \311\221\302\267x + y.\n\n Logically collective.\n\n Parameters\n ----------\n alpha\n Scale factor.\n x\n First input vector.\n y\n Second input vector.\n\n See Also\n --------\n axpy, aypx, axpby, maxpy, petsc.VecWAXPY\n\n \nSource code at petsc4py/PETSc/Vec.pyx:2408"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_247waxpy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_alpha = 0; struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_y = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("waxpy (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_alpha,&__pyx_n_s_x,&__pyx_n_s_y,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_alpha)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 2408, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 2408, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("waxpy", 1, 3, 3, 1); __PYX_ERR(41, 2408, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 2408, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("waxpy", 1, 3, 3, 2); __PYX_ERR(41, 2408, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "waxpy") < 0)) __PYX_ERR(41, 2408, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_alpha = values[0]; __pyx_v_x = ((struct PyPetscVecObject *)values[1]); __pyx_v_y = ((struct PyPetscVecObject *)values[2]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("waxpy", 1, 3, 3, __pyx_nargs); __PYX_ERR(41, 2408, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.waxpy", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(41, 2408, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(41, 2408, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_246waxpy(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_alpha, __pyx_v_x, __pyx_v_y); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_246waxpy(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_alpha, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y) { PetscScalar __pyx_v_sval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscScalar __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("waxpy", 1); /* "petsc4py/PETSc/Vec.pyx":2427 * * """ * cdef PetscScalar sval = asScalar(alpha) # <<<<<<<<<<<<<< * CHKERR( VecWAXPY(self.vec, sval, x.vec, y.vec) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_alpha); if (unlikely(__pyx_t_1 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(41, 2427, __pyx_L1_error) __pyx_v_sval = __pyx_t_1; /* "petsc4py/PETSc/Vec.pyx":2428 * """ * cdef PetscScalar sval = asScalar(alpha) * CHKERR( VecWAXPY(self.vec, sval, x.vec, y.vec) ) # <<<<<<<<<<<<<< * * def maxpy(self, alphas: Sequence[Scalar], vecs: Sequence[Vec]) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecWAXPY(__pyx_v_self->vec, __pyx_v_sval, __pyx_v_x->vec, __pyx_v_y->vec)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 2428, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":2408 * CHKERR( VecAXPBY(self.vec, sval1, sval2, x.vec) ) * * def waxpy(self, alpha: Scalar, Vec x, Vec y) -> None: # <<<<<<<<<<<<<< * """Compute and store w = x + y. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.waxpy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":2430 * CHKERR( VecWAXPY(self.vec, sval, x.vec, y.vec) ) * * def maxpy(self, alphas: Sequence[Scalar], vecs: Sequence[Vec]) -> None: # <<<<<<<<<<<<<< * """Compute and store y = (X) + y with X an array of vectors. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_249maxpy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_248maxpy, "Vec.maxpy(self, alphas: Sequence[Scalar], vecs: Sequence[Vec]) -> None\nCompute and store y = \316\243\342\202\231(\311\221\342\202\231\302\267X\342\202\231) + y with X an array of vectors.\n\n Logically collective.\n\n Equivalent to ``y[:] = alphas[i]*vecs[i, :] + y[:]``.\n\n Parameters\n ----------\n alphas\n Array of scale factors, one for each vector in ``vecs``.\n vecs\n Array of vectors.\n\n See Also\n --------\n axpy, aypx, axpby, waxpy, petsc.VecMAXPY\n\n \nSource code at petsc4py/PETSc/Vec.pyx:2430"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_249maxpy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_alphas = 0; PyObject *__pyx_v_vecs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("maxpy (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_alphas,&__pyx_n_s_vecs,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_alphas)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 2430, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vecs)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 2430, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("maxpy", 1, 2, 2, 1); __PYX_ERR(41, 2430, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "maxpy") < 0)) __PYX_ERR(41, 2430, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_alphas = values[0]; __pyx_v_vecs = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("maxpy", 1, 2, 2, __pyx_nargs); __PYX_ERR(41, 2430, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.maxpy", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_248maxpy(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_alphas, __pyx_v_vecs); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_248maxpy(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_alphas, PyObject *__pyx_v_vecs) { PetscInt __pyx_v_n; PetscScalar *__pyx_v_a; Vec *__pyx_v_v; CYTHON_UNUSED PyObject *__pyx_v_tmp1 = 0; CYTHON_UNUSED PyObject *__pyx_v_tmp2 = 0; Py_ssize_t __pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; int __pyx_t_4; PetscInt __pyx_t_5; Vec __pyx_t_6; PetscErrorCode __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("maxpy", 1); /* "petsc4py/PETSc/Vec.pyx":2449 * * """ * cdef PetscInt n = 0 # <<<<<<<<<<<<<< * cdef PetscScalar *a = NULL * cdef PetscVec *v = NULL */ __pyx_v_n = 0; /* "petsc4py/PETSc/Vec.pyx":2450 * """ * cdef PetscInt n = 0 * cdef PetscScalar *a = NULL # <<<<<<<<<<<<<< * cdef PetscVec *v = NULL * cdef object tmp1 = iarray_s(alphas, &n, &a) */ __pyx_v_a = NULL; /* "petsc4py/PETSc/Vec.pyx":2451 * cdef PetscInt n = 0 * cdef PetscScalar *a = NULL * cdef PetscVec *v = NULL # <<<<<<<<<<<<<< * cdef object tmp1 = iarray_s(alphas, &n, &a) * cdef object tmp2 = oarray_p(empty_p(n),NULL, &v) */ __pyx_v_v = NULL; /* "petsc4py/PETSc/Vec.pyx":2452 * cdef PetscScalar *a = NULL * cdef PetscVec *v = NULL * cdef object tmp1 = iarray_s(alphas, &n, &a) # <<<<<<<<<<<<<< * cdef object tmp2 = oarray_p(empty_p(n),NULL, &v) * assert n == len(vecs) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_s(__pyx_v_alphas, (&__pyx_v_n), (&__pyx_v_a))); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 2452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_tmp1 = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/Vec.pyx":2453 * cdef PetscVec *v = NULL * cdef object tmp1 = iarray_s(alphas, &n, &a) * cdef object tmp2 = oarray_p(empty_p(n),NULL, &v) # <<<<<<<<<<<<<< * assert n == len(vecs) * cdef Py_ssize_t i=0 */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_n)); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 2453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_1, NULL, ((void **)(&__pyx_v_v)))); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 2453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_tmp2 = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/Vec.pyx":2454 * cdef object tmp1 = iarray_s(alphas, &n, &a) * cdef object tmp2 = oarray_p(empty_p(n),NULL, &v) * assert n == len(vecs) # <<<<<<<<<<<<<< * cdef Py_ssize_t i=0 * for i from 0 <= i < n: */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_3 = PyObject_Length(__pyx_v_vecs); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(41, 2454, __pyx_L1_error) __pyx_t_4 = (__pyx_v_n == __pyx_t_3); if (unlikely(!__pyx_t_4)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(41, 2454, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(41, 2454, __pyx_L1_error) #endif /* "petsc4py/PETSc/Vec.pyx":2455 * cdef object tmp2 = oarray_p(empty_p(n),NULL, &v) * assert n == len(vecs) * cdef Py_ssize_t i=0 # <<<<<<<<<<<<<< * for i from 0 <= i < n: * v[i] = ((vecs[i])).vec */ __pyx_v_i = 0; /* "petsc4py/PETSc/Vec.pyx":2456 * assert n == len(vecs) * cdef Py_ssize_t i=0 * for i from 0 <= i < n: # <<<<<<<<<<<<<< * v[i] = ((vecs[i])).vec * CHKERR( VecMAXPY(self.vec, n, a, v) ) */ __pyx_t_5 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) { /* "petsc4py/PETSc/Vec.pyx":2457 * cdef Py_ssize_t i=0 * for i from 0 <= i < n: * v[i] = ((vecs[i])).vec # <<<<<<<<<<<<<< * CHKERR( VecMAXPY(self.vec, n, a, v) ) * */ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_vecs, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 2457, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (!(likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_Vec)))) __PYX_ERR(41, 2457, __pyx_L1_error) __pyx_t_6 = ((struct PyPetscVecObject *)__pyx_t_2)->vec; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; (__pyx_v_v[__pyx_v_i]) = __pyx_t_6; } /* "petsc4py/PETSc/Vec.pyx":2458 * for i from 0 <= i < n: * v[i] = ((vecs[i])).vec * CHKERR( VecMAXPY(self.vec, n, a, v) ) # <<<<<<<<<<<<<< * * def pointwiseMult(self, Vec x, Vec y) -> None: */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecMAXPY(__pyx_v_self->vec, __pyx_v_n, __pyx_v_a, __pyx_v_v)); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 2458, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":2430 * CHKERR( VecWAXPY(self.vec, sval, x.vec, y.vec) ) * * def maxpy(self, alphas: Sequence[Scalar], vecs: Sequence[Vec]) -> None: # <<<<<<<<<<<<<< * """Compute and store y = (X) + y with X an array of vectors. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Vec.maxpy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_tmp1); __Pyx_XDECREF(__pyx_v_tmp2); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":2460 * CHKERR( VecMAXPY(self.vec, n, a, v) ) * * def pointwiseMult(self, Vec x, Vec y) -> None: # <<<<<<<<<<<<<< * """Compute and store the component-wise multiplication of two vectors. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_251pointwiseMult(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_250pointwiseMult, "Vec.pointwiseMult(self, x: Vec, y: Vec) -> None\nCompute and store the component-wise multiplication of two vectors.\n\n Logically collective.\n\n Equivalent to ``w[i] = x[i] * y[i]``.\n\n Parameters\n ----------\n x, y\n Input vectors to multiply component-wise.\n\n See Also\n --------\n pointwiseDivide, petsc.VecPointwiseMult\n\n \nSource code at petsc4py/PETSc/Vec.pyx:2460"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_251pointwiseMult(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_y = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pointwiseMult (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 2460, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 2460, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("pointwiseMult", 1, 2, 2, 1); __PYX_ERR(41, 2460, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "pointwiseMult") < 0)) __PYX_ERR(41, 2460, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_x = ((struct PyPetscVecObject *)values[0]); __pyx_v_y = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("pointwiseMult", 1, 2, 2, __pyx_nargs); __PYX_ERR(41, 2460, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.pointwiseMult", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(41, 2460, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(41, 2460, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_250pointwiseMult(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_x, __pyx_v_y); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_250pointwiseMult(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pointwiseMult", 1); /* "petsc4py/PETSc/Vec.pyx":2477 * * """ * CHKERR( VecPointwiseMult(self.vec, x.vec, y.vec) ) # <<<<<<<<<<<<<< * * def pointwiseDivide(self, Vec x, Vec y) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecPointwiseMult(__pyx_v_self->vec, __pyx_v_x->vec, __pyx_v_y->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 2477, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":2460 * CHKERR( VecMAXPY(self.vec, n, a, v) ) * * def pointwiseMult(self, Vec x, Vec y) -> None: # <<<<<<<<<<<<<< * """Compute and store the component-wise multiplication of two vectors. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.pointwiseMult", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":2479 * CHKERR( VecPointwiseMult(self.vec, x.vec, y.vec) ) * * def pointwiseDivide(self, Vec x, Vec y) -> None: # <<<<<<<<<<<<<< * """Compute and store the component-wise division of two vectors. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_253pointwiseDivide(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_252pointwiseDivide, "Vec.pointwiseDivide(self, x: Vec, y: Vec) -> None\nCompute and store the component-wise division of two vectors.\n\n Logically collective.\n\n Equivalent to ``w[i] = x[i] / y[i]``.\n\n Parameters\n ----------\n x\n Numerator vector.\n y\n Denominator vector.\n\n See Also\n --------\n pointwiseMult, petsc.VecPointwiseDivide\n\n \nSource code at petsc4py/PETSc/Vec.pyx:2479"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_253pointwiseDivide(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_y = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pointwiseDivide (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 2479, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 2479, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("pointwiseDivide", 1, 2, 2, 1); __PYX_ERR(41, 2479, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "pointwiseDivide") < 0)) __PYX_ERR(41, 2479, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_x = ((struct PyPetscVecObject *)values[0]); __pyx_v_y = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("pointwiseDivide", 1, 2, 2, __pyx_nargs); __PYX_ERR(41, 2479, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.pointwiseDivide", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(41, 2479, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(41, 2479, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_252pointwiseDivide(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_x, __pyx_v_y); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_252pointwiseDivide(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pointwiseDivide", 1); /* "petsc4py/PETSc/Vec.pyx":2498 * * """ * CHKERR( VecPointwiseDivide(self.vec, x.vec, y.vec) ) # <<<<<<<<<<<<<< * * def pointwiseMin(self, Vec x, Vec y) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecPointwiseDivide(__pyx_v_self->vec, __pyx_v_x->vec, __pyx_v_y->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 2498, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":2479 * CHKERR( VecPointwiseMult(self.vec, x.vec, y.vec) ) * * def pointwiseDivide(self, Vec x, Vec y) -> None: # <<<<<<<<<<<<<< * """Compute and store the component-wise division of two vectors. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.pointwiseDivide", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":2500 * CHKERR( VecPointwiseDivide(self.vec, x.vec, y.vec) ) * * def pointwiseMin(self, Vec x, Vec y) -> None: # <<<<<<<<<<<<<< * """Compute and store the component-wise minimum of two vectors. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_255pointwiseMin(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_254pointwiseMin, "Vec.pointwiseMin(self, x: Vec, y: Vec) -> None\nCompute and store the component-wise minimum of two vectors.\n\n Logically collective.\n\n Equivalent to ``w[i] = min(x[i], y[i])``.\n\n Parameters\n ----------\n x, y\n Input vectors to find the component-wise minima.\n\n See Also\n --------\n pointwiseMax, pointwiseMaxAbs, petsc.VecPointwiseMin\n\n \nSource code at petsc4py/PETSc/Vec.pyx:2500"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_255pointwiseMin(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_y = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pointwiseMin (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 2500, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 2500, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("pointwiseMin", 1, 2, 2, 1); __PYX_ERR(41, 2500, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "pointwiseMin") < 0)) __PYX_ERR(41, 2500, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_x = ((struct PyPetscVecObject *)values[0]); __pyx_v_y = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("pointwiseMin", 1, 2, 2, __pyx_nargs); __PYX_ERR(41, 2500, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.pointwiseMin", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(41, 2500, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(41, 2500, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_254pointwiseMin(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_x, __pyx_v_y); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_254pointwiseMin(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pointwiseMin", 1); /* "petsc4py/PETSc/Vec.pyx":2517 * * """ * CHKERR( VecPointwiseMin(self.vec, x.vec, y.vec) ) # <<<<<<<<<<<<<< * * def pointwiseMax(self, Vec x, Vec y) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecPointwiseMin(__pyx_v_self->vec, __pyx_v_x->vec, __pyx_v_y->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 2517, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":2500 * CHKERR( VecPointwiseDivide(self.vec, x.vec, y.vec) ) * * def pointwiseMin(self, Vec x, Vec y) -> None: # <<<<<<<<<<<<<< * """Compute and store the component-wise minimum of two vectors. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.pointwiseMin", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":2519 * CHKERR( VecPointwiseMin(self.vec, x.vec, y.vec) ) * * def pointwiseMax(self, Vec x, Vec y) -> None: # <<<<<<<<<<<<<< * """Compute and store the component-wise maximum of two vectors. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_257pointwiseMax(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_256pointwiseMax, "Vec.pointwiseMax(self, x: Vec, y: Vec) -> None\nCompute and store the component-wise maximum of two vectors.\n\n Logically collective.\n\n Equivalent to ``w[i] = max(x[i], y[i])``.\n\n Parameters\n ----------\n x, y\n Input vectors to find the component-wise maxima.\n\n See Also\n --------\n pointwiseMin, pointwiseMaxAbs, petsc.VecPointwiseMax\n\n \nSource code at petsc4py/PETSc/Vec.pyx:2519"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_257pointwiseMax(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_y = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pointwiseMax (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 2519, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 2519, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("pointwiseMax", 1, 2, 2, 1); __PYX_ERR(41, 2519, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "pointwiseMax") < 0)) __PYX_ERR(41, 2519, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_x = ((struct PyPetscVecObject *)values[0]); __pyx_v_y = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("pointwiseMax", 1, 2, 2, __pyx_nargs); __PYX_ERR(41, 2519, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.pointwiseMax", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(41, 2519, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(41, 2519, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_256pointwiseMax(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_x, __pyx_v_y); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_256pointwiseMax(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pointwiseMax", 1); /* "petsc4py/PETSc/Vec.pyx":2536 * * """ * CHKERR( VecPointwiseMax(self.vec, x.vec, y.vec) ) # <<<<<<<<<<<<<< * * def pointwiseMaxAbs(self, Vec x, Vec y) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecPointwiseMax(__pyx_v_self->vec, __pyx_v_x->vec, __pyx_v_y->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 2536, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":2519 * CHKERR( VecPointwiseMin(self.vec, x.vec, y.vec) ) * * def pointwiseMax(self, Vec x, Vec y) -> None: # <<<<<<<<<<<<<< * """Compute and store the component-wise maximum of two vectors. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.pointwiseMax", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":2538 * CHKERR( VecPointwiseMax(self.vec, x.vec, y.vec) ) * * def pointwiseMaxAbs(self, Vec x, Vec y) -> None: # <<<<<<<<<<<<<< * """Compute and store the component-wise maximum absolute values. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_259pointwiseMaxAbs(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_258pointwiseMaxAbs, "Vec.pointwiseMaxAbs(self, x: Vec, y: Vec) -> None\nCompute and store the component-wise maximum absolute values.\n\n Logically collective.\n\n Equivalent to ``w[i] = max(abs(x[i]), abs(y[i]))``.\n\n Parameters\n ----------\n x, y\n Input vectors to find the component-wise maxima.\n\n See Also\n --------\n pointwiseMin, pointwiseMax, petsc.VecPointwiseMaxAbs\n\n \nSource code at petsc4py/PETSc/Vec.pyx:2538"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_259pointwiseMaxAbs(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_y = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pointwiseMaxAbs (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 2538, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 2538, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("pointwiseMaxAbs", 1, 2, 2, 1); __PYX_ERR(41, 2538, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "pointwiseMaxAbs") < 0)) __PYX_ERR(41, 2538, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_x = ((struct PyPetscVecObject *)values[0]); __pyx_v_y = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("pointwiseMaxAbs", 1, 2, 2, __pyx_nargs); __PYX_ERR(41, 2538, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.pointwiseMaxAbs", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(41, 2538, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(41, 2538, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_258pointwiseMaxAbs(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_x, __pyx_v_y); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_258pointwiseMaxAbs(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pointwiseMaxAbs", 1); /* "petsc4py/PETSc/Vec.pyx":2555 * * """ * CHKERR( VecPointwiseMaxAbs(self.vec, x.vec, y.vec) ) # <<<<<<<<<<<<<< * * def maxPointwiseDivide(self, Vec vec) -> float: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecPointwiseMaxAbs(__pyx_v_self->vec, __pyx_v_x->vec, __pyx_v_y->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 2555, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":2538 * CHKERR( VecPointwiseMax(self.vec, x.vec, y.vec) ) * * def pointwiseMaxAbs(self, Vec x, Vec y) -> None: # <<<<<<<<<<<<<< * """Compute and store the component-wise maximum absolute values. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.pointwiseMaxAbs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":2557 * CHKERR( VecPointwiseMaxAbs(self.vec, x.vec, y.vec) ) * * def maxPointwiseDivide(self, Vec vec) -> float: # <<<<<<<<<<<<<< * """Return the maximum of the component-wise absolute value division. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_261maxPointwiseDivide(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_260maxPointwiseDivide, "Vec.maxPointwiseDivide(self, vec: Vec) -> float\nReturn the maximum of the component-wise absolute value division.\n\n Logically collective.\n\n Equivalent to ``result = max_i abs(x[i] / y[i])``.\n\n Parameters\n ----------\n x\n Numerator vector.\n y\n Denominator vector.\n\n See Also\n --------\n pointwiseMin, pointwiseMax, pointwiseMaxAbs\n petsc.VecMaxPointwiseDivide\n\n \nSource code at petsc4py/PETSc/Vec.pyx:2557"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_261maxPointwiseDivide(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_vec = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("maxPointwiseDivide (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vec)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 2557, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "maxPointwiseDivide") < 0)) __PYX_ERR(41, 2557, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_vec = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("maxPointwiseDivide", 1, 1, 1, __pyx_nargs); __PYX_ERR(41, 2557, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.maxPointwiseDivide", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(41, 2557, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_260maxPointwiseDivide(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_vec); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_260maxPointwiseDivide(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec) { PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("maxPointwiseDivide", 1); /* "petsc4py/PETSc/Vec.pyx":2577 * * """ * cdef PetscReal rval = 0 # <<<<<<<<<<<<<< * CHKERR( VecMaxPointwiseDivide(self.vec, vec.vec, &rval) ) * return toReal(rval) */ __pyx_v_rval = 0.0; /* "petsc4py/PETSc/Vec.pyx":2578 * """ * cdef PetscReal rval = 0 * CHKERR( VecMaxPointwiseDivide(self.vec, vec.vec, &rval) ) # <<<<<<<<<<<<<< * return toReal(rval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecMaxPointwiseDivide(__pyx_v_self->vec, __pyx_v_vec->vec, (&__pyx_v_rval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 2578, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":2579 * cdef PetscReal rval = 0 * CHKERR( VecMaxPointwiseDivide(self.vec, vec.vec, &rval) ) * return toReal(rval) # <<<<<<<<<<<<<< * * def getValue(self, index: int) -> Scalar: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_rval); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 2579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":2557 * CHKERR( VecPointwiseMaxAbs(self.vec, x.vec, y.vec) ) * * def maxPointwiseDivide(self, Vec vec) -> float: # <<<<<<<<<<<<<< * """Return the maximum of the component-wise absolute value division. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Vec.maxPointwiseDivide", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":2581 * return toReal(rval) * * def getValue(self, index: int) -> Scalar: # <<<<<<<<<<<<<< * """Return a single value from the vector. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_263getValue(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_262getValue, "Vec.getValue(self, index: int) -> Scalar\nReturn a single value from the vector.\n\n Not collective.\n\n Only values locally stored may be accessed.\n\n Parameters\n ----------\n index\n Location of the value to read.\n\n See Also\n --------\n getValues, petsc.VecGetValues\n\n \nSource code at petsc4py/PETSc/Vec.pyx:2581"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_263getValue(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_index = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getValue (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_index)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 2581, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getValue") < 0)) __PYX_ERR(41, 2581, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_index = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getValue", 1, 1, 1, __pyx_nargs); __PYX_ERR(41, 2581, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.getValue", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_262getValue(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_index); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_262getValue(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_index) { PetscInt __pyx_v_ival; PetscScalar __pyx_v_sval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getValue", 1); /* "petsc4py/PETSc/Vec.pyx":2598 * * """ * cdef PetscInt ival = asInt(index) # <<<<<<<<<<<<<< * cdef PetscScalar sval = 0 * CHKERR( VecGetValues(self.vec, 1, &ival, &sval) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_index); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(41, 2598, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "petsc4py/PETSc/Vec.pyx":2599 * """ * cdef PetscInt ival = asInt(index) * cdef PetscScalar sval = 0 # <<<<<<<<<<<<<< * CHKERR( VecGetValues(self.vec, 1, &ival, &sval) ) * return toScalar(sval) */ __pyx_v_sval = 0.0; /* "petsc4py/PETSc/Vec.pyx":2600 * cdef PetscInt ival = asInt(index) * cdef PetscScalar sval = 0 * CHKERR( VecGetValues(self.vec, 1, &ival, &sval) ) # <<<<<<<<<<<<<< * return toScalar(sval) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetValues(__pyx_v_self->vec, 1, (&__pyx_v_ival), (&__pyx_v_sval))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 2600, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":2601 * cdef PetscScalar sval = 0 * CHKERR( VecGetValues(self.vec, 1, &ival, &sval) ) * return toScalar(sval) # <<<<<<<<<<<<<< * * def getValues( */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toScalar(__pyx_v_sval); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 2601, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":2581 * return toReal(rval) * * def getValue(self, index: int) -> Scalar: # <<<<<<<<<<<<<< * """Return a single value from the vector. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Vec.getValue", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":2603 * return toScalar(sval) * * def getValues( # <<<<<<<<<<<<<< * self, * indices: Sequence[int], */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_265getValues(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_264getValues, "Vec.getValues(self, indices: Sequence[int], values: Sequence[Scalar] | None = None) -> ArrayScalar\nReturn values from certain locations in the vector.\n\n Not collective.\n\n Only values locally stored may be accessed.\n\n Parameters\n ----------\n indices\n Locations of the values to read.\n values\n Location to store the collected values. If not provided then a new\n array will be allocated.\n\n See Also\n --------\n getValue, setValues, petsc.VecGetValues\n\n \nSource code at petsc4py/PETSc/Vec.pyx:2603"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_265getValues(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_indices = 0; PyObject *__pyx_v_values = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getValues (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_indices,&__pyx_n_s_values,0}; /* "petsc4py/PETSc/Vec.pyx":2606 * self, * indices: Sequence[int], * values: Sequence[Scalar] | None = None, # <<<<<<<<<<<<<< * ) -> ArrayScalar: * """Return values from certain locations in the vector. */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_indices)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 2603, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_values); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 2603, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getValues") < 0)) __PYX_ERR(41, 2603, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_indices = values[0]; __pyx_v_values = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getValues", 0, 1, 2, __pyx_nargs); __PYX_ERR(41, 2603, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.getValues", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_264getValues(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_indices, __pyx_v_values); /* "petsc4py/PETSc/Vec.pyx":2603 * return toScalar(sval) * * def getValues( # <<<<<<<<<<<<<< * self, * indices: Sequence[int], */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_264getValues(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_values) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getValues", 1); /* "petsc4py/PETSc/Vec.pyx":2627 * * """ * return vecgetvalues(self.vec, indices, values) # <<<<<<<<<<<<<< * * def getValuesStagStencil(self, indices, values=None) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_vecgetvalues(__pyx_v_self->vec, __pyx_v_indices, __pyx_v_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 2627, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":2603 * return toScalar(sval) * * def getValues( # <<<<<<<<<<<<<< * self, * indices: Sequence[int], */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Vec.getValues", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":2629 * return vecgetvalues(self.vec, indices, values) * * def getValuesStagStencil(self, indices, values=None) -> None: # <<<<<<<<<<<<<< * """Not implemented.""" * raise NotImplementedError */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_267getValuesStagStencil(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_266getValuesStagStencil, "Vec.getValuesStagStencil(self, indices, values=None) -> None\nNot implemented.\nSource code at petsc4py/PETSc/Vec.pyx:2629"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_267getValuesStagStencil(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v_indices = 0; CYTHON_UNUSED PyObject *__pyx_v_values = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getValuesStagStencil (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_indices,&__pyx_n_s_values,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_indices)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 2629, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_values); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 2629, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getValuesStagStencil") < 0)) __PYX_ERR(41, 2629, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_indices = values[0]; __pyx_v_values = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getValuesStagStencil", 0, 1, 2, __pyx_nargs); __PYX_ERR(41, 2629, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.getValuesStagStencil", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_266getValuesStagStencil(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_indices, __pyx_v_values); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_266getValuesStagStencil(CYTHON_UNUSED struct PyPetscVecObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_indices, CYTHON_UNUSED PyObject *__pyx_v_values) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getValuesStagStencil", 1); /* "petsc4py/PETSc/Vec.pyx":2631 * def getValuesStagStencil(self, indices, values=None) -> None: * """Not implemented.""" * raise NotImplementedError # <<<<<<<<<<<<<< * * def setValue( */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); __PYX_ERR(41, 2631, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":2629 * return vecgetvalues(self.vec, indices, values) * * def getValuesStagStencil(self, indices, values=None) -> None: # <<<<<<<<<<<<<< * """Not implemented.""" * raise NotImplementedError */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.getValuesStagStencil", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":2633 * raise NotImplementedError * * def setValue( # <<<<<<<<<<<<<< * self, * index: int, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_269setValue(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_268setValue, "Vec.setValue(self, index: int, value: Scalar, addv: InsertModeSpec = None) -> None\nInsert or add a single value in the vector.\n\n Not collective.\n\n Parameters\n ----------\n index\n Location to write to. Negative indices are ignored.\n value\n Value to insert at ``index``.\n addv\n Insertion mode.\n\n Notes\n -----\n The values may be cached so `assemblyBegin` and `assemblyEnd`\n must be called after all calls of this method are completed.\n\n Multiple calls to `setValue` cannot be made with different values\n for ``addv`` without intermediate calls to `assemblyBegin` and\n `assemblyEnd`.\n\n See Also\n --------\n setValues, petsc.VecSetValues\n\n \nSource code at petsc4py/PETSc/Vec.pyx:2633"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_269setValue(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_index = 0; PyObject *__pyx_v_value = 0; PyObject *__pyx_v_addv = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setValue (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_value,&__pyx_n_s_addv,0}; /* "petsc4py/PETSc/Vec.pyx":2637 * index: int, * value: Scalar, * addv: InsertModeSpec = None, # <<<<<<<<<<<<<< * ) -> None: * """Insert or add a single value in the vector. */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_index)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 2633, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 2633, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setValue", 0, 2, 3, 1); __PYX_ERR(41, 2633, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_addv); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 2633, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setValue") < 0)) __PYX_ERR(41, 2633, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_index = values[0]; __pyx_v_value = values[1]; __pyx_v_addv = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setValue", 0, 2, 3, __pyx_nargs); __PYX_ERR(41, 2633, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.setValue", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_268setValue(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_index, __pyx_v_value, __pyx_v_addv); /* "petsc4py/PETSc/Vec.pyx":2633 * raise NotImplementedError * * def setValue( # <<<<<<<<<<<<<< * self, * index: int, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_268setValue(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value, PyObject *__pyx_v_addv) { PetscInt __pyx_v_ival; PetscScalar __pyx_v_sval; InsertMode __pyx_v_caddv; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscScalar __pyx_t_2; InsertMode __pyx_t_3; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setValue", 1); /* "petsc4py/PETSc/Vec.pyx":2666 * * """ * cdef PetscInt ival = asInt(index) # <<<<<<<<<<<<<< * cdef PetscScalar sval = asScalar(value) * cdef PetscInsertMode caddv = insertmode(addv) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_index); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(41, 2666, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "petsc4py/PETSc/Vec.pyx":2667 * """ * cdef PetscInt ival = asInt(index) * cdef PetscScalar sval = asScalar(value) # <<<<<<<<<<<<<< * cdef PetscInsertMode caddv = insertmode(addv) * CHKERR( VecSetValues(self.vec, 1, &ival, &sval, caddv) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_value); if (unlikely(__pyx_t_2 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(41, 2667, __pyx_L1_error) __pyx_v_sval = __pyx_t_2; /* "petsc4py/PETSc/Vec.pyx":2668 * cdef PetscInt ival = asInt(index) * cdef PetscScalar sval = asScalar(value) * cdef PetscInsertMode caddv = insertmode(addv) # <<<<<<<<<<<<<< * CHKERR( VecSetValues(self.vec, 1, &ival, &sval, caddv) ) * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_insertmode(__pyx_v_addv); if (unlikely(__pyx_t_3 == ((InsertMode)((InsertMode)-1L)))) __PYX_ERR(41, 2668, __pyx_L1_error) __pyx_v_caddv = __pyx_t_3; /* "petsc4py/PETSc/Vec.pyx":2669 * cdef PetscScalar sval = asScalar(value) * cdef PetscInsertMode caddv = insertmode(addv) * CHKERR( VecSetValues(self.vec, 1, &ival, &sval, caddv) ) # <<<<<<<<<<<<<< * * def setValues( */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecSetValues(__pyx_v_self->vec, 1, (&__pyx_v_ival), (&__pyx_v_sval), __pyx_v_caddv)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 2669, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":2633 * raise NotImplementedError * * def setValue( # <<<<<<<<<<<<<< * self, * index: int, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.setValue", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":2671 * CHKERR( VecSetValues(self.vec, 1, &ival, &sval, caddv) ) * * def setValues( # <<<<<<<<<<<<<< * self, * indices: Sequence[int], */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_271setValues(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_270setValues, "Vec.setValues(self, indices: Sequence[int], values: Sequence[Scalar], addv: InsertModeSpec = None) -> None\nInsert or add multiple values in the vector.\n\n Not collective.\n\n Parameters\n ----------\n indices\n Locations to write to. Negative indices are ignored.\n values\n Values to insert at ``indices``.\n addv\n Insertion mode.\n\n Notes\n -----\n The values may be cached so `assemblyBegin` and `assemblyEnd`\n must be called after all calls of this method are completed.\n\n Multiple calls to `setValues` cannot be made with different values\n for ``addv`` without intermediate calls to `assemblyBegin` and\n `assemblyEnd`.\n\n See Also\n --------\n setValue, petsc.VecSetValues\n\n \nSource code at petsc4py/PETSc/Vec.pyx:2671"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_271setValues(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_indices = 0; PyObject *__pyx_v_values = 0; PyObject *__pyx_v_addv = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setValues (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_indices,&__pyx_n_s_values,&__pyx_n_s_addv,0}; /* "petsc4py/PETSc/Vec.pyx":2675 * indices: Sequence[int], * values: Sequence[Scalar], * addv: InsertModeSpec = None, # <<<<<<<<<<<<<< * ) -> None: * """Insert or add multiple values in the vector. */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_indices)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 2671, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_values)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 2671, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setValues", 0, 2, 3, 1); __PYX_ERR(41, 2671, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_addv); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 2671, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setValues") < 0)) __PYX_ERR(41, 2671, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_indices = values[0]; __pyx_v_values = values[1]; __pyx_v_addv = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setValues", 0, 2, 3, __pyx_nargs); __PYX_ERR(41, 2671, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.setValues", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_270setValues(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_indices, __pyx_v_values, __pyx_v_addv); /* "petsc4py/PETSc/Vec.pyx":2671 * CHKERR( VecSetValues(self.vec, 1, &ival, &sval, caddv) ) * * def setValues( # <<<<<<<<<<<<<< * self, * indices: Sequence[int], */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_270setValues(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_values, PyObject *__pyx_v_addv) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setValues", 1); /* "petsc4py/PETSc/Vec.pyx":2704 * * """ * vecsetvalues(self.vec, indices, values, addv, 0, 0) # <<<<<<<<<<<<<< * * def setValuesBlocked( */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_vecsetvalues(__pyx_v_self->vec, __pyx_v_indices, __pyx_v_values, __pyx_v_addv, 0, 0); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(41, 2704, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":2671 * CHKERR( VecSetValues(self.vec, 1, &ival, &sval, caddv) ) * * def setValues( # <<<<<<<<<<<<<< * self, * indices: Sequence[int], */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.setValues", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":2706 * vecsetvalues(self.vec, indices, values, addv, 0, 0) * * def setValuesBlocked( # <<<<<<<<<<<<<< * self, * indices: Sequence[int], */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_273setValuesBlocked(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_272setValuesBlocked, "Vec.setValuesBlocked(self, indices: Sequence[int], values: Sequence[Scalar], addv: InsertModeSpec = None) -> None\nInsert or add blocks of values in the vector.\n\n Not collective.\n\n Equivalent to ``x[bs*indices[i]+j] = y[bs*i+j]`` for\n ``0 <= i < len(indices)``, ``0 <= j < bs`` and ``bs`` `block_size`.\n\n Parameters\n ----------\n indices\n Block indices to write to. Negative indices are ignored.\n values\n Values to insert at ``indices``. Should have length\n ``len(indices) * vec.block_size``.\n addv\n Insertion mode.\n\n Notes\n -----\n The values may be cached so `assemblyBegin` and `assemblyEnd`\n must be called after all calls of this method are completed.\n\n Multiple calls to `setValuesBlocked` cannot be made with different\n values for ``addv`` without intermediate calls to `assemblyBegin`\n and `assemblyEnd`.\n\n See Also\n --------\n setValues, petsc.VecSetValuesBlocked\n\n \nSource code at petsc4py/PETSc/Vec.pyx:2706"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_273setValuesBlocked(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_indices = 0; PyObject *__pyx_v_values = 0; PyObject *__pyx_v_addv = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setValuesBlocked (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_indices,&__pyx_n_s_values,&__pyx_n_s_addv,0}; /* "petsc4py/PETSc/Vec.pyx":2710 * indices: Sequence[int], * values: Sequence[Scalar], * addv: InsertModeSpec = None, # <<<<<<<<<<<<<< * ) -> None: * """Insert or add blocks of values in the vector. */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_indices)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 2706, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_values)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 2706, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setValuesBlocked", 0, 2, 3, 1); __PYX_ERR(41, 2706, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_addv); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 2706, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setValuesBlocked") < 0)) __PYX_ERR(41, 2706, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_indices = values[0]; __pyx_v_values = values[1]; __pyx_v_addv = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setValuesBlocked", 0, 2, 3, __pyx_nargs); __PYX_ERR(41, 2706, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.setValuesBlocked", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_272setValuesBlocked(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_indices, __pyx_v_values, __pyx_v_addv); /* "petsc4py/PETSc/Vec.pyx":2706 * vecsetvalues(self.vec, indices, values, addv, 0, 0) * * def setValuesBlocked( # <<<<<<<<<<<<<< * self, * indices: Sequence[int], */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_272setValuesBlocked(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_values, PyObject *__pyx_v_addv) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setValuesBlocked", 1); /* "petsc4py/PETSc/Vec.pyx":2743 * * """ * vecsetvalues(self.vec, indices, values, addv, 1, 0) # <<<<<<<<<<<<<< * * def setValuesStagStencil(self, indices, values, addv=None) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_vecsetvalues(__pyx_v_self->vec, __pyx_v_indices, __pyx_v_values, __pyx_v_addv, 1, 0); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(41, 2743, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":2706 * vecsetvalues(self.vec, indices, values, addv, 0, 0) * * def setValuesBlocked( # <<<<<<<<<<<<<< * self, * indices: Sequence[int], */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.setValuesBlocked", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":2745 * vecsetvalues(self.vec, indices, values, addv, 1, 0) * * def setValuesStagStencil(self, indices, values, addv=None) -> None: # <<<<<<<<<<<<<< * """Not implemented.""" * raise NotImplementedError */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_275setValuesStagStencil(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_274setValuesStagStencil, "Vec.setValuesStagStencil(self, indices, values, addv=None) -> None\nNot implemented.\nSource code at petsc4py/PETSc/Vec.pyx:2745"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_275setValuesStagStencil(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v_indices = 0; CYTHON_UNUSED PyObject *__pyx_v_values = 0; CYTHON_UNUSED PyObject *__pyx_v_addv = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setValuesStagStencil (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_indices,&__pyx_n_s_values,&__pyx_n_s_addv,0}; values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_indices)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 2745, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_values)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 2745, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setValuesStagStencil", 0, 2, 3, 1); __PYX_ERR(41, 2745, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_addv); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 2745, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setValuesStagStencil") < 0)) __PYX_ERR(41, 2745, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_indices = values[0]; __pyx_v_values = values[1]; __pyx_v_addv = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setValuesStagStencil", 0, 2, 3, __pyx_nargs); __PYX_ERR(41, 2745, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.setValuesStagStencil", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_274setValuesStagStencil(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_indices, __pyx_v_values, __pyx_v_addv); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_274setValuesStagStencil(CYTHON_UNUSED struct PyPetscVecObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_indices, CYTHON_UNUSED PyObject *__pyx_v_values, CYTHON_UNUSED PyObject *__pyx_v_addv) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setValuesStagStencil", 1); /* "petsc4py/PETSc/Vec.pyx":2747 * def setValuesStagStencil(self, indices, values, addv=None) -> None: * """Not implemented.""" * raise NotImplementedError # <<<<<<<<<<<<<< * * def setLGMap(self, LGMap lgmap) -> None: */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); __PYX_ERR(41, 2747, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":2745 * vecsetvalues(self.vec, indices, values, addv, 1, 0) * * def setValuesStagStencil(self, indices, values, addv=None) -> None: # <<<<<<<<<<<<<< * """Not implemented.""" * raise NotImplementedError */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.setValuesStagStencil", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":2749 * raise NotImplementedError * * def setLGMap(self, LGMap lgmap) -> None: # <<<<<<<<<<<<<< * """Set the local-to-global mapping. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_277setLGMap(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_276setLGMap, "Vec.setLGMap(self, lgmap: LGMap) -> None\nSet the local-to-global mapping.\n\n Logically collective.\n\n This allows users to insert vector entries using a local numbering\n with `setValuesLocal`.\n\n See Also\n --------\n setValues, setValuesLocal, getLGMap, petsc.VecSetLocalToGlobalMapping\n\n \nSource code at petsc4py/PETSc/Vec.pyx:2749"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_277setLGMap(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscLGMapObject *__pyx_v_lgmap = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setLGMap (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_lgmap,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_lgmap)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 2749, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setLGMap") < 0)) __PYX_ERR(41, 2749, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_lgmap = ((struct PyPetscLGMapObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setLGMap", 1, 1, 1, __pyx_nargs); __PYX_ERR(41, 2749, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.setLGMap", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lgmap), __pyx_ptype_8petsc4py_5PETSc_LGMap, 0, "lgmap", 0))) __PYX_ERR(41, 2749, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_276setLGMap(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_lgmap); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_276setLGMap(struct PyPetscVecObject *__pyx_v_self, struct PyPetscLGMapObject *__pyx_v_lgmap) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setLGMap", 1); /* "petsc4py/PETSc/Vec.pyx":2762 * * """ * CHKERR( VecSetLocalToGlobalMapping(self.vec, lgmap.lgm) ) # <<<<<<<<<<<<<< * * def getLGMap(self) -> LGMap: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecSetLocalToGlobalMapping(__pyx_v_self->vec, __pyx_v_lgmap->lgm)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 2762, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":2749 * raise NotImplementedError * * def setLGMap(self, LGMap lgmap) -> None: # <<<<<<<<<<<<<< * """Set the local-to-global mapping. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.setLGMap", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":2764 * CHKERR( VecSetLocalToGlobalMapping(self.vec, lgmap.lgm) ) * * def getLGMap(self) -> LGMap: # <<<<<<<<<<<<<< * """Return the local-to-global mapping. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_279getLGMap(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_278getLGMap, "Vec.getLGMap(self) -> LGMap\nReturn the local-to-global mapping.\n\n Not collective.\n\n See Also\n --------\n setLGMap, petsc.VecGetLocalToGlobalMapping\n\n \nSource code at petsc4py/PETSc/Vec.pyx:2764"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_279getLGMap(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getLGMap (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getLGMap", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getLGMap", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_278getLGMap(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_278getLGMap(struct PyPetscVecObject *__pyx_v_self) { struct PyPetscLGMapObject *__pyx_v_cmap = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getLGMap", 1); /* "petsc4py/PETSc/Vec.pyx":2774 * * """ * cdef LGMap cmap = LGMap() # <<<<<<<<<<<<<< * CHKERR( VecGetLocalToGlobalMapping(self.vec, &cmap.lgm) ) * CHKERR( PetscINCREF(cmap.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_LGMap)); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 2774, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_cmap = ((struct PyPetscLGMapObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Vec.pyx":2775 * """ * cdef LGMap cmap = LGMap() * CHKERR( VecGetLocalToGlobalMapping(self.vec, &cmap.lgm) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(cmap.obj) ) * return cmap */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetLocalToGlobalMapping(__pyx_v_self->vec, (&__pyx_v_cmap->lgm))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 2775, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":2776 * cdef LGMap cmap = LGMap() * CHKERR( VecGetLocalToGlobalMapping(self.vec, &cmap.lgm) ) * CHKERR( PetscINCREF(cmap.obj) ) # <<<<<<<<<<<<<< * return cmap * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_cmap->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 2776, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":2777 * CHKERR( VecGetLocalToGlobalMapping(self.vec, &cmap.lgm) ) * CHKERR( PetscINCREF(cmap.obj) ) * return cmap # <<<<<<<<<<<<<< * * def setValueLocal( */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_cmap); __pyx_r = ((PyObject *)__pyx_v_cmap); goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":2764 * CHKERR( VecSetLocalToGlobalMapping(self.vec, lgmap.lgm) ) * * def getLGMap(self) -> LGMap: # <<<<<<<<<<<<<< * """Return the local-to-global mapping. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Vec.getLGMap", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_cmap); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":2779 * return cmap * * def setValueLocal( # <<<<<<<<<<<<<< * self, * index: int, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_281setValueLocal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_280setValueLocal, "Vec.setValueLocal(self, index: int, value: Scalar, addv: InsertModeSpec = None)\nInsert or add a single value in the vector using a local numbering.\n\n Not collective.\n\n Parameters\n ----------\n index\n Location to write to.\n value\n Value to insert at ``index``.\n addv\n Insertion mode.\n\n Notes\n -----\n The values may be cached so `assemblyBegin` and `assemblyEnd`\n must be called after all calls of this method are completed.\n\n Multiple calls to `setValueLocal` cannot be made with different\n values for ``addv`` without intermediate calls to `assemblyBegin`\n and `assemblyEnd`.\n\n See Also\n --------\n setValuesLocal, petsc.VecSetValuesLocal\n\n \nSource code at petsc4py/PETSc/Vec.pyx:2779"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_281setValueLocal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_index = 0; PyObject *__pyx_v_value = 0; PyObject *__pyx_v_addv = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setValueLocal (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_value,&__pyx_n_s_addv,0}; /* "petsc4py/PETSc/Vec.pyx":2783 * index: int, * value: Scalar, * addv: InsertModeSpec = None, # <<<<<<<<<<<<<< * ): * """Insert or add a single value in the vector using a local numbering. */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_index)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 2779, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 2779, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setValueLocal", 0, 2, 3, 1); __PYX_ERR(41, 2779, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_addv); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 2779, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setValueLocal") < 0)) __PYX_ERR(41, 2779, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_index = values[0]; __pyx_v_value = values[1]; __pyx_v_addv = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setValueLocal", 0, 2, 3, __pyx_nargs); __PYX_ERR(41, 2779, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.setValueLocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_280setValueLocal(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_index, __pyx_v_value, __pyx_v_addv); /* "petsc4py/PETSc/Vec.pyx":2779 * return cmap * * def setValueLocal( # <<<<<<<<<<<<<< * self, * index: int, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_280setValueLocal(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value, PyObject *__pyx_v_addv) { PetscInt __pyx_v_ival; PetscScalar __pyx_v_sval; InsertMode __pyx_v_caddv; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscScalar __pyx_t_2; InsertMode __pyx_t_3; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setValueLocal", 1); /* "petsc4py/PETSc/Vec.pyx":2812 * * """ * cdef PetscInt ival = asInt(index) # <<<<<<<<<<<<<< * cdef PetscScalar sval = asScalar(value) * cdef PetscInsertMode caddv = insertmode(addv) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_index); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(41, 2812, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "petsc4py/PETSc/Vec.pyx":2813 * """ * cdef PetscInt ival = asInt(index) * cdef PetscScalar sval = asScalar(value) # <<<<<<<<<<<<<< * cdef PetscInsertMode caddv = insertmode(addv) * CHKERR( VecSetValuesLocal(self.vec, 1, &ival, &sval, caddv) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_value); if (unlikely(__pyx_t_2 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(41, 2813, __pyx_L1_error) __pyx_v_sval = __pyx_t_2; /* "petsc4py/PETSc/Vec.pyx":2814 * cdef PetscInt ival = asInt(index) * cdef PetscScalar sval = asScalar(value) * cdef PetscInsertMode caddv = insertmode(addv) # <<<<<<<<<<<<<< * CHKERR( VecSetValuesLocal(self.vec, 1, &ival, &sval, caddv) ) * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_insertmode(__pyx_v_addv); if (unlikely(__pyx_t_3 == ((InsertMode)((InsertMode)-1L)))) __PYX_ERR(41, 2814, __pyx_L1_error) __pyx_v_caddv = __pyx_t_3; /* "petsc4py/PETSc/Vec.pyx":2815 * cdef PetscScalar sval = asScalar(value) * cdef PetscInsertMode caddv = insertmode(addv) * CHKERR( VecSetValuesLocal(self.vec, 1, &ival, &sval, caddv) ) # <<<<<<<<<<<<<< * * def setValuesLocal( */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecSetValuesLocal(__pyx_v_self->vec, 1, (&__pyx_v_ival), (&__pyx_v_sval), __pyx_v_caddv)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 2815, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":2779 * return cmap * * def setValueLocal( # <<<<<<<<<<<<<< * self, * index: int, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.setValueLocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":2817 * CHKERR( VecSetValuesLocal(self.vec, 1, &ival, &sval, caddv) ) * * def setValuesLocal( # <<<<<<<<<<<<<< * self, * indices: Sequence[int], */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_283setValuesLocal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_282setValuesLocal, "Vec.setValuesLocal(self, indices: Sequence[int], values: Sequence[Scalar], addv: InsertModeSpec = None) -> None\nInsert or add multiple values in the vector with a local numbering.\n\n Not collective.\n\n Parameters\n ----------\n indices\n Locations to write to.\n values\n Values to insert at ``indices``.\n addv\n Insertion mode.\n\n Notes\n -----\n The values may be cached so `assemblyBegin` and `assemblyEnd`\n must be called after all calls of this method are completed.\n\n Multiple calls to `setValuesLocal` cannot be made with different\n values for ``addv`` without intermediate calls to `assemblyBegin`\n and `assemblyEnd`.\n\n See Also\n --------\n setValues, petsc.VecSetValuesLocal\n\n \nSource code at petsc4py/PETSc/Vec.pyx:2817"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_283setValuesLocal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_indices = 0; PyObject *__pyx_v_values = 0; PyObject *__pyx_v_addv = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setValuesLocal (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_indices,&__pyx_n_s_values,&__pyx_n_s_addv,0}; /* "petsc4py/PETSc/Vec.pyx":2821 * indices: Sequence[int], * values: Sequence[Scalar], * addv: InsertModeSpec = None, # <<<<<<<<<<<<<< * ) -> None: * """Insert or add multiple values in the vector with a local numbering. */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_indices)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 2817, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_values)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 2817, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setValuesLocal", 0, 2, 3, 1); __PYX_ERR(41, 2817, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_addv); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 2817, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setValuesLocal") < 0)) __PYX_ERR(41, 2817, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_indices = values[0]; __pyx_v_values = values[1]; __pyx_v_addv = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setValuesLocal", 0, 2, 3, __pyx_nargs); __PYX_ERR(41, 2817, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.setValuesLocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_282setValuesLocal(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_indices, __pyx_v_values, __pyx_v_addv); /* "petsc4py/PETSc/Vec.pyx":2817 * CHKERR( VecSetValuesLocal(self.vec, 1, &ival, &sval, caddv) ) * * def setValuesLocal( # <<<<<<<<<<<<<< * self, * indices: Sequence[int], */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_282setValuesLocal(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_values, PyObject *__pyx_v_addv) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setValuesLocal", 1); /* "petsc4py/PETSc/Vec.pyx":2850 * * """ * vecsetvalues(self.vec, indices, values, addv, 0, 1) # <<<<<<<<<<<<<< * * def setValuesBlockedLocal( */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_vecsetvalues(__pyx_v_self->vec, __pyx_v_indices, __pyx_v_values, __pyx_v_addv, 0, 1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(41, 2850, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":2817 * CHKERR( VecSetValuesLocal(self.vec, 1, &ival, &sval, caddv) ) * * def setValuesLocal( # <<<<<<<<<<<<<< * self, * indices: Sequence[int], */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.setValuesLocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":2852 * vecsetvalues(self.vec, indices, values, addv, 0, 1) * * def setValuesBlockedLocal( # <<<<<<<<<<<<<< * self, * indices: Sequence[int], */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_285setValuesBlockedLocal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_284setValuesBlockedLocal, "Vec.setValuesBlockedLocal(self, indices: Sequence[int], values: Sequence[Scalar], addv: InsertModeSpec = None) -> None\nInsert or add blocks of values in the vector with a local numbering.\n\n Not collective.\n\n Equivalent to ``x[bs*indices[i]+j] = y[bs*i+j]`` for\n ``0 <= i < len(indices)``, ``0 <= j < bs`` and ``bs`` `block_size`.\n\n Parameters\n ----------\n indices\n Local block indices to write to.\n values\n Values to insert at ``indices``. Should have length\n ``len(indices) * vec.block_size``.\n addv\n Insertion mode.\n\n Notes\n -----\n The values may be cached so `assemblyBegin` and `assemblyEnd`\n must be called after all calls of this method are completed.\n\n Multiple calls to `setValuesBlockedLocal` cannot be made with\n different values for ``addv`` without intermediate calls to\n `assemblyBegin` and `assemblyEnd`.\n\n See Also\n --------\n setValuesBlocked, setValuesLocal, petsc.VecSetValuesBlockedLocal\n\n \nSource code at petsc4py/PETSc/Vec.pyx:2852"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_285setValuesBlockedLocal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_indices = 0; PyObject *__pyx_v_values = 0; PyObject *__pyx_v_addv = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setValuesBlockedLocal (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_indices,&__pyx_n_s_values,&__pyx_n_s_addv,0}; /* "petsc4py/PETSc/Vec.pyx":2856 * indices: Sequence[int], * values: Sequence[Scalar], * addv: InsertModeSpec = None, # <<<<<<<<<<<<<< * ) -> None: * """Insert or add blocks of values in the vector with a local numbering. */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_indices)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 2852, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_values)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 2852, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setValuesBlockedLocal", 0, 2, 3, 1); __PYX_ERR(41, 2852, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_addv); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 2852, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setValuesBlockedLocal") < 0)) __PYX_ERR(41, 2852, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_indices = values[0]; __pyx_v_values = values[1]; __pyx_v_addv = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setValuesBlockedLocal", 0, 2, 3, __pyx_nargs); __PYX_ERR(41, 2852, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.setValuesBlockedLocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_284setValuesBlockedLocal(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_indices, __pyx_v_values, __pyx_v_addv); /* "petsc4py/PETSc/Vec.pyx":2852 * vecsetvalues(self.vec, indices, values, addv, 0, 1) * * def setValuesBlockedLocal( # <<<<<<<<<<<<<< * self, * indices: Sequence[int], */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_284setValuesBlockedLocal(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_values, PyObject *__pyx_v_addv) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setValuesBlockedLocal", 1); /* "petsc4py/PETSc/Vec.pyx":2889 * * """ * vecsetvalues(self.vec, indices, values, addv, 1, 1) # <<<<<<<<<<<<<< * * def assemblyBegin(self) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_vecsetvalues(__pyx_v_self->vec, __pyx_v_indices, __pyx_v_values, __pyx_v_addv, 1, 1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(41, 2889, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":2852 * vecsetvalues(self.vec, indices, values, addv, 0, 1) * * def setValuesBlockedLocal( # <<<<<<<<<<<<<< * self, * indices: Sequence[int], */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.setValuesBlockedLocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":2891 * vecsetvalues(self.vec, indices, values, addv, 1, 1) * * def assemblyBegin(self) -> None: # <<<<<<<<<<<<<< * """Begin an assembling stage of the vector. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_287assemblyBegin(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_286assemblyBegin, "Vec.assemblyBegin(self) -> None\nBegin an assembling stage of the vector.\n\n Collective.\n\n See Also\n --------\n assemblyEnd, petsc.VecAssemblyBegin\n\n \nSource code at petsc4py/PETSc/Vec.pyx:2891"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_287assemblyBegin(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("assemblyBegin (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("assemblyBegin", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "assemblyBegin", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_286assemblyBegin(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_286assemblyBegin(struct PyPetscVecObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("assemblyBegin", 1); /* "petsc4py/PETSc/Vec.pyx":2901 * * """ * CHKERR( VecAssemblyBegin(self.vec) ) # <<<<<<<<<<<<<< * * def assemblyEnd(self) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecAssemblyBegin(__pyx_v_self->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 2901, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":2891 * vecsetvalues(self.vec, indices, values, addv, 1, 1) * * def assemblyBegin(self) -> None: # <<<<<<<<<<<<<< * """Begin an assembling stage of the vector. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.assemblyBegin", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":2903 * CHKERR( VecAssemblyBegin(self.vec) ) * * def assemblyEnd(self) -> None: # <<<<<<<<<<<<<< * """Finish the assembling stage initiated with `assemblyBegin`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_289assemblyEnd(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_288assemblyEnd, "Vec.assemblyEnd(self) -> None\nFinish the assembling stage initiated with `assemblyBegin`.\n\n Collective.\n\n See Also\n --------\n assemblyBegin, petsc.VecAssemblyEnd\n\n \nSource code at petsc4py/PETSc/Vec.pyx:2903"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_289assemblyEnd(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("assemblyEnd (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("assemblyEnd", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "assemblyEnd", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_288assemblyEnd(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_288assemblyEnd(struct PyPetscVecObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("assemblyEnd", 1); /* "petsc4py/PETSc/Vec.pyx":2913 * * """ * CHKERR( VecAssemblyEnd(self.vec) ) # <<<<<<<<<<<<<< * * def assemble(self) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecAssemblyEnd(__pyx_v_self->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 2913, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":2903 * CHKERR( VecAssemblyBegin(self.vec) ) * * def assemblyEnd(self) -> None: # <<<<<<<<<<<<<< * """Finish the assembling stage initiated with `assemblyBegin`. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.assemblyEnd", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":2915 * CHKERR( VecAssemblyEnd(self.vec) ) * * def assemble(self) -> None: # <<<<<<<<<<<<<< * """Assemble the vector. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_291assemble(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_290assemble, "Vec.assemble(self) -> None\nAssemble the vector.\n\n Collective.\n\n See Also\n --------\n assemblyBegin, assemblyEnd\n\n \nSource code at petsc4py/PETSc/Vec.pyx:2915"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_291assemble(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("assemble (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("assemble", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "assemble", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_290assemble(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_290assemble(struct PyPetscVecObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("assemble", 1); /* "petsc4py/PETSc/Vec.pyx":2925 * * """ * CHKERR( VecAssemblyBegin(self.vec) ) # <<<<<<<<<<<<<< * CHKERR( VecAssemblyEnd(self.vec) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecAssemblyBegin(__pyx_v_self->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 2925, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":2926 * """ * CHKERR( VecAssemblyBegin(self.vec) ) * CHKERR( VecAssemblyEnd(self.vec) ) # <<<<<<<<<<<<<< * * # --- methods for strided vectors --- */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecAssemblyEnd(__pyx_v_self->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 2926, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":2915 * CHKERR( VecAssemblyEnd(self.vec) ) * * def assemble(self) -> None: # <<<<<<<<<<<<<< * """Assemble the vector. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.assemble", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":2930 * # --- methods for strided vectors --- * * def strideScale(self, field: int, alpha: Scalar) -> None: # <<<<<<<<<<<<<< * """Scale a component of the vector. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_293strideScale(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_292strideScale, "Vec.strideScale(self, field: int, alpha: Scalar) -> None\nScale a component of the vector.\n\n Logically collective.\n\n Parameters\n ----------\n field\n Component index. Must be between ``0`` and ``vec.block_size``.\n alpha\n Factor to multiple the component entries by.\n\n See Also\n --------\n strideSum, strideMin, strideMax, petsc.VecStrideScale\n\n \nSource code at petsc4py/PETSc/Vec.pyx:2930"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_293strideScale(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_field = 0; PyObject *__pyx_v_alpha = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("strideScale (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_field,&__pyx_n_s_alpha,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_field)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 2930, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_alpha)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 2930, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("strideScale", 1, 2, 2, 1); __PYX_ERR(41, 2930, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "strideScale") < 0)) __PYX_ERR(41, 2930, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_field = values[0]; __pyx_v_alpha = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("strideScale", 1, 2, 2, __pyx_nargs); __PYX_ERR(41, 2930, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.strideScale", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_292strideScale(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_field, __pyx_v_alpha); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_292strideScale(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_alpha) { PetscInt __pyx_v_ival; PetscScalar __pyx_v_sval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscScalar __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("strideScale", 1); /* "petsc4py/PETSc/Vec.pyx":2947 * * """ * cdef PetscInt ival = asInt(field) # <<<<<<<<<<<<<< * cdef PetscScalar sval = asScalar(alpha) * CHKERR( VecStrideScale(self.vec, ival, sval) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_field); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(41, 2947, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "petsc4py/PETSc/Vec.pyx":2948 * """ * cdef PetscInt ival = asInt(field) * cdef PetscScalar sval = asScalar(alpha) # <<<<<<<<<<<<<< * CHKERR( VecStrideScale(self.vec, ival, sval) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_alpha); if (unlikely(__pyx_t_2 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(41, 2948, __pyx_L1_error) __pyx_v_sval = __pyx_t_2; /* "petsc4py/PETSc/Vec.pyx":2949 * cdef PetscInt ival = asInt(field) * cdef PetscScalar sval = asScalar(alpha) * CHKERR( VecStrideScale(self.vec, ival, sval) ) # <<<<<<<<<<<<<< * * def strideSum(self, field: int) -> Scalar: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecStrideScale(__pyx_v_self->vec, __pyx_v_ival, __pyx_v_sval)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 2949, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":2930 * # --- methods for strided vectors --- * * def strideScale(self, field: int, alpha: Scalar) -> None: # <<<<<<<<<<<<<< * """Scale a component of the vector. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.strideScale", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":2951 * CHKERR( VecStrideScale(self.vec, ival, sval) ) * * def strideSum(self, field: int) -> Scalar: # <<<<<<<<<<<<<< * """Sum subvector entries. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_295strideSum(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_294strideSum, "Vec.strideSum(self, field: int) -> Scalar\nSum subvector entries.\n\n Collective.\n\n Equivalent to ``sum(x[field], x[field+bs], x[field+2*bs], ...)`` where\n ``bs`` is `block_size`.\n\n Parameters\n ----------\n field\n Component index. Must be between ``0`` and ``vec.block_size``.\n\n See Also\n --------\n strideScale, strideMin, strideMax, petsc.VecStrideSum\n\n \nSource code at petsc4py/PETSc/Vec.pyx:2951"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_295strideSum(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_field = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("strideSum (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_field,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_field)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 2951, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "strideSum") < 0)) __PYX_ERR(41, 2951, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_field = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("strideSum", 1, 1, 1, __pyx_nargs); __PYX_ERR(41, 2951, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.strideSum", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_294strideSum(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_field); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_294strideSum(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_field) { PetscInt __pyx_v_ival; PetscScalar __pyx_v_sval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("strideSum", 1); /* "petsc4py/PETSc/Vec.pyx":2969 * * """ * cdef PetscInt ival = asInt(field) # <<<<<<<<<<<<<< * cdef PetscScalar sval = 0 * CHKERR( VecStrideSum(self.vec, ival, &sval) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_field); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(41, 2969, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "petsc4py/PETSc/Vec.pyx":2970 * """ * cdef PetscInt ival = asInt(field) * cdef PetscScalar sval = 0 # <<<<<<<<<<<<<< * CHKERR( VecStrideSum(self.vec, ival, &sval) ) * return toScalar(sval) */ __pyx_v_sval = 0.0; /* "petsc4py/PETSc/Vec.pyx":2971 * cdef PetscInt ival = asInt(field) * cdef PetscScalar sval = 0 * CHKERR( VecStrideSum(self.vec, ival, &sval) ) # <<<<<<<<<<<<<< * return toScalar(sval) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecStrideSum(__pyx_v_self->vec, __pyx_v_ival, (&__pyx_v_sval))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 2971, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":2972 * cdef PetscScalar sval = 0 * CHKERR( VecStrideSum(self.vec, ival, &sval) ) * return toScalar(sval) # <<<<<<<<<<<<<< * * def strideMin(self, field: int) -> tuple[int, float]: */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toScalar(__pyx_v_sval); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 2972, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":2951 * CHKERR( VecStrideScale(self.vec, ival, sval) ) * * def strideSum(self, field: int) -> Scalar: # <<<<<<<<<<<<<< * """Sum subvector entries. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Vec.strideSum", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":2974 * return toScalar(sval) * * def strideMin(self, field: int) -> tuple[int, float]: # <<<<<<<<<<<<<< * """Return the minimum of entries in a subvector. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_297strideMin(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_296strideMin, "Vec.strideMin(self, field: int) -> tuple[int, float]\nReturn the minimum of entries in a subvector.\n\n Collective.\n\n Equivalent to ``min(x[field], x[field+bs], x[field+2*bs], ...)`` where\n ``bs`` is `block_size`.\n\n Parameters\n ----------\n field\n Component index. Must be between ``0`` and ``vec.block_size``.\n\n Returns\n -------\n int\n Location of minimum.\n float\n Minimum value.\n\n See Also\n --------\n strideScale, strideSum, strideMax, petsc.VecStrideMin\n\n \nSource code at petsc4py/PETSc/Vec.pyx:2974"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_297strideMin(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_field = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("strideMin (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_field,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_field)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 2974, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "strideMin") < 0)) __PYX_ERR(41, 2974, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_field = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("strideMin", 1, 1, 1, __pyx_nargs); __PYX_ERR(41, 2974, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.strideMin", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_296strideMin(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_field); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_296strideMin(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_field) { PetscInt __pyx_v_ival1; PetscInt __pyx_v_ival2; PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("strideMin", 1); /* "petsc4py/PETSc/Vec.pyx":2999 * * """ * cdef PetscInt ival1 = asInt(field) # <<<<<<<<<<<<<< * cdef PetscInt ival2 = 0 * cdef PetscReal rval = 0 */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_field); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(41, 2999, __pyx_L1_error) __pyx_v_ival1 = __pyx_t_1; /* "petsc4py/PETSc/Vec.pyx":3000 * """ * cdef PetscInt ival1 = asInt(field) * cdef PetscInt ival2 = 0 # <<<<<<<<<<<<<< * cdef PetscReal rval = 0 * CHKERR( VecStrideMin(self.vec, ival1, &ival2, &rval) ) */ __pyx_v_ival2 = 0; /* "petsc4py/PETSc/Vec.pyx":3001 * cdef PetscInt ival1 = asInt(field) * cdef PetscInt ival2 = 0 * cdef PetscReal rval = 0 # <<<<<<<<<<<<<< * CHKERR( VecStrideMin(self.vec, ival1, &ival2, &rval) ) * return (toInt(ival2), toReal(rval)) */ __pyx_v_rval = 0.0; /* "petsc4py/PETSc/Vec.pyx":3002 * cdef PetscInt ival2 = 0 * cdef PetscReal rval = 0 * CHKERR( VecStrideMin(self.vec, ival1, &ival2, &rval) ) # <<<<<<<<<<<<<< * return (toInt(ival2), toReal(rval)) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecStrideMin(__pyx_v_self->vec, __pyx_v_ival1, (&__pyx_v_ival2), (&__pyx_v_rval))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 3002, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":3003 * cdef PetscReal rval = 0 * CHKERR( VecStrideMin(self.vec, ival1, &ival2, &rval) ) * return (toInt(ival2), toReal(rval)) # <<<<<<<<<<<<<< * * def strideMax(self, field: int) -> tuple[int, float]: */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ival2); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 3003, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_rval); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 3003, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(41, 3003, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3)) __PYX_ERR(41, 3003, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4)) __PYX_ERR(41, 3003, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":2974 * return toScalar(sval) * * def strideMin(self, field: int) -> tuple[int, float]: # <<<<<<<<<<<<<< * """Return the minimum of entries in a subvector. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.Vec.strideMin", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":3005 * return (toInt(ival2), toReal(rval)) * * def strideMax(self, field: int) -> tuple[int, float]: # <<<<<<<<<<<<<< * """Return the maximum of entries in a subvector. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_299strideMax(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_298strideMax, "Vec.strideMax(self, field: int) -> tuple[int, float]\nReturn the maximum of entries in a subvector.\n\n Collective.\n\n Equivalent to ``max(x[field], x[field+bs], x[field+2*bs], ...)`` where\n ``bs`` is `block_size`.\n\n Parameters\n ----------\n field\n Component index. Must be between ``0`` and ``vec.block_size``.\n\n Returns\n -------\n int\n Location of maximum.\n float\n Maximum value.\n\n See Also\n --------\n strideScale, strideSum, strideMin, petsc.VecStrideMax\n\n \nSource code at petsc4py/PETSc/Vec.pyx:3005"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_299strideMax(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_field = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("strideMax (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_field,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_field)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 3005, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "strideMax") < 0)) __PYX_ERR(41, 3005, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_field = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("strideMax", 1, 1, 1, __pyx_nargs); __PYX_ERR(41, 3005, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.strideMax", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_298strideMax(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_field); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_298strideMax(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_field) { PetscInt __pyx_v_ival1; PetscInt __pyx_v_ival2; PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("strideMax", 1); /* "petsc4py/PETSc/Vec.pyx":3030 * * """ * cdef PetscInt ival1 = asInt(field) # <<<<<<<<<<<<<< * cdef PetscInt ival2 = 0 * cdef PetscReal rval = 0 */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_field); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(41, 3030, __pyx_L1_error) __pyx_v_ival1 = __pyx_t_1; /* "petsc4py/PETSc/Vec.pyx":3031 * """ * cdef PetscInt ival1 = asInt(field) * cdef PetscInt ival2 = 0 # <<<<<<<<<<<<<< * cdef PetscReal rval = 0 * CHKERR( VecStrideMax(self.vec, ival1, &ival2, &rval) ) */ __pyx_v_ival2 = 0; /* "petsc4py/PETSc/Vec.pyx":3032 * cdef PetscInt ival1 = asInt(field) * cdef PetscInt ival2 = 0 * cdef PetscReal rval = 0 # <<<<<<<<<<<<<< * CHKERR( VecStrideMax(self.vec, ival1, &ival2, &rval) ) * return (toInt(ival2), toReal(rval)) */ __pyx_v_rval = 0.0; /* "petsc4py/PETSc/Vec.pyx":3033 * cdef PetscInt ival2 = 0 * cdef PetscReal rval = 0 * CHKERR( VecStrideMax(self.vec, ival1, &ival2, &rval) ) # <<<<<<<<<<<<<< * return (toInt(ival2), toReal(rval)) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecStrideMax(__pyx_v_self->vec, __pyx_v_ival1, (&__pyx_v_ival2), (&__pyx_v_rval))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 3033, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":3034 * cdef PetscReal rval = 0 * CHKERR( VecStrideMax(self.vec, ival1, &ival2, &rval) ) * return (toInt(ival2), toReal(rval)) # <<<<<<<<<<<<<< * * def strideNorm( */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ival2); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 3034, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_rval); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 3034, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(41, 3034, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3)) __PYX_ERR(41, 3034, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4)) __PYX_ERR(41, 3034, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":3005 * return (toInt(ival2), toReal(rval)) * * def strideMax(self, field: int) -> tuple[int, float]: # <<<<<<<<<<<<<< * """Return the maximum of entries in a subvector. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.Vec.strideMax", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":3036 * return (toInt(ival2), toReal(rval)) * * def strideNorm( # <<<<<<<<<<<<<< * self, * field: int, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_301strideNorm(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_300strideNorm, "Vec.strideNorm(self, field: int, norm_type: NormTypeSpec = None) -> float | tuple[float, float]\nReturn the norm of entries in a subvector.\n\n Collective.\n\n Equivalent to ``norm(x[field], x[field+bs], x[field+2*bs], ...)`` where\n ``bs`` is `block_size`.\n\n Parameters\n ----------\n field\n Component index. Must be between ``0`` and ``vec.block_size``.\n norm_type\n The norm type.\n\n See Also\n --------\n norm, strideScale, strideSum, petsc.VecStrideNorm\n\n \nSource code at petsc4py/PETSc/Vec.pyx:3036"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_301strideNorm(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_field = 0; PyObject *__pyx_v_norm_type = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("strideNorm (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_field,&__pyx_n_s_norm_type,0}; /* "petsc4py/PETSc/Vec.pyx":3039 * self, * field: int, * norm_type: NormTypeSpec = None, # <<<<<<<<<<<<<< * ) -> float | tuple[float, float]: * """Return the norm of entries in a subvector. */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_field)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 3036, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_norm_type); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 3036, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "strideNorm") < 0)) __PYX_ERR(41, 3036, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_field = values[0]; __pyx_v_norm_type = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("strideNorm", 0, 1, 2, __pyx_nargs); __PYX_ERR(41, 3036, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.strideNorm", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_300strideNorm(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_field, __pyx_v_norm_type); /* "petsc4py/PETSc/Vec.pyx":3036 * return (toInt(ival2), toReal(rval)) * * def strideNorm( # <<<<<<<<<<<<<< * self, * field: int, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_300strideNorm(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_norm_type) { PetscInt __pyx_v_ival; NormType __pyx_v_norm_1_2; NormType __pyx_v_ntype; PetscReal __pyx_v_rval[2]; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; NormType __pyx_t_3; PetscErrorCode __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("strideNorm", 1); /* "petsc4py/PETSc/Vec.pyx":3060 * * """ * cdef PetscInt ival = asInt(field) # <<<<<<<<<<<<<< * cdef PetscNormType norm_1_2 = PETSC_NORM_1_AND_2 * cdef PetscNormType ntype = PETSC_NORM_2 */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_field); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(41, 3060, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "petsc4py/PETSc/Vec.pyx":3061 * """ * cdef PetscInt ival = asInt(field) * cdef PetscNormType norm_1_2 = PETSC_NORM_1_AND_2 # <<<<<<<<<<<<<< * cdef PetscNormType ntype = PETSC_NORM_2 * if norm_type is not None: ntype = norm_type */ __pyx_v_norm_1_2 = NORM_1_AND_2; /* "petsc4py/PETSc/Vec.pyx":3062 * cdef PetscInt ival = asInt(field) * cdef PetscNormType norm_1_2 = PETSC_NORM_1_AND_2 * cdef PetscNormType ntype = PETSC_NORM_2 # <<<<<<<<<<<<<< * if norm_type is not None: ntype = norm_type * cdef PetscReal rval[2] */ __pyx_v_ntype = NORM_2; /* "petsc4py/PETSc/Vec.pyx":3063 * cdef PetscNormType norm_1_2 = PETSC_NORM_1_AND_2 * cdef PetscNormType ntype = PETSC_NORM_2 * if norm_type is not None: ntype = norm_type # <<<<<<<<<<<<<< * cdef PetscReal rval[2] * CHKERR( VecStrideNorm(self.vec, ival, ntype, rval) ) */ __pyx_t_2 = (__pyx_v_norm_type != Py_None); if (__pyx_t_2) { __pyx_t_3 = ((NormType)__Pyx_PyInt_As_NormType(__pyx_v_norm_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 3063, __pyx_L1_error) __pyx_v_ntype = __pyx_t_3; } /* "petsc4py/PETSc/Vec.pyx":3065 * if norm_type is not None: ntype = norm_type * cdef PetscReal rval[2] * CHKERR( VecStrideNorm(self.vec, ival, ntype, rval) ) # <<<<<<<<<<<<<< * if ntype != norm_1_2: return toReal(rval[0]) * else: return (toReal(rval[0]), toReal(rval[1])) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecStrideNorm(__pyx_v_self->vec, __pyx_v_ival, __pyx_v_ntype, __pyx_v_rval)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 3065, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":3066 * cdef PetscReal rval[2] * CHKERR( VecStrideNorm(self.vec, ival, ntype, rval) ) * if ntype != norm_1_2: return toReal(rval[0]) # <<<<<<<<<<<<<< * else: return (toReal(rval[0]), toReal(rval[1])) * */ __pyx_t_2 = (__pyx_v_ntype != __pyx_v_norm_1_2); if (__pyx_t_2) { __Pyx_XDECREF(__pyx_r); __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toReal((__pyx_v_rval[0])); if (unlikely(!__pyx_t_5)) __PYX_ERR(41, 3066, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; } /* "petsc4py/PETSc/Vec.pyx":3067 * CHKERR( VecStrideNorm(self.vec, ival, ntype, rval) ) * if ntype != norm_1_2: return toReal(rval[0]) * else: return (toReal(rval[0]), toReal(rval[1])) # <<<<<<<<<<<<<< * * def strideScatter( */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toReal((__pyx_v_rval[0])); if (unlikely(!__pyx_t_5)) __PYX_ERR(41, 3067, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_toReal((__pyx_v_rval[1])); if (unlikely(!__pyx_t_6)) __PYX_ERR(41, 3067, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 3067, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5)) __PYX_ERR(41, 3067, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6)) __PYX_ERR(41, 3067, __pyx_L1_error); __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_r = __pyx_t_7; __pyx_t_7 = 0; goto __pyx_L0; } /* "petsc4py/PETSc/Vec.pyx":3036 * return (toInt(ival2), toReal(rval)) * * def strideNorm( # <<<<<<<<<<<<<< * self, * field: int, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.Vec.strideNorm", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":3069 * else: return (toReal(rval[0]), toReal(rval[1])) * * def strideScatter( # <<<<<<<<<<<<<< * self, * field: int, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_303strideScatter(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_302strideScatter, "Vec.strideScatter(self, field: int, vec: Vec, addv: InsertModeSpec = None) -> None\nScatter entries into a component of another vector.\n\n Collective.\n\n The current vector is expected to be single-component\n (`block_size` of ``1``) and the target vector is expected to be\n multi-component.\n\n Parameters\n ----------\n field\n Component index. Must be between ``0`` and ``vec.block_size``.\n vec\n Multi-component vector to be scattered into.\n addv\n Insertion mode.\n\n See Also\n --------\n strideGather, petsc.VecStrideScatter\n\n \nSource code at petsc4py/PETSc/Vec.pyx:3069"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_303strideScatter(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_field = 0; struct PyPetscVecObject *__pyx_v_vec = 0; PyObject *__pyx_v_addv = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("strideScatter (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_field,&__pyx_n_s_vec,&__pyx_n_s_addv,0}; /* "petsc4py/PETSc/Vec.pyx":3073 * field: int, * Vec vec, * addv: InsertModeSpec = None, # <<<<<<<<<<<<<< * ) -> None: * """Scatter entries into a component of another vector. */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_field)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 3069, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vec)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 3069, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("strideScatter", 0, 2, 3, 1); __PYX_ERR(41, 3069, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_addv); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 3069, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "strideScatter") < 0)) __PYX_ERR(41, 3069, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_field = values[0]; __pyx_v_vec = ((struct PyPetscVecObject *)values[1]); __pyx_v_addv = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("strideScatter", 0, 2, 3, __pyx_nargs); __PYX_ERR(41, 3069, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.strideScatter", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(41, 3072, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_302strideScatter(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_field, __pyx_v_vec, __pyx_v_addv); /* "petsc4py/PETSc/Vec.pyx":3069 * else: return (toReal(rval[0]), toReal(rval[1])) * * def strideScatter( # <<<<<<<<<<<<<< * self, * field: int, */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_302strideScatter(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_field, struct PyPetscVecObject *__pyx_v_vec, PyObject *__pyx_v_addv) { PetscInt __pyx_v_ival; InsertMode __pyx_v_caddv; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; InsertMode __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("strideScatter", 1); /* "petsc4py/PETSc/Vec.pyx":3097 * * """ * cdef PetscInt ival = asInt(field) # <<<<<<<<<<<<<< * cdef PetscInsertMode caddv = insertmode(addv) * CHKERR( VecStrideScatter(self.vec, ival, vec.vec, caddv) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_field); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(41, 3097, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "petsc4py/PETSc/Vec.pyx":3098 * """ * cdef PetscInt ival = asInt(field) * cdef PetscInsertMode caddv = insertmode(addv) # <<<<<<<<<<<<<< * CHKERR( VecStrideScatter(self.vec, ival, vec.vec, caddv) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_insertmode(__pyx_v_addv); if (unlikely(__pyx_t_2 == ((InsertMode)((InsertMode)-1L)))) __PYX_ERR(41, 3098, __pyx_L1_error) __pyx_v_caddv = __pyx_t_2; /* "petsc4py/PETSc/Vec.pyx":3099 * cdef PetscInt ival = asInt(field) * cdef PetscInsertMode caddv = insertmode(addv) * CHKERR( VecStrideScatter(self.vec, ival, vec.vec, caddv) ) # <<<<<<<<<<<<<< * * def strideGather( */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecStrideScatter(__pyx_v_self->vec, __pyx_v_ival, __pyx_v_vec->vec, __pyx_v_caddv)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 3099, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":3069 * else: return (toReal(rval[0]), toReal(rval[1])) * * def strideScatter( # <<<<<<<<<<<<<< * self, * field: int, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.strideScatter", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":3101 * CHKERR( VecStrideScatter(self.vec, ival, vec.vec, caddv) ) * * def strideGather( # <<<<<<<<<<<<<< * self, * field: int, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_305strideGather(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_304strideGather, "Vec.strideGather(self, field: int, vec: Vec, addv: InsertModeSpec = None) -> None\nInsert component values into a single-component vector.\n\n Collective.\n\n The current vector is expected to be multi-component (`block_size`\n greater than ``1``) and the target vector is expected to be\n single-component.\n\n Parameters\n ----------\n field\n Component index. Must be between ``0`` and ``vec.block_size``.\n vec\n Single-component vector to be inserted into.\n addv\n Insertion mode.\n\n See Also\n --------\n strideScatter, petsc.VecStrideScatter\n\n \nSource code at petsc4py/PETSc/Vec.pyx:3101"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_305strideGather(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_field = 0; struct PyPetscVecObject *__pyx_v_vec = 0; PyObject *__pyx_v_addv = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("strideGather (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_field,&__pyx_n_s_vec,&__pyx_n_s_addv,0}; /* "petsc4py/PETSc/Vec.pyx":3105 * field: int, * Vec vec, * addv: InsertModeSpec = None, # <<<<<<<<<<<<<< * ) -> None: * """Insert component values into a single-component vector. */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_field)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 3101, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vec)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 3101, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("strideGather", 0, 2, 3, 1); __PYX_ERR(41, 3101, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_addv); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 3101, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "strideGather") < 0)) __PYX_ERR(41, 3101, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_field = values[0]; __pyx_v_vec = ((struct PyPetscVecObject *)values[1]); __pyx_v_addv = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("strideGather", 0, 2, 3, __pyx_nargs); __PYX_ERR(41, 3101, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.strideGather", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(41, 3104, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_304strideGather(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_field, __pyx_v_vec, __pyx_v_addv); /* "petsc4py/PETSc/Vec.pyx":3101 * CHKERR( VecStrideScatter(self.vec, ival, vec.vec, caddv) ) * * def strideGather( # <<<<<<<<<<<<<< * self, * field: int, */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_304strideGather(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_field, struct PyPetscVecObject *__pyx_v_vec, PyObject *__pyx_v_addv) { PetscInt __pyx_v_ival; InsertMode __pyx_v_caddv; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; InsertMode __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("strideGather", 1); /* "petsc4py/PETSc/Vec.pyx":3129 * * """ * cdef PetscInt ival = asInt(field) # <<<<<<<<<<<<<< * cdef PetscInsertMode caddv = insertmode(addv) * CHKERR( VecStrideGather(self.vec, ival, vec.vec, caddv) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_field); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(41, 3129, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "petsc4py/PETSc/Vec.pyx":3130 * """ * cdef PetscInt ival = asInt(field) * cdef PetscInsertMode caddv = insertmode(addv) # <<<<<<<<<<<<<< * CHKERR( VecStrideGather(self.vec, ival, vec.vec, caddv) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_insertmode(__pyx_v_addv); if (unlikely(__pyx_t_2 == ((InsertMode)((InsertMode)-1L)))) __PYX_ERR(41, 3130, __pyx_L1_error) __pyx_v_caddv = __pyx_t_2; /* "petsc4py/PETSc/Vec.pyx":3131 * cdef PetscInt ival = asInt(field) * cdef PetscInsertMode caddv = insertmode(addv) * CHKERR( VecStrideGather(self.vec, ival, vec.vec, caddv) ) # <<<<<<<<<<<<<< * * # --- methods for vectors with ghost values --- */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecStrideGather(__pyx_v_self->vec, __pyx_v_ival, __pyx_v_vec->vec, __pyx_v_caddv)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 3131, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":3101 * CHKERR( VecStrideScatter(self.vec, ival, vec.vec, caddv) ) * * def strideGather( # <<<<<<<<<<<<<< * self, * field: int, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.strideGather", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":3135 * # --- methods for vectors with ghost values --- * * def localForm(self) -> Any: # <<<<<<<<<<<<<< * """Return a context manager for viewing ghost vectors in local form. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_307localForm(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_306localForm, "Vec.localForm(self) -> Any\nReturn a context manager for viewing ghost vectors in local form.\n\n Logically collective.\n\n Returns\n -------\n typing.Any\n Context manager yielding the vector in local (ghosted) form.\n\n Notes\n -----\n This operation does not perform a copy. To obtain up-to-date ghost\n values `ghostUpdateBegin` and `ghostUpdateEnd` must be called\n first.\n\n Non-ghost values can be found\n at ``values[0:nlocal]`` and ghost values at\n ``values[nlocal:nlocal+nghost]``.\n\n Examples\n --------\n >>> with vec.localForm() as lf:\n ... # compute with lf\n\n See Also\n --------\n createGhost, ghostUpdateBegin, ghostUpdateEnd\n petsc.VecGhostGetLocalForm, petsc.VecGhostRestoreLocalForm\n\n \nSource code at petsc4py/PETSc/Vec.pyx:3135"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_307localForm(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("localForm (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("localForm", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "localForm", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_306localForm(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_306localForm(struct PyPetscVecObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("localForm", 1); /* "petsc4py/PETSc/Vec.pyx":3166 * * """ * return _Vec_LocalForm(self) # <<<<<<<<<<<<<< * * def ghostUpdateBegin( */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc__Vec_LocalForm), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 3166, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":3135 * # --- methods for vectors with ghost values --- * * def localForm(self) -> Any: # <<<<<<<<<<<<<< * """Return a context manager for viewing ghost vectors in local form. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Vec.localForm", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":3168 * return _Vec_LocalForm(self) * * def ghostUpdateBegin( # <<<<<<<<<<<<<< * self, * addv: InsertModeSpec = None, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_309ghostUpdateBegin(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_308ghostUpdateBegin, "Vec.ghostUpdateBegin(self, addv: InsertModeSpec = None, mode: ScatterModeSpec = None) -> None\nBegin updating ghosted vector entries.\n\n Neighborwise collective.\n\n See Also\n --------\n ghostUpdateEnd, ghostUpdate, createGhost, petsc.VecGhostUpdateBegin\n\n \nSource code at petsc4py/PETSc/Vec.pyx:3168"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_309ghostUpdateBegin(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_addv = 0; PyObject *__pyx_v_mode = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("ghostUpdateBegin (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_addv,&__pyx_n_s_mode,0}; /* "petsc4py/PETSc/Vec.pyx":3170 * def ghostUpdateBegin( * self, * addv: InsertModeSpec = None, # <<<<<<<<<<<<<< * mode: ScatterModeSpec = None, * ) -> None: */ values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Vec.pyx":3171 * self, * addv: InsertModeSpec = None, * mode: ScatterModeSpec = None, # <<<<<<<<<<<<<< * ) -> None: * """Begin updating ghosted vector entries. */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_addv); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 3168, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mode); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 3168, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "ghostUpdateBegin") < 0)) __PYX_ERR(41, 3168, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_addv = values[0]; __pyx_v_mode = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("ghostUpdateBegin", 0, 0, 2, __pyx_nargs); __PYX_ERR(41, 3168, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.ghostUpdateBegin", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_308ghostUpdateBegin(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_addv, __pyx_v_mode); /* "petsc4py/PETSc/Vec.pyx":3168 * return _Vec_LocalForm(self) * * def ghostUpdateBegin( # <<<<<<<<<<<<<< * self, * addv: InsertModeSpec = None, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_308ghostUpdateBegin(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_addv, PyObject *__pyx_v_mode) { InsertMode __pyx_v_caddv; ScatterMode __pyx_v_csctm; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations InsertMode __pyx_t_1; ScatterMode __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("ghostUpdateBegin", 1); /* "petsc4py/PETSc/Vec.pyx":3182 * * """ * cdef PetscInsertMode caddv = insertmode(addv) # <<<<<<<<<<<<<< * cdef PetscScatterMode csctm = scattermode(mode) * CHKERR( VecGhostUpdateBegin(self.vec, caddv, csctm) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_insertmode(__pyx_v_addv); if (unlikely(__pyx_t_1 == ((InsertMode)((InsertMode)-1L)))) __PYX_ERR(41, 3182, __pyx_L1_error) __pyx_v_caddv = __pyx_t_1; /* "petsc4py/PETSc/Vec.pyx":3183 * """ * cdef PetscInsertMode caddv = insertmode(addv) * cdef PetscScatterMode csctm = scattermode(mode) # <<<<<<<<<<<<<< * CHKERR( VecGhostUpdateBegin(self.vec, caddv, csctm) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_scattermode(__pyx_v_mode); if (unlikely(__pyx_t_2 == ((ScatterMode)((ScatterMode)-1L)))) __PYX_ERR(41, 3183, __pyx_L1_error) __pyx_v_csctm = __pyx_t_2; /* "petsc4py/PETSc/Vec.pyx":3184 * cdef PetscInsertMode caddv = insertmode(addv) * cdef PetscScatterMode csctm = scattermode(mode) * CHKERR( VecGhostUpdateBegin(self.vec, caddv, csctm) ) # <<<<<<<<<<<<<< * * def ghostUpdateEnd( */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGhostUpdateBegin(__pyx_v_self->vec, __pyx_v_caddv, __pyx_v_csctm)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 3184, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":3168 * return _Vec_LocalForm(self) * * def ghostUpdateBegin( # <<<<<<<<<<<<<< * self, * addv: InsertModeSpec = None, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.ghostUpdateBegin", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":3186 * CHKERR( VecGhostUpdateBegin(self.vec, caddv, csctm) ) * * def ghostUpdateEnd( # <<<<<<<<<<<<<< * self, * addv: InsertModeSpec = None, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_311ghostUpdateEnd(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_310ghostUpdateEnd, "Vec.ghostUpdateEnd(self, addv: InsertModeSpec = None, mode: ScatterModeSpec = None) -> None\nFinish updating ghosted vector entries initiated with `ghostUpdateBegin`.\n\n Neighborwise collective.\n\n See Also\n --------\n ghostUpdateBegin, ghostUpdate, createGhost, petsc.VecGhostUpdateEnd\n\n \nSource code at petsc4py/PETSc/Vec.pyx:3186"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_311ghostUpdateEnd(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_addv = 0; PyObject *__pyx_v_mode = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("ghostUpdateEnd (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_addv,&__pyx_n_s_mode,0}; /* "petsc4py/PETSc/Vec.pyx":3188 * def ghostUpdateEnd( * self, * addv: InsertModeSpec = None, # <<<<<<<<<<<<<< * mode: ScatterModeSpec = None, * ) -> None: */ values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Vec.pyx":3189 * self, * addv: InsertModeSpec = None, * mode: ScatterModeSpec = None, # <<<<<<<<<<<<<< * ) -> None: * """Finish updating ghosted vector entries initiated with `ghostUpdateBegin`. */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_addv); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 3186, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mode); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 3186, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "ghostUpdateEnd") < 0)) __PYX_ERR(41, 3186, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_addv = values[0]; __pyx_v_mode = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("ghostUpdateEnd", 0, 0, 2, __pyx_nargs); __PYX_ERR(41, 3186, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.ghostUpdateEnd", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_310ghostUpdateEnd(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_addv, __pyx_v_mode); /* "petsc4py/PETSc/Vec.pyx":3186 * CHKERR( VecGhostUpdateBegin(self.vec, caddv, csctm) ) * * def ghostUpdateEnd( # <<<<<<<<<<<<<< * self, * addv: InsertModeSpec = None, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_310ghostUpdateEnd(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_addv, PyObject *__pyx_v_mode) { InsertMode __pyx_v_caddv; ScatterMode __pyx_v_csctm; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations InsertMode __pyx_t_1; ScatterMode __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("ghostUpdateEnd", 1); /* "petsc4py/PETSc/Vec.pyx":3200 * * """ * cdef PetscInsertMode caddv = insertmode(addv) # <<<<<<<<<<<<<< * cdef PetscScatterMode csctm = scattermode(mode) * CHKERR( VecGhostUpdateEnd(self.vec, caddv, csctm) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_insertmode(__pyx_v_addv); if (unlikely(__pyx_t_1 == ((InsertMode)((InsertMode)-1L)))) __PYX_ERR(41, 3200, __pyx_L1_error) __pyx_v_caddv = __pyx_t_1; /* "petsc4py/PETSc/Vec.pyx":3201 * """ * cdef PetscInsertMode caddv = insertmode(addv) * cdef PetscScatterMode csctm = scattermode(mode) # <<<<<<<<<<<<<< * CHKERR( VecGhostUpdateEnd(self.vec, caddv, csctm) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_scattermode(__pyx_v_mode); if (unlikely(__pyx_t_2 == ((ScatterMode)((ScatterMode)-1L)))) __PYX_ERR(41, 3201, __pyx_L1_error) __pyx_v_csctm = __pyx_t_2; /* "petsc4py/PETSc/Vec.pyx":3202 * cdef PetscInsertMode caddv = insertmode(addv) * cdef PetscScatterMode csctm = scattermode(mode) * CHKERR( VecGhostUpdateEnd(self.vec, caddv, csctm) ) # <<<<<<<<<<<<<< * * def ghostUpdate( */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGhostUpdateEnd(__pyx_v_self->vec, __pyx_v_caddv, __pyx_v_csctm)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 3202, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":3186 * CHKERR( VecGhostUpdateBegin(self.vec, caddv, csctm) ) * * def ghostUpdateEnd( # <<<<<<<<<<<<<< * self, * addv: InsertModeSpec = None, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.ghostUpdateEnd", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":3204 * CHKERR( VecGhostUpdateEnd(self.vec, caddv, csctm) ) * * def ghostUpdate( # <<<<<<<<<<<<<< * self, * addv: InsertModeSpec = None, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_313ghostUpdate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_312ghostUpdate, "Vec.ghostUpdate(self, addv: InsertModeSpec = None, mode: ScatterModeSpec = None) -> None\nUpdate ghosted vector entries.\n\n Neighborwise collective.\n\n Parameters\n ----------\n addv\n Insertion mode.\n mode\n Scatter mode.\n\n Examples\n --------\n To accumulate ghost region values onto owning processes:\n\n >>> vec.ghostUpdate(InsertMode.ADD_VALUES, ScatterMode.REVERSE)\n\n Update ghost regions:\n\n >>> vec.ghostUpdate(InsertMode.INSERT_VALUES, ScatterMode.FORWARD)\n\n See Also\n --------\n ghostUpdateBegin, ghostUpdateEnd\n\n \nSource code at petsc4py/PETSc/Vec.pyx:3204"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_313ghostUpdate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_addv = 0; PyObject *__pyx_v_mode = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("ghostUpdate (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_addv,&__pyx_n_s_mode,0}; /* "petsc4py/PETSc/Vec.pyx":3206 * def ghostUpdate( * self, * addv: InsertModeSpec = None, # <<<<<<<<<<<<<< * mode: ScatterModeSpec = None, * ) -> None: */ values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Vec.pyx":3207 * self, * addv: InsertModeSpec = None, * mode: ScatterModeSpec = None, # <<<<<<<<<<<<<< * ) -> None: * """Update ghosted vector entries. */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_addv); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 3204, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mode); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 3204, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "ghostUpdate") < 0)) __PYX_ERR(41, 3204, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_addv = values[0]; __pyx_v_mode = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("ghostUpdate", 0, 0, 2, __pyx_nargs); __PYX_ERR(41, 3204, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.ghostUpdate", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_312ghostUpdate(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_addv, __pyx_v_mode); /* "petsc4py/PETSc/Vec.pyx":3204 * CHKERR( VecGhostUpdateEnd(self.vec, caddv, csctm) ) * * def ghostUpdate( # <<<<<<<<<<<<<< * self, * addv: InsertModeSpec = None, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_312ghostUpdate(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_addv, PyObject *__pyx_v_mode) { InsertMode __pyx_v_caddv; ScatterMode __pyx_v_csctm; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations InsertMode __pyx_t_1; ScatterMode __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("ghostUpdate", 1); /* "petsc4py/PETSc/Vec.pyx":3235 * * """ * cdef PetscInsertMode caddv = insertmode(addv) # <<<<<<<<<<<<<< * cdef PetscScatterMode csctm = scattermode(mode) * CHKERR( VecGhostUpdateBegin(self.vec, caddv, csctm) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_insertmode(__pyx_v_addv); if (unlikely(__pyx_t_1 == ((InsertMode)((InsertMode)-1L)))) __PYX_ERR(41, 3235, __pyx_L1_error) __pyx_v_caddv = __pyx_t_1; /* "petsc4py/PETSc/Vec.pyx":3236 * """ * cdef PetscInsertMode caddv = insertmode(addv) * cdef PetscScatterMode csctm = scattermode(mode) # <<<<<<<<<<<<<< * CHKERR( VecGhostUpdateBegin(self.vec, caddv, csctm) ) * CHKERR( VecGhostUpdateEnd(self.vec, caddv, csctm) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_scattermode(__pyx_v_mode); if (unlikely(__pyx_t_2 == ((ScatterMode)((ScatterMode)-1L)))) __PYX_ERR(41, 3236, __pyx_L1_error) __pyx_v_csctm = __pyx_t_2; /* "petsc4py/PETSc/Vec.pyx":3237 * cdef PetscInsertMode caddv = insertmode(addv) * cdef PetscScatterMode csctm = scattermode(mode) * CHKERR( VecGhostUpdateBegin(self.vec, caddv, csctm) ) # <<<<<<<<<<<<<< * CHKERR( VecGhostUpdateEnd(self.vec, caddv, csctm) ) * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGhostUpdateBegin(__pyx_v_self->vec, __pyx_v_caddv, __pyx_v_csctm)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 3237, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":3238 * cdef PetscScatterMode csctm = scattermode(mode) * CHKERR( VecGhostUpdateBegin(self.vec, caddv, csctm) ) * CHKERR( VecGhostUpdateEnd(self.vec, caddv, csctm) ) # <<<<<<<<<<<<<< * * def setMPIGhost(self, ghosts: Sequence[int]) -> None: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGhostUpdateEnd(__pyx_v_self->vec, __pyx_v_caddv, __pyx_v_csctm)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 3238, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":3204 * CHKERR( VecGhostUpdateEnd(self.vec, caddv, csctm) ) * * def ghostUpdate( # <<<<<<<<<<<<<< * self, * addv: InsertModeSpec = None, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.ghostUpdate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":3240 * CHKERR( VecGhostUpdateEnd(self.vec, caddv, csctm) ) * * def setMPIGhost(self, ghosts: Sequence[int]) -> None: # <<<<<<<<<<<<<< * """Set the ghost points for a ghosted vector. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_315setMPIGhost(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_314setMPIGhost, "Vec.setMPIGhost(self, ghosts: Sequence[int]) -> None\nSet the ghost points for a ghosted vector.\n\n Collective.\n\n Parameters\n ----------\n ghosts\n Global indices of ghost points.\n\n See Also\n --------\n createGhost\n\n \nSource code at petsc4py/PETSc/Vec.pyx:3240"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_315setMPIGhost(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_ghosts = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setMPIGhost (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ghosts,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ghosts)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 3240, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setMPIGhost") < 0)) __PYX_ERR(41, 3240, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_ghosts = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setMPIGhost", 1, 1, 1, __pyx_nargs); __PYX_ERR(41, 3240, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.setMPIGhost", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_314setMPIGhost(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_ghosts); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_314setMPIGhost(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_ghosts) { PetscInt __pyx_v_ng; PetscInt *__pyx_v_ig; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setMPIGhost", 0); __Pyx_INCREF(__pyx_v_ghosts); /* "petsc4py/PETSc/Vec.pyx":3255 * * """ * cdef PetscInt ng=0, *ig=NULL # <<<<<<<<<<<<<< * ghosts = iarray_i(ghosts, &ng, &ig) * CHKERR( VecMPISetGhost(self.vec, ng, ig) ) */ __pyx_v_ng = 0; __pyx_v_ig = NULL; /* "petsc4py/PETSc/Vec.pyx":3256 * """ * cdef PetscInt ng=0, *ig=NULL * ghosts = iarray_i(ghosts, &ng, &ig) # <<<<<<<<<<<<<< * CHKERR( VecMPISetGhost(self.vec, ng, ig) ) * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_ghosts, (&__pyx_v_ng), (&__pyx_v_ig))); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 3256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_ghosts, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Vec.pyx":3257 * cdef PetscInt ng=0, *ig=NULL * ghosts = iarray_i(ghosts, &ng, &ig) * CHKERR( VecMPISetGhost(self.vec, ng, ig) ) # <<<<<<<<<<<<<< * * # */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecMPISetGhost(__pyx_v_self->vec, __pyx_v_ng, __pyx_v_ig)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 3257, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":3240 * CHKERR( VecGhostUpdateEnd(self.vec, caddv, csctm) ) * * def setMPIGhost(self, ghosts: Sequence[int]) -> None: # <<<<<<<<<<<<<< * """Set the ghost points for a ghosted vector. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Vec.setMPIGhost", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ghosts); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":3261 * # * * def getSubVector(self, IS iset, Vec subvec=None) -> Vec: # <<<<<<<<<<<<<< * """Return a subvector from given indices. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_317getSubVector(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_316getSubVector, "Vec.getSubVector(self, iset: IS, subvec: Vec | None = None) -> Vec\nReturn a subvector from given indices.\n\n Collective.\n\n Once finished with the subvector it should be returned with\n `restoreSubVector`.\n\n Parameters\n ----------\n iset\n Index set describing which indices to extract into the subvector.\n subvec\n Subvector to copy entries into. If `None` then a new `Vec` will\n be created.\n\n See Also\n --------\n restoreSubVector, petsc.VecGetSubVector\n\n \nSource code at petsc4py/PETSc/Vec.pyx:3261"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_317getSubVector(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscISObject *__pyx_v_iset = 0; struct PyPetscVecObject *__pyx_v_subvec = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSubVector (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_iset,&__pyx_n_s_subvec,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscVecObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_iset)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 3261, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_subvec); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 3261, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getSubVector") < 0)) __PYX_ERR(41, 3261, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_iset = ((struct PyPetscISObject *)values[0]); __pyx_v_subvec = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getSubVector", 0, 1, 2, __pyx_nargs); __PYX_ERR(41, 3261, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.getSubVector", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iset), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "iset", 0))) __PYX_ERR(41, 3261, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subvec), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "subvec", 0))) __PYX_ERR(41, 3261, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_316getSubVector(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_iset, __pyx_v_subvec); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_316getSubVector(struct PyPetscVecObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset, struct PyPetscVecObject *__pyx_v_subvec) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSubVector", 0); __Pyx_INCREF((PyObject *)__pyx_v_subvec); /* "petsc4py/PETSc/Vec.pyx":3282 * * """ * if subvec is None: subvec = Vec() # <<<<<<<<<<<<<< * else: CHKERR( VecDestroy(&subvec.vec) ) * CHKERR( VecGetSubVector(self.vec, iset.iset, &subvec.vec) ) */ __pyx_t_1 = (((PyObject *)__pyx_v_subvec) == Py_None); if (__pyx_t_1) { __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 3282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_subvec, ((struct PyPetscVecObject *)__pyx_t_2)); __pyx_t_2 = 0; goto __pyx_L3; } /* "petsc4py/PETSc/Vec.pyx":3283 * """ * if subvec is None: subvec = Vec() * else: CHKERR( VecDestroy(&subvec.vec) ) # <<<<<<<<<<<<<< * CHKERR( VecGetSubVector(self.vec, iset.iset, &subvec.vec) ) * return subvec */ /*else*/ { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecDestroy((&__pyx_v_subvec->vec))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 3283, __pyx_L1_error) } __pyx_L3:; /* "petsc4py/PETSc/Vec.pyx":3284 * if subvec is None: subvec = Vec() * else: CHKERR( VecDestroy(&subvec.vec) ) * CHKERR( VecGetSubVector(self.vec, iset.iset, &subvec.vec) ) # <<<<<<<<<<<<<< * return subvec * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetSubVector(__pyx_v_self->vec, __pyx_v_iset->iset, (&__pyx_v_subvec->vec))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 3284, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":3285 * else: CHKERR( VecDestroy(&subvec.vec) ) * CHKERR( VecGetSubVector(self.vec, iset.iset, &subvec.vec) ) * return subvec # <<<<<<<<<<<<<< * * def restoreSubVector(self, IS iset, Vec subvec) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_subvec); __pyx_r = ((PyObject *)__pyx_v_subvec); goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":3261 * # * * def getSubVector(self, IS iset, Vec subvec=None) -> Vec: # <<<<<<<<<<<<<< * """Return a subvector from given indices. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Vec.getSubVector", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_subvec); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":3287 * return subvec * * def restoreSubVector(self, IS iset, Vec subvec) -> None: # <<<<<<<<<<<<<< * """Restore a subvector extracted using `getSubVector`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_319restoreSubVector(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_318restoreSubVector, "Vec.restoreSubVector(self, iset: IS, subvec: Vec) -> None\nRestore a subvector extracted using `getSubVector`.\n\n Collective.\n\n Parameters\n ----------\n iset\n Index set describing the indices represented by the subvector.\n subvec\n Subvector to be restored.\n\n See Also\n --------\n getSubVector, petsc.VecRestoreSubVector\n\n \nSource code at petsc4py/PETSc/Vec.pyx:3287"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_319restoreSubVector(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscISObject *__pyx_v_iset = 0; struct PyPetscVecObject *__pyx_v_subvec = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("restoreSubVector (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_iset,&__pyx_n_s_subvec,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_iset)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 3287, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_subvec)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 3287, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("restoreSubVector", 1, 2, 2, 1); __PYX_ERR(41, 3287, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "restoreSubVector") < 0)) __PYX_ERR(41, 3287, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_iset = ((struct PyPetscISObject *)values[0]); __pyx_v_subvec = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("restoreSubVector", 1, 2, 2, __pyx_nargs); __PYX_ERR(41, 3287, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.restoreSubVector", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iset), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "iset", 0))) __PYX_ERR(41, 3287, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subvec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "subvec", 0))) __PYX_ERR(41, 3287, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_318restoreSubVector(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_iset, __pyx_v_subvec); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_318restoreSubVector(struct PyPetscVecObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset, struct PyPetscVecObject *__pyx_v_subvec) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("restoreSubVector", 1); /* "petsc4py/PETSc/Vec.pyx":3304 * * """ * CHKERR( VecRestoreSubVector(self.vec, iset.iset, &subvec.vec) ) # <<<<<<<<<<<<<< * * def getNestSubVecs(self) -> list[Vec]: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecRestoreSubVector(__pyx_v_self->vec, __pyx_v_iset->iset, (&__pyx_v_subvec->vec))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 3304, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":3287 * return subvec * * def restoreSubVector(self, IS iset, Vec subvec) -> None: # <<<<<<<<<<<<<< * """Restore a subvector extracted using `getSubVector`. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.restoreSubVector", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":3306 * CHKERR( VecRestoreSubVector(self.vec, iset.iset, &subvec.vec) ) * * def getNestSubVecs(self) -> list[Vec]: # <<<<<<<<<<<<<< * """Return all the vectors contained in the nested vector. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_321getNestSubVecs(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_320getNestSubVecs, "Vec.getNestSubVecs(self) -> list[Vec]\nReturn all the vectors contained in the nested vector.\n\n Not collective.\n\n See Also\n --------\n setNestSubVecs, petsc.VecNestGetSubVecs\n\n \nSource code at petsc4py/PETSc/Vec.pyx:3306"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_321getNestSubVecs(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getNestSubVecs (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getNestSubVecs", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getNestSubVecs", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_320getNestSubVecs(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_320getNestSubVecs(struct PyPetscVecObject *__pyx_v_self) { PetscInt __pyx_v_N; Vec *__pyx_v_sx; PyObject *__pyx_v_output = NULL; PetscInt __pyx_v_i; struct PyPetscVecObject *__pyx_v_pyvec = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscInt __pyx_t_3; PetscInt __pyx_t_4; PetscInt __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getNestSubVecs", 1); /* "petsc4py/PETSc/Vec.pyx":3316 * * """ * cdef PetscInt N=0 # <<<<<<<<<<<<<< * cdef PetscVec* sx=NULL * CHKERR( VecNestGetSubVecs(self.vec, &N, &sx) ) */ __pyx_v_N = 0; /* "petsc4py/PETSc/Vec.pyx":3317 * """ * cdef PetscInt N=0 * cdef PetscVec* sx=NULL # <<<<<<<<<<<<<< * CHKERR( VecNestGetSubVecs(self.vec, &N, &sx) ) * output = [] */ __pyx_v_sx = NULL; /* "petsc4py/PETSc/Vec.pyx":3318 * cdef PetscInt N=0 * cdef PetscVec* sx=NULL * CHKERR( VecNestGetSubVecs(self.vec, &N, &sx) ) # <<<<<<<<<<<<<< * output = [] * for i in range(N): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecNestGetSubVecs(__pyx_v_self->vec, (&__pyx_v_N), (&__pyx_v_sx))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 3318, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":3319 * cdef PetscVec* sx=NULL * CHKERR( VecNestGetSubVecs(self.vec, &N, &sx) ) * output = [] # <<<<<<<<<<<<<< * for i in range(N): * pyvec = Vec() */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 3319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_output = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/Vec.pyx":3320 * CHKERR( VecNestGetSubVecs(self.vec, &N, &sx) ) * output = [] * for i in range(N): # <<<<<<<<<<<<<< * pyvec = Vec() * pyvec.vec = sx[i] */ __pyx_t_3 = __pyx_v_N; __pyx_t_4 = __pyx_t_3; for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { __pyx_v_i = __pyx_t_5; /* "petsc4py/PETSc/Vec.pyx":3321 * output = [] * for i in range(N): * pyvec = Vec() # <<<<<<<<<<<<<< * pyvec.vec = sx[i] * CHKERR( PetscObjectReference( pyvec.vec) ) */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 3321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_pyvec, ((struct PyPetscVecObject *)__pyx_t_2)); __pyx_t_2 = 0; /* "petsc4py/PETSc/Vec.pyx":3322 * for i in range(N): * pyvec = Vec() * pyvec.vec = sx[i] # <<<<<<<<<<<<<< * CHKERR( PetscObjectReference( pyvec.vec) ) * output.append(pyvec) */ __pyx_v_pyvec->vec = (__pyx_v_sx[__pyx_v_i]); /* "petsc4py/PETSc/Vec.pyx":3323 * pyvec = Vec() * pyvec.vec = sx[i] * CHKERR( PetscObjectReference( pyvec.vec) ) # <<<<<<<<<<<<<< * output.append(pyvec) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectReference(((PetscObject)__pyx_v_pyvec->vec))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 3323, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":3324 * pyvec.vec = sx[i] * CHKERR( PetscObjectReference( pyvec.vec) ) * output.append(pyvec) # <<<<<<<<<<<<<< * * return output */ __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_output, ((PyObject *)__pyx_v_pyvec)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(41, 3324, __pyx_L1_error) } /* "petsc4py/PETSc/Vec.pyx":3326 * output.append(pyvec) * * return output # <<<<<<<<<<<<<< * * def setNestSubVecs( */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_output); __pyx_r = __pyx_v_output; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":3306 * CHKERR( VecRestoreSubVector(self.vec, iset.iset, &subvec.vec) ) * * def getNestSubVecs(self) -> list[Vec]: # <<<<<<<<<<<<<< * """Return all the vectors contained in the nested vector. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Vec.getNestSubVecs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_output); __Pyx_XDECREF((PyObject *)__pyx_v_pyvec); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":3328 * return output * * def setNestSubVecs( # <<<<<<<<<<<<<< * self, * sx: Sequence[Vec], */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_323setNestSubVecs(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_322setNestSubVecs, "Vec.setNestSubVecs(self, sx: Sequence[Vec], idxm: Sequence[int] | None = None) -> None\nSet the component vectors at specified indices in the nested vector.\n\n Not collective.\n\n Parameters\n ----------\n sx\n Array of component vectors.\n idxm\n Indices of the component vectors, defaults to ``range(len(sx))``.\n\n See Also\n --------\n getNestSubVecs, petsc.VecNestSetSubVecs\n\n \nSource code at petsc4py/PETSc/Vec.pyx:3328"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_323setNestSubVecs(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_sx = 0; PyObject *__pyx_v_idxm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setNestSubVecs (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sx,&__pyx_n_s_idxm,0}; /* "petsc4py/PETSc/Vec.pyx":3331 * self, * sx: Sequence[Vec], * idxm: Sequence[int] | None = None, # <<<<<<<<<<<<<< * ) -> None: * """Set the component vectors at specified indices in the nested vector. */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sx)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 3328, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_idxm); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 3328, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setNestSubVecs") < 0)) __PYX_ERR(41, 3328, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_sx = values[0]; __pyx_v_idxm = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setNestSubVecs", 0, 1, 2, __pyx_nargs); __PYX_ERR(41, 3328, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.setNestSubVecs", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_322setNestSubVecs(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_sx, __pyx_v_idxm); /* "petsc4py/PETSc/Vec.pyx":3328 * return output * * def setNestSubVecs( # <<<<<<<<<<<<<< * self, * sx: Sequence[Vec], */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_322setNestSubVecs(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_sx, PyObject *__pyx_v_idxm) { PetscInt __pyx_v_N; PetscInt *__pyx_v_cidxm; Vec *__pyx_v_csx; CYTHON_UNUSED PyArrayObject *__pyx_v_tmp = NULL; long __pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; Py_ssize_t __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; Py_ssize_t __pyx_t_5; PetscInt __pyx_t_6; Vec __pyx_t_7; PetscErrorCode __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setNestSubVecs", 0); __Pyx_INCREF(__pyx_v_idxm); /* "petsc4py/PETSc/Vec.pyx":3349 * * """ * if idxm is None: idxm = range(len(sx)) # <<<<<<<<<<<<<< * else: assert len(idxm) == len(sx) * cdef PetscInt N = 0 */ __pyx_t_1 = (__pyx_v_idxm == Py_None); if (__pyx_t_1) { __pyx_t_2 = PyObject_Length(__pyx_v_sx); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(41, 3349, __pyx_L1_error) __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 3349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 3349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_idxm, __pyx_t_4); __pyx_t_4 = 0; goto __pyx_L3; } /* "petsc4py/PETSc/Vec.pyx":3350 * """ * if idxm is None: idxm = range(len(sx)) * else: assert len(idxm) == len(sx) # <<<<<<<<<<<<<< * cdef PetscInt N = 0 * cdef PetscInt* cidxm = NULL */ /*else*/ { #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_2 = PyObject_Length(__pyx_v_idxm); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(41, 3350, __pyx_L1_error) __pyx_t_5 = PyObject_Length(__pyx_v_sx); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(41, 3350, __pyx_L1_error) __pyx_t_1 = (__pyx_t_2 == __pyx_t_5); if (unlikely(!__pyx_t_1)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(41, 3350, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(41, 3350, __pyx_L1_error) #endif } __pyx_L3:; /* "petsc4py/PETSc/Vec.pyx":3351 * if idxm is None: idxm = range(len(sx)) * else: assert len(idxm) == len(sx) * cdef PetscInt N = 0 # <<<<<<<<<<<<<< * cdef PetscInt* cidxm = NULL * idxm = iarray_i(idxm, &N, &cidxm) */ __pyx_v_N = 0; /* "petsc4py/PETSc/Vec.pyx":3352 * else: assert len(idxm) == len(sx) * cdef PetscInt N = 0 * cdef PetscInt* cidxm = NULL # <<<<<<<<<<<<<< * idxm = iarray_i(idxm, &N, &cidxm) * */ __pyx_v_cidxm = NULL; /* "petsc4py/PETSc/Vec.pyx":3353 * cdef PetscInt N = 0 * cdef PetscInt* cidxm = NULL * idxm = iarray_i(idxm, &N, &cidxm) # <<<<<<<<<<<<<< * * cdef PetscVec* csx = NULL */ __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_idxm, (&__pyx_v_N), (&__pyx_v_cidxm))); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 3353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_idxm, __pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/Vec.pyx":3355 * idxm = iarray_i(idxm, &N, &cidxm) * * cdef PetscVec* csx = NULL # <<<<<<<<<<<<<< * tmp = oarray_p(empty_p(N), NULL, &csx) * for i from 0 <= i < N: csx[i] = (sx[i]).vec */ __pyx_v_csx = NULL; /* "petsc4py/PETSc/Vec.pyx":3356 * * cdef PetscVec* csx = NULL * tmp = oarray_p(empty_p(N), NULL, &csx) # <<<<<<<<<<<<<< * for i from 0 <= i < N: csx[i] = (sx[i]).vec * */ __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_N)); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 3356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_4, NULL, ((void **)(&__pyx_v_csx)))); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 3356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_tmp = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/Vec.pyx":3357 * cdef PetscVec* csx = NULL * tmp = oarray_p(empty_p(N), NULL, &csx) * for i from 0 <= i < N: csx[i] = (sx[i]).vec # <<<<<<<<<<<<<< * * CHKERR( VecNestSetSubVecs(self.vec, N, cidxm, csx) ) */ __pyx_t_6 = __pyx_v_N; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_6; __pyx_v_i++) { __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_sx, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 3357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (!(likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_8petsc4py_5PETSc_Vec)))) __PYX_ERR(41, 3357, __pyx_L1_error) __pyx_t_7 = ((struct PyPetscVecObject *)__pyx_t_3)->vec; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; (__pyx_v_csx[__pyx_v_i]) = __pyx_t_7; } /* "petsc4py/PETSc/Vec.pyx":3359 * for i from 0 <= i < N: csx[i] = (sx[i]).vec * * CHKERR( VecNestSetSubVecs(self.vec, N, cidxm, csx) ) # <<<<<<<<<<<<<< * * # */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecNestSetSubVecs(__pyx_v_self->vec, __pyx_v_N, __pyx_v_cidxm, __pyx_v_csx)); if (unlikely(__pyx_t_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 3359, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":3328 * return output * * def setNestSubVecs( # <<<<<<<<<<<<<< * self, * sx: Sequence[Vec], */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.Vec.setNestSubVecs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_tmp); __Pyx_XDECREF(__pyx_v_idxm); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":3363 * # * * def setDM(self, DM dm) -> None: # <<<<<<<<<<<<<< * """Associate a `DM` to the vector. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_325setDM(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_324setDM, "Vec.setDM(self, dm: DM) -> None\nAssociate a `DM` to the vector.\n\n Not collective.\n\n See Also\n --------\n getDM, petsc.VecSetDM\n\n \nSource code at petsc4py/PETSc/Vec.pyx:3363"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_325setDM(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscDMObject *__pyx_v_dm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setDM (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dm,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dm)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 3363, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setDM") < 0)) __PYX_ERR(41, 3363, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_dm = ((struct PyPetscDMObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setDM", 1, 1, 1, __pyx_nargs); __PYX_ERR(41, 3363, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Vec.setDM", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_ptype_8petsc4py_5PETSc_DM, 0, "dm", 0))) __PYX_ERR(41, 3363, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_324setDM(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_dm); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_324setDM(struct PyPetscVecObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setDM", 1); /* "petsc4py/PETSc/Vec.pyx":3373 * * """ * CHKERR( VecSetDM(self.vec, dm.dm) ) # <<<<<<<<<<<<<< * * def getDM(self) -> DM: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecSetDM(__pyx_v_self->vec, __pyx_v_dm->dm)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 3373, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":3363 * # * * def setDM(self, DM dm) -> None: # <<<<<<<<<<<<<< * """Associate a `DM` to the vector. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.setDM", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":3375 * CHKERR( VecSetDM(self.vec, dm.dm) ) * * def getDM(self) -> DM: # <<<<<<<<<<<<<< * """Return the `DM` associated to the vector. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_327getDM(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Vec_326getDM, "Vec.getDM(self) -> DM\nReturn the `DM` associated to the vector.\n\n Not collective.\n\n See Also\n --------\n setDM, petsc.VecGetDM\n\n \nSource code at petsc4py/PETSc/Vec.pyx:3375"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_327getDM(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getDM (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getDM", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getDM", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_326getDM(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_326getDM(struct PyPetscVecObject *__pyx_v_self) { struct PyPetscDMObject *__pyx_v_dm = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getDM", 1); /* "petsc4py/PETSc/Vec.pyx":3385 * * """ * cdef DM dm = DM() # <<<<<<<<<<<<<< * CHKERR( VecGetDM(self.vec, &dm.dm) ) * return dm */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM)); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 3385, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_dm = ((struct PyPetscDMObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Vec.pyx":3386 * """ * cdef DM dm = DM() * CHKERR( VecGetDM(self.vec, &dm.dm) ) # <<<<<<<<<<<<<< * return dm * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetDM(__pyx_v_self->vec, (&__pyx_v_dm->dm))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 3386, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":3387 * cdef DM dm = DM() * CHKERR( VecGetDM(self.vec, &dm.dm) ) * return dm # <<<<<<<<<<<<<< * * # */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_dm); __pyx_r = ((PyObject *)__pyx_v_dm); goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":3375 * CHKERR( VecSetDM(self.vec, dm.dm) ) * * def getDM(self) -> DM: # <<<<<<<<<<<<<< * """Return the `DM` associated to the vector. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Vec.getDM", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_dm); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":3393 * property sizes: * """The local and global vector sizes.""" * def __get__(self) -> LayoutSizeSpec: # <<<<<<<<<<<<<< * return self.getSizes() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_5sizes_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_5sizes_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_5sizes___get__(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_5sizes___get__(struct PyPetscVecObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/Vec.pyx":3394 * """The local and global vector sizes.""" * def __get__(self) -> LayoutSizeSpec: * return self.getSizes() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setSizes(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getSizes); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 3394, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 3394, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":3393 * property sizes: * """The local and global vector sizes.""" * def __get__(self) -> LayoutSizeSpec: # <<<<<<<<<<<<<< * return self.getSizes() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Vec.sizes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":3395 * def __get__(self) -> LayoutSizeSpec: * return self.getSizes() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setSizes(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_3Vec_5sizes_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_3Vec_5sizes_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_5sizes_2__set__(((struct PyPetscVecObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_3Vec_5sizes_2__set__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "petsc4py/PETSc/Vec.pyx":3396 * return self.getSizes() * def __set__(self, value): * self.setSizes(value) # <<<<<<<<<<<<<< * * property size: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setSizes); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 3396, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_value}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 3396, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Vec.pyx":3395 * def __get__(self) -> LayoutSizeSpec: * return self.getSizes() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setSizes(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Vec.sizes.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":3400 * property size: * """The global vector size.""" * def __get__(self) -> int: # <<<<<<<<<<<<<< * return self.getSize() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_4size_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_4size_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_4size___get__(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_4size___get__(struct PyPetscVecObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/Vec.pyx":3401 * """The global vector size.""" * def __get__(self) -> int: * return self.getSize() # <<<<<<<<<<<<<< * * property local_size: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getSize); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 3401, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 3401, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":3400 * property size: * """The global vector size.""" * def __get__(self) -> int: # <<<<<<<<<<<<<< * return self.getSize() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Vec.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":3405 * property local_size: * """The local vector size.""" * def __get__(self) -> int: # <<<<<<<<<<<<<< * return self.getLocalSize() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_10local_size_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_10local_size_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_10local_size___get__(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_10local_size___get__(struct PyPetscVecObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/Vec.pyx":3406 * """The local vector size.""" * def __get__(self) -> int: * return self.getLocalSize() # <<<<<<<<<<<<<< * * property block_size: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getLocalSize); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 3406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 3406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":3405 * property local_size: * """The local vector size.""" * def __get__(self) -> int: # <<<<<<<<<<<<<< * return self.getLocalSize() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Vec.local_size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":3410 * property block_size: * """The block size.""" * def __get__(self) -> int: # <<<<<<<<<<<<<< * return self.getBlockSize() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_10block_size_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_10block_size_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_10block_size___get__(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_10block_size___get__(struct PyPetscVecObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/Vec.pyx":3411 * """The block size.""" * def __get__(self) -> int: * return self.getBlockSize() # <<<<<<<<<<<<<< * * property owner_range: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getBlockSize); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 3411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 3411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":3410 * property block_size: * """The block size.""" * def __get__(self) -> int: # <<<<<<<<<<<<<< * return self.getBlockSize() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Vec.block_size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":3415 * property owner_range: * """The locally owned range of indices in the form ``[low, high)``.""" * def __get__(self) -> tuple[int, int]: # <<<<<<<<<<<<<< * return self.getOwnershipRange() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_11owner_range_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_11owner_range_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_11owner_range___get__(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_11owner_range___get__(struct PyPetscVecObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/Vec.pyx":3416 * """The locally owned range of indices in the form ``[low, high)``.""" * def __get__(self) -> tuple[int, int]: * return self.getOwnershipRange() # <<<<<<<<<<<<<< * * property owner_ranges: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getOwnershipRange); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 3416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 3416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":3415 * property owner_range: * """The locally owned range of indices in the form ``[low, high)``.""" * def __get__(self) -> tuple[int, int]: # <<<<<<<<<<<<<< * return self.getOwnershipRange() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Vec.owner_range.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":3420 * property owner_ranges: * """The range of indices owned by each process.""" * def __get__(self) -> ArrayInt: # <<<<<<<<<<<<<< * return self.getOwnershipRanges() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_12owner_ranges_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_12owner_ranges_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_12owner_ranges___get__(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_12owner_ranges___get__(struct PyPetscVecObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/Vec.pyx":3421 * """The range of indices owned by each process.""" * def __get__(self) -> ArrayInt: * return self.getOwnershipRanges() # <<<<<<<<<<<<<< * * property buffer_w: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getOwnershipRanges); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 3421, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 3421, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":3420 * property owner_ranges: * """The range of indices owned by each process.""" * def __get__(self) -> ArrayInt: # <<<<<<<<<<<<<< * return self.getOwnershipRanges() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Vec.owner_ranges.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":3425 * property buffer_w: * """Writeable buffered view of the local portion of the vector.""" * def __get__(self) -> Any: # <<<<<<<<<<<<<< * return self.getBuffer() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_8buffer_w_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_8buffer_w_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_8buffer_w___get__(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_8buffer_w___get__(struct PyPetscVecObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/Vec.pyx":3426 * """Writeable buffered view of the local portion of the vector.""" * def __get__(self) -> Any: * return self.getBuffer() # <<<<<<<<<<<<<< * * property buffer_r: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getBuffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 3426, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 3426, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":3425 * property buffer_w: * """Writeable buffered view of the local portion of the vector.""" * def __get__(self) -> Any: # <<<<<<<<<<<<<< * return self.getBuffer() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Vec.buffer_w.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":3430 * property buffer_r: * """Read-only buffered view of the local portion of the vector.""" * def __get__(self) -> Any: # <<<<<<<<<<<<<< * return self.getBuffer(True) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_8buffer_r_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_8buffer_r_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_8buffer_r___get__(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_8buffer_r___get__(struct PyPetscVecObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/Vec.pyx":3431 * """Read-only buffered view of the local portion of the vector.""" * def __get__(self) -> Any: * return self.getBuffer(True) # <<<<<<<<<<<<<< * * property array_w: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getBuffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 3431, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, Py_True}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 3431, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":3430 * property buffer_r: * """Read-only buffered view of the local portion of the vector.""" * def __get__(self) -> Any: # <<<<<<<<<<<<<< * return self.getBuffer(True) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Vec.buffer_r.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":3435 * property array_w: * """Writeable `ndarray` containing the local portion of the vector.""" * def __get__(self) -> ArrayScalar: # <<<<<<<<<<<<<< * return self.getArray() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_7array_w_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_7array_w_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_7array_w___get__(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_7array_w___get__(struct PyPetscVecObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/Vec.pyx":3436 * """Writeable `ndarray` containing the local portion of the vector.""" * def __get__(self) -> ArrayScalar: * return self.getArray() # <<<<<<<<<<<<<< * def __set__(self, value): * cdef buf = self.getBuffer() */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getArray); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 3436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 3436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":3435 * property array_w: * """Writeable `ndarray` containing the local portion of the vector.""" * def __get__(self) -> ArrayScalar: # <<<<<<<<<<<<<< * return self.getArray() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Vec.array_w.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":3437 * def __get__(self) -> ArrayScalar: * return self.getArray() * def __set__(self, value): # <<<<<<<<<<<<<< * cdef buf = self.getBuffer() * with buf as array: array[:] = value */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_3Vec_7array_w_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_3Vec_7array_w_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_7array_w_2__set__(((struct PyPetscVecObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_3Vec_7array_w_2__set__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_value) { PyObject *__pyx_v_buf = 0; PyObject *__pyx_v_array = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; int __pyx_t_11; int __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "petsc4py/PETSc/Vec.pyx":3438 * return self.getArray() * def __set__(self, value): * cdef buf = self.getBuffer() # <<<<<<<<<<<<<< * with buf as array: array[:] = value * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getBuffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 3438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 3438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_buf = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/Vec.pyx":3439 * def __set__(self, value): * cdef buf = self.getBuffer() * with buf as array: array[:] = value # <<<<<<<<<<<<<< * * property array_r: */ /*with:*/ { __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_v_buf, __pyx_n_s_exit); if (unlikely(!__pyx_t_5)) __PYX_ERR(41, 3439, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_v_buf, __pyx_n_s_enter); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 3439, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 3439, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_2 = __pyx_t_1; __pyx_t_1 = 0; /*try:*/ { { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); /*try:*/ { __pyx_v_array = __pyx_t_2; __pyx_t_2 = 0; if (__Pyx_PyObject_SetSlice(__pyx_v_array, __pyx_v_value, 0, 0, NULL, NULL, &__pyx_slice__5, 0, 0, 1) < 0) __PYX_ERR(41, 3439, __pyx_L7_error) } __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L12_try_end; __pyx_L7_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; /*except:*/ { __Pyx_AddTraceback("petsc4py.PETSc.Vec.array_w.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_3) < 0) __PYX_ERR(41, 3439, __pyx_L9_except_error) __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_3); __pyx_t_9 = PyTuple_Pack(3, __pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(41, 3439, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_10)) __PYX_ERR(41, 3439, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (__pyx_t_11 < 0) __PYX_ERR(41, 3439, __pyx_L9_except_error) __pyx_t_12 = (!__pyx_t_11); if (unlikely(__pyx_t_12)) { __Pyx_GIVEREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ErrRestoreWithState(__pyx_t_2, __pyx_t_1, __pyx_t_3); __pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_t_3 = 0; __PYX_ERR(41, 3439, __pyx_L9_except_error) } __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L8_exception_handled; } __pyx_L9_except_error:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); goto __pyx_L1_error; __pyx_L8_exception_handled:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); __pyx_L12_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_5) { __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__32, NULL); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(41, 3439, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } goto __pyx_L6; } __pyx_L6:; } goto __pyx_L16; __pyx_L3_error:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L1_error; __pyx_L16:; } /* "petsc4py/PETSc/Vec.pyx":3437 * def __get__(self) -> ArrayScalar: * return self.getArray() * def __set__(self, value): # <<<<<<<<<<<<<< * cdef buf = self.getBuffer() * with buf as array: array[:] = value */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("petsc4py.PETSc.Vec.array_w.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_buf); __Pyx_XDECREF(__pyx_v_array); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":3443 * property array_r: * """Read-only `ndarray` containing the local portion of the vector.""" * def __get__(self) -> ArrayScalar: # <<<<<<<<<<<<<< * return self.getArray(True) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_7array_r_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_7array_r_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_7array_r___get__(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_7array_r___get__(struct PyPetscVecObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/Vec.pyx":3444 * """Read-only `ndarray` containing the local portion of the vector.""" * def __get__(self) -> ArrayScalar: * return self.getArray(True) # <<<<<<<<<<<<<< * * property buffer: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getArray); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 3444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, Py_True}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 3444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":3443 * property array_r: * """Read-only `ndarray` containing the local portion of the vector.""" * def __get__(self) -> ArrayScalar: # <<<<<<<<<<<<<< * return self.getArray(True) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Vec.array_r.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":3448 * property buffer: * """Alias for `buffer_w`.""" * def __get__(self) -> Any: # <<<<<<<<<<<<<< * return self.buffer_w * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_6buffer_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_6buffer_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_6buffer___get__(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_6buffer___get__(struct PyPetscVecObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/Vec.pyx":3449 * """Alias for `buffer_w`.""" * def __get__(self) -> Any: * return self.buffer_w # <<<<<<<<<<<<<< * * property array: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_buffer_w); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 3449, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":3448 * property buffer: * """Alias for `buffer_w`.""" * def __get__(self) -> Any: # <<<<<<<<<<<<<< * return self.buffer_w * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Vec.buffer.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":3453 * property array: * """Alias for `array_w`.""" * def __get__(self) -> ArrayScalar: # <<<<<<<<<<<<<< * return self.array_w * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_5array_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_5array_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_5array___get__(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_5array___get__(struct PyPetscVecObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/Vec.pyx":3454 * """Alias for `array_w`.""" * def __get__(self) -> ArrayScalar: * return self.array_w # <<<<<<<<<<<<<< * def __set__(self, value): * self.array_w = value */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_array_w); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 3454, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":3453 * property array: * """Alias for `array_w`.""" * def __get__(self) -> ArrayScalar: # <<<<<<<<<<<<<< * return self.array_w * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Vec.array.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":3455 * def __get__(self) -> ArrayScalar: * return self.array_w * def __set__(self, value): # <<<<<<<<<<<<<< * self.array_w = value * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_3Vec_5array_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_3Vec_5array_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_5array_2__set__(((struct PyPetscVecObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_3Vec_5array_2__set__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "petsc4py/PETSc/Vec.pyx":3456 * return self.array_w * def __set__(self, value): * self.array_w = value # <<<<<<<<<<<<<< * * # --- NumPy array interface (legacy) --- */ if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_array_w, __pyx_v_value) < 0) __PYX_ERR(41, 3456, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":3455 * def __get__(self) -> ArrayScalar: * return self.array_w * def __set__(self, value): # <<<<<<<<<<<<<< * self.array_w = value * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.array.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/Vec.pyx":3461 * * property __array_interface__: * def __get__(self): # <<<<<<<<<<<<<< * cdef buf = self.getBuffer() * return buf.__array_interface__ */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_19__array_interface___1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_19__array_interface___1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_19__array_interface_____get__(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_19__array_interface_____get__(struct PyPetscVecObject *__pyx_v_self) { PyObject *__pyx_v_buf = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/Vec.pyx":3462 * property __array_interface__: * def __get__(self): * cdef buf = self.getBuffer() # <<<<<<<<<<<<<< * return buf.__array_interface__ * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getBuffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 3462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 3462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_buf = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/Vec.pyx":3463 * def __get__(self): * cdef buf = self.getBuffer() * return buf.__array_interface__ # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_buf, __pyx_n_s_array_interface); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 3463, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Vec.pyx":3461 * * property __array_interface__: * def __get__(self): # <<<<<<<<<<<<<< * cdef buf = self.getBuffer() * return buf.__array_interface__ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Vec.__array_interface__.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_buf); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DT.pyx":5 * cdef class Quad(Object): * """Quadrature rule for integration.""" * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.quad * self.quad = NULL */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_4Quad_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_4Quad_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4Quad___cinit__(((struct PyPetscQuadObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_4Quad___cinit__(struct PyPetscQuadObject *__pyx_v_self) { int __pyx_r; /* "petsc4py/PETSc/DT.pyx":6 * """Quadrature rule for integration.""" * def __cinit__(self): * self.obj = &self.quad # <<<<<<<<<<<<<< * self.quad = NULL * */ __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->quad)); /* "petsc4py/PETSc/DT.pyx":7 * def __cinit__(self): * self.obj = &self.quad * self.quad = NULL # <<<<<<<<<<<<<< * * def view(self, Viewer viewer=None) -> None: */ __pyx_v_self->quad = NULL; /* "petsc4py/PETSc/DT.pyx":5 * cdef class Quad(Object): * """Quadrature rule for integration.""" * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.quad * self.quad = NULL */ /* function exit code */ __pyx_r = 0; return __pyx_r; } /* "petsc4py/PETSc/DT.pyx":9 * self.quad = NULL * * def view(self, Viewer viewer=None) -> None: # <<<<<<<<<<<<<< * """View a `Quad` object. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4Quad_3view(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4Quad_2view, "Quad.view(self, viewer: Viewer | None = None) -> None\nView a `Quad` object.\n\n Collective.\n\n Parameters\n ----------\n viewer\n A `Viewer` to display the graph.\n\n See Also\n --------\n petsc.PetscQuadratureView\n\n \nSource code at petsc4py/PETSc/DT.pyx:9"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4Quad_3view(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscViewerObject *__pyx_v_viewer = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("view (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscViewerObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_viewer); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(42, 9, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "view") < 0)) __PYX_ERR(42, 9, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, __pyx_nargs); __PYX_ERR(42, 9, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Quad.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(42, 9, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_4Quad_2view(((struct PyPetscQuadObject *)__pyx_v_self), __pyx_v_viewer); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4Quad_2view(struct PyPetscQuadObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer) { PetscViewer __pyx_v_vwr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscViewer __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("view", 1); /* "petsc4py/PETSc/DT.pyx":24 * * """ * cdef PetscViewer vwr = NULL # <<<<<<<<<<<<<< * if viewer is not None: vwr = viewer.vwr * CHKERR( PetscQuadratureView(self.quad, vwr) ) */ __pyx_v_vwr = NULL; /* "petsc4py/PETSc/DT.pyx":25 * """ * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr # <<<<<<<<<<<<<< * CHKERR( PetscQuadratureView(self.quad, vwr) ) * */ __pyx_t_1 = (((PyObject *)__pyx_v_viewer) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_viewer->vwr; __pyx_v_vwr = __pyx_t_2; } /* "petsc4py/PETSc/DT.pyx":26 * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr * CHKERR( PetscQuadratureView(self.quad, vwr) ) # <<<<<<<<<<<<<< * * def create(self, comm: Comm | None = None) -> Self: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscQuadratureView(__pyx_v_self->quad, __pyx_v_vwr)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(42, 26, __pyx_L1_error) /* "petsc4py/PETSc/DT.pyx":9 * self.quad = NULL * * def view(self, Viewer viewer=None) -> None: # <<<<<<<<<<<<<< * """View a `Quad` object. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Quad.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DT.pyx":28 * CHKERR( PetscQuadratureView(self.quad, vwr) ) * * def create(self, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Create a `Quad` object. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4Quad_5create(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4Quad_4create, "Quad.create(self, comm: Comm | None = None) -> Self\nCreate a `Quad` object.\n\n Collective.\n\n Parameters\n ----------\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n petsc.PetscQuadratureCreate\n\n \nSource code at petsc4py/PETSc/DT.pyx:28"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4Quad_5create(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(42, 28, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "create") < 0)) __PYX_ERR(42, 28, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_comm = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, __pyx_nargs); __PYX_ERR(42, 28, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Quad.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4Quad_4create(((struct PyPetscQuadObject *)__pyx_v_self), __pyx_v_comm); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4Quad_4create(struct PyPetscQuadObject *__pyx_v_self, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PetscQuadrature __pyx_v_newquad; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create", 1); /* "petsc4py/PETSc/DT.pyx":43 * * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscQuadrature newquad = NULL * CHKERR( PetscQuadratureCreate(ccomm, &newquad) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(42, 43, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/DT.pyx":44 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscQuadrature newquad = NULL # <<<<<<<<<<<<<< * CHKERR( PetscQuadratureCreate(ccomm, &newquad) ) * CHKERR( PetscCLEAR(self.obj) ); self.quad = newquad */ __pyx_v_newquad = NULL; /* "petsc4py/PETSc/DT.pyx":45 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscQuadrature newquad = NULL * CHKERR( PetscQuadratureCreate(ccomm, &newquad) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.quad = newquad * return self */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscQuadratureCreate(__pyx_v_ccomm, (&__pyx_v_newquad))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(42, 45, __pyx_L1_error) /* "petsc4py/PETSc/DT.pyx":46 * cdef PetscQuadrature newquad = NULL * CHKERR( PetscQuadratureCreate(ccomm, &newquad) ) * CHKERR( PetscCLEAR(self.obj) ); self.quad = newquad # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(42, 46, __pyx_L1_error) __pyx_v_self->quad = __pyx_v_newquad; /* "petsc4py/PETSc/DT.pyx":47 * CHKERR( PetscQuadratureCreate(ccomm, &newquad) ) * CHKERR( PetscCLEAR(self.obj) ); self.quad = newquad * return self # <<<<<<<<<<<<<< * * def duplicate(self) -> Quad: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/DT.pyx":28 * CHKERR( PetscQuadratureView(self.quad, vwr) ) * * def create(self, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Create a `Quad` object. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Quad.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DT.pyx":49 * return self * * def duplicate(self) -> Quad: # <<<<<<<<<<<<<< * """Create a deep copy of the `Quad` object. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4Quad_7duplicate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4Quad_6duplicate, "Quad.duplicate(self) -> Quad\nCreate a deep copy of the `Quad` object.\n\n Collective.\n\n See Also\n --------\n petsc.PetscQuadratureDuplicate\n\n \nSource code at petsc4py/PETSc/DT.pyx:49"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4Quad_7duplicate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("duplicate (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("duplicate", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "duplicate", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4Quad_6duplicate(((struct PyPetscQuadObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4Quad_6duplicate(struct PyPetscQuadObject *__pyx_v_self) { struct PyPetscQuadObject *__pyx_v_newquad = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("duplicate", 1); /* "petsc4py/PETSc/DT.pyx":59 * * """ * cdef Quad newquad = Quad() # <<<<<<<<<<<<<< * CHKERR( PetscQuadratureDuplicate(self.quad, &newquad.quad) ) * return newquad */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Quad)); if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_newquad = ((struct PyPetscQuadObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DT.pyx":60 * """ * cdef Quad newquad = Quad() * CHKERR( PetscQuadratureDuplicate(self.quad, &newquad.quad) ) # <<<<<<<<<<<<<< * return newquad * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscQuadratureDuplicate(__pyx_v_self->quad, (&__pyx_v_newquad->quad))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(42, 60, __pyx_L1_error) /* "petsc4py/PETSc/DT.pyx":61 * cdef Quad newquad = Quad() * CHKERR( PetscQuadratureDuplicate(self.quad, &newquad.quad) ) * return newquad # <<<<<<<<<<<<<< * * def destroy(self) -> Self: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_newquad); __pyx_r = ((PyObject *)__pyx_v_newquad); goto __pyx_L0; /* "petsc4py/PETSc/DT.pyx":49 * return self * * def duplicate(self) -> Quad: # <<<<<<<<<<<<<< * """Create a deep copy of the `Quad` object. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Quad.duplicate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_newquad); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DT.pyx":63 * return newquad * * def destroy(self) -> Self: # <<<<<<<<<<<<<< * """Destroy the `Quad` object. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4Quad_9destroy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4Quad_8destroy, "Quad.destroy(self) -> Self\nDestroy the `Quad` object.\n\n Collective.\n\n See Also\n --------\n petsc.PetscQuadratureDestroy\n\n \nSource code at petsc4py/PETSc/DT.pyx:63"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4Quad_9destroy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("destroy (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4Quad_8destroy(((struct PyPetscQuadObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4Quad_8destroy(struct PyPetscQuadObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("destroy", 1); /* "petsc4py/PETSc/DT.pyx":73 * * """ * CHKERR( PetscQuadratureDestroy(&self.quad) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscQuadratureDestroy((&__pyx_v_self->quad))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(42, 73, __pyx_L1_error) /* "petsc4py/PETSc/DT.pyx":74 * """ * CHKERR( PetscQuadratureDestroy(&self.quad) ) * return self # <<<<<<<<<<<<<< * * def getData(self) -> tuple(ArrayReal, ArrayReal): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/DT.pyx":63 * return newquad * * def destroy(self) -> Self: # <<<<<<<<<<<<<< * """Destroy the `Quad` object. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Quad.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DT.pyx":76 * return self * * def getData(self) -> tuple(ArrayReal, ArrayReal): # <<<<<<<<<<<<<< * """Return the data defining the `Quad`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4Quad_11getData(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4Quad_10getData, "Quad.getData(self) -> tuple(ArrayReal, ArrayReal)\nReturn the data defining the `Quad`.\n\n Not collective.\n\n Returns\n -------\n points : ArrayReal\n The coordinates of the quadrature points.\n weights : ArrayReal\n The quadrature weights.\n\n See Also\n --------\n petsc.PetscQuadratureGetData\n\n \nSource code at petsc4py/PETSc/DT.pyx:76"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4Quad_11getData(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getData (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getData", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getData", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4Quad_10getData(((struct PyPetscQuadObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4Quad_10getData(struct PyPetscQuadObject *__pyx_v_self) { PetscInt __pyx_v_cdim; PetscInt __pyx_v_cnc; PetscInt __pyx_v_cnpoints; PetscReal const *__pyx_v_cpoints; PetscReal const *__pyx_v_cweights; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getData", 1); /* "petsc4py/PETSc/DT.pyx":93 * * """ * cdef PetscInt cdim = 0 # <<<<<<<<<<<<<< * cdef PetscInt cnc = 0 * cdef PetscInt cnpoints = 0 */ __pyx_v_cdim = 0; /* "petsc4py/PETSc/DT.pyx":94 * """ * cdef PetscInt cdim = 0 * cdef PetscInt cnc = 0 # <<<<<<<<<<<<<< * cdef PetscInt cnpoints = 0 * cdef const PetscReal *cpoints = NULL */ __pyx_v_cnc = 0; /* "petsc4py/PETSc/DT.pyx":95 * cdef PetscInt cdim = 0 * cdef PetscInt cnc = 0 * cdef PetscInt cnpoints = 0 # <<<<<<<<<<<<<< * cdef const PetscReal *cpoints = NULL * cdef const PetscReal *cweights = NULL */ __pyx_v_cnpoints = 0; /* "petsc4py/PETSc/DT.pyx":96 * cdef PetscInt cnc = 0 * cdef PetscInt cnpoints = 0 * cdef const PetscReal *cpoints = NULL # <<<<<<<<<<<<<< * cdef const PetscReal *cweights = NULL * CHKERR( PetscQuadratureGetData(self.quad, &cdim, &cnc, &cnpoints, &cpoints, &cweights)) */ __pyx_v_cpoints = NULL; /* "petsc4py/PETSc/DT.pyx":97 * cdef PetscInt cnpoints = 0 * cdef const PetscReal *cpoints = NULL * cdef const PetscReal *cweights = NULL # <<<<<<<<<<<<<< * CHKERR( PetscQuadratureGetData(self.quad, &cdim, &cnc, &cnpoints, &cpoints, &cweights)) * return array_r(cnpoints*cdim, cpoints), array_r(cnpoints*cnc, cweights) */ __pyx_v_cweights = NULL; /* "petsc4py/PETSc/DT.pyx":98 * cdef const PetscReal *cpoints = NULL * cdef const PetscReal *cweights = NULL * CHKERR( PetscQuadratureGetData(self.quad, &cdim, &cnc, &cnpoints, &cpoints, &cweights)) # <<<<<<<<<<<<<< * return array_r(cnpoints*cdim, cpoints), array_r(cnpoints*cnc, cweights) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscQuadratureGetData(__pyx_v_self->quad, (&__pyx_v_cdim), (&__pyx_v_cnc), (&__pyx_v_cnpoints), (&__pyx_v_cpoints), (&__pyx_v_cweights))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(42, 98, __pyx_L1_error) /* "petsc4py/PETSc/DT.pyx":99 * cdef const PetscReal *cweights = NULL * CHKERR( PetscQuadratureGetData(self.quad, &cdim, &cnc, &cnpoints, &cpoints, &cweights)) * return array_r(cnpoints*cdim, cpoints), array_r(cnpoints*cnc, cweights) # <<<<<<<<<<<<<< * * # FIXME: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_r((__pyx_v_cnpoints * __pyx_v_cdim), __pyx_v_cpoints)); if (unlikely(!__pyx_t_2)) __PYX_ERR(42, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_r((__pyx_v_cnpoints * __pyx_v_cnc), __pyx_v_cweights)); if (unlikely(!__pyx_t_3)) __PYX_ERR(42, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(42, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(42, 99, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(42, 99, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DT.pyx":76 * return self * * def getData(self) -> tuple(ArrayReal, ArrayReal): # <<<<<<<<<<<<<< * """Return the data defining the `Quad`. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.Quad.getData", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DT.pyx":104 * # def setData(???) * * def getNumComponents(self) -> int: # <<<<<<<<<<<<<< * """Return the number of components for functions to be integrated. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4Quad_13getNumComponents(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4Quad_12getNumComponents, "Quad.getNumComponents(self) -> int\nReturn the number of components for functions to be integrated.\n\n Not collective.\n\n See Also\n --------\n setNumComponents, petsc.PetscQuadratureGetNumComponents\n\n \nSource code at petsc4py/PETSc/DT.pyx:104"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4Quad_13getNumComponents(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getNumComponents (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getNumComponents", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getNumComponents", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4Quad_12getNumComponents(((struct PyPetscQuadObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4Quad_12getNumComponents(struct PyPetscQuadObject *__pyx_v_self) { PetscInt __pyx_v_cnc; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getNumComponents", 1); /* "petsc4py/PETSc/DT.pyx":114 * * """ * cdef PetscInt cnc = 0 # <<<<<<<<<<<<<< * CHKERR( PetscQuadratureGetNumComponents(self.quad, &cnc) ) * return toInt(cnc) */ __pyx_v_cnc = 0; /* "petsc4py/PETSc/DT.pyx":115 * """ * cdef PetscInt cnc = 0 * CHKERR( PetscQuadratureGetNumComponents(self.quad, &cnc) ) # <<<<<<<<<<<<<< * return toInt(cnc) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscQuadratureGetNumComponents(__pyx_v_self->quad, (&__pyx_v_cnc))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(42, 115, __pyx_L1_error) /* "petsc4py/PETSc/DT.pyx":116 * cdef PetscInt cnc = 0 * CHKERR( PetscQuadratureGetNumComponents(self.quad, &cnc) ) * return toInt(cnc) # <<<<<<<<<<<<<< * * def setNumComponents(self, nc: int) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_cnc); if (unlikely(!__pyx_t_2)) __PYX_ERR(42, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DT.pyx":104 * # def setData(???) * * def getNumComponents(self) -> int: # <<<<<<<<<<<<<< * """Return the number of components for functions to be integrated. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Quad.getNumComponents", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DT.pyx":118 * return toInt(cnc) * * def setNumComponents(self, nc: int) -> None: # <<<<<<<<<<<<<< * """Return the number of components for functions to be integrated. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4Quad_15setNumComponents(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4Quad_14setNumComponents, "Quad.setNumComponents(self, nc: int) -> None\nReturn the number of components for functions to be integrated.\n\n Not collective.\n\n Parameters\n ----------\n nc\n The number of components.\n\n See Also\n --------\n getNumComponents, petsc.PetscQuadratureSetNumComponents\n\n \nSource code at petsc4py/PETSc/DT.pyx:118"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4Quad_15setNumComponents(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_nc = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setNumComponents (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nc,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_nc)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(42, 118, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setNumComponents") < 0)) __PYX_ERR(42, 118, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_nc = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setNumComponents", 1, 1, 1, __pyx_nargs); __PYX_ERR(42, 118, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Quad.setNumComponents", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4Quad_14setNumComponents(((struct PyPetscQuadObject *)__pyx_v_self), __pyx_v_nc); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4Quad_14setNumComponents(struct PyPetscQuadObject *__pyx_v_self, PyObject *__pyx_v_nc) { PetscInt __pyx_v_cnc; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setNumComponents", 1); /* "petsc4py/PETSc/DT.pyx":133 * * """ * cdef PetscInt cnc = asInt(nc) # <<<<<<<<<<<<<< * CHKERR( PetscQuadratureSetNumComponents(self.quad, cnc) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_nc); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(42, 133, __pyx_L1_error) __pyx_v_cnc = __pyx_t_1; /* "petsc4py/PETSc/DT.pyx":134 * """ * cdef PetscInt cnc = asInt(nc) * CHKERR( PetscQuadratureSetNumComponents(self.quad, cnc) ) # <<<<<<<<<<<<<< * * def getOrder(self) -> int: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscQuadratureSetNumComponents(__pyx_v_self->quad, __pyx_v_cnc)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(42, 134, __pyx_L1_error) /* "petsc4py/PETSc/DT.pyx":118 * return toInt(cnc) * * def setNumComponents(self, nc: int) -> None: # <<<<<<<<<<<<<< * """Return the number of components for functions to be integrated. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Quad.setNumComponents", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DT.pyx":136 * CHKERR( PetscQuadratureSetNumComponents(self.quad, cnc) ) * * def getOrder(self) -> int: # <<<<<<<<<<<<<< * """Return the order of the method in the `Quad`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4Quad_17getOrder(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4Quad_16getOrder, "Quad.getOrder(self) -> int\nReturn the order of the method in the `Quad`.\n\n Not collective.\n\n See Also\n --------\n setOrder, petsc.PetscQuadratureGetOrder\n\n \nSource code at petsc4py/PETSc/DT.pyx:136"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4Quad_17getOrder(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getOrder (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getOrder", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getOrder", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4Quad_16getOrder(((struct PyPetscQuadObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4Quad_16getOrder(struct PyPetscQuadObject *__pyx_v_self) { PetscInt __pyx_v_corder; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getOrder", 1); /* "petsc4py/PETSc/DT.pyx":146 * * """ * cdef PetscInt corder = 0 # <<<<<<<<<<<<<< * CHKERR( PetscQuadratureGetOrder(self.quad, &corder)) * return toInt(corder) */ __pyx_v_corder = 0; /* "petsc4py/PETSc/DT.pyx":147 * """ * cdef PetscInt corder = 0 * CHKERR( PetscQuadratureGetOrder(self.quad, &corder)) # <<<<<<<<<<<<<< * return toInt(corder) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscQuadratureGetOrder(__pyx_v_self->quad, (&__pyx_v_corder))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(42, 147, __pyx_L1_error) /* "petsc4py/PETSc/DT.pyx":148 * cdef PetscInt corder = 0 * CHKERR( PetscQuadratureGetOrder(self.quad, &corder)) * return toInt(corder) # <<<<<<<<<<<<<< * * def setOrder(self, order: int) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_corder); if (unlikely(!__pyx_t_2)) __PYX_ERR(42, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DT.pyx":136 * CHKERR( PetscQuadratureSetNumComponents(self.quad, cnc) ) * * def getOrder(self) -> int: # <<<<<<<<<<<<<< * """Return the order of the method in the `Quad`. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Quad.getOrder", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DT.pyx":150 * return toInt(corder) * * def setOrder(self, order: int) -> None: # <<<<<<<<<<<<<< * """Set the order of the method in the `Quad`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4Quad_19setOrder(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4Quad_18setOrder, "Quad.setOrder(self, order: int) -> None\nSet the order of the method in the `Quad`.\n\n Not collective.\n\n Parameters\n ----------\n order\n The order of the quadrature, i.e. the highest degree polynomial\n that is exactly integrated.\n\n See Also\n --------\n getOrder, petsc.PetscQuadratureSetOrder\n\n \nSource code at petsc4py/PETSc/DT.pyx:150"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4Quad_19setOrder(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_order = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setOrder (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_order,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_order)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(42, 150, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setOrder") < 0)) __PYX_ERR(42, 150, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_order = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setOrder", 1, 1, 1, __pyx_nargs); __PYX_ERR(42, 150, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Quad.setOrder", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4Quad_18setOrder(((struct PyPetscQuadObject *)__pyx_v_self), __pyx_v_order); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4Quad_18setOrder(struct PyPetscQuadObject *__pyx_v_self, PyObject *__pyx_v_order) { PetscInt __pyx_v_corder; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setOrder", 1); /* "petsc4py/PETSc/DT.pyx":166 * * """ * cdef PetscInt corder = asInt(order) # <<<<<<<<<<<<<< * CHKERR( PetscQuadratureSetOrder(self.quad, corder)) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_order); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(42, 166, __pyx_L1_error) __pyx_v_corder = __pyx_t_1; /* "petsc4py/PETSc/DT.pyx":167 * """ * cdef PetscInt corder = asInt(order) * CHKERR( PetscQuadratureSetOrder(self.quad, corder)) # <<<<<<<<<<<<<< * * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscQuadratureSetOrder(__pyx_v_self->quad, __pyx_v_corder)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(42, 167, __pyx_L1_error) /* "petsc4py/PETSc/DT.pyx":150 * return toInt(corder) * * def setOrder(self, order: int) -> None: # <<<<<<<<<<<<<< * """Set the order of the method in the `Quad`. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Quad.setOrder", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/FE.pyx":15 * Type = FEType * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.fe * self.fe = NULL */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_2FE_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_2FE_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE___cinit__(((struct PyPetscFEObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_2FE___cinit__(struct PyPetscFEObject *__pyx_v_self) { int __pyx_r; /* "petsc4py/PETSc/FE.pyx":16 * * def __cinit__(self): * self.obj = &self.fe # <<<<<<<<<<<<<< * self.fe = NULL * */ __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->fe)); /* "petsc4py/PETSc/FE.pyx":17 * def __cinit__(self): * self.obj = &self.fe * self.fe = NULL # <<<<<<<<<<<<<< * * def view(self, Viewer viewer=None) -> None: */ __pyx_v_self->fe = NULL; /* "petsc4py/PETSc/FE.pyx":15 * Type = FEType * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.fe * self.fe = NULL */ /* function exit code */ __pyx_r = 0; return __pyx_r; } /* "petsc4py/PETSc/FE.pyx":19 * self.fe = NULL * * def view(self, Viewer viewer=None) -> None: # <<<<<<<<<<<<<< * """View a `FE` object. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_3view(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2FE_2view, "FE.view(self, viewer: Viewer | None = None) -> None\nView a `FE` object.\n\n Collective.\n\n Parameters\n ----------\n viewer\n A `Viewer` to display the graph.\n\n See Also\n --------\n petsc.PetscFEView\n\n \nSource code at petsc4py/PETSc/FE.pyx:19"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_3view(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscViewerObject *__pyx_v_viewer = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("view (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscViewerObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_viewer); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(43, 19, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "view") < 0)) __PYX_ERR(43, 19, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, __pyx_nargs); __PYX_ERR(43, 19, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.FE.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(43, 19, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE_2view(((struct PyPetscFEObject *)__pyx_v_self), __pyx_v_viewer); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_2view(struct PyPetscFEObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer) { PetscViewer __pyx_v_vwr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscViewer __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("view", 1); /* "petsc4py/PETSc/FE.pyx":34 * * """ * cdef PetscViewer vwr = NULL # <<<<<<<<<<<<<< * if viewer is not None: vwr = viewer.vwr * CHKERR( PetscFEView(self.fe, vwr) ) */ __pyx_v_vwr = NULL; /* "petsc4py/PETSc/FE.pyx":35 * """ * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr # <<<<<<<<<<<<<< * CHKERR( PetscFEView(self.fe, vwr) ) * */ __pyx_t_1 = (((PyObject *)__pyx_v_viewer) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_viewer->vwr; __pyx_v_vwr = __pyx_t_2; } /* "petsc4py/PETSc/FE.pyx":36 * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr * CHKERR( PetscFEView(self.fe, vwr) ) # <<<<<<<<<<<<<< * * def destroy(self) -> Self: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFEView(__pyx_v_self->fe, __pyx_v_vwr)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(43, 36, __pyx_L1_error) /* "petsc4py/PETSc/FE.pyx":19 * self.fe = NULL * * def view(self, Viewer viewer=None) -> None: # <<<<<<<<<<<<<< * """View a `FE` object. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.FE.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/FE.pyx":38 * CHKERR( PetscFEView(self.fe, vwr) ) * * def destroy(self) -> Self: # <<<<<<<<<<<<<< * """Destroy the `FE` object. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_5destroy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2FE_4destroy, "FE.destroy(self) -> Self\nDestroy the `FE` object.\n\n Collective.\n\n See Also\n --------\n petsc.PetscFEDestroy\n\n \nSource code at petsc4py/PETSc/FE.pyx:38"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_5destroy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("destroy (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE_4destroy(((struct PyPetscFEObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_4destroy(struct PyPetscFEObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("destroy", 1); /* "petsc4py/PETSc/FE.pyx":48 * * """ * CHKERR( PetscFEDestroy(&self.fe) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFEDestroy((&__pyx_v_self->fe))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(43, 48, __pyx_L1_error) /* "petsc4py/PETSc/FE.pyx":49 * """ * CHKERR( PetscFEDestroy(&self.fe) ) * return self # <<<<<<<<<<<<<< * * def create(self, comm: Comm | None = None) -> Self: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/FE.pyx":38 * CHKERR( PetscFEView(self.fe, vwr) ) * * def destroy(self) -> Self: # <<<<<<<<<<<<<< * """Destroy the `FE` object. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.FE.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/FE.pyx":51 * return self * * def create(self, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Create an empty `FE` object. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_7create(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2FE_6create, "FE.create(self, comm: Comm | None = None) -> Self\nCreate an empty `FE` object.\n\n Collective.\n\n The type can then be set with `setType`.\n\n Parameters\n ----------\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n setType, petsc.PetscFECreate\n\n \nSource code at petsc4py/PETSc/FE.pyx:51"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_7create(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(43, 51, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "create") < 0)) __PYX_ERR(43, 51, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_comm = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, __pyx_nargs); __PYX_ERR(43, 51, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.FE.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE_6create(((struct PyPetscFEObject *)__pyx_v_self), __pyx_v_comm); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_6create(struct PyPetscFEObject *__pyx_v_self, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PetscFE __pyx_v_newfe; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create", 1); /* "petsc4py/PETSc/FE.pyx":68 * * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscFE newfe = NULL * CHKERR( PetscFECreate(ccomm, &newfe) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(43, 68, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/FE.pyx":69 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscFE newfe = NULL # <<<<<<<<<<<<<< * CHKERR( PetscFECreate(ccomm, &newfe) ) * CHKERR( PetscCLEAR(self.obj) ); self.fe = newfe */ __pyx_v_newfe = NULL; /* "petsc4py/PETSc/FE.pyx":70 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscFE newfe = NULL * CHKERR( PetscFECreate(ccomm, &newfe) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.fe = newfe * return self */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFECreate(__pyx_v_ccomm, (&__pyx_v_newfe))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(43, 70, __pyx_L1_error) /* "petsc4py/PETSc/FE.pyx":71 * cdef PetscFE newfe = NULL * CHKERR( PetscFECreate(ccomm, &newfe) ) * CHKERR( PetscCLEAR(self.obj) ); self.fe = newfe # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(43, 71, __pyx_L1_error) __pyx_v_self->fe = __pyx_v_newfe; /* "petsc4py/PETSc/FE.pyx":72 * CHKERR( PetscFECreate(ccomm, &newfe) ) * CHKERR( PetscCLEAR(self.obj) ); self.fe = newfe * return self # <<<<<<<<<<<<<< * * def createDefault( */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/FE.pyx":51 * return self * * def create(self, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Create an empty `FE` object. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.FE.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/FE.pyx":74 * return self * * def createDefault( # <<<<<<<<<<<<<< * self, * dim: int, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_9createDefault(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2FE_8createDefault, "FE.createDefault(self, dim: int, nc: int, isSimplex: bool, qorder: int = DETERMINE, prefix: str = None, comm: Comm | None = None) -> Self\nCreate a `FE` for basic FEM computation.\n\n Collective.\n\n Parameters\n ----------\n dim\n The spatial dimension.\n nc\n The number of components.\n isSimplex\n Flag for simplex reference cell, otherwise it's a tensor product.\n qorder\n The quadrature order or `DETERMINE` to use `Space` polynomial\n degree.\n prefix\n The options prefix, or `None`.\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n petsc.PetscFECreateDefault\n\n \nSource code at petsc4py/PETSc/FE.pyx:74"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_9createDefault(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_dim = 0; PyObject *__pyx_v_nc = 0; PyObject *__pyx_v_isSimplex = 0; PyObject *__pyx_v_qorder = 0; PyObject *__pyx_v_prefix = 0; PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[6] = {0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createDefault (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dim,&__pyx_n_s_nc,&__pyx_n_s_isSimplex,&__pyx_n_s_qorder,&__pyx_n_s_prefix,&__pyx_n_s_comm,0}; values[3] = __Pyx_Arg_NewRef_FASTCALL(__pyx_k__49); /* "petsc4py/PETSc/FE.pyx":80 * isSimplex: bool, * qorder: int = DETERMINE, * prefix: str = None, # <<<<<<<<<<<<<< * comm: Comm | None = None * ) -> Self: */ values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/FE.pyx":81 * qorder: int = DETERMINE, * prefix: str = None, * comm: Comm | None = None # <<<<<<<<<<<<<< * ) -> Self: * """Create a `FE` for basic FEM computation. */ values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dim)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(43, 74, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_nc)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(43, 74, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("createDefault", 0, 3, 6, 1); __PYX_ERR(43, 74, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_isSimplex)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(43, 74, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("createDefault", 0, 3, 6, 2); __PYX_ERR(43, 74, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_qorder); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(43, 74, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_prefix); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(43, 74, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(43, 74, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createDefault") < 0)) __PYX_ERR(43, 74, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_dim = values[0]; __pyx_v_nc = values[1]; __pyx_v_isSimplex = values[2]; __pyx_v_qorder = values[3]; __pyx_v_prefix = values[4]; __pyx_v_comm = values[5]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createDefault", 0, 3, 6, __pyx_nargs); __PYX_ERR(43, 74, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.FE.createDefault", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE_8createDefault(((struct PyPetscFEObject *)__pyx_v_self), __pyx_v_dim, __pyx_v_nc, __pyx_v_isSimplex, __pyx_v_qorder, __pyx_v_prefix, __pyx_v_comm); /* "petsc4py/PETSc/FE.pyx":74 * return self * * def createDefault( # <<<<<<<<<<<<<< * self, * dim: int, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_8createDefault(struct PyPetscFEObject *__pyx_v_self, PyObject *__pyx_v_dim, PyObject *__pyx_v_nc, PyObject *__pyx_v_isSimplex, PyObject *__pyx_v_qorder, PyObject *__pyx_v_prefix, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PetscFE __pyx_v_newfe; PetscInt __pyx_v_cdim; PetscInt __pyx_v_cnc; PetscInt __pyx_v_cqorder; PetscBool __pyx_v_cisSimplex; char const *__pyx_v_cprefix; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PetscInt __pyx_t_2; PetscBool __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PetscErrorCode __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createDefault", 0); __Pyx_INCREF(__pyx_v_prefix); /* "petsc4py/PETSc/FE.pyx":108 * * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscFE newfe = NULL * cdef PetscInt cdim = asInt(dim) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(43, 108, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/FE.pyx":109 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscFE newfe = NULL # <<<<<<<<<<<<<< * cdef PetscInt cdim = asInt(dim) * cdef PetscInt cnc = asInt(nc) */ __pyx_v_newfe = NULL; /* "petsc4py/PETSc/FE.pyx":110 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscFE newfe = NULL * cdef PetscInt cdim = asInt(dim) # <<<<<<<<<<<<<< * cdef PetscInt cnc = asInt(nc) * cdef PetscInt cqorder = asInt(qorder) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_dim); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(43, 110, __pyx_L1_error) __pyx_v_cdim = __pyx_t_2; /* "petsc4py/PETSc/FE.pyx":111 * cdef PetscFE newfe = NULL * cdef PetscInt cdim = asInt(dim) * cdef PetscInt cnc = asInt(nc) # <<<<<<<<<<<<<< * cdef PetscInt cqorder = asInt(qorder) * cdef PetscBool cisSimplex = asBool(isSimplex) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_nc); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(43, 111, __pyx_L1_error) __pyx_v_cnc = __pyx_t_2; /* "petsc4py/PETSc/FE.pyx":112 * cdef PetscInt cdim = asInt(dim) * cdef PetscInt cnc = asInt(nc) * cdef PetscInt cqorder = asInt(qorder) # <<<<<<<<<<<<<< * cdef PetscBool cisSimplex = asBool(isSimplex) * cdef const char *cprefix = NULL */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_qorder); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(43, 112, __pyx_L1_error) __pyx_v_cqorder = __pyx_t_2; /* "petsc4py/PETSc/FE.pyx":113 * cdef PetscInt cnc = asInt(nc) * cdef PetscInt cqorder = asInt(qorder) * cdef PetscBool cisSimplex = asBool(isSimplex) # <<<<<<<<<<<<<< * cdef const char *cprefix = NULL * if prefix: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asBool(__pyx_v_isSimplex); if (unlikely(__pyx_t_3 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(43, 113, __pyx_L1_error) __pyx_v_cisSimplex = __pyx_t_3; /* "petsc4py/PETSc/FE.pyx":114 * cdef PetscInt cqorder = asInt(qorder) * cdef PetscBool cisSimplex = asBool(isSimplex) * cdef const char *cprefix = NULL # <<<<<<<<<<<<<< * if prefix: * prefix = str2bytes(prefix, &cprefix) */ __pyx_v_cprefix = NULL; /* "petsc4py/PETSc/FE.pyx":115 * cdef PetscBool cisSimplex = asBool(isSimplex) * cdef const char *cprefix = NULL * if prefix: # <<<<<<<<<<<<<< * prefix = str2bytes(prefix, &cprefix) * CHKERR( PetscFECreateDefault(ccomm, cdim, cnc, cisSimplex, cprefix, cqorder, &newfe)) */ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_prefix); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(43, 115, __pyx_L1_error) if (__pyx_t_4) { /* "petsc4py/PETSc/FE.pyx":116 * cdef const char *cprefix = NULL * if prefix: * prefix = str2bytes(prefix, &cprefix) # <<<<<<<<<<<<<< * CHKERR( PetscFECreateDefault(ccomm, cdim, cnc, cisSimplex, cprefix, cqorder, &newfe)) * CHKERR( PetscCLEAR(self.obj) ); self.fe = newfe */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_prefix, (&__pyx_v_cprefix)); if (unlikely(!__pyx_t_5)) __PYX_ERR(43, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_prefix, __pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/FE.pyx":115 * cdef PetscBool cisSimplex = asBool(isSimplex) * cdef const char *cprefix = NULL * if prefix: # <<<<<<<<<<<<<< * prefix = str2bytes(prefix, &cprefix) * CHKERR( PetscFECreateDefault(ccomm, cdim, cnc, cisSimplex, cprefix, cqorder, &newfe)) */ } /* "petsc4py/PETSc/FE.pyx":117 * if prefix: * prefix = str2bytes(prefix, &cprefix) * CHKERR( PetscFECreateDefault(ccomm, cdim, cnc, cisSimplex, cprefix, cqorder, &newfe)) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.fe = newfe * return self */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFECreateDefault(__pyx_v_ccomm, __pyx_v_cdim, __pyx_v_cnc, __pyx_v_cisSimplex, __pyx_v_cprefix, __pyx_v_cqorder, (&__pyx_v_newfe))); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(43, 117, __pyx_L1_error) /* "petsc4py/PETSc/FE.pyx":118 * prefix = str2bytes(prefix, &cprefix) * CHKERR( PetscFECreateDefault(ccomm, cdim, cnc, cisSimplex, cprefix, cqorder, &newfe)) * CHKERR( PetscCLEAR(self.obj) ); self.fe = newfe # <<<<<<<<<<<<<< * return self * */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(43, 118, __pyx_L1_error) __pyx_v_self->fe = __pyx_v_newfe; /* "petsc4py/PETSc/FE.pyx":119 * CHKERR( PetscFECreateDefault(ccomm, cdim, cnc, cisSimplex, cprefix, cqorder, &newfe)) * CHKERR( PetscCLEAR(self.obj) ); self.fe = newfe * return self # <<<<<<<<<<<<<< * * def createLagrange( */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/FE.pyx":74 * return self * * def createDefault( # <<<<<<<<<<<<<< * self, * dim: int, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.FE.createDefault", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_prefix); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/FE.pyx":121 * return self * * def createLagrange( # <<<<<<<<<<<<<< * self, * dim: int, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_11createLagrange(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2FE_10createLagrange, "FE.createLagrange(self, dim: int, nc: int, isSimplex: bool, k: int, qorder: int = DETERMINE, comm: Comm | None = None) -> Self\nCreate a `FE` for the basic Lagrange space of degree k.\n\n Collective.\n\n Parameters\n ----------\n dim\n The spatial dimension.\n nc\n The number of components.\n isSimplex\n Flag for simplex reference cell, otherwise it's a tensor product.\n k\n The degree of the space.\n qorder\n The quadrature order or `DETERMINE` to use `Space` polynomial\n degree.\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n petsc.PetscFECreateLagrange\n\n \nSource code at petsc4py/PETSc/FE.pyx:121"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_11createLagrange(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_dim = 0; PyObject *__pyx_v_nc = 0; PyObject *__pyx_v_isSimplex = 0; PyObject *__pyx_v_k = 0; PyObject *__pyx_v_qorder = 0; PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[6] = {0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createLagrange (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dim,&__pyx_n_s_nc,&__pyx_n_s_isSimplex,&__pyx_n_s_k,&__pyx_n_s_qorder,&__pyx_n_s_comm,0}; values[4] = __Pyx_Arg_NewRef_FASTCALL(__pyx_k__50); /* "petsc4py/PETSc/FE.pyx":128 * k: int, * qorder: int = DETERMINE, * comm: Comm | None = None # <<<<<<<<<<<<<< * ) -> Self: * """Create a `FE` for the basic Lagrange space of degree k. */ values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dim)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(43, 121, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_nc)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(43, 121, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("createLagrange", 0, 4, 6, 1); __PYX_ERR(43, 121, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_isSimplex)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(43, 121, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("createLagrange", 0, 4, 6, 2); __PYX_ERR(43, 121, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_k)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(43, 121, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("createLagrange", 0, 4, 6, 3); __PYX_ERR(43, 121, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_qorder); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(43, 121, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(43, 121, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createLagrange") < 0)) __PYX_ERR(43, 121, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_dim = values[0]; __pyx_v_nc = values[1]; __pyx_v_isSimplex = values[2]; __pyx_v_k = values[3]; __pyx_v_qorder = values[4]; __pyx_v_comm = values[5]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createLagrange", 0, 4, 6, __pyx_nargs); __PYX_ERR(43, 121, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.FE.createLagrange", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE_10createLagrange(((struct PyPetscFEObject *)__pyx_v_self), __pyx_v_dim, __pyx_v_nc, __pyx_v_isSimplex, __pyx_v_k, __pyx_v_qorder, __pyx_v_comm); /* "petsc4py/PETSc/FE.pyx":121 * return self * * def createLagrange( # <<<<<<<<<<<<<< * self, * dim: int, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_10createLagrange(struct PyPetscFEObject *__pyx_v_self, PyObject *__pyx_v_dim, PyObject *__pyx_v_nc, PyObject *__pyx_v_isSimplex, PyObject *__pyx_v_k, PyObject *__pyx_v_qorder, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PetscFE __pyx_v_newfe; PetscInt __pyx_v_cdim; PetscInt __pyx_v_cnc; PetscInt __pyx_v_ck; PetscInt __pyx_v_cqorder; PetscBool __pyx_v_cisSimplex; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PetscInt __pyx_t_2; PetscBool __pyx_t_3; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createLagrange", 1); /* "petsc4py/PETSc/FE.pyx":155 * * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscFE newfe = NULL * cdef PetscInt cdim = asInt(dim) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(43, 155, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/FE.pyx":156 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscFE newfe = NULL # <<<<<<<<<<<<<< * cdef PetscInt cdim = asInt(dim) * cdef PetscInt cnc = asInt(nc) */ __pyx_v_newfe = NULL; /* "petsc4py/PETSc/FE.pyx":157 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscFE newfe = NULL * cdef PetscInt cdim = asInt(dim) # <<<<<<<<<<<<<< * cdef PetscInt cnc = asInt(nc) * cdef PetscInt ck = asInt(k) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_dim); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(43, 157, __pyx_L1_error) __pyx_v_cdim = __pyx_t_2; /* "petsc4py/PETSc/FE.pyx":158 * cdef PetscFE newfe = NULL * cdef PetscInt cdim = asInt(dim) * cdef PetscInt cnc = asInt(nc) # <<<<<<<<<<<<<< * cdef PetscInt ck = asInt(k) * cdef PetscInt cqorder = asInt(qorder) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_nc); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(43, 158, __pyx_L1_error) __pyx_v_cnc = __pyx_t_2; /* "petsc4py/PETSc/FE.pyx":159 * cdef PetscInt cdim = asInt(dim) * cdef PetscInt cnc = asInt(nc) * cdef PetscInt ck = asInt(k) # <<<<<<<<<<<<<< * cdef PetscInt cqorder = asInt(qorder) * cdef PetscBool cisSimplex = asBool(isSimplex) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_k); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(43, 159, __pyx_L1_error) __pyx_v_ck = __pyx_t_2; /* "petsc4py/PETSc/FE.pyx":160 * cdef PetscInt cnc = asInt(nc) * cdef PetscInt ck = asInt(k) * cdef PetscInt cqorder = asInt(qorder) # <<<<<<<<<<<<<< * cdef PetscBool cisSimplex = asBool(isSimplex) * CHKERR( PetscFECreateLagrange(ccomm, cdim, cnc, cisSimplex, ck, cqorder, &newfe)) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_qorder); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(43, 160, __pyx_L1_error) __pyx_v_cqorder = __pyx_t_2; /* "petsc4py/PETSc/FE.pyx":161 * cdef PetscInt ck = asInt(k) * cdef PetscInt cqorder = asInt(qorder) * cdef PetscBool cisSimplex = asBool(isSimplex) # <<<<<<<<<<<<<< * CHKERR( PetscFECreateLagrange(ccomm, cdim, cnc, cisSimplex, ck, cqorder, &newfe)) * CHKERR( PetscCLEAR(self.obj) ); self.fe = newfe */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asBool(__pyx_v_isSimplex); if (unlikely(__pyx_t_3 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(43, 161, __pyx_L1_error) __pyx_v_cisSimplex = __pyx_t_3; /* "petsc4py/PETSc/FE.pyx":162 * cdef PetscInt cqorder = asInt(qorder) * cdef PetscBool cisSimplex = asBool(isSimplex) * CHKERR( PetscFECreateLagrange(ccomm, cdim, cnc, cisSimplex, ck, cqorder, &newfe)) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.fe = newfe * return self */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFECreateLagrange(__pyx_v_ccomm, __pyx_v_cdim, __pyx_v_cnc, __pyx_v_cisSimplex, __pyx_v_ck, __pyx_v_cqorder, (&__pyx_v_newfe))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(43, 162, __pyx_L1_error) /* "petsc4py/PETSc/FE.pyx":163 * cdef PetscBool cisSimplex = asBool(isSimplex) * CHKERR( PetscFECreateLagrange(ccomm, cdim, cnc, cisSimplex, ck, cqorder, &newfe)) * CHKERR( PetscCLEAR(self.obj) ); self.fe = newfe # <<<<<<<<<<<<<< * return self * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(43, 163, __pyx_L1_error) __pyx_v_self->fe = __pyx_v_newfe; /* "petsc4py/PETSc/FE.pyx":164 * CHKERR( PetscFECreateLagrange(ccomm, cdim, cnc, cisSimplex, ck, cqorder, &newfe)) * CHKERR( PetscCLEAR(self.obj) ); self.fe = newfe * return self # <<<<<<<<<<<<<< * * def getQuadrature(self) -> Quad: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/FE.pyx":121 * return self * * def createLagrange( # <<<<<<<<<<<<<< * self, * dim: int, */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.FE.createLagrange", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/FE.pyx":166 * return self * * def getQuadrature(self) -> Quad: # <<<<<<<<<<<<<< * """Return the `Quad` used to calculate inner products. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_13getQuadrature(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2FE_12getQuadrature, "FE.getQuadrature(self) -> Quad\nReturn the `Quad` used to calculate inner products.\n\n Not collective.\n\n See Also\n --------\n setQuadrature, petsc.PetscFEGetQuadrature\n\n \nSource code at petsc4py/PETSc/FE.pyx:166"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_13getQuadrature(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getQuadrature (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getQuadrature", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getQuadrature", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE_12getQuadrature(((struct PyPetscFEObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_12getQuadrature(struct PyPetscFEObject *__pyx_v_self) { struct PyPetscQuadObject *__pyx_v_quad = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getQuadrature", 1); /* "petsc4py/PETSc/FE.pyx":176 * * """ * cdef Quad quad = Quad() # <<<<<<<<<<<<<< * CHKERR( PetscFEGetQuadrature(self.fe, &quad.quad) ) * return quad */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Quad)); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_quad = ((struct PyPetscQuadObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/FE.pyx":177 * """ * cdef Quad quad = Quad() * CHKERR( PetscFEGetQuadrature(self.fe, &quad.quad) ) # <<<<<<<<<<<<<< * return quad * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFEGetQuadrature(__pyx_v_self->fe, (&__pyx_v_quad->quad))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(43, 177, __pyx_L1_error) /* "petsc4py/PETSc/FE.pyx":178 * cdef Quad quad = Quad() * CHKERR( PetscFEGetQuadrature(self.fe, &quad.quad) ) * return quad # <<<<<<<<<<<<<< * * def getDimension(self) -> int: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_quad); __pyx_r = ((PyObject *)__pyx_v_quad); goto __pyx_L0; /* "petsc4py/PETSc/FE.pyx":166 * return self * * def getQuadrature(self) -> Quad: # <<<<<<<<<<<<<< * """Return the `Quad` used to calculate inner products. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.FE.getQuadrature", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_quad); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/FE.pyx":180 * return quad * * def getDimension(self) -> int: # <<<<<<<<<<<<<< * """Return the dimension of the finite element space on a cell. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_15getDimension(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2FE_14getDimension, "FE.getDimension(self) -> int\nReturn the dimension of the finite element space on a cell.\n\n Not collective.\n\n See Also\n --------\n petsc.PetscFEGetDimension\n\n \nSource code at petsc4py/PETSc/FE.pyx:180"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_15getDimension(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getDimension (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getDimension", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getDimension", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE_14getDimension(((struct PyPetscFEObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_14getDimension(struct PyPetscFEObject *__pyx_v_self) { PetscInt __pyx_v_cdim; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getDimension", 1); /* "petsc4py/PETSc/FE.pyx":190 * * """ * cdef PetscInt cdim = 0 # <<<<<<<<<<<<<< * CHKERR( PetscFEGetDimension(self.fe, &cdim) ) * return toInt(cdim) */ __pyx_v_cdim = 0; /* "petsc4py/PETSc/FE.pyx":191 * """ * cdef PetscInt cdim = 0 * CHKERR( PetscFEGetDimension(self.fe, &cdim) ) # <<<<<<<<<<<<<< * return toInt(cdim) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFEGetDimension(__pyx_v_self->fe, (&__pyx_v_cdim))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(43, 191, __pyx_L1_error) /* "petsc4py/PETSc/FE.pyx":192 * cdef PetscInt cdim = 0 * CHKERR( PetscFEGetDimension(self.fe, &cdim) ) * return toInt(cdim) # <<<<<<<<<<<<<< * * def getSpatialDimension(self) -> int: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_cdim); if (unlikely(!__pyx_t_2)) __PYX_ERR(43, 192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/FE.pyx":180 * return quad * * def getDimension(self) -> int: # <<<<<<<<<<<<<< * """Return the dimension of the finite element space on a cell. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.FE.getDimension", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/FE.pyx":194 * return toInt(cdim) * * def getSpatialDimension(self) -> int: # <<<<<<<<<<<<<< * """Return the spatial dimension of the element. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_17getSpatialDimension(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2FE_16getSpatialDimension, "FE.getSpatialDimension(self) -> int\nReturn the spatial dimension of the element.\n\n Not collective.\n\n See Also\n --------\n petsc.PetscFEGetSpatialDimension\n\n \nSource code at petsc4py/PETSc/FE.pyx:194"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_17getSpatialDimension(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSpatialDimension (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getSpatialDimension", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getSpatialDimension", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE_16getSpatialDimension(((struct PyPetscFEObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_16getSpatialDimension(struct PyPetscFEObject *__pyx_v_self) { PetscInt __pyx_v_csdim; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSpatialDimension", 1); /* "petsc4py/PETSc/FE.pyx":204 * * """ * cdef PetscInt csdim = 0 # <<<<<<<<<<<<<< * CHKERR( PetscFEGetSpatialDimension(self.fe, &csdim) ) * return toInt(csdim) */ __pyx_v_csdim = 0; /* "petsc4py/PETSc/FE.pyx":205 * """ * cdef PetscInt csdim = 0 * CHKERR( PetscFEGetSpatialDimension(self.fe, &csdim) ) # <<<<<<<<<<<<<< * return toInt(csdim) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFEGetSpatialDimension(__pyx_v_self->fe, (&__pyx_v_csdim))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(43, 205, __pyx_L1_error) /* "petsc4py/PETSc/FE.pyx":206 * cdef PetscInt csdim = 0 * CHKERR( PetscFEGetSpatialDimension(self.fe, &csdim) ) * return toInt(csdim) # <<<<<<<<<<<<<< * * def getNumComponents(self) -> int: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_csdim); if (unlikely(!__pyx_t_2)) __PYX_ERR(43, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/FE.pyx":194 * return toInt(cdim) * * def getSpatialDimension(self) -> int: # <<<<<<<<<<<<<< * """Return the spatial dimension of the element. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.FE.getSpatialDimension", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/FE.pyx":208 * return toInt(csdim) * * def getNumComponents(self) -> int: # <<<<<<<<<<<<<< * """Return the number of components in the element. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_19getNumComponents(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2FE_18getNumComponents, "FE.getNumComponents(self) -> int\nReturn the number of components in the element.\n\n Not collective.\n\n See Also\n --------\n setNumComponents, petsc.PetscFEGetNumComponents\n\n \nSource code at petsc4py/PETSc/FE.pyx:208"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_19getNumComponents(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getNumComponents (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getNumComponents", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getNumComponents", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE_18getNumComponents(((struct PyPetscFEObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_18getNumComponents(struct PyPetscFEObject *__pyx_v_self) { PetscInt __pyx_v_comp; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getNumComponents", 1); /* "petsc4py/PETSc/FE.pyx":218 * * """ * cdef PetscInt comp = 0 # <<<<<<<<<<<<<< * CHKERR( PetscFEGetNumComponents(self.fe, &comp) ) * return toInt(comp) */ __pyx_v_comp = 0; /* "petsc4py/PETSc/FE.pyx":219 * """ * cdef PetscInt comp = 0 * CHKERR( PetscFEGetNumComponents(self.fe, &comp) ) # <<<<<<<<<<<<<< * return toInt(comp) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFEGetNumComponents(__pyx_v_self->fe, (&__pyx_v_comp))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(43, 219, __pyx_L1_error) /* "petsc4py/PETSc/FE.pyx":220 * cdef PetscInt comp = 0 * CHKERR( PetscFEGetNumComponents(self.fe, &comp) ) * return toInt(comp) # <<<<<<<<<<<<<< * * def setNumComponents(self, comp: int) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_comp); if (unlikely(!__pyx_t_2)) __PYX_ERR(43, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/FE.pyx":208 * return toInt(csdim) * * def getNumComponents(self) -> int: # <<<<<<<<<<<<<< * """Return the number of components in the element. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.FE.getNumComponents", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/FE.pyx":222 * return toInt(comp) * * def setNumComponents(self, comp: int) -> None: # <<<<<<<<<<<<<< * """Set the number of field components in the element. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_21setNumComponents(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2FE_20setNumComponents, "FE.setNumComponents(self, comp: int) -> None\nSet the number of field components in the element.\n\n Not collective.\n\n Parameters\n ----------\n comp\n The number of field components.\n\n See Also\n --------\n getNumComponents, petsc.PetscFESetNumComponents\n\n \nSource code at petsc4py/PETSc/FE.pyx:222"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_21setNumComponents(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_comp = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setNumComponents (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comp,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comp)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(43, 222, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setNumComponents") < 0)) __PYX_ERR(43, 222, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_comp = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setNumComponents", 1, 1, 1, __pyx_nargs); __PYX_ERR(43, 222, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.FE.setNumComponents", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE_20setNumComponents(((struct PyPetscFEObject *)__pyx_v_self), __pyx_v_comp); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_20setNumComponents(struct PyPetscFEObject *__pyx_v_self, PyObject *__pyx_v_comp) { CYTHON_UNUSED PetscInt __pyx_v_ccomp; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setNumComponents", 1); /* "petsc4py/PETSc/FE.pyx":237 * * """ * cdef PetscInt ccomp = asInt(comp) # <<<<<<<<<<<<<< * CHKERR( PetscFESetNumComponents(self.fe, comp) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_comp); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(43, 237, __pyx_L1_error) __pyx_v_ccomp = __pyx_t_1; /* "petsc4py/PETSc/FE.pyx":238 * """ * cdef PetscInt ccomp = asInt(comp) * CHKERR( PetscFESetNumComponents(self.fe, comp) ) # <<<<<<<<<<<<<< * * def getNumDof(self) -> ndarray: */ __pyx_t_1 = __Pyx_PyInt_As_PetscInt(__pyx_v_comp); if (unlikely((__pyx_t_1 == ((PetscInt)-1)) && PyErr_Occurred())) __PYX_ERR(43, 238, __pyx_L1_error) __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFESetNumComponents(__pyx_v_self->fe, __pyx_t_1)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(43, 238, __pyx_L1_error) /* "petsc4py/PETSc/FE.pyx":222 * return toInt(comp) * * def setNumComponents(self, comp: int) -> None: # <<<<<<<<<<<<<< * """Set the number of field components in the element. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.FE.setNumComponents", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/FE.pyx":240 * CHKERR( PetscFESetNumComponents(self.fe, comp) ) * * def getNumDof(self) -> ndarray: # <<<<<<<<<<<<<< * """Return the number of DOFs. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_23getNumDof(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2FE_22getNumDof, "FE.getNumDof(self) -> ndarray\nReturn the number of DOFs.\n\n Not collective.\n\n Return the number of DOFs (dual basis vectors) associated with mesh\n points on the reference cell of a given dimension.\n\n See Also\n --------\n petsc.PetscFEGetNumDof\n\n \nSource code at petsc4py/PETSc/FE.pyx:240"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_23getNumDof(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getNumDof (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getNumDof", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getNumDof", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE_22getNumDof(((struct PyPetscFEObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_22getNumDof(struct PyPetscFEObject *__pyx_v_self) { PetscInt const *__pyx_v_numDof; PetscInt __pyx_v_cdim; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getNumDof", 1); /* "petsc4py/PETSc/FE.pyx":253 * * """ * cdef const PetscInt *numDof = NULL # <<<<<<<<<<<<<< * cdef PetscInt cdim = 0 * CHKERR( PetscFEGetDimension(self.fe, &cdim) ) */ __pyx_v_numDof = NULL; /* "petsc4py/PETSc/FE.pyx":254 * """ * cdef const PetscInt *numDof = NULL * cdef PetscInt cdim = 0 # <<<<<<<<<<<<<< * CHKERR( PetscFEGetDimension(self.fe, &cdim) ) * CHKERR( PetscFEGetNumDof(self.fe, &numDof) ) */ __pyx_v_cdim = 0; /* "petsc4py/PETSc/FE.pyx":255 * cdef const PetscInt *numDof = NULL * cdef PetscInt cdim = 0 * CHKERR( PetscFEGetDimension(self.fe, &cdim) ) # <<<<<<<<<<<<<< * CHKERR( PetscFEGetNumDof(self.fe, &numDof) ) * return array_i(cdim, numDof) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFEGetDimension(__pyx_v_self->fe, (&__pyx_v_cdim))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(43, 255, __pyx_L1_error) /* "petsc4py/PETSc/FE.pyx":256 * cdef PetscInt cdim = 0 * CHKERR( PetscFEGetDimension(self.fe, &cdim) ) * CHKERR( PetscFEGetNumDof(self.fe, &numDof) ) # <<<<<<<<<<<<<< * return array_i(cdim, numDof) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFEGetNumDof(__pyx_v_self->fe, (&__pyx_v_numDof))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(43, 256, __pyx_L1_error) /* "petsc4py/PETSc/FE.pyx":257 * CHKERR( PetscFEGetDimension(self.fe, &cdim) ) * CHKERR( PetscFEGetNumDof(self.fe, &numDof) ) * return array_i(cdim, numDof) # <<<<<<<<<<<<<< * * def getTileSizes(self) -> tuple(int, int, int, int): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i(__pyx_v_cdim, __pyx_v_numDof)); if (unlikely(!__pyx_t_2)) __PYX_ERR(43, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/FE.pyx":240 * CHKERR( PetscFESetNumComponents(self.fe, comp) ) * * def getNumDof(self) -> ndarray: # <<<<<<<<<<<<<< * """Return the number of DOFs. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.FE.getNumDof", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/FE.pyx":259 * return array_i(cdim, numDof) * * def getTileSizes(self) -> tuple(int, int, int, int): # <<<<<<<<<<<<<< * """Return the tile sizes for evaluation. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_25getTileSizes(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2FE_24getTileSizes, "FE.getTileSizes(self) -> tuple(int, int, int, int)\nReturn the tile sizes for evaluation.\n\n Not collective.\n\n Returns\n -------\n blockSize : int\n The number of elements in a block.\n numBlocks : int\n The number of blocks in a batch.\n batchSize : int\n The number of elements in a batch.\n numBatches : int\n The number of batches in a chunk.\n\n See Also\n --------\n setTileSizes, petsc.PetscFEGetTileSizes\n\n \nSource code at petsc4py/PETSc/FE.pyx:259"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_25getTileSizes(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getTileSizes (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getTileSizes", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getTileSizes", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE_24getTileSizes(((struct PyPetscFEObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_24getTileSizes(struct PyPetscFEObject *__pyx_v_self) { PetscInt __pyx_v_blockSize; PetscInt __pyx_v_numBlocks; PetscInt __pyx_v_batchSize; PetscInt __pyx_v_numBatches; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getTileSizes", 1); /* "petsc4py/PETSc/FE.pyx":280 * * """ * cdef PetscInt blockSize = 0, numBlocks = 0 # <<<<<<<<<<<<<< * cdef PetscInt batchSize = 0, numBatches = 0 * CHKERR( PetscFEGetTileSizes(self.fe, &blockSize, &numBlocks, &batchSize, &numBatches) ) */ __pyx_v_blockSize = 0; __pyx_v_numBlocks = 0; /* "petsc4py/PETSc/FE.pyx":281 * """ * cdef PetscInt blockSize = 0, numBlocks = 0 * cdef PetscInt batchSize = 0, numBatches = 0 # <<<<<<<<<<<<<< * CHKERR( PetscFEGetTileSizes(self.fe, &blockSize, &numBlocks, &batchSize, &numBatches) ) * return toInt(blockSize), toInt(numBlocks), toInt(batchSize), toInt(numBatches) */ __pyx_v_batchSize = 0; __pyx_v_numBatches = 0; /* "petsc4py/PETSc/FE.pyx":282 * cdef PetscInt blockSize = 0, numBlocks = 0 * cdef PetscInt batchSize = 0, numBatches = 0 * CHKERR( PetscFEGetTileSizes(self.fe, &blockSize, &numBlocks, &batchSize, &numBatches) ) # <<<<<<<<<<<<<< * return toInt(blockSize), toInt(numBlocks), toInt(batchSize), toInt(numBatches) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFEGetTileSizes(__pyx_v_self->fe, (&__pyx_v_blockSize), (&__pyx_v_numBlocks), (&__pyx_v_batchSize), (&__pyx_v_numBatches))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(43, 282, __pyx_L1_error) /* "petsc4py/PETSc/FE.pyx":283 * cdef PetscInt batchSize = 0, numBatches = 0 * CHKERR( PetscFEGetTileSizes(self.fe, &blockSize, &numBlocks, &batchSize, &numBatches) ) * return toInt(blockSize), toInt(numBlocks), toInt(batchSize), toInt(numBatches) # <<<<<<<<<<<<<< * * def setTileSizes( */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_blockSize); if (unlikely(!__pyx_t_2)) __PYX_ERR(43, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_numBlocks); if (unlikely(!__pyx_t_3)) __PYX_ERR(43, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_batchSize); if (unlikely(!__pyx_t_4)) __PYX_ERR(43, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_numBatches); if (unlikely(!__pyx_t_5)) __PYX_ERR(43, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(43, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2)) __PYX_ERR(43, 283, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3)) __PYX_ERR(43, 283, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_4)) __PYX_ERR(43, 283, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_5)) __PYX_ERR(43, 283, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "petsc4py/PETSc/FE.pyx":259 * return array_i(cdim, numDof) * * def getTileSizes(self) -> tuple(int, int, int, int): # <<<<<<<<<<<<<< * """Return the tile sizes for evaluation. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.FE.getTileSizes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/FE.pyx":285 * return toInt(blockSize), toInt(numBlocks), toInt(batchSize), toInt(numBatches) * * def setTileSizes( # <<<<<<<<<<<<<< * self, * blockSize: int, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_27setTileSizes(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2FE_26setTileSizes, "FE.setTileSizes(self, blockSize: int, numBlocks: int, batchSize: int, numBatches: int) -> None\nSet the tile sizes for evaluation.\n\n Not collective.\n\n Parameters\n ----------\n blockSize\n The number of elements in a block.\n numBlocks\n The number of blocks in a batch.\n batchSize\n The number of elements in a batch.\n numBatches\n The number of batches in a chunk.\n\n See Also\n --------\n getTileSizes, petsc.PetscFESetTileSizes\n\n \nSource code at petsc4py/PETSc/FE.pyx:285"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_27setTileSizes(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_blockSize = 0; PyObject *__pyx_v_numBlocks = 0; PyObject *__pyx_v_batchSize = 0; PyObject *__pyx_v_numBatches = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setTileSizes (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_blockSize,&__pyx_n_s_numBlocks,&__pyx_n_s_batchSize,&__pyx_n_s_numBatches,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_blockSize)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(43, 285, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_numBlocks)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(43, 285, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setTileSizes", 1, 4, 4, 1); __PYX_ERR(43, 285, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_batchSize)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(43, 285, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setTileSizes", 1, 4, 4, 2); __PYX_ERR(43, 285, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_numBatches)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(43, 285, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setTileSizes", 1, 4, 4, 3); __PYX_ERR(43, 285, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setTileSizes") < 0)) __PYX_ERR(43, 285, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 4)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); } __pyx_v_blockSize = values[0]; __pyx_v_numBlocks = values[1]; __pyx_v_batchSize = values[2]; __pyx_v_numBatches = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setTileSizes", 1, 4, 4, __pyx_nargs); __PYX_ERR(43, 285, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.FE.setTileSizes", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE_26setTileSizes(((struct PyPetscFEObject *)__pyx_v_self), __pyx_v_blockSize, __pyx_v_numBlocks, __pyx_v_batchSize, __pyx_v_numBatches); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_26setTileSizes(struct PyPetscFEObject *__pyx_v_self, PyObject *__pyx_v_blockSize, PyObject *__pyx_v_numBlocks, PyObject *__pyx_v_batchSize, PyObject *__pyx_v_numBatches) { CYTHON_UNUSED PetscInt __pyx_v_cblockSize; CYTHON_UNUSED PetscInt __pyx_v_cnumBlocks; CYTHON_UNUSED PetscInt __pyx_v_cbatchSize; CYTHON_UNUSED PetscInt __pyx_v_cnumBatches; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscInt __pyx_t_2; PetscInt __pyx_t_3; PetscInt __pyx_t_4; PetscErrorCode __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setTileSizes", 1); /* "petsc4py/PETSc/FE.pyx":312 * * """ * cdef PetscInt cblockSize = asInt(blockSize), cnumBlocks = asInt(numBlocks) # <<<<<<<<<<<<<< * cdef PetscInt cbatchSize = asInt(batchSize), cnumBatches = asInt(numBatches) * CHKERR( PetscFESetTileSizes(self.fe, blockSize, numBlocks, batchSize, numBatches) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_blockSize); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(43, 312, __pyx_L1_error) __pyx_v_cblockSize = __pyx_t_1; __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_numBlocks); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(43, 312, __pyx_L1_error) __pyx_v_cnumBlocks = __pyx_t_1; /* "petsc4py/PETSc/FE.pyx":313 * """ * cdef PetscInt cblockSize = asInt(blockSize), cnumBlocks = asInt(numBlocks) * cdef PetscInt cbatchSize = asInt(batchSize), cnumBatches = asInt(numBatches) # <<<<<<<<<<<<<< * CHKERR( PetscFESetTileSizes(self.fe, blockSize, numBlocks, batchSize, numBatches) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_batchSize); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(43, 313, __pyx_L1_error) __pyx_v_cbatchSize = __pyx_t_1; __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_numBatches); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(43, 313, __pyx_L1_error) __pyx_v_cnumBatches = __pyx_t_1; /* "petsc4py/PETSc/FE.pyx":314 * cdef PetscInt cblockSize = asInt(blockSize), cnumBlocks = asInt(numBlocks) * cdef PetscInt cbatchSize = asInt(batchSize), cnumBatches = asInt(numBatches) * CHKERR( PetscFESetTileSizes(self.fe, blockSize, numBlocks, batchSize, numBatches) ) # <<<<<<<<<<<<<< * * def getFaceQuadrature(self) -> Quad: */ __pyx_t_1 = __Pyx_PyInt_As_PetscInt(__pyx_v_blockSize); if (unlikely((__pyx_t_1 == ((PetscInt)-1)) && PyErr_Occurred())) __PYX_ERR(43, 314, __pyx_L1_error) __pyx_t_2 = __Pyx_PyInt_As_PetscInt(__pyx_v_numBlocks); if (unlikely((__pyx_t_2 == ((PetscInt)-1)) && PyErr_Occurred())) __PYX_ERR(43, 314, __pyx_L1_error) __pyx_t_3 = __Pyx_PyInt_As_PetscInt(__pyx_v_batchSize); if (unlikely((__pyx_t_3 == ((PetscInt)-1)) && PyErr_Occurred())) __PYX_ERR(43, 314, __pyx_L1_error) __pyx_t_4 = __Pyx_PyInt_As_PetscInt(__pyx_v_numBatches); if (unlikely((__pyx_t_4 == ((PetscInt)-1)) && PyErr_Occurred())) __PYX_ERR(43, 314, __pyx_L1_error) __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFESetTileSizes(__pyx_v_self->fe, __pyx_t_1, __pyx_t_2, __pyx_t_3, __pyx_t_4)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(43, 314, __pyx_L1_error) /* "petsc4py/PETSc/FE.pyx":285 * return toInt(blockSize), toInt(numBlocks), toInt(batchSize), toInt(numBatches) * * def setTileSizes( # <<<<<<<<<<<<<< * self, * blockSize: int, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.FE.setTileSizes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/FE.pyx":316 * CHKERR( PetscFESetTileSizes(self.fe, blockSize, numBlocks, batchSize, numBatches) ) * * def getFaceQuadrature(self) -> Quad: # <<<<<<<<<<<<<< * """Return the `Quad` used to calculate inner products on faces. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_29getFaceQuadrature(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2FE_28getFaceQuadrature, "FE.getFaceQuadrature(self) -> Quad\nReturn the `Quad` used to calculate inner products on faces.\n\n Not collective.\n\n See Also\n --------\n setFaceQuadrature, petsc.PetscFEGetFaceQuadrature\n\n \nSource code at petsc4py/PETSc/FE.pyx:316"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_29getFaceQuadrature(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getFaceQuadrature (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getFaceQuadrature", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getFaceQuadrature", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE_28getFaceQuadrature(((struct PyPetscFEObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_28getFaceQuadrature(struct PyPetscFEObject *__pyx_v_self) { struct PyPetscQuadObject *__pyx_v_quad = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getFaceQuadrature", 1); /* "petsc4py/PETSc/FE.pyx":326 * * """ * cdef Quad quad = Quad() # <<<<<<<<<<<<<< * CHKERR( PetscFEGetFaceQuadrature(self.fe, &quad.quad) ) * return quad */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Quad)); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_quad = ((struct PyPetscQuadObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/FE.pyx":327 * """ * cdef Quad quad = Quad() * CHKERR( PetscFEGetFaceQuadrature(self.fe, &quad.quad) ) # <<<<<<<<<<<<<< * return quad * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFEGetFaceQuadrature(__pyx_v_self->fe, (&__pyx_v_quad->quad))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(43, 327, __pyx_L1_error) /* "petsc4py/PETSc/FE.pyx":328 * cdef Quad quad = Quad() * CHKERR( PetscFEGetFaceQuadrature(self.fe, &quad.quad) ) * return quad # <<<<<<<<<<<<<< * * def setQuadrature(self, Quad quad) -> Self: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_quad); __pyx_r = ((PyObject *)__pyx_v_quad); goto __pyx_L0; /* "petsc4py/PETSc/FE.pyx":316 * CHKERR( PetscFESetTileSizes(self.fe, blockSize, numBlocks, batchSize, numBatches) ) * * def getFaceQuadrature(self) -> Quad: # <<<<<<<<<<<<<< * """Return the `Quad` used to calculate inner products on faces. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.FE.getFaceQuadrature", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_quad); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/FE.pyx":330 * return quad * * def setQuadrature(self, Quad quad) -> Self: # <<<<<<<<<<<<<< * """Set the `Quad` used to calculate inner products. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_31setQuadrature(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2FE_30setQuadrature, "FE.setQuadrature(self, quad: Quad) -> Self\nSet the `Quad` used to calculate inner products.\n\n Not collective.\n\n Parameters\n ----------\n quad\n The `Quad` object.\n\n See Also\n --------\n getQuadrature, petsc.PetscFESetQuadrature\n\n \nSource code at petsc4py/PETSc/FE.pyx:330"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_31setQuadrature(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscQuadObject *__pyx_v_quad = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setQuadrature (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_quad,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_quad)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(43, 330, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setQuadrature") < 0)) __PYX_ERR(43, 330, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_quad = ((struct PyPetscQuadObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setQuadrature", 1, 1, 1, __pyx_nargs); __PYX_ERR(43, 330, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.FE.setQuadrature", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quad), __pyx_ptype_8petsc4py_5PETSc_Quad, 0, "quad", 0))) __PYX_ERR(43, 330, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE_30setQuadrature(((struct PyPetscFEObject *)__pyx_v_self), __pyx_v_quad); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_30setQuadrature(struct PyPetscFEObject *__pyx_v_self, struct PyPetscQuadObject *__pyx_v_quad) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setQuadrature", 1); /* "petsc4py/PETSc/FE.pyx":345 * * """ * CHKERR( PetscFESetQuadrature(self.fe, quad.quad) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFESetQuadrature(__pyx_v_self->fe, __pyx_v_quad->quad)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(43, 345, __pyx_L1_error) /* "petsc4py/PETSc/FE.pyx":346 * """ * CHKERR( PetscFESetQuadrature(self.fe, quad.quad) ) * return self # <<<<<<<<<<<<<< * * def setFaceQuadrature(self, Quad quad) -> Quad: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/FE.pyx":330 * return quad * * def setQuadrature(self, Quad quad) -> Self: # <<<<<<<<<<<<<< * """Set the `Quad` used to calculate inner products. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.FE.setQuadrature", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/FE.pyx":348 * return self * * def setFaceQuadrature(self, Quad quad) -> Quad: # <<<<<<<<<<<<<< * """Set the `Quad` used to calculate inner products on faces. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_33setFaceQuadrature(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2FE_32setFaceQuadrature, "FE.setFaceQuadrature(self, quad: Quad) -> Quad\nSet the `Quad` used to calculate inner products on faces.\n\n Not collective.\n\n Parameters\n ----------\n quad\n The `Quad` object.\n\n See Also\n --------\n getFaceQuadrature, petsc.PetscFESetFaceQuadrature\n\n \nSource code at petsc4py/PETSc/FE.pyx:348"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_33setFaceQuadrature(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscQuadObject *__pyx_v_quad = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFaceQuadrature (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_quad,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_quad)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(43, 348, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setFaceQuadrature") < 0)) __PYX_ERR(43, 348, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_quad = ((struct PyPetscQuadObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setFaceQuadrature", 1, 1, 1, __pyx_nargs); __PYX_ERR(43, 348, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.FE.setFaceQuadrature", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quad), __pyx_ptype_8petsc4py_5PETSc_Quad, 0, "quad", 0))) __PYX_ERR(43, 348, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE_32setFaceQuadrature(((struct PyPetscFEObject *)__pyx_v_self), __pyx_v_quad); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_32setFaceQuadrature(struct PyPetscFEObject *__pyx_v_self, struct PyPetscQuadObject *__pyx_v_quad) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFaceQuadrature", 1); /* "petsc4py/PETSc/FE.pyx":363 * * """ * CHKERR( PetscFESetFaceQuadrature(self.fe, quad.quad) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFESetFaceQuadrature(__pyx_v_self->fe, __pyx_v_quad->quad)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(43, 363, __pyx_L1_error) /* "petsc4py/PETSc/FE.pyx":364 * """ * CHKERR( PetscFESetFaceQuadrature(self.fe, quad.quad) ) * return self # <<<<<<<<<<<<<< * * def setType(self, fe_type: Type | str) -> Self: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/FE.pyx":348 * return self * * def setFaceQuadrature(self, Quad quad) -> Quad: # <<<<<<<<<<<<<< * """Set the `Quad` used to calculate inner products on faces. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.FE.setFaceQuadrature", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/FE.pyx":366 * return self * * def setType(self, fe_type: Type | str) -> Self: # <<<<<<<<<<<<<< * """Build a particular `FE`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_35setType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2FE_34setType, "FE.setType(self, fe_type: Type | str) -> Self\nBuild a particular `FE`.\n\n Collective.\n\n Parameters\n ----------\n fe_type\n The kind of FEM space.\n\n See Also\n --------\n petsc.PetscFESetType\n\n \nSource code at petsc4py/PETSc/FE.pyx:366"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_35setType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_fe_type = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fe_type,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fe_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(43, 366, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setType") < 0)) __PYX_ERR(43, 366, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_fe_type = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, __pyx_nargs); __PYX_ERR(43, 366, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.FE.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE_34setType(((struct PyPetscFEObject *)__pyx_v_self), __pyx_v_fe_type); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_34setType(struct PyPetscFEObject *__pyx_v_self, PyObject *__pyx_v_fe_type) { PetscFEType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setType", 0); __Pyx_INCREF(__pyx_v_fe_type); /* "petsc4py/PETSc/FE.pyx":381 * * """ * cdef PetscFEType cval = NULL # <<<<<<<<<<<<<< * fe_type = str2bytes(fe_type, &cval) * CHKERR( PetscFESetType(self.fe, cval) ) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/FE.pyx":382 * """ * cdef PetscFEType cval = NULL * fe_type = str2bytes(fe_type, &cval) # <<<<<<<<<<<<<< * CHKERR( PetscFESetType(self.fe, cval) ) * return self */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_fe_type, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 382, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_fe_type, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/FE.pyx":383 * cdef PetscFEType cval = NULL * fe_type = str2bytes(fe_type, &cval) * CHKERR( PetscFESetType(self.fe, cval) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFESetType(__pyx_v_self->fe, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(43, 383, __pyx_L1_error) /* "petsc4py/PETSc/FE.pyx":384 * fe_type = str2bytes(fe_type, &cval) * CHKERR( PetscFESetType(self.fe, cval) ) * return self # <<<<<<<<<<<<<< * * def getBasisSpace(self) -> Space: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/FE.pyx":366 * return self * * def setType(self, fe_type: Type | str) -> Self: # <<<<<<<<<<<<<< * """Build a particular `FE`. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.FE.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_fe_type); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/FE.pyx":386 * return self * * def getBasisSpace(self) -> Space: # <<<<<<<<<<<<<< * """Return the `Space` used for the approximation of the `FE` solution. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_37getBasisSpace(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2FE_36getBasisSpace, "FE.getBasisSpace(self) -> Space\nReturn the `Space` used for the approximation of the `FE` solution.\n\n Not collective.\n\n See Also\n --------\n setBasisSpace, petsc.PetscFEGetBasisSpace\n\n \nSource code at petsc4py/PETSc/FE.pyx:386"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_37getBasisSpace(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getBasisSpace (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getBasisSpace", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getBasisSpace", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE_36getBasisSpace(((struct PyPetscFEObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_36getBasisSpace(struct PyPetscFEObject *__pyx_v_self) { struct PyPetscSpaceObject *__pyx_v_sp = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getBasisSpace", 1); /* "petsc4py/PETSc/FE.pyx":396 * * """ * cdef Space sp = Space() # <<<<<<<<<<<<<< * CHKERR( PetscFEGetBasisSpace(self.fe, &sp.space ) ) * return sp */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Space)); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 396, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_sp = ((struct PyPetscSpaceObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/FE.pyx":397 * """ * cdef Space sp = Space() * CHKERR( PetscFEGetBasisSpace(self.fe, &sp.space ) ) # <<<<<<<<<<<<<< * return sp * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFEGetBasisSpace(__pyx_v_self->fe, (&__pyx_v_sp->space))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(43, 397, __pyx_L1_error) /* "petsc4py/PETSc/FE.pyx":398 * cdef Space sp = Space() * CHKERR( PetscFEGetBasisSpace(self.fe, &sp.space ) ) * return sp # <<<<<<<<<<<<<< * * def setBasisSpace(self, Space sp) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_sp); __pyx_r = ((PyObject *)__pyx_v_sp); goto __pyx_L0; /* "petsc4py/PETSc/FE.pyx":386 * return self * * def getBasisSpace(self) -> Space: # <<<<<<<<<<<<<< * """Return the `Space` used for the approximation of the `FE` solution. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.FE.getBasisSpace", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_sp); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/FE.pyx":400 * return sp * * def setBasisSpace(self, Space sp) -> None: # <<<<<<<<<<<<<< * """Set the `Space` used for the approximation of the solution. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_39setBasisSpace(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2FE_38setBasisSpace, "FE.setBasisSpace(self, sp: Space) -> None\nSet the `Space` used for the approximation of the solution.\n\n Not collective.\n\n Parameters\n ----------\n sp\n The `Space` object.\n\n See Also\n --------\n getBasisSpace, petsc.PetscFESetBasisSpace\n\n \nSource code at petsc4py/PETSc/FE.pyx:400"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_39setBasisSpace(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscSpaceObject *__pyx_v_sp = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setBasisSpace (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sp,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sp)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(43, 400, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setBasisSpace") < 0)) __PYX_ERR(43, 400, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_sp = ((struct PyPetscSpaceObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setBasisSpace", 1, 1, 1, __pyx_nargs); __PYX_ERR(43, 400, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.FE.setBasisSpace", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sp), __pyx_ptype_8petsc4py_5PETSc_Space, 0, "sp", 0))) __PYX_ERR(43, 400, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE_38setBasisSpace(((struct PyPetscFEObject *)__pyx_v_self), __pyx_v_sp); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_38setBasisSpace(struct PyPetscFEObject *__pyx_v_self, struct PyPetscSpaceObject *__pyx_v_sp) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setBasisSpace", 1); /* "petsc4py/PETSc/FE.pyx":415 * * """ * CHKERR( PetscFESetBasisSpace(self.fe, sp.space ) ) # <<<<<<<<<<<<<< * * def setFromOptions(self) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFESetBasisSpace(__pyx_v_self->fe, __pyx_v_sp->space)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(43, 415, __pyx_L1_error) /* "petsc4py/PETSc/FE.pyx":400 * return sp * * def setBasisSpace(self, Space sp) -> None: # <<<<<<<<<<<<<< * """Set the `Space` used for the approximation of the solution. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.FE.setBasisSpace", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/FE.pyx":417 * CHKERR( PetscFESetBasisSpace(self.fe, sp.space ) ) * * def setFromOptions(self) -> None: # <<<<<<<<<<<<<< * """Set parameters in a `FE` from the options database. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_41setFromOptions(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2FE_40setFromOptions, "FE.setFromOptions(self) -> None\nSet parameters in a `FE` from the options database.\n\n Collective.\n\n See Also\n --------\n petsc_options, petsc.PetscFESetFromOptions\n\n \nSource code at petsc4py/PETSc/FE.pyx:417"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_41setFromOptions(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFromOptions (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("setFromOptions", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setFromOptions", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE_40setFromOptions(((struct PyPetscFEObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_40setFromOptions(struct PyPetscFEObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFromOptions", 1); /* "petsc4py/PETSc/FE.pyx":427 * * """ * CHKERR( PetscFESetFromOptions(self.fe) ) # <<<<<<<<<<<<<< * * def setUp(self) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFESetFromOptions(__pyx_v_self->fe)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(43, 427, __pyx_L1_error) /* "petsc4py/PETSc/FE.pyx":417 * CHKERR( PetscFESetBasisSpace(self.fe, sp.space ) ) * * def setFromOptions(self) -> None: # <<<<<<<<<<<<<< * """Set parameters in a `FE` from the options database. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.FE.setFromOptions", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/FE.pyx":429 * CHKERR( PetscFESetFromOptions(self.fe) ) * * def setUp(self) -> None: # <<<<<<<<<<<<<< * """Construct data structures for the `FE` after the `Type` has been set. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_43setUp(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2FE_42setUp, "FE.setUp(self) -> None\nConstruct data structures for the `FE` after the `Type` has been set.\n\n Collective.\n\n See Also\n --------\n petsc.PetscFESetUp\n\n \nSource code at petsc4py/PETSc/FE.pyx:429"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_43setUp(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setUp (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("setUp", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setUp", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE_42setUp(((struct PyPetscFEObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_42setUp(struct PyPetscFEObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setUp", 1); /* "petsc4py/PETSc/FE.pyx":439 * * """ * CHKERR( PetscFESetUp(self.fe) ) # <<<<<<<<<<<<<< * * def getDualSpace(self) -> DualSpace: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFESetUp(__pyx_v_self->fe)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(43, 439, __pyx_L1_error) /* "petsc4py/PETSc/FE.pyx":429 * CHKERR( PetscFESetFromOptions(self.fe) ) * * def setUp(self) -> None: # <<<<<<<<<<<<<< * """Construct data structures for the `FE` after the `Type` has been set. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.FE.setUp", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/FE.pyx":441 * CHKERR( PetscFESetUp(self.fe) ) * * def getDualSpace(self) -> DualSpace: # <<<<<<<<<<<<<< * """Return the `DualSpace` used to define the inner product for the `FE`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_45getDualSpace(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2FE_44getDualSpace, "FE.getDualSpace(self) -> DualSpace\nReturn the `DualSpace` used to define the inner product for the `FE`.\n\n Not collective.\n\n See Also\n --------\n setDualSpace, DualSpace, petsc.PetscFEGetDualSpace\n\n \nSource code at petsc4py/PETSc/FE.pyx:441"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_45getDualSpace(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getDualSpace (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getDualSpace", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getDualSpace", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE_44getDualSpace(((struct PyPetscFEObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_44getDualSpace(struct PyPetscFEObject *__pyx_v_self) { struct PyPetscDualSpaceObject *__pyx_v_dspace = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getDualSpace", 1); /* "petsc4py/PETSc/FE.pyx":451 * * """ * cdef DualSpace dspace = DualSpace() # <<<<<<<<<<<<<< * CHKERR( PetscFEGetDualSpace(self.fe, &dspace.dualspace) ) * return dspace */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DualSpace)); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_dspace = ((struct PyPetscDualSpaceObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/FE.pyx":452 * """ * cdef DualSpace dspace = DualSpace() * CHKERR( PetscFEGetDualSpace(self.fe, &dspace.dualspace) ) # <<<<<<<<<<<<<< * return dspace * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFEGetDualSpace(__pyx_v_self->fe, (&__pyx_v_dspace->dualspace))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(43, 452, __pyx_L1_error) /* "petsc4py/PETSc/FE.pyx":453 * cdef DualSpace dspace = DualSpace() * CHKERR( PetscFEGetDualSpace(self.fe, &dspace.dualspace) ) * return dspace # <<<<<<<<<<<<<< * * def setDualSpace(self, DualSpace dspace) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_dspace); __pyx_r = ((PyObject *)__pyx_v_dspace); goto __pyx_L0; /* "petsc4py/PETSc/FE.pyx":441 * CHKERR( PetscFESetUp(self.fe) ) * * def getDualSpace(self) -> DualSpace: # <<<<<<<<<<<<<< * """Return the `DualSpace` used to define the inner product for the `FE`. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.FE.getDualSpace", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_dspace); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/FE.pyx":455 * return dspace * * def setDualSpace(self, DualSpace dspace) -> None: # <<<<<<<<<<<<<< * """Set the `DualSpace` used to define the inner product. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_47setDualSpace(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2FE_46setDualSpace, "FE.setDualSpace(self, dspace: DualSpace) -> None\nSet the `DualSpace` used to define the inner product.\n\n Not collective.\n\n Parameters\n ----------\n dspace\n The `DualSpace` object.\n\n See Also\n --------\n getDualSpace, DualSpace, petsc.PetscFESetDualSpace\n\n \nSource code at petsc4py/PETSc/FE.pyx:455"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_47setDualSpace(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscDualSpaceObject *__pyx_v_dspace = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setDualSpace (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dspace,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dspace)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(43, 455, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setDualSpace") < 0)) __PYX_ERR(43, 455, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_dspace = ((struct PyPetscDualSpaceObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setDualSpace", 1, 1, 1, __pyx_nargs); __PYX_ERR(43, 455, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.FE.setDualSpace", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dspace), __pyx_ptype_8petsc4py_5PETSc_DualSpace, 0, "dspace", 0))) __PYX_ERR(43, 455, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE_46setDualSpace(((struct PyPetscFEObject *)__pyx_v_self), __pyx_v_dspace); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_46setDualSpace(struct PyPetscFEObject *__pyx_v_self, struct PyPetscDualSpaceObject *__pyx_v_dspace) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setDualSpace", 1); /* "petsc4py/PETSc/FE.pyx":470 * * """ * CHKERR( PetscFESetDualSpace(self.fe, dspace.dualspace) ) # <<<<<<<<<<<<<< * * def viewFromOptions(self, name: str, Object obj=None) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFESetDualSpace(__pyx_v_self->fe, __pyx_v_dspace->dualspace)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(43, 470, __pyx_L1_error) /* "petsc4py/PETSc/FE.pyx":455 * return dspace * * def setDualSpace(self, DualSpace dspace) -> None: # <<<<<<<<<<<<<< * """Set the `DualSpace` used to define the inner product. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.FE.setDualSpace", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/FE.pyx":472 * CHKERR( PetscFESetDualSpace(self.fe, dspace.dualspace) ) * * def viewFromOptions(self, name: str, Object obj=None) -> None: # <<<<<<<<<<<<<< * """View from a `FE` based on values in the options database. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_49viewFromOptions(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2FE_48viewFromOptions, "FE.viewFromOptions(self, name: str, obj: Object | None = None) -> None\nView from a `FE` based on values in the options database.\n\n Collective.\n\n Parameters\n ----------\n name\n Command line option name.\n obj\n Optional object that provides the options prefix.\n\n See Also\n --------\n petsc_options, petsc.PetscFEViewFromOptions\n\n \nSource code at petsc4py/PETSc/FE.pyx:472"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_49viewFromOptions(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_name = 0; struct PyPetscObjectObject *__pyx_v_obj = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("viewFromOptions (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_obj,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscObjectObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(43, 472, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_obj); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(43, 472, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "viewFromOptions") < 0)) __PYX_ERR(43, 472, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_name = values[0]; __pyx_v_obj = ((struct PyPetscObjectObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("viewFromOptions", 0, 1, 2, __pyx_nargs); __PYX_ERR(43, 472, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.FE.viewFromOptions", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_obj), __pyx_ptype_8petsc4py_5PETSc_Object, 1, "obj", 0))) __PYX_ERR(43, 472, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE_48viewFromOptions(((struct PyPetscFEObject *)__pyx_v_self), __pyx_v_name, __pyx_v_obj); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_48viewFromOptions(struct PyPetscFEObject *__pyx_v_self, PyObject *__pyx_v_name, struct PyPetscObjectObject *__pyx_v_obj) { char const *__pyx_v_cname; CYTHON_UNUSED PyObject *__pyx_v__ = NULL; PetscObject __pyx_v_cobj; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("viewFromOptions", 1); /* "petsc4py/PETSc/FE.pyx":489 * * """ * cdef const char *cname = NULL # <<<<<<<<<<<<<< * _ = str2bytes(name, &cname) * cdef PetscObject cobj = NULL */ __pyx_v_cname = NULL; /* "petsc4py/PETSc/FE.pyx":490 * """ * cdef const char *cname = NULL * _ = str2bytes(name, &cname) # <<<<<<<<<<<<<< * cdef PetscObject cobj = NULL * if obj is not None: cobj = obj.obj[0] */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cname)); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 490, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v__ = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/FE.pyx":491 * cdef const char *cname = NULL * _ = str2bytes(name, &cname) * cdef PetscObject cobj = NULL # <<<<<<<<<<<<<< * if obj is not None: cobj = obj.obj[0] * CHKERR( PetscFEViewFromOptions(self.fe, cobj, cname) ) */ __pyx_v_cobj = NULL; /* "petsc4py/PETSc/FE.pyx":492 * _ = str2bytes(name, &cname) * cdef PetscObject cobj = NULL * if obj is not None: cobj = obj.obj[0] # <<<<<<<<<<<<<< * CHKERR( PetscFEViewFromOptions(self.fe, cobj, cname) ) * */ __pyx_t_2 = (((PyObject *)__pyx_v_obj) != Py_None); if (__pyx_t_2) { __pyx_v_cobj = (__pyx_v_obj->obj[0]); } /* "petsc4py/PETSc/FE.pyx":493 * cdef PetscObject cobj = NULL * if obj is not None: cobj = obj.obj[0] * CHKERR( PetscFEViewFromOptions(self.fe, cobj, cname) ) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFEViewFromOptions(__pyx_v_self->fe, __pyx_v_cobj, __pyx_v_cname)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(43, 493, __pyx_L1_error) /* "petsc4py/PETSc/FE.pyx":472 * CHKERR( PetscFESetDualSpace(self.fe, dspace.dualspace) ) * * def viewFromOptions(self, name: str, Object obj=None) -> None: # <<<<<<<<<<<<<< * """View from a `FE` based on values in the options database. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.FE.viewFromOptions", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v__); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Scatter.pyx":40 * # * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.sct * self.sct = NULL */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_7Scatter_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_7Scatter_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Scatter___cinit__(((struct PyPetscScatterObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_7Scatter___cinit__(struct PyPetscScatterObject *__pyx_v_self) { int __pyx_r; /* "petsc4py/PETSc/Scatter.pyx":41 * * def __cinit__(self): * self.obj = &self.sct # <<<<<<<<<<<<<< * self.sct = NULL * */ __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->sct)); /* "petsc4py/PETSc/Scatter.pyx":42 * def __cinit__(self): * self.obj = &self.sct * self.sct = NULL # <<<<<<<<<<<<<< * * def __call__(self, x, y, addv=None, mode=None): */ __pyx_v_self->sct = NULL; /* "petsc4py/PETSc/Scatter.pyx":40 * # * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.sct * self.sct = NULL */ /* function exit code */ __pyx_r = 0; return __pyx_r; } /* "petsc4py/PETSc/Scatter.pyx":44 * self.sct = NULL * * def __call__(self, x, y, addv=None, mode=None): # <<<<<<<<<<<<<< * """Perform the scatter. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7Scatter_2__call__, "Perform the scatter.\n\n Collective.\n\n See Also\n --------\n scatter\n\n "); #if CYTHON_UPDATE_DESCRIPTOR_DOC struct wrapperbase __pyx_wrapperbase_8petsc4py_5PETSc_7Scatter_2__call__; #endif static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_x = 0; PyObject *__pyx_v_y = 0; PyObject *__pyx_v_addv = 0; PyObject *__pyx_v_mode = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_addv,&__pyx_n_s_mode,0}; values[2] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)Py_None)); values[3] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(44, 44, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(44, 44, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__call__", 0, 2, 4, 1); __PYX_ERR(44, 44, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_addv); if (value) { values[2] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(44, 44, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mode); if (value) { values[3] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(44, 44, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__call__") < 0)) __PYX_ERR(44, 44, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_x = values[0]; __pyx_v_y = values[1]; __pyx_v_addv = values[2]; __pyx_v_mode = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__call__", 0, 2, 4, __pyx_nargs); __PYX_ERR(44, 44, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Scatter.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Scatter_2__call__(((struct PyPetscScatterObject *)__pyx_v_self), __pyx_v_x, __pyx_v_y, __pyx_v_addv, __pyx_v_mode); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_2__call__(struct PyPetscScatterObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_addv, PyObject *__pyx_v_mode) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 1); /* "petsc4py/PETSc/Scatter.pyx":54 * * """ * self.scatter(x, y, addv, mode) # <<<<<<<<<<<<<< * * # */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_scatter); if (unlikely(!__pyx_t_2)) __PYX_ERR(44, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_3, __pyx_v_x, __pyx_v_y, __pyx_v_addv, __pyx_v_mode}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 4+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(44, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Scatter.pyx":44 * self.sct = NULL * * def __call__(self, x, y, addv=None, mode=None): # <<<<<<<<<<<<<< * """Perform the scatter. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Scatter.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Scatter.pyx":58 * # * * def view(self, Viewer viewer=None) -> None: # <<<<<<<<<<<<<< * """View the scatter. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_5view(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7Scatter_4view, "Scatter.view(self, viewer: Viewer | None = None) -> None\nView the scatter.\n\n Collective.\n\n Parameters\n ----------\n viewer\n A `Viewer` instance or `None` for the default viewer.\n\n See Also\n --------\n petsc.VecScatterView\n\n \nSource code at petsc4py/PETSc/Scatter.pyx:58"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_5view(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscViewerObject *__pyx_v_viewer = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("view (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscViewerObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_viewer); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(44, 58, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "view") < 0)) __PYX_ERR(44, 58, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, __pyx_nargs); __PYX_ERR(44, 58, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Scatter.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(44, 58, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Scatter_4view(((struct PyPetscScatterObject *)__pyx_v_self), __pyx_v_viewer); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_4view(struct PyPetscScatterObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer) { PetscViewer __pyx_v_vwr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscViewer __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("view", 1); /* "petsc4py/PETSc/Scatter.pyx":73 * * """ * cdef PetscViewer vwr = NULL # <<<<<<<<<<<<<< * if viewer is not None: vwr = viewer.vwr * CHKERR( VecScatterView(self.sct, vwr) ) */ __pyx_v_vwr = NULL; /* "petsc4py/PETSc/Scatter.pyx":74 * """ * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr # <<<<<<<<<<<<<< * CHKERR( VecScatterView(self.sct, vwr) ) * */ __pyx_t_1 = (((PyObject *)__pyx_v_viewer) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_viewer->vwr; __pyx_v_vwr = __pyx_t_2; } /* "petsc4py/PETSc/Scatter.pyx":75 * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr * CHKERR( VecScatterView(self.sct, vwr) ) # <<<<<<<<<<<<<< * * def destroy(self) -> Self: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecScatterView(__pyx_v_self->sct, __pyx_v_vwr)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(44, 75, __pyx_L1_error) /* "petsc4py/PETSc/Scatter.pyx":58 * # * * def view(self, Viewer viewer=None) -> None: # <<<<<<<<<<<<<< * """View the scatter. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Scatter.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Scatter.pyx":77 * CHKERR( VecScatterView(self.sct, vwr) ) * * def destroy(self) -> Self: # <<<<<<<<<<<<<< * """Destroy the scatter. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_7destroy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7Scatter_6destroy, "Scatter.destroy(self) -> Self\nDestroy the scatter.\n\n Collective.\n\n See Also\n --------\n petsc.VecScatterDestroy\n\n \nSource code at petsc4py/PETSc/Scatter.pyx:77"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_7destroy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("destroy (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Scatter_6destroy(((struct PyPetscScatterObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_6destroy(struct PyPetscScatterObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("destroy", 1); /* "petsc4py/PETSc/Scatter.pyx":87 * * """ * CHKERR( VecScatterDestroy(&self.sct) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecScatterDestroy((&__pyx_v_self->sct))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(44, 87, __pyx_L1_error) /* "petsc4py/PETSc/Scatter.pyx":88 * """ * CHKERR( VecScatterDestroy(&self.sct) ) * return self # <<<<<<<<<<<<<< * * def create( */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Scatter.pyx":77 * CHKERR( VecScatterView(self.sct, vwr) ) * * def destroy(self) -> Self: # <<<<<<<<<<<<<< * """Destroy the scatter. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Scatter.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Scatter.pyx":90 * return self * * def create( # <<<<<<<<<<<<<< * self, * Vec vec_from, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_9create(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7Scatter_8create, "Scatter.create(self, vec_from: Vec, is_from: IS, vec_to: Vec, is_to: IS) -> Self\nCreate a scatter object.\n\n Collective.\n\n Parameters\n ----------\n vec_from\n Representative vector from which to scatter the data.\n is_from\n Indices of ``vec_from`` to scatter. If `None`, use all indices.\n vec_to\n Representative vector to which scatter the data.\n is_to\n Indices of ``vec_to`` where to receive. If `None`, use all indices.\n\n Examples\n --------\n The scatter object can be used to repeatedly perform data movement.\n It is the PETSc equivalent of NumPy-like indexing and slicing,\n with support for parallel communications:\n\n >>> revmode = PETSc.Scatter.Mode.REVERSE\n >>> v1 = PETSc.Vec().createWithArray([1, 2, 3])\n >>> v2 = PETSc.Vec().createWithArray([0, 0, 0])\n >>> sct = PETSc.Scatter().create(v1,None,v2,None)\n >>> sct.scatter(v1,v2) # v2[:] = v1[:]\n >>> sct.scatter(v2,v1,mode=revmode) # v1[:] = v2[:]\n\n >>> revmode = PETSc.Scatter.Mode.REVERSE\n >>> v1 = PETSc.Vec().createWithArray([1, 2, 3, 4])\n >>> v2 = PETSc.Vec().createWithArray([0, 0])\n >>> is1 = PETSc.IS().createStride(2, 3, -2)\n >>> sct = PETSc.Scatter().create(v1,is1,v2,None)\n >>> sct.scatter(v1,v2) # v2[:] = v1[3:0:-2]\n >>> sct.scatter(v2,v1,mode=revmode) # v1[3:0:-2] = v2[:]\n\n See Also\n --------\n IS, petsc.VecScatterCreate\n\n \nSource code at petsc4py/PETSc/Scatter.pyx:90"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_9create(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_vec_from = 0; struct PyPetscISObject *__pyx_v_is_from = 0; struct PyPetscVecObject *__pyx_v_vec_to = 0; struct PyPetscISObject *__pyx_v_is_to = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec_from,&__pyx_n_s_is_from,&__pyx_n_s_vec_to,&__pyx_n_s_is_to,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vec_from)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(44, 90, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_is_from)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(44, 90, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("create", 1, 4, 4, 1); __PYX_ERR(44, 90, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vec_to)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(44, 90, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("create", 1, 4, 4, 2); __PYX_ERR(44, 90, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_is_to)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(44, 90, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("create", 1, 4, 4, 3); __PYX_ERR(44, 90, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "create") < 0)) __PYX_ERR(44, 90, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 4)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); } __pyx_v_vec_from = ((struct PyPetscVecObject *)values[0]); __pyx_v_is_from = ((struct PyPetscISObject *)values[1]); __pyx_v_vec_to = ((struct PyPetscVecObject *)values[2]); __pyx_v_is_to = ((struct PyPetscISObject *)values[3]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("create", 1, 4, 4, __pyx_nargs); __PYX_ERR(44, 90, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Scatter.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec_from), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec_from", 0))) __PYX_ERR(44, 92, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_is_from), __pyx_ptype_8petsc4py_5PETSc_IS, 1, "is_from", 0))) __PYX_ERR(44, 93, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec_to), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec_to", 0))) __PYX_ERR(44, 94, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_is_to), __pyx_ptype_8petsc4py_5PETSc_IS, 1, "is_to", 0))) __PYX_ERR(44, 95, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Scatter_8create(((struct PyPetscScatterObject *)__pyx_v_self), __pyx_v_vec_from, __pyx_v_is_from, __pyx_v_vec_to, __pyx_v_is_to); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_8create(struct PyPetscScatterObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec_from, struct PyPetscISObject *__pyx_v_is_from, struct PyPetscVecObject *__pyx_v_vec_to, struct PyPetscISObject *__pyx_v_is_to) { IS __pyx_v_cisfrom; IS __pyx_v_cisto; VecScatter __pyx_v_newsct; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; IS __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create", 1); /* "petsc4py/PETSc/Scatter.pyx":138 * * """ * cdef PetscIS cisfrom = NULL, cisto = NULL # <<<<<<<<<<<<<< * if is_from is not None: cisfrom = is_from.iset * if is_to is not None: cisto = is_to.iset */ __pyx_v_cisfrom = NULL; __pyx_v_cisto = NULL; /* "petsc4py/PETSc/Scatter.pyx":139 * """ * cdef PetscIS cisfrom = NULL, cisto = NULL * if is_from is not None: cisfrom = is_from.iset # <<<<<<<<<<<<<< * if is_to is not None: cisto = is_to.iset * cdef PetscScatter newsct = NULL */ __pyx_t_1 = (((PyObject *)__pyx_v_is_from) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_is_from->iset; __pyx_v_cisfrom = __pyx_t_2; } /* "petsc4py/PETSc/Scatter.pyx":140 * cdef PetscIS cisfrom = NULL, cisto = NULL * if is_from is not None: cisfrom = is_from.iset * if is_to is not None: cisto = is_to.iset # <<<<<<<<<<<<<< * cdef PetscScatter newsct = NULL * CHKERR( VecScatterCreate( */ __pyx_t_1 = (((PyObject *)__pyx_v_is_to) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_is_to->iset; __pyx_v_cisto = __pyx_t_2; } /* "petsc4py/PETSc/Scatter.pyx":141 * if is_from is not None: cisfrom = is_from.iset * if is_to is not None: cisto = is_to.iset * cdef PetscScatter newsct = NULL # <<<<<<<<<<<<<< * CHKERR( VecScatterCreate( * vec_from.vec, cisfrom, vec_to.vec, cisto, &newsct) ) */ __pyx_v_newsct = NULL; /* "petsc4py/PETSc/Scatter.pyx":142 * if is_to is not None: cisto = is_to.iset * cdef PetscScatter newsct = NULL * CHKERR( VecScatterCreate( # <<<<<<<<<<<<<< * vec_from.vec, cisfrom, vec_to.vec, cisto, &newsct) ) * CHKERR( PetscCLEAR(self.obj) ); self.sct = newsct */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecScatterCreate(__pyx_v_vec_from->vec, __pyx_v_cisfrom, __pyx_v_vec_to->vec, __pyx_v_cisto, (&__pyx_v_newsct))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(44, 142, __pyx_L1_error) /* "petsc4py/PETSc/Scatter.pyx":144 * CHKERR( VecScatterCreate( * vec_from.vec, cisfrom, vec_to.vec, cisto, &newsct) ) * CHKERR( PetscCLEAR(self.obj) ); self.sct = newsct # <<<<<<<<<<<<<< * return self * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(44, 144, __pyx_L1_error) __pyx_v_self->sct = __pyx_v_newsct; /* "petsc4py/PETSc/Scatter.pyx":145 * vec_from.vec, cisfrom, vec_to.vec, cisto, &newsct) ) * CHKERR( PetscCLEAR(self.obj) ); self.sct = newsct * return self # <<<<<<<<<<<<<< * * def setType(self, scatter_type: Type | str) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Scatter.pyx":90 * return self * * def create( # <<<<<<<<<<<<<< * self, * Vec vec_from, */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Scatter.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Scatter.pyx":147 * return self * * def setType(self, scatter_type: Type | str) -> None: # <<<<<<<<<<<<<< * """Set the type of the scatter. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_11setType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7Scatter_10setType, "Scatter.setType(self, scatter_type: Type | str) -> None\nSet the type of the scatter.\n\n Logically collective.\n\n See Also\n --------\n getType, petsc.VecScatterSetType\n\n \nSource code at petsc4py/PETSc/Scatter.pyx:147"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_11setType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_scatter_type = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_scatter_type,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_scatter_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(44, 147, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setType") < 0)) __PYX_ERR(44, 147, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_scatter_type = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, __pyx_nargs); __PYX_ERR(44, 147, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Scatter.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Scatter_10setType(((struct PyPetscScatterObject *)__pyx_v_self), __pyx_v_scatter_type); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_10setType(struct PyPetscScatterObject *__pyx_v_self, PyObject *__pyx_v_scatter_type) { VecScatterType __pyx_v_cval; CYTHON_UNUSED PyObject *__pyx_v_vec_type = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setType", 1); /* "petsc4py/PETSc/Scatter.pyx":157 * * """ * cdef PetscScatterType cval = NULL # <<<<<<<<<<<<<< * vec_type = str2bytes(scatter_type, &cval) * CHKERR( VecScatterSetType(self.sct, cval) ) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/Scatter.pyx":158 * """ * cdef PetscScatterType cval = NULL * vec_type = str2bytes(scatter_type, &cval) # <<<<<<<<<<<<<< * CHKERR( VecScatterSetType(self.sct, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_scatter_type, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(44, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_vec_type = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/Scatter.pyx":159 * cdef PetscScatterType cval = NULL * vec_type = str2bytes(scatter_type, &cval) * CHKERR( VecScatterSetType(self.sct, cval) ) # <<<<<<<<<<<<<< * * def getType(self) -> str: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecScatterSetType(__pyx_v_self->sct, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(44, 159, __pyx_L1_error) /* "petsc4py/PETSc/Scatter.pyx":147 * return self * * def setType(self, scatter_type: Type | str) -> None: # <<<<<<<<<<<<<< * """Set the type of the scatter. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Scatter.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_vec_type); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Scatter.pyx":161 * CHKERR( VecScatterSetType(self.sct, cval) ) * * def getType(self) -> str: # <<<<<<<<<<<<<< * """Return the type of the scatter. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_13getType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7Scatter_12getType, "Scatter.getType(self) -> str\nReturn the type of the scatter.\n\n Not collective.\n\n See Also\n --------\n setType, petsc.VecScatterGetType\n\n \nSource code at petsc4py/PETSc/Scatter.pyx:161"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_13getType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getType", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Scatter_12getType(((struct PyPetscScatterObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_12getType(struct PyPetscScatterObject *__pyx_v_self) { VecScatterType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getType", 1); /* "petsc4py/PETSc/Scatter.pyx":171 * * """ * cdef PetscScatterType cval = NULL # <<<<<<<<<<<<<< * CHKERR( VecScatterGetType(self.sct, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/Scatter.pyx":172 * """ * cdef PetscScatterType cval = NULL * CHKERR( VecScatterGetType(self.sct, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecScatterGetType(__pyx_v_self->sct, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(44, 172, __pyx_L1_error) /* "petsc4py/PETSc/Scatter.pyx":173 * cdef PetscScatterType cval = NULL * CHKERR( VecScatterGetType(self.sct, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * def setFromOptions(self) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(44, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Scatter.pyx":161 * CHKERR( VecScatterSetType(self.sct, cval) ) * * def getType(self) -> str: # <<<<<<<<<<<<<< * """Return the type of the scatter. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Scatter.getType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Scatter.pyx":175 * return bytes2str(cval) * * def setFromOptions(self) -> None: # <<<<<<<<<<<<<< * """Configure the scatter from the options database. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_15setFromOptions(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7Scatter_14setFromOptions, "Scatter.setFromOptions(self) -> None\nConfigure the scatter from the options database.\n\n Collective.\n\n See Also\n --------\n petsc_options, petsc.VecScatterSetFromOptions\n\n \nSource code at petsc4py/PETSc/Scatter.pyx:175"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_15setFromOptions(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFromOptions (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("setFromOptions", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setFromOptions", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Scatter_14setFromOptions(((struct PyPetscScatterObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_14setFromOptions(struct PyPetscScatterObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFromOptions", 1); /* "petsc4py/PETSc/Scatter.pyx":185 * * """ * CHKERR( VecScatterSetFromOptions(self.sct) ) # <<<<<<<<<<<<<< * * def setUp(self) -> Self: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecScatterSetFromOptions(__pyx_v_self->sct)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(44, 185, __pyx_L1_error) /* "petsc4py/PETSc/Scatter.pyx":175 * return bytes2str(cval) * * def setFromOptions(self) -> None: # <<<<<<<<<<<<<< * """Configure the scatter from the options database. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Scatter.setFromOptions", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Scatter.pyx":187 * CHKERR( VecScatterSetFromOptions(self.sct) ) * * def setUp(self) -> Self: # <<<<<<<<<<<<<< * """Set up the internal data structures for using the scatter. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_17setUp(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7Scatter_16setUp, "Scatter.setUp(self) -> Self\nSet up the internal data structures for using the scatter.\n\n Collective.\n\n See Also\n --------\n petsc.VecScatterSetUp\n\n \nSource code at petsc4py/PETSc/Scatter.pyx:187"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_17setUp(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setUp (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("setUp", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setUp", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Scatter_16setUp(((struct PyPetscScatterObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_16setUp(struct PyPetscScatterObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setUp", 1); /* "petsc4py/PETSc/Scatter.pyx":197 * * """ * CHKERR( VecScatterSetUp(self.sct) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecScatterSetUp(__pyx_v_self->sct)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(44, 197, __pyx_L1_error) /* "petsc4py/PETSc/Scatter.pyx":198 * """ * CHKERR( VecScatterSetUp(self.sct) ) * return self # <<<<<<<<<<<<<< * * def copy(self) -> Scatter: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Scatter.pyx":187 * CHKERR( VecScatterSetFromOptions(self.sct) ) * * def setUp(self) -> Self: # <<<<<<<<<<<<<< * """Set up the internal data structures for using the scatter. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Scatter.setUp", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Scatter.pyx":200 * return self * * def copy(self) -> Scatter: # <<<<<<<<<<<<<< * """Return a copy of the scatter.""" * cdef Scatter scatter = Scatter() */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_19copy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7Scatter_18copy, "Scatter.copy(self) -> Scatter\nReturn a copy of the scatter.\nSource code at petsc4py/PETSc/Scatter.pyx:200"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_19copy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("copy (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("copy", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "copy", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Scatter_18copy(((struct PyPetscScatterObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_18copy(struct PyPetscScatterObject *__pyx_v_self) { struct PyPetscScatterObject *__pyx_v_scatter = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("copy", 1); /* "petsc4py/PETSc/Scatter.pyx":202 * def copy(self) -> Scatter: * """Return a copy of the scatter.""" * cdef Scatter scatter = Scatter() # <<<<<<<<<<<<<< * CHKERR( VecScatterCopy(self.sct, &scatter.sct) ) * return scatter */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Scatter)); if (unlikely(!__pyx_t_1)) __PYX_ERR(44, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_scatter = ((struct PyPetscScatterObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Scatter.pyx":203 * """Return a copy of the scatter.""" * cdef Scatter scatter = Scatter() * CHKERR( VecScatterCopy(self.sct, &scatter.sct) ) # <<<<<<<<<<<<<< * return scatter * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecScatterCopy(__pyx_v_self->sct, (&__pyx_v_scatter->sct))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(44, 203, __pyx_L1_error) /* "petsc4py/PETSc/Scatter.pyx":204 * cdef Scatter scatter = Scatter() * CHKERR( VecScatterCopy(self.sct, &scatter.sct) ) * return scatter # <<<<<<<<<<<<<< * * @classmethod */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_scatter); __pyx_r = ((PyObject *)__pyx_v_scatter); goto __pyx_L0; /* "petsc4py/PETSc/Scatter.pyx":200 * return self * * def copy(self) -> Scatter: # <<<<<<<<<<<<<< * """Return a copy of the scatter.""" * cdef Scatter scatter = Scatter() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Scatter.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_scatter); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Scatter.pyx":206 * return scatter * * @classmethod # <<<<<<<<<<<<<< * def toAll(cls, Vec vec) -> tuple[Scatter, Vec]: * """Create a scatter that communicates a vector to all sharing processes. */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_21toAll(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7Scatter_20toAll, "Scatter.toAll(cls, vec: Vec) -> tuple[Scatter, Vec]\nCreate a scatter that communicates a vector to all sharing processes.\n\n Collective.\n\n Parameters\n ----------\n vec\n The vector to scatter from.\n\n Notes\n -----\n The created scatter will have the same communicator of ``vec``.\n The method also returns an output vector of appropriate size to\n contain the result of the operation.\n\n See Also\n --------\n toZero, petsc.VecScatterCreateToAll\n\n \nSource code at petsc4py/PETSc/Scatter.pyx:206"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_21toAll(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_vec = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("toAll (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vec)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(44, 206, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "toAll") < 0)) __PYX_ERR(44, 206, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_vec = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("toAll", 1, 1, 1, __pyx_nargs); __PYX_ERR(44, 206, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Scatter.toAll", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(44, 207, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Scatter_20toAll(((PyTypeObject*)__pyx_v_cls), __pyx_v_vec); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_20toAll(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, struct PyPetscVecObject *__pyx_v_vec) { struct PyPetscScatterObject *__pyx_v_scatter = 0; struct PyPetscVecObject *__pyx_v_ovec = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("toAll", 1); /* "petsc4py/PETSc/Scatter.pyx":228 * * """ * cdef Scatter scatter = Scatter() # <<<<<<<<<<<<<< * cdef Vec ovec = Vec() * CHKERR( VecScatterCreateToAll( */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Scatter)); if (unlikely(!__pyx_t_1)) __PYX_ERR(44, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_scatter = ((struct PyPetscScatterObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Scatter.pyx":229 * """ * cdef Scatter scatter = Scatter() * cdef Vec ovec = Vec() # <<<<<<<<<<<<<< * CHKERR( VecScatterCreateToAll( * vec.vec, &scatter.sct, &ovec.vec) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(44, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ovec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Scatter.pyx":230 * cdef Scatter scatter = Scatter() * cdef Vec ovec = Vec() * CHKERR( VecScatterCreateToAll( # <<<<<<<<<<<<<< * vec.vec, &scatter.sct, &ovec.vec) ) * return (scatter, ovec) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecScatterCreateToAll(__pyx_v_vec->vec, (&__pyx_v_scatter->sct), (&__pyx_v_ovec->vec))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(44, 230, __pyx_L1_error) /* "petsc4py/PETSc/Scatter.pyx":232 * CHKERR( VecScatterCreateToAll( * vec.vec, &scatter.sct, &ovec.vec) ) * return (scatter, ovec) # <<<<<<<<<<<<<< * * @classmethod */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(44, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF((PyObject *)__pyx_v_scatter); __Pyx_GIVEREF((PyObject *)__pyx_v_scatter); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_scatter))) __PYX_ERR(44, 232, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_ovec); __Pyx_GIVEREF((PyObject *)__pyx_v_ovec); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_ovec))) __PYX_ERR(44, 232, __pyx_L1_error); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Scatter.pyx":206 * return scatter * * @classmethod # <<<<<<<<<<<<<< * def toAll(cls, Vec vec) -> tuple[Scatter, Vec]: * """Create a scatter that communicates a vector to all sharing processes. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Scatter.toAll", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_scatter); __Pyx_XDECREF((PyObject *)__pyx_v_ovec); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Scatter.pyx":234 * return (scatter, ovec) * * @classmethod # <<<<<<<<<<<<<< * def toZero(cls, Vec vec) -> tuple[Scatter, Vec]: * """Create a scatter that communicates a vector to rank zero. */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_23toZero(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7Scatter_22toZero, "Scatter.toZero(cls, vec: Vec) -> tuple[Scatter, Vec]\nCreate a scatter that communicates a vector to rank zero.\n\n Collective.\n\n Parameters\n ----------\n vec\n The vector to scatter from.\n\n Notes\n -----\n The created scatter will have the same communicator of ``vec``.\n The method also returns an output vector of appropriate size to\n contain the result of the operation.\n\n See Also\n --------\n toAll, petsc.VecScatterCreateToZero\n\n \nSource code at petsc4py/PETSc/Scatter.pyx:234"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_23toZero(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_vec = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("toZero (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vec)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(44, 234, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "toZero") < 0)) __PYX_ERR(44, 234, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_vec = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("toZero", 1, 1, 1, __pyx_nargs); __PYX_ERR(44, 234, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Scatter.toZero", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(44, 235, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Scatter_22toZero(((PyTypeObject*)__pyx_v_cls), __pyx_v_vec); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_22toZero(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, struct PyPetscVecObject *__pyx_v_vec) { struct PyPetscScatterObject *__pyx_v_scatter = 0; struct PyPetscVecObject *__pyx_v_ovec = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("toZero", 1); /* "petsc4py/PETSc/Scatter.pyx":256 * * """ * cdef Scatter scatter = Scatter() # <<<<<<<<<<<<<< * cdef Vec ovec = Vec() * CHKERR( VecScatterCreateToZero( */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Scatter)); if (unlikely(!__pyx_t_1)) __PYX_ERR(44, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_scatter = ((struct PyPetscScatterObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Scatter.pyx":257 * """ * cdef Scatter scatter = Scatter() * cdef Vec ovec = Vec() # <<<<<<<<<<<<<< * CHKERR( VecScatterCreateToZero( * vec.vec, &scatter.sct, &ovec.vec) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(44, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ovec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Scatter.pyx":258 * cdef Scatter scatter = Scatter() * cdef Vec ovec = Vec() * CHKERR( VecScatterCreateToZero( # <<<<<<<<<<<<<< * vec.vec, &scatter.sct, &ovec.vec) ) * return (scatter, ovec) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecScatterCreateToZero(__pyx_v_vec->vec, (&__pyx_v_scatter->sct), (&__pyx_v_ovec->vec))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(44, 258, __pyx_L1_error) /* "petsc4py/PETSc/Scatter.pyx":260 * CHKERR( VecScatterCreateToZero( * vec.vec, &scatter.sct, &ovec.vec) ) * return (scatter, ovec) # <<<<<<<<<<<<<< * # * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(44, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF((PyObject *)__pyx_v_scatter); __Pyx_GIVEREF((PyObject *)__pyx_v_scatter); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_scatter))) __PYX_ERR(44, 260, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_ovec); __Pyx_GIVEREF((PyObject *)__pyx_v_ovec); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_ovec))) __PYX_ERR(44, 260, __pyx_L1_error); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Scatter.pyx":234 * return (scatter, ovec) * * @classmethod # <<<<<<<<<<<<<< * def toZero(cls, Vec vec) -> tuple[Scatter, Vec]: * """Create a scatter that communicates a vector to rank zero. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Scatter.toZero", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_scatter); __Pyx_XDECREF((PyObject *)__pyx_v_ovec); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Scatter.pyx":263 * # * * def begin( # <<<<<<<<<<<<<< * self, * Vec vec_from, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_25begin(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7Scatter_24begin, "Scatter.begin(self, vec_from: Vec, vec_to: Vec, addv: InsertModeSpec = None, mode: ScatterModeSpec = None) -> None\nBegin a generalized scatter from one vector into another.\n\n Collective.\n\n This call has to be concluded with a call to `end`.\n For additional details on the Parameters, see `scatter`.\n\n See Also\n --------\n create, end, petsc.VecScatterBegin\n\n \nSource code at petsc4py/PETSc/Scatter.pyx:263"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_25begin(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_vec_from = 0; struct PyPetscVecObject *__pyx_v_vec_to = 0; PyObject *__pyx_v_addv = 0; PyObject *__pyx_v_mode = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("begin (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec_from,&__pyx_n_s_vec_to,&__pyx_n_s_addv,&__pyx_n_s_mode,0}; /* "petsc4py/PETSc/Scatter.pyx":267 * Vec vec_from, * Vec vec_to, * addv: InsertModeSpec = None, # <<<<<<<<<<<<<< * mode: ScatterModeSpec = None, * ) -> None: */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Scatter.pyx":268 * Vec vec_to, * addv: InsertModeSpec = None, * mode: ScatterModeSpec = None, # <<<<<<<<<<<<<< * ) -> None: * """Begin a generalized scatter from one vector into another. */ values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vec_from)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(44, 263, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vec_to)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(44, 263, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("begin", 0, 2, 4, 1); __PYX_ERR(44, 263, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_addv); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(44, 263, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mode); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(44, 263, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "begin") < 0)) __PYX_ERR(44, 263, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_vec_from = ((struct PyPetscVecObject *)values[0]); __pyx_v_vec_to = ((struct PyPetscVecObject *)values[1]); __pyx_v_addv = values[2]; __pyx_v_mode = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("begin", 0, 2, 4, __pyx_nargs); __PYX_ERR(44, 263, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Scatter.begin", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec_from), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec_from", 0))) __PYX_ERR(44, 265, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec_to), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec_to", 0))) __PYX_ERR(44, 266, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Scatter_24begin(((struct PyPetscScatterObject *)__pyx_v_self), __pyx_v_vec_from, __pyx_v_vec_to, __pyx_v_addv, __pyx_v_mode); /* "petsc4py/PETSc/Scatter.pyx":263 * # * * def begin( # <<<<<<<<<<<<<< * self, * Vec vec_from, */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_24begin(struct PyPetscScatterObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec_from, struct PyPetscVecObject *__pyx_v_vec_to, PyObject *__pyx_v_addv, PyObject *__pyx_v_mode) { InsertMode __pyx_v_caddv; ScatterMode __pyx_v_csctm; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations InsertMode __pyx_t_1; ScatterMode __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("begin", 1); /* "petsc4py/PETSc/Scatter.pyx":282 * * """ * cdef PetscInsertMode caddv = insertmode(addv) # <<<<<<<<<<<<<< * cdef PetscScatterMode csctm = scattermode(mode) * CHKERR( VecScatterBegin(self.sct, vec_from.vec, vec_to.vec, */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_insertmode(__pyx_v_addv); if (unlikely(__pyx_t_1 == ((InsertMode)((InsertMode)-1L)))) __PYX_ERR(44, 282, __pyx_L1_error) __pyx_v_caddv = __pyx_t_1; /* "petsc4py/PETSc/Scatter.pyx":283 * """ * cdef PetscInsertMode caddv = insertmode(addv) * cdef PetscScatterMode csctm = scattermode(mode) # <<<<<<<<<<<<<< * CHKERR( VecScatterBegin(self.sct, vec_from.vec, vec_to.vec, * caddv, csctm) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_scattermode(__pyx_v_mode); if (unlikely(__pyx_t_2 == ((ScatterMode)((ScatterMode)-1L)))) __PYX_ERR(44, 283, __pyx_L1_error) __pyx_v_csctm = __pyx_t_2; /* "petsc4py/PETSc/Scatter.pyx":284 * cdef PetscInsertMode caddv = insertmode(addv) * cdef PetscScatterMode csctm = scattermode(mode) * CHKERR( VecScatterBegin(self.sct, vec_from.vec, vec_to.vec, # <<<<<<<<<<<<<< * caddv, csctm) ) * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecScatterBegin(__pyx_v_self->sct, __pyx_v_vec_from->vec, __pyx_v_vec_to->vec, __pyx_v_caddv, __pyx_v_csctm)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(44, 284, __pyx_L1_error) /* "petsc4py/PETSc/Scatter.pyx":263 * # * * def begin( # <<<<<<<<<<<<<< * self, * Vec vec_from, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Scatter.begin", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Scatter.pyx":287 * caddv, csctm) ) * * def end( # <<<<<<<<<<<<<< * self, * Vec vec_from, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_27end(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7Scatter_26end, "Scatter.end(self, vec_from: Vec, vec_to: Vec, addv: InsertModeSpec = None, mode: ScatterModeSpec = None) -> None\nComplete a generalized scatter from one vector into another.\n\n Collective.\n\n This call has to be preceded by a call to `begin`.\n For additional details on the Parameters, see `scatter`.\n\n See Also\n --------\n create, begin, petsc.VecScatterEnd\n\n \nSource code at petsc4py/PETSc/Scatter.pyx:287"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_27end(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_vec_from = 0; struct PyPetscVecObject *__pyx_v_vec_to = 0; PyObject *__pyx_v_addv = 0; PyObject *__pyx_v_mode = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("end (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec_from,&__pyx_n_s_vec_to,&__pyx_n_s_addv,&__pyx_n_s_mode,0}; /* "petsc4py/PETSc/Scatter.pyx":291 * Vec vec_from, * Vec vec_to, * addv: InsertModeSpec = None, # <<<<<<<<<<<<<< * mode: ScatterModeSpec = None, * ) -> None: */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Scatter.pyx":292 * Vec vec_to, * addv: InsertModeSpec = None, * mode: ScatterModeSpec = None, # <<<<<<<<<<<<<< * ) -> None: * """Complete a generalized scatter from one vector into another. */ values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vec_from)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(44, 287, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vec_to)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(44, 287, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("end", 0, 2, 4, 1); __PYX_ERR(44, 287, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_addv); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(44, 287, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mode); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(44, 287, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "end") < 0)) __PYX_ERR(44, 287, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_vec_from = ((struct PyPetscVecObject *)values[0]); __pyx_v_vec_to = ((struct PyPetscVecObject *)values[1]); __pyx_v_addv = values[2]; __pyx_v_mode = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("end", 0, 2, 4, __pyx_nargs); __PYX_ERR(44, 287, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Scatter.end", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec_from), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec_from", 0))) __PYX_ERR(44, 289, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec_to), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec_to", 0))) __PYX_ERR(44, 290, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Scatter_26end(((struct PyPetscScatterObject *)__pyx_v_self), __pyx_v_vec_from, __pyx_v_vec_to, __pyx_v_addv, __pyx_v_mode); /* "petsc4py/PETSc/Scatter.pyx":287 * caddv, csctm) ) * * def end( # <<<<<<<<<<<<<< * self, * Vec vec_from, */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_26end(struct PyPetscScatterObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec_from, struct PyPetscVecObject *__pyx_v_vec_to, PyObject *__pyx_v_addv, PyObject *__pyx_v_mode) { InsertMode __pyx_v_caddv; ScatterMode __pyx_v_csctm; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations InsertMode __pyx_t_1; ScatterMode __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("end", 1); /* "petsc4py/PETSc/Scatter.pyx":306 * * """ * cdef PetscInsertMode caddv = insertmode(addv) # <<<<<<<<<<<<<< * cdef PetscScatterMode csctm = scattermode(mode) * CHKERR( VecScatterEnd(self.sct, vec_from.vec, vec_to.vec, */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_insertmode(__pyx_v_addv); if (unlikely(__pyx_t_1 == ((InsertMode)((InsertMode)-1L)))) __PYX_ERR(44, 306, __pyx_L1_error) __pyx_v_caddv = __pyx_t_1; /* "petsc4py/PETSc/Scatter.pyx":307 * """ * cdef PetscInsertMode caddv = insertmode(addv) * cdef PetscScatterMode csctm = scattermode(mode) # <<<<<<<<<<<<<< * CHKERR( VecScatterEnd(self.sct, vec_from.vec, vec_to.vec, * caddv, csctm) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_scattermode(__pyx_v_mode); if (unlikely(__pyx_t_2 == ((ScatterMode)((ScatterMode)-1L)))) __PYX_ERR(44, 307, __pyx_L1_error) __pyx_v_csctm = __pyx_t_2; /* "petsc4py/PETSc/Scatter.pyx":308 * cdef PetscInsertMode caddv = insertmode(addv) * cdef PetscScatterMode csctm = scattermode(mode) * CHKERR( VecScatterEnd(self.sct, vec_from.vec, vec_to.vec, # <<<<<<<<<<<<<< * caddv, csctm) ) * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecScatterEnd(__pyx_v_self->sct, __pyx_v_vec_from->vec, __pyx_v_vec_to->vec, __pyx_v_caddv, __pyx_v_csctm)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(44, 308, __pyx_L1_error) /* "petsc4py/PETSc/Scatter.pyx":287 * caddv, csctm) ) * * def end( # <<<<<<<<<<<<<< * self, * Vec vec_from, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Scatter.end", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Scatter.pyx":311 * caddv, csctm) ) * * def scatter( # <<<<<<<<<<<<<< * self, * Vec vec_from, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_29scatter(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7Scatter_28scatter, "Scatter.scatter(self, vec_from: Vec, vec_to: Vec, addv: InsertModeSpec = None, mode: ScatterModeSpec = None) -> None\nPerform a generalized scatter from one vector into another.\n\n Collective.\n\n Parameters\n ----------\n vec_from\n The source vector.\n vec_to\n The destination vector.\n addv\n Insertion mode.\n mode\n Scatter mode.\n\n See Also\n --------\n create, begin, end, petsc.VecScatterBegin, petsc.VecScatterEnd\n\n \nSource code at petsc4py/PETSc/Scatter.pyx:311"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_29scatter(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_vec_from = 0; struct PyPetscVecObject *__pyx_v_vec_to = 0; PyObject *__pyx_v_addv = 0; PyObject *__pyx_v_mode = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("scatter (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec_from,&__pyx_n_s_vec_to,&__pyx_n_s_addv,&__pyx_n_s_mode,0}; /* "petsc4py/PETSc/Scatter.pyx":315 * Vec vec_from, * Vec vec_to, * addv: InsertModeSpec = None, # <<<<<<<<<<<<<< * mode: ScatterModeSpec = None, * ) -> None: */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Scatter.pyx":316 * Vec vec_to, * addv: InsertModeSpec = None, * mode: ScatterModeSpec = None, # <<<<<<<<<<<<<< * ) -> None: * """Perform a generalized scatter from one vector into another. */ values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vec_from)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(44, 311, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vec_to)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(44, 311, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("scatter", 0, 2, 4, 1); __PYX_ERR(44, 311, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_addv); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(44, 311, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mode); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(44, 311, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "scatter") < 0)) __PYX_ERR(44, 311, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_vec_from = ((struct PyPetscVecObject *)values[0]); __pyx_v_vec_to = ((struct PyPetscVecObject *)values[1]); __pyx_v_addv = values[2]; __pyx_v_mode = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("scatter", 0, 2, 4, __pyx_nargs); __PYX_ERR(44, 311, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Scatter.scatter", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec_from), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec_from", 0))) __PYX_ERR(44, 313, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec_to), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec_to", 0))) __PYX_ERR(44, 314, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Scatter_28scatter(((struct PyPetscScatterObject *)__pyx_v_self), __pyx_v_vec_from, __pyx_v_vec_to, __pyx_v_addv, __pyx_v_mode); /* "petsc4py/PETSc/Scatter.pyx":311 * caddv, csctm) ) * * def scatter( # <<<<<<<<<<<<<< * self, * Vec vec_from, */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_28scatter(struct PyPetscScatterObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec_from, struct PyPetscVecObject *__pyx_v_vec_to, PyObject *__pyx_v_addv, PyObject *__pyx_v_mode) { InsertMode __pyx_v_caddv; ScatterMode __pyx_v_csctm; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations InsertMode __pyx_t_1; ScatterMode __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("scatter", 1); /* "petsc4py/PETSc/Scatter.pyx":338 * * """ * cdef PetscInsertMode caddv = insertmode(addv) # <<<<<<<<<<<<<< * cdef PetscScatterMode csctm = scattermode(mode) * CHKERR( VecScatterBegin(self.sct, vec_from.vec, vec_to.vec, */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_insertmode(__pyx_v_addv); if (unlikely(__pyx_t_1 == ((InsertMode)((InsertMode)-1L)))) __PYX_ERR(44, 338, __pyx_L1_error) __pyx_v_caddv = __pyx_t_1; /* "petsc4py/PETSc/Scatter.pyx":339 * """ * cdef PetscInsertMode caddv = insertmode(addv) * cdef PetscScatterMode csctm = scattermode(mode) # <<<<<<<<<<<<<< * CHKERR( VecScatterBegin(self.sct, vec_from.vec, vec_to.vec, * caddv, csctm) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_scattermode(__pyx_v_mode); if (unlikely(__pyx_t_2 == ((ScatterMode)((ScatterMode)-1L)))) __PYX_ERR(44, 339, __pyx_L1_error) __pyx_v_csctm = __pyx_t_2; /* "petsc4py/PETSc/Scatter.pyx":340 * cdef PetscInsertMode caddv = insertmode(addv) * cdef PetscScatterMode csctm = scattermode(mode) * CHKERR( VecScatterBegin(self.sct, vec_from.vec, vec_to.vec, # <<<<<<<<<<<<<< * caddv, csctm) ) * CHKERR( VecScatterEnd(self.sct, vec_from.vec, vec_to.vec, */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecScatterBegin(__pyx_v_self->sct, __pyx_v_vec_from->vec, __pyx_v_vec_to->vec, __pyx_v_caddv, __pyx_v_csctm)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(44, 340, __pyx_L1_error) /* "petsc4py/PETSc/Scatter.pyx":342 * CHKERR( VecScatterBegin(self.sct, vec_from.vec, vec_to.vec, * caddv, csctm) ) * CHKERR( VecScatterEnd(self.sct, vec_from.vec, vec_to.vec, # <<<<<<<<<<<<<< * caddv, csctm) ) * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecScatterEnd(__pyx_v_self->sct, __pyx_v_vec_from->vec, __pyx_v_vec_to->vec, __pyx_v_caddv, __pyx_v_csctm)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(44, 342, __pyx_L1_error) /* "petsc4py/PETSc/Scatter.pyx":311 * caddv, csctm) ) * * def scatter( # <<<<<<<<<<<<<< * self, * Vec vec_from, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Scatter.scatter", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Section.pyx":6 * """Mapping from integers in a range to unstructured set of integers.""" * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.sec * self.sec = NULL */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_7Section_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_7Section_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section___cinit__(((struct PyPetscSectionObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_7Section___cinit__(struct PyPetscSectionObject *__pyx_v_self) { int __pyx_r; /* "petsc4py/PETSc/Section.pyx":7 * * def __cinit__(self): * self.obj = &self.sec # <<<<<<<<<<<<<< * self.sec = NULL * */ __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->sec)); /* "petsc4py/PETSc/Section.pyx":8 * def __cinit__(self): * self.obj = &self.sec * self.sec = NULL # <<<<<<<<<<<<<< * * def __dealloc__(self): */ __pyx_v_self->sec = NULL; /* "petsc4py/PETSc/Section.pyx":6 * """Mapping from integers in a range to unstructured set of integers.""" * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.sec * self.sec = NULL */ /* function exit code */ __pyx_r = 0; return __pyx_r; } /* "petsc4py/PETSc/Section.pyx":10 * self.sec = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< * CHKERR( PetscSectionDestroy(&self.sec) ) * self.sec = NULL */ /* Python wrapper */ static void __pyx_pw_8petsc4py_5PETSc_7Section_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_8petsc4py_5PETSc_7Section_3__dealloc__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_pf_8petsc4py_5PETSc_7Section_2__dealloc__(((struct PyPetscSectionObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_8petsc4py_5PETSc_7Section_2__dealloc__(struct PyPetscSectionObject *__pyx_v_self) { PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "petsc4py/PETSc/Section.pyx":11 * * def __dealloc__(self): * CHKERR( PetscSectionDestroy(&self.sec) ) # <<<<<<<<<<<<<< * self.sec = NULL * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionDestroy((&__pyx_v_self->sec))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 11, __pyx_L1_error) /* "petsc4py/PETSc/Section.pyx":12 * def __dealloc__(self): * CHKERR( PetscSectionDestroy(&self.sec) ) * self.sec = NULL # <<<<<<<<<<<<<< * * def view(self, Viewer viewer=None) -> None: */ __pyx_v_self->sec = NULL; /* "petsc4py/PETSc/Section.pyx":10 * self.sec = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< * CHKERR( PetscSectionDestroy(&self.sec) ) * self.sec = NULL */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_WriteUnraisable("petsc4py.PETSc.Section.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_L0:; } /* "petsc4py/PETSc/Section.pyx":14 * self.sec = NULL * * def view(self, Viewer viewer=None) -> None: # <<<<<<<<<<<<<< * """View the section. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_5view(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7Section_4view, "Section.view(self, viewer: Viewer | None = None) -> None\nView the section.\n\n Collective.\n\n Parameters\n ----------\n viewer\n A `Viewer` to display the section.\n\n See Also\n --------\n petsc.PetscSectionView\n\n \nSource code at petsc4py/PETSc/Section.pyx:14"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_5view(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscViewerObject *__pyx_v_viewer = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("view (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscViewerObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_viewer); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 14, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "view") < 0)) __PYX_ERR(45, 14, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, __pyx_nargs); __PYX_ERR(45, 14, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Section.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(45, 14, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_4view(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_viewer); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_4view(struct PyPetscSectionObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer) { PetscViewer __pyx_v_vwr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscViewer __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("view", 1); /* "petsc4py/PETSc/Section.pyx":29 * * """ * cdef PetscViewer vwr = NULL # <<<<<<<<<<<<<< * if viewer is not None: vwr = viewer.vwr * CHKERR( PetscSectionView(self.sec, vwr) ) */ __pyx_v_vwr = NULL; /* "petsc4py/PETSc/Section.pyx":30 * """ * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr # <<<<<<<<<<<<<< * CHKERR( PetscSectionView(self.sec, vwr) ) * */ __pyx_t_1 = (((PyObject *)__pyx_v_viewer) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_viewer->vwr; __pyx_v_vwr = __pyx_t_2; } /* "petsc4py/PETSc/Section.pyx":31 * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr * CHKERR( PetscSectionView(self.sec, vwr) ) # <<<<<<<<<<<<<< * * def destroy(self) -> Self: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionView(__pyx_v_self->sec, __pyx_v_vwr)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 31, __pyx_L1_error) /* "petsc4py/PETSc/Section.pyx":14 * self.sec = NULL * * def view(self, Viewer viewer=None) -> None: # <<<<<<<<<<<<<< * """View the section. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Section.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Section.pyx":33 * CHKERR( PetscSectionView(self.sec, vwr) ) * * def destroy(self) -> Self: # <<<<<<<<<<<<<< * """Destroy a section. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_7destroy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7Section_6destroy, "Section.destroy(self) -> Self\nDestroy a section.\n\n Not collective.\n\n See Also\n --------\n petsc.PetscSectionDestroy\n\n \nSource code at petsc4py/PETSc/Section.pyx:33"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_7destroy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("destroy (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_6destroy(((struct PyPetscSectionObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_6destroy(struct PyPetscSectionObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("destroy", 1); /* "petsc4py/PETSc/Section.pyx":43 * * """ * CHKERR( PetscSectionDestroy(&self.sec) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionDestroy((&__pyx_v_self->sec))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 43, __pyx_L1_error) /* "petsc4py/PETSc/Section.pyx":44 * """ * CHKERR( PetscSectionDestroy(&self.sec) ) * return self # <<<<<<<<<<<<<< * * def create(self, comm: Comm | None = None) -> Self: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Section.pyx":33 * CHKERR( PetscSectionView(self.sec, vwr) ) * * def destroy(self) -> Self: # <<<<<<<<<<<<<< * """Destroy a section. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Section.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Section.pyx":46 * return self * * def create(self, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Allocate a section and set the map contents to the default. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_9create(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7Section_8create, "Section.create(self, comm: Comm | None = None) -> Self\nAllocate a section and set the map contents to the default.\n\n Collective.\n\n Typical calling sequence:\n - `create`\n - `setNumFields`\n - `setChart`\n - `setDof`\n - `setUp`\n - `getOffset`\n - `destroy`\n\n The `Section` object and methods are intended to be used in the PETSc\n Vec and Mat implementations. The indices returned by the `Section` are\n appropriate for the kind of `Vec` it is associated with. For example,\n if the vector being indexed is a local vector, we call the section a\n local section. If the section indexes a global vector, we call it a\n global section. For parallel vectors, like global vectors, we use\n negative indices to indicate DOFs owned by other processes.\n\n Parameters\n ----------\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n petsc.PetscSectionCreate\n\n \nSource code at petsc4py/PETSc/Section.pyx:46"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_9create(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 46, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "create") < 0)) __PYX_ERR(45, 46, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_comm = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, __pyx_nargs); __PYX_ERR(45, 46, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Section.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_8create(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_comm); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_8create(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PetscSection __pyx_v_newsec; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create", 1); /* "petsc4py/PETSc/Section.pyx":78 * * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscSection newsec = NULL * CHKERR( PetscSectionCreate(ccomm, &newsec) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(45, 78, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/Section.pyx":79 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscSection newsec = NULL # <<<<<<<<<<<<<< * CHKERR( PetscSectionCreate(ccomm, &newsec) ) * CHKERR( PetscCLEAR(self.obj) ); self.sec = newsec */ __pyx_v_newsec = NULL; /* "petsc4py/PETSc/Section.pyx":80 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscSection newsec = NULL * CHKERR( PetscSectionCreate(ccomm, &newsec) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.sec = newsec * return self */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionCreate(__pyx_v_ccomm, (&__pyx_v_newsec))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 80, __pyx_L1_error) /* "petsc4py/PETSc/Section.pyx":81 * cdef PetscSection newsec = NULL * CHKERR( PetscSectionCreate(ccomm, &newsec) ) * CHKERR( PetscCLEAR(self.obj) ); self.sec = newsec # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 81, __pyx_L1_error) __pyx_v_self->sec = __pyx_v_newsec; /* "petsc4py/PETSc/Section.pyx":82 * CHKERR( PetscSectionCreate(ccomm, &newsec) ) * CHKERR( PetscCLEAR(self.obj) ); self.sec = newsec * return self # <<<<<<<<<<<<<< * * def clone(self) -> Section: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Section.pyx":46 * return self * * def create(self, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Allocate a section and set the map contents to the default. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Section.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Section.pyx":84 * return self * * def clone(self) -> Section: # <<<<<<<<<<<<<< * """Return a copy of the section. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_11clone(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7Section_10clone, "Section.clone(self) -> Section\nReturn a copy of the section.\n\n Collective.\n\n The copy is shallow, if possible.\n\n See Also\n --------\n petsc.PetscSectionClone\n\n \nSource code at petsc4py/PETSc/Section.pyx:84"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_11clone(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("clone (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("clone", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "clone", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_10clone(((struct PyPetscSectionObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_10clone(struct PyPetscSectionObject *__pyx_v_self) { struct PyPetscSectionObject *__pyx_v_sec = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PetscErrorCode __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("clone", 1); /* "petsc4py/PETSc/Section.pyx":96 * * """ * cdef Section sec =
type(self)() # <<<<<<<<<<<<<< * CHKERR( PetscSectionClone(self.sec, &sec.sec) ) * return sec */ __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __pyx_t_2 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_sec = ((struct PyPetscSectionObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/Section.pyx":97 * """ * cdef Section sec =
type(self)() * CHKERR( PetscSectionClone(self.sec, &sec.sec) ) # <<<<<<<<<<<<<< * return sec * */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionClone(__pyx_v_self->sec, (&__pyx_v_sec->sec))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 97, __pyx_L1_error) /* "petsc4py/PETSc/Section.pyx":98 * cdef Section sec =
type(self)() * CHKERR( PetscSectionClone(self.sec, &sec.sec) ) * return sec # <<<<<<<<<<<<<< * * def setUp(self) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_sec); __pyx_r = ((PyObject *)__pyx_v_sec); goto __pyx_L0; /* "petsc4py/PETSc/Section.pyx":84 * return self * * def clone(self) -> Section: # <<<<<<<<<<<<<< * """Return a copy of the section. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Section.clone", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_sec); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Section.pyx":100 * return sec * * def setUp(self) -> None: # <<<<<<<<<<<<<< * """Calculate offsets. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_13setUp(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7Section_12setUp, "Section.setUp(self) -> None\nCalculate offsets.\n\n Not collective.\n\n Offsets are based on the number of degrees of freedom for each point.\n\n See Also\n --------\n petsc.PetscSectionSetUp\n\n \nSource code at petsc4py/PETSc/Section.pyx:100"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_13setUp(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setUp (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("setUp", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setUp", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_12setUp(((struct PyPetscSectionObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_12setUp(struct PyPetscSectionObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setUp", 1); /* "petsc4py/PETSc/Section.pyx":112 * * """ * CHKERR( PetscSectionSetUp(self.sec) ) # <<<<<<<<<<<<<< * * def reset(self) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionSetUp(__pyx_v_self->sec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 112, __pyx_L1_error) /* "petsc4py/PETSc/Section.pyx":100 * return sec * * def setUp(self) -> None: # <<<<<<<<<<<<<< * """Calculate offsets. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Section.setUp", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Section.pyx":114 * CHKERR( PetscSectionSetUp(self.sec) ) * * def reset(self) -> None: # <<<<<<<<<<<<<< * """Free all section data. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_15reset(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7Section_14reset, "Section.reset(self) -> None\nFree all section data.\n\n Not collective.\n\n See Also\n --------\n petsc.PetscSectionReset\n\n \nSource code at petsc4py/PETSc/Section.pyx:114"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_15reset(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("reset (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("reset", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "reset", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_14reset(((struct PyPetscSectionObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_14reset(struct PyPetscSectionObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("reset", 1); /* "petsc4py/PETSc/Section.pyx":124 * * """ * CHKERR( PetscSectionReset(self.sec) ) # <<<<<<<<<<<<<< * * def getNumFields(self) -> int: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionReset(__pyx_v_self->sec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 124, __pyx_L1_error) /* "petsc4py/PETSc/Section.pyx":114 * CHKERR( PetscSectionSetUp(self.sec) ) * * def reset(self) -> None: # <<<<<<<<<<<<<< * """Free all section data. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Section.reset", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Section.pyx":126 * CHKERR( PetscSectionReset(self.sec) ) * * def getNumFields(self) -> int: # <<<<<<<<<<<<<< * """Return the number of fields in a section. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_17getNumFields(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7Section_16getNumFields, "Section.getNumFields(self) -> int\nReturn the number of fields in a section.\n\n Not collective.\n\n Returns ``0`` if no fields were defined.\n\n See Also\n --------\n setNumFields, petsc.PetscSectionGetNumFields\n\n \nSource code at petsc4py/PETSc/Section.pyx:126"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_17getNumFields(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getNumFields (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getNumFields", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getNumFields", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_16getNumFields(((struct PyPetscSectionObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_16getNumFields(struct PyPetscSectionObject *__pyx_v_self) { PetscInt __pyx_v_numFields; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getNumFields", 1); /* "petsc4py/PETSc/Section.pyx":138 * * """ * cdef PetscInt numFields = 0 # <<<<<<<<<<<<<< * CHKERR( PetscSectionGetNumFields(self.sec, &numFields) ) * return toInt(numFields) */ __pyx_v_numFields = 0; /* "petsc4py/PETSc/Section.pyx":139 * """ * cdef PetscInt numFields = 0 * CHKERR( PetscSectionGetNumFields(self.sec, &numFields) ) # <<<<<<<<<<<<<< * return toInt(numFields) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionGetNumFields(__pyx_v_self->sec, (&__pyx_v_numFields))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 139, __pyx_L1_error) /* "petsc4py/PETSc/Section.pyx":140 * cdef PetscInt numFields = 0 * CHKERR( PetscSectionGetNumFields(self.sec, &numFields) ) * return toInt(numFields) # <<<<<<<<<<<<<< * * def setNumFields(self, numFields: int) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_numFields); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Section.pyx":126 * CHKERR( PetscSectionReset(self.sec) ) * * def getNumFields(self) -> int: # <<<<<<<<<<<<<< * """Return the number of fields in a section. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Section.getNumFields", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Section.pyx":142 * return toInt(numFields) * * def setNumFields(self, numFields: int) -> None: # <<<<<<<<<<<<<< * """Set the number of fields in a section. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_19setNumFields(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7Section_18setNumFields, "Section.setNumFields(self, numFields: int) -> None\nSet the number of fields in a section.\n\n Not collective.\n\n Parameters\n ----------\n numFields\n The number of fields.\n\n See Also\n --------\n getNumFields, petsc.PetscSectionSetNumFields\n\n \nSource code at petsc4py/PETSc/Section.pyx:142"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_19setNumFields(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_numFields = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setNumFields (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_numFields,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_numFields)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 142, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setNumFields") < 0)) __PYX_ERR(45, 142, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_numFields = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setNumFields", 1, 1, 1, __pyx_nargs); __PYX_ERR(45, 142, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Section.setNumFields", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_18setNumFields(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_numFields); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_18setNumFields(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_numFields) { PetscInt __pyx_v_cnumFields; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setNumFields", 1); /* "petsc4py/PETSc/Section.pyx":157 * * """ * cdef PetscInt cnumFields = asInt(numFields) # <<<<<<<<<<<<<< * CHKERR( PetscSectionSetNumFields(self.sec, cnumFields) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_numFields); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 157, __pyx_L1_error) __pyx_v_cnumFields = __pyx_t_1; /* "petsc4py/PETSc/Section.pyx":158 * """ * cdef PetscInt cnumFields = asInt(numFields) * CHKERR( PetscSectionSetNumFields(self.sec, cnumFields) ) # <<<<<<<<<<<<<< * * def getFieldName(self, field: int) -> str: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionSetNumFields(__pyx_v_self->sec, __pyx_v_cnumFields)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 158, __pyx_L1_error) /* "petsc4py/PETSc/Section.pyx":142 * return toInt(numFields) * * def setNumFields(self, numFields: int) -> None: # <<<<<<<<<<<<<< * """Set the number of fields in a section. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Section.setNumFields", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Section.pyx":160 * CHKERR( PetscSectionSetNumFields(self.sec, cnumFields) ) * * def getFieldName(self, field: int) -> str: # <<<<<<<<<<<<<< * """Return the name of a field in the section. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_21getFieldName(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7Section_20getFieldName, "Section.getFieldName(self, field: int) -> str\nReturn the name of a field in the section.\n\n Not collective.\n\n Parameters\n ----------\n field\n The field number.\n\n See Also\n --------\n setFieldName, petsc.PetscSectionGetFieldName\n\n \nSource code at petsc4py/PETSc/Section.pyx:160"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_21getFieldName(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_field = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getFieldName (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_field,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_field)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 160, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getFieldName") < 0)) __PYX_ERR(45, 160, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_field = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getFieldName", 1, 1, 1, __pyx_nargs); __PYX_ERR(45, 160, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Section.getFieldName", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_20getFieldName(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_field); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_20getFieldName(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_field) { PetscInt __pyx_v_cfield; char const *__pyx_v_fieldName; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getFieldName", 1); /* "petsc4py/PETSc/Section.pyx":175 * * """ * cdef PetscInt cfield = asInt(field) # <<<<<<<<<<<<<< * cdef const char *fieldName = NULL * CHKERR( PetscSectionGetFieldName(self.sec,cfield,&fieldName) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_field); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 175, __pyx_L1_error) __pyx_v_cfield = __pyx_t_1; /* "petsc4py/PETSc/Section.pyx":176 * """ * cdef PetscInt cfield = asInt(field) * cdef const char *fieldName = NULL # <<<<<<<<<<<<<< * CHKERR( PetscSectionGetFieldName(self.sec,cfield,&fieldName) ) * return bytes2str(fieldName) */ __pyx_v_fieldName = NULL; /* "petsc4py/PETSc/Section.pyx":177 * cdef PetscInt cfield = asInt(field) * cdef const char *fieldName = NULL * CHKERR( PetscSectionGetFieldName(self.sec,cfield,&fieldName) ) # <<<<<<<<<<<<<< * return bytes2str(fieldName) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionGetFieldName(__pyx_v_self->sec, __pyx_v_cfield, (&__pyx_v_fieldName))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 177, __pyx_L1_error) /* "petsc4py/PETSc/Section.pyx":178 * cdef const char *fieldName = NULL * CHKERR( PetscSectionGetFieldName(self.sec,cfield,&fieldName) ) * return bytes2str(fieldName) # <<<<<<<<<<<<<< * * def setFieldName(self, field: int, fieldName: str) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_fieldName); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Section.pyx":160 * CHKERR( PetscSectionSetNumFields(self.sec, cnumFields) ) * * def getFieldName(self, field: int) -> str: # <<<<<<<<<<<<<< * """Return the name of a field in the section. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Section.getFieldName", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Section.pyx":180 * return bytes2str(fieldName) * * def setFieldName(self, field: int, fieldName: str) -> None: # <<<<<<<<<<<<<< * """Set the name of a field in the section. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_23setFieldName(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7Section_22setFieldName, "Section.setFieldName(self, field: int, fieldName: str) -> None\nSet the name of a field in the section.\n\n Not collective.\n\n Parameters\n ----------\n field\n The field number.\n fieldName\n The field name.\n\n See Also\n --------\n getFieldName, petsc.PetscSectionSetFieldName\n\n \nSource code at petsc4py/PETSc/Section.pyx:180"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_23setFieldName(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_field = 0; PyObject *__pyx_v_fieldName = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFieldName (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_field,&__pyx_n_s_fieldName,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_field)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 180, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fieldName)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 180, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setFieldName", 1, 2, 2, 1); __PYX_ERR(45, 180, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setFieldName") < 0)) __PYX_ERR(45, 180, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_field = values[0]; __pyx_v_fieldName = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setFieldName", 1, 2, 2, __pyx_nargs); __PYX_ERR(45, 180, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Section.setFieldName", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_22setFieldName(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_field, __pyx_v_fieldName); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_22setFieldName(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_fieldName) { PetscInt __pyx_v_cfield; char const *__pyx_v_cname; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFieldName", 0); __Pyx_INCREF(__pyx_v_fieldName); /* "petsc4py/PETSc/Section.pyx":197 * * """ * cdef PetscInt cfield = asInt(field) # <<<<<<<<<<<<<< * cdef const char *cname = NULL * fieldName = str2bytes(fieldName, &cname) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_field); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 197, __pyx_L1_error) __pyx_v_cfield = __pyx_t_1; /* "petsc4py/PETSc/Section.pyx":198 * """ * cdef PetscInt cfield = asInt(field) * cdef const char *cname = NULL # <<<<<<<<<<<<<< * fieldName = str2bytes(fieldName, &cname) * CHKERR( PetscSectionSetFieldName(self.sec,cfield,cname) ) */ __pyx_v_cname = NULL; /* "petsc4py/PETSc/Section.pyx":199 * cdef PetscInt cfield = asInt(field) * cdef const char *cname = NULL * fieldName = str2bytes(fieldName, &cname) # <<<<<<<<<<<<<< * CHKERR( PetscSectionSetFieldName(self.sec,cfield,cname) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_fieldName, (&__pyx_v_cname)); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_fieldName, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/Section.pyx":200 * cdef const char *cname = NULL * fieldName = str2bytes(fieldName, &cname) * CHKERR( PetscSectionSetFieldName(self.sec,cfield,cname) ) # <<<<<<<<<<<<<< * * def getFieldComponents(self, field: int) -> int: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionSetFieldName(__pyx_v_self->sec, __pyx_v_cfield, __pyx_v_cname)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 200, __pyx_L1_error) /* "petsc4py/PETSc/Section.pyx":180 * return bytes2str(fieldName) * * def setFieldName(self, field: int, fieldName: str) -> None: # <<<<<<<<<<<<<< * """Set the name of a field in the section. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Section.setFieldName", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_fieldName); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Section.pyx":202 * CHKERR( PetscSectionSetFieldName(self.sec,cfield,cname) ) * * def getFieldComponents(self, field: int) -> int: # <<<<<<<<<<<<<< * """Return the number of field components for the given field. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_25getFieldComponents(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7Section_24getFieldComponents, "Section.getFieldComponents(self, field: int) -> int\nReturn the number of field components for the given field.\n\n Not collective.\n\n Parameters\n ----------\n field\n The field number.\n\n See Also\n --------\n setFieldComponents, petsc.PetscSectionGetFieldComponents\n\n \nSource code at petsc4py/PETSc/Section.pyx:202"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_25getFieldComponents(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_field = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getFieldComponents (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_field,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_field)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 202, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getFieldComponents") < 0)) __PYX_ERR(45, 202, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_field = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getFieldComponents", 1, 1, 1, __pyx_nargs); __PYX_ERR(45, 202, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Section.getFieldComponents", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_24getFieldComponents(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_field); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_24getFieldComponents(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_field) { PetscInt __pyx_v_cfield; PetscInt __pyx_v_cnumComp; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getFieldComponents", 1); /* "petsc4py/PETSc/Section.pyx":217 * * """ * cdef PetscInt cfield = asInt(field), cnumComp = 0 # <<<<<<<<<<<<<< * CHKERR( PetscSectionGetFieldComponents(self.sec,cfield,&cnumComp) ) * return toInt(cnumComp) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_field); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 217, __pyx_L1_error) __pyx_v_cfield = __pyx_t_1; __pyx_v_cnumComp = 0; /* "petsc4py/PETSc/Section.pyx":218 * """ * cdef PetscInt cfield = asInt(field), cnumComp = 0 * CHKERR( PetscSectionGetFieldComponents(self.sec,cfield,&cnumComp) ) # <<<<<<<<<<<<<< * return toInt(cnumComp) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionGetFieldComponents(__pyx_v_self->sec, __pyx_v_cfield, (&__pyx_v_cnumComp))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 218, __pyx_L1_error) /* "petsc4py/PETSc/Section.pyx":219 * cdef PetscInt cfield = asInt(field), cnumComp = 0 * CHKERR( PetscSectionGetFieldComponents(self.sec,cfield,&cnumComp) ) * return toInt(cnumComp) # <<<<<<<<<<<<<< * * def setFieldComponents(self, field: int, numComp: int) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_cnumComp); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Section.pyx":202 * CHKERR( PetscSectionSetFieldName(self.sec,cfield,cname) ) * * def getFieldComponents(self, field: int) -> int: # <<<<<<<<<<<<<< * """Return the number of field components for the given field. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Section.getFieldComponents", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Section.pyx":221 * return toInt(cnumComp) * * def setFieldComponents(self, field: int, numComp: int) -> None: # <<<<<<<<<<<<<< * """Set the number of field components for the given field. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_27setFieldComponents(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7Section_26setFieldComponents, "Section.setFieldComponents(self, field: int, numComp: int) -> None\nSet the number of field components for the given field.\n\n Not collective.\n\n Parameters\n ----------\n field\n The field number.\n numComp\n The number of field components.\n\n See Also\n --------\n getFieldComponents, petsc.PetscSectionSetFieldComponents\n\n \nSource code at petsc4py/PETSc/Section.pyx:221"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_27setFieldComponents(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_field = 0; PyObject *__pyx_v_numComp = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFieldComponents (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_field,&__pyx_n_s_numComp,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_field)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 221, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_numComp)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 221, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setFieldComponents", 1, 2, 2, 1); __PYX_ERR(45, 221, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setFieldComponents") < 0)) __PYX_ERR(45, 221, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_field = values[0]; __pyx_v_numComp = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setFieldComponents", 1, 2, 2, __pyx_nargs); __PYX_ERR(45, 221, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Section.setFieldComponents", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_26setFieldComponents(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_field, __pyx_v_numComp); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_26setFieldComponents(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_numComp) { PetscInt __pyx_v_cfield; PetscInt __pyx_v_cnumComp; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFieldComponents", 1); /* "petsc4py/PETSc/Section.pyx":238 * * """ * cdef PetscInt cfield = asInt(field) # <<<<<<<<<<<<<< * cdef PetscInt cnumComp = asInt(numComp) * CHKERR( PetscSectionSetFieldComponents(self.sec,cfield,cnumComp) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_field); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 238, __pyx_L1_error) __pyx_v_cfield = __pyx_t_1; /* "petsc4py/PETSc/Section.pyx":239 * """ * cdef PetscInt cfield = asInt(field) * cdef PetscInt cnumComp = asInt(numComp) # <<<<<<<<<<<<<< * CHKERR( PetscSectionSetFieldComponents(self.sec,cfield,cnumComp) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_numComp); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 239, __pyx_L1_error) __pyx_v_cnumComp = __pyx_t_1; /* "petsc4py/PETSc/Section.pyx":240 * cdef PetscInt cfield = asInt(field) * cdef PetscInt cnumComp = asInt(numComp) * CHKERR( PetscSectionSetFieldComponents(self.sec,cfield,cnumComp) ) # <<<<<<<<<<<<<< * * def getChart(self) -> tuple[int, int]: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionSetFieldComponents(__pyx_v_self->sec, __pyx_v_cfield, __pyx_v_cnumComp)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 240, __pyx_L1_error) /* "petsc4py/PETSc/Section.pyx":221 * return toInt(cnumComp) * * def setFieldComponents(self, field: int, numComp: int) -> None: # <<<<<<<<<<<<<< * """Set the number of field components for the given field. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Section.setFieldComponents", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Section.pyx":242 * CHKERR( PetscSectionSetFieldComponents(self.sec,cfield,cnumComp) ) * * def getChart(self) -> tuple[int, int]: # <<<<<<<<<<<<<< * """Return the range in which points (indices) lie for this section. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_29getChart(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7Section_28getChart, "Section.getChart(self) -> tuple[int, int]\nReturn the range in which points (indices) lie for this section.\n\n Not collective.\n\n The range is [pStart, pEnd), i.e., from the first point to one past the\n last point.\n\n See Also\n --------\n petsc.PetscSectionGetChart\n\n \nSource code at petsc4py/PETSc/Section.pyx:242"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_29getChart(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getChart (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getChart", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getChart", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_28getChart(((struct PyPetscSectionObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_28getChart(struct PyPetscSectionObject *__pyx_v_self) { PetscInt __pyx_v_pStart; PetscInt __pyx_v_pEnd; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getChart", 1); /* "petsc4py/PETSc/Section.pyx":255 * * """ * cdef PetscInt pStart = 0, pEnd = 0 # <<<<<<<<<<<<<< * CHKERR( PetscSectionGetChart(self.sec, &pStart, &pEnd) ) * return toInt(pStart), toInt(pEnd) */ __pyx_v_pStart = 0; __pyx_v_pEnd = 0; /* "petsc4py/PETSc/Section.pyx":256 * """ * cdef PetscInt pStart = 0, pEnd = 0 * CHKERR( PetscSectionGetChart(self.sec, &pStart, &pEnd) ) # <<<<<<<<<<<<<< * return toInt(pStart), toInt(pEnd) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionGetChart(__pyx_v_self->sec, (&__pyx_v_pStart), (&__pyx_v_pEnd))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 256, __pyx_L1_error) /* "petsc4py/PETSc/Section.pyx":257 * cdef PetscInt pStart = 0, pEnd = 0 * CHKERR( PetscSectionGetChart(self.sec, &pStart, &pEnd) ) * return toInt(pStart), toInt(pEnd) # <<<<<<<<<<<<<< * * def setChart(self, pStart: int, pEnd: int) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_pStart); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_pEnd); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(45, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(45, 257, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(45, 257, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Section.pyx":242 * CHKERR( PetscSectionSetFieldComponents(self.sec,cfield,cnumComp) ) * * def getChart(self) -> tuple[int, int]: # <<<<<<<<<<<<<< * """Return the range in which points (indices) lie for this section. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.Section.getChart", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Section.pyx":259 * return toInt(pStart), toInt(pEnd) * * def setChart(self, pStart: int, pEnd: int) -> None: # <<<<<<<<<<<<<< * """Set the range in which points (indices) lie for this section. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_31setChart(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7Section_30setChart, "Section.setChart(self, pStart: int, pEnd: int) -> None\nSet the range in which points (indices) lie for this section.\n\n Not collective.\n\n The range is [pStart, pEnd), i.e., from the first point to one past the\n last point.\n\n Parameters\n ----------\n pStart\n The first point.\n pEnd\n One past the last point.\n\n See Also\n --------\n petsc.PetscSectionSetChart\n\n \nSource code at petsc4py/PETSc/Section.pyx:259"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_31setChart(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_pStart = 0; PyObject *__pyx_v_pEnd = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setChart (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pStart,&__pyx_n_s_pEnd,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pStart)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 259, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pEnd)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 259, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setChart", 1, 2, 2, 1); __PYX_ERR(45, 259, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setChart") < 0)) __PYX_ERR(45, 259, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_pStart = values[0]; __pyx_v_pEnd = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setChart", 1, 2, 2, __pyx_nargs); __PYX_ERR(45, 259, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Section.setChart", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_30setChart(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_pStart, __pyx_v_pEnd); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_30setChart(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_pStart, PyObject *__pyx_v_pEnd) { PetscInt __pyx_v_cStart; PetscInt __pyx_v_cEnd; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setChart", 1); /* "petsc4py/PETSc/Section.pyx":279 * * """ * cdef PetscInt cStart = asInt(pStart) # <<<<<<<<<<<<<< * cdef PetscInt cEnd = asInt(pEnd) * CHKERR( PetscSectionSetChart(self.sec, cStart, cEnd) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_pStart); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 279, __pyx_L1_error) __pyx_v_cStart = __pyx_t_1; /* "petsc4py/PETSc/Section.pyx":280 * """ * cdef PetscInt cStart = asInt(pStart) * cdef PetscInt cEnd = asInt(pEnd) # <<<<<<<<<<<<<< * CHKERR( PetscSectionSetChart(self.sec, cStart, cEnd) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_pEnd); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 280, __pyx_L1_error) __pyx_v_cEnd = __pyx_t_1; /* "petsc4py/PETSc/Section.pyx":281 * cdef PetscInt cStart = asInt(pStart) * cdef PetscInt cEnd = asInt(pEnd) * CHKERR( PetscSectionSetChart(self.sec, cStart, cEnd) ) # <<<<<<<<<<<<<< * * def getPermutation(self) -> IS: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionSetChart(__pyx_v_self->sec, __pyx_v_cStart, __pyx_v_cEnd)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 281, __pyx_L1_error) /* "petsc4py/PETSc/Section.pyx":259 * return toInt(pStart), toInt(pEnd) * * def setChart(self, pStart: int, pEnd: int) -> None: # <<<<<<<<<<<<<< * """Set the range in which points (indices) lie for this section. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Section.setChart", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Section.pyx":283 * CHKERR( PetscSectionSetChart(self.sec, cStart, cEnd) ) * * def getPermutation(self) -> IS: # <<<<<<<<<<<<<< * """Return the permutation that was set with `setPermutation`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_33getPermutation(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7Section_32getPermutation, "Section.getPermutation(self) -> IS\nReturn the permutation that was set with `setPermutation`.\n\n Not collective.\n\n See Also\n --------\n setPermutation, petsc.PetscSectionGetPermutation\n\n \nSource code at petsc4py/PETSc/Section.pyx:283"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_33getPermutation(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getPermutation (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getPermutation", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getPermutation", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_32getPermutation(((struct PyPetscSectionObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_32getPermutation(struct PyPetscSectionObject *__pyx_v_self) { struct PyPetscISObject *__pyx_v_perm = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getPermutation", 1); /* "petsc4py/PETSc/Section.pyx":293 * * """ * cdef IS perm = IS() # <<<<<<<<<<<<<< * CHKERR( PetscSectionGetPermutation(self.sec, &perm.iset)) * CHKERR( PetscINCREF(perm.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_perm = ((struct PyPetscISObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Section.pyx":294 * """ * cdef IS perm = IS() * CHKERR( PetscSectionGetPermutation(self.sec, &perm.iset)) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(perm.obj) ) * return perm */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionGetPermutation(__pyx_v_self->sec, (&__pyx_v_perm->iset))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 294, __pyx_L1_error) /* "petsc4py/PETSc/Section.pyx":295 * cdef IS perm = IS() * CHKERR( PetscSectionGetPermutation(self.sec, &perm.iset)) * CHKERR( PetscINCREF(perm.obj) ) # <<<<<<<<<<<<<< * return perm * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_perm->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 295, __pyx_L1_error) /* "petsc4py/PETSc/Section.pyx":296 * CHKERR( PetscSectionGetPermutation(self.sec, &perm.iset)) * CHKERR( PetscINCREF(perm.obj) ) * return perm # <<<<<<<<<<<<<< * * def setPermutation(self, IS perm) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_perm); __pyx_r = ((PyObject *)__pyx_v_perm); goto __pyx_L0; /* "petsc4py/PETSc/Section.pyx":283 * CHKERR( PetscSectionSetChart(self.sec, cStart, cEnd) ) * * def getPermutation(self) -> IS: # <<<<<<<<<<<<<< * """Return the permutation that was set with `setPermutation`. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Section.getPermutation", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_perm); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Section.pyx":298 * return perm * * def setPermutation(self, IS perm) -> None: # <<<<<<<<<<<<<< * """Set the permutation for [0, pEnd - pStart). * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_35setPermutation(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7Section_34setPermutation, "Section.setPermutation(self, perm: IS) -> None\nSet the permutation for [0, pEnd - pStart).\n\n Not collective.\n\n Parameters\n ----------\n perm\n The permutation of points.\n\n See Also\n --------\n getPermutation, petsc.PetscSectionSetPermutation\n\n \nSource code at petsc4py/PETSc/Section.pyx:298"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_35setPermutation(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscISObject *__pyx_v_perm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPermutation (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_perm,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_perm)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 298, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setPermutation") < 0)) __PYX_ERR(45, 298, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_perm = ((struct PyPetscISObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPermutation", 1, 1, 1, __pyx_nargs); __PYX_ERR(45, 298, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Section.setPermutation", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_perm), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "perm", 0))) __PYX_ERR(45, 298, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_34setPermutation(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_perm); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_34setPermutation(struct PyPetscSectionObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_perm) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPermutation", 1); /* "petsc4py/PETSc/Section.pyx":313 * * """ * CHKERR( PetscSectionSetPermutation(self.sec, perm.iset)) # <<<<<<<<<<<<<< * * def getDof(self, point: int) -> int: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionSetPermutation(__pyx_v_self->sec, __pyx_v_perm->iset)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 313, __pyx_L1_error) /* "petsc4py/PETSc/Section.pyx":298 * return perm * * def setPermutation(self, IS perm) -> None: # <<<<<<<<<<<<<< * """Set the permutation for [0, pEnd - pStart). * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Section.setPermutation", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Section.pyx":315 * CHKERR( PetscSectionSetPermutation(self.sec, perm.iset)) * * def getDof(self, point: int) -> int: # <<<<<<<<<<<<<< * """Return the number of degrees of freedom for a given point. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_37getDof(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7Section_36getDof, "Section.getDof(self, point: int) -> int\nReturn the number of degrees of freedom for a given point.\n\n Not collective.\n\n In a global section, this value will be negative for points not owned\n by this process.\n\n Parameters\n ----------\n point\n The point.\n\n See Also\n --------\n setDof, addDof, petsc.PetscSectionGetDof\n\n \nSource code at petsc4py/PETSc/Section.pyx:315"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_37getDof(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_point = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getDof (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_point)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 315, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getDof") < 0)) __PYX_ERR(45, 315, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_point = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getDof", 1, 1, 1, __pyx_nargs); __PYX_ERR(45, 315, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Section.getDof", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_36getDof(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_36getDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point) { PetscInt __pyx_v_cpoint; PetscInt __pyx_v_cnumDof; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getDof", 1); /* "petsc4py/PETSc/Section.pyx":333 * * """ * cdef PetscInt cpoint = asInt(point), cnumDof = 0 # <<<<<<<<<<<<<< * CHKERR( PetscSectionGetDof(self.sec,cpoint,&cnumDof) ) * return toInt(cnumDof) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_point); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 333, __pyx_L1_error) __pyx_v_cpoint = __pyx_t_1; __pyx_v_cnumDof = 0; /* "petsc4py/PETSc/Section.pyx":334 * """ * cdef PetscInt cpoint = asInt(point), cnumDof = 0 * CHKERR( PetscSectionGetDof(self.sec,cpoint,&cnumDof) ) # <<<<<<<<<<<<<< * return toInt(cnumDof) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionGetDof(__pyx_v_self->sec, __pyx_v_cpoint, (&__pyx_v_cnumDof))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 334, __pyx_L1_error) /* "petsc4py/PETSc/Section.pyx":335 * cdef PetscInt cpoint = asInt(point), cnumDof = 0 * CHKERR( PetscSectionGetDof(self.sec,cpoint,&cnumDof) ) * return toInt(cnumDof) # <<<<<<<<<<<<<< * * def setDof(self, point: int, numDof: int) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_cnumDof); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Section.pyx":315 * CHKERR( PetscSectionSetPermutation(self.sec, perm.iset)) * * def getDof(self, point: int) -> int: # <<<<<<<<<<<<<< * """Return the number of degrees of freedom for a given point. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Section.getDof", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Section.pyx":337 * return toInt(cnumDof) * * def setDof(self, point: int, numDof: int) -> None: # <<<<<<<<<<<<<< * """Set the number of degrees of freedom associated with a given point. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_39setDof(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7Section_38setDof, "Section.setDof(self, point: int, numDof: int) -> None\nSet the number of degrees of freedom associated with a given point.\n\n Not collective.\n\n Parameters\n ----------\n point\n The point.\n numDof\n The number of DOFs.\n\n See Also\n --------\n getDof, addDof, petsc.PetscSectionSetDof\n\n \nSource code at petsc4py/PETSc/Section.pyx:337"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_39setDof(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_point = 0; PyObject *__pyx_v_numDof = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setDof (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,&__pyx_n_s_numDof,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_point)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 337, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_numDof)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 337, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setDof", 1, 2, 2, 1); __PYX_ERR(45, 337, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setDof") < 0)) __PYX_ERR(45, 337, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_point = values[0]; __pyx_v_numDof = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setDof", 1, 2, 2, __pyx_nargs); __PYX_ERR(45, 337, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Section.setDof", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_38setDof(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point, __pyx_v_numDof); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_38setDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_numDof) { PetscInt __pyx_v_cpoint; PetscInt __pyx_v_cnumDof; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setDof", 1); /* "petsc4py/PETSc/Section.pyx":354 * * """ * cdef PetscInt cpoint = asInt(point) # <<<<<<<<<<<<<< * cdef PetscInt cnumDof = asInt(numDof) * CHKERR( PetscSectionSetDof(self.sec,cpoint,cnumDof) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_point); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 354, __pyx_L1_error) __pyx_v_cpoint = __pyx_t_1; /* "petsc4py/PETSc/Section.pyx":355 * """ * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cnumDof = asInt(numDof) # <<<<<<<<<<<<<< * CHKERR( PetscSectionSetDof(self.sec,cpoint,cnumDof) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_numDof); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 355, __pyx_L1_error) __pyx_v_cnumDof = __pyx_t_1; /* "petsc4py/PETSc/Section.pyx":356 * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cnumDof = asInt(numDof) * CHKERR( PetscSectionSetDof(self.sec,cpoint,cnumDof) ) # <<<<<<<<<<<<<< * * def addDof(self, point: int, numDof: int) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionSetDof(__pyx_v_self->sec, __pyx_v_cpoint, __pyx_v_cnumDof)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 356, __pyx_L1_error) /* "petsc4py/PETSc/Section.pyx":337 * return toInt(cnumDof) * * def setDof(self, point: int, numDof: int) -> None: # <<<<<<<<<<<<<< * """Set the number of degrees of freedom associated with a given point. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Section.setDof", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Section.pyx":358 * CHKERR( PetscSectionSetDof(self.sec,cpoint,cnumDof) ) * * def addDof(self, point: int, numDof: int) -> None: # <<<<<<<<<<<<<< * """Add ``numDof`` degrees of freedom associated with a given point. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_41addDof(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7Section_40addDof, "Section.addDof(self, point: int, numDof: int) -> None\nAdd ``numDof`` degrees of freedom associated with a given point.\n\n Not collective.\n\n Parameters\n ----------\n point\n The point.\n numDof\n The number of additional DOFs.\n\n See Also\n --------\n setDof, getDof, petsc.PetscSectionAddDof\n\n \nSource code at petsc4py/PETSc/Section.pyx:358"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_41addDof(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_point = 0; PyObject *__pyx_v_numDof = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("addDof (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,&__pyx_n_s_numDof,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_point)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 358, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_numDof)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 358, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("addDof", 1, 2, 2, 1); __PYX_ERR(45, 358, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "addDof") < 0)) __PYX_ERR(45, 358, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_point = values[0]; __pyx_v_numDof = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("addDof", 1, 2, 2, __pyx_nargs); __PYX_ERR(45, 358, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Section.addDof", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_40addDof(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point, __pyx_v_numDof); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_40addDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_numDof) { PetscInt __pyx_v_cpoint; PetscInt __pyx_v_cnumDof; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("addDof", 1); /* "petsc4py/PETSc/Section.pyx":375 * * """ * cdef PetscInt cpoint = asInt(point) # <<<<<<<<<<<<<< * cdef PetscInt cnumDof = asInt(numDof) * CHKERR( PetscSectionAddDof(self.sec,cpoint,cnumDof) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_point); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 375, __pyx_L1_error) __pyx_v_cpoint = __pyx_t_1; /* "petsc4py/PETSc/Section.pyx":376 * """ * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cnumDof = asInt(numDof) # <<<<<<<<<<<<<< * CHKERR( PetscSectionAddDof(self.sec,cpoint,cnumDof) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_numDof); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 376, __pyx_L1_error) __pyx_v_cnumDof = __pyx_t_1; /* "petsc4py/PETSc/Section.pyx":377 * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cnumDof = asInt(numDof) * CHKERR( PetscSectionAddDof(self.sec,cpoint,cnumDof) ) # <<<<<<<<<<<<<< * * def getFieldDof(self, point: int, field: int) -> int: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionAddDof(__pyx_v_self->sec, __pyx_v_cpoint, __pyx_v_cnumDof)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 377, __pyx_L1_error) /* "petsc4py/PETSc/Section.pyx":358 * CHKERR( PetscSectionSetDof(self.sec,cpoint,cnumDof) ) * * def addDof(self, point: int, numDof: int) -> None: # <<<<<<<<<<<<<< * """Add ``numDof`` degrees of freedom associated with a given point. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Section.addDof", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Section.pyx":379 * CHKERR( PetscSectionAddDof(self.sec,cpoint,cnumDof) ) * * def getFieldDof(self, point: int, field: int) -> int: # <<<<<<<<<<<<<< * """Return the number of DOFs associated with a field on a given point. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_43getFieldDof(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7Section_42getFieldDof, "Section.getFieldDof(self, point: int, field: int) -> int\nReturn the number of DOFs associated with a field on a given point.\n\n Not collective.\n\n Parameters\n ----------\n point\n The point.\n field\n The field.\n\n See Also\n --------\n setFieldDof, petsc.PetscSectionGetFieldDof\n\n \nSource code at petsc4py/PETSc/Section.pyx:379"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_43getFieldDof(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_point = 0; PyObject *__pyx_v_field = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getFieldDof (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,&__pyx_n_s_field,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_point)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 379, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_field)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 379, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("getFieldDof", 1, 2, 2, 1); __PYX_ERR(45, 379, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getFieldDof") < 0)) __PYX_ERR(45, 379, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_point = values[0]; __pyx_v_field = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getFieldDof", 1, 2, 2, __pyx_nargs); __PYX_ERR(45, 379, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Section.getFieldDof", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_42getFieldDof(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point, __pyx_v_field); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_42getFieldDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field) { PetscInt __pyx_v_cpoint; PetscInt __pyx_v_cnumDof; PetscInt __pyx_v_cfield; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getFieldDof", 1); /* "petsc4py/PETSc/Section.pyx":396 * * """ * cdef PetscInt cpoint = asInt(point), cnumDof = 0 # <<<<<<<<<<<<<< * cdef PetscInt cfield = asInt(field) * CHKERR( PetscSectionGetFieldDof(self.sec,cpoint,cfield,&cnumDof) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_point); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 396, __pyx_L1_error) __pyx_v_cpoint = __pyx_t_1; __pyx_v_cnumDof = 0; /* "petsc4py/PETSc/Section.pyx":397 * """ * cdef PetscInt cpoint = asInt(point), cnumDof = 0 * cdef PetscInt cfield = asInt(field) # <<<<<<<<<<<<<< * CHKERR( PetscSectionGetFieldDof(self.sec,cpoint,cfield,&cnumDof) ) * return toInt(cnumDof) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_field); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 397, __pyx_L1_error) __pyx_v_cfield = __pyx_t_1; /* "petsc4py/PETSc/Section.pyx":398 * cdef PetscInt cpoint = asInt(point), cnumDof = 0 * cdef PetscInt cfield = asInt(field) * CHKERR( PetscSectionGetFieldDof(self.sec,cpoint,cfield,&cnumDof) ) # <<<<<<<<<<<<<< * return toInt(cnumDof) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionGetFieldDof(__pyx_v_self->sec, __pyx_v_cpoint, __pyx_v_cfield, (&__pyx_v_cnumDof))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 398, __pyx_L1_error) /* "petsc4py/PETSc/Section.pyx":399 * cdef PetscInt cfield = asInt(field) * CHKERR( PetscSectionGetFieldDof(self.sec,cpoint,cfield,&cnumDof) ) * return toInt(cnumDof) # <<<<<<<<<<<<<< * * def setFieldDof(self, point: int, field: int, numDof: int) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_cnumDof); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Section.pyx":379 * CHKERR( PetscSectionAddDof(self.sec,cpoint,cnumDof) ) * * def getFieldDof(self, point: int, field: int) -> int: # <<<<<<<<<<<<<< * """Return the number of DOFs associated with a field on a given point. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Section.getFieldDof", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Section.pyx":401 * return toInt(cnumDof) * * def setFieldDof(self, point: int, field: int, numDof: int) -> None: # <<<<<<<<<<<<<< * """Set the number of DOFs associated with a field on a given point. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_45setFieldDof(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7Section_44setFieldDof, "Section.setFieldDof(self, point: int, field: int, numDof: int) -> None\nSet the number of DOFs associated with a field on a given point.\n\n Not collective.\n\n Parameters\n ----------\n point\n The point.\n field\n The field.\n numDof\n The number of DOFs.\n\n See Also\n --------\n getFieldDof, addFieldDof, petsc.PetscSectionSetFieldDof\n\n \nSource code at petsc4py/PETSc/Section.pyx:401"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_45setFieldDof(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_point = 0; PyObject *__pyx_v_field = 0; PyObject *__pyx_v_numDof = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFieldDof (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,&__pyx_n_s_field,&__pyx_n_s_numDof,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_point)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 401, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_field)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 401, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setFieldDof", 1, 3, 3, 1); __PYX_ERR(45, 401, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_numDof)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 401, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setFieldDof", 1, 3, 3, 2); __PYX_ERR(45, 401, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setFieldDof") < 0)) __PYX_ERR(45, 401, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_point = values[0]; __pyx_v_field = values[1]; __pyx_v_numDof = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setFieldDof", 1, 3, 3, __pyx_nargs); __PYX_ERR(45, 401, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Section.setFieldDof", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_44setFieldDof(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point, __pyx_v_field, __pyx_v_numDof); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_44setFieldDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field, PyObject *__pyx_v_numDof) { PetscInt __pyx_v_cpoint; PetscInt __pyx_v_cfield; PetscInt __pyx_v_cnumDof; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFieldDof", 1); /* "petsc4py/PETSc/Section.pyx":420 * * """ * cdef PetscInt cpoint = asInt(point) # <<<<<<<<<<<<<< * cdef PetscInt cfield = asInt(field) * cdef PetscInt cnumDof = asInt(numDof) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_point); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 420, __pyx_L1_error) __pyx_v_cpoint = __pyx_t_1; /* "petsc4py/PETSc/Section.pyx":421 * """ * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cfield = asInt(field) # <<<<<<<<<<<<<< * cdef PetscInt cnumDof = asInt(numDof) * CHKERR( PetscSectionSetFieldDof(self.sec,cpoint,cfield,cnumDof) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_field); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 421, __pyx_L1_error) __pyx_v_cfield = __pyx_t_1; /* "petsc4py/PETSc/Section.pyx":422 * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cfield = asInt(field) * cdef PetscInt cnumDof = asInt(numDof) # <<<<<<<<<<<<<< * CHKERR( PetscSectionSetFieldDof(self.sec,cpoint,cfield,cnumDof) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_numDof); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 422, __pyx_L1_error) __pyx_v_cnumDof = __pyx_t_1; /* "petsc4py/PETSc/Section.pyx":423 * cdef PetscInt cfield = asInt(field) * cdef PetscInt cnumDof = asInt(numDof) * CHKERR( PetscSectionSetFieldDof(self.sec,cpoint,cfield,cnumDof) ) # <<<<<<<<<<<<<< * * def addFieldDof(self, point: int, field: int, numDof: int) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionSetFieldDof(__pyx_v_self->sec, __pyx_v_cpoint, __pyx_v_cfield, __pyx_v_cnumDof)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 423, __pyx_L1_error) /* "petsc4py/PETSc/Section.pyx":401 * return toInt(cnumDof) * * def setFieldDof(self, point: int, field: int, numDof: int) -> None: # <<<<<<<<<<<<<< * """Set the number of DOFs associated with a field on a given point. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Section.setFieldDof", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Section.pyx":425 * CHKERR( PetscSectionSetFieldDof(self.sec,cpoint,cfield,cnumDof) ) * * def addFieldDof(self, point: int, field: int, numDof: int) -> None: # <<<<<<<<<<<<<< * """Add ``numDof`` DOFs associated with a field on a given point. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_47addFieldDof(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7Section_46addFieldDof, "Section.addFieldDof(self, point: int, field: int, numDof: int) -> None\nAdd ``numDof`` DOFs associated with a field on a given point.\n\n Not collective.\n\n Parameters\n ----------\n point\n The point.\n field\n The field.\n numDof\n The number of additional DOFs.\n\n See Also\n --------\n setFieldDof, getFieldDof, petsc.PetscSectionAddFieldDof\n\n \nSource code at petsc4py/PETSc/Section.pyx:425"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_47addFieldDof(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_point = 0; PyObject *__pyx_v_field = 0; PyObject *__pyx_v_numDof = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("addFieldDof (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,&__pyx_n_s_field,&__pyx_n_s_numDof,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_point)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 425, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_field)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 425, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("addFieldDof", 1, 3, 3, 1); __PYX_ERR(45, 425, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_numDof)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 425, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("addFieldDof", 1, 3, 3, 2); __PYX_ERR(45, 425, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "addFieldDof") < 0)) __PYX_ERR(45, 425, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_point = values[0]; __pyx_v_field = values[1]; __pyx_v_numDof = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("addFieldDof", 1, 3, 3, __pyx_nargs); __PYX_ERR(45, 425, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Section.addFieldDof", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_46addFieldDof(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point, __pyx_v_field, __pyx_v_numDof); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_46addFieldDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field, PyObject *__pyx_v_numDof) { PetscInt __pyx_v_cpoint; PetscInt __pyx_v_cfield; PetscInt __pyx_v_cnumDof; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("addFieldDof", 1); /* "petsc4py/PETSc/Section.pyx":444 * * """ * cdef PetscInt cpoint = asInt(point) # <<<<<<<<<<<<<< * cdef PetscInt cfield = asInt(field) * cdef PetscInt cnumDof = asInt(numDof) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_point); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 444, __pyx_L1_error) __pyx_v_cpoint = __pyx_t_1; /* "petsc4py/PETSc/Section.pyx":445 * """ * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cfield = asInt(field) # <<<<<<<<<<<<<< * cdef PetscInt cnumDof = asInt(numDof) * CHKERR( PetscSectionAddFieldDof(self.sec,cpoint,cfield,cnumDof) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_field); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 445, __pyx_L1_error) __pyx_v_cfield = __pyx_t_1; /* "petsc4py/PETSc/Section.pyx":446 * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cfield = asInt(field) * cdef PetscInt cnumDof = asInt(numDof) # <<<<<<<<<<<<<< * CHKERR( PetscSectionAddFieldDof(self.sec,cpoint,cfield,cnumDof) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_numDof); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 446, __pyx_L1_error) __pyx_v_cnumDof = __pyx_t_1; /* "petsc4py/PETSc/Section.pyx":447 * cdef PetscInt cfield = asInt(field) * cdef PetscInt cnumDof = asInt(numDof) * CHKERR( PetscSectionAddFieldDof(self.sec,cpoint,cfield,cnumDof) ) # <<<<<<<<<<<<<< * * def getConstraintDof(self, point: int) -> int: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionAddFieldDof(__pyx_v_self->sec, __pyx_v_cpoint, __pyx_v_cfield, __pyx_v_cnumDof)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 447, __pyx_L1_error) /* "petsc4py/PETSc/Section.pyx":425 * CHKERR( PetscSectionSetFieldDof(self.sec,cpoint,cfield,cnumDof) ) * * def addFieldDof(self, point: int, field: int, numDof: int) -> None: # <<<<<<<<<<<<<< * """Add ``numDof`` DOFs associated with a field on a given point. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Section.addFieldDof", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Section.pyx":449 * CHKERR( PetscSectionAddFieldDof(self.sec,cpoint,cfield,cnumDof) ) * * def getConstraintDof(self, point: int) -> int: # <<<<<<<<<<<<<< * """Return the number of constrained DOFs associated with a given point. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_49getConstraintDof(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7Section_48getConstraintDof, "Section.getConstraintDof(self, point: int) -> int\nReturn the number of constrained DOFs associated with a given point.\n\n Not collective.\n\n Parameters\n ----------\n point\n The point.\n\n See Also\n --------\n setConstraintDof, petsc.PetscSectionGetConstraintDof\n\n \nSource code at petsc4py/PETSc/Section.pyx:449"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_49getConstraintDof(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_point = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getConstraintDof (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_point)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 449, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getConstraintDof") < 0)) __PYX_ERR(45, 449, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_point = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getConstraintDof", 1, 1, 1, __pyx_nargs); __PYX_ERR(45, 449, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Section.getConstraintDof", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_48getConstraintDof(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_48getConstraintDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point) { PetscInt __pyx_v_cpoint; PetscInt __pyx_v_cnumDof; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getConstraintDof", 1); /* "petsc4py/PETSc/Section.pyx":464 * * """ * cdef PetscInt cpoint = asInt(point), cnumDof = 0 # <<<<<<<<<<<<<< * CHKERR( PetscSectionGetConstraintDof(self.sec,cpoint,&cnumDof) ) * return toInt(cnumDof) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_point); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 464, __pyx_L1_error) __pyx_v_cpoint = __pyx_t_1; __pyx_v_cnumDof = 0; /* "petsc4py/PETSc/Section.pyx":465 * """ * cdef PetscInt cpoint = asInt(point), cnumDof = 0 * CHKERR( PetscSectionGetConstraintDof(self.sec,cpoint,&cnumDof) ) # <<<<<<<<<<<<<< * return toInt(cnumDof) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionGetConstraintDof(__pyx_v_self->sec, __pyx_v_cpoint, (&__pyx_v_cnumDof))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 465, __pyx_L1_error) /* "petsc4py/PETSc/Section.pyx":466 * cdef PetscInt cpoint = asInt(point), cnumDof = 0 * CHKERR( PetscSectionGetConstraintDof(self.sec,cpoint,&cnumDof) ) * return toInt(cnumDof) # <<<<<<<<<<<<<< * * def setConstraintDof(self, point: int, numDof: int) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_cnumDof); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Section.pyx":449 * CHKERR( PetscSectionAddFieldDof(self.sec,cpoint,cfield,cnumDof) ) * * def getConstraintDof(self, point: int) -> int: # <<<<<<<<<<<<<< * """Return the number of constrained DOFs associated with a given point. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Section.getConstraintDof", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Section.pyx":468 * return toInt(cnumDof) * * def setConstraintDof(self, point: int, numDof: int) -> None: # <<<<<<<<<<<<<< * """Set the number of constrained DOFs associated with a given point. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_51setConstraintDof(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7Section_50setConstraintDof, "Section.setConstraintDof(self, point: int, numDof: int) -> None\nSet the number of constrained DOFs associated with a given point.\n\n Not collective.\n\n Parameters\n ----------\n point\n The point.\n numDof\n The number of DOFs which are fixed by constraints.\n\n See Also\n --------\n getConstraintDof, addConstraintDof, petsc.PetscSectionSetConstraintDof\n\n \nSource code at petsc4py/PETSc/Section.pyx:468"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_51setConstraintDof(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_point = 0; PyObject *__pyx_v_numDof = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setConstraintDof (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,&__pyx_n_s_numDof,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_point)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 468, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_numDof)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 468, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setConstraintDof", 1, 2, 2, 1); __PYX_ERR(45, 468, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setConstraintDof") < 0)) __PYX_ERR(45, 468, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_point = values[0]; __pyx_v_numDof = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setConstraintDof", 1, 2, 2, __pyx_nargs); __PYX_ERR(45, 468, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Section.setConstraintDof", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_50setConstraintDof(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point, __pyx_v_numDof); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_50setConstraintDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_numDof) { PetscInt __pyx_v_cpoint; PetscInt __pyx_v_cnumDof; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setConstraintDof", 1); /* "petsc4py/PETSc/Section.pyx":485 * * """ * cdef PetscInt cpoint = asInt(point) # <<<<<<<<<<<<<< * cdef PetscInt cnumDof = asInt(numDof) * CHKERR( PetscSectionSetConstraintDof(self.sec,cpoint,cnumDof) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_point); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 485, __pyx_L1_error) __pyx_v_cpoint = __pyx_t_1; /* "petsc4py/PETSc/Section.pyx":486 * """ * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cnumDof = asInt(numDof) # <<<<<<<<<<<<<< * CHKERR( PetscSectionSetConstraintDof(self.sec,cpoint,cnumDof) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_numDof); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 486, __pyx_L1_error) __pyx_v_cnumDof = __pyx_t_1; /* "petsc4py/PETSc/Section.pyx":487 * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cnumDof = asInt(numDof) * CHKERR( PetscSectionSetConstraintDof(self.sec,cpoint,cnumDof) ) # <<<<<<<<<<<<<< * * def addConstraintDof(self, point: int, numDof: int) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionSetConstraintDof(__pyx_v_self->sec, __pyx_v_cpoint, __pyx_v_cnumDof)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 487, __pyx_L1_error) /* "petsc4py/PETSc/Section.pyx":468 * return toInt(cnumDof) * * def setConstraintDof(self, point: int, numDof: int) -> None: # <<<<<<<<<<<<<< * """Set the number of constrained DOFs associated with a given point. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Section.setConstraintDof", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Section.pyx":489 * CHKERR( PetscSectionSetConstraintDof(self.sec,cpoint,cnumDof) ) * * def addConstraintDof(self, point: int, numDof: int) -> None: # <<<<<<<<<<<<<< * """Increment the number of constrained DOFs for a given point. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_53addConstraintDof(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7Section_52addConstraintDof, "Section.addConstraintDof(self, point: int, numDof: int) -> None\nIncrement the number of constrained DOFs for a given point.\n\n Not collective.\n\n Parameters\n ----------\n point\n The point.\n numDof\n The number of additional DOFs which are fixed by constraints.\n\n See Also\n --------\n setConstraintDof, getConstraintDof, petsc.PetscSectionAddConstraintDof\n\n \nSource code at petsc4py/PETSc/Section.pyx:489"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_53addConstraintDof(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_point = 0; PyObject *__pyx_v_numDof = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("addConstraintDof (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,&__pyx_n_s_numDof,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_point)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 489, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_numDof)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 489, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("addConstraintDof", 1, 2, 2, 1); __PYX_ERR(45, 489, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "addConstraintDof") < 0)) __PYX_ERR(45, 489, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_point = values[0]; __pyx_v_numDof = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("addConstraintDof", 1, 2, 2, __pyx_nargs); __PYX_ERR(45, 489, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Section.addConstraintDof", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_52addConstraintDof(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point, __pyx_v_numDof); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_52addConstraintDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_numDof) { PetscInt __pyx_v_cpoint; PetscInt __pyx_v_cnumDof; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("addConstraintDof", 1); /* "petsc4py/PETSc/Section.pyx":506 * * """ * cdef PetscInt cpoint = asInt(point) # <<<<<<<<<<<<<< * cdef PetscInt cnumDof = asInt(numDof) * CHKERR( PetscSectionAddConstraintDof(self.sec,cpoint,cnumDof) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_point); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 506, __pyx_L1_error) __pyx_v_cpoint = __pyx_t_1; /* "petsc4py/PETSc/Section.pyx":507 * """ * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cnumDof = asInt(numDof) # <<<<<<<<<<<<<< * CHKERR( PetscSectionAddConstraintDof(self.sec,cpoint,cnumDof) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_numDof); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 507, __pyx_L1_error) __pyx_v_cnumDof = __pyx_t_1; /* "petsc4py/PETSc/Section.pyx":508 * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cnumDof = asInt(numDof) * CHKERR( PetscSectionAddConstraintDof(self.sec,cpoint,cnumDof) ) # <<<<<<<<<<<<<< * * def getFieldConstraintDof(self, point: int, field: int) -> int: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionAddConstraintDof(__pyx_v_self->sec, __pyx_v_cpoint, __pyx_v_cnumDof)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 508, __pyx_L1_error) /* "petsc4py/PETSc/Section.pyx":489 * CHKERR( PetscSectionSetConstraintDof(self.sec,cpoint,cnumDof) ) * * def addConstraintDof(self, point: int, numDof: int) -> None: # <<<<<<<<<<<<<< * """Increment the number of constrained DOFs for a given point. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Section.addConstraintDof", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Section.pyx":510 * CHKERR( PetscSectionAddConstraintDof(self.sec,cpoint,cnumDof) ) * * def getFieldConstraintDof(self, point: int, field: int) -> int: # <<<<<<<<<<<<<< * """Return the number of constrained DOFs for a given field on a point. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_55getFieldConstraintDof(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7Section_54getFieldConstraintDof, "Section.getFieldConstraintDof(self, point: int, field: int) -> int\nReturn the number of constrained DOFs for a given field on a point.\n\n Not collective.\n\n Parameters\n ----------\n point\n The point.\n field\n The field.\n\n See Also\n --------\n setFieldConstraintDof, petsc.PetscSectionGetFieldConstraintDof\n\n \nSource code at petsc4py/PETSc/Section.pyx:510"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_55getFieldConstraintDof(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_point = 0; PyObject *__pyx_v_field = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getFieldConstraintDof (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,&__pyx_n_s_field,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_point)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 510, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_field)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 510, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("getFieldConstraintDof", 1, 2, 2, 1); __PYX_ERR(45, 510, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getFieldConstraintDof") < 0)) __PYX_ERR(45, 510, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_point = values[0]; __pyx_v_field = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getFieldConstraintDof", 1, 2, 2, __pyx_nargs); __PYX_ERR(45, 510, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Section.getFieldConstraintDof", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_54getFieldConstraintDof(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point, __pyx_v_field); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_54getFieldConstraintDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field) { PetscInt __pyx_v_cpoint; PetscInt __pyx_v_cnumDof; PetscInt __pyx_v_cfield; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getFieldConstraintDof", 1); /* "petsc4py/PETSc/Section.pyx":527 * * """ * cdef PetscInt cpoint = asInt(point), cnumDof = 0 # <<<<<<<<<<<<<< * cdef PetscInt cfield = asInt(field) * CHKERR( PetscSectionGetFieldConstraintDof(self.sec,cpoint,cfield,&cnumDof) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_point); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 527, __pyx_L1_error) __pyx_v_cpoint = __pyx_t_1; __pyx_v_cnumDof = 0; /* "petsc4py/PETSc/Section.pyx":528 * """ * cdef PetscInt cpoint = asInt(point), cnumDof = 0 * cdef PetscInt cfield = asInt(field) # <<<<<<<<<<<<<< * CHKERR( PetscSectionGetFieldConstraintDof(self.sec,cpoint,cfield,&cnumDof) ) * return toInt(cnumDof) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_field); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 528, __pyx_L1_error) __pyx_v_cfield = __pyx_t_1; /* "petsc4py/PETSc/Section.pyx":529 * cdef PetscInt cpoint = asInt(point), cnumDof = 0 * cdef PetscInt cfield = asInt(field) * CHKERR( PetscSectionGetFieldConstraintDof(self.sec,cpoint,cfield,&cnumDof) ) # <<<<<<<<<<<<<< * return toInt(cnumDof) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionGetFieldConstraintDof(__pyx_v_self->sec, __pyx_v_cpoint, __pyx_v_cfield, (&__pyx_v_cnumDof))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 529, __pyx_L1_error) /* "petsc4py/PETSc/Section.pyx":530 * cdef PetscInt cfield = asInt(field) * CHKERR( PetscSectionGetFieldConstraintDof(self.sec,cpoint,cfield,&cnumDof) ) * return toInt(cnumDof) # <<<<<<<<<<<<<< * * def setFieldConstraintDof( */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_cnumDof); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 530, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Section.pyx":510 * CHKERR( PetscSectionAddConstraintDof(self.sec,cpoint,cnumDof) ) * * def getFieldConstraintDof(self, point: int, field: int) -> int: # <<<<<<<<<<<<<< * """Return the number of constrained DOFs for a given field on a point. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Section.getFieldConstraintDof", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Section.pyx":532 * return toInt(cnumDof) * * def setFieldConstraintDof( # <<<<<<<<<<<<<< * self, * point: int, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_57setFieldConstraintDof(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7Section_56setFieldConstraintDof, "Section.setFieldConstraintDof(self, point: int, field: int, numDof: int) -> None\nSet the number of constrained DOFs for a given field on a point.\n\n Not collective.\n\n Parameters\n ----------\n point\n The point.\n field\n The field.\n numDof\n The number of DOFs which are fixed by constraints.\n\n See Also\n --------\n getFieldConstraintDof, addFieldConstraintDof\n petsc.PetscSectionSetFieldConstraintDof\n\n \nSource code at petsc4py/PETSc/Section.pyx:532"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_57setFieldConstraintDof(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_point = 0; PyObject *__pyx_v_field = 0; PyObject *__pyx_v_numDof = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFieldConstraintDof (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,&__pyx_n_s_field,&__pyx_n_s_numDof,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_point)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 532, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_field)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 532, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setFieldConstraintDof", 1, 3, 3, 1); __PYX_ERR(45, 532, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_numDof)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 532, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setFieldConstraintDof", 1, 3, 3, 2); __PYX_ERR(45, 532, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setFieldConstraintDof") < 0)) __PYX_ERR(45, 532, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_point = values[0]; __pyx_v_field = values[1]; __pyx_v_numDof = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setFieldConstraintDof", 1, 3, 3, __pyx_nargs); __PYX_ERR(45, 532, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Section.setFieldConstraintDof", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_56setFieldConstraintDof(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point, __pyx_v_field, __pyx_v_numDof); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_56setFieldConstraintDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field, PyObject *__pyx_v_numDof) { PetscInt __pyx_v_cpoint; PetscInt __pyx_v_cfield; PetscInt __pyx_v_cnumDof; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFieldConstraintDof", 1); /* "petsc4py/PETSc/Section.pyx":557 * * """ * cdef PetscInt cpoint = asInt(point) # <<<<<<<<<<<<<< * cdef PetscInt cfield = asInt(field) * cdef PetscInt cnumDof = asInt(numDof) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_point); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 557, __pyx_L1_error) __pyx_v_cpoint = __pyx_t_1; /* "petsc4py/PETSc/Section.pyx":558 * """ * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cfield = asInt(field) # <<<<<<<<<<<<<< * cdef PetscInt cnumDof = asInt(numDof) * CHKERR( PetscSectionSetFieldConstraintDof(self.sec,cpoint,cfield,cnumDof) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_field); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 558, __pyx_L1_error) __pyx_v_cfield = __pyx_t_1; /* "petsc4py/PETSc/Section.pyx":559 * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cfield = asInt(field) * cdef PetscInt cnumDof = asInt(numDof) # <<<<<<<<<<<<<< * CHKERR( PetscSectionSetFieldConstraintDof(self.sec,cpoint,cfield,cnumDof) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_numDof); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 559, __pyx_L1_error) __pyx_v_cnumDof = __pyx_t_1; /* "petsc4py/PETSc/Section.pyx":560 * cdef PetscInt cfield = asInt(field) * cdef PetscInt cnumDof = asInt(numDof) * CHKERR( PetscSectionSetFieldConstraintDof(self.sec,cpoint,cfield,cnumDof) ) # <<<<<<<<<<<<<< * * def addFieldConstraintDof( */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionSetFieldConstraintDof(__pyx_v_self->sec, __pyx_v_cpoint, __pyx_v_cfield, __pyx_v_cnumDof)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 560, __pyx_L1_error) /* "petsc4py/PETSc/Section.pyx":532 * return toInt(cnumDof) * * def setFieldConstraintDof( # <<<<<<<<<<<<<< * self, * point: int, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Section.setFieldConstraintDof", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Section.pyx":562 * CHKERR( PetscSectionSetFieldConstraintDof(self.sec,cpoint,cfield,cnumDof) ) * * def addFieldConstraintDof( # <<<<<<<<<<<<<< * self, * point: int, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_59addFieldConstraintDof(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7Section_58addFieldConstraintDof, "Section.addFieldConstraintDof(self, point: int, field: int, numDof: int) -> None\nAdd ``numDof`` constrained DOFs for a given field on a point.\n\n Not collective.\n\n Parameters\n ----------\n point\n The point.\n field\n The field.\n numDof\n The number of additional DOFs which are fixed by constraints.\n\n See Also\n --------\n setFieldConstraintDof, getFieldConstraintDof\n petsc.PetscSectionAddFieldConstraintDof\n\n \nSource code at petsc4py/PETSc/Section.pyx:562"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_59addFieldConstraintDof(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_point = 0; PyObject *__pyx_v_field = 0; PyObject *__pyx_v_numDof = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("addFieldConstraintDof (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,&__pyx_n_s_field,&__pyx_n_s_numDof,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_point)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 562, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_field)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 562, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("addFieldConstraintDof", 1, 3, 3, 1); __PYX_ERR(45, 562, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_numDof)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 562, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("addFieldConstraintDof", 1, 3, 3, 2); __PYX_ERR(45, 562, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "addFieldConstraintDof") < 0)) __PYX_ERR(45, 562, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_point = values[0]; __pyx_v_field = values[1]; __pyx_v_numDof = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("addFieldConstraintDof", 1, 3, 3, __pyx_nargs); __PYX_ERR(45, 562, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Section.addFieldConstraintDof", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_58addFieldConstraintDof(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point, __pyx_v_field, __pyx_v_numDof); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_58addFieldConstraintDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field, PyObject *__pyx_v_numDof) { PetscInt __pyx_v_cpoint; PetscInt __pyx_v_cfield; PetscInt __pyx_v_cnumDof; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("addFieldConstraintDof", 1); /* "petsc4py/PETSc/Section.pyx":587 * * """ * cdef PetscInt cpoint = asInt(point) # <<<<<<<<<<<<<< * cdef PetscInt cfield = asInt(field) * cdef PetscInt cnumDof = asInt(numDof) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_point); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 587, __pyx_L1_error) __pyx_v_cpoint = __pyx_t_1; /* "petsc4py/PETSc/Section.pyx":588 * """ * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cfield = asInt(field) # <<<<<<<<<<<<<< * cdef PetscInt cnumDof = asInt(numDof) * CHKERR( PetscSectionAddFieldConstraintDof(self.sec,cpoint,cfield,cnumDof) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_field); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 588, __pyx_L1_error) __pyx_v_cfield = __pyx_t_1; /* "petsc4py/PETSc/Section.pyx":589 * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cfield = asInt(field) * cdef PetscInt cnumDof = asInt(numDof) # <<<<<<<<<<<<<< * CHKERR( PetscSectionAddFieldConstraintDof(self.sec,cpoint,cfield,cnumDof) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_numDof); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 589, __pyx_L1_error) __pyx_v_cnumDof = __pyx_t_1; /* "petsc4py/PETSc/Section.pyx":590 * cdef PetscInt cfield = asInt(field) * cdef PetscInt cnumDof = asInt(numDof) * CHKERR( PetscSectionAddFieldConstraintDof(self.sec,cpoint,cfield,cnumDof) ) # <<<<<<<<<<<<<< * * def getConstraintIndices(self, point: int) -> ArrayInt: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionAddFieldConstraintDof(__pyx_v_self->sec, __pyx_v_cpoint, __pyx_v_cfield, __pyx_v_cnumDof)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 590, __pyx_L1_error) /* "petsc4py/PETSc/Section.pyx":562 * CHKERR( PetscSectionSetFieldConstraintDof(self.sec,cpoint,cfield,cnumDof) ) * * def addFieldConstraintDof( # <<<<<<<<<<<<<< * self, * point: int, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Section.addFieldConstraintDof", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Section.pyx":592 * CHKERR( PetscSectionAddFieldConstraintDof(self.sec,cpoint,cfield,cnumDof) ) * * def getConstraintIndices(self, point: int) -> ArrayInt: # <<<<<<<<<<<<<< * """Return the point DOFs numbers which are constrained for a given point. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_61getConstraintIndices(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7Section_60getConstraintIndices, "Section.getConstraintIndices(self, point: int) -> ArrayInt\nReturn the point DOFs numbers which are constrained for a given point.\n\n Not collective.\n\n The range is in [0, DOFs).\n\n Parameters\n ----------\n point\n The point.\n\n See Also\n --------\n setConstraintIndices, petsc.PetscSectionGetConstraintIndices\n\n \nSource code at petsc4py/PETSc/Section.pyx:592"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_61getConstraintIndices(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_point = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getConstraintIndices (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_point)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 592, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getConstraintIndices") < 0)) __PYX_ERR(45, 592, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_point = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getConstraintIndices", 1, 1, 1, __pyx_nargs); __PYX_ERR(45, 592, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Section.getConstraintIndices", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_60getConstraintIndices(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_60getConstraintIndices(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point) { PetscInt __pyx_v_cpoint; PetscInt __pyx_v_nindex; PetscInt const *__pyx_v_indices; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getConstraintIndices", 1); /* "petsc4py/PETSc/Section.pyx":609 * * """ * cdef PetscInt cpoint = asInt(point) # <<<<<<<<<<<<<< * cdef PetscInt nindex = 0 * cdef const PetscInt *indices = NULL */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_point); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 609, __pyx_L1_error) __pyx_v_cpoint = __pyx_t_1; /* "petsc4py/PETSc/Section.pyx":610 * """ * cdef PetscInt cpoint = asInt(point) * cdef PetscInt nindex = 0 # <<<<<<<<<<<<<< * cdef const PetscInt *indices = NULL * CHKERR( PetscSectionGetConstraintDof(self.sec, cpoint, &nindex) ) */ __pyx_v_nindex = 0; /* "petsc4py/PETSc/Section.pyx":611 * cdef PetscInt cpoint = asInt(point) * cdef PetscInt nindex = 0 * cdef const PetscInt *indices = NULL # <<<<<<<<<<<<<< * CHKERR( PetscSectionGetConstraintDof(self.sec, cpoint, &nindex) ) * CHKERR( PetscSectionGetConstraintIndices(self.sec, cpoint, &indices) ) */ __pyx_v_indices = NULL; /* "petsc4py/PETSc/Section.pyx":612 * cdef PetscInt nindex = 0 * cdef const PetscInt *indices = NULL * CHKERR( PetscSectionGetConstraintDof(self.sec, cpoint, &nindex) ) # <<<<<<<<<<<<<< * CHKERR( PetscSectionGetConstraintIndices(self.sec, cpoint, &indices) ) * return array_i(nindex, indices) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionGetConstraintDof(__pyx_v_self->sec, __pyx_v_cpoint, (&__pyx_v_nindex))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 612, __pyx_L1_error) /* "petsc4py/PETSc/Section.pyx":613 * cdef const PetscInt *indices = NULL * CHKERR( PetscSectionGetConstraintDof(self.sec, cpoint, &nindex) ) * CHKERR( PetscSectionGetConstraintIndices(self.sec, cpoint, &indices) ) # <<<<<<<<<<<<<< * return array_i(nindex, indices) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionGetConstraintIndices(__pyx_v_self->sec, __pyx_v_cpoint, (&__pyx_v_indices))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 613, __pyx_L1_error) /* "petsc4py/PETSc/Section.pyx":614 * CHKERR( PetscSectionGetConstraintDof(self.sec, cpoint, &nindex) ) * CHKERR( PetscSectionGetConstraintIndices(self.sec, cpoint, &indices) ) * return array_i(nindex, indices) # <<<<<<<<<<<<<< * * def setConstraintIndices(self, point: int, indices: Sequence[int]) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i(__pyx_v_nindex, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Section.pyx":592 * CHKERR( PetscSectionAddFieldConstraintDof(self.sec,cpoint,cfield,cnumDof) ) * * def getConstraintIndices(self, point: int) -> ArrayInt: # <<<<<<<<<<<<<< * """Return the point DOFs numbers which are constrained for a given point. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Section.getConstraintIndices", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Section.pyx":616 * return array_i(nindex, indices) * * def setConstraintIndices(self, point: int, indices: Sequence[int]) -> None: # <<<<<<<<<<<<<< * """Set the point DOFs numbers, in [0, DOFs), which are constrained. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_63setConstraintIndices(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7Section_62setConstraintIndices, "Section.setConstraintIndices(self, point: int, indices: Sequence[int]) -> None\nSet the point DOFs numbers, in [0, DOFs), which are constrained.\n\n Not collective.\n\n Parameters\n ----------\n point\n The point.\n indices\n The constrained DOFs.\n\n See Also\n --------\n getConstraintIndices, petsc.PetscSectionSetConstraintIndices\n\n \nSource code at petsc4py/PETSc/Section.pyx:616"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_63setConstraintIndices(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_point = 0; PyObject *__pyx_v_indices = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setConstraintIndices (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,&__pyx_n_s_indices,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_point)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 616, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_indices)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 616, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setConstraintIndices", 1, 2, 2, 1); __PYX_ERR(45, 616, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setConstraintIndices") < 0)) __PYX_ERR(45, 616, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_point = values[0]; __pyx_v_indices = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setConstraintIndices", 1, 2, 2, __pyx_nargs); __PYX_ERR(45, 616, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Section.setConstraintIndices", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_62setConstraintIndices(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point, __pyx_v_indices); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_62setConstraintIndices(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_indices) { PetscInt __pyx_v_cpoint; PetscInt __pyx_v_nindex; PetscInt *__pyx_v_cindices; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setConstraintIndices", 0); __Pyx_INCREF(__pyx_v_indices); /* "petsc4py/PETSc/Section.pyx":633 * * """ * cdef PetscInt cpoint = asInt(point) # <<<<<<<<<<<<<< * cdef PetscInt nindex = 0 * cdef PetscInt *cindices = NULL */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_point); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 633, __pyx_L1_error) __pyx_v_cpoint = __pyx_t_1; /* "petsc4py/PETSc/Section.pyx":634 * """ * cdef PetscInt cpoint = asInt(point) * cdef PetscInt nindex = 0 # <<<<<<<<<<<<<< * cdef PetscInt *cindices = NULL * indices = iarray_i(indices, &nindex, &cindices) */ __pyx_v_nindex = 0; /* "petsc4py/PETSc/Section.pyx":635 * cdef PetscInt cpoint = asInt(point) * cdef PetscInt nindex = 0 * cdef PetscInt *cindices = NULL # <<<<<<<<<<<<<< * indices = iarray_i(indices, &nindex, &cindices) * CHKERR( PetscSectionSetConstraintDof(self.sec,cpoint,nindex) ) */ __pyx_v_cindices = NULL; /* "petsc4py/PETSc/Section.pyx":636 * cdef PetscInt nindex = 0 * cdef PetscInt *cindices = NULL * indices = iarray_i(indices, &nindex, &cindices) # <<<<<<<<<<<<<< * CHKERR( PetscSectionSetConstraintDof(self.sec,cpoint,nindex) ) * CHKERR( PetscSectionSetConstraintIndices(self.sec,cpoint,cindices) ) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_indices, (&__pyx_v_nindex), (&__pyx_v_cindices))); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 636, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_indices, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/Section.pyx":637 * cdef PetscInt *cindices = NULL * indices = iarray_i(indices, &nindex, &cindices) * CHKERR( PetscSectionSetConstraintDof(self.sec,cpoint,nindex) ) # <<<<<<<<<<<<<< * CHKERR( PetscSectionSetConstraintIndices(self.sec,cpoint,cindices) ) * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionSetConstraintDof(__pyx_v_self->sec, __pyx_v_cpoint, __pyx_v_nindex)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 637, __pyx_L1_error) /* "petsc4py/PETSc/Section.pyx":638 * indices = iarray_i(indices, &nindex, &cindices) * CHKERR( PetscSectionSetConstraintDof(self.sec,cpoint,nindex) ) * CHKERR( PetscSectionSetConstraintIndices(self.sec,cpoint,cindices) ) # <<<<<<<<<<<<<< * * def getFieldConstraintIndices(self, point: int, field: int) -> ArrayInt: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionSetConstraintIndices(__pyx_v_self->sec, __pyx_v_cpoint, __pyx_v_cindices)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 638, __pyx_L1_error) /* "petsc4py/PETSc/Section.pyx":616 * return array_i(nindex, indices) * * def setConstraintIndices(self, point: int, indices: Sequence[int]) -> None: # <<<<<<<<<<<<<< * """Set the point DOFs numbers, in [0, DOFs), which are constrained. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Section.setConstraintIndices", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_indices); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Section.pyx":640 * CHKERR( PetscSectionSetConstraintIndices(self.sec,cpoint,cindices) ) * * def getFieldConstraintIndices(self, point: int, field: int) -> ArrayInt: # <<<<<<<<<<<<<< * """Return the field DOFs numbers, in [0, DOFs), which are constrained. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_65getFieldConstraintIndices(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7Section_64getFieldConstraintIndices, "Section.getFieldConstraintIndices(self, point: int, field: int) -> ArrayInt\nReturn the field DOFs numbers, in [0, DOFs), which are constrained.\n\n Not collective.\n\n The constrained DOFs are sorted in ascending order.\n\n Parameters\n ----------\n field\n The field number.\n point\n The point.\n\n See Also\n --------\n setFieldConstraintIndices, petsc.PetscSectionGetFieldConstraintIndices\n\n \nSource code at petsc4py/PETSc/Section.pyx:640"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_65getFieldConstraintIndices(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_point = 0; PyObject *__pyx_v_field = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getFieldConstraintIndices (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,&__pyx_n_s_field,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_point)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 640, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_field)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 640, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("getFieldConstraintIndices", 1, 2, 2, 1); __PYX_ERR(45, 640, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getFieldConstraintIndices") < 0)) __PYX_ERR(45, 640, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_point = values[0]; __pyx_v_field = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getFieldConstraintIndices", 1, 2, 2, __pyx_nargs); __PYX_ERR(45, 640, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Section.getFieldConstraintIndices", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_64getFieldConstraintIndices(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point, __pyx_v_field); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_64getFieldConstraintIndices(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field) { PetscInt __pyx_v_cpoint; PetscInt __pyx_v_cfield; PetscInt __pyx_v_nindex; PetscInt const *__pyx_v_indices; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getFieldConstraintIndices", 1); /* "petsc4py/PETSc/Section.pyx":659 * * """ * cdef PetscInt cpoint = asInt(point) # <<<<<<<<<<<<<< * cdef PetscInt cfield = asInt(field) * cdef PetscInt nindex = 0 */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_point); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 659, __pyx_L1_error) __pyx_v_cpoint = __pyx_t_1; /* "petsc4py/PETSc/Section.pyx":660 * """ * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cfield = asInt(field) # <<<<<<<<<<<<<< * cdef PetscInt nindex = 0 * cdef const PetscInt *indices = NULL */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_field); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 660, __pyx_L1_error) __pyx_v_cfield = __pyx_t_1; /* "petsc4py/PETSc/Section.pyx":661 * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cfield = asInt(field) * cdef PetscInt nindex = 0 # <<<<<<<<<<<<<< * cdef const PetscInt *indices = NULL * CHKERR( PetscSectionGetFieldConstraintDof(self.sec,cpoint,cfield,&nindex) ) */ __pyx_v_nindex = 0; /* "petsc4py/PETSc/Section.pyx":662 * cdef PetscInt cfield = asInt(field) * cdef PetscInt nindex = 0 * cdef const PetscInt *indices = NULL # <<<<<<<<<<<<<< * CHKERR( PetscSectionGetFieldConstraintDof(self.sec,cpoint,cfield,&nindex) ) * CHKERR( PetscSectionGetFieldConstraintIndices(self.sec,cpoint,cfield,&indices) ) */ __pyx_v_indices = NULL; /* "petsc4py/PETSc/Section.pyx":663 * cdef PetscInt nindex = 0 * cdef const PetscInt *indices = NULL * CHKERR( PetscSectionGetFieldConstraintDof(self.sec,cpoint,cfield,&nindex) ) # <<<<<<<<<<<<<< * CHKERR( PetscSectionGetFieldConstraintIndices(self.sec,cpoint,cfield,&indices) ) * return array_i(nindex, indices) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionGetFieldConstraintDof(__pyx_v_self->sec, __pyx_v_cpoint, __pyx_v_cfield, (&__pyx_v_nindex))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 663, __pyx_L1_error) /* "petsc4py/PETSc/Section.pyx":664 * cdef const PetscInt *indices = NULL * CHKERR( PetscSectionGetFieldConstraintDof(self.sec,cpoint,cfield,&nindex) ) * CHKERR( PetscSectionGetFieldConstraintIndices(self.sec,cpoint,cfield,&indices) ) # <<<<<<<<<<<<<< * return array_i(nindex, indices) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionGetFieldConstraintIndices(__pyx_v_self->sec, __pyx_v_cpoint, __pyx_v_cfield, (&__pyx_v_indices))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 664, __pyx_L1_error) /* "petsc4py/PETSc/Section.pyx":665 * CHKERR( PetscSectionGetFieldConstraintDof(self.sec,cpoint,cfield,&nindex) ) * CHKERR( PetscSectionGetFieldConstraintIndices(self.sec,cpoint,cfield,&indices) ) * return array_i(nindex, indices) # <<<<<<<<<<<<<< * * def setFieldConstraintIndices( */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i(__pyx_v_nindex, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Section.pyx":640 * CHKERR( PetscSectionSetConstraintIndices(self.sec,cpoint,cindices) ) * * def getFieldConstraintIndices(self, point: int, field: int) -> ArrayInt: # <<<<<<<<<<<<<< * """Return the field DOFs numbers, in [0, DOFs), which are constrained. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Section.getFieldConstraintIndices", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Section.pyx":667 * return array_i(nindex, indices) * * def setFieldConstraintIndices( # <<<<<<<<<<<<<< * self, * point: int, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_67setFieldConstraintIndices(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7Section_66setFieldConstraintIndices, "Section.setFieldConstraintIndices(self, point: int, field: int, indices: Sequence[int]) -> None\nSet the field DOFs numbers, in [0, DOFs), which are constrained.\n\n Not collective.\n\n Parameters\n ----------\n point\n The point.\n field\n The field number.\n indices\n The constrained DOFs.\n\n See Also\n --------\n getFieldConstraintIndices, petsc.PetscSectionSetFieldConstraintIndices\n\n \nSource code at petsc4py/PETSc/Section.pyx:667"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_67setFieldConstraintIndices(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_point = 0; PyObject *__pyx_v_field = 0; PyObject *__pyx_v_indices = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFieldConstraintIndices (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,&__pyx_n_s_field,&__pyx_n_s_indices,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_point)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 667, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_field)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 667, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setFieldConstraintIndices", 1, 3, 3, 1); __PYX_ERR(45, 667, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_indices)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 667, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setFieldConstraintIndices", 1, 3, 3, 2); __PYX_ERR(45, 667, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setFieldConstraintIndices") < 0)) __PYX_ERR(45, 667, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_point = values[0]; __pyx_v_field = values[1]; __pyx_v_indices = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setFieldConstraintIndices", 1, 3, 3, __pyx_nargs); __PYX_ERR(45, 667, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Section.setFieldConstraintIndices", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_66setFieldConstraintIndices(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point, __pyx_v_field, __pyx_v_indices); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_66setFieldConstraintIndices(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field, PyObject *__pyx_v_indices) { PetscInt __pyx_v_cpoint; PetscInt __pyx_v_cfield; PetscInt __pyx_v_nindex; PetscInt *__pyx_v_cindices; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFieldConstraintIndices", 0); __Pyx_INCREF(__pyx_v_indices); /* "petsc4py/PETSc/Section.pyx":691 * * """ * cdef PetscInt cpoint = asInt(point) # <<<<<<<<<<<<<< * cdef PetscInt cfield = asInt(field) * cdef PetscInt nindex = 0 */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_point); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 691, __pyx_L1_error) __pyx_v_cpoint = __pyx_t_1; /* "petsc4py/PETSc/Section.pyx":692 * """ * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cfield = asInt(field) # <<<<<<<<<<<<<< * cdef PetscInt nindex = 0 * cdef PetscInt *cindices = NULL */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_field); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 692, __pyx_L1_error) __pyx_v_cfield = __pyx_t_1; /* "petsc4py/PETSc/Section.pyx":693 * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cfield = asInt(field) * cdef PetscInt nindex = 0 # <<<<<<<<<<<<<< * cdef PetscInt *cindices = NULL * indices = iarray_i(indices, &nindex, &cindices) */ __pyx_v_nindex = 0; /* "petsc4py/PETSc/Section.pyx":694 * cdef PetscInt cfield = asInt(field) * cdef PetscInt nindex = 0 * cdef PetscInt *cindices = NULL # <<<<<<<<<<<<<< * indices = iarray_i(indices, &nindex, &cindices) * CHKERR( PetscSectionSetFieldConstraintDof(self.sec,cpoint,cfield,nindex) ) */ __pyx_v_cindices = NULL; /* "petsc4py/PETSc/Section.pyx":695 * cdef PetscInt nindex = 0 * cdef PetscInt *cindices = NULL * indices = iarray_i(indices, &nindex, &cindices) # <<<<<<<<<<<<<< * CHKERR( PetscSectionSetFieldConstraintDof(self.sec,cpoint,cfield,nindex) ) * CHKERR( PetscSectionSetFieldConstraintIndices(self.sec,cpoint,cfield,cindices) ) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_indices, (&__pyx_v_nindex), (&__pyx_v_cindices))); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 695, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_indices, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/Section.pyx":696 * cdef PetscInt *cindices = NULL * indices = iarray_i(indices, &nindex, &cindices) * CHKERR( PetscSectionSetFieldConstraintDof(self.sec,cpoint,cfield,nindex) ) # <<<<<<<<<<<<<< * CHKERR( PetscSectionSetFieldConstraintIndices(self.sec,cpoint,cfield,cindices) ) * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionSetFieldConstraintDof(__pyx_v_self->sec, __pyx_v_cpoint, __pyx_v_cfield, __pyx_v_nindex)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 696, __pyx_L1_error) /* "petsc4py/PETSc/Section.pyx":697 * indices = iarray_i(indices, &nindex, &cindices) * CHKERR( PetscSectionSetFieldConstraintDof(self.sec,cpoint,cfield,nindex) ) * CHKERR( PetscSectionSetFieldConstraintIndices(self.sec,cpoint,cfield,cindices) ) # <<<<<<<<<<<<<< * * def getMaxDof(self) -> int: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionSetFieldConstraintIndices(__pyx_v_self->sec, __pyx_v_cpoint, __pyx_v_cfield, __pyx_v_cindices)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 697, __pyx_L1_error) /* "petsc4py/PETSc/Section.pyx":667 * return array_i(nindex, indices) * * def setFieldConstraintIndices( # <<<<<<<<<<<<<< * self, * point: int, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Section.setFieldConstraintIndices", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_indices); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Section.pyx":699 * CHKERR( PetscSectionSetFieldConstraintIndices(self.sec,cpoint,cfield,cindices) ) * * def getMaxDof(self) -> int: # <<<<<<<<<<<<<< * """Return the maximum number of DOFs for any point in the section. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_69getMaxDof(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7Section_68getMaxDof, "Section.getMaxDof(self) -> int\nReturn the maximum number of DOFs for any point in the section.\n\n Not collective.\n\n See Also\n --------\n petsc.PetscSectionGetMaxDof\n\n \nSource code at petsc4py/PETSc/Section.pyx:699"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_69getMaxDof(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getMaxDof (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getMaxDof", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getMaxDof", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_68getMaxDof(((struct PyPetscSectionObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_68getMaxDof(struct PyPetscSectionObject *__pyx_v_self) { PetscInt __pyx_v_maxDof; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getMaxDof", 1); /* "petsc4py/PETSc/Section.pyx":709 * * """ * cdef PetscInt maxDof = 0 # <<<<<<<<<<<<<< * CHKERR( PetscSectionGetMaxDof(self.sec,&maxDof) ) * return toInt(maxDof) */ __pyx_v_maxDof = 0; /* "petsc4py/PETSc/Section.pyx":710 * """ * cdef PetscInt maxDof = 0 * CHKERR( PetscSectionGetMaxDof(self.sec,&maxDof) ) # <<<<<<<<<<<<<< * return toInt(maxDof) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionGetMaxDof(__pyx_v_self->sec, (&__pyx_v_maxDof))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 710, __pyx_L1_error) /* "petsc4py/PETSc/Section.pyx":711 * cdef PetscInt maxDof = 0 * CHKERR( PetscSectionGetMaxDof(self.sec,&maxDof) ) * return toInt(maxDof) # <<<<<<<<<<<<<< * * def getStorageSize(self) -> int: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_maxDof); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 711, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Section.pyx":699 * CHKERR( PetscSectionSetFieldConstraintIndices(self.sec,cpoint,cfield,cindices) ) * * def getMaxDof(self) -> int: # <<<<<<<<<<<<<< * """Return the maximum number of DOFs for any point in the section. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Section.getMaxDof", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Section.pyx":713 * return toInt(maxDof) * * def getStorageSize(self) -> int: # <<<<<<<<<<<<<< * """Return the size capable of holding all the DOFs defined in a section. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_71getStorageSize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7Section_70getStorageSize, "Section.getStorageSize(self) -> int\nReturn the size capable of holding all the DOFs defined in a section.\n\n Not collective.\n\n See Also\n --------\n getConstrainedStorageSize, petsc.PetscSectionGetStorageSize\n\n \nSource code at petsc4py/PETSc/Section.pyx:713"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_71getStorageSize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getStorageSize (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getStorageSize", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getStorageSize", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_70getStorageSize(((struct PyPetscSectionObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_70getStorageSize(struct PyPetscSectionObject *__pyx_v_self) { PetscInt __pyx_v_size; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getStorageSize", 1); /* "petsc4py/PETSc/Section.pyx":723 * * """ * cdef PetscInt size = 0 # <<<<<<<<<<<<<< * CHKERR( PetscSectionGetStorageSize(self.sec,&size) ) * return toInt(size) */ __pyx_v_size = 0; /* "petsc4py/PETSc/Section.pyx":724 * """ * cdef PetscInt size = 0 * CHKERR( PetscSectionGetStorageSize(self.sec,&size) ) # <<<<<<<<<<<<<< * return toInt(size) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionGetStorageSize(__pyx_v_self->sec, (&__pyx_v_size))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 724, __pyx_L1_error) /* "petsc4py/PETSc/Section.pyx":725 * cdef PetscInt size = 0 * CHKERR( PetscSectionGetStorageSize(self.sec,&size) ) * return toInt(size) # <<<<<<<<<<<<<< * * def getConstrainedStorageSize(self) -> int: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 725, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Section.pyx":713 * return toInt(maxDof) * * def getStorageSize(self) -> int: # <<<<<<<<<<<<<< * """Return the size capable of holding all the DOFs defined in a section. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Section.getStorageSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Section.pyx":727 * return toInt(size) * * def getConstrainedStorageSize(self) -> int: # <<<<<<<<<<<<<< * """Return the size capable of holding all unconstrained DOFs in a section. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_73getConstrainedStorageSize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7Section_72getConstrainedStorageSize, "Section.getConstrainedStorageSize(self) -> int\nReturn the size capable of holding all unconstrained DOFs in a section.\n\n Not collective.\n\n See Also\n --------\n getStorageSize, petsc.PetscSectionGetConstrainedStorageSize\n\n \nSource code at petsc4py/PETSc/Section.pyx:727"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_73getConstrainedStorageSize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getConstrainedStorageSize (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getConstrainedStorageSize", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getConstrainedStorageSize", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_72getConstrainedStorageSize(((struct PyPetscSectionObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_72getConstrainedStorageSize(struct PyPetscSectionObject *__pyx_v_self) { PetscInt __pyx_v_size; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getConstrainedStorageSize", 1); /* "petsc4py/PETSc/Section.pyx":737 * * """ * cdef PetscInt size = 0 # <<<<<<<<<<<<<< * CHKERR( PetscSectionGetConstrainedStorageSize(self.sec,&size) ) * return toInt(size) */ __pyx_v_size = 0; /* "petsc4py/PETSc/Section.pyx":738 * """ * cdef PetscInt size = 0 * CHKERR( PetscSectionGetConstrainedStorageSize(self.sec,&size) ) # <<<<<<<<<<<<<< * return toInt(size) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionGetConstrainedStorageSize(__pyx_v_self->sec, (&__pyx_v_size))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 738, __pyx_L1_error) /* "petsc4py/PETSc/Section.pyx":739 * cdef PetscInt size = 0 * CHKERR( PetscSectionGetConstrainedStorageSize(self.sec,&size) ) * return toInt(size) # <<<<<<<<<<<<<< * * def getOffset(self, point: int) -> int: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 739, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Section.pyx":727 * return toInt(size) * * def getConstrainedStorageSize(self) -> int: # <<<<<<<<<<<<<< * """Return the size capable of holding all unconstrained DOFs in a section. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Section.getConstrainedStorageSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Section.pyx":741 * return toInt(size) * * def getOffset(self, point: int) -> int: # <<<<<<<<<<<<<< * """Return the offset for the DOFs associated with the given point. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_75getOffset(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7Section_74getOffset, "Section.getOffset(self, point: int) -> int\nReturn the offset for the DOFs associated with the given point.\n\n Not collective.\n\n In a global section, this offset will be negative for points not owned\n by this process.\n\n Parameters\n ----------\n point\n The point.\n\n See Also\n --------\n setOffset, petsc.PetscSectionGetOffset\n\n \nSource code at petsc4py/PETSc/Section.pyx:741"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_75getOffset(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_point = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getOffset (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_point)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 741, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getOffset") < 0)) __PYX_ERR(45, 741, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_point = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getOffset", 1, 1, 1, __pyx_nargs); __PYX_ERR(45, 741, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Section.getOffset", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_74getOffset(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_74getOffset(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point) { PetscInt __pyx_v_cpoint; PetscInt __pyx_v_offset; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getOffset", 1); /* "petsc4py/PETSc/Section.pyx":759 * * """ * cdef PetscInt cpoint = asInt(point), offset = 0 # <<<<<<<<<<<<<< * CHKERR( PetscSectionGetOffset(self.sec,cpoint,&offset) ) * return toInt(offset) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_point); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 759, __pyx_L1_error) __pyx_v_cpoint = __pyx_t_1; __pyx_v_offset = 0; /* "petsc4py/PETSc/Section.pyx":760 * """ * cdef PetscInt cpoint = asInt(point), offset = 0 * CHKERR( PetscSectionGetOffset(self.sec,cpoint,&offset) ) # <<<<<<<<<<<<<< * return toInt(offset) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionGetOffset(__pyx_v_self->sec, __pyx_v_cpoint, (&__pyx_v_offset))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 760, __pyx_L1_error) /* "petsc4py/PETSc/Section.pyx":761 * cdef PetscInt cpoint = asInt(point), offset = 0 * CHKERR( PetscSectionGetOffset(self.sec,cpoint,&offset) ) * return toInt(offset) # <<<<<<<<<<<<<< * * def setOffset(self, point: int, offset: int) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_offset); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 761, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Section.pyx":741 * return toInt(size) * * def getOffset(self, point: int) -> int: # <<<<<<<<<<<<<< * """Return the offset for the DOFs associated with the given point. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Section.getOffset", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Section.pyx":763 * return toInt(offset) * * def setOffset(self, point: int, offset: int) -> None: # <<<<<<<<<<<<<< * """Set the offset for the DOFs associated with the given point. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_77setOffset(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7Section_76setOffset, "Section.setOffset(self, point: int, offset: int) -> None\nSet the offset for the DOFs associated with the given point.\n\n Not collective.\n\n The user usually does not call this function, but uses `setUp`.\n\n Parameters\n ----------\n point\n The point.\n offset\n The offset.\n\n See Also\n --------\n getOffset, petsc.PetscSectionSetOffset\n\n \nSource code at petsc4py/PETSc/Section.pyx:763"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_77setOffset(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_point = 0; PyObject *__pyx_v_offset = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setOffset (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,&__pyx_n_s_offset,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_point)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 763, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_offset)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 763, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setOffset", 1, 2, 2, 1); __PYX_ERR(45, 763, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setOffset") < 0)) __PYX_ERR(45, 763, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_point = values[0]; __pyx_v_offset = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setOffset", 1, 2, 2, __pyx_nargs); __PYX_ERR(45, 763, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Section.setOffset", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_76setOffset(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point, __pyx_v_offset); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_76setOffset(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_offset) { PetscInt __pyx_v_cpoint; PetscInt __pyx_v_coffset; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setOffset", 1); /* "petsc4py/PETSc/Section.pyx":782 * * """ * cdef PetscInt cpoint = asInt(point) # <<<<<<<<<<<<<< * cdef PetscInt coffset = asInt(offset) * CHKERR( PetscSectionSetOffset(self.sec,cpoint,coffset) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_point); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 782, __pyx_L1_error) __pyx_v_cpoint = __pyx_t_1; /* "petsc4py/PETSc/Section.pyx":783 * """ * cdef PetscInt cpoint = asInt(point) * cdef PetscInt coffset = asInt(offset) # <<<<<<<<<<<<<< * CHKERR( PetscSectionSetOffset(self.sec,cpoint,coffset) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_offset); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 783, __pyx_L1_error) __pyx_v_coffset = __pyx_t_1; /* "petsc4py/PETSc/Section.pyx":784 * cdef PetscInt cpoint = asInt(point) * cdef PetscInt coffset = asInt(offset) * CHKERR( PetscSectionSetOffset(self.sec,cpoint,coffset) ) # <<<<<<<<<<<<<< * * def getFieldOffset(self, point: int, field: int) -> int: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionSetOffset(__pyx_v_self->sec, __pyx_v_cpoint, __pyx_v_coffset)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 784, __pyx_L1_error) /* "petsc4py/PETSc/Section.pyx":763 * return toInt(offset) * * def setOffset(self, point: int, offset: int) -> None: # <<<<<<<<<<<<<< * """Set the offset for the DOFs associated with the given point. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Section.setOffset", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Section.pyx":786 * CHKERR( PetscSectionSetOffset(self.sec,cpoint,coffset) ) * * def getFieldOffset(self, point: int, field: int) -> int: # <<<<<<<<<<<<<< * """Return the offset for the field DOFs on the given point. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_79getFieldOffset(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7Section_78getFieldOffset, "Section.getFieldOffset(self, point: int, field: int) -> int\nReturn the offset for the field DOFs on the given point.\n\n Not collective.\n\n In a global section, this offset will be negative for points not owned\n by this process.\n\n Parameters\n ----------\n point\n The point.\n field\n The field.\n\n See Also\n --------\n setFieldOffset, petsc.PetscSectionGetFieldOffset\n\n \nSource code at petsc4py/PETSc/Section.pyx:786"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_79getFieldOffset(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_point = 0; PyObject *__pyx_v_field = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getFieldOffset (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,&__pyx_n_s_field,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_point)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 786, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_field)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 786, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("getFieldOffset", 1, 2, 2, 1); __PYX_ERR(45, 786, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getFieldOffset") < 0)) __PYX_ERR(45, 786, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_point = values[0]; __pyx_v_field = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getFieldOffset", 1, 2, 2, __pyx_nargs); __PYX_ERR(45, 786, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Section.getFieldOffset", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_78getFieldOffset(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point, __pyx_v_field); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_78getFieldOffset(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field) { PetscInt __pyx_v_cpoint; PetscInt __pyx_v_cfield; PetscInt __pyx_v_offset; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getFieldOffset", 1); /* "petsc4py/PETSc/Section.pyx":806 * * """ * cdef PetscInt cpoint = asInt(point) # <<<<<<<<<<<<<< * cdef PetscInt cfield = asInt(field) * cdef PetscInt offset = 0 */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_point); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 806, __pyx_L1_error) __pyx_v_cpoint = __pyx_t_1; /* "petsc4py/PETSc/Section.pyx":807 * """ * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cfield = asInt(field) # <<<<<<<<<<<<<< * cdef PetscInt offset = 0 * CHKERR( PetscSectionGetFieldOffset(self.sec,cpoint,cfield,&offset) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_field); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 807, __pyx_L1_error) __pyx_v_cfield = __pyx_t_1; /* "petsc4py/PETSc/Section.pyx":808 * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cfield = asInt(field) * cdef PetscInt offset = 0 # <<<<<<<<<<<<<< * CHKERR( PetscSectionGetFieldOffset(self.sec,cpoint,cfield,&offset) ) * return toInt(offset) */ __pyx_v_offset = 0; /* "petsc4py/PETSc/Section.pyx":809 * cdef PetscInt cfield = asInt(field) * cdef PetscInt offset = 0 * CHKERR( PetscSectionGetFieldOffset(self.sec,cpoint,cfield,&offset) ) # <<<<<<<<<<<<<< * return toInt(offset) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionGetFieldOffset(__pyx_v_self->sec, __pyx_v_cpoint, __pyx_v_cfield, (&__pyx_v_offset))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 809, __pyx_L1_error) /* "petsc4py/PETSc/Section.pyx":810 * cdef PetscInt offset = 0 * CHKERR( PetscSectionGetFieldOffset(self.sec,cpoint,cfield,&offset) ) * return toInt(offset) # <<<<<<<<<<<<<< * * def setFieldOffset(self, point: int, field: int, offset: int) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_offset); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 810, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Section.pyx":786 * CHKERR( PetscSectionSetOffset(self.sec,cpoint,coffset) ) * * def getFieldOffset(self, point: int, field: int) -> int: # <<<<<<<<<<<<<< * """Return the offset for the field DOFs on the given point. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Section.getFieldOffset", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Section.pyx":812 * return toInt(offset) * * def setFieldOffset(self, point: int, field: int, offset: int) -> None: # <<<<<<<<<<<<<< * """Set the offset for the DOFs on the given field at a point. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_81setFieldOffset(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7Section_80setFieldOffset, "Section.setFieldOffset(self, point: int, field: int, offset: int) -> None\nSet the offset for the DOFs on the given field at a point.\n\n Not collective.\n\n The user usually does not call this function, but uses `setUp`.\n\n Parameters\n ----------\n point\n The point.\n field\n The field.\n offset\n The offset.\n\n See Also\n --------\n getFieldOffset, petsc.PetscSectionSetFieldOffset\n\n \nSource code at petsc4py/PETSc/Section.pyx:812"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_81setFieldOffset(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_point = 0; PyObject *__pyx_v_field = 0; PyObject *__pyx_v_offset = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFieldOffset (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,&__pyx_n_s_field,&__pyx_n_s_offset,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_point)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 812, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_field)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 812, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setFieldOffset", 1, 3, 3, 1); __PYX_ERR(45, 812, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_offset)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 812, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setFieldOffset", 1, 3, 3, 2); __PYX_ERR(45, 812, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setFieldOffset") < 0)) __PYX_ERR(45, 812, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_point = values[0]; __pyx_v_field = values[1]; __pyx_v_offset = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setFieldOffset", 1, 3, 3, __pyx_nargs); __PYX_ERR(45, 812, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Section.setFieldOffset", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_80setFieldOffset(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point, __pyx_v_field, __pyx_v_offset); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_80setFieldOffset(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field, PyObject *__pyx_v_offset) { PetscInt __pyx_v_cpoint; PetscInt __pyx_v_cfield; PetscInt __pyx_v_coffset; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFieldOffset", 1); /* "petsc4py/PETSc/Section.pyx":833 * * """ * cdef PetscInt cpoint = asInt(point) # <<<<<<<<<<<<<< * cdef PetscInt cfield = asInt(field) * cdef PetscInt coffset = asInt(offset) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_point); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 833, __pyx_L1_error) __pyx_v_cpoint = __pyx_t_1; /* "petsc4py/PETSc/Section.pyx":834 * """ * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cfield = asInt(field) # <<<<<<<<<<<<<< * cdef PetscInt coffset = asInt(offset) * CHKERR( PetscSectionSetFieldOffset(self.sec,cpoint,cfield,coffset) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_field); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 834, __pyx_L1_error) __pyx_v_cfield = __pyx_t_1; /* "petsc4py/PETSc/Section.pyx":835 * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cfield = asInt(field) * cdef PetscInt coffset = asInt(offset) # <<<<<<<<<<<<<< * CHKERR( PetscSectionSetFieldOffset(self.sec,cpoint,cfield,coffset) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_offset); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 835, __pyx_L1_error) __pyx_v_coffset = __pyx_t_1; /* "petsc4py/PETSc/Section.pyx":836 * cdef PetscInt cfield = asInt(field) * cdef PetscInt coffset = asInt(offset) * CHKERR( PetscSectionSetFieldOffset(self.sec,cpoint,cfield,coffset) ) # <<<<<<<<<<<<<< * * def getOffsetRange(self) -> tuple[int,int]: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionSetFieldOffset(__pyx_v_self->sec, __pyx_v_cpoint, __pyx_v_cfield, __pyx_v_coffset)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 836, __pyx_L1_error) /* "petsc4py/PETSc/Section.pyx":812 * return toInt(offset) * * def setFieldOffset(self, point: int, field: int, offset: int) -> None: # <<<<<<<<<<<<<< * """Set the offset for the DOFs on the given field at a point. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Section.setFieldOffset", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Section.pyx":838 * CHKERR( PetscSectionSetFieldOffset(self.sec,cpoint,cfield,coffset) ) * * def getOffsetRange(self) -> tuple[int,int]: # <<<<<<<<<<<<<< * """Return the full range of offsets, [start, end), for a section. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_83getOffsetRange(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7Section_82getOffsetRange, "Section.getOffsetRange(self) -> tuple[int, int]\nReturn the full range of offsets, [start, end), for a section.\n\n Not collective.\n\n See Also\n --------\n petsc.PetscSectionGetOffsetRange\n\n \nSource code at petsc4py/PETSc/Section.pyx:838"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_83getOffsetRange(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getOffsetRange (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getOffsetRange", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getOffsetRange", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_82getOffsetRange(((struct PyPetscSectionObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_82getOffsetRange(struct PyPetscSectionObject *__pyx_v_self) { PetscInt __pyx_v_oStart; PetscInt __pyx_v_oEnd; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getOffsetRange", 1); /* "petsc4py/PETSc/Section.pyx":848 * * """ * cdef PetscInt oStart = 0, oEnd = 0 # <<<<<<<<<<<<<< * CHKERR( PetscSectionGetOffsetRange(self.sec,&oStart,&oEnd) ) * return toInt(oStart),toInt(oEnd) */ __pyx_v_oStart = 0; __pyx_v_oEnd = 0; /* "petsc4py/PETSc/Section.pyx":849 * """ * cdef PetscInt oStart = 0, oEnd = 0 * CHKERR( PetscSectionGetOffsetRange(self.sec,&oStart,&oEnd) ) # <<<<<<<<<<<<<< * return toInt(oStart),toInt(oEnd) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionGetOffsetRange(__pyx_v_self->sec, (&__pyx_v_oStart), (&__pyx_v_oEnd))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 849, __pyx_L1_error) /* "petsc4py/PETSc/Section.pyx":850 * cdef PetscInt oStart = 0, oEnd = 0 * CHKERR( PetscSectionGetOffsetRange(self.sec,&oStart,&oEnd) ) * return toInt(oStart),toInt(oEnd) # <<<<<<<<<<<<<< * * # FIXME: Hardcoded PETSC_FALSE parameters */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_oStart); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 850, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_oEnd); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 850, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(45, 850, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(45, 850, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(45, 850, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Section.pyx":838 * CHKERR( PetscSectionSetFieldOffset(self.sec,cpoint,cfield,coffset) ) * * def getOffsetRange(self) -> tuple[int,int]: # <<<<<<<<<<<<<< * """Return the full range of offsets, [start, end), for a section. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.Section.getOffsetRange", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Section.pyx":853 * * # FIXME: Hardcoded PETSC_FALSE parameters * def createGlobalSection(self, SF sf) -> Section: # <<<<<<<<<<<<<< * """Create a section describing the global field layout. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_85createGlobalSection(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7Section_84createGlobalSection, "Section.createGlobalSection(self, sf: SF) -> Section\nCreate a section describing the global field layout.\n\n Collective.\n\n The section describes the global field layout using the local section\n and an `SF` describing the section point overlap.\n\n If we have a set of local sections defining the layout of a set of\n local vectors, and also an `SF` to determine which section points are\n shared and the ownership, we can calculate a global section defining\n the parallel data layout, and the associated global vector.\n\n This gives negative sizes and offsets to points not owned by this\n process.\n\n ``includeConstraints`` and ``localOffsets`` parameters of the C API\n are always set to `False`.\n\n Parameters\n ----------\n sf\n The `SF` describing the parallel layout of the section points\n (leaves are unowned local points).\n\n See Also\n --------\n petsc.PetscSectionCreateGlobalSection\n\n \nSource code at petsc4py/PETSc/Section.pyx:853"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_85createGlobalSection(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscSFObject *__pyx_v_sf = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createGlobalSection (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sf,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sf)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 853, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createGlobalSection") < 0)) __PYX_ERR(45, 853, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_sf = ((struct PyPetscSFObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createGlobalSection", 1, 1, 1, __pyx_nargs); __PYX_ERR(45, 853, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Section.createGlobalSection", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sf), __pyx_ptype_8petsc4py_5PETSc_SF, 0, "sf", 0))) __PYX_ERR(45, 853, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_84createGlobalSection(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_sf); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_84createGlobalSection(struct PyPetscSectionObject *__pyx_v_self, struct PyPetscSFObject *__pyx_v_sf) { struct PyPetscSectionObject *__pyx_v_gsec = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createGlobalSection", 1); /* "petsc4py/PETSc/Section.pyx":883 * * """ * cdef Section gsec = Section() # <<<<<<<<<<<<<< * CHKERR( PetscSectionCreateGlobalSection(self.sec,sf.sf,PETSC_FALSE,PETSC_FALSE,&gsec.sec) ) * return gsec */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Section)); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 883, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_gsec = ((struct PyPetscSectionObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Section.pyx":884 * """ * cdef Section gsec = Section() * CHKERR( PetscSectionCreateGlobalSection(self.sec,sf.sf,PETSC_FALSE,PETSC_FALSE,&gsec.sec) ) # <<<<<<<<<<<<<< * return gsec */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionCreateGlobalSection(__pyx_v_self->sec, __pyx_v_sf->sf, PETSC_FALSE, PETSC_FALSE, (&__pyx_v_gsec->sec))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 884, __pyx_L1_error) /* "petsc4py/PETSc/Section.pyx":885 * cdef Section gsec = Section() * CHKERR( PetscSectionCreateGlobalSection(self.sec,sf.sf,PETSC_FALSE,PETSC_FALSE,&gsec.sec) ) * return gsec # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_gsec); __pyx_r = ((PyObject *)__pyx_v_gsec); goto __pyx_L0; /* "petsc4py/PETSc/Section.pyx":853 * * # FIXME: Hardcoded PETSC_FALSE parameters * def createGlobalSection(self, SF sf) -> Section: # <<<<<<<<<<<<<< * """Create a section describing the global field layout. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Section.createGlobalSection", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_gsec); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":282 * property i: * "First logical grid coordinate." * def __get__(self) -> int: # <<<<<<<<<<<<<< * return toInt(self.stencil.i) * def __set__(self, value: int) -> None: */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_10MatStencil_1i_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_10MatStencil_1i_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_10MatStencil_1i___get__(((struct __pyx_obj_8petsc4py_5PETSc_MatStencil *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_10MatStencil_1i___get__(struct __pyx_obj_8petsc4py_5PETSc_MatStencil *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/Mat.pyx":283 * "First logical grid coordinate." * def __get__(self) -> int: * return toInt(self.stencil.i) # <<<<<<<<<<<<<< * def __set__(self, value: int) -> None: * self.stencil.i = asInt(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_self->stencil.i); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":282 * property i: * "First logical grid coordinate." * def __get__(self) -> int: # <<<<<<<<<<<<<< * return toInt(self.stencil.i) * def __set__(self, value: int) -> None: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.MatStencil.i.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":284 * def __get__(self) -> int: * return toInt(self.stencil.i) * def __set__(self, value: int) -> None: # <<<<<<<<<<<<<< * self.stencil.i = asInt(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_10MatStencil_1i_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_10MatStencil_1i_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_10MatStencil_1i_2__set__(((struct __pyx_obj_8petsc4py_5PETSc_MatStencil *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_10MatStencil_1i_2__set__(struct __pyx_obj_8petsc4py_5PETSc_MatStencil *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; PetscInt __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "petsc4py/PETSc/Mat.pyx":285 * return toInt(self.stencil.i) * def __set__(self, value: int) -> None: * self.stencil.i = asInt(value) # <<<<<<<<<<<<<< * * property j: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_value); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(46, 285, __pyx_L1_error) __pyx_v_self->stencil.i = __pyx_t_1; /* "petsc4py/PETSc/Mat.pyx":284 * def __get__(self) -> int: * return toInt(self.stencil.i) * def __set__(self, value: int) -> None: # <<<<<<<<<<<<<< * self.stencil.i = asInt(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.MatStencil.i.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":289 * property j: * "Second logical grid coordinate." * def __get__(self) -> int: # <<<<<<<<<<<<<< * return toInt(self.stencil.j) * def __set__(self, value: int) -> None: */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_10MatStencil_1j_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_10MatStencil_1j_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_10MatStencil_1j___get__(((struct __pyx_obj_8petsc4py_5PETSc_MatStencil *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_10MatStencil_1j___get__(struct __pyx_obj_8petsc4py_5PETSc_MatStencil *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/Mat.pyx":290 * "Second logical grid coordinate." * def __get__(self) -> int: * return toInt(self.stencil.j) # <<<<<<<<<<<<<< * def __set__(self, value: int) -> None: * self.stencil.j = asInt(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_self->stencil.j); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":289 * property j: * "Second logical grid coordinate." * def __get__(self) -> int: # <<<<<<<<<<<<<< * return toInt(self.stencil.j) * def __set__(self, value: int) -> None: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.MatStencil.j.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":291 * def __get__(self) -> int: * return toInt(self.stencil.j) * def __set__(self, value: int) -> None: # <<<<<<<<<<<<<< * self.stencil.j = asInt(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_10MatStencil_1j_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_10MatStencil_1j_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_10MatStencil_1j_2__set__(((struct __pyx_obj_8petsc4py_5PETSc_MatStencil *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_10MatStencil_1j_2__set__(struct __pyx_obj_8petsc4py_5PETSc_MatStencil *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; PetscInt __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "petsc4py/PETSc/Mat.pyx":292 * return toInt(self.stencil.j) * def __set__(self, value: int) -> None: * self.stencil.j = asInt(value) # <<<<<<<<<<<<<< * * property k: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_value); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(46, 292, __pyx_L1_error) __pyx_v_self->stencil.j = __pyx_t_1; /* "petsc4py/PETSc/Mat.pyx":291 * def __get__(self) -> int: * return toInt(self.stencil.j) * def __set__(self, value: int) -> None: # <<<<<<<<<<<<<< * self.stencil.j = asInt(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.MatStencil.j.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":296 * property k: * "Third logical grid coordinate." * def __get__(self) -> int: # <<<<<<<<<<<<<< * return toInt(self.stencil.k) * def __set__(self, value: int) -> None: */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_10MatStencil_1k_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_10MatStencil_1k_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_10MatStencil_1k___get__(((struct __pyx_obj_8petsc4py_5PETSc_MatStencil *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_10MatStencil_1k___get__(struct __pyx_obj_8petsc4py_5PETSc_MatStencil *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/Mat.pyx":297 * "Third logical grid coordinate." * def __get__(self) -> int: * return toInt(self.stencil.k) # <<<<<<<<<<<<<< * def __set__(self, value: int) -> None: * self.stencil.k = asInt(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_self->stencil.k); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":296 * property k: * "Third logical grid coordinate." * def __get__(self) -> int: # <<<<<<<<<<<<<< * return toInt(self.stencil.k) * def __set__(self, value: int) -> None: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.MatStencil.k.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":298 * def __get__(self) -> int: * return toInt(self.stencil.k) * def __set__(self, value: int) -> None: # <<<<<<<<<<<<<< * self.stencil.k = asInt(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_10MatStencil_1k_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_10MatStencil_1k_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_10MatStencil_1k_2__set__(((struct __pyx_obj_8petsc4py_5PETSc_MatStencil *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_10MatStencil_1k_2__set__(struct __pyx_obj_8petsc4py_5PETSc_MatStencil *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; PetscInt __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "petsc4py/PETSc/Mat.pyx":299 * return toInt(self.stencil.k) * def __set__(self, value: int) -> None: * self.stencil.k = asInt(value) # <<<<<<<<<<<<<< * * property c: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_value); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(46, 299, __pyx_L1_error) __pyx_v_self->stencil.k = __pyx_t_1; /* "petsc4py/PETSc/Mat.pyx":298 * def __get__(self) -> int: * return toInt(self.stencil.k) * def __set__(self, value: int) -> None: # <<<<<<<<<<<<<< * self.stencil.k = asInt(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.MatStencil.k.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":303 * property c: * "Field component." * def __get__(self) -> int: # <<<<<<<<<<<<<< * return toInt(self.stencil.c) * def __set__(self, value: int) -> None: */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_10MatStencil_1c_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_10MatStencil_1c_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_10MatStencil_1c___get__(((struct __pyx_obj_8petsc4py_5PETSc_MatStencil *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_10MatStencil_1c___get__(struct __pyx_obj_8petsc4py_5PETSc_MatStencil *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/Mat.pyx":304 * "Field component." * def __get__(self) -> int: * return toInt(self.stencil.c) # <<<<<<<<<<<<<< * def __set__(self, value: int) -> None: * self.stencil.c = asInt(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_self->stencil.c); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":303 * property c: * "Field component." * def __get__(self) -> int: # <<<<<<<<<<<<<< * return toInt(self.stencil.c) * def __set__(self, value: int) -> None: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.MatStencil.c.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":305 * def __get__(self) -> int: * return toInt(self.stencil.c) * def __set__(self, value: int) -> None: # <<<<<<<<<<<<<< * self.stencil.c = asInt(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_10MatStencil_1c_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_10MatStencil_1c_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_10MatStencil_1c_2__set__(((struct __pyx_obj_8petsc4py_5PETSc_MatStencil *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_10MatStencil_1c_2__set__(struct __pyx_obj_8petsc4py_5PETSc_MatStencil *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; PetscInt __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "petsc4py/PETSc/Mat.pyx":306 * return toInt(self.stencil.c) * def __set__(self, value: int) -> None: * self.stencil.c = asInt(value) # <<<<<<<<<<<<<< * * property index: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_value); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(46, 306, __pyx_L1_error) __pyx_v_self->stencil.c = __pyx_t_1; /* "petsc4py/PETSc/Mat.pyx":305 * def __get__(self) -> int: * return toInt(self.stencil.c) * def __set__(self, value: int) -> None: # <<<<<<<<<<<<<< * self.stencil.c = asInt(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.MatStencil.c.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":310 * property index: * "Logical grid coordinates ``(i, j, k)``." * def __get__(self) -> tuple[int, int, int]: # <<<<<<<<<<<<<< * cdef PetscMatStencil *s = &self.stencil * return toInt(s.i), toInt(s.j), toInt(s.k) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_10MatStencil_5index_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_10MatStencil_5index_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_10MatStencil_5index___get__(((struct __pyx_obj_8petsc4py_5PETSc_MatStencil *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_10MatStencil_5index___get__(struct __pyx_obj_8petsc4py_5PETSc_MatStencil *__pyx_v_self) { MatStencil *__pyx_v_s; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/Mat.pyx":311 * "Logical grid coordinates ``(i, j, k)``." * def __get__(self) -> tuple[int, int, int]: * cdef PetscMatStencil *s = &self.stencil # <<<<<<<<<<<<<< * return toInt(s.i), toInt(s.j), toInt(s.k) * def __set__(self, value: Sequence[int]) -> None: */ __pyx_v_s = (&__pyx_v_self->stencil); /* "petsc4py/PETSc/Mat.pyx":312 * def __get__(self) -> tuple[int, int, int]: * cdef PetscMatStencil *s = &self.stencil * return toInt(s.i), toInt(s.j), toInt(s.k) # <<<<<<<<<<<<<< * def __set__(self, value: Sequence[int]) -> None: * cdef PetscMatStencil *s = &self.stencil */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_s->i); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_s->j); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_s->k); if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1)) __PYX_ERR(46, 312, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2)) __PYX_ERR(46, 312, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3)) __PYX_ERR(46, 312, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":310 * property index: * "Logical grid coordinates ``(i, j, k)``." * def __get__(self) -> tuple[int, int, int]: # <<<<<<<<<<<<<< * cdef PetscMatStencil *s = &self.stencil * return toInt(s.i), toInt(s.j), toInt(s.k) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.MatStencil.index.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":313 * cdef PetscMatStencil *s = &self.stencil * return toInt(s.i), toInt(s.j), toInt(s.k) * def __set__(self, value: Sequence[int]) -> None: # <<<<<<<<<<<<<< * cdef PetscMatStencil *s = &self.stencil * s.i = s.j = s.k = 0 */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_10MatStencil_5index_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_10MatStencil_5index_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_10MatStencil_5index_2__set__(((struct __pyx_obj_8petsc4py_5PETSc_MatStencil *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_10MatStencil_5index_2__set__(struct __pyx_obj_8petsc4py_5PETSc_MatStencil *__pyx_v_self, PyObject *__pyx_v_value) { MatStencil *__pyx_v_s; int __pyx_r; PetscInt __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "petsc4py/PETSc/Mat.pyx":314 * return toInt(s.i), toInt(s.j), toInt(s.k) * def __set__(self, value: Sequence[int]) -> None: * cdef PetscMatStencil *s = &self.stencil # <<<<<<<<<<<<<< * s.i = s.j = s.k = 0 * asDims(value, &s.i, &s.j, &s.k) */ __pyx_v_s = (&__pyx_v_self->stencil); /* "petsc4py/PETSc/Mat.pyx":315 * def __set__(self, value: Sequence[int]) -> None: * cdef PetscMatStencil *s = &self.stencil * s.i = s.j = s.k = 0 # <<<<<<<<<<<<<< * asDims(value, &s.i, &s.j, &s.k) * */ __pyx_v_s->i = 0; __pyx_v_s->j = 0; __pyx_v_s->k = 0; /* "petsc4py/PETSc/Mat.pyx":316 * cdef PetscMatStencil *s = &self.stencil * s.i = s.j = s.k = 0 * asDims(value, &s.i, &s.j, &s.k) # <<<<<<<<<<<<<< * * property field: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asDims(__pyx_v_value, (&__pyx_v_s->i), (&__pyx_v_s->j), (&__pyx_v_s->k)); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(46, 316, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":313 * cdef PetscMatStencil *s = &self.stencil * return toInt(s.i), toInt(s.j), toInt(s.k) * def __set__(self, value: Sequence[int]) -> None: # <<<<<<<<<<<<<< * cdef PetscMatStencil *s = &self.stencil * s.i = s.j = s.k = 0 */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.MatStencil.index.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":320 * property field: * "Field component." * def __get__(self) -> int: # <<<<<<<<<<<<<< * cdef PetscMatStencil *s = &self.stencil * return toInt(s.c) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_10MatStencil_5field_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_10MatStencil_5field_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_10MatStencil_5field___get__(((struct __pyx_obj_8petsc4py_5PETSc_MatStencil *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_10MatStencil_5field___get__(struct __pyx_obj_8petsc4py_5PETSc_MatStencil *__pyx_v_self) { MatStencil *__pyx_v_s; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/Mat.pyx":321 * "Field component." * def __get__(self) -> int: * cdef PetscMatStencil *s = &self.stencil # <<<<<<<<<<<<<< * return toInt(s.c) * def __set__(self, value: int) -> None: */ __pyx_v_s = (&__pyx_v_self->stencil); /* "petsc4py/PETSc/Mat.pyx":322 * def __get__(self) -> int: * cdef PetscMatStencil *s = &self.stencil * return toInt(s.c) # <<<<<<<<<<<<<< * def __set__(self, value: int) -> None: * cdef PetscMatStencil *s = &self.stencil */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_s->c); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":320 * property field: * "Field component." * def __get__(self) -> int: # <<<<<<<<<<<<<< * cdef PetscMatStencil *s = &self.stencil * return toInt(s.c) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.MatStencil.field.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":323 * cdef PetscMatStencil *s = &self.stencil * return toInt(s.c) * def __set__(self, value: int) -> None: # <<<<<<<<<<<<<< * cdef PetscMatStencil *s = &self.stencil * s.c = asInt(value) */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_10MatStencil_5field_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_10MatStencil_5field_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_10MatStencil_5field_2__set__(((struct __pyx_obj_8petsc4py_5PETSc_MatStencil *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_10MatStencil_5field_2__set__(struct __pyx_obj_8petsc4py_5PETSc_MatStencil *__pyx_v_self, PyObject *__pyx_v_value) { MatStencil *__pyx_v_s; int __pyx_r; PetscInt __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "petsc4py/PETSc/Mat.pyx":324 * return toInt(s.c) * def __set__(self, value: int) -> None: * cdef PetscMatStencil *s = &self.stencil # <<<<<<<<<<<<<< * s.c = asInt(value) * */ __pyx_v_s = (&__pyx_v_self->stencil); /* "petsc4py/PETSc/Mat.pyx":325 * def __set__(self, value: int) -> None: * cdef PetscMatStencil *s = &self.stencil * s.c = asInt(value) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_value); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(46, 325, __pyx_L1_error) __pyx_v_s->c = __pyx_t_1; /* "petsc4py/PETSc/Mat.pyx":323 * cdef PetscMatStencil *s = &self.stencil * return toInt(s.c) * def __set__(self, value: int) -> None: # <<<<<<<<<<<<<< * cdef PetscMatStencil *s = &self.stencil * s.c = asInt(value) */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.MatStencil.field.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":352 * # * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.mat * self.mat = NULL */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_3Mat_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_3Mat_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat___cinit__(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_3Mat___cinit__(struct PyPetscMatObject *__pyx_v_self) { int __pyx_r; /* "petsc4py/PETSc/Mat.pyx":353 * * def __cinit__(self): * self.obj = &self.mat # <<<<<<<<<<<<<< * self.mat = NULL * */ __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->mat)); /* "petsc4py/PETSc/Mat.pyx":354 * def __cinit__(self): * self.obj = &self.mat * self.mat = NULL # <<<<<<<<<<<<<< * * # unary operations */ __pyx_v_self->mat = NULL; /* "petsc4py/PETSc/Mat.pyx":352 * # * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.mat * self.mat = NULL */ /* function exit code */ __pyx_r = 0; return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":358 * # unary operations * * def __pos__(self): # <<<<<<<<<<<<<< * return mat_pos(self) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_3__pos__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_3__pos__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pos__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_2__pos__(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_2__pos__(struct PyPetscMatObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__pos__", 1); /* "petsc4py/PETSc/Mat.pyx":359 * * def __pos__(self): * return mat_pos(self) # <<<<<<<<<<<<<< * * def __neg__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_pos(__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":358 * # unary operations * * def __pos__(self): # <<<<<<<<<<<<<< * return mat_pos(self) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.__pos__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":361 * return mat_pos(self) * * def __neg__(self): # <<<<<<<<<<<<<< * return mat_neg(self) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_5__neg__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_5__neg__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__neg__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_4__neg__(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_4__neg__(struct PyPetscMatObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__neg__", 1); /* "petsc4py/PETSc/Mat.pyx":362 * * def __neg__(self): * return mat_neg(self) # <<<<<<<<<<<<<< * * # inplace binary operations */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_neg(__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":361 * return mat_pos(self) * * def __neg__(self): # <<<<<<<<<<<<<< * return mat_neg(self) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.__neg__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":366 * # inplace binary operations * * def __iadd__(self, other): # <<<<<<<<<<<<<< * return mat_iadd(self, other) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_7__iadd__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_7__iadd__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iadd__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_6__iadd__(((struct PyPetscMatObject *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_6__iadd__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__iadd__", 1); /* "petsc4py/PETSc/Mat.pyx":367 * * def __iadd__(self, other): * return mat_iadd(self, other) # <<<<<<<<<<<<<< * * def __isub__(self, other): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_iadd(__pyx_v_self, __pyx_v_other)); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":366 * # inplace binary operations * * def __iadd__(self, other): # <<<<<<<<<<<<<< * return mat_iadd(self, other) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.__iadd__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":369 * return mat_iadd(self, other) * * def __isub__(self, other): # <<<<<<<<<<<<<< * return mat_isub(self, other) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_9__isub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_9__isub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__isub__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_8__isub__(((struct PyPetscMatObject *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_8__isub__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__isub__", 1); /* "petsc4py/PETSc/Mat.pyx":370 * * def __isub__(self, other): * return mat_isub(self, other) # <<<<<<<<<<<<<< * * def __imul__(self, other): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_isub(__pyx_v_self, __pyx_v_other)); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 370, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":369 * return mat_iadd(self, other) * * def __isub__(self, other): # <<<<<<<<<<<<<< * return mat_isub(self, other) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.__isub__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":372 * return mat_isub(self, other) * * def __imul__(self, other): # <<<<<<<<<<<<<< * return mat_imul(self, other) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_11__imul__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_11__imul__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__imul__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_10__imul__(((struct PyPetscMatObject *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_10__imul__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__imul__", 1); /* "petsc4py/PETSc/Mat.pyx":373 * * def __imul__(self, other): * return mat_imul(self, other) # <<<<<<<<<<<<<< * * def __idiv__(self, other): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_imul(__pyx_v_self, __pyx_v_other)); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 373, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":372 * return mat_isub(self, other) * * def __imul__(self, other): # <<<<<<<<<<<<<< * return mat_imul(self, other) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.__imul__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":375 * return mat_imul(self, other) * * def __idiv__(self, other): # <<<<<<<<<<<<<< * return mat_idiv(self, other) * */ /* Python wrapper */ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_13__idiv__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_13__idiv__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__idiv__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_12__idiv__(((struct PyPetscMatObject *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } #endif /*!(#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000))*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_12__idiv__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__idiv__", 1); /* "petsc4py/PETSc/Mat.pyx":376 * * def __idiv__(self, other): * return mat_idiv(self, other) # <<<<<<<<<<<<<< * * def __itruediv__(self, other): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_idiv(__pyx_v_self, __pyx_v_other)); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":375 * return mat_imul(self, other) * * def __idiv__(self, other): # <<<<<<<<<<<<<< * return mat_idiv(self, other) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.__idiv__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } #endif /*!(#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000))*/ /* "petsc4py/PETSc/Mat.pyx":378 * return mat_idiv(self, other) * * def __itruediv__(self, other): # <<<<<<<<<<<<<< * return mat_idiv(self, other) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_15__itruediv__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_15__itruediv__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__itruediv__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_14__itruediv__(((struct PyPetscMatObject *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_14__itruediv__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__itruediv__", 1); /* "petsc4py/PETSc/Mat.pyx":379 * * def __itruediv__(self, other): * return mat_idiv(self, other) # <<<<<<<<<<<<<< * * # binary operations */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_idiv(__pyx_v_self, __pyx_v_other)); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":378 * return mat_idiv(self, other) * * def __itruediv__(self, other): # <<<<<<<<<<<<<< * return mat_idiv(self, other) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.__itruediv__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":383 * # binary operations * * def __add__(self, other): # <<<<<<<<<<<<<< * return mat_add(self, other) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_17__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_17__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__add__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_16__add__(((struct PyPetscMatObject *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_16__add__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__add__", 1); /* "petsc4py/PETSc/Mat.pyx":384 * * def __add__(self, other): * return mat_add(self, other) # <<<<<<<<<<<<<< * * def __radd__(self, other): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_add(__pyx_v_self, __pyx_v_other)); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 384, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":383 * # binary operations * * def __add__(self, other): # <<<<<<<<<<<<<< * return mat_add(self, other) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.__add__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":386 * return mat_add(self, other) * * def __radd__(self, other): # <<<<<<<<<<<<<< * return mat_radd(self, other) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_19__radd__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_19__radd__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__radd__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_18__radd__(((struct PyPetscMatObject *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_18__radd__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__radd__", 1); /* "petsc4py/PETSc/Mat.pyx":387 * * def __radd__(self, other): * return mat_radd(self, other) # <<<<<<<<<<<<<< * * def __sub__(self, other): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_radd(__pyx_v_self, __pyx_v_other)); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":386 * return mat_add(self, other) * * def __radd__(self, other): # <<<<<<<<<<<<<< * return mat_radd(self, other) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.__radd__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":389 * return mat_radd(self, other) * * def __sub__(self, other): # <<<<<<<<<<<<<< * return mat_sub(self, other) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_21__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_21__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__sub__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_20__sub__(((struct PyPetscMatObject *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_20__sub__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__sub__", 1); /* "petsc4py/PETSc/Mat.pyx":390 * * def __sub__(self, other): * return mat_sub(self, other) # <<<<<<<<<<<<<< * * def __rsub__(self, other): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_sub(__pyx_v_self, __pyx_v_other)); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":389 * return mat_radd(self, other) * * def __sub__(self, other): # <<<<<<<<<<<<<< * return mat_sub(self, other) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.__sub__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":392 * return mat_sub(self, other) * * def __rsub__(self, other): # <<<<<<<<<<<<<< * return mat_rsub(self, other) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_23__rsub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_23__rsub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__rsub__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_22__rsub__(((struct PyPetscMatObject *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_22__rsub__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__rsub__", 1); /* "petsc4py/PETSc/Mat.pyx":393 * * def __rsub__(self, other): * return mat_rsub(self, other) # <<<<<<<<<<<<<< * * def __mul__(self, other): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_rsub(__pyx_v_self, __pyx_v_other)); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":392 * return mat_sub(self, other) * * def __rsub__(self, other): # <<<<<<<<<<<<<< * return mat_rsub(self, other) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.__rsub__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":395 * return mat_rsub(self, other) * * def __mul__(self, other): # <<<<<<<<<<<<<< * return mat_mul(self, other) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_25__mul__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_25__mul__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__mul__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_24__mul__(((struct PyPetscMatObject *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_24__mul__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__mul__", 1); /* "petsc4py/PETSc/Mat.pyx":396 * * def __mul__(self, other): * return mat_mul(self, other) # <<<<<<<<<<<<<< * * def __rmul__(self, other): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_mat_mul(__pyx_v_self, __pyx_v_other); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 396, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":395 * return mat_rsub(self, other) * * def __mul__(self, other): # <<<<<<<<<<<<<< * return mat_mul(self, other) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.__mul__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":398 * return mat_mul(self, other) * * def __rmul__(self, other): # <<<<<<<<<<<<<< * return mat_rmul(self, other) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_27__rmul__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_27__rmul__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__rmul__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_26__rmul__(((struct PyPetscMatObject *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_26__rmul__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__rmul__", 1); /* "petsc4py/PETSc/Mat.pyx":399 * * def __rmul__(self, other): * return mat_rmul(self, other) # <<<<<<<<<<<<<< * * def __div__(self, other): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_rmul(__pyx_v_self, __pyx_v_other)); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":398 * return mat_mul(self, other) * * def __rmul__(self, other): # <<<<<<<<<<<<<< * return mat_rmul(self, other) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.__rmul__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":401 * return mat_rmul(self, other) * * def __div__(self, other): # <<<<<<<<<<<<<< * return mat_div(self, other) * */ /* Python wrapper */ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_29__div__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_29__div__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__div__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_28__div__(((struct PyPetscMatObject *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } #endif /*!(#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000))*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_28__div__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__div__", 1); /* "petsc4py/PETSc/Mat.pyx":402 * * def __div__(self, other): * return mat_div(self, other) # <<<<<<<<<<<<<< * * def __rdiv__(self, other): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_div(__pyx_v_self, __pyx_v_other)); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 402, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":401 * return mat_rmul(self, other) * * def __div__(self, other): # <<<<<<<<<<<<<< * return mat_div(self, other) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.__div__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } #endif /*!(#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000))*/ /* "petsc4py/PETSc/Mat.pyx":404 * return mat_div(self, other) * * def __rdiv__(self, other): # <<<<<<<<<<<<<< * return mat_rdiv(self, other) * */ /* Python wrapper */ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_31__rdiv__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_31__rdiv__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__rdiv__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_30__rdiv__(((struct PyPetscMatObject *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } #endif /*!(#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000))*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_30__rdiv__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__rdiv__", 1); /* "petsc4py/PETSc/Mat.pyx":405 * * def __rdiv__(self, other): * return mat_rdiv(self, other) # <<<<<<<<<<<<<< * * def __truediv__(self, other): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_rdiv(__pyx_v_self, __pyx_v_other)); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":404 * return mat_div(self, other) * * def __rdiv__(self, other): # <<<<<<<<<<<<<< * return mat_rdiv(self, other) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.__rdiv__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } #endif /*!(#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000))*/ /* "petsc4py/PETSc/Mat.pyx":407 * return mat_rdiv(self, other) * * def __truediv__(self, other): # <<<<<<<<<<<<<< * return mat_div(self, other) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_33__truediv__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_33__truediv__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__truediv__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_32__truediv__(((struct PyPetscMatObject *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_32__truediv__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__truediv__", 1); /* "petsc4py/PETSc/Mat.pyx":408 * * def __truediv__(self, other): * return mat_div(self, other) # <<<<<<<<<<<<<< * * def __rtruediv__(self, other): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_div(__pyx_v_self, __pyx_v_other)); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":407 * return mat_rdiv(self, other) * * def __truediv__(self, other): # <<<<<<<<<<<<<< * return mat_div(self, other) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.__truediv__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":410 * return mat_div(self, other) * * def __rtruediv__(self, other): # <<<<<<<<<<<<<< * return mat_rdiv(self, other) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_35__rtruediv__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_35__rtruediv__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__rtruediv__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_34__rtruediv__(((struct PyPetscMatObject *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_34__rtruediv__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__rtruediv__", 1); /* "petsc4py/PETSc/Mat.pyx":411 * * def __rtruediv__(self, other): * return mat_rdiv(self, other) # <<<<<<<<<<<<<< * * def __matmul__(self, other): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_rdiv(__pyx_v_self, __pyx_v_other)); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":410 * return mat_div(self, other) * * def __rtruediv__(self, other): # <<<<<<<<<<<<<< * return mat_rdiv(self, other) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.__rtruediv__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":413 * return mat_rdiv(self, other) * * def __matmul__(self, other): # <<<<<<<<<<<<<< * return mat_matmul(self, other) * */ /* Python wrapper */ #if PY_VERSION_HEX >= 0x03050000 static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_37__matmul__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_37__matmul__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__matmul__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_36__matmul__(((struct PyPetscMatObject *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } #endif /*!(#if PY_VERSION_HEX >= 0x03050000)*/ #if PY_VERSION_HEX >= 0x03050000 static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_36__matmul__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__matmul__", 1); /* "petsc4py/PETSc/Mat.pyx":414 * * def __matmul__(self, other): * return mat_matmul(self, other) # <<<<<<<<<<<<<< * * # */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_mat_matmul(__pyx_v_self, __pyx_v_other); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":413 * return mat_rdiv(self, other) * * def __matmul__(self, other): # <<<<<<<<<<<<<< * return mat_matmul(self, other) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.__matmul__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } #endif /*!(#if PY_VERSION_HEX >= 0x03050000)*/ /* "petsc4py/PETSc/Mat.pyx":418 * # * * def __getitem__(self, ij): # <<<<<<<<<<<<<< * return mat_getitem(self, ij) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_39__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_ij); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_39__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_ij) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_38__getitem__(((struct PyPetscMatObject *)__pyx_v_self), ((PyObject *)__pyx_v_ij)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_38__getitem__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_ij) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getitem__", 1); /* "petsc4py/PETSc/Mat.pyx":419 * * def __getitem__(self, ij): * return mat_getitem(self, ij) # <<<<<<<<<<<<<< * * def __setitem__(self, ij, v): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_mat_getitem(__pyx_v_self, __pyx_v_ij); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 419, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":418 * # * * def __getitem__(self, ij): # <<<<<<<<<<<<<< * return mat_getitem(self, ij) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":421 * return mat_getitem(self, ij) * * def __setitem__(self, ij, v): # <<<<<<<<<<<<<< * mat_setitem(self, ij, v) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_3Mat_41__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_ij, PyObject *__pyx_v_v); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_3Mat_41__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_ij, PyObject *__pyx_v_v) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_40__setitem__(((struct PyPetscMatObject *)__pyx_v_self), ((PyObject *)__pyx_v_ij), ((PyObject *)__pyx_v_v)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_3Mat_40__setitem__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_ij, PyObject *__pyx_v_v) { int __pyx_r; PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "petsc4py/PETSc/Mat.pyx":422 * * def __setitem__(self, ij, v): * mat_setitem(self, ij, v) # <<<<<<<<<<<<<< * * def __call__(self, x, y=None): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_mat_setitem(__pyx_v_self, __pyx_v_ij, __pyx_v_v); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 422, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":421 * return mat_getitem(self, ij) * * def __setitem__(self, ij, v): # <<<<<<<<<<<<<< * mat_setitem(self, ij, v) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":424 * mat_setitem(self, ij, v) * * def __call__(self, x, y=None): # <<<<<<<<<<<<<< * if y is None: * y = self.createVecLeft() */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_43__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_43__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_x = 0; PyObject *__pyx_v_y = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0}; values[1] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 424, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y); if (value) { values[1] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 424, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__call__") < 0)) __PYX_ERR(46, 424, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_x = values[0]; __pyx_v_y = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__call__", 0, 1, 2, __pyx_nargs); __PYX_ERR(46, 424, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_42__call__(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_x, __pyx_v_y); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_42__call__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); __Pyx_INCREF(__pyx_v_y); /* "petsc4py/PETSc/Mat.pyx":425 * * def __call__(self, x, y=None): * if y is None: # <<<<<<<<<<<<<< * y = self.createVecLeft() * self.mult(x, y) */ __pyx_t_1 = (__pyx_v_y == Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/Mat.pyx":426 * def __call__(self, x, y=None): * if y is None: * y = self.createVecLeft() # <<<<<<<<<<<<<< * self.mult(x, y) * return y */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_createVecLeft); if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 426, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 426, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF_SET(__pyx_v_y, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/Mat.pyx":425 * * def __call__(self, x, y=None): * if y is None: # <<<<<<<<<<<<<< * y = self.createVecLeft() * self.mult(x, y) */ } /* "petsc4py/PETSc/Mat.pyx":427 * if y is None: * y = self.createVecLeft() * self.mult(x, y) # <<<<<<<<<<<<<< * return y * # */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mult); if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_x, __pyx_v_y}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/Mat.pyx":428 * y = self.createVecLeft() * self.mult(x, y) * return y # <<<<<<<<<<<<<< * # * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_y); __pyx_r = __pyx_v_y; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":424 * mat_setitem(self, ij, v) * * def __call__(self, x, y=None): # <<<<<<<<<<<<<< * if y is None: * y = self.createVecLeft() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.Mat.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_y); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":431 * # * * def view(self, Viewer viewer=None) -> None: # <<<<<<<<<<<<<< * """View the matrix. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_45view(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_44view, "Mat.view(self, viewer: Viewer | None = None) -> None\nView the matrix.\n\n Collective.\n\n Parameters\n ----------\n viewer\n A `Viewer` instance or `None` for the default viewer.\n\n Notes\n -----\n Viewers with type `Viewer.Type.ASCII` are only recommended for small\n matrices on small numbers of processes. Larger matrices should use a\n binary format like `Viewer.Type.BINARY`.\n\n See Also\n --------\n load, Viewer, petsc.MatView\n\n \nSource code at petsc4py/PETSc/Mat.pyx:431"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_45view(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscViewerObject *__pyx_v_viewer = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("view (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscViewerObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_viewer); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 431, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "view") < 0)) __PYX_ERR(46, 431, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, __pyx_nargs); __PYX_ERR(46, 431, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(46, 431, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_44view(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_viewer); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_44view(struct PyPetscMatObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer) { PetscViewer __pyx_v_vwr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscViewer __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("view", 1); /* "petsc4py/PETSc/Mat.pyx":452 * * """ * cdef PetscViewer vwr = NULL # <<<<<<<<<<<<<< * if viewer is not None: vwr = viewer.vwr * CHKERR( MatView(self.mat, vwr) ) */ __pyx_v_vwr = NULL; /* "petsc4py/PETSc/Mat.pyx":453 * """ * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr # <<<<<<<<<<<<<< * CHKERR( MatView(self.mat, vwr) ) * */ __pyx_t_1 = (((PyObject *)__pyx_v_viewer) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_viewer->vwr; __pyx_v_vwr = __pyx_t_2; } /* "petsc4py/PETSc/Mat.pyx":454 * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr * CHKERR( MatView(self.mat, vwr) ) # <<<<<<<<<<<<<< * * def destroy(self) -> Self: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatView(__pyx_v_self->mat, __pyx_v_vwr)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 454, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":431 * # * * def view(self, Viewer viewer=None) -> None: # <<<<<<<<<<<<<< * """View the matrix. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":456 * CHKERR( MatView(self.mat, vwr) ) * * def destroy(self) -> Self: # <<<<<<<<<<<<<< * """Destroy the matrix. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_47destroy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_46destroy, "Mat.destroy(self) -> Self\nDestroy the matrix.\n\n Collective.\n\n See Also\n --------\n create, petsc.MatDestroy\n\n \nSource code at petsc4py/PETSc/Mat.pyx:456"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_47destroy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("destroy (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_46destroy(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_46destroy(struct PyPetscMatObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("destroy", 1); /* "petsc4py/PETSc/Mat.pyx":466 * * """ * CHKERR( MatDestroy(&self.mat) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDestroy((&__pyx_v_self->mat))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 466, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":467 * """ * CHKERR( MatDestroy(&self.mat) ) * return self # <<<<<<<<<<<<<< * * def create(self, comm: Comm | None = None) -> Self: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":456 * CHKERR( MatView(self.mat, vwr) ) * * def destroy(self) -> Self: # <<<<<<<<<<<<<< * """Destroy the matrix. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":469 * return self * * def create(self, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Create the matrix. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_49create(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_48create, "Mat.create(self, comm: Comm | None = None) -> Self\nCreate the matrix.\n\n Collective.\n\n Once created, the user should call `setType` or\n `setFromOptions` before using the matrix. Alternatively, specific\n creation routines such as `createAIJ` or\n `createBAIJ` can be used.\n\n Parameters\n ----------\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n destroy, petsc.MatCreate\n\n \nSource code at petsc4py/PETSc/Mat.pyx:469"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_49create(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 469, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "create") < 0)) __PYX_ERR(46, 469, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_comm = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, __pyx_nargs); __PYX_ERR(46, 469, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_48create(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_comm); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_48create(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; Mat __pyx_v_newmat; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create", 1); /* "petsc4py/PETSc/Mat.pyx":489 * * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscMat newmat = NULL * CHKERR( MatCreate(ccomm, &newmat) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(46, 489, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/Mat.pyx":490 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscMat newmat = NULL # <<<<<<<<<<<<<< * CHKERR( MatCreate(ccomm, &newmat) ) * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat */ __pyx_v_newmat = NULL; /* "petsc4py/PETSc/Mat.pyx":491 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscMat newmat = NULL * CHKERR( MatCreate(ccomm, &newmat) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat * return self */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreate(__pyx_v_ccomm, (&__pyx_v_newmat))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 491, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":492 * cdef PetscMat newmat = NULL * CHKERR( MatCreate(ccomm, &newmat) ) * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 492, __pyx_L1_error) __pyx_v_self->mat = __pyx_v_newmat; /* "petsc4py/PETSc/Mat.pyx":493 * CHKERR( MatCreate(ccomm, &newmat) ) * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat * return self # <<<<<<<<<<<<<< * * def setType(self, mat_type: Type | str) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":469 * return self * * def create(self, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Create the matrix. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":495 * return self * * def setType(self, mat_type: Type | str) -> None: # <<<<<<<<<<<<<< * """Set the matrix type. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_51setType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_50setType, "Mat.setType(self, mat_type: Type | str) -> None\nSet the matrix type.\n\n Collective.\n\n Parameters\n ----------\n mat_type\n The matrix type.\n\n See Also\n --------\n create, getType, petsc.MatSetType\n\n \nSource code at petsc4py/PETSc/Mat.pyx:495"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_51setType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_mat_type = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat_type,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mat_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 495, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setType") < 0)) __PYX_ERR(46, 495, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_mat_type = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 495, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_50setType(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_mat_type); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_50setType(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_mat_type) { MatType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setType", 0); __Pyx_INCREF(__pyx_v_mat_type); /* "petsc4py/PETSc/Mat.pyx":510 * * """ * cdef PetscMatType cval = NULL # <<<<<<<<<<<<<< * mat_type = str2bytes(mat_type, &cval) * CHKERR( MatSetType(self.mat, cval) ) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/Mat.pyx":511 * """ * cdef PetscMatType cval = NULL * mat_type = str2bytes(mat_type, &cval) # <<<<<<<<<<<<<< * CHKERR( MatSetType(self.mat, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_mat_type, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 511, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_mat_type, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Mat.pyx":512 * cdef PetscMatType cval = NULL * mat_type = str2bytes(mat_type, &cval) * CHKERR( MatSetType(self.mat, cval) ) # <<<<<<<<<<<<<< * * def setSizes( */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSetType(__pyx_v_self->mat, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 512, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":495 * return self * * def setType(self, mat_type: Type | str) -> None: # <<<<<<<<<<<<<< * """Set the matrix type. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_mat_type); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":514 * CHKERR( MatSetType(self.mat, cval) ) * * def setSizes( # <<<<<<<<<<<<<< * self, * size: MatSizeSpec, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_53setSizes(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_52setSizes, "Mat.setSizes(self, size: MatSizeSpec, bsize: MatBlockSizeSpec | None = None) -> None\nSet the local, global and block sizes.\n\n Collective.\n\n Parameters\n ----------\n size\n Matrix size.\n bsize\n Matrix block size. If `None`, a block size of ``1`` is set.\n\n Examples\n --------\n Create a `Mat` with ``n`` rows and columns and the same local and\n global sizes.\n\n >>> mat = PETSc.Mat().create()\n >>> mat.setFromOptions()\n >>> mat.setSizes(n)\n\n Create a `Mat` with ``nr`` rows, ``nc`` columns and the same local and\n global sizes.\n\n >>> mat = PETSc.Mat().create()\n >>> mat.setFromOptions()\n >>> mat.setSizes([nr, nc])\n\n Create a `Mat` with ``nrl`` local rows, ``nrg`` global rows, ``ncl``\n local columns and ``ncg`` global columns.\n\n >>> mat = PETSc.Mat().create()\n >>> mat.setFromOptions()\n >>> mat.setSizes([[nrl, nrg], [ncl, ncg]])\n\n See Also\n --------\n setBlockSize, setBlockSizes, petsc.MatSetSizes, petsc.MatSetBlockSize\n petsc.MatSetBlockSizes\n\n \nSource code at petsc4py/PETSc/Mat.pyx:514"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_53setSizes(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_size = 0; PyObject *__pyx_v_bsize = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setSizes (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_bsize,0}; /* "petsc4py/PETSc/Mat.pyx":517 * self, * size: MatSizeSpec, * bsize: MatBlockSizeSpec | None = None, # <<<<<<<<<<<<<< * ) -> None: * """Set the local, global and block sizes. */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 514, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_bsize); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 514, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setSizes") < 0)) __PYX_ERR(46, 514, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_size = values[0]; __pyx_v_bsize = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setSizes", 0, 1, 2, __pyx_nargs); __PYX_ERR(46, 514, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.setSizes", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_52setSizes(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_size, __pyx_v_bsize); /* "petsc4py/PETSc/Mat.pyx":514 * CHKERR( MatSetType(self.mat, cval) ) * * def setSizes( # <<<<<<<<<<<<<< * self, * size: MatSizeSpec, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_52setSizes(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize) { PetscInt __pyx_v_rbs; PetscInt __pyx_v_cbs; PetscInt __pyx_v_m; PetscInt __pyx_v_n; PetscInt __pyx_v_M; PetscInt __pyx_v_N; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setSizes", 1); /* "petsc4py/PETSc/Mat.pyx":559 * * """ * cdef PetscInt rbs = 0, cbs = 0, m = 0, n = 0, M = 0, N = 0 # <<<<<<<<<<<<<< * Mat_Sizes(size, bsize, &rbs, &cbs, &m, &n, &M, &N) * CHKERR( MatSetSizes(self.mat, m, n, M, N) ) */ __pyx_v_rbs = 0; __pyx_v_cbs = 0; __pyx_v_m = 0; __pyx_v_n = 0; __pyx_v_M = 0; __pyx_v_N = 0; /* "petsc4py/PETSc/Mat.pyx":560 * """ * cdef PetscInt rbs = 0, cbs = 0, m = 0, n = 0, M = 0, N = 0 * Mat_Sizes(size, bsize, &rbs, &cbs, &m, &n, &M, &N) # <<<<<<<<<<<<<< * CHKERR( MatSetSizes(self.mat, m, n, M, N) ) * if rbs != PETSC_DECIDE: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_Mat_Sizes(__pyx_v_size, __pyx_v_bsize, (&__pyx_v_rbs), (&__pyx_v_cbs), (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_M), (&__pyx_v_N)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 560, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":561 * cdef PetscInt rbs = 0, cbs = 0, m = 0, n = 0, M = 0, N = 0 * Mat_Sizes(size, bsize, &rbs, &cbs, &m, &n, &M, &N) * CHKERR( MatSetSizes(self.mat, m, n, M, N) ) # <<<<<<<<<<<<<< * if rbs != PETSC_DECIDE: * if cbs != PETSC_DECIDE: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSetSizes(__pyx_v_self->mat, __pyx_v_m, __pyx_v_n, __pyx_v_M, __pyx_v_N)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 561, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":562 * Mat_Sizes(size, bsize, &rbs, &cbs, &m, &n, &M, &N) * CHKERR( MatSetSizes(self.mat, m, n, M, N) ) * if rbs != PETSC_DECIDE: # <<<<<<<<<<<<<< * if cbs != PETSC_DECIDE: * CHKERR( MatSetBlockSizes(self.mat, rbs, cbs) ) */ __pyx_t_2 = (__pyx_v_rbs != PETSC_DECIDE); if (__pyx_t_2) { /* "petsc4py/PETSc/Mat.pyx":563 * CHKERR( MatSetSizes(self.mat, m, n, M, N) ) * if rbs != PETSC_DECIDE: * if cbs != PETSC_DECIDE: # <<<<<<<<<<<<<< * CHKERR( MatSetBlockSizes(self.mat, rbs, cbs) ) * else: */ __pyx_t_2 = (__pyx_v_cbs != PETSC_DECIDE); if (__pyx_t_2) { /* "petsc4py/PETSc/Mat.pyx":564 * if rbs != PETSC_DECIDE: * if cbs != PETSC_DECIDE: * CHKERR( MatSetBlockSizes(self.mat, rbs, cbs) ) # <<<<<<<<<<<<<< * else: * CHKERR( MatSetBlockSize(self.mat, rbs) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSetBlockSizes(__pyx_v_self->mat, __pyx_v_rbs, __pyx_v_cbs)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 564, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":563 * CHKERR( MatSetSizes(self.mat, m, n, M, N) ) * if rbs != PETSC_DECIDE: * if cbs != PETSC_DECIDE: # <<<<<<<<<<<<<< * CHKERR( MatSetBlockSizes(self.mat, rbs, cbs) ) * else: */ goto __pyx_L4; } /* "petsc4py/PETSc/Mat.pyx":566 * CHKERR( MatSetBlockSizes(self.mat, rbs, cbs) ) * else: * CHKERR( MatSetBlockSize(self.mat, rbs) ) # <<<<<<<<<<<<<< * * def setBlockSize(self, bsize: int) -> None: */ /*else*/ { __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSetBlockSize(__pyx_v_self->mat, __pyx_v_rbs)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 566, __pyx_L1_error) } __pyx_L4:; /* "petsc4py/PETSc/Mat.pyx":562 * Mat_Sizes(size, bsize, &rbs, &cbs, &m, &n, &M, &N) * CHKERR( MatSetSizes(self.mat, m, n, M, N) ) * if rbs != PETSC_DECIDE: # <<<<<<<<<<<<<< * if cbs != PETSC_DECIDE: * CHKERR( MatSetBlockSizes(self.mat, rbs, cbs) ) */ } /* "petsc4py/PETSc/Mat.pyx":514 * CHKERR( MatSetType(self.mat, cval) ) * * def setSizes( # <<<<<<<<<<<<<< * self, * size: MatSizeSpec, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setSizes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":568 * CHKERR( MatSetBlockSize(self.mat, rbs) ) * * def setBlockSize(self, bsize: int) -> None: # <<<<<<<<<<<<<< * """Set the matrix block size (same for rows and columns). * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_55setBlockSize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_54setBlockSize, "Mat.setBlockSize(self, bsize: int) -> None\nSet the matrix block size (same for rows and columns).\n\n Logically collective.\n\n Parameters\n ----------\n bsize\n Block size.\n\n See Also\n --------\n setBlockSizes, setSizes, petsc.MatSetBlockSize\n\n \nSource code at petsc4py/PETSc/Mat.pyx:568"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_55setBlockSize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_bsize = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setBlockSize (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_bsize,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_bsize)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 568, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setBlockSize") < 0)) __PYX_ERR(46, 568, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_bsize = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setBlockSize", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 568, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.setBlockSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_54setBlockSize(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_bsize); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_54setBlockSize(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_bsize) { PetscInt __pyx_v_bs; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setBlockSize", 1); /* "petsc4py/PETSc/Mat.pyx":583 * * """ * cdef PetscInt bs = asInt(bsize) # <<<<<<<<<<<<<< * CHKERR( MatSetBlockSize(self.mat, bs) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_bsize); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(46, 583, __pyx_L1_error) __pyx_v_bs = __pyx_t_1; /* "petsc4py/PETSc/Mat.pyx":584 * """ * cdef PetscInt bs = asInt(bsize) * CHKERR( MatSetBlockSize(self.mat, bs) ) # <<<<<<<<<<<<<< * * def setBlockSizes(self, row_bsize: int, col_bsize: int) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSetBlockSize(__pyx_v_self->mat, __pyx_v_bs)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 584, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":568 * CHKERR( MatSetBlockSize(self.mat, rbs) ) * * def setBlockSize(self, bsize: int) -> None: # <<<<<<<<<<<<<< * """Set the matrix block size (same for rows and columns). * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setBlockSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":586 * CHKERR( MatSetBlockSize(self.mat, bs) ) * * def setBlockSizes(self, row_bsize: int, col_bsize: int) -> None: # <<<<<<<<<<<<<< * """Set the row and column block sizes. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_57setBlockSizes(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_56setBlockSizes, "Mat.setBlockSizes(self, row_bsize: int, col_bsize: int) -> None\nSet the row and column block sizes.\n\n Logically collective.\n\n Parameters\n ----------\n row_bsize\n Row block size.\n col_bsize\n Column block size.\n\n See Also\n --------\n setBlockSize, setSizes, petsc.MatSetBlockSizes\n\n \nSource code at petsc4py/PETSc/Mat.pyx:586"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_57setBlockSizes(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_row_bsize = 0; PyObject *__pyx_v_col_bsize = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setBlockSizes (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_row_bsize,&__pyx_n_s_col_bsize,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_row_bsize)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 586, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_col_bsize)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 586, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setBlockSizes", 1, 2, 2, 1); __PYX_ERR(46, 586, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setBlockSizes") < 0)) __PYX_ERR(46, 586, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_row_bsize = values[0]; __pyx_v_col_bsize = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setBlockSizes", 1, 2, 2, __pyx_nargs); __PYX_ERR(46, 586, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.setBlockSizes", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_56setBlockSizes(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_row_bsize, __pyx_v_col_bsize); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_56setBlockSizes(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_row_bsize, PyObject *__pyx_v_col_bsize) { PetscInt __pyx_v_rbs; PetscInt __pyx_v_cbs; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setBlockSizes", 1); /* "petsc4py/PETSc/Mat.pyx":603 * * """ * cdef PetscInt rbs = asInt(row_bsize) # <<<<<<<<<<<<<< * cdef PetscInt cbs = asInt(col_bsize) * CHKERR( MatSetBlockSizes(self.mat, rbs, cbs) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_row_bsize); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(46, 603, __pyx_L1_error) __pyx_v_rbs = __pyx_t_1; /* "petsc4py/PETSc/Mat.pyx":604 * """ * cdef PetscInt rbs = asInt(row_bsize) * cdef PetscInt cbs = asInt(col_bsize) # <<<<<<<<<<<<<< * CHKERR( MatSetBlockSizes(self.mat, rbs, cbs) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_col_bsize); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(46, 604, __pyx_L1_error) __pyx_v_cbs = __pyx_t_1; /* "petsc4py/PETSc/Mat.pyx":605 * cdef PetscInt rbs = asInt(row_bsize) * cdef PetscInt cbs = asInt(col_bsize) * CHKERR( MatSetBlockSizes(self.mat, rbs, cbs) ) # <<<<<<<<<<<<<< * * def setVecType(self, vec_type: Vec.Type | str) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSetBlockSizes(__pyx_v_self->mat, __pyx_v_rbs, __pyx_v_cbs)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 605, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":586 * CHKERR( MatSetBlockSize(self.mat, bs) ) * * def setBlockSizes(self, row_bsize: int, col_bsize: int) -> None: # <<<<<<<<<<<<<< * """Set the row and column block sizes. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setBlockSizes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":607 * CHKERR( MatSetBlockSizes(self.mat, rbs, cbs) ) * * def setVecType(self, vec_type: Vec.Type | str) -> None: # <<<<<<<<<<<<<< * """Set the vector type. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_59setVecType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_58setVecType, "Mat.setVecType(self, vec_type: Vec.Type | str) -> None\nSet the vector type.\n\n Collective.\n\n Parameters\n ----------\n vec_type\n Vector type used when creating vectors with `createVecs`.\n\n See Also\n --------\n getVecType, petsc.MatSetVecType\n\n \nSource code at petsc4py/PETSc/Mat.pyx:607"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_59setVecType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_vec_type = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setVecType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec_type,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vec_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 607, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setVecType") < 0)) __PYX_ERR(46, 607, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_vec_type = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setVecType", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 607, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.setVecType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_58setVecType(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_vec_type); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_58setVecType(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_vec_type) { VecType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setVecType", 0); __Pyx_INCREF(__pyx_v_vec_type); /* "petsc4py/PETSc/Mat.pyx":622 * * """ * cdef PetscVecType cval = NULL # <<<<<<<<<<<<<< * vec_type = str2bytes(vec_type, &cval) * CHKERR( MatSetVecType(self.mat, cval) ) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/Mat.pyx":623 * """ * cdef PetscVecType cval = NULL * vec_type = str2bytes(vec_type, &cval) # <<<<<<<<<<<<<< * CHKERR( MatSetVecType(self.mat, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_vec_type, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 623, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_vec_type, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Mat.pyx":624 * cdef PetscVecType cval = NULL * vec_type = str2bytes(vec_type, &cval) * CHKERR( MatSetVecType(self.mat, cval) ) # <<<<<<<<<<<<<< * * def getVecType(self) -> str: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSetVecType(__pyx_v_self->mat, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 624, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":607 * CHKERR( MatSetBlockSizes(self.mat, rbs, cbs) ) * * def setVecType(self, vec_type: Vec.Type | str) -> None: # <<<<<<<<<<<<<< * """Set the vector type. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.setVecType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_vec_type); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":626 * CHKERR( MatSetVecType(self.mat, cval) ) * * def getVecType(self) -> str: # <<<<<<<<<<<<<< * """Return the vector type used by the matrix. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_61getVecType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_60getVecType, "Mat.getVecType(self) -> str\nReturn the vector type used by the matrix.\n\n Not collective.\n\n See Also\n --------\n setVecType, petsc.MatGetVecType\n\n \nSource code at petsc4py/PETSc/Mat.pyx:626"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_61getVecType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getVecType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getVecType", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getVecType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_60getVecType(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_60getVecType(struct PyPetscMatObject *__pyx_v_self) { VecType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getVecType", 1); /* "petsc4py/PETSc/Mat.pyx":636 * * """ * cdef PetscVecType cval = NULL # <<<<<<<<<<<<<< * CHKERR( MatGetVecType(self.mat, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/Mat.pyx":637 * """ * cdef PetscVecType cval = NULL * CHKERR( MatGetVecType(self.mat, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetVecType(__pyx_v_self->mat, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 637, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":638 * cdef PetscVecType cval = NULL * CHKERR( MatGetVecType(self.mat, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * def setNestVecType(self, vec_type: Vec.Type | str) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 638, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":626 * CHKERR( MatSetVecType(self.mat, cval) ) * * def getVecType(self) -> str: # <<<<<<<<<<<<<< * """Return the vector type used by the matrix. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getVecType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":640 * return bytes2str(cval) * * def setNestVecType(self, vec_type: Vec.Type | str) -> None: # <<<<<<<<<<<<<< * """Set the vector type for a `Type.NEST` matrix. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_63setNestVecType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_62setNestVecType, "Mat.setNestVecType(self, vec_type: Vec.Type | str) -> None\nSet the vector type for a `Type.NEST` matrix.\n\n Collective.\n\n Parameters\n ----------\n vec_type\n Vector type used when creating vectors with `createVecs`.\n\n See Also\n --------\n getVecType, petsc.MatNestSetVecType\n\n \nSource code at petsc4py/PETSc/Mat.pyx:640"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_63setNestVecType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_vec_type = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setNestVecType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec_type,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vec_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 640, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setNestVecType") < 0)) __PYX_ERR(46, 640, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_vec_type = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setNestVecType", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 640, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.setNestVecType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_62setNestVecType(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_vec_type); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_62setNestVecType(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_vec_type) { VecType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setNestVecType", 0); __Pyx_INCREF(__pyx_v_vec_type); /* "petsc4py/PETSc/Mat.pyx":655 * * """ * cdef PetscVecType cval = NULL # <<<<<<<<<<<<<< * vec_type = str2bytes(vec_type, &cval) * CHKERR( MatNestSetVecType(self.mat, cval) ) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/Mat.pyx":656 * """ * cdef PetscVecType cval = NULL * vec_type = str2bytes(vec_type, &cval) # <<<<<<<<<<<<<< * CHKERR( MatNestSetVecType(self.mat, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_vec_type, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 656, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_vec_type, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Mat.pyx":657 * cdef PetscVecType cval = NULL * vec_type = str2bytes(vec_type, &cval) * CHKERR( MatNestSetVecType(self.mat, cval) ) # <<<<<<<<<<<<<< * * # */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatNestSetVecType(__pyx_v_self->mat, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 657, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":640 * return bytes2str(cval) * * def setNestVecType(self, vec_type: Vec.Type | str) -> None: # <<<<<<<<<<<<<< * """Set the vector type for a `Type.NEST` matrix. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.setNestVecType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_vec_type); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":661 * # * * def createAIJ( # <<<<<<<<<<<<<< * self, * size: MatSizeSpec, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_65createAIJ(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_64createAIJ, "Mat.createAIJ(self, size: MatSizeSpec, bsize: MatBlockSizeSpec | None = None, nnz: NNZSpec | None = None, csr: CSRIndicesSpec | None = None, comm: Comm | None = None) -> Self\nCreate a sparse `Type.AIJ` matrix, optionally preallocating.\n\n Collective.\n\n To preallocate the matrix the user can either pass ``nnz`` or ``csr``\n describing the sparsity. If neither is set then preallocation will not\n occur. Consult the `PETSc manual ` for\n more information.\n\n Parameters\n ----------\n size\n Matrix size.\n bsize\n Matrix block size. If `None`, a block size of ``1`` is set.\n nnz\n Optional non-zeros preallocation pattern.\n csr\n Optional compressed sparse row layout information.\n If provided, it takes precedence on ``nnz``.\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n setSizes, createBAIJ, petsc.MATAIJ, petsc.MATSEQAIJ, petsc.MATMPIAIJ\n petsc.MatCreateAIJ, petsc.MatSeqAIJSetPreallocation\n petsc.MatSeqAIJSetPreallocationCSR\n\n \nSource code at petsc4py/PETSc/Mat.pyx:661"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_65createAIJ(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_size = 0; PyObject *__pyx_v_bsize = 0; PyObject *__pyx_v_nnz = 0; PyObject *__pyx_v_csr = 0; PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createAIJ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_bsize,&__pyx_n_s_nnz,&__pyx_n_s_csr,&__pyx_n_s_comm,0}; /* "petsc4py/PETSc/Mat.pyx":664 * self, * size: MatSizeSpec, * bsize: MatBlockSizeSpec | None = None, # <<<<<<<<<<<<<< * nnz: NNZSpec | None = None, * csr: CSRIndicesSpec | None = None, */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Mat.pyx":665 * size: MatSizeSpec, * bsize: MatBlockSizeSpec | None = None, * nnz: NNZSpec | None = None, # <<<<<<<<<<<<<< * csr: CSRIndicesSpec | None = None, * comm: Comm | None = None, */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Mat.pyx":666 * bsize: MatBlockSizeSpec | None = None, * nnz: NNZSpec | None = None, * csr: CSRIndicesSpec | None = None, # <<<<<<<<<<<<<< * comm: Comm | None = None, * ) -> Self: */ values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Mat.pyx":667 * nnz: NNZSpec | None = None, * csr: CSRIndicesSpec | None = None, * comm: Comm | None = None, # <<<<<<<<<<<<<< * ) -> Self: * """Create a sparse `Type.AIJ` matrix, optionally preallocating. */ values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 661, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_bsize); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 661, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_nnz); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 661, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_csr); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 661, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 661, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createAIJ") < 0)) __PYX_ERR(46, 661, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_size = values[0]; __pyx_v_bsize = values[1]; __pyx_v_nnz = values[2]; __pyx_v_csr = values[3]; __pyx_v_comm = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createAIJ", 0, 1, 5, __pyx_nargs); __PYX_ERR(46, 661, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.createAIJ", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_64createAIJ(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_size, __pyx_v_bsize, __pyx_v_nnz, __pyx_v_csr, __pyx_v_comm); /* "petsc4py/PETSc/Mat.pyx":661 * # * * def createAIJ( # <<<<<<<<<<<<<< * self, * size: MatSizeSpec, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_64createAIJ(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PyObject *__pyx_v_nnz, PyObject *__pyx_v_csr, PyObject *__pyx_v_comm) { Mat __pyx_v_newmat; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createAIJ", 1); /* "petsc4py/PETSc/Mat.pyx":700 * """ * # create matrix * cdef PetscMat newmat = NULL # <<<<<<<<<<<<<< * Mat_Create(MATAIJ, comm, size, bsize, &newmat) * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat */ __pyx_v_newmat = NULL; /* "petsc4py/PETSc/Mat.pyx":701 * # create matrix * cdef PetscMat newmat = NULL * Mat_Create(MATAIJ, comm, size, bsize, &newmat) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat * # preallocate matrix */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_Mat_Create(MATAIJ, __pyx_v_comm, __pyx_v_size, __pyx_v_bsize, (&__pyx_v_newmat)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 701, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":702 * cdef PetscMat newmat = NULL * Mat_Create(MATAIJ, comm, size, bsize, &newmat) * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat # <<<<<<<<<<<<<< * # preallocate matrix * Mat_AllocAIJ(self.mat, nnz, csr) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 702, __pyx_L1_error) __pyx_v_self->mat = __pyx_v_newmat; /* "petsc4py/PETSc/Mat.pyx":704 * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat * # preallocate matrix * Mat_AllocAIJ(self.mat, nnz, csr) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_Mat_AllocAIJ(__pyx_v_self->mat, __pyx_v_nnz, __pyx_v_csr); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 704, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":705 * # preallocate matrix * Mat_AllocAIJ(self.mat, nnz, csr) * return self # <<<<<<<<<<<<<< * * def createBAIJ( */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":661 * # * * def createAIJ( # <<<<<<<<<<<<<< * self, * size: MatSizeSpec, */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.createAIJ", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":707 * return self * * def createBAIJ( # <<<<<<<<<<<<<< * self, * size: MatSizeSpec, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_67createBAIJ(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_66createBAIJ, "Mat.createBAIJ(self, size: MatSizeSpec, bsize: MatBlockSizeSpec, nnz: NNZSpec | None = None, csr: CSRIndicesSpec | None = None, comm: Comm | None = None) -> Self\nCreate a sparse blocked `Type.BAIJ` matrix, optionally preallocating.\n\n Collective.\n\n To preallocate the matrix the user can either pass ``nnz`` or ``csr``\n describing the sparsity. If neither is set then preallocation will not\n occur. Consult the `PETSc manual ` for\n more information.\n\n Parameters\n ----------\n size\n Matrix size.\n bsize\n Matrix block size.\n nnz\n Optional non-zeros preallocation pattern for block rows.\n csr\n Optional block-compressed sparse row layout information.\n If provided, it takes precedence on ``nnz``.\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n setSizes, createAIJ, petsc.MATBAIJ, petsc.MATSEQBAIJ\n petsc.MATMPIBAIJ, petsc.MatCreateBAIJ\n\n \nSource code at petsc4py/PETSc/Mat.pyx:707"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_67createBAIJ(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_size = 0; PyObject *__pyx_v_bsize = 0; PyObject *__pyx_v_nnz = 0; PyObject *__pyx_v_csr = 0; PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createBAIJ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_bsize,&__pyx_n_s_nnz,&__pyx_n_s_csr,&__pyx_n_s_comm,0}; /* "petsc4py/PETSc/Mat.pyx":711 * size: MatSizeSpec, * bsize: MatBlockSizeSpec, * nnz: NNZSpec | None = None, # <<<<<<<<<<<<<< * csr: CSRIndicesSpec | None = None, * comm: Comm | None = None, */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Mat.pyx":712 * bsize: MatBlockSizeSpec, * nnz: NNZSpec | None = None, * csr: CSRIndicesSpec | None = None, # <<<<<<<<<<<<<< * comm: Comm | None = None, * ) -> Self: */ values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Mat.pyx":713 * nnz: NNZSpec | None = None, * csr: CSRIndicesSpec | None = None, * comm: Comm | None = None, # <<<<<<<<<<<<<< * ) -> Self: * """Create a sparse blocked `Type.BAIJ` matrix, optionally preallocating. */ values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 707, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_bsize)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 707, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("createBAIJ", 0, 2, 5, 1); __PYX_ERR(46, 707, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_nnz); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 707, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_csr); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 707, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 707, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createBAIJ") < 0)) __PYX_ERR(46, 707, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_size = values[0]; __pyx_v_bsize = values[1]; __pyx_v_nnz = values[2]; __pyx_v_csr = values[3]; __pyx_v_comm = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createBAIJ", 0, 2, 5, __pyx_nargs); __PYX_ERR(46, 707, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.createBAIJ", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_66createBAIJ(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_size, __pyx_v_bsize, __pyx_v_nnz, __pyx_v_csr, __pyx_v_comm); /* "petsc4py/PETSc/Mat.pyx":707 * return self * * def createBAIJ( # <<<<<<<<<<<<<< * self, * size: MatSizeSpec, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_66createBAIJ(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PyObject *__pyx_v_nnz, PyObject *__pyx_v_csr, PyObject *__pyx_v_comm) { Mat __pyx_v_newmat; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createBAIJ", 1); /* "petsc4py/PETSc/Mat.pyx":745 * """ * # create matrix * cdef PetscMat newmat = NULL # <<<<<<<<<<<<<< * Mat_Create(MATBAIJ, comm, size, bsize, &newmat) * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat */ __pyx_v_newmat = NULL; /* "petsc4py/PETSc/Mat.pyx":746 * # create matrix * cdef PetscMat newmat = NULL * Mat_Create(MATBAIJ, comm, size, bsize, &newmat) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat * # preallocate matrix */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_Mat_Create(MATBAIJ, __pyx_v_comm, __pyx_v_size, __pyx_v_bsize, (&__pyx_v_newmat)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 746, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":747 * cdef PetscMat newmat = NULL * Mat_Create(MATBAIJ, comm, size, bsize, &newmat) * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat # <<<<<<<<<<<<<< * # preallocate matrix * Mat_AllocAIJ(self.mat, nnz, csr) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 747, __pyx_L1_error) __pyx_v_self->mat = __pyx_v_newmat; /* "petsc4py/PETSc/Mat.pyx":749 * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat * # preallocate matrix * Mat_AllocAIJ(self.mat, nnz, csr) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_Mat_AllocAIJ(__pyx_v_self->mat, __pyx_v_nnz, __pyx_v_csr); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 749, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":750 * # preallocate matrix * Mat_AllocAIJ(self.mat, nnz, csr) * return self # <<<<<<<<<<<<<< * * def createSBAIJ( */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":707 * return self * * def createBAIJ( # <<<<<<<<<<<<<< * self, * size: MatSizeSpec, */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.createBAIJ", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":752 * return self * * def createSBAIJ( # <<<<<<<<<<<<<< * self, * size: MatSizeSpec, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_69createSBAIJ(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_68createSBAIJ, "Mat.createSBAIJ(self, size: MatSizeSpec, bsize: int, nnz: NNZSpec | None = None, csr: CSRIndicesSpec | None = None, comm: Comm | None = None) -> Self\nCreate a sparse `Type.SBAIJ` matrix in symmetric block format.\n\n Collective.\n\n To preallocate the matrix the user can either pass ``nnz`` or ``csr``\n describing the sparsity. If neither is set then preallocation will not\n occur. Consult the `PETSc manual ` for\n more information.\n\n Parameters\n ----------\n size\n Matrix size.\n bsize\n Matrix block size.\n nnz\n Optional upper-triangular (including diagonal)\n non-zeros preallocation pattern for block rows.\n csr\n Optional block-compressed sparse row layout information.\n If provided, it takes precedence on ``nnz``.\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n createAIJ, createBAIJ, petsc.MatCreateSBAIJ\n\n \nSource code at petsc4py/PETSc/Mat.pyx:752"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_69createSBAIJ(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_size = 0; PyObject *__pyx_v_bsize = 0; PyObject *__pyx_v_nnz = 0; PyObject *__pyx_v_csr = 0; PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createSBAIJ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_bsize,&__pyx_n_s_nnz,&__pyx_n_s_csr,&__pyx_n_s_comm,0}; /* "petsc4py/PETSc/Mat.pyx":756 * size: MatSizeSpec, * bsize: int, * nnz: NNZSpec | None = None, # <<<<<<<<<<<<<< * csr: CSRIndicesSpec | None = None, * comm: Comm | None = None, */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Mat.pyx":757 * bsize: int, * nnz: NNZSpec | None = None, * csr: CSRIndicesSpec | None = None, # <<<<<<<<<<<<<< * comm: Comm | None = None, * ) -> Self: */ values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Mat.pyx":758 * nnz: NNZSpec | None = None, * csr: CSRIndicesSpec | None = None, * comm: Comm | None = None, # <<<<<<<<<<<<<< * ) -> Self: * """Create a sparse `Type.SBAIJ` matrix in symmetric block format. */ values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 752, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_bsize)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 752, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("createSBAIJ", 0, 2, 5, 1); __PYX_ERR(46, 752, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_nnz); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 752, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_csr); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 752, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 752, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createSBAIJ") < 0)) __PYX_ERR(46, 752, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_size = values[0]; __pyx_v_bsize = values[1]; __pyx_v_nnz = values[2]; __pyx_v_csr = values[3]; __pyx_v_comm = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createSBAIJ", 0, 2, 5, __pyx_nargs); __PYX_ERR(46, 752, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.createSBAIJ", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_68createSBAIJ(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_size, __pyx_v_bsize, __pyx_v_nnz, __pyx_v_csr, __pyx_v_comm); /* "petsc4py/PETSc/Mat.pyx":752 * return self * * def createSBAIJ( # <<<<<<<<<<<<<< * self, * size: MatSizeSpec, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_68createSBAIJ(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PyObject *__pyx_v_nnz, PyObject *__pyx_v_csr, PyObject *__pyx_v_comm) { Mat __pyx_v_newmat; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createSBAIJ", 1); /* "petsc4py/PETSc/Mat.pyx":790 * """ * # create matrix * cdef PetscMat newmat = NULL # <<<<<<<<<<<<<< * Mat_Create(MATSBAIJ, comm, size, bsize, &newmat) * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat */ __pyx_v_newmat = NULL; /* "petsc4py/PETSc/Mat.pyx":791 * # create matrix * cdef PetscMat newmat = NULL * Mat_Create(MATSBAIJ, comm, size, bsize, &newmat) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat * # preallocate matrix */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_Mat_Create(MATSBAIJ, __pyx_v_comm, __pyx_v_size, __pyx_v_bsize, (&__pyx_v_newmat)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 791, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":792 * cdef PetscMat newmat = NULL * Mat_Create(MATSBAIJ, comm, size, bsize, &newmat) * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat # <<<<<<<<<<<<<< * # preallocate matrix * Mat_AllocAIJ(self.mat, nnz, csr) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 792, __pyx_L1_error) __pyx_v_self->mat = __pyx_v_newmat; /* "petsc4py/PETSc/Mat.pyx":794 * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat * # preallocate matrix * Mat_AllocAIJ(self.mat, nnz, csr) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_Mat_AllocAIJ(__pyx_v_self->mat, __pyx_v_nnz, __pyx_v_csr); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 794, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":795 * # preallocate matrix * Mat_AllocAIJ(self.mat, nnz, csr) * return self # <<<<<<<<<<<<<< * * def createAIJCRL( */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":752 * return self * * def createSBAIJ( # <<<<<<<<<<<<<< * self, * size: MatSizeSpec, */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.createSBAIJ", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":797 * return self * * def createAIJCRL( # <<<<<<<<<<<<<< * self, * size: MatSizeSpec, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_71createAIJCRL(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_70createAIJCRL, "Mat.createAIJCRL(self, size: MatSizeSpec, bsize: MatBlockSizeSpec | None = None, nnz: NNZSpec | None = None, csr: CSRIndicesSpec | None = None, comm: Comm | None = None) -> Self\nCreate a sparse `Type.AIJCRL` matrix.\n\n Collective.\n\n This is similar to `Type.AIJ` matrices but stores some additional\n information that improves vectorization for the matrix-vector product.\n\n To preallocate the matrix the user can either pass ``nnz`` or ``csr``\n describing the sparsity. If neither is set then preallocation will not\n occur. Consult the `PETSc manual ` for\n more information.\n\n Parameters\n ----------\n size\n Matrix size.\n bsize\n Matrix block size. If `None`, a block size of ``1`` is set.\n nnz\n Optional non-zeros preallocation pattern.\n csr\n Optional compressed sparse row layout information.\n If provided, it takes precedence on ``nnz``.\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n createAIJ, createBAIJ, petsc.MatCreateSeqAIJCRL\n petsc.MatCreateMPIAIJCRL\n\n \nSource code at petsc4py/PETSc/Mat.pyx:797"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_71createAIJCRL(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_size = 0; PyObject *__pyx_v_bsize = 0; PyObject *__pyx_v_nnz = 0; PyObject *__pyx_v_csr = 0; PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createAIJCRL (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_bsize,&__pyx_n_s_nnz,&__pyx_n_s_csr,&__pyx_n_s_comm,0}; /* "petsc4py/PETSc/Mat.pyx":800 * self, * size: MatSizeSpec, * bsize: MatBlockSizeSpec | None = None, # <<<<<<<<<<<<<< * nnz: NNZSpec | None = None, * csr: CSRIndicesSpec | None = None, */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Mat.pyx":801 * size: MatSizeSpec, * bsize: MatBlockSizeSpec | None = None, * nnz: NNZSpec | None = None, # <<<<<<<<<<<<<< * csr: CSRIndicesSpec | None = None, * comm: Comm | None = None, */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Mat.pyx":802 * bsize: MatBlockSizeSpec | None = None, * nnz: NNZSpec | None = None, * csr: CSRIndicesSpec | None = None, # <<<<<<<<<<<<<< * comm: Comm | None = None, * ) -> Self: */ values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Mat.pyx":803 * nnz: NNZSpec | None = None, * csr: CSRIndicesSpec | None = None, * comm: Comm | None = None, # <<<<<<<<<<<<<< * ) -> Self: * """Create a sparse `Type.AIJCRL` matrix. */ values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 797, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_bsize); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 797, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_nnz); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 797, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_csr); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 797, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 797, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createAIJCRL") < 0)) __PYX_ERR(46, 797, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_size = values[0]; __pyx_v_bsize = values[1]; __pyx_v_nnz = values[2]; __pyx_v_csr = values[3]; __pyx_v_comm = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createAIJCRL", 0, 1, 5, __pyx_nargs); __PYX_ERR(46, 797, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.createAIJCRL", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_70createAIJCRL(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_size, __pyx_v_bsize, __pyx_v_nnz, __pyx_v_csr, __pyx_v_comm); /* "petsc4py/PETSc/Mat.pyx":797 * return self * * def createAIJCRL( # <<<<<<<<<<<<<< * self, * size: MatSizeSpec, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_70createAIJCRL(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PyObject *__pyx_v_nnz, PyObject *__pyx_v_csr, PyObject *__pyx_v_comm) { Mat __pyx_v_newmat; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createAIJCRL", 1); /* "petsc4py/PETSc/Mat.pyx":838 * """ * # create matrix * cdef PetscMat newmat = NULL # <<<<<<<<<<<<<< * Mat_Create(MATAIJCRL, comm, size, bsize, &newmat) * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat */ __pyx_v_newmat = NULL; /* "petsc4py/PETSc/Mat.pyx":839 * # create matrix * cdef PetscMat newmat = NULL * Mat_Create(MATAIJCRL, comm, size, bsize, &newmat) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat * # preallocate matrix */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_Mat_Create(MATAIJCRL, __pyx_v_comm, __pyx_v_size, __pyx_v_bsize, (&__pyx_v_newmat)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 839, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":840 * cdef PetscMat newmat = NULL * Mat_Create(MATAIJCRL, comm, size, bsize, &newmat) * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat # <<<<<<<<<<<<<< * # preallocate matrix * Mat_AllocAIJ(self.mat, nnz, csr) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 840, __pyx_L1_error) __pyx_v_self->mat = __pyx_v_newmat; /* "petsc4py/PETSc/Mat.pyx":842 * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat * # preallocate matrix * Mat_AllocAIJ(self.mat, nnz, csr) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_Mat_AllocAIJ(__pyx_v_self->mat, __pyx_v_nnz, __pyx_v_csr); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 842, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":843 * # preallocate matrix * Mat_AllocAIJ(self.mat, nnz, csr) * return self # <<<<<<<<<<<<<< * * def setPreallocationNNZ(self, nnz: NNZSpec) -> Self: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":797 * return self * * def createAIJCRL( # <<<<<<<<<<<<<< * self, * size: MatSizeSpec, */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.createAIJCRL", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":845 * return self * * def setPreallocationNNZ(self, nnz: NNZSpec) -> Self: # <<<<<<<<<<<<<< * """Preallocate memory for the matrix with a non-zero pattern. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_73setPreallocationNNZ(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_72setPreallocationNNZ, "Mat.setPreallocationNNZ(self, nnz: NNZSpec) -> Self\nPreallocate memory for the matrix with a non-zero pattern.\n\n Collective.\n\n Correct preallocation can result in a dramatic reduction in matrix\n assembly time.\n\n Parameters\n ----------\n nnz\n The number of non-zeros per row for the local portion of the matrix,\n or a 2-tuple for the on-process and off-process part of the matrix.\n\n See Also\n --------\n setPreallocationCSR, createAIJ, petsc.MatSeqAIJSetPreallocation\n petsc.MatMPIAIJSetPreallocation\n\n \nSource code at petsc4py/PETSc/Mat.pyx:845"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_73setPreallocationNNZ(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_nnz = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPreallocationNNZ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nnz,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_nnz)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 845, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setPreallocationNNZ") < 0)) __PYX_ERR(46, 845, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_nnz = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPreallocationNNZ", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 845, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.setPreallocationNNZ", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_72setPreallocationNNZ(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_nnz); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_72setPreallocationNNZ(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_nnz) { PetscBool __pyx_v_done; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPreallocationNNZ", 1); /* "petsc4py/PETSc/Mat.pyx":865 * * """ * cdef PetscBool done = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( MatIsPreallocated(self.mat, &done) ) * # if done: raise Error(PETSC_ERR_ORDER) */ __pyx_v_done = PETSC_FALSE; /* "petsc4py/PETSc/Mat.pyx":866 * """ * cdef PetscBool done = PETSC_FALSE * CHKERR( MatIsPreallocated(self.mat, &done) ) # <<<<<<<<<<<<<< * # if done: raise Error(PETSC_ERR_ORDER) * Mat_AllocAIJ_NNZ(self.mat, nnz) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatIsPreallocated(__pyx_v_self->mat, (&__pyx_v_done))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 866, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":868 * CHKERR( MatIsPreallocated(self.mat, &done) ) * # if done: raise Error(PETSC_ERR_ORDER) * Mat_AllocAIJ_NNZ(self.mat, nnz) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_Mat_AllocAIJ_NNZ(__pyx_v_self->mat, __pyx_v_nnz); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 868, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":869 * # if done: raise Error(PETSC_ERR_ORDER) * Mat_AllocAIJ_NNZ(self.mat, nnz) * return self # <<<<<<<<<<<<<< * * def setPreallocationCSR(self, csr: CSRIndicesSpec) -> Self: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":845 * return self * * def setPreallocationNNZ(self, nnz: NNZSpec) -> Self: # <<<<<<<<<<<<<< * """Preallocate memory for the matrix with a non-zero pattern. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setPreallocationNNZ", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":871 * return self * * def setPreallocationCSR(self, csr: CSRIndicesSpec) -> Self: # <<<<<<<<<<<<<< * """Preallocate memory for the matrix with a CSR layout. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_75setPreallocationCSR(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_74setPreallocationCSR, "Mat.setPreallocationCSR(self, csr: CSRIndicesSpec) -> Self\nPreallocate memory for the matrix with a CSR layout.\n\n Collective.\n\n Correct preallocation can result in a dramatic reduction in matrix\n assembly time.\n\n Parameters\n ----------\n csr\n Local matrix data in compressed sparse row layout format.\n\n Notes\n -----\n Must use the block-compressed form with `Type.BAIJ` and `Type.SBAIJ`.\n\n See Also\n --------\n setPreallocationNNZ, createAIJ, createBAIJ, createSBAIJ\n petsc.MatSeqAIJSetPreallocationCSR\n petsc.MatMPIAIJSetPreallocationCSR\n petsc.MatSeqBAIJSetPreallocationCSR\n petsc.MatMPIBAIJSetPreallocationCSR\n petsc.MatSeqSBAIJSetPreallocationCSR\n petsc.MatMPISBAIJSetPreallocationCSR\n\n \nSource code at petsc4py/PETSc/Mat.pyx:871"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_75setPreallocationCSR(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_csr = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPreallocationCSR (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_csr,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_csr)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 871, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setPreallocationCSR") < 0)) __PYX_ERR(46, 871, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_csr = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPreallocationCSR", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 871, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.setPreallocationCSR", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_74setPreallocationCSR(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_csr); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_74setPreallocationCSR(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_csr) { PetscBool __pyx_v_done; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPreallocationCSR", 1); /* "petsc4py/PETSc/Mat.pyx":899 * * """ * cdef PetscBool done = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( MatIsPreallocated(self.mat, &done) ) * # if done: raise Error(PETSC_ERR_ORDER) */ __pyx_v_done = PETSC_FALSE; /* "petsc4py/PETSc/Mat.pyx":900 * """ * cdef PetscBool done = PETSC_FALSE * CHKERR( MatIsPreallocated(self.mat, &done) ) # <<<<<<<<<<<<<< * # if done: raise Error(PETSC_ERR_ORDER) * Mat_AllocAIJ_CSR(self.mat, csr) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatIsPreallocated(__pyx_v_self->mat, (&__pyx_v_done))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 900, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":902 * CHKERR( MatIsPreallocated(self.mat, &done) ) * # if done: raise Error(PETSC_ERR_ORDER) * Mat_AllocAIJ_CSR(self.mat, csr) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_Mat_AllocAIJ_CSR(__pyx_v_self->mat, __pyx_v_csr); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 902, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":903 * # if done: raise Error(PETSC_ERR_ORDER) * Mat_AllocAIJ_CSR(self.mat, csr) * return self # <<<<<<<<<<<<<< * * def createAIJWithArrays( */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":871 * return self * * def setPreallocationCSR(self, csr: CSRIndicesSpec) -> Self: # <<<<<<<<<<<<<< * """Preallocate memory for the matrix with a CSR layout. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setPreallocationCSR", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":905 * return self * * def createAIJWithArrays( # <<<<<<<<<<<<<< * self, * size: MatSizeSpec, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_77createAIJWithArrays(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_76createAIJWithArrays, "Mat.createAIJWithArrays(self, size: MatSizeSpec, csr: CSRSpec | tuple[CSRSpec, CSRSpec], bsize: MatBlockSizeSpec | None = None, comm: Comm | None = None) -> Self\nCreate a sparse `Type.AIJ` matrix with data in CSR format.\n\n Collective.\n\n Parameters\n ----------\n size\n Matrix size.\n csr\n Local matrix data in compressed sparse row format.\n bsize\n Matrix block size. If `None`, a block size of ``1`` is set.\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n Notes\n -----\n For `Type.SEQAIJ` matrices, the ``csr`` data is not copied.\n For `Type.MPIAIJ` matrices, the ``csr`` data is not copied only\n in the case it represents on-process and off-process information.\n\n See Also\n --------\n createAIJ, petsc.MatCreateSeqAIJWithArrays\n petsc.MatCreateMPIAIJWithArrays, petsc.MatCreateMPIAIJWithSplitArrays\n\n \nSource code at petsc4py/PETSc/Mat.pyx:905"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_77createAIJWithArrays(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_size = 0; PyObject *__pyx_v_csr = 0; PyObject *__pyx_v_bsize = 0; PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createAIJWithArrays (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_csr,&__pyx_n_s_bsize,&__pyx_n_s_comm,0}; /* "petsc4py/PETSc/Mat.pyx":909 * size: MatSizeSpec, * csr: CSRSpec | tuple[CSRSpec, CSRSpec], * bsize: MatBlockSizeSpec | None = None, # <<<<<<<<<<<<<< * comm: Comm | None = None, * ) -> Self: */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Mat.pyx":910 * csr: CSRSpec | tuple[CSRSpec, CSRSpec], * bsize: MatBlockSizeSpec | None = None, * comm: Comm | None = None, # <<<<<<<<<<<<<< * ) -> Self: * """Create a sparse `Type.AIJ` matrix with data in CSR format. */ values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 905, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_csr)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 905, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("createAIJWithArrays", 0, 2, 4, 1); __PYX_ERR(46, 905, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_bsize); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 905, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 905, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createAIJWithArrays") < 0)) __PYX_ERR(46, 905, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_size = values[0]; __pyx_v_csr = values[1]; __pyx_v_bsize = values[2]; __pyx_v_comm = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createAIJWithArrays", 0, 2, 4, __pyx_nargs); __PYX_ERR(46, 905, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.createAIJWithArrays", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_76createAIJWithArrays(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_size, __pyx_v_csr, __pyx_v_bsize, __pyx_v_comm); /* "petsc4py/PETSc/Mat.pyx":905 * return self * * def createAIJWithArrays( # <<<<<<<<<<<<<< * self, * size: MatSizeSpec, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_76createAIJWithArrays(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_csr, PyObject *__pyx_v_bsize, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PetscInt __pyx_v_rbs; PetscInt __pyx_v_cbs; PetscInt __pyx_v_m; PetscInt __pyx_v_n; PetscInt __pyx_v_M; PetscInt __pyx_v_N; PyObject *__pyx_v_pi = 0; PyObject *__pyx_v_pj = 0; PyObject *__pyx_v_pv = 0; PyObject *__pyx_v_poi = 0; PyObject *__pyx_v_poj = 0; PyObject *__pyx_v_pov = 0; PetscInt __pyx_v_ni; PetscInt __pyx_v_noi; PetscInt *__pyx_v_i; PetscInt *__pyx_v_oi; PetscInt __pyx_v_nj; PetscInt __pyx_v_noj; PetscInt *__pyx_v_j; PetscInt *__pyx_v_oj; PetscInt __pyx_v_nv; PetscInt __pyx_v_nov; PetscScalar *__pyx_v_v; PetscScalar *__pyx_v_ov; Mat __pyx_v_newmat; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *(*__pyx_t_10)(PyObject *); PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; int __pyx_t_14; PyObject *__pyx_t_15 = NULL; int __pyx_t_16; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createAIJWithArrays", 0); __Pyx_INCREF(__pyx_v_csr); /* "petsc4py/PETSc/Mat.pyx":940 * """ * # communicator * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * # sizes and block sizes * cdef PetscInt rbs = 0, cbs = 0, m = 0, n = 0, M = 0, N = 0 */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(46, 940, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/Mat.pyx":942 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * # sizes and block sizes * cdef PetscInt rbs = 0, cbs = 0, m = 0, n = 0, M = 0, N = 0 # <<<<<<<<<<<<<< * Mat_Sizes(size, bsize, &rbs, &cbs, &m, &n, &M, &N) * if rbs == PETSC_DECIDE: rbs = 1 */ __pyx_v_rbs = 0; __pyx_v_cbs = 0; __pyx_v_m = 0; __pyx_v_n = 0; __pyx_v_M = 0; __pyx_v_N = 0; /* "petsc4py/PETSc/Mat.pyx":943 * # sizes and block sizes * cdef PetscInt rbs = 0, cbs = 0, m = 0, n = 0, M = 0, N = 0 * Mat_Sizes(size, bsize, &rbs, &cbs, &m, &n, &M, &N) # <<<<<<<<<<<<<< * if rbs == PETSC_DECIDE: rbs = 1 * if cbs == PETSC_DECIDE: cbs = rbs */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_Mat_Sizes(__pyx_v_size, __pyx_v_bsize, (&__pyx_v_rbs), (&__pyx_v_cbs), (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_M), (&__pyx_v_N)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 943, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":944 * cdef PetscInt rbs = 0, cbs = 0, m = 0, n = 0, M = 0, N = 0 * Mat_Sizes(size, bsize, &rbs, &cbs, &m, &n, &M, &N) * if rbs == PETSC_DECIDE: rbs = 1 # <<<<<<<<<<<<<< * if cbs == PETSC_DECIDE: cbs = rbs * Sys_Layout(ccomm, rbs, &m, &M) */ __pyx_t_3 = (__pyx_v_rbs == PETSC_DECIDE); if (__pyx_t_3) { __pyx_v_rbs = 1; } /* "petsc4py/PETSc/Mat.pyx":945 * Mat_Sizes(size, bsize, &rbs, &cbs, &m, &n, &M, &N) * if rbs == PETSC_DECIDE: rbs = 1 * if cbs == PETSC_DECIDE: cbs = rbs # <<<<<<<<<<<<<< * Sys_Layout(ccomm, rbs, &m, &M) * Sys_Layout(ccomm, cbs, &n, &N) */ __pyx_t_3 = (__pyx_v_cbs == PETSC_DECIDE); if (__pyx_t_3) { __pyx_v_cbs = __pyx_v_rbs; } /* "petsc4py/PETSc/Mat.pyx":946 * if rbs == PETSC_DECIDE: rbs = 1 * if cbs == PETSC_DECIDE: cbs = rbs * Sys_Layout(ccomm, rbs, &m, &M) # <<<<<<<<<<<<<< * Sys_Layout(ccomm, cbs, &n, &N) * # unpack CSR argument */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_Sys_Layout(__pyx_v_ccomm, __pyx_v_rbs, (&__pyx_v_m), (&__pyx_v_M)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 946, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":947 * if cbs == PETSC_DECIDE: cbs = rbs * Sys_Layout(ccomm, rbs, &m, &M) * Sys_Layout(ccomm, cbs, &n, &N) # <<<<<<<<<<<<<< * # unpack CSR argument * cdef object pi, pj, pv, poi, poj, pov */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_Sys_Layout(__pyx_v_ccomm, __pyx_v_cbs, (&__pyx_v_n), (&__pyx_v_N)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 947, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":950 * # unpack CSR argument * cdef object pi, pj, pv, poi, poj, pov * try: # <<<<<<<<<<<<<< * (pi, pj, pv), (poi, poj, pov) = csr * except (TypeError, ValueError): */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); /*try:*/ { /* "petsc4py/PETSc/Mat.pyx":951 * cdef object pi, pj, pv, poi, poj, pov * try: * (pi, pj, pv), (poi, poj, pov) = csr # <<<<<<<<<<<<<< * except (TypeError, ValueError): * pi, pj, pv = csr */ if ((likely(PyTuple_CheckExact(__pyx_v_csr))) || (PyList_CheckExact(__pyx_v_csr))) { PyObject* sequence = __pyx_v_csr; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(46, 951, __pyx_L5_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_7 = PyList_GET_ITEM(sequence, 0); __pyx_t_8 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); #else __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(46, 951, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(46, 951, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_8); #endif } else { Py_ssize_t index = -1; __pyx_t_9 = PyObject_GetIter(__pyx_v_csr); if (unlikely(!__pyx_t_9)) __PYX_ERR(46, 951, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); index = 0; __pyx_t_7 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_7)) goto __pyx_L11_unpacking_failed; __Pyx_GOTREF(__pyx_t_7); index = 1; __pyx_t_8 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L11_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(46, 951, __pyx_L5_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L12_unpacking_done; __pyx_L11_unpacking_failed:; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(46, 951, __pyx_L5_error) __pyx_L12_unpacking_done:; } if ((likely(PyTuple_CheckExact(__pyx_t_7))) || (PyList_CheckExact(__pyx_t_7))) { PyObject* sequence = __pyx_t_7; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(46, 951, __pyx_L5_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_11 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_12 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_9 = PyList_GET_ITEM(sequence, 0); __pyx_t_11 = PyList_GET_ITEM(sequence, 1); __pyx_t_12 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(__pyx_t_12); #else __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(46, 951, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_11 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 951, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_12 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_12)) __PYX_ERR(46, 951, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_12); #endif __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else { Py_ssize_t index = -1; __pyx_t_13 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 951, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_10 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_13); index = 0; __pyx_t_9 = __pyx_t_10(__pyx_t_13); if (unlikely(!__pyx_t_9)) goto __pyx_L13_unpacking_failed; __Pyx_GOTREF(__pyx_t_9); index = 1; __pyx_t_11 = __pyx_t_10(__pyx_t_13); if (unlikely(!__pyx_t_11)) goto __pyx_L13_unpacking_failed; __Pyx_GOTREF(__pyx_t_11); index = 2; __pyx_t_12 = __pyx_t_10(__pyx_t_13); if (unlikely(!__pyx_t_12)) goto __pyx_L13_unpacking_failed; __Pyx_GOTREF(__pyx_t_12); if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_13), 3) < 0) __PYX_ERR(46, 951, __pyx_L5_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; goto __pyx_L14_unpacking_done; __pyx_L13_unpacking_failed:; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(46, 951, __pyx_L5_error) __pyx_L14_unpacking_done:; } __pyx_v_pi = __pyx_t_9; __pyx_t_9 = 0; __pyx_v_pj = __pyx_t_11; __pyx_t_11 = 0; __pyx_v_pv = __pyx_t_12; __pyx_t_12 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_8))) || (PyList_CheckExact(__pyx_t_8))) { PyObject* sequence = __pyx_t_8; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(46, 951, __pyx_L5_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_12 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_11 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_9 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_12 = PyList_GET_ITEM(sequence, 0); __pyx_t_11 = PyList_GET_ITEM(sequence, 1); __pyx_t_9 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(__pyx_t_9); #else __pyx_t_12 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(46, 951, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_11 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 951, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_9 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_9)) __PYX_ERR(46, 951, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_9); #endif __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else { Py_ssize_t index = -1; __pyx_t_13 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 951, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_10 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_13); index = 0; __pyx_t_12 = __pyx_t_10(__pyx_t_13); if (unlikely(!__pyx_t_12)) goto __pyx_L15_unpacking_failed; __Pyx_GOTREF(__pyx_t_12); index = 1; __pyx_t_11 = __pyx_t_10(__pyx_t_13); if (unlikely(!__pyx_t_11)) goto __pyx_L15_unpacking_failed; __Pyx_GOTREF(__pyx_t_11); index = 2; __pyx_t_9 = __pyx_t_10(__pyx_t_13); if (unlikely(!__pyx_t_9)) goto __pyx_L15_unpacking_failed; __Pyx_GOTREF(__pyx_t_9); if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_13), 3) < 0) __PYX_ERR(46, 951, __pyx_L5_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; goto __pyx_L16_unpacking_done; __pyx_L15_unpacking_failed:; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(46, 951, __pyx_L5_error) __pyx_L16_unpacking_done:; } __pyx_v_poi = __pyx_t_12; __pyx_t_12 = 0; __pyx_v_poj = __pyx_t_11; __pyx_t_11 = 0; __pyx_v_pov = __pyx_t_9; __pyx_t_9 = 0; /* "petsc4py/PETSc/Mat.pyx":950 * # unpack CSR argument * cdef object pi, pj, pv, poi, poj, pov * try: # <<<<<<<<<<<<<< * (pi, pj, pv), (poi, poj, pov) = csr * except (TypeError, ValueError): */ } __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L10_try_end; __pyx_L5_error:; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; /* "petsc4py/PETSc/Mat.pyx":952 * try: * (pi, pj, pv), (poi, poj, pov) = csr * except (TypeError, ValueError): # <<<<<<<<<<<<<< * pi, pj, pv = csr * poi = poj = pov = None */ __pyx_t_14 = __Pyx_PyErr_ExceptionMatches2(__pyx_builtin_TypeError, __pyx_builtin_ValueError); if (__pyx_t_14) { __Pyx_AddTraceback("petsc4py.PETSc.Mat.createAIJWithArrays", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_9) < 0) __PYX_ERR(46, 952, __pyx_L7_except_error) __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_9); /* "petsc4py/PETSc/Mat.pyx":953 * (pi, pj, pv), (poi, poj, pov) = csr * except (TypeError, ValueError): * pi, pj, pv = csr # <<<<<<<<<<<<<< * poi = poj = pov = None * # rows, cols, and values */ if ((likely(PyTuple_CheckExact(__pyx_v_csr))) || (PyList_CheckExact(__pyx_v_csr))) { PyObject* sequence = __pyx_v_csr; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(46, 953, __pyx_L7_except_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_11 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_12 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_13 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_11 = PyList_GET_ITEM(sequence, 0); __pyx_t_12 = PyList_GET_ITEM(sequence, 1); __pyx_t_13 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(__pyx_t_13); #else __pyx_t_11 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 953, __pyx_L7_except_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_12 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(46, 953, __pyx_L7_except_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_13 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 953, __pyx_L7_except_error) __Pyx_GOTREF(__pyx_t_13); #endif } else { Py_ssize_t index = -1; __pyx_t_15 = PyObject_GetIter(__pyx_v_csr); if (unlikely(!__pyx_t_15)) __PYX_ERR(46, 953, __pyx_L7_except_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_10 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_15); index = 0; __pyx_t_11 = __pyx_t_10(__pyx_t_15); if (unlikely(!__pyx_t_11)) goto __pyx_L19_unpacking_failed; __Pyx_GOTREF(__pyx_t_11); index = 1; __pyx_t_12 = __pyx_t_10(__pyx_t_15); if (unlikely(!__pyx_t_12)) goto __pyx_L19_unpacking_failed; __Pyx_GOTREF(__pyx_t_12); index = 2; __pyx_t_13 = __pyx_t_10(__pyx_t_15); if (unlikely(!__pyx_t_13)) goto __pyx_L19_unpacking_failed; __Pyx_GOTREF(__pyx_t_13); if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_15), 3) < 0) __PYX_ERR(46, 953, __pyx_L7_except_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; goto __pyx_L20_unpacking_done; __pyx_L19_unpacking_failed:; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(46, 953, __pyx_L7_except_error) __pyx_L20_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_pi, __pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF_SET(__pyx_v_pj, __pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF_SET(__pyx_v_pv, __pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/Mat.pyx":954 * except (TypeError, ValueError): * pi, pj, pv = csr * poi = poj = pov = None # <<<<<<<<<<<<<< * # rows, cols, and values * cdef PetscInt ni=0, noi=0, *i=NULL, *oi=NULL */ __Pyx_INCREF(Py_None); __Pyx_XDECREF_SET(__pyx_v_poi, Py_None); __Pyx_INCREF(Py_None); __Pyx_XDECREF_SET(__pyx_v_poj, Py_None); __Pyx_INCREF(Py_None); __Pyx_XDECREF_SET(__pyx_v_pov, Py_None); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L6_exception_handled; } goto __pyx_L7_except_error; /* "petsc4py/PETSc/Mat.pyx":950 * # unpack CSR argument * cdef object pi, pj, pv, poi, poj, pov * try: # <<<<<<<<<<<<<< * (pi, pj, pv), (poi, poj, pov) = csr * except (TypeError, ValueError): */ __pyx_L7_except_error:; __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); goto __pyx_L1_error; __pyx_L6_exception_handled:; __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); __pyx_L10_try_end:; } /* "petsc4py/PETSc/Mat.pyx":956 * poi = poj = pov = None * # rows, cols, and values * cdef PetscInt ni=0, noi=0, *i=NULL, *oi=NULL # <<<<<<<<<<<<<< * cdef PetscInt nj=0, noj=0, *j=NULL, *oj=NULL * pi = iarray_i(pi, &ni, &i) # Row pointers (diagonal) */ __pyx_v_ni = 0; __pyx_v_noi = 0; __pyx_v_i = NULL; __pyx_v_oi = NULL; /* "petsc4py/PETSc/Mat.pyx":957 * # rows, cols, and values * cdef PetscInt ni=0, noi=0, *i=NULL, *oi=NULL * cdef PetscInt nj=0, noj=0, *j=NULL, *oj=NULL # <<<<<<<<<<<<<< * pi = iarray_i(pi, &ni, &i) # Row pointers (diagonal) * pj = iarray_i(pj, &nj, &j) # Column indices (diagonal) */ __pyx_v_nj = 0; __pyx_v_noj = 0; __pyx_v_j = NULL; __pyx_v_oj = NULL; /* "petsc4py/PETSc/Mat.pyx":958 * cdef PetscInt ni=0, noi=0, *i=NULL, *oi=NULL * cdef PetscInt nj=0, noj=0, *j=NULL, *oj=NULL * pi = iarray_i(pi, &ni, &i) # Row pointers (diagonal) # <<<<<<<<<<<<<< * pj = iarray_i(pj, &nj, &j) # Column indices (diagonal) * if ni != m+1: raise ValueError( */ __pyx_t_9 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_pi, (&__pyx_v_ni), (&__pyx_v_i))); if (unlikely(!__pyx_t_9)) __PYX_ERR(46, 958, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF_SET(__pyx_v_pi, __pyx_t_9); __pyx_t_9 = 0; /* "petsc4py/PETSc/Mat.pyx":959 * cdef PetscInt nj=0, noj=0, *j=NULL, *oj=NULL * pi = iarray_i(pi, &ni, &i) # Row pointers (diagonal) * pj = iarray_i(pj, &nj, &j) # Column indices (diagonal) # <<<<<<<<<<<<<< * if ni != m+1: raise ValueError( * "A matrix with %d rows requires a row pointer of length %d (given: %d)" % */ __pyx_t_9 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_pj, (&__pyx_v_nj), (&__pyx_v_j))); if (unlikely(!__pyx_t_9)) __PYX_ERR(46, 959, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF_SET(__pyx_v_pj, __pyx_t_9); __pyx_t_9 = 0; /* "petsc4py/PETSc/Mat.pyx":960 * pi = iarray_i(pi, &ni, &i) # Row pointers (diagonal) * pj = iarray_i(pj, &nj, &j) # Column indices (diagonal) * if ni != m+1: raise ValueError( # <<<<<<<<<<<<<< * "A matrix with %d rows requires a row pointer of length %d (given: %d)" % * (toInt(m), toInt(m+1), toInt(ni))) */ __pyx_t_3 = (__pyx_v_ni != (__pyx_v_m + 1)); if (unlikely(__pyx_t_3)) { /* "petsc4py/PETSc/Mat.pyx":962 * if ni != m+1: raise ValueError( * "A matrix with %d rows requires a row pointer of length %d (given: %d)" % * (toInt(m), toInt(m+1), toInt(ni))) # <<<<<<<<<<<<<< * if poi is not None and poj is not None: * poi = iarray_i(poi, &noi, &oi) # Row pointers (off-diagonal) */ __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_m); if (unlikely(!__pyx_t_9)) __PYX_ERR(46, 962, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_m + 1)); if (unlikely(!__pyx_t_7)) __PYX_ERR(46, 962, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ni); if (unlikely(!__pyx_t_8)) __PYX_ERR(46, 962, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_13 = PyTuple_New(3); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 962, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_GIVEREF(__pyx_t_9); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_9)) __PYX_ERR(46, 962, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_7)) __PYX_ERR(46, 962, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_8)) __PYX_ERR(46, 962, __pyx_L1_error); __pyx_t_9 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; /* "petsc4py/PETSc/Mat.pyx":961 * pj = iarray_i(pj, &nj, &j) # Column indices (diagonal) * if ni != m+1: raise ValueError( * "A matrix with %d rows requires a row pointer of length %d (given: %d)" % # <<<<<<<<<<<<<< * (toInt(m), toInt(m+1), toInt(ni))) * if poi is not None and poj is not None: */ __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_A_matrix_with_d_rows_requires_a, __pyx_t_13); if (unlikely(!__pyx_t_8)) __PYX_ERR(46, 961, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/Mat.pyx":960 * pi = iarray_i(pi, &ni, &i) # Row pointers (diagonal) * pj = iarray_i(pj, &nj, &j) # Column indices (diagonal) * if ni != m+1: raise ValueError( # <<<<<<<<<<<<<< * "A matrix with %d rows requires a row pointer of length %d (given: %d)" % * (toInt(m), toInt(m+1), toInt(ni))) */ __pyx_t_13 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_8); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 960, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_Raise(__pyx_t_13, 0, 0, 0); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __PYX_ERR(46, 960, __pyx_L1_error) } /* "petsc4py/PETSc/Mat.pyx":963 * "A matrix with %d rows requires a row pointer of length %d (given: %d)" % * (toInt(m), toInt(m+1), toInt(ni))) * if poi is not None and poj is not None: # <<<<<<<<<<<<<< * poi = iarray_i(poi, &noi, &oi) # Row pointers (off-diagonal) * poj = iarray_i(poj, &noj, &oj) # Column indices (off-diagonal) */ __pyx_t_16 = (__pyx_v_poi != Py_None); if (__pyx_t_16) { } else { __pyx_t_3 = __pyx_t_16; goto __pyx_L23_bool_binop_done; } __pyx_t_16 = (__pyx_v_poj != Py_None); __pyx_t_3 = __pyx_t_16; __pyx_L23_bool_binop_done:; if (__pyx_t_3) { /* "petsc4py/PETSc/Mat.pyx":964 * (toInt(m), toInt(m+1), toInt(ni))) * if poi is not None and poj is not None: * poi = iarray_i(poi, &noi, &oi) # Row pointers (off-diagonal) # <<<<<<<<<<<<<< * poj = iarray_i(poj, &noj, &oj) # Column indices (off-diagonal) * cdef PetscInt nv=0, nov=0 */ __pyx_t_13 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_poi, (&__pyx_v_noi), (&__pyx_v_oi))); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 964, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF_SET(__pyx_v_poi, __pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/Mat.pyx":965 * if poi is not None and poj is not None: * poi = iarray_i(poi, &noi, &oi) # Row pointers (off-diagonal) * poj = iarray_i(poj, &noj, &oj) # Column indices (off-diagonal) # <<<<<<<<<<<<<< * cdef PetscInt nv=0, nov=0 * cdef PetscScalar *v=NULL, *ov=NULL */ __pyx_t_13 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_poj, (&__pyx_v_noj), (&__pyx_v_oj))); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 965, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF_SET(__pyx_v_poj, __pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/Mat.pyx":963 * "A matrix with %d rows requires a row pointer of length %d (given: %d)" % * (toInt(m), toInt(m+1), toInt(ni))) * if poi is not None and poj is not None: # <<<<<<<<<<<<<< * poi = iarray_i(poi, &noi, &oi) # Row pointers (off-diagonal) * poj = iarray_i(poj, &noj, &oj) # Column indices (off-diagonal) */ } /* "petsc4py/PETSc/Mat.pyx":966 * poi = iarray_i(poi, &noi, &oi) # Row pointers (off-diagonal) * poj = iarray_i(poj, &noj, &oj) # Column indices (off-diagonal) * cdef PetscInt nv=0, nov=0 # <<<<<<<<<<<<<< * cdef PetscScalar *v=NULL, *ov=NULL * pv = iarray_s(pv, &nv, &v) # Non-zero values (diagonal) */ __pyx_v_nv = 0; __pyx_v_nov = 0; /* "petsc4py/PETSc/Mat.pyx":967 * poj = iarray_i(poj, &noj, &oj) # Column indices (off-diagonal) * cdef PetscInt nv=0, nov=0 * cdef PetscScalar *v=NULL, *ov=NULL # <<<<<<<<<<<<<< * pv = iarray_s(pv, &nv, &v) # Non-zero values (diagonal) * if nj != nv: raise ValueError( */ __pyx_v_v = NULL; __pyx_v_ov = NULL; /* "petsc4py/PETSc/Mat.pyx":968 * cdef PetscInt nv=0, nov=0 * cdef PetscScalar *v=NULL, *ov=NULL * pv = iarray_s(pv, &nv, &v) # Non-zero values (diagonal) # <<<<<<<<<<<<<< * if nj != nv: raise ValueError( * "Given %d column indices but %d non-zero values" % */ __pyx_t_13 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_s(__pyx_v_pv, (&__pyx_v_nv), (&__pyx_v_v))); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 968, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF_SET(__pyx_v_pv, __pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/Mat.pyx":969 * cdef PetscScalar *v=NULL, *ov=NULL * pv = iarray_s(pv, &nv, &v) # Non-zero values (diagonal) * if nj != nv: raise ValueError( # <<<<<<<<<<<<<< * "Given %d column indices but %d non-zero values" % * (toInt(nj), toInt(nv))) */ __pyx_t_3 = (__pyx_v_nj != __pyx_v_nv); if (unlikely(__pyx_t_3)) { /* "petsc4py/PETSc/Mat.pyx":971 * if nj != nv: raise ValueError( * "Given %d column indices but %d non-zero values" % * (toInt(nj), toInt(nv))) # <<<<<<<<<<<<<< * if pov is not None: * pov = iarray_s(pov, &nov, &ov) # Non-zero values (off-diagonal) */ __pyx_t_13 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nj); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 971, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nv); if (unlikely(!__pyx_t_8)) __PYX_ERR(46, 971, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(46, 971, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_13); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_13)) __PYX_ERR(46, 971, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_8)) __PYX_ERR(46, 971, __pyx_L1_error); __pyx_t_13 = 0; __pyx_t_8 = 0; /* "petsc4py/PETSc/Mat.pyx":970 * pv = iarray_s(pv, &nv, &v) # Non-zero values (diagonal) * if nj != nv: raise ValueError( * "Given %d column indices but %d non-zero values" % # <<<<<<<<<<<<<< * (toInt(nj), toInt(nv))) * if pov is not None: */ __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_Given_d_column_indices_but_d_non, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(46, 970, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "petsc4py/PETSc/Mat.pyx":969 * cdef PetscScalar *v=NULL, *ov=NULL * pv = iarray_s(pv, &nv, &v) # Non-zero values (diagonal) * if nj != nv: raise ValueError( # <<<<<<<<<<<<<< * "Given %d column indices but %d non-zero values" % * (toInt(nj), toInt(nv))) */ __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(46, 969, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __PYX_ERR(46, 969, __pyx_L1_error) } /* "petsc4py/PETSc/Mat.pyx":972 * "Given %d column indices but %d non-zero values" % * (toInt(nj), toInt(nv))) * if pov is not None: # <<<<<<<<<<<<<< * pov = iarray_s(pov, &nov, &ov) # Non-zero values (off-diagonal) * # create matrix */ __pyx_t_3 = (__pyx_v_pov != Py_None); if (__pyx_t_3) { /* "petsc4py/PETSc/Mat.pyx":973 * (toInt(nj), toInt(nv))) * if pov is not None: * pov = iarray_s(pov, &nov, &ov) # Non-zero values (off-diagonal) # <<<<<<<<<<<<<< * # create matrix * cdef PetscMat newmat = NULL */ __pyx_t_7 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_s(__pyx_v_pov, (&__pyx_v_nov), (&__pyx_v_ov))); if (unlikely(!__pyx_t_7)) __PYX_ERR(46, 973, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF_SET(__pyx_v_pov, __pyx_t_7); __pyx_t_7 = 0; /* "petsc4py/PETSc/Mat.pyx":972 * "Given %d column indices but %d non-zero values" % * (toInt(nj), toInt(nv))) * if pov is not None: # <<<<<<<<<<<<<< * pov = iarray_s(pov, &nov, &ov) # Non-zero values (off-diagonal) * # create matrix */ } /* "petsc4py/PETSc/Mat.pyx":975 * pov = iarray_s(pov, &nov, &ov) # Non-zero values (off-diagonal) * # create matrix * cdef PetscMat newmat = NULL # <<<<<<<<<<<<<< * if comm_size(ccomm) == 1: * CHKERR( MatCreateSeqAIJWithArrays( */ __pyx_v_newmat = NULL; /* "petsc4py/PETSc/Mat.pyx":976 * # create matrix * cdef PetscMat newmat = NULL * if comm_size(ccomm) == 1: # <<<<<<<<<<<<<< * CHKERR( MatCreateSeqAIJWithArrays( * ccomm, m, n, i, j, v, &newmat) ) */ __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_comm_size(__pyx_v_ccomm); if (unlikely(__pyx_t_14 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(46, 976, __pyx_L1_error) __pyx_t_3 = (__pyx_t_14 == 1); if (__pyx_t_3) { /* "petsc4py/PETSc/Mat.pyx":977 * cdef PetscMat newmat = NULL * if comm_size(ccomm) == 1: * CHKERR( MatCreateSeqAIJWithArrays( # <<<<<<<<<<<<<< * ccomm, m, n, i, j, v, &newmat) ) * csr = (pi, pj, pv) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreateSeqAIJWithArrays(__pyx_v_ccomm, __pyx_v_m, __pyx_v_n, __pyx_v_i, __pyx_v_j, __pyx_v_v, (&__pyx_v_newmat))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 977, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":979 * CHKERR( MatCreateSeqAIJWithArrays( * ccomm, m, n, i, j, v, &newmat) ) * csr = (pi, pj, pv) # <<<<<<<<<<<<<< * else: * # if off-diagonal components are provided then SplitArrays can be */ __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(46, 979, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_v_pi); __Pyx_GIVEREF(__pyx_v_pi); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_pi)) __PYX_ERR(46, 979, __pyx_L1_error); __Pyx_INCREF(__pyx_v_pj); __Pyx_GIVEREF(__pyx_v_pj); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_pj)) __PYX_ERR(46, 979, __pyx_L1_error); __Pyx_INCREF(__pyx_v_pv); __Pyx_GIVEREF(__pyx_v_pv); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_v_pv)) __PYX_ERR(46, 979, __pyx_L1_error); __Pyx_DECREF_SET(__pyx_v_csr, __pyx_t_7); __pyx_t_7 = 0; /* "petsc4py/PETSc/Mat.pyx":976 * # create matrix * cdef PetscMat newmat = NULL * if comm_size(ccomm) == 1: # <<<<<<<<<<<<<< * CHKERR( MatCreateSeqAIJWithArrays( * ccomm, m, n, i, j, v, &newmat) ) */ goto __pyx_L27; } /* "petsc4py/PETSc/Mat.pyx":983 * # if off-diagonal components are provided then SplitArrays can be * # used (and not cause a copy). * if oi != NULL and oj != NULL and ov != NULL: # <<<<<<<<<<<<<< * CHKERR( MatCreateMPIAIJWithSplitArrays( * ccomm, m, n, M, N, i, j, v, oi, oj, ov, &newmat) ) */ /*else*/ { __pyx_t_16 = (__pyx_v_oi != NULL); if (__pyx_t_16) { } else { __pyx_t_3 = __pyx_t_16; goto __pyx_L29_bool_binop_done; } __pyx_t_16 = (__pyx_v_oj != NULL); if (__pyx_t_16) { } else { __pyx_t_3 = __pyx_t_16; goto __pyx_L29_bool_binop_done; } __pyx_t_16 = (__pyx_v_ov != NULL); __pyx_t_3 = __pyx_t_16; __pyx_L29_bool_binop_done:; if (__pyx_t_3) { /* "petsc4py/PETSc/Mat.pyx":984 * # used (and not cause a copy). * if oi != NULL and oj != NULL and ov != NULL: * CHKERR( MatCreateMPIAIJWithSplitArrays( # <<<<<<<<<<<<<< * ccomm, m, n, M, N, i, j, v, oi, oj, ov, &newmat) ) * csr = ((pi, pj, pv), (poi, poj, pov)) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreateMPIAIJWithSplitArrays(__pyx_v_ccomm, __pyx_v_m, __pyx_v_n, __pyx_v_M, __pyx_v_N, __pyx_v_i, __pyx_v_j, __pyx_v_v, __pyx_v_oi, __pyx_v_oj, __pyx_v_ov, (&__pyx_v_newmat))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 984, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":986 * CHKERR( MatCreateMPIAIJWithSplitArrays( * ccomm, m, n, M, N, i, j, v, oi, oj, ov, &newmat) ) * csr = ((pi, pj, pv), (poi, poj, pov)) # <<<<<<<<<<<<<< * else: * CHKERR( MatCreateMPIAIJWithArrays( */ __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(46, 986, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_v_pi); __Pyx_GIVEREF(__pyx_v_pi); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_pi)) __PYX_ERR(46, 986, __pyx_L1_error); __Pyx_INCREF(__pyx_v_pj); __Pyx_GIVEREF(__pyx_v_pj); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_pj)) __PYX_ERR(46, 986, __pyx_L1_error); __Pyx_INCREF(__pyx_v_pv); __Pyx_GIVEREF(__pyx_v_pv); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_v_pv)) __PYX_ERR(46, 986, __pyx_L1_error); __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(46, 986, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_poi); __Pyx_GIVEREF(__pyx_v_poi); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_poi)) __PYX_ERR(46, 986, __pyx_L1_error); __Pyx_INCREF(__pyx_v_poj); __Pyx_GIVEREF(__pyx_v_poj); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_poj)) __PYX_ERR(46, 986, __pyx_L1_error); __Pyx_INCREF(__pyx_v_pov); __Pyx_GIVEREF(__pyx_v_pov); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_v_pov)) __PYX_ERR(46, 986, __pyx_L1_error); __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 986, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_7)) __PYX_ERR(46, 986, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_8)) __PYX_ERR(46, 986, __pyx_L1_error); __pyx_t_7 = 0; __pyx_t_8 = 0; __Pyx_DECREF_SET(__pyx_v_csr, __pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/Mat.pyx":983 * # if off-diagonal components are provided then SplitArrays can be * # used (and not cause a copy). * if oi != NULL and oj != NULL and ov != NULL: # <<<<<<<<<<<<<< * CHKERR( MatCreateMPIAIJWithSplitArrays( * ccomm, m, n, M, N, i, j, v, oi, oj, ov, &newmat) ) */ goto __pyx_L28; } /* "petsc4py/PETSc/Mat.pyx":988 * csr = ((pi, pj, pv), (poi, poj, pov)) * else: * CHKERR( MatCreateMPIAIJWithArrays( # <<<<<<<<<<<<<< * ccomm, m, n, M, N, i, j, v, &newmat) ) * csr = None */ /*else*/ { /* "petsc4py/PETSc/Mat.pyx":989 * else: * CHKERR( MatCreateMPIAIJWithArrays( * ccomm, m, n, M, N, i, j, v, &newmat) ) # <<<<<<<<<<<<<< * csr = None * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreateMPIAIJWithArrays(__pyx_v_ccomm, __pyx_v_m, __pyx_v_n, __pyx_v_M, __pyx_v_N, __pyx_v_i, __pyx_v_j, __pyx_v_v, (&__pyx_v_newmat))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 988, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":990 * CHKERR( MatCreateMPIAIJWithArrays( * ccomm, m, n, M, N, i, j, v, &newmat) ) * csr = None # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat * self.set_attr('__csr__', csr) */ __Pyx_INCREF(Py_None); __Pyx_DECREF_SET(__pyx_v_csr, Py_None); } __pyx_L28:; } __pyx_L27:; /* "petsc4py/PETSc/Mat.pyx":991 * ccomm, m, n, M, N, i, j, v, &newmat) ) * csr = None * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat # <<<<<<<<<<<<<< * self.set_attr('__csr__', csr) * return self */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 991, __pyx_L1_error) __pyx_v_self->mat = __pyx_v_newmat; /* "petsc4py/PETSc/Mat.pyx":992 * csr = None * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat * self.set_attr('__csr__', csr) # <<<<<<<<<<<<<< * return self * */ __pyx_t_13 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Mat *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__csr__"), __pyx_v_csr); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 992, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/Mat.pyx":993 * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat * self.set_attr('__csr__', csr) * return self # <<<<<<<<<<<<<< * * # */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":905 * return self * * def createAIJWithArrays( # <<<<<<<<<<<<<< * self, * size: MatSizeSpec, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_XDECREF(__pyx_t_15); __Pyx_AddTraceback("petsc4py.PETSc.Mat.createAIJWithArrays", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_pi); __Pyx_XDECREF(__pyx_v_pj); __Pyx_XDECREF(__pyx_v_pv); __Pyx_XDECREF(__pyx_v_poi); __Pyx_XDECREF(__pyx_v_poj); __Pyx_XDECREF(__pyx_v_pov); __Pyx_XDECREF(__pyx_v_csr); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":997 * # * * def createDense( # <<<<<<<<<<<<<< * self, * size: MatSizeSpec, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_79createDense(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_78createDense, "Mat.createDense(self, size: MatSizeSpec, bsize: MatBlockSizeSpec | None = None, array: Sequence[Scalar] | None = None, comm: Comm | None = None) -> Self\nCreate a `Type.DENSE` matrix.\n\n Collective.\n\n Parameters\n ----------\n size\n Matrix size.\n bsize\n Matrix block size. If `None`, a block size of ``1`` is set.\n array\n Optional matrix data. If `None`, memory is internally allocated.\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n createDenseCUDA, petsc.MATDENSE, petsc.MatCreateDense\n\n \nSource code at petsc4py/PETSc/Mat.pyx:997"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_79createDense(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_size = 0; PyObject *__pyx_v_bsize = 0; PyObject *__pyx_v_array = 0; PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createDense (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_bsize,&__pyx_n_s_array,&__pyx_n_s_comm,0}; /* "petsc4py/PETSc/Mat.pyx":1000 * self, * size: MatSizeSpec, * bsize: MatBlockSizeSpec | None = None, # <<<<<<<<<<<<<< * array: Sequence[Scalar] | None = None, * comm: Comm | None = None */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Mat.pyx":1001 * size: MatSizeSpec, * bsize: MatBlockSizeSpec | None = None, * array: Sequence[Scalar] | None = None, # <<<<<<<<<<<<<< * comm: Comm | None = None * ) -> Self: */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Mat.pyx":1002 * bsize: MatBlockSizeSpec | None = None, * array: Sequence[Scalar] | None = None, * comm: Comm | None = None # <<<<<<<<<<<<<< * ) -> Self: * """Create a `Type.DENSE` matrix. */ values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 997, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_bsize); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 997, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_array); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 997, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 997, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createDense") < 0)) __PYX_ERR(46, 997, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_size = values[0]; __pyx_v_bsize = values[1]; __pyx_v_array = values[2]; __pyx_v_comm = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createDense", 0, 1, 4, __pyx_nargs); __PYX_ERR(46, 997, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.createDense", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_78createDense(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_size, __pyx_v_bsize, __pyx_v_array, __pyx_v_comm); /* "petsc4py/PETSc/Mat.pyx":997 * # * * def createDense( # <<<<<<<<<<<<<< * self, * size: MatSizeSpec, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_78createDense(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PyObject *__pyx_v_array, PyObject *__pyx_v_comm) { Mat __pyx_v_newmat; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createDense", 0); __Pyx_INCREF(__pyx_v_array); /* "petsc4py/PETSc/Mat.pyx":1025 * """ * # create matrix * cdef PetscMat newmat = NULL # <<<<<<<<<<<<<< * Mat_Create(MATDENSE, comm, size, bsize, &newmat) * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat */ __pyx_v_newmat = NULL; /* "petsc4py/PETSc/Mat.pyx":1026 * # create matrix * cdef PetscMat newmat = NULL * Mat_Create(MATDENSE, comm, size, bsize, &newmat) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat * # preallocate matrix */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_Mat_Create(MATDENSE, __pyx_v_comm, __pyx_v_size, __pyx_v_bsize, (&__pyx_v_newmat)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1026, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":1027 * cdef PetscMat newmat = NULL * Mat_Create(MATDENSE, comm, size, bsize, &newmat) * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat # <<<<<<<<<<<<<< * # preallocate matrix * if array is not None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1027, __pyx_L1_error) __pyx_v_self->mat = __pyx_v_newmat; /* "petsc4py/PETSc/Mat.pyx":1029 * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat * # preallocate matrix * if array is not None: # <<<<<<<<<<<<<< * array = Mat_AllocDense(self.mat, array) * self.set_attr('__array__', array) */ __pyx_t_2 = (__pyx_v_array != Py_None); if (__pyx_t_2) { /* "petsc4py/PETSc/Mat.pyx":1030 * # preallocate matrix * if array is not None: * array = Mat_AllocDense(self.mat, array) # <<<<<<<<<<<<<< * self.set_attr('__array__', array) * return self */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_Mat_AllocDense(__pyx_v_self->mat, __pyx_v_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 1030, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_array, __pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/Mat.pyx":1031 * if array is not None: * array = Mat_AllocDense(self.mat, array) * self.set_attr('__array__', array) # <<<<<<<<<<<<<< * return self * */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Mat *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__array__"), __pyx_v_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 1031, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/Mat.pyx":1029 * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat * # preallocate matrix * if array is not None: # <<<<<<<<<<<<<< * array = Mat_AllocDense(self.mat, array) * self.set_attr('__array__', array) */ } /* "petsc4py/PETSc/Mat.pyx":1032 * array = Mat_AllocDense(self.mat, array) * self.set_attr('__array__', array) * return self # <<<<<<<<<<<<<< * * def createDenseCUDA( */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":997 * # * * def createDense( # <<<<<<<<<<<<<< * self, * size: MatSizeSpec, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.createDense", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_array); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":1034 * return self * * def createDenseCUDA( # <<<<<<<<<<<<<< * self, * size: MatSizeSpec, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_81createDenseCUDA(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_80createDenseCUDA, "Mat.createDenseCUDA(self, size: MatSizeSpec, bsize: MatBlockSizeSpec | None = None, array: Sequence[Scalar] | None = None, cudahandle: int | None = None, comm: Comm | None = None) -> Self\nCreate a `Type.DENSECUDA` matrix with optional host and device data.\n\n Collective.\n\n Parameters\n ----------\n size\n Matrix size.\n bsize\n Matrix block size. If `None`, a block size of ``1`` is set.\n array\n Host data. Will be lazily allocated if `None`.\n cudahandle\n Address of the array on the GPU. Will be lazily allocated if\n `None`. If ``cudahandle`` is provided, ``array`` will be\n ignored.\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n createDense, petsc.MatCreateDenseCUDA\n\n \nSource code at petsc4py/PETSc/Mat.pyx:1034"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_81createDenseCUDA(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_size = 0; PyObject *__pyx_v_bsize = 0; PyObject *__pyx_v_array = 0; PyObject *__pyx_v_cudahandle = 0; PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createDenseCUDA (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_bsize,&__pyx_n_s_array,&__pyx_n_s_cudahandle,&__pyx_n_s_comm,0}; /* "petsc4py/PETSc/Mat.pyx":1037 * self, * size: MatSizeSpec, * bsize: MatBlockSizeSpec | None = None, # <<<<<<<<<<<<<< * array: Sequence[Scalar] | None = None, * cudahandle: int | None = None, */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Mat.pyx":1038 * size: MatSizeSpec, * bsize: MatBlockSizeSpec | None = None, * array: Sequence[Scalar] | None = None, # <<<<<<<<<<<<<< * cudahandle: int | None = None, * comm: Comm | None = None, */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Mat.pyx":1039 * bsize: MatBlockSizeSpec | None = None, * array: Sequence[Scalar] | None = None, * cudahandle: int | None = None, # <<<<<<<<<<<<<< * comm: Comm | None = None, * ) -> Self: */ values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Mat.pyx":1040 * array: Sequence[Scalar] | None = None, * cudahandle: int | None = None, * comm: Comm | None = None, # <<<<<<<<<<<<<< * ) -> Self: * """Create a `Type.DENSECUDA` matrix with optional host and device data. */ values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 1034, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_bsize); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 1034, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_array); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 1034, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_cudahandle); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 1034, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 1034, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createDenseCUDA") < 0)) __PYX_ERR(46, 1034, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_size = values[0]; __pyx_v_bsize = values[1]; __pyx_v_array = values[2]; __pyx_v_cudahandle = values[3]; __pyx_v_comm = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createDenseCUDA", 0, 1, 5, __pyx_nargs); __PYX_ERR(46, 1034, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.createDenseCUDA", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_80createDenseCUDA(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_size, __pyx_v_bsize, __pyx_v_array, __pyx_v_cudahandle, __pyx_v_comm); /* "petsc4py/PETSc/Mat.pyx":1034 * return self * * def createDenseCUDA( # <<<<<<<<<<<<<< * self, * size: MatSizeSpec, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_80createDenseCUDA(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PyObject *__pyx_v_array, PyObject *__pyx_v_cudahandle, PyObject *__pyx_v_comm) { Mat __pyx_v_newmat; MPI_Comm __pyx_v_ccomm; PetscInt __pyx_v_rbs; PetscInt __pyx_v_cbs; PetscInt __pyx_v_m; PetscInt __pyx_v_n; PetscInt __pyx_v_M; PetscInt __pyx_v_N; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; int __pyx_t_2; PetscErrorCode __pyx_t_3; Py_uintptr_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createDenseCUDA", 0); __Pyx_INCREF(__pyx_v_array); /* "petsc4py/PETSc/Mat.pyx":1067 * """ * # create matrix * cdef PetscMat newmat = NULL # <<<<<<<<<<<<<< * # communicator * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) */ __pyx_v_newmat = NULL; /* "petsc4py/PETSc/Mat.pyx":1069 * cdef PetscMat newmat = NULL * # communicator * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * # sizes and block sizes * cdef PetscInt rbs = 0, cbs = 0, m = 0, n = 0, M = 0, N = 0 */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(46, 1069, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/Mat.pyx":1071 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * # sizes and block sizes * cdef PetscInt rbs = 0, cbs = 0, m = 0, n = 0, M = 0, N = 0 # <<<<<<<<<<<<<< * * # FIXME handle the case of array not None? */ __pyx_v_rbs = 0; __pyx_v_cbs = 0; __pyx_v_m = 0; __pyx_v_n = 0; __pyx_v_M = 0; __pyx_v_N = 0; /* "petsc4py/PETSc/Mat.pyx":1074 * * # FIXME handle the case of array not None? * if cudahandle is not None: # <<<<<<<<<<<<<< * Mat_Sizes(size, None, &rbs, &cbs, &m, &n, &M, &N) * if rbs == PETSC_DECIDE: rbs = 1 */ __pyx_t_2 = (__pyx_v_cudahandle != Py_None); if (__pyx_t_2) { /* "petsc4py/PETSc/Mat.pyx":1075 * # FIXME handle the case of array not None? * if cudahandle is not None: * Mat_Sizes(size, None, &rbs, &cbs, &m, &n, &M, &N) # <<<<<<<<<<<<<< * if rbs == PETSC_DECIDE: rbs = 1 * if cbs == PETSC_DECIDE: cbs = rbs */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_Mat_Sizes(__pyx_v_size, Py_None, (&__pyx_v_rbs), (&__pyx_v_cbs), (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_M), (&__pyx_v_N)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1075, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":1076 * if cudahandle is not None: * Mat_Sizes(size, None, &rbs, &cbs, &m, &n, &M, &N) * if rbs == PETSC_DECIDE: rbs = 1 # <<<<<<<<<<<<<< * if cbs == PETSC_DECIDE: cbs = rbs * Sys_Layout(ccomm, rbs, &m, &M) */ __pyx_t_2 = (__pyx_v_rbs == PETSC_DECIDE); if (__pyx_t_2) { __pyx_v_rbs = 1; } /* "petsc4py/PETSc/Mat.pyx":1077 * Mat_Sizes(size, None, &rbs, &cbs, &m, &n, &M, &N) * if rbs == PETSC_DECIDE: rbs = 1 * if cbs == PETSC_DECIDE: cbs = rbs # <<<<<<<<<<<<<< * Sys_Layout(ccomm, rbs, &m, &M) * Sys_Layout(ccomm, cbs, &n, &N) */ __pyx_t_2 = (__pyx_v_cbs == PETSC_DECIDE); if (__pyx_t_2) { __pyx_v_cbs = __pyx_v_rbs; } /* "petsc4py/PETSc/Mat.pyx":1078 * if rbs == PETSC_DECIDE: rbs = 1 * if cbs == PETSC_DECIDE: cbs = rbs * Sys_Layout(ccomm, rbs, &m, &M) # <<<<<<<<<<<<<< * Sys_Layout(ccomm, cbs, &n, &N) * # create matrix and set sizes */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_Sys_Layout(__pyx_v_ccomm, __pyx_v_rbs, (&__pyx_v_m), (&__pyx_v_M)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1078, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":1079 * if cbs == PETSC_DECIDE: cbs = rbs * Sys_Layout(ccomm, rbs, &m, &M) * Sys_Layout(ccomm, cbs, &n, &N) # <<<<<<<<<<<<<< * # create matrix and set sizes * CHKERR( MatCreateDenseCUDA(ccomm, m, n, M, N, (cudahandle), &newmat) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_Sys_Layout(__pyx_v_ccomm, __pyx_v_cbs, (&__pyx_v_n), (&__pyx_v_N)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1079, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":1081 * Sys_Layout(ccomm, cbs, &n, &N) * # create matrix and set sizes * CHKERR( MatCreateDenseCUDA(ccomm, m, n, M, N, (cudahandle), &newmat) ) # <<<<<<<<<<<<<< * # Does block size make sense for MATDENSE? * CHKERR( MatSetBlockSizes(newmat, rbs, cbs) ) */ __pyx_t_4 = __Pyx_PyInt_As_size_t(__pyx_v_cudahandle); if (unlikely((__pyx_t_4 == ((Py_uintptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(46, 1081, __pyx_L1_error) __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreateDenseCUDA(__pyx_v_ccomm, __pyx_v_m, __pyx_v_n, __pyx_v_M, __pyx_v_N, ((PetscScalar *)((Py_uintptr_t)__pyx_t_4)), (&__pyx_v_newmat))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1081, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":1083 * CHKERR( MatCreateDenseCUDA(ccomm, m, n, M, N, (cudahandle), &newmat) ) * # Does block size make sense for MATDENSE? * CHKERR( MatSetBlockSizes(newmat, rbs, cbs) ) # <<<<<<<<<<<<<< * else: * Mat_Create(MATDENSECUDA, comm, size, bsize, &newmat) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSetBlockSizes(__pyx_v_newmat, __pyx_v_rbs, __pyx_v_cbs)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1083, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":1074 * * # FIXME handle the case of array not None? * if cudahandle is not None: # <<<<<<<<<<<<<< * Mat_Sizes(size, None, &rbs, &cbs, &m, &n, &M, &N) * if rbs == PETSC_DECIDE: rbs = 1 */ goto __pyx_L3; } /* "petsc4py/PETSc/Mat.pyx":1085 * CHKERR( MatSetBlockSizes(newmat, rbs, cbs) ) * else: * Mat_Create(MATDENSECUDA, comm, size, bsize, &newmat) # <<<<<<<<<<<<<< * if array is not None: * array = Mat_AllocDense(self.mat, array) */ /*else*/ { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_Mat_Create(MATDENSECUDA, __pyx_v_comm, __pyx_v_size, __pyx_v_bsize, (&__pyx_v_newmat)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1085, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":1086 * else: * Mat_Create(MATDENSECUDA, comm, size, bsize, &newmat) * if array is not None: # <<<<<<<<<<<<<< * array = Mat_AllocDense(self.mat, array) * self.set_attr('__array__', array) */ __pyx_t_2 = (__pyx_v_array != Py_None); if (__pyx_t_2) { /* "petsc4py/PETSc/Mat.pyx":1087 * Mat_Create(MATDENSECUDA, comm, size, bsize, &newmat) * if array is not None: * array = Mat_AllocDense(self.mat, array) # <<<<<<<<<<<<<< * self.set_attr('__array__', array) * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_Mat_AllocDense(__pyx_v_self->mat, __pyx_v_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(46, 1087, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_array, __pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/Mat.pyx":1088 * if array is not None: * array = Mat_AllocDense(self.mat, array) * self.set_attr('__array__', array) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat * return self */ __pyx_t_5 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Mat *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__array__"), __pyx_v_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(46, 1088, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/Mat.pyx":1086 * else: * Mat_Create(MATDENSECUDA, comm, size, bsize, &newmat) * if array is not None: # <<<<<<<<<<<<<< * array = Mat_AllocDense(self.mat, array) * self.set_attr('__array__', array) */ } } __pyx_L3:; /* "petsc4py/PETSc/Mat.pyx":1089 * array = Mat_AllocDense(self.mat, array) * self.set_attr('__array__', array) * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat # <<<<<<<<<<<<<< * return self * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1089, __pyx_L1_error) __pyx_v_self->mat = __pyx_v_newmat; /* "petsc4py/PETSc/Mat.pyx":1090 * self.set_attr('__array__', array) * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat * return self # <<<<<<<<<<<<<< * * def setPreallocationDense(self, array: Sequence[Scalar]) -> Self: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":1034 * return self * * def createDenseCUDA( # <<<<<<<<<<<<<< * self, * size: MatSizeSpec, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.Mat.createDenseCUDA", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_array); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":1092 * return self * * def setPreallocationDense(self, array: Sequence[Scalar]) -> Self: # <<<<<<<<<<<<<< * """Set the array used for storing matrix elements for a dense matrix. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_83setPreallocationDense(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_82setPreallocationDense, "Mat.setPreallocationDense(self, array: Sequence[Scalar]) -> Self\nSet the array used for storing matrix elements for a dense matrix.\n\n Collective.\n\n Parameters\n ----------\n array\n Array that will be used to store matrix data.\n\n See Also\n --------\n petsc.MatSeqDenseSetPreallocation, petsc.MatMPIDenseSetPreallocation\n\n \nSource code at petsc4py/PETSc/Mat.pyx:1092"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_83setPreallocationDense(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_array = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPreallocationDense (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_array,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_array)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 1092, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setPreallocationDense") < 0)) __PYX_ERR(46, 1092, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_array = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPreallocationDense", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 1092, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.setPreallocationDense", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_82setPreallocationDense(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_array); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_82setPreallocationDense(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_array) { PetscBool __pyx_v_done; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPreallocationDense", 0); __Pyx_INCREF(__pyx_v_array); /* "petsc4py/PETSc/Mat.pyx":1107 * * """ * cdef PetscBool done = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( MatIsPreallocated(self.mat, &done) ) * # if done: raise Error(PETSC_ERR_ORDER) */ __pyx_v_done = PETSC_FALSE; /* "petsc4py/PETSc/Mat.pyx":1108 * """ * cdef PetscBool done = PETSC_FALSE * CHKERR( MatIsPreallocated(self.mat, &done) ) # <<<<<<<<<<<<<< * # if done: raise Error(PETSC_ERR_ORDER) * array = Mat_AllocDense(self.mat, array) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatIsPreallocated(__pyx_v_self->mat, (&__pyx_v_done))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1108, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":1110 * CHKERR( MatIsPreallocated(self.mat, &done) ) * # if done: raise Error(PETSC_ERR_ORDER) * array = Mat_AllocDense(self.mat, array) # <<<<<<<<<<<<<< * self.set_attr('__array__', array) * return self */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_Mat_AllocDense(__pyx_v_self->mat, __pyx_v_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 1110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_array, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/Mat.pyx":1111 * # if done: raise Error(PETSC_ERR_ORDER) * array = Mat_AllocDense(self.mat, array) * self.set_attr('__array__', array) # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Mat *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__array__"), __pyx_v_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 1111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/Mat.pyx":1112 * array = Mat_AllocDense(self.mat, array) * self.set_attr('__array__', array) * return self # <<<<<<<<<<<<<< * * # */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":1092 * return self * * def setPreallocationDense(self, array: Sequence[Scalar]) -> Self: # <<<<<<<<<<<<<< * """Set the array used for storing matrix elements for a dense matrix. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Mat.setPreallocationDense", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_array); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":1116 * # * * def createScatter(self, Scatter scatter, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Create a `Type.SCATTER` matrix from a vector scatter. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_85createScatter(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_84createScatter, "Mat.createScatter(self, scatter: Scatter, comm: Comm | None = None) -> Self\nCreate a `Type.SCATTER` matrix from a vector scatter.\n\n Collective.\n\n Parameters\n ----------\n scatter\n Vector scatter.\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n petsc.MATSCATTER, petsc.MatCreateScatter\n\n \nSource code at petsc4py/PETSc/Mat.pyx:1116"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_85createScatter(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscScatterObject *__pyx_v_scatter = 0; PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createScatter (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_scatter,&__pyx_n_s_comm,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_scatter)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 1116, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 1116, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createScatter") < 0)) __PYX_ERR(46, 1116, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_scatter = ((struct PyPetscScatterObject *)values[0]); __pyx_v_comm = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createScatter", 0, 1, 2, __pyx_nargs); __PYX_ERR(46, 1116, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.createScatter", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_scatter), __pyx_ptype_8petsc4py_5PETSc_Scatter, 0, "scatter", 0))) __PYX_ERR(46, 1116, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_84createScatter(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_scatter, __pyx_v_comm); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_84createScatter(struct PyPetscMatObject *__pyx_v_self, struct PyPetscScatterObject *__pyx_v_scatter, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; Mat __pyx_v_newmat; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; MPI_Comm __pyx_t_6; PetscErrorCode __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createScatter", 0); __Pyx_INCREF(__pyx_v_comm); /* "petsc4py/PETSc/Mat.pyx":1133 * * """ * if comm is None: comm = scatter.getComm() # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscMat newmat = NULL */ __pyx_t_1 = (__pyx_v_comm == Py_None); if (__pyx_t_1) { __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_scatter), __pyx_n_s_getComm); if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 1133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 1133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF_SET(__pyx_v_comm, __pyx_t_2); __pyx_t_2 = 0; } /* "petsc4py/PETSc/Mat.pyx":1134 * """ * if comm is None: comm = scatter.getComm() * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscMat newmat = NULL * CHKERR( MatCreateScatter(ccomm, scatter.sct, &newmat) ) */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_6 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(46, 1134, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_6; /* "petsc4py/PETSc/Mat.pyx":1135 * if comm is None: comm = scatter.getComm() * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscMat newmat = NULL # <<<<<<<<<<<<<< * CHKERR( MatCreateScatter(ccomm, scatter.sct, &newmat) ) * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat */ __pyx_v_newmat = NULL; /* "petsc4py/PETSc/Mat.pyx":1136 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscMat newmat = NULL * CHKERR( MatCreateScatter(ccomm, scatter.sct, &newmat) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat * return self */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreateScatter(__pyx_v_ccomm, __pyx_v_scatter->sct, (&__pyx_v_newmat))); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1136, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":1137 * cdef PetscMat newmat = NULL * CHKERR( MatCreateScatter(ccomm, scatter.sct, &newmat) ) * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat # <<<<<<<<<<<<<< * return self * */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1137, __pyx_L1_error) __pyx_v_self->mat = __pyx_v_newmat; /* "petsc4py/PETSc/Mat.pyx":1138 * CHKERR( MatCreateScatter(ccomm, scatter.sct, &newmat) ) * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat * return self # <<<<<<<<<<<<<< * * def createNormal(self, Mat mat) -> Self: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":1116 * # * * def createScatter(self, Scatter scatter, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Create a `Type.SCATTER` matrix from a vector scatter. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.Mat.createScatter", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_comm); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":1140 * return self * * def createNormal(self, Mat mat) -> Self: # <<<<<<<<<<<<<< * """Create a `Type.NORMAL` matrix representing AA. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_87createNormal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_86createNormal, "Mat.createNormal(self, mat: Mat) -> Self\nCreate a `Type.NORMAL` matrix representing A\341\265\200A.\n\n Collective.\n\n Parameters\n ----------\n mat\n The (possibly rectangular) matrix A.\n\n Notes\n -----\n The product A\341\265\200A is never actually formed. Instead A and A\341\265\200 are used\n during `mult` and various other matrix operations.\n\n See Also\n --------\n petsc.MATNORMAL, petsc.MatCreateNormal\n\n \nSource code at petsc4py/PETSc/Mat.pyx:1140"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_87createNormal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscMatObject *__pyx_v_mat = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createNormal (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mat)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 1140, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createNormal") < 0)) __PYX_ERR(46, 1140, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_mat = ((struct PyPetscMatObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createNormal", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 1140, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.createNormal", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(46, 1140, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_86createNormal(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_mat); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_86createNormal(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat) { Mat __pyx_v_newmat; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createNormal", 1); /* "petsc4py/PETSc/Mat.pyx":1160 * * """ * cdef PetscMat newmat = NULL # <<<<<<<<<<<<<< * CHKERR( MatCreateNormal(mat.mat, &newmat) ) * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat */ __pyx_v_newmat = NULL; /* "petsc4py/PETSc/Mat.pyx":1161 * """ * cdef PetscMat newmat = NULL * CHKERR( MatCreateNormal(mat.mat, &newmat) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat * return self */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreateNormal(__pyx_v_mat->mat, (&__pyx_v_newmat))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1161, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":1162 * cdef PetscMat newmat = NULL * CHKERR( MatCreateNormal(mat.mat, &newmat) ) * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1162, __pyx_L1_error) __pyx_v_self->mat = __pyx_v_newmat; /* "petsc4py/PETSc/Mat.pyx":1163 * CHKERR( MatCreateNormal(mat.mat, &newmat) ) * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat * return self # <<<<<<<<<<<<<< * * def createTranspose(self, Mat mat) -> Self: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":1140 * return self * * def createNormal(self, Mat mat) -> Self: # <<<<<<<<<<<<<< * """Create a `Type.NORMAL` matrix representing AA. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.createNormal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":1165 * return self * * def createTranspose(self, Mat mat) -> Self: # <<<<<<<<<<<<<< * """Create a `Type.TRANSPOSE` matrix that behaves like A. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_89createTranspose(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_88createTranspose, "Mat.createTranspose(self, mat: Mat) -> Self\nCreate a `Type.TRANSPOSE` matrix that behaves like A\341\265\200.\n\n Collective.\n\n Parameters\n ----------\n mat\n Matrix A to represent the transpose of.\n\n Notes\n -----\n The transpose is never actually formed. Instead `multTranspose` is\n called whenever the matrix-vector product is computed.\n\n See Also\n --------\n createNormal, petsc.MatCreateTranspose\n\n \nSource code at petsc4py/PETSc/Mat.pyx:1165"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_89createTranspose(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscMatObject *__pyx_v_mat = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createTranspose (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mat)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 1165, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createTranspose") < 0)) __PYX_ERR(46, 1165, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_mat = ((struct PyPetscMatObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createTranspose", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 1165, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.createTranspose", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(46, 1165, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_88createTranspose(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_mat); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_88createTranspose(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat) { Mat __pyx_v_newmat; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createTranspose", 1); /* "petsc4py/PETSc/Mat.pyx":1185 * * """ * cdef PetscMat newmat = NULL # <<<<<<<<<<<<<< * CHKERR( MatCreateTranspose(mat.mat, &newmat) ) * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat */ __pyx_v_newmat = NULL; /* "petsc4py/PETSc/Mat.pyx":1186 * """ * cdef PetscMat newmat = NULL * CHKERR( MatCreateTranspose(mat.mat, &newmat) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat * return self */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreateTranspose(__pyx_v_mat->mat, (&__pyx_v_newmat))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1186, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":1187 * cdef PetscMat newmat = NULL * CHKERR( MatCreateTranspose(mat.mat, &newmat) ) * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1187, __pyx_L1_error) __pyx_v_self->mat = __pyx_v_newmat; /* "petsc4py/PETSc/Mat.pyx":1188 * CHKERR( MatCreateTranspose(mat.mat, &newmat) ) * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat * return self # <<<<<<<<<<<<<< * * def createNormalHermitian(self, Mat mat) -> Self: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":1165 * return self * * def createTranspose(self, Mat mat) -> Self: # <<<<<<<<<<<<<< * """Create a `Type.TRANSPOSE` matrix that behaves like A. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.createTranspose", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":1190 * return self * * def createNormalHermitian(self, Mat mat) -> Self: # <<<<<<<<<<<<<< * """Create a `Type.NORMALHERMITIAN` matrix representing (A*)A. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_91createNormalHermitian(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_90createNormalHermitian, "Mat.createNormalHermitian(self, mat: Mat) -> Self\nCreate a `Type.NORMALHERMITIAN` matrix representing (A*)\341\265\200A.\n\n Collective.\n\n Parameters\n ----------\n mat\n The (possibly rectangular) matrix A.\n\n Notes\n -----\n The product (A*)\341\265\200A is never actually formed.\n\n See Also\n --------\n createHermitianTranspose, petsc.MATNORMAL, petsc.MATNORMALHERMITIAN\n petsc.MatCreateNormalHermitian\n\n \nSource code at petsc4py/PETSc/Mat.pyx:1190"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_91createNormalHermitian(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscMatObject *__pyx_v_mat = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createNormalHermitian (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mat)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 1190, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createNormalHermitian") < 0)) __PYX_ERR(46, 1190, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_mat = ((struct PyPetscMatObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createNormalHermitian", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 1190, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.createNormalHermitian", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(46, 1190, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_90createNormalHermitian(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_mat); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_90createNormalHermitian(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat) { Mat __pyx_v_newmat; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createNormalHermitian", 1); /* "petsc4py/PETSc/Mat.pyx":1210 * * """ * cdef PetscMat newmat = NULL # <<<<<<<<<<<<<< * CHKERR( MatCreateNormalHermitian(mat.mat, &newmat) ) * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat */ __pyx_v_newmat = NULL; /* "petsc4py/PETSc/Mat.pyx":1211 * """ * cdef PetscMat newmat = NULL * CHKERR( MatCreateNormalHermitian(mat.mat, &newmat) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat * return self */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreateNormalHermitian(__pyx_v_mat->mat, (&__pyx_v_newmat))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1211, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":1212 * cdef PetscMat newmat = NULL * CHKERR( MatCreateNormalHermitian(mat.mat, &newmat) ) * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1212, __pyx_L1_error) __pyx_v_self->mat = __pyx_v_newmat; /* "petsc4py/PETSc/Mat.pyx":1213 * CHKERR( MatCreateNormalHermitian(mat.mat, &newmat) ) * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat * return self # <<<<<<<<<<<<<< * * def createHermitianTranspose(self, Mat mat) -> Self: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":1190 * return self * * def createNormalHermitian(self, Mat mat) -> Self: # <<<<<<<<<<<<<< * """Create a `Type.NORMALHERMITIAN` matrix representing (A*)A. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.createNormalHermitian", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":1215 * return self * * def createHermitianTranspose(self, Mat mat) -> Self: # <<<<<<<<<<<<<< * """Create a `Type.HERMITIANTRANSPOSE` matrix that behaves like (A*). * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_93createHermitianTranspose(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_92createHermitianTranspose, "Mat.createHermitianTranspose(self, mat: Mat) -> Self\nCreate a `Type.HERMITIANTRANSPOSE` matrix that behaves like (A*)\341\265\200.\n\n Collective.\n\n Parameters\n ----------\n mat\n Matrix A to represent the hermitian transpose of.\n\n Notes\n -----\n The Hermitian transpose is never actually formed.\n\n See Also\n --------\n createNormal, createNormalHermitian\n petsc.MATHERMITIANTRANSPOSEVIRTUAL, petsc.MatCreateHermitianTranspose\n\n \nSource code at petsc4py/PETSc/Mat.pyx:1215"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_93createHermitianTranspose(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscMatObject *__pyx_v_mat = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createHermitianTranspose (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mat)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 1215, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createHermitianTranspose") < 0)) __PYX_ERR(46, 1215, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_mat = ((struct PyPetscMatObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createHermitianTranspose", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 1215, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.createHermitianTranspose", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(46, 1215, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_92createHermitianTranspose(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_mat); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_92createHermitianTranspose(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat) { Mat __pyx_v_newmat; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createHermitianTranspose", 1); /* "petsc4py/PETSc/Mat.pyx":1235 * * """ * cdef PetscMat newmat = NULL # <<<<<<<<<<<<<< * CHKERR( MatCreateHermitianTranspose(mat.mat, &newmat) ) * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat */ __pyx_v_newmat = NULL; /* "petsc4py/PETSc/Mat.pyx":1236 * """ * cdef PetscMat newmat = NULL * CHKERR( MatCreateHermitianTranspose(mat.mat, &newmat) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat * return self */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreateHermitianTranspose(__pyx_v_mat->mat, (&__pyx_v_newmat))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1236, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":1237 * cdef PetscMat newmat = NULL * CHKERR( MatCreateHermitianTranspose(mat.mat, &newmat) ) * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1237, __pyx_L1_error) __pyx_v_self->mat = __pyx_v_newmat; /* "petsc4py/PETSc/Mat.pyx":1238 * CHKERR( MatCreateHermitianTranspose(mat.mat, &newmat) ) * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat * return self # <<<<<<<<<<<<<< * * def createLRC(self, Mat A, Mat U, Vec c, Mat V) -> Self: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":1215 * return self * * def createHermitianTranspose(self, Mat mat) -> Self: # <<<<<<<<<<<<<< * """Create a `Type.HERMITIANTRANSPOSE` matrix that behaves like (A*). * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.createHermitianTranspose", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":1240 * return self * * def createLRC(self, Mat A, Mat U, Vec c, Mat V) -> Self: # <<<<<<<<<<<<<< * """Create a low-rank correction `Type.LRC` matrix representing A + UCV. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_95createLRC(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_94createLRC, "Mat.createLRC(self, A: Mat, U: Mat, c: Vec, V: Mat) -> Self\nCreate a low-rank correction `Type.LRC` matrix representing A + UCV\341\265\200.\n\n Collective.\n\n Parameters\n ----------\n A\n Sparse matrix, can be `None`.\n U, V\n Dense rectangular matrices.\n c\n Vector containing the diagonal of C, can be `None`.\n\n Notes\n -----\n The matrix A + UCV\341\265\200 is never actually formed.\n\n C is a diagonal matrix (represented as a vector) of order k, where k\n is the number of columns of both U and V.\n\n If A is `None` then the new object behaves like a low-rank matrix UCV\341\265\200.\n\n Use the same matrix for ``V`` and ``U`` (or ``V=None``) for a symmetric\n low-rank correction, A + UCU\341\265\200.\n\n If ``c`` is `None` then the low-rank correction is just U*V\341\265\200. If a\n sequential ``c`` vector is used for a parallel matrix, PETSc assumes\n that the values of the vector are consistently set across processors.\n\n See Also\n --------\n petsc.MATLRC, petsc.MatCreateLRC\n\n \nSource code at petsc4py/PETSc/Mat.pyx:1240"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_95createLRC(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscMatObject *__pyx_v_A = 0; struct PyPetscMatObject *__pyx_v_U = 0; struct PyPetscVecObject *__pyx_v_c = 0; struct PyPetscMatObject *__pyx_v_V = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createLRC (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_U,&__pyx_n_s_c,&__pyx_n_s_V,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_A)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 1240, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_U)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 1240, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("createLRC", 1, 4, 4, 1); __PYX_ERR(46, 1240, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_c)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 1240, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("createLRC", 1, 4, 4, 2); __PYX_ERR(46, 1240, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_V)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 1240, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("createLRC", 1, 4, 4, 3); __PYX_ERR(46, 1240, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createLRC") < 0)) __PYX_ERR(46, 1240, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 4)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); } __pyx_v_A = ((struct PyPetscMatObject *)values[0]); __pyx_v_U = ((struct PyPetscMatObject *)values[1]); __pyx_v_c = ((struct PyPetscVecObject *)values[2]); __pyx_v_V = ((struct PyPetscMatObject *)values[3]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createLRC", 1, 4, 4, __pyx_nargs); __PYX_ERR(46, 1240, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.createLRC", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_A), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "A", 0))) __PYX_ERR(46, 1240, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_U), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "U", 0))) __PYX_ERR(46, 1240, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_c), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "c", 0))) __PYX_ERR(46, 1240, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_V), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "V", 0))) __PYX_ERR(46, 1240, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_94createLRC(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_A, __pyx_v_U, __pyx_v_c, __pyx_v_V); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_94createLRC(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_A, struct PyPetscMatObject *__pyx_v_U, struct PyPetscVecObject *__pyx_v_c, struct PyPetscMatObject *__pyx_v_V) { Mat __pyx_v_Amat; Mat __pyx_v_Umat; Vec __pyx_v_cvec; Mat __pyx_v_Vmat; Mat __pyx_v_newmat; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Mat __pyx_t_1; int __pyx_t_2; Vec __pyx_t_3; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createLRC", 1); /* "petsc4py/PETSc/Mat.pyx":1275 * * """ * cdef PetscMat Amat = NULL # <<<<<<<<<<<<<< * cdef PetscMat Umat = U.mat * cdef PetscVec cvec = NULL */ __pyx_v_Amat = NULL; /* "petsc4py/PETSc/Mat.pyx":1276 * """ * cdef PetscMat Amat = NULL * cdef PetscMat Umat = U.mat # <<<<<<<<<<<<<< * cdef PetscVec cvec = NULL * cdef PetscMat Vmat = NULL */ __pyx_t_1 = __pyx_v_U->mat; __pyx_v_Umat = __pyx_t_1; /* "petsc4py/PETSc/Mat.pyx":1277 * cdef PetscMat Amat = NULL * cdef PetscMat Umat = U.mat * cdef PetscVec cvec = NULL # <<<<<<<<<<<<<< * cdef PetscMat Vmat = NULL * cdef PetscMat newmat = NULL */ __pyx_v_cvec = NULL; /* "petsc4py/PETSc/Mat.pyx":1278 * cdef PetscMat Umat = U.mat * cdef PetscVec cvec = NULL * cdef PetscMat Vmat = NULL # <<<<<<<<<<<<<< * cdef PetscMat newmat = NULL * if A is not None: Amat = A.mat */ __pyx_v_Vmat = NULL; /* "petsc4py/PETSc/Mat.pyx":1279 * cdef PetscVec cvec = NULL * cdef PetscMat Vmat = NULL * cdef PetscMat newmat = NULL # <<<<<<<<<<<<<< * if A is not None: Amat = A.mat * if c is not None: cvec = c.vec */ __pyx_v_newmat = NULL; /* "petsc4py/PETSc/Mat.pyx":1280 * cdef PetscMat Vmat = NULL * cdef PetscMat newmat = NULL * if A is not None: Amat = A.mat # <<<<<<<<<<<<<< * if c is not None: cvec = c.vec * if V is not None: Vmat = V.mat */ __pyx_t_2 = (((PyObject *)__pyx_v_A) != Py_None); if (__pyx_t_2) { __pyx_t_1 = __pyx_v_A->mat; __pyx_v_Amat = __pyx_t_1; } /* "petsc4py/PETSc/Mat.pyx":1281 * cdef PetscMat newmat = NULL * if A is not None: Amat = A.mat * if c is not None: cvec = c.vec # <<<<<<<<<<<<<< * if V is not None: Vmat = V.mat * CHKERR( MatCreateLRC(Amat, Umat, cvec, Vmat, &newmat) ) */ __pyx_t_2 = (((PyObject *)__pyx_v_c) != Py_None); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_c->vec; __pyx_v_cvec = __pyx_t_3; } /* "petsc4py/PETSc/Mat.pyx":1282 * if A is not None: Amat = A.mat * if c is not None: cvec = c.vec * if V is not None: Vmat = V.mat # <<<<<<<<<<<<<< * CHKERR( MatCreateLRC(Amat, Umat, cvec, Vmat, &newmat) ) * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat */ __pyx_t_2 = (((PyObject *)__pyx_v_V) != Py_None); if (__pyx_t_2) { __pyx_t_1 = __pyx_v_V->mat; __pyx_v_Vmat = __pyx_t_1; } /* "petsc4py/PETSc/Mat.pyx":1283 * if c is not None: cvec = c.vec * if V is not None: Vmat = V.mat * CHKERR( MatCreateLRC(Amat, Umat, cvec, Vmat, &newmat) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat * return self */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreateLRC(__pyx_v_Amat, __pyx_v_Umat, __pyx_v_cvec, __pyx_v_Vmat, (&__pyx_v_newmat))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1283, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":1284 * if V is not None: Vmat = V.mat * CHKERR( MatCreateLRC(Amat, Umat, cvec, Vmat, &newmat) ) * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat # <<<<<<<<<<<<<< * return self * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1284, __pyx_L1_error) __pyx_v_self->mat = __pyx_v_newmat; /* "petsc4py/PETSc/Mat.pyx":1285 * CHKERR( MatCreateLRC(Amat, Umat, cvec, Vmat, &newmat) ) * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat * return self # <<<<<<<<<<<<<< * * def createSubMatrixVirtual(self, Mat A, IS isrow, IS iscol=None) -> Self: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":1240 * return self * * def createLRC(self, Mat A, Mat U, Vec c, Mat V) -> Self: # <<<<<<<<<<<<<< * """Create a low-rank correction `Type.LRC` matrix representing A + UCV. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.createLRC", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":1287 * return self * * def createSubMatrixVirtual(self, Mat A, IS isrow, IS iscol=None) -> Self: # <<<<<<<<<<<<<< * """Create a `Type.SUBMATRIX` matrix that acts as a submatrix. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_97createSubMatrixVirtual(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_96createSubMatrixVirtual, "Mat.createSubMatrixVirtual(self, A: Mat, isrow: IS, iscol: IS | None = None) -> Self\nCreate a `Type.SUBMATRIX` matrix that acts as a submatrix.\n\n Collective.\n\n Parameters\n ----------\n A\n Matrix to extract submatrix from.\n isrow\n Rows present in the submatrix.\n iscol\n Columns present in the submatrix, defaults to ``isrow``.\n\n See Also\n --------\n petsc.MatCreateSubMatrixVirtual\n\n \nSource code at petsc4py/PETSc/Mat.pyx:1287"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_97createSubMatrixVirtual(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscMatObject *__pyx_v_A = 0; struct PyPetscISObject *__pyx_v_isrow = 0; struct PyPetscISObject *__pyx_v_iscol = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createSubMatrixVirtual (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_isrow,&__pyx_n_s_iscol,0}; values[2] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscISObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_A)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 1287, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_isrow)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 1287, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("createSubMatrixVirtual", 0, 2, 3, 1); __PYX_ERR(46, 1287, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_iscol); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 1287, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createSubMatrixVirtual") < 0)) __PYX_ERR(46, 1287, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_A = ((struct PyPetscMatObject *)values[0]); __pyx_v_isrow = ((struct PyPetscISObject *)values[1]); __pyx_v_iscol = ((struct PyPetscISObject *)values[2]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createSubMatrixVirtual", 0, 2, 3, __pyx_nargs); __PYX_ERR(46, 1287, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.createSubMatrixVirtual", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_A), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "A", 0))) __PYX_ERR(46, 1287, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isrow), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "isrow", 0))) __PYX_ERR(46, 1287, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iscol), __pyx_ptype_8petsc4py_5PETSc_IS, 1, "iscol", 0))) __PYX_ERR(46, 1287, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_96createSubMatrixVirtual(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_A, __pyx_v_isrow, __pyx_v_iscol); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_96createSubMatrixVirtual(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_A, struct PyPetscISObject *__pyx_v_isrow, struct PyPetscISObject *__pyx_v_iscol) { Mat __pyx_v_newmat; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createSubMatrixVirtual", 0); __Pyx_INCREF((PyObject *)__pyx_v_iscol); /* "petsc4py/PETSc/Mat.pyx":1306 * * """ * if iscol is None: iscol = isrow # <<<<<<<<<<<<<< * cdef PetscMat newmat = NULL * CHKERR( MatCreateSubMatrixVirtual(A.mat, isrow.iset, iscol.iset, &newmat) ) */ __pyx_t_1 = (((PyObject *)__pyx_v_iscol) == Py_None); if (__pyx_t_1) { __Pyx_INCREF((PyObject *)__pyx_v_isrow); __Pyx_DECREF_SET(__pyx_v_iscol, __pyx_v_isrow); } /* "petsc4py/PETSc/Mat.pyx":1307 * """ * if iscol is None: iscol = isrow * cdef PetscMat newmat = NULL # <<<<<<<<<<<<<< * CHKERR( MatCreateSubMatrixVirtual(A.mat, isrow.iset, iscol.iset, &newmat) ) * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat */ __pyx_v_newmat = NULL; /* "petsc4py/PETSc/Mat.pyx":1308 * if iscol is None: iscol = isrow * cdef PetscMat newmat = NULL * CHKERR( MatCreateSubMatrixVirtual(A.mat, isrow.iset, iscol.iset, &newmat) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat * return self */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreateSubMatrixVirtual(__pyx_v_A->mat, __pyx_v_isrow->iset, __pyx_v_iscol->iset, (&__pyx_v_newmat))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1308, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":1309 * cdef PetscMat newmat = NULL * CHKERR( MatCreateSubMatrixVirtual(A.mat, isrow.iset, iscol.iset, &newmat) ) * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1309, __pyx_L1_error) __pyx_v_self->mat = __pyx_v_newmat; /* "petsc4py/PETSc/Mat.pyx":1310 * CHKERR( MatCreateSubMatrixVirtual(A.mat, isrow.iset, iscol.iset, &newmat) ) * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat * return self # <<<<<<<<<<<<<< * * def createNest( */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":1287 * return self * * def createSubMatrixVirtual(self, Mat A, IS isrow, IS iscol=None) -> Self: # <<<<<<<<<<<<<< * """Create a `Type.SUBMATRIX` matrix that acts as a submatrix. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.createSubMatrixVirtual", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_iscol); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":1312 * return self * * def createNest( # <<<<<<<<<<<<<< * self, * mats: Sequence[Sequence[Mat]], */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_99createNest(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_98createNest, "Mat.createNest(self, mats: Sequence[Sequence[Mat]], isrows: Sequence[IS] | None = None, iscols: Sequence[IS] | None = None, comm: Comm | None = None) -> Self\nCreate a `Type.NEST` matrix containing multiple submatrices.\n\n Collective.\n\n Parameters\n ----------\n mats\n Iterable of matrix block rows with size ``len(isrows)``.\n Each matrix block row must be of size ``len(iscols)``.\n Empty submatrices can be set with `None`.\n isrows\n Index set for each nested row block, defaults to contiguous\n ordering.\n iscols\n Index set for each nested column block, defaults to contiguous\n ordering.\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n petsc.MatCreateNest, petsc.MATNEST\n\n \nSource code at petsc4py/PETSc/Mat.pyx:1312"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_99createNest(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_mats = 0; PyObject *__pyx_v_isrows = 0; PyObject *__pyx_v_iscols = 0; PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createNest (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mats,&__pyx_n_s_isrows,&__pyx_n_s_iscols,&__pyx_n_s_comm,0}; /* "petsc4py/PETSc/Mat.pyx":1315 * self, * mats: Sequence[Sequence[Mat]], * isrows: Sequence[IS] | None = None, # <<<<<<<<<<<<<< * iscols: Sequence[IS] | None = None, * comm: Comm | None = None, */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Mat.pyx":1316 * mats: Sequence[Sequence[Mat]], * isrows: Sequence[IS] | None = None, * iscols: Sequence[IS] | None = None, # <<<<<<<<<<<<<< * comm: Comm | None = None, * ) -> Self: */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Mat.pyx":1317 * isrows: Sequence[IS] | None = None, * iscols: Sequence[IS] | None = None, * comm: Comm | None = None, # <<<<<<<<<<<<<< * ) -> Self: * """Create a `Type.NEST` matrix containing multiple submatrices. */ values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mats)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 1312, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_isrows); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 1312, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_iscols); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 1312, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 1312, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createNest") < 0)) __PYX_ERR(46, 1312, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_mats = values[0]; __pyx_v_isrows = values[1]; __pyx_v_iscols = values[2]; __pyx_v_comm = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createNest", 0, 1, 4, __pyx_nargs); __PYX_ERR(46, 1312, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.createNest", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_98createNest(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_mats, __pyx_v_isrows, __pyx_v_iscols, __pyx_v_comm); /* "petsc4py/PETSc/Mat.pyx":1312 * return self * * def createNest( # <<<<<<<<<<<<<< * self, * mats: Sequence[Sequence[Mat]], */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_98createNest(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_mats, PyObject *__pyx_v_isrows, PyObject *__pyx_v_iscols, PyObject *__pyx_v_comm) { PyObject *__pyx_v_mat = 0; MPI_Comm __pyx_v_ccomm; Py_ssize_t __pyx_v_i; Py_ssize_t __pyx_v_mr; Py_ssize_t __pyx_v_j; Py_ssize_t __pyx_v_mc; PetscInt __pyx_v_nr; PetscInt __pyx_v_nc; Mat *__pyx_v_cmats; IS *__pyx_v_cisrows; IS *__pyx_v_ciscols; CYTHON_UNUSED PyObject *__pyx_v_tmp1 = 0; CYTHON_UNUSED PyObject *__pyx_v_tmp2 = 0; CYTHON_UNUSED PyObject *__pyx_v_tmp3 = 0; Mat __pyx_v_newmat; PyObject *__pyx_8genexpr3__pyx_v_mat = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; PyObject *(*__pyx_t_4)(PyObject *); PyObject *__pyx_t_5 = NULL; int __pyx_t_6; Py_ssize_t __pyx_t_7; MPI_Comm __pyx_t_8; Mat __pyx_t_9; IS __pyx_t_10; PetscErrorCode __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createNest", 0); __Pyx_INCREF(__pyx_v_mats); __Pyx_INCREF(__pyx_v_isrows); __Pyx_INCREF(__pyx_v_iscols); /* "petsc4py/PETSc/Mat.pyx":1344 * """ * cdef object mat * mats = [list(mat) for mat in mats] # <<<<<<<<<<<<<< * if isrows: * isrows = list(isrows) */ { /* enter inner scope */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 1344, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_v_mats)) || PyTuple_CheckExact(__pyx_v_mats)) { __pyx_t_2 = __pyx_v_mats; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_mats); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 1344, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 1344, __pyx_L5_error) } for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_2))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(46, 1344, __pyx_L5_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(46, 1344, __pyx_L5_error) #else __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(46, 1344, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(46, 1344, __pyx_L5_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(46, 1344, __pyx_L5_error) #else __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(46, 1344, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_5); #endif } } else { __pyx_t_5 = __pyx_t_4(__pyx_t_2); if (unlikely(!__pyx_t_5)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(46, 1344, __pyx_L5_error) } break; } __Pyx_GOTREF(__pyx_t_5); } __Pyx_XDECREF_SET(__pyx_8genexpr3__pyx_v_mat, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PySequence_List(__pyx_8genexpr3__pyx_v_mat); if (unlikely(!__pyx_t_5)) __PYX_ERR(46, 1344, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_5); if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(46, 1344, __pyx_L5_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_mat); __pyx_8genexpr3__pyx_v_mat = 0; goto __pyx_L9_exit_scope; __pyx_L5_error:; __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_mat); __pyx_8genexpr3__pyx_v_mat = 0; goto __pyx_L1_error; __pyx_L9_exit_scope:; } /* exit inner scope */ __Pyx_DECREF_SET(__pyx_v_mats, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Mat.pyx":1345 * cdef object mat * mats = [list(mat) for mat in mats] * if isrows: # <<<<<<<<<<<<<< * isrows = list(isrows) * assert len(isrows) == len(mats) */ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_isrows); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(46, 1345, __pyx_L1_error) if (__pyx_t_6) { /* "petsc4py/PETSc/Mat.pyx":1346 * mats = [list(mat) for mat in mats] * if isrows: * isrows = list(isrows) # <<<<<<<<<<<<<< * assert len(isrows) == len(mats) * else: */ __pyx_t_1 = PySequence_List(__pyx_v_isrows); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 1346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_isrows, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Mat.pyx":1347 * if isrows: * isrows = list(isrows) * assert len(isrows) == len(mats) # <<<<<<<<<<<<<< * else: * isrows = None */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_3 = PyObject_Length(__pyx_v_isrows); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(46, 1347, __pyx_L1_error) __pyx_t_7 = PyObject_Length(__pyx_v_mats); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(46, 1347, __pyx_L1_error) __pyx_t_6 = (__pyx_t_3 == __pyx_t_7); if (unlikely(!__pyx_t_6)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(46, 1347, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(46, 1347, __pyx_L1_error) #endif /* "petsc4py/PETSc/Mat.pyx":1345 * cdef object mat * mats = [list(mat) for mat in mats] * if isrows: # <<<<<<<<<<<<<< * isrows = list(isrows) * assert len(isrows) == len(mats) */ goto __pyx_L10; } /* "petsc4py/PETSc/Mat.pyx":1349 * assert len(isrows) == len(mats) * else: * isrows = None # <<<<<<<<<<<<<< * if iscols: * iscols = list(iscols) */ /*else*/ { __Pyx_INCREF(Py_None); __Pyx_DECREF_SET(__pyx_v_isrows, Py_None); } __pyx_L10:; /* "petsc4py/PETSc/Mat.pyx":1350 * else: * isrows = None * if iscols: # <<<<<<<<<<<<<< * iscols = list(iscols) * assert len(iscols) == len(mats[0]) */ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_iscols); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(46, 1350, __pyx_L1_error) if (__pyx_t_6) { /* "petsc4py/PETSc/Mat.pyx":1351 * isrows = None * if iscols: * iscols = list(iscols) # <<<<<<<<<<<<<< * assert len(iscols) == len(mats[0]) * else: */ __pyx_t_1 = PySequence_List(__pyx_v_iscols); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 1351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_iscols, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Mat.pyx":1352 * if iscols: * iscols = list(iscols) * assert len(iscols) == len(mats[0]) # <<<<<<<<<<<<<< * else: * iscols = None */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_7 = PyObject_Length(__pyx_v_iscols); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(46, 1352, __pyx_L1_error) __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_mats, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 1352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(46, 1352, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = (__pyx_t_7 == __pyx_t_3); if (unlikely(!__pyx_t_6)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(46, 1352, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(46, 1352, __pyx_L1_error) #endif /* "petsc4py/PETSc/Mat.pyx":1350 * else: * isrows = None * if iscols: # <<<<<<<<<<<<<< * iscols = list(iscols) * assert len(iscols) == len(mats[0]) */ goto __pyx_L11; } /* "petsc4py/PETSc/Mat.pyx":1354 * assert len(iscols) == len(mats[0]) * else: * iscols = None # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef Py_ssize_t i, mr = len(mats) */ /*else*/ { __Pyx_INCREF(Py_None); __Pyx_DECREF_SET(__pyx_v_iscols, Py_None); } __pyx_L11:; /* "petsc4py/PETSc/Mat.pyx":1355 * else: * iscols = None * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef Py_ssize_t i, mr = len(mats) * cdef Py_ssize_t j, mc = len(mats[0]) */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_8 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(46, 1355, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_8; /* "petsc4py/PETSc/Mat.pyx":1356 * iscols = None * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef Py_ssize_t i, mr = len(mats) # <<<<<<<<<<<<<< * cdef Py_ssize_t j, mc = len(mats[0]) * cdef PetscInt nr = mr */ __pyx_t_3 = PyObject_Length(__pyx_v_mats); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(46, 1356, __pyx_L1_error) __pyx_v_mr = __pyx_t_3; /* "petsc4py/PETSc/Mat.pyx":1357 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef Py_ssize_t i, mr = len(mats) * cdef Py_ssize_t j, mc = len(mats[0]) # <<<<<<<<<<<<<< * cdef PetscInt nr = mr * cdef PetscInt nc = mc */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_mats, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 1357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(46, 1357, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_mc = __pyx_t_3; /* "petsc4py/PETSc/Mat.pyx":1358 * cdef Py_ssize_t i, mr = len(mats) * cdef Py_ssize_t j, mc = len(mats[0]) * cdef PetscInt nr = mr # <<<<<<<<<<<<<< * cdef PetscInt nc = mc * cdef PetscMat *cmats = NULL */ __pyx_v_nr = ((PetscInt)__pyx_v_mr); /* "petsc4py/PETSc/Mat.pyx":1359 * cdef Py_ssize_t j, mc = len(mats[0]) * cdef PetscInt nr = mr * cdef PetscInt nc = mc # <<<<<<<<<<<<<< * cdef PetscMat *cmats = NULL * cdef PetscIS *cisrows = NULL */ __pyx_v_nc = ((PetscInt)__pyx_v_mc); /* "petsc4py/PETSc/Mat.pyx":1360 * cdef PetscInt nr = mr * cdef PetscInt nc = mc * cdef PetscMat *cmats = NULL # <<<<<<<<<<<<<< * cdef PetscIS *cisrows = NULL * cdef PetscIS *ciscols = NULL */ __pyx_v_cmats = NULL; /* "petsc4py/PETSc/Mat.pyx":1361 * cdef PetscInt nc = mc * cdef PetscMat *cmats = NULL * cdef PetscIS *cisrows = NULL # <<<<<<<<<<<<<< * cdef PetscIS *ciscols = NULL * cdef object tmp1, tmp2, tmp3 */ __pyx_v_cisrows = NULL; /* "petsc4py/PETSc/Mat.pyx":1362 * cdef PetscMat *cmats = NULL * cdef PetscIS *cisrows = NULL * cdef PetscIS *ciscols = NULL # <<<<<<<<<<<<<< * cdef object tmp1, tmp2, tmp3 * tmp1 = oarray_p(empty_p(nr*nc), NULL, &cmats) */ __pyx_v_ciscols = NULL; /* "petsc4py/PETSc/Mat.pyx":1364 * cdef PetscIS *ciscols = NULL * cdef object tmp1, tmp2, tmp3 * tmp1 = oarray_p(empty_p(nr*nc), NULL, &cmats) # <<<<<<<<<<<<<< * for i from 0 <= i < mr: * for j from 0 <= j < mc: */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p((__pyx_v_nr * __pyx_v_nc))); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 1364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_1, NULL, ((void **)(&__pyx_v_cmats)))); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 1364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_tmp1 = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/Mat.pyx":1365 * cdef object tmp1, tmp2, tmp3 * tmp1 = oarray_p(empty_p(nr*nc), NULL, &cmats) * for i from 0 <= i < mr: # <<<<<<<<<<<<<< * for j from 0 <= j < mc: * mat = mats[i][j] */ __pyx_t_3 = __pyx_v_mr; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { /* "petsc4py/PETSc/Mat.pyx":1366 * tmp1 = oarray_p(empty_p(nr*nc), NULL, &cmats) * for i from 0 <= i < mr: * for j from 0 <= j < mc: # <<<<<<<<<<<<<< * mat = mats[i][j] * cmats[i*mc+j] = (mat).mat if mat is not None else NULL */ __pyx_t_7 = __pyx_v_mc; for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) { /* "petsc4py/PETSc/Mat.pyx":1367 * for i from 0 <= i < mr: * for j from 0 <= j < mc: * mat = mats[i][j] # <<<<<<<<<<<<<< * cmats[i*mc+j] = (mat).mat if mat is not None else NULL * if isrows is not None: */ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_mats, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 1367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_j, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 1367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF_SET(__pyx_v_mat, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Mat.pyx":1368 * for j from 0 <= j < mc: * mat = mats[i][j] * cmats[i*mc+j] = (mat).mat if mat is not None else NULL # <<<<<<<<<<<<<< * if isrows is not None: * tmp2 = oarray_p(empty_p(nr), NULL, &cisrows) */ __pyx_t_6 = (__pyx_v_mat != Py_None); if (__pyx_t_6) { if (!(likely(__Pyx_TypeTest(__pyx_v_mat, __pyx_ptype_8petsc4py_5PETSc_Mat)))) __PYX_ERR(46, 1368, __pyx_L1_error) __pyx_t_9 = ((struct PyPetscMatObject *)__pyx_v_mat)->mat; } else { __pyx_t_9 = NULL; } (__pyx_v_cmats[((__pyx_v_i * __pyx_v_mc) + __pyx_v_j)]) = __pyx_t_9; } } /* "petsc4py/PETSc/Mat.pyx":1369 * mat = mats[i][j] * cmats[i*mc+j] = (mat).mat if mat is not None else NULL * if isrows is not None: # <<<<<<<<<<<<<< * tmp2 = oarray_p(empty_p(nr), NULL, &cisrows) * for i from 0 <= i < mr: cisrows[i] = (isrows[i]).iset */ __pyx_t_6 = (__pyx_v_isrows != Py_None); if (__pyx_t_6) { /* "petsc4py/PETSc/Mat.pyx":1370 * cmats[i*mc+j] = (mat).mat if mat is not None else NULL * if isrows is not None: * tmp2 = oarray_p(empty_p(nr), NULL, &cisrows) # <<<<<<<<<<<<<< * for i from 0 <= i < mr: cisrows[i] = (isrows[i]).iset * if iscols is not None: */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_nr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 1370, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_1, NULL, ((void **)(&__pyx_v_cisrows)))); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 1370, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_tmp2 = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/Mat.pyx":1371 * if isrows is not None: * tmp2 = oarray_p(empty_p(nr), NULL, &cisrows) * for i from 0 <= i < mr: cisrows[i] = (isrows[i]).iset # <<<<<<<<<<<<<< * if iscols is not None: * tmp3 = oarray_p(empty_p(nc), NULL, &ciscols) */ __pyx_t_3 = __pyx_v_mr; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_isrows, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 1371, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (!(likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(46, 1371, __pyx_L1_error) __pyx_t_10 = ((struct PyPetscISObject *)__pyx_t_2)->iset; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; (__pyx_v_cisrows[__pyx_v_i]) = __pyx_t_10; } /* "petsc4py/PETSc/Mat.pyx":1369 * mat = mats[i][j] * cmats[i*mc+j] = (mat).mat if mat is not None else NULL * if isrows is not None: # <<<<<<<<<<<<<< * tmp2 = oarray_p(empty_p(nr), NULL, &cisrows) * for i from 0 <= i < mr: cisrows[i] = (isrows[i]).iset */ } /* "petsc4py/PETSc/Mat.pyx":1372 * tmp2 = oarray_p(empty_p(nr), NULL, &cisrows) * for i from 0 <= i < mr: cisrows[i] = (isrows[i]).iset * if iscols is not None: # <<<<<<<<<<<<<< * tmp3 = oarray_p(empty_p(nc), NULL, &ciscols) * for j from 0 <= j < mc: ciscols[j] = (iscols[j]).iset */ __pyx_t_6 = (__pyx_v_iscols != Py_None); if (__pyx_t_6) { /* "petsc4py/PETSc/Mat.pyx":1373 * for i from 0 <= i < mr: cisrows[i] = (isrows[i]).iset * if iscols is not None: * tmp3 = oarray_p(empty_p(nc), NULL, &ciscols) # <<<<<<<<<<<<<< * for j from 0 <= j < mc: ciscols[j] = (iscols[j]).iset * cdef PetscMat newmat = NULL */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_nc)); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 1373, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_2, NULL, ((void **)(&__pyx_v_ciscols)))); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 1373, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_tmp3 = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/Mat.pyx":1374 * if iscols is not None: * tmp3 = oarray_p(empty_p(nc), NULL, &ciscols) * for j from 0 <= j < mc: ciscols[j] = (iscols[j]).iset # <<<<<<<<<<<<<< * cdef PetscMat newmat = NULL * CHKERR( MatCreateNest(ccomm, nr, cisrows, nc, ciscols, cmats, &newmat) ) */ __pyx_t_3 = __pyx_v_mc; for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_3; __pyx_v_j++) { __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_iscols, __pyx_v_j, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 1374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(46, 1374, __pyx_L1_error) __pyx_t_10 = ((struct PyPetscISObject *)__pyx_t_1)->iset; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; (__pyx_v_ciscols[__pyx_v_j]) = __pyx_t_10; } /* "petsc4py/PETSc/Mat.pyx":1372 * tmp2 = oarray_p(empty_p(nr), NULL, &cisrows) * for i from 0 <= i < mr: cisrows[i] = (isrows[i]).iset * if iscols is not None: # <<<<<<<<<<<<<< * tmp3 = oarray_p(empty_p(nc), NULL, &ciscols) * for j from 0 <= j < mc: ciscols[j] = (iscols[j]).iset */ } /* "petsc4py/PETSc/Mat.pyx":1375 * tmp3 = oarray_p(empty_p(nc), NULL, &ciscols) * for j from 0 <= j < mc: ciscols[j] = (iscols[j]).iset * cdef PetscMat newmat = NULL # <<<<<<<<<<<<<< * CHKERR( MatCreateNest(ccomm, nr, cisrows, nc, ciscols, cmats, &newmat) ) * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat */ __pyx_v_newmat = NULL; /* "petsc4py/PETSc/Mat.pyx":1376 * for j from 0 <= j < mc: ciscols[j] = (iscols[j]).iset * cdef PetscMat newmat = NULL * CHKERR( MatCreateNest(ccomm, nr, cisrows, nc, ciscols, cmats, &newmat) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat * return self */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreateNest(__pyx_v_ccomm, __pyx_v_nr, __pyx_v_cisrows, __pyx_v_nc, __pyx_v_ciscols, __pyx_v_cmats, (&__pyx_v_newmat))); if (unlikely(__pyx_t_11 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1376, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":1377 * cdef PetscMat newmat = NULL * CHKERR( MatCreateNest(ccomm, nr, cisrows, nc, ciscols, cmats, &newmat) ) * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat # <<<<<<<<<<<<<< * return self * */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_11 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1377, __pyx_L1_error) __pyx_v_self->mat = __pyx_v_newmat; /* "petsc4py/PETSc/Mat.pyx":1378 * CHKERR( MatCreateNest(ccomm, nr, cisrows, nc, ciscols, cmats, &newmat) ) * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat * return self # <<<<<<<<<<<<<< * * def createH2OpusFromMat( */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":1312 * return self * * def createNest( # <<<<<<<<<<<<<< * self, * mats: Sequence[Sequence[Mat]], */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.Mat.createNest", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_mat); __Pyx_XDECREF(__pyx_v_tmp1); __Pyx_XDECREF(__pyx_v_tmp2); __Pyx_XDECREF(__pyx_v_tmp3); __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_mat); __Pyx_XDECREF(__pyx_v_mats); __Pyx_XDECREF(__pyx_v_isrows); __Pyx_XDECREF(__pyx_v_iscols); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":1380 * return self * * def createH2OpusFromMat( # <<<<<<<<<<<<<< * self, * Mat A, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_101createH2OpusFromMat(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_100createH2OpusFromMat, "Mat.createH2OpusFromMat(self, A: Mat, coordinates: Sequence[Scalar] | None = None, dist: bool | None = None, eta: float | None = None, leafsize: int | None = None, maxrank: int | None = None, bs: int | None = None, rtol: float | None = None) -> Self\nCreate a hierarchical `Type.H2OPUS` matrix sampling from a provided operator.\n\n Parameters\n ----------\n A\n Matrix to be sampled.\n coordinates\n Coordinates of the points.\n dist\n Whether or not coordinates are distributed, defaults to `False`.\n eta\n Admissibility condition tolerance, defaults to `DECIDE`.\n leafsize\n Leaf size in cluster tree, defaults to `DECIDE`.\n maxrank\n Maximum rank permitted, defaults to `DECIDE`.\n bs\n Maximum number of samples to take concurrently, defaults to\n `DECIDE`.\n rtol\n Relative tolerance for construction, defaults to `DECIDE`.\n\n Notes\n -----\n See `petsc.MatCreateH2OpusFromMat` for the appropriate database\n options.\n\n See Also\n --------\n petsc_options, petsc.MatCreateH2OpusFromMat\n\n \nSource code at petsc4py/PETSc/Mat.pyx:1380"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_101createH2OpusFromMat(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscMatObject *__pyx_v_A = 0; PyObject *__pyx_v_coordinates = 0; PyObject *__pyx_v_dist = 0; PyObject *__pyx_v_eta = 0; PyObject *__pyx_v_leafsize = 0; PyObject *__pyx_v_maxrank = 0; PyObject *__pyx_v_bs = 0; PyObject *__pyx_v_rtol = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[8] = {0,0,0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createH2OpusFromMat (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_coordinates,&__pyx_n_s_dist,&__pyx_n_s_eta,&__pyx_n_s_leafsize,&__pyx_n_s_maxrank,&__pyx_n_s_bs,&__pyx_n_s_rtol,0}; /* "petsc4py/PETSc/Mat.pyx":1383 * self, * Mat A, * coordinates: Sequence[Scalar] | None = None, # <<<<<<<<<<<<<< * dist: bool | None = None, * eta: float | None = None, */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Mat.pyx":1384 * Mat A, * coordinates: Sequence[Scalar] | None = None, * dist: bool | None = None, # <<<<<<<<<<<<<< * eta: float | None = None, * leafsize: int | None = None, */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Mat.pyx":1385 * coordinates: Sequence[Scalar] | None = None, * dist: bool | None = None, * eta: float | None = None, # <<<<<<<<<<<<<< * leafsize: int | None = None, * maxrank: int | None = None, */ values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Mat.pyx":1386 * dist: bool | None = None, * eta: float | None = None, * leafsize: int | None = None, # <<<<<<<<<<<<<< * maxrank: int | None = None, * bs: int | None = None, */ values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Mat.pyx":1387 * eta: float | None = None, * leafsize: int | None = None, * maxrank: int | None = None, # <<<<<<<<<<<<<< * bs: int | None = None, * rtol: float | None = None, */ values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Mat.pyx":1388 * leafsize: int | None = None, * maxrank: int | None = None, * bs: int | None = None, # <<<<<<<<<<<<<< * rtol: float | None = None, * ) -> Self: */ values[6] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Mat.pyx":1389 * maxrank: int | None = None, * bs: int | None = None, * rtol: float | None = None, # <<<<<<<<<<<<<< * ) -> Self: * """Create a hierarchical `Type.H2OPUS` matrix sampling from a provided operator. */ values[7] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); CYTHON_FALLTHROUGH; case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_A)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 1380, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_coordinates); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 1380, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dist); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 1380, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_eta); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 1380, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_leafsize); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 1380, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_maxrank); if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 1380, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 6: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_bs); if (value) { values[6] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 1380, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 7: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rtol); if (value) { values[7] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 1380, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createH2OpusFromMat") < 0)) __PYX_ERR(46, 1380, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); CYTHON_FALLTHROUGH; case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_A = ((struct PyPetscMatObject *)values[0]); __pyx_v_coordinates = values[1]; __pyx_v_dist = values[2]; __pyx_v_eta = values[3]; __pyx_v_leafsize = values[4]; __pyx_v_maxrank = values[5]; __pyx_v_bs = values[6]; __pyx_v_rtol = values[7]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createH2OpusFromMat", 0, 1, 8, __pyx_nargs); __PYX_ERR(46, 1380, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.createH2OpusFromMat", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_A), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "A", 0))) __PYX_ERR(46, 1382, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_100createH2OpusFromMat(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_A, __pyx_v_coordinates, __pyx_v_dist, __pyx_v_eta, __pyx_v_leafsize, __pyx_v_maxrank, __pyx_v_bs, __pyx_v_rtol); /* "petsc4py/PETSc/Mat.pyx":1380 * return self * * def createH2OpusFromMat( # <<<<<<<<<<<<<< * self, * Mat A, */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_100createH2OpusFromMat(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_A, PyObject *__pyx_v_coordinates, PyObject *__pyx_v_dist, PyObject *__pyx_v_eta, PyObject *__pyx_v_leafsize, PyObject *__pyx_v_maxrank, PyObject *__pyx_v_bs, PyObject *__pyx_v_rtol) { PetscInt __pyx_v_cdim; PetscReal *__pyx_v_coords; PetscBool __pyx_v_cdist; PetscReal __pyx_v_peta; PetscInt __pyx_v_lsize; PetscInt __pyx_v_maxr; PetscInt __pyx_v_pbs; PetscReal __pyx_v_tol; PyArrayObject *__pyx_v_xyz = 0; PetscInt __pyx_v_nvtx; PetscInt __pyx_v_rl; PetscInt __pyx_v_cl; Mat __pyx_v_newmat; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscBool __pyx_t_2; PetscReal __pyx_t_3; PetscInt __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PetscErrorCode __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createH2OpusFromMat", 1); /* "petsc4py/PETSc/Mat.pyx":1423 * * """ * cdef PetscInt cdim = 1 # <<<<<<<<<<<<<< * cdef PetscReal *coords = NULL * cdef PetscBool cdist = PETSC_FALSE */ __pyx_v_cdim = 1; /* "petsc4py/PETSc/Mat.pyx":1424 * """ * cdef PetscInt cdim = 1 * cdef PetscReal *coords = NULL # <<<<<<<<<<<<<< * cdef PetscBool cdist = PETSC_FALSE * cdef PetscReal peta = PETSC_DECIDE */ __pyx_v_coords = NULL; /* "petsc4py/PETSc/Mat.pyx":1425 * cdef PetscInt cdim = 1 * cdef PetscReal *coords = NULL * cdef PetscBool cdist = PETSC_FALSE # <<<<<<<<<<<<<< * cdef PetscReal peta = PETSC_DECIDE * cdef PetscInt lsize = PETSC_DECIDE */ __pyx_v_cdist = PETSC_FALSE; /* "petsc4py/PETSc/Mat.pyx":1426 * cdef PetscReal *coords = NULL * cdef PetscBool cdist = PETSC_FALSE * cdef PetscReal peta = PETSC_DECIDE # <<<<<<<<<<<<<< * cdef PetscInt lsize = PETSC_DECIDE * cdef PetscInt maxr = PETSC_DECIDE */ __pyx_v_peta = PETSC_DECIDE; /* "petsc4py/PETSc/Mat.pyx":1427 * cdef PetscBool cdist = PETSC_FALSE * cdef PetscReal peta = PETSC_DECIDE * cdef PetscInt lsize = PETSC_DECIDE # <<<<<<<<<<<<<< * cdef PetscInt maxr = PETSC_DECIDE * cdef PetscInt pbs = PETSC_DECIDE */ __pyx_v_lsize = PETSC_DECIDE; /* "petsc4py/PETSc/Mat.pyx":1428 * cdef PetscReal peta = PETSC_DECIDE * cdef PetscInt lsize = PETSC_DECIDE * cdef PetscInt maxr = PETSC_DECIDE # <<<<<<<<<<<<<< * cdef PetscInt pbs = PETSC_DECIDE * cdef PetscReal tol = PETSC_DECIDE */ __pyx_v_maxr = PETSC_DECIDE; /* "petsc4py/PETSc/Mat.pyx":1429 * cdef PetscInt lsize = PETSC_DECIDE * cdef PetscInt maxr = PETSC_DECIDE * cdef PetscInt pbs = PETSC_DECIDE # <<<<<<<<<<<<<< * cdef PetscReal tol = PETSC_DECIDE * cdef ndarray xyz */ __pyx_v_pbs = PETSC_DECIDE; /* "petsc4py/PETSc/Mat.pyx":1430 * cdef PetscInt maxr = PETSC_DECIDE * cdef PetscInt pbs = PETSC_DECIDE * cdef PetscReal tol = PETSC_DECIDE # <<<<<<<<<<<<<< * cdef ndarray xyz * cdef PetscInt nvtx */ __pyx_v_tol = PETSC_DECIDE; /* "petsc4py/PETSc/Mat.pyx":1433 * cdef ndarray xyz * cdef PetscInt nvtx * cdef PetscInt rl = 0, cl = 0 # <<<<<<<<<<<<<< * if dist is not None: cdist = asBool(dist) * if eta is not None: peta = asReal(eta) */ __pyx_v_rl = 0; __pyx_v_cl = 0; /* "petsc4py/PETSc/Mat.pyx":1434 * cdef PetscInt nvtx * cdef PetscInt rl = 0, cl = 0 * if dist is not None: cdist = asBool(dist) # <<<<<<<<<<<<<< * if eta is not None: peta = asReal(eta) * if leafsize is not None: lsize = asInt(leafsize) */ __pyx_t_1 = (__pyx_v_dist != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asBool(__pyx_v_dist); if (unlikely(__pyx_t_2 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(46, 1434, __pyx_L1_error) __pyx_v_cdist = __pyx_t_2; } /* "petsc4py/PETSc/Mat.pyx":1435 * cdef PetscInt rl = 0, cl = 0 * if dist is not None: cdist = asBool(dist) * if eta is not None: peta = asReal(eta) # <<<<<<<<<<<<<< * if leafsize is not None: lsize = asInt(leafsize) * if maxrank is not None: maxr = asInt(maxrank) */ __pyx_t_1 = (__pyx_v_eta != Py_None); if (__pyx_t_1) { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_eta); if (unlikely(__pyx_t_3 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(46, 1435, __pyx_L1_error) __pyx_v_peta = __pyx_t_3; } /* "petsc4py/PETSc/Mat.pyx":1436 * if dist is not None: cdist = asBool(dist) * if eta is not None: peta = asReal(eta) * if leafsize is not None: lsize = asInt(leafsize) # <<<<<<<<<<<<<< * if maxrank is not None: maxr = asInt(maxrank) * if bs is not None: pbs = asInt(bs) */ __pyx_t_1 = (__pyx_v_leafsize != Py_None); if (__pyx_t_1) { __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_leafsize); if (unlikely(__pyx_t_4 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(46, 1436, __pyx_L1_error) __pyx_v_lsize = __pyx_t_4; } /* "petsc4py/PETSc/Mat.pyx":1437 * if eta is not None: peta = asReal(eta) * if leafsize is not None: lsize = asInt(leafsize) * if maxrank is not None: maxr = asInt(maxrank) # <<<<<<<<<<<<<< * if bs is not None: pbs = asInt(bs) * if rtol is not None: tol = asReal(rtol) */ __pyx_t_1 = (__pyx_v_maxrank != Py_None); if (__pyx_t_1) { __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_maxrank); if (unlikely(__pyx_t_4 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(46, 1437, __pyx_L1_error) __pyx_v_maxr = __pyx_t_4; } /* "petsc4py/PETSc/Mat.pyx":1438 * if leafsize is not None: lsize = asInt(leafsize) * if maxrank is not None: maxr = asInt(maxrank) * if bs is not None: pbs = asInt(bs) # <<<<<<<<<<<<<< * if rtol is not None: tol = asReal(rtol) * */ __pyx_t_1 = (__pyx_v_bs != Py_None); if (__pyx_t_1) { __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_bs); if (unlikely(__pyx_t_4 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(46, 1438, __pyx_L1_error) __pyx_v_pbs = __pyx_t_4; } /* "petsc4py/PETSc/Mat.pyx":1439 * if maxrank is not None: maxr = asInt(maxrank) * if bs is not None: pbs = asInt(bs) * if rtol is not None: tol = asReal(rtol) # <<<<<<<<<<<<<< * * if coordinates is not None: */ __pyx_t_1 = (__pyx_v_rtol != Py_None); if (__pyx_t_1) { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_rtol); if (unlikely(__pyx_t_3 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(46, 1439, __pyx_L1_error) __pyx_v_tol = __pyx_t_3; } /* "petsc4py/PETSc/Mat.pyx":1441 * if rtol is not None: tol = asReal(rtol) * * if coordinates is not None: # <<<<<<<<<<<<<< * xyz = iarray(coordinates, NPY_PETSC_REAL) * if PyArray_ISFORTRAN(xyz): xyz = PyArray_Copy(xyz) */ __pyx_t_1 = (__pyx_v_coordinates != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/Mat.pyx":1442 * * if coordinates is not None: * xyz = iarray(coordinates, NPY_PETSC_REAL) # <<<<<<<<<<<<<< * if PyArray_ISFORTRAN(xyz): xyz = PyArray_Copy(xyz) * if PyArray_NDIM(xyz) != 2: raise ValueError( */ __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray(__pyx_v_coordinates, NPY_PETSC_REAL)); if (unlikely(!__pyx_t_5)) __PYX_ERR(46, 1442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_v_xyz = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/Mat.pyx":1443 * if coordinates is not None: * xyz = iarray(coordinates, NPY_PETSC_REAL) * if PyArray_ISFORTRAN(xyz): xyz = PyArray_Copy(xyz) # <<<<<<<<<<<<<< * if PyArray_NDIM(xyz) != 2: raise ValueError( * ("coordinates must have two dimensions: " */ __pyx_t_1 = PyArray_ISFORTRAN(__pyx_v_xyz); if (__pyx_t_1) { __pyx_t_5 = ((PyObject *)PyArray_Copy(__pyx_v_xyz)); if (unlikely(!__pyx_t_5)) __PYX_ERR(46, 1443, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_xyz, ((PyArrayObject *)__pyx_t_5)); __pyx_t_5 = 0; } /* "petsc4py/PETSc/Mat.pyx":1444 * xyz = iarray(coordinates, NPY_PETSC_REAL) * if PyArray_ISFORTRAN(xyz): xyz = PyArray_Copy(xyz) * if PyArray_NDIM(xyz) != 2: raise ValueError( # <<<<<<<<<<<<<< * ("coordinates must have two dimensions: " * "coordinates.ndim=%d") % (PyArray_NDIM(xyz)) ) */ __pyx_t_1 = (PyArray_NDIM(__pyx_v_xyz) != 2); if (unlikely(__pyx_t_1)) { /* "petsc4py/PETSc/Mat.pyx":1446 * if PyArray_NDIM(xyz) != 2: raise ValueError( * ("coordinates must have two dimensions: " * "coordinates.ndim=%d") % (PyArray_NDIM(xyz)) ) # <<<<<<<<<<<<<< * nvtx = PyArray_DIM(xyz, 0) * CHKERR( MatGetLocalSize(A.mat, &rl, &cl) ) */ __pyx_t_5 = __Pyx_PyInt_From_int(PyArray_NDIM(__pyx_v_xyz)); if (unlikely(!__pyx_t_5)) __PYX_ERR(46, 1446, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_coordinates_must_have_two_dimens, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(46, 1446, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/Mat.pyx":1444 * xyz = iarray(coordinates, NPY_PETSC_REAL) * if PyArray_ISFORTRAN(xyz): xyz = PyArray_Copy(xyz) * if PyArray_NDIM(xyz) != 2: raise ValueError( # <<<<<<<<<<<<<< * ("coordinates must have two dimensions: " * "coordinates.ndim=%d") % (PyArray_NDIM(xyz)) ) */ __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(46, 1444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(46, 1444, __pyx_L1_error) } /* "petsc4py/PETSc/Mat.pyx":1447 * ("coordinates must have two dimensions: " * "coordinates.ndim=%d") % (PyArray_NDIM(xyz)) ) * nvtx = PyArray_DIM(xyz, 0) # <<<<<<<<<<<<<< * CHKERR( MatGetLocalSize(A.mat, &rl, &cl) ) * if cl != rl: raise ValueError("Not for rectangular matrices") */ __pyx_v_nvtx = ((PetscInt)PyArray_DIM(__pyx_v_xyz, 0)); /* "petsc4py/PETSc/Mat.pyx":1448 * "coordinates.ndim=%d") % (PyArray_NDIM(xyz)) ) * nvtx = PyArray_DIM(xyz, 0) * CHKERR( MatGetLocalSize(A.mat, &rl, &cl) ) # <<<<<<<<<<<<<< * if cl != rl: raise ValueError("Not for rectangular matrices") * if nvtx < rl: raise ValueError( */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetLocalSize(__pyx_v_A->mat, (&__pyx_v_rl), (&__pyx_v_cl))); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1448, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":1449 * nvtx = PyArray_DIM(xyz, 0) * CHKERR( MatGetLocalSize(A.mat, &rl, &cl) ) * if cl != rl: raise ValueError("Not for rectangular matrices") # <<<<<<<<<<<<<< * if nvtx < rl: raise ValueError( * ("coordinates size must be at least %d" % rl )) */ __pyx_t_1 = (__pyx_v_cl != __pyx_v_rl); if (unlikely(__pyx_t_1)) { __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(46, 1449, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(46, 1449, __pyx_L1_error) } /* "petsc4py/PETSc/Mat.pyx":1450 * CHKERR( MatGetLocalSize(A.mat, &rl, &cl) ) * if cl != rl: raise ValueError("Not for rectangular matrices") * if nvtx < rl: raise ValueError( # <<<<<<<<<<<<<< * ("coordinates size must be at least %d" % rl )) * cdim = PyArray_DIM(xyz, 1) */ __pyx_t_1 = (__pyx_v_nvtx < __pyx_v_rl); if (unlikely(__pyx_t_1)) { /* "petsc4py/PETSc/Mat.pyx":1451 * if cl != rl: raise ValueError("Not for rectangular matrices") * if nvtx < rl: raise ValueError( * ("coordinates size must be at least %d" % rl )) # <<<<<<<<<<<<<< * cdim = PyArray_DIM(xyz, 1) * coords = PyArray_DATA(xyz) */ __pyx_t_5 = __Pyx_PyInt_From_PetscInt(__pyx_v_rl); if (unlikely(!__pyx_t_5)) __PYX_ERR(46, 1451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_coordinates_size_must_be_at_leas, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(46, 1451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/Mat.pyx":1450 * CHKERR( MatGetLocalSize(A.mat, &rl, &cl) ) * if cl != rl: raise ValueError("Not for rectangular matrices") * if nvtx < rl: raise ValueError( # <<<<<<<<<<<<<< * ("coordinates size must be at least %d" % rl )) * cdim = PyArray_DIM(xyz, 1) */ __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(46, 1450, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(46, 1450, __pyx_L1_error) } /* "petsc4py/PETSc/Mat.pyx":1452 * if nvtx < rl: raise ValueError( * ("coordinates size must be at least %d" % rl )) * cdim = PyArray_DIM(xyz, 1) # <<<<<<<<<<<<<< * coords = PyArray_DATA(xyz) * */ __pyx_v_cdim = ((PetscInt)PyArray_DIM(__pyx_v_xyz, 1)); /* "petsc4py/PETSc/Mat.pyx":1453 * ("coordinates size must be at least %d" % rl )) * cdim = PyArray_DIM(xyz, 1) * coords = PyArray_DATA(xyz) # <<<<<<<<<<<<<< * * cdef PetscMat newmat = NULL */ __pyx_v_coords = ((PetscReal *)PyArray_DATA(__pyx_v_xyz)); /* "petsc4py/PETSc/Mat.pyx":1441 * if rtol is not None: tol = asReal(rtol) * * if coordinates is not None: # <<<<<<<<<<<<<< * xyz = iarray(coordinates, NPY_PETSC_REAL) * if PyArray_ISFORTRAN(xyz): xyz = PyArray_Copy(xyz) */ } /* "petsc4py/PETSc/Mat.pyx":1455 * coords = PyArray_DATA(xyz) * * cdef PetscMat newmat = NULL # <<<<<<<<<<<<<< * CHKERR( MatCreateH2OpusFromMat(A.mat, cdim, coords, cdist, peta, lsize, maxr, pbs, tol, &newmat) ) * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat */ __pyx_v_newmat = NULL; /* "petsc4py/PETSc/Mat.pyx":1456 * * cdef PetscMat newmat = NULL * CHKERR( MatCreateH2OpusFromMat(A.mat, cdim, coords, cdist, peta, lsize, maxr, pbs, tol, &newmat) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat * return self */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreateH2OpusFromMat(__pyx_v_A->mat, __pyx_v_cdim, __pyx_v_coords, __pyx_v_cdist, __pyx_v_peta, __pyx_v_lsize, __pyx_v_maxr, __pyx_v_pbs, __pyx_v_tol, (&__pyx_v_newmat))); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1456, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":1457 * cdef PetscMat newmat = NULL * CHKERR( MatCreateH2OpusFromMat(A.mat, cdim, coords, cdist, peta, lsize, maxr, pbs, tol, &newmat) ) * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat # <<<<<<<<<<<<<< * return self * */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1457, __pyx_L1_error) __pyx_v_self->mat = __pyx_v_newmat; /* "petsc4py/PETSc/Mat.pyx":1458 * CHKERR( MatCreateH2OpusFromMat(A.mat, cdim, coords, cdist, peta, lsize, maxr, pbs, tol, &newmat) ) * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat * return self # <<<<<<<<<<<<<< * * def createIS( */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":1380 * return self * * def createH2OpusFromMat( # <<<<<<<<<<<<<< * self, * Mat A, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.Mat.createH2OpusFromMat", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_xyz); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":1460 * return self * * def createIS( # <<<<<<<<<<<<<< * self, * size: MatSizeSpec, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_103createIS(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_102createIS, "Mat.createIS(self, size: MatSizeSpec, lgmapr: LGMap | None = None, lgmapc: LGMap | None = None, comm: Comm | None = None) -> Self\nCreate a `Type.IS` matrix representing globally unassembled operators.\n\n Collective.\n\n Parameters\n ----------\n size\n Matrix size.\n lgmapr\n Optional local-to-global mapping for the rows.\n If `None`, the local row space matches the global row space.\n lgmapc\n Optional local-to-global mapping for the columns.\n If `None`, the local column space matches the global column space.\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n petsc.MATIS\n\n \nSource code at petsc4py/PETSc/Mat.pyx:1460"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_103createIS(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_size = 0; struct PyPetscLGMapObject *__pyx_v_lgmapr = 0; struct PyPetscLGMapObject *__pyx_v_lgmapc = 0; PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createIS (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_lgmapr,&__pyx_n_s_lgmapc,&__pyx_n_s_comm,0}; /* "petsc4py/PETSc/Mat.pyx":1463 * self, * size: MatSizeSpec, * LGMap lgmapr = None, # <<<<<<<<<<<<<< * LGMap lgmapc = None, * comm: Comm | None = None, */ values[1] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscLGMapObject *)Py_None)); /* "petsc4py/PETSc/Mat.pyx":1464 * size: MatSizeSpec, * LGMap lgmapr = None, * LGMap lgmapc = None, # <<<<<<<<<<<<<< * comm: Comm | None = None, * ) -> Self: */ values[2] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscLGMapObject *)Py_None)); /* "petsc4py/PETSc/Mat.pyx":1465 * LGMap lgmapr = None, * LGMap lgmapc = None, * comm: Comm | None = None, # <<<<<<<<<<<<<< * ) -> Self: * """Create a `Type.IS` matrix representing globally unassembled operators. */ values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 1460, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_lgmapr); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 1460, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_lgmapc); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 1460, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 1460, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createIS") < 0)) __PYX_ERR(46, 1460, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_size = values[0]; __pyx_v_lgmapr = ((struct PyPetscLGMapObject *)values[1]); __pyx_v_lgmapc = ((struct PyPetscLGMapObject *)values[2]); __pyx_v_comm = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createIS", 0, 1, 4, __pyx_nargs); __PYX_ERR(46, 1460, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.createIS", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lgmapr), __pyx_ptype_8petsc4py_5PETSc_LGMap, 1, "lgmapr", 0))) __PYX_ERR(46, 1463, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lgmapc), __pyx_ptype_8petsc4py_5PETSc_LGMap, 1, "lgmapc", 0))) __PYX_ERR(46, 1464, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_102createIS(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_size, __pyx_v_lgmapr, __pyx_v_lgmapc, __pyx_v_comm); /* "petsc4py/PETSc/Mat.pyx":1460 * return self * * def createIS( # <<<<<<<<<<<<<< * self, * size: MatSizeSpec, */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_102createIS(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_size, struct PyPetscLGMapObject *__pyx_v_lgmapr, struct PyPetscLGMapObject *__pyx_v_lgmapc, PyObject *__pyx_v_comm) { ISLocalToGlobalMapping __pyx_v_lgmr; ISLocalToGlobalMapping __pyx_v_lgmc; MPI_Comm __pyx_v_ccomm; PetscInt __pyx_v_rbs; PetscInt __pyx_v_cbs; PetscInt __pyx_v_m; PetscInt __pyx_v_n; PetscInt __pyx_v_M; PetscInt __pyx_v_N; Mat __pyx_v_newmat; PetscInt __pyx_v_bs; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; MPI_Comm __pyx_t_7; PetscErrorCode __pyx_t_8; ISLocalToGlobalMapping __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createIS", 0); __Pyx_INCREF(__pyx_v_comm); /* "petsc4py/PETSc/Mat.pyx":1490 * """ * # communicator and sizes * if comm is None and lgmapr is not None: comm = lgmapr.getComm() # <<<<<<<<<<<<<< * if comm is None and lgmapc is not None: comm = lgmapc.getComm() * cdef PetscLGMap lgmr = NULL */ __pyx_t_2 = (__pyx_v_comm == Py_None); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = (((PyObject *)__pyx_v_lgmapr) != Py_None); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_lgmapr), __pyx_n_s_getComm); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 1490, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 1490, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF_SET(__pyx_v_comm, __pyx_t_3); __pyx_t_3 = 0; } /* "petsc4py/PETSc/Mat.pyx":1491 * # communicator and sizes * if comm is None and lgmapr is not None: comm = lgmapr.getComm() * if comm is None and lgmapc is not None: comm = lgmapc.getComm() # <<<<<<<<<<<<<< * cdef PetscLGMap lgmr = NULL * cdef PetscLGMap lgmc = NULL */ __pyx_t_2 = (__pyx_v_comm == Py_None); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L7_bool_binop_done; } __pyx_t_2 = (((PyObject *)__pyx_v_lgmapc) != Py_None); __pyx_t_1 = __pyx_t_2; __pyx_L7_bool_binop_done:; if (__pyx_t_1) { __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_lgmapc), __pyx_n_s_getComm); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 1491, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 1491, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF_SET(__pyx_v_comm, __pyx_t_3); __pyx_t_3 = 0; } /* "petsc4py/PETSc/Mat.pyx":1492 * if comm is None and lgmapr is not None: comm = lgmapr.getComm() * if comm is None and lgmapc is not None: comm = lgmapc.getComm() * cdef PetscLGMap lgmr = NULL # <<<<<<<<<<<<<< * cdef PetscLGMap lgmc = NULL * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) */ __pyx_v_lgmr = NULL; /* "petsc4py/PETSc/Mat.pyx":1493 * if comm is None and lgmapc is not None: comm = lgmapc.getComm() * cdef PetscLGMap lgmr = NULL * cdef PetscLGMap lgmc = NULL # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt rbs = 0, cbs = 0, m = 0, n = 0, M = 0, N = 0 */ __pyx_v_lgmc = NULL; /* "petsc4py/PETSc/Mat.pyx":1494 * cdef PetscLGMap lgmr = NULL * cdef PetscLGMap lgmc = NULL * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscInt rbs = 0, cbs = 0, m = 0, n = 0, M = 0, N = 0 * Mat_Sizes(size, None, &rbs, &cbs, &m, &n, &M, &N) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_7 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(46, 1494, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_7; /* "petsc4py/PETSc/Mat.pyx":1495 * cdef PetscLGMap lgmc = NULL * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt rbs = 0, cbs = 0, m = 0, n = 0, M = 0, N = 0 # <<<<<<<<<<<<<< * Mat_Sizes(size, None, &rbs, &cbs, &m, &n, &M, &N) * Sys_Layout(ccomm, rbs, &m, &M) */ __pyx_v_rbs = 0; __pyx_v_cbs = 0; __pyx_v_m = 0; __pyx_v_n = 0; __pyx_v_M = 0; __pyx_v_N = 0; /* "petsc4py/PETSc/Mat.pyx":1496 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt rbs = 0, cbs = 0, m = 0, n = 0, M = 0, N = 0 * Mat_Sizes(size, None, &rbs, &cbs, &m, &n, &M, &N) # <<<<<<<<<<<<<< * Sys_Layout(ccomm, rbs, &m, &M) * Sys_Layout(ccomm, cbs, &n, &N) */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_Mat_Sizes(__pyx_v_size, Py_None, (&__pyx_v_rbs), (&__pyx_v_cbs), (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_M), (&__pyx_v_N)); if (unlikely(__pyx_t_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1496, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":1497 * cdef PetscInt rbs = 0, cbs = 0, m = 0, n = 0, M = 0, N = 0 * Mat_Sizes(size, None, &rbs, &cbs, &m, &n, &M, &N) * Sys_Layout(ccomm, rbs, &m, &M) # <<<<<<<<<<<<<< * Sys_Layout(ccomm, cbs, &n, &N) * # create matrix */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_Sys_Layout(__pyx_v_ccomm, __pyx_v_rbs, (&__pyx_v_m), (&__pyx_v_M)); if (unlikely(__pyx_t_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1497, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":1498 * Mat_Sizes(size, None, &rbs, &cbs, &m, &n, &M, &N) * Sys_Layout(ccomm, rbs, &m, &M) * Sys_Layout(ccomm, cbs, &n, &N) # <<<<<<<<<<<<<< * # create matrix * cdef PetscMat newmat = NULL */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_Sys_Layout(__pyx_v_ccomm, __pyx_v_cbs, (&__pyx_v_n), (&__pyx_v_N)); if (unlikely(__pyx_t_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1498, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":1500 * Sys_Layout(ccomm, cbs, &n, &N) * # create matrix * cdef PetscMat newmat = NULL # <<<<<<<<<<<<<< * cdef PetscInt bs = 1 * if rbs == cbs: bs = rbs */ __pyx_v_newmat = NULL; /* "petsc4py/PETSc/Mat.pyx":1501 * # create matrix * cdef PetscMat newmat = NULL * cdef PetscInt bs = 1 # <<<<<<<<<<<<<< * if rbs == cbs: bs = rbs * if lgmapr is not None: */ __pyx_v_bs = 1; /* "petsc4py/PETSc/Mat.pyx":1502 * cdef PetscMat newmat = NULL * cdef PetscInt bs = 1 * if rbs == cbs: bs = rbs # <<<<<<<<<<<<<< * if lgmapr is not None: * lgmr = lgmapr.lgm */ __pyx_t_1 = (__pyx_v_rbs == __pyx_v_cbs); if (__pyx_t_1) { __pyx_v_bs = __pyx_v_rbs; } /* "petsc4py/PETSc/Mat.pyx":1503 * cdef PetscInt bs = 1 * if rbs == cbs: bs = rbs * if lgmapr is not None: # <<<<<<<<<<<<<< * lgmr = lgmapr.lgm * if lgmapc is not None: */ __pyx_t_1 = (((PyObject *)__pyx_v_lgmapr) != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/Mat.pyx":1504 * if rbs == cbs: bs = rbs * if lgmapr is not None: * lgmr = lgmapr.lgm # <<<<<<<<<<<<<< * if lgmapc is not None: * lgmc = lgmapc.lgm */ __pyx_t_9 = __pyx_v_lgmapr->lgm; __pyx_v_lgmr = __pyx_t_9; /* "petsc4py/PETSc/Mat.pyx":1503 * cdef PetscInt bs = 1 * if rbs == cbs: bs = rbs * if lgmapr is not None: # <<<<<<<<<<<<<< * lgmr = lgmapr.lgm * if lgmapc is not None: */ } /* "petsc4py/PETSc/Mat.pyx":1505 * if lgmapr is not None: * lgmr = lgmapr.lgm * if lgmapc is not None: # <<<<<<<<<<<<<< * lgmc = lgmapc.lgm * CHKERR( MatCreateIS(ccomm, bs, m, n, M, N, lgmr, lgmc, &newmat) ) */ __pyx_t_1 = (((PyObject *)__pyx_v_lgmapc) != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/Mat.pyx":1506 * lgmr = lgmapr.lgm * if lgmapc is not None: * lgmc = lgmapc.lgm # <<<<<<<<<<<<<< * CHKERR( MatCreateIS(ccomm, bs, m, n, M, N, lgmr, lgmc, &newmat) ) * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat */ __pyx_t_9 = __pyx_v_lgmapc->lgm; __pyx_v_lgmc = __pyx_t_9; /* "petsc4py/PETSc/Mat.pyx":1505 * if lgmapr is not None: * lgmr = lgmapr.lgm * if lgmapc is not None: # <<<<<<<<<<<<<< * lgmc = lgmapc.lgm * CHKERR( MatCreateIS(ccomm, bs, m, n, M, N, lgmr, lgmc, &newmat) ) */ } /* "petsc4py/PETSc/Mat.pyx":1507 * if lgmapc is not None: * lgmc = lgmapc.lgm * CHKERR( MatCreateIS(ccomm, bs, m, n, M, N, lgmr, lgmc, &newmat) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat * return self */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreateIS(__pyx_v_ccomm, __pyx_v_bs, __pyx_v_m, __pyx_v_n, __pyx_v_M, __pyx_v_N, __pyx_v_lgmr, __pyx_v_lgmc, (&__pyx_v_newmat))); if (unlikely(__pyx_t_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1507, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":1508 * lgmc = lgmapc.lgm * CHKERR( MatCreateIS(ccomm, bs, m, n, M, N, lgmr, lgmc, &newmat) ) * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat # <<<<<<<<<<<<<< * return self * */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1508, __pyx_L1_error) __pyx_v_self->mat = __pyx_v_newmat; /* "petsc4py/PETSc/Mat.pyx":1509 * CHKERR( MatCreateIS(ccomm, bs, m, n, M, N, lgmr, lgmc, &newmat) ) * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat * return self # <<<<<<<<<<<<<< * * def createConstantDiagonal( */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":1460 * return self * * def createIS( # <<<<<<<<<<<<<< * self, * size: MatSizeSpec, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.Mat.createIS", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_comm); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":1511 * return self * * def createConstantDiagonal( # <<<<<<<<<<<<<< * self, * size: MatSizeSpec, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_105createConstantDiagonal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_104createConstantDiagonal, "Mat.createConstantDiagonal(self, size: MatSizeSpec, diag: float, comm: Comm | None = None) -> Self\nCreate a diagonal matrix of type `Type.CONSTANTDIAGONAL`.\n\n Collective.\n\n Parameters\n ----------\n size\n Matrix size.\n diag\n The diagonal value.\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n createDiagonal\n\n \nSource code at petsc4py/PETSc/Mat.pyx:1511"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_105createConstantDiagonal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_size = 0; PyObject *__pyx_v_diag = 0; PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createConstantDiagonal (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_diag,&__pyx_n_s_comm,0}; /* "petsc4py/PETSc/Mat.pyx":1515 * size: MatSizeSpec, * diag: float, * comm: Comm | None = None, # <<<<<<<<<<<<<< * ) -> Self: * """Create a diagonal matrix of type `Type.CONSTANTDIAGONAL`. */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 1511, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_diag)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 1511, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("createConstantDiagonal", 0, 2, 3, 1); __PYX_ERR(46, 1511, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 1511, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createConstantDiagonal") < 0)) __PYX_ERR(46, 1511, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_size = values[0]; __pyx_v_diag = values[1]; __pyx_v_comm = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createConstantDiagonal", 0, 2, 3, __pyx_nargs); __PYX_ERR(46, 1511, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.createConstantDiagonal", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_104createConstantDiagonal(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_size, __pyx_v_diag, __pyx_v_comm); /* "petsc4py/PETSc/Mat.pyx":1511 * return self * * def createConstantDiagonal( # <<<<<<<<<<<<<< * self, * size: MatSizeSpec, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_104createConstantDiagonal(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_diag, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PetscInt __pyx_v_rbs; PetscInt __pyx_v_cbs; PetscInt __pyx_v_m; PetscInt __pyx_v_n; PetscInt __pyx_v_M; PetscInt __pyx_v_N; Mat __pyx_v_newmat; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PetscErrorCode __pyx_t_2; PetscScalar __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createConstantDiagonal", 1); /* "petsc4py/PETSc/Mat.pyx":1535 * * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscInt rbs = 0, cbs = 0, m = 0, n = 0, M = 0, N = 0 * Mat_Sizes(size, None, &rbs, &cbs, &m, &n, &M, &N) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(46, 1535, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/Mat.pyx":1536 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt rbs = 0, cbs = 0, m = 0, n = 0, M = 0, N = 0 # <<<<<<<<<<<<<< * Mat_Sizes(size, None, &rbs, &cbs, &m, &n, &M, &N) * Sys_Layout(ccomm, rbs, &m, &M) */ __pyx_v_rbs = 0; __pyx_v_cbs = 0; __pyx_v_m = 0; __pyx_v_n = 0; __pyx_v_M = 0; __pyx_v_N = 0; /* "petsc4py/PETSc/Mat.pyx":1537 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt rbs = 0, cbs = 0, m = 0, n = 0, M = 0, N = 0 * Mat_Sizes(size, None, &rbs, &cbs, &m, &n, &M, &N) # <<<<<<<<<<<<<< * Sys_Layout(ccomm, rbs, &m, &M) * Sys_Layout(ccomm, cbs, &n, &N) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_Mat_Sizes(__pyx_v_size, Py_None, (&__pyx_v_rbs), (&__pyx_v_cbs), (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_M), (&__pyx_v_N)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1537, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":1538 * cdef PetscInt rbs = 0, cbs = 0, m = 0, n = 0, M = 0, N = 0 * Mat_Sizes(size, None, &rbs, &cbs, &m, &n, &M, &N) * Sys_Layout(ccomm, rbs, &m, &M) # <<<<<<<<<<<<<< * Sys_Layout(ccomm, cbs, &n, &N) * cdef PetscMat newmat = NULL */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_Sys_Layout(__pyx_v_ccomm, __pyx_v_rbs, (&__pyx_v_m), (&__pyx_v_M)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1538, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":1539 * Mat_Sizes(size, None, &rbs, &cbs, &m, &n, &M, &N) * Sys_Layout(ccomm, rbs, &m, &M) * Sys_Layout(ccomm, cbs, &n, &N) # <<<<<<<<<<<<<< * cdef PetscMat newmat = NULL * CHKERR( MatCreateConstantDiagonal(ccomm, m, n, M, N, diag, &newmat) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_Sys_Layout(__pyx_v_ccomm, __pyx_v_cbs, (&__pyx_v_n), (&__pyx_v_N)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1539, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":1540 * Sys_Layout(ccomm, rbs, &m, &M) * Sys_Layout(ccomm, cbs, &n, &N) * cdef PetscMat newmat = NULL # <<<<<<<<<<<<<< * CHKERR( MatCreateConstantDiagonal(ccomm, m, n, M, N, diag, &newmat) ) * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat */ __pyx_v_newmat = NULL; /* "petsc4py/PETSc/Mat.pyx":1541 * Sys_Layout(ccomm, cbs, &n, &N) * cdef PetscMat newmat = NULL * CHKERR( MatCreateConstantDiagonal(ccomm, m, n, M, N, diag, &newmat) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat * return self */ __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_v_diag); if (unlikely((__pyx_t_3 == ((PetscScalar)-1)) && PyErr_Occurred())) __PYX_ERR(46, 1541, __pyx_L1_error) __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreateConstantDiagonal(__pyx_v_ccomm, __pyx_v_m, __pyx_v_n, __pyx_v_M, __pyx_v_N, __pyx_t_3, (&__pyx_v_newmat))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1541, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":1542 * cdef PetscMat newmat = NULL * CHKERR( MatCreateConstantDiagonal(ccomm, m, n, M, N, diag, &newmat) ) * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1542, __pyx_L1_error) __pyx_v_self->mat = __pyx_v_newmat; /* "petsc4py/PETSc/Mat.pyx":1543 * CHKERR( MatCreateConstantDiagonal(ccomm, m, n, M, N, diag, &newmat) ) * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat * return self # <<<<<<<<<<<<<< * * def createDiagonal( */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":1511 * return self * * def createConstantDiagonal( # <<<<<<<<<<<<<< * self, * size: MatSizeSpec, */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.createConstantDiagonal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":1545 * return self * * def createDiagonal( # <<<<<<<<<<<<<< * self, * Vec diag, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_107createDiagonal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_106createDiagonal, "Mat.createDiagonal(self, diag: Vec) -> Self\nCreate a diagonal matrix of type `Type.DIAGONAL`.\n\n Collective.\n\n Parameters\n ----------\n diag\n The vector holding diagonal values.\n\n See Also\n --------\n createConstantDiagonal\n\n \nSource code at petsc4py/PETSc/Mat.pyx:1545"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_107createDiagonal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_diag = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createDiagonal (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_diag,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_diag)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 1545, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createDiagonal") < 0)) __PYX_ERR(46, 1545, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_diag = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createDiagonal", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 1545, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.createDiagonal", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_diag), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "diag", 0))) __PYX_ERR(46, 1547, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_106createDiagonal(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_diag); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_106createDiagonal(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_diag) { Vec __pyx_v_dvec; Mat __pyx_v_newmat; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Vec __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createDiagonal", 1); /* "petsc4py/PETSc/Mat.pyx":1563 * * """ * cdef PetscVec dvec = diag.vec # <<<<<<<<<<<<<< * cdef PetscMat newmat = NULL * CHKERR( MatCreateDiagonal(dvec, &newmat) ) */ __pyx_t_1 = __pyx_v_diag->vec; __pyx_v_dvec = __pyx_t_1; /* "petsc4py/PETSc/Mat.pyx":1564 * """ * cdef PetscVec dvec = diag.vec * cdef PetscMat newmat = NULL # <<<<<<<<<<<<<< * CHKERR( MatCreateDiagonal(dvec, &newmat) ) * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat */ __pyx_v_newmat = NULL; /* "petsc4py/PETSc/Mat.pyx":1565 * cdef PetscVec dvec = diag.vec * cdef PetscMat newmat = NULL * CHKERR( MatCreateDiagonal(dvec, &newmat) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat * return self */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreateDiagonal(__pyx_v_dvec, (&__pyx_v_newmat))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1565, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":1566 * cdef PetscMat newmat = NULL * CHKERR( MatCreateDiagonal(dvec, &newmat) ) * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1566, __pyx_L1_error) __pyx_v_self->mat = __pyx_v_newmat; /* "petsc4py/PETSc/Mat.pyx":1567 * CHKERR( MatCreateDiagonal(dvec, &newmat) ) * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat * return self # <<<<<<<<<<<<<< * * def createPython(self, size: MatSizeSpec, context: Any = None, comm: Comm | None = None) -> Self: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":1545 * return self * * def createDiagonal( # <<<<<<<<<<<<<< * self, * Vec diag, */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.createDiagonal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":1569 * return self * * def createPython(self, size: MatSizeSpec, context: Any = None, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Create a `Type.PYTHON` matrix. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_109createPython(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_108createPython, "Mat.createPython(self, size: MatSizeSpec, context: Any = None, comm: Comm | None = None) -> Self\nCreate a `Type.PYTHON` matrix.\n\n Collective.\n\n Parameters\n ----------\n size\n Matrix size.\n context\n An instance of the Python class implementing the required methods.\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n petsc_python_mat, setType, setPythonContext, Type.PYTHON\n\n \nSource code at petsc4py/PETSc/Mat.pyx:1569"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_109createPython(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_size = 0; PyObject *__pyx_v_context = 0; PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createPython (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_context,&__pyx_n_s_comm,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 1569, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_context); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 1569, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 1569, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createPython") < 0)) __PYX_ERR(46, 1569, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_size = values[0]; __pyx_v_context = values[1]; __pyx_v_comm = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createPython", 0, 1, 3, __pyx_nargs); __PYX_ERR(46, 1569, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.createPython", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_108createPython(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_size, __pyx_v_context, __pyx_v_comm); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_108createPython(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_context, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PetscInt __pyx_v_rbs; PetscInt __pyx_v_cbs; PetscInt __pyx_v_m; PetscInt __pyx_v_n; PetscInt __pyx_v_M; PetscInt __pyx_v_N; Mat __pyx_v_newmat; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PetscErrorCode __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createPython", 1); /* "petsc4py/PETSc/Mat.pyx":1589 * """ * # communicator and sizes * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscInt rbs = 0, cbs = 0, m = 0, n = 0, M = 0, N = 0 * Mat_Sizes(size, None, &rbs, &cbs, &m, &n, &M, &N) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(46, 1589, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/Mat.pyx":1590 * # communicator and sizes * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt rbs = 0, cbs = 0, m = 0, n = 0, M = 0, N = 0 # <<<<<<<<<<<<<< * Mat_Sizes(size, None, &rbs, &cbs, &m, &n, &M, &N) * Sys_Layout(ccomm, rbs, &m, &M) */ __pyx_v_rbs = 0; __pyx_v_cbs = 0; __pyx_v_m = 0; __pyx_v_n = 0; __pyx_v_M = 0; __pyx_v_N = 0; /* "petsc4py/PETSc/Mat.pyx":1591 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt rbs = 0, cbs = 0, m = 0, n = 0, M = 0, N = 0 * Mat_Sizes(size, None, &rbs, &cbs, &m, &n, &M, &N) # <<<<<<<<<<<<<< * Sys_Layout(ccomm, rbs, &m, &M) * Sys_Layout(ccomm, cbs, &n, &N) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_Mat_Sizes(__pyx_v_size, Py_None, (&__pyx_v_rbs), (&__pyx_v_cbs), (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_M), (&__pyx_v_N)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1591, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":1592 * cdef PetscInt rbs = 0, cbs = 0, m = 0, n = 0, M = 0, N = 0 * Mat_Sizes(size, None, &rbs, &cbs, &m, &n, &M, &N) * Sys_Layout(ccomm, rbs, &m, &M) # <<<<<<<<<<<<<< * Sys_Layout(ccomm, cbs, &n, &N) * # create matrix */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_Sys_Layout(__pyx_v_ccomm, __pyx_v_rbs, (&__pyx_v_m), (&__pyx_v_M)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1592, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":1593 * Mat_Sizes(size, None, &rbs, &cbs, &m, &n, &M, &N) * Sys_Layout(ccomm, rbs, &m, &M) * Sys_Layout(ccomm, cbs, &n, &N) # <<<<<<<<<<<<<< * # create matrix * # FIXME: propagate block sizes? */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_Sys_Layout(__pyx_v_ccomm, __pyx_v_cbs, (&__pyx_v_n), (&__pyx_v_N)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1593, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":1596 * # create matrix * # FIXME: propagate block sizes? * cdef PetscMat newmat = NULL # <<<<<<<<<<<<<< * CHKERR( MatCreate(ccomm, &newmat) ) * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat */ __pyx_v_newmat = NULL; /* "petsc4py/PETSc/Mat.pyx":1597 * # FIXME: propagate block sizes? * cdef PetscMat newmat = NULL * CHKERR( MatCreate(ccomm, &newmat) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat * CHKERR( MatSetSizes(self.mat, m, n, M, N) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreate(__pyx_v_ccomm, (&__pyx_v_newmat))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1597, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":1598 * cdef PetscMat newmat = NULL * CHKERR( MatCreate(ccomm, &newmat) ) * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat # <<<<<<<<<<<<<< * CHKERR( MatSetSizes(self.mat, m, n, M, N) ) * CHKERR( MatSetType(self.mat, MATPYTHON) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1598, __pyx_L1_error) __pyx_v_self->mat = __pyx_v_newmat; /* "petsc4py/PETSc/Mat.pyx":1599 * CHKERR( MatCreate(ccomm, &newmat) ) * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat * CHKERR( MatSetSizes(self.mat, m, n, M, N) ) # <<<<<<<<<<<<<< * CHKERR( MatSetType(self.mat, MATPYTHON) ) * CHKERR( MatPythonSetContext(self.mat, context) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSetSizes(__pyx_v_self->mat, __pyx_v_m, __pyx_v_n, __pyx_v_M, __pyx_v_N)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1599, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":1600 * CHKERR( PetscCLEAR(self.obj) ); self.mat = newmat * CHKERR( MatSetSizes(self.mat, m, n, M, N) ) * CHKERR( MatSetType(self.mat, MATPYTHON) ) # <<<<<<<<<<<<<< * CHKERR( MatPythonSetContext(self.mat, context) ) * return self */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSetType(__pyx_v_self->mat, MATPYTHON)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1600, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":1601 * CHKERR( MatSetSizes(self.mat, m, n, M, N) ) * CHKERR( MatSetType(self.mat, MATPYTHON) ) * CHKERR( MatPythonSetContext(self.mat, context) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = MatPythonSetContext(__pyx_v_self->mat, ((void *)__pyx_v_context)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1601, __pyx_L1_error) __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_t_2); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1601, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":1602 * CHKERR( MatSetType(self.mat, MATPYTHON) ) * CHKERR( MatPythonSetContext(self.mat, context) ) * return self # <<<<<<<<<<<<<< * * def setPythonContext(self, context: Any) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":1569 * return self * * def createPython(self, size: MatSizeSpec, context: Any = None, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Create a `Type.PYTHON` matrix. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.createPython", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":1604 * return self * * def setPythonContext(self, context: Any) -> None: # <<<<<<<<<<<<<< * """Set the instance of the class implementing the required Python methods. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_111setPythonContext(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_110setPythonContext, "Mat.setPythonContext(self, context: Any) -> None\nSet the instance of the class implementing the required Python methods.\n\n Not collective.\n\n See Also\n --------\n petsc_python_mat, getPythonContext\n\n \nSource code at petsc4py/PETSc/Mat.pyx:1604"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_111setPythonContext(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_context = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPythonContext (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_context,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_context)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 1604, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setPythonContext") < 0)) __PYX_ERR(46, 1604, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_context = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPythonContext", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 1604, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.setPythonContext", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_110setPythonContext(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_context); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_110setPythonContext(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_context) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPythonContext", 1); /* "petsc4py/PETSc/Mat.pyx":1614 * * """ * CHKERR( MatPythonSetContext(self.mat, context) ) # <<<<<<<<<<<<<< * * def getPythonContext(self) -> Any: */ __pyx_t_1 = MatPythonSetContext(__pyx_v_self->mat, ((void *)__pyx_v_context)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1614, __pyx_L1_error) __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_t_1); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1614, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":1604 * return self * * def setPythonContext(self, context: Any) -> None: # <<<<<<<<<<<<<< * """Set the instance of the class implementing the required Python methods. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setPythonContext", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":1616 * CHKERR( MatPythonSetContext(self.mat, context) ) * * def getPythonContext(self) -> Any: # <<<<<<<<<<<<<< * """Return the instance of the class implementing the required Python methods. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_113getPythonContext(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_112getPythonContext, "Mat.getPythonContext(self) -> Any\nReturn the instance of the class implementing the required Python methods.\n\n Not collective.\n\n See Also\n --------\n petsc_python_mat, setPythonContext\n\n \nSource code at petsc4py/PETSc/Mat.pyx:1616"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_113getPythonContext(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getPythonContext (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getPythonContext", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getPythonContext", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_112getPythonContext(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_112getPythonContext(struct PyPetscMatObject *__pyx_v_self) { void *__pyx_v_context; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getPythonContext", 1); /* "petsc4py/PETSc/Mat.pyx":1626 * * """ * cdef void *context = NULL # <<<<<<<<<<<<<< * CHKERR( MatPythonGetContext(self.mat, &context) ) * if context == NULL: return None */ __pyx_v_context = NULL; /* "petsc4py/PETSc/Mat.pyx":1627 * """ * cdef void *context = NULL * CHKERR( MatPythonGetContext(self.mat, &context) ) # <<<<<<<<<<<<<< * if context == NULL: return None * else: return context */ __pyx_t_1 = MatPythonGetContext(__pyx_v_self->mat, (&__pyx_v_context)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1627, __pyx_L1_error) __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_t_1); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1627, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":1628 * cdef void *context = NULL * CHKERR( MatPythonGetContext(self.mat, &context) ) * if context == NULL: return None # <<<<<<<<<<<<<< * else: return context * */ __pyx_t_3 = (__pyx_v_context == NULL); if (__pyx_t_3) { __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } /* "petsc4py/PETSc/Mat.pyx":1629 * CHKERR( MatPythonGetContext(self.mat, &context) ) * if context == NULL: return None * else: return context # <<<<<<<<<<<<<< * * def setPythonType(self, py_type: str) -> None: */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_context)); __pyx_r = ((PyObject *)__pyx_v_context); goto __pyx_L0; } /* "petsc4py/PETSc/Mat.pyx":1616 * CHKERR( MatPythonSetContext(self.mat, context) ) * * def getPythonContext(self) -> Any: # <<<<<<<<<<<<<< * """Return the instance of the class implementing the required Python methods. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.getPythonContext", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":1631 * else: return context * * def setPythonType(self, py_type: str) -> None: # <<<<<<<<<<<<<< * """Set the fully qualified Python name of the class to be used. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_115setPythonType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_114setPythonType, "Mat.setPythonType(self, py_type: str) -> None\nSet the fully qualified Python name of the class to be used.\n\n Collective.\n\n See Also\n --------\n petsc_python_mat, setPythonContext, getPythonType\n petsc.MatPythonSetType\n\n \nSource code at petsc4py/PETSc/Mat.pyx:1631"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_115setPythonType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_py_type = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPythonType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_py_type,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_py_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 1631, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setPythonType") < 0)) __PYX_ERR(46, 1631, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_py_type = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPythonType", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 1631, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.setPythonType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_114setPythonType(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_py_type); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_114setPythonType(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_py_type) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPythonType", 0); __Pyx_INCREF(__pyx_v_py_type); /* "petsc4py/PETSc/Mat.pyx":1642 * * """ * cdef const char *cval = NULL # <<<<<<<<<<<<<< * py_type = str2bytes(py_type, &cval) * CHKERR( MatPythonSetType(self.mat, cval) ) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/Mat.pyx":1643 * """ * cdef const char *cval = NULL * py_type = str2bytes(py_type, &cval) # <<<<<<<<<<<<<< * CHKERR( MatPythonSetType(self.mat, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_py_type, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 1643, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_py_type, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Mat.pyx":1644 * cdef const char *cval = NULL * py_type = str2bytes(py_type, &cval) * CHKERR( MatPythonSetType(self.mat, cval) ) # <<<<<<<<<<<<<< * * def getPythonType(self) -> str: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatPythonSetType(__pyx_v_self->mat, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1644, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":1631 * else: return context * * def setPythonType(self, py_type: str) -> None: # <<<<<<<<<<<<<< * """Set the fully qualified Python name of the class to be used. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.setPythonType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_py_type); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":1646 * CHKERR( MatPythonSetType(self.mat, cval) ) * * def getPythonType(self) -> str: # <<<<<<<<<<<<<< * """Return the fully qualified Python name of the class used by the matrix. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_117getPythonType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_116getPythonType, "Mat.getPythonType(self) -> str\nReturn the fully qualified Python name of the class used by the matrix.\n\n Not collective.\n\n See Also\n --------\n petsc_python_mat, setPythonContext, setPythonType\n petsc.MatPythonGetType\n\n \nSource code at petsc4py/PETSc/Mat.pyx:1646"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_117getPythonType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getPythonType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getPythonType", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getPythonType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_116getPythonType(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_116getPythonType(struct PyPetscMatObject *__pyx_v_self) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getPythonType", 1); /* "petsc4py/PETSc/Mat.pyx":1657 * * """ * cdef const char *cval = NULL # <<<<<<<<<<<<<< * CHKERR( MatPythonGetType(self.mat, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/Mat.pyx":1658 * """ * cdef const char *cval = NULL * CHKERR( MatPythonGetType(self.mat, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatPythonGetType(__pyx_v_self->mat, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1658, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":1659 * cdef const char *cval = NULL * CHKERR( MatPythonGetType(self.mat, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * # */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 1659, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":1646 * CHKERR( MatPythonSetType(self.mat, cval) ) * * def getPythonType(self) -> str: # <<<<<<<<<<<<<< * """Return the fully qualified Python name of the class used by the matrix. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getPythonType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":1663 * # * * def setOptionsPrefix(self, prefix: str) -> None: # <<<<<<<<<<<<<< * """Set the prefix used for searching for options in the database. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_119setOptionsPrefix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_118setOptionsPrefix, "Mat.setOptionsPrefix(self, prefix: str) -> None\nSet the prefix used for searching for options in the database.\n\n Logically collective.\n\n See Also\n --------\n petsc_options, getOptionsPrefix, petsc.MatSetOptionsPrefix\n\n \nSource code at petsc4py/PETSc/Mat.pyx:1663"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_119setOptionsPrefix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_prefix = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setOptionsPrefix (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_prefix,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_prefix)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 1663, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setOptionsPrefix") < 0)) __PYX_ERR(46, 1663, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_prefix = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setOptionsPrefix", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 1663, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.setOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_118setOptionsPrefix(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_prefix); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_118setOptionsPrefix(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_prefix) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setOptionsPrefix", 0); __Pyx_INCREF(__pyx_v_prefix); /* "petsc4py/PETSc/Mat.pyx":1673 * * """ * cdef const char *cval = NULL # <<<<<<<<<<<<<< * prefix = str2bytes(prefix, &cval) * CHKERR( MatSetOptionsPrefix(self.mat, cval) ) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/Mat.pyx":1674 * """ * cdef const char *cval = NULL * prefix = str2bytes(prefix, &cval) # <<<<<<<<<<<<<< * CHKERR( MatSetOptionsPrefix(self.mat, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_prefix, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 1674, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_prefix, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Mat.pyx":1675 * cdef const char *cval = NULL * prefix = str2bytes(prefix, &cval) * CHKERR( MatSetOptionsPrefix(self.mat, cval) ) # <<<<<<<<<<<<<< * * def getOptionsPrefix(self) -> str: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSetOptionsPrefix(__pyx_v_self->mat, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1675, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":1663 * # * * def setOptionsPrefix(self, prefix: str) -> None: # <<<<<<<<<<<<<< * """Set the prefix used for searching for options in the database. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.setOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_prefix); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":1677 * CHKERR( MatSetOptionsPrefix(self.mat, cval) ) * * def getOptionsPrefix(self) -> str: # <<<<<<<<<<<<<< * """Return the prefix used for searching for options in the database. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_121getOptionsPrefix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_120getOptionsPrefix, "Mat.getOptionsPrefix(self) -> str\nReturn the prefix used for searching for options in the database.\n\n Not collective.\n\n See Also\n --------\n petsc_options, setOptionsPrefix, petsc.MatGetOptionsPrefix\n\n \nSource code at petsc4py/PETSc/Mat.pyx:1677"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_121getOptionsPrefix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getOptionsPrefix (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getOptionsPrefix", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getOptionsPrefix", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_120getOptionsPrefix(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_120getOptionsPrefix(struct PyPetscMatObject *__pyx_v_self) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getOptionsPrefix", 1); /* "petsc4py/PETSc/Mat.pyx":1687 * * """ * cdef const char *cval = NULL # <<<<<<<<<<<<<< * CHKERR( MatGetOptionsPrefix(self.mat, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/Mat.pyx":1688 * """ * cdef const char *cval = NULL * CHKERR( MatGetOptionsPrefix(self.mat, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetOptionsPrefix(__pyx_v_self->mat, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1688, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":1689 * cdef const char *cval = NULL * CHKERR( MatGetOptionsPrefix(self.mat, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * def appendOptionsPrefix(self, prefix: str) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 1689, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":1677 * CHKERR( MatSetOptionsPrefix(self.mat, cval) ) * * def getOptionsPrefix(self) -> str: # <<<<<<<<<<<<<< * """Return the prefix used for searching for options in the database. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":1691 * return bytes2str(cval) * * def appendOptionsPrefix(self, prefix: str) -> None: # <<<<<<<<<<<<<< * """Append to the prefix used for searching for options in the database. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_123appendOptionsPrefix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_122appendOptionsPrefix, "Mat.appendOptionsPrefix(self, prefix: str) -> None\nAppend to the prefix used for searching for options in the database.\n\n Logically collective.\n\n See Also\n --------\n petsc_options, setOptionsPrefix, petsc.MatAppendOptionsPrefix\n\n \nSource code at petsc4py/PETSc/Mat.pyx:1691"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_123appendOptionsPrefix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_prefix = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("appendOptionsPrefix (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_prefix,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_prefix)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 1691, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "appendOptionsPrefix") < 0)) __PYX_ERR(46, 1691, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_prefix = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("appendOptionsPrefix", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 1691, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.appendOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_122appendOptionsPrefix(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_prefix); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_122appendOptionsPrefix(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_prefix) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("appendOptionsPrefix", 0); __Pyx_INCREF(__pyx_v_prefix); /* "petsc4py/PETSc/Mat.pyx":1701 * * """ * cdef const char *cval = NULL # <<<<<<<<<<<<<< * prefix = str2bytes(prefix, &cval) * CHKERR( MatAppendOptionsPrefix(self.mat, cval) ) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/Mat.pyx":1702 * """ * cdef const char *cval = NULL * prefix = str2bytes(prefix, &cval) # <<<<<<<<<<<<<< * CHKERR( MatAppendOptionsPrefix(self.mat, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_prefix, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 1702, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_prefix, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Mat.pyx":1703 * cdef const char *cval = NULL * prefix = str2bytes(prefix, &cval) * CHKERR( MatAppendOptionsPrefix(self.mat, cval) ) # <<<<<<<<<<<<<< * * def setFromOptions(self) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatAppendOptionsPrefix(__pyx_v_self->mat, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1703, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":1691 * return bytes2str(cval) * * def appendOptionsPrefix(self, prefix: str) -> None: # <<<<<<<<<<<<<< * """Append to the prefix used for searching for options in the database. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.appendOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_prefix); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":1705 * CHKERR( MatAppendOptionsPrefix(self.mat, cval) ) * * def setFromOptions(self) -> None: # <<<<<<<<<<<<<< * """Configure the matrix from the options database. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_125setFromOptions(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_124setFromOptions, "Mat.setFromOptions(self) -> None\nConfigure the matrix from the options database.\n\n Collective.\n\n See Also\n --------\n petsc_options, petsc.MatSetFromOptions\n\n \nSource code at petsc4py/PETSc/Mat.pyx:1705"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_125setFromOptions(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFromOptions (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("setFromOptions", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setFromOptions", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_124setFromOptions(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_124setFromOptions(struct PyPetscMatObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFromOptions", 1); /* "petsc4py/PETSc/Mat.pyx":1715 * * """ * CHKERR( MatSetFromOptions(self.mat) ) # <<<<<<<<<<<<<< * * def setUp(self) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSetFromOptions(__pyx_v_self->mat)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1715, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":1705 * CHKERR( MatAppendOptionsPrefix(self.mat, cval) ) * * def setFromOptions(self) -> None: # <<<<<<<<<<<<<< * """Configure the matrix from the options database. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setFromOptions", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":1717 * CHKERR( MatSetFromOptions(self.mat) ) * * def setUp(self) -> None: # <<<<<<<<<<<<<< * """Set up the internal data structures for using the matrix. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_127setUp(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_126setUp, "Mat.setUp(self) -> None\nSet up the internal data structures for using the matrix.\n\n Collective.\n\n See Also\n --------\n petsc.MatSetUp\n\n \nSource code at petsc4py/PETSc/Mat.pyx:1717"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_127setUp(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setUp (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("setUp", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setUp", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_126setUp(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_126setUp(struct PyPetscMatObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setUp", 1); /* "petsc4py/PETSc/Mat.pyx":1727 * * """ * CHKERR( MatSetUp(self.mat) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSetUp(__pyx_v_self->mat)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1727, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":1728 * """ * CHKERR( MatSetUp(self.mat) ) * return self # <<<<<<<<<<<<<< * * def setOption(self, option: Option, flag: bool) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":1717 * CHKERR( MatSetFromOptions(self.mat) ) * * def setUp(self) -> None: # <<<<<<<<<<<<<< * """Set up the internal data structures for using the matrix. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setUp", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":1730 * return self * * def setOption(self, option: Option, flag: bool) -> None: # <<<<<<<<<<<<<< * """Set option. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_129setOption(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_128setOption, "Mat.setOption(self, option: Option, flag: bool) -> None\nSet option.\n\n Collective.\n\n See Also\n --------\n getOption, petsc.MatSetOption\n\n \nSource code at petsc4py/PETSc/Mat.pyx:1730"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_129setOption(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_option = 0; PyObject *__pyx_v_flag = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setOption (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_option,&__pyx_n_s_flag,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_option)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 1730, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flag)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 1730, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setOption", 1, 2, 2, 1); __PYX_ERR(46, 1730, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setOption") < 0)) __PYX_ERR(46, 1730, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_option = values[0]; __pyx_v_flag = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setOption", 1, 2, 2, __pyx_nargs); __PYX_ERR(46, 1730, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.setOption", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_128setOption(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_option, __pyx_v_flag); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_128setOption(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_option, PyObject *__pyx_v_flag) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MatOption __pyx_t_1; PetscBool __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setOption", 1); /* "petsc4py/PETSc/Mat.pyx":1740 * * """ * CHKERR( MatSetOption(self.mat, option, flag) ) # <<<<<<<<<<<<<< * * def getOption(self, option: Option) -> bool: */ __pyx_t_1 = ((MatOption)__Pyx_PyInt_As_MatOption(__pyx_v_option)); if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 1740, __pyx_L1_error) __pyx_t_2 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_flag)); if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 1740, __pyx_L1_error) __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSetOption(__pyx_v_self->mat, __pyx_t_1, __pyx_t_2)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1740, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":1730 * return self * * def setOption(self, option: Option, flag: bool) -> None: # <<<<<<<<<<<<<< * """Set option. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setOption", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":1742 * CHKERR( MatSetOption(self.mat, option, flag) ) * * def getOption(self, option: Option) -> bool: # <<<<<<<<<<<<<< * """Return the option value. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_131getOption(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_130getOption, "Mat.getOption(self, option: Option) -> bool\nReturn the option value.\n\n Not collective.\n\n See Also\n --------\n setOption, petsc.MatGetOption\n\n \nSource code at petsc4py/PETSc/Mat.pyx:1742"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_131getOption(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_option = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getOption (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_option,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_option)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 1742, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getOption") < 0)) __PYX_ERR(46, 1742, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_option = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getOption", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 1742, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.getOption", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_130getOption(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_option); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_130getOption(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_option) { PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MatOption __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getOption", 1); /* "petsc4py/PETSc/Mat.pyx":1752 * * """ * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( MatGetOption(self.mat, option, &flag) ) * return toBool(flag) */ __pyx_v_flag = PETSC_FALSE; /* "petsc4py/PETSc/Mat.pyx":1753 * """ * cdef PetscBool flag = PETSC_FALSE * CHKERR( MatGetOption(self.mat, option, &flag) ) # <<<<<<<<<<<<<< * return toBool(flag) * */ __pyx_t_1 = ((MatOption)__Pyx_PyInt_As_MatOption(__pyx_v_option)); if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 1753, __pyx_L1_error) __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetOption(__pyx_v_self->mat, __pyx_t_1, (&__pyx_v_flag))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1753, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":1754 * cdef PetscBool flag = PETSC_FALSE * CHKERR( MatGetOption(self.mat, option, &flag) ) * return toBool(flag) # <<<<<<<<<<<<<< * * def getType(self) -> str: */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 1754, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":1742 * CHKERR( MatSetOption(self.mat, option, flag) ) * * def getOption(self, option: Option) -> bool: # <<<<<<<<<<<<<< * """Return the option value. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getOption", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":1756 * return toBool(flag) * * def getType(self) -> str: # <<<<<<<<<<<<<< * """Return the type of the matrix. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_133getType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_132getType, "Mat.getType(self) -> str\nReturn the type of the matrix.\n\n Not collective.\n\n See Also\n --------\n setType, Type, petsc.MatGetType\n\n \nSource code at petsc4py/PETSc/Mat.pyx:1756"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_133getType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getType", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_132getType(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_132getType(struct PyPetscMatObject *__pyx_v_self) { MatType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getType", 1); /* "petsc4py/PETSc/Mat.pyx":1766 * * """ * cdef PetscMatType cval = NULL # <<<<<<<<<<<<<< * CHKERR( MatGetType(self.mat, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/Mat.pyx":1767 * """ * cdef PetscMatType cval = NULL * CHKERR( MatGetType(self.mat, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetType(__pyx_v_self->mat, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1767, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":1768 * cdef PetscMatType cval = NULL * CHKERR( MatGetType(self.mat, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * def getSize(self) -> tuple[int, int]: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 1768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":1756 * return toBool(flag) * * def getType(self) -> str: # <<<<<<<<<<<<<< * """Return the type of the matrix. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":1770 * return bytes2str(cval) * * def getSize(self) -> tuple[int, int]: # <<<<<<<<<<<<<< * """Return the global number of rows and columns. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_135getSize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_134getSize, "Mat.getSize(self) -> tuple[int, int]\nReturn the global number of rows and columns.\n\n Not collective.\n\n See Also\n --------\n getLocalSize, getSizes, petsc.MatGetSize\n\n \nSource code at petsc4py/PETSc/Mat.pyx:1770"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_135getSize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSize (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getSize", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getSize", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_134getSize(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_134getSize(struct PyPetscMatObject *__pyx_v_self) { PetscInt __pyx_v_M; PetscInt __pyx_v_N; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSize", 1); /* "petsc4py/PETSc/Mat.pyx":1780 * * """ * cdef PetscInt M = 0, N = 0 # <<<<<<<<<<<<<< * CHKERR( MatGetSize(self.mat, &M, &N) ) * return (toInt(M), toInt(N)) */ __pyx_v_M = 0; __pyx_v_N = 0; /* "petsc4py/PETSc/Mat.pyx":1781 * """ * cdef PetscInt M = 0, N = 0 * CHKERR( MatGetSize(self.mat, &M, &N) ) # <<<<<<<<<<<<<< * return (toInt(M), toInt(N)) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetSize(__pyx_v_self->mat, (&__pyx_v_M), (&__pyx_v_N))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1781, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":1782 * cdef PetscInt M = 0, N = 0 * CHKERR( MatGetSize(self.mat, &M, &N) ) * return (toInt(M), toInt(N)) # <<<<<<<<<<<<<< * * def getLocalSize(self) -> tuple[int, int]: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_M); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 1782, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_N); if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 1782, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 1782, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(46, 1782, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(46, 1782, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":1770 * return bytes2str(cval) * * def getSize(self) -> tuple[int, int]: # <<<<<<<<<<<<<< * """Return the global number of rows and columns. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":1784 * return (toInt(M), toInt(N)) * * def getLocalSize(self) -> tuple[int, int]: # <<<<<<<<<<<<<< * """Return the local number of rows and columns. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_137getLocalSize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_136getLocalSize, "Mat.getLocalSize(self) -> tuple[int, int]\nReturn the local number of rows and columns.\n\n Not collective.\n\n See Also\n --------\n getSize, petsc.MatGetLocalSize\n\n \nSource code at petsc4py/PETSc/Mat.pyx:1784"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_137getLocalSize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getLocalSize (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getLocalSize", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getLocalSize", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_136getLocalSize(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_136getLocalSize(struct PyPetscMatObject *__pyx_v_self) { PetscInt __pyx_v_m; PetscInt __pyx_v_n; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getLocalSize", 1); /* "petsc4py/PETSc/Mat.pyx":1794 * * """ * cdef PetscInt m = 0, n = 0 # <<<<<<<<<<<<<< * CHKERR( MatGetLocalSize(self.mat, &m, &n) ) * return (toInt(m), toInt(n)) */ __pyx_v_m = 0; __pyx_v_n = 0; /* "petsc4py/PETSc/Mat.pyx":1795 * """ * cdef PetscInt m = 0, n = 0 * CHKERR( MatGetLocalSize(self.mat, &m, &n) ) # <<<<<<<<<<<<<< * return (toInt(m), toInt(n)) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetLocalSize(__pyx_v_self->mat, (&__pyx_v_m), (&__pyx_v_n))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1795, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":1796 * cdef PetscInt m = 0, n = 0 * CHKERR( MatGetLocalSize(self.mat, &m, &n) ) * return (toInt(m), toInt(n)) # <<<<<<<<<<<<<< * * def getSizes(self) -> tuple[LayoutSizeSpec, LayoutSizeSpec]: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_m); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 1796, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 1796, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 1796, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(46, 1796, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(46, 1796, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":1784 * return (toInt(M), toInt(N)) * * def getLocalSize(self) -> tuple[int, int]: # <<<<<<<<<<<<<< * """Return the local number of rows and columns. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getLocalSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":1798 * return (toInt(m), toInt(n)) * * def getSizes(self) -> tuple[LayoutSizeSpec, LayoutSizeSpec]: # <<<<<<<<<<<<<< * """Return the tuple of matrix layouts. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_139getSizes(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_138getSizes, "Mat.getSizes(self) -> tuple[LayoutSizeSpec, LayoutSizeSpec]\nReturn the tuple of matrix layouts.\n\n Not collective.\n\n See Also\n --------\n getLocalSize, getSize\n\n \nSource code at petsc4py/PETSc/Mat.pyx:1798"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_139getSizes(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSizes (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getSizes", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getSizes", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_138getSizes(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_138getSizes(struct PyPetscMatObject *__pyx_v_self) { PetscInt __pyx_v_m; PetscInt __pyx_v_n; PetscInt __pyx_v_M; PetscInt __pyx_v_N; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSizes", 1); /* "petsc4py/PETSc/Mat.pyx":1808 * * """ * cdef PetscInt m = 0, n = 0 # <<<<<<<<<<<<<< * cdef PetscInt M = 0, N = 0 * CHKERR( MatGetLocalSize(self.mat, &m, &n) ) */ __pyx_v_m = 0; __pyx_v_n = 0; /* "petsc4py/PETSc/Mat.pyx":1809 * """ * cdef PetscInt m = 0, n = 0 * cdef PetscInt M = 0, N = 0 # <<<<<<<<<<<<<< * CHKERR( MatGetLocalSize(self.mat, &m, &n) ) * CHKERR( MatGetSize(self.mat, &M, &N) ) */ __pyx_v_M = 0; __pyx_v_N = 0; /* "petsc4py/PETSc/Mat.pyx":1810 * cdef PetscInt m = 0, n = 0 * cdef PetscInt M = 0, N = 0 * CHKERR( MatGetLocalSize(self.mat, &m, &n) ) # <<<<<<<<<<<<<< * CHKERR( MatGetSize(self.mat, &M, &N) ) * return ((toInt(m), toInt(M)), (toInt(n), toInt(N))) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetLocalSize(__pyx_v_self->mat, (&__pyx_v_m), (&__pyx_v_n))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1810, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":1811 * cdef PetscInt M = 0, N = 0 * CHKERR( MatGetLocalSize(self.mat, &m, &n) ) * CHKERR( MatGetSize(self.mat, &M, &N) ) # <<<<<<<<<<<<<< * return ((toInt(m), toInt(M)), (toInt(n), toInt(N))) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetSize(__pyx_v_self->mat, (&__pyx_v_M), (&__pyx_v_N))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1811, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":1812 * CHKERR( MatGetLocalSize(self.mat, &m, &n) ) * CHKERR( MatGetSize(self.mat, &M, &N) ) * return ((toInt(m), toInt(M)), (toInt(n), toInt(N))) # <<<<<<<<<<<<<< * * def getBlockSize(self) -> int: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_m); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 1812, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_M); if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 1812, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 1812, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(46, 1812, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(46, 1812, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 1812, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_N); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 1812, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(46, 1812, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3)) __PYX_ERR(46, 1812, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2)) __PYX_ERR(46, 1812, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 1812, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4)) __PYX_ERR(46, 1812, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5)) __PYX_ERR(46, 1812, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":1798 * return (toInt(m), toInt(n)) * * def getSizes(self) -> tuple[LayoutSizeSpec, LayoutSizeSpec]: # <<<<<<<<<<<<<< * """Return the tuple of matrix layouts. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getSizes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":1814 * return ((toInt(m), toInt(M)), (toInt(n), toInt(N))) * * def getBlockSize(self) -> int: # <<<<<<<<<<<<<< * """Return the matrix block size. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_141getBlockSize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_140getBlockSize, "Mat.getBlockSize(self) -> int\nReturn the matrix block size.\n\n Not collective.\n\n See Also\n --------\n getBlockSize, petsc.MatGetBlockSize\n\n \nSource code at petsc4py/PETSc/Mat.pyx:1814"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_141getBlockSize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getBlockSize (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getBlockSize", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getBlockSize", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_140getBlockSize(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_140getBlockSize(struct PyPetscMatObject *__pyx_v_self) { PetscInt __pyx_v_bs; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getBlockSize", 1); /* "petsc4py/PETSc/Mat.pyx":1824 * * """ * cdef PetscInt bs = 0 # <<<<<<<<<<<<<< * CHKERR( MatGetBlockSize(self.mat, &bs) ) * return toInt(bs) */ __pyx_v_bs = 0; /* "petsc4py/PETSc/Mat.pyx":1825 * """ * cdef PetscInt bs = 0 * CHKERR( MatGetBlockSize(self.mat, &bs) ) # <<<<<<<<<<<<<< * return toInt(bs) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetBlockSize(__pyx_v_self->mat, (&__pyx_v_bs))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1825, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":1826 * cdef PetscInt bs = 0 * CHKERR( MatGetBlockSize(self.mat, &bs) ) * return toInt(bs) # <<<<<<<<<<<<<< * * def getBlockSizes(self) -> tuple[int, int]: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_bs); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 1826, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":1814 * return ((toInt(m), toInt(M)), (toInt(n), toInt(N))) * * def getBlockSize(self) -> int: # <<<<<<<<<<<<<< * """Return the matrix block size. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getBlockSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":1828 * return toInt(bs) * * def getBlockSizes(self) -> tuple[int, int]: # <<<<<<<<<<<<<< * """Return the row and column block sizes. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_143getBlockSizes(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_142getBlockSizes, "Mat.getBlockSizes(self) -> tuple[int, int]\nReturn the row and column block sizes.\n\n Not collective.\n\n See Also\n --------\n getBlockSize, petsc.MatGetBlockSizes\n\n \nSource code at petsc4py/PETSc/Mat.pyx:1828"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_143getBlockSizes(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getBlockSizes (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getBlockSizes", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getBlockSizes", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_142getBlockSizes(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_142getBlockSizes(struct PyPetscMatObject *__pyx_v_self) { PetscInt __pyx_v_rbs; PetscInt __pyx_v_cbs; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getBlockSizes", 1); /* "petsc4py/PETSc/Mat.pyx":1838 * * """ * cdef PetscInt rbs = 0, cbs = 0 # <<<<<<<<<<<<<< * CHKERR( MatGetBlockSizes(self.mat, &rbs, &cbs) ) * return (toInt(rbs), toInt(cbs)) */ __pyx_v_rbs = 0; __pyx_v_cbs = 0; /* "petsc4py/PETSc/Mat.pyx":1839 * """ * cdef PetscInt rbs = 0, cbs = 0 * CHKERR( MatGetBlockSizes(self.mat, &rbs, &cbs) ) # <<<<<<<<<<<<<< * return (toInt(rbs), toInt(cbs)) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetBlockSizes(__pyx_v_self->mat, (&__pyx_v_rbs), (&__pyx_v_cbs))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1839, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":1840 * cdef PetscInt rbs = 0, cbs = 0 * CHKERR( MatGetBlockSizes(self.mat, &rbs, &cbs) ) * return (toInt(rbs), toInt(cbs)) # <<<<<<<<<<<<<< * * def getOwnershipRange(self) -> tuple[int, int]: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_rbs); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 1840, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_cbs); if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 1840, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 1840, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(46, 1840, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(46, 1840, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":1828 * return toInt(bs) * * def getBlockSizes(self) -> tuple[int, int]: # <<<<<<<<<<<<<< * """Return the row and column block sizes. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getBlockSizes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":1842 * return (toInt(rbs), toInt(cbs)) * * def getOwnershipRange(self) -> tuple[int, int]: # <<<<<<<<<<<<<< * """Return the locally owned range of rows. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_145getOwnershipRange(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_144getOwnershipRange, "Mat.getOwnershipRange(self) -> tuple[int, int]\nReturn the locally owned range of rows.\n\n Not collective.\n\n See Also\n --------\n getOwnershipRanges, getOwnershipRangeColumn, petsc.MatGetOwnershipRange\n\n \nSource code at petsc4py/PETSc/Mat.pyx:1842"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_145getOwnershipRange(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getOwnershipRange (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getOwnershipRange", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getOwnershipRange", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_144getOwnershipRange(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_144getOwnershipRange(struct PyPetscMatObject *__pyx_v_self) { PetscInt __pyx_v_ival1; PetscInt __pyx_v_ival2; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getOwnershipRange", 1); /* "petsc4py/PETSc/Mat.pyx":1852 * * """ * cdef PetscInt ival1 = 0, ival2 = 0 # <<<<<<<<<<<<<< * CHKERR( MatGetOwnershipRange(self.mat, &ival1, &ival2) ) * return (toInt(ival1), toInt(ival2)) */ __pyx_v_ival1 = 0; __pyx_v_ival2 = 0; /* "petsc4py/PETSc/Mat.pyx":1853 * """ * cdef PetscInt ival1 = 0, ival2 = 0 * CHKERR( MatGetOwnershipRange(self.mat, &ival1, &ival2) ) # <<<<<<<<<<<<<< * return (toInt(ival1), toInt(ival2)) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetOwnershipRange(__pyx_v_self->mat, (&__pyx_v_ival1), (&__pyx_v_ival2))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1853, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":1854 * cdef PetscInt ival1 = 0, ival2 = 0 * CHKERR( MatGetOwnershipRange(self.mat, &ival1, &ival2) ) * return (toInt(ival1), toInt(ival2)) # <<<<<<<<<<<<<< * * def getOwnershipRanges(self) -> ArrayInt: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ival1); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 1854, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ival2); if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 1854, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 1854, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(46, 1854, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(46, 1854, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":1842 * return (toInt(rbs), toInt(cbs)) * * def getOwnershipRange(self) -> tuple[int, int]: # <<<<<<<<<<<<<< * """Return the locally owned range of rows. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getOwnershipRange", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":1856 * return (toInt(ival1), toInt(ival2)) * * def getOwnershipRanges(self) -> ArrayInt: # <<<<<<<<<<<<<< * """Return the range of rows owned by each process. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_147getOwnershipRanges(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_146getOwnershipRanges, "Mat.getOwnershipRanges(self) -> ArrayInt\nReturn the range of rows owned by each process.\n\n Not collective.\n\n The returned array is the result of exclusive scan of the local sizes.\n\n See Also\n --------\n getOwnershipRange, petsc.MatGetOwnershipRanges\n\n \nSource code at petsc4py/PETSc/Mat.pyx:1856"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_147getOwnershipRanges(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getOwnershipRanges (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getOwnershipRanges", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getOwnershipRanges", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_146getOwnershipRanges(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_146getOwnershipRanges(struct PyPetscMatObject *__pyx_v_self) { PetscInt const *__pyx_v_rowrng; MPI_Comm __pyx_v_comm; int __pyx_v_size; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getOwnershipRanges", 1); /* "petsc4py/PETSc/Mat.pyx":1868 * * """ * cdef const PetscInt *rowrng = NULL # <<<<<<<<<<<<<< * CHKERR( MatGetOwnershipRanges(self.mat, &rowrng) ) * cdef MPI_Comm comm = MPI_COMM_NULL */ __pyx_v_rowrng = NULL; /* "petsc4py/PETSc/Mat.pyx":1869 * """ * cdef const PetscInt *rowrng = NULL * CHKERR( MatGetOwnershipRanges(self.mat, &rowrng) ) # <<<<<<<<<<<<<< * cdef MPI_Comm comm = MPI_COMM_NULL * CHKERR( PetscObjectGetComm(self.mat, &comm) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetOwnershipRanges(__pyx_v_self->mat, (&__pyx_v_rowrng))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1869, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":1870 * cdef const PetscInt *rowrng = NULL * CHKERR( MatGetOwnershipRanges(self.mat, &rowrng) ) * cdef MPI_Comm comm = MPI_COMM_NULL # <<<<<<<<<<<<<< * CHKERR( PetscObjectGetComm(self.mat, &comm) ) * cdef int size = -1 */ __pyx_v_comm = MPI_COMM_NULL; /* "petsc4py/PETSc/Mat.pyx":1871 * CHKERR( MatGetOwnershipRanges(self.mat, &rowrng) ) * cdef MPI_Comm comm = MPI_COMM_NULL * CHKERR( PetscObjectGetComm(self.mat, &comm) ) # <<<<<<<<<<<<<< * cdef int size = -1 * CHKERR( MPI_Comm_size(comm, &size) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectGetComm(((PetscObject)__pyx_v_self->mat), (&__pyx_v_comm))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1871, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":1872 * cdef MPI_Comm comm = MPI_COMM_NULL * CHKERR( PetscObjectGetComm(self.mat, &comm) ) * cdef int size = -1 # <<<<<<<<<<<<<< * CHKERR( MPI_Comm_size(comm, &size) ) * return array_i(size+1, rowrng) */ __pyx_v_size = -1; /* "petsc4py/PETSc/Mat.pyx":1873 * CHKERR( PetscObjectGetComm(self.mat, &comm) ) * cdef int size = -1 * CHKERR( MPI_Comm_size(comm, &size) ) # <<<<<<<<<<<<<< * return array_i(size+1, rowrng) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(((PetscErrorCode)MPI_Comm_size(__pyx_v_comm, (&__pyx_v_size)))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1873, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":1874 * cdef int size = -1 * CHKERR( MPI_Comm_size(comm, &size) ) * return array_i(size+1, rowrng) # <<<<<<<<<<<<<< * * def getOwnershipRangeColumn(self) -> tuple[int, int]: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i((__pyx_v_size + 1), __pyx_v_rowrng)); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 1874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":1856 * return (toInt(ival1), toInt(ival2)) * * def getOwnershipRanges(self) -> ArrayInt: # <<<<<<<<<<<<<< * """Return the range of rows owned by each process. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getOwnershipRanges", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":1876 * return array_i(size+1, rowrng) * * def getOwnershipRangeColumn(self) -> tuple[int, int]: # <<<<<<<<<<<<<< * """Return the locally owned range of columns. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_149getOwnershipRangeColumn(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_148getOwnershipRangeColumn, "Mat.getOwnershipRangeColumn(self) -> tuple[int, int]\nReturn the locally owned range of columns.\n\n Not collective.\n\n See Also\n --------\n getOwnershipRangesColumn, getOwnershipRange\n petsc.MatGetOwnershipRangeColumn\n\n \nSource code at petsc4py/PETSc/Mat.pyx:1876"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_149getOwnershipRangeColumn(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getOwnershipRangeColumn (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getOwnershipRangeColumn", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getOwnershipRangeColumn", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_148getOwnershipRangeColumn(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_148getOwnershipRangeColumn(struct PyPetscMatObject *__pyx_v_self) { PetscInt __pyx_v_ival1; PetscInt __pyx_v_ival2; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getOwnershipRangeColumn", 1); /* "petsc4py/PETSc/Mat.pyx":1887 * * """ * cdef PetscInt ival1 = 0, ival2 = 0 # <<<<<<<<<<<<<< * CHKERR( MatGetOwnershipRangeColumn(self.mat, &ival1, &ival2) ) * return (toInt(ival1), toInt(ival2)) */ __pyx_v_ival1 = 0; __pyx_v_ival2 = 0; /* "petsc4py/PETSc/Mat.pyx":1888 * """ * cdef PetscInt ival1 = 0, ival2 = 0 * CHKERR( MatGetOwnershipRangeColumn(self.mat, &ival1, &ival2) ) # <<<<<<<<<<<<<< * return (toInt(ival1), toInt(ival2)) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetOwnershipRangeColumn(__pyx_v_self->mat, (&__pyx_v_ival1), (&__pyx_v_ival2))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1888, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":1889 * cdef PetscInt ival1 = 0, ival2 = 0 * CHKERR( MatGetOwnershipRangeColumn(self.mat, &ival1, &ival2) ) * return (toInt(ival1), toInt(ival2)) # <<<<<<<<<<<<<< * * def getOwnershipRangesColumn(self) -> ArrayInt: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ival1); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 1889, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ival2); if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 1889, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 1889, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(46, 1889, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(46, 1889, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":1876 * return array_i(size+1, rowrng) * * def getOwnershipRangeColumn(self) -> tuple[int, int]: # <<<<<<<<<<<<<< * """Return the locally owned range of columns. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getOwnershipRangeColumn", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":1891 * return (toInt(ival1), toInt(ival2)) * * def getOwnershipRangesColumn(self) -> ArrayInt: # <<<<<<<<<<<<<< * """Return the range of columns owned by each process. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_151getOwnershipRangesColumn(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_150getOwnershipRangesColumn, "Mat.getOwnershipRangesColumn(self) -> ArrayInt\nReturn the range of columns owned by each process.\n\n Not collective.\n\n See Also\n --------\n getOwnershipRangeColumn, petsc.MatGetOwnershipRangesColumn\n\n \nSource code at petsc4py/PETSc/Mat.pyx:1891"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_151getOwnershipRangesColumn(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getOwnershipRangesColumn (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getOwnershipRangesColumn", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getOwnershipRangesColumn", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_150getOwnershipRangesColumn(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_150getOwnershipRangesColumn(struct PyPetscMatObject *__pyx_v_self) { PetscInt const *__pyx_v_colrng; MPI_Comm __pyx_v_comm; int __pyx_v_size; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getOwnershipRangesColumn", 1); /* "petsc4py/PETSc/Mat.pyx":1901 * * """ * cdef const PetscInt *colrng = NULL # <<<<<<<<<<<<<< * CHKERR( MatGetOwnershipRangesColumn(self.mat, &colrng) ) * cdef MPI_Comm comm = MPI_COMM_NULL */ __pyx_v_colrng = NULL; /* "petsc4py/PETSc/Mat.pyx":1902 * """ * cdef const PetscInt *colrng = NULL * CHKERR( MatGetOwnershipRangesColumn(self.mat, &colrng) ) # <<<<<<<<<<<<<< * cdef MPI_Comm comm = MPI_COMM_NULL * CHKERR( PetscObjectGetComm(self.mat, &comm) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetOwnershipRangesColumn(__pyx_v_self->mat, (&__pyx_v_colrng))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1902, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":1903 * cdef const PetscInt *colrng = NULL * CHKERR( MatGetOwnershipRangesColumn(self.mat, &colrng) ) * cdef MPI_Comm comm = MPI_COMM_NULL # <<<<<<<<<<<<<< * CHKERR( PetscObjectGetComm(self.mat, &comm) ) * cdef int size = -1 */ __pyx_v_comm = MPI_COMM_NULL; /* "petsc4py/PETSc/Mat.pyx":1904 * CHKERR( MatGetOwnershipRangesColumn(self.mat, &colrng) ) * cdef MPI_Comm comm = MPI_COMM_NULL * CHKERR( PetscObjectGetComm(self.mat, &comm) ) # <<<<<<<<<<<<<< * cdef int size = -1 * CHKERR( MPI_Comm_size(comm, &size) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectGetComm(((PetscObject)__pyx_v_self->mat), (&__pyx_v_comm))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1904, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":1905 * cdef MPI_Comm comm = MPI_COMM_NULL * CHKERR( PetscObjectGetComm(self.mat, &comm) ) * cdef int size = -1 # <<<<<<<<<<<<<< * CHKERR( MPI_Comm_size(comm, &size) ) * return array_i(size+1, colrng) */ __pyx_v_size = -1; /* "petsc4py/PETSc/Mat.pyx":1906 * CHKERR( PetscObjectGetComm(self.mat, &comm) ) * cdef int size = -1 * CHKERR( MPI_Comm_size(comm, &size) ) # <<<<<<<<<<<<<< * return array_i(size+1, colrng) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(((PetscErrorCode)MPI_Comm_size(__pyx_v_comm, (&__pyx_v_size)))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1906, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":1907 * cdef int size = -1 * CHKERR( MPI_Comm_size(comm, &size) ) * return array_i(size+1, colrng) # <<<<<<<<<<<<<< * * def getOwnershipIS(self) -> tuple[IS, IS]: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i((__pyx_v_size + 1), __pyx_v_colrng)); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 1907, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":1891 * return (toInt(ival1), toInt(ival2)) * * def getOwnershipRangesColumn(self) -> ArrayInt: # <<<<<<<<<<<<<< * """Return the range of columns owned by each process. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getOwnershipRangesColumn", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":1909 * return array_i(size+1, colrng) * * def getOwnershipIS(self) -> tuple[IS, IS]: # <<<<<<<<<<<<<< * """Return the ranges of rows and columns owned by each process as index sets. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_153getOwnershipIS(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_152getOwnershipIS, "Mat.getOwnershipIS(self) -> tuple[IS, IS]\nReturn the ranges of rows and columns owned by each process as index sets.\n\n Not collective.\n\n See Also\n --------\n getOwnershipRanges, getOwnershipRangesColumn, petsc.MatGetOwnershipIS\n\n \nSource code at petsc4py/PETSc/Mat.pyx:1909"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_153getOwnershipIS(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getOwnershipIS (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getOwnershipIS", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getOwnershipIS", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_152getOwnershipIS(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_152getOwnershipIS(struct PyPetscMatObject *__pyx_v_self) { struct PyPetscISObject *__pyx_v_rows = 0; struct PyPetscISObject *__pyx_v_cols = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getOwnershipIS", 1); /* "petsc4py/PETSc/Mat.pyx":1919 * * """ * cdef IS rows = IS() # <<<<<<<<<<<<<< * cdef IS cols = IS() * CHKERR( MatGetOwnershipIS(self.mat, &rows.iset, &cols.iset) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 1919, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_rows = ((struct PyPetscISObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Mat.pyx":1920 * """ * cdef IS rows = IS() * cdef IS cols = IS() # <<<<<<<<<<<<<< * CHKERR( MatGetOwnershipIS(self.mat, &rows.iset, &cols.iset) ) * return (rows, cols) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 1920, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_cols = ((struct PyPetscISObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Mat.pyx":1921 * cdef IS rows = IS() * cdef IS cols = IS() * CHKERR( MatGetOwnershipIS(self.mat, &rows.iset, &cols.iset) ) # <<<<<<<<<<<<<< * return (rows, cols) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetOwnershipIS(__pyx_v_self->mat, (&__pyx_v_rows->iset), (&__pyx_v_cols->iset))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1921, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":1922 * cdef IS cols = IS() * CHKERR( MatGetOwnershipIS(self.mat, &rows.iset, &cols.iset) ) * return (rows, cols) # <<<<<<<<<<<<<< * * def getInfo(self, info: InfoType = None) -> dict[str, float]: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 1922, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF((PyObject *)__pyx_v_rows); __Pyx_GIVEREF((PyObject *)__pyx_v_rows); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_rows))) __PYX_ERR(46, 1922, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_cols); __Pyx_GIVEREF((PyObject *)__pyx_v_cols); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_cols))) __PYX_ERR(46, 1922, __pyx_L1_error); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":1909 * return array_i(size+1, colrng) * * def getOwnershipIS(self) -> tuple[IS, IS]: # <<<<<<<<<<<<<< * """Return the ranges of rows and columns owned by each process as index sets. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getOwnershipIS", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_rows); __Pyx_XDECREF((PyObject *)__pyx_v_cols); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":1924 * return (rows, cols) * * def getInfo(self, info: InfoType = None) -> dict[str, float]: # <<<<<<<<<<<<<< * """Return summary information. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_155getInfo(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_154getInfo, "Mat.getInfo(self, info: InfoType = None) -> dict[str, float]\nReturn summary information.\n\n Collective.\n\n Parameters\n ----------\n info\n If `None`, it uses `InfoType.GLOBAL_SUM`.\n\n See Also\n --------\n petsc.MatInfo, petsc.MatGetInfo\n\n \nSource code at petsc4py/PETSc/Mat.pyx:1924"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_155getInfo(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_info = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getInfo (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_info,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_info); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 1924, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getInfo") < 0)) __PYX_ERR(46, 1924, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_info = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getInfo", 0, 0, 1, __pyx_nargs); __PYX_ERR(46, 1924, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.getInfo", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_154getInfo(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_info); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_154getInfo(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_info) { MatInfoType __pyx_v_itype; MatInfo __pyx_v_cinfo; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MatInfoType __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getInfo", 1); /* "petsc4py/PETSc/Mat.pyx":1939 * * """ * cdef PetscMatInfoType itype = infotype(info) # <<<<<<<<<<<<<< * cdef PetscMatInfo cinfo * CHKERR( MatGetInfo(self.mat, itype, &cinfo) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_infotype(__pyx_v_info); if (unlikely(__pyx_t_1 == ((MatInfoType)((MatInfoType)-1L)))) __PYX_ERR(46, 1939, __pyx_L1_error) __pyx_v_itype = __pyx_t_1; /* "petsc4py/PETSc/Mat.pyx":1941 * cdef PetscMatInfoType itype = infotype(info) * cdef PetscMatInfo cinfo * CHKERR( MatGetInfo(self.mat, itype, &cinfo) ) # <<<<<<<<<<<<<< * return cinfo * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetInfo(__pyx_v_self->mat, __pyx_v_itype, (&__pyx_v_cinfo))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1941, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":1942 * cdef PetscMatInfo cinfo * CHKERR( MatGetInfo(self.mat, itype, &cinfo) ) * return cinfo # <<<<<<<<<<<<<< * * def duplicate(self, copy: bool = False) -> Mat: */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_convert__to_py_MatInfo(__pyx_v_cinfo); if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 1942, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":1924 * return (rows, cols) * * def getInfo(self, info: InfoType = None) -> dict[str, float]: # <<<<<<<<<<<<<< * """Return summary information. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getInfo", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":1944 * return cinfo * * def duplicate(self, copy: bool = False) -> Mat: # <<<<<<<<<<<<<< * """Return a clone of the matrix. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_157duplicate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_156duplicate, "Mat.duplicate(self, copy: bool = False) -> Mat\nReturn a clone of the matrix.\n\n Collective.\n\n Parameters\n ----------\n copy\n If `True`, it also copies the values.\n\n See Also\n --------\n petsc.MatDuplicate\n\n \nSource code at petsc4py/PETSc/Mat.pyx:1944"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_157duplicate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_copy = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("duplicate (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_copy,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_copy); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 1944, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "duplicate") < 0)) __PYX_ERR(46, 1944, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_copy = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("duplicate", 0, 0, 1, __pyx_nargs); __PYX_ERR(46, 1944, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.duplicate", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_156duplicate(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_copy); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_156duplicate(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_copy) { MatDuplicateOption __pyx_v_flag; struct PyPetscMatObject *__pyx_v_mat = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PetscErrorCode __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("duplicate", 1); /* "petsc4py/PETSc/Mat.pyx":1959 * * """ * cdef PetscMatDuplicateOption flag = MAT_DO_NOT_COPY_VALUES # <<<<<<<<<<<<<< * if copy: flag = MAT_COPY_VALUES * if copy > MAT_COPY_VALUES: flag = MAT_SHARE_NONZERO_PATTERN */ __pyx_v_flag = MAT_DO_NOT_COPY_VALUES; /* "petsc4py/PETSc/Mat.pyx":1960 * """ * cdef PetscMatDuplicateOption flag = MAT_DO_NOT_COPY_VALUES * if copy: flag = MAT_COPY_VALUES # <<<<<<<<<<<<<< * if copy > MAT_COPY_VALUES: flag = MAT_SHARE_NONZERO_PATTERN * cdef Mat mat = type(self)() */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_copy); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(46, 1960, __pyx_L1_error) if (__pyx_t_1) { __pyx_v_flag = MAT_COPY_VALUES; } /* "petsc4py/PETSc/Mat.pyx":1961 * cdef PetscMatDuplicateOption flag = MAT_DO_NOT_COPY_VALUES * if copy: flag = MAT_COPY_VALUES * if copy > MAT_COPY_VALUES: flag = MAT_SHARE_NONZERO_PATTERN # <<<<<<<<<<<<<< * cdef Mat mat = type(self)() * CHKERR( MatDuplicate(self.mat, flag, &mat.mat) ) */ __pyx_t_2 = __Pyx_PyInt_From_MatDuplicateOption(MAT_COPY_VALUES); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 1961, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyObject_RichCompare(__pyx_v_copy, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 1961, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(46, 1961, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { __pyx_v_flag = MAT_SHARE_NONZERO_PATTERN; } /* "petsc4py/PETSc/Mat.pyx":1962 * if copy: flag = MAT_COPY_VALUES * if copy > MAT_COPY_VALUES: flag = MAT_SHARE_NONZERO_PATTERN * cdef Mat mat = type(self)() # <<<<<<<<<<<<<< * CHKERR( MatDuplicate(self.mat, flag, &mat.mat) ) * return mat */ __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __pyx_t_2 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 1962, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(46, 1962, __pyx_L1_error) __pyx_v_mat = ((struct PyPetscMatObject *)__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/Mat.pyx":1963 * if copy > MAT_COPY_VALUES: flag = MAT_SHARE_NONZERO_PATTERN * cdef Mat mat = type(self)() * CHKERR( MatDuplicate(self.mat, flag, &mat.mat) ) # <<<<<<<<<<<<<< * return mat * */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDuplicate(__pyx_v_self->mat, __pyx_v_flag, (&__pyx_v_mat->mat))); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1963, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":1964 * cdef Mat mat = type(self)() * CHKERR( MatDuplicate(self.mat, flag, &mat.mat) ) * return mat # <<<<<<<<<<<<<< * * def copy(self, Mat result=None, structure: Structure | None = None) -> Mat: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_mat); __pyx_r = ((PyObject *)__pyx_v_mat); goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":1944 * return cinfo * * def duplicate(self, copy: bool = False) -> Mat: # <<<<<<<<<<<<<< * """Return a clone of the matrix. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.Mat.duplicate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_mat); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":1966 * return mat * * def copy(self, Mat result=None, structure: Structure | None = None) -> Mat: # <<<<<<<<<<<<<< * """Return a copy of the matrix. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_159copy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_158copy, "Mat.copy(self, result: Mat | None = None, structure: Structure | None = None) -> Mat\nReturn a copy of the matrix.\n\n Collective.\n\n Parameters\n ----------\n result\n Optional return matrix. If `None`, it is internally created.\n structure\n The copy structure. Only relevant if ``result`` is not `None`.\n\n See Also\n --------\n petsc.MatCopy, petsc.MatDuplicate\n\n \nSource code at petsc4py/PETSc/Mat.pyx:1966"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_159copy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscMatObject *__pyx_v_result = 0; PyObject *__pyx_v_structure = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("copy (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_result,&__pyx_n_s_structure,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscMatObject *)Py_None)); values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_result); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 1966, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_structure); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 1966, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "copy") < 0)) __PYX_ERR(46, 1966, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_result = ((struct PyPetscMatObject *)values[0]); __pyx_v_structure = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("copy", 0, 0, 2, __pyx_nargs); __PYX_ERR(46, 1966, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_result), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "result", 0))) __PYX_ERR(46, 1966, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_158copy(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_result, __pyx_v_structure); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_158copy(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_result, PyObject *__pyx_v_structure) { MatDuplicateOption __pyx_v_copy; MatStructure __pyx_v_mstr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MatStructure __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; PetscErrorCode __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("copy", 0); __Pyx_INCREF((PyObject *)__pyx_v_result); /* "petsc4py/PETSc/Mat.pyx":1983 * * """ * cdef PetscMatDuplicateOption copy = MAT_COPY_VALUES # <<<<<<<<<<<<<< * cdef PetscMatStructure mstr = matstructure(structure) * if result is None: */ __pyx_v_copy = MAT_COPY_VALUES; /* "petsc4py/PETSc/Mat.pyx":1984 * """ * cdef PetscMatDuplicateOption copy = MAT_COPY_VALUES * cdef PetscMatStructure mstr = matstructure(structure) # <<<<<<<<<<<<<< * if result is None: * result = type(self)() */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_matstructure(__pyx_v_structure); if (unlikely(__pyx_t_1 == ((MatStructure)((MatStructure)-1L)))) __PYX_ERR(46, 1984, __pyx_L1_error) __pyx_v_mstr = __pyx_t_1; /* "petsc4py/PETSc/Mat.pyx":1985 * cdef PetscMatDuplicateOption copy = MAT_COPY_VALUES * cdef PetscMatStructure mstr = matstructure(structure) * if result is None: # <<<<<<<<<<<<<< * result = type(self)() * if result.mat == NULL: */ __pyx_t_2 = (((PyObject *)__pyx_v_result) == Py_None); if (__pyx_t_2) { /* "petsc4py/PETSc/Mat.pyx":1986 * cdef PetscMatStructure mstr = matstructure(structure) * if result is None: * result = type(self)() # <<<<<<<<<<<<<< * if result.mat == NULL: * CHKERR( MatDuplicate(self.mat, copy, &result.mat) ) */ __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __pyx_t_4 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 1986, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(46, 1986, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_result, ((struct PyPetscMatObject *)__pyx_t_3)); __pyx_t_3 = 0; /* "petsc4py/PETSc/Mat.pyx":1985 * cdef PetscMatDuplicateOption copy = MAT_COPY_VALUES * cdef PetscMatStructure mstr = matstructure(structure) * if result is None: # <<<<<<<<<<<<<< * result = type(self)() * if result.mat == NULL: */ } /* "petsc4py/PETSc/Mat.pyx":1987 * if result is None: * result = type(self)() * if result.mat == NULL: # <<<<<<<<<<<<<< * CHKERR( MatDuplicate(self.mat, copy, &result.mat) ) * else: */ __pyx_t_2 = (__pyx_v_result->mat == NULL); if (__pyx_t_2) { /* "petsc4py/PETSc/Mat.pyx":1988 * result = type(self)() * if result.mat == NULL: * CHKERR( MatDuplicate(self.mat, copy, &result.mat) ) # <<<<<<<<<<<<<< * else: * CHKERR( MatCopy(self.mat, result.mat, mstr) ) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDuplicate(__pyx_v_self->mat, __pyx_v_copy, (&__pyx_v_result->mat))); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1988, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":1987 * if result is None: * result = type(self)() * if result.mat == NULL: # <<<<<<<<<<<<<< * CHKERR( MatDuplicate(self.mat, copy, &result.mat) ) * else: */ goto __pyx_L4; } /* "petsc4py/PETSc/Mat.pyx":1990 * CHKERR( MatDuplicate(self.mat, copy, &result.mat) ) * else: * CHKERR( MatCopy(self.mat, result.mat, mstr) ) # <<<<<<<<<<<<<< * return result * */ /*else*/ { __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCopy(__pyx_v_self->mat, __pyx_v_result->mat, __pyx_v_mstr)); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1990, __pyx_L1_error) } __pyx_L4:; /* "petsc4py/PETSc/Mat.pyx":1991 * else: * CHKERR( MatCopy(self.mat, result.mat, mstr) ) * return result # <<<<<<<<<<<<<< * * def load(self, Viewer viewer) -> Self: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_result); __pyx_r = ((PyObject *)__pyx_v_result); goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":1966 * return mat * * def copy(self, Mat result=None, structure: Structure | None = None) -> Mat: # <<<<<<<<<<<<<< * """Return a copy of the matrix. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.Mat.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":1993 * return result * * def load(self, Viewer viewer) -> Self: # <<<<<<<<<<<<<< * """Load a matrix. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_161load(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_160load, "Mat.load(self, viewer: Viewer) -> Self\nLoad a matrix.\n\n Collective.\n\n See Also\n --------\n petsc.MatLoad\n\n \nSource code at petsc4py/PETSc/Mat.pyx:1993"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_161load(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscViewerObject *__pyx_v_viewer = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("load (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_viewer)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 1993, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "load") < 0)) __PYX_ERR(46, 1993, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("load", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 1993, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.load", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 0, "viewer", 0))) __PYX_ERR(46, 1993, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_160load(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_viewer); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_160load(struct PyPetscMatObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer) { MPI_Comm __pyx_v_comm; PetscObject __pyx_v_obj; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("load", 1); /* "petsc4py/PETSc/Mat.pyx":2003 * * """ * cdef MPI_Comm comm = MPI_COMM_NULL # <<<<<<<<<<<<<< * cdef PetscObject obj = (viewer.vwr) * if self.mat == NULL: */ __pyx_v_comm = MPI_COMM_NULL; /* "petsc4py/PETSc/Mat.pyx":2004 * """ * cdef MPI_Comm comm = MPI_COMM_NULL * cdef PetscObject obj = (viewer.vwr) # <<<<<<<<<<<<<< * if self.mat == NULL: * CHKERR( PetscObjectGetComm(obj, &comm) ) */ __pyx_v_obj = ((PetscObject)__pyx_v_viewer->vwr); /* "petsc4py/PETSc/Mat.pyx":2005 * cdef MPI_Comm comm = MPI_COMM_NULL * cdef PetscObject obj = (viewer.vwr) * if self.mat == NULL: # <<<<<<<<<<<<<< * CHKERR( PetscObjectGetComm(obj, &comm) ) * CHKERR( MatCreate(comm, &self.mat) ) */ __pyx_t_1 = (__pyx_v_self->mat == NULL); if (__pyx_t_1) { /* "petsc4py/PETSc/Mat.pyx":2006 * cdef PetscObject obj = (viewer.vwr) * if self.mat == NULL: * CHKERR( PetscObjectGetComm(obj, &comm) ) # <<<<<<<<<<<<<< * CHKERR( MatCreate(comm, &self.mat) ) * CHKERR( MatLoad(self.mat, viewer.vwr) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectGetComm(__pyx_v_obj, (&__pyx_v_comm))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 2006, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":2007 * if self.mat == NULL: * CHKERR( PetscObjectGetComm(obj, &comm) ) * CHKERR( MatCreate(comm, &self.mat) ) # <<<<<<<<<<<<<< * CHKERR( MatLoad(self.mat, viewer.vwr) ) * return self */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreate(__pyx_v_comm, (&__pyx_v_self->mat))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 2007, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":2005 * cdef MPI_Comm comm = MPI_COMM_NULL * cdef PetscObject obj = (viewer.vwr) * if self.mat == NULL: # <<<<<<<<<<<<<< * CHKERR( PetscObjectGetComm(obj, &comm) ) * CHKERR( MatCreate(comm, &self.mat) ) */ } /* "petsc4py/PETSc/Mat.pyx":2008 * CHKERR( PetscObjectGetComm(obj, &comm) ) * CHKERR( MatCreate(comm, &self.mat) ) * CHKERR( MatLoad(self.mat, viewer.vwr) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatLoad(__pyx_v_self->mat, __pyx_v_viewer->vwr)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 2008, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":2009 * CHKERR( MatCreate(comm, &self.mat) ) * CHKERR( MatLoad(self.mat, viewer.vwr) ) * return self # <<<<<<<<<<<<<< * * def convert(self, mat_type: Type | str = None, Mat out=None) -> Mat: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":1993 * return result * * def load(self, Viewer viewer) -> Self: # <<<<<<<<<<<<<< * """Load a matrix. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.load", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":2011 * return self * * def convert(self, mat_type: Type | str = None, Mat out=None) -> Mat: # <<<<<<<<<<<<<< * """Convert the matrix type. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_163convert(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_162convert, "Mat.convert(self, mat_type: Type | str = None, out: Mat | None = None) -> Mat\nConvert the matrix type.\n\n Collective.\n\n Parameters\n ----------\n mat_type\n The type of the new matrix. If `None` uses `Type.SAME`.\n out\n Optional return matrix. If `None`, inplace conversion is performed.\n Otherwise, the matrix is reused.\n\n See Also\n --------\n petsc.MatConvert\n\n \nSource code at petsc4py/PETSc/Mat.pyx:2011"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_163convert(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_mat_type = 0; struct PyPetscMatObject *__pyx_v_out = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("convert (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat_type,&__pyx_n_s_out,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[1] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscMatObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mat_type); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2011, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_out); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2011, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "convert") < 0)) __PYX_ERR(46, 2011, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_mat_type = values[0]; __pyx_v_out = ((struct PyPetscMatObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("convert", 0, 0, 2, __pyx_nargs); __PYX_ERR(46, 2011, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.convert", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "out", 0))) __PYX_ERR(46, 2011, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_162convert(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_mat_type, __pyx_v_out); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_162convert(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_mat_type, struct PyPetscMatObject *__pyx_v_out) { MatType __pyx_v_mtype; MatReuse __pyx_v_reuse; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("convert", 0); __Pyx_INCREF(__pyx_v_mat_type); __Pyx_INCREF((PyObject *)__pyx_v_out); /* "petsc4py/PETSc/Mat.pyx":2029 * * """ * cdef PetscMatType mtype = MATSAME # <<<<<<<<<<<<<< * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * mat_type = str2bytes(mat_type, &mtype) */ __pyx_v_mtype = MATSAME; /* "petsc4py/PETSc/Mat.pyx":2030 * """ * cdef PetscMatType mtype = MATSAME * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX # <<<<<<<<<<<<<< * mat_type = str2bytes(mat_type, &mtype) * if mtype == NULL: mtype = MATSAME */ __pyx_v_reuse = MAT_INITIAL_MATRIX; /* "petsc4py/PETSc/Mat.pyx":2031 * cdef PetscMatType mtype = MATSAME * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * mat_type = str2bytes(mat_type, &mtype) # <<<<<<<<<<<<<< * if mtype == NULL: mtype = MATSAME * if out is None: out = self */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_mat_type, (&__pyx_v_mtype)); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 2031, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_mat_type, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Mat.pyx":2032 * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * mat_type = str2bytes(mat_type, &mtype) * if mtype == NULL: mtype = MATSAME # <<<<<<<<<<<<<< * if out is None: out = self * if out.mat == self.mat: */ __pyx_t_2 = (__pyx_v_mtype == NULL); if (__pyx_t_2) { __pyx_v_mtype = MATSAME; } /* "petsc4py/PETSc/Mat.pyx":2033 * mat_type = str2bytes(mat_type, &mtype) * if mtype == NULL: mtype = MATSAME * if out is None: out = self # <<<<<<<<<<<<<< * if out.mat == self.mat: * reuse = MAT_INPLACE_MATRIX */ __pyx_t_2 = (((PyObject *)__pyx_v_out) == Py_None); if (__pyx_t_2) { __Pyx_INCREF((PyObject *)__pyx_v_self); __Pyx_DECREF_SET(__pyx_v_out, __pyx_v_self); } /* "petsc4py/PETSc/Mat.pyx":2034 * if mtype == NULL: mtype = MATSAME * if out is None: out = self * if out.mat == self.mat: # <<<<<<<<<<<<<< * reuse = MAT_INPLACE_MATRIX * elif out.mat == NULL: */ __pyx_t_2 = (__pyx_v_out->mat == __pyx_v_self->mat); if (__pyx_t_2) { /* "petsc4py/PETSc/Mat.pyx":2035 * if out is None: out = self * if out.mat == self.mat: * reuse = MAT_INPLACE_MATRIX # <<<<<<<<<<<<<< * elif out.mat == NULL: * reuse = MAT_INITIAL_MATRIX */ __pyx_v_reuse = MAT_INPLACE_MATRIX; /* "petsc4py/PETSc/Mat.pyx":2034 * if mtype == NULL: mtype = MATSAME * if out is None: out = self * if out.mat == self.mat: # <<<<<<<<<<<<<< * reuse = MAT_INPLACE_MATRIX * elif out.mat == NULL: */ goto __pyx_L5; } /* "petsc4py/PETSc/Mat.pyx":2036 * if out.mat == self.mat: * reuse = MAT_INPLACE_MATRIX * elif out.mat == NULL: # <<<<<<<<<<<<<< * reuse = MAT_INITIAL_MATRIX * else: */ __pyx_t_2 = (__pyx_v_out->mat == NULL); if (__pyx_t_2) { /* "petsc4py/PETSc/Mat.pyx":2037 * reuse = MAT_INPLACE_MATRIX * elif out.mat == NULL: * reuse = MAT_INITIAL_MATRIX # <<<<<<<<<<<<<< * else: * reuse = MAT_REUSE_MATRIX */ __pyx_v_reuse = MAT_INITIAL_MATRIX; /* "petsc4py/PETSc/Mat.pyx":2036 * if out.mat == self.mat: * reuse = MAT_INPLACE_MATRIX * elif out.mat == NULL: # <<<<<<<<<<<<<< * reuse = MAT_INITIAL_MATRIX * else: */ goto __pyx_L5; } /* "petsc4py/PETSc/Mat.pyx":2039 * reuse = MAT_INITIAL_MATRIX * else: * reuse = MAT_REUSE_MATRIX # <<<<<<<<<<<<<< * CHKERR( MatConvert(self.mat, mtype, reuse, &out.mat) ) * return out */ /*else*/ { __pyx_v_reuse = MAT_REUSE_MATRIX; } __pyx_L5:; /* "petsc4py/PETSc/Mat.pyx":2040 * else: * reuse = MAT_REUSE_MATRIX * CHKERR( MatConvert(self.mat, mtype, reuse, &out.mat) ) # <<<<<<<<<<<<<< * return out * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatConvert(__pyx_v_self->mat, __pyx_v_mtype, __pyx_v_reuse, (&__pyx_v_out->mat))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 2040, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":2041 * reuse = MAT_REUSE_MATRIX * CHKERR( MatConvert(self.mat, mtype, reuse, &out.mat) ) * return out # <<<<<<<<<<<<<< * * def transpose(self, Mat out=None) -> Mat: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_out); __pyx_r = ((PyObject *)__pyx_v_out); goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":2011 * return self * * def convert(self, mat_type: Type | str = None, Mat out=None) -> Mat: # <<<<<<<<<<<<<< * """Convert the matrix type. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.convert", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_mat_type); __Pyx_XDECREF((PyObject *)__pyx_v_out); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":2043 * return out * * def transpose(self, Mat out=None) -> Mat: # <<<<<<<<<<<<<< * """Return the transposed matrix. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_165transpose(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_164transpose, "Mat.transpose(self, out: Mat | None = None) -> Mat\nReturn the transposed matrix.\n\n Collective.\n\n Parameters\n ----------\n out\n Optional return matrix. If `None`, inplace transposition is performed.\n Otherwise, the matrix is reused.\n\n See Also\n --------\n petsc.MatTranspose\n\n \nSource code at petsc4py/PETSc/Mat.pyx:2043"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_165transpose(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscMatObject *__pyx_v_out = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("transpose (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscMatObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_out); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2043, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "transpose") < 0)) __PYX_ERR(46, 2043, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_out = ((struct PyPetscMatObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("transpose", 0, 0, 1, __pyx_nargs); __PYX_ERR(46, 2043, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.transpose", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "out", 0))) __PYX_ERR(46, 2043, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_164transpose(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_out); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_164transpose(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_out) { MatReuse __pyx_v_reuse; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("transpose", 0); __Pyx_INCREF((PyObject *)__pyx_v_out); /* "petsc4py/PETSc/Mat.pyx":2059 * * """ * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX # <<<<<<<<<<<<<< * if out is None: out = self * if out.mat == self.mat: */ __pyx_v_reuse = MAT_INITIAL_MATRIX; /* "petsc4py/PETSc/Mat.pyx":2060 * """ * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * if out is None: out = self # <<<<<<<<<<<<<< * if out.mat == self.mat: * reuse = MAT_INPLACE_MATRIX */ __pyx_t_1 = (((PyObject *)__pyx_v_out) == Py_None); if (__pyx_t_1) { __Pyx_INCREF((PyObject *)__pyx_v_self); __Pyx_DECREF_SET(__pyx_v_out, __pyx_v_self); } /* "petsc4py/PETSc/Mat.pyx":2061 * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * if out is None: out = self * if out.mat == self.mat: # <<<<<<<<<<<<<< * reuse = MAT_INPLACE_MATRIX * elif out.mat == NULL: */ __pyx_t_1 = (__pyx_v_out->mat == __pyx_v_self->mat); if (__pyx_t_1) { /* "petsc4py/PETSc/Mat.pyx":2062 * if out is None: out = self * if out.mat == self.mat: * reuse = MAT_INPLACE_MATRIX # <<<<<<<<<<<<<< * elif out.mat == NULL: * reuse = MAT_INITIAL_MATRIX */ __pyx_v_reuse = MAT_INPLACE_MATRIX; /* "petsc4py/PETSc/Mat.pyx":2061 * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * if out is None: out = self * if out.mat == self.mat: # <<<<<<<<<<<<<< * reuse = MAT_INPLACE_MATRIX * elif out.mat == NULL: */ goto __pyx_L4; } /* "petsc4py/PETSc/Mat.pyx":2063 * if out.mat == self.mat: * reuse = MAT_INPLACE_MATRIX * elif out.mat == NULL: # <<<<<<<<<<<<<< * reuse = MAT_INITIAL_MATRIX * else: */ __pyx_t_1 = (__pyx_v_out->mat == NULL); if (__pyx_t_1) { /* "petsc4py/PETSc/Mat.pyx":2064 * reuse = MAT_INPLACE_MATRIX * elif out.mat == NULL: * reuse = MAT_INITIAL_MATRIX # <<<<<<<<<<<<<< * else: * reuse = MAT_REUSE_MATRIX */ __pyx_v_reuse = MAT_INITIAL_MATRIX; /* "petsc4py/PETSc/Mat.pyx":2063 * if out.mat == self.mat: * reuse = MAT_INPLACE_MATRIX * elif out.mat == NULL: # <<<<<<<<<<<<<< * reuse = MAT_INITIAL_MATRIX * else: */ goto __pyx_L4; } /* "petsc4py/PETSc/Mat.pyx":2066 * reuse = MAT_INITIAL_MATRIX * else: * reuse = MAT_REUSE_MATRIX # <<<<<<<<<<<<<< * CHKERR( MatTranspose(self.mat, reuse, &out.mat) ) * return out */ /*else*/ { __pyx_v_reuse = MAT_REUSE_MATRIX; } __pyx_L4:; /* "petsc4py/PETSc/Mat.pyx":2067 * else: * reuse = MAT_REUSE_MATRIX * CHKERR( MatTranspose(self.mat, reuse, &out.mat) ) # <<<<<<<<<<<<<< * return out * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatTranspose(__pyx_v_self->mat, __pyx_v_reuse, (&__pyx_v_out->mat))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 2067, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":2068 * reuse = MAT_REUSE_MATRIX * CHKERR( MatTranspose(self.mat, reuse, &out.mat) ) * return out # <<<<<<<<<<<<<< * * def setTransposePrecursor(self, Mat out) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_out); __pyx_r = ((PyObject *)__pyx_v_out); goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":2043 * return out * * def transpose(self, Mat out=None) -> Mat: # <<<<<<<<<<<<<< * """Return the transposed matrix. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.transpose", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_out); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":2070 * return out * * def setTransposePrecursor(self, Mat out) -> None: # <<<<<<<<<<<<<< * """Set transpose precursor. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_167setTransposePrecursor(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_166setTransposePrecursor, "Mat.setTransposePrecursor(self, out: Mat) -> None\nSet transpose precursor.\n\n See Also\n --------\n petsc.MatTransposeSetPrecursor\n\n \nSource code at petsc4py/PETSc/Mat.pyx:2070"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_167setTransposePrecursor(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscMatObject *__pyx_v_out = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setTransposePrecursor (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_out)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2070, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setTransposePrecursor") < 0)) __PYX_ERR(46, 2070, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_out = ((struct PyPetscMatObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setTransposePrecursor", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 2070, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.setTransposePrecursor", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "out", 0))) __PYX_ERR(46, 2070, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_166setTransposePrecursor(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_out); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_166setTransposePrecursor(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_out) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setTransposePrecursor", 1); /* "petsc4py/PETSc/Mat.pyx":2078 * * """ * CHKERR( MatTransposeSetPrecursor(self.mat, out.mat) ) # <<<<<<<<<<<<<< * * def hermitianTranspose(self, Mat out=None) -> Mat: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatTransposeSetPrecursor(__pyx_v_self->mat, __pyx_v_out->mat)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 2078, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":2070 * return out * * def setTransposePrecursor(self, Mat out) -> None: # <<<<<<<<<<<<<< * """Set transpose precursor. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setTransposePrecursor", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":2080 * CHKERR( MatTransposeSetPrecursor(self.mat, out.mat) ) * * def hermitianTranspose(self, Mat out=None) -> Mat: # <<<<<<<<<<<<<< * """Return the transposed Hermitian matrix. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_169hermitianTranspose(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_168hermitianTranspose, "Mat.hermitianTranspose(self, out: Mat | None = None) -> Mat\nReturn the transposed Hermitian matrix.\n\n Collective.\n\n Parameters\n ----------\n out\n Optional return matrix. If `None`, inplace transposition is performed.\n Otherwise, the matrix is reused.\n\n See Also\n --------\n petsc.MatHermitianTranspose\n\n \nSource code at petsc4py/PETSc/Mat.pyx:2080"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_169hermitianTranspose(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscMatObject *__pyx_v_out = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("hermitianTranspose (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscMatObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_out); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2080, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "hermitianTranspose") < 0)) __PYX_ERR(46, 2080, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_out = ((struct PyPetscMatObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("hermitianTranspose", 0, 0, 1, __pyx_nargs); __PYX_ERR(46, 2080, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.hermitianTranspose", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "out", 0))) __PYX_ERR(46, 2080, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_168hermitianTranspose(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_out); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_168hermitianTranspose(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_out) { MatReuse __pyx_v_reuse; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("hermitianTranspose", 0); __Pyx_INCREF((PyObject *)__pyx_v_out); /* "petsc4py/PETSc/Mat.pyx":2096 * * """ * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX # <<<<<<<<<<<<<< * if out is None: out = self * if out.mat == self.mat: */ __pyx_v_reuse = MAT_INITIAL_MATRIX; /* "petsc4py/PETSc/Mat.pyx":2097 * """ * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * if out is None: out = self # <<<<<<<<<<<<<< * if out.mat == self.mat: * reuse = MAT_INPLACE_MATRIX */ __pyx_t_1 = (((PyObject *)__pyx_v_out) == Py_None); if (__pyx_t_1) { __Pyx_INCREF((PyObject *)__pyx_v_self); __Pyx_DECREF_SET(__pyx_v_out, __pyx_v_self); } /* "petsc4py/PETSc/Mat.pyx":2098 * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * if out is None: out = self * if out.mat == self.mat: # <<<<<<<<<<<<<< * reuse = MAT_INPLACE_MATRIX * elif out.mat == NULL: */ __pyx_t_1 = (__pyx_v_out->mat == __pyx_v_self->mat); if (__pyx_t_1) { /* "petsc4py/PETSc/Mat.pyx":2099 * if out is None: out = self * if out.mat == self.mat: * reuse = MAT_INPLACE_MATRIX # <<<<<<<<<<<<<< * elif out.mat == NULL: * reuse = MAT_INITIAL_MATRIX */ __pyx_v_reuse = MAT_INPLACE_MATRIX; /* "petsc4py/PETSc/Mat.pyx":2098 * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * if out is None: out = self * if out.mat == self.mat: # <<<<<<<<<<<<<< * reuse = MAT_INPLACE_MATRIX * elif out.mat == NULL: */ goto __pyx_L4; } /* "petsc4py/PETSc/Mat.pyx":2100 * if out.mat == self.mat: * reuse = MAT_INPLACE_MATRIX * elif out.mat == NULL: # <<<<<<<<<<<<<< * reuse = MAT_INITIAL_MATRIX * else: */ __pyx_t_1 = (__pyx_v_out->mat == NULL); if (__pyx_t_1) { /* "petsc4py/PETSc/Mat.pyx":2101 * reuse = MAT_INPLACE_MATRIX * elif out.mat == NULL: * reuse = MAT_INITIAL_MATRIX # <<<<<<<<<<<<<< * else: * reuse = MAT_REUSE_MATRIX */ __pyx_v_reuse = MAT_INITIAL_MATRIX; /* "petsc4py/PETSc/Mat.pyx":2100 * if out.mat == self.mat: * reuse = MAT_INPLACE_MATRIX * elif out.mat == NULL: # <<<<<<<<<<<<<< * reuse = MAT_INITIAL_MATRIX * else: */ goto __pyx_L4; } /* "petsc4py/PETSc/Mat.pyx":2103 * reuse = MAT_INITIAL_MATRIX * else: * reuse = MAT_REUSE_MATRIX # <<<<<<<<<<<<<< * CHKERR( MatHermitianTranspose(self.mat, reuse, &out.mat) ) * return out */ /*else*/ { __pyx_v_reuse = MAT_REUSE_MATRIX; } __pyx_L4:; /* "petsc4py/PETSc/Mat.pyx":2104 * else: * reuse = MAT_REUSE_MATRIX * CHKERR( MatHermitianTranspose(self.mat, reuse, &out.mat) ) # <<<<<<<<<<<<<< * return out * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatHermitianTranspose(__pyx_v_self->mat, __pyx_v_reuse, (&__pyx_v_out->mat))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 2104, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":2105 * reuse = MAT_REUSE_MATRIX * CHKERR( MatHermitianTranspose(self.mat, reuse, &out.mat) ) * return out # <<<<<<<<<<<<<< * * def realPart(self, Mat out=None) -> Mat: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_out); __pyx_r = ((PyObject *)__pyx_v_out); goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":2080 * CHKERR( MatTransposeSetPrecursor(self.mat, out.mat) ) * * def hermitianTranspose(self, Mat out=None) -> Mat: # <<<<<<<<<<<<<< * """Return the transposed Hermitian matrix. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.hermitianTranspose", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_out); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":2107 * return out * * def realPart(self, Mat out=None) -> Mat: # <<<<<<<<<<<<<< * """Return the real part of the matrix. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_171realPart(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_170realPart, "Mat.realPart(self, out: Mat | None = None) -> Mat\nReturn the real part of the matrix.\n\n Collective.\n\n Parameters\n ----------\n out\n Optional return matrix. If `None`, the operation is performed in-place.\n Otherwise, the operation is performed on ``out``.\n\n See Also\n --------\n imagPart, conjugate, petsc.MatRealPart\n\n \nSource code at petsc4py/PETSc/Mat.pyx:2107"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_171realPart(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscMatObject *__pyx_v_out = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("realPart (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscMatObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_out); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2107, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "realPart") < 0)) __PYX_ERR(46, 2107, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_out = ((struct PyPetscMatObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("realPart", 0, 0, 1, __pyx_nargs); __PYX_ERR(46, 2107, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.realPart", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "out", 0))) __PYX_ERR(46, 2107, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_170realPart(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_out); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_170realPart(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_out) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("realPart", 0); __Pyx_INCREF((PyObject *)__pyx_v_out); /* "petsc4py/PETSc/Mat.pyx":2123 * * """ * if out is None: # <<<<<<<<<<<<<< * out = self * elif out.mat == NULL: */ __pyx_t_1 = (((PyObject *)__pyx_v_out) == Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/Mat.pyx":2124 * """ * if out is None: * out = self # <<<<<<<<<<<<<< * elif out.mat == NULL: * CHKERR( MatDuplicate(self.mat, MAT_COPY_VALUES, &out.mat) ) */ __Pyx_INCREF((PyObject *)__pyx_v_self); __Pyx_DECREF_SET(__pyx_v_out, __pyx_v_self); /* "petsc4py/PETSc/Mat.pyx":2123 * * """ * if out is None: # <<<<<<<<<<<<<< * out = self * elif out.mat == NULL: */ goto __pyx_L3; } /* "petsc4py/PETSc/Mat.pyx":2125 * if out is None: * out = self * elif out.mat == NULL: # <<<<<<<<<<<<<< * CHKERR( MatDuplicate(self.mat, MAT_COPY_VALUES, &out.mat) ) * CHKERR( MatRealPart(out.mat) ) */ __pyx_t_1 = (__pyx_v_out->mat == NULL); if (__pyx_t_1) { /* "petsc4py/PETSc/Mat.pyx":2126 * out = self * elif out.mat == NULL: * CHKERR( MatDuplicate(self.mat, MAT_COPY_VALUES, &out.mat) ) # <<<<<<<<<<<<<< * CHKERR( MatRealPart(out.mat) ) * return out */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDuplicate(__pyx_v_self->mat, MAT_COPY_VALUES, (&__pyx_v_out->mat))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 2126, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":2125 * if out is None: * out = self * elif out.mat == NULL: # <<<<<<<<<<<<<< * CHKERR( MatDuplicate(self.mat, MAT_COPY_VALUES, &out.mat) ) * CHKERR( MatRealPart(out.mat) ) */ } __pyx_L3:; /* "petsc4py/PETSc/Mat.pyx":2127 * elif out.mat == NULL: * CHKERR( MatDuplicate(self.mat, MAT_COPY_VALUES, &out.mat) ) * CHKERR( MatRealPart(out.mat) ) # <<<<<<<<<<<<<< * return out * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatRealPart(__pyx_v_out->mat)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 2127, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":2128 * CHKERR( MatDuplicate(self.mat, MAT_COPY_VALUES, &out.mat) ) * CHKERR( MatRealPart(out.mat) ) * return out # <<<<<<<<<<<<<< * * def imagPart(self, Mat out=None) -> Mat: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_out); __pyx_r = ((PyObject *)__pyx_v_out); goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":2107 * return out * * def realPart(self, Mat out=None) -> Mat: # <<<<<<<<<<<<<< * """Return the real part of the matrix. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.realPart", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_out); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":2130 * return out * * def imagPart(self, Mat out=None) -> Mat: # <<<<<<<<<<<<<< * """Return the imaginary part of the matrix. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_173imagPart(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_172imagPart, "Mat.imagPart(self, out: Mat | None = None) -> Mat\nReturn the imaginary part of the matrix.\n\n Collective.\n\n Parameters\n ----------\n out\n Optional return matrix. If `None`, the operation is performed in-place.\n Otherwise, the operation is performed on ``out``.\n\n See Also\n --------\n realPart, conjugate, petsc.MatImaginaryPart\n\n \nSource code at petsc4py/PETSc/Mat.pyx:2130"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_173imagPart(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscMatObject *__pyx_v_out = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("imagPart (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscMatObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_out); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2130, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "imagPart") < 0)) __PYX_ERR(46, 2130, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_out = ((struct PyPetscMatObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("imagPart", 0, 0, 1, __pyx_nargs); __PYX_ERR(46, 2130, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.imagPart", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "out", 0))) __PYX_ERR(46, 2130, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_172imagPart(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_out); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_172imagPart(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_out) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("imagPart", 0); __Pyx_INCREF((PyObject *)__pyx_v_out); /* "petsc4py/PETSc/Mat.pyx":2146 * * """ * if out is None: # <<<<<<<<<<<<<< * out = self * elif out.mat == NULL: */ __pyx_t_1 = (((PyObject *)__pyx_v_out) == Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/Mat.pyx":2147 * """ * if out is None: * out = self # <<<<<<<<<<<<<< * elif out.mat == NULL: * CHKERR( MatDuplicate(self.mat, MAT_COPY_VALUES, &out.mat) ) */ __Pyx_INCREF((PyObject *)__pyx_v_self); __Pyx_DECREF_SET(__pyx_v_out, __pyx_v_self); /* "petsc4py/PETSc/Mat.pyx":2146 * * """ * if out is None: # <<<<<<<<<<<<<< * out = self * elif out.mat == NULL: */ goto __pyx_L3; } /* "petsc4py/PETSc/Mat.pyx":2148 * if out is None: * out = self * elif out.mat == NULL: # <<<<<<<<<<<<<< * CHKERR( MatDuplicate(self.mat, MAT_COPY_VALUES, &out.mat) ) * CHKERR( MatImaginaryPart(out.mat) ) */ __pyx_t_1 = (__pyx_v_out->mat == NULL); if (__pyx_t_1) { /* "petsc4py/PETSc/Mat.pyx":2149 * out = self * elif out.mat == NULL: * CHKERR( MatDuplicate(self.mat, MAT_COPY_VALUES, &out.mat) ) # <<<<<<<<<<<<<< * CHKERR( MatImaginaryPart(out.mat) ) * return out */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDuplicate(__pyx_v_self->mat, MAT_COPY_VALUES, (&__pyx_v_out->mat))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 2149, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":2148 * if out is None: * out = self * elif out.mat == NULL: # <<<<<<<<<<<<<< * CHKERR( MatDuplicate(self.mat, MAT_COPY_VALUES, &out.mat) ) * CHKERR( MatImaginaryPart(out.mat) ) */ } __pyx_L3:; /* "petsc4py/PETSc/Mat.pyx":2150 * elif out.mat == NULL: * CHKERR( MatDuplicate(self.mat, MAT_COPY_VALUES, &out.mat) ) * CHKERR( MatImaginaryPart(out.mat) ) # <<<<<<<<<<<<<< * return out * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatImaginaryPart(__pyx_v_out->mat)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 2150, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":2151 * CHKERR( MatDuplicate(self.mat, MAT_COPY_VALUES, &out.mat) ) * CHKERR( MatImaginaryPart(out.mat) ) * return out # <<<<<<<<<<<<<< * * def conjugate(self, Mat out=None) -> Mat: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_out); __pyx_r = ((PyObject *)__pyx_v_out); goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":2130 * return out * * def imagPart(self, Mat out=None) -> Mat: # <<<<<<<<<<<<<< * """Return the imaginary part of the matrix. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.imagPart", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_out); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":2153 * return out * * def conjugate(self, Mat out=None) -> Mat: # <<<<<<<<<<<<<< * """Return the conjugate matrix. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_175conjugate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_174conjugate, "Mat.conjugate(self, out: Mat | None = None) -> Mat\nReturn the conjugate matrix.\n\n Collective.\n\n Parameters\n ----------\n out\n Optional return matrix. If `None`, the operation is performed in-place.\n Otherwise, the operation is performed on ``out``.\n\n See Also\n --------\n realPart, imagPart, petsc.MatConjugate\n\n \nSource code at petsc4py/PETSc/Mat.pyx:2153"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_175conjugate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscMatObject *__pyx_v_out = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("conjugate (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscMatObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_out); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2153, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "conjugate") < 0)) __PYX_ERR(46, 2153, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_out = ((struct PyPetscMatObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("conjugate", 0, 0, 1, __pyx_nargs); __PYX_ERR(46, 2153, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.conjugate", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "out", 0))) __PYX_ERR(46, 2153, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_174conjugate(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_out); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_174conjugate(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_out) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("conjugate", 0); __Pyx_INCREF((PyObject *)__pyx_v_out); /* "petsc4py/PETSc/Mat.pyx":2169 * * """ * if out is None: # <<<<<<<<<<<<<< * out = self * elif out.mat == NULL: */ __pyx_t_1 = (((PyObject *)__pyx_v_out) == Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/Mat.pyx":2170 * """ * if out is None: * out = self # <<<<<<<<<<<<<< * elif out.mat == NULL: * CHKERR( MatDuplicate(self.mat, MAT_COPY_VALUES, &out.mat) ) */ __Pyx_INCREF((PyObject *)__pyx_v_self); __Pyx_DECREF_SET(__pyx_v_out, __pyx_v_self); /* "petsc4py/PETSc/Mat.pyx":2169 * * """ * if out is None: # <<<<<<<<<<<<<< * out = self * elif out.mat == NULL: */ goto __pyx_L3; } /* "petsc4py/PETSc/Mat.pyx":2171 * if out is None: * out = self * elif out.mat == NULL: # <<<<<<<<<<<<<< * CHKERR( MatDuplicate(self.mat, MAT_COPY_VALUES, &out.mat) ) * CHKERR( MatConjugate(out.mat) ) */ __pyx_t_1 = (__pyx_v_out->mat == NULL); if (__pyx_t_1) { /* "petsc4py/PETSc/Mat.pyx":2172 * out = self * elif out.mat == NULL: * CHKERR( MatDuplicate(self.mat, MAT_COPY_VALUES, &out.mat) ) # <<<<<<<<<<<<<< * CHKERR( MatConjugate(out.mat) ) * return out */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDuplicate(__pyx_v_self->mat, MAT_COPY_VALUES, (&__pyx_v_out->mat))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 2172, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":2171 * if out is None: * out = self * elif out.mat == NULL: # <<<<<<<<<<<<<< * CHKERR( MatDuplicate(self.mat, MAT_COPY_VALUES, &out.mat) ) * CHKERR( MatConjugate(out.mat) ) */ } __pyx_L3:; /* "petsc4py/PETSc/Mat.pyx":2173 * elif out.mat == NULL: * CHKERR( MatDuplicate(self.mat, MAT_COPY_VALUES, &out.mat) ) * CHKERR( MatConjugate(out.mat) ) # <<<<<<<<<<<<<< * return out * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatConjugate(__pyx_v_out->mat)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 2173, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":2174 * CHKERR( MatDuplicate(self.mat, MAT_COPY_VALUES, &out.mat) ) * CHKERR( MatConjugate(out.mat) ) * return out # <<<<<<<<<<<<<< * * def permute(self, IS row, IS col) -> Mat: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_out); __pyx_r = ((PyObject *)__pyx_v_out); goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":2153 * return out * * def conjugate(self, Mat out=None) -> Mat: # <<<<<<<<<<<<<< * """Return the conjugate matrix. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.conjugate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_out); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":2176 * return out * * def permute(self, IS row, IS col) -> Mat: # <<<<<<<<<<<<<< * """Return the permuted matrix. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_177permute(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_176permute, "Mat.permute(self, row: IS, col: IS) -> Mat\nReturn the permuted matrix.\n\n Collective.\n\n Parameters\n ----------\n row\n Row permutation.\n col\n Column permutation.\n\n See Also\n --------\n petsc.MatPermute\n\n \nSource code at petsc4py/PETSc/Mat.pyx:2176"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_177permute(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscISObject *__pyx_v_row = 0; struct PyPetscISObject *__pyx_v_col = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("permute (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_row,&__pyx_n_s_col,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_row)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2176, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_col)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2176, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("permute", 1, 2, 2, 1); __PYX_ERR(46, 2176, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "permute") < 0)) __PYX_ERR(46, 2176, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_row = ((struct PyPetscISObject *)values[0]); __pyx_v_col = ((struct PyPetscISObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("permute", 1, 2, 2, __pyx_nargs); __PYX_ERR(46, 2176, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.permute", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_row), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "row", 0))) __PYX_ERR(46, 2176, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_col), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "col", 0))) __PYX_ERR(46, 2176, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_176permute(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_row, __pyx_v_col); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_176permute(struct PyPetscMatObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_row, struct PyPetscISObject *__pyx_v_col) { struct PyPetscMatObject *__pyx_v_mat = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("permute", 1); /* "petsc4py/PETSc/Mat.pyx":2193 * * """ * cdef Mat mat = Mat() # <<<<<<<<<<<<<< * CHKERR( MatPermute(self.mat, row.iset, col.iset, &mat.mat) ) * return mat */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 2193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_mat = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Mat.pyx":2194 * """ * cdef Mat mat = Mat() * CHKERR( MatPermute(self.mat, row.iset, col.iset, &mat.mat) ) # <<<<<<<<<<<<<< * return mat * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatPermute(__pyx_v_self->mat, __pyx_v_row->iset, __pyx_v_col->iset, (&__pyx_v_mat->mat))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 2194, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":2195 * cdef Mat mat = Mat() * CHKERR( MatPermute(self.mat, row.iset, col.iset, &mat.mat) ) * return mat # <<<<<<<<<<<<<< * * def equal(self, Mat mat) -> bool: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_mat); __pyx_r = ((PyObject *)__pyx_v_mat); goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":2176 * return out * * def permute(self, IS row, IS col) -> Mat: # <<<<<<<<<<<<<< * """Return the permuted matrix. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.permute", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_mat); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":2197 * return mat * * def equal(self, Mat mat) -> bool: # <<<<<<<<<<<<<< * """Return the result of matrix comparison. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_179equal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_178equal, "Mat.equal(self, mat: Mat) -> bool\nReturn the result of matrix comparison.\n\n Collective.\n\n See Also\n --------\n petsc.MatEqual\n\n \nSource code at petsc4py/PETSc/Mat.pyx:2197"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_179equal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscMatObject *__pyx_v_mat = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("equal (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mat)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2197, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "equal") < 0)) __PYX_ERR(46, 2197, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_mat = ((struct PyPetscMatObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("equal", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 2197, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.equal", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(46, 2197, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_178equal(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_mat); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_178equal(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat) { PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("equal", 1); /* "petsc4py/PETSc/Mat.pyx":2207 * * """ * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( MatEqual(self.mat, mat.mat, &flag) ) * return toBool(flag) */ __pyx_v_flag = PETSC_FALSE; /* "petsc4py/PETSc/Mat.pyx":2208 * """ * cdef PetscBool flag = PETSC_FALSE * CHKERR( MatEqual(self.mat, mat.mat, &flag) ) # <<<<<<<<<<<<<< * return toBool(flag) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatEqual(__pyx_v_self->mat, __pyx_v_mat->mat, (&__pyx_v_flag))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 2208, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":2209 * cdef PetscBool flag = PETSC_FALSE * CHKERR( MatEqual(self.mat, mat.mat, &flag) ) * return toBool(flag) # <<<<<<<<<<<<<< * * def isTranspose(self, Mat mat=None, tol: float = 0) -> bool: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 2209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":2197 * return mat * * def equal(self, Mat mat) -> bool: # <<<<<<<<<<<<<< * """Return the result of matrix comparison. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Mat.equal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":2211 * return toBool(flag) * * def isTranspose(self, Mat mat=None, tol: float = 0) -> bool: # <<<<<<<<<<<<<< * """Return the result of matrix comparison with transposition. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_181isTranspose(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_180isTranspose, "Mat.isTranspose(self, mat: Mat | None = None, tol: float = 0) -> bool\nReturn the result of matrix comparison with transposition.\n\n Collective.\n\n Parameters\n ----------\n mat\n Matrix to compare against. Uses ``self`` if `None`.\n tol\n Tolerance for comparison.\n\n See Also\n --------\n petsc.MatIsTranspose\n\n \nSource code at petsc4py/PETSc/Mat.pyx:2211"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_181isTranspose(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscMatObject *__pyx_v_mat = 0; PyObject *__pyx_v_tol = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("isTranspose (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat,&__pyx_n_s_tol,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscMatObject *)Py_None)); values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_0)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mat); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2211, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_tol); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2211, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "isTranspose") < 0)) __PYX_ERR(46, 2211, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_mat = ((struct PyPetscMatObject *)values[0]); __pyx_v_tol = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("isTranspose", 0, 0, 2, __pyx_nargs); __PYX_ERR(46, 2211, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.isTranspose", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "mat", 0))) __PYX_ERR(46, 2211, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_180isTranspose(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_mat, __pyx_v_tol); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_180isTranspose(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat, PyObject *__pyx_v_tol) { PetscReal __pyx_v_rval; PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscReal __pyx_t_2; PetscErrorCode __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("isTranspose", 0); __Pyx_INCREF((PyObject *)__pyx_v_mat); /* "petsc4py/PETSc/Mat.pyx":2228 * * """ * if mat is None: mat = self # <<<<<<<<<<<<<< * cdef PetscReal rval = asReal(tol) * cdef PetscBool flag = PETSC_FALSE */ __pyx_t_1 = (((PyObject *)__pyx_v_mat) == Py_None); if (__pyx_t_1) { __Pyx_INCREF((PyObject *)__pyx_v_self); __Pyx_DECREF_SET(__pyx_v_mat, __pyx_v_self); } /* "petsc4py/PETSc/Mat.pyx":2229 * """ * if mat is None: mat = self * cdef PetscReal rval = asReal(tol) # <<<<<<<<<<<<<< * cdef PetscBool flag = PETSC_FALSE * CHKERR( MatIsTranspose(self.mat, mat.mat, rval, &flag) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_tol); if (unlikely(__pyx_t_2 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(46, 2229, __pyx_L1_error) __pyx_v_rval = __pyx_t_2; /* "petsc4py/PETSc/Mat.pyx":2230 * if mat is None: mat = self * cdef PetscReal rval = asReal(tol) * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( MatIsTranspose(self.mat, mat.mat, rval, &flag) ) * return toBool(flag) */ __pyx_v_flag = PETSC_FALSE; /* "petsc4py/PETSc/Mat.pyx":2231 * cdef PetscReal rval = asReal(tol) * cdef PetscBool flag = PETSC_FALSE * CHKERR( MatIsTranspose(self.mat, mat.mat, rval, &flag) ) # <<<<<<<<<<<<<< * return toBool(flag) * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatIsTranspose(__pyx_v_self->mat, __pyx_v_mat->mat, __pyx_v_rval, (&__pyx_v_flag))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 2231, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":2232 * cdef PetscBool flag = PETSC_FALSE * CHKERR( MatIsTranspose(self.mat, mat.mat, rval, &flag) ) * return toBool(flag) # <<<<<<<<<<<<<< * * def isSymmetric(self, tol: float = 0) -> bool: */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 2232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":2211 * return toBool(flag) * * def isTranspose(self, Mat mat=None, tol: float = 0) -> bool: # <<<<<<<<<<<<<< * """Return the result of matrix comparison with transposition. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.Mat.isTranspose", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_mat); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":2234 * return toBool(flag) * * def isSymmetric(self, tol: float = 0) -> bool: # <<<<<<<<<<<<<< * """Return the boolean indicating if the matrix is symmetric. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_183isSymmetric(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_182isSymmetric, "Mat.isSymmetric(self, tol: float = 0) -> bool\nReturn the boolean indicating if the matrix is symmetric.\n\n Collective.\n\n Parameters\n ----------\n tol\n Tolerance for comparison.\n\n See Also\n --------\n petsc.MatIsSymmetric\n\n \nSource code at petsc4py/PETSc/Mat.pyx:2234"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_183isSymmetric(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_tol = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("isSymmetric (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tol,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_0)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_tol); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2234, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "isSymmetric") < 0)) __PYX_ERR(46, 2234, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_tol = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("isSymmetric", 0, 0, 1, __pyx_nargs); __PYX_ERR(46, 2234, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.isSymmetric", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_182isSymmetric(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_tol); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_182isSymmetric(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_tol) { PetscReal __pyx_v_rval; PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("isSymmetric", 1); /* "petsc4py/PETSc/Mat.pyx":2249 * * """ * cdef PetscReal rval = asReal(tol) # <<<<<<<<<<<<<< * cdef PetscBool flag = PETSC_FALSE * CHKERR( MatIsSymmetric(self.mat, rval, &flag) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_tol); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(46, 2249, __pyx_L1_error) __pyx_v_rval = __pyx_t_1; /* "petsc4py/PETSc/Mat.pyx":2250 * """ * cdef PetscReal rval = asReal(tol) * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( MatIsSymmetric(self.mat, rval, &flag) ) * return toBool(flag) */ __pyx_v_flag = PETSC_FALSE; /* "petsc4py/PETSc/Mat.pyx":2251 * cdef PetscReal rval = asReal(tol) * cdef PetscBool flag = PETSC_FALSE * CHKERR( MatIsSymmetric(self.mat, rval, &flag) ) # <<<<<<<<<<<<<< * return toBool(flag) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatIsSymmetric(__pyx_v_self->mat, __pyx_v_rval, (&__pyx_v_flag))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 2251, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":2252 * cdef PetscBool flag = PETSC_FALSE * CHKERR( MatIsSymmetric(self.mat, rval, &flag) ) * return toBool(flag) # <<<<<<<<<<<<<< * * def isSymmetricKnown(self) -> tuple[bool, bool]: */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 2252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":2234 * return toBool(flag) * * def isSymmetric(self, tol: float = 0) -> bool: # <<<<<<<<<<<<<< * """Return the boolean indicating if the matrix is symmetric. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.isSymmetric", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":2254 * return toBool(flag) * * def isSymmetricKnown(self) -> tuple[bool, bool]: # <<<<<<<<<<<<<< * """Return the 2-tuple indicating if the matrix is known to be symmetric. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_185isSymmetricKnown(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_184isSymmetricKnown, "Mat.isSymmetricKnown(self) -> tuple[bool, bool]\nReturn the 2-tuple indicating if the matrix is known to be symmetric.\n\n Not collective.\n\n See Also\n --------\n petsc.MatIsSymmetricKnown\n\n \nSource code at petsc4py/PETSc/Mat.pyx:2254"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_185isSymmetricKnown(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("isSymmetricKnown (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("isSymmetricKnown", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "isSymmetricKnown", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_184isSymmetricKnown(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_184isSymmetricKnown(struct PyPetscMatObject *__pyx_v_self) { PetscBool __pyx_v_flag1; PetscBool __pyx_v_flag2; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("isSymmetricKnown", 1); /* "petsc4py/PETSc/Mat.pyx":2264 * * """ * cdef PetscBool flag1 = PETSC_FALSE # <<<<<<<<<<<<<< * cdef PetscBool flag2 = PETSC_FALSE * CHKERR( MatIsSymmetricKnown(self.mat, &flag1, &flag2) ) */ __pyx_v_flag1 = PETSC_FALSE; /* "petsc4py/PETSc/Mat.pyx":2265 * """ * cdef PetscBool flag1 = PETSC_FALSE * cdef PetscBool flag2 = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( MatIsSymmetricKnown(self.mat, &flag1, &flag2) ) * return (toBool(flag1), toBool(flag2)) */ __pyx_v_flag2 = PETSC_FALSE; /* "petsc4py/PETSc/Mat.pyx":2266 * cdef PetscBool flag1 = PETSC_FALSE * cdef PetscBool flag2 = PETSC_FALSE * CHKERR( MatIsSymmetricKnown(self.mat, &flag1, &flag2) ) # <<<<<<<<<<<<<< * return (toBool(flag1), toBool(flag2)) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatIsSymmetricKnown(__pyx_v_self->mat, (&__pyx_v_flag1), (&__pyx_v_flag2))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 2266, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":2267 * cdef PetscBool flag2 = PETSC_FALSE * CHKERR( MatIsSymmetricKnown(self.mat, &flag1, &flag2) ) * return (toBool(flag1), toBool(flag2)) # <<<<<<<<<<<<<< * * def isHermitian(self, tol: float = 0) -> bool: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag1); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 2267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag2); if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 2267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 2267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(46, 2267, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(46, 2267, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":2254 * return toBool(flag) * * def isSymmetricKnown(self) -> tuple[bool, bool]: # <<<<<<<<<<<<<< * """Return the 2-tuple indicating if the matrix is known to be symmetric. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.Mat.isSymmetricKnown", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":2269 * return (toBool(flag1), toBool(flag2)) * * def isHermitian(self, tol: float = 0) -> bool: # <<<<<<<<<<<<<< * """Return the boolean indicating if the matrix is Hermitian. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_187isHermitian(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_186isHermitian, "Mat.isHermitian(self, tol: float = 0) -> bool\nReturn the boolean indicating if the matrix is Hermitian.\n\n Collective.\n\n Parameters\n ----------\n tol\n Tolerance for comparison.\n\n See Also\n --------\n petsc.MatIsHermitian\n\n \nSource code at petsc4py/PETSc/Mat.pyx:2269"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_187isHermitian(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_tol = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("isHermitian (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tol,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_0)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_tol); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2269, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "isHermitian") < 0)) __PYX_ERR(46, 2269, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_tol = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("isHermitian", 0, 0, 1, __pyx_nargs); __PYX_ERR(46, 2269, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.isHermitian", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_186isHermitian(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_tol); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_186isHermitian(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_tol) { PetscReal __pyx_v_rval; PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("isHermitian", 1); /* "petsc4py/PETSc/Mat.pyx":2284 * * """ * cdef PetscReal rval = asReal(tol) # <<<<<<<<<<<<<< * cdef PetscBool flag = PETSC_FALSE * CHKERR( MatIsHermitian(self.mat, rval, &flag) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_tol); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(46, 2284, __pyx_L1_error) __pyx_v_rval = __pyx_t_1; /* "petsc4py/PETSc/Mat.pyx":2285 * """ * cdef PetscReal rval = asReal(tol) * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( MatIsHermitian(self.mat, rval, &flag) ) * return toBool(flag) */ __pyx_v_flag = PETSC_FALSE; /* "petsc4py/PETSc/Mat.pyx":2286 * cdef PetscReal rval = asReal(tol) * cdef PetscBool flag = PETSC_FALSE * CHKERR( MatIsHermitian(self.mat, rval, &flag) ) # <<<<<<<<<<<<<< * return toBool(flag) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatIsHermitian(__pyx_v_self->mat, __pyx_v_rval, (&__pyx_v_flag))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 2286, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":2287 * cdef PetscBool flag = PETSC_FALSE * CHKERR( MatIsHermitian(self.mat, rval, &flag) ) * return toBool(flag) # <<<<<<<<<<<<<< * * def isHermitianKnown(self) -> tuple[bool, bool]: */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 2287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":2269 * return (toBool(flag1), toBool(flag2)) * * def isHermitian(self, tol: float = 0) -> bool: # <<<<<<<<<<<<<< * """Return the boolean indicating if the matrix is Hermitian. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.isHermitian", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":2289 * return toBool(flag) * * def isHermitianKnown(self) -> tuple[bool, bool]: # <<<<<<<<<<<<<< * """Return the 2-tuple indicating if the matrix is known to be Hermitian. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_189isHermitianKnown(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_188isHermitianKnown, "Mat.isHermitianKnown(self) -> tuple[bool, bool]\nReturn the 2-tuple indicating if the matrix is known to be Hermitian.\n\n Not collective.\n\n See Also\n --------\n petsc.MatIsHermitianKnown\n\n \nSource code at petsc4py/PETSc/Mat.pyx:2289"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_189isHermitianKnown(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("isHermitianKnown (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("isHermitianKnown", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "isHermitianKnown", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_188isHermitianKnown(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_188isHermitianKnown(struct PyPetscMatObject *__pyx_v_self) { PetscBool __pyx_v_flag1; PetscBool __pyx_v_flag2; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("isHermitianKnown", 1); /* "petsc4py/PETSc/Mat.pyx":2299 * * """ * cdef PetscBool flag1 = PETSC_FALSE # <<<<<<<<<<<<<< * cdef PetscBool flag2 = PETSC_FALSE * CHKERR( MatIsHermitianKnown(self.mat, &flag1, &flag2) ) */ __pyx_v_flag1 = PETSC_FALSE; /* "petsc4py/PETSc/Mat.pyx":2300 * """ * cdef PetscBool flag1 = PETSC_FALSE * cdef PetscBool flag2 = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( MatIsHermitianKnown(self.mat, &flag1, &flag2) ) * return (toBool(flag1), toBool(flag2)) */ __pyx_v_flag2 = PETSC_FALSE; /* "petsc4py/PETSc/Mat.pyx":2301 * cdef PetscBool flag1 = PETSC_FALSE * cdef PetscBool flag2 = PETSC_FALSE * CHKERR( MatIsHermitianKnown(self.mat, &flag1, &flag2) ) # <<<<<<<<<<<<<< * return (toBool(flag1), toBool(flag2)) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatIsHermitianKnown(__pyx_v_self->mat, (&__pyx_v_flag1), (&__pyx_v_flag2))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 2301, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":2302 * cdef PetscBool flag2 = PETSC_FALSE * CHKERR( MatIsHermitianKnown(self.mat, &flag1, &flag2) ) * return (toBool(flag1), toBool(flag2)) # <<<<<<<<<<<<<< * * def isStructurallySymmetric(self) -> bool: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag1); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 2302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag2); if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 2302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 2302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(46, 2302, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(46, 2302, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":2289 * return toBool(flag) * * def isHermitianKnown(self) -> tuple[bool, bool]: # <<<<<<<<<<<<<< * """Return the 2-tuple indicating if the matrix is known to be Hermitian. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.Mat.isHermitianKnown", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":2304 * return (toBool(flag1), toBool(flag2)) * * def isStructurallySymmetric(self) -> bool: # <<<<<<<<<<<<<< * """Return the boolean indicating if the matrix is structurally symmetric.""" * cdef PetscBool flag = PETSC_FALSE */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_191isStructurallySymmetric(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_190isStructurallySymmetric, "Mat.isStructurallySymmetric(self) -> bool\nReturn the boolean indicating if the matrix is structurally symmetric.\nSource code at petsc4py/PETSc/Mat.pyx:2304"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_191isStructurallySymmetric(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("isStructurallySymmetric (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("isStructurallySymmetric", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "isStructurallySymmetric", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_190isStructurallySymmetric(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_190isStructurallySymmetric(struct PyPetscMatObject *__pyx_v_self) { PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("isStructurallySymmetric", 1); /* "petsc4py/PETSc/Mat.pyx":2306 * def isStructurallySymmetric(self) -> bool: * """Return the boolean indicating if the matrix is structurally symmetric.""" * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( MatIsStructurallySymmetric(self.mat, &flag) ) * return toBool(flag) */ __pyx_v_flag = PETSC_FALSE; /* "petsc4py/PETSc/Mat.pyx":2307 * """Return the boolean indicating if the matrix is structurally symmetric.""" * cdef PetscBool flag = PETSC_FALSE * CHKERR( MatIsStructurallySymmetric(self.mat, &flag) ) # <<<<<<<<<<<<<< * return toBool(flag) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatIsStructurallySymmetric(__pyx_v_self->mat, (&__pyx_v_flag))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 2307, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":2308 * cdef PetscBool flag = PETSC_FALSE * CHKERR( MatIsStructurallySymmetric(self.mat, &flag) ) * return toBool(flag) # <<<<<<<<<<<<<< * * def zeroEntries(self) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 2308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":2304 * return (toBool(flag1), toBool(flag2)) * * def isStructurallySymmetric(self) -> bool: # <<<<<<<<<<<<<< * """Return the boolean indicating if the matrix is structurally symmetric.""" * cdef PetscBool flag = PETSC_FALSE */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Mat.isStructurallySymmetric", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":2310 * return toBool(flag) * * def zeroEntries(self) -> None: # <<<<<<<<<<<<<< * """Zero the entries of the matrix. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_193zeroEntries(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_192zeroEntries, "Mat.zeroEntries(self) -> None\nZero the entries of the matrix.\n\n Collective.\n\n See Also\n --------\n petsc.MatZeroEntries\n\n \nSource code at petsc4py/PETSc/Mat.pyx:2310"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_193zeroEntries(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("zeroEntries (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("zeroEntries", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "zeroEntries", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_192zeroEntries(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_192zeroEntries(struct PyPetscMatObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("zeroEntries", 1); /* "petsc4py/PETSc/Mat.pyx":2320 * * """ * CHKERR( MatZeroEntries(self.mat) ) # <<<<<<<<<<<<<< * * def getValue(self, row, col) -> Scalar: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatZeroEntries(__pyx_v_self->mat)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 2320, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":2310 * return toBool(flag) * * def zeroEntries(self) -> None: # <<<<<<<<<<<<<< * """Zero the entries of the matrix. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.zeroEntries", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":2322 * CHKERR( MatZeroEntries(self.mat) ) * * def getValue(self, row, col) -> Scalar: # <<<<<<<<<<<<<< * """Return the value in the (row,col) position. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_195getValue(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_194getValue, "Mat.getValue(self, row, col) -> Scalar\nReturn the value in the (row,col) position.\n\n Not collective.\n\n See Also\n --------\n petsc.MatGetValues\n\n \nSource code at petsc4py/PETSc/Mat.pyx:2322"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_195getValue(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_row = 0; PyObject *__pyx_v_col = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getValue (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_row,&__pyx_n_s_col,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_row)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2322, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_col)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2322, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("getValue", 1, 2, 2, 1); __PYX_ERR(46, 2322, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getValue") < 0)) __PYX_ERR(46, 2322, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_row = values[0]; __pyx_v_col = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getValue", 1, 2, 2, __pyx_nargs); __PYX_ERR(46, 2322, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.getValue", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_194getValue(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_row, __pyx_v_col); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_194getValue(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_row, PyObject *__pyx_v_col) { PetscInt __pyx_v_ival1; PetscInt __pyx_v_ival2; PetscScalar __pyx_v_sval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getValue", 1); /* "petsc4py/PETSc/Mat.pyx":2332 * * """ * cdef PetscInt ival1 = asInt(row) # <<<<<<<<<<<<<< * cdef PetscInt ival2 = asInt(col) * cdef PetscScalar sval = 0 */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_row); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(46, 2332, __pyx_L1_error) __pyx_v_ival1 = __pyx_t_1; /* "petsc4py/PETSc/Mat.pyx":2333 * """ * cdef PetscInt ival1 = asInt(row) * cdef PetscInt ival2 = asInt(col) # <<<<<<<<<<<<<< * cdef PetscScalar sval = 0 * CHKERR( MatGetValues(self.mat, 1, &ival1, 1, &ival2, &sval) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_col); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(46, 2333, __pyx_L1_error) __pyx_v_ival2 = __pyx_t_1; /* "petsc4py/PETSc/Mat.pyx":2334 * cdef PetscInt ival1 = asInt(row) * cdef PetscInt ival2 = asInt(col) * cdef PetscScalar sval = 0 # <<<<<<<<<<<<<< * CHKERR( MatGetValues(self.mat, 1, &ival1, 1, &ival2, &sval) ) * return toScalar(sval) */ __pyx_v_sval = 0.0; /* "petsc4py/PETSc/Mat.pyx":2335 * cdef PetscInt ival2 = asInt(col) * cdef PetscScalar sval = 0 * CHKERR( MatGetValues(self.mat, 1, &ival1, 1, &ival2, &sval) ) # <<<<<<<<<<<<<< * return toScalar(sval) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetValues(__pyx_v_self->mat, 1, (&__pyx_v_ival1), 1, (&__pyx_v_ival2), (&__pyx_v_sval))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 2335, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":2336 * cdef PetscScalar sval = 0 * CHKERR( MatGetValues(self.mat, 1, &ival1, 1, &ival2, &sval) ) * return toScalar(sval) # <<<<<<<<<<<<<< * * def getValues(self, rows: Sequence[int], cols: Sequence[int], values: ArrayScalar = None) -> ArrayScalar: */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toScalar(__pyx_v_sval); if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 2336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":2322 * CHKERR( MatZeroEntries(self.mat) ) * * def getValue(self, row, col) -> Scalar: # <<<<<<<<<<<<<< * """Return the value in the (row,col) position. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getValue", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":2338 * return toScalar(sval) * * def getValues(self, rows: Sequence[int], cols: Sequence[int], values: ArrayScalar = None) -> ArrayScalar: # <<<<<<<<<<<<<< * """Return the values in the ``zip(rows,cols)`` positions. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_197getValues(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_196getValues, "Mat.getValues(self, rows: Sequence[int], cols: Sequence[int], values: ArrayScalar = None) -> ArrayScalar\nReturn the values in the ``zip(rows,cols)`` positions.\n\n Not collective.\n\n Parameters\n ----------\n rows\n Row indices.\n cols\n Column indices.\n values\n Optional array where to store the values.\n\n See Also\n --------\n petsc.MatGetValues\n\n \nSource code at petsc4py/PETSc/Mat.pyx:2338"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_197getValues(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_rows = 0; PyObject *__pyx_v_cols = 0; PyObject *__pyx_v_values = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getValues (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rows,&__pyx_n_s_cols,&__pyx_n_s_values,0}; values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rows)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2338, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_cols)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2338, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("getValues", 0, 2, 3, 1); __PYX_ERR(46, 2338, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_values); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2338, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getValues") < 0)) __PYX_ERR(46, 2338, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_rows = values[0]; __pyx_v_cols = values[1]; __pyx_v_values = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getValues", 0, 2, 3, __pyx_nargs); __PYX_ERR(46, 2338, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.getValues", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_196getValues(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_rows, __pyx_v_cols, __pyx_v_values); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_196getValues(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_rows, PyObject *__pyx_v_cols, PyObject *__pyx_v_values) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getValues", 1); /* "petsc4py/PETSc/Mat.pyx":2357 * * """ * return matgetvalues(self.mat, rows, cols, values) # <<<<<<<<<<<<<< * * def getValuesCSR(self) -> tuple[ArrayInt, ArrayInt, ArrayScalar]: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_matgetvalues(__pyx_v_self->mat, __pyx_v_rows, __pyx_v_cols, __pyx_v_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 2357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":2338 * return toScalar(sval) * * def getValues(self, rows: Sequence[int], cols: Sequence[int], values: ArrayScalar = None) -> ArrayScalar: # <<<<<<<<<<<<<< * """Return the values in the ``zip(rows,cols)`` positions. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getValues", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":2359 * return matgetvalues(self.mat, rows, cols, values) * * def getValuesCSR(self) -> tuple[ArrayInt, ArrayInt, ArrayScalar]: # <<<<<<<<<<<<<< * """Return the CSR representation of the local part of the matrix. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_199getValuesCSR(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_198getValuesCSR, "Mat.getValuesCSR(self) -> tuple[ArrayInt, ArrayInt, ArrayScalar]\nReturn the CSR representation of the local part of the matrix.\n\n Not collective.\n\n See Also\n --------\n petsc.MatGetRow\n\n \nSource code at petsc4py/PETSc/Mat.pyx:2359"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_199getValuesCSR(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getValuesCSR (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getValuesCSR", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getValuesCSR", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_198getValuesCSR(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_198getValuesCSR(struct PyPetscMatObject *__pyx_v_self) { PetscInt __pyx_v_rstart; PetscInt __pyx_v_rend; PetscInt __pyx_v_nrows; PetscInt *__pyx_v_AI; PyArrayObject *__pyx_v_ai = 0; PetscInt __pyx_v_irow; PetscInt __pyx_v_ncols; PetscInt *__pyx_v_AJ; PyArrayObject *__pyx_v_aj = 0; PetscScalar *__pyx_v_AV; PyArrayObject *__pyx_v_av = 0; PetscInt const *__pyx_v_cols; PetscScalar const *__pyx_v_vals; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PetscInt __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getValuesCSR", 1); /* "petsc4py/PETSc/Mat.pyx":2370 * """ * # row ownership * cdef PetscInt rstart=0, rend=0, nrows=0 # <<<<<<<<<<<<<< * CHKERR( MatGetOwnershipRange(self.mat, &rstart, &rend) ) * nrows = rend - rstart */ __pyx_v_rstart = 0; __pyx_v_rend = 0; __pyx_v_nrows = 0; /* "petsc4py/PETSc/Mat.pyx":2371 * # row ownership * cdef PetscInt rstart=0, rend=0, nrows=0 * CHKERR( MatGetOwnershipRange(self.mat, &rstart, &rend) ) # <<<<<<<<<<<<<< * nrows = rend - rstart * # first pass: row pointer array */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetOwnershipRange(__pyx_v_self->mat, (&__pyx_v_rstart), (&__pyx_v_rend))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 2371, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":2372 * cdef PetscInt rstart=0, rend=0, nrows=0 * CHKERR( MatGetOwnershipRange(self.mat, &rstart, &rend) ) * nrows = rend - rstart # <<<<<<<<<<<<<< * # first pass: row pointer array * cdef PetscInt *AI = NULL */ __pyx_v_nrows = (__pyx_v_rend - __pyx_v_rstart); /* "petsc4py/PETSc/Mat.pyx":2374 * nrows = rend - rstart * # first pass: row pointer array * cdef PetscInt *AI = NULL # <<<<<<<<<<<<<< * cdef ndarray ai = oarray_i(empty_i(nrows+1), NULL, &AI) * cdef PetscInt irow=0, ncols=0 */ __pyx_v_AI = NULL; /* "petsc4py/PETSc/Mat.pyx":2375 * # first pass: row pointer array * cdef PetscInt *AI = NULL * cdef ndarray ai = oarray_i(empty_i(nrows+1), NULL, &AI) # <<<<<<<<<<<<<< * cdef PetscInt irow=0, ncols=0 * AI[0] = 0 */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_i((__pyx_v_nrows + 1))); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 2375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_i(__pyx_t_2, NULL, (&__pyx_v_AI))); if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 2375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_ai = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/Mat.pyx":2376 * cdef PetscInt *AI = NULL * cdef ndarray ai = oarray_i(empty_i(nrows+1), NULL, &AI) * cdef PetscInt irow=0, ncols=0 # <<<<<<<<<<<<<< * AI[0] = 0 * for irow from 0 <= irow < nrows: */ __pyx_v_irow = 0; __pyx_v_ncols = 0; /* "petsc4py/PETSc/Mat.pyx":2377 * cdef ndarray ai = oarray_i(empty_i(nrows+1), NULL, &AI) * cdef PetscInt irow=0, ncols=0 * AI[0] = 0 # <<<<<<<<<<<<<< * for irow from 0 <= irow < nrows: * CHKERR( MatGetRow(self.mat, irow+rstart, &ncols, NULL, NULL) ) */ (__pyx_v_AI[0]) = 0; /* "petsc4py/PETSc/Mat.pyx":2378 * cdef PetscInt irow=0, ncols=0 * AI[0] = 0 * for irow from 0 <= irow < nrows: # <<<<<<<<<<<<<< * CHKERR( MatGetRow(self.mat, irow+rstart, &ncols, NULL, NULL) ) * AI[irow+1] = AI[irow] + ncols */ __pyx_t_4 = __pyx_v_nrows; for (__pyx_v_irow = 0; __pyx_v_irow < __pyx_t_4; __pyx_v_irow++) { /* "petsc4py/PETSc/Mat.pyx":2379 * AI[0] = 0 * for irow from 0 <= irow < nrows: * CHKERR( MatGetRow(self.mat, irow+rstart, &ncols, NULL, NULL) ) # <<<<<<<<<<<<<< * AI[irow+1] = AI[irow] + ncols * CHKERR( MatRestoreRow(self.mat, irow+rstart, &ncols, NULL, NULL) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetRow(__pyx_v_self->mat, (__pyx_v_irow + __pyx_v_rstart), (&__pyx_v_ncols), NULL, NULL)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 2379, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":2380 * for irow from 0 <= irow < nrows: * CHKERR( MatGetRow(self.mat, irow+rstart, &ncols, NULL, NULL) ) * AI[irow+1] = AI[irow] + ncols # <<<<<<<<<<<<<< * CHKERR( MatRestoreRow(self.mat, irow+rstart, &ncols, NULL, NULL) ) * # second pass: column indices and values */ (__pyx_v_AI[(__pyx_v_irow + 1)]) = ((__pyx_v_AI[__pyx_v_irow]) + __pyx_v_ncols); /* "petsc4py/PETSc/Mat.pyx":2381 * CHKERR( MatGetRow(self.mat, irow+rstart, &ncols, NULL, NULL) ) * AI[irow+1] = AI[irow] + ncols * CHKERR( MatRestoreRow(self.mat, irow+rstart, &ncols, NULL, NULL) ) # <<<<<<<<<<<<<< * # second pass: column indices and values * cdef PetscInt *AJ = NULL */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatRestoreRow(__pyx_v_self->mat, (__pyx_v_irow + __pyx_v_rstart), (&__pyx_v_ncols), NULL, NULL)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 2381, __pyx_L1_error) } /* "petsc4py/PETSc/Mat.pyx":2383 * CHKERR( MatRestoreRow(self.mat, irow+rstart, &ncols, NULL, NULL) ) * # second pass: column indices and values * cdef PetscInt *AJ = NULL # <<<<<<<<<<<<<< * cdef ndarray aj = oarray_i(empty_i(AI[nrows]), NULL, &AJ) * cdef PetscScalar *AV = NULL */ __pyx_v_AJ = NULL; /* "petsc4py/PETSc/Mat.pyx":2384 * # second pass: column indices and values * cdef PetscInt *AJ = NULL * cdef ndarray aj = oarray_i(empty_i(AI[nrows]), NULL, &AJ) # <<<<<<<<<<<<<< * cdef PetscScalar *AV = NULL * cdef ndarray av = oarray_s(empty_s(AI[nrows]), NULL, &AV) */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_i((__pyx_v_AI[__pyx_v_nrows]))); if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 2384, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_i(__pyx_t_3, NULL, (&__pyx_v_AJ))); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 2384, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_aj = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/Mat.pyx":2385 * cdef PetscInt *AJ = NULL * cdef ndarray aj = oarray_i(empty_i(AI[nrows]), NULL, &AJ) * cdef PetscScalar *AV = NULL # <<<<<<<<<<<<<< * cdef ndarray av = oarray_s(empty_s(AI[nrows]), NULL, &AV) * cdef const PetscInt *cols = NULL */ __pyx_v_AV = NULL; /* "petsc4py/PETSc/Mat.pyx":2386 * cdef ndarray aj = oarray_i(empty_i(AI[nrows]), NULL, &AJ) * cdef PetscScalar *AV = NULL * cdef ndarray av = oarray_s(empty_s(AI[nrows]), NULL, &AV) # <<<<<<<<<<<<<< * cdef const PetscInt *cols = NULL * cdef const PetscScalar *vals = NULL */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_s((__pyx_v_AI[__pyx_v_nrows]))); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 2386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_s(__pyx_t_2, NULL, (&__pyx_v_AV))); if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 2386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_av = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/Mat.pyx":2387 * cdef PetscScalar *AV = NULL * cdef ndarray av = oarray_s(empty_s(AI[nrows]), NULL, &AV) * cdef const PetscInt *cols = NULL # <<<<<<<<<<<<<< * cdef const PetscScalar *vals = NULL * for irow from 0 <= irow < nrows: */ __pyx_v_cols = NULL; /* "petsc4py/PETSc/Mat.pyx":2388 * cdef ndarray av = oarray_s(empty_s(AI[nrows]), NULL, &AV) * cdef const PetscInt *cols = NULL * cdef const PetscScalar *vals = NULL # <<<<<<<<<<<<<< * for irow from 0 <= irow < nrows: * CHKERR( MatGetRow(self.mat, irow+rstart, &ncols, &cols, &vals) ) */ __pyx_v_vals = NULL; /* "petsc4py/PETSc/Mat.pyx":2389 * cdef const PetscInt *cols = NULL * cdef const PetscScalar *vals = NULL * for irow from 0 <= irow < nrows: # <<<<<<<<<<<<<< * CHKERR( MatGetRow(self.mat, irow+rstart, &ncols, &cols, &vals) ) * CHKERR( PetscMemcpy(AJ+AI[irow], cols, ncols*sizeof(PetscInt)) ) */ __pyx_t_4 = __pyx_v_nrows; for (__pyx_v_irow = 0; __pyx_v_irow < __pyx_t_4; __pyx_v_irow++) { /* "petsc4py/PETSc/Mat.pyx":2390 * cdef const PetscScalar *vals = NULL * for irow from 0 <= irow < nrows: * CHKERR( MatGetRow(self.mat, irow+rstart, &ncols, &cols, &vals) ) # <<<<<<<<<<<<<< * CHKERR( PetscMemcpy(AJ+AI[irow], cols, ncols*sizeof(PetscInt)) ) * CHKERR( PetscMemcpy(AV+AI[irow], vals, ncols*sizeof(PetscScalar)) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetRow(__pyx_v_self->mat, (__pyx_v_irow + __pyx_v_rstart), (&__pyx_v_ncols), (&__pyx_v_cols), (&__pyx_v_vals))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 2390, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":2391 * for irow from 0 <= irow < nrows: * CHKERR( MatGetRow(self.mat, irow+rstart, &ncols, &cols, &vals) ) * CHKERR( PetscMemcpy(AJ+AI[irow], cols, ncols*sizeof(PetscInt)) ) # <<<<<<<<<<<<<< * CHKERR( PetscMemcpy(AV+AI[irow], vals, ncols*sizeof(PetscScalar)) ) * CHKERR( MatRestoreRow(self.mat, irow+rstart, &ncols, &cols, &vals) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMemcpy((__pyx_v_AJ + (__pyx_v_AI[__pyx_v_irow])), __pyx_v_cols, (((size_t)__pyx_v_ncols) * (sizeof(PetscInt))))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 2391, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":2392 * CHKERR( MatGetRow(self.mat, irow+rstart, &ncols, &cols, &vals) ) * CHKERR( PetscMemcpy(AJ+AI[irow], cols, ncols*sizeof(PetscInt)) ) * CHKERR( PetscMemcpy(AV+AI[irow], vals, ncols*sizeof(PetscScalar)) ) # <<<<<<<<<<<<<< * CHKERR( MatRestoreRow(self.mat, irow+rstart, &ncols, &cols, &vals) ) * # */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMemcpy((__pyx_v_AV + (__pyx_v_AI[__pyx_v_irow])), __pyx_v_vals, (((size_t)__pyx_v_ncols) * (sizeof(PetscScalar))))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 2392, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":2393 * CHKERR( PetscMemcpy(AJ+AI[irow], cols, ncols*sizeof(PetscInt)) ) * CHKERR( PetscMemcpy(AV+AI[irow], vals, ncols*sizeof(PetscScalar)) ) * CHKERR( MatRestoreRow(self.mat, irow+rstart, &ncols, &cols, &vals) ) # <<<<<<<<<<<<<< * # * return (ai, aj, av) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatRestoreRow(__pyx_v_self->mat, (__pyx_v_irow + __pyx_v_rstart), (&__pyx_v_ncols), (&__pyx_v_cols), (&__pyx_v_vals))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 2393, __pyx_L1_error) } /* "petsc4py/PETSc/Mat.pyx":2395 * CHKERR( MatRestoreRow(self.mat, irow+rstart, &ncols, &cols, &vals) ) * # * return (ai, aj, av) # <<<<<<<<<<<<<< * * def getRow(self, row: int) -> tuple[ArrayInt, ArrayScalar]: */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 2395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF((PyObject *)__pyx_v_ai); __Pyx_GIVEREF((PyObject *)__pyx_v_ai); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_ai))) __PYX_ERR(46, 2395, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_aj); __Pyx_GIVEREF((PyObject *)__pyx_v_aj); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_aj))) __PYX_ERR(46, 2395, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_av); __Pyx_GIVEREF((PyObject *)__pyx_v_av); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_v_av))) __PYX_ERR(46, 2395, __pyx_L1_error); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":2359 * return matgetvalues(self.mat, rows, cols, values) * * def getValuesCSR(self) -> tuple[ArrayInt, ArrayInt, ArrayScalar]: # <<<<<<<<<<<<<< * """Return the CSR representation of the local part of the matrix. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getValuesCSR", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ai); __Pyx_XDECREF((PyObject *)__pyx_v_aj); __Pyx_XDECREF((PyObject *)__pyx_v_av); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":2397 * return (ai, aj, av) * * def getRow(self, row: int) -> tuple[ArrayInt, ArrayScalar]: # <<<<<<<<<<<<<< * """Return the column indices and values for the requested row. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_201getRow(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_200getRow, "Mat.getRow(self, row: int) -> tuple[ArrayInt, ArrayScalar]\nReturn the column indices and values for the requested row.\n\n Not collective.\n\n See Also\n --------\n petsc.MatGetRow\n\n \nSource code at petsc4py/PETSc/Mat.pyx:2397"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_201getRow(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_row = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getRow (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_row,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_row)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2397, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getRow") < 0)) __PYX_ERR(46, 2397, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_row = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getRow", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 2397, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.getRow", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_200getRow(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_row); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_200getRow(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_row) { PetscInt __pyx_v_irow; PetscInt __pyx_v_ncols; PetscInt const *__pyx_v_icols; PetscScalar const *__pyx_v_svals; PyObject *__pyx_v_cols = 0; PyObject *__pyx_v_vals = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getRow", 1); /* "petsc4py/PETSc/Mat.pyx":2407 * * """ * cdef PetscInt irow = asInt(row) # <<<<<<<<<<<<<< * cdef PetscInt ncols = 0 * cdef const PetscInt *icols=NULL */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_row); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(46, 2407, __pyx_L1_error) __pyx_v_irow = __pyx_t_1; /* "petsc4py/PETSc/Mat.pyx":2408 * """ * cdef PetscInt irow = asInt(row) * cdef PetscInt ncols = 0 # <<<<<<<<<<<<<< * cdef const PetscInt *icols=NULL * cdef const PetscScalar *svals=NULL */ __pyx_v_ncols = 0; /* "petsc4py/PETSc/Mat.pyx":2409 * cdef PetscInt irow = asInt(row) * cdef PetscInt ncols = 0 * cdef const PetscInt *icols=NULL # <<<<<<<<<<<<<< * cdef const PetscScalar *svals=NULL * CHKERR( MatGetRow(self.mat, irow, &ncols, &icols, &svals) ) */ __pyx_v_icols = NULL; /* "petsc4py/PETSc/Mat.pyx":2410 * cdef PetscInt ncols = 0 * cdef const PetscInt *icols=NULL * cdef const PetscScalar *svals=NULL # <<<<<<<<<<<<<< * CHKERR( MatGetRow(self.mat, irow, &ncols, &icols, &svals) ) * cdef object cols = array_i(ncols, icols) */ __pyx_v_svals = NULL; /* "petsc4py/PETSc/Mat.pyx":2411 * cdef const PetscInt *icols=NULL * cdef const PetscScalar *svals=NULL * CHKERR( MatGetRow(self.mat, irow, &ncols, &icols, &svals) ) # <<<<<<<<<<<<<< * cdef object cols = array_i(ncols, icols) * cdef object vals = array_s(ncols, svals) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetRow(__pyx_v_self->mat, __pyx_v_irow, (&__pyx_v_ncols), (&__pyx_v_icols), (&__pyx_v_svals))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 2411, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":2412 * cdef const PetscScalar *svals=NULL * CHKERR( MatGetRow(self.mat, irow, &ncols, &icols, &svals) ) * cdef object cols = array_i(ncols, icols) # <<<<<<<<<<<<<< * cdef object vals = array_s(ncols, svals) * CHKERR( MatRestoreRow(self.mat, irow, &ncols, &icols, &svals) ) */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i(__pyx_v_ncols, __pyx_v_icols)); if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 2412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_cols = __pyx_t_3; __pyx_t_3 = 0; /* "petsc4py/PETSc/Mat.pyx":2413 * CHKERR( MatGetRow(self.mat, irow, &ncols, &icols, &svals) ) * cdef object cols = array_i(ncols, icols) * cdef object vals = array_s(ncols, svals) # <<<<<<<<<<<<<< * CHKERR( MatRestoreRow(self.mat, irow, &ncols, &icols, &svals) ) * return (cols, vals) */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_s(__pyx_v_ncols, __pyx_v_svals)); if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 2413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_vals = __pyx_t_3; __pyx_t_3 = 0; /* "petsc4py/PETSc/Mat.pyx":2414 * cdef object cols = array_i(ncols, icols) * cdef object vals = array_s(ncols, svals) * CHKERR( MatRestoreRow(self.mat, irow, &ncols, &icols, &svals) ) # <<<<<<<<<<<<<< * return (cols, vals) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatRestoreRow(__pyx_v_self->mat, __pyx_v_irow, (&__pyx_v_ncols), (&__pyx_v_icols), (&__pyx_v_svals))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 2414, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":2415 * cdef object vals = array_s(ncols, svals) * CHKERR( MatRestoreRow(self.mat, irow, &ncols, &icols, &svals) ) * return (cols, vals) # <<<<<<<<<<<<<< * * def getRowIJ(self, symmetric: bool = False, compressed: bool = False) -> tuple[ArrayInt, ArrayInt]: */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 2415, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_cols); __Pyx_GIVEREF(__pyx_v_cols); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_cols)) __PYX_ERR(46, 2415, __pyx_L1_error); __Pyx_INCREF(__pyx_v_vals); __Pyx_GIVEREF(__pyx_v_vals); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_vals)) __PYX_ERR(46, 2415, __pyx_L1_error); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":2397 * return (ai, aj, av) * * def getRow(self, row: int) -> tuple[ArrayInt, ArrayScalar]: # <<<<<<<<<<<<<< * """Return the column indices and values for the requested row. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getRow", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_cols); __Pyx_XDECREF(__pyx_v_vals); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":2417 * return (cols, vals) * * def getRowIJ(self, symmetric: bool = False, compressed: bool = False) -> tuple[ArrayInt, ArrayInt]: # <<<<<<<<<<<<<< * """Return the CSR representation of the local sparsity pattern. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_203getRowIJ(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_202getRowIJ, "Mat.getRowIJ(self, symmetric: bool = False, compressed: bool = False) -> tuple[ArrayInt, ArrayInt]\nReturn the CSR representation of the local sparsity pattern.\n\n Collective.\n\n Parameters\n ----------\n symmetric\n If `True`, return the symmetrized graph.\n compressed\n If `True`, return the compressed graph.\n\n See Also\n --------\n petsc.MatGetRowIJ\n\n \nSource code at petsc4py/PETSc/Mat.pyx:2417"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_203getRowIJ(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_symmetric = 0; PyObject *__pyx_v_compressed = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getRowIJ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_symmetric,&__pyx_n_s_compressed,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False)); values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_symmetric); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2417, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_compressed); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2417, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getRowIJ") < 0)) __PYX_ERR(46, 2417, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_symmetric = values[0]; __pyx_v_compressed = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getRowIJ", 0, 0, 2, __pyx_nargs); __PYX_ERR(46, 2417, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.getRowIJ", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_202getRowIJ(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_symmetric, __pyx_v_compressed); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_202getRowIJ(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_symmetric, PyObject *__pyx_v_compressed) { PetscInt __pyx_v_shift; PetscBool __pyx_v_symm; PetscBool __pyx_v_bcmp; PetscInt __pyx_v_n; PetscInt const *__pyx_v_ia; PetscInt const *__pyx_v_ja; PetscBool __pyx_v_done; PyObject *__pyx_v_ai = 0; PyObject *__pyx_v_aj = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getRowIJ", 1); /* "petsc4py/PETSc/Mat.pyx":2434 * * """ * cdef PetscInt shift=0 # <<<<<<<<<<<<<< * cdef PetscBool symm=symmetric * cdef PetscBool bcmp=compressed */ __pyx_v_shift = 0; /* "petsc4py/PETSc/Mat.pyx":2435 * """ * cdef PetscInt shift=0 * cdef PetscBool symm=symmetric # <<<<<<<<<<<<<< * cdef PetscBool bcmp=compressed * cdef PetscInt n=0 */ __pyx_t_1 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_symmetric)); if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2435, __pyx_L1_error) __pyx_v_symm = __pyx_t_1; /* "petsc4py/PETSc/Mat.pyx":2436 * cdef PetscInt shift=0 * cdef PetscBool symm=symmetric * cdef PetscBool bcmp=compressed # <<<<<<<<<<<<<< * cdef PetscInt n=0 * cdef const PetscInt *ia=NULL */ __pyx_t_1 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_compressed)); if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2436, __pyx_L1_error) __pyx_v_bcmp = __pyx_t_1; /* "petsc4py/PETSc/Mat.pyx":2437 * cdef PetscBool symm=symmetric * cdef PetscBool bcmp=compressed * cdef PetscInt n=0 # <<<<<<<<<<<<<< * cdef const PetscInt *ia=NULL * cdef const PetscInt *ja=NULL */ __pyx_v_n = 0; /* "petsc4py/PETSc/Mat.pyx":2438 * cdef PetscBool bcmp=compressed * cdef PetscInt n=0 * cdef const PetscInt *ia=NULL # <<<<<<<<<<<<<< * cdef const PetscInt *ja=NULL * cdef PetscBool done=PETSC_FALSE */ __pyx_v_ia = NULL; /* "petsc4py/PETSc/Mat.pyx":2439 * cdef PetscInt n=0 * cdef const PetscInt *ia=NULL * cdef const PetscInt *ja=NULL # <<<<<<<<<<<<<< * cdef PetscBool done=PETSC_FALSE * CHKERR( MatGetRowIJ(self.mat, shift, symm, bcmp, &n, &ia, &ja, &done) ) */ __pyx_v_ja = NULL; /* "petsc4py/PETSc/Mat.pyx":2440 * cdef const PetscInt *ia=NULL * cdef const PetscInt *ja=NULL * cdef PetscBool done=PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( MatGetRowIJ(self.mat, shift, symm, bcmp, &n, &ia, &ja, &done) ) * cdef object ai=None, aj=None */ __pyx_v_done = PETSC_FALSE; /* "petsc4py/PETSc/Mat.pyx":2441 * cdef const PetscInt *ja=NULL * cdef PetscBool done=PETSC_FALSE * CHKERR( MatGetRowIJ(self.mat, shift, symm, bcmp, &n, &ia, &ja, &done) ) # <<<<<<<<<<<<<< * cdef object ai=None, aj=None * if done != PETSC_FALSE: ai = array_i( n+1, ia) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetRowIJ(__pyx_v_self->mat, __pyx_v_shift, __pyx_v_symm, __pyx_v_bcmp, (&__pyx_v_n), (&__pyx_v_ia), (&__pyx_v_ja), (&__pyx_v_done))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 2441, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":2442 * cdef PetscBool done=PETSC_FALSE * CHKERR( MatGetRowIJ(self.mat, shift, symm, bcmp, &n, &ia, &ja, &done) ) * cdef object ai=None, aj=None # <<<<<<<<<<<<<< * if done != PETSC_FALSE: ai = array_i( n+1, ia) * if done != PETSC_FALSE: aj = array_i(ia[n], ja) */ __Pyx_INCREF(Py_None); __pyx_v_ai = Py_None; __Pyx_INCREF(Py_None); __pyx_v_aj = Py_None; /* "petsc4py/PETSc/Mat.pyx":2443 * CHKERR( MatGetRowIJ(self.mat, shift, symm, bcmp, &n, &ia, &ja, &done) ) * cdef object ai=None, aj=None * if done != PETSC_FALSE: ai = array_i( n+1, ia) # <<<<<<<<<<<<<< * if done != PETSC_FALSE: aj = array_i(ia[n], ja) * CHKERR( MatRestoreRowIJ(self.mat, shift, symm, bcmp, &n, &ia, &ja, &done) ) */ __pyx_t_3 = (__pyx_v_done != PETSC_FALSE); if (__pyx_t_3) { __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i((__pyx_v_n + 1), __pyx_v_ia)); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 2443, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_ai, __pyx_t_4); __pyx_t_4 = 0; } /* "petsc4py/PETSc/Mat.pyx":2444 * cdef object ai=None, aj=None * if done != PETSC_FALSE: ai = array_i( n+1, ia) * if done != PETSC_FALSE: aj = array_i(ia[n], ja) # <<<<<<<<<<<<<< * CHKERR( MatRestoreRowIJ(self.mat, shift, symm, bcmp, &n, &ia, &ja, &done) ) * return (ai, aj) */ __pyx_t_3 = (__pyx_v_done != PETSC_FALSE); if (__pyx_t_3) { __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i((__pyx_v_ia[__pyx_v_n]), __pyx_v_ja)); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 2444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_aj, __pyx_t_4); __pyx_t_4 = 0; } /* "petsc4py/PETSc/Mat.pyx":2445 * if done != PETSC_FALSE: ai = array_i( n+1, ia) * if done != PETSC_FALSE: aj = array_i(ia[n], ja) * CHKERR( MatRestoreRowIJ(self.mat, shift, symm, bcmp, &n, &ia, &ja, &done) ) # <<<<<<<<<<<<<< * return (ai, aj) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatRestoreRowIJ(__pyx_v_self->mat, __pyx_v_shift, __pyx_v_symm, __pyx_v_bcmp, (&__pyx_v_n), (&__pyx_v_ia), (&__pyx_v_ja), (&__pyx_v_done))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 2445, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":2446 * if done != PETSC_FALSE: aj = array_i(ia[n], ja) * CHKERR( MatRestoreRowIJ(self.mat, shift, symm, bcmp, &n, &ia, &ja, &done) ) * return (ai, aj) # <<<<<<<<<<<<<< * * def getColumnIJ(self, symmetric: bool = False, compressed: bool = False) -> tuple[ArrayInt, ArrayInt]: */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 2446, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_ai); __Pyx_GIVEREF(__pyx_v_ai); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_ai)) __PYX_ERR(46, 2446, __pyx_L1_error); __Pyx_INCREF(__pyx_v_aj); __Pyx_GIVEREF(__pyx_v_aj); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_aj)) __PYX_ERR(46, 2446, __pyx_L1_error); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":2417 * return (cols, vals) * * def getRowIJ(self, symmetric: bool = False, compressed: bool = False) -> tuple[ArrayInt, ArrayInt]: # <<<<<<<<<<<<<< * """Return the CSR representation of the local sparsity pattern. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getRowIJ", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ai); __Pyx_XDECREF(__pyx_v_aj); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":2448 * return (ai, aj) * * def getColumnIJ(self, symmetric: bool = False, compressed: bool = False) -> tuple[ArrayInt, ArrayInt]: # <<<<<<<<<<<<<< * """Return the CSC representation of the local sparsity pattern. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_205getColumnIJ(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_204getColumnIJ, "Mat.getColumnIJ(self, symmetric: bool = False, compressed: bool = False) -> tuple[ArrayInt, ArrayInt]\nReturn the CSC representation of the local sparsity pattern.\n\n Collective.\n\n Parameters\n ----------\n symmetric\n If `True`, return the symmetrized graph.\n compressed\n If `True`, return the compressed graph.\n\n See Also\n --------\n petsc.MatGetRowIJ\n\n \nSource code at petsc4py/PETSc/Mat.pyx:2448"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_205getColumnIJ(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_symmetric = 0; PyObject *__pyx_v_compressed = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getColumnIJ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_symmetric,&__pyx_n_s_compressed,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False)); values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_symmetric); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2448, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_compressed); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2448, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getColumnIJ") < 0)) __PYX_ERR(46, 2448, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_symmetric = values[0]; __pyx_v_compressed = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getColumnIJ", 0, 0, 2, __pyx_nargs); __PYX_ERR(46, 2448, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.getColumnIJ", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_204getColumnIJ(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_symmetric, __pyx_v_compressed); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_204getColumnIJ(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_symmetric, PyObject *__pyx_v_compressed) { PetscInt __pyx_v_shift; PetscBool __pyx_v_symm; PetscBool __pyx_v_bcmp; PetscInt __pyx_v_n; PetscInt const *__pyx_v_ia; PetscInt const *__pyx_v_ja; PetscBool __pyx_v_done; PyObject *__pyx_v_ai = 0; PyObject *__pyx_v_aj = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getColumnIJ", 1); /* "petsc4py/PETSc/Mat.pyx":2465 * * """ * cdef PetscInt shift=0 # <<<<<<<<<<<<<< * cdef PetscBool symm=symmetric, bcmp=compressed * cdef PetscInt n=0 */ __pyx_v_shift = 0; /* "petsc4py/PETSc/Mat.pyx":2466 * """ * cdef PetscInt shift=0 * cdef PetscBool symm=symmetric, bcmp=compressed # <<<<<<<<<<<<<< * cdef PetscInt n=0 * cdef const PetscInt *ia=NULL */ __pyx_t_1 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_symmetric)); if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2466, __pyx_L1_error) __pyx_v_symm = __pyx_t_1; __pyx_t_1 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_compressed)); if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2466, __pyx_L1_error) __pyx_v_bcmp = __pyx_t_1; /* "petsc4py/PETSc/Mat.pyx":2467 * cdef PetscInt shift=0 * cdef PetscBool symm=symmetric, bcmp=compressed * cdef PetscInt n=0 # <<<<<<<<<<<<<< * cdef const PetscInt *ia=NULL * cdef const PetscInt *ja=NULL */ __pyx_v_n = 0; /* "petsc4py/PETSc/Mat.pyx":2468 * cdef PetscBool symm=symmetric, bcmp=compressed * cdef PetscInt n=0 * cdef const PetscInt *ia=NULL # <<<<<<<<<<<<<< * cdef const PetscInt *ja=NULL * cdef PetscBool done=PETSC_FALSE */ __pyx_v_ia = NULL; /* "petsc4py/PETSc/Mat.pyx":2469 * cdef PetscInt n=0 * cdef const PetscInt *ia=NULL * cdef const PetscInt *ja=NULL # <<<<<<<<<<<<<< * cdef PetscBool done=PETSC_FALSE * CHKERR( MatGetColumnIJ(self.mat, shift, symm, bcmp, &n, &ia, &ja, &done) ) */ __pyx_v_ja = NULL; /* "petsc4py/PETSc/Mat.pyx":2470 * cdef const PetscInt *ia=NULL * cdef const PetscInt *ja=NULL * cdef PetscBool done=PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( MatGetColumnIJ(self.mat, shift, symm, bcmp, &n, &ia, &ja, &done) ) * cdef object ai=None, aj=None */ __pyx_v_done = PETSC_FALSE; /* "petsc4py/PETSc/Mat.pyx":2471 * cdef const PetscInt *ja=NULL * cdef PetscBool done=PETSC_FALSE * CHKERR( MatGetColumnIJ(self.mat, shift, symm, bcmp, &n, &ia, &ja, &done) ) # <<<<<<<<<<<<<< * cdef object ai=None, aj=None * if done != PETSC_FALSE: ai = array_i( n+1, ia) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetColumnIJ(__pyx_v_self->mat, __pyx_v_shift, __pyx_v_symm, __pyx_v_bcmp, (&__pyx_v_n), (&__pyx_v_ia), (&__pyx_v_ja), (&__pyx_v_done))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 2471, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":2472 * cdef PetscBool done=PETSC_FALSE * CHKERR( MatGetColumnIJ(self.mat, shift, symm, bcmp, &n, &ia, &ja, &done) ) * cdef object ai=None, aj=None # <<<<<<<<<<<<<< * if done != PETSC_FALSE: ai = array_i( n+1, ia) * if done != PETSC_FALSE: aj = array_i(ia[n], ja) */ __Pyx_INCREF(Py_None); __pyx_v_ai = Py_None; __Pyx_INCREF(Py_None); __pyx_v_aj = Py_None; /* "petsc4py/PETSc/Mat.pyx":2473 * CHKERR( MatGetColumnIJ(self.mat, shift, symm, bcmp, &n, &ia, &ja, &done) ) * cdef object ai=None, aj=None * if done != PETSC_FALSE: ai = array_i( n+1, ia) # <<<<<<<<<<<<<< * if done != PETSC_FALSE: aj = array_i(ia[n], ja) * CHKERR( MatRestoreColumnIJ(self.mat, shift, symm, bcmp, &n, &ia, &ja, &done) ) */ __pyx_t_3 = (__pyx_v_done != PETSC_FALSE); if (__pyx_t_3) { __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i((__pyx_v_n + 1), __pyx_v_ia)); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 2473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_ai, __pyx_t_4); __pyx_t_4 = 0; } /* "petsc4py/PETSc/Mat.pyx":2474 * cdef object ai=None, aj=None * if done != PETSC_FALSE: ai = array_i( n+1, ia) * if done != PETSC_FALSE: aj = array_i(ia[n], ja) # <<<<<<<<<<<<<< * CHKERR( MatRestoreColumnIJ(self.mat, shift, symm, bcmp, &n, &ia, &ja, &done) ) * return (ai, aj) */ __pyx_t_3 = (__pyx_v_done != PETSC_FALSE); if (__pyx_t_3) { __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i((__pyx_v_ia[__pyx_v_n]), __pyx_v_ja)); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 2474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_aj, __pyx_t_4); __pyx_t_4 = 0; } /* "petsc4py/PETSc/Mat.pyx":2475 * if done != PETSC_FALSE: ai = array_i( n+1, ia) * if done != PETSC_FALSE: aj = array_i(ia[n], ja) * CHKERR( MatRestoreColumnIJ(self.mat, shift, symm, bcmp, &n, &ia, &ja, &done) ) # <<<<<<<<<<<<<< * return (ai, aj) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatRestoreColumnIJ(__pyx_v_self->mat, __pyx_v_shift, __pyx_v_symm, __pyx_v_bcmp, (&__pyx_v_n), (&__pyx_v_ia), (&__pyx_v_ja), (&__pyx_v_done))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 2475, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":2476 * if done != PETSC_FALSE: aj = array_i(ia[n], ja) * CHKERR( MatRestoreColumnIJ(self.mat, shift, symm, bcmp, &n, &ia, &ja, &done) ) * return (ai, aj) # <<<<<<<<<<<<<< * * def setValue( */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 2476, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_ai); __Pyx_GIVEREF(__pyx_v_ai); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_ai)) __PYX_ERR(46, 2476, __pyx_L1_error); __Pyx_INCREF(__pyx_v_aj); __Pyx_GIVEREF(__pyx_v_aj); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_aj)) __PYX_ERR(46, 2476, __pyx_L1_error); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":2448 * return (ai, aj) * * def getColumnIJ(self, symmetric: bool = False, compressed: bool = False) -> tuple[ArrayInt, ArrayInt]: # <<<<<<<<<<<<<< * """Return the CSC representation of the local sparsity pattern. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getColumnIJ", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ai); __Pyx_XDECREF(__pyx_v_aj); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":2478 * return (ai, aj) * * def setValue( # <<<<<<<<<<<<<< * self, * row: int, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_207setValue(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_206setValue, "Mat.setValue(self, row: int, col: int, value: Scalar, addv: InsertModeSpec = None) -> None\nSet a value to the ``(row, col)`` entry of the matrix.\n\n Not collective.\n\n Parameters\n ----------\n row\n Row index.\n col\n Column index.\n value\n The scalar value.\n addv\n Insertion mode.\n\n See Also\n --------\n petsc.MatSetValues\n\n \nSource code at petsc4py/PETSc/Mat.pyx:2478"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_207setValue(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_row = 0; PyObject *__pyx_v_col = 0; PyObject *__pyx_v_value = 0; PyObject *__pyx_v_addv = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setValue (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_row,&__pyx_n_s_col,&__pyx_n_s_value,&__pyx_n_s_addv,0}; /* "petsc4py/PETSc/Mat.pyx":2483 * col: int, * value: Scalar, * addv: InsertModeSpec = None, # <<<<<<<<<<<<<< * ) -> None: * """Set a value to the ``(row, col)`` entry of the matrix. */ values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_row)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2478, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_col)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2478, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setValue", 0, 3, 4, 1); __PYX_ERR(46, 2478, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2478, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setValue", 0, 3, 4, 2); __PYX_ERR(46, 2478, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_addv); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2478, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setValue") < 0)) __PYX_ERR(46, 2478, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_row = values[0]; __pyx_v_col = values[1]; __pyx_v_value = values[2]; __pyx_v_addv = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setValue", 0, 3, 4, __pyx_nargs); __PYX_ERR(46, 2478, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValue", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_206setValue(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_row, __pyx_v_col, __pyx_v_value, __pyx_v_addv); /* "petsc4py/PETSc/Mat.pyx":2478 * return (ai, aj) * * def setValue( # <<<<<<<<<<<<<< * self, * row: int, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_206setValue(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_row, PyObject *__pyx_v_col, PyObject *__pyx_v_value, PyObject *__pyx_v_addv) { PetscInt __pyx_v_ival1; PetscInt __pyx_v_ival2; PetscScalar __pyx_v_sval; InsertMode __pyx_v_caddv; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscScalar __pyx_t_2; InsertMode __pyx_t_3; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setValue", 1); /* "petsc4py/PETSc/Mat.pyx":2505 * * """ * cdef PetscInt ival1 = asInt(row) # <<<<<<<<<<<<<< * cdef PetscInt ival2 = asInt(col) * cdef PetscScalar sval = asScalar(value) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_row); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(46, 2505, __pyx_L1_error) __pyx_v_ival1 = __pyx_t_1; /* "petsc4py/PETSc/Mat.pyx":2506 * """ * cdef PetscInt ival1 = asInt(row) * cdef PetscInt ival2 = asInt(col) # <<<<<<<<<<<<<< * cdef PetscScalar sval = asScalar(value) * cdef PetscInsertMode caddv = insertmode(addv) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_col); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(46, 2506, __pyx_L1_error) __pyx_v_ival2 = __pyx_t_1; /* "petsc4py/PETSc/Mat.pyx":2507 * cdef PetscInt ival1 = asInt(row) * cdef PetscInt ival2 = asInt(col) * cdef PetscScalar sval = asScalar(value) # <<<<<<<<<<<<<< * cdef PetscInsertMode caddv = insertmode(addv) * CHKERR( MatSetValues(self.mat, 1, &ival1, 1, &ival2, &sval, caddv) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_value); if (unlikely(__pyx_t_2 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(46, 2507, __pyx_L1_error) __pyx_v_sval = __pyx_t_2; /* "petsc4py/PETSc/Mat.pyx":2508 * cdef PetscInt ival2 = asInt(col) * cdef PetscScalar sval = asScalar(value) * cdef PetscInsertMode caddv = insertmode(addv) # <<<<<<<<<<<<<< * CHKERR( MatSetValues(self.mat, 1, &ival1, 1, &ival2, &sval, caddv) ) * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_insertmode(__pyx_v_addv); if (unlikely(__pyx_t_3 == ((InsertMode)((InsertMode)-1L)))) __PYX_ERR(46, 2508, __pyx_L1_error) __pyx_v_caddv = __pyx_t_3; /* "petsc4py/PETSc/Mat.pyx":2509 * cdef PetscScalar sval = asScalar(value) * cdef PetscInsertMode caddv = insertmode(addv) * CHKERR( MatSetValues(self.mat, 1, &ival1, 1, &ival2, &sval, caddv) ) # <<<<<<<<<<<<<< * * def setValues( */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSetValues(__pyx_v_self->mat, 1, (&__pyx_v_ival1), 1, (&__pyx_v_ival2), (&__pyx_v_sval), __pyx_v_caddv)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 2509, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":2478 * return (ai, aj) * * def setValue( # <<<<<<<<<<<<<< * self, * row: int, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValue", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":2511 * CHKERR( MatSetValues(self.mat, 1, &ival1, 1, &ival2, &sval, caddv) ) * * def setValues( # <<<<<<<<<<<<<< * self, * rows: Sequence[int], */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_209setValues(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_208setValues, "Mat.setValues(self, rows: Sequence[int], cols: Sequence[int], values: Sequence[Scalar], addv: InsertModeSpec = None) -> None\nSet values to the rows \342\212\227 cols entries of the matrix.\n\n Not collective.\n\n Parameters\n ----------\n rows\n Row indices.\n cols\n Column indices.\n values\n The scalar values. A sequence of length at least ``len(rows) * len(cols)``.\n addv\n Insertion mode.\n\n See Also\n --------\n petsc.MatSetValues\n\n \nSource code at petsc4py/PETSc/Mat.pyx:2511"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_209setValues(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_rows = 0; PyObject *__pyx_v_cols = 0; PyObject *__pyx_v_values = 0; PyObject *__pyx_v_addv = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setValues (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rows,&__pyx_n_s_cols,&__pyx_n_s_values,&__pyx_n_s_addv,0}; /* "petsc4py/PETSc/Mat.pyx":2516 * cols: Sequence[int], * values: Sequence[Scalar], * addv: InsertModeSpec = None, # <<<<<<<<<<<<<< * ) -> None: * """Set values to the rows cols entries of the matrix. */ values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rows)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2511, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_cols)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2511, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setValues", 0, 3, 4, 1); __PYX_ERR(46, 2511, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_values)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2511, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setValues", 0, 3, 4, 2); __PYX_ERR(46, 2511, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_addv); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2511, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setValues") < 0)) __PYX_ERR(46, 2511, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_rows = values[0]; __pyx_v_cols = values[1]; __pyx_v_values = values[2]; __pyx_v_addv = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setValues", 0, 3, 4, __pyx_nargs); __PYX_ERR(46, 2511, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValues", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_208setValues(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_rows, __pyx_v_cols, __pyx_v_values, __pyx_v_addv); /* "petsc4py/PETSc/Mat.pyx":2511 * CHKERR( MatSetValues(self.mat, 1, &ival1, 1, &ival2, &sval, caddv) ) * * def setValues( # <<<<<<<<<<<<<< * self, * rows: Sequence[int], */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_208setValues(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_rows, PyObject *__pyx_v_cols, PyObject *__pyx_v_values, PyObject *__pyx_v_addv) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setValues", 1); /* "petsc4py/PETSc/Mat.pyx":2538 * * """ * matsetvalues(self.mat, rows, cols, values, addv, 0, 0) # <<<<<<<<<<<<<< * * def setValuesRCV(self, R, C, V, addv=None) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_matsetvalues(__pyx_v_self->mat, __pyx_v_rows, __pyx_v_cols, __pyx_v_values, __pyx_v_addv, 0, 0); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 2538, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":2511 * CHKERR( MatSetValues(self.mat, 1, &ival1, 1, &ival2, &sval, caddv) ) * * def setValues( # <<<<<<<<<<<<<< * self, * rows: Sequence[int], */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValues", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":2540 * matsetvalues(self.mat, rows, cols, values, addv, 0, 0) * * def setValuesRCV(self, R, C, V, addv=None) -> None: # <<<<<<<<<<<<<< * """Undocumented.""" * matsetvalues_rcv(self.mat, R, C, V, addv, 0, 0) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_211setValuesRCV(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_210setValuesRCV, "Mat.setValuesRCV(self, R, C, V, addv=None) -> None\nUndocumented.\nSource code at petsc4py/PETSc/Mat.pyx:2540"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_211setValuesRCV(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_R = 0; PyObject *__pyx_v_C = 0; PyObject *__pyx_v_V = 0; PyObject *__pyx_v_addv = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setValuesRCV (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_R,&__pyx_n_s_C,&__pyx_n_s_V,&__pyx_n_s_addv,0}; values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_R)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2540, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_C)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2540, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setValuesRCV", 0, 3, 4, 1); __PYX_ERR(46, 2540, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_V)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2540, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setValuesRCV", 0, 3, 4, 2); __PYX_ERR(46, 2540, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_addv); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2540, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setValuesRCV") < 0)) __PYX_ERR(46, 2540, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_R = values[0]; __pyx_v_C = values[1]; __pyx_v_V = values[2]; __pyx_v_addv = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setValuesRCV", 0, 3, 4, __pyx_nargs); __PYX_ERR(46, 2540, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValuesRCV", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_210setValuesRCV(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_R, __pyx_v_C, __pyx_v_V, __pyx_v_addv); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_210setValuesRCV(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_R, PyObject *__pyx_v_C, PyObject *__pyx_v_V, PyObject *__pyx_v_addv) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setValuesRCV", 1); /* "petsc4py/PETSc/Mat.pyx":2542 * def setValuesRCV(self, R, C, V, addv=None) -> None: * """Undocumented.""" * matsetvalues_rcv(self.mat, R, C, V, addv, 0, 0) # <<<<<<<<<<<<<< * * def setValuesIJV( */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_matsetvalues_rcv(__pyx_v_self->mat, __pyx_v_R, __pyx_v_C, __pyx_v_V, __pyx_v_addv, 0, 0); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 2542, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":2540 * matsetvalues(self.mat, rows, cols, values, addv, 0, 0) * * def setValuesRCV(self, R, C, V, addv=None) -> None: # <<<<<<<<<<<<<< * """Undocumented.""" * matsetvalues_rcv(self.mat, R, C, V, addv, 0, 0) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValuesRCV", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":2544 * matsetvalues_rcv(self.mat, R, C, V, addv, 0, 0) * * def setValuesIJV( # <<<<<<<<<<<<<< * self, * I: Sequence[int], */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_213setValuesIJV(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_212setValuesIJV, "Mat.setValuesIJV(self, I: Sequence[int], J: Sequence[int], V: Sequence[Scalar], addv: InsertModeSpec = None, rowmap: Sequence[int] = None) -> None\nSet a subset of values stored in CSR format.\n\n Not collective.\n\n Parameters\n ----------\n I\n Row pointers.\n J\n Column indices.\n V\n The scalar values.\n addv\n Insertion mode.\n rowmap\n Optional iterable indicating which row to insert.\n\n See Also\n --------\n petsc.MatSetValues\n\n \nSource code at petsc4py/PETSc/Mat.pyx:2544"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_213setValuesIJV(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_I = 0; PyObject *__pyx_v_J = 0; PyObject *__pyx_v_V = 0; PyObject *__pyx_v_addv = 0; PyObject *__pyx_v_rowmap = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setValuesIJV (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_I,&__pyx_n_s_J,&__pyx_n_s_V,&__pyx_n_s_addv,&__pyx_n_s_rowmap,0}; /* "petsc4py/PETSc/Mat.pyx":2549 * J: Sequence[int], * V: Sequence[Scalar], * addv: InsertModeSpec = None, # <<<<<<<<<<<<<< * rowmap: Sequence[int] = None, * ) -> None: */ values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Mat.pyx":2550 * V: Sequence[Scalar], * addv: InsertModeSpec = None, * rowmap: Sequence[int] = None, # <<<<<<<<<<<<<< * ) -> None: * """Set a subset of values stored in CSR format. */ values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_I)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2544, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_J)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2544, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setValuesIJV", 0, 3, 5, 1); __PYX_ERR(46, 2544, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_V)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2544, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setValuesIJV", 0, 3, 5, 2); __PYX_ERR(46, 2544, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_addv); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2544, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rowmap); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2544, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setValuesIJV") < 0)) __PYX_ERR(46, 2544, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_I = values[0]; __pyx_v_J = values[1]; __pyx_v_V = values[2]; __pyx_v_addv = values[3]; __pyx_v_rowmap = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setValuesIJV", 0, 3, 5, __pyx_nargs); __PYX_ERR(46, 2544, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValuesIJV", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_212setValuesIJV(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_I, __pyx_v_J, __pyx_v_V, __pyx_v_addv, __pyx_v_rowmap); /* "petsc4py/PETSc/Mat.pyx":2544 * matsetvalues_rcv(self.mat, R, C, V, addv, 0, 0) * * def setValuesIJV( # <<<<<<<<<<<<<< * self, * I: Sequence[int], */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_212setValuesIJV(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_I, PyObject *__pyx_v_J, PyObject *__pyx_v_V, PyObject *__pyx_v_addv, PyObject *__pyx_v_rowmap) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setValuesIJV", 1); /* "petsc4py/PETSc/Mat.pyx":2574 * * """ * matsetvalues_ijv(self.mat, I, J, V, addv, rowmap, 0, 0) # <<<<<<<<<<<<<< * * def setValuesCSR( */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_matsetvalues_ijv(__pyx_v_self->mat, __pyx_v_I, __pyx_v_J, __pyx_v_V, __pyx_v_addv, __pyx_v_rowmap, 0, 0); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 2574, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":2544 * matsetvalues_rcv(self.mat, R, C, V, addv, 0, 0) * * def setValuesIJV( # <<<<<<<<<<<<<< * self, * I: Sequence[int], */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValuesIJV", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":2576 * matsetvalues_ijv(self.mat, I, J, V, addv, rowmap, 0, 0) * * def setValuesCSR( # <<<<<<<<<<<<<< * self, * I: Sequence[int], */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_215setValuesCSR(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_214setValuesCSR, "Mat.setValuesCSR(self, I: Sequence[int], J: Sequence[int], V: Sequence[Scalar], addv: InsertModeSpec = None) -> None\nSet values stored in CSR format.\n\n Not collective.\n\n Parameters\n ----------\n I\n Row pointers.\n J\n Column indices.\n V\n The scalar values.\n addv\n Insertion mode.\n\n See Also\n --------\n petsc.MatSetValues\n\n \nSource code at petsc4py/PETSc/Mat.pyx:2576"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_215setValuesCSR(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_I = 0; PyObject *__pyx_v_J = 0; PyObject *__pyx_v_V = 0; PyObject *__pyx_v_addv = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setValuesCSR (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_I,&__pyx_n_s_J,&__pyx_n_s_V,&__pyx_n_s_addv,0}; /* "petsc4py/PETSc/Mat.pyx":2581 * J: Sequence[int], * V: Sequence[Scalar], * addv: InsertModeSpec = None, # <<<<<<<<<<<<<< * ) -> None: * """Set values stored in CSR format. */ values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_I)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2576, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_J)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2576, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setValuesCSR", 0, 3, 4, 1); __PYX_ERR(46, 2576, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_V)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2576, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setValuesCSR", 0, 3, 4, 2); __PYX_ERR(46, 2576, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_addv); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2576, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setValuesCSR") < 0)) __PYX_ERR(46, 2576, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_I = values[0]; __pyx_v_J = values[1]; __pyx_v_V = values[2]; __pyx_v_addv = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setValuesCSR", 0, 3, 4, __pyx_nargs); __PYX_ERR(46, 2576, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValuesCSR", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_214setValuesCSR(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_I, __pyx_v_J, __pyx_v_V, __pyx_v_addv); /* "petsc4py/PETSc/Mat.pyx":2576 * matsetvalues_ijv(self.mat, I, J, V, addv, rowmap, 0, 0) * * def setValuesCSR( # <<<<<<<<<<<<<< * self, * I: Sequence[int], */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_214setValuesCSR(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_I, PyObject *__pyx_v_J, PyObject *__pyx_v_V, PyObject *__pyx_v_addv) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setValuesCSR", 1); /* "petsc4py/PETSc/Mat.pyx":2603 * * """ * matsetvalues_csr(self.mat, I, J, V, addv, 0, 0) # <<<<<<<<<<<<<< * * def setValuesBlocked( */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_matsetvalues_csr(__pyx_v_self->mat, __pyx_v_I, __pyx_v_J, __pyx_v_V, __pyx_v_addv, 0, 0); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 2603, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":2576 * matsetvalues_ijv(self.mat, I, J, V, addv, rowmap, 0, 0) * * def setValuesCSR( # <<<<<<<<<<<<<< * self, * I: Sequence[int], */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValuesCSR", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":2605 * matsetvalues_csr(self.mat, I, J, V, addv, 0, 0) * * def setValuesBlocked( # <<<<<<<<<<<<<< * self, * rows: Sequence[int], */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_217setValuesBlocked(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_216setValuesBlocked, "Mat.setValuesBlocked(self, rows: Sequence[int], cols: Sequence[int], values: Sequence[Scalar], addv: InsertModeSpec = None) -> None\nSet values to the rows \342\212\227 col block entries of the matrix.\n\n Not collective.\n\n Parameters\n ----------\n rows\n Block row indices.\n cols\n Block column indices.\n values\n The scalar values. A sequence of length at least\n ``len(rows) * len(cols) * bs * bs``,\n where ``bs`` is the block size of the matrix.\n addv\n Insertion mode.\n\n See Also\n --------\n petsc.MatSetValuesBlocked\n\n \nSource code at petsc4py/PETSc/Mat.pyx:2605"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_217setValuesBlocked(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_rows = 0; PyObject *__pyx_v_cols = 0; PyObject *__pyx_v_values = 0; PyObject *__pyx_v_addv = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setValuesBlocked (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rows,&__pyx_n_s_cols,&__pyx_n_s_values,&__pyx_n_s_addv,0}; /* "petsc4py/PETSc/Mat.pyx":2610 * cols: Sequence[int], * values: Sequence[Scalar], * addv: InsertModeSpec = None, # <<<<<<<<<<<<<< * ) -> None: * """Set values to the rows col block entries of the matrix. */ values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rows)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2605, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_cols)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2605, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setValuesBlocked", 0, 3, 4, 1); __PYX_ERR(46, 2605, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_values)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2605, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setValuesBlocked", 0, 3, 4, 2); __PYX_ERR(46, 2605, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_addv); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2605, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setValuesBlocked") < 0)) __PYX_ERR(46, 2605, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_rows = values[0]; __pyx_v_cols = values[1]; __pyx_v_values = values[2]; __pyx_v_addv = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setValuesBlocked", 0, 3, 4, __pyx_nargs); __PYX_ERR(46, 2605, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValuesBlocked", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_216setValuesBlocked(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_rows, __pyx_v_cols, __pyx_v_values, __pyx_v_addv); /* "petsc4py/PETSc/Mat.pyx":2605 * matsetvalues_csr(self.mat, I, J, V, addv, 0, 0) * * def setValuesBlocked( # <<<<<<<<<<<<<< * self, * rows: Sequence[int], */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_216setValuesBlocked(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_rows, PyObject *__pyx_v_cols, PyObject *__pyx_v_values, PyObject *__pyx_v_addv) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setValuesBlocked", 1); /* "petsc4py/PETSc/Mat.pyx":2634 * * """ * matsetvalues(self.mat, rows, cols, values, addv, 1, 0) # <<<<<<<<<<<<<< * * def setValuesBlockedRCV(self, R, C, V, addv=None) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_matsetvalues(__pyx_v_self->mat, __pyx_v_rows, __pyx_v_cols, __pyx_v_values, __pyx_v_addv, 1, 0); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 2634, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":2605 * matsetvalues_csr(self.mat, I, J, V, addv, 0, 0) * * def setValuesBlocked( # <<<<<<<<<<<<<< * self, * rows: Sequence[int], */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValuesBlocked", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":2636 * matsetvalues(self.mat, rows, cols, values, addv, 1, 0) * * def setValuesBlockedRCV(self, R, C, V, addv=None) -> None: # <<<<<<<<<<<<<< * """Undocumented.""" * matsetvalues_rcv(self.mat, R, C, V, addv, 1, 0) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_219setValuesBlockedRCV(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_218setValuesBlockedRCV, "Mat.setValuesBlockedRCV(self, R, C, V, addv=None) -> None\nUndocumented.\nSource code at petsc4py/PETSc/Mat.pyx:2636"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_219setValuesBlockedRCV(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_R = 0; PyObject *__pyx_v_C = 0; PyObject *__pyx_v_V = 0; PyObject *__pyx_v_addv = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setValuesBlockedRCV (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_R,&__pyx_n_s_C,&__pyx_n_s_V,&__pyx_n_s_addv,0}; values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_R)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2636, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_C)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2636, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setValuesBlockedRCV", 0, 3, 4, 1); __PYX_ERR(46, 2636, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_V)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2636, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setValuesBlockedRCV", 0, 3, 4, 2); __PYX_ERR(46, 2636, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_addv); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2636, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setValuesBlockedRCV") < 0)) __PYX_ERR(46, 2636, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_R = values[0]; __pyx_v_C = values[1]; __pyx_v_V = values[2]; __pyx_v_addv = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setValuesBlockedRCV", 0, 3, 4, __pyx_nargs); __PYX_ERR(46, 2636, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValuesBlockedRCV", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_218setValuesBlockedRCV(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_R, __pyx_v_C, __pyx_v_V, __pyx_v_addv); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_218setValuesBlockedRCV(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_R, PyObject *__pyx_v_C, PyObject *__pyx_v_V, PyObject *__pyx_v_addv) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setValuesBlockedRCV", 1); /* "petsc4py/PETSc/Mat.pyx":2638 * def setValuesBlockedRCV(self, R, C, V, addv=None) -> None: * """Undocumented.""" * matsetvalues_rcv(self.mat, R, C, V, addv, 1, 0) # <<<<<<<<<<<<<< * * def setValuesBlockedIJV( */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_matsetvalues_rcv(__pyx_v_self->mat, __pyx_v_R, __pyx_v_C, __pyx_v_V, __pyx_v_addv, 1, 0); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 2638, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":2636 * matsetvalues(self.mat, rows, cols, values, addv, 1, 0) * * def setValuesBlockedRCV(self, R, C, V, addv=None) -> None: # <<<<<<<<<<<<<< * """Undocumented.""" * matsetvalues_rcv(self.mat, R, C, V, addv, 1, 0) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValuesBlockedRCV", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":2640 * matsetvalues_rcv(self.mat, R, C, V, addv, 1, 0) * * def setValuesBlockedIJV( # <<<<<<<<<<<<<< * self, * I: Sequence[int], */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_221setValuesBlockedIJV(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_220setValuesBlockedIJV, "Mat.setValuesBlockedIJV(self, I: Sequence[int], J: Sequence[int], V: Sequence[Scalar], addv: InsertModeSpec = None, rowmap: Sequence[int] = None) -> None\nSet a subset of values stored in block CSR format.\n\n Not collective.\n\n Parameters\n ----------\n I\n Block row pointers.\n J\n Block column indices.\n V\n The scalar values.\n addv\n Insertion mode.\n rowmap\n Optional iterable indicating which block row to insert.\n\n See Also\n --------\n petsc.MatSetValuesBlocked\n\n \nSource code at petsc4py/PETSc/Mat.pyx:2640"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_221setValuesBlockedIJV(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_I = 0; PyObject *__pyx_v_J = 0; PyObject *__pyx_v_V = 0; PyObject *__pyx_v_addv = 0; PyObject *__pyx_v_rowmap = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setValuesBlockedIJV (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_I,&__pyx_n_s_J,&__pyx_n_s_V,&__pyx_n_s_addv,&__pyx_n_s_rowmap,0}; /* "petsc4py/PETSc/Mat.pyx":2645 * J: Sequence[int], * V: Sequence[Scalar], * addv: InsertModeSpec = None, # <<<<<<<<<<<<<< * rowmap: Sequence[int] = None, * ) -> None: */ values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Mat.pyx":2646 * V: Sequence[Scalar], * addv: InsertModeSpec = None, * rowmap: Sequence[int] = None, # <<<<<<<<<<<<<< * ) -> None: * """Set a subset of values stored in block CSR format. */ values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_I)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2640, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_J)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2640, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setValuesBlockedIJV", 0, 3, 5, 1); __PYX_ERR(46, 2640, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_V)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2640, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setValuesBlockedIJV", 0, 3, 5, 2); __PYX_ERR(46, 2640, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_addv); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2640, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rowmap); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2640, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setValuesBlockedIJV") < 0)) __PYX_ERR(46, 2640, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_I = values[0]; __pyx_v_J = values[1]; __pyx_v_V = values[2]; __pyx_v_addv = values[3]; __pyx_v_rowmap = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setValuesBlockedIJV", 0, 3, 5, __pyx_nargs); __PYX_ERR(46, 2640, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValuesBlockedIJV", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_220setValuesBlockedIJV(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_I, __pyx_v_J, __pyx_v_V, __pyx_v_addv, __pyx_v_rowmap); /* "petsc4py/PETSc/Mat.pyx":2640 * matsetvalues_rcv(self.mat, R, C, V, addv, 1, 0) * * def setValuesBlockedIJV( # <<<<<<<<<<<<<< * self, * I: Sequence[int], */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_220setValuesBlockedIJV(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_I, PyObject *__pyx_v_J, PyObject *__pyx_v_V, PyObject *__pyx_v_addv, PyObject *__pyx_v_rowmap) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setValuesBlockedIJV", 1); /* "petsc4py/PETSc/Mat.pyx":2670 * * """ * matsetvalues_ijv(self.mat, I, J, V, addv, rowmap, 1, 0) # <<<<<<<<<<<<<< * * def setValuesBlockedCSR( */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_matsetvalues_ijv(__pyx_v_self->mat, __pyx_v_I, __pyx_v_J, __pyx_v_V, __pyx_v_addv, __pyx_v_rowmap, 1, 0); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 2670, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":2640 * matsetvalues_rcv(self.mat, R, C, V, addv, 1, 0) * * def setValuesBlockedIJV( # <<<<<<<<<<<<<< * self, * I: Sequence[int], */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValuesBlockedIJV", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":2672 * matsetvalues_ijv(self.mat, I, J, V, addv, rowmap, 1, 0) * * def setValuesBlockedCSR( # <<<<<<<<<<<<<< * self, * I: Sequence[int], */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_223setValuesBlockedCSR(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_222setValuesBlockedCSR, "Mat.setValuesBlockedCSR(self, I: Sequence[int], J: Sequence[int], V: Sequence[Scalar], addv: InsertModeSpec = None) -> None\nSet values stored in block CSR format.\n\n Not collective.\n\n Parameters\n ----------\n I\n Block row pointers.\n J\n Block column indices.\n V\n The scalar values.\n addv\n Insertion mode.\n\n See Also\n --------\n petsc.MatSetValuesBlocked\n\n \nSource code at petsc4py/PETSc/Mat.pyx:2672"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_223setValuesBlockedCSR(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_I = 0; PyObject *__pyx_v_J = 0; PyObject *__pyx_v_V = 0; PyObject *__pyx_v_addv = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setValuesBlockedCSR (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_I,&__pyx_n_s_J,&__pyx_n_s_V,&__pyx_n_s_addv,0}; /* "petsc4py/PETSc/Mat.pyx":2677 * J: Sequence[int], * V: Sequence[Scalar], * addv: InsertModeSpec = None, # <<<<<<<<<<<<<< * ) -> None: * """Set values stored in block CSR format. */ values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_I)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2672, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_J)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2672, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setValuesBlockedCSR", 0, 3, 4, 1); __PYX_ERR(46, 2672, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_V)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2672, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setValuesBlockedCSR", 0, 3, 4, 2); __PYX_ERR(46, 2672, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_addv); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2672, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setValuesBlockedCSR") < 0)) __PYX_ERR(46, 2672, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_I = values[0]; __pyx_v_J = values[1]; __pyx_v_V = values[2]; __pyx_v_addv = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setValuesBlockedCSR", 0, 3, 4, __pyx_nargs); __PYX_ERR(46, 2672, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValuesBlockedCSR", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_222setValuesBlockedCSR(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_I, __pyx_v_J, __pyx_v_V, __pyx_v_addv); /* "petsc4py/PETSc/Mat.pyx":2672 * matsetvalues_ijv(self.mat, I, J, V, addv, rowmap, 1, 0) * * def setValuesBlockedCSR( # <<<<<<<<<<<<<< * self, * I: Sequence[int], */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_222setValuesBlockedCSR(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_I, PyObject *__pyx_v_J, PyObject *__pyx_v_V, PyObject *__pyx_v_addv) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setValuesBlockedCSR", 1); /* "petsc4py/PETSc/Mat.pyx":2699 * * """ * matsetvalues_csr(self.mat, I, J, V, addv, 1, 0) # <<<<<<<<<<<<<< * * def setLGMap(self, LGMap rmap, LGMap cmap=None) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_matsetvalues_csr(__pyx_v_self->mat, __pyx_v_I, __pyx_v_J, __pyx_v_V, __pyx_v_addv, 1, 0); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 2699, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":2672 * matsetvalues_ijv(self.mat, I, J, V, addv, rowmap, 1, 0) * * def setValuesBlockedCSR( # <<<<<<<<<<<<<< * self, * I: Sequence[int], */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValuesBlockedCSR", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":2701 * matsetvalues_csr(self.mat, I, J, V, addv, 1, 0) * * def setLGMap(self, LGMap rmap, LGMap cmap=None) -> None: # <<<<<<<<<<<<<< * """Set the local-to-global mappings. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_225setLGMap(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_224setLGMap, "Mat.setLGMap(self, rmap: LGMap, cmap: LGMap | None = None) -> None\nSet the local-to-global mappings.\n\n Collective.\n\n Parameters\n ----------\n rmap\n Row mapping.\n cmap\n Column mapping. If `None`, ``cmap = rmap``.\n\n See Also\n --------\n getLGMap, petsc.MatSetLocalToGlobalMapping\n\n \nSource code at petsc4py/PETSc/Mat.pyx:2701"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_225setLGMap(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscLGMapObject *__pyx_v_rmap = 0; struct PyPetscLGMapObject *__pyx_v_cmap = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setLGMap (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rmap,&__pyx_n_s_cmap,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscLGMapObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rmap)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2701, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_cmap); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2701, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setLGMap") < 0)) __PYX_ERR(46, 2701, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_rmap = ((struct PyPetscLGMapObject *)values[0]); __pyx_v_cmap = ((struct PyPetscLGMapObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setLGMap", 0, 1, 2, __pyx_nargs); __PYX_ERR(46, 2701, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.setLGMap", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rmap), __pyx_ptype_8petsc4py_5PETSc_LGMap, 0, "rmap", 0))) __PYX_ERR(46, 2701, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cmap), __pyx_ptype_8petsc4py_5PETSc_LGMap, 1, "cmap", 0))) __PYX_ERR(46, 2701, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_224setLGMap(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_rmap, __pyx_v_cmap); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_224setLGMap(struct PyPetscMatObject *__pyx_v_self, struct PyPetscLGMapObject *__pyx_v_rmap, struct PyPetscLGMapObject *__pyx_v_cmap) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setLGMap", 0); __Pyx_INCREF((PyObject *)__pyx_v_cmap); /* "petsc4py/PETSc/Mat.pyx":2718 * * """ * if cmap is None: cmap = rmap # <<<<<<<<<<<<<< * CHKERR( MatSetLocalToGlobalMapping(self.mat, rmap.lgm, cmap.lgm) ) * */ __pyx_t_1 = (((PyObject *)__pyx_v_cmap) == Py_None); if (__pyx_t_1) { __Pyx_INCREF((PyObject *)__pyx_v_rmap); __Pyx_DECREF_SET(__pyx_v_cmap, __pyx_v_rmap); } /* "petsc4py/PETSc/Mat.pyx":2719 * """ * if cmap is None: cmap = rmap * CHKERR( MatSetLocalToGlobalMapping(self.mat, rmap.lgm, cmap.lgm) ) # <<<<<<<<<<<<<< * * def getLGMap(self) -> tuple[LGMap, LGMap]: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSetLocalToGlobalMapping(__pyx_v_self->mat, __pyx_v_rmap->lgm, __pyx_v_cmap->lgm)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 2719, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":2701 * matsetvalues_csr(self.mat, I, J, V, addv, 1, 0) * * def setLGMap(self, LGMap rmap, LGMap cmap=None) -> None: # <<<<<<<<<<<<<< * """Set the local-to-global mappings. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setLGMap", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_cmap); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":2721 * CHKERR( MatSetLocalToGlobalMapping(self.mat, rmap.lgm, cmap.lgm) ) * * def getLGMap(self) -> tuple[LGMap, LGMap]: # <<<<<<<<<<<<<< * """Return the local-to-global mappings. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_227getLGMap(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_226getLGMap, "Mat.getLGMap(self) -> tuple[LGMap, LGMap]\nReturn the local-to-global mappings.\n\n Not collective.\n\n See Also\n --------\n setLGMap, petsc.MatGetLocalToGlobalMapping\n\n \nSource code at petsc4py/PETSc/Mat.pyx:2721"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_227getLGMap(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getLGMap (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getLGMap", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getLGMap", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_226getLGMap(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_226getLGMap(struct PyPetscMatObject *__pyx_v_self) { struct PyPetscLGMapObject *__pyx_v_cmap = 0; struct PyPetscLGMapObject *__pyx_v_rmap = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getLGMap", 1); /* "petsc4py/PETSc/Mat.pyx":2731 * * """ * cdef LGMap cmap = LGMap() # <<<<<<<<<<<<<< * cdef LGMap rmap = LGMap() * CHKERR( MatGetLocalToGlobalMapping(self.mat, &rmap.lgm, &cmap.lgm) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_LGMap)); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 2731, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_cmap = ((struct PyPetscLGMapObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Mat.pyx":2732 * """ * cdef LGMap cmap = LGMap() * cdef LGMap rmap = LGMap() # <<<<<<<<<<<<<< * CHKERR( MatGetLocalToGlobalMapping(self.mat, &rmap.lgm, &cmap.lgm) ) * CHKERR( PetscINCREF(cmap.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_LGMap)); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 2732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_rmap = ((struct PyPetscLGMapObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Mat.pyx":2733 * cdef LGMap cmap = LGMap() * cdef LGMap rmap = LGMap() * CHKERR( MatGetLocalToGlobalMapping(self.mat, &rmap.lgm, &cmap.lgm) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(cmap.obj) ) * CHKERR( PetscINCREF(rmap.obj) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetLocalToGlobalMapping(__pyx_v_self->mat, (&__pyx_v_rmap->lgm), (&__pyx_v_cmap->lgm))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 2733, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":2734 * cdef LGMap rmap = LGMap() * CHKERR( MatGetLocalToGlobalMapping(self.mat, &rmap.lgm, &cmap.lgm) ) * CHKERR( PetscINCREF(cmap.obj) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(rmap.obj) ) * return (rmap, cmap) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_cmap->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 2734, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":2735 * CHKERR( MatGetLocalToGlobalMapping(self.mat, &rmap.lgm, &cmap.lgm) ) * CHKERR( PetscINCREF(cmap.obj) ) * CHKERR( PetscINCREF(rmap.obj) ) # <<<<<<<<<<<<<< * return (rmap, cmap) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_rmap->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 2735, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":2736 * CHKERR( PetscINCREF(cmap.obj) ) * CHKERR( PetscINCREF(rmap.obj) ) * return (rmap, cmap) # <<<<<<<<<<<<<< * * def setValueLocal( */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 2736, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF((PyObject *)__pyx_v_rmap); __Pyx_GIVEREF((PyObject *)__pyx_v_rmap); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_rmap))) __PYX_ERR(46, 2736, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_cmap); __Pyx_GIVEREF((PyObject *)__pyx_v_cmap); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_cmap))) __PYX_ERR(46, 2736, __pyx_L1_error); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":2721 * CHKERR( MatSetLocalToGlobalMapping(self.mat, rmap.lgm, cmap.lgm) ) * * def getLGMap(self) -> tuple[LGMap, LGMap]: # <<<<<<<<<<<<<< * """Return the local-to-global mappings. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getLGMap", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_cmap); __Pyx_XDECREF((PyObject *)__pyx_v_rmap); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":2738 * return (rmap, cmap) * * def setValueLocal( # <<<<<<<<<<<<<< * self, * row: int, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_229setValueLocal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_228setValueLocal, "Mat.setValueLocal(self, row: int, col: int, value: Scalar, addv: InsertModeSpec = None) -> None\nSet a value to the ``(row, col)`` entry of the matrix in local ordering.\n\n Not collective.\n\n Parameters\n ----------\n row\n Local row index.\n col\n Local column index.\n value\n The scalar value.\n addv\n Insertion mode.\n\n See Also\n --------\n petsc.MatSetValuesLocal\n\n \nSource code at petsc4py/PETSc/Mat.pyx:2738"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_229setValueLocal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_row = 0; PyObject *__pyx_v_col = 0; PyObject *__pyx_v_value = 0; PyObject *__pyx_v_addv = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setValueLocal (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_row,&__pyx_n_s_col,&__pyx_n_s_value,&__pyx_n_s_addv,0}; /* "petsc4py/PETSc/Mat.pyx":2743 * col: int, * value: Scalar, * addv: InsertModeSpec = None, # <<<<<<<<<<<<<< * ) -> None: * """Set a value to the ``(row, col)`` entry of the matrix in local ordering. */ values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_row)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2738, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_col)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2738, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setValueLocal", 0, 3, 4, 1); __PYX_ERR(46, 2738, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2738, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setValueLocal", 0, 3, 4, 2); __PYX_ERR(46, 2738, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_addv); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2738, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setValueLocal") < 0)) __PYX_ERR(46, 2738, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_row = values[0]; __pyx_v_col = values[1]; __pyx_v_value = values[2]; __pyx_v_addv = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setValueLocal", 0, 3, 4, __pyx_nargs); __PYX_ERR(46, 2738, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValueLocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_228setValueLocal(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_row, __pyx_v_col, __pyx_v_value, __pyx_v_addv); /* "petsc4py/PETSc/Mat.pyx":2738 * return (rmap, cmap) * * def setValueLocal( # <<<<<<<<<<<<<< * self, * row: int, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_228setValueLocal(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_row, PyObject *__pyx_v_col, PyObject *__pyx_v_value, PyObject *__pyx_v_addv) { PetscInt __pyx_v_ival1; PetscInt __pyx_v_ival2; PetscScalar __pyx_v_sval; InsertMode __pyx_v_caddv; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscScalar __pyx_t_2; InsertMode __pyx_t_3; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setValueLocal", 1); /* "petsc4py/PETSc/Mat.pyx":2765 * * """ * cdef PetscInt ival1 = asInt(row) # <<<<<<<<<<<<<< * cdef PetscInt ival2 = asInt(col) * cdef PetscScalar sval = asScalar(value) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_row); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(46, 2765, __pyx_L1_error) __pyx_v_ival1 = __pyx_t_1; /* "petsc4py/PETSc/Mat.pyx":2766 * """ * cdef PetscInt ival1 = asInt(row) * cdef PetscInt ival2 = asInt(col) # <<<<<<<<<<<<<< * cdef PetscScalar sval = asScalar(value) * cdef PetscInsertMode caddv = insertmode(addv) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_col); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(46, 2766, __pyx_L1_error) __pyx_v_ival2 = __pyx_t_1; /* "petsc4py/PETSc/Mat.pyx":2767 * cdef PetscInt ival1 = asInt(row) * cdef PetscInt ival2 = asInt(col) * cdef PetscScalar sval = asScalar(value) # <<<<<<<<<<<<<< * cdef PetscInsertMode caddv = insertmode(addv) * CHKERR( MatSetValuesLocal( */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_value); if (unlikely(__pyx_t_2 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(46, 2767, __pyx_L1_error) __pyx_v_sval = __pyx_t_2; /* "petsc4py/PETSc/Mat.pyx":2768 * cdef PetscInt ival2 = asInt(col) * cdef PetscScalar sval = asScalar(value) * cdef PetscInsertMode caddv = insertmode(addv) # <<<<<<<<<<<<<< * CHKERR( MatSetValuesLocal( * self.mat, 1, &ival1, 1, &ival2, &sval, caddv) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_insertmode(__pyx_v_addv); if (unlikely(__pyx_t_3 == ((InsertMode)((InsertMode)-1L)))) __PYX_ERR(46, 2768, __pyx_L1_error) __pyx_v_caddv = __pyx_t_3; /* "petsc4py/PETSc/Mat.pyx":2769 * cdef PetscScalar sval = asScalar(value) * cdef PetscInsertMode caddv = insertmode(addv) * CHKERR( MatSetValuesLocal( # <<<<<<<<<<<<<< * self.mat, 1, &ival1, 1, &ival2, &sval, caddv) ) * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSetValuesLocal(__pyx_v_self->mat, 1, (&__pyx_v_ival1), 1, (&__pyx_v_ival2), (&__pyx_v_sval), __pyx_v_caddv)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 2769, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":2738 * return (rmap, cmap) * * def setValueLocal( # <<<<<<<<<<<<<< * self, * row: int, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValueLocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":2772 * self.mat, 1, &ival1, 1, &ival2, &sval, caddv) ) * * def setValuesLocal( # <<<<<<<<<<<<<< * self, * rows: Sequence[int], */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_231setValuesLocal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_230setValuesLocal, "Mat.setValuesLocal(self, rows: Sequence[int], cols: Sequence[int], values: Sequence[Scalar], addv: InsertModeSpec = None) -> None\nSet values to the rows \342\212\227 col entries of the matrix in local ordering.\n\n Not collective.\n\n Parameters\n ----------\n rows\n Local row indices.\n cols\n Local column indices.\n values\n The scalar values. A sequence of length at least ``len(rows) * len(cols)``.\n addv\n Insertion mode.\n\n See Also\n --------\n petsc.MatSetValuesLocal\n\n \nSource code at petsc4py/PETSc/Mat.pyx:2772"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_231setValuesLocal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_rows = 0; PyObject *__pyx_v_cols = 0; PyObject *__pyx_v_values = 0; PyObject *__pyx_v_addv = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setValuesLocal (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rows,&__pyx_n_s_cols,&__pyx_n_s_values,&__pyx_n_s_addv,0}; /* "petsc4py/PETSc/Mat.pyx":2777 * cols: Sequence[int], * values: Sequence[Scalar], * addv: InsertModeSpec = None, # <<<<<<<<<<<<<< * ) -> None: * """Set values to the rows col entries of the matrix in local ordering. */ values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rows)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2772, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_cols)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2772, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setValuesLocal", 0, 3, 4, 1); __PYX_ERR(46, 2772, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_values)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2772, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setValuesLocal", 0, 3, 4, 2); __PYX_ERR(46, 2772, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_addv); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2772, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setValuesLocal") < 0)) __PYX_ERR(46, 2772, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_rows = values[0]; __pyx_v_cols = values[1]; __pyx_v_values = values[2]; __pyx_v_addv = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setValuesLocal", 0, 3, 4, __pyx_nargs); __PYX_ERR(46, 2772, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValuesLocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_230setValuesLocal(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_rows, __pyx_v_cols, __pyx_v_values, __pyx_v_addv); /* "petsc4py/PETSc/Mat.pyx":2772 * self.mat, 1, &ival1, 1, &ival2, &sval, caddv) ) * * def setValuesLocal( # <<<<<<<<<<<<<< * self, * rows: Sequence[int], */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_230setValuesLocal(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_rows, PyObject *__pyx_v_cols, PyObject *__pyx_v_values, PyObject *__pyx_v_addv) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setValuesLocal", 1); /* "petsc4py/PETSc/Mat.pyx":2799 * * """ * matsetvalues(self.mat, rows, cols, values, addv, 0, 1) # <<<<<<<<<<<<<< * * def setValuesLocalRCV(self, R, C, V, addv=None) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_matsetvalues(__pyx_v_self->mat, __pyx_v_rows, __pyx_v_cols, __pyx_v_values, __pyx_v_addv, 0, 1); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 2799, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":2772 * self.mat, 1, &ival1, 1, &ival2, &sval, caddv) ) * * def setValuesLocal( # <<<<<<<<<<<<<< * self, * rows: Sequence[int], */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValuesLocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":2801 * matsetvalues(self.mat, rows, cols, values, addv, 0, 1) * * def setValuesLocalRCV(self, R, C, V, addv=None) -> None: # <<<<<<<<<<<<<< * """Undocumented.""" * matsetvalues_rcv(self.mat, R, C, V, addv, 0, 1) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_233setValuesLocalRCV(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_232setValuesLocalRCV, "Mat.setValuesLocalRCV(self, R, C, V, addv=None) -> None\nUndocumented.\nSource code at petsc4py/PETSc/Mat.pyx:2801"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_233setValuesLocalRCV(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_R = 0; PyObject *__pyx_v_C = 0; PyObject *__pyx_v_V = 0; PyObject *__pyx_v_addv = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setValuesLocalRCV (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_R,&__pyx_n_s_C,&__pyx_n_s_V,&__pyx_n_s_addv,0}; values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_R)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2801, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_C)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2801, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setValuesLocalRCV", 0, 3, 4, 1); __PYX_ERR(46, 2801, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_V)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2801, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setValuesLocalRCV", 0, 3, 4, 2); __PYX_ERR(46, 2801, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_addv); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2801, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setValuesLocalRCV") < 0)) __PYX_ERR(46, 2801, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_R = values[0]; __pyx_v_C = values[1]; __pyx_v_V = values[2]; __pyx_v_addv = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setValuesLocalRCV", 0, 3, 4, __pyx_nargs); __PYX_ERR(46, 2801, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValuesLocalRCV", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_232setValuesLocalRCV(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_R, __pyx_v_C, __pyx_v_V, __pyx_v_addv); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_232setValuesLocalRCV(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_R, PyObject *__pyx_v_C, PyObject *__pyx_v_V, PyObject *__pyx_v_addv) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setValuesLocalRCV", 1); /* "petsc4py/PETSc/Mat.pyx":2803 * def setValuesLocalRCV(self, R, C, V, addv=None) -> None: * """Undocumented.""" * matsetvalues_rcv(self.mat, R, C, V, addv, 0, 1) # <<<<<<<<<<<<<< * * def setValuesLocalIJV( */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_matsetvalues_rcv(__pyx_v_self->mat, __pyx_v_R, __pyx_v_C, __pyx_v_V, __pyx_v_addv, 0, 1); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 2803, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":2801 * matsetvalues(self.mat, rows, cols, values, addv, 0, 1) * * def setValuesLocalRCV(self, R, C, V, addv=None) -> None: # <<<<<<<<<<<<<< * """Undocumented.""" * matsetvalues_rcv(self.mat, R, C, V, addv, 0, 1) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValuesLocalRCV", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":2805 * matsetvalues_rcv(self.mat, R, C, V, addv, 0, 1) * * def setValuesLocalIJV( # <<<<<<<<<<<<<< * self, * I: Sequence[int], */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_235setValuesLocalIJV(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_234setValuesLocalIJV, "Mat.setValuesLocalIJV(self, I: Sequence[int], J: Sequence[int], V: Sequence[Scalar], addv: InsertModeSpec = None, rowmap: Sequence[int] = None) -> None\nSet a subset of values stored in CSR format.\n\n Not collective.\n\n Parameters\n ----------\n I\n Row pointers.\n J\n Local column indices.\n V\n The scalar values.\n addv\n Insertion mode.\n rowmap\n Optional iterable indicating which row to insert.\n\n See Also\n --------\n petsc.MatSetValuesLocal\n\n \nSource code at petsc4py/PETSc/Mat.pyx:2805"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_235setValuesLocalIJV(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_I = 0; PyObject *__pyx_v_J = 0; PyObject *__pyx_v_V = 0; PyObject *__pyx_v_addv = 0; PyObject *__pyx_v_rowmap = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setValuesLocalIJV (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_I,&__pyx_n_s_J,&__pyx_n_s_V,&__pyx_n_s_addv,&__pyx_n_s_rowmap,0}; /* "petsc4py/PETSc/Mat.pyx":2810 * J: Sequence[int], * V: Sequence[Scalar], * addv: InsertModeSpec = None, # <<<<<<<<<<<<<< * rowmap: Sequence[int] = None, * ) -> None: */ values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Mat.pyx":2811 * V: Sequence[Scalar], * addv: InsertModeSpec = None, * rowmap: Sequence[int] = None, # <<<<<<<<<<<<<< * ) -> None: * """Set a subset of values stored in CSR format. */ values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_I)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2805, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_J)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2805, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setValuesLocalIJV", 0, 3, 5, 1); __PYX_ERR(46, 2805, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_V)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2805, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setValuesLocalIJV", 0, 3, 5, 2); __PYX_ERR(46, 2805, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_addv); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2805, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rowmap); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2805, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setValuesLocalIJV") < 0)) __PYX_ERR(46, 2805, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_I = values[0]; __pyx_v_J = values[1]; __pyx_v_V = values[2]; __pyx_v_addv = values[3]; __pyx_v_rowmap = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setValuesLocalIJV", 0, 3, 5, __pyx_nargs); __PYX_ERR(46, 2805, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValuesLocalIJV", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_234setValuesLocalIJV(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_I, __pyx_v_J, __pyx_v_V, __pyx_v_addv, __pyx_v_rowmap); /* "petsc4py/PETSc/Mat.pyx":2805 * matsetvalues_rcv(self.mat, R, C, V, addv, 0, 1) * * def setValuesLocalIJV( # <<<<<<<<<<<<<< * self, * I: Sequence[int], */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_234setValuesLocalIJV(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_I, PyObject *__pyx_v_J, PyObject *__pyx_v_V, PyObject *__pyx_v_addv, PyObject *__pyx_v_rowmap) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setValuesLocalIJV", 1); /* "petsc4py/PETSc/Mat.pyx":2835 * * """ * matsetvalues_ijv(self.mat, I, J, V, addv, rowmap, 0, 1) # <<<<<<<<<<<<<< * * def setValuesLocalCSR( */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_matsetvalues_ijv(__pyx_v_self->mat, __pyx_v_I, __pyx_v_J, __pyx_v_V, __pyx_v_addv, __pyx_v_rowmap, 0, 1); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 2835, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":2805 * matsetvalues_rcv(self.mat, R, C, V, addv, 0, 1) * * def setValuesLocalIJV( # <<<<<<<<<<<<<< * self, * I: Sequence[int], */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValuesLocalIJV", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":2837 * matsetvalues_ijv(self.mat, I, J, V, addv, rowmap, 0, 1) * * def setValuesLocalCSR( # <<<<<<<<<<<<<< * self, * I: Sequence[int], */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_237setValuesLocalCSR(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_236setValuesLocalCSR, "Mat.setValuesLocalCSR(self, I: Sequence[int], J: Sequence[int], V: Sequence[Scalar], addv: InsertModeSpec = None) -> None\nSet values stored in CSR format.\n\n Not collective.\n\n Parameters\n ----------\n I\n Row pointers.\n J\n Local column indices.\n V\n The scalar values.\n addv\n Insertion mode.\n\n See Also\n --------\n petsc.MatSetValuesLocal\n\n \nSource code at petsc4py/PETSc/Mat.pyx:2837"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_237setValuesLocalCSR(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_I = 0; PyObject *__pyx_v_J = 0; PyObject *__pyx_v_V = 0; PyObject *__pyx_v_addv = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setValuesLocalCSR (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_I,&__pyx_n_s_J,&__pyx_n_s_V,&__pyx_n_s_addv,0}; /* "petsc4py/PETSc/Mat.pyx":2842 * J: Sequence[int], * V: Sequence[Scalar], * addv: InsertModeSpec = None, # <<<<<<<<<<<<<< * ) -> None: * """Set values stored in CSR format. */ values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_I)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2837, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_J)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2837, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setValuesLocalCSR", 0, 3, 4, 1); __PYX_ERR(46, 2837, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_V)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2837, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setValuesLocalCSR", 0, 3, 4, 2); __PYX_ERR(46, 2837, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_addv); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2837, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setValuesLocalCSR") < 0)) __PYX_ERR(46, 2837, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_I = values[0]; __pyx_v_J = values[1]; __pyx_v_V = values[2]; __pyx_v_addv = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setValuesLocalCSR", 0, 3, 4, __pyx_nargs); __PYX_ERR(46, 2837, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValuesLocalCSR", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_236setValuesLocalCSR(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_I, __pyx_v_J, __pyx_v_V, __pyx_v_addv); /* "petsc4py/PETSc/Mat.pyx":2837 * matsetvalues_ijv(self.mat, I, J, V, addv, rowmap, 0, 1) * * def setValuesLocalCSR( # <<<<<<<<<<<<<< * self, * I: Sequence[int], */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_236setValuesLocalCSR(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_I, PyObject *__pyx_v_J, PyObject *__pyx_v_V, PyObject *__pyx_v_addv) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setValuesLocalCSR", 1); /* "petsc4py/PETSc/Mat.pyx":2864 * * """ * matsetvalues_csr(self.mat, I, J, V, addv, 0, 1) # <<<<<<<<<<<<<< * * def setValuesBlockedLocal( */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_matsetvalues_csr(__pyx_v_self->mat, __pyx_v_I, __pyx_v_J, __pyx_v_V, __pyx_v_addv, 0, 1); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 2864, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":2837 * matsetvalues_ijv(self.mat, I, J, V, addv, rowmap, 0, 1) * * def setValuesLocalCSR( # <<<<<<<<<<<<<< * self, * I: Sequence[int], */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValuesLocalCSR", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":2866 * matsetvalues_csr(self.mat, I, J, V, addv, 0, 1) * * def setValuesBlockedLocal( # <<<<<<<<<<<<<< * self, * rows: Sequence[int], */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_239setValuesBlockedLocal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_238setValuesBlockedLocal, "Mat.setValuesBlockedLocal(self, rows: Sequence[int], cols: Sequence[int], values: Sequence[Scalar], addv: InsertModeSpec = None) -> None\nSet values to the rows \342\212\227 col block entries of the matrix in local ordering.\n\n Not collective.\n\n Parameters\n ----------\n rows\n Local block row indices.\n cols\n Local block column indices.\n values\n The scalar values. A sequence of length at least\n ``len(rows) * len(cols) * bs * bs``,\n where ``bs`` is the block size of the matrix.\n addv\n Insertion mode.\n\n See Also\n --------\n petsc.MatSetValuesBlockedLocal\n\n \nSource code at petsc4py/PETSc/Mat.pyx:2866"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_239setValuesBlockedLocal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_rows = 0; PyObject *__pyx_v_cols = 0; PyObject *__pyx_v_values = 0; PyObject *__pyx_v_addv = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setValuesBlockedLocal (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rows,&__pyx_n_s_cols,&__pyx_n_s_values,&__pyx_n_s_addv,0}; /* "petsc4py/PETSc/Mat.pyx":2871 * cols: Sequence[int], * values: Sequence[Scalar], * addv: InsertModeSpec = None, # <<<<<<<<<<<<<< * ) -> None: * """Set values to the rows col block entries of the matrix in local ordering. */ values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rows)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2866, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_cols)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2866, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setValuesBlockedLocal", 0, 3, 4, 1); __PYX_ERR(46, 2866, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_values)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2866, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setValuesBlockedLocal", 0, 3, 4, 2); __PYX_ERR(46, 2866, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_addv); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2866, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setValuesBlockedLocal") < 0)) __PYX_ERR(46, 2866, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_rows = values[0]; __pyx_v_cols = values[1]; __pyx_v_values = values[2]; __pyx_v_addv = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setValuesBlockedLocal", 0, 3, 4, __pyx_nargs); __PYX_ERR(46, 2866, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValuesBlockedLocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_238setValuesBlockedLocal(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_rows, __pyx_v_cols, __pyx_v_values, __pyx_v_addv); /* "petsc4py/PETSc/Mat.pyx":2866 * matsetvalues_csr(self.mat, I, J, V, addv, 0, 1) * * def setValuesBlockedLocal( # <<<<<<<<<<<<<< * self, * rows: Sequence[int], */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_238setValuesBlockedLocal(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_rows, PyObject *__pyx_v_cols, PyObject *__pyx_v_values, PyObject *__pyx_v_addv) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setValuesBlockedLocal", 1); /* "petsc4py/PETSc/Mat.pyx":2895 * * """ * matsetvalues(self.mat, rows, cols, values, addv, 1, 1) # <<<<<<<<<<<<<< * * def setValuesBlockedLocalRCV(self, R, C, V, addv=None) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_matsetvalues(__pyx_v_self->mat, __pyx_v_rows, __pyx_v_cols, __pyx_v_values, __pyx_v_addv, 1, 1); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 2895, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":2866 * matsetvalues_csr(self.mat, I, J, V, addv, 0, 1) * * def setValuesBlockedLocal( # <<<<<<<<<<<<<< * self, * rows: Sequence[int], */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValuesBlockedLocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":2897 * matsetvalues(self.mat, rows, cols, values, addv, 1, 1) * * def setValuesBlockedLocalRCV(self, R, C, V, addv=None) -> None: # <<<<<<<<<<<<<< * """Undocumented.""" * matsetvalues_rcv(self.mat, R, C, V, addv, 1, 1) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_241setValuesBlockedLocalRCV(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_240setValuesBlockedLocalRCV, "Mat.setValuesBlockedLocalRCV(self, R, C, V, addv=None) -> None\nUndocumented.\nSource code at petsc4py/PETSc/Mat.pyx:2897"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_241setValuesBlockedLocalRCV(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_R = 0; PyObject *__pyx_v_C = 0; PyObject *__pyx_v_V = 0; PyObject *__pyx_v_addv = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setValuesBlockedLocalRCV (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_R,&__pyx_n_s_C,&__pyx_n_s_V,&__pyx_n_s_addv,0}; values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_R)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2897, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_C)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2897, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setValuesBlockedLocalRCV", 0, 3, 4, 1); __PYX_ERR(46, 2897, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_V)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2897, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setValuesBlockedLocalRCV", 0, 3, 4, 2); __PYX_ERR(46, 2897, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_addv); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2897, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setValuesBlockedLocalRCV") < 0)) __PYX_ERR(46, 2897, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_R = values[0]; __pyx_v_C = values[1]; __pyx_v_V = values[2]; __pyx_v_addv = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setValuesBlockedLocalRCV", 0, 3, 4, __pyx_nargs); __PYX_ERR(46, 2897, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValuesBlockedLocalRCV", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_240setValuesBlockedLocalRCV(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_R, __pyx_v_C, __pyx_v_V, __pyx_v_addv); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_240setValuesBlockedLocalRCV(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_R, PyObject *__pyx_v_C, PyObject *__pyx_v_V, PyObject *__pyx_v_addv) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setValuesBlockedLocalRCV", 1); /* "petsc4py/PETSc/Mat.pyx":2899 * def setValuesBlockedLocalRCV(self, R, C, V, addv=None) -> None: * """Undocumented.""" * matsetvalues_rcv(self.mat, R, C, V, addv, 1, 1) # <<<<<<<<<<<<<< * * def setValuesBlockedLocalIJV( */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_matsetvalues_rcv(__pyx_v_self->mat, __pyx_v_R, __pyx_v_C, __pyx_v_V, __pyx_v_addv, 1, 1); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 2899, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":2897 * matsetvalues(self.mat, rows, cols, values, addv, 1, 1) * * def setValuesBlockedLocalRCV(self, R, C, V, addv=None) -> None: # <<<<<<<<<<<<<< * """Undocumented.""" * matsetvalues_rcv(self.mat, R, C, V, addv, 1, 1) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValuesBlockedLocalRCV", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":2901 * matsetvalues_rcv(self.mat, R, C, V, addv, 1, 1) * * def setValuesBlockedLocalIJV( # <<<<<<<<<<<<<< * self, * I: Sequence[int], */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_243setValuesBlockedLocalIJV(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_242setValuesBlockedLocalIJV, "Mat.setValuesBlockedLocalIJV(self, I: Sequence[int], J: Sequence[int], V: Sequence[Scalar], addv: InsertModeSpec = None, rowmap: Sequence[int] = None) -> None\nSet a subset of values stored in block CSR format.\n\n Not collective.\n\n Parameters\n ----------\n I\n Block row pointers.\n J\n Local block column indices.\n V\n The scalar values.\n addv\n Insertion mode.\n rowmap\n Optional iterable indicating which block row to insert.\n\n See Also\n --------\n petsc.MatSetValuesBlockedLocal\n\n \nSource code at petsc4py/PETSc/Mat.pyx:2901"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_243setValuesBlockedLocalIJV(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_I = 0; PyObject *__pyx_v_J = 0; PyObject *__pyx_v_V = 0; PyObject *__pyx_v_addv = 0; PyObject *__pyx_v_rowmap = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setValuesBlockedLocalIJV (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_I,&__pyx_n_s_J,&__pyx_n_s_V,&__pyx_n_s_addv,&__pyx_n_s_rowmap,0}; /* "petsc4py/PETSc/Mat.pyx":2906 * J: Sequence[int], * V: Sequence[Scalar], * addv: InsertModeSpec = None, # <<<<<<<<<<<<<< * rowmap: Sequence[int] = None, * ) -> None: */ values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Mat.pyx":2907 * V: Sequence[Scalar], * addv: InsertModeSpec = None, * rowmap: Sequence[int] = None, # <<<<<<<<<<<<<< * ) -> None: * """Set a subset of values stored in block CSR format. */ values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_I)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2901, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_J)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2901, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setValuesBlockedLocalIJV", 0, 3, 5, 1); __PYX_ERR(46, 2901, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_V)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2901, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setValuesBlockedLocalIJV", 0, 3, 5, 2); __PYX_ERR(46, 2901, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_addv); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2901, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rowmap); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2901, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setValuesBlockedLocalIJV") < 0)) __PYX_ERR(46, 2901, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_I = values[0]; __pyx_v_J = values[1]; __pyx_v_V = values[2]; __pyx_v_addv = values[3]; __pyx_v_rowmap = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setValuesBlockedLocalIJV", 0, 3, 5, __pyx_nargs); __PYX_ERR(46, 2901, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValuesBlockedLocalIJV", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_242setValuesBlockedLocalIJV(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_I, __pyx_v_J, __pyx_v_V, __pyx_v_addv, __pyx_v_rowmap); /* "petsc4py/PETSc/Mat.pyx":2901 * matsetvalues_rcv(self.mat, R, C, V, addv, 1, 1) * * def setValuesBlockedLocalIJV( # <<<<<<<<<<<<<< * self, * I: Sequence[int], */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_242setValuesBlockedLocalIJV(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_I, PyObject *__pyx_v_J, PyObject *__pyx_v_V, PyObject *__pyx_v_addv, PyObject *__pyx_v_rowmap) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setValuesBlockedLocalIJV", 1); /* "petsc4py/PETSc/Mat.pyx":2931 * * """ * matsetvalues_ijv(self.mat, I, J, V, addv, rowmap, 1, 1) # <<<<<<<<<<<<<< * * def setValuesBlockedLocalCSR( */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_matsetvalues_ijv(__pyx_v_self->mat, __pyx_v_I, __pyx_v_J, __pyx_v_V, __pyx_v_addv, __pyx_v_rowmap, 1, 1); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 2931, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":2901 * matsetvalues_rcv(self.mat, R, C, V, addv, 1, 1) * * def setValuesBlockedLocalIJV( # <<<<<<<<<<<<<< * self, * I: Sequence[int], */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValuesBlockedLocalIJV", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":2933 * matsetvalues_ijv(self.mat, I, J, V, addv, rowmap, 1, 1) * * def setValuesBlockedLocalCSR( # <<<<<<<<<<<<<< * self, * I: Sequence[int], */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_245setValuesBlockedLocalCSR(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_244setValuesBlockedLocalCSR, "Mat.setValuesBlockedLocalCSR(self, I: Sequence[int], J: Sequence[int], V: Sequence[Scalar], addv: InsertModeSpec = None) -> None\nSet values stored in block CSR format.\n\n Not collective.\n\n Parameters\n ----------\n I\n Block row pointers.\n J\n Local block column indices.\n V\n The scalar values.\n addv\n Insertion mode.\n\n See Also\n --------\n petsc.MatSetValuesBlockedLocal\n\n \nSource code at petsc4py/PETSc/Mat.pyx:2933"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_245setValuesBlockedLocalCSR(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_I = 0; PyObject *__pyx_v_J = 0; PyObject *__pyx_v_V = 0; PyObject *__pyx_v_addv = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setValuesBlockedLocalCSR (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_I,&__pyx_n_s_J,&__pyx_n_s_V,&__pyx_n_s_addv,0}; /* "petsc4py/PETSc/Mat.pyx":2938 * J: Sequence[int], * V: Sequence[Scalar], * addv: InsertModeSpec = None, # <<<<<<<<<<<<<< * ) -> None: * """Set values stored in block CSR format. */ values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_I)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2933, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_J)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2933, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setValuesBlockedLocalCSR", 0, 3, 4, 1); __PYX_ERR(46, 2933, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_V)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2933, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setValuesBlockedLocalCSR", 0, 3, 4, 2); __PYX_ERR(46, 2933, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_addv); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2933, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setValuesBlockedLocalCSR") < 0)) __PYX_ERR(46, 2933, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_I = values[0]; __pyx_v_J = values[1]; __pyx_v_V = values[2]; __pyx_v_addv = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setValuesBlockedLocalCSR", 0, 3, 4, __pyx_nargs); __PYX_ERR(46, 2933, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValuesBlockedLocalCSR", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_244setValuesBlockedLocalCSR(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_I, __pyx_v_J, __pyx_v_V, __pyx_v_addv); /* "petsc4py/PETSc/Mat.pyx":2933 * matsetvalues_ijv(self.mat, I, J, V, addv, rowmap, 1, 1) * * def setValuesBlockedLocalCSR( # <<<<<<<<<<<<<< * self, * I: Sequence[int], */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_244setValuesBlockedLocalCSR(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_I, PyObject *__pyx_v_J, PyObject *__pyx_v_V, PyObject *__pyx_v_addv) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setValuesBlockedLocalCSR", 1); /* "petsc4py/PETSc/Mat.pyx":2960 * * """ * matsetvalues_csr(self.mat, I, J, V, addv, 1, 1) # <<<<<<<<<<<<<< * * # */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_matsetvalues_csr(__pyx_v_self->mat, __pyx_v_I, __pyx_v_J, __pyx_v_V, __pyx_v_addv, 1, 1); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 2960, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":2933 * matsetvalues_ijv(self.mat, I, J, V, addv, rowmap, 1, 1) * * def setValuesBlockedLocalCSR( # <<<<<<<<<<<<<< * self, * I: Sequence[int], */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValuesBlockedLocalCSR", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":2966 * Stencil = MatStencil * * def setStencil(self, dims: DimsSpec, starts: DimsSpec | None = None, dof: int = 1) -> None: # <<<<<<<<<<<<<< * """Set matrix stencil. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_247setStencil(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_246setStencil, "Mat.setStencil(self, dims: DimsSpec, starts: DimsSpec | None = None, dof: int = 1) -> None\nSet matrix stencil.\n\n Not collective.\n\n See Also\n --------\n petsc.MatSetStencil\n\n \nSource code at petsc4py/PETSc/Mat.pyx:2966"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_247setStencil(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_dims = 0; PyObject *__pyx_v_starts = 0; PyObject *__pyx_v_dof = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setStencil (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dims,&__pyx_n_s_starts,&__pyx_n_s_dof,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_1)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dims)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2966, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_starts); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2966, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dof); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2966, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setStencil") < 0)) __PYX_ERR(46, 2966, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_dims = values[0]; __pyx_v_starts = values[1]; __pyx_v_dof = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setStencil", 0, 1, 3, __pyx_nargs); __PYX_ERR(46, 2966, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.setStencil", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_246setStencil(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_dims, __pyx_v_starts, __pyx_v_dof); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_246setStencil(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_dims, PyObject *__pyx_v_starts, PyObject *__pyx_v_dof) { PetscInt __pyx_v_ndim; PetscInt __pyx_v_ndof; PetscInt __pyx_v_cdims[3]; PetscInt __pyx_v_cstarts[3]; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setStencil", 1); /* "petsc4py/PETSc/Mat.pyx":2978 * cdef PetscInt ndim, ndof * cdef PetscInt cdims[3], cstarts[3] * cdims[0] = cdims[1] = cdims[2] = 1 # <<<<<<<<<<<<<< * cstarts[0] = cstarts[1] = cstarts[2] = 0 * ndim = asDims(dims, &cdims[0], &cdims[1], &cdims[2]) */ (__pyx_v_cdims[0]) = 1; (__pyx_v_cdims[1]) = 1; (__pyx_v_cdims[2]) = 1; /* "petsc4py/PETSc/Mat.pyx":2979 * cdef PetscInt cdims[3], cstarts[3] * cdims[0] = cdims[1] = cdims[2] = 1 * cstarts[0] = cstarts[1] = cstarts[2] = 0 # <<<<<<<<<<<<<< * ndim = asDims(dims, &cdims[0], &cdims[1], &cdims[2]) * ndof = asInt(dof) */ (__pyx_v_cstarts[0]) = 0; (__pyx_v_cstarts[1]) = 0; (__pyx_v_cstarts[2]) = 0; /* "petsc4py/PETSc/Mat.pyx":2980 * cdims[0] = cdims[1] = cdims[2] = 1 * cstarts[0] = cstarts[1] = cstarts[2] = 0 * ndim = asDims(dims, &cdims[0], &cdims[1], &cdims[2]) # <<<<<<<<<<<<<< * ndof = asInt(dof) * if starts is not None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asDims(__pyx_v_dims, (&(__pyx_v_cdims[0])), (&(__pyx_v_cdims[1])), (&(__pyx_v_cdims[2]))); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(46, 2980, __pyx_L1_error) __pyx_v_ndim = __pyx_t_1; /* "petsc4py/PETSc/Mat.pyx":2981 * cstarts[0] = cstarts[1] = cstarts[2] = 0 * ndim = asDims(dims, &cdims[0], &cdims[1], &cdims[2]) * ndof = asInt(dof) # <<<<<<<<<<<<<< * if starts is not None: * asDims(dims, &cstarts[0], &cstarts[1], &cstarts[2]) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_dof); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(46, 2981, __pyx_L1_error) __pyx_v_ndof = __pyx_t_1; /* "petsc4py/PETSc/Mat.pyx":2982 * ndim = asDims(dims, &cdims[0], &cdims[1], &cdims[2]) * ndof = asInt(dof) * if starts is not None: # <<<<<<<<<<<<<< * asDims(dims, &cstarts[0], &cstarts[1], &cstarts[2]) * CHKERR( MatSetStencil(self.mat, ndim, cdims, cstarts, ndof) ) */ __pyx_t_2 = (__pyx_v_starts != Py_None); if (__pyx_t_2) { /* "petsc4py/PETSc/Mat.pyx":2983 * ndof = asInt(dof) * if starts is not None: * asDims(dims, &cstarts[0], &cstarts[1], &cstarts[2]) # <<<<<<<<<<<<<< * CHKERR( MatSetStencil(self.mat, ndim, cdims, cstarts, ndof) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asDims(__pyx_v_dims, (&(__pyx_v_cstarts[0])), (&(__pyx_v_cstarts[1])), (&(__pyx_v_cstarts[2]))); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(46, 2983, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":2982 * ndim = asDims(dims, &cdims[0], &cdims[1], &cdims[2]) * ndof = asInt(dof) * if starts is not None: # <<<<<<<<<<<<<< * asDims(dims, &cstarts[0], &cstarts[1], &cstarts[2]) * CHKERR( MatSetStencil(self.mat, ndim, cdims, cstarts, ndof) ) */ } /* "petsc4py/PETSc/Mat.pyx":2984 * if starts is not None: * asDims(dims, &cstarts[0], &cstarts[1], &cstarts[2]) * CHKERR( MatSetStencil(self.mat, ndim, cdims, cstarts, ndof) ) # <<<<<<<<<<<<<< * * def setValueStencil( */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSetStencil(__pyx_v_self->mat, __pyx_v_ndim, __pyx_v_cdims, __pyx_v_cstarts, __pyx_v_ndof)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 2984, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":2966 * Stencil = MatStencil * * def setStencil(self, dims: DimsSpec, starts: DimsSpec | None = None, dof: int = 1) -> None: # <<<<<<<<<<<<<< * """Set matrix stencil. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setStencil", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":2986 * CHKERR( MatSetStencil(self.mat, ndim, cdims, cstarts, ndof) ) * * def setValueStencil( # <<<<<<<<<<<<<< * self, * MatStencil row: Stencil, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_249setValueStencil(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_248setValueStencil, "Mat.setValueStencil(self, row: Stencil, col: Stencil, value: Sequence[Scalar], addv: InsertModeSpec = None) -> None\nSet a value to row and col stencil.\n\n Not collective.\n\n Parameters\n ----------\n row\n Row stencil.\n col\n Column stencil.\n value\n The scalar values.\n addv\n Insertion mode.\n\n See Also\n --------\n petsc.MatSetValuesStencil\n\n \nSource code at petsc4py/PETSc/Mat.pyx:2986"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_249setValueStencil(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_8petsc4py_5PETSc_MatStencil *__pyx_v_row = 0; struct __pyx_obj_8petsc4py_5PETSc_MatStencil *__pyx_v_col = 0; PyObject *__pyx_v_value = 0; PyObject *__pyx_v_addv = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setValueStencil (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_row,&__pyx_n_s_col,&__pyx_n_s_value,&__pyx_n_s_addv,0}; /* "petsc4py/PETSc/Mat.pyx":2991 * MatStencil col: Stencil, * value: Sequence[Scalar], * addv: InsertModeSpec = None, # <<<<<<<<<<<<<< * ) -> None: * """Set a value to row and col stencil. */ values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_row)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2986, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_col)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2986, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setValueStencil", 0, 3, 4, 1); __PYX_ERR(46, 2986, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2986, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setValueStencil", 0, 3, 4, 2); __PYX_ERR(46, 2986, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_addv); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2986, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setValueStencil") < 0)) __PYX_ERR(46, 2986, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_row = ((struct __pyx_obj_8petsc4py_5PETSc_MatStencil *)values[0]); __pyx_v_col = ((struct __pyx_obj_8petsc4py_5PETSc_MatStencil *)values[1]); __pyx_v_value = values[2]; __pyx_v_addv = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setValueStencil", 0, 3, 4, __pyx_nargs); __PYX_ERR(46, 2986, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValueStencil", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_row), __pyx_ptype_8petsc4py_5PETSc_MatStencil, 0, "row", 0))) __PYX_ERR(46, 2988, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_col), __pyx_ptype_8petsc4py_5PETSc_MatStencil, 0, "col", 0))) __PYX_ERR(46, 2989, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_248setValueStencil(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_row, __pyx_v_col, __pyx_v_value, __pyx_v_addv); /* "petsc4py/PETSc/Mat.pyx":2986 * CHKERR( MatSetStencil(self.mat, ndim, cdims, cstarts, ndof) ) * * def setValueStencil( # <<<<<<<<<<<<<< * self, * MatStencil row: Stencil, */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_248setValueStencil(struct PyPetscMatObject *__pyx_v_self, struct __pyx_obj_8petsc4py_5PETSc_MatStencil *__pyx_v_row, struct __pyx_obj_8petsc4py_5PETSc_MatStencil *__pyx_v_col, PyObject *__pyx_v_value, PyObject *__pyx_v_addv) { struct __pyx_obj_8petsc4py_5PETSc_MatStencil *__pyx_v_r = 0; struct __pyx_obj_8petsc4py_5PETSc_MatStencil *__pyx_v_c = 0; InsertMode __pyx_v_im; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations InsertMode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setValueStencil", 1); /* "petsc4py/PETSc/Mat.pyx":3013 * * """ * cdef MatStencil r = row, c = col # <<<<<<<<<<<<<< * cdef PetscInsertMode im = insertmode(addv) * matsetvaluestencil(self.mat, r, c, value, im, 0) */ __Pyx_INCREF((PyObject *)__pyx_v_row); __pyx_v_r = __pyx_v_row; __Pyx_INCREF((PyObject *)__pyx_v_col); __pyx_v_c = __pyx_v_col; /* "petsc4py/PETSc/Mat.pyx":3014 * """ * cdef MatStencil r = row, c = col * cdef PetscInsertMode im = insertmode(addv) # <<<<<<<<<<<<<< * matsetvaluestencil(self.mat, r, c, value, im, 0) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_insertmode(__pyx_v_addv); if (unlikely(__pyx_t_1 == ((InsertMode)((InsertMode)-1L)))) __PYX_ERR(46, 3014, __pyx_L1_error) __pyx_v_im = __pyx_t_1; /* "petsc4py/PETSc/Mat.pyx":3015 * cdef MatStencil r = row, c = col * cdef PetscInsertMode im = insertmode(addv) * matsetvaluestencil(self.mat, r, c, value, im, 0) # <<<<<<<<<<<<<< * * def setValueStagStencil(self, row, col, value, addv=None) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_matsetvaluestencil(__pyx_v_self->mat, __pyx_v_r, __pyx_v_c, __pyx_v_value, __pyx_v_im, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 3015, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/Mat.pyx":2986 * CHKERR( MatSetStencil(self.mat, ndim, cdims, cstarts, ndof) ) * * def setValueStencil( # <<<<<<<<<<<<<< * self, * MatStencil row: Stencil, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValueStencil", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_r); __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":3017 * matsetvaluestencil(self.mat, r, c, value, im, 0) * * def setValueStagStencil(self, row, col, value, addv=None) -> None: # <<<<<<<<<<<<<< * """Not implemented.""" * raise NotImplementedError */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_251setValueStagStencil(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_250setValueStagStencil, "Mat.setValueStagStencil(self, row, col, value, addv=None) -> None\nNot implemented.\nSource code at petsc4py/PETSc/Mat.pyx:3017"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_251setValueStagStencil(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v_row = 0; CYTHON_UNUSED PyObject *__pyx_v_col = 0; CYTHON_UNUSED PyObject *__pyx_v_value = 0; CYTHON_UNUSED PyObject *__pyx_v_addv = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setValueStagStencil (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_row,&__pyx_n_s_col,&__pyx_n_s_value,&__pyx_n_s_addv,0}; values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_row)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3017, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_col)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3017, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setValueStagStencil", 0, 3, 4, 1); __PYX_ERR(46, 3017, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3017, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setValueStagStencil", 0, 3, 4, 2); __PYX_ERR(46, 3017, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_addv); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3017, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setValueStagStencil") < 0)) __PYX_ERR(46, 3017, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_row = values[0]; __pyx_v_col = values[1]; __pyx_v_value = values[2]; __pyx_v_addv = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setValueStagStencil", 0, 3, 4, __pyx_nargs); __PYX_ERR(46, 3017, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValueStagStencil", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_250setValueStagStencil(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_row, __pyx_v_col, __pyx_v_value, __pyx_v_addv); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_250setValueStagStencil(CYTHON_UNUSED struct PyPetscMatObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_row, CYTHON_UNUSED PyObject *__pyx_v_col, CYTHON_UNUSED PyObject *__pyx_v_value, CYTHON_UNUSED PyObject *__pyx_v_addv) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setValueStagStencil", 1); /* "petsc4py/PETSc/Mat.pyx":3019 * def setValueStagStencil(self, row, col, value, addv=None) -> None: * """Not implemented.""" * raise NotImplementedError # <<<<<<<<<<<<<< * * def setValueBlockedStencil( */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); __PYX_ERR(46, 3019, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":3017 * matsetvaluestencil(self.mat, r, c, value, im, 0) * * def setValueStagStencil(self, row, col, value, addv=None) -> None: # <<<<<<<<<<<<<< * """Not implemented.""" * raise NotImplementedError */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValueStagStencil", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":3021 * raise NotImplementedError * * def setValueBlockedStencil( # <<<<<<<<<<<<<< * self, * row: Stencil, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_253setValueBlockedStencil(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_252setValueBlockedStencil, "Mat.setValueBlockedStencil(self, row: Stencil, col: Stencil, value: Sequence[Scalar], addv: InsertModeSpec = None) -> None\nSet a block of values to row and col stencil.\n\n Not collective.\n\n Parameters\n ----------\n row\n Row stencil.\n col\n Column stencil.\n value\n The scalar values.\n addv\n Insertion mode.\n\n See Also\n --------\n petsc.MatSetValuesBlockedStencil\n\n \nSource code at petsc4py/PETSc/Mat.pyx:3021"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_253setValueBlockedStencil(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_row = 0; PyObject *__pyx_v_col = 0; PyObject *__pyx_v_value = 0; PyObject *__pyx_v_addv = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setValueBlockedStencil (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_row,&__pyx_n_s_col,&__pyx_n_s_value,&__pyx_n_s_addv,0}; /* "petsc4py/PETSc/Mat.pyx":3026 * col: Stencil, * value: Sequence[Scalar], * addv: InsertModeSpec = None, # <<<<<<<<<<<<<< * ) -> None: * """Set a block of values to row and col stencil. */ values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_row)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3021, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_col)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3021, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setValueBlockedStencil", 0, 3, 4, 1); __PYX_ERR(46, 3021, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3021, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setValueBlockedStencil", 0, 3, 4, 2); __PYX_ERR(46, 3021, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_addv); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3021, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setValueBlockedStencil") < 0)) __PYX_ERR(46, 3021, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_row = values[0]; __pyx_v_col = values[1]; __pyx_v_value = values[2]; __pyx_v_addv = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setValueBlockedStencil", 0, 3, 4, __pyx_nargs); __PYX_ERR(46, 3021, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValueBlockedStencil", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_252setValueBlockedStencil(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_row, __pyx_v_col, __pyx_v_value, __pyx_v_addv); /* "petsc4py/PETSc/Mat.pyx":3021 * raise NotImplementedError * * def setValueBlockedStencil( # <<<<<<<<<<<<<< * self, * row: Stencil, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_252setValueBlockedStencil(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_row, PyObject *__pyx_v_col, PyObject *__pyx_v_value, PyObject *__pyx_v_addv) { struct __pyx_obj_8petsc4py_5PETSc_MatStencil *__pyx_v_r = 0; struct __pyx_obj_8petsc4py_5PETSc_MatStencil *__pyx_v_c = 0; InsertMode __pyx_v_im; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; InsertMode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setValueBlockedStencil", 1); /* "petsc4py/PETSc/Mat.pyx":3048 * * """ * cdef MatStencil r = row, c = col # <<<<<<<<<<<<<< * cdef PetscInsertMode im = insertmode(addv) * matsetvaluestencil(self.mat, r, c, value, im, 1) */ if (!(likely(((__pyx_v_row) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_row, __pyx_ptype_8petsc4py_5PETSc_MatStencil))))) __PYX_ERR(46, 3048, __pyx_L1_error) __pyx_t_1 = __pyx_v_row; __Pyx_INCREF(__pyx_t_1); __pyx_v_r = ((struct __pyx_obj_8petsc4py_5PETSc_MatStencil *)__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_v_col) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_col, __pyx_ptype_8petsc4py_5PETSc_MatStencil))))) __PYX_ERR(46, 3048, __pyx_L1_error) __pyx_t_1 = __pyx_v_col; __Pyx_INCREF(__pyx_t_1); __pyx_v_c = ((struct __pyx_obj_8petsc4py_5PETSc_MatStencil *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Mat.pyx":3049 * """ * cdef MatStencil r = row, c = col * cdef PetscInsertMode im = insertmode(addv) # <<<<<<<<<<<<<< * matsetvaluestencil(self.mat, r, c, value, im, 1) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_insertmode(__pyx_v_addv); if (unlikely(__pyx_t_2 == ((InsertMode)((InsertMode)-1L)))) __PYX_ERR(46, 3049, __pyx_L1_error) __pyx_v_im = __pyx_t_2; /* "petsc4py/PETSc/Mat.pyx":3050 * cdef MatStencil r = row, c = col * cdef PetscInsertMode im = insertmode(addv) * matsetvaluestencil(self.mat, r, c, value, im, 1) # <<<<<<<<<<<<<< * * def setValueBlockedStagStencil(self, row, col, value, addv=None) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_matsetvaluestencil(__pyx_v_self->mat, __pyx_v_r, __pyx_v_c, __pyx_v_value, __pyx_v_im, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 3050, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Mat.pyx":3021 * raise NotImplementedError * * def setValueBlockedStencil( # <<<<<<<<<<<<<< * self, * row: Stencil, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValueBlockedStencil", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_r); __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":3052 * matsetvaluestencil(self.mat, r, c, value, im, 1) * * def setValueBlockedStagStencil(self, row, col, value, addv=None) -> None: # <<<<<<<<<<<<<< * """Not implemented.""" * raise NotImplementedError */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_255setValueBlockedStagStencil(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_254setValueBlockedStagStencil, "Mat.setValueBlockedStagStencil(self, row, col, value, addv=None) -> None\nNot implemented.\nSource code at petsc4py/PETSc/Mat.pyx:3052"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_255setValueBlockedStagStencil(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v_row = 0; CYTHON_UNUSED PyObject *__pyx_v_col = 0; CYTHON_UNUSED PyObject *__pyx_v_value = 0; CYTHON_UNUSED PyObject *__pyx_v_addv = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setValueBlockedStagStencil (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_row,&__pyx_n_s_col,&__pyx_n_s_value,&__pyx_n_s_addv,0}; values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_row)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3052, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_col)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3052, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setValueBlockedStagStencil", 0, 3, 4, 1); __PYX_ERR(46, 3052, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3052, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setValueBlockedStagStencil", 0, 3, 4, 2); __PYX_ERR(46, 3052, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_addv); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3052, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setValueBlockedStagStencil") < 0)) __PYX_ERR(46, 3052, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_row = values[0]; __pyx_v_col = values[1]; __pyx_v_value = values[2]; __pyx_v_addv = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setValueBlockedStagStencil", 0, 3, 4, __pyx_nargs); __PYX_ERR(46, 3052, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValueBlockedStagStencil", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_254setValueBlockedStagStencil(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_row, __pyx_v_col, __pyx_v_value, __pyx_v_addv); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_254setValueBlockedStagStencil(CYTHON_UNUSED struct PyPetscMatObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_row, CYTHON_UNUSED PyObject *__pyx_v_col, CYTHON_UNUSED PyObject *__pyx_v_value, CYTHON_UNUSED PyObject *__pyx_v_addv) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setValueBlockedStagStencil", 1); /* "petsc4py/PETSc/Mat.pyx":3054 * def setValueBlockedStagStencil(self, row, col, value, addv=None) -> None: * """Not implemented.""" * raise NotImplementedError # <<<<<<<<<<<<<< * * def zeroRows(self, rows: IS | Sequence[int], diag: Scalar = 1, Vec x=None, Vec b=None) -> None: */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); __PYX_ERR(46, 3054, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":3052 * matsetvaluestencil(self.mat, r, c, value, im, 1) * * def setValueBlockedStagStencil(self, row, col, value, addv=None) -> None: # <<<<<<<<<<<<<< * """Not implemented.""" * raise NotImplementedError */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValueBlockedStagStencil", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":3056 * raise NotImplementedError * * def zeroRows(self, rows: IS | Sequence[int], diag: Scalar = 1, Vec x=None, Vec b=None) -> None: # <<<<<<<<<<<<<< * """Zero selected rows of the matrix. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_257zeroRows(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_256zeroRows, "Mat.zeroRows(self, rows: IS | Sequence[int], diag: Scalar = 1, x: Vec | None = None, b: Vec | None = None) -> None\nZero selected rows of the matrix.\n\n Collective.\n\n Parameters\n ----------\n rows\n Row indices to be zeroed.\n diag\n Scalar value to be inserted into the diagonal.\n x\n Optional solution vector to be modified for zeroed rows.\n b\n Optional right-hand side vector to be modified.\n It will be adjusted with provided solution entries.\n\n See Also\n --------\n zeroRowsLocal, petsc.MatZeroRows, petsc.MatZeroRowsIS\n\n \nSource code at petsc4py/PETSc/Mat.pyx:3056"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_257zeroRows(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_rows = 0; PyObject *__pyx_v_diag = 0; struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_b = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("zeroRows (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rows,&__pyx_n_s_diag,&__pyx_n_s_x,&__pyx_n_s_b,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_1)); values[2] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscVecObject *)Py_None)); values[3] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscVecObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rows)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3056, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_diag); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3056, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3056, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_b); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3056, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "zeroRows") < 0)) __PYX_ERR(46, 3056, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_rows = values[0]; __pyx_v_diag = values[1]; __pyx_v_x = ((struct PyPetscVecObject *)values[2]); __pyx_v_b = ((struct PyPetscVecObject *)values[3]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("zeroRows", 0, 1, 4, __pyx_nargs); __PYX_ERR(46, 3056, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.zeroRows", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "x", 0))) __PYX_ERR(46, 3056, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "b", 0))) __PYX_ERR(46, 3056, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_256zeroRows(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_rows, __pyx_v_diag, __pyx_v_x, __pyx_v_b); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_256zeroRows(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_rows, PyObject *__pyx_v_diag, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_b) { PetscInt __pyx_v_ni; PetscInt *__pyx_v_i; PetscScalar __pyx_v_sval; Vec __pyx_v_xvec; Vec __pyx_v_bvec; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscScalar __pyx_t_1; int __pyx_t_2; Vec __pyx_t_3; PetscErrorCode __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("zeroRows", 0); __Pyx_INCREF(__pyx_v_rows); /* "petsc4py/PETSc/Mat.pyx":3078 * * """ * cdef PetscInt ni=0, *i=NULL # <<<<<<<<<<<<<< * cdef PetscScalar sval = asScalar(diag) * cdef PetscVec xvec=NULL, bvec=NULL */ __pyx_v_ni = 0; __pyx_v_i = NULL; /* "petsc4py/PETSc/Mat.pyx":3079 * """ * cdef PetscInt ni=0, *i=NULL * cdef PetscScalar sval = asScalar(diag) # <<<<<<<<<<<<<< * cdef PetscVec xvec=NULL, bvec=NULL * if x is not None: xvec = x.vec */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_diag); if (unlikely(__pyx_t_1 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(46, 3079, __pyx_L1_error) __pyx_v_sval = __pyx_t_1; /* "petsc4py/PETSc/Mat.pyx":3080 * cdef PetscInt ni=0, *i=NULL * cdef PetscScalar sval = asScalar(diag) * cdef PetscVec xvec=NULL, bvec=NULL # <<<<<<<<<<<<<< * if x is not None: xvec = x.vec * if b is not None: bvec = b.vec */ __pyx_v_xvec = NULL; __pyx_v_bvec = NULL; /* "petsc4py/PETSc/Mat.pyx":3081 * cdef PetscScalar sval = asScalar(diag) * cdef PetscVec xvec=NULL, bvec=NULL * if x is not None: xvec = x.vec # <<<<<<<<<<<<<< * if b is not None: bvec = b.vec * if isinstance(rows, IS): */ __pyx_t_2 = (((PyObject *)__pyx_v_x) != Py_None); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_x->vec; __pyx_v_xvec = __pyx_t_3; } /* "petsc4py/PETSc/Mat.pyx":3082 * cdef PetscVec xvec=NULL, bvec=NULL * if x is not None: xvec = x.vec * if b is not None: bvec = b.vec # <<<<<<<<<<<<<< * if isinstance(rows, IS): * CHKERR( MatZeroRowsIS(self.mat, (rows).iset, sval, xvec, bvec) ) */ __pyx_t_2 = (((PyObject *)__pyx_v_b) != Py_None); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_b->vec; __pyx_v_bvec = __pyx_t_3; } /* "petsc4py/PETSc/Mat.pyx":3083 * if x is not None: xvec = x.vec * if b is not None: bvec = b.vec * if isinstance(rows, IS): # <<<<<<<<<<<<<< * CHKERR( MatZeroRowsIS(self.mat, (rows).iset, sval, xvec, bvec) ) * else: */ __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_rows, __pyx_ptype_8petsc4py_5PETSc_IS); if (__pyx_t_2) { /* "petsc4py/PETSc/Mat.pyx":3084 * if b is not None: bvec = b.vec * if isinstance(rows, IS): * CHKERR( MatZeroRowsIS(self.mat, (rows).iset, sval, xvec, bvec) ) # <<<<<<<<<<<<<< * else: * rows = iarray_i(rows, &ni, &i) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatZeroRowsIS(__pyx_v_self->mat, ((struct PyPetscISObject *)__pyx_v_rows)->iset, __pyx_v_sval, __pyx_v_xvec, __pyx_v_bvec)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3084, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":3083 * if x is not None: xvec = x.vec * if b is not None: bvec = b.vec * if isinstance(rows, IS): # <<<<<<<<<<<<<< * CHKERR( MatZeroRowsIS(self.mat, (rows).iset, sval, xvec, bvec) ) * else: */ goto __pyx_L5; } /* "petsc4py/PETSc/Mat.pyx":3086 * CHKERR( MatZeroRowsIS(self.mat, (rows).iset, sval, xvec, bvec) ) * else: * rows = iarray_i(rows, &ni, &i) # <<<<<<<<<<<<<< * CHKERR( MatZeroRows(self.mat, ni, i, sval, xvec, bvec) ) * */ /*else*/ { __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_rows, (&__pyx_v_ni), (&__pyx_v_i))); if (unlikely(!__pyx_t_5)) __PYX_ERR(46, 3086, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_rows, __pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/Mat.pyx":3087 * else: * rows = iarray_i(rows, &ni, &i) * CHKERR( MatZeroRows(self.mat, ni, i, sval, xvec, bvec) ) # <<<<<<<<<<<<<< * * def zeroRowsLocal(self, rows: IS | Sequence[int], diag: Scalar = 1, Vec x=None, Vec b=None) -> None: */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatZeroRows(__pyx_v_self->mat, __pyx_v_ni, __pyx_v_i, __pyx_v_sval, __pyx_v_xvec, __pyx_v_bvec)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3087, __pyx_L1_error) } __pyx_L5:; /* "petsc4py/PETSc/Mat.pyx":3056 * raise NotImplementedError * * def zeroRows(self, rows: IS | Sequence[int], diag: Scalar = 1, Vec x=None, Vec b=None) -> None: # <<<<<<<<<<<<<< * """Zero selected rows of the matrix. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.Mat.zeroRows", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rows); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":3089 * CHKERR( MatZeroRows(self.mat, ni, i, sval, xvec, bvec) ) * * def zeroRowsLocal(self, rows: IS | Sequence[int], diag: Scalar = 1, Vec x=None, Vec b=None) -> None: # <<<<<<<<<<<<<< * """Zero selected rows of the matrix in local ordering. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_259zeroRowsLocal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_258zeroRowsLocal, "Mat.zeroRowsLocal(self, rows: IS | Sequence[int], diag: Scalar = 1, x: Vec | None = None, b: Vec | None = None) -> None\nZero selected rows of the matrix in local ordering.\n\n Collective.\n\n Parameters\n ----------\n rows\n Local row indices to be zeroed.\n diag\n Scalar value to be inserted into the diagonal.\n x\n Optional solution vector to be modified for zeroed rows.\n b\n Optional right-hand side vector to be modified.\n It will be adjusted with provided solution entries.\n\n See Also\n --------\n zeroRows, petsc.MatZeroRowsLocal, petsc.MatZeroRowsLocalIS\n\n \nSource code at petsc4py/PETSc/Mat.pyx:3089"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_259zeroRowsLocal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_rows = 0; PyObject *__pyx_v_diag = 0; struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_b = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("zeroRowsLocal (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rows,&__pyx_n_s_diag,&__pyx_n_s_x,&__pyx_n_s_b,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_1)); values[2] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscVecObject *)Py_None)); values[3] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscVecObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rows)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3089, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_diag); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3089, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3089, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_b); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3089, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "zeroRowsLocal") < 0)) __PYX_ERR(46, 3089, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_rows = values[0]; __pyx_v_diag = values[1]; __pyx_v_x = ((struct PyPetscVecObject *)values[2]); __pyx_v_b = ((struct PyPetscVecObject *)values[3]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("zeroRowsLocal", 0, 1, 4, __pyx_nargs); __PYX_ERR(46, 3089, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.zeroRowsLocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "x", 0))) __PYX_ERR(46, 3089, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "b", 0))) __PYX_ERR(46, 3089, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_258zeroRowsLocal(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_rows, __pyx_v_diag, __pyx_v_x, __pyx_v_b); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_258zeroRowsLocal(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_rows, PyObject *__pyx_v_diag, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_b) { PetscInt __pyx_v_ni; PetscInt *__pyx_v_i; PetscScalar __pyx_v_sval; Vec __pyx_v_xvec; Vec __pyx_v_bvec; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscScalar __pyx_t_1; int __pyx_t_2; Vec __pyx_t_3; PetscErrorCode __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("zeroRowsLocal", 0); __Pyx_INCREF(__pyx_v_rows); /* "petsc4py/PETSc/Mat.pyx":3111 * * """ * cdef PetscInt ni=0, *i=NULL # <<<<<<<<<<<<<< * cdef PetscScalar sval = asScalar(diag) * cdef PetscVec xvec=NULL, bvec=NULL */ __pyx_v_ni = 0; __pyx_v_i = NULL; /* "petsc4py/PETSc/Mat.pyx":3112 * """ * cdef PetscInt ni=0, *i=NULL * cdef PetscScalar sval = asScalar(diag) # <<<<<<<<<<<<<< * cdef PetscVec xvec=NULL, bvec=NULL * if x is not None: xvec = x.vec */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_diag); if (unlikely(__pyx_t_1 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(46, 3112, __pyx_L1_error) __pyx_v_sval = __pyx_t_1; /* "petsc4py/PETSc/Mat.pyx":3113 * cdef PetscInt ni=0, *i=NULL * cdef PetscScalar sval = asScalar(diag) * cdef PetscVec xvec=NULL, bvec=NULL # <<<<<<<<<<<<<< * if x is not None: xvec = x.vec * if b is not None: bvec = b.vec */ __pyx_v_xvec = NULL; __pyx_v_bvec = NULL; /* "petsc4py/PETSc/Mat.pyx":3114 * cdef PetscScalar sval = asScalar(diag) * cdef PetscVec xvec=NULL, bvec=NULL * if x is not None: xvec = x.vec # <<<<<<<<<<<<<< * if b is not None: bvec = b.vec * if isinstance(rows, IS): */ __pyx_t_2 = (((PyObject *)__pyx_v_x) != Py_None); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_x->vec; __pyx_v_xvec = __pyx_t_3; } /* "petsc4py/PETSc/Mat.pyx":3115 * cdef PetscVec xvec=NULL, bvec=NULL * if x is not None: xvec = x.vec * if b is not None: bvec = b.vec # <<<<<<<<<<<<<< * if isinstance(rows, IS): * CHKERR( MatZeroRowsLocalIS(self.mat, (rows).iset, sval, xvec, bvec) ) */ __pyx_t_2 = (((PyObject *)__pyx_v_b) != Py_None); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_b->vec; __pyx_v_bvec = __pyx_t_3; } /* "petsc4py/PETSc/Mat.pyx":3116 * if x is not None: xvec = x.vec * if b is not None: bvec = b.vec * if isinstance(rows, IS): # <<<<<<<<<<<<<< * CHKERR( MatZeroRowsLocalIS(self.mat, (rows).iset, sval, xvec, bvec) ) * else: */ __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_rows, __pyx_ptype_8petsc4py_5PETSc_IS); if (__pyx_t_2) { /* "petsc4py/PETSc/Mat.pyx":3117 * if b is not None: bvec = b.vec * if isinstance(rows, IS): * CHKERR( MatZeroRowsLocalIS(self.mat, (rows).iset, sval, xvec, bvec) ) # <<<<<<<<<<<<<< * else: * rows = iarray_i(rows, &ni, &i) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatZeroRowsLocalIS(__pyx_v_self->mat, ((struct PyPetscISObject *)__pyx_v_rows)->iset, __pyx_v_sval, __pyx_v_xvec, __pyx_v_bvec)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3117, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":3116 * if x is not None: xvec = x.vec * if b is not None: bvec = b.vec * if isinstance(rows, IS): # <<<<<<<<<<<<<< * CHKERR( MatZeroRowsLocalIS(self.mat, (rows).iset, sval, xvec, bvec) ) * else: */ goto __pyx_L5; } /* "petsc4py/PETSc/Mat.pyx":3119 * CHKERR( MatZeroRowsLocalIS(self.mat, (rows).iset, sval, xvec, bvec) ) * else: * rows = iarray_i(rows, &ni, &i) # <<<<<<<<<<<<<< * CHKERR( MatZeroRowsLocal(self.mat, ni, i, sval, xvec, bvec) ) * */ /*else*/ { __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_rows, (&__pyx_v_ni), (&__pyx_v_i))); if (unlikely(!__pyx_t_5)) __PYX_ERR(46, 3119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_rows, __pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/Mat.pyx":3120 * else: * rows = iarray_i(rows, &ni, &i) * CHKERR( MatZeroRowsLocal(self.mat, ni, i, sval, xvec, bvec) ) # <<<<<<<<<<<<<< * * def zeroRowsColumns(self, rows: IS | Sequence[int], diag: Scalar = 1, Vec x=None, Vec b=None) -> None: */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatZeroRowsLocal(__pyx_v_self->mat, __pyx_v_ni, __pyx_v_i, __pyx_v_sval, __pyx_v_xvec, __pyx_v_bvec)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3120, __pyx_L1_error) } __pyx_L5:; /* "petsc4py/PETSc/Mat.pyx":3089 * CHKERR( MatZeroRows(self.mat, ni, i, sval, xvec, bvec) ) * * def zeroRowsLocal(self, rows: IS | Sequence[int], diag: Scalar = 1, Vec x=None, Vec b=None) -> None: # <<<<<<<<<<<<<< * """Zero selected rows of the matrix in local ordering. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.Mat.zeroRowsLocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rows); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":3122 * CHKERR( MatZeroRowsLocal(self.mat, ni, i, sval, xvec, bvec) ) * * def zeroRowsColumns(self, rows: IS | Sequence[int], diag: Scalar = 1, Vec x=None, Vec b=None) -> None: # <<<<<<<<<<<<<< * """Zero selected rows and columns of the matrix. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_261zeroRowsColumns(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_260zeroRowsColumns, "Mat.zeroRowsColumns(self, rows: IS | Sequence[int], diag: Scalar = 1, x: Vec | None = None, b: Vec | None = None) -> None\nZero selected rows and columns of the matrix.\n\n Collective.\n\n Parameters\n ----------\n rows\n Row/column indices to be zeroed.\n diag\n Scalar value to be inserted into the diagonal.\n x\n Optional solution vector to be modified for zeroed rows.\n b\n Optional right-hand side vector to be modified.\n It will be adjusted with provided solution entries.\n\n See Also\n --------\n zeroRowsColumnsLocal, zeroRows, petsc.MatZeroRowsColumns\n petsc.MatZeroRowsColumnsIS\n\n \nSource code at petsc4py/PETSc/Mat.pyx:3122"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_261zeroRowsColumns(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_rows = 0; PyObject *__pyx_v_diag = 0; struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_b = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("zeroRowsColumns (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rows,&__pyx_n_s_diag,&__pyx_n_s_x,&__pyx_n_s_b,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_1)); values[2] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscVecObject *)Py_None)); values[3] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscVecObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rows)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3122, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_diag); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3122, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3122, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_b); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3122, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "zeroRowsColumns") < 0)) __PYX_ERR(46, 3122, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_rows = values[0]; __pyx_v_diag = values[1]; __pyx_v_x = ((struct PyPetscVecObject *)values[2]); __pyx_v_b = ((struct PyPetscVecObject *)values[3]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("zeroRowsColumns", 0, 1, 4, __pyx_nargs); __PYX_ERR(46, 3122, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.zeroRowsColumns", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "x", 0))) __PYX_ERR(46, 3122, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "b", 0))) __PYX_ERR(46, 3122, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_260zeroRowsColumns(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_rows, __pyx_v_diag, __pyx_v_x, __pyx_v_b); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_260zeroRowsColumns(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_rows, PyObject *__pyx_v_diag, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_b) { PetscInt __pyx_v_ni; PetscInt *__pyx_v_i; PetscScalar __pyx_v_sval; Vec __pyx_v_xvec; Vec __pyx_v_bvec; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscScalar __pyx_t_1; int __pyx_t_2; Vec __pyx_t_3; PetscErrorCode __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("zeroRowsColumns", 0); __Pyx_INCREF(__pyx_v_rows); /* "petsc4py/PETSc/Mat.pyx":3145 * * """ * cdef PetscInt ni=0, *i=NULL # <<<<<<<<<<<<<< * cdef PetscScalar sval = asScalar(diag) * cdef PetscVec xvec=NULL, bvec=NULL */ __pyx_v_ni = 0; __pyx_v_i = NULL; /* "petsc4py/PETSc/Mat.pyx":3146 * """ * cdef PetscInt ni=0, *i=NULL * cdef PetscScalar sval = asScalar(diag) # <<<<<<<<<<<<<< * cdef PetscVec xvec=NULL, bvec=NULL * if x is not None: xvec = x.vec */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_diag); if (unlikely(__pyx_t_1 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(46, 3146, __pyx_L1_error) __pyx_v_sval = __pyx_t_1; /* "petsc4py/PETSc/Mat.pyx":3147 * cdef PetscInt ni=0, *i=NULL * cdef PetscScalar sval = asScalar(diag) * cdef PetscVec xvec=NULL, bvec=NULL # <<<<<<<<<<<<<< * if x is not None: xvec = x.vec * if b is not None: bvec = b.vec */ __pyx_v_xvec = NULL; __pyx_v_bvec = NULL; /* "petsc4py/PETSc/Mat.pyx":3148 * cdef PetscScalar sval = asScalar(diag) * cdef PetscVec xvec=NULL, bvec=NULL * if x is not None: xvec = x.vec # <<<<<<<<<<<<<< * if b is not None: bvec = b.vec * if isinstance(rows, IS): */ __pyx_t_2 = (((PyObject *)__pyx_v_x) != Py_None); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_x->vec; __pyx_v_xvec = __pyx_t_3; } /* "petsc4py/PETSc/Mat.pyx":3149 * cdef PetscVec xvec=NULL, bvec=NULL * if x is not None: xvec = x.vec * if b is not None: bvec = b.vec # <<<<<<<<<<<<<< * if isinstance(rows, IS): * CHKERR( MatZeroRowsColumnsIS(self.mat, (rows).iset, sval, xvec, bvec) ) */ __pyx_t_2 = (((PyObject *)__pyx_v_b) != Py_None); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_b->vec; __pyx_v_bvec = __pyx_t_3; } /* "petsc4py/PETSc/Mat.pyx":3150 * if x is not None: xvec = x.vec * if b is not None: bvec = b.vec * if isinstance(rows, IS): # <<<<<<<<<<<<<< * CHKERR( MatZeroRowsColumnsIS(self.mat, (rows).iset, sval, xvec, bvec) ) * else: */ __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_rows, __pyx_ptype_8petsc4py_5PETSc_IS); if (__pyx_t_2) { /* "petsc4py/PETSc/Mat.pyx":3151 * if b is not None: bvec = b.vec * if isinstance(rows, IS): * CHKERR( MatZeroRowsColumnsIS(self.mat, (rows).iset, sval, xvec, bvec) ) # <<<<<<<<<<<<<< * else: * rows = iarray_i(rows, &ni, &i) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatZeroRowsColumnsIS(__pyx_v_self->mat, ((struct PyPetscISObject *)__pyx_v_rows)->iset, __pyx_v_sval, __pyx_v_xvec, __pyx_v_bvec)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3151, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":3150 * if x is not None: xvec = x.vec * if b is not None: bvec = b.vec * if isinstance(rows, IS): # <<<<<<<<<<<<<< * CHKERR( MatZeroRowsColumnsIS(self.mat, (rows).iset, sval, xvec, bvec) ) * else: */ goto __pyx_L5; } /* "petsc4py/PETSc/Mat.pyx":3153 * CHKERR( MatZeroRowsColumnsIS(self.mat, (rows).iset, sval, xvec, bvec) ) * else: * rows = iarray_i(rows, &ni, &i) # <<<<<<<<<<<<<< * CHKERR( MatZeroRowsColumns(self.mat, ni, i, sval, xvec, bvec) ) * */ /*else*/ { __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_rows, (&__pyx_v_ni), (&__pyx_v_i))); if (unlikely(!__pyx_t_5)) __PYX_ERR(46, 3153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_rows, __pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/Mat.pyx":3154 * else: * rows = iarray_i(rows, &ni, &i) * CHKERR( MatZeroRowsColumns(self.mat, ni, i, sval, xvec, bvec) ) # <<<<<<<<<<<<<< * * def zeroRowsColumnsLocal(self, rows: IS | Sequence[int], diag: Scalar = 1, Vec x=None, Vec b=None) -> None: */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatZeroRowsColumns(__pyx_v_self->mat, __pyx_v_ni, __pyx_v_i, __pyx_v_sval, __pyx_v_xvec, __pyx_v_bvec)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3154, __pyx_L1_error) } __pyx_L5:; /* "petsc4py/PETSc/Mat.pyx":3122 * CHKERR( MatZeroRowsLocal(self.mat, ni, i, sval, xvec, bvec) ) * * def zeroRowsColumns(self, rows: IS | Sequence[int], diag: Scalar = 1, Vec x=None, Vec b=None) -> None: # <<<<<<<<<<<<<< * """Zero selected rows and columns of the matrix. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.Mat.zeroRowsColumns", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rows); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":3156 * CHKERR( MatZeroRowsColumns(self.mat, ni, i, sval, xvec, bvec) ) * * def zeroRowsColumnsLocal(self, rows: IS | Sequence[int], diag: Scalar = 1, Vec x=None, Vec b=None) -> None: # <<<<<<<<<<<<<< * """Zero selected rows and columns of the matrix in local ordering. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_263zeroRowsColumnsLocal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_262zeroRowsColumnsLocal, "Mat.zeroRowsColumnsLocal(self, rows: IS | Sequence[int], diag: Scalar = 1, x: Vec | None = None, b: Vec | None = None) -> None\nZero selected rows and columns of the matrix in local ordering.\n\n Collective.\n\n Parameters\n ----------\n rows\n Local row/column indices to be zeroed.\n diag\n Scalar value to be inserted into the diagonal.\n x\n Optional solution vector to be modified for zeroed rows.\n b\n Optional right-hand side vector to be modified.\n It will be adjusted with provided solution entries.\n\n See Also\n --------\n zeroRowsLocal, zeroRowsColumns, petsc.MatZeroRowsColumnsLocal\n petsc.MatZeroRowsColumnsLocalIS\n\n \nSource code at petsc4py/PETSc/Mat.pyx:3156"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_263zeroRowsColumnsLocal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_rows = 0; PyObject *__pyx_v_diag = 0; struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_b = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("zeroRowsColumnsLocal (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rows,&__pyx_n_s_diag,&__pyx_n_s_x,&__pyx_n_s_b,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_1)); values[2] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscVecObject *)Py_None)); values[3] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscVecObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rows)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3156, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_diag); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3156, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3156, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_b); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3156, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "zeroRowsColumnsLocal") < 0)) __PYX_ERR(46, 3156, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_rows = values[0]; __pyx_v_diag = values[1]; __pyx_v_x = ((struct PyPetscVecObject *)values[2]); __pyx_v_b = ((struct PyPetscVecObject *)values[3]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("zeroRowsColumnsLocal", 0, 1, 4, __pyx_nargs); __PYX_ERR(46, 3156, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.zeroRowsColumnsLocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "x", 0))) __PYX_ERR(46, 3156, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "b", 0))) __PYX_ERR(46, 3156, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_262zeroRowsColumnsLocal(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_rows, __pyx_v_diag, __pyx_v_x, __pyx_v_b); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_262zeroRowsColumnsLocal(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_rows, PyObject *__pyx_v_diag, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_b) { PetscInt __pyx_v_ni; PetscInt *__pyx_v_i; PetscScalar __pyx_v_sval; Vec __pyx_v_xvec; Vec __pyx_v_bvec; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscScalar __pyx_t_1; int __pyx_t_2; Vec __pyx_t_3; PetscErrorCode __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("zeroRowsColumnsLocal", 0); __Pyx_INCREF(__pyx_v_rows); /* "petsc4py/PETSc/Mat.pyx":3179 * * """ * cdef PetscInt ni=0, *i=NULL # <<<<<<<<<<<<<< * cdef PetscScalar sval = asScalar(diag) * cdef PetscVec xvec=NULL, bvec=NULL */ __pyx_v_ni = 0; __pyx_v_i = NULL; /* "petsc4py/PETSc/Mat.pyx":3180 * """ * cdef PetscInt ni=0, *i=NULL * cdef PetscScalar sval = asScalar(diag) # <<<<<<<<<<<<<< * cdef PetscVec xvec=NULL, bvec=NULL * if x is not None: xvec = x.vec */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_diag); if (unlikely(__pyx_t_1 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(46, 3180, __pyx_L1_error) __pyx_v_sval = __pyx_t_1; /* "petsc4py/PETSc/Mat.pyx":3181 * cdef PetscInt ni=0, *i=NULL * cdef PetscScalar sval = asScalar(diag) * cdef PetscVec xvec=NULL, bvec=NULL # <<<<<<<<<<<<<< * if x is not None: xvec = x.vec * if b is not None: bvec = b.vec */ __pyx_v_xvec = NULL; __pyx_v_bvec = NULL; /* "petsc4py/PETSc/Mat.pyx":3182 * cdef PetscScalar sval = asScalar(diag) * cdef PetscVec xvec=NULL, bvec=NULL * if x is not None: xvec = x.vec # <<<<<<<<<<<<<< * if b is not None: bvec = b.vec * if isinstance(rows, IS): */ __pyx_t_2 = (((PyObject *)__pyx_v_x) != Py_None); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_x->vec; __pyx_v_xvec = __pyx_t_3; } /* "petsc4py/PETSc/Mat.pyx":3183 * cdef PetscVec xvec=NULL, bvec=NULL * if x is not None: xvec = x.vec * if b is not None: bvec = b.vec # <<<<<<<<<<<<<< * if isinstance(rows, IS): * CHKERR( MatZeroRowsColumnsLocalIS(self.mat, (rows).iset, sval, xvec, bvec) ) */ __pyx_t_2 = (((PyObject *)__pyx_v_b) != Py_None); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_b->vec; __pyx_v_bvec = __pyx_t_3; } /* "petsc4py/PETSc/Mat.pyx":3184 * if x is not None: xvec = x.vec * if b is not None: bvec = b.vec * if isinstance(rows, IS): # <<<<<<<<<<<<<< * CHKERR( MatZeroRowsColumnsLocalIS(self.mat, (rows).iset, sval, xvec, bvec) ) * else: */ __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_rows, __pyx_ptype_8petsc4py_5PETSc_IS); if (__pyx_t_2) { /* "petsc4py/PETSc/Mat.pyx":3185 * if b is not None: bvec = b.vec * if isinstance(rows, IS): * CHKERR( MatZeroRowsColumnsLocalIS(self.mat, (rows).iset, sval, xvec, bvec) ) # <<<<<<<<<<<<<< * else: * rows = iarray_i(rows, &ni, &i) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatZeroRowsColumnsLocalIS(__pyx_v_self->mat, ((struct PyPetscISObject *)__pyx_v_rows)->iset, __pyx_v_sval, __pyx_v_xvec, __pyx_v_bvec)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3185, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":3184 * if x is not None: xvec = x.vec * if b is not None: bvec = b.vec * if isinstance(rows, IS): # <<<<<<<<<<<<<< * CHKERR( MatZeroRowsColumnsLocalIS(self.mat, (rows).iset, sval, xvec, bvec) ) * else: */ goto __pyx_L5; } /* "petsc4py/PETSc/Mat.pyx":3187 * CHKERR( MatZeroRowsColumnsLocalIS(self.mat, (rows).iset, sval, xvec, bvec) ) * else: * rows = iarray_i(rows, &ni, &i) # <<<<<<<<<<<<<< * CHKERR( MatZeroRowsColumnsLocal(self.mat, ni, i, sval, xvec, bvec) ) * */ /*else*/ { __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_rows, (&__pyx_v_ni), (&__pyx_v_i))); if (unlikely(!__pyx_t_5)) __PYX_ERR(46, 3187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_rows, __pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/Mat.pyx":3188 * else: * rows = iarray_i(rows, &ni, &i) * CHKERR( MatZeroRowsColumnsLocal(self.mat, ni, i, sval, xvec, bvec) ) # <<<<<<<<<<<<<< * * def zeroRowsColumnsStencil(self, rows: Sequence[Stencil], diag: Scalar = 1, Vec x=None, Vec b=None) -> None: */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatZeroRowsColumnsLocal(__pyx_v_self->mat, __pyx_v_ni, __pyx_v_i, __pyx_v_sval, __pyx_v_xvec, __pyx_v_bvec)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3188, __pyx_L1_error) } __pyx_L5:; /* "petsc4py/PETSc/Mat.pyx":3156 * CHKERR( MatZeroRowsColumns(self.mat, ni, i, sval, xvec, bvec) ) * * def zeroRowsColumnsLocal(self, rows: IS | Sequence[int], diag: Scalar = 1, Vec x=None, Vec b=None) -> None: # <<<<<<<<<<<<<< * """Zero selected rows and columns of the matrix in local ordering. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.Mat.zeroRowsColumnsLocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rows); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":3190 * CHKERR( MatZeroRowsColumnsLocal(self.mat, ni, i, sval, xvec, bvec) ) * * def zeroRowsColumnsStencil(self, rows: Sequence[Stencil], diag: Scalar = 1, Vec x=None, Vec b=None) -> None: # <<<<<<<<<<<<<< * """Zero selected rows and columns of the matrix. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_265zeroRowsColumnsStencil(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_264zeroRowsColumnsStencil, "Mat.zeroRowsColumnsStencil(self, rows: Sequence[Stencil], diag: Scalar = 1, x: Vec | None = None, b: Vec | None = None) -> None\nZero selected rows and columns of the matrix.\n\n Collective.\n\n Parameters\n ----------\n rows\n Iterable of stencil rows and columns.\n diag\n Scalar value to be inserted into the diagonal.\n x\n Optional solution vector to be modified for zeroed rows.\n b\n Optional right-hand side vector to be modified.\n It will be adjusted with provided solution entries.\n\n See Also\n --------\n zeroRowsLocal, zeroRowsColumns, petsc.MatZeroRowsColumnsStencil\n\n \nSource code at petsc4py/PETSc/Mat.pyx:3190"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_265zeroRowsColumnsStencil(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_rows = 0; PyObject *__pyx_v_diag = 0; struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_b = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("zeroRowsColumnsStencil (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rows,&__pyx_n_s_diag,&__pyx_n_s_x,&__pyx_n_s_b,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_1)); values[2] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscVecObject *)Py_None)); values[3] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscVecObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rows)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3190, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_diag); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3190, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3190, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_b); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3190, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "zeroRowsColumnsStencil") < 0)) __PYX_ERR(46, 3190, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_rows = values[0]; __pyx_v_diag = values[1]; __pyx_v_x = ((struct PyPetscVecObject *)values[2]); __pyx_v_b = ((struct PyPetscVecObject *)values[3]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("zeroRowsColumnsStencil", 0, 1, 4, __pyx_nargs); __PYX_ERR(46, 3190, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.zeroRowsColumnsStencil", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "x", 0))) __PYX_ERR(46, 3190, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "b", 0))) __PYX_ERR(46, 3190, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_264zeroRowsColumnsStencil(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_rows, __pyx_v_diag, __pyx_v_x, __pyx_v_b); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_264zeroRowsColumnsStencil(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_rows, PyObject *__pyx_v_diag, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_b) { PetscScalar __pyx_v_sval; PetscInt __pyx_v_nrows; CYTHON_UNUSED MatStencil __pyx_v_st; struct __pyx_obj_8petsc4py_5PETSc_MatStencil *__pyx_v_r = 0; MatStencil *__pyx_v_crows; PetscInt __pyx_v_i; Vec __pyx_v_xvec; Vec __pyx_v_bvec; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscScalar __pyx_t_1; Py_ssize_t __pyx_t_2; PyObject *__pyx_t_3 = NULL; PetscInt __pyx_t_4; PetscErrorCode __pyx_t_5; PetscInt __pyx_t_6; PetscInt __pyx_t_7; MatStencil __pyx_t_8; int __pyx_t_9; Vec __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("zeroRowsColumnsStencil", 1); /* "petsc4py/PETSc/Mat.pyx":3212 * * """ * cdef PetscScalar sval = asScalar(diag) # <<<<<<<<<<<<<< * cdef PetscInt nrows = asInt(len(rows)) * cdef PetscMatStencil st */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_diag); if (unlikely(__pyx_t_1 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(46, 3212, __pyx_L1_error) __pyx_v_sval = __pyx_t_1; /* "petsc4py/PETSc/Mat.pyx":3213 * """ * cdef PetscScalar sval = asScalar(diag) * cdef PetscInt nrows = asInt(len(rows)) # <<<<<<<<<<<<<< * cdef PetscMatStencil st * cdef MatStencil r */ __pyx_t_2 = PyObject_Length(__pyx_v_rows); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(46, 3213, __pyx_L1_error) __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 3213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_t_3); if (unlikely(__pyx_t_4 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(46, 3213, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_nrows = __pyx_t_4; /* "petsc4py/PETSc/Mat.pyx":3216 * cdef PetscMatStencil st * cdef MatStencil r * cdef PetscMatStencil *crows = NULL # <<<<<<<<<<<<<< * CHKERR( PetscMalloc((nrows+1)*sizeof(st), &crows) ) * for i in range(nrows): */ __pyx_v_crows = NULL; /* "petsc4py/PETSc/Mat.pyx":3217 * cdef MatStencil r * cdef PetscMatStencil *crows = NULL * CHKERR( PetscMalloc((nrows+1)*sizeof(st), &crows) ) # <<<<<<<<<<<<<< * for i in range(nrows): * r = rows[i] */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((((size_t)(__pyx_v_nrows + 1)) * (sizeof(__pyx_v_st))), (&__pyx_v_crows))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3217, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":3218 * cdef PetscMatStencil *crows = NULL * CHKERR( PetscMalloc((nrows+1)*sizeof(st), &crows) ) * for i in range(nrows): # <<<<<<<<<<<<<< * r = rows[i] * crows[i] = r.stencil */ __pyx_t_4 = __pyx_v_nrows; __pyx_t_6 = __pyx_t_4; for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; /* "petsc4py/PETSc/Mat.pyx":3219 * CHKERR( PetscMalloc((nrows+1)*sizeof(st), &crows) ) * for i in range(nrows): * r = rows[i] # <<<<<<<<<<<<<< * crows[i] = r.stencil * cdef PetscVec xvec = NULL, bvec = NULL */ __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_rows, __pyx_v_i, PetscInt, 1, __Pyx_PyInt_From_PetscInt, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 3219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_8petsc4py_5PETSc_MatStencil))))) __PYX_ERR(46, 3219, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_r, ((struct __pyx_obj_8petsc4py_5PETSc_MatStencil *)__pyx_t_3)); __pyx_t_3 = 0; /* "petsc4py/PETSc/Mat.pyx":3220 * for i in range(nrows): * r = rows[i] * crows[i] = r.stencil # <<<<<<<<<<<<<< * cdef PetscVec xvec = NULL, bvec = NULL * if x is not None: xvec = x.vec */ __pyx_t_8 = __pyx_v_r->stencil; (__pyx_v_crows[__pyx_v_i]) = __pyx_t_8; } /* "petsc4py/PETSc/Mat.pyx":3221 * r = rows[i] * crows[i] = r.stencil * cdef PetscVec xvec = NULL, bvec = NULL # <<<<<<<<<<<<<< * if x is not None: xvec = x.vec * if b is not None: bvec = b.vec */ __pyx_v_xvec = NULL; __pyx_v_bvec = NULL; /* "petsc4py/PETSc/Mat.pyx":3222 * crows[i] = r.stencil * cdef PetscVec xvec = NULL, bvec = NULL * if x is not None: xvec = x.vec # <<<<<<<<<<<<<< * if b is not None: bvec = b.vec * CHKERR( MatZeroRowsColumnsStencil(self.mat, nrows, crows, sval, xvec, bvec) ) */ __pyx_t_9 = (((PyObject *)__pyx_v_x) != Py_None); if (__pyx_t_9) { __pyx_t_10 = __pyx_v_x->vec; __pyx_v_xvec = __pyx_t_10; } /* "petsc4py/PETSc/Mat.pyx":3223 * cdef PetscVec xvec = NULL, bvec = NULL * if x is not None: xvec = x.vec * if b is not None: bvec = b.vec # <<<<<<<<<<<<<< * CHKERR( MatZeroRowsColumnsStencil(self.mat, nrows, crows, sval, xvec, bvec) ) * CHKERR( PetscFree( crows ) ) */ __pyx_t_9 = (((PyObject *)__pyx_v_b) != Py_None); if (__pyx_t_9) { __pyx_t_10 = __pyx_v_b->vec; __pyx_v_bvec = __pyx_t_10; } /* "petsc4py/PETSc/Mat.pyx":3224 * if x is not None: xvec = x.vec * if b is not None: bvec = b.vec * CHKERR( MatZeroRowsColumnsStencil(self.mat, nrows, crows, sval, xvec, bvec) ) # <<<<<<<<<<<<<< * CHKERR( PetscFree( crows ) ) * */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatZeroRowsColumnsStencil(__pyx_v_self->mat, __pyx_v_nrows, __pyx_v_crows, __pyx_v_sval, __pyx_v_xvec, __pyx_v_bvec)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3224, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":3225 * if b is not None: bvec = b.vec * CHKERR( MatZeroRowsColumnsStencil(self.mat, nrows, crows, sval, xvec, bvec) ) * CHKERR( PetscFree( crows ) ) # <<<<<<<<<<<<<< * * def storeValues(self) -> None: */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_crows)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3225, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":3190 * CHKERR( MatZeroRowsColumnsLocal(self.mat, ni, i, sval, xvec, bvec) ) * * def zeroRowsColumnsStencil(self, rows: Sequence[Stencil], diag: Scalar = 1, Vec x=None, Vec b=None) -> None: # <<<<<<<<<<<<<< * """Zero selected rows and columns of the matrix. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.zeroRowsColumnsStencil", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_r); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":3227 * CHKERR( PetscFree( crows ) ) * * def storeValues(self) -> None: # <<<<<<<<<<<<<< * """Stash a copy of the matrix values. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_267storeValues(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_266storeValues, "Mat.storeValues(self) -> None\nStash a copy of the matrix values.\n\n Collective.\n\n See Also\n --------\n retrieveValues, petsc.MatStoreValues\n\n \nSource code at petsc4py/PETSc/Mat.pyx:3227"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_267storeValues(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("storeValues (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("storeValues", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "storeValues", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_266storeValues(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_266storeValues(struct PyPetscMatObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("storeValues", 1); /* "petsc4py/PETSc/Mat.pyx":3237 * * """ * CHKERR( MatStoreValues(self.mat) ) # <<<<<<<<<<<<<< * * def retrieveValues(self) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatStoreValues(__pyx_v_self->mat)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3237, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":3227 * CHKERR( PetscFree( crows ) ) * * def storeValues(self) -> None: # <<<<<<<<<<<<<< * """Stash a copy of the matrix values. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.storeValues", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":3239 * CHKERR( MatStoreValues(self.mat) ) * * def retrieveValues(self) -> None: # <<<<<<<<<<<<<< * """Retrieve a copy of the matrix values previously stored with `storeValues`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_269retrieveValues(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_268retrieveValues, "Mat.retrieveValues(self) -> None\nRetrieve a copy of the matrix values previously stored with `storeValues`.\n\n Collective.\n\n See Also\n --------\n storeValues, petsc.MatRetrieveValues\n\n \nSource code at petsc4py/PETSc/Mat.pyx:3239"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_269retrieveValues(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("retrieveValues (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("retrieveValues", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "retrieveValues", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_268retrieveValues(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_268retrieveValues(struct PyPetscMatObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("retrieveValues", 1); /* "petsc4py/PETSc/Mat.pyx":3249 * * """ * CHKERR( MatRetrieveValues(self.mat) ) # <<<<<<<<<<<<<< * * def assemblyBegin(self, assembly: MatAssemblySpec = None) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatRetrieveValues(__pyx_v_self->mat)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3249, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":3239 * CHKERR( MatStoreValues(self.mat) ) * * def retrieveValues(self) -> None: # <<<<<<<<<<<<<< * """Retrieve a copy of the matrix values previously stored with `storeValues`. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.retrieveValues", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":3251 * CHKERR( MatRetrieveValues(self.mat) ) * * def assemblyBegin(self, assembly: MatAssemblySpec = None) -> None: # <<<<<<<<<<<<<< * """Begin an assembling stage of the matrix. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_271assemblyBegin(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_270assemblyBegin, "Mat.assemblyBegin(self, assembly: MatAssemblySpec = None) -> None\nBegin an assembling stage of the matrix.\n\n Collective.\n\n Parameters\n ----------\n assembly\n The assembly type.\n\n See Also\n --------\n assemblyEnd, assemble, petsc.MatAssemblyBegin\n\n \nSource code at petsc4py/PETSc/Mat.pyx:3251"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_271assemblyBegin(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_assembly = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("assemblyBegin (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_assembly,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_assembly); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3251, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "assemblyBegin") < 0)) __PYX_ERR(46, 3251, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_assembly = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("assemblyBegin", 0, 0, 1, __pyx_nargs); __PYX_ERR(46, 3251, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.assemblyBegin", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_270assemblyBegin(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_assembly); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_270assemblyBegin(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_assembly) { MatAssemblyType __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MatAssemblyType __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("assemblyBegin", 1); /* "petsc4py/PETSc/Mat.pyx":3266 * * """ * cdef PetscMatAssemblyType flag = assemblytype(assembly) # <<<<<<<<<<<<<< * CHKERR( MatAssemblyBegin(self.mat, flag) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_assemblytype(__pyx_v_assembly); if (unlikely(__pyx_t_1 == ((MatAssemblyType)((MatAssemblyType)-1L)))) __PYX_ERR(46, 3266, __pyx_L1_error) __pyx_v_flag = __pyx_t_1; /* "petsc4py/PETSc/Mat.pyx":3267 * """ * cdef PetscMatAssemblyType flag = assemblytype(assembly) * CHKERR( MatAssemblyBegin(self.mat, flag) ) # <<<<<<<<<<<<<< * * def assemblyEnd(self, assembly: MatAssemblySpec = None) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatAssemblyBegin(__pyx_v_self->mat, __pyx_v_flag)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3267, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":3251 * CHKERR( MatRetrieveValues(self.mat) ) * * def assemblyBegin(self, assembly: MatAssemblySpec = None) -> None: # <<<<<<<<<<<<<< * """Begin an assembling stage of the matrix. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.assemblyBegin", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":3269 * CHKERR( MatAssemblyBegin(self.mat, flag) ) * * def assemblyEnd(self, assembly: MatAssemblySpec = None) -> None: # <<<<<<<<<<<<<< * """Complete an assembling stage of the matrix initiated with `assemblyBegin`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_273assemblyEnd(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_272assemblyEnd, "Mat.assemblyEnd(self, assembly: MatAssemblySpec = None) -> None\nComplete an assembling stage of the matrix initiated with `assemblyBegin`.\n\n Collective.\n\n Parameters\n ----------\n assembly\n The assembly type.\n\n See Also\n --------\n assemblyBegin, assemble, petsc.MatAssemblyEnd\n\n \nSource code at petsc4py/PETSc/Mat.pyx:3269"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_273assemblyEnd(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_assembly = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("assemblyEnd (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_assembly,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_assembly); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3269, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "assemblyEnd") < 0)) __PYX_ERR(46, 3269, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_assembly = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("assemblyEnd", 0, 0, 1, __pyx_nargs); __PYX_ERR(46, 3269, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.assemblyEnd", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_272assemblyEnd(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_assembly); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_272assemblyEnd(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_assembly) { MatAssemblyType __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MatAssemblyType __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("assemblyEnd", 1); /* "petsc4py/PETSc/Mat.pyx":3284 * * """ * cdef PetscMatAssemblyType flag = assemblytype(assembly) # <<<<<<<<<<<<<< * CHKERR( MatAssemblyEnd(self.mat, flag) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_assemblytype(__pyx_v_assembly); if (unlikely(__pyx_t_1 == ((MatAssemblyType)((MatAssemblyType)-1L)))) __PYX_ERR(46, 3284, __pyx_L1_error) __pyx_v_flag = __pyx_t_1; /* "petsc4py/PETSc/Mat.pyx":3285 * """ * cdef PetscMatAssemblyType flag = assemblytype(assembly) * CHKERR( MatAssemblyEnd(self.mat, flag) ) # <<<<<<<<<<<<<< * * def assemble(self, assembly: MatAssemblySpec = None) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatAssemblyEnd(__pyx_v_self->mat, __pyx_v_flag)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3285, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":3269 * CHKERR( MatAssemblyBegin(self.mat, flag) ) * * def assemblyEnd(self, assembly: MatAssemblySpec = None) -> None: # <<<<<<<<<<<<<< * """Complete an assembling stage of the matrix initiated with `assemblyBegin`. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.assemblyEnd", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":3287 * CHKERR( MatAssemblyEnd(self.mat, flag) ) * * def assemble(self, assembly: MatAssemblySpec = None) -> None: # <<<<<<<<<<<<<< * """Assemble the matrix. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_275assemble(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_274assemble, "Mat.assemble(self, assembly: MatAssemblySpec = None) -> None\nAssemble the matrix.\n\n Collective.\n\n Parameters\n ----------\n assembly\n The assembly type.\n\n See Also\n --------\n assemblyBegin, assemblyEnd\n\n \nSource code at petsc4py/PETSc/Mat.pyx:3287"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_275assemble(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_assembly = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("assemble (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_assembly,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_assembly); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3287, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "assemble") < 0)) __PYX_ERR(46, 3287, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_assembly = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("assemble", 0, 0, 1, __pyx_nargs); __PYX_ERR(46, 3287, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.assemble", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_274assemble(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_assembly); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_274assemble(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_assembly) { MatAssemblyType __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MatAssemblyType __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("assemble", 1); /* "petsc4py/PETSc/Mat.pyx":3302 * * """ * cdef PetscMatAssemblyType flag = assemblytype(assembly) # <<<<<<<<<<<<<< * CHKERR( MatAssemblyBegin(self.mat, flag) ) * CHKERR( MatAssemblyEnd(self.mat, flag) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_assemblytype(__pyx_v_assembly); if (unlikely(__pyx_t_1 == ((MatAssemblyType)((MatAssemblyType)-1L)))) __PYX_ERR(46, 3302, __pyx_L1_error) __pyx_v_flag = __pyx_t_1; /* "petsc4py/PETSc/Mat.pyx":3303 * """ * cdef PetscMatAssemblyType flag = assemblytype(assembly) * CHKERR( MatAssemblyBegin(self.mat, flag) ) # <<<<<<<<<<<<<< * CHKERR( MatAssemblyEnd(self.mat, flag) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatAssemblyBegin(__pyx_v_self->mat, __pyx_v_flag)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3303, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":3304 * cdef PetscMatAssemblyType flag = assemblytype(assembly) * CHKERR( MatAssemblyBegin(self.mat, flag) ) * CHKERR( MatAssemblyEnd(self.mat, flag) ) # <<<<<<<<<<<<<< * * def isAssembled(self) -> bool: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatAssemblyEnd(__pyx_v_self->mat, __pyx_v_flag)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3304, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":3287 * CHKERR( MatAssemblyEnd(self.mat, flag) ) * * def assemble(self, assembly: MatAssemblySpec = None) -> None: # <<<<<<<<<<<<<< * """Assemble the matrix. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.assemble", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":3306 * CHKERR( MatAssemblyEnd(self.mat, flag) ) * * def isAssembled(self) -> bool: # <<<<<<<<<<<<<< * """The boolean flag indicating if the matrix is assembled. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_277isAssembled(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_276isAssembled, "Mat.isAssembled(self) -> bool\nThe boolean flag indicating if the matrix is assembled.\n\n Not collective.\n\n See Also\n --------\n assemble, petsc.MatAssembled\n\n \nSource code at petsc4py/PETSc/Mat.pyx:3306"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_277isAssembled(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("isAssembled (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("isAssembled", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "isAssembled", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_276isAssembled(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_276isAssembled(struct PyPetscMatObject *__pyx_v_self) { PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("isAssembled", 1); /* "petsc4py/PETSc/Mat.pyx":3316 * * """ * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( MatAssembled(self.mat, &flag) ) * return toBool(flag) */ __pyx_v_flag = PETSC_FALSE; /* "petsc4py/PETSc/Mat.pyx":3317 * """ * cdef PetscBool flag = PETSC_FALSE * CHKERR( MatAssembled(self.mat, &flag) ) # <<<<<<<<<<<<<< * return toBool(flag) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatAssembled(__pyx_v_self->mat, (&__pyx_v_flag))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3317, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":3318 * cdef PetscBool flag = PETSC_FALSE * CHKERR( MatAssembled(self.mat, &flag) ) * return toBool(flag) # <<<<<<<<<<<<<< * * def findZeroRows(self) -> IS: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 3318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":3306 * CHKERR( MatAssemblyEnd(self.mat, flag) ) * * def isAssembled(self) -> bool: # <<<<<<<<<<<<<< * """The boolean flag indicating if the matrix is assembled. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Mat.isAssembled", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":3320 * return toBool(flag) * * def findZeroRows(self) -> IS: # <<<<<<<<<<<<<< * """Return the index set of empty rows. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_279findZeroRows(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_278findZeroRows, "Mat.findZeroRows(self) -> IS\nReturn the index set of empty rows.\n\n Collective.\n\n See Also\n --------\n petsc.MatFindZeroRows\n\n \nSource code at petsc4py/PETSc/Mat.pyx:3320"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_279findZeroRows(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("findZeroRows (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("findZeroRows", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "findZeroRows", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_278findZeroRows(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_278findZeroRows(struct PyPetscMatObject *__pyx_v_self) { struct PyPetscISObject *__pyx_v_zerorows = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("findZeroRows", 1); /* "petsc4py/PETSc/Mat.pyx":3330 * * """ * cdef IS zerorows = IS() # <<<<<<<<<<<<<< * CHKERR( MatFindZeroRows(self.mat, &zerorows.iset) ) * return zerorows */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 3330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_zerorows = ((struct PyPetscISObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Mat.pyx":3331 * """ * cdef IS zerorows = IS() * CHKERR( MatFindZeroRows(self.mat, &zerorows.iset) ) # <<<<<<<<<<<<<< * return zerorows * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatFindZeroRows(__pyx_v_self->mat, (&__pyx_v_zerorows->iset))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3331, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":3332 * cdef IS zerorows = IS() * CHKERR( MatFindZeroRows(self.mat, &zerorows.iset) ) * return zerorows # <<<<<<<<<<<<<< * * def createVecs( */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_zerorows); __pyx_r = ((PyObject *)__pyx_v_zerorows); goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":3320 * return toBool(flag) * * def findZeroRows(self) -> IS: # <<<<<<<<<<<<<< * """Return the index set of empty rows. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.findZeroRows", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_zerorows); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":3334 * return zerorows * * def createVecs( # <<<<<<<<<<<<<< * self, * side: Literal['r', 'R', 'right', 'Right', 'RIGHT', 'l', 'L', 'left', 'Left', 'LEFT'] | None = None, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_281createVecs(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_280createVecs, "Mat.createVecs(self, side: Literal['r', 'R', 'right', 'Right', 'RIGHT', 'l', 'L', 'left', 'Left', 'LEFT'] | None = None) -> Vec | tuple[Vec, Vec]\nReturn vectors that can be used in matrix vector products.\n\n Collective.\n\n Parameters\n ----------\n side\n If `None` returns a 2-tuple of vectors ``(right, left)``.\n Otherwise it just return a left or right vector.\n\n Notes\n -----\n ``right`` vectors are vectors in the column space of the matrix.\n ``left`` vectors are vectors in the row space of the matrix.\n\n See Also\n --------\n createVecLeft, createVecRight, petsc.MatCreateVecs\n\n \nSource code at petsc4py/PETSc/Mat.pyx:3334"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_281createVecs(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_side = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createVecs (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_side,0}; /* "petsc4py/PETSc/Mat.pyx":3336 * def createVecs( * self, * side: Literal['r', 'R', 'right', 'Right', 'RIGHT', 'l', 'L', 'left', 'Left', 'LEFT'] | None = None, # <<<<<<<<<<<<<< * ) -> Vec | tuple[Vec, Vec]: * """Return vectors that can be used in matrix vector products. */ values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_side); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3334, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createVecs") < 0)) __PYX_ERR(46, 3334, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_side = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createVecs", 0, 0, 1, __pyx_nargs); __PYX_ERR(46, 3334, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.createVecs", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_280createVecs(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_side); /* "petsc4py/PETSc/Mat.pyx":3334 * return zerorows * * def createVecs( # <<<<<<<<<<<<<< * self, * side: Literal['r', 'R', 'right', 'Right', 'RIGHT', 'l', 'L', 'left', 'Left', 'LEFT'] | None = None, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_280createVecs(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_side) { struct PyPetscVecObject *__pyx_v_vecr = 0; struct PyPetscVecObject *__pyx_v_vecl = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createVecs", 1); /* "petsc4py/PETSc/Mat.pyx":3359 * """ * cdef Vec vecr, vecl * if side is None: # <<<<<<<<<<<<<< * vecr = Vec(); vecl = Vec(); * CHKERR( MatCreateVecs(self.mat, &vecr.vec, &vecl.vec) ) */ __pyx_t_1 = (__pyx_v_side == Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/Mat.pyx":3360 * cdef Vec vecr, vecl * if side is None: * vecr = Vec(); vecl = Vec(); # <<<<<<<<<<<<<< * CHKERR( MatCreateVecs(self.mat, &vecr.vec, &vecl.vec) ) * return (vecr, vecl) */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 3360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_vecr = ((struct PyPetscVecObject *)__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 3360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_vecl = ((struct PyPetscVecObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/Mat.pyx":3361 * if side is None: * vecr = Vec(); vecl = Vec(); * CHKERR( MatCreateVecs(self.mat, &vecr.vec, &vecl.vec) ) # <<<<<<<<<<<<<< * return (vecr, vecl) * elif side in ('r', 'R', 'right', 'Right', 'RIGHT'): */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreateVecs(__pyx_v_self->mat, (&__pyx_v_vecr->vec), (&__pyx_v_vecl->vec))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3361, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":3362 * vecr = Vec(); vecl = Vec(); * CHKERR( MatCreateVecs(self.mat, &vecr.vec, &vecl.vec) ) * return (vecr, vecl) # <<<<<<<<<<<<<< * elif side in ('r', 'R', 'right', 'Right', 'RIGHT'): * vecr = Vec() */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 3362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF((PyObject *)__pyx_v_vecr); __Pyx_GIVEREF((PyObject *)__pyx_v_vecr); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_vecr))) __PYX_ERR(46, 3362, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_vecl); __Pyx_GIVEREF((PyObject *)__pyx_v_vecl); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_vecl))) __PYX_ERR(46, 3362, __pyx_L1_error); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":3359 * """ * cdef Vec vecr, vecl * if side is None: # <<<<<<<<<<<<<< * vecr = Vec(); vecl = Vec(); * CHKERR( MatCreateVecs(self.mat, &vecr.vec, &vecl.vec) ) */ } /* "petsc4py/PETSc/Mat.pyx":3363 * CHKERR( MatCreateVecs(self.mat, &vecr.vec, &vecl.vec) ) * return (vecr, vecl) * elif side in ('r', 'R', 'right', 'Right', 'RIGHT'): # <<<<<<<<<<<<<< * vecr = Vec() * CHKERR( MatCreateVecs(self.mat, &vecr.vec, NULL) ) */ __Pyx_INCREF(__pyx_v_side); __pyx_t_2 = __pyx_v_side; __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_r, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(46, 3363, __pyx_L1_error) if (!__pyx_t_4) { } else { __pyx_t_1 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_R, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(46, 3363, __pyx_L1_error) if (!__pyx_t_4) { } else { __pyx_t_1 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_right, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(46, 3363, __pyx_L1_error) if (!__pyx_t_4) { } else { __pyx_t_1 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_Right, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(46, 3363, __pyx_L1_error) if (!__pyx_t_4) { } else { __pyx_t_1 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_RIGHT, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(46, 3363, __pyx_L1_error) __pyx_t_1 = __pyx_t_4; __pyx_L4_bool_binop_done:; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __pyx_t_1; if (__pyx_t_4) { /* "petsc4py/PETSc/Mat.pyx":3364 * return (vecr, vecl) * elif side in ('r', 'R', 'right', 'Right', 'RIGHT'): * vecr = Vec() # <<<<<<<<<<<<<< * CHKERR( MatCreateVecs(self.mat, &vecr.vec, NULL) ) * return vecr */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 3364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_vecr = ((struct PyPetscVecObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/Mat.pyx":3365 * elif side in ('r', 'R', 'right', 'Right', 'RIGHT'): * vecr = Vec() * CHKERR( MatCreateVecs(self.mat, &vecr.vec, NULL) ) # <<<<<<<<<<<<<< * return vecr * elif side in ('l', 'L', 'left', 'Left', 'LEFT'): */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreateVecs(__pyx_v_self->mat, (&__pyx_v_vecr->vec), NULL)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3365, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":3366 * vecr = Vec() * CHKERR( MatCreateVecs(self.mat, &vecr.vec, NULL) ) * return vecr # <<<<<<<<<<<<<< * elif side in ('l', 'L', 'left', 'Left', 'LEFT'): * vecl = Vec() */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_vecr); __pyx_r = ((PyObject *)__pyx_v_vecr); goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":3363 * CHKERR( MatCreateVecs(self.mat, &vecr.vec, &vecl.vec) ) * return (vecr, vecl) * elif side in ('r', 'R', 'right', 'Right', 'RIGHT'): # <<<<<<<<<<<<<< * vecr = Vec() * CHKERR( MatCreateVecs(self.mat, &vecr.vec, NULL) ) */ } /* "petsc4py/PETSc/Mat.pyx":3367 * CHKERR( MatCreateVecs(self.mat, &vecr.vec, NULL) ) * return vecr * elif side in ('l', 'L', 'left', 'Left', 'LEFT'): # <<<<<<<<<<<<<< * vecl = Vec() * CHKERR( MatCreateVecs(self.mat, NULL, &vecl.vec) ) */ __Pyx_INCREF(__pyx_v_side); __pyx_t_2 = __pyx_v_side; __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_l, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(46, 3367, __pyx_L1_error) if (!__pyx_t_1) { } else { __pyx_t_4 = __pyx_t_1; goto __pyx_L9_bool_binop_done; } __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_L, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(46, 3367, __pyx_L1_error) if (!__pyx_t_1) { } else { __pyx_t_4 = __pyx_t_1; goto __pyx_L9_bool_binop_done; } __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_left, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(46, 3367, __pyx_L1_error) if (!__pyx_t_1) { } else { __pyx_t_4 = __pyx_t_1; goto __pyx_L9_bool_binop_done; } __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_Left, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(46, 3367, __pyx_L1_error) if (!__pyx_t_1) { } else { __pyx_t_4 = __pyx_t_1; goto __pyx_L9_bool_binop_done; } __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_LEFT, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(46, 3367, __pyx_L1_error) __pyx_t_4 = __pyx_t_1; __pyx_L9_bool_binop_done:; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_1 = __pyx_t_4; if (likely(__pyx_t_1)) { /* "petsc4py/PETSc/Mat.pyx":3368 * return vecr * elif side in ('l', 'L', 'left', 'Left', 'LEFT'): * vecl = Vec() # <<<<<<<<<<<<<< * CHKERR( MatCreateVecs(self.mat, NULL, &vecl.vec) ) * return vecl */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 3368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_vecl = ((struct PyPetscVecObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/Mat.pyx":3369 * elif side in ('l', 'L', 'left', 'Left', 'LEFT'): * vecl = Vec() * CHKERR( MatCreateVecs(self.mat, NULL, &vecl.vec) ) # <<<<<<<<<<<<<< * return vecl * else: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreateVecs(__pyx_v_self->mat, NULL, (&__pyx_v_vecl->vec))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3369, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":3370 * vecl = Vec() * CHKERR( MatCreateVecs(self.mat, NULL, &vecl.vec) ) * return vecl # <<<<<<<<<<<<<< * else: * raise ValueError("side '%r' not understood" % side) */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_vecl); __pyx_r = ((PyObject *)__pyx_v_vecl); goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":3367 * CHKERR( MatCreateVecs(self.mat, &vecr.vec, NULL) ) * return vecr * elif side in ('l', 'L', 'left', 'Left', 'LEFT'): # <<<<<<<<<<<<<< * vecl = Vec() * CHKERR( MatCreateVecs(self.mat, NULL, &vecl.vec) ) */ } /* "petsc4py/PETSc/Mat.pyx":3372 * return vecl * else: * raise ValueError("side '%r' not understood" % side) # <<<<<<<<<<<<<< * * def createVecRight(self) -> Vec: */ /*else*/ { __pyx_t_2 = __Pyx_PyString_FormatSafe(__pyx_kp_s_side_r_not_understood, __pyx_v_side); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 3372, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(46, 3372, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(46, 3372, __pyx_L1_error) } /* "petsc4py/PETSc/Mat.pyx":3334 * return zerorows * * def createVecs( # <<<<<<<<<<<<<< * self, * side: Literal['r', 'R', 'right', 'Right', 'RIGHT', 'l', 'L', 'left', 'Left', 'LEFT'] | None = None, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.Mat.createVecs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_vecr); __Pyx_XDECREF((PyObject *)__pyx_v_vecl); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":3374 * raise ValueError("side '%r' not understood" % side) * * def createVecRight(self) -> Vec: # <<<<<<<<<<<<<< * """Return a right vector, a vector that the matrix can be multiplied against. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_283createVecRight(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_282createVecRight, "Mat.createVecRight(self) -> Vec\nReturn a right vector, a vector that the matrix can be multiplied against.\n\n Collective.\n\n See Also\n --------\n createVecs, createVecLeft, petsc.MatCreateVecs\n\n \nSource code at petsc4py/PETSc/Mat.pyx:3374"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_283createVecRight(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createVecRight (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("createVecRight", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "createVecRight", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_282createVecRight(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_282createVecRight(struct PyPetscMatObject *__pyx_v_self) { struct PyPetscVecObject *__pyx_v_vecr = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createVecRight", 1); /* "petsc4py/PETSc/Mat.pyx":3384 * * """ * cdef Vec vecr = Vec() # <<<<<<<<<<<<<< * CHKERR( MatCreateVecs(self.mat, &vecr.vec, NULL) ) * return vecr */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 3384, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_vecr = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Mat.pyx":3385 * """ * cdef Vec vecr = Vec() * CHKERR( MatCreateVecs(self.mat, &vecr.vec, NULL) ) # <<<<<<<<<<<<<< * return vecr * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreateVecs(__pyx_v_self->mat, (&__pyx_v_vecr->vec), NULL)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3385, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":3386 * cdef Vec vecr = Vec() * CHKERR( MatCreateVecs(self.mat, &vecr.vec, NULL) ) * return vecr # <<<<<<<<<<<<<< * * def createVecLeft(self) -> Vec: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_vecr); __pyx_r = ((PyObject *)__pyx_v_vecr); goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":3374 * raise ValueError("side '%r' not understood" % side) * * def createVecRight(self) -> Vec: # <<<<<<<<<<<<<< * """Return a right vector, a vector that the matrix can be multiplied against. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.createVecRight", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_vecr); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":3388 * return vecr * * def createVecLeft(self) -> Vec: # <<<<<<<<<<<<<< * """Return a left vector, a vector that the matrix vector product can be stored in. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_285createVecLeft(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_284createVecLeft, "Mat.createVecLeft(self) -> Vec\nReturn a left vector, a vector that the matrix vector product can be stored in.\n\n Collective.\n\n See Also\n --------\n createVecs, createVecRight, petsc.MatCreateVecs\n\n \nSource code at petsc4py/PETSc/Mat.pyx:3388"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_285createVecLeft(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createVecLeft (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("createVecLeft", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "createVecLeft", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_284createVecLeft(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_284createVecLeft(struct PyPetscMatObject *__pyx_v_self) { struct PyPetscVecObject *__pyx_v_vecl = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createVecLeft", 1); /* "petsc4py/PETSc/Mat.pyx":3398 * * """ * cdef Vec vecl = Vec() # <<<<<<<<<<<<<< * CHKERR( MatCreateVecs(self.mat, NULL, &vecl.vec) ) * return vecl */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 3398, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_vecl = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Mat.pyx":3399 * """ * cdef Vec vecl = Vec() * CHKERR( MatCreateVecs(self.mat, NULL, &vecl.vec) ) # <<<<<<<<<<<<<< * return vecl * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreateVecs(__pyx_v_self->mat, NULL, (&__pyx_v_vecl->vec))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3399, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":3400 * cdef Vec vecl = Vec() * CHKERR( MatCreateVecs(self.mat, NULL, &vecl.vec) ) * return vecl # <<<<<<<<<<<<<< * * getVecs = createVecs */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_vecl); __pyx_r = ((PyObject *)__pyx_v_vecl); goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":3388 * return vecr * * def createVecLeft(self) -> Vec: # <<<<<<<<<<<<<< * """Return a left vector, a vector that the matrix vector product can be stored in. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.createVecLeft", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_vecl); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":3408 * # * * def getColumnVector(self, column: int, Vec result=None) -> Vec: # <<<<<<<<<<<<<< * """Return the column column vector of the matrix. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_287getColumnVector(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_286getColumnVector, "Mat.getColumnVector(self, column: int, result: Vec | None = None) -> Vec\nReturn the column\341\265\227\312\260 column vector of the matrix.\n\n Collective.\n\n Parameters\n ----------\n column\n Column index.\n result\n Optional vector to store the result.\n\n See Also\n --------\n petsc.MatGetColumnVector\n\n \nSource code at petsc4py/PETSc/Mat.pyx:3408"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_287getColumnVector(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_column = 0; struct PyPetscVecObject *__pyx_v_result = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getColumnVector (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_column,&__pyx_n_s_result,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscVecObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_column)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3408, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_result); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3408, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getColumnVector") < 0)) __PYX_ERR(46, 3408, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_column = values[0]; __pyx_v_result = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getColumnVector", 0, 1, 2, __pyx_nargs); __PYX_ERR(46, 3408, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.getColumnVector", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_result), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "result", 0))) __PYX_ERR(46, 3408, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_286getColumnVector(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_column, __pyx_v_result); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_286getColumnVector(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_column, struct PyPetscVecObject *__pyx_v_result) { PetscInt __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getColumnVector", 0); __Pyx_INCREF((PyObject *)__pyx_v_result); /* "petsc4py/PETSc/Mat.pyx":3425 * * """ * cdef PetscInt ival = asInt(column) # <<<<<<<<<<<<<< * if result is None: * result = Vec() */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_column); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(46, 3425, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "petsc4py/PETSc/Mat.pyx":3426 * """ * cdef PetscInt ival = asInt(column) * if result is None: # <<<<<<<<<<<<<< * result = Vec() * if result.vec == NULL: */ __pyx_t_2 = (((PyObject *)__pyx_v_result) == Py_None); if (__pyx_t_2) { /* "petsc4py/PETSc/Mat.pyx":3427 * cdef PetscInt ival = asInt(column) * if result is None: * result = Vec() # <<<<<<<<<<<<<< * if result.vec == NULL: * CHKERR( MatCreateVecs(self.mat, NULL, &result.vec) ) */ __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 3427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_result, ((struct PyPetscVecObject *)__pyx_t_3)); __pyx_t_3 = 0; /* "petsc4py/PETSc/Mat.pyx":3426 * """ * cdef PetscInt ival = asInt(column) * if result is None: # <<<<<<<<<<<<<< * result = Vec() * if result.vec == NULL: */ } /* "petsc4py/PETSc/Mat.pyx":3428 * if result is None: * result = Vec() * if result.vec == NULL: # <<<<<<<<<<<<<< * CHKERR( MatCreateVecs(self.mat, NULL, &result.vec) ) * CHKERR( MatGetColumnVector(self.mat, result.vec, ival) ) */ __pyx_t_2 = (__pyx_v_result->vec == NULL); if (__pyx_t_2) { /* "petsc4py/PETSc/Mat.pyx":3429 * result = Vec() * if result.vec == NULL: * CHKERR( MatCreateVecs(self.mat, NULL, &result.vec) ) # <<<<<<<<<<<<<< * CHKERR( MatGetColumnVector(self.mat, result.vec, ival) ) * return result */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreateVecs(__pyx_v_self->mat, NULL, (&__pyx_v_result->vec))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3429, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":3428 * if result is None: * result = Vec() * if result.vec == NULL: # <<<<<<<<<<<<<< * CHKERR( MatCreateVecs(self.mat, NULL, &result.vec) ) * CHKERR( MatGetColumnVector(self.mat, result.vec, ival) ) */ } /* "petsc4py/PETSc/Mat.pyx":3430 * if result.vec == NULL: * CHKERR( MatCreateVecs(self.mat, NULL, &result.vec) ) * CHKERR( MatGetColumnVector(self.mat, result.vec, ival) ) # <<<<<<<<<<<<<< * return result * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetColumnVector(__pyx_v_self->mat, __pyx_v_result->vec, __pyx_v_ival)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3430, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":3431 * CHKERR( MatCreateVecs(self.mat, NULL, &result.vec) ) * CHKERR( MatGetColumnVector(self.mat, result.vec, ival) ) * return result # <<<<<<<<<<<<<< * * def getRedundantMatrix(self, nsubcomm: int, subcomm: Comm | None = None, Mat out=None) -> Mat: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_result); __pyx_r = ((PyObject *)__pyx_v_result); goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":3408 * # * * def getColumnVector(self, column: int, Vec result=None) -> Vec: # <<<<<<<<<<<<<< * """Return the column column vector of the matrix. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getColumnVector", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":3433 * return result * * def getRedundantMatrix(self, nsubcomm: int, subcomm: Comm | None = None, Mat out=None) -> Mat: # <<<<<<<<<<<<<< * """Return redundant matrices on subcommunicators. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_289getRedundantMatrix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_288getRedundantMatrix, "Mat.getRedundantMatrix(self, nsubcomm: int, subcomm: Comm | None = None, out: Mat | None = None) -> Mat\nReturn redundant matrices on subcommunicators.\n\n Parameters\n ----------\n nsubcomm\n The number of subcommunicators.\n subcomm\n Communicator split or `None` for the null communicator.\n out\n Optional resultant matrix.\n When `None`, a new matrix is created, and ``MAT_INITIAL_MATRIX`` is used.\n When not `None`, the matrix is reused with ``MAT_REUSE_MATRIX``.\n\n See Also\n --------\n petsc.MatCreateRedundantMatrix\n\n \nSource code at petsc4py/PETSc/Mat.pyx:3433"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_289getRedundantMatrix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_nsubcomm = 0; PyObject *__pyx_v_subcomm = 0; struct PyPetscMatObject *__pyx_v_out = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getRedundantMatrix (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nsubcomm,&__pyx_n_s_subcomm,&__pyx_n_s_out,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[2] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscMatObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_nsubcomm)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3433, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_subcomm); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3433, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_out); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3433, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getRedundantMatrix") < 0)) __PYX_ERR(46, 3433, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_nsubcomm = values[0]; __pyx_v_subcomm = values[1]; __pyx_v_out = ((struct PyPetscMatObject *)values[2]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getRedundantMatrix", 0, 1, 3, __pyx_nargs); __PYX_ERR(46, 3433, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.getRedundantMatrix", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "out", 0))) __PYX_ERR(46, 3433, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_288getRedundantMatrix(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_nsubcomm, __pyx_v_subcomm, __pyx_v_out); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_288getRedundantMatrix(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_nsubcomm, PyObject *__pyx_v_subcomm, struct PyPetscMatObject *__pyx_v_out) { PetscInt __pyx_v__nsubcomm; MPI_Comm __pyx_v__subcomm; MatReuse __pyx_v_reuse; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; MPI_Comm __pyx_t_3; PyObject *__pyx_t_4 = NULL; PetscErrorCode __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getRedundantMatrix", 0); __Pyx_INCREF((PyObject *)__pyx_v_out); /* "petsc4py/PETSc/Mat.pyx":3452 * * """ * cdef PetscInt _nsubcomm = asInt(nsubcomm) # <<<<<<<<<<<<<< * cdef MPI_Comm _subcomm = MPI_COMM_NULL * if subcomm: _subcomm = def_Comm(subcomm, PETSC_COMM_DEFAULT) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_nsubcomm); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(46, 3452, __pyx_L1_error) __pyx_v__nsubcomm = __pyx_t_1; /* "petsc4py/PETSc/Mat.pyx":3453 * """ * cdef PetscInt _nsubcomm = asInt(nsubcomm) * cdef MPI_Comm _subcomm = MPI_COMM_NULL # <<<<<<<<<<<<<< * if subcomm: _subcomm = def_Comm(subcomm, PETSC_COMM_DEFAULT) * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX */ __pyx_v__subcomm = MPI_COMM_NULL; /* "petsc4py/PETSc/Mat.pyx":3454 * cdef PetscInt _nsubcomm = asInt(nsubcomm) * cdef MPI_Comm _subcomm = MPI_COMM_NULL * if subcomm: _subcomm = def_Comm(subcomm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * if out is None: out = Mat() */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_subcomm); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(46, 3454, __pyx_L1_error) if (__pyx_t_2) { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_subcomm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_3 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(46, 3454, __pyx_L1_error) __pyx_v__subcomm = __pyx_t_3; } /* "petsc4py/PETSc/Mat.pyx":3455 * cdef MPI_Comm _subcomm = MPI_COMM_NULL * if subcomm: _subcomm = def_Comm(subcomm, PETSC_COMM_DEFAULT) * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX # <<<<<<<<<<<<<< * if out is None: out = Mat() * if out.mat != NULL: reuse = MAT_REUSE_MATRIX */ __pyx_v_reuse = MAT_INITIAL_MATRIX; /* "petsc4py/PETSc/Mat.pyx":3456 * if subcomm: _subcomm = def_Comm(subcomm, PETSC_COMM_DEFAULT) * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * if out is None: out = Mat() # <<<<<<<<<<<<<< * if out.mat != NULL: reuse = MAT_REUSE_MATRIX * CHKERR( MatCreateRedundantMatrix(self.mat, _nsubcomm, _subcomm, reuse, &out.mat)) */ __pyx_t_2 = (((PyObject *)__pyx_v_out) == Py_None); if (__pyx_t_2) { __pyx_t_4 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 3456, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_out, ((struct PyPetscMatObject *)__pyx_t_4)); __pyx_t_4 = 0; } /* "petsc4py/PETSc/Mat.pyx":3457 * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * if out is None: out = Mat() * if out.mat != NULL: reuse = MAT_REUSE_MATRIX # <<<<<<<<<<<<<< * CHKERR( MatCreateRedundantMatrix(self.mat, _nsubcomm, _subcomm, reuse, &out.mat)) * return out */ __pyx_t_2 = (__pyx_v_out->mat != NULL); if (__pyx_t_2) { __pyx_v_reuse = MAT_REUSE_MATRIX; } /* "petsc4py/PETSc/Mat.pyx":3458 * if out is None: out = Mat() * if out.mat != NULL: reuse = MAT_REUSE_MATRIX * CHKERR( MatCreateRedundantMatrix(self.mat, _nsubcomm, _subcomm, reuse, &out.mat)) # <<<<<<<<<<<<<< * return out * */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreateRedundantMatrix(__pyx_v_self->mat, __pyx_v__nsubcomm, __pyx_v__subcomm, __pyx_v_reuse, (&__pyx_v_out->mat))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3458, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":3459 * if out.mat != NULL: reuse = MAT_REUSE_MATRIX * CHKERR( MatCreateRedundantMatrix(self.mat, _nsubcomm, _subcomm, reuse, &out.mat)) * return out # <<<<<<<<<<<<<< * * def getDiagonal(self, Vec result=None) -> Vec: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_out); __pyx_r = ((PyObject *)__pyx_v_out); goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":3433 * return result * * def getRedundantMatrix(self, nsubcomm: int, subcomm: Comm | None = None, Mat out=None) -> Mat: # <<<<<<<<<<<<<< * """Return redundant matrices on subcommunicators. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getRedundantMatrix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_out); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":3461 * return out * * def getDiagonal(self, Vec result=None) -> Vec: # <<<<<<<<<<<<<< * """Return the diagonal of the matrix. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_291getDiagonal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_290getDiagonal, "Mat.getDiagonal(self, result: Vec | None = None) -> Vec\nReturn the diagonal of the matrix.\n\n Collective.\n\n Parameters\n ----------\n result\n Optional vector to store the result.\n\n See Also\n --------\n setDiagonal, petsc.MatGetDiagonal\n\n \nSource code at petsc4py/PETSc/Mat.pyx:3461"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_291getDiagonal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_result = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getDiagonal (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_result,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscVecObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_result); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3461, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getDiagonal") < 0)) __PYX_ERR(46, 3461, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_result = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getDiagonal", 0, 0, 1, __pyx_nargs); __PYX_ERR(46, 3461, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.getDiagonal", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_result), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "result", 0))) __PYX_ERR(46, 3461, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_290getDiagonal(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_result); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_290getDiagonal(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_result) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getDiagonal", 0); __Pyx_INCREF((PyObject *)__pyx_v_result); /* "petsc4py/PETSc/Mat.pyx":3476 * * """ * if result is None: # <<<<<<<<<<<<<< * result = Vec() * if result.vec == NULL: */ __pyx_t_1 = (((PyObject *)__pyx_v_result) == Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/Mat.pyx":3477 * """ * if result is None: * result = Vec() # <<<<<<<<<<<<<< * if result.vec == NULL: * CHKERR( MatCreateVecs(self.mat, NULL, &result.vec) ) */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 3477, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_result, ((struct PyPetscVecObject *)__pyx_t_2)); __pyx_t_2 = 0; /* "petsc4py/PETSc/Mat.pyx":3476 * * """ * if result is None: # <<<<<<<<<<<<<< * result = Vec() * if result.vec == NULL: */ } /* "petsc4py/PETSc/Mat.pyx":3478 * if result is None: * result = Vec() * if result.vec == NULL: # <<<<<<<<<<<<<< * CHKERR( MatCreateVecs(self.mat, NULL, &result.vec) ) * CHKERR( MatGetDiagonal(self.mat, result.vec) ) */ __pyx_t_1 = (__pyx_v_result->vec == NULL); if (__pyx_t_1) { /* "petsc4py/PETSc/Mat.pyx":3479 * result = Vec() * if result.vec == NULL: * CHKERR( MatCreateVecs(self.mat, NULL, &result.vec) ) # <<<<<<<<<<<<<< * CHKERR( MatGetDiagonal(self.mat, result.vec) ) * return result */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreateVecs(__pyx_v_self->mat, NULL, (&__pyx_v_result->vec))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3479, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":3478 * if result is None: * result = Vec() * if result.vec == NULL: # <<<<<<<<<<<<<< * CHKERR( MatCreateVecs(self.mat, NULL, &result.vec) ) * CHKERR( MatGetDiagonal(self.mat, result.vec) ) */ } /* "petsc4py/PETSc/Mat.pyx":3480 * if result.vec == NULL: * CHKERR( MatCreateVecs(self.mat, NULL, &result.vec) ) * CHKERR( MatGetDiagonal(self.mat, result.vec) ) # <<<<<<<<<<<<<< * return result * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetDiagonal(__pyx_v_self->mat, __pyx_v_result->vec)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3480, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":3481 * CHKERR( MatCreateVecs(self.mat, NULL, &result.vec) ) * CHKERR( MatGetDiagonal(self.mat, result.vec) ) * return result # <<<<<<<<<<<<<< * * def getRowSum(self, Vec result=None) -> Vec: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_result); __pyx_r = ((PyObject *)__pyx_v_result); goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":3461 * return out * * def getDiagonal(self, Vec result=None) -> Vec: # <<<<<<<<<<<<<< * """Return the diagonal of the matrix. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getDiagonal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":3483 * return result * * def getRowSum(self, Vec result=None) -> Vec: # <<<<<<<<<<<<<< * """Return the row-sum vector. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_293getRowSum(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_292getRowSum, "Mat.getRowSum(self, result: Vec | None = None) -> Vec\nReturn the row-sum vector.\n\n Collective.\n\n Parameters\n ----------\n result\n Optional vector to store the result.\n\n See Also\n --------\n petsc.MatGetRowSum\n\n \nSource code at petsc4py/PETSc/Mat.pyx:3483"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_293getRowSum(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_result = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getRowSum (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_result,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscVecObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_result); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3483, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getRowSum") < 0)) __PYX_ERR(46, 3483, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_result = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getRowSum", 0, 0, 1, __pyx_nargs); __PYX_ERR(46, 3483, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.getRowSum", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_result), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "result", 0))) __PYX_ERR(46, 3483, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_292getRowSum(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_result); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_292getRowSum(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_result) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getRowSum", 0); __Pyx_INCREF((PyObject *)__pyx_v_result); /* "petsc4py/PETSc/Mat.pyx":3498 * * """ * if result is None: # <<<<<<<<<<<<<< * result = Vec() * if result.vec == NULL: */ __pyx_t_1 = (((PyObject *)__pyx_v_result) == Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/Mat.pyx":3499 * """ * if result is None: * result = Vec() # <<<<<<<<<<<<<< * if result.vec == NULL: * CHKERR( MatCreateVecs(self.mat, NULL, &result.vec) ) */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 3499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_result, ((struct PyPetscVecObject *)__pyx_t_2)); __pyx_t_2 = 0; /* "petsc4py/PETSc/Mat.pyx":3498 * * """ * if result is None: # <<<<<<<<<<<<<< * result = Vec() * if result.vec == NULL: */ } /* "petsc4py/PETSc/Mat.pyx":3500 * if result is None: * result = Vec() * if result.vec == NULL: # <<<<<<<<<<<<<< * CHKERR( MatCreateVecs(self.mat, NULL, &result.vec) ) * CHKERR( MatGetRowSum(self.mat, result.vec) ) */ __pyx_t_1 = (__pyx_v_result->vec == NULL); if (__pyx_t_1) { /* "petsc4py/PETSc/Mat.pyx":3501 * result = Vec() * if result.vec == NULL: * CHKERR( MatCreateVecs(self.mat, NULL, &result.vec) ) # <<<<<<<<<<<<<< * CHKERR( MatGetRowSum(self.mat, result.vec) ) * return result */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreateVecs(__pyx_v_self->mat, NULL, (&__pyx_v_result->vec))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3501, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":3500 * if result is None: * result = Vec() * if result.vec == NULL: # <<<<<<<<<<<<<< * CHKERR( MatCreateVecs(self.mat, NULL, &result.vec) ) * CHKERR( MatGetRowSum(self.mat, result.vec) ) */ } /* "petsc4py/PETSc/Mat.pyx":3502 * if result.vec == NULL: * CHKERR( MatCreateVecs(self.mat, NULL, &result.vec) ) * CHKERR( MatGetRowSum(self.mat, result.vec) ) # <<<<<<<<<<<<<< * return result * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetRowSum(__pyx_v_self->mat, __pyx_v_result->vec)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3502, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":3503 * CHKERR( MatCreateVecs(self.mat, NULL, &result.vec) ) * CHKERR( MatGetRowSum(self.mat, result.vec) ) * return result # <<<<<<<<<<<<<< * * def setDiagonal(self, Vec diag, addv: InsertModeSpec = None) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_result); __pyx_r = ((PyObject *)__pyx_v_result); goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":3483 * return result * * def getRowSum(self, Vec result=None) -> Vec: # <<<<<<<<<<<<<< * """Return the row-sum vector. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getRowSum", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":3505 * return result * * def setDiagonal(self, Vec diag, addv: InsertModeSpec = None) -> None: # <<<<<<<<<<<<<< * """Set the diagonal values of the matrix. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_295setDiagonal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_294setDiagonal, "Mat.setDiagonal(self, diag: Vec, addv: InsertModeSpec = None) -> None\nSet the diagonal values of the matrix.\n\n Collective.\n\n Parameters\n ----------\n diag\n Vector storing diagonal values.\n addv\n Insertion mode.\n\n See Also\n --------\n getDiagonal, petsc.MatDiagonalSet\n\n \nSource code at petsc4py/PETSc/Mat.pyx:3505"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_295setDiagonal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_diag = 0; PyObject *__pyx_v_addv = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setDiagonal (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_diag,&__pyx_n_s_addv,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_diag)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3505, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_addv); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3505, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setDiagonal") < 0)) __PYX_ERR(46, 3505, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_diag = ((struct PyPetscVecObject *)values[0]); __pyx_v_addv = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setDiagonal", 0, 1, 2, __pyx_nargs); __PYX_ERR(46, 3505, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.setDiagonal", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_diag), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "diag", 0))) __PYX_ERR(46, 3505, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_294setDiagonal(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_diag, __pyx_v_addv); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_294setDiagonal(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_diag, PyObject *__pyx_v_addv) { InsertMode __pyx_v_caddv; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations InsertMode __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setDiagonal", 1); /* "petsc4py/PETSc/Mat.pyx":3522 * * """ * cdef PetscInsertMode caddv = insertmode(addv) # <<<<<<<<<<<<<< * CHKERR( MatDiagonalSet(self.mat, diag.vec, caddv) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_insertmode(__pyx_v_addv); if (unlikely(__pyx_t_1 == ((InsertMode)((InsertMode)-1L)))) __PYX_ERR(46, 3522, __pyx_L1_error) __pyx_v_caddv = __pyx_t_1; /* "petsc4py/PETSc/Mat.pyx":3523 * """ * cdef PetscInsertMode caddv = insertmode(addv) * CHKERR( MatDiagonalSet(self.mat, diag.vec, caddv) ) # <<<<<<<<<<<<<< * * def diagonalScale(self, Vec L=None, Vec R=None) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDiagonalSet(__pyx_v_self->mat, __pyx_v_diag->vec, __pyx_v_caddv)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3523, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":3505 * return result * * def setDiagonal(self, Vec diag, addv: InsertModeSpec = None) -> None: # <<<<<<<<<<<<<< * """Set the diagonal values of the matrix. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setDiagonal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":3525 * CHKERR( MatDiagonalSet(self.mat, diag.vec, caddv) ) * * def diagonalScale(self, Vec L=None, Vec R=None) -> None: # <<<<<<<<<<<<<< * """Perform left and/or right diagonal scaling of the matrix. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_297diagonalScale(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_296diagonalScale, "Mat.diagonalScale(self, L: Vec | None = None, R: Vec | None = None) -> None\nPerform left and/or right diagonal scaling of the matrix.\n\n Collective.\n\n Parameters\n ----------\n L\n Optional left scaling vector.\n R\n Optional right scaling vector.\n\n See Also\n --------\n petsc.MatDiagonalScale\n\n \nSource code at petsc4py/PETSc/Mat.pyx:3525"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_297diagonalScale(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_L = 0; struct PyPetscVecObject *__pyx_v_R = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("diagonalScale (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_L,&__pyx_n_s_R,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscVecObject *)Py_None)); values[1] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscVecObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_L); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3525, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_R); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3525, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "diagonalScale") < 0)) __PYX_ERR(46, 3525, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_L = ((struct PyPetscVecObject *)values[0]); __pyx_v_R = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("diagonalScale", 0, 0, 2, __pyx_nargs); __PYX_ERR(46, 3525, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.diagonalScale", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_L), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "L", 0))) __PYX_ERR(46, 3525, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_R), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "R", 0))) __PYX_ERR(46, 3525, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_296diagonalScale(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_L, __pyx_v_R); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_296diagonalScale(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_L, struct PyPetscVecObject *__pyx_v_R) { Vec __pyx_v_vecl; Vec __pyx_v_vecr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; Vec __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("diagonalScale", 1); /* "petsc4py/PETSc/Mat.pyx":3542 * * """ * cdef PetscVec vecl=NULL, vecr=NULL # <<<<<<<<<<<<<< * if L is not None: vecl = L.vec * if R is not None: vecr = R.vec */ __pyx_v_vecl = NULL; __pyx_v_vecr = NULL; /* "petsc4py/PETSc/Mat.pyx":3543 * """ * cdef PetscVec vecl=NULL, vecr=NULL * if L is not None: vecl = L.vec # <<<<<<<<<<<<<< * if R is not None: vecr = R.vec * CHKERR( MatDiagonalScale(self.mat, vecl, vecr) ) */ __pyx_t_1 = (((PyObject *)__pyx_v_L) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_L->vec; __pyx_v_vecl = __pyx_t_2; } /* "petsc4py/PETSc/Mat.pyx":3544 * cdef PetscVec vecl=NULL, vecr=NULL * if L is not None: vecl = L.vec * if R is not None: vecr = R.vec # <<<<<<<<<<<<<< * CHKERR( MatDiagonalScale(self.mat, vecl, vecr) ) * */ __pyx_t_1 = (((PyObject *)__pyx_v_R) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_R->vec; __pyx_v_vecr = __pyx_t_2; } /* "petsc4py/PETSc/Mat.pyx":3545 * if L is not None: vecl = L.vec * if R is not None: vecr = R.vec * CHKERR( MatDiagonalScale(self.mat, vecl, vecr) ) # <<<<<<<<<<<<<< * * def invertBlockDiagonal(self) -> ArrayScalar: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDiagonalScale(__pyx_v_self->mat, __pyx_v_vecl, __pyx_v_vecr)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3545, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":3525 * CHKERR( MatDiagonalSet(self.mat, diag.vec, caddv) ) * * def diagonalScale(self, Vec L=None, Vec R=None) -> None: # <<<<<<<<<<<<<< * """Perform left and/or right diagonal scaling of the matrix. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.diagonalScale", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":3547 * CHKERR( MatDiagonalScale(self.mat, vecl, vecr) ) * * def invertBlockDiagonal(self) -> ArrayScalar: # <<<<<<<<<<<<<< * """Return the inverse of the block-diagonal entries. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_299invertBlockDiagonal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_298invertBlockDiagonal, "Mat.invertBlockDiagonal(self) -> ArrayScalar\nReturn the inverse of the block-diagonal entries.\n\n Collective.\n\n See Also\n --------\n petsc.MatInvertBlockDiagonal\n\n \nSource code at petsc4py/PETSc/Mat.pyx:3547"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_299invertBlockDiagonal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("invertBlockDiagonal (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("invertBlockDiagonal", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "invertBlockDiagonal", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_298invertBlockDiagonal(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_298invertBlockDiagonal(struct PyPetscMatObject *__pyx_v_self) { PetscInt __pyx_v_bs; PetscInt __pyx_v_m; PetscScalar const *__pyx_v_cibdiag; PyArrayObject *__pyx_v_ibdiag = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("invertBlockDiagonal", 1); /* "petsc4py/PETSc/Mat.pyx":3557 * * """ * cdef PetscInt bs = 0, m = 0 # <<<<<<<<<<<<<< * cdef const PetscScalar *cibdiag = NULL * CHKERR( MatGetBlockSize(self.mat, &bs) ) */ __pyx_v_bs = 0; __pyx_v_m = 0; /* "petsc4py/PETSc/Mat.pyx":3558 * """ * cdef PetscInt bs = 0, m = 0 * cdef const PetscScalar *cibdiag = NULL # <<<<<<<<<<<<<< * CHKERR( MatGetBlockSize(self.mat, &bs) ) * CHKERR( MatGetLocalSize(self.mat, &m, NULL) ) */ __pyx_v_cibdiag = NULL; /* "petsc4py/PETSc/Mat.pyx":3559 * cdef PetscInt bs = 0, m = 0 * cdef const PetscScalar *cibdiag = NULL * CHKERR( MatGetBlockSize(self.mat, &bs) ) # <<<<<<<<<<<<<< * CHKERR( MatGetLocalSize(self.mat, &m, NULL) ) * CHKERR( MatInvertBlockDiagonal(self.mat, &cibdiag) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetBlockSize(__pyx_v_self->mat, (&__pyx_v_bs))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3559, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":3560 * cdef const PetscScalar *cibdiag = NULL * CHKERR( MatGetBlockSize(self.mat, &bs) ) * CHKERR( MatGetLocalSize(self.mat, &m, NULL) ) # <<<<<<<<<<<<<< * CHKERR( MatInvertBlockDiagonal(self.mat, &cibdiag) ) * cdef ndarray ibdiag = array_s(m*bs, cibdiag) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetLocalSize(__pyx_v_self->mat, (&__pyx_v_m), NULL)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3560, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":3561 * CHKERR( MatGetBlockSize(self.mat, &bs) ) * CHKERR( MatGetLocalSize(self.mat, &m, NULL) ) * CHKERR( MatInvertBlockDiagonal(self.mat, &cibdiag) ) # <<<<<<<<<<<<<< * cdef ndarray ibdiag = array_s(m*bs, cibdiag) * ibdiag.shape = (toInt(m//bs), toInt(bs), toInt(bs)) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatInvertBlockDiagonal(__pyx_v_self->mat, (&__pyx_v_cibdiag))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3561, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":3562 * CHKERR( MatGetLocalSize(self.mat, &m, NULL) ) * CHKERR( MatInvertBlockDiagonal(self.mat, &cibdiag) ) * cdef ndarray ibdiag = array_s(m*bs, cibdiag) # <<<<<<<<<<<<<< * ibdiag.shape = (toInt(m//bs), toInt(bs), toInt(bs)) * return ibdiag.transpose(0, 2, 1) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_s((__pyx_v_m * __pyx_v_bs), __pyx_v_cibdiag)); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 3562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_ibdiag = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/Mat.pyx":3563 * CHKERR( MatInvertBlockDiagonal(self.mat, &cibdiag) ) * cdef ndarray ibdiag = array_s(m*bs, cibdiag) * ibdiag.shape = (toInt(m//bs), toInt(bs), toInt(bs)) # <<<<<<<<<<<<<< * return ibdiag.transpose(0, 2, 1) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_m / __pyx_v_bs)); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 3563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_bs); if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 3563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_bs); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 3563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(46, 3563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2)) __PYX_ERR(46, 3563, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3)) __PYX_ERR(46, 3563, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4)) __PYX_ERR(46, 3563, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_ibdiag), __pyx_n_s_shape, __pyx_t_5) < 0) __PYX_ERR(46, 3563, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/Mat.pyx":3564 * cdef ndarray ibdiag = array_s(m*bs, cibdiag) * ibdiag.shape = (toInt(m//bs), toInt(bs), toInt(bs)) * return ibdiag.transpose(0, 2, 1) # <<<<<<<<<<<<<< * * # null space */ __Pyx_XDECREF(__pyx_r); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ibdiag), __pyx_n_s_transpose); if (unlikely(!__pyx_t_5)) __PYX_ERR(46, 3564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 3564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":3547 * CHKERR( MatDiagonalScale(self.mat, vecl, vecr) ) * * def invertBlockDiagonal(self) -> ArrayScalar: # <<<<<<<<<<<<<< * """Return the inverse of the block-diagonal entries. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.Mat.invertBlockDiagonal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ibdiag); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":3568 * # null space * * def setNullSpace(self, NullSpace nsp) -> None: # <<<<<<<<<<<<<< * """Set the nullspace. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_301setNullSpace(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_300setNullSpace, "Mat.setNullSpace(self, nsp: NullSpace) -> None\nSet the nullspace.\n\n Collective.\n\n See Also\n --------\n getNullSpace, petsc.MatSetNullSpace\n\n \nSource code at petsc4py/PETSc/Mat.pyx:3568"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_301setNullSpace(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscNullSpaceObject *__pyx_v_nsp = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setNullSpace (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nsp,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_nsp)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3568, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setNullSpace") < 0)) __PYX_ERR(46, 3568, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_nsp = ((struct PyPetscNullSpaceObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setNullSpace", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 3568, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.setNullSpace", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nsp), __pyx_ptype_8petsc4py_5PETSc_NullSpace, 0, "nsp", 0))) __PYX_ERR(46, 3568, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_300setNullSpace(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_nsp); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_300setNullSpace(struct PyPetscMatObject *__pyx_v_self, struct PyPetscNullSpaceObject *__pyx_v_nsp) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setNullSpace", 1); /* "petsc4py/PETSc/Mat.pyx":3578 * * """ * CHKERR( MatSetNullSpace(self.mat, nsp.nsp) ) # <<<<<<<<<<<<<< * * def getNullSpace(self) -> NullSpace: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSetNullSpace(__pyx_v_self->mat, __pyx_v_nsp->nsp)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3578, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":3568 * # null space * * def setNullSpace(self, NullSpace nsp) -> None: # <<<<<<<<<<<<<< * """Set the nullspace. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setNullSpace", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":3580 * CHKERR( MatSetNullSpace(self.mat, nsp.nsp) ) * * def getNullSpace(self) -> NullSpace: # <<<<<<<<<<<<<< * """Return the nullspace. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_303getNullSpace(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_302getNullSpace, "Mat.getNullSpace(self) -> NullSpace\nReturn the nullspace.\n\n Not collective.\n\n See Also\n --------\n setNullSpace, petsc.MatGetNullSpace\n\n \nSource code at petsc4py/PETSc/Mat.pyx:3580"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_303getNullSpace(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getNullSpace (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getNullSpace", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getNullSpace", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_302getNullSpace(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_302getNullSpace(struct PyPetscMatObject *__pyx_v_self) { struct PyPetscNullSpaceObject *__pyx_v_nsp = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getNullSpace", 1); /* "petsc4py/PETSc/Mat.pyx":3590 * * """ * cdef NullSpace nsp = NullSpace() # <<<<<<<<<<<<<< * CHKERR( MatGetNullSpace(self.mat, &nsp.nsp) ) * CHKERR( PetscINCREF(nsp.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_NullSpace)); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 3590, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_nsp = ((struct PyPetscNullSpaceObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Mat.pyx":3591 * """ * cdef NullSpace nsp = NullSpace() * CHKERR( MatGetNullSpace(self.mat, &nsp.nsp) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(nsp.obj) ) * return nsp */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetNullSpace(__pyx_v_self->mat, (&__pyx_v_nsp->nsp))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3591, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":3592 * cdef NullSpace nsp = NullSpace() * CHKERR( MatGetNullSpace(self.mat, &nsp.nsp) ) * CHKERR( PetscINCREF(nsp.obj) ) # <<<<<<<<<<<<<< * return nsp * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_nsp->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3592, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":3593 * CHKERR( MatGetNullSpace(self.mat, &nsp.nsp) ) * CHKERR( PetscINCREF(nsp.obj) ) * return nsp # <<<<<<<<<<<<<< * * def setTransposeNullSpace(self, NullSpace nsp) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_nsp); __pyx_r = ((PyObject *)__pyx_v_nsp); goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":3580 * CHKERR( MatSetNullSpace(self.mat, nsp.nsp) ) * * def getNullSpace(self) -> NullSpace: # <<<<<<<<<<<<<< * """Return the nullspace. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getNullSpace", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_nsp); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":3595 * return nsp * * def setTransposeNullSpace(self, NullSpace nsp) -> None: # <<<<<<<<<<<<<< * """Set the transpose nullspace. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_305setTransposeNullSpace(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_304setTransposeNullSpace, "Mat.setTransposeNullSpace(self, nsp: NullSpace) -> None\nSet the transpose nullspace.\n\n Collective.\n\n See Also\n --------\n setNullSpace, getTransposeNullSpace, petsc.MatSetTransposeNullSpace\n\n \nSource code at petsc4py/PETSc/Mat.pyx:3595"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_305setTransposeNullSpace(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscNullSpaceObject *__pyx_v_nsp = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setTransposeNullSpace (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nsp,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_nsp)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3595, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setTransposeNullSpace") < 0)) __PYX_ERR(46, 3595, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_nsp = ((struct PyPetscNullSpaceObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setTransposeNullSpace", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 3595, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.setTransposeNullSpace", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nsp), __pyx_ptype_8petsc4py_5PETSc_NullSpace, 0, "nsp", 0))) __PYX_ERR(46, 3595, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_304setTransposeNullSpace(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_nsp); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_304setTransposeNullSpace(struct PyPetscMatObject *__pyx_v_self, struct PyPetscNullSpaceObject *__pyx_v_nsp) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setTransposeNullSpace", 1); /* "petsc4py/PETSc/Mat.pyx":3605 * * """ * CHKERR( MatSetTransposeNullSpace(self.mat, nsp.nsp) ) # <<<<<<<<<<<<<< * * def getTransposeNullSpace(self) -> NullSpace: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSetTransposeNullSpace(__pyx_v_self->mat, __pyx_v_nsp->nsp)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3605, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":3595 * return nsp * * def setTransposeNullSpace(self, NullSpace nsp) -> None: # <<<<<<<<<<<<<< * """Set the transpose nullspace. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setTransposeNullSpace", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":3607 * CHKERR( MatSetTransposeNullSpace(self.mat, nsp.nsp) ) * * def getTransposeNullSpace(self) -> NullSpace: # <<<<<<<<<<<<<< * """Return the transpose nullspace. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_307getTransposeNullSpace(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_306getTransposeNullSpace, "Mat.getTransposeNullSpace(self) -> NullSpace\nReturn the transpose nullspace.\n\n Not collective.\n\n See Also\n --------\n getNullSpace, setTransposeNullSpace, petsc.MatGetTransposeNullSpace\n\n \nSource code at petsc4py/PETSc/Mat.pyx:3607"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_307getTransposeNullSpace(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getTransposeNullSpace (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getTransposeNullSpace", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getTransposeNullSpace", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_306getTransposeNullSpace(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_306getTransposeNullSpace(struct PyPetscMatObject *__pyx_v_self) { struct PyPetscNullSpaceObject *__pyx_v_nsp = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getTransposeNullSpace", 1); /* "petsc4py/PETSc/Mat.pyx":3617 * * """ * cdef NullSpace nsp = NullSpace() # <<<<<<<<<<<<<< * CHKERR( MatGetTransposeNullSpace(self.mat, &nsp.nsp) ) * CHKERR( PetscINCREF(nsp.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_NullSpace)); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 3617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_nsp = ((struct PyPetscNullSpaceObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Mat.pyx":3618 * """ * cdef NullSpace nsp = NullSpace() * CHKERR( MatGetTransposeNullSpace(self.mat, &nsp.nsp) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(nsp.obj) ) * return nsp */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetTransposeNullSpace(__pyx_v_self->mat, (&__pyx_v_nsp->nsp))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3618, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":3619 * cdef NullSpace nsp = NullSpace() * CHKERR( MatGetTransposeNullSpace(self.mat, &nsp.nsp) ) * CHKERR( PetscINCREF(nsp.obj) ) # <<<<<<<<<<<<<< * return nsp * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_nsp->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3619, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":3620 * CHKERR( MatGetTransposeNullSpace(self.mat, &nsp.nsp) ) * CHKERR( PetscINCREF(nsp.obj) ) * return nsp # <<<<<<<<<<<<<< * * def setNearNullSpace(self, NullSpace nsp) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_nsp); __pyx_r = ((PyObject *)__pyx_v_nsp); goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":3607 * CHKERR( MatSetTransposeNullSpace(self.mat, nsp.nsp) ) * * def getTransposeNullSpace(self) -> NullSpace: # <<<<<<<<<<<<<< * """Return the transpose nullspace. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getTransposeNullSpace", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_nsp); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":3622 * return nsp * * def setNearNullSpace(self, NullSpace nsp) -> None: # <<<<<<<<<<<<<< * """Set the near-nullspace. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_309setNearNullSpace(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_308setNearNullSpace, "Mat.setNearNullSpace(self, nsp: NullSpace) -> None\nSet the near-nullspace.\n\n Collective.\n\n See Also\n --------\n setNullSpace, getNearNullSpace, petsc.MatSetNearNullSpace\n\n \nSource code at petsc4py/PETSc/Mat.pyx:3622"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_309setNearNullSpace(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscNullSpaceObject *__pyx_v_nsp = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setNearNullSpace (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nsp,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_nsp)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3622, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setNearNullSpace") < 0)) __PYX_ERR(46, 3622, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_nsp = ((struct PyPetscNullSpaceObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setNearNullSpace", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 3622, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.setNearNullSpace", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nsp), __pyx_ptype_8petsc4py_5PETSc_NullSpace, 0, "nsp", 0))) __PYX_ERR(46, 3622, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_308setNearNullSpace(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_nsp); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_308setNearNullSpace(struct PyPetscMatObject *__pyx_v_self, struct PyPetscNullSpaceObject *__pyx_v_nsp) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setNearNullSpace", 1); /* "petsc4py/PETSc/Mat.pyx":3632 * * """ * CHKERR( MatSetNearNullSpace(self.mat, nsp.nsp) ) # <<<<<<<<<<<<<< * * def getNearNullSpace(self) -> NullSpace: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSetNearNullSpace(__pyx_v_self->mat, __pyx_v_nsp->nsp)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3632, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":3622 * return nsp * * def setNearNullSpace(self, NullSpace nsp) -> None: # <<<<<<<<<<<<<< * """Set the near-nullspace. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setNearNullSpace", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":3634 * CHKERR( MatSetNearNullSpace(self.mat, nsp.nsp) ) * * def getNearNullSpace(self) -> NullSpace: # <<<<<<<<<<<<<< * """Return the near-nullspace. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_311getNearNullSpace(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_310getNearNullSpace, "Mat.getNearNullSpace(self) -> NullSpace\nReturn the near-nullspace.\n\n Not collective.\n\n See Also\n --------\n getNullSpace, setNearNullSpace, petsc.MatSetNearNullSpace\n\n \nSource code at petsc4py/PETSc/Mat.pyx:3634"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_311getNearNullSpace(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getNearNullSpace (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getNearNullSpace", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getNearNullSpace", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_310getNearNullSpace(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_310getNearNullSpace(struct PyPetscMatObject *__pyx_v_self) { struct PyPetscNullSpaceObject *__pyx_v_nsp = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getNearNullSpace", 1); /* "petsc4py/PETSc/Mat.pyx":3644 * * """ * cdef NullSpace nsp = NullSpace() # <<<<<<<<<<<<<< * CHKERR( MatGetNearNullSpace(self.mat, &nsp.nsp) ) * CHKERR( PetscINCREF(nsp.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_NullSpace)); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 3644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_nsp = ((struct PyPetscNullSpaceObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Mat.pyx":3645 * """ * cdef NullSpace nsp = NullSpace() * CHKERR( MatGetNearNullSpace(self.mat, &nsp.nsp) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(nsp.obj) ) * return nsp */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetNearNullSpace(__pyx_v_self->mat, (&__pyx_v_nsp->nsp))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3645, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":3646 * cdef NullSpace nsp = NullSpace() * CHKERR( MatGetNearNullSpace(self.mat, &nsp.nsp) ) * CHKERR( PetscINCREF(nsp.obj) ) # <<<<<<<<<<<<<< * return nsp * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_nsp->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3646, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":3647 * CHKERR( MatGetNearNullSpace(self.mat, &nsp.nsp) ) * CHKERR( PetscINCREF(nsp.obj) ) * return nsp # <<<<<<<<<<<<<< * * # matrix-vector product */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_nsp); __pyx_r = ((PyObject *)__pyx_v_nsp); goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":3634 * CHKERR( MatSetNearNullSpace(self.mat, nsp.nsp) ) * * def getNearNullSpace(self) -> NullSpace: # <<<<<<<<<<<<<< * """Return the near-nullspace. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getNearNullSpace", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_nsp); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":3651 * # matrix-vector product * * def mult(self, Vec x, Vec y) -> None: # <<<<<<<<<<<<<< * """Perform the matrix vector product y = A @ x. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_313mult(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_312mult, "Mat.mult(self, x: Vec, y: Vec) -> None\nPerform the matrix vector product y = A @ x.\n\n Collective.\n\n Parameters\n ----------\n x\n The input vector.\n y\n The output vector.\n\n See Also\n --------\n petsc.MatMult\n\n \nSource code at petsc4py/PETSc/Mat.pyx:3651"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_313mult(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_y = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("mult (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3651, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3651, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("mult", 1, 2, 2, 1); __PYX_ERR(46, 3651, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mult") < 0)) __PYX_ERR(46, 3651, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_x = ((struct PyPetscVecObject *)values[0]); __pyx_v_y = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("mult", 1, 2, 2, __pyx_nargs); __PYX_ERR(46, 3651, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.mult", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(46, 3651, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(46, 3651, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_312mult(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_x, __pyx_v_y); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_312mult(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mult", 1); /* "petsc4py/PETSc/Mat.pyx":3668 * * """ * CHKERR( MatMult(self.mat, x.vec, y.vec) ) # <<<<<<<<<<<<<< * * def multAdd(self, Vec x, Vec v, Vec y) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatMult(__pyx_v_self->mat, __pyx_v_x->vec, __pyx_v_y->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3668, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":3651 * # matrix-vector product * * def mult(self, Vec x, Vec y) -> None: # <<<<<<<<<<<<<< * """Perform the matrix vector product y = A @ x. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.mult", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":3670 * CHKERR( MatMult(self.mat, x.vec, y.vec) ) * * def multAdd(self, Vec x, Vec v, Vec y) -> None: # <<<<<<<<<<<<<< * """Perform the matrix vector product with addition y = A @ x + v. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_315multAdd(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_314multAdd, "Mat.multAdd(self, x: Vec, v: Vec, y: Vec) -> None\nPerform the matrix vector product with addition y = A @ x + v.\n\n Collective.\n\n Parameters\n ----------\n x\n The input vector for the matrix-vector product.\n v\n The input vector to be added to.\n y\n The output vector.\n\n See Also\n --------\n petsc.MatMultAdd\n\n \nSource code at petsc4py/PETSc/Mat.pyx:3670"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_315multAdd(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_v = 0; struct PyPetscVecObject *__pyx_v_y = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("multAdd (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_v,&__pyx_n_s_y,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3670, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_v)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3670, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("multAdd", 1, 3, 3, 1); __PYX_ERR(46, 3670, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3670, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("multAdd", 1, 3, 3, 2); __PYX_ERR(46, 3670, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "multAdd") < 0)) __PYX_ERR(46, 3670, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_x = ((struct PyPetscVecObject *)values[0]); __pyx_v_v = ((struct PyPetscVecObject *)values[1]); __pyx_v_y = ((struct PyPetscVecObject *)values[2]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("multAdd", 1, 3, 3, __pyx_nargs); __PYX_ERR(46, 3670, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.multAdd", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(46, 3670, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "v", 0))) __PYX_ERR(46, 3670, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(46, 3670, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_314multAdd(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_x, __pyx_v_v, __pyx_v_y); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_314multAdd(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_v, struct PyPetscVecObject *__pyx_v_y) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("multAdd", 1); /* "petsc4py/PETSc/Mat.pyx":3689 * * """ * CHKERR( MatMultAdd(self.mat, x.vec, v.vec, y.vec) ) # <<<<<<<<<<<<<< * * def multTranspose(self, Vec x, Vec y) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatMultAdd(__pyx_v_self->mat, __pyx_v_x->vec, __pyx_v_v->vec, __pyx_v_y->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3689, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":3670 * CHKERR( MatMult(self.mat, x.vec, y.vec) ) * * def multAdd(self, Vec x, Vec v, Vec y) -> None: # <<<<<<<<<<<<<< * """Perform the matrix vector product with addition y = A @ x + v. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.multAdd", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":3691 * CHKERR( MatMultAdd(self.mat, x.vec, v.vec, y.vec) ) * * def multTranspose(self, Vec x, Vec y) -> None: # <<<<<<<<<<<<<< * """Perform the transposed matrix vector product y = A^T @ x. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_317multTranspose(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_316multTranspose, "Mat.multTranspose(self, x: Vec, y: Vec) -> None\nPerform the transposed matrix vector product y = A^T @ x.\n\n Collective.\n\n Parameters\n ----------\n x\n The input vector.\n y\n The output vector.\n\n See Also\n --------\n petsc.MatMultTranspose\n\n \nSource code at petsc4py/PETSc/Mat.pyx:3691"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_317multTranspose(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_y = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("multTranspose (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3691, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3691, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("multTranspose", 1, 2, 2, 1); __PYX_ERR(46, 3691, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "multTranspose") < 0)) __PYX_ERR(46, 3691, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_x = ((struct PyPetscVecObject *)values[0]); __pyx_v_y = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("multTranspose", 1, 2, 2, __pyx_nargs); __PYX_ERR(46, 3691, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.multTranspose", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(46, 3691, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(46, 3691, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_316multTranspose(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_x, __pyx_v_y); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_316multTranspose(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("multTranspose", 1); /* "petsc4py/PETSc/Mat.pyx":3708 * * """ * CHKERR( MatMultTranspose(self.mat, x.vec, y.vec) ) # <<<<<<<<<<<<<< * * def multTransposeAdd(self, Vec x, Vec v, Vec y) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatMultTranspose(__pyx_v_self->mat, __pyx_v_x->vec, __pyx_v_y->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3708, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":3691 * CHKERR( MatMultAdd(self.mat, x.vec, v.vec, y.vec) ) * * def multTranspose(self, Vec x, Vec y) -> None: # <<<<<<<<<<<<<< * """Perform the transposed matrix vector product y = A^T @ x. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.multTranspose", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":3710 * CHKERR( MatMultTranspose(self.mat, x.vec, y.vec) ) * * def multTransposeAdd(self, Vec x, Vec v, Vec y) -> None: # <<<<<<<<<<<<<< * """Perform the transposed matrix vector product with addition y = A^T @ x + v. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_319multTransposeAdd(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_318multTransposeAdd, "Mat.multTransposeAdd(self, x: Vec, v: Vec, y: Vec) -> None\nPerform the transposed matrix vector product with addition y = A^T @ x + v.\n\n Collective.\n\n Parameters\n ----------\n x\n The input vector for the transposed matrix-vector product.\n v\n The input vector to be added to.\n y\n The output vector.\n\n See Also\n --------\n petsc.MatMultTransposeAdd\n\n \nSource code at petsc4py/PETSc/Mat.pyx:3710"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_319multTransposeAdd(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_v = 0; struct PyPetscVecObject *__pyx_v_y = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("multTransposeAdd (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_v,&__pyx_n_s_y,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3710, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_v)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3710, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("multTransposeAdd", 1, 3, 3, 1); __PYX_ERR(46, 3710, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3710, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("multTransposeAdd", 1, 3, 3, 2); __PYX_ERR(46, 3710, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "multTransposeAdd") < 0)) __PYX_ERR(46, 3710, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_x = ((struct PyPetscVecObject *)values[0]); __pyx_v_v = ((struct PyPetscVecObject *)values[1]); __pyx_v_y = ((struct PyPetscVecObject *)values[2]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("multTransposeAdd", 1, 3, 3, __pyx_nargs); __PYX_ERR(46, 3710, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.multTransposeAdd", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(46, 3710, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "v", 0))) __PYX_ERR(46, 3710, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(46, 3710, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_318multTransposeAdd(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_x, __pyx_v_v, __pyx_v_y); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_318multTransposeAdd(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_v, struct PyPetscVecObject *__pyx_v_y) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("multTransposeAdd", 1); /* "petsc4py/PETSc/Mat.pyx":3729 * * """ * CHKERR( MatMultTransposeAdd(self.mat, x.vec, v.vec, y.vec) ) # <<<<<<<<<<<<<< * * def multHermitian(self, Vec x, Vec y) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatMultTransposeAdd(__pyx_v_self->mat, __pyx_v_x->vec, __pyx_v_v->vec, __pyx_v_y->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3729, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":3710 * CHKERR( MatMultTranspose(self.mat, x.vec, y.vec) ) * * def multTransposeAdd(self, Vec x, Vec v, Vec y) -> None: # <<<<<<<<<<<<<< * """Perform the transposed matrix vector product with addition y = A^T @ x + v. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.multTransposeAdd", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":3731 * CHKERR( MatMultTransposeAdd(self.mat, x.vec, v.vec, y.vec) ) * * def multHermitian(self, Vec x, Vec y) -> None: # <<<<<<<<<<<<<< * """Perform the Hermitian matrix vector product y = A^H @ x. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_321multHermitian(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_320multHermitian, "Mat.multHermitian(self, x: Vec, y: Vec) -> None\nPerform the Hermitian matrix vector product y = A^H @ x.\n\n Collective.\n\n Parameters\n ----------\n x\n The input vector for the Hermitian matrix-vector product.\n y\n The output vector.\n\n See Also\n --------\n petsc.MatMultHermitianTranspose\n\n \nSource code at petsc4py/PETSc/Mat.pyx:3731"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_321multHermitian(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_y = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("multHermitian (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3731, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3731, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("multHermitian", 1, 2, 2, 1); __PYX_ERR(46, 3731, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "multHermitian") < 0)) __PYX_ERR(46, 3731, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_x = ((struct PyPetscVecObject *)values[0]); __pyx_v_y = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("multHermitian", 1, 2, 2, __pyx_nargs); __PYX_ERR(46, 3731, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.multHermitian", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(46, 3731, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(46, 3731, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_320multHermitian(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_x, __pyx_v_y); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_320multHermitian(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("multHermitian", 1); /* "petsc4py/PETSc/Mat.pyx":3748 * * """ * CHKERR( MatMultHermitian(self.mat, x.vec, y.vec) ) # <<<<<<<<<<<<<< * * def multHermitianAdd(self, Vec x, Vec v, Vec y) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatMultHermitianTranspose(__pyx_v_self->mat, __pyx_v_x->vec, __pyx_v_y->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3748, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":3731 * CHKERR( MatMultTransposeAdd(self.mat, x.vec, v.vec, y.vec) ) * * def multHermitian(self, Vec x, Vec y) -> None: # <<<<<<<<<<<<<< * """Perform the Hermitian matrix vector product y = A^H @ x. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.multHermitian", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":3750 * CHKERR( MatMultHermitian(self.mat, x.vec, y.vec) ) * * def multHermitianAdd(self, Vec x, Vec v, Vec y) -> None: # <<<<<<<<<<<<<< * """Perform the Hermitian matrix vector product with addition y = A^H @ x + v. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_323multHermitianAdd(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_322multHermitianAdd, "Mat.multHermitianAdd(self, x: Vec, v: Vec, y: Vec) -> None\nPerform the Hermitian matrix vector product with addition y = A^H @ x + v.\n\n Collective.\n\n Parameters\n ----------\n x\n The input vector for the Hermitian matrix-vector product.\n v\n The input vector to be added to.\n y\n The output vector.\n\n See Also\n --------\n petsc.MatMultHermitianTransposeAdd\n\n \nSource code at petsc4py/PETSc/Mat.pyx:3750"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_323multHermitianAdd(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_v = 0; struct PyPetscVecObject *__pyx_v_y = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("multHermitianAdd (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_v,&__pyx_n_s_y,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3750, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_v)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3750, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("multHermitianAdd", 1, 3, 3, 1); __PYX_ERR(46, 3750, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3750, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("multHermitianAdd", 1, 3, 3, 2); __PYX_ERR(46, 3750, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "multHermitianAdd") < 0)) __PYX_ERR(46, 3750, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_x = ((struct PyPetscVecObject *)values[0]); __pyx_v_v = ((struct PyPetscVecObject *)values[1]); __pyx_v_y = ((struct PyPetscVecObject *)values[2]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("multHermitianAdd", 1, 3, 3, __pyx_nargs); __PYX_ERR(46, 3750, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.multHermitianAdd", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(46, 3750, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "v", 0))) __PYX_ERR(46, 3750, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(46, 3750, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_322multHermitianAdd(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_x, __pyx_v_v, __pyx_v_y); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_322multHermitianAdd(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_v, struct PyPetscVecObject *__pyx_v_y) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("multHermitianAdd", 1); /* "petsc4py/PETSc/Mat.pyx":3769 * * """ * CHKERR( MatMultHermitianAdd(self.mat, x.vec, v.vec, y.vec) ) # <<<<<<<<<<<<<< * * # SOR */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatMultHermitianTransposeAdd(__pyx_v_self->mat, __pyx_v_x->vec, __pyx_v_v->vec, __pyx_v_y->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3769, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":3750 * CHKERR( MatMultHermitian(self.mat, x.vec, y.vec) ) * * def multHermitianAdd(self, Vec x, Vec v, Vec y) -> None: # <<<<<<<<<<<<<< * """Perform the Hermitian matrix vector product with addition y = A^H @ x + v. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.multHermitianAdd", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":3773 * # SOR * * def SOR( # <<<<<<<<<<<<<< * self, * Vec b, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_325SOR(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_324SOR, "Mat.SOR(self, b: Vec, x: Vec, omega: float = 1.0, sortype: SORType | None = None, shift: float = 0.0, its: int = 1, lits: int = 1) -> None\nCompute relaxation (SOR, Gauss-Seidel) sweeps.\n\n Neighborwise collective.\n\n See Also\n --------\n petsc.MatSOR\n\n \nSource code at petsc4py/PETSc/Mat.pyx:3773"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_325SOR(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_b = 0; struct PyPetscVecObject *__pyx_v_x = 0; PyObject *__pyx_v_omega = 0; PyObject *__pyx_v_sortype = 0; PyObject *__pyx_v_shift = 0; PyObject *__pyx_v_its = 0; PyObject *__pyx_v_lits = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[7] = {0,0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("SOR (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_b,&__pyx_n_s_x,&__pyx_n_s_omega,&__pyx_n_s_sortype,&__pyx_n_s_shift,&__pyx_n_s_its,&__pyx_n_s_lits,0}; values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_float_1_0)); /* "petsc4py/PETSc/Mat.pyx":3778 * Vec x, * omega:float = 1.0, * sortype:SORType | None = None, # <<<<<<<<<<<<<< * shift:float = 0.0, * its:int = 1, */ values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_float_0_0)); values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_1)); values[6] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_1)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_b)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3773, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3773, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("SOR", 0, 2, 7, 1); __PYX_ERR(46, 3773, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_omega); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3773, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sortype); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3773, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_shift); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3773, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_its); if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3773, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 6: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_lits); if (value) { values[6] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3773, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "SOR") < 0)) __PYX_ERR(46, 3773, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_b = ((struct PyPetscVecObject *)values[0]); __pyx_v_x = ((struct PyPetscVecObject *)values[1]); __pyx_v_omega = values[2]; __pyx_v_sortype = values[3]; __pyx_v_shift = values[4]; __pyx_v_its = values[5]; __pyx_v_lits = values[6]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("SOR", 0, 2, 7, __pyx_nargs); __PYX_ERR(46, 3773, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.SOR", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "b", 0))) __PYX_ERR(46, 3775, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(46, 3776, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_324SOR(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_b, __pyx_v_x, __pyx_v_omega, __pyx_v_sortype, __pyx_v_shift, __pyx_v_its, __pyx_v_lits); /* "petsc4py/PETSc/Mat.pyx":3773 * # SOR * * def SOR( # <<<<<<<<<<<<<< * self, * Vec b, */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_324SOR(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_b, struct PyPetscVecObject *__pyx_v_x, PyObject *__pyx_v_omega, PyObject *__pyx_v_sortype, PyObject *__pyx_v_shift, PyObject *__pyx_v_its, PyObject *__pyx_v_lits) { PetscReal __pyx_v_comega; MatSORType __pyx_v_csortype; PetscReal __pyx_v_cshift; PetscInt __pyx_v_cits; PetscInt __pyx_v_clits; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; int __pyx_t_2; PetscInt __pyx_t_3; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("SOR", 1); /* "petsc4py/PETSc/Mat.pyx":3792 * * """ * cdef PetscReal comega = asReal(omega) # <<<<<<<<<<<<<< * cdef PetscMatSORType csortype = SOR_LOCAL_SYMMETRIC_SWEEP * if sortype is not None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_omega); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(46, 3792, __pyx_L1_error) __pyx_v_comega = __pyx_t_1; /* "petsc4py/PETSc/Mat.pyx":3793 * """ * cdef PetscReal comega = asReal(omega) * cdef PetscMatSORType csortype = SOR_LOCAL_SYMMETRIC_SWEEP # <<<<<<<<<<<<<< * if sortype is not None: * csortype = asInt(sortype) */ __pyx_v_csortype = SOR_LOCAL_SYMMETRIC_SWEEP; /* "petsc4py/PETSc/Mat.pyx":3794 * cdef PetscReal comega = asReal(omega) * cdef PetscMatSORType csortype = SOR_LOCAL_SYMMETRIC_SWEEP * if sortype is not None: # <<<<<<<<<<<<<< * csortype = asInt(sortype) * cdef PetscReal cshift = asReal(shift) */ __pyx_t_2 = (__pyx_v_sortype != Py_None); if (__pyx_t_2) { /* "petsc4py/PETSc/Mat.pyx":3795 * cdef PetscMatSORType csortype = SOR_LOCAL_SYMMETRIC_SWEEP * if sortype is not None: * csortype = asInt(sortype) # <<<<<<<<<<<<<< * cdef PetscReal cshift = asReal(shift) * cdef PetscInt cits = asInt(its) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_sortype); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(46, 3795, __pyx_L1_error) __pyx_v_csortype = ((MatSORType)__pyx_t_3); /* "petsc4py/PETSc/Mat.pyx":3794 * cdef PetscReal comega = asReal(omega) * cdef PetscMatSORType csortype = SOR_LOCAL_SYMMETRIC_SWEEP * if sortype is not None: # <<<<<<<<<<<<<< * csortype = asInt(sortype) * cdef PetscReal cshift = asReal(shift) */ } /* "petsc4py/PETSc/Mat.pyx":3796 * if sortype is not None: * csortype = asInt(sortype) * cdef PetscReal cshift = asReal(shift) # <<<<<<<<<<<<<< * cdef PetscInt cits = asInt(its) * cdef PetscInt clits = asInt(lits) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_shift); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(46, 3796, __pyx_L1_error) __pyx_v_cshift = __pyx_t_1; /* "petsc4py/PETSc/Mat.pyx":3797 * csortype = asInt(sortype) * cdef PetscReal cshift = asReal(shift) * cdef PetscInt cits = asInt(its) # <<<<<<<<<<<<<< * cdef PetscInt clits = asInt(lits) * CHKERR( MatSOR(self.mat, b.vec, comega, csortype, cshift, cits, clits, x.vec) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_its); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(46, 3797, __pyx_L1_error) __pyx_v_cits = __pyx_t_3; /* "petsc4py/PETSc/Mat.pyx":3798 * cdef PetscReal cshift = asReal(shift) * cdef PetscInt cits = asInt(its) * cdef PetscInt clits = asInt(lits) # <<<<<<<<<<<<<< * CHKERR( MatSOR(self.mat, b.vec, comega, csortype, cshift, cits, clits, x.vec) ) * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_lits); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(46, 3798, __pyx_L1_error) __pyx_v_clits = __pyx_t_3; /* "petsc4py/PETSc/Mat.pyx":3799 * cdef PetscInt cits = asInt(its) * cdef PetscInt clits = asInt(lits) * CHKERR( MatSOR(self.mat, b.vec, comega, csortype, cshift, cits, clits, x.vec) ) # <<<<<<<<<<<<<< * * # */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSOR(__pyx_v_self->mat, __pyx_v_b->vec, __pyx_v_comega, __pyx_v_csortype, __pyx_v_cshift, __pyx_v_cits, __pyx_v_clits, __pyx_v_x->vec)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3799, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":3773 * # SOR * * def SOR( # <<<<<<<<<<<<<< * self, * Vec b, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.SOR", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":3803 * # * * def getDiagonalBlock(self) -> Mat: # <<<<<<<<<<<<<< * """Return the part of the matrix associated with the on-process coupling. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_327getDiagonalBlock(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_326getDiagonalBlock, "Mat.getDiagonalBlock(self) -> Mat\nReturn the part of the matrix associated with the on-process coupling.\n\n Not collective.\n\n See Also\n --------\n petsc.MatGetDiagonalBlock\n\n \nSource code at petsc4py/PETSc/Mat.pyx:3803"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_327getDiagonalBlock(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getDiagonalBlock (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getDiagonalBlock", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getDiagonalBlock", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_326getDiagonalBlock(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_326getDiagonalBlock(struct PyPetscMatObject *__pyx_v_self) { struct PyPetscMatObject *__pyx_v_submat = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getDiagonalBlock", 1); /* "petsc4py/PETSc/Mat.pyx":3813 * * """ * cdef Mat submat = Mat() # <<<<<<<<<<<<<< * CHKERR( MatGetDiagonalBlock(self.mat, &submat.mat) ) * CHKERR( PetscINCREF(submat.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 3813, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_submat = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Mat.pyx":3814 * """ * cdef Mat submat = Mat() * CHKERR( MatGetDiagonalBlock(self.mat, &submat.mat) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(submat.obj) ) * return submat */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetDiagonalBlock(__pyx_v_self->mat, (&__pyx_v_submat->mat))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3814, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":3815 * cdef Mat submat = Mat() * CHKERR( MatGetDiagonalBlock(self.mat, &submat.mat) ) * CHKERR( PetscINCREF(submat.obj) ) # <<<<<<<<<<<<<< * return submat * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_submat->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3815, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":3816 * CHKERR( MatGetDiagonalBlock(self.mat, &submat.mat) ) * CHKERR( PetscINCREF(submat.obj) ) * return submat # <<<<<<<<<<<<<< * * def increaseOverlap(self, IS iset, overlap: int = 1) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_submat); __pyx_r = ((PyObject *)__pyx_v_submat); goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":3803 * # * * def getDiagonalBlock(self) -> Mat: # <<<<<<<<<<<<<< * """Return the part of the matrix associated with the on-process coupling. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getDiagonalBlock", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_submat); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":3818 * return submat * * def increaseOverlap(self, IS iset, overlap: int = 1) -> None: # <<<<<<<<<<<<<< * """Increase the overlap of a index set. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_329increaseOverlap(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_328increaseOverlap, "Mat.increaseOverlap(self, iset: IS, overlap: int = 1) -> None\nIncrease the overlap of a index set.\n\n Collective.\n\n See Also\n --------\n petsc.MatIncreaseOverlap\n\n \nSource code at petsc4py/PETSc/Mat.pyx:3818"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_329increaseOverlap(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscISObject *__pyx_v_iset = 0; PyObject *__pyx_v_overlap = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("increaseOverlap (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_iset,&__pyx_n_s_overlap,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_1)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_iset)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3818, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_overlap); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3818, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "increaseOverlap") < 0)) __PYX_ERR(46, 3818, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_iset = ((struct PyPetscISObject *)values[0]); __pyx_v_overlap = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("increaseOverlap", 0, 1, 2, __pyx_nargs); __PYX_ERR(46, 3818, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.increaseOverlap", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iset), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "iset", 0))) __PYX_ERR(46, 3818, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_328increaseOverlap(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_iset, __pyx_v_overlap); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_328increaseOverlap(struct PyPetscMatObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset, PyObject *__pyx_v_overlap) { PetscInt __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("increaseOverlap", 1); /* "petsc4py/PETSc/Mat.pyx":3828 * * """ * cdef PetscInt ival = asInt(overlap) # <<<<<<<<<<<<<< * CHKERR( MatIncreaseOverlap(self.mat, 1, &iset.iset, ival) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_overlap); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(46, 3828, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "petsc4py/PETSc/Mat.pyx":3829 * """ * cdef PetscInt ival = asInt(overlap) * CHKERR( MatIncreaseOverlap(self.mat, 1, &iset.iset, ival) ) # <<<<<<<<<<<<<< * * def createSubMatrix(self, IS isrow, IS iscol=None, Mat submat=None) -> Mat: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatIncreaseOverlap(__pyx_v_self->mat, 1, (&__pyx_v_iset->iset), __pyx_v_ival)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3829, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":3818 * return submat * * def increaseOverlap(self, IS iset, overlap: int = 1) -> None: # <<<<<<<<<<<<<< * """Increase the overlap of a index set. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.increaseOverlap", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":3831 * CHKERR( MatIncreaseOverlap(self.mat, 1, &iset.iset, ival) ) * * def createSubMatrix(self, IS isrow, IS iscol=None, Mat submat=None) -> Mat: # <<<<<<<<<<<<<< * """Return a submatrix. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_331createSubMatrix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_330createSubMatrix, "Mat.createSubMatrix(self, isrow: IS, iscol: IS | None = None, submat: Mat | None = None) -> Mat\nReturn a submatrix.\n\n Collective.\n\n Parameters\n ----------\n isrow\n Row index set.\n iscol\n Column index set. If `None`, ``iscol = isrow``.\n submat\n Optional resultant matrix.\n When `None`, a new matrix is created, and ``MAT_INITIAL_MATRIX`` is used.\n When not `None`, the matrix is reused with ``MAT_REUSE_MATRIX``.\n\n See Also\n --------\n petsc.MatCreateSubMatrix\n\n \nSource code at petsc4py/PETSc/Mat.pyx:3831"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_331createSubMatrix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscISObject *__pyx_v_isrow = 0; struct PyPetscISObject *__pyx_v_iscol = 0; struct PyPetscMatObject *__pyx_v_submat = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createSubMatrix (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_isrow,&__pyx_n_s_iscol,&__pyx_n_s_submat,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscISObject *)Py_None)); values[2] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscMatObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_isrow)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3831, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_iscol); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3831, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_submat); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3831, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createSubMatrix") < 0)) __PYX_ERR(46, 3831, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_isrow = ((struct PyPetscISObject *)values[0]); __pyx_v_iscol = ((struct PyPetscISObject *)values[1]); __pyx_v_submat = ((struct PyPetscMatObject *)values[2]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createSubMatrix", 0, 1, 3, __pyx_nargs); __PYX_ERR(46, 3831, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.createSubMatrix", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isrow), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "isrow", 0))) __PYX_ERR(46, 3831, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iscol), __pyx_ptype_8petsc4py_5PETSc_IS, 1, "iscol", 0))) __PYX_ERR(46, 3831, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_submat), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "submat", 0))) __PYX_ERR(46, 3831, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_330createSubMatrix(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_isrow, __pyx_v_iscol, __pyx_v_submat); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_330createSubMatrix(struct PyPetscMatObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_isrow, struct PyPetscISObject *__pyx_v_iscol, struct PyPetscMatObject *__pyx_v_submat) { MatReuse __pyx_v_reuse; IS __pyx_v_ciscol; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; IS __pyx_t_2; PyObject *__pyx_t_3 = NULL; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createSubMatrix", 0); __Pyx_INCREF((PyObject *)__pyx_v_submat); /* "petsc4py/PETSc/Mat.pyx":3852 * * """ * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX # <<<<<<<<<<<<<< * cdef PetscIS ciscol = NULL * if iscol is not None: ciscol = iscol.iset */ __pyx_v_reuse = MAT_INITIAL_MATRIX; /* "petsc4py/PETSc/Mat.pyx":3853 * """ * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * cdef PetscIS ciscol = NULL # <<<<<<<<<<<<<< * if iscol is not None: ciscol = iscol.iset * if submat is None: submat = Mat() */ __pyx_v_ciscol = NULL; /* "petsc4py/PETSc/Mat.pyx":3854 * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * cdef PetscIS ciscol = NULL * if iscol is not None: ciscol = iscol.iset # <<<<<<<<<<<<<< * if submat is None: submat = Mat() * if submat.mat != NULL: reuse = MAT_REUSE_MATRIX */ __pyx_t_1 = (((PyObject *)__pyx_v_iscol) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_iscol->iset; __pyx_v_ciscol = __pyx_t_2; } /* "petsc4py/PETSc/Mat.pyx":3855 * cdef PetscIS ciscol = NULL * if iscol is not None: ciscol = iscol.iset * if submat is None: submat = Mat() # <<<<<<<<<<<<<< * if submat.mat != NULL: reuse = MAT_REUSE_MATRIX * CHKERR( MatCreateSubMatrix(self.mat, isrow.iset, ciscol, */ __pyx_t_1 = (((PyObject *)__pyx_v_submat) == Py_None); if (__pyx_t_1) { __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 3855, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_submat, ((struct PyPetscMatObject *)__pyx_t_3)); __pyx_t_3 = 0; } /* "petsc4py/PETSc/Mat.pyx":3856 * if iscol is not None: ciscol = iscol.iset * if submat is None: submat = Mat() * if submat.mat != NULL: reuse = MAT_REUSE_MATRIX # <<<<<<<<<<<<<< * CHKERR( MatCreateSubMatrix(self.mat, isrow.iset, ciscol, * reuse, &submat.mat) ) */ __pyx_t_1 = (__pyx_v_submat->mat != NULL); if (__pyx_t_1) { __pyx_v_reuse = MAT_REUSE_MATRIX; } /* "petsc4py/PETSc/Mat.pyx":3857 * if submat is None: submat = Mat() * if submat.mat != NULL: reuse = MAT_REUSE_MATRIX * CHKERR( MatCreateSubMatrix(self.mat, isrow.iset, ciscol, # <<<<<<<<<<<<<< * reuse, &submat.mat) ) * return submat */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreateSubMatrix(__pyx_v_self->mat, __pyx_v_isrow->iset, __pyx_v_ciscol, __pyx_v_reuse, (&__pyx_v_submat->mat))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3857, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":3859 * CHKERR( MatCreateSubMatrix(self.mat, isrow.iset, ciscol, * reuse, &submat.mat) ) * return submat # <<<<<<<<<<<<<< * * def createSubMatrices( */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_submat); __pyx_r = ((PyObject *)__pyx_v_submat); goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":3831 * CHKERR( MatIncreaseOverlap(self.mat, 1, &iset.iset, ival) ) * * def createSubMatrix(self, IS isrow, IS iscol=None, Mat submat=None) -> Mat: # <<<<<<<<<<<<<< * """Return a submatrix. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.createSubMatrix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_submat); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":3861 * return submat * * def createSubMatrices( # <<<<<<<<<<<<<< * self, * isrows: IS | Sequence[IS], */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_333createSubMatrices(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_332createSubMatrices, "Mat.createSubMatrices(self, isrows: IS | Sequence[IS], iscols: IS | Sequence[IS] = None, submats: Mat | Sequence[Mat] = None) -> Sequence[Mat]\nReturn several sequential submatrices.\n\n Collective.\n\n Parameters\n ----------\n isrows\n Row index sets.\n iscols\n Column index sets. If `None`, ``iscols = isrows``.\n submats\n Optional resultant matrices.\n When `None`, new matrices are created, and ``MAT_INITIAL_MATRIX`` is used.\n When not `None`, the matrices are reused with ``MAT_REUSE_MATRIX``.\n\n See Also\n --------\n petsc.MatCreateSubMatrices\n\n \nSource code at petsc4py/PETSc/Mat.pyx:3861"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_333createSubMatrices(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_isrows = 0; PyObject *__pyx_v_iscols = 0; PyObject *__pyx_v_submats = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createSubMatrices (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_isrows,&__pyx_n_s_iscols,&__pyx_n_s_submats,0}; /* "petsc4py/PETSc/Mat.pyx":3864 * self, * isrows: IS | Sequence[IS], * iscols: IS | Sequence[IS] = None, # <<<<<<<<<<<<<< * submats: Mat | Sequence[Mat] = None, * ) -> Sequence[Mat]: */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Mat.pyx":3865 * isrows: IS | Sequence[IS], * iscols: IS | Sequence[IS] = None, * submats: Mat | Sequence[Mat] = None, # <<<<<<<<<<<<<< * ) -> Sequence[Mat]: * """Return several sequential submatrices. */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_isrows)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3861, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_iscols); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3861, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_submats); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3861, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createSubMatrices") < 0)) __PYX_ERR(46, 3861, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_isrows = values[0]; __pyx_v_iscols = values[1]; __pyx_v_submats = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createSubMatrices", 0, 1, 3, __pyx_nargs); __PYX_ERR(46, 3861, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.createSubMatrices", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_332createSubMatrices(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_isrows, __pyx_v_iscols, __pyx_v_submats); /* "petsc4py/PETSc/Mat.pyx":3861 * return submat * * def createSubMatrices( # <<<<<<<<<<<<<< * self, * isrows: IS | Sequence[IS], */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_332createSubMatrices(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_isrows, PyObject *__pyx_v_iscols, PyObject *__pyx_v_submats) { Py_ssize_t __pyx_v_i; Py_ssize_t __pyx_v_n; MatReuse __pyx_v_reuse; IS *__pyx_v_cisrows; IS *__pyx_v_ciscols; Mat *__pyx_v_cmats; CYTHON_UNUSED PyObject *__pyx_v_tmp1 = 0; CYTHON_UNUSED PyObject *__pyx_v_tmp2 = 0; struct PyPetscMatObject *__pyx_v_mat = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; Py_ssize_t __pyx_t_5; IS __pyx_t_6; PetscErrorCode __pyx_t_7; Mat __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createSubMatrices", 0); __Pyx_INCREF(__pyx_v_isrows); __Pyx_INCREF(__pyx_v_iscols); __Pyx_INCREF(__pyx_v_submats); /* "petsc4py/PETSc/Mat.pyx":3887 * * """ * if iscols is None: iscols = isrows # <<<<<<<<<<<<<< * isrows = [isrows] if isinstance(isrows, IS) else list(isrows) * iscols = [iscols] if isinstance(iscols, IS) else list(iscols) */ __pyx_t_1 = (__pyx_v_iscols == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_v_isrows); __Pyx_DECREF_SET(__pyx_v_iscols, __pyx_v_isrows); } /* "petsc4py/PETSc/Mat.pyx":3888 * """ * if iscols is None: iscols = isrows * isrows = [isrows] if isinstance(isrows, IS) else list(isrows) # <<<<<<<<<<<<<< * iscols = [iscols] if isinstance(iscols, IS) else list(iscols) * assert len(isrows) == len(iscols) */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_isrows, __pyx_ptype_8petsc4py_5PETSc_IS); if (__pyx_t_1) { __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 3888, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_isrows); __Pyx_GIVEREF(__pyx_v_isrows); if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_v_isrows)) __PYX_ERR(46, 3888, __pyx_L1_error); __pyx_t_2 = __pyx_t_3; __pyx_t_3 = 0; } else { __pyx_t_3 = PySequence_List(__pyx_v_isrows); if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 3888, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __pyx_t_3; __pyx_t_3 = 0; } __Pyx_DECREF_SET(__pyx_v_isrows, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/Mat.pyx":3889 * if iscols is None: iscols = isrows * isrows = [isrows] if isinstance(isrows, IS) else list(isrows) * iscols = [iscols] if isinstance(iscols, IS) else list(iscols) # <<<<<<<<<<<<<< * assert len(isrows) == len(iscols) * cdef Py_ssize_t i, n = len(isrows) */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_iscols, __pyx_ptype_8petsc4py_5PETSc_IS); if (__pyx_t_1) { __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 3889, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_iscols); __Pyx_GIVEREF(__pyx_v_iscols); if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_v_iscols)) __PYX_ERR(46, 3889, __pyx_L1_error); __pyx_t_2 = __pyx_t_3; __pyx_t_3 = 0; } else { __pyx_t_3 = PySequence_List(__pyx_v_iscols); if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 3889, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __pyx_t_3; __pyx_t_3 = 0; } __Pyx_DECREF_SET(__pyx_v_iscols, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/Mat.pyx":3890 * isrows = [isrows] if isinstance(isrows, IS) else list(isrows) * iscols = [iscols] if isinstance(iscols, IS) else list(iscols) * assert len(isrows) == len(iscols) # <<<<<<<<<<<<<< * cdef Py_ssize_t i, n = len(isrows) * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_4 = PyObject_Length(__pyx_v_isrows); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(46, 3890, __pyx_L1_error) __pyx_t_5 = PyObject_Length(__pyx_v_iscols); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(46, 3890, __pyx_L1_error) __pyx_t_1 = (__pyx_t_4 == __pyx_t_5); if (unlikely(!__pyx_t_1)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(46, 3890, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(46, 3890, __pyx_L1_error) #endif /* "petsc4py/PETSc/Mat.pyx":3891 * iscols = [iscols] if isinstance(iscols, IS) else list(iscols) * assert len(isrows) == len(iscols) * cdef Py_ssize_t i, n = len(isrows) # <<<<<<<<<<<<<< * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * cdef PetscIS *cisrows = NULL */ __pyx_t_5 = PyObject_Length(__pyx_v_isrows); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(46, 3891, __pyx_L1_error) __pyx_v_n = __pyx_t_5; /* "petsc4py/PETSc/Mat.pyx":3892 * assert len(isrows) == len(iscols) * cdef Py_ssize_t i, n = len(isrows) * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX # <<<<<<<<<<<<<< * cdef PetscIS *cisrows = NULL * cdef PetscIS *ciscols = NULL */ __pyx_v_reuse = MAT_INITIAL_MATRIX; /* "petsc4py/PETSc/Mat.pyx":3893 * cdef Py_ssize_t i, n = len(isrows) * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * cdef PetscIS *cisrows = NULL # <<<<<<<<<<<<<< * cdef PetscIS *ciscols = NULL * cdef PetscMat *cmats = NULL */ __pyx_v_cisrows = NULL; /* "petsc4py/PETSc/Mat.pyx":3894 * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * cdef PetscIS *cisrows = NULL * cdef PetscIS *ciscols = NULL # <<<<<<<<<<<<<< * cdef PetscMat *cmats = NULL * cdef object tmp1, tmp2 */ __pyx_v_ciscols = NULL; /* "petsc4py/PETSc/Mat.pyx":3895 * cdef PetscIS *cisrows = NULL * cdef PetscIS *ciscols = NULL * cdef PetscMat *cmats = NULL # <<<<<<<<<<<<<< * cdef object tmp1, tmp2 * cdef Mat mat */ __pyx_v_cmats = NULL; /* "petsc4py/PETSc/Mat.pyx":3898 * cdef object tmp1, tmp2 * cdef Mat mat * tmp1 = oarray_p(empty_p(n), NULL, &cisrows) # <<<<<<<<<<<<<< * for i from 0 <= i < n: cisrows[i] = (isrows[i]).iset * tmp2 = oarray_p(empty_p(n), NULL, &ciscols) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_n)); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 3898, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_2, NULL, ((void **)(&__pyx_v_cisrows)))); if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 3898, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_tmp1 = __pyx_t_3; __pyx_t_3 = 0; /* "petsc4py/PETSc/Mat.pyx":3899 * cdef Mat mat * tmp1 = oarray_p(empty_p(n), NULL, &cisrows) * for i from 0 <= i < n: cisrows[i] = (isrows[i]).iset # <<<<<<<<<<<<<< * tmp2 = oarray_p(empty_p(n), NULL, &ciscols) * for i from 0 <= i < n: ciscols[i] = (iscols[i]).iset */ __pyx_t_5 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) { __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_isrows, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 3899, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (!(likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(46, 3899, __pyx_L1_error) __pyx_t_6 = ((struct PyPetscISObject *)__pyx_t_3)->iset; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; (__pyx_v_cisrows[__pyx_v_i]) = __pyx_t_6; } /* "petsc4py/PETSc/Mat.pyx":3900 * tmp1 = oarray_p(empty_p(n), NULL, &cisrows) * for i from 0 <= i < n: cisrows[i] = (isrows[i]).iset * tmp2 = oarray_p(empty_p(n), NULL, &ciscols) # <<<<<<<<<<<<<< * for i from 0 <= i < n: ciscols[i] = (iscols[i]).iset * if submats is not None: */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_n)); if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 3900, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_3, NULL, ((void **)(&__pyx_v_ciscols)))); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 3900, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_tmp2 = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/Mat.pyx":3901 * for i from 0 <= i < n: cisrows[i] = (isrows[i]).iset * tmp2 = oarray_p(empty_p(n), NULL, &ciscols) * for i from 0 <= i < n: ciscols[i] = (iscols[i]).iset # <<<<<<<<<<<<<< * if submats is not None: * reuse = MAT_REUSE_MATRIX */ __pyx_t_5 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) { __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_iscols, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 3901, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (!(likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(46, 3901, __pyx_L1_error) __pyx_t_6 = ((struct PyPetscISObject *)__pyx_t_2)->iset; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; (__pyx_v_ciscols[__pyx_v_i]) = __pyx_t_6; } /* "petsc4py/PETSc/Mat.pyx":3902 * tmp2 = oarray_p(empty_p(n), NULL, &ciscols) * for i from 0 <= i < n: ciscols[i] = (iscols[i]).iset * if submats is not None: # <<<<<<<<<<<<<< * reuse = MAT_REUSE_MATRIX * submats = list(submats) */ __pyx_t_1 = (__pyx_v_submats != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/Mat.pyx":3903 * for i from 0 <= i < n: ciscols[i] = (iscols[i]).iset * if submats is not None: * reuse = MAT_REUSE_MATRIX # <<<<<<<<<<<<<< * submats = list(submats) * assert len(submats) == len(isrows) */ __pyx_v_reuse = MAT_REUSE_MATRIX; /* "petsc4py/PETSc/Mat.pyx":3904 * if submats is not None: * reuse = MAT_REUSE_MATRIX * submats = list(submats) # <<<<<<<<<<<<<< * assert len(submats) == len(isrows) * CHKERR( PetscMalloc((n+1)*sizeof(PetscMat), &cmats) ) */ __pyx_t_2 = PySequence_List(__pyx_v_submats); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 3904, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_submats, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/Mat.pyx":3905 * reuse = MAT_REUSE_MATRIX * submats = list(submats) * assert len(submats) == len(isrows) # <<<<<<<<<<<<<< * CHKERR( PetscMalloc((n+1)*sizeof(PetscMat), &cmats) ) * for i from 0 <= i < n: cmats[i] = (submats[i]).mat */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_5 = PyObject_Length(__pyx_v_submats); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(46, 3905, __pyx_L1_error) __pyx_t_4 = PyObject_Length(__pyx_v_isrows); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(46, 3905, __pyx_L1_error) __pyx_t_1 = (__pyx_t_5 == __pyx_t_4); if (unlikely(!__pyx_t_1)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(46, 3905, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(46, 3905, __pyx_L1_error) #endif /* "petsc4py/PETSc/Mat.pyx":3906 * submats = list(submats) * assert len(submats) == len(isrows) * CHKERR( PetscMalloc((n+1)*sizeof(PetscMat), &cmats) ) # <<<<<<<<<<<<<< * for i from 0 <= i < n: cmats[i] = (submats[i]).mat * CHKERR( MatCreateSubMatrices(self.mat, n, cisrows, ciscols, reuse, &cmats) ) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((((size_t)(__pyx_v_n + 1)) * (sizeof(Mat))), (&__pyx_v_cmats))); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3906, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":3907 * assert len(submats) == len(isrows) * CHKERR( PetscMalloc((n+1)*sizeof(PetscMat), &cmats) ) * for i from 0 <= i < n: cmats[i] = (submats[i]).mat # <<<<<<<<<<<<<< * CHKERR( MatCreateSubMatrices(self.mat, n, cisrows, ciscols, reuse, &cmats) ) * for i from 0 <= i < n: CHKERR( PetscINCREF(&cmats[i]) ) */ __pyx_t_4 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_submats, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 3907, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (!(likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_Mat)))) __PYX_ERR(46, 3907, __pyx_L1_error) __pyx_t_8 = ((struct PyPetscMatObject *)__pyx_t_2)->mat; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; (__pyx_v_cmats[__pyx_v_i]) = __pyx_t_8; } /* "petsc4py/PETSc/Mat.pyx":3902 * tmp2 = oarray_p(empty_p(n), NULL, &ciscols) * for i from 0 <= i < n: ciscols[i] = (iscols[i]).iset * if submats is not None: # <<<<<<<<<<<<<< * reuse = MAT_REUSE_MATRIX * submats = list(submats) */ } /* "petsc4py/PETSc/Mat.pyx":3908 * CHKERR( PetscMalloc((n+1)*sizeof(PetscMat), &cmats) ) * for i from 0 <= i < n: cmats[i] = (submats[i]).mat * CHKERR( MatCreateSubMatrices(self.mat, n, cisrows, ciscols, reuse, &cmats) ) # <<<<<<<<<<<<<< * for i from 0 <= i < n: CHKERR( PetscINCREF(&cmats[i]) ) * if reuse == MAT_INITIAL_MATRIX: */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreateSubMatrices(__pyx_v_self->mat, ((PetscInt)__pyx_v_n), __pyx_v_cisrows, __pyx_v_ciscols, __pyx_v_reuse, (&__pyx_v_cmats))); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3908, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":3909 * for i from 0 <= i < n: cmats[i] = (submats[i]).mat * CHKERR( MatCreateSubMatrices(self.mat, n, cisrows, ciscols, reuse, &cmats) ) * for i from 0 <= i < n: CHKERR( PetscINCREF(&cmats[i]) ) # <<<<<<<<<<<<<< * if reuse == MAT_INITIAL_MATRIX: * submats = [None] * n */ __pyx_t_4 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(((PetscObject *)(&(__pyx_v_cmats[__pyx_v_i]))))); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3909, __pyx_L1_error) } /* "petsc4py/PETSc/Mat.pyx":3910 * CHKERR( MatCreateSubMatrices(self.mat, n, cisrows, ciscols, reuse, &cmats) ) * for i from 0 <= i < n: CHKERR( PetscINCREF(&cmats[i]) ) * if reuse == MAT_INITIAL_MATRIX: # <<<<<<<<<<<<<< * submats = [None] * n * for i from 0 <= i < n: */ __pyx_t_1 = (__pyx_v_reuse == MAT_INITIAL_MATRIX); if (__pyx_t_1) { /* "petsc4py/PETSc/Mat.pyx":3911 * for i from 0 <= i < n: CHKERR( PetscINCREF(&cmats[i]) ) * if reuse == MAT_INITIAL_MATRIX: * submats = [None] * n # <<<<<<<<<<<<<< * for i from 0 <= i < n: * submats[i] = mat = Mat() */ __pyx_t_2 = PyList_New(1 * ((__pyx_v_n<0) ? 0:__pyx_v_n)); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 3911, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < __pyx_v_n; __pyx_temp++) { __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, __pyx_temp, Py_None)) __PYX_ERR(46, 3911, __pyx_L1_error); } } __Pyx_DECREF_SET(__pyx_v_submats, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/Mat.pyx":3912 * if reuse == MAT_INITIAL_MATRIX: * submats = [None] * n * for i from 0 <= i < n: # <<<<<<<<<<<<<< * submats[i] = mat = Mat() * mat.mat = cmats[i] */ __pyx_t_4 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { /* "petsc4py/PETSc/Mat.pyx":3913 * submats = [None] * n * for i from 0 <= i < n: * submats[i] = mat = Mat() # <<<<<<<<<<<<<< * mat.mat = cmats[i] * CHKERR( MatDestroyMatrices(n, &cmats) ) */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 3913, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (unlikely((__Pyx_SetItemInt(__pyx_v_submats, __pyx_v_i, __pyx_t_2, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1) < 0))) __PYX_ERR(46, 3913, __pyx_L1_error) __Pyx_INCREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_mat, ((struct PyPetscMatObject *)__pyx_t_2)); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/Mat.pyx":3914 * for i from 0 <= i < n: * submats[i] = mat = Mat() * mat.mat = cmats[i] # <<<<<<<<<<<<<< * CHKERR( MatDestroyMatrices(n, &cmats) ) * return submats */ __pyx_v_mat->mat = (__pyx_v_cmats[__pyx_v_i]); } /* "petsc4py/PETSc/Mat.pyx":3910 * CHKERR( MatCreateSubMatrices(self.mat, n, cisrows, ciscols, reuse, &cmats) ) * for i from 0 <= i < n: CHKERR( PetscINCREF(&cmats[i]) ) * if reuse == MAT_INITIAL_MATRIX: # <<<<<<<<<<<<<< * submats = [None] * n * for i from 0 <= i < n: */ } /* "petsc4py/PETSc/Mat.pyx":3915 * submats[i] = mat = Mat() * mat.mat = cmats[i] * CHKERR( MatDestroyMatrices(n, &cmats) ) # <<<<<<<<<<<<<< * return submats * */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDestroyMatrices(((PetscInt)__pyx_v_n), (&__pyx_v_cmats))); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3915, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":3916 * mat.mat = cmats[i] * CHKERR( MatDestroyMatrices(n, &cmats) ) * return submats # <<<<<<<<<<<<<< * * # */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_submats); __pyx_r = __pyx_v_submats; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":3861 * return submat * * def createSubMatrices( # <<<<<<<<<<<<<< * self, * isrows: IS | Sequence[IS], */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.createSubMatrices", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_tmp1); __Pyx_XDECREF(__pyx_v_tmp2); __Pyx_XDECREF((PyObject *)__pyx_v_mat); __Pyx_XDECREF(__pyx_v_isrows); __Pyx_XDECREF(__pyx_v_iscols); __Pyx_XDECREF(__pyx_v_submats); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":3920 * # * * def getLocalSubMatrix(self, IS isrow, IS iscol, Mat submat=None) -> Mat: # <<<<<<<<<<<<<< * """Return a reference to a submatrix specified in local numbering. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_335getLocalSubMatrix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_334getLocalSubMatrix, "Mat.getLocalSubMatrix(self, isrow: IS, iscol: IS, submat: Mat | None = None) -> Mat\nReturn a reference to a submatrix specified in local numbering.\n\n Collective.\n\n Parameters\n ----------\n isrow\n Row index set.\n iscol\n Column index set.\n submat\n Optional resultant matrix.\n When `None`, a new matrix is created.\n When not `None`, the matrix is first destroyed and then recreated.\n\n See Also\n --------\n restoreLocalSubMatrix, petsc.MatGetLocalSubMatrix\n\n \nSource code at petsc4py/PETSc/Mat.pyx:3920"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_335getLocalSubMatrix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscISObject *__pyx_v_isrow = 0; struct PyPetscISObject *__pyx_v_iscol = 0; struct PyPetscMatObject *__pyx_v_submat = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getLocalSubMatrix (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_isrow,&__pyx_n_s_iscol,&__pyx_n_s_submat,0}; values[2] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscMatObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_isrow)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3920, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_iscol)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3920, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("getLocalSubMatrix", 0, 2, 3, 1); __PYX_ERR(46, 3920, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_submat); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3920, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getLocalSubMatrix") < 0)) __PYX_ERR(46, 3920, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_isrow = ((struct PyPetscISObject *)values[0]); __pyx_v_iscol = ((struct PyPetscISObject *)values[1]); __pyx_v_submat = ((struct PyPetscMatObject *)values[2]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getLocalSubMatrix", 0, 2, 3, __pyx_nargs); __PYX_ERR(46, 3920, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.getLocalSubMatrix", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isrow), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "isrow", 0))) __PYX_ERR(46, 3920, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iscol), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "iscol", 0))) __PYX_ERR(46, 3920, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_submat), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "submat", 0))) __PYX_ERR(46, 3920, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_334getLocalSubMatrix(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_isrow, __pyx_v_iscol, __pyx_v_submat); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_334getLocalSubMatrix(struct PyPetscMatObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_isrow, struct PyPetscISObject *__pyx_v_iscol, struct PyPetscMatObject *__pyx_v_submat) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getLocalSubMatrix", 0); __Pyx_INCREF((PyObject *)__pyx_v_submat); /* "petsc4py/PETSc/Mat.pyx":3941 * * """ * if submat is None: submat = Mat() # <<<<<<<<<<<<<< * else: CHKERR( MatDestroy(&submat.mat) ) * CHKERR( MatGetLocalSubMatrix(self.mat, isrow.iset, iscol.iset, &submat.mat) ) */ __pyx_t_1 = (((PyObject *)__pyx_v_submat) == Py_None); if (__pyx_t_1) { __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 3941, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_submat, ((struct PyPetscMatObject *)__pyx_t_2)); __pyx_t_2 = 0; goto __pyx_L3; } /* "petsc4py/PETSc/Mat.pyx":3942 * """ * if submat is None: submat = Mat() * else: CHKERR( MatDestroy(&submat.mat) ) # <<<<<<<<<<<<<< * CHKERR( MatGetLocalSubMatrix(self.mat, isrow.iset, iscol.iset, &submat.mat) ) * return submat */ /*else*/ { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDestroy((&__pyx_v_submat->mat))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3942, __pyx_L1_error) } __pyx_L3:; /* "petsc4py/PETSc/Mat.pyx":3943 * if submat is None: submat = Mat() * else: CHKERR( MatDestroy(&submat.mat) ) * CHKERR( MatGetLocalSubMatrix(self.mat, isrow.iset, iscol.iset, &submat.mat) ) # <<<<<<<<<<<<<< * return submat * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetLocalSubMatrix(__pyx_v_self->mat, __pyx_v_isrow->iset, __pyx_v_iscol->iset, (&__pyx_v_submat->mat))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3943, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":3944 * else: CHKERR( MatDestroy(&submat.mat) ) * CHKERR( MatGetLocalSubMatrix(self.mat, isrow.iset, iscol.iset, &submat.mat) ) * return submat # <<<<<<<<<<<<<< * * def restoreLocalSubMatrix(self, IS isrow, IS iscol, Mat submat): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_submat); __pyx_r = ((PyObject *)__pyx_v_submat); goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":3920 * # * * def getLocalSubMatrix(self, IS isrow, IS iscol, Mat submat=None) -> Mat: # <<<<<<<<<<<<<< * """Return a reference to a submatrix specified in local numbering. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getLocalSubMatrix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_submat); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":3946 * return submat * * def restoreLocalSubMatrix(self, IS isrow, IS iscol, Mat submat): # <<<<<<<<<<<<<< * """Restore a reference to a submatrix obtained with `getLocalSubMatrix`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_337restoreLocalSubMatrix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_336restoreLocalSubMatrix, "Mat.restoreLocalSubMatrix(self, isrow: IS, iscol: IS, submat: Mat)\nRestore a reference to a submatrix obtained with `getLocalSubMatrix`.\n\n Collective.\n\n Parameters\n ----------\n isrow\n Row index set.\n iscol\n Column index set.\n submat\n The submatrix.\n\n See Also\n --------\n getLocalSubMatrix, petsc.MatRestoreLocalSubMatrix\n\n \nSource code at petsc4py/PETSc/Mat.pyx:3946"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_337restoreLocalSubMatrix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscISObject *__pyx_v_isrow = 0; struct PyPetscISObject *__pyx_v_iscol = 0; struct PyPetscMatObject *__pyx_v_submat = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("restoreLocalSubMatrix (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_isrow,&__pyx_n_s_iscol,&__pyx_n_s_submat,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_isrow)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3946, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_iscol)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3946, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("restoreLocalSubMatrix", 1, 3, 3, 1); __PYX_ERR(46, 3946, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_submat)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3946, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("restoreLocalSubMatrix", 1, 3, 3, 2); __PYX_ERR(46, 3946, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "restoreLocalSubMatrix") < 0)) __PYX_ERR(46, 3946, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_isrow = ((struct PyPetscISObject *)values[0]); __pyx_v_iscol = ((struct PyPetscISObject *)values[1]); __pyx_v_submat = ((struct PyPetscMatObject *)values[2]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("restoreLocalSubMatrix", 1, 3, 3, __pyx_nargs); __PYX_ERR(46, 3946, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.restoreLocalSubMatrix", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isrow), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "isrow", 0))) __PYX_ERR(46, 3946, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iscol), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "iscol", 0))) __PYX_ERR(46, 3946, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_submat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "submat", 0))) __PYX_ERR(46, 3946, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_336restoreLocalSubMatrix(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_isrow, __pyx_v_iscol, __pyx_v_submat); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_336restoreLocalSubMatrix(struct PyPetscMatObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_isrow, struct PyPetscISObject *__pyx_v_iscol, struct PyPetscMatObject *__pyx_v_submat) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("restoreLocalSubMatrix", 1); /* "petsc4py/PETSc/Mat.pyx":3965 * * """ * CHKERR( MatRestoreLocalSubMatrix(self.mat, isrow.iset, iscol.iset, &submat.mat) ) # <<<<<<<<<<<<<< * * # */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatRestoreLocalSubMatrix(__pyx_v_self->mat, __pyx_v_isrow->iset, __pyx_v_iscol->iset, (&__pyx_v_submat->mat))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3965, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":3946 * return submat * * def restoreLocalSubMatrix(self, IS isrow, IS iscol, Mat submat): # <<<<<<<<<<<<<< * """Restore a reference to a submatrix obtained with `getLocalSubMatrix`. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.restoreLocalSubMatrix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":3969 * # * * def norm( # <<<<<<<<<<<<<< * self, * norm_type: NormTypeSpec = None, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_339norm(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_338norm, "Mat.norm(self, norm_type: NormTypeSpec = None) -> float | tuple[float, float]\nCompute the requested matrix norm.\n\n Collective.\n\n A 2-tuple is returned if `NormType.NORM_1_AND_2` is specified.\n\n See Also\n --------\n petsc.MatNorm, petsc.NormType\n\n \nSource code at petsc4py/PETSc/Mat.pyx:3969"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_339norm(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_norm_type = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("norm (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_norm_type,0}; /* "petsc4py/PETSc/Mat.pyx":3971 * def norm( * self, * norm_type: NormTypeSpec = None, # <<<<<<<<<<<<<< * ) -> float | tuple[float, float]: * """Compute the requested matrix norm. */ values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_norm_type); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3969, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "norm") < 0)) __PYX_ERR(46, 3969, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_norm_type = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("norm", 0, 0, 1, __pyx_nargs); __PYX_ERR(46, 3969, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.norm", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_338norm(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_norm_type); /* "petsc4py/PETSc/Mat.pyx":3969 * # * * def norm( # <<<<<<<<<<<<<< * self, * norm_type: NormTypeSpec = None, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_338norm(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_norm_type) { NormType __pyx_v_norm_1_2; NormType __pyx_v_ntype; PetscReal __pyx_v_rval[2]; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; NormType __pyx_t_2; PetscErrorCode __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("norm", 1); /* "petsc4py/PETSc/Mat.pyx":3984 * * """ * cdef PetscNormType norm_1_2 = PETSC_NORM_1_AND_2 # <<<<<<<<<<<<<< * cdef PetscNormType ntype = PETSC_NORM_FROBENIUS * if norm_type is not None: ntype = norm_type */ __pyx_v_norm_1_2 = NORM_1_AND_2; /* "petsc4py/PETSc/Mat.pyx":3985 * """ * cdef PetscNormType norm_1_2 = PETSC_NORM_1_AND_2 * cdef PetscNormType ntype = PETSC_NORM_FROBENIUS # <<<<<<<<<<<<<< * if norm_type is not None: ntype = norm_type * cdef PetscReal rval[2] */ __pyx_v_ntype = NORM_FROBENIUS; /* "petsc4py/PETSc/Mat.pyx":3986 * cdef PetscNormType norm_1_2 = PETSC_NORM_1_AND_2 * cdef PetscNormType ntype = PETSC_NORM_FROBENIUS * if norm_type is not None: ntype = norm_type # <<<<<<<<<<<<<< * cdef PetscReal rval[2] * CHKERR( MatNorm(self.mat, ntype, rval) ) */ __pyx_t_1 = (__pyx_v_norm_type != Py_None); if (__pyx_t_1) { __pyx_t_2 = ((NormType)__Pyx_PyInt_As_NormType(__pyx_v_norm_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3986, __pyx_L1_error) __pyx_v_ntype = __pyx_t_2; } /* "petsc4py/PETSc/Mat.pyx":3988 * if norm_type is not None: ntype = norm_type * cdef PetscReal rval[2] * CHKERR( MatNorm(self.mat, ntype, rval) ) # <<<<<<<<<<<<<< * if ntype != norm_1_2: return toReal(rval[0]) * else: return (toReal(rval[0]), toReal(rval[1])) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatNorm(__pyx_v_self->mat, __pyx_v_ntype, __pyx_v_rval)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3988, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":3989 * cdef PetscReal rval[2] * CHKERR( MatNorm(self.mat, ntype, rval) ) * if ntype != norm_1_2: return toReal(rval[0]) # <<<<<<<<<<<<<< * else: return (toReal(rval[0]), toReal(rval[1])) * */ __pyx_t_1 = (__pyx_v_ntype != __pyx_v_norm_1_2); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toReal((__pyx_v_rval[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 3989, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; } /* "petsc4py/PETSc/Mat.pyx":3990 * CHKERR( MatNorm(self.mat, ntype, rval) ) * if ntype != norm_1_2: return toReal(rval[0]) * else: return (toReal(rval[0]), toReal(rval[1])) # <<<<<<<<<<<<<< * * def scale(self, alpha: Scalar) -> None: */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toReal((__pyx_v_rval[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 3990, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toReal((__pyx_v_rval[1])); if (unlikely(!__pyx_t_5)) __PYX_ERR(46, 3990, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(46, 3990, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4)) __PYX_ERR(46, 3990, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5)) __PYX_ERR(46, 3990, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; } /* "petsc4py/PETSc/Mat.pyx":3969 * # * * def norm( # <<<<<<<<<<<<<< * self, * norm_type: NormTypeSpec = None, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.Mat.norm", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":3992 * else: return (toReal(rval[0]), toReal(rval[1])) * * def scale(self, alpha: Scalar) -> None: # <<<<<<<<<<<<<< * """Scale the matrix. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_341scale(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_340scale, "Mat.scale(self, alpha: Scalar) -> None\nScale the matrix.\n\n Collective.\n\n See Also\n --------\n petsc.MatScale\n\n \nSource code at petsc4py/PETSc/Mat.pyx:3992"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_341scale(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_alpha = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("scale (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_alpha,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_alpha)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 3992, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "scale") < 0)) __PYX_ERR(46, 3992, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_alpha = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("scale", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 3992, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.scale", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_340scale(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_alpha); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_340scale(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_alpha) { PetscScalar __pyx_v_sval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscScalar __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("scale", 1); /* "petsc4py/PETSc/Mat.pyx":4002 * * """ * cdef PetscScalar sval = asScalar(alpha) # <<<<<<<<<<<<<< * CHKERR( MatScale(self.mat, sval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_alpha); if (unlikely(__pyx_t_1 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(46, 4002, __pyx_L1_error) __pyx_v_sval = __pyx_t_1; /* "petsc4py/PETSc/Mat.pyx":4003 * """ * cdef PetscScalar sval = asScalar(alpha) * CHKERR( MatScale(self.mat, sval) ) # <<<<<<<<<<<<<< * * def shift(self, alpha: Scalar) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatScale(__pyx_v_self->mat, __pyx_v_sval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 4003, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":3992 * else: return (toReal(rval[0]), toReal(rval[1])) * * def scale(self, alpha: Scalar) -> None: # <<<<<<<<<<<<<< * """Scale the matrix. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.scale", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":4005 * CHKERR( MatScale(self.mat, sval) ) * * def shift(self, alpha: Scalar) -> None: # <<<<<<<<<<<<<< * """Shift the matrix. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_343shift(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_342shift, "Mat.shift(self, alpha: Scalar) -> None\nShift the matrix.\n\n Collective.\n\n See Also\n --------\n petsc.MatShift\n\n \nSource code at petsc4py/PETSc/Mat.pyx:4005"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_343shift(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_alpha = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("shift (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_alpha,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_alpha)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4005, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "shift") < 0)) __PYX_ERR(46, 4005, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_alpha = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("shift", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 4005, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.shift", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_342shift(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_alpha); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_342shift(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_alpha) { PetscScalar __pyx_v_sval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscScalar __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("shift", 1); /* "petsc4py/PETSc/Mat.pyx":4015 * * """ * cdef PetscScalar sval = asScalar(alpha) # <<<<<<<<<<<<<< * CHKERR( MatShift(self.mat, sval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_alpha); if (unlikely(__pyx_t_1 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(46, 4015, __pyx_L1_error) __pyx_v_sval = __pyx_t_1; /* "petsc4py/PETSc/Mat.pyx":4016 * """ * cdef PetscScalar sval = asScalar(alpha) * CHKERR( MatShift(self.mat, sval) ) # <<<<<<<<<<<<<< * * def chop(self, tol: float) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatShift(__pyx_v_self->mat, __pyx_v_sval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 4016, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":4005 * CHKERR( MatScale(self.mat, sval) ) * * def shift(self, alpha: Scalar) -> None: # <<<<<<<<<<<<<< * """Shift the matrix. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.shift", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":4018 * CHKERR( MatShift(self.mat, sval) ) * * def chop(self, tol: float) -> None: # <<<<<<<<<<<<<< * """Set entries smallest of tol (in absolute values) to zero. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_345chop(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_344chop, "Mat.chop(self, tol: float) -> None\nSet entries smallest of tol (in absolute values) to zero.\n\n Collective.\n\n See Also\n --------\n petsc.MatFilter\n\n \nSource code at petsc4py/PETSc/Mat.pyx:4018"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_345chop(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_tol = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("chop (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tol,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_tol)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4018, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "chop") < 0)) __PYX_ERR(46, 4018, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_tol = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("chop", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 4018, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.chop", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_344chop(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_tol); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_344chop(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_tol) { PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("chop", 1); /* "petsc4py/PETSc/Mat.pyx":4028 * * """ * cdef PetscReal rval = asReal(tol) # <<<<<<<<<<<<<< * CHKERR( MatFilter(self.mat, rval, PETSC_FALSE, PETSC_FALSE) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_tol); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(46, 4028, __pyx_L1_error) __pyx_v_rval = __pyx_t_1; /* "petsc4py/PETSc/Mat.pyx":4029 * """ * cdef PetscReal rval = asReal(tol) * CHKERR( MatFilter(self.mat, rval, PETSC_FALSE, PETSC_FALSE) ) # <<<<<<<<<<<<<< * * def setRandom(self, Random random=None) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatFilter(__pyx_v_self->mat, __pyx_v_rval, PETSC_FALSE, PETSC_FALSE)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 4029, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":4018 * CHKERR( MatShift(self.mat, sval) ) * * def chop(self, tol: float) -> None: # <<<<<<<<<<<<<< * """Set entries smallest of tol (in absolute values) to zero. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.chop", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":4031 * CHKERR( MatFilter(self.mat, rval, PETSC_FALSE, PETSC_FALSE) ) * * def setRandom(self, Random random=None) -> None: # <<<<<<<<<<<<<< * """Set random values in the matrix. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_347setRandom(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_346setRandom, "Mat.setRandom(self, random: Random | None = None) -> None\nSet random values in the matrix.\n\n Collective.\n\n Parameters\n ----------\n random\n The random number generator object or `None` for the default.\n\n See Also\n --------\n petsc.MatSetRandom\n\n \nSource code at petsc4py/PETSc/Mat.pyx:4031"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_347setRandom(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscRandomObject *__pyx_v_random = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setRandom (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_random,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscRandomObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_random); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4031, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setRandom") < 0)) __PYX_ERR(46, 4031, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_random = ((struct PyPetscRandomObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setRandom", 0, 0, 1, __pyx_nargs); __PYX_ERR(46, 4031, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.setRandom", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_random), __pyx_ptype_8petsc4py_5PETSc_Random, 1, "random", 0))) __PYX_ERR(46, 4031, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_346setRandom(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_random); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_346setRandom(struct PyPetscMatObject *__pyx_v_self, struct PyPetscRandomObject *__pyx_v_random) { PetscRandom __pyx_v_rnd; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscRandom __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setRandom", 1); /* "petsc4py/PETSc/Mat.pyx":4046 * * """ * cdef PetscRandom rnd = NULL # <<<<<<<<<<<<<< * if random is not None: rnd = random.rnd * CHKERR( MatSetRandom(self.mat, rnd) ) */ __pyx_v_rnd = NULL; /* "petsc4py/PETSc/Mat.pyx":4047 * """ * cdef PetscRandom rnd = NULL * if random is not None: rnd = random.rnd # <<<<<<<<<<<<<< * CHKERR( MatSetRandom(self.mat, rnd) ) * */ __pyx_t_1 = (((PyObject *)__pyx_v_random) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_random->rnd; __pyx_v_rnd = __pyx_t_2; } /* "petsc4py/PETSc/Mat.pyx":4048 * cdef PetscRandom rnd = NULL * if random is not None: rnd = random.rnd * CHKERR( MatSetRandom(self.mat, rnd) ) # <<<<<<<<<<<<<< * * def axpy(self, alpha: Scalar, Mat X, structure: Structure = None) -> None: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSetRandom(__pyx_v_self->mat, __pyx_v_rnd)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 4048, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":4031 * CHKERR( MatFilter(self.mat, rval, PETSC_FALSE, PETSC_FALSE) ) * * def setRandom(self, Random random=None) -> None: # <<<<<<<<<<<<<< * """Set random values in the matrix. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setRandom", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":4050 * CHKERR( MatSetRandom(self.mat, rnd) ) * * def axpy(self, alpha: Scalar, Mat X, structure: Structure = None) -> None: # <<<<<<<<<<<<<< * """Perform the matrix summation ``self`` + = X. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_349axpy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_348axpy, "Mat.axpy(self, alpha: Scalar, X: Mat, structure: Structure = None) -> None\nPerform the matrix summation ``self`` + = \311\221\302\267X.\n\n Collective.\n\n Parameters\n ----------\n alpha\n The scalar.\n X\n The matrix to be added.\n structure\n The structure of the operation.\n\n See Also\n --------\n petsc.MatAXPY\n\n \nSource code at petsc4py/PETSc/Mat.pyx:4050"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_349axpy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_alpha = 0; struct PyPetscMatObject *__pyx_v_X = 0; PyObject *__pyx_v_structure = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("axpy (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_alpha,&__pyx_n_s_X,&__pyx_n_s_structure,0}; values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_alpha)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4050, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_X)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4050, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("axpy", 0, 2, 3, 1); __PYX_ERR(46, 4050, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_structure); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4050, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "axpy") < 0)) __PYX_ERR(46, 4050, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_alpha = values[0]; __pyx_v_X = ((struct PyPetscMatObject *)values[1]); __pyx_v_structure = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("axpy", 0, 2, 3, __pyx_nargs); __PYX_ERR(46, 4050, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.axpy", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_X), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "X", 0))) __PYX_ERR(46, 4050, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_348axpy(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_alpha, __pyx_v_X, __pyx_v_structure); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_348axpy(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_alpha, struct PyPetscMatObject *__pyx_v_X, PyObject *__pyx_v_structure) { PetscScalar __pyx_v_sval; MatStructure __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscScalar __pyx_t_1; MatStructure __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("axpy", 1); /* "petsc4py/PETSc/Mat.pyx":4069 * * """ * cdef PetscScalar sval = asScalar(alpha) # <<<<<<<<<<<<<< * cdef PetscMatStructure flag = matstructure(structure) * CHKERR( MatAXPY(self.mat, sval, X.mat, flag) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_alpha); if (unlikely(__pyx_t_1 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(46, 4069, __pyx_L1_error) __pyx_v_sval = __pyx_t_1; /* "petsc4py/PETSc/Mat.pyx":4070 * """ * cdef PetscScalar sval = asScalar(alpha) * cdef PetscMatStructure flag = matstructure(structure) # <<<<<<<<<<<<<< * CHKERR( MatAXPY(self.mat, sval, X.mat, flag) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_matstructure(__pyx_v_structure); if (unlikely(__pyx_t_2 == ((MatStructure)((MatStructure)-1L)))) __PYX_ERR(46, 4070, __pyx_L1_error) __pyx_v_flag = __pyx_t_2; /* "petsc4py/PETSc/Mat.pyx":4071 * cdef PetscScalar sval = asScalar(alpha) * cdef PetscMatStructure flag = matstructure(structure) * CHKERR( MatAXPY(self.mat, sval, X.mat, flag) ) # <<<<<<<<<<<<<< * * def aypx(self, alpha: Scalar, Mat X, structure: Structure = None) -> None: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatAXPY(__pyx_v_self->mat, __pyx_v_sval, __pyx_v_X->mat, __pyx_v_flag)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 4071, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":4050 * CHKERR( MatSetRandom(self.mat, rnd) ) * * def axpy(self, alpha: Scalar, Mat X, structure: Structure = None) -> None: # <<<<<<<<<<<<<< * """Perform the matrix summation ``self`` + = X. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.axpy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":4073 * CHKERR( MatAXPY(self.mat, sval, X.mat, flag) ) * * def aypx(self, alpha: Scalar, Mat X, structure: Structure = None) -> None: # <<<<<<<<<<<<<< * """Perform the matrix summation ``self`` = ``self`` + X. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_351aypx(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_350aypx, "Mat.aypx(self, alpha: Scalar, X: Mat, structure: Structure = None) -> None\nPerform the matrix summation ``self`` = \311\221\302\267``self`` + X.\n\n Collective.\n\n Parameters\n ----------\n alpha\n The scalar.\n X\n The matrix to be added.\n structure\n The structure of the operation.\n\n See Also\n --------\n petsc.MatAYPX\n\n \nSource code at petsc4py/PETSc/Mat.pyx:4073"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_351aypx(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_alpha = 0; struct PyPetscMatObject *__pyx_v_X = 0; PyObject *__pyx_v_structure = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("aypx (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_alpha,&__pyx_n_s_X,&__pyx_n_s_structure,0}; values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_alpha)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4073, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_X)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4073, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("aypx", 0, 2, 3, 1); __PYX_ERR(46, 4073, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_structure); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4073, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "aypx") < 0)) __PYX_ERR(46, 4073, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_alpha = values[0]; __pyx_v_X = ((struct PyPetscMatObject *)values[1]); __pyx_v_structure = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("aypx", 0, 2, 3, __pyx_nargs); __PYX_ERR(46, 4073, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.aypx", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_X), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "X", 0))) __PYX_ERR(46, 4073, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_350aypx(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_alpha, __pyx_v_X, __pyx_v_structure); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_350aypx(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_alpha, struct PyPetscMatObject *__pyx_v_X, PyObject *__pyx_v_structure) { PetscScalar __pyx_v_sval; MatStructure __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscScalar __pyx_t_1; MatStructure __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("aypx", 1); /* "petsc4py/PETSc/Mat.pyx":4092 * * """ * cdef PetscScalar sval = asScalar(alpha) # <<<<<<<<<<<<<< * cdef PetscMatStructure flag = matstructure(structure) * CHKERR( MatAYPX(self.mat, sval, X.mat, flag) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_alpha); if (unlikely(__pyx_t_1 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(46, 4092, __pyx_L1_error) __pyx_v_sval = __pyx_t_1; /* "petsc4py/PETSc/Mat.pyx":4093 * """ * cdef PetscScalar sval = asScalar(alpha) * cdef PetscMatStructure flag = matstructure(structure) # <<<<<<<<<<<<<< * CHKERR( MatAYPX(self.mat, sval, X.mat, flag) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_matstructure(__pyx_v_structure); if (unlikely(__pyx_t_2 == ((MatStructure)((MatStructure)-1L)))) __PYX_ERR(46, 4093, __pyx_L1_error) __pyx_v_flag = __pyx_t_2; /* "petsc4py/PETSc/Mat.pyx":4094 * cdef PetscScalar sval = asScalar(alpha) * cdef PetscMatStructure flag = matstructure(structure) * CHKERR( MatAYPX(self.mat, sval, X.mat, flag) ) # <<<<<<<<<<<<<< * * # matrix-matrix product */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatAYPX(__pyx_v_self->mat, __pyx_v_sval, __pyx_v_X->mat, __pyx_v_flag)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 4094, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":4073 * CHKERR( MatAXPY(self.mat, sval, X.mat, flag) ) * * def aypx(self, alpha: Scalar, Mat X, structure: Structure = None) -> None: # <<<<<<<<<<<<<< * """Perform the matrix summation ``self`` = ``self`` + X. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.aypx", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":4098 * # matrix-matrix product * * def matMult( # <<<<<<<<<<<<<< * self, * Mat mat, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_353matMult(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_352matMult, "Mat.matMult(self, mat: Mat, result: Mat | None = None, fill: float | None = None) -> Mat\nPerform matrix-matrix multiplication C=AB.\n\n Neighborwise collective.\n\n Parameters\n ----------\n mat\n The right hand matrix B.\n result\n The optional resultant matrix C. When `None`, a new matrix\n is created, and ``MAT_INITIAL_MATRIX`` is used. When C is\n not `None`, the matrix is reused with ``MAT_REUSE_MATRIX``.\n fill\n Expected fill as ratio of nnz(C)/(nnz(A) + nnz(B)), use\n `None` if you do not have a good estimate. If the\n result is a dense matrix this is irrelevant.\n\n Returns\n -------\n result : Mat\n The resultant product matrix C.\n\n Notes\n -----\n To determine the correct fill value, run with -info and search\n for the string \"Fill ratio\" to see the value actually needed.\n\n See Also\n --------\n petsc.MatMatMult, petsc.MatReuse\n\n \nSource code at petsc4py/PETSc/Mat.pyx:4098"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_353matMult(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscMatObject *__pyx_v_mat = 0; struct PyPetscMatObject *__pyx_v_result = 0; PyObject *__pyx_v_fill = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("matMult (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat,&__pyx_n_s_result,&__pyx_n_s_fill,0}; /* "petsc4py/PETSc/Mat.pyx":4101 * self, * Mat mat, * Mat result=None, # <<<<<<<<<<<<<< * fill: float | None = None * ) -> Mat: */ values[1] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscMatObject *)Py_None)); /* "petsc4py/PETSc/Mat.pyx":4102 * Mat mat, * Mat result=None, * fill: float | None = None # <<<<<<<<<<<<<< * ) -> Mat: * """Perform matrix-matrix multiplication C=AB. */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mat)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4098, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_result); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4098, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fill); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4098, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "matMult") < 0)) __PYX_ERR(46, 4098, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_mat = ((struct PyPetscMatObject *)values[0]); __pyx_v_result = ((struct PyPetscMatObject *)values[1]); __pyx_v_fill = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("matMult", 0, 1, 3, __pyx_nargs); __PYX_ERR(46, 4098, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.matMult", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(46, 4100, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_result), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "result", 0))) __PYX_ERR(46, 4101, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_352matMult(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_mat, __pyx_v_result, __pyx_v_fill); /* "petsc4py/PETSc/Mat.pyx":4098 * # matrix-matrix product * * def matMult( # <<<<<<<<<<<<<< * self, * Mat mat, */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_352matMult(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat, struct PyPetscMatObject *__pyx_v_result, PyObject *__pyx_v_fill) { MatReuse __pyx_v_reuse; PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscReal __pyx_t_3; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("matMult", 0); __Pyx_INCREF((PyObject *)__pyx_v_result); /* "petsc4py/PETSc/Mat.pyx":4136 * * """ * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX # <<<<<<<<<<<<<< * cdef PetscReal rval = 2 * if result is None: */ __pyx_v_reuse = MAT_INITIAL_MATRIX; /* "petsc4py/PETSc/Mat.pyx":4137 * """ * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * cdef PetscReal rval = 2 # <<<<<<<<<<<<<< * if result is None: * result = Mat() */ __pyx_v_rval = 2.0; /* "petsc4py/PETSc/Mat.pyx":4138 * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * cdef PetscReal rval = 2 * if result is None: # <<<<<<<<<<<<<< * result = Mat() * elif result.mat != NULL: */ __pyx_t_1 = (((PyObject *)__pyx_v_result) == Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/Mat.pyx":4139 * cdef PetscReal rval = 2 * if result is None: * result = Mat() # <<<<<<<<<<<<<< * elif result.mat != NULL: * reuse = MAT_REUSE_MATRIX */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 4139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_result, ((struct PyPetscMatObject *)__pyx_t_2)); __pyx_t_2 = 0; /* "petsc4py/PETSc/Mat.pyx":4138 * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * cdef PetscReal rval = 2 * if result is None: # <<<<<<<<<<<<<< * result = Mat() * elif result.mat != NULL: */ goto __pyx_L3; } /* "petsc4py/PETSc/Mat.pyx":4140 * if result is None: * result = Mat() * elif result.mat != NULL: # <<<<<<<<<<<<<< * reuse = MAT_REUSE_MATRIX * if fill is not None: rval = asReal(fill) */ __pyx_t_1 = (__pyx_v_result->mat != NULL); if (__pyx_t_1) { /* "petsc4py/PETSc/Mat.pyx":4141 * result = Mat() * elif result.mat != NULL: * reuse = MAT_REUSE_MATRIX # <<<<<<<<<<<<<< * if fill is not None: rval = asReal(fill) * CHKERR( MatMatMult(self.mat, mat.mat, reuse, rval, &result.mat) ) */ __pyx_v_reuse = MAT_REUSE_MATRIX; /* "petsc4py/PETSc/Mat.pyx":4140 * if result is None: * result = Mat() * elif result.mat != NULL: # <<<<<<<<<<<<<< * reuse = MAT_REUSE_MATRIX * if fill is not None: rval = asReal(fill) */ } __pyx_L3:; /* "petsc4py/PETSc/Mat.pyx":4142 * elif result.mat != NULL: * reuse = MAT_REUSE_MATRIX * if fill is not None: rval = asReal(fill) # <<<<<<<<<<<<<< * CHKERR( MatMatMult(self.mat, mat.mat, reuse, rval, &result.mat) ) * return result */ __pyx_t_1 = (__pyx_v_fill != Py_None); if (__pyx_t_1) { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_fill); if (unlikely(__pyx_t_3 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(46, 4142, __pyx_L1_error) __pyx_v_rval = __pyx_t_3; } /* "petsc4py/PETSc/Mat.pyx":4143 * reuse = MAT_REUSE_MATRIX * if fill is not None: rval = asReal(fill) * CHKERR( MatMatMult(self.mat, mat.mat, reuse, rval, &result.mat) ) # <<<<<<<<<<<<<< * return result * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatMatMult(__pyx_v_self->mat, __pyx_v_mat->mat, __pyx_v_reuse, __pyx_v_rval, (&__pyx_v_result->mat))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 4143, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":4144 * if fill is not None: rval = asReal(fill) * CHKERR( MatMatMult(self.mat, mat.mat, reuse, rval, &result.mat) ) * return result # <<<<<<<<<<<<<< * * def matTransposeMult( */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_result); __pyx_r = ((PyObject *)__pyx_v_result); goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":4098 * # matrix-matrix product * * def matMult( # <<<<<<<<<<<<<< * self, * Mat mat, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Mat.matMult", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":4146 * return result * * def matTransposeMult( # <<<<<<<<<<<<<< * self, * Mat mat, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_355matTransposeMult(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_354matTransposeMult, "Mat.matTransposeMult(self, mat: Mat, result: Mat | None = None, fill: float | None = None)\nPerform matrix-matrix multiplication C=AB\341\265\200.\n\n Neighborwise collective.\n\n Parameters\n ----------\n mat\n The right hand matrix B.\n result\n The optional resultant matrix C. When `None`, a new matrix\n is created, and ``MAT_INITIAL_MATRIX`` is used. When C is\n not `None`, the matrix is reused with ``MAT_REUSE_MATRIX``.\n fill\n Expected fill as ratio of nnz(C)/(nnz(A) + nnz(B)), use\n `None` if you do not have a good estimate. If the\n result is a dense matrix this is irrelevant.\n\n Returns\n -------\n result : Mat\n The resultant product matrix C.\n\n Notes\n -----\n To determine the correct fill value, run with -info and search\n for the string \"Fill ratio\" to see the value actually needed.\n\n See Also\n --------\n petsc.MatMatTransposeMult, petsc.MatReuse\n\n \nSource code at petsc4py/PETSc/Mat.pyx:4146"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_355matTransposeMult(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscMatObject *__pyx_v_mat = 0; struct PyPetscMatObject *__pyx_v_result = 0; PyObject *__pyx_v_fill = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("matTransposeMult (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat,&__pyx_n_s_result,&__pyx_n_s_fill,0}; /* "petsc4py/PETSc/Mat.pyx":4149 * self, * Mat mat, * Mat result=None, # <<<<<<<<<<<<<< * fill: float | None = None * ): */ values[1] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscMatObject *)Py_None)); /* "petsc4py/PETSc/Mat.pyx":4150 * Mat mat, * Mat result=None, * fill: float | None = None # <<<<<<<<<<<<<< * ): * """Perform matrix-matrix multiplication C=AB. */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mat)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4146, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_result); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4146, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fill); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4146, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "matTransposeMult") < 0)) __PYX_ERR(46, 4146, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_mat = ((struct PyPetscMatObject *)values[0]); __pyx_v_result = ((struct PyPetscMatObject *)values[1]); __pyx_v_fill = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("matTransposeMult", 0, 1, 3, __pyx_nargs); __PYX_ERR(46, 4146, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.matTransposeMult", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(46, 4148, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_result), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "result", 0))) __PYX_ERR(46, 4149, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_354matTransposeMult(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_mat, __pyx_v_result, __pyx_v_fill); /* "petsc4py/PETSc/Mat.pyx":4146 * return result * * def matTransposeMult( # <<<<<<<<<<<<<< * self, * Mat mat, */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_354matTransposeMult(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat, struct PyPetscMatObject *__pyx_v_result, PyObject *__pyx_v_fill) { MatReuse __pyx_v_reuse; PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscReal __pyx_t_3; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("matTransposeMult", 0); __Pyx_INCREF((PyObject *)__pyx_v_result); /* "petsc4py/PETSc/Mat.pyx":4184 * * """ * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX # <<<<<<<<<<<<<< * cdef PetscReal rval = 2 * if result is None: */ __pyx_v_reuse = MAT_INITIAL_MATRIX; /* "petsc4py/PETSc/Mat.pyx":4185 * """ * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * cdef PetscReal rval = 2 # <<<<<<<<<<<<<< * if result is None: * result = Mat() */ __pyx_v_rval = 2.0; /* "petsc4py/PETSc/Mat.pyx":4186 * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * cdef PetscReal rval = 2 * if result is None: # <<<<<<<<<<<<<< * result = Mat() * elif result.mat != NULL: */ __pyx_t_1 = (((PyObject *)__pyx_v_result) == Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/Mat.pyx":4187 * cdef PetscReal rval = 2 * if result is None: * result = Mat() # <<<<<<<<<<<<<< * elif result.mat != NULL: * reuse = MAT_REUSE_MATRIX */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 4187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_result, ((struct PyPetscMatObject *)__pyx_t_2)); __pyx_t_2 = 0; /* "petsc4py/PETSc/Mat.pyx":4186 * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * cdef PetscReal rval = 2 * if result is None: # <<<<<<<<<<<<<< * result = Mat() * elif result.mat != NULL: */ goto __pyx_L3; } /* "petsc4py/PETSc/Mat.pyx":4188 * if result is None: * result = Mat() * elif result.mat != NULL: # <<<<<<<<<<<<<< * reuse = MAT_REUSE_MATRIX * if fill is not None: rval = asReal(fill) */ __pyx_t_1 = (__pyx_v_result->mat != NULL); if (__pyx_t_1) { /* "petsc4py/PETSc/Mat.pyx":4189 * result = Mat() * elif result.mat != NULL: * reuse = MAT_REUSE_MATRIX # <<<<<<<<<<<<<< * if fill is not None: rval = asReal(fill) * CHKERR( MatMatTransposeMult(self.mat, mat.mat, reuse, rval, &result.mat) ) */ __pyx_v_reuse = MAT_REUSE_MATRIX; /* "petsc4py/PETSc/Mat.pyx":4188 * if result is None: * result = Mat() * elif result.mat != NULL: # <<<<<<<<<<<<<< * reuse = MAT_REUSE_MATRIX * if fill is not None: rval = asReal(fill) */ } __pyx_L3:; /* "petsc4py/PETSc/Mat.pyx":4190 * elif result.mat != NULL: * reuse = MAT_REUSE_MATRIX * if fill is not None: rval = asReal(fill) # <<<<<<<<<<<<<< * CHKERR( MatMatTransposeMult(self.mat, mat.mat, reuse, rval, &result.mat) ) * return result */ __pyx_t_1 = (__pyx_v_fill != Py_None); if (__pyx_t_1) { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_fill); if (unlikely(__pyx_t_3 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(46, 4190, __pyx_L1_error) __pyx_v_rval = __pyx_t_3; } /* "petsc4py/PETSc/Mat.pyx":4191 * reuse = MAT_REUSE_MATRIX * if fill is not None: rval = asReal(fill) * CHKERR( MatMatTransposeMult(self.mat, mat.mat, reuse, rval, &result.mat) ) # <<<<<<<<<<<<<< * return result * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatMatTransposeMult(__pyx_v_self->mat, __pyx_v_mat->mat, __pyx_v_reuse, __pyx_v_rval, (&__pyx_v_result->mat))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 4191, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":4192 * if fill is not None: rval = asReal(fill) * CHKERR( MatMatTransposeMult(self.mat, mat.mat, reuse, rval, &result.mat) ) * return result # <<<<<<<<<<<<<< * * def transposeMatMult( */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_result); __pyx_r = ((PyObject *)__pyx_v_result); goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":4146 * return result * * def matTransposeMult( # <<<<<<<<<<<<<< * self, * Mat mat, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Mat.matTransposeMult", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":4194 * return result * * def transposeMatMult( # <<<<<<<<<<<<<< * self, * Mat mat, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_357transposeMatMult(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_356transposeMatMult, "Mat.transposeMatMult(self, mat: Mat, result: Mat | None = None, fill: float | None = None)\nPerform matrix-matrix multiplication C=A\341\265\200B.\n\n Neighborwise collective.\n\n Parameters\n ----------\n mat\n The right hand matrix B.\n result\n The optional resultant matrix C. When `None`, a new matrix\n is created, and ``MAT_INITIAL_MATRIX`` is used. When C is\n not `None`, the matrix is reused with ``MAT_REUSE_MATRIX``.\n fill\n Expected fill as ratio of nnz(C)/(nnz(A) + nnz(B)), use\n `None` if you do not have a good estimate. If the\n result is a dense matrix this is irrelevant.\n\n Returns\n -------\n result : Mat\n The resultant product matrix C.\n\n Notes\n -----\n To determine the correct fill value, run with -info and search\n for the string \"Fill ratio\" to see the value actually needed.\n\n See Also\n --------\n petsc.MatTransposeMatMult, petsc.MatReuse\n\n \nSource code at petsc4py/PETSc/Mat.pyx:4194"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_357transposeMatMult(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscMatObject *__pyx_v_mat = 0; struct PyPetscMatObject *__pyx_v_result = 0; PyObject *__pyx_v_fill = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("transposeMatMult (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat,&__pyx_n_s_result,&__pyx_n_s_fill,0}; /* "petsc4py/PETSc/Mat.pyx":4197 * self, * Mat mat, * Mat result=None, # <<<<<<<<<<<<<< * fill: float | None = None * ): */ values[1] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscMatObject *)Py_None)); /* "petsc4py/PETSc/Mat.pyx":4198 * Mat mat, * Mat result=None, * fill: float | None = None # <<<<<<<<<<<<<< * ): * """Perform matrix-matrix multiplication C=AB. */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mat)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4194, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_result); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4194, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fill); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4194, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "transposeMatMult") < 0)) __PYX_ERR(46, 4194, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_mat = ((struct PyPetscMatObject *)values[0]); __pyx_v_result = ((struct PyPetscMatObject *)values[1]); __pyx_v_fill = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("transposeMatMult", 0, 1, 3, __pyx_nargs); __PYX_ERR(46, 4194, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.transposeMatMult", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(46, 4196, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_result), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "result", 0))) __PYX_ERR(46, 4197, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_356transposeMatMult(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_mat, __pyx_v_result, __pyx_v_fill); /* "petsc4py/PETSc/Mat.pyx":4194 * return result * * def transposeMatMult( # <<<<<<<<<<<<<< * self, * Mat mat, */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_356transposeMatMult(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat, struct PyPetscMatObject *__pyx_v_result, PyObject *__pyx_v_fill) { MatReuse __pyx_v_reuse; PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscReal __pyx_t_3; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("transposeMatMult", 0); __Pyx_INCREF((PyObject *)__pyx_v_result); /* "petsc4py/PETSc/Mat.pyx":4232 * * """ * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX # <<<<<<<<<<<<<< * cdef PetscReal rval = 2 * if result is None: */ __pyx_v_reuse = MAT_INITIAL_MATRIX; /* "petsc4py/PETSc/Mat.pyx":4233 * """ * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * cdef PetscReal rval = 2 # <<<<<<<<<<<<<< * if result is None: * result = Mat() */ __pyx_v_rval = 2.0; /* "petsc4py/PETSc/Mat.pyx":4234 * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * cdef PetscReal rval = 2 * if result is None: # <<<<<<<<<<<<<< * result = Mat() * elif result.mat != NULL: */ __pyx_t_1 = (((PyObject *)__pyx_v_result) == Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/Mat.pyx":4235 * cdef PetscReal rval = 2 * if result is None: * result = Mat() # <<<<<<<<<<<<<< * elif result.mat != NULL: * reuse = MAT_REUSE_MATRIX */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 4235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_result, ((struct PyPetscMatObject *)__pyx_t_2)); __pyx_t_2 = 0; /* "petsc4py/PETSc/Mat.pyx":4234 * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * cdef PetscReal rval = 2 * if result is None: # <<<<<<<<<<<<<< * result = Mat() * elif result.mat != NULL: */ goto __pyx_L3; } /* "petsc4py/PETSc/Mat.pyx":4236 * if result is None: * result = Mat() * elif result.mat != NULL: # <<<<<<<<<<<<<< * reuse = MAT_REUSE_MATRIX * if fill is not None: rval = asReal(fill) */ __pyx_t_1 = (__pyx_v_result->mat != NULL); if (__pyx_t_1) { /* "petsc4py/PETSc/Mat.pyx":4237 * result = Mat() * elif result.mat != NULL: * reuse = MAT_REUSE_MATRIX # <<<<<<<<<<<<<< * if fill is not None: rval = asReal(fill) * CHKERR( MatTransposeMatMult(self.mat, mat.mat, reuse, rval, &result.mat) ) */ __pyx_v_reuse = MAT_REUSE_MATRIX; /* "petsc4py/PETSc/Mat.pyx":4236 * if result is None: * result = Mat() * elif result.mat != NULL: # <<<<<<<<<<<<<< * reuse = MAT_REUSE_MATRIX * if fill is not None: rval = asReal(fill) */ } __pyx_L3:; /* "petsc4py/PETSc/Mat.pyx":4238 * elif result.mat != NULL: * reuse = MAT_REUSE_MATRIX * if fill is not None: rval = asReal(fill) # <<<<<<<<<<<<<< * CHKERR( MatTransposeMatMult(self.mat, mat.mat, reuse, rval, &result.mat) ) * return result */ __pyx_t_1 = (__pyx_v_fill != Py_None); if (__pyx_t_1) { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_fill); if (unlikely(__pyx_t_3 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(46, 4238, __pyx_L1_error) __pyx_v_rval = __pyx_t_3; } /* "petsc4py/PETSc/Mat.pyx":4239 * reuse = MAT_REUSE_MATRIX * if fill is not None: rval = asReal(fill) * CHKERR( MatTransposeMatMult(self.mat, mat.mat, reuse, rval, &result.mat) ) # <<<<<<<<<<<<<< * return result * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatTransposeMatMult(__pyx_v_self->mat, __pyx_v_mat->mat, __pyx_v_reuse, __pyx_v_rval, (&__pyx_v_result->mat))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 4239, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":4240 * if fill is not None: rval = asReal(fill) * CHKERR( MatTransposeMatMult(self.mat, mat.mat, reuse, rval, &result.mat) ) * return result # <<<<<<<<<<<<<< * * def ptap( */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_result); __pyx_r = ((PyObject *)__pyx_v_result); goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":4194 * return result * * def transposeMatMult( # <<<<<<<<<<<<<< * self, * Mat mat, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Mat.transposeMatMult", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":4242 * return result * * def ptap( # <<<<<<<<<<<<<< * self, * Mat P, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_359ptap(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_358ptap, "Mat.ptap(self, P: Mat, result: Mat | None = None, fill: float | None = None) -> Mat\nCreates the matrix product C = P\341\265\200AP.\n\n Neighborwise collective.\n\n Parameters\n ----------\n P\n The matrix P.\n result\n The optional resultant matrix C. When `None`, a new matrix\n is created, and ``MAT_INITIAL_MATRIX`` is used. When C is\n not `None`, the matrix is reused with ``MAT_REUSE_MATRIX``.\n fill\n Expected fill as ratio of nnz(C)/(nnz(A) + nnz(P)), use\n `None` if you do not have a good estimate. If the\n result is a dense matrix this is irrelevant.\n\n Returns\n -------\n result : Mat\n The resultant product matrix C.\n\n Notes\n -----\n To determine the correct fill value, run with -info and search\n for the string \"Fill ratio\" to see the value actually needed.\n\n An alternative approach to this function is to use\n `petsc.MatProductCreate` and set the desired options before the\n computation is done.\n\n See Also\n --------\n petsc.MatPtAP, petsc.MatReuse\n\n \nSource code at petsc4py/PETSc/Mat.pyx:4242"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_359ptap(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscMatObject *__pyx_v_P = 0; struct PyPetscMatObject *__pyx_v_result = 0; PyObject *__pyx_v_fill = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("ptap (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_P,&__pyx_n_s_result,&__pyx_n_s_fill,0}; /* "petsc4py/PETSc/Mat.pyx":4245 * self, * Mat P, * Mat result=None, # <<<<<<<<<<<<<< * fill: float | None = None * ) -> Mat: */ values[1] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscMatObject *)Py_None)); /* "petsc4py/PETSc/Mat.pyx":4246 * Mat P, * Mat result=None, * fill: float | None = None # <<<<<<<<<<<<<< * ) -> Mat: * """Creates the matrix product C = PAP. */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_P)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4242, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_result); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4242, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fill); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4242, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "ptap") < 0)) __PYX_ERR(46, 4242, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_P = ((struct PyPetscMatObject *)values[0]); __pyx_v_result = ((struct PyPetscMatObject *)values[1]); __pyx_v_fill = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("ptap", 0, 1, 3, __pyx_nargs); __PYX_ERR(46, 4242, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.ptap", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_P), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "P", 0))) __PYX_ERR(46, 4244, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_result), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "result", 0))) __PYX_ERR(46, 4245, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_358ptap(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_P, __pyx_v_result, __pyx_v_fill); /* "petsc4py/PETSc/Mat.pyx":4242 * return result * * def ptap( # <<<<<<<<<<<<<< * self, * Mat P, */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_358ptap(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_P, struct PyPetscMatObject *__pyx_v_result, PyObject *__pyx_v_fill) { MatReuse __pyx_v_reuse; PetscReal __pyx_v_cfill; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscReal __pyx_t_3; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("ptap", 0); __Pyx_INCREF((PyObject *)__pyx_v_result); /* "petsc4py/PETSc/Mat.pyx":4284 * * """ * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX # <<<<<<<<<<<<<< * cdef PetscReal cfill = PETSC_DEFAULT * if result is None: */ __pyx_v_reuse = MAT_INITIAL_MATRIX; /* "petsc4py/PETSc/Mat.pyx":4285 * """ * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * cdef PetscReal cfill = PETSC_DEFAULT # <<<<<<<<<<<<<< * if result is None: * result = Mat() */ __pyx_v_cfill = PETSC_DEFAULT; /* "petsc4py/PETSc/Mat.pyx":4286 * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * cdef PetscReal cfill = PETSC_DEFAULT * if result is None: # <<<<<<<<<<<<<< * result = Mat() * elif result.mat != NULL: */ __pyx_t_1 = (((PyObject *)__pyx_v_result) == Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/Mat.pyx":4287 * cdef PetscReal cfill = PETSC_DEFAULT * if result is None: * result = Mat() # <<<<<<<<<<<<<< * elif result.mat != NULL: * reuse = MAT_REUSE_MATRIX */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 4287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_result, ((struct PyPetscMatObject *)__pyx_t_2)); __pyx_t_2 = 0; /* "petsc4py/PETSc/Mat.pyx":4286 * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * cdef PetscReal cfill = PETSC_DEFAULT * if result is None: # <<<<<<<<<<<<<< * result = Mat() * elif result.mat != NULL: */ goto __pyx_L3; } /* "petsc4py/PETSc/Mat.pyx":4288 * if result is None: * result = Mat() * elif result.mat != NULL: # <<<<<<<<<<<<<< * reuse = MAT_REUSE_MATRIX * if fill is not None: cfill = asReal(fill) */ __pyx_t_1 = (__pyx_v_result->mat != NULL); if (__pyx_t_1) { /* "petsc4py/PETSc/Mat.pyx":4289 * result = Mat() * elif result.mat != NULL: * reuse = MAT_REUSE_MATRIX # <<<<<<<<<<<<<< * if fill is not None: cfill = asReal(fill) * CHKERR( MatPtAP(self.mat, P.mat, reuse, cfill, &result.mat) ) */ __pyx_v_reuse = MAT_REUSE_MATRIX; /* "petsc4py/PETSc/Mat.pyx":4288 * if result is None: * result = Mat() * elif result.mat != NULL: # <<<<<<<<<<<<<< * reuse = MAT_REUSE_MATRIX * if fill is not None: cfill = asReal(fill) */ } __pyx_L3:; /* "petsc4py/PETSc/Mat.pyx":4290 * elif result.mat != NULL: * reuse = MAT_REUSE_MATRIX * if fill is not None: cfill = asReal(fill) # <<<<<<<<<<<<<< * CHKERR( MatPtAP(self.mat, P.mat, reuse, cfill, &result.mat) ) * return result */ __pyx_t_1 = (__pyx_v_fill != Py_None); if (__pyx_t_1) { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_fill); if (unlikely(__pyx_t_3 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(46, 4290, __pyx_L1_error) __pyx_v_cfill = __pyx_t_3; } /* "petsc4py/PETSc/Mat.pyx":4291 * reuse = MAT_REUSE_MATRIX * if fill is not None: cfill = asReal(fill) * CHKERR( MatPtAP(self.mat, P.mat, reuse, cfill, &result.mat) ) # <<<<<<<<<<<<<< * return result * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatPtAP(__pyx_v_self->mat, __pyx_v_P->mat, __pyx_v_reuse, __pyx_v_cfill, (&__pyx_v_result->mat))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 4291, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":4292 * if fill is not None: cfill = asReal(fill) * CHKERR( MatPtAP(self.mat, P.mat, reuse, cfill, &result.mat) ) * return result # <<<<<<<<<<<<<< * * def rart( */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_result); __pyx_r = ((PyObject *)__pyx_v_result); goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":4242 * return result * * def ptap( # <<<<<<<<<<<<<< * self, * Mat P, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Mat.ptap", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":4294 * return result * * def rart( # <<<<<<<<<<<<<< * self, * Mat R, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_361rart(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_360rart, "Mat.rart(self, R: Mat, result: Mat | None = None, fill: float | None = None) -> Mat\nCreate the matrix product C = RAR\341\265\200.\n\n Neighborwise collective.\n\n Parameters\n ----------\n R\n The projection matrix.\n result\n The optional resultant matrix C. When `None`, a new matrix\n is created, and ``MAT_INITIAL_MATRIX`` is used. When C is\n not `None`, the matrix is reused with ``MAT_REUSE_MATRIX``.\n fill\n Expected fill as ratio of nnz(C)/nnz(A), use `None` if\n you do not have a good estimate. If the result is a dense\n matrix this is irrelevant.\n\n Returns\n -------\n result : Mat\n The resultant product matrix C.\n\n Notes\n -----\n To determine the correct fill value, run with -info and search\n for the string \"Fill ratio\" to see the value actually needed.\n\n See Also\n --------\n petsc.MatRARt, petsc.MatReuse\n\n \nSource code at petsc4py/PETSc/Mat.pyx:4294"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_361rart(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscMatObject *__pyx_v_R = 0; struct PyPetscMatObject *__pyx_v_result = 0; PyObject *__pyx_v_fill = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("rart (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_R,&__pyx_n_s_result,&__pyx_n_s_fill,0}; /* "petsc4py/PETSc/Mat.pyx":4297 * self, * Mat R, * Mat result=None, # <<<<<<<<<<<<<< * fill: float | None = None * ) -> Mat: */ values[1] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscMatObject *)Py_None)); /* "petsc4py/PETSc/Mat.pyx":4298 * Mat R, * Mat result=None, * fill: float | None = None # <<<<<<<<<<<<<< * ) -> Mat: * """Create the matrix product C = RAR. */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_R)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4294, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_result); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4294, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fill); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4294, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "rart") < 0)) __PYX_ERR(46, 4294, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_R = ((struct PyPetscMatObject *)values[0]); __pyx_v_result = ((struct PyPetscMatObject *)values[1]); __pyx_v_fill = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("rart", 0, 1, 3, __pyx_nargs); __PYX_ERR(46, 4294, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.rart", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_R), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "R", 0))) __PYX_ERR(46, 4296, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_result), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "result", 0))) __PYX_ERR(46, 4297, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_360rart(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_R, __pyx_v_result, __pyx_v_fill); /* "petsc4py/PETSc/Mat.pyx":4294 * return result * * def rart( # <<<<<<<<<<<<<< * self, * Mat R, */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_360rart(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_R, struct PyPetscMatObject *__pyx_v_result, PyObject *__pyx_v_fill) { MatReuse __pyx_v_reuse; PetscReal __pyx_v_cfill; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscReal __pyx_t_3; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("rart", 0); __Pyx_INCREF((PyObject *)__pyx_v_result); /* "petsc4py/PETSc/Mat.pyx":4332 * * """ * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX # <<<<<<<<<<<<<< * cdef PetscReal cfill = PETSC_DEFAULT * if result is None: */ __pyx_v_reuse = MAT_INITIAL_MATRIX; /* "petsc4py/PETSc/Mat.pyx":4333 * """ * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * cdef PetscReal cfill = PETSC_DEFAULT # <<<<<<<<<<<<<< * if result is None: * result = Mat() */ __pyx_v_cfill = PETSC_DEFAULT; /* "petsc4py/PETSc/Mat.pyx":4334 * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * cdef PetscReal cfill = PETSC_DEFAULT * if result is None: # <<<<<<<<<<<<<< * result = Mat() * elif result.mat != NULL: */ __pyx_t_1 = (((PyObject *)__pyx_v_result) == Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/Mat.pyx":4335 * cdef PetscReal cfill = PETSC_DEFAULT * if result is None: * result = Mat() # <<<<<<<<<<<<<< * elif result.mat != NULL: * reuse = MAT_REUSE_MATRIX */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 4335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_result, ((struct PyPetscMatObject *)__pyx_t_2)); __pyx_t_2 = 0; /* "petsc4py/PETSc/Mat.pyx":4334 * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * cdef PetscReal cfill = PETSC_DEFAULT * if result is None: # <<<<<<<<<<<<<< * result = Mat() * elif result.mat != NULL: */ goto __pyx_L3; } /* "petsc4py/PETSc/Mat.pyx":4336 * if result is None: * result = Mat() * elif result.mat != NULL: # <<<<<<<<<<<<<< * reuse = MAT_REUSE_MATRIX * if fill is not None: cfill = asReal(fill) */ __pyx_t_1 = (__pyx_v_result->mat != NULL); if (__pyx_t_1) { /* "petsc4py/PETSc/Mat.pyx":4337 * result = Mat() * elif result.mat != NULL: * reuse = MAT_REUSE_MATRIX # <<<<<<<<<<<<<< * if fill is not None: cfill = asReal(fill) * CHKERR( MatRARt(self.mat, R.mat, reuse, cfill, &result.mat) ) */ __pyx_v_reuse = MAT_REUSE_MATRIX; /* "petsc4py/PETSc/Mat.pyx":4336 * if result is None: * result = Mat() * elif result.mat != NULL: # <<<<<<<<<<<<<< * reuse = MAT_REUSE_MATRIX * if fill is not None: cfill = asReal(fill) */ } __pyx_L3:; /* "petsc4py/PETSc/Mat.pyx":4338 * elif result.mat != NULL: * reuse = MAT_REUSE_MATRIX * if fill is not None: cfill = asReal(fill) # <<<<<<<<<<<<<< * CHKERR( MatRARt(self.mat, R.mat, reuse, cfill, &result.mat) ) * return result */ __pyx_t_1 = (__pyx_v_fill != Py_None); if (__pyx_t_1) { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_fill); if (unlikely(__pyx_t_3 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(46, 4338, __pyx_L1_error) __pyx_v_cfill = __pyx_t_3; } /* "petsc4py/PETSc/Mat.pyx":4339 * reuse = MAT_REUSE_MATRIX * if fill is not None: cfill = asReal(fill) * CHKERR( MatRARt(self.mat, R.mat, reuse, cfill, &result.mat) ) # <<<<<<<<<<<<<< * return result * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatRARt(__pyx_v_self->mat, __pyx_v_R->mat, __pyx_v_reuse, __pyx_v_cfill, (&__pyx_v_result->mat))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 4339, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":4340 * if fill is not None: cfill = asReal(fill) * CHKERR( MatRARt(self.mat, R.mat, reuse, cfill, &result.mat) ) * return result # <<<<<<<<<<<<<< * * def matMatMult( */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_result); __pyx_r = ((PyObject *)__pyx_v_result); goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":4294 * return result * * def rart( # <<<<<<<<<<<<<< * self, * Mat R, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Mat.rart", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":4342 * return result * * def matMatMult( # <<<<<<<<<<<<<< * self, * Mat B, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_363matMatMult(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_362matMatMult, "Mat.matMatMult(self, B: Mat, C: Mat, result: Mat | None = None, fill: float | None = None) -> Mat\nPerform matrix-matrix-matrix multiplication D=ABC.\n\n Neighborwise collective.\n\n Parameters\n ----------\n B\n The middle matrix B.\n C\n The right hand matrix C.\n result\n The optional resultant matrix D. When `None`, a new matrix\n is created, and ``MAT_INITIAL_MATRIX`` is used. When D is\n not `None`, the matrix is reused with ``MAT_REUSE_MATRIX``.\n fill\n Expected fill as ratio of nnz(C)/nnz(A), use `None` if\n you do not have a good estimate. If the result is a dense\n matrix this is irrelevant.\n\n Returns\n -------\n result : Mat\n The resultant product matrix D.\n\n See Also\n --------\n petsc.MatMatMatMult, petsc.MatReuse\n\n \nSource code at petsc4py/PETSc/Mat.pyx:4342"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_363matMatMult(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscMatObject *__pyx_v_B = 0; struct PyPetscMatObject *__pyx_v_C = 0; struct PyPetscMatObject *__pyx_v_result = 0; PyObject *__pyx_v_fill = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("matMatMult (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_B,&__pyx_n_s_C,&__pyx_n_s_result,&__pyx_n_s_fill,0}; /* "petsc4py/PETSc/Mat.pyx":4346 * Mat B, * Mat C, * Mat result=None, # <<<<<<<<<<<<<< * fill: float | None = None * ) -> Mat: */ values[2] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscMatObject *)Py_None)); /* "petsc4py/PETSc/Mat.pyx":4347 * Mat C, * Mat result=None, * fill: float | None = None # <<<<<<<<<<<<<< * ) -> Mat: * """Perform matrix-matrix-matrix multiplication D=ABC. */ values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_B)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4342, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_C)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4342, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("matMatMult", 0, 2, 4, 1); __PYX_ERR(46, 4342, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_result); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4342, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fill); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4342, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "matMatMult") < 0)) __PYX_ERR(46, 4342, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_B = ((struct PyPetscMatObject *)values[0]); __pyx_v_C = ((struct PyPetscMatObject *)values[1]); __pyx_v_result = ((struct PyPetscMatObject *)values[2]); __pyx_v_fill = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("matMatMult", 0, 2, 4, __pyx_nargs); __PYX_ERR(46, 4342, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.matMatMult", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_B), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "B", 0))) __PYX_ERR(46, 4344, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_C), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "C", 0))) __PYX_ERR(46, 4345, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_result), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "result", 0))) __PYX_ERR(46, 4346, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_362matMatMult(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_B, __pyx_v_C, __pyx_v_result, __pyx_v_fill); /* "petsc4py/PETSc/Mat.pyx":4342 * return result * * def matMatMult( # <<<<<<<<<<<<<< * self, * Mat B, */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_362matMatMult(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_B, struct PyPetscMatObject *__pyx_v_C, struct PyPetscMatObject *__pyx_v_result, PyObject *__pyx_v_fill) { MatReuse __pyx_v_reuse; PetscReal __pyx_v_cfill; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscReal __pyx_t_3; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("matMatMult", 0); __Pyx_INCREF((PyObject *)__pyx_v_result); /* "petsc4py/PETSc/Mat.pyx":4378 * * """ * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX # <<<<<<<<<<<<<< * cdef PetscReal cfill = PETSC_DEFAULT * if result is None: */ __pyx_v_reuse = MAT_INITIAL_MATRIX; /* "petsc4py/PETSc/Mat.pyx":4379 * """ * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * cdef PetscReal cfill = PETSC_DEFAULT # <<<<<<<<<<<<<< * if result is None: * result = Mat() */ __pyx_v_cfill = PETSC_DEFAULT; /* "petsc4py/PETSc/Mat.pyx":4380 * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * cdef PetscReal cfill = PETSC_DEFAULT * if result is None: # <<<<<<<<<<<<<< * result = Mat() * elif result.mat != NULL: */ __pyx_t_1 = (((PyObject *)__pyx_v_result) == Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/Mat.pyx":4381 * cdef PetscReal cfill = PETSC_DEFAULT * if result is None: * result = Mat() # <<<<<<<<<<<<<< * elif result.mat != NULL: * reuse = MAT_REUSE_MATRIX */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 4381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_result, ((struct PyPetscMatObject *)__pyx_t_2)); __pyx_t_2 = 0; /* "petsc4py/PETSc/Mat.pyx":4380 * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * cdef PetscReal cfill = PETSC_DEFAULT * if result is None: # <<<<<<<<<<<<<< * result = Mat() * elif result.mat != NULL: */ goto __pyx_L3; } /* "petsc4py/PETSc/Mat.pyx":4382 * if result is None: * result = Mat() * elif result.mat != NULL: # <<<<<<<<<<<<<< * reuse = MAT_REUSE_MATRIX * if fill is not None: cfill = asReal(fill) */ __pyx_t_1 = (__pyx_v_result->mat != NULL); if (__pyx_t_1) { /* "petsc4py/PETSc/Mat.pyx":4383 * result = Mat() * elif result.mat != NULL: * reuse = MAT_REUSE_MATRIX # <<<<<<<<<<<<<< * if fill is not None: cfill = asReal(fill) * CHKERR( MatMatMatMult(self.mat, B.mat, C.mat, reuse, cfill, &result.mat) ) */ __pyx_v_reuse = MAT_REUSE_MATRIX; /* "petsc4py/PETSc/Mat.pyx":4382 * if result is None: * result = Mat() * elif result.mat != NULL: # <<<<<<<<<<<<<< * reuse = MAT_REUSE_MATRIX * if fill is not None: cfill = asReal(fill) */ } __pyx_L3:; /* "petsc4py/PETSc/Mat.pyx":4384 * elif result.mat != NULL: * reuse = MAT_REUSE_MATRIX * if fill is not None: cfill = asReal(fill) # <<<<<<<<<<<<<< * CHKERR( MatMatMatMult(self.mat, B.mat, C.mat, reuse, cfill, &result.mat) ) * return result */ __pyx_t_1 = (__pyx_v_fill != Py_None); if (__pyx_t_1) { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_fill); if (unlikely(__pyx_t_3 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(46, 4384, __pyx_L1_error) __pyx_v_cfill = __pyx_t_3; } /* "petsc4py/PETSc/Mat.pyx":4385 * reuse = MAT_REUSE_MATRIX * if fill is not None: cfill = asReal(fill) * CHKERR( MatMatMatMult(self.mat, B.mat, C.mat, reuse, cfill, &result.mat) ) # <<<<<<<<<<<<<< * return result * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatMatMatMult(__pyx_v_self->mat, __pyx_v_B->mat, __pyx_v_C->mat, __pyx_v_reuse, __pyx_v_cfill, (&__pyx_v_result->mat))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 4385, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":4386 * if fill is not None: cfill = asReal(fill) * CHKERR( MatMatMatMult(self.mat, B.mat, C.mat, reuse, cfill, &result.mat) ) * return result # <<<<<<<<<<<<<< * * def kron( */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_result); __pyx_r = ((PyObject *)__pyx_v_result); goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":4342 * return result * * def matMatMult( # <<<<<<<<<<<<<< * self, * Mat B, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Mat.matMatMult", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":4388 * return result * * def kron( # <<<<<<<<<<<<<< * self, * Mat mat, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_365kron(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_364kron, "Mat.kron(self, mat: Mat, result: Mat | None = None) -> Mat\nCompute C, the Kronecker product of A and B.\n\n Parameters\n ----------\n mat\n The right hand matrix B.\n result\n The optional resultant matrix. When `None`, a new matrix\n is created, and ``MAT_INITIAL_MATRIX`` is used. When it is\n not `None`, the matrix is reused with ``MAT_REUSE_MATRIX``.\n\n Returns\n -------\n result : Mat\n The resultant matrix C, the Kronecker product of A and B.\n\n See Also\n --------\n petsc.MatSeqAIJKron, petsc.MatReuse\n\n \nSource code at petsc4py/PETSc/Mat.pyx:4388"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_365kron(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscMatObject *__pyx_v_mat = 0; struct PyPetscMatObject *__pyx_v_result = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("kron (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat,&__pyx_n_s_result,0}; /* "petsc4py/PETSc/Mat.pyx":4391 * self, * Mat mat, * Mat result=None # <<<<<<<<<<<<<< * ) -> Mat: * """Compute C, the Kronecker product of A and B. */ values[1] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscMatObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mat)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4388, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_result); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4388, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "kron") < 0)) __PYX_ERR(46, 4388, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_mat = ((struct PyPetscMatObject *)values[0]); __pyx_v_result = ((struct PyPetscMatObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("kron", 0, 1, 2, __pyx_nargs); __PYX_ERR(46, 4388, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.kron", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(46, 4390, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_result), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "result", 0))) __PYX_ERR(46, 4391, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_364kron(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_mat, __pyx_v_result); /* "petsc4py/PETSc/Mat.pyx":4388 * return result * * def kron( # <<<<<<<<<<<<<< * self, * Mat mat, */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_364kron(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat, struct PyPetscMatObject *__pyx_v_result) { MatReuse __pyx_v_reuse; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("kron", 0); __Pyx_INCREF((PyObject *)__pyx_v_result); /* "petsc4py/PETSc/Mat.pyx":4414 * * """ * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX # <<<<<<<<<<<<<< * if result is None: * result = Mat() */ __pyx_v_reuse = MAT_INITIAL_MATRIX; /* "petsc4py/PETSc/Mat.pyx":4415 * """ * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * if result is None: # <<<<<<<<<<<<<< * result = Mat() * elif result.mat != NULL: */ __pyx_t_1 = (((PyObject *)__pyx_v_result) == Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/Mat.pyx":4416 * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * if result is None: * result = Mat() # <<<<<<<<<<<<<< * elif result.mat != NULL: * reuse = MAT_REUSE_MATRIX */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 4416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_result, ((struct PyPetscMatObject *)__pyx_t_2)); __pyx_t_2 = 0; /* "petsc4py/PETSc/Mat.pyx":4415 * """ * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * if result is None: # <<<<<<<<<<<<<< * result = Mat() * elif result.mat != NULL: */ goto __pyx_L3; } /* "petsc4py/PETSc/Mat.pyx":4417 * if result is None: * result = Mat() * elif result.mat != NULL: # <<<<<<<<<<<<<< * reuse = MAT_REUSE_MATRIX * CHKERR( MatSeqAIJKron(self.mat, mat.mat, reuse, &result.mat) ) */ __pyx_t_1 = (__pyx_v_result->mat != NULL); if (__pyx_t_1) { /* "petsc4py/PETSc/Mat.pyx":4418 * result = Mat() * elif result.mat != NULL: * reuse = MAT_REUSE_MATRIX # <<<<<<<<<<<<<< * CHKERR( MatSeqAIJKron(self.mat, mat.mat, reuse, &result.mat) ) * return result */ __pyx_v_reuse = MAT_REUSE_MATRIX; /* "petsc4py/PETSc/Mat.pyx":4417 * if result is None: * result = Mat() * elif result.mat != NULL: # <<<<<<<<<<<<<< * reuse = MAT_REUSE_MATRIX * CHKERR( MatSeqAIJKron(self.mat, mat.mat, reuse, &result.mat) ) */ } __pyx_L3:; /* "petsc4py/PETSc/Mat.pyx":4419 * elif result.mat != NULL: * reuse = MAT_REUSE_MATRIX * CHKERR( MatSeqAIJKron(self.mat, mat.mat, reuse, &result.mat) ) # <<<<<<<<<<<<<< * return result * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSeqAIJKron(__pyx_v_self->mat, __pyx_v_mat->mat, __pyx_v_reuse, (&__pyx_v_result->mat))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 4419, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":4420 * reuse = MAT_REUSE_MATRIX * CHKERR( MatSeqAIJKron(self.mat, mat.mat, reuse, &result.mat) ) * return result # <<<<<<<<<<<<<< * * def bindToCPU(self, flg: bool) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_result); __pyx_r = ((PyObject *)__pyx_v_result); goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":4388 * return result * * def kron( # <<<<<<<<<<<<<< * self, * Mat mat, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Mat.kron", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":4422 * return result * * def bindToCPU(self, flg: bool) -> None: # <<<<<<<<<<<<<< * """Mark a matrix to temporarily stay on the CPU. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_367bindToCPU(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_366bindToCPU, "Mat.bindToCPU(self, flg: bool) -> None\nMark a matrix to temporarily stay on the CPU.\n\n Once marked, perform computations on the CPU.\n\n Parameters\n ----------\n flg\n Bind to the CPU if `True`.\n\n See Also\n --------\n petsc.MatBindToCPU\n\n \nSource code at petsc4py/PETSc/Mat.pyx:4422"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_367bindToCPU(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_flg = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("bindToCPU (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flg,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flg)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4422, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "bindToCPU") < 0)) __PYX_ERR(46, 4422, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_flg = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("bindToCPU", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 4422, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.bindToCPU", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_366bindToCPU(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_flg); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_366bindToCPU(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_flg) { PetscBool __pyx_v_bindFlg; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("bindToCPU", 1); /* "petsc4py/PETSc/Mat.pyx":4437 * * """ * cdef PetscBool bindFlg = asBool(flg) # <<<<<<<<<<<<<< * CHKERR( MatBindToCPU(self.mat, bindFlg) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asBool(__pyx_v_flg); if (unlikely(__pyx_t_1 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(46, 4437, __pyx_L1_error) __pyx_v_bindFlg = __pyx_t_1; /* "petsc4py/PETSc/Mat.pyx":4438 * """ * cdef PetscBool bindFlg = asBool(flg) * CHKERR( MatBindToCPU(self.mat, bindFlg) ) # <<<<<<<<<<<<<< * * def boundToCPU(self) -> bool: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatBindToCPU(__pyx_v_self->mat, __pyx_v_bindFlg)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 4438, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":4422 * return result * * def bindToCPU(self, flg: bool) -> None: # <<<<<<<<<<<<<< * """Mark a matrix to temporarily stay on the CPU. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.bindToCPU", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":4440 * CHKERR( MatBindToCPU(self.mat, bindFlg) ) * * def boundToCPU(self) -> bool: # <<<<<<<<<<<<<< * """Query if a matrix is bound to the CPU. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_369boundToCPU(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_368boundToCPU, "Mat.boundToCPU(self) -> bool\nQuery if a matrix is bound to the CPU.\n\n See Also\n --------\n petsc.MatBoundToCPU\n\n \nSource code at petsc4py/PETSc/Mat.pyx:4440"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_369boundToCPU(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("boundToCPU (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("boundToCPU", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "boundToCPU", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_368boundToCPU(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_368boundToCPU(struct PyPetscMatObject *__pyx_v_self) { PetscBool __pyx_v_flg; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("boundToCPU", 1); /* "petsc4py/PETSc/Mat.pyx":4448 * * """ * cdef PetscBool flg = PETSC_TRUE # <<<<<<<<<<<<<< * CHKERR( MatBoundToCPU(self.mat, &flg) ) * return toBool(flg) */ __pyx_v_flg = PETSC_TRUE; /* "petsc4py/PETSc/Mat.pyx":4449 * """ * cdef PetscBool flg = PETSC_TRUE * CHKERR( MatBoundToCPU(self.mat, &flg) ) # <<<<<<<<<<<<<< * return toBool(flg) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatBoundToCPU(__pyx_v_self->mat, (&__pyx_v_flg))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 4449, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":4450 * cdef PetscBool flg = PETSC_TRUE * CHKERR( MatBoundToCPU(self.mat, &flg) ) * return toBool(flg) # <<<<<<<<<<<<<< * * # XXX factorization */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flg); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 4450, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":4440 * CHKERR( MatBindToCPU(self.mat, bindFlg) ) * * def boundToCPU(self) -> bool: # <<<<<<<<<<<<<< * """Query if a matrix is bound to the CPU. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Mat.boundToCPU", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":4454 * # XXX factorization * * def getOrdering(self, ord_type: OrderingType) -> tuple[IS, IS]: # <<<<<<<<<<<<<< * """Return a reordering for a matrix to improve a LU factorization. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_371getOrdering(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_370getOrdering, "Mat.getOrdering(self, ord_type: OrderingType) -> tuple[IS, IS]\nReturn a reordering for a matrix to improve a LU factorization.\n\n Collective.\n\n Parameters\n ----------\n ord_type\n The type of reordering.\n\n Returns\n -------\n rp : IS\n The row permutation indices.\n cp : IS\n The column permutation indices.\n\n See Also\n --------\n petsc.MatGetOrdering\n\n \nSource code at petsc4py/PETSc/Mat.pyx:4454"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_371getOrdering(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_ord_type = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getOrdering (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ord_type,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ord_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4454, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getOrdering") < 0)) __PYX_ERR(46, 4454, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_ord_type = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getOrdering", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 4454, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.getOrdering", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_370getOrdering(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_ord_type); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_370getOrdering(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_ord_type) { MatOrderingType __pyx_v_cval; struct PyPetscISObject *__pyx_v_rp = 0; struct PyPetscISObject *__pyx_v_cp = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getOrdering", 0); __Pyx_INCREF(__pyx_v_ord_type); /* "petsc4py/PETSc/Mat.pyx":4476 * * """ * cdef PetscMatOrderingType cval = NULL # <<<<<<<<<<<<<< * ord_type = str2bytes(ord_type, &cval) * cdef IS rp = IS(), cp = IS() */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/Mat.pyx":4477 * """ * cdef PetscMatOrderingType cval = NULL * ord_type = str2bytes(ord_type, &cval) # <<<<<<<<<<<<<< * cdef IS rp = IS(), cp = IS() * CHKERR( MatGetOrdering(self.mat, cval, &rp.iset, &cp.iset) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_ord_type, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 4477, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_ord_type, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Mat.pyx":4478 * cdef PetscMatOrderingType cval = NULL * ord_type = str2bytes(ord_type, &cval) * cdef IS rp = IS(), cp = IS() # <<<<<<<<<<<<<< * CHKERR( MatGetOrdering(self.mat, cval, &rp.iset, &cp.iset) ) * return (rp, cp) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 4478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_rp = ((struct PyPetscISObject *)__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 4478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_cp = ((struct PyPetscISObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Mat.pyx":4479 * ord_type = str2bytes(ord_type, &cval) * cdef IS rp = IS(), cp = IS() * CHKERR( MatGetOrdering(self.mat, cval, &rp.iset, &cp.iset) ) # <<<<<<<<<<<<<< * return (rp, cp) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetOrdering(__pyx_v_self->mat, __pyx_v_cval, (&__pyx_v_rp->iset), (&__pyx_v_cp->iset))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 4479, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":4480 * cdef IS rp = IS(), cp = IS() * CHKERR( MatGetOrdering(self.mat, cval, &rp.iset, &cp.iset) ) * return (rp, cp) # <<<<<<<<<<<<<< * * def reorderForNonzeroDiagonal( */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 4480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF((PyObject *)__pyx_v_rp); __Pyx_GIVEREF((PyObject *)__pyx_v_rp); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_rp))) __PYX_ERR(46, 4480, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_cp); __Pyx_GIVEREF((PyObject *)__pyx_v_cp); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_cp))) __PYX_ERR(46, 4480, __pyx_L1_error); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":4454 * # XXX factorization * * def getOrdering(self, ord_type: OrderingType) -> tuple[IS, IS]: # <<<<<<<<<<<<<< * """Return a reordering for a matrix to improve a LU factorization. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getOrdering", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_rp); __Pyx_XDECREF((PyObject *)__pyx_v_cp); __Pyx_XDECREF(__pyx_v_ord_type); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":4482 * return (rp, cp) * * def reorderForNonzeroDiagonal( # <<<<<<<<<<<<<< * self, * IS isrow, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_373reorderForNonzeroDiagonal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_372reorderForNonzeroDiagonal, "Mat.reorderForNonzeroDiagonal(self, isrow: IS, iscol: IS, atol: float = 0) -> None\nChange a matrix ordering to remove zeros from the diagonal.\n\n Collective.\n\n Parameters\n ----------\n isrow\n The row reordering.\n iscol\n The column reordering.\n atol\n The absolute tolerance. Values along the diagonal whose absolute value\n are smaller than this tolerance are moved off the diagonal.\n\n See Also\n --------\n getOrdering, petsc.MatReorderForNonzeroDiagonal\n\n \nSource code at petsc4py/PETSc/Mat.pyx:4482"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_373reorderForNonzeroDiagonal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscISObject *__pyx_v_isrow = 0; struct PyPetscISObject *__pyx_v_iscol = 0; PyObject *__pyx_v_atol = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("reorderForNonzeroDiagonal (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_isrow,&__pyx_n_s_iscol,&__pyx_n_s_atol,0}; values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_0)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_isrow)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4482, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_iscol)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4482, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("reorderForNonzeroDiagonal", 0, 2, 3, 1); __PYX_ERR(46, 4482, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_atol); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4482, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "reorderForNonzeroDiagonal") < 0)) __PYX_ERR(46, 4482, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_isrow = ((struct PyPetscISObject *)values[0]); __pyx_v_iscol = ((struct PyPetscISObject *)values[1]); __pyx_v_atol = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("reorderForNonzeroDiagonal", 0, 2, 3, __pyx_nargs); __PYX_ERR(46, 4482, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.reorderForNonzeroDiagonal", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isrow), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "isrow", 0))) __PYX_ERR(46, 4484, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iscol), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "iscol", 0))) __PYX_ERR(46, 4485, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_372reorderForNonzeroDiagonal(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_isrow, __pyx_v_iscol, __pyx_v_atol); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_372reorderForNonzeroDiagonal(struct PyPetscMatObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_isrow, struct PyPetscISObject *__pyx_v_iscol, PyObject *__pyx_v_atol) { PetscReal __pyx_v_rval; IS __pyx_v_rp; IS __pyx_v_cp; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; IS __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("reorderForNonzeroDiagonal", 1); /* "petsc4py/PETSc/Mat.pyx":4507 * * """ * cdef PetscReal rval = asReal(atol) # <<<<<<<<<<<<<< * cdef PetscIS rp = isrow.iset, cp = iscol.iset * CHKERR( MatReorderForNonzeroDiagonal(self.mat, rval, rp, cp) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_atol); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(46, 4507, __pyx_L1_error) __pyx_v_rval = __pyx_t_1; /* "petsc4py/PETSc/Mat.pyx":4508 * """ * cdef PetscReal rval = asReal(atol) * cdef PetscIS rp = isrow.iset, cp = iscol.iset # <<<<<<<<<<<<<< * CHKERR( MatReorderForNonzeroDiagonal(self.mat, rval, rp, cp) ) * */ __pyx_t_2 = __pyx_v_isrow->iset; __pyx_v_rp = __pyx_t_2; __pyx_t_2 = __pyx_v_iscol->iset; __pyx_v_cp = __pyx_t_2; /* "petsc4py/PETSc/Mat.pyx":4509 * cdef PetscReal rval = asReal(atol) * cdef PetscIS rp = isrow.iset, cp = iscol.iset * CHKERR( MatReorderForNonzeroDiagonal(self.mat, rval, rp, cp) ) # <<<<<<<<<<<<<< * * def factorLU( */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatReorderForNonzeroDiagonal(__pyx_v_self->mat, __pyx_v_rval, __pyx_v_rp, __pyx_v_cp)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 4509, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":4482 * return (rp, cp) * * def reorderForNonzeroDiagonal( # <<<<<<<<<<<<<< * self, * IS isrow, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.reorderForNonzeroDiagonal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":4511 * CHKERR( MatReorderForNonzeroDiagonal(self.mat, rval, rp, cp) ) * * def factorLU( # <<<<<<<<<<<<<< * self, * IS isrow, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_375factorLU(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_374factorLU, "Mat.factorLU(self, isrow: IS, iscol: IS, options: dict[str, Any] | None = None) -> None\nPerform an in-place LU factorization.\n\n Collective.\n\n Parameters\n ----------\n isrow\n The row permutation.\n iscol\n The column permutation.\n options\n An optional dictionary of options for the factorization. These include\n ``fill``, the expected fill as a ratio of the original fill and\n ``dtcol``, the pivot tolerance where ``0`` indicates no pivot and ``1``\n indicates full column pivoting.\n\n See Also\n --------\n petsc.MatLUFactor\n\n \nSource code at petsc4py/PETSc/Mat.pyx:4511"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_375factorLU(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscISObject *__pyx_v_isrow = 0; struct PyPetscISObject *__pyx_v_iscol = 0; PyObject *__pyx_v_options = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("factorLU (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_isrow,&__pyx_n_s_iscol,&__pyx_n_s_options,0}; /* "petsc4py/PETSc/Mat.pyx":4515 * IS isrow, * IS iscol, * options: dict[str, Any] | None = None, # <<<<<<<<<<<<<< * ) -> None: * """Perform an in-place LU factorization. */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_isrow)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4511, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_iscol)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4511, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("factorLU", 0, 2, 3, 1); __PYX_ERR(46, 4511, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_options); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4511, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "factorLU") < 0)) __PYX_ERR(46, 4511, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_isrow = ((struct PyPetscISObject *)values[0]); __pyx_v_iscol = ((struct PyPetscISObject *)values[1]); __pyx_v_options = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("factorLU", 0, 2, 3, __pyx_nargs); __PYX_ERR(46, 4511, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.factorLU", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isrow), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "isrow", 0))) __PYX_ERR(46, 4513, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iscol), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "iscol", 0))) __PYX_ERR(46, 4514, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_374factorLU(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_isrow, __pyx_v_iscol, __pyx_v_options); /* "petsc4py/PETSc/Mat.pyx":4511 * CHKERR( MatReorderForNonzeroDiagonal(self.mat, rval, rp, cp) ) * * def factorLU( # <<<<<<<<<<<<<< * self, * IS isrow, */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_374factorLU(struct PyPetscMatObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_isrow, struct PyPetscISObject *__pyx_v_iscol, PyObject *__pyx_v_options) { MatFactorInfo __pyx_v_info; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("factorLU", 1); /* "petsc4py/PETSc/Mat.pyx":4539 * """ * cdef PetscMatFactorInfo info * matfactorinfo(PETSC_FALSE, PETSC_FALSE, options, &info) # <<<<<<<<<<<<<< * CHKERR( MatLUFactor(self.mat, isrow.iset, iscol.iset, &info) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_matfactorinfo(PETSC_FALSE, PETSC_FALSE, __pyx_v_options, (&__pyx_v_info)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 4539, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":4540 * cdef PetscMatFactorInfo info * matfactorinfo(PETSC_FALSE, PETSC_FALSE, options, &info) * CHKERR( MatLUFactor(self.mat, isrow.iset, iscol.iset, &info) ) # <<<<<<<<<<<<<< * * def factorSymbolicLU(self, Mat mat, IS isrow, IS iscol, options=None) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatLUFactor(__pyx_v_self->mat, __pyx_v_isrow->iset, __pyx_v_iscol->iset, (&__pyx_v_info))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 4540, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":4511 * CHKERR( MatReorderForNonzeroDiagonal(self.mat, rval, rp, cp) ) * * def factorLU( # <<<<<<<<<<<<<< * self, * IS isrow, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.factorLU", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":4542 * CHKERR( MatLUFactor(self.mat, isrow.iset, iscol.iset, &info) ) * * def factorSymbolicLU(self, Mat mat, IS isrow, IS iscol, options=None) -> None: # <<<<<<<<<<<<<< * """Not implemented.""" * raise NotImplementedError */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_377factorSymbolicLU(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_376factorSymbolicLU, "Mat.factorSymbolicLU(self, mat: Mat, isrow: IS, iscol: IS, options=None) -> None\nNot implemented.\nSource code at petsc4py/PETSc/Mat.pyx:4542"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_377factorSymbolicLU(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED struct PyPetscMatObject *__pyx_v_mat = 0; CYTHON_UNUSED struct PyPetscISObject *__pyx_v_isrow = 0; CYTHON_UNUSED struct PyPetscISObject *__pyx_v_iscol = 0; CYTHON_UNUSED PyObject *__pyx_v_options = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("factorSymbolicLU (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat,&__pyx_n_s_isrow,&__pyx_n_s_iscol,&__pyx_n_s_options,0}; values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mat)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4542, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_isrow)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4542, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("factorSymbolicLU", 0, 3, 4, 1); __PYX_ERR(46, 4542, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_iscol)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4542, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("factorSymbolicLU", 0, 3, 4, 2); __PYX_ERR(46, 4542, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_options); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4542, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "factorSymbolicLU") < 0)) __PYX_ERR(46, 4542, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_mat = ((struct PyPetscMatObject *)values[0]); __pyx_v_isrow = ((struct PyPetscISObject *)values[1]); __pyx_v_iscol = ((struct PyPetscISObject *)values[2]); __pyx_v_options = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("factorSymbolicLU", 0, 3, 4, __pyx_nargs); __PYX_ERR(46, 4542, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.factorSymbolicLU", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(46, 4542, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isrow), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "isrow", 0))) __PYX_ERR(46, 4542, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iscol), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "iscol", 0))) __PYX_ERR(46, 4542, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_376factorSymbolicLU(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_mat, __pyx_v_isrow, __pyx_v_iscol, __pyx_v_options); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_376factorSymbolicLU(CYTHON_UNUSED struct PyPetscMatObject *__pyx_v_self, CYTHON_UNUSED struct PyPetscMatObject *__pyx_v_mat, CYTHON_UNUSED struct PyPetscISObject *__pyx_v_isrow, CYTHON_UNUSED struct PyPetscISObject *__pyx_v_iscol, CYTHON_UNUSED PyObject *__pyx_v_options) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("factorSymbolicLU", 1); /* "petsc4py/PETSc/Mat.pyx":4544 * def factorSymbolicLU(self, Mat mat, IS isrow, IS iscol, options=None) -> None: * """Not implemented.""" * raise NotImplementedError # <<<<<<<<<<<<<< * * def factorNumericLU(self, Mat mat, options=None) -> None: */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); __PYX_ERR(46, 4544, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":4542 * CHKERR( MatLUFactor(self.mat, isrow.iset, iscol.iset, &info) ) * * def factorSymbolicLU(self, Mat mat, IS isrow, IS iscol, options=None) -> None: # <<<<<<<<<<<<<< * """Not implemented.""" * raise NotImplementedError */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.factorSymbolicLU", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":4546 * raise NotImplementedError * * def factorNumericLU(self, Mat mat, options=None) -> None: # <<<<<<<<<<<<<< * """Not implemented.""" * raise NotImplementedError */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_379factorNumericLU(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_378factorNumericLU, "Mat.factorNumericLU(self, mat: Mat, options=None) -> None\nNot implemented.\nSource code at petsc4py/PETSc/Mat.pyx:4546"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_379factorNumericLU(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED struct PyPetscMatObject *__pyx_v_mat = 0; CYTHON_UNUSED PyObject *__pyx_v_options = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("factorNumericLU (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat,&__pyx_n_s_options,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mat)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4546, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_options); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4546, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "factorNumericLU") < 0)) __PYX_ERR(46, 4546, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_mat = ((struct PyPetscMatObject *)values[0]); __pyx_v_options = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("factorNumericLU", 0, 1, 2, __pyx_nargs); __PYX_ERR(46, 4546, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.factorNumericLU", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(46, 4546, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_378factorNumericLU(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_mat, __pyx_v_options); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_378factorNumericLU(CYTHON_UNUSED struct PyPetscMatObject *__pyx_v_self, CYTHON_UNUSED struct PyPetscMatObject *__pyx_v_mat, CYTHON_UNUSED PyObject *__pyx_v_options) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("factorNumericLU", 1); /* "petsc4py/PETSc/Mat.pyx":4548 * def factorNumericLU(self, Mat mat, options=None) -> None: * """Not implemented.""" * raise NotImplementedError # <<<<<<<<<<<<<< * * def factorILU( */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); __PYX_ERR(46, 4548, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":4546 * raise NotImplementedError * * def factorNumericLU(self, Mat mat, options=None) -> None: # <<<<<<<<<<<<<< * """Not implemented.""" * raise NotImplementedError */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.factorNumericLU", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":4550 * raise NotImplementedError * * def factorILU( # <<<<<<<<<<<<<< * self, * IS isrow, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_381factorILU(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_380factorILU, "Mat.factorILU(self, isrow: IS, iscol: IS, options: dict[str, Any] | None = None) -> None\nPerform an in-place ILU factorization.\n\n Collective.\n\n Parameters\n ----------\n isrow\n The row permutation.\n iscol\n The column permutation.\n options\n An optional dictionary of options for the factorization. These include\n ``levels``, the number of levels of fill, ``fill``, the expected fill\n as a ratio of the original fill, and ``dtcol``, the pivot tolerance\n where ``0`` indicates no pivot and ``1`` indicates full column pivoting.\n\n See Also\n --------\n petsc.MatILUFactor\n\n \nSource code at petsc4py/PETSc/Mat.pyx:4550"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_381factorILU(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscISObject *__pyx_v_isrow = 0; struct PyPetscISObject *__pyx_v_iscol = 0; PyObject *__pyx_v_options = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("factorILU (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_isrow,&__pyx_n_s_iscol,&__pyx_n_s_options,0}; /* "petsc4py/PETSc/Mat.pyx":4554 * IS isrow, * IS iscol, * options: dict[str, Any] | None = None, # <<<<<<<<<<<<<< * ) -> None: * """Perform an in-place ILU factorization. */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_isrow)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4550, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_iscol)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4550, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("factorILU", 0, 2, 3, 1); __PYX_ERR(46, 4550, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_options); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4550, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "factorILU") < 0)) __PYX_ERR(46, 4550, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_isrow = ((struct PyPetscISObject *)values[0]); __pyx_v_iscol = ((struct PyPetscISObject *)values[1]); __pyx_v_options = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("factorILU", 0, 2, 3, __pyx_nargs); __PYX_ERR(46, 4550, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.factorILU", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isrow), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "isrow", 0))) __PYX_ERR(46, 4552, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iscol), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "iscol", 0))) __PYX_ERR(46, 4553, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_380factorILU(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_isrow, __pyx_v_iscol, __pyx_v_options); /* "petsc4py/PETSc/Mat.pyx":4550 * raise NotImplementedError * * def factorILU( # <<<<<<<<<<<<<< * self, * IS isrow, */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_380factorILU(struct PyPetscMatObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_isrow, struct PyPetscISObject *__pyx_v_iscol, PyObject *__pyx_v_options) { MatFactorInfo __pyx_v_info; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("factorILU", 1); /* "petsc4py/PETSc/Mat.pyx":4578 * """ * cdef PetscMatFactorInfo info * matfactorinfo(PETSC_TRUE, PETSC_FALSE, options, &info) # <<<<<<<<<<<<<< * CHKERR( MatILUFactor(self.mat, isrow.iset, iscol.iset, &info) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_matfactorinfo(PETSC_TRUE, PETSC_FALSE, __pyx_v_options, (&__pyx_v_info)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 4578, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":4579 * cdef PetscMatFactorInfo info * matfactorinfo(PETSC_TRUE, PETSC_FALSE, options, &info) * CHKERR( MatILUFactor(self.mat, isrow.iset, iscol.iset, &info) ) # <<<<<<<<<<<<<< * * def factorSymbolicILU(self, IS isrow, IS iscol, options=None) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatILUFactor(__pyx_v_self->mat, __pyx_v_isrow->iset, __pyx_v_iscol->iset, (&__pyx_v_info))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 4579, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":4550 * raise NotImplementedError * * def factorILU( # <<<<<<<<<<<<<< * self, * IS isrow, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.factorILU", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":4581 * CHKERR( MatILUFactor(self.mat, isrow.iset, iscol.iset, &info) ) * * def factorSymbolicILU(self, IS isrow, IS iscol, options=None) -> None: # <<<<<<<<<<<<<< * """Not implemented.""" * raise NotImplementedError */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_383factorSymbolicILU(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_382factorSymbolicILU, "Mat.factorSymbolicILU(self, isrow: IS, iscol: IS, options=None) -> None\nNot implemented.\nSource code at petsc4py/PETSc/Mat.pyx:4581"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_383factorSymbolicILU(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED struct PyPetscISObject *__pyx_v_isrow = 0; CYTHON_UNUSED struct PyPetscISObject *__pyx_v_iscol = 0; CYTHON_UNUSED PyObject *__pyx_v_options = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("factorSymbolicILU (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_isrow,&__pyx_n_s_iscol,&__pyx_n_s_options,0}; values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_isrow)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4581, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_iscol)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4581, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("factorSymbolicILU", 0, 2, 3, 1); __PYX_ERR(46, 4581, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_options); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4581, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "factorSymbolicILU") < 0)) __PYX_ERR(46, 4581, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_isrow = ((struct PyPetscISObject *)values[0]); __pyx_v_iscol = ((struct PyPetscISObject *)values[1]); __pyx_v_options = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("factorSymbolicILU", 0, 2, 3, __pyx_nargs); __PYX_ERR(46, 4581, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.factorSymbolicILU", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isrow), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "isrow", 0))) __PYX_ERR(46, 4581, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iscol), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "iscol", 0))) __PYX_ERR(46, 4581, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_382factorSymbolicILU(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_isrow, __pyx_v_iscol, __pyx_v_options); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_382factorSymbolicILU(CYTHON_UNUSED struct PyPetscMatObject *__pyx_v_self, CYTHON_UNUSED struct PyPetscISObject *__pyx_v_isrow, CYTHON_UNUSED struct PyPetscISObject *__pyx_v_iscol, CYTHON_UNUSED PyObject *__pyx_v_options) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("factorSymbolicILU", 1); /* "petsc4py/PETSc/Mat.pyx":4583 * def factorSymbolicILU(self, IS isrow, IS iscol, options=None) -> None: * """Not implemented.""" * raise NotImplementedError # <<<<<<<<<<<<<< * * def factorCholesky( */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); __PYX_ERR(46, 4583, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":4581 * CHKERR( MatILUFactor(self.mat, isrow.iset, iscol.iset, &info) ) * * def factorSymbolicILU(self, IS isrow, IS iscol, options=None) -> None: # <<<<<<<<<<<<<< * """Not implemented.""" * raise NotImplementedError */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.factorSymbolicILU", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":4585 * raise NotImplementedError * * def factorCholesky( # <<<<<<<<<<<<<< * self, * IS isperm, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_385factorCholesky(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_384factorCholesky, "Mat.factorCholesky(self, isperm: IS, options: dict[str, Any] | None = None) -> None\nPerform an in-place Cholesky factorization.\n\n Collective.\n\n Parameters\n ----------\n isperm\n The row and column permutations.\n options\n An optional dictionary of options for the factorization. These include\n ``fill``, the expected fill as a ratio of the original fill.\n\n See Also\n --------\n factorLU, petsc.MatCholeskyFactor\n\n \nSource code at petsc4py/PETSc/Mat.pyx:4585"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_385factorCholesky(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscISObject *__pyx_v_isperm = 0; PyObject *__pyx_v_options = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("factorCholesky (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_isperm,&__pyx_n_s_options,0}; /* "petsc4py/PETSc/Mat.pyx":4588 * self, * IS isperm, * options: dict[str, Any] | None = None, # <<<<<<<<<<<<<< * ) -> None: * """Perform an in-place Cholesky factorization. */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_isperm)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4585, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_options); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4585, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "factorCholesky") < 0)) __PYX_ERR(46, 4585, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_isperm = ((struct PyPetscISObject *)values[0]); __pyx_v_options = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("factorCholesky", 0, 1, 2, __pyx_nargs); __PYX_ERR(46, 4585, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.factorCholesky", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isperm), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "isperm", 0))) __PYX_ERR(46, 4587, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_384factorCholesky(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_isperm, __pyx_v_options); /* "petsc4py/PETSc/Mat.pyx":4585 * raise NotImplementedError * * def factorCholesky( # <<<<<<<<<<<<<< * self, * IS isperm, */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_384factorCholesky(struct PyPetscMatObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_isperm, PyObject *__pyx_v_options) { MatFactorInfo __pyx_v_info; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("factorCholesky", 1); /* "petsc4py/PETSc/Mat.pyx":4608 * """ * cdef PetscMatFactorInfo info * matfactorinfo(PETSC_FALSE, PETSC_TRUE, options, &info) # <<<<<<<<<<<<<< * CHKERR( MatCholeskyFactor(self.mat, isperm.iset, &info) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_matfactorinfo(PETSC_FALSE, PETSC_TRUE, __pyx_v_options, (&__pyx_v_info)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 4608, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":4609 * cdef PetscMatFactorInfo info * matfactorinfo(PETSC_FALSE, PETSC_TRUE, options, &info) * CHKERR( MatCholeskyFactor(self.mat, isperm.iset, &info) ) # <<<<<<<<<<<<<< * * def factorSymbolicCholesky(self, IS isperm, options=None) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCholeskyFactor(__pyx_v_self->mat, __pyx_v_isperm->iset, (&__pyx_v_info))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 4609, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":4585 * raise NotImplementedError * * def factorCholesky( # <<<<<<<<<<<<<< * self, * IS isperm, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.factorCholesky", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":4611 * CHKERR( MatCholeskyFactor(self.mat, isperm.iset, &info) ) * * def factorSymbolicCholesky(self, IS isperm, options=None) -> None: # <<<<<<<<<<<<<< * """Not implemented.""" * raise NotImplementedError */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_387factorSymbolicCholesky(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_386factorSymbolicCholesky, "Mat.factorSymbolicCholesky(self, isperm: IS, options=None) -> None\nNot implemented.\nSource code at petsc4py/PETSc/Mat.pyx:4611"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_387factorSymbolicCholesky(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED struct PyPetscISObject *__pyx_v_isperm = 0; CYTHON_UNUSED PyObject *__pyx_v_options = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("factorSymbolicCholesky (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_isperm,&__pyx_n_s_options,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_isperm)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4611, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_options); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4611, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "factorSymbolicCholesky") < 0)) __PYX_ERR(46, 4611, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_isperm = ((struct PyPetscISObject *)values[0]); __pyx_v_options = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("factorSymbolicCholesky", 0, 1, 2, __pyx_nargs); __PYX_ERR(46, 4611, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.factorSymbolicCholesky", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isperm), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "isperm", 0))) __PYX_ERR(46, 4611, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_386factorSymbolicCholesky(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_isperm, __pyx_v_options); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_386factorSymbolicCholesky(CYTHON_UNUSED struct PyPetscMatObject *__pyx_v_self, CYTHON_UNUSED struct PyPetscISObject *__pyx_v_isperm, CYTHON_UNUSED PyObject *__pyx_v_options) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("factorSymbolicCholesky", 1); /* "petsc4py/PETSc/Mat.pyx":4613 * def factorSymbolicCholesky(self, IS isperm, options=None) -> None: * """Not implemented.""" * raise NotImplementedError # <<<<<<<<<<<<<< * * def factorNumericCholesky(self, Mat mat, options=None) -> None: */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); __PYX_ERR(46, 4613, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":4611 * CHKERR( MatCholeskyFactor(self.mat, isperm.iset, &info) ) * * def factorSymbolicCholesky(self, IS isperm, options=None) -> None: # <<<<<<<<<<<<<< * """Not implemented.""" * raise NotImplementedError */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.factorSymbolicCholesky", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":4615 * raise NotImplementedError * * def factorNumericCholesky(self, Mat mat, options=None) -> None: # <<<<<<<<<<<<<< * """Not implemented.""" * raise NotImplementedError */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_389factorNumericCholesky(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_388factorNumericCholesky, "Mat.factorNumericCholesky(self, mat: Mat, options=None) -> None\nNot implemented.\nSource code at petsc4py/PETSc/Mat.pyx:4615"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_389factorNumericCholesky(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED struct PyPetscMatObject *__pyx_v_mat = 0; CYTHON_UNUSED PyObject *__pyx_v_options = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("factorNumericCholesky (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat,&__pyx_n_s_options,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mat)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4615, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_options); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4615, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "factorNumericCholesky") < 0)) __PYX_ERR(46, 4615, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_mat = ((struct PyPetscMatObject *)values[0]); __pyx_v_options = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("factorNumericCholesky", 0, 1, 2, __pyx_nargs); __PYX_ERR(46, 4615, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.factorNumericCholesky", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(46, 4615, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_388factorNumericCholesky(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_mat, __pyx_v_options); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_388factorNumericCholesky(CYTHON_UNUSED struct PyPetscMatObject *__pyx_v_self, CYTHON_UNUSED struct PyPetscMatObject *__pyx_v_mat, CYTHON_UNUSED PyObject *__pyx_v_options) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("factorNumericCholesky", 1); /* "petsc4py/PETSc/Mat.pyx":4617 * def factorNumericCholesky(self, Mat mat, options=None) -> None: * """Not implemented.""" * raise NotImplementedError # <<<<<<<<<<<<<< * * def factorICC( */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); __PYX_ERR(46, 4617, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":4615 * raise NotImplementedError * * def factorNumericCholesky(self, Mat mat, options=None) -> None: # <<<<<<<<<<<<<< * """Not implemented.""" * raise NotImplementedError */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.factorNumericCholesky", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":4619 * raise NotImplementedError * * def factorICC( # <<<<<<<<<<<<<< * self, * IS isperm, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_391factorICC(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_390factorICC, "Mat.factorICC(self, isperm: IS, options: dict[str, Any] | None = None) -> None\nPerform an in-place an incomplete Cholesky factorization.\n\n Collective.\n\n Parameters\n ----------\n isperm\n The row and column permutations\n options\n An optional dictionary of options for the factorization. These include\n ``fill``, the expected fill as a ratio of the original fill.\n\n See Also\n --------\n factorILU, petsc.MatICCFactor\n\n \nSource code at petsc4py/PETSc/Mat.pyx:4619"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_391factorICC(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscISObject *__pyx_v_isperm = 0; PyObject *__pyx_v_options = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("factorICC (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_isperm,&__pyx_n_s_options,0}; /* "petsc4py/PETSc/Mat.pyx":4622 * self, * IS isperm, * options: dict[str, Any] | None = None, # <<<<<<<<<<<<<< * ) -> None: * """Perform an in-place an incomplete Cholesky factorization. */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_isperm)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4619, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_options); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4619, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "factorICC") < 0)) __PYX_ERR(46, 4619, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_isperm = ((struct PyPetscISObject *)values[0]); __pyx_v_options = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("factorICC", 0, 1, 2, __pyx_nargs); __PYX_ERR(46, 4619, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.factorICC", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isperm), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "isperm", 0))) __PYX_ERR(46, 4621, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_390factorICC(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_isperm, __pyx_v_options); /* "petsc4py/PETSc/Mat.pyx":4619 * raise NotImplementedError * * def factorICC( # <<<<<<<<<<<<<< * self, * IS isperm, */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_390factorICC(struct PyPetscMatObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_isperm, PyObject *__pyx_v_options) { MatFactorInfo __pyx_v_info; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("factorICC", 1); /* "petsc4py/PETSc/Mat.pyx":4642 * """ * cdef PetscMatFactorInfo info * matfactorinfo(PETSC_TRUE, PETSC_TRUE, options, &info) # <<<<<<<<<<<<<< * CHKERR( MatICCFactor(self.mat, isperm.iset, &info) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_matfactorinfo(PETSC_TRUE, PETSC_TRUE, __pyx_v_options, (&__pyx_v_info)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 4642, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":4643 * cdef PetscMatFactorInfo info * matfactorinfo(PETSC_TRUE, PETSC_TRUE, options, &info) * CHKERR( MatICCFactor(self.mat, isperm.iset, &info) ) # <<<<<<<<<<<<<< * * def factorSymbolicICC(self, IS isperm, options=None) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatICCFactor(__pyx_v_self->mat, __pyx_v_isperm->iset, (&__pyx_v_info))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 4643, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":4619 * raise NotImplementedError * * def factorICC( # <<<<<<<<<<<<<< * self, * IS isperm, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.factorICC", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":4645 * CHKERR( MatICCFactor(self.mat, isperm.iset, &info) ) * * def factorSymbolicICC(self, IS isperm, options=None) -> None: # <<<<<<<<<<<<<< * """Not implemented.""" * raise NotImplementedError */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_393factorSymbolicICC(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_392factorSymbolicICC, "Mat.factorSymbolicICC(self, isperm: IS, options=None) -> None\nNot implemented.\nSource code at petsc4py/PETSc/Mat.pyx:4645"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_393factorSymbolicICC(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED struct PyPetscISObject *__pyx_v_isperm = 0; CYTHON_UNUSED PyObject *__pyx_v_options = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("factorSymbolicICC (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_isperm,&__pyx_n_s_options,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_isperm)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4645, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_options); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4645, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "factorSymbolicICC") < 0)) __PYX_ERR(46, 4645, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_isperm = ((struct PyPetscISObject *)values[0]); __pyx_v_options = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("factorSymbolicICC", 0, 1, 2, __pyx_nargs); __PYX_ERR(46, 4645, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.factorSymbolicICC", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isperm), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "isperm", 0))) __PYX_ERR(46, 4645, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_392factorSymbolicICC(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_isperm, __pyx_v_options); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_392factorSymbolicICC(CYTHON_UNUSED struct PyPetscMatObject *__pyx_v_self, CYTHON_UNUSED struct PyPetscISObject *__pyx_v_isperm, CYTHON_UNUSED PyObject *__pyx_v_options) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("factorSymbolicICC", 1); /* "petsc4py/PETSc/Mat.pyx":4647 * def factorSymbolicICC(self, IS isperm, options=None) -> None: * """Not implemented.""" * raise NotImplementedError # <<<<<<<<<<<<<< * * def getInertia(self) -> tuple[int, int, int]: */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); __PYX_ERR(46, 4647, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":4645 * CHKERR( MatICCFactor(self.mat, isperm.iset, &info) ) * * def factorSymbolicICC(self, IS isperm, options=None) -> None: # <<<<<<<<<<<<<< * """Not implemented.""" * raise NotImplementedError */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.factorSymbolicICC", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":4649 * raise NotImplementedError * * def getInertia(self) -> tuple[int, int, int]: # <<<<<<<<<<<<<< * """Return the inertia from a factored matrix. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_395getInertia(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_394getInertia, "Mat.getInertia(self) -> tuple[int, int, int]\nReturn the inertia from a factored matrix.\n\n Collective.\n\n The matrix must have been factored by calling `factorCholesky`.\n\n Returns\n -------\n n : int\n The number of negative eigenvalues.\n z : int\n The number of zero eigenvalues.\n p : int\n The number of positive eigenvalues.\n\n See Also\n --------\n petsc.MatGetInertia\n\n \nSource code at petsc4py/PETSc/Mat.pyx:4649"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_395getInertia(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getInertia (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getInertia", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getInertia", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_394getInertia(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_394getInertia(struct PyPetscMatObject *__pyx_v_self) { PetscInt __pyx_v_ival1; PetscInt __pyx_v_ival2; PetscInt __pyx_v_ival3; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getInertia", 1); /* "petsc4py/PETSc/Mat.pyx":4670 * * """ * cdef PetscInt ival1 = 0, ival2 = 0, ival3 = 0 # <<<<<<<<<<<<<< * CHKERR( MatGetInertia(self.mat, &ival1, &ival2, &ival3) ) * return (toInt(ival1), toInt(ival2), toInt(ival3)) */ __pyx_v_ival1 = 0; __pyx_v_ival2 = 0; __pyx_v_ival3 = 0; /* "petsc4py/PETSc/Mat.pyx":4671 * """ * cdef PetscInt ival1 = 0, ival2 = 0, ival3 = 0 * CHKERR( MatGetInertia(self.mat, &ival1, &ival2, &ival3) ) # <<<<<<<<<<<<<< * return (toInt(ival1), toInt(ival2), toInt(ival3)) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetInertia(__pyx_v_self->mat, (&__pyx_v_ival1), (&__pyx_v_ival2), (&__pyx_v_ival3))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 4671, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":4672 * cdef PetscInt ival1 = 0, ival2 = 0, ival3 = 0 * CHKERR( MatGetInertia(self.mat, &ival1, &ival2, &ival3) ) * return (toInt(ival1), toInt(ival2), toInt(ival3)) # <<<<<<<<<<<<<< * * def setUnfactored(self) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ival1); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 4672, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ival2); if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 4672, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ival3); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 4672, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(46, 4672, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2)) __PYX_ERR(46, 4672, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3)) __PYX_ERR(46, 4672, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4)) __PYX_ERR(46, 4672, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":4649 * raise NotImplementedError * * def getInertia(self) -> tuple[int, int, int]: # <<<<<<<<<<<<<< * """Return the inertia from a factored matrix. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getInertia", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":4674 * return (toInt(ival1), toInt(ival2), toInt(ival3)) * * def setUnfactored(self) -> None: # <<<<<<<<<<<<<< * """Set a factored matrix to be treated as unfactored. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_397setUnfactored(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_396setUnfactored, "Mat.setUnfactored(self) -> None\nSet a factored matrix to be treated as unfactored.\n\n Logically collective.\n\n See Also\n --------\n petsc.MatSetUnfactored\n\n \nSource code at petsc4py/PETSc/Mat.pyx:4674"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_397setUnfactored(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setUnfactored (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("setUnfactored", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setUnfactored", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_396setUnfactored(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_396setUnfactored(struct PyPetscMatObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setUnfactored", 1); /* "petsc4py/PETSc/Mat.pyx":4684 * * """ * CHKERR( MatSetUnfactored(self.mat) ) # <<<<<<<<<<<<<< * * # IS */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSetUnfactored(__pyx_v_self->mat)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 4684, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":4674 * return (toInt(ival1), toInt(ival2), toInt(ival3)) * * def setUnfactored(self) -> None: # <<<<<<<<<<<<<< * """Set a factored matrix to be treated as unfactored. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setUnfactored", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":4688 * # IS * * def fixISLocalEmpty(self, fix: bool) -> None: # <<<<<<<<<<<<<< * """Compress out zero local rows from the local matrices. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_399fixISLocalEmpty(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_398fixISLocalEmpty, "Mat.fixISLocalEmpty(self, fix: bool) -> None\nCompress out zero local rows from the local matrices.\n\n Collective.\n\n Parameters\n ----------\n fix\n When `True`, new local matrices and local to global maps are generated\n during the final assembly process.\n\n See Also\n --------\n petsc.MatISFixLocalEmpty\n\n \nSource code at petsc4py/PETSc/Mat.pyx:4688"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_399fixISLocalEmpty(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_fix = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("fixISLocalEmpty (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fix,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fix)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4688, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "fixISLocalEmpty") < 0)) __PYX_ERR(46, 4688, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_fix = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("fixISLocalEmpty", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 4688, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.fixISLocalEmpty", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_398fixISLocalEmpty(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_fix); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_398fixISLocalEmpty(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_fix) { PetscBool __pyx_v_cfix; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("fixISLocalEmpty", 1); /* "petsc4py/PETSc/Mat.pyx":4704 * * """ * cdef PetscBool cfix = asBool(fix) # <<<<<<<<<<<<<< * CHKERR( MatISFixLocalEmpty(self.mat, cfix) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asBool(__pyx_v_fix); if (unlikely(__pyx_t_1 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(46, 4704, __pyx_L1_error) __pyx_v_cfix = __pyx_t_1; /* "petsc4py/PETSc/Mat.pyx":4705 * """ * cdef PetscBool cfix = asBool(fix) * CHKERR( MatISFixLocalEmpty(self.mat, cfix) ) # <<<<<<<<<<<<<< * * def getISLocalMat(self) -> Mat: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatISFixLocalEmpty(__pyx_v_self->mat, __pyx_v_cfix)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 4705, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":4688 * # IS * * def fixISLocalEmpty(self, fix: bool) -> None: # <<<<<<<<<<<<<< * """Compress out zero local rows from the local matrices. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.fixISLocalEmpty", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":4707 * CHKERR( MatISFixLocalEmpty(self.mat, cfix) ) * * def getISLocalMat(self) -> Mat: # <<<<<<<<<<<<<< * """Return the local matrix stored inside a `Type.IS` matrix. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_401getISLocalMat(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_400getISLocalMat, "Mat.getISLocalMat(self) -> Mat\nReturn the local matrix stored inside a `Type.IS` matrix.\n\n See Also\n --------\n petsc.MatISGetLocalMat\n\n \nSource code at petsc4py/PETSc/Mat.pyx:4707"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_401getISLocalMat(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getISLocalMat (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getISLocalMat", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getISLocalMat", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_400getISLocalMat(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_400getISLocalMat(struct PyPetscMatObject *__pyx_v_self) { struct PyPetscMatObject *__pyx_v_local = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getISLocalMat", 1); /* "petsc4py/PETSc/Mat.pyx":4715 * * """ * cdef Mat local = Mat() # <<<<<<<<<<<<<< * CHKERR( MatISGetLocalMat(self.mat, &local.mat) ) * CHKERR( PetscINCREF(local.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 4715, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_local = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Mat.pyx":4716 * """ * cdef Mat local = Mat() * CHKERR( MatISGetLocalMat(self.mat, &local.mat) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(local.obj) ) * return local */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatISGetLocalMat(__pyx_v_self->mat, (&__pyx_v_local->mat))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 4716, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":4717 * cdef Mat local = Mat() * CHKERR( MatISGetLocalMat(self.mat, &local.mat) ) * CHKERR( PetscINCREF(local.obj) ) # <<<<<<<<<<<<<< * return local * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_local->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 4717, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":4718 * CHKERR( MatISGetLocalMat(self.mat, &local.mat) ) * CHKERR( PetscINCREF(local.obj) ) * return local # <<<<<<<<<<<<<< * * def restoreISLocalMat(self, Mat local not None) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_local); __pyx_r = ((PyObject *)__pyx_v_local); goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":4707 * CHKERR( MatISFixLocalEmpty(self.mat, cfix) ) * * def getISLocalMat(self) -> Mat: # <<<<<<<<<<<<<< * """Return the local matrix stored inside a `Type.IS` matrix. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getISLocalMat", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_local); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":4720 * return local * * def restoreISLocalMat(self, Mat local not None) -> None: # <<<<<<<<<<<<<< * """Restore the local matrix obtained with `getISLocalMat`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_403restoreISLocalMat(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_402restoreISLocalMat, "Mat.restoreISLocalMat(self, local: Mat) -> None\nRestore the local matrix obtained with `getISLocalMat`.\n\n Parameters\n ----------\n local\n The local matrix.\n\n See Also\n --------\n petsc.MatISRestoreLocalMat\n\n \nSource code at petsc4py/PETSc/Mat.pyx:4720"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_403restoreISLocalMat(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscMatObject *__pyx_v_local = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("restoreISLocalMat (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_local,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_local)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4720, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "restoreISLocalMat") < 0)) __PYX_ERR(46, 4720, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_local = ((struct PyPetscMatObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("restoreISLocalMat", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 4720, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.restoreISLocalMat", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_local), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "local", 0))) __PYX_ERR(46, 4720, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_402restoreISLocalMat(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_local); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_402restoreISLocalMat(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_local) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("restoreISLocalMat", 1); /* "petsc4py/PETSc/Mat.pyx":4733 * * """ * CHKERR( MatISRestoreLocalMat(self.mat, &local.mat) ) # <<<<<<<<<<<<<< * * def setISLocalMat(self, Mat local not None) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatISRestoreLocalMat(__pyx_v_self->mat, (&__pyx_v_local->mat))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 4733, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":4720 * return local * * def restoreISLocalMat(self, Mat local not None) -> None: # <<<<<<<<<<<<<< * """Restore the local matrix obtained with `getISLocalMat`. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.restoreISLocalMat", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":4735 * CHKERR( MatISRestoreLocalMat(self.mat, &local.mat) ) * * def setISLocalMat(self, Mat local not None) -> None: # <<<<<<<<<<<<<< * """Set the local matrix stored inside a `Type.IS`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_405setISLocalMat(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_404setISLocalMat, "Mat.setISLocalMat(self, local: Mat) -> None\nSet the local matrix stored inside a `Type.IS`.\n\n Parameters\n ----------\n local\n The local matrix.\n\n See Also\n --------\n petsc.MatISSetLocalMat\n\n \nSource code at petsc4py/PETSc/Mat.pyx:4735"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_405setISLocalMat(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscMatObject *__pyx_v_local = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setISLocalMat (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_local,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_local)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4735, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setISLocalMat") < 0)) __PYX_ERR(46, 4735, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_local = ((struct PyPetscMatObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setISLocalMat", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 4735, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.setISLocalMat", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_local), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "local", 0))) __PYX_ERR(46, 4735, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_404setISLocalMat(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_local); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_404setISLocalMat(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_local) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setISLocalMat", 1); /* "petsc4py/PETSc/Mat.pyx":4748 * * """ * CHKERR( MatISSetLocalMat(self.mat, local.mat) ) # <<<<<<<<<<<<<< * * def setISPreallocation( */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatISSetLocalMat(__pyx_v_self->mat, __pyx_v_local->mat)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 4748, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":4735 * CHKERR( MatISRestoreLocalMat(self.mat, &local.mat) ) * * def setISLocalMat(self, Mat local not None) -> None: # <<<<<<<<<<<<<< * """Set the local matrix stored inside a `Type.IS`. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setISLocalMat", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":4750 * CHKERR( MatISSetLocalMat(self.mat, local.mat) ) * * def setISPreallocation( # <<<<<<<<<<<<<< * self, * nnz: Sequence[int], */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_407setISPreallocation(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_406setISPreallocation, "Mat.setISPreallocation(self, nnz: Sequence[int], onnz: Sequence[int]) -> Self\nPreallocate memory for a `Type.IS` parallel matrix.\n\n Parameters\n ----------\n nnz\n The sequence whose length corresponds to the number of local rows\n and values which represent the number of nonzeros in the various\n rows of the *diagonal* of the local submatrix.\n onnz:\n The sequence whose length corresponds to the number of local rows\n and values which represent the number of nonzeros in the various\n rows of the *off-diagonal* of the local submatrix.\n\n See Also\n --------\n petsc.MatISSetPreallocation\n\n \nSource code at petsc4py/PETSc/Mat.pyx:4750"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_407setISPreallocation(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_nnz = 0; PyObject *__pyx_v_onnz = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setISPreallocation (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nnz,&__pyx_n_s_onnz,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_nnz)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4750, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_onnz)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4750, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setISPreallocation", 1, 2, 2, 1); __PYX_ERR(46, 4750, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setISPreallocation") < 0)) __PYX_ERR(46, 4750, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_nnz = values[0]; __pyx_v_onnz = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setISPreallocation", 1, 2, 2, __pyx_nargs); __PYX_ERR(46, 4750, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.setISPreallocation", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_406setISPreallocation(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_nnz, __pyx_v_onnz); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_406setISPreallocation(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_nnz, PyObject *__pyx_v_onnz) { PetscInt *__pyx_v_cnnz; PetscInt *__pyx_v_connz; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setISPreallocation", 0); __Pyx_INCREF(__pyx_v_nnz); __Pyx_INCREF(__pyx_v_onnz); /* "petsc4py/PETSc/Mat.pyx":4773 * * """ * cdef PetscInt *cnnz = NULL # <<<<<<<<<<<<<< * cdef PetscInt *connz = NULL * nnz = iarray_i(nnz, NULL, &cnnz) */ __pyx_v_cnnz = NULL; /* "petsc4py/PETSc/Mat.pyx":4774 * """ * cdef PetscInt *cnnz = NULL * cdef PetscInt *connz = NULL # <<<<<<<<<<<<<< * nnz = iarray_i(nnz, NULL, &cnnz) * onnz = iarray_i(onnz, NULL, &connz) */ __pyx_v_connz = NULL; /* "petsc4py/PETSc/Mat.pyx":4775 * cdef PetscInt *cnnz = NULL * cdef PetscInt *connz = NULL * nnz = iarray_i(nnz, NULL, &cnnz) # <<<<<<<<<<<<<< * onnz = iarray_i(onnz, NULL, &connz) * CHKERR( MatISSetPreallocation(self.mat, 0, cnnz, 0, connz) ) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_nnz, NULL, (&__pyx_v_cnnz))); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 4775, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_nnz, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Mat.pyx":4776 * cdef PetscInt *connz = NULL * nnz = iarray_i(nnz, NULL, &cnnz) * onnz = iarray_i(onnz, NULL, &connz) # <<<<<<<<<<<<<< * CHKERR( MatISSetPreallocation(self.mat, 0, cnnz, 0, connz) ) * return self */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_onnz, NULL, (&__pyx_v_connz))); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 4776, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_onnz, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Mat.pyx":4777 * nnz = iarray_i(nnz, NULL, &cnnz) * onnz = iarray_i(onnz, NULL, &connz) * CHKERR( MatISSetPreallocation(self.mat, 0, cnnz, 0, connz) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatISSetPreallocation(__pyx_v_self->mat, 0, __pyx_v_cnnz, 0, __pyx_v_connz)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 4777, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":4778 * onnz = iarray_i(onnz, NULL, &connz) * CHKERR( MatISSetPreallocation(self.mat, 0, cnnz, 0, connz) ) * return self # <<<<<<<<<<<<<< * * # LRC */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":4750 * CHKERR( MatISSetLocalMat(self.mat, local.mat) ) * * def setISPreallocation( # <<<<<<<<<<<<<< * self, * nnz: Sequence[int], */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.setISPreallocation", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_nnz); __Pyx_XDECREF(__pyx_v_onnz); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":4782 * # LRC * * def getLRCMats(self) -> tuple[Mat, Mat, Vec, Mat]: # <<<<<<<<<<<<<< * """Return the constituents of a `Type.LRC` matrix. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_409getLRCMats(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_408getLRCMats, "Mat.getLRCMats(self) -> tuple[Mat, Mat, Vec, Mat]\nReturn the constituents of a `Type.LRC` matrix.\n\n Not collective.\n\n Returns\n -------\n A : Mat\n The ``A`` matrix.\n U : Mat\n The first dense rectangular matrix.\n c : Vec\n The sequential vector containing the diagonal of ``C``.\n V : Mat\n The second dense rectangular matrix.\n\n See Also\n --------\n petsc.MatLRCGetMats\n\n \nSource code at petsc4py/PETSc/Mat.pyx:4782"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_409getLRCMats(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getLRCMats (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getLRCMats", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getLRCMats", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_408getLRCMats(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_408getLRCMats(struct PyPetscMatObject *__pyx_v_self) { struct PyPetscMatObject *__pyx_v_A = 0; struct PyPetscMatObject *__pyx_v_U = 0; struct PyPetscVecObject *__pyx_v_c = 0; struct PyPetscMatObject *__pyx_v_V = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getLRCMats", 1); /* "petsc4py/PETSc/Mat.pyx":4803 * * """ * cdef Mat A = Mat() # <<<<<<<<<<<<<< * cdef Mat U = Mat() * cdef Vec c = Vec() */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 4803, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_A = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Mat.pyx":4804 * """ * cdef Mat A = Mat() * cdef Mat U = Mat() # <<<<<<<<<<<<<< * cdef Vec c = Vec() * cdef Mat V = Mat() */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 4804, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_U = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Mat.pyx":4805 * cdef Mat A = Mat() * cdef Mat U = Mat() * cdef Vec c = Vec() # <<<<<<<<<<<<<< * cdef Mat V = Mat() * CHKERR( MatLRCGetMats(self.mat, &A.mat, &U.mat, &c.vec, &V.mat) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 4805, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_c = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Mat.pyx":4806 * cdef Mat U = Mat() * cdef Vec c = Vec() * cdef Mat V = Mat() # <<<<<<<<<<<<<< * CHKERR( MatLRCGetMats(self.mat, &A.mat, &U.mat, &c.vec, &V.mat) ) * CHKERR( PetscINCREF(A.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 4806, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_V = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Mat.pyx":4807 * cdef Vec c = Vec() * cdef Mat V = Mat() * CHKERR( MatLRCGetMats(self.mat, &A.mat, &U.mat, &c.vec, &V.mat) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(A.obj) ) * CHKERR( PetscINCREF(U.obj) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatLRCGetMats(__pyx_v_self->mat, (&__pyx_v_A->mat), (&__pyx_v_U->mat), (&__pyx_v_c->vec), (&__pyx_v_V->mat))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 4807, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":4808 * cdef Mat V = Mat() * CHKERR( MatLRCGetMats(self.mat, &A.mat, &U.mat, &c.vec, &V.mat) ) * CHKERR( PetscINCREF(A.obj) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(U.obj) ) * CHKERR( PetscINCREF(c.obj) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_A->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 4808, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":4809 * CHKERR( MatLRCGetMats(self.mat, &A.mat, &U.mat, &c.vec, &V.mat) ) * CHKERR( PetscINCREF(A.obj) ) * CHKERR( PetscINCREF(U.obj) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(c.obj) ) * CHKERR( PetscINCREF(V.obj) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_U->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 4809, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":4810 * CHKERR( PetscINCREF(A.obj) ) * CHKERR( PetscINCREF(U.obj) ) * CHKERR( PetscINCREF(c.obj) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(V.obj) ) * return (A, U, c, V) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_c->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 4810, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":4811 * CHKERR( PetscINCREF(U.obj) ) * CHKERR( PetscINCREF(c.obj) ) * CHKERR( PetscINCREF(V.obj) ) # <<<<<<<<<<<<<< * return (A, U, c, V) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_V->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 4811, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":4812 * CHKERR( PetscINCREF(c.obj) ) * CHKERR( PetscINCREF(V.obj) ) * return (A, U, c, V) # <<<<<<<<<<<<<< * * def setLRCMats(self, Mat A, Mat U, Vec c=None, Mat V=None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 4812, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF((PyObject *)__pyx_v_A); __Pyx_GIVEREF((PyObject *)__pyx_v_A); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_A))) __PYX_ERR(46, 4812, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_U); __Pyx_GIVEREF((PyObject *)__pyx_v_U); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_U))) __PYX_ERR(46, 4812, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_c); __Pyx_GIVEREF((PyObject *)__pyx_v_c); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_c))) __PYX_ERR(46, 4812, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_V); __Pyx_GIVEREF((PyObject *)__pyx_v_V); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_V))) __PYX_ERR(46, 4812, __pyx_L1_error); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":4782 * # LRC * * def getLRCMats(self) -> tuple[Mat, Mat, Vec, Mat]: # <<<<<<<<<<<<<< * """Return the constituents of a `Type.LRC` matrix. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getLRCMats", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_A); __Pyx_XDECREF((PyObject *)__pyx_v_U); __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XDECREF((PyObject *)__pyx_v_V); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":4814 * return (A, U, c, V) * * def setLRCMats(self, Mat A, Mat U, Vec c=None, Mat V=None): # <<<<<<<<<<<<<< * """Set the constituents of a `Type.LRC` matrix. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_411setLRCMats(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_410setLRCMats, "Mat.setLRCMats(self, A: Mat, U: Mat, c: Vec | None = None, V: Mat | None = None)\nSet the constituents of a `Type.LRC` matrix.\n\n Logically collective.\n\n Parameters\n ----------\n A : Mat\n The ``A`` matrix, or `None` to omit ``A``.\n U : Mat\n The first dense rectangular matrix.\n c : Vec\n The sequential vector containing the diagonal of ``C``,\n or `None` for all ones.\n V : Mat\n The second dense rectangular matrix, or `None` for a copy of ``U``.\n\n See Also\n --------\n petsc.MatLRCSetMats\n\n \nSource code at petsc4py/PETSc/Mat.pyx:4814"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_411setLRCMats(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscMatObject *__pyx_v_A = 0; struct PyPetscMatObject *__pyx_v_U = 0; struct PyPetscVecObject *__pyx_v_c = 0; struct PyPetscMatObject *__pyx_v_V = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setLRCMats (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_U,&__pyx_n_s_c,&__pyx_n_s_V,0}; values[2] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscVecObject *)Py_None)); values[3] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscMatObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_A)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4814, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_U)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4814, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setLRCMats", 0, 2, 4, 1); __PYX_ERR(46, 4814, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_c); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4814, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_V); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4814, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setLRCMats") < 0)) __PYX_ERR(46, 4814, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_A = ((struct PyPetscMatObject *)values[0]); __pyx_v_U = ((struct PyPetscMatObject *)values[1]); __pyx_v_c = ((struct PyPetscVecObject *)values[2]); __pyx_v_V = ((struct PyPetscMatObject *)values[3]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setLRCMats", 0, 2, 4, __pyx_nargs); __PYX_ERR(46, 4814, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.setLRCMats", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_A), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "A", 0))) __PYX_ERR(46, 4814, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_U), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "U", 0))) __PYX_ERR(46, 4814, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_c), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "c", 0))) __PYX_ERR(46, 4814, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_V), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "V", 0))) __PYX_ERR(46, 4814, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_410setLRCMats(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_A, __pyx_v_U, __pyx_v_c, __pyx_v_V); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_410setLRCMats(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_A, struct PyPetscMatObject *__pyx_v_U, struct PyPetscVecObject *__pyx_v_c, struct PyPetscMatObject *__pyx_v_V) { Mat __pyx_v_Amat; Vec __pyx_v_cvec; Mat __pyx_v_Vmat; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Mat __pyx_t_1; int __pyx_t_2; Vec __pyx_t_3; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setLRCMats", 1); /* "petsc4py/PETSc/Mat.pyx":4836 * * """ * cdef PetscMat Amat = A.mat if A is not None else NULL # <<<<<<<<<<<<<< * cdef PetscVec cvec = c.vec if c is not None else NULL * cdef PetscMat Vmat = V.mat if V is not None else NULL */ __pyx_t_2 = (((PyObject *)__pyx_v_A) != Py_None); if (__pyx_t_2) { __pyx_t_1 = __pyx_v_A->mat; } else { __pyx_t_1 = ((Mat)NULL); } __pyx_v_Amat = __pyx_t_1; /* "petsc4py/PETSc/Mat.pyx":4837 * """ * cdef PetscMat Amat = A.mat if A is not None else NULL * cdef PetscVec cvec = c.vec if c is not None else NULL # <<<<<<<<<<<<<< * cdef PetscMat Vmat = V.mat if V is not None else NULL * CHKERR( MatLRCSetMats(self.mat, Amat, U.mat, cvec, Vmat) ) */ __pyx_t_2 = (((PyObject *)__pyx_v_c) != Py_None); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_c->vec; } else { __pyx_t_3 = ((Vec)NULL); } __pyx_v_cvec = __pyx_t_3; /* "petsc4py/PETSc/Mat.pyx":4838 * cdef PetscMat Amat = A.mat if A is not None else NULL * cdef PetscVec cvec = c.vec if c is not None else NULL * cdef PetscMat Vmat = V.mat if V is not None else NULL # <<<<<<<<<<<<<< * CHKERR( MatLRCSetMats(self.mat, Amat, U.mat, cvec, Vmat) ) * */ __pyx_t_2 = (((PyObject *)__pyx_v_V) != Py_None); if (__pyx_t_2) { __pyx_t_1 = __pyx_v_V->mat; } else { __pyx_t_1 = ((Mat)NULL); } __pyx_v_Vmat = __pyx_t_1; /* "petsc4py/PETSc/Mat.pyx":4839 * cdef PetscVec cvec = c.vec if c is not None else NULL * cdef PetscMat Vmat = V.mat if V is not None else NULL * CHKERR( MatLRCSetMats(self.mat, Amat, U.mat, cvec, Vmat) ) # <<<<<<<<<<<<<< * * # H2Opus */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatLRCSetMats(__pyx_v_self->mat, __pyx_v_Amat, __pyx_v_U->mat, __pyx_v_cvec, __pyx_v_Vmat)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 4839, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":4814 * return (A, U, c, V) * * def setLRCMats(self, Mat A, Mat U, Vec c=None, Mat V=None): # <<<<<<<<<<<<<< * """Set the constituents of a `Type.LRC` matrix. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setLRCMats", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":4843 * # H2Opus * * def H2OpusOrthogonalize(self) -> Self: # <<<<<<<<<<<<<< * """Orthogonalize the basis tree of a hierarchical matrix. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_413H2OpusOrthogonalize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_412H2OpusOrthogonalize, "Mat.H2OpusOrthogonalize(self) -> Self\nOrthogonalize the basis tree of a hierarchical matrix.\n\n See Also\n --------\n petsc.MatH2OpusOrthogonalize\n\n \nSource code at petsc4py/PETSc/Mat.pyx:4843"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_413H2OpusOrthogonalize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("H2OpusOrthogonalize (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("H2OpusOrthogonalize", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "H2OpusOrthogonalize", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_412H2OpusOrthogonalize(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_412H2OpusOrthogonalize(struct PyPetscMatObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("H2OpusOrthogonalize", 1); /* "petsc4py/PETSc/Mat.pyx":4851 * * """ * CHKERR( MatH2OpusOrthogonalize(self.mat) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatH2OpusOrthogonalize(__pyx_v_self->mat)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 4851, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":4852 * """ * CHKERR( MatH2OpusOrthogonalize(self.mat) ) * return self # <<<<<<<<<<<<<< * * def H2OpusCompress(self, tol: float): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":4843 * # H2Opus * * def H2OpusOrthogonalize(self) -> Self: # <<<<<<<<<<<<<< * """Orthogonalize the basis tree of a hierarchical matrix. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.H2OpusOrthogonalize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":4854 * return self * * def H2OpusCompress(self, tol: float): # <<<<<<<<<<<<<< * """Compress a hierarchical matrix. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_415H2OpusCompress(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_414H2OpusCompress, "Mat.H2OpusCompress(self, tol: float)\nCompress a hierarchical matrix.\n\n Parameters\n ----------\n tol\n The absolute truncation threshold.\n\n See Also\n --------\n petsc.MatH2OpusCompress\n\n \nSource code at petsc4py/PETSc/Mat.pyx:4854"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_415H2OpusCompress(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_tol = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("H2OpusCompress (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tol,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_tol)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4854, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "H2OpusCompress") < 0)) __PYX_ERR(46, 4854, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_tol = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("H2OpusCompress", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 4854, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.H2OpusCompress", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_414H2OpusCompress(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_tol); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_414H2OpusCompress(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_tol) { PetscReal __pyx_v__tol; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("H2OpusCompress", 1); /* "petsc4py/PETSc/Mat.pyx":4867 * * """ * cdef PetscReal _tol = asReal(tol) # <<<<<<<<<<<<<< * CHKERR( MatH2OpusCompress(self.mat, _tol) ) * return self */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_tol); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(46, 4867, __pyx_L1_error) __pyx_v__tol = __pyx_t_1; /* "petsc4py/PETSc/Mat.pyx":4868 * """ * cdef PetscReal _tol = asReal(tol) * CHKERR( MatH2OpusCompress(self.mat, _tol) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatH2OpusCompress(__pyx_v_self->mat, __pyx_v__tol)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 4868, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":4869 * cdef PetscReal _tol = asReal(tol) * CHKERR( MatH2OpusCompress(self.mat, _tol) ) * return self # <<<<<<<<<<<<<< * * def H2OpusLowRankUpdate(self, Mat U, Mat V=None, s: float = 1.0): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":4854 * return self * * def H2OpusCompress(self, tol: float): # <<<<<<<<<<<<<< * """Compress a hierarchical matrix. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.H2OpusCompress", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":4871 * return self * * def H2OpusLowRankUpdate(self, Mat U, Mat V=None, s: float = 1.0): # <<<<<<<<<<<<<< * """Perform a low-rank update of the form ``self`` += sUV. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_417H2OpusLowRankUpdate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_416H2OpusLowRankUpdate, "Mat.H2OpusLowRankUpdate(self, U: Mat, V: Mat | None = None, s: float = 1.0)\nPerform a low-rank update of the form ``self`` += sUV\341\265\200.\n\n Parameters\n ----------\n U\n The dense low-rank update matrix.\n V\n The dense low-rank update matrix. If `None`, ``V = U``.\n s\n The scaling factor.\n\n See Also\n --------\n petsc.MatH2OpusLowRankUpdate\n\n \nSource code at petsc4py/PETSc/Mat.pyx:4871"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_417H2OpusLowRankUpdate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscMatObject *__pyx_v_U = 0; struct PyPetscMatObject *__pyx_v_V = 0; PyObject *__pyx_v_s = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("H2OpusLowRankUpdate (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_U,&__pyx_n_s_V,&__pyx_n_s_s_2,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscMatObject *)Py_None)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_float_1_0)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_U)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4871, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_V); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4871, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_s_2); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4871, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "H2OpusLowRankUpdate") < 0)) __PYX_ERR(46, 4871, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_U = ((struct PyPetscMatObject *)values[0]); __pyx_v_V = ((struct PyPetscMatObject *)values[1]); __pyx_v_s = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("H2OpusLowRankUpdate", 0, 1, 3, __pyx_nargs); __PYX_ERR(46, 4871, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.H2OpusLowRankUpdate", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_U), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "U", 0))) __PYX_ERR(46, 4871, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_V), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "V", 0))) __PYX_ERR(46, 4871, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_416H2OpusLowRankUpdate(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_U, __pyx_v_V, __pyx_v_s); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_416H2OpusLowRankUpdate(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_U, struct PyPetscMatObject *__pyx_v_V, PyObject *__pyx_v_s) { PetscScalar __pyx_v__s; Mat __pyx_v_vmat; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscScalar __pyx_t_1; int __pyx_t_2; Mat __pyx_t_3; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("H2OpusLowRankUpdate", 1); /* "petsc4py/PETSc/Mat.pyx":4888 * * """ * cdef PetscScalar _s = asScalar(s) # <<<<<<<<<<<<<< * cdef PetscMat vmat = NULL * if V is not None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_s); if (unlikely(__pyx_t_1 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(46, 4888, __pyx_L1_error) __pyx_v__s = __pyx_t_1; /* "petsc4py/PETSc/Mat.pyx":4889 * """ * cdef PetscScalar _s = asScalar(s) * cdef PetscMat vmat = NULL # <<<<<<<<<<<<<< * if V is not None: * vmat = V.mat */ __pyx_v_vmat = NULL; /* "petsc4py/PETSc/Mat.pyx":4890 * cdef PetscScalar _s = asScalar(s) * cdef PetscMat vmat = NULL * if V is not None: # <<<<<<<<<<<<<< * vmat = V.mat * CHKERR( MatH2OpusLowRankUpdate(self.mat, U.mat, vmat, _s) ) */ __pyx_t_2 = (((PyObject *)__pyx_v_V) != Py_None); if (__pyx_t_2) { /* "petsc4py/PETSc/Mat.pyx":4891 * cdef PetscMat vmat = NULL * if V is not None: * vmat = V.mat # <<<<<<<<<<<<<< * CHKERR( MatH2OpusLowRankUpdate(self.mat, U.mat, vmat, _s) ) * return self */ __pyx_t_3 = __pyx_v_V->mat; __pyx_v_vmat = __pyx_t_3; /* "petsc4py/PETSc/Mat.pyx":4890 * cdef PetscScalar _s = asScalar(s) * cdef PetscMat vmat = NULL * if V is not None: # <<<<<<<<<<<<<< * vmat = V.mat * CHKERR( MatH2OpusLowRankUpdate(self.mat, U.mat, vmat, _s) ) */ } /* "petsc4py/PETSc/Mat.pyx":4892 * if V is not None: * vmat = V.mat * CHKERR( MatH2OpusLowRankUpdate(self.mat, U.mat, vmat, _s) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatH2OpusLowRankUpdate(__pyx_v_self->mat, __pyx_v_U->mat, __pyx_v_vmat, __pyx_v__s)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 4892, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":4893 * vmat = V.mat * CHKERR( MatH2OpusLowRankUpdate(self.mat, U.mat, vmat, _s) ) * return self # <<<<<<<<<<<<<< * * # MUMPS */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":4871 * return self * * def H2OpusLowRankUpdate(self, Mat U, Mat V=None, s: float = 1.0): # <<<<<<<<<<<<<< * """Perform a low-rank update of the form ``self`` += sUV. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.H2OpusLowRankUpdate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":4897 * # MUMPS * * def setMumpsIcntl(self, icntl: int, ival: int) -> None: # <<<<<<<<<<<<<< * """Set a MUMPS parameter, ``ICNTL[icntl] = ival``. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_419setMumpsIcntl(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_418setMumpsIcntl, "Mat.setMumpsIcntl(self, icntl: int, ival: int) -> None\nSet a MUMPS parameter, ``ICNTL[icntl] = ival``.\n\n Logically collective.\n\n Parameters\n ----------\n icntl\n The index of the MUMPS parameter array.\n ival\n The value to set.\n\n See Also\n --------\n petsc_options, petsc.MatMumpsSetIcntl\n\n \nSource code at petsc4py/PETSc/Mat.pyx:4897"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_419setMumpsIcntl(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_icntl = 0; PyObject *__pyx_v_ival = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setMumpsIcntl (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_icntl,&__pyx_n_s_ival,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_icntl)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4897, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ival)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4897, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setMumpsIcntl", 1, 2, 2, 1); __PYX_ERR(46, 4897, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setMumpsIcntl") < 0)) __PYX_ERR(46, 4897, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_icntl = values[0]; __pyx_v_ival = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setMumpsIcntl", 1, 2, 2, __pyx_nargs); __PYX_ERR(46, 4897, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.setMumpsIcntl", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_418setMumpsIcntl(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_icntl, __pyx_v_ival); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_418setMumpsIcntl(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_icntl, PyObject *__pyx_v_ival) { PetscInt __pyx_v__icntl; PetscInt __pyx_v__ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setMumpsIcntl", 1); /* "petsc4py/PETSc/Mat.pyx":4914 * * """ * cdef PetscInt _icntl = asInt(icntl) # <<<<<<<<<<<<<< * cdef PetscInt _ival = asInt(ival) * CHKERR( MatMumpsSetIcntl(self.mat, _icntl, _ival) ); */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_icntl); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(46, 4914, __pyx_L1_error) __pyx_v__icntl = __pyx_t_1; /* "petsc4py/PETSc/Mat.pyx":4915 * """ * cdef PetscInt _icntl = asInt(icntl) * cdef PetscInt _ival = asInt(ival) # <<<<<<<<<<<<<< * CHKERR( MatMumpsSetIcntl(self.mat, _icntl, _ival) ); * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_ival); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(46, 4915, __pyx_L1_error) __pyx_v__ival = __pyx_t_1; /* "petsc4py/PETSc/Mat.pyx":4916 * cdef PetscInt _icntl = asInt(icntl) * cdef PetscInt _ival = asInt(ival) * CHKERR( MatMumpsSetIcntl(self.mat, _icntl, _ival) ); # <<<<<<<<<<<<<< * * def getMumpsIcntl(self, icntl: int) -> int: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatMumpsSetIcntl(__pyx_v_self->mat, __pyx_v__icntl, __pyx_v__ival)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 4916, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":4897 * # MUMPS * * def setMumpsIcntl(self, icntl: int, ival: int) -> None: # <<<<<<<<<<<<<< * """Set a MUMPS parameter, ``ICNTL[icntl] = ival``. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setMumpsIcntl", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":4918 * CHKERR( MatMumpsSetIcntl(self.mat, _icntl, _ival) ); * * def getMumpsIcntl(self, icntl: int) -> int: # <<<<<<<<<<<<<< * """Return the MUMPS parameter, ``ICNTL[icntl]``. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_421getMumpsIcntl(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_420getMumpsIcntl, "Mat.getMumpsIcntl(self, icntl: int) -> int\nReturn the MUMPS parameter, ``ICNTL[icntl]``.\n\n Logically collective.\n\n See Also\n --------\n petsc_options, petsc.MatMumpsGetIcntl\n\n \nSource code at petsc4py/PETSc/Mat.pyx:4918"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_421getMumpsIcntl(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_icntl = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getMumpsIcntl (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_icntl,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_icntl)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4918, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getMumpsIcntl") < 0)) __PYX_ERR(46, 4918, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_icntl = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getMumpsIcntl", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 4918, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.getMumpsIcntl", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_420getMumpsIcntl(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_icntl); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_420getMumpsIcntl(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_icntl) { PetscInt __pyx_v__icntl; PetscInt __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getMumpsIcntl", 1); /* "petsc4py/PETSc/Mat.pyx":4928 * * """ * cdef PetscInt _icntl = asInt(icntl) # <<<<<<<<<<<<<< * cdef PetscInt ival = 0 * CHKERR( MatMumpsGetIcntl(self.mat, _icntl, &ival) ); */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_icntl); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(46, 4928, __pyx_L1_error) __pyx_v__icntl = __pyx_t_1; /* "petsc4py/PETSc/Mat.pyx":4929 * """ * cdef PetscInt _icntl = asInt(icntl) * cdef PetscInt ival = 0 # <<<<<<<<<<<<<< * CHKERR( MatMumpsGetIcntl(self.mat, _icntl, &ival) ); * return toInt(ival) */ __pyx_v_ival = 0; /* "petsc4py/PETSc/Mat.pyx":4930 * cdef PetscInt _icntl = asInt(icntl) * cdef PetscInt ival = 0 * CHKERR( MatMumpsGetIcntl(self.mat, _icntl, &ival) ); # <<<<<<<<<<<<<< * return toInt(ival) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatMumpsGetIcntl(__pyx_v_self->mat, __pyx_v__icntl, (&__pyx_v_ival))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 4930, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":4931 * cdef PetscInt ival = 0 * CHKERR( MatMumpsGetIcntl(self.mat, _icntl, &ival) ); * return toInt(ival) # <<<<<<<<<<<<<< * * def setMumpsCntl(self, icntl: int, val: float): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ival); if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 4931, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":4918 * CHKERR( MatMumpsSetIcntl(self.mat, _icntl, _ival) ); * * def getMumpsIcntl(self, icntl: int) -> int: # <<<<<<<<<<<<<< * """Return the MUMPS parameter, ``ICNTL[icntl]``. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getMumpsIcntl", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":4933 * return toInt(ival) * * def setMumpsCntl(self, icntl: int, val: float): # <<<<<<<<<<<<<< * """Set a MUMPS parameter, ``CNTL[icntl] = val``. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_423setMumpsCntl(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_422setMumpsCntl, "Mat.setMumpsCntl(self, icntl: int, val: float)\nSet a MUMPS parameter, ``CNTL[icntl] = val``.\n\n Logically collective.\n\n Parameters\n ----------\n icntl\n The index of the MUMPS parameter array.\n val\n The value to set.\n\n See Also\n --------\n petsc_options, petsc.MatMumpsSetCntl\n\n \nSource code at petsc4py/PETSc/Mat.pyx:4933"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_423setMumpsCntl(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_icntl = 0; PyObject *__pyx_v_val = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setMumpsCntl (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_icntl,&__pyx_n_s_val,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_icntl)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4933, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_val)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4933, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setMumpsCntl", 1, 2, 2, 1); __PYX_ERR(46, 4933, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setMumpsCntl") < 0)) __PYX_ERR(46, 4933, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_icntl = values[0]; __pyx_v_val = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setMumpsCntl", 1, 2, 2, __pyx_nargs); __PYX_ERR(46, 4933, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.setMumpsCntl", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_422setMumpsCntl(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_icntl, __pyx_v_val); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_422setMumpsCntl(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_icntl, PyObject *__pyx_v_val) { PetscInt __pyx_v__icntl; PetscReal __pyx_v__val; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscReal __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setMumpsCntl", 1); /* "petsc4py/PETSc/Mat.pyx":4950 * * """ * cdef PetscInt _icntl = asInt(icntl) # <<<<<<<<<<<<<< * cdef PetscReal _val = asReal(val) * CHKERR( MatMumpsSetCntl(self.mat, _icntl, _val) ); */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_icntl); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(46, 4950, __pyx_L1_error) __pyx_v__icntl = __pyx_t_1; /* "petsc4py/PETSc/Mat.pyx":4951 * """ * cdef PetscInt _icntl = asInt(icntl) * cdef PetscReal _val = asReal(val) # <<<<<<<<<<<<<< * CHKERR( MatMumpsSetCntl(self.mat, _icntl, _val) ); * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_val); if (unlikely(__pyx_t_2 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(46, 4951, __pyx_L1_error) __pyx_v__val = __pyx_t_2; /* "petsc4py/PETSc/Mat.pyx":4952 * cdef PetscInt _icntl = asInt(icntl) * cdef PetscReal _val = asReal(val) * CHKERR( MatMumpsSetCntl(self.mat, _icntl, _val) ); # <<<<<<<<<<<<<< * * def getMumpsCntl(self, icntl: int) -> float: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatMumpsSetCntl(__pyx_v_self->mat, __pyx_v__icntl, __pyx_v__val)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 4952, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":4933 * return toInt(ival) * * def setMumpsCntl(self, icntl: int, val: float): # <<<<<<<<<<<<<< * """Set a MUMPS parameter, ``CNTL[icntl] = val``. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setMumpsCntl", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":4954 * CHKERR( MatMumpsSetCntl(self.mat, _icntl, _val) ); * * def getMumpsCntl(self, icntl: int) -> float: # <<<<<<<<<<<<<< * """Return the MUMPS parameter, ``CNTL[icntl]``. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_425getMumpsCntl(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_424getMumpsCntl, "Mat.getMumpsCntl(self, icntl: int) -> float\nReturn the MUMPS parameter, ``CNTL[icntl]``.\n\n Logically collective.\n\n See Also\n --------\n petsc_options, petsc.MatMumpsGetCntl\n\n \nSource code at petsc4py/PETSc/Mat.pyx:4954"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_425getMumpsCntl(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_icntl = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getMumpsCntl (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_icntl,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_icntl)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4954, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getMumpsCntl") < 0)) __PYX_ERR(46, 4954, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_icntl = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getMumpsCntl", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 4954, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.getMumpsCntl", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_424getMumpsCntl(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_icntl); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_424getMumpsCntl(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_icntl) { PetscInt __pyx_v__icntl; PetscReal __pyx_v_val; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getMumpsCntl", 1); /* "petsc4py/PETSc/Mat.pyx":4964 * * """ * cdef PetscInt _icntl = asInt(icntl) # <<<<<<<<<<<<<< * cdef PetscReal val = 0 * CHKERR( MatMumpsGetCntl(self.mat, _icntl, &val) ); */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_icntl); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(46, 4964, __pyx_L1_error) __pyx_v__icntl = __pyx_t_1; /* "petsc4py/PETSc/Mat.pyx":4965 * """ * cdef PetscInt _icntl = asInt(icntl) * cdef PetscReal val = 0 # <<<<<<<<<<<<<< * CHKERR( MatMumpsGetCntl(self.mat, _icntl, &val) ); * return toReal(val) */ __pyx_v_val = 0.0; /* "petsc4py/PETSc/Mat.pyx":4966 * cdef PetscInt _icntl = asInt(icntl) * cdef PetscReal val = 0 * CHKERR( MatMumpsGetCntl(self.mat, _icntl, &val) ); # <<<<<<<<<<<<<< * return toReal(val) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatMumpsGetCntl(__pyx_v_self->mat, __pyx_v__icntl, (&__pyx_v_val))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 4966, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":4967 * cdef PetscReal val = 0 * CHKERR( MatMumpsGetCntl(self.mat, _icntl, &val) ); * return toReal(val) # <<<<<<<<<<<<<< * * def getMumpsInfo(self, icntl: int) -> int: */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_val); if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 4967, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":4954 * CHKERR( MatMumpsSetCntl(self.mat, _icntl, _val) ); * * def getMumpsCntl(self, icntl: int) -> float: # <<<<<<<<<<<<<< * """Return the MUMPS parameter, ``CNTL[icntl]``. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getMumpsCntl", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":4969 * return toReal(val) * * def getMumpsInfo(self, icntl: int) -> int: # <<<<<<<<<<<<<< * """Return the MUMPS parameter, ``INFO[icntl]``. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_427getMumpsInfo(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_426getMumpsInfo, "Mat.getMumpsInfo(self, icntl: int) -> int\nReturn the MUMPS parameter, ``INFO[icntl]``.\n\n Logically collective.\n\n Parameters\n ----------\n icntl\n The index of the MUMPS INFO array.\n\n See Also\n --------\n petsc.MatMumpsGetInfo\n\n \nSource code at petsc4py/PETSc/Mat.pyx:4969"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_427getMumpsInfo(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_icntl = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getMumpsInfo (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_icntl,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_icntl)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4969, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getMumpsInfo") < 0)) __PYX_ERR(46, 4969, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_icntl = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getMumpsInfo", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 4969, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.getMumpsInfo", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_426getMumpsInfo(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_icntl); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_426getMumpsInfo(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_icntl) { PetscInt __pyx_v__icntl; PetscInt __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getMumpsInfo", 1); /* "petsc4py/PETSc/Mat.pyx":4984 * * """ * cdef PetscInt _icntl = asInt(icntl) # <<<<<<<<<<<<<< * cdef PetscInt ival = 0 * CHKERR( MatMumpsGetInfo(self.mat, _icntl, &ival) ); */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_icntl); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(46, 4984, __pyx_L1_error) __pyx_v__icntl = __pyx_t_1; /* "petsc4py/PETSc/Mat.pyx":4985 * """ * cdef PetscInt _icntl = asInt(icntl) * cdef PetscInt ival = 0 # <<<<<<<<<<<<<< * CHKERR( MatMumpsGetInfo(self.mat, _icntl, &ival) ); * return toInt(ival) */ __pyx_v_ival = 0; /* "petsc4py/PETSc/Mat.pyx":4986 * cdef PetscInt _icntl = asInt(icntl) * cdef PetscInt ival = 0 * CHKERR( MatMumpsGetInfo(self.mat, _icntl, &ival) ); # <<<<<<<<<<<<<< * return toInt(ival) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatMumpsGetInfo(__pyx_v_self->mat, __pyx_v__icntl, (&__pyx_v_ival))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 4986, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":4987 * cdef PetscInt ival = 0 * CHKERR( MatMumpsGetInfo(self.mat, _icntl, &ival) ); * return toInt(ival) # <<<<<<<<<<<<<< * * def getMumpsInfog(self, icntl: int) -> int: */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ival); if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 4987, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":4969 * return toReal(val) * * def getMumpsInfo(self, icntl: int) -> int: # <<<<<<<<<<<<<< * """Return the MUMPS parameter, ``INFO[icntl]``. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getMumpsInfo", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":4989 * return toInt(ival) * * def getMumpsInfog(self, icntl: int) -> int: # <<<<<<<<<<<<<< * """Return the MUMPS parameter, ``INFOG[icntl]``. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_429getMumpsInfog(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_428getMumpsInfog, "Mat.getMumpsInfog(self, icntl: int) -> int\nReturn the MUMPS parameter, ``INFOG[icntl]``.\n\n Logically collective.\n\n Parameters\n ----------\n icntl\n The index of the MUMPS INFOG array.\n\n See Also\n --------\n petsc.MatMumpsGetInfog\n\n \nSource code at petsc4py/PETSc/Mat.pyx:4989"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_429getMumpsInfog(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_icntl = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getMumpsInfog (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_icntl,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_icntl)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4989, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getMumpsInfog") < 0)) __PYX_ERR(46, 4989, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_icntl = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getMumpsInfog", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 4989, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.getMumpsInfog", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_428getMumpsInfog(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_icntl); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_428getMumpsInfog(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_icntl) { PetscInt __pyx_v__icntl; PetscInt __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getMumpsInfog", 1); /* "petsc4py/PETSc/Mat.pyx":5004 * * """ * cdef PetscInt _icntl = asInt(icntl) # <<<<<<<<<<<<<< * cdef PetscInt ival = 0 * CHKERR( MatMumpsGetInfog(self.mat, _icntl, &ival) ); */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_icntl); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(46, 5004, __pyx_L1_error) __pyx_v__icntl = __pyx_t_1; /* "petsc4py/PETSc/Mat.pyx":5005 * """ * cdef PetscInt _icntl = asInt(icntl) * cdef PetscInt ival = 0 # <<<<<<<<<<<<<< * CHKERR( MatMumpsGetInfog(self.mat, _icntl, &ival) ); * return toInt(ival) */ __pyx_v_ival = 0; /* "petsc4py/PETSc/Mat.pyx":5006 * cdef PetscInt _icntl = asInt(icntl) * cdef PetscInt ival = 0 * CHKERR( MatMumpsGetInfog(self.mat, _icntl, &ival) ); # <<<<<<<<<<<<<< * return toInt(ival) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatMumpsGetInfog(__pyx_v_self->mat, __pyx_v__icntl, (&__pyx_v_ival))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5006, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":5007 * cdef PetscInt ival = 0 * CHKERR( MatMumpsGetInfog(self.mat, _icntl, &ival) ); * return toInt(ival) # <<<<<<<<<<<<<< * * def getMumpsRinfo(self, icntl: int) -> float: */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ival); if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 5007, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":4989 * return toInt(ival) * * def getMumpsInfog(self, icntl: int) -> int: # <<<<<<<<<<<<<< * """Return the MUMPS parameter, ``INFOG[icntl]``. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getMumpsInfog", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":5009 * return toInt(ival) * * def getMumpsRinfo(self, icntl: int) -> float: # <<<<<<<<<<<<<< * """Return the MUMPS parameter, ``RINFO[icntl]``. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_431getMumpsRinfo(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_430getMumpsRinfo, "Mat.getMumpsRinfo(self, icntl: int) -> float\nReturn the MUMPS parameter, ``RINFO[icntl]``.\n\n Logically collective.\n\n Parameters\n ----------\n icntl\n The index of the MUMPS RINFO array.\n\n See Also\n --------\n petsc.MatMumpsGetRinfo\n\n \nSource code at petsc4py/PETSc/Mat.pyx:5009"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_431getMumpsRinfo(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_icntl = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getMumpsRinfo (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_icntl,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_icntl)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 5009, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getMumpsRinfo") < 0)) __PYX_ERR(46, 5009, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_icntl = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getMumpsRinfo", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 5009, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.getMumpsRinfo", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_430getMumpsRinfo(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_icntl); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_430getMumpsRinfo(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_icntl) { PetscInt __pyx_v__icntl; PetscReal __pyx_v_val; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getMumpsRinfo", 1); /* "petsc4py/PETSc/Mat.pyx":5024 * * """ * cdef PetscInt _icntl = asInt(icntl) # <<<<<<<<<<<<<< * cdef PetscReal val = 0 * CHKERR( MatMumpsGetRinfo(self.mat, _icntl, &val) ); */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_icntl); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(46, 5024, __pyx_L1_error) __pyx_v__icntl = __pyx_t_1; /* "petsc4py/PETSc/Mat.pyx":5025 * """ * cdef PetscInt _icntl = asInt(icntl) * cdef PetscReal val = 0 # <<<<<<<<<<<<<< * CHKERR( MatMumpsGetRinfo(self.mat, _icntl, &val) ); * return toReal(val) */ __pyx_v_val = 0.0; /* "petsc4py/PETSc/Mat.pyx":5026 * cdef PetscInt _icntl = asInt(icntl) * cdef PetscReal val = 0 * CHKERR( MatMumpsGetRinfo(self.mat, _icntl, &val) ); # <<<<<<<<<<<<<< * return toReal(val) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatMumpsGetRinfo(__pyx_v_self->mat, __pyx_v__icntl, (&__pyx_v_val))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5026, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":5027 * cdef PetscReal val = 0 * CHKERR( MatMumpsGetRinfo(self.mat, _icntl, &val) ); * return toReal(val) # <<<<<<<<<<<<<< * * def getMumpsRinfog(self, icntl: int) -> float: */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_val); if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 5027, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":5009 * return toInt(ival) * * def getMumpsRinfo(self, icntl: int) -> float: # <<<<<<<<<<<<<< * """Return the MUMPS parameter, ``RINFO[icntl]``. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getMumpsRinfo", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":5029 * return toReal(val) * * def getMumpsRinfog(self, icntl: int) -> float: # <<<<<<<<<<<<<< * """Return the MUMPS parameter, ``RINFOG[icntl]``. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_433getMumpsRinfog(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_432getMumpsRinfog, "Mat.getMumpsRinfog(self, icntl: int) -> float\nReturn the MUMPS parameter, ``RINFOG[icntl]``.\n\n Logically collective.\n\n Parameters\n ----------\n icntl\n The index of the MUMPS RINFOG array.\n\n See Also\n --------\n petsc.MatMumpsGetRinfog\n\n \nSource code at petsc4py/PETSc/Mat.pyx:5029"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_433getMumpsRinfog(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_icntl = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getMumpsRinfog (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_icntl,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_icntl)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 5029, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getMumpsRinfog") < 0)) __PYX_ERR(46, 5029, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_icntl = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getMumpsRinfog", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 5029, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.getMumpsRinfog", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_432getMumpsRinfog(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_icntl); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_432getMumpsRinfog(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_icntl) { PetscInt __pyx_v__icntl; PetscReal __pyx_v_val; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getMumpsRinfog", 1); /* "petsc4py/PETSc/Mat.pyx":5044 * * """ * cdef PetscInt _icntl = asInt(icntl) # <<<<<<<<<<<<<< * cdef PetscReal val = 0 * CHKERR( MatMumpsGetRinfog(self.mat, _icntl, &val) ); */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_icntl); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(46, 5044, __pyx_L1_error) __pyx_v__icntl = __pyx_t_1; /* "petsc4py/PETSc/Mat.pyx":5045 * """ * cdef PetscInt _icntl = asInt(icntl) * cdef PetscReal val = 0 # <<<<<<<<<<<<<< * CHKERR( MatMumpsGetRinfog(self.mat, _icntl, &val) ); * return toReal(val) */ __pyx_v_val = 0.0; /* "petsc4py/PETSc/Mat.pyx":5046 * cdef PetscInt _icntl = asInt(icntl) * cdef PetscReal val = 0 * CHKERR( MatMumpsGetRinfog(self.mat, _icntl, &val) ); # <<<<<<<<<<<<<< * return toReal(val) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatMumpsGetRinfog(__pyx_v_self->mat, __pyx_v__icntl, (&__pyx_v_val))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5046, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":5047 * cdef PetscReal val = 0 * CHKERR( MatMumpsGetRinfog(self.mat, _icntl, &val) ); * return toReal(val) # <<<<<<<<<<<<<< * * # solve */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_val); if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 5047, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":5029 * return toReal(val) * * def getMumpsRinfog(self, icntl: int) -> float: # <<<<<<<<<<<<<< * """Return the MUMPS parameter, ``RINFOG[icntl]``. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getMumpsRinfog", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":5051 * # solve * * def solveForward(self, Vec b, Vec x) -> None: # <<<<<<<<<<<<<< * """Solve Lx = b, given a factored matrix A = LU. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_435solveForward(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_434solveForward, "Mat.solveForward(self, b: Vec, x: Vec) -> None\nSolve Lx = b, given a factored matrix A = LU.\n\n Neighborwise collective.\n\n Parameters\n ----------\n b\n The right-hand side vector.\n x\n The output solution vector.\n\n See Also\n --------\n petsc.MatForwardSolve\n\n \nSource code at petsc4py/PETSc/Mat.pyx:5051"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_435solveForward(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_b = 0; struct PyPetscVecObject *__pyx_v_x = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("solveForward (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_b,&__pyx_n_s_x,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_b)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 5051, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 5051, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("solveForward", 1, 2, 2, 1); __PYX_ERR(46, 5051, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "solveForward") < 0)) __PYX_ERR(46, 5051, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_b = ((struct PyPetscVecObject *)values[0]); __pyx_v_x = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("solveForward", 1, 2, 2, __pyx_nargs); __PYX_ERR(46, 5051, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.solveForward", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "b", 0))) __PYX_ERR(46, 5051, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(46, 5051, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_434solveForward(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_b, __pyx_v_x); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_434solveForward(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_b, struct PyPetscVecObject *__pyx_v_x) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("solveForward", 1); /* "petsc4py/PETSc/Mat.pyx":5068 * * """ * CHKERR( MatForwardSolve(self.mat, b.vec, x.vec) ) # <<<<<<<<<<<<<< * * def solveBackward(self, Vec b, Vec x) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatForwardSolve(__pyx_v_self->mat, __pyx_v_b->vec, __pyx_v_x->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5068, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":5051 * # solve * * def solveForward(self, Vec b, Vec x) -> None: # <<<<<<<<<<<<<< * """Solve Lx = b, given a factored matrix A = LU. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.solveForward", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":5070 * CHKERR( MatForwardSolve(self.mat, b.vec, x.vec) ) * * def solveBackward(self, Vec b, Vec x) -> None: # <<<<<<<<<<<<<< * """Solve Ux=b, given a factored matrix A=LU. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_437solveBackward(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_436solveBackward, "Mat.solveBackward(self, b: Vec, x: Vec) -> None\nSolve Ux=b, given a factored matrix A=LU.\n\n Neighborwise collective.\n\n Parameters\n ----------\n b\n The right-hand side vector.\n x\n The output solution vector.\n\n See Also\n --------\n petsc.MatBackwardSolve\n\n \nSource code at petsc4py/PETSc/Mat.pyx:5070"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_437solveBackward(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_b = 0; struct PyPetscVecObject *__pyx_v_x = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("solveBackward (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_b,&__pyx_n_s_x,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_b)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 5070, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 5070, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("solveBackward", 1, 2, 2, 1); __PYX_ERR(46, 5070, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "solveBackward") < 0)) __PYX_ERR(46, 5070, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_b = ((struct PyPetscVecObject *)values[0]); __pyx_v_x = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("solveBackward", 1, 2, 2, __pyx_nargs); __PYX_ERR(46, 5070, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.solveBackward", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "b", 0))) __PYX_ERR(46, 5070, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(46, 5070, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_436solveBackward(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_b, __pyx_v_x); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_436solveBackward(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_b, struct PyPetscVecObject *__pyx_v_x) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("solveBackward", 1); /* "petsc4py/PETSc/Mat.pyx":5087 * * """ * CHKERR( MatBackwardSolve(self.mat, b.vec, x.vec) ) # <<<<<<<<<<<<<< * * def solve(self, Vec b, Vec x) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatBackwardSolve(__pyx_v_self->mat, __pyx_v_b->vec, __pyx_v_x->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5087, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":5070 * CHKERR( MatForwardSolve(self.mat, b.vec, x.vec) ) * * def solveBackward(self, Vec b, Vec x) -> None: # <<<<<<<<<<<<<< * """Solve Ux=b, given a factored matrix A=LU. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.solveBackward", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":5089 * CHKERR( MatBackwardSolve(self.mat, b.vec, x.vec) ) * * def solve(self, Vec b, Vec x) -> None: # <<<<<<<<<<<<<< * """Solve Ax=b, given a factored matrix. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_439solve(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_438solve, "Mat.solve(self, b: Vec, x: Vec) -> None\nSolve Ax=b, given a factored matrix.\n\n Neighborwise collective.\n\n The vectors ``b`` and ``x`` cannot be the same.\n Most users should employ the `KSP` interface for linear solvers instead\n of working directly with matrix algebra routines.\n\n Parameters\n ----------\n b\n The right-hand side vector.\n x\n The output solution vector, must be different than ``b``.\n\n See Also\n --------\n KSP.create, solveTranspose, petsc.MatSolve\n\n \nSource code at petsc4py/PETSc/Mat.pyx:5089"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_439solve(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_b = 0; struct PyPetscVecObject *__pyx_v_x = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("solve (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_b,&__pyx_n_s_x,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_b)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 5089, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 5089, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("solve", 1, 2, 2, 1); __PYX_ERR(46, 5089, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "solve") < 0)) __PYX_ERR(46, 5089, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_b = ((struct PyPetscVecObject *)values[0]); __pyx_v_x = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("solve", 1, 2, 2, __pyx_nargs); __PYX_ERR(46, 5089, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.solve", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "b", 0))) __PYX_ERR(46, 5089, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(46, 5089, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_438solve(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_b, __pyx_v_x); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_438solve(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_b, struct PyPetscVecObject *__pyx_v_x) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("solve", 1); /* "petsc4py/PETSc/Mat.pyx":5110 * * """ * CHKERR(MatSolve(self.mat, b.vec, x.vec) ) # <<<<<<<<<<<<<< * * def solveTranspose(self, Vec b, Vec x) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSolve(__pyx_v_self->mat, __pyx_v_b->vec, __pyx_v_x->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5110, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":5089 * CHKERR( MatBackwardSolve(self.mat, b.vec, x.vec) ) * * def solve(self, Vec b, Vec x) -> None: # <<<<<<<<<<<<<< * """Solve Ax=b, given a factored matrix. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.solve", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":5112 * CHKERR(MatSolve(self.mat, b.vec, x.vec) ) * * def solveTranspose(self, Vec b, Vec x) -> None: # <<<<<<<<<<<<<< * """Solve Ax=b, given a factored matrix. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_441solveTranspose(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_440solveTranspose, "Mat.solveTranspose(self, b: Vec, x: Vec) -> None\nSolve A\341\265\200x=b, given a factored matrix.\n\n Neighborwise collective.\n\n The vectors ``b`` and ``x`` cannot be the same.\n\n Parameters\n ----------\n b\n The right-hand side vector.\n x\n The output solution vector, must be different than ``b``.\n\n See Also\n --------\n KSP.create, petsc.MatSolve, petsc.MatSolveTranspose\n\n \nSource code at petsc4py/PETSc/Mat.pyx:5112"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_441solveTranspose(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_b = 0; struct PyPetscVecObject *__pyx_v_x = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("solveTranspose (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_b,&__pyx_n_s_x,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_b)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 5112, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 5112, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("solveTranspose", 1, 2, 2, 1); __PYX_ERR(46, 5112, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "solveTranspose") < 0)) __PYX_ERR(46, 5112, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_b = ((struct PyPetscVecObject *)values[0]); __pyx_v_x = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("solveTranspose", 1, 2, 2, __pyx_nargs); __PYX_ERR(46, 5112, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.solveTranspose", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "b", 0))) __PYX_ERR(46, 5112, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(46, 5112, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_440solveTranspose(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_b, __pyx_v_x); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_440solveTranspose(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_b, struct PyPetscVecObject *__pyx_v_x) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("solveTranspose", 1); /* "petsc4py/PETSc/Mat.pyx":5131 * * """ * CHKERR( MatSolveTranspose(self.mat, b.vec, x.vec) ) # <<<<<<<<<<<<<< * * def solveAdd(self, Vec b, Vec y, Vec x) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSolveTranspose(__pyx_v_self->mat, __pyx_v_b->vec, __pyx_v_x->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5131, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":5112 * CHKERR(MatSolve(self.mat, b.vec, x.vec) ) * * def solveTranspose(self, Vec b, Vec x) -> None: # <<<<<<<<<<<<<< * """Solve Ax=b, given a factored matrix. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.solveTranspose", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":5133 * CHKERR( MatSolveTranspose(self.mat, b.vec, x.vec) ) * * def solveAdd(self, Vec b, Vec y, Vec x) -> None: # <<<<<<<<<<<<<< * """Solve x=y+Ab, given a factored matrix. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_443solveAdd(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_442solveAdd, "Mat.solveAdd(self, b: Vec, y: Vec, x: Vec) -> None\nSolve x=y+A\342\201\273\302\271b, given a factored matrix.\n\n Neighborwise collective.\n\n The vectors ``b`` and ``x`` cannot be the same.\n\n Parameters\n ----------\n b\n The right-hand side vector.\n y\n The vector to be added\n x\n The output solution vector, must be different than ``b``.\n\n See Also\n --------\n KSP.create, petsc.MatSolve, petsc.MatSolveAdd\n\n \nSource code at petsc4py/PETSc/Mat.pyx:5133"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_443solveAdd(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_b = 0; struct PyPetscVecObject *__pyx_v_y = 0; struct PyPetscVecObject *__pyx_v_x = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("solveAdd (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_b,&__pyx_n_s_y,&__pyx_n_s_x,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_b)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 5133, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 5133, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("solveAdd", 1, 3, 3, 1); __PYX_ERR(46, 5133, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 5133, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("solveAdd", 1, 3, 3, 2); __PYX_ERR(46, 5133, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "solveAdd") < 0)) __PYX_ERR(46, 5133, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_b = ((struct PyPetscVecObject *)values[0]); __pyx_v_y = ((struct PyPetscVecObject *)values[1]); __pyx_v_x = ((struct PyPetscVecObject *)values[2]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("solveAdd", 1, 3, 3, __pyx_nargs); __PYX_ERR(46, 5133, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.solveAdd", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "b", 0))) __PYX_ERR(46, 5133, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(46, 5133, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(46, 5133, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_442solveAdd(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_b, __pyx_v_y, __pyx_v_x); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_442solveAdd(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_b, struct PyPetscVecObject *__pyx_v_y, struct PyPetscVecObject *__pyx_v_x) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("solveAdd", 1); /* "petsc4py/PETSc/Mat.pyx":5154 * * """ * CHKERR( MatSolveAdd(self.mat, b.vec, y.vec, x.vec) ) # <<<<<<<<<<<<<< * * def solveTransposeAdd(self, Vec b, Vec y, Vec x) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSolveAdd(__pyx_v_self->mat, __pyx_v_b->vec, __pyx_v_y->vec, __pyx_v_x->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5154, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":5133 * CHKERR( MatSolveTranspose(self.mat, b.vec, x.vec) ) * * def solveAdd(self, Vec b, Vec y, Vec x) -> None: # <<<<<<<<<<<<<< * """Solve x=y+Ab, given a factored matrix. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.solveAdd", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":5156 * CHKERR( MatSolveAdd(self.mat, b.vec, y.vec, x.vec) ) * * def solveTransposeAdd(self, Vec b, Vec y, Vec x) -> None: # <<<<<<<<<<<<<< * """Solve x=y+Ab, given a factored matrix. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_445solveTransposeAdd(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_444solveTransposeAdd, "Mat.solveTransposeAdd(self, b: Vec, y: Vec, x: Vec) -> None\nSolve x=y+A\342\201\273\341\265\200b, given a factored matrix.\n\n Neighborwise collective.\n\n The vectors ``b`` and ``x`` cannot be the same.\n\n Parameters\n ----------\n b\n The right-hand side vector.\n y\n The vector to be added\n x\n The output solution vector, must be different than ``b``.\n\n See Also\n --------\n KSP.create, petsc.MatSolve, petsc.MatSolveTransposeAdd\n\n \nSource code at petsc4py/PETSc/Mat.pyx:5156"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_445solveTransposeAdd(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_b = 0; struct PyPetscVecObject *__pyx_v_y = 0; struct PyPetscVecObject *__pyx_v_x = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("solveTransposeAdd (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_b,&__pyx_n_s_y,&__pyx_n_s_x,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_b)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 5156, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 5156, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("solveTransposeAdd", 1, 3, 3, 1); __PYX_ERR(46, 5156, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 5156, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("solveTransposeAdd", 1, 3, 3, 2); __PYX_ERR(46, 5156, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "solveTransposeAdd") < 0)) __PYX_ERR(46, 5156, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_b = ((struct PyPetscVecObject *)values[0]); __pyx_v_y = ((struct PyPetscVecObject *)values[1]); __pyx_v_x = ((struct PyPetscVecObject *)values[2]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("solveTransposeAdd", 1, 3, 3, __pyx_nargs); __PYX_ERR(46, 5156, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.solveTransposeAdd", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "b", 0))) __PYX_ERR(46, 5156, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(46, 5156, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(46, 5156, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_444solveTransposeAdd(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_b, __pyx_v_y, __pyx_v_x); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_444solveTransposeAdd(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_b, struct PyPetscVecObject *__pyx_v_y, struct PyPetscVecObject *__pyx_v_x) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("solveTransposeAdd", 1); /* "petsc4py/PETSc/Mat.pyx":5177 * * """ * CHKERR( MatSolveTransposeAdd(self.mat, b.vec, y.vec, x.vec) ) # <<<<<<<<<<<<<< * * def matSolve(self, Mat B, Mat X) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSolveTransposeAdd(__pyx_v_self->mat, __pyx_v_b->vec, __pyx_v_y->vec, __pyx_v_x->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5177, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":5156 * CHKERR( MatSolveAdd(self.mat, b.vec, y.vec, x.vec) ) * * def solveTransposeAdd(self, Vec b, Vec y, Vec x) -> None: # <<<<<<<<<<<<<< * """Solve x=y+Ab, given a factored matrix. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.solveTransposeAdd", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":5179 * CHKERR( MatSolveTransposeAdd(self.mat, b.vec, y.vec, x.vec) ) * * def matSolve(self, Mat B, Mat X) -> None: # <<<<<<<<<<<<<< * """Solve AX=B, given a factored matrix A. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_447matSolve(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_446matSolve, "Mat.matSolve(self, B: Mat, X: Mat) -> None\nSolve AX=B, given a factored matrix A.\n\n Neighborwise collective.\n\n Parameters\n ----------\n B\n The right-hand side matrix of type `Type.DENSE`. Can be of type\n `Type.AIJ` if using MUMPS.\n X\n The output solution matrix, must be different than ``B``.\n\n See Also\n --------\n KSP.create, petsc.MatMatSolve\n\n \nSource code at petsc4py/PETSc/Mat.pyx:5179"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_447matSolve(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscMatObject *__pyx_v_B = 0; struct PyPetscMatObject *__pyx_v_X = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("matSolve (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_B,&__pyx_n_s_X,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_B)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 5179, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_X)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 5179, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("matSolve", 1, 2, 2, 1); __PYX_ERR(46, 5179, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "matSolve") < 0)) __PYX_ERR(46, 5179, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_B = ((struct PyPetscMatObject *)values[0]); __pyx_v_X = ((struct PyPetscMatObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("matSolve", 1, 2, 2, __pyx_nargs); __PYX_ERR(46, 5179, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.matSolve", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_B), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "B", 0))) __PYX_ERR(46, 5179, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_X), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "X", 0))) __PYX_ERR(46, 5179, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_446matSolve(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_B, __pyx_v_X); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_446matSolve(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_B, struct PyPetscMatObject *__pyx_v_X) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("matSolve", 1); /* "petsc4py/PETSc/Mat.pyx":5197 * * """ * CHKERR( MatMatSolve(self.mat, B.mat, X.mat) ) # <<<<<<<<<<<<<< * * # dense matrices */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatMatSolve(__pyx_v_self->mat, __pyx_v_B->mat, __pyx_v_X->mat)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5197, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":5179 * CHKERR( MatSolveTransposeAdd(self.mat, b.vec, y.vec, x.vec) ) * * def matSolve(self, Mat B, Mat X) -> None: # <<<<<<<<<<<<<< * """Solve AX=B, given a factored matrix A. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.matSolve", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":5201 * # dense matrices * * def setDenseLDA(self, lda: int) -> None: # <<<<<<<<<<<<<< * """Set the leading dimension of the array used by the dense matrix. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_449setDenseLDA(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_448setDenseLDA, "Mat.setDenseLDA(self, lda: int) -> None\nSet the leading dimension of the array used by the dense matrix.\n\n Not collective.\n\n Parameters\n ----------\n lda\n The leading dimension.\n\n See Also\n --------\n petsc.MatDenseSetLDA\n\n \nSource code at petsc4py/PETSc/Mat.pyx:5201"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_449setDenseLDA(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_lda = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setDenseLDA (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_lda,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_lda)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 5201, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setDenseLDA") < 0)) __PYX_ERR(46, 5201, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_lda = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setDenseLDA", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 5201, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.setDenseLDA", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_448setDenseLDA(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_lda); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_448setDenseLDA(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_lda) { PetscInt __pyx_v__ilda; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setDenseLDA", 1); /* "petsc4py/PETSc/Mat.pyx":5216 * * """ * cdef PetscInt _ilda = asInt(lda) # <<<<<<<<<<<<<< * CHKERR( MatDenseSetLDA(self.mat, _ilda) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_lda); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(46, 5216, __pyx_L1_error) __pyx_v__ilda = __pyx_t_1; /* "petsc4py/PETSc/Mat.pyx":5217 * """ * cdef PetscInt _ilda = asInt(lda) * CHKERR( MatDenseSetLDA(self.mat, _ilda) ) # <<<<<<<<<<<<<< * * def getDenseLDA(self) -> int: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDenseSetLDA(__pyx_v_self->mat, __pyx_v__ilda)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5217, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":5201 * # dense matrices * * def setDenseLDA(self, lda: int) -> None: # <<<<<<<<<<<<<< * """Set the leading dimension of the array used by the dense matrix. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setDenseLDA", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":5219 * CHKERR( MatDenseSetLDA(self.mat, _ilda) ) * * def getDenseLDA(self) -> int: # <<<<<<<<<<<<<< * """Return the leading dimension of the array used by the dense matrix. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_451getDenseLDA(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_450getDenseLDA, "Mat.getDenseLDA(self) -> int\nReturn the leading dimension of the array used by the dense matrix.\n\n Not collective.\n\n See Also\n --------\n petsc.MatDenseGetLDA\n\n \nSource code at petsc4py/PETSc/Mat.pyx:5219"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_451getDenseLDA(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getDenseLDA (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getDenseLDA", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getDenseLDA", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_450getDenseLDA(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_450getDenseLDA(struct PyPetscMatObject *__pyx_v_self) { PetscInt __pyx_v_lda; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getDenseLDA", 1); /* "petsc4py/PETSc/Mat.pyx":5229 * * """ * cdef PetscInt lda=0 # <<<<<<<<<<<<<< * CHKERR( MatDenseGetLDA(self.mat, &lda) ) * return toInt(lda) */ __pyx_v_lda = 0; /* "petsc4py/PETSc/Mat.pyx":5230 * """ * cdef PetscInt lda=0 * CHKERR( MatDenseGetLDA(self.mat, &lda) ) # <<<<<<<<<<<<<< * return toInt(lda) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDenseGetLDA(__pyx_v_self->mat, (&__pyx_v_lda))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5230, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":5231 * cdef PetscInt lda=0 * CHKERR( MatDenseGetLDA(self.mat, &lda) ) * return toInt(lda) # <<<<<<<<<<<<<< * * def getDenseArray(self, readonly: bool = False) -> ArrayScalar: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_lda); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 5231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":5219 * CHKERR( MatDenseSetLDA(self.mat, _ilda) ) * * def getDenseLDA(self) -> int: # <<<<<<<<<<<<<< * """Return the leading dimension of the array used by the dense matrix. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getDenseLDA", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":5233 * return toInt(lda) * * def getDenseArray(self, readonly: bool = False) -> ArrayScalar: # <<<<<<<<<<<<<< * """Return the array where the data is stored. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_453getDenseArray(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_452getDenseArray, "Mat.getDenseArray(self, readonly: bool = False) -> ArrayScalar\nReturn the array where the data is stored.\n\n Not collective.\n\n Parameters\n ----------\n readonly\n Enable to obtain a read only array.\n\n See Also\n --------\n petsc.MatDenseGetArrayRead, petsc.MatDenseGetArray\n\n \nSource code at petsc4py/PETSc/Mat.pyx:5233"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_453getDenseArray(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_readonly = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getDenseArray (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_readonly,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_readonly); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 5233, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getDenseArray") < 0)) __PYX_ERR(46, 5233, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_readonly = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getDenseArray", 0, 0, 1, __pyx_nargs); __PYX_ERR(46, 5233, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.getDenseArray", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_452getDenseArray(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_readonly); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_452getDenseArray(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_readonly) { PetscInt __pyx_v_m; PetscInt __pyx_v_N; PetscInt __pyx_v_lda; PetscScalar *__pyx_v_data; int __pyx_v_typenum; int __pyx_v_itemsize; int __pyx_v_flags; npy_intp __pyx_v_dims[2]; npy_intp __pyx_v_strides[2]; PyObject *__pyx_v_array = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getDenseArray", 1); /* "petsc4py/PETSc/Mat.pyx":5248 * * """ * cdef PetscInt m=0, N=0, lda=0 # <<<<<<<<<<<<<< * cdef PetscScalar *data = NULL * CHKERR( MatGetLocalSize(self.mat, &m, NULL) ) */ __pyx_v_m = 0; __pyx_v_N = 0; __pyx_v_lda = 0; /* "petsc4py/PETSc/Mat.pyx":5249 * """ * cdef PetscInt m=0, N=0, lda=0 * cdef PetscScalar *data = NULL # <<<<<<<<<<<<<< * CHKERR( MatGetLocalSize(self.mat, &m, NULL) ) * CHKERR( MatGetSize(self.mat, NULL, &N) ) */ __pyx_v_data = NULL; /* "petsc4py/PETSc/Mat.pyx":5250 * cdef PetscInt m=0, N=0, lda=0 * cdef PetscScalar *data = NULL * CHKERR( MatGetLocalSize(self.mat, &m, NULL) ) # <<<<<<<<<<<<<< * CHKERR( MatGetSize(self.mat, NULL, &N) ) * CHKERR( MatDenseGetLDA(self.mat, &lda) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetLocalSize(__pyx_v_self->mat, (&__pyx_v_m), NULL)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5250, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":5251 * cdef PetscScalar *data = NULL * CHKERR( MatGetLocalSize(self.mat, &m, NULL) ) * CHKERR( MatGetSize(self.mat, NULL, &N) ) # <<<<<<<<<<<<<< * CHKERR( MatDenseGetLDA(self.mat, &lda) ) * if readonly: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetSize(__pyx_v_self->mat, NULL, (&__pyx_v_N))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5251, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":5252 * CHKERR( MatGetLocalSize(self.mat, &m, NULL) ) * CHKERR( MatGetSize(self.mat, NULL, &N) ) * CHKERR( MatDenseGetLDA(self.mat, &lda) ) # <<<<<<<<<<<<<< * if readonly: * CHKERR( MatDenseGetArrayRead(self.mat, &data) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDenseGetLDA(__pyx_v_self->mat, (&__pyx_v_lda))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5252, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":5253 * CHKERR( MatGetSize(self.mat, NULL, &N) ) * CHKERR( MatDenseGetLDA(self.mat, &lda) ) * if readonly: # <<<<<<<<<<<<<< * CHKERR( MatDenseGetArrayRead(self.mat, &data) ) * else: */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_readonly); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(46, 5253, __pyx_L1_error) if (__pyx_t_2) { /* "petsc4py/PETSc/Mat.pyx":5254 * CHKERR( MatDenseGetLDA(self.mat, &lda) ) * if readonly: * CHKERR( MatDenseGetArrayRead(self.mat, &data) ) # <<<<<<<<<<<<<< * else: * CHKERR( MatDenseGetArray(self.mat, &data) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDenseGetArrayRead(__pyx_v_self->mat, ((PetscScalar const **)(&__pyx_v_data)))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5254, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":5253 * CHKERR( MatGetSize(self.mat, NULL, &N) ) * CHKERR( MatDenseGetLDA(self.mat, &lda) ) * if readonly: # <<<<<<<<<<<<<< * CHKERR( MatDenseGetArrayRead(self.mat, &data) ) * else: */ goto __pyx_L3; } /* "petsc4py/PETSc/Mat.pyx":5256 * CHKERR( MatDenseGetArrayRead(self.mat, &data) ) * else: * CHKERR( MatDenseGetArray(self.mat, &data) ) # <<<<<<<<<<<<<< * cdef int typenum = NPY_PETSC_SCALAR * cdef int itemsize = sizeof(PetscScalar) */ /*else*/ { __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDenseGetArray(__pyx_v_self->mat, (&__pyx_v_data))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5256, __pyx_L1_error) } __pyx_L3:; /* "petsc4py/PETSc/Mat.pyx":5257 * else: * CHKERR( MatDenseGetArray(self.mat, &data) ) * cdef int typenum = NPY_PETSC_SCALAR # <<<<<<<<<<<<<< * cdef int itemsize = sizeof(PetscScalar) * cdef int flags = NPY_ARRAY_FARRAY */ __pyx_v_typenum = NPY_PETSC_SCALAR; /* "petsc4py/PETSc/Mat.pyx":5258 * CHKERR( MatDenseGetArray(self.mat, &data) ) * cdef int typenum = NPY_PETSC_SCALAR * cdef int itemsize = sizeof(PetscScalar) # <<<<<<<<<<<<<< * cdef int flags = NPY_ARRAY_FARRAY * cdef npy_intp dims[2], strides[2] */ __pyx_v_itemsize = ((int)(sizeof(PetscScalar))); /* "petsc4py/PETSc/Mat.pyx":5259 * cdef int typenum = NPY_PETSC_SCALAR * cdef int itemsize = sizeof(PetscScalar) * cdef int flags = NPY_ARRAY_FARRAY # <<<<<<<<<<<<<< * cdef npy_intp dims[2], strides[2] * dims[0] = m; strides[0] = sizeof(PetscScalar); */ __pyx_v_flags = NPY_ARRAY_FARRAY; /* "petsc4py/PETSc/Mat.pyx":5261 * cdef int flags = NPY_ARRAY_FARRAY * cdef npy_intp dims[2], strides[2] * dims[0] = m; strides[0] = sizeof(PetscScalar); # <<<<<<<<<<<<<< * dims[1] = N; strides[1] = (lda*sizeof(PetscScalar)); * array = PyArray_New(ndarray, 2, dims, typenum, */ (__pyx_v_dims[0]) = ((npy_intp)__pyx_v_m); (__pyx_v_strides[0]) = ((npy_intp)(sizeof(PetscScalar))); /* "petsc4py/PETSc/Mat.pyx":5262 * cdef npy_intp dims[2], strides[2] * dims[0] = m; strides[0] = sizeof(PetscScalar); * dims[1] = N; strides[1] = (lda*sizeof(PetscScalar)); # <<<<<<<<<<<<<< * array = PyArray_New(ndarray, 2, dims, typenum, * strides, data, itemsize, flags, NULL) */ (__pyx_v_dims[1]) = ((npy_intp)__pyx_v_N); (__pyx_v_strides[1]) = ((npy_intp)(__pyx_v_lda * (sizeof(PetscScalar)))); /* "petsc4py/PETSc/Mat.pyx":5263 * dims[0] = m; strides[0] = sizeof(PetscScalar); * dims[1] = N; strides[1] = (lda*sizeof(PetscScalar)); * array = PyArray_New(ndarray, 2, dims, typenum, # <<<<<<<<<<<<<< * strides, data, itemsize, flags, NULL) * if readonly: */ __pyx_t_3 = ((PyObject *)PyArray_New(((PyTypeObject *)__pyx_ptype_8petsc4py_5PETSc_ndarray), 2, __pyx_v_dims, __pyx_v_typenum, __pyx_v_strides, __pyx_v_data, __pyx_v_itemsize, __pyx_v_flags, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 5263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_array = __pyx_t_4; __pyx_t_4 = 0; /* "petsc4py/PETSc/Mat.pyx":5265 * array = PyArray_New(ndarray, 2, dims, typenum, * strides, data, itemsize, flags, NULL) * if readonly: # <<<<<<<<<<<<<< * CHKERR( MatDenseRestoreArrayRead(self.mat, &data) ) * else: */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_readonly); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(46, 5265, __pyx_L1_error) if (__pyx_t_2) { /* "petsc4py/PETSc/Mat.pyx":5266 * strides, data, itemsize, flags, NULL) * if readonly: * CHKERR( MatDenseRestoreArrayRead(self.mat, &data) ) # <<<<<<<<<<<<<< * else: * CHKERR( MatDenseRestoreArray(self.mat, &data) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDenseRestoreArrayRead(__pyx_v_self->mat, ((PetscScalar const **)(&__pyx_v_data)))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5266, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":5265 * array = PyArray_New(ndarray, 2, dims, typenum, * strides, data, itemsize, flags, NULL) * if readonly: # <<<<<<<<<<<<<< * CHKERR( MatDenseRestoreArrayRead(self.mat, &data) ) * else: */ goto __pyx_L4; } /* "petsc4py/PETSc/Mat.pyx":5268 * CHKERR( MatDenseRestoreArrayRead(self.mat, &data) ) * else: * CHKERR( MatDenseRestoreArray(self.mat, &data) ) # <<<<<<<<<<<<<< * return array * */ /*else*/ { __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDenseRestoreArray(__pyx_v_self->mat, (&__pyx_v_data))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5268, __pyx_L1_error) } __pyx_L4:; /* "petsc4py/PETSc/Mat.pyx":5269 * else: * CHKERR( MatDenseRestoreArray(self.mat, &data) ) * return array # <<<<<<<<<<<<<< * * def getDenseLocalMatrix(self) -> Mat: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_array); __pyx_r = __pyx_v_array; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":5233 * return toInt(lda) * * def getDenseArray(self, readonly: bool = False) -> ArrayScalar: # <<<<<<<<<<<<<< * """Return the array where the data is stored. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getDenseArray", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_array); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":5271 * return array * * def getDenseLocalMatrix(self) -> Mat: # <<<<<<<<<<<<<< * """Return the local part of the dense matrix. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_455getDenseLocalMatrix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_454getDenseLocalMatrix, "Mat.getDenseLocalMatrix(self) -> Mat\nReturn the local part of the dense matrix.\n\n Not collective.\n\n See Also\n --------\n petsc.MatDenseGetLocalMatrix\n\n \nSource code at petsc4py/PETSc/Mat.pyx:5271"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_455getDenseLocalMatrix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getDenseLocalMatrix (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getDenseLocalMatrix", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getDenseLocalMatrix", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_454getDenseLocalMatrix(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_454getDenseLocalMatrix(struct PyPetscMatObject *__pyx_v_self) { struct PyPetscMatObject *__pyx_v_mat = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PetscErrorCode __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getDenseLocalMatrix", 1); /* "petsc4py/PETSc/Mat.pyx":5281 * * """ * cdef Mat mat = type(self)() # <<<<<<<<<<<<<< * CHKERR( MatDenseGetLocalMatrix(self.mat, &mat.mat) ) * CHKERR( PetscINCREF(mat.obj) ) */ __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __pyx_t_2 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 5281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(46, 5281, __pyx_L1_error) __pyx_v_mat = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Mat.pyx":5282 * """ * cdef Mat mat = type(self)() * CHKERR( MatDenseGetLocalMatrix(self.mat, &mat.mat) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(mat.obj) ) * return mat */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDenseGetLocalMatrix(__pyx_v_self->mat, (&__pyx_v_mat->mat))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5282, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":5283 * cdef Mat mat = type(self)() * CHKERR( MatDenseGetLocalMatrix(self.mat, &mat.mat) ) * CHKERR( PetscINCREF(mat.obj) ) # <<<<<<<<<<<<<< * return mat * */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_mat->__pyx_base.obj)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5283, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":5284 * CHKERR( MatDenseGetLocalMatrix(self.mat, &mat.mat) ) * CHKERR( PetscINCREF(mat.obj) ) * return mat # <<<<<<<<<<<<<< * * def getDenseColumnVec(self, i: int, mode: AccessModeSpec = 'rw') -> Vec: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_mat); __pyx_r = ((PyObject *)__pyx_v_mat); goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":5271 * return array * * def getDenseLocalMatrix(self) -> Mat: # <<<<<<<<<<<<<< * """Return the local part of the dense matrix. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getDenseLocalMatrix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_mat); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":5286 * return mat * * def getDenseColumnVec(self, i: int, mode: AccessModeSpec = 'rw') -> Vec: # <<<<<<<<<<<<<< * """Return the i column vector of the dense matrix. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_457getDenseColumnVec(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_456getDenseColumnVec, "Mat.getDenseColumnVec(self, i: int, mode: AccessModeSpec = 'rw') -> Vec\nReturn the i\341\265\227\312\260 column vector of the dense matrix.\n\n Collective.\n\n Parameters\n ----------\n i\n The column index to access.\n mode\n The access type of the returned array\n\n See Also\n --------\n restoreDenseColumnVec, petsc.MatDenseGetColumnVec\n petsc.MatDenseGetColumnVecRead, petsc.MatDenseGetColumnVecWrite\n\n \nSource code at petsc4py/PETSc/Mat.pyx:5286"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_457getDenseColumnVec(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_i = 0; PyObject *__pyx_v_mode = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getDenseColumnVec (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_i,&__pyx_n_s_mode,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_n_s_rw)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_i)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 5286, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mode); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 5286, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getDenseColumnVec") < 0)) __PYX_ERR(46, 5286, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_i = values[0]; __pyx_v_mode = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getDenseColumnVec", 0, 1, 2, __pyx_nargs); __PYX_ERR(46, 5286, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.getDenseColumnVec", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_456getDenseColumnVec(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_i, __pyx_v_mode); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_456getDenseColumnVec(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_i, PyObject *__pyx_v_mode) { struct PyPetscVecObject *__pyx_v_v = 0; PetscInt __pyx_v__i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PetscInt __pyx_t_4; PetscErrorCode __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getDenseColumnVec", 0); __Pyx_INCREF(__pyx_v_mode); /* "petsc4py/PETSc/Mat.pyx":5304 * * """ * if mode is None: mode = 'rw' # <<<<<<<<<<<<<< * if mode not in ['rw', 'r', 'w']: * raise ValueError("Invalid mode: expected 'rw', 'r', or 'w'") */ __pyx_t_1 = (__pyx_v_mode == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_n_s_rw); __Pyx_DECREF_SET(__pyx_v_mode, __pyx_n_s_rw); } /* "petsc4py/PETSc/Mat.pyx":5305 * """ * if mode is None: mode = 'rw' * if mode not in ['rw', 'r', 'w']: # <<<<<<<<<<<<<< * raise ValueError("Invalid mode: expected 'rw', 'r', or 'w'") * cdef Vec v = Vec() */ __Pyx_INCREF(__pyx_v_mode); __pyx_t_2 = __pyx_v_mode; __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_rw, Py_NE)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(46, 5305, __pyx_L1_error) if (__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L5_bool_binop_done; } __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_r, Py_NE)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(46, 5305, __pyx_L1_error) if (__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L5_bool_binop_done; } __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_w, Py_NE)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(46, 5305, __pyx_L1_error) __pyx_t_1 = __pyx_t_3; __pyx_L5_bool_binop_done:; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = __pyx_t_1; if (unlikely(__pyx_t_3)) { /* "petsc4py/PETSc/Mat.pyx":5306 * if mode is None: mode = 'rw' * if mode not in ['rw', 'r', 'w']: * raise ValueError("Invalid mode: expected 'rw', 'r', or 'w'") # <<<<<<<<<<<<<< * cdef Vec v = Vec() * cdef PetscInt _i = asInt(i) */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 5306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(46, 5306, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":5305 * """ * if mode is None: mode = 'rw' * if mode not in ['rw', 'r', 'w']: # <<<<<<<<<<<<<< * raise ValueError("Invalid mode: expected 'rw', 'r', or 'w'") * cdef Vec v = Vec() */ } /* "petsc4py/PETSc/Mat.pyx":5307 * if mode not in ['rw', 'r', 'w']: * raise ValueError("Invalid mode: expected 'rw', 'r', or 'w'") * cdef Vec v = Vec() # <<<<<<<<<<<<<< * cdef PetscInt _i = asInt(i) * if mode == 'rw': */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 5307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_v = ((struct PyPetscVecObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/Mat.pyx":5308 * raise ValueError("Invalid mode: expected 'rw', 'r', or 'w'") * cdef Vec v = Vec() * cdef PetscInt _i = asInt(i) # <<<<<<<<<<<<<< * if mode == 'rw': * CHKERR( MatDenseGetColumnVec(self.mat, _i, &v.vec) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_i); if (unlikely(__pyx_t_4 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(46, 5308, __pyx_L1_error) __pyx_v__i = __pyx_t_4; /* "petsc4py/PETSc/Mat.pyx":5309 * cdef Vec v = Vec() * cdef PetscInt _i = asInt(i) * if mode == 'rw': # <<<<<<<<<<<<<< * CHKERR( MatDenseGetColumnVec(self.mat, _i, &v.vec) ) * elif mode == 'r': */ __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_rw, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(46, 5309, __pyx_L1_error) if (__pyx_t_3) { /* "petsc4py/PETSc/Mat.pyx":5310 * cdef PetscInt _i = asInt(i) * if mode == 'rw': * CHKERR( MatDenseGetColumnVec(self.mat, _i, &v.vec) ) # <<<<<<<<<<<<<< * elif mode == 'r': * CHKERR( MatDenseGetColumnVecRead(self.mat, _i, &v.vec) ) */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDenseGetColumnVec(__pyx_v_self->mat, __pyx_v__i, (&__pyx_v_v->vec))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5310, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":5309 * cdef Vec v = Vec() * cdef PetscInt _i = asInt(i) * if mode == 'rw': # <<<<<<<<<<<<<< * CHKERR( MatDenseGetColumnVec(self.mat, _i, &v.vec) ) * elif mode == 'r': */ goto __pyx_L8; } /* "petsc4py/PETSc/Mat.pyx":5311 * if mode == 'rw': * CHKERR( MatDenseGetColumnVec(self.mat, _i, &v.vec) ) * elif mode == 'r': # <<<<<<<<<<<<<< * CHKERR( MatDenseGetColumnVecRead(self.mat, _i, &v.vec) ) * else: */ __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_r, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(46, 5311, __pyx_L1_error) if (__pyx_t_3) { /* "petsc4py/PETSc/Mat.pyx":5312 * CHKERR( MatDenseGetColumnVec(self.mat, _i, &v.vec) ) * elif mode == 'r': * CHKERR( MatDenseGetColumnVecRead(self.mat, _i, &v.vec) ) # <<<<<<<<<<<<<< * else: * CHKERR( MatDenseGetColumnVecWrite(self.mat, _i, &v.vec) ) */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDenseGetColumnVecRead(__pyx_v_self->mat, __pyx_v__i, (&__pyx_v_v->vec))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5312, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":5311 * if mode == 'rw': * CHKERR( MatDenseGetColumnVec(self.mat, _i, &v.vec) ) * elif mode == 'r': # <<<<<<<<<<<<<< * CHKERR( MatDenseGetColumnVecRead(self.mat, _i, &v.vec) ) * else: */ goto __pyx_L8; } /* "petsc4py/PETSc/Mat.pyx":5314 * CHKERR( MatDenseGetColumnVecRead(self.mat, _i, &v.vec) ) * else: * CHKERR( MatDenseGetColumnVecWrite(self.mat, _i, &v.vec) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(v.obj) ) * return v */ /*else*/ { __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDenseGetColumnVecWrite(__pyx_v_self->mat, __pyx_v__i, (&__pyx_v_v->vec))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5314, __pyx_L1_error) } __pyx_L8:; /* "petsc4py/PETSc/Mat.pyx":5315 * else: * CHKERR( MatDenseGetColumnVecWrite(self.mat, _i, &v.vec) ) * CHKERR( PetscINCREF(v.obj) ) # <<<<<<<<<<<<<< * return v * */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_v->__pyx_base.obj)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5315, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":5316 * CHKERR( MatDenseGetColumnVecWrite(self.mat, _i, &v.vec) ) * CHKERR( PetscINCREF(v.obj) ) * return v # <<<<<<<<<<<<<< * * def restoreDenseColumnVec(self, i: int, mode: AccessModeSpec = 'rw') -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_v); __pyx_r = ((PyObject *)__pyx_v_v); goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":5286 * return mat * * def getDenseColumnVec(self, i: int, mode: AccessModeSpec = 'rw') -> Vec: # <<<<<<<<<<<<<< * """Return the i column vector of the dense matrix. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getDenseColumnVec", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_v); __Pyx_XDECREF(__pyx_v_mode); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":5318 * return v * * def restoreDenseColumnVec(self, i: int, mode: AccessModeSpec = 'rw') -> None: # <<<<<<<<<<<<<< * """Restore the i column vector of the dense matrix. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_459restoreDenseColumnVec(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_458restoreDenseColumnVec, "Mat.restoreDenseColumnVec(self, i: int, mode: AccessModeSpec = 'rw') -> None\nRestore the i\341\265\227\312\260 column vector of the dense matrix.\n\n Collective.\n\n Parameters\n ----------\n i\n The column index to be restored.\n mode\n The access type of the restored array\n\n See Also\n --------\n getDenseColumnVec, petsc.MatDenseRestoreColumnVec\n petsc.MatDenseRestoreColumnVecRead, petsc.MatDenseRestoreColumnVecWrite\n\n \nSource code at petsc4py/PETSc/Mat.pyx:5318"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_459restoreDenseColumnVec(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_i = 0; PyObject *__pyx_v_mode = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("restoreDenseColumnVec (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_i,&__pyx_n_s_mode,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_n_s_rw)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_i)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 5318, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mode); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 5318, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "restoreDenseColumnVec") < 0)) __PYX_ERR(46, 5318, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_i = values[0]; __pyx_v_mode = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("restoreDenseColumnVec", 0, 1, 2, __pyx_nargs); __PYX_ERR(46, 5318, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.restoreDenseColumnVec", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_458restoreDenseColumnVec(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_i, __pyx_v_mode); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_458restoreDenseColumnVec(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_i, PyObject *__pyx_v_mode) { PetscInt __pyx_v__i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("restoreDenseColumnVec", 1); /* "petsc4py/PETSc/Mat.pyx":5336 * * """ * cdef PetscInt _i = asInt(i) # <<<<<<<<<<<<<< * if mode == 'rw': * CHKERR( MatDenseRestoreColumnVec(self.mat, _i, NULL) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_i); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(46, 5336, __pyx_L1_error) __pyx_v__i = __pyx_t_1; /* "petsc4py/PETSc/Mat.pyx":5337 * """ * cdef PetscInt _i = asInt(i) * if mode == 'rw': # <<<<<<<<<<<<<< * CHKERR( MatDenseRestoreColumnVec(self.mat, _i, NULL) ) * elif mode == 'r': */ __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_rw, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(46, 5337, __pyx_L1_error) if (__pyx_t_2) { /* "petsc4py/PETSc/Mat.pyx":5338 * cdef PetscInt _i = asInt(i) * if mode == 'rw': * CHKERR( MatDenseRestoreColumnVec(self.mat, _i, NULL) ) # <<<<<<<<<<<<<< * elif mode == 'r': * CHKERR( MatDenseRestoreColumnVecRead(self.mat, _i, NULL) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDenseRestoreColumnVec(__pyx_v_self->mat, __pyx_v__i, NULL)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5338, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":5337 * """ * cdef PetscInt _i = asInt(i) * if mode == 'rw': # <<<<<<<<<<<<<< * CHKERR( MatDenseRestoreColumnVec(self.mat, _i, NULL) ) * elif mode == 'r': */ goto __pyx_L3; } /* "petsc4py/PETSc/Mat.pyx":5339 * if mode == 'rw': * CHKERR( MatDenseRestoreColumnVec(self.mat, _i, NULL) ) * elif mode == 'r': # <<<<<<<<<<<<<< * CHKERR( MatDenseRestoreColumnVecRead(self.mat, _i, NULL) ) * else: */ __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_r, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(46, 5339, __pyx_L1_error) if (__pyx_t_2) { /* "petsc4py/PETSc/Mat.pyx":5340 * CHKERR( MatDenseRestoreColumnVec(self.mat, _i, NULL) ) * elif mode == 'r': * CHKERR( MatDenseRestoreColumnVecRead(self.mat, _i, NULL) ) # <<<<<<<<<<<<<< * else: * CHKERR( MatDenseRestoreColumnVecWrite(self.mat, _i, NULL) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDenseRestoreColumnVecRead(__pyx_v_self->mat, __pyx_v__i, NULL)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5340, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":5339 * if mode == 'rw': * CHKERR( MatDenseRestoreColumnVec(self.mat, _i, NULL) ) * elif mode == 'r': # <<<<<<<<<<<<<< * CHKERR( MatDenseRestoreColumnVecRead(self.mat, _i, NULL) ) * else: */ goto __pyx_L3; } /* "petsc4py/PETSc/Mat.pyx":5342 * CHKERR( MatDenseRestoreColumnVecRead(self.mat, _i, NULL) ) * else: * CHKERR( MatDenseRestoreColumnVecWrite(self.mat, _i, NULL) ) # <<<<<<<<<<<<<< * * # Nest */ /*else*/ { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDenseRestoreColumnVecWrite(__pyx_v_self->mat, __pyx_v__i, NULL)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5342, __pyx_L1_error) } __pyx_L3:; /* "petsc4py/PETSc/Mat.pyx":5318 * return v * * def restoreDenseColumnVec(self, i: int, mode: AccessModeSpec = 'rw') -> None: # <<<<<<<<<<<<<< * """Restore the i column vector of the dense matrix. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.restoreDenseColumnVec", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":5346 * # Nest * * def getNestSize(self) -> tuple[int, int]: # <<<<<<<<<<<<<< * """Return the number of rows and columns of the matrix. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_461getNestSize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_460getNestSize, "Mat.getNestSize(self) -> tuple[int, int]\nReturn the number of rows and columns of the matrix.\n\n Not collective.\n\n See Also\n --------\n petsc.MatNestGetSize\n\n \nSource code at petsc4py/PETSc/Mat.pyx:5346"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_461getNestSize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getNestSize (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getNestSize", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getNestSize", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_460getNestSize(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_460getNestSize(struct PyPetscMatObject *__pyx_v_self) { PetscInt __pyx_v_nrows; PetscInt __pyx_v_ncols; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getNestSize", 1); /* "petsc4py/PETSc/Mat.pyx":5357 * """ * cdef PetscInt nrows, ncols * CHKERR( MatNestGetSize(self.mat, &nrows, &ncols) ) # <<<<<<<<<<<<<< * return toInt(nrows), toInt(ncols) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatNestGetSize(__pyx_v_self->mat, (&__pyx_v_nrows), (&__pyx_v_ncols))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5357, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":5358 * cdef PetscInt nrows, ncols * CHKERR( MatNestGetSize(self.mat, &nrows, &ncols) ) * return toInt(nrows), toInt(ncols) # <<<<<<<<<<<<<< * * def getNestISs(self) -> tuple[list[IS], list[IS]]: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nrows); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 5358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ncols); if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 5358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 5358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(46, 5358, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(46, 5358, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":5346 * # Nest * * def getNestSize(self) -> tuple[int, int]: # <<<<<<<<<<<<<< * """Return the number of rows and columns of the matrix. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getNestSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":5360 * return toInt(nrows), toInt(ncols) * * def getNestISs(self) -> tuple[list[IS], list[IS]]: # <<<<<<<<<<<<<< * """Return the index sets representing the row and column spaces. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_463getNestISs(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_462getNestISs, "Mat.getNestISs(self) -> tuple[list[IS], list[IS]]\nReturn the index sets representing the row and column spaces.\n\n Not collective.\n\n See Also\n --------\n petsc.MatNestGetISs\n\n \nSource code at petsc4py/PETSc/Mat.pyx:5360"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_463getNestISs(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getNestISs (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getNestISs", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getNestISs", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_462getNestISs(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_462getNestISs(struct PyPetscMatObject *__pyx_v_self) { PetscInt __pyx_v_nrows; PetscInt __pyx_v_ncols; IS *__pyx_v_cisrows; IS *__pyx_v_ciscols; CYTHON_UNUSED PyObject *__pyx_v_tmpr = 0; CYTHON_UNUSED PyObject *__pyx_v_tmpc = 0; PyObject *__pyx_v_isetsrows = 0; PyObject *__pyx_v_isetscols = 0; PetscInt __pyx_8genexpr4__pyx_v_i; PetscInt __pyx_8genexpr5__pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PetscInt __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getNestISs", 1); /* "petsc4py/PETSc/Mat.pyx":5370 * * """ * cdef PetscInt i, nrows =0, ncols = 0 # <<<<<<<<<<<<<< * cdef PetscIS *cisrows = NULL * cdef PetscIS *ciscols = NULL */ __pyx_v_nrows = 0; __pyx_v_ncols = 0; /* "petsc4py/PETSc/Mat.pyx":5371 * """ * cdef PetscInt i, nrows =0, ncols = 0 * cdef PetscIS *cisrows = NULL # <<<<<<<<<<<<<< * cdef PetscIS *ciscols = NULL * CHKERR( MatNestGetSize(self.mat, &nrows, &ncols) ) */ __pyx_v_cisrows = NULL; /* "petsc4py/PETSc/Mat.pyx":5372 * cdef PetscInt i, nrows =0, ncols = 0 * cdef PetscIS *cisrows = NULL * cdef PetscIS *ciscols = NULL # <<<<<<<<<<<<<< * CHKERR( MatNestGetSize(self.mat, &nrows, &ncols) ) * cdef object tmpr = oarray_p(empty_p(nrows), NULL, &cisrows) */ __pyx_v_ciscols = NULL; /* "petsc4py/PETSc/Mat.pyx":5373 * cdef PetscIS *cisrows = NULL * cdef PetscIS *ciscols = NULL * CHKERR( MatNestGetSize(self.mat, &nrows, &ncols) ) # <<<<<<<<<<<<<< * cdef object tmpr = oarray_p(empty_p(nrows), NULL, &cisrows) * cdef object tmpc = oarray_p(empty_p(ncols), NULL, &ciscols) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatNestGetSize(__pyx_v_self->mat, (&__pyx_v_nrows), (&__pyx_v_ncols))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5373, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":5374 * cdef PetscIS *ciscols = NULL * CHKERR( MatNestGetSize(self.mat, &nrows, &ncols) ) * cdef object tmpr = oarray_p(empty_p(nrows), NULL, &cisrows) # <<<<<<<<<<<<<< * cdef object tmpc = oarray_p(empty_p(ncols), NULL, &ciscols) * CHKERR( MatNestGetISs(self.mat, cisrows, ciscols) ) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_nrows)); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 5374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_2, NULL, ((void **)(&__pyx_v_cisrows)))); if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 5374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_tmpr = __pyx_t_3; __pyx_t_3 = 0; /* "petsc4py/PETSc/Mat.pyx":5375 * CHKERR( MatNestGetSize(self.mat, &nrows, &ncols) ) * cdef object tmpr = oarray_p(empty_p(nrows), NULL, &cisrows) * cdef object tmpc = oarray_p(empty_p(ncols), NULL, &ciscols) # <<<<<<<<<<<<<< * CHKERR( MatNestGetISs(self.mat, cisrows, ciscols) ) * cdef object isetsrows = [ref_IS(cisrows[i]) for i from 0 <= i < nrows] */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_ncols)); if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 5375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_3, NULL, ((void **)(&__pyx_v_ciscols)))); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 5375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_tmpc = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/Mat.pyx":5376 * cdef object tmpr = oarray_p(empty_p(nrows), NULL, &cisrows) * cdef object tmpc = oarray_p(empty_p(ncols), NULL, &ciscols) * CHKERR( MatNestGetISs(self.mat, cisrows, ciscols) ) # <<<<<<<<<<<<<< * cdef object isetsrows = [ref_IS(cisrows[i]) for i from 0 <= i < nrows] * cdef object isetscols = [ref_IS(ciscols[i]) for i from 0 <= i < ncols] */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatNestGetISs(__pyx_v_self->mat, __pyx_v_cisrows, __pyx_v_ciscols)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5376, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":5377 * cdef object tmpc = oarray_p(empty_p(ncols), NULL, &ciscols) * CHKERR( MatNestGetISs(self.mat, cisrows, ciscols) ) * cdef object isetsrows = [ref_IS(cisrows[i]) for i from 0 <= i < nrows] # <<<<<<<<<<<<<< * cdef object isetscols = [ref_IS(ciscols[i]) for i from 0 <= i < ncols] * return isetsrows, isetscols */ { /* enter inner scope */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 5377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __pyx_v_nrows; for (__pyx_8genexpr4__pyx_v_i = 0; __pyx_8genexpr4__pyx_v_i < __pyx_t_4; __pyx_8genexpr4__pyx_v_i++) { __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_IS((__pyx_v_cisrows[__pyx_8genexpr4__pyx_v_i]))); if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 5377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) __PYX_ERR(46, 5377, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } } /* exit inner scope */ __pyx_v_isetsrows = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/Mat.pyx":5378 * CHKERR( MatNestGetISs(self.mat, cisrows, ciscols) ) * cdef object isetsrows = [ref_IS(cisrows[i]) for i from 0 <= i < nrows] * cdef object isetscols = [ref_IS(ciscols[i]) for i from 0 <= i < ncols] # <<<<<<<<<<<<<< * return isetsrows, isetscols * */ { /* enter inner scope */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 5378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __pyx_v_ncols; for (__pyx_8genexpr5__pyx_v_i = 0; __pyx_8genexpr5__pyx_v_i < __pyx_t_4; __pyx_8genexpr5__pyx_v_i++) { __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_IS((__pyx_v_ciscols[__pyx_8genexpr5__pyx_v_i]))); if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 5378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) __PYX_ERR(46, 5378, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } } /* exit inner scope */ __pyx_v_isetscols = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/Mat.pyx":5379 * cdef object isetsrows = [ref_IS(cisrows[i]) for i from 0 <= i < nrows] * cdef object isetscols = [ref_IS(ciscols[i]) for i from 0 <= i < ncols] * return isetsrows, isetscols # <<<<<<<<<<<<<< * * def getNestLocalISs(self) -> tuple[list[IS], list[IS]]: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 5379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_isetsrows); __Pyx_GIVEREF(__pyx_v_isetsrows); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_isetsrows)) __PYX_ERR(46, 5379, __pyx_L1_error); __Pyx_INCREF(__pyx_v_isetscols); __Pyx_GIVEREF(__pyx_v_isetscols); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_isetscols)) __PYX_ERR(46, 5379, __pyx_L1_error); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":5360 * return toInt(nrows), toInt(ncols) * * def getNestISs(self) -> tuple[list[IS], list[IS]]: # <<<<<<<<<<<<<< * """Return the index sets representing the row and column spaces. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getNestISs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_tmpr); __Pyx_XDECREF(__pyx_v_tmpc); __Pyx_XDECREF(__pyx_v_isetsrows); __Pyx_XDECREF(__pyx_v_isetscols); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":5381 * return isetsrows, isetscols * * def getNestLocalISs(self) -> tuple[list[IS], list[IS]]: # <<<<<<<<<<<<<< * """Return the local index sets representing the row and column spaces. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_465getNestLocalISs(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_464getNestLocalISs, "Mat.getNestLocalISs(self) -> tuple[list[IS], list[IS]]\nReturn the local index sets representing the row and column spaces.\n\n Not collective.\n\n See Also\n --------\n petsc.MatNestGetLocalISs\n\n \nSource code at petsc4py/PETSc/Mat.pyx:5381"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_465getNestLocalISs(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getNestLocalISs (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getNestLocalISs", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getNestLocalISs", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_464getNestLocalISs(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_464getNestLocalISs(struct PyPetscMatObject *__pyx_v_self) { PetscInt __pyx_v_nrows; PetscInt __pyx_v_ncols; IS *__pyx_v_cisrows; IS *__pyx_v_ciscols; CYTHON_UNUSED PyObject *__pyx_v_tmpr = 0; CYTHON_UNUSED PyObject *__pyx_v_tmpc = 0; PyObject *__pyx_v_isetsrows = 0; PyObject *__pyx_v_isetscols = 0; PetscInt __pyx_8genexpr6__pyx_v_i; PetscInt __pyx_8genexpr7__pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PetscInt __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getNestLocalISs", 1); /* "petsc4py/PETSc/Mat.pyx":5391 * * """ * cdef PetscInt i, nrows =0, ncols = 0 # <<<<<<<<<<<<<< * cdef PetscIS *cisrows = NULL * cdef PetscIS *ciscols = NULL */ __pyx_v_nrows = 0; __pyx_v_ncols = 0; /* "petsc4py/PETSc/Mat.pyx":5392 * """ * cdef PetscInt i, nrows =0, ncols = 0 * cdef PetscIS *cisrows = NULL # <<<<<<<<<<<<<< * cdef PetscIS *ciscols = NULL * CHKERR( MatNestGetSize(self.mat, &nrows, &ncols) ) */ __pyx_v_cisrows = NULL; /* "petsc4py/PETSc/Mat.pyx":5393 * cdef PetscInt i, nrows =0, ncols = 0 * cdef PetscIS *cisrows = NULL * cdef PetscIS *ciscols = NULL # <<<<<<<<<<<<<< * CHKERR( MatNestGetSize(self.mat, &nrows, &ncols) ) * cdef object tmpr = oarray_p(empty_p(nrows), NULL, &cisrows) */ __pyx_v_ciscols = NULL; /* "petsc4py/PETSc/Mat.pyx":5394 * cdef PetscIS *cisrows = NULL * cdef PetscIS *ciscols = NULL * CHKERR( MatNestGetSize(self.mat, &nrows, &ncols) ) # <<<<<<<<<<<<<< * cdef object tmpr = oarray_p(empty_p(nrows), NULL, &cisrows) * cdef object tmpc = oarray_p(empty_p(ncols), NULL, &ciscols) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatNestGetSize(__pyx_v_self->mat, (&__pyx_v_nrows), (&__pyx_v_ncols))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5394, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":5395 * cdef PetscIS *ciscols = NULL * CHKERR( MatNestGetSize(self.mat, &nrows, &ncols) ) * cdef object tmpr = oarray_p(empty_p(nrows), NULL, &cisrows) # <<<<<<<<<<<<<< * cdef object tmpc = oarray_p(empty_p(ncols), NULL, &ciscols) * CHKERR( MatNestGetLocalISs(self.mat, cisrows, ciscols) ) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_nrows)); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 5395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_2, NULL, ((void **)(&__pyx_v_cisrows)))); if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 5395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_tmpr = __pyx_t_3; __pyx_t_3 = 0; /* "petsc4py/PETSc/Mat.pyx":5396 * CHKERR( MatNestGetSize(self.mat, &nrows, &ncols) ) * cdef object tmpr = oarray_p(empty_p(nrows), NULL, &cisrows) * cdef object tmpc = oarray_p(empty_p(ncols), NULL, &ciscols) # <<<<<<<<<<<<<< * CHKERR( MatNestGetLocalISs(self.mat, cisrows, ciscols) ) * cdef object isetsrows = [ref_IS(cisrows[i]) for i from 0 <= i < nrows] */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_ncols)); if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 5396, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_3, NULL, ((void **)(&__pyx_v_ciscols)))); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 5396, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_tmpc = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/Mat.pyx":5397 * cdef object tmpr = oarray_p(empty_p(nrows), NULL, &cisrows) * cdef object tmpc = oarray_p(empty_p(ncols), NULL, &ciscols) * CHKERR( MatNestGetLocalISs(self.mat, cisrows, ciscols) ) # <<<<<<<<<<<<<< * cdef object isetsrows = [ref_IS(cisrows[i]) for i from 0 <= i < nrows] * cdef object isetscols = [ref_IS(ciscols[i]) for i from 0 <= i < ncols] */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatNestGetLocalISs(__pyx_v_self->mat, __pyx_v_cisrows, __pyx_v_ciscols)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5397, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":5398 * cdef object tmpc = oarray_p(empty_p(ncols), NULL, &ciscols) * CHKERR( MatNestGetLocalISs(self.mat, cisrows, ciscols) ) * cdef object isetsrows = [ref_IS(cisrows[i]) for i from 0 <= i < nrows] # <<<<<<<<<<<<<< * cdef object isetscols = [ref_IS(ciscols[i]) for i from 0 <= i < ncols] * return isetsrows, isetscols */ { /* enter inner scope */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 5398, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __pyx_v_nrows; for (__pyx_8genexpr6__pyx_v_i = 0; __pyx_8genexpr6__pyx_v_i < __pyx_t_4; __pyx_8genexpr6__pyx_v_i++) { __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_IS((__pyx_v_cisrows[__pyx_8genexpr6__pyx_v_i]))); if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 5398, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) __PYX_ERR(46, 5398, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } } /* exit inner scope */ __pyx_v_isetsrows = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/Mat.pyx":5399 * CHKERR( MatNestGetLocalISs(self.mat, cisrows, ciscols) ) * cdef object isetsrows = [ref_IS(cisrows[i]) for i from 0 <= i < nrows] * cdef object isetscols = [ref_IS(ciscols[i]) for i from 0 <= i < ncols] # <<<<<<<<<<<<<< * return isetsrows, isetscols * */ { /* enter inner scope */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 5399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __pyx_v_ncols; for (__pyx_8genexpr7__pyx_v_i = 0; __pyx_8genexpr7__pyx_v_i < __pyx_t_4; __pyx_8genexpr7__pyx_v_i++) { __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_IS((__pyx_v_ciscols[__pyx_8genexpr7__pyx_v_i]))); if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 5399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) __PYX_ERR(46, 5399, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } } /* exit inner scope */ __pyx_v_isetscols = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/Mat.pyx":5400 * cdef object isetsrows = [ref_IS(cisrows[i]) for i from 0 <= i < nrows] * cdef object isetscols = [ref_IS(ciscols[i]) for i from 0 <= i < ncols] * return isetsrows, isetscols # <<<<<<<<<<<<<< * * def getNestSubMatrix(self, i: int, j: int) -> Mat: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 5400, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_isetsrows); __Pyx_GIVEREF(__pyx_v_isetsrows); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_isetsrows)) __PYX_ERR(46, 5400, __pyx_L1_error); __Pyx_INCREF(__pyx_v_isetscols); __Pyx_GIVEREF(__pyx_v_isetscols); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_isetscols)) __PYX_ERR(46, 5400, __pyx_L1_error); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":5381 * return isetsrows, isetscols * * def getNestLocalISs(self) -> tuple[list[IS], list[IS]]: # <<<<<<<<<<<<<< * """Return the local index sets representing the row and column spaces. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getNestLocalISs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_tmpr); __Pyx_XDECREF(__pyx_v_tmpc); __Pyx_XDECREF(__pyx_v_isetsrows); __Pyx_XDECREF(__pyx_v_isetscols); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":5402 * return isetsrows, isetscols * * def getNestSubMatrix(self, i: int, j: int) -> Mat: # <<<<<<<<<<<<<< * """Return a single submatrix. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_467getNestSubMatrix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_466getNestSubMatrix, "Mat.getNestSubMatrix(self, i: int, j: int) -> Mat\nReturn a single submatrix.\n\n Not collective.\n\n Parameters\n ----------\n i\n The first index of the matrix within the nesting.\n j\n The second index of the matrix within the nesting.\n\n See Also\n --------\n petsc.MatNestGetSubMat\n\n \nSource code at petsc4py/PETSc/Mat.pyx:5402"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_467getNestSubMatrix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_i = 0; PyObject *__pyx_v_j = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getNestSubMatrix (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_i,&__pyx_n_s_j,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_i)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 5402, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_j)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 5402, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("getNestSubMatrix", 1, 2, 2, 1); __PYX_ERR(46, 5402, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getNestSubMatrix") < 0)) __PYX_ERR(46, 5402, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_i = values[0]; __pyx_v_j = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getNestSubMatrix", 1, 2, 2, __pyx_nargs); __PYX_ERR(46, 5402, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.getNestSubMatrix", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_466getNestSubMatrix(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_i, __pyx_v_j); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_466getNestSubMatrix(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_i, PyObject *__pyx_v_j) { struct PyPetscMatObject *__pyx_v_submat = 0; PetscInt __pyx_v_idxm; PetscInt __pyx_v_jdxm; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscInt __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getNestSubMatrix", 1); /* "petsc4py/PETSc/Mat.pyx":5419 * * """ * cdef Mat submat = Mat() # <<<<<<<<<<<<<< * cdef PetscInt idxm = asInt(i) * cdef PetscInt jdxm = asInt(j) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 5419, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_submat = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Mat.pyx":5420 * """ * cdef Mat submat = Mat() * cdef PetscInt idxm = asInt(i) # <<<<<<<<<<<<<< * cdef PetscInt jdxm = asInt(j) * CHKERR( MatNestGetSubMat(self.mat, idxm, jdxm, &submat.mat) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_i); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(46, 5420, __pyx_L1_error) __pyx_v_idxm = __pyx_t_2; /* "petsc4py/PETSc/Mat.pyx":5421 * cdef Mat submat = Mat() * cdef PetscInt idxm = asInt(i) * cdef PetscInt jdxm = asInt(j) # <<<<<<<<<<<<<< * CHKERR( MatNestGetSubMat(self.mat, idxm, jdxm, &submat.mat) ) * CHKERR( PetscINCREF(submat.obj) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_j); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(46, 5421, __pyx_L1_error) __pyx_v_jdxm = __pyx_t_2; /* "petsc4py/PETSc/Mat.pyx":5422 * cdef PetscInt idxm = asInt(i) * cdef PetscInt jdxm = asInt(j) * CHKERR( MatNestGetSubMat(self.mat, idxm, jdxm, &submat.mat) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(submat.obj) ) * return submat */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatNestGetSubMat(__pyx_v_self->mat, __pyx_v_idxm, __pyx_v_jdxm, (&__pyx_v_submat->mat))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5422, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":5423 * cdef PetscInt jdxm = asInt(j) * CHKERR( MatNestGetSubMat(self.mat, idxm, jdxm, &submat.mat) ) * CHKERR( PetscINCREF(submat.obj) ) # <<<<<<<<<<<<<< * return submat * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_submat->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5423, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":5424 * CHKERR( MatNestGetSubMat(self.mat, idxm, jdxm, &submat.mat) ) * CHKERR( PetscINCREF(submat.obj) ) * return submat # <<<<<<<<<<<<<< * * # DM */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_submat); __pyx_r = ((PyObject *)__pyx_v_submat); goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":5402 * return isetsrows, isetscols * * def getNestSubMatrix(self, i: int, j: int) -> Mat: # <<<<<<<<<<<<<< * """Return a single submatrix. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getNestSubMatrix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_submat); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":5428 * # DM * * def getDM(self) -> DM: # <<<<<<<<<<<<<< * """Return the DM defining the data layout of the matrix. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_469getDM(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_468getDM, "Mat.getDM(self) -> DM\nReturn the DM defining the data layout of the matrix.\n\n Not collective.\n\n See Also\n --------\n petsc.MatGetDM\n\n \nSource code at petsc4py/PETSc/Mat.pyx:5428"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_469getDM(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getDM (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getDM", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getDM", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_468getDM(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_468getDM(struct PyPetscMatObject *__pyx_v_self) { DM __pyx_v_newdm; struct PyPetscDMObject *__pyx_v_dm = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getDM", 1); /* "petsc4py/PETSc/Mat.pyx":5438 * * """ * cdef PetscDM newdm = NULL # <<<<<<<<<<<<<< * CHKERR( MatGetDM(self.mat, &newdm) ) * cdef DM dm = subtype_DM(newdm)() */ __pyx_v_newdm = NULL; /* "petsc4py/PETSc/Mat.pyx":5439 * """ * cdef PetscDM newdm = NULL * CHKERR( MatGetDM(self.mat, &newdm) ) # <<<<<<<<<<<<<< * cdef DM dm = subtype_DM(newdm)() * dm.dm = newdm */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetDM(__pyx_v_self->mat, (&__pyx_v_newdm))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5439, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":5440 * cdef PetscDM newdm = NULL * CHKERR( MatGetDM(self.mat, &newdm) ) * cdef DM dm = subtype_DM(newdm)() # <<<<<<<<<<<<<< * dm.dm = newdm * CHKERR( PetscINCREF(dm.obj) ) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_newdm)); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 5440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 5440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(46, 5440, __pyx_L1_error) __pyx_v_dm = ((struct PyPetscDMObject *)__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/Mat.pyx":5441 * CHKERR( MatGetDM(self.mat, &newdm) ) * cdef DM dm = subtype_DM(newdm)() * dm.dm = newdm # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(dm.obj) ) * return dm */ __pyx_v_dm->dm = __pyx_v_newdm; /* "petsc4py/PETSc/Mat.pyx":5442 * cdef DM dm = subtype_DM(newdm)() * dm.dm = newdm * CHKERR( PetscINCREF(dm.obj) ) # <<<<<<<<<<<<<< * return dm * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_dm->__pyx_base.obj)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5442, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":5443 * dm.dm = newdm * CHKERR( PetscINCREF(dm.obj) ) * return dm # <<<<<<<<<<<<<< * * def setDM(self, DM dm) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_dm); __pyx_r = ((PyObject *)__pyx_v_dm); goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":5428 * # DM * * def getDM(self) -> DM: # <<<<<<<<<<<<<< * """Return the DM defining the data layout of the matrix. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getDM", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_dm); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":5445 * return dm * * def setDM(self, DM dm) -> None: # <<<<<<<<<<<<<< * """Set the DM defining the data layout of the matrix. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_471setDM(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_470setDM, "Mat.setDM(self, dm: DM) -> None\nSet the DM defining the data layout of the matrix.\n\n Not collective.\n\n Parameters\n ----------\n dm\n The `DM`.\n\n See Also\n --------\n petsc.MatSetDM\n\n \nSource code at petsc4py/PETSc/Mat.pyx:5445"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_471setDM(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscDMObject *__pyx_v_dm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setDM (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dm,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dm)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 5445, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setDM") < 0)) __PYX_ERR(46, 5445, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_dm = ((struct PyPetscDMObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setDM", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 5445, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.setDM", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_ptype_8petsc4py_5PETSc_DM, 0, "dm", 0))) __PYX_ERR(46, 5445, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_470setDM(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_dm); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_470setDM(struct PyPetscMatObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setDM", 1); /* "petsc4py/PETSc/Mat.pyx":5460 * * """ * CHKERR( MatSetDM(self.mat, dm.dm) ) # <<<<<<<<<<<<<< * * # backward compatibility */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSetDM(__pyx_v_self->mat, __pyx_v_dm->dm)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5460, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":5445 * return dm * * def setDM(self, DM dm) -> None: # <<<<<<<<<<<<<< * """Set the DM defining the data layout of the matrix. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setDM", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":5470 * property sizes: * """Matrix local and global sizes.""" * def __get__(self) -> tuple[tuple[int, int], tuple[int, int]]: # <<<<<<<<<<<<<< * return self.getSizes() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_5sizes_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_5sizes_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_5sizes___get__(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_5sizes___get__(struct PyPetscMatObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/Mat.pyx":5471 * """Matrix local and global sizes.""" * def __get__(self) -> tuple[tuple[int, int], tuple[int, int]]: * return self.getSizes() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setSizes(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getSizes); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 5471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 5471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":5470 * property sizes: * """Matrix local and global sizes.""" * def __get__(self) -> tuple[tuple[int, int], tuple[int, int]]: # <<<<<<<<<<<<<< * return self.getSizes() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.sizes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":5472 * def __get__(self) -> tuple[tuple[int, int], tuple[int, int]]: * return self.getSizes() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setSizes(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_3Mat_5sizes_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_3Mat_5sizes_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_5sizes_2__set__(((struct PyPetscMatObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_3Mat_5sizes_2__set__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "petsc4py/PETSc/Mat.pyx":5473 * return self.getSizes() * def __set__(self, value): * self.setSizes(value) # <<<<<<<<<<<<<< * * property size: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setSizes); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 5473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_value}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 5473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Mat.pyx":5472 * def __get__(self) -> tuple[tuple[int, int], tuple[int, int]]: * return self.getSizes() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setSizes(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.sizes.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":5477 * property size: * """Matrix global size.""" * def __get__(self) -> tuple[int, int]: # <<<<<<<<<<<<<< * return self.getSize() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_4size_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_4size_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_4size___get__(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_4size___get__(struct PyPetscMatObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/Mat.pyx":5478 * """Matrix global size.""" * def __get__(self) -> tuple[int, int]: * return self.getSize() # <<<<<<<<<<<<<< * * property local_size: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getSize); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 5478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 5478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":5477 * property size: * """Matrix global size.""" * def __get__(self) -> tuple[int, int]: # <<<<<<<<<<<<<< * return self.getSize() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":5482 * property local_size: * """Matrix local size.""" * def __get__(self) -> int: # <<<<<<<<<<<<<< * return self.getLocalSize() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_10local_size_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_10local_size_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_10local_size___get__(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_10local_size___get__(struct PyPetscMatObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/Mat.pyx":5483 * """Matrix local size.""" * def __get__(self) -> int: * return self.getLocalSize() # <<<<<<<<<<<<<< * * property block_size: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getLocalSize); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 5483, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 5483, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":5482 * property local_size: * """Matrix local size.""" * def __get__(self) -> int: # <<<<<<<<<<<<<< * return self.getLocalSize() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.local_size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":5487 * property block_size: * """Matrix block size.""" * def __get__(self) -> int: # <<<<<<<<<<<<<< * return self.getBlockSize() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_10block_size_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_10block_size_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_10block_size___get__(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_10block_size___get__(struct PyPetscMatObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/Mat.pyx":5488 * """Matrix block size.""" * def __get__(self) -> int: * return self.getBlockSize() # <<<<<<<<<<<<<< * * property block_sizes: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getBlockSize); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 5488, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 5488, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":5487 * property block_size: * """Matrix block size.""" * def __get__(self) -> int: # <<<<<<<<<<<<<< * return self.getBlockSize() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.block_size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":5492 * property block_sizes: * """Matrix row and column block sizes.""" * def __get__(self) -> tuple[int, int]: # <<<<<<<<<<<<<< * return self.getBlockSizes() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_11block_sizes_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_11block_sizes_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_11block_sizes___get__(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_11block_sizes___get__(struct PyPetscMatObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/Mat.pyx":5493 * """Matrix row and column block sizes.""" * def __get__(self) -> tuple[int, int]: * return self.getBlockSizes() # <<<<<<<<<<<<<< * * property owner_range: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getBlockSizes); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 5493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 5493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":5492 * property block_sizes: * """Matrix row and column block sizes.""" * def __get__(self) -> tuple[int, int]: # <<<<<<<<<<<<<< * return self.getBlockSizes() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.block_sizes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":5497 * property owner_range: * """Matrix local row range.""" * def __get__(self) -> tuple[int, int]: # <<<<<<<<<<<<<< * return self.getOwnershipRange() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_11owner_range_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_11owner_range_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_11owner_range___get__(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_11owner_range___get__(struct PyPetscMatObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/Mat.pyx":5498 * """Matrix local row range.""" * def __get__(self) -> tuple[int, int]: * return self.getOwnershipRange() # <<<<<<<<<<<<<< * * property owner_ranges: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getOwnershipRange); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 5498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 5498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":5497 * property owner_range: * """Matrix local row range.""" * def __get__(self) -> tuple[int, int]: # <<<<<<<<<<<<<< * return self.getOwnershipRange() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.owner_range.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":5502 * property owner_ranges: * """Matrix row ranges.""" * def __get__(self) -> ArrayInt: # <<<<<<<<<<<<<< * return self.getOwnershipRanges() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_12owner_ranges_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_12owner_ranges_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_12owner_ranges___get__(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_12owner_ranges___get__(struct PyPetscMatObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/Mat.pyx":5503 * """Matrix row ranges.""" * def __get__(self) -> ArrayInt: * return self.getOwnershipRanges() # <<<<<<<<<<<<<< * * # */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getOwnershipRanges); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 5503, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 5503, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":5502 * property owner_ranges: * """Matrix row ranges.""" * def __get__(self) -> ArrayInt: # <<<<<<<<<<<<<< * return self.getOwnershipRanges() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.owner_ranges.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":5509 * property assembled: * """The boolean flag indicating if the matrix is assembled.""" * def __get__(self) -> bool: # <<<<<<<<<<<<<< * return self.isAssembled() * property symmetric: */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_9assembled_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_9assembled_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_9assembled___get__(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_9assembled___get__(struct PyPetscMatObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/Mat.pyx":5510 * """The boolean flag indicating if the matrix is assembled.""" * def __get__(self) -> bool: * return self.isAssembled() # <<<<<<<<<<<<<< * property symmetric: * """The boolean flag indicating if the matrix is symmetric.""" */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_isAssembled); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 5510, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 5510, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":5509 * property assembled: * """The boolean flag indicating if the matrix is assembled.""" * def __get__(self) -> bool: # <<<<<<<<<<<<<< * return self.isAssembled() * property symmetric: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.assembled.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":5513 * property symmetric: * """The boolean flag indicating if the matrix is symmetric.""" * def __get__(self) -> bool: # <<<<<<<<<<<<<< * return self.isSymmetric() * property hermitian: */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_9symmetric_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_9symmetric_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_9symmetric___get__(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_9symmetric___get__(struct PyPetscMatObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/Mat.pyx":5514 * """The boolean flag indicating if the matrix is symmetric.""" * def __get__(self) -> bool: * return self.isSymmetric() # <<<<<<<<<<<<<< * property hermitian: * """The boolean flag indicating if the matrix is Hermitian.""" */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_isSymmetric); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 5514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 5514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":5513 * property symmetric: * """The boolean flag indicating if the matrix is symmetric.""" * def __get__(self) -> bool: # <<<<<<<<<<<<<< * return self.isSymmetric() * property hermitian: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.symmetric.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":5517 * property hermitian: * """The boolean flag indicating if the matrix is Hermitian.""" * def __get__(self) -> bool: # <<<<<<<<<<<<<< * return self.isHermitian() * property structsymm: */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_9hermitian_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_9hermitian_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_9hermitian___get__(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_9hermitian___get__(struct PyPetscMatObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/Mat.pyx":5518 * """The boolean flag indicating if the matrix is Hermitian.""" * def __get__(self) -> bool: * return self.isHermitian() # <<<<<<<<<<<<<< * property structsymm: * """The boolean flag indicating if the matrix is structurally symmetric.""" */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_isHermitian); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 5518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 5518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":5517 * property hermitian: * """The boolean flag indicating if the matrix is Hermitian.""" * def __get__(self) -> bool: # <<<<<<<<<<<<<< * return self.isHermitian() * property structsymm: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.hermitian.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":5521 * property structsymm: * """The boolean flag indicating if the matrix is structurally symmetric.""" * def __get__(self) -> bool: # <<<<<<<<<<<<<< * return self.isStructurallySymmetric() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_10structsymm_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_10structsymm_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_10structsymm___get__(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_10structsymm___get__(struct PyPetscMatObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/Mat.pyx":5522 * """The boolean flag indicating if the matrix is structurally symmetric.""" * def __get__(self) -> bool: * return self.isStructurallySymmetric() # <<<<<<<<<<<<<< * * # TODO Stream */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_isStructurallySymmetric); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 5522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 5522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":5521 * property structsymm: * """The boolean flag indicating if the matrix is structurally symmetric.""" * def __get__(self) -> bool: # <<<<<<<<<<<<<< * return self.isStructurallySymmetric() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.structsymm.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":5525 * * # TODO Stream * def __dlpack__(self, stream=-1): # <<<<<<<<<<<<<< * return self.toDLPack('rw') * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_473__dlpack__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_472__dlpack__, "Mat.__dlpack__(self, stream=-1)\nSource code at petsc4py/PETSc/Mat.pyx:5525"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_473__dlpack__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v_stream = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dlpack__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stream,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_neg_1)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_stream); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 5525, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__dlpack__") < 0)) __PYX_ERR(46, 5525, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_stream = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__dlpack__", 0, 0, 1, __pyx_nargs); __PYX_ERR(46, 5525, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.__dlpack__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_472__dlpack__(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_stream); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_472__dlpack__(struct PyPetscMatObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_stream) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__dlpack__", 1); /* "petsc4py/PETSc/Mat.pyx":5526 * # TODO Stream * def __dlpack__(self, stream=-1): * return self.toDLPack('rw') # <<<<<<<<<<<<<< * * def __dlpack_device__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_toDLPack); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 5526, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_n_s_rw}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 5526, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":5525 * * # TODO Stream * def __dlpack__(self, stream=-1): # <<<<<<<<<<<<<< * return self.toDLPack('rw') * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.__dlpack__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":5528 * return self.toDLPack('rw') * * def __dlpack_device__(self): # <<<<<<<<<<<<<< * (dltype, devId, _, _, _) = mat_get_dlpack_ctx(self) * return (dltype, devId) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_475__dlpack_device__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_474__dlpack_device__, "Mat.__dlpack_device__(self)\nSource code at petsc4py/PETSc/Mat.pyx:5528"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_475__dlpack_device__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dlpack_device__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__dlpack_device__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__dlpack_device__", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_474__dlpack_device__(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_474__dlpack_device__(struct PyPetscMatObject *__pyx_v_self) { PyObject *__pyx_v_dltype = NULL; PyObject *__pyx_v_devId = NULL; CYTHON_UNUSED PyObject *__pyx_v__ = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__dlpack_device__", 1); /* "petsc4py/PETSc/Mat.pyx":5529 * * def __dlpack_device__(self): * (dltype, devId, _, _, _) = mat_get_dlpack_ctx(self) # <<<<<<<<<<<<<< * return (dltype, devId) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_mat_get_dlpack_ctx(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 5529, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 5)) { if (size > 5) __Pyx_RaiseTooManyValuesError(5); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(46, 5529, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 3); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 4); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); __pyx_t_4 = PyList_GET_ITEM(sequence, 2); __pyx_t_5 = PyList_GET_ITEM(sequence, 3); __pyx_t_6 = PyList_GET_ITEM(sequence, 4); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else { Py_ssize_t i; PyObject** temps[5] = {&__pyx_t_2,&__pyx_t_3,&__pyx_t_4,&__pyx_t_5,&__pyx_t_6}; for (i=0; i < 5; i++) { PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(46, 5529, __pyx_L1_error) __Pyx_GOTREF(item); *(temps[i]) = item; } } #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; PyObject** temps[5] = {&__pyx_t_2,&__pyx_t_3,&__pyx_t_4,&__pyx_t_5,&__pyx_t_6}; __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(46, 5529, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); for (index=0; index < 5; index++) { PyObject* item = __pyx_t_8(__pyx_t_7); if (unlikely(!item)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(item); *(temps[index]) = item; } if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 5) < 0) __PYX_ERR(46, 5529, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(46, 5529, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_dltype = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_devId = __pyx_t_3; __pyx_t_3 = 0; __pyx_v__ = __pyx_t_4; __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v__, __pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v__, __pyx_t_6); __pyx_t_6 = 0; /* "petsc4py/PETSc/Mat.pyx":5530 * def __dlpack_device__(self): * (dltype, devId, _, _, _) = mat_get_dlpack_ctx(self) * return (dltype, devId) # <<<<<<<<<<<<<< * * def toDLPack(self, mode: AccessModeSpec = 'rw') -> Any: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 5530, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_dltype); __Pyx_GIVEREF(__pyx_v_dltype); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_dltype)) __PYX_ERR(46, 5530, __pyx_L1_error); __Pyx_INCREF(__pyx_v_devId); __Pyx_GIVEREF(__pyx_v_devId); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_devId)) __PYX_ERR(46, 5530, __pyx_L1_error); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":5528 * return self.toDLPack('rw') * * def __dlpack_device__(self): # <<<<<<<<<<<<<< * (dltype, devId, _, _, _) = mat_get_dlpack_ctx(self) * return (dltype, devId) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.Mat.__dlpack_device__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_dltype); __Pyx_XDECREF(__pyx_v_devId); __Pyx_XDECREF(__pyx_v__); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":5532 * return (dltype, devId) * * def toDLPack(self, mode: AccessModeSpec = 'rw') -> Any: # <<<<<<<<<<<<<< * """Return a DLPack `PyCapsule` wrapping the vector data.""" * if mode is None: mode = 'rw' */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_477toDLPack(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3Mat_476toDLPack, "Mat.toDLPack(self, mode: AccessModeSpec = 'rw') -> Any\nReturn a DLPack `PyCapsule` wrapping the vector data.\nSource code at petsc4py/PETSc/Mat.pyx:5532"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_477toDLPack(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_mode = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("toDLPack (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mode,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_n_s_rw)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mode); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 5532, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "toDLPack") < 0)) __PYX_ERR(46, 5532, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_mode = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("toDLPack", 0, 0, 1, __pyx_nargs); __PYX_ERR(46, 5532, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Mat.toDLPack", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_476toDLPack(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_mode); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_476toDLPack(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_mode) { int64_t __pyx_v_ndim; PyObject *__pyx_v_device_type = NULL; PyObject *__pyx_v_device_id = NULL; PyObject *__pyx_v_shape = NULL; PyObject *__pyx_v_strides = NULL; PyObject *__pyx_v_hostmem = NULL; struct __pyx_t_8petsc4py_5PETSc_DLManagedTensor *__pyx_v_dlm_tensor; struct __pyx_t_8petsc4py_5PETSc_DLTensor *__pyx_v_dl_tensor; PetscScalar *__pyx_v_a; int64_t *__pyx_v_shape_strides; __pyx_t_8petsc4py_5PETSc_DLContext *__pyx_v_ctx; PyObject *__pyx_v_i = NULL; struct __pyx_t_8petsc4py_5PETSc_DLDataType *__pyx_v_dtype; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *(*__pyx_t_10)(PyObject *); int64_t __pyx_t_11; PetscErrorCode __pyx_t_12; enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType __pyx_t_13; int __pyx_t_14; Py_ssize_t __pyx_t_15; PyObject *(*__pyx_t_16)(PyObject *); Py_ssize_t __pyx_t_17; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("toDLPack", 0); __Pyx_INCREF(__pyx_v_mode); /* "petsc4py/PETSc/Mat.pyx":5534 * def toDLPack(self, mode: AccessModeSpec = 'rw') -> Any: * """Return a DLPack `PyCapsule` wrapping the vector data.""" * if mode is None: mode = 'rw' # <<<<<<<<<<<<<< * if mode is None: mode = 'rw' * if mode not in ['rw', 'r', 'w']: */ __pyx_t_1 = (__pyx_v_mode == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_n_s_rw); __Pyx_DECREF_SET(__pyx_v_mode, __pyx_n_s_rw); } /* "petsc4py/PETSc/Mat.pyx":5535 * """Return a DLPack `PyCapsule` wrapping the vector data.""" * if mode is None: mode = 'rw' * if mode is None: mode = 'rw' # <<<<<<<<<<<<<< * if mode not in ['rw', 'r', 'w']: * raise ValueError("Invalid mode: expected 'rw', 'r', or 'w'") */ __pyx_t_1 = (__pyx_v_mode == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_n_s_rw); __Pyx_DECREF_SET(__pyx_v_mode, __pyx_n_s_rw); } /* "petsc4py/PETSc/Mat.pyx":5536 * if mode is None: mode = 'rw' * if mode is None: mode = 'rw' * if mode not in ['rw', 'r', 'w']: # <<<<<<<<<<<<<< * raise ValueError("Invalid mode: expected 'rw', 'r', or 'w'") * */ __Pyx_INCREF(__pyx_v_mode); __pyx_t_2 = __pyx_v_mode; __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_rw, Py_NE)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(46, 5536, __pyx_L1_error) if (__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_r, Py_NE)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(46, 5536, __pyx_L1_error) if (__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_w, Py_NE)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(46, 5536, __pyx_L1_error) __pyx_t_1 = __pyx_t_3; __pyx_L6_bool_binop_done:; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = __pyx_t_1; if (unlikely(__pyx_t_3)) { /* "petsc4py/PETSc/Mat.pyx":5537 * if mode is None: mode = 'rw' * if mode not in ['rw', 'r', 'w']: * raise ValueError("Invalid mode: expected 'rw', 'r', or 'w'") # <<<<<<<<<<<<<< * * cdef int64_t ndim = 0 */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 5537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(46, 5537, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":5536 * if mode is None: mode = 'rw' * if mode is None: mode = 'rw' * if mode not in ['rw', 'r', 'w']: # <<<<<<<<<<<<<< * raise ValueError("Invalid mode: expected 'rw', 'r', or 'w'") * */ } /* "petsc4py/PETSc/Mat.pyx":5539 * raise ValueError("Invalid mode: expected 'rw', 'r', or 'w'") * * cdef int64_t ndim = 0 # <<<<<<<<<<<<<< * (device_type, device_id, ndim, shape, strides) = mat_get_dlpack_ctx(self) * hostmem = (device_type == kDLCPU) */ __pyx_v_ndim = 0; /* "petsc4py/PETSc/Mat.pyx":5540 * * cdef int64_t ndim = 0 * (device_type, device_id, ndim, shape, strides) = mat_get_dlpack_ctx(self) # <<<<<<<<<<<<<< * hostmem = (device_type == kDLCPU) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_mat_get_dlpack_ctx(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 5540, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { PyObject* sequence = __pyx_t_2; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 5)) { if (size > 5) __Pyx_RaiseTooManyValuesError(5); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(46, 5540, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_7 = PyTuple_GET_ITEM(sequence, 3); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 4); } else { __pyx_t_4 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); __pyx_t_7 = PyList_GET_ITEM(sequence, 3); __pyx_t_8 = PyList_GET_ITEM(sequence, 4); } __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); #else { Py_ssize_t i; PyObject** temps[5] = {&__pyx_t_4,&__pyx_t_5,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8}; for (i=0; i < 5; i++) { PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(46, 5540, __pyx_L1_error) __Pyx_GOTREF(item); *(temps[i]) = item; } } #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; PyObject** temps[5] = {&__pyx_t_4,&__pyx_t_5,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8}; __pyx_t_9 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(46, 5540, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_10 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); for (index=0; index < 5; index++) { PyObject* item = __pyx_t_10(__pyx_t_9); if (unlikely(!item)) goto __pyx_L9_unpacking_failed; __Pyx_GOTREF(item); *(temps[index]) = item; } if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 5) < 0) __PYX_ERR(46, 5540, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L10_unpacking_done; __pyx_L9_unpacking_failed:; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(46, 5540, __pyx_L1_error) __pyx_L10_unpacking_done:; } __pyx_t_11 = __Pyx_PyInt_As_int64_t(__pyx_t_6); if (unlikely((__pyx_t_11 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(46, 5540, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_device_type = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_device_id = __pyx_t_5; __pyx_t_5 = 0; __pyx_v_ndim = __pyx_t_11; __pyx_v_shape = __pyx_t_7; __pyx_t_7 = 0; __pyx_v_strides = __pyx_t_8; __pyx_t_8 = 0; /* "petsc4py/PETSc/Mat.pyx":5541 * cdef int64_t ndim = 0 * (device_type, device_id, ndim, shape, strides) = mat_get_dlpack_ctx(self) * hostmem = (device_type == kDLCPU) # <<<<<<<<<<<<<< * * cdef DLManagedTensor* dlm_tensor = malloc(sizeof(DLManagedTensor)) */ __pyx_t_2 = __Pyx_PyInt_From_enum____pyx_t_8petsc4py_5PETSc_PetscDLDeviceType(__pyx_e_8petsc4py_5PETSc_kDLCPU); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 5541, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_8 = PyObject_RichCompare(__pyx_v_device_type, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(46, 5541, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_hostmem = __pyx_t_8; __pyx_t_8 = 0; /* "petsc4py/PETSc/Mat.pyx":5543 * hostmem = (device_type == kDLCPU) * * cdef DLManagedTensor* dlm_tensor = malloc(sizeof(DLManagedTensor)) # <<<<<<<<<<<<<< * cdef DLTensor* dl_tensor = &dlm_tensor.dl_tensor * cdef PetscScalar *a = NULL */ __pyx_v_dlm_tensor = ((struct __pyx_t_8petsc4py_5PETSc_DLManagedTensor *)malloc((sizeof(struct __pyx_t_8petsc4py_5PETSc_DLManagedTensor)))); /* "petsc4py/PETSc/Mat.pyx":5544 * * cdef DLManagedTensor* dlm_tensor = malloc(sizeof(DLManagedTensor)) * cdef DLTensor* dl_tensor = &dlm_tensor.dl_tensor # <<<<<<<<<<<<<< * cdef PetscScalar *a = NULL * cdef int64_t* shape_strides = NULL */ __pyx_v_dl_tensor = (&__pyx_v_dlm_tensor->dl_tensor); /* "petsc4py/PETSc/Mat.pyx":5545 * cdef DLManagedTensor* dlm_tensor = malloc(sizeof(DLManagedTensor)) * cdef DLTensor* dl_tensor = &dlm_tensor.dl_tensor * cdef PetscScalar *a = NULL # <<<<<<<<<<<<<< * cdef int64_t* shape_strides = NULL * dl_tensor.byte_offset = 0 */ __pyx_v_a = NULL; /* "petsc4py/PETSc/Mat.pyx":5546 * cdef DLTensor* dl_tensor = &dlm_tensor.dl_tensor * cdef PetscScalar *a = NULL * cdef int64_t* shape_strides = NULL # <<<<<<<<<<<<<< * dl_tensor.byte_offset = 0 * */ __pyx_v_shape_strides = NULL; /* "petsc4py/PETSc/Mat.pyx":5547 * cdef PetscScalar *a = NULL * cdef int64_t* shape_strides = NULL * dl_tensor.byte_offset = 0 # <<<<<<<<<<<<<< * * # DLPack does not currently play well with our get/restore model */ __pyx_v_dl_tensor->byte_offset = 0; /* "petsc4py/PETSc/Mat.pyx":5553 * # and not modify memory requested with read access * # By restoring now, we guarantee the sanity of the ObjectState * if mode == 'w': # <<<<<<<<<<<<<< * if hostmem: * CHKERR( MatDenseGetArrayWrite(self.mat, &a) ) */ __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_w, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(46, 5553, __pyx_L1_error) if (__pyx_t_3) { /* "petsc4py/PETSc/Mat.pyx":5554 * # By restoring now, we guarantee the sanity of the ObjectState * if mode == 'w': * if hostmem: # <<<<<<<<<<<<<< * CHKERR( MatDenseGetArrayWrite(self.mat, &a) ) * CHKERR( MatDenseRestoreArrayWrite(self.mat, NULL) ) */ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_hostmem); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(46, 5554, __pyx_L1_error) if (__pyx_t_3) { /* "petsc4py/PETSc/Mat.pyx":5555 * if mode == 'w': * if hostmem: * CHKERR( MatDenseGetArrayWrite(self.mat, &a) ) # <<<<<<<<<<<<<< * CHKERR( MatDenseRestoreArrayWrite(self.mat, NULL) ) * else: */ __pyx_t_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDenseGetArrayWrite(__pyx_v_self->mat, ((PetscScalar **)(&__pyx_v_a)))); if (unlikely(__pyx_t_12 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5555, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":5556 * if hostmem: * CHKERR( MatDenseGetArrayWrite(self.mat, &a) ) * CHKERR( MatDenseRestoreArrayWrite(self.mat, NULL) ) # <<<<<<<<<<<<<< * else: * CHKERR( MatDenseCUDAGetArrayWrite(self.mat, &a) ) */ __pyx_t_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDenseRestoreArrayWrite(__pyx_v_self->mat, NULL)); if (unlikely(__pyx_t_12 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5556, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":5554 * # By restoring now, we guarantee the sanity of the ObjectState * if mode == 'w': * if hostmem: # <<<<<<<<<<<<<< * CHKERR( MatDenseGetArrayWrite(self.mat, &a) ) * CHKERR( MatDenseRestoreArrayWrite(self.mat, NULL) ) */ goto __pyx_L12; } /* "petsc4py/PETSc/Mat.pyx":5558 * CHKERR( MatDenseRestoreArrayWrite(self.mat, NULL) ) * else: * CHKERR( MatDenseCUDAGetArrayWrite(self.mat, &a) ) # <<<<<<<<<<<<<< * CHKERR( MatDenseCUDARestoreArrayWrite(self.mat, NULL) ) * elif mode == 'r': */ /*else*/ { __pyx_t_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDenseCUDAGetArrayWrite(__pyx_v_self->mat, ((PetscScalar **)(&__pyx_v_a)))); if (unlikely(__pyx_t_12 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5558, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":5559 * else: * CHKERR( MatDenseCUDAGetArrayWrite(self.mat, &a) ) * CHKERR( MatDenseCUDARestoreArrayWrite(self.mat, NULL) ) # <<<<<<<<<<<<<< * elif mode == 'r': * if hostmem: */ __pyx_t_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDenseCUDARestoreArrayWrite(__pyx_v_self->mat, NULL)); if (unlikely(__pyx_t_12 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5559, __pyx_L1_error) } __pyx_L12:; /* "petsc4py/PETSc/Mat.pyx":5553 * # and not modify memory requested with read access * # By restoring now, we guarantee the sanity of the ObjectState * if mode == 'w': # <<<<<<<<<<<<<< * if hostmem: * CHKERR( MatDenseGetArrayWrite(self.mat, &a) ) */ goto __pyx_L11; } /* "petsc4py/PETSc/Mat.pyx":5560 * CHKERR( MatDenseCUDAGetArrayWrite(self.mat, &a) ) * CHKERR( MatDenseCUDARestoreArrayWrite(self.mat, NULL) ) * elif mode == 'r': # <<<<<<<<<<<<<< * if hostmem: * CHKERR( MatDenseGetArrayRead(self.mat, &a) ) */ __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_r, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(46, 5560, __pyx_L1_error) if (__pyx_t_3) { /* "petsc4py/PETSc/Mat.pyx":5561 * CHKERR( MatDenseCUDARestoreArrayWrite(self.mat, NULL) ) * elif mode == 'r': * if hostmem: # <<<<<<<<<<<<<< * CHKERR( MatDenseGetArrayRead(self.mat, &a) ) * CHKERR( MatDenseRestoreArrayRead(self.mat, NULL) ) */ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_hostmem); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(46, 5561, __pyx_L1_error) if (__pyx_t_3) { /* "petsc4py/PETSc/Mat.pyx":5562 * elif mode == 'r': * if hostmem: * CHKERR( MatDenseGetArrayRead(self.mat, &a) ) # <<<<<<<<<<<<<< * CHKERR( MatDenseRestoreArrayRead(self.mat, NULL) ) * else: */ __pyx_t_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDenseGetArrayRead(__pyx_v_self->mat, ((PetscScalar const **)(&__pyx_v_a)))); if (unlikely(__pyx_t_12 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5562, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":5563 * if hostmem: * CHKERR( MatDenseGetArrayRead(self.mat, &a) ) * CHKERR( MatDenseRestoreArrayRead(self.mat, NULL) ) # <<<<<<<<<<<<<< * else: * CHKERR( MatDenseCUDAGetArrayRead(self.mat, &a) ) */ __pyx_t_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDenseRestoreArrayRead(__pyx_v_self->mat, NULL)); if (unlikely(__pyx_t_12 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5563, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":5561 * CHKERR( MatDenseCUDARestoreArrayWrite(self.mat, NULL) ) * elif mode == 'r': * if hostmem: # <<<<<<<<<<<<<< * CHKERR( MatDenseGetArrayRead(self.mat, &a) ) * CHKERR( MatDenseRestoreArrayRead(self.mat, NULL) ) */ goto __pyx_L13; } /* "petsc4py/PETSc/Mat.pyx":5565 * CHKERR( MatDenseRestoreArrayRead(self.mat, NULL) ) * else: * CHKERR( MatDenseCUDAGetArrayRead(self.mat, &a) ) # <<<<<<<<<<<<<< * CHKERR( MatDenseCUDARestoreArrayRead(self.mat, NULL) ) * else: */ /*else*/ { __pyx_t_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDenseCUDAGetArrayRead(__pyx_v_self->mat, ((PetscScalar const **)(&__pyx_v_a)))); if (unlikely(__pyx_t_12 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5565, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":5566 * else: * CHKERR( MatDenseCUDAGetArrayRead(self.mat, &a) ) * CHKERR( MatDenseCUDARestoreArrayRead(self.mat, NULL) ) # <<<<<<<<<<<<<< * else: * if hostmem: */ __pyx_t_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDenseCUDARestoreArrayRead(__pyx_v_self->mat, NULL)); if (unlikely(__pyx_t_12 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5566, __pyx_L1_error) } __pyx_L13:; /* "petsc4py/PETSc/Mat.pyx":5560 * CHKERR( MatDenseCUDAGetArrayWrite(self.mat, &a) ) * CHKERR( MatDenseCUDARestoreArrayWrite(self.mat, NULL) ) * elif mode == 'r': # <<<<<<<<<<<<<< * if hostmem: * CHKERR( MatDenseGetArrayRead(self.mat, &a) ) */ goto __pyx_L11; } /* "petsc4py/PETSc/Mat.pyx":5568 * CHKERR( MatDenseCUDARestoreArrayRead(self.mat, NULL) ) * else: * if hostmem: # <<<<<<<<<<<<<< * CHKERR( MatDenseGetArray(self.mat, &a) ) * CHKERR( MatDenseRestoreArray(self.mat, NULL) ) */ /*else*/ { __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_hostmem); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(46, 5568, __pyx_L1_error) if (__pyx_t_3) { /* "petsc4py/PETSc/Mat.pyx":5569 * else: * if hostmem: * CHKERR( MatDenseGetArray(self.mat, &a) ) # <<<<<<<<<<<<<< * CHKERR( MatDenseRestoreArray(self.mat, NULL) ) * else: */ __pyx_t_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDenseGetArray(__pyx_v_self->mat, ((PetscScalar **)(&__pyx_v_a)))); if (unlikely(__pyx_t_12 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5569, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":5570 * if hostmem: * CHKERR( MatDenseGetArray(self.mat, &a) ) * CHKERR( MatDenseRestoreArray(self.mat, NULL) ) # <<<<<<<<<<<<<< * else: * CHKERR( MatDenseCUDAGetArray(self.mat, &a) ) */ __pyx_t_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDenseRestoreArray(__pyx_v_self->mat, NULL)); if (unlikely(__pyx_t_12 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5570, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":5568 * CHKERR( MatDenseCUDARestoreArrayRead(self.mat, NULL) ) * else: * if hostmem: # <<<<<<<<<<<<<< * CHKERR( MatDenseGetArray(self.mat, &a) ) * CHKERR( MatDenseRestoreArray(self.mat, NULL) ) */ goto __pyx_L14; } /* "petsc4py/PETSc/Mat.pyx":5572 * CHKERR( MatDenseRestoreArray(self.mat, NULL) ) * else: * CHKERR( MatDenseCUDAGetArray(self.mat, &a) ) # <<<<<<<<<<<<<< * CHKERR( MatDenseCUDARestoreArray(self.mat, NULL) ) * dl_tensor.data = a */ /*else*/ { __pyx_t_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDenseCUDAGetArray(__pyx_v_self->mat, ((PetscScalar **)(&__pyx_v_a)))); if (unlikely(__pyx_t_12 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5572, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":5573 * else: * CHKERR( MatDenseCUDAGetArray(self.mat, &a) ) * CHKERR( MatDenseCUDARestoreArray(self.mat, NULL) ) # <<<<<<<<<<<<<< * dl_tensor.data = a * */ __pyx_t_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDenseCUDARestoreArray(__pyx_v_self->mat, NULL)); if (unlikely(__pyx_t_12 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5573, __pyx_L1_error) } __pyx_L14:; } __pyx_L11:; /* "petsc4py/PETSc/Mat.pyx":5574 * CHKERR( MatDenseCUDAGetArray(self.mat, &a) ) * CHKERR( MatDenseCUDARestoreArray(self.mat, NULL) ) * dl_tensor.data = a # <<<<<<<<<<<<<< * * cdef DLContext* ctx = &dl_tensor.ctx */ __pyx_v_dl_tensor->data = ((void *)__pyx_v_a); /* "petsc4py/PETSc/Mat.pyx":5576 * dl_tensor.data = a * * cdef DLContext* ctx = &dl_tensor.ctx # <<<<<<<<<<<<<< * ctx.device_type = device_type * ctx.device_id = device_id */ __pyx_v_ctx = (&__pyx_v_dl_tensor->ctx); /* "petsc4py/PETSc/Mat.pyx":5577 * * cdef DLContext* ctx = &dl_tensor.ctx * ctx.device_type = device_type # <<<<<<<<<<<<<< * ctx.device_id = device_id * shape_strides = malloc(sizeof(int64_t)*2*ndim) */ __pyx_t_13 = ((enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType)__Pyx_PyInt_As_enum____pyx_t_8petsc4py_5PETSc_PetscDLDeviceType(__pyx_v_device_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 5577, __pyx_L1_error) __pyx_v_ctx->device_type = __pyx_t_13; /* "petsc4py/PETSc/Mat.pyx":5578 * cdef DLContext* ctx = &dl_tensor.ctx * ctx.device_type = device_type * ctx.device_id = device_id # <<<<<<<<<<<<<< * shape_strides = malloc(sizeof(int64_t)*2*ndim) * for i in range(ndim): */ __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_v_device_id); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(46, 5578, __pyx_L1_error) __pyx_v_ctx->device_id = __pyx_t_14; /* "petsc4py/PETSc/Mat.pyx":5579 * ctx.device_type = device_type * ctx.device_id = device_id * shape_strides = malloc(sizeof(int64_t)*2*ndim) # <<<<<<<<<<<<<< * for i in range(ndim): * shape_strides[i] = shape[i] */ __pyx_v_shape_strides = ((int64_t *)malloc((((sizeof(int64_t)) * 2) * __pyx_v_ndim))); /* "petsc4py/PETSc/Mat.pyx":5580 * ctx.device_id = device_id * shape_strides = malloc(sizeof(int64_t)*2*ndim) * for i in range(ndim): # <<<<<<<<<<<<<< * shape_strides[i] = shape[i] * for i in range(ndim): */ __pyx_t_8 = __Pyx_PyInt_From_int64_t(__pyx_v_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(46, 5580, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 5580, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_8 = __pyx_t_2; __Pyx_INCREF(__pyx_t_8); __pyx_t_15 = 0; __pyx_t_16 = NULL; } else { __pyx_t_15 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(46, 5580, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_16 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_16)) __PYX_ERR(46, 5580, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { if (likely(!__pyx_t_16)) { if (likely(PyList_CheckExact(__pyx_t_8))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_8); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(46, 5580, __pyx_L1_error) #endif if (__pyx_t_15 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_15); __Pyx_INCREF(__pyx_t_2); __pyx_t_15++; if (unlikely((0 < 0))) __PYX_ERR(46, 5580, __pyx_L1_error) #else __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 5580, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_8); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(46, 5580, __pyx_L1_error) #endif if (__pyx_t_15 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_15); __Pyx_INCREF(__pyx_t_2); __pyx_t_15++; if (unlikely((0 < 0))) __PYX_ERR(46, 5580, __pyx_L1_error) #else __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 5580, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } } else { __pyx_t_2 = __pyx_t_16(__pyx_t_8); if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(46, 5580, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_2); } __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/Mat.pyx":5581 * shape_strides = malloc(sizeof(int64_t)*2*ndim) * for i in range(ndim): * shape_strides[i] = shape[i] # <<<<<<<<<<<<<< * for i in range(ndim): * shape_strides[i+ndim] = strides[i] */ __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_shape, __pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 5581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_11 = __Pyx_PyInt_As_int64_t(__pyx_t_2); if (unlikely((__pyx_t_11 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(46, 5581, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_17 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_17 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(46, 5581, __pyx_L1_error) (__pyx_v_shape_strides[__pyx_t_17]) = __pyx_t_11; /* "petsc4py/PETSc/Mat.pyx":5580 * ctx.device_id = device_id * shape_strides = malloc(sizeof(int64_t)*2*ndim) * for i in range(ndim): # <<<<<<<<<<<<<< * shape_strides[i] = shape[i] * for i in range(ndim): */ } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "petsc4py/PETSc/Mat.pyx":5582 * for i in range(ndim): * shape_strides[i] = shape[i] * for i in range(ndim): # <<<<<<<<<<<<<< * shape_strides[i+ndim] = strides[i] * dl_tensor.ndim = ndim */ __pyx_t_8 = __Pyx_PyInt_From_int64_t(__pyx_v_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(46, 5582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 5582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_8 = __pyx_t_2; __Pyx_INCREF(__pyx_t_8); __pyx_t_15 = 0; __pyx_t_16 = NULL; } else { __pyx_t_15 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(46, 5582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_16 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_16)) __PYX_ERR(46, 5582, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { if (likely(!__pyx_t_16)) { if (likely(PyList_CheckExact(__pyx_t_8))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_8); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(46, 5582, __pyx_L1_error) #endif if (__pyx_t_15 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_15); __Pyx_INCREF(__pyx_t_2); __pyx_t_15++; if (unlikely((0 < 0))) __PYX_ERR(46, 5582, __pyx_L1_error) #else __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 5582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_8); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(46, 5582, __pyx_L1_error) #endif if (__pyx_t_15 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_15); __Pyx_INCREF(__pyx_t_2); __pyx_t_15++; if (unlikely((0 < 0))) __PYX_ERR(46, 5582, __pyx_L1_error) #else __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 5582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } } else { __pyx_t_2 = __pyx_t_16(__pyx_t_8); if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(46, 5582, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_2); } __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/Mat.pyx":5583 * shape_strides[i] = shape[i] * for i in range(ndim): * shape_strides[i+ndim] = strides[i] # <<<<<<<<<<<<<< * dl_tensor.ndim = ndim * dl_tensor.shape = shape_strides */ __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_strides, __pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 5583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_11 = __Pyx_PyInt_As_int64_t(__pyx_t_2); if (unlikely((__pyx_t_11 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(46, 5583, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 5583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = PyNumber_Add(__pyx_v_i, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(46, 5583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_17 = __Pyx_PyIndex_AsSsize_t(__pyx_t_7); if (unlikely((__pyx_t_17 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(46, 5583, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; (__pyx_v_shape_strides[__pyx_t_17]) = __pyx_t_11; /* "petsc4py/PETSc/Mat.pyx":5582 * for i in range(ndim): * shape_strides[i] = shape[i] * for i in range(ndim): # <<<<<<<<<<<<<< * shape_strides[i+ndim] = strides[i] * dl_tensor.ndim = ndim */ } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "petsc4py/PETSc/Mat.pyx":5584 * for i in range(ndim): * shape_strides[i+ndim] = strides[i] * dl_tensor.ndim = ndim # <<<<<<<<<<<<<< * dl_tensor.shape = shape_strides * dl_tensor.strides = shape_strides + ndim */ __pyx_v_dl_tensor->ndim = __pyx_v_ndim; /* "petsc4py/PETSc/Mat.pyx":5585 * shape_strides[i+ndim] = strides[i] * dl_tensor.ndim = ndim * dl_tensor.shape = shape_strides # <<<<<<<<<<<<<< * dl_tensor.strides = shape_strides + ndim * */ __pyx_v_dl_tensor->shape = __pyx_v_shape_strides; /* "petsc4py/PETSc/Mat.pyx":5586 * dl_tensor.ndim = ndim * dl_tensor.shape = shape_strides * dl_tensor.strides = shape_strides + ndim # <<<<<<<<<<<<<< * * cdef DLDataType* dtype = &dl_tensor.dtype */ __pyx_v_dl_tensor->strides = (__pyx_v_shape_strides + __pyx_v_ndim); /* "petsc4py/PETSc/Mat.pyx":5588 * dl_tensor.strides = shape_strides + ndim * * cdef DLDataType* dtype = &dl_tensor.dtype # <<<<<<<<<<<<<< * dtype.code = DLDataTypeCode.kDLFloat * if sizeof(PetscScalar) == 8: */ __pyx_v_dtype = (&__pyx_v_dl_tensor->dtype); /* "petsc4py/PETSc/Mat.pyx":5589 * * cdef DLDataType* dtype = &dl_tensor.dtype * dtype.code = DLDataTypeCode.kDLFloat # <<<<<<<<<<<<<< * if sizeof(PetscScalar) == 8: * dtype.bits = 64 */ __pyx_v_dtype->code = ((uint8_t)__pyx_e_8petsc4py_5PETSc_kDLFloat); /* "petsc4py/PETSc/Mat.pyx":5590 * cdef DLDataType* dtype = &dl_tensor.dtype * dtype.code = DLDataTypeCode.kDLFloat * if sizeof(PetscScalar) == 8: # <<<<<<<<<<<<<< * dtype.bits = 64 * elif sizeof(PetscScalar) == 4: */ __pyx_t_3 = ((sizeof(PetscScalar)) == 8); if (__pyx_t_3) { /* "petsc4py/PETSc/Mat.pyx":5591 * dtype.code = DLDataTypeCode.kDLFloat * if sizeof(PetscScalar) == 8: * dtype.bits = 64 # <<<<<<<<<<<<<< * elif sizeof(PetscScalar) == 4: * dtype.bits = 32 */ __pyx_v_dtype->bits = ((uint8_t)64); /* "petsc4py/PETSc/Mat.pyx":5590 * cdef DLDataType* dtype = &dl_tensor.dtype * dtype.code = DLDataTypeCode.kDLFloat * if sizeof(PetscScalar) == 8: # <<<<<<<<<<<<<< * dtype.bits = 64 * elif sizeof(PetscScalar) == 4: */ goto __pyx_L21; } /* "petsc4py/PETSc/Mat.pyx":5592 * if sizeof(PetscScalar) == 8: * dtype.bits = 64 * elif sizeof(PetscScalar) == 4: # <<<<<<<<<<<<<< * dtype.bits = 32 * else: */ __pyx_t_3 = ((sizeof(PetscScalar)) == 4); if (likely(__pyx_t_3)) { /* "petsc4py/PETSc/Mat.pyx":5593 * dtype.bits = 64 * elif sizeof(PetscScalar) == 4: * dtype.bits = 32 # <<<<<<<<<<<<<< * else: * raise ValueError('Unsupported PetscScalar type') */ __pyx_v_dtype->bits = ((uint8_t)32); /* "petsc4py/PETSc/Mat.pyx":5592 * if sizeof(PetscScalar) == 8: * dtype.bits = 64 * elif sizeof(PetscScalar) == 4: # <<<<<<<<<<<<<< * dtype.bits = 32 * else: */ goto __pyx_L21; } /* "petsc4py/PETSc/Mat.pyx":5595 * dtype.bits = 32 * else: * raise ValueError('Unsupported PetscScalar type') # <<<<<<<<<<<<<< * dtype.lanes = 1 * dlm_tensor.manager_ctx = self.mat */ /*else*/ { __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(46, 5595, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __PYX_ERR(46, 5595, __pyx_L1_error) } __pyx_L21:; /* "petsc4py/PETSc/Mat.pyx":5596 * else: * raise ValueError('Unsupported PetscScalar type') * dtype.lanes = 1 # <<<<<<<<<<<<<< * dlm_tensor.manager_ctx = self.mat * CHKERR( PetscObjectReference(self.mat) ) */ __pyx_v_dtype->lanes = ((uint16_t)1); /* "petsc4py/PETSc/Mat.pyx":5597 * raise ValueError('Unsupported PetscScalar type') * dtype.lanes = 1 * dlm_tensor.manager_ctx = self.mat # <<<<<<<<<<<<<< * CHKERR( PetscObjectReference(self.mat) ) * dlm_tensor.manager_deleter = manager_deleter */ __pyx_v_dlm_tensor->manager_ctx = ((void *)__pyx_v_self->mat); /* "petsc4py/PETSc/Mat.pyx":5598 * dtype.lanes = 1 * dlm_tensor.manager_ctx = self.mat * CHKERR( PetscObjectReference(self.mat) ) # <<<<<<<<<<<<<< * dlm_tensor.manager_deleter = manager_deleter * dlm_tensor.del_obj = PetscDEALLOC */ __pyx_t_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectReference(((PetscObject)__pyx_v_self->mat))); if (unlikely(__pyx_t_12 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5598, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":5599 * dlm_tensor.manager_ctx = self.mat * CHKERR( PetscObjectReference(self.mat) ) * dlm_tensor.manager_deleter = manager_deleter # <<<<<<<<<<<<<< * dlm_tensor.del_obj = PetscDEALLOC * return PyCapsule_New(dlm_tensor, 'dltensor', pycapsule_deleter) */ __pyx_v_dlm_tensor->manager_deleter = __pyx_f_8petsc4py_5PETSc_manager_deleter; /* "petsc4py/PETSc/Mat.pyx":5600 * CHKERR( PetscObjectReference(self.mat) ) * dlm_tensor.manager_deleter = manager_deleter * dlm_tensor.del_obj = PetscDEALLOC # <<<<<<<<<<<<<< * return PyCapsule_New(dlm_tensor, 'dltensor', pycapsule_deleter) * */ __pyx_v_dlm_tensor->del_obj = ((__pyx_t_8petsc4py_5PETSc_dlpack_manager_del_obj)__pyx_f_8petsc4py_5PETSc_PetscDEALLOC); /* "petsc4py/PETSc/Mat.pyx":5601 * dlm_tensor.manager_deleter = manager_deleter * dlm_tensor.del_obj = PetscDEALLOC * return PyCapsule_New(dlm_tensor, 'dltensor', pycapsule_deleter) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF(__pyx_r); __pyx_t_8 = PyCapsule_New(__pyx_v_dlm_tensor, ((char const *)"dltensor"), __pyx_f_8petsc4py_5PETSc_pycapsule_deleter); if (unlikely(!__pyx_t_8)) __PYX_ERR(46, 5601, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_r = __pyx_t_8; __pyx_t_8 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":5532 * return (dltype, devId) * * def toDLPack(self, mode: AccessModeSpec = 'rw') -> Any: # <<<<<<<<<<<<<< * """Return a DLPack `PyCapsule` wrapping the vector data.""" * if mode is None: mode = 'rw' */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("petsc4py.PETSc.Mat.toDLPack", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_device_type); __Pyx_XDECREF(__pyx_v_device_id); __Pyx_XDECREF(__pyx_v_shape); __Pyx_XDECREF(__pyx_v_strides); __Pyx_XDECREF(__pyx_v_hostmem); __Pyx_XDECREF(__pyx_v_i); __Pyx_XDECREF(__pyx_v_mode); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":5615 * # * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.nsp * self.nsp = NULL */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_9NullSpace_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_9NullSpace_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_8petsc4py_5PETSc_9NullSpace___cinit__(((struct PyPetscNullSpaceObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_9NullSpace___cinit__(struct PyPetscNullSpaceObject *__pyx_v_self) { int __pyx_r; /* "petsc4py/PETSc/Mat.pyx":5616 * * def __cinit__(self): * self.obj = &self.nsp # <<<<<<<<<<<<<< * self.nsp = NULL * */ __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->nsp)); /* "petsc4py/PETSc/Mat.pyx":5617 * def __cinit__(self): * self.obj = &self.nsp * self.nsp = NULL # <<<<<<<<<<<<<< * * def __call__(self, vec): */ __pyx_v_self->nsp = NULL; /* "petsc4py/PETSc/Mat.pyx":5615 * # * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.nsp * self.nsp = NULL */ /* function exit code */ __pyx_r = 0; return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":5619 * self.nsp = NULL * * def __call__(self, vec): # <<<<<<<<<<<<<< * self.remove(vec) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_9NullSpace_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_9NullSpace_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_vec = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vec)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 5619, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__call__") < 0)) __PYX_ERR(46, 5619, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); } __pyx_v_vec = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 5619, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.NullSpace.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_9NullSpace_2__call__(((struct PyPetscNullSpaceObject *)__pyx_v_self), __pyx_v_vec); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_9NullSpace_2__call__(struct PyPetscNullSpaceObject *__pyx_v_self, PyObject *__pyx_v_vec) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 1); /* "petsc4py/PETSc/Mat.pyx":5620 * * def __call__(self, vec): * self.remove(vec) # <<<<<<<<<<<<<< * * # */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_remove); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 5620, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_vec}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 5620, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Mat.pyx":5619 * self.nsp = NULL * * def __call__(self, vec): # <<<<<<<<<<<<<< * self.remove(vec) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.NullSpace.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":5624 * # * * def view(self, Viewer viewer=None) -> None: # <<<<<<<<<<<<<< * """View the null space. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_9NullSpace_5view(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_9NullSpace_4view, "NullSpace.view(self, viewer: Viewer | None = None) -> None\nView the null space.\n\n Collective.\n\n Parameters\n ----------\n viewer\n A `Viewer` instance or `None` for the default viewer.\n\n See Also\n --------\n Viewer, petsc.MatNullSpaceView\n\n \nSource code at petsc4py/PETSc/Mat.pyx:5624"); static PyObject *__pyx_pw_8petsc4py_5PETSc_9NullSpace_5view(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscViewerObject *__pyx_v_viewer = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("view (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscViewerObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_viewer); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 5624, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "view") < 0)) __PYX_ERR(46, 5624, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, __pyx_nargs); __PYX_ERR(46, 5624, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.NullSpace.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(46, 5624, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_9NullSpace_4view(((struct PyPetscNullSpaceObject *)__pyx_v_self), __pyx_v_viewer); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_9NullSpace_4view(struct PyPetscNullSpaceObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer) { PetscViewer __pyx_v_vwr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscViewer __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("view", 1); /* "petsc4py/PETSc/Mat.pyx":5639 * * """ * cdef PetscViewer vwr = NULL # <<<<<<<<<<<<<< * if viewer is not None: vwr = viewer.vwr * CHKERR( MatNullSpaceView(self.nsp, vwr) ) */ __pyx_v_vwr = NULL; /* "petsc4py/PETSc/Mat.pyx":5640 * """ * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr # <<<<<<<<<<<<<< * CHKERR( MatNullSpaceView(self.nsp, vwr) ) * */ __pyx_t_1 = (((PyObject *)__pyx_v_viewer) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_viewer->vwr; __pyx_v_vwr = __pyx_t_2; } /* "petsc4py/PETSc/Mat.pyx":5641 * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr * CHKERR( MatNullSpaceView(self.nsp, vwr) ) # <<<<<<<<<<<<<< * * def destroy(self) -> Self: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatNullSpaceView(__pyx_v_self->nsp, __pyx_v_vwr)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5641, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":5624 * # * * def view(self, Viewer viewer=None) -> None: # <<<<<<<<<<<<<< * """View the null space. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.NullSpace.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":5643 * CHKERR( MatNullSpaceView(self.nsp, vwr) ) * * def destroy(self) -> Self: # <<<<<<<<<<<<<< * """Destroy the null space. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_9NullSpace_7destroy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_9NullSpace_6destroy, "NullSpace.destroy(self) -> Self\nDestroy the null space.\n\n Collective.\n\n See Also\n --------\n create, petsc.MatNullSpaceDestroy\n\n \nSource code at petsc4py/PETSc/Mat.pyx:5643"); static PyObject *__pyx_pw_8petsc4py_5PETSc_9NullSpace_7destroy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("destroy (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_9NullSpace_6destroy(((struct PyPetscNullSpaceObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_9NullSpace_6destroy(struct PyPetscNullSpaceObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("destroy", 1); /* "petsc4py/PETSc/Mat.pyx":5653 * * """ * CHKERR( MatNullSpaceDestroy(&self.nsp) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatNullSpaceDestroy((&__pyx_v_self->nsp))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5653, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":5654 * """ * CHKERR( MatNullSpaceDestroy(&self.nsp) ) * return self # <<<<<<<<<<<<<< * * def create( */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":5643 * CHKERR( MatNullSpaceView(self.nsp, vwr) ) * * def destroy(self) -> Self: # <<<<<<<<<<<<<< * """Destroy the null space. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.NullSpace.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":5656 * return self * * def create( # <<<<<<<<<<<<<< * self, * constant: bool = False, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_9NullSpace_9create(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_9NullSpace_8create, "NullSpace.create(self, constant: bool = False, vectors: Sequence[Vec] = (), comm=None) -> Self\nCreate the null space.\n\n Collective.\n\n Parameters\n ----------\n constant\n A flag to indicate the null space contains the constant vector.\n vectors\n The sequence of vectors that span the null space.\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n destroy, petsc.MatNullSpaceCreate\n\n \nSource code at petsc4py/PETSc/Mat.pyx:5656"); static PyObject *__pyx_pw_8petsc4py_5PETSc_9NullSpace_9create(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_constant = 0; PyObject *__pyx_v_vectors = 0; PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_constant,&__pyx_n_s_vectors,&__pyx_n_s_comm,0}; /* "petsc4py/PETSc/Mat.pyx":5658 * def create( * self, * constant: bool = False, # <<<<<<<<<<<<<< * vectors: Sequence[Vec] = (), * comm=None */ values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False)); /* "petsc4py/PETSc/Mat.pyx":5659 * self, * constant: bool = False, * vectors: Sequence[Vec] = (), # <<<<<<<<<<<<<< * comm=None * ) -> Self: */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_empty_tuple)); /* "petsc4py/PETSc/Mat.pyx":5660 * constant: bool = False, * vectors: Sequence[Vec] = (), * comm=None # <<<<<<<<<<<<<< * ) -> Self: * """Create the null space. */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_constant); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 5656, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vectors); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 5656, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 5656, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "create") < 0)) __PYX_ERR(46, 5656, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_constant = values[0]; __pyx_v_vectors = values[1]; __pyx_v_comm = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("create", 0, 0, 3, __pyx_nargs); __PYX_ERR(46, 5656, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.NullSpace.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_9NullSpace_8create(((struct PyPetscNullSpaceObject *)__pyx_v_self), __pyx_v_constant, __pyx_v_vectors, __pyx_v_comm); /* "petsc4py/PETSc/Mat.pyx":5656 * return self * * def create( # <<<<<<<<<<<<<< * self, * constant: bool = False, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_9NullSpace_8create(struct PyPetscNullSpaceObject *__pyx_v_self, PyObject *__pyx_v_constant, PyObject *__pyx_v_vectors, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PetscBool __pyx_v_has_const; PetscInt __pyx_v_i; PetscInt __pyx_v_nv; Vec *__pyx_v_v; CYTHON_UNUSED PyObject *__pyx_v_tmp2 = 0; MatNullSpace __pyx_v_newnsp; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; int __pyx_t_2; Py_ssize_t __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PetscInt __pyx_t_6; Vec __pyx_t_7; PetscErrorCode __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create", 1); /* "petsc4py/PETSc/Mat.pyx":5680 * * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscBool has_const = PETSC_FALSE * if constant: has_const = PETSC_TRUE */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(46, 5680, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/Mat.pyx":5681 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscBool has_const = PETSC_FALSE # <<<<<<<<<<<<<< * if constant: has_const = PETSC_TRUE * cdef PetscInt i = 0, nv = len(vectors) */ __pyx_v_has_const = PETSC_FALSE; /* "petsc4py/PETSc/Mat.pyx":5682 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscBool has_const = PETSC_FALSE * if constant: has_const = PETSC_TRUE # <<<<<<<<<<<<<< * cdef PetscInt i = 0, nv = len(vectors) * cdef PetscVec *v = NULL */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_constant); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(46, 5682, __pyx_L1_error) if (__pyx_t_2) { __pyx_v_has_const = PETSC_TRUE; } /* "petsc4py/PETSc/Mat.pyx":5683 * cdef PetscBool has_const = PETSC_FALSE * if constant: has_const = PETSC_TRUE * cdef PetscInt i = 0, nv = len(vectors) # <<<<<<<<<<<<<< * cdef PetscVec *v = NULL * cdef object tmp2 = oarray_p(empty_p(nv), NULL, &v) */ __pyx_v_i = 0; __pyx_t_3 = PyObject_Length(__pyx_v_vectors); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(46, 5683, __pyx_L1_error) __pyx_v_nv = ((PetscInt)__pyx_t_3); /* "petsc4py/PETSc/Mat.pyx":5684 * if constant: has_const = PETSC_TRUE * cdef PetscInt i = 0, nv = len(vectors) * cdef PetscVec *v = NULL # <<<<<<<<<<<<<< * cdef object tmp2 = oarray_p(empty_p(nv), NULL, &v) * for i from 0 <= i < nv: */ __pyx_v_v = NULL; /* "petsc4py/PETSc/Mat.pyx":5685 * cdef PetscInt i = 0, nv = len(vectors) * cdef PetscVec *v = NULL * cdef object tmp2 = oarray_p(empty_p(nv), NULL, &v) # <<<<<<<<<<<<<< * for i from 0 <= i < nv: * v[i] = ((vectors[i])).vec */ __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_nv)); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 5685, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_4, NULL, ((void **)(&__pyx_v_v)))); if (unlikely(!__pyx_t_5)) __PYX_ERR(46, 5685, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_tmp2 = __pyx_t_5; __pyx_t_5 = 0; /* "petsc4py/PETSc/Mat.pyx":5686 * cdef PetscVec *v = NULL * cdef object tmp2 = oarray_p(empty_p(nv), NULL, &v) * for i from 0 <= i < nv: # <<<<<<<<<<<<<< * v[i] = ((vectors[i])).vec * cdef PetscNullSpace newnsp = NULL */ __pyx_t_6 = __pyx_v_nv; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_6; __pyx_v_i++) { /* "petsc4py/PETSc/Mat.pyx":5687 * cdef object tmp2 = oarray_p(empty_p(nv), NULL, &v) * for i from 0 <= i < nv: * v[i] = ((vectors[i])).vec # <<<<<<<<<<<<<< * cdef PetscNullSpace newnsp = NULL * CHKERR( MatNullSpaceCreate(ccomm, has_const, nv, v, &newnsp) ) */ __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_vectors, ((Py_ssize_t)__pyx_v_i), Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(46, 5687, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (!(likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_8petsc4py_5PETSc_Vec)))) __PYX_ERR(46, 5687, __pyx_L1_error) __pyx_t_7 = ((struct PyPetscVecObject *)__pyx_t_5)->vec; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; (__pyx_v_v[__pyx_v_i]) = __pyx_t_7; } /* "petsc4py/PETSc/Mat.pyx":5688 * for i from 0 <= i < nv: * v[i] = ((vectors[i])).vec * cdef PetscNullSpace newnsp = NULL # <<<<<<<<<<<<<< * CHKERR( MatNullSpaceCreate(ccomm, has_const, nv, v, &newnsp) ) * CHKERR( PetscCLEAR(self.obj) ); self.nsp = newnsp */ __pyx_v_newnsp = NULL; /* "petsc4py/PETSc/Mat.pyx":5689 * v[i] = ((vectors[i])).vec * cdef PetscNullSpace newnsp = NULL * CHKERR( MatNullSpaceCreate(ccomm, has_const, nv, v, &newnsp) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.nsp = newnsp * return self */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatNullSpaceCreate(__pyx_v_ccomm, __pyx_v_has_const, __pyx_v_nv, __pyx_v_v, (&__pyx_v_newnsp))); if (unlikely(__pyx_t_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5689, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":5690 * cdef PetscNullSpace newnsp = NULL * CHKERR( MatNullSpaceCreate(ccomm, has_const, nv, v, &newnsp) ) * CHKERR( PetscCLEAR(self.obj) ); self.nsp = newnsp # <<<<<<<<<<<<<< * return self * */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5690, __pyx_L1_error) __pyx_v_self->nsp = __pyx_v_newnsp; /* "petsc4py/PETSc/Mat.pyx":5691 * CHKERR( MatNullSpaceCreate(ccomm, has_const, nv, v, &newnsp) ) * CHKERR( PetscCLEAR(self.obj) ); self.nsp = newnsp * return self # <<<<<<<<<<<<<< * * def createRigidBody(self, Vec coords) -> Self: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":5656 * return self * * def create( # <<<<<<<<<<<<<< * self, * constant: bool = False, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.NullSpace.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_tmp2); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":5693 * return self * * def createRigidBody(self, Vec coords) -> Self: # <<<<<<<<<<<<<< * """Create rigid body modes from coordinates. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_9NullSpace_11createRigidBody(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_9NullSpace_10createRigidBody, "NullSpace.createRigidBody(self, coords: Vec) -> Self\nCreate rigid body modes from coordinates.\n\n Collective.\n\n Parameters\n ----------\n coords\n The block coordinates of each node.\n Requires the block size to have been set.\n\n See Also\n --------\n petsc.MatNullSpaceCreateRigidBody\n\n \nSource code at petsc4py/PETSc/Mat.pyx:5693"); static PyObject *__pyx_pw_8petsc4py_5PETSc_9NullSpace_11createRigidBody(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_coords = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createRigidBody (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_coords,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_coords)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 5693, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createRigidBody") < 0)) __PYX_ERR(46, 5693, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_coords = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createRigidBody", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 5693, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.NullSpace.createRigidBody", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "coords", 0))) __PYX_ERR(46, 5693, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_9NullSpace_10createRigidBody(((struct PyPetscNullSpaceObject *)__pyx_v_self), __pyx_v_coords); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_9NullSpace_10createRigidBody(struct PyPetscNullSpaceObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_coords) { MatNullSpace __pyx_v_newnsp; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createRigidBody", 1); /* "petsc4py/PETSc/Mat.pyx":5709 * * """ * cdef PetscNullSpace newnsp = NULL # <<<<<<<<<<<<<< * CHKERR( MatNullSpaceCreateRigidBody(coords.vec, &newnsp) ) * CHKERR( PetscCLEAR(self.obj) ); self.nsp = newnsp */ __pyx_v_newnsp = NULL; /* "petsc4py/PETSc/Mat.pyx":5710 * """ * cdef PetscNullSpace newnsp = NULL * CHKERR( MatNullSpaceCreateRigidBody(coords.vec, &newnsp) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.nsp = newnsp * return self */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatNullSpaceCreateRigidBody(__pyx_v_coords->vec, (&__pyx_v_newnsp))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5710, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":5711 * cdef PetscNullSpace newnsp = NULL * CHKERR( MatNullSpaceCreateRigidBody(coords.vec, &newnsp) ) * CHKERR( PetscCLEAR(self.obj) ); self.nsp = newnsp # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5711, __pyx_L1_error) __pyx_v_self->nsp = __pyx_v_newnsp; /* "petsc4py/PETSc/Mat.pyx":5712 * CHKERR( MatNullSpaceCreateRigidBody(coords.vec, &newnsp) ) * CHKERR( PetscCLEAR(self.obj) ); self.nsp = newnsp * return self # <<<<<<<<<<<<<< * * def setFunction( */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":5693 * return self * * def createRigidBody(self, Vec coords) -> Self: # <<<<<<<<<<<<<< * """Create rigid body modes from coordinates. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.NullSpace.createRigidBody", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":5714 * return self * * def setFunction( # <<<<<<<<<<<<<< * self, * function: MatNullFunction, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_9NullSpace_13setFunction(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_9NullSpace_12setFunction, "NullSpace.setFunction(self, function: MatNullFunction, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nSet the callback to remove the nullspace.\n\n Logically collective.\n\n Parameters\n ----------\n function\n The callback.\n args\n Positional arguments for the callback.\n kargs\n Keyword arguments for the callback.\n\n See Also\n --------\n getFunction, petsc.MatNullSpaceSetFunction\n\n \nSource code at petsc4py/PETSc/Mat.pyx:5714"); static PyObject *__pyx_pw_8petsc4py_5PETSc_9NullSpace_13setFunction(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_function = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFunction (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_function,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; /* "petsc4py/PETSc/Mat.pyx":5717 * self, * function: MatNullFunction, * args: tuple[Any, ...] | None = None, # <<<<<<<<<<<<<< * kargs: dict[str, Any] | None = None, * ) -> None: */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Mat.pyx":5718 * function: MatNullFunction, * args: tuple[Any, ...] | None = None, * kargs: dict[str, Any] | None = None, # <<<<<<<<<<<<<< * ) -> None: * """Set the callback to remove the nullspace. */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_function)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 5714, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 5714, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 5714, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setFunction") < 0)) __PYX_ERR(46, 5714, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_function = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setFunction", 0, 1, 3, __pyx_nargs); __PYX_ERR(46, 5714, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.NullSpace.setFunction", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_9NullSpace_12setFunction(((struct PyPetscNullSpaceObject *)__pyx_v_self), __pyx_v_function, __pyx_v_args, __pyx_v_kargs); /* "petsc4py/PETSc/Mat.pyx":5714 * return self * * def setFunction( # <<<<<<<<<<<<<< * self, * function: MatNullFunction, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_9NullSpace_12setFunction(struct PyPetscNullSpaceObject *__pyx_v_self, PyObject *__pyx_v_function, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFunction", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/Mat.pyx":5738 * * """ * if function is not None: # <<<<<<<<<<<<<< * CHKERR( MatNullSpaceSetFunction( * self.nsp, NullSpace_Function, NULL) ) */ __pyx_t_1 = (__pyx_v_function != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/Mat.pyx":5739 * """ * if function is not None: * CHKERR( MatNullSpaceSetFunction( # <<<<<<<<<<<<<< * self.nsp, NullSpace_Function, NULL) ) * if args is None: args = () */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatNullSpaceSetFunction(__pyx_v_self->nsp, __pyx_f_8petsc4py_5PETSc_NullSpace_Function, NULL)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5739, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":5741 * CHKERR( MatNullSpaceSetFunction( * self.nsp, NullSpace_Function, NULL) ) * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * self.set_attr('__function__', (function, args, kargs)) */ __pyx_t_1 = (__pyx_v_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/Mat.pyx":5742 * self.nsp, NullSpace_Function, NULL) ) * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * self.set_attr('__function__', (function, args, kargs)) * else: */ __pyx_t_1 = (__pyx_v_kargs == Py_None); if (__pyx_t_1) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 5742, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "petsc4py/PETSc/Mat.pyx":5743 * if args is None: args = () * if kargs is None: kargs = {} * self.set_attr('__function__', (function, args, kargs)) # <<<<<<<<<<<<<< * else: * CHKERR( MatNullSpaceSetFunction(self.nsp, NULL, NULL) ) */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 5743, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_function); __Pyx_GIVEREF(__pyx_v_function); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_function)) __PYX_ERR(46, 5743, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args)) __PYX_ERR(46, 5743, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs)) __PYX_ERR(46, 5743, __pyx_L1_error); __pyx_t_4 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_NullSpace *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__function__"), __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 5743, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/Mat.pyx":5738 * * """ * if function is not None: # <<<<<<<<<<<<<< * CHKERR( MatNullSpaceSetFunction( * self.nsp, NullSpace_Function, NULL) ) */ goto __pyx_L3; } /* "petsc4py/PETSc/Mat.pyx":5745 * self.set_attr('__function__', (function, args, kargs)) * else: * CHKERR( MatNullSpaceSetFunction(self.nsp, NULL, NULL) ) # <<<<<<<<<<<<<< * self.set_attr('__function__', None) * # */ /*else*/ { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatNullSpaceSetFunction(__pyx_v_self->nsp, NULL, NULL)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5745, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":5746 * else: * CHKERR( MatNullSpaceSetFunction(self.nsp, NULL, NULL) ) * self.set_attr('__function__', None) # <<<<<<<<<<<<<< * # * */ __pyx_t_4 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_NullSpace *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__function__"), Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 5746, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_L3:; /* "petsc4py/PETSc/Mat.pyx":5714 * return self * * def setFunction( # <<<<<<<<<<<<<< * self, * function: MatNullFunction, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.NullSpace.setFunction", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":5749 * # * * def hasConstant(self) -> bool: # <<<<<<<<<<<<<< * """Return whether the null space contains the constant. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_9NullSpace_15hasConstant(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_9NullSpace_14hasConstant, "NullSpace.hasConstant(self) -> bool\nReturn whether the null space contains the constant.\n\n Not collective.\n\n See Also\n --------\n petsc.MatNullSpaceGetVecs\n\n \nSource code at petsc4py/PETSc/Mat.pyx:5749"); static PyObject *__pyx_pw_8petsc4py_5PETSc_9NullSpace_15hasConstant(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("hasConstant (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("hasConstant", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "hasConstant", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_9NullSpace_14hasConstant(((struct PyPetscNullSpaceObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_9NullSpace_14hasConstant(struct PyPetscNullSpaceObject *__pyx_v_self) { PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("hasConstant", 1); /* "petsc4py/PETSc/Mat.pyx":5759 * * """ * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( MatNullSpaceGetVecs(self.nsp, &flag, NULL, NULL) ) * return toBool(flag) */ __pyx_v_flag = PETSC_FALSE; /* "petsc4py/PETSc/Mat.pyx":5760 * """ * cdef PetscBool flag = PETSC_FALSE * CHKERR( MatNullSpaceGetVecs(self.nsp, &flag, NULL, NULL) ) # <<<<<<<<<<<<<< * return toBool(flag) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatNullSpaceGetVecs(__pyx_v_self->nsp, (&__pyx_v_flag), NULL, NULL)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5760, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":5761 * cdef PetscBool flag = PETSC_FALSE * CHKERR( MatNullSpaceGetVecs(self.nsp, &flag, NULL, NULL) ) * return toBool(flag) # <<<<<<<<<<<<<< * * def getVecs(self) -> list[Vec]: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 5761, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":5749 * # * * def hasConstant(self) -> bool: # <<<<<<<<<<<<<< * """Return whether the null space contains the constant. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.NullSpace.hasConstant", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":5763 * return toBool(flag) * * def getVecs(self) -> list[Vec]: # <<<<<<<<<<<<<< * """Return the vectors defining the null space. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_9NullSpace_17getVecs(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_9NullSpace_16getVecs, "NullSpace.getVecs(self) -> list[Vec]\nReturn the vectors defining the null space.\n\n Not collective.\n\n See Also\n --------\n petsc.MatNullSpaceGetVecs\n\n \nSource code at petsc4py/PETSc/Mat.pyx:5763"); static PyObject *__pyx_pw_8petsc4py_5PETSc_9NullSpace_17getVecs(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getVecs (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getVecs", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getVecs", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_9NullSpace_16getVecs(((struct PyPetscNullSpaceObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_9NullSpace_16getVecs(struct PyPetscNullSpaceObject *__pyx_v_self) { PetscInt __pyx_v_i; PetscInt __pyx_v_nv; Vec const *__pyx_v_v; struct PyPetscVecObject *__pyx_v_vec = 0; PyObject *__pyx_v_vectors = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscInt __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getVecs", 1); /* "petsc4py/PETSc/Mat.pyx":5773 * * """ * cdef PetscInt i = 0, nv = 0 # <<<<<<<<<<<<<< * cdef const PetscVec *v = NULL * CHKERR( MatNullSpaceGetVecs(self.nsp, NULL, &nv, &v) ) */ __pyx_v_i = 0; __pyx_v_nv = 0; /* "petsc4py/PETSc/Mat.pyx":5774 * """ * cdef PetscInt i = 0, nv = 0 * cdef const PetscVec *v = NULL # <<<<<<<<<<<<<< * CHKERR( MatNullSpaceGetVecs(self.nsp, NULL, &nv, &v) ) * cdef Vec vec = None */ __pyx_v_v = NULL; /* "petsc4py/PETSc/Mat.pyx":5775 * cdef PetscInt i = 0, nv = 0 * cdef const PetscVec *v = NULL * CHKERR( MatNullSpaceGetVecs(self.nsp, NULL, &nv, &v) ) # <<<<<<<<<<<<<< * cdef Vec vec = None * cdef list vectors = [] */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatNullSpaceGetVecs(__pyx_v_self->nsp, NULL, (&__pyx_v_nv), (&__pyx_v_v))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5775, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":5776 * cdef const PetscVec *v = NULL * CHKERR( MatNullSpaceGetVecs(self.nsp, NULL, &nv, &v) ) * cdef Vec vec = None # <<<<<<<<<<<<<< * cdef list vectors = [] * for i from 0 <= i < nv: */ __Pyx_INCREF(Py_None); __pyx_v_vec = ((struct PyPetscVecObject *)Py_None); /* "petsc4py/PETSc/Mat.pyx":5777 * CHKERR( MatNullSpaceGetVecs(self.nsp, NULL, &nv, &v) ) * cdef Vec vec = None * cdef list vectors = [] # <<<<<<<<<<<<<< * for i from 0 <= i < nv: * vec = Vec() */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 5777, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_vectors = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/Mat.pyx":5778 * cdef Vec vec = None * cdef list vectors = [] * for i from 0 <= i < nv: # <<<<<<<<<<<<<< * vec = Vec() * vec.vec = v[i] */ __pyx_t_3 = __pyx_v_nv; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { /* "petsc4py/PETSc/Mat.pyx":5779 * cdef list vectors = [] * for i from 0 <= i < nv: * vec = Vec() # <<<<<<<<<<<<<< * vec.vec = v[i] * CHKERR( PetscINCREF(vec.obj) ) */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 5779, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_vec, ((struct PyPetscVecObject *)__pyx_t_2)); __pyx_t_2 = 0; /* "petsc4py/PETSc/Mat.pyx":5780 * for i from 0 <= i < nv: * vec = Vec() * vec.vec = v[i] # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(vec.obj) ) * vectors.append(vec) */ __pyx_v_vec->vec = (__pyx_v_v[__pyx_v_i]); /* "petsc4py/PETSc/Mat.pyx":5781 * vec = Vec() * vec.vec = v[i] * CHKERR( PetscINCREF(vec.obj) ) # <<<<<<<<<<<<<< * vectors.append(vec) * return vectors */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_vec->__pyx_base.obj)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5781, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":5782 * vec.vec = v[i] * CHKERR( PetscINCREF(vec.obj) ) * vectors.append(vec) # <<<<<<<<<<<<<< * return vectors * */ __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_vectors, ((PyObject *)__pyx_v_vec)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(46, 5782, __pyx_L1_error) } /* "petsc4py/PETSc/Mat.pyx":5783 * CHKERR( PetscINCREF(vec.obj) ) * vectors.append(vec) * return vectors # <<<<<<<<<<<<<< * * def getFunction(self) -> MatNullFunction: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_vectors); __pyx_r = __pyx_v_vectors; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":5763 * return toBool(flag) * * def getVecs(self) -> list[Vec]: # <<<<<<<<<<<<<< * """Return the vectors defining the null space. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.NullSpace.getVecs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_vec); __Pyx_XDECREF(__pyx_v_vectors); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":5785 * return vectors * * def getFunction(self) -> MatNullFunction: # <<<<<<<<<<<<<< * """Return the callback to remove the nullspace. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_9NullSpace_19getFunction(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_9NullSpace_18getFunction, "NullSpace.getFunction(self) -> MatNullFunction\nReturn the callback to remove the nullspace.\n\n Not collective.\n\n See Also\n --------\n setFunction\n\n \nSource code at petsc4py/PETSc/Mat.pyx:5785"); static PyObject *__pyx_pw_8petsc4py_5PETSc_9NullSpace_19getFunction(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getFunction (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getFunction", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getFunction", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_9NullSpace_18getFunction(((struct PyPetscNullSpaceObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_9NullSpace_18getFunction(struct PyPetscNullSpaceObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getFunction", 1); /* "petsc4py/PETSc/Mat.pyx":5795 * * """ * return self.get_attr('__function__') # <<<<<<<<<<<<<< * * # */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_NullSpace *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__function__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 5795, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":5785 * return vectors * * def getFunction(self) -> MatNullFunction: # <<<<<<<<<<<<<< * """Return the callback to remove the nullspace. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.NullSpace.getFunction", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":5799 * # * * def remove(self, Vec vec) -> None: # <<<<<<<<<<<<<< * """Remove all components of a null space from a vector. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_9NullSpace_21remove(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_9NullSpace_20remove, "NullSpace.remove(self, vec: Vec) -> None\nRemove all components of a null space from a vector.\n\n Collective.\n\n Parameters\n ----------\n vec\n The vector from which the null space is removed.\n\n See Also\n --------\n petsc.MatNullSpaceRemove\n\n \nSource code at petsc4py/PETSc/Mat.pyx:5799"); static PyObject *__pyx_pw_8petsc4py_5PETSc_9NullSpace_21remove(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_vec = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("remove (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vec)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 5799, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "remove") < 0)) __PYX_ERR(46, 5799, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_vec = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("remove", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 5799, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.NullSpace.remove", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(46, 5799, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_9NullSpace_20remove(((struct PyPetscNullSpaceObject *)__pyx_v_self), __pyx_v_vec); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_9NullSpace_20remove(struct PyPetscNullSpaceObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("remove", 1); /* "petsc4py/PETSc/Mat.pyx":5814 * * """ * CHKERR( MatNullSpaceRemove(self.nsp, vec.vec) ) # <<<<<<<<<<<<<< * * def test(self, Mat mat) -> bool: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatNullSpaceRemove(__pyx_v_self->nsp, __pyx_v_vec->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5814, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":5799 * # * * def remove(self, Vec vec) -> None: # <<<<<<<<<<<<<< * """Remove all components of a null space from a vector. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.NullSpace.remove", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Mat.pyx":5816 * CHKERR( MatNullSpaceRemove(self.nsp, vec.vec) ) * * def test(self, Mat mat) -> bool: # <<<<<<<<<<<<<< * """Return if the claimed null space is valid for a matrix. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_9NullSpace_23test(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_9NullSpace_22test, "NullSpace.test(self, mat: Mat) -> bool\nReturn if the claimed null space is valid for a matrix.\n\n Collective.\n\n Parameters\n ----------\n mat\n The matrix to check.\n\n See Also\n --------\n petsc.MatNullSpaceTest\n\n \nSource code at petsc4py/PETSc/Mat.pyx:5816"); static PyObject *__pyx_pw_8petsc4py_5PETSc_9NullSpace_23test(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscMatObject *__pyx_v_mat = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("test (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mat)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 5816, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "test") < 0)) __PYX_ERR(46, 5816, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_mat = ((struct PyPetscMatObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("test", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 5816, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.NullSpace.test", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(46, 5816, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_9NullSpace_22test(((struct PyPetscNullSpaceObject *)__pyx_v_self), __pyx_v_mat); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_9NullSpace_22test(struct PyPetscNullSpaceObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat) { PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("test", 1); /* "petsc4py/PETSc/Mat.pyx":5831 * * """ * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( MatNullSpaceTest(self.nsp, mat.mat, &flag) ) * return toBool(flag) */ __pyx_v_flag = PETSC_FALSE; /* "petsc4py/PETSc/Mat.pyx":5832 * """ * cdef PetscBool flag = PETSC_FALSE * CHKERR( MatNullSpaceTest(self.nsp, mat.mat, &flag) ) # <<<<<<<<<<<<<< * return toBool(flag) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatNullSpaceTest(__pyx_v_self->nsp, __pyx_v_mat->mat, (&__pyx_v_flag))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5832, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":5833 * cdef PetscBool flag = PETSC_FALSE * CHKERR( MatNullSpaceTest(self.nsp, mat.mat, &flag) ) * return toBool(flag) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 5833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Mat.pyx":5816 * CHKERR( MatNullSpaceRemove(self.nsp, vec.vec) ) * * def test(self, Mat mat) -> bool: # <<<<<<<<<<<<<< * """Return if the claimed null space is valid for a matrix. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.NullSpace.test", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/MatPartitioning.pyx":20 * Type = MatPartitioningType * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.part * self.part = NULL */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_15MatPartitioning_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_15MatPartitioning_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_8petsc4py_5PETSc_15MatPartitioning___cinit__(((struct PyPetscMatPartitioningObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_15MatPartitioning___cinit__(struct PyPetscMatPartitioningObject *__pyx_v_self) { int __pyx_r; /* "petsc4py/PETSc/MatPartitioning.pyx":21 * * def __cinit__(self): * self.obj = &self.part # <<<<<<<<<<<<<< * self.part = NULL * */ __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->part)); /* "petsc4py/PETSc/MatPartitioning.pyx":22 * def __cinit__(self): * self.obj = &self.part * self.part = NULL # <<<<<<<<<<<<<< * * def __call__(self): */ __pyx_v_self->part = NULL; /* "petsc4py/PETSc/MatPartitioning.pyx":20 * Type = MatPartitioningType * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.part * self.part = NULL */ /* function exit code */ __pyx_r = 0; return __pyx_r; } /* "petsc4py/PETSc/MatPartitioning.pyx":24 * self.part = NULL * * def __call__(self): # <<<<<<<<<<<<<< * return self.getValue() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_15MatPartitioning_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_15MatPartitioning_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__call__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__call__", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_15MatPartitioning_2__call__(((struct PyPetscMatPartitioningObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_15MatPartitioning_2__call__(struct PyPetscMatPartitioningObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 1); /* "petsc4py/PETSc/MatPartitioning.pyx":25 * * def __call__(self): * return self.getValue() # <<<<<<<<<<<<<< * * def view(self, Viewer viewer=None) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getValue); if (unlikely(!__pyx_t_2)) __PYX_ERR(47, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(47, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/MatPartitioning.pyx":24 * self.part = NULL * * def __call__(self): # <<<<<<<<<<<<<< * return self.getValue() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.MatPartitioning.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/MatPartitioning.pyx":27 * return self.getValue() * * def view(self, Viewer viewer=None) -> None: # <<<<<<<<<<<<<< * """View the partitioning data structure. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_15MatPartitioning_5view(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_15MatPartitioning_4view, "MatPartitioning.view(self, viewer: Viewer | None = None) -> None\nView the partitioning data structure.\n\n Collective.\n\n Parameters\n ----------\n viewer\n A `Viewer` to display the graph.\n\n See Also\n --------\n petsc.MatPartitioningView\n\n \nSource code at petsc4py/PETSc/MatPartitioning.pyx:27"); static PyObject *__pyx_pw_8petsc4py_5PETSc_15MatPartitioning_5view(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscViewerObject *__pyx_v_viewer = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("view (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscViewerObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_viewer); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(47, 27, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "view") < 0)) __PYX_ERR(47, 27, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, __pyx_nargs); __PYX_ERR(47, 27, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.MatPartitioning.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(47, 27, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_15MatPartitioning_4view(((struct PyPetscMatPartitioningObject *)__pyx_v_self), __pyx_v_viewer); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_15MatPartitioning_4view(struct PyPetscMatPartitioningObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer) { PetscViewer __pyx_v_vwr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscViewer __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("view", 1); /* "petsc4py/PETSc/MatPartitioning.pyx":42 * * """ * assert self.obj != NULL # <<<<<<<<<<<<<< * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_1 = (__pyx_v_self->__pyx_base.obj != NULL); if (unlikely(!__pyx_t_1)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(47, 42, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(47, 42, __pyx_L1_error) #endif /* "petsc4py/PETSc/MatPartitioning.pyx":43 * """ * assert self.obj != NULL * cdef PetscViewer vwr = NULL # <<<<<<<<<<<<<< * if viewer is not None: vwr = viewer.vwr * CHKERR( MatPartitioningView(self.part, vwr) ) */ __pyx_v_vwr = NULL; /* "petsc4py/PETSc/MatPartitioning.pyx":44 * assert self.obj != NULL * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr # <<<<<<<<<<<<<< * CHKERR( MatPartitioningView(self.part, vwr) ) * */ __pyx_t_1 = (((PyObject *)__pyx_v_viewer) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_viewer->vwr; __pyx_v_vwr = __pyx_t_2; } /* "petsc4py/PETSc/MatPartitioning.pyx":45 * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr * CHKERR( MatPartitioningView(self.part, vwr) ) # <<<<<<<<<<<<<< * * def destroy(self) -> Self: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatPartitioningView(__pyx_v_self->part, __pyx_v_vwr)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(47, 45, __pyx_L1_error) /* "petsc4py/PETSc/MatPartitioning.pyx":27 * return self.getValue() * * def view(self, Viewer viewer=None) -> None: # <<<<<<<<<<<<<< * """View the partitioning data structure. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.MatPartitioning.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/MatPartitioning.pyx":47 * CHKERR( MatPartitioningView(self.part, vwr) ) * * def destroy(self) -> Self: # <<<<<<<<<<<<<< * """Destroy the partitioning context. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_15MatPartitioning_7destroy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_15MatPartitioning_6destroy, "MatPartitioning.destroy(self) -> Self\nDestroy the partitioning context.\n\n Collective.\n\n See Also\n --------\n create, petsc.MatPartitioningDestroy\n\n \nSource code at petsc4py/PETSc/MatPartitioning.pyx:47"); static PyObject *__pyx_pw_8petsc4py_5PETSc_15MatPartitioning_7destroy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("destroy (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_15MatPartitioning_6destroy(((struct PyPetscMatPartitioningObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_15MatPartitioning_6destroy(struct PyPetscMatPartitioningObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("destroy", 1); /* "petsc4py/PETSc/MatPartitioning.pyx":57 * * """ * CHKERR( MatPartitioningDestroy(&self.part) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatPartitioningDestroy((&__pyx_v_self->part))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(47, 57, __pyx_L1_error) /* "petsc4py/PETSc/MatPartitioning.pyx":58 * """ * CHKERR( MatPartitioningDestroy(&self.part) ) * return self # <<<<<<<<<<<<<< * * def create(self, comm: Comm | None = None) -> Self: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/MatPartitioning.pyx":47 * CHKERR( MatPartitioningView(self.part, vwr) ) * * def destroy(self) -> Self: # <<<<<<<<<<<<<< * """Destroy the partitioning context. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.MatPartitioning.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/MatPartitioning.pyx":60 * return self * * def create(self, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Create a partitioning context. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_15MatPartitioning_9create(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_15MatPartitioning_8create, "MatPartitioning.create(self, comm: Comm | None = None) -> Self\nCreate a partitioning context.\n\n Collective.\n\n Parameters\n ----------\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n destroy, petsc.MatPartitioningCreate\n\n \nSource code at petsc4py/PETSc/MatPartitioning.pyx:60"); static PyObject *__pyx_pw_8petsc4py_5PETSc_15MatPartitioning_9create(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(47, 60, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "create") < 0)) __PYX_ERR(47, 60, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_comm = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, __pyx_nargs); __PYX_ERR(47, 60, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.MatPartitioning.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_15MatPartitioning_8create(((struct PyPetscMatPartitioningObject *)__pyx_v_self), __pyx_v_comm); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_15MatPartitioning_8create(struct PyPetscMatPartitioningObject *__pyx_v_self, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create", 1); /* "petsc4py/PETSc/MatPartitioning.pyx":75 * * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * CHKERR( MatPartitioningCreate(ccomm, &self.part) ) * return self */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(47, 75, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/MatPartitioning.pyx":76 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * CHKERR( MatPartitioningCreate(ccomm, &self.part) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatPartitioningCreate(__pyx_v_ccomm, (&__pyx_v_self->part))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(47, 76, __pyx_L1_error) /* "petsc4py/PETSc/MatPartitioning.pyx":77 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * CHKERR( MatPartitioningCreate(ccomm, &self.part) ) * return self # <<<<<<<<<<<<<< * * def setType(self, matpartitioning_type: Type | str) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/MatPartitioning.pyx":60 * return self * * def create(self, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Create a partitioning context. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.MatPartitioning.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/MatPartitioning.pyx":79 * return self * * def setType(self, matpartitioning_type: Type | str) -> None: # <<<<<<<<<<<<<< * """Set the type of the partitioner to use. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_15MatPartitioning_11setType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_15MatPartitioning_10setType, "MatPartitioning.setType(self, matpartitioning_type: Type | str) -> None\nSet the type of the partitioner to use.\n\n Collective.\n\n Parameters\n ----------\n matpartitioning_type\n The partitioner type.\n\n See Also\n --------\n getType, petsc.MatPartitioningSetType\n\n \nSource code at petsc4py/PETSc/MatPartitioning.pyx:79"); static PyObject *__pyx_pw_8petsc4py_5PETSc_15MatPartitioning_11setType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_matpartitioning_type = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_matpartitioning_type,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_matpartitioning_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(47, 79, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setType") < 0)) __PYX_ERR(47, 79, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_matpartitioning_type = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, __pyx_nargs); __PYX_ERR(47, 79, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.MatPartitioning.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_15MatPartitioning_10setType(((struct PyPetscMatPartitioningObject *)__pyx_v_self), __pyx_v_matpartitioning_type); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_15MatPartitioning_10setType(struct PyPetscMatPartitioningObject *__pyx_v_self, PyObject *__pyx_v_matpartitioning_type) { MatPartitioningType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setType", 0); __Pyx_INCREF(__pyx_v_matpartitioning_type); /* "petsc4py/PETSc/MatPartitioning.pyx":94 * * """ * cdef PetscMatPartitioningType cval = NULL # <<<<<<<<<<<<<< * matpartitioning_type = str2bytes(matpartitioning_type, &cval) * CHKERR( MatPartitioningSetType(self.part, cval) ) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/MatPartitioning.pyx":95 * """ * cdef PetscMatPartitioningType cval = NULL * matpartitioning_type = str2bytes(matpartitioning_type, &cval) # <<<<<<<<<<<<<< * CHKERR( MatPartitioningSetType(self.part, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_matpartitioning_type, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(47, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_matpartitioning_type, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/MatPartitioning.pyx":96 * cdef PetscMatPartitioningType cval = NULL * matpartitioning_type = str2bytes(matpartitioning_type, &cval) * CHKERR( MatPartitioningSetType(self.part, cval) ) # <<<<<<<<<<<<<< * * def getType(self) -> str: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatPartitioningSetType(__pyx_v_self->part, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(47, 96, __pyx_L1_error) /* "petsc4py/PETSc/MatPartitioning.pyx":79 * return self * * def setType(self, matpartitioning_type: Type | str) -> None: # <<<<<<<<<<<<<< * """Set the type of the partitioner to use. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.MatPartitioning.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_matpartitioning_type); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/MatPartitioning.pyx":98 * CHKERR( MatPartitioningSetType(self.part, cval) ) * * def getType(self) -> str: # <<<<<<<<<<<<<< * """Return the partitioning method. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_15MatPartitioning_13getType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_15MatPartitioning_12getType, "MatPartitioning.getType(self) -> str\nReturn the partitioning method.\n\n Not collective.\n\n See Also\n --------\n setType, petsc.MatPartitioningGetType\n\n \nSource code at petsc4py/PETSc/MatPartitioning.pyx:98"); static PyObject *__pyx_pw_8petsc4py_5PETSc_15MatPartitioning_13getType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getType", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_15MatPartitioning_12getType(((struct PyPetscMatPartitioningObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_15MatPartitioning_12getType(struct PyPetscMatPartitioningObject *__pyx_v_self) { MatPartitioningType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getType", 1); /* "petsc4py/PETSc/MatPartitioning.pyx":108 * * """ * cdef PetscMatPartitioningType cval = NULL # <<<<<<<<<<<<<< * CHKERR( MatPartitioningGetType(self.part, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/MatPartitioning.pyx":109 * """ * cdef PetscMatPartitioningType cval = NULL * CHKERR( MatPartitioningGetType(self.part, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatPartitioningGetType(__pyx_v_self->part, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(47, 109, __pyx_L1_error) /* "petsc4py/PETSc/MatPartitioning.pyx":110 * cdef PetscMatPartitioningType cval = NULL * CHKERR( MatPartitioningGetType(self.part, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * def setFromOptions(self) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(47, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/MatPartitioning.pyx":98 * CHKERR( MatPartitioningSetType(self.part, cval) ) * * def getType(self) -> str: # <<<<<<<<<<<<<< * """Return the partitioning method. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.MatPartitioning.getType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/MatPartitioning.pyx":112 * return bytes2str(cval) * * def setFromOptions(self) -> None: # <<<<<<<<<<<<<< * """Set parameters in the partitioner from the options database. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_15MatPartitioning_15setFromOptions(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_15MatPartitioning_14setFromOptions, "MatPartitioning.setFromOptions(self) -> None\nSet parameters in the partitioner from the options database.\n\n Collective.\n\n See Also\n --------\n petsc_options, petsc.MatPartitioningSetFromOptions\n\n \nSource code at petsc4py/PETSc/MatPartitioning.pyx:112"); static PyObject *__pyx_pw_8petsc4py_5PETSc_15MatPartitioning_15setFromOptions(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFromOptions (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("setFromOptions", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setFromOptions", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_15MatPartitioning_14setFromOptions(((struct PyPetscMatPartitioningObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_15MatPartitioning_14setFromOptions(struct PyPetscMatPartitioningObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFromOptions", 1); /* "petsc4py/PETSc/MatPartitioning.pyx":122 * * """ * CHKERR( MatPartitioningSetFromOptions(self.part) ) # <<<<<<<<<<<<<< * * def setAdjacency(self, Mat adj) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatPartitioningSetFromOptions(__pyx_v_self->part)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(47, 122, __pyx_L1_error) /* "petsc4py/PETSc/MatPartitioning.pyx":112 * return bytes2str(cval) * * def setFromOptions(self) -> None: # <<<<<<<<<<<<<< * """Set parameters in the partitioner from the options database. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.MatPartitioning.setFromOptions", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/MatPartitioning.pyx":124 * CHKERR( MatPartitioningSetFromOptions(self.part) ) * * def setAdjacency(self, Mat adj) -> None: # <<<<<<<<<<<<<< * """Set the adjacency graph (matrix) of the thing to be partitioned. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_15MatPartitioning_17setAdjacency(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_15MatPartitioning_16setAdjacency, "MatPartitioning.setAdjacency(self, adj: Mat) -> None\nSet the adjacency graph (matrix) of the thing to be partitioned.\n\n Collective.\n\n Parameters\n ----------\n adj\n The adjacency matrix, this can be any `Mat.Type` but the natural\n representation is `Mat.Type.MPIADJ`.\n\n See Also\n --------\n petsc.MatPartitioningSetAdjacency\n\n \nSource code at petsc4py/PETSc/MatPartitioning.pyx:124"); static PyObject *__pyx_pw_8petsc4py_5PETSc_15MatPartitioning_17setAdjacency(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscMatObject *__pyx_v_adj = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setAdjacency (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_adj,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_adj)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(47, 124, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setAdjacency") < 0)) __PYX_ERR(47, 124, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_adj = ((struct PyPetscMatObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setAdjacency", 1, 1, 1, __pyx_nargs); __PYX_ERR(47, 124, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.MatPartitioning.setAdjacency", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_adj), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "adj", 0))) __PYX_ERR(47, 124, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_15MatPartitioning_16setAdjacency(((struct PyPetscMatPartitioningObject *)__pyx_v_self), __pyx_v_adj); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_15MatPartitioning_16setAdjacency(struct PyPetscMatPartitioningObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_adj) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setAdjacency", 1); /* "petsc4py/PETSc/MatPartitioning.pyx":140 * * """ * CHKERR( MatPartitioningSetAdjacency(self.part, adj.mat) ) # <<<<<<<<<<<<<< * * def apply(self, IS partitioning) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatPartitioningSetAdjacency(__pyx_v_self->part, __pyx_v_adj->mat)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(47, 140, __pyx_L1_error) /* "petsc4py/PETSc/MatPartitioning.pyx":124 * CHKERR( MatPartitioningSetFromOptions(self.part) ) * * def setAdjacency(self, Mat adj) -> None: # <<<<<<<<<<<<<< * """Set the adjacency graph (matrix) of the thing to be partitioned. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.MatPartitioning.setAdjacency", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/MatPartitioning.pyx":142 * CHKERR( MatPartitioningSetAdjacency(self.part, adj.mat) ) * * def apply(self, IS partitioning) -> None: # <<<<<<<<<<<<<< * """Return a partitioning for the graph represented by a sparse matrix. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_15MatPartitioning_19apply(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_15MatPartitioning_18apply, "MatPartitioning.apply(self, partitioning: IS) -> None\nReturn a partitioning for the graph represented by a sparse matrix.\n\n Collective.\n\n For each local node this tells the processor number that that node is\n assigned to.\n\n See Also\n --------\n petsc.MatPartitioningApply\n\n \nSource code at petsc4py/PETSc/MatPartitioning.pyx:142"); static PyObject *__pyx_pw_8petsc4py_5PETSc_15MatPartitioning_19apply(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscISObject *__pyx_v_partitioning = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("apply (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_partitioning,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_partitioning)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(47, 142, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "apply") < 0)) __PYX_ERR(47, 142, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_partitioning = ((struct PyPetscISObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("apply", 1, 1, 1, __pyx_nargs); __PYX_ERR(47, 142, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.MatPartitioning.apply", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_partitioning), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "partitioning", 0))) __PYX_ERR(47, 142, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_15MatPartitioning_18apply(((struct PyPetscMatPartitioningObject *)__pyx_v_self), __pyx_v_partitioning); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_15MatPartitioning_18apply(struct PyPetscMatPartitioningObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_partitioning) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("apply", 1); /* "petsc4py/PETSc/MatPartitioning.pyx":155 * * """ * CHKERR( MatPartitioningApply(self.part, &partitioning.iset) ) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatPartitioningApply(__pyx_v_self->part, (&__pyx_v_partitioning->iset))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(47, 155, __pyx_L1_error) /* "petsc4py/PETSc/MatPartitioning.pyx":142 * CHKERR( MatPartitioningSetAdjacency(self.part, adj.mat) ) * * def apply(self, IS partitioning) -> None: # <<<<<<<<<<<<<< * """Return a partitioning for the graph represented by a sparse matrix. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.MatPartitioning.apply", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":203 * # --- xxx --- * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.pc * self.pc = NULL */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_2PC_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_2PC_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC___cinit__(((struct PyPetscPCObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_2PC___cinit__(struct PyPetscPCObject *__pyx_v_self) { int __pyx_r; /* "petsc4py/PETSc/PC.pyx":204 * * def __cinit__(self): * self.obj = &self.pc # <<<<<<<<<<<<<< * self.pc = NULL * */ __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->pc)); /* "petsc4py/PETSc/PC.pyx":205 * def __cinit__(self): * self.obj = &self.pc * self.pc = NULL # <<<<<<<<<<<<<< * * def __call__(self, x, y=None): */ __pyx_v_self->pc = NULL; /* "petsc4py/PETSc/PC.pyx":203 * # --- xxx --- * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.pc * self.pc = NULL */ /* function exit code */ __pyx_r = 0; return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":207 * self.pc = NULL * * def __call__(self, x, y=None): # <<<<<<<<<<<<<< * if y is None: # XXX do this better * y = self.getOperators()[0].createVecLeft() */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_x = 0; PyObject *__pyx_v_y = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0}; values[1] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 207, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y); if (value) { values[1] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 207, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__call__") < 0)) __PYX_ERR(48, 207, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_x = values[0]; __pyx_v_y = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__call__", 0, 1, 2, __pyx_nargs); __PYX_ERR(48, 207, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_2__call__(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_x, __pyx_v_y); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_2__call__(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); __Pyx_INCREF(__pyx_v_y); /* "petsc4py/PETSc/PC.pyx":208 * * def __call__(self, x, y=None): * if y is None: # XXX do this better # <<<<<<<<<<<<<< * y = self.getOperators()[0].createVecLeft() * self.apply(x, y) */ __pyx_t_1 = (__pyx_v_y == Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/PC.pyx":209 * def __call__(self, x, y=None): * if y is None: # XXX do this better * y = self.getOperators()[0].createVecLeft() # <<<<<<<<<<<<<< * self.apply(x, y) * return y */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getOperators); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(48, 209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_createVecLeft); if (unlikely(!__pyx_t_3)) __PYX_ERR(48, 209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF_SET(__pyx_v_y, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/PC.pyx":208 * * def __call__(self, x, y=None): * if y is None: # XXX do this better # <<<<<<<<<<<<<< * y = self.getOperators()[0].createVecLeft() * self.apply(x, y) */ } /* "petsc4py/PETSc/PC.pyx":210 * if y is None: # XXX do this better * y = self.getOperators()[0].createVecLeft() * self.apply(x, y) # <<<<<<<<<<<<<< * return y * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_apply); if (unlikely(!__pyx_t_3)) __PYX_ERR(48, 210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_x, __pyx_v_y}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/PC.pyx":211 * y = self.getOperators()[0].createVecLeft() * self.apply(x, y) * return y # <<<<<<<<<<<<<< * * # --- xxx --- */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_y); __pyx_r = __pyx_v_y; goto __pyx_L0; /* "petsc4py/PETSc/PC.pyx":207 * self.pc = NULL * * def __call__(self, x, y=None): # <<<<<<<<<<<<<< * if y is None: # XXX do this better * y = self.getOperators()[0].createVecLeft() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.PC.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_y); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":215 * # --- xxx --- * * def view(self, Viewer viewer=None) -> None: # <<<<<<<<<<<<<< * """View the `PC` object. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_5view(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_4view, "PC.view(self, viewer: Viewer | None = None) -> None\nView the `PC` object.\n\n Collective.\n\n Parameters\n ----------\n viewer\n The visualization context.\n\n See Also\n --------\n petsc.PCView\n\n \nSource code at petsc4py/PETSc/PC.pyx:215"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_5view(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscViewerObject *__pyx_v_viewer = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("view (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscViewerObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_viewer); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 215, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "view") < 0)) __PYX_ERR(48, 215, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, __pyx_nargs); __PYX_ERR(48, 215, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(48, 215, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_4view(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_viewer); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_4view(struct PyPetscPCObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer) { PetscViewer __pyx_v_vwr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscViewer __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("view", 1); /* "petsc4py/PETSc/PC.pyx":230 * * """ * cdef PetscViewer vwr = NULL # <<<<<<<<<<<<<< * if viewer is not None: vwr = viewer.vwr * CHKERR( PCView(self.pc, vwr) ) */ __pyx_v_vwr = NULL; /* "petsc4py/PETSc/PC.pyx":231 * """ * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr # <<<<<<<<<<<<<< * CHKERR( PCView(self.pc, vwr) ) * */ __pyx_t_1 = (((PyObject *)__pyx_v_viewer) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_viewer->vwr; __pyx_v_vwr = __pyx_t_2; } /* "petsc4py/PETSc/PC.pyx":232 * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr * CHKERR( PCView(self.pc, vwr) ) # <<<<<<<<<<<<<< * * def destroy(self) -> Self: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCView(__pyx_v_self->pc, __pyx_v_vwr)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 232, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":215 * # --- xxx --- * * def view(self, Viewer viewer=None) -> None: # <<<<<<<<<<<<<< * """View the `PC` object. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":234 * CHKERR( PCView(self.pc, vwr) ) * * def destroy(self) -> Self: # <<<<<<<<<<<<<< * """Destroy the `PC` that was created with `create`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_7destroy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_6destroy, "PC.destroy(self) -> Self\nDestroy the `PC` that was created with `create`.\n\n Collective.\n\n See Also\n --------\n petsc.PCDestroy\n\n \nSource code at petsc4py/PETSc/PC.pyx:234"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_7destroy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("destroy (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_6destroy(((struct PyPetscPCObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_6destroy(struct PyPetscPCObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("destroy", 1); /* "petsc4py/PETSc/PC.pyx":244 * * """ * CHKERR( PCDestroy(&self.pc) ) # <<<<<<<<<<<<<< * self.pc = NULL * return self */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCDestroy((&__pyx_v_self->pc))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 244, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":245 * """ * CHKERR( PCDestroy(&self.pc) ) * self.pc = NULL # <<<<<<<<<<<<<< * return self * */ __pyx_v_self->pc = NULL; /* "petsc4py/PETSc/PC.pyx":246 * CHKERR( PCDestroy(&self.pc) ) * self.pc = NULL * return self # <<<<<<<<<<<<<< * * def create(self, comm: Comm | None = None) -> Self: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/PC.pyx":234 * CHKERR( PCView(self.pc, vwr) ) * * def destroy(self) -> Self: # <<<<<<<<<<<<<< * """Destroy the `PC` that was created with `create`. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":248 * return self * * def create(self, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Create an empty `PC`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_9create(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_8create, "PC.create(self, comm: Comm | None = None) -> Self\nCreate an empty `PC`.\n\n Collective.\n\n The default preconditioner for sparse matrices is `ILU` or\n `ICC` with 0 fill on one process and block Jacobi (`BJACOBI`) with `ILU`\n or `ICC` in parallel. For dense matrices it is always `None`.\n\n Parameters\n ----------\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n destroy, petsc.PCCreate\n\n \nSource code at petsc4py/PETSc/PC.pyx:248"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_9create(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 248, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "create") < 0)) __PYX_ERR(48, 248, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_comm = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, __pyx_nargs); __PYX_ERR(48, 248, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_8create(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_comm); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_8create(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PC __pyx_v_newpc; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create", 1); /* "petsc4py/PETSc/PC.pyx":267 * * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscPC newpc = NULL * CHKERR( PCCreate(ccomm, &newpc) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(48, 267, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/PC.pyx":268 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscPC newpc = NULL # <<<<<<<<<<<<<< * CHKERR( PCCreate(ccomm, &newpc) ) * CHKERR( PetscCLEAR(self.obj) ); self.pc = newpc */ __pyx_v_newpc = NULL; /* "petsc4py/PETSc/PC.pyx":269 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscPC newpc = NULL * CHKERR( PCCreate(ccomm, &newpc) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.pc = newpc * return self */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCCreate(__pyx_v_ccomm, (&__pyx_v_newpc))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 269, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":270 * cdef PetscPC newpc = NULL * CHKERR( PCCreate(ccomm, &newpc) ) * CHKERR( PetscCLEAR(self.obj) ); self.pc = newpc # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 270, __pyx_L1_error) __pyx_v_self->pc = __pyx_v_newpc; /* "petsc4py/PETSc/PC.pyx":271 * CHKERR( PCCreate(ccomm, &newpc) ) * CHKERR( PetscCLEAR(self.obj) ); self.pc = newpc * return self # <<<<<<<<<<<<<< * * def setType(self, pc_type: Type | str) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/PC.pyx":248 * return self * * def create(self, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Create an empty `PC`. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":273 * return self * * def setType(self, pc_type: Type | str) -> None: # <<<<<<<<<<<<<< * """Set the preconditioner type. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_11setType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_10setType, "PC.setType(self, pc_type: Type | str) -> None\nSet the preconditioner type.\n\n Collective.\n\n Parameters\n ----------\n pc_type\n The preconditioner type.\n\n See Also\n --------\n petsc_options, getType, petsc.TSSetType\n\n \nSource code at petsc4py/PETSc/PC.pyx:273"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_11setType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_pc_type = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pc_type,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pc_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 273, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setType") < 0)) __PYX_ERR(48, 273, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_pc_type = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 273, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_10setType(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_pc_type); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_10setType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_pc_type) { PCType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setType", 0); __Pyx_INCREF(__pyx_v_pc_type); /* "petsc4py/PETSc/PC.pyx":288 * * """ * cdef PetscPCType cval = NULL # <<<<<<<<<<<<<< * pc_type = str2bytes(pc_type, &cval) * CHKERR( PCSetType(self.pc, cval) ) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/PC.pyx":289 * """ * cdef PetscPCType cval = NULL * pc_type = str2bytes(pc_type, &cval) # <<<<<<<<<<<<<< * CHKERR( PCSetType(self.pc, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_pc_type, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_pc_type, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/PC.pyx":290 * cdef PetscPCType cval = NULL * pc_type = str2bytes(pc_type, &cval) * CHKERR( PCSetType(self.pc, cval) ) # <<<<<<<<<<<<<< * * def getType(self) -> str: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCSetType(__pyx_v_self->pc, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 290, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":273 * return self * * def setType(self, pc_type: Type | str) -> None: # <<<<<<<<<<<<<< * """Set the preconditioner type. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PC.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_pc_type); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":292 * CHKERR( PCSetType(self.pc, cval) ) * * def getType(self) -> str: # <<<<<<<<<<<<<< * """Return the preconditioner type. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_13getType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_12getType, "PC.getType(self) -> str\nReturn the preconditioner type.\n\n Not collective.\n\n See Also\n --------\n setType, petsc.PCGetType\n\n \nSource code at petsc4py/PETSc/PC.pyx:292"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_13getType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getType", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_12getType(((struct PyPetscPCObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_12getType(struct PyPetscPCObject *__pyx_v_self) { PCType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getType", 1); /* "petsc4py/PETSc/PC.pyx":302 * * """ * cdef PetscPCType cval = NULL # <<<<<<<<<<<<<< * CHKERR( PCGetType(self.pc, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/PC.pyx":303 * """ * cdef PetscPCType cval = NULL * CHKERR( PCGetType(self.pc, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCGetType(__pyx_v_self->pc, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 303, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":304 * cdef PetscPCType cval = NULL * CHKERR( PCGetType(self.pc, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * def setOptionsPrefix(self, prefix: str) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/PC.pyx":292 * CHKERR( PCSetType(self.pc, cval) ) * * def getType(self) -> str: # <<<<<<<<<<<<<< * """Return the preconditioner type. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.PC.getType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":306 * return bytes2str(cval) * * def setOptionsPrefix(self, prefix: str) -> None: # <<<<<<<<<<<<<< * """Set the prefix used for all the `PC` options. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_15setOptionsPrefix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_14setOptionsPrefix, "PC.setOptionsPrefix(self, prefix: str) -> None\nSet the prefix used for all the `PC` options.\n\n Logically collective.\n\n Parameters\n ----------\n prefix\n The prefix to prepend to all option names.\n\n See Also\n --------\n petsc_options, petsc.PCSetOptionsPrefix\n\n \nSource code at petsc4py/PETSc/PC.pyx:306"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_15setOptionsPrefix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_prefix = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setOptionsPrefix (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_prefix,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_prefix)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 306, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setOptionsPrefix") < 0)) __PYX_ERR(48, 306, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_prefix = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setOptionsPrefix", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 306, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_14setOptionsPrefix(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_prefix); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_14setOptionsPrefix(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_prefix) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setOptionsPrefix", 0); __Pyx_INCREF(__pyx_v_prefix); /* "petsc4py/PETSc/PC.pyx":321 * * """ * cdef const char *cval = NULL # <<<<<<<<<<<<<< * prefix = str2bytes(prefix, &cval) * CHKERR( PCSetOptionsPrefix(self.pc, cval) ) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/PC.pyx":322 * """ * cdef const char *cval = NULL * prefix = str2bytes(prefix, &cval) # <<<<<<<<<<<<<< * CHKERR( PCSetOptionsPrefix(self.pc, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_prefix, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_prefix, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/PC.pyx":323 * cdef const char *cval = NULL * prefix = str2bytes(prefix, &cval) * CHKERR( PCSetOptionsPrefix(self.pc, cval) ) # <<<<<<<<<<<<<< * * def getOptionsPrefix(self) -> str: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCSetOptionsPrefix(__pyx_v_self->pc, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 323, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":306 * return bytes2str(cval) * * def setOptionsPrefix(self, prefix: str) -> None: # <<<<<<<<<<<<<< * """Set the prefix used for all the `PC` options. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PC.setOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_prefix); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":325 * CHKERR( PCSetOptionsPrefix(self.pc, cval) ) * * def getOptionsPrefix(self) -> str: # <<<<<<<<<<<<<< * """Return the prefix used for all the `PC` options. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_17getOptionsPrefix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_16getOptionsPrefix, "PC.getOptionsPrefix(self) -> str\nReturn the prefix used for all the `PC` options.\n\n Not collective.\n\n See Also\n --------\n petsc_options, petsc.PCGetOptionsPrefix\n\n \nSource code at petsc4py/PETSc/PC.pyx:325"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_17getOptionsPrefix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getOptionsPrefix (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getOptionsPrefix", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getOptionsPrefix", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_16getOptionsPrefix(((struct PyPetscPCObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_16getOptionsPrefix(struct PyPetscPCObject *__pyx_v_self) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getOptionsPrefix", 1); /* "petsc4py/PETSc/PC.pyx":335 * * """ * cdef const char *cval = NULL # <<<<<<<<<<<<<< * CHKERR( PCGetOptionsPrefix(self.pc, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/PC.pyx":336 * """ * cdef const char *cval = NULL * CHKERR( PCGetOptionsPrefix(self.pc, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCGetOptionsPrefix(__pyx_v_self->pc, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 336, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":337 * cdef const char *cval = NULL * CHKERR( PCGetOptionsPrefix(self.pc, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * def appendOptionsPrefix(self, prefix: str) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/PC.pyx":325 * CHKERR( PCSetOptionsPrefix(self.pc, cval) ) * * def getOptionsPrefix(self) -> str: # <<<<<<<<<<<<<< * """Return the prefix used for all the `PC` options. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.PC.getOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":339 * return bytes2str(cval) * * def appendOptionsPrefix(self, prefix: str) -> None: # <<<<<<<<<<<<<< * """Append to the prefix used for all the `PC` options. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_19appendOptionsPrefix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_18appendOptionsPrefix, "PC.appendOptionsPrefix(self, prefix: str) -> None\nAppend to the prefix used for all the `PC` options.\n\n Logically collective.\n\n Parameters\n ----------\n prefix\n The prefix to append to the current prefix.\n\n See Also\n --------\n petsc_options, petsc.PCAppendOptionsPrefix\n\n \nSource code at petsc4py/PETSc/PC.pyx:339"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_19appendOptionsPrefix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_prefix = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("appendOptionsPrefix (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_prefix,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_prefix)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 339, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "appendOptionsPrefix") < 0)) __PYX_ERR(48, 339, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_prefix = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("appendOptionsPrefix", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 339, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.appendOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_18appendOptionsPrefix(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_prefix); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_18appendOptionsPrefix(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_prefix) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("appendOptionsPrefix", 0); __Pyx_INCREF(__pyx_v_prefix); /* "petsc4py/PETSc/PC.pyx":354 * * """ * cdef const char *cval = NULL # <<<<<<<<<<<<<< * prefix = str2bytes(prefix, &cval) * CHKERR( PCAppendOptionsPrefix(self.pc, cval) ) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/PC.pyx":355 * """ * cdef const char *cval = NULL * prefix = str2bytes(prefix, &cval) # <<<<<<<<<<<<<< * CHKERR( PCAppendOptionsPrefix(self.pc, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_prefix, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_prefix, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/PC.pyx":356 * cdef const char *cval = NULL * prefix = str2bytes(prefix, &cval) * CHKERR( PCAppendOptionsPrefix(self.pc, cval) ) # <<<<<<<<<<<<<< * * def setFromOptions(self) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCAppendOptionsPrefix(__pyx_v_self->pc, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 356, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":339 * return bytes2str(cval) * * def appendOptionsPrefix(self, prefix: str) -> None: # <<<<<<<<<<<<<< * """Append to the prefix used for all the `PC` options. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PC.appendOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_prefix); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":358 * CHKERR( PCAppendOptionsPrefix(self.pc, cval) ) * * def setFromOptions(self) -> None: # <<<<<<<<<<<<<< * """Set various `PC` parameters from user options. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_21setFromOptions(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_20setFromOptions, "PC.setFromOptions(self) -> None\nSet various `PC` parameters from user options.\n\n Collective.\n\n See Also\n --------\n petsc_options, petsc.PCSetFromOptions\n\n \nSource code at petsc4py/PETSc/PC.pyx:358"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_21setFromOptions(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFromOptions (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("setFromOptions", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setFromOptions", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_20setFromOptions(((struct PyPetscPCObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_20setFromOptions(struct PyPetscPCObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFromOptions", 1); /* "petsc4py/PETSc/PC.pyx":368 * * """ * CHKERR( PCSetFromOptions(self.pc) ) # <<<<<<<<<<<<<< * * def setOperators(self, Mat A=None, Mat P=None) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCSetFromOptions(__pyx_v_self->pc)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 368, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":358 * CHKERR( PCAppendOptionsPrefix(self.pc, cval) ) * * def setFromOptions(self) -> None: # <<<<<<<<<<<<<< * """Set various `PC` parameters from user options. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setFromOptions", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":370 * CHKERR( PCSetFromOptions(self.pc) ) * * def setOperators(self, Mat A=None, Mat P=None) -> None: # <<<<<<<<<<<<<< * """Set the matrices associated with the linear system. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_23setOperators(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_22setOperators, "PC.setOperators(self, A: Mat | None = None, P: Mat | None = None) -> None\nSet the matrices associated with the linear system.\n\n Logically collective.\n\n Passing `None` for ``A`` or ``P`` removes the\n matrix that is currently used. PETSc does not reset the matrix entries\n of either ``A`` or ``P`` to zero after a linear solve; the user is\n completely responsible for matrix assembly. See `Mat.zeroEntries` to\n zero all elements of a matrix.\n\n Parameters\n ----------\n A\n the matrix which defines the linear system\n P\n the matrix to be used in constructing the preconditioner, usually\n the same as ``A``\n\n See Also\n --------\n petsc.PCSetOperators\n\n \nSource code at petsc4py/PETSc/PC.pyx:370"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_23setOperators(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscMatObject *__pyx_v_A = 0; struct PyPetscMatObject *__pyx_v_P = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setOperators (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_P,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscMatObject *)Py_None)); values[1] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscMatObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_A); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 370, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_P); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 370, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setOperators") < 0)) __PYX_ERR(48, 370, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_A = ((struct PyPetscMatObject *)values[0]); __pyx_v_P = ((struct PyPetscMatObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setOperators", 0, 0, 2, __pyx_nargs); __PYX_ERR(48, 370, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setOperators", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_A), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "A", 0))) __PYX_ERR(48, 370, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_P), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "P", 0))) __PYX_ERR(48, 370, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_22setOperators(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_A, __pyx_v_P); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_22setOperators(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_A, struct PyPetscMatObject *__pyx_v_P) { Mat __pyx_v_amat; Mat __pyx_v_pmat; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; Mat __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setOperators", 1); /* "petsc4py/PETSc/PC.pyx":394 * * """ * cdef PetscMat amat=NULL # <<<<<<<<<<<<<< * if A is not None: amat = A.mat * cdef PetscMat pmat=amat */ __pyx_v_amat = NULL; /* "petsc4py/PETSc/PC.pyx":395 * """ * cdef PetscMat amat=NULL * if A is not None: amat = A.mat # <<<<<<<<<<<<<< * cdef PetscMat pmat=amat * if P is not None: pmat = P.mat */ __pyx_t_1 = (((PyObject *)__pyx_v_A) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_A->mat; __pyx_v_amat = __pyx_t_2; } /* "petsc4py/PETSc/PC.pyx":396 * cdef PetscMat amat=NULL * if A is not None: amat = A.mat * cdef PetscMat pmat=amat # <<<<<<<<<<<<<< * if P is not None: pmat = P.mat * CHKERR( PCSetOperators(self.pc, amat, pmat) ) */ __pyx_v_pmat = __pyx_v_amat; /* "petsc4py/PETSc/PC.pyx":397 * if A is not None: amat = A.mat * cdef PetscMat pmat=amat * if P is not None: pmat = P.mat # <<<<<<<<<<<<<< * CHKERR( PCSetOperators(self.pc, amat, pmat) ) * */ __pyx_t_1 = (((PyObject *)__pyx_v_P) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_P->mat; __pyx_v_pmat = __pyx_t_2; } /* "petsc4py/PETSc/PC.pyx":398 * cdef PetscMat pmat=amat * if P is not None: pmat = P.mat * CHKERR( PCSetOperators(self.pc, amat, pmat) ) # <<<<<<<<<<<<<< * * def getOperators(self) -> tuple[Mat,Mat]: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCSetOperators(__pyx_v_self->pc, __pyx_v_amat, __pyx_v_pmat)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 398, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":370 * CHKERR( PCSetFromOptions(self.pc) ) * * def setOperators(self, Mat A=None, Mat P=None) -> None: # <<<<<<<<<<<<<< * """Set the matrices associated with the linear system. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setOperators", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":400 * CHKERR( PCSetOperators(self.pc, amat, pmat) ) * * def getOperators(self) -> tuple[Mat,Mat]: # <<<<<<<<<<<<<< * """Return the matrices associated with a linear system. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_25getOperators(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_24getOperators, "PC.getOperators(self) -> tuple[Mat, Mat]\nReturn the matrices associated with a linear system.\n\n Not collective.\n\n See Also\n --------\n setOperators, petsc.PCGetOperators\n\n \nSource code at petsc4py/PETSc/PC.pyx:400"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_25getOperators(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getOperators (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getOperators", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getOperators", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_24getOperators(((struct PyPetscPCObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_24getOperators(struct PyPetscPCObject *__pyx_v_self) { struct PyPetscMatObject *__pyx_v_A = 0; struct PyPetscMatObject *__pyx_v_P = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getOperators", 1); /* "petsc4py/PETSc/PC.pyx":410 * * """ * cdef Mat A = Mat(), P = Mat() # <<<<<<<<<<<<<< * CHKERR( PCGetOperators(self.pc, &A.mat, &P.mat) ) * CHKERR( PetscINCREF(A.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_A = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_P = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/PC.pyx":411 * """ * cdef Mat A = Mat(), P = Mat() * CHKERR( PCGetOperators(self.pc, &A.mat, &P.mat) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(A.obj) ) * CHKERR( PetscINCREF(P.obj) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCGetOperators(__pyx_v_self->pc, (&__pyx_v_A->mat), (&__pyx_v_P->mat))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 411, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":412 * cdef Mat A = Mat(), P = Mat() * CHKERR( PCGetOperators(self.pc, &A.mat, &P.mat) ) * CHKERR( PetscINCREF(A.obj) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(P.obj) ) * return (A, P) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_A->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 412, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":413 * CHKERR( PCGetOperators(self.pc, &A.mat, &P.mat) ) * CHKERR( PetscINCREF(A.obj) ) * CHKERR( PetscINCREF(P.obj) ) # <<<<<<<<<<<<<< * return (A, P) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_P->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 413, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":414 * CHKERR( PetscINCREF(A.obj) ) * CHKERR( PetscINCREF(P.obj) ) * return (A, P) # <<<<<<<<<<<<<< * * def setUseAmat(self, flag: bool) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF((PyObject *)__pyx_v_A); __Pyx_GIVEREF((PyObject *)__pyx_v_A); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_A))) __PYX_ERR(48, 414, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_P); __Pyx_GIVEREF((PyObject *)__pyx_v_P); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_P))) __PYX_ERR(48, 414, __pyx_L1_error); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/PC.pyx":400 * CHKERR( PCSetOperators(self.pc, amat, pmat) ) * * def getOperators(self) -> tuple[Mat,Mat]: # <<<<<<<<<<<<<< * """Return the matrices associated with a linear system. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PC.getOperators", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_A); __Pyx_XDECREF((PyObject *)__pyx_v_P); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":416 * return (A, P) * * def setUseAmat(self, flag: bool) -> None: # <<<<<<<<<<<<<< * """Set to indicate to apply `PC` to ``A`` and not ``P``. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_27setUseAmat(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_26setUseAmat, "PC.setUseAmat(self, flag: bool) -> None\nSet to indicate to apply `PC` to ``A`` and not ``P``.\n\n Logically collective.\n\n Sets a flag to indicate that when the\n preconditioner needs to apply (part of) the operator during the\n preconditioning process, it applies to ``A`` provided to\n `TS.setRHSJacobian`, `TS.setIJacobian`, `SNES.setJacobian`,\n `KSP.setOperators` or `PC.setOperators` not the ``P``.\n\n Parameters\n ----------\n flag\n Set True to use ``A`` and False to use ``P``.\n\n See Also\n --------\n setOperators, petsc.PCSetUseAmat\n\n \nSource code at petsc4py/PETSc/PC.pyx:416"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_27setUseAmat(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_flag = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setUseAmat (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flag)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 416, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setUseAmat") < 0)) __PYX_ERR(48, 416, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_flag = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setUseAmat", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 416, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setUseAmat", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_26setUseAmat(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_flag); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_26setUseAmat(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_flag) { PetscBool __pyx_v_cflag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setUseAmat", 1); /* "petsc4py/PETSc/PC.pyx":437 * * """ * cdef PetscBool cflag = PETSC_FALSE # <<<<<<<<<<<<<< * if flag: * cflag = PETSC_TRUE */ __pyx_v_cflag = PETSC_FALSE; /* "petsc4py/PETSc/PC.pyx":438 * """ * cdef PetscBool cflag = PETSC_FALSE * if flag: # <<<<<<<<<<<<<< * cflag = PETSC_TRUE * CHKERR( PCSetUseAmat(self.pc, cflag) ) */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_flag); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(48, 438, __pyx_L1_error) if (__pyx_t_1) { /* "petsc4py/PETSc/PC.pyx":439 * cdef PetscBool cflag = PETSC_FALSE * if flag: * cflag = PETSC_TRUE # <<<<<<<<<<<<<< * CHKERR( PCSetUseAmat(self.pc, cflag) ) * */ __pyx_v_cflag = PETSC_TRUE; /* "petsc4py/PETSc/PC.pyx":438 * """ * cdef PetscBool cflag = PETSC_FALSE * if flag: # <<<<<<<<<<<<<< * cflag = PETSC_TRUE * CHKERR( PCSetUseAmat(self.pc, cflag) ) */ } /* "petsc4py/PETSc/PC.pyx":440 * if flag: * cflag = PETSC_TRUE * CHKERR( PCSetUseAmat(self.pc, cflag) ) # <<<<<<<<<<<<<< * * def getUseAmat(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCSetUseAmat(__pyx_v_self->pc, __pyx_v_cflag)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 440, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":416 * return (A, P) * * def setUseAmat(self, flag: bool) -> None: # <<<<<<<<<<<<<< * """Set to indicate to apply `PC` to ``A`` and not ``P``. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setUseAmat", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":442 * CHKERR( PCSetUseAmat(self.pc, cflag) ) * * def getUseAmat(self): # <<<<<<<<<<<<<< * """Return the flag to indicate if `PC` is applied to ``A`` or ``P``. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_29getUseAmat(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_28getUseAmat, "PC.getUseAmat(self)\nReturn the flag to indicate if `PC` is applied to ``A`` or ``P``.\n\n Logically collective.\n\n Returns\n -------\n flag : bool\n True if ``A`` is used and False if ``P``.\n\n See Also\n --------\n setUseAmat, petsc.PCGetUseAmat\n\n \nSource code at petsc4py/PETSc/PC.pyx:442"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_29getUseAmat(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getUseAmat (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getUseAmat", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getUseAmat", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_28getUseAmat(((struct PyPetscPCObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_28getUseAmat(struct PyPetscPCObject *__pyx_v_self) { PetscBool __pyx_v_cflag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getUseAmat", 1); /* "petsc4py/PETSc/PC.pyx":457 * * """ * cdef PetscBool cflag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( PCGetUseAmat(self.pc, &cflag) ) * return toBool(cflag) */ __pyx_v_cflag = PETSC_FALSE; /* "petsc4py/PETSc/PC.pyx":458 * """ * cdef PetscBool cflag = PETSC_FALSE * CHKERR( PCGetUseAmat(self.pc, &cflag) ) # <<<<<<<<<<<<<< * return toBool(cflag) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCGetUseAmat(__pyx_v_self->pc, (&__pyx_v_cflag))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 458, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":459 * cdef PetscBool cflag = PETSC_FALSE * CHKERR( PCGetUseAmat(self.pc, &cflag) ) * return toBool(cflag) # <<<<<<<<<<<<<< * * def setReusePreconditioner(self, flag: bool) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_cflag); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 459, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/PC.pyx":442 * CHKERR( PCSetUseAmat(self.pc, cflag) ) * * def getUseAmat(self): # <<<<<<<<<<<<<< * """Return the flag to indicate if `PC` is applied to ``A`` or ``P``. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.PC.getUseAmat", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":461 * return toBool(cflag) * * def setReusePreconditioner(self, flag: bool) -> None: # <<<<<<<<<<<<<< * """Set to indicate the preconditioner is to be reused. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_31setReusePreconditioner(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_30setReusePreconditioner, "PC.setReusePreconditioner(self, flag: bool) -> None\nSet to indicate the preconditioner is to be reused.\n\n Logically collective.\n\n Normally if the ``A`` matrix inside a `PC`\n changes, the `PC` automatically updates itself using information from\n the changed matrix. Enable this option prevents this.\n\n Parameters\n ----------\n flag\n Set to `True` to use the reuse the current preconditioner and\n `False` to recompute on changes to the matrix.\n\n See Also\n --------\n setOperators, petsc.PCSetReusePreconditioner\n\n \nSource code at petsc4py/PETSc/PC.pyx:461"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_31setReusePreconditioner(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_flag = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setReusePreconditioner (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flag)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 461, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setReusePreconditioner") < 0)) __PYX_ERR(48, 461, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_flag = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setReusePreconditioner", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 461, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setReusePreconditioner", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_30setReusePreconditioner(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_flag); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_30setReusePreconditioner(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_flag) { PetscBool __pyx_v_cflag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setReusePreconditioner", 1); /* "petsc4py/PETSc/PC.pyx":481 * * """ * cdef PetscBool cflag = PETSC_FALSE # <<<<<<<<<<<<<< * if flag: * cflag = PETSC_TRUE */ __pyx_v_cflag = PETSC_FALSE; /* "petsc4py/PETSc/PC.pyx":482 * """ * cdef PetscBool cflag = PETSC_FALSE * if flag: # <<<<<<<<<<<<<< * cflag = PETSC_TRUE * CHKERR( PCSetReusePreconditioner(self.pc, cflag) ) */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_flag); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(48, 482, __pyx_L1_error) if (__pyx_t_1) { /* "petsc4py/PETSc/PC.pyx":483 * cdef PetscBool cflag = PETSC_FALSE * if flag: * cflag = PETSC_TRUE # <<<<<<<<<<<<<< * CHKERR( PCSetReusePreconditioner(self.pc, cflag) ) * */ __pyx_v_cflag = PETSC_TRUE; /* "petsc4py/PETSc/PC.pyx":482 * """ * cdef PetscBool cflag = PETSC_FALSE * if flag: # <<<<<<<<<<<<<< * cflag = PETSC_TRUE * CHKERR( PCSetReusePreconditioner(self.pc, cflag) ) */ } /* "petsc4py/PETSc/PC.pyx":484 * if flag: * cflag = PETSC_TRUE * CHKERR( PCSetReusePreconditioner(self.pc, cflag) ) # <<<<<<<<<<<<<< * * def setFailedReason(self, reason: FailedReason | str) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCSetReusePreconditioner(__pyx_v_self->pc, __pyx_v_cflag)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 484, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":461 * return toBool(cflag) * * def setReusePreconditioner(self, flag: bool) -> None: # <<<<<<<<<<<<<< * """Set to indicate the preconditioner is to be reused. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setReusePreconditioner", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":486 * CHKERR( PCSetReusePreconditioner(self.pc, cflag) ) * * def setFailedReason(self, reason: FailedReason | str) -> None: # <<<<<<<<<<<<<< * """Set the reason the `PC` terminated. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_33setFailedReason(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_32setFailedReason, "PC.setFailedReason(self, reason: FailedReason | str) -> None\nSet the reason the `PC` terminated.\n\n Logically collective.\n\n Parameters\n ----------\n reason\n the reason the `PC` terminated\n\n See Also\n --------\n petsc.PCSetFailedReason\n\n \nSource code at petsc4py/PETSc/PC.pyx:486"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_33setFailedReason(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_reason = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFailedReason (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_reason,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_reason)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 486, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setFailedReason") < 0)) __PYX_ERR(48, 486, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_reason = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setFailedReason", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 486, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setFailedReason", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_32setFailedReason(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_reason); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_32setFailedReason(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_reason) { PCFailedReason __pyx_v_val; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PCFailedReason __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFailedReason", 1); /* "petsc4py/PETSc/PC.pyx":501 * * """ * cdef PetscPCFailedReason val = reason # <<<<<<<<<<<<<< * CHKERR( PCSetFailedReason(self.pc, val) ) * */ __pyx_t_1 = ((PCFailedReason)__Pyx_PyInt_As_PCFailedReason(__pyx_v_reason)); if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 501, __pyx_L1_error) __pyx_v_val = __pyx_t_1; /* "petsc4py/PETSc/PC.pyx":502 * """ * cdef PetscPCFailedReason val = reason * CHKERR( PCSetFailedReason(self.pc, val) ) # <<<<<<<<<<<<<< * * def getFailedReason(self) -> FailedReason: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCSetFailedReason(__pyx_v_self->pc, __pyx_v_val)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 502, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":486 * CHKERR( PCSetReusePreconditioner(self.pc, cflag) ) * * def setFailedReason(self, reason: FailedReason | str) -> None: # <<<<<<<<<<<<<< * """Set the reason the `PC` terminated. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setFailedReason", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":504 * CHKERR( PCSetFailedReason(self.pc, val) ) * * def getFailedReason(self) -> FailedReason: # <<<<<<<<<<<<<< * """Return the reason the `PC` terminated. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_35getFailedReason(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_34getFailedReason, "PC.getFailedReason(self) -> FailedReason\nReturn the reason the `PC` terminated.\n\n Logically collective.\n\n This is the maximum reason over all ranks in the\n `PC` communicator.\n\n See Also\n --------\n petsc.PCGetFailedReason\n\n \nSource code at petsc4py/PETSc/PC.pyx:504"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_35getFailedReason(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getFailedReason (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getFailedReason", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getFailedReason", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_34getFailedReason(((struct PyPetscPCObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_34getFailedReason(struct PyPetscPCObject *__pyx_v_self) { PCFailedReason __pyx_v_reason; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getFailedReason", 1); /* "petsc4py/PETSc/PC.pyx":517 * * """ * cdef PetscPCFailedReason reason = PC_NOERROR # <<<<<<<<<<<<<< * CHKERR( PCGetFailedReason(self.pc, &reason) ) * return reason */ __pyx_v_reason = PC_NOERROR; /* "petsc4py/PETSc/PC.pyx":518 * """ * cdef PetscPCFailedReason reason = PC_NOERROR * CHKERR( PCGetFailedReason(self.pc, &reason) ) # <<<<<<<<<<<<<< * return reason * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCGetFailedReason(__pyx_v_self->pc, (&__pyx_v_reason))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 518, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":519 * cdef PetscPCFailedReason reason = PC_NOERROR * CHKERR( PCGetFailedReason(self.pc, &reason) ) * return reason # <<<<<<<<<<<<<< * * def getFailedReasonRank(self) -> FailedReason: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_PCFailedReason(__pyx_v_reason); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 519, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/PC.pyx":504 * CHKERR( PCSetFailedReason(self.pc, val) ) * * def getFailedReason(self) -> FailedReason: # <<<<<<<<<<<<<< * """Return the reason the `PC` terminated. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.PC.getFailedReason", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":521 * return reason * * def getFailedReasonRank(self) -> FailedReason: # <<<<<<<<<<<<<< * """Return the reason the `PC` terminated on this rank. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_37getFailedReasonRank(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_36getFailedReasonRank, "PC.getFailedReasonRank(self) -> FailedReason\nReturn the reason the `PC` terminated on this rank.\n\n Not collective.\n\n Different ranks may have different reasons.\n\n See Also\n --------\n getFailedReason, petsc.PCGetFailedReasonRank\n\n \nSource code at petsc4py/PETSc/PC.pyx:521"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_37getFailedReasonRank(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getFailedReasonRank (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getFailedReasonRank", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getFailedReasonRank", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_36getFailedReasonRank(((struct PyPetscPCObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_36getFailedReasonRank(struct PyPetscPCObject *__pyx_v_self) { PCFailedReason __pyx_v_reason; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getFailedReasonRank", 1); /* "petsc4py/PETSc/PC.pyx":533 * * """ * cdef PetscPCFailedReason reason = PC_NOERROR # <<<<<<<<<<<<<< * CHKERR( PCGetFailedReasonRank(self.pc, &reason) ) * return reason */ __pyx_v_reason = PC_NOERROR; /* "petsc4py/PETSc/PC.pyx":534 * """ * cdef PetscPCFailedReason reason = PC_NOERROR * CHKERR( PCGetFailedReasonRank(self.pc, &reason) ) # <<<<<<<<<<<<<< * return reason * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCGetFailedReasonRank(__pyx_v_self->pc, (&__pyx_v_reason))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 534, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":535 * cdef PetscPCFailedReason reason = PC_NOERROR * CHKERR( PCGetFailedReasonRank(self.pc, &reason) ) * return reason # <<<<<<<<<<<<<< * * def setUp(self) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_PCFailedReason(__pyx_v_reason); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/PC.pyx":521 * return reason * * def getFailedReasonRank(self) -> FailedReason: # <<<<<<<<<<<<<< * """Return the reason the `PC` terminated on this rank. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.PC.getFailedReasonRank", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":537 * return reason * * def setUp(self) -> None: # <<<<<<<<<<<<<< * """Set up the internal data structures for the `PC`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_39setUp(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_38setUp, "PC.setUp(self) -> None\nSet up the internal data structures for the `PC`.\n\n Collective.\n\n See Also\n --------\n petsc.PCSetUp\n\n \nSource code at petsc4py/PETSc/PC.pyx:537"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_39setUp(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setUp (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("setUp", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setUp", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_38setUp(((struct PyPetscPCObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_38setUp(struct PyPetscPCObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setUp", 1); /* "petsc4py/PETSc/PC.pyx":547 * * """ * CHKERR( PCSetUp(self.pc) ) # <<<<<<<<<<<<<< * * def reset(self) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCSetUp(__pyx_v_self->pc)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 547, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":537 * return reason * * def setUp(self) -> None: # <<<<<<<<<<<<<< * """Set up the internal data structures for the `PC`. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setUp", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":549 * CHKERR( PCSetUp(self.pc) ) * * def reset(self) -> None: # <<<<<<<<<<<<<< * """Reset the `PC`, removing any allocated vectors and matrices. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_41reset(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_40reset, "PC.reset(self) -> None\nReset the `PC`, removing any allocated vectors and matrices.\n\n Collective.\n\n See Also\n --------\n petsc.PCReset\n\n \nSource code at petsc4py/PETSc/PC.pyx:549"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_41reset(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("reset (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("reset", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "reset", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_40reset(((struct PyPetscPCObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_40reset(struct PyPetscPCObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("reset", 1); /* "petsc4py/PETSc/PC.pyx":559 * * """ * CHKERR( PCReset(self.pc) ) # <<<<<<<<<<<<<< * * def setUpOnBlocks(self) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCReset(__pyx_v_self->pc)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 559, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":549 * CHKERR( PCSetUp(self.pc) ) * * def reset(self) -> None: # <<<<<<<<<<<<<< * """Reset the `PC`, removing any allocated vectors and matrices. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.reset", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":561 * CHKERR( PCReset(self.pc) ) * * def setUpOnBlocks(self) -> None: # <<<<<<<<<<<<<< * """Set up the `PC` for each block. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_43setUpOnBlocks(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_42setUpOnBlocks, "PC.setUpOnBlocks(self) -> None\nSet up the `PC` for each block.\n\n Collective.\n\n For nested preconditioners such as `BJACOBI`, `setUp` is not\n called on each sub-`KSP` when `setUp` is called on the outer `PC`. This\n routine ensures it is called.\n\n See Also\n --------\n setUp, petsc.PCSetUpOnBlocks\n\n \nSource code at petsc4py/PETSc/PC.pyx:561"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_43setUpOnBlocks(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setUpOnBlocks (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("setUpOnBlocks", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setUpOnBlocks", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_42setUpOnBlocks(((struct PyPetscPCObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_42setUpOnBlocks(struct PyPetscPCObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setUpOnBlocks", 1); /* "petsc4py/PETSc/PC.pyx":575 * * """ * CHKERR( PCSetUpOnBlocks(self.pc) ) # <<<<<<<<<<<<<< * * def apply(self, Vec x, Vec y) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCSetUpOnBlocks(__pyx_v_self->pc)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 575, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":561 * CHKERR( PCReset(self.pc) ) * * def setUpOnBlocks(self) -> None: # <<<<<<<<<<<<<< * """Set up the `PC` for each block. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setUpOnBlocks", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":577 * CHKERR( PCSetUpOnBlocks(self.pc) ) * * def apply(self, Vec x, Vec y) -> None: # <<<<<<<<<<<<<< * """Apply the `PC` to a vector. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_45apply(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_44apply, "PC.apply(self, x: Vec, y: Vec) -> None\nApply the `PC` to a vector.\n\n Collective.\n\n Parameters\n ----------\n x\n The input vector.\n y\n The output vector, cannot be the same as ``x``.\n\n See Also\n --------\n petsc.PCApply\n\n \nSource code at petsc4py/PETSc/PC.pyx:577"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_45apply(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_y = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("apply (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 577, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 577, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("apply", 1, 2, 2, 1); __PYX_ERR(48, 577, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "apply") < 0)) __PYX_ERR(48, 577, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_x = ((struct PyPetscVecObject *)values[0]); __pyx_v_y = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("apply", 1, 2, 2, __pyx_nargs); __PYX_ERR(48, 577, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.apply", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(48, 577, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(48, 577, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_44apply(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_x, __pyx_v_y); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_44apply(struct PyPetscPCObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("apply", 1); /* "petsc4py/PETSc/PC.pyx":594 * * """ * CHKERR( PCApply(self.pc, x.vec, y.vec) ) # <<<<<<<<<<<<<< * * def matApply(self, Mat x, Mat y) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCApply(__pyx_v_self->pc, __pyx_v_x->vec, __pyx_v_y->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 594, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":577 * CHKERR( PCSetUpOnBlocks(self.pc) ) * * def apply(self, Vec x, Vec y) -> None: # <<<<<<<<<<<<<< * """Apply the `PC` to a vector. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.apply", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":596 * CHKERR( PCApply(self.pc, x.vec, y.vec) ) * * def matApply(self, Mat x, Mat y) -> None: # <<<<<<<<<<<<<< * """Apply the `PC` to many vectors stored as `Mat.Type.DENSE`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_47matApply(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_46matApply, "PC.matApply(self, x: Mat, y: Mat) -> None\nApply the `PC` to many vectors stored as `Mat.Type.DENSE`.\n\n Collective.\n\n Parameters\n ----------\n x\n The input matrix.\n y\n The output matrix, cannot be the same as ``x``.\n\n See Also\n --------\n petsc.PCMatApply, petsc.PCApply\n\n \nSource code at petsc4py/PETSc/PC.pyx:596"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_47matApply(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscMatObject *__pyx_v_x = 0; struct PyPetscMatObject *__pyx_v_y = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("matApply (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 596, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 596, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("matApply", 1, 2, 2, 1); __PYX_ERR(48, 596, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "matApply") < 0)) __PYX_ERR(48, 596, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_x = ((struct PyPetscMatObject *)values[0]); __pyx_v_y = ((struct PyPetscMatObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("matApply", 1, 2, 2, __pyx_nargs); __PYX_ERR(48, 596, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.matApply", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "x", 0))) __PYX_ERR(48, 596, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "y", 0))) __PYX_ERR(48, 596, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_46matApply(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_x, __pyx_v_y); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_46matApply(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_x, struct PyPetscMatObject *__pyx_v_y) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("matApply", 1); /* "petsc4py/PETSc/PC.pyx":613 * * """ * CHKERR( PCMatApply(self.pc, x.mat, y.mat) ) # <<<<<<<<<<<<<< * * def applyTranspose(self, Vec x, Vec y) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCMatApply(__pyx_v_self->pc, __pyx_v_x->mat, __pyx_v_y->mat)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 613, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":596 * CHKERR( PCApply(self.pc, x.vec, y.vec) ) * * def matApply(self, Mat x, Mat y) -> None: # <<<<<<<<<<<<<< * """Apply the `PC` to many vectors stored as `Mat.Type.DENSE`. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.matApply", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":615 * CHKERR( PCMatApply(self.pc, x.mat, y.mat) ) * * def applyTranspose(self, Vec x, Vec y) -> None: # <<<<<<<<<<<<<< * """Apply the transpose of the `PC` to a vector. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_49applyTranspose(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_48applyTranspose, "PC.applyTranspose(self, x: Vec, y: Vec) -> None\nApply the transpose of the `PC` to a vector.\n\n Collective.\n\n For complex numbers this applies the non-Hermitian\n transpose.\n\n Parameters\n ----------\n x\n The input vector.\n y\n The output vector, cannot be the same as ``x``.\n\n See Also\n --------\n petsc.PCApply\n\n \nSource code at petsc4py/PETSc/PC.pyx:615"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_49applyTranspose(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_y = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("applyTranspose (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 615, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 615, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("applyTranspose", 1, 2, 2, 1); __PYX_ERR(48, 615, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "applyTranspose") < 0)) __PYX_ERR(48, 615, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_x = ((struct PyPetscVecObject *)values[0]); __pyx_v_y = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("applyTranspose", 1, 2, 2, __pyx_nargs); __PYX_ERR(48, 615, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.applyTranspose", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(48, 615, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(48, 615, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_48applyTranspose(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_x, __pyx_v_y); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_48applyTranspose(struct PyPetscPCObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("applyTranspose", 1); /* "petsc4py/PETSc/PC.pyx":635 * * """ * CHKERR( PCApplyTranspose(self.pc, x.vec, y.vec) ) # <<<<<<<<<<<<<< * * def applySymmetricLeft(self, Vec x, Vec y) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCApplyTranspose(__pyx_v_self->pc, __pyx_v_x->vec, __pyx_v_y->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 635, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":615 * CHKERR( PCMatApply(self.pc, x.mat, y.mat) ) * * def applyTranspose(self, Vec x, Vec y) -> None: # <<<<<<<<<<<<<< * """Apply the transpose of the `PC` to a vector. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.applyTranspose", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":637 * CHKERR( PCApplyTranspose(self.pc, x.vec, y.vec) ) * * def applySymmetricLeft(self, Vec x, Vec y) -> None: # <<<<<<<<<<<<<< * """Apply the left part of a symmetric `PC` to a vector. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_51applySymmetricLeft(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_50applySymmetricLeft, "PC.applySymmetricLeft(self, x: Vec, y: Vec) -> None\nApply the left part of a symmetric `PC` to a vector.\n\n Collective.\n\n Parameters\n ----------\n x\n The input vector.\n y\n The output vector, cannot be the same as ``x``.\n\n See Also\n --------\n petsc.PCApplySymmetricLeft\n\n \nSource code at petsc4py/PETSc/PC.pyx:637"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_51applySymmetricLeft(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_y = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("applySymmetricLeft (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 637, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 637, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("applySymmetricLeft", 1, 2, 2, 1); __PYX_ERR(48, 637, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "applySymmetricLeft") < 0)) __PYX_ERR(48, 637, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_x = ((struct PyPetscVecObject *)values[0]); __pyx_v_y = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("applySymmetricLeft", 1, 2, 2, __pyx_nargs); __PYX_ERR(48, 637, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.applySymmetricLeft", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(48, 637, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(48, 637, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_50applySymmetricLeft(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_x, __pyx_v_y); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_50applySymmetricLeft(struct PyPetscPCObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("applySymmetricLeft", 1); /* "petsc4py/PETSc/PC.pyx":654 * * """ * CHKERR( PCApplySymmetricLeft(self.pc, x.vec, y.vec) ) # <<<<<<<<<<<<<< * * def applySymmetricRight(self, Vec x, Vec y) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCApplySymmetricLeft(__pyx_v_self->pc, __pyx_v_x->vec, __pyx_v_y->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 654, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":637 * CHKERR( PCApplyTranspose(self.pc, x.vec, y.vec) ) * * def applySymmetricLeft(self, Vec x, Vec y) -> None: # <<<<<<<<<<<<<< * """Apply the left part of a symmetric `PC` to a vector. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.applySymmetricLeft", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":656 * CHKERR( PCApplySymmetricLeft(self.pc, x.vec, y.vec) ) * * def applySymmetricRight(self, Vec x, Vec y) -> None: # <<<<<<<<<<<<<< * """Apply the right part of a symmetric `PC` to a vector. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_53applySymmetricRight(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_52applySymmetricRight, "PC.applySymmetricRight(self, x: Vec, y: Vec) -> None\nApply the right part of a symmetric `PC` to a vector.\n\n Collective.\n\n Parameters\n ----------\n x\n The input vector.\n y\n The output vector, cannot be the same as ``x``.\n\n See Also\n --------\n petsc.PCApplySymmetricRight\n\n \nSource code at petsc4py/PETSc/PC.pyx:656"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_53applySymmetricRight(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_y = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("applySymmetricRight (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 656, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 656, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("applySymmetricRight", 1, 2, 2, 1); __PYX_ERR(48, 656, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "applySymmetricRight") < 0)) __PYX_ERR(48, 656, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_x = ((struct PyPetscVecObject *)values[0]); __pyx_v_y = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("applySymmetricRight", 1, 2, 2, __pyx_nargs); __PYX_ERR(48, 656, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.applySymmetricRight", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(48, 656, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(48, 656, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_52applySymmetricRight(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_x, __pyx_v_y); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_52applySymmetricRight(struct PyPetscPCObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("applySymmetricRight", 1); /* "petsc4py/PETSc/PC.pyx":673 * * """ * CHKERR( PCApplySymmetricRight(self.pc, x.vec, y.vec) ) # <<<<<<<<<<<<<< * * # --- discretization space --- */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCApplySymmetricRight(__pyx_v_self->pc, __pyx_v_x->vec, __pyx_v_y->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 673, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":656 * CHKERR( PCApplySymmetricLeft(self.pc, x.vec, y.vec) ) * * def applySymmetricRight(self, Vec x, Vec y) -> None: # <<<<<<<<<<<<<< * """Apply the right part of a symmetric `PC` to a vector. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.applySymmetricRight", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":677 * # --- discretization space --- * * def getDM(self) -> DM: # <<<<<<<<<<<<<< * """Return the `DM` associated with the `PC`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_55getDM(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_54getDM, "PC.getDM(self) -> DM\nReturn the `DM` associated with the `PC`.\n\n Not collective.\n\n See Also\n --------\n petsc.PCGetDM\n\n \nSource code at petsc4py/PETSc/PC.pyx:677"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_55getDM(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getDM (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getDM", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getDM", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_54getDM(((struct PyPetscPCObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_54getDM(struct PyPetscPCObject *__pyx_v_self) { DM __pyx_v_newdm; struct PyPetscDMObject *__pyx_v_dm = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getDM", 1); /* "petsc4py/PETSc/PC.pyx":687 * * """ * cdef PetscDM newdm = NULL # <<<<<<<<<<<<<< * CHKERR( PCGetDM(self.pc, &newdm) ) * cdef DM dm = subtype_DM(newdm)() */ __pyx_v_newdm = NULL; /* "petsc4py/PETSc/PC.pyx":688 * """ * cdef PetscDM newdm = NULL * CHKERR( PCGetDM(self.pc, &newdm) ) # <<<<<<<<<<<<<< * cdef DM dm = subtype_DM(newdm)() * dm.dm = newdm */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCGetDM(__pyx_v_self->pc, (&__pyx_v_newdm))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 688, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":689 * cdef PetscDM newdm = NULL * CHKERR( PCGetDM(self.pc, &newdm) ) * cdef DM dm = subtype_DM(newdm)() # <<<<<<<<<<<<<< * dm.dm = newdm * CHKERR( PetscINCREF(dm.obj) ) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_newdm)); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 689, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(48, 689, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(48, 689, __pyx_L1_error) __pyx_v_dm = ((struct PyPetscDMObject *)__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/PC.pyx":690 * CHKERR( PCGetDM(self.pc, &newdm) ) * cdef DM dm = subtype_DM(newdm)() * dm.dm = newdm # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(dm.obj) ) * return dm */ __pyx_v_dm->dm = __pyx_v_newdm; /* "petsc4py/PETSc/PC.pyx":691 * cdef DM dm = subtype_DM(newdm)() * dm.dm = newdm * CHKERR( PetscINCREF(dm.obj) ) # <<<<<<<<<<<<<< * return dm * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_dm->__pyx_base.obj)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 691, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":692 * dm.dm = newdm * CHKERR( PetscINCREF(dm.obj) ) * return dm # <<<<<<<<<<<<<< * * def setDM(self, DM dm) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_dm); __pyx_r = ((PyObject *)__pyx_v_dm); goto __pyx_L0; /* "petsc4py/PETSc/PC.pyx":677 * # --- discretization space --- * * def getDM(self) -> DM: # <<<<<<<<<<<<<< * """Return the `DM` associated with the `PC`. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.PC.getDM", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_dm); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":694 * return dm * * def setDM(self, DM dm) -> None: # <<<<<<<<<<<<<< * """Set the `DM` that may be used by some preconditioners. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_57setDM(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_56setDM, "PC.setDM(self, dm: DM) -> None\nSet the `DM` that may be used by some preconditioners.\n\n Logically collective.\n\n Parameters\n ----------\n dm\n The `DM` object.\n\n See Also\n --------\n petsc.PCSetDM\n\n \nSource code at petsc4py/PETSc/PC.pyx:694"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_57setDM(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscDMObject *__pyx_v_dm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setDM (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dm,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dm)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 694, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setDM") < 0)) __PYX_ERR(48, 694, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_dm = ((struct PyPetscDMObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setDM", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 694, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setDM", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_ptype_8petsc4py_5PETSc_DM, 0, "dm", 0))) __PYX_ERR(48, 694, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_56setDM(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_dm); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_56setDM(struct PyPetscPCObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setDM", 1); /* "petsc4py/PETSc/PC.pyx":709 * * """ * CHKERR( PCSetDM(self.pc, dm.dm) ) # <<<<<<<<<<<<<< * * def setCoordinates(self, coordinates: Sequence[Sequence[float]]) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCSetDM(__pyx_v_self->pc, __pyx_v_dm->dm)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 709, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":694 * return dm * * def setDM(self, DM dm) -> None: # <<<<<<<<<<<<<< * """Set the `DM` that may be used by some preconditioners. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setDM", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":711 * CHKERR( PCSetDM(self.pc, dm.dm) ) * * def setCoordinates(self, coordinates: Sequence[Sequence[float]]) -> None: # <<<<<<<<<<<<<< * """Set the coordinates for the nodes on the local process. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_59setCoordinates(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_58setCoordinates, "PC.setCoordinates(self, coordinates: Sequence[Sequence[float]]) -> None\nSet the coordinates for the nodes on the local process.\n\n Collective.\n\n Parameters\n ----------\n coordinates\n The two dimensional coordinate array.\n\n See Also\n --------\n petsc.PCSetCoordinates\n\n \nSource code at petsc4py/PETSc/PC.pyx:711"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_59setCoordinates(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_coordinates = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setCoordinates (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_coordinates,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_coordinates)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 711, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setCoordinates") < 0)) __PYX_ERR(48, 711, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_coordinates = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setCoordinates", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 711, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setCoordinates", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_58setCoordinates(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_coordinates); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_58setCoordinates(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_coordinates) { PyArrayObject *__pyx_v_xyz = 0; PetscInt __pyx_v_nvtx; PetscInt __pyx_v_ndim; PetscReal *__pyx_v_coords; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setCoordinates", 1); /* "petsc4py/PETSc/PC.pyx":726 * * """ * cdef ndarray xyz = iarray(coordinates, NPY_PETSC_REAL) # <<<<<<<<<<<<<< * if PyArray_ISFORTRAN(xyz): xyz = PyArray_Copy(xyz) * if PyArray_NDIM(xyz) != 2: raise ValueError( */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray(__pyx_v_coordinates, NPY_PETSC_REAL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 726, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_xyz = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/PC.pyx":727 * """ * cdef ndarray xyz = iarray(coordinates, NPY_PETSC_REAL) * if PyArray_ISFORTRAN(xyz): xyz = PyArray_Copy(xyz) # <<<<<<<<<<<<<< * if PyArray_NDIM(xyz) != 2: raise ValueError( * ("coordinates must have two dimensions: " */ __pyx_t_2 = PyArray_ISFORTRAN(__pyx_v_xyz); if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)PyArray_Copy(__pyx_v_xyz)); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 727, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_xyz, ((PyArrayObject *)__pyx_t_1)); __pyx_t_1 = 0; } /* "petsc4py/PETSc/PC.pyx":728 * cdef ndarray xyz = iarray(coordinates, NPY_PETSC_REAL) * if PyArray_ISFORTRAN(xyz): xyz = PyArray_Copy(xyz) * if PyArray_NDIM(xyz) != 2: raise ValueError( # <<<<<<<<<<<<<< * ("coordinates must have two dimensions: " * "coordinates.ndim=%d") % (PyArray_NDIM(xyz)) ) */ __pyx_t_2 = (PyArray_NDIM(__pyx_v_xyz) != 2); if (unlikely(__pyx_t_2)) { /* "petsc4py/PETSc/PC.pyx":730 * if PyArray_NDIM(xyz) != 2: raise ValueError( * ("coordinates must have two dimensions: " * "coordinates.ndim=%d") % (PyArray_NDIM(xyz)) ) # <<<<<<<<<<<<<< * cdef PetscInt nvtx = PyArray_DIM(xyz, 0) * cdef PetscInt ndim = PyArray_DIM(xyz, 1) */ __pyx_t_1 = __Pyx_PyInt_From_int(PyArray_NDIM(__pyx_v_xyz)); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 730, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_coordinates_must_have_two_dimens, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(48, 730, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/PC.pyx":728 * cdef ndarray xyz = iarray(coordinates, NPY_PETSC_REAL) * if PyArray_ISFORTRAN(xyz): xyz = PyArray_Copy(xyz) * if PyArray_NDIM(xyz) != 2: raise ValueError( # <<<<<<<<<<<<<< * ("coordinates must have two dimensions: " * "coordinates.ndim=%d") % (PyArray_NDIM(xyz)) ) */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 728, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(48, 728, __pyx_L1_error) } /* "petsc4py/PETSc/PC.pyx":731 * ("coordinates must have two dimensions: " * "coordinates.ndim=%d") % (PyArray_NDIM(xyz)) ) * cdef PetscInt nvtx = PyArray_DIM(xyz, 0) # <<<<<<<<<<<<<< * cdef PetscInt ndim = PyArray_DIM(xyz, 1) * cdef PetscReal *coords = PyArray_DATA(xyz) */ __pyx_v_nvtx = ((PetscInt)PyArray_DIM(__pyx_v_xyz, 0)); /* "petsc4py/PETSc/PC.pyx":732 * "coordinates.ndim=%d") % (PyArray_NDIM(xyz)) ) * cdef PetscInt nvtx = PyArray_DIM(xyz, 0) * cdef PetscInt ndim = PyArray_DIM(xyz, 1) # <<<<<<<<<<<<<< * cdef PetscReal *coords = PyArray_DATA(xyz) * CHKERR( PCSetCoordinates(self.pc, ndim, nvtx, coords) ) */ __pyx_v_ndim = ((PetscInt)PyArray_DIM(__pyx_v_xyz, 1)); /* "petsc4py/PETSc/PC.pyx":733 * cdef PetscInt nvtx = PyArray_DIM(xyz, 0) * cdef PetscInt ndim = PyArray_DIM(xyz, 1) * cdef PetscReal *coords = PyArray_DATA(xyz) # <<<<<<<<<<<<<< * CHKERR( PCSetCoordinates(self.pc, ndim, nvtx, coords) ) * */ __pyx_v_coords = ((PetscReal *)PyArray_DATA(__pyx_v_xyz)); /* "petsc4py/PETSc/PC.pyx":734 * cdef PetscInt ndim = PyArray_DIM(xyz, 1) * cdef PetscReal *coords = PyArray_DATA(xyz) * CHKERR( PCSetCoordinates(self.pc, ndim, nvtx, coords) ) # <<<<<<<<<<<<<< * * # --- Python --- */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCSetCoordinates(__pyx_v_self->pc, __pyx_v_ndim, __pyx_v_nvtx, __pyx_v_coords)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 734, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":711 * CHKERR( PCSetDM(self.pc, dm.dm) ) * * def setCoordinates(self, coordinates: Sequence[Sequence[float]]) -> None: # <<<<<<<<<<<<<< * """Set the coordinates for the nodes on the local process. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.PC.setCoordinates", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_xyz); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":738 * # --- Python --- * * def createPython(self, context: Any = None, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Create a preconditioner of Python type. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_61createPython(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_60createPython, "PC.createPython(self, context: Any = None, comm: Comm | None = None) -> Self\nCreate a preconditioner of Python type.\n\n Collective.\n\n Parameters\n ----------\n context\n An instance of the Python class implementing the required methods.\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n petsc_python_pc, setType, setPythonContext, PC.Type.PYTHON\n\n \nSource code at petsc4py/PETSc/PC.pyx:738"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_61createPython(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_context = 0; PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createPython (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_context,&__pyx_n_s_comm,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_context); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 738, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 738, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createPython") < 0)) __PYX_ERR(48, 738, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_context = values[0]; __pyx_v_comm = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createPython", 0, 0, 2, __pyx_nargs); __PYX_ERR(48, 738, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.createPython", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_60createPython(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_context, __pyx_v_comm); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_60createPython(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PC __pyx_v_newpc; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PetscErrorCode __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createPython", 1); /* "petsc4py/PETSc/PC.pyx":755 * * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscPC newpc = NULL * CHKERR( PCCreate(ccomm, &newpc) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(48, 755, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/PC.pyx":756 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscPC newpc = NULL # <<<<<<<<<<<<<< * CHKERR( PCCreate(ccomm, &newpc) ) * CHKERR( PetscCLEAR(self.obj) ); self.pc = newpc */ __pyx_v_newpc = NULL; /* "petsc4py/PETSc/PC.pyx":757 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscPC newpc = NULL * CHKERR( PCCreate(ccomm, &newpc) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.pc = newpc * CHKERR( PCSetType(self.pc, PCPYTHON) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCCreate(__pyx_v_ccomm, (&__pyx_v_newpc))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 757, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":758 * cdef PetscPC newpc = NULL * CHKERR( PCCreate(ccomm, &newpc) ) * CHKERR( PetscCLEAR(self.obj) ); self.pc = newpc # <<<<<<<<<<<<<< * CHKERR( PCSetType(self.pc, PCPYTHON) ) * CHKERR( PCPythonSetContext(self.pc, context) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 758, __pyx_L1_error) __pyx_v_self->pc = __pyx_v_newpc; /* "petsc4py/PETSc/PC.pyx":759 * CHKERR( PCCreate(ccomm, &newpc) ) * CHKERR( PetscCLEAR(self.obj) ); self.pc = newpc * CHKERR( PCSetType(self.pc, PCPYTHON) ) # <<<<<<<<<<<<<< * CHKERR( PCPythonSetContext(self.pc, context) ) * return self */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCSetType(__pyx_v_self->pc, PCPYTHON)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 759, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":760 * CHKERR( PetscCLEAR(self.obj) ); self.pc = newpc * CHKERR( PCSetType(self.pc, PCPYTHON) ) * CHKERR( PCPythonSetContext(self.pc, context) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = PCPythonSetContext(__pyx_v_self->pc, ((void *)__pyx_v_context)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 760, __pyx_L1_error) __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_t_2); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 760, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":761 * CHKERR( PCSetType(self.pc, PCPYTHON) ) * CHKERR( PCPythonSetContext(self.pc, context) ) * return self # <<<<<<<<<<<<<< * * def setPythonContext(self, context: Any) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/PC.pyx":738 * # --- Python --- * * def createPython(self, context: Any = None, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Create a preconditioner of Python type. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.createPython", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":763 * return self * * def setPythonContext(self, context: Any) -> None: # <<<<<<<<<<<<<< * """Set the instance of the class implementing the required Python methods. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_63setPythonContext(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_62setPythonContext, "PC.setPythonContext(self, context: Any) -> None\nSet the instance of the class implementing the required Python methods.\n\n Not collective.\n\n See Also\n --------\n petsc_python_pc, getPythonContext\n\n \nSource code at petsc4py/PETSc/PC.pyx:763"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_63setPythonContext(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_context = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPythonContext (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_context,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_context)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 763, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setPythonContext") < 0)) __PYX_ERR(48, 763, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_context = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPythonContext", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 763, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setPythonContext", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_62setPythonContext(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_context); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_62setPythonContext(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_context) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPythonContext", 1); /* "petsc4py/PETSc/PC.pyx":773 * * """ * CHKERR( PCPythonSetContext(self.pc, context) ) # <<<<<<<<<<<<<< * * def getPythonContext(self) -> Any: */ __pyx_t_1 = PCPythonSetContext(__pyx_v_self->pc, ((void *)__pyx_v_context)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 773, __pyx_L1_error) __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_t_1); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 773, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":763 * return self * * def setPythonContext(self, context: Any) -> None: # <<<<<<<<<<<<<< * """Set the instance of the class implementing the required Python methods. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setPythonContext", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":775 * CHKERR( PCPythonSetContext(self.pc, context) ) * * def getPythonContext(self) -> Any: # <<<<<<<<<<<<<< * """Return the instance of the class implementing the required Python methods. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_65getPythonContext(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_64getPythonContext, "PC.getPythonContext(self) -> Any\nReturn the instance of the class implementing the required Python methods.\n\n Not collective.\n\n See Also\n --------\n petsc_python_pc, setPythonContext\n\n \nSource code at petsc4py/PETSc/PC.pyx:775"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_65getPythonContext(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getPythonContext (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getPythonContext", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getPythonContext", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_64getPythonContext(((struct PyPetscPCObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_64getPythonContext(struct PyPetscPCObject *__pyx_v_self) { void *__pyx_v_context; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getPythonContext", 1); /* "petsc4py/PETSc/PC.pyx":785 * * """ * cdef void *context = NULL # <<<<<<<<<<<<<< * CHKERR( PCPythonGetContext(self.pc, &context) ) * if context == NULL: return None */ __pyx_v_context = NULL; /* "petsc4py/PETSc/PC.pyx":786 * """ * cdef void *context = NULL * CHKERR( PCPythonGetContext(self.pc, &context) ) # <<<<<<<<<<<<<< * if context == NULL: return None * else: return context */ __pyx_t_1 = PCPythonGetContext(__pyx_v_self->pc, (&__pyx_v_context)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 786, __pyx_L1_error) __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_t_1); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 786, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":787 * cdef void *context = NULL * CHKERR( PCPythonGetContext(self.pc, &context) ) * if context == NULL: return None # <<<<<<<<<<<<<< * else: return context * */ __pyx_t_3 = (__pyx_v_context == NULL); if (__pyx_t_3) { __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } /* "petsc4py/PETSc/PC.pyx":788 * CHKERR( PCPythonGetContext(self.pc, &context) ) * if context == NULL: return None * else: return context # <<<<<<<<<<<<<< * * def setPythonType(self, py_type: str) -> None: */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_context)); __pyx_r = ((PyObject *)__pyx_v_context); goto __pyx_L0; } /* "petsc4py/PETSc/PC.pyx":775 * CHKERR( PCPythonSetContext(self.pc, context) ) * * def getPythonContext(self) -> Any: # <<<<<<<<<<<<<< * """Return the instance of the class implementing the required Python methods. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.getPythonContext", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":790 * else: return context * * def setPythonType(self, py_type: str) -> None: # <<<<<<<<<<<<<< * """Set the fully qualified Python name of the class to be used. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_67setPythonType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_66setPythonType, "PC.setPythonType(self, py_type: str) -> None\nSet the fully qualified Python name of the class to be used.\n\n Collective.\n\n See Also\n --------\n petsc_python_pc, setPythonContext, getPythonType, petsc.PCPythonSetType\n\n \nSource code at petsc4py/PETSc/PC.pyx:790"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_67setPythonType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_py_type = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPythonType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_py_type,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_py_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 790, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setPythonType") < 0)) __PYX_ERR(48, 790, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_py_type = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPythonType", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 790, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setPythonType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_66setPythonType(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_py_type); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_66setPythonType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_py_type) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPythonType", 0); __Pyx_INCREF(__pyx_v_py_type); /* "petsc4py/PETSc/PC.pyx":800 * * """ * cdef const char *cval = NULL # <<<<<<<<<<<<<< * py_type = str2bytes(py_type, &cval) * CHKERR( PCPythonSetType(self.pc, cval) ) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/PC.pyx":801 * """ * cdef const char *cval = NULL * py_type = str2bytes(py_type, &cval) # <<<<<<<<<<<<<< * CHKERR( PCPythonSetType(self.pc, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_py_type, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 801, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_py_type, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/PC.pyx":802 * cdef const char *cval = NULL * py_type = str2bytes(py_type, &cval) * CHKERR( PCPythonSetType(self.pc, cval) ) # <<<<<<<<<<<<<< * * def getPythonType(self) -> str: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCPythonSetType(__pyx_v_self->pc, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 802, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":790 * else: return context * * def setPythonType(self, py_type: str) -> None: # <<<<<<<<<<<<<< * """Set the fully qualified Python name of the class to be used. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PC.setPythonType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_py_type); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":804 * CHKERR( PCPythonSetType(self.pc, cval) ) * * def getPythonType(self) -> str: # <<<<<<<<<<<<<< * """Return the fully qualified Python name of the class used by the preconditioner. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_69getPythonType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_68getPythonType, "PC.getPythonType(self) -> str\nReturn the fully qualified Python name of the class used by the preconditioner.\n\n Not collective.\n\n See Also\n --------\n petsc_python_pc, setPythonContext, setPythonType, petsc.PCPythonGetType\n\n \nSource code at petsc4py/PETSc/PC.pyx:804"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_69getPythonType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getPythonType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getPythonType", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getPythonType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_68getPythonType(((struct PyPetscPCObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_68getPythonType(struct PyPetscPCObject *__pyx_v_self) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getPythonType", 1); /* "petsc4py/PETSc/PC.pyx":814 * * """ * cdef const char *cval = NULL # <<<<<<<<<<<<<< * CHKERR( PCPythonGetType(self.pc, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/PC.pyx":815 * """ * cdef const char *cval = NULL * CHKERR( PCPythonGetType(self.pc, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCPythonGetType(__pyx_v_self->pc, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 815, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":816 * cdef const char *cval = NULL * CHKERR( PCPythonGetType(self.pc, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * # --- ASM --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 816, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/PC.pyx":804 * CHKERR( PCPythonSetType(self.pc, cval) ) * * def getPythonType(self) -> str: # <<<<<<<<<<<<<< * """Return the fully qualified Python name of the class used by the preconditioner. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.PC.getPythonType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":820 * # --- ASM --- * * def setASMType(self, asmtype: ASMType) -> None: # <<<<<<<<<<<<<< * """Set the type of restriction and interpolation. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_71setASMType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_70setASMType, "PC.setASMType(self, asmtype: ASMType) -> None\nSet the type of restriction and interpolation.\n\n Logically collective.\n\n Parameters\n ----------\n asmtype\n The type of ASM you wish to use.\n\n See Also\n --------\n petsc.PCASMSetType\n\n \nSource code at petsc4py/PETSc/PC.pyx:820"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_71setASMType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_asmtype = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setASMType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_asmtype,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_asmtype)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 820, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setASMType") < 0)) __PYX_ERR(48, 820, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_asmtype = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setASMType", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 820, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setASMType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_70setASMType(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_asmtype); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_70setASMType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_asmtype) { PCASMType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PCASMType __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setASMType", 1); /* "petsc4py/PETSc/PC.pyx":835 * * """ * cdef PetscPCASMType cval = asmtype # <<<<<<<<<<<<<< * CHKERR( PCASMSetType(self.pc, cval) ) * */ __pyx_t_1 = ((PCASMType)__Pyx_PyInt_As_PCASMType(__pyx_v_asmtype)); if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 835, __pyx_L1_error) __pyx_v_cval = __pyx_t_1; /* "petsc4py/PETSc/PC.pyx":836 * """ * cdef PetscPCASMType cval = asmtype * CHKERR( PCASMSetType(self.pc, cval) ) # <<<<<<<<<<<<<< * * def setASMOverlap(self, overlap: int) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCASMSetType(__pyx_v_self->pc, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 836, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":820 * # --- ASM --- * * def setASMType(self, asmtype: ASMType) -> None: # <<<<<<<<<<<<<< * """Set the type of restriction and interpolation. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setASMType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":838 * CHKERR( PCASMSetType(self.pc, cval) ) * * def setASMOverlap(self, overlap: int) -> None: # <<<<<<<<<<<<<< * """Set the overlap between a pair of subdomains. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_73setASMOverlap(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_72setASMOverlap, "PC.setASMOverlap(self, overlap: int) -> None\nSet the overlap between a pair of subdomains.\n\n Logically collective.\n\n Parameters\n ----------\n overlap\n The amount of overlap between subdomains.\n\n See Also\n --------\n petsc.PCASMSetOverlap\n\n \nSource code at petsc4py/PETSc/PC.pyx:838"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_73setASMOverlap(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_overlap = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setASMOverlap (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_overlap,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_overlap)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 838, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setASMOverlap") < 0)) __PYX_ERR(48, 838, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_overlap = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setASMOverlap", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 838, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setASMOverlap", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_72setASMOverlap(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_overlap); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_72setASMOverlap(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_overlap) { PetscInt __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setASMOverlap", 1); /* "petsc4py/PETSc/PC.pyx":853 * * """ * cdef PetscInt ival = asInt(overlap) # <<<<<<<<<<<<<< * CHKERR( PCASMSetOverlap(self.pc, ival) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_overlap); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 853, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "petsc4py/PETSc/PC.pyx":854 * """ * cdef PetscInt ival = asInt(overlap) * CHKERR( PCASMSetOverlap(self.pc, ival) ) # <<<<<<<<<<<<<< * * def setASMLocalSubdomains( */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCASMSetOverlap(__pyx_v_self->pc, __pyx_v_ival)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 854, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":838 * CHKERR( PCASMSetType(self.pc, cval) ) * * def setASMOverlap(self, overlap: int) -> None: # <<<<<<<<<<<<<< * """Set the overlap between a pair of subdomains. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setASMOverlap", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":856 * CHKERR( PCASMSetOverlap(self.pc, ival) ) * * def setASMLocalSubdomains( # <<<<<<<<<<<<<< * self, * nsd: int, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_75setASMLocalSubdomains(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_74setASMLocalSubdomains, "PC.setASMLocalSubdomains(self, nsd: int, is_: Sequence[IS] | None = None, is_local: Sequence[IS] | None = None) -> None\nSet the local subdomains.\n\n Collective.\n\n Parameters\n ----------\n nsd\n The number of subdomains for this process.\n is\\_\n Defines the subdomains for this process or `None` to determine\n internally.\n is_local\n Defines the local part of the subdomains for this process, only used\n for `PC.ASMType.RESTRICT`.\n\n See Also\n --------\n setASMTotalSubdomains, petsc.PCASMSetLocalSubdomains\n\n \nSource code at petsc4py/PETSc/PC.pyx:856"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_75setASMLocalSubdomains(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_nsd = 0; PyObject *__pyx_v_is_ = 0; PyObject *__pyx_v_is_local = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setASMLocalSubdomains (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nsd,&__pyx_n_s_is,&__pyx_n_s_is_local,0}; /* "petsc4py/PETSc/PC.pyx":859 * self, * nsd: int, * is_: Sequence[IS] | None = None, # <<<<<<<<<<<<<< * is_local: Sequence[IS] | None = None) -> None: * """Set the local subdomains. */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/PC.pyx":860 * nsd: int, * is_: Sequence[IS] | None = None, * is_local: Sequence[IS] | None = None) -> None: # <<<<<<<<<<<<<< * """Set the local subdomains. * */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_nsd)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 856, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_is); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 856, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_is_local); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 856, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setASMLocalSubdomains") < 0)) __PYX_ERR(48, 856, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_nsd = values[0]; __pyx_v_is_ = values[1]; __pyx_v_is_local = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setASMLocalSubdomains", 0, 1, 3, __pyx_nargs); __PYX_ERR(48, 856, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setASMLocalSubdomains", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_74setASMLocalSubdomains(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_nsd, __pyx_v_is_, __pyx_v_is_local); /* "petsc4py/PETSc/PC.pyx":856 * CHKERR( PCASMSetOverlap(self.pc, ival) ) * * def setASMLocalSubdomains( # <<<<<<<<<<<<<< * self, * nsd: int, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_74setASMLocalSubdomains(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_nsd, PyObject *__pyx_v_is_, PyObject *__pyx_v_is_local) { PetscInt __pyx_v_n; PetscInt __pyx_v_i; IS *__pyx_v_isets; IS *__pyx_v_isets_local; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; Py_ssize_t __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PetscErrorCode __pyx_t_6; PetscInt __pyx_t_7; PetscInt __pyx_t_8; IS __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setASMLocalSubdomains", 1); /* "petsc4py/PETSc/PC.pyx":881 * * """ * cdef PetscInt n = asInt(nsd) # <<<<<<<<<<<<<< * cdef PetscInt i = 0 * cdef PetscIS *isets = NULL */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_nsd); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 881, __pyx_L1_error) __pyx_v_n = __pyx_t_1; /* "petsc4py/PETSc/PC.pyx":882 * """ * cdef PetscInt n = asInt(nsd) * cdef PetscInt i = 0 # <<<<<<<<<<<<<< * cdef PetscIS *isets = NULL * cdef PetscIS *isets_local = NULL */ __pyx_v_i = 0; /* "petsc4py/PETSc/PC.pyx":883 * cdef PetscInt n = asInt(nsd) * cdef PetscInt i = 0 * cdef PetscIS *isets = NULL # <<<<<<<<<<<<<< * cdef PetscIS *isets_local = NULL * if is_ is not None: */ __pyx_v_isets = NULL; /* "petsc4py/PETSc/PC.pyx":884 * cdef PetscInt i = 0 * cdef PetscIS *isets = NULL * cdef PetscIS *isets_local = NULL # <<<<<<<<<<<<<< * if is_ is not None: * assert len(is_) == nsd */ __pyx_v_isets_local = NULL; /* "petsc4py/PETSc/PC.pyx":885 * cdef PetscIS *isets = NULL * cdef PetscIS *isets_local = NULL * if is_ is not None: # <<<<<<<<<<<<<< * assert len(is_) == nsd * CHKERR( PetscMalloc(n*sizeof(PetscIS), &isets) ) */ __pyx_t_2 = (__pyx_v_is_ != Py_None); if (__pyx_t_2) { /* "petsc4py/PETSc/PC.pyx":886 * cdef PetscIS *isets_local = NULL * if is_ is not None: * assert len(is_) == nsd # <<<<<<<<<<<<<< * CHKERR( PetscMalloc(n*sizeof(PetscIS), &isets) ) * for i in range(n): */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_3 = PyObject_Length(__pyx_v_is_); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(48, 886, __pyx_L1_error) __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 886, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_v_nsd, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 886, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(48, 886, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(48, 886, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(48, 886, __pyx_L1_error) #endif /* "petsc4py/PETSc/PC.pyx":887 * if is_ is not None: * assert len(is_) == nsd * CHKERR( PetscMalloc(n*sizeof(PetscIS), &isets) ) # <<<<<<<<<<<<<< * for i in range(n): * isets[i] = (is_[i]).iset */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((((size_t)__pyx_v_n) * (sizeof(IS))), (&__pyx_v_isets))); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 887, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":888 * assert len(is_) == nsd * CHKERR( PetscMalloc(n*sizeof(PetscIS), &isets) ) * for i in range(n): # <<<<<<<<<<<<<< * isets[i] = (is_[i]).iset * if is_local is not None: */ __pyx_t_1 = __pyx_v_n; __pyx_t_7 = __pyx_t_1; for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { __pyx_v_i = __pyx_t_8; /* "petsc4py/PETSc/PC.pyx":889 * CHKERR( PetscMalloc(n*sizeof(PetscIS), &isets) ) * for i in range(n): * isets[i] = (is_[i]).iset # <<<<<<<<<<<<<< * if is_local is not None: * assert len(is_local) == nsd */ __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_is_, __pyx_v_i, PetscInt, 1, __Pyx_PyInt_From_PetscInt, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 889, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (!(likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(48, 889, __pyx_L1_error) __pyx_t_9 = ((struct PyPetscISObject *)__pyx_t_5)->iset; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; (__pyx_v_isets[__pyx_v_i]) = __pyx_t_9; } /* "petsc4py/PETSc/PC.pyx":885 * cdef PetscIS *isets = NULL * cdef PetscIS *isets_local = NULL * if is_ is not None: # <<<<<<<<<<<<<< * assert len(is_) == nsd * CHKERR( PetscMalloc(n*sizeof(PetscIS), &isets) ) */ } /* "petsc4py/PETSc/PC.pyx":890 * for i in range(n): * isets[i] = (is_[i]).iset * if is_local is not None: # <<<<<<<<<<<<<< * assert len(is_local) == nsd * CHKERR( PetscMalloc(n*sizeof(PetscIS), &isets_local) ) */ __pyx_t_2 = (__pyx_v_is_local != Py_None); if (__pyx_t_2) { /* "petsc4py/PETSc/PC.pyx":891 * isets[i] = (is_[i]).iset * if is_local is not None: * assert len(is_local) == nsd # <<<<<<<<<<<<<< * CHKERR( PetscMalloc(n*sizeof(PetscIS), &isets_local) ) * for i in range(n): */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_3 = PyObject_Length(__pyx_v_is_local); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(48, 891, __pyx_L1_error) __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 891, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_v_nsd, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 891, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(48, 891, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(48, 891, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(48, 891, __pyx_L1_error) #endif /* "petsc4py/PETSc/PC.pyx":892 * if is_local is not None: * assert len(is_local) == nsd * CHKERR( PetscMalloc(n*sizeof(PetscIS), &isets_local) ) # <<<<<<<<<<<<<< * for i in range(n): * isets_local[i] = (is_local[i]).iset */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((((size_t)__pyx_v_n) * (sizeof(IS))), (&__pyx_v_isets_local))); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 892, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":893 * assert len(is_local) == nsd * CHKERR( PetscMalloc(n*sizeof(PetscIS), &isets_local) ) * for i in range(n): # <<<<<<<<<<<<<< * isets_local[i] = (is_local[i]).iset * CHKERR( PCASMSetLocalSubdomains(self.pc, n, isets, isets_local) ) */ __pyx_t_1 = __pyx_v_n; __pyx_t_7 = __pyx_t_1; for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { __pyx_v_i = __pyx_t_8; /* "petsc4py/PETSc/PC.pyx":894 * CHKERR( PetscMalloc(n*sizeof(PetscIS), &isets_local) ) * for i in range(n): * isets_local[i] = (is_local[i]).iset # <<<<<<<<<<<<<< * CHKERR( PCASMSetLocalSubdomains(self.pc, n, isets, isets_local) ) * CHKERR( PetscFree(isets) ) */ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_is_local, __pyx_v_i, PetscInt, 1, __Pyx_PyInt_From_PetscInt, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 894, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (!(likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(48, 894, __pyx_L1_error) __pyx_t_9 = ((struct PyPetscISObject *)__pyx_t_4)->iset; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; (__pyx_v_isets_local[__pyx_v_i]) = __pyx_t_9; } /* "petsc4py/PETSc/PC.pyx":890 * for i in range(n): * isets[i] = (is_[i]).iset * if is_local is not None: # <<<<<<<<<<<<<< * assert len(is_local) == nsd * CHKERR( PetscMalloc(n*sizeof(PetscIS), &isets_local) ) */ } /* "petsc4py/PETSc/PC.pyx":895 * for i in range(n): * isets_local[i] = (is_local[i]).iset * CHKERR( PCASMSetLocalSubdomains(self.pc, n, isets, isets_local) ) # <<<<<<<<<<<<<< * CHKERR( PetscFree(isets) ) * CHKERR( PetscFree(isets_local) ) */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCASMSetLocalSubdomains(__pyx_v_self->pc, __pyx_v_n, __pyx_v_isets, __pyx_v_isets_local)); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 895, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":896 * isets_local[i] = (is_local[i]).iset * CHKERR( PCASMSetLocalSubdomains(self.pc, n, isets, isets_local) ) * CHKERR( PetscFree(isets) ) # <<<<<<<<<<<<<< * CHKERR( PetscFree(isets_local) ) * */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_isets)); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 896, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":897 * CHKERR( PCASMSetLocalSubdomains(self.pc, n, isets, isets_local) ) * CHKERR( PetscFree(isets) ) * CHKERR( PetscFree(isets_local) ) # <<<<<<<<<<<<<< * * def setASMTotalSubdomains( */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_isets_local)); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 897, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":856 * CHKERR( PCASMSetOverlap(self.pc, ival) ) * * def setASMLocalSubdomains( # <<<<<<<<<<<<<< * self, * nsd: int, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.PC.setASMLocalSubdomains", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":899 * CHKERR( PetscFree(isets_local) ) * * def setASMTotalSubdomains( # <<<<<<<<<<<<<< * self, * nsd: int, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_77setASMTotalSubdomains(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_76setASMTotalSubdomains, "PC.setASMTotalSubdomains(self, nsd: int, is_: Sequence[IS] | None = None, is_local: Sequence[IS] | None = None) -> None\nSet the subdomains for all processes.\n\n Collective.\n\n Parameters\n ----------\n nsd\n The number of subdomains for all processes.\n is\\_\n Defines the subdomains for all processes or `None` to determine\n internally.\n is_local\n Defines the local part of the subdomains for this process, only used\n for `PC.ASMType.RESTRICT`.\n\n See Also\n --------\n setASMLocalSubdomains, petsc.PCASMSetTotalSubdomains\n\n \nSource code at petsc4py/PETSc/PC.pyx:899"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_77setASMTotalSubdomains(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_nsd = 0; PyObject *__pyx_v_is_ = 0; PyObject *__pyx_v_is_local = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setASMTotalSubdomains (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nsd,&__pyx_n_s_is,&__pyx_n_s_is_local,0}; /* "petsc4py/PETSc/PC.pyx":902 * self, * nsd: int, * is_: Sequence[IS] | None=None, # <<<<<<<<<<<<<< * is_local: Sequence[IS] | None=None) -> None: * """Set the subdomains for all processes. */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/PC.pyx":903 * nsd: int, * is_: Sequence[IS] | None=None, * is_local: Sequence[IS] | None=None) -> None: # <<<<<<<<<<<<<< * """Set the subdomains for all processes. * */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_nsd)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 899, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_is); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 899, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_is_local); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 899, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setASMTotalSubdomains") < 0)) __PYX_ERR(48, 899, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_nsd = values[0]; __pyx_v_is_ = values[1]; __pyx_v_is_local = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setASMTotalSubdomains", 0, 1, 3, __pyx_nargs); __PYX_ERR(48, 899, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setASMTotalSubdomains", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_76setASMTotalSubdomains(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_nsd, __pyx_v_is_, __pyx_v_is_local); /* "petsc4py/PETSc/PC.pyx":899 * CHKERR( PetscFree(isets_local) ) * * def setASMTotalSubdomains( # <<<<<<<<<<<<<< * self, * nsd: int, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_76setASMTotalSubdomains(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_nsd, PyObject *__pyx_v_is_, PyObject *__pyx_v_is_local) { PetscInt __pyx_v_n; PetscInt __pyx_v_i; IS *__pyx_v_isets; IS *__pyx_v_isets_local; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; Py_ssize_t __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PetscErrorCode __pyx_t_6; PetscInt __pyx_t_7; PetscInt __pyx_t_8; IS __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setASMTotalSubdomains", 1); /* "petsc4py/PETSc/PC.pyx":924 * * """ * cdef PetscInt n = asInt(nsd) # <<<<<<<<<<<<<< * cdef PetscInt i = 0 * cdef PetscIS *isets = NULL */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_nsd); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 924, __pyx_L1_error) __pyx_v_n = __pyx_t_1; /* "petsc4py/PETSc/PC.pyx":925 * """ * cdef PetscInt n = asInt(nsd) * cdef PetscInt i = 0 # <<<<<<<<<<<<<< * cdef PetscIS *isets = NULL * cdef PetscIS *isets_local = NULL */ __pyx_v_i = 0; /* "petsc4py/PETSc/PC.pyx":926 * cdef PetscInt n = asInt(nsd) * cdef PetscInt i = 0 * cdef PetscIS *isets = NULL # <<<<<<<<<<<<<< * cdef PetscIS *isets_local = NULL * if is_ is not None: */ __pyx_v_isets = NULL; /* "petsc4py/PETSc/PC.pyx":927 * cdef PetscInt i = 0 * cdef PetscIS *isets = NULL * cdef PetscIS *isets_local = NULL # <<<<<<<<<<<<<< * if is_ is not None: * assert len(is_) == nsd */ __pyx_v_isets_local = NULL; /* "petsc4py/PETSc/PC.pyx":928 * cdef PetscIS *isets = NULL * cdef PetscIS *isets_local = NULL * if is_ is not None: # <<<<<<<<<<<<<< * assert len(is_) == nsd * CHKERR( PetscMalloc(n*sizeof(PetscIS), &isets) ) */ __pyx_t_2 = (__pyx_v_is_ != Py_None); if (__pyx_t_2) { /* "petsc4py/PETSc/PC.pyx":929 * cdef PetscIS *isets_local = NULL * if is_ is not None: * assert len(is_) == nsd # <<<<<<<<<<<<<< * CHKERR( PetscMalloc(n*sizeof(PetscIS), &isets) ) * for i in range(n): */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_3 = PyObject_Length(__pyx_v_is_); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(48, 929, __pyx_L1_error) __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 929, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_v_nsd, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 929, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(48, 929, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(48, 929, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(48, 929, __pyx_L1_error) #endif /* "petsc4py/PETSc/PC.pyx":930 * if is_ is not None: * assert len(is_) == nsd * CHKERR( PetscMalloc(n*sizeof(PetscIS), &isets) ) # <<<<<<<<<<<<<< * for i in range(n): * isets[i] = (is_[i]).iset */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((((size_t)__pyx_v_n) * (sizeof(IS))), (&__pyx_v_isets))); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 930, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":931 * assert len(is_) == nsd * CHKERR( PetscMalloc(n*sizeof(PetscIS), &isets) ) * for i in range(n): # <<<<<<<<<<<<<< * isets[i] = (is_[i]).iset * if is_local is not None: */ __pyx_t_1 = __pyx_v_n; __pyx_t_7 = __pyx_t_1; for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { __pyx_v_i = __pyx_t_8; /* "petsc4py/PETSc/PC.pyx":932 * CHKERR( PetscMalloc(n*sizeof(PetscIS), &isets) ) * for i in range(n): * isets[i] = (is_[i]).iset # <<<<<<<<<<<<<< * if is_local is not None: * assert len(is_local) == nsd */ __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_is_, __pyx_v_i, PetscInt, 1, __Pyx_PyInt_From_PetscInt, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 932, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (!(likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(48, 932, __pyx_L1_error) __pyx_t_9 = ((struct PyPetscISObject *)__pyx_t_5)->iset; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; (__pyx_v_isets[__pyx_v_i]) = __pyx_t_9; } /* "petsc4py/PETSc/PC.pyx":928 * cdef PetscIS *isets = NULL * cdef PetscIS *isets_local = NULL * if is_ is not None: # <<<<<<<<<<<<<< * assert len(is_) == nsd * CHKERR( PetscMalloc(n*sizeof(PetscIS), &isets) ) */ } /* "petsc4py/PETSc/PC.pyx":933 * for i in range(n): * isets[i] = (is_[i]).iset * if is_local is not None: # <<<<<<<<<<<<<< * assert len(is_local) == nsd * CHKERR( PetscMalloc(n*sizeof(PetscIS), &isets_local) ) */ __pyx_t_2 = (__pyx_v_is_local != Py_None); if (__pyx_t_2) { /* "petsc4py/PETSc/PC.pyx":934 * isets[i] = (is_[i]).iset * if is_local is not None: * assert len(is_local) == nsd # <<<<<<<<<<<<<< * CHKERR( PetscMalloc(n*sizeof(PetscIS), &isets_local) ) * for i in range(n): */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_3 = PyObject_Length(__pyx_v_is_local); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(48, 934, __pyx_L1_error) __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 934, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_v_nsd, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 934, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(48, 934, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(48, 934, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(48, 934, __pyx_L1_error) #endif /* "petsc4py/PETSc/PC.pyx":935 * if is_local is not None: * assert len(is_local) == nsd * CHKERR( PetscMalloc(n*sizeof(PetscIS), &isets_local) ) # <<<<<<<<<<<<<< * for i in range(n): * isets_local[i] = (is_local[i]).iset */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((((size_t)__pyx_v_n) * (sizeof(IS))), (&__pyx_v_isets_local))); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 935, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":936 * assert len(is_local) == nsd * CHKERR( PetscMalloc(n*sizeof(PetscIS), &isets_local) ) * for i in range(n): # <<<<<<<<<<<<<< * isets_local[i] = (is_local[i]).iset * CHKERR( PCASMSetTotalSubdomains(self.pc, n, isets, isets_local) ) */ __pyx_t_1 = __pyx_v_n; __pyx_t_7 = __pyx_t_1; for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { __pyx_v_i = __pyx_t_8; /* "petsc4py/PETSc/PC.pyx":937 * CHKERR( PetscMalloc(n*sizeof(PetscIS), &isets_local) ) * for i in range(n): * isets_local[i] = (is_local[i]).iset # <<<<<<<<<<<<<< * CHKERR( PCASMSetTotalSubdomains(self.pc, n, isets, isets_local) ) * CHKERR( PetscFree(isets) ) */ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_is_local, __pyx_v_i, PetscInt, 1, __Pyx_PyInt_From_PetscInt, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 937, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (!(likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(48, 937, __pyx_L1_error) __pyx_t_9 = ((struct PyPetscISObject *)__pyx_t_4)->iset; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; (__pyx_v_isets_local[__pyx_v_i]) = __pyx_t_9; } /* "petsc4py/PETSc/PC.pyx":933 * for i in range(n): * isets[i] = (is_[i]).iset * if is_local is not None: # <<<<<<<<<<<<<< * assert len(is_local) == nsd * CHKERR( PetscMalloc(n*sizeof(PetscIS), &isets_local) ) */ } /* "petsc4py/PETSc/PC.pyx":938 * for i in range(n): * isets_local[i] = (is_local[i]).iset * CHKERR( PCASMSetTotalSubdomains(self.pc, n, isets, isets_local) ) # <<<<<<<<<<<<<< * CHKERR( PetscFree(isets) ) * CHKERR( PetscFree(isets_local) ) */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCASMSetTotalSubdomains(__pyx_v_self->pc, __pyx_v_n, __pyx_v_isets, __pyx_v_isets_local)); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 938, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":939 * isets_local[i] = (is_local[i]).iset * CHKERR( PCASMSetTotalSubdomains(self.pc, n, isets, isets_local) ) * CHKERR( PetscFree(isets) ) # <<<<<<<<<<<<<< * CHKERR( PetscFree(isets_local) ) * */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_isets)); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 939, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":940 * CHKERR( PCASMSetTotalSubdomains(self.pc, n, isets, isets_local) ) * CHKERR( PetscFree(isets) ) * CHKERR( PetscFree(isets_local) ) # <<<<<<<<<<<<<< * * def getASMSubKSP(self) -> list[KSP]: */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_isets_local)); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 940, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":899 * CHKERR( PetscFree(isets_local) ) * * def setASMTotalSubdomains( # <<<<<<<<<<<<<< * self, * nsd: int, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.PC.setASMTotalSubdomains", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":942 * CHKERR( PetscFree(isets_local) ) * * def getASMSubKSP(self) -> list[KSP]: # <<<<<<<<<<<<<< * """Return the local `KSP` object for all blocks on this process. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_79getASMSubKSP(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_78getASMSubKSP, "PC.getASMSubKSP(self) -> list[KSP]\nReturn the local `KSP` object for all blocks on this process.\n\n Not collective.\n\n See Also\n --------\n petsc.PCASMGetSubKSP\n\n \nSource code at petsc4py/PETSc/PC.pyx:942"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_79getASMSubKSP(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getASMSubKSP (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getASMSubKSP", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getASMSubKSP", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_78getASMSubKSP(((struct PyPetscPCObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_78getASMSubKSP(struct PyPetscPCObject *__pyx_v_self) { CYTHON_UNUSED PetscInt __pyx_v_i; PetscInt __pyx_v_n; KSP *__pyx_v_p; PetscInt __pyx_8genexpr8__pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscInt __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getASMSubKSP", 1); /* "petsc4py/PETSc/PC.pyx":952 * * """ * cdef PetscInt i = 0, n = 0 # <<<<<<<<<<<<<< * cdef PetscKSP *p = NULL * CHKERR( PCASMGetSubKSP(self.pc, &n, NULL, &p) ) */ __pyx_v_i = 0; __pyx_v_n = 0; /* "petsc4py/PETSc/PC.pyx":953 * """ * cdef PetscInt i = 0, n = 0 * cdef PetscKSP *p = NULL # <<<<<<<<<<<<<< * CHKERR( PCASMGetSubKSP(self.pc, &n, NULL, &p) ) * return [ref_KSP(p[i]) for i from 0 <= i pc, (&__pyx_v_n), NULL, (&__pyx_v_p))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 954, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":955 * cdef PetscKSP *p = NULL * CHKERR( PCASMGetSubKSP(self.pc, &n, NULL, &p) ) * return [ref_KSP(p[i]) for i from 0 <= i None: */ __Pyx_XDECREF(__pyx_r); { /* enter inner scope */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 955, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_v_n; for (__pyx_8genexpr8__pyx_v_i = 0; __pyx_8genexpr8__pyx_v_i < __pyx_t_3; __pyx_8genexpr8__pyx_v_i++) { __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_KSP((__pyx_v_p[__pyx_8genexpr8__pyx_v_i]))); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 955, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_4))) __PYX_ERR(48, 955, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } } /* exit inner scope */ __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/PC.pyx":942 * CHKERR( PetscFree(isets_local) ) * * def getASMSubKSP(self) -> list[KSP]: # <<<<<<<<<<<<<< * """Return the local `KSP` object for all blocks on this process. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.PC.getASMSubKSP", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":957 * return [ref_KSP(p[i]) for i from 0 <= i None: # <<<<<<<<<<<<<< * """Set to sort subdomain indices. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_81setASMSortIndices(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_80setASMSortIndices, "PC.setASMSortIndices(self, dosort: bool) -> None\nSet to sort subdomain indices.\n\n Logically collective.\n\n Parameters\n ----------\n dosort\n Set to `True` to sort indices\n\n See Also\n --------\n petsc.PCASMSetSortIndices\n\n \nSource code at petsc4py/PETSc/PC.pyx:957"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_81setASMSortIndices(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_dosort = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setASMSortIndices (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dosort,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dosort)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 957, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setASMSortIndices") < 0)) __PYX_ERR(48, 957, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_dosort = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setASMSortIndices", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 957, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setASMSortIndices", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_80setASMSortIndices(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_dosort); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_80setASMSortIndices(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_dosort) { PetscBool __pyx_v_cdosort; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setASMSortIndices", 1); /* "petsc4py/PETSc/PC.pyx":972 * * """ * cdef PetscBool cdosort = asBool(dosort) # <<<<<<<<<<<<<< * CHKERR( PCASMSetSortIndices(self.pc, cdosort) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asBool(__pyx_v_dosort); if (unlikely(__pyx_t_1 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(48, 972, __pyx_L1_error) __pyx_v_cdosort = __pyx_t_1; /* "petsc4py/PETSc/PC.pyx":973 * """ * cdef PetscBool cdosort = asBool(dosort) * CHKERR( PCASMSetSortIndices(self.pc, cdosort) ) # <<<<<<<<<<<<<< * * # --- GASM --- */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCASMSetSortIndices(__pyx_v_self->pc, __pyx_v_cdosort)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 973, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":957 * return [ref_KSP(p[i]) for i from 0 <= i None: # <<<<<<<<<<<<<< * """Set to sort subdomain indices. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setASMSortIndices", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":977 * # --- GASM --- * * def setGASMType(self, gasmtype: GASMType) -> None: # <<<<<<<<<<<<<< * """Set the type of restriction and interpolation. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_83setGASMType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_82setGASMType, "PC.setGASMType(self, gasmtype: GASMType) -> None\nSet the type of restriction and interpolation.\n\n Logically collective.\n\n Parameters\n ----------\n gasmtype\n The type of `GASM`.\n\n See Also\n --------\n petsc.PCGASMSetType\n\n \nSource code at petsc4py/PETSc/PC.pyx:977"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_83setGASMType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_gasmtype = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setGASMType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gasmtype,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gasmtype)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 977, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setGASMType") < 0)) __PYX_ERR(48, 977, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_gasmtype = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setGASMType", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 977, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setGASMType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_82setGASMType(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_gasmtype); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_82setGASMType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_gasmtype) { PCGASMType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PCGASMType __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setGASMType", 1); /* "petsc4py/PETSc/PC.pyx":992 * * """ * cdef PetscPCGASMType cval = gasmtype # <<<<<<<<<<<<<< * CHKERR( PCGASMSetType(self.pc, cval) ) * */ __pyx_t_1 = ((PCGASMType)__Pyx_PyInt_As_PCGASMType(__pyx_v_gasmtype)); if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 992, __pyx_L1_error) __pyx_v_cval = __pyx_t_1; /* "petsc4py/PETSc/PC.pyx":993 * """ * cdef PetscPCGASMType cval = gasmtype * CHKERR( PCGASMSetType(self.pc, cval) ) # <<<<<<<<<<<<<< * * def setGASMOverlap(self, overlap: int) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCGASMSetType(__pyx_v_self->pc, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 993, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":977 * # --- GASM --- * * def setGASMType(self, gasmtype: GASMType) -> None: # <<<<<<<<<<<<<< * """Set the type of restriction and interpolation. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setGASMType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":995 * CHKERR( PCGASMSetType(self.pc, cval) ) * * def setGASMOverlap(self, overlap: int) -> None: # <<<<<<<<<<<<<< * """Set the overlap between a pair of subdomains. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_85setGASMOverlap(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_84setGASMOverlap, "PC.setGASMOverlap(self, overlap: int) -> None\nSet the overlap between a pair of subdomains.\n\n Logically collective.\n\n Parameters\n ----------\n overlap\n The amount of overlap between subdomains.\n\n See Also\n --------\n petsc.PCGASMSetOverlap\n\n \nSource code at petsc4py/PETSc/PC.pyx:995"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_85setGASMOverlap(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_overlap = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setGASMOverlap (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_overlap,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_overlap)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 995, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setGASMOverlap") < 0)) __PYX_ERR(48, 995, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_overlap = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setGASMOverlap", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 995, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setGASMOverlap", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_84setGASMOverlap(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_overlap); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_84setGASMOverlap(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_overlap) { PetscInt __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setGASMOverlap", 1); /* "petsc4py/PETSc/PC.pyx":1010 * * """ * cdef PetscInt ival = asInt(overlap) # <<<<<<<<<<<<<< * CHKERR( PCGASMSetOverlap(self.pc, ival) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_overlap); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 1010, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "petsc4py/PETSc/PC.pyx":1011 * """ * cdef PetscInt ival = asInt(overlap) * CHKERR( PCGASMSetOverlap(self.pc, ival) ) # <<<<<<<<<<<<<< * * # --- GAMG --- */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCGASMSetOverlap(__pyx_v_self->pc, __pyx_v_ival)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1011, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":995 * CHKERR( PCGASMSetType(self.pc, cval) ) * * def setGASMOverlap(self, overlap: int) -> None: # <<<<<<<<<<<<<< * """Set the overlap between a pair of subdomains. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setGASMOverlap", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":1015 * # --- GAMG --- * * def setGAMGType(self, gamgtype: GAMGType | str) -> None: # <<<<<<<<<<<<<< * """Set the type of algorithm. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_87setGAMGType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_86setGAMGType, "PC.setGAMGType(self, gamgtype: GAMGType | str) -> None\nSet the type of algorithm.\n\n Collective.\n\n Parameters\n ----------\n gamgtype\n The type of `GAMG`\n\n See Also\n --------\n petsc.PCGAMGSetType\n\n \nSource code at petsc4py/PETSc/PC.pyx:1015"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_87setGAMGType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_gamgtype = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setGAMGType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gamgtype,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gamgtype)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 1015, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setGAMGType") < 0)) __PYX_ERR(48, 1015, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_gamgtype = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setGAMGType", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 1015, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setGAMGType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_86setGAMGType(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_gamgtype); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_86setGAMGType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_gamgtype) { PCGAMGType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setGAMGType", 0); __Pyx_INCREF(__pyx_v_gamgtype); /* "petsc4py/PETSc/PC.pyx":1030 * * """ * cdef PetscPCGAMGType cval = NULL # <<<<<<<<<<<<<< * gamgtype = str2bytes(gamgtype, &cval) * CHKERR( PCGAMGSetType(self.pc, cval) ) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/PC.pyx":1031 * """ * cdef PetscPCGAMGType cval = NULL * gamgtype = str2bytes(gamgtype, &cval) # <<<<<<<<<<<<<< * CHKERR( PCGAMGSetType(self.pc, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_gamgtype, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 1031, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_gamgtype, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/PC.pyx":1032 * cdef PetscPCGAMGType cval = NULL * gamgtype = str2bytes(gamgtype, &cval) * CHKERR( PCGAMGSetType(self.pc, cval) ) # <<<<<<<<<<<<<< * * def setGAMGLevels(self, levels: int) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCGAMGSetType(__pyx_v_self->pc, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1032, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":1015 * # --- GAMG --- * * def setGAMGType(self, gamgtype: GAMGType | str) -> None: # <<<<<<<<<<<<<< * """Set the type of algorithm. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PC.setGAMGType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_gamgtype); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":1034 * CHKERR( PCGAMGSetType(self.pc, cval) ) * * def setGAMGLevels(self, levels: int) -> None: # <<<<<<<<<<<<<< * """Set the maximum number of levels. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_89setGAMGLevels(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_88setGAMGLevels, "PC.setGAMGLevels(self, levels: int) -> None\nSet the maximum number of levels.\n\n Not collective.\n\n Parameters\n ----------\n levels\n The maximum number of levels to use.\n\n See Also\n --------\n petsc.PCGAMGSetNlevels\n\n \nSource code at petsc4py/PETSc/PC.pyx:1034"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_89setGAMGLevels(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_levels = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setGAMGLevels (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_levels,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_levels)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 1034, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setGAMGLevels") < 0)) __PYX_ERR(48, 1034, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_levels = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setGAMGLevels", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 1034, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setGAMGLevels", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_88setGAMGLevels(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_levels); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_88setGAMGLevels(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_levels) { PetscInt __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setGAMGLevels", 1); /* "petsc4py/PETSc/PC.pyx":1049 * * """ * cdef PetscInt ival = asInt(levels) # <<<<<<<<<<<<<< * CHKERR( PCGAMGSetNlevels(self.pc, ival) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_levels); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 1049, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "petsc4py/PETSc/PC.pyx":1050 * """ * cdef PetscInt ival = asInt(levels) * CHKERR( PCGAMGSetNlevels(self.pc, ival) ) # <<<<<<<<<<<<<< * * def setGAMGSmooths(self, smooths: int) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCGAMGSetNlevels(__pyx_v_self->pc, __pyx_v_ival)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1050, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":1034 * CHKERR( PCGAMGSetType(self.pc, cval) ) * * def setGAMGLevels(self, levels: int) -> None: # <<<<<<<<<<<<<< * """Set the maximum number of levels. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setGAMGLevels", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":1052 * CHKERR( PCGAMGSetNlevels(self.pc, ival) ) * * def setGAMGSmooths(self, smooths: int) -> None: # <<<<<<<<<<<<<< * """Set the number of smoothing steps used on all levels. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_91setGAMGSmooths(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_90setGAMGSmooths, "PC.setGAMGSmooths(self, smooths: int) -> None\nSet the number of smoothing steps used on all levels.\n\n Logically collective.\n\n Parameters\n ----------\n smooths\n The maximum number of smooths.\n\n See Also\n --------\n petsc.PCGAMGSetNSmooths\n\n \nSource code at petsc4py/PETSc/PC.pyx:1052"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_91setGAMGSmooths(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_smooths = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setGAMGSmooths (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_smooths,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_smooths)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 1052, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setGAMGSmooths") < 0)) __PYX_ERR(48, 1052, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_smooths = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setGAMGSmooths", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 1052, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setGAMGSmooths", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_90setGAMGSmooths(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_smooths); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_90setGAMGSmooths(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_smooths) { PetscInt __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setGAMGSmooths", 1); /* "petsc4py/PETSc/PC.pyx":1067 * * """ * cdef PetscInt ival = asInt(smooths) # <<<<<<<<<<<<<< * CHKERR( PCGAMGSetNSmooths(self.pc, ival) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_smooths); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 1067, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "petsc4py/PETSc/PC.pyx":1068 * """ * cdef PetscInt ival = asInt(smooths) * CHKERR( PCGAMGSetNSmooths(self.pc, ival) ) # <<<<<<<<<<<<<< * * # --- Hypre --- */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCGAMGSetNSmooths(__pyx_v_self->pc, __pyx_v_ival)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1068, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":1052 * CHKERR( PCGAMGSetNlevels(self.pc, ival) ) * * def setGAMGSmooths(self, smooths: int) -> None: # <<<<<<<<<<<<<< * """Set the number of smoothing steps used on all levels. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setGAMGSmooths", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":1072 * # --- Hypre --- * * def getHYPREType(self) -> str: # <<<<<<<<<<<<<< * """Return the `Type.HYPRE` type. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_93getHYPREType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_92getHYPREType, "PC.getHYPREType(self) -> str\nReturn the `Type.HYPRE` type.\n\n See Also\n --------\n petsc.PCHYPREGetType\n\n \nSource code at petsc4py/PETSc/PC.pyx:1072"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_93getHYPREType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getHYPREType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getHYPREType", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getHYPREType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_92getHYPREType(((struct PyPetscPCObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_92getHYPREType(struct PyPetscPCObject *__pyx_v_self) { const char* __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getHYPREType", 1); /* "petsc4py/PETSc/PC.pyx":1080 * * """ * cdef PetscPCHYPREType cval = NULL # <<<<<<<<<<<<<< * CHKERR( PCHYPREGetType(self.pc, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/PC.pyx":1081 * """ * cdef PetscPCHYPREType cval = NULL * CHKERR( PCHYPREGetType(self.pc, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCHYPREGetType(__pyx_v_self->pc, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1081, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":1082 * cdef PetscPCHYPREType cval = NULL * CHKERR( PCHYPREGetType(self.pc, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * def setHYPREType(self, hypretype: str): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 1082, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/PC.pyx":1072 * # --- Hypre --- * * def getHYPREType(self) -> str: # <<<<<<<<<<<<<< * """Return the `Type.HYPRE` type. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.PC.getHYPREType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":1084 * return bytes2str(cval) * * def setHYPREType(self, hypretype: str): # <<<<<<<<<<<<<< * """Set the `Type.HYPRE` type. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_95setHYPREType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_94setHYPREType, "PC.setHYPREType(self, hypretype: str)\nSet the `Type.HYPRE` type.\n\n Parameters\n ----------\n hypretype\n The name of the type, one of ``\"euclid\"``, ``\"pilut\"``,\n ``\"parasails\"``, ``\"boomeramg\"``, ``\"ams\"``, ``\"ads\"``\n\n See Also\n --------\n petsc.PCHYPRESetType\n\n \nSource code at petsc4py/PETSc/PC.pyx:1084"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_95setHYPREType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_hypretype = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setHYPREType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_hypretype,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_hypretype)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 1084, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setHYPREType") < 0)) __PYX_ERR(48, 1084, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_hypretype = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setHYPREType", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 1084, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setHYPREType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_94setHYPREType(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_hypretype); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_94setHYPREType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_hypretype) { const char* __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setHYPREType", 0); __Pyx_INCREF(__pyx_v_hypretype); /* "petsc4py/PETSc/PC.pyx":1098 * * """ * cdef PetscPCHYPREType cval = NULL # <<<<<<<<<<<<<< * hypretype = str2bytes(hypretype, &cval) * CHKERR( PCHYPRESetType(self.pc, cval) ) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/PC.pyx":1099 * """ * cdef PetscPCHYPREType cval = NULL * hypretype = str2bytes(hypretype, &cval) # <<<<<<<<<<<<<< * CHKERR( PCHYPRESetType(self.pc, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_hypretype, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 1099, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_hypretype, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/PC.pyx":1100 * cdef PetscPCHYPREType cval = NULL * hypretype = str2bytes(hypretype, &cval) * CHKERR( PCHYPRESetType(self.pc, cval) ) # <<<<<<<<<<<<<< * * def setHYPREDiscreteCurl(self, Mat mat) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCHYPRESetType(__pyx_v_self->pc, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1100, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":1084 * return bytes2str(cval) * * def setHYPREType(self, hypretype: str): # <<<<<<<<<<<<<< * """Set the `Type.HYPRE` type. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PC.setHYPREType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_hypretype); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":1102 * CHKERR( PCHYPRESetType(self.pc, cval) ) * * def setHYPREDiscreteCurl(self, Mat mat) -> None: # <<<<<<<<<<<<<< * """Set the discrete curl matrix. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_97setHYPREDiscreteCurl(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_96setHYPREDiscreteCurl, "PC.setHYPREDiscreteCurl(self, mat: Mat) -> None\nSet the discrete curl matrix.\n\n Collective.\n\n Parameters\n ----------\n mat\n The discrete curl.\n\n See Also\n --------\n petsc.PCHYPRESetDiscreteCurl\n\n \nSource code at petsc4py/PETSc/PC.pyx:1102"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_97setHYPREDiscreteCurl(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscMatObject *__pyx_v_mat = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setHYPREDiscreteCurl (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mat)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 1102, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setHYPREDiscreteCurl") < 0)) __PYX_ERR(48, 1102, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_mat = ((struct PyPetscMatObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setHYPREDiscreteCurl", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 1102, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setHYPREDiscreteCurl", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(48, 1102, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_96setHYPREDiscreteCurl(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_mat); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_96setHYPREDiscreteCurl(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setHYPREDiscreteCurl", 1); /* "petsc4py/PETSc/PC.pyx":1117 * * """ * CHKERR( PCHYPRESetDiscreteCurl(self.pc, mat.mat) ) # <<<<<<<<<<<<<< * * def setHYPREDiscreteGradient(self, Mat mat) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCHYPRESetDiscreteCurl(__pyx_v_self->pc, __pyx_v_mat->mat)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1117, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":1102 * CHKERR( PCHYPRESetType(self.pc, cval) ) * * def setHYPREDiscreteCurl(self, Mat mat) -> None: # <<<<<<<<<<<<<< * """Set the discrete curl matrix. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setHYPREDiscreteCurl", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":1119 * CHKERR( PCHYPRESetDiscreteCurl(self.pc, mat.mat) ) * * def setHYPREDiscreteGradient(self, Mat mat) -> None: # <<<<<<<<<<<<<< * """Set the discrete gradient matrix. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_99setHYPREDiscreteGradient(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_98setHYPREDiscreteGradient, "PC.setHYPREDiscreteGradient(self, mat: Mat) -> None\nSet the discrete gradient matrix.\n\n Collective.\n\n Parameters\n ----------\n mat\n The discrete gradient.\n\n See Also\n --------\n petsc.PCHYPRESetDiscreteGradient\n\n \nSource code at petsc4py/PETSc/PC.pyx:1119"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_99setHYPREDiscreteGradient(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscMatObject *__pyx_v_mat = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setHYPREDiscreteGradient (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mat)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 1119, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setHYPREDiscreteGradient") < 0)) __PYX_ERR(48, 1119, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_mat = ((struct PyPetscMatObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setHYPREDiscreteGradient", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 1119, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setHYPREDiscreteGradient", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(48, 1119, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_98setHYPREDiscreteGradient(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_mat); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_98setHYPREDiscreteGradient(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setHYPREDiscreteGradient", 1); /* "petsc4py/PETSc/PC.pyx":1134 * * """ * CHKERR( PCHYPRESetDiscreteGradient(self.pc, mat.mat) ) # <<<<<<<<<<<<<< * * def setHYPRESetAlphaPoissonMatrix(self, Mat mat) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCHYPRESetDiscreteGradient(__pyx_v_self->pc, __pyx_v_mat->mat)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1134, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":1119 * CHKERR( PCHYPRESetDiscreteCurl(self.pc, mat.mat) ) * * def setHYPREDiscreteGradient(self, Mat mat) -> None: # <<<<<<<<<<<<<< * """Set the discrete gradient matrix. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setHYPREDiscreteGradient", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":1136 * CHKERR( PCHYPRESetDiscreteGradient(self.pc, mat.mat) ) * * def setHYPRESetAlphaPoissonMatrix(self, Mat mat) -> None: # <<<<<<<<<<<<<< * """Set the vector Poisson matrix. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_101setHYPRESetAlphaPoissonMatrix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_100setHYPRESetAlphaPoissonMatrix, "PC.setHYPRESetAlphaPoissonMatrix(self, mat: Mat) -> None\nSet the vector Poisson matrix.\n\n Collective.\n\n Parameters\n ----------\n mat\n The vector Poisson matrix.\n\n See Also\n --------\n petsc.PCHYPRESetAlphaPoissonMatrix\n\n \nSource code at petsc4py/PETSc/PC.pyx:1136"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_101setHYPRESetAlphaPoissonMatrix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscMatObject *__pyx_v_mat = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setHYPRESetAlphaPoissonMatrix (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mat)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 1136, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setHYPRESetAlphaPoissonMatrix") < 0)) __PYX_ERR(48, 1136, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_mat = ((struct PyPetscMatObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setHYPRESetAlphaPoissonMatrix", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 1136, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setHYPRESetAlphaPoissonMatrix", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(48, 1136, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_100setHYPRESetAlphaPoissonMatrix(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_mat); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_100setHYPRESetAlphaPoissonMatrix(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setHYPRESetAlphaPoissonMatrix", 1); /* "petsc4py/PETSc/PC.pyx":1151 * * """ * CHKERR( PCHYPRESetAlphaPoissonMatrix(self.pc, mat.mat) ) # <<<<<<<<<<<<<< * * def setHYPRESetBetaPoissonMatrix(self, Mat mat=None) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCHYPRESetAlphaPoissonMatrix(__pyx_v_self->pc, __pyx_v_mat->mat)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1151, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":1136 * CHKERR( PCHYPRESetDiscreteGradient(self.pc, mat.mat) ) * * def setHYPRESetAlphaPoissonMatrix(self, Mat mat) -> None: # <<<<<<<<<<<<<< * """Set the vector Poisson matrix. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setHYPRESetAlphaPoissonMatrix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":1153 * CHKERR( PCHYPRESetAlphaPoissonMatrix(self.pc, mat.mat) ) * * def setHYPRESetBetaPoissonMatrix(self, Mat mat=None) -> None: # <<<<<<<<<<<<<< * """Set the Posson matrix. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_103setHYPRESetBetaPoissonMatrix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_102setHYPRESetBetaPoissonMatrix, "PC.setHYPRESetBetaPoissonMatrix(self, mat: Mat | None = None) -> None\nSet the Posson matrix.\n\n Collective.\n\n Parameters\n ----------\n mat\n The Poisson matrix or `None` to turn off.\n\n See Also\n --------\n petsc.PCHYPRESetBetaPoissonMatrix\n\n \nSource code at petsc4py/PETSc/PC.pyx:1153"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_103setHYPRESetBetaPoissonMatrix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscMatObject *__pyx_v_mat = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setHYPRESetBetaPoissonMatrix (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscMatObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mat); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 1153, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setHYPRESetBetaPoissonMatrix") < 0)) __PYX_ERR(48, 1153, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_mat = ((struct PyPetscMatObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setHYPRESetBetaPoissonMatrix", 0, 0, 1, __pyx_nargs); __PYX_ERR(48, 1153, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setHYPRESetBetaPoissonMatrix", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "mat", 0))) __PYX_ERR(48, 1153, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_102setHYPRESetBetaPoissonMatrix(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_mat); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_102setHYPRESetBetaPoissonMatrix(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat) { Mat __pyx_v_pmat; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; Mat __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setHYPRESetBetaPoissonMatrix", 1); /* "petsc4py/PETSc/PC.pyx":1168 * * """ * cdef PetscMat pmat = NULL # <<<<<<<<<<<<<< * if mat is not None: pmat = mat.mat * CHKERR( PCHYPRESetBetaPoissonMatrix(self.pc, pmat) ) */ __pyx_v_pmat = NULL; /* "petsc4py/PETSc/PC.pyx":1169 * """ * cdef PetscMat pmat = NULL * if mat is not None: pmat = mat.mat # <<<<<<<<<<<<<< * CHKERR( PCHYPRESetBetaPoissonMatrix(self.pc, pmat) ) * */ __pyx_t_1 = (((PyObject *)__pyx_v_mat) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_mat->mat; __pyx_v_pmat = __pyx_t_2; } /* "petsc4py/PETSc/PC.pyx":1170 * cdef PetscMat pmat = NULL * if mat is not None: pmat = mat.mat * CHKERR( PCHYPRESetBetaPoissonMatrix(self.pc, pmat) ) # <<<<<<<<<<<<<< * * def setHYPRESetInterpolations(self, dim: int, Mat RT_Pi_Full=None, RT_Pi=None, */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCHYPRESetBetaPoissonMatrix(__pyx_v_self->pc, __pyx_v_pmat)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1170, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":1153 * CHKERR( PCHYPRESetAlphaPoissonMatrix(self.pc, mat.mat) ) * * def setHYPRESetBetaPoissonMatrix(self, Mat mat=None) -> None: # <<<<<<<<<<<<<< * """Set the Posson matrix. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setHYPRESetBetaPoissonMatrix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":1172 * CHKERR( PCHYPRESetBetaPoissonMatrix(self.pc, pmat) ) * * def setHYPRESetInterpolations(self, dim: int, Mat RT_Pi_Full=None, RT_Pi=None, # <<<<<<<<<<<<<< * Mat ND_Pi_Full=None, ND_Pi=None) -> None: * """Set the interpolation matrices. */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_105setHYPRESetInterpolations(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_104setHYPRESetInterpolations, "PC.setHYPRESetInterpolations(self, dim: int, RT_Pi_Full: Mat | None = None, RT_Pi=None, ND_Pi_Full: Mat | None = None, ND_Pi=None) -> None\nSet the interpolation matrices.\n\n Collective.\n\n Parameters\n ----------\n dim\n The dimension of the problem.\n RT_Pi_Full\n The Raviart-Thomas interpolation matrix or `None` to omit.\n RT_Pi\n The xyz components of the Raviart-Thomas interpolation matrix,\n or `None` to omit.\n ND_Pi_Full\n The Nedelec interpolation matrix or `None` to omit.\n ND_Pi\n The xyz components of the Nedelec interpolation matrix,\n or `None` to omit.\n\n See Also\n --------\n petsc.PCHYPRESetInterpolations\n\n \nSource code at petsc4py/PETSc/PC.pyx:1172"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_105setHYPRESetInterpolations(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_dim = 0; struct PyPetscMatObject *__pyx_v_RT_Pi_Full = 0; PyObject *__pyx_v_RT_Pi = 0; struct PyPetscMatObject *__pyx_v_ND_Pi_Full = 0; PyObject *__pyx_v_ND_Pi = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setHYPRESetInterpolations (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dim,&__pyx_n_s_RT_Pi_Full,&__pyx_n_s_RT_Pi,&__pyx_n_s_ND_Pi_Full,&__pyx_n_s_ND_Pi,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscMatObject *)Py_None)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/PC.pyx":1173 * * def setHYPRESetInterpolations(self, dim: int, Mat RT_Pi_Full=None, RT_Pi=None, * Mat ND_Pi_Full=None, ND_Pi=None) -> None: # <<<<<<<<<<<<<< * """Set the interpolation matrices. * */ values[3] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscMatObject *)Py_None)); values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dim)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 1172, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_RT_Pi_Full); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 1172, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_RT_Pi); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 1172, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ND_Pi_Full); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 1172, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ND_Pi); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 1172, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setHYPRESetInterpolations") < 0)) __PYX_ERR(48, 1172, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_dim = values[0]; __pyx_v_RT_Pi_Full = ((struct PyPetscMatObject *)values[1]); __pyx_v_RT_Pi = values[2]; __pyx_v_ND_Pi_Full = ((struct PyPetscMatObject *)values[3]); __pyx_v_ND_Pi = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setHYPRESetInterpolations", 0, 1, 5, __pyx_nargs); __PYX_ERR(48, 1172, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setHYPRESetInterpolations", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_RT_Pi_Full), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "RT_Pi_Full", 0))) __PYX_ERR(48, 1172, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ND_Pi_Full), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "ND_Pi_Full", 0))) __PYX_ERR(48, 1173, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_104setHYPRESetInterpolations(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_dim, __pyx_v_RT_Pi_Full, __pyx_v_RT_Pi, __pyx_v_ND_Pi_Full, __pyx_v_ND_Pi); /* "petsc4py/PETSc/PC.pyx":1172 * CHKERR( PCHYPRESetBetaPoissonMatrix(self.pc, pmat) ) * * def setHYPRESetInterpolations(self, dim: int, Mat RT_Pi_Full=None, RT_Pi=None, # <<<<<<<<<<<<<< * Mat ND_Pi_Full=None, ND_Pi=None) -> None: * """Set the interpolation matrices. */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_104setHYPRESetInterpolations(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_dim, struct PyPetscMatObject *__pyx_v_RT_Pi_Full, PyObject *__pyx_v_RT_Pi, struct PyPetscMatObject *__pyx_v_ND_Pi_Full, PyObject *__pyx_v_ND_Pi) { Mat __pyx_v_RT_full_mat; Mat __pyx_v_ND_full_mat; PetscInt __pyx_v_idim; Mat *__pyx_v_RT_Pi_mat; PyObject *__pyx_v_i = NULL; Mat *__pyx_v_ND_Pi_mat; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; Mat __pyx_t_2; PetscInt __pyx_t_3; size_t __pyx_t_4; Py_ssize_t __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); Py_ssize_t __pyx_t_9; PetscErrorCode __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setHYPRESetInterpolations", 1); /* "petsc4py/PETSc/PC.pyx":1198 * * """ * cdef PetscMat RT_full_mat = NULL # <<<<<<<<<<<<<< * if RT_Pi_Full is not None: RT_full_mat = RT_Pi_Full.mat * cdef PetscMat ND_full_mat = NULL */ __pyx_v_RT_full_mat = NULL; /* "petsc4py/PETSc/PC.pyx":1199 * """ * cdef PetscMat RT_full_mat = NULL * if RT_Pi_Full is not None: RT_full_mat = RT_Pi_Full.mat # <<<<<<<<<<<<<< * cdef PetscMat ND_full_mat = NULL * if ND_Pi_Full is not None: ND_full_mat = ND_Pi_Full.mat */ __pyx_t_1 = (((PyObject *)__pyx_v_RT_Pi_Full) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_RT_Pi_Full->mat; __pyx_v_RT_full_mat = __pyx_t_2; } /* "petsc4py/PETSc/PC.pyx":1200 * cdef PetscMat RT_full_mat = NULL * if RT_Pi_Full is not None: RT_full_mat = RT_Pi_Full.mat * cdef PetscMat ND_full_mat = NULL # <<<<<<<<<<<<<< * if ND_Pi_Full is not None: ND_full_mat = ND_Pi_Full.mat * cdef PetscInt idim = asInt(dim) */ __pyx_v_ND_full_mat = NULL; /* "petsc4py/PETSc/PC.pyx":1201 * if RT_Pi_Full is not None: RT_full_mat = RT_Pi_Full.mat * cdef PetscMat ND_full_mat = NULL * if ND_Pi_Full is not None: ND_full_mat = ND_Pi_Full.mat # <<<<<<<<<<<<<< * cdef PetscInt idim = asInt(dim) * cdef PetscMat *RT_Pi_mat = NULL */ __pyx_t_1 = (((PyObject *)__pyx_v_ND_Pi_Full) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_ND_Pi_Full->mat; __pyx_v_ND_full_mat = __pyx_t_2; } /* "petsc4py/PETSc/PC.pyx":1202 * cdef PetscMat ND_full_mat = NULL * if ND_Pi_Full is not None: ND_full_mat = ND_Pi_Full.mat * cdef PetscInt idim = asInt(dim) # <<<<<<<<<<<<<< * cdef PetscMat *RT_Pi_mat = NULL * if RT_Pi is not None: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_dim); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 1202, __pyx_L1_error) __pyx_v_idim = __pyx_t_3; /* "petsc4py/PETSc/PC.pyx":1203 * if ND_Pi_Full is not None: ND_full_mat = ND_Pi_Full.mat * cdef PetscInt idim = asInt(dim) * cdef PetscMat *RT_Pi_mat = NULL # <<<<<<<<<<<<<< * if RT_Pi is not None: * PetscMalloc(dim*sizeof(PetscMat), &RT_Pi_mat) */ __pyx_v_RT_Pi_mat = NULL; /* "petsc4py/PETSc/PC.pyx":1204 * cdef PetscInt idim = asInt(dim) * cdef PetscMat *RT_Pi_mat = NULL * if RT_Pi is not None: # <<<<<<<<<<<<<< * PetscMalloc(dim*sizeof(PetscMat), &RT_Pi_mat) * assert len(RT_Pi) == dim */ __pyx_t_1 = (__pyx_v_RT_Pi != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/PC.pyx":1205 * cdef PetscMat *RT_Pi_mat = NULL * if RT_Pi is not None: * PetscMalloc(dim*sizeof(PetscMat), &RT_Pi_mat) # <<<<<<<<<<<<<< * assert len(RT_Pi) == dim * for i in range(dim): */ __pyx_t_4 = __Pyx_PyInt_As_size_t(__pyx_v_dim); if (unlikely((__pyx_t_4 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(48, 1205, __pyx_L1_error) (void)(PetscMalloc((((size_t)__pyx_t_4) * (sizeof(Mat))), (&__pyx_v_RT_Pi_mat))); /* "petsc4py/PETSc/PC.pyx":1206 * if RT_Pi is not None: * PetscMalloc(dim*sizeof(PetscMat), &RT_Pi_mat) * assert len(RT_Pi) == dim # <<<<<<<<<<<<<< * for i in range(dim): * RT_Pi_mat[i] = (RT_Pi[i]).mat */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_5 = PyObject_Length(__pyx_v_RT_Pi); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(48, 1206, __pyx_L1_error) __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(48, 1206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, __pyx_v_dim, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(48, 1206, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(48, 1206, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_1)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(48, 1206, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(48, 1206, __pyx_L1_error) #endif /* "petsc4py/PETSc/PC.pyx":1207 * PetscMalloc(dim*sizeof(PetscMat), &RT_Pi_mat) * assert len(RT_Pi) == dim * for i in range(dim): # <<<<<<<<<<<<<< * RT_Pi_mat[i] = (RT_Pi[i]).mat * cdef PetscMat *ND_Pi_mat = NULL */ __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_v_dim); if (unlikely(!__pyx_t_7)) __PYX_ERR(48, 1207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) { __pyx_t_6 = __pyx_t_7; __Pyx_INCREF(__pyx_t_6); __pyx_t_5 = 0; __pyx_t_8 = NULL; } else { __pyx_t_5 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(48, 1207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(48, 1207, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; for (;;) { if (likely(!__pyx_t_8)) { if (likely(PyList_CheckExact(__pyx_t_6))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(48, 1207, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_7 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(48, 1207, __pyx_L1_error) #else __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(48, 1207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_6); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(48, 1207, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(48, 1207, __pyx_L1_error) #else __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(48, 1207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } } else { __pyx_t_7 = __pyx_t_8(__pyx_t_6); if (unlikely(!__pyx_t_7)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(48, 1207, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_7); } __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_7); __pyx_t_7 = 0; /* "petsc4py/PETSc/PC.pyx":1208 * assert len(RT_Pi) == dim * for i in range(dim): * RT_Pi_mat[i] = (RT_Pi[i]).mat # <<<<<<<<<<<<<< * cdef PetscMat *ND_Pi_mat = NULL * if ND_Pi is not None: */ __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_RT_Pi, __pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(48, 1208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (!(likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_8petsc4py_5PETSc_Mat)))) __PYX_ERR(48, 1208, __pyx_L1_error) __pyx_t_2 = ((struct PyPetscMatObject *)__pyx_t_7)->mat; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(48, 1208, __pyx_L1_error) (__pyx_v_RT_Pi_mat[__pyx_t_9]) = __pyx_t_2; /* "petsc4py/PETSc/PC.pyx":1207 * PetscMalloc(dim*sizeof(PetscMat), &RT_Pi_mat) * assert len(RT_Pi) == dim * for i in range(dim): # <<<<<<<<<<<<<< * RT_Pi_mat[i] = (RT_Pi[i]).mat * cdef PetscMat *ND_Pi_mat = NULL */ } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "petsc4py/PETSc/PC.pyx":1204 * cdef PetscInt idim = asInt(dim) * cdef PetscMat *RT_Pi_mat = NULL * if RT_Pi is not None: # <<<<<<<<<<<<<< * PetscMalloc(dim*sizeof(PetscMat), &RT_Pi_mat) * assert len(RT_Pi) == dim */ } /* "petsc4py/PETSc/PC.pyx":1209 * for i in range(dim): * RT_Pi_mat[i] = (RT_Pi[i]).mat * cdef PetscMat *ND_Pi_mat = NULL # <<<<<<<<<<<<<< * if ND_Pi is not None: * PetscMalloc(dim*sizeof(PetscMat), &ND_Pi_mat) */ __pyx_v_ND_Pi_mat = NULL; /* "petsc4py/PETSc/PC.pyx":1210 * RT_Pi_mat[i] = (RT_Pi[i]).mat * cdef PetscMat *ND_Pi_mat = NULL * if ND_Pi is not None: # <<<<<<<<<<<<<< * PetscMalloc(dim*sizeof(PetscMat), &ND_Pi_mat) * assert len(ND_Pi) == dim */ __pyx_t_1 = (__pyx_v_ND_Pi != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/PC.pyx":1211 * cdef PetscMat *ND_Pi_mat = NULL * if ND_Pi is not None: * PetscMalloc(dim*sizeof(PetscMat), &ND_Pi_mat) # <<<<<<<<<<<<<< * assert len(ND_Pi) == dim * for i in range(dim): */ __pyx_t_4 = __Pyx_PyInt_As_size_t(__pyx_v_dim); if (unlikely((__pyx_t_4 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(48, 1211, __pyx_L1_error) (void)(PetscMalloc((((size_t)__pyx_t_4) * (sizeof(Mat))), (&__pyx_v_ND_Pi_mat))); /* "petsc4py/PETSc/PC.pyx":1212 * if ND_Pi is not None: * PetscMalloc(dim*sizeof(PetscMat), &ND_Pi_mat) * assert len(ND_Pi) == dim # <<<<<<<<<<<<<< * for i in range(dim): * ND_Pi_mat[dim] = (ND_Pi[i]).mat */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_5 = PyObject_Length(__pyx_v_ND_Pi); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(48, 1212, __pyx_L1_error) __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(48, 1212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, __pyx_v_dim, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(48, 1212, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(48, 1212, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_1)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(48, 1212, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(48, 1212, __pyx_L1_error) #endif /* "petsc4py/PETSc/PC.pyx":1213 * PetscMalloc(dim*sizeof(PetscMat), &ND_Pi_mat) * assert len(ND_Pi) == dim * for i in range(dim): # <<<<<<<<<<<<<< * ND_Pi_mat[dim] = (ND_Pi[i]).mat * CHKERR (PCHYPRESetInterpolations(self.pc, idim, RT_full_mat, RT_Pi_mat, */ __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_v_dim); if (unlikely(!__pyx_t_7)) __PYX_ERR(48, 1213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) { __pyx_t_6 = __pyx_t_7; __Pyx_INCREF(__pyx_t_6); __pyx_t_5 = 0; __pyx_t_8 = NULL; } else { __pyx_t_5 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(48, 1213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(48, 1213, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; for (;;) { if (likely(!__pyx_t_8)) { if (likely(PyList_CheckExact(__pyx_t_6))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(48, 1213, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_7 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(48, 1213, __pyx_L1_error) #else __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(48, 1213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_6); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(48, 1213, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(48, 1213, __pyx_L1_error) #else __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(48, 1213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } } else { __pyx_t_7 = __pyx_t_8(__pyx_t_6); if (unlikely(!__pyx_t_7)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(48, 1213, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_7); } __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_7); __pyx_t_7 = 0; /* "petsc4py/PETSc/PC.pyx":1214 * assert len(ND_Pi) == dim * for i in range(dim): * ND_Pi_mat[dim] = (ND_Pi[i]).mat # <<<<<<<<<<<<<< * CHKERR (PCHYPRESetInterpolations(self.pc, idim, RT_full_mat, RT_Pi_mat, * ND_full_mat, ND_Pi_mat)) */ __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_ND_Pi, __pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(48, 1214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (!(likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_8petsc4py_5PETSc_Mat)))) __PYX_ERR(48, 1214, __pyx_L1_error) __pyx_t_2 = ((struct PyPetscMatObject *)__pyx_t_7)->mat; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_dim); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(48, 1214, __pyx_L1_error) (__pyx_v_ND_Pi_mat[__pyx_t_9]) = __pyx_t_2; /* "petsc4py/PETSc/PC.pyx":1213 * PetscMalloc(dim*sizeof(PetscMat), &ND_Pi_mat) * assert len(ND_Pi) == dim * for i in range(dim): # <<<<<<<<<<<<<< * ND_Pi_mat[dim] = (ND_Pi[i]).mat * CHKERR (PCHYPRESetInterpolations(self.pc, idim, RT_full_mat, RT_Pi_mat, */ } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "petsc4py/PETSc/PC.pyx":1210 * RT_Pi_mat[i] = (RT_Pi[i]).mat * cdef PetscMat *ND_Pi_mat = NULL * if ND_Pi is not None: # <<<<<<<<<<<<<< * PetscMalloc(dim*sizeof(PetscMat), &ND_Pi_mat) * assert len(ND_Pi) == dim */ } /* "petsc4py/PETSc/PC.pyx":1215 * for i in range(dim): * ND_Pi_mat[dim] = (ND_Pi[i]).mat * CHKERR (PCHYPRESetInterpolations(self.pc, idim, RT_full_mat, RT_Pi_mat, # <<<<<<<<<<<<<< * ND_full_mat, ND_Pi_mat)) * CHKERR (PetscFree(RT_Pi_mat)) */ __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCHYPRESetInterpolations(__pyx_v_self->pc, __pyx_v_idim, __pyx_v_RT_full_mat, __pyx_v_RT_Pi_mat, __pyx_v_ND_full_mat, __pyx_v_ND_Pi_mat)); if (unlikely(__pyx_t_10 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1215, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":1217 * CHKERR (PCHYPRESetInterpolations(self.pc, idim, RT_full_mat, RT_Pi_mat, * ND_full_mat, ND_Pi_mat)) * CHKERR (PetscFree(RT_Pi_mat)) # <<<<<<<<<<<<<< * CHKERR (PetscFree(ND_Pi_mat)) * */ __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_RT_Pi_mat)); if (unlikely(__pyx_t_10 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1217, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":1218 * ND_full_mat, ND_Pi_mat)) * CHKERR (PetscFree(RT_Pi_mat)) * CHKERR (PetscFree(ND_Pi_mat)) # <<<<<<<<<<<<<< * * def setHYPRESetEdgeConstantVectors(self, Vec ozz, Vec zoz, Vec zzo=None) -> None: */ __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_ND_Pi_mat)); if (unlikely(__pyx_t_10 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1218, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":1172 * CHKERR( PCHYPRESetBetaPoissonMatrix(self.pc, pmat) ) * * def setHYPRESetInterpolations(self, dim: int, Mat RT_Pi_Full=None, RT_Pi=None, # <<<<<<<<<<<<<< * Mat ND_Pi_Full=None, ND_Pi=None) -> None: * """Set the interpolation matrices. */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.PC.setHYPRESetInterpolations", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_i); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":1220 * CHKERR (PetscFree(ND_Pi_mat)) * * def setHYPRESetEdgeConstantVectors(self, Vec ozz, Vec zoz, Vec zzo=None) -> None: # <<<<<<<<<<<<<< * """Set the representation of the constant vector fields in the edge element basis. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_107setHYPRESetEdgeConstantVectors(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_106setHYPRESetEdgeConstantVectors, "PC.setHYPRESetEdgeConstantVectors(self, ozz: Vec, zoz: Vec, zzo: Vec | None = None) -> None\nSet the representation of the constant vector fields in the edge element basis.\n\n Collective.\n\n Parameters\n ----------\n ozz\n A vector representing ``[1,0,0]`` or ``[1,0]`` in 2D.\n zoz\n A vector representing ``[0,1,0]`` or ``[0,1]`` in 2D.\n zzo\n A vector representing ``[0,0,1]`` or `None` in 2D.\n\n See Also\n --------\n petsc.PCHYPRESetEdgeConstantVectors\n\n \nSource code at petsc4py/PETSc/PC.pyx:1220"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_107setHYPRESetEdgeConstantVectors(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_ozz = 0; struct PyPetscVecObject *__pyx_v_zoz = 0; struct PyPetscVecObject *__pyx_v_zzo = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setHYPRESetEdgeConstantVectors (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ozz,&__pyx_n_s_zoz,&__pyx_n_s_zzo,0}; values[2] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscVecObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ozz)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 1220, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_zoz)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 1220, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setHYPRESetEdgeConstantVectors", 0, 2, 3, 1); __PYX_ERR(48, 1220, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_zzo); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 1220, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setHYPRESetEdgeConstantVectors") < 0)) __PYX_ERR(48, 1220, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_ozz = ((struct PyPetscVecObject *)values[0]); __pyx_v_zoz = ((struct PyPetscVecObject *)values[1]); __pyx_v_zzo = ((struct PyPetscVecObject *)values[2]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setHYPRESetEdgeConstantVectors", 0, 2, 3, __pyx_nargs); __PYX_ERR(48, 1220, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setHYPRESetEdgeConstantVectors", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ozz), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "ozz", 0))) __PYX_ERR(48, 1220, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_zoz), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "zoz", 0))) __PYX_ERR(48, 1220, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_zzo), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "zzo", 0))) __PYX_ERR(48, 1220, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_106setHYPRESetEdgeConstantVectors(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_ozz, __pyx_v_zoz, __pyx_v_zzo); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_106setHYPRESetEdgeConstantVectors(struct PyPetscPCObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_ozz, struct PyPetscVecObject *__pyx_v_zoz, struct PyPetscVecObject *__pyx_v_zzo) { Vec __pyx_v_zzo_vec; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; Vec __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setHYPRESetEdgeConstantVectors", 1); /* "petsc4py/PETSc/PC.pyx":1239 * * """ * cdef PetscVec zzo_vec = NULL # <<<<<<<<<<<<<< * if zzo is not None: zzo_vec = zzo.vec * CHKERR( PCHYPRESetEdgeConstantVectors(self.pc, ozz.vec, zoz.vec, */ __pyx_v_zzo_vec = NULL; /* "petsc4py/PETSc/PC.pyx":1240 * """ * cdef PetscVec zzo_vec = NULL * if zzo is not None: zzo_vec = zzo.vec # <<<<<<<<<<<<<< * CHKERR( PCHYPRESetEdgeConstantVectors(self.pc, ozz.vec, zoz.vec, * zzo_vec) ) */ __pyx_t_1 = (((PyObject *)__pyx_v_zzo) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_zzo->vec; __pyx_v_zzo_vec = __pyx_t_2; } /* "petsc4py/PETSc/PC.pyx":1241 * cdef PetscVec zzo_vec = NULL * if zzo is not None: zzo_vec = zzo.vec * CHKERR( PCHYPRESetEdgeConstantVectors(self.pc, ozz.vec, zoz.vec, # <<<<<<<<<<<<<< * zzo_vec) ) * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCHYPRESetEdgeConstantVectors(__pyx_v_self->pc, __pyx_v_ozz->vec, __pyx_v_zoz->vec, __pyx_v_zzo_vec)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1241, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":1220 * CHKERR (PetscFree(ND_Pi_mat)) * * def setHYPRESetEdgeConstantVectors(self, Vec ozz, Vec zoz, Vec zzo=None) -> None: # <<<<<<<<<<<<<< * """Set the representation of the constant vector fields in the edge element basis. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setHYPRESetEdgeConstantVectors", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":1244 * zzo_vec) ) * * def setHYPREAMSSetInteriorNodes(self, Vec interior) -> None: # <<<<<<<<<<<<<< * """Set the list of interior nodes to a zero conductivity region. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_109setHYPREAMSSetInteriorNodes(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_108setHYPREAMSSetInteriorNodes, "PC.setHYPREAMSSetInteriorNodes(self, interior: Vec) -> None\nSet the list of interior nodes to a zero conductivity region.\n\n Collective.\n\n Parameters\n ----------\n interior\n A vector where a value of 1.0 indicates an interior node.\n\n See Also\n --------\n petsc.PCHYPREAMSSetInteriorNodes\n\n \nSource code at petsc4py/PETSc/PC.pyx:1244"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_109setHYPREAMSSetInteriorNodes(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_interior = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setHYPREAMSSetInteriorNodes (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_interior,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_interior)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 1244, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setHYPREAMSSetInteriorNodes") < 0)) __PYX_ERR(48, 1244, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_interior = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setHYPREAMSSetInteriorNodes", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 1244, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setHYPREAMSSetInteriorNodes", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_interior), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "interior", 0))) __PYX_ERR(48, 1244, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_108setHYPREAMSSetInteriorNodes(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_interior); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_108setHYPREAMSSetInteriorNodes(struct PyPetscPCObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_interior) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setHYPREAMSSetInteriorNodes", 1); /* "petsc4py/PETSc/PC.pyx":1259 * * """ * CHKERR(PCHYPREAMSSetInteriorNodes(self.pc, interior.vec)) # <<<<<<<<<<<<<< * * # --- Factor --- */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCHYPREAMSSetInteriorNodes(__pyx_v_self->pc, __pyx_v_interior->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1259, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":1244 * zzo_vec) ) * * def setHYPREAMSSetInteriorNodes(self, Vec interior) -> None: # <<<<<<<<<<<<<< * """Set the list of interior nodes to a zero conductivity region. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setHYPREAMSSetInteriorNodes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":1263 * # --- Factor --- * * def setFactorSolverType(self, solver: Mat.SolverType | str) -> None: # <<<<<<<<<<<<<< * """Set the solver package used to perform the factorization. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_111setFactorSolverType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_110setFactorSolverType, "PC.setFactorSolverType(self, solver: Mat.SolverType | str) -> None\nSet the solver package used to perform the factorization.\n\n Logically collective.\n\n Parameters\n ----------\n solver\n The solver package used to factorize.\n\n See Also\n --------\n petsc.PCFactorSetMatSolverType\n\n \nSource code at petsc4py/PETSc/PC.pyx:1263"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_111setFactorSolverType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_solver = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFactorSolverType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_solver,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_solver)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 1263, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setFactorSolverType") < 0)) __PYX_ERR(48, 1263, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_solver = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setFactorSolverType", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 1263, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setFactorSolverType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_110setFactorSolverType(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_solver); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_110setFactorSolverType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_solver) { MatSolverType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFactorSolverType", 0); __Pyx_INCREF(__pyx_v_solver); /* "petsc4py/PETSc/PC.pyx":1278 * * """ * cdef PetscMatSolverType cval = NULL # <<<<<<<<<<<<<< * solver = str2bytes(solver, &cval) * CHKERR( PCFactorSetMatSolverType(self.pc, cval) ) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/PC.pyx":1279 * """ * cdef PetscMatSolverType cval = NULL * solver = str2bytes(solver, &cval) # <<<<<<<<<<<<<< * CHKERR( PCFactorSetMatSolverType(self.pc, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_solver, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 1279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_solver, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/PC.pyx":1280 * cdef PetscMatSolverType cval = NULL * solver = str2bytes(solver, &cval) * CHKERR( PCFactorSetMatSolverType(self.pc, cval) ) # <<<<<<<<<<<<<< * * def getFactorSolverType(self) -> str: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCFactorSetMatSolverType(__pyx_v_self->pc, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1280, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":1263 * # --- Factor --- * * def setFactorSolverType(self, solver: Mat.SolverType | str) -> None: # <<<<<<<<<<<<<< * """Set the solver package used to perform the factorization. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PC.setFactorSolverType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_solver); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":1282 * CHKERR( PCFactorSetMatSolverType(self.pc, cval) ) * * def getFactorSolverType(self) -> str: # <<<<<<<<<<<<<< * """Return the solver package used to perform the factorization. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_113getFactorSolverType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_112getFactorSolverType, "PC.getFactorSolverType(self) -> str\nReturn the solver package used to perform the factorization.\n\n Not collective.\n\n See Also\n --------\n petsc.PCFactorGetMatSolverType\n\n \nSource code at petsc4py/PETSc/PC.pyx:1282"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_113getFactorSolverType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getFactorSolverType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getFactorSolverType", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getFactorSolverType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_112getFactorSolverType(((struct PyPetscPCObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_112getFactorSolverType(struct PyPetscPCObject *__pyx_v_self) { MatSolverType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getFactorSolverType", 1); /* "petsc4py/PETSc/PC.pyx":1292 * * """ * cdef PetscMatSolverType cval = NULL # <<<<<<<<<<<<<< * CHKERR( PCFactorGetMatSolverType(self.pc, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/PC.pyx":1293 * """ * cdef PetscMatSolverType cval = NULL * CHKERR( PCFactorGetMatSolverType(self.pc, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCFactorGetMatSolverType(__pyx_v_self->pc, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1293, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":1294 * cdef PetscMatSolverType cval = NULL * CHKERR( PCFactorGetMatSolverType(self.pc, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * def setFactorSetUpSolverType(self) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 1294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/PC.pyx":1282 * CHKERR( PCFactorSetMatSolverType(self.pc, cval) ) * * def getFactorSolverType(self) -> str: # <<<<<<<<<<<<<< * """Return the solver package used to perform the factorization. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.PC.getFactorSolverType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":1296 * return bytes2str(cval) * * def setFactorSetUpSolverType(self) -> None: # <<<<<<<<<<<<<< * """Set up the factorization solver. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_115setFactorSetUpSolverType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_114setFactorSetUpSolverType, "PC.setFactorSetUpSolverType(self) -> None\nSet up the factorization solver.\n\n This can be called after `KSP.setOperators` or `PC.setOperators`, causes\n `petsc.MatGetFactor` to be called so then one may set the options for\n that particular factorization object.\n\n See Also\n --------\n petsc_options, petsc.PCFactorSetUpMatSolverType\n\n \nSource code at petsc4py/PETSc/PC.pyx:1296"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_115setFactorSetUpSolverType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFactorSetUpSolverType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("setFactorSetUpSolverType", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setFactorSetUpSolverType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_114setFactorSetUpSolverType(((struct PyPetscPCObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_114setFactorSetUpSolverType(struct PyPetscPCObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFactorSetUpSolverType", 1); /* "petsc4py/PETSc/PC.pyx":1308 * * """ * CHKERR( PCFactorSetUpMatSolverType(self.pc) ) # <<<<<<<<<<<<<< * * def setFactorOrdering( */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCFactorSetUpMatSolverType(__pyx_v_self->pc)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1308, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":1296 * return bytes2str(cval) * * def setFactorSetUpSolverType(self) -> None: # <<<<<<<<<<<<<< * """Set up the factorization solver. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setFactorSetUpSolverType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":1310 * CHKERR( PCFactorSetUpMatSolverType(self.pc) ) * * def setFactorOrdering( # <<<<<<<<<<<<<< * self, * ord_type: str | None = None, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_117setFactorOrdering(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_116setFactorOrdering, "PC.setFactorOrdering(self, ord_type: str | None = None, nzdiag: float | None = None, reuse: bool | None = None) -> None\nSet options for the matrix factorization reordering.\n\n Logically collective.\n\n Parameters\n ----------\n ord_type\n The name of the matrix ordering or `None` to leave unchanged.\n nzdiag\n Threshold to consider diagonal entries in the matrix as zero.\n reuse\n Enable to reuse the ordering of a factored matrix.\n\n See Also\n --------\n petsc.PCFactorSetMatOrderingType\n petsc.PCFactorReorderForNonzeroDiagonal, petsc.PCFactorSetReuseOrdering\n\n \nSource code at petsc4py/PETSc/PC.pyx:1310"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_117setFactorOrdering(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_ord_type = 0; PyObject *__pyx_v_nzdiag = 0; PyObject *__pyx_v_reuse = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFactorOrdering (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ord_type,&__pyx_n_s_nzdiag,&__pyx_n_s_reuse,0}; /* "petsc4py/PETSc/PC.pyx":1312 * def setFactorOrdering( * self, * ord_type: str | None = None, # <<<<<<<<<<<<<< * nzdiag: float | None = None, * reuse: bool | None = None) -> None: */ values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/PC.pyx":1313 * self, * ord_type: str | None = None, * nzdiag: float | None = None, # <<<<<<<<<<<<<< * reuse: bool | None = None) -> None: * """Set options for the matrix factorization reordering. */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/PC.pyx":1314 * ord_type: str | None = None, * nzdiag: float | None = None, * reuse: bool | None = None) -> None: # <<<<<<<<<<<<<< * """Set options for the matrix factorization reordering. * */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ord_type); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 1310, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_nzdiag); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 1310, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_reuse); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 1310, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setFactorOrdering") < 0)) __PYX_ERR(48, 1310, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_ord_type = values[0]; __pyx_v_nzdiag = values[1]; __pyx_v_reuse = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setFactorOrdering", 0, 0, 3, __pyx_nargs); __PYX_ERR(48, 1310, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setFactorOrdering", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_116setFactorOrdering(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_ord_type, __pyx_v_nzdiag, __pyx_v_reuse); /* "petsc4py/PETSc/PC.pyx":1310 * CHKERR( PCFactorSetUpMatSolverType(self.pc) ) * * def setFactorOrdering( # <<<<<<<<<<<<<< * self, * ord_type: str | None = None, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_116setFactorOrdering(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_ord_type, PyObject *__pyx_v_nzdiag, PyObject *__pyx_v_reuse) { MatOrderingType __pyx_v_cval; PetscReal __pyx_v_rval; PetscBool __pyx_v_bval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; PetscReal __pyx_t_4; PetscBool __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFactorOrdering", 0); __Pyx_INCREF(__pyx_v_ord_type); /* "petsc4py/PETSc/PC.pyx":1334 * * """ * cdef PetscMatOrderingType cval = NULL # <<<<<<<<<<<<<< * if ord_type is not None: * ord_type = str2bytes(ord_type, &cval) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/PC.pyx":1335 * """ * cdef PetscMatOrderingType cval = NULL * if ord_type is not None: # <<<<<<<<<<<<<< * ord_type = str2bytes(ord_type, &cval) * CHKERR( PCFactorSetMatOrderingType(self.pc, cval) ) */ __pyx_t_1 = (__pyx_v_ord_type != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/PC.pyx":1336 * cdef PetscMatOrderingType cval = NULL * if ord_type is not None: * ord_type = str2bytes(ord_type, &cval) # <<<<<<<<<<<<<< * CHKERR( PCFactorSetMatOrderingType(self.pc, cval) ) * cdef PetscReal rval = 0 */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_ord_type, (&__pyx_v_cval)); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 1336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_ord_type, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/PC.pyx":1337 * if ord_type is not None: * ord_type = str2bytes(ord_type, &cval) * CHKERR( PCFactorSetMatOrderingType(self.pc, cval) ) # <<<<<<<<<<<<<< * cdef PetscReal rval = 0 * if nzdiag is not None: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCFactorSetMatOrderingType(__pyx_v_self->pc, __pyx_v_cval)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1337, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":1335 * """ * cdef PetscMatOrderingType cval = NULL * if ord_type is not None: # <<<<<<<<<<<<<< * ord_type = str2bytes(ord_type, &cval) * CHKERR( PCFactorSetMatOrderingType(self.pc, cval) ) */ } /* "petsc4py/PETSc/PC.pyx":1338 * ord_type = str2bytes(ord_type, &cval) * CHKERR( PCFactorSetMatOrderingType(self.pc, cval) ) * cdef PetscReal rval = 0 # <<<<<<<<<<<<<< * if nzdiag is not None: * rval = asReal(nzdiag) */ __pyx_v_rval = 0.0; /* "petsc4py/PETSc/PC.pyx":1339 * CHKERR( PCFactorSetMatOrderingType(self.pc, cval) ) * cdef PetscReal rval = 0 * if nzdiag is not None: # <<<<<<<<<<<<<< * rval = asReal(nzdiag) * CHKERR( PCFactorReorderForNonzeroDiagonal(self.pc, rval) ) */ __pyx_t_1 = (__pyx_v_nzdiag != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/PC.pyx":1340 * cdef PetscReal rval = 0 * if nzdiag is not None: * rval = asReal(nzdiag) # <<<<<<<<<<<<<< * CHKERR( PCFactorReorderForNonzeroDiagonal(self.pc, rval) ) * cdef PetscBool bval = PETSC_FALSE */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_nzdiag); if (unlikely(__pyx_t_4 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(48, 1340, __pyx_L1_error) __pyx_v_rval = __pyx_t_4; /* "petsc4py/PETSc/PC.pyx":1341 * if nzdiag is not None: * rval = asReal(nzdiag) * CHKERR( PCFactorReorderForNonzeroDiagonal(self.pc, rval) ) # <<<<<<<<<<<<<< * cdef PetscBool bval = PETSC_FALSE * if reuse is not None: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCFactorReorderForNonzeroDiagonal(__pyx_v_self->pc, __pyx_v_rval)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1341, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":1339 * CHKERR( PCFactorSetMatOrderingType(self.pc, cval) ) * cdef PetscReal rval = 0 * if nzdiag is not None: # <<<<<<<<<<<<<< * rval = asReal(nzdiag) * CHKERR( PCFactorReorderForNonzeroDiagonal(self.pc, rval) ) */ } /* "petsc4py/PETSc/PC.pyx":1342 * rval = asReal(nzdiag) * CHKERR( PCFactorReorderForNonzeroDiagonal(self.pc, rval) ) * cdef PetscBool bval = PETSC_FALSE # <<<<<<<<<<<<<< * if reuse is not None: * bval = PETSC_TRUE if reuse else PETSC_FALSE */ __pyx_v_bval = PETSC_FALSE; /* "petsc4py/PETSc/PC.pyx":1343 * CHKERR( PCFactorReorderForNonzeroDiagonal(self.pc, rval) ) * cdef PetscBool bval = PETSC_FALSE * if reuse is not None: # <<<<<<<<<<<<<< * bval = PETSC_TRUE if reuse else PETSC_FALSE * CHKERR( PCFactorSetReuseOrdering(self.pc, bval) ) */ __pyx_t_1 = (__pyx_v_reuse != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/PC.pyx":1344 * cdef PetscBool bval = PETSC_FALSE * if reuse is not None: * bval = PETSC_TRUE if reuse else PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( PCFactorSetReuseOrdering(self.pc, bval) ) * */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_reuse); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(48, 1344, __pyx_L1_error) if (__pyx_t_1) { __pyx_t_5 = PETSC_TRUE; } else { __pyx_t_5 = PETSC_FALSE; } __pyx_v_bval = __pyx_t_5; /* "petsc4py/PETSc/PC.pyx":1345 * if reuse is not None: * bval = PETSC_TRUE if reuse else PETSC_FALSE * CHKERR( PCFactorSetReuseOrdering(self.pc, bval) ) # <<<<<<<<<<<<<< * * def setFactorPivot( */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCFactorSetReuseOrdering(__pyx_v_self->pc, __pyx_v_bval)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1345, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":1343 * CHKERR( PCFactorReorderForNonzeroDiagonal(self.pc, rval) ) * cdef PetscBool bval = PETSC_FALSE * if reuse is not None: # <<<<<<<<<<<<<< * bval = PETSC_TRUE if reuse else PETSC_FALSE * CHKERR( PCFactorSetReuseOrdering(self.pc, bval) ) */ } /* "petsc4py/PETSc/PC.pyx":1310 * CHKERR( PCFactorSetUpMatSolverType(self.pc) ) * * def setFactorOrdering( # <<<<<<<<<<<<<< * self, * ord_type: str | None = None, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.PC.setFactorOrdering", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ord_type); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":1347 * CHKERR( PCFactorSetReuseOrdering(self.pc, bval) ) * * def setFactorPivot( # <<<<<<<<<<<<<< * self, * zeropivot: float | None = None, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_119setFactorPivot(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_118setFactorPivot, "PC.setFactorPivot(self, zeropivot: float | None = None, inblocks: bool | None = None) -> None\nSet options for matrix factorization pivoting.\n\n Logically collective.\n\n Parameters\n ----------\n zeropivot\n The size at which smaller pivots are treated as zero.\n inblocks\n Enable to allow pivoting while factoring in blocks.\n\n See Also\n --------\n petsc.PCFactorSetZeroPivot, petsc.PCFactorSetPivotInBlocks\n\n \nSource code at petsc4py/PETSc/PC.pyx:1347"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_119setFactorPivot(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_zeropivot = 0; PyObject *__pyx_v_inblocks = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFactorPivot (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_zeropivot,&__pyx_n_s_inblocks,0}; /* "petsc4py/PETSc/PC.pyx":1349 * def setFactorPivot( * self, * zeropivot: float | None = None, # <<<<<<<<<<<<<< * inblocks: bool | None = None) -> None: * """Set options for matrix factorization pivoting. */ values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/PC.pyx":1350 * self, * zeropivot: float | None = None, * inblocks: bool | None = None) -> None: # <<<<<<<<<<<<<< * """Set options for matrix factorization pivoting. * */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_zeropivot); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 1347, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_inblocks); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 1347, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setFactorPivot") < 0)) __PYX_ERR(48, 1347, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_zeropivot = values[0]; __pyx_v_inblocks = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setFactorPivot", 0, 0, 2, __pyx_nargs); __PYX_ERR(48, 1347, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setFactorPivot", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_118setFactorPivot(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_zeropivot, __pyx_v_inblocks); /* "petsc4py/PETSc/PC.pyx":1347 * CHKERR( PCFactorSetReuseOrdering(self.pc, bval) ) * * def setFactorPivot( # <<<<<<<<<<<<<< * self, * zeropivot: float | None = None, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_118setFactorPivot(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_zeropivot, PyObject *__pyx_v_inblocks) { PetscReal __pyx_v_rval; PetscBool __pyx_v_bval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscReal __pyx_t_2; PetscErrorCode __pyx_t_3; PetscBool __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFactorPivot", 1); /* "petsc4py/PETSc/PC.pyx":1367 * * """ * cdef PetscReal rval = 0 # <<<<<<<<<<<<<< * if zeropivot is not None: * rval = asReal(zeropivot) */ __pyx_v_rval = 0.0; /* "petsc4py/PETSc/PC.pyx":1368 * """ * cdef PetscReal rval = 0 * if zeropivot is not None: # <<<<<<<<<<<<<< * rval = asReal(zeropivot) * CHKERR( PCFactorSetZeroPivot(self.pc, rval) ) */ __pyx_t_1 = (__pyx_v_zeropivot != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/PC.pyx":1369 * cdef PetscReal rval = 0 * if zeropivot is not None: * rval = asReal(zeropivot) # <<<<<<<<<<<<<< * CHKERR( PCFactorSetZeroPivot(self.pc, rval) ) * cdef PetscBool bval = PETSC_FALSE */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_zeropivot); if (unlikely(__pyx_t_2 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(48, 1369, __pyx_L1_error) __pyx_v_rval = __pyx_t_2; /* "petsc4py/PETSc/PC.pyx":1370 * if zeropivot is not None: * rval = asReal(zeropivot) * CHKERR( PCFactorSetZeroPivot(self.pc, rval) ) # <<<<<<<<<<<<<< * cdef PetscBool bval = PETSC_FALSE * if inblocks is not None: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCFactorSetZeroPivot(__pyx_v_self->pc, __pyx_v_rval)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1370, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":1368 * """ * cdef PetscReal rval = 0 * if zeropivot is not None: # <<<<<<<<<<<<<< * rval = asReal(zeropivot) * CHKERR( PCFactorSetZeroPivot(self.pc, rval) ) */ } /* "petsc4py/PETSc/PC.pyx":1371 * rval = asReal(zeropivot) * CHKERR( PCFactorSetZeroPivot(self.pc, rval) ) * cdef PetscBool bval = PETSC_FALSE # <<<<<<<<<<<<<< * if inblocks is not None: * bval = PETSC_TRUE if inblocks else PETSC_FALSE */ __pyx_v_bval = PETSC_FALSE; /* "petsc4py/PETSc/PC.pyx":1372 * CHKERR( PCFactorSetZeroPivot(self.pc, rval) ) * cdef PetscBool bval = PETSC_FALSE * if inblocks is not None: # <<<<<<<<<<<<<< * bval = PETSC_TRUE if inblocks else PETSC_FALSE * CHKERR( PCFactorSetPivotInBlocks(self.pc, bval) ) */ __pyx_t_1 = (__pyx_v_inblocks != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/PC.pyx":1373 * cdef PetscBool bval = PETSC_FALSE * if inblocks is not None: * bval = PETSC_TRUE if inblocks else PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( PCFactorSetPivotInBlocks(self.pc, bval) ) * */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_inblocks); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(48, 1373, __pyx_L1_error) if (__pyx_t_1) { __pyx_t_4 = PETSC_TRUE; } else { __pyx_t_4 = PETSC_FALSE; } __pyx_v_bval = __pyx_t_4; /* "petsc4py/PETSc/PC.pyx":1374 * if inblocks is not None: * bval = PETSC_TRUE if inblocks else PETSC_FALSE * CHKERR( PCFactorSetPivotInBlocks(self.pc, bval) ) # <<<<<<<<<<<<<< * * def setFactorShift( */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCFactorSetPivotInBlocks(__pyx_v_self->pc, __pyx_v_bval)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1374, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":1372 * CHKERR( PCFactorSetZeroPivot(self.pc, rval) ) * cdef PetscBool bval = PETSC_FALSE * if inblocks is not None: # <<<<<<<<<<<<<< * bval = PETSC_TRUE if inblocks else PETSC_FALSE * CHKERR( PCFactorSetPivotInBlocks(self.pc, bval) ) */ } /* "petsc4py/PETSc/PC.pyx":1347 * CHKERR( PCFactorSetReuseOrdering(self.pc, bval) ) * * def setFactorPivot( # <<<<<<<<<<<<<< * self, * zeropivot: float | None = None, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setFactorPivot", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":1376 * CHKERR( PCFactorSetPivotInBlocks(self.pc, bval) ) * * def setFactorShift( # <<<<<<<<<<<<<< * self, * shift_type: Mat.FactorShiftType | None = None, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_121setFactorShift(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_120setFactorShift, "PC.setFactorShift(self, shift_type: Mat.FactorShiftType | None = None, amount: float | None = None) -> None\nSet options for shifting diagonal entries of a matrix.\n\n Parameters\n ----------\n shift_type\n The type of shift, or `None` to leave unchanged.\n amount\n The amount of shift. Specify `DEFAULT` to determine internally or\n `None` to leave unchanged.\n\n See Also\n --------\n petsc.PCFactorSetShiftType, petsc.PCFactorSetShiftAmount\n\n \nSource code at petsc4py/PETSc/PC.pyx:1376"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_121setFactorShift(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_shift_type = 0; PyObject *__pyx_v_amount = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFactorShift (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shift_type,&__pyx_n_s_amount,0}; /* "petsc4py/PETSc/PC.pyx":1378 * def setFactorShift( * self, * shift_type: Mat.FactorShiftType | None = None, # <<<<<<<<<<<<<< * amount: float | None = None) -> None: * """Set options for shifting diagonal entries of a matrix. */ values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/PC.pyx":1379 * self, * shift_type: Mat.FactorShiftType | None = None, * amount: float | None = None) -> None: # <<<<<<<<<<<<<< * """Set options for shifting diagonal entries of a matrix. * */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_shift_type); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 1376, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_amount); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 1376, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setFactorShift") < 0)) __PYX_ERR(48, 1376, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_shift_type = values[0]; __pyx_v_amount = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setFactorShift", 0, 0, 2, __pyx_nargs); __PYX_ERR(48, 1376, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setFactorShift", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_120setFactorShift(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_shift_type, __pyx_v_amount); /* "petsc4py/PETSc/PC.pyx":1376 * CHKERR( PCFactorSetPivotInBlocks(self.pc, bval) ) * * def setFactorShift( # <<<<<<<<<<<<<< * self, * shift_type: Mat.FactorShiftType | None = None, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_120setFactorShift(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_shift_type, PyObject *__pyx_v_amount) { MatFactorShiftType __pyx_v_cval; PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; MatFactorShiftType __pyx_t_2; PetscErrorCode __pyx_t_3; PetscReal __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFactorShift", 1); /* "petsc4py/PETSc/PC.pyx":1395 * * """ * cdef PetscMatFactorShiftType cval = MAT_SHIFT_NONE # <<<<<<<<<<<<<< * if shift_type is not None: * cval = matfactorshifttype(shift_type) */ __pyx_v_cval = MAT_SHIFT_NONE; /* "petsc4py/PETSc/PC.pyx":1396 * """ * cdef PetscMatFactorShiftType cval = MAT_SHIFT_NONE * if shift_type is not None: # <<<<<<<<<<<<<< * cval = matfactorshifttype(shift_type) * CHKERR( PCFactorSetShiftType(self.pc, cval) ) */ __pyx_t_1 = (__pyx_v_shift_type != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/PC.pyx":1397 * cdef PetscMatFactorShiftType cval = MAT_SHIFT_NONE * if shift_type is not None: * cval = matfactorshifttype(shift_type) # <<<<<<<<<<<<<< * CHKERR( PCFactorSetShiftType(self.pc, cval) ) * cdef PetscReal rval = 0 */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_matfactorshifttype(__pyx_v_shift_type); if (unlikely(__pyx_t_2 == ((MatFactorShiftType)((MatFactorShiftType)-1L)))) __PYX_ERR(48, 1397, __pyx_L1_error) __pyx_v_cval = __pyx_t_2; /* "petsc4py/PETSc/PC.pyx":1398 * if shift_type is not None: * cval = matfactorshifttype(shift_type) * CHKERR( PCFactorSetShiftType(self.pc, cval) ) # <<<<<<<<<<<<<< * cdef PetscReal rval = 0 * if amount is not None: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCFactorSetShiftType(__pyx_v_self->pc, __pyx_v_cval)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1398, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":1396 * """ * cdef PetscMatFactorShiftType cval = MAT_SHIFT_NONE * if shift_type is not None: # <<<<<<<<<<<<<< * cval = matfactorshifttype(shift_type) * CHKERR( PCFactorSetShiftType(self.pc, cval) ) */ } /* "petsc4py/PETSc/PC.pyx":1399 * cval = matfactorshifttype(shift_type) * CHKERR( PCFactorSetShiftType(self.pc, cval) ) * cdef PetscReal rval = 0 # <<<<<<<<<<<<<< * if amount is not None: * rval = asReal(amount) */ __pyx_v_rval = 0.0; /* "petsc4py/PETSc/PC.pyx":1400 * CHKERR( PCFactorSetShiftType(self.pc, cval) ) * cdef PetscReal rval = 0 * if amount is not None: # <<<<<<<<<<<<<< * rval = asReal(amount) * CHKERR( PCFactorSetShiftAmount(self.pc, rval) ) */ __pyx_t_1 = (__pyx_v_amount != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/PC.pyx":1401 * cdef PetscReal rval = 0 * if amount is not None: * rval = asReal(amount) # <<<<<<<<<<<<<< * CHKERR( PCFactorSetShiftAmount(self.pc, rval) ) * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_amount); if (unlikely(__pyx_t_4 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(48, 1401, __pyx_L1_error) __pyx_v_rval = __pyx_t_4; /* "petsc4py/PETSc/PC.pyx":1402 * if amount is not None: * rval = asReal(amount) * CHKERR( PCFactorSetShiftAmount(self.pc, rval) ) # <<<<<<<<<<<<<< * * def setFactorLevels(self, levels: int) -> None: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCFactorSetShiftAmount(__pyx_v_self->pc, __pyx_v_rval)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1402, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":1400 * CHKERR( PCFactorSetShiftType(self.pc, cval) ) * cdef PetscReal rval = 0 * if amount is not None: # <<<<<<<<<<<<<< * rval = asReal(amount) * CHKERR( PCFactorSetShiftAmount(self.pc, rval) ) */ } /* "petsc4py/PETSc/PC.pyx":1376 * CHKERR( PCFactorSetPivotInBlocks(self.pc, bval) ) * * def setFactorShift( # <<<<<<<<<<<<<< * self, * shift_type: Mat.FactorShiftType | None = None, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setFactorShift", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":1404 * CHKERR( PCFactorSetShiftAmount(self.pc, rval) ) * * def setFactorLevels(self, levels: int) -> None: # <<<<<<<<<<<<<< * """Set the number of levels of fill. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_123setFactorLevels(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_122setFactorLevels, "PC.setFactorLevels(self, levels: int) -> None\nSet the number of levels of fill.\n\n Logically collective.\n\n Parameters\n ----------\n levels\n The number of levels to fill.\n\n See Also\n --------\n petsc.PCFactorSetLevels\n\n \nSource code at petsc4py/PETSc/PC.pyx:1404"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_123setFactorLevels(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_levels = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFactorLevels (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_levels,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_levels)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 1404, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setFactorLevels") < 0)) __PYX_ERR(48, 1404, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_levels = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setFactorLevels", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 1404, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setFactorLevels", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_122setFactorLevels(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_levels); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_122setFactorLevels(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_levels) { PetscInt __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFactorLevels", 1); /* "petsc4py/PETSc/PC.pyx":1419 * * """ * cdef PetscInt ival = asInt(levels) # <<<<<<<<<<<<<< * CHKERR( PCFactorSetLevels(self.pc, ival) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_levels); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 1419, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "petsc4py/PETSc/PC.pyx":1420 * """ * cdef PetscInt ival = asInt(levels) * CHKERR( PCFactorSetLevels(self.pc, ival) ) # <<<<<<<<<<<<<< * * def getFactorMatrix(self) -> Mat: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCFactorSetLevels(__pyx_v_self->pc, __pyx_v_ival)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1420, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":1404 * CHKERR( PCFactorSetShiftAmount(self.pc, rval) ) * * def setFactorLevels(self, levels: int) -> None: # <<<<<<<<<<<<<< * """Set the number of levels of fill. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setFactorLevels", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":1422 * CHKERR( PCFactorSetLevels(self.pc, ival) ) * * def getFactorMatrix(self) -> Mat: # <<<<<<<<<<<<<< * """Return the factored matrix. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_125getFactorMatrix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_124getFactorMatrix, "PC.getFactorMatrix(self) -> Mat\nReturn the factored matrix.\n\n Not collective.\n\n See Also\n --------\n petsc.PCFactorGetMatrix\n\n \nSource code at petsc4py/PETSc/PC.pyx:1422"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_125getFactorMatrix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getFactorMatrix (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getFactorMatrix", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getFactorMatrix", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_124getFactorMatrix(((struct PyPetscPCObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_124getFactorMatrix(struct PyPetscPCObject *__pyx_v_self) { struct PyPetscMatObject *__pyx_v_mat = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getFactorMatrix", 1); /* "petsc4py/PETSc/PC.pyx":1432 * * """ * cdef Mat mat = Mat() # <<<<<<<<<<<<<< * CHKERR( PCFactorGetMatrix(self.pc, &mat.mat) ) * CHKERR( PetscINCREF(mat.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 1432, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_mat = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/PC.pyx":1433 * """ * cdef Mat mat = Mat() * CHKERR( PCFactorGetMatrix(self.pc, &mat.mat) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(mat.obj) ) * return mat */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCFactorGetMatrix(__pyx_v_self->pc, (&__pyx_v_mat->mat))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1433, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":1434 * cdef Mat mat = Mat() * CHKERR( PCFactorGetMatrix(self.pc, &mat.mat) ) * CHKERR( PetscINCREF(mat.obj) ) # <<<<<<<<<<<<<< * return mat * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_mat->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1434, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":1435 * CHKERR( PCFactorGetMatrix(self.pc, &mat.mat) ) * CHKERR( PetscINCREF(mat.obj) ) * return mat # <<<<<<<<<<<<<< * * # --- FieldSplit --- */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_mat); __pyx_r = ((PyObject *)__pyx_v_mat); goto __pyx_L0; /* "petsc4py/PETSc/PC.pyx":1422 * CHKERR( PCFactorSetLevels(self.pc, ival) ) * * def getFactorMatrix(self) -> Mat: # <<<<<<<<<<<<<< * """Return the factored matrix. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PC.getFactorMatrix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_mat); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":1439 * # --- FieldSplit --- * * def setFieldSplitType(self, ctype: CompositeType) -> None: # <<<<<<<<<<<<<< * """Set the type of composition of a field split preconditioner. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_127setFieldSplitType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_126setFieldSplitType, "PC.setFieldSplitType(self, ctype: CompositeType) -> None\nSet the type of composition of a field split preconditioner.\n\n Collective.\n\n Parameters\n ----------\n ctype\n The type of composition.\n\n See Also\n --------\n petsc.PCFieldSplitSetType\n\n \nSource code at petsc4py/PETSc/PC.pyx:1439"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_127setFieldSplitType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_ctype = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFieldSplitType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ctype,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ctype)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 1439, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setFieldSplitType") < 0)) __PYX_ERR(48, 1439, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_ctype = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setFieldSplitType", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 1439, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setFieldSplitType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_126setFieldSplitType(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_ctype); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_126setFieldSplitType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_ctype) { PCCompositeType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PCCompositeType __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFieldSplitType", 1); /* "petsc4py/PETSc/PC.pyx":1454 * * """ * cdef PetscPCCompositeType cval = ctype # <<<<<<<<<<<<<< * CHKERR( PCFieldSplitSetType(self.pc, cval) ) * */ __pyx_t_1 = ((PCCompositeType)__Pyx_PyInt_As_PCCompositeType(__pyx_v_ctype)); if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 1454, __pyx_L1_error) __pyx_v_cval = __pyx_t_1; /* "petsc4py/PETSc/PC.pyx":1455 * """ * cdef PetscPCCompositeType cval = ctype * CHKERR( PCFieldSplitSetType(self.pc, cval) ) # <<<<<<<<<<<<<< * * def setFieldSplitIS(self, *fields: Tuple[str, IS]) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCFieldSplitSetType(__pyx_v_self->pc, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1455, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":1439 * # --- FieldSplit --- * * def setFieldSplitType(self, ctype: CompositeType) -> None: # <<<<<<<<<<<<<< * """Set the type of composition of a field split preconditioner. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setFieldSplitType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":1457 * CHKERR( PCFieldSplitSetType(self.pc, cval) ) * * def setFieldSplitIS(self, *fields: Tuple[str, IS]) -> None: # <<<<<<<<<<<<<< * """Set the elements for the field split by `IS`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_129setFieldSplitIS(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_128setFieldSplitIS, "PC.setFieldSplitIS(self, *fields: Tuple[str, IS]) -> None\nSet the elements for the field split by `IS`.\n\n Logically collective.\n\n Solve options for this split will be available\n under the prefix ``-fieldsplit_SPLITNAME_*``.\n\n Parameters\n ----------\n fields\n A sequence of tuples containing the split name and the `IS` that\n defines the elements in the split.\n\n See Also\n --------\n petsc_options, petsc.PCFieldSplitSetIS\n\n \nSource code at petsc4py/PETSc/PC.pyx:1457"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_129setFieldSplitIS(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_fields = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFieldSplitIS (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setFieldSplitIS", 0))) return NULL; __Pyx_INCREF(__pyx_args); __pyx_v_fields = __pyx_args; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_128setFieldSplitIS(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_fields); /* function exit code */ __Pyx_DECREF(__pyx_v_fields); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_128setFieldSplitIS(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_fields) { PyObject *__pyx_v_name = 0; struct PyPetscISObject *__pyx_v_field = 0; char const *__pyx_v_cname; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); PetscErrorCode __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFieldSplitIS", 1); /* "petsc4py/PETSc/PC.pyx":1476 * * """ * cdef object name = None # <<<<<<<<<<<<<< * cdef IS field = None * cdef const char *cname = NULL */ __Pyx_INCREF(Py_None); __pyx_v_name = Py_None; /* "petsc4py/PETSc/PC.pyx":1477 * """ * cdef object name = None * cdef IS field = None # <<<<<<<<<<<<<< * cdef const char *cname = NULL * for name, field in fields: */ __Pyx_INCREF(Py_None); __pyx_v_field = ((struct PyPetscISObject *)Py_None); /* "petsc4py/PETSc/PC.pyx":1478 * cdef object name = None * cdef IS field = None * cdef const char *cname = NULL # <<<<<<<<<<<<<< * for name, field in fields: * name = str2bytes(name, &cname) */ __pyx_v_cname = NULL; /* "petsc4py/PETSc/PC.pyx":1479 * cdef IS field = None * cdef const char *cname = NULL * for name, field in fields: # <<<<<<<<<<<<<< * name = str2bytes(name, &cname) * CHKERR( PCFieldSplitSetIS(self.pc, cname, field.iset) ) */ __pyx_t_1 = __pyx_v_fields; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(48, 1479, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(48, 1479, __pyx_L1_error) #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(48, 1479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { PyObject* sequence = __pyx_t_3; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(48, 1479, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_4 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 1479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 1479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(48, 1479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); index = 0; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(48, 1479, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(48, 1479, __pyx_L1_error) __pyx_L6_unpacking_done:; } if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_8petsc4py_5PETSc_IS))))) __PYX_ERR(48, 1479, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_field, ((struct PyPetscISObject *)__pyx_t_5)); __pyx_t_5 = 0; /* "petsc4py/PETSc/PC.pyx":1480 * cdef const char *cname = NULL * for name, field in fields: * name = str2bytes(name, &cname) # <<<<<<<<<<<<<< * CHKERR( PCFieldSplitSetIS(self.pc, cname, field.iset) ) * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cname)); if (unlikely(!__pyx_t_3)) __PYX_ERR(48, 1480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/PC.pyx":1481 * for name, field in fields: * name = str2bytes(name, &cname) * CHKERR( PCFieldSplitSetIS(self.pc, cname, field.iset) ) # <<<<<<<<<<<<<< * * def setFieldSplitFields(self, bsize: int, *fields: Tuple[str, Sequence[int]]) -> None: */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCFieldSplitSetIS(__pyx_v_self->pc, __pyx_v_cname, __pyx_v_field->iset)); if (unlikely(__pyx_t_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1481, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":1479 * cdef IS field = None * cdef const char *cname = NULL * for name, field in fields: # <<<<<<<<<<<<<< * name = str2bytes(name, &cname) * CHKERR( PCFieldSplitSetIS(self.pc, cname, field.iset) ) */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/PC.pyx":1457 * CHKERR( PCFieldSplitSetType(self.pc, cval) ) * * def setFieldSplitIS(self, *fields: Tuple[str, IS]) -> None: # <<<<<<<<<<<<<< * """Set the elements for the field split by `IS`. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.PC.setFieldSplitIS", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XDECREF((PyObject *)__pyx_v_field); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":1483 * CHKERR( PCFieldSplitSetIS(self.pc, cname, field.iset) ) * * def setFieldSplitFields(self, bsize: int, *fields: Tuple[str, Sequence[int]]) -> None: # <<<<<<<<<<<<<< * """Sets the elements for the field split. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_131setFieldSplitFields(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_130setFieldSplitFields, "PC.setFieldSplitFields(self, bsize: int, *fields: Tuple[str, Sequence[int]]) -> None\nSets the elements for the field split.\n\n Parameters\n ----------\n bsize\n The block size\n fields\n A sequence of tuples containing the split name and a sequence of\n integers that define the elements in the split.\n\n See Also\n --------\n petsc.PCFieldSplitSetBlockSize, petsc.PCFieldSplitSetFields\n\n \nSource code at petsc4py/PETSc/PC.pyx:1483"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_131setFieldSplitFields(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_bsize = 0; PyObject *__pyx_v_fields = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFieldSplitFields (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); __pyx_v_fields = __Pyx_ArgsSlice_FASTCALL(__pyx_args, 1, __pyx_nargs); if (unlikely(!__pyx_v_fields)) { __Pyx_RefNannyFinishContext(); return NULL; } __Pyx_GOTREF(__pyx_v_fields); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_bsize,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { default: case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_bsize)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 1483, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; const Py_ssize_t used_pos_args = (kwd_pos_args < 1) ? kwd_pos_args : 1; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, used_pos_args, "setFieldSplitFields") < 0)) __PYX_ERR(48, 1483, __pyx_L3_error) } } else if (unlikely(__pyx_nargs < 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_bsize = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setFieldSplitFields", 0, 1, 1, __pyx_nargs); __PYX_ERR(48, 1483, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_DECREF(__pyx_v_fields); __pyx_v_fields = 0; __Pyx_AddTraceback("petsc4py.PETSc.PC.setFieldSplitFields", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_130setFieldSplitFields(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_bsize, __pyx_v_fields); /* function exit code */ __Pyx_DECREF(__pyx_v_fields); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_130setFieldSplitFields(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_bsize, PyObject *__pyx_v_fields) { PetscInt __pyx_v_bs; PyObject *__pyx_v_name = 0; PyObject *__pyx_v_field = 0; char const *__pyx_v_cname; PetscInt __pyx_v_nfields; PetscInt *__pyx_v_ifields; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *(*__pyx_t_9)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFieldSplitFields", 1); /* "petsc4py/PETSc/PC.pyx":1499 * * """ * cdef PetscInt bs = asInt(bsize) # <<<<<<<<<<<<<< * CHKERR( PCFieldSplitSetBlockSize(self.pc, bs) ) * cdef object name = None */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_bsize); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 1499, __pyx_L1_error) __pyx_v_bs = __pyx_t_1; /* "petsc4py/PETSc/PC.pyx":1500 * """ * cdef PetscInt bs = asInt(bsize) * CHKERR( PCFieldSplitSetBlockSize(self.pc, bs) ) # <<<<<<<<<<<<<< * cdef object name = None * cdef object field = None */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCFieldSplitSetBlockSize(__pyx_v_self->pc, __pyx_v_bs)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1500, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":1501 * cdef PetscInt bs = asInt(bsize) * CHKERR( PCFieldSplitSetBlockSize(self.pc, bs) ) * cdef object name = None # <<<<<<<<<<<<<< * cdef object field = None * cdef const char *cname = NULL */ __Pyx_INCREF(Py_None); __pyx_v_name = Py_None; /* "petsc4py/PETSc/PC.pyx":1502 * CHKERR( PCFieldSplitSetBlockSize(self.pc, bs) ) * cdef object name = None * cdef object field = None # <<<<<<<<<<<<<< * cdef const char *cname = NULL * cdef PetscInt nfields = 0, *ifields = NULL */ __Pyx_INCREF(Py_None); __pyx_v_field = Py_None; /* "petsc4py/PETSc/PC.pyx":1503 * cdef object name = None * cdef object field = None * cdef const char *cname = NULL # <<<<<<<<<<<<<< * cdef PetscInt nfields = 0, *ifields = NULL * for name, field in fields: */ __pyx_v_cname = NULL; /* "petsc4py/PETSc/PC.pyx":1504 * cdef object field = None * cdef const char *cname = NULL * cdef PetscInt nfields = 0, *ifields = NULL # <<<<<<<<<<<<<< * for name, field in fields: * name = str2bytes(name, &cname) */ __pyx_v_nfields = 0; __pyx_v_ifields = NULL; /* "petsc4py/PETSc/PC.pyx":1505 * cdef const char *cname = NULL * cdef PetscInt nfields = 0, *ifields = NULL * for name, field in fields: # <<<<<<<<<<<<<< * name = str2bytes(name, &cname) * field = iarray_i(field, &nfields, &ifields) */ __pyx_t_3 = __pyx_v_fields; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(48, 1505, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(48, 1505, __pyx_L1_error) #else __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 1505, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) { PyObject* sequence = __pyx_t_5; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(48, 1505, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_6 = PyList_GET_ITEM(sequence, 0); __pyx_t_7 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); #else __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(48, 1505, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(48, 1505, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { Py_ssize_t index = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(48, 1505, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); index = 0; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_7); if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(48, 1505, __pyx_L1_error) __pyx_t_9 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_9 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(48, 1505, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF_SET(__pyx_v_field, __pyx_t_7); __pyx_t_7 = 0; /* "petsc4py/PETSc/PC.pyx":1506 * cdef PetscInt nfields = 0, *ifields = NULL * for name, field in fields: * name = str2bytes(name, &cname) # <<<<<<<<<<<<<< * field = iarray_i(field, &nfields, &ifields) * CHKERR( PCFieldSplitSetFields(self.pc, cname, */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cname)); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 1506, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/PC.pyx":1507 * for name, field in fields: * name = str2bytes(name, &cname) * field = iarray_i(field, &nfields, &ifields) # <<<<<<<<<<<<<< * CHKERR( PCFieldSplitSetFields(self.pc, cname, * nfields, ifields, ifields) ) */ __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_field, (&__pyx_v_nfields), (&__pyx_v_ifields))); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 1507, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_field, __pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/PC.pyx":1508 * name = str2bytes(name, &cname) * field = iarray_i(field, &nfields, &ifields) * CHKERR( PCFieldSplitSetFields(self.pc, cname, # <<<<<<<<<<<<<< * nfields, ifields, ifields) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCFieldSplitSetFields(__pyx_v_self->pc, __pyx_v_cname, __pyx_v_nfields, __pyx_v_ifields, __pyx_v_ifields)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1508, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":1505 * cdef const char *cname = NULL * cdef PetscInt nfields = 0, *ifields = NULL * for name, field in fields: # <<<<<<<<<<<<<< * name = str2bytes(name, &cname) * field = iarray_i(field, &nfields, &ifields) */ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/PC.pyx":1483 * CHKERR( PCFieldSplitSetIS(self.pc, cname, field.iset) ) * * def setFieldSplitFields(self, bsize: int, *fields: Tuple[str, Sequence[int]]) -> None: # <<<<<<<<<<<<<< * """Sets the elements for the field split. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("petsc4py.PETSc.PC.setFieldSplitFields", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XDECREF(__pyx_v_field); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":1511 * nfields, ifields, ifields) ) * * def getFieldSplitSubKSP(self) -> list[KSP]: # <<<<<<<<<<<<<< * """Return the `KSP` for all splits. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_133getFieldSplitSubKSP(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_132getFieldSplitSubKSP, "PC.getFieldSplitSubKSP(self) -> list[KSP]\nReturn the `KSP` for all splits.\n\n See Also\n --------\n petsc.PCFieldSplitGetSubKSP\n\n \nSource code at petsc4py/PETSc/PC.pyx:1511"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_133getFieldSplitSubKSP(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getFieldSplitSubKSP (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getFieldSplitSubKSP", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getFieldSplitSubKSP", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_132getFieldSplitSubKSP(((struct PyPetscPCObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_132getFieldSplitSubKSP(struct PyPetscPCObject *__pyx_v_self) { CYTHON_UNUSED PetscInt __pyx_v_i; PetscInt __pyx_v_n; KSP *__pyx_v_p; PyObject *__pyx_v_subksp = 0; PetscInt __pyx_8genexpr9__pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscInt __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_t_6; char const *__pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getFieldSplitSubKSP", 1); /* "petsc4py/PETSc/PC.pyx":1519 * * """ * cdef PetscInt i = 0, n = 0 # <<<<<<<<<<<<<< * cdef PetscKSP *p = NULL * cdef object subksp = None */ __pyx_v_i = 0; __pyx_v_n = 0; /* "petsc4py/PETSc/PC.pyx":1520 * """ * cdef PetscInt i = 0, n = 0 * cdef PetscKSP *p = NULL # <<<<<<<<<<<<<< * cdef object subksp = None * try: */ __pyx_v_p = NULL; /* "petsc4py/PETSc/PC.pyx":1521 * cdef PetscInt i = 0, n = 0 * cdef PetscKSP *p = NULL * cdef object subksp = None # <<<<<<<<<<<<<< * try: * CHKERR( PCFieldSplitGetSubKSP(self.pc, &n, &p) ) */ __Pyx_INCREF(Py_None); __pyx_v_subksp = Py_None; /* "petsc4py/PETSc/PC.pyx":1522 * cdef PetscKSP *p = NULL * cdef object subksp = None * try: # <<<<<<<<<<<<<< * CHKERR( PCFieldSplitGetSubKSP(self.pc, &n, &p) ) * subksp = [ref_KSP(p[i]) for i from 0 <= i pc, (&__pyx_v_n), (&__pyx_v_p))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1523, __pyx_L4_error) /* "petsc4py/PETSc/PC.pyx":1524 * try: * CHKERR( PCFieldSplitGetSubKSP(self.pc, &n, &p) ) * subksp = [ref_KSP(p[i]) for i from 0 <= i = 3) __Pyx_ExceptionSwap(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10) < 0)) __Pyx_ErrFetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); __pyx_t_5 = __pyx_lineno; __pyx_t_6 = __pyx_clineno; __pyx_t_7 = __pyx_filename; { __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_p)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1526, __pyx_L9_error) } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); } __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ErrRestore(__pyx_t_8, __pyx_t_9, __pyx_t_10); __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_lineno = __pyx_t_5; __pyx_clineno = __pyx_t_6; __pyx_filename = __pyx_t_7; goto __pyx_L1_error; __pyx_L9_error:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); } __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; goto __pyx_L1_error; } __pyx_L5:; } /* "petsc4py/PETSc/PC.pyx":1527 * finally: * CHKERR( PetscFree(p) ) * return subksp # <<<<<<<<<<<<<< * * def getFieldSplitSchurGetSubKSP(self) -> list[KSP]: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_subksp); __pyx_r = __pyx_v_subksp; goto __pyx_L0; /* "petsc4py/PETSc/PC.pyx":1511 * nfields, ifields, ifields) ) * * def getFieldSplitSubKSP(self) -> list[KSP]: # <<<<<<<<<<<<<< * """Return the `KSP` for all splits. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.PC.getFieldSplitSubKSP", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_subksp); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":1529 * return subksp * * def getFieldSplitSchurGetSubKSP(self) -> list[KSP]: # <<<<<<<<<<<<<< * """Return the `KSP` for the Schur complement based splits. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_135getFieldSplitSchurGetSubKSP(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_134getFieldSplitSchurGetSubKSP, "PC.getFieldSplitSchurGetSubKSP(self) -> list[KSP]\nReturn the `KSP` for the Schur complement based splits.\n\n See Also\n --------\n petsc.PCFieldSplitSchurGetSubKSP, petsc.PCFieldSplitGetSubKSP\n\n \nSource code at petsc4py/PETSc/PC.pyx:1529"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_135getFieldSplitSchurGetSubKSP(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getFieldSplitSchurGetSubKSP (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getFieldSplitSchurGetSubKSP", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getFieldSplitSchurGetSubKSP", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_134getFieldSplitSchurGetSubKSP(((struct PyPetscPCObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_134getFieldSplitSchurGetSubKSP(struct PyPetscPCObject *__pyx_v_self) { CYTHON_UNUSED PetscInt __pyx_v_i; PetscInt __pyx_v_n; KSP *__pyx_v_p; PyObject *__pyx_v_subksp = 0; PetscInt __pyx_9genexpr10__pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscInt __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_t_6; char const *__pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getFieldSplitSchurGetSubKSP", 1); /* "petsc4py/PETSc/PC.pyx":1537 * * """ * cdef PetscInt i = 0, n = 0 # <<<<<<<<<<<<<< * cdef PetscKSP *p = NULL * cdef object subksp = None */ __pyx_v_i = 0; __pyx_v_n = 0; /* "petsc4py/PETSc/PC.pyx":1538 * """ * cdef PetscInt i = 0, n = 0 * cdef PetscKSP *p = NULL # <<<<<<<<<<<<<< * cdef object subksp = None * try: */ __pyx_v_p = NULL; /* "petsc4py/PETSc/PC.pyx":1539 * cdef PetscInt i = 0, n = 0 * cdef PetscKSP *p = NULL * cdef object subksp = None # <<<<<<<<<<<<<< * try: * CHKERR( PCFieldSplitSchurGetSubKSP(self.pc, &n, &p) ) */ __Pyx_INCREF(Py_None); __pyx_v_subksp = Py_None; /* "petsc4py/PETSc/PC.pyx":1540 * cdef PetscKSP *p = NULL * cdef object subksp = None * try: # <<<<<<<<<<<<<< * CHKERR( PCFieldSplitSchurGetSubKSP(self.pc, &n, &p) ) * subksp = [ref_KSP(p[i]) for i from 0 <= i pc, (&__pyx_v_n), (&__pyx_v_p))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1541, __pyx_L4_error) /* "petsc4py/PETSc/PC.pyx":1542 * try: * CHKERR( PCFieldSplitSchurGetSubKSP(self.pc, &n, &p) ) * subksp = [ref_KSP(p[i]) for i from 0 <= i = 3) __Pyx_ExceptionSwap(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10) < 0)) __Pyx_ErrFetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); __pyx_t_5 = __pyx_lineno; __pyx_t_6 = __pyx_clineno; __pyx_t_7 = __pyx_filename; { __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_p)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1544, __pyx_L9_error) } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); } __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ErrRestore(__pyx_t_8, __pyx_t_9, __pyx_t_10); __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_lineno = __pyx_t_5; __pyx_clineno = __pyx_t_6; __pyx_filename = __pyx_t_7; goto __pyx_L1_error; __pyx_L9_error:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); } __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; goto __pyx_L1_error; } __pyx_L5:; } /* "petsc4py/PETSc/PC.pyx":1545 * finally: * CHKERR( PetscFree(p) ) * return subksp # <<<<<<<<<<<<<< * * def setFieldSplitSchurFactType(self, ctype: FieldSplitSchurFactType) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_subksp); __pyx_r = __pyx_v_subksp; goto __pyx_L0; /* "petsc4py/PETSc/PC.pyx":1529 * return subksp * * def getFieldSplitSchurGetSubKSP(self) -> list[KSP]: # <<<<<<<<<<<<<< * """Return the `KSP` for the Schur complement based splits. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.PC.getFieldSplitSchurGetSubKSP", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_subksp); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":1547 * return subksp * * def setFieldSplitSchurFactType(self, ctype: FieldSplitSchurFactType) -> None: # <<<<<<<<<<<<<< * """Set the type of approximate block factorization. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_137setFieldSplitSchurFactType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_136setFieldSplitSchurFactType, "PC.setFieldSplitSchurFactType(self, ctype: FieldSplitSchurFactType) -> None\nSet the type of approximate block factorization.\n\n Collective.\n\n Parameters\n ----------\n ctype\n The type indicating which blocks to retain.\n\n See Also\n --------\n petsc.PCFieldSplitSetSchurFactType\n\n \nSource code at petsc4py/PETSc/PC.pyx:1547"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_137setFieldSplitSchurFactType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_ctype = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFieldSplitSchurFactType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ctype,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ctype)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 1547, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setFieldSplitSchurFactType") < 0)) __PYX_ERR(48, 1547, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_ctype = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setFieldSplitSchurFactType", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 1547, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setFieldSplitSchurFactType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_136setFieldSplitSchurFactType(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_ctype); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_136setFieldSplitSchurFactType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_ctype) { PCFieldSplitSchurFactType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PCFieldSplitSchurFactType __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFieldSplitSchurFactType", 1); /* "petsc4py/PETSc/PC.pyx":1562 * * """ * cdef PetscPCFieldSplitSchurFactType cval = ctype # <<<<<<<<<<<<<< * CHKERR( PCFieldSplitSetSchurFactType(self.pc, cval) ) * */ __pyx_t_1 = ((PCFieldSplitSchurFactType)__Pyx_PyInt_As_PCFieldSplitSchurFactType(__pyx_v_ctype)); if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 1562, __pyx_L1_error) __pyx_v_cval = __pyx_t_1; /* "petsc4py/PETSc/PC.pyx":1563 * """ * cdef PetscPCFieldSplitSchurFactType cval = ctype * CHKERR( PCFieldSplitSetSchurFactType(self.pc, cval) ) # <<<<<<<<<<<<<< * * def setFieldSplitSchurPreType( */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCFieldSplitSetSchurFactType(__pyx_v_self->pc, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1563, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":1547 * return subksp * * def setFieldSplitSchurFactType(self, ctype: FieldSplitSchurFactType) -> None: # <<<<<<<<<<<<<< * """Set the type of approximate block factorization. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setFieldSplitSchurFactType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":1565 * CHKERR( PCFieldSplitSetSchurFactType(self.pc, cval) ) * * def setFieldSplitSchurPreType( # <<<<<<<<<<<<<< * self, * ptype: FieldSplitSchurPreType, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_139setFieldSplitSchurPreType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_138setFieldSplitSchurPreType, "PC.setFieldSplitSchurPreType(self, ptype: FieldSplitSchurPreType, pre: Mat | None = None) -> None\nSet from what operator the `PC` is constructed.\n\n Collective.\n\n Parameters\n ----------\n ptype\n The type of matrix to use for preconditioning the Schur complement.\n pre\n The optional matrix to use for preconditioning.\n\n See Also\n --------\n petsc.PCFieldSplitSetSchurPre\n\n \nSource code at petsc4py/PETSc/PC.pyx:1565"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_139setFieldSplitSchurPreType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_ptype = 0; struct PyPetscMatObject *__pyx_v_pre = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFieldSplitSchurPreType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ptype,&__pyx_n_s_pre,0}; /* "petsc4py/PETSc/PC.pyx":1568 * self, * ptype: FieldSplitSchurPreType, * Mat pre=None) -> None: # <<<<<<<<<<<<<< * """Set from what operator the `PC` is constructed. * */ values[1] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscMatObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ptype)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 1565, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pre); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 1565, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setFieldSplitSchurPreType") < 0)) __PYX_ERR(48, 1565, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_ptype = values[0]; __pyx_v_pre = ((struct PyPetscMatObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setFieldSplitSchurPreType", 0, 1, 2, __pyx_nargs); __PYX_ERR(48, 1565, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setFieldSplitSchurPreType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pre), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "pre", 0))) __PYX_ERR(48, 1568, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_138setFieldSplitSchurPreType(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_ptype, __pyx_v_pre); /* "petsc4py/PETSc/PC.pyx":1565 * CHKERR( PCFieldSplitSetSchurFactType(self.pc, cval) ) * * def setFieldSplitSchurPreType( # <<<<<<<<<<<<<< * self, * ptype: FieldSplitSchurPreType, */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_138setFieldSplitSchurPreType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_ptype, struct PyPetscMatObject *__pyx_v_pre) { PCFieldSplitSchurPreType __pyx_v_pval; Mat __pyx_v_pmat; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PCFieldSplitSchurPreType __pyx_t_1; int __pyx_t_2; Mat __pyx_t_3; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFieldSplitSchurPreType", 1); /* "petsc4py/PETSc/PC.pyx":1585 * * """ * cdef PetscPCFieldSplitSchurPreType pval = ptype # <<<<<<<<<<<<<< * cdef PetscMat pmat = NULL * if pre is not None: pmat = pre.mat */ __pyx_t_1 = ((PCFieldSplitSchurPreType)__Pyx_PyInt_As_PCFieldSplitSchurPreType(__pyx_v_ptype)); if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 1585, __pyx_L1_error) __pyx_v_pval = __pyx_t_1; /* "petsc4py/PETSc/PC.pyx":1586 * """ * cdef PetscPCFieldSplitSchurPreType pval = ptype * cdef PetscMat pmat = NULL # <<<<<<<<<<<<<< * if pre is not None: pmat = pre.mat * CHKERR( PCFieldSplitSetSchurPre(self.pc, pval, pmat) ) */ __pyx_v_pmat = NULL; /* "petsc4py/PETSc/PC.pyx":1587 * cdef PetscPCFieldSplitSchurPreType pval = ptype * cdef PetscMat pmat = NULL * if pre is not None: pmat = pre.mat # <<<<<<<<<<<<<< * CHKERR( PCFieldSplitSetSchurPre(self.pc, pval, pmat) ) * */ __pyx_t_2 = (((PyObject *)__pyx_v_pre) != Py_None); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_pre->mat; __pyx_v_pmat = __pyx_t_3; } /* "petsc4py/PETSc/PC.pyx":1588 * cdef PetscMat pmat = NULL * if pre is not None: pmat = pre.mat * CHKERR( PCFieldSplitSetSchurPre(self.pc, pval, pmat) ) # <<<<<<<<<<<<<< * * # --- COMPOSITE --- */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCFieldSplitSetSchurPre(__pyx_v_self->pc, __pyx_v_pval, __pyx_v_pmat)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1588, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":1565 * CHKERR( PCFieldSplitSetSchurFactType(self.pc, cval) ) * * def setFieldSplitSchurPreType( # <<<<<<<<<<<<<< * self, * ptype: FieldSplitSchurPreType, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setFieldSplitSchurPreType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":1592 * # --- COMPOSITE --- * * def setCompositeType(self, ctype: CompositeType) -> None: # <<<<<<<<<<<<<< * """Set the type of composite preconditioner. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_141setCompositeType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_140setCompositeType, "PC.setCompositeType(self, ctype: CompositeType) -> None\nSet the type of composite preconditioner.\n\n Logically collective.\n\n Parameters\n ----------\n ctype\n The type of composition.\n\n See Also\n --------\n petsc.PCCompositeSetType\n\n \nSource code at petsc4py/PETSc/PC.pyx:1592"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_141setCompositeType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_ctype = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setCompositeType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ctype,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ctype)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 1592, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setCompositeType") < 0)) __PYX_ERR(48, 1592, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_ctype = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setCompositeType", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 1592, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setCompositeType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_140setCompositeType(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_ctype); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_140setCompositeType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_ctype) { PCCompositeType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PCCompositeType __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setCompositeType", 1); /* "petsc4py/PETSc/PC.pyx":1607 * * """ * cdef PetscPCCompositeType cval = ctype # <<<<<<<<<<<<<< * CHKERR( PCCompositeSetType(self.pc, cval) ) * */ __pyx_t_1 = ((PCCompositeType)__Pyx_PyInt_As_PCCompositeType(__pyx_v_ctype)); if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 1607, __pyx_L1_error) __pyx_v_cval = __pyx_t_1; /* "petsc4py/PETSc/PC.pyx":1608 * """ * cdef PetscPCCompositeType cval = ctype * CHKERR( PCCompositeSetType(self.pc, cval) ) # <<<<<<<<<<<<<< * * def getCompositePC(self, n: int) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCCompositeSetType(__pyx_v_self->pc, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1608, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":1592 * # --- COMPOSITE --- * * def setCompositeType(self, ctype: CompositeType) -> None: # <<<<<<<<<<<<<< * """Set the type of composite preconditioner. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setCompositeType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":1610 * CHKERR( PCCompositeSetType(self.pc, cval) ) * * def getCompositePC(self, n: int) -> None: # <<<<<<<<<<<<<< * """Return a component of the composite `PC`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_143getCompositePC(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_142getCompositePC, "PC.getCompositePC(self, n: int) -> None\nReturn a component of the composite `PC`.\n\n Not collective.\n\n Parameters\n ----------\n n\n The index of the `PC` in the composition.\n\n See Also\n --------\n petsc.PCCompositeGetPC\n\n \nSource code at petsc4py/PETSc/PC.pyx:1610"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_143getCompositePC(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_n = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getCompositePC (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 1610, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getCompositePC") < 0)) __PYX_ERR(48, 1610, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_n = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getCompositePC", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 1610, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.getCompositePC", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_142getCompositePC(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_n); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_142getCompositePC(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_n) { struct PyPetscPCObject *__pyx_v_pc = 0; PyObject *__pyx_v_cn = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscInt __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getCompositePC", 1); /* "petsc4py/PETSc/PC.pyx":1625 * * """ * cdef PC pc = PC() # <<<<<<<<<<<<<< * cdef cn = asInt(n) * CHKERR( PCCompositeGetPC(self.pc, cn, &pc.pc) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_PC)); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 1625, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_pc = ((struct PyPetscPCObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/PC.pyx":1626 * """ * cdef PC pc = PC() * cdef cn = asInt(n) # <<<<<<<<<<<<<< * CHKERR( PCCompositeGetPC(self.pc, cn, &pc.pc) ) * CHKERR( PetscINCREF(pc.obj) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_n); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 1626, __pyx_L1_error) __pyx_t_1 = __Pyx_PyInt_From_PetscInt(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 1626, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_cn = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/PC.pyx":1627 * cdef PC pc = PC() * cdef cn = asInt(n) * CHKERR( PCCompositeGetPC(self.pc, cn, &pc.pc) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(pc.obj) ) * return pc */ __pyx_t_2 = __Pyx_PyInt_As_PetscInt(__pyx_v_cn); if (unlikely((__pyx_t_2 == ((PetscInt)-1)) && PyErr_Occurred())) __PYX_ERR(48, 1627, __pyx_L1_error) __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCCompositeGetPC(__pyx_v_self->pc, __pyx_t_2, (&__pyx_v_pc->pc))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1627, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":1628 * cdef cn = asInt(n) * CHKERR( PCCompositeGetPC(self.pc, cn, &pc.pc) ) * CHKERR( PetscINCREF(pc.obj) ) # <<<<<<<<<<<<<< * return pc * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_pc->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1628, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":1629 * CHKERR( PCCompositeGetPC(self.pc, cn, &pc.pc) ) * CHKERR( PetscINCREF(pc.obj) ) * return pc # <<<<<<<<<<<<<< * * def addCompositePCType(self, pc_type: Type | str) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_pc); __pyx_r = ((PyObject *)__pyx_v_pc); goto __pyx_L0; /* "petsc4py/PETSc/PC.pyx":1610 * CHKERR( PCCompositeSetType(self.pc, cval) ) * * def getCompositePC(self, n: int) -> None: # <<<<<<<<<<<<<< * """Return a component of the composite `PC`. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PC.getCompositePC", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_pc); __Pyx_XDECREF(__pyx_v_cn); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":1631 * return pc * * def addCompositePCType(self, pc_type: Type | str) -> None: # <<<<<<<<<<<<<< * """Add a `PC` of the given type to the composite `PC`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_145addCompositePCType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_144addCompositePCType, "PC.addCompositePCType(self, pc_type: Type | str) -> None\nAdd a `PC` of the given type to the composite `PC`.\n\n Collective.\n\n Parameters\n ----------\n pc_type\n The type of the preconditioner to add.\n\n See Also\n --------\n petsc.PCCompositeAddPCType\n\n \nSource code at petsc4py/PETSc/PC.pyx:1631"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_145addCompositePCType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_pc_type = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("addCompositePCType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pc_type,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pc_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 1631, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "addCompositePCType") < 0)) __PYX_ERR(48, 1631, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_pc_type = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("addCompositePCType", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 1631, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.addCompositePCType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_144addCompositePCType(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_pc_type); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_144addCompositePCType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_pc_type) { PCType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("addCompositePCType", 0); __Pyx_INCREF(__pyx_v_pc_type); /* "petsc4py/PETSc/PC.pyx":1646 * * """ * cdef PetscPCType cval = NULL # <<<<<<<<<<<<<< * pc_type = str2bytes(pc_type, &cval) * CHKERR( PCCompositeAddPCType(self.pc, cval) ) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/PC.pyx":1647 * """ * cdef PetscPCType cval = NULL * pc_type = str2bytes(pc_type, &cval) # <<<<<<<<<<<<<< * CHKERR( PCCompositeAddPCType(self.pc, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_pc_type, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 1647, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_pc_type, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/PC.pyx":1648 * cdef PetscPCType cval = NULL * pc_type = str2bytes(pc_type, &cval) * CHKERR( PCCompositeAddPCType(self.pc, cval) ) # <<<<<<<<<<<<<< * * # --- KSP --- */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCCompositeAddPCType(__pyx_v_self->pc, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1648, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":1631 * return pc * * def addCompositePCType(self, pc_type: Type | str) -> None: # <<<<<<<<<<<<<< * """Add a `PC` of the given type to the composite `PC`. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PC.addCompositePCType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_pc_type); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":1652 * # --- KSP --- * * def getKSP(self): # <<<<<<<<<<<<<< * """Return the `KSP` if the `PC` is `Type.KSP`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_147getKSP(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_146getKSP, "PC.getKSP(self)\nReturn the `KSP` if the `PC` is `Type.KSP`.\n\n Not collective.\n\n See Also\n --------\n petsc.PCKSPGetKSP\n\n \nSource code at petsc4py/PETSc/PC.pyx:1652"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_147getKSP(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getKSP (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getKSP", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getKSP", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_146getKSP(((struct PyPetscPCObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_146getKSP(struct PyPetscPCObject *__pyx_v_self) { struct PyPetscKSPObject *__pyx_v_ksp = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getKSP", 1); /* "petsc4py/PETSc/PC.pyx":1662 * * """ * cdef KSP ksp = KSP() # <<<<<<<<<<<<<< * CHKERR( PCKSPGetKSP(self.pc, &ksp.ksp) ) * CHKERR( PetscINCREF(ksp.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_KSP)); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 1662, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ksp = ((struct PyPetscKSPObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/PC.pyx":1663 * """ * cdef KSP ksp = KSP() * CHKERR( PCKSPGetKSP(self.pc, &ksp.ksp) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(ksp.obj) ) * return ksp */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCKSPGetKSP(__pyx_v_self->pc, (&__pyx_v_ksp->ksp))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1663, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":1664 * cdef KSP ksp = KSP() * CHKERR( PCKSPGetKSP(self.pc, &ksp.ksp) ) * CHKERR( PetscINCREF(ksp.obj) ) # <<<<<<<<<<<<<< * return ksp * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ksp->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1664, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":1665 * CHKERR( PCKSPGetKSP(self.pc, &ksp.ksp) ) * CHKERR( PetscINCREF(ksp.obj) ) * return ksp # <<<<<<<<<<<<<< * * # --- MG --- */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_ksp); __pyx_r = ((PyObject *)__pyx_v_ksp); goto __pyx_L0; /* "petsc4py/PETSc/PC.pyx":1652 * # --- KSP --- * * def getKSP(self): # <<<<<<<<<<<<<< * """Return the `KSP` if the `PC` is `Type.KSP`. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PC.getKSP", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ksp); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":1669 * # --- MG --- * * def getMGType(self) -> MGType: # <<<<<<<<<<<<<< * """Return the form of multigrid. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_149getMGType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_148getMGType, "PC.getMGType(self) -> MGType\nReturn the form of multigrid.\n\n Logically collective.\n\n See Also\n --------\n petsc.PCMGGetType\n\n \nSource code at petsc4py/PETSc/PC.pyx:1669"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_149getMGType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getMGType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getMGType", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getMGType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_148getMGType(((struct PyPetscPCObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_148getMGType(struct PyPetscPCObject *__pyx_v_self) { PCMGType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getMGType", 1); /* "petsc4py/PETSc/PC.pyx":1679 * * """ * cdef PetscPCMGType cval = PC_MG_ADDITIVE # <<<<<<<<<<<<<< * CHKERR( PCMGGetType(self.pc, &cval) ) * return cval */ __pyx_v_cval = PC_MG_ADDITIVE; /* "petsc4py/PETSc/PC.pyx":1680 * """ * cdef PetscPCMGType cval = PC_MG_ADDITIVE * CHKERR( PCMGGetType(self.pc, &cval) ) # <<<<<<<<<<<<<< * return cval * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCMGGetType(__pyx_v_self->pc, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1680, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":1681 * cdef PetscPCMGType cval = PC_MG_ADDITIVE * CHKERR( PCMGGetType(self.pc, &cval) ) * return cval # <<<<<<<<<<<<<< * * def setMGType(self, mgtype: MGType): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_PCMGType(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 1681, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/PC.pyx":1669 * # --- MG --- * * def getMGType(self) -> MGType: # <<<<<<<<<<<<<< * """Return the form of multigrid. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.PC.getMGType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":1683 * return cval * * def setMGType(self, mgtype: MGType): # <<<<<<<<<<<<<< * """Set the form of multigrid. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_151setMGType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_150setMGType, "PC.setMGType(self, mgtype: MGType)\nSet the form of multigrid.\n\n Logically collective.\n\n See Also\n --------\n petsc.PCMGSetType\n\n \nSource code at petsc4py/PETSc/PC.pyx:1683"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_151setMGType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_mgtype = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setMGType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mgtype,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mgtype)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 1683, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setMGType") < 0)) __PYX_ERR(48, 1683, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_mgtype = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setMGType", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 1683, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setMGType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_150setMGType(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_mgtype); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_150setMGType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_mgtype) { PCMGType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PCMGType __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setMGType", 1); /* "petsc4py/PETSc/PC.pyx":1693 * * """ * cdef PetscPCMGType cval = mgtype # <<<<<<<<<<<<<< * CHKERR( PCMGSetType(self.pc, cval) ) * */ __pyx_t_1 = ((PCMGType)__Pyx_PyInt_As_PCMGType(__pyx_v_mgtype)); if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 1693, __pyx_L1_error) __pyx_v_cval = __pyx_t_1; /* "petsc4py/PETSc/PC.pyx":1694 * """ * cdef PetscPCMGType cval = mgtype * CHKERR( PCMGSetType(self.pc, cval) ) # <<<<<<<<<<<<<< * * def getMGLevels(self) -> int: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCMGSetType(__pyx_v_self->pc, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1694, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":1683 * return cval * * def setMGType(self, mgtype: MGType): # <<<<<<<<<<<<<< * """Set the form of multigrid. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setMGType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":1696 * CHKERR( PCMGSetType(self.pc, cval) ) * * def getMGLevels(self) -> int: # <<<<<<<<<<<<<< * """Return the number of `MG` levels. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_153getMGLevels(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_152getMGLevels, "PC.getMGLevels(self) -> int\nReturn the number of `MG` levels.\n\n Not collective.\n\n See Also\n --------\n petsc.PCMGGetLevels\n\n \nSource code at petsc4py/PETSc/PC.pyx:1696"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_153getMGLevels(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getMGLevels (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getMGLevels", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getMGLevels", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_152getMGLevels(((struct PyPetscPCObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_152getMGLevels(struct PyPetscPCObject *__pyx_v_self) { PetscInt __pyx_v_levels; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getMGLevels", 1); /* "petsc4py/PETSc/PC.pyx":1706 * * """ * cdef PetscInt levels = 0 # <<<<<<<<<<<<<< * CHKERR( PCMGGetLevels(self.pc, &levels) ) * return toInt(levels) */ __pyx_v_levels = 0; /* "petsc4py/PETSc/PC.pyx":1707 * """ * cdef PetscInt levels = 0 * CHKERR( PCMGGetLevels(self.pc, &levels) ) # <<<<<<<<<<<<<< * return toInt(levels) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCMGGetLevels(__pyx_v_self->pc, (&__pyx_v_levels))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1707, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":1708 * cdef PetscInt levels = 0 * CHKERR( PCMGGetLevels(self.pc, &levels) ) * return toInt(levels) # <<<<<<<<<<<<<< * * def setMGLevels(self, levels: int) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_levels); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 1708, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/PC.pyx":1696 * CHKERR( PCMGSetType(self.pc, cval) ) * * def getMGLevels(self) -> int: # <<<<<<<<<<<<<< * """Return the number of `MG` levels. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.PC.getMGLevels", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":1710 * return toInt(levels) * * def setMGLevels(self, levels: int) -> None: # <<<<<<<<<<<<<< * """Set the number of `MG` levels. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_155setMGLevels(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_154setMGLevels, "PC.setMGLevels(self, levels: int) -> None\nSet the number of `MG` levels.\n\n Parameters\n ----------\n levels\n The number of levels\n\n See Also\n --------\n petsc.PCMGSetLevels\n\n \nSource code at petsc4py/PETSc/PC.pyx:1710"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_155setMGLevels(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_levels = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setMGLevels (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_levels,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_levels)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 1710, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setMGLevels") < 0)) __PYX_ERR(48, 1710, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_levels = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setMGLevels", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 1710, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setMGLevels", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_154setMGLevels(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_levels); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_154setMGLevels(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_levels) { PetscInt __pyx_v_clevels; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setMGLevels", 1); /* "petsc4py/PETSc/PC.pyx":1723 * * """ * cdef PetscInt clevels = asInt(levels) # <<<<<<<<<<<<<< * CHKERR( PCMGSetLevels(self.pc, clevels, NULL) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_levels); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 1723, __pyx_L1_error) __pyx_v_clevels = __pyx_t_1; /* "petsc4py/PETSc/PC.pyx":1724 * """ * cdef PetscInt clevels = asInt(levels) * CHKERR( PCMGSetLevels(self.pc, clevels, NULL) ) # <<<<<<<<<<<<<< * * def getMGCoarseSolve(self) -> KSP: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCMGSetLevels(__pyx_v_self->pc, __pyx_v_clevels, NULL)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1724, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":1710 * return toInt(levels) * * def setMGLevels(self, levels: int) -> None: # <<<<<<<<<<<<<< * """Set the number of `MG` levels. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setMGLevels", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":1726 * CHKERR( PCMGSetLevels(self.pc, clevels, NULL) ) * * def getMGCoarseSolve(self) -> KSP: # <<<<<<<<<<<<<< * """Return the `KSP` used on the coarse grid. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_157getMGCoarseSolve(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_156getMGCoarseSolve, "PC.getMGCoarseSolve(self) -> KSP\nReturn the `KSP` used on the coarse grid.\n\n Not collective.\n\n See Also\n --------\n petsc.PCMGGetCoarseSolve\n\n \nSource code at petsc4py/PETSc/PC.pyx:1726"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_157getMGCoarseSolve(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getMGCoarseSolve (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getMGCoarseSolve", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getMGCoarseSolve", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_156getMGCoarseSolve(((struct PyPetscPCObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_156getMGCoarseSolve(struct PyPetscPCObject *__pyx_v_self) { struct PyPetscKSPObject *__pyx_v_ksp = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getMGCoarseSolve", 1); /* "petsc4py/PETSc/PC.pyx":1736 * * """ * cdef KSP ksp = KSP() # <<<<<<<<<<<<<< * CHKERR( PCMGGetCoarseSolve(self.pc, &ksp.ksp) ) * CHKERR( PetscINCREF(ksp.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_KSP)); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 1736, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ksp = ((struct PyPetscKSPObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/PC.pyx":1737 * """ * cdef KSP ksp = KSP() * CHKERR( PCMGGetCoarseSolve(self.pc, &ksp.ksp) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(ksp.obj) ) * return ksp */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCMGGetCoarseSolve(__pyx_v_self->pc, (&__pyx_v_ksp->ksp))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1737, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":1738 * cdef KSP ksp = KSP() * CHKERR( PCMGGetCoarseSolve(self.pc, &ksp.ksp) ) * CHKERR( PetscINCREF(ksp.obj) ) # <<<<<<<<<<<<<< * return ksp * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ksp->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1738, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":1739 * CHKERR( PCMGGetCoarseSolve(self.pc, &ksp.ksp) ) * CHKERR( PetscINCREF(ksp.obj) ) * return ksp # <<<<<<<<<<<<<< * * def setMGInterpolation(self, level, Mat mat) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_ksp); __pyx_r = ((PyObject *)__pyx_v_ksp); goto __pyx_L0; /* "petsc4py/PETSc/PC.pyx":1726 * CHKERR( PCMGSetLevels(self.pc, clevels, NULL) ) * * def getMGCoarseSolve(self) -> KSP: # <<<<<<<<<<<<<< * """Return the `KSP` used on the coarse grid. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PC.getMGCoarseSolve", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ksp); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":1741 * return ksp * * def setMGInterpolation(self, level, Mat mat) -> None: # <<<<<<<<<<<<<< * """Set the interpolation operator for the given level. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_159setMGInterpolation(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_158setMGInterpolation, "PC.setMGInterpolation(self, level, mat: Mat) -> None\nSet the interpolation operator for the given level.\n\n Logically collective.\n\n Parameters\n ----------\n level\n The level where interpolation is defined from ``level-1`` to ``level``.\n mat\n The interpolation operator\n\n See Also\n --------\n petsc.PCMGSetInterpolation\n\n \nSource code at petsc4py/PETSc/PC.pyx:1741"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_159setMGInterpolation(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_level = 0; struct PyPetscMatObject *__pyx_v_mat = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setMGInterpolation (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,&__pyx_n_s_mat,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_level)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 1741, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mat)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 1741, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setMGInterpolation", 1, 2, 2, 1); __PYX_ERR(48, 1741, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setMGInterpolation") < 0)) __PYX_ERR(48, 1741, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_level = values[0]; __pyx_v_mat = ((struct PyPetscMatObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setMGInterpolation", 1, 2, 2, __pyx_nargs); __PYX_ERR(48, 1741, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setMGInterpolation", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(48, 1741, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_158setMGInterpolation(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_level, __pyx_v_mat); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_158setMGInterpolation(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level, struct PyPetscMatObject *__pyx_v_mat) { PetscInt __pyx_v_clevel; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setMGInterpolation", 1); /* "petsc4py/PETSc/PC.pyx":1758 * * """ * cdef PetscInt clevel = asInt(level) # <<<<<<<<<<<<<< * CHKERR( PCMGSetInterpolation(self.pc, clevel, mat.mat) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_level); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 1758, __pyx_L1_error) __pyx_v_clevel = __pyx_t_1; /* "petsc4py/PETSc/PC.pyx":1759 * """ * cdef PetscInt clevel = asInt(level) * CHKERR( PCMGSetInterpolation(self.pc, clevel, mat.mat) ) # <<<<<<<<<<<<<< * * def getMGInterpolation(self, level: int) -> Mat: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCMGSetInterpolation(__pyx_v_self->pc, __pyx_v_clevel, __pyx_v_mat->mat)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1759, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":1741 * return ksp * * def setMGInterpolation(self, level, Mat mat) -> None: # <<<<<<<<<<<<<< * """Set the interpolation operator for the given level. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setMGInterpolation", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":1761 * CHKERR( PCMGSetInterpolation(self.pc, clevel, mat.mat) ) * * def getMGInterpolation(self, level: int) -> Mat: # <<<<<<<<<<<<<< * """Return the interpolation operator for the given level. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_161getMGInterpolation(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_160getMGInterpolation, "PC.getMGInterpolation(self, level: int) -> Mat\nReturn the interpolation operator for the given level.\n\n Logically collective.\n\n Parameters\n ----------\n level\n The level where interpolation is defined from ``level-1`` to ``level``.\n\n See Also\n --------\n petsc.PCMGGetInterpolation\n\n \nSource code at petsc4py/PETSc/PC.pyx:1761"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_161getMGInterpolation(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_level = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getMGInterpolation (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_level)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 1761, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getMGInterpolation") < 0)) __PYX_ERR(48, 1761, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_level = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getMGInterpolation", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 1761, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.getMGInterpolation", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_160getMGInterpolation(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_level); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_160getMGInterpolation(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level) { PetscInt __pyx_v_clevel; struct PyPetscMatObject *__pyx_v_interpolation = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getMGInterpolation", 1); /* "petsc4py/PETSc/PC.pyx":1776 * * """ * cdef PetscInt clevel = asInt(level) # <<<<<<<<<<<<<< * cdef Mat interpolation = Mat() * CHKERR( PCMGGetInterpolation(self.pc, clevel, &interpolation.mat) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_level); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 1776, __pyx_L1_error) __pyx_v_clevel = __pyx_t_1; /* "petsc4py/PETSc/PC.pyx":1777 * """ * cdef PetscInt clevel = asInt(level) * cdef Mat interpolation = Mat() # <<<<<<<<<<<<<< * CHKERR( PCMGGetInterpolation(self.pc, clevel, &interpolation.mat) ) * CHKERR( PetscINCREF(interpolation.obj) ) */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 1777, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_interpolation = ((struct PyPetscMatObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/PC.pyx":1778 * cdef PetscInt clevel = asInt(level) * cdef Mat interpolation = Mat() * CHKERR( PCMGGetInterpolation(self.pc, clevel, &interpolation.mat) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(interpolation.obj) ) * return interpolation */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCMGGetInterpolation(__pyx_v_self->pc, __pyx_v_clevel, (&__pyx_v_interpolation->mat))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1778, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":1779 * cdef Mat interpolation = Mat() * CHKERR( PCMGGetInterpolation(self.pc, clevel, &interpolation.mat) ) * CHKERR( PetscINCREF(interpolation.obj) ) # <<<<<<<<<<<<<< * return interpolation * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_interpolation->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1779, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":1780 * CHKERR( PCMGGetInterpolation(self.pc, clevel, &interpolation.mat) ) * CHKERR( PetscINCREF(interpolation.obj) ) * return interpolation # <<<<<<<<<<<<<< * * def setMGRestriction(self, level: int, Mat mat) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_interpolation); __pyx_r = ((PyObject *)__pyx_v_interpolation); goto __pyx_L0; /* "petsc4py/PETSc/PC.pyx":1761 * CHKERR( PCMGSetInterpolation(self.pc, clevel, mat.mat) ) * * def getMGInterpolation(self, level: int) -> Mat: # <<<<<<<<<<<<<< * """Return the interpolation operator for the given level. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.PC.getMGInterpolation", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_interpolation); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":1782 * return interpolation * * def setMGRestriction(self, level: int, Mat mat) -> None: # <<<<<<<<<<<<<< * """Set the restriction operator for the given level. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_163setMGRestriction(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_162setMGRestriction, "PC.setMGRestriction(self, level: int, mat: Mat) -> None\nSet the restriction operator for the given level.\n\n Logically collective.\n\n Parameters\n ----------\n level\n The level where restriction is defined from ``level`` to ``level-1``.\n mat\n The restriction operator\n\n See Also\n --------\n petsc.PCMGSetRestriction\n\n \nSource code at petsc4py/PETSc/PC.pyx:1782"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_163setMGRestriction(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_level = 0; struct PyPetscMatObject *__pyx_v_mat = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setMGRestriction (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,&__pyx_n_s_mat,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_level)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 1782, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mat)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 1782, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setMGRestriction", 1, 2, 2, 1); __PYX_ERR(48, 1782, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setMGRestriction") < 0)) __PYX_ERR(48, 1782, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_level = values[0]; __pyx_v_mat = ((struct PyPetscMatObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setMGRestriction", 1, 2, 2, __pyx_nargs); __PYX_ERR(48, 1782, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setMGRestriction", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(48, 1782, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_162setMGRestriction(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_level, __pyx_v_mat); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_162setMGRestriction(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level, struct PyPetscMatObject *__pyx_v_mat) { PetscInt __pyx_v_clevel; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setMGRestriction", 1); /* "petsc4py/PETSc/PC.pyx":1799 * * """ * cdef PetscInt clevel = asInt(level) # <<<<<<<<<<<<<< * CHKERR( PCMGSetRestriction(self.pc, clevel, mat.mat) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_level); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 1799, __pyx_L1_error) __pyx_v_clevel = __pyx_t_1; /* "petsc4py/PETSc/PC.pyx":1800 * """ * cdef PetscInt clevel = asInt(level) * CHKERR( PCMGSetRestriction(self.pc, clevel, mat.mat) ) # <<<<<<<<<<<<<< * * def getMGRestriction(self, level: int) -> Mat: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCMGSetRestriction(__pyx_v_self->pc, __pyx_v_clevel, __pyx_v_mat->mat)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1800, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":1782 * return interpolation * * def setMGRestriction(self, level: int, Mat mat) -> None: # <<<<<<<<<<<<<< * """Set the restriction operator for the given level. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setMGRestriction", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":1802 * CHKERR( PCMGSetRestriction(self.pc, clevel, mat.mat) ) * * def getMGRestriction(self, level: int) -> Mat: # <<<<<<<<<<<<<< * """Return the restriction operator for the given level. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_165getMGRestriction(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_164getMGRestriction, "PC.getMGRestriction(self, level: int) -> Mat\nReturn the restriction operator for the given level.\n\n Logically collective.\n\n Parameters\n ----------\n level\n The level where restriction is defined from ``level`` to ``level-1``.\n\n See Also\n --------\n petsc.PCMGGetRestriction\n\n \nSource code at petsc4py/PETSc/PC.pyx:1802"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_165getMGRestriction(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_level = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getMGRestriction (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_level)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 1802, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getMGRestriction") < 0)) __PYX_ERR(48, 1802, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_level = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getMGRestriction", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 1802, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.getMGRestriction", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_164getMGRestriction(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_level); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_164getMGRestriction(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level) { PetscInt __pyx_v_clevel; struct PyPetscMatObject *__pyx_v_restriction = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getMGRestriction", 1); /* "petsc4py/PETSc/PC.pyx":1817 * * """ * cdef PetscInt clevel = asInt(level) # <<<<<<<<<<<<<< * cdef Mat restriction = Mat() * CHKERR( PCMGGetRestriction(self.pc, clevel, &restriction.mat) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_level); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 1817, __pyx_L1_error) __pyx_v_clevel = __pyx_t_1; /* "petsc4py/PETSc/PC.pyx":1818 * """ * cdef PetscInt clevel = asInt(level) * cdef Mat restriction = Mat() # <<<<<<<<<<<<<< * CHKERR( PCMGGetRestriction(self.pc, clevel, &restriction.mat) ) * CHKERR( PetscINCREF(restriction.obj) ) */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 1818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_restriction = ((struct PyPetscMatObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/PC.pyx":1819 * cdef PetscInt clevel = asInt(level) * cdef Mat restriction = Mat() * CHKERR( PCMGGetRestriction(self.pc, clevel, &restriction.mat) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(restriction.obj) ) * return restriction */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCMGGetRestriction(__pyx_v_self->pc, __pyx_v_clevel, (&__pyx_v_restriction->mat))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1819, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":1820 * cdef Mat restriction = Mat() * CHKERR( PCMGGetRestriction(self.pc, clevel, &restriction.mat) ) * CHKERR( PetscINCREF(restriction.obj) ) # <<<<<<<<<<<<<< * return restriction * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_restriction->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1820, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":1821 * CHKERR( PCMGGetRestriction(self.pc, clevel, &restriction.mat) ) * CHKERR( PetscINCREF(restriction.obj) ) * return restriction # <<<<<<<<<<<<<< * * def setMGRScale(self, level: int, Vec rscale) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_restriction); __pyx_r = ((PyObject *)__pyx_v_restriction); goto __pyx_L0; /* "petsc4py/PETSc/PC.pyx":1802 * CHKERR( PCMGSetRestriction(self.pc, clevel, mat.mat) ) * * def getMGRestriction(self, level: int) -> Mat: # <<<<<<<<<<<<<< * """Return the restriction operator for the given level. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.PC.getMGRestriction", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_restriction); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":1823 * return restriction * * def setMGRScale(self, level: int, Vec rscale) -> None: # <<<<<<<<<<<<<< * """Set the pointwise scaling for the restriction operator on the given level. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_167setMGRScale(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_166setMGRScale, "PC.setMGRScale(self, level: int, rscale: Vec) -> None\nSet the pointwise scaling for the restriction operator on the given level.\n\n Logically collective.\n\n Parameters\n ----------\n level\n The level where restriction is defined from ``level`` to ``level-1``.\n rscale\n The scaling vector.\n\n See Also\n --------\n petsc.PCMGSetRScale\n\n \nSource code at petsc4py/PETSc/PC.pyx:1823"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_167setMGRScale(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_level = 0; struct PyPetscVecObject *__pyx_v_rscale = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setMGRScale (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,&__pyx_n_s_rscale,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_level)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 1823, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rscale)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 1823, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setMGRScale", 1, 2, 2, 1); __PYX_ERR(48, 1823, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setMGRScale") < 0)) __PYX_ERR(48, 1823, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_level = values[0]; __pyx_v_rscale = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setMGRScale", 1, 2, 2, __pyx_nargs); __PYX_ERR(48, 1823, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setMGRScale", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rscale), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "rscale", 0))) __PYX_ERR(48, 1823, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_166setMGRScale(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_level, __pyx_v_rscale); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_166setMGRScale(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level, struct PyPetscVecObject *__pyx_v_rscale) { PetscInt __pyx_v_clevel; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setMGRScale", 1); /* "petsc4py/PETSc/PC.pyx":1840 * * """ * cdef PetscInt clevel = asInt(level) # <<<<<<<<<<<<<< * CHKERR( PCMGSetRScale(self.pc, clevel, rscale.vec) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_level); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 1840, __pyx_L1_error) __pyx_v_clevel = __pyx_t_1; /* "petsc4py/PETSc/PC.pyx":1841 * """ * cdef PetscInt clevel = asInt(level) * CHKERR( PCMGSetRScale(self.pc, clevel, rscale.vec) ) # <<<<<<<<<<<<<< * * def getMGRScale(self, level: int) -> Vec: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCMGSetRScale(__pyx_v_self->pc, __pyx_v_clevel, __pyx_v_rscale->vec)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1841, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":1823 * return restriction * * def setMGRScale(self, level: int, Vec rscale) -> None: # <<<<<<<<<<<<<< * """Set the pointwise scaling for the restriction operator on the given level. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setMGRScale", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":1843 * CHKERR( PCMGSetRScale(self.pc, clevel, rscale.vec) ) * * def getMGRScale(self, level: int) -> Vec: # <<<<<<<<<<<<<< * """Return the pointwise scaling for the restriction operator on the given level. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_169getMGRScale(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_168getMGRScale, "PC.getMGRScale(self, level: int) -> Vec\nReturn the pointwise scaling for the restriction operator on the given level.\n\n Logically collective.\n\n Parameters\n ----------\n level\n The level where restriction is defined from ``level`` to ``level-1``.\n\n See Also\n --------\n petsc.PCMGGetRScale\n\n \nSource code at petsc4py/PETSc/PC.pyx:1843"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_169getMGRScale(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_level = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getMGRScale (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_level)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 1843, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getMGRScale") < 0)) __PYX_ERR(48, 1843, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_level = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getMGRScale", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 1843, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.getMGRScale", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_168getMGRScale(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_level); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_168getMGRScale(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level) { PetscInt __pyx_v_clevel; struct PyPetscVecObject *__pyx_v_rscale = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getMGRScale", 1); /* "petsc4py/PETSc/PC.pyx":1858 * * """ * cdef PetscInt clevel = asInt(level) # <<<<<<<<<<<<<< * cdef Vec rscale = Vec() * CHKERR( PCMGGetRScale(self.pc, clevel, &rscale.vec) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_level); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 1858, __pyx_L1_error) __pyx_v_clevel = __pyx_t_1; /* "petsc4py/PETSc/PC.pyx":1859 * """ * cdef PetscInt clevel = asInt(level) * cdef Vec rscale = Vec() # <<<<<<<<<<<<<< * CHKERR( PCMGGetRScale(self.pc, clevel, &rscale.vec) ) * CHKERR( PetscINCREF(rscale.obj) ) */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 1859, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_rscale = ((struct PyPetscVecObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/PC.pyx":1860 * cdef PetscInt clevel = asInt(level) * cdef Vec rscale = Vec() * CHKERR( PCMGGetRScale(self.pc, clevel, &rscale.vec) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(rscale.obj) ) * return rscale */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCMGGetRScale(__pyx_v_self->pc, __pyx_v_clevel, (&__pyx_v_rscale->vec))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1860, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":1861 * cdef Vec rscale = Vec() * CHKERR( PCMGGetRScale(self.pc, clevel, &rscale.vec) ) * CHKERR( PetscINCREF(rscale.obj) ) # <<<<<<<<<<<<<< * return rscale * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_rscale->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1861, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":1862 * CHKERR( PCMGGetRScale(self.pc, clevel, &rscale.vec) ) * CHKERR( PetscINCREF(rscale.obj) ) * return rscale # <<<<<<<<<<<<<< * * def getMGSmoother(self, level: int) -> KSP: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_rscale); __pyx_r = ((PyObject *)__pyx_v_rscale); goto __pyx_L0; /* "petsc4py/PETSc/PC.pyx":1843 * CHKERR( PCMGSetRScale(self.pc, clevel, rscale.vec) ) * * def getMGRScale(self, level: int) -> Vec: # <<<<<<<<<<<<<< * """Return the pointwise scaling for the restriction operator on the given level. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.PC.getMGRScale", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_rscale); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":1864 * return rscale * * def getMGSmoother(self, level: int) -> KSP: # <<<<<<<<<<<<<< * """Return the `KSP` to be used as a smoother. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_171getMGSmoother(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_170getMGSmoother, "PC.getMGSmoother(self, level: int) -> KSP\nReturn the `KSP` to be used as a smoother.\n\n Not collective.\n\n Parameters\n ----------\n level\n The level of the smoother.\n\n See Also\n --------\n getMGSmootherDown, getMGSmootherUp, petsc.PCMGGetSmoother\n\n \nSource code at petsc4py/PETSc/PC.pyx:1864"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_171getMGSmoother(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_level = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getMGSmoother (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_level)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 1864, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getMGSmoother") < 0)) __PYX_ERR(48, 1864, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_level = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getMGSmoother", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 1864, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.getMGSmoother", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_170getMGSmoother(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_level); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_170getMGSmoother(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level) { PetscInt __pyx_v_clevel; struct PyPetscKSPObject *__pyx_v_ksp = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getMGSmoother", 1); /* "petsc4py/PETSc/PC.pyx":1879 * * """ * cdef PetscInt clevel = asInt(level) # <<<<<<<<<<<<<< * cdef KSP ksp = KSP() * CHKERR( PCMGGetSmoother(self.pc, clevel, &ksp.ksp) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_level); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 1879, __pyx_L1_error) __pyx_v_clevel = __pyx_t_1; /* "petsc4py/PETSc/PC.pyx":1880 * """ * cdef PetscInt clevel = asInt(level) * cdef KSP ksp = KSP() # <<<<<<<<<<<<<< * CHKERR( PCMGGetSmoother(self.pc, clevel, &ksp.ksp) ) * CHKERR( PetscINCREF(ksp.obj) ) */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_KSP)); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 1880, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_ksp = ((struct PyPetscKSPObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/PC.pyx":1881 * cdef PetscInt clevel = asInt(level) * cdef KSP ksp = KSP() * CHKERR( PCMGGetSmoother(self.pc, clevel, &ksp.ksp) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(ksp.obj) ) * return ksp */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCMGGetSmoother(__pyx_v_self->pc, __pyx_v_clevel, (&__pyx_v_ksp->ksp))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1881, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":1882 * cdef KSP ksp = KSP() * CHKERR( PCMGGetSmoother(self.pc, clevel, &ksp.ksp) ) * CHKERR( PetscINCREF(ksp.obj) ) # <<<<<<<<<<<<<< * return ksp * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ksp->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1882, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":1883 * CHKERR( PCMGGetSmoother(self.pc, clevel, &ksp.ksp) ) * CHKERR( PetscINCREF(ksp.obj) ) * return ksp # <<<<<<<<<<<<<< * * def getMGSmootherDown(self, level: int) -> KSP: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_ksp); __pyx_r = ((PyObject *)__pyx_v_ksp); goto __pyx_L0; /* "petsc4py/PETSc/PC.pyx":1864 * return rscale * * def getMGSmoother(self, level: int) -> KSP: # <<<<<<<<<<<<<< * """Return the `KSP` to be used as a smoother. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.PC.getMGSmoother", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ksp); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":1885 * return ksp * * def getMGSmootherDown(self, level: int) -> KSP: # <<<<<<<<<<<<<< * """Return the `KSP` to be used as a smoother before coarse grid correction. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_173getMGSmootherDown(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_172getMGSmootherDown, "PC.getMGSmootherDown(self, level: int) -> KSP\nReturn the `KSP` to be used as a smoother before coarse grid correction.\n\n Not collective.\n\n Parameters\n ----------\n level\n The level of the smoother.\n\n See Also\n --------\n getMGSmoother, getMGSmootherUp, petsc.PCMGGetSmootherDown\n\n \nSource code at petsc4py/PETSc/PC.pyx:1885"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_173getMGSmootherDown(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_level = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getMGSmootherDown (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_level)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 1885, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getMGSmootherDown") < 0)) __PYX_ERR(48, 1885, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_level = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getMGSmootherDown", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 1885, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.getMGSmootherDown", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_172getMGSmootherDown(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_level); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_172getMGSmootherDown(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level) { PetscInt __pyx_v_clevel; struct PyPetscKSPObject *__pyx_v_ksp = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getMGSmootherDown", 1); /* "petsc4py/PETSc/PC.pyx":1900 * * """ * cdef PetscInt clevel = asInt(level) # <<<<<<<<<<<<<< * cdef KSP ksp = KSP() * CHKERR( PCMGGetSmootherDown(self.pc, clevel, &ksp.ksp) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_level); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 1900, __pyx_L1_error) __pyx_v_clevel = __pyx_t_1; /* "petsc4py/PETSc/PC.pyx":1901 * """ * cdef PetscInt clevel = asInt(level) * cdef KSP ksp = KSP() # <<<<<<<<<<<<<< * CHKERR( PCMGGetSmootherDown(self.pc, clevel, &ksp.ksp) ) * CHKERR( PetscINCREF(ksp.obj) ) */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_KSP)); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 1901, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_ksp = ((struct PyPetscKSPObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/PC.pyx":1902 * cdef PetscInt clevel = asInt(level) * cdef KSP ksp = KSP() * CHKERR( PCMGGetSmootherDown(self.pc, clevel, &ksp.ksp) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(ksp.obj) ) * return ksp */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCMGGetSmootherDown(__pyx_v_self->pc, __pyx_v_clevel, (&__pyx_v_ksp->ksp))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1902, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":1903 * cdef KSP ksp = KSP() * CHKERR( PCMGGetSmootherDown(self.pc, clevel, &ksp.ksp) ) * CHKERR( PetscINCREF(ksp.obj) ) # <<<<<<<<<<<<<< * return ksp * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ksp->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1903, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":1904 * CHKERR( PCMGGetSmootherDown(self.pc, clevel, &ksp.ksp) ) * CHKERR( PetscINCREF(ksp.obj) ) * return ksp # <<<<<<<<<<<<<< * * def getMGSmootherUp(self, level: int) -> KSP: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_ksp); __pyx_r = ((PyObject *)__pyx_v_ksp); goto __pyx_L0; /* "petsc4py/PETSc/PC.pyx":1885 * return ksp * * def getMGSmootherDown(self, level: int) -> KSP: # <<<<<<<<<<<<<< * """Return the `KSP` to be used as a smoother before coarse grid correction. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.PC.getMGSmootherDown", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ksp); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":1906 * return ksp * * def getMGSmootherUp(self, level: int) -> KSP: # <<<<<<<<<<<<<< * """Return the `KSP` to be used as a smoother after coarse grid correction. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_175getMGSmootherUp(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_174getMGSmootherUp, "PC.getMGSmootherUp(self, level: int) -> KSP\nReturn the `KSP` to be used as a smoother after coarse grid correction.\n\n Not collective.\n\n Parameters\n ----------\n level\n The level of the smoother.\n\n See Also\n --------\n getMGSmootherDown, getMGSmoother, petsc.PCMGGetSmootherUp\n\n \nSource code at petsc4py/PETSc/PC.pyx:1906"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_175getMGSmootherUp(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_level = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getMGSmootherUp (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_level)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 1906, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getMGSmootherUp") < 0)) __PYX_ERR(48, 1906, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_level = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getMGSmootherUp", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 1906, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.getMGSmootherUp", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_174getMGSmootherUp(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_level); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_174getMGSmootherUp(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level) { PetscInt __pyx_v_clevel; struct PyPetscKSPObject *__pyx_v_ksp = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getMGSmootherUp", 1); /* "petsc4py/PETSc/PC.pyx":1921 * * """ * cdef PetscInt clevel = asInt(level) # <<<<<<<<<<<<<< * cdef KSP ksp = KSP() * CHKERR( PCMGGetSmootherUp(self.pc, clevel, &ksp.ksp) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_level); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 1921, __pyx_L1_error) __pyx_v_clevel = __pyx_t_1; /* "petsc4py/PETSc/PC.pyx":1922 * """ * cdef PetscInt clevel = asInt(level) * cdef KSP ksp = KSP() # <<<<<<<<<<<<<< * CHKERR( PCMGGetSmootherUp(self.pc, clevel, &ksp.ksp) ) * CHKERR( PetscINCREF(ksp.obj) ) */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_KSP)); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 1922, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_ksp = ((struct PyPetscKSPObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/PC.pyx":1923 * cdef PetscInt clevel = asInt(level) * cdef KSP ksp = KSP() * CHKERR( PCMGGetSmootherUp(self.pc, clevel, &ksp.ksp) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(ksp.obj) ) * return ksp */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCMGGetSmootherUp(__pyx_v_self->pc, __pyx_v_clevel, (&__pyx_v_ksp->ksp))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1923, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":1924 * cdef KSP ksp = KSP() * CHKERR( PCMGGetSmootherUp(self.pc, clevel, &ksp.ksp) ) * CHKERR( PetscINCREF(ksp.obj) ) # <<<<<<<<<<<<<< * return ksp * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ksp->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1924, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":1925 * CHKERR( PCMGGetSmootherUp(self.pc, clevel, &ksp.ksp) ) * CHKERR( PetscINCREF(ksp.obj) ) * return ksp # <<<<<<<<<<<<<< * * def setMGCycleType(self, cycle_type: MGCycleType) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_ksp); __pyx_r = ((PyObject *)__pyx_v_ksp); goto __pyx_L0; /* "petsc4py/PETSc/PC.pyx":1906 * return ksp * * def getMGSmootherUp(self, level: int) -> KSP: # <<<<<<<<<<<<<< * """Return the `KSP` to be used as a smoother after coarse grid correction. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.PC.getMGSmootherUp", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ksp); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":1927 * return ksp * * def setMGCycleType(self, cycle_type: MGCycleType) -> None: # <<<<<<<<<<<<<< * """Set the type of cycles. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_177setMGCycleType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_176setMGCycleType, "PC.setMGCycleType(self, cycle_type: MGCycleType) -> None\nSet the type of cycles.\n\n Parameters\n ----------\n cycle_type\n The type of multigrid cycles to use.\n\n See Also\n --------\n setMGCycleTypeOnLevel, petsc.PCMGSetCycleType\n\n \nSource code at petsc4py/PETSc/PC.pyx:1927"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_177setMGCycleType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_cycle_type = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setMGCycleType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cycle_type,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_cycle_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 1927, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setMGCycleType") < 0)) __PYX_ERR(48, 1927, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_cycle_type = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setMGCycleType", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 1927, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setMGCycleType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_176setMGCycleType(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_cycle_type); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_176setMGCycleType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_cycle_type) { PCMGCycleType __pyx_v_ctype; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PCMGCycleType __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setMGCycleType", 1); /* "petsc4py/PETSc/PC.pyx":1940 * * """ * cdef PetscPCMGCycleType ctype = cycle_type # <<<<<<<<<<<<<< * CHKERR( PCMGSetCycleType(self.pc, ctype) ) * */ __pyx_t_1 = ((PCMGCycleType)__Pyx_PyInt_As_PCMGCycleType(__pyx_v_cycle_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 1940, __pyx_L1_error) __pyx_v_ctype = __pyx_t_1; /* "petsc4py/PETSc/PC.pyx":1941 * """ * cdef PetscPCMGCycleType ctype = cycle_type * CHKERR( PCMGSetCycleType(self.pc, ctype) ) # <<<<<<<<<<<<<< * * def setMGCycleTypeOnLevel(self, level: int, cycle_type: MGCycleType) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCMGSetCycleType(__pyx_v_self->pc, __pyx_v_ctype)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1941, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":1927 * return ksp * * def setMGCycleType(self, cycle_type: MGCycleType) -> None: # <<<<<<<<<<<<<< * """Set the type of cycles. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setMGCycleType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":1943 * CHKERR( PCMGSetCycleType(self.pc, ctype) ) * * def setMGCycleTypeOnLevel(self, level: int, cycle_type: MGCycleType) -> None: # <<<<<<<<<<<<<< * """Set the type of cycle on the given level. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_179setMGCycleTypeOnLevel(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_178setMGCycleTypeOnLevel, "PC.setMGCycleTypeOnLevel(self, level: int, cycle_type: MGCycleType) -> None\nSet the type of cycle on the given level.\n\n Logically collective.\n\n Parameters\n ----------\n level\n The level on which to set the cycle type.\n cycle_type\n The type of multigrid cycles to use.\n\n See Also\n --------\n setMGCycleType, petsc.PCMGSetCycleTypeOnLevel\n\n \nSource code at petsc4py/PETSc/PC.pyx:1943"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_179setMGCycleTypeOnLevel(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_level = 0; PyObject *__pyx_v_cycle_type = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setMGCycleTypeOnLevel (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,&__pyx_n_s_cycle_type,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_level)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 1943, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_cycle_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 1943, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setMGCycleTypeOnLevel", 1, 2, 2, 1); __PYX_ERR(48, 1943, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setMGCycleTypeOnLevel") < 0)) __PYX_ERR(48, 1943, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_level = values[0]; __pyx_v_cycle_type = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setMGCycleTypeOnLevel", 1, 2, 2, __pyx_nargs); __PYX_ERR(48, 1943, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setMGCycleTypeOnLevel", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_178setMGCycleTypeOnLevel(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_level, __pyx_v_cycle_type); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_178setMGCycleTypeOnLevel(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level, PyObject *__pyx_v_cycle_type) { PetscInt __pyx_v_clevel; PCMGCycleType __pyx_v_ctype; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PCMGCycleType __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setMGCycleTypeOnLevel", 1); /* "petsc4py/PETSc/PC.pyx":1960 * * """ * cdef PetscInt clevel = asInt(level) # <<<<<<<<<<<<<< * cdef PetscPCMGCycleType ctype = cycle_type * CHKERR( PCMGSetCycleTypeOnLevel(self.pc, clevel, ctype) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_level); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 1960, __pyx_L1_error) __pyx_v_clevel = __pyx_t_1; /* "petsc4py/PETSc/PC.pyx":1961 * """ * cdef PetscInt clevel = asInt(level) * cdef PetscPCMGCycleType ctype = cycle_type # <<<<<<<<<<<<<< * CHKERR( PCMGSetCycleTypeOnLevel(self.pc, clevel, ctype) ) * */ __pyx_t_2 = ((PCMGCycleType)__Pyx_PyInt_As_PCMGCycleType(__pyx_v_cycle_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 1961, __pyx_L1_error) __pyx_v_ctype = __pyx_t_2; /* "petsc4py/PETSc/PC.pyx":1962 * cdef PetscInt clevel = asInt(level) * cdef PetscPCMGCycleType ctype = cycle_type * CHKERR( PCMGSetCycleTypeOnLevel(self.pc, clevel, ctype) ) # <<<<<<<<<<<<<< * * def setMGRhs(self, level: int, Vec rhs) -> None: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCMGSetCycleTypeOnLevel(__pyx_v_self->pc, __pyx_v_clevel, __pyx_v_ctype)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1962, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":1943 * CHKERR( PCMGSetCycleType(self.pc, ctype) ) * * def setMGCycleTypeOnLevel(self, level: int, cycle_type: MGCycleType) -> None: # <<<<<<<<<<<<<< * """Set the type of cycle on the given level. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setMGCycleTypeOnLevel", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":1964 * CHKERR( PCMGSetCycleTypeOnLevel(self.pc, clevel, ctype) ) * * def setMGRhs(self, level: int, Vec rhs) -> None: # <<<<<<<<<<<<<< * """Set the vector where the right-hand side is stored. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_181setMGRhs(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_180setMGRhs, "PC.setMGRhs(self, level: int, rhs: Vec) -> None\nSet the vector where the right-hand side is stored.\n\n Logically collective.\n\n If not provided, one will be set internally. Will\n be cleaned up in `destroy`.\n\n Parameters\n ----------\n level\n The level on which to set the right-hand side.\n rhs\n The vector where the right-hand side is stored.\n\n See Also\n --------\n petsc.PCMGSetRhs\n\n \nSource code at petsc4py/PETSc/PC.pyx:1964"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_181setMGRhs(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_level = 0; struct PyPetscVecObject *__pyx_v_rhs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setMGRhs (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,&__pyx_n_s_rhs,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_level)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 1964, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rhs)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 1964, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setMGRhs", 1, 2, 2, 1); __PYX_ERR(48, 1964, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setMGRhs") < 0)) __PYX_ERR(48, 1964, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_level = values[0]; __pyx_v_rhs = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setMGRhs", 1, 2, 2, __pyx_nargs); __PYX_ERR(48, 1964, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setMGRhs", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "rhs", 0))) __PYX_ERR(48, 1964, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_180setMGRhs(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_level, __pyx_v_rhs); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_180setMGRhs(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level, struct PyPetscVecObject *__pyx_v_rhs) { PetscInt __pyx_v_clevel; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setMGRhs", 1); /* "petsc4py/PETSc/PC.pyx":1984 * * """ * cdef PetscInt clevel = asInt(level) # <<<<<<<<<<<<<< * CHKERR( PCMGSetRhs(self.pc, clevel, rhs.vec) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_level); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 1984, __pyx_L1_error) __pyx_v_clevel = __pyx_t_1; /* "petsc4py/PETSc/PC.pyx":1985 * """ * cdef PetscInt clevel = asInt(level) * CHKERR( PCMGSetRhs(self.pc, clevel, rhs.vec) ) # <<<<<<<<<<<<<< * * def setMGX(self, level: int, Vec x) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCMGSetRhs(__pyx_v_self->pc, __pyx_v_clevel, __pyx_v_rhs->vec)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1985, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":1964 * CHKERR( PCMGSetCycleTypeOnLevel(self.pc, clevel, ctype) ) * * def setMGRhs(self, level: int, Vec rhs) -> None: # <<<<<<<<<<<<<< * """Set the vector where the right-hand side is stored. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setMGRhs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":1987 * CHKERR( PCMGSetRhs(self.pc, clevel, rhs.vec) ) * * def setMGX(self, level: int, Vec x) -> None: # <<<<<<<<<<<<<< * """Set the vector where the solution is stored. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_183setMGX(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_182setMGX, "PC.setMGX(self, level: int, x: Vec) -> None\nSet the vector where the solution is stored.\n\n Logically collective.\n\n If not provided, one will be set internally. Will\n be cleaned up in `destroy`.\n\n Parameters\n ----------\n level\n The level on which to set the solution.\n x\n The vector where the solution is stored.\n\n See Also\n --------\n petsc.PCMGSetX\n\n \nSource code at petsc4py/PETSc/PC.pyx:1987"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_183setMGX(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_level = 0; struct PyPetscVecObject *__pyx_v_x = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setMGX (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,&__pyx_n_s_x,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_level)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 1987, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 1987, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setMGX", 1, 2, 2, 1); __PYX_ERR(48, 1987, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setMGX") < 0)) __PYX_ERR(48, 1987, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_level = values[0]; __pyx_v_x = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setMGX", 1, 2, 2, __pyx_nargs); __PYX_ERR(48, 1987, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setMGX", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(48, 1987, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_182setMGX(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_level, __pyx_v_x); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_182setMGX(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level, struct PyPetscVecObject *__pyx_v_x) { PetscInt __pyx_v_clevel; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setMGX", 1); /* "petsc4py/PETSc/PC.pyx":2007 * * """ * cdef PetscInt clevel = asInt(level) # <<<<<<<<<<<<<< * CHKERR( PCMGSetX(self.pc, clevel, x.vec) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_level); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 2007, __pyx_L1_error) __pyx_v_clevel = __pyx_t_1; /* "petsc4py/PETSc/PC.pyx":2008 * """ * cdef PetscInt clevel = asInt(level) * CHKERR( PCMGSetX(self.pc, clevel, x.vec) ) # <<<<<<<<<<<<<< * * def setMGR(self, level: int, Vec r) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCMGSetX(__pyx_v_self->pc, __pyx_v_clevel, __pyx_v_x->vec)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 2008, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":1987 * CHKERR( PCMGSetRhs(self.pc, clevel, rhs.vec) ) * * def setMGX(self, level: int, Vec x) -> None: # <<<<<<<<<<<<<< * """Set the vector where the solution is stored. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setMGX", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":2010 * CHKERR( PCMGSetX(self.pc, clevel, x.vec) ) * * def setMGR(self, level: int, Vec r) -> None: # <<<<<<<<<<<<<< * """Set the vector where the residual is stored. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_185setMGR(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_184setMGR, "PC.setMGR(self, level: int, r: Vec) -> None\nSet the vector where the residual is stored.\n\n Logically collective.\n\n If not provided, one will be set internally. Will\n be cleaned up in `destroy`.\n\n Parameters\n ----------\n level\n The level on which to set the residual.\n r\n The vector where the residual is stored.\n\n See Also\n --------\n petsc.PCMGSetR\n\n \nSource code at petsc4py/PETSc/PC.pyx:2010"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_185setMGR(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_level = 0; struct PyPetscVecObject *__pyx_v_r = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setMGR (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,&__pyx_n_s_r,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_level)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2010, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_r)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2010, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setMGR", 1, 2, 2, 1); __PYX_ERR(48, 2010, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setMGR") < 0)) __PYX_ERR(48, 2010, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_level = values[0]; __pyx_v_r = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setMGR", 1, 2, 2, __pyx_nargs); __PYX_ERR(48, 2010, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setMGR", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_r), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "r", 0))) __PYX_ERR(48, 2010, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_184setMGR(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_level, __pyx_v_r); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_184setMGR(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level, struct PyPetscVecObject *__pyx_v_r) { PetscInt __pyx_v_clevel; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setMGR", 1); /* "petsc4py/PETSc/PC.pyx":2030 * * """ * cdef PetscInt clevel = asInt(level) # <<<<<<<<<<<<<< * CHKERR( PCMGSetR(self.pc, clevel, r.vec) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_level); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 2030, __pyx_L1_error) __pyx_v_clevel = __pyx_t_1; /* "petsc4py/PETSc/PC.pyx":2031 * """ * cdef PetscInt clevel = asInt(level) * CHKERR( PCMGSetR(self.pc, clevel, r.vec) ) # <<<<<<<<<<<<<< * * # --- BDDC --- */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCMGSetR(__pyx_v_self->pc, __pyx_v_clevel, __pyx_v_r->vec)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 2031, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":2010 * CHKERR( PCMGSetX(self.pc, clevel, x.vec) ) * * def setMGR(self, level: int, Vec r) -> None: # <<<<<<<<<<<<<< * """Set the vector where the residual is stored. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setMGR", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":2035 * # --- BDDC --- * * def setBDDCDivergenceMat(self, Mat div, trans: bool = False, IS l2l=None) -> None: # <<<<<<<<<<<<<< * """Set the linear operator representing div(u)p dx. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_187setBDDCDivergenceMat(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_186setBDDCDivergenceMat, "PC.setBDDCDivergenceMat(self, div: Mat, trans: bool = False, l2l: IS | None = None) -> None\nSet the linear operator representing \342\210\253 div(u)\342\200\242p dx.\n\n Collective.\n\n Parameters\n ----------\n div\n The matrix in `Mat.Type.IS` format.\n trans\n If `True`, the pressure/velocity is in the trial/test space\n respectively. If `False` the pressure/velocity is in the test/trial\n space.\n l2l\n Optional `IS` describing the local to local map for velocities.\n\n See Also\n --------\n petsc.PCBDDCSetDivergenceMat\n\n \nSource code at petsc4py/PETSc/PC.pyx:2035"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_187setBDDCDivergenceMat(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscMatObject *__pyx_v_div = 0; PyObject *__pyx_v_trans = 0; struct PyPetscISObject *__pyx_v_l2l = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setBDDCDivergenceMat (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_div,&__pyx_n_s_trans,&__pyx_n_s_l2l,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False)); values[2] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscISObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_div)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2035, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_trans); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2035, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_l2l); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2035, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setBDDCDivergenceMat") < 0)) __PYX_ERR(48, 2035, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_div = ((struct PyPetscMatObject *)values[0]); __pyx_v_trans = values[1]; __pyx_v_l2l = ((struct PyPetscISObject *)values[2]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setBDDCDivergenceMat", 0, 1, 3, __pyx_nargs); __PYX_ERR(48, 2035, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setBDDCDivergenceMat", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_div), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "div", 0))) __PYX_ERR(48, 2035, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_l2l), __pyx_ptype_8petsc4py_5PETSc_IS, 1, "l2l", 0))) __PYX_ERR(48, 2035, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_186setBDDCDivergenceMat(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_div, __pyx_v_trans, __pyx_v_l2l); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_186setBDDCDivergenceMat(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_div, PyObject *__pyx_v_trans, struct PyPetscISObject *__pyx_v_l2l) { PetscBool __pyx_v_ptrans; IS __pyx_v_pl2l; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; int __pyx_t_2; IS __pyx_t_3; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setBDDCDivergenceMat", 1); /* "petsc4py/PETSc/PC.pyx":2056 * * """ * cdef PetscBool ptrans = trans # <<<<<<<<<<<<<< * cdef PetscIS pl2l = NULL * if l2l is not None: pl2l = l2l.iset */ __pyx_t_1 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_trans)); if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2056, __pyx_L1_error) __pyx_v_ptrans = __pyx_t_1; /* "petsc4py/PETSc/PC.pyx":2057 * """ * cdef PetscBool ptrans = trans * cdef PetscIS pl2l = NULL # <<<<<<<<<<<<<< * if l2l is not None: pl2l = l2l.iset * CHKERR( PCBDDCSetDivergenceMat(self.pc, div.mat, ptrans, pl2l) ) */ __pyx_v_pl2l = NULL; /* "petsc4py/PETSc/PC.pyx":2058 * cdef PetscBool ptrans = trans * cdef PetscIS pl2l = NULL * if l2l is not None: pl2l = l2l.iset # <<<<<<<<<<<<<< * CHKERR( PCBDDCSetDivergenceMat(self.pc, div.mat, ptrans, pl2l) ) * */ __pyx_t_2 = (((PyObject *)__pyx_v_l2l) != Py_None); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_l2l->iset; __pyx_v_pl2l = __pyx_t_3; } /* "petsc4py/PETSc/PC.pyx":2059 * cdef PetscIS pl2l = NULL * if l2l is not None: pl2l = l2l.iset * CHKERR( PCBDDCSetDivergenceMat(self.pc, div.mat, ptrans, pl2l) ) # <<<<<<<<<<<<<< * * def setBDDCDiscreteGradient( */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCBDDCSetDivergenceMat(__pyx_v_self->pc, __pyx_v_div->mat, __pyx_v_ptrans, __pyx_v_pl2l)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 2059, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":2035 * # --- BDDC --- * * def setBDDCDivergenceMat(self, Mat div, trans: bool = False, IS l2l=None) -> None: # <<<<<<<<<<<<<< * """Set the linear operator representing div(u)p dx. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setBDDCDivergenceMat", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":2061 * CHKERR( PCBDDCSetDivergenceMat(self.pc, div.mat, ptrans, pl2l) ) * * def setBDDCDiscreteGradient( # <<<<<<<<<<<<<< * self, * Mat G, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_189setBDDCDiscreteGradient(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_188setBDDCDiscreteGradient, "PC.setBDDCDiscreteGradient(self, G: Mat, order: int = 1, field: int = 1, gord: bool = True, conforming: bool = True) -> None\nSet the discrete gradient.\n\n Collective.\n\n Parameters\n ----------\n G\n The discrete gradient matrix in `Mat.Type.AIJ` format.\n order\n The order of the Nedelec space.\n field\n The field number of the Nedelec degrees of freedom. This is not used\n if no fields have been specified.\n gord\n Enable to use global ordering in the rows of ``G``.\n conforming\n Enable if the mesh is conforming.\n\n See Also\n --------\n petsc.PCBDDCSetDiscreteGradient\n\n \nSource code at petsc4py/PETSc/PC.pyx:2061"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_189setBDDCDiscreteGradient(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscMatObject *__pyx_v_G = 0; PyObject *__pyx_v_order = 0; PyObject *__pyx_v_field = 0; PyObject *__pyx_v_gord = 0; PyObject *__pyx_v_conforming = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setBDDCDiscreteGradient (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_G,&__pyx_n_s_order,&__pyx_n_s_field,&__pyx_n_s_gord,&__pyx_n_s_conforming,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_1)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_1)); /* "petsc4py/PETSc/PC.pyx":2066 * order: int = 1, * field: int = 1, * gord: bool = True, # <<<<<<<<<<<<<< * conforming: bool = True) -> None: * """Set the discrete gradient. */ values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_True)); /* "petsc4py/PETSc/PC.pyx":2067 * field: int = 1, * gord: bool = True, * conforming: bool = True) -> None: # <<<<<<<<<<<<<< * """Set the discrete gradient. * */ values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_True)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_G)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2061, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_order); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2061, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_field); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2061, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gord); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2061, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_conforming); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2061, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setBDDCDiscreteGradient") < 0)) __PYX_ERR(48, 2061, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_G = ((struct PyPetscMatObject *)values[0]); __pyx_v_order = values[1]; __pyx_v_field = values[2]; __pyx_v_gord = values[3]; __pyx_v_conforming = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setBDDCDiscreteGradient", 0, 1, 5, __pyx_nargs); __PYX_ERR(48, 2061, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setBDDCDiscreteGradient", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_G), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "G", 0))) __PYX_ERR(48, 2063, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_188setBDDCDiscreteGradient(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_G, __pyx_v_order, __pyx_v_field, __pyx_v_gord, __pyx_v_conforming); /* "petsc4py/PETSc/PC.pyx":2061 * CHKERR( PCBDDCSetDivergenceMat(self.pc, div.mat, ptrans, pl2l) ) * * def setBDDCDiscreteGradient( # <<<<<<<<<<<<<< * self, * Mat G, */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_188setBDDCDiscreteGradient(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_G, PyObject *__pyx_v_order, PyObject *__pyx_v_field, PyObject *__pyx_v_gord, PyObject *__pyx_v_conforming) { PetscInt __pyx_v_porder; PetscInt __pyx_v_pfield; PetscBool __pyx_v_pgord; PetscBool __pyx_v_pconforming; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscBool __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setBDDCDiscreteGradient", 1); /* "petsc4py/PETSc/PC.pyx":2091 * * """ * cdef PetscInt porder = asInt(order) # <<<<<<<<<<<<<< * cdef PetscInt pfield = asInt(field) * cdef PetscBool pgord = gord */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_order); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 2091, __pyx_L1_error) __pyx_v_porder = __pyx_t_1; /* "petsc4py/PETSc/PC.pyx":2092 * """ * cdef PetscInt porder = asInt(order) * cdef PetscInt pfield = asInt(field) # <<<<<<<<<<<<<< * cdef PetscBool pgord = gord * cdef PetscBool pconforming = conforming */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_field); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 2092, __pyx_L1_error) __pyx_v_pfield = __pyx_t_1; /* "petsc4py/PETSc/PC.pyx":2093 * cdef PetscInt porder = asInt(order) * cdef PetscInt pfield = asInt(field) * cdef PetscBool pgord = gord # <<<<<<<<<<<<<< * cdef PetscBool pconforming = conforming * CHKERR( PCBDDCSetDiscreteGradient(self.pc, G.mat, porder, pfield, pgord, pconforming) ) */ __pyx_t_2 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_gord)); if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2093, __pyx_L1_error) __pyx_v_pgord = __pyx_t_2; /* "petsc4py/PETSc/PC.pyx":2094 * cdef PetscInt pfield = asInt(field) * cdef PetscBool pgord = gord * cdef PetscBool pconforming = conforming # <<<<<<<<<<<<<< * CHKERR( PCBDDCSetDiscreteGradient(self.pc, G.mat, porder, pfield, pgord, pconforming) ) * */ __pyx_t_2 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_conforming)); if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2094, __pyx_L1_error) __pyx_v_pconforming = __pyx_t_2; /* "petsc4py/PETSc/PC.pyx":2095 * cdef PetscBool pgord = gord * cdef PetscBool pconforming = conforming * CHKERR( PCBDDCSetDiscreteGradient(self.pc, G.mat, porder, pfield, pgord, pconforming) ) # <<<<<<<<<<<<<< * * def setBDDCChangeOfBasisMat(self, Mat T, interior: bool = False) -> None: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCBDDCSetDiscreteGradient(__pyx_v_self->pc, __pyx_v_G->mat, __pyx_v_porder, __pyx_v_pfield, __pyx_v_pgord, __pyx_v_pconforming)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 2095, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":2061 * CHKERR( PCBDDCSetDivergenceMat(self.pc, div.mat, ptrans, pl2l) ) * * def setBDDCDiscreteGradient( # <<<<<<<<<<<<<< * self, * Mat G, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setBDDCDiscreteGradient", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":2097 * CHKERR( PCBDDCSetDiscreteGradient(self.pc, G.mat, porder, pfield, pgord, pconforming) ) * * def setBDDCChangeOfBasisMat(self, Mat T, interior: bool = False) -> None: # <<<<<<<<<<<<<< * """Set a user defined change of basis for degrees of freedom. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_191setBDDCChangeOfBasisMat(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_190setBDDCChangeOfBasisMat, "PC.setBDDCChangeOfBasisMat(self, T: Mat, interior: bool = False) -> None\nSet a user defined change of basis for degrees of freedom.\n\n Collective.\n\n Parameters\n ----------\n T\n The matrix representing the change of basis.\n interior\n Enable to indicate the change of basis affects interior degrees of\n freedom.\n\n See Also\n --------\n petsc.PCBDDCSetChangeOfBasisMat\n\n \nSource code at petsc4py/PETSc/PC.pyx:2097"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_191setBDDCChangeOfBasisMat(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscMatObject *__pyx_v_T = 0; PyObject *__pyx_v_interior = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setBDDCChangeOfBasisMat (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_T_2,&__pyx_n_s_interior,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_T_2)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2097, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_interior); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2097, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setBDDCChangeOfBasisMat") < 0)) __PYX_ERR(48, 2097, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_T = ((struct PyPetscMatObject *)values[0]); __pyx_v_interior = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setBDDCChangeOfBasisMat", 0, 1, 2, __pyx_nargs); __PYX_ERR(48, 2097, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setBDDCChangeOfBasisMat", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_T), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "T", 0))) __PYX_ERR(48, 2097, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_190setBDDCChangeOfBasisMat(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_T, __pyx_v_interior); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_190setBDDCChangeOfBasisMat(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_T, PyObject *__pyx_v_interior) { PetscBool __pyx_v_pinterior; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setBDDCChangeOfBasisMat", 1); /* "petsc4py/PETSc/PC.pyx":2115 * * """ * cdef PetscBool pinterior = interior # <<<<<<<<<<<<<< * CHKERR( PCBDDCSetChangeOfBasisMat(self.pc, T.mat, pinterior) ) * */ __pyx_t_1 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_interior)); if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2115, __pyx_L1_error) __pyx_v_pinterior = __pyx_t_1; /* "petsc4py/PETSc/PC.pyx":2116 * """ * cdef PetscBool pinterior = interior * CHKERR( PCBDDCSetChangeOfBasisMat(self.pc, T.mat, pinterior) ) # <<<<<<<<<<<<<< * * def setBDDCPrimalVerticesIS(self, IS primv) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCBDDCSetChangeOfBasisMat(__pyx_v_self->pc, __pyx_v_T->mat, __pyx_v_pinterior)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 2116, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":2097 * CHKERR( PCBDDCSetDiscreteGradient(self.pc, G.mat, porder, pfield, pgord, pconforming) ) * * def setBDDCChangeOfBasisMat(self, Mat T, interior: bool = False) -> None: # <<<<<<<<<<<<<< * """Set a user defined change of basis for degrees of freedom. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setBDDCChangeOfBasisMat", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":2118 * CHKERR( PCBDDCSetChangeOfBasisMat(self.pc, T.mat, pinterior) ) * * def setBDDCPrimalVerticesIS(self, IS primv) -> None: # <<<<<<<<<<<<<< * """Set additional user defined primal vertices. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_193setBDDCPrimalVerticesIS(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_192setBDDCPrimalVerticesIS, "PC.setBDDCPrimalVerticesIS(self, primv: IS) -> None\nSet additional user defined primal vertices.\n\n Collective.\n\n Parameters\n ----------\n primv\n The `IS` of primal vertices in global numbering.\n\n See Also\n --------\n petsc.PCBDDCSetPrimalVerticesIS\n\n \nSource code at petsc4py/PETSc/PC.pyx:2118"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_193setBDDCPrimalVerticesIS(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscISObject *__pyx_v_primv = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setBDDCPrimalVerticesIS (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_primv,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_primv)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2118, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setBDDCPrimalVerticesIS") < 0)) __PYX_ERR(48, 2118, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_primv = ((struct PyPetscISObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setBDDCPrimalVerticesIS", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 2118, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setBDDCPrimalVerticesIS", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_primv), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "primv", 0))) __PYX_ERR(48, 2118, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_192setBDDCPrimalVerticesIS(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_primv); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_192setBDDCPrimalVerticesIS(struct PyPetscPCObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_primv) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setBDDCPrimalVerticesIS", 1); /* "petsc4py/PETSc/PC.pyx":2133 * * """ * CHKERR( PCBDDCSetPrimalVerticesIS(self.pc, primv.iset) ) # <<<<<<<<<<<<<< * * def setBDDCPrimalVerticesLocalIS(self, IS primv) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCBDDCSetPrimalVerticesIS(__pyx_v_self->pc, __pyx_v_primv->iset)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 2133, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":2118 * CHKERR( PCBDDCSetChangeOfBasisMat(self.pc, T.mat, pinterior) ) * * def setBDDCPrimalVerticesIS(self, IS primv) -> None: # <<<<<<<<<<<<<< * """Set additional user defined primal vertices. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setBDDCPrimalVerticesIS", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":2135 * CHKERR( PCBDDCSetPrimalVerticesIS(self.pc, primv.iset) ) * * def setBDDCPrimalVerticesLocalIS(self, IS primv) -> None: # <<<<<<<<<<<<<< * """Set additional user defined primal vertices. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_195setBDDCPrimalVerticesLocalIS(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_194setBDDCPrimalVerticesLocalIS, "PC.setBDDCPrimalVerticesLocalIS(self, primv: IS) -> None\nSet additional user defined primal vertices.\n\n Collective.\n\n Parameters\n ----------\n primv\n The `IS` of primal vertices in local numbering.\n\n See Also\n --------\n petsc.PCBDDCSetPrimalVerticesLocalIS\n\n \nSource code at petsc4py/PETSc/PC.pyx:2135"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_195setBDDCPrimalVerticesLocalIS(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscISObject *__pyx_v_primv = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setBDDCPrimalVerticesLocalIS (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_primv,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_primv)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2135, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setBDDCPrimalVerticesLocalIS") < 0)) __PYX_ERR(48, 2135, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_primv = ((struct PyPetscISObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setBDDCPrimalVerticesLocalIS", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 2135, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setBDDCPrimalVerticesLocalIS", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_primv), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "primv", 0))) __PYX_ERR(48, 2135, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_194setBDDCPrimalVerticesLocalIS(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_primv); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_194setBDDCPrimalVerticesLocalIS(struct PyPetscPCObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_primv) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setBDDCPrimalVerticesLocalIS", 1); /* "petsc4py/PETSc/PC.pyx":2150 * * """ * CHKERR( PCBDDCSetPrimalVerticesLocalIS(self.pc, primv.iset) ) # <<<<<<<<<<<<<< * * def setBDDCCoarseningRatio(self, cratio: int) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCBDDCSetPrimalVerticesLocalIS(__pyx_v_self->pc, __pyx_v_primv->iset)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 2150, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":2135 * CHKERR( PCBDDCSetPrimalVerticesIS(self.pc, primv.iset) ) * * def setBDDCPrimalVerticesLocalIS(self, IS primv) -> None: # <<<<<<<<<<<<<< * """Set additional user defined primal vertices. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setBDDCPrimalVerticesLocalIS", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":2152 * CHKERR( PCBDDCSetPrimalVerticesLocalIS(self.pc, primv.iset) ) * * def setBDDCCoarseningRatio(self, cratio: int) -> None: # <<<<<<<<<<<<<< * """Set the coarsening ratio used in the multilevel version. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_197setBDDCCoarseningRatio(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_196setBDDCCoarseningRatio, "PC.setBDDCCoarseningRatio(self, cratio: int) -> None\nSet the coarsening ratio used in the multilevel version.\n\n Logically collective.\n\n Parameters\n ----------\n cratio\n The coarsening ratio at the coarse level\n\n See Also\n --------\n petsc.PCBDDCSetCoarseningRatio\n\n \nSource code at petsc4py/PETSc/PC.pyx:2152"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_197setBDDCCoarseningRatio(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_cratio = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setBDDCCoarseningRatio (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cratio,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_cratio)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2152, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setBDDCCoarseningRatio") < 0)) __PYX_ERR(48, 2152, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_cratio = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setBDDCCoarseningRatio", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 2152, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setBDDCCoarseningRatio", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_196setBDDCCoarseningRatio(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_cratio); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_196setBDDCCoarseningRatio(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_cratio) { PetscInt __pyx_v_pcratio; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setBDDCCoarseningRatio", 1); /* "petsc4py/PETSc/PC.pyx":2167 * * """ * cdef PetscInt pcratio = asInt(cratio) # <<<<<<<<<<<<<< * CHKERR( PCBDDCSetCoarseningRatio(self.pc, pcratio) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_cratio); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 2167, __pyx_L1_error) __pyx_v_pcratio = __pyx_t_1; /* "petsc4py/PETSc/PC.pyx":2168 * """ * cdef PetscInt pcratio = asInt(cratio) * CHKERR( PCBDDCSetCoarseningRatio(self.pc, pcratio) ) # <<<<<<<<<<<<<< * * def setBDDCLevels(self, levels: int) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCBDDCSetCoarseningRatio(__pyx_v_self->pc, __pyx_v_pcratio)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 2168, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":2152 * CHKERR( PCBDDCSetPrimalVerticesLocalIS(self.pc, primv.iset) ) * * def setBDDCCoarseningRatio(self, cratio: int) -> None: # <<<<<<<<<<<<<< * """Set the coarsening ratio used in the multilevel version. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setBDDCCoarseningRatio", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":2170 * CHKERR( PCBDDCSetCoarseningRatio(self.pc, pcratio) ) * * def setBDDCLevels(self, levels: int) -> None: # <<<<<<<<<<<<<< * """Set the maximum number of additional levels allowed. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_199setBDDCLevels(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_198setBDDCLevels, "PC.setBDDCLevels(self, levels: int) -> None\nSet the maximum number of additional levels allowed.\n\n Logically collective.\n\n Parameters\n ----------\n levels\n The maximum number of levels.\n\n See Also\n --------\n petsc.PCBDDCSetLevels\n\n \nSource code at petsc4py/PETSc/PC.pyx:2170"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_199setBDDCLevels(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_levels = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setBDDCLevels (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_levels,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_levels)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2170, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setBDDCLevels") < 0)) __PYX_ERR(48, 2170, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_levels = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setBDDCLevels", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 2170, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setBDDCLevels", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_198setBDDCLevels(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_levels); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_198setBDDCLevels(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_levels) { PetscInt __pyx_v_plevels; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setBDDCLevels", 1); /* "petsc4py/PETSc/PC.pyx":2185 * * """ * cdef PetscInt plevels = asInt(levels) # <<<<<<<<<<<<<< * CHKERR( PCBDDCSetLevels(self.pc, plevels) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_levels); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 2185, __pyx_L1_error) __pyx_v_plevels = __pyx_t_1; /* "petsc4py/PETSc/PC.pyx":2186 * """ * cdef PetscInt plevels = asInt(levels) * CHKERR( PCBDDCSetLevels(self.pc, plevels) ) # <<<<<<<<<<<<<< * * def setBDDCDirichletBoundaries(self, IS bndr) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCBDDCSetLevels(__pyx_v_self->pc, __pyx_v_plevels)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 2186, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":2170 * CHKERR( PCBDDCSetCoarseningRatio(self.pc, pcratio) ) * * def setBDDCLevels(self, levels: int) -> None: # <<<<<<<<<<<<<< * """Set the maximum number of additional levels allowed. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setBDDCLevels", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":2188 * CHKERR( PCBDDCSetLevels(self.pc, plevels) ) * * def setBDDCDirichletBoundaries(self, IS bndr) -> None: # <<<<<<<<<<<<<< * """Set the `IS` defining Dirichlet boundaries for the global problem. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_201setBDDCDirichletBoundaries(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_200setBDDCDirichletBoundaries, "PC.setBDDCDirichletBoundaries(self, bndr: IS) -> None\nSet the `IS` defining Dirichlet boundaries for the global problem.\n\n Collective.\n\n Parameters\n ----------\n bndr\n The parallel `IS` defining Dirichlet boundaries.\n\n See Also\n --------\n petsc.PCBDDCSetDirichletBoundaries\n\n \nSource code at petsc4py/PETSc/PC.pyx:2188"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_201setBDDCDirichletBoundaries(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscISObject *__pyx_v_bndr = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setBDDCDirichletBoundaries (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_bndr,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_bndr)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2188, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setBDDCDirichletBoundaries") < 0)) __PYX_ERR(48, 2188, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_bndr = ((struct PyPetscISObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setBDDCDirichletBoundaries", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 2188, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setBDDCDirichletBoundaries", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bndr), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "bndr", 0))) __PYX_ERR(48, 2188, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_200setBDDCDirichletBoundaries(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_bndr); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_200setBDDCDirichletBoundaries(struct PyPetscPCObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_bndr) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setBDDCDirichletBoundaries", 1); /* "petsc4py/PETSc/PC.pyx":2203 * * """ * CHKERR( PCBDDCSetDirichletBoundaries(self.pc, bndr.iset) ) # <<<<<<<<<<<<<< * * def setBDDCDirichletBoundariesLocal(self, IS bndr) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCBDDCSetDirichletBoundaries(__pyx_v_self->pc, __pyx_v_bndr->iset)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 2203, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":2188 * CHKERR( PCBDDCSetLevels(self.pc, plevels) ) * * def setBDDCDirichletBoundaries(self, IS bndr) -> None: # <<<<<<<<<<<<<< * """Set the `IS` defining Dirichlet boundaries for the global problem. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setBDDCDirichletBoundaries", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":2205 * CHKERR( PCBDDCSetDirichletBoundaries(self.pc, bndr.iset) ) * * def setBDDCDirichletBoundariesLocal(self, IS bndr) -> None: # <<<<<<<<<<<<<< * """Set the `IS` defining Dirichlet boundaries in local ordering. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_203setBDDCDirichletBoundariesLocal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_202setBDDCDirichletBoundariesLocal, "PC.setBDDCDirichletBoundariesLocal(self, bndr: IS) -> None\nSet the `IS` defining Dirichlet boundaries in local ordering.\n\n Collective.\n\n Parameters\n ----------\n bndr\n The parallel `IS` defining Dirichlet boundaries in local ordering.\n\n See Also\n --------\n setBDDCDirichletBoundaries, petsc.PCBDDCSetDirichletBoundariesLocal\n\n \nSource code at petsc4py/PETSc/PC.pyx:2205"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_203setBDDCDirichletBoundariesLocal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscISObject *__pyx_v_bndr = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setBDDCDirichletBoundariesLocal (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_bndr,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_bndr)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2205, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setBDDCDirichletBoundariesLocal") < 0)) __PYX_ERR(48, 2205, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_bndr = ((struct PyPetscISObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setBDDCDirichletBoundariesLocal", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 2205, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setBDDCDirichletBoundariesLocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bndr), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "bndr", 0))) __PYX_ERR(48, 2205, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_202setBDDCDirichletBoundariesLocal(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_bndr); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_202setBDDCDirichletBoundariesLocal(struct PyPetscPCObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_bndr) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setBDDCDirichletBoundariesLocal", 1); /* "petsc4py/PETSc/PC.pyx":2220 * * """ * CHKERR( PCBDDCSetDirichletBoundariesLocal(self.pc, bndr.iset) ) # <<<<<<<<<<<<<< * * def setBDDCNeumannBoundaries(self, IS bndr) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCBDDCSetDirichletBoundariesLocal(__pyx_v_self->pc, __pyx_v_bndr->iset)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 2220, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":2205 * CHKERR( PCBDDCSetDirichletBoundaries(self.pc, bndr.iset) ) * * def setBDDCDirichletBoundariesLocal(self, IS bndr) -> None: # <<<<<<<<<<<<<< * """Set the `IS` defining Dirichlet boundaries in local ordering. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setBDDCDirichletBoundariesLocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":2222 * CHKERR( PCBDDCSetDirichletBoundariesLocal(self.pc, bndr.iset) ) * * def setBDDCNeumannBoundaries(self, IS bndr) -> None: # <<<<<<<<<<<<<< * """Set the `IS` defining Neumann boundaries for the global problem. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_205setBDDCNeumannBoundaries(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_204setBDDCNeumannBoundaries, "PC.setBDDCNeumannBoundaries(self, bndr: IS) -> None\nSet the `IS` defining Neumann boundaries for the global problem.\n\n Collective.\n\n Parameters\n ----------\n bndr\n The parallel `IS` defining Neumann boundaries.\n\n See Also\n --------\n petsc.PCBDDCSetNeumannBoundaries\n\n \nSource code at petsc4py/PETSc/PC.pyx:2222"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_205setBDDCNeumannBoundaries(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscISObject *__pyx_v_bndr = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setBDDCNeumannBoundaries (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_bndr,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_bndr)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2222, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setBDDCNeumannBoundaries") < 0)) __PYX_ERR(48, 2222, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_bndr = ((struct PyPetscISObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setBDDCNeumannBoundaries", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 2222, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setBDDCNeumannBoundaries", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bndr), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "bndr", 0))) __PYX_ERR(48, 2222, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_204setBDDCNeumannBoundaries(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_bndr); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_204setBDDCNeumannBoundaries(struct PyPetscPCObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_bndr) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setBDDCNeumannBoundaries", 1); /* "petsc4py/PETSc/PC.pyx":2237 * * """ * CHKERR( PCBDDCSetNeumannBoundaries(self.pc, bndr.iset) ) # <<<<<<<<<<<<<< * * def setBDDCNeumannBoundariesLocal(self, IS bndr) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCBDDCSetNeumannBoundaries(__pyx_v_self->pc, __pyx_v_bndr->iset)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 2237, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":2222 * CHKERR( PCBDDCSetDirichletBoundariesLocal(self.pc, bndr.iset) ) * * def setBDDCNeumannBoundaries(self, IS bndr) -> None: # <<<<<<<<<<<<<< * """Set the `IS` defining Neumann boundaries for the global problem. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setBDDCNeumannBoundaries", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":2239 * CHKERR( PCBDDCSetNeumannBoundaries(self.pc, bndr.iset) ) * * def setBDDCNeumannBoundariesLocal(self, IS bndr) -> None: # <<<<<<<<<<<<<< * """Set the `IS` defining Neumann boundaries in local ordering. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_207setBDDCNeumannBoundariesLocal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_206setBDDCNeumannBoundariesLocal, "PC.setBDDCNeumannBoundariesLocal(self, bndr: IS) -> None\nSet the `IS` defining Neumann boundaries in local ordering.\n\n Collective.\n\n Parameters\n ----------\n bndr\n The parallel `IS` defining Neumann boundaries in local ordering.\n\n See Also\n --------\n setBDDCNeumannBoundaries, petsc.PCBDDCSetNeumannBoundariesLocal\n\n \nSource code at petsc4py/PETSc/PC.pyx:2239"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_207setBDDCNeumannBoundariesLocal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscISObject *__pyx_v_bndr = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setBDDCNeumannBoundariesLocal (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_bndr,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_bndr)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2239, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setBDDCNeumannBoundariesLocal") < 0)) __PYX_ERR(48, 2239, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_bndr = ((struct PyPetscISObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setBDDCNeumannBoundariesLocal", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 2239, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setBDDCNeumannBoundariesLocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bndr), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "bndr", 0))) __PYX_ERR(48, 2239, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_206setBDDCNeumannBoundariesLocal(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_bndr); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_206setBDDCNeumannBoundariesLocal(struct PyPetscPCObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_bndr) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setBDDCNeumannBoundariesLocal", 1); /* "petsc4py/PETSc/PC.pyx":2254 * * """ * CHKERR( PCBDDCSetNeumannBoundariesLocal(self.pc, bndr.iset) ) # <<<<<<<<<<<<<< * * def setBDDCDofsSplitting(self, isfields: IS | Sequence[IS]) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCBDDCSetNeumannBoundariesLocal(__pyx_v_self->pc, __pyx_v_bndr->iset)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 2254, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":2239 * CHKERR( PCBDDCSetNeumannBoundaries(self.pc, bndr.iset) ) * * def setBDDCNeumannBoundariesLocal(self, IS bndr) -> None: # <<<<<<<<<<<<<< * """Set the `IS` defining Neumann boundaries in local ordering. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setBDDCNeumannBoundariesLocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":2256 * CHKERR( PCBDDCSetNeumannBoundariesLocal(self.pc, bndr.iset) ) * * def setBDDCDofsSplitting(self, isfields: IS | Sequence[IS]) -> None: # <<<<<<<<<<<<<< * """Set the index set(s) defining fields of the global matrix. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_209setBDDCDofsSplitting(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_208setBDDCDofsSplitting, "PC.setBDDCDofsSplitting(self, isfields: IS | Sequence[IS]) -> None\nSet the index set(s) defining fields of the global matrix.\n\n Collective.\n\n Parameters\n ----------\n isfields\n The sequence of `IS` describing the fields in global ordering.\n\n See Also\n --------\n petsc.PCBDDCSetDofsSplitting\n\n \nSource code at petsc4py/PETSc/PC.pyx:2256"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_209setBDDCDofsSplitting(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_isfields = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setBDDCDofsSplitting (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_isfields,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_isfields)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2256, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setBDDCDofsSplitting") < 0)) __PYX_ERR(48, 2256, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_isfields = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setBDDCDofsSplitting", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 2256, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setBDDCDofsSplitting", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_208setBDDCDofsSplitting(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_isfields); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_208setBDDCDofsSplitting(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_isfields) { Py_ssize_t __pyx_v_i; Py_ssize_t __pyx_v_n; IS *__pyx_v_cisfields; CYTHON_UNUSED PyObject *__pyx_v_tmp = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; IS __pyx_t_5; PetscErrorCode __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setBDDCDofsSplitting", 0); __Pyx_INCREF(__pyx_v_isfields); /* "petsc4py/PETSc/PC.pyx":2271 * * """ * isfields = [isfields] if isinstance(isfields, IS) else list(isfields) # <<<<<<<<<<<<<< * cdef Py_ssize_t i, n = len(isfields) * cdef PetscIS *cisfields = NULL */ __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_isfields, __pyx_ptype_8petsc4py_5PETSc_IS); if (__pyx_t_2) { __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(48, 2271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_isfields); __Pyx_GIVEREF(__pyx_v_isfields); if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_v_isfields)) __PYX_ERR(48, 2271, __pyx_L1_error); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __pyx_t_3 = PySequence_List(__pyx_v_isfields); if (unlikely(!__pyx_t_3)) __PYX_ERR(48, 2271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } __Pyx_DECREF_SET(__pyx_v_isfields, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/PC.pyx":2272 * """ * isfields = [isfields] if isinstance(isfields, IS) else list(isfields) * cdef Py_ssize_t i, n = len(isfields) # <<<<<<<<<<<<<< * cdef PetscIS *cisfields = NULL * cdef object tmp */ __pyx_t_4 = PyObject_Length(__pyx_v_isfields); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(48, 2272, __pyx_L1_error) __pyx_v_n = __pyx_t_4; /* "petsc4py/PETSc/PC.pyx":2273 * isfields = [isfields] if isinstance(isfields, IS) else list(isfields) * cdef Py_ssize_t i, n = len(isfields) * cdef PetscIS *cisfields = NULL # <<<<<<<<<<<<<< * cdef object tmp * tmp = oarray_p(empty_p(n), NULL, &cisfields) */ __pyx_v_cisfields = NULL; /* "petsc4py/PETSc/PC.pyx":2275 * cdef PetscIS *cisfields = NULL * cdef object tmp * tmp = oarray_p(empty_p(n), NULL, &cisfields) # <<<<<<<<<<<<<< * for i from 0 <= i < n: cisfields[i] = (isfields[i]).iset * CHKERR( PCBDDCSetDofsSplitting(self.pc, n, cisfields) ) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_n)); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 2275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_1, NULL, ((void **)(&__pyx_v_cisfields)))); if (unlikely(!__pyx_t_3)) __PYX_ERR(48, 2275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_tmp = __pyx_t_3; __pyx_t_3 = 0; /* "petsc4py/PETSc/PC.pyx":2276 * cdef object tmp * tmp = oarray_p(empty_p(n), NULL, &cisfields) * for i from 0 <= i < n: cisfields[i] = (isfields[i]).iset # <<<<<<<<<<<<<< * CHKERR( PCBDDCSetDofsSplitting(self.pc, n, cisfields) ) * */ __pyx_t_4 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_isfields, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(48, 2276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (!(likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(48, 2276, __pyx_L1_error) __pyx_t_5 = ((struct PyPetscISObject *)__pyx_t_3)->iset; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; (__pyx_v_cisfields[__pyx_v_i]) = __pyx_t_5; } /* "petsc4py/PETSc/PC.pyx":2277 * tmp = oarray_p(empty_p(n), NULL, &cisfields) * for i from 0 <= i < n: cisfields[i] = (isfields[i]).iset * CHKERR( PCBDDCSetDofsSplitting(self.pc, n, cisfields) ) # <<<<<<<<<<<<<< * * def setBDDCDofsSplittingLocal(self, isfields: IS | Sequence[IS]): */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCBDDCSetDofsSplitting(__pyx_v_self->pc, ((PetscInt)__pyx_v_n), __pyx_v_cisfields)); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 2277, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":2256 * CHKERR( PCBDDCSetNeumannBoundariesLocal(self.pc, bndr.iset) ) * * def setBDDCDofsSplitting(self, isfields: IS | Sequence[IS]) -> None: # <<<<<<<<<<<<<< * """Set the index set(s) defining fields of the global matrix. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.PC.setBDDCDofsSplitting", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_tmp); __Pyx_XDECREF(__pyx_v_isfields); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":2279 * CHKERR( PCBDDCSetDofsSplitting(self.pc, n, cisfields) ) * * def setBDDCDofsSplittingLocal(self, isfields: IS | Sequence[IS]): # <<<<<<<<<<<<<< * """Set the index set(s) defining fields of the local subdomain matrix. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_211setBDDCDofsSplittingLocal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_210setBDDCDofsSplittingLocal, "PC.setBDDCDofsSplittingLocal(self, isfields: IS | Sequence[IS])\nSet the index set(s) defining fields of the local subdomain matrix.\n\n Collective.\n\n Not all nodes need to be listed. Unlisted nodes will belong\n to the complement field.\n\n Parameters\n ----------\n isfields\n The sequence of `IS` describing the fields in local ordering.\n\n See Also\n --------\n petsc.PCBDDCSetDofsSplittingLocal\n\n \nSource code at petsc4py/PETSc/PC.pyx:2279"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_211setBDDCDofsSplittingLocal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_isfields = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setBDDCDofsSplittingLocal (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_isfields,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_isfields)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2279, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setBDDCDofsSplittingLocal") < 0)) __PYX_ERR(48, 2279, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_isfields = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setBDDCDofsSplittingLocal", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 2279, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setBDDCDofsSplittingLocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_210setBDDCDofsSplittingLocal(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_isfields); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_210setBDDCDofsSplittingLocal(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_isfields) { Py_ssize_t __pyx_v_i; Py_ssize_t __pyx_v_n; IS *__pyx_v_cisfields; CYTHON_UNUSED PyObject *__pyx_v_tmp = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; IS __pyx_t_5; PetscErrorCode __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setBDDCDofsSplittingLocal", 0); __Pyx_INCREF(__pyx_v_isfields); /* "petsc4py/PETSc/PC.pyx":2297 * * """ * isfields = [isfields] if isinstance(isfields, IS) else list(isfields) # <<<<<<<<<<<<<< * cdef Py_ssize_t i, n = len(isfields) * cdef PetscIS *cisfields = NULL */ __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_isfields, __pyx_ptype_8petsc4py_5PETSc_IS); if (__pyx_t_2) { __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(48, 2297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_isfields); __Pyx_GIVEREF(__pyx_v_isfields); if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_v_isfields)) __PYX_ERR(48, 2297, __pyx_L1_error); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __pyx_t_3 = PySequence_List(__pyx_v_isfields); if (unlikely(!__pyx_t_3)) __PYX_ERR(48, 2297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } __Pyx_DECREF_SET(__pyx_v_isfields, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/PC.pyx":2298 * """ * isfields = [isfields] if isinstance(isfields, IS) else list(isfields) * cdef Py_ssize_t i, n = len(isfields) # <<<<<<<<<<<<<< * cdef PetscIS *cisfields = NULL * cdef object tmp */ __pyx_t_4 = PyObject_Length(__pyx_v_isfields); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(48, 2298, __pyx_L1_error) __pyx_v_n = __pyx_t_4; /* "petsc4py/PETSc/PC.pyx":2299 * isfields = [isfields] if isinstance(isfields, IS) else list(isfields) * cdef Py_ssize_t i, n = len(isfields) * cdef PetscIS *cisfields = NULL # <<<<<<<<<<<<<< * cdef object tmp * tmp = oarray_p(empty_p(n), NULL, &cisfields) */ __pyx_v_cisfields = NULL; /* "petsc4py/PETSc/PC.pyx":2301 * cdef PetscIS *cisfields = NULL * cdef object tmp * tmp = oarray_p(empty_p(n), NULL, &cisfields) # <<<<<<<<<<<<<< * for i from 0 <= i < n: cisfields[i] = (isfields[i]).iset * CHKERR( PCBDDCSetDofsSplittingLocal(self.pc, n, cisfields) ) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_n)); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 2301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_1, NULL, ((void **)(&__pyx_v_cisfields)))); if (unlikely(!__pyx_t_3)) __PYX_ERR(48, 2301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_tmp = __pyx_t_3; __pyx_t_3 = 0; /* "petsc4py/PETSc/PC.pyx":2302 * cdef object tmp * tmp = oarray_p(empty_p(n), NULL, &cisfields) * for i from 0 <= i < n: cisfields[i] = (isfields[i]).iset # <<<<<<<<<<<<<< * CHKERR( PCBDDCSetDofsSplittingLocal(self.pc, n, cisfields) ) * */ __pyx_t_4 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_isfields, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(48, 2302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (!(likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(48, 2302, __pyx_L1_error) __pyx_t_5 = ((struct PyPetscISObject *)__pyx_t_3)->iset; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; (__pyx_v_cisfields[__pyx_v_i]) = __pyx_t_5; } /* "petsc4py/PETSc/PC.pyx":2303 * tmp = oarray_p(empty_p(n), NULL, &cisfields) * for i from 0 <= i < n: cisfields[i] = (isfields[i]).iset * CHKERR( PCBDDCSetDofsSplittingLocal(self.pc, n, cisfields) ) # <<<<<<<<<<<<<< * * # --- Patch --- */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCBDDCSetDofsSplittingLocal(__pyx_v_self->pc, ((PetscInt)__pyx_v_n), __pyx_v_cisfields)); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 2303, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":2279 * CHKERR( PCBDDCSetDofsSplitting(self.pc, n, cisfields) ) * * def setBDDCDofsSplittingLocal(self, isfields: IS | Sequence[IS]): # <<<<<<<<<<<<<< * """Set the index set(s) defining fields of the local subdomain matrix. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.PC.setBDDCDofsSplittingLocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_tmp); __Pyx_XDECREF(__pyx_v_isfields); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":2306 * * # --- Patch --- * def setPatchCellNumbering(self, Section sec not None): # <<<<<<<<<<<<<< * CHKERR( PCPatchSetCellNumbering(self.pc, sec.sec) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_213setPatchCellNumbering(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_212setPatchCellNumbering, "PC.setPatchCellNumbering(self, sec: Section)\nSource code at petsc4py/PETSc/PC.pyx:2306"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_213setPatchCellNumbering(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscSectionObject *__pyx_v_sec = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPatchCellNumbering (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sec,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sec)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2306, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setPatchCellNumbering") < 0)) __PYX_ERR(48, 2306, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_sec = ((struct PyPetscSectionObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPatchCellNumbering", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 2306, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setPatchCellNumbering", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sec), __pyx_ptype_8petsc4py_5PETSc_Section, 0, "sec", 0))) __PYX_ERR(48, 2306, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_212setPatchCellNumbering(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_sec); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_212setPatchCellNumbering(struct PyPetscPCObject *__pyx_v_self, struct PyPetscSectionObject *__pyx_v_sec) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPatchCellNumbering", 1); /* "petsc4py/PETSc/PC.pyx":2307 * # --- Patch --- * def setPatchCellNumbering(self, Section sec not None): * CHKERR( PCPatchSetCellNumbering(self.pc, sec.sec) ) # <<<<<<<<<<<<<< * * def setPatchDiscretisationInfo(self, dms, bs, */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCPatchSetCellNumbering(__pyx_v_self->pc, __pyx_v_sec->sec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 2307, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":2306 * * # --- Patch --- * def setPatchCellNumbering(self, Section sec not None): # <<<<<<<<<<<<<< * CHKERR( PCPatchSetCellNumbering(self.pc, sec.sec) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setPatchCellNumbering", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":2309 * CHKERR( PCPatchSetCellNumbering(self.pc, sec.sec) ) * * def setPatchDiscretisationInfo(self, dms, bs, # <<<<<<<<<<<<<< * cellNodeMaps, * subspaceOffsets, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_215setPatchDiscretisationInfo(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_214setPatchDiscretisationInfo, "PC.setPatchDiscretisationInfo(self, dms, bs, cellNodeMaps, subspaceOffsets, ghostBcNodes, globalBcNodes)\nSource code at petsc4py/PETSc/PC.pyx:2309"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_215setPatchDiscretisationInfo(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_dms = 0; PyObject *__pyx_v_bs = 0; PyObject *__pyx_v_cellNodeMaps = 0; PyObject *__pyx_v_subspaceOffsets = 0; PyObject *__pyx_v_ghostBcNodes = 0; PyObject *__pyx_v_globalBcNodes = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[6] = {0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPatchDiscretisationInfo (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dms,&__pyx_n_s_bs,&__pyx_n_s_cellNodeMaps,&__pyx_n_s_subspaceOffsets,&__pyx_n_s_ghostBcNodes,&__pyx_n_s_globalBcNodes,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dms)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2309, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_bs)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2309, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setPatchDiscretisationInfo", 1, 6, 6, 1); __PYX_ERR(48, 2309, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_cellNodeMaps)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2309, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setPatchDiscretisationInfo", 1, 6, 6, 2); __PYX_ERR(48, 2309, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_subspaceOffsets)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2309, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setPatchDiscretisationInfo", 1, 6, 6, 3); __PYX_ERR(48, 2309, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ghostBcNodes)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2309, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setPatchDiscretisationInfo", 1, 6, 6, 4); __PYX_ERR(48, 2309, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_globalBcNodes)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2309, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setPatchDiscretisationInfo", 1, 6, 6, 5); __PYX_ERR(48, 2309, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setPatchDiscretisationInfo") < 0)) __PYX_ERR(48, 2309, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 6)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); } __pyx_v_dms = values[0]; __pyx_v_bs = values[1]; __pyx_v_cellNodeMaps = values[2]; __pyx_v_subspaceOffsets = values[3]; __pyx_v_ghostBcNodes = values[4]; __pyx_v_globalBcNodes = values[5]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPatchDiscretisationInfo", 1, 6, 6, __pyx_nargs); __PYX_ERR(48, 2309, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setPatchDiscretisationInfo", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_214setPatchDiscretisationInfo(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_dms, __pyx_v_bs, __pyx_v_cellNodeMaps, __pyx_v_subspaceOffsets, __pyx_v_ghostBcNodes, __pyx_v_globalBcNodes); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_214setPatchDiscretisationInfo(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_dms, PyObject *__pyx_v_bs, PyObject *__pyx_v_cellNodeMaps, PyObject *__pyx_v_subspaceOffsets, PyObject *__pyx_v_ghostBcNodes, PyObject *__pyx_v_globalBcNodes) { PetscInt __pyx_v_numSubSpaces; PetscInt __pyx_v_numGhostBcs; PetscInt __pyx_v_numGlobalBcs; PetscInt *__pyx_v_nodesPerCell; PetscInt const **__pyx_v_ccellNodeMaps; DM *__pyx_v_cdms; PetscInt *__pyx_v_cbs; PetscInt *__pyx_v_csubspaceOffsets; PetscInt *__pyx_v_cghostBcNodes; PetscInt *__pyx_v_cglobalBcNodes; PetscInt __pyx_v_i; CYTHON_UNUSED PyObject *__pyx_v__ = NULL; PyObject *__pyx_v_nodes = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; PetscInt __pyx_t_3; PetscInt __pyx_t_4; PetscInt __pyx_t_5; DM __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *(*__pyx_t_10)(PyObject *); PetscInt __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPatchDiscretisationInfo", 0); __Pyx_INCREF(__pyx_v_bs); __Pyx_INCREF(__pyx_v_subspaceOffsets); __Pyx_INCREF(__pyx_v_ghostBcNodes); __Pyx_INCREF(__pyx_v_globalBcNodes); /* "petsc4py/PETSc/PC.pyx":2314 * ghostBcNodes, * globalBcNodes): * cdef PetscInt numSubSpaces = 0 # <<<<<<<<<<<<<< * cdef PetscInt numGhostBcs = 0, numGlobalBcs = 0 * cdef PetscInt *nodesPerCell = NULL */ __pyx_v_numSubSpaces = 0; /* "petsc4py/PETSc/PC.pyx":2315 * globalBcNodes): * cdef PetscInt numSubSpaces = 0 * cdef PetscInt numGhostBcs = 0, numGlobalBcs = 0 # <<<<<<<<<<<<<< * cdef PetscInt *nodesPerCell = NULL * cdef const PetscInt **ccellNodeMaps = NULL */ __pyx_v_numGhostBcs = 0; __pyx_v_numGlobalBcs = 0; /* "petsc4py/PETSc/PC.pyx":2316 * cdef PetscInt numSubSpaces = 0 * cdef PetscInt numGhostBcs = 0, numGlobalBcs = 0 * cdef PetscInt *nodesPerCell = NULL # <<<<<<<<<<<<<< * cdef const PetscInt **ccellNodeMaps = NULL * cdef PetscDM *cdms = NULL */ __pyx_v_nodesPerCell = NULL; /* "petsc4py/PETSc/PC.pyx":2317 * cdef PetscInt numGhostBcs = 0, numGlobalBcs = 0 * cdef PetscInt *nodesPerCell = NULL * cdef const PetscInt **ccellNodeMaps = NULL # <<<<<<<<<<<<<< * cdef PetscDM *cdms = NULL * cdef PetscInt *cbs = NULL */ __pyx_v_ccellNodeMaps = NULL; /* "petsc4py/PETSc/PC.pyx":2318 * cdef PetscInt *nodesPerCell = NULL * cdef const PetscInt **ccellNodeMaps = NULL * cdef PetscDM *cdms = NULL # <<<<<<<<<<<<<< * cdef PetscInt *cbs = NULL * cdef PetscInt *csubspaceOffsets = NULL */ __pyx_v_cdms = NULL; /* "petsc4py/PETSc/PC.pyx":2319 * cdef const PetscInt **ccellNodeMaps = NULL * cdef PetscDM *cdms = NULL * cdef PetscInt *cbs = NULL # <<<<<<<<<<<<<< * cdef PetscInt *csubspaceOffsets = NULL * cdef PetscInt *cghostBcNodes = NULL */ __pyx_v_cbs = NULL; /* "petsc4py/PETSc/PC.pyx":2320 * cdef PetscDM *cdms = NULL * cdef PetscInt *cbs = NULL * cdef PetscInt *csubspaceOffsets = NULL # <<<<<<<<<<<<<< * cdef PetscInt *cghostBcNodes = NULL * cdef PetscInt *cglobalBcNodes = NULL */ __pyx_v_csubspaceOffsets = NULL; /* "petsc4py/PETSc/PC.pyx":2321 * cdef PetscInt *cbs = NULL * cdef PetscInt *csubspaceOffsets = NULL * cdef PetscInt *cghostBcNodes = NULL # <<<<<<<<<<<<<< * cdef PetscInt *cglobalBcNodes = NULL * cdef PetscInt i = 0 */ __pyx_v_cghostBcNodes = NULL; /* "petsc4py/PETSc/PC.pyx":2322 * cdef PetscInt *csubspaceOffsets = NULL * cdef PetscInt *cghostBcNodes = NULL * cdef PetscInt *cglobalBcNodes = NULL # <<<<<<<<<<<<<< * cdef PetscInt i = 0 * */ __pyx_v_cglobalBcNodes = NULL; /* "petsc4py/PETSc/PC.pyx":2323 * cdef PetscInt *cghostBcNodes = NULL * cdef PetscInt *cglobalBcNodes = NULL * cdef PetscInt i = 0 # <<<<<<<<<<<<<< * * bs = iarray_i(bs, &numSubSpaces, &cbs) */ __pyx_v_i = 0; /* "petsc4py/PETSc/PC.pyx":2325 * cdef PetscInt i = 0 * * bs = iarray_i(bs, &numSubSpaces, &cbs) # <<<<<<<<<<<<<< * ghostBcNodes = iarray_i(ghostBcNodes, &numGhostBcs, &cghostBcNodes) * globalBcNodes = iarray_i(globalBcNodes, &numGlobalBcs, &cglobalBcNodes) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_bs, (&__pyx_v_numSubSpaces), (&__pyx_v_cbs))); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 2325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_bs, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/PC.pyx":2326 * * bs = iarray_i(bs, &numSubSpaces, &cbs) * ghostBcNodes = iarray_i(ghostBcNodes, &numGhostBcs, &cghostBcNodes) # <<<<<<<<<<<<<< * globalBcNodes = iarray_i(globalBcNodes, &numGlobalBcs, &cglobalBcNodes) * subspaceOffsets = iarray_i(subspaceOffsets, NULL, &csubspaceOffsets) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_ghostBcNodes, (&__pyx_v_numGhostBcs), (&__pyx_v_cghostBcNodes))); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 2326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_ghostBcNodes, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/PC.pyx":2327 * bs = iarray_i(bs, &numSubSpaces, &cbs) * ghostBcNodes = iarray_i(ghostBcNodes, &numGhostBcs, &cghostBcNodes) * globalBcNodes = iarray_i(globalBcNodes, &numGlobalBcs, &cglobalBcNodes) # <<<<<<<<<<<<<< * subspaceOffsets = iarray_i(subspaceOffsets, NULL, &csubspaceOffsets) * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_globalBcNodes, (&__pyx_v_numGlobalBcs), (&__pyx_v_cglobalBcNodes))); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 2327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_globalBcNodes, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/PC.pyx":2328 * ghostBcNodes = iarray_i(ghostBcNodes, &numGhostBcs, &cghostBcNodes) * globalBcNodes = iarray_i(globalBcNodes, &numGlobalBcs, &cglobalBcNodes) * subspaceOffsets = iarray_i(subspaceOffsets, NULL, &csubspaceOffsets) # <<<<<<<<<<<<<< * * CHKERR( PetscMalloc(numSubSpaces*sizeof(PetscInt), &nodesPerCell) ) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_subspaceOffsets, NULL, (&__pyx_v_csubspaceOffsets))); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 2328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_subspaceOffsets, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/PC.pyx":2330 * subspaceOffsets = iarray_i(subspaceOffsets, NULL, &csubspaceOffsets) * * CHKERR( PetscMalloc(numSubSpaces*sizeof(PetscInt), &nodesPerCell) ) # <<<<<<<<<<<<<< * CHKERR( PetscMalloc(numSubSpaces*sizeof(PetscDM), &cdms) ) * CHKERR( PetscMalloc(numSubSpaces*sizeof(PetscInt*), &ccellNodeMaps) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((((size_t)__pyx_v_numSubSpaces) * (sizeof(PetscInt))), (&__pyx_v_nodesPerCell))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 2330, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":2331 * * CHKERR( PetscMalloc(numSubSpaces*sizeof(PetscInt), &nodesPerCell) ) * CHKERR( PetscMalloc(numSubSpaces*sizeof(PetscDM), &cdms) ) # <<<<<<<<<<<<<< * CHKERR( PetscMalloc(numSubSpaces*sizeof(PetscInt*), &ccellNodeMaps) ) * for i in range(numSubSpaces): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((((size_t)__pyx_v_numSubSpaces) * (sizeof(DM))), (&__pyx_v_cdms))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 2331, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":2332 * CHKERR( PetscMalloc(numSubSpaces*sizeof(PetscInt), &nodesPerCell) ) * CHKERR( PetscMalloc(numSubSpaces*sizeof(PetscDM), &cdms) ) * CHKERR( PetscMalloc(numSubSpaces*sizeof(PetscInt*), &ccellNodeMaps) ) # <<<<<<<<<<<<<< * for i in range(numSubSpaces): * cdms[i] = (dms[i]).dm */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((((size_t)__pyx_v_numSubSpaces) * (sizeof(PetscInt *))), (&__pyx_v_ccellNodeMaps))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 2332, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":2333 * CHKERR( PetscMalloc(numSubSpaces*sizeof(PetscDM), &cdms) ) * CHKERR( PetscMalloc(numSubSpaces*sizeof(PetscInt*), &ccellNodeMaps) ) * for i in range(numSubSpaces): # <<<<<<<<<<<<<< * cdms[i] = (dms[i]).dm * _, nodes = asarray(cellNodeMaps[i]).shape */ __pyx_t_3 = __pyx_v_numSubSpaces; __pyx_t_4 = __pyx_t_3; for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { __pyx_v_i = __pyx_t_5; /* "petsc4py/PETSc/PC.pyx":2334 * CHKERR( PetscMalloc(numSubSpaces*sizeof(PetscInt*), &ccellNodeMaps) ) * for i in range(numSubSpaces): * cdms[i] = (dms[i]).dm # <<<<<<<<<<<<<< * _, nodes = asarray(cellNodeMaps[i]).shape * cellNodeMaps[i] = iarray_i(cellNodeMaps[i], NULL, &(ccellNodeMaps[i])) */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_dms, __pyx_v_i, PetscInt, 1, __Pyx_PyInt_From_PetscInt, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 2334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_DM)))) __PYX_ERR(48, 2334, __pyx_L1_error) __pyx_t_6 = ((struct PyPetscDMObject *)__pyx_t_1)->dm; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; (__pyx_v_cdms[__pyx_v_i]) = __pyx_t_6; /* "petsc4py/PETSc/PC.pyx":2335 * for i in range(numSubSpaces): * cdms[i] = (dms[i]).dm * _, nodes = asarray(cellNodeMaps[i]).shape # <<<<<<<<<<<<<< * cellNodeMaps[i] = iarray_i(cellNodeMaps[i], NULL, &(ccellNodeMaps[i])) * nodesPerCell[i] = asInt(nodes) */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_cellNodeMaps, __pyx_v_i, PetscInt, 1, __Pyx_PyInt_From_PetscInt, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 2335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_asarray(__pyx_t_1)); if (unlikely(!__pyx_t_7)) __PYX_ERR(48, 2335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 2335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(48, 2335, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_7 = PyList_GET_ITEM(sequence, 0); __pyx_t_8 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); #else __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(48, 2335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(48, 2335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(48, 2335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_10 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); index = 0; __pyx_t_7 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_7)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_7); index = 1; __pyx_t_8 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(48, 2335, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(48, 2335, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v__, __pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF_SET(__pyx_v_nodes, __pyx_t_8); __pyx_t_8 = 0; /* "petsc4py/PETSc/PC.pyx":2336 * cdms[i] = (dms[i]).dm * _, nodes = asarray(cellNodeMaps[i]).shape * cellNodeMaps[i] = iarray_i(cellNodeMaps[i], NULL, &(ccellNodeMaps[i])) # <<<<<<<<<<<<<< * nodesPerCell[i] = asInt(nodes) * */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_cellNodeMaps, __pyx_v_i, PetscInt, 1, __Pyx_PyInt_From_PetscInt, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 2336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_t_1, NULL, ((PetscInt **)(&(__pyx_v_ccellNodeMaps[__pyx_v_i]))))); if (unlikely(!__pyx_t_8)) __PYX_ERR(48, 2336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely((__Pyx_SetItemInt(__pyx_v_cellNodeMaps, __pyx_v_i, __pyx_t_8, PetscInt, 1, __Pyx_PyInt_From_PetscInt, 0, 1, 1) < 0))) __PYX_ERR(48, 2336, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "petsc4py/PETSc/PC.pyx":2337 * _, nodes = asarray(cellNodeMaps[i]).shape * cellNodeMaps[i] = iarray_i(cellNodeMaps[i], NULL, &(ccellNodeMaps[i])) * nodesPerCell[i] = asInt(nodes) # <<<<<<<<<<<<<< * * # TODO: refactor on the PETSc side to take ISes? */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_nodes); if (unlikely(__pyx_t_11 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 2337, __pyx_L1_error) (__pyx_v_nodesPerCell[__pyx_v_i]) = __pyx_t_11; } /* "petsc4py/PETSc/PC.pyx":2340 * * # TODO: refactor on the PETSc side to take ISes? * CHKERR( PCPatchSetDiscretisationInfo(self.pc, numSubSpaces, # <<<<<<<<<<<<<< * cdms, cbs, nodesPerCell, * ccellNodeMaps, csubspaceOffsets, */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCPatchSetDiscretisationInfo(__pyx_v_self->pc, __pyx_v_numSubSpaces, __pyx_v_cdms, __pyx_v_cbs, __pyx_v_nodesPerCell, __pyx_v_ccellNodeMaps, __pyx_v_csubspaceOffsets, __pyx_v_numGhostBcs, __pyx_v_cghostBcNodes, __pyx_v_numGlobalBcs, __pyx_v_cglobalBcNodes)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 2340, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":2345 * numGhostBcs, cghostBcNodes, * numGlobalBcs, cglobalBcNodes) ) * CHKERR( PetscFree(nodesPerCell) ) # <<<<<<<<<<<<<< * CHKERR( PetscFree(cdms) ) * CHKERR( PetscFree(ccellNodeMaps) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_nodesPerCell)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 2345, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":2346 * numGlobalBcs, cglobalBcNodes) ) * CHKERR( PetscFree(nodesPerCell) ) * CHKERR( PetscFree(cdms) ) # <<<<<<<<<<<<<< * CHKERR( PetscFree(ccellNodeMaps) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_cdms)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 2346, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":2347 * CHKERR( PetscFree(nodesPerCell) ) * CHKERR( PetscFree(cdms) ) * CHKERR( PetscFree(ccellNodeMaps) ) # <<<<<<<<<<<<<< * * def setPatchComputeOperator(self, operator, args=None, kargs=None): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_ccellNodeMaps)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 2347, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":2309 * CHKERR( PCPatchSetCellNumbering(self.pc, sec.sec) ) * * def setPatchDiscretisationInfo(self, dms, bs, # <<<<<<<<<<<<<< * cellNodeMaps, * subspaceOffsets, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("petsc4py.PETSc.PC.setPatchDiscretisationInfo", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v__); __Pyx_XDECREF(__pyx_v_nodes); __Pyx_XDECREF(__pyx_v_bs); __Pyx_XDECREF(__pyx_v_subspaceOffsets); __Pyx_XDECREF(__pyx_v_ghostBcNodes); __Pyx_XDECREF(__pyx_v_globalBcNodes); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":2349 * CHKERR( PetscFree(ccellNodeMaps) ) * * def setPatchComputeOperator(self, operator, args=None, kargs=None): # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_217setPatchComputeOperator(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_216setPatchComputeOperator, "PC.setPatchComputeOperator(self, operator, args=None, kargs=None)\nSource code at petsc4py/PETSc/PC.pyx:2349"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_217setPatchComputeOperator(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_operator = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPatchComputeOperator (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_operator,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_operator)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2349, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2349, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2349, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setPatchComputeOperator") < 0)) __PYX_ERR(48, 2349, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_operator = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPatchComputeOperator", 0, 1, 3, __pyx_nargs); __PYX_ERR(48, 2349, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setPatchComputeOperator", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_216setPatchComputeOperator(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_operator, __pyx_v_args, __pyx_v_kargs); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_216setPatchComputeOperator(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_operator, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPatchComputeOperator", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/PC.pyx":2350 * * def setPatchComputeOperator(self, operator, args=None, kargs=None): * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (operator, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/PC.pyx":2351 * def setPatchComputeOperator(self, operator, args=None, kargs=None): * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (operator, args, kargs) * self.set_attr("__patch_compute_operator__", context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); if (__pyx_t_1) { __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 2351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_2); __pyx_t_2 = 0; } /* "petsc4py/PETSc/PC.pyx":2352 * if args is None: args = () * if kargs is None: kargs = {} * context = (operator, args, kargs) # <<<<<<<<<<<<<< * self.set_attr("__patch_compute_operator__", context) * CHKERR( PCPatchSetComputeOperator(self.pc, PCPatch_ComputeOperator, context) ) */ __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 2352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_operator); __Pyx_GIVEREF(__pyx_v_operator); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_operator)) __PYX_ERR(48, 2352, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_args)) __PYX_ERR(48, 2352, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_kargs)) __PYX_ERR(48, 2352, __pyx_L1_error); __pyx_v_context = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/PC.pyx":2353 * if kargs is None: kargs = {} * context = (operator, args, kargs) * self.set_attr("__patch_compute_operator__", context) # <<<<<<<<<<<<<< * CHKERR( PCPatchSetComputeOperator(self.pc, PCPatch_ComputeOperator, context) ) * */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_PC *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__patch_compute_operator__"), __pyx_v_context); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 2353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/PC.pyx":2354 * context = (operator, args, kargs) * self.set_attr("__patch_compute_operator__", context) * CHKERR( PCPatchSetComputeOperator(self.pc, PCPatch_ComputeOperator, context) ) # <<<<<<<<<<<<<< * * def setPatchComputeOperatorInteriorFacets(self, operator, args=None, kargs=None): */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCPatchSetComputeOperator(__pyx_v_self->pc, __pyx_f_8petsc4py_5PETSc_PCPatch_ComputeOperator, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 2354, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":2349 * CHKERR( PetscFree(ccellNodeMaps) ) * * def setPatchComputeOperator(self, operator, args=None, kargs=None): # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.PC.setPatchComputeOperator", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":2356 * CHKERR( PCPatchSetComputeOperator(self.pc, PCPatch_ComputeOperator, context) ) * * def setPatchComputeOperatorInteriorFacets(self, operator, args=None, kargs=None): # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_219setPatchComputeOperatorInteriorFacets(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_218setPatchComputeOperatorInteriorFacets, "PC.setPatchComputeOperatorInteriorFacets(self, operator, args=None, kargs=None)\nSource code at petsc4py/PETSc/PC.pyx:2356"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_219setPatchComputeOperatorInteriorFacets(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_operator = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPatchComputeOperatorInteriorFacets (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_operator,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_operator)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2356, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2356, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2356, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setPatchComputeOperatorInteriorFacets") < 0)) __PYX_ERR(48, 2356, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_operator = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPatchComputeOperatorInteriorFacets", 0, 1, 3, __pyx_nargs); __PYX_ERR(48, 2356, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setPatchComputeOperatorInteriorFacets", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_218setPatchComputeOperatorInteriorFacets(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_operator, __pyx_v_args, __pyx_v_kargs); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_218setPatchComputeOperatorInteriorFacets(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_operator, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPatchComputeOperatorInteriorFacets", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/PC.pyx":2357 * * def setPatchComputeOperatorInteriorFacets(self, operator, args=None, kargs=None): * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (operator, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/PC.pyx":2358 * def setPatchComputeOperatorInteriorFacets(self, operator, args=None, kargs=None): * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (operator, args, kargs) * self.set_attr("__patch_compute_operator_interior_facets__", context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); if (__pyx_t_1) { __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 2358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_2); __pyx_t_2 = 0; } /* "petsc4py/PETSc/PC.pyx":2359 * if args is None: args = () * if kargs is None: kargs = {} * context = (operator, args, kargs) # <<<<<<<<<<<<<< * self.set_attr("__patch_compute_operator_interior_facets__", context) * CHKERR( PCPatchSetComputeOperatorInteriorFacets(self.pc, PCPatch_ComputeOperatorInteriorFacets, context) ) */ __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 2359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_operator); __Pyx_GIVEREF(__pyx_v_operator); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_operator)) __PYX_ERR(48, 2359, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_args)) __PYX_ERR(48, 2359, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_kargs)) __PYX_ERR(48, 2359, __pyx_L1_error); __pyx_v_context = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/PC.pyx":2360 * if kargs is None: kargs = {} * context = (operator, args, kargs) * self.set_attr("__patch_compute_operator_interior_facets__", context) # <<<<<<<<<<<<<< * CHKERR( PCPatchSetComputeOperatorInteriorFacets(self.pc, PCPatch_ComputeOperatorInteriorFacets, context) ) * */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_PC *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__patch_compute_operator_interior_facets__"), __pyx_v_context); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 2360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/PC.pyx":2361 * context = (operator, args, kargs) * self.set_attr("__patch_compute_operator_interior_facets__", context) * CHKERR( PCPatchSetComputeOperatorInteriorFacets(self.pc, PCPatch_ComputeOperatorInteriorFacets, context) ) # <<<<<<<<<<<<<< * * def setPatchComputeFunction(self, function, args=None, kargs=None): */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCPatchSetComputeOperatorInteriorFacets(__pyx_v_self->pc, __pyx_f_8petsc4py_5PETSc_PCPatch_ComputeOperatorInteriorFacets, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 2361, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":2356 * CHKERR( PCPatchSetComputeOperator(self.pc, PCPatch_ComputeOperator, context) ) * * def setPatchComputeOperatorInteriorFacets(self, operator, args=None, kargs=None): # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.PC.setPatchComputeOperatorInteriorFacets", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":2363 * CHKERR( PCPatchSetComputeOperatorInteriorFacets(self.pc, PCPatch_ComputeOperatorInteriorFacets, context) ) * * def setPatchComputeFunction(self, function, args=None, kargs=None): # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_221setPatchComputeFunction(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_220setPatchComputeFunction, "PC.setPatchComputeFunction(self, function, args=None, kargs=None)\nSource code at petsc4py/PETSc/PC.pyx:2363"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_221setPatchComputeFunction(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_function = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPatchComputeFunction (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_function,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_function)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2363, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2363, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2363, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setPatchComputeFunction") < 0)) __PYX_ERR(48, 2363, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_function = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPatchComputeFunction", 0, 1, 3, __pyx_nargs); __PYX_ERR(48, 2363, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setPatchComputeFunction", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_220setPatchComputeFunction(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_function, __pyx_v_args, __pyx_v_kargs); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_220setPatchComputeFunction(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_function, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPatchComputeFunction", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/PC.pyx":2364 * * def setPatchComputeFunction(self, function, args=None, kargs=None): * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (function, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/PC.pyx":2365 * def setPatchComputeFunction(self, function, args=None, kargs=None): * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (function, args, kargs) * self.set_attr("__patch_compute_function__", context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); if (__pyx_t_1) { __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 2365, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_2); __pyx_t_2 = 0; } /* "petsc4py/PETSc/PC.pyx":2366 * if args is None: args = () * if kargs is None: kargs = {} * context = (function, args, kargs) # <<<<<<<<<<<<<< * self.set_attr("__patch_compute_function__", context) * CHKERR( PCPatchSetComputeFunction(self.pc, PCPatch_ComputeFunction, context) ) */ __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 2366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_function); __Pyx_GIVEREF(__pyx_v_function); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_function)) __PYX_ERR(48, 2366, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_args)) __PYX_ERR(48, 2366, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_kargs)) __PYX_ERR(48, 2366, __pyx_L1_error); __pyx_v_context = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/PC.pyx":2367 * if kargs is None: kargs = {} * context = (function, args, kargs) * self.set_attr("__patch_compute_function__", context) # <<<<<<<<<<<<<< * CHKERR( PCPatchSetComputeFunction(self.pc, PCPatch_ComputeFunction, context) ) * */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_PC *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__patch_compute_function__"), __pyx_v_context); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 2367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/PC.pyx":2368 * context = (function, args, kargs) * self.set_attr("__patch_compute_function__", context) * CHKERR( PCPatchSetComputeFunction(self.pc, PCPatch_ComputeFunction, context) ) # <<<<<<<<<<<<<< * * def setPatchComputeFunctionInteriorFacets(self, function, args=None, kargs=None): */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCPatchSetComputeFunction(__pyx_v_self->pc, __pyx_f_8petsc4py_5PETSc_PCPatch_ComputeFunction, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 2368, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":2363 * CHKERR( PCPatchSetComputeOperatorInteriorFacets(self.pc, PCPatch_ComputeOperatorInteriorFacets, context) ) * * def setPatchComputeFunction(self, function, args=None, kargs=None): # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.PC.setPatchComputeFunction", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":2370 * CHKERR( PCPatchSetComputeFunction(self.pc, PCPatch_ComputeFunction, context) ) * * def setPatchComputeFunctionInteriorFacets(self, function, args=None, kargs=None): # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_223setPatchComputeFunctionInteriorFacets(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_222setPatchComputeFunctionInteriorFacets, "PC.setPatchComputeFunctionInteriorFacets(self, function, args=None, kargs=None)\nSource code at petsc4py/PETSc/PC.pyx:2370"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_223setPatchComputeFunctionInteriorFacets(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_function = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPatchComputeFunctionInteriorFacets (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_function,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_function)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2370, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2370, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2370, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setPatchComputeFunctionInteriorFacets") < 0)) __PYX_ERR(48, 2370, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_function = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPatchComputeFunctionInteriorFacets", 0, 1, 3, __pyx_nargs); __PYX_ERR(48, 2370, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setPatchComputeFunctionInteriorFacets", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_222setPatchComputeFunctionInteriorFacets(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_function, __pyx_v_args, __pyx_v_kargs); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_222setPatchComputeFunctionInteriorFacets(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_function, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPatchComputeFunctionInteriorFacets", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/PC.pyx":2371 * * def setPatchComputeFunctionInteriorFacets(self, function, args=None, kargs=None): * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (function, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/PC.pyx":2372 * def setPatchComputeFunctionInteriorFacets(self, function, args=None, kargs=None): * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (function, args, kargs) * self.set_attr("__patch_compute_function_interior_facets__", context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); if (__pyx_t_1) { __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 2372, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_2); __pyx_t_2 = 0; } /* "petsc4py/PETSc/PC.pyx":2373 * if args is None: args = () * if kargs is None: kargs = {} * context = (function, args, kargs) # <<<<<<<<<<<<<< * self.set_attr("__patch_compute_function_interior_facets__", context) * CHKERR( PCPatchSetComputeFunction(self.pc, PCPatch_ComputeFunctionInteriorFacets, context) ) */ __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 2373, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_function); __Pyx_GIVEREF(__pyx_v_function); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_function)) __PYX_ERR(48, 2373, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_args)) __PYX_ERR(48, 2373, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_kargs)) __PYX_ERR(48, 2373, __pyx_L1_error); __pyx_v_context = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/PC.pyx":2374 * if kargs is None: kargs = {} * context = (function, args, kargs) * self.set_attr("__patch_compute_function_interior_facets__", context) # <<<<<<<<<<<<<< * CHKERR( PCPatchSetComputeFunction(self.pc, PCPatch_ComputeFunctionInteriorFacets, context) ) * */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_PC *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__patch_compute_function_interior_facets__"), __pyx_v_context); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 2374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/PC.pyx":2375 * context = (function, args, kargs) * self.set_attr("__patch_compute_function_interior_facets__", context) * CHKERR( PCPatchSetComputeFunction(self.pc, PCPatch_ComputeFunctionInteriorFacets, context) ) # <<<<<<<<<<<<<< * * def setPatchConstructType(self, typ, operator=None, args=None, kargs=None): */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCPatchSetComputeFunction(__pyx_v_self->pc, __pyx_f_8petsc4py_5PETSc_PCPatch_ComputeFunctionInteriorFacets, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 2375, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":2370 * CHKERR( PCPatchSetComputeFunction(self.pc, PCPatch_ComputeFunction, context) ) * * def setPatchComputeFunctionInteriorFacets(self, function, args=None, kargs=None): # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.PC.setPatchComputeFunctionInteriorFacets", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":2377 * CHKERR( PCPatchSetComputeFunction(self.pc, PCPatch_ComputeFunctionInteriorFacets, context) ) * * def setPatchConstructType(self, typ, operator=None, args=None, kargs=None): # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_225setPatchConstructType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_224setPatchConstructType, "PC.setPatchConstructType(self, typ, operator=None, args=None, kargs=None)\nSource code at petsc4py/PETSc/PC.pyx:2377"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_225setPatchConstructType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_typ = 0; PyObject *__pyx_v_operator = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPatchConstructType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_typ,&__pyx_n_s_operator,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_typ)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2377, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_operator); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2377, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2377, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2377, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setPatchConstructType") < 0)) __PYX_ERR(48, 2377, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_typ = values[0]; __pyx_v_operator = values[1]; __pyx_v_args = values[2]; __pyx_v_kargs = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPatchConstructType", 0, 1, 4, __pyx_nargs); __PYX_ERR(48, 2377, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setPatchConstructType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_224setPatchConstructType(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_typ, __pyx_v_operator, __pyx_v_args, __pyx_v_kargs); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_224setPatchConstructType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_typ, PyObject *__pyx_v_operator, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; PCPatchConstructType __pyx_t_7; PetscErrorCode __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPatchConstructType", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/PC.pyx":2378 * * def setPatchConstructType(self, typ, operator=None, args=None, kargs=None): * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * */ __pyx_t_1 = (__pyx_v_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/PC.pyx":2379 * def setPatchConstructType(self, typ, operator=None, args=None, kargs=None): * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * * if typ in {PC.PatchConstructType.PYTHON, PC.PatchConstructType.USER} and operator is None: */ __pyx_t_1 = (__pyx_v_kargs == Py_None); if (__pyx_t_1) { __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 2379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_2); __pyx_t_2 = 0; } /* "petsc4py/PETSc/PC.pyx":2381 * if kargs is None: kargs = {} * * if typ in {PC.PatchConstructType.PYTHON, PC.PatchConstructType.USER} and operator is None: # <<<<<<<<<<<<<< * raise ValueError("Must provide operator for USER or PYTHON type") * if operator is not None: */ __Pyx_INCREF(__pyx_v_typ); __pyx_t_2 = __pyx_v_typ; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_PC), __pyx_n_s_PatchConstructType); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 2381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_PYTHON); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 2381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 2381, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(48, 2381, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!__pyx_t_6) { } else { __pyx_t_3 = __pyx_t_6; goto __pyx_L8_bool_binop_done; } __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_PC), __pyx_n_s_PatchConstructType); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 2381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_USER); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 2381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 2381, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(48, 2381, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = __pyx_t_6; __pyx_L8_bool_binop_done:; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_6 = __pyx_t_3; if (__pyx_t_6) { } else { __pyx_t_1 = __pyx_t_6; goto __pyx_L6_bool_binop_done; } __pyx_t_6 = (__pyx_v_operator == Py_None); __pyx_t_1 = __pyx_t_6; __pyx_L6_bool_binop_done:; if (unlikely(__pyx_t_1)) { /* "petsc4py/PETSc/PC.pyx":2382 * * if typ in {PC.PatchConstructType.PYTHON, PC.PatchConstructType.USER} and operator is None: * raise ValueError("Must provide operator for USER or PYTHON type") # <<<<<<<<<<<<<< * if operator is not None: * context = (operator, args, kargs) */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 2382, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(48, 2382, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":2381 * if kargs is None: kargs = {} * * if typ in {PC.PatchConstructType.PYTHON, PC.PatchConstructType.USER} and operator is None: # <<<<<<<<<<<<<< * raise ValueError("Must provide operator for USER or PYTHON type") * if operator is not None: */ } /* "petsc4py/PETSc/PC.pyx":2383 * if typ in {PC.PatchConstructType.PYTHON, PC.PatchConstructType.USER} and operator is None: * raise ValueError("Must provide operator for USER or PYTHON type") * if operator is not None: # <<<<<<<<<<<<<< * context = (operator, args, kargs) * else: */ __pyx_t_1 = (__pyx_v_operator != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/PC.pyx":2384 * raise ValueError("Must provide operator for USER or PYTHON type") * if operator is not None: * context = (operator, args, kargs) # <<<<<<<<<<<<<< * else: * context = None */ __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 2384, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_operator); __Pyx_GIVEREF(__pyx_v_operator); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_operator)) __PYX_ERR(48, 2384, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_args)) __PYX_ERR(48, 2384, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_kargs)) __PYX_ERR(48, 2384, __pyx_L1_error); __pyx_v_context = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/PC.pyx":2383 * if typ in {PC.PatchConstructType.PYTHON, PC.PatchConstructType.USER} and operator is None: * raise ValueError("Must provide operator for USER or PYTHON type") * if operator is not None: # <<<<<<<<<<<<<< * context = (operator, args, kargs) * else: */ goto __pyx_L10; } /* "petsc4py/PETSc/PC.pyx":2386 * context = (operator, args, kargs) * else: * context = None # <<<<<<<<<<<<<< * self.set_attr("__patch_construction_operator__", context) * CHKERR( PCPatchSetConstructType(self.pc, typ, PCPatch_UserConstructOperator, context) ) */ /*else*/ { __Pyx_INCREF(Py_None); __pyx_v_context = ((PyObject*)Py_None); } __pyx_L10:; /* "petsc4py/PETSc/PC.pyx":2387 * else: * context = None * self.set_attr("__patch_construction_operator__", context) # <<<<<<<<<<<<<< * CHKERR( PCPatchSetConstructType(self.pc, typ, PCPatch_UserConstructOperator, context) ) * */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_PC *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__patch_construction_operator__"), __pyx_v_context); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 2387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/PC.pyx":2388 * context = None * self.set_attr("__patch_construction_operator__", context) * CHKERR( PCPatchSetConstructType(self.pc, typ, PCPatch_UserConstructOperator, context) ) # <<<<<<<<<<<<<< * * # --- HPDDM --- */ __pyx_t_7 = ((PCPatchConstructType)__Pyx_PyInt_As_PCPatchConstructType(__pyx_v_typ)); if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2388, __pyx_L1_error) __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCPatchSetConstructType(__pyx_v_self->pc, __pyx_t_7, __pyx_f_8petsc4py_5PETSc_PCPatch_UserConstructOperator, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 2388, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":2377 * CHKERR( PCPatchSetComputeFunction(self.pc, PCPatch_ComputeFunctionInteriorFacets, context) ) * * def setPatchConstructType(self, typ, operator=None, args=None, kargs=None): # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.PC.setPatchConstructType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":2392 * # --- HPDDM --- * * def setHPDDMAuxiliaryMat(self, IS uis, Mat uaux) -> None: # <<<<<<<<<<<<<< * """Set the auxiliary matrix used by the preconditioner. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_227setHPDDMAuxiliaryMat(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_226setHPDDMAuxiliaryMat, "PC.setHPDDMAuxiliaryMat(self, uis: IS, uaux: Mat) -> None\nSet the auxiliary matrix used by the preconditioner.\n\n Parameters\n ----------\n uis\n The `IS` of the local auxiliary matrix\n uaux\n The auxiliary sequential matrix\n\n See Also\n --------\n petsc.PCHPDDMSetAuxiliaryMat\n\n \nSource code at petsc4py/PETSc/PC.pyx:2392"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_227setHPDDMAuxiliaryMat(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscISObject *__pyx_v_uis = 0; struct PyPetscMatObject *__pyx_v_uaux = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setHPDDMAuxiliaryMat (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_uis,&__pyx_n_s_uaux,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_uis)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2392, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_uaux)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2392, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setHPDDMAuxiliaryMat", 1, 2, 2, 1); __PYX_ERR(48, 2392, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setHPDDMAuxiliaryMat") < 0)) __PYX_ERR(48, 2392, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_uis = ((struct PyPetscISObject *)values[0]); __pyx_v_uaux = ((struct PyPetscMatObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setHPDDMAuxiliaryMat", 1, 2, 2, __pyx_nargs); __PYX_ERR(48, 2392, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setHPDDMAuxiliaryMat", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_uis), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "uis", 0))) __PYX_ERR(48, 2392, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_uaux), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "uaux", 0))) __PYX_ERR(48, 2392, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_226setHPDDMAuxiliaryMat(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_uis, __pyx_v_uaux); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_226setHPDDMAuxiliaryMat(struct PyPetscPCObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_uis, struct PyPetscMatObject *__pyx_v_uaux) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setHPDDMAuxiliaryMat", 1); /* "petsc4py/PETSc/PC.pyx":2407 * * """ * CHKERR( PCHPDDMSetAuxiliaryMat(self.pc, uis.iset, uaux.mat, NULL, NULL) ) # <<<<<<<<<<<<<< * * def setHPDDMRHSMat(self, Mat B) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCHPDDMSetAuxiliaryMat(__pyx_v_self->pc, __pyx_v_uis->iset, __pyx_v_uaux->mat, NULL, ((void *)NULL))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 2407, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":2392 * # --- HPDDM --- * * def setHPDDMAuxiliaryMat(self, IS uis, Mat uaux) -> None: # <<<<<<<<<<<<<< * """Set the auxiliary matrix used by the preconditioner. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setHPDDMAuxiliaryMat", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":2409 * CHKERR( PCHPDDMSetAuxiliaryMat(self.pc, uis.iset, uaux.mat, NULL, NULL) ) * * def setHPDDMRHSMat(self, Mat B) -> None: # <<<<<<<<<<<<<< * """Set the right-hand side matrix of the preconditioner. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_229setHPDDMRHSMat(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_228setHPDDMRHSMat, "PC.setHPDDMRHSMat(self, B: Mat) -> None\nSet the right-hand side matrix of the preconditioner.\n\n Parameters\n ----------\n B\n The right-hand side sequential matrix.\n\n See Also\n --------\n petsc.PCHPDDMSetRHSMat\n\n \nSource code at petsc4py/PETSc/PC.pyx:2409"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_229setHPDDMRHSMat(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscMatObject *__pyx_v_B = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setHPDDMRHSMat (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_B,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_B)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2409, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setHPDDMRHSMat") < 0)) __PYX_ERR(48, 2409, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_B = ((struct PyPetscMatObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setHPDDMRHSMat", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 2409, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setHPDDMRHSMat", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_B), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "B", 0))) __PYX_ERR(48, 2409, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_228setHPDDMRHSMat(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_B); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_228setHPDDMRHSMat(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_B) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setHPDDMRHSMat", 1); /* "petsc4py/PETSc/PC.pyx":2422 * * """ * CHKERR( PCHPDDMSetRHSMat(self.pc, B.mat) ) # <<<<<<<<<<<<<< * * def setHPDDMHasNeumannMat(self, has: bool) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCHPDDMSetRHSMat(__pyx_v_self->pc, __pyx_v_B->mat)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 2422, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":2409 * CHKERR( PCHPDDMSetAuxiliaryMat(self.pc, uis.iset, uaux.mat, NULL, NULL) ) * * def setHPDDMRHSMat(self, Mat B) -> None: # <<<<<<<<<<<<<< * """Set the right-hand side matrix of the preconditioner. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setHPDDMRHSMat", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":2424 * CHKERR( PCHPDDMSetRHSMat(self.pc, B.mat) ) * * def setHPDDMHasNeumannMat(self, has: bool) -> None: # <<<<<<<<<<<<<< * """Set to indicate that the `Mat` passed to the `PC` is the local Neumann matrix. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_231setHPDDMHasNeumannMat(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_230setHPDDMHasNeumannMat, "PC.setHPDDMHasNeumannMat(self, has: bool) -> None\nSet to indicate that the `Mat` passed to the `PC` is the local Neumann matrix.\n\n Parameters\n ----------\n has\n Enable to indicate the matrix is the local Neumann matrix.\n\n See Also\n --------\n petsc.PCHPDDMHasNeumannMat\n\n \nSource code at petsc4py/PETSc/PC.pyx:2424"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_231setHPDDMHasNeumannMat(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_has = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setHPDDMHasNeumannMat (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_has,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_has)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2424, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setHPDDMHasNeumannMat") < 0)) __PYX_ERR(48, 2424, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_has = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setHPDDMHasNeumannMat", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 2424, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setHPDDMHasNeumannMat", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_230setHPDDMHasNeumannMat(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_has); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_230setHPDDMHasNeumannMat(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_has) { PetscBool __pyx_v_phas; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setHPDDMHasNeumannMat", 1); /* "petsc4py/PETSc/PC.pyx":2437 * * """ * cdef PetscBool phas = has # <<<<<<<<<<<<<< * CHKERR( PCHPDDMHasNeumannMat(self.pc, phas) ) * */ __pyx_t_1 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_has)); if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2437, __pyx_L1_error) __pyx_v_phas = __pyx_t_1; /* "petsc4py/PETSc/PC.pyx":2438 * """ * cdef PetscBool phas = has * CHKERR( PCHPDDMHasNeumannMat(self.pc, phas) ) # <<<<<<<<<<<<<< * * def setHPDDMCoarseCorrectionType(self, correction_type: HPDDMCoarseCorrectionType) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCHPDDMHasNeumannMat(__pyx_v_self->pc, __pyx_v_phas)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 2438, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":2424 * CHKERR( PCHPDDMSetRHSMat(self.pc, B.mat) ) * * def setHPDDMHasNeumannMat(self, has: bool) -> None: # <<<<<<<<<<<<<< * """Set to indicate that the `Mat` passed to the `PC` is the local Neumann matrix. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setHPDDMHasNeumannMat", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":2440 * CHKERR( PCHPDDMHasNeumannMat(self.pc, phas) ) * * def setHPDDMCoarseCorrectionType(self, correction_type: HPDDMCoarseCorrectionType) -> None: # <<<<<<<<<<<<<< * """Set the coarse correction type. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_233setHPDDMCoarseCorrectionType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_232setHPDDMCoarseCorrectionType, "PC.setHPDDMCoarseCorrectionType(self, correction_type: HPDDMCoarseCorrectionType) -> None\nSet the coarse correction type.\n\n Collective.\n\n Parameters\n ----------\n correction_type\n The type of coarse correction to apply.\n\n See Also\n --------\n petsc.PCHPDDMSetCoarseCorrectionType\n\n \nSource code at petsc4py/PETSc/PC.pyx:2440"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_233setHPDDMCoarseCorrectionType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_correction_type = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setHPDDMCoarseCorrectionType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_correction_type,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_correction_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2440, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setHPDDMCoarseCorrectionType") < 0)) __PYX_ERR(48, 2440, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_correction_type = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setHPDDMCoarseCorrectionType", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 2440, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setHPDDMCoarseCorrectionType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_232setHPDDMCoarseCorrectionType(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_correction_type); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_232setHPDDMCoarseCorrectionType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_correction_type) { PCHPDDMCoarseCorrectionType __pyx_v_ctype; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PCHPDDMCoarseCorrectionType __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setHPDDMCoarseCorrectionType", 1); /* "petsc4py/PETSc/PC.pyx":2455 * * """ * cdef PetscPCHPDDMCoarseCorrectionType ctype = correction_type # <<<<<<<<<<<<<< * CHKERR( PCHPDDMSetCoarseCorrectionType(self.pc, ctype) ) * */ __pyx_t_1 = ((PCHPDDMCoarseCorrectionType)__Pyx_PyInt_As_PCHPDDMCoarseCorrectionType(__pyx_v_correction_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2455, __pyx_L1_error) __pyx_v_ctype = __pyx_t_1; /* "petsc4py/PETSc/PC.pyx":2456 * """ * cdef PetscPCHPDDMCoarseCorrectionType ctype = correction_type * CHKERR( PCHPDDMSetCoarseCorrectionType(self.pc, ctype) ) # <<<<<<<<<<<<<< * * def getHPDDMCoarseCorrectionType(self) -> HPDDMCoarseCorrectionType: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCHPDDMSetCoarseCorrectionType(__pyx_v_self->pc, __pyx_v_ctype)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 2456, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":2440 * CHKERR( PCHPDDMHasNeumannMat(self.pc, phas) ) * * def setHPDDMCoarseCorrectionType(self, correction_type: HPDDMCoarseCorrectionType) -> None: # <<<<<<<<<<<<<< * """Set the coarse correction type. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setHPDDMCoarseCorrectionType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":2458 * CHKERR( PCHPDDMSetCoarseCorrectionType(self.pc, ctype) ) * * def getHPDDMCoarseCorrectionType(self) -> HPDDMCoarseCorrectionType: # <<<<<<<<<<<<<< * """Return the coarse correction type. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_235getHPDDMCoarseCorrectionType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_234getHPDDMCoarseCorrectionType, "PC.getHPDDMCoarseCorrectionType(self) -> HPDDMCoarseCorrectionType\nReturn the coarse correction type.\n\n See Also\n --------\n petsc.PCHPDDMGetCoarseCorrectionType\n\n \nSource code at petsc4py/PETSc/PC.pyx:2458"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_235getHPDDMCoarseCorrectionType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getHPDDMCoarseCorrectionType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getHPDDMCoarseCorrectionType", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getHPDDMCoarseCorrectionType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_234getHPDDMCoarseCorrectionType(((struct PyPetscPCObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_234getHPDDMCoarseCorrectionType(struct PyPetscPCObject *__pyx_v_self) { PCHPDDMCoarseCorrectionType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getHPDDMCoarseCorrectionType", 1); /* "petsc4py/PETSc/PC.pyx":2466 * * """ * cdef PetscPCHPDDMCoarseCorrectionType cval = PC_HPDDM_COARSE_CORRECTION_DEFLATED # <<<<<<<<<<<<<< * CHKERR( PCHPDDMGetCoarseCorrectionType(self.pc, &cval) ) * return cval */ __pyx_v_cval = PC_HPDDM_COARSE_CORRECTION_DEFLATED; /* "petsc4py/PETSc/PC.pyx":2467 * """ * cdef PetscPCHPDDMCoarseCorrectionType cval = PC_HPDDM_COARSE_CORRECTION_DEFLATED * CHKERR( PCHPDDMGetCoarseCorrectionType(self.pc, &cval) ) # <<<<<<<<<<<<<< * return cval * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCHPDDMGetCoarseCorrectionType(__pyx_v_self->pc, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 2467, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":2468 * cdef PetscPCHPDDMCoarseCorrectionType cval = PC_HPDDM_COARSE_CORRECTION_DEFLATED * CHKERR( PCHPDDMGetCoarseCorrectionType(self.pc, &cval) ) * return cval # <<<<<<<<<<<<<< * * def getHPDDMSTShareSubKSP(self) -> bool: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_PCHPDDMCoarseCorrectionType(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 2468, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/PC.pyx":2458 * CHKERR( PCHPDDMSetCoarseCorrectionType(self.pc, ctype) ) * * def getHPDDMCoarseCorrectionType(self) -> HPDDMCoarseCorrectionType: # <<<<<<<<<<<<<< * """Return the coarse correction type. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.PC.getHPDDMCoarseCorrectionType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":2470 * return cval * * def getHPDDMSTShareSubKSP(self) -> bool: # <<<<<<<<<<<<<< * """Return true if the `KSP` in SLEPc ``ST`` and the subdomain solver is shared. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_237getHPDDMSTShareSubKSP(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_236getHPDDMSTShareSubKSP, "PC.getHPDDMSTShareSubKSP(self) -> bool\nReturn true if the `KSP` in SLEPc ``ST`` and the subdomain solver is shared.\n\n See Also\n --------\n petsc.PCHPDDMGetSTShareSubKSP\n\n \nSource code at petsc4py/PETSc/PC.pyx:2470"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_237getHPDDMSTShareSubKSP(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getHPDDMSTShareSubKSP (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getHPDDMSTShareSubKSP", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getHPDDMSTShareSubKSP", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_236getHPDDMSTShareSubKSP(((struct PyPetscPCObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_236getHPDDMSTShareSubKSP(struct PyPetscPCObject *__pyx_v_self) { PetscBool __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getHPDDMSTShareSubKSP", 1); /* "petsc4py/PETSc/PC.pyx":2478 * * """ * cdef PetscBool cval = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( PCHPDDMGetSTShareSubKSP(self.pc, &cval) ) * return toBool(cval) */ __pyx_v_cval = PETSC_FALSE; /* "petsc4py/PETSc/PC.pyx":2479 * """ * cdef PetscBool cval = PETSC_FALSE * CHKERR( PCHPDDMGetSTShareSubKSP(self.pc, &cval) ) # <<<<<<<<<<<<<< * return toBool(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCHPDDMGetSTShareSubKSP(__pyx_v_self->pc, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 2479, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":2480 * cdef PetscBool cval = PETSC_FALSE * CHKERR( PCHPDDMGetSTShareSubKSP(self.pc, &cval) ) * return toBool(cval) # <<<<<<<<<<<<<< * * def setHPDDMDeflationMat(self, IS uis, Mat U): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 2480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/PC.pyx":2470 * return cval * * def getHPDDMSTShareSubKSP(self) -> bool: # <<<<<<<<<<<<<< * """Return true if the `KSP` in SLEPc ``ST`` and the subdomain solver is shared. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.PC.getHPDDMSTShareSubKSP", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":2482 * return toBool(cval) * * def setHPDDMDeflationMat(self, IS uis, Mat U): # <<<<<<<<<<<<<< * """Set the deflation space used to assemble a coarse operator. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_239setHPDDMDeflationMat(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_238setHPDDMDeflationMat, "PC.setHPDDMDeflationMat(self, uis: IS, U: Mat)\nSet the deflation space used to assemble a coarse operator.\n\n Parameters\n ----------\n uis\n The `IS` of the local deflation matrix.\n U\n The deflation sequential matrix of type `Mat.Type.DENSE`.\n\n See Also\n --------\n petsc.PCHPDDMSetDeflationMat\n\n \nSource code at petsc4py/PETSc/PC.pyx:2482"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_239setHPDDMDeflationMat(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscISObject *__pyx_v_uis = 0; struct PyPetscMatObject *__pyx_v_U = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setHPDDMDeflationMat (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_uis,&__pyx_n_s_U,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_uis)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2482, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_U)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2482, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setHPDDMDeflationMat", 1, 2, 2, 1); __PYX_ERR(48, 2482, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setHPDDMDeflationMat") < 0)) __PYX_ERR(48, 2482, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_uis = ((struct PyPetscISObject *)values[0]); __pyx_v_U = ((struct PyPetscMatObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setHPDDMDeflationMat", 1, 2, 2, __pyx_nargs); __PYX_ERR(48, 2482, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setHPDDMDeflationMat", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_uis), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "uis", 0))) __PYX_ERR(48, 2482, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_U), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "U", 0))) __PYX_ERR(48, 2482, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_238setHPDDMDeflationMat(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_uis, __pyx_v_U); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_238setHPDDMDeflationMat(struct PyPetscPCObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_uis, struct PyPetscMatObject *__pyx_v_U) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setHPDDMDeflationMat", 1); /* "petsc4py/PETSc/PC.pyx":2497 * * """ * CHKERR( PCHPDDMSetDeflationMat(self.pc, uis.iset, U.mat) ) # <<<<<<<<<<<<<< * * # --- SPAI --- */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCHPDDMSetDeflationMat(__pyx_v_self->pc, __pyx_v_uis->iset, __pyx_v_U->mat)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 2497, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":2482 * return toBool(cval) * * def setHPDDMDeflationMat(self, IS uis, Mat U): # <<<<<<<<<<<<<< * """Set the deflation space used to assemble a coarse operator. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setHPDDMDeflationMat", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":2501 * # --- SPAI --- * * def setSPAIEpsilon(self, val: float) -> None: # <<<<<<<<<<<<<< * """Set the tolerance for the preconditioner. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_241setSPAIEpsilon(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_240setSPAIEpsilon, "PC.setSPAIEpsilon(self, val: float) -> None\nSet the tolerance for the preconditioner.\n\n Parameters\n ----------\n val\n The tolerance, defaults to ``0.4``.\n\n See Also\n --------\n petsc.PCSPAISetEpsilon\n\n \nSource code at petsc4py/PETSc/PC.pyx:2501"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_241setSPAIEpsilon(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_val = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setSPAIEpsilon (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_val,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_val)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2501, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setSPAIEpsilon") < 0)) __PYX_ERR(48, 2501, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_val = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setSPAIEpsilon", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 2501, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setSPAIEpsilon", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_240setSPAIEpsilon(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_val); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_240setSPAIEpsilon(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_val) { PetscReal __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setSPAIEpsilon", 1); /* "petsc4py/PETSc/PC.pyx":2514 * * """ * cdef PetscReal cval = asReal(val) # <<<<<<<<<<<<<< * CHKERR( PCSPAISetEpsilon(self.pc, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_val); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(48, 2514, __pyx_L1_error) __pyx_v_cval = __pyx_t_1; /* "petsc4py/PETSc/PC.pyx":2515 * """ * cdef PetscReal cval = asReal(val) * CHKERR( PCSPAISetEpsilon(self.pc, cval) ) # <<<<<<<<<<<<<< * * def setSPAINBSteps(self, nbsteps: int) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCSPAISetEpsilon(__pyx_v_self->pc, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 2515, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":2501 * # --- SPAI --- * * def setSPAIEpsilon(self, val: float) -> None: # <<<<<<<<<<<<<< * """Set the tolerance for the preconditioner. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setSPAIEpsilon", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":2517 * CHKERR( PCSPAISetEpsilon(self.pc, cval) ) * * def setSPAINBSteps(self, nbsteps: int) -> None: # <<<<<<<<<<<<<< * """Set the maximum number of improvement steps per row. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_243setSPAINBSteps(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_242setSPAINBSteps, "PC.setSPAINBSteps(self, nbsteps: int) -> None\nSet the maximum number of improvement steps per row.\n\n Parameters\n ----------\n nbsteps\n The number of steps, defaults to ``5``.\n\n See Also\n --------\n petsc.PCSPAISetNBSteps\n\n \nSource code at petsc4py/PETSc/PC.pyx:2517"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_243setSPAINBSteps(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_nbsteps = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setSPAINBSteps (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nbsteps,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_nbsteps)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2517, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setSPAINBSteps") < 0)) __PYX_ERR(48, 2517, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_nbsteps = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setSPAINBSteps", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 2517, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setSPAINBSteps", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_242setSPAINBSteps(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_nbsteps); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_242setSPAINBSteps(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_nbsteps) { PetscInt __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setSPAINBSteps", 1); /* "petsc4py/PETSc/PC.pyx":2530 * * """ * cdef PetscInt cval = asInt(nbsteps) # <<<<<<<<<<<<<< * CHKERR( PCSPAISetNBSteps(self.pc, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_nbsteps); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 2530, __pyx_L1_error) __pyx_v_cval = __pyx_t_1; /* "petsc4py/PETSc/PC.pyx":2531 * """ * cdef PetscInt cval = asInt(nbsteps) * CHKERR( PCSPAISetNBSteps(self.pc, cval) ) # <<<<<<<<<<<<<< * * def setSPAIMax(self, maxval: int) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCSPAISetNBSteps(__pyx_v_self->pc, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 2531, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":2517 * CHKERR( PCSPAISetEpsilon(self.pc, cval) ) * * def setSPAINBSteps(self, nbsteps: int) -> None: # <<<<<<<<<<<<<< * """Set the maximum number of improvement steps per row. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setSPAINBSteps", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":2533 * CHKERR( PCSPAISetNBSteps(self.pc, cval) ) * * def setSPAIMax(self, maxval: int) -> None: # <<<<<<<<<<<<<< * """Set the size of working buffers in the preconditioner. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_245setSPAIMax(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_244setSPAIMax, "PC.setSPAIMax(self, maxval: int) -> None\nSet the size of working buffers in the preconditioner.\n\n Parameters\n ----------\n maxval\n Number of entries in the work arrays to be allocated, defaults to\n ``5000``.\n\n See Also\n --------\n petsc.PCSPAISetMax\n\n \nSource code at petsc4py/PETSc/PC.pyx:2533"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_245setSPAIMax(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_maxval = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setSPAIMax (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_maxval,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_maxval)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2533, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setSPAIMax") < 0)) __PYX_ERR(48, 2533, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_maxval = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setSPAIMax", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 2533, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setSPAIMax", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_244setSPAIMax(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_maxval); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_244setSPAIMax(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_maxval) { PetscInt __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setSPAIMax", 1); /* "petsc4py/PETSc/PC.pyx":2547 * * """ * cdef PetscInt cval = asInt(maxval) # <<<<<<<<<<<<<< * CHKERR( PCSPAISetMax(self.pc, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_maxval); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 2547, __pyx_L1_error) __pyx_v_cval = __pyx_t_1; /* "petsc4py/PETSc/PC.pyx":2548 * """ * cdef PetscInt cval = asInt(maxval) * CHKERR( PCSPAISetMax(self.pc, cval) ) # <<<<<<<<<<<<<< * * def setSPAIMaxNew(self, maxval: int) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCSPAISetMax(__pyx_v_self->pc, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 2548, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":2533 * CHKERR( PCSPAISetNBSteps(self.pc, cval) ) * * def setSPAIMax(self, maxval: int) -> None: # <<<<<<<<<<<<<< * """Set the size of working buffers in the preconditioner. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setSPAIMax", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":2550 * CHKERR( PCSPAISetMax(self.pc, cval) ) * * def setSPAIMaxNew(self, maxval: int) -> None: # <<<<<<<<<<<<<< * """Set the maximum number of new non-zero candidates per step. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_247setSPAIMaxNew(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_246setSPAIMaxNew, "PC.setSPAIMaxNew(self, maxval: int) -> None\nSet the maximum number of new non-zero candidates per step.\n\n Parameters\n ----------\n maxval\n Number of entries allowed, defaults to ``5``.\n\n See Also\n --------\n petsc.PCSPAISetMaxNew\n\n \nSource code at petsc4py/PETSc/PC.pyx:2550"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_247setSPAIMaxNew(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_maxval = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setSPAIMaxNew (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_maxval,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_maxval)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2550, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setSPAIMaxNew") < 0)) __PYX_ERR(48, 2550, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_maxval = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setSPAIMaxNew", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 2550, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setSPAIMaxNew", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_246setSPAIMaxNew(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_maxval); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_246setSPAIMaxNew(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_maxval) { PetscInt __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setSPAIMaxNew", 1); /* "petsc4py/PETSc/PC.pyx":2563 * * """ * cdef PetscInt cval = asInt(maxval) # <<<<<<<<<<<<<< * CHKERR( PCSPAISetMaxNew(self.pc, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_maxval); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 2563, __pyx_L1_error) __pyx_v_cval = __pyx_t_1; /* "petsc4py/PETSc/PC.pyx":2564 * """ * cdef PetscInt cval = asInt(maxval) * CHKERR( PCSPAISetMaxNew(self.pc, cval) ) # <<<<<<<<<<<<<< * * def setSPAIBlockSize(self, n: int) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCSPAISetMaxNew(__pyx_v_self->pc, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 2564, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":2550 * CHKERR( PCSPAISetMax(self.pc, cval) ) * * def setSPAIMaxNew(self, maxval: int) -> None: # <<<<<<<<<<<<<< * """Set the maximum number of new non-zero candidates per step. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setSPAIMaxNew", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":2566 * CHKERR( PCSPAISetMaxNew(self.pc, cval) ) * * def setSPAIBlockSize(self, n: int) -> None: # <<<<<<<<<<<<<< * """Set the block size of the preconditioner. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_249setSPAIBlockSize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_248setSPAIBlockSize, "PC.setSPAIBlockSize(self, n: int) -> None\nSet the block size of the preconditioner.\n\n Parameters\n ----------\n n\n The block size, defaults to ``1``.\n\n See Also\n --------\n petsc.PCSPAISetBlockSize\n\n \nSource code at petsc4py/PETSc/PC.pyx:2566"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_249setSPAIBlockSize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_n = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setSPAIBlockSize (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2566, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setSPAIBlockSize") < 0)) __PYX_ERR(48, 2566, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_n = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setSPAIBlockSize", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 2566, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setSPAIBlockSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_248setSPAIBlockSize(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_n); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_248setSPAIBlockSize(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_n) { PetscInt __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setSPAIBlockSize", 1); /* "petsc4py/PETSc/PC.pyx":2579 * * """ * cdef PetscInt cval = asInt(n) # <<<<<<<<<<<<<< * CHKERR( PCSPAISetBlockSize(self.pc, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_n); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 2579, __pyx_L1_error) __pyx_v_cval = __pyx_t_1; /* "petsc4py/PETSc/PC.pyx":2580 * """ * cdef PetscInt cval = asInt(n) * CHKERR( PCSPAISetBlockSize(self.pc, cval) ) # <<<<<<<<<<<<<< * * def setSPAICacheSize(self, size: int) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCSPAISetBlockSize(__pyx_v_self->pc, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 2580, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":2566 * CHKERR( PCSPAISetMaxNew(self.pc, cval) ) * * def setSPAIBlockSize(self, n: int) -> None: # <<<<<<<<<<<<<< * """Set the block size of the preconditioner. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setSPAIBlockSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":2582 * CHKERR( PCSPAISetBlockSize(self.pc, cval) ) * * def setSPAICacheSize(self, size: int) -> None: # <<<<<<<<<<<<<< * """Set the cache size. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_251setSPAICacheSize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_250setSPAICacheSize, "PC.setSPAICacheSize(self, size: int) -> None\nSet the cache size.\n\n Parameters\n ----------\n size\n The size of the cache, defaults to ``5``.\n\n See Also\n --------\n petsc.PCSPAISetCacheSize\n\n \nSource code at petsc4py/PETSc/PC.pyx:2582"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_251setSPAICacheSize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_size = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setSPAICacheSize (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2582, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setSPAICacheSize") < 0)) __PYX_ERR(48, 2582, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_size = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setSPAICacheSize", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 2582, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setSPAICacheSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_250setSPAICacheSize(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_size); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_250setSPAICacheSize(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_size) { PetscInt __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setSPAICacheSize", 1); /* "petsc4py/PETSc/PC.pyx":2595 * * """ * cdef PetscInt cval = asInt(size) # <<<<<<<<<<<<<< * CHKERR( PCSPAISetCacheSize(self.pc, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_size); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 2595, __pyx_L1_error) __pyx_v_cval = __pyx_t_1; /* "petsc4py/PETSc/PC.pyx":2596 * """ * cdef PetscInt cval = asInt(size) * CHKERR( PCSPAISetCacheSize(self.pc, cval) ) # <<<<<<<<<<<<<< * * def setSPAIVerbose(self, level: int) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCSPAISetCacheSize(__pyx_v_self->pc, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 2596, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":2582 * CHKERR( PCSPAISetBlockSize(self.pc, cval) ) * * def setSPAICacheSize(self, size: int) -> None: # <<<<<<<<<<<<<< * """Set the cache size. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setSPAICacheSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":2598 * CHKERR( PCSPAISetCacheSize(self.pc, cval) ) * * def setSPAIVerbose(self, level: int) -> None: # <<<<<<<<<<<<<< * """Set the verbosity level. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_253setSPAIVerbose(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_252setSPAIVerbose, "PC.setSPAIVerbose(self, level: int) -> None\nSet the verbosity level.\n\n Parameters\n ----------\n level\n The level of verbosity, defaults to ``1``.\n\n See Also\n --------\n petsc.PCSPAISetVerbose\n\n \nSource code at petsc4py/PETSc/PC.pyx:2598"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_253setSPAIVerbose(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_level = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setSPAIVerbose (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_level)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2598, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setSPAIVerbose") < 0)) __PYX_ERR(48, 2598, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_level = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setSPAIVerbose", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 2598, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setSPAIVerbose", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_252setSPAIVerbose(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_level); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_252setSPAIVerbose(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level) { PetscInt __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setSPAIVerbose", 1); /* "petsc4py/PETSc/PC.pyx":2611 * * """ * cdef PetscInt cval = asInt(level) # <<<<<<<<<<<<<< * CHKERR( PCSPAISetVerbose(self.pc, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_level); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 2611, __pyx_L1_error) __pyx_v_cval = __pyx_t_1; /* "petsc4py/PETSc/PC.pyx":2612 * """ * cdef PetscInt cval = asInt(level) * CHKERR( PCSPAISetVerbose(self.pc, cval) ) # <<<<<<<<<<<<<< * * def setSPAISp(self, sym: int) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCSPAISetVerbose(__pyx_v_self->pc, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 2612, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":2598 * CHKERR( PCSPAISetCacheSize(self.pc, cval) ) * * def setSPAIVerbose(self, level: int) -> None: # <<<<<<<<<<<<<< * """Set the verbosity level. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setSPAIVerbose", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":2614 * CHKERR( PCSPAISetVerbose(self.pc, cval) ) * * def setSPAISp(self, sym: int) -> None: # <<<<<<<<<<<<<< * """Set to specify a symmetric sparsity pattern. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_255setSPAISp(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_254setSPAISp, "PC.setSPAISp(self, sym: int) -> None\nSet to specify a symmetric sparsity pattern.\n\n Parameters\n ----------\n sym\n Enable to indicate the matrix is symmetric.\n\n See Also\n --------\n petsc.PCSPAISetSp\n\n \nSource code at petsc4py/PETSc/PC.pyx:2614"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_255setSPAISp(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_sym = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setSPAISp (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sym,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sym)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2614, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setSPAISp") < 0)) __PYX_ERR(48, 2614, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_sym = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setSPAISp", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 2614, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setSPAISp", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_254setSPAISp(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_sym); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_254setSPAISp(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_sym) { PetscInt __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setSPAISp", 1); /* "petsc4py/PETSc/PC.pyx":2627 * * """ * cdef PetscInt cval = asInt(sym) # <<<<<<<<<<<<<< * CHKERR( PCSPAISetSp(self.pc, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_sym); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 2627, __pyx_L1_error) __pyx_v_cval = __pyx_t_1; /* "petsc4py/PETSc/PC.pyx":2628 * """ * cdef PetscInt cval = asInt(sym) * CHKERR( PCSPAISetSp(self.pc, cval) ) # <<<<<<<<<<<<<< * * # --- DEFLATION --- */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCSPAISetSp(__pyx_v_self->pc, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 2628, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":2614 * CHKERR( PCSPAISetVerbose(self.pc, cval) ) * * def setSPAISp(self, sym: int) -> None: # <<<<<<<<<<<<<< * """Set to specify a symmetric sparsity pattern. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setSPAISp", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":2632 * # --- DEFLATION --- * * def setDeflationInitOnly(self, flg: bool) -> None: # <<<<<<<<<<<<<< * """Set to only perform the initialization. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_257setDeflationInitOnly(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_256setDeflationInitOnly, "PC.setDeflationInitOnly(self, flg: bool) -> None\nSet to only perform the initialization.\n\n Logically collective.\n\n Sets initial guess to the solution on the\n deflation space but does not apply the deflation preconditioner. The\n additional preconditioner is still applied.\n\n Parameters\n ----------\n flg\n Enable to only initialize the preconditioner.\n\n See Also\n --------\n petsc.PCDeflationSetInitOnly\n\n \nSource code at petsc4py/PETSc/PC.pyx:2632"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_257setDeflationInitOnly(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_flg = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setDeflationInitOnly (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flg,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flg)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2632, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setDeflationInitOnly") < 0)) __PYX_ERR(48, 2632, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_flg = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setDeflationInitOnly", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 2632, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setDeflationInitOnly", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_256setDeflationInitOnly(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_flg); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_256setDeflationInitOnly(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_flg) { PetscBool __pyx_v_cflg; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setDeflationInitOnly", 1); /* "petsc4py/PETSc/PC.pyx":2651 * * """ * cdef PetscBool cflg = asBool(flg) # <<<<<<<<<<<<<< * CHKERR( PCDeflationSetInitOnly(self.pc, cflg) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asBool(__pyx_v_flg); if (unlikely(__pyx_t_1 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(48, 2651, __pyx_L1_error) __pyx_v_cflg = __pyx_t_1; /* "petsc4py/PETSc/PC.pyx":2652 * """ * cdef PetscBool cflg = asBool(flg) * CHKERR( PCDeflationSetInitOnly(self.pc, cflg) ) # <<<<<<<<<<<<<< * * def setDeflationLevels(self, levels: int) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCDeflationSetInitOnly(__pyx_v_self->pc, __pyx_v_cflg)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 2652, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":2632 * # --- DEFLATION --- * * def setDeflationInitOnly(self, flg: bool) -> None: # <<<<<<<<<<<<<< * """Set to only perform the initialization. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setDeflationInitOnly", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":2654 * CHKERR( PCDeflationSetInitOnly(self.pc, cflg) ) * * def setDeflationLevels(self, levels: int) -> None: # <<<<<<<<<<<<<< * """Set the maximum level of deflation nesting. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_259setDeflationLevels(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_258setDeflationLevels, "PC.setDeflationLevels(self, levels: int) -> None\nSet the maximum level of deflation nesting.\n\n Logically collective.\n\n Parameters\n ----------\n levels\n The maximum deflation level.\n\n See Also\n --------\n petsc.PCDeflationSetLevels\n\n \nSource code at petsc4py/PETSc/PC.pyx:2654"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_259setDeflationLevels(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_levels = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setDeflationLevels (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_levels,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_levels)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2654, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setDeflationLevels") < 0)) __PYX_ERR(48, 2654, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_levels = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setDeflationLevels", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 2654, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setDeflationLevels", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_258setDeflationLevels(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_levels); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_258setDeflationLevels(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_levels) { PetscInt __pyx_v_clevels; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setDeflationLevels", 1); /* "petsc4py/PETSc/PC.pyx":2669 * * """ * cdef PetscInt clevels = asInt(levels) # <<<<<<<<<<<<<< * CHKERR( PCDeflationSetLevels(self.pc, clevels) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_levels); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 2669, __pyx_L1_error) __pyx_v_clevels = __pyx_t_1; /* "petsc4py/PETSc/PC.pyx":2670 * """ * cdef PetscInt clevels = asInt(levels) * CHKERR( PCDeflationSetLevels(self.pc, clevels) ) # <<<<<<<<<<<<<< * * def setDeflationReductionFactor(self, red: int) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCDeflationSetLevels(__pyx_v_self->pc, __pyx_v_clevels)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 2670, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":2654 * CHKERR( PCDeflationSetInitOnly(self.pc, cflg) ) * * def setDeflationLevels(self, levels: int) -> None: # <<<<<<<<<<<<<< * """Set the maximum level of deflation nesting. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setDeflationLevels", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":2672 * CHKERR( PCDeflationSetLevels(self.pc, clevels) ) * * def setDeflationReductionFactor(self, red: int) -> None: # <<<<<<<<<<<<<< * """Set the reduction factor for the preconditioner. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_261setDeflationReductionFactor(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_260setDeflationReductionFactor, "PC.setDeflationReductionFactor(self, red: int) -> None\nSet the reduction factor for the preconditioner.\n\n Logically collective.\n\n Parameters\n ----------\n red\n The reduction factor or ``DEFAULT``.\n\n See Also\n --------\n petsc.PCDeflationSetReductionFactor\n\n \nSource code at petsc4py/PETSc/PC.pyx:2672"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_261setDeflationReductionFactor(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_red = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setDeflationReductionFactor (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_red,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_red)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2672, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setDeflationReductionFactor") < 0)) __PYX_ERR(48, 2672, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_red = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setDeflationReductionFactor", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 2672, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setDeflationReductionFactor", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_260setDeflationReductionFactor(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_red); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_260setDeflationReductionFactor(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_red) { PetscInt __pyx_v_cred; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setDeflationReductionFactor", 1); /* "petsc4py/PETSc/PC.pyx":2687 * * """ * cdef PetscInt cred = asInt(red) # <<<<<<<<<<<<<< * CHKERR( PCDeflationSetReductionFactor(self.pc, cred) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_red); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 2687, __pyx_L1_error) __pyx_v_cred = __pyx_t_1; /* "petsc4py/PETSc/PC.pyx":2688 * """ * cdef PetscInt cred = asInt(red) * CHKERR( PCDeflationSetReductionFactor(self.pc, cred) ) # <<<<<<<<<<<<<< * * def setDeflationCorrectionFactor(self, fact: float) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCDeflationSetReductionFactor(__pyx_v_self->pc, __pyx_v_cred)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 2688, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":2672 * CHKERR( PCDeflationSetLevels(self.pc, clevels) ) * * def setDeflationReductionFactor(self, red: int) -> None: # <<<<<<<<<<<<<< * """Set the reduction factor for the preconditioner. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setDeflationReductionFactor", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":2690 * CHKERR( PCDeflationSetReductionFactor(self.pc, cred) ) * * def setDeflationCorrectionFactor(self, fact: float) -> None: # <<<<<<<<<<<<<< * """Set the coarse problem correction factor. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_263setDeflationCorrectionFactor(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_262setDeflationCorrectionFactor, "PC.setDeflationCorrectionFactor(self, fact: float) -> None\nSet the coarse problem correction factor.\n\n Logically collective.\n\n Parameters\n ----------\n fact\n The correction factor.\n\n See Also\n --------\n petsc.PCDeflationSetCorrectionFactor\n\n \nSource code at petsc4py/PETSc/PC.pyx:2690"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_263setDeflationCorrectionFactor(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_fact = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setDeflationCorrectionFactor (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fact,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fact)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2690, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setDeflationCorrectionFactor") < 0)) __PYX_ERR(48, 2690, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_fact = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setDeflationCorrectionFactor", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 2690, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setDeflationCorrectionFactor", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_262setDeflationCorrectionFactor(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_fact); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_262setDeflationCorrectionFactor(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_fact) { CYTHON_UNUSED PetscScalar __pyx_v_cfact; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscScalar __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setDeflationCorrectionFactor", 1); /* "petsc4py/PETSc/PC.pyx":2705 * * """ * cdef PetscScalar cfact = asScalar(fact) # <<<<<<<<<<<<<< * CHKERR( PCDeflationSetCorrectionFactor(self.pc, fact) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_fact); if (unlikely(__pyx_t_1 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(48, 2705, __pyx_L1_error) __pyx_v_cfact = __pyx_t_1; /* "petsc4py/PETSc/PC.pyx":2706 * """ * cdef PetscScalar cfact = asScalar(fact) * CHKERR( PCDeflationSetCorrectionFactor(self.pc, fact) ) # <<<<<<<<<<<<<< * * def setDeflationSpaceToCompute(self, space_type: DeflationSpaceType, size: int) -> None: */ __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_fact); if (unlikely((__pyx_t_1 == ((PetscScalar)-1)) && PyErr_Occurred())) __PYX_ERR(48, 2706, __pyx_L1_error) __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCDeflationSetCorrectionFactor(__pyx_v_self->pc, __pyx_t_1)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 2706, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":2690 * CHKERR( PCDeflationSetReductionFactor(self.pc, cred) ) * * def setDeflationCorrectionFactor(self, fact: float) -> None: # <<<<<<<<<<<<<< * """Set the coarse problem correction factor. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setDeflationCorrectionFactor", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":2708 * CHKERR( PCDeflationSetCorrectionFactor(self.pc, fact) ) * * def setDeflationSpaceToCompute(self, space_type: DeflationSpaceType, size: int) -> None: # <<<<<<<<<<<<<< * """Set the deflation space type. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_265setDeflationSpaceToCompute(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_264setDeflationSpaceToCompute, "PC.setDeflationSpaceToCompute(self, space_type: DeflationSpaceType, size: int) -> None\nSet the deflation space type.\n\n Logically collective.\n\n Parameters\n ----------\n space_type\n The deflation space type.\n size\n The size of the space to compute\n\n See Also\n --------\n petsc.PCDeflationSetSpaceToCompute\n\n \nSource code at petsc4py/PETSc/PC.pyx:2708"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_265setDeflationSpaceToCompute(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_space_type = 0; PyObject *__pyx_v_size = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setDeflationSpaceToCompute (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_space_type,&__pyx_n_s_size,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_space_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2708, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2708, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setDeflationSpaceToCompute", 1, 2, 2, 1); __PYX_ERR(48, 2708, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setDeflationSpaceToCompute") < 0)) __PYX_ERR(48, 2708, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_space_type = values[0]; __pyx_v_size = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setDeflationSpaceToCompute", 1, 2, 2, __pyx_nargs); __PYX_ERR(48, 2708, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setDeflationSpaceToCompute", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_264setDeflationSpaceToCompute(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_space_type, __pyx_v_size); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_264setDeflationSpaceToCompute(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_space_type, PyObject *__pyx_v_size) { PetscInt __pyx_v_csize; CYTHON_UNUSED PCDeflationSpaceType __pyx_v_ctype; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PCDeflationSpaceType __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setDeflationSpaceToCompute", 1); /* "petsc4py/PETSc/PC.pyx":2725 * * """ * cdef PetscInt csize = asInt(size) # <<<<<<<<<<<<<< * cdef PetscPCDeflationSpaceType ctype = space_type * CHKERR( PCDeflationSetSpaceToCompute(self.pc, space_type, csize) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_size); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 2725, __pyx_L1_error) __pyx_v_csize = __pyx_t_1; /* "petsc4py/PETSc/PC.pyx":2726 * """ * cdef PetscInt csize = asInt(size) * cdef PetscPCDeflationSpaceType ctype = space_type # <<<<<<<<<<<<<< * CHKERR( PCDeflationSetSpaceToCompute(self.pc, space_type, csize) ) * */ __pyx_t_2 = ((PCDeflationSpaceType)__Pyx_PyInt_As_PCDeflationSpaceType(__pyx_v_space_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2726, __pyx_L1_error) __pyx_v_ctype = __pyx_t_2; /* "petsc4py/PETSc/PC.pyx":2727 * cdef PetscInt csize = asInt(size) * cdef PetscPCDeflationSpaceType ctype = space_type * CHKERR( PCDeflationSetSpaceToCompute(self.pc, space_type, csize) ) # <<<<<<<<<<<<<< * * def setDeflationSpace(self, Mat W, transpose: bool) -> None: */ __pyx_t_2 = ((PCDeflationSpaceType)__Pyx_PyInt_As_PCDeflationSpaceType(__pyx_v_space_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2727, __pyx_L1_error) __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCDeflationSetSpaceToCompute(__pyx_v_self->pc, __pyx_t_2, __pyx_v_csize)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 2727, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":2708 * CHKERR( PCDeflationSetCorrectionFactor(self.pc, fact) ) * * def setDeflationSpaceToCompute(self, space_type: DeflationSpaceType, size: int) -> None: # <<<<<<<<<<<<<< * """Set the deflation space type. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setDeflationSpaceToCompute", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":2729 * CHKERR( PCDeflationSetSpaceToCompute(self.pc, space_type, csize) ) * * def setDeflationSpace(self, Mat W, transpose: bool) -> None: # <<<<<<<<<<<<<< * """Set the deflation space matrix or its (Hermitian) transpose. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_267setDeflationSpace(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_266setDeflationSpace, "PC.setDeflationSpace(self, W: Mat, transpose: bool) -> None\nSet the deflation space matrix or its (Hermitian) transpose.\n\n Logically collective.\n\n Parameters\n ----------\n W\n The deflation matrix.\n transpose\n Enable to indicate that ``W`` is an explicit transpose of the\n deflation matrix.\n\n See Also\n --------\n petsc.PCDeflationSetSpace\n\n \nSource code at petsc4py/PETSc/PC.pyx:2729"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_267setDeflationSpace(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscMatObject *__pyx_v_W = 0; PyObject *__pyx_v_transpose = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setDeflationSpace (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_W,&__pyx_n_s_transpose,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_W)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2729, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_transpose)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2729, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setDeflationSpace", 1, 2, 2, 1); __PYX_ERR(48, 2729, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setDeflationSpace") < 0)) __PYX_ERR(48, 2729, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_W = ((struct PyPetscMatObject *)values[0]); __pyx_v_transpose = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setDeflationSpace", 1, 2, 2, __pyx_nargs); __PYX_ERR(48, 2729, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setDeflationSpace", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_W), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "W", 0))) __PYX_ERR(48, 2729, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_266setDeflationSpace(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_W, __pyx_v_transpose); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_266setDeflationSpace(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_W, PyObject *__pyx_v_transpose) { PetscBool __pyx_v_ctranspose; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setDeflationSpace", 1); /* "petsc4py/PETSc/PC.pyx":2747 * * """ * cdef PetscBool ctranspose = asBool(transpose) # <<<<<<<<<<<<<< * CHKERR( PCDeflationSetSpace(self.pc, W.mat, ctranspose) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asBool(__pyx_v_transpose); if (unlikely(__pyx_t_1 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(48, 2747, __pyx_L1_error) __pyx_v_ctranspose = __pyx_t_1; /* "petsc4py/PETSc/PC.pyx":2748 * """ * cdef PetscBool ctranspose = asBool(transpose) * CHKERR( PCDeflationSetSpace(self.pc, W.mat, ctranspose) ) # <<<<<<<<<<<<<< * * def setDeflationProjectionNullSpaceMat(self, Mat mat) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCDeflationSetSpace(__pyx_v_self->pc, __pyx_v_W->mat, __pyx_v_ctranspose)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 2748, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":2729 * CHKERR( PCDeflationSetSpaceToCompute(self.pc, space_type, csize) ) * * def setDeflationSpace(self, Mat W, transpose: bool) -> None: # <<<<<<<<<<<<<< * """Set the deflation space matrix or its (Hermitian) transpose. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setDeflationSpace", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":2750 * CHKERR( PCDeflationSetSpace(self.pc, W.mat, ctranspose) ) * * def setDeflationProjectionNullSpaceMat(self, Mat mat) -> None: # <<<<<<<<<<<<<< * """Set the projection null space matrix. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_269setDeflationProjectionNullSpaceMat(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_268setDeflationProjectionNullSpaceMat, "PC.setDeflationProjectionNullSpaceMat(self, mat: Mat) -> None\nSet the projection null space matrix.\n\n Collective.\n\n Parameters\n ----------\n mat\n The projection null space matrix.\n\n See Also\n --------\n petsc.PCDeflationSetProjectionNullSpaceMat\n\n \nSource code at petsc4py/PETSc/PC.pyx:2750"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_269setDeflationProjectionNullSpaceMat(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscMatObject *__pyx_v_mat = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setDeflationProjectionNullSpaceMat (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mat)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2750, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setDeflationProjectionNullSpaceMat") < 0)) __PYX_ERR(48, 2750, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_mat = ((struct PyPetscMatObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setDeflationProjectionNullSpaceMat", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 2750, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setDeflationProjectionNullSpaceMat", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(48, 2750, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_268setDeflationProjectionNullSpaceMat(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_mat); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_268setDeflationProjectionNullSpaceMat(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setDeflationProjectionNullSpaceMat", 1); /* "petsc4py/PETSc/PC.pyx":2765 * * """ * CHKERR( PCDeflationSetProjectionNullSpaceMat(self.pc, mat.mat) ) # <<<<<<<<<<<<<< * * def setDeflationCoarseMat(self, Mat mat) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCDeflationSetProjectionNullSpaceMat(__pyx_v_self->pc, __pyx_v_mat->mat)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 2765, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":2750 * CHKERR( PCDeflationSetSpace(self.pc, W.mat, ctranspose) ) * * def setDeflationProjectionNullSpaceMat(self, Mat mat) -> None: # <<<<<<<<<<<<<< * """Set the projection null space matrix. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setDeflationProjectionNullSpaceMat", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":2767 * CHKERR( PCDeflationSetProjectionNullSpaceMat(self.pc, mat.mat) ) * * def setDeflationCoarseMat(self, Mat mat) -> None: # <<<<<<<<<<<<<< * """Set the coarse problem matrix. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_271setDeflationCoarseMat(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_270setDeflationCoarseMat, "PC.setDeflationCoarseMat(self, mat: Mat) -> None\nSet the coarse problem matrix.\n\n Collective.\n\n Parameters\n ----------\n mat\n The coarse problem matrix.\n\n See Also\n --------\n petsc.PCDeflationSetCoarseMat\n\n \nSource code at petsc4py/PETSc/PC.pyx:2767"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_271setDeflationCoarseMat(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscMatObject *__pyx_v_mat = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setDeflationCoarseMat (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mat)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2767, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setDeflationCoarseMat") < 0)) __PYX_ERR(48, 2767, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_mat = ((struct PyPetscMatObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setDeflationCoarseMat", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 2767, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.PC.setDeflationCoarseMat", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(48, 2767, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_270setDeflationCoarseMat(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_mat); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_270setDeflationCoarseMat(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setDeflationCoarseMat", 1); /* "petsc4py/PETSc/PC.pyx":2782 * * """ * CHKERR( PCDeflationSetCoarseMat(self.pc, mat.mat) ) # <<<<<<<<<<<<<< * * def getDeflationCoarseKSP(self) -> KSP: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCDeflationSetCoarseMat(__pyx_v_self->pc, __pyx_v_mat->mat)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 2782, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":2767 * CHKERR( PCDeflationSetProjectionNullSpaceMat(self.pc, mat.mat) ) * * def setDeflationCoarseMat(self, Mat mat) -> None: # <<<<<<<<<<<<<< * """Set the coarse problem matrix. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setDeflationCoarseMat", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":2784 * CHKERR( PCDeflationSetCoarseMat(self.pc, mat.mat) ) * * def getDeflationCoarseKSP(self) -> KSP: # <<<<<<<<<<<<<< * """Return the coarse problem `KSP`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_273getDeflationCoarseKSP(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_272getDeflationCoarseKSP, "PC.getDeflationCoarseKSP(self) -> KSP\nReturn the coarse problem `KSP`.\n\n Not collective.\n\n See Also\n --------\n petsc.PCDeflationGetCoarseKSP\n\n \nSource code at petsc4py/PETSc/PC.pyx:2784"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_273getDeflationCoarseKSP(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getDeflationCoarseKSP (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getDeflationCoarseKSP", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getDeflationCoarseKSP", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_272getDeflationCoarseKSP(((struct PyPetscPCObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_272getDeflationCoarseKSP(struct PyPetscPCObject *__pyx_v_self) { struct PyPetscKSPObject *__pyx_v_ksp = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getDeflationCoarseKSP", 1); /* "petsc4py/PETSc/PC.pyx":2794 * * """ * cdef KSP ksp = KSP() # <<<<<<<<<<<<<< * CHKERR( PCDeflationGetCoarseKSP(self.pc, &ksp.ksp) ) * CHKERR( PetscINCREF(ksp.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_KSP)); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 2794, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ksp = ((struct PyPetscKSPObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/PC.pyx":2795 * """ * cdef KSP ksp = KSP() * CHKERR( PCDeflationGetCoarseKSP(self.pc, &ksp.ksp) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(ksp.obj) ) * return ksp */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCDeflationGetCoarseKSP(__pyx_v_self->pc, (&__pyx_v_ksp->ksp))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 2795, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":2796 * cdef KSP ksp = KSP() * CHKERR( PCDeflationGetCoarseKSP(self.pc, &ksp.ksp) ) * CHKERR( PetscINCREF(ksp.obj) ) # <<<<<<<<<<<<<< * return ksp * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ksp->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 2796, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":2797 * CHKERR( PCDeflationGetCoarseKSP(self.pc, &ksp.ksp) ) * CHKERR( PetscINCREF(ksp.obj) ) * return ksp # <<<<<<<<<<<<<< * * def getDeflationPC(self) -> PC: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_ksp); __pyx_r = ((PyObject *)__pyx_v_ksp); goto __pyx_L0; /* "petsc4py/PETSc/PC.pyx":2784 * CHKERR( PCDeflationSetCoarseMat(self.pc, mat.mat) ) * * def getDeflationCoarseKSP(self) -> KSP: # <<<<<<<<<<<<<< * """Return the coarse problem `KSP`. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PC.getDeflationCoarseKSP", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ksp); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PC.pyx":2799 * return ksp * * def getDeflationPC(self) -> PC: # <<<<<<<<<<<<<< * """Return the additional preconditioner. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_275getDeflationPC(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_274getDeflationPC, "PC.getDeflationPC(self) -> PC\nReturn the additional preconditioner.\n\n See Also\n --------\n petsc.PCDeflationGetPC\n\n \nSource code at petsc4py/PETSc/PC.pyx:2799"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_275getDeflationPC(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getDeflationPC (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getDeflationPC", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getDeflationPC", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_274getDeflationPC(((struct PyPetscPCObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_274getDeflationPC(struct PyPetscPCObject *__pyx_v_self) { struct PyPetscPCObject *__pyx_v_apc = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getDeflationPC", 1); /* "petsc4py/PETSc/PC.pyx":2807 * * """ * cdef PC apc = PC() # <<<<<<<<<<<<<< * CHKERR( PCDeflationGetPC(self.pc, &apc.pc) ) * CHKERR( PetscINCREF(apc.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_PC)); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 2807, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_apc = ((struct PyPetscPCObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/PC.pyx":2808 * """ * cdef PC apc = PC() * CHKERR( PCDeflationGetPC(self.pc, &apc.pc) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(apc.obj) ) * return apc */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCDeflationGetPC(__pyx_v_self->pc, (&__pyx_v_apc->pc))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 2808, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":2809 * cdef PC apc = PC() * CHKERR( PCDeflationGetPC(self.pc, &apc.pc) ) * CHKERR( PetscINCREF(apc.obj) ) # <<<<<<<<<<<<<< * return apc * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_apc->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 2809, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":2810 * CHKERR( PCDeflationGetPC(self.pc, &apc.pc) ) * CHKERR( PetscINCREF(apc.obj) ) * return apc # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_apc); __pyx_r = ((PyObject *)__pyx_v_apc); goto __pyx_L0; /* "petsc4py/PETSc/PC.pyx":2799 * return ksp * * def getDeflationPC(self) -> PC: # <<<<<<<<<<<<<< * """Return the additional preconditioner. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PC.getDeflationPC", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_apc); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":396 * # --- xxx --- * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.ksp * self.ksp = NULL */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_3KSP_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_3KSP_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP___cinit__(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_3KSP___cinit__(struct PyPetscKSPObject *__pyx_v_self) { int __pyx_r; /* "petsc4py/PETSc/KSP.pyx":397 * * def __cinit__(self): * self.obj = &self.ksp # <<<<<<<<<<<<<< * self.ksp = NULL * */ __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->ksp)); /* "petsc4py/PETSc/KSP.pyx":398 * def __cinit__(self): * self.obj = &self.ksp * self.ksp = NULL # <<<<<<<<<<<<<< * * def __call__(self, Vec b, Vec x = None) -> Vec: */ __pyx_v_self->ksp = NULL; /* "petsc4py/PETSc/KSP.pyx":396 * # --- xxx --- * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.ksp * self.ksp = NULL */ /* function exit code */ __pyx_r = 0; return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":400 * self.ksp = NULL * * def __call__(self, Vec b, Vec x = None) -> Vec: # <<<<<<<<<<<<<< * """Solve linear system. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_2__call__, "Solve linear system.\n\n Collective.\n\n Parameters\n ----------\n b\n Right hand side vector.\n x\n Solution vector.\n\n Notes\n -----\n Shortcut for `solve`, which returns the solution vector.\n\n See Also\n --------\n solve, petsc_options, petsc.KSPSolve\n\n "); #if CYTHON_UPDATE_DESCRIPTOR_DOC struct wrapperbase __pyx_wrapperbase_8petsc4py_5PETSc_3KSP_2__call__; #endif static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_b = 0; struct PyPetscVecObject *__pyx_v_x = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_b,&__pyx_n_s_x,0}; values[1] = __Pyx_Arg_NewRef_VARARGS((PyObject *)((struct PyPetscVecObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_b)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 400, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x); if (value) { values[1] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 400, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__call__") < 0)) __PYX_ERR(49, 400, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_b = ((struct PyPetscVecObject *)values[0]); __pyx_v_x = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__call__", 0, 1, 2, __pyx_nargs); __PYX_ERR(49, 400, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.KSP.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "b", 0))) __PYX_ERR(49, 400, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "x", 0))) __PYX_ERR(49, 400, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_2__call__(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_b, __pyx_v_x); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_2__call__(struct PyPetscKSPObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_b, struct PyPetscVecObject *__pyx_v_x) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); __Pyx_INCREF((PyObject *)__pyx_v_x); /* "petsc4py/PETSc/KSP.pyx":421 * * """ * if x is None: # XXX do this better # <<<<<<<<<<<<<< * x = self.getOperators()[0].createVecLeft() * self.solve(b, x) */ __pyx_t_1 = (((PyObject *)__pyx_v_x) == Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/KSP.pyx":422 * """ * if x is None: # XXX do this better * x = self.getOperators()[0].createVecLeft() # <<<<<<<<<<<<<< * self.solve(b, x) * return x */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getOperators); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(49, 422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_createVecLeft); if (unlikely(!__pyx_t_3)) __PYX_ERR(49, 422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(49, 422, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_x, ((struct PyPetscVecObject *)__pyx_t_2)); __pyx_t_2 = 0; /* "petsc4py/PETSc/KSP.pyx":421 * * """ * if x is None: # XXX do this better # <<<<<<<<<<<<<< * x = self.getOperators()[0].createVecLeft() * self.solve(b, x) */ } /* "petsc4py/PETSc/KSP.pyx":423 * if x is None: # XXX do this better * x = self.getOperators()[0].createVecLeft() * self.solve(b, x) # <<<<<<<<<<<<<< * return x * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_solve); if (unlikely(!__pyx_t_3)) __PYX_ERR(49, 423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_4, ((PyObject *)__pyx_v_b), ((PyObject *)__pyx_v_x)}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/KSP.pyx":424 * x = self.getOperators()[0].createVecLeft() * self.solve(b, x) * return x # <<<<<<<<<<<<<< * * # --- xxx --- */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_x); __pyx_r = ((PyObject *)__pyx_v_x); goto __pyx_L0; /* "petsc4py/PETSc/KSP.pyx":400 * self.ksp = NULL * * def __call__(self, Vec b, Vec x = None) -> Vec: # <<<<<<<<<<<<<< * """Solve linear system. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.KSP.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_x); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":428 * # --- xxx --- * * def view(self, Viewer viewer=None) -> None: # <<<<<<<<<<<<<< * """Print the KSP data structure. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_5view(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_4view, "KSP.view(self, viewer: Viewer | None = None) -> None\nPrint the KSP data structure.\n\n Collective.\n\n Parameters\n ----------\n viewer\n Viewer used to display the KSP.\n\n See Also\n --------\n petsc.KSPView\n\n \nSource code at petsc4py/PETSc/KSP.pyx:428"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_5view(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscViewerObject *__pyx_v_viewer = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("view (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscViewerObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_viewer); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 428, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "view") < 0)) __PYX_ERR(49, 428, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, __pyx_nargs); __PYX_ERR(49, 428, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.KSP.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(49, 428, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_4view(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_viewer); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_4view(struct PyPetscKSPObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer) { PetscViewer __pyx_v_vwr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscViewer __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("view", 1); /* "petsc4py/PETSc/KSP.pyx":443 * * """ * cdef PetscViewer vwr = NULL # <<<<<<<<<<<<<< * if viewer is not None: vwr = viewer.vwr * CHKERR( KSPView(self.ksp, vwr) ) */ __pyx_v_vwr = NULL; /* "petsc4py/PETSc/KSP.pyx":444 * """ * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr # <<<<<<<<<<<<<< * CHKERR( KSPView(self.ksp, vwr) ) * */ __pyx_t_1 = (((PyObject *)__pyx_v_viewer) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_viewer->vwr; __pyx_v_vwr = __pyx_t_2; } /* "petsc4py/PETSc/KSP.pyx":445 * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr * CHKERR( KSPView(self.ksp, vwr) ) # <<<<<<<<<<<<<< * * def destroy(self) -> Self: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPView(__pyx_v_self->ksp, __pyx_v_vwr)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 445, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":428 * # --- xxx --- * * def view(self, Viewer viewer=None) -> None: # <<<<<<<<<<<<<< * """Print the KSP data structure. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":447 * CHKERR( KSPView(self.ksp, vwr) ) * * def destroy(self) -> Self: # <<<<<<<<<<<<<< * """Destroy KSP context. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_7destroy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_6destroy, "KSP.destroy(self) -> Self\nDestroy KSP context.\n\n Collective.\n\n See Also\n --------\n petsc.KSPDestroy\n\n \nSource code at petsc4py/PETSc/KSP.pyx:447"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_7destroy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("destroy (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_6destroy(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_6destroy(struct PyPetscKSPObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("destroy", 1); /* "petsc4py/PETSc/KSP.pyx":457 * * """ * CHKERR( KSPDestroy(&self.ksp) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPDestroy((&__pyx_v_self->ksp))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 457, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":458 * """ * CHKERR( KSPDestroy(&self.ksp) ) * return self # <<<<<<<<<<<<<< * * def create(self, comm: Comm | None = None) -> Self: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/KSP.pyx":447 * CHKERR( KSPView(self.ksp, vwr) ) * * def destroy(self) -> Self: # <<<<<<<<<<<<<< * """Destroy KSP context. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":460 * return self * * def create(self, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Create the KSP context. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_9create(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_8create, "KSP.create(self, comm: Comm | None = None) -> Self\nCreate the KSP context.\n\n Collective.\n\n See Also\n --------\n petsc.KSPCreate\n\n \nSource code at petsc4py/PETSc/KSP.pyx:460"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_9create(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 460, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "create") < 0)) __PYX_ERR(49, 460, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_comm = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, __pyx_nargs); __PYX_ERR(49, 460, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.KSP.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_8create(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_comm); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_8create(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; KSP __pyx_v_newksp; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create", 1); /* "petsc4py/PETSc/KSP.pyx":470 * * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscKSP newksp = NULL * CHKERR( KSPCreate(ccomm, &newksp) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(49, 470, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/KSP.pyx":471 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscKSP newksp = NULL # <<<<<<<<<<<<<< * CHKERR( KSPCreate(ccomm, &newksp) ) * CHKERR( PetscCLEAR(self.obj) ); self.ksp = newksp */ __pyx_v_newksp = NULL; /* "petsc4py/PETSc/KSP.pyx":472 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscKSP newksp = NULL * CHKERR( KSPCreate(ccomm, &newksp) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.ksp = newksp * return self */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPCreate(__pyx_v_ccomm, (&__pyx_v_newksp))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 472, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":473 * cdef PetscKSP newksp = NULL * CHKERR( KSPCreate(ccomm, &newksp) ) * CHKERR( PetscCLEAR(self.obj) ); self.ksp = newksp # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 473, __pyx_L1_error) __pyx_v_self->ksp = __pyx_v_newksp; /* "petsc4py/PETSc/KSP.pyx":474 * CHKERR( KSPCreate(ccomm, &newksp) ) * CHKERR( PetscCLEAR(self.obj) ); self.ksp = newksp * return self # <<<<<<<<<<<<<< * * def setType(self, ksp_type: Type | str) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/KSP.pyx":460 * return self * * def create(self, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Create the KSP context. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":476 * return self * * def setType(self, ksp_type: Type | str) -> None: # <<<<<<<<<<<<<< * """Build the `KSP` data structure for a particular `Type`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_11setType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_10setType, "KSP.setType(self, ksp_type: Type | str) -> None\nBuild the `KSP` data structure for a particular `Type`.\n\n Logically collective.\n\n Parameters\n ----------\n ksp_type\n KSP Type object\n\n Notes\n -----\n See `Type` for available methods (for instance, `Type.CG` or\n `Type.GMRES`).\n\n Normally, it is best to use the `setFromOptions` command\n and then set the KSP type from the options database rather than\n by using this routine. Using the options database provides the\n user with maximum flexibility in evaluating the many different\n Krylov methods. This method is provided for those situations\n where it is necessary to set the iterative solver independently\n of the command line or options database. This might be the\n case, for example, when the choice of iterative solver changes\n during the execution of the program, and the user's application\n is taking responsibility for choosing the appropriate method.\n In other words, this routine is not for beginners.\n\n See Also\n --------\n petsc.KSPSetType\n\n \nSource code at petsc4py/PETSc/KSP.pyx:476"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_11setType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_ksp_type = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ksp_type,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ksp_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 476, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setType") < 0)) __PYX_ERR(49, 476, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_ksp_type = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, __pyx_nargs); __PYX_ERR(49, 476, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.KSP.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_10setType(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_ksp_type); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_10setType(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_ksp_type) { KSPType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setType", 0); __Pyx_INCREF(__pyx_v_ksp_type); /* "petsc4py/PETSc/KSP.pyx":508 * * """ * cdef PetscKSPType cval = NULL # <<<<<<<<<<<<<< * ksp_type = str2bytes(ksp_type, &cval) * CHKERR( KSPSetType(self.ksp, cval) ) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/KSP.pyx":509 * """ * cdef PetscKSPType cval = NULL * ksp_type = str2bytes(ksp_type, &cval) # <<<<<<<<<<<<<< * CHKERR( KSPSetType(self.ksp, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_ksp_type, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 509, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_ksp_type, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/KSP.pyx":510 * cdef PetscKSPType cval = NULL * ksp_type = str2bytes(ksp_type, &cval) * CHKERR( KSPSetType(self.ksp, cval) ) # <<<<<<<<<<<<<< * * def getType(self) -> str: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetType(__pyx_v_self->ksp, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 510, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":476 * return self * * def setType(self, ksp_type: Type | str) -> None: # <<<<<<<<<<<<<< * """Build the `KSP` data structure for a particular `Type`. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.KSP.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ksp_type); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":512 * CHKERR( KSPSetType(self.ksp, cval) ) * * def getType(self) -> str: # <<<<<<<<<<<<<< * """Return the KSP type as a string from the `KSP` object. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_13getType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_12getType, "KSP.getType(self) -> str\nReturn the KSP type as a string from the `KSP` object.\n\n Not collective.\n\n See Also\n --------\n petsc.KSPGetType\n\n \nSource code at petsc4py/PETSc/KSP.pyx:512"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_13getType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getType", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_12getType(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_12getType(struct PyPetscKSPObject *__pyx_v_self) { KSPType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getType", 1); /* "petsc4py/PETSc/KSP.pyx":522 * * """ * cdef PetscKSPType cval = NULL # <<<<<<<<<<<<<< * CHKERR( KSPGetType(self.ksp, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/KSP.pyx":523 * """ * cdef PetscKSPType cval = NULL * CHKERR( KSPGetType(self.ksp, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPGetType(__pyx_v_self->ksp, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 523, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":524 * cdef PetscKSPType cval = NULL * CHKERR( KSPGetType(self.ksp, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * def setOptionsPrefix(self, prefix: str) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 524, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/KSP.pyx":512 * CHKERR( KSPSetType(self.ksp, cval) ) * * def getType(self) -> str: # <<<<<<<<<<<<<< * """Return the KSP type as a string from the `KSP` object. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.KSP.getType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":526 * return bytes2str(cval) * * def setOptionsPrefix(self, prefix: str) -> None: # <<<<<<<<<<<<<< * """Set the prefix used for all `KSP` options in the database. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_15setOptionsPrefix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_14setOptionsPrefix, "KSP.setOptionsPrefix(self, prefix: str) -> None\nSet the prefix used for all `KSP` options in the database.\n\n Logically collective.\n\n Parameters\n ----------\n prefix\n The options prefix.\n\n Notes\n -----\n A hyphen (-) must NOT be given at the beginning of the prefix\n name. The first character of all runtime options is\n AUTOMATICALLY the hyphen. For example, to distinguish between\n the runtime options for two different `KSP` contexts, one could\n call\n ```\n KSPSetOptionsPrefix(ksp1, \"sys1_\")\n KSPSetOptionsPrefix(ksp2, \"sys2_\")\n ```\n\n This would enable use of different options for each system,\n such as\n ```\n -sys1_ksp_type gmres -sys1_ksp_rtol 1.e-3\n -sys2_ksp_type bcgs -sys2_ksp_rtol 1.e-4\n ```\n\n See Also\n --------\n petsc_options, petsc.KSPSetOptionsPrefix\n\n \nSource code at petsc4py/PETSc/KSP.pyx:526"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_15setOptionsPrefix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_prefix = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setOptionsPrefix (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_prefix,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_prefix)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 526, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setOptionsPrefix") < 0)) __PYX_ERR(49, 526, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_prefix = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setOptionsPrefix", 1, 1, 1, __pyx_nargs); __PYX_ERR(49, 526, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.KSP.setOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_14setOptionsPrefix(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_prefix); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_14setOptionsPrefix(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_prefix) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setOptionsPrefix", 0); __Pyx_INCREF(__pyx_v_prefix); /* "petsc4py/PETSc/KSP.pyx":560 * * """ * cdef const char *cval = NULL # <<<<<<<<<<<<<< * prefix = str2bytes(prefix, &cval) * CHKERR( KSPSetOptionsPrefix(self.ksp, cval) ) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/KSP.pyx":561 * """ * cdef const char *cval = NULL * prefix = str2bytes(prefix, &cval) # <<<<<<<<<<<<<< * CHKERR( KSPSetOptionsPrefix(self.ksp, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_prefix, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 561, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_prefix, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/KSP.pyx":562 * cdef const char *cval = NULL * prefix = str2bytes(prefix, &cval) * CHKERR( KSPSetOptionsPrefix(self.ksp, cval) ) # <<<<<<<<<<<<<< * * def getOptionsPrefix(self) -> str: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetOptionsPrefix(__pyx_v_self->ksp, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 562, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":526 * return bytes2str(cval) * * def setOptionsPrefix(self, prefix: str) -> None: # <<<<<<<<<<<<<< * """Set the prefix used for all `KSP` options in the database. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.KSP.setOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_prefix); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":564 * CHKERR( KSPSetOptionsPrefix(self.ksp, cval) ) * * def getOptionsPrefix(self) -> str: # <<<<<<<<<<<<<< * """Return the prefix used for all `KSP` options in the database. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_17getOptionsPrefix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_16getOptionsPrefix, "KSP.getOptionsPrefix(self) -> str\nReturn the prefix used for all `KSP` options in the database.\n\n Not collective.\n\n See Also\n --------\n petsc.KSPGetOptionsPrefix\n\n \nSource code at petsc4py/PETSc/KSP.pyx:564"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_17getOptionsPrefix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getOptionsPrefix (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getOptionsPrefix", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getOptionsPrefix", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_16getOptionsPrefix(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_16getOptionsPrefix(struct PyPetscKSPObject *__pyx_v_self) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getOptionsPrefix", 1); /* "petsc4py/PETSc/KSP.pyx":574 * * """ * cdef const char *cval = NULL # <<<<<<<<<<<<<< * CHKERR( KSPGetOptionsPrefix(self.ksp, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/KSP.pyx":575 * """ * cdef const char *cval = NULL * CHKERR( KSPGetOptionsPrefix(self.ksp, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPGetOptionsPrefix(__pyx_v_self->ksp, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 575, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":576 * cdef const char *cval = NULL * CHKERR( KSPGetOptionsPrefix(self.ksp, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * def appendOptionsPrefix(self, prefix: str) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 576, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/KSP.pyx":564 * CHKERR( KSPSetOptionsPrefix(self.ksp, cval) ) * * def getOptionsPrefix(self) -> str: # <<<<<<<<<<<<<< * """Return the prefix used for all `KSP` options in the database. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.KSP.getOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":578 * return bytes2str(cval) * * def appendOptionsPrefix(self, prefix: str) -> None: # <<<<<<<<<<<<<< * """Append to prefix used for all `KSP` options in the database. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_19appendOptionsPrefix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_18appendOptionsPrefix, "KSP.appendOptionsPrefix(self, prefix: str) -> None\nAppend to prefix used for all `KSP` options in the database.\n\n Logically collective.\n\n Parameters\n ----------\n prefix\n The options prefix to append.\n\n Notes\n -----\n A hyphen (-) must NOT be given at the beginning of the prefix\n name. The first character of all runtime options is\n AUTOMATICALLY the hyphen.\n\n See Also\n --------\n petsc.KSPAppendOptionsPrefix\n\n \nSource code at petsc4py/PETSc/KSP.pyx:578"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_19appendOptionsPrefix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_prefix = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("appendOptionsPrefix (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_prefix,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_prefix)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 578, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "appendOptionsPrefix") < 0)) __PYX_ERR(49, 578, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_prefix = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("appendOptionsPrefix", 1, 1, 1, __pyx_nargs); __PYX_ERR(49, 578, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.KSP.appendOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_18appendOptionsPrefix(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_prefix); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_18appendOptionsPrefix(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_prefix) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("appendOptionsPrefix", 0); __Pyx_INCREF(__pyx_v_prefix); /* "petsc4py/PETSc/KSP.pyx":599 * * """ * cdef const char *cval = NULL # <<<<<<<<<<<<<< * prefix = str2bytes(prefix, &cval) * CHKERR( KSPAppendOptionsPrefix(self.ksp, cval) ) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/KSP.pyx":600 * """ * cdef const char *cval = NULL * prefix = str2bytes(prefix, &cval) # <<<<<<<<<<<<<< * CHKERR( KSPAppendOptionsPrefix(self.ksp, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_prefix, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 600, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_prefix, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/KSP.pyx":601 * cdef const char *cval = NULL * prefix = str2bytes(prefix, &cval) * CHKERR( KSPAppendOptionsPrefix(self.ksp, cval) ) # <<<<<<<<<<<<<< * * def setFromOptions(self) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPAppendOptionsPrefix(__pyx_v_self->ksp, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 601, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":578 * return bytes2str(cval) * * def appendOptionsPrefix(self, prefix: str) -> None: # <<<<<<<<<<<<<< * """Append to prefix used for all `KSP` options in the database. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.KSP.appendOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_prefix); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":603 * CHKERR( KSPAppendOptionsPrefix(self.ksp, cval) ) * * def setFromOptions(self) -> None: # <<<<<<<<<<<<<< * """Set `KSP` options from the options database. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_21setFromOptions(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_20setFromOptions, "KSP.setFromOptions(self) -> None\nSet `KSP` options from the options database.\n\n Collective.\n\n This routine must be called before `setUp` if the user is\n to be allowed to set the Krylov type.\n\n See Also\n --------\n petsc_options, petsc.KSPSetFromOptions\n\n \nSource code at petsc4py/PETSc/KSP.pyx:603"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_21setFromOptions(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFromOptions (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("setFromOptions", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setFromOptions", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_20setFromOptions(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_20setFromOptions(struct PyPetscKSPObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFromOptions", 1); /* "petsc4py/PETSc/KSP.pyx":616 * * """ * CHKERR( KSPSetFromOptions(self.ksp) ) # <<<<<<<<<<<<<< * * # --- application context --- */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetFromOptions(__pyx_v_self->ksp)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 616, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":603 * CHKERR( KSPAppendOptionsPrefix(self.ksp, cval) ) * * def setFromOptions(self) -> None: # <<<<<<<<<<<<<< * """Set `KSP` options from the options database. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.setFromOptions", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":620 * # --- application context --- * * def setAppCtx(self, appctx: Any) -> None: # <<<<<<<<<<<<<< * """Set the optional user-defined context for the linear solver. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_23setAppCtx(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_22setAppCtx, "KSP.setAppCtx(self, appctx: Any) -> None\nSet the optional user-defined context for the linear solver.\n\n Not collective.\n\n Parameters\n ----------\n appctx\n The user defined context\n\n Notes\n -----\n The user context is a way for users to attach any information\n to the `KSP` that they may need later when interacting with\n the solver.\n\n See Also\n --------\n getAppCtx\n\n \nSource code at petsc4py/PETSc/KSP.pyx:620"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_23setAppCtx(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_appctx = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setAppCtx (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_appctx,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_appctx)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 620, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setAppCtx") < 0)) __PYX_ERR(49, 620, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_appctx = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setAppCtx", 1, 1, 1, __pyx_nargs); __PYX_ERR(49, 620, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.KSP.setAppCtx", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_22setAppCtx(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_appctx); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_22setAppCtx(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_appctx) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setAppCtx", 1); /* "petsc4py/PETSc/KSP.pyx":641 * * """ * self.set_attr('__appctx__', appctx) # <<<<<<<<<<<<<< * * def getAppCtx(self) -> Any: */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_KSP *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__appctx__"), __pyx_v_appctx); if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/KSP.pyx":620 * # --- application context --- * * def setAppCtx(self, appctx: Any) -> None: # <<<<<<<<<<<<<< * """Set the optional user-defined context for the linear solver. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.KSP.setAppCtx", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":643 * self.set_attr('__appctx__', appctx) * * def getAppCtx(self) -> Any: # <<<<<<<<<<<<<< * """Return the user-defined context for the linear solver. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_25getAppCtx(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_24getAppCtx, "KSP.getAppCtx(self) -> Any\nReturn the user-defined context for the linear solver.\n\n Not collective.\n\n See Also\n --------\n setAppCtx\n\n \nSource code at petsc4py/PETSc/KSP.pyx:643"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_25getAppCtx(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getAppCtx (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getAppCtx", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getAppCtx", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_24getAppCtx(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_24getAppCtx(struct PyPetscKSPObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getAppCtx", 1); /* "petsc4py/PETSc/KSP.pyx":653 * * """ * return self.get_attr('__appctx__') # <<<<<<<<<<<<<< * * # --- discretization space --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_KSP *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__appctx__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/KSP.pyx":643 * self.set_attr('__appctx__', appctx) * * def getAppCtx(self) -> Any: # <<<<<<<<<<<<<< * """Return the user-defined context for the linear solver. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.KSP.getAppCtx", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":657 * # --- discretization space --- * * def getDM(self) -> DM: # <<<<<<<<<<<<<< * """Return the `DM` that may be used by some preconditioners. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_27getDM(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_26getDM, "KSP.getDM(self) -> DM\nReturn the `DM` that may be used by some preconditioners.\n\n Not collective.\n\n See Also\n --------\n PETSc.KSP, DM, petsc.KSPGetDM\n\n \nSource code at petsc4py/PETSc/KSP.pyx:657"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_27getDM(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getDM (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getDM", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getDM", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_26getDM(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_26getDM(struct PyPetscKSPObject *__pyx_v_self) { DM __pyx_v_newdm; struct PyPetscDMObject *__pyx_v_dm = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getDM", 1); /* "petsc4py/PETSc/KSP.pyx":667 * * """ * cdef PetscDM newdm = NULL # <<<<<<<<<<<<<< * CHKERR( KSPGetDM(self.ksp, &newdm) ) * cdef DM dm = subtype_DM(newdm)() */ __pyx_v_newdm = NULL; /* "petsc4py/PETSc/KSP.pyx":668 * """ * cdef PetscDM newdm = NULL * CHKERR( KSPGetDM(self.ksp, &newdm) ) # <<<<<<<<<<<<<< * cdef DM dm = subtype_DM(newdm)() * dm.dm = newdm */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPGetDM(__pyx_v_self->ksp, (&__pyx_v_newdm))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 668, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":669 * cdef PetscDM newdm = NULL * CHKERR( KSPGetDM(self.ksp, &newdm) ) * cdef DM dm = subtype_DM(newdm)() # <<<<<<<<<<<<<< * dm.dm = newdm * CHKERR( PetscINCREF(dm.obj) ) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_newdm)); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 669, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(49, 669, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(49, 669, __pyx_L1_error) __pyx_v_dm = ((struct PyPetscDMObject *)__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/KSP.pyx":670 * CHKERR( KSPGetDM(self.ksp, &newdm) ) * cdef DM dm = subtype_DM(newdm)() * dm.dm = newdm # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(dm.obj) ) * return dm */ __pyx_v_dm->dm = __pyx_v_newdm; /* "petsc4py/PETSc/KSP.pyx":671 * cdef DM dm = subtype_DM(newdm)() * dm.dm = newdm * CHKERR( PetscINCREF(dm.obj) ) # <<<<<<<<<<<<<< * return dm * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_dm->__pyx_base.obj)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 671, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":672 * dm.dm = newdm * CHKERR( PetscINCREF(dm.obj) ) * return dm # <<<<<<<<<<<<<< * * def setDM(self, DM dm) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_dm); __pyx_r = ((PyObject *)__pyx_v_dm); goto __pyx_L0; /* "petsc4py/PETSc/KSP.pyx":657 * # --- discretization space --- * * def getDM(self) -> DM: # <<<<<<<<<<<<<< * """Return the `DM` that may be used by some preconditioners. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.getDM", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_dm); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":674 * return dm * * def setDM(self, DM dm) -> None: # <<<<<<<<<<<<<< * """Set the `DM` that may be used by some preconditioners. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_29setDM(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_28setDM, "KSP.setDM(self, dm: DM) -> None\nSet the `DM` that may be used by some preconditioners.\n\n Logically collective.\n\n Parameters\n ----------\n dm\n The `DM` object, cannot be `None`.\n\n Notes\n -----\n If this is used then the `KSP` will attempt to use the `DM` to\n create the matrix and use the routine set with\n `DM.setKSPComputeOperators`. Use ``setDMActive(False)``\n to instead use the matrix you have provided with\n `setOperators`.\n\n A `DM` can only be used for solving one problem at a time\n because information about the problem is stored on the `DM`,\n even when not using interfaces like\n `DM.setKSPComputeOperators`. Use `DM.clone` to get a distinct\n `DM` when solving different problems using the same function\n space.\n\n See Also\n --------\n PETSc.KSP, DM, DM.setKSPComputeOperators, setOperators, DM.clone\n petsc.KSPSetDM\n\n \nSource code at petsc4py/PETSc/KSP.pyx:674"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_29setDM(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscDMObject *__pyx_v_dm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setDM (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dm,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dm)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 674, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setDM") < 0)) __PYX_ERR(49, 674, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_dm = ((struct PyPetscDMObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setDM", 1, 1, 1, __pyx_nargs); __PYX_ERR(49, 674, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.KSP.setDM", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_ptype_8petsc4py_5PETSc_DM, 0, "dm", 0))) __PYX_ERR(49, 674, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_28setDM(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_dm); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_28setDM(struct PyPetscKSPObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setDM", 1); /* "petsc4py/PETSc/KSP.pyx":705 * * """ * CHKERR( KSPSetDM(self.ksp, dm.dm) ) # <<<<<<<<<<<<<< * * def setDMActive(self, flag: bool) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetDM(__pyx_v_self->ksp, __pyx_v_dm->dm)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 705, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":674 * return dm * * def setDM(self, DM dm) -> None: # <<<<<<<<<<<<<< * """Set the `DM` that may be used by some preconditioners. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.setDM", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":707 * CHKERR( KSPSetDM(self.ksp, dm.dm) ) * * def setDMActive(self, flag: bool) -> None: # <<<<<<<<<<<<<< * """`DM` should be used to generate system matrix & RHS vector. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_31setDMActive(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_30setDMActive, "KSP.setDMActive(self, flag: bool) -> None\n`DM` should be used to generate system matrix & RHS vector.\n\n Logically collective.\n\n Parameters\n ----------\n flag\n Whether to use the `DM`.\n\n Notes\n -----\n By default `setDM` sets the `DM` as active, call\n ``setDMActive(False)`` after ``setDM(dm)`` to not\n have the `KSP` object use the `DM` to generate the matrices.\n\n See Also\n --------\n PETSc.KSP, DM, setDM, petsc.KSPSetDMActive\n\n \nSource code at petsc4py/PETSc/KSP.pyx:707"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_31setDMActive(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_flag = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setDMActive (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flag)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 707, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setDMActive") < 0)) __PYX_ERR(49, 707, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_flag = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setDMActive", 1, 1, 1, __pyx_nargs); __PYX_ERR(49, 707, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.KSP.setDMActive", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_30setDMActive(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_flag); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_30setDMActive(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_flag) { PetscBool __pyx_v_cflag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setDMActive", 1); /* "petsc4py/PETSc/KSP.pyx":728 * * """ * cdef PetscBool cflag = asBool(flag) # <<<<<<<<<<<<<< * CHKERR( KSPSetDMActive(self.ksp, cflag) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asBool(__pyx_v_flag); if (unlikely(__pyx_t_1 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(49, 728, __pyx_L1_error) __pyx_v_cflag = __pyx_t_1; /* "petsc4py/PETSc/KSP.pyx":729 * """ * cdef PetscBool cflag = asBool(flag) * CHKERR( KSPSetDMActive(self.ksp, cflag) ) # <<<<<<<<<<<<<< * * # --- operators and preconditioner --- */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetDMActive(__pyx_v_self->ksp, __pyx_v_cflag)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 729, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":707 * CHKERR( KSPSetDM(self.ksp, dm.dm) ) * * def setDMActive(self, flag: bool) -> None: # <<<<<<<<<<<<<< * """`DM` should be used to generate system matrix & RHS vector. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.setDMActive", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":733 * # --- operators and preconditioner --- * * def setComputeRHS( # <<<<<<<<<<<<<< * self, * rhs: KSPRHSFunction, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_33setComputeRHS(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_32setComputeRHS, "KSP.setComputeRHS(self, rhs: KSPRHSFunction, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nSet routine to compute the right-hand side of the linear system.\n\n Logically collective.\n\n Parameters\n ----------\n rhs\n Function which computes the right-hand side.\n args\n Positional arguments for callback function ``rhs``.\n kargs\n Keyword arguments for callback function ``rhs``.\n\n Notes\n -----\n The routine you provide will be called each time you call `solve`\n to prepare the new right-hand side for that solve.\n\n See Also\n --------\n PETSc.KSP, solve, petsc.KSPSetComputeRHS\n\n \nSource code at petsc4py/PETSc/KSP.pyx:733"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_33setComputeRHS(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_rhs = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setComputeRHS (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rhs,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; /* "petsc4py/PETSc/KSP.pyx":736 * self, * rhs: KSPRHSFunction, * args: tuple[Any, ...] | None = None, # <<<<<<<<<<<<<< * kargs: dict[str, Any] | None = None * ) -> None: */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/KSP.pyx":737 * rhs: KSPRHSFunction, * args: tuple[Any, ...] | None = None, * kargs: dict[str, Any] | None = None # <<<<<<<<<<<<<< * ) -> None: * """Set routine to compute the right-hand side of the linear system. */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rhs)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 733, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 733, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 733, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setComputeRHS") < 0)) __PYX_ERR(49, 733, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_rhs = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setComputeRHS", 0, 1, 3, __pyx_nargs); __PYX_ERR(49, 733, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.KSP.setComputeRHS", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_32setComputeRHS(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_rhs, __pyx_v_args, __pyx_v_kargs); /* "petsc4py/PETSc/KSP.pyx":733 * # --- operators and preconditioner --- * * def setComputeRHS( # <<<<<<<<<<<<<< * self, * rhs: KSPRHSFunction, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_32setComputeRHS(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_rhs, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setComputeRHS", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/KSP.pyx":762 * * """ * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (rhs, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/KSP.pyx":763 * """ * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (rhs, args, kargs) * self.set_attr('__rhs__', context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); if (__pyx_t_1) { __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 763, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_2); __pyx_t_2 = 0; } /* "petsc4py/PETSc/KSP.pyx":764 * if args is None: args = () * if kargs is None: kargs = {} * context = (rhs, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__rhs__', context) * CHKERR( KSPSetComputeRHS(self.ksp, KSP_ComputeRHS, context) ) */ __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 764, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_rhs); __Pyx_GIVEREF(__pyx_v_rhs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_rhs)) __PYX_ERR(49, 764, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_args)) __PYX_ERR(49, 764, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_kargs)) __PYX_ERR(49, 764, __pyx_L1_error); __pyx_v_context = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/KSP.pyx":765 * if kargs is None: kargs = {} * context = (rhs, args, kargs) * self.set_attr('__rhs__', context) # <<<<<<<<<<<<<< * CHKERR( KSPSetComputeRHS(self.ksp, KSP_ComputeRHS, context) ) * */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_KSP *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__rhs__"), __pyx_v_context); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 765, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/KSP.pyx":766 * context = (rhs, args, kargs) * self.set_attr('__rhs__', context) * CHKERR( KSPSetComputeRHS(self.ksp, KSP_ComputeRHS, context) ) # <<<<<<<<<<<<<< * * def setComputeOperators( */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetComputeRHS(__pyx_v_self->ksp, __pyx_f_8petsc4py_5PETSc_KSP_ComputeRHS, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 766, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":733 * # --- operators and preconditioner --- * * def setComputeRHS( # <<<<<<<<<<<<<< * self, * rhs: KSPRHSFunction, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.KSP.setComputeRHS", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":768 * CHKERR( KSPSetComputeRHS(self.ksp, KSP_ComputeRHS, context) ) * * def setComputeOperators( # <<<<<<<<<<<<<< * self, * operators: KSPOperatorsFunction, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_35setComputeOperators(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_34setComputeOperators, "KSP.setComputeOperators(self, operators: KSPOperatorsFunction, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nSet routine to compute the linear operators.\n\n Logically collective.\n\n Parameters\n ----------\n operators\n Function which computes the operators.\n args\n Positional arguments for callback function ``operators``.\n kargs\n Keyword arguments for callback function ``operators``.\n\n Notes\n -----\n The user provided function `operators` will be called\n automatically at the very next call to `solve`. It will NOT\n be called at future `solve` calls unless either\n `setComputeOperators` or `setOperators` is called\n before that `solve` is called. This allows the same system\n to be solved several times with different right-hand side\n functions, but is a confusing API since one might expect it to\n be called for each `solve`.\n\n To reuse the same preconditioner for the next `solve` and\n not compute a new one based on the most recently computed\n matrix call `petsc.KSPSetReusePreconditioner`.\n\n See Also\n --------\n PETSc.KSP, solve, setOperators, petsc.KSPSetComputeOperators\n petsc.KSPSetReusePreconditioner\n\n \nSource code at petsc4py/PETSc/KSP.pyx:768"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_35setComputeOperators(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_operators = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setComputeOperators (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_operators,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; /* "petsc4py/PETSc/KSP.pyx":771 * self, * operators: KSPOperatorsFunction, * args: tuple[Any, ...] | None = None, # <<<<<<<<<<<<<< * kargs: dict[str, Any] | None = None * ) -> None: */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/KSP.pyx":772 * operators: KSPOperatorsFunction, * args: tuple[Any, ...] | None = None, * kargs: dict[str, Any] | None = None # <<<<<<<<<<<<<< * ) -> None: * """Set routine to compute the linear operators. */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_operators)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 768, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 768, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 768, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setComputeOperators") < 0)) __PYX_ERR(49, 768, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_operators = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setComputeOperators", 0, 1, 3, __pyx_nargs); __PYX_ERR(49, 768, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.KSP.setComputeOperators", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_34setComputeOperators(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_operators, __pyx_v_args, __pyx_v_kargs); /* "petsc4py/PETSc/KSP.pyx":768 * CHKERR( KSPSetComputeRHS(self.ksp, KSP_ComputeRHS, context) ) * * def setComputeOperators( # <<<<<<<<<<<<<< * self, * operators: KSPOperatorsFunction, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_34setComputeOperators(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_operators, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setComputeOperators", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/KSP.pyx":808 * * """ * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (operators, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/KSP.pyx":809 * """ * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (operators, args, kargs) * self.set_attr('__operators__', context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); if (__pyx_t_1) { __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 809, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_2); __pyx_t_2 = 0; } /* "petsc4py/PETSc/KSP.pyx":810 * if args is None: args = () * if kargs is None: kargs = {} * context = (operators, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__operators__', context) * CHKERR( KSPSetComputeOperators(self.ksp, KSP_ComputeOps, context) ) */ __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 810, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_operators); __Pyx_GIVEREF(__pyx_v_operators); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_operators)) __PYX_ERR(49, 810, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_args)) __PYX_ERR(49, 810, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_kargs)) __PYX_ERR(49, 810, __pyx_L1_error); __pyx_v_context = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/KSP.pyx":811 * if kargs is None: kargs = {} * context = (operators, args, kargs) * self.set_attr('__operators__', context) # <<<<<<<<<<<<<< * CHKERR( KSPSetComputeOperators(self.ksp, KSP_ComputeOps, context) ) * */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_KSP *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__operators__"), __pyx_v_context); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 811, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/KSP.pyx":812 * context = (operators, args, kargs) * self.set_attr('__operators__', context) * CHKERR( KSPSetComputeOperators(self.ksp, KSP_ComputeOps, context) ) # <<<<<<<<<<<<<< * * def setOperators(self, Mat A=None, Mat P=None) -> None: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetComputeOperators(__pyx_v_self->ksp, __pyx_f_8petsc4py_5PETSc_KSP_ComputeOps, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 812, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":768 * CHKERR( KSPSetComputeRHS(self.ksp, KSP_ComputeRHS, context) ) * * def setComputeOperators( # <<<<<<<<<<<<<< * self, * operators: KSPOperatorsFunction, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.KSP.setComputeOperators", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":814 * CHKERR( KSPSetComputeOperators(self.ksp, KSP_ComputeOps, context) ) * * def setOperators(self, Mat A=None, Mat P=None) -> None: # <<<<<<<<<<<<<< * """Set matrix associated with the linear system. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_37setOperators(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_36setOperators, "KSP.setOperators(self, A: Mat | None = None, P: Mat | None = None) -> None\nSet matrix associated with the linear system.\n\n Collective.\n\n Set the matrix associated with the linear system and a\n (possibly) different one from which the preconditioner will be\n built.\n\n Parameters\n ----------\n A\n Matrix that defines the linear system.\n P\n Matrix to be used in constructing the preconditioner,\n usually the same as ``A``.\n\n Notes\n -----\n If you know the operator ``A`` has a null space you can use\n `Mat.setNullSpace` and `Mat.setTransposeNullSpace` to supply the\n null space to ``A`` and the `KSP` solvers will automatically use\n that null space as needed during the solution process.\n\n All future calls to `setOperators` must use the same size\n matrices!\n\n Passing `None` for ``A`` or ``P`` removes the matrix that is\n currently used.\n\n See Also\n --------\n PETSc.KSP, solve, setComputeOperators, petsc.KSPSetOperators\n\n \nSource code at petsc4py/PETSc/KSP.pyx:814"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_37setOperators(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscMatObject *__pyx_v_A = 0; struct PyPetscMatObject *__pyx_v_P = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setOperators (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_P,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscMatObject *)Py_None)); values[1] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscMatObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_A); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 814, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_P); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 814, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setOperators") < 0)) __PYX_ERR(49, 814, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_A = ((struct PyPetscMatObject *)values[0]); __pyx_v_P = ((struct PyPetscMatObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setOperators", 0, 0, 2, __pyx_nargs); __PYX_ERR(49, 814, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.KSP.setOperators", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_A), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "A", 0))) __PYX_ERR(49, 814, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_P), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "P", 0))) __PYX_ERR(49, 814, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_36setOperators(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_A, __pyx_v_P); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_36setOperators(struct PyPetscKSPObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_A, struct PyPetscMatObject *__pyx_v_P) { Mat __pyx_v_amat; Mat __pyx_v_pmat; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; Mat __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setOperators", 1); /* "petsc4py/PETSc/KSP.pyx":849 * * """ * cdef PetscMat amat=NULL # <<<<<<<<<<<<<< * if A is not None: amat = A.mat * cdef PetscMat pmat=amat */ __pyx_v_amat = NULL; /* "petsc4py/PETSc/KSP.pyx":850 * """ * cdef PetscMat amat=NULL * if A is not None: amat = A.mat # <<<<<<<<<<<<<< * cdef PetscMat pmat=amat * if P is not None: pmat = P.mat */ __pyx_t_1 = (((PyObject *)__pyx_v_A) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_A->mat; __pyx_v_amat = __pyx_t_2; } /* "petsc4py/PETSc/KSP.pyx":851 * cdef PetscMat amat=NULL * if A is not None: amat = A.mat * cdef PetscMat pmat=amat # <<<<<<<<<<<<<< * if P is not None: pmat = P.mat * CHKERR( KSPSetOperators(self.ksp, amat, pmat) ) */ __pyx_v_pmat = __pyx_v_amat; /* "petsc4py/PETSc/KSP.pyx":852 * if A is not None: amat = A.mat * cdef PetscMat pmat=amat * if P is not None: pmat = P.mat # <<<<<<<<<<<<<< * CHKERR( KSPSetOperators(self.ksp, amat, pmat) ) * */ __pyx_t_1 = (((PyObject *)__pyx_v_P) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_P->mat; __pyx_v_pmat = __pyx_t_2; } /* "petsc4py/PETSc/KSP.pyx":853 * cdef PetscMat pmat=amat * if P is not None: pmat = P.mat * CHKERR( KSPSetOperators(self.ksp, amat, pmat) ) # <<<<<<<<<<<<<< * * def getOperators(self) -> tuple[Mat, Mat]: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetOperators(__pyx_v_self->ksp, __pyx_v_amat, __pyx_v_pmat)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 853, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":814 * CHKERR( KSPSetComputeOperators(self.ksp, KSP_ComputeOps, context) ) * * def setOperators(self, Mat A=None, Mat P=None) -> None: # <<<<<<<<<<<<<< * """Set matrix associated with the linear system. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.setOperators", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":855 * CHKERR( KSPSetOperators(self.ksp, amat, pmat) ) * * def getOperators(self) -> tuple[Mat, Mat]: # <<<<<<<<<<<<<< * """Return the matrix associated with the linear system. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_39getOperators(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_38getOperators, "KSP.getOperators(self) -> tuple[Mat, Mat]\nReturn the matrix associated with the linear system.\n\n Collective.\n\n Return the matrix associated with the linear system and a\n (possibly) different one used to construct the preconditioner.\n\n Returns\n -------\n A : Mat\n Matrix that defines the linear system.\n P : Mat\n Matrix to be used in constructing the preconditioner,\n usually the same as ``A``.\n\n See Also\n --------\n PETSc.KSP, solve, setOperators, petsc.KSPGetOperators\n\n \nSource code at petsc4py/PETSc/KSP.pyx:855"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_39getOperators(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getOperators (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getOperators", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getOperators", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_38getOperators(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_38getOperators(struct PyPetscKSPObject *__pyx_v_self) { struct PyPetscMatObject *__pyx_v_A = 0; struct PyPetscMatObject *__pyx_v_P = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getOperators", 1); /* "petsc4py/PETSc/KSP.pyx":876 * * """ * cdef Mat A = Mat(), P = Mat() # <<<<<<<<<<<<<< * CHKERR( KSPGetOperators(self.ksp, &A.mat, &P.mat) ) * CHKERR( PetscINCREF(A.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 876, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_A = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 876, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_P = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/KSP.pyx":877 * """ * cdef Mat A = Mat(), P = Mat() * CHKERR( KSPGetOperators(self.ksp, &A.mat, &P.mat) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(A.obj) ) * CHKERR( PetscINCREF(P.obj) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPGetOperators(__pyx_v_self->ksp, (&__pyx_v_A->mat), (&__pyx_v_P->mat))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 877, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":878 * cdef Mat A = Mat(), P = Mat() * CHKERR( KSPGetOperators(self.ksp, &A.mat, &P.mat) ) * CHKERR( PetscINCREF(A.obj) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(P.obj) ) * return (A, P) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_A->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 878, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":879 * CHKERR( KSPGetOperators(self.ksp, &A.mat, &P.mat) ) * CHKERR( PetscINCREF(A.obj) ) * CHKERR( PetscINCREF(P.obj) ) # <<<<<<<<<<<<<< * return (A, P) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_P->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 879, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":880 * CHKERR( PetscINCREF(A.obj) ) * CHKERR( PetscINCREF(P.obj) ) * return (A, P) # <<<<<<<<<<<<<< * * def setPC(self, PC pc) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 880, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF((PyObject *)__pyx_v_A); __Pyx_GIVEREF((PyObject *)__pyx_v_A); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_A))) __PYX_ERR(49, 880, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_P); __Pyx_GIVEREF((PyObject *)__pyx_v_P); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_P))) __PYX_ERR(49, 880, __pyx_L1_error); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/KSP.pyx":855 * CHKERR( KSPSetOperators(self.ksp, amat, pmat) ) * * def getOperators(self) -> tuple[Mat, Mat]: # <<<<<<<<<<<<<< * """Return the matrix associated with the linear system. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.KSP.getOperators", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_A); __Pyx_XDECREF((PyObject *)__pyx_v_P); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":882 * return (A, P) * * def setPC(self, PC pc) -> None: # <<<<<<<<<<<<<< * """Set the preconditioner. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_41setPC(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_40setPC, "KSP.setPC(self, pc: PC) -> None\nSet the preconditioner.\n\n Collective.\n\n Set the preconditioner to be used to calculate the application\n of the preconditioner on a vector.\n\n Parameters\n ----------\n pc\n The preconditioner object\n\n See Also\n --------\n PETSc.KSP, getPC, petsc.KSPSetPC\n\n \nSource code at petsc4py/PETSc/KSP.pyx:882"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_41setPC(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscPCObject *__pyx_v_pc = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPC (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pc,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pc)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 882, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setPC") < 0)) __PYX_ERR(49, 882, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_pc = ((struct PyPetscPCObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPC", 1, 1, 1, __pyx_nargs); __PYX_ERR(49, 882, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.KSP.setPC", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pc), __pyx_ptype_8petsc4py_5PETSc_PC, 0, "pc", 0))) __PYX_ERR(49, 882, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_40setPC(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_pc); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_40setPC(struct PyPetscKSPObject *__pyx_v_self, struct PyPetscPCObject *__pyx_v_pc) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPC", 1); /* "petsc4py/PETSc/KSP.pyx":900 * * """ * CHKERR( KSPSetPC(self.ksp, pc.pc) ) # <<<<<<<<<<<<<< * * def getPC(self) -> PC: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetPC(__pyx_v_self->ksp, __pyx_v_pc->pc)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 900, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":882 * return (A, P) * * def setPC(self, PC pc) -> None: # <<<<<<<<<<<<<< * """Set the preconditioner. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.setPC", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":902 * CHKERR( KSPSetPC(self.ksp, pc.pc) ) * * def getPC(self) -> PC: # <<<<<<<<<<<<<< * """Return the preconditioner. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_43getPC(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_42getPC, "KSP.getPC(self) -> PC\nReturn the preconditioner.\n\n Not collective.\n\n See Also\n --------\n PETSc.KSP, setPC, petsc.KSPGetPC\n\n \nSource code at petsc4py/PETSc/KSP.pyx:902"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_43getPC(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getPC (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getPC", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getPC", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_42getPC(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_42getPC(struct PyPetscKSPObject *__pyx_v_self) { struct PyPetscPCObject *__pyx_v_pc = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getPC", 1); /* "petsc4py/PETSc/KSP.pyx":912 * * """ * cdef PC pc = PC() # <<<<<<<<<<<<<< * CHKERR( KSPGetPC(self.ksp, &pc.pc) ) * CHKERR( PetscINCREF(pc.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_PC)); if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 912, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_pc = ((struct PyPetscPCObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/KSP.pyx":913 * """ * cdef PC pc = PC() * CHKERR( KSPGetPC(self.ksp, &pc.pc) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(pc.obj) ) * return pc */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPGetPC(__pyx_v_self->ksp, (&__pyx_v_pc->pc))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 913, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":914 * cdef PC pc = PC() * CHKERR( KSPGetPC(self.ksp, &pc.pc) ) * CHKERR( PetscINCREF(pc.obj) ) # <<<<<<<<<<<<<< * return pc * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_pc->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 914, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":915 * CHKERR( KSPGetPC(self.ksp, &pc.pc) ) * CHKERR( PetscINCREF(pc.obj) ) * return pc # <<<<<<<<<<<<<< * * # --- tolerances and convergence --- */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_pc); __pyx_r = ((PyObject *)__pyx_v_pc); goto __pyx_L0; /* "petsc4py/PETSc/KSP.pyx":902 * CHKERR( KSPSetPC(self.ksp, pc.pc) ) * * def getPC(self) -> PC: # <<<<<<<<<<<<<< * """Return the preconditioner. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.KSP.getPC", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_pc); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":919 * # --- tolerances and convergence --- * * def setTolerances( # <<<<<<<<<<<<<< * self, * rtol: float | None = None, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_45setTolerances(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_44setTolerances, "KSP.setTolerances(self, rtol: float | None = None, atol: float | None = None, divtol: float | None = None, max_it: int | None = None) -> None\nSet various tolerances used by the KSP convergence testers.\n\n Logically collective.\n\n Set the relative, absolute, divergence, and maximum iteration\n tolerances used by the default KSP convergence testers.\n\n Parameters\n ----------\n rtol\n The relative convergence tolerance, relative decrease in\n the (possibly preconditioned) residual norm.\n atol\n The absolute convergence tolerance absolute size of the\n (possibly preconditioned) residual norm.\n dtol\n The divergence tolerance, amount (possibly preconditioned)\n residual norm can increase before\n `petsc.KSPConvergedDefault` concludes that the method is\n diverging.\n max_it\n Maximum number of iterations to use.\n\n Notes\n -----\n Use `None` to retain the default value of any of the\n tolerances.\n\n See Also\n --------\n petsc_options, getTolerances, setConvergenceTest\n petsc.KSPSetTolerances, petsc.KSPConvergedDefault\n\n \nSource code at petsc4py/PETSc/KSP.pyx:919"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_45setTolerances(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_rtol = 0; PyObject *__pyx_v_atol = 0; PyObject *__pyx_v_divtol = 0; PyObject *__pyx_v_max_it = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setTolerances (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rtol,&__pyx_n_s_atol,&__pyx_n_s_divtol,&__pyx_n_s_max_it,0}; /* "petsc4py/PETSc/KSP.pyx":921 * def setTolerances( * self, * rtol: float | None = None, # <<<<<<<<<<<<<< * atol: float | None = None, * divtol: float | None = None, */ values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/KSP.pyx":922 * self, * rtol: float | None = None, * atol: float | None = None, # <<<<<<<<<<<<<< * divtol: float | None = None, * max_it: int | None = None */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/KSP.pyx":923 * rtol: float | None = None, * atol: float | None = None, * divtol: float | None = None, # <<<<<<<<<<<<<< * max_it: int | None = None * ) -> None: */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/KSP.pyx":924 * atol: float | None = None, * divtol: float | None = None, * max_it: int | None = None # <<<<<<<<<<<<<< * ) -> None: * """Set various tolerances used by the KSP convergence testers. */ values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rtol); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 919, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_atol); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 919, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_divtol); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 919, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_max_it); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 919, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setTolerances") < 0)) __PYX_ERR(49, 919, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_rtol = values[0]; __pyx_v_atol = values[1]; __pyx_v_divtol = values[2]; __pyx_v_max_it = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setTolerances", 0, 0, 4, __pyx_nargs); __PYX_ERR(49, 919, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.KSP.setTolerances", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_44setTolerances(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_rtol, __pyx_v_atol, __pyx_v_divtol, __pyx_v_max_it); /* "petsc4py/PETSc/KSP.pyx":919 * # --- tolerances and convergence --- * * def setTolerances( # <<<<<<<<<<<<<< * self, * rtol: float | None = None, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_44setTolerances(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_rtol, PyObject *__pyx_v_atol, PyObject *__pyx_v_divtol, PyObject *__pyx_v_max_it) { PetscReal __pyx_v_crtol; PetscReal __pyx_v_catol; PetscReal __pyx_v_cdivtol; PetscInt __pyx_v_cmaxits; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscReal __pyx_t_2; PetscInt __pyx_t_3; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setTolerances", 1); /* "petsc4py/PETSc/KSP.pyx":961 * """ * cdef PetscReal crtol, catol, cdivtol * crtol = catol = cdivtol = PETSC_DEFAULT; # <<<<<<<<<<<<<< * if rtol is not None: crtol = asReal(rtol) * if atol is not None: catol = asReal(atol) */ __pyx_v_crtol = PETSC_DEFAULT; __pyx_v_catol = PETSC_DEFAULT; __pyx_v_cdivtol = PETSC_DEFAULT; /* "petsc4py/PETSc/KSP.pyx":962 * cdef PetscReal crtol, catol, cdivtol * crtol = catol = cdivtol = PETSC_DEFAULT; * if rtol is not None: crtol = asReal(rtol) # <<<<<<<<<<<<<< * if atol is not None: catol = asReal(atol) * if divtol is not None: cdivtol = asReal(divtol) */ __pyx_t_1 = (__pyx_v_rtol != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_rtol); if (unlikely(__pyx_t_2 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(49, 962, __pyx_L1_error) __pyx_v_crtol = __pyx_t_2; } /* "petsc4py/PETSc/KSP.pyx":963 * crtol = catol = cdivtol = PETSC_DEFAULT; * if rtol is not None: crtol = asReal(rtol) * if atol is not None: catol = asReal(atol) # <<<<<<<<<<<<<< * if divtol is not None: cdivtol = asReal(divtol) * cdef PetscInt cmaxits = PETSC_DEFAULT */ __pyx_t_1 = (__pyx_v_atol != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_atol); if (unlikely(__pyx_t_2 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(49, 963, __pyx_L1_error) __pyx_v_catol = __pyx_t_2; } /* "petsc4py/PETSc/KSP.pyx":964 * if rtol is not None: crtol = asReal(rtol) * if atol is not None: catol = asReal(atol) * if divtol is not None: cdivtol = asReal(divtol) # <<<<<<<<<<<<<< * cdef PetscInt cmaxits = PETSC_DEFAULT * if max_it is not None: cmaxits = asInt(max_it) */ __pyx_t_1 = (__pyx_v_divtol != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_divtol); if (unlikely(__pyx_t_2 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(49, 964, __pyx_L1_error) __pyx_v_cdivtol = __pyx_t_2; } /* "petsc4py/PETSc/KSP.pyx":965 * if atol is not None: catol = asReal(atol) * if divtol is not None: cdivtol = asReal(divtol) * cdef PetscInt cmaxits = PETSC_DEFAULT # <<<<<<<<<<<<<< * if max_it is not None: cmaxits = asInt(max_it) * CHKERR( KSPSetTolerances(self.ksp, crtol, catol, cdivtol, cmaxits) ) */ __pyx_v_cmaxits = PETSC_DEFAULT; /* "petsc4py/PETSc/KSP.pyx":966 * if divtol is not None: cdivtol = asReal(divtol) * cdef PetscInt cmaxits = PETSC_DEFAULT * if max_it is not None: cmaxits = asInt(max_it) # <<<<<<<<<<<<<< * CHKERR( KSPSetTolerances(self.ksp, crtol, catol, cdivtol, cmaxits) ) * */ __pyx_t_1 = (__pyx_v_max_it != Py_None); if (__pyx_t_1) { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_max_it); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(49, 966, __pyx_L1_error) __pyx_v_cmaxits = __pyx_t_3; } /* "petsc4py/PETSc/KSP.pyx":967 * cdef PetscInt cmaxits = PETSC_DEFAULT * if max_it is not None: cmaxits = asInt(max_it) * CHKERR( KSPSetTolerances(self.ksp, crtol, catol, cdivtol, cmaxits) ) # <<<<<<<<<<<<<< * * def getTolerances(self) -> tuple[float, float, float, int]: */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetTolerances(__pyx_v_self->ksp, __pyx_v_crtol, __pyx_v_catol, __pyx_v_cdivtol, __pyx_v_cmaxits)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 967, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":919 * # --- tolerances and convergence --- * * def setTolerances( # <<<<<<<<<<<<<< * self, * rtol: float | None = None, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.setTolerances", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":969 * CHKERR( KSPSetTolerances(self.ksp, crtol, catol, cdivtol, cmaxits) ) * * def getTolerances(self) -> tuple[float, float, float, int]: # <<<<<<<<<<<<<< * """Return various tolerances used by the KSP convergence tests. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_47getTolerances(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_46getTolerances, "KSP.getTolerances(self) -> tuple[float, float, float, int]\nReturn various tolerances used by the KSP convergence tests.\n\n Not collective.\n\n Return the relative, absolute, divergence, and maximum iteration\n tolerances used by the default KSP convergence tests.\n\n Returns\n -------\n rtol : float\n The relative convergence tolerance\n atol : float\n The absolute convergence tolerance\n dtol : float\n The divergence tolerance\n maxits : int\n Maximum number of iterations\n\n See Also\n --------\n setTolerances, petsc.KSPGetTolerances\n\n \nSource code at petsc4py/PETSc/KSP.pyx:969"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_47getTolerances(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getTolerances (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getTolerances", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getTolerances", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_46getTolerances(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_46getTolerances(struct PyPetscKSPObject *__pyx_v_self) { PetscReal __pyx_v_crtol; PetscReal __pyx_v_catol; PetscReal __pyx_v_cdivtol; PetscInt __pyx_v_cmaxits; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getTolerances", 1); /* "petsc4py/PETSc/KSP.pyx":993 * * """ * cdef PetscReal crtol=0, catol=0, cdivtol=0 # <<<<<<<<<<<<<< * cdef PetscInt cmaxits=0 * CHKERR( KSPGetTolerances(self.ksp, &crtol, &catol, &cdivtol, &cmaxits) ) */ __pyx_v_crtol = 0.0; __pyx_v_catol = 0.0; __pyx_v_cdivtol = 0.0; /* "petsc4py/PETSc/KSP.pyx":994 * """ * cdef PetscReal crtol=0, catol=0, cdivtol=0 * cdef PetscInt cmaxits=0 # <<<<<<<<<<<<<< * CHKERR( KSPGetTolerances(self.ksp, &crtol, &catol, &cdivtol, &cmaxits) ) * return (toReal(crtol), toReal(catol), toReal(cdivtol), toInt(cmaxits)) */ __pyx_v_cmaxits = 0; /* "petsc4py/PETSc/KSP.pyx":995 * cdef PetscReal crtol=0, catol=0, cdivtol=0 * cdef PetscInt cmaxits=0 * CHKERR( KSPGetTolerances(self.ksp, &crtol, &catol, &cdivtol, &cmaxits) ) # <<<<<<<<<<<<<< * return (toReal(crtol), toReal(catol), toReal(cdivtol), toInt(cmaxits)) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPGetTolerances(__pyx_v_self->ksp, (&__pyx_v_crtol), (&__pyx_v_catol), (&__pyx_v_cdivtol), (&__pyx_v_cmaxits))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 995, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":996 * cdef PetscInt cmaxits=0 * CHKERR( KSPGetTolerances(self.ksp, &crtol, &catol, &cdivtol, &cmaxits) ) * return (toReal(crtol), toReal(catol), toReal(cdivtol), toInt(cmaxits)) # <<<<<<<<<<<<<< * * def setConvergenceTest( */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_crtol); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 996, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_catol); if (unlikely(!__pyx_t_3)) __PYX_ERR(49, 996, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_cdivtol); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 996, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_cmaxits); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 996, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(49, 996, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2)) __PYX_ERR(49, 996, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3)) __PYX_ERR(49, 996, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_4)) __PYX_ERR(49, 996, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_5)) __PYX_ERR(49, 996, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "petsc4py/PETSc/KSP.pyx":969 * CHKERR( KSPSetTolerances(self.ksp, crtol, catol, cdivtol, cmaxits) ) * * def getTolerances(self) -> tuple[float, float, float, int]: # <<<<<<<<<<<<<< * """Return various tolerances used by the KSP convergence tests. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.KSP.getTolerances", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":998 * return (toReal(crtol), toReal(catol), toReal(cdivtol), toInt(cmaxits)) * * def setConvergenceTest( # <<<<<<<<<<<<<< * self, * converged: KSPConvergenceTestFunction, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_49setConvergenceTest(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_48setConvergenceTest, "KSP.setConvergenceTest(self, converged: KSPConvergenceTestFunction, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nSet the function to be used to determine convergence.\n\n Logically collective.\n\n Parameters\n ----------\n converged\n Callback which computes the convergence.\n args\n Positional arguments for callback function.\n kargs\n Keyword arguments for callback function.\n\n Notes\n -----\n Must be called after the KSP type has been set so put this\n after a call to `setType`, or `setFromOptions`.\n\n The default convergence test, `petsc.KSPConvergedDefault`,\n aborts if the residual grows to more than 10000 times the\n initial residual.\n\n The default is a combination of relative and absolute\n tolerances. The residual value that is tested may be an\n approximation; routines that need exact values should compute\n them.\n\n In the default PETSc convergence test, the precise values of\n reason are macros such as ``KSP_CONVERGED_RTOL``, which are\n defined in ``petsch``.\n\n See Also\n --------\n setTolerances, getConvergenceTest, petsc.KSPSetConvergenceTest\n petsc.KSPConvergedDefault\n\n \nSource code at petsc4py/PETSc/KSP.pyx:998"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_49setConvergenceTest(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_converged = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setConvergenceTest (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_converged,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; /* "petsc4py/PETSc/KSP.pyx":1001 * self, * converged: KSPConvergenceTestFunction, * args: tuple[Any, ...] | None = None, # <<<<<<<<<<<<<< * kargs: dict[str, Any] | None = None * ) -> None: */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/KSP.pyx":1002 * converged: KSPConvergenceTestFunction, * args: tuple[Any, ...] | None = None, * kargs: dict[str, Any] | None = None # <<<<<<<<<<<<<< * ) -> None: * """Set the function to be used to determine convergence. */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_converged)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 998, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 998, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 998, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setConvergenceTest") < 0)) __PYX_ERR(49, 998, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_converged = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setConvergenceTest", 0, 1, 3, __pyx_nargs); __PYX_ERR(49, 998, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.KSP.setConvergenceTest", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_48setConvergenceTest(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_converged, __pyx_v_args, __pyx_v_kargs); /* "petsc4py/PETSc/KSP.pyx":998 * return (toReal(crtol), toReal(catol), toReal(cdivtol), toInt(cmaxits)) * * def setConvergenceTest( # <<<<<<<<<<<<<< * self, * converged: KSPConvergenceTestFunction, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_48setConvergenceTest(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_converged, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { KSPNormType __pyx_v_normtype; void *__pyx_v_cctx; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setConvergenceTest", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/KSP.pyx":1041 * * """ * cdef PetscKSPNormType normtype = KSP_NORM_NONE # <<<<<<<<<<<<<< * cdef void* cctx = NULL * if converged is not None: */ __pyx_v_normtype = KSP_NORM_NONE; /* "petsc4py/PETSc/KSP.pyx":1042 * """ * cdef PetscKSPNormType normtype = KSP_NORM_NONE * cdef void* cctx = NULL # <<<<<<<<<<<<<< * if converged is not None: * CHKERR( KSPSetConvergenceTest( */ __pyx_v_cctx = NULL; /* "petsc4py/PETSc/KSP.pyx":1043 * cdef PetscKSPNormType normtype = KSP_NORM_NONE * cdef void* cctx = NULL * if converged is not None: # <<<<<<<<<<<<<< * CHKERR( KSPSetConvergenceTest( * self.ksp, KSP_Converged, NULL, NULL) ) */ __pyx_t_1 = (__pyx_v_converged != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/KSP.pyx":1044 * cdef void* cctx = NULL * if converged is not None: * CHKERR( KSPSetConvergenceTest( # <<<<<<<<<<<<<< * self.ksp, KSP_Converged, NULL, NULL) ) * if args is None: args = () */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetConvergenceTest(__pyx_v_self->ksp, __pyx_f_8petsc4py_5PETSc_KSP_Converged, NULL, NULL)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 1044, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":1046 * CHKERR( KSPSetConvergenceTest( * self.ksp, KSP_Converged, NULL, NULL) ) * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * self.set_attr('__converged__', (converged, args, kargs)) */ __pyx_t_1 = (__pyx_v_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/KSP.pyx":1047 * self.ksp, KSP_Converged, NULL, NULL) ) * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * self.set_attr('__converged__', (converged, args, kargs)) * else: */ __pyx_t_1 = (__pyx_v_kargs == Py_None); if (__pyx_t_1) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(49, 1047, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "petsc4py/PETSc/KSP.pyx":1048 * if args is None: args = () * if kargs is None: kargs = {} * self.set_attr('__converged__', (converged, args, kargs)) # <<<<<<<<<<<<<< * else: * CHKERR( KSPGetNormType(self.ksp, &normtype) ) */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(49, 1048, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_converged); __Pyx_GIVEREF(__pyx_v_converged); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_converged)) __PYX_ERR(49, 1048, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args)) __PYX_ERR(49, 1048, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs)) __PYX_ERR(49, 1048, __pyx_L1_error); __pyx_t_4 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_KSP *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__converged__"), __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 1048, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/KSP.pyx":1043 * cdef PetscKSPNormType normtype = KSP_NORM_NONE * cdef void* cctx = NULL * if converged is not None: # <<<<<<<<<<<<<< * CHKERR( KSPSetConvergenceTest( * self.ksp, KSP_Converged, NULL, NULL) ) */ goto __pyx_L3; } /* "petsc4py/PETSc/KSP.pyx":1050 * self.set_attr('__converged__', (converged, args, kargs)) * else: * CHKERR( KSPGetNormType(self.ksp, &normtype) ) # <<<<<<<<<<<<<< * if normtype != KSP_NORM_NONE: * CHKERR( KSPConvergedDefaultCreate(&cctx) ) */ /*else*/ { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPGetNormType(__pyx_v_self->ksp, (&__pyx_v_normtype))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 1050, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":1051 * else: * CHKERR( KSPGetNormType(self.ksp, &normtype) ) * if normtype != KSP_NORM_NONE: # <<<<<<<<<<<<<< * CHKERR( KSPConvergedDefaultCreate(&cctx) ) * CHKERR( KSPSetConvergenceTest( */ __pyx_t_1 = (__pyx_v_normtype != KSP_NORM_NONE); if (__pyx_t_1) { /* "petsc4py/PETSc/KSP.pyx":1052 * CHKERR( KSPGetNormType(self.ksp, &normtype) ) * if normtype != KSP_NORM_NONE: * CHKERR( KSPConvergedDefaultCreate(&cctx) ) # <<<<<<<<<<<<<< * CHKERR( KSPSetConvergenceTest( * self.ksp, KSPConvergedDefault, */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPConvergedDefaultCreate((&__pyx_v_cctx))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 1052, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":1053 * if normtype != KSP_NORM_NONE: * CHKERR( KSPConvergedDefaultCreate(&cctx) ) * CHKERR( KSPSetConvergenceTest( # <<<<<<<<<<<<<< * self.ksp, KSPConvergedDefault, * cctx, KSPConvergedDefaultDestroy) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetConvergenceTest(__pyx_v_self->ksp, KSPConvergedDefault, __pyx_v_cctx, KSPConvergedDefaultDestroy)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 1053, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":1051 * else: * CHKERR( KSPGetNormType(self.ksp, &normtype) ) * if normtype != KSP_NORM_NONE: # <<<<<<<<<<<<<< * CHKERR( KSPConvergedDefaultCreate(&cctx) ) * CHKERR( KSPSetConvergenceTest( */ goto __pyx_L6; } /* "petsc4py/PETSc/KSP.pyx":1057 * cctx, KSPConvergedDefaultDestroy) ) * else: * CHKERR( KSPSetConvergenceTest( # <<<<<<<<<<<<<< * self.ksp, KSPConvergedSkip, * NULL, NULL) ) */ /*else*/ { /* "petsc4py/PETSc/KSP.pyx":1059 * CHKERR( KSPSetConvergenceTest( * self.ksp, KSPConvergedSkip, * NULL, NULL) ) # <<<<<<<<<<<<<< * self.set_attr('__converged__', None) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetConvergenceTest(__pyx_v_self->ksp, KSPConvergedSkip, NULL, NULL)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 1057, __pyx_L1_error) } __pyx_L6:; /* "petsc4py/PETSc/KSP.pyx":1060 * self.ksp, KSPConvergedSkip, * NULL, NULL) ) * self.set_attr('__converged__', None) # <<<<<<<<<<<<<< * * def getConvergenceTest(self) -> KSPConvergenceTestFunction: */ __pyx_t_4 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_KSP *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__converged__"), Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 1060, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_L3:; /* "petsc4py/PETSc/KSP.pyx":998 * return (toReal(crtol), toReal(catol), toReal(cdivtol), toInt(cmaxits)) * * def setConvergenceTest( # <<<<<<<<<<<<<< * self, * converged: KSPConvergenceTestFunction, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.KSP.setConvergenceTest", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":1062 * self.set_attr('__converged__', None) * * def getConvergenceTest(self) -> KSPConvergenceTestFunction: # <<<<<<<<<<<<<< * """Return the function to be used to determine convergence. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_51getConvergenceTest(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_50getConvergenceTest, "KSP.getConvergenceTest(self) -> KSPConvergenceTestFunction\nReturn the function to be used to determine convergence.\n\n Logically collective.\n\n See Also\n --------\n setTolerances, setConvergenceTest, petsc.KSPGetConvergenceTest\n petsc.KSPConvergedDefault\n\n \nSource code at petsc4py/PETSc/KSP.pyx:1062"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_51getConvergenceTest(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getConvergenceTest (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getConvergenceTest", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getConvergenceTest", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_50getConvergenceTest(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_50getConvergenceTest(struct PyPetscKSPObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getConvergenceTest", 1); /* "petsc4py/PETSc/KSP.pyx":1073 * * """ * return self.get_attr('__converged__') # <<<<<<<<<<<<<< * * def callConvergenceTest(self, its: int, rnorm: float) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_KSP *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__converged__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 1073, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/KSP.pyx":1062 * self.set_attr('__converged__', None) * * def getConvergenceTest(self) -> KSPConvergenceTestFunction: # <<<<<<<<<<<<<< * """Return the function to be used to determine convergence. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.KSP.getConvergenceTest", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":1075 * return self.get_attr('__converged__') * * def callConvergenceTest(self, its: int, rnorm: float) -> None: # <<<<<<<<<<<<<< * """Call the convergence test callback. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_53callConvergenceTest(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_52callConvergenceTest, "KSP.callConvergenceTest(self, its: int, rnorm: float) -> None\nCall the convergence test callback.\n\n Parameters\n ----------\n its\n Number of iterations.\n rnorm\n The residual norm.\n\n Notes\n -----\n This functionality is implemented in petsc4py.\n\n \nSource code at petsc4py/PETSc/KSP.pyx:1075"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_53callConvergenceTest(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_its = 0; PyObject *__pyx_v_rnorm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("callConvergenceTest (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_its,&__pyx_n_s_rnorm,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_its)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 1075, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnorm)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 1075, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("callConvergenceTest", 1, 2, 2, 1); __PYX_ERR(49, 1075, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "callConvergenceTest") < 0)) __PYX_ERR(49, 1075, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_its = values[0]; __pyx_v_rnorm = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("callConvergenceTest", 1, 2, 2, __pyx_nargs); __PYX_ERR(49, 1075, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.KSP.callConvergenceTest", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_52callConvergenceTest(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_its, __pyx_v_rnorm); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_52callConvergenceTest(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_its, PyObject *__pyx_v_rnorm) { PetscInt __pyx_v_ival; PetscReal __pyx_v_rval; KSPConvergedReason __pyx_v_reason; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscReal __pyx_t_2; PetscErrorCode __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("callConvergenceTest", 1); /* "petsc4py/PETSc/KSP.pyx":1090 * * """ * cdef PetscInt ival = asInt(its) # <<<<<<<<<<<<<< * cdef PetscReal rval = asReal(rnorm) * cdef PetscKSPConvergedReason reason = KSP_CONVERGED_ITERATING */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_its); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(49, 1090, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "petsc4py/PETSc/KSP.pyx":1091 * """ * cdef PetscInt ival = asInt(its) * cdef PetscReal rval = asReal(rnorm) # <<<<<<<<<<<<<< * cdef PetscKSPConvergedReason reason = KSP_CONVERGED_ITERATING * CHKERR( KSPConvergenceTestCall(self.ksp, ival, rval, &reason) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_rnorm); if (unlikely(__pyx_t_2 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(49, 1091, __pyx_L1_error) __pyx_v_rval = __pyx_t_2; /* "petsc4py/PETSc/KSP.pyx":1092 * cdef PetscInt ival = asInt(its) * cdef PetscReal rval = asReal(rnorm) * cdef PetscKSPConvergedReason reason = KSP_CONVERGED_ITERATING # <<<<<<<<<<<<<< * CHKERR( KSPConvergenceTestCall(self.ksp, ival, rval, &reason) ) * return reason */ __pyx_v_reason = KSP_CONVERGED_ITERATING; /* "petsc4py/PETSc/KSP.pyx":1093 * cdef PetscReal rval = asReal(rnorm) * cdef PetscKSPConvergedReason reason = KSP_CONVERGED_ITERATING * CHKERR( KSPConvergenceTestCall(self.ksp, ival, rval, &reason) ) # <<<<<<<<<<<<<< * return reason * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPConvergenceTestCall(__pyx_v_self->ksp, __pyx_v_ival, __pyx_v_rval, (&__pyx_v_reason))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 1093, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":1094 * cdef PetscKSPConvergedReason reason = KSP_CONVERGED_ITERATING * CHKERR( KSPConvergenceTestCall(self.ksp, ival, rval, &reason) ) * return reason # <<<<<<<<<<<<<< * * def setConvergenceHistory( */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PyInt_From_KSPConvergedReason(__pyx_v_reason); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 1094, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "petsc4py/PETSc/KSP.pyx":1075 * return self.get_attr('__converged__') * * def callConvergenceTest(self, its: int, rnorm: float) -> None: # <<<<<<<<<<<<<< * """Call the convergence test callback. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.KSP.callConvergenceTest", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":1096 * return reason * * def setConvergenceHistory( # <<<<<<<<<<<<<< * self, * length: int | None = None, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_55setConvergenceHistory(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_54setConvergenceHistory, "KSP.setConvergenceHistory(self, length: int | None = None, reset: bool = False) -> None\nSet the array used to hold the residual history.\n\n Not collective.\n\n If set, this array will contain the residual norms computed at\n each iteration of the solver.\n\n Parameters\n ----------\n length\n Length of array to store history in.\n reset\n `True` indicates the history counter is reset to zero for\n each new linear solve.\n\n Notes\n -----\n If ``length`` is not provided or `None` then a default array\n of length 10000 is allocated.\n\n If the array is not long enough then once the iterations is\n longer than the array length `solve` stops recording the\n history.\n\n See Also\n --------\n getConvergenceHistory, petsc.KSPSetResidualHistory\n\n \nSource code at petsc4py/PETSc/KSP.pyx:1096"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_55setConvergenceHistory(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_length = 0; PyObject *__pyx_v_reset = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setConvergenceHistory (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_length,&__pyx_n_s_reset,0}; /* "petsc4py/PETSc/KSP.pyx":1098 * def setConvergenceHistory( * self, * length: int | None = None, # <<<<<<<<<<<<<< * reset: bool = False * ) -> None: */ values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/KSP.pyx":1099 * self, * length: int | None = None, * reset: bool = False # <<<<<<<<<<<<<< * ) -> None: * """Set the array used to hold the residual history. */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_length); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 1096, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_reset); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 1096, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setConvergenceHistory") < 0)) __PYX_ERR(49, 1096, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_length = values[0]; __pyx_v_reset = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setConvergenceHistory", 0, 0, 2, __pyx_nargs); __PYX_ERR(49, 1096, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.KSP.setConvergenceHistory", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_54setConvergenceHistory(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_length, __pyx_v_reset); /* "petsc4py/PETSc/KSP.pyx":1096 * return reason * * def setConvergenceHistory( # <<<<<<<<<<<<<< * self, * length: int | None = None, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_54setConvergenceHistory(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_length, PyObject *__pyx_v_reset) { PetscReal *__pyx_v_data; PetscInt __pyx_v_size; PetscBool __pyx_v_flag; PyObject *__pyx_v_hist = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscInt __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PetscErrorCode __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setConvergenceHistory", 1); /* "petsc4py/PETSc/KSP.pyx":1130 * * """ * cdef PetscReal *data = NULL # <<<<<<<<<<<<<< * cdef PetscInt size = 10000 * cdef PetscBool flag = PETSC_FALSE */ __pyx_v_data = NULL; /* "petsc4py/PETSc/KSP.pyx":1131 * """ * cdef PetscReal *data = NULL * cdef PetscInt size = 10000 # <<<<<<<<<<<<<< * cdef PetscBool flag = PETSC_FALSE * if length is True: pass */ __pyx_v_size = 0x2710; /* "petsc4py/PETSc/KSP.pyx":1132 * cdef PetscReal *data = NULL * cdef PetscInt size = 10000 * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * if length is True: pass * elif length is not None: size = asInt(length) */ __pyx_v_flag = PETSC_FALSE; /* "petsc4py/PETSc/KSP.pyx":1133 * cdef PetscInt size = 10000 * cdef PetscBool flag = PETSC_FALSE * if length is True: pass # <<<<<<<<<<<<<< * elif length is not None: size = asInt(length) * if size < 0: size = 10000 */ __pyx_t_1 = (__pyx_v_length == Py_True); if (__pyx_t_1) { goto __pyx_L3; } /* "petsc4py/PETSc/KSP.pyx":1134 * cdef PetscBool flag = PETSC_FALSE * if length is True: pass * elif length is not None: size = asInt(length) # <<<<<<<<<<<<<< * if size < 0: size = 10000 * if reset: flag = PETSC_TRUE */ __pyx_t_1 = (__pyx_v_length != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_length); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(49, 1134, __pyx_L1_error) __pyx_v_size = __pyx_t_2; } __pyx_L3:; /* "petsc4py/PETSc/KSP.pyx":1135 * if length is True: pass * elif length is not None: size = asInt(length) * if size < 0: size = 10000 # <<<<<<<<<<<<<< * if reset: flag = PETSC_TRUE * cdef object hist = oarray_r(empty_r(size), NULL, &data) */ __pyx_t_1 = (__pyx_v_size < 0); if (__pyx_t_1) { __pyx_v_size = 0x2710; } /* "petsc4py/PETSc/KSP.pyx":1136 * elif length is not None: size = asInt(length) * if size < 0: size = 10000 * if reset: flag = PETSC_TRUE # <<<<<<<<<<<<<< * cdef object hist = oarray_r(empty_r(size), NULL, &data) * self.set_attr('__history__', hist) */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_reset); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(49, 1136, __pyx_L1_error) if (__pyx_t_1) { __pyx_v_flag = PETSC_TRUE; } /* "petsc4py/PETSc/KSP.pyx":1137 * if size < 0: size = 10000 * if reset: flag = PETSC_TRUE * cdef object hist = oarray_r(empty_r(size), NULL, &data) # <<<<<<<<<<<<<< * self.set_attr('__history__', hist) * CHKERR( KSPSetResidualHistory(self.ksp, data, size, flag) ) */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_r(__pyx_v_size)); if (unlikely(!__pyx_t_3)) __PYX_ERR(49, 1137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_r(__pyx_t_3, NULL, (&__pyx_v_data))); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 1137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_hist = __pyx_t_4; __pyx_t_4 = 0; /* "petsc4py/PETSc/KSP.pyx":1138 * if reset: flag = PETSC_TRUE * cdef object hist = oarray_r(empty_r(size), NULL, &data) * self.set_attr('__history__', hist) # <<<<<<<<<<<<<< * CHKERR( KSPSetResidualHistory(self.ksp, data, size, flag) ) * */ __pyx_t_4 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_KSP *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__history__"), __pyx_v_hist); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 1138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/KSP.pyx":1139 * cdef object hist = oarray_r(empty_r(size), NULL, &data) * self.set_attr('__history__', hist) * CHKERR( KSPSetResidualHistory(self.ksp, data, size, flag) ) # <<<<<<<<<<<<<< * * def getConvergenceHistory(self) -> ArrayReal: */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetResidualHistory(__pyx_v_self->ksp, __pyx_v_data, __pyx_v_size, __pyx_v_flag)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 1139, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":1096 * return reason * * def setConvergenceHistory( # <<<<<<<<<<<<<< * self, * length: int | None = None, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.KSP.setConvergenceHistory", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_hist); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":1141 * CHKERR( KSPSetResidualHistory(self.ksp, data, size, flag) ) * * def getConvergenceHistory(self) -> ArrayReal: # <<<<<<<<<<<<<< * """Return array containing the residual history. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_57getConvergenceHistory(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_56getConvergenceHistory, "KSP.getConvergenceHistory(self) -> ArrayReal\nReturn array containing the residual history.\n\n Not collective.\n\n See Also\n --------\n setConvergenceHistory, petsc.KSPGetResidualHistory\n\n \nSource code at petsc4py/PETSc/KSP.pyx:1141"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_57getConvergenceHistory(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getConvergenceHistory (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getConvergenceHistory", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getConvergenceHistory", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_56getConvergenceHistory(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_56getConvergenceHistory(struct PyPetscKSPObject *__pyx_v_self) { PetscReal const *__pyx_v_data; PetscInt __pyx_v_size; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getConvergenceHistory", 1); /* "petsc4py/PETSc/KSP.pyx":1151 * * """ * cdef const PetscReal *data = NULL # <<<<<<<<<<<<<< * cdef PetscInt size = 0 * CHKERR( KSPGetResidualHistory(self.ksp, &data, &size) ) */ __pyx_v_data = NULL; /* "petsc4py/PETSc/KSP.pyx":1152 * """ * cdef const PetscReal *data = NULL * cdef PetscInt size = 0 # <<<<<<<<<<<<<< * CHKERR( KSPGetResidualHistory(self.ksp, &data, &size) ) * return array_r(size, data) */ __pyx_v_size = 0; /* "petsc4py/PETSc/KSP.pyx":1153 * cdef const PetscReal *data = NULL * cdef PetscInt size = 0 * CHKERR( KSPGetResidualHistory(self.ksp, &data, &size) ) # <<<<<<<<<<<<<< * return array_r(size, data) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPGetResidualHistory(__pyx_v_self->ksp, (&__pyx_v_data), (&__pyx_v_size))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 1153, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":1154 * cdef PetscInt size = 0 * CHKERR( KSPGetResidualHistory(self.ksp, &data, &size) ) * return array_r(size, data) # <<<<<<<<<<<<<< * * def logConvergenceHistory(self, rnorm: float) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_r(__pyx_v_size, __pyx_v_data)); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 1154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/KSP.pyx":1141 * CHKERR( KSPSetResidualHistory(self.ksp, data, size, flag) ) * * def getConvergenceHistory(self) -> ArrayReal: # <<<<<<<<<<<<<< * """Return array containing the residual history. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.KSP.getConvergenceHistory", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":1156 * return array_r(size, data) * * def logConvergenceHistory(self, rnorm: float) -> None: # <<<<<<<<<<<<<< * """Add residual to convergence history. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_59logConvergenceHistory(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_58logConvergenceHistory, "KSP.logConvergenceHistory(self, rnorm: float) -> None\nAdd residual to convergence history.\n\n Logically collective.\n\n Parameters\n ----------\n rnorm\n Residual norm to be added to convergence history.\n\n \nSource code at petsc4py/PETSc/KSP.pyx:1156"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_59logConvergenceHistory(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_rnorm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("logConvergenceHistory (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rnorm,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnorm)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 1156, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "logConvergenceHistory") < 0)) __PYX_ERR(49, 1156, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_rnorm = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("logConvergenceHistory", 1, 1, 1, __pyx_nargs); __PYX_ERR(49, 1156, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.KSP.logConvergenceHistory", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_58logConvergenceHistory(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_rnorm); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_58logConvergenceHistory(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_rnorm) { PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("logConvergenceHistory", 1); /* "petsc4py/PETSc/KSP.pyx":1167 * * """ * cdef PetscReal rval = asReal(rnorm) # <<<<<<<<<<<<<< * CHKERR( KSPLogResidualHistory(self.ksp, rval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_rnorm); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(49, 1167, __pyx_L1_error) __pyx_v_rval = __pyx_t_1; /* "petsc4py/PETSc/KSP.pyx":1168 * """ * cdef PetscReal rval = asReal(rnorm) * CHKERR( KSPLogResidualHistory(self.ksp, rval) ) # <<<<<<<<<<<<<< * * # --- monitoring --- */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPLogResidualHistory(__pyx_v_self->ksp, __pyx_v_rval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 1168, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":1156 * return array_r(size, data) * * def logConvergenceHistory(self, rnorm: float) -> None: # <<<<<<<<<<<<<< * """Add residual to convergence history. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.logConvergenceHistory", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":1172 * # --- monitoring --- * * def setMonitor(self, # <<<<<<<<<<<<<< * monitor: KSPMonitorFunction, * args: tuple[Any, ...] | None = None, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_61setMonitor(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_60setMonitor, "KSP.setMonitor(self, monitor: KSPMonitorFunction, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nSet additional function to monitor the residual.\n\n Logically collective.\n\n Set an ADDITIONAL function to be called at every iteration to\n monitor the residual/error etc.\n\n Parameters\n ----------\n monitor\n Callback which monitors the convergence.\n args\n Positional arguments for callback function.\n kargs\n Keyword arguments for callback function.\n\n Notes\n -----\n The default is to do nothing. To print the residual, or\n preconditioned residual if\n ``setNormType(NORM_PRECONDITIONED)`` was called, use\n `monitor` as the monitoring routine, with a\n `PETSc.Viewer.ASCII` as the context.\n\n Several different monitoring routines may be set by calling\n `setMonitor` multiple times; all will be called in the order\n in which they were set.\n\n See Also\n --------\n petsc_options, getMonitor, monitor, monitorCancel, petsc.KSPMonitorSet\n\n \nSource code at petsc4py/PETSc/KSP.pyx:1172"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_61setMonitor(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_monitor = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setMonitor (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_monitor,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; /* "petsc4py/PETSc/KSP.pyx":1174 * def setMonitor(self, * monitor: KSPMonitorFunction, * args: tuple[Any, ...] | None = None, # <<<<<<<<<<<<<< * kargs: dict[str, Any] | None = None * ) -> None: */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/KSP.pyx":1175 * monitor: KSPMonitorFunction, * args: tuple[Any, ...] | None = None, * kargs: dict[str, Any] | None = None # <<<<<<<<<<<<<< * ) -> None: * """Set additional function to monitor the residual. */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_monitor)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 1172, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 1172, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 1172, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setMonitor") < 0)) __PYX_ERR(49, 1172, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_monitor = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setMonitor", 0, 1, 3, __pyx_nargs); __PYX_ERR(49, 1172, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.KSP.setMonitor", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_60setMonitor(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_monitor, __pyx_v_args, __pyx_v_kargs); /* "petsc4py/PETSc/KSP.pyx":1172 * # --- monitoring --- * * def setMonitor(self, # <<<<<<<<<<<<<< * monitor: KSPMonitorFunction, * args: tuple[Any, ...] | None = None, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_60setMonitor(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_monitor, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_monitorlist = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setMonitor", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/KSP.pyx":1210 * * """ * if monitor is None: return # <<<<<<<<<<<<<< * cdef object monitorlist = self.get_attr('__monitor__') * if monitorlist is None: */ __pyx_t_1 = (__pyx_v_monitor == Py_None); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } /* "petsc4py/PETSc/KSP.pyx":1211 * """ * if monitor is None: return * cdef object monitorlist = self.get_attr('__monitor__') # <<<<<<<<<<<<<< * if monitorlist is None: * monitorlist = [] */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_KSP *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__monitor__")); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 1211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_monitorlist = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/KSP.pyx":1212 * if monitor is None: return * cdef object monitorlist = self.get_attr('__monitor__') * if monitorlist is None: # <<<<<<<<<<<<<< * monitorlist = [] * self.set_attr('__monitor__', monitorlist) */ __pyx_t_1 = (__pyx_v_monitorlist == Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/KSP.pyx":1213 * cdef object monitorlist = self.get_attr('__monitor__') * if monitorlist is None: * monitorlist = [] # <<<<<<<<<<<<<< * self.set_attr('__monitor__', monitorlist) * CHKERR( KSPMonitorSet(self.ksp, KSP_Monitor, NULL, NULL) ) */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 1213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_monitorlist, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/KSP.pyx":1214 * if monitorlist is None: * monitorlist = [] * self.set_attr('__monitor__', monitorlist) # <<<<<<<<<<<<<< * CHKERR( KSPMonitorSet(self.ksp, KSP_Monitor, NULL, NULL) ) * if args is None: args = () */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_KSP *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__monitor__"), __pyx_v_monitorlist); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 1214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/KSP.pyx":1215 * monitorlist = [] * self.set_attr('__monitor__', monitorlist) * CHKERR( KSPMonitorSet(self.ksp, KSP_Monitor, NULL, NULL) ) # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPMonitorSet(__pyx_v_self->ksp, __pyx_f_8petsc4py_5PETSc_KSP_Monitor, NULL, NULL)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 1215, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":1212 * if monitor is None: return * cdef object monitorlist = self.get_attr('__monitor__') * if monitorlist is None: # <<<<<<<<<<<<<< * monitorlist = [] * self.set_attr('__monitor__', monitorlist) */ } /* "petsc4py/PETSc/KSP.pyx":1216 * self.set_attr('__monitor__', monitorlist) * CHKERR( KSPMonitorSet(self.ksp, KSP_Monitor, NULL, NULL) ) * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * monitorlist.append((monitor, args, kargs)) */ __pyx_t_1 = (__pyx_v_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/KSP.pyx":1217 * CHKERR( KSPMonitorSet(self.ksp, KSP_Monitor, NULL, NULL) ) * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * monitorlist.append((monitor, args, kargs)) * */ __pyx_t_1 = (__pyx_v_kargs == Py_None); if (__pyx_t_1) { __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 1217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_2); __pyx_t_2 = 0; } /* "petsc4py/PETSc/KSP.pyx":1218 * if args is None: args = () * if kargs is None: kargs = {} * monitorlist.append((monitor, args, kargs)) # <<<<<<<<<<<<<< * * def getMonitor(self) -> KSPMonitorFunction: */ __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 1218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_monitor); __Pyx_GIVEREF(__pyx_v_monitor); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_monitor)) __PYX_ERR(49, 1218, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_args)) __PYX_ERR(49, 1218, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_kargs)) __PYX_ERR(49, 1218, __pyx_L1_error); __pyx_t_4 = __Pyx_PyObject_Append(__pyx_v_monitorlist, __pyx_t_2); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(49, 1218, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/KSP.pyx":1172 * # --- monitoring --- * * def setMonitor(self, # <<<<<<<<<<<<<< * monitor: KSPMonitorFunction, * args: tuple[Any, ...] | None = None, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.KSP.setMonitor", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_monitorlist); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":1220 * monitorlist.append((monitor, args, kargs)) * * def getMonitor(self) -> KSPMonitorFunction: # <<<<<<<<<<<<<< * """Return function used to monitor the residual. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_63getMonitor(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_62getMonitor, "KSP.getMonitor(self) -> KSPMonitorFunction\nReturn function used to monitor the residual.\n\n Not collective.\n\n See Also\n --------\n petsc_options, setMonitor, monitor, monitorCancel\n petsc.KSPGetMonitorContext\n\n \nSource code at petsc4py/PETSc/KSP.pyx:1220"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_63getMonitor(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getMonitor (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getMonitor", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getMonitor", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_62getMonitor(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_62getMonitor(struct PyPetscKSPObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getMonitor", 1); /* "petsc4py/PETSc/KSP.pyx":1231 * * """ * return self.get_attr('__monitor__') # <<<<<<<<<<<<<< * * def monitorCancel(self) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_KSP *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__monitor__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 1231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/KSP.pyx":1220 * monitorlist.append((monitor, args, kargs)) * * def getMonitor(self) -> KSPMonitorFunction: # <<<<<<<<<<<<<< * """Return function used to monitor the residual. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.KSP.getMonitor", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":1233 * return self.get_attr('__monitor__') * * def monitorCancel(self) -> None: # <<<<<<<<<<<<<< * """Clear all monitors for a `KSP` object. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_65monitorCancel(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_64monitorCancel, "KSP.monitorCancel(self) -> None\nClear all monitors for a `KSP` object.\n\n Logically collective.\n\n See Also\n --------\n petsc_options, getMonitor, setMonitor, monitor, petsc.KSPMonitorCancel\n\n \nSource code at petsc4py/PETSc/KSP.pyx:1233"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_65monitorCancel(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("monitorCancel (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("monitorCancel", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "monitorCancel", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_64monitorCancel(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_64monitorCancel(struct PyPetscKSPObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("monitorCancel", 1); /* "petsc4py/PETSc/KSP.pyx":1243 * * """ * CHKERR( KSPMonitorCancel(self.ksp) ) # <<<<<<<<<<<<<< * self.set_attr('__monitor__', None) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPMonitorCancel(__pyx_v_self->ksp)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 1243, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":1244 * """ * CHKERR( KSPMonitorCancel(self.ksp) ) * self.set_attr('__monitor__', None) # <<<<<<<<<<<<<< * * cancelMonitor = monitorCancel */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_KSP *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__monitor__"), Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 1244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/KSP.pyx":1233 * return self.get_attr('__monitor__') * * def monitorCancel(self) -> None: # <<<<<<<<<<<<<< * """Clear all monitors for a `KSP` object. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.KSP.monitorCancel", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":1248 * cancelMonitor = monitorCancel * * def monitor(self, its: int, rnorm: float) -> None: # <<<<<<<<<<<<<< * """Run the user provided monitor routines, if they exist. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_67monitor(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_66monitor, "KSP.monitor(self, its: int, rnorm: float) -> None\nRun the user provided monitor routines, if they exist.\n\n Collective.\n\n Notes\n -----\n This routine is called by the `KSP` implementations. It does not\n typically need to be called by the user.\n\n See Also\n --------\n setMonitor, petsc.KSPMonitor\n\n \nSource code at petsc4py/PETSc/KSP.pyx:1248"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_67monitor(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_its = 0; PyObject *__pyx_v_rnorm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("monitor (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_its,&__pyx_n_s_rnorm,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_its)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 1248, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnorm)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 1248, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("monitor", 1, 2, 2, 1); __PYX_ERR(49, 1248, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "monitor") < 0)) __PYX_ERR(49, 1248, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_its = values[0]; __pyx_v_rnorm = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("monitor", 1, 2, 2, __pyx_nargs); __PYX_ERR(49, 1248, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.KSP.monitor", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_66monitor(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_its, __pyx_v_rnorm); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_66monitor(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_its, PyObject *__pyx_v_rnorm) { PetscInt __pyx_v_ival; PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscReal __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("monitor", 1); /* "petsc4py/PETSc/KSP.pyx":1263 * * """ * cdef PetscInt ival = asInt(its) # <<<<<<<<<<<<<< * cdef PetscReal rval = asReal(rnorm) * CHKERR( KSPMonitor(self.ksp, ival, rval) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_its); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(49, 1263, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "petsc4py/PETSc/KSP.pyx":1264 * """ * cdef PetscInt ival = asInt(its) * cdef PetscReal rval = asReal(rnorm) # <<<<<<<<<<<<<< * CHKERR( KSPMonitor(self.ksp, ival, rval) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_rnorm); if (unlikely(__pyx_t_2 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(49, 1264, __pyx_L1_error) __pyx_v_rval = __pyx_t_2; /* "petsc4py/PETSc/KSP.pyx":1265 * cdef PetscInt ival = asInt(its) * cdef PetscReal rval = asReal(rnorm) * CHKERR( KSPMonitor(self.ksp, ival, rval) ) # <<<<<<<<<<<<<< * * # --- customization --- */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPMonitor(__pyx_v_self->ksp, __pyx_v_ival, __pyx_v_rval)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 1265, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":1248 * cancelMonitor = monitorCancel * * def monitor(self, its: int, rnorm: float) -> None: # <<<<<<<<<<<<<< * """Run the user provided monitor routines, if they exist. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.monitor", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":1269 * # --- customization --- * * def setPCSide(self, side: PC.Side) -> None: # <<<<<<<<<<<<<< * """Set the preconditioning side. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_69setPCSide(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_68setPCSide, "KSP.setPCSide(self, side: PC.Side) -> None\nSet the preconditioning side.\n\n Logically collective.\n\n Parameters\n ----------\n side\n The preconditioning side (see `PC.Side`).\n\n Notes\n -----\n Left preconditioning is used by default for most Krylov methods\n except `Type.FGMRES` which only supports right preconditioning.\n\n For methods changing the side of the preconditioner changes the\n norm type that is used, see `setNormType`.\n\n Symmetric preconditioning is currently available only for the\n `Type.QCG` method. Note, however, that symmetric preconditioning\n can be emulated by using either right or left preconditioning\n and a pre or post processing step.\n\n Setting the PC side often affects the default norm type. See\n `setNormType` for details.\n\n See Also\n --------\n PC.Side, petsc_options, getPCSide, setNormType, getNormType\n petsc.KSPSetPCSide\n\n \nSource code at petsc4py/PETSc/KSP.pyx:1269"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_69setPCSide(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_side = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPCSide (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_side,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_side)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 1269, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setPCSide") < 0)) __PYX_ERR(49, 1269, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_side = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPCSide", 1, 1, 1, __pyx_nargs); __PYX_ERR(49, 1269, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.KSP.setPCSide", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_68setPCSide(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_side); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_68setPCSide(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_side) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PCSide __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPCSide", 1); /* "petsc4py/PETSc/KSP.pyx":1301 * * """ * CHKERR( KSPSetPCSide(self.ksp, side) ) # <<<<<<<<<<<<<< * * def getPCSide(self) -> PC.Side: */ __pyx_t_1 = ((PCSide)__Pyx_PyInt_As_PCSide(__pyx_v_side)); if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 1301, __pyx_L1_error) __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetPCSide(__pyx_v_self->ksp, __pyx_t_1)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 1301, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":1269 * # --- customization --- * * def setPCSide(self, side: PC.Side) -> None: # <<<<<<<<<<<<<< * """Set the preconditioning side. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.setPCSide", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":1303 * CHKERR( KSPSetPCSide(self.ksp, side) ) * * def getPCSide(self) -> PC.Side: # <<<<<<<<<<<<<< * """Return the preconditioning side. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_71getPCSide(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_70getPCSide, "KSP.getPCSide(self) -> PC.Side\nReturn the preconditioning side.\n\n Not collective.\n\n See Also\n --------\n petsc_options, setPCSide, setNormType, getNormType, petsc.KSPGetPCSide\n\n \nSource code at petsc4py/PETSc/KSP.pyx:1303"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_71getPCSide(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getPCSide (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getPCSide", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getPCSide", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_70getPCSide(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_70getPCSide(struct PyPetscKSPObject *__pyx_v_self) { PCSide __pyx_v_side; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getPCSide", 1); /* "petsc4py/PETSc/KSP.pyx":1313 * * """ * cdef PetscPCSide side = PC_LEFT # <<<<<<<<<<<<<< * CHKERR( KSPGetPCSide(self.ksp, &side) ) * return side */ __pyx_v_side = PC_LEFT; /* "petsc4py/PETSc/KSP.pyx":1314 * """ * cdef PetscPCSide side = PC_LEFT * CHKERR( KSPGetPCSide(self.ksp, &side) ) # <<<<<<<<<<<<<< * return side * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPGetPCSide(__pyx_v_self->ksp, (&__pyx_v_side))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 1314, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":1315 * cdef PetscPCSide side = PC_LEFT * CHKERR( KSPGetPCSide(self.ksp, &side) ) * return side # <<<<<<<<<<<<<< * * def setNormType(self, normtype: NormType) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_PCSide(__pyx_v_side); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 1315, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/KSP.pyx":1303 * CHKERR( KSPSetPCSide(self.ksp, side) ) * * def getPCSide(self) -> PC.Side: # <<<<<<<<<<<<<< * """Return the preconditioning side. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.KSP.getPCSide", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":1317 * return side * * def setNormType(self, normtype: NormType) -> None: # <<<<<<<<<<<<<< * """Set the norm that is used for convergence testing. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_73setNormType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_72setNormType, "KSP.setNormType(self, normtype: NormType) -> None\nSet the norm that is used for convergence testing.\n\n Parameters\n ----------\n normtype\n The norm type to use (see `NormType`).\n\n Notes\n -----\n Not all combinations of preconditioner side (see\n `setPCSide`) and norm type are supported by all Krylov\n methods. If only one is set, PETSc tries to automatically\n change the other to find a compatible pair. If no such\n combination is supported, PETSc will generate an error.\n\n See Also\n --------\n NormType, petsc_options, setUp, solve, destroy, setPCSide, getPCSide\n NormType, petsc.KSPSetNormType, petsc.KSPConvergedSkip\n petsc.KSPSetCheckNormIteration\n\n \nSource code at petsc4py/PETSc/KSP.pyx:1317"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_73setNormType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_normtype = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setNormType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_normtype,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_normtype)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 1317, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setNormType") < 0)) __PYX_ERR(49, 1317, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_normtype = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setNormType", 1, 1, 1, __pyx_nargs); __PYX_ERR(49, 1317, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.KSP.setNormType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_72setNormType(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_normtype); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_72setNormType(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_normtype) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations KSPNormType __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setNormType", 1); /* "petsc4py/PETSc/KSP.pyx":1340 * * """ * CHKERR( KSPSetNormType(self.ksp, normtype) ) # <<<<<<<<<<<<<< * * def getNormType(self) -> NormType: */ __pyx_t_1 = ((KSPNormType)__Pyx_PyInt_As_KSPNormType(__pyx_v_normtype)); if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 1340, __pyx_L1_error) __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetNormType(__pyx_v_self->ksp, __pyx_t_1)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 1340, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":1317 * return side * * def setNormType(self, normtype: NormType) -> None: # <<<<<<<<<<<<<< * """Set the norm that is used for convergence testing. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.setNormType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":1342 * CHKERR( KSPSetNormType(self.ksp, normtype) ) * * def getNormType(self) -> NormType: # <<<<<<<<<<<<<< * """Return the norm that is used for convergence testing. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_75getNormType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_74getNormType, "KSP.getNormType(self) -> NormType\nReturn the norm that is used for convergence testing.\n\n Not collective.\n\n See Also\n --------\n NormType, setNormType, petsc.KSPGetNormType, petsc.KSPConvergedSkip\n\n \nSource code at petsc4py/PETSc/KSP.pyx:1342"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_75getNormType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getNormType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getNormType", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getNormType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_74getNormType(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_74getNormType(struct PyPetscKSPObject *__pyx_v_self) { KSPNormType __pyx_v_normtype; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getNormType", 1); /* "petsc4py/PETSc/KSP.pyx":1352 * * """ * cdef PetscKSPNormType normtype = KSP_NORM_NONE # <<<<<<<<<<<<<< * CHKERR( KSPGetNormType(self.ksp, &normtype) ) * return normtype */ __pyx_v_normtype = KSP_NORM_NONE; /* "petsc4py/PETSc/KSP.pyx":1353 * """ * cdef PetscKSPNormType normtype = KSP_NORM_NONE * CHKERR( KSPGetNormType(self.ksp, &normtype) ) # <<<<<<<<<<<<<< * return normtype * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPGetNormType(__pyx_v_self->ksp, (&__pyx_v_normtype))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 1353, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":1354 * cdef PetscKSPNormType normtype = KSP_NORM_NONE * CHKERR( KSPGetNormType(self.ksp, &normtype) ) * return normtype # <<<<<<<<<<<<<< * * def setComputeEigenvalues(self, flag: bool) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_KSPNormType(__pyx_v_normtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 1354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/KSP.pyx":1342 * CHKERR( KSPSetNormType(self.ksp, normtype) ) * * def getNormType(self) -> NormType: # <<<<<<<<<<<<<< * """Return the norm that is used for convergence testing. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.KSP.getNormType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":1356 * return normtype * * def setComputeEigenvalues(self, flag: bool) -> None: # <<<<<<<<<<<<<< * """Set a flag to compute eigenvalues. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_77setComputeEigenvalues(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_76setComputeEigenvalues, "KSP.setComputeEigenvalues(self, flag: bool) -> None\nSet a flag to compute eigenvalues.\n\n Set a flag so that the extreme eigenvalues values will be\n calculated via a Lanczos or Arnoldi process as the linear\n system is solved.\n\n Parameters\n ----------\n flag\n Boolean whether to compute eigenvalues (or not).\n\n Notes\n -----\n Currently this option is not valid for all iterative methods.\n\n See Also\n --------\n getComputeEigenvalues, petsc.KSPSetComputeEigenvalues\n\n \nSource code at petsc4py/PETSc/KSP.pyx:1356"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_77setComputeEigenvalues(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_flag = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setComputeEigenvalues (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flag)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 1356, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setComputeEigenvalues") < 0)) __PYX_ERR(49, 1356, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_flag = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setComputeEigenvalues", 1, 1, 1, __pyx_nargs); __PYX_ERR(49, 1356, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.KSP.setComputeEigenvalues", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_76setComputeEigenvalues(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_flag); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_76setComputeEigenvalues(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_flag) { PetscBool __pyx_v_compute; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setComputeEigenvalues", 1); /* "petsc4py/PETSc/KSP.pyx":1377 * * """ * cdef PetscBool compute = asBool(flag) # <<<<<<<<<<<<<< * CHKERR( KSPSetComputeEigenvalues(self.ksp, compute) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asBool(__pyx_v_flag); if (unlikely(__pyx_t_1 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(49, 1377, __pyx_L1_error) __pyx_v_compute = __pyx_t_1; /* "petsc4py/PETSc/KSP.pyx":1378 * """ * cdef PetscBool compute = asBool(flag) * CHKERR( KSPSetComputeEigenvalues(self.ksp, compute) ) # <<<<<<<<<<<<<< * * def getComputeEigenvalues(self) -> bool: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetComputeEigenvalues(__pyx_v_self->ksp, __pyx_v_compute)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 1378, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":1356 * return normtype * * def setComputeEigenvalues(self, flag: bool) -> None: # <<<<<<<<<<<<<< * """Set a flag to compute eigenvalues. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.setComputeEigenvalues", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":1380 * CHKERR( KSPSetComputeEigenvalues(self.ksp, compute) ) * * def getComputeEigenvalues(self) -> bool: # <<<<<<<<<<<<<< * """Return flag indicating whether eigenvalues will be calculated. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_79getComputeEigenvalues(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_78getComputeEigenvalues, "KSP.getComputeEigenvalues(self) -> bool\nReturn flag indicating whether eigenvalues will be calculated.\n\n Not collective.\n\n Return the flag indicating that the extreme eigenvalues values\n will be calculated via a Lanczos or Arnoldi process as the\n linear system is solved.\n\n See Also\n --------\n setComputeEigenvalues, petsc.KSPSetComputeEigenvalues\n\n \nSource code at petsc4py/PETSc/KSP.pyx:1380"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_79getComputeEigenvalues(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getComputeEigenvalues (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getComputeEigenvalues", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getComputeEigenvalues", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_78getComputeEigenvalues(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_78getComputeEigenvalues(struct PyPetscKSPObject *__pyx_v_self) { PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getComputeEigenvalues", 1); /* "petsc4py/PETSc/KSP.pyx":1394 * * """ * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( KSPGetComputeEigenvalues(self.ksp, &flag) ) * return toBool(flag) */ __pyx_v_flag = PETSC_FALSE; /* "petsc4py/PETSc/KSP.pyx":1395 * """ * cdef PetscBool flag = PETSC_FALSE * CHKERR( KSPGetComputeEigenvalues(self.ksp, &flag) ) # <<<<<<<<<<<<<< * return toBool(flag) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPGetComputeEigenvalues(__pyx_v_self->ksp, (&__pyx_v_flag))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 1395, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":1396 * cdef PetscBool flag = PETSC_FALSE * CHKERR( KSPGetComputeEigenvalues(self.ksp, &flag) ) * return toBool(flag) # <<<<<<<<<<<<<< * * def setComputeSingularValues(self, flag: bool) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 1396, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/KSP.pyx":1380 * CHKERR( KSPSetComputeEigenvalues(self.ksp, compute) ) * * def getComputeEigenvalues(self) -> bool: # <<<<<<<<<<<<<< * """Return flag indicating whether eigenvalues will be calculated. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.KSP.getComputeEigenvalues", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":1398 * return toBool(flag) * * def setComputeSingularValues(self, flag: bool) -> None: # <<<<<<<<<<<<<< * """Set flag to calculate singular values. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_81setComputeSingularValues(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_80setComputeSingularValues, "KSP.setComputeSingularValues(self, flag: bool) -> None\nSet flag to calculate singular values.\n\n Logically collective.\n\n Set a flag so that the extreme singular values will be\n calculated via a Lanczos or Arnoldi process as the linear\n system is solved.\n\n Parameters\n ----------\n flag\n Boolean whether to compute singular values (or not).\n\n Notes\n -----\n Currently this option is not valid for all iterative methods.\n\n See Also\n --------\n getComputeSingularValues, petsc.KSPSetComputeSingularValues\n\n \nSource code at petsc4py/PETSc/KSP.pyx:1398"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_81setComputeSingularValues(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_flag = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setComputeSingularValues (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flag)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 1398, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setComputeSingularValues") < 0)) __PYX_ERR(49, 1398, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_flag = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setComputeSingularValues", 1, 1, 1, __pyx_nargs); __PYX_ERR(49, 1398, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.KSP.setComputeSingularValues", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_80setComputeSingularValues(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_flag); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_80setComputeSingularValues(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_flag) { PetscBool __pyx_v_compute; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setComputeSingularValues", 1); /* "petsc4py/PETSc/KSP.pyx":1421 * * """ * cdef PetscBool compute = asBool(flag) # <<<<<<<<<<<<<< * CHKERR( KSPSetComputeSingularValues(self.ksp, compute) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asBool(__pyx_v_flag); if (unlikely(__pyx_t_1 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(49, 1421, __pyx_L1_error) __pyx_v_compute = __pyx_t_1; /* "petsc4py/PETSc/KSP.pyx":1422 * """ * cdef PetscBool compute = asBool(flag) * CHKERR( KSPSetComputeSingularValues(self.ksp, compute) ) # <<<<<<<<<<<<<< * * def getComputeSingularValues(self) -> bool: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetComputeSingularValues(__pyx_v_self->ksp, __pyx_v_compute)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 1422, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":1398 * return toBool(flag) * * def setComputeSingularValues(self, flag: bool) -> None: # <<<<<<<<<<<<<< * """Set flag to calculate singular values. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.setComputeSingularValues", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":1424 * CHKERR( KSPSetComputeSingularValues(self.ksp, compute) ) * * def getComputeSingularValues(self) -> bool: # <<<<<<<<<<<<<< * """Return flag indicating whether singular values will be calculated. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_83getComputeSingularValues(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_82getComputeSingularValues, "KSP.getComputeSingularValues(self) -> bool\nReturn flag indicating whether singular values will be calculated.\n\n Return the flag indicating whether the extreme singular values\n will be calculated via a Lanczos or Arnoldi process as the\n linear system is solved.\n\n See Also\n --------\n setComputeSingularValues, petsc.KSPGetComputeSingularValues\n\n \nSource code at petsc4py/PETSc/KSP.pyx:1424"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_83getComputeSingularValues(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getComputeSingularValues (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getComputeSingularValues", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getComputeSingularValues", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_82getComputeSingularValues(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_82getComputeSingularValues(struct PyPetscKSPObject *__pyx_v_self) { PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getComputeSingularValues", 1); /* "petsc4py/PETSc/KSP.pyx":1436 * * """ * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( KSPGetComputeSingularValues(self.ksp, &flag) ) * return toBool(flag) */ __pyx_v_flag = PETSC_FALSE; /* "petsc4py/PETSc/KSP.pyx":1437 * """ * cdef PetscBool flag = PETSC_FALSE * CHKERR( KSPGetComputeSingularValues(self.ksp, &flag) ) # <<<<<<<<<<<<<< * return toBool(flag) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPGetComputeSingularValues(__pyx_v_self->ksp, (&__pyx_v_flag))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 1437, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":1438 * cdef PetscBool flag = PETSC_FALSE * CHKERR( KSPGetComputeSingularValues(self.ksp, &flag) ) * return toBool(flag) # <<<<<<<<<<<<<< * * # --- initial guess --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 1438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/KSP.pyx":1424 * CHKERR( KSPSetComputeSingularValues(self.ksp, compute) ) * * def getComputeSingularValues(self) -> bool: # <<<<<<<<<<<<<< * """Return flag indicating whether singular values will be calculated. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.KSP.getComputeSingularValues", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":1442 * # --- initial guess --- * * def setInitialGuessNonzero(self, flag: bool) -> None: # <<<<<<<<<<<<<< * """Tell the iterative solver that the initial guess is nonzero. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_85setInitialGuessNonzero(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_84setInitialGuessNonzero, "KSP.setInitialGuessNonzero(self, flag: bool) -> None\nTell the iterative solver that the initial guess is nonzero.\n\n Logically collective.\n\n Otherwise KSP assumes the initial guess is to be zero (and thus\n zeros it out before solving).\n\n Parameters\n ----------\n flag\n `True` indicates the guess is non-zero, `False`\n indicates the guess is zero.\n\n See Also\n --------\n petsc.KSPSetInitialGuessNonzero\n\n \nSource code at petsc4py/PETSc/KSP.pyx:1442"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_85setInitialGuessNonzero(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_flag = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setInitialGuessNonzero (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flag)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 1442, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setInitialGuessNonzero") < 0)) __PYX_ERR(49, 1442, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_flag = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setInitialGuessNonzero", 1, 1, 1, __pyx_nargs); __PYX_ERR(49, 1442, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.KSP.setInitialGuessNonzero", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_84setInitialGuessNonzero(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_flag); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_84setInitialGuessNonzero(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_flag) { PetscBool __pyx_v_guess_nonzero; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setInitialGuessNonzero", 1); /* "petsc4py/PETSc/KSP.pyx":1461 * * """ * cdef PetscBool guess_nonzero = asBool(flag) # <<<<<<<<<<<<<< * CHKERR( KSPSetInitialGuessNonzero(self.ksp, guess_nonzero) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asBool(__pyx_v_flag); if (unlikely(__pyx_t_1 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(49, 1461, __pyx_L1_error) __pyx_v_guess_nonzero = __pyx_t_1; /* "petsc4py/PETSc/KSP.pyx":1462 * """ * cdef PetscBool guess_nonzero = asBool(flag) * CHKERR( KSPSetInitialGuessNonzero(self.ksp, guess_nonzero) ) # <<<<<<<<<<<<<< * * def getInitialGuessNonzero(self) -> bool: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetInitialGuessNonzero(__pyx_v_self->ksp, __pyx_v_guess_nonzero)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 1462, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":1442 * # --- initial guess --- * * def setInitialGuessNonzero(self, flag: bool) -> None: # <<<<<<<<<<<<<< * """Tell the iterative solver that the initial guess is nonzero. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.setInitialGuessNonzero", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":1464 * CHKERR( KSPSetInitialGuessNonzero(self.ksp, guess_nonzero) ) * * def getInitialGuessNonzero(self) -> bool: # <<<<<<<<<<<<<< * """Determine whether the KSP solver uses a zero initial guess. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_87getInitialGuessNonzero(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_86getInitialGuessNonzero, "KSP.getInitialGuessNonzero(self) -> bool\nDetermine whether the KSP solver uses a zero initial guess.\n\n Not collective.\n\n See Also\n --------\n petsc.KSPGetInitialGuessNonzero\n\n \nSource code at petsc4py/PETSc/KSP.pyx:1464"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_87getInitialGuessNonzero(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getInitialGuessNonzero (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getInitialGuessNonzero", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getInitialGuessNonzero", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_86getInitialGuessNonzero(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_86getInitialGuessNonzero(struct PyPetscKSPObject *__pyx_v_self) { PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getInitialGuessNonzero", 1); /* "petsc4py/PETSc/KSP.pyx":1474 * * """ * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( KSPGetInitialGuessNonzero(self.ksp, &flag) ) * return toBool(flag) */ __pyx_v_flag = PETSC_FALSE; /* "petsc4py/PETSc/KSP.pyx":1475 * """ * cdef PetscBool flag = PETSC_FALSE * CHKERR( KSPGetInitialGuessNonzero(self.ksp, &flag) ) # <<<<<<<<<<<<<< * return toBool(flag) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPGetInitialGuessNonzero(__pyx_v_self->ksp, (&__pyx_v_flag))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 1475, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":1476 * cdef PetscBool flag = PETSC_FALSE * CHKERR( KSPGetInitialGuessNonzero(self.ksp, &flag) ) * return toBool(flag) # <<<<<<<<<<<<<< * * def setInitialGuessKnoll(self, flag: bool) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 1476, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/KSP.pyx":1464 * CHKERR( KSPSetInitialGuessNonzero(self.ksp, guess_nonzero) ) * * def getInitialGuessNonzero(self) -> bool: # <<<<<<<<<<<<<< * """Determine whether the KSP solver uses a zero initial guess. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.KSP.getInitialGuessNonzero", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":1478 * return toBool(flag) * * def setInitialGuessKnoll(self, flag: bool) -> None: # <<<<<<<<<<<<<< * """Tell solver to use `PC.apply` to compute the initial guess. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_89setInitialGuessKnoll(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_88setInitialGuessKnoll, "KSP.setInitialGuessKnoll(self, flag: bool) -> None\nTell solver to use `PC.apply` to compute the initial guess.\n\n Logically collective.\n\n This is the Knoll trick.\n\n Parameters\n ----------\n flag\n `True` uses Knoll trick.\n\n See Also\n --------\n petsc.KSPSetInitialGuessKnoll\n\n \nSource code at petsc4py/PETSc/KSP.pyx:1478"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_89setInitialGuessKnoll(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_flag = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setInitialGuessKnoll (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flag)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 1478, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setInitialGuessKnoll") < 0)) __PYX_ERR(49, 1478, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_flag = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setInitialGuessKnoll", 1, 1, 1, __pyx_nargs); __PYX_ERR(49, 1478, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.KSP.setInitialGuessKnoll", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_88setInitialGuessKnoll(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_flag); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_88setInitialGuessKnoll(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_flag) { PetscBool __pyx_v_guess_knoll; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setInitialGuessKnoll", 1); /* "petsc4py/PETSc/KSP.pyx":1495 * * """ * cdef PetscBool guess_knoll = asBool(flag) # <<<<<<<<<<<<<< * CHKERR( KSPSetInitialGuessKnoll(self.ksp, guess_knoll) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asBool(__pyx_v_flag); if (unlikely(__pyx_t_1 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(49, 1495, __pyx_L1_error) __pyx_v_guess_knoll = __pyx_t_1; /* "petsc4py/PETSc/KSP.pyx":1496 * """ * cdef PetscBool guess_knoll = asBool(flag) * CHKERR( KSPSetInitialGuessKnoll(self.ksp, guess_knoll) ) # <<<<<<<<<<<<<< * * def getInitialGuessKnoll(self) -> bool: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetInitialGuessKnoll(__pyx_v_self->ksp, __pyx_v_guess_knoll)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 1496, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":1478 * return toBool(flag) * * def setInitialGuessKnoll(self, flag: bool) -> None: # <<<<<<<<<<<<<< * """Tell solver to use `PC.apply` to compute the initial guess. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.setInitialGuessKnoll", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":1498 * CHKERR( KSPSetInitialGuessKnoll(self.ksp, guess_knoll) ) * * def getInitialGuessKnoll(self) -> bool: # <<<<<<<<<<<<<< * """Determine whether the KSP solver is using the Knoll trick. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_91getInitialGuessKnoll(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_90getInitialGuessKnoll, "KSP.getInitialGuessKnoll(self) -> bool\nDetermine whether the KSP solver is using the Knoll trick.\n\n This uses the Knoll trick; using `PC.apply` to compute the\n initial guess.\n\n See Also\n --------\n petsc.KSPGetInitialGuessKnoll\n\n \nSource code at petsc4py/PETSc/KSP.pyx:1498"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_91getInitialGuessKnoll(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getInitialGuessKnoll (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getInitialGuessKnoll", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getInitialGuessKnoll", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_90getInitialGuessKnoll(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_90getInitialGuessKnoll(struct PyPetscKSPObject *__pyx_v_self) { PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getInitialGuessKnoll", 1); /* "petsc4py/PETSc/KSP.pyx":1509 * * """ * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( KSPGetInitialGuessKnoll(self.ksp, &flag) ) * return toBool(flag) */ __pyx_v_flag = PETSC_FALSE; /* "petsc4py/PETSc/KSP.pyx":1510 * """ * cdef PetscBool flag = PETSC_FALSE * CHKERR( KSPGetInitialGuessKnoll(self.ksp, &flag) ) # <<<<<<<<<<<<<< * return toBool(flag) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPGetInitialGuessKnoll(__pyx_v_self->ksp, (&__pyx_v_flag))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 1510, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":1511 * cdef PetscBool flag = PETSC_FALSE * CHKERR( KSPGetInitialGuessKnoll(self.ksp, &flag) ) * return toBool(flag) # <<<<<<<<<<<<<< * * def setUseFischerGuess(self, model: int, size: int) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 1511, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/KSP.pyx":1498 * CHKERR( KSPSetInitialGuessKnoll(self.ksp, guess_knoll) ) * * def getInitialGuessKnoll(self) -> bool: # <<<<<<<<<<<<<< * """Determine whether the KSP solver is using the Knoll trick. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.KSP.getInitialGuessKnoll", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":1513 * return toBool(flag) * * def setUseFischerGuess(self, model: int, size: int) -> None: # <<<<<<<<<<<<<< * """Use the Paul Fischer algorithm to compute initial guesses. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_93setUseFischerGuess(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_92setUseFischerGuess, "KSP.setUseFischerGuess(self, model: int, size: int) -> None\nUse the Paul Fischer algorithm to compute initial guesses.\n\n Use the Paul Fischer algorithm or its variants to compute\n initial guesses for a set of solves with related right hand\n sides.\n\n Parameters\n ----------\n model\n Use model ``1``, model ``2``, model ``3``, any other number\n to turn it off.\n size\n Size of subspace used to generate initial guess.\n\n See Also\n --------\n petsc.KSPSetUseFischerGuess\n\n \nSource code at petsc4py/PETSc/KSP.pyx:1513"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_93setUseFischerGuess(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_model = 0; PyObject *__pyx_v_size = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setUseFischerGuess (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_model,&__pyx_n_s_size,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_model)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 1513, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 1513, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setUseFischerGuess", 1, 2, 2, 1); __PYX_ERR(49, 1513, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setUseFischerGuess") < 0)) __PYX_ERR(49, 1513, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_model = values[0]; __pyx_v_size = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setUseFischerGuess", 1, 2, 2, __pyx_nargs); __PYX_ERR(49, 1513, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.KSP.setUseFischerGuess", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_92setUseFischerGuess(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_model, __pyx_v_size); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_92setUseFischerGuess(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_model, PyObject *__pyx_v_size) { PetscInt __pyx_v_ival1; PetscInt __pyx_v_ival2; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setUseFischerGuess", 1); /* "petsc4py/PETSc/KSP.pyx":1533 * * """ * cdef PetscInt ival1 = asInt(model) # <<<<<<<<<<<<<< * cdef PetscInt ival2 = asInt(size) * CHKERR( KSPSetUseFischerGuess(self.ksp, ival1, ival2) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_model); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(49, 1533, __pyx_L1_error) __pyx_v_ival1 = __pyx_t_1; /* "petsc4py/PETSc/KSP.pyx":1534 * """ * cdef PetscInt ival1 = asInt(model) * cdef PetscInt ival2 = asInt(size) # <<<<<<<<<<<<<< * CHKERR( KSPSetUseFischerGuess(self.ksp, ival1, ival2) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_size); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(49, 1534, __pyx_L1_error) __pyx_v_ival2 = __pyx_t_1; /* "petsc4py/PETSc/KSP.pyx":1535 * cdef PetscInt ival1 = asInt(model) * cdef PetscInt ival2 = asInt(size) * CHKERR( KSPSetUseFischerGuess(self.ksp, ival1, ival2) ) # <<<<<<<<<<<<<< * * # --- solving --- */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetUseFischerGuess(__pyx_v_self->ksp, __pyx_v_ival1, __pyx_v_ival2)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 1535, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":1513 * return toBool(flag) * * def setUseFischerGuess(self, model: int, size: int) -> None: # <<<<<<<<<<<<<< * """Use the Paul Fischer algorithm to compute initial guesses. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.setUseFischerGuess", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":1539 * # --- solving --- * * def setUp(self) -> None: # <<<<<<<<<<<<<< * """Set up internal data structures for an iterative solver. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_95setUp(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_94setUp, "KSP.setUp(self) -> None\nSet up internal data structures for an iterative solver.\n\n Collective.\n\n See Also\n --------\n petsc.KSPSetUp\n\n \nSource code at petsc4py/PETSc/KSP.pyx:1539"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_95setUp(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setUp (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("setUp", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setUp", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_94setUp(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_94setUp(struct PyPetscKSPObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setUp", 1); /* "petsc4py/PETSc/KSP.pyx":1549 * * """ * CHKERR( KSPSetUp(self.ksp) ) # <<<<<<<<<<<<<< * * def reset(self) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetUp(__pyx_v_self->ksp)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 1549, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":1539 * # --- solving --- * * def setUp(self) -> None: # <<<<<<<<<<<<<< * """Set up internal data structures for an iterative solver. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.setUp", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":1551 * CHKERR( KSPSetUp(self.ksp) ) * * def reset(self) -> None: # <<<<<<<<<<<<<< * """Resets a KSP context. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_97reset(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_96reset, "KSP.reset(self) -> None\nResets a KSP context.\n\n Collective.\n\n Resets a KSP context to the ``kspsetupcalled = 0`` state and\n removes any allocated Vecs and Mats.\n\n See Also\n --------\n petsc.KSPReset\n\n \nSource code at petsc4py/PETSc/KSP.pyx:1551"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_97reset(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("reset (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("reset", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "reset", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_96reset(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_96reset(struct PyPetscKSPObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("reset", 1); /* "petsc4py/PETSc/KSP.pyx":1564 * * """ * CHKERR( KSPReset(self.ksp) ) # <<<<<<<<<<<<<< * * def setUpOnBlocks(self) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPReset(__pyx_v_self->ksp)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 1564, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":1551 * CHKERR( KSPSetUp(self.ksp) ) * * def reset(self) -> None: # <<<<<<<<<<<<<< * """Resets a KSP context. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.reset", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":1566 * CHKERR( KSPReset(self.ksp) ) * * def setUpOnBlocks(self) -> None: # <<<<<<<<<<<<<< * """Set up the preconditioner for each block in a block method. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_99setUpOnBlocks(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_98setUpOnBlocks, "KSP.setUpOnBlocks(self) -> None\nSet up the preconditioner for each block in a block method.\n\n Collective.\n\n Methods include: block Jacobi, block Gauss-Seidel, and\n overlapping Schwarz methods.\n\n See Also\n --------\n petsc.KSPSetUpOnBlocks\n\n \nSource code at petsc4py/PETSc/KSP.pyx:1566"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_99setUpOnBlocks(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setUpOnBlocks (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("setUpOnBlocks", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setUpOnBlocks", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_98setUpOnBlocks(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_98setUpOnBlocks(struct PyPetscKSPObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setUpOnBlocks", 1); /* "petsc4py/PETSc/KSP.pyx":1579 * * """ * CHKERR( KSPSetUpOnBlocks(self.ksp) ) # <<<<<<<<<<<<<< * * def solve(self, Vec b, Vec x) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetUpOnBlocks(__pyx_v_self->ksp)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 1579, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":1566 * CHKERR( KSPReset(self.ksp) ) * * def setUpOnBlocks(self) -> None: # <<<<<<<<<<<<<< * """Set up the preconditioner for each block in a block method. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.setUpOnBlocks", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":1581 * CHKERR( KSPSetUpOnBlocks(self.ksp) ) * * def solve(self, Vec b, Vec x) -> None: # <<<<<<<<<<<<<< * """Solve the linear system. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_101solve(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_100solve, "KSP.solve(self, b: Vec, x: Vec) -> None\nSolve the linear system.\n\n Collective.\n\n Parameters\n ----------\n b\n Right hand side vector.\n x\n Solution vector.\n\n Notes\n -----\n If one uses `setDM` then ``x`` or ``b`` need not be passed. Use\n `getSolution` to access the solution in this case.\n\n The operator is specified with `setOperators`.\n\n `solve` will normally return without generating an error\n regardless of whether the linear system was solved or if\n constructing the preconditioner failed. Call\n `getConvergedReason` to determine if the solver converged or\n failed and why. The option ``-ksp_error_if_not_converged`` or\n function `setErrorIfNotConverged` will cause `solve` to error\n as soon as an error occurs in the linear solver. In inner\n solves, ``DIVERGED_MAX_IT`` is not treated as an error\n because when using nested solvers it may be fine that inner\n solvers in the preconditioner do not converge during the\n solution process.\n\n The number of iterations can be obtained from `its`.\n\n If you provide a matrix that has a `Mat.setNullSpace` and\n `Mat.setTransposeNullSpace` this will use that information to\n solve singular systems in the least squares sense with a norm\n minimizing solution.\n\n Ax = b where b = b\342\202\232 + b\342\202\234 where b\342\202\234 is not in the range of A\n (and hence by the fundamental theorem of linear algebra is in\n the nullspace(A\341\265\200), see `Mat.setNullSpace`.\n\n KSP first removes b\342\202\234 producing the linear system Ax = b\342\202\232 (which\n has multiple solutions) and solves this to find the \342\210\245x\342\210\245\n minimizing solution (and hence it finds the solution x\n orthogonal to the nullspace(A). The algorithm is simply in each""\n iteration of the Krylov method we remove the nullspace(A) from\n the search direction thus the solution which is a linear\n combination of the search directions has no component in the\n nullspace(A).\n\n We recommend always using `Type.GMRES` for such singular\n systems. If nullspace(A) = nullspace(A\341\265\200) (note symmetric\n matrices always satisfy this property) then both left and right\n preconditioning will work If nullspace(A) != nullspace(A\341\265\200) then\n left preconditioning will work but right preconditioning may\n not work (or it may).\n\n If using a direct method (e.g., via the KSP solver\n `Type.PREONLY` and a preconditioner such as `PC.Type.LU` or\n `PC.Type.ILU`, then its=1. See `setTolerances` for more details.\n\n **Understanding Convergence**\n\n The routines `setMonitor` and `computeEigenvalues` provide\n information on additional options to monitor convergence and\n print eigenvalue information.\n\n See Also\n --------\n create, setUp, destroy, setTolerances, is_converged, solveTranspose, its\n Mat.setNullSpace, Mat.setTransposeNullSpace, Type,\n setErrorIfNotConverged petsc_options, petsc.KSPSolve\n\n \nSource code at petsc4py/PETSc/KSP.pyx:1581"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_101solve(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_b = 0; struct PyPetscVecObject *__pyx_v_x = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("solve (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_b,&__pyx_n_s_x,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_b)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 1581, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 1581, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("solve", 1, 2, 2, 1); __PYX_ERR(49, 1581, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "solve") < 0)) __PYX_ERR(49, 1581, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_b = ((struct PyPetscVecObject *)values[0]); __pyx_v_x = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("solve", 1, 2, 2, __pyx_nargs); __PYX_ERR(49, 1581, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.KSP.solve", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "b", 0))) __PYX_ERR(49, 1581, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(49, 1581, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_100solve(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_b, __pyx_v_x); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_100solve(struct PyPetscKSPObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_b, struct PyPetscVecObject *__pyx_v_x) { Vec __pyx_v_b_vec; Vec __pyx_v_x_vec; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; Vec __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("solve", 1); /* "petsc4py/PETSc/KSP.pyx":1656 * * """ * cdef PetscVec b_vec = NULL # <<<<<<<<<<<<<< * cdef PetscVec x_vec = NULL * if b is not None: b_vec = b.vec */ __pyx_v_b_vec = NULL; /* "petsc4py/PETSc/KSP.pyx":1657 * """ * cdef PetscVec b_vec = NULL * cdef PetscVec x_vec = NULL # <<<<<<<<<<<<<< * if b is not None: b_vec = b.vec * if x is not None: x_vec = x.vec */ __pyx_v_x_vec = NULL; /* "petsc4py/PETSc/KSP.pyx":1658 * cdef PetscVec b_vec = NULL * cdef PetscVec x_vec = NULL * if b is not None: b_vec = b.vec # <<<<<<<<<<<<<< * if x is not None: x_vec = x.vec * CHKERR( KSPSolve(self.ksp, b_vec, x_vec) ) */ __pyx_t_1 = (((PyObject *)__pyx_v_b) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_b->vec; __pyx_v_b_vec = __pyx_t_2; } /* "petsc4py/PETSc/KSP.pyx":1659 * cdef PetscVec x_vec = NULL * if b is not None: b_vec = b.vec * if x is not None: x_vec = x.vec # <<<<<<<<<<<<<< * CHKERR( KSPSolve(self.ksp, b_vec, x_vec) ) * */ __pyx_t_1 = (((PyObject *)__pyx_v_x) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_x->vec; __pyx_v_x_vec = __pyx_t_2; } /* "petsc4py/PETSc/KSP.pyx":1660 * if b is not None: b_vec = b.vec * if x is not None: x_vec = x.vec * CHKERR( KSPSolve(self.ksp, b_vec, x_vec) ) # <<<<<<<<<<<<<< * * def solveTranspose(self, Vec b, Vec x) -> None: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSolve(__pyx_v_self->ksp, __pyx_v_b_vec, __pyx_v_x_vec)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 1660, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":1581 * CHKERR( KSPSetUpOnBlocks(self.ksp) ) * * def solve(self, Vec b, Vec x) -> None: # <<<<<<<<<<<<<< * """Solve the linear system. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.solve", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":1662 * CHKERR( KSPSolve(self.ksp, b_vec, x_vec) ) * * def solveTranspose(self, Vec b, Vec x) -> None: # <<<<<<<<<<<<<< * """Solve the transpose of a linear system. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_103solveTranspose(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_102solveTranspose, "KSP.solveTranspose(self, b: Vec, x: Vec) -> None\nSolve the transpose of a linear system.\n\n Collective.\n\n Parameters\n ----------\n b\n Right hand side vector.\n x\n Solution vector.\n\n Notes\n -----\n For complex numbers this solve the non-Hermitian transpose\n system.\n\n See Also\n --------\n solve, petsc.KSPSolveTranspose\n\n \nSource code at petsc4py/PETSc/KSP.pyx:1662"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_103solveTranspose(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_b = 0; struct PyPetscVecObject *__pyx_v_x = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("solveTranspose (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_b,&__pyx_n_s_x,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_b)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 1662, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 1662, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("solveTranspose", 1, 2, 2, 1); __PYX_ERR(49, 1662, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "solveTranspose") < 0)) __PYX_ERR(49, 1662, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_b = ((struct PyPetscVecObject *)values[0]); __pyx_v_x = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("solveTranspose", 1, 2, 2, __pyx_nargs); __PYX_ERR(49, 1662, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.KSP.solveTranspose", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "b", 0))) __PYX_ERR(49, 1662, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(49, 1662, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_102solveTranspose(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_b, __pyx_v_x); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_102solveTranspose(struct PyPetscKSPObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_b, struct PyPetscVecObject *__pyx_v_x) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("solveTranspose", 1); /* "petsc4py/PETSc/KSP.pyx":1684 * * """ * CHKERR( KSPSolveTranspose(self.ksp, b.vec, x.vec) ) # <<<<<<<<<<<<<< * * def matSolve(self, Mat B, Mat X) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSolveTranspose(__pyx_v_self->ksp, __pyx_v_b->vec, __pyx_v_x->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 1684, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":1662 * CHKERR( KSPSolve(self.ksp, b_vec, x_vec) ) * * def solveTranspose(self, Vec b, Vec x) -> None: # <<<<<<<<<<<<<< * """Solve the transpose of a linear system. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.solveTranspose", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":1686 * CHKERR( KSPSolveTranspose(self.ksp, b.vec, x.vec) ) * * def matSolve(self, Mat B, Mat X) -> None: # <<<<<<<<<<<<<< * """Solve a linear system with multiple right-hand sides. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_105matSolve(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_104matSolve, "KSP.matSolve(self, B: Mat, X: Mat) -> None\nSolve a linear system with multiple right-hand sides.\n\n These are stored as a `Mat.Type.DENSE`. Unlike `solve`,\n ``B`` and ``X`` must be different matrices.\n\n Parameters\n ----------\n B\n Block of right-hand sides.\n X\n Block of solutions.\n\n See Also\n --------\n solve, petsc.KSPMatSolve\n\n \nSource code at petsc4py/PETSc/KSP.pyx:1686"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_105matSolve(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscMatObject *__pyx_v_B = 0; struct PyPetscMatObject *__pyx_v_X = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("matSolve (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_B,&__pyx_n_s_X,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_B)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 1686, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_X)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 1686, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("matSolve", 1, 2, 2, 1); __PYX_ERR(49, 1686, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "matSolve") < 0)) __PYX_ERR(49, 1686, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_B = ((struct PyPetscMatObject *)values[0]); __pyx_v_X = ((struct PyPetscMatObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("matSolve", 1, 2, 2, __pyx_nargs); __PYX_ERR(49, 1686, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.KSP.matSolve", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_B), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "B", 0))) __PYX_ERR(49, 1686, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_X), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "X", 0))) __PYX_ERR(49, 1686, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_104matSolve(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_B, __pyx_v_X); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_104matSolve(struct PyPetscKSPObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_B, struct PyPetscMatObject *__pyx_v_X) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("matSolve", 1); /* "petsc4py/PETSc/KSP.pyx":1704 * * """ * CHKERR( KSPMatSolve(self.ksp, B.mat, X.mat) ) # <<<<<<<<<<<<<< * * def matSolveTranspose(self, Mat B, Mat X) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPMatSolve(__pyx_v_self->ksp, __pyx_v_B->mat, __pyx_v_X->mat)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 1704, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":1686 * CHKERR( KSPSolveTranspose(self.ksp, b.vec, x.vec) ) * * def matSolve(self, Mat B, Mat X) -> None: # <<<<<<<<<<<<<< * """Solve a linear system with multiple right-hand sides. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.matSolve", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":1706 * CHKERR( KSPMatSolve(self.ksp, B.mat, X.mat) ) * * def matSolveTranspose(self, Mat B, Mat X) -> None: # <<<<<<<<<<<<<< * """Solve the transpose of a linear system with multiple RHS. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_107matSolveTranspose(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_106matSolveTranspose, "KSP.matSolveTranspose(self, B: Mat, X: Mat) -> None\nSolve the transpose of a linear system with multiple RHS.\n\n Parameters\n ----------\n B\n Block of right-hand sides.\n X\n Block of solutions.\n\n See Also\n --------\n solveTranspose, petsc.KSPMatSolve\n\n \nSource code at petsc4py/PETSc/KSP.pyx:1706"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_107matSolveTranspose(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscMatObject *__pyx_v_B = 0; struct PyPetscMatObject *__pyx_v_X = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("matSolveTranspose (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_B,&__pyx_n_s_X,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_B)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 1706, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_X)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 1706, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("matSolveTranspose", 1, 2, 2, 1); __PYX_ERR(49, 1706, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "matSolveTranspose") < 0)) __PYX_ERR(49, 1706, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_B = ((struct PyPetscMatObject *)values[0]); __pyx_v_X = ((struct PyPetscMatObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("matSolveTranspose", 1, 2, 2, __pyx_nargs); __PYX_ERR(49, 1706, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.KSP.matSolveTranspose", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_B), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "B", 0))) __PYX_ERR(49, 1706, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_X), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "X", 0))) __PYX_ERR(49, 1706, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_106matSolveTranspose(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_B, __pyx_v_X); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_106matSolveTranspose(struct PyPetscKSPObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_B, struct PyPetscMatObject *__pyx_v_X) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("matSolveTranspose", 1); /* "petsc4py/PETSc/KSP.pyx":1721 * * """ * CHKERR( KSPMatSolveTranspose(self.ksp, B.mat, X.mat) ) # <<<<<<<<<<<<<< * * def setIterationNumber(self, its: int) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPMatSolveTranspose(__pyx_v_self->ksp, __pyx_v_B->mat, __pyx_v_X->mat)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 1721, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":1706 * CHKERR( KSPMatSolve(self.ksp, B.mat, X.mat) ) * * def matSolveTranspose(self, Mat B, Mat X) -> None: # <<<<<<<<<<<<<< * """Solve the transpose of a linear system with multiple RHS. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.matSolveTranspose", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":1723 * CHKERR( KSPMatSolveTranspose(self.ksp, B.mat, X.mat) ) * * def setIterationNumber(self, its: int) -> None: # <<<<<<<<<<<<<< * """Use `its` property.""" * cdef PetscInt ival = asInt(its) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_109setIterationNumber(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_108setIterationNumber, "KSP.setIterationNumber(self, its: int) -> None\nUse `its` property.\nSource code at petsc4py/PETSc/KSP.pyx:1723"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_109setIterationNumber(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_its = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setIterationNumber (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_its,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_its)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 1723, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setIterationNumber") < 0)) __PYX_ERR(49, 1723, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_its = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setIterationNumber", 1, 1, 1, __pyx_nargs); __PYX_ERR(49, 1723, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.KSP.setIterationNumber", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_108setIterationNumber(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_its); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_108setIterationNumber(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_its) { PetscInt __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setIterationNumber", 1); /* "petsc4py/PETSc/KSP.pyx":1725 * def setIterationNumber(self, its: int) -> None: * """Use `its` property.""" * cdef PetscInt ival = asInt(its) # <<<<<<<<<<<<<< * CHKERR( KSPSetIterationNumber(self.ksp, ival) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_its); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(49, 1725, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "petsc4py/PETSc/KSP.pyx":1726 * """Use `its` property.""" * cdef PetscInt ival = asInt(its) * CHKERR( KSPSetIterationNumber(self.ksp, ival) ) # <<<<<<<<<<<<<< * * def getIterationNumber(self) -> int: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetIterationNumber(__pyx_v_self->ksp, __pyx_v_ival)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 1726, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":1723 * CHKERR( KSPMatSolveTranspose(self.ksp, B.mat, X.mat) ) * * def setIterationNumber(self, its: int) -> None: # <<<<<<<<<<<<<< * """Use `its` property.""" * cdef PetscInt ival = asInt(its) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.setIterationNumber", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":1728 * CHKERR( KSPSetIterationNumber(self.ksp, ival) ) * * def getIterationNumber(self) -> int: # <<<<<<<<<<<<<< * """Use `its` property.""" * cdef PetscInt ival = 0 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_111getIterationNumber(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_110getIterationNumber, "KSP.getIterationNumber(self) -> int\nUse `its` property.\nSource code at petsc4py/PETSc/KSP.pyx:1728"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_111getIterationNumber(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getIterationNumber (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getIterationNumber", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getIterationNumber", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_110getIterationNumber(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_110getIterationNumber(struct PyPetscKSPObject *__pyx_v_self) { PetscInt __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getIterationNumber", 1); /* "petsc4py/PETSc/KSP.pyx":1730 * def getIterationNumber(self) -> int: * """Use `its` property.""" * cdef PetscInt ival = 0 # <<<<<<<<<<<<<< * CHKERR( KSPGetIterationNumber(self.ksp, &ival) ) * return toInt(ival) */ __pyx_v_ival = 0; /* "petsc4py/PETSc/KSP.pyx":1731 * """Use `its` property.""" * cdef PetscInt ival = 0 * CHKERR( KSPGetIterationNumber(self.ksp, &ival) ) # <<<<<<<<<<<<<< * return toInt(ival) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPGetIterationNumber(__pyx_v_self->ksp, (&__pyx_v_ival))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 1731, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":1732 * cdef PetscInt ival = 0 * CHKERR( KSPGetIterationNumber(self.ksp, &ival) ) * return toInt(ival) # <<<<<<<<<<<<<< * * def setResidualNorm(self, rnorm: float) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ival); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 1732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/KSP.pyx":1728 * CHKERR( KSPSetIterationNumber(self.ksp, ival) ) * * def getIterationNumber(self) -> int: # <<<<<<<<<<<<<< * """Use `its` property.""" * cdef PetscInt ival = 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.KSP.getIterationNumber", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":1734 * return toInt(ival) * * def setResidualNorm(self, rnorm: float) -> None: # <<<<<<<<<<<<<< * """Use `norm` property.""" * cdef PetscReal rval = asReal(rnorm) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_113setResidualNorm(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_112setResidualNorm, "KSP.setResidualNorm(self, rnorm: float) -> None\nUse `norm` property.\nSource code at petsc4py/PETSc/KSP.pyx:1734"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_113setResidualNorm(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_rnorm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setResidualNorm (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rnorm,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnorm)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 1734, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setResidualNorm") < 0)) __PYX_ERR(49, 1734, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_rnorm = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setResidualNorm", 1, 1, 1, __pyx_nargs); __PYX_ERR(49, 1734, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.KSP.setResidualNorm", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_112setResidualNorm(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_rnorm); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_112setResidualNorm(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_rnorm) { PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setResidualNorm", 1); /* "petsc4py/PETSc/KSP.pyx":1736 * def setResidualNorm(self, rnorm: float) -> None: * """Use `norm` property.""" * cdef PetscReal rval = asReal(rnorm) # <<<<<<<<<<<<<< * CHKERR( KSPSetResidualNorm(self.ksp, rval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_rnorm); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(49, 1736, __pyx_L1_error) __pyx_v_rval = __pyx_t_1; /* "petsc4py/PETSc/KSP.pyx":1737 * """Use `norm` property.""" * cdef PetscReal rval = asReal(rnorm) * CHKERR( KSPSetResidualNorm(self.ksp, rval) ) # <<<<<<<<<<<<<< * * def getResidualNorm(self) -> float: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetResidualNorm(__pyx_v_self->ksp, __pyx_v_rval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 1737, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":1734 * return toInt(ival) * * def setResidualNorm(self, rnorm: float) -> None: # <<<<<<<<<<<<<< * """Use `norm` property.""" * cdef PetscReal rval = asReal(rnorm) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.setResidualNorm", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":1739 * CHKERR( KSPSetResidualNorm(self.ksp, rval) ) * * def getResidualNorm(self) -> float: # <<<<<<<<<<<<<< * """Use `norm` property.""" * cdef PetscReal rval = 0 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_115getResidualNorm(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_114getResidualNorm, "KSP.getResidualNorm(self) -> float\nUse `norm` property.\nSource code at petsc4py/PETSc/KSP.pyx:1739"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_115getResidualNorm(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getResidualNorm (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getResidualNorm", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getResidualNorm", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_114getResidualNorm(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_114getResidualNorm(struct PyPetscKSPObject *__pyx_v_self) { PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getResidualNorm", 1); /* "petsc4py/PETSc/KSP.pyx":1741 * def getResidualNorm(self) -> float: * """Use `norm` property.""" * cdef PetscReal rval = 0 # <<<<<<<<<<<<<< * CHKERR( KSPGetResidualNorm(self.ksp, &rval) ) * return toReal(rval) */ __pyx_v_rval = 0.0; /* "petsc4py/PETSc/KSP.pyx":1742 * """Use `norm` property.""" * cdef PetscReal rval = 0 * CHKERR( KSPGetResidualNorm(self.ksp, &rval) ) # <<<<<<<<<<<<<< * return toReal(rval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPGetResidualNorm(__pyx_v_self->ksp, (&__pyx_v_rval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 1742, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":1743 * cdef PetscReal rval = 0 * CHKERR( KSPGetResidualNorm(self.ksp, &rval) ) * return toReal(rval) # <<<<<<<<<<<<<< * * def setConvergedReason(self, reason: KSP.ConvergedReason) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_rval); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 1743, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/KSP.pyx":1739 * CHKERR( KSPSetResidualNorm(self.ksp, rval) ) * * def getResidualNorm(self) -> float: # <<<<<<<<<<<<<< * """Use `norm` property.""" * cdef PetscReal rval = 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.KSP.getResidualNorm", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":1745 * return toReal(rval) * * def setConvergedReason(self, reason: KSP.ConvergedReason) -> None: # <<<<<<<<<<<<<< * """Use `reason` property.""" * cdef PetscKSPConvergedReason val = reason */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_117setConvergedReason(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_116setConvergedReason, "KSP.setConvergedReason(self, reason: KSP.ConvergedReason) -> None\nUse `reason` property.\nSource code at petsc4py/PETSc/KSP.pyx:1745"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_117setConvergedReason(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_reason = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setConvergedReason (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_reason,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_reason)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 1745, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setConvergedReason") < 0)) __PYX_ERR(49, 1745, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_reason = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setConvergedReason", 1, 1, 1, __pyx_nargs); __PYX_ERR(49, 1745, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.KSP.setConvergedReason", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_116setConvergedReason(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_reason); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_116setConvergedReason(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_reason) { KSPConvergedReason __pyx_v_val; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations KSPConvergedReason __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setConvergedReason", 1); /* "petsc4py/PETSc/KSP.pyx":1747 * def setConvergedReason(self, reason: KSP.ConvergedReason) -> None: * """Use `reason` property.""" * cdef PetscKSPConvergedReason val = reason # <<<<<<<<<<<<<< * CHKERR( KSPSetConvergedReason(self.ksp, val) ) * */ __pyx_t_1 = ((KSPConvergedReason)__Pyx_PyInt_As_KSPConvergedReason(__pyx_v_reason)); if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 1747, __pyx_L1_error) __pyx_v_val = __pyx_t_1; /* "petsc4py/PETSc/KSP.pyx":1748 * """Use `reason` property.""" * cdef PetscKSPConvergedReason val = reason * CHKERR( KSPSetConvergedReason(self.ksp, val) ) # <<<<<<<<<<<<<< * * def getConvergedReason(self) -> KSP.ConvergedReason: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetConvergedReason(__pyx_v_self->ksp, __pyx_v_val)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 1748, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":1745 * return toReal(rval) * * def setConvergedReason(self, reason: KSP.ConvergedReason) -> None: # <<<<<<<<<<<<<< * """Use `reason` property.""" * cdef PetscKSPConvergedReason val = reason */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.setConvergedReason", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":1750 * CHKERR( KSPSetConvergedReason(self.ksp, val) ) * * def getConvergedReason(self) -> KSP.ConvergedReason: # <<<<<<<<<<<<<< * """Use `reason` property.""" * cdef PetscKSPConvergedReason reason = KSP_CONVERGED_ITERATING */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_119getConvergedReason(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_118getConvergedReason, "KSP.getConvergedReason(self) -> KSP.ConvergedReason\nUse `reason` property.\nSource code at petsc4py/PETSc/KSP.pyx:1750"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_119getConvergedReason(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getConvergedReason (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getConvergedReason", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getConvergedReason", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_118getConvergedReason(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_118getConvergedReason(struct PyPetscKSPObject *__pyx_v_self) { KSPConvergedReason __pyx_v_reason; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getConvergedReason", 1); /* "petsc4py/PETSc/KSP.pyx":1752 * def getConvergedReason(self) -> KSP.ConvergedReason: * """Use `reason` property.""" * cdef PetscKSPConvergedReason reason = KSP_CONVERGED_ITERATING # <<<<<<<<<<<<<< * CHKERR( KSPGetConvergedReason(self.ksp, &reason) ) * return reason */ __pyx_v_reason = KSP_CONVERGED_ITERATING; /* "petsc4py/PETSc/KSP.pyx":1753 * """Use `reason` property.""" * cdef PetscKSPConvergedReason reason = KSP_CONVERGED_ITERATING * CHKERR( KSPGetConvergedReason(self.ksp, &reason) ) # <<<<<<<<<<<<<< * return reason * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPGetConvergedReason(__pyx_v_self->ksp, (&__pyx_v_reason))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 1753, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":1754 * cdef PetscKSPConvergedReason reason = KSP_CONVERGED_ITERATING * CHKERR( KSPGetConvergedReason(self.ksp, &reason) ) * return reason # <<<<<<<<<<<<<< * * def setHPDDMType(self, hpddm_type: HPDDMType) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_KSPConvergedReason(__pyx_v_reason); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 1754, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/KSP.pyx":1750 * CHKERR( KSPSetConvergedReason(self.ksp, val) ) * * def getConvergedReason(self) -> KSP.ConvergedReason: # <<<<<<<<<<<<<< * """Use `reason` property.""" * cdef PetscKSPConvergedReason reason = KSP_CONVERGED_ITERATING */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.KSP.getConvergedReason", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":1756 * return reason * * def setHPDDMType(self, hpddm_type: HPDDMType) -> None: # <<<<<<<<<<<<<< * """Set the Krylov solver type. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_121setHPDDMType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_120setHPDDMType, "KSP.setHPDDMType(self, hpddm_type: HPDDMType) -> None\nSet the Krylov solver type.\n\n Collective.\n\n Parameters\n ----------\n hpddm_type\n The type of Krylov solver to use.\n\n See Also\n --------\n petsc.KSPHPDDMSetType\n\n \nSource code at petsc4py/PETSc/KSP.pyx:1756"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_121setHPDDMType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_hpddm_type = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setHPDDMType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_hpddm_type,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_hpddm_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 1756, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setHPDDMType") < 0)) __PYX_ERR(49, 1756, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_hpddm_type = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setHPDDMType", 1, 1, 1, __pyx_nargs); __PYX_ERR(49, 1756, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.KSP.setHPDDMType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_120setHPDDMType(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_hpddm_type); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_120setHPDDMType(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_hpddm_type) { KSPHPDDMType __pyx_v_ctype; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations KSPHPDDMType __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setHPDDMType", 1); /* "petsc4py/PETSc/KSP.pyx":1771 * * """ * cdef PetscKSPHPDDMType ctype = hpddm_type # <<<<<<<<<<<<<< * CHKERR( KSPHPDDMSetType(self.ksp, ctype) ) * */ __pyx_t_1 = ((KSPHPDDMType)__Pyx_PyInt_As_KSPHPDDMType(__pyx_v_hpddm_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 1771, __pyx_L1_error) __pyx_v_ctype = __pyx_t_1; /* "petsc4py/PETSc/KSP.pyx":1772 * """ * cdef PetscKSPHPDDMType ctype = hpddm_type * CHKERR( KSPHPDDMSetType(self.ksp, ctype) ) # <<<<<<<<<<<<<< * * def getHPDDMType(self) -> HPDDMType: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPHPDDMSetType(__pyx_v_self->ksp, __pyx_v_ctype)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 1772, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":1756 * return reason * * def setHPDDMType(self, hpddm_type: HPDDMType) -> None: # <<<<<<<<<<<<<< * """Set the Krylov solver type. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.setHPDDMType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":1774 * CHKERR( KSPHPDDMSetType(self.ksp, ctype) ) * * def getHPDDMType(self) -> HPDDMType: # <<<<<<<<<<<<<< * """Return the Krylov solver type. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_123getHPDDMType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_122getHPDDMType, "KSP.getHPDDMType(self) -> HPDDMType\nReturn the Krylov solver type.\n\n See Also\n --------\n petsc.KSPHPDDMGetType\n\n \nSource code at petsc4py/PETSc/KSP.pyx:1774"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_123getHPDDMType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getHPDDMType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getHPDDMType", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getHPDDMType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_122getHPDDMType(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_122getHPDDMType(struct PyPetscKSPObject *__pyx_v_self) { KSPHPDDMType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getHPDDMType", 1); /* "petsc4py/PETSc/KSP.pyx":1782 * * """ * cdef PetscKSPHPDDMType cval = KSP_HPDDM_TYPE_GMRES # <<<<<<<<<<<<<< * CHKERR( KSPHPDDMGetType(self.ksp, &cval) ) * return cval */ __pyx_v_cval = KSP_HPDDM_TYPE_GMRES; /* "petsc4py/PETSc/KSP.pyx":1783 * """ * cdef PetscKSPHPDDMType cval = KSP_HPDDM_TYPE_GMRES * CHKERR( KSPHPDDMGetType(self.ksp, &cval) ) # <<<<<<<<<<<<<< * return cval * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPHPDDMGetType(__pyx_v_self->ksp, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 1783, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":1784 * cdef PetscKSPHPDDMType cval = KSP_HPDDM_TYPE_GMRES * CHKERR( KSPHPDDMGetType(self.ksp, &cval) ) * return cval # <<<<<<<<<<<<<< * * def setErrorIfNotConverged(self, flag: bool) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_KSPHPDDMType(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 1784, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/KSP.pyx":1774 * CHKERR( KSPHPDDMSetType(self.ksp, ctype) ) * * def getHPDDMType(self) -> HPDDMType: # <<<<<<<<<<<<<< * """Return the Krylov solver type. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.KSP.getHPDDMType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":1786 * return cval * * def setErrorIfNotConverged(self, flag: bool) -> None: # <<<<<<<<<<<<<< * """Cause `solve` to generate an error if not converged. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_125setErrorIfNotConverged(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_124setErrorIfNotConverged, "KSP.setErrorIfNotConverged(self, flag: bool) -> None\nCause `solve` to generate an error if not converged.\n\n Logically collective.\n\n Parameters\n ----------\n flag\n `True` enables this behavior.\n\n See Also\n --------\n petsc.KSPSetErrorIfNotConverged\n\n \nSource code at petsc4py/PETSc/KSP.pyx:1786"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_125setErrorIfNotConverged(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_flag = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setErrorIfNotConverged (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flag)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 1786, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setErrorIfNotConverged") < 0)) __PYX_ERR(49, 1786, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_flag = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setErrorIfNotConverged", 1, 1, 1, __pyx_nargs); __PYX_ERR(49, 1786, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.KSP.setErrorIfNotConverged", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_124setErrorIfNotConverged(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_flag); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_124setErrorIfNotConverged(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_flag) { PetscBool __pyx_v_ernc; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setErrorIfNotConverged", 1); /* "petsc4py/PETSc/KSP.pyx":1801 * * """ * cdef PetscBool ernc = asBool(flag) # <<<<<<<<<<<<<< * CHKERR( KSPSetErrorIfNotConverged(self.ksp, ernc) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asBool(__pyx_v_flag); if (unlikely(__pyx_t_1 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(49, 1801, __pyx_L1_error) __pyx_v_ernc = __pyx_t_1; /* "petsc4py/PETSc/KSP.pyx":1802 * """ * cdef PetscBool ernc = asBool(flag) * CHKERR( KSPSetErrorIfNotConverged(self.ksp, ernc) ) # <<<<<<<<<<<<<< * * def getErrorIfNotConverged(self) -> bool: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetErrorIfNotConverged(__pyx_v_self->ksp, __pyx_v_ernc)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 1802, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":1786 * return cval * * def setErrorIfNotConverged(self, flag: bool) -> None: # <<<<<<<<<<<<<< * """Cause `solve` to generate an error if not converged. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.setErrorIfNotConverged", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":1804 * CHKERR( KSPSetErrorIfNotConverged(self.ksp, ernc) ) * * def getErrorIfNotConverged(self) -> bool: # <<<<<<<<<<<<<< * """Return the flag indicating the solver will error if divergent. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_127getErrorIfNotConverged(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_126getErrorIfNotConverged, "KSP.getErrorIfNotConverged(self) -> bool\nReturn the flag indicating the solver will error if divergent.\n\n Not collective.\n\n See Also\n --------\n petsc.KSPGetErrorIfNotConverged\n\n \nSource code at petsc4py/PETSc/KSP.pyx:1804"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_127getErrorIfNotConverged(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getErrorIfNotConverged (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getErrorIfNotConverged", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getErrorIfNotConverged", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_126getErrorIfNotConverged(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_126getErrorIfNotConverged(struct PyPetscKSPObject *__pyx_v_self) { PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getErrorIfNotConverged", 1); /* "petsc4py/PETSc/KSP.pyx":1814 * * """ * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( KSPGetErrorIfNotConverged(self.ksp, &flag) ) * return toBool(flag) */ __pyx_v_flag = PETSC_FALSE; /* "petsc4py/PETSc/KSP.pyx":1815 * """ * cdef PetscBool flag = PETSC_FALSE * CHKERR( KSPGetErrorIfNotConverged(self.ksp, &flag) ) # <<<<<<<<<<<<<< * return toBool(flag) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPGetErrorIfNotConverged(__pyx_v_self->ksp, (&__pyx_v_flag))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 1815, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":1816 * cdef PetscBool flag = PETSC_FALSE * CHKERR( KSPGetErrorIfNotConverged(self.ksp, &flag) ) * return toBool(flag) # <<<<<<<<<<<<<< * * def getRhs(self) -> Vec: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 1816, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/KSP.pyx":1804 * CHKERR( KSPSetErrorIfNotConverged(self.ksp, ernc) ) * * def getErrorIfNotConverged(self) -> bool: # <<<<<<<<<<<<<< * """Return the flag indicating the solver will error if divergent. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.KSP.getErrorIfNotConverged", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":1818 * return toBool(flag) * * def getRhs(self) -> Vec: # <<<<<<<<<<<<<< * """Return the right-hand side vector for the linear system. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_129getRhs(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_128getRhs, "KSP.getRhs(self) -> Vec\nReturn the right-hand side vector for the linear system.\n\n Not collective.\n\n See Also\n --------\n petsc.KSPGetRhs\n\n \nSource code at petsc4py/PETSc/KSP.pyx:1818"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_129getRhs(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getRhs (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getRhs", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getRhs", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_128getRhs(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_128getRhs(struct PyPetscKSPObject *__pyx_v_self) { struct PyPetscVecObject *__pyx_v_vec = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getRhs", 1); /* "petsc4py/PETSc/KSP.pyx":1828 * * """ * cdef Vec vec = Vec() # <<<<<<<<<<<<<< * CHKERR( KSPGetRhs(self.ksp, &vec.vec) ) * CHKERR( PetscINCREF(vec.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 1828, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/KSP.pyx":1829 * """ * cdef Vec vec = Vec() * CHKERR( KSPGetRhs(self.ksp, &vec.vec) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(vec.obj) ) * return vec */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPGetRhs(__pyx_v_self->ksp, (&__pyx_v_vec->vec))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 1829, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":1830 * cdef Vec vec = Vec() * CHKERR( KSPGetRhs(self.ksp, &vec.vec) ) * CHKERR( PetscINCREF(vec.obj) ) # <<<<<<<<<<<<<< * return vec * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_vec->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 1830, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":1831 * CHKERR( KSPGetRhs(self.ksp, &vec.vec) ) * CHKERR( PetscINCREF(vec.obj) ) * return vec # <<<<<<<<<<<<<< * * def getSolution(self) -> Vec: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_vec); __pyx_r = ((PyObject *)__pyx_v_vec); goto __pyx_L0; /* "petsc4py/PETSc/KSP.pyx":1818 * return toBool(flag) * * def getRhs(self) -> Vec: # <<<<<<<<<<<<<< * """Return the right-hand side vector for the linear system. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.KSP.getRhs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_vec); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":1833 * return vec * * def getSolution(self) -> Vec: # <<<<<<<<<<<<<< * """Return the solution for the linear system to be solved. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_131getSolution(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_130getSolution, "KSP.getSolution(self) -> Vec\nReturn the solution for the linear system to be solved.\n\n Note that this may not be the solution that is stored during\n the iterative process.\n\n See Also\n --------\n petsc.KSPGetSolution\n\n \nSource code at petsc4py/PETSc/KSP.pyx:1833"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_131getSolution(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSolution (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getSolution", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getSolution", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_130getSolution(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_130getSolution(struct PyPetscKSPObject *__pyx_v_self) { struct PyPetscVecObject *__pyx_v_vec = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSolution", 1); /* "petsc4py/PETSc/KSP.pyx":1844 * * """ * cdef Vec vec = Vec() # <<<<<<<<<<<<<< * CHKERR( KSPGetSolution(self.ksp, &vec.vec) ) * CHKERR( PetscINCREF(vec.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 1844, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/KSP.pyx":1845 * """ * cdef Vec vec = Vec() * CHKERR( KSPGetSolution(self.ksp, &vec.vec) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(vec.obj) ) * return vec */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPGetSolution(__pyx_v_self->ksp, (&__pyx_v_vec->vec))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 1845, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":1846 * cdef Vec vec = Vec() * CHKERR( KSPGetSolution(self.ksp, &vec.vec) ) * CHKERR( PetscINCREF(vec.obj) ) # <<<<<<<<<<<<<< * return vec * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_vec->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 1846, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":1847 * CHKERR( KSPGetSolution(self.ksp, &vec.vec) ) * CHKERR( PetscINCREF(vec.obj) ) * return vec # <<<<<<<<<<<<<< * * def getWorkVecs( */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_vec); __pyx_r = ((PyObject *)__pyx_v_vec); goto __pyx_L0; /* "petsc4py/PETSc/KSP.pyx":1833 * return vec * * def getSolution(self) -> Vec: # <<<<<<<<<<<<<< * """Return the solution for the linear system to be solved. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.KSP.getSolution", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_vec); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":1849 * return vec * * def getWorkVecs( # <<<<<<<<<<<<<< * self, * right: int | None = None, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_133getWorkVecs(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_132getWorkVecs, "KSP.getWorkVecs(self, right: int | None = None, left: int | None = None) -> tuple[list[Vec], list[Vec]] | list[Vec] | None\nCreate working vectors.\n\n Parameters\n ----------\n right\n Number of right hand vectors to allocate.\n left\n Number of left hand vectors to allocate.\n\n Returns\n -------\n R : list of Vec\n List of correctly allocated right hand vectors.\n L : list of Vec\n List of correctly allocated left hand vectors.\n\n \nSource code at petsc4py/PETSc/KSP.pyx:1849"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_133getWorkVecs(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_right = 0; PyObject *__pyx_v_left = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getWorkVecs (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_right,&__pyx_n_s_left,0}; /* "petsc4py/PETSc/KSP.pyx":1851 * def getWorkVecs( * self, * right: int | None = None, # <<<<<<<<<<<<<< * left: int | None = None * ) -> tuple[list[Vec], list[Vec]] | list[Vec] | None: */ values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/KSP.pyx":1852 * self, * right: int | None = None, * left: int | None = None # <<<<<<<<<<<<<< * ) -> tuple[list[Vec], list[Vec]] | list[Vec] | None: * """Create working vectors. */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_right); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 1849, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_left); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 1849, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getWorkVecs") < 0)) __PYX_ERR(49, 1849, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_right = values[0]; __pyx_v_left = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getWorkVecs", 0, 0, 2, __pyx_nargs); __PYX_ERR(49, 1849, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.KSP.getWorkVecs", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_132getWorkVecs(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_right, __pyx_v_left); /* "petsc4py/PETSc/KSP.pyx":1849 * return vec * * def getWorkVecs( # <<<<<<<<<<<<<< * self, * right: int | None = None, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_132getWorkVecs(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_right, PyObject *__pyx_v_left) { int __pyx_v_R; int __pyx_v_L; PetscInt __pyx_v_i; PetscInt __pyx_v_nr; PetscInt __pyx_v_nl; Vec *__pyx_v_vr; Vec *__pyx_v_vl; PyObject *__pyx_v_vecsr = 0; PyObject *__pyx_v_vecsl = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscInt __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PetscErrorCode __pyx_t_5; int __pyx_t_6; int __pyx_t_7; int __pyx_t_8; int __pyx_t_9; char const *__pyx_t_10; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getWorkVecs", 1); /* "petsc4py/PETSc/KSP.pyx":1871 * * """ * cdef bint R = right is not None # <<<<<<<<<<<<<< * cdef bint L = left is not None * cdef PetscInt i=0, nr=0, nl=0 */ __pyx_t_1 = (__pyx_v_right != Py_None); __pyx_v_R = __pyx_t_1; /* "petsc4py/PETSc/KSP.pyx":1872 * """ * cdef bint R = right is not None * cdef bint L = left is not None # <<<<<<<<<<<<<< * cdef PetscInt i=0, nr=0, nl=0 * cdef PetscVec *vr=NULL, *vl=NULL */ __pyx_t_1 = (__pyx_v_left != Py_None); __pyx_v_L = __pyx_t_1; /* "petsc4py/PETSc/KSP.pyx":1873 * cdef bint R = right is not None * cdef bint L = left is not None * cdef PetscInt i=0, nr=0, nl=0 # <<<<<<<<<<<<<< * cdef PetscVec *vr=NULL, *vl=NULL * if R: nr = asInt(right) */ __pyx_v_i = 0; __pyx_v_nr = 0; __pyx_v_nl = 0; /* "petsc4py/PETSc/KSP.pyx":1874 * cdef bint L = left is not None * cdef PetscInt i=0, nr=0, nl=0 * cdef PetscVec *vr=NULL, *vl=NULL # <<<<<<<<<<<<<< * if R: nr = asInt(right) * if L: nl = asInt(left) */ __pyx_v_vr = NULL; __pyx_v_vl = NULL; /* "petsc4py/PETSc/KSP.pyx":1875 * cdef PetscInt i=0, nr=0, nl=0 * cdef PetscVec *vr=NULL, *vl=NULL * if R: nr = asInt(right) # <<<<<<<<<<<<<< * if L: nl = asInt(left) * cdef object vecsr = [] if R else None */ if (__pyx_v_R) { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_right); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(49, 1875, __pyx_L1_error) __pyx_v_nr = __pyx_t_2; } /* "petsc4py/PETSc/KSP.pyx":1876 * cdef PetscVec *vr=NULL, *vl=NULL * if R: nr = asInt(right) * if L: nl = asInt(left) # <<<<<<<<<<<<<< * cdef object vecsr = [] if R else None * cdef object vecsl = [] if L else None */ if (__pyx_v_L) { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_left); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(49, 1876, __pyx_L1_error) __pyx_v_nl = __pyx_t_2; } /* "petsc4py/PETSc/KSP.pyx":1877 * if R: nr = asInt(right) * if L: nl = asInt(left) * cdef object vecsr = [] if R else None # <<<<<<<<<<<<<< * cdef object vecsl = [] if L else None * CHKERR( KSPCreateVecs(self.ksp, nr, &vr, nl, &vr) ) */ if (__pyx_v_R) { __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 1877, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __pyx_t_4 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_3 = Py_None; } __pyx_v_vecsr = __pyx_t_3; __pyx_t_3 = 0; /* "petsc4py/PETSc/KSP.pyx":1878 * if L: nl = asInt(left) * cdef object vecsr = [] if R else None * cdef object vecsl = [] if L else None # <<<<<<<<<<<<<< * CHKERR( KSPCreateVecs(self.ksp, nr, &vr, nl, &vr) ) * try: */ if (__pyx_v_L) { __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 1878, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __pyx_t_4 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_3 = Py_None; } __pyx_v_vecsl = __pyx_t_3; __pyx_t_3 = 0; /* "petsc4py/PETSc/KSP.pyx":1879 * cdef object vecsr = [] if R else None * cdef object vecsl = [] if L else None * CHKERR( KSPCreateVecs(self.ksp, nr, &vr, nl, &vr) ) # <<<<<<<<<<<<<< * try: * for i from 0 <= i < nr: */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPCreateVecs(__pyx_v_self->ksp, __pyx_v_nr, (&__pyx_v_vr), __pyx_v_nl, (&__pyx_v_vr))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 1879, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":1880 * cdef object vecsl = [] if L else None * CHKERR( KSPCreateVecs(self.ksp, nr, &vr, nl, &vr) ) * try: # <<<<<<<<<<<<<< * for i from 0 <= i < nr: * vecsr.append(ref_Vec(vr[i])) */ /*try:*/ { /* "petsc4py/PETSc/KSP.pyx":1881 * CHKERR( KSPCreateVecs(self.ksp, nr, &vr, nl, &vr) ) * try: * for i from 0 <= i < nr: # <<<<<<<<<<<<<< * vecsr.append(ref_Vec(vr[i])) * for i from 0 <= i < nl: */ __pyx_t_2 = __pyx_v_nr; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { /* "petsc4py/PETSc/KSP.pyx":1882 * try: * for i from 0 <= i < nr: * vecsr.append(ref_Vec(vr[i])) # <<<<<<<<<<<<<< * for i from 0 <= i < nl: * vecsl.append(ref_Vec(vl[i])) */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec((__pyx_v_vr[__pyx_v_i]))); if (unlikely(!__pyx_t_3)) __PYX_ERR(49, 1882, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyObject_Append(__pyx_v_vecsr, __pyx_t_3); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(49, 1882, __pyx_L6_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } /* "petsc4py/PETSc/KSP.pyx":1883 * for i from 0 <= i < nr: * vecsr.append(ref_Vec(vr[i])) * for i from 0 <= i < nl: # <<<<<<<<<<<<<< * vecsl.append(ref_Vec(vl[i])) * finally: */ __pyx_t_2 = __pyx_v_nl; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { /* "petsc4py/PETSc/KSP.pyx":1884 * vecsr.append(ref_Vec(vr[i])) * for i from 0 <= i < nl: * vecsl.append(ref_Vec(vl[i])) # <<<<<<<<<<<<<< * finally: * if nr > 0 and vr != NULL: */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec((__pyx_v_vl[__pyx_v_i]))); if (unlikely(!__pyx_t_3)) __PYX_ERR(49, 1884, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyObject_Append(__pyx_v_vecsl, __pyx_t_3); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(49, 1884, __pyx_L6_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } } /* "petsc4py/PETSc/KSP.pyx":1886 * vecsl.append(ref_Vec(vl[i])) * finally: * if nr > 0 and vr != NULL: # <<<<<<<<<<<<<< * VecDestroyVecs(nr, &vr) # XXX errors? * if nl > 0 and vl !=NULL: */ /*finally:*/ { /*normal exit:*/{ __pyx_t_7 = (__pyx_v_nr > 0); if (__pyx_t_7) { } else { __pyx_t_1 = __pyx_t_7; goto __pyx_L13_bool_binop_done; } __pyx_t_7 = (__pyx_v_vr != NULL); __pyx_t_1 = __pyx_t_7; __pyx_L13_bool_binop_done:; if (__pyx_t_1) { /* "petsc4py/PETSc/KSP.pyx":1887 * finally: * if nr > 0 and vr != NULL: * VecDestroyVecs(nr, &vr) # XXX errors? # <<<<<<<<<<<<<< * if nl > 0 and vl !=NULL: * VecDestroyVecs(nl, &vl) # XXX errors? */ (void)(VecDestroyVecs(__pyx_v_nr, (&__pyx_v_vr))); /* "petsc4py/PETSc/KSP.pyx":1886 * vecsl.append(ref_Vec(vl[i])) * finally: * if nr > 0 and vr != NULL: # <<<<<<<<<<<<<< * VecDestroyVecs(nr, &vr) # XXX errors? * if nl > 0 and vl !=NULL: */ } /* "petsc4py/PETSc/KSP.pyx":1888 * if nr > 0 and vr != NULL: * VecDestroyVecs(nr, &vr) # XXX errors? * if nl > 0 and vl !=NULL: # <<<<<<<<<<<<<< * VecDestroyVecs(nl, &vl) # XXX errors? * # */ __pyx_t_7 = (__pyx_v_nl > 0); if (__pyx_t_7) { } else { __pyx_t_1 = __pyx_t_7; goto __pyx_L16_bool_binop_done; } __pyx_t_7 = (__pyx_v_vl != NULL); __pyx_t_1 = __pyx_t_7; __pyx_L16_bool_binop_done:; if (__pyx_t_1) { /* "petsc4py/PETSc/KSP.pyx":1889 * VecDestroyVecs(nr, &vr) # XXX errors? * if nl > 0 and vl !=NULL: * VecDestroyVecs(nl, &vl) # XXX errors? # <<<<<<<<<<<<<< * # * if R and L: return (vecsr, vecsl) */ (void)(VecDestroyVecs(__pyx_v_nl, (&__pyx_v_vl))); /* "petsc4py/PETSc/KSP.pyx":1888 * if nr > 0 and vr != NULL: * VecDestroyVecs(nr, &vr) # XXX errors? * if nl > 0 and vl !=NULL: # <<<<<<<<<<<<<< * VecDestroyVecs(nl, &vl) # XXX errors? * # */ } goto __pyx_L7; } __pyx_L6_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13) < 0)) __Pyx_ErrFetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_16); __pyx_t_8 = __pyx_lineno; __pyx_t_9 = __pyx_clineno; __pyx_t_10 = __pyx_filename; { /* "petsc4py/PETSc/KSP.pyx":1886 * vecsl.append(ref_Vec(vl[i])) * finally: * if nr > 0 and vr != NULL: # <<<<<<<<<<<<<< * VecDestroyVecs(nr, &vr) # XXX errors? * if nl > 0 and vl !=NULL: */ __pyx_t_7 = (__pyx_v_nr > 0); if (__pyx_t_7) { } else { __pyx_t_1 = __pyx_t_7; goto __pyx_L21_bool_binop_done; } __pyx_t_7 = (__pyx_v_vr != NULL); __pyx_t_1 = __pyx_t_7; __pyx_L21_bool_binop_done:; if (__pyx_t_1) { /* "petsc4py/PETSc/KSP.pyx":1887 * finally: * if nr > 0 and vr != NULL: * VecDestroyVecs(nr, &vr) # XXX errors? # <<<<<<<<<<<<<< * if nl > 0 and vl !=NULL: * VecDestroyVecs(nl, &vl) # XXX errors? */ (void)(VecDestroyVecs(__pyx_v_nr, (&__pyx_v_vr))); /* "petsc4py/PETSc/KSP.pyx":1886 * vecsl.append(ref_Vec(vl[i])) * finally: * if nr > 0 and vr != NULL: # <<<<<<<<<<<<<< * VecDestroyVecs(nr, &vr) # XXX errors? * if nl > 0 and vl !=NULL: */ } /* "petsc4py/PETSc/KSP.pyx":1888 * if nr > 0 and vr != NULL: * VecDestroyVecs(nr, &vr) # XXX errors? * if nl > 0 and vl !=NULL: # <<<<<<<<<<<<<< * VecDestroyVecs(nl, &vl) # XXX errors? * # */ __pyx_t_7 = (__pyx_v_nl > 0); if (__pyx_t_7) { } else { __pyx_t_1 = __pyx_t_7; goto __pyx_L24_bool_binop_done; } __pyx_t_7 = (__pyx_v_vl != NULL); __pyx_t_1 = __pyx_t_7; __pyx_L24_bool_binop_done:; if (__pyx_t_1) { /* "petsc4py/PETSc/KSP.pyx":1889 * VecDestroyVecs(nr, &vr) # XXX errors? * if nl > 0 and vl !=NULL: * VecDestroyVecs(nl, &vl) # XXX errors? # <<<<<<<<<<<<<< * # * if R and L: return (vecsr, vecsl) */ (void)(VecDestroyVecs(__pyx_v_nl, (&__pyx_v_vl))); /* "petsc4py/PETSc/KSP.pyx":1888 * if nr > 0 and vr != NULL: * VecDestroyVecs(nr, &vr) # XXX errors? * if nl > 0 and vl !=NULL: # <<<<<<<<<<<<<< * VecDestroyVecs(nl, &vl) # XXX errors? * # */ } } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16); } __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ErrRestore(__pyx_t_11, __pyx_t_12, __pyx_t_13); __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_9; __pyx_filename = __pyx_t_10; goto __pyx_L1_error; } __pyx_L7:; } /* "petsc4py/PETSc/KSP.pyx":1891 * VecDestroyVecs(nl, &vl) # XXX errors? * # * if R and L: return (vecsr, vecsl) # <<<<<<<<<<<<<< * elif R: return vecsr * elif L: return vecsl */ if (__pyx_v_R) { } else { __pyx_t_1 = __pyx_v_R; goto __pyx_L27_bool_binop_done; } __pyx_t_1 = __pyx_v_L; __pyx_L27_bool_binop_done:; if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(49, 1891, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_vecsr); __Pyx_GIVEREF(__pyx_v_vecsr); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_vecsr)) __PYX_ERR(49, 1891, __pyx_L1_error); __Pyx_INCREF(__pyx_v_vecsl); __Pyx_GIVEREF(__pyx_v_vecsl); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_vecsl)) __PYX_ERR(49, 1891, __pyx_L1_error); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } /* "petsc4py/PETSc/KSP.pyx":1892 * # * if R and L: return (vecsr, vecsl) * elif R: return vecsr # <<<<<<<<<<<<<< * elif L: return vecsl * else: return None */ if (__pyx_v_R) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_vecsr); __pyx_r = __pyx_v_vecsr; goto __pyx_L0; } /* "petsc4py/PETSc/KSP.pyx":1893 * if R and L: return (vecsr, vecsl) * elif R: return vecsr * elif L: return vecsl # <<<<<<<<<<<<<< * else: return None * */ if (__pyx_v_L) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_vecsl); __pyx_r = __pyx_v_vecsl; goto __pyx_L0; } /* "petsc4py/PETSc/KSP.pyx":1894 * elif R: return vecsr * elif L: return vecsl * else: return None # <<<<<<<<<<<<<< * * def buildSolution(self, Vec x=None) -> Vec: */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } /* "petsc4py/PETSc/KSP.pyx":1849 * return vec * * def getWorkVecs( # <<<<<<<<<<<<<< * self, * right: int | None = None, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.KSP.getWorkVecs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_vecsr); __Pyx_XDECREF(__pyx_v_vecsl); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":1896 * else: return None * * def buildSolution(self, Vec x=None) -> Vec: # <<<<<<<<<<<<<< * """Return the solution vector. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_135buildSolution(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_134buildSolution, "KSP.buildSolution(self, x: Vec | None = None) -> Vec\nReturn the solution vector.\n\n Parameters\n ----------\n x\n Optional vector to store the solution.\n\n See Also\n --------\n buildResidual, petsc.KSPBuildSolution\n\n \nSource code at petsc4py/PETSc/KSP.pyx:1896"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_135buildSolution(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_x = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("buildSolution (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscVecObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 1896, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "buildSolution") < 0)) __PYX_ERR(49, 1896, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_x = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("buildSolution", 0, 0, 1, __pyx_nargs); __PYX_ERR(49, 1896, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.KSP.buildSolution", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "x", 0))) __PYX_ERR(49, 1896, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_134buildSolution(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_x); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_134buildSolution(struct PyPetscKSPObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("buildSolution", 0); __Pyx_INCREF((PyObject *)__pyx_v_x); /* "petsc4py/PETSc/KSP.pyx":1909 * * """ * if x is None: x = Vec() # <<<<<<<<<<<<<< * if x.vec == NULL: * CHKERR( KSPGetSolution(self.ksp, &x.vec) ) */ __pyx_t_1 = (((PyObject *)__pyx_v_x) == Py_None); if (__pyx_t_1) { __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 1909, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_x, ((struct PyPetscVecObject *)__pyx_t_2)); __pyx_t_2 = 0; } /* "petsc4py/PETSc/KSP.pyx":1910 * """ * if x is None: x = Vec() * if x.vec == NULL: # <<<<<<<<<<<<<< * CHKERR( KSPGetSolution(self.ksp, &x.vec) ) * CHKERR( VecDuplicate(x.vec, &x.vec) ) */ __pyx_t_1 = (__pyx_v_x->vec == NULL); if (__pyx_t_1) { /* "petsc4py/PETSc/KSP.pyx":1911 * if x is None: x = Vec() * if x.vec == NULL: * CHKERR( KSPGetSolution(self.ksp, &x.vec) ) # <<<<<<<<<<<<<< * CHKERR( VecDuplicate(x.vec, &x.vec) ) * CHKERR( KSPBuildSolution(self.ksp, x.vec, NULL) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPGetSolution(__pyx_v_self->ksp, (&__pyx_v_x->vec))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 1911, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":1912 * if x.vec == NULL: * CHKERR( KSPGetSolution(self.ksp, &x.vec) ) * CHKERR( VecDuplicate(x.vec, &x.vec) ) # <<<<<<<<<<<<<< * CHKERR( KSPBuildSolution(self.ksp, x.vec, NULL) ) * return x */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecDuplicate(__pyx_v_x->vec, (&__pyx_v_x->vec))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 1912, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":1910 * """ * if x is None: x = Vec() * if x.vec == NULL: # <<<<<<<<<<<<<< * CHKERR( KSPGetSolution(self.ksp, &x.vec) ) * CHKERR( VecDuplicate(x.vec, &x.vec) ) */ } /* "petsc4py/PETSc/KSP.pyx":1913 * CHKERR( KSPGetSolution(self.ksp, &x.vec) ) * CHKERR( VecDuplicate(x.vec, &x.vec) ) * CHKERR( KSPBuildSolution(self.ksp, x.vec, NULL) ) # <<<<<<<<<<<<<< * return x * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPBuildSolution(__pyx_v_self->ksp, __pyx_v_x->vec, NULL)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 1913, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":1914 * CHKERR( VecDuplicate(x.vec, &x.vec) ) * CHKERR( KSPBuildSolution(self.ksp, x.vec, NULL) ) * return x # <<<<<<<<<<<<<< * * def buildResidual(self, Vec r=None) -> Vec: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_x); __pyx_r = ((PyObject *)__pyx_v_x); goto __pyx_L0; /* "petsc4py/PETSc/KSP.pyx":1896 * else: return None * * def buildSolution(self, Vec x=None) -> Vec: # <<<<<<<<<<<<<< * """Return the solution vector. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.KSP.buildSolution", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_x); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":1916 * return x * * def buildResidual(self, Vec r=None) -> Vec: # <<<<<<<<<<<<<< * """Return the residual of the linear system. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_137buildResidual(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_136buildResidual, "KSP.buildResidual(self, r: Vec | None = None) -> Vec\nReturn the residual of the linear system.\n\n Parameters\n ----------\n r\n Optional vector to use for the result.\n\n See Also\n --------\n buildSolution, petsc.KSPBuildResidual\n\n \nSource code at petsc4py/PETSc/KSP.pyx:1916"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_137buildResidual(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_r = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("buildResidual (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_r,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscVecObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_r); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 1916, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "buildResidual") < 0)) __PYX_ERR(49, 1916, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_r = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("buildResidual", 0, 0, 1, __pyx_nargs); __PYX_ERR(49, 1916, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.KSP.buildResidual", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_r), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "r", 0))) __PYX_ERR(49, 1916, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_136buildResidual(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_r); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_136buildResidual(struct PyPetscKSPObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_r) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("buildResidual", 0); __Pyx_INCREF((PyObject *)__pyx_v_r); /* "petsc4py/PETSc/KSP.pyx":1929 * * """ * if r is None: r = Vec() # <<<<<<<<<<<<<< * if r.vec == NULL: * CHKERR( KSPGetRhs(self.ksp, &r.vec) ) */ __pyx_t_1 = (((PyObject *)__pyx_v_r) == Py_None); if (__pyx_t_1) { __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 1929, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_r, ((struct PyPetscVecObject *)__pyx_t_2)); __pyx_t_2 = 0; } /* "petsc4py/PETSc/KSP.pyx":1930 * """ * if r is None: r = Vec() * if r.vec == NULL: # <<<<<<<<<<<<<< * CHKERR( KSPGetRhs(self.ksp, &r.vec) ) * CHKERR( VecDuplicate(r.vec, &r.vec) ) */ __pyx_t_1 = (__pyx_v_r->vec == NULL); if (__pyx_t_1) { /* "petsc4py/PETSc/KSP.pyx":1931 * if r is None: r = Vec() * if r.vec == NULL: * CHKERR( KSPGetRhs(self.ksp, &r.vec) ) # <<<<<<<<<<<<<< * CHKERR( VecDuplicate(r.vec, &r.vec) ) * CHKERR( KSPBuildResidual(self.ksp , NULL, r.vec, &r.vec) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPGetRhs(__pyx_v_self->ksp, (&__pyx_v_r->vec))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 1931, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":1932 * if r.vec == NULL: * CHKERR( KSPGetRhs(self.ksp, &r.vec) ) * CHKERR( VecDuplicate(r.vec, &r.vec) ) # <<<<<<<<<<<<<< * CHKERR( KSPBuildResidual(self.ksp , NULL, r.vec, &r.vec) ) * return r */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecDuplicate(__pyx_v_r->vec, (&__pyx_v_r->vec))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 1932, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":1930 * """ * if r is None: r = Vec() * if r.vec == NULL: # <<<<<<<<<<<<<< * CHKERR( KSPGetRhs(self.ksp, &r.vec) ) * CHKERR( VecDuplicate(r.vec, &r.vec) ) */ } /* "petsc4py/PETSc/KSP.pyx":1933 * CHKERR( KSPGetRhs(self.ksp, &r.vec) ) * CHKERR( VecDuplicate(r.vec, &r.vec) ) * CHKERR( KSPBuildResidual(self.ksp , NULL, r.vec, &r.vec) ) # <<<<<<<<<<<<<< * return r * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPBuildResidual(__pyx_v_self->ksp, NULL, __pyx_v_r->vec, (&__pyx_v_r->vec))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 1933, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":1934 * CHKERR( VecDuplicate(r.vec, &r.vec) ) * CHKERR( KSPBuildResidual(self.ksp , NULL, r.vec, &r.vec) ) * return r # <<<<<<<<<<<<<< * * def computeEigenvalues(self) -> ArrayComplex: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_r); __pyx_r = ((PyObject *)__pyx_v_r); goto __pyx_L0; /* "petsc4py/PETSc/KSP.pyx":1916 * return x * * def buildResidual(self, Vec r=None) -> Vec: # <<<<<<<<<<<<<< * """Return the residual of the linear system. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.KSP.buildResidual", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_r); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":1936 * return r * * def computeEigenvalues(self) -> ArrayComplex: # <<<<<<<<<<<<<< * """Compute the extreme eigenvalues for the preconditioned operator. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_139computeEigenvalues(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_138computeEigenvalues, "KSP.computeEigenvalues(self) -> ArrayComplex\nCompute the extreme eigenvalues for the preconditioned operator.\n\n See Also\n --------\n petsc.KSPComputeEigenvalues\n\n \nSource code at petsc4py/PETSc/KSP.pyx:1936"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_139computeEigenvalues(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("computeEigenvalues (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("computeEigenvalues", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "computeEigenvalues", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_138computeEigenvalues(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_138computeEigenvalues(struct PyPetscKSPObject *__pyx_v_self) { PetscInt __pyx_v_its; PetscInt __pyx_v_neig; PetscReal *__pyx_v_rdata; PetscReal *__pyx_v_idata; PyArrayObject *__pyx_v_r = 0; PyArrayObject *__pyx_v_i = 0; PyArrayObject *__pyx_v_eigen = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("computeEigenvalues", 1); /* "petsc4py/PETSc/KSP.pyx":1944 * * """ * cdef PetscInt its = 0 # <<<<<<<<<<<<<< * cdef PetscInt neig = 0 * cdef PetscReal *rdata = NULL */ __pyx_v_its = 0; /* "petsc4py/PETSc/KSP.pyx":1945 * """ * cdef PetscInt its = 0 * cdef PetscInt neig = 0 # <<<<<<<<<<<<<< * cdef PetscReal *rdata = NULL * cdef PetscReal *idata = NULL */ __pyx_v_neig = 0; /* "petsc4py/PETSc/KSP.pyx":1946 * cdef PetscInt its = 0 * cdef PetscInt neig = 0 * cdef PetscReal *rdata = NULL # <<<<<<<<<<<<<< * cdef PetscReal *idata = NULL * CHKERR( KSPGetIterationNumber(self.ksp, &its) ) */ __pyx_v_rdata = NULL; /* "petsc4py/PETSc/KSP.pyx":1947 * cdef PetscInt neig = 0 * cdef PetscReal *rdata = NULL * cdef PetscReal *idata = NULL # <<<<<<<<<<<<<< * CHKERR( KSPGetIterationNumber(self.ksp, &its) ) * cdef ndarray r = oarray_r(empty_r(its), NULL, &rdata) */ __pyx_v_idata = NULL; /* "petsc4py/PETSc/KSP.pyx":1948 * cdef PetscReal *rdata = NULL * cdef PetscReal *idata = NULL * CHKERR( KSPGetIterationNumber(self.ksp, &its) ) # <<<<<<<<<<<<<< * cdef ndarray r = oarray_r(empty_r(its), NULL, &rdata) * cdef ndarray i = oarray_r(empty_r(its), NULL, &idata) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPGetIterationNumber(__pyx_v_self->ksp, (&__pyx_v_its))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 1948, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":1949 * cdef PetscReal *idata = NULL * CHKERR( KSPGetIterationNumber(self.ksp, &its) ) * cdef ndarray r = oarray_r(empty_r(its), NULL, &rdata) # <<<<<<<<<<<<<< * cdef ndarray i = oarray_r(empty_r(its), NULL, &idata) * CHKERR( KSPComputeEigenvalues(self.ksp, its, rdata, idata, &neig) ) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_r(__pyx_v_its)); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 1949, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_r(__pyx_t_2, NULL, (&__pyx_v_rdata))); if (unlikely(!__pyx_t_3)) __PYX_ERR(49, 1949, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_r = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/KSP.pyx":1950 * CHKERR( KSPGetIterationNumber(self.ksp, &its) ) * cdef ndarray r = oarray_r(empty_r(its), NULL, &rdata) * cdef ndarray i = oarray_r(empty_r(its), NULL, &idata) # <<<<<<<<<<<<<< * CHKERR( KSPComputeEigenvalues(self.ksp, its, rdata, idata, &neig) ) * eigen = empty_c(neig) */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_r(__pyx_v_its)); if (unlikely(!__pyx_t_3)) __PYX_ERR(49, 1950, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_r(__pyx_t_3, NULL, (&__pyx_v_idata))); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 1950, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_i = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/KSP.pyx":1951 * cdef ndarray r = oarray_r(empty_r(its), NULL, &rdata) * cdef ndarray i = oarray_r(empty_r(its), NULL, &idata) * CHKERR( KSPComputeEigenvalues(self.ksp, its, rdata, idata, &neig) ) # <<<<<<<<<<<<<< * eigen = empty_c(neig) * eigen.real = r[:neig] */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPComputeEigenvalues(__pyx_v_self->ksp, __pyx_v_its, __pyx_v_rdata, __pyx_v_idata, (&__pyx_v_neig))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 1951, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":1952 * cdef ndarray i = oarray_r(empty_r(its), NULL, &idata) * CHKERR( KSPComputeEigenvalues(self.ksp, its, rdata, idata, &neig) ) * eigen = empty_c(neig) # <<<<<<<<<<<<<< * eigen.real = r[:neig] * eigen.imag = i[:neig] */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_c(__pyx_v_neig)); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 1952, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_eigen = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/KSP.pyx":1953 * CHKERR( KSPComputeEigenvalues(self.ksp, its, rdata, idata, &neig) ) * eigen = empty_c(neig) * eigen.real = r[:neig] # <<<<<<<<<<<<<< * eigen.imag = i[:neig] * return eigen */ __pyx_t_2 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_r), 0, __pyx_v_neig, NULL, NULL, NULL, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 1953, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_eigen), __pyx_n_s_real, __pyx_t_2) < 0) __PYX_ERR(49, 1953, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/KSP.pyx":1954 * eigen = empty_c(neig) * eigen.real = r[:neig] * eigen.imag = i[:neig] # <<<<<<<<<<<<<< * return eigen * */ __pyx_t_2 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_i), 0, __pyx_v_neig, NULL, NULL, NULL, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 1954, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_eigen), __pyx_n_s_imag, __pyx_t_2) < 0) __PYX_ERR(49, 1954, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/KSP.pyx":1955 * eigen.real = r[:neig] * eigen.imag = i[:neig] * return eigen # <<<<<<<<<<<<<< * * def computeExtremeSingularValues(self) -> tuple[float, float]: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_eigen); __pyx_r = ((PyObject *)__pyx_v_eigen); goto __pyx_L0; /* "petsc4py/PETSc/KSP.pyx":1936 * return r * * def computeEigenvalues(self) -> ArrayComplex: # <<<<<<<<<<<<<< * """Compute the extreme eigenvalues for the preconditioned operator. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.computeEigenvalues", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_r); __Pyx_XDECREF((PyObject *)__pyx_v_i); __Pyx_XDECREF((PyObject *)__pyx_v_eigen); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":1957 * return eigen * * def computeExtremeSingularValues(self) -> tuple[float, float]: # <<<<<<<<<<<<<< * """Compute the extreme singular values for the preconditioned operator. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_141computeExtremeSingularValues(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_140computeExtremeSingularValues, "KSP.computeExtremeSingularValues(self) -> tuple[float, float]\nCompute the extreme singular values for the preconditioned operator.\n\n Returns\n -------\n smax : float\n The maximum singular value.\n smin : float\n The minimum singular value.\n\n See Also\n --------\n petsc.KSPComputeExtremeSingularValues\n\n \nSource code at petsc4py/PETSc/KSP.pyx:1957"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_141computeExtremeSingularValues(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("computeExtremeSingularValues (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("computeExtremeSingularValues", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "computeExtremeSingularValues", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_140computeExtremeSingularValues(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_140computeExtremeSingularValues(struct PyPetscKSPObject *__pyx_v_self) { PetscReal __pyx_v_smax; PetscReal __pyx_v_smin; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("computeExtremeSingularValues", 1); /* "petsc4py/PETSc/KSP.pyx":1972 * * """ * cdef PetscReal smax = 0 # <<<<<<<<<<<<<< * cdef PetscReal smin = 0 * CHKERR( KSPComputeExtremeSingularValues(self.ksp, &smax, &smin) ) */ __pyx_v_smax = 0.0; /* "petsc4py/PETSc/KSP.pyx":1973 * """ * cdef PetscReal smax = 0 * cdef PetscReal smin = 0 # <<<<<<<<<<<<<< * CHKERR( KSPComputeExtremeSingularValues(self.ksp, &smax, &smin) ) * return toReal(smax), toReal(smin) */ __pyx_v_smin = 0.0; /* "petsc4py/PETSc/KSP.pyx":1974 * cdef PetscReal smax = 0 * cdef PetscReal smin = 0 * CHKERR( KSPComputeExtremeSingularValues(self.ksp, &smax, &smin) ) # <<<<<<<<<<<<<< * return toReal(smax), toReal(smin) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPComputeExtremeSingularValues(__pyx_v_self->ksp, (&__pyx_v_smax), (&__pyx_v_smin))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 1974, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":1975 * cdef PetscReal smin = 0 * CHKERR( KSPComputeExtremeSingularValues(self.ksp, &smax, &smin) ) * return toReal(smax), toReal(smin) # <<<<<<<<<<<<<< * * # --- GMRES --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_smax); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 1975, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_smin); if (unlikely(!__pyx_t_3)) __PYX_ERR(49, 1975, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 1975, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(49, 1975, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(49, 1975, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "petsc4py/PETSc/KSP.pyx":1957 * return eigen * * def computeExtremeSingularValues(self) -> tuple[float, float]: # <<<<<<<<<<<<<< * """Compute the extreme singular values for the preconditioned operator. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.KSP.computeExtremeSingularValues", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":1979 * # --- GMRES --- * * def setGMRESRestart(self, restart: int) -> None: # <<<<<<<<<<<<<< * """Set number of iterations at which KSP restarts. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_143setGMRESRestart(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_142setGMRESRestart, "KSP.setGMRESRestart(self, restart: int) -> None\nSet number of iterations at which KSP restarts.\n\n Suitable KSPs are: KSPGMRES, KSPFGMRES and KSPLGMRES.\n\n Parameters\n ----------\n restart\n Integer restart value.\n\n See Also\n --------\n petsc.KSPGMRESSetRestart\n\n \nSource code at petsc4py/PETSc/KSP.pyx:1979"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_143setGMRESRestart(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_restart = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setGMRESRestart (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_restart,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_restart)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 1979, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setGMRESRestart") < 0)) __PYX_ERR(49, 1979, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_restart = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setGMRESRestart", 1, 1, 1, __pyx_nargs); __PYX_ERR(49, 1979, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.KSP.setGMRESRestart", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_142setGMRESRestart(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_restart); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_142setGMRESRestart(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_restart) { PetscInt __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setGMRESRestart", 1); /* "petsc4py/PETSc/KSP.pyx":1994 * * """ * cdef PetscInt ival = asInt(restart) # <<<<<<<<<<<<<< * CHKERR( KSPGMRESSetRestart(self.ksp, ival) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_restart); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(49, 1994, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "petsc4py/PETSc/KSP.pyx":1995 * """ * cdef PetscInt ival = asInt(restart) * CHKERR( KSPGMRESSetRestart(self.ksp, ival) ) # <<<<<<<<<<<<<< * * # --- Python --- */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPGMRESSetRestart(__pyx_v_self->ksp, __pyx_v_ival)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 1995, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":1979 * # --- GMRES --- * * def setGMRESRestart(self, restart: int) -> None: # <<<<<<<<<<<<<< * """Set number of iterations at which KSP restarts. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.setGMRESRestart", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":1999 * # --- Python --- * * def createPython( # <<<<<<<<<<<<<< * self, * context: Any = None, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_145createPython(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_144createPython, "KSP.createPython(self, context: Any = None, comm: Comm | None = None) -> Self\nCreate a linear solver of Python type.\n\n Collective.\n\n Parameters\n ----------\n context\n An instance of the Python class implementing the required\n methods.\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n petsc_python_ksp, setType, setPythonContext, Type.PYTHON\n\n \nSource code at petsc4py/PETSc/KSP.pyx:1999"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_145createPython(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_context = 0; PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createPython (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_context,&__pyx_n_s_comm,0}; /* "petsc4py/PETSc/KSP.pyx":2001 * def createPython( * self, * context: Any = None, # <<<<<<<<<<<<<< * comm: Comm | None = None * ) -> Self: */ values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/KSP.pyx":2002 * self, * context: Any = None, * comm: Comm | None = None # <<<<<<<<<<<<<< * ) -> Self: * """Create a linear solver of Python type. */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_context); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 1999, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 1999, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createPython") < 0)) __PYX_ERR(49, 1999, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_context = values[0]; __pyx_v_comm = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createPython", 0, 0, 2, __pyx_nargs); __PYX_ERR(49, 1999, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.KSP.createPython", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_144createPython(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_context, __pyx_v_comm); /* "petsc4py/PETSc/KSP.pyx":1999 * # --- Python --- * * def createPython( # <<<<<<<<<<<<<< * self, * context: Any = None, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_144createPython(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; KSP __pyx_v_newksp; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PetscErrorCode __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createPython", 1); /* "petsc4py/PETSc/KSP.pyx":2021 * * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscKSP newksp = NULL * CHKERR( KSPCreate(ccomm, &newksp) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(49, 2021, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/KSP.pyx":2022 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscKSP newksp = NULL # <<<<<<<<<<<<<< * CHKERR( KSPCreate(ccomm, &newksp) ) * CHKERR( PetscCLEAR(self.obj) ); self.ksp = newksp */ __pyx_v_newksp = NULL; /* "petsc4py/PETSc/KSP.pyx":2023 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscKSP newksp = NULL * CHKERR( KSPCreate(ccomm, &newksp) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.ksp = newksp * CHKERR( KSPSetType(self.ksp, KSPPYTHON) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPCreate(__pyx_v_ccomm, (&__pyx_v_newksp))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 2023, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":2024 * cdef PetscKSP newksp = NULL * CHKERR( KSPCreate(ccomm, &newksp) ) * CHKERR( PetscCLEAR(self.obj) ); self.ksp = newksp # <<<<<<<<<<<<<< * CHKERR( KSPSetType(self.ksp, KSPPYTHON) ) * CHKERR( KSPPythonSetContext(self.ksp, context) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 2024, __pyx_L1_error) __pyx_v_self->ksp = __pyx_v_newksp; /* "petsc4py/PETSc/KSP.pyx":2025 * CHKERR( KSPCreate(ccomm, &newksp) ) * CHKERR( PetscCLEAR(self.obj) ); self.ksp = newksp * CHKERR( KSPSetType(self.ksp, KSPPYTHON) ) # <<<<<<<<<<<<<< * CHKERR( KSPPythonSetContext(self.ksp, context) ) * return self */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetType(__pyx_v_self->ksp, KSPPYTHON)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 2025, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":2026 * CHKERR( PetscCLEAR(self.obj) ); self.ksp = newksp * CHKERR( KSPSetType(self.ksp, KSPPYTHON) ) * CHKERR( KSPPythonSetContext(self.ksp, context) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = KSPPythonSetContext(__pyx_v_self->ksp, ((void *)__pyx_v_context)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 2026, __pyx_L1_error) __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_t_2); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 2026, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":2027 * CHKERR( KSPSetType(self.ksp, KSPPYTHON) ) * CHKERR( KSPPythonSetContext(self.ksp, context) ) * return self # <<<<<<<<<<<<<< * * def setPythonContext(self, context: Any | None = None) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/KSP.pyx":1999 * # --- Python --- * * def createPython( # <<<<<<<<<<<<<< * self, * context: Any = None, */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.createPython", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":2029 * return self * * def setPythonContext(self, context: Any | None = None) -> None: # <<<<<<<<<<<<<< * """Set the instance of the class implementing Python methods. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_147setPythonContext(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_146setPythonContext, "KSP.setPythonContext(self, context: Any | None = None) -> None\nSet the instance of the class implementing Python methods.\n\n Not collective.\n\n See Also\n --------\n petsc_python_ksp, getPythonContext\n\n \nSource code at petsc4py/PETSc/KSP.pyx:2029"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_147setPythonContext(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_context = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPythonContext (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_context,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_context); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 2029, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setPythonContext") < 0)) __PYX_ERR(49, 2029, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_context = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPythonContext", 0, 0, 1, __pyx_nargs); __PYX_ERR(49, 2029, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.KSP.setPythonContext", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_146setPythonContext(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_context); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_146setPythonContext(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_context) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPythonContext", 1); /* "petsc4py/PETSc/KSP.pyx":2039 * * """ * CHKERR( KSPPythonSetContext(self.ksp, context) ) # <<<<<<<<<<<<<< * * def getPythonContext(self) -> Any: */ __pyx_t_1 = KSPPythonSetContext(__pyx_v_self->ksp, ((void *)__pyx_v_context)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 2039, __pyx_L1_error) __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_t_1); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 2039, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":2029 * return self * * def setPythonContext(self, context: Any | None = None) -> None: # <<<<<<<<<<<<<< * """Set the instance of the class implementing Python methods. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.setPythonContext", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":2041 * CHKERR( KSPPythonSetContext(self.ksp, context) ) * * def getPythonContext(self) -> Any: # <<<<<<<<<<<<<< * """Return the instance of the class implementing Python methods. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_149getPythonContext(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_148getPythonContext, "KSP.getPythonContext(self) -> Any\nReturn the instance of the class implementing Python methods.\n\n Not collective.\n\n See Also\n --------\n petsc_python_ksp, setPythonContext\n\n \nSource code at petsc4py/PETSc/KSP.pyx:2041"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_149getPythonContext(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getPythonContext (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getPythonContext", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getPythonContext", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_148getPythonContext(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_148getPythonContext(struct PyPetscKSPObject *__pyx_v_self) { void *__pyx_v_context; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getPythonContext", 1); /* "petsc4py/PETSc/KSP.pyx":2051 * * """ * cdef void *context = NULL # <<<<<<<<<<<<<< * CHKERR( KSPPythonGetContext(self.ksp, &context) ) * if context == NULL: return None */ __pyx_v_context = NULL; /* "petsc4py/PETSc/KSP.pyx":2052 * """ * cdef void *context = NULL * CHKERR( KSPPythonGetContext(self.ksp, &context) ) # <<<<<<<<<<<<<< * if context == NULL: return None * else: return context */ __pyx_t_1 = KSPPythonGetContext(__pyx_v_self->ksp, (&__pyx_v_context)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 2052, __pyx_L1_error) __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_t_1); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 2052, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":2053 * cdef void *context = NULL * CHKERR( KSPPythonGetContext(self.ksp, &context) ) * if context == NULL: return None # <<<<<<<<<<<<<< * else: return context * */ __pyx_t_3 = (__pyx_v_context == NULL); if (__pyx_t_3) { __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } /* "petsc4py/PETSc/KSP.pyx":2054 * CHKERR( KSPPythonGetContext(self.ksp, &context) ) * if context == NULL: return None * else: return context # <<<<<<<<<<<<<< * * def setPythonType(self, py_type: str) -> None: */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_context)); __pyx_r = ((PyObject *)__pyx_v_context); goto __pyx_L0; } /* "petsc4py/PETSc/KSP.pyx":2041 * CHKERR( KSPPythonSetContext(self.ksp, context) ) * * def getPythonContext(self) -> Any: # <<<<<<<<<<<<<< * """Return the instance of the class implementing Python methods. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.getPythonContext", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":2056 * else: return context * * def setPythonType(self, py_type: str) -> None: # <<<<<<<<<<<<<< * """Set the fully qualified Python name of the class to be used. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_151setPythonType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_150setPythonType, "KSP.setPythonType(self, py_type: str) -> None\nSet the fully qualified Python name of the class to be used.\n\n Collective.\n\n See Also\n --------\n petsc_python_ksp, setPythonContext, getPythonType\n petsc.KSPPythonSetType\n\n \nSource code at petsc4py/PETSc/KSP.pyx:2056"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_151setPythonType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_py_type = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPythonType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_py_type,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_py_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 2056, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setPythonType") < 0)) __PYX_ERR(49, 2056, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_py_type = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPythonType", 1, 1, 1, __pyx_nargs); __PYX_ERR(49, 2056, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.KSP.setPythonType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_150setPythonType(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_py_type); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_150setPythonType(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_py_type) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPythonType", 0); __Pyx_INCREF(__pyx_v_py_type); /* "petsc4py/PETSc/KSP.pyx":2067 * * """ * cdef const char *cval = NULL # <<<<<<<<<<<<<< * py_type = str2bytes(py_type, &cval) * CHKERR( KSPPythonSetType(self.ksp, cval) ) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/KSP.pyx":2068 * """ * cdef const char *cval = NULL * py_type = str2bytes(py_type, &cval) # <<<<<<<<<<<<<< * CHKERR( KSPPythonSetType(self.ksp, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_py_type, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_py_type, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/KSP.pyx":2069 * cdef const char *cval = NULL * py_type = str2bytes(py_type, &cval) * CHKERR( KSPPythonSetType(self.ksp, cval) ) # <<<<<<<<<<<<<< * * def getPythonType(self) -> str: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPPythonSetType(__pyx_v_self->ksp, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 2069, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":2056 * else: return context * * def setPythonType(self, py_type: str) -> None: # <<<<<<<<<<<<<< * """Set the fully qualified Python name of the class to be used. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.KSP.setPythonType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_py_type); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":2071 * CHKERR( KSPPythonSetType(self.ksp, cval) ) * * def getPythonType(self) -> str: # <<<<<<<<<<<<<< * """Return the fully qualified Python name of the class used by the solver. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_153getPythonType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3KSP_152getPythonType, "KSP.getPythonType(self) -> str\nReturn the fully qualified Python name of the class used by the solver.\n\n Not collective.\n\n See Also\n --------\n petsc_python_ksp, setPythonContext, setPythonType\n petsc.KSPPythonGetType\n\n \nSource code at petsc4py/PETSc/KSP.pyx:2071"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_153getPythonType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getPythonType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getPythonType", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getPythonType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_152getPythonType(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_152getPythonType(struct PyPetscKSPObject *__pyx_v_self) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getPythonType", 1); /* "petsc4py/PETSc/KSP.pyx":2082 * * """ * cdef const char *cval = NULL # <<<<<<<<<<<<<< * CHKERR( KSPPythonGetType(self.ksp, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/KSP.pyx":2083 * """ * cdef const char *cval = NULL * CHKERR( KSPPythonGetType(self.ksp, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPPythonGetType(__pyx_v_self->ksp, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 2083, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":2084 * cdef const char *cval = NULL * CHKERR( KSPPythonGetType(self.ksp, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * # --- application context --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 2084, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/KSP.pyx":2071 * CHKERR( KSPPythonSetType(self.ksp, cval) ) * * def getPythonType(self) -> str: # <<<<<<<<<<<<<< * """Return the fully qualified Python name of the class used by the solver. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.KSP.getPythonType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":2090 * property appctx: * """The solver application context.""" * def __get__(self) -> Any: # <<<<<<<<<<<<<< * return self.getAppCtx() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_6appctx_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_6appctx_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_6appctx___get__(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_6appctx___get__(struct PyPetscKSPObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/KSP.pyx":2091 * """The solver application context.""" * def __get__(self) -> Any: * return self.getAppCtx() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setAppCtx(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getAppCtx); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 2091, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2091, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/KSP.pyx":2090 * property appctx: * """The solver application context.""" * def __get__(self) -> Any: # <<<<<<<<<<<<<< * return self.getAppCtx() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.appctx.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":2092 * def __get__(self) -> Any: * return self.getAppCtx() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setAppCtx(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_3KSP_6appctx_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_3KSP_6appctx_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_6appctx_2__set__(((struct PyPetscKSPObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_3KSP_6appctx_2__set__(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "petsc4py/PETSc/KSP.pyx":2093 * return self.getAppCtx() * def __set__(self, value): * self.setAppCtx(value) # <<<<<<<<<<<<<< * * # --- discretization space --- */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setAppCtx); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 2093, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_value}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2093, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/KSP.pyx":2092 * def __get__(self) -> Any: * return self.getAppCtx() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setAppCtx(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.appctx.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":2099 * property dm: * """The solver `DM`.""" * def __get__(self) -> DM: # <<<<<<<<<<<<<< * return self.getDM() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_2dm_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_2dm_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_2dm___get__(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_2dm___get__(struct PyPetscKSPObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/KSP.pyx":2100 * """The solver `DM`.""" * def __get__(self) -> DM: * return self.getDM() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setDM(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getDM); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 2100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/KSP.pyx":2099 * property dm: * """The solver `DM`.""" * def __get__(self) -> DM: # <<<<<<<<<<<<<< * return self.getDM() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.dm.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":2101 * def __get__(self) -> DM: * return self.getDM() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setDM(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_3KSP_2dm_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_3KSP_2dm_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_2dm_2__set__(((struct PyPetscKSPObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_3KSP_2dm_2__set__(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "petsc4py/PETSc/KSP.pyx":2102 * return self.getDM() * def __set__(self, value): * self.setDM(value) # <<<<<<<<<<<<<< * * # --- vectors --- */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setDM); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 2102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_value}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/KSP.pyx":2101 * def __get__(self) -> DM: * return self.getDM() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setDM(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.dm.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":2108 * property vec_sol: * """The solution vector.""" * def __get__(self) -> Vec: # <<<<<<<<<<<<<< * return self.getSolution() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_7vec_sol_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_7vec_sol_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_7vec_sol___get__(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_7vec_sol___get__(struct PyPetscKSPObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/KSP.pyx":2109 * """The solution vector.""" * def __get__(self) -> Vec: * return self.getSolution() # <<<<<<<<<<<<<< * * property vec_rhs: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getSolution); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 2109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/KSP.pyx":2108 * property vec_sol: * """The solution vector.""" * def __get__(self) -> Vec: # <<<<<<<<<<<<<< * return self.getSolution() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.vec_sol.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":2113 * property vec_rhs: * """The right-hand side vector.""" * def __get__(self) -> Vec: # <<<<<<<<<<<<<< * return self.getRhs() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_7vec_rhs_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_7vec_rhs_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_7vec_rhs___get__(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_7vec_rhs___get__(struct PyPetscKSPObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/KSP.pyx":2114 * """The right-hand side vector.""" * def __get__(self) -> Vec: * return self.getRhs() # <<<<<<<<<<<<<< * * # --- operators --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getRhs); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 2114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/KSP.pyx":2113 * property vec_rhs: * """The right-hand side vector.""" * def __get__(self) -> Vec: # <<<<<<<<<<<<<< * return self.getRhs() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.vec_rhs.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":2120 * property mat_op: * """The system matrix operator.""" * def __get__(self) -> Mat: # <<<<<<<<<<<<<< * return self.getOperators()[0] * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_6mat_op_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_6mat_op_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_6mat_op___get__(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_6mat_op___get__(struct PyPetscKSPObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/KSP.pyx":2121 * """The system matrix operator.""" * def __get__(self) -> Mat: * return self.getOperators()[0] # <<<<<<<<<<<<<< * * property mat_pc: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getOperators); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 2121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 2121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/KSP.pyx":2120 * property mat_op: * """The system matrix operator.""" * def __get__(self) -> Mat: # <<<<<<<<<<<<<< * return self.getOperators()[0] * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.mat_op.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":2125 * property mat_pc: * """The preconditioner operator.""" * def __get__(self) -> Mat: # <<<<<<<<<<<<<< * return self.getOperators()[1] * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_6mat_pc_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_6mat_pc_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_6mat_pc___get__(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_6mat_pc___get__(struct PyPetscKSPObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/KSP.pyx":2126 * """The preconditioner operator.""" * def __get__(self) -> Mat: * return self.getOperators()[1] # <<<<<<<<<<<<<< * * # --- initial guess --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getOperators); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 2126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 2126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/KSP.pyx":2125 * property mat_pc: * """The preconditioner operator.""" * def __get__(self) -> Mat: # <<<<<<<<<<<<<< * return self.getOperators()[1] * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.mat_pc.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":2132 * property guess_nonzero: * """Whether guess is non-zero.""" * def __get__(self) -> bool: # <<<<<<<<<<<<<< * return self.getInitialGuessNonzero() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_13guess_nonzero_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_13guess_nonzero_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_13guess_nonzero___get__(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_13guess_nonzero___get__(struct PyPetscKSPObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/KSP.pyx":2133 * """Whether guess is non-zero.""" * def __get__(self) -> bool: * return self.getInitialGuessNonzero() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setInitialGuessNonzero(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getInitialGuessNonzero); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 2133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/KSP.pyx":2132 * property guess_nonzero: * """Whether guess is non-zero.""" * def __get__(self) -> bool: # <<<<<<<<<<<<<< * return self.getInitialGuessNonzero() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.guess_nonzero.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":2134 * def __get__(self) -> bool: * return self.getInitialGuessNonzero() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setInitialGuessNonzero(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_3KSP_13guess_nonzero_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_3KSP_13guess_nonzero_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_13guess_nonzero_2__set__(((struct PyPetscKSPObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_3KSP_13guess_nonzero_2__set__(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "petsc4py/PETSc/KSP.pyx":2135 * return self.getInitialGuessNonzero() * def __set__(self, value): * self.setInitialGuessNonzero(value) # <<<<<<<<<<<<<< * * property guess_knoll: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setInitialGuessNonzero); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 2135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_value}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/KSP.pyx":2134 * def __get__(self) -> bool: * return self.getInitialGuessNonzero() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setInitialGuessNonzero(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.guess_nonzero.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":2139 * property guess_knoll: * """Whether solver uses Knoll trick.""" * def __get__(self) -> bool: # <<<<<<<<<<<<<< * return self.getInitialGuessKnoll() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_11guess_knoll_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_11guess_knoll_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_11guess_knoll___get__(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_11guess_knoll___get__(struct PyPetscKSPObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/KSP.pyx":2140 * """Whether solver uses Knoll trick.""" * def __get__(self) -> bool: * return self.getInitialGuessKnoll() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setInitialGuessKnoll(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getInitialGuessKnoll); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 2140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/KSP.pyx":2139 * property guess_knoll: * """Whether solver uses Knoll trick.""" * def __get__(self) -> bool: # <<<<<<<<<<<<<< * return self.getInitialGuessKnoll() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.guess_knoll.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":2141 * def __get__(self) -> bool: * return self.getInitialGuessKnoll() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setInitialGuessKnoll(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_3KSP_11guess_knoll_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_3KSP_11guess_knoll_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_11guess_knoll_2__set__(((struct PyPetscKSPObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_3KSP_11guess_knoll_2__set__(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "petsc4py/PETSc/KSP.pyx":2142 * return self.getInitialGuessKnoll() * def __set__(self, value): * self.setInitialGuessKnoll(value) # <<<<<<<<<<<<<< * * # --- preconditioner --- */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setInitialGuessKnoll); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 2142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_value}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/KSP.pyx":2141 * def __get__(self) -> bool: * return self.getInitialGuessKnoll() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setInitialGuessKnoll(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.guess_knoll.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":2148 * property pc: * """The `PC` of the solver.""" * def __get__(self) -> PC: # <<<<<<<<<<<<<< * return self.getPC() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_2pc_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_2pc_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_2pc___get__(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_2pc___get__(struct PyPetscKSPObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/KSP.pyx":2149 * """The `PC` of the solver.""" * def __get__(self) -> PC: * return self.getPC() # <<<<<<<<<<<<<< * * property pc_side: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getPC); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 2149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/KSP.pyx":2148 * property pc: * """The `PC` of the solver.""" * def __get__(self) -> PC: # <<<<<<<<<<<<<< * return self.getPC() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.pc.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":2153 * property pc_side: * """The side on which preconditioning is performed.""" * def __get__(self) -> PC.Side: # <<<<<<<<<<<<<< * return self.getPCSide() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_7pc_side_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_7pc_side_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_7pc_side___get__(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_7pc_side___get__(struct PyPetscKSPObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/KSP.pyx":2154 * """The side on which preconditioning is performed.""" * def __get__(self) -> PC.Side: * return self.getPCSide() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setPCSide(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getPCSide); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 2154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/KSP.pyx":2153 * property pc_side: * """The side on which preconditioning is performed.""" * def __get__(self) -> PC.Side: # <<<<<<<<<<<<<< * return self.getPCSide() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.pc_side.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":2155 * def __get__(self) -> PC.Side: * return self.getPCSide() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setPCSide(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_3KSP_7pc_side_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_3KSP_7pc_side_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_7pc_side_2__set__(((struct PyPetscKSPObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_3KSP_7pc_side_2__set__(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "petsc4py/PETSc/KSP.pyx":2156 * return self.getPCSide() * def __set__(self, value): * self.setPCSide(value) # <<<<<<<<<<<<<< * * property norm_type: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setPCSide); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 2156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_value}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/KSP.pyx":2155 * def __get__(self) -> PC.Side: * return self.getPCSide() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setPCSide(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.pc_side.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":2160 * property norm_type: * """The norm used by the solver.""" * def __get__(self) -> NormType: # <<<<<<<<<<<<<< * return self.getNormType() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_9norm_type_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_9norm_type_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_9norm_type___get__(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_9norm_type___get__(struct PyPetscKSPObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/KSP.pyx":2161 * """The norm used by the solver.""" * def __get__(self) -> NormType: * return self.getNormType() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setNormType(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getNormType); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 2161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/KSP.pyx":2160 * property norm_type: * """The norm used by the solver.""" * def __get__(self) -> NormType: # <<<<<<<<<<<<<< * return self.getNormType() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.norm_type.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":2162 * def __get__(self) -> NormType: * return self.getNormType() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setNormType(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_3KSP_9norm_type_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_3KSP_9norm_type_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_9norm_type_2__set__(((struct PyPetscKSPObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_3KSP_9norm_type_2__set__(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "petsc4py/PETSc/KSP.pyx":2163 * return self.getNormType() * def __set__(self, value): * self.setNormType(value) # <<<<<<<<<<<<<< * * # --- tolerances --- */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setNormType); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 2163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_value}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/KSP.pyx":2162 * def __get__(self) -> NormType: * return self.getNormType() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setNormType(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.norm_type.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":2169 * property rtol: * """The relative tolerance of the solver.""" * def __get__(self) -> float: # <<<<<<<<<<<<<< * return self.getTolerances()[0] * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_4rtol_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_4rtol_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_4rtol___get__(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_4rtol___get__(struct PyPetscKSPObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/KSP.pyx":2170 * """The relative tolerance of the solver.""" * def __get__(self) -> float: * return self.getTolerances()[0] # <<<<<<<<<<<<<< * def __set__(self, value): * self.setTolerances(rtol=value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getTolerances); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 2170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 2170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/KSP.pyx":2169 * property rtol: * """The relative tolerance of the solver.""" * def __get__(self) -> float: # <<<<<<<<<<<<<< * return self.getTolerances()[0] * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.rtol.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":2171 * def __get__(self) -> float: * return self.getTolerances()[0] * def __set__(self, value): # <<<<<<<<<<<<<< * self.setTolerances(rtol=value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_3KSP_4rtol_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_3KSP_4rtol_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_4rtol_2__set__(((struct PyPetscKSPObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_3KSP_4rtol_2__set__(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "petsc4py/PETSc/KSP.pyx":2172 * return self.getTolerances()[0] * def __set__(self, value): * self.setTolerances(rtol=value) # <<<<<<<<<<<<<< * * property atol: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setTolerances); if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 2172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_rtol, __pyx_v_value) < 0) __PYX_ERR(49, 2172, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(49, 2172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/KSP.pyx":2171 * def __get__(self) -> float: * return self.getTolerances()[0] * def __set__(self, value): # <<<<<<<<<<<<<< * self.setTolerances(rtol=value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.rtol.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":2176 * property atol: * """The absolute tolerance of the solver.""" * def __get__(self) -> float: # <<<<<<<<<<<<<< * return self.getTolerances()[1] * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_4atol_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_4atol_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_4atol___get__(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_4atol___get__(struct PyPetscKSPObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/KSP.pyx":2177 * """The absolute tolerance of the solver.""" * def __get__(self) -> float: * return self.getTolerances()[1] # <<<<<<<<<<<<<< * def __set__(self, value): * self.setTolerances(atol=value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getTolerances); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 2177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 2177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/KSP.pyx":2176 * property atol: * """The absolute tolerance of the solver.""" * def __get__(self) -> float: # <<<<<<<<<<<<<< * return self.getTolerances()[1] * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.atol.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":2178 * def __get__(self) -> float: * return self.getTolerances()[1] * def __set__(self, value): # <<<<<<<<<<<<<< * self.setTolerances(atol=value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_3KSP_4atol_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_3KSP_4atol_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_4atol_2__set__(((struct PyPetscKSPObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_3KSP_4atol_2__set__(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "petsc4py/PETSc/KSP.pyx":2179 * return self.getTolerances()[1] * def __set__(self, value): * self.setTolerances(atol=value) # <<<<<<<<<<<<<< * * property divtol: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setTolerances); if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 2179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_atol, __pyx_v_value) < 0) __PYX_ERR(49, 2179, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(49, 2179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/KSP.pyx":2178 * def __get__(self) -> float: * return self.getTolerances()[1] * def __set__(self, value): # <<<<<<<<<<<<<< * self.setTolerances(atol=value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.atol.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":2183 * property divtol: * """The divergence tolerance of the solver.""" * def __get__(self) -> float: # <<<<<<<<<<<<<< * return self.getTolerances()[2] * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_6divtol_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_6divtol_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_6divtol___get__(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_6divtol___get__(struct PyPetscKSPObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/KSP.pyx":2184 * """The divergence tolerance of the solver.""" * def __get__(self) -> float: * return self.getTolerances()[2] # <<<<<<<<<<<<<< * def __set__(self, value): * self.setTolerances(divtol=value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getTolerances); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 2184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 2184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/KSP.pyx":2183 * property divtol: * """The divergence tolerance of the solver.""" * def __get__(self) -> float: # <<<<<<<<<<<<<< * return self.getTolerances()[2] * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.divtol.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":2185 * def __get__(self) -> float: * return self.getTolerances()[2] * def __set__(self, value): # <<<<<<<<<<<<<< * self.setTolerances(divtol=value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_3KSP_6divtol_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_3KSP_6divtol_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_6divtol_2__set__(((struct PyPetscKSPObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_3KSP_6divtol_2__set__(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "petsc4py/PETSc/KSP.pyx":2186 * return self.getTolerances()[2] * def __set__(self, value): * self.setTolerances(divtol=value) # <<<<<<<<<<<<<< * * property max_it: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setTolerances); if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 2186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_divtol, __pyx_v_value) < 0) __PYX_ERR(49, 2186, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(49, 2186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/KSP.pyx":2185 * def __get__(self) -> float: * return self.getTolerances()[2] * def __set__(self, value): # <<<<<<<<<<<<<< * self.setTolerances(divtol=value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.divtol.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":2190 * property max_it: * """The maximum number of iteration the solver may take.""" * def __get__(self) -> int: # <<<<<<<<<<<<<< * return self.getTolerances()[3] * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_6max_it_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_6max_it_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_6max_it___get__(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_6max_it___get__(struct PyPetscKSPObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/KSP.pyx":2191 * """The maximum number of iteration the solver may take.""" * def __get__(self) -> int: * return self.getTolerances()[3] # <<<<<<<<<<<<<< * def __set__(self, value): * self.setTolerances(max_it=value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getTolerances); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 2191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 2191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/KSP.pyx":2190 * property max_it: * """The maximum number of iteration the solver may take.""" * def __get__(self) -> int: # <<<<<<<<<<<<<< * return self.getTolerances()[3] * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.max_it.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":2192 * def __get__(self) -> int: * return self.getTolerances()[3] * def __set__(self, value): # <<<<<<<<<<<<<< * self.setTolerances(max_it=value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_3KSP_6max_it_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_3KSP_6max_it_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_6max_it_2__set__(((struct PyPetscKSPObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_3KSP_6max_it_2__set__(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "petsc4py/PETSc/KSP.pyx":2193 * return self.getTolerances()[3] * def __set__(self, value): * self.setTolerances(max_it=value) # <<<<<<<<<<<<<< * * # --- iteration --- */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setTolerances); if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 2193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_max_it, __pyx_v_value) < 0) __PYX_ERR(49, 2193, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(49, 2193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/KSP.pyx":2192 * def __get__(self) -> int: * return self.getTolerances()[3] * def __set__(self, value): # <<<<<<<<<<<<<< * self.setTolerances(max_it=value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.max_it.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":2199 * property its: * """The current number of iterations the solver has taken.""" * def __get__(self) -> int: # <<<<<<<<<<<<<< * return self.getIterationNumber() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_3its_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_3its_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_3its___get__(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_3its___get__(struct PyPetscKSPObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/KSP.pyx":2200 * """The current number of iterations the solver has taken.""" * def __get__(self) -> int: * return self.getIterationNumber() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setIterationNumber(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getIterationNumber); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 2200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/KSP.pyx":2199 * property its: * """The current number of iterations the solver has taken.""" * def __get__(self) -> int: # <<<<<<<<<<<<<< * return self.getIterationNumber() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.its.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":2201 * def __get__(self) -> int: * return self.getIterationNumber() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setIterationNumber(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_3KSP_3its_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_3KSP_3its_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_3its_2__set__(((struct PyPetscKSPObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_3KSP_3its_2__set__(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "petsc4py/PETSc/KSP.pyx":2202 * return self.getIterationNumber() * def __set__(self, value): * self.setIterationNumber(value) # <<<<<<<<<<<<<< * * property norm: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setIterationNumber); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 2202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_value}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/KSP.pyx":2201 * def __get__(self) -> int: * return self.getIterationNumber() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setIterationNumber(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.its.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":2206 * property norm: * """The norm of the residual at the current iteration.""" * def __get__(self) -> float: # <<<<<<<<<<<<<< * return self.getResidualNorm() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_4norm_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_4norm_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_4norm___get__(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_4norm___get__(struct PyPetscKSPObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/KSP.pyx":2207 * """The norm of the residual at the current iteration.""" * def __get__(self) -> float: * return self.getResidualNorm() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setResidualNorm(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getResidualNorm); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 2207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/KSP.pyx":2206 * property norm: * """The norm of the residual at the current iteration.""" * def __get__(self) -> float: # <<<<<<<<<<<<<< * return self.getResidualNorm() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.norm.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":2208 * def __get__(self) -> float: * return self.getResidualNorm() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setResidualNorm(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_3KSP_4norm_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_3KSP_4norm_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_4norm_2__set__(((struct PyPetscKSPObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_3KSP_4norm_2__set__(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "petsc4py/PETSc/KSP.pyx":2209 * return self.getResidualNorm() * def __set__(self, value): * self.setResidualNorm(value) # <<<<<<<<<<<<<< * * property history: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setResidualNorm); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 2209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_value}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/KSP.pyx":2208 * def __get__(self) -> float: * return self.getResidualNorm() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setResidualNorm(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.norm.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":2213 * property history: * """The convergence history of the solver.""" * def __get__(self) -> ndarray: # <<<<<<<<<<<<<< * return self.getConvergenceHistory() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_7history_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_7history_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_7history___get__(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_7history___get__(struct PyPetscKSPObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/KSP.pyx":2214 * """The convergence history of the solver.""" * def __get__(self) -> ndarray: * return self.getConvergenceHistory() # <<<<<<<<<<<<<< * * # --- convergence --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getConvergenceHistory); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 2214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/KSP.pyx":2213 * property history: * """The convergence history of the solver.""" * def __get__(self) -> ndarray: # <<<<<<<<<<<<<< * return self.getConvergenceHistory() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.history.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":2220 * property reason: * """The converged reason.""" * def __get__(self) -> KSP.ConvergedReason: # <<<<<<<<<<<<<< * return self.getConvergedReason() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_6reason_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_6reason_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_6reason___get__(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_6reason___get__(struct PyPetscKSPObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/KSP.pyx":2221 * """The converged reason.""" * def __get__(self) -> KSP.ConvergedReason: * return self.getConvergedReason() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setConvergedReason(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getConvergedReason); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 2221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/KSP.pyx":2220 * property reason: * """The converged reason.""" * def __get__(self) -> KSP.ConvergedReason: # <<<<<<<<<<<<<< * return self.getConvergedReason() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.reason.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":2222 * def __get__(self) -> KSP.ConvergedReason: * return self.getConvergedReason() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setConvergedReason(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_3KSP_6reason_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_3KSP_6reason_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_6reason_2__set__(((struct PyPetscKSPObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_3KSP_6reason_2__set__(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "petsc4py/PETSc/KSP.pyx":2223 * return self.getConvergedReason() * def __set__(self, value): * self.setConvergedReason(value) # <<<<<<<<<<<<<< * * property is_iterating: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setConvergedReason); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 2223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_value}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/KSP.pyx":2222 * def __get__(self) -> KSP.ConvergedReason: * return self.getConvergedReason() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setConvergedReason(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.reason.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":2227 * property is_iterating: * """Boolean indicating if the solver has not converged yet.""" * def __get__(self) -> bool: # <<<<<<<<<<<<<< * return self.reason == 0 * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_12is_iterating_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_12is_iterating_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_12is_iterating___get__(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_12is_iterating___get__(struct PyPetscKSPObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/KSP.pyx":2228 * """Boolean indicating if the solver has not converged yet.""" * def __get__(self) -> bool: * return self.reason == 0 # <<<<<<<<<<<<<< * * property is_converged: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reason); if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_t_1, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 2228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/KSP.pyx":2227 * property is_iterating: * """Boolean indicating if the solver has not converged yet.""" * def __get__(self) -> bool: # <<<<<<<<<<<<<< * return self.reason == 0 * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.KSP.is_iterating.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":2232 * property is_converged: * """Boolean indicating if the solver has converged.""" * def __get__(self) -> bool: # <<<<<<<<<<<<<< * return self.reason > 0 * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_12is_converged_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_12is_converged_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_12is_converged___get__(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_12is_converged___get__(struct PyPetscKSPObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/KSP.pyx":2233 * """Boolean indicating if the solver has converged.""" * def __get__(self) -> bool: * return self.reason > 0 # <<<<<<<<<<<<<< * * property is_diverged: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reason); if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 2233, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/KSP.pyx":2232 * property is_converged: * """Boolean indicating if the solver has converged.""" * def __get__(self) -> bool: # <<<<<<<<<<<<<< * return self.reason > 0 * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.KSP.is_converged.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/KSP.pyx":2237 * property is_diverged: * """Boolean indicating if the solver has failed.""" * def __get__(self) -> bool: # <<<<<<<<<<<<<< * return self.reason < 0 * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_11is_diverged_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_11is_diverged_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_11is_diverged___get__(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_11is_diverged___get__(struct PyPetscKSPObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/KSP.pyx":2238 * """Boolean indicating if the solver has failed.""" * def __get__(self) -> bool: * return self.reason < 0 # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reason); if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 2238, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/KSP.pyx":2237 * property is_diverged: * """Boolean indicating if the solver has failed.""" * def __get__(self) -> bool: # <<<<<<<<<<<<<< * return self.reason < 0 * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.KSP.is_diverged.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":104 * # --- xxx --- * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.snes * self.snes = NULL */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_4SNES_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_4SNES_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES___cinit__(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_4SNES___cinit__(struct PyPetscSNESObject *__pyx_v_self) { int __pyx_r; /* "petsc4py/PETSc/SNES.pyx":105 * * def __cinit__(self): * self.obj = &self.snes # <<<<<<<<<<<<<< * self.snes = NULL * */ __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->snes)); /* "petsc4py/PETSc/SNES.pyx":106 * def __cinit__(self): * self.obj = &self.snes * self.snes = NULL # <<<<<<<<<<<<<< * * # --- xxx --- */ __pyx_v_self->snes = NULL; /* "petsc4py/PETSc/SNES.pyx":104 * # --- xxx --- * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.snes * self.snes = NULL */ /* function exit code */ __pyx_r = 0; return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":110 * # --- xxx --- * * def view(self, Viewer viewer=None) -> None: # <<<<<<<<<<<<<< * """View the solver. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_3view(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_2view, "SNES.view(self, viewer: Viewer | None = None) -> None\nView the solver.\n\n Collective.\n\n Parameters\n ----------\n viewer\n A `Viewer` instance or `None` for the default viewer.\n\n See Also\n --------\n petsc.SNESView\n\n \nSource code at petsc4py/PETSc/SNES.pyx:110"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_3view(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscViewerObject *__pyx_v_viewer = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("view (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscViewerObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_viewer); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 110, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "view") < 0)) __PYX_ERR(50, 110, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, __pyx_nargs); __PYX_ERR(50, 110, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SNES.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(50, 110, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_2view(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_viewer); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_2view(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer) { PetscViewer __pyx_v_cviewer; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscViewer __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("view", 1); /* "petsc4py/PETSc/SNES.pyx":125 * * """ * cdef PetscViewer cviewer = NULL # <<<<<<<<<<<<<< * if viewer is not None: cviewer = viewer.vwr * CHKERR( SNESView(self.snes, cviewer) ) */ __pyx_v_cviewer = NULL; /* "petsc4py/PETSc/SNES.pyx":126 * """ * cdef PetscViewer cviewer = NULL * if viewer is not None: cviewer = viewer.vwr # <<<<<<<<<<<<<< * CHKERR( SNESView(self.snes, cviewer) ) * */ __pyx_t_1 = (((PyObject *)__pyx_v_viewer) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_viewer->vwr; __pyx_v_cviewer = __pyx_t_2; } /* "petsc4py/PETSc/SNES.pyx":127 * cdef PetscViewer cviewer = NULL * if viewer is not None: cviewer = viewer.vwr * CHKERR( SNESView(self.snes, cviewer) ) # <<<<<<<<<<<<<< * * def destroy(self) -> Self: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESView(__pyx_v_self->snes, __pyx_v_cviewer)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 127, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":110 * # --- xxx --- * * def view(self, Viewer viewer=None) -> None: # <<<<<<<<<<<<<< * """View the solver. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":129 * CHKERR( SNESView(self.snes, cviewer) ) * * def destroy(self) -> Self: # <<<<<<<<<<<<<< * """Destroy the solver. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_5destroy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_4destroy, "SNES.destroy(self) -> Self\nDestroy the solver.\n\n Collective.\n\n See Also\n --------\n petsc.SNESDestroy\n\n \nSource code at petsc4py/PETSc/SNES.pyx:129"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_5destroy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("destroy (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_4destroy(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_4destroy(struct PyPetscSNESObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("destroy", 1); /* "petsc4py/PETSc/SNES.pyx":139 * * """ * CHKERR( SNESDestroy(&self.snes) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESDestroy((&__pyx_v_self->snes))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 139, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":140 * """ * CHKERR( SNESDestroy(&self.snes) ) * return self # <<<<<<<<<<<<<< * * def create(self, comm: Comm | None = None) -> Self: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":129 * CHKERR( SNESView(self.snes, cviewer) ) * * def destroy(self) -> Self: # <<<<<<<<<<<<<< * """Destroy the solver. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":142 * return self * * def create(self, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Create a SNES solver. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_7create(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_6create, "SNES.create(self, comm: Comm | None = None) -> Self\nCreate a SNES solver.\n\n Collective.\n\n Parameters\n ----------\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n Sys.getDefaultComm, petsc.SNESCreate\n\n \nSource code at petsc4py/PETSc/SNES.pyx:142"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_7create(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 142, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "create") < 0)) __PYX_ERR(50, 142, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_comm = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, __pyx_nargs); __PYX_ERR(50, 142, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SNES.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_6create(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_comm); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_6create(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; SNES __pyx_v_newsnes; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create", 1); /* "petsc4py/PETSc/SNES.pyx":157 * * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscSNES newsnes = NULL * CHKERR( SNESCreate(ccomm, &newsnes) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(50, 157, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/SNES.pyx":158 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscSNES newsnes = NULL # <<<<<<<<<<<<<< * CHKERR( SNESCreate(ccomm, &newsnes) ) * CHKERR( PetscCLEAR(self.obj) ); self.snes = newsnes */ __pyx_v_newsnes = NULL; /* "petsc4py/PETSc/SNES.pyx":159 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscSNES newsnes = NULL * CHKERR( SNESCreate(ccomm, &newsnes) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.snes = newsnes * return self */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESCreate(__pyx_v_ccomm, (&__pyx_v_newsnes))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 159, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":160 * cdef PetscSNES newsnes = NULL * CHKERR( SNESCreate(ccomm, &newsnes) ) * CHKERR( PetscCLEAR(self.obj) ); self.snes = newsnes # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 160, __pyx_L1_error) __pyx_v_self->snes = __pyx_v_newsnes; /* "petsc4py/PETSc/SNES.pyx":161 * CHKERR( SNESCreate(ccomm, &newsnes) ) * CHKERR( PetscCLEAR(self.obj) ); self.snes = newsnes * return self # <<<<<<<<<<<<<< * * def setType(self, snes_type: Type | str) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":142 * return self * * def create(self, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Create a SNES solver. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":163 * return self * * def setType(self, snes_type: Type | str) -> None: # <<<<<<<<<<<<<< * """Set the type of the solver. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_9setType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_8setType, "SNES.setType(self, snes_type: Type | str) -> None\nSet the type of the solver.\n\n Logically collective.\n\n Parameters\n ----------\n snes_type\n The type of the solver.\n\n See Also\n --------\n getType, petsc.SNESSetType\n\n \nSource code at petsc4py/PETSc/SNES.pyx:163"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_9setType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_snes_type = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_snes_type,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_snes_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 163, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setType") < 0)) __PYX_ERR(50, 163, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_snes_type = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, __pyx_nargs); __PYX_ERR(50, 163, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SNES.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_8setType(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_snes_type); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_8setType(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_snes_type) { SNESType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setType", 0); __Pyx_INCREF(__pyx_v_snes_type); /* "petsc4py/PETSc/SNES.pyx":178 * * """ * cdef PetscSNESType cval = NULL # <<<<<<<<<<<<<< * snes_type = str2bytes(snes_type, &cval) * CHKERR( SNESSetType(self.snes, cval) ) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/SNES.pyx":179 * """ * cdef PetscSNESType cval = NULL * snes_type = str2bytes(snes_type, &cval) # <<<<<<<<<<<<<< * CHKERR( SNESSetType(self.snes, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_snes_type, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_snes_type, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/SNES.pyx":180 * cdef PetscSNESType cval = NULL * snes_type = str2bytes(snes_type, &cval) * CHKERR( SNESSetType(self.snes, cval) ) # <<<<<<<<<<<<<< * * def getType(self) -> str: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetType(__pyx_v_self->snes, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 180, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":163 * return self * * def setType(self, snes_type: Type | str) -> None: # <<<<<<<<<<<<<< * """Set the type of the solver. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.SNES.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_snes_type); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":182 * CHKERR( SNESSetType(self.snes, cval) ) * * def getType(self) -> str: # <<<<<<<<<<<<<< * """Return the type of the solver. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_11getType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_10getType, "SNES.getType(self) -> str\nReturn the type of the solver.\n\n Not collective.\n\n See Also\n --------\n setType, petsc.SNESGetType\n\n \nSource code at petsc4py/PETSc/SNES.pyx:182"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_11getType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getType", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_10getType(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_10getType(struct PyPetscSNESObject *__pyx_v_self) { SNESType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getType", 1); /* "petsc4py/PETSc/SNES.pyx":192 * * """ * cdef PetscSNESType cval = NULL # <<<<<<<<<<<<<< * CHKERR( SNESGetType(self.snes, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/SNES.pyx":193 * """ * cdef PetscSNESType cval = NULL * CHKERR( SNESGetType(self.snes, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetType(__pyx_v_self->snes, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 193, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":194 * cdef PetscSNESType cval = NULL * CHKERR( SNESGetType(self.snes, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * def setOptionsPrefix(self, prefix: str) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":182 * CHKERR( SNESSetType(self.snes, cval) ) * * def getType(self) -> str: # <<<<<<<<<<<<<< * """Return the type of the solver. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":196 * return bytes2str(cval) * * def setOptionsPrefix(self, prefix: str) -> None: # <<<<<<<<<<<<<< * """Set the prefix used for searching for options in the database. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_13setOptionsPrefix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_12setOptionsPrefix, "SNES.setOptionsPrefix(self, prefix: str) -> None\nSet the prefix used for searching for options in the database.\n\n Logically collective.\n\n See Also\n --------\n petsc_options, petsc.SNESSetOptionsPrefix\n\n \nSource code at petsc4py/PETSc/SNES.pyx:196"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_13setOptionsPrefix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_prefix = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setOptionsPrefix (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_prefix,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_prefix)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 196, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setOptionsPrefix") < 0)) __PYX_ERR(50, 196, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_prefix = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setOptionsPrefix", 1, 1, 1, __pyx_nargs); __PYX_ERR(50, 196, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SNES.setOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_12setOptionsPrefix(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_prefix); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_12setOptionsPrefix(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_prefix) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setOptionsPrefix", 0); __Pyx_INCREF(__pyx_v_prefix); /* "petsc4py/PETSc/SNES.pyx":206 * * """ * cdef const char *cval = NULL # <<<<<<<<<<<<<< * prefix = str2bytes(prefix, &cval) * CHKERR( SNESSetOptionsPrefix(self.snes, cval) ) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/SNES.pyx":207 * """ * cdef const char *cval = NULL * prefix = str2bytes(prefix, &cval) # <<<<<<<<<<<<<< * CHKERR( SNESSetOptionsPrefix(self.snes, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_prefix, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_prefix, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/SNES.pyx":208 * cdef const char *cval = NULL * prefix = str2bytes(prefix, &cval) * CHKERR( SNESSetOptionsPrefix(self.snes, cval) ) # <<<<<<<<<<<<<< * * def getOptionsPrefix(self) -> str: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetOptionsPrefix(__pyx_v_self->snes, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 208, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":196 * return bytes2str(cval) * * def setOptionsPrefix(self, prefix: str) -> None: # <<<<<<<<<<<<<< * """Set the prefix used for searching for options in the database. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.SNES.setOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_prefix); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":210 * CHKERR( SNESSetOptionsPrefix(self.snes, cval) ) * * def getOptionsPrefix(self) -> str: # <<<<<<<<<<<<<< * """Return the prefix used for searching for options in the database. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_15getOptionsPrefix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_14getOptionsPrefix, "SNES.getOptionsPrefix(self) -> str\nReturn the prefix used for searching for options in the database.\n\n Not collective.\n\n See Also\n --------\n petsc_options, setOptionsPrefix, petsc.SNESGetOptionsPrefix\n\n \nSource code at petsc4py/PETSc/SNES.pyx:210"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_15getOptionsPrefix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getOptionsPrefix (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getOptionsPrefix", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getOptionsPrefix", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_14getOptionsPrefix(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_14getOptionsPrefix(struct PyPetscSNESObject *__pyx_v_self) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getOptionsPrefix", 1); /* "petsc4py/PETSc/SNES.pyx":220 * * """ * cdef const char *cval = NULL # <<<<<<<<<<<<<< * CHKERR( SNESGetOptionsPrefix(self.snes, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/SNES.pyx":221 * """ * cdef const char *cval = NULL * CHKERR( SNESGetOptionsPrefix(self.snes, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetOptionsPrefix(__pyx_v_self->snes, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 221, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":222 * cdef const char *cval = NULL * CHKERR( SNESGetOptionsPrefix(self.snes, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * def appendOptionsPrefix(self, prefix: str) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":210 * CHKERR( SNESSetOptionsPrefix(self.snes, cval) ) * * def getOptionsPrefix(self) -> str: # <<<<<<<<<<<<<< * """Return the prefix used for searching for options in the database. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":224 * return bytes2str(cval) * * def appendOptionsPrefix(self, prefix: str) -> None: # <<<<<<<<<<<<<< * """Append to the prefix used for searching for options in the database. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_17appendOptionsPrefix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_16appendOptionsPrefix, "SNES.appendOptionsPrefix(self, prefix: str) -> None\nAppend to the prefix used for searching for options in the database.\n\n Logically collective.\n\n See Also\n --------\n petsc_options, setOptionsPrefix, petsc.SNESAppendOptionsPrefix\n\n \nSource code at petsc4py/PETSc/SNES.pyx:224"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_17appendOptionsPrefix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_prefix = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("appendOptionsPrefix (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_prefix,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_prefix)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 224, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "appendOptionsPrefix") < 0)) __PYX_ERR(50, 224, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_prefix = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("appendOptionsPrefix", 1, 1, 1, __pyx_nargs); __PYX_ERR(50, 224, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SNES.appendOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_16appendOptionsPrefix(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_prefix); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_16appendOptionsPrefix(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_prefix) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("appendOptionsPrefix", 0); __Pyx_INCREF(__pyx_v_prefix); /* "petsc4py/PETSc/SNES.pyx":234 * * """ * cdef const char *cval = NULL # <<<<<<<<<<<<<< * prefix = str2bytes(prefix, &cval) * CHKERR( SNESAppendOptionsPrefix(self.snes, cval) ) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/SNES.pyx":235 * """ * cdef const char *cval = NULL * prefix = str2bytes(prefix, &cval) # <<<<<<<<<<<<<< * CHKERR( SNESAppendOptionsPrefix(self.snes, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_prefix, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_prefix, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/SNES.pyx":236 * cdef const char *cval = NULL * prefix = str2bytes(prefix, &cval) * CHKERR( SNESAppendOptionsPrefix(self.snes, cval) ) # <<<<<<<<<<<<<< * * def setFromOptions(self) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESAppendOptionsPrefix(__pyx_v_self->snes, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 236, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":224 * return bytes2str(cval) * * def appendOptionsPrefix(self, prefix: str) -> None: # <<<<<<<<<<<<<< * """Append to the prefix used for searching for options in the database. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.SNES.appendOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_prefix); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":238 * CHKERR( SNESAppendOptionsPrefix(self.snes, cval) ) * * def setFromOptions(self) -> None: # <<<<<<<<<<<<<< * """Configure the solver from the options database. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_19setFromOptions(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_18setFromOptions, "SNES.setFromOptions(self) -> None\nConfigure the solver from the options database.\n\n Collective.\n\n See Also\n --------\n petsc_options, petsc.SNESSetFromOptions\n\n \nSource code at petsc4py/PETSc/SNES.pyx:238"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_19setFromOptions(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFromOptions (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("setFromOptions", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setFromOptions", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_18setFromOptions(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_18setFromOptions(struct PyPetscSNESObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFromOptions", 1); /* "petsc4py/PETSc/SNES.pyx":248 * * """ * CHKERR( SNESSetFromOptions(self.snes) ) # <<<<<<<<<<<<<< * * # --- application context --- */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetFromOptions(__pyx_v_self->snes)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 248, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":238 * CHKERR( SNESAppendOptionsPrefix(self.snes, cval) ) * * def setFromOptions(self) -> None: # <<<<<<<<<<<<<< * """Configure the solver from the options database. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setFromOptions", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":252 * # --- application context --- * * def setApplicationContext(self, appctx: Any) -> None: # <<<<<<<<<<<<<< * """Set the application context.""" * self.set_attr('__appctx__', appctx) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_21setApplicationContext(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_20setApplicationContext, "SNES.setApplicationContext(self, appctx: Any) -> None\nSet the application context.\nSource code at petsc4py/PETSc/SNES.pyx:252"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_21setApplicationContext(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_appctx = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setApplicationContext (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_appctx,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_appctx)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 252, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setApplicationContext") < 0)) __PYX_ERR(50, 252, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_appctx = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setApplicationContext", 1, 1, 1, __pyx_nargs); __PYX_ERR(50, 252, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SNES.setApplicationContext", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_20setApplicationContext(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_appctx); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_20setApplicationContext(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_appctx) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setApplicationContext", 1); /* "petsc4py/PETSc/SNES.pyx":254 * def setApplicationContext(self, appctx: Any) -> None: * """Set the application context.""" * self.set_attr('__appctx__', appctx) # <<<<<<<<<<<<<< * if appctx is not None: * registerAppCtx(appctx) */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__appctx__"), __pyx_v_appctx); if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/SNES.pyx":255 * """Set the application context.""" * self.set_attr('__appctx__', appctx) * if appctx is not None: # <<<<<<<<<<<<<< * registerAppCtx(appctx) * CHKERR( SNESSetApplicationContext(self.snes, appctx) ) */ __pyx_t_2 = (__pyx_v_appctx != Py_None); if (__pyx_t_2) { /* "petsc4py/PETSc/SNES.pyx":256 * self.set_attr('__appctx__', appctx) * if appctx is not None: * registerAppCtx(appctx) # <<<<<<<<<<<<<< * CHKERR( SNESSetApplicationContext(self.snes, appctx) ) * else: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_registerAppCtx(((void *)__pyx_v_appctx)); if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/SNES.pyx":257 * if appctx is not None: * registerAppCtx(appctx) * CHKERR( SNESSetApplicationContext(self.snes, appctx) ) # <<<<<<<<<<<<<< * else: * CHKERR( SNESSetApplicationContext(self.snes, NULL) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetApplicationContext(__pyx_v_self->snes, ((void *)__pyx_v_appctx))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 257, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":255 * """Set the application context.""" * self.set_attr('__appctx__', appctx) * if appctx is not None: # <<<<<<<<<<<<<< * registerAppCtx(appctx) * CHKERR( SNESSetApplicationContext(self.snes, appctx) ) */ goto __pyx_L3; } /* "petsc4py/PETSc/SNES.pyx":259 * CHKERR( SNESSetApplicationContext(self.snes, appctx) ) * else: * CHKERR( SNESSetApplicationContext(self.snes, NULL) ) # <<<<<<<<<<<<<< * * def getApplicationContext(self) -> Any: */ /*else*/ { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetApplicationContext(__pyx_v_self->snes, NULL)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 259, __pyx_L1_error) } __pyx_L3:; /* "petsc4py/PETSc/SNES.pyx":252 * # --- application context --- * * def setApplicationContext(self, appctx: Any) -> None: # <<<<<<<<<<<<<< * """Set the application context.""" * self.set_attr('__appctx__', appctx) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.SNES.setApplicationContext", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":261 * CHKERR( SNESSetApplicationContext(self.snes, NULL) ) * * def getApplicationContext(self) -> Any: # <<<<<<<<<<<<<< * """Return the application context.""" * cdef void *ctx */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_23getApplicationContext(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_22getApplicationContext, "SNES.getApplicationContext(self) -> Any\nReturn the application context.\nSource code at petsc4py/PETSc/SNES.pyx:261"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_23getApplicationContext(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getApplicationContext (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getApplicationContext", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getApplicationContext", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_22getApplicationContext(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_22getApplicationContext(struct PyPetscSNESObject *__pyx_v_self) { void *__pyx_v_ctx; PyObject *__pyx_v_appctx = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getApplicationContext", 1); /* "petsc4py/PETSc/SNES.pyx":264 * """Return the application context.""" * cdef void *ctx * appctx = self.get_attr('__appctx__') # <<<<<<<<<<<<<< * if appctx is None: * CHKERR( SNESGetApplicationContext(self.snes, &ctx) ) */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__appctx__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 264, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_appctx = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/SNES.pyx":265 * cdef void *ctx * appctx = self.get_attr('__appctx__') * if appctx is None: # <<<<<<<<<<<<<< * CHKERR( SNESGetApplicationContext(self.snes, &ctx) ) * appctx = toAppCtx(ctx) */ __pyx_t_2 = (__pyx_v_appctx == Py_None); if (__pyx_t_2) { /* "petsc4py/PETSc/SNES.pyx":266 * appctx = self.get_attr('__appctx__') * if appctx is None: * CHKERR( SNESGetApplicationContext(self.snes, &ctx) ) # <<<<<<<<<<<<<< * appctx = toAppCtx(ctx) * return appctx */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetApplicationContext(__pyx_v_self->snes, (&__pyx_v_ctx))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 266, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":267 * if appctx is None: * CHKERR( SNESGetApplicationContext(self.snes, &ctx) ) * appctx = toAppCtx(ctx) # <<<<<<<<<<<<<< * return appctx * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toAppCtx(__pyx_v_ctx); if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_appctx, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/SNES.pyx":265 * cdef void *ctx * appctx = self.get_attr('__appctx__') * if appctx is None: # <<<<<<<<<<<<<< * CHKERR( SNESGetApplicationContext(self.snes, &ctx) ) * appctx = toAppCtx(ctx) */ } /* "petsc4py/PETSc/SNES.pyx":268 * CHKERR( SNESGetApplicationContext(self.snes, &ctx) ) * appctx = toAppCtx(ctx) * return appctx # <<<<<<<<<<<<<< * * # backward compatibility */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_appctx); __pyx_r = __pyx_v_appctx; goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":261 * CHKERR( SNESSetApplicationContext(self.snes, NULL) ) * * def getApplicationContext(self) -> Any: # <<<<<<<<<<<<<< * """Return the application context.""" * cdef void *ctx */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getApplicationContext", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_appctx); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":276 * # --- discretization space --- * * def getDM(self) -> DM: # <<<<<<<<<<<<<< * """Return the `DM` associated with the solver. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_25getDM(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_24getDM, "SNES.getDM(self) -> DM\nReturn the `DM` associated with the solver.\n\n Not collective.\n\n See Also\n --------\n setDM, petsc.SNESGetDM\n\n \nSource code at petsc4py/PETSc/SNES.pyx:276"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_25getDM(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getDM (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getDM", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getDM", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_24getDM(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_24getDM(struct PyPetscSNESObject *__pyx_v_self) { DM __pyx_v_newdm; struct PyPetscDMObject *__pyx_v_dm = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getDM", 1); /* "petsc4py/PETSc/SNES.pyx":286 * * """ * cdef PetscDM newdm = NULL # <<<<<<<<<<<<<< * CHKERR( SNESGetDM(self.snes, &newdm) ) * cdef DM dm = subtype_DM(newdm)() */ __pyx_v_newdm = NULL; /* "petsc4py/PETSc/SNES.pyx":287 * """ * cdef PetscDM newdm = NULL * CHKERR( SNESGetDM(self.snes, &newdm) ) # <<<<<<<<<<<<<< * cdef DM dm = subtype_DM(newdm)() * dm.dm = newdm */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetDM(__pyx_v_self->snes, (&__pyx_v_newdm))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 287, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":288 * cdef PetscDM newdm = NULL * CHKERR( SNESGetDM(self.snes, &newdm) ) * cdef DM dm = subtype_DM(newdm)() # <<<<<<<<<<<<<< * dm.dm = newdm * CHKERR( PetscINCREF(dm.obj) ) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_newdm)); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(50, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(50, 288, __pyx_L1_error) __pyx_v_dm = ((struct PyPetscDMObject *)__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/SNES.pyx":289 * CHKERR( SNESGetDM(self.snes, &newdm) ) * cdef DM dm = subtype_DM(newdm)() * dm.dm = newdm # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(dm.obj) ) * return dm */ __pyx_v_dm->dm = __pyx_v_newdm; /* "petsc4py/PETSc/SNES.pyx":290 * cdef DM dm = subtype_DM(newdm)() * dm.dm = newdm * CHKERR( PetscINCREF(dm.obj) ) # <<<<<<<<<<<<<< * return dm * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_dm->__pyx_base.obj)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 290, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":291 * dm.dm = newdm * CHKERR( PetscINCREF(dm.obj) ) * return dm # <<<<<<<<<<<<<< * * def setDM(self, DM dm) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_dm); __pyx_r = ((PyObject *)__pyx_v_dm); goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":276 * # --- discretization space --- * * def getDM(self) -> DM: # <<<<<<<<<<<<<< * """Return the `DM` associated with the solver. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getDM", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_dm); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":293 * return dm * * def setDM(self, DM dm) -> None: # <<<<<<<<<<<<<< * """Associate a `DM` with the solver. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_27setDM(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_26setDM, "SNES.setDM(self, dm: DM) -> None\nAssociate a `DM` with the solver.\n\n Not collective.\n\n See Also\n --------\n getDM, petsc.SNESSetDM\n\n \nSource code at petsc4py/PETSc/SNES.pyx:293"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_27setDM(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscDMObject *__pyx_v_dm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setDM (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dm,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dm)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 293, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setDM") < 0)) __PYX_ERR(50, 293, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_dm = ((struct PyPetscDMObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setDM", 1, 1, 1, __pyx_nargs); __PYX_ERR(50, 293, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SNES.setDM", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_ptype_8petsc4py_5PETSc_DM, 0, "dm", 0))) __PYX_ERR(50, 293, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_26setDM(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_dm); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_26setDM(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setDM", 1); /* "petsc4py/PETSc/SNES.pyx":303 * * """ * CHKERR( SNESSetDM(self.snes, dm.dm) ) # <<<<<<<<<<<<<< * * # --- FAS --- */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetDM(__pyx_v_self->snes, __pyx_v_dm->dm)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 303, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":293 * return dm * * def setDM(self, DM dm) -> None: # <<<<<<<<<<<<<< * """Associate a `DM` with the solver. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setDM", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":307 * # --- FAS --- * * def setFASInterpolation(self, level: int, Mat mat) -> None: # <<<<<<<<<<<<<< * """Set the `Mat` to be used to apply the interpolation from level-1 to level. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_29setFASInterpolation(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_28setFASInterpolation, "SNES.setFASInterpolation(self, level: int, mat: Mat) -> None\nSet the `Mat` to be used to apply the interpolation from level-1 to level.\n\n Collective.\n\n See Also\n --------\n getFASInterpolation, setFASRestriction, setFASInjection\n petsc.SNESFASSetInterpolation, petsc.SNESFAS\n\n \nSource code at petsc4py/PETSc/SNES.pyx:307"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_29setFASInterpolation(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_level = 0; struct PyPetscMatObject *__pyx_v_mat = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFASInterpolation (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,&__pyx_n_s_mat,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_level)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 307, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mat)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 307, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setFASInterpolation", 1, 2, 2, 1); __PYX_ERR(50, 307, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setFASInterpolation") < 0)) __PYX_ERR(50, 307, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_level = values[0]; __pyx_v_mat = ((struct PyPetscMatObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setFASInterpolation", 1, 2, 2, __pyx_nargs); __PYX_ERR(50, 307, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SNES.setFASInterpolation", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(50, 307, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_28setFASInterpolation(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_level, __pyx_v_mat); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_28setFASInterpolation(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level, struct PyPetscMatObject *__pyx_v_mat) { PetscInt __pyx_v_clevel; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFASInterpolation", 1); /* "petsc4py/PETSc/SNES.pyx":318 * * """ * cdef PetscInt clevel = asInt(level) # <<<<<<<<<<<<<< * CHKERR( SNESFASSetInterpolation(self.snes, clevel, mat.mat) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_level); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(50, 318, __pyx_L1_error) __pyx_v_clevel = __pyx_t_1; /* "petsc4py/PETSc/SNES.pyx":319 * """ * cdef PetscInt clevel = asInt(level) * CHKERR( SNESFASSetInterpolation(self.snes, clevel, mat.mat) ) # <<<<<<<<<<<<<< * * def getFASInterpolation(self, level: int) -> Mat: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESFASSetInterpolation(__pyx_v_self->snes, __pyx_v_clevel, __pyx_v_mat->mat)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 319, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":307 * # --- FAS --- * * def setFASInterpolation(self, level: int, Mat mat) -> None: # <<<<<<<<<<<<<< * """Set the `Mat` to be used to apply the interpolation from level-1 to level. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setFASInterpolation", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":321 * CHKERR( SNESFASSetInterpolation(self.snes, clevel, mat.mat) ) * * def getFASInterpolation(self, level: int) -> Mat: # <<<<<<<<<<<<<< * """Return the `Mat` used to apply the interpolation from level-1 to level. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_31getFASInterpolation(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_30getFASInterpolation, "SNES.getFASInterpolation(self, level: int) -> Mat\nReturn the `Mat` used to apply the interpolation from level-1 to level.\n\n Not collective.\n\n See Also\n --------\n setFASInterpolation, petsc.SNESFASGetInterpolation, petsc.SNESFAS\n\n \nSource code at petsc4py/PETSc/SNES.pyx:321"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_31getFASInterpolation(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_level = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getFASInterpolation (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_level)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 321, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getFASInterpolation") < 0)) __PYX_ERR(50, 321, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_level = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getFASInterpolation", 1, 1, 1, __pyx_nargs); __PYX_ERR(50, 321, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SNES.getFASInterpolation", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_30getFASInterpolation(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_level); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_30getFASInterpolation(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level) { PetscInt __pyx_v_clevel; struct PyPetscMatObject *__pyx_v_mat = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getFASInterpolation", 1); /* "petsc4py/PETSc/SNES.pyx":331 * * """ * cdef PetscInt clevel = asInt(level) # <<<<<<<<<<<<<< * cdef Mat mat = Mat() * CHKERR( SNESFASGetInterpolation(self.snes, clevel, &mat.mat) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_level); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(50, 331, __pyx_L1_error) __pyx_v_clevel = __pyx_t_1; /* "petsc4py/PETSc/SNES.pyx":332 * """ * cdef PetscInt clevel = asInt(level) * cdef Mat mat = Mat() # <<<<<<<<<<<<<< * CHKERR( SNESFASGetInterpolation(self.snes, clevel, &mat.mat) ) * CHKERR( PetscINCREF(mat.obj) ) */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_mat = ((struct PyPetscMatObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/SNES.pyx":333 * cdef PetscInt clevel = asInt(level) * cdef Mat mat = Mat() * CHKERR( SNESFASGetInterpolation(self.snes, clevel, &mat.mat) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(mat.obj) ) * return mat */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESFASGetInterpolation(__pyx_v_self->snes, __pyx_v_clevel, (&__pyx_v_mat->mat))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 333, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":334 * cdef Mat mat = Mat() * CHKERR( SNESFASGetInterpolation(self.snes, clevel, &mat.mat) ) * CHKERR( PetscINCREF(mat.obj) ) # <<<<<<<<<<<<<< * return mat * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_mat->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 334, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":335 * CHKERR( SNESFASGetInterpolation(self.snes, clevel, &mat.mat) ) * CHKERR( PetscINCREF(mat.obj) ) * return mat # <<<<<<<<<<<<<< * * def setFASRestriction(self, level: int, Mat mat) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_mat); __pyx_r = ((PyObject *)__pyx_v_mat); goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":321 * CHKERR( SNESFASSetInterpolation(self.snes, clevel, mat.mat) ) * * def getFASInterpolation(self, level: int) -> Mat: # <<<<<<<<<<<<<< * """Return the `Mat` used to apply the interpolation from level-1 to level. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getFASInterpolation", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_mat); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":337 * return mat * * def setFASRestriction(self, level: int, Mat mat) -> None: # <<<<<<<<<<<<<< * """Set the `Mat` to be used to apply the restriction from level-1 to level. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_33setFASRestriction(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_32setFASRestriction, "SNES.setFASRestriction(self, level: int, mat: Mat) -> None\nSet the `Mat` to be used to apply the restriction from level-1 to level.\n\n Collective.\n\n See Also\n --------\n setFASRScale, getFASRestriction, setFASInterpolation, setFASInjection\n petsc.SNESFASSetRestriction, petsc.SNESFAS\n\n \nSource code at petsc4py/PETSc/SNES.pyx:337"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_33setFASRestriction(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_level = 0; struct PyPetscMatObject *__pyx_v_mat = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFASRestriction (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,&__pyx_n_s_mat,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_level)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 337, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mat)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 337, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setFASRestriction", 1, 2, 2, 1); __PYX_ERR(50, 337, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setFASRestriction") < 0)) __PYX_ERR(50, 337, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_level = values[0]; __pyx_v_mat = ((struct PyPetscMatObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setFASRestriction", 1, 2, 2, __pyx_nargs); __PYX_ERR(50, 337, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SNES.setFASRestriction", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(50, 337, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_32setFASRestriction(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_level, __pyx_v_mat); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_32setFASRestriction(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level, struct PyPetscMatObject *__pyx_v_mat) { PetscInt __pyx_v_clevel; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFASRestriction", 1); /* "petsc4py/PETSc/SNES.pyx":348 * * """ * cdef PetscInt clevel = asInt(level) # <<<<<<<<<<<<<< * CHKERR( SNESFASSetRestriction(self.snes, clevel, mat.mat) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_level); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(50, 348, __pyx_L1_error) __pyx_v_clevel = __pyx_t_1; /* "petsc4py/PETSc/SNES.pyx":349 * """ * cdef PetscInt clevel = asInt(level) * CHKERR( SNESFASSetRestriction(self.snes, clevel, mat.mat) ) # <<<<<<<<<<<<<< * * def getFASRestriction(self, level: int) -> Mat: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESFASSetRestriction(__pyx_v_self->snes, __pyx_v_clevel, __pyx_v_mat->mat)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 349, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":337 * return mat * * def setFASRestriction(self, level: int, Mat mat) -> None: # <<<<<<<<<<<<<< * """Set the `Mat` to be used to apply the restriction from level-1 to level. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setFASRestriction", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":351 * CHKERR( SNESFASSetRestriction(self.snes, clevel, mat.mat) ) * * def getFASRestriction(self, level: int) -> Mat: # <<<<<<<<<<<<<< * """Return the `Mat` used to apply the restriction from level-1 to level. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_35getFASRestriction(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_34getFASRestriction, "SNES.getFASRestriction(self, level: int) -> Mat\nReturn the `Mat` used to apply the restriction from level-1 to level.\n\n Not collective.\n\n See Also\n --------\n setFASRestriction, petsc.SNESFASGetRestriction, petsc.SNESFAS\n\n \nSource code at petsc4py/PETSc/SNES.pyx:351"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_35getFASRestriction(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_level = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getFASRestriction (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_level)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 351, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getFASRestriction") < 0)) __PYX_ERR(50, 351, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_level = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getFASRestriction", 1, 1, 1, __pyx_nargs); __PYX_ERR(50, 351, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SNES.getFASRestriction", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_34getFASRestriction(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_level); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_34getFASRestriction(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level) { PetscInt __pyx_v_clevel; struct PyPetscMatObject *__pyx_v_mat = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getFASRestriction", 1); /* "petsc4py/PETSc/SNES.pyx":361 * * """ * cdef PetscInt clevel = asInt(level) # <<<<<<<<<<<<<< * cdef Mat mat = Mat() * CHKERR( SNESFASGetRestriction(self.snes, clevel, &mat.mat) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_level); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(50, 361, __pyx_L1_error) __pyx_v_clevel = __pyx_t_1; /* "petsc4py/PETSc/SNES.pyx":362 * """ * cdef PetscInt clevel = asInt(level) * cdef Mat mat = Mat() # <<<<<<<<<<<<<< * CHKERR( SNESFASGetRestriction(self.snes, clevel, &mat.mat) ) * CHKERR( PetscINCREF(mat.obj) ) */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_mat = ((struct PyPetscMatObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/SNES.pyx":363 * cdef PetscInt clevel = asInt(level) * cdef Mat mat = Mat() * CHKERR( SNESFASGetRestriction(self.snes, clevel, &mat.mat) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(mat.obj) ) * return mat */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESFASGetRestriction(__pyx_v_self->snes, __pyx_v_clevel, (&__pyx_v_mat->mat))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 363, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":364 * cdef Mat mat = Mat() * CHKERR( SNESFASGetRestriction(self.snes, clevel, &mat.mat) ) * CHKERR( PetscINCREF(mat.obj) ) # <<<<<<<<<<<<<< * return mat * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_mat->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 364, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":365 * CHKERR( SNESFASGetRestriction(self.snes, clevel, &mat.mat) ) * CHKERR( PetscINCREF(mat.obj) ) * return mat # <<<<<<<<<<<<<< * * def setFASInjection(self, level: int, Mat mat) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_mat); __pyx_r = ((PyObject *)__pyx_v_mat); goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":351 * CHKERR( SNESFASSetRestriction(self.snes, clevel, mat.mat) ) * * def getFASRestriction(self, level: int) -> Mat: # <<<<<<<<<<<<<< * """Return the `Mat` used to apply the restriction from level-1 to level. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getFASRestriction", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_mat); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":367 * return mat * * def setFASInjection(self, level: int, Mat mat) -> None: # <<<<<<<<<<<<<< * """Set the `Mat` to be used to apply the injection from level-1 to level. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_37setFASInjection(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_36setFASInjection, "SNES.setFASInjection(self, level: int, mat: Mat) -> None\nSet the `Mat` to be used to apply the injection from level-1 to level.\n\n Collective.\n\n See Also\n --------\n getFASInjection, setFASInterpolation, setFASRestriction\n petsc.SNESFASSetInjection, petsc.SNESFAS\n\n \nSource code at petsc4py/PETSc/SNES.pyx:367"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_37setFASInjection(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_level = 0; struct PyPetscMatObject *__pyx_v_mat = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFASInjection (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,&__pyx_n_s_mat,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_level)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 367, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mat)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 367, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setFASInjection", 1, 2, 2, 1); __PYX_ERR(50, 367, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setFASInjection") < 0)) __PYX_ERR(50, 367, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_level = values[0]; __pyx_v_mat = ((struct PyPetscMatObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setFASInjection", 1, 2, 2, __pyx_nargs); __PYX_ERR(50, 367, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SNES.setFASInjection", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(50, 367, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_36setFASInjection(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_level, __pyx_v_mat); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_36setFASInjection(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level, struct PyPetscMatObject *__pyx_v_mat) { PetscInt __pyx_v_clevel; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFASInjection", 1); /* "petsc4py/PETSc/SNES.pyx":378 * * """ * cdef PetscInt clevel = asInt(level) # <<<<<<<<<<<<<< * CHKERR( SNESFASSetInjection(self.snes, clevel, mat.mat) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_level); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(50, 378, __pyx_L1_error) __pyx_v_clevel = __pyx_t_1; /* "petsc4py/PETSc/SNES.pyx":379 * """ * cdef PetscInt clevel = asInt(level) * CHKERR( SNESFASSetInjection(self.snes, clevel, mat.mat) ) # <<<<<<<<<<<<<< * * def getFASInjection(self, level: int) -> Mat: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESFASSetInjection(__pyx_v_self->snes, __pyx_v_clevel, __pyx_v_mat->mat)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 379, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":367 * return mat * * def setFASInjection(self, level: int, Mat mat) -> None: # <<<<<<<<<<<<<< * """Set the `Mat` to be used to apply the injection from level-1 to level. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setFASInjection", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":381 * CHKERR( SNESFASSetInjection(self.snes, clevel, mat.mat) ) * * def getFASInjection(self, level: int) -> Mat: # <<<<<<<<<<<<<< * """Return the `Mat` used to apply the injection from level-1 to level. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_39getFASInjection(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_38getFASInjection, "SNES.getFASInjection(self, level: int) -> Mat\nReturn the `Mat` used to apply the injection from level-1 to level.\n\n Not collective.\n\n See Also\n --------\n setFASInjection, petsc.SNESFASGetInjection, petsc.SNESFAS\n\n \nSource code at petsc4py/PETSc/SNES.pyx:381"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_39getFASInjection(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_level = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getFASInjection (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_level)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 381, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getFASInjection") < 0)) __PYX_ERR(50, 381, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_level = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getFASInjection", 1, 1, 1, __pyx_nargs); __PYX_ERR(50, 381, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SNES.getFASInjection", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_38getFASInjection(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_level); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_38getFASInjection(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level) { PetscInt __pyx_v_clevel; struct PyPetscMatObject *__pyx_v_mat = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getFASInjection", 1); /* "petsc4py/PETSc/SNES.pyx":391 * * """ * cdef PetscInt clevel = asInt(level) # <<<<<<<<<<<<<< * cdef Mat mat = Mat() * CHKERR( SNESFASGetInjection(self.snes, clevel, &mat.mat) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_level); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(50, 391, __pyx_L1_error) __pyx_v_clevel = __pyx_t_1; /* "petsc4py/PETSc/SNES.pyx":392 * """ * cdef PetscInt clevel = asInt(level) * cdef Mat mat = Mat() # <<<<<<<<<<<<<< * CHKERR( SNESFASGetInjection(self.snes, clevel, &mat.mat) ) * CHKERR( PetscINCREF(mat.obj) ) */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_mat = ((struct PyPetscMatObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/SNES.pyx":393 * cdef PetscInt clevel = asInt(level) * cdef Mat mat = Mat() * CHKERR( SNESFASGetInjection(self.snes, clevel, &mat.mat) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(mat.obj) ) * return mat */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESFASGetInjection(__pyx_v_self->snes, __pyx_v_clevel, (&__pyx_v_mat->mat))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 393, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":394 * cdef Mat mat = Mat() * CHKERR( SNESFASGetInjection(self.snes, clevel, &mat.mat) ) * CHKERR( PetscINCREF(mat.obj) ) # <<<<<<<<<<<<<< * return mat * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_mat->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 394, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":395 * CHKERR( SNESFASGetInjection(self.snes, clevel, &mat.mat) ) * CHKERR( PetscINCREF(mat.obj) ) * return mat # <<<<<<<<<<<<<< * * def setFASRScale(self, level: int, Vec vec) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_mat); __pyx_r = ((PyObject *)__pyx_v_mat); goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":381 * CHKERR( SNESFASSetInjection(self.snes, clevel, mat.mat) ) * * def getFASInjection(self, level: int) -> Mat: # <<<<<<<<<<<<<< * """Return the `Mat` used to apply the injection from level-1 to level. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getFASInjection", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_mat); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":397 * return mat * * def setFASRScale(self, level: int, Vec vec) -> None: # <<<<<<<<<<<<<< * """Set the scaling factor of the restriction operator from level to level-1. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_41setFASRScale(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_40setFASRScale, "SNES.setFASRScale(self, level: int, vec: Vec) -> None\nSet the scaling factor of the restriction operator from level to level-1.\n\n Collective.\n\n See Also\n --------\n setFASRestriction, petsc.SNESFASSetRScale, petsc.SNESFAS\n\n \nSource code at petsc4py/PETSc/SNES.pyx:397"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_41setFASRScale(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_level = 0; struct PyPetscVecObject *__pyx_v_vec = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFASRScale (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,&__pyx_n_s_vec,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_level)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 397, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vec)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 397, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setFASRScale", 1, 2, 2, 1); __PYX_ERR(50, 397, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setFASRScale") < 0)) __PYX_ERR(50, 397, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_level = values[0]; __pyx_v_vec = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setFASRScale", 1, 2, 2, __pyx_nargs); __PYX_ERR(50, 397, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SNES.setFASRScale", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(50, 397, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_40setFASRScale(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_level, __pyx_v_vec); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_40setFASRScale(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level, struct PyPetscVecObject *__pyx_v_vec) { PetscInt __pyx_v_clevel; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFASRScale", 1); /* "petsc4py/PETSc/SNES.pyx":407 * * """ * cdef PetscInt clevel = asInt(level) # <<<<<<<<<<<<<< * CHKERR( SNESFASSetRScale(self.snes, clevel, vec.vec) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_level); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(50, 407, __pyx_L1_error) __pyx_v_clevel = __pyx_t_1; /* "petsc4py/PETSc/SNES.pyx":408 * """ * cdef PetscInt clevel = asInt(level) * CHKERR( SNESFASSetRScale(self.snes, clevel, vec.vec) ) # <<<<<<<<<<<<<< * * def setFASLevels(self, levels: int, comms: Sequence[Comm] = None) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESFASSetRScale(__pyx_v_self->snes, __pyx_v_clevel, __pyx_v_vec->vec)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 408, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":397 * return mat * * def setFASRScale(self, level: int, Vec vec) -> None: # <<<<<<<<<<<<<< * """Set the scaling factor of the restriction operator from level to level-1. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setFASRScale", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":410 * CHKERR( SNESFASSetRScale(self.snes, clevel, vec.vec) ) * * def setFASLevels(self, levels: int, comms: Sequence[Comm] = None) -> None: # <<<<<<<<<<<<<< * """Set the number of levels to use with FAS. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_43setFASLevels(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_42setFASLevels, "SNES.setFASLevels(self, levels: int, comms: Sequence[Comm] = None) -> None\nSet the number of levels to use with FAS.\n\n Collective.\n\n Parameters\n ----------\n levels\n The number of levels\n comms\n An optional sequence of communicators of length `levels`,\n or `None` for the default communicator `Sys.getDefaultComm`.\n\n See Also\n --------\n getFASLevels, petsc.SNESFASSetLevels, petsc.SNESFAS\n\n \nSource code at petsc4py/PETSc/SNES.pyx:410"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_43setFASLevels(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_levels = 0; PyObject *__pyx_v_comms = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFASLevels (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_levels,&__pyx_n_s_comms,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_levels)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 410, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comms); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 410, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setFASLevels") < 0)) __PYX_ERR(50, 410, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_levels = values[0]; __pyx_v_comms = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setFASLevels", 0, 1, 2, __pyx_nargs); __PYX_ERR(50, 410, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SNES.setFASLevels", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_42setFASLevels(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_levels, __pyx_v_comms); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_42setFASLevels(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_levels, PyObject *__pyx_v_comms) { PetscInt __pyx_v_clevels; MPI_Comm *__pyx_v_ccomms; Py_ssize_t __pyx_v_i; PyObject *__pyx_v_comm = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; Py_ssize_t __pyx_t_3; PyObject *__pyx_t_4 = NULL; PetscErrorCode __pyx_t_5; Py_ssize_t __pyx_t_6; PyObject *(*__pyx_t_7)(PyObject *); PyObject *__pyx_t_8 = NULL; MPI_Comm __pyx_t_9; int __pyx_t_10; int __pyx_t_11; char const *__pyx_t_12; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFASLevels", 1); /* "petsc4py/PETSc/SNES.pyx":428 * * """ * cdef PetscInt clevels = asInt(levels) # <<<<<<<<<<<<<< * cdef MPI_Comm *ccomms = NULL * cdef Py_ssize_t i = 0 */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_levels); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(50, 428, __pyx_L1_error) __pyx_v_clevels = __pyx_t_1; /* "petsc4py/PETSc/SNES.pyx":429 * """ * cdef PetscInt clevels = asInt(levels) * cdef MPI_Comm *ccomms = NULL # <<<<<<<<<<<<<< * cdef Py_ssize_t i = 0 * if comms is not None: */ __pyx_v_ccomms = NULL; /* "petsc4py/PETSc/SNES.pyx":430 * cdef PetscInt clevels = asInt(levels) * cdef MPI_Comm *ccomms = NULL * cdef Py_ssize_t i = 0 # <<<<<<<<<<<<<< * if comms is not None: * if clevels != len(comms): */ __pyx_v_i = 0; /* "petsc4py/PETSc/SNES.pyx":431 * cdef MPI_Comm *ccomms = NULL * cdef Py_ssize_t i = 0 * if comms is not None: # <<<<<<<<<<<<<< * if clevels != len(comms): * raise ValueError("Must provide as many communicators as levels") */ __pyx_t_2 = (__pyx_v_comms != Py_None); if (__pyx_t_2) { /* "petsc4py/PETSc/SNES.pyx":432 * cdef Py_ssize_t i = 0 * if comms is not None: * if clevels != len(comms): # <<<<<<<<<<<<<< * raise ValueError("Must provide as many communicators as levels") * CHKERR( PetscMalloc(sizeof(MPI_Comm)*clevels, &ccomms) ) */ __pyx_t_3 = PyObject_Length(__pyx_v_comms); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(50, 432, __pyx_L1_error) __pyx_t_2 = (__pyx_v_clevels != ((PetscInt)__pyx_t_3)); if (unlikely(__pyx_t_2)) { /* "petsc4py/PETSc/SNES.pyx":433 * if comms is not None: * if clevels != len(comms): * raise ValueError("Must provide as many communicators as levels") # <<<<<<<<<<<<<< * CHKERR( PetscMalloc(sizeof(MPI_Comm)*clevels, &ccomms) ) * try: */ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 433, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(50, 433, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":432 * cdef Py_ssize_t i = 0 * if comms is not None: * if clevels != len(comms): # <<<<<<<<<<<<<< * raise ValueError("Must provide as many communicators as levels") * CHKERR( PetscMalloc(sizeof(MPI_Comm)*clevels, &ccomms) ) */ } /* "petsc4py/PETSc/SNES.pyx":434 * if clevels != len(comms): * raise ValueError("Must provide as many communicators as levels") * CHKERR( PetscMalloc(sizeof(MPI_Comm)*clevels, &ccomms) ) # <<<<<<<<<<<<<< * try: * for i, comm in enumerate(comms): */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc(((sizeof(MPI_Comm)) * ((size_t)__pyx_v_clevels)), (&__pyx_v_ccomms))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 434, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":435 * raise ValueError("Must provide as many communicators as levels") * CHKERR( PetscMalloc(sizeof(MPI_Comm)*clevels, &ccomms) ) * try: # <<<<<<<<<<<<<< * for i, comm in enumerate(comms): * ccomms[i] = def_Comm(comm, MPI_COMM_NULL) */ /*try:*/ { /* "petsc4py/PETSc/SNES.pyx":436 * CHKERR( PetscMalloc(sizeof(MPI_Comm)*clevels, &ccomms) ) * try: * for i, comm in enumerate(comms): # <<<<<<<<<<<<<< * ccomms[i] = def_Comm(comm, MPI_COMM_NULL) * CHKERR( SNESFASSetLevels(self.snes, clevels, ccomms) ) */ __pyx_t_3 = 0; if (likely(PyList_CheckExact(__pyx_v_comms)) || PyTuple_CheckExact(__pyx_v_comms)) { __pyx_t_4 = __pyx_v_comms; __Pyx_INCREF(__pyx_t_4); __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_comms); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 436, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(50, 436, __pyx_L6_error) } for (;;) { if (likely(!__pyx_t_7)) { if (likely(PyList_CheckExact(__pyx_t_4))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(50, 436, __pyx_L6_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_8 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(50, 436, __pyx_L6_error) #else __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(50, 436, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_8); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(50, 436, __pyx_L6_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(50, 436, __pyx_L6_error) #else __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(50, 436, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_8); #endif } } else { __pyx_t_8 = __pyx_t_7(__pyx_t_4); if (unlikely(!__pyx_t_8)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(50, 436, __pyx_L6_error) } break; } __Pyx_GOTREF(__pyx_t_8); } __Pyx_XDECREF_SET(__pyx_v_comm, __pyx_t_8); __pyx_t_8 = 0; __pyx_v_i = __pyx_t_3; __pyx_t_3 = (__pyx_t_3 + 1); /* "petsc4py/PETSc/SNES.pyx":437 * try: * for i, comm in enumerate(comms): * ccomms[i] = def_Comm(comm, MPI_COMM_NULL) # <<<<<<<<<<<<<< * CHKERR( SNESFASSetLevels(self.snes, clevels, ccomms) ) * finally: */ __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, MPI_COMM_NULL); if (unlikely(__pyx_t_9 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(50, 437, __pyx_L6_error) (__pyx_v_ccomms[__pyx_v_i]) = __pyx_t_9; /* "petsc4py/PETSc/SNES.pyx":436 * CHKERR( PetscMalloc(sizeof(MPI_Comm)*clevels, &ccomms) ) * try: * for i, comm in enumerate(comms): # <<<<<<<<<<<<<< * ccomms[i] = def_Comm(comm, MPI_COMM_NULL) * CHKERR( SNESFASSetLevels(self.snes, clevels, ccomms) ) */ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/SNES.pyx":438 * for i, comm in enumerate(comms): * ccomms[i] = def_Comm(comm, MPI_COMM_NULL) * CHKERR( SNESFASSetLevels(self.snes, clevels, ccomms) ) # <<<<<<<<<<<<<< * finally: * CHKERR( PetscFree(ccomms) ) */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESFASSetLevels(__pyx_v_self->snes, __pyx_v_clevels, __pyx_v_ccomms)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 438, __pyx_L6_error) } /* "petsc4py/PETSc/SNES.pyx":440 * CHKERR( SNESFASSetLevels(self.snes, clevels, ccomms) ) * finally: * CHKERR( PetscFree(ccomms) ) # <<<<<<<<<<<<<< * else: * CHKERR( SNESFASSetLevels(self.snes, clevels, ccomms) ) */ /*finally:*/ { /*normal exit:*/{ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_ccomms)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 440, __pyx_L1_error) goto __pyx_L7; } __pyx_L6_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15) < 0)) __Pyx_ErrFetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); __pyx_t_10 = __pyx_lineno; __pyx_t_11 = __pyx_clineno; __pyx_t_12 = __pyx_filename; { __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_ccomms)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 440, __pyx_L12_error) } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18); } __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_ErrRestore(__pyx_t_13, __pyx_t_14, __pyx_t_15); __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_lineno = __pyx_t_10; __pyx_clineno = __pyx_t_11; __pyx_filename = __pyx_t_12; goto __pyx_L1_error; __pyx_L12_error:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18); } __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; goto __pyx_L1_error; } __pyx_L7:; } /* "petsc4py/PETSc/SNES.pyx":431 * cdef MPI_Comm *ccomms = NULL * cdef Py_ssize_t i = 0 * if comms is not None: # <<<<<<<<<<<<<< * if clevels != len(comms): * raise ValueError("Must provide as many communicators as levels") */ goto __pyx_L3; } /* "petsc4py/PETSc/SNES.pyx":442 * CHKERR( PetscFree(ccomms) ) * else: * CHKERR( SNESFASSetLevels(self.snes, clevels, ccomms) ) # <<<<<<<<<<<<<< * * def getFASLevels(self) -> int: */ /*else*/ { __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESFASSetLevels(__pyx_v_self->snes, __pyx_v_clevels, __pyx_v_ccomms)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 442, __pyx_L1_error) } __pyx_L3:; /* "petsc4py/PETSc/SNES.pyx":410 * CHKERR( SNESFASSetRScale(self.snes, clevel, vec.vec) ) * * def setFASLevels(self, levels: int, comms: Sequence[Comm] = None) -> None: # <<<<<<<<<<<<<< * """Set the number of levels to use with FAS. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("petsc4py.PETSc.SNES.setFASLevels", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_comm); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":444 * CHKERR( SNESFASSetLevels(self.snes, clevels, ccomms) ) * * def getFASLevels(self) -> int: # <<<<<<<<<<<<<< * """Return the number of levels used. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_45getFASLevels(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_44getFASLevels, "SNES.getFASLevels(self) -> int\nReturn the number of levels used.\n\n Not collective.\n\n See Also\n --------\n setFASLevels, petsc.SNESFASGetLevels, petsc.SNESFAS\n\n \nSource code at petsc4py/PETSc/SNES.pyx:444"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_45getFASLevels(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getFASLevels (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getFASLevels", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getFASLevels", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_44getFASLevels(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_44getFASLevels(struct PyPetscSNESObject *__pyx_v_self) { PetscInt __pyx_v_levels; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getFASLevels", 1); /* "petsc4py/PETSc/SNES.pyx":454 * * """ * cdef PetscInt levels = 0 # <<<<<<<<<<<<<< * CHKERR( SNESFASGetLevels(self.snes, &levels) ) * return toInt(levels) */ __pyx_v_levels = 0; /* "petsc4py/PETSc/SNES.pyx":455 * """ * cdef PetscInt levels = 0 * CHKERR( SNESFASGetLevels(self.snes, &levels) ) # <<<<<<<<<<<<<< * return toInt(levels) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESFASGetLevels(__pyx_v_self->snes, (&__pyx_v_levels))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 455, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":456 * cdef PetscInt levels = 0 * CHKERR( SNESFASGetLevels(self.snes, &levels) ) * return toInt(levels) # <<<<<<<<<<<<<< * * def getFASCycleSNES(self, level: int) -> SNES: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_levels); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 456, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":444 * CHKERR( SNESFASSetLevels(self.snes, clevels, ccomms) ) * * def getFASLevels(self) -> int: # <<<<<<<<<<<<<< * """Return the number of levels used. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getFASLevels", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":458 * return toInt(levels) * * def getFASCycleSNES(self, level: int) -> SNES: # <<<<<<<<<<<<<< * """Return the `SNES` corresponding to a particular level of the FAS hierarchy. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_47getFASCycleSNES(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_46getFASCycleSNES, "SNES.getFASCycleSNES(self, level: int) -> SNES\nReturn the `SNES` corresponding to a particular level of the FAS hierarchy.\n\n Not collective.\n\n See Also\n --------\n setFASLevels, getFASCoarseSolve, getFASSmoother\n petsc.SNESFASGetCycleSNES, petsc.SNESFAS\n\n \nSource code at petsc4py/PETSc/SNES.pyx:458"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_47getFASCycleSNES(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_level = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getFASCycleSNES (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_level)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 458, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getFASCycleSNES") < 0)) __PYX_ERR(50, 458, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_level = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getFASCycleSNES", 1, 1, 1, __pyx_nargs); __PYX_ERR(50, 458, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SNES.getFASCycleSNES", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_46getFASCycleSNES(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_level); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_46getFASCycleSNES(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level) { PetscInt __pyx_v_clevel; struct PyPetscSNESObject *__pyx_v_lsnes = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getFASCycleSNES", 1); /* "petsc4py/PETSc/SNES.pyx":469 * * """ * cdef PetscInt clevel = asInt(level) # <<<<<<<<<<<<<< * cdef SNES lsnes = SNES() * CHKERR( SNESFASGetCycleSNES(self.snes, clevel, &lsnes.snes) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_level); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(50, 469, __pyx_L1_error) __pyx_v_clevel = __pyx_t_1; /* "petsc4py/PETSc/SNES.pyx":470 * """ * cdef PetscInt clevel = asInt(level) * cdef SNES lsnes = SNES() # <<<<<<<<<<<<<< * CHKERR( SNESFASGetCycleSNES(self.snes, clevel, &lsnes.snes) ) * CHKERR( PetscINCREF(lsnes.obj) ) */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SNES)); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_lsnes = ((struct PyPetscSNESObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/SNES.pyx":471 * cdef PetscInt clevel = asInt(level) * cdef SNES lsnes = SNES() * CHKERR( SNESFASGetCycleSNES(self.snes, clevel, &lsnes.snes) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(lsnes.obj) ) * return lsnes */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESFASGetCycleSNES(__pyx_v_self->snes, __pyx_v_clevel, (&__pyx_v_lsnes->snes))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 471, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":472 * cdef SNES lsnes = SNES() * CHKERR( SNESFASGetCycleSNES(self.snes, clevel, &lsnes.snes) ) * CHKERR( PetscINCREF(lsnes.obj) ) # <<<<<<<<<<<<<< * return lsnes * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_lsnes->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 472, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":473 * CHKERR( SNESFASGetCycleSNES(self.snes, clevel, &lsnes.snes) ) * CHKERR( PetscINCREF(lsnes.obj) ) * return lsnes # <<<<<<<<<<<<<< * * def getFASCoarseSolve(self) -> SNES: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_lsnes); __pyx_r = ((PyObject *)__pyx_v_lsnes); goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":458 * return toInt(levels) * * def getFASCycleSNES(self, level: int) -> SNES: # <<<<<<<<<<<<<< * """Return the `SNES` corresponding to a particular level of the FAS hierarchy. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getFASCycleSNES", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_lsnes); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":475 * return lsnes * * def getFASCoarseSolve(self) -> SNES: # <<<<<<<<<<<<<< * """Return the `SNES` used at the coarsest level of the FAS hierarchy. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_49getFASCoarseSolve(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_48getFASCoarseSolve, "SNES.getFASCoarseSolve(self) -> SNES\nReturn the `SNES` used at the coarsest level of the FAS hierarchy.\n\n Not collective.\n\n See Also\n --------\n getFASSmoother, petsc.SNESFASGetCoarseSolve, petsc.SNESFAS\n\n \nSource code at petsc4py/PETSc/SNES.pyx:475"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_49getFASCoarseSolve(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getFASCoarseSolve (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getFASCoarseSolve", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getFASCoarseSolve", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_48getFASCoarseSolve(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_48getFASCoarseSolve(struct PyPetscSNESObject *__pyx_v_self) { struct PyPetscSNESObject *__pyx_v_smooth = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getFASCoarseSolve", 1); /* "petsc4py/PETSc/SNES.pyx":485 * * """ * cdef SNES smooth = SNES() # <<<<<<<<<<<<<< * CHKERR( SNESFASGetCoarseSolve(self.snes, &smooth.snes) ) * CHKERR( PetscINCREF(smooth.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SNES)); if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_smooth = ((struct PyPetscSNESObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/SNES.pyx":486 * """ * cdef SNES smooth = SNES() * CHKERR( SNESFASGetCoarseSolve(self.snes, &smooth.snes) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(smooth.obj) ) * return smooth */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESFASGetCoarseSolve(__pyx_v_self->snes, (&__pyx_v_smooth->snes))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 486, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":487 * cdef SNES smooth = SNES() * CHKERR( SNESFASGetCoarseSolve(self.snes, &smooth.snes) ) * CHKERR( PetscINCREF(smooth.obj) ) # <<<<<<<<<<<<<< * return smooth * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_smooth->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 487, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":488 * CHKERR( SNESFASGetCoarseSolve(self.snes, &smooth.snes) ) * CHKERR( PetscINCREF(smooth.obj) ) * return smooth # <<<<<<<<<<<<<< * * def getFASSmoother(self, level: int) -> SNES: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_smooth); __pyx_r = ((PyObject *)__pyx_v_smooth); goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":475 * return lsnes * * def getFASCoarseSolve(self) -> SNES: # <<<<<<<<<<<<<< * """Return the `SNES` used at the coarsest level of the FAS hierarchy. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getFASCoarseSolve", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_smooth); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":490 * return smooth * * def getFASSmoother(self, level: int) -> SNES: # <<<<<<<<<<<<<< * """Return the smoother used at a given level of the FAS hierarchy. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_51getFASSmoother(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_50getFASSmoother, "SNES.getFASSmoother(self, level: int) -> SNES\nReturn the smoother used at a given level of the FAS hierarchy.\n\n Not collective.\n\n See Also\n --------\n setFASLevels, getFASCoarseSolve, getFASSmootherDown, getFASSmootherUp\n petsc.SNESFASGetSmoother, petsc.SNESFAS\n\n \nSource code at petsc4py/PETSc/SNES.pyx:490"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_51getFASSmoother(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_level = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getFASSmoother (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_level)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 490, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getFASSmoother") < 0)) __PYX_ERR(50, 490, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_level = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getFASSmoother", 1, 1, 1, __pyx_nargs); __PYX_ERR(50, 490, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SNES.getFASSmoother", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_50getFASSmoother(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_level); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_50getFASSmoother(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level) { PetscInt __pyx_v_clevel; struct PyPetscSNESObject *__pyx_v_smooth = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getFASSmoother", 1); /* "petsc4py/PETSc/SNES.pyx":501 * * """ * cdef PetscInt clevel = asInt(level) # <<<<<<<<<<<<<< * cdef SNES smooth = SNES() * CHKERR( SNESFASGetSmoother(self.snes, clevel, &smooth.snes) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_level); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(50, 501, __pyx_L1_error) __pyx_v_clevel = __pyx_t_1; /* "petsc4py/PETSc/SNES.pyx":502 * """ * cdef PetscInt clevel = asInt(level) * cdef SNES smooth = SNES() # <<<<<<<<<<<<<< * CHKERR( SNESFASGetSmoother(self.snes, clevel, &smooth.snes) ) * CHKERR( PetscINCREF(smooth.obj) ) */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SNES)); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 502, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_smooth = ((struct PyPetscSNESObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/SNES.pyx":503 * cdef PetscInt clevel = asInt(level) * cdef SNES smooth = SNES() * CHKERR( SNESFASGetSmoother(self.snes, clevel, &smooth.snes) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(smooth.obj) ) * return smooth */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESFASGetSmoother(__pyx_v_self->snes, __pyx_v_clevel, (&__pyx_v_smooth->snes))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 503, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":504 * cdef SNES smooth = SNES() * CHKERR( SNESFASGetSmoother(self.snes, clevel, &smooth.snes) ) * CHKERR( PetscINCREF(smooth.obj) ) # <<<<<<<<<<<<<< * return smooth * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_smooth->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 504, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":505 * CHKERR( SNESFASGetSmoother(self.snes, clevel, &smooth.snes) ) * CHKERR( PetscINCREF(smooth.obj) ) * return smooth # <<<<<<<<<<<<<< * * def getFASSmootherDown(self, level: int) -> SNES: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_smooth); __pyx_r = ((PyObject *)__pyx_v_smooth); goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":490 * return smooth * * def getFASSmoother(self, level: int) -> SNES: # <<<<<<<<<<<<<< * """Return the smoother used at a given level of the FAS hierarchy. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getFASSmoother", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_smooth); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":507 * return smooth * * def getFASSmootherDown(self, level: int) -> SNES: # <<<<<<<<<<<<<< * """Return the downsmoother used at a given level of the FAS hierarchy. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_53getFASSmootherDown(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_52getFASSmootherDown, "SNES.getFASSmootherDown(self, level: int) -> SNES\nReturn the downsmoother used at a given level of the FAS hierarchy.\n\n Not collective.\n\n See Also\n --------\n setFASLevels, getFASCoarseSolve, getFASSmoother, getFASSmootherUp\n petsc.SNESFASGetSmootherDown, petsc.SNESFAS\n\n \nSource code at petsc4py/PETSc/SNES.pyx:507"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_53getFASSmootherDown(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_level = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getFASSmootherDown (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_level)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 507, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getFASSmootherDown") < 0)) __PYX_ERR(50, 507, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_level = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getFASSmootherDown", 1, 1, 1, __pyx_nargs); __PYX_ERR(50, 507, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SNES.getFASSmootherDown", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_52getFASSmootherDown(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_level); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_52getFASSmootherDown(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level) { PetscInt __pyx_v_clevel; struct PyPetscSNESObject *__pyx_v_smooth = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getFASSmootherDown", 1); /* "petsc4py/PETSc/SNES.pyx":518 * * """ * cdef PetscInt clevel = asInt(level) # <<<<<<<<<<<<<< * cdef SNES smooth = SNES() * CHKERR( SNESFASGetSmootherDown(self.snes, clevel, &smooth.snes) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_level); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(50, 518, __pyx_L1_error) __pyx_v_clevel = __pyx_t_1; /* "petsc4py/PETSc/SNES.pyx":519 * """ * cdef PetscInt clevel = asInt(level) * cdef SNES smooth = SNES() # <<<<<<<<<<<<<< * CHKERR( SNESFASGetSmootherDown(self.snes, clevel, &smooth.snes) ) * CHKERR( PetscINCREF(smooth.obj) ) */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SNES)); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 519, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_smooth = ((struct PyPetscSNESObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/SNES.pyx":520 * cdef PetscInt clevel = asInt(level) * cdef SNES smooth = SNES() * CHKERR( SNESFASGetSmootherDown(self.snes, clevel, &smooth.snes) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(smooth.obj) ) * return smooth */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESFASGetSmootherDown(__pyx_v_self->snes, __pyx_v_clevel, (&__pyx_v_smooth->snes))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 520, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":521 * cdef SNES smooth = SNES() * CHKERR( SNESFASGetSmootherDown(self.snes, clevel, &smooth.snes) ) * CHKERR( PetscINCREF(smooth.obj) ) # <<<<<<<<<<<<<< * return smooth * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_smooth->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 521, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":522 * CHKERR( SNESFASGetSmootherDown(self.snes, clevel, &smooth.snes) ) * CHKERR( PetscINCREF(smooth.obj) ) * return smooth # <<<<<<<<<<<<<< * * def getFASSmootherUp(self, level: int) -> SNES: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_smooth); __pyx_r = ((PyObject *)__pyx_v_smooth); goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":507 * return smooth * * def getFASSmootherDown(self, level: int) -> SNES: # <<<<<<<<<<<<<< * """Return the downsmoother used at a given level of the FAS hierarchy. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getFASSmootherDown", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_smooth); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":524 * return smooth * * def getFASSmootherUp(self, level: int) -> SNES: # <<<<<<<<<<<<<< * """Return the upsmoother used at a given level of the FAS hierarchy. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_55getFASSmootherUp(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_54getFASSmootherUp, "SNES.getFASSmootherUp(self, level: int) -> SNES\nReturn the upsmoother used at a given level of the FAS hierarchy.\n\n Not collective.\n\n See Also\n --------\n setFASLevels, getFASCoarseSolve, getFASSmoother, getFASSmootherDown\n petsc.SNESFASGetSmootherUp, petsc.SNESFAS\n\n \nSource code at petsc4py/PETSc/SNES.pyx:524"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_55getFASSmootherUp(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_level = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getFASSmootherUp (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_level)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 524, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getFASSmootherUp") < 0)) __PYX_ERR(50, 524, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_level = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getFASSmootherUp", 1, 1, 1, __pyx_nargs); __PYX_ERR(50, 524, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SNES.getFASSmootherUp", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_54getFASSmootherUp(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_level); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_54getFASSmootherUp(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level) { PetscInt __pyx_v_clevel; struct PyPetscSNESObject *__pyx_v_smooth = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getFASSmootherUp", 1); /* "petsc4py/PETSc/SNES.pyx":535 * * """ * cdef PetscInt clevel = asInt(level) # <<<<<<<<<<<<<< * cdef SNES smooth = SNES() * CHKERR( SNESFASGetSmootherUp(self.snes, clevel, &smooth.snes) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_level); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(50, 535, __pyx_L1_error) __pyx_v_clevel = __pyx_t_1; /* "petsc4py/PETSc/SNES.pyx":536 * """ * cdef PetscInt clevel = asInt(level) * cdef SNES smooth = SNES() # <<<<<<<<<<<<<< * CHKERR( SNESFASGetSmootherUp(self.snes, clevel, &smooth.snes) ) * CHKERR( PetscINCREF(smooth.obj) ) */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SNES)); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 536, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_smooth = ((struct PyPetscSNESObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/SNES.pyx":537 * cdef PetscInt clevel = asInt(level) * cdef SNES smooth = SNES() * CHKERR( SNESFASGetSmootherUp(self.snes, clevel, &smooth.snes) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(smooth.obj) ) * return smooth */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESFASGetSmootherUp(__pyx_v_self->snes, __pyx_v_clevel, (&__pyx_v_smooth->snes))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 537, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":538 * cdef SNES smooth = SNES() * CHKERR( SNESFASGetSmootherUp(self.snes, clevel, &smooth.snes) ) * CHKERR( PetscINCREF(smooth.obj) ) # <<<<<<<<<<<<<< * return smooth * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_smooth->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 538, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":539 * CHKERR( SNESFASGetSmootherUp(self.snes, clevel, &smooth.snes) ) * CHKERR( PetscINCREF(smooth.obj) ) * return smooth # <<<<<<<<<<<<<< * * # --- nonlinear preconditioner --- */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_smooth); __pyx_r = ((PyObject *)__pyx_v_smooth); goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":524 * return smooth * * def getFASSmootherUp(self, level: int) -> SNES: # <<<<<<<<<<<<<< * """Return the upsmoother used at a given level of the FAS hierarchy. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getFASSmootherUp", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_smooth); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":543 * # --- nonlinear preconditioner --- * * def getNPC(self) -> SNES: # <<<<<<<<<<<<<< * """Return the nonlinear preconditioner associated with the solver. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_57getNPC(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_56getNPC, "SNES.getNPC(self) -> SNES\nReturn the nonlinear preconditioner associated with the solver.\n\n Not collective.\n\n See Also\n --------\n setNPC, hasNPC, setNPCSide, getNPCSide, petsc.SNESGetNPC\n\n \nSource code at petsc4py/PETSc/SNES.pyx:543"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_57getNPC(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getNPC (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getNPC", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getNPC", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_56getNPC(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_56getNPC(struct PyPetscSNESObject *__pyx_v_self) { struct PyPetscSNESObject *__pyx_v_snes = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getNPC", 1); /* "petsc4py/PETSc/SNES.pyx":553 * * """ * cdef SNES snes = SNES() # <<<<<<<<<<<<<< * CHKERR( SNESGetNPC(self.snes, &snes.snes) ) * CHKERR( PetscINCREF(snes.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SNES)); if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_snes = ((struct PyPetscSNESObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/SNES.pyx":554 * """ * cdef SNES snes = SNES() * CHKERR( SNESGetNPC(self.snes, &snes.snes) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(snes.obj) ) * return snes */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetNPC(__pyx_v_self->snes, (&__pyx_v_snes->snes))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 554, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":555 * cdef SNES snes = SNES() * CHKERR( SNESGetNPC(self.snes, &snes.snes) ) * CHKERR( PetscINCREF(snes.obj) ) # <<<<<<<<<<<<<< * return snes * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_snes->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 555, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":556 * CHKERR( SNESGetNPC(self.snes, &snes.snes) ) * CHKERR( PetscINCREF(snes.obj) ) * return snes # <<<<<<<<<<<<<< * * def hasNPC(self) -> bool: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_snes); __pyx_r = ((PyObject *)__pyx_v_snes); goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":543 * # --- nonlinear preconditioner --- * * def getNPC(self) -> SNES: # <<<<<<<<<<<<<< * """Return the nonlinear preconditioner associated with the solver. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getNPC", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_snes); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":558 * return snes * * def hasNPC(self) -> bool: # <<<<<<<<<<<<<< * """Return a boolean indicating whether the solver has a nonlinear preconditioner. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_59hasNPC(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_58hasNPC, "SNES.hasNPC(self) -> bool\nReturn a boolean indicating whether the solver has a nonlinear preconditioner.\n\n Not collective.\n\n See Also\n --------\n setNPC, getNPC, setNPCSide, getNPCSide, petsc.SNESHasNPC\n\n \nSource code at petsc4py/PETSc/SNES.pyx:558"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_59hasNPC(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("hasNPC (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("hasNPC", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "hasNPC", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_58hasNPC(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_58hasNPC(struct PyPetscSNESObject *__pyx_v_self) { PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("hasNPC", 1); /* "petsc4py/PETSc/SNES.pyx":568 * * """ * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( SNESHasNPC(self.snes, &flag) ) * return toBool(flag) */ __pyx_v_flag = PETSC_FALSE; /* "petsc4py/PETSc/SNES.pyx":569 * """ * cdef PetscBool flag = PETSC_FALSE * CHKERR( SNESHasNPC(self.snes, &flag) ) # <<<<<<<<<<<<<< * return toBool(flag) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESHasNPC(__pyx_v_self->snes, (&__pyx_v_flag))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 569, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":570 * cdef PetscBool flag = PETSC_FALSE * CHKERR( SNESHasNPC(self.snes, &flag) ) * return toBool(flag) # <<<<<<<<<<<<<< * * def setNPC(self, SNES snes) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 570, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":558 * return snes * * def hasNPC(self) -> bool: # <<<<<<<<<<<<<< * """Return a boolean indicating whether the solver has a nonlinear preconditioner. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.hasNPC", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":572 * return toBool(flag) * * def setNPC(self, SNES snes) -> None: # <<<<<<<<<<<<<< * """Set the nonlinear preconditioner. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_61setNPC(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_60setNPC, "SNES.setNPC(self, snes: SNES) -> None\nSet the nonlinear preconditioner.\n\n Logically collective.\n\n See Also\n --------\n getNPC, hasNPC, setNPCSide, getNPCSide, petsc.SNESSetNPC\n\n \nSource code at petsc4py/PETSc/SNES.pyx:572"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_61setNPC(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscSNESObject *__pyx_v_snes = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setNPC (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_snes,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_snes)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 572, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setNPC") < 0)) __PYX_ERR(50, 572, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_snes = ((struct PyPetscSNESObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setNPC", 1, 1, 1, __pyx_nargs); __PYX_ERR(50, 572, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SNES.setNPC", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_snes), __pyx_ptype_8petsc4py_5PETSc_SNES, 0, "snes", 0))) __PYX_ERR(50, 572, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_60setNPC(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_snes); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_60setNPC(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscSNESObject *__pyx_v_snes) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setNPC", 1); /* "petsc4py/PETSc/SNES.pyx":582 * * """ * CHKERR( SNESSetNPC(self.snes, snes.snes) ) # <<<<<<<<<<<<<< * * def setNPCSide(self, side: PC.Side) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetNPC(__pyx_v_self->snes, __pyx_v_snes->snes)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 582, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":572 * return toBool(flag) * * def setNPC(self, SNES snes) -> None: # <<<<<<<<<<<<<< * """Set the nonlinear preconditioner. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setNPC", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":584 * CHKERR( SNESSetNPC(self.snes, snes.snes) ) * * def setNPCSide(self, side: PC.Side) -> None: # <<<<<<<<<<<<<< * """Set the nonlinear preconditioning side. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_63setNPCSide(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_62setNPCSide, "SNES.setNPCSide(self, side: PC.Side) -> None\nSet the nonlinear preconditioning side.\n\n Collective.\n\n See Also\n --------\n setNPC, getNPC, hasNPC, getNPCSide, petsc.SNESSetNPCSide\n\n \nSource code at petsc4py/PETSc/SNES.pyx:584"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_63setNPCSide(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_side = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setNPCSide (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_side,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_side)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 584, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setNPCSide") < 0)) __PYX_ERR(50, 584, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_side = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setNPCSide", 1, 1, 1, __pyx_nargs); __PYX_ERR(50, 584, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SNES.setNPCSide", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_62setNPCSide(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_side); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_62setNPCSide(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_side) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PCSide __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setNPCSide", 1); /* "petsc4py/PETSc/SNES.pyx":594 * * """ * CHKERR( SNESSetNPCSide(self.snes, side) ) # <<<<<<<<<<<<<< * * def getNPCSide(self) -> PC.Side: */ __pyx_t_1 = ((PCSide)__Pyx_PyInt_As_PCSide(__pyx_v_side)); if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 594, __pyx_L1_error) __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetNPCSide(__pyx_v_self->snes, __pyx_t_1)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 594, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":584 * CHKERR( SNESSetNPC(self.snes, snes.snes) ) * * def setNPCSide(self, side: PC.Side) -> None: # <<<<<<<<<<<<<< * """Set the nonlinear preconditioning side. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setNPCSide", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":596 * CHKERR( SNESSetNPCSide(self.snes, side) ) * * def getNPCSide(self) -> PC.Side: # <<<<<<<<<<<<<< * """Return the nonlinear preconditioning side. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_65getNPCSide(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_64getNPCSide, "SNES.getNPCSide(self) -> PC.Side\nReturn the nonlinear preconditioning side.\n\n Not collective.\n\n See Also\n --------\n setNPC, getNPC, hasNPC, setNPCSide, petsc.SNESGetNPCSide\n\n \nSource code at petsc4py/PETSc/SNES.pyx:596"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_65getNPCSide(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getNPCSide (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getNPCSide", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getNPCSide", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_64getNPCSide(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_64getNPCSide(struct PyPetscSNESObject *__pyx_v_self) { PCSide __pyx_v_side; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getNPCSide", 1); /* "petsc4py/PETSc/SNES.pyx":606 * * """ * cdef PetscPCSide side = PC_RIGHT # <<<<<<<<<<<<<< * CHKERR( SNESGetNPCSide(self.snes, &side) ) * return side */ __pyx_v_side = PC_RIGHT; /* "petsc4py/PETSc/SNES.pyx":607 * """ * cdef PetscPCSide side = PC_RIGHT * CHKERR( SNESGetNPCSide(self.snes, &side) ) # <<<<<<<<<<<<<< * return side * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetNPCSide(__pyx_v_self->snes, (&__pyx_v_side))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 607, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":608 * cdef PetscPCSide side = PC_RIGHT * CHKERR( SNESGetNPCSide(self.snes, &side) ) * return side # <<<<<<<<<<<<<< * * # --- user Function/Jacobian routines --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_PCSide(__pyx_v_side); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 608, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":596 * CHKERR( SNESSetNPCSide(self.snes, side) ) * * def getNPCSide(self) -> PC.Side: # <<<<<<<<<<<<<< * """Return the nonlinear preconditioning side. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getNPCSide", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":612 * # --- user Function/Jacobian routines --- * * def setLineSearchPreCheck(self, precheck: SNESLSPreFunction, # <<<<<<<<<<<<<< * args: tuple[Any, ...] | None = None, * kargs: dict[str, Any] | None = None) -> None: */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_67setLineSearchPreCheck(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_66setLineSearchPreCheck, "SNES.setLineSearchPreCheck(self, precheck: SNESLSPreFunction, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nSet the callback that will be called before applying the linesearch.\n\n Logically collective.\n\n Parameters\n ----------\n precheck\n The callback.\n args\n Positional arguments for the callback.\n kargs\n Keyword arguments for the callback.\n\n See Also\n --------\n petsc.SNESLineSearchSetPreCheck\n\n \nSource code at petsc4py/PETSc/SNES.pyx:612"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_67setLineSearchPreCheck(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_precheck = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setLineSearchPreCheck (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_precheck,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; /* "petsc4py/PETSc/SNES.pyx":613 * * def setLineSearchPreCheck(self, precheck: SNESLSPreFunction, * args: tuple[Any, ...] | None = None, # <<<<<<<<<<<<<< * kargs: dict[str, Any] | None = None) -> None: * """Set the callback that will be called before applying the linesearch. */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/SNES.pyx":614 * def setLineSearchPreCheck(self, precheck: SNESLSPreFunction, * args: tuple[Any, ...] | None = None, * kargs: dict[str, Any] | None = None) -> None: # <<<<<<<<<<<<<< * """Set the callback that will be called before applying the linesearch. * */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_precheck)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 612, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 612, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 612, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setLineSearchPreCheck") < 0)) __PYX_ERR(50, 612, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_precheck = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setLineSearchPreCheck", 0, 1, 3, __pyx_nargs); __PYX_ERR(50, 612, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SNES.setLineSearchPreCheck", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_66setLineSearchPreCheck(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_precheck, __pyx_v_args, __pyx_v_kargs); /* "petsc4py/PETSc/SNES.pyx":612 * # --- user Function/Jacobian routines --- * * def setLineSearchPreCheck(self, precheck: SNESLSPreFunction, # <<<<<<<<<<<<<< * args: tuple[Any, ...] | None = None, * kargs: dict[str, Any] | None = None) -> None: */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_66setLineSearchPreCheck(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_precheck, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { SNESLineSearch __pyx_v_snesls; PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setLineSearchPreCheck", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/SNES.pyx":633 * * """ * cdef PetscSNESLineSearch snesls = NULL # <<<<<<<<<<<<<< * CHKERR( SNESGetLineSearch(self.snes, &snesls) ) * if precheck is not None: */ __pyx_v_snesls = NULL; /* "petsc4py/PETSc/SNES.pyx":634 * """ * cdef PetscSNESLineSearch snesls = NULL * CHKERR( SNESGetLineSearch(self.snes, &snesls) ) # <<<<<<<<<<<<<< * if precheck is not None: * if args is None: args = () */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetLineSearch(__pyx_v_self->snes, (&__pyx_v_snesls))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 634, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":635 * cdef PetscSNESLineSearch snesls = NULL * CHKERR( SNESGetLineSearch(self.snes, &snesls) ) * if precheck is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_2 = (__pyx_v_precheck != Py_None); if (__pyx_t_2) { /* "petsc4py/PETSc/SNES.pyx":636 * CHKERR( SNESGetLineSearch(self.snes, &snesls) ) * if precheck is not None: * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (precheck, args, kargs) */ __pyx_t_2 = (__pyx_v_args == Py_None); if (__pyx_t_2) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/SNES.pyx":637 * if precheck is not None: * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (precheck, args, kargs) * self.set_attr('__precheck__', context) */ __pyx_t_2 = (__pyx_v_kargs == Py_None); if (__pyx_t_2) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(50, 637, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "petsc4py/PETSc/SNES.pyx":638 * if args is None: args = () * if kargs is None: kargs = {} * context = (precheck, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__precheck__', context) * # FIXME callback */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(50, 638, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_precheck); __Pyx_GIVEREF(__pyx_v_precheck); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_precheck)) __PYX_ERR(50, 638, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args)) __PYX_ERR(50, 638, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs)) __PYX_ERR(50, 638, __pyx_L1_error); __pyx_v_context = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/SNES.pyx":639 * if kargs is None: kargs = {} * context = (precheck, args, kargs) * self.set_attr('__precheck__', context) # <<<<<<<<<<<<<< * # FIXME callback * CHKERR( SNESLineSearchSetPreCheck(snesls, SNES_PreCheck, context) ) */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__precheck__"), __pyx_v_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(50, 639, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/SNES.pyx":641 * self.set_attr('__precheck__', context) * # FIXME callback * CHKERR( SNESLineSearchSetPreCheck(snesls, SNES_PreCheck, context) ) # <<<<<<<<<<<<<< * else: * self.set_attr('__precheck__', None) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESLineSearchSetPreCheck(__pyx_v_snesls, __pyx_f_8petsc4py_5PETSc_SNES_PreCheck, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 641, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":635 * cdef PetscSNESLineSearch snesls = NULL * CHKERR( SNESGetLineSearch(self.snes, &snesls) ) * if precheck is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ goto __pyx_L3; } /* "petsc4py/PETSc/SNES.pyx":643 * CHKERR( SNESLineSearchSetPreCheck(snesls, SNES_PreCheck, context) ) * else: * self.set_attr('__precheck__', None) # <<<<<<<<<<<<<< * CHKERR( SNESLineSearchSetPreCheck(snesls, NULL, NULL) ) * */ /*else*/ { __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__precheck__"), Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(50, 643, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/SNES.pyx":644 * else: * self.set_attr('__precheck__', None) * CHKERR( SNESLineSearchSetPreCheck(snesls, NULL, NULL) ) # <<<<<<<<<<<<<< * * def setInitialGuess(self, initialguess: SNESGuessFunction, */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESLineSearchSetPreCheck(__pyx_v_snesls, NULL, NULL)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 644, __pyx_L1_error) } __pyx_L3:; /* "petsc4py/PETSc/SNES.pyx":612 * # --- user Function/Jacobian routines --- * * def setLineSearchPreCheck(self, precheck: SNESLSPreFunction, # <<<<<<<<<<<<<< * args: tuple[Any, ...] | None = None, * kargs: dict[str, Any] | None = None) -> None: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.setLineSearchPreCheck", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":646 * CHKERR( SNESLineSearchSetPreCheck(snesls, NULL, NULL) ) * * def setInitialGuess(self, initialguess: SNESGuessFunction, # <<<<<<<<<<<<<< * args: tuple[Any, ...] | None = None, * kargs: dict[str, Any] | None = None) -> None: */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_69setInitialGuess(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_68setInitialGuess, "SNES.setInitialGuess(self, initialguess: SNESGuessFunction, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nSet the callback to compute the initial guess.\n\n Logically collective.\n\n Parameters\n ----------\n initialguess\n The callback.\n args\n Positional arguments for the callback.\n kargs\n Keyword arguments for the callback.\n\n See Also\n --------\n getInitialGuess, petsc.SNESSetComputeInitialGuess\n\n \nSource code at petsc4py/PETSc/SNES.pyx:646"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_69setInitialGuess(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_initialguess = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setInitialGuess (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_initialguess,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; /* "petsc4py/PETSc/SNES.pyx":647 * * def setInitialGuess(self, initialguess: SNESGuessFunction, * args: tuple[Any, ...] | None = None, # <<<<<<<<<<<<<< * kargs: dict[str, Any] | None = None) -> None: * """Set the callback to compute the initial guess. */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/SNES.pyx":648 * def setInitialGuess(self, initialguess: SNESGuessFunction, * args: tuple[Any, ...] | None = None, * kargs: dict[str, Any] | None = None) -> None: # <<<<<<<<<<<<<< * """Set the callback to compute the initial guess. * */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_initialguess)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 646, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 646, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 646, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setInitialGuess") < 0)) __PYX_ERR(50, 646, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_initialguess = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setInitialGuess", 0, 1, 3, __pyx_nargs); __PYX_ERR(50, 646, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SNES.setInitialGuess", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_68setInitialGuess(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_initialguess, __pyx_v_args, __pyx_v_kargs); /* "petsc4py/PETSc/SNES.pyx":646 * CHKERR( SNESLineSearchSetPreCheck(snesls, NULL, NULL) ) * * def setInitialGuess(self, initialguess: SNESGuessFunction, # <<<<<<<<<<<<<< * args: tuple[Any, ...] | None = None, * kargs: dict[str, Any] | None = None) -> None: */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_68setInitialGuess(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_initialguess, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setInitialGuess", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/SNES.pyx":667 * * """ * if initialguess is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = (__pyx_v_initialguess != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/SNES.pyx":668 * """ * if initialguess is not None: * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (initialguess, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/SNES.pyx":669 * if initialguess is not None: * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (initialguess, args, kargs) * self.set_attr('__initialguess__', context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); if (__pyx_t_1) { __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 669, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_2); __pyx_t_2 = 0; } /* "petsc4py/PETSc/SNES.pyx":670 * if args is None: args = () * if kargs is None: kargs = {} * context = (initialguess, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__initialguess__', context) * CHKERR( SNESSetComputeInitialGuess(self.snes, SNES_InitialGuess, context) ) */ __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_initialguess); __Pyx_GIVEREF(__pyx_v_initialguess); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_initialguess)) __PYX_ERR(50, 670, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_args)) __PYX_ERR(50, 670, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_kargs)) __PYX_ERR(50, 670, __pyx_L1_error); __pyx_v_context = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/SNES.pyx":671 * if kargs is None: kargs = {} * context = (initialguess, args, kargs) * self.set_attr('__initialguess__', context) # <<<<<<<<<<<<<< * CHKERR( SNESSetComputeInitialGuess(self.snes, SNES_InitialGuess, context) ) * else: */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__initialguess__"), __pyx_v_context); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 671, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/SNES.pyx":672 * context = (initialguess, args, kargs) * self.set_attr('__initialguess__', context) * CHKERR( SNESSetComputeInitialGuess(self.snes, SNES_InitialGuess, context) ) # <<<<<<<<<<<<<< * else: * self.set_attr('__initialguess__', None) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetComputeInitialGuess(__pyx_v_self->snes, __pyx_f_8petsc4py_5PETSc_SNES_InitialGuess, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 672, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":667 * * """ * if initialguess is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ goto __pyx_L3; } /* "petsc4py/PETSc/SNES.pyx":674 * CHKERR( SNESSetComputeInitialGuess(self.snes, SNES_InitialGuess, context) ) * else: * self.set_attr('__initialguess__', None) # <<<<<<<<<<<<<< * CHKERR( SNESSetComputeInitialGuess(self.snes, NULL, NULL) ) * */ /*else*/ { __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__initialguess__"), Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 674, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/SNES.pyx":675 * else: * self.set_attr('__initialguess__', None) * CHKERR( SNESSetComputeInitialGuess(self.snes, NULL, NULL) ) # <<<<<<<<<<<<<< * * def getInitialGuess(self) -> SNESGuessFunction: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetComputeInitialGuess(__pyx_v_self->snes, NULL, NULL)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 675, __pyx_L1_error) } __pyx_L3:; /* "petsc4py/PETSc/SNES.pyx":646 * CHKERR( SNESLineSearchSetPreCheck(snesls, NULL, NULL) ) * * def setInitialGuess(self, initialguess: SNESGuessFunction, # <<<<<<<<<<<<<< * args: tuple[Any, ...] | None = None, * kargs: dict[str, Any] | None = None) -> None: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.setInitialGuess", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":677 * CHKERR( SNESSetComputeInitialGuess(self.snes, NULL, NULL) ) * * def getInitialGuess(self) -> SNESGuessFunction: # <<<<<<<<<<<<<< * """Return the callback to compute the initial guess. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_71getInitialGuess(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_70getInitialGuess, "SNES.getInitialGuess(self) -> SNESGuessFunction\nReturn the callback to compute the initial guess.\n\n Not collective.\n\n See Also\n --------\n setInitialGuess\n\n \nSource code at petsc4py/PETSc/SNES.pyx:677"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_71getInitialGuess(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getInitialGuess (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getInitialGuess", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getInitialGuess", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_70getInitialGuess(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_70getInitialGuess(struct PyPetscSNESObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getInitialGuess", 1); /* "petsc4py/PETSc/SNES.pyx":687 * * """ * return self.get_attr('__initialguess__') # <<<<<<<<<<<<<< * * def setFunction(self, function: SNESFunction, Vec f=None, */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__initialguess__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 687, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":677 * CHKERR( SNESSetComputeInitialGuess(self.snes, NULL, NULL) ) * * def getInitialGuess(self) -> SNESGuessFunction: # <<<<<<<<<<<<<< * """Return the callback to compute the initial guess. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getInitialGuess", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":689 * return self.get_attr('__initialguess__') * * def setFunction(self, function: SNESFunction, Vec f=None, # <<<<<<<<<<<<<< * args: tuple[Any, ...] | None = None, * kargs: dict[str, Any] | None = None) -> None: */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_73setFunction(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_72setFunction, "SNES.setFunction(self, function: SNESFunction, f: Vec | None = None, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nSet the callback to compute the nonlinear function.\n\n Logically collective.\n\n Parameters\n ----------\n function\n The callback.\n f\n An optional vector to store the result.\n args\n Positional arguments for the callback.\n kargs\n Keyword arguments for the callback.\n\n See Also\n --------\n getFunction, petsc.SNESSetFunction\n\n \nSource code at petsc4py/PETSc/SNES.pyx:689"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_73setFunction(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_function = 0; struct PyPetscVecObject *__pyx_v_f = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFunction (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_function,&__pyx_n_s_f,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscVecObject *)Py_None)); /* "petsc4py/PETSc/SNES.pyx":690 * * def setFunction(self, function: SNESFunction, Vec f=None, * args: tuple[Any, ...] | None = None, # <<<<<<<<<<<<<< * kargs: dict[str, Any] | None = None) -> None: * """Set the callback to compute the nonlinear function. */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/SNES.pyx":691 * def setFunction(self, function: SNESFunction, Vec f=None, * args: tuple[Any, ...] | None = None, * kargs: dict[str, Any] | None = None) -> None: # <<<<<<<<<<<<<< * """Set the callback to compute the nonlinear function. * */ values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_function)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 689, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_f); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 689, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 689, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 689, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setFunction") < 0)) __PYX_ERR(50, 689, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_function = values[0]; __pyx_v_f = ((struct PyPetscVecObject *)values[1]); __pyx_v_args = values[2]; __pyx_v_kargs = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setFunction", 0, 1, 4, __pyx_nargs); __PYX_ERR(50, 689, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SNES.setFunction", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_f), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "f", 0))) __PYX_ERR(50, 689, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_72setFunction(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_function, __pyx_v_f, __pyx_v_args, __pyx_v_kargs); /* "petsc4py/PETSc/SNES.pyx":689 * return self.get_attr('__initialguess__') * * def setFunction(self, function: SNESFunction, Vec f=None, # <<<<<<<<<<<<<< * args: tuple[Any, ...] | None = None, * kargs: dict[str, Any] | None = None) -> None: */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_72setFunction(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_function, struct PyPetscVecObject *__pyx_v_f, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { Vec __pyx_v_fvec; PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; Vec __pyx_t_2; PyObject *__pyx_t_3 = NULL; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFunction", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/SNES.pyx":712 * * """ * cdef PetscVec fvec=NULL # <<<<<<<<<<<<<< * if f is not None: fvec = f.vec * if function is not None: */ __pyx_v_fvec = NULL; /* "petsc4py/PETSc/SNES.pyx":713 * """ * cdef PetscVec fvec=NULL * if f is not None: fvec = f.vec # <<<<<<<<<<<<<< * if function is not None: * if args is None: args = () */ __pyx_t_1 = (((PyObject *)__pyx_v_f) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_f->vec; __pyx_v_fvec = __pyx_t_2; } /* "petsc4py/PETSc/SNES.pyx":714 * cdef PetscVec fvec=NULL * if f is not None: fvec = f.vec * if function is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = (__pyx_v_function != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/SNES.pyx":715 * if f is not None: fvec = f.vec * if function is not None: * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (function, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/SNES.pyx":716 * if function is not None: * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (function, args, kargs) * self.set_attr('__function__', context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); if (__pyx_t_1) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(50, 716, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "petsc4py/PETSc/SNES.pyx":717 * if args is None: args = () * if kargs is None: kargs = {} * context = (function, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__function__', context) * CHKERR( SNESSetFunction(self.snes, fvec, SNES_Function, context) ) */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(50, 717, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_function); __Pyx_GIVEREF(__pyx_v_function); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_function)) __PYX_ERR(50, 717, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args)) __PYX_ERR(50, 717, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs)) __PYX_ERR(50, 717, __pyx_L1_error); __pyx_v_context = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/SNES.pyx":718 * if kargs is None: kargs = {} * context = (function, args, kargs) * self.set_attr('__function__', context) # <<<<<<<<<<<<<< * CHKERR( SNESSetFunction(self.snes, fvec, SNES_Function, context) ) * else: */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__function__"), __pyx_v_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(50, 718, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/SNES.pyx":719 * context = (function, args, kargs) * self.set_attr('__function__', context) * CHKERR( SNESSetFunction(self.snes, fvec, SNES_Function, context) ) # <<<<<<<<<<<<<< * else: * CHKERR( SNESSetFunction(self.snes, fvec, NULL, NULL) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetFunction(__pyx_v_self->snes, __pyx_v_fvec, __pyx_f_8petsc4py_5PETSc_SNES_Function, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 719, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":714 * cdef PetscVec fvec=NULL * if f is not None: fvec = f.vec * if function is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ goto __pyx_L4; } /* "petsc4py/PETSc/SNES.pyx":721 * CHKERR( SNESSetFunction(self.snes, fvec, SNES_Function, context) ) * else: * CHKERR( SNESSetFunction(self.snes, fvec, NULL, NULL) ) # <<<<<<<<<<<<<< * * def getFunction(self) -> SNESFunction: */ /*else*/ { __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetFunction(__pyx_v_self->snes, __pyx_v_fvec, NULL, NULL)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 721, __pyx_L1_error) } __pyx_L4:; /* "petsc4py/PETSc/SNES.pyx":689 * return self.get_attr('__initialguess__') * * def setFunction(self, function: SNESFunction, Vec f=None, # <<<<<<<<<<<<<< * args: tuple[Any, ...] | None = None, * kargs: dict[str, Any] | None = None) -> None: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.setFunction", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":723 * CHKERR( SNESSetFunction(self.snes, fvec, NULL, NULL) ) * * def getFunction(self) -> SNESFunction: # <<<<<<<<<<<<<< * """Return the callback to compute the nonlinear function. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_75getFunction(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_74getFunction, "SNES.getFunction(self) -> SNESFunction\nReturn the callback to compute the nonlinear function.\n\n Not collective.\n\n See Also\n --------\n setFunction, petsc.SNESGetFunction\n\n \nSource code at petsc4py/PETSc/SNES.pyx:723"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_75getFunction(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getFunction (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getFunction", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getFunction", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_74getFunction(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_74getFunction(struct PyPetscSNESObject *__pyx_v_self) { struct PyPetscVecObject *__pyx_v_f = 0; void *__pyx_v_ctx; PetscErrorCode (*__pyx_v_fun)(SNES, Vec, Vec, void *); PyObject *__pyx_v_function = 0; PyObject *__pyx_v_context = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getFunction", 1); /* "petsc4py/PETSc/SNES.pyx":733 * * """ * cdef Vec f = Vec() # <<<<<<<<<<<<<< * cdef void* ctx * cdef PetscErrorCode (*fun)(PetscSNES,PetscVec,PetscVec,void*) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 733, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_f = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/SNES.pyx":736 * cdef void* ctx * cdef PetscErrorCode (*fun)(PetscSNES,PetscVec,PetscVec,void*) * CHKERR( SNESGetFunction(self.snes, &f.vec, &fun, &ctx) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(f.obj) ) * cdef object function = self.get_attr('__function__') */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetFunction(__pyx_v_self->snes, (&__pyx_v_f->vec), (&__pyx_v_fun), (&__pyx_v_ctx))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 736, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":737 * cdef PetscErrorCode (*fun)(PetscSNES,PetscVec,PetscVec,void*) * CHKERR( SNESGetFunction(self.snes, &f.vec, &fun, &ctx) ) * CHKERR( PetscINCREF(f.obj) ) # <<<<<<<<<<<<<< * cdef object function = self.get_attr('__function__') * cdef object context */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_f->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 737, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":738 * CHKERR( SNESGetFunction(self.snes, &f.vec, &fun, &ctx) ) * CHKERR( PetscINCREF(f.obj) ) * cdef object function = self.get_attr('__function__') # <<<<<<<<<<<<<< * cdef object context * */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__function__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 738, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_function = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/SNES.pyx":741 * cdef object context * * if function is not None: # <<<<<<<<<<<<<< * return (f, function) * */ __pyx_t_3 = (__pyx_v_function != Py_None); if (__pyx_t_3) { /* "petsc4py/PETSc/SNES.pyx":742 * * if function is not None: * return (f, function) # <<<<<<<<<<<<<< * * if ctx != NULL and SNES_Function == fun: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 742, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF((PyObject *)__pyx_v_f); __Pyx_GIVEREF((PyObject *)__pyx_v_f); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_f))) __PYX_ERR(50, 742, __pyx_L1_error); __Pyx_INCREF(__pyx_v_function); __Pyx_GIVEREF(__pyx_v_function); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_function)) __PYX_ERR(50, 742, __pyx_L1_error); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":741 * cdef object context * * if function is not None: # <<<<<<<<<<<<<< * return (f, function) * */ } /* "petsc4py/PETSc/SNES.pyx":744 * return (f, function) * * if ctx != NULL and SNES_Function == fun: # <<<<<<<<<<<<<< * context = ctx * if context is not None: */ __pyx_t_4 = (__pyx_v_ctx != NULL); if (__pyx_t_4) { } else { __pyx_t_3 = __pyx_t_4; goto __pyx_L5_bool_binop_done; } __pyx_t_4 = (((void *)__pyx_f_8petsc4py_5PETSc_SNES_Function) == ((void *)__pyx_v_fun)); __pyx_t_3 = __pyx_t_4; __pyx_L5_bool_binop_done:; if (__pyx_t_3) { /* "petsc4py/PETSc/SNES.pyx":745 * * if ctx != NULL and SNES_Function == fun: * context = ctx # <<<<<<<<<<<<<< * if context is not None: * assert type(context) is tuple */ __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/SNES.pyx":746 * if ctx != NULL and SNES_Function == fun: * context = ctx * if context is not None: # <<<<<<<<<<<<<< * assert type(context) is tuple * return (f, context) */ __pyx_t_3 = (__pyx_v_context != Py_None); if (__pyx_t_3) { /* "petsc4py/PETSc/SNES.pyx":747 * context = ctx * if context is not None: * assert type(context) is tuple # <<<<<<<<<<<<<< * return (f, context) * */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); if (unlikely(!__pyx_t_3)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(50, 747, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(50, 747, __pyx_L1_error) #endif /* "petsc4py/PETSc/SNES.pyx":748 * if context is not None: * assert type(context) is tuple * return (f, context) # <<<<<<<<<<<<<< * * return (f, None) */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF((PyObject *)__pyx_v_f); __Pyx_GIVEREF((PyObject *)__pyx_v_f); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_f))) __PYX_ERR(50, 748, __pyx_L1_error); __Pyx_INCREF(__pyx_v_context); __Pyx_GIVEREF(__pyx_v_context); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_context)) __PYX_ERR(50, 748, __pyx_L1_error); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":746 * if ctx != NULL and SNES_Function == fun: * context = ctx * if context is not None: # <<<<<<<<<<<<<< * assert type(context) is tuple * return (f, context) */ } /* "petsc4py/PETSc/SNES.pyx":744 * return (f, function) * * if ctx != NULL and SNES_Function == fun: # <<<<<<<<<<<<<< * context = ctx * if context is not None: */ } /* "petsc4py/PETSc/SNES.pyx":750 * return (f, context) * * return (f, None) # <<<<<<<<<<<<<< * * def setUpdate(self, update: SNESUpdateFunction, */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 750, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF((PyObject *)__pyx_v_f); __Pyx_GIVEREF((PyObject *)__pyx_v_f); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_f))) __PYX_ERR(50, 750, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, Py_None)) __PYX_ERR(50, 750, __pyx_L1_error); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":723 * CHKERR( SNESSetFunction(self.snes, fvec, NULL, NULL) ) * * def getFunction(self) -> SNESFunction: # <<<<<<<<<<<<<< * """Return the callback to compute the nonlinear function. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getFunction", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_f); __Pyx_XDECREF(__pyx_v_function); __Pyx_XDECREF(__pyx_v_context); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":752 * return (f, None) * * def setUpdate(self, update: SNESUpdateFunction, # <<<<<<<<<<<<<< * args: tuple[Any, ...] | None = None, * kargs: dict[str, Any] | None = None) -> None: */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_77setUpdate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_76setUpdate, "SNES.setUpdate(self, update: SNESUpdateFunction, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nSet the callback to compute update at the beginning of each step.\n\n Logically collective.\n\n Parameters\n ----------\n update\n The callback.\n args\n Positional arguments for the callback.\n kargs\n Keyword arguments for the callback.\n\n See Also\n --------\n getUpdate, petsc.SNESSetUpdate\n\n \nSource code at petsc4py/PETSc/SNES.pyx:752"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_77setUpdate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_update = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setUpdate (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_update,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; /* "petsc4py/PETSc/SNES.pyx":753 * * def setUpdate(self, update: SNESUpdateFunction, * args: tuple[Any, ...] | None = None, # <<<<<<<<<<<<<< * kargs: dict[str, Any] | None = None) -> None: * """Set the callback to compute update at the beginning of each step. */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/SNES.pyx":754 * def setUpdate(self, update: SNESUpdateFunction, * args: tuple[Any, ...] | None = None, * kargs: dict[str, Any] | None = None) -> None: # <<<<<<<<<<<<<< * """Set the callback to compute update at the beginning of each step. * */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_update)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 752, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 752, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 752, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setUpdate") < 0)) __PYX_ERR(50, 752, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_update = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setUpdate", 0, 1, 3, __pyx_nargs); __PYX_ERR(50, 752, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SNES.setUpdate", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_76setUpdate(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_update, __pyx_v_args, __pyx_v_kargs); /* "petsc4py/PETSc/SNES.pyx":752 * return (f, None) * * def setUpdate(self, update: SNESUpdateFunction, # <<<<<<<<<<<<<< * args: tuple[Any, ...] | None = None, * kargs: dict[str, Any] | None = None) -> None: */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_76setUpdate(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_update, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setUpdate", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/SNES.pyx":773 * * """ * if update is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = (__pyx_v_update != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/SNES.pyx":774 * """ * if update is not None: * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (update, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/SNES.pyx":775 * if update is not None: * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (update, args, kargs) * self.set_attr('__update__', context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); if (__pyx_t_1) { __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 775, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_2); __pyx_t_2 = 0; } /* "petsc4py/PETSc/SNES.pyx":776 * if args is None: args = () * if kargs is None: kargs = {} * context = (update, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__update__', context) * CHKERR( SNESSetUpdate(self.snes, SNES_Update) ) */ __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 776, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_update); __Pyx_GIVEREF(__pyx_v_update); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_update)) __PYX_ERR(50, 776, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_args)) __PYX_ERR(50, 776, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_kargs)) __PYX_ERR(50, 776, __pyx_L1_error); __pyx_v_context = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/SNES.pyx":777 * if kargs is None: kargs = {} * context = (update, args, kargs) * self.set_attr('__update__', context) # <<<<<<<<<<<<<< * CHKERR( SNESSetUpdate(self.snes, SNES_Update) ) * else: */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__update__"), __pyx_v_context); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 777, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/SNES.pyx":778 * context = (update, args, kargs) * self.set_attr('__update__', context) * CHKERR( SNESSetUpdate(self.snes, SNES_Update) ) # <<<<<<<<<<<<<< * else: * self.set_attr('__update__', None) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetUpdate(__pyx_v_self->snes, __pyx_f_8petsc4py_5PETSc_SNES_Update)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 778, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":773 * * """ * if update is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ goto __pyx_L3; } /* "petsc4py/PETSc/SNES.pyx":780 * CHKERR( SNESSetUpdate(self.snes, SNES_Update) ) * else: * self.set_attr('__update__', None) # <<<<<<<<<<<<<< * CHKERR( SNESSetUpdate(self.snes, NULL) ) * */ /*else*/ { __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__update__"), Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 780, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/SNES.pyx":781 * else: * self.set_attr('__update__', None) * CHKERR( SNESSetUpdate(self.snes, NULL) ) # <<<<<<<<<<<<<< * * def getUpdate(self) -> SNESUpdateFunction: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetUpdate(__pyx_v_self->snes, NULL)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 781, __pyx_L1_error) } __pyx_L3:; /* "petsc4py/PETSc/SNES.pyx":752 * return (f, None) * * def setUpdate(self, update: SNESUpdateFunction, # <<<<<<<<<<<<<< * args: tuple[Any, ...] | None = None, * kargs: dict[str, Any] | None = None) -> None: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.setUpdate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":783 * CHKERR( SNESSetUpdate(self.snes, NULL) ) * * def getUpdate(self) -> SNESUpdateFunction: # <<<<<<<<<<<<<< * """Return the callback to compute the update at the beginning of each step. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_79getUpdate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_78getUpdate, "SNES.getUpdate(self) -> SNESUpdateFunction\nReturn the callback to compute the update at the beginning of each step.\n\n Not collective.\n\n See Also\n --------\n setUpdate\n\n \nSource code at petsc4py/PETSc/SNES.pyx:783"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_79getUpdate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getUpdate (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getUpdate", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getUpdate", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_78getUpdate(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_78getUpdate(struct PyPetscSNESObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getUpdate", 1); /* "petsc4py/PETSc/SNES.pyx":793 * * """ * return self.get_attr('__update__') # <<<<<<<<<<<<<< * * def setJacobian(self, jacobian: SNESJacobianFunction, Mat J=None, Mat P=None, */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__update__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 793, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":783 * CHKERR( SNESSetUpdate(self.snes, NULL) ) * * def getUpdate(self) -> SNESUpdateFunction: # <<<<<<<<<<<<<< * """Return the callback to compute the update at the beginning of each step. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getUpdate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":795 * return self.get_attr('__update__') * * def setJacobian(self, jacobian: SNESJacobianFunction, Mat J=None, Mat P=None, # <<<<<<<<<<<<<< * args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: * """Set the callback to compute the Jacobian. */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_81setJacobian(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_80setJacobian, "SNES.setJacobian(self, jacobian: SNESJacobianFunction, J: Mat | None = None, P: Mat | None = None, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nSet the callback to compute the Jacobian.\n\n Logically collective.\n\n Parameters\n ----------\n jacobian\n The Jacobian callback.\n J\n The matrix to store the Jacobian.\n P\n The matrix to construct the preconditioner.\n args\n Positional arguments for the callback.\n kargs\n Keyword arguments for the callback.\n\n See Also\n --------\n getJacobian, petsc.SNESSetJacobian\n\n \nSource code at petsc4py/PETSc/SNES.pyx:795"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_81setJacobian(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_jacobian = 0; struct PyPetscMatObject *__pyx_v_J = 0; struct PyPetscMatObject *__pyx_v_P = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setJacobian (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_jacobian,&__pyx_n_s_J,&__pyx_n_s_P,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscMatObject *)Py_None)); values[2] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscMatObject *)Py_None)); /* "petsc4py/PETSc/SNES.pyx":796 * * def setJacobian(self, jacobian: SNESJacobianFunction, Mat J=None, Mat P=None, * args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: # <<<<<<<<<<<<<< * """Set the callback to compute the Jacobian. * */ values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_jacobian)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 795, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_J); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 795, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_P); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 795, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 795, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 795, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setJacobian") < 0)) __PYX_ERR(50, 795, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_jacobian = values[0]; __pyx_v_J = ((struct PyPetscMatObject *)values[1]); __pyx_v_P = ((struct PyPetscMatObject *)values[2]); __pyx_v_args = values[3]; __pyx_v_kargs = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setJacobian", 0, 1, 5, __pyx_nargs); __PYX_ERR(50, 795, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SNES.setJacobian", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_J), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "J", 0))) __PYX_ERR(50, 795, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_P), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "P", 0))) __PYX_ERR(50, 795, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_80setJacobian(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_jacobian, __pyx_v_J, __pyx_v_P, __pyx_v_args, __pyx_v_kargs); /* "petsc4py/PETSc/SNES.pyx":795 * return self.get_attr('__update__') * * def setJacobian(self, jacobian: SNESJacobianFunction, Mat J=None, Mat P=None, # <<<<<<<<<<<<<< * args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: * """Set the callback to compute the Jacobian. */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_80setJacobian(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_jacobian, struct PyPetscMatObject *__pyx_v_J, struct PyPetscMatObject *__pyx_v_P, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { Mat __pyx_v_Jmat; Mat __pyx_v_Pmat; PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; Mat __pyx_t_2; PyObject *__pyx_t_3 = NULL; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setJacobian", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/SNES.pyx":819 * * """ * cdef PetscMat Jmat=NULL # <<<<<<<<<<<<<< * if J is not None: Jmat = J.mat * cdef PetscMat Pmat=Jmat */ __pyx_v_Jmat = NULL; /* "petsc4py/PETSc/SNES.pyx":820 * """ * cdef PetscMat Jmat=NULL * if J is not None: Jmat = J.mat # <<<<<<<<<<<<<< * cdef PetscMat Pmat=Jmat * if P is not None: Pmat = P.mat */ __pyx_t_1 = (((PyObject *)__pyx_v_J) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_J->mat; __pyx_v_Jmat = __pyx_t_2; } /* "petsc4py/PETSc/SNES.pyx":821 * cdef PetscMat Jmat=NULL * if J is not None: Jmat = J.mat * cdef PetscMat Pmat=Jmat # <<<<<<<<<<<<<< * if P is not None: Pmat = P.mat * if jacobian is not None: */ __pyx_v_Pmat = __pyx_v_Jmat; /* "petsc4py/PETSc/SNES.pyx":822 * if J is not None: Jmat = J.mat * cdef PetscMat Pmat=Jmat * if P is not None: Pmat = P.mat # <<<<<<<<<<<<<< * if jacobian is not None: * if args is None: args = () */ __pyx_t_1 = (((PyObject *)__pyx_v_P) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_P->mat; __pyx_v_Pmat = __pyx_t_2; } /* "petsc4py/PETSc/SNES.pyx":823 * cdef PetscMat Pmat=Jmat * if P is not None: Pmat = P.mat * if jacobian is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = (__pyx_v_jacobian != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/SNES.pyx":824 * if P is not None: Pmat = P.mat * if jacobian is not None: * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (jacobian, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/SNES.pyx":825 * if jacobian is not None: * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (jacobian, args, kargs) * self.set_attr('__jacobian__', context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); if (__pyx_t_1) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(50, 825, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "petsc4py/PETSc/SNES.pyx":826 * if args is None: args = () * if kargs is None: kargs = {} * context = (jacobian, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__jacobian__', context) * CHKERR( SNESSetJacobian(self.snes, Jmat, Pmat, SNES_Jacobian, context) ) */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(50, 826, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_jacobian); __Pyx_GIVEREF(__pyx_v_jacobian); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_jacobian)) __PYX_ERR(50, 826, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args)) __PYX_ERR(50, 826, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs)) __PYX_ERR(50, 826, __pyx_L1_error); __pyx_v_context = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/SNES.pyx":827 * if kargs is None: kargs = {} * context = (jacobian, args, kargs) * self.set_attr('__jacobian__', context) # <<<<<<<<<<<<<< * CHKERR( SNESSetJacobian(self.snes, Jmat, Pmat, SNES_Jacobian, context) ) * else: */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__jacobian__"), __pyx_v_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(50, 827, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/SNES.pyx":828 * context = (jacobian, args, kargs) * self.set_attr('__jacobian__', context) * CHKERR( SNESSetJacobian(self.snes, Jmat, Pmat, SNES_Jacobian, context) ) # <<<<<<<<<<<<<< * else: * CHKERR( SNESSetJacobian(self.snes, Jmat, Pmat, NULL, NULL) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetJacobian(__pyx_v_self->snes, __pyx_v_Jmat, __pyx_v_Pmat, __pyx_f_8petsc4py_5PETSc_SNES_Jacobian, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 828, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":823 * cdef PetscMat Pmat=Jmat * if P is not None: Pmat = P.mat * if jacobian is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ goto __pyx_L5; } /* "petsc4py/PETSc/SNES.pyx":830 * CHKERR( SNESSetJacobian(self.snes, Jmat, Pmat, SNES_Jacobian, context) ) * else: * CHKERR( SNESSetJacobian(self.snes, Jmat, Pmat, NULL, NULL) ) # <<<<<<<<<<<<<< * * def getJacobian(self) -> tuple[Mat, Mat, SNESJacobianFunction]: */ /*else*/ { __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetJacobian(__pyx_v_self->snes, __pyx_v_Jmat, __pyx_v_Pmat, NULL, NULL)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 830, __pyx_L1_error) } __pyx_L5:; /* "petsc4py/PETSc/SNES.pyx":795 * return self.get_attr('__update__') * * def setJacobian(self, jacobian: SNESJacobianFunction, Mat J=None, Mat P=None, # <<<<<<<<<<<<<< * args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: * """Set the callback to compute the Jacobian. */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.setJacobian", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":832 * CHKERR( SNESSetJacobian(self.snes, Jmat, Pmat, NULL, NULL) ) * * def getJacobian(self) -> tuple[Mat, Mat, SNESJacobianFunction]: # <<<<<<<<<<<<<< * """Return the matrices used to compute the Jacobian and the callback tuple. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_83getJacobian(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_82getJacobian, "SNES.getJacobian(self) -> tuple[Mat, Mat, SNESJacobianFunction]\nReturn the matrices used to compute the Jacobian and the callback tuple.\n\n Not collective.\n\n Returns\n -------\n J : Mat\n The matrix to store the Jacobian.\n P : Mat\n The matrix to construct the preconditioner.\n callback : SNESJacobianFunction\n callback, positional and keyword arguments.\n\n See Also\n --------\n setJacobian, petsc.SNESGetJacobian\n\n \nSource code at petsc4py/PETSc/SNES.pyx:832"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_83getJacobian(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getJacobian (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getJacobian", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getJacobian", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_82getJacobian(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_82getJacobian(struct PyPetscSNESObject *__pyx_v_self) { struct PyPetscMatObject *__pyx_v_J = 0; struct PyPetscMatObject *__pyx_v_P = 0; PyObject *__pyx_v_jacobian = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getJacobian", 1); /* "petsc4py/PETSc/SNES.pyx":851 * * """ * cdef Mat J = Mat() # <<<<<<<<<<<<<< * cdef Mat P = Mat() * CHKERR( SNESGetJacobian(self.snes, &J.mat, &P.mat, NULL, NULL) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 851, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_J = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/SNES.pyx":852 * """ * cdef Mat J = Mat() * cdef Mat P = Mat() # <<<<<<<<<<<<<< * CHKERR( SNESGetJacobian(self.snes, &J.mat, &P.mat, NULL, NULL) ) * CHKERR( PetscINCREF(J.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 852, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_P = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/SNES.pyx":853 * cdef Mat J = Mat() * cdef Mat P = Mat() * CHKERR( SNESGetJacobian(self.snes, &J.mat, &P.mat, NULL, NULL) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(J.obj) ) * CHKERR( PetscINCREF(P.obj) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetJacobian(__pyx_v_self->snes, (&__pyx_v_J->mat), (&__pyx_v_P->mat), NULL, NULL)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 853, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":854 * cdef Mat P = Mat() * CHKERR( SNESGetJacobian(self.snes, &J.mat, &P.mat, NULL, NULL) ) * CHKERR( PetscINCREF(J.obj) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(P.obj) ) * cdef object jacobian = self.get_attr('__jacobian__') */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_J->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 854, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":855 * CHKERR( SNESGetJacobian(self.snes, &J.mat, &P.mat, NULL, NULL) ) * CHKERR( PetscINCREF(J.obj) ) * CHKERR( PetscINCREF(P.obj) ) # <<<<<<<<<<<<<< * cdef object jacobian = self.get_attr('__jacobian__') * return (J, P, jacobian) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_P->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 855, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":856 * CHKERR( PetscINCREF(J.obj) ) * CHKERR( PetscINCREF(P.obj) ) * cdef object jacobian = self.get_attr('__jacobian__') # <<<<<<<<<<<<<< * return (J, P, jacobian) * */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__jacobian__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 856, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_jacobian = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/SNES.pyx":857 * CHKERR( PetscINCREF(P.obj) ) * cdef object jacobian = self.get_attr('__jacobian__') * return (J, P, jacobian) # <<<<<<<<<<<<<< * * def setObjective(self, objective: SNESObjFunction, */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 857, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF((PyObject *)__pyx_v_J); __Pyx_GIVEREF((PyObject *)__pyx_v_J); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_J))) __PYX_ERR(50, 857, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_P); __Pyx_GIVEREF((PyObject *)__pyx_v_P); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_P))) __PYX_ERR(50, 857, __pyx_L1_error); __Pyx_INCREF(__pyx_v_jacobian); __Pyx_GIVEREF(__pyx_v_jacobian); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_jacobian)) __PYX_ERR(50, 857, __pyx_L1_error); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":832 * CHKERR( SNESSetJacobian(self.snes, Jmat, Pmat, NULL, NULL) ) * * def getJacobian(self) -> tuple[Mat, Mat, SNESJacobianFunction]: # <<<<<<<<<<<<<< * """Return the matrices used to compute the Jacobian and the callback tuple. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getJacobian", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_J); __Pyx_XDECREF((PyObject *)__pyx_v_P); __Pyx_XDECREF(__pyx_v_jacobian); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":859 * return (J, P, jacobian) * * def setObjective(self, objective: SNESObjFunction, # <<<<<<<<<<<<<< * args: tuple[Any, ...] | None = None, * kargs: dict[str, Any] | None = None) -> None: */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_85setObjective(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_84setObjective, "SNES.setObjective(self, objective: SNESObjFunction, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nSet the callback to compute the objective function.\n\n Logically collective.\n\n Parameters\n ----------\n objective\n The Jacobian callback.\n args\n Positional arguments for the callback.\n kargs\n Keyword arguments for the callback.\n\n See Also\n --------\n getObjective, petsc.SNESSetObjective\n\n \nSource code at petsc4py/PETSc/SNES.pyx:859"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_85setObjective(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_objective = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setObjective (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_objective,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; /* "petsc4py/PETSc/SNES.pyx":860 * * def setObjective(self, objective: SNESObjFunction, * args: tuple[Any, ...] | None = None, # <<<<<<<<<<<<<< * kargs: dict[str, Any] | None = None) -> None: * """Set the callback to compute the objective function. */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/SNES.pyx":861 * def setObjective(self, objective: SNESObjFunction, * args: tuple[Any, ...] | None = None, * kargs: dict[str, Any] | None = None) -> None: # <<<<<<<<<<<<<< * """Set the callback to compute the objective function. * */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_objective)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 859, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 859, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 859, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setObjective") < 0)) __PYX_ERR(50, 859, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_objective = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setObjective", 0, 1, 3, __pyx_nargs); __PYX_ERR(50, 859, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SNES.setObjective", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_84setObjective(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_objective, __pyx_v_args, __pyx_v_kargs); /* "petsc4py/PETSc/SNES.pyx":859 * return (J, P, jacobian) * * def setObjective(self, objective: SNESObjFunction, # <<<<<<<<<<<<<< * args: tuple[Any, ...] | None = None, * kargs: dict[str, Any] | None = None) -> None: */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_84setObjective(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_objective, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setObjective", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/SNES.pyx":880 * * """ * if objective is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = (__pyx_v_objective != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/SNES.pyx":881 * """ * if objective is not None: * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (objective, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/SNES.pyx":882 * if objective is not None: * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (objective, args, kargs) * self.set_attr('__objective__', context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); if (__pyx_t_1) { __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 882, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_2); __pyx_t_2 = 0; } /* "petsc4py/PETSc/SNES.pyx":883 * if args is None: args = () * if kargs is None: kargs = {} * context = (objective, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__objective__', context) * CHKERR( SNESSetObjective(self.snes, SNES_Objective, context) ) */ __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 883, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_objective); __Pyx_GIVEREF(__pyx_v_objective); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_objective)) __PYX_ERR(50, 883, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_args)) __PYX_ERR(50, 883, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_kargs)) __PYX_ERR(50, 883, __pyx_L1_error); __pyx_v_context = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/SNES.pyx":884 * if kargs is None: kargs = {} * context = (objective, args, kargs) * self.set_attr('__objective__', context) # <<<<<<<<<<<<<< * CHKERR( SNESSetObjective(self.snes, SNES_Objective, context) ) * else: */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__objective__"), __pyx_v_context); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 884, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/SNES.pyx":885 * context = (objective, args, kargs) * self.set_attr('__objective__', context) * CHKERR( SNESSetObjective(self.snes, SNES_Objective, context) ) # <<<<<<<<<<<<<< * else: * CHKERR( SNESSetObjective(self.snes, NULL, NULL) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetObjective(__pyx_v_self->snes, __pyx_f_8petsc4py_5PETSc_SNES_Objective, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 885, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":880 * * """ * if objective is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ goto __pyx_L3; } /* "petsc4py/PETSc/SNES.pyx":887 * CHKERR( SNESSetObjective(self.snes, SNES_Objective, context) ) * else: * CHKERR( SNESSetObjective(self.snes, NULL, NULL) ) # <<<<<<<<<<<<<< * * def getObjective(self) -> SNESObjFunction: */ /*else*/ { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetObjective(__pyx_v_self->snes, NULL, NULL)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 887, __pyx_L1_error) } __pyx_L3:; /* "petsc4py/PETSc/SNES.pyx":859 * return (J, P, jacobian) * * def setObjective(self, objective: SNESObjFunction, # <<<<<<<<<<<<<< * args: tuple[Any, ...] | None = None, * kargs: dict[str, Any] | None = None) -> None: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.setObjective", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":889 * CHKERR( SNESSetObjective(self.snes, NULL, NULL) ) * * def getObjective(self) -> SNESObjFunction: # <<<<<<<<<<<<<< * """Return the objective callback tuple. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_87getObjective(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_86getObjective, "SNES.getObjective(self) -> SNESObjFunction\nReturn the objective callback tuple.\n\n Not collective.\n\n See Also\n --------\n setObjective\n\n \nSource code at petsc4py/PETSc/SNES.pyx:889"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_87getObjective(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getObjective (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getObjective", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getObjective", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_86getObjective(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_86getObjective(struct PyPetscSNESObject *__pyx_v_self) { PyObject *__pyx_v_objective = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getObjective", 1); /* "petsc4py/PETSc/SNES.pyx":899 * * """ * CHKERR( SNESGetObjective(self.snes, NULL, NULL) ) # <<<<<<<<<<<<<< * cdef object objective = self.get_attr('__objective__') * return objective */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetObjective(__pyx_v_self->snes, NULL, NULL)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 899, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":900 * """ * CHKERR( SNESGetObjective(self.snes, NULL, NULL) ) * cdef object objective = self.get_attr('__objective__') # <<<<<<<<<<<<<< * return objective * */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__objective__")); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 900, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_objective = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/SNES.pyx":901 * CHKERR( SNESGetObjective(self.snes, NULL, NULL) ) * cdef object objective = self.get_attr('__objective__') * return objective # <<<<<<<<<<<<<< * * def computeFunction(self, Vec x, Vec f) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_objective); __pyx_r = __pyx_v_objective; goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":889 * CHKERR( SNESSetObjective(self.snes, NULL, NULL) ) * * def getObjective(self) -> SNESObjFunction: # <<<<<<<<<<<<<< * """Return the objective callback tuple. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getObjective", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_objective); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":903 * return objective * * def computeFunction(self, Vec x, Vec f) -> None: # <<<<<<<<<<<<<< * """Compute the function. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_89computeFunction(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_88computeFunction, "SNES.computeFunction(self, x: Vec, f: Vec) -> None\nCompute the function.\n\n Collective.\n\n Parameters\n ----------\n x\n The input state vector.\n f\n The output vector.\n\n See Also\n --------\n setFunction, petsc.SNESComputeFunction\n\n \nSource code at petsc4py/PETSc/SNES.pyx:903"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_89computeFunction(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_f = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("computeFunction (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_f,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 903, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_f)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 903, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("computeFunction", 1, 2, 2, 1); __PYX_ERR(50, 903, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "computeFunction") < 0)) __PYX_ERR(50, 903, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_x = ((struct PyPetscVecObject *)values[0]); __pyx_v_f = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("computeFunction", 1, 2, 2, __pyx_nargs); __PYX_ERR(50, 903, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SNES.computeFunction", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(50, 903, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_f), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "f", 0))) __PYX_ERR(50, 903, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_88computeFunction(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_x, __pyx_v_f); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_88computeFunction(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_f) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("computeFunction", 1); /* "petsc4py/PETSc/SNES.pyx":920 * * """ * CHKERR( SNESComputeFunction(self.snes, x.vec, f.vec) ) # <<<<<<<<<<<<<< * * def computeJacobian(self, Vec x, Mat J, Mat P=None) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESComputeFunction(__pyx_v_self->snes, __pyx_v_x->vec, __pyx_v_f->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 920, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":903 * return objective * * def computeFunction(self, Vec x, Vec f) -> None: # <<<<<<<<<<<<<< * """Compute the function. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.computeFunction", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":922 * CHKERR( SNESComputeFunction(self.snes, x.vec, f.vec) ) * * def computeJacobian(self, Vec x, Mat J, Mat P=None) -> None: # <<<<<<<<<<<<<< * """Compute the Jacobian. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_91computeJacobian(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_90computeJacobian, "SNES.computeJacobian(self, x: Vec, J: Mat, P: Mat | None = None) -> None\nCompute the Jacobian.\n\n Collective.\n\n Parameters\n ----------\n x\n The input state vector.\n J\n The output Jacobian matrix.\n P\n The output Jacobian matrix used to construct the preconditioner.\n\n See Also\n --------\n setJacobian, petsc.SNESComputeJacobian\n\n \nSource code at petsc4py/PETSc/SNES.pyx:922"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_91computeJacobian(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscMatObject *__pyx_v_J = 0; struct PyPetscMatObject *__pyx_v_P = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("computeJacobian (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_J,&__pyx_n_s_P,0}; values[2] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscMatObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 922, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_J)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 922, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("computeJacobian", 0, 2, 3, 1); __PYX_ERR(50, 922, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_P); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 922, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "computeJacobian") < 0)) __PYX_ERR(50, 922, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_x = ((struct PyPetscVecObject *)values[0]); __pyx_v_J = ((struct PyPetscMatObject *)values[1]); __pyx_v_P = ((struct PyPetscMatObject *)values[2]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("computeJacobian", 0, 2, 3, __pyx_nargs); __PYX_ERR(50, 922, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SNES.computeJacobian", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(50, 922, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_J), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "J", 0))) __PYX_ERR(50, 922, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_P), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "P", 0))) __PYX_ERR(50, 922, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_90computeJacobian(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_x, __pyx_v_J, __pyx_v_P); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_90computeJacobian(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscMatObject *__pyx_v_J, struct PyPetscMatObject *__pyx_v_P) { Mat __pyx_v_jmat; Mat __pyx_v_pmat; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Mat __pyx_t_1; int __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("computeJacobian", 1); /* "petsc4py/PETSc/SNES.pyx":941 * * """ * cdef PetscMat jmat = J.mat, pmat = J.mat # <<<<<<<<<<<<<< * if P is not None: pmat = P.mat * CHKERR( SNESComputeJacobian(self.snes, x.vec, jmat, pmat) ) */ __pyx_t_1 = __pyx_v_J->mat; __pyx_v_jmat = __pyx_t_1; __pyx_t_1 = __pyx_v_J->mat; __pyx_v_pmat = __pyx_t_1; /* "petsc4py/PETSc/SNES.pyx":942 * """ * cdef PetscMat jmat = J.mat, pmat = J.mat * if P is not None: pmat = P.mat # <<<<<<<<<<<<<< * CHKERR( SNESComputeJacobian(self.snes, x.vec, jmat, pmat) ) * */ __pyx_t_2 = (((PyObject *)__pyx_v_P) != Py_None); if (__pyx_t_2) { __pyx_t_1 = __pyx_v_P->mat; __pyx_v_pmat = __pyx_t_1; } /* "petsc4py/PETSc/SNES.pyx":943 * cdef PetscMat jmat = J.mat, pmat = J.mat * if P is not None: pmat = P.mat * CHKERR( SNESComputeJacobian(self.snes, x.vec, jmat, pmat) ) # <<<<<<<<<<<<<< * * def computeObjective(self, Vec x) -> float: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESComputeJacobian(__pyx_v_self->snes, __pyx_v_x->vec, __pyx_v_jmat, __pyx_v_pmat)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 943, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":922 * CHKERR( SNESComputeFunction(self.snes, x.vec, f.vec) ) * * def computeJacobian(self, Vec x, Mat J, Mat P=None) -> None: # <<<<<<<<<<<<<< * """Compute the Jacobian. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.computeJacobian", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":945 * CHKERR( SNESComputeJacobian(self.snes, x.vec, jmat, pmat) ) * * def computeObjective(self, Vec x) -> float: # <<<<<<<<<<<<<< * """Compute the value of the objective function. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_93computeObjective(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_92computeObjective, "SNES.computeObjective(self, x: Vec) -> float\nCompute the value of the objective function.\n\n Collective.\n\n Parameters\n ----------\n x\n The input state vector.\n\n See Also\n --------\n setObjective, petsc.SNESComputeObjective\n\n \nSource code at petsc4py/PETSc/SNES.pyx:945"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_93computeObjective(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_x = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("computeObjective (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 945, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "computeObjective") < 0)) __PYX_ERR(50, 945, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_x = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("computeObjective", 1, 1, 1, __pyx_nargs); __PYX_ERR(50, 945, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SNES.computeObjective", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(50, 945, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_92computeObjective(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_x); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_92computeObjective(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x) { PetscReal __pyx_v_o; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("computeObjective", 1); /* "petsc4py/PETSc/SNES.pyx":960 * * """ * cdef PetscReal o = 0 # <<<<<<<<<<<<<< * CHKERR( SNESComputeObjective(self.snes, x.vec, &o) ) * return toReal(o) */ __pyx_v_o = 0.0; /* "petsc4py/PETSc/SNES.pyx":961 * """ * cdef PetscReal o = 0 * CHKERR( SNESComputeObjective(self.snes, x.vec, &o) ) # <<<<<<<<<<<<<< * return toReal(o) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESComputeObjective(__pyx_v_self->snes, __pyx_v_x->vec, (&__pyx_v_o))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 961, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":962 * cdef PetscReal o = 0 * CHKERR( SNESComputeObjective(self.snes, x.vec, &o) ) * return toReal(o) # <<<<<<<<<<<<<< * * def setNGS(self, ngs: SNESNGSFunction, */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_o); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 962, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":945 * CHKERR( SNESComputeJacobian(self.snes, x.vec, jmat, pmat) ) * * def computeObjective(self, Vec x) -> float: # <<<<<<<<<<<<<< * """Compute the value of the objective function. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.computeObjective", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":964 * return toReal(o) * * def setNGS(self, ngs: SNESNGSFunction, # <<<<<<<<<<<<<< * args: tuple[Any, ...] | None = None, * kargs: dict[str, Any] | None = None) -> None: */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_95setNGS(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_94setNGS, "SNES.setNGS(self, ngs: SNESNGSFunction, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nSet the callback to compute nonlinear Gauss-Seidel.\n\n Logically collective.\n\n Parameters\n ----------\n ngs\n The nonlinear Gauss-Seidel callback.\n args\n Positional arguments for the callback.\n kargs\n Keyword arguments for the callback.\n\n See Also\n --------\n getNGS, computeNGS, petsc.SNESSetNGS\n\n \nSource code at petsc4py/PETSc/SNES.pyx:964"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_95setNGS(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_ngs = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setNGS (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ngs,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; /* "petsc4py/PETSc/SNES.pyx":965 * * def setNGS(self, ngs: SNESNGSFunction, * args: tuple[Any, ...] | None = None, # <<<<<<<<<<<<<< * kargs: dict[str, Any] | None = None) -> None: * """Set the callback to compute nonlinear Gauss-Seidel. */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/SNES.pyx":966 * def setNGS(self, ngs: SNESNGSFunction, * args: tuple[Any, ...] | None = None, * kargs: dict[str, Any] | None = None) -> None: # <<<<<<<<<<<<<< * """Set the callback to compute nonlinear Gauss-Seidel. * */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ngs)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 964, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 964, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 964, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setNGS") < 0)) __PYX_ERR(50, 964, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_ngs = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setNGS", 0, 1, 3, __pyx_nargs); __PYX_ERR(50, 964, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SNES.setNGS", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_94setNGS(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_ngs, __pyx_v_args, __pyx_v_kargs); /* "petsc4py/PETSc/SNES.pyx":964 * return toReal(o) * * def setNGS(self, ngs: SNESNGSFunction, # <<<<<<<<<<<<<< * args: tuple[Any, ...] | None = None, * kargs: dict[str, Any] | None = None) -> None: */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_94setNGS(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_ngs, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setNGS", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/SNES.pyx":985 * * """ * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (ngs, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/SNES.pyx":986 * """ * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (ngs, args, kargs) * self.set_attr('__ngs__', context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); if (__pyx_t_1) { __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 986, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_2); __pyx_t_2 = 0; } /* "petsc4py/PETSc/SNES.pyx":987 * if args is None: args = () * if kargs is None: kargs = {} * context = (ngs, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__ngs__', context) * CHKERR( SNESSetNGS(self.snes, SNES_NGS, context) ) */ __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 987, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_ngs); __Pyx_GIVEREF(__pyx_v_ngs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_ngs)) __PYX_ERR(50, 987, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_args)) __PYX_ERR(50, 987, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_kargs)) __PYX_ERR(50, 987, __pyx_L1_error); __pyx_v_context = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/SNES.pyx":988 * if kargs is None: kargs = {} * context = (ngs, args, kargs) * self.set_attr('__ngs__', context) # <<<<<<<<<<<<<< * CHKERR( SNESSetNGS(self.snes, SNES_NGS, context) ) * */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__ngs__"), __pyx_v_context); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 988, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/SNES.pyx":989 * context = (ngs, args, kargs) * self.set_attr('__ngs__', context) * CHKERR( SNESSetNGS(self.snes, SNES_NGS, context) ) # <<<<<<<<<<<<<< * * def getNGS(self) -> SNESNGSFunction: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetNGS(__pyx_v_self->snes, __pyx_f_8petsc4py_5PETSc_SNES_NGS, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 989, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":964 * return toReal(o) * * def setNGS(self, ngs: SNESNGSFunction, # <<<<<<<<<<<<<< * args: tuple[Any, ...] | None = None, * kargs: dict[str, Any] | None = None) -> None: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.setNGS", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":991 * CHKERR( SNESSetNGS(self.snes, SNES_NGS, context) ) * * def getNGS(self) -> SNESNGSFunction: # <<<<<<<<<<<<<< * """Return the nonlinear Gauss-Seidel callback tuple. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_97getNGS(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_96getNGS, "SNES.getNGS(self) -> SNESNGSFunction\nReturn the nonlinear Gauss-Seidel callback tuple.\n\n Not collective.\n\n See Also\n --------\n setNGS, computeNGS\n\n \nSource code at petsc4py/PETSc/SNES.pyx:991"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_97getNGS(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getNGS (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getNGS", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getNGS", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_96getNGS(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_96getNGS(struct PyPetscSNESObject *__pyx_v_self) { PyObject *__pyx_v_ngs = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getNGS", 1); /* "petsc4py/PETSc/SNES.pyx":1001 * * """ * CHKERR( SNESGetNGS(self.snes, NULL, NULL) ) # <<<<<<<<<<<<<< * cdef object ngs = self.get_attr('__ngs__') * return ngs */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetNGS(__pyx_v_self->snes, NULL, NULL)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1001, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":1002 * """ * CHKERR( SNESGetNGS(self.snes, NULL, NULL) ) * cdef object ngs = self.get_attr('__ngs__') # <<<<<<<<<<<<<< * return ngs * */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__ngs__")); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 1002, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_ngs = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/SNES.pyx":1003 * CHKERR( SNESGetNGS(self.snes, NULL, NULL) ) * cdef object ngs = self.get_attr('__ngs__') * return ngs # <<<<<<<<<<<<<< * * def computeNGS(self, Vec x, Vec b=None) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_ngs); __pyx_r = __pyx_v_ngs; goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":991 * CHKERR( SNESSetNGS(self.snes, SNES_NGS, context) ) * * def getNGS(self) -> SNESNGSFunction: # <<<<<<<<<<<<<< * """Return the nonlinear Gauss-Seidel callback tuple. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getNGS", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ngs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":1005 * return ngs * * def computeNGS(self, Vec x, Vec b=None) -> None: # <<<<<<<<<<<<<< * """Compute a nonlinear Gauss-Seidel step. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_99computeNGS(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_98computeNGS, "SNES.computeNGS(self, x: Vec, b: Vec | None = None) -> None\nCompute a nonlinear Gauss-Seidel step.\n\n Collective.\n\n Parameters\n ----------\n x\n The input/output state vector.\n b\n The input right-hand side vector.\n\n See Also\n --------\n setNGS, getNGS, petsc.SNESComputeNGS\n\n \nSource code at petsc4py/PETSc/SNES.pyx:1005"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_99computeNGS(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_b = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("computeNGS (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_b,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscVecObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 1005, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_b); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 1005, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "computeNGS") < 0)) __PYX_ERR(50, 1005, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_x = ((struct PyPetscVecObject *)values[0]); __pyx_v_b = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("computeNGS", 0, 1, 2, __pyx_nargs); __PYX_ERR(50, 1005, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SNES.computeNGS", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(50, 1005, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "b", 0))) __PYX_ERR(50, 1005, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_98computeNGS(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_x, __pyx_v_b); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_98computeNGS(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_b) { Vec __pyx_v_bvec; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; Vec __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("computeNGS", 1); /* "petsc4py/PETSc/SNES.pyx":1022 * * """ * cdef PetscVec bvec = NULL # <<<<<<<<<<<<<< * if b is not None: bvec = b.vec * CHKERR( SNESComputeNGS(self.snes, bvec, x.vec) ) */ __pyx_v_bvec = NULL; /* "petsc4py/PETSc/SNES.pyx":1023 * """ * cdef PetscVec bvec = NULL * if b is not None: bvec = b.vec # <<<<<<<<<<<<<< * CHKERR( SNESComputeNGS(self.snes, bvec, x.vec) ) * */ __pyx_t_1 = (((PyObject *)__pyx_v_b) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_b->vec; __pyx_v_bvec = __pyx_t_2; } /* "petsc4py/PETSc/SNES.pyx":1024 * cdef PetscVec bvec = NULL * if b is not None: bvec = b.vec * CHKERR( SNESComputeNGS(self.snes, bvec, x.vec) ) # <<<<<<<<<<<<<< * * # --- tolerances and convergence --- */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESComputeNGS(__pyx_v_self->snes, __pyx_v_bvec, __pyx_v_x->vec)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1024, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":1005 * return ngs * * def computeNGS(self, Vec x, Vec b=None) -> None: # <<<<<<<<<<<<<< * """Compute a nonlinear Gauss-Seidel step. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.computeNGS", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":1028 * # --- tolerances and convergence --- * * def setTolerances(self, rtol: float = None, atol: float = None, stol: float = None, max_it: int = None) -> None: # <<<<<<<<<<<<<< * """Set the tolerance parameters used in the solver convergence tests. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_101setTolerances(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_100setTolerances, "SNES.setTolerances(self, rtol: float = None, atol: float = None, stol: float = None, max_it: int = None) -> None\nSet the tolerance parameters used in the solver convergence tests.\n\n Collective.\n\n Parameters\n ----------\n rtol\n The relative norm of the residual. Defaults to `DEFAULT`.\n atol\n The absolute norm of the residual. Defaults to `DEFAULT`.\n stol\n The absolute norm of the step. Defaults to `DEFAULT`.\n max_it\n The maximum allowed number of iterations. Defaults to `DEFAULT`\n\n See Also\n --------\n getTolerances, petsc.SNESSetTolerances\n\n \nSource code at petsc4py/PETSc/SNES.pyx:1028"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_101setTolerances(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_rtol = 0; PyObject *__pyx_v_atol = 0; PyObject *__pyx_v_stol = 0; PyObject *__pyx_v_max_it = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setTolerances (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rtol,&__pyx_n_s_atol,&__pyx_n_s_stol,&__pyx_n_s_max_it,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rtol); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 1028, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_atol); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 1028, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_stol); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 1028, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_max_it); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 1028, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setTolerances") < 0)) __PYX_ERR(50, 1028, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_rtol = values[0]; __pyx_v_atol = values[1]; __pyx_v_stol = values[2]; __pyx_v_max_it = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setTolerances", 0, 0, 4, __pyx_nargs); __PYX_ERR(50, 1028, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SNES.setTolerances", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_100setTolerances(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_rtol, __pyx_v_atol, __pyx_v_stol, __pyx_v_max_it); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_100setTolerances(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_rtol, PyObject *__pyx_v_atol, PyObject *__pyx_v_stol, PyObject *__pyx_v_max_it) { PetscReal __pyx_v_crtol; PetscReal __pyx_v_catol; PetscReal __pyx_v_cstol; PetscInt __pyx_v_cmaxit; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscReal __pyx_t_2; PetscInt __pyx_t_3; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setTolerances", 1); /* "petsc4py/PETSc/SNES.pyx":1050 * """ * cdef PetscReal crtol, catol, cstol * crtol = catol = cstol = PETSC_DEFAULT # <<<<<<<<<<<<<< * cdef PetscInt cmaxit = PETSC_DEFAULT * if rtol is not None: crtol = asReal(rtol) */ __pyx_v_crtol = PETSC_DEFAULT; __pyx_v_catol = PETSC_DEFAULT; __pyx_v_cstol = PETSC_DEFAULT; /* "petsc4py/PETSc/SNES.pyx":1051 * cdef PetscReal crtol, catol, cstol * crtol = catol = cstol = PETSC_DEFAULT * cdef PetscInt cmaxit = PETSC_DEFAULT # <<<<<<<<<<<<<< * if rtol is not None: crtol = asReal(rtol) * if atol is not None: catol = asReal(atol) */ __pyx_v_cmaxit = PETSC_DEFAULT; /* "petsc4py/PETSc/SNES.pyx":1052 * crtol = catol = cstol = PETSC_DEFAULT * cdef PetscInt cmaxit = PETSC_DEFAULT * if rtol is not None: crtol = asReal(rtol) # <<<<<<<<<<<<<< * if atol is not None: catol = asReal(atol) * if stol is not None: cstol = asReal(stol) */ __pyx_t_1 = (__pyx_v_rtol != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_rtol); if (unlikely(__pyx_t_2 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(50, 1052, __pyx_L1_error) __pyx_v_crtol = __pyx_t_2; } /* "petsc4py/PETSc/SNES.pyx":1053 * cdef PetscInt cmaxit = PETSC_DEFAULT * if rtol is not None: crtol = asReal(rtol) * if atol is not None: catol = asReal(atol) # <<<<<<<<<<<<<< * if stol is not None: cstol = asReal(stol) * if max_it is not None: cmaxit = asInt(max_it) */ __pyx_t_1 = (__pyx_v_atol != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_atol); if (unlikely(__pyx_t_2 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(50, 1053, __pyx_L1_error) __pyx_v_catol = __pyx_t_2; } /* "petsc4py/PETSc/SNES.pyx":1054 * if rtol is not None: crtol = asReal(rtol) * if atol is not None: catol = asReal(atol) * if stol is not None: cstol = asReal(stol) # <<<<<<<<<<<<<< * if max_it is not None: cmaxit = asInt(max_it) * CHKERR( SNESSetTolerances(self.snes, catol, crtol, cstol, */ __pyx_t_1 = (__pyx_v_stol != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_stol); if (unlikely(__pyx_t_2 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(50, 1054, __pyx_L1_error) __pyx_v_cstol = __pyx_t_2; } /* "petsc4py/PETSc/SNES.pyx":1055 * if atol is not None: catol = asReal(atol) * if stol is not None: cstol = asReal(stol) * if max_it is not None: cmaxit = asInt(max_it) # <<<<<<<<<<<<<< * CHKERR( SNESSetTolerances(self.snes, catol, crtol, cstol, * cmaxit, PETSC_DEFAULT) ) */ __pyx_t_1 = (__pyx_v_max_it != Py_None); if (__pyx_t_1) { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_max_it); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(50, 1055, __pyx_L1_error) __pyx_v_cmaxit = __pyx_t_3; } /* "petsc4py/PETSc/SNES.pyx":1056 * if stol is not None: cstol = asReal(stol) * if max_it is not None: cmaxit = asInt(max_it) * CHKERR( SNESSetTolerances(self.snes, catol, crtol, cstol, # <<<<<<<<<<<<<< * cmaxit, PETSC_DEFAULT) ) * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetTolerances(__pyx_v_self->snes, __pyx_v_catol, __pyx_v_crtol, __pyx_v_cstol, __pyx_v_cmaxit, PETSC_DEFAULT)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1056, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":1028 * # --- tolerances and convergence --- * * def setTolerances(self, rtol: float = None, atol: float = None, stol: float = None, max_it: int = None) -> None: # <<<<<<<<<<<<<< * """Set the tolerance parameters used in the solver convergence tests. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setTolerances", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":1059 * cmaxit, PETSC_DEFAULT) ) * * def getTolerances(self) -> tuple[float, float, float, int]: # <<<<<<<<<<<<<< * """Return the tolerance parameters used in the solver convergence tests. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_103getTolerances(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_102getTolerances, "SNES.getTolerances(self) -> tuple[float, float, float, int]\nReturn the tolerance parameters used in the solver convergence tests.\n\n Collective.\n\n Returns\n -------\n rtol : float\n The relative norm of the residual.\n atol : float\n The absolute norm of the residual.\n stol : float\n The absolute norm of the step.\n max_it : int\n The maximum allowed number of iterations.\n\n See Also\n --------\n setTolerances, petsc.SNESGetTolerances\n\n \nSource code at petsc4py/PETSc/SNES.pyx:1059"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_103getTolerances(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getTolerances (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getTolerances", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getTolerances", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_102getTolerances(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_102getTolerances(struct PyPetscSNESObject *__pyx_v_self) { PetscReal __pyx_v_crtol; PetscReal __pyx_v_catol; PetscReal __pyx_v_cstol; PetscInt __pyx_v_cmaxit; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getTolerances", 1); /* "petsc4py/PETSc/SNES.pyx":1080 * * """ * cdef PetscReal crtol=0, catol=0, cstol=0 # <<<<<<<<<<<<<< * cdef PetscInt cmaxit=0 * CHKERR( SNESGetTolerances(self.snes, &catol, &crtol, &cstol, */ __pyx_v_crtol = 0.0; __pyx_v_catol = 0.0; __pyx_v_cstol = 0.0; /* "petsc4py/PETSc/SNES.pyx":1081 * """ * cdef PetscReal crtol=0, catol=0, cstol=0 * cdef PetscInt cmaxit=0 # <<<<<<<<<<<<<< * CHKERR( SNESGetTolerances(self.snes, &catol, &crtol, &cstol, * &cmaxit, NULL) ) */ __pyx_v_cmaxit = 0; /* "petsc4py/PETSc/SNES.pyx":1082 * cdef PetscReal crtol=0, catol=0, cstol=0 * cdef PetscInt cmaxit=0 * CHKERR( SNESGetTolerances(self.snes, &catol, &crtol, &cstol, # <<<<<<<<<<<<<< * &cmaxit, NULL) ) * return (toReal(crtol), toReal(catol), toReal(cstol), toInt(cmaxit)) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetTolerances(__pyx_v_self->snes, (&__pyx_v_catol), (&__pyx_v_crtol), (&__pyx_v_cstol), (&__pyx_v_cmaxit), NULL)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1082, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":1084 * CHKERR( SNESGetTolerances(self.snes, &catol, &crtol, &cstol, * &cmaxit, NULL) ) * return (toReal(crtol), toReal(catol), toReal(cstol), toInt(cmaxit)) # <<<<<<<<<<<<<< * * def setNormSchedule(self, normsched: NormSchedule) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_crtol); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 1084, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_catol); if (unlikely(!__pyx_t_3)) __PYX_ERR(50, 1084, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_cstol); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 1084, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_cmaxit); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 1084, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(50, 1084, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2)) __PYX_ERR(50, 1084, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3)) __PYX_ERR(50, 1084, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_4)) __PYX_ERR(50, 1084, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_5)) __PYX_ERR(50, 1084, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":1059 * cmaxit, PETSC_DEFAULT) ) * * def getTolerances(self) -> tuple[float, float, float, int]: # <<<<<<<<<<<<<< * """Return the tolerance parameters used in the solver convergence tests. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getTolerances", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":1086 * return (toReal(crtol), toReal(catol), toReal(cstol), toInt(cmaxit)) * * def setNormSchedule(self, normsched: NormSchedule) -> None: # <<<<<<<<<<<<<< * """Set the norm schedule. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_105setNormSchedule(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_104setNormSchedule, "SNES.setNormSchedule(self, normsched: NormSchedule) -> None\nSet the norm schedule.\n\n Collective.\n\n See Also\n --------\n getNormSchedule, petsc.SNESSetNormSchedule\n\n \nSource code at petsc4py/PETSc/SNES.pyx:1086"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_105setNormSchedule(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_normsched = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setNormSchedule (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_normsched,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_normsched)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 1086, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setNormSchedule") < 0)) __PYX_ERR(50, 1086, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_normsched = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setNormSchedule", 1, 1, 1, __pyx_nargs); __PYX_ERR(50, 1086, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SNES.setNormSchedule", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_104setNormSchedule(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_normsched); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_104setNormSchedule(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_normsched) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations SNESNormSchedule __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setNormSchedule", 1); /* "petsc4py/PETSc/SNES.pyx":1096 * * """ * CHKERR( SNESSetNormSchedule(self.snes, normsched) ) # <<<<<<<<<<<<<< * * def getNormSchedule(self) -> NormSchedule: */ __pyx_t_1 = ((SNESNormSchedule)__Pyx_PyInt_As_SNESNormSchedule(__pyx_v_normsched)); if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 1096, __pyx_L1_error) __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetNormSchedule(__pyx_v_self->snes, __pyx_t_1)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1096, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":1086 * return (toReal(crtol), toReal(catol), toReal(cstol), toInt(cmaxit)) * * def setNormSchedule(self, normsched: NormSchedule) -> None: # <<<<<<<<<<<<<< * """Set the norm schedule. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setNormSchedule", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":1098 * CHKERR( SNESSetNormSchedule(self.snes, normsched) ) * * def getNormSchedule(self) -> NormSchedule: # <<<<<<<<<<<<<< * """Return the norm schedule. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_107getNormSchedule(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_106getNormSchedule, "SNES.getNormSchedule(self) -> NormSchedule\nReturn the norm schedule.\n\n Not collective.\n\n See Also\n --------\n setNormSchedule, petsc.SNESGetNormSchedule\n\n \nSource code at petsc4py/PETSc/SNES.pyx:1098"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_107getNormSchedule(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getNormSchedule (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getNormSchedule", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getNormSchedule", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_106getNormSchedule(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_106getNormSchedule(struct PyPetscSNESObject *__pyx_v_self) { SNESNormSchedule __pyx_v_normsched; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getNormSchedule", 1); /* "petsc4py/PETSc/SNES.pyx":1108 * * """ * cdef PetscSNESNormSchedule normsched = SNES_NORM_NONE # <<<<<<<<<<<<<< * CHKERR( SNESGetNormSchedule(self.snes, &normsched) ) * return normsched */ __pyx_v_normsched = SNES_NORM_NONE; /* "petsc4py/PETSc/SNES.pyx":1109 * """ * cdef PetscSNESNormSchedule normsched = SNES_NORM_NONE * CHKERR( SNESGetNormSchedule(self.snes, &normsched) ) # <<<<<<<<<<<<<< * return normsched * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetNormSchedule(__pyx_v_self->snes, (&__pyx_v_normsched))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1109, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":1110 * cdef PetscSNESNormSchedule normsched = SNES_NORM_NONE * CHKERR( SNESGetNormSchedule(self.snes, &normsched) ) * return normsched # <<<<<<<<<<<<<< * * def setConvergenceTest(self, converged: SNESConvergedFunction | Literal["skip", "default"], */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_SNESNormSchedule(__pyx_v_normsched); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 1110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":1098 * CHKERR( SNESSetNormSchedule(self.snes, normsched) ) * * def getNormSchedule(self) -> NormSchedule: # <<<<<<<<<<<<<< * """Return the norm schedule. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getNormSchedule", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":1112 * return normsched * * def setConvergenceTest(self, converged: SNESConvergedFunction | Literal["skip", "default"], # <<<<<<<<<<<<<< * args: tuple[Any, ...] | None = None, * kargs: dict[str, Any] | None = None) -> None: */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_109setConvergenceTest(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_108setConvergenceTest, "SNES.setConvergenceTest(self, converged: SNESConvergedFunction | Literal['skip', 'default'], args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nSet the callback to use as convergence test.\n\n Logically collective.\n\n Parameters\n ----------\n converged\n The convergence testing callback.\n args\n Positional arguments for the callback.\n kargs\n Keyword arguments for the callback.\n\n See Also\n --------\n getConvergenceTest, callConvergenceTest, petsc.SNESSetConvergenceTest\n\n \nSource code at petsc4py/PETSc/SNES.pyx:1112"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_109setConvergenceTest(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_converged = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setConvergenceTest (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_converged,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; /* "petsc4py/PETSc/SNES.pyx":1113 * * def setConvergenceTest(self, converged: SNESConvergedFunction | Literal["skip", "default"], * args: tuple[Any, ...] | None = None, # <<<<<<<<<<<<<< * kargs: dict[str, Any] | None = None) -> None: * """Set the callback to use as convergence test. */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/SNES.pyx":1114 * def setConvergenceTest(self, converged: SNESConvergedFunction | Literal["skip", "default"], * args: tuple[Any, ...] | None = None, * kargs: dict[str, Any] | None = None) -> None: # <<<<<<<<<<<<<< * """Set the callback to use as convergence test. * */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_converged)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 1112, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 1112, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 1112, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setConvergenceTest") < 0)) __PYX_ERR(50, 1112, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_converged = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setConvergenceTest", 0, 1, 3, __pyx_nargs); __PYX_ERR(50, 1112, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SNES.setConvergenceTest", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_108setConvergenceTest(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_converged, __pyx_v_args, __pyx_v_kargs); /* "petsc4py/PETSc/SNES.pyx":1112 * return normsched * * def setConvergenceTest(self, converged: SNESConvergedFunction | Literal["skip", "default"], # <<<<<<<<<<<<<< * args: tuple[Any, ...] | None = None, * kargs: dict[str, Any] | None = None) -> None: */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_108setConvergenceTest(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_converged, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setConvergenceTest", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/SNES.pyx":1133 * * """ * if converged == "skip": # <<<<<<<<<<<<<< * self.set_attr('__converged__', None) * CHKERR( SNESSetConvergenceTest(self.snes, SNESConvergedSkip, NULL, NULL) ) */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_converged, __pyx_n_s_skip, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(50, 1133, __pyx_L1_error) if (__pyx_t_1) { /* "petsc4py/PETSc/SNES.pyx":1134 * """ * if converged == "skip": * self.set_attr('__converged__', None) # <<<<<<<<<<<<<< * CHKERR( SNESSetConvergenceTest(self.snes, SNESConvergedSkip, NULL, NULL) ) * elif converged is None or converged == "default": */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__converged__"), Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 1134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/SNES.pyx":1135 * if converged == "skip": * self.set_attr('__converged__', None) * CHKERR( SNESSetConvergenceTest(self.snes, SNESConvergedSkip, NULL, NULL) ) # <<<<<<<<<<<<<< * elif converged is None or converged == "default": * self.set_attr('__converged__', None) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetConvergenceTest(__pyx_v_self->snes, SNESConvergedSkip, NULL, NULL)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1135, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":1133 * * """ * if converged == "skip": # <<<<<<<<<<<<<< * self.set_attr('__converged__', None) * CHKERR( SNESSetConvergenceTest(self.snes, SNESConvergedSkip, NULL, NULL) ) */ goto __pyx_L3; } /* "petsc4py/PETSc/SNES.pyx":1136 * self.set_attr('__converged__', None) * CHKERR( SNESSetConvergenceTest(self.snes, SNESConvergedSkip, NULL, NULL) ) * elif converged is None or converged == "default": # <<<<<<<<<<<<<< * self.set_attr('__converged__', None) * CHKERR( SNESSetConvergenceTest(self.snes, SNESConvergedDefault, NULL, NULL) ) */ __pyx_t_4 = (__pyx_v_converged == Py_None); if (!__pyx_t_4) { } else { __pyx_t_1 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_converged, __pyx_n_s_default, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(50, 1136, __pyx_L1_error) __pyx_t_1 = __pyx_t_4; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "petsc4py/PETSc/SNES.pyx":1137 * CHKERR( SNESSetConvergenceTest(self.snes, SNESConvergedSkip, NULL, NULL) ) * elif converged is None or converged == "default": * self.set_attr('__converged__', None) # <<<<<<<<<<<<<< * CHKERR( SNESSetConvergenceTest(self.snes, SNESConvergedDefault, NULL, NULL) ) * else: */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__converged__"), Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 1137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/SNES.pyx":1138 * elif converged is None or converged == "default": * self.set_attr('__converged__', None) * CHKERR( SNESSetConvergenceTest(self.snes, SNESConvergedDefault, NULL, NULL) ) # <<<<<<<<<<<<<< * else: * assert callable(converged) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetConvergenceTest(__pyx_v_self->snes, SNESConvergedDefault, NULL, NULL)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1138, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":1136 * self.set_attr('__converged__', None) * CHKERR( SNESSetConvergenceTest(self.snes, SNESConvergedSkip, NULL, NULL) ) * elif converged is None or converged == "default": # <<<<<<<<<<<<<< * self.set_attr('__converged__', None) * CHKERR( SNESSetConvergenceTest(self.snes, SNESConvergedDefault, NULL, NULL) ) */ goto __pyx_L3; } /* "petsc4py/PETSc/SNES.pyx":1140 * CHKERR( SNESSetConvergenceTest(self.snes, SNESConvergedDefault, NULL, NULL) ) * else: * assert callable(converged) # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ /*else*/ { #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_1 = __Pyx_PyCallable_Check(__pyx_v_converged); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(50, 1140, __pyx_L1_error) if (unlikely(!__pyx_t_1)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(50, 1140, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(50, 1140, __pyx_L1_error) #endif /* "petsc4py/PETSc/SNES.pyx":1141 * else: * assert callable(converged) * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (converged, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/SNES.pyx":1142 * assert callable(converged) * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (converged, args, kargs) * self.set_attr('__converged__', context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); if (__pyx_t_1) { __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 1142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_2); __pyx_t_2 = 0; } /* "petsc4py/PETSc/SNES.pyx":1143 * if args is None: args = () * if kargs is None: kargs = {} * context = (converged, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__converged__', context) * CHKERR( SNESSetConvergenceTest(self.snes, SNES_Converged, context, NULL) ) */ __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 1143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_converged); __Pyx_GIVEREF(__pyx_v_converged); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_converged)) __PYX_ERR(50, 1143, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_args)) __PYX_ERR(50, 1143, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_kargs)) __PYX_ERR(50, 1143, __pyx_L1_error); __pyx_v_context = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/SNES.pyx":1144 * if kargs is None: kargs = {} * context = (converged, args, kargs) * self.set_attr('__converged__', context) # <<<<<<<<<<<<<< * CHKERR( SNESSetConvergenceTest(self.snes, SNES_Converged, context, NULL) ) * */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__converged__"), __pyx_v_context); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 1144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/SNES.pyx":1145 * context = (converged, args, kargs) * self.set_attr('__converged__', context) * CHKERR( SNESSetConvergenceTest(self.snes, SNES_Converged, context, NULL) ) # <<<<<<<<<<<<<< * * def getConvergenceTest(self) -> SNESConvergedFunction: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetConvergenceTest(__pyx_v_self->snes, __pyx_f_8petsc4py_5PETSc_SNES_Converged, ((void *)__pyx_v_context), NULL)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1145, __pyx_L1_error) } __pyx_L3:; /* "petsc4py/PETSc/SNES.pyx":1112 * return normsched * * def setConvergenceTest(self, converged: SNESConvergedFunction | Literal["skip", "default"], # <<<<<<<<<<<<<< * args: tuple[Any, ...] | None = None, * kargs: dict[str, Any] | None = None) -> None: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.setConvergenceTest", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":1147 * CHKERR( SNESSetConvergenceTest(self.snes, SNES_Converged, context, NULL) ) * * def getConvergenceTest(self) -> SNESConvergedFunction: # <<<<<<<<<<<<<< * """Return the callback to used as convergence test. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_111getConvergenceTest(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_110getConvergenceTest, "SNES.getConvergenceTest(self) -> SNESConvergedFunction\nReturn the callback to used as convergence test.\n\n Not collective.\n\n See Also\n --------\n setConvergenceTest, callConvergenceTest\n\n \nSource code at petsc4py/PETSc/SNES.pyx:1147"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_111getConvergenceTest(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getConvergenceTest (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getConvergenceTest", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getConvergenceTest", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_110getConvergenceTest(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_110getConvergenceTest(struct PyPetscSNESObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getConvergenceTest", 1); /* "petsc4py/PETSc/SNES.pyx":1157 * * """ * return self.get_attr('__converged__') # <<<<<<<<<<<<<< * * def callConvergenceTest(self, its: int, xnorm: float, ynorm: float, fnorm: float) -> ConvergedReason: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__converged__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 1157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":1147 * CHKERR( SNESSetConvergenceTest(self.snes, SNES_Converged, context, NULL) ) * * def getConvergenceTest(self) -> SNESConvergedFunction: # <<<<<<<<<<<<<< * """Return the callback to used as convergence test. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getConvergenceTest", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":1159 * return self.get_attr('__converged__') * * def callConvergenceTest(self, its: int, xnorm: float, ynorm: float, fnorm: float) -> ConvergedReason: # <<<<<<<<<<<<<< * """Compute the convergence test. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_113callConvergenceTest(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_112callConvergenceTest, "SNES.callConvergenceTest(self, its: int, xnorm: float, ynorm: float, fnorm: float) -> ConvergedReason\nCompute the convergence test.\n\n Collective.\n\n Parameters\n ----------\n its\n Iteration number.\n xnorm\n Solution norm.\n ynorm\n Update norm.\n fnorm\n Function norm.\n\n See Also\n --------\n setConvergenceTest, getConvergenceTest\n\n \nSource code at petsc4py/PETSc/SNES.pyx:1159"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_113callConvergenceTest(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_its = 0; PyObject *__pyx_v_xnorm = 0; PyObject *__pyx_v_ynorm = 0; PyObject *__pyx_v_fnorm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("callConvergenceTest (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_its,&__pyx_n_s_xnorm,&__pyx_n_s_ynorm,&__pyx_n_s_fnorm,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_its)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 1159, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_xnorm)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 1159, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("callConvergenceTest", 1, 4, 4, 1); __PYX_ERR(50, 1159, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ynorm)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 1159, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("callConvergenceTest", 1, 4, 4, 2); __PYX_ERR(50, 1159, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fnorm)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 1159, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("callConvergenceTest", 1, 4, 4, 3); __PYX_ERR(50, 1159, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "callConvergenceTest") < 0)) __PYX_ERR(50, 1159, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 4)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); } __pyx_v_its = values[0]; __pyx_v_xnorm = values[1]; __pyx_v_ynorm = values[2]; __pyx_v_fnorm = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("callConvergenceTest", 1, 4, 4, __pyx_nargs); __PYX_ERR(50, 1159, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SNES.callConvergenceTest", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_112callConvergenceTest(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_its, __pyx_v_xnorm, __pyx_v_ynorm, __pyx_v_fnorm); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_112callConvergenceTest(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_its, PyObject *__pyx_v_xnorm, PyObject *__pyx_v_ynorm, PyObject *__pyx_v_fnorm) { PetscInt __pyx_v_ival; PetscReal __pyx_v_rval1; PetscReal __pyx_v_rval2; PetscReal __pyx_v_rval3; SNESConvergedReason __pyx_v_reason; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscReal __pyx_t_2; PetscErrorCode __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("callConvergenceTest", 1); /* "petsc4py/PETSc/SNES.pyx":1180 * * """ * cdef PetscInt ival = asInt(its) # <<<<<<<<<<<<<< * cdef PetscReal rval1 = asReal(xnorm) * cdef PetscReal rval2 = asReal(ynorm) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_its); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(50, 1180, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "petsc4py/PETSc/SNES.pyx":1181 * """ * cdef PetscInt ival = asInt(its) * cdef PetscReal rval1 = asReal(xnorm) # <<<<<<<<<<<<<< * cdef PetscReal rval2 = asReal(ynorm) * cdef PetscReal rval3 = asReal(fnorm) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_xnorm); if (unlikely(__pyx_t_2 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(50, 1181, __pyx_L1_error) __pyx_v_rval1 = __pyx_t_2; /* "petsc4py/PETSc/SNES.pyx":1182 * cdef PetscInt ival = asInt(its) * cdef PetscReal rval1 = asReal(xnorm) * cdef PetscReal rval2 = asReal(ynorm) # <<<<<<<<<<<<<< * cdef PetscReal rval3 = asReal(fnorm) * cdef PetscSNESConvergedReason reason = SNES_CONVERGED_ITERATING */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_ynorm); if (unlikely(__pyx_t_2 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(50, 1182, __pyx_L1_error) __pyx_v_rval2 = __pyx_t_2; /* "petsc4py/PETSc/SNES.pyx":1183 * cdef PetscReal rval1 = asReal(xnorm) * cdef PetscReal rval2 = asReal(ynorm) * cdef PetscReal rval3 = asReal(fnorm) # <<<<<<<<<<<<<< * cdef PetscSNESConvergedReason reason = SNES_CONVERGED_ITERATING * CHKERR( SNESConvergenceTestCall(self.snes, ival, */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_fnorm); if (unlikely(__pyx_t_2 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(50, 1183, __pyx_L1_error) __pyx_v_rval3 = __pyx_t_2; /* "petsc4py/PETSc/SNES.pyx":1184 * cdef PetscReal rval2 = asReal(ynorm) * cdef PetscReal rval3 = asReal(fnorm) * cdef PetscSNESConvergedReason reason = SNES_CONVERGED_ITERATING # <<<<<<<<<<<<<< * CHKERR( SNESConvergenceTestCall(self.snes, ival, * rval1, rval2, rval3, &reason) ) */ __pyx_v_reason = SNES_CONVERGED_ITERATING; /* "petsc4py/PETSc/SNES.pyx":1185 * cdef PetscReal rval3 = asReal(fnorm) * cdef PetscSNESConvergedReason reason = SNES_CONVERGED_ITERATING * CHKERR( SNESConvergenceTestCall(self.snes, ival, # <<<<<<<<<<<<<< * rval1, rval2, rval3, &reason) ) * return reason */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESConvergenceTestCall(__pyx_v_self->snes, __pyx_v_ival, __pyx_v_rval1, __pyx_v_rval2, __pyx_v_rval3, (&__pyx_v_reason))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1185, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":1187 * CHKERR( SNESConvergenceTestCall(self.snes, ival, * rval1, rval2, rval3, &reason) ) * return reason # <<<<<<<<<<<<<< * * def converged(self, its: int, xnorm: float, ynorm: float, fnorm: float) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PyInt_From_SNESConvergedReason(__pyx_v_reason); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 1187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":1159 * return self.get_attr('__converged__') * * def callConvergenceTest(self, its: int, xnorm: float, ynorm: float, fnorm: float) -> ConvergedReason: # <<<<<<<<<<<<<< * """Compute the convergence test. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.SNES.callConvergenceTest", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":1189 * return reason * * def converged(self, its: int, xnorm: float, ynorm: float, fnorm: float) -> None: # <<<<<<<<<<<<<< * """Compute the convergence test and update the solver converged reason. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_115converged(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_114converged, "SNES.converged(self, its: int, xnorm: float, ynorm: float, fnorm: float) -> None\nCompute the convergence test and update the solver converged reason.\n\n Collective.\n\n Parameters\n ----------\n its\n Iteration number.\n xnorm\n Solution norm.\n ynorm\n Update norm.\n fnorm\n Function norm.\n\n See Also\n --------\n setConvergenceTest, getConvergenceTest, petsc.SNESConverged\n\n \nSource code at petsc4py/PETSc/SNES.pyx:1189"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_115converged(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_its = 0; PyObject *__pyx_v_xnorm = 0; PyObject *__pyx_v_ynorm = 0; PyObject *__pyx_v_fnorm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("converged (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_its,&__pyx_n_s_xnorm,&__pyx_n_s_ynorm,&__pyx_n_s_fnorm,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_its)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 1189, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_xnorm)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 1189, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("converged", 1, 4, 4, 1); __PYX_ERR(50, 1189, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ynorm)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 1189, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("converged", 1, 4, 4, 2); __PYX_ERR(50, 1189, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fnorm)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 1189, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("converged", 1, 4, 4, 3); __PYX_ERR(50, 1189, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "converged") < 0)) __PYX_ERR(50, 1189, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 4)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); } __pyx_v_its = values[0]; __pyx_v_xnorm = values[1]; __pyx_v_ynorm = values[2]; __pyx_v_fnorm = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("converged", 1, 4, 4, __pyx_nargs); __PYX_ERR(50, 1189, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SNES.converged", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_114converged(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_its, __pyx_v_xnorm, __pyx_v_ynorm, __pyx_v_fnorm); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_114converged(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_its, PyObject *__pyx_v_xnorm, PyObject *__pyx_v_ynorm, PyObject *__pyx_v_fnorm) { PetscInt __pyx_v_ival; PetscReal __pyx_v_rval1; PetscReal __pyx_v_rval2; PetscReal __pyx_v_rval3; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscReal __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("converged", 1); /* "petsc4py/PETSc/SNES.pyx":1210 * * """ * cdef PetscInt ival = asInt(its) # <<<<<<<<<<<<<< * cdef PetscReal rval1 = asReal(xnorm) * cdef PetscReal rval2 = asReal(ynorm) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_its); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(50, 1210, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "petsc4py/PETSc/SNES.pyx":1211 * """ * cdef PetscInt ival = asInt(its) * cdef PetscReal rval1 = asReal(xnorm) # <<<<<<<<<<<<<< * cdef PetscReal rval2 = asReal(ynorm) * cdef PetscReal rval3 = asReal(fnorm) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_xnorm); if (unlikely(__pyx_t_2 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(50, 1211, __pyx_L1_error) __pyx_v_rval1 = __pyx_t_2; /* "petsc4py/PETSc/SNES.pyx":1212 * cdef PetscInt ival = asInt(its) * cdef PetscReal rval1 = asReal(xnorm) * cdef PetscReal rval2 = asReal(ynorm) # <<<<<<<<<<<<<< * cdef PetscReal rval3 = asReal(fnorm) * CHKERR( SNESConverged(self.snes, ival, rval1, rval2, rval3) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_ynorm); if (unlikely(__pyx_t_2 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(50, 1212, __pyx_L1_error) __pyx_v_rval2 = __pyx_t_2; /* "petsc4py/PETSc/SNES.pyx":1213 * cdef PetscReal rval1 = asReal(xnorm) * cdef PetscReal rval2 = asReal(ynorm) * cdef PetscReal rval3 = asReal(fnorm) # <<<<<<<<<<<<<< * CHKERR( SNESConverged(self.snes, ival, rval1, rval2, rval3) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_fnorm); if (unlikely(__pyx_t_2 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(50, 1213, __pyx_L1_error) __pyx_v_rval3 = __pyx_t_2; /* "petsc4py/PETSc/SNES.pyx":1214 * cdef PetscReal rval2 = asReal(ynorm) * cdef PetscReal rval3 = asReal(fnorm) * CHKERR( SNESConverged(self.snes, ival, rval1, rval2, rval3) ) # <<<<<<<<<<<<<< * * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESConverged(__pyx_v_self->snes, __pyx_v_ival, __pyx_v_rval1, __pyx_v_rval2, __pyx_v_rval3)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1214, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":1189 * return reason * * def converged(self, its: int, xnorm: float, ynorm: float, fnorm: float) -> None: # <<<<<<<<<<<<<< * """Compute the convergence test and update the solver converged reason. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.converged", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":1217 * * * def setConvergenceHistory(self, length=None, reset=False) -> None: # <<<<<<<<<<<<<< * """Set the convergence history. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_117setConvergenceHistory(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_116setConvergenceHistory, "SNES.setConvergenceHistory(self, length=None, reset=False) -> None\nSet the convergence history.\n\n Logically collective.\n\n See Also\n --------\n petsc.SNESSetConvergenceHistory\n\n \nSource code at petsc4py/PETSc/SNES.pyx:1217"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_117setConvergenceHistory(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_length = 0; PyObject *__pyx_v_reset = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setConvergenceHistory (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_length,&__pyx_n_s_reset,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_length); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 1217, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_reset); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 1217, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setConvergenceHistory") < 0)) __PYX_ERR(50, 1217, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_length = values[0]; __pyx_v_reset = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setConvergenceHistory", 0, 0, 2, __pyx_nargs); __PYX_ERR(50, 1217, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SNES.setConvergenceHistory", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_116setConvergenceHistory(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_length, __pyx_v_reset); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_116setConvergenceHistory(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_length, PyObject *__pyx_v_reset) { PetscReal *__pyx_v_rdata; PetscInt *__pyx_v_idata; PetscInt __pyx_v_size; PetscBool __pyx_v_flag; PyObject *__pyx_v_rhist = 0; PyObject *__pyx_v_ihist = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscInt __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PetscErrorCode __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setConvergenceHistory", 1); /* "petsc4py/PETSc/SNES.pyx":1227 * * """ * cdef PetscReal *rdata = NULL # <<<<<<<<<<<<<< * cdef PetscInt *idata = NULL * cdef PetscInt size = 1000 */ __pyx_v_rdata = NULL; /* "petsc4py/PETSc/SNES.pyx":1228 * """ * cdef PetscReal *rdata = NULL * cdef PetscInt *idata = NULL # <<<<<<<<<<<<<< * cdef PetscInt size = 1000 * cdef PetscBool flag = PETSC_FALSE */ __pyx_v_idata = NULL; /* "petsc4py/PETSc/SNES.pyx":1229 * cdef PetscReal *rdata = NULL * cdef PetscInt *idata = NULL * cdef PetscInt size = 1000 # <<<<<<<<<<<<<< * cdef PetscBool flag = PETSC_FALSE * #FIXME */ __pyx_v_size = 0x3E8; /* "petsc4py/PETSc/SNES.pyx":1230 * cdef PetscInt *idata = NULL * cdef PetscInt size = 1000 * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * #FIXME * if length is True: pass */ __pyx_v_flag = PETSC_FALSE; /* "petsc4py/PETSc/SNES.pyx":1232 * cdef PetscBool flag = PETSC_FALSE * #FIXME * if length is True: pass # <<<<<<<<<<<<<< * elif length is not None: size = asInt(length) * if size < 0: size = 1000 */ __pyx_t_1 = (__pyx_v_length == Py_True); if (__pyx_t_1) { goto __pyx_L3; } /* "petsc4py/PETSc/SNES.pyx":1233 * #FIXME * if length is True: pass * elif length is not None: size = asInt(length) # <<<<<<<<<<<<<< * if size < 0: size = 1000 * if reset: flag = PETSC_TRUE */ __pyx_t_1 = (__pyx_v_length != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_length); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(50, 1233, __pyx_L1_error) __pyx_v_size = __pyx_t_2; } __pyx_L3:; /* "petsc4py/PETSc/SNES.pyx":1234 * if length is True: pass * elif length is not None: size = asInt(length) * if size < 0: size = 1000 # <<<<<<<<<<<<<< * if reset: flag = PETSC_TRUE * cdef object rhist = oarray_r(empty_r(size), NULL, &rdata) */ __pyx_t_1 = (__pyx_v_size < 0); if (__pyx_t_1) { __pyx_v_size = 0x3E8; } /* "petsc4py/PETSc/SNES.pyx":1235 * elif length is not None: size = asInt(length) * if size < 0: size = 1000 * if reset: flag = PETSC_TRUE # <<<<<<<<<<<<<< * cdef object rhist = oarray_r(empty_r(size), NULL, &rdata) * cdef object ihist = oarray_i(empty_i(size), NULL, &idata) */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_reset); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(50, 1235, __pyx_L1_error) if (__pyx_t_1) { __pyx_v_flag = PETSC_TRUE; } /* "petsc4py/PETSc/SNES.pyx":1236 * if size < 0: size = 1000 * if reset: flag = PETSC_TRUE * cdef object rhist = oarray_r(empty_r(size), NULL, &rdata) # <<<<<<<<<<<<<< * cdef object ihist = oarray_i(empty_i(size), NULL, &idata) * self.set_attr('__history__', (rhist, ihist)) */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_r(__pyx_v_size)); if (unlikely(!__pyx_t_3)) __PYX_ERR(50, 1236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_r(__pyx_t_3, NULL, (&__pyx_v_rdata))); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 1236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_rhist = __pyx_t_4; __pyx_t_4 = 0; /* "petsc4py/PETSc/SNES.pyx":1237 * if reset: flag = PETSC_TRUE * cdef object rhist = oarray_r(empty_r(size), NULL, &rdata) * cdef object ihist = oarray_i(empty_i(size), NULL, &idata) # <<<<<<<<<<<<<< * self.set_attr('__history__', (rhist, ihist)) * CHKERR( SNESSetConvergenceHistory(self.snes, rdata, idata, size, flag) ) */ __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_i(__pyx_v_size)); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 1237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_i(__pyx_t_4, NULL, (&__pyx_v_idata))); if (unlikely(!__pyx_t_3)) __PYX_ERR(50, 1237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_ihist = __pyx_t_3; __pyx_t_3 = 0; /* "petsc4py/PETSc/SNES.pyx":1238 * cdef object rhist = oarray_r(empty_r(size), NULL, &rdata) * cdef object ihist = oarray_i(empty_i(size), NULL, &idata) * self.set_attr('__history__', (rhist, ihist)) # <<<<<<<<<<<<<< * CHKERR( SNESSetConvergenceHistory(self.snes, rdata, idata, size, flag) ) * */ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(50, 1238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_rhist); __Pyx_GIVEREF(__pyx_v_rhist); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_rhist)) __PYX_ERR(50, 1238, __pyx_L1_error); __Pyx_INCREF(__pyx_v_ihist); __Pyx_GIVEREF(__pyx_v_ihist); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_ihist)) __PYX_ERR(50, 1238, __pyx_L1_error); __pyx_t_4 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__history__"), __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 1238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/SNES.pyx":1239 * cdef object ihist = oarray_i(empty_i(size), NULL, &idata) * self.set_attr('__history__', (rhist, ihist)) * CHKERR( SNESSetConvergenceHistory(self.snes, rdata, idata, size, flag) ) # <<<<<<<<<<<<<< * * def getConvergenceHistory(self) -> tuple[ArrayReal, ArrayInt]: */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetConvergenceHistory(__pyx_v_self->snes, __pyx_v_rdata, __pyx_v_idata, __pyx_v_size, __pyx_v_flag)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1239, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":1217 * * * def setConvergenceHistory(self, length=None, reset=False) -> None: # <<<<<<<<<<<<<< * """Set the convergence history. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.SNES.setConvergenceHistory", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rhist); __Pyx_XDECREF(__pyx_v_ihist); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":1241 * CHKERR( SNESSetConvergenceHistory(self.snes, rdata, idata, size, flag) ) * * def getConvergenceHistory(self) -> tuple[ArrayReal, ArrayInt]: # <<<<<<<<<<<<<< * """Return the convergence history. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_119getConvergenceHistory(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_118getConvergenceHistory, "SNES.getConvergenceHistory(self) -> tuple[ArrayReal, ArrayInt]\nReturn the convergence history.\n\n Not collective.\n\n See Also\n --------\n petsc.SNESGetConvergenceHistory\n\n \nSource code at petsc4py/PETSc/SNES.pyx:1241"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_119getConvergenceHistory(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getConvergenceHistory (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getConvergenceHistory", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getConvergenceHistory", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_118getConvergenceHistory(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_118getConvergenceHistory(struct PyPetscSNESObject *__pyx_v_self) { PetscReal *__pyx_v_rdata; PetscInt *__pyx_v_idata; PetscInt __pyx_v_size; PyObject *__pyx_v_rhist = 0; PyObject *__pyx_v_ihist = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getConvergenceHistory", 1); /* "petsc4py/PETSc/SNES.pyx":1251 * * """ * cdef PetscReal *rdata = NULL # <<<<<<<<<<<<<< * cdef PetscInt *idata = NULL * cdef PetscInt size = 0 */ __pyx_v_rdata = NULL; /* "petsc4py/PETSc/SNES.pyx":1252 * """ * cdef PetscReal *rdata = NULL * cdef PetscInt *idata = NULL # <<<<<<<<<<<<<< * cdef PetscInt size = 0 * CHKERR( SNESGetConvergenceHistory(self.snes, &rdata, &idata, &size) ) */ __pyx_v_idata = NULL; /* "petsc4py/PETSc/SNES.pyx":1253 * cdef PetscReal *rdata = NULL * cdef PetscInt *idata = NULL * cdef PetscInt size = 0 # <<<<<<<<<<<<<< * CHKERR( SNESGetConvergenceHistory(self.snes, &rdata, &idata, &size) ) * cdef object rhist = array_r(size, rdata) */ __pyx_v_size = 0; /* "petsc4py/PETSc/SNES.pyx":1254 * cdef PetscInt *idata = NULL * cdef PetscInt size = 0 * CHKERR( SNESGetConvergenceHistory(self.snes, &rdata, &idata, &size) ) # <<<<<<<<<<<<<< * cdef object rhist = array_r(size, rdata) * cdef object ihist = array_i(size, idata) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetConvergenceHistory(__pyx_v_self->snes, (&__pyx_v_rdata), (&__pyx_v_idata), (&__pyx_v_size))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1254, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":1255 * cdef PetscInt size = 0 * CHKERR( SNESGetConvergenceHistory(self.snes, &rdata, &idata, &size) ) * cdef object rhist = array_r(size, rdata) # <<<<<<<<<<<<<< * cdef object ihist = array_i(size, idata) * return (rhist, ihist) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_r(__pyx_v_size, __pyx_v_rdata)); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 1255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_rhist = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/SNES.pyx":1256 * CHKERR( SNESGetConvergenceHistory(self.snes, &rdata, &idata, &size) ) * cdef object rhist = array_r(size, rdata) * cdef object ihist = array_i(size, idata) # <<<<<<<<<<<<<< * return (rhist, ihist) * */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i(__pyx_v_size, __pyx_v_idata)); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 1256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_ihist = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/SNES.pyx":1257 * cdef object rhist = array_r(size, rdata) * cdef object ihist = array_i(size, idata) * return (rhist, ihist) # <<<<<<<<<<<<<< * * def logConvergenceHistory(self, norm: float, linear_its: int = 0) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 1257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_rhist); __Pyx_GIVEREF(__pyx_v_rhist); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_rhist)) __PYX_ERR(50, 1257, __pyx_L1_error); __Pyx_INCREF(__pyx_v_ihist); __Pyx_GIVEREF(__pyx_v_ihist); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_ihist)) __PYX_ERR(50, 1257, __pyx_L1_error); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":1241 * CHKERR( SNESSetConvergenceHistory(self.snes, rdata, idata, size, flag) ) * * def getConvergenceHistory(self) -> tuple[ArrayReal, ArrayInt]: # <<<<<<<<<<<<<< * """Return the convergence history. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getConvergenceHistory", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rhist); __Pyx_XDECREF(__pyx_v_ihist); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":1259 * return (rhist, ihist) * * def logConvergenceHistory(self, norm: float, linear_its: int = 0) -> None: # <<<<<<<<<<<<<< * """Log residual norm and linear iterations.""" * cdef PetscReal rval = asReal(norm) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_121logConvergenceHistory(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_120logConvergenceHistory, "SNES.logConvergenceHistory(self, norm: float, linear_its: int = 0) -> None\nLog residual norm and linear iterations.\nSource code at petsc4py/PETSc/SNES.pyx:1259"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_121logConvergenceHistory(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_norm = 0; PyObject *__pyx_v_linear_its = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("logConvergenceHistory (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_norm,&__pyx_n_s_linear_its,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_0)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_norm)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 1259, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_linear_its); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 1259, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "logConvergenceHistory") < 0)) __PYX_ERR(50, 1259, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_norm = values[0]; __pyx_v_linear_its = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("logConvergenceHistory", 0, 1, 2, __pyx_nargs); __PYX_ERR(50, 1259, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SNES.logConvergenceHistory", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_120logConvergenceHistory(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_norm, __pyx_v_linear_its); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_120logConvergenceHistory(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_norm, PyObject *__pyx_v_linear_its) { PetscReal __pyx_v_rval; PetscInt __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; PetscInt __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("logConvergenceHistory", 1); /* "petsc4py/PETSc/SNES.pyx":1261 * def logConvergenceHistory(self, norm: float, linear_its: int = 0) -> None: * """Log residual norm and linear iterations.""" * cdef PetscReal rval = asReal(norm) # <<<<<<<<<<<<<< * cdef PetscInt ival = asInt(linear_its) * CHKERR( SNESLogConvergenceHistory(self.snes, rval, ival) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_norm); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(50, 1261, __pyx_L1_error) __pyx_v_rval = __pyx_t_1; /* "petsc4py/PETSc/SNES.pyx":1262 * """Log residual norm and linear iterations.""" * cdef PetscReal rval = asReal(norm) * cdef PetscInt ival = asInt(linear_its) # <<<<<<<<<<<<<< * CHKERR( SNESLogConvergenceHistory(self.snes, rval, ival) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_linear_its); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(50, 1262, __pyx_L1_error) __pyx_v_ival = __pyx_t_2; /* "petsc4py/PETSc/SNES.pyx":1263 * cdef PetscReal rval = asReal(norm) * cdef PetscInt ival = asInt(linear_its) * CHKERR( SNESLogConvergenceHistory(self.snes, rval, ival) ) # <<<<<<<<<<<<<< * * def setResetCounters(self, reset: bool = True) -> None: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESLogConvergenceHistory(__pyx_v_self->snes, __pyx_v_rval, __pyx_v_ival)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1263, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":1259 * return (rhist, ihist) * * def logConvergenceHistory(self, norm: float, linear_its: int = 0) -> None: # <<<<<<<<<<<<<< * """Log residual norm and linear iterations.""" * cdef PetscReal rval = asReal(norm) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.logConvergenceHistory", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":1265 * CHKERR( SNESLogConvergenceHistory(self.snes, rval, ival) ) * * def setResetCounters(self, reset: bool = True) -> None: # <<<<<<<<<<<<<< * """Set the flag to reset the counters. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_123setResetCounters(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_122setResetCounters, "SNES.setResetCounters(self, reset: bool = True) -> None\nSet the flag to reset the counters.\n\n Collective.\n\n See Also\n --------\n petsc.SNESSetCountersReset\n\n \nSource code at petsc4py/PETSc/SNES.pyx:1265"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_123setResetCounters(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_reset = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setResetCounters (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_reset,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_True)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_reset); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 1265, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setResetCounters") < 0)) __PYX_ERR(50, 1265, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_reset = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setResetCounters", 0, 0, 1, __pyx_nargs); __PYX_ERR(50, 1265, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SNES.setResetCounters", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_122setResetCounters(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_reset); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_122setResetCounters(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_reset) { PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setResetCounters", 1); /* "petsc4py/PETSc/SNES.pyx":1275 * * """ * cdef PetscBool flag = reset # <<<<<<<<<<<<<< * CHKERR( SNESSetCountersReset(self.snes, flag) ) * */ __pyx_t_1 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_reset)); if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 1275, __pyx_L1_error) __pyx_v_flag = __pyx_t_1; /* "petsc4py/PETSc/SNES.pyx":1276 * """ * cdef PetscBool flag = reset * CHKERR( SNESSetCountersReset(self.snes, flag) ) # <<<<<<<<<<<<<< * * # --- monitoring --- */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetCountersReset(__pyx_v_self->snes, __pyx_v_flag)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1276, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":1265 * CHKERR( SNESLogConvergenceHistory(self.snes, rval, ival) ) * * def setResetCounters(self, reset: bool = True) -> None: # <<<<<<<<<<<<<< * """Set the flag to reset the counters. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setResetCounters", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":1280 * # --- monitoring --- * * def setMonitor(self, monitor: SNESMonitorFunction, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: # <<<<<<<<<<<<<< * """Set the callback used to monitor solver convergence. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_125setMonitor(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_124setMonitor, "SNES.setMonitor(self, monitor: SNESMonitorFunction, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nSet the callback used to monitor solver convergence.\n\n Logically collective.\n\n Parameters\n ----------\n monitor\n The callback.\n args\n Positional arguments for the callback.\n kargs\n Keyword arguments for the callback.\n\n See Also\n --------\n getMonitor, petsc.SNESMonitorSet\n\n \nSource code at petsc4py/PETSc/SNES.pyx:1280"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_125setMonitor(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_monitor = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setMonitor (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_monitor,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_monitor)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 1280, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 1280, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 1280, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setMonitor") < 0)) __PYX_ERR(50, 1280, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_monitor = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setMonitor", 0, 1, 3, __pyx_nargs); __PYX_ERR(50, 1280, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SNES.setMonitor", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_124setMonitor(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_monitor, __pyx_v_args, __pyx_v_kargs); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_124setMonitor(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_monitor, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_monitorlist = 0; PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setMonitor", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/SNES.pyx":1299 * * """ * if monitor is None: return # <<<<<<<<<<<<<< * cdef object monitorlist = self.get_attr('__monitor__') * if monitorlist is None: */ __pyx_t_1 = (__pyx_v_monitor == Py_None); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } /* "petsc4py/PETSc/SNES.pyx":1300 * """ * if monitor is None: return * cdef object monitorlist = self.get_attr('__monitor__') # <<<<<<<<<<<<<< * if monitorlist is None: * monitorlist = [] */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__monitor__")); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 1300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_monitorlist = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/SNES.pyx":1301 * if monitor is None: return * cdef object monitorlist = self.get_attr('__monitor__') * if monitorlist is None: # <<<<<<<<<<<<<< * monitorlist = [] * self.set_attr('__monitor__', monitorlist) */ __pyx_t_1 = (__pyx_v_monitorlist == Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/SNES.pyx":1302 * cdef object monitorlist = self.get_attr('__monitor__') * if monitorlist is None: * monitorlist = [] # <<<<<<<<<<<<<< * self.set_attr('__monitor__', monitorlist) * CHKERR( SNESMonitorSet(self.snes, SNES_Monitor, NULL, NULL) ) */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 1302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_monitorlist, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/SNES.pyx":1303 * if monitorlist is None: * monitorlist = [] * self.set_attr('__monitor__', monitorlist) # <<<<<<<<<<<<<< * CHKERR( SNESMonitorSet(self.snes, SNES_Monitor, NULL, NULL) ) * if args is None: args = () */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__monitor__"), __pyx_v_monitorlist); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 1303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/SNES.pyx":1304 * monitorlist = [] * self.set_attr('__monitor__', monitorlist) * CHKERR( SNESMonitorSet(self.snes, SNES_Monitor, NULL, NULL) ) # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESMonitorSet(__pyx_v_self->snes, __pyx_f_8petsc4py_5PETSc_SNES_Monitor, NULL, NULL)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1304, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":1301 * if monitor is None: return * cdef object monitorlist = self.get_attr('__monitor__') * if monitorlist is None: # <<<<<<<<<<<<<< * monitorlist = [] * self.set_attr('__monitor__', monitorlist) */ } /* "petsc4py/PETSc/SNES.pyx":1305 * self.set_attr('__monitor__', monitorlist) * CHKERR( SNESMonitorSet(self.snes, SNES_Monitor, NULL, NULL) ) * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (monitor, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/SNES.pyx":1306 * CHKERR( SNESMonitorSet(self.snes, SNES_Monitor, NULL, NULL) ) * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (monitor, args, kargs) * monitorlist.append(context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); if (__pyx_t_1) { __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 1306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_2); __pyx_t_2 = 0; } /* "petsc4py/PETSc/SNES.pyx":1307 * if args is None: args = () * if kargs is None: kargs = {} * context = (monitor, args, kargs) # <<<<<<<<<<<<<< * monitorlist.append(context) * */ __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 1307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_monitor); __Pyx_GIVEREF(__pyx_v_monitor); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_monitor)) __PYX_ERR(50, 1307, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_args)) __PYX_ERR(50, 1307, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_kargs)) __PYX_ERR(50, 1307, __pyx_L1_error); __pyx_v_context = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/SNES.pyx":1308 * if kargs is None: kargs = {} * context = (monitor, args, kargs) * monitorlist.append(context) # <<<<<<<<<<<<<< * * def getMonitor(self) -> list[tuple[SNESMonitorFunction, tuple[Any, ...], dict[str, Any]]]: */ __pyx_t_4 = __Pyx_PyObject_Append(__pyx_v_monitorlist, __pyx_v_context); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(50, 1308, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":1280 * # --- monitoring --- * * def setMonitor(self, monitor: SNESMonitorFunction, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: # <<<<<<<<<<<<<< * """Set the callback used to monitor solver convergence. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.setMonitor", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_monitorlist); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":1310 * monitorlist.append(context) * * def getMonitor(self) -> list[tuple[SNESMonitorFunction, tuple[Any, ...], dict[str, Any]]]: # <<<<<<<<<<<<<< * """Return the callback used to monitor solver convergence. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_127getMonitor(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_126getMonitor, "SNES.getMonitor(self) -> list[tuple[SNESMonitorFunction, tuple[Any, ...], dict[str, Any]]]\nReturn the callback used to monitor solver convergence.\n\n Not collective.\n\n See Also\n --------\n setMonitor\n\n \nSource code at petsc4py/PETSc/SNES.pyx:1310"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_127getMonitor(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getMonitor (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getMonitor", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getMonitor", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_126getMonitor(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_126getMonitor(struct PyPetscSNESObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getMonitor", 1); /* "petsc4py/PETSc/SNES.pyx":1320 * * """ * return self.get_attr('__monitor__') # <<<<<<<<<<<<<< * * def monitorCancel(self) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__monitor__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 1320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":1310 * monitorlist.append(context) * * def getMonitor(self) -> list[tuple[SNESMonitorFunction, tuple[Any, ...], dict[str, Any]]]: # <<<<<<<<<<<<<< * """Return the callback used to monitor solver convergence. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getMonitor", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":1322 * return self.get_attr('__monitor__') * * def monitorCancel(self) -> None: # <<<<<<<<<<<<<< * """Cancel all the monitors of the solver. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_129monitorCancel(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_128monitorCancel, "SNES.monitorCancel(self) -> None\nCancel all the monitors of the solver.\n\n Logically collective.\n\n See Also\n --------\n setMonitor, petsc.SNESMonitorCancel\n\n \nSource code at petsc4py/PETSc/SNES.pyx:1322"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_129monitorCancel(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("monitorCancel (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("monitorCancel", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "monitorCancel", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_128monitorCancel(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_128monitorCancel(struct PyPetscSNESObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("monitorCancel", 1); /* "petsc4py/PETSc/SNES.pyx":1332 * * """ * CHKERR( SNESMonitorCancel(self.snes) ) # <<<<<<<<<<<<<< * self.set_attr('__monitor__', None) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESMonitorCancel(__pyx_v_self->snes)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1332, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":1333 * """ * CHKERR( SNESMonitorCancel(self.snes) ) * self.set_attr('__monitor__', None) # <<<<<<<<<<<<<< * * cancelMonitor = monitorCancel */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__monitor__"), Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 1333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/SNES.pyx":1322 * return self.get_attr('__monitor__') * * def monitorCancel(self) -> None: # <<<<<<<<<<<<<< * """Cancel all the monitors of the solver. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.monitorCancel", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":1337 * cancelMonitor = monitorCancel * * def monitor(self, its, rnorm) -> None: # <<<<<<<<<<<<<< * """Monitor the solver. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_131monitor(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_130monitor, "SNES.monitor(self, its, rnorm) -> None\nMonitor the solver.\n\n Collective.\n\n Parameters\n ----------\n its\n Current number of iterations.\n rnorm\n Current value of the residual norm.\n\n See Also\n --------\n setMonitor, petsc.SNESMonitor\n\n \nSource code at petsc4py/PETSc/SNES.pyx:1337"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_131monitor(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_its = 0; PyObject *__pyx_v_rnorm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("monitor (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_its,&__pyx_n_s_rnorm,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_its)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 1337, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnorm)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 1337, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("monitor", 1, 2, 2, 1); __PYX_ERR(50, 1337, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "monitor") < 0)) __PYX_ERR(50, 1337, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_its = values[0]; __pyx_v_rnorm = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("monitor", 1, 2, 2, __pyx_nargs); __PYX_ERR(50, 1337, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SNES.monitor", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_130monitor(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_its, __pyx_v_rnorm); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_130monitor(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_its, PyObject *__pyx_v_rnorm) { PetscInt __pyx_v_ival; PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscReal __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("monitor", 1); /* "petsc4py/PETSc/SNES.pyx":1354 * * """ * cdef PetscInt ival = asInt(its) # <<<<<<<<<<<<<< * cdef PetscReal rval = asReal(rnorm) * CHKERR( SNESMonitor(self.snes, ival, rval) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_its); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(50, 1354, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "petsc4py/PETSc/SNES.pyx":1355 * """ * cdef PetscInt ival = asInt(its) * cdef PetscReal rval = asReal(rnorm) # <<<<<<<<<<<<<< * CHKERR( SNESMonitor(self.snes, ival, rval) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_rnorm); if (unlikely(__pyx_t_2 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(50, 1355, __pyx_L1_error) __pyx_v_rval = __pyx_t_2; /* "petsc4py/PETSc/SNES.pyx":1356 * cdef PetscInt ival = asInt(its) * cdef PetscReal rval = asReal(rnorm) * CHKERR( SNESMonitor(self.snes, ival, rval) ) # <<<<<<<<<<<<<< * * # --- more tolerances --- */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESMonitor(__pyx_v_self->snes, __pyx_v_ival, __pyx_v_rval)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1356, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":1337 * cancelMonitor = monitorCancel * * def monitor(self, its, rnorm) -> None: # <<<<<<<<<<<<<< * """Monitor the solver. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.monitor", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":1360 * # --- more tolerances --- * * def setMaxFunctionEvaluations(self, max_funcs: int) -> None: # <<<<<<<<<<<<<< * """Set the maximum allowed number of function evaluations. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_133setMaxFunctionEvaluations(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_132setMaxFunctionEvaluations, "SNES.setMaxFunctionEvaluations(self, max_funcs: int) -> None\nSet the maximum allowed number of function evaluations.\n\n Collective.\n\n See Also\n --------\n getMaxFunctionEvaluations, petsc.SNESSetTolerances\n\n \nSource code at petsc4py/PETSc/SNES.pyx:1360"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_133setMaxFunctionEvaluations(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_max_funcs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setMaxFunctionEvaluations (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_max_funcs,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_max_funcs)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 1360, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setMaxFunctionEvaluations") < 0)) __PYX_ERR(50, 1360, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_max_funcs = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setMaxFunctionEvaluations", 1, 1, 1, __pyx_nargs); __PYX_ERR(50, 1360, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SNES.setMaxFunctionEvaluations", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_132setMaxFunctionEvaluations(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_max_funcs); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_132setMaxFunctionEvaluations(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_max_funcs) { PetscReal __pyx_v_r; PetscInt __pyx_v_i; PetscInt __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setMaxFunctionEvaluations", 1); /* "petsc4py/PETSc/SNES.pyx":1370 * * """ * cdef PetscReal r = PETSC_DEFAULT # <<<<<<<<<<<<<< * cdef PetscInt i = PETSC_DEFAULT * cdef PetscInt ival = asInt(max_funcs) */ __pyx_v_r = PETSC_DEFAULT; /* "petsc4py/PETSc/SNES.pyx":1371 * """ * cdef PetscReal r = PETSC_DEFAULT * cdef PetscInt i = PETSC_DEFAULT # <<<<<<<<<<<<<< * cdef PetscInt ival = asInt(max_funcs) * CHKERR( SNESSetTolerances(self.snes, r, r, r, i, ival) ) */ __pyx_v_i = PETSC_DEFAULT; /* "petsc4py/PETSc/SNES.pyx":1372 * cdef PetscReal r = PETSC_DEFAULT * cdef PetscInt i = PETSC_DEFAULT * cdef PetscInt ival = asInt(max_funcs) # <<<<<<<<<<<<<< * CHKERR( SNESSetTolerances(self.snes, r, r, r, i, ival) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_max_funcs); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(50, 1372, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "petsc4py/PETSc/SNES.pyx":1373 * cdef PetscInt i = PETSC_DEFAULT * cdef PetscInt ival = asInt(max_funcs) * CHKERR( SNESSetTolerances(self.snes, r, r, r, i, ival) ) # <<<<<<<<<<<<<< * * def getMaxFunctionEvaluations(self) -> int: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetTolerances(__pyx_v_self->snes, __pyx_v_r, __pyx_v_r, __pyx_v_r, __pyx_v_i, __pyx_v_ival)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1373, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":1360 * # --- more tolerances --- * * def setMaxFunctionEvaluations(self, max_funcs: int) -> None: # <<<<<<<<<<<<<< * """Set the maximum allowed number of function evaluations. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setMaxFunctionEvaluations", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":1375 * CHKERR( SNESSetTolerances(self.snes, r, r, r, i, ival) ) * * def getMaxFunctionEvaluations(self) -> int: # <<<<<<<<<<<<<< * """Return the maximum allowed number of function evaluations. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_135getMaxFunctionEvaluations(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_134getMaxFunctionEvaluations, "SNES.getMaxFunctionEvaluations(self) -> int\nReturn the maximum allowed number of function evaluations.\n\n Not collective.\n\n See Also\n --------\n setMaxFunctionEvaluations, petsc.SNESSetTolerances\n\n \nSource code at petsc4py/PETSc/SNES.pyx:1375"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_135getMaxFunctionEvaluations(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getMaxFunctionEvaluations (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getMaxFunctionEvaluations", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getMaxFunctionEvaluations", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_134getMaxFunctionEvaluations(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_134getMaxFunctionEvaluations(struct PyPetscSNESObject *__pyx_v_self) { PetscReal *__pyx_v_r; PetscInt *__pyx_v_i; PetscInt __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getMaxFunctionEvaluations", 1); /* "petsc4py/PETSc/SNES.pyx":1385 * * """ * cdef PetscReal *r = NULL # <<<<<<<<<<<<<< * cdef PetscInt *i = NULL * cdef PetscInt ival = 0 */ __pyx_v_r = NULL; /* "petsc4py/PETSc/SNES.pyx":1386 * """ * cdef PetscReal *r = NULL * cdef PetscInt *i = NULL # <<<<<<<<<<<<<< * cdef PetscInt ival = 0 * CHKERR( SNESGetTolerances(self.snes, r, r, r, i, &ival) ) */ __pyx_v_i = NULL; /* "petsc4py/PETSc/SNES.pyx":1387 * cdef PetscReal *r = NULL * cdef PetscInt *i = NULL * cdef PetscInt ival = 0 # <<<<<<<<<<<<<< * CHKERR( SNESGetTolerances(self.snes, r, r, r, i, &ival) ) * return toInt(ival) */ __pyx_v_ival = 0; /* "petsc4py/PETSc/SNES.pyx":1388 * cdef PetscInt *i = NULL * cdef PetscInt ival = 0 * CHKERR( SNESGetTolerances(self.snes, r, r, r, i, &ival) ) # <<<<<<<<<<<<<< * return toInt(ival) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetTolerances(__pyx_v_self->snes, __pyx_v_r, __pyx_v_r, __pyx_v_r, __pyx_v_i, (&__pyx_v_ival))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1388, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":1389 * cdef PetscInt ival = 0 * CHKERR( SNESGetTolerances(self.snes, r, r, r, i, &ival) ) * return toInt(ival) # <<<<<<<<<<<<<< * * def getFunctionEvaluations(self) -> int: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ival); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 1389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":1375 * CHKERR( SNESSetTolerances(self.snes, r, r, r, i, ival) ) * * def getMaxFunctionEvaluations(self) -> int: # <<<<<<<<<<<<<< * """Return the maximum allowed number of function evaluations. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getMaxFunctionEvaluations", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":1391 * return toInt(ival) * * def getFunctionEvaluations(self) -> int: # <<<<<<<<<<<<<< * """Return the current number of function evaluations. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_137getFunctionEvaluations(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_136getFunctionEvaluations, "SNES.getFunctionEvaluations(self) -> int\nReturn the current number of function evaluations.\n\n Not collective.\n\n See Also\n --------\n setMaxFunctionEvaluations, petsc.SNESGetNumberFunctionEvals\n\n \nSource code at petsc4py/PETSc/SNES.pyx:1391"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_137getFunctionEvaluations(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getFunctionEvaluations (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getFunctionEvaluations", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getFunctionEvaluations", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_136getFunctionEvaluations(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_136getFunctionEvaluations(struct PyPetscSNESObject *__pyx_v_self) { PetscInt __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getFunctionEvaluations", 1); /* "petsc4py/PETSc/SNES.pyx":1401 * * """ * cdef PetscInt ival = 0 # <<<<<<<<<<<<<< * CHKERR( SNESGetNumberFunctionEvals(self.snes, &ival) ) * return toInt(ival) */ __pyx_v_ival = 0; /* "petsc4py/PETSc/SNES.pyx":1402 * """ * cdef PetscInt ival = 0 * CHKERR( SNESGetNumberFunctionEvals(self.snes, &ival) ) # <<<<<<<<<<<<<< * return toInt(ival) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetNumberFunctionEvals(__pyx_v_self->snes, (&__pyx_v_ival))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1402, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":1403 * cdef PetscInt ival = 0 * CHKERR( SNESGetNumberFunctionEvals(self.snes, &ival) ) * return toInt(ival) # <<<<<<<<<<<<<< * * def setMaxStepFailures(self, max_fails: int) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ival); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 1403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":1391 * return toInt(ival) * * def getFunctionEvaluations(self) -> int: # <<<<<<<<<<<<<< * """Return the current number of function evaluations. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getFunctionEvaluations", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":1405 * return toInt(ival) * * def setMaxStepFailures(self, max_fails: int) -> None: # <<<<<<<<<<<<<< * """Set the maximum allowed number of step failures. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_139setMaxStepFailures(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_138setMaxStepFailures, "SNES.setMaxStepFailures(self, max_fails: int) -> None\nSet the maximum allowed number of step failures.\n\n Collective.\n\n See Also\n --------\n getMaxStepFailures, petsc.SNESSetMaxNonlinearStepFailures\n\n \nSource code at petsc4py/PETSc/SNES.pyx:1405"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_139setMaxStepFailures(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_max_fails = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setMaxStepFailures (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_max_fails,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_max_fails)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 1405, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setMaxStepFailures") < 0)) __PYX_ERR(50, 1405, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_max_fails = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setMaxStepFailures", 1, 1, 1, __pyx_nargs); __PYX_ERR(50, 1405, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SNES.setMaxStepFailures", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_138setMaxStepFailures(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_max_fails); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_138setMaxStepFailures(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_max_fails) { PetscInt __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setMaxStepFailures", 1); /* "petsc4py/PETSc/SNES.pyx":1415 * * """ * cdef PetscInt ival = asInt(max_fails) # <<<<<<<<<<<<<< * CHKERR( SNESSetMaxNonlinearStepFailures(self.snes, ival) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_max_fails); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(50, 1415, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "petsc4py/PETSc/SNES.pyx":1416 * """ * cdef PetscInt ival = asInt(max_fails) * CHKERR( SNESSetMaxNonlinearStepFailures(self.snes, ival) ) # <<<<<<<<<<<<<< * * def getMaxStepFailures(self) -> int: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetMaxNonlinearStepFailures(__pyx_v_self->snes, __pyx_v_ival)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1416, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":1405 * return toInt(ival) * * def setMaxStepFailures(self, max_fails: int) -> None: # <<<<<<<<<<<<<< * """Set the maximum allowed number of step failures. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setMaxStepFailures", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":1418 * CHKERR( SNESSetMaxNonlinearStepFailures(self.snes, ival) ) * * def getMaxStepFailures(self) -> int: # <<<<<<<<<<<<<< * """Return the maximum allowed number of step failures. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_141getMaxStepFailures(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_140getMaxStepFailures, "SNES.getMaxStepFailures(self) -> int\nReturn the maximum allowed number of step failures.\n\n Not collective.\n\n See Also\n --------\n setMaxStepFailures, petsc.SNESGetMaxNonlinearStepFailures\n\n \nSource code at petsc4py/PETSc/SNES.pyx:1418"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_141getMaxStepFailures(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getMaxStepFailures (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getMaxStepFailures", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getMaxStepFailures", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_140getMaxStepFailures(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_140getMaxStepFailures(struct PyPetscSNESObject *__pyx_v_self) { PetscInt __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getMaxStepFailures", 1); /* "petsc4py/PETSc/SNES.pyx":1428 * * """ * cdef PetscInt ival = 0 # <<<<<<<<<<<<<< * CHKERR( SNESGetMaxNonlinearStepFailures(self.snes, &ival) ) * return toInt(ival) */ __pyx_v_ival = 0; /* "petsc4py/PETSc/SNES.pyx":1429 * """ * cdef PetscInt ival = 0 * CHKERR( SNESGetMaxNonlinearStepFailures(self.snes, &ival) ) # <<<<<<<<<<<<<< * return toInt(ival) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetMaxNonlinearStepFailures(__pyx_v_self->snes, (&__pyx_v_ival))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1429, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":1430 * cdef PetscInt ival = 0 * CHKERR( SNESGetMaxNonlinearStepFailures(self.snes, &ival) ) * return toInt(ival) # <<<<<<<<<<<<<< * * def getStepFailures(self) -> int: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ival); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 1430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":1418 * CHKERR( SNESSetMaxNonlinearStepFailures(self.snes, ival) ) * * def getMaxStepFailures(self) -> int: # <<<<<<<<<<<<<< * """Return the maximum allowed number of step failures. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getMaxStepFailures", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":1432 * return toInt(ival) * * def getStepFailures(self) -> int: # <<<<<<<<<<<<<< * """Return the current number of step failures. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_143getStepFailures(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_142getStepFailures, "SNES.getStepFailures(self) -> int\nReturn the current number of step failures.\n\n Not collective.\n\n See Also\n --------\n getMaxStepFailures, petsc.SNESGetNonlinearStepFailures\n\n \nSource code at petsc4py/PETSc/SNES.pyx:1432"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_143getStepFailures(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getStepFailures (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getStepFailures", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getStepFailures", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_142getStepFailures(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_142getStepFailures(struct PyPetscSNESObject *__pyx_v_self) { PetscInt __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getStepFailures", 1); /* "petsc4py/PETSc/SNES.pyx":1442 * * """ * cdef PetscInt ival = 0 # <<<<<<<<<<<<<< * CHKERR( SNESGetNonlinearStepFailures(self.snes, &ival) ) * return toInt(ival) */ __pyx_v_ival = 0; /* "petsc4py/PETSc/SNES.pyx":1443 * """ * cdef PetscInt ival = 0 * CHKERR( SNESGetNonlinearStepFailures(self.snes, &ival) ) # <<<<<<<<<<<<<< * return toInt(ival) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetNonlinearStepFailures(__pyx_v_self->snes, (&__pyx_v_ival))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1443, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":1444 * cdef PetscInt ival = 0 * CHKERR( SNESGetNonlinearStepFailures(self.snes, &ival) ) * return toInt(ival) # <<<<<<<<<<<<<< * * def setMaxKSPFailures(self, max_fails: int) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ival); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 1444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":1432 * return toInt(ival) * * def getStepFailures(self) -> int: # <<<<<<<<<<<<<< * """Return the current number of step failures. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getStepFailures", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":1446 * return toInt(ival) * * def setMaxKSPFailures(self, max_fails: int) -> None: # <<<<<<<<<<<<<< * """Set the maximum allowed number of linear solve failures. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_145setMaxKSPFailures(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_144setMaxKSPFailures, "SNES.setMaxKSPFailures(self, max_fails: int) -> None\nSet the maximum allowed number of linear solve failures.\n\n Collective.\n\n See Also\n --------\n getMaxKSPFailures, petsc.SNESSetMaxLinearSolveFailures\n\n \nSource code at petsc4py/PETSc/SNES.pyx:1446"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_145setMaxKSPFailures(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_max_fails = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setMaxKSPFailures (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_max_fails,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_max_fails)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 1446, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setMaxKSPFailures") < 0)) __PYX_ERR(50, 1446, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_max_fails = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setMaxKSPFailures", 1, 1, 1, __pyx_nargs); __PYX_ERR(50, 1446, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SNES.setMaxKSPFailures", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_144setMaxKSPFailures(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_max_fails); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_144setMaxKSPFailures(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_max_fails) { PetscInt __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setMaxKSPFailures", 1); /* "petsc4py/PETSc/SNES.pyx":1456 * * """ * cdef PetscInt ival = asInt(max_fails) # <<<<<<<<<<<<<< * CHKERR( SNESSetMaxLinearSolveFailures(self.snes, ival) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_max_fails); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(50, 1456, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "petsc4py/PETSc/SNES.pyx":1457 * """ * cdef PetscInt ival = asInt(max_fails) * CHKERR( SNESSetMaxLinearSolveFailures(self.snes, ival) ) # <<<<<<<<<<<<<< * * def getMaxKSPFailures(self) -> int: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetMaxLinearSolveFailures(__pyx_v_self->snes, __pyx_v_ival)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1457, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":1446 * return toInt(ival) * * def setMaxKSPFailures(self, max_fails: int) -> None: # <<<<<<<<<<<<<< * """Set the maximum allowed number of linear solve failures. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setMaxKSPFailures", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":1459 * CHKERR( SNESSetMaxLinearSolveFailures(self.snes, ival) ) * * def getMaxKSPFailures(self) -> int: # <<<<<<<<<<<<<< * """Return the maximum allowed number of linear solve failures. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_147getMaxKSPFailures(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_146getMaxKSPFailures, "SNES.getMaxKSPFailures(self) -> int\nReturn the maximum allowed number of linear solve failures.\n\n Not collective.\n\n See Also\n --------\n setMaxKSPFailures, petsc.SNESGetMaxLinearSolveFailures\n\n \nSource code at petsc4py/PETSc/SNES.pyx:1459"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_147getMaxKSPFailures(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getMaxKSPFailures (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getMaxKSPFailures", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getMaxKSPFailures", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_146getMaxKSPFailures(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_146getMaxKSPFailures(struct PyPetscSNESObject *__pyx_v_self) { PetscInt __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getMaxKSPFailures", 1); /* "petsc4py/PETSc/SNES.pyx":1469 * * """ * cdef PetscInt ival = 0 # <<<<<<<<<<<<<< * CHKERR( SNESGetMaxLinearSolveFailures(self.snes, &ival) ) * return toInt(ival) */ __pyx_v_ival = 0; /* "petsc4py/PETSc/SNES.pyx":1470 * """ * cdef PetscInt ival = 0 * CHKERR( SNESGetMaxLinearSolveFailures(self.snes, &ival) ) # <<<<<<<<<<<<<< * return toInt(ival) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetMaxLinearSolveFailures(__pyx_v_self->snes, (&__pyx_v_ival))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1470, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":1471 * cdef PetscInt ival = 0 * CHKERR( SNESGetMaxLinearSolveFailures(self.snes, &ival) ) * return toInt(ival) # <<<<<<<<<<<<<< * * def getKSPFailures(self) -> int: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ival); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 1471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":1459 * CHKERR( SNESSetMaxLinearSolveFailures(self.snes, ival) ) * * def getMaxKSPFailures(self) -> int: # <<<<<<<<<<<<<< * """Return the maximum allowed number of linear solve failures. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getMaxKSPFailures", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":1473 * return toInt(ival) * * def getKSPFailures(self) -> int: # <<<<<<<<<<<<<< * """Return the current number of linear solve failures. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_149getKSPFailures(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_148getKSPFailures, "SNES.getKSPFailures(self) -> int\nReturn the current number of linear solve failures.\n\n Not collective.\n\n See Also\n --------\n getMaxKSPFailures, petsc.SNESGetLinearSolveFailures\n\n \nSource code at petsc4py/PETSc/SNES.pyx:1473"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_149getKSPFailures(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getKSPFailures (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getKSPFailures", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getKSPFailures", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_148getKSPFailures(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_148getKSPFailures(struct PyPetscSNESObject *__pyx_v_self) { PetscInt __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getKSPFailures", 1); /* "petsc4py/PETSc/SNES.pyx":1483 * * """ * cdef PetscInt ival = 0 # <<<<<<<<<<<<<< * CHKERR( SNESGetLinearSolveFailures(self.snes, &ival) ) * return toInt(ival) */ __pyx_v_ival = 0; /* "petsc4py/PETSc/SNES.pyx":1484 * """ * cdef PetscInt ival = 0 * CHKERR( SNESGetLinearSolveFailures(self.snes, &ival) ) # <<<<<<<<<<<<<< * return toInt(ival) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetLinearSolveFailures(__pyx_v_self->snes, (&__pyx_v_ival))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1484, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":1485 * cdef PetscInt ival = 0 * CHKERR( SNESGetLinearSolveFailures(self.snes, &ival) ) * return toInt(ival) # <<<<<<<<<<<<<< * * setMaxNonlinearStepFailures = setMaxStepFailures */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ival); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 1485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":1473 * return toInt(ival) * * def getKSPFailures(self) -> int: # <<<<<<<<<<<<<< * """Return the current number of linear solve failures. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getKSPFailures", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":1496 * # --- solving --- * * def setUp(self) -> None: # <<<<<<<<<<<<<< * """Set up the internal data structures for using the solver. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_151setUp(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_150setUp, "SNES.setUp(self) -> None\nSet up the internal data structures for using the solver.\n\n Collective.\n\n See Also\n --------\n petsc.SNESSetUp\n\n \nSource code at petsc4py/PETSc/SNES.pyx:1496"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_151setUp(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setUp (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("setUp", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setUp", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_150setUp(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_150setUp(struct PyPetscSNESObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setUp", 1); /* "petsc4py/PETSc/SNES.pyx":1506 * * """ * CHKERR( SNESSetUp(self.snes) ) # <<<<<<<<<<<<<< * * def setUpMatrices(self) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetUp(__pyx_v_self->snes)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1506, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":1496 * # --- solving --- * * def setUp(self) -> None: # <<<<<<<<<<<<<< * """Set up the internal data structures for using the solver. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setUp", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":1508 * CHKERR( SNESSetUp(self.snes) ) * * def setUpMatrices(self) -> None: # <<<<<<<<<<<<<< * """Ensures that matrices are available for Newton-like methods. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_153setUpMatrices(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_152setUpMatrices, "SNES.setUpMatrices(self) -> None\nEnsures that matrices are available for Newton-like methods.\n\n Collective.\n\n This is only of use to implementers of custom SNES types.\n\n See Also\n --------\n setUp, petsc.SNESSetUpMatrices\n\n \nSource code at petsc4py/PETSc/SNES.pyx:1508"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_153setUpMatrices(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setUpMatrices (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("setUpMatrices", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setUpMatrices", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_152setUpMatrices(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_152setUpMatrices(struct PyPetscSNESObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setUpMatrices", 1); /* "petsc4py/PETSc/SNES.pyx":1520 * * """ * CHKERR( SNESSetUpMatrices(self.snes) ) # <<<<<<<<<<<<<< * * def reset(self) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetUpMatrices(__pyx_v_self->snes)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1520, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":1508 * CHKERR( SNESSetUp(self.snes) ) * * def setUpMatrices(self) -> None: # <<<<<<<<<<<<<< * """Ensures that matrices are available for Newton-like methods. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setUpMatrices", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":1522 * CHKERR( SNESSetUpMatrices(self.snes) ) * * def reset(self) -> None: # <<<<<<<<<<<<<< * """Reset the solver. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_155reset(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_154reset, "SNES.reset(self) -> None\nReset the solver.\n\n Collective.\n\n See Also\n --------\n petsc.SNESReset\n\n \nSource code at petsc4py/PETSc/SNES.pyx:1522"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_155reset(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("reset (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("reset", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "reset", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_154reset(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_154reset(struct PyPetscSNESObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("reset", 1); /* "petsc4py/PETSc/SNES.pyx":1532 * * """ * CHKERR( SNESReset(self.snes) ) # <<<<<<<<<<<<<< * * def solve(self, Vec b = None, Vec x = None) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESReset(__pyx_v_self->snes)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1532, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":1522 * CHKERR( SNESSetUpMatrices(self.snes) ) * * def reset(self) -> None: # <<<<<<<<<<<<<< * """Reset the solver. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.reset", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":1534 * CHKERR( SNESReset(self.snes) ) * * def solve(self, Vec b = None, Vec x = None) -> None: # <<<<<<<<<<<<<< * """Solve the nonlinear equations. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_157solve(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_156solve, "SNES.solve(self, b: Vec | None = None, x: Vec | None = None) -> None\nSolve the nonlinear equations.\n\n Collective.\n\n Parameters\n ----------\n b\n The affine right-hand side or `None` to use zero.\n x\n The starting vector or `None` to use the vector stored internally.\n\n See Also\n --------\n setSolution, getSolution, petsc.SNESSolve\n\n \nSource code at petsc4py/PETSc/SNES.pyx:1534"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_157solve(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_b = 0; struct PyPetscVecObject *__pyx_v_x = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("solve (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_b,&__pyx_n_s_x,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscVecObject *)Py_None)); values[1] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscVecObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_b); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 1534, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 1534, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "solve") < 0)) __PYX_ERR(50, 1534, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_b = ((struct PyPetscVecObject *)values[0]); __pyx_v_x = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("solve", 0, 0, 2, __pyx_nargs); __PYX_ERR(50, 1534, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SNES.solve", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "b", 0))) __PYX_ERR(50, 1534, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "x", 0))) __PYX_ERR(50, 1534, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_156solve(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_b, __pyx_v_x); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_156solve(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_b, struct PyPetscVecObject *__pyx_v_x) { Vec __pyx_v_rhs; Vec __pyx_v_sol; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; Vec __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("solve", 1); /* "petsc4py/PETSc/SNES.pyx":1551 * * """ * cdef PetscVec rhs = NULL # <<<<<<<<<<<<<< * cdef PetscVec sol = NULL * if b is not None: rhs = b.vec */ __pyx_v_rhs = NULL; /* "petsc4py/PETSc/SNES.pyx":1552 * """ * cdef PetscVec rhs = NULL * cdef PetscVec sol = NULL # <<<<<<<<<<<<<< * if b is not None: rhs = b.vec * if x is not None: sol = x.vec */ __pyx_v_sol = NULL; /* "petsc4py/PETSc/SNES.pyx":1553 * cdef PetscVec rhs = NULL * cdef PetscVec sol = NULL * if b is not None: rhs = b.vec # <<<<<<<<<<<<<< * if x is not None: sol = x.vec * CHKERR( SNESSolve(self.snes, rhs, sol) ) */ __pyx_t_1 = (((PyObject *)__pyx_v_b) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_b->vec; __pyx_v_rhs = __pyx_t_2; } /* "petsc4py/PETSc/SNES.pyx":1554 * cdef PetscVec sol = NULL * if b is not None: rhs = b.vec * if x is not None: sol = x.vec # <<<<<<<<<<<<<< * CHKERR( SNESSolve(self.snes, rhs, sol) ) * */ __pyx_t_1 = (((PyObject *)__pyx_v_x) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_x->vec; __pyx_v_sol = __pyx_t_2; } /* "petsc4py/PETSc/SNES.pyx":1555 * if b is not None: rhs = b.vec * if x is not None: sol = x.vec * CHKERR( SNESSolve(self.snes, rhs, sol) ) # <<<<<<<<<<<<<< * * def setConvergedReason(self, reason: ConvergedReason) -> None: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSolve(__pyx_v_self->snes, __pyx_v_rhs, __pyx_v_sol)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1555, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":1534 * CHKERR( SNESReset(self.snes) ) * * def solve(self, Vec b = None, Vec x = None) -> None: # <<<<<<<<<<<<<< * """Solve the nonlinear equations. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.solve", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":1557 * CHKERR( SNESSolve(self.snes, rhs, sol) ) * * def setConvergedReason(self, reason: ConvergedReason) -> None: # <<<<<<<<<<<<<< * """Set the termination flag. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_159setConvergedReason(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_158setConvergedReason, "SNES.setConvergedReason(self, reason: ConvergedReason) -> None\nSet the termination flag.\n\n Collective.\n\n See Also\n --------\n getConvergedReason, petsc.SNESSetConvergedReason\n\n \nSource code at petsc4py/PETSc/SNES.pyx:1557"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_159setConvergedReason(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_reason = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setConvergedReason (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_reason,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_reason)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 1557, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setConvergedReason") < 0)) __PYX_ERR(50, 1557, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_reason = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setConvergedReason", 1, 1, 1, __pyx_nargs); __PYX_ERR(50, 1557, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SNES.setConvergedReason", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_158setConvergedReason(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_reason); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_158setConvergedReason(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_reason) { SNESConvergedReason __pyx_v_eval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations SNESConvergedReason __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setConvergedReason", 1); /* "petsc4py/PETSc/SNES.pyx":1567 * * """ * cdef PetscSNESConvergedReason eval = reason # <<<<<<<<<<<<<< * CHKERR( SNESSetConvergedReason(self.snes, eval) ) * */ __pyx_t_1 = ((SNESConvergedReason)__Pyx_PyInt_As_SNESConvergedReason(__pyx_v_reason)); if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 1567, __pyx_L1_error) __pyx_v_eval = __pyx_t_1; /* "petsc4py/PETSc/SNES.pyx":1568 * """ * cdef PetscSNESConvergedReason eval = reason * CHKERR( SNESSetConvergedReason(self.snes, eval) ) # <<<<<<<<<<<<<< * * def getConvergedReason(self) -> ConvergedReason: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetConvergedReason(__pyx_v_self->snes, __pyx_v_eval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1568, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":1557 * CHKERR( SNESSolve(self.snes, rhs, sol) ) * * def setConvergedReason(self, reason: ConvergedReason) -> None: # <<<<<<<<<<<<<< * """Set the termination flag. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setConvergedReason", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":1570 * CHKERR( SNESSetConvergedReason(self.snes, eval) ) * * def getConvergedReason(self) -> ConvergedReason: # <<<<<<<<<<<<<< * """Return the termination flag. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_161getConvergedReason(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_160getConvergedReason, "SNES.getConvergedReason(self) -> ConvergedReason\nReturn the termination flag.\n\n Not collective.\n\n See Also\n --------\n setConvergedReason, petsc.SNESGetConvergedReason\n\n \nSource code at petsc4py/PETSc/SNES.pyx:1570"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_161getConvergedReason(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getConvergedReason (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getConvergedReason", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getConvergedReason", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_160getConvergedReason(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_160getConvergedReason(struct PyPetscSNESObject *__pyx_v_self) { SNESConvergedReason __pyx_v_reason; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getConvergedReason", 1); /* "petsc4py/PETSc/SNES.pyx":1580 * * """ * cdef PetscSNESConvergedReason reason = SNES_CONVERGED_ITERATING # <<<<<<<<<<<<<< * CHKERR( SNESGetConvergedReason(self.snes, &reason) ) * return reason */ __pyx_v_reason = SNES_CONVERGED_ITERATING; /* "petsc4py/PETSc/SNES.pyx":1581 * """ * cdef PetscSNESConvergedReason reason = SNES_CONVERGED_ITERATING * CHKERR( SNESGetConvergedReason(self.snes, &reason) ) # <<<<<<<<<<<<<< * return reason * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetConvergedReason(__pyx_v_self->snes, (&__pyx_v_reason))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1581, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":1582 * cdef PetscSNESConvergedReason reason = SNES_CONVERGED_ITERATING * CHKERR( SNESGetConvergedReason(self.snes, &reason) ) * return reason # <<<<<<<<<<<<<< * * def setErrorIfNotConverged(self, flag: bool) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_SNESConvergedReason(__pyx_v_reason); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 1582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":1570 * CHKERR( SNESSetConvergedReason(self.snes, eval) ) * * def getConvergedReason(self) -> ConvergedReason: # <<<<<<<<<<<<<< * """Return the termination flag. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getConvergedReason", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":1584 * return reason * * def setErrorIfNotConverged(self, flag: bool) -> None: # <<<<<<<<<<<<<< * """Immediately generate an error if the solver has not converged. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_163setErrorIfNotConverged(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_162setErrorIfNotConverged, "SNES.setErrorIfNotConverged(self, flag: bool) -> None\nImmediately generate an error if the solver has not converged.\n\n Collective.\n\n See Also\n --------\n getErrorIfNotConverged, petsc.SNESSetErrorIfNotConverged\n\n \nSource code at petsc4py/PETSc/SNES.pyx:1584"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_163setErrorIfNotConverged(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_flag = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setErrorIfNotConverged (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flag)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 1584, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setErrorIfNotConverged") < 0)) __PYX_ERR(50, 1584, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_flag = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setErrorIfNotConverged", 1, 1, 1, __pyx_nargs); __PYX_ERR(50, 1584, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SNES.setErrorIfNotConverged", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_162setErrorIfNotConverged(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_flag); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_162setErrorIfNotConverged(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_flag) { PetscBool __pyx_v_ernc; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setErrorIfNotConverged", 1); /* "petsc4py/PETSc/SNES.pyx":1594 * * """ * cdef PetscBool ernc = asBool(flag) # <<<<<<<<<<<<<< * CHKERR( SNESSetErrorIfNotConverged(self.snes, ernc) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asBool(__pyx_v_flag); if (unlikely(__pyx_t_1 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(50, 1594, __pyx_L1_error) __pyx_v_ernc = __pyx_t_1; /* "petsc4py/PETSc/SNES.pyx":1595 * """ * cdef PetscBool ernc = asBool(flag) * CHKERR( SNESSetErrorIfNotConverged(self.snes, ernc) ) # <<<<<<<<<<<<<< * * def getErrorIfNotConverged(self) -> bool: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetErrorIfNotConverged(__pyx_v_self->snes, __pyx_v_ernc)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1595, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":1584 * return reason * * def setErrorIfNotConverged(self, flag: bool) -> None: # <<<<<<<<<<<<<< * """Immediately generate an error if the solver has not converged. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setErrorIfNotConverged", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":1597 * CHKERR( SNESSetErrorIfNotConverged(self.snes, ernc) ) * * def getErrorIfNotConverged(self) -> bool: # <<<<<<<<<<<<<< * """Return the flag indicating error on divergence. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_165getErrorIfNotConverged(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_164getErrorIfNotConverged, "SNES.getErrorIfNotConverged(self) -> bool\nReturn the flag indicating error on divergence.\n\n Not collective.\n\n See Also\n --------\n setErrorIfNotConverged, petsc.SNESGetErrorIfNotConverged\n\n \nSource code at petsc4py/PETSc/SNES.pyx:1597"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_165getErrorIfNotConverged(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getErrorIfNotConverged (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getErrorIfNotConverged", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getErrorIfNotConverged", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_164getErrorIfNotConverged(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_164getErrorIfNotConverged(struct PyPetscSNESObject *__pyx_v_self) { PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getErrorIfNotConverged", 1); /* "petsc4py/PETSc/SNES.pyx":1607 * * """ * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( SNESGetErrorIfNotConverged(self.snes, &flag) ) * return toBool(flag) */ __pyx_v_flag = PETSC_FALSE; /* "petsc4py/PETSc/SNES.pyx":1608 * """ * cdef PetscBool flag = PETSC_FALSE * CHKERR( SNESGetErrorIfNotConverged(self.snes, &flag) ) # <<<<<<<<<<<<<< * return toBool(flag) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetErrorIfNotConverged(__pyx_v_self->snes, (&__pyx_v_flag))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1608, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":1609 * cdef PetscBool flag = PETSC_FALSE * CHKERR( SNESGetErrorIfNotConverged(self.snes, &flag) ) * return toBool(flag) # <<<<<<<<<<<<<< * * def setIterationNumber(self, its: int) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 1609, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":1597 * CHKERR( SNESSetErrorIfNotConverged(self.snes, ernc) ) * * def getErrorIfNotConverged(self) -> bool: # <<<<<<<<<<<<<< * """Return the flag indicating error on divergence. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getErrorIfNotConverged", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":1611 * return toBool(flag) * * def setIterationNumber(self, its: int) -> None: # <<<<<<<<<<<<<< * """Set the current iteration number. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_167setIterationNumber(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_166setIterationNumber, "SNES.setIterationNumber(self, its: int) -> None\nSet the current iteration number.\n\n Collective.\n\n This is only of use to implementers of custom SNES types.\n\n See Also\n --------\n getIterationNumber, petsc.SNESSetIterationNumber\n\n \nSource code at petsc4py/PETSc/SNES.pyx:1611"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_167setIterationNumber(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_its = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setIterationNumber (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_its,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_its)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 1611, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setIterationNumber") < 0)) __PYX_ERR(50, 1611, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_its = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setIterationNumber", 1, 1, 1, __pyx_nargs); __PYX_ERR(50, 1611, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SNES.setIterationNumber", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_166setIterationNumber(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_its); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_166setIterationNumber(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_its) { PetscInt __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setIterationNumber", 1); /* "petsc4py/PETSc/SNES.pyx":1623 * * """ * cdef PetscInt ival = asInt(its) # <<<<<<<<<<<<<< * CHKERR( SNESSetIterationNumber(self.snes, ival) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_its); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(50, 1623, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "petsc4py/PETSc/SNES.pyx":1624 * """ * cdef PetscInt ival = asInt(its) * CHKERR( SNESSetIterationNumber(self.snes, ival) ) # <<<<<<<<<<<<<< * * def getIterationNumber(self) -> int: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetIterationNumber(__pyx_v_self->snes, __pyx_v_ival)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1624, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":1611 * return toBool(flag) * * def setIterationNumber(self, its: int) -> None: # <<<<<<<<<<<<<< * """Set the current iteration number. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setIterationNumber", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":1626 * CHKERR( SNESSetIterationNumber(self.snes, ival) ) * * def getIterationNumber(self) -> int: # <<<<<<<<<<<<<< * """Return the current iteration number. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_169getIterationNumber(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_168getIterationNumber, "SNES.getIterationNumber(self) -> int\nReturn the current iteration number.\n\n Not collective.\n\n See Also\n --------\n setIterationNumber, petsc.SNESGetIterationNumber\n\n \nSource code at petsc4py/PETSc/SNES.pyx:1626"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_169getIterationNumber(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getIterationNumber (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getIterationNumber", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getIterationNumber", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_168getIterationNumber(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_168getIterationNumber(struct PyPetscSNESObject *__pyx_v_self) { PetscInt __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getIterationNumber", 1); /* "petsc4py/PETSc/SNES.pyx":1636 * * """ * cdef PetscInt ival = 0 # <<<<<<<<<<<<<< * CHKERR( SNESGetIterationNumber(self.snes, &ival) ) * return toInt(ival) */ __pyx_v_ival = 0; /* "petsc4py/PETSc/SNES.pyx":1637 * """ * cdef PetscInt ival = 0 * CHKERR( SNESGetIterationNumber(self.snes, &ival) ) # <<<<<<<<<<<<<< * return toInt(ival) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetIterationNumber(__pyx_v_self->snes, (&__pyx_v_ival))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1637, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":1638 * cdef PetscInt ival = 0 * CHKERR( SNESGetIterationNumber(self.snes, &ival) ) * return toInt(ival) # <<<<<<<<<<<<<< * * def setForceIteration(self, force: bool) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ival); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 1638, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":1626 * CHKERR( SNESSetIterationNumber(self.snes, ival) ) * * def getIterationNumber(self) -> int: # <<<<<<<<<<<<<< * """Return the current iteration number. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getIterationNumber", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":1640 * return toInt(ival) * * def setForceIteration(self, force: bool) -> None: # <<<<<<<<<<<<<< * """Force solve to take at least one iteration. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_171setForceIteration(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_170setForceIteration, "SNES.setForceIteration(self, force: bool) -> None\nForce solve to take at least one iteration.\n\n Collective.\n\n See Also\n --------\n petsc.SNESSetForceIteration\n\n \nSource code at petsc4py/PETSc/SNES.pyx:1640"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_171setForceIteration(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_force = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setForceIteration (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_force,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_force)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 1640, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setForceIteration") < 0)) __PYX_ERR(50, 1640, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_force = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setForceIteration", 1, 1, 1, __pyx_nargs); __PYX_ERR(50, 1640, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SNES.setForceIteration", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_170setForceIteration(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_force); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_170setForceIteration(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_force) { PetscBool __pyx_v_bval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setForceIteration", 1); /* "petsc4py/PETSc/SNES.pyx":1650 * * """ * cdef PetscBool bval = asBool(force) # <<<<<<<<<<<<<< * CHKERR( SNESSetForceIteration(self.snes, bval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asBool(__pyx_v_force); if (unlikely(__pyx_t_1 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(50, 1650, __pyx_L1_error) __pyx_v_bval = __pyx_t_1; /* "petsc4py/PETSc/SNES.pyx":1651 * """ * cdef PetscBool bval = asBool(force) * CHKERR( SNESSetForceIteration(self.snes, bval) ) # <<<<<<<<<<<<<< * * def setFunctionNorm(self, norm: float) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetForceIteration(__pyx_v_self->snes, __pyx_v_bval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1651, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":1640 * return toInt(ival) * * def setForceIteration(self, force: bool) -> None: # <<<<<<<<<<<<<< * """Force solve to take at least one iteration. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setForceIteration", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":1653 * CHKERR( SNESSetForceIteration(self.snes, bval) ) * * def setFunctionNorm(self, norm: float) -> None: # <<<<<<<<<<<<<< * """Set the function norm value. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_173setFunctionNorm(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_172setFunctionNorm, "SNES.setFunctionNorm(self, norm: float) -> None\nSet the function norm value.\n\n Collective.\n\n This is only of use to implementers of custom SNES types.\n\n See Also\n --------\n getFunctionNorm, petsc.SNESSetFunctionNorm\n\n \nSource code at petsc4py/PETSc/SNES.pyx:1653"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_173setFunctionNorm(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_norm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFunctionNorm (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_norm,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_norm)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 1653, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setFunctionNorm") < 0)) __PYX_ERR(50, 1653, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_norm = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setFunctionNorm", 1, 1, 1, __pyx_nargs); __PYX_ERR(50, 1653, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SNES.setFunctionNorm", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_172setFunctionNorm(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_norm); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_172setFunctionNorm(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_norm) { PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFunctionNorm", 1); /* "petsc4py/PETSc/SNES.pyx":1665 * * """ * cdef PetscReal rval = asReal(norm) # <<<<<<<<<<<<<< * CHKERR( SNESSetFunctionNorm(self.snes, rval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_norm); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(50, 1665, __pyx_L1_error) __pyx_v_rval = __pyx_t_1; /* "petsc4py/PETSc/SNES.pyx":1666 * """ * cdef PetscReal rval = asReal(norm) * CHKERR( SNESSetFunctionNorm(self.snes, rval) ) # <<<<<<<<<<<<<< * * def getFunctionNorm(self) -> float: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetFunctionNorm(__pyx_v_self->snes, __pyx_v_rval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1666, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":1653 * CHKERR( SNESSetForceIteration(self.snes, bval) ) * * def setFunctionNorm(self, norm: float) -> None: # <<<<<<<<<<<<<< * """Set the function norm value. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setFunctionNorm", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":1668 * CHKERR( SNESSetFunctionNorm(self.snes, rval) ) * * def getFunctionNorm(self) -> float: # <<<<<<<<<<<<<< * """Return the function norm. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_175getFunctionNorm(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_174getFunctionNorm, "SNES.getFunctionNorm(self) -> float\nReturn the function norm.\n\n Not collective.\n\n See Also\n --------\n setFunctionNorm, petsc.SNESGetFunctionNorm\n\n \nSource code at petsc4py/PETSc/SNES.pyx:1668"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_175getFunctionNorm(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getFunctionNorm (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getFunctionNorm", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getFunctionNorm", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_174getFunctionNorm(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_174getFunctionNorm(struct PyPetscSNESObject *__pyx_v_self) { PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getFunctionNorm", 1); /* "petsc4py/PETSc/SNES.pyx":1678 * * """ * cdef PetscReal rval = 0 # <<<<<<<<<<<<<< * CHKERR( SNESGetFunctionNorm(self.snes, &rval) ) * return toReal(rval) */ __pyx_v_rval = 0.0; /* "petsc4py/PETSc/SNES.pyx":1679 * """ * cdef PetscReal rval = 0 * CHKERR( SNESGetFunctionNorm(self.snes, &rval) ) # <<<<<<<<<<<<<< * return toReal(rval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetFunctionNorm(__pyx_v_self->snes, (&__pyx_v_rval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1679, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":1680 * cdef PetscReal rval = 0 * CHKERR( SNESGetFunctionNorm(self.snes, &rval) ) * return toReal(rval) # <<<<<<<<<<<<<< * * def getLinearSolveIterations(self) -> int: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_rval); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 1680, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":1668 * CHKERR( SNESSetFunctionNorm(self.snes, rval) ) * * def getFunctionNorm(self) -> float: # <<<<<<<<<<<<<< * """Return the function norm. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getFunctionNorm", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":1682 * return toReal(rval) * * def getLinearSolveIterations(self) -> int: # <<<<<<<<<<<<<< * """Return the total number of linear iterations. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_177getLinearSolveIterations(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_176getLinearSolveIterations, "SNES.getLinearSolveIterations(self) -> int\nReturn the total number of linear iterations.\n\n Not collective.\n\n See Also\n --------\n petsc.SNESGetLinearSolveIterations\n\n \nSource code at petsc4py/PETSc/SNES.pyx:1682"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_177getLinearSolveIterations(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getLinearSolveIterations (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getLinearSolveIterations", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getLinearSolveIterations", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_176getLinearSolveIterations(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_176getLinearSolveIterations(struct PyPetscSNESObject *__pyx_v_self) { PetscInt __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getLinearSolveIterations", 1); /* "petsc4py/PETSc/SNES.pyx":1692 * * """ * cdef PetscInt ival = 0 # <<<<<<<<<<<<<< * CHKERR( SNESGetLinearSolveIterations(self.snes, &ival) ) * return toInt(ival) */ __pyx_v_ival = 0; /* "petsc4py/PETSc/SNES.pyx":1693 * """ * cdef PetscInt ival = 0 * CHKERR( SNESGetLinearSolveIterations(self.snes, &ival) ) # <<<<<<<<<<<<<< * return toInt(ival) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetLinearSolveIterations(__pyx_v_self->snes, (&__pyx_v_ival))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1693, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":1694 * cdef PetscInt ival = 0 * CHKERR( SNESGetLinearSolveIterations(self.snes, &ival) ) * return toInt(ival) # <<<<<<<<<<<<<< * * def getRhs(self) -> Vec: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ival); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 1694, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":1682 * return toReal(rval) * * def getLinearSolveIterations(self) -> int: # <<<<<<<<<<<<<< * """Return the total number of linear iterations. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getLinearSolveIterations", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":1696 * return toInt(ival) * * def getRhs(self) -> Vec: # <<<<<<<<<<<<<< * """Return the vector holding the right-hand side. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_179getRhs(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_178getRhs, "SNES.getRhs(self) -> Vec\nReturn the vector holding the right-hand side.\n\n Not collective.\n\n See Also\n --------\n petsc.SNESGetRhs\n\n \nSource code at petsc4py/PETSc/SNES.pyx:1696"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_179getRhs(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getRhs (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getRhs", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getRhs", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_178getRhs(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_178getRhs(struct PyPetscSNESObject *__pyx_v_self) { struct PyPetscVecObject *__pyx_v_vec = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getRhs", 1); /* "petsc4py/PETSc/SNES.pyx":1706 * * """ * cdef Vec vec = Vec() # <<<<<<<<<<<<<< * CHKERR( SNESGetRhs(self.snes, &vec.vec) ) * CHKERR( PetscINCREF(vec.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 1706, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/SNES.pyx":1707 * """ * cdef Vec vec = Vec() * CHKERR( SNESGetRhs(self.snes, &vec.vec) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(vec.obj) ) * return vec */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetRhs(__pyx_v_self->snes, (&__pyx_v_vec->vec))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1707, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":1708 * cdef Vec vec = Vec() * CHKERR( SNESGetRhs(self.snes, &vec.vec) ) * CHKERR( PetscINCREF(vec.obj) ) # <<<<<<<<<<<<<< * return vec * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_vec->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1708, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":1709 * CHKERR( SNESGetRhs(self.snes, &vec.vec) ) * CHKERR( PetscINCREF(vec.obj) ) * return vec # <<<<<<<<<<<<<< * * def getSolution(self) -> Vec: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_vec); __pyx_r = ((PyObject *)__pyx_v_vec); goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":1696 * return toInt(ival) * * def getRhs(self) -> Vec: # <<<<<<<<<<<<<< * """Return the vector holding the right-hand side. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getRhs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_vec); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":1711 * return vec * * def getSolution(self) -> Vec: # <<<<<<<<<<<<<< * """Return the vector holding the solution. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_181getSolution(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_180getSolution, "SNES.getSolution(self) -> Vec\nReturn the vector holding the solution.\n\n Not collective.\n\n See Also\n --------\n setSolution, petsc.SNESGetSolution\n\n \nSource code at petsc4py/PETSc/SNES.pyx:1711"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_181getSolution(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSolution (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getSolution", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getSolution", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_180getSolution(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_180getSolution(struct PyPetscSNESObject *__pyx_v_self) { struct PyPetscVecObject *__pyx_v_vec = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSolution", 1); /* "petsc4py/PETSc/SNES.pyx":1721 * * """ * cdef Vec vec = Vec() # <<<<<<<<<<<<<< * CHKERR( SNESGetSolution(self.snes, &vec.vec) ) * CHKERR( PetscINCREF(vec.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 1721, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/SNES.pyx":1722 * """ * cdef Vec vec = Vec() * CHKERR( SNESGetSolution(self.snes, &vec.vec) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(vec.obj) ) * return vec */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetSolution(__pyx_v_self->snes, (&__pyx_v_vec->vec))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1722, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":1723 * cdef Vec vec = Vec() * CHKERR( SNESGetSolution(self.snes, &vec.vec) ) * CHKERR( PetscINCREF(vec.obj) ) # <<<<<<<<<<<<<< * return vec * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_vec->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1723, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":1724 * CHKERR( SNESGetSolution(self.snes, &vec.vec) ) * CHKERR( PetscINCREF(vec.obj) ) * return vec # <<<<<<<<<<<<<< * * def setSolution(self, Vec vec) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_vec); __pyx_r = ((PyObject *)__pyx_v_vec); goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":1711 * return vec * * def getSolution(self) -> Vec: # <<<<<<<<<<<<<< * """Return the vector holding the solution. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getSolution", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_vec); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":1726 * return vec * * def setSolution(self, Vec vec) -> None: # <<<<<<<<<<<<<< * """Set the vector used to store the solution. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_183setSolution(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_182setSolution, "SNES.setSolution(self, vec: Vec) -> None\nSet the vector used to store the solution.\n\n Collective.\n\n See Also\n --------\n getSolution, petsc.SNESSetSolution\n\n \nSource code at petsc4py/PETSc/SNES.pyx:1726"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_183setSolution(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_vec = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setSolution (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vec)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 1726, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setSolution") < 0)) __PYX_ERR(50, 1726, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_vec = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setSolution", 1, 1, 1, __pyx_nargs); __PYX_ERR(50, 1726, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SNES.setSolution", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(50, 1726, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_182setSolution(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_vec); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_182setSolution(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setSolution", 1); /* "petsc4py/PETSc/SNES.pyx":1736 * * """ * CHKERR( SNESSetSolution(self.snes, vec.vec) ) # <<<<<<<<<<<<<< * * def getSolutionUpdate(self) -> Vec: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetSolution(__pyx_v_self->snes, __pyx_v_vec->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1736, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":1726 * return vec * * def setSolution(self, Vec vec) -> None: # <<<<<<<<<<<<<< * """Set the vector used to store the solution. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setSolution", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":1738 * CHKERR( SNESSetSolution(self.snes, vec.vec) ) * * def getSolutionUpdate(self) -> Vec: # <<<<<<<<<<<<<< * """Return the vector holding the solution update. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_185getSolutionUpdate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_184getSolutionUpdate, "SNES.getSolutionUpdate(self) -> Vec\nReturn the vector holding the solution update.\n\n Not collective.\n\n See Also\n --------\n petsc.SNESGetSolutionUpdate\n\n \nSource code at petsc4py/PETSc/SNES.pyx:1738"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_185getSolutionUpdate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSolutionUpdate (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getSolutionUpdate", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getSolutionUpdate", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_184getSolutionUpdate(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_184getSolutionUpdate(struct PyPetscSNESObject *__pyx_v_self) { struct PyPetscVecObject *__pyx_v_vec = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSolutionUpdate", 1); /* "petsc4py/PETSc/SNES.pyx":1748 * * """ * cdef Vec vec = Vec() # <<<<<<<<<<<<<< * CHKERR( SNESGetSolutionUpdate(self.snes, &vec.vec) ) * CHKERR( PetscINCREF(vec.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 1748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/SNES.pyx":1749 * """ * cdef Vec vec = Vec() * CHKERR( SNESGetSolutionUpdate(self.snes, &vec.vec) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(vec.obj) ) * return vec */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetSolutionUpdate(__pyx_v_self->snes, (&__pyx_v_vec->vec))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1749, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":1750 * cdef Vec vec = Vec() * CHKERR( SNESGetSolutionUpdate(self.snes, &vec.vec) ) * CHKERR( PetscINCREF(vec.obj) ) # <<<<<<<<<<<<<< * return vec * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_vec->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1750, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":1751 * CHKERR( SNESGetSolutionUpdate(self.snes, &vec.vec) ) * CHKERR( PetscINCREF(vec.obj) ) * return vec # <<<<<<<<<<<<<< * * # --- linear solver --- */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_vec); __pyx_r = ((PyObject *)__pyx_v_vec); goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":1738 * CHKERR( SNESSetSolution(self.snes, vec.vec) ) * * def getSolutionUpdate(self) -> Vec: # <<<<<<<<<<<<<< * """Return the vector holding the solution update. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getSolutionUpdate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_vec); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":1755 * # --- linear solver --- * * def setKSP(self, KSP ksp) -> None: # <<<<<<<<<<<<<< * """Set the linear solver that will be used by the nonlinear solver. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_187setKSP(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_186setKSP, "SNES.setKSP(self, ksp: KSP) -> None\nSet the linear solver that will be used by the nonlinear solver.\n\n Logically collective.\n\n See Also\n --------\n getKSP, petsc.SNESSetKSP\n\n \nSource code at petsc4py/PETSc/SNES.pyx:1755"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_187setKSP(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscKSPObject *__pyx_v_ksp = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setKSP (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ksp,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ksp)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 1755, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setKSP") < 0)) __PYX_ERR(50, 1755, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_ksp = ((struct PyPetscKSPObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setKSP", 1, 1, 1, __pyx_nargs); __PYX_ERR(50, 1755, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SNES.setKSP", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ksp), __pyx_ptype_8petsc4py_5PETSc_KSP, 0, "ksp", 0))) __PYX_ERR(50, 1755, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_186setKSP(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_ksp); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_186setKSP(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscKSPObject *__pyx_v_ksp) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setKSP", 1); /* "petsc4py/PETSc/SNES.pyx":1765 * * """ * CHKERR( SNESSetKSP(self.snes, ksp.ksp) ) # <<<<<<<<<<<<<< * * def getKSP(self) -> KSP: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetKSP(__pyx_v_self->snes, __pyx_v_ksp->ksp)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1765, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":1755 * # --- linear solver --- * * def setKSP(self, KSP ksp) -> None: # <<<<<<<<<<<<<< * """Set the linear solver that will be used by the nonlinear solver. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setKSP", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":1767 * CHKERR( SNESSetKSP(self.snes, ksp.ksp) ) * * def getKSP(self) -> KSP: # <<<<<<<<<<<<<< * """Return the linear solver used by the nonlinear solver. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_189getKSP(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_188getKSP, "SNES.getKSP(self) -> KSP\nReturn the linear solver used by the nonlinear solver.\n\n Not collective.\n\n See Also\n --------\n setKSP, petsc.SNESGetKSP\n\n \nSource code at petsc4py/PETSc/SNES.pyx:1767"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_189getKSP(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getKSP (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getKSP", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getKSP", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_188getKSP(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_188getKSP(struct PyPetscSNESObject *__pyx_v_self) { struct PyPetscKSPObject *__pyx_v_ksp = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getKSP", 1); /* "petsc4py/PETSc/SNES.pyx":1777 * * """ * cdef KSP ksp = KSP() # <<<<<<<<<<<<<< * CHKERR( SNESGetKSP(self.snes, &ksp.ksp) ) * CHKERR( PetscINCREF(ksp.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_KSP)); if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 1777, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ksp = ((struct PyPetscKSPObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/SNES.pyx":1778 * """ * cdef KSP ksp = KSP() * CHKERR( SNESGetKSP(self.snes, &ksp.ksp) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(ksp.obj) ) * return ksp */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetKSP(__pyx_v_self->snes, (&__pyx_v_ksp->ksp))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1778, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":1779 * cdef KSP ksp = KSP() * CHKERR( SNESGetKSP(self.snes, &ksp.ksp) ) * CHKERR( PetscINCREF(ksp.obj) ) # <<<<<<<<<<<<<< * return ksp * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ksp->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1779, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":1780 * CHKERR( SNESGetKSP(self.snes, &ksp.ksp) ) * CHKERR( PetscINCREF(ksp.obj) ) * return ksp # <<<<<<<<<<<<<< * * def setUseEW(self, flag: bool = True, *targs: Any, **kargs: Any) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_ksp); __pyx_r = ((PyObject *)__pyx_v_ksp); goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":1767 * CHKERR( SNESSetKSP(self.snes, ksp.ksp) ) * * def getKSP(self) -> KSP: # <<<<<<<<<<<<<< * """Return the linear solver used by the nonlinear solver. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getKSP", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ksp); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":1782 * return ksp * * def setUseEW(self, flag: bool = True, *targs: Any, **kargs: Any) -> None: # <<<<<<<<<<<<<< * """Tell the solver to use the Eisenstat-Walker trick. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_191setUseEW(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_190setUseEW, "SNES.setUseEW(self, flag: bool = True, *targs: Any, **kargs: Any) -> None\nTell the solver to use the Eisenstat-Walker trick.\n\n Logically collective.\n\n Parameters\n ----------\n flag\n Whether or not to use the Eisenstat-Walker trick.\n *targs\n Positional arguments for `setParamsEW`.\n **kargs\n Keyword arguments for `setParamsEW`.\n\n See Also\n --------\n getUseEW, setParamsEW, petsc.SNESKSPSetUseEW\n\n \nSource code at petsc4py/PETSc/SNES.pyx:1782"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_191setUseEW(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_flag = 0; PyObject *__pyx_v_targs = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setUseEW (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); __pyx_v_kargs = PyDict_New(); if (unlikely(!__pyx_v_kargs)) return NULL; __Pyx_GOTREF(__pyx_v_kargs); __pyx_v_targs = __Pyx_ArgsSlice_FASTCALL(__pyx_args, 1, __pyx_nargs); if (unlikely(!__pyx_v_targs)) { __Pyx_DECREF(__pyx_v_kargs); __pyx_v_kargs = 0; __Pyx_RefNannyFinishContext(); return NULL; } __Pyx_GOTREF(__pyx_v_targs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_True)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { default: case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flag); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 1782, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; const Py_ssize_t used_pos_args = (kwd_pos_args < 1) ? kwd_pos_args : 1; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, __pyx_v_kargs, values + 0, used_pos_args, "setUseEW") < 0)) __PYX_ERR(50, 1782, __pyx_L3_error) } } else { switch (__pyx_nargs) { default: case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; } } __pyx_v_flag = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_DECREF(__pyx_v_targs); __pyx_v_targs = 0; __Pyx_DECREF(__pyx_v_kargs); __pyx_v_kargs = 0; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setUseEW", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_190setUseEW(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_flag, __pyx_v_targs, __pyx_v_kargs); /* function exit code */ __Pyx_DECREF(__pyx_v_targs); __Pyx_DECREF(__pyx_v_kargs); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_190setUseEW(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_flag, PyObject *__pyx_v_targs, PyObject *__pyx_v_kargs) { PetscBool __pyx_v_bval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setUseEW", 1); /* "petsc4py/PETSc/SNES.pyx":1801 * * """ * cdef PetscBool bval = flag # <<<<<<<<<<<<<< * CHKERR( SNESKSPSetUseEW(self.snes, bval) ) * if targs or kargs: self.setParamsEW(*targs, **kargs) */ __pyx_t_1 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_flag)); if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 1801, __pyx_L1_error) __pyx_v_bval = __pyx_t_1; /* "petsc4py/PETSc/SNES.pyx":1802 * """ * cdef PetscBool bval = flag * CHKERR( SNESKSPSetUseEW(self.snes, bval) ) # <<<<<<<<<<<<<< * if targs or kargs: self.setParamsEW(*targs, **kargs) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESKSPSetUseEW(__pyx_v_self->snes, __pyx_v_bval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1802, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":1803 * cdef PetscBool bval = flag * CHKERR( SNESKSPSetUseEW(self.snes, bval) ) * if targs or kargs: self.setParamsEW(*targs, **kargs) # <<<<<<<<<<<<<< * * def getUseEW(self) -> bool: */ __pyx_t_4 = (PyTuple_GET_SIZE(__pyx_v_targs) != 0); if (!__pyx_t_4) { } else { __pyx_t_3 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_kargs); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(50, 1803, __pyx_L1_error) __pyx_t_3 = __pyx_t_4; __pyx_L4_bool_binop_done:; if (__pyx_t_3) { __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setParamsEW); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 1803, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_6)) __PYX_ERR(50, 1803, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_v_targs, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(50, 1803, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } /* "petsc4py/PETSc/SNES.pyx":1782 * return ksp * * def setUseEW(self, flag: bool = True, *targs: Any, **kargs: Any) -> None: # <<<<<<<<<<<<<< * """Tell the solver to use the Eisenstat-Walker trick. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.SNES.setUseEW", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":1805 * if targs or kargs: self.setParamsEW(*targs, **kargs) * * def getUseEW(self) -> bool: # <<<<<<<<<<<<<< * """Return the flag indicating if the solver uses the Eisenstat-Walker trick. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_193getUseEW(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_192getUseEW, "SNES.getUseEW(self) -> bool\nReturn the flag indicating if the solver uses the Eisenstat-Walker trick.\n\n Not Collective.\n\n See Also\n --------\n setUseEW, setParamsEW, petsc.SNESKSPGetUseEW\n\n \nSource code at petsc4py/PETSc/SNES.pyx:1805"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_193getUseEW(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getUseEW (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getUseEW", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getUseEW", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_192getUseEW(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_192getUseEW(struct PyPetscSNESObject *__pyx_v_self) { PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getUseEW", 1); /* "petsc4py/PETSc/SNES.pyx":1815 * * """ * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( SNESKSPGetUseEW(self.snes, &flag) ) * return toBool(flag) */ __pyx_v_flag = PETSC_FALSE; /* "petsc4py/PETSc/SNES.pyx":1816 * """ * cdef PetscBool flag = PETSC_FALSE * CHKERR( SNESKSPGetUseEW(self.snes, &flag) ) # <<<<<<<<<<<<<< * return toBool(flag) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESKSPGetUseEW(__pyx_v_self->snes, (&__pyx_v_flag))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1816, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":1817 * cdef PetscBool flag = PETSC_FALSE * CHKERR( SNESKSPGetUseEW(self.snes, &flag) ) * return toBool(flag) # <<<<<<<<<<<<<< * * def setParamsEW(self, */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 1817, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":1805 * if targs or kargs: self.setParamsEW(*targs, **kargs) * * def getUseEW(self) -> bool: # <<<<<<<<<<<<<< * """Return the flag indicating if the solver uses the Eisenstat-Walker trick. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getUseEW", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":1819 * return toBool(flag) * * def setParamsEW(self, # <<<<<<<<<<<<<< * version: int = None, * rtol_0: float = None, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_195setParamsEW(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_194setParamsEW, "SNES.setParamsEW(self, version: int = None, rtol_0: float = None, rtol_max: float = None, gamma: float = None, alpha: float = None, alpha2: float = None, threshold: float = None) -> None\nSet the parameters for the Eisenstat and Walker trick.\n\n Logically collective.\n\n Parameters\n ----------\n version\n The version of the algorithm. Defaults to `DEFAULT`.\n rtol_0\n The initial relative residual norm. Defaults to `DEFAULT`.\n rtol_max\n The maximum relative residual norm. Defaults to `DEFAULT`.\n gamma\n Parameter. Defaults to `DEFAULT`.\n alpha\n Parameter. Defaults to `DEFAULT`.\n alpha2\n Parameter. Defaults to `DEFAULT`.\n threshold\n Parameter. Defaults to `DEFAULT`.\n\n See Also\n --------\n setUseEW, getParamsEW, petsc.SNESKSPSetParametersEW\n\n \nSource code at petsc4py/PETSc/SNES.pyx:1819"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_195setParamsEW(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_version = 0; PyObject *__pyx_v_rtol_0 = 0; PyObject *__pyx_v_rtol_max = 0; PyObject *__pyx_v_gamma = 0; PyObject *__pyx_v_alpha = 0; PyObject *__pyx_v_alpha2 = 0; PyObject *__pyx_v_threshold = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[7] = {0,0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setParamsEW (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_version,&__pyx_n_s_rtol_0,&__pyx_n_s_rtol_max,&__pyx_n_s_gamma,&__pyx_n_s_alpha,&__pyx_n_s_alpha2,&__pyx_n_s_threshold,0}; /* "petsc4py/PETSc/SNES.pyx":1820 * * def setParamsEW(self, * version: int = None, # <<<<<<<<<<<<<< * rtol_0: float = None, * rtol_max: float = None, */ values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/SNES.pyx":1821 * def setParamsEW(self, * version: int = None, * rtol_0: float = None, # <<<<<<<<<<<<<< * rtol_max: float = None, * gamma: float = None, */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/SNES.pyx":1822 * version: int = None, * rtol_0: float = None, * rtol_max: float = None, # <<<<<<<<<<<<<< * gamma: float = None, * alpha: float = None, */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/SNES.pyx":1823 * rtol_0: float = None, * rtol_max: float = None, * gamma: float = None, # <<<<<<<<<<<<<< * alpha: float = None, * alpha2: float = None, */ values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/SNES.pyx":1824 * rtol_max: float = None, * gamma: float = None, * alpha: float = None, # <<<<<<<<<<<<<< * alpha2: float = None, * threshold: float = None) -> None: */ values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/SNES.pyx":1825 * gamma: float = None, * alpha: float = None, * alpha2: float = None, # <<<<<<<<<<<<<< * threshold: float = None) -> None: * """Set the parameters for the Eisenstat and Walker trick. */ values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/SNES.pyx":1826 * alpha: float = None, * alpha2: float = None, * threshold: float = None) -> None: # <<<<<<<<<<<<<< * """Set the parameters for the Eisenstat and Walker trick. * */ values[6] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_version); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 1819, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rtol_0); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 1819, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rtol_max); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 1819, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gamma); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 1819, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_alpha); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 1819, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_alpha2); if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 1819, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 6: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_threshold); if (value) { values[6] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 1819, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setParamsEW") < 0)) __PYX_ERR(50, 1819, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_version = values[0]; __pyx_v_rtol_0 = values[1]; __pyx_v_rtol_max = values[2]; __pyx_v_gamma = values[3]; __pyx_v_alpha = values[4]; __pyx_v_alpha2 = values[5]; __pyx_v_threshold = values[6]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setParamsEW", 0, 0, 7, __pyx_nargs); __PYX_ERR(50, 1819, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SNES.setParamsEW", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_194setParamsEW(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_version, __pyx_v_rtol_0, __pyx_v_rtol_max, __pyx_v_gamma, __pyx_v_alpha, __pyx_v_alpha2, __pyx_v_threshold); /* "petsc4py/PETSc/SNES.pyx":1819 * return toBool(flag) * * def setParamsEW(self, # <<<<<<<<<<<<<< * version: int = None, * rtol_0: float = None, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_194setParamsEW(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_version, PyObject *__pyx_v_rtol_0, PyObject *__pyx_v_rtol_max, PyObject *__pyx_v_gamma, PyObject *__pyx_v_alpha, PyObject *__pyx_v_alpha2, PyObject *__pyx_v_threshold) { PetscInt __pyx_v_cversion; PetscReal __pyx_v_crtol_0; PetscReal __pyx_v_crtol_max; PetscReal __pyx_v_cgamma; PetscReal __pyx_v_calpha; PetscReal __pyx_v_calpha2; PetscReal __pyx_v_cthreshold; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscInt __pyx_t_2; PetscReal __pyx_t_3; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setParamsEW", 1); /* "petsc4py/PETSc/SNES.pyx":1853 * * """ * cdef PetscInt cversion = PETSC_DEFAULT # <<<<<<<<<<<<<< * cdef PetscReal crtol_0 = PETSC_DEFAULT * cdef PetscReal crtol_max = PETSC_DEFAULT */ __pyx_v_cversion = PETSC_DEFAULT; /* "petsc4py/PETSc/SNES.pyx":1854 * """ * cdef PetscInt cversion = PETSC_DEFAULT * cdef PetscReal crtol_0 = PETSC_DEFAULT # <<<<<<<<<<<<<< * cdef PetscReal crtol_max = PETSC_DEFAULT * cdef PetscReal cgamma = PETSC_DEFAULT */ __pyx_v_crtol_0 = PETSC_DEFAULT; /* "petsc4py/PETSc/SNES.pyx":1855 * cdef PetscInt cversion = PETSC_DEFAULT * cdef PetscReal crtol_0 = PETSC_DEFAULT * cdef PetscReal crtol_max = PETSC_DEFAULT # <<<<<<<<<<<<<< * cdef PetscReal cgamma = PETSC_DEFAULT * cdef PetscReal calpha = PETSC_DEFAULT */ __pyx_v_crtol_max = PETSC_DEFAULT; /* "petsc4py/PETSc/SNES.pyx":1856 * cdef PetscReal crtol_0 = PETSC_DEFAULT * cdef PetscReal crtol_max = PETSC_DEFAULT * cdef PetscReal cgamma = PETSC_DEFAULT # <<<<<<<<<<<<<< * cdef PetscReal calpha = PETSC_DEFAULT * cdef PetscReal calpha2 = PETSC_DEFAULT */ __pyx_v_cgamma = PETSC_DEFAULT; /* "petsc4py/PETSc/SNES.pyx":1857 * cdef PetscReal crtol_max = PETSC_DEFAULT * cdef PetscReal cgamma = PETSC_DEFAULT * cdef PetscReal calpha = PETSC_DEFAULT # <<<<<<<<<<<<<< * cdef PetscReal calpha2 = PETSC_DEFAULT * cdef PetscReal cthreshold = PETSC_DEFAULT */ __pyx_v_calpha = PETSC_DEFAULT; /* "petsc4py/PETSc/SNES.pyx":1858 * cdef PetscReal cgamma = PETSC_DEFAULT * cdef PetscReal calpha = PETSC_DEFAULT * cdef PetscReal calpha2 = PETSC_DEFAULT # <<<<<<<<<<<<<< * cdef PetscReal cthreshold = PETSC_DEFAULT * if version is not None: cversion = asInt(version) */ __pyx_v_calpha2 = PETSC_DEFAULT; /* "petsc4py/PETSc/SNES.pyx":1859 * cdef PetscReal calpha = PETSC_DEFAULT * cdef PetscReal calpha2 = PETSC_DEFAULT * cdef PetscReal cthreshold = PETSC_DEFAULT # <<<<<<<<<<<<<< * if version is not None: cversion = asInt(version) * if rtol_0 is not None: crtol_0 = asReal(rtol_0) */ __pyx_v_cthreshold = PETSC_DEFAULT; /* "petsc4py/PETSc/SNES.pyx":1860 * cdef PetscReal calpha2 = PETSC_DEFAULT * cdef PetscReal cthreshold = PETSC_DEFAULT * if version is not None: cversion = asInt(version) # <<<<<<<<<<<<<< * if rtol_0 is not None: crtol_0 = asReal(rtol_0) * if rtol_max is not None: crtol_max = asReal(rtol_max) */ __pyx_t_1 = (__pyx_v_version != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_version); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(50, 1860, __pyx_L1_error) __pyx_v_cversion = __pyx_t_2; } /* "petsc4py/PETSc/SNES.pyx":1861 * cdef PetscReal cthreshold = PETSC_DEFAULT * if version is not None: cversion = asInt(version) * if rtol_0 is not None: crtol_0 = asReal(rtol_0) # <<<<<<<<<<<<<< * if rtol_max is not None: crtol_max = asReal(rtol_max) * if gamma is not None: cgamma = asReal(gamma) */ __pyx_t_1 = (__pyx_v_rtol_0 != Py_None); if (__pyx_t_1) { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_rtol_0); if (unlikely(__pyx_t_3 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(50, 1861, __pyx_L1_error) __pyx_v_crtol_0 = __pyx_t_3; } /* "petsc4py/PETSc/SNES.pyx":1862 * if version is not None: cversion = asInt(version) * if rtol_0 is not None: crtol_0 = asReal(rtol_0) * if rtol_max is not None: crtol_max = asReal(rtol_max) # <<<<<<<<<<<<<< * if gamma is not None: cgamma = asReal(gamma) * if alpha is not None: calpha = asReal(alpha) */ __pyx_t_1 = (__pyx_v_rtol_max != Py_None); if (__pyx_t_1) { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_rtol_max); if (unlikely(__pyx_t_3 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(50, 1862, __pyx_L1_error) __pyx_v_crtol_max = __pyx_t_3; } /* "petsc4py/PETSc/SNES.pyx":1863 * if rtol_0 is not None: crtol_0 = asReal(rtol_0) * if rtol_max is not None: crtol_max = asReal(rtol_max) * if gamma is not None: cgamma = asReal(gamma) # <<<<<<<<<<<<<< * if alpha is not None: calpha = asReal(alpha) * if alpha2 is not None: calpha2 = asReal(alpha2) */ __pyx_t_1 = (__pyx_v_gamma != Py_None); if (__pyx_t_1) { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_gamma); if (unlikely(__pyx_t_3 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(50, 1863, __pyx_L1_error) __pyx_v_cgamma = __pyx_t_3; } /* "petsc4py/PETSc/SNES.pyx":1864 * if rtol_max is not None: crtol_max = asReal(rtol_max) * if gamma is not None: cgamma = asReal(gamma) * if alpha is not None: calpha = asReal(alpha) # <<<<<<<<<<<<<< * if alpha2 is not None: calpha2 = asReal(alpha2) * if threshold is not None: cthreshold = asReal(threshold) */ __pyx_t_1 = (__pyx_v_alpha != Py_None); if (__pyx_t_1) { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_alpha); if (unlikely(__pyx_t_3 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(50, 1864, __pyx_L1_error) __pyx_v_calpha = __pyx_t_3; } /* "petsc4py/PETSc/SNES.pyx":1865 * if gamma is not None: cgamma = asReal(gamma) * if alpha is not None: calpha = asReal(alpha) * if alpha2 is not None: calpha2 = asReal(alpha2) # <<<<<<<<<<<<<< * if threshold is not None: cthreshold = asReal(threshold) * CHKERR( SNESKSPSetParametersEW( */ __pyx_t_1 = (__pyx_v_alpha2 != Py_None); if (__pyx_t_1) { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_alpha2); if (unlikely(__pyx_t_3 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(50, 1865, __pyx_L1_error) __pyx_v_calpha2 = __pyx_t_3; } /* "petsc4py/PETSc/SNES.pyx":1866 * if alpha is not None: calpha = asReal(alpha) * if alpha2 is not None: calpha2 = asReal(alpha2) * if threshold is not None: cthreshold = asReal(threshold) # <<<<<<<<<<<<<< * CHKERR( SNESKSPSetParametersEW( * self.snes, cversion, crtol_0, crtol_max, */ __pyx_t_1 = (__pyx_v_threshold != Py_None); if (__pyx_t_1) { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_threshold); if (unlikely(__pyx_t_3 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(50, 1866, __pyx_L1_error) __pyx_v_cthreshold = __pyx_t_3; } /* "petsc4py/PETSc/SNES.pyx":1867 * if alpha2 is not None: calpha2 = asReal(alpha2) * if threshold is not None: cthreshold = asReal(threshold) * CHKERR( SNESKSPSetParametersEW( # <<<<<<<<<<<<<< * self.snes, cversion, crtol_0, crtol_max, * cgamma, calpha, calpha2, cthreshold) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESKSPSetParametersEW(__pyx_v_self->snes, __pyx_v_cversion, __pyx_v_crtol_0, __pyx_v_crtol_max, __pyx_v_cgamma, __pyx_v_calpha, __pyx_v_calpha2, __pyx_v_cthreshold)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1867, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":1819 * return toBool(flag) * * def setParamsEW(self, # <<<<<<<<<<<<<< * version: int = None, * rtol_0: float = None, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setParamsEW", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":1871 * cgamma, calpha, calpha2, cthreshold) ) * * def getParamsEW(self) -> dict[str, int | float]: # <<<<<<<<<<<<<< * """Get the parameters of the Eisenstat and Walker trick. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_197getParamsEW(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_196getParamsEW, "SNES.getParamsEW(self) -> dict[str, int | float]\nGet the parameters of the Eisenstat and Walker trick.\n\n Not collective.\n\n See Also\n --------\n setUseEW, setParamsEW, petsc.SNESKSPGetParametersEW\n\n \nSource code at petsc4py/PETSc/SNES.pyx:1871"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_197getParamsEW(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getParamsEW (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getParamsEW", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getParamsEW", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_196getParamsEW(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_196getParamsEW(struct PyPetscSNESObject *__pyx_v_self) { PetscInt __pyx_v_version; PetscReal __pyx_v_rtol_0; PetscReal __pyx_v_rtol_max; PetscReal __pyx_v_gamma; PetscReal __pyx_v_alpha; PetscReal __pyx_v_alpha2; PetscReal __pyx_v_threshold; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getParamsEW", 1); /* "petsc4py/PETSc/SNES.pyx":1881 * * """ * cdef PetscInt version=0 # <<<<<<<<<<<<<< * cdef PetscReal rtol_0=0, rtol_max=0 * cdef PetscReal gamma=0, alpha=0, alpha2=0 */ __pyx_v_version = 0; /* "petsc4py/PETSc/SNES.pyx":1882 * """ * cdef PetscInt version=0 * cdef PetscReal rtol_0=0, rtol_max=0 # <<<<<<<<<<<<<< * cdef PetscReal gamma=0, alpha=0, alpha2=0 * cdef PetscReal threshold=0 */ __pyx_v_rtol_0 = 0.0; __pyx_v_rtol_max = 0.0; /* "petsc4py/PETSc/SNES.pyx":1883 * cdef PetscInt version=0 * cdef PetscReal rtol_0=0, rtol_max=0 * cdef PetscReal gamma=0, alpha=0, alpha2=0 # <<<<<<<<<<<<<< * cdef PetscReal threshold=0 * CHKERR( SNESKSPGetParametersEW( */ __pyx_v_gamma = 0.0; __pyx_v_alpha = 0.0; __pyx_v_alpha2 = 0.0; /* "petsc4py/PETSc/SNES.pyx":1884 * cdef PetscReal rtol_0=0, rtol_max=0 * cdef PetscReal gamma=0, alpha=0, alpha2=0 * cdef PetscReal threshold=0 # <<<<<<<<<<<<<< * CHKERR( SNESKSPGetParametersEW( * self.snes, &version, &rtol_0, &rtol_max, */ __pyx_v_threshold = 0.0; /* "petsc4py/PETSc/SNES.pyx":1885 * cdef PetscReal gamma=0, alpha=0, alpha2=0 * cdef PetscReal threshold=0 * CHKERR( SNESKSPGetParametersEW( # <<<<<<<<<<<<<< * self.snes, &version, &rtol_0, &rtol_max, * &gamma, &alpha, &alpha2, &threshold) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESKSPGetParametersEW(__pyx_v_self->snes, (&__pyx_v_version), (&__pyx_v_rtol_0), (&__pyx_v_rtol_max), (&__pyx_v_gamma), (&__pyx_v_alpha), (&__pyx_v_alpha2), (&__pyx_v_threshold))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1885, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":1888 * self.snes, &version, &rtol_0, &rtol_max, * &gamma, &alpha, &alpha2, &threshold) ) * return {'version' : toInt(version), # <<<<<<<<<<<<<< * 'rtol_0' : toReal(rtol_0), * 'rtol_max' : toReal(rtol_max), */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyDict_NewPresized(7); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 1888, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_version); if (unlikely(!__pyx_t_3)) __PYX_ERR(50, 1888, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_version, __pyx_t_3) < 0) __PYX_ERR(50, 1888, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/SNES.pyx":1889 * &gamma, &alpha, &alpha2, &threshold) ) * return {'version' : toInt(version), * 'rtol_0' : toReal(rtol_0), # <<<<<<<<<<<<<< * 'rtol_max' : toReal(rtol_max), * 'gamma' : toReal(gamma), */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_rtol_0); if (unlikely(!__pyx_t_3)) __PYX_ERR(50, 1889, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_rtol_0, __pyx_t_3) < 0) __PYX_ERR(50, 1888, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/SNES.pyx":1890 * return {'version' : toInt(version), * 'rtol_0' : toReal(rtol_0), * 'rtol_max' : toReal(rtol_max), # <<<<<<<<<<<<<< * 'gamma' : toReal(gamma), * 'alpha' : toReal(alpha), */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_rtol_max); if (unlikely(!__pyx_t_3)) __PYX_ERR(50, 1890, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_rtol_max, __pyx_t_3) < 0) __PYX_ERR(50, 1888, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/SNES.pyx":1891 * 'rtol_0' : toReal(rtol_0), * 'rtol_max' : toReal(rtol_max), * 'gamma' : toReal(gamma), # <<<<<<<<<<<<<< * 'alpha' : toReal(alpha), * 'alpha2' : toReal(alpha2), */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_gamma); if (unlikely(!__pyx_t_3)) __PYX_ERR(50, 1891, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gamma, __pyx_t_3) < 0) __PYX_ERR(50, 1888, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/SNES.pyx":1892 * 'rtol_max' : toReal(rtol_max), * 'gamma' : toReal(gamma), * 'alpha' : toReal(alpha), # <<<<<<<<<<<<<< * 'alpha2' : toReal(alpha2), * 'threshold' : toReal(threshold),} */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_alpha); if (unlikely(!__pyx_t_3)) __PYX_ERR(50, 1892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_alpha, __pyx_t_3) < 0) __PYX_ERR(50, 1888, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/SNES.pyx":1893 * 'gamma' : toReal(gamma), * 'alpha' : toReal(alpha), * 'alpha2' : toReal(alpha2), # <<<<<<<<<<<<<< * 'threshold' : toReal(threshold),} * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_alpha2); if (unlikely(!__pyx_t_3)) __PYX_ERR(50, 1893, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_alpha2, __pyx_t_3) < 0) __PYX_ERR(50, 1888, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/SNES.pyx":1894 * 'alpha' : toReal(alpha), * 'alpha2' : toReal(alpha2), * 'threshold' : toReal(threshold),} # <<<<<<<<<<<<<< * * # --- matrix-free / finite differences --- */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_threshold); if (unlikely(!__pyx_t_3)) __PYX_ERR(50, 1894, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_threshold, __pyx_t_3) < 0) __PYX_ERR(50, 1888, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":1871 * cgamma, calpha, calpha2, cthreshold) ) * * def getParamsEW(self) -> dict[str, int | float]: # <<<<<<<<<<<<<< * """Get the parameters of the Eisenstat and Walker trick. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getParamsEW", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":1898 * # --- matrix-free / finite differences --- * * def setUseMF(self, flag=True) -> None: # <<<<<<<<<<<<<< * """Set the boolean flag indicating to use matrix-free finite-differencing. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_199setUseMF(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_198setUseMF, "SNES.setUseMF(self, flag=True) -> None\nSet the boolean flag indicating to use matrix-free finite-differencing.\n\n Logically collective.\n\n See Also\n --------\n getUseMF\n\n \nSource code at petsc4py/PETSc/SNES.pyx:1898"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_199setUseMF(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_flag = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setUseMF (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_True)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flag); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 1898, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setUseMF") < 0)) __PYX_ERR(50, 1898, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_flag = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setUseMF", 0, 0, 1, __pyx_nargs); __PYX_ERR(50, 1898, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SNES.setUseMF", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_198setUseMF(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_flag); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_198setUseMF(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_flag) { PetscBool __pyx_v_bval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setUseMF", 1); /* "petsc4py/PETSc/SNES.pyx":1908 * * """ * cdef PetscBool bval = flag # <<<<<<<<<<<<<< * CHKERR( SNESSetUseMFFD(self.snes, bval) ) * */ __pyx_t_1 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_flag)); if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 1908, __pyx_L1_error) __pyx_v_bval = __pyx_t_1; /* "petsc4py/PETSc/SNES.pyx":1909 * """ * cdef PetscBool bval = flag * CHKERR( SNESSetUseMFFD(self.snes, bval) ) # <<<<<<<<<<<<<< * * def getUseMF(self) -> bool: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetUseMFFD(__pyx_v_self->snes, __pyx_v_bval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1909, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":1898 * # --- matrix-free / finite differences --- * * def setUseMF(self, flag=True) -> None: # <<<<<<<<<<<<<< * """Set the boolean flag indicating to use matrix-free finite-differencing. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setUseMF", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":1911 * CHKERR( SNESSetUseMFFD(self.snes, bval) ) * * def getUseMF(self) -> bool: # <<<<<<<<<<<<<< * """Return the flag indicating if the solver uses matrix-free finite-differencing. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_201getUseMF(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_200getUseMF, "SNES.getUseMF(self) -> bool\nReturn the flag indicating if the solver uses matrix-free finite-differencing.\n\n Not collective.\n\n See Also\n --------\n setUseMF\n\n \nSource code at petsc4py/PETSc/SNES.pyx:1911"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_201getUseMF(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getUseMF (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getUseMF", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getUseMF", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_200getUseMF(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_200getUseMF(struct PyPetscSNESObject *__pyx_v_self) { PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getUseMF", 1); /* "petsc4py/PETSc/SNES.pyx":1921 * * """ * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( SNESGetUseMFFD(self.snes, &flag) ) * return toBool(flag) */ __pyx_v_flag = PETSC_FALSE; /* "petsc4py/PETSc/SNES.pyx":1922 * """ * cdef PetscBool flag = PETSC_FALSE * CHKERR( SNESGetUseMFFD(self.snes, &flag) ) # <<<<<<<<<<<<<< * return toBool(flag) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetUseMFFD(__pyx_v_self->snes, (&__pyx_v_flag))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1922, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":1923 * cdef PetscBool flag = PETSC_FALSE * CHKERR( SNESGetUseMFFD(self.snes, &flag) ) * return toBool(flag) # <<<<<<<<<<<<<< * * def setUseFD(self, flag=True) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 1923, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":1911 * CHKERR( SNESSetUseMFFD(self.snes, bval) ) * * def getUseMF(self) -> bool: # <<<<<<<<<<<<<< * """Return the flag indicating if the solver uses matrix-free finite-differencing. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getUseMF", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":1925 * return toBool(flag) * * def setUseFD(self, flag=True) -> None: # <<<<<<<<<<<<<< * """Set the boolean flag to use coloring finite-differencing for Jacobian assembly. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_203setUseFD(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_202setUseFD, "SNES.setUseFD(self, flag=True) -> None\nSet the boolean flag to use coloring finite-differencing for Jacobian assembly.\n\n Logically collective.\n\n See Also\n --------\n getUseFD\n\n \nSource code at petsc4py/PETSc/SNES.pyx:1925"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_203setUseFD(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_flag = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setUseFD (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_True)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flag); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 1925, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setUseFD") < 0)) __PYX_ERR(50, 1925, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_flag = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setUseFD", 0, 0, 1, __pyx_nargs); __PYX_ERR(50, 1925, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SNES.setUseFD", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_202setUseFD(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_flag); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_202setUseFD(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_flag) { PetscBool __pyx_v_bval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setUseFD", 1); /* "petsc4py/PETSc/SNES.pyx":1935 * * """ * cdef PetscBool bval = flag # <<<<<<<<<<<<<< * CHKERR( SNESSetUseFDColoring(self.snes, bval) ) * */ __pyx_t_1 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_flag)); if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 1935, __pyx_L1_error) __pyx_v_bval = __pyx_t_1; /* "petsc4py/PETSc/SNES.pyx":1936 * """ * cdef PetscBool bval = flag * CHKERR( SNESSetUseFDColoring(self.snes, bval) ) # <<<<<<<<<<<<<< * * def getUseFD(self) -> False: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetUseFDColoring(__pyx_v_self->snes, __pyx_v_bval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1936, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":1925 * return toBool(flag) * * def setUseFD(self, flag=True) -> None: # <<<<<<<<<<<<<< * """Set the boolean flag to use coloring finite-differencing for Jacobian assembly. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setUseFD", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":1938 * CHKERR( SNESSetUseFDColoring(self.snes, bval) ) * * def getUseFD(self) -> False: # <<<<<<<<<<<<<< * """Return ``true`` if the solver uses color finite-differencing for the Jacobian. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_205getUseFD(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_204getUseFD, "SNES.getUseFD(self) -> False\nReturn ``true`` if the solver uses color finite-differencing for the Jacobian.\n\n Not collective.\n\n See Also\n --------\n setUseFD\n\n \nSource code at petsc4py/PETSc/SNES.pyx:1938"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_205getUseFD(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getUseFD (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getUseFD", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getUseFD", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_204getUseFD(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_204getUseFD(struct PyPetscSNESObject *__pyx_v_self) { PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getUseFD", 1); /* "petsc4py/PETSc/SNES.pyx":1948 * * """ * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( SNESGetUseFDColoring(self.snes, &flag) ) * return toBool(flag) */ __pyx_v_flag = PETSC_FALSE; /* "petsc4py/PETSc/SNES.pyx":1949 * """ * cdef PetscBool flag = PETSC_FALSE * CHKERR( SNESGetUseFDColoring(self.snes, &flag) ) # <<<<<<<<<<<<<< * return toBool(flag) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetUseFDColoring(__pyx_v_self->snes, (&__pyx_v_flag))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1949, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":1950 * cdef PetscBool flag = PETSC_FALSE * CHKERR( SNESGetUseFDColoring(self.snes, &flag) ) * return toBool(flag) # <<<<<<<<<<<<<< * * # --- VI --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 1950, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":1938 * CHKERR( SNESSetUseFDColoring(self.snes, bval) ) * * def getUseFD(self) -> False: # <<<<<<<<<<<<<< * """Return ``true`` if the solver uses color finite-differencing for the Jacobian. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getUseFD", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":1954 * # --- VI --- * * def setVariableBounds(self, Vec xl, Vec xu) -> None: # <<<<<<<<<<<<<< * """Set the vector for the variable bounds. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_207setVariableBounds(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_206setVariableBounds, "SNES.setVariableBounds(self, xl: Vec, xu: Vec) -> None\nSet the vector for the variable bounds.\n\n Collective.\n\n See Also\n --------\n petsc.SNESVISetVariableBounds\n\n \nSource code at petsc4py/PETSc/SNES.pyx:1954"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_207setVariableBounds(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_xl = 0; struct PyPetscVecObject *__pyx_v_xu = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setVariableBounds (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_xl,&__pyx_n_s_xu,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_xl)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 1954, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_xu)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 1954, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setVariableBounds", 1, 2, 2, 1); __PYX_ERR(50, 1954, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setVariableBounds") < 0)) __PYX_ERR(50, 1954, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_xl = ((struct PyPetscVecObject *)values[0]); __pyx_v_xu = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setVariableBounds", 1, 2, 2, __pyx_nargs); __PYX_ERR(50, 1954, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SNES.setVariableBounds", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xl), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "xl", 0))) __PYX_ERR(50, 1954, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xu), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "xu", 0))) __PYX_ERR(50, 1954, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_206setVariableBounds(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_xl, __pyx_v_xu); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_206setVariableBounds(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_xl, struct PyPetscVecObject *__pyx_v_xu) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setVariableBounds", 1); /* "petsc4py/PETSc/SNES.pyx":1964 * * """ * CHKERR( SNESVISetVariableBounds(self.snes, xl.vec, xu.vec) ) # <<<<<<<<<<<<<< * * def getVIInactiveSet(self) -> IS: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESVISetVariableBounds(__pyx_v_self->snes, __pyx_v_xl->vec, __pyx_v_xu->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1964, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":1954 * # --- VI --- * * def setVariableBounds(self, Vec xl, Vec xu) -> None: # <<<<<<<<<<<<<< * """Set the vector for the variable bounds. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setVariableBounds", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":1966 * CHKERR( SNESVISetVariableBounds(self.snes, xl.vec, xu.vec) ) * * def getVIInactiveSet(self) -> IS: # <<<<<<<<<<<<<< * """Return the index set for the inactive set. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_209getVIInactiveSet(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_208getVIInactiveSet, "SNES.getVIInactiveSet(self) -> IS\nReturn the index set for the inactive set.\n\n Not collective.\n\n See Also\n --------\n petsc.SNESVIGetInactiveSet\n\n \nSource code at petsc4py/PETSc/SNES.pyx:1966"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_209getVIInactiveSet(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getVIInactiveSet (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getVIInactiveSet", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getVIInactiveSet", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_208getVIInactiveSet(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_208getVIInactiveSet(struct PyPetscSNESObject *__pyx_v_self) { struct PyPetscISObject *__pyx_v_inact = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getVIInactiveSet", 1); /* "petsc4py/PETSc/SNES.pyx":1976 * * """ * cdef IS inact = IS() # <<<<<<<<<<<<<< * CHKERR( SNESVIGetInactiveSet(self.snes, &inact.iset) ) * CHKERR( PetscINCREF(inact.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 1976, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_inact = ((struct PyPetscISObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/SNES.pyx":1977 * """ * cdef IS inact = IS() * CHKERR( SNESVIGetInactiveSet(self.snes, &inact.iset) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(inact.obj) ) * return inact */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESVIGetInactiveSet(__pyx_v_self->snes, (&__pyx_v_inact->iset))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1977, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":1978 * cdef IS inact = IS() * CHKERR( SNESVIGetInactiveSet(self.snes, &inact.iset) ) * CHKERR( PetscINCREF(inact.obj) ) # <<<<<<<<<<<<<< * return inact * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_inact->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1978, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":1979 * CHKERR( SNESVIGetInactiveSet(self.snes, &inact.iset) ) * CHKERR( PetscINCREF(inact.obj) ) * return inact # <<<<<<<<<<<<<< * * # --- Python --- */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_inact); __pyx_r = ((PyObject *)__pyx_v_inact); goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":1966 * CHKERR( SNESVISetVariableBounds(self.snes, xl.vec, xu.vec) ) * * def getVIInactiveSet(self) -> IS: # <<<<<<<<<<<<<< * """Return the index set for the inactive set. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getVIInactiveSet", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_inact); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":1983 * # --- Python --- * * def createPython(self, context: Any = None, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Create a nonlinear solver of Python type. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_211createPython(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_210createPython, "SNES.createPython(self, context: Any = None, comm: Comm | None = None) -> Self\nCreate a nonlinear solver of Python type.\n\n Collective.\n\n Parameters\n ----------\n context\n An instance of the Python class implementing the required methods.\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n petsc_python_snes, setType, setPythonContext, Type.PYTHON\n\n \nSource code at petsc4py/PETSc/SNES.pyx:1983"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_211createPython(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_context = 0; PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createPython (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_context,&__pyx_n_s_comm,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_context); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 1983, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 1983, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createPython") < 0)) __PYX_ERR(50, 1983, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_context = values[0]; __pyx_v_comm = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createPython", 0, 0, 2, __pyx_nargs); __PYX_ERR(50, 1983, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SNES.createPython", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_210createPython(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_context, __pyx_v_comm); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_210createPython(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; SNES __pyx_v_newsnes; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PetscErrorCode __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createPython", 1); /* "petsc4py/PETSc/SNES.pyx":2000 * * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscSNES newsnes = NULL * CHKERR( SNESCreate(ccomm, &newsnes) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(50, 2000, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/SNES.pyx":2001 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscSNES newsnes = NULL # <<<<<<<<<<<<<< * CHKERR( SNESCreate(ccomm, &newsnes) ) * CHKERR( PetscCLEAR(self.obj) ); self.snes = newsnes */ __pyx_v_newsnes = NULL; /* "petsc4py/PETSc/SNES.pyx":2002 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscSNES newsnes = NULL * CHKERR( SNESCreate(ccomm, &newsnes) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.snes = newsnes * CHKERR( SNESSetType(self.snes, SNESPYTHON) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESCreate(__pyx_v_ccomm, (&__pyx_v_newsnes))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 2002, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":2003 * cdef PetscSNES newsnes = NULL * CHKERR( SNESCreate(ccomm, &newsnes) ) * CHKERR( PetscCLEAR(self.obj) ); self.snes = newsnes # <<<<<<<<<<<<<< * CHKERR( SNESSetType(self.snes, SNESPYTHON) ) * CHKERR( SNESPythonSetContext(self.snes, context) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 2003, __pyx_L1_error) __pyx_v_self->snes = __pyx_v_newsnes; /* "petsc4py/PETSc/SNES.pyx":2004 * CHKERR( SNESCreate(ccomm, &newsnes) ) * CHKERR( PetscCLEAR(self.obj) ); self.snes = newsnes * CHKERR( SNESSetType(self.snes, SNESPYTHON) ) # <<<<<<<<<<<<<< * CHKERR( SNESPythonSetContext(self.snes, context) ) * return self */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetType(__pyx_v_self->snes, SNESPYTHON)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 2004, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":2005 * CHKERR( PetscCLEAR(self.obj) ); self.snes = newsnes * CHKERR( SNESSetType(self.snes, SNESPYTHON) ) * CHKERR( SNESPythonSetContext(self.snes, context) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = SNESPythonSetContext(__pyx_v_self->snes, ((void *)__pyx_v_context)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 2005, __pyx_L1_error) __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_t_2); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 2005, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":2006 * CHKERR( SNESSetType(self.snes, SNESPYTHON) ) * CHKERR( SNESPythonSetContext(self.snes, context) ) * return self # <<<<<<<<<<<<<< * * def setPythonContext(self, context: Any) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":1983 * # --- Python --- * * def createPython(self, context: Any = None, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Create a nonlinear solver of Python type. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.createPython", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":2008 * return self * * def setPythonContext(self, context: Any) -> None: # <<<<<<<<<<<<<< * """Set the instance of the class implementing the required Python methods. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_213setPythonContext(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_212setPythonContext, "SNES.setPythonContext(self, context: Any) -> None\nSet the instance of the class implementing the required Python methods.\n\n Not collective.\n\n See Also\n --------\n petsc_python_snes, getPythonContext\n\n \nSource code at petsc4py/PETSc/SNES.pyx:2008"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_213setPythonContext(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_context = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPythonContext (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_context,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_context)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 2008, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setPythonContext") < 0)) __PYX_ERR(50, 2008, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_context = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPythonContext", 1, 1, 1, __pyx_nargs); __PYX_ERR(50, 2008, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SNES.setPythonContext", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_212setPythonContext(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_context); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_212setPythonContext(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_context) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPythonContext", 1); /* "petsc4py/PETSc/SNES.pyx":2018 * * """ * CHKERR( SNESPythonSetContext(self.snes, context) ) # <<<<<<<<<<<<<< * * def getPythonContext(self) -> Any: */ __pyx_t_1 = SNESPythonSetContext(__pyx_v_self->snes, ((void *)__pyx_v_context)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 2018, __pyx_L1_error) __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_t_1); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 2018, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":2008 * return self * * def setPythonContext(self, context: Any) -> None: # <<<<<<<<<<<<<< * """Set the instance of the class implementing the required Python methods. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setPythonContext", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":2020 * CHKERR( SNESPythonSetContext(self.snes, context) ) * * def getPythonContext(self) -> Any: # <<<<<<<<<<<<<< * """Return the instance of the class implementing the required Python methods. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_215getPythonContext(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_214getPythonContext, "SNES.getPythonContext(self) -> Any\nReturn the instance of the class implementing the required Python methods.\n\n Not collective.\n\n See Also\n --------\n petsc_python_snes, setPythonContext\n\n \nSource code at petsc4py/PETSc/SNES.pyx:2020"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_215getPythonContext(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getPythonContext (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getPythonContext", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getPythonContext", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_214getPythonContext(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_214getPythonContext(struct PyPetscSNESObject *__pyx_v_self) { void *__pyx_v_context; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getPythonContext", 1); /* "petsc4py/PETSc/SNES.pyx":2030 * * """ * cdef void *context = NULL # <<<<<<<<<<<<<< * CHKERR( SNESPythonGetContext(self.snes, &context) ) * if context == NULL: return None */ __pyx_v_context = NULL; /* "petsc4py/PETSc/SNES.pyx":2031 * """ * cdef void *context = NULL * CHKERR( SNESPythonGetContext(self.snes, &context) ) # <<<<<<<<<<<<<< * if context == NULL: return None * else: return context */ __pyx_t_1 = SNESPythonGetContext(__pyx_v_self->snes, (&__pyx_v_context)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 2031, __pyx_L1_error) __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_t_1); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 2031, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":2032 * cdef void *context = NULL * CHKERR( SNESPythonGetContext(self.snes, &context) ) * if context == NULL: return None # <<<<<<<<<<<<<< * else: return context * */ __pyx_t_3 = (__pyx_v_context == NULL); if (__pyx_t_3) { __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } /* "petsc4py/PETSc/SNES.pyx":2033 * CHKERR( SNESPythonGetContext(self.snes, &context) ) * if context == NULL: return None * else: return context # <<<<<<<<<<<<<< * * def setPythonType(self, py_type: str) -> None: */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_context)); __pyx_r = ((PyObject *)__pyx_v_context); goto __pyx_L0; } /* "petsc4py/PETSc/SNES.pyx":2020 * CHKERR( SNESPythonSetContext(self.snes, context) ) * * def getPythonContext(self) -> Any: # <<<<<<<<<<<<<< * """Return the instance of the class implementing the required Python methods. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.getPythonContext", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":2035 * else: return context * * def setPythonType(self, py_type: str) -> None: # <<<<<<<<<<<<<< * """Set the fully qualified Python name of the class to be used. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_217setPythonType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_216setPythonType, "SNES.setPythonType(self, py_type: str) -> None\nSet the fully qualified Python name of the class to be used.\n\n Collective.\n\n See Also\n --------\n petsc_python_snes, setPythonContext, getPythonType\n petsc.SNESPythonSetType\n\n \nSource code at petsc4py/PETSc/SNES.pyx:2035"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_217setPythonType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_py_type = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPythonType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_py_type,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_py_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 2035, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setPythonType") < 0)) __PYX_ERR(50, 2035, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_py_type = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPythonType", 1, 1, 1, __pyx_nargs); __PYX_ERR(50, 2035, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SNES.setPythonType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_216setPythonType(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_py_type); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_216setPythonType(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_py_type) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPythonType", 0); __Pyx_INCREF(__pyx_v_py_type); /* "petsc4py/PETSc/SNES.pyx":2046 * * """ * cdef const char *cval = NULL # <<<<<<<<<<<<<< * py_type = str2bytes(py_type, &cval) * CHKERR( SNESPythonSetType(self.snes, cval) ) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/SNES.pyx":2047 * """ * cdef const char *cval = NULL * py_type = str2bytes(py_type, &cval) # <<<<<<<<<<<<<< * CHKERR( SNESPythonSetType(self.snes, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_py_type, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2047, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_py_type, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/SNES.pyx":2048 * cdef const char *cval = NULL * py_type = str2bytes(py_type, &cval) * CHKERR( SNESPythonSetType(self.snes, cval) ) # <<<<<<<<<<<<<< * * def getPythonType(self) -> str: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESPythonSetType(__pyx_v_self->snes, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 2048, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":2035 * else: return context * * def setPythonType(self, py_type: str) -> None: # <<<<<<<<<<<<<< * """Set the fully qualified Python name of the class to be used. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.SNES.setPythonType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_py_type); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":2050 * CHKERR( SNESPythonSetType(self.snes, cval) ) * * def getPythonType(self) -> str: # <<<<<<<<<<<<<< * """Return the fully qualified Python name of the class used by the solver. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_219getPythonType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_218getPythonType, "SNES.getPythonType(self) -> str\nReturn the fully qualified Python name of the class used by the solver.\n\n Not collective.\n\n See Also\n --------\n petsc_python_snes, setPythonContext, setPythonType\n petsc.SNESPythonGetType\n\n \nSource code at petsc4py/PETSc/SNES.pyx:2050"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_219getPythonType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getPythonType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getPythonType", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getPythonType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_218getPythonType(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_218getPythonType(struct PyPetscSNESObject *__pyx_v_self) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getPythonType", 1); /* "petsc4py/PETSc/SNES.pyx":2061 * * """ * cdef const char *cval = NULL # <<<<<<<<<<<<<< * CHKERR( SNESPythonGetType(self.snes, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/SNES.pyx":2062 * """ * cdef const char *cval = NULL * CHKERR( SNESPythonGetType(self.snes, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESPythonGetType(__pyx_v_self->snes, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 2062, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":2063 * cdef const char *cval = NULL * CHKERR( SNESPythonGetType(self.snes, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * # --- Composite --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2063, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":2050 * CHKERR( SNESPythonSetType(self.snes, cval) ) * * def getPythonType(self) -> str: # <<<<<<<<<<<<<< * """Return the fully qualified Python name of the class used by the solver. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getPythonType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":2067 * # --- Composite --- * * def getCompositeSNES(self, int n) -> SNES: # <<<<<<<<<<<<<< * """Return the n-th solver in the composite. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_221getCompositeSNES(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_220getCompositeSNES, "SNES.getCompositeSNES(self, n: int) -> SNES\nReturn the n-th solver in the composite.\n\n Not collective.\n\n See Also\n --------\n getCompositeNumber, petsc.SNESCompositeGetSNES, petsc.SNESCOMPOSITE\n\n \nSource code at petsc4py/PETSc/SNES.pyx:2067"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_221getCompositeSNES(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { int __pyx_v_n; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getCompositeSNES (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 2067, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getCompositeSNES") < 0)) __PYX_ERR(50, 2067, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_n = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(50, 2067, __pyx_L3_error) } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getCompositeSNES", 1, 1, 1, __pyx_nargs); __PYX_ERR(50, 2067, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SNES.getCompositeSNES", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_220getCompositeSNES(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_n); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_220getCompositeSNES(struct PyPetscSNESObject *__pyx_v_self, int __pyx_v_n) { PetscInt __pyx_v_cn; struct PyPetscSNESObject *__pyx_v_snes = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscInt __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getCompositeSNES", 1); /* "petsc4py/PETSc/SNES.pyx":2078 * """ * cdef PetscInt cn * cdef SNES snes = SNES() # <<<<<<<<<<<<<< * cn = asInt(n) * CHKERR( SNESCompositeGetSNES(self.snes, cn, &snes.snes) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SNES)); if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2078, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_snes = ((struct PyPetscSNESObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/SNES.pyx":2079 * cdef PetscInt cn * cdef SNES snes = SNES() * cn = asInt(n) # <<<<<<<<<<<<<< * CHKERR( SNESCompositeGetSNES(self.snes, cn, &snes.snes) ) * CHKERR( PetscINCREF(snes.obj) ) */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2079, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_t_1); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(50, 2079, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_cn = __pyx_t_2; /* "petsc4py/PETSc/SNES.pyx":2080 * cdef SNES snes = SNES() * cn = asInt(n) * CHKERR( SNESCompositeGetSNES(self.snes, cn, &snes.snes) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(snes.obj) ) * return snes */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESCompositeGetSNES(__pyx_v_self->snes, __pyx_v_cn, (&__pyx_v_snes->snes))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 2080, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":2081 * cn = asInt(n) * CHKERR( SNESCompositeGetSNES(self.snes, cn, &snes.snes) ) * CHKERR( PetscINCREF(snes.obj) ) # <<<<<<<<<<<<<< * return snes * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_snes->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 2081, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":2082 * CHKERR( SNESCompositeGetSNES(self.snes, cn, &snes.snes) ) * CHKERR( PetscINCREF(snes.obj) ) * return snes # <<<<<<<<<<<<<< * * def getCompositeNumber(self) -> int: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_snes); __pyx_r = ((PyObject *)__pyx_v_snes); goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":2067 * # --- Composite --- * * def getCompositeSNES(self, int n) -> SNES: # <<<<<<<<<<<<<< * """Return the n-th solver in the composite. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getCompositeSNES", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_snes); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":2084 * return snes * * def getCompositeNumber(self) -> int: # <<<<<<<<<<<<<< * """Return the number of solvers in the composite. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_223getCompositeNumber(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_222getCompositeNumber, "SNES.getCompositeNumber(self) -> int\nReturn the number of solvers in the composite.\n\n Not collective.\n\n See Also\n --------\n getCompositeSNES, petsc.SNESCompositeGetNumber, petsc.SNESCOMPOSITE\n\n \nSource code at petsc4py/PETSc/SNES.pyx:2084"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_223getCompositeNumber(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getCompositeNumber (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getCompositeNumber", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getCompositeNumber", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_222getCompositeNumber(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_222getCompositeNumber(struct PyPetscSNESObject *__pyx_v_self) { PetscInt __pyx_v_cn; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getCompositeNumber", 1); /* "petsc4py/PETSc/SNES.pyx":2094 * * """ * cdef PetscInt cn = 0 # <<<<<<<<<<<<<< * CHKERR( SNESCompositeGetNumber(self.snes, &cn) ) * return toInt(cn) */ __pyx_v_cn = 0; /* "petsc4py/PETSc/SNES.pyx":2095 * """ * cdef PetscInt cn = 0 * CHKERR( SNESCompositeGetNumber(self.snes, &cn) ) # <<<<<<<<<<<<<< * return toInt(cn) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESCompositeGetNumber(__pyx_v_self->snes, (&__pyx_v_cn))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 2095, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":2096 * cdef PetscInt cn = 0 * CHKERR( SNESCompositeGetNumber(self.snes, &cn) ) * return toInt(cn) # <<<<<<<<<<<<<< * * # --- NASM --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_cn); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":2084 * return snes * * def getCompositeNumber(self) -> int: # <<<<<<<<<<<<<< * """Return the number of solvers in the composite. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getCompositeNumber", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":2100 * # --- NASM --- * * def getNASMSNES(self, n: int) -> SNES: # <<<<<<<<<<<<<< * """Return the n-th solver in NASM. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_225getNASMSNES(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_224getNASMSNES, "SNES.getNASMSNES(self, n: int) -> SNES\nReturn the n-th solver in NASM.\n\n Not collective.\n\n See Also\n --------\n getNASMNumber, petsc.SNESNASMGetSNES, petsc.SNESNASM\n\n \nSource code at petsc4py/PETSc/SNES.pyx:2100"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_225getNASMSNES(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_n = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getNASMSNES (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 2100, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getNASMSNES") < 0)) __PYX_ERR(50, 2100, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_n = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getNASMSNES", 1, 1, 1, __pyx_nargs); __PYX_ERR(50, 2100, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SNES.getNASMSNES", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_224getNASMSNES(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_n); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_224getNASMSNES(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_n) { PetscInt __pyx_v_cn; struct PyPetscSNESObject *__pyx_v_snes = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getNASMSNES", 1); /* "petsc4py/PETSc/SNES.pyx":2110 * * """ * cdef PetscInt cn = asInt(n) # <<<<<<<<<<<<<< * cdef SNES snes = SNES() * CHKERR( SNESNASMGetSNES(self.snes, cn, &snes.snes) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_n); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(50, 2110, __pyx_L1_error) __pyx_v_cn = __pyx_t_1; /* "petsc4py/PETSc/SNES.pyx":2111 * """ * cdef PetscInt cn = asInt(n) * cdef SNES snes = SNES() # <<<<<<<<<<<<<< * CHKERR( SNESNASMGetSNES(self.snes, cn, &snes.snes) ) * CHKERR( PetscINCREF(snes.obj) ) */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SNES)); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_snes = ((struct PyPetscSNESObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/SNES.pyx":2112 * cdef PetscInt cn = asInt(n) * cdef SNES snes = SNES() * CHKERR( SNESNASMGetSNES(self.snes, cn, &snes.snes) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(snes.obj) ) * return snes */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESNASMGetSNES(__pyx_v_self->snes, __pyx_v_cn, (&__pyx_v_snes->snes))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 2112, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":2113 * cdef SNES snes = SNES() * CHKERR( SNESNASMGetSNES(self.snes, cn, &snes.snes) ) * CHKERR( PetscINCREF(snes.obj) ) # <<<<<<<<<<<<<< * return snes * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_snes->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 2113, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":2114 * CHKERR( SNESNASMGetSNES(self.snes, cn, &snes.snes) ) * CHKERR( PetscINCREF(snes.obj) ) * return snes # <<<<<<<<<<<<<< * * def getNASMNumber(self) -> int: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_snes); __pyx_r = ((PyObject *)__pyx_v_snes); goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":2100 * # --- NASM --- * * def getNASMSNES(self, n: int) -> SNES: # <<<<<<<<<<<<<< * """Return the n-th solver in NASM. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getNASMSNES", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_snes); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":2116 * return snes * * def getNASMNumber(self) -> int: # <<<<<<<<<<<<<< * """Return the number of solvers in NASM. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_227getNASMNumber(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_226getNASMNumber, "SNES.getNASMNumber(self) -> int\nReturn the number of solvers in NASM.\n\n Not collective.\n\n See Also\n --------\n getNASMSNES, petsc.SNESNASMGetNumber, petsc.SNESNASM\n\n \nSource code at petsc4py/PETSc/SNES.pyx:2116"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_227getNASMNumber(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getNASMNumber (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getNASMNumber", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getNASMNumber", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_226getNASMNumber(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_226getNASMNumber(struct PyPetscSNESObject *__pyx_v_self) { PetscInt __pyx_v_cn; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getNASMNumber", 1); /* "petsc4py/PETSc/SNES.pyx":2126 * * """ * cdef PetscInt cn = 0 # <<<<<<<<<<<<<< * CHKERR( SNESNASMGetNumber(self.snes, &cn) ) * return toInt(cn) */ __pyx_v_cn = 0; /* "petsc4py/PETSc/SNES.pyx":2127 * """ * cdef PetscInt cn = 0 * CHKERR( SNESNASMGetNumber(self.snes, &cn) ) # <<<<<<<<<<<<<< * return toInt(cn) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESNASMGetNumber(__pyx_v_self->snes, (&__pyx_v_cn))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 2127, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":2128 * cdef PetscInt cn = 0 * CHKERR( SNESNASMGetNumber(self.snes, &cn) ) * return toInt(cn) # <<<<<<<<<<<<<< * * # --- Patch --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_cn); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":2116 * return snes * * def getNASMNumber(self) -> int: # <<<<<<<<<<<<<< * """Return the number of solvers in NASM. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getNASMNumber", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":2132 * # --- Patch --- * * def setPatchCellNumbering(self, Section sec) -> None: # <<<<<<<<<<<<<< * """Set cell patch numbering.""" * CHKERR( SNESPatchSetCellNumbering(self.snes, sec.sec) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_229setPatchCellNumbering(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_228setPatchCellNumbering, "SNES.setPatchCellNumbering(self, sec: Section) -> None\nSet cell patch numbering.\nSource code at petsc4py/PETSc/SNES.pyx:2132"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_229setPatchCellNumbering(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscSectionObject *__pyx_v_sec = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPatchCellNumbering (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sec,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sec)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 2132, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setPatchCellNumbering") < 0)) __PYX_ERR(50, 2132, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_sec = ((struct PyPetscSectionObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPatchCellNumbering", 1, 1, 1, __pyx_nargs); __PYX_ERR(50, 2132, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SNES.setPatchCellNumbering", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sec), __pyx_ptype_8petsc4py_5PETSc_Section, 0, "sec", 0))) __PYX_ERR(50, 2132, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_228setPatchCellNumbering(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_sec); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_228setPatchCellNumbering(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscSectionObject *__pyx_v_sec) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPatchCellNumbering", 1); /* "petsc4py/PETSc/SNES.pyx":2134 * def setPatchCellNumbering(self, Section sec) -> None: * """Set cell patch numbering.""" * CHKERR( SNESPatchSetCellNumbering(self.snes, sec.sec) ) # <<<<<<<<<<<<<< * * def setPatchDiscretisationInfo(self, dms, bs, */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESPatchSetCellNumbering(__pyx_v_self->snes, __pyx_v_sec->sec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 2134, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":2132 * # --- Patch --- * * def setPatchCellNumbering(self, Section sec) -> None: # <<<<<<<<<<<<<< * """Set cell patch numbering.""" * CHKERR( SNESPatchSetCellNumbering(self.snes, sec.sec) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setPatchCellNumbering", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":2136 * CHKERR( SNESPatchSetCellNumbering(self.snes, sec.sec) ) * * def setPatchDiscretisationInfo(self, dms, bs, # <<<<<<<<<<<<<< * cellNodeMaps, * subspaceOffsets, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_231setPatchDiscretisationInfo(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_230setPatchDiscretisationInfo, "SNES.setPatchDiscretisationInfo(self, dms, bs, cellNodeMaps, subspaceOffsets, ghostBcNodes, globalBcNodes) -> None\nSet patch discretisation information.\nSource code at petsc4py/PETSc/SNES.pyx:2136"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_231setPatchDiscretisationInfo(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_dms = 0; PyObject *__pyx_v_bs = 0; PyObject *__pyx_v_cellNodeMaps = 0; PyObject *__pyx_v_subspaceOffsets = 0; PyObject *__pyx_v_ghostBcNodes = 0; PyObject *__pyx_v_globalBcNodes = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[6] = {0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPatchDiscretisationInfo (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dms,&__pyx_n_s_bs,&__pyx_n_s_cellNodeMaps,&__pyx_n_s_subspaceOffsets,&__pyx_n_s_ghostBcNodes,&__pyx_n_s_globalBcNodes,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dms)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 2136, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_bs)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 2136, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setPatchDiscretisationInfo", 1, 6, 6, 1); __PYX_ERR(50, 2136, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_cellNodeMaps)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 2136, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setPatchDiscretisationInfo", 1, 6, 6, 2); __PYX_ERR(50, 2136, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_subspaceOffsets)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 2136, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setPatchDiscretisationInfo", 1, 6, 6, 3); __PYX_ERR(50, 2136, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ghostBcNodes)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 2136, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setPatchDiscretisationInfo", 1, 6, 6, 4); __PYX_ERR(50, 2136, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_globalBcNodes)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 2136, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setPatchDiscretisationInfo", 1, 6, 6, 5); __PYX_ERR(50, 2136, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setPatchDiscretisationInfo") < 0)) __PYX_ERR(50, 2136, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 6)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); } __pyx_v_dms = values[0]; __pyx_v_bs = values[1]; __pyx_v_cellNodeMaps = values[2]; __pyx_v_subspaceOffsets = values[3]; __pyx_v_ghostBcNodes = values[4]; __pyx_v_globalBcNodes = values[5]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPatchDiscretisationInfo", 1, 6, 6, __pyx_nargs); __PYX_ERR(50, 2136, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SNES.setPatchDiscretisationInfo", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_230setPatchDiscretisationInfo(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_dms, __pyx_v_bs, __pyx_v_cellNodeMaps, __pyx_v_subspaceOffsets, __pyx_v_ghostBcNodes, __pyx_v_globalBcNodes); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_230setPatchDiscretisationInfo(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_dms, PyObject *__pyx_v_bs, PyObject *__pyx_v_cellNodeMaps, PyObject *__pyx_v_subspaceOffsets, PyObject *__pyx_v_ghostBcNodes, PyObject *__pyx_v_globalBcNodes) { PetscInt __pyx_v_numSubSpaces; PetscInt __pyx_v_numGhostBcs; PetscInt __pyx_v_numGlobalBcs; PetscInt *__pyx_v_nodesPerCell; PetscInt const **__pyx_v_ccellNodeMaps; DM *__pyx_v_cdms; PetscInt *__pyx_v_cbs; PetscInt *__pyx_v_csubspaceOffsets; PetscInt *__pyx_v_cghostBcNodes; PetscInt *__pyx_v_cglobalBcNodes; PetscInt __pyx_v_i; CYTHON_UNUSED PyObject *__pyx_v__ = NULL; PyObject *__pyx_v_nodes = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; PetscInt __pyx_t_3; PetscInt __pyx_t_4; PetscInt __pyx_t_5; DM __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *(*__pyx_t_10)(PyObject *); PetscInt __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPatchDiscretisationInfo", 0); __Pyx_INCREF(__pyx_v_bs); __Pyx_INCREF(__pyx_v_subspaceOffsets); __Pyx_INCREF(__pyx_v_ghostBcNodes); __Pyx_INCREF(__pyx_v_globalBcNodes); /* "petsc4py/PETSc/SNES.pyx":2142 * globalBcNodes) -> None: * """Set patch discretisation information.""" * cdef PetscInt numSubSpaces = 0 # <<<<<<<<<<<<<< * cdef PetscInt numGhostBcs = 0, numGlobalBcs = 0 * cdef PetscInt *nodesPerCell = NULL */ __pyx_v_numSubSpaces = 0; /* "petsc4py/PETSc/SNES.pyx":2143 * """Set patch discretisation information.""" * cdef PetscInt numSubSpaces = 0 * cdef PetscInt numGhostBcs = 0, numGlobalBcs = 0 # <<<<<<<<<<<<<< * cdef PetscInt *nodesPerCell = NULL * cdef const PetscInt **ccellNodeMaps = NULL */ __pyx_v_numGhostBcs = 0; __pyx_v_numGlobalBcs = 0; /* "petsc4py/PETSc/SNES.pyx":2144 * cdef PetscInt numSubSpaces = 0 * cdef PetscInt numGhostBcs = 0, numGlobalBcs = 0 * cdef PetscInt *nodesPerCell = NULL # <<<<<<<<<<<<<< * cdef const PetscInt **ccellNodeMaps = NULL * cdef PetscDM *cdms = NULL */ __pyx_v_nodesPerCell = NULL; /* "petsc4py/PETSc/SNES.pyx":2145 * cdef PetscInt numGhostBcs = 0, numGlobalBcs = 0 * cdef PetscInt *nodesPerCell = NULL * cdef const PetscInt **ccellNodeMaps = NULL # <<<<<<<<<<<<<< * cdef PetscDM *cdms = NULL * cdef PetscInt *cbs = NULL */ __pyx_v_ccellNodeMaps = NULL; /* "petsc4py/PETSc/SNES.pyx":2146 * cdef PetscInt *nodesPerCell = NULL * cdef const PetscInt **ccellNodeMaps = NULL * cdef PetscDM *cdms = NULL # <<<<<<<<<<<<<< * cdef PetscInt *cbs = NULL * cdef PetscInt *csubspaceOffsets = NULL */ __pyx_v_cdms = NULL; /* "petsc4py/PETSc/SNES.pyx":2147 * cdef const PetscInt **ccellNodeMaps = NULL * cdef PetscDM *cdms = NULL * cdef PetscInt *cbs = NULL # <<<<<<<<<<<<<< * cdef PetscInt *csubspaceOffsets = NULL * cdef PetscInt *cghostBcNodes = NULL */ __pyx_v_cbs = NULL; /* "petsc4py/PETSc/SNES.pyx":2148 * cdef PetscDM *cdms = NULL * cdef PetscInt *cbs = NULL * cdef PetscInt *csubspaceOffsets = NULL # <<<<<<<<<<<<<< * cdef PetscInt *cghostBcNodes = NULL * cdef PetscInt *cglobalBcNodes = NULL */ __pyx_v_csubspaceOffsets = NULL; /* "petsc4py/PETSc/SNES.pyx":2149 * cdef PetscInt *cbs = NULL * cdef PetscInt *csubspaceOffsets = NULL * cdef PetscInt *cghostBcNodes = NULL # <<<<<<<<<<<<<< * cdef PetscInt *cglobalBcNodes = NULL * cdef PetscInt i = 0 */ __pyx_v_cghostBcNodes = NULL; /* "petsc4py/PETSc/SNES.pyx":2150 * cdef PetscInt *csubspaceOffsets = NULL * cdef PetscInt *cghostBcNodes = NULL * cdef PetscInt *cglobalBcNodes = NULL # <<<<<<<<<<<<<< * cdef PetscInt i = 0 * */ __pyx_v_cglobalBcNodes = NULL; /* "petsc4py/PETSc/SNES.pyx":2151 * cdef PetscInt *cghostBcNodes = NULL * cdef PetscInt *cglobalBcNodes = NULL * cdef PetscInt i = 0 # <<<<<<<<<<<<<< * * bs = iarray_i(bs, &numSubSpaces, &cbs) */ __pyx_v_i = 0; /* "petsc4py/PETSc/SNES.pyx":2153 * cdef PetscInt i = 0 * * bs = iarray_i(bs, &numSubSpaces, &cbs) # <<<<<<<<<<<<<< * ghostBcNodes = iarray_i(ghostBcNodes, &numGhostBcs, &cghostBcNodes) * globalBcNodes = iarray_i(globalBcNodes, &numGlobalBcs, &cglobalBcNodes) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_bs, (&__pyx_v_numSubSpaces), (&__pyx_v_cbs))); if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_bs, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/SNES.pyx":2154 * * bs = iarray_i(bs, &numSubSpaces, &cbs) * ghostBcNodes = iarray_i(ghostBcNodes, &numGhostBcs, &cghostBcNodes) # <<<<<<<<<<<<<< * globalBcNodes = iarray_i(globalBcNodes, &numGlobalBcs, &cglobalBcNodes) * subspaceOffsets = iarray_i(subspaceOffsets, NULL, &csubspaceOffsets) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_ghostBcNodes, (&__pyx_v_numGhostBcs), (&__pyx_v_cghostBcNodes))); if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_ghostBcNodes, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/SNES.pyx":2155 * bs = iarray_i(bs, &numSubSpaces, &cbs) * ghostBcNodes = iarray_i(ghostBcNodes, &numGhostBcs, &cghostBcNodes) * globalBcNodes = iarray_i(globalBcNodes, &numGlobalBcs, &cglobalBcNodes) # <<<<<<<<<<<<<< * subspaceOffsets = iarray_i(subspaceOffsets, NULL, &csubspaceOffsets) * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_globalBcNodes, (&__pyx_v_numGlobalBcs), (&__pyx_v_cglobalBcNodes))); if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_globalBcNodes, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/SNES.pyx":2156 * ghostBcNodes = iarray_i(ghostBcNodes, &numGhostBcs, &cghostBcNodes) * globalBcNodes = iarray_i(globalBcNodes, &numGlobalBcs, &cglobalBcNodes) * subspaceOffsets = iarray_i(subspaceOffsets, NULL, &csubspaceOffsets) # <<<<<<<<<<<<<< * * CHKERR( PetscMalloc(numSubSpaces*sizeof(PetscInt), &nodesPerCell) ) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_subspaceOffsets, NULL, (&__pyx_v_csubspaceOffsets))); if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_subspaceOffsets, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/SNES.pyx":2158 * subspaceOffsets = iarray_i(subspaceOffsets, NULL, &csubspaceOffsets) * * CHKERR( PetscMalloc(numSubSpaces*sizeof(PetscInt), &nodesPerCell) ) # <<<<<<<<<<<<<< * CHKERR( PetscMalloc(numSubSpaces*sizeof(PetscDM), &cdms) ) * CHKERR( PetscMalloc(numSubSpaces*sizeof(PetscInt*), &ccellNodeMaps) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((((size_t)__pyx_v_numSubSpaces) * (sizeof(PetscInt))), (&__pyx_v_nodesPerCell))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 2158, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":2159 * * CHKERR( PetscMalloc(numSubSpaces*sizeof(PetscInt), &nodesPerCell) ) * CHKERR( PetscMalloc(numSubSpaces*sizeof(PetscDM), &cdms) ) # <<<<<<<<<<<<<< * CHKERR( PetscMalloc(numSubSpaces*sizeof(PetscInt*), &ccellNodeMaps) ) * for i in range(numSubSpaces): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((((size_t)__pyx_v_numSubSpaces) * (sizeof(DM))), (&__pyx_v_cdms))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 2159, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":2160 * CHKERR( PetscMalloc(numSubSpaces*sizeof(PetscInt), &nodesPerCell) ) * CHKERR( PetscMalloc(numSubSpaces*sizeof(PetscDM), &cdms) ) * CHKERR( PetscMalloc(numSubSpaces*sizeof(PetscInt*), &ccellNodeMaps) ) # <<<<<<<<<<<<<< * for i in range(numSubSpaces): * cdms[i] = (dms[i]).dm */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((((size_t)__pyx_v_numSubSpaces) * (sizeof(PetscInt *))), (&__pyx_v_ccellNodeMaps))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 2160, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":2161 * CHKERR( PetscMalloc(numSubSpaces*sizeof(PetscDM), &cdms) ) * CHKERR( PetscMalloc(numSubSpaces*sizeof(PetscInt*), &ccellNodeMaps) ) * for i in range(numSubSpaces): # <<<<<<<<<<<<<< * cdms[i] = (dms[i]).dm * _, nodes = asarray(cellNodeMaps[i]).shape */ __pyx_t_3 = __pyx_v_numSubSpaces; __pyx_t_4 = __pyx_t_3; for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { __pyx_v_i = __pyx_t_5; /* "petsc4py/PETSc/SNES.pyx":2162 * CHKERR( PetscMalloc(numSubSpaces*sizeof(PetscInt*), &ccellNodeMaps) ) * for i in range(numSubSpaces): * cdms[i] = (dms[i]).dm # <<<<<<<<<<<<<< * _, nodes = asarray(cellNodeMaps[i]).shape * cellNodeMaps[i] = iarray_i(cellNodeMaps[i], NULL, &(ccellNodeMaps[i])) */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_dms, __pyx_v_i, PetscInt, 1, __Pyx_PyInt_From_PetscInt, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_DM)))) __PYX_ERR(50, 2162, __pyx_L1_error) __pyx_t_6 = ((struct PyPetscDMObject *)__pyx_t_1)->dm; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; (__pyx_v_cdms[__pyx_v_i]) = __pyx_t_6; /* "petsc4py/PETSc/SNES.pyx":2163 * for i in range(numSubSpaces): * cdms[i] = (dms[i]).dm * _, nodes = asarray(cellNodeMaps[i]).shape # <<<<<<<<<<<<<< * cellNodeMaps[i] = iarray_i(cellNodeMaps[i], NULL, &(ccellNodeMaps[i])) * nodesPerCell[i] = asInt(nodes) */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_cellNodeMaps, __pyx_v_i, PetscInt, 1, __Pyx_PyInt_From_PetscInt, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_asarray(__pyx_t_1)); if (unlikely(!__pyx_t_7)) __PYX_ERR(50, 2163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(50, 2163, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_7 = PyList_GET_ITEM(sequence, 0); __pyx_t_8 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); #else __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(50, 2163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(50, 2163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(50, 2163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_10 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); index = 0; __pyx_t_7 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_7)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_7); index = 1; __pyx_t_8 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(50, 2163, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(50, 2163, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v__, __pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF_SET(__pyx_v_nodes, __pyx_t_8); __pyx_t_8 = 0; /* "petsc4py/PETSc/SNES.pyx":2164 * cdms[i] = (dms[i]).dm * _, nodes = asarray(cellNodeMaps[i]).shape * cellNodeMaps[i] = iarray_i(cellNodeMaps[i], NULL, &(ccellNodeMaps[i])) # <<<<<<<<<<<<<< * nodesPerCell[i] = asInt(nodes) * */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_cellNodeMaps, __pyx_v_i, PetscInt, 1, __Pyx_PyInt_From_PetscInt, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_t_1, NULL, ((PetscInt **)(&(__pyx_v_ccellNodeMaps[__pyx_v_i]))))); if (unlikely(!__pyx_t_8)) __PYX_ERR(50, 2164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely((__Pyx_SetItemInt(__pyx_v_cellNodeMaps, __pyx_v_i, __pyx_t_8, PetscInt, 1, __Pyx_PyInt_From_PetscInt, 0, 1, 1) < 0))) __PYX_ERR(50, 2164, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "petsc4py/PETSc/SNES.pyx":2165 * _, nodes = asarray(cellNodeMaps[i]).shape * cellNodeMaps[i] = iarray_i(cellNodeMaps[i], NULL, &(ccellNodeMaps[i])) * nodesPerCell[i] = asInt(nodes) # <<<<<<<<<<<<<< * * # TODO: refactor on the PETSc side to take ISes? */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_nodes); if (unlikely(__pyx_t_11 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(50, 2165, __pyx_L1_error) (__pyx_v_nodesPerCell[__pyx_v_i]) = __pyx_t_11; } /* "petsc4py/PETSc/SNES.pyx":2168 * * # TODO: refactor on the PETSc side to take ISes? * CHKERR( SNESPatchSetDiscretisationInfo(self.snes, numSubSpaces, # <<<<<<<<<<<<<< * cdms, cbs, nodesPerCell, * ccellNodeMaps, csubspaceOffsets, */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESPatchSetDiscretisationInfo(__pyx_v_self->snes, __pyx_v_numSubSpaces, __pyx_v_cdms, __pyx_v_cbs, __pyx_v_nodesPerCell, __pyx_v_ccellNodeMaps, __pyx_v_csubspaceOffsets, __pyx_v_numGhostBcs, __pyx_v_cghostBcNodes, __pyx_v_numGlobalBcs, __pyx_v_cglobalBcNodes)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 2168, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":2173 * numGhostBcs, cghostBcNodes, * numGlobalBcs, cglobalBcNodes) ) * CHKERR( PetscFree(nodesPerCell) ) # <<<<<<<<<<<<<< * CHKERR( PetscFree(cdms) ) * CHKERR( PetscFree(ccellNodeMaps) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_nodesPerCell)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 2173, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":2174 * numGlobalBcs, cglobalBcNodes) ) * CHKERR( PetscFree(nodesPerCell) ) * CHKERR( PetscFree(cdms) ) # <<<<<<<<<<<<<< * CHKERR( PetscFree(ccellNodeMaps) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_cdms)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 2174, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":2175 * CHKERR( PetscFree(nodesPerCell) ) * CHKERR( PetscFree(cdms) ) * CHKERR( PetscFree(ccellNodeMaps) ) # <<<<<<<<<<<<<< * * def setPatchComputeOperator(self, operator, args=None, kargs=None) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_ccellNodeMaps)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 2175, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":2136 * CHKERR( SNESPatchSetCellNumbering(self.snes, sec.sec) ) * * def setPatchDiscretisationInfo(self, dms, bs, # <<<<<<<<<<<<<< * cellNodeMaps, * subspaceOffsets, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("petsc4py.PETSc.SNES.setPatchDiscretisationInfo", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v__); __Pyx_XDECREF(__pyx_v_nodes); __Pyx_XDECREF(__pyx_v_bs); __Pyx_XDECREF(__pyx_v_subspaceOffsets); __Pyx_XDECREF(__pyx_v_ghostBcNodes); __Pyx_XDECREF(__pyx_v_globalBcNodes); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":2177 * CHKERR( PetscFree(ccellNodeMaps) ) * * def setPatchComputeOperator(self, operator, args=None, kargs=None) -> None: # <<<<<<<<<<<<<< * """Set patch compute operator.""" * if args is None: args = () */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_233setPatchComputeOperator(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_232setPatchComputeOperator, "SNES.setPatchComputeOperator(self, operator, args=None, kargs=None) -> None\nSet patch compute operator.\nSource code at petsc4py/PETSc/SNES.pyx:2177"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_233setPatchComputeOperator(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_operator = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPatchComputeOperator (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_operator,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_operator)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 2177, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 2177, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 2177, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setPatchComputeOperator") < 0)) __PYX_ERR(50, 2177, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_operator = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPatchComputeOperator", 0, 1, 3, __pyx_nargs); __PYX_ERR(50, 2177, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SNES.setPatchComputeOperator", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_232setPatchComputeOperator(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_operator, __pyx_v_args, __pyx_v_kargs); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_232setPatchComputeOperator(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_operator, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPatchComputeOperator", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/SNES.pyx":2179 * def setPatchComputeOperator(self, operator, args=None, kargs=None) -> None: * """Set patch compute operator.""" * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (operator, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/SNES.pyx":2180 * """Set patch compute operator.""" * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (operator, args, kargs) * self.set_attr("__patch_compute_operator__", context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); if (__pyx_t_1) { __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_2); __pyx_t_2 = 0; } /* "petsc4py/PETSc/SNES.pyx":2181 * if args is None: args = () * if kargs is None: kargs = {} * context = (operator, args, kargs) # <<<<<<<<<<<<<< * self.set_attr("__patch_compute_operator__", context) * CHKERR( SNESPatchSetComputeOperator(self.snes, PCPatch_ComputeOperator, context) ) */ __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_operator); __Pyx_GIVEREF(__pyx_v_operator); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_operator)) __PYX_ERR(50, 2181, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_args)) __PYX_ERR(50, 2181, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_kargs)) __PYX_ERR(50, 2181, __pyx_L1_error); __pyx_v_context = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/SNES.pyx":2182 * if kargs is None: kargs = {} * context = (operator, args, kargs) * self.set_attr("__patch_compute_operator__", context) # <<<<<<<<<<<<<< * CHKERR( SNESPatchSetComputeOperator(self.snes, PCPatch_ComputeOperator, context) ) * */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__patch_compute_operator__"), __pyx_v_context); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/SNES.pyx":2183 * context = (operator, args, kargs) * self.set_attr("__patch_compute_operator__", context) * CHKERR( SNESPatchSetComputeOperator(self.snes, PCPatch_ComputeOperator, context) ) # <<<<<<<<<<<<<< * * def setPatchComputeFunction(self, function, args=None, kargs=None) -> None: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESPatchSetComputeOperator(__pyx_v_self->snes, __pyx_f_8petsc4py_5PETSc_PCPatch_ComputeOperator, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 2183, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":2177 * CHKERR( PetscFree(ccellNodeMaps) ) * * def setPatchComputeOperator(self, operator, args=None, kargs=None) -> None: # <<<<<<<<<<<<<< * """Set patch compute operator.""" * if args is None: args = () */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.setPatchComputeOperator", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":2185 * CHKERR( SNESPatchSetComputeOperator(self.snes, PCPatch_ComputeOperator, context) ) * * def setPatchComputeFunction(self, function, args=None, kargs=None) -> None: # <<<<<<<<<<<<<< * """Set patch compute function.""" * if args is None: args = () */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_235setPatchComputeFunction(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_234setPatchComputeFunction, "SNES.setPatchComputeFunction(self, function, args=None, kargs=None) -> None\nSet patch compute function.\nSource code at petsc4py/PETSc/SNES.pyx:2185"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_235setPatchComputeFunction(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_function = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPatchComputeFunction (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_function,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_function)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 2185, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 2185, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 2185, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setPatchComputeFunction") < 0)) __PYX_ERR(50, 2185, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_function = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPatchComputeFunction", 0, 1, 3, __pyx_nargs); __PYX_ERR(50, 2185, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SNES.setPatchComputeFunction", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_234setPatchComputeFunction(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_function, __pyx_v_args, __pyx_v_kargs); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_234setPatchComputeFunction(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_function, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPatchComputeFunction", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/SNES.pyx":2187 * def setPatchComputeFunction(self, function, args=None, kargs=None) -> None: * """Set patch compute function.""" * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (function, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/SNES.pyx":2188 * """Set patch compute function.""" * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (function, args, kargs) * self.set_attr("__patch_compute_function__", context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); if (__pyx_t_1) { __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_2); __pyx_t_2 = 0; } /* "petsc4py/PETSc/SNES.pyx":2189 * if args is None: args = () * if kargs is None: kargs = {} * context = (function, args, kargs) # <<<<<<<<<<<<<< * self.set_attr("__patch_compute_function__", context) * CHKERR( SNESPatchSetComputeFunction(self.snes, PCPatch_ComputeFunction, context) ) */ __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_function); __Pyx_GIVEREF(__pyx_v_function); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_function)) __PYX_ERR(50, 2189, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_args)) __PYX_ERR(50, 2189, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_kargs)) __PYX_ERR(50, 2189, __pyx_L1_error); __pyx_v_context = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/SNES.pyx":2190 * if kargs is None: kargs = {} * context = (function, args, kargs) * self.set_attr("__patch_compute_function__", context) # <<<<<<<<<<<<<< * CHKERR( SNESPatchSetComputeFunction(self.snes, PCPatch_ComputeFunction, context) ) * */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__patch_compute_function__"), __pyx_v_context); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/SNES.pyx":2191 * context = (function, args, kargs) * self.set_attr("__patch_compute_function__", context) * CHKERR( SNESPatchSetComputeFunction(self.snes, PCPatch_ComputeFunction, context) ) # <<<<<<<<<<<<<< * * def setPatchConstructType(self, typ, operator=None, args=None, kargs=None) -> None: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESPatchSetComputeFunction(__pyx_v_self->snes, __pyx_f_8petsc4py_5PETSc_PCPatch_ComputeFunction, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 2191, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":2185 * CHKERR( SNESPatchSetComputeOperator(self.snes, PCPatch_ComputeOperator, context) ) * * def setPatchComputeFunction(self, function, args=None, kargs=None) -> None: # <<<<<<<<<<<<<< * """Set patch compute function.""" * if args is None: args = () */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.setPatchComputeFunction", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":2193 * CHKERR( SNESPatchSetComputeFunction(self.snes, PCPatch_ComputeFunction, context) ) * * def setPatchConstructType(self, typ, operator=None, args=None, kargs=None) -> None: # <<<<<<<<<<<<<< * """Set patch construct type.""" * if args is None: args = () */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_237setPatchConstructType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4SNES_236setPatchConstructType, "SNES.setPatchConstructType(self, typ, operator=None, args=None, kargs=None) -> None\nSet patch construct type.\nSource code at petsc4py/PETSc/SNES.pyx:2193"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_237setPatchConstructType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_typ = 0; PyObject *__pyx_v_operator = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPatchConstructType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_typ,&__pyx_n_s_operator,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_typ)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 2193, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_operator); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 2193, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 2193, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 2193, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setPatchConstructType") < 0)) __PYX_ERR(50, 2193, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_typ = values[0]; __pyx_v_operator = values[1]; __pyx_v_args = values[2]; __pyx_v_kargs = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPatchConstructType", 0, 1, 4, __pyx_nargs); __PYX_ERR(50, 2193, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.SNES.setPatchConstructType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_236setPatchConstructType(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_typ, __pyx_v_operator, __pyx_v_args, __pyx_v_kargs); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_236setPatchConstructType(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_typ, PyObject *__pyx_v_operator, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; PCPatchConstructType __pyx_t_7; PetscErrorCode __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPatchConstructType", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/SNES.pyx":2195 * def setPatchConstructType(self, typ, operator=None, args=None, kargs=None) -> None: * """Set patch construct type.""" * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * */ __pyx_t_1 = (__pyx_v_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/SNES.pyx":2196 * """Set patch construct type.""" * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * * if typ in {PC.PatchConstructType.PYTHON, PC.PatchConstructType.USER} and operator is None: */ __pyx_t_1 = (__pyx_v_kargs == Py_None); if (__pyx_t_1) { __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_2); __pyx_t_2 = 0; } /* "petsc4py/PETSc/SNES.pyx":2198 * if kargs is None: kargs = {} * * if typ in {PC.PatchConstructType.PYTHON, PC.PatchConstructType.USER} and operator is None: # <<<<<<<<<<<<<< * raise ValueError("Must provide operator for USER or PYTHON type") * if operator is not None: */ __Pyx_INCREF(__pyx_v_typ); __pyx_t_2 = __pyx_v_typ; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_PC), __pyx_n_s_PatchConstructType); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 2198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_PYTHON); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 2198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 2198, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(50, 2198, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!__pyx_t_6) { } else { __pyx_t_3 = __pyx_t_6; goto __pyx_L8_bool_binop_done; } __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_PC), __pyx_n_s_PatchConstructType); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 2198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_USER); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 2198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 2198, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(50, 2198, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = __pyx_t_6; __pyx_L8_bool_binop_done:; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_6 = __pyx_t_3; if (__pyx_t_6) { } else { __pyx_t_1 = __pyx_t_6; goto __pyx_L6_bool_binop_done; } __pyx_t_6 = (__pyx_v_operator == Py_None); __pyx_t_1 = __pyx_t_6; __pyx_L6_bool_binop_done:; if (unlikely(__pyx_t_1)) { /* "petsc4py/PETSc/SNES.pyx":2199 * * if typ in {PC.PatchConstructType.PYTHON, PC.PatchConstructType.USER} and operator is None: * raise ValueError("Must provide operator for USER or PYTHON type") # <<<<<<<<<<<<<< * if operator is not None: * context = (operator, args, kargs) */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(50, 2199, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":2198 * if kargs is None: kargs = {} * * if typ in {PC.PatchConstructType.PYTHON, PC.PatchConstructType.USER} and operator is None: # <<<<<<<<<<<<<< * raise ValueError("Must provide operator for USER or PYTHON type") * if operator is not None: */ } /* "petsc4py/PETSc/SNES.pyx":2200 * if typ in {PC.PatchConstructType.PYTHON, PC.PatchConstructType.USER} and operator is None: * raise ValueError("Must provide operator for USER or PYTHON type") * if operator is not None: # <<<<<<<<<<<<<< * context = (operator, args, kargs) * else: */ __pyx_t_1 = (__pyx_v_operator != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/SNES.pyx":2201 * raise ValueError("Must provide operator for USER or PYTHON type") * if operator is not None: * context = (operator, args, kargs) # <<<<<<<<<<<<<< * else: * context = None */ __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_operator); __Pyx_GIVEREF(__pyx_v_operator); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_operator)) __PYX_ERR(50, 2201, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_args)) __PYX_ERR(50, 2201, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_kargs)) __PYX_ERR(50, 2201, __pyx_L1_error); __pyx_v_context = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/SNES.pyx":2200 * if typ in {PC.PatchConstructType.PYTHON, PC.PatchConstructType.USER} and operator is None: * raise ValueError("Must provide operator for USER or PYTHON type") * if operator is not None: # <<<<<<<<<<<<<< * context = (operator, args, kargs) * else: */ goto __pyx_L10; } /* "petsc4py/PETSc/SNES.pyx":2203 * context = (operator, args, kargs) * else: * context = None # <<<<<<<<<<<<<< * self.set_attr("__patch_construction_operator__", context) * CHKERR( SNESPatchSetConstructType(self.snes, typ, PCPatch_UserConstructOperator, context) ) */ /*else*/ { __Pyx_INCREF(Py_None); __pyx_v_context = ((PyObject*)Py_None); } __pyx_L10:; /* "petsc4py/PETSc/SNES.pyx":2204 * else: * context = None * self.set_attr("__patch_construction_operator__", context) # <<<<<<<<<<<<<< * CHKERR( SNESPatchSetConstructType(self.snes, typ, PCPatch_UserConstructOperator, context) ) * */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__patch_construction_operator__"), __pyx_v_context); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/SNES.pyx":2205 * context = None * self.set_attr("__patch_construction_operator__", context) * CHKERR( SNESPatchSetConstructType(self.snes, typ, PCPatch_UserConstructOperator, context) ) # <<<<<<<<<<<<<< * * # --- application context --- */ __pyx_t_7 = ((PCPatchConstructType)__Pyx_PyInt_As_PCPatchConstructType(__pyx_v_typ)); if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 2205, __pyx_L1_error) __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESPatchSetConstructType(__pyx_v_self->snes, __pyx_t_7, __pyx_f_8petsc4py_5PETSc_PCPatch_UserConstructOperator, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 2205, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":2193 * CHKERR( SNESPatchSetComputeFunction(self.snes, PCPatch_ComputeFunction, context) ) * * def setPatchConstructType(self, typ, operator=None, args=None, kargs=None) -> None: # <<<<<<<<<<<<<< * """Set patch construct type.""" * if args is None: args = () */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.SNES.setPatchConstructType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":2211 * property appctx: * """Application context.""" * def __get__(self) -> Any: # <<<<<<<<<<<<<< * return self.getAppCtx() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_6appctx_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_6appctx_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_6appctx___get__(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_6appctx___get__(struct PyPetscSNESObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/SNES.pyx":2212 * """Application context.""" * def __get__(self) -> Any: * return self.getAppCtx() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setAppCtx(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getAppCtx); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":2211 * property appctx: * """Application context.""" * def __get__(self) -> Any: # <<<<<<<<<<<<<< * return self.getAppCtx() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.appctx.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":2213 * def __get__(self) -> Any: * return self.getAppCtx() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setAppCtx(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_4SNES_6appctx_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_4SNES_6appctx_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_6appctx_2__set__(((struct PyPetscSNESObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_4SNES_6appctx_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "petsc4py/PETSc/SNES.pyx":2214 * return self.getAppCtx() * def __set__(self, value): * self.setAppCtx(value) # <<<<<<<<<<<<<< * * # --- discretization space --- */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setAppCtx); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_value}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/SNES.pyx":2213 * def __get__(self) -> Any: * return self.getAppCtx() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setAppCtx(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.appctx.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":2220 * property dm: * """`DM`.""" * def __get__(self) -> DM: # <<<<<<<<<<<<<< * return self.getDM() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_2dm_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_2dm_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_2dm___get__(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_2dm___get__(struct PyPetscSNESObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/SNES.pyx":2221 * """`DM`.""" * def __get__(self) -> DM: * return self.getDM() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setDM(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getDM); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":2220 * property dm: * """`DM`.""" * def __get__(self) -> DM: # <<<<<<<<<<<<<< * return self.getDM() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.dm.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":2222 * def __get__(self) -> DM: * return self.getDM() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setDM(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_4SNES_2dm_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_4SNES_2dm_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_2dm_2__set__(((struct PyPetscSNESObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_4SNES_2dm_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "petsc4py/PETSc/SNES.pyx":2223 * return self.getDM() * def __set__(self, value): * self.setDM(value) # <<<<<<<<<<<<<< * * # --- nonlinear preconditioner --- */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setDM); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_value}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/SNES.pyx":2222 * def __get__(self) -> DM: * return self.getDM() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setDM(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.dm.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":2229 * property npc: * """Nonlinear preconditioner.""" * def __get__(self) -> SNES: # <<<<<<<<<<<<<< * return self.getNPC() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_3npc_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_3npc_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_3npc___get__(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_3npc___get__(struct PyPetscSNESObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/SNES.pyx":2230 * """Nonlinear preconditioner.""" * def __get__(self) -> SNES: * return self.getNPC() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setNPC(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getNPC); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":2229 * property npc: * """Nonlinear preconditioner.""" * def __get__(self) -> SNES: # <<<<<<<<<<<<<< * return self.getNPC() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.npc.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":2231 * def __get__(self) -> SNES: * return self.getNPC() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setNPC(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_4SNES_3npc_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_4SNES_3npc_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_3npc_2__set__(((struct PyPetscSNESObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_4SNES_3npc_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "petsc4py/PETSc/SNES.pyx":2232 * return self.getNPC() * def __set__(self, value): * self.setNPC(value) # <<<<<<<<<<<<<< * * # --- vectors --- */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setNPC); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_value}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/SNES.pyx":2231 * def __get__(self) -> SNES: * return self.getNPC() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setNPC(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.npc.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":2238 * property vec_sol: * """Solution vector.""" * def __get__(self) -> Vec: # <<<<<<<<<<<<<< * return self.getSolution() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_7vec_sol_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_7vec_sol_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_7vec_sol___get__(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_7vec_sol___get__(struct PyPetscSNESObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/SNES.pyx":2239 * """Solution vector.""" * def __get__(self) -> Vec: * return self.getSolution() # <<<<<<<<<<<<<< * * property vec_upd: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getSolution); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":2238 * property vec_sol: * """Solution vector.""" * def __get__(self) -> Vec: # <<<<<<<<<<<<<< * return self.getSolution() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.vec_sol.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":2243 * property vec_upd: * """Update vector.""" * def __get__(self) -> Vec: # <<<<<<<<<<<<<< * return self.getSolutionUpdate() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_7vec_upd_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_7vec_upd_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_7vec_upd___get__(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_7vec_upd___get__(struct PyPetscSNESObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/SNES.pyx":2244 * """Update vector.""" * def __get__(self) -> Vec: * return self.getSolutionUpdate() # <<<<<<<<<<<<<< * * property vec_rhs: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getSolutionUpdate); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":2243 * property vec_upd: * """Update vector.""" * def __get__(self) -> Vec: # <<<<<<<<<<<<<< * return self.getSolutionUpdate() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.vec_upd.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":2248 * property vec_rhs: * """Right-hand side vector.""" * def __get__(self) -> Vec: # <<<<<<<<<<<<<< * return self.getRhs() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_7vec_rhs_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_7vec_rhs_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_7vec_rhs___get__(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_7vec_rhs___get__(struct PyPetscSNESObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/SNES.pyx":2249 * """Right-hand side vector.""" * def __get__(self) -> Vec: * return self.getRhs() # <<<<<<<<<<<<<< * * # --- linear solver --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getRhs); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":2248 * property vec_rhs: * """Right-hand side vector.""" * def __get__(self) -> Vec: # <<<<<<<<<<<<<< * return self.getRhs() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.vec_rhs.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":2255 * property ksp: * """Linear solver.""" * def __get__(self) -> KSP: # <<<<<<<<<<<<<< * return self.getKSP() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_3ksp_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_3ksp_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_3ksp___get__(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_3ksp___get__(struct PyPetscSNESObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/SNES.pyx":2256 * """Linear solver.""" * def __get__(self) -> KSP: * return self.getKSP() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setKSP(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getKSP); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":2255 * property ksp: * """Linear solver.""" * def __get__(self) -> KSP: # <<<<<<<<<<<<<< * return self.getKSP() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.ksp.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":2257 * def __get__(self) -> KSP: * return self.getKSP() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setKSP(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_4SNES_3ksp_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_4SNES_3ksp_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_3ksp_2__set__(((struct PyPetscSNESObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_4SNES_3ksp_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "petsc4py/PETSc/SNES.pyx":2258 * return self.getKSP() * def __set__(self, value): * self.setKSP(value) # <<<<<<<<<<<<<< * * property use_ew: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setKSP); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_value}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/SNES.pyx":2257 * def __get__(self) -> KSP: * return self.getKSP() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setKSP(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.ksp.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":2261 * * property use_ew: * def __get__(self): # <<<<<<<<<<<<<< * return self.getUseEW() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_6use_ew_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_6use_ew_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_6use_ew___get__(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_6use_ew___get__(struct PyPetscSNESObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/SNES.pyx":2262 * property use_ew: * def __get__(self): * return self.getUseEW() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setUseEW(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getUseEW); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":2261 * * property use_ew: * def __get__(self): # <<<<<<<<<<<<<< * return self.getUseEW() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.use_ew.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":2263 * def __get__(self): * return self.getUseEW() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setUseEW(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_4SNES_6use_ew_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_4SNES_6use_ew_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_6use_ew_2__set__(((struct PyPetscSNESObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_4SNES_6use_ew_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "petsc4py/PETSc/SNES.pyx":2264 * return self.getUseEW() * def __set__(self, value): * self.setUseEW(value) # <<<<<<<<<<<<<< * * # --- tolerances --- */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setUseEW); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2264, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_value}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2264, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/SNES.pyx":2263 * def __get__(self): * return self.getUseEW() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setUseEW(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.use_ew.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":2270 * property rtol: * """Relative residual tolerance.""" * def __get__(self) -> float: # <<<<<<<<<<<<<< * return self.getTolerances()[0] * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_4rtol_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_4rtol_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_4rtol___get__(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_4rtol___get__(struct PyPetscSNESObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/SNES.pyx":2271 * """Relative residual tolerance.""" * def __get__(self) -> float: * return self.getTolerances()[0] # <<<<<<<<<<<<<< * def __set__(self, value): * self.setTolerances(rtol=value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getTolerances); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":2270 * property rtol: * """Relative residual tolerance.""" * def __get__(self) -> float: # <<<<<<<<<<<<<< * return self.getTolerances()[0] * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.rtol.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":2272 * def __get__(self) -> float: * return self.getTolerances()[0] * def __set__(self, value): # <<<<<<<<<<<<<< * self.setTolerances(rtol=value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_4SNES_4rtol_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_4SNES_4rtol_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_4rtol_2__set__(((struct PyPetscSNESObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_4SNES_4rtol_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "petsc4py/PETSc/SNES.pyx":2273 * return self.getTolerances()[0] * def __set__(self, value): * self.setTolerances(rtol=value) # <<<<<<<<<<<<<< * * property atol: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setTolerances); if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_rtol, __pyx_v_value) < 0) __PYX_ERR(50, 2273, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(50, 2273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/SNES.pyx":2272 * def __get__(self) -> float: * return self.getTolerances()[0] * def __set__(self, value): # <<<<<<<<<<<<<< * self.setTolerances(rtol=value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.rtol.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":2277 * property atol: * """Absolute residual tolerance.""" * def __get__(self) -> float: # <<<<<<<<<<<<<< * return self.getTolerances()[1] * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_4atol_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_4atol_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_4atol___get__(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_4atol___get__(struct PyPetscSNESObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/SNES.pyx":2278 * """Absolute residual tolerance.""" * def __get__(self) -> float: * return self.getTolerances()[1] # <<<<<<<<<<<<<< * def __set__(self, value): * self.setTolerances(atol=value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getTolerances); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":2277 * property atol: * """Absolute residual tolerance.""" * def __get__(self) -> float: # <<<<<<<<<<<<<< * return self.getTolerances()[1] * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.atol.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":2279 * def __get__(self) -> float: * return self.getTolerances()[1] * def __set__(self, value): # <<<<<<<<<<<<<< * self.setTolerances(atol=value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_4SNES_4atol_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_4SNES_4atol_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_4atol_2__set__(((struct PyPetscSNESObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_4SNES_4atol_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "petsc4py/PETSc/SNES.pyx":2280 * return self.getTolerances()[1] * def __set__(self, value): * self.setTolerances(atol=value) # <<<<<<<<<<<<<< * * property stol: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setTolerances); if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_atol, __pyx_v_value) < 0) __PYX_ERR(50, 2280, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(50, 2280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/SNES.pyx":2279 * def __get__(self) -> float: * return self.getTolerances()[1] * def __set__(self, value): # <<<<<<<<<<<<<< * self.setTolerances(atol=value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.atol.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":2284 * property stol: * """Solution update tolerance.""" * def __get__(self) -> float: # <<<<<<<<<<<<<< * return self.getTolerances()[2] * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_4stol_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_4stol_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_4stol___get__(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_4stol___get__(struct PyPetscSNESObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/SNES.pyx":2285 * """Solution update tolerance.""" * def __get__(self) -> float: * return self.getTolerances()[2] # <<<<<<<<<<<<<< * def __set__(self, value): * self.setTolerances(stol=value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getTolerances); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":2284 * property stol: * """Solution update tolerance.""" * def __get__(self) -> float: # <<<<<<<<<<<<<< * return self.getTolerances()[2] * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.stol.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":2286 * def __get__(self) -> float: * return self.getTolerances()[2] * def __set__(self, value): # <<<<<<<<<<<<<< * self.setTolerances(stol=value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_4SNES_4stol_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_4SNES_4stol_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_4stol_2__set__(((struct PyPetscSNESObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_4SNES_4stol_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "petsc4py/PETSc/SNES.pyx":2287 * return self.getTolerances()[2] * def __set__(self, value): * self.setTolerances(stol=value) # <<<<<<<<<<<<<< * * property max_it: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setTolerances); if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_stol, __pyx_v_value) < 0) __PYX_ERR(50, 2287, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(50, 2287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/SNES.pyx":2286 * def __get__(self) -> float: * return self.getTolerances()[2] * def __set__(self, value): # <<<<<<<<<<<<<< * self.setTolerances(stol=value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.stol.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":2291 * property max_it: * """Maximum number of iterations.""" * def __get__(self) -> int: # <<<<<<<<<<<<<< * return self.getTolerances()[3] * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_6max_it_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_6max_it_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_6max_it___get__(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_6max_it___get__(struct PyPetscSNESObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/SNES.pyx":2292 * """Maximum number of iterations.""" * def __get__(self) -> int: * return self.getTolerances()[3] # <<<<<<<<<<<<<< * def __set__(self, value): * self.setTolerances(max_it=value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getTolerances); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":2291 * property max_it: * """Maximum number of iterations.""" * def __get__(self) -> int: # <<<<<<<<<<<<<< * return self.getTolerances()[3] * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.max_it.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":2293 * def __get__(self) -> int: * return self.getTolerances()[3] * def __set__(self, value): # <<<<<<<<<<<<<< * self.setTolerances(max_it=value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_4SNES_6max_it_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_4SNES_6max_it_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_6max_it_2__set__(((struct PyPetscSNESObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_4SNES_6max_it_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "petsc4py/PETSc/SNES.pyx":2294 * return self.getTolerances()[3] * def __set__(self, value): * self.setTolerances(max_it=value) # <<<<<<<<<<<<<< * * # --- more tolerances --- */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setTolerances); if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_max_it, __pyx_v_value) < 0) __PYX_ERR(50, 2294, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(50, 2294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/SNES.pyx":2293 * def __get__(self) -> int: * return self.getTolerances()[3] * def __set__(self, value): # <<<<<<<<<<<<<< * self.setTolerances(max_it=value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.max_it.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":2300 * property max_funcs: * """Maximum number of function evaluations.""" * def __get__(self) -> int: # <<<<<<<<<<<<<< * return self.getMaxFunctionEvaluations() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_9max_funcs_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_9max_funcs_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_9max_funcs___get__(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_9max_funcs___get__(struct PyPetscSNESObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/SNES.pyx":2301 * """Maximum number of function evaluations.""" * def __get__(self) -> int: * return self.getMaxFunctionEvaluations() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setMaxFunctionEvaluations(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getMaxFunctionEvaluations); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":2300 * property max_funcs: * """Maximum number of function evaluations.""" * def __get__(self) -> int: # <<<<<<<<<<<<<< * return self.getMaxFunctionEvaluations() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.max_funcs.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":2302 * def __get__(self) -> int: * return self.getMaxFunctionEvaluations() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setMaxFunctionEvaluations(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_4SNES_9max_funcs_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_4SNES_9max_funcs_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_9max_funcs_2__set__(((struct PyPetscSNESObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_4SNES_9max_funcs_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "petsc4py/PETSc/SNES.pyx":2303 * return self.getMaxFunctionEvaluations() * def __set__(self, value): * self.setMaxFunctionEvaluations(value) # <<<<<<<<<<<<<< * * # --- iteration --- */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setMaxFunctionEvaluations); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_value}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/SNES.pyx":2302 * def __get__(self) -> int: * return self.getMaxFunctionEvaluations() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setMaxFunctionEvaluations(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.max_funcs.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":2309 * property its: * """Number of iterations.""" * def __get__(self) -> int: # <<<<<<<<<<<<<< * return self.getIterationNumber() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_3its_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_3its_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_3its___get__(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_3its___get__(struct PyPetscSNESObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/SNES.pyx":2310 * """Number of iterations.""" * def __get__(self) -> int: * return self.getIterationNumber() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setIterationNumber(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getIterationNumber); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":2309 * property its: * """Number of iterations.""" * def __get__(self) -> int: # <<<<<<<<<<<<<< * return self.getIterationNumber() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.its.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":2311 * def __get__(self) -> int: * return self.getIterationNumber() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setIterationNumber(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_4SNES_3its_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_4SNES_3its_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_3its_2__set__(((struct PyPetscSNESObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_4SNES_3its_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "petsc4py/PETSc/SNES.pyx":2312 * return self.getIterationNumber() * def __set__(self, value): * self.setIterationNumber(value) # <<<<<<<<<<<<<< * * property norm: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setIterationNumber); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_value}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/SNES.pyx":2311 * def __get__(self) -> int: * return self.getIterationNumber() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setIterationNumber(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.its.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":2316 * property norm: * """Function norm.""" * def __get__(self) -> float: # <<<<<<<<<<<<<< * return self.getFunctionNorm() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_4norm_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_4norm_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_4norm___get__(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_4norm___get__(struct PyPetscSNESObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/SNES.pyx":2317 * """Function norm.""" * def __get__(self) -> float: * return self.getFunctionNorm() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setFunctionNorm(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getFunctionNorm); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":2316 * property norm: * """Function norm.""" * def __get__(self) -> float: # <<<<<<<<<<<<<< * return self.getFunctionNorm() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.norm.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":2318 * def __get__(self) -> float: * return self.getFunctionNorm() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setFunctionNorm(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_4SNES_4norm_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_4SNES_4norm_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_4norm_2__set__(((struct PyPetscSNESObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_4SNES_4norm_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "petsc4py/PETSc/SNES.pyx":2319 * return self.getFunctionNorm() * def __set__(self, value): * self.setFunctionNorm(value) # <<<<<<<<<<<<<< * * property history: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setFunctionNorm); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_value}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/SNES.pyx":2318 * def __get__(self) -> float: * return self.getFunctionNorm() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setFunctionNorm(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.norm.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":2323 * property history: * """Convergence history.""" * def __get__(self) -> tuple[ArrayReal, ArrayInt]: # <<<<<<<<<<<<<< * return self.getConvergenceHistory() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_7history_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_7history_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_7history___get__(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_7history___get__(struct PyPetscSNESObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/SNES.pyx":2324 * """Convergence history.""" * def __get__(self) -> tuple[ArrayReal, ArrayInt]: * return self.getConvergenceHistory() # <<<<<<<<<<<<<< * * # --- convergence --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getConvergenceHistory); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2324, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2324, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":2323 * property history: * """Convergence history.""" * def __get__(self) -> tuple[ArrayReal, ArrayInt]: # <<<<<<<<<<<<<< * return self.getConvergenceHistory() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.history.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":2330 * property reason: * """Converged reason.""" * def __get__(self) -> ConvergedReason: # <<<<<<<<<<<<<< * return self.getConvergedReason() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_6reason_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_6reason_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_6reason___get__(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_6reason___get__(struct PyPetscSNESObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/SNES.pyx":2331 * """Converged reason.""" * def __get__(self) -> ConvergedReason: * return self.getConvergedReason() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setConvergedReason(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getConvergedReason); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":2330 * property reason: * """Converged reason.""" * def __get__(self) -> ConvergedReason: # <<<<<<<<<<<<<< * return self.getConvergedReason() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.reason.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":2332 * def __get__(self) -> ConvergedReason: * return self.getConvergedReason() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setConvergedReason(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_4SNES_6reason_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_4SNES_6reason_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_6reason_2__set__(((struct PyPetscSNESObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_4SNES_6reason_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "petsc4py/PETSc/SNES.pyx":2333 * return self.getConvergedReason() * def __set__(self, value): * self.setConvergedReason(value) # <<<<<<<<<<<<<< * * property is_iterating: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setConvergedReason); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_value}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/SNES.pyx":2332 * def __get__(self) -> ConvergedReason: * return self.getConvergedReason() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setConvergedReason(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.reason.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":2337 * property is_iterating: * """Boolean indicating if the solver has not converged yet.""" * def __get__(self) -> bool: # <<<<<<<<<<<<<< * return self.reason == 0 * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_12is_iterating_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_12is_iterating_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_12is_iterating___get__(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_12is_iterating___get__(struct PyPetscSNESObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/SNES.pyx":2338 * """Boolean indicating if the solver has not converged yet.""" * def __get__(self) -> bool: * return self.reason == 0 # <<<<<<<<<<<<<< * * property is_converged: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reason); if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_t_1, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":2337 * property is_iterating: * """Boolean indicating if the solver has not converged yet.""" * def __get__(self) -> bool: # <<<<<<<<<<<<<< * return self.reason == 0 * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.is_iterating.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":2342 * property is_converged: * """Boolean indicating if the solver has converged.""" * def __get__(self) -> bool: # <<<<<<<<<<<<<< * return self.reason > 0 * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_12is_converged_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_12is_converged_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_12is_converged___get__(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_12is_converged___get__(struct PyPetscSNESObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/SNES.pyx":2343 * """Boolean indicating if the solver has converged.""" * def __get__(self) -> bool: * return self.reason > 0 # <<<<<<<<<<<<<< * * property is_diverged: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reason); if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2343, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":2342 * property is_converged: * """Boolean indicating if the solver has converged.""" * def __get__(self) -> bool: # <<<<<<<<<<<<<< * return self.reason > 0 * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.is_converged.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":2347 * property is_diverged: * """Boolean indicating if the solver has failed.""" * def __get__(self) -> bool: # <<<<<<<<<<<<<< * return self.reason < 0 * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_11is_diverged_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_11is_diverged_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_11is_diverged___get__(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_11is_diverged___get__(struct PyPetscSNESObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/SNES.pyx":2348 * """Boolean indicating if the solver has failed.""" * def __get__(self) -> bool: * return self.reason < 0 # <<<<<<<<<<<<<< * * # --- matrix-free / finite differences --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reason); if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2348, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":2347 * property is_diverged: * """Boolean indicating if the solver has failed.""" * def __get__(self) -> bool: # <<<<<<<<<<<<<< * return self.reason < 0 * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.is_diverged.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":2354 * property use_mf: * """Boolean indicating if the solver uses matrix-free finite-differencing.""" * def __get__(self) -> bool: # <<<<<<<<<<<<<< * return self.getUseMF() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_6use_mf_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_6use_mf_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_6use_mf___get__(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_6use_mf___get__(struct PyPetscSNESObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/SNES.pyx":2355 * """Boolean indicating if the solver uses matrix-free finite-differencing.""" * def __get__(self) -> bool: * return self.getUseMF() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setUseMF(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getUseMF); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":2354 * property use_mf: * """Boolean indicating if the solver uses matrix-free finite-differencing.""" * def __get__(self) -> bool: # <<<<<<<<<<<<<< * return self.getUseMF() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.use_mf.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":2356 * def __get__(self) -> bool: * return self.getUseMF() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setUseMF(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_4SNES_6use_mf_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_4SNES_6use_mf_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_6use_mf_2__set__(((struct PyPetscSNESObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_4SNES_6use_mf_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "petsc4py/PETSc/SNES.pyx":2357 * return self.getUseMF() * def __set__(self, value): * self.setUseMF(value) # <<<<<<<<<<<<<< * * property use_fd: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setUseMF); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_value}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/SNES.pyx":2356 * def __get__(self) -> bool: * return self.getUseMF() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setUseMF(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.use_mf.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":2361 * property use_fd: * """Boolean indicating if the solver uses coloring finite-differencing.""" * def __get__(self) -> bool: # <<<<<<<<<<<<<< * return self.getUseFD() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_6use_fd_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_6use_fd_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_6use_fd___get__(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_6use_fd___get__(struct PyPetscSNESObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/SNES.pyx":2362 * """Boolean indicating if the solver uses coloring finite-differencing.""" * def __get__(self) -> bool: * return self.getUseFD() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setUseFD(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getUseFD); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/SNES.pyx":2361 * property use_fd: * """Boolean indicating if the solver uses coloring finite-differencing.""" * def __get__(self) -> bool: # <<<<<<<<<<<<<< * return self.getUseFD() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.use_fd.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/SNES.pyx":2363 * def __get__(self) -> bool: * return self.getUseFD() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setUseFD(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_4SNES_6use_fd_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_4SNES_6use_fd_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_6use_fd_2__set__(((struct PyPetscSNESObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_4SNES_6use_fd_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "petsc4py/PETSc/SNES.pyx":2364 * return self.getUseFD() * def __set__(self, value): * self.setUseFD(value) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setUseFD); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_value}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/SNES.pyx":2363 * def __get__(self) -> bool: * return self.getUseFD() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setUseFD(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.use_fd.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":152 * # --- xxx --- * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.ts * self.ts = NULL */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_2TS_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_2TS_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS___cinit__(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_2TS___cinit__(struct PyPetscTSObject *__pyx_v_self) { int __pyx_r; /* "petsc4py/PETSc/TS.pyx":153 * * def __cinit__(self): * self.obj = &self.ts # <<<<<<<<<<<<<< * self.ts = NULL * */ __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->ts)); /* "petsc4py/PETSc/TS.pyx":154 * def __cinit__(self): * self.obj = &self.ts * self.ts = NULL # <<<<<<<<<<<<<< * * # --- xxx --- */ __pyx_v_self->ts = NULL; /* "petsc4py/PETSc/TS.pyx":152 * # --- xxx --- * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.ts * self.ts = NULL */ /* function exit code */ __pyx_r = 0; return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":158 * # --- xxx --- * * def view(self, Viewer viewer=None) -> None: # <<<<<<<<<<<<<< * """Print the `TS` object. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_3view(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_2view, "TS.view(self, viewer: Viewer | None = None) -> None\nPrint the `TS` object.\n\n Collective.\n\n Parameters\n ----------\n viewer\n The visualization context.\n\n Notes\n -----\n ``-ts_view`` calls TSView at the end of TSStep\n\n See Also\n --------\n petsc.TSView\n\n \nSource code at petsc4py/PETSc/TS.pyx:158"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_3view(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscViewerObject *__pyx_v_viewer = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("view (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscViewerObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_viewer); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 158, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "view") < 0)) __PYX_ERR(51, 158, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, __pyx_nargs); __PYX_ERR(51, 158, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TS.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(51, 158, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_2view(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_viewer); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_2view(struct PyPetscTSObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer) { PetscViewer __pyx_v_cviewer; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscViewer __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("view", 1); /* "petsc4py/PETSc/TS.pyx":177 * * """ * cdef PetscViewer cviewer = NULL # <<<<<<<<<<<<<< * if viewer is not None: cviewer = viewer.vwr * CHKERR( TSView(self.ts, cviewer) ) */ __pyx_v_cviewer = NULL; /* "petsc4py/PETSc/TS.pyx":178 * """ * cdef PetscViewer cviewer = NULL * if viewer is not None: cviewer = viewer.vwr # <<<<<<<<<<<<<< * CHKERR( TSView(self.ts, cviewer) ) * */ __pyx_t_1 = (((PyObject *)__pyx_v_viewer) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_viewer->vwr; __pyx_v_cviewer = __pyx_t_2; } /* "petsc4py/PETSc/TS.pyx":179 * cdef PetscViewer cviewer = NULL * if viewer is not None: cviewer = viewer.vwr * CHKERR( TSView(self.ts, cviewer) ) # <<<<<<<<<<<<<< * * def load(self, Viewer viewer) -> None: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSView(__pyx_v_self->ts, __pyx_v_cviewer)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 179, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":158 * # --- xxx --- * * def view(self, Viewer viewer=None) -> None: # <<<<<<<<<<<<<< * """Print the `TS` object. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":181 * CHKERR( TSView(self.ts, cviewer) ) * * def load(self, Viewer viewer) -> None: # <<<<<<<<<<<<<< * """Load a `TS` that has been stored in binary with `view`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_5load(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_4load, "TS.load(self, viewer: Viewer) -> None\nLoad a `TS` that has been stored in binary with `view`.\n\n Parameters\n ----------\n viewer\n The visualization context.\n\n See Also\n --------\n petsc.TSLoad\n\n \nSource code at petsc4py/PETSc/TS.pyx:181"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_5load(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscViewerObject *__pyx_v_viewer = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("load (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_viewer)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 181, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "load") < 0)) __PYX_ERR(51, 181, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("load", 1, 1, 1, __pyx_nargs); __PYX_ERR(51, 181, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TS.load", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 0, "viewer", 0))) __PYX_ERR(51, 181, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_4load(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_viewer); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_4load(struct PyPetscTSObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("load", 1); /* "petsc4py/PETSc/TS.pyx":194 * * """ * CHKERR( TSLoad(self.ts, viewer.vwr) ) # <<<<<<<<<<<<<< * * def destroy(self) -> Self: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSLoad(__pyx_v_self->ts, __pyx_v_viewer->vwr)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 194, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":181 * CHKERR( TSView(self.ts, cviewer) ) * * def load(self, Viewer viewer) -> None: # <<<<<<<<<<<<<< * """Load a `TS` that has been stored in binary with `view`. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.load", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":196 * CHKERR( TSLoad(self.ts, viewer.vwr) ) * * def destroy(self) -> Self: # <<<<<<<<<<<<<< * """Destroy the `TS` that was created with `create`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_7destroy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_6destroy, "TS.destroy(self) -> Self\nDestroy the `TS` that was created with `create`.\n\n See Also\n --------\n petsc.TSDestroy\n\n \nSource code at petsc4py/PETSc/TS.pyx:196"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_7destroy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("destroy (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_6destroy(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_6destroy(struct PyPetscTSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("destroy", 1); /* "petsc4py/PETSc/TS.pyx":204 * * """ * CHKERR( TSDestroy(&self.ts) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSDestroy((&__pyx_v_self->ts))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 204, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":205 * """ * CHKERR( TSDestroy(&self.ts) ) * return self # <<<<<<<<<<<<<< * * def create(self, comm: Comm | None = None) -> Self: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/TS.pyx":196 * CHKERR( TSLoad(self.ts, viewer.vwr) ) * * def destroy(self) -> Self: # <<<<<<<<<<<<<< * """Destroy the `TS` that was created with `create`. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":207 * return self * * def create(self, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Create an empty `TS`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_9create(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_8create, "TS.create(self, comm: Comm | None = None) -> Self\nCreate an empty `TS`.\n\n The problem type can then be set with `setProblemType` and the type of\n solver can then be set with `setType`.\n\n Parameters\n ----------\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n petsc.TSCreate\n\n \nSource code at petsc4py/PETSc/TS.pyx:207"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_9create(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 207, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "create") < 0)) __PYX_ERR(51, 207, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_comm = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, __pyx_nargs); __PYX_ERR(51, 207, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TS.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_8create(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_comm); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_8create(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; TS __pyx_v_newts; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create", 1); /* "petsc4py/PETSc/TS.pyx":223 * * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscTS newts = NULL * CHKERR( TSCreate(ccomm, &newts) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(51, 223, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/TS.pyx":224 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscTS newts = NULL # <<<<<<<<<<<<<< * CHKERR( TSCreate(ccomm, &newts) ) * CHKERR( PetscCLEAR(self.obj) ); self.ts = newts */ __pyx_v_newts = NULL; /* "petsc4py/PETSc/TS.pyx":225 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscTS newts = NULL * CHKERR( TSCreate(ccomm, &newts) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.ts = newts * return self */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSCreate(__pyx_v_ccomm, (&__pyx_v_newts))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 225, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":226 * cdef PetscTS newts = NULL * CHKERR( TSCreate(ccomm, &newts) ) * CHKERR( PetscCLEAR(self.obj) ); self.ts = newts # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 226, __pyx_L1_error) __pyx_v_self->ts = __pyx_v_newts; /* "petsc4py/PETSc/TS.pyx":227 * CHKERR( TSCreate(ccomm, &newts) ) * CHKERR( PetscCLEAR(self.obj) ); self.ts = newts * return self # <<<<<<<<<<<<<< * * def clone(self) -> TS: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/TS.pyx":207 * return self * * def create(self, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Create an empty `TS`. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":229 * return self * * def clone(self) -> TS: # <<<<<<<<<<<<<< * """Return a shallow clone of the `TS` object. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_11clone(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_10clone, "TS.clone(self) -> TS\nReturn a shallow clone of the `TS` object.\n\n Collective.\n\n See Also\n --------\n petsc.TSClone\n\n \nSource code at petsc4py/PETSc/TS.pyx:229"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_11clone(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("clone (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("clone", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "clone", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_10clone(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_10clone(struct PyPetscTSObject *__pyx_v_self) { struct PyPetscTSObject *__pyx_v_ts = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("clone", 1); /* "petsc4py/PETSc/TS.pyx":239 * * """ * cdef TS ts = TS() # <<<<<<<<<<<<<< * CHKERR( TSClone(self.ts, &ts.ts) ) * return ts */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_TS)); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ts = ((struct PyPetscTSObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/TS.pyx":240 * """ * cdef TS ts = TS() * CHKERR( TSClone(self.ts, &ts.ts) ) # <<<<<<<<<<<<<< * return ts * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSClone(__pyx_v_self->ts, (&__pyx_v_ts->ts))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 240, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":241 * cdef TS ts = TS() * CHKERR( TSClone(self.ts, &ts.ts) ) * return ts # <<<<<<<<<<<<<< * * def setType(self, ts_type: Type | str) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_ts); __pyx_r = ((PyObject *)__pyx_v_ts); goto __pyx_L0; /* "petsc4py/PETSc/TS.pyx":229 * return self * * def clone(self) -> TS: # <<<<<<<<<<<<<< * """Return a shallow clone of the `TS` object. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TS.clone", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ts); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":243 * return ts * * def setType(self, ts_type: Type | str) -> None: # <<<<<<<<<<<<<< * """Set the method to be used as the `TS` solver. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_13setType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_12setType, "TS.setType(self, ts_type: Type | str) -> None\nSet the method to be used as the `TS` solver.\n\n Parameters\n ----------\n ts_type\n The solver type.\n\n Notes\n -----\n ``-ts_type`` sets the method from the commandline\n\n See Also\n --------\n petsc.TSSetType\n\n \nSource code at petsc4py/PETSc/TS.pyx:243"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_13setType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_ts_type = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ts_type,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ts_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 243, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setType") < 0)) __PYX_ERR(51, 243, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_ts_type = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, __pyx_nargs); __PYX_ERR(51, 243, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TS.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_12setType(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_ts_type); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_12setType(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_ts_type) { TSType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setType", 0); __Pyx_INCREF(__pyx_v_ts_type); /* "petsc4py/PETSc/TS.pyx":260 * * """ * cdef PetscTSType cval = NULL # <<<<<<<<<<<<<< * ts_type = str2bytes(ts_type, &cval) * CHKERR( TSSetType(self.ts, cval) ) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/TS.pyx":261 * """ * cdef PetscTSType cval = NULL * ts_type = str2bytes(ts_type, &cval) # <<<<<<<<<<<<<< * CHKERR( TSSetType(self.ts, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_ts_type, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_ts_type, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/TS.pyx":262 * cdef PetscTSType cval = NULL * ts_type = str2bytes(ts_type, &cval) * CHKERR( TSSetType(self.ts, cval) ) # <<<<<<<<<<<<<< * * def setRKType(self, ts_type: RKType | str) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetType(__pyx_v_self->ts, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 262, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":243 * return ts * * def setType(self, ts_type: Type | str) -> None: # <<<<<<<<<<<<<< * """Set the method to be used as the `TS` solver. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TS.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ts_type); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":264 * CHKERR( TSSetType(self.ts, cval) ) * * def setRKType(self, ts_type: RKType | str) -> None: # <<<<<<<<<<<<<< * """Set the type of the *Runge-Kutta* scheme. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_15setRKType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_14setRKType, "TS.setRKType(self, ts_type: RKType | str) -> None\nSet the type of the *Runge-Kutta* scheme.\n\n Parameters\n ----------\n ts_type\n The type of scheme.\n\n Notes\n -----\n ``-ts_rk_type`` sets scheme type from the commandline.\n\n See Also\n --------\n petsc.TSRKSetType\n\n \nSource code at petsc4py/PETSc/TS.pyx:264"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_15setRKType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_ts_type = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setRKType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ts_type,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ts_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 264, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setRKType") < 0)) __PYX_ERR(51, 264, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_ts_type = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setRKType", 1, 1, 1, __pyx_nargs); __PYX_ERR(51, 264, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TS.setRKType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_14setRKType(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_ts_type); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_14setRKType(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_ts_type) { TSRKType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setRKType", 0); __Pyx_INCREF(__pyx_v_ts_type); /* "petsc4py/PETSc/TS.pyx":281 * * """ * cdef PetscTSRKType cval = NULL # <<<<<<<<<<<<<< * ts_type = str2bytes(ts_type, &cval) * CHKERR( TSRKSetType(self.ts, cval) ) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/TS.pyx":282 * """ * cdef PetscTSRKType cval = NULL * ts_type = str2bytes(ts_type, &cval) # <<<<<<<<<<<<<< * CHKERR( TSRKSetType(self.ts, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_ts_type, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_ts_type, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/TS.pyx":283 * cdef PetscTSRKType cval = NULL * ts_type = str2bytes(ts_type, &cval) * CHKERR( TSRKSetType(self.ts, cval) ) # <<<<<<<<<<<<<< * * def setARKIMEXType(self, ts_type: ARKIMEXType | str) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSRKSetType(__pyx_v_self->ts, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 283, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":264 * CHKERR( TSSetType(self.ts, cval) ) * * def setRKType(self, ts_type: RKType | str) -> None: # <<<<<<<<<<<<<< * """Set the type of the *Runge-Kutta* scheme. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TS.setRKType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ts_type); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":285 * CHKERR( TSRKSetType(self.ts, cval) ) * * def setARKIMEXType(self, ts_type: ARKIMEXType | str) -> None: # <<<<<<<<<<<<<< * """Set the type of `Type.ARKIMEX` scheme. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_17setARKIMEXType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_16setARKIMEXType, "TS.setARKIMEXType(self, ts_type: ARKIMEXType | str) -> None\nSet the type of `Type.ARKIMEX` scheme.\n\n Parameters\n ----------\n ts_type\n The type of `Type.ARKIMEX` scheme.\n\n Notes\n -----\n ``-ts_arkimex_type`` sets scheme type from the commandline.\n\n See Also\n --------\n petsc.TSARKIMEXSetType\n\n \nSource code at petsc4py/PETSc/TS.pyx:285"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_17setARKIMEXType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_ts_type = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setARKIMEXType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ts_type,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ts_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 285, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setARKIMEXType") < 0)) __PYX_ERR(51, 285, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_ts_type = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setARKIMEXType", 1, 1, 1, __pyx_nargs); __PYX_ERR(51, 285, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TS.setARKIMEXType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_16setARKIMEXType(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_ts_type); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_16setARKIMEXType(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_ts_type) { TSARKIMEXType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setARKIMEXType", 0); __Pyx_INCREF(__pyx_v_ts_type); /* "petsc4py/PETSc/TS.pyx":302 * * """ * cdef PetscTSARKIMEXType cval = NULL # <<<<<<<<<<<<<< * ts_type = str2bytes(ts_type, &cval) * CHKERR( TSARKIMEXSetType(self.ts, cval) ) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/TS.pyx":303 * """ * cdef PetscTSARKIMEXType cval = NULL * ts_type = str2bytes(ts_type, &cval) # <<<<<<<<<<<<<< * CHKERR( TSARKIMEXSetType(self.ts, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_ts_type, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_ts_type, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/TS.pyx":304 * cdef PetscTSARKIMEXType cval = NULL * ts_type = str2bytes(ts_type, &cval) * CHKERR( TSARKIMEXSetType(self.ts, cval) ) # <<<<<<<<<<<<<< * * def setARKIMEXFullyImplicit(self, flag: bool) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSARKIMEXSetType(__pyx_v_self->ts, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 304, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":285 * CHKERR( TSRKSetType(self.ts, cval) ) * * def setARKIMEXType(self, ts_type: ARKIMEXType | str) -> None: # <<<<<<<<<<<<<< * """Set the type of `Type.ARKIMEX` scheme. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TS.setARKIMEXType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ts_type); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":306 * CHKERR( TSARKIMEXSetType(self.ts, cval) ) * * def setARKIMEXFullyImplicit(self, flag: bool) -> None: # <<<<<<<<<<<<<< * """Solve both parts of the equation implicitly. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_19setARKIMEXFullyImplicit(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_18setARKIMEXFullyImplicit, "TS.setARKIMEXFullyImplicit(self, flag: bool) -> None\nSolve both parts of the equation implicitly.\n\n Parameters\n ----------\n flag\n Set to True for fully implicit.\n\n See Also\n --------\n petsc.TSARKIMEXSetFullyImplicit\n\n \nSource code at petsc4py/PETSc/TS.pyx:306"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_19setARKIMEXFullyImplicit(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_flag = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setARKIMEXFullyImplicit (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flag)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 306, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setARKIMEXFullyImplicit") < 0)) __PYX_ERR(51, 306, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_flag = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setARKIMEXFullyImplicit", 1, 1, 1, __pyx_nargs); __PYX_ERR(51, 306, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TS.setARKIMEXFullyImplicit", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_18setARKIMEXFullyImplicit(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_flag); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_18setARKIMEXFullyImplicit(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_flag) { PetscBool __pyx_v_bval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setARKIMEXFullyImplicit", 1); /* "petsc4py/PETSc/TS.pyx":319 * * """ * cdef PetscBool bval = asBool(flag) # <<<<<<<<<<<<<< * CHKERR( TSARKIMEXSetFullyImplicit(self.ts, bval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asBool(__pyx_v_flag); if (unlikely(__pyx_t_1 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(51, 319, __pyx_L1_error) __pyx_v_bval = __pyx_t_1; /* "petsc4py/PETSc/TS.pyx":320 * """ * cdef PetscBool bval = asBool(flag) * CHKERR( TSARKIMEXSetFullyImplicit(self.ts, bval) ) # <<<<<<<<<<<<<< * * def getType(self) -> str: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSARKIMEXSetFullyImplicit(__pyx_v_self->ts, __pyx_v_bval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 320, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":306 * CHKERR( TSARKIMEXSetType(self.ts, cval) ) * * def setARKIMEXFullyImplicit(self, flag: bool) -> None: # <<<<<<<<<<<<<< * """Solve both parts of the equation implicitly. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setARKIMEXFullyImplicit", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":322 * CHKERR( TSARKIMEXSetFullyImplicit(self.ts, bval) ) * * def getType(self) -> str: # <<<<<<<<<<<<<< * """Return the `TS` type. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_21getType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_20getType, "TS.getType(self) -> str\nReturn the `TS` type.\n\n See Also\n --------\n petsc.TSGetType\n\n \nSource code at petsc4py/PETSc/TS.pyx:322"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_21getType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getType", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_20getType(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_20getType(struct PyPetscTSObject *__pyx_v_self) { TSType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getType", 1); /* "petsc4py/PETSc/TS.pyx":330 * * """ * cdef PetscTSType cval = NULL # <<<<<<<<<<<<<< * CHKERR( TSGetType(self.ts, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/TS.pyx":331 * """ * cdef PetscTSType cval = NULL * CHKERR( TSGetType(self.ts, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetType(__pyx_v_self->ts, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 331, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":332 * cdef PetscTSType cval = NULL * CHKERR( TSGetType(self.ts, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * def getRKType(self) -> str: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TS.pyx":322 * CHKERR( TSARKIMEXSetFullyImplicit(self.ts, bval) ) * * def getType(self) -> str: # <<<<<<<<<<<<<< * """Return the `TS` type. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TS.getType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":334 * return bytes2str(cval) * * def getRKType(self) -> str: # <<<<<<<<<<<<<< * """Return the `Type.RK` scheme. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_23getRKType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_22getRKType, "TS.getRKType(self) -> str\nReturn the `Type.RK` scheme.\n\n See Also\n --------\n petsc.TSRKGetType\n\n \nSource code at petsc4py/PETSc/TS.pyx:334"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_23getRKType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getRKType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getRKType", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getRKType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_22getRKType(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_22getRKType(struct PyPetscTSObject *__pyx_v_self) { TSRKType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getRKType", 1); /* "petsc4py/PETSc/TS.pyx":342 * * """ * cdef PetscTSRKType cval = NULL # <<<<<<<<<<<<<< * CHKERR( TSRKGetType(self.ts, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/TS.pyx":343 * """ * cdef PetscTSRKType cval = NULL * CHKERR( TSRKGetType(self.ts, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSRKGetType(__pyx_v_self->ts, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 343, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":344 * cdef PetscTSRKType cval = NULL * CHKERR( TSRKGetType(self.ts, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * def getARKIMEXType(self) -> str: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TS.pyx":334 * return bytes2str(cval) * * def getRKType(self) -> str: # <<<<<<<<<<<<<< * """Return the `Type.RK` scheme. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TS.getRKType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":346 * return bytes2str(cval) * * def getARKIMEXType(self) -> str: # <<<<<<<<<<<<<< * """Return the `Type.ARKIMEX` scheme. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_25getARKIMEXType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_24getARKIMEXType, "TS.getARKIMEXType(self) -> str\nReturn the `Type.ARKIMEX` scheme.\n\n See Also\n --------\n petsc.TSARKIMEXGetType\n\n \nSource code at petsc4py/PETSc/TS.pyx:346"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_25getARKIMEXType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getARKIMEXType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getARKIMEXType", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getARKIMEXType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_24getARKIMEXType(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_24getARKIMEXType(struct PyPetscTSObject *__pyx_v_self) { TSARKIMEXType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getARKIMEXType", 1); /* "petsc4py/PETSc/TS.pyx":354 * * """ * cdef PetscTSARKIMEXType cval = NULL # <<<<<<<<<<<<<< * CHKERR( TSARKIMEXGetType(self.ts, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/TS.pyx":355 * """ * cdef PetscTSARKIMEXType cval = NULL * CHKERR( TSARKIMEXGetType(self.ts, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSARKIMEXGetType(__pyx_v_self->ts, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 355, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":356 * cdef PetscTSARKIMEXType cval = NULL * CHKERR( TSARKIMEXGetType(self.ts, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * def setDIRKType(self, ts_type: DIRKType | str) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TS.pyx":346 * return bytes2str(cval) * * def getARKIMEXType(self) -> str: # <<<<<<<<<<<<<< * """Return the `Type.ARKIMEX` scheme. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TS.getARKIMEXType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":358 * return bytes2str(cval) * * def setDIRKType(self, ts_type: DIRKType | str) -> None: # <<<<<<<<<<<<<< * """Set the type of `Type.DIRK` scheme. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_27setDIRKType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_26setDIRKType, "TS.setDIRKType(self, ts_type: DIRKType | str) -> None\nSet the type of `Type.DIRK` scheme.\n\n Parameters\n ----------\n ts_type\n The type of `Type.DIRK` scheme.\n\n Notes\n -----\n ``-ts_dirk_type`` sets scheme type from the commandline.\n\n See Also\n --------\n petsc.TSDIRKSetType\n\n \nSource code at petsc4py/PETSc/TS.pyx:358"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_27setDIRKType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_ts_type = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setDIRKType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ts_type,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ts_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 358, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setDIRKType") < 0)) __PYX_ERR(51, 358, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_ts_type = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setDIRKType", 1, 1, 1, __pyx_nargs); __PYX_ERR(51, 358, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TS.setDIRKType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_26setDIRKType(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_ts_type); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_26setDIRKType(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_ts_type) { TSDIRKType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setDIRKType", 0); __Pyx_INCREF(__pyx_v_ts_type); /* "petsc4py/PETSc/TS.pyx":375 * * """ * cdef PetscTSDIRKType cval = NULL # <<<<<<<<<<<<<< * ts_type = str2bytes(ts_type, &cval) * CHKERR( TSDIRKSetType(self.ts, cval) ) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/TS.pyx":376 * """ * cdef PetscTSDIRKType cval = NULL * ts_type = str2bytes(ts_type, &cval) # <<<<<<<<<<<<<< * CHKERR( TSDIRKSetType(self.ts, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_ts_type, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_ts_type, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/TS.pyx":377 * cdef PetscTSDIRKType cval = NULL * ts_type = str2bytes(ts_type, &cval) * CHKERR( TSDIRKSetType(self.ts, cval) ) # <<<<<<<<<<<<<< * * def getDIRKType(self) -> str: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSDIRKSetType(__pyx_v_self->ts, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 377, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":358 * return bytes2str(cval) * * def setDIRKType(self, ts_type: DIRKType | str) -> None: # <<<<<<<<<<<<<< * """Set the type of `Type.DIRK` scheme. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TS.setDIRKType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ts_type); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":379 * CHKERR( TSDIRKSetType(self.ts, cval) ) * * def getDIRKType(self) -> str: # <<<<<<<<<<<<<< * """Return the `Type.DIRK` scheme. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_29getDIRKType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_28getDIRKType, "TS.getDIRKType(self) -> str\nReturn the `Type.DIRK` scheme.\n\n See Also\n --------\n setDIRKType, petsc.TSDIRKGetType\n\n \nSource code at petsc4py/PETSc/TS.pyx:379"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_29getDIRKType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getDIRKType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getDIRKType", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getDIRKType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_28getDIRKType(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_28getDIRKType(struct PyPetscTSObject *__pyx_v_self) { TSDIRKType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getDIRKType", 1); /* "petsc4py/PETSc/TS.pyx":387 * * """ * cdef PetscTSDIRKType cval = NULL # <<<<<<<<<<<<<< * CHKERR( TSDIRKGetType(self.ts, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/TS.pyx":388 * """ * cdef PetscTSDIRKType cval = NULL * CHKERR( TSDIRKGetType(self.ts, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSDIRKGetType(__pyx_v_self->ts, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 388, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":389 * cdef PetscTSDIRKType cval = NULL * CHKERR( TSDIRKGetType(self.ts, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * def setProblemType(self, ptype: ProblemType) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TS.pyx":379 * CHKERR( TSDIRKSetType(self.ts, cval) ) * * def getDIRKType(self) -> str: # <<<<<<<<<<<<<< * """Return the `Type.DIRK` scheme. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TS.getDIRKType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":391 * return bytes2str(cval) * * def setProblemType(self, ptype: ProblemType) -> None: # <<<<<<<<<<<<<< * """Set the type of problem to be solved. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_31setProblemType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_30setProblemType, "TS.setProblemType(self, ptype: ProblemType) -> None\nSet the type of problem to be solved.\n\n Parameters\n ----------\n ptype\n The type of problem of the forms.\n\n See Also\n --------\n petsc.TSSetProblemType\n\n \nSource code at petsc4py/PETSc/TS.pyx:391"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_31setProblemType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_ptype = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setProblemType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ptype,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ptype)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 391, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setProblemType") < 0)) __PYX_ERR(51, 391, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_ptype = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setProblemType", 1, 1, 1, __pyx_nargs); __PYX_ERR(51, 391, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TS.setProblemType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_30setProblemType(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_ptype); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_30setProblemType(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_ptype) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations TSProblemType __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setProblemType", 1); /* "petsc4py/PETSc/TS.pyx":404 * * """ * CHKERR( TSSetProblemType(self.ts, ptype) ) # <<<<<<<<<<<<<< * * def getProblemType(self) -> ProblemType: */ __pyx_t_1 = ((TSProblemType)__Pyx_PyInt_As_TSProblemType(__pyx_v_ptype)); if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 404, __pyx_L1_error) __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetProblemType(__pyx_v_self->ts, __pyx_t_1)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 404, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":391 * return bytes2str(cval) * * def setProblemType(self, ptype: ProblemType) -> None: # <<<<<<<<<<<<<< * """Set the type of problem to be solved. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setProblemType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":406 * CHKERR( TSSetProblemType(self.ts, ptype) ) * * def getProblemType(self) -> ProblemType: # <<<<<<<<<<<<<< * """Return the type of problem to be solved. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_33getProblemType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_32getProblemType, "TS.getProblemType(self) -> ProblemType\nReturn the type of problem to be solved.\n\n See Also\n --------\n petsc.TSGetProblemType\n\n \nSource code at petsc4py/PETSc/TS.pyx:406"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_33getProblemType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getProblemType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getProblemType", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getProblemType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_32getProblemType(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_32getProblemType(struct PyPetscTSObject *__pyx_v_self) { TSProblemType __pyx_v_ptype; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getProblemType", 1); /* "petsc4py/PETSc/TS.pyx":414 * * """ * cdef PetscTSProblemType ptype = TS_NONLINEAR # <<<<<<<<<<<<<< * CHKERR( TSGetProblemType(self.ts, &ptype) ) * return ptype */ __pyx_v_ptype = TS_NONLINEAR; /* "petsc4py/PETSc/TS.pyx":415 * """ * cdef PetscTSProblemType ptype = TS_NONLINEAR * CHKERR( TSGetProblemType(self.ts, &ptype) ) # <<<<<<<<<<<<<< * return ptype * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetProblemType(__pyx_v_self->ts, (&__pyx_v_ptype))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 415, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":416 * cdef PetscTSProblemType ptype = TS_NONLINEAR * CHKERR( TSGetProblemType(self.ts, &ptype) ) * return ptype # <<<<<<<<<<<<<< * * def setEquationType(self, eqtype: EquationType) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_TSProblemType(__pyx_v_ptype); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TS.pyx":406 * CHKERR( TSSetProblemType(self.ts, ptype) ) * * def getProblemType(self) -> ProblemType: # <<<<<<<<<<<<<< * """Return the type of problem to be solved. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TS.getProblemType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":418 * return ptype * * def setEquationType(self, eqtype: EquationType) -> None: # <<<<<<<<<<<<<< * """Set the type of the equation that `TS` is solving. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_35setEquationType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_34setEquationType, "TS.setEquationType(self, eqtype: EquationType) -> None\nSet the type of the equation that `TS` is solving.\n\n Not collective.\n\n Parameters\n ----------\n eqtype\n The type of equation.\n\n See Also\n --------\n petsc.TSSetEquationType\n\n \nSource code at petsc4py/PETSc/TS.pyx:418"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_35setEquationType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_eqtype = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setEquationType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_eqtype,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_eqtype)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 418, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setEquationType") < 0)) __PYX_ERR(51, 418, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_eqtype = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setEquationType", 1, 1, 1, __pyx_nargs); __PYX_ERR(51, 418, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TS.setEquationType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_34setEquationType(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_eqtype); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_34setEquationType(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_eqtype) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations TSEquationType __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setEquationType", 1); /* "petsc4py/PETSc/TS.pyx":433 * * """ * CHKERR( TSSetEquationType(self.ts, eqtype) ) # <<<<<<<<<<<<<< * * def getEquationType(self) -> EquationType: */ __pyx_t_1 = ((TSEquationType)__Pyx_PyInt_As_TSEquationType(__pyx_v_eqtype)); if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 433, __pyx_L1_error) __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetEquationType(__pyx_v_self->ts, __pyx_t_1)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 433, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":418 * return ptype * * def setEquationType(self, eqtype: EquationType) -> None: # <<<<<<<<<<<<<< * """Set the type of the equation that `TS` is solving. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setEquationType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":435 * CHKERR( TSSetEquationType(self.ts, eqtype) ) * * def getEquationType(self) -> EquationType: # <<<<<<<<<<<<<< * """Get the type of the equation that `TS` is solving. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_37getEquationType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_36getEquationType, "TS.getEquationType(self) -> EquationType\nGet the type of the equation that `TS` is solving.\n\n Not collective.\n\n See Also\n --------\n petsc.TSGetEquationType\n\n \nSource code at petsc4py/PETSc/TS.pyx:435"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_37getEquationType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getEquationType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getEquationType", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getEquationType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_36getEquationType(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_36getEquationType(struct PyPetscTSObject *__pyx_v_self) { TSEquationType __pyx_v_eqtype; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getEquationType", 1); /* "petsc4py/PETSc/TS.pyx":445 * * """ * cdef PetscTSEquationType eqtype = TS_EQ_UNSPECIFIED # <<<<<<<<<<<<<< * CHKERR( TSGetEquationType(self.ts, &eqtype) ) * return eqtype */ __pyx_v_eqtype = TS_EQ_UNSPECIFIED; /* "petsc4py/PETSc/TS.pyx":446 * """ * cdef PetscTSEquationType eqtype = TS_EQ_UNSPECIFIED * CHKERR( TSGetEquationType(self.ts, &eqtype) ) # <<<<<<<<<<<<<< * return eqtype * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetEquationType(__pyx_v_self->ts, (&__pyx_v_eqtype))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 446, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":447 * cdef PetscTSEquationType eqtype = TS_EQ_UNSPECIFIED * CHKERR( TSGetEquationType(self.ts, &eqtype) ) * return eqtype # <<<<<<<<<<<<<< * * def setOptionsPrefix(self, prefix : str) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_TSEquationType(__pyx_v_eqtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 447, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TS.pyx":435 * CHKERR( TSSetEquationType(self.ts, eqtype) ) * * def getEquationType(self) -> EquationType: # <<<<<<<<<<<<<< * """Get the type of the equation that `TS` is solving. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TS.getEquationType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":449 * return eqtype * * def setOptionsPrefix(self, prefix : str) -> None: # <<<<<<<<<<<<<< * """Set the prefix used for all the `TS` options. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_39setOptionsPrefix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_38setOptionsPrefix, "TS.setOptionsPrefix(self, prefix: str) -> None\nSet the prefix used for all the `TS` options.\n\n Logically collective.\n\n Parameters\n ----------\n prefix\n The prefix to prepend to all option names.\n\n Notes\n -----\n A hyphen must not be given at the beginning of the prefix name.\n\n See Also\n --------\n petsc_options, petsc.TSSetOptionsPrefix\n\n \nSource code at petsc4py/PETSc/TS.pyx:449"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_39setOptionsPrefix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_prefix = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setOptionsPrefix (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_prefix,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_prefix)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 449, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setOptionsPrefix") < 0)) __PYX_ERR(51, 449, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_prefix = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setOptionsPrefix", 1, 1, 1, __pyx_nargs); __PYX_ERR(51, 449, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TS.setOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_38setOptionsPrefix(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_prefix); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_38setOptionsPrefix(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_prefix) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setOptionsPrefix", 0); __Pyx_INCREF(__pyx_v_prefix); /* "petsc4py/PETSc/TS.pyx":468 * * """ * cdef const char *cval = NULL # <<<<<<<<<<<<<< * prefix = str2bytes(prefix, &cval) * CHKERR( TSSetOptionsPrefix(self.ts, cval) ) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/TS.pyx":469 * """ * cdef const char *cval = NULL * prefix = str2bytes(prefix, &cval) # <<<<<<<<<<<<<< * CHKERR( TSSetOptionsPrefix(self.ts, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_prefix, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_prefix, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/TS.pyx":470 * cdef const char *cval = NULL * prefix = str2bytes(prefix, &cval) * CHKERR( TSSetOptionsPrefix(self.ts, cval) ) # <<<<<<<<<<<<<< * * def getOptionsPrefix(self) -> str: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetOptionsPrefix(__pyx_v_self->ts, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 470, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":449 * return eqtype * * def setOptionsPrefix(self, prefix : str) -> None: # <<<<<<<<<<<<<< * """Set the prefix used for all the `TS` options. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TS.setOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_prefix); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":472 * CHKERR( TSSetOptionsPrefix(self.ts, cval) ) * * def getOptionsPrefix(self) -> str: # <<<<<<<<<<<<<< * """Return the prefix used for all the `TS` options. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_41getOptionsPrefix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_40getOptionsPrefix, "TS.getOptionsPrefix(self) -> str\nReturn the prefix used for all the `TS` options.\n\n Not collective.\n\n See Also\n --------\n petsc.TSGetOptionsPrefix\n\n \nSource code at petsc4py/PETSc/TS.pyx:472"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_41getOptionsPrefix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getOptionsPrefix (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getOptionsPrefix", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getOptionsPrefix", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_40getOptionsPrefix(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_40getOptionsPrefix(struct PyPetscTSObject *__pyx_v_self) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getOptionsPrefix", 1); /* "petsc4py/PETSc/TS.pyx":482 * * """ * cdef const char *cval = NULL # <<<<<<<<<<<<<< * CHKERR( TSGetOptionsPrefix(self.ts, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/TS.pyx":483 * """ * cdef const char *cval = NULL * CHKERR( TSGetOptionsPrefix(self.ts, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetOptionsPrefix(__pyx_v_self->ts, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 483, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":484 * cdef const char *cval = NULL * CHKERR( TSGetOptionsPrefix(self.ts, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * def appendOptionsPrefix(self, prefix: str) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 484, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TS.pyx":472 * CHKERR( TSSetOptionsPrefix(self.ts, cval) ) * * def getOptionsPrefix(self) -> str: # <<<<<<<<<<<<<< * """Return the prefix used for all the `TS` options. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TS.getOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":486 * return bytes2str(cval) * * def appendOptionsPrefix(self, prefix: str) -> None: # <<<<<<<<<<<<<< * """Append to the prefix used for all the `TS` options. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_43appendOptionsPrefix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_42appendOptionsPrefix, "TS.appendOptionsPrefix(self, prefix: str) -> None\nAppend to the prefix used for all the `TS` options.\n\n Logically collective.\n\n Parameters\n ----------\n prefix\n The prefix to append to the current prefix.\n\n Notes\n -----\n A hyphen must not be given at the beginning of the prefix name.\n\n See Also\n --------\n petsc_options, petsc.TSAppendOptionsPrefix\n\n \nSource code at petsc4py/PETSc/TS.pyx:486"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_43appendOptionsPrefix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_prefix = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("appendOptionsPrefix (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_prefix,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_prefix)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 486, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "appendOptionsPrefix") < 0)) __PYX_ERR(51, 486, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_prefix = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("appendOptionsPrefix", 1, 1, 1, __pyx_nargs); __PYX_ERR(51, 486, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TS.appendOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_42appendOptionsPrefix(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_prefix); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_42appendOptionsPrefix(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_prefix) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("appendOptionsPrefix", 0); __Pyx_INCREF(__pyx_v_prefix); /* "petsc4py/PETSc/TS.pyx":505 * * """ * cdef const char *cval = NULL # <<<<<<<<<<<<<< * prefix = str2bytes(prefix, &cval) * CHKERR( TSAppendOptionsPrefix(self.ts, cval) ) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/TS.pyx":506 * """ * cdef const char *cval = NULL * prefix = str2bytes(prefix, &cval) # <<<<<<<<<<<<<< * CHKERR( TSAppendOptionsPrefix(self.ts, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_prefix, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 506, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_prefix, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/TS.pyx":507 * cdef const char *cval = NULL * prefix = str2bytes(prefix, &cval) * CHKERR( TSAppendOptionsPrefix(self.ts, cval) ) # <<<<<<<<<<<<<< * * def setFromOptions(self) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSAppendOptionsPrefix(__pyx_v_self->ts, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 507, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":486 * return bytes2str(cval) * * def appendOptionsPrefix(self, prefix: str) -> None: # <<<<<<<<<<<<<< * """Append to the prefix used for all the `TS` options. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TS.appendOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_prefix); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":509 * CHKERR( TSAppendOptionsPrefix(self.ts, cval) ) * * def setFromOptions(self) -> None: # <<<<<<<<<<<<<< * """Set various `TS` parameters from user options. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_45setFromOptions(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_44setFromOptions, "TS.setFromOptions(self) -> None\nSet various `TS` parameters from user options.\n\n Collective.\n\n See Also\n --------\n petsc_options, petsc.TSSetFromOptions\n\n \nSource code at petsc4py/PETSc/TS.pyx:509"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_45setFromOptions(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFromOptions (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("setFromOptions", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setFromOptions", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_44setFromOptions(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_44setFromOptions(struct PyPetscTSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFromOptions", 1); /* "petsc4py/PETSc/TS.pyx":519 * * """ * CHKERR( TSSetFromOptions(self.ts) ) # <<<<<<<<<<<<<< * * # --- application context --- */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetFromOptions(__pyx_v_self->ts)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 519, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":509 * CHKERR( TSAppendOptionsPrefix(self.ts, cval) ) * * def setFromOptions(self) -> None: # <<<<<<<<<<<<<< * """Set various `TS` parameters from user options. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setFromOptions", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":523 * # --- application context --- * * def setAppCtx(self, appctx: Any) -> None: # <<<<<<<<<<<<<< * """Set the application context. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_47setAppCtx(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_46setAppCtx, "TS.setAppCtx(self, appctx: Any) -> None\nSet the application context.\n\n Not collective.\n\n Parameters\n ----------\n appctx\n The application context.\n\n \nSource code at petsc4py/PETSc/TS.pyx:523"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_47setAppCtx(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_appctx = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setAppCtx (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_appctx,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_appctx)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 523, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setAppCtx") < 0)) __PYX_ERR(51, 523, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_appctx = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setAppCtx", 1, 1, 1, __pyx_nargs); __PYX_ERR(51, 523, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TS.setAppCtx", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_46setAppCtx(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_appctx); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_46setAppCtx(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_appctx) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setAppCtx", 1); /* "petsc4py/PETSc/TS.pyx":534 * * """ * self.set_attr('__appctx__', appctx) # <<<<<<<<<<<<<< * * def getAppCtx(self) -> Any: */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__appctx__"), __pyx_v_appctx); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 534, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/TS.pyx":523 * # --- application context --- * * def setAppCtx(self, appctx: Any) -> None: # <<<<<<<<<<<<<< * """Set the application context. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TS.setAppCtx", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":536 * self.set_attr('__appctx__', appctx) * * def getAppCtx(self) -> Any: # <<<<<<<<<<<<<< * """Return the application context.""" * return self.get_attr('__appctx__') */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_49getAppCtx(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_48getAppCtx, "TS.getAppCtx(self) -> Any\nReturn the application context.\nSource code at petsc4py/PETSc/TS.pyx:536"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_49getAppCtx(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getAppCtx (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getAppCtx", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getAppCtx", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_48getAppCtx(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_48getAppCtx(struct PyPetscTSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getAppCtx", 1); /* "petsc4py/PETSc/TS.pyx":538 * def getAppCtx(self) -> Any: * """Return the application context.""" * return self.get_attr('__appctx__') # <<<<<<<<<<<<<< * * # --- user RHS Function/Jacobian routines --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__appctx__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TS.pyx":536 * self.set_attr('__appctx__', appctx) * * def getAppCtx(self) -> Any: # <<<<<<<<<<<<<< * """Return the application context.""" * return self.get_attr('__appctx__') */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TS.getAppCtx", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":542 * # --- user RHS Function/Jacobian routines --- * * def setRHSFunction( # <<<<<<<<<<<<<< * self, * function: TSRHSFunction, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_51setRHSFunction(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_50setRHSFunction, "TS.setRHSFunction(self, function: TSRHSFunction, f: Vec | None = None, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nSet the routine for evaluating the function ``G`` in ``U_t = G(t,u)``.\n\n Parameters\n ----------\n function\n The right-hand side function.\n f\n The vector into which the right-hand side is computed.\n args\n Additional positional arguments for ``function``.\n kargs\n Additional keyword arguments for ``function``.\n\n See Also\n --------\n petsc.TSSetRHSFunction\n\n \nSource code at petsc4py/PETSc/TS.pyx:542"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_51setRHSFunction(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_function = 0; struct PyPetscVecObject *__pyx_v_f = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setRHSFunction (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_function,&__pyx_n_s_f,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; /* "petsc4py/PETSc/TS.pyx":545 * self, * function: TSRHSFunction, * Vec f=None, # <<<<<<<<<<<<<< * args : tuple[Any, ...] | None = None, * kargs : dict[str, Any] | None = None) -> None: */ values[1] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscVecObject *)Py_None)); /* "petsc4py/PETSc/TS.pyx":546 * function: TSRHSFunction, * Vec f=None, * args : tuple[Any, ...] | None = None, # <<<<<<<<<<<<<< * kargs : dict[str, Any] | None = None) -> None: * """Set the routine for evaluating the function ``G`` in ``U_t = G(t,u)``. */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/TS.pyx":547 * Vec f=None, * args : tuple[Any, ...] | None = None, * kargs : dict[str, Any] | None = None) -> None: # <<<<<<<<<<<<<< * """Set the routine for evaluating the function ``G`` in ``U_t = G(t,u)``. * */ values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_function)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 542, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_f); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 542, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 542, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 542, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setRHSFunction") < 0)) __PYX_ERR(51, 542, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_function = values[0]; __pyx_v_f = ((struct PyPetscVecObject *)values[1]); __pyx_v_args = values[2]; __pyx_v_kargs = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setRHSFunction", 0, 1, 4, __pyx_nargs); __PYX_ERR(51, 542, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TS.setRHSFunction", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_f), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "f", 0))) __PYX_ERR(51, 545, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_50setRHSFunction(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_function, __pyx_v_f, __pyx_v_args, __pyx_v_kargs); /* "petsc4py/PETSc/TS.pyx":542 * # --- user RHS Function/Jacobian routines --- * * def setRHSFunction( # <<<<<<<<<<<<<< * self, * function: TSRHSFunction, */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_50setRHSFunction(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_function, struct PyPetscVecObject *__pyx_v_f, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { Vec __pyx_v_fvec; PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; Vec __pyx_t_2; PyObject *__pyx_t_3 = NULL; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setRHSFunction", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/TS.pyx":566 * * """ * cdef PetscVec fvec=NULL # <<<<<<<<<<<<<< * if f is not None: fvec = f.vec * if function is not None: */ __pyx_v_fvec = NULL; /* "petsc4py/PETSc/TS.pyx":567 * """ * cdef PetscVec fvec=NULL * if f is not None: fvec = f.vec # <<<<<<<<<<<<<< * if function is not None: * if args is None: args = () */ __pyx_t_1 = (((PyObject *)__pyx_v_f) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_f->vec; __pyx_v_fvec = __pyx_t_2; } /* "petsc4py/PETSc/TS.pyx":568 * cdef PetscVec fvec=NULL * if f is not None: fvec = f.vec * if function is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = (__pyx_v_function != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/TS.pyx":569 * if f is not None: fvec = f.vec * if function is not None: * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (function, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/TS.pyx":570 * if function is not None: * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (function, args, kargs) * self.set_attr('__rhsfunction__', context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); if (__pyx_t_1) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 570, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "petsc4py/PETSc/TS.pyx":571 * if args is None: args = () * if kargs is None: kargs = {} * context = (function, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__rhsfunction__', context) * CHKERR( TSSetRHSFunction(self.ts, fvec, TS_RHSFunction, context) ) */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 571, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_function); __Pyx_GIVEREF(__pyx_v_function); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_function)) __PYX_ERR(51, 571, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args)) __PYX_ERR(51, 571, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs)) __PYX_ERR(51, 571, __pyx_L1_error); __pyx_v_context = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/TS.pyx":572 * if kargs is None: kargs = {} * context = (function, args, kargs) * self.set_attr('__rhsfunction__', context) # <<<<<<<<<<<<<< * CHKERR( TSSetRHSFunction(self.ts, fvec, TS_RHSFunction, context) ) * else: */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__rhsfunction__"), __pyx_v_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/TS.pyx":573 * context = (function, args, kargs) * self.set_attr('__rhsfunction__', context) * CHKERR( TSSetRHSFunction(self.ts, fvec, TS_RHSFunction, context) ) # <<<<<<<<<<<<<< * else: * CHKERR( TSSetRHSFunction(self.ts, fvec, NULL, NULL) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetRHSFunction(__pyx_v_self->ts, __pyx_v_fvec, __pyx_f_8petsc4py_5PETSc_TS_RHSFunction, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 573, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":568 * cdef PetscVec fvec=NULL * if f is not None: fvec = f.vec * if function is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ goto __pyx_L4; } /* "petsc4py/PETSc/TS.pyx":575 * CHKERR( TSSetRHSFunction(self.ts, fvec, TS_RHSFunction, context) ) * else: * CHKERR( TSSetRHSFunction(self.ts, fvec, NULL, NULL) ) # <<<<<<<<<<<<<< * * def setRHSJacobian( */ /*else*/ { __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetRHSFunction(__pyx_v_self->ts, __pyx_v_fvec, NULL, NULL)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 575, __pyx_L1_error) } __pyx_L4:; /* "petsc4py/PETSc/TS.pyx":542 * # --- user RHS Function/Jacobian routines --- * * def setRHSFunction( # <<<<<<<<<<<<<< * self, * function: TSRHSFunction, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.setRHSFunction", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":577 * CHKERR( TSSetRHSFunction(self.ts, fvec, NULL, NULL) ) * * def setRHSJacobian( # <<<<<<<<<<<<<< * self, * jacobian: TSRHSJacobian, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_53setRHSJacobian(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_52setRHSJacobian, "TS.setRHSJacobian(self, jacobian: TSRHSJacobian, J: Mat | None = None, P: Mat | None = None, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nSet the function to compute the Jacobian of ``G`` in ``U_t = G(U,t)``.\n\n Logically collective.\n\n Parameters\n ----------\n jacobian\n The right-hand side function.\n J\n The matrix into which the jacobian is computed.\n P\n The matrix into which the preconditioner is computed.\n args\n Additional positional arguments for ``jacobian``.\n kargs\n Additional keyword arguments for ``jacobian``.\n\n See Also\n --------\n petsc.TSSetRHSJacobian\n\n \nSource code at petsc4py/PETSc/TS.pyx:577"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_53setRHSJacobian(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_jacobian = 0; struct PyPetscMatObject *__pyx_v_J = 0; struct PyPetscMatObject *__pyx_v_P = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setRHSJacobian (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_jacobian,&__pyx_n_s_J,&__pyx_n_s_P,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; /* "petsc4py/PETSc/TS.pyx":580 * self, * jacobian: TSRHSJacobian, * Mat J=None, # <<<<<<<<<<<<<< * Mat P=None, * args : tuple[Any, ...] | None = None, */ values[1] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscMatObject *)Py_None)); /* "petsc4py/PETSc/TS.pyx":581 * jacobian: TSRHSJacobian, * Mat J=None, * Mat P=None, # <<<<<<<<<<<<<< * args : tuple[Any, ...] | None = None, * kargs : dict[str, Any] | None = None) -> None: */ values[2] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscMatObject *)Py_None)); /* "petsc4py/PETSc/TS.pyx":582 * Mat J=None, * Mat P=None, * args : tuple[Any, ...] | None = None, # <<<<<<<<<<<<<< * kargs : dict[str, Any] | None = None) -> None: * """Set the function to compute the Jacobian of ``G`` in ``U_t = G(U,t)``. */ values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/TS.pyx":583 * Mat P=None, * args : tuple[Any, ...] | None = None, * kargs : dict[str, Any] | None = None) -> None: # <<<<<<<<<<<<<< * """Set the function to compute the Jacobian of ``G`` in ``U_t = G(U,t)``. * */ values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_jacobian)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 577, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_J); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 577, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_P); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 577, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 577, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 577, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setRHSJacobian") < 0)) __PYX_ERR(51, 577, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_jacobian = values[0]; __pyx_v_J = ((struct PyPetscMatObject *)values[1]); __pyx_v_P = ((struct PyPetscMatObject *)values[2]); __pyx_v_args = values[3]; __pyx_v_kargs = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setRHSJacobian", 0, 1, 5, __pyx_nargs); __PYX_ERR(51, 577, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TS.setRHSJacobian", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_J), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "J", 0))) __PYX_ERR(51, 580, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_P), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "P", 0))) __PYX_ERR(51, 581, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_52setRHSJacobian(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_jacobian, __pyx_v_J, __pyx_v_P, __pyx_v_args, __pyx_v_kargs); /* "petsc4py/PETSc/TS.pyx":577 * CHKERR( TSSetRHSFunction(self.ts, fvec, NULL, NULL) ) * * def setRHSJacobian( # <<<<<<<<<<<<<< * self, * jacobian: TSRHSJacobian, */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_52setRHSJacobian(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_jacobian, struct PyPetscMatObject *__pyx_v_J, struct PyPetscMatObject *__pyx_v_P, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { Mat __pyx_v_Jmat; Mat __pyx_v_Pmat; PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; Mat __pyx_t_2; PyObject *__pyx_t_3 = NULL; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setRHSJacobian", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/TS.pyx":606 * * """ * cdef PetscMat Jmat=NULL # <<<<<<<<<<<<<< * if J is not None: Jmat = J.mat * cdef PetscMat Pmat=Jmat */ __pyx_v_Jmat = NULL; /* "petsc4py/PETSc/TS.pyx":607 * """ * cdef PetscMat Jmat=NULL * if J is not None: Jmat = J.mat # <<<<<<<<<<<<<< * cdef PetscMat Pmat=Jmat * if P is not None: Pmat = P.mat */ __pyx_t_1 = (((PyObject *)__pyx_v_J) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_J->mat; __pyx_v_Jmat = __pyx_t_2; } /* "petsc4py/PETSc/TS.pyx":608 * cdef PetscMat Jmat=NULL * if J is not None: Jmat = J.mat * cdef PetscMat Pmat=Jmat # <<<<<<<<<<<<<< * if P is not None: Pmat = P.mat * if jacobian is not None: */ __pyx_v_Pmat = __pyx_v_Jmat; /* "petsc4py/PETSc/TS.pyx":609 * if J is not None: Jmat = J.mat * cdef PetscMat Pmat=Jmat * if P is not None: Pmat = P.mat # <<<<<<<<<<<<<< * if jacobian is not None: * if args is None: args = () */ __pyx_t_1 = (((PyObject *)__pyx_v_P) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_P->mat; __pyx_v_Pmat = __pyx_t_2; } /* "petsc4py/PETSc/TS.pyx":610 * cdef PetscMat Pmat=Jmat * if P is not None: Pmat = P.mat * if jacobian is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = (__pyx_v_jacobian != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/TS.pyx":611 * if P is not None: Pmat = P.mat * if jacobian is not None: * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (jacobian, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/TS.pyx":612 * if jacobian is not None: * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (jacobian, args, kargs) * self.set_attr('__rhsjacobian__', context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); if (__pyx_t_1) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 612, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "petsc4py/PETSc/TS.pyx":613 * if args is None: args = () * if kargs is None: kargs = {} * context = (jacobian, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__rhsjacobian__', context) * CHKERR( TSSetRHSJacobian(self.ts, Jmat, Pmat, TS_RHSJacobian, context) ) */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 613, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_jacobian); __Pyx_GIVEREF(__pyx_v_jacobian); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_jacobian)) __PYX_ERR(51, 613, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args)) __PYX_ERR(51, 613, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs)) __PYX_ERR(51, 613, __pyx_L1_error); __pyx_v_context = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/TS.pyx":614 * if kargs is None: kargs = {} * context = (jacobian, args, kargs) * self.set_attr('__rhsjacobian__', context) # <<<<<<<<<<<<<< * CHKERR( TSSetRHSJacobian(self.ts, Jmat, Pmat, TS_RHSJacobian, context) ) * else: */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__rhsjacobian__"), __pyx_v_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/TS.pyx":615 * context = (jacobian, args, kargs) * self.set_attr('__rhsjacobian__', context) * CHKERR( TSSetRHSJacobian(self.ts, Jmat, Pmat, TS_RHSJacobian, context) ) # <<<<<<<<<<<<<< * else: * CHKERR( TSSetRHSJacobian(self.ts, Jmat, Pmat, NULL, NULL) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetRHSJacobian(__pyx_v_self->ts, __pyx_v_Jmat, __pyx_v_Pmat, __pyx_f_8petsc4py_5PETSc_TS_RHSJacobian, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 615, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":610 * cdef PetscMat Pmat=Jmat * if P is not None: Pmat = P.mat * if jacobian is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ goto __pyx_L5; } /* "petsc4py/PETSc/TS.pyx":617 * CHKERR( TSSetRHSJacobian(self.ts, Jmat, Pmat, TS_RHSJacobian, context) ) * else: * CHKERR( TSSetRHSJacobian(self.ts, Jmat, Pmat, NULL, NULL) ) # <<<<<<<<<<<<<< * * def computeRHSFunction(self, t: float, Vec x, Vec f) -> None: */ /*else*/ { __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetRHSJacobian(__pyx_v_self->ts, __pyx_v_Jmat, __pyx_v_Pmat, NULL, NULL)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 617, __pyx_L1_error) } __pyx_L5:; /* "petsc4py/PETSc/TS.pyx":577 * CHKERR( TSSetRHSFunction(self.ts, fvec, NULL, NULL) ) * * def setRHSJacobian( # <<<<<<<<<<<<<< * self, * jacobian: TSRHSJacobian, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.setRHSJacobian", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":619 * CHKERR( TSSetRHSJacobian(self.ts, Jmat, Pmat, NULL, NULL) ) * * def computeRHSFunction(self, t: float, Vec x, Vec f) -> None: # <<<<<<<<<<<<<< * """Evaluate the right-hand side function. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_55computeRHSFunction(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_54computeRHSFunction, "TS.computeRHSFunction(self, t: float, x: Vec, f: Vec) -> None\nEvaluate the right-hand side function.\n\n Parameters\n ----------\n t\n The time at which to evaluate the RHS.\n x\n The state vector.\n f\n The Vec into which the RHS is computed.\n\n See Also\n --------\n petsc.TSComputeRHSFunction\n\n \nSource code at petsc4py/PETSc/TS.pyx:619"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_55computeRHSFunction(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_t = 0; struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_f = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("computeRHSFunction (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_x,&__pyx_n_s_f,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 619, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 619, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("computeRHSFunction", 1, 3, 3, 1); __PYX_ERR(51, 619, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_f)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 619, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("computeRHSFunction", 1, 3, 3, 2); __PYX_ERR(51, 619, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "computeRHSFunction") < 0)) __PYX_ERR(51, 619, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_t = values[0]; __pyx_v_x = ((struct PyPetscVecObject *)values[1]); __pyx_v_f = ((struct PyPetscVecObject *)values[2]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("computeRHSFunction", 1, 3, 3, __pyx_nargs); __PYX_ERR(51, 619, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TS.computeRHSFunction", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(51, 619, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_f), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "f", 0))) __PYX_ERR(51, 619, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_54computeRHSFunction(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_t, __pyx_v_x, __pyx_v_f); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_54computeRHSFunction(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_t, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_f) { PetscReal __pyx_v_time; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("computeRHSFunction", 1); /* "petsc4py/PETSc/TS.pyx":636 * * """ * cdef PetscReal time = asReal(t) # <<<<<<<<<<<<<< * CHKERR( TSComputeRHSFunction(self.ts, time, x.vec, f.vec) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_t); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(51, 636, __pyx_L1_error) __pyx_v_time = __pyx_t_1; /* "petsc4py/PETSc/TS.pyx":637 * """ * cdef PetscReal time = asReal(t) * CHKERR( TSComputeRHSFunction(self.ts, time, x.vec, f.vec) ) # <<<<<<<<<<<<<< * * def computeRHSFunctionLinear(self, t: float, Vec x, Vec f) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSComputeRHSFunction(__pyx_v_self->ts, __pyx_v_time, __pyx_v_x->vec, __pyx_v_f->vec)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 637, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":619 * CHKERR( TSSetRHSJacobian(self.ts, Jmat, Pmat, NULL, NULL) ) * * def computeRHSFunction(self, t: float, Vec x, Vec f) -> None: # <<<<<<<<<<<<<< * """Evaluate the right-hand side function. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.computeRHSFunction", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":639 * CHKERR( TSComputeRHSFunction(self.ts, time, x.vec, f.vec) ) * * def computeRHSFunctionLinear(self, t: float, Vec x, Vec f) -> None: # <<<<<<<<<<<<<< * """Evaluate the right-hand side via the user-provided Jacobian. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_57computeRHSFunctionLinear(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_56computeRHSFunctionLinear, "TS.computeRHSFunctionLinear(self, t: float, x: Vec, f: Vec) -> None\nEvaluate the right-hand side via the user-provided Jacobian.\n\n Parameters\n ----------\n t\n The time at which to evaluate the RHS.\n x\n The state vector.\n f\n The Vec into which the RHS is computed.\n\n See Also\n --------\n petsc.TSComputeRHSFunctionLinear\n\n \nSource code at petsc4py/PETSc/TS.pyx:639"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_57computeRHSFunctionLinear(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_t = 0; struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_f = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("computeRHSFunctionLinear (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_x,&__pyx_n_s_f,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 639, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 639, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("computeRHSFunctionLinear", 1, 3, 3, 1); __PYX_ERR(51, 639, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_f)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 639, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("computeRHSFunctionLinear", 1, 3, 3, 2); __PYX_ERR(51, 639, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "computeRHSFunctionLinear") < 0)) __PYX_ERR(51, 639, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_t = values[0]; __pyx_v_x = ((struct PyPetscVecObject *)values[1]); __pyx_v_f = ((struct PyPetscVecObject *)values[2]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("computeRHSFunctionLinear", 1, 3, 3, __pyx_nargs); __PYX_ERR(51, 639, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TS.computeRHSFunctionLinear", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(51, 639, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_f), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "f", 0))) __PYX_ERR(51, 639, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_56computeRHSFunctionLinear(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_t, __pyx_v_x, __pyx_v_f); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_56computeRHSFunctionLinear(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_t, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_f) { PetscReal __pyx_v_time; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("computeRHSFunctionLinear", 1); /* "petsc4py/PETSc/TS.pyx":656 * * """ * cdef PetscReal time = asReal(t) # <<<<<<<<<<<<<< * CHKERR( TSComputeRHSFunctionLinear(self.ts, time, x.vec, f.vec, NULL) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_t); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(51, 656, __pyx_L1_error) __pyx_v_time = __pyx_t_1; /* "petsc4py/PETSc/TS.pyx":657 * """ * cdef PetscReal time = asReal(t) * CHKERR( TSComputeRHSFunctionLinear(self.ts, time, x.vec, f.vec, NULL) ) # <<<<<<<<<<<<<< * * def computeRHSJacobian(self, t: float, Vec x, Mat J, Mat P=None) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSComputeRHSFunctionLinear(__pyx_v_self->ts, __pyx_v_time, __pyx_v_x->vec, __pyx_v_f->vec, NULL)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 657, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":639 * CHKERR( TSComputeRHSFunction(self.ts, time, x.vec, f.vec) ) * * def computeRHSFunctionLinear(self, t: float, Vec x, Vec f) -> None: # <<<<<<<<<<<<<< * """Evaluate the right-hand side via the user-provided Jacobian. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.computeRHSFunctionLinear", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":659 * CHKERR( TSComputeRHSFunctionLinear(self.ts, time, x.vec, f.vec, NULL) ) * * def computeRHSJacobian(self, t: float, Vec x, Mat J, Mat P=None) -> None: # <<<<<<<<<<<<<< * """Compute the Jacobian matrix that has been set with `setRHSJacobian`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_59computeRHSJacobian(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_58computeRHSJacobian, "TS.computeRHSJacobian(self, t: float, x: Vec, J: Mat, P: Mat | None = None) -> None\nCompute the Jacobian matrix that has been set with `setRHSJacobian`.\n\n Collective.\n\n Parameters\n ----------\n t\n The time at which to evaluate the Jacobian.\n x\n The state vector.\n J\n The matrix into which the Jacobian is computed.\n P\n The optional matrix to use for building a preconditioner matrix.\n\n See Also\n --------\n petsc.TSComputeRHSJacobian\n\n \nSource code at petsc4py/PETSc/TS.pyx:659"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_59computeRHSJacobian(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_t = 0; struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscMatObject *__pyx_v_J = 0; struct PyPetscMatObject *__pyx_v_P = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("computeRHSJacobian (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_x,&__pyx_n_s_J,&__pyx_n_s_P,0}; values[3] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscMatObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 659, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 659, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("computeRHSJacobian", 0, 3, 4, 1); __PYX_ERR(51, 659, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_J)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 659, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("computeRHSJacobian", 0, 3, 4, 2); __PYX_ERR(51, 659, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_P); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 659, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "computeRHSJacobian") < 0)) __PYX_ERR(51, 659, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_t = values[0]; __pyx_v_x = ((struct PyPetscVecObject *)values[1]); __pyx_v_J = ((struct PyPetscMatObject *)values[2]); __pyx_v_P = ((struct PyPetscMatObject *)values[3]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("computeRHSJacobian", 0, 3, 4, __pyx_nargs); __PYX_ERR(51, 659, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TS.computeRHSJacobian", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(51, 659, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_J), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "J", 0))) __PYX_ERR(51, 659, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_P), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "P", 0))) __PYX_ERR(51, 659, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_58computeRHSJacobian(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_t, __pyx_v_x, __pyx_v_J, __pyx_v_P); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_58computeRHSJacobian(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_t, struct PyPetscVecObject *__pyx_v_x, struct PyPetscMatObject *__pyx_v_J, struct PyPetscMatObject *__pyx_v_P) { PetscReal __pyx_v_time; Mat __pyx_v_jmat; Mat __pyx_v_pmat; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; Mat __pyx_t_2; int __pyx_t_3; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("computeRHSJacobian", 1); /* "petsc4py/PETSc/TS.pyx":680 * * """ * cdef PetscReal time = asReal(t) # <<<<<<<<<<<<<< * cdef PetscMat jmat = J.mat, pmat = J.mat * if P is not None: pmat = P.mat */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_t); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(51, 680, __pyx_L1_error) __pyx_v_time = __pyx_t_1; /* "petsc4py/PETSc/TS.pyx":681 * """ * cdef PetscReal time = asReal(t) * cdef PetscMat jmat = J.mat, pmat = J.mat # <<<<<<<<<<<<<< * if P is not None: pmat = P.mat * CHKERR( TSComputeRHSJacobian(self.ts, time, x.vec, jmat, pmat) ) */ __pyx_t_2 = __pyx_v_J->mat; __pyx_v_jmat = __pyx_t_2; __pyx_t_2 = __pyx_v_J->mat; __pyx_v_pmat = __pyx_t_2; /* "petsc4py/PETSc/TS.pyx":682 * cdef PetscReal time = asReal(t) * cdef PetscMat jmat = J.mat, pmat = J.mat * if P is not None: pmat = P.mat # <<<<<<<<<<<<<< * CHKERR( TSComputeRHSJacobian(self.ts, time, x.vec, jmat, pmat) ) * */ __pyx_t_3 = (((PyObject *)__pyx_v_P) != Py_None); if (__pyx_t_3) { __pyx_t_2 = __pyx_v_P->mat; __pyx_v_pmat = __pyx_t_2; } /* "petsc4py/PETSc/TS.pyx":683 * cdef PetscMat jmat = J.mat, pmat = J.mat * if P is not None: pmat = P.mat * CHKERR( TSComputeRHSJacobian(self.ts, time, x.vec, jmat, pmat) ) # <<<<<<<<<<<<<< * * def computeRHSJacobianConstant(self, t: float, Vec x, Mat J, Mat P=None) -> None: */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSComputeRHSJacobian(__pyx_v_self->ts, __pyx_v_time, __pyx_v_x->vec, __pyx_v_jmat, __pyx_v_pmat)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 683, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":659 * CHKERR( TSComputeRHSFunctionLinear(self.ts, time, x.vec, f.vec, NULL) ) * * def computeRHSJacobian(self, t: float, Vec x, Mat J, Mat P=None) -> None: # <<<<<<<<<<<<<< * """Compute the Jacobian matrix that has been set with `setRHSJacobian`. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.computeRHSJacobian", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":685 * CHKERR( TSComputeRHSJacobian(self.ts, time, x.vec, jmat, pmat) ) * * def computeRHSJacobianConstant(self, t: float, Vec x, Mat J, Mat P=None) -> None: # <<<<<<<<<<<<<< * """Reuse a Jacobian that is time-independent. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_61computeRHSJacobianConstant(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_60computeRHSJacobianConstant, "TS.computeRHSJacobianConstant(self, t: float, x: Vec, J: Mat, P: Mat | None = None) -> None\nReuse a Jacobian that is time-independent.\n\n Collective.\n\n Parameters\n ----------\n t\n The time at which to evaluate the Jacobian.\n x\n The state vector.\n J\n A pointer to the stored Jacobian.\n P\n An optional pointer to the preconditioner matrix.\n\n See Also\n --------\n petsc.TSComputeRHSJacobianConstant\n\n \nSource code at petsc4py/PETSc/TS.pyx:685"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_61computeRHSJacobianConstant(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_t = 0; struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscMatObject *__pyx_v_J = 0; struct PyPetscMatObject *__pyx_v_P = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("computeRHSJacobianConstant (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_x,&__pyx_n_s_J,&__pyx_n_s_P,0}; values[3] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscMatObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 685, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 685, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("computeRHSJacobianConstant", 0, 3, 4, 1); __PYX_ERR(51, 685, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_J)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 685, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("computeRHSJacobianConstant", 0, 3, 4, 2); __PYX_ERR(51, 685, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_P); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 685, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "computeRHSJacobianConstant") < 0)) __PYX_ERR(51, 685, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_t = values[0]; __pyx_v_x = ((struct PyPetscVecObject *)values[1]); __pyx_v_J = ((struct PyPetscMatObject *)values[2]); __pyx_v_P = ((struct PyPetscMatObject *)values[3]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("computeRHSJacobianConstant", 0, 3, 4, __pyx_nargs); __PYX_ERR(51, 685, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TS.computeRHSJacobianConstant", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(51, 685, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_J), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "J", 0))) __PYX_ERR(51, 685, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_P), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "P", 0))) __PYX_ERR(51, 685, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_60computeRHSJacobianConstant(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_t, __pyx_v_x, __pyx_v_J, __pyx_v_P); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_60computeRHSJacobianConstant(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_t, struct PyPetscVecObject *__pyx_v_x, struct PyPetscMatObject *__pyx_v_J, struct PyPetscMatObject *__pyx_v_P) { PetscReal __pyx_v_time; Mat __pyx_v_jmat; Mat __pyx_v_pmat; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; Mat __pyx_t_2; int __pyx_t_3; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("computeRHSJacobianConstant", 1); /* "petsc4py/PETSc/TS.pyx":706 * * """ * cdef PetscReal time = asReal(t) # <<<<<<<<<<<<<< * cdef PetscMat jmat = J.mat, pmat = J.mat * if P is not None: pmat = P.mat */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_t); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(51, 706, __pyx_L1_error) __pyx_v_time = __pyx_t_1; /* "petsc4py/PETSc/TS.pyx":707 * """ * cdef PetscReal time = asReal(t) * cdef PetscMat jmat = J.mat, pmat = J.mat # <<<<<<<<<<<<<< * if P is not None: pmat = P.mat * CHKERR( TSComputeRHSJacobianConstant(self.ts, time, x.vec, jmat, pmat, NULL) ) */ __pyx_t_2 = __pyx_v_J->mat; __pyx_v_jmat = __pyx_t_2; __pyx_t_2 = __pyx_v_J->mat; __pyx_v_pmat = __pyx_t_2; /* "petsc4py/PETSc/TS.pyx":708 * cdef PetscReal time = asReal(t) * cdef PetscMat jmat = J.mat, pmat = J.mat * if P is not None: pmat = P.mat # <<<<<<<<<<<<<< * CHKERR( TSComputeRHSJacobianConstant(self.ts, time, x.vec, jmat, pmat, NULL) ) * */ __pyx_t_3 = (((PyObject *)__pyx_v_P) != Py_None); if (__pyx_t_3) { __pyx_t_2 = __pyx_v_P->mat; __pyx_v_pmat = __pyx_t_2; } /* "petsc4py/PETSc/TS.pyx":709 * cdef PetscMat jmat = J.mat, pmat = J.mat * if P is not None: pmat = P.mat * CHKERR( TSComputeRHSJacobianConstant(self.ts, time, x.vec, jmat, pmat, NULL) ) # <<<<<<<<<<<<<< * * def getRHSFunction(self) -> tuple[Vec, TSRHSFunction]: */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSComputeRHSJacobianConstant(__pyx_v_self->ts, __pyx_v_time, __pyx_v_x->vec, __pyx_v_jmat, __pyx_v_pmat, NULL)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 709, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":685 * CHKERR( TSComputeRHSJacobian(self.ts, time, x.vec, jmat, pmat) ) * * def computeRHSJacobianConstant(self, t: float, Vec x, Mat J, Mat P=None) -> None: # <<<<<<<<<<<<<< * """Reuse a Jacobian that is time-independent. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.computeRHSJacobianConstant", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":711 * CHKERR( TSComputeRHSJacobianConstant(self.ts, time, x.vec, jmat, pmat, NULL) ) * * def getRHSFunction(self) -> tuple[Vec, TSRHSFunction]: # <<<<<<<<<<<<<< * """Return the vector where the rhs is stored and the function used to compute it. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_63getRHSFunction(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_62getRHSFunction, "TS.getRHSFunction(self) -> tuple[Vec, TSRHSFunction]\nReturn the vector where the rhs is stored and the function used to compute it.\n\n Not collective.\n\n See Also\n --------\n petsc.TSGetRHSFunction\n\n \nSource code at petsc4py/PETSc/TS.pyx:711"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_63getRHSFunction(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getRHSFunction (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getRHSFunction", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getRHSFunction", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_62getRHSFunction(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_62getRHSFunction(struct PyPetscTSObject *__pyx_v_self) { struct PyPetscVecObject *__pyx_v_f = 0; PyObject *__pyx_v_function = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getRHSFunction", 1); /* "petsc4py/PETSc/TS.pyx":721 * * """ * cdef Vec f = Vec() # <<<<<<<<<<<<<< * CHKERR( TSGetRHSFunction(self.ts, &f.vec, NULL, NULL) ) * CHKERR( PetscINCREF(f.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 721, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_f = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/TS.pyx":722 * """ * cdef Vec f = Vec() * CHKERR( TSGetRHSFunction(self.ts, &f.vec, NULL, NULL) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(f.obj) ) * cdef object function = self.get_attr('__rhsfunction__') */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetRHSFunction(__pyx_v_self->ts, (&__pyx_v_f->vec), NULL, NULL)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 722, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":723 * cdef Vec f = Vec() * CHKERR( TSGetRHSFunction(self.ts, &f.vec, NULL, NULL) ) * CHKERR( PetscINCREF(f.obj) ) # <<<<<<<<<<<<<< * cdef object function = self.get_attr('__rhsfunction__') * return (f, function) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_f->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 723, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":724 * CHKERR( TSGetRHSFunction(self.ts, &f.vec, NULL, NULL) ) * CHKERR( PetscINCREF(f.obj) ) * cdef object function = self.get_attr('__rhsfunction__') # <<<<<<<<<<<<<< * return (f, function) * */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__rhsfunction__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 724, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_function = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/TS.pyx":725 * CHKERR( PetscINCREF(f.obj) ) * cdef object function = self.get_attr('__rhsfunction__') * return (f, function) # <<<<<<<<<<<<<< * * def getRHSJacobian(self) -> tuple[Mat, Mat, TSRHSJacobian]: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 725, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF((PyObject *)__pyx_v_f); __Pyx_GIVEREF((PyObject *)__pyx_v_f); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_f))) __PYX_ERR(51, 725, __pyx_L1_error); __Pyx_INCREF(__pyx_v_function); __Pyx_GIVEREF(__pyx_v_function); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_function)) __PYX_ERR(51, 725, __pyx_L1_error); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TS.pyx":711 * CHKERR( TSComputeRHSJacobianConstant(self.ts, time, x.vec, jmat, pmat, NULL) ) * * def getRHSFunction(self) -> tuple[Vec, TSRHSFunction]: # <<<<<<<<<<<<<< * """Return the vector where the rhs is stored and the function used to compute it. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TS.getRHSFunction", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_f); __Pyx_XDECREF(__pyx_v_function); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":727 * return (f, function) * * def getRHSJacobian(self) -> tuple[Mat, Mat, TSRHSJacobian]: # <<<<<<<<<<<<<< * """Return the Jacobian and the function used to compute them. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_65getRHSJacobian(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_64getRHSJacobian, "TS.getRHSJacobian(self) -> tuple[Mat, Mat, TSRHSJacobian]\nReturn the Jacobian and the function used to compute them.\n\n Not collective.\n\n See Also\n --------\n petsc.TSGetRHSJacobian\n\n \nSource code at petsc4py/PETSc/TS.pyx:727"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_65getRHSJacobian(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getRHSJacobian (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getRHSJacobian", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getRHSJacobian", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_64getRHSJacobian(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_64getRHSJacobian(struct PyPetscTSObject *__pyx_v_self) { struct PyPetscMatObject *__pyx_v_J = 0; struct PyPetscMatObject *__pyx_v_P = 0; PyObject *__pyx_v_jacobian = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getRHSJacobian", 1); /* "petsc4py/PETSc/TS.pyx":737 * * """ * cdef Mat J = Mat(), P = Mat() # <<<<<<<<<<<<<< * CHKERR( TSGetRHSJacobian(self.ts, &J.mat, &P.mat, NULL, NULL) ) * CHKERR( PetscINCREF(J.obj) ); CHKERR( PetscINCREF(P.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 737, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_J = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 737, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_P = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/TS.pyx":738 * """ * cdef Mat J = Mat(), P = Mat() * CHKERR( TSGetRHSJacobian(self.ts, &J.mat, &P.mat, NULL, NULL) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(J.obj) ); CHKERR( PetscINCREF(P.obj) ) * cdef object jacobian = self.get_attr('__rhsjacobian__') */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetRHSJacobian(__pyx_v_self->ts, (&__pyx_v_J->mat), (&__pyx_v_P->mat), NULL, NULL)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 738, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":739 * cdef Mat J = Mat(), P = Mat() * CHKERR( TSGetRHSJacobian(self.ts, &J.mat, &P.mat, NULL, NULL) ) * CHKERR( PetscINCREF(J.obj) ); CHKERR( PetscINCREF(P.obj) ) # <<<<<<<<<<<<<< * cdef object jacobian = self.get_attr('__rhsjacobian__') * return (J, P, jacobian) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_J->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 739, __pyx_L1_error) __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_P->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 739, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":740 * CHKERR( TSGetRHSJacobian(self.ts, &J.mat, &P.mat, NULL, NULL) ) * CHKERR( PetscINCREF(J.obj) ); CHKERR( PetscINCREF(P.obj) ) * cdef object jacobian = self.get_attr('__rhsjacobian__') # <<<<<<<<<<<<<< * return (J, P, jacobian) * */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__rhsjacobian__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 740, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_jacobian = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/TS.pyx":741 * CHKERR( PetscINCREF(J.obj) ); CHKERR( PetscINCREF(P.obj) ) * cdef object jacobian = self.get_attr('__rhsjacobian__') * return (J, P, jacobian) # <<<<<<<<<<<<<< * * # --- user Implicit Function/Jacobian routines --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 741, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF((PyObject *)__pyx_v_J); __Pyx_GIVEREF((PyObject *)__pyx_v_J); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_J))) __PYX_ERR(51, 741, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_P); __Pyx_GIVEREF((PyObject *)__pyx_v_P); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_P))) __PYX_ERR(51, 741, __pyx_L1_error); __Pyx_INCREF(__pyx_v_jacobian); __Pyx_GIVEREF(__pyx_v_jacobian); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_jacobian)) __PYX_ERR(51, 741, __pyx_L1_error); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TS.pyx":727 * return (f, function) * * def getRHSJacobian(self) -> tuple[Mat, Mat, TSRHSJacobian]: # <<<<<<<<<<<<<< * """Return the Jacobian and the function used to compute them. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TS.getRHSJacobian", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_J); __Pyx_XDECREF((PyObject *)__pyx_v_P); __Pyx_XDECREF(__pyx_v_jacobian); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":745 * # --- user Implicit Function/Jacobian routines --- * * def setIFunction( # <<<<<<<<<<<<<< * self, * function: TSIFunction, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_67setIFunction(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_66setIFunction, "TS.setIFunction(self, function: TSIFunction, f: Vec | None = None, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nSet the function representing the DAE to be solved.\n\n Logically collective.\n\n Parameters\n ----------\n function\n The right-hand side function.\n f\n The vector to store values or `None` to be created internally.\n args\n Additional positional arguments for ``function``.\n kargs\n Additional keyword arguments for ``function``.\n\n See Also\n --------\n petsc.TSSetIFunction\n\n \nSource code at petsc4py/PETSc/TS.pyx:745"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_67setIFunction(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_function = 0; struct PyPetscVecObject *__pyx_v_f = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setIFunction (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_function,&__pyx_n_s_f,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; /* "petsc4py/PETSc/TS.pyx":748 * self, * function: TSIFunction, * Vec f=None, # <<<<<<<<<<<<<< * args : tuple[Any, ...] | None = None, * kargs : dict[str, Any] | None = None) -> None: */ values[1] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscVecObject *)Py_None)); /* "petsc4py/PETSc/TS.pyx":749 * function: TSIFunction, * Vec f=None, * args : tuple[Any, ...] | None = None, # <<<<<<<<<<<<<< * kargs : dict[str, Any] | None = None) -> None: * """Set the function representing the DAE to be solved. */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/TS.pyx":750 * Vec f=None, * args : tuple[Any, ...] | None = None, * kargs : dict[str, Any] | None = None) -> None: # <<<<<<<<<<<<<< * """Set the function representing the DAE to be solved. * */ values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_function)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 745, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_f); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 745, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 745, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 745, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setIFunction") < 0)) __PYX_ERR(51, 745, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_function = values[0]; __pyx_v_f = ((struct PyPetscVecObject *)values[1]); __pyx_v_args = values[2]; __pyx_v_kargs = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setIFunction", 0, 1, 4, __pyx_nargs); __PYX_ERR(51, 745, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TS.setIFunction", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_f), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "f", 0))) __PYX_ERR(51, 748, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_66setIFunction(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_function, __pyx_v_f, __pyx_v_args, __pyx_v_kargs); /* "petsc4py/PETSc/TS.pyx":745 * # --- user Implicit Function/Jacobian routines --- * * def setIFunction( # <<<<<<<<<<<<<< * self, * function: TSIFunction, */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_66setIFunction(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_function, struct PyPetscVecObject *__pyx_v_f, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { Vec __pyx_v_fvec; PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; Vec __pyx_t_2; PyObject *__pyx_t_3 = NULL; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setIFunction", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/TS.pyx":771 * * """ * cdef PetscVec fvec=NULL # <<<<<<<<<<<<<< * if f is not None: fvec = f.vec * if function is not None: */ __pyx_v_fvec = NULL; /* "petsc4py/PETSc/TS.pyx":772 * """ * cdef PetscVec fvec=NULL * if f is not None: fvec = f.vec # <<<<<<<<<<<<<< * if function is not None: * if args is None: args = () */ __pyx_t_1 = (((PyObject *)__pyx_v_f) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_f->vec; __pyx_v_fvec = __pyx_t_2; } /* "petsc4py/PETSc/TS.pyx":773 * cdef PetscVec fvec=NULL * if f is not None: fvec = f.vec * if function is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = (__pyx_v_function != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/TS.pyx":774 * if f is not None: fvec = f.vec * if function is not None: * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (function, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/TS.pyx":775 * if function is not None: * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (function, args, kargs) * self.set_attr('__ifunction__', context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); if (__pyx_t_1) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 775, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "petsc4py/PETSc/TS.pyx":776 * if args is None: args = () * if kargs is None: kargs = {} * context = (function, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__ifunction__', context) * CHKERR( TSSetIFunction(self.ts, fvec, TS_IFunction, context) ) */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 776, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_function); __Pyx_GIVEREF(__pyx_v_function); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_function)) __PYX_ERR(51, 776, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args)) __PYX_ERR(51, 776, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs)) __PYX_ERR(51, 776, __pyx_L1_error); __pyx_v_context = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/TS.pyx":777 * if kargs is None: kargs = {} * context = (function, args, kargs) * self.set_attr('__ifunction__', context) # <<<<<<<<<<<<<< * CHKERR( TSSetIFunction(self.ts, fvec, TS_IFunction, context) ) * else: */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__ifunction__"), __pyx_v_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 777, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/TS.pyx":778 * context = (function, args, kargs) * self.set_attr('__ifunction__', context) * CHKERR( TSSetIFunction(self.ts, fvec, TS_IFunction, context) ) # <<<<<<<<<<<<<< * else: * CHKERR( TSSetIFunction(self.ts, fvec, NULL, NULL) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetIFunction(__pyx_v_self->ts, __pyx_v_fvec, __pyx_f_8petsc4py_5PETSc_TS_IFunction, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 778, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":773 * cdef PetscVec fvec=NULL * if f is not None: fvec = f.vec * if function is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ goto __pyx_L4; } /* "petsc4py/PETSc/TS.pyx":780 * CHKERR( TSSetIFunction(self.ts, fvec, TS_IFunction, context) ) * else: * CHKERR( TSSetIFunction(self.ts, fvec, NULL, NULL) ) # <<<<<<<<<<<<<< * * def setIJacobian( */ /*else*/ { __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetIFunction(__pyx_v_self->ts, __pyx_v_fvec, NULL, NULL)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 780, __pyx_L1_error) } __pyx_L4:; /* "petsc4py/PETSc/TS.pyx":745 * # --- user Implicit Function/Jacobian routines --- * * def setIFunction( # <<<<<<<<<<<<<< * self, * function: TSIFunction, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.setIFunction", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":782 * CHKERR( TSSetIFunction(self.ts, fvec, NULL, NULL) ) * * def setIJacobian( # <<<<<<<<<<<<<< * self, * jacobian: TSIJacobian, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_69setIJacobian(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_68setIJacobian, "TS.setIJacobian(self, jacobian: TSIJacobian, J: Mat | None = None, P: Mat | None = None, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nSet the function to compute the Jacobian.\n\n Logically collective.\n\n Set the function to compute the matrix ``dF/dU + a*dF/dU_t`` where\n ``F(t,U,U_t)`` is the function provided with `setIFunction`.\n\n Parameters\n ----------\n jacobian\n The function which computes the Jacobian.\n J\n The matrix into which the Jacobian is computed.\n P\n The optional matrix to use for building a preconditioner matrix.\n args\n Additional positional arguments for ``jacobian``.\n kargs\n Additional keyword arguments for ``jacobian``.\n\n See Also\n --------\n petsc.TSSetIJacobian\n\n \nSource code at petsc4py/PETSc/TS.pyx:782"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_69setIJacobian(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_jacobian = 0; struct PyPetscMatObject *__pyx_v_J = 0; struct PyPetscMatObject *__pyx_v_P = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setIJacobian (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_jacobian,&__pyx_n_s_J,&__pyx_n_s_P,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; /* "petsc4py/PETSc/TS.pyx":785 * self, * jacobian: TSIJacobian, * Mat J=None, # <<<<<<<<<<<<<< * Mat P=None, * args : tuple[Any, ...] | None = None, */ values[1] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscMatObject *)Py_None)); /* "petsc4py/PETSc/TS.pyx":786 * jacobian: TSIJacobian, * Mat J=None, * Mat P=None, # <<<<<<<<<<<<<< * args : tuple[Any, ...] | None = None, * kargs : dict[str, Any] | None = None) -> None: */ values[2] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscMatObject *)Py_None)); /* "petsc4py/PETSc/TS.pyx":787 * Mat J=None, * Mat P=None, * args : tuple[Any, ...] | None = None, # <<<<<<<<<<<<<< * kargs : dict[str, Any] | None = None) -> None: * """Set the function to compute the Jacobian. */ values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/TS.pyx":788 * Mat P=None, * args : tuple[Any, ...] | None = None, * kargs : dict[str, Any] | None = None) -> None: # <<<<<<<<<<<<<< * """Set the function to compute the Jacobian. * */ values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_jacobian)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 782, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_J); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 782, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_P); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 782, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 782, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 782, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setIJacobian") < 0)) __PYX_ERR(51, 782, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_jacobian = values[0]; __pyx_v_J = ((struct PyPetscMatObject *)values[1]); __pyx_v_P = ((struct PyPetscMatObject *)values[2]); __pyx_v_args = values[3]; __pyx_v_kargs = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setIJacobian", 0, 1, 5, __pyx_nargs); __PYX_ERR(51, 782, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TS.setIJacobian", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_J), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "J", 0))) __PYX_ERR(51, 785, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_P), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "P", 0))) __PYX_ERR(51, 786, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_68setIJacobian(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_jacobian, __pyx_v_J, __pyx_v_P, __pyx_v_args, __pyx_v_kargs); /* "petsc4py/PETSc/TS.pyx":782 * CHKERR( TSSetIFunction(self.ts, fvec, NULL, NULL) ) * * def setIJacobian( # <<<<<<<<<<<<<< * self, * jacobian: TSIJacobian, */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_68setIJacobian(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_jacobian, struct PyPetscMatObject *__pyx_v_J, struct PyPetscMatObject *__pyx_v_P, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { Mat __pyx_v_Jmat; Mat __pyx_v_Pmat; PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; Mat __pyx_t_2; PyObject *__pyx_t_3 = NULL; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setIJacobian", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/TS.pyx":814 * * """ * cdef PetscMat Jmat=NULL # <<<<<<<<<<<<<< * if J is not None: Jmat = J.mat * cdef PetscMat Pmat=Jmat */ __pyx_v_Jmat = NULL; /* "petsc4py/PETSc/TS.pyx":815 * """ * cdef PetscMat Jmat=NULL * if J is not None: Jmat = J.mat # <<<<<<<<<<<<<< * cdef PetscMat Pmat=Jmat * if P is not None: Pmat = P.mat */ __pyx_t_1 = (((PyObject *)__pyx_v_J) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_J->mat; __pyx_v_Jmat = __pyx_t_2; } /* "petsc4py/PETSc/TS.pyx":816 * cdef PetscMat Jmat=NULL * if J is not None: Jmat = J.mat * cdef PetscMat Pmat=Jmat # <<<<<<<<<<<<<< * if P is not None: Pmat = P.mat * if jacobian is not None: */ __pyx_v_Pmat = __pyx_v_Jmat; /* "petsc4py/PETSc/TS.pyx":817 * if J is not None: Jmat = J.mat * cdef PetscMat Pmat=Jmat * if P is not None: Pmat = P.mat # <<<<<<<<<<<<<< * if jacobian is not None: * if args is None: args = () */ __pyx_t_1 = (((PyObject *)__pyx_v_P) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_P->mat; __pyx_v_Pmat = __pyx_t_2; } /* "petsc4py/PETSc/TS.pyx":818 * cdef PetscMat Pmat=Jmat * if P is not None: Pmat = P.mat * if jacobian is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = (__pyx_v_jacobian != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/TS.pyx":819 * if P is not None: Pmat = P.mat * if jacobian is not None: * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (jacobian, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/TS.pyx":820 * if jacobian is not None: * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (jacobian, args, kargs) * self.set_attr('__ijacobian__', context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); if (__pyx_t_1) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 820, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "petsc4py/PETSc/TS.pyx":821 * if args is None: args = () * if kargs is None: kargs = {} * context = (jacobian, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__ijacobian__', context) * CHKERR( TSSetIJacobian(self.ts, Jmat, Pmat, TS_IJacobian, context) ) */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 821, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_jacobian); __Pyx_GIVEREF(__pyx_v_jacobian); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_jacobian)) __PYX_ERR(51, 821, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args)) __PYX_ERR(51, 821, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs)) __PYX_ERR(51, 821, __pyx_L1_error); __pyx_v_context = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/TS.pyx":822 * if kargs is None: kargs = {} * context = (jacobian, args, kargs) * self.set_attr('__ijacobian__', context) # <<<<<<<<<<<<<< * CHKERR( TSSetIJacobian(self.ts, Jmat, Pmat, TS_IJacobian, context) ) * else: */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__ijacobian__"), __pyx_v_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 822, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/TS.pyx":823 * context = (jacobian, args, kargs) * self.set_attr('__ijacobian__', context) * CHKERR( TSSetIJacobian(self.ts, Jmat, Pmat, TS_IJacobian, context) ) # <<<<<<<<<<<<<< * else: * CHKERR( TSSetIJacobian(self.ts, Jmat, Pmat, NULL, NULL) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetIJacobian(__pyx_v_self->ts, __pyx_v_Jmat, __pyx_v_Pmat, __pyx_f_8petsc4py_5PETSc_TS_IJacobian, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 823, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":818 * cdef PetscMat Pmat=Jmat * if P is not None: Pmat = P.mat * if jacobian is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ goto __pyx_L5; } /* "petsc4py/PETSc/TS.pyx":825 * CHKERR( TSSetIJacobian(self.ts, Jmat, Pmat, TS_IJacobian, context) ) * else: * CHKERR( TSSetIJacobian(self.ts, Jmat, Pmat, NULL, NULL) ) # <<<<<<<<<<<<<< * * def setIJacobianP( */ /*else*/ { __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetIJacobian(__pyx_v_self->ts, __pyx_v_Jmat, __pyx_v_Pmat, NULL, NULL)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 825, __pyx_L1_error) } __pyx_L5:; /* "petsc4py/PETSc/TS.pyx":782 * CHKERR( TSSetIFunction(self.ts, fvec, NULL, NULL) ) * * def setIJacobian( # <<<<<<<<<<<<<< * self, * jacobian: TSIJacobian, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.setIJacobian", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":827 * CHKERR( TSSetIJacobian(self.ts, Jmat, Pmat, NULL, NULL) ) * * def setIJacobianP( # <<<<<<<<<<<<<< * self, * jacobian, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_71setIJacobianP(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_70setIJacobianP, "TS.setIJacobianP(self, jacobian, J: Mat | None = None, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nSet the function that computes the Jacobian.\n\n Logically collective.\n\n Set the function that computes the Jacobian of ``F`` with respect to\n the parameters ``P`` where ``F(Udot,U,t) = G(U,P,t)``, as well as the\n location to store the matrix.\n\n Parameters\n ----------\n jacobian\n The function which computes the Jacobian.\n J\n The matrix into which the Jacobian is computed.\n args\n Additional positional arguments for ``jacobian``.\n kargs\n Additional keyword arguments for ``jacobian``.\n\n See Also\n --------\n petsc.TSSetIJacobianP\n\n \nSource code at petsc4py/PETSc/TS.pyx:827"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_71setIJacobianP(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_jacobian = 0; struct PyPetscMatObject *__pyx_v_J = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setIJacobianP (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_jacobian,&__pyx_n_s_J,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; /* "petsc4py/PETSc/TS.pyx":830 * self, * jacobian, * Mat J=None, # <<<<<<<<<<<<<< * args : tuple[Any, ...] | None = None, * kargs : dict[str, Any] | None = None) -> None: */ values[1] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscMatObject *)Py_None)); /* "petsc4py/PETSc/TS.pyx":831 * jacobian, * Mat J=None, * args : tuple[Any, ...] | None = None, # <<<<<<<<<<<<<< * kargs : dict[str, Any] | None = None) -> None: * """Set the function that computes the Jacobian. */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/TS.pyx":832 * Mat J=None, * args : tuple[Any, ...] | None = None, * kargs : dict[str, Any] | None = None) -> None: # <<<<<<<<<<<<<< * """Set the function that computes the Jacobian. * */ values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_jacobian)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 827, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_J); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 827, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 827, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 827, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setIJacobianP") < 0)) __PYX_ERR(51, 827, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_jacobian = values[0]; __pyx_v_J = ((struct PyPetscMatObject *)values[1]); __pyx_v_args = values[2]; __pyx_v_kargs = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setIJacobianP", 0, 1, 4, __pyx_nargs); __PYX_ERR(51, 827, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TS.setIJacobianP", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_J), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "J", 0))) __PYX_ERR(51, 830, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_70setIJacobianP(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_jacobian, __pyx_v_J, __pyx_v_args, __pyx_v_kargs); /* "petsc4py/PETSc/TS.pyx":827 * CHKERR( TSSetIJacobian(self.ts, Jmat, Pmat, NULL, NULL) ) * * def setIJacobianP( # <<<<<<<<<<<<<< * self, * jacobian, */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_70setIJacobianP(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_jacobian, struct PyPetscMatObject *__pyx_v_J, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { Mat __pyx_v_Jmat; PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; Mat __pyx_t_2; PyObject *__pyx_t_3 = NULL; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setIJacobianP", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/TS.pyx":857 * * """ * cdef PetscMat Jmat=NULL # <<<<<<<<<<<<<< * if J is not None: Jmat = J.mat * if jacobian is not None: */ __pyx_v_Jmat = NULL; /* "petsc4py/PETSc/TS.pyx":858 * """ * cdef PetscMat Jmat=NULL * if J is not None: Jmat = J.mat # <<<<<<<<<<<<<< * if jacobian is not None: * if args is None: args = () */ __pyx_t_1 = (((PyObject *)__pyx_v_J) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_J->mat; __pyx_v_Jmat = __pyx_t_2; } /* "petsc4py/PETSc/TS.pyx":859 * cdef PetscMat Jmat=NULL * if J is not None: Jmat = J.mat * if jacobian is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = (__pyx_v_jacobian != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/TS.pyx":860 * if J is not None: Jmat = J.mat * if jacobian is not None: * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (jacobian, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/TS.pyx":861 * if jacobian is not None: * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (jacobian, args, kargs) * self.set_attr('__ijacobianp__', context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); if (__pyx_t_1) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 861, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "petsc4py/PETSc/TS.pyx":862 * if args is None: args = () * if kargs is None: kargs = {} * context = (jacobian, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__ijacobianp__', context) * CHKERR( TSSetIJacobianP(self.ts, Jmat, TS_IJacobianP, context) ) */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 862, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_jacobian); __Pyx_GIVEREF(__pyx_v_jacobian); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_jacobian)) __PYX_ERR(51, 862, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args)) __PYX_ERR(51, 862, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs)) __PYX_ERR(51, 862, __pyx_L1_error); __pyx_v_context = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/TS.pyx":863 * if kargs is None: kargs = {} * context = (jacobian, args, kargs) * self.set_attr('__ijacobianp__', context) # <<<<<<<<<<<<<< * CHKERR( TSSetIJacobianP(self.ts, Jmat, TS_IJacobianP, context) ) * else: */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__ijacobianp__"), __pyx_v_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 863, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/TS.pyx":864 * context = (jacobian, args, kargs) * self.set_attr('__ijacobianp__', context) * CHKERR( TSSetIJacobianP(self.ts, Jmat, TS_IJacobianP, context) ) # <<<<<<<<<<<<<< * else: * CHKERR( TSSetIJacobianP(self.ts, Jmat, NULL, NULL) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetIJacobianP(__pyx_v_self->ts, __pyx_v_Jmat, __pyx_f_8petsc4py_5PETSc_TS_IJacobianP, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 864, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":859 * cdef PetscMat Jmat=NULL * if J is not None: Jmat = J.mat * if jacobian is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ goto __pyx_L4; } /* "petsc4py/PETSc/TS.pyx":866 * CHKERR( TSSetIJacobianP(self.ts, Jmat, TS_IJacobianP, context) ) * else: * CHKERR( TSSetIJacobianP(self.ts, Jmat, NULL, NULL) ) # <<<<<<<<<<<<<< * * def computeIFunction(self, */ /*else*/ { __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetIJacobianP(__pyx_v_self->ts, __pyx_v_Jmat, NULL, NULL)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 866, __pyx_L1_error) } __pyx_L4:; /* "petsc4py/PETSc/TS.pyx":827 * CHKERR( TSSetIJacobian(self.ts, Jmat, Pmat, NULL, NULL) ) * * def setIJacobianP( # <<<<<<<<<<<<<< * self, * jacobian, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.setIJacobianP", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":868 * CHKERR( TSSetIJacobianP(self.ts, Jmat, NULL, NULL) ) * * def computeIFunction(self, # <<<<<<<<<<<<<< * t: float, Vec x, Vec xdot, * Vec f, imex: bool=False) -> None: */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_73computeIFunction(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_72computeIFunction, "TS.computeIFunction(self, t: float, x: Vec, xdot: Vec, f: Vec, imex: bool = False) -> None\nEvaluate the DAE residual written in implicit form.\n\n Collective.\n\n Parameters\n ----------\n t\n The current time.\n x\n The state vector.\n xdot\n The time derivative of the state vector.\n f\n The vector into which the residual is stored.\n imex\n A flag which indicates if the RHS should be kept separate.\n\n See Also\n --------\n petsc.TSComputeIFunction\n\n \nSource code at petsc4py/PETSc/TS.pyx:868"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_73computeIFunction(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_t = 0; struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_xdot = 0; struct PyPetscVecObject *__pyx_v_f = 0; PyObject *__pyx_v_imex = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("computeIFunction (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_x,&__pyx_n_s_xdot,&__pyx_n_s_f,&__pyx_n_s_imex,0}; /* "petsc4py/PETSc/TS.pyx":870 * def computeIFunction(self, * t: float, Vec x, Vec xdot, * Vec f, imex: bool=False) -> None: # <<<<<<<<<<<<<< * """Evaluate the DAE residual written in implicit form. * */ values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 868, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 868, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("computeIFunction", 0, 4, 5, 1); __PYX_ERR(51, 868, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_xdot)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 868, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("computeIFunction", 0, 4, 5, 2); __PYX_ERR(51, 868, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_f)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 868, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("computeIFunction", 0, 4, 5, 3); __PYX_ERR(51, 868, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_imex); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 868, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "computeIFunction") < 0)) __PYX_ERR(51, 868, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_t = values[0]; __pyx_v_x = ((struct PyPetscVecObject *)values[1]); __pyx_v_xdot = ((struct PyPetscVecObject *)values[2]); __pyx_v_f = ((struct PyPetscVecObject *)values[3]); __pyx_v_imex = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("computeIFunction", 0, 4, 5, __pyx_nargs); __PYX_ERR(51, 868, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TS.computeIFunction", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(51, 869, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xdot), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "xdot", 0))) __PYX_ERR(51, 869, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_f), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "f", 0))) __PYX_ERR(51, 870, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_72computeIFunction(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_t, __pyx_v_x, __pyx_v_xdot, __pyx_v_f, __pyx_v_imex); /* "petsc4py/PETSc/TS.pyx":868 * CHKERR( TSSetIJacobianP(self.ts, Jmat, NULL, NULL) ) * * def computeIFunction(self, # <<<<<<<<<<<<<< * t: float, Vec x, Vec xdot, * Vec f, imex: bool=False) -> None: */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_72computeIFunction(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_t, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_xdot, struct PyPetscVecObject *__pyx_v_f, PyObject *__pyx_v_imex) { PetscReal __pyx_v_rval; PetscBool __pyx_v_bval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; PetscBool __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("computeIFunction", 1); /* "petsc4py/PETSc/TS.pyx":893 * * """ * cdef PetscReal rval = asReal(t) # <<<<<<<<<<<<<< * cdef PetscBool bval = imex * CHKERR( TSComputeIFunction(self.ts, rval, x.vec, xdot.vec, */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_t); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(51, 893, __pyx_L1_error) __pyx_v_rval = __pyx_t_1; /* "petsc4py/PETSc/TS.pyx":894 * """ * cdef PetscReal rval = asReal(t) * cdef PetscBool bval = imex # <<<<<<<<<<<<<< * CHKERR( TSComputeIFunction(self.ts, rval, x.vec, xdot.vec, * f.vec, bval) ) */ __pyx_t_2 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_imex)); if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 894, __pyx_L1_error) __pyx_v_bval = __pyx_t_2; /* "petsc4py/PETSc/TS.pyx":895 * cdef PetscReal rval = asReal(t) * cdef PetscBool bval = imex * CHKERR( TSComputeIFunction(self.ts, rval, x.vec, xdot.vec, # <<<<<<<<<<<<<< * f.vec, bval) ) * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSComputeIFunction(__pyx_v_self->ts, __pyx_v_rval, __pyx_v_x->vec, __pyx_v_xdot->vec, __pyx_v_f->vec, __pyx_v_bval)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 895, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":868 * CHKERR( TSSetIJacobianP(self.ts, Jmat, NULL, NULL) ) * * def computeIFunction(self, # <<<<<<<<<<<<<< * t: float, Vec x, Vec xdot, * Vec f, imex: bool=False) -> None: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.computeIFunction", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":898 * f.vec, bval) ) * * def computeIJacobian(self, # <<<<<<<<<<<<<< * t: float, Vec x, Vec xdot, a: float, * Mat J, Mat P=None, imex: bool=False) -> None: */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_75computeIJacobian(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_74computeIJacobian, "TS.computeIJacobian(self, t: float, x: Vec, xdot: Vec, a: float, J: Mat, P: Mat | None = None, imex: bool = False) -> None\nEvaluate the Jacobian of the DAE.\n\n Collective.\n\n If ``F(t,U,Udot)=0`` is the DAE, the required Jacobian is\n ``dF/dU + shift*dF/dUdot``\n\n Parameters\n ----------\n t\n The current time.\n x\n The state vector.\n xdot\n The time derivative of the state vector.\n a\n The shift to apply\n J\n The matrix into which the Jacobian is computed.\n P\n The optional matrix to use for building a preconditioner matrix.\n imex\n A flag which indicates if the RHS should be kept separate.\n\n See Also\n --------\n petsc.TSComputeIJacobian\n\n \nSource code at petsc4py/PETSc/TS.pyx:898"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_75computeIJacobian(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_t = 0; struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_xdot = 0; PyObject *__pyx_v_a = 0; struct PyPetscMatObject *__pyx_v_J = 0; struct PyPetscMatObject *__pyx_v_P = 0; PyObject *__pyx_v_imex = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[7] = {0,0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("computeIJacobian (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_x,&__pyx_n_s_xdot,&__pyx_n_s_a,&__pyx_n_s_J,&__pyx_n_s_P,&__pyx_n_s_imex,0}; /* "petsc4py/PETSc/TS.pyx":900 * def computeIJacobian(self, * t: float, Vec x, Vec xdot, a: float, * Mat J, Mat P=None, imex: bool=False) -> None: # <<<<<<<<<<<<<< * """Evaluate the Jacobian of the DAE. * */ values[5] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscMatObject *)Py_None)); values[6] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 898, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 898, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("computeIJacobian", 0, 5, 7, 1); __PYX_ERR(51, 898, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_xdot)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 898, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("computeIJacobian", 0, 5, 7, 2); __PYX_ERR(51, 898, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 898, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("computeIJacobian", 0, 5, 7, 3); __PYX_ERR(51, 898, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_J)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 898, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("computeIJacobian", 0, 5, 7, 4); __PYX_ERR(51, 898, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_P); if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 898, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 6: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_imex); if (value) { values[6] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 898, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "computeIJacobian") < 0)) __PYX_ERR(51, 898, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_t = values[0]; __pyx_v_x = ((struct PyPetscVecObject *)values[1]); __pyx_v_xdot = ((struct PyPetscVecObject *)values[2]); __pyx_v_a = values[3]; __pyx_v_J = ((struct PyPetscMatObject *)values[4]); __pyx_v_P = ((struct PyPetscMatObject *)values[5]); __pyx_v_imex = values[6]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("computeIJacobian", 0, 5, 7, __pyx_nargs); __PYX_ERR(51, 898, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TS.computeIJacobian", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(51, 899, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xdot), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "xdot", 0))) __PYX_ERR(51, 899, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_J), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "J", 0))) __PYX_ERR(51, 900, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_P), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "P", 0))) __PYX_ERR(51, 900, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_74computeIJacobian(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_t, __pyx_v_x, __pyx_v_xdot, __pyx_v_a, __pyx_v_J, __pyx_v_P, __pyx_v_imex); /* "petsc4py/PETSc/TS.pyx":898 * f.vec, bval) ) * * def computeIJacobian(self, # <<<<<<<<<<<<<< * t: float, Vec x, Vec xdot, a: float, * Mat J, Mat P=None, imex: bool=False) -> None: */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_74computeIJacobian(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_t, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_xdot, PyObject *__pyx_v_a, struct PyPetscMatObject *__pyx_v_J, struct PyPetscMatObject *__pyx_v_P, PyObject *__pyx_v_imex) { PetscReal __pyx_v_rval1; PetscReal __pyx_v_rval2; PetscBool __pyx_v_bval; Mat __pyx_v_jmat; Mat __pyx_v_pmat; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; PetscBool __pyx_t_2; Mat __pyx_t_3; int __pyx_t_4; PetscErrorCode __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("computeIJacobian", 1); /* "petsc4py/PETSc/TS.pyx":930 * * """ * cdef PetscReal rval1 = asReal(t) # <<<<<<<<<<<<<< * cdef PetscReal rval2 = asReal(a) * cdef PetscBool bval = imex */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_t); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(51, 930, __pyx_L1_error) __pyx_v_rval1 = __pyx_t_1; /* "petsc4py/PETSc/TS.pyx":931 * """ * cdef PetscReal rval1 = asReal(t) * cdef PetscReal rval2 = asReal(a) # <<<<<<<<<<<<<< * cdef PetscBool bval = imex * cdef PetscMat jmat = J.mat, pmat = J.mat */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_a); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(51, 931, __pyx_L1_error) __pyx_v_rval2 = __pyx_t_1; /* "petsc4py/PETSc/TS.pyx":932 * cdef PetscReal rval1 = asReal(t) * cdef PetscReal rval2 = asReal(a) * cdef PetscBool bval = imex # <<<<<<<<<<<<<< * cdef PetscMat jmat = J.mat, pmat = J.mat * if P is not None: pmat = P.mat */ __pyx_t_2 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_imex)); if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 932, __pyx_L1_error) __pyx_v_bval = __pyx_t_2; /* "petsc4py/PETSc/TS.pyx":933 * cdef PetscReal rval2 = asReal(a) * cdef PetscBool bval = imex * cdef PetscMat jmat = J.mat, pmat = J.mat # <<<<<<<<<<<<<< * if P is not None: pmat = P.mat * CHKERR( TSComputeIJacobian(self.ts, rval1, x.vec, xdot.vec, rval2, */ __pyx_t_3 = __pyx_v_J->mat; __pyx_v_jmat = __pyx_t_3; __pyx_t_3 = __pyx_v_J->mat; __pyx_v_pmat = __pyx_t_3; /* "petsc4py/PETSc/TS.pyx":934 * cdef PetscBool bval = imex * cdef PetscMat jmat = J.mat, pmat = J.mat * if P is not None: pmat = P.mat # <<<<<<<<<<<<<< * CHKERR( TSComputeIJacobian(self.ts, rval1, x.vec, xdot.vec, rval2, * jmat, pmat, bval) ) */ __pyx_t_4 = (((PyObject *)__pyx_v_P) != Py_None); if (__pyx_t_4) { __pyx_t_3 = __pyx_v_P->mat; __pyx_v_pmat = __pyx_t_3; } /* "petsc4py/PETSc/TS.pyx":935 * cdef PetscMat jmat = J.mat, pmat = J.mat * if P is not None: pmat = P.mat * CHKERR( TSComputeIJacobian(self.ts, rval1, x.vec, xdot.vec, rval2, # <<<<<<<<<<<<<< * jmat, pmat, bval) ) * */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSComputeIJacobian(__pyx_v_self->ts, __pyx_v_rval1, __pyx_v_x->vec, __pyx_v_xdot->vec, __pyx_v_rval2, __pyx_v_jmat, __pyx_v_pmat, __pyx_v_bval)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 935, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":898 * f.vec, bval) ) * * def computeIJacobian(self, # <<<<<<<<<<<<<< * t: float, Vec x, Vec xdot, a: float, * Mat J, Mat P=None, imex: bool=False) -> None: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.computeIJacobian", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":938 * jmat, pmat, bval) ) * * def computeIJacobianP(self, # <<<<<<<<<<<<<< * t: float, Vec x, Vec xdot, a: float, * Mat J, imex: bool=False) -> None: */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_77computeIJacobianP(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_76computeIJacobianP, "TS.computeIJacobianP(self, t: float, x: Vec, xdot: Vec, a: float, J: Mat, imex: bool = False) -> None\nEvaluate the Jacobian with respect to parameters.\n\n Collective.\n\n Parameters\n ----------\n t\n The current time.\n x\n The state vector.\n xdot\n The time derivative of the state vector.\n a\n The shift to apply\n J\n The matrix into which the Jacobian is computed.\n imex\n A flag which indicates if the RHS should be kept separate.\n\n See Also\n --------\n petsc.TSComputeIJacobianP\n\n \nSource code at petsc4py/PETSc/TS.pyx:938"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_77computeIJacobianP(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_t = 0; struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_xdot = 0; PyObject *__pyx_v_a = 0; struct PyPetscMatObject *__pyx_v_J = 0; PyObject *__pyx_v_imex = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[6] = {0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("computeIJacobianP (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_x,&__pyx_n_s_xdot,&__pyx_n_s_a,&__pyx_n_s_J,&__pyx_n_s_imex,0}; /* "petsc4py/PETSc/TS.pyx":940 * def computeIJacobianP(self, * t: float, Vec x, Vec xdot, a: float, * Mat J, imex: bool=False) -> None: # <<<<<<<<<<<<<< * """Evaluate the Jacobian with respect to parameters. * */ values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 938, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 938, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("computeIJacobianP", 0, 5, 6, 1); __PYX_ERR(51, 938, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_xdot)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 938, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("computeIJacobianP", 0, 5, 6, 2); __PYX_ERR(51, 938, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 938, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("computeIJacobianP", 0, 5, 6, 3); __PYX_ERR(51, 938, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_J)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 938, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("computeIJacobianP", 0, 5, 6, 4); __PYX_ERR(51, 938, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_imex); if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 938, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "computeIJacobianP") < 0)) __PYX_ERR(51, 938, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_t = values[0]; __pyx_v_x = ((struct PyPetscVecObject *)values[1]); __pyx_v_xdot = ((struct PyPetscVecObject *)values[2]); __pyx_v_a = values[3]; __pyx_v_J = ((struct PyPetscMatObject *)values[4]); __pyx_v_imex = values[5]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("computeIJacobianP", 0, 5, 6, __pyx_nargs); __PYX_ERR(51, 938, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TS.computeIJacobianP", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(51, 939, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xdot), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "xdot", 0))) __PYX_ERR(51, 939, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_J), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "J", 0))) __PYX_ERR(51, 940, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_76computeIJacobianP(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_t, __pyx_v_x, __pyx_v_xdot, __pyx_v_a, __pyx_v_J, __pyx_v_imex); /* "petsc4py/PETSc/TS.pyx":938 * jmat, pmat, bval) ) * * def computeIJacobianP(self, # <<<<<<<<<<<<<< * t: float, Vec x, Vec xdot, a: float, * Mat J, imex: bool=False) -> None: */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_76computeIJacobianP(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_t, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_xdot, PyObject *__pyx_v_a, struct PyPetscMatObject *__pyx_v_J, PyObject *__pyx_v_imex) { PetscReal __pyx_v_rval1; PetscReal __pyx_v_rval2; PetscBool __pyx_v_bval; Mat __pyx_v_jmat; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; PetscBool __pyx_t_2; Mat __pyx_t_3; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("computeIJacobianP", 1); /* "petsc4py/PETSc/TS.pyx":965 * * """ * cdef PetscReal rval1 = asReal(t) # <<<<<<<<<<<<<< * cdef PetscReal rval2 = asReal(a) * cdef PetscBool bval = asBool(imex) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_t); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(51, 965, __pyx_L1_error) __pyx_v_rval1 = __pyx_t_1; /* "petsc4py/PETSc/TS.pyx":966 * """ * cdef PetscReal rval1 = asReal(t) * cdef PetscReal rval2 = asReal(a) # <<<<<<<<<<<<<< * cdef PetscBool bval = asBool(imex) * cdef PetscMat jmat = J.mat */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_a); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(51, 966, __pyx_L1_error) __pyx_v_rval2 = __pyx_t_1; /* "petsc4py/PETSc/TS.pyx":967 * cdef PetscReal rval1 = asReal(t) * cdef PetscReal rval2 = asReal(a) * cdef PetscBool bval = asBool(imex) # <<<<<<<<<<<<<< * cdef PetscMat jmat = J.mat * CHKERR( TSComputeIJacobianP(self.ts, rval1, x.vec, xdot.vec, rval2, */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asBool(__pyx_v_imex); if (unlikely(__pyx_t_2 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(51, 967, __pyx_L1_error) __pyx_v_bval = __pyx_t_2; /* "petsc4py/PETSc/TS.pyx":968 * cdef PetscReal rval2 = asReal(a) * cdef PetscBool bval = asBool(imex) * cdef PetscMat jmat = J.mat # <<<<<<<<<<<<<< * CHKERR( TSComputeIJacobianP(self.ts, rval1, x.vec, xdot.vec, rval2, * jmat, bval) ) */ __pyx_t_3 = __pyx_v_J->mat; __pyx_v_jmat = __pyx_t_3; /* "petsc4py/PETSc/TS.pyx":969 * cdef PetscBool bval = asBool(imex) * cdef PetscMat jmat = J.mat * CHKERR( TSComputeIJacobianP(self.ts, rval1, x.vec, xdot.vec, rval2, # <<<<<<<<<<<<<< * jmat, bval) ) * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSComputeIJacobianP(__pyx_v_self->ts, __pyx_v_rval1, __pyx_v_x->vec, __pyx_v_xdot->vec, __pyx_v_rval2, __pyx_v_jmat, __pyx_v_bval)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 969, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":938 * jmat, pmat, bval) ) * * def computeIJacobianP(self, # <<<<<<<<<<<<<< * t: float, Vec x, Vec xdot, a: float, * Mat J, imex: bool=False) -> None: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.computeIJacobianP", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":972 * jmat, bval) ) * * def getIFunction(self) -> tuple[Vec, TSIFunction]: # <<<<<<<<<<<<<< * """Return the vector and function which computes the implicit residual. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_79getIFunction(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_78getIFunction, "TS.getIFunction(self) -> tuple[Vec, TSIFunction]\nReturn the vector and function which computes the implicit residual.\n\n Not collective.\n\n See Also\n --------\n petsc.TSGetIFunction\n\n \nSource code at petsc4py/PETSc/TS.pyx:972"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_79getIFunction(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getIFunction (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getIFunction", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getIFunction", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_78getIFunction(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_78getIFunction(struct PyPetscTSObject *__pyx_v_self) { struct PyPetscVecObject *__pyx_v_f = 0; PyObject *__pyx_v_function = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getIFunction", 1); /* "petsc4py/PETSc/TS.pyx":982 * * """ * cdef Vec f = Vec() # <<<<<<<<<<<<<< * CHKERR( TSGetIFunction(self.ts, &f.vec, NULL, NULL) ) * CHKERR( PetscINCREF(f.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 982, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_f = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/TS.pyx":983 * """ * cdef Vec f = Vec() * CHKERR( TSGetIFunction(self.ts, &f.vec, NULL, NULL) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(f.obj) ) * cdef object function = self.get_attr('__ifunction__') */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetIFunction(__pyx_v_self->ts, (&__pyx_v_f->vec), NULL, NULL)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 983, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":984 * cdef Vec f = Vec() * CHKERR( TSGetIFunction(self.ts, &f.vec, NULL, NULL) ) * CHKERR( PetscINCREF(f.obj) ) # <<<<<<<<<<<<<< * cdef object function = self.get_attr('__ifunction__') * return (f, function) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_f->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 984, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":985 * CHKERR( TSGetIFunction(self.ts, &f.vec, NULL, NULL) ) * CHKERR( PetscINCREF(f.obj) ) * cdef object function = self.get_attr('__ifunction__') # <<<<<<<<<<<<<< * return (f, function) * */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__ifunction__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 985, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_function = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/TS.pyx":986 * CHKERR( PetscINCREF(f.obj) ) * cdef object function = self.get_attr('__ifunction__') * return (f, function) # <<<<<<<<<<<<<< * * def getIJacobian(self) -> tuple[Mat, Mat, TSIJacobian]: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 986, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF((PyObject *)__pyx_v_f); __Pyx_GIVEREF((PyObject *)__pyx_v_f); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_f))) __PYX_ERR(51, 986, __pyx_L1_error); __Pyx_INCREF(__pyx_v_function); __Pyx_GIVEREF(__pyx_v_function); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_function)) __PYX_ERR(51, 986, __pyx_L1_error); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TS.pyx":972 * jmat, bval) ) * * def getIFunction(self) -> tuple[Vec, TSIFunction]: # <<<<<<<<<<<<<< * """Return the vector and function which computes the implicit residual. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TS.getIFunction", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_f); __Pyx_XDECREF(__pyx_v_function); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":988 * return (f, function) * * def getIJacobian(self) -> tuple[Mat, Mat, TSIJacobian]: # <<<<<<<<<<<<<< * """Return the matrices and function which computes the implicit Jacobian. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_81getIJacobian(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_80getIJacobian, "TS.getIJacobian(self) -> tuple[Mat, Mat, TSIJacobian]\nReturn the matrices and function which computes the implicit Jacobian.\n\n Not collective.\n\n See Also\n --------\n petsc.TSGetIJacobian\n\n \nSource code at petsc4py/PETSc/TS.pyx:988"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_81getIJacobian(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getIJacobian (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getIJacobian", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getIJacobian", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_80getIJacobian(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_80getIJacobian(struct PyPetscTSObject *__pyx_v_self) { struct PyPetscMatObject *__pyx_v_J = 0; struct PyPetscMatObject *__pyx_v_P = 0; PyObject *__pyx_v_jacobian = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getIJacobian", 1); /* "petsc4py/PETSc/TS.pyx":998 * * """ * cdef Mat J = Mat(), P = Mat() # <<<<<<<<<<<<<< * CHKERR( TSGetIJacobian(self.ts, &J.mat, &P.mat, NULL, NULL) ) * CHKERR( PetscINCREF(J.obj) ); CHKERR( PetscINCREF(P.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 998, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_J = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 998, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_P = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/TS.pyx":999 * """ * cdef Mat J = Mat(), P = Mat() * CHKERR( TSGetIJacobian(self.ts, &J.mat, &P.mat, NULL, NULL) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(J.obj) ); CHKERR( PetscINCREF(P.obj) ) * cdef object jacobian = self.get_attr('__ijacobian__') */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetIJacobian(__pyx_v_self->ts, (&__pyx_v_J->mat), (&__pyx_v_P->mat), NULL, NULL)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 999, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":1000 * cdef Mat J = Mat(), P = Mat() * CHKERR( TSGetIJacobian(self.ts, &J.mat, &P.mat, NULL, NULL) ) * CHKERR( PetscINCREF(J.obj) ); CHKERR( PetscINCREF(P.obj) ) # <<<<<<<<<<<<<< * cdef object jacobian = self.get_attr('__ijacobian__') * return (J, P, jacobian) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_J->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1000, __pyx_L1_error) __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_P->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1000, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":1001 * CHKERR( TSGetIJacobian(self.ts, &J.mat, &P.mat, NULL, NULL) ) * CHKERR( PetscINCREF(J.obj) ); CHKERR( PetscINCREF(P.obj) ) * cdef object jacobian = self.get_attr('__ijacobian__') # <<<<<<<<<<<<<< * return (J, P, jacobian) * */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__ijacobian__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 1001, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_jacobian = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/TS.pyx":1002 * CHKERR( PetscINCREF(J.obj) ); CHKERR( PetscINCREF(P.obj) ) * cdef object jacobian = self.get_attr('__ijacobian__') * return (J, P, jacobian) # <<<<<<<<<<<<<< * * def setI2Function( */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 1002, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF((PyObject *)__pyx_v_J); __Pyx_GIVEREF((PyObject *)__pyx_v_J); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_J))) __PYX_ERR(51, 1002, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_P); __Pyx_GIVEREF((PyObject *)__pyx_v_P); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_P))) __PYX_ERR(51, 1002, __pyx_L1_error); __Pyx_INCREF(__pyx_v_jacobian); __Pyx_GIVEREF(__pyx_v_jacobian); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_jacobian)) __PYX_ERR(51, 1002, __pyx_L1_error); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TS.pyx":988 * return (f, function) * * def getIJacobian(self) -> tuple[Mat, Mat, TSIJacobian]: # <<<<<<<<<<<<<< * """Return the matrices and function which computes the implicit Jacobian. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TS.getIJacobian", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_J); __Pyx_XDECREF((PyObject *)__pyx_v_P); __Pyx_XDECREF(__pyx_v_jacobian); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":1004 * return (J, P, jacobian) * * def setI2Function( # <<<<<<<<<<<<<< * self, * function: TSI2Function, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_83setI2Function(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_82setI2Function, "TS.setI2Function(self, function: TSI2Function, f: Vec | None = None, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nSet the function to compute the 2nd order DAE.\n\n Logically collective.\n\n Parameters\n ----------\n function\n The right-hand side function.\n f\n The vector to store values or `None` to be created internally.\n args\n Additional positional arguments for ``function``.\n kargs\n Additional keyword arguments for ``function``.\n\n See Also\n --------\n petsc.TSSetI2Function\n\n \nSource code at petsc4py/PETSc/TS.pyx:1004"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_83setI2Function(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_function = 0; struct PyPetscVecObject *__pyx_v_f = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setI2Function (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_function,&__pyx_n_s_f,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; /* "petsc4py/PETSc/TS.pyx":1007 * self, * function: TSI2Function, * Vec f=None, # <<<<<<<<<<<<<< * args : tuple[Any, ...] | None = None, * kargs : dict[str, Any] | None = None) -> None: */ values[1] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscVecObject *)Py_None)); /* "petsc4py/PETSc/TS.pyx":1008 * function: TSI2Function, * Vec f=None, * args : tuple[Any, ...] | None = None, # <<<<<<<<<<<<<< * kargs : dict[str, Any] | None = None) -> None: * """Set the function to compute the 2nd order DAE. */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/TS.pyx":1009 * Vec f=None, * args : tuple[Any, ...] | None = None, * kargs : dict[str, Any] | None = None) -> None: # <<<<<<<<<<<<<< * """Set the function to compute the 2nd order DAE. * */ values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_function)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 1004, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_f); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 1004, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 1004, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 1004, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setI2Function") < 0)) __PYX_ERR(51, 1004, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_function = values[0]; __pyx_v_f = ((struct PyPetscVecObject *)values[1]); __pyx_v_args = values[2]; __pyx_v_kargs = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setI2Function", 0, 1, 4, __pyx_nargs); __PYX_ERR(51, 1004, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TS.setI2Function", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_f), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "f", 0))) __PYX_ERR(51, 1007, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_82setI2Function(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_function, __pyx_v_f, __pyx_v_args, __pyx_v_kargs); /* "petsc4py/PETSc/TS.pyx":1004 * return (J, P, jacobian) * * def setI2Function( # <<<<<<<<<<<<<< * self, * function: TSI2Function, */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_82setI2Function(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_function, struct PyPetscVecObject *__pyx_v_f, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { Vec __pyx_v_fvec; PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; Vec __pyx_t_2; PyObject *__pyx_t_3 = NULL; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setI2Function", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/TS.pyx":1030 * * """ * cdef PetscVec fvec=NULL # <<<<<<<<<<<<<< * if f is not None: fvec = f.vec * if function is not None: */ __pyx_v_fvec = NULL; /* "petsc4py/PETSc/TS.pyx":1031 * """ * cdef PetscVec fvec=NULL * if f is not None: fvec = f.vec # <<<<<<<<<<<<<< * if function is not None: * if args is None: args = () */ __pyx_t_1 = (((PyObject *)__pyx_v_f) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_f->vec; __pyx_v_fvec = __pyx_t_2; } /* "petsc4py/PETSc/TS.pyx":1032 * cdef PetscVec fvec=NULL * if f is not None: fvec = f.vec * if function is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = (__pyx_v_function != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/TS.pyx":1033 * if f is not None: fvec = f.vec * if function is not None: * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (function, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/TS.pyx":1034 * if function is not None: * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (function, args, kargs) * self.set_attr('__i2function__', context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); if (__pyx_t_1) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 1034, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "petsc4py/PETSc/TS.pyx":1035 * if args is None: args = () * if kargs is None: kargs = {} * context = (function, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__i2function__', context) * CHKERR( TSSetI2Function(self.ts, fvec, TS_I2Function, context) ) */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 1035, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_function); __Pyx_GIVEREF(__pyx_v_function); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_function)) __PYX_ERR(51, 1035, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args)) __PYX_ERR(51, 1035, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs)) __PYX_ERR(51, 1035, __pyx_L1_error); __pyx_v_context = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/TS.pyx":1036 * if kargs is None: kargs = {} * context = (function, args, kargs) * self.set_attr('__i2function__', context) # <<<<<<<<<<<<<< * CHKERR( TSSetI2Function(self.ts, fvec, TS_I2Function, context) ) * else: */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__i2function__"), __pyx_v_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 1036, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/TS.pyx":1037 * context = (function, args, kargs) * self.set_attr('__i2function__', context) * CHKERR( TSSetI2Function(self.ts, fvec, TS_I2Function, context) ) # <<<<<<<<<<<<<< * else: * CHKERR( TSSetI2Function(self.ts, fvec, NULL, NULL) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetI2Function(__pyx_v_self->ts, __pyx_v_fvec, __pyx_f_8petsc4py_5PETSc_TS_I2Function, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1037, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":1032 * cdef PetscVec fvec=NULL * if f is not None: fvec = f.vec * if function is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ goto __pyx_L4; } /* "petsc4py/PETSc/TS.pyx":1039 * CHKERR( TSSetI2Function(self.ts, fvec, TS_I2Function, context) ) * else: * CHKERR( TSSetI2Function(self.ts, fvec, NULL, NULL) ) # <<<<<<<<<<<<<< * * def setI2Jacobian( */ /*else*/ { __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetI2Function(__pyx_v_self->ts, __pyx_v_fvec, NULL, NULL)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1039, __pyx_L1_error) } __pyx_L4:; /* "petsc4py/PETSc/TS.pyx":1004 * return (J, P, jacobian) * * def setI2Function( # <<<<<<<<<<<<<< * self, * function: TSI2Function, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.setI2Function", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":1041 * CHKERR( TSSetI2Function(self.ts, fvec, NULL, NULL) ) * * def setI2Jacobian( # <<<<<<<<<<<<<< * self, * jacobian: TSI2Jacobian, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_85setI2Jacobian(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_84setI2Jacobian, "TS.setI2Jacobian(self, jacobian: TSI2Jacobian, J: Mat | None = None, P: Mat | None = None, args=None, kargs=None) -> None\nSet the function to compute the Jacobian of the 2nd order DAE.\n\n Logically collective.\n\n Parameters\n ----------\n jacobian\n The function which computes the Jacobian.\n J\n The matrix into which the Jacobian is computed.\n P\n The optional matrix to use for building a preconditioner matrix.\n args\n Additional positional arguments for ``jacobian``.\n kargs\n Additional keyword arguments for ``jacobian``.\n\n See Also\n --------\n petsc.TSSetI2Jacobian\n\n \nSource code at petsc4py/PETSc/TS.pyx:1041"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_85setI2Jacobian(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_jacobian = 0; struct PyPetscMatObject *__pyx_v_J = 0; struct PyPetscMatObject *__pyx_v_P = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setI2Jacobian (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_jacobian,&__pyx_n_s_J,&__pyx_n_s_P,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; /* "petsc4py/PETSc/TS.pyx":1044 * self, * jacobian: TSI2Jacobian, * Mat J=None, # <<<<<<<<<<<<<< * Mat P=None, * args=None, */ values[1] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscMatObject *)Py_None)); /* "petsc4py/PETSc/TS.pyx":1045 * jacobian: TSI2Jacobian, * Mat J=None, * Mat P=None, # <<<<<<<<<<<<<< * args=None, * kargs=None) -> None: */ values[2] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscMatObject *)Py_None)); /* "petsc4py/PETSc/TS.pyx":1046 * Mat J=None, * Mat P=None, * args=None, # <<<<<<<<<<<<<< * kargs=None) -> None: * """Set the function to compute the Jacobian of the 2nd order DAE. */ values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/TS.pyx":1047 * Mat P=None, * args=None, * kargs=None) -> None: # <<<<<<<<<<<<<< * """Set the function to compute the Jacobian of the 2nd order DAE. * */ values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_jacobian)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 1041, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_J); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 1041, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_P); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 1041, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 1041, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 1041, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setI2Jacobian") < 0)) __PYX_ERR(51, 1041, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_jacobian = values[0]; __pyx_v_J = ((struct PyPetscMatObject *)values[1]); __pyx_v_P = ((struct PyPetscMatObject *)values[2]); __pyx_v_args = values[3]; __pyx_v_kargs = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setI2Jacobian", 0, 1, 5, __pyx_nargs); __PYX_ERR(51, 1041, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TS.setI2Jacobian", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_J), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "J", 0))) __PYX_ERR(51, 1044, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_P), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "P", 0))) __PYX_ERR(51, 1045, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_84setI2Jacobian(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_jacobian, __pyx_v_J, __pyx_v_P, __pyx_v_args, __pyx_v_kargs); /* "petsc4py/PETSc/TS.pyx":1041 * CHKERR( TSSetI2Function(self.ts, fvec, NULL, NULL) ) * * def setI2Jacobian( # <<<<<<<<<<<<<< * self, * jacobian: TSI2Jacobian, */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_84setI2Jacobian(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_jacobian, struct PyPetscMatObject *__pyx_v_J, struct PyPetscMatObject *__pyx_v_P, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { Mat __pyx_v_Jmat; Mat __pyx_v_Pmat; PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; Mat __pyx_t_2; PyObject *__pyx_t_3 = NULL; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setI2Jacobian", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/TS.pyx":1070 * * """ * cdef PetscMat Jmat=NULL # <<<<<<<<<<<<<< * if J is not None: Jmat = J.mat * cdef PetscMat Pmat=Jmat */ __pyx_v_Jmat = NULL; /* "petsc4py/PETSc/TS.pyx":1071 * """ * cdef PetscMat Jmat=NULL * if J is not None: Jmat = J.mat # <<<<<<<<<<<<<< * cdef PetscMat Pmat=Jmat * if P is not None: Pmat = P.mat */ __pyx_t_1 = (((PyObject *)__pyx_v_J) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_J->mat; __pyx_v_Jmat = __pyx_t_2; } /* "petsc4py/PETSc/TS.pyx":1072 * cdef PetscMat Jmat=NULL * if J is not None: Jmat = J.mat * cdef PetscMat Pmat=Jmat # <<<<<<<<<<<<<< * if P is not None: Pmat = P.mat * if jacobian is not None: */ __pyx_v_Pmat = __pyx_v_Jmat; /* "petsc4py/PETSc/TS.pyx":1073 * if J is not None: Jmat = J.mat * cdef PetscMat Pmat=Jmat * if P is not None: Pmat = P.mat # <<<<<<<<<<<<<< * if jacobian is not None: * if args is None: args = () */ __pyx_t_1 = (((PyObject *)__pyx_v_P) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_P->mat; __pyx_v_Pmat = __pyx_t_2; } /* "petsc4py/PETSc/TS.pyx":1074 * cdef PetscMat Pmat=Jmat * if P is not None: Pmat = P.mat * if jacobian is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = (__pyx_v_jacobian != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/TS.pyx":1075 * if P is not None: Pmat = P.mat * if jacobian is not None: * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (jacobian, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/TS.pyx":1076 * if jacobian is not None: * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (jacobian, args, kargs) * self.set_attr('__i2jacobian__', context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); if (__pyx_t_1) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 1076, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "petsc4py/PETSc/TS.pyx":1077 * if args is None: args = () * if kargs is None: kargs = {} * context = (jacobian, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__i2jacobian__', context) * CHKERR( TSSetI2Jacobian(self.ts, Jmat, Pmat, TS_I2Jacobian, context) ) */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 1077, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_jacobian); __Pyx_GIVEREF(__pyx_v_jacobian); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_jacobian)) __PYX_ERR(51, 1077, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args)) __PYX_ERR(51, 1077, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs)) __PYX_ERR(51, 1077, __pyx_L1_error); __pyx_v_context = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/TS.pyx":1078 * if kargs is None: kargs = {} * context = (jacobian, args, kargs) * self.set_attr('__i2jacobian__', context) # <<<<<<<<<<<<<< * CHKERR( TSSetI2Jacobian(self.ts, Jmat, Pmat, TS_I2Jacobian, context) ) * else: */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__i2jacobian__"), __pyx_v_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 1078, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/TS.pyx":1079 * context = (jacobian, args, kargs) * self.set_attr('__i2jacobian__', context) * CHKERR( TSSetI2Jacobian(self.ts, Jmat, Pmat, TS_I2Jacobian, context) ) # <<<<<<<<<<<<<< * else: * CHKERR( TSSetI2Jacobian(self.ts, Jmat, Pmat, NULL, NULL) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetI2Jacobian(__pyx_v_self->ts, __pyx_v_Jmat, __pyx_v_Pmat, __pyx_f_8petsc4py_5PETSc_TS_I2Jacobian, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1079, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":1074 * cdef PetscMat Pmat=Jmat * if P is not None: Pmat = P.mat * if jacobian is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ goto __pyx_L5; } /* "petsc4py/PETSc/TS.pyx":1081 * CHKERR( TSSetI2Jacobian(self.ts, Jmat, Pmat, TS_I2Jacobian, context) ) * else: * CHKERR( TSSetI2Jacobian(self.ts, Jmat, Pmat, NULL, NULL) ) # <<<<<<<<<<<<<< * * def computeI2Function(self, t: float, Vec x, Vec xdot, Vec xdotdot, Vec f) -> None: */ /*else*/ { __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetI2Jacobian(__pyx_v_self->ts, __pyx_v_Jmat, __pyx_v_Pmat, NULL, NULL)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1081, __pyx_L1_error) } __pyx_L5:; /* "petsc4py/PETSc/TS.pyx":1041 * CHKERR( TSSetI2Function(self.ts, fvec, NULL, NULL) ) * * def setI2Jacobian( # <<<<<<<<<<<<<< * self, * jacobian: TSI2Jacobian, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.setI2Jacobian", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":1083 * CHKERR( TSSetI2Jacobian(self.ts, Jmat, Pmat, NULL, NULL) ) * * def computeI2Function(self, t: float, Vec x, Vec xdot, Vec xdotdot, Vec f) -> None: # <<<<<<<<<<<<<< * """Evaluate the DAE residual in implicit form. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_87computeI2Function(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_86computeI2Function, "TS.computeI2Function(self, t: float, x: Vec, xdot: Vec, xdotdot: Vec, f: Vec) -> None\nEvaluate the DAE residual in implicit form.\n\n Collective.\n\n Parameters\n ----------\n t\n The current time.\n x\n The state vector.\n xdot\n The time derivative of the state vector.\n xdotdot\n The second time derivative of the state vector.\n f\n The vector into which the residual is stored.\n\n See Also\n --------\n petsc.TSComputeI2Function\n\n \nSource code at petsc4py/PETSc/TS.pyx:1083"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_87computeI2Function(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_t = 0; struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_xdot = 0; struct PyPetscVecObject *__pyx_v_xdotdot = 0; struct PyPetscVecObject *__pyx_v_f = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("computeI2Function (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_x,&__pyx_n_s_xdot,&__pyx_n_s_xdotdot,&__pyx_n_s_f,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 1083, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 1083, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("computeI2Function", 1, 5, 5, 1); __PYX_ERR(51, 1083, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_xdot)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 1083, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("computeI2Function", 1, 5, 5, 2); __PYX_ERR(51, 1083, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_xdotdot)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 1083, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("computeI2Function", 1, 5, 5, 3); __PYX_ERR(51, 1083, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_f)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 1083, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("computeI2Function", 1, 5, 5, 4); __PYX_ERR(51, 1083, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "computeI2Function") < 0)) __PYX_ERR(51, 1083, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 5)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); } __pyx_v_t = values[0]; __pyx_v_x = ((struct PyPetscVecObject *)values[1]); __pyx_v_xdot = ((struct PyPetscVecObject *)values[2]); __pyx_v_xdotdot = ((struct PyPetscVecObject *)values[3]); __pyx_v_f = ((struct PyPetscVecObject *)values[4]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("computeI2Function", 1, 5, 5, __pyx_nargs); __PYX_ERR(51, 1083, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TS.computeI2Function", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(51, 1083, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xdot), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "xdot", 0))) __PYX_ERR(51, 1083, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xdotdot), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "xdotdot", 0))) __PYX_ERR(51, 1083, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_f), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "f", 0))) __PYX_ERR(51, 1083, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_86computeI2Function(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_t, __pyx_v_x, __pyx_v_xdot, __pyx_v_xdotdot, __pyx_v_f); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_86computeI2Function(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_t, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_xdot, struct PyPetscVecObject *__pyx_v_xdotdot, struct PyPetscVecObject *__pyx_v_f) { PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("computeI2Function", 1); /* "petsc4py/PETSc/TS.pyx":1106 * * """ * cdef PetscReal rval = asReal(t) # <<<<<<<<<<<<<< * CHKERR( TSComputeI2Function(self.ts, rval, x.vec, xdot.vec, xdotdot.vec, * f.vec) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_t); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(51, 1106, __pyx_L1_error) __pyx_v_rval = __pyx_t_1; /* "petsc4py/PETSc/TS.pyx":1107 * """ * cdef PetscReal rval = asReal(t) * CHKERR( TSComputeI2Function(self.ts, rval, x.vec, xdot.vec, xdotdot.vec, # <<<<<<<<<<<<<< * f.vec) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSComputeI2Function(__pyx_v_self->ts, __pyx_v_rval, __pyx_v_x->vec, __pyx_v_xdot->vec, __pyx_v_xdotdot->vec, __pyx_v_f->vec)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1107, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":1083 * CHKERR( TSSetI2Jacobian(self.ts, Jmat, Pmat, NULL, NULL) ) * * def computeI2Function(self, t: float, Vec x, Vec xdot, Vec xdotdot, Vec f) -> None: # <<<<<<<<<<<<<< * """Evaluate the DAE residual in implicit form. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.computeI2Function", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":1110 * f.vec) ) * * def computeI2Jacobian( # <<<<<<<<<<<<<< * self, * t: float, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_89computeI2Jacobian(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_88computeI2Jacobian, "TS.computeI2Jacobian(self, t: float, x: Vec, xdot: Vec, xdotdot: Vec, v: float, a: float, J: Mat, P: Mat | None = None) -> None\nEvaluate the Jacobian of the DAE.\n\n Collective.\n\n If ``F(t,U,V,A)=0`` is the DAE,\n the required Jacobian is ``dF/dU + v dF/dV + a dF/dA``.\n\n Parameters\n ----------\n t\n The current time.\n x\n The state vector.\n xdot\n The time derivative of the state vector.\n xdotdot\n The second time derivative of the state vector.\n v\n The shift to apply to the first derivative.\n a\n The shift to apply to the second derivative.\n J\n The matrix into which the Jacobian is computed.\n P\n The optional matrix to use for building a preconditioner matrix.\n\n See Also\n --------\n petsc.TSComputeI2Jacobian\n\n \nSource code at petsc4py/PETSc/TS.pyx:1110"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_89computeI2Jacobian(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_t = 0; struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_xdot = 0; struct PyPetscVecObject *__pyx_v_xdotdot = 0; PyObject *__pyx_v_v = 0; PyObject *__pyx_v_a = 0; struct PyPetscMatObject *__pyx_v_J = 0; struct PyPetscMatObject *__pyx_v_P = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[8] = {0,0,0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("computeI2Jacobian (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_x,&__pyx_n_s_xdot,&__pyx_n_s_xdotdot,&__pyx_n_s_v,&__pyx_n_s_a,&__pyx_n_s_J,&__pyx_n_s_P,0}; /* "petsc4py/PETSc/TS.pyx":1119 * a: float, * Mat J, * Mat P=None) -> None: # <<<<<<<<<<<<<< * """Evaluate the Jacobian of the DAE. * */ values[7] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscMatObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); CYTHON_FALLTHROUGH; case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 1110, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 1110, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("computeI2Jacobian", 0, 7, 8, 1); __PYX_ERR(51, 1110, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_xdot)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 1110, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("computeI2Jacobian", 0, 7, 8, 2); __PYX_ERR(51, 1110, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_xdotdot)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 1110, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("computeI2Jacobian", 0, 7, 8, 3); __PYX_ERR(51, 1110, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_v)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 1110, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("computeI2Jacobian", 0, 7, 8, 4); __PYX_ERR(51, 1110, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 1110, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("computeI2Jacobian", 0, 7, 8, 5); __PYX_ERR(51, 1110, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 6: if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_J)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[6]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 1110, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("computeI2Jacobian", 0, 7, 8, 6); __PYX_ERR(51, 1110, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 7: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_P); if (value) { values[7] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 1110, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "computeI2Jacobian") < 0)) __PYX_ERR(51, 1110, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); CYTHON_FALLTHROUGH; case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_t = values[0]; __pyx_v_x = ((struct PyPetscVecObject *)values[1]); __pyx_v_xdot = ((struct PyPetscVecObject *)values[2]); __pyx_v_xdotdot = ((struct PyPetscVecObject *)values[3]); __pyx_v_v = values[4]; __pyx_v_a = values[5]; __pyx_v_J = ((struct PyPetscMatObject *)values[6]); __pyx_v_P = ((struct PyPetscMatObject *)values[7]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("computeI2Jacobian", 0, 7, 8, __pyx_nargs); __PYX_ERR(51, 1110, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TS.computeI2Jacobian", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(51, 1113, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xdot), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "xdot", 0))) __PYX_ERR(51, 1114, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xdotdot), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "xdotdot", 0))) __PYX_ERR(51, 1115, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_J), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "J", 0))) __PYX_ERR(51, 1118, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_P), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "P", 0))) __PYX_ERR(51, 1119, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_88computeI2Jacobian(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_t, __pyx_v_x, __pyx_v_xdot, __pyx_v_xdotdot, __pyx_v_v, __pyx_v_a, __pyx_v_J, __pyx_v_P); /* "petsc4py/PETSc/TS.pyx":1110 * f.vec) ) * * def computeI2Jacobian( # <<<<<<<<<<<<<< * self, * t: float, */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_88computeI2Jacobian(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_t, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_xdot, struct PyPetscVecObject *__pyx_v_xdotdot, PyObject *__pyx_v_v, PyObject *__pyx_v_a, struct PyPetscMatObject *__pyx_v_J, struct PyPetscMatObject *__pyx_v_P) { PetscReal __pyx_v_rval1; PetscReal __pyx_v_rval2; PetscReal __pyx_v_rval3; Mat __pyx_v_jmat; Mat __pyx_v_pmat; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; Mat __pyx_t_2; int __pyx_t_3; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("computeI2Jacobian", 1); /* "petsc4py/PETSc/TS.pyx":1151 * * """ * cdef PetscReal rval1 = asReal(t) # <<<<<<<<<<<<<< * cdef PetscReal rval2 = asReal(v) * cdef PetscReal rval3 = asReal(a) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_t); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(51, 1151, __pyx_L1_error) __pyx_v_rval1 = __pyx_t_1; /* "petsc4py/PETSc/TS.pyx":1152 * """ * cdef PetscReal rval1 = asReal(t) * cdef PetscReal rval2 = asReal(v) # <<<<<<<<<<<<<< * cdef PetscReal rval3 = asReal(a) * cdef PetscMat jmat = J.mat, pmat = J.mat */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_v); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(51, 1152, __pyx_L1_error) __pyx_v_rval2 = __pyx_t_1; /* "petsc4py/PETSc/TS.pyx":1153 * cdef PetscReal rval1 = asReal(t) * cdef PetscReal rval2 = asReal(v) * cdef PetscReal rval3 = asReal(a) # <<<<<<<<<<<<<< * cdef PetscMat jmat = J.mat, pmat = J.mat * if P is not None: pmat = P.mat */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_a); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(51, 1153, __pyx_L1_error) __pyx_v_rval3 = __pyx_t_1; /* "petsc4py/PETSc/TS.pyx":1154 * cdef PetscReal rval2 = asReal(v) * cdef PetscReal rval3 = asReal(a) * cdef PetscMat jmat = J.mat, pmat = J.mat # <<<<<<<<<<<<<< * if P is not None: pmat = P.mat * CHKERR( TSComputeI2Jacobian(self.ts, rval1, x.vec, xdot.vec, xdotdot.vec, rval2, rval3, */ __pyx_t_2 = __pyx_v_J->mat; __pyx_v_jmat = __pyx_t_2; __pyx_t_2 = __pyx_v_J->mat; __pyx_v_pmat = __pyx_t_2; /* "petsc4py/PETSc/TS.pyx":1155 * cdef PetscReal rval3 = asReal(a) * cdef PetscMat jmat = J.mat, pmat = J.mat * if P is not None: pmat = P.mat # <<<<<<<<<<<<<< * CHKERR( TSComputeI2Jacobian(self.ts, rval1, x.vec, xdot.vec, xdotdot.vec, rval2, rval3, * jmat, pmat) ) */ __pyx_t_3 = (((PyObject *)__pyx_v_P) != Py_None); if (__pyx_t_3) { __pyx_t_2 = __pyx_v_P->mat; __pyx_v_pmat = __pyx_t_2; } /* "petsc4py/PETSc/TS.pyx":1156 * cdef PetscMat jmat = J.mat, pmat = J.mat * if P is not None: pmat = P.mat * CHKERR( TSComputeI2Jacobian(self.ts, rval1, x.vec, xdot.vec, xdotdot.vec, rval2, rval3, # <<<<<<<<<<<<<< * jmat, pmat) ) * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSComputeI2Jacobian(__pyx_v_self->ts, __pyx_v_rval1, __pyx_v_x->vec, __pyx_v_xdot->vec, __pyx_v_xdotdot->vec, __pyx_v_rval2, __pyx_v_rval3, __pyx_v_jmat, __pyx_v_pmat)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1156, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":1110 * f.vec) ) * * def computeI2Jacobian( # <<<<<<<<<<<<<< * self, * t: float, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.computeI2Jacobian", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":1159 * jmat, pmat) ) * * def getI2Function(self) -> tuple[Vec, TSI2Function]: # <<<<<<<<<<<<<< * """Return the vector and function which computes the residual. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_91getI2Function(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_90getI2Function, "TS.getI2Function(self) -> tuple[Vec, TSI2Function]\nReturn the vector and function which computes the residual.\n\n Not collective.\n\n See Also\n --------\n petsc.TSGetI2Function\n\n \nSource code at petsc4py/PETSc/TS.pyx:1159"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_91getI2Function(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getI2Function (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getI2Function", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getI2Function", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_90getI2Function(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_90getI2Function(struct PyPetscTSObject *__pyx_v_self) { struct PyPetscVecObject *__pyx_v_f = 0; PyObject *__pyx_v_function = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getI2Function", 1); /* "petsc4py/PETSc/TS.pyx":1169 * * """ * cdef Vec f = Vec() # <<<<<<<<<<<<<< * CHKERR( TSGetI2Function(self.ts, &f.vec, NULL, NULL) ) * CHKERR( PetscINCREF(f.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 1169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_f = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/TS.pyx":1170 * """ * cdef Vec f = Vec() * CHKERR( TSGetI2Function(self.ts, &f.vec, NULL, NULL) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(f.obj) ) * cdef object function = self.get_attr('__i2function__') */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetI2Function(__pyx_v_self->ts, (&__pyx_v_f->vec), NULL, NULL)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1170, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":1171 * cdef Vec f = Vec() * CHKERR( TSGetI2Function(self.ts, &f.vec, NULL, NULL) ) * CHKERR( PetscINCREF(f.obj) ) # <<<<<<<<<<<<<< * cdef object function = self.get_attr('__i2function__') * return (f, function) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_f->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1171, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":1172 * CHKERR( TSGetI2Function(self.ts, &f.vec, NULL, NULL) ) * CHKERR( PetscINCREF(f.obj) ) * cdef object function = self.get_attr('__i2function__') # <<<<<<<<<<<<<< * return (f, function) * */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__i2function__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 1172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_function = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/TS.pyx":1173 * CHKERR( PetscINCREF(f.obj) ) * cdef object function = self.get_attr('__i2function__') * return (f, function) # <<<<<<<<<<<<<< * * def getI2Jacobian(self) -> tuple[Mat, Mat, TSI2Jacobian]: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 1173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF((PyObject *)__pyx_v_f); __Pyx_GIVEREF((PyObject *)__pyx_v_f); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_f))) __PYX_ERR(51, 1173, __pyx_L1_error); __Pyx_INCREF(__pyx_v_function); __Pyx_GIVEREF(__pyx_v_function); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_function)) __PYX_ERR(51, 1173, __pyx_L1_error); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TS.pyx":1159 * jmat, pmat) ) * * def getI2Function(self) -> tuple[Vec, TSI2Function]: # <<<<<<<<<<<<<< * """Return the vector and function which computes the residual. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TS.getI2Function", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_f); __Pyx_XDECREF(__pyx_v_function); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":1175 * return (f, function) * * def getI2Jacobian(self) -> tuple[Mat, Mat, TSI2Jacobian]: # <<<<<<<<<<<<<< * """Return the matrices and function which computes the Jacobian. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_93getI2Jacobian(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_92getI2Jacobian, "TS.getI2Jacobian(self) -> tuple[Mat, Mat, TSI2Jacobian]\nReturn the matrices and function which computes the Jacobian.\n\n Not collective.\n\n See Also\n --------\n petsc.TSGetI2Jacobian\n\n \nSource code at petsc4py/PETSc/TS.pyx:1175"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_93getI2Jacobian(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getI2Jacobian (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getI2Jacobian", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getI2Jacobian", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_92getI2Jacobian(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_92getI2Jacobian(struct PyPetscTSObject *__pyx_v_self) { struct PyPetscMatObject *__pyx_v_J = 0; struct PyPetscMatObject *__pyx_v_P = 0; PyObject *__pyx_v_jacobian = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getI2Jacobian", 1); /* "petsc4py/PETSc/TS.pyx":1185 * * """ * cdef Mat J = Mat(), P = Mat() # <<<<<<<<<<<<<< * CHKERR( TSGetI2Jacobian(self.ts, &J.mat, &P.mat, NULL, NULL) ) * CHKERR( PetscINCREF(J.obj) ); CHKERR( PetscINCREF(P.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 1185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_J = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 1185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_P = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/TS.pyx":1186 * """ * cdef Mat J = Mat(), P = Mat() * CHKERR( TSGetI2Jacobian(self.ts, &J.mat, &P.mat, NULL, NULL) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(J.obj) ); CHKERR( PetscINCREF(P.obj) ) * cdef object jacobian = self.get_attr('__i2jacobian__') */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetI2Jacobian(__pyx_v_self->ts, (&__pyx_v_J->mat), (&__pyx_v_P->mat), NULL, NULL)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1186, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":1187 * cdef Mat J = Mat(), P = Mat() * CHKERR( TSGetI2Jacobian(self.ts, &J.mat, &P.mat, NULL, NULL) ) * CHKERR( PetscINCREF(J.obj) ); CHKERR( PetscINCREF(P.obj) ) # <<<<<<<<<<<<<< * cdef object jacobian = self.get_attr('__i2jacobian__') * return (J, P, jacobian) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_J->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1187, __pyx_L1_error) __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_P->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1187, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":1188 * CHKERR( TSGetI2Jacobian(self.ts, &J.mat, &P.mat, NULL, NULL) ) * CHKERR( PetscINCREF(J.obj) ); CHKERR( PetscINCREF(P.obj) ) * cdef object jacobian = self.get_attr('__i2jacobian__') # <<<<<<<<<<<<<< * return (J, P, jacobian) * */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__i2jacobian__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 1188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_jacobian = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/TS.pyx":1189 * CHKERR( PetscINCREF(J.obj) ); CHKERR( PetscINCREF(P.obj) ) * cdef object jacobian = self.get_attr('__i2jacobian__') * return (J, P, jacobian) # <<<<<<<<<<<<<< * * # --- solution vector --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 1189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF((PyObject *)__pyx_v_J); __Pyx_GIVEREF((PyObject *)__pyx_v_J); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_J))) __PYX_ERR(51, 1189, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_P); __Pyx_GIVEREF((PyObject *)__pyx_v_P); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_P))) __PYX_ERR(51, 1189, __pyx_L1_error); __Pyx_INCREF(__pyx_v_jacobian); __Pyx_GIVEREF(__pyx_v_jacobian); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_jacobian)) __PYX_ERR(51, 1189, __pyx_L1_error); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TS.pyx":1175 * return (f, function) * * def getI2Jacobian(self) -> tuple[Mat, Mat, TSI2Jacobian]: # <<<<<<<<<<<<<< * """Return the matrices and function which computes the Jacobian. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TS.getI2Jacobian", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_J); __Pyx_XDECREF((PyObject *)__pyx_v_P); __Pyx_XDECREF(__pyx_v_jacobian); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":1193 * # --- solution vector --- * * def setSolution(self, Vec u) -> None: # <<<<<<<<<<<<<< * """Set the initial solution vector. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_95setSolution(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_94setSolution, "TS.setSolution(self, u: Vec) -> None\nSet the initial solution vector.\n\n Logically collective.\n\n Parameters\n ----------\n u\n The solution vector.\n\n See Also\n --------\n petsc.TSSetSolution\n\n \nSource code at petsc4py/PETSc/TS.pyx:1193"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_95setSolution(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_u = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setSolution (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_u,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_u)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 1193, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setSolution") < 0)) __PYX_ERR(51, 1193, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_u = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setSolution", 1, 1, 1, __pyx_nargs); __PYX_ERR(51, 1193, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TS.setSolution", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_u), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "u", 0))) __PYX_ERR(51, 1193, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_94setSolution(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_u); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_94setSolution(struct PyPetscTSObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_u) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setSolution", 1); /* "petsc4py/PETSc/TS.pyx":1208 * * """ * CHKERR( TSSetSolution(self.ts, u.vec) ) # <<<<<<<<<<<<<< * * def getSolution(self) -> Vec: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetSolution(__pyx_v_self->ts, __pyx_v_u->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1208, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":1193 * # --- solution vector --- * * def setSolution(self, Vec u) -> None: # <<<<<<<<<<<<<< * """Set the initial solution vector. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setSolution", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":1210 * CHKERR( TSSetSolution(self.ts, u.vec) ) * * def getSolution(self) -> Vec: # <<<<<<<<<<<<<< * """Return the solution at the present timestep. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_97getSolution(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_96getSolution, "TS.getSolution(self) -> Vec\nReturn the solution at the present timestep.\n\n Not collective.\n\n It is valid to call this routine inside the function that you are\n evaluating in order to move to the new timestep. This vector is not\n changed until the solution at the next timestep has been calculated.\n\n See Also\n --------\n petsc.TSGetSolution\n\n \nSource code at petsc4py/PETSc/TS.pyx:1210"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_97getSolution(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSolution (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getSolution", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getSolution", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_96getSolution(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_96getSolution(struct PyPetscTSObject *__pyx_v_self) { struct PyPetscVecObject *__pyx_v_u = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSolution", 1); /* "petsc4py/PETSc/TS.pyx":1224 * * """ * cdef Vec u = Vec() # <<<<<<<<<<<<<< * CHKERR( TSGetSolution(self.ts, &u.vec) ) * CHKERR( PetscINCREF(u.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 1224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_u = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/TS.pyx":1225 * """ * cdef Vec u = Vec() * CHKERR( TSGetSolution(self.ts, &u.vec) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(u.obj) ) * return u */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetSolution(__pyx_v_self->ts, (&__pyx_v_u->vec))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1225, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":1226 * cdef Vec u = Vec() * CHKERR( TSGetSolution(self.ts, &u.vec) ) * CHKERR( PetscINCREF(u.obj) ) # <<<<<<<<<<<<<< * return u * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_u->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1226, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":1227 * CHKERR( TSGetSolution(self.ts, &u.vec) ) * CHKERR( PetscINCREF(u.obj) ) * return u # <<<<<<<<<<<<<< * * def setSolution2(self, Vec u, Vec v) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_u); __pyx_r = ((PyObject *)__pyx_v_u); goto __pyx_L0; /* "petsc4py/PETSc/TS.pyx":1210 * CHKERR( TSSetSolution(self.ts, u.vec) ) * * def getSolution(self) -> Vec: # <<<<<<<<<<<<<< * """Return the solution at the present timestep. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TS.getSolution", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_u); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":1229 * return u * * def setSolution2(self, Vec u, Vec v) -> None: # <<<<<<<<<<<<<< * """Set the initial solution and its time derivative. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_99setSolution2(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_98setSolution2, "TS.setSolution2(self, u: Vec, v: Vec) -> None\nSet the initial solution and its time derivative.\n\n Logically collective.\n\n Parameters\n ----------\n u\n The solution vector.\n v\n The time derivative vector.\n\n See Also\n --------\n petsc.TS2SetSolution\n\n \nSource code at petsc4py/PETSc/TS.pyx:1229"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_99setSolution2(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_u = 0; struct PyPetscVecObject *__pyx_v_v = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setSolution2 (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_u,&__pyx_n_s_v,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_u)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 1229, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_v)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 1229, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setSolution2", 1, 2, 2, 1); __PYX_ERR(51, 1229, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setSolution2") < 0)) __PYX_ERR(51, 1229, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_u = ((struct PyPetscVecObject *)values[0]); __pyx_v_v = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setSolution2", 1, 2, 2, __pyx_nargs); __PYX_ERR(51, 1229, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TS.setSolution2", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_u), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "u", 0))) __PYX_ERR(51, 1229, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "v", 0))) __PYX_ERR(51, 1229, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_98setSolution2(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_u, __pyx_v_v); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_98setSolution2(struct PyPetscTSObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_u, struct PyPetscVecObject *__pyx_v_v) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setSolution2", 1); /* "petsc4py/PETSc/TS.pyx":1246 * * """ * CHKERR( TS2SetSolution(self.ts, u.vec, v.vec) ) # <<<<<<<<<<<<<< * * def getSolution2(self) -> tuple[Vec, Vec]: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TS2SetSolution(__pyx_v_self->ts, __pyx_v_u->vec, __pyx_v_v->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1246, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":1229 * return u * * def setSolution2(self, Vec u, Vec v) -> None: # <<<<<<<<<<<<<< * """Set the initial solution and its time derivative. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setSolution2", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":1248 * CHKERR( TS2SetSolution(self.ts, u.vec, v.vec) ) * * def getSolution2(self) -> tuple[Vec, Vec]: # <<<<<<<<<<<<<< * """Return the solution and time derivative at the present timestep. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_101getSolution2(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_100getSolution2, "TS.getSolution2(self) -> tuple[Vec, Vec]\nReturn the solution and time derivative at the present timestep.\n\n Not collective.\n\n It is valid to call this routine inside the function that you are\n evaluating in order to move to the new timestep. These vectors are not\n changed until the solution at the next timestep has been calculated.\n\n See Also\n --------\n petsc.TS2GetSolution\n\n \nSource code at petsc4py/PETSc/TS.pyx:1248"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_101getSolution2(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSolution2 (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getSolution2", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getSolution2", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_100getSolution2(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_100getSolution2(struct PyPetscTSObject *__pyx_v_self) { struct PyPetscVecObject *__pyx_v_u = 0; struct PyPetscVecObject *__pyx_v_v = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSolution2", 1); /* "petsc4py/PETSc/TS.pyx":1262 * * """ * cdef Vec u = Vec() # <<<<<<<<<<<<<< * cdef Vec v = Vec() * CHKERR( TS2GetSolution(self.ts, &u.vec, &v.vec) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 1262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_u = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/TS.pyx":1263 * """ * cdef Vec u = Vec() * cdef Vec v = Vec() # <<<<<<<<<<<<<< * CHKERR( TS2GetSolution(self.ts, &u.vec, &v.vec) ) * CHKERR( PetscINCREF(u.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 1263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/TS.pyx":1264 * cdef Vec u = Vec() * cdef Vec v = Vec() * CHKERR( TS2GetSolution(self.ts, &u.vec, &v.vec) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(u.obj) ) * CHKERR( PetscINCREF(v.obj) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TS2GetSolution(__pyx_v_self->ts, (&__pyx_v_u->vec), (&__pyx_v_v->vec))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1264, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":1265 * cdef Vec v = Vec() * CHKERR( TS2GetSolution(self.ts, &u.vec, &v.vec) ) * CHKERR( PetscINCREF(u.obj) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(v.obj) ) * return (u, v) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_u->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1265, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":1266 * CHKERR( TS2GetSolution(self.ts, &u.vec, &v.vec) ) * CHKERR( PetscINCREF(u.obj) ) * CHKERR( PetscINCREF(v.obj) ) # <<<<<<<<<<<<<< * return (u, v) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_v->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1266, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":1267 * CHKERR( PetscINCREF(u.obj) ) * CHKERR( PetscINCREF(v.obj) ) * return (u, v) # <<<<<<<<<<<<<< * * # --- time span --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 1267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF((PyObject *)__pyx_v_u); __Pyx_GIVEREF((PyObject *)__pyx_v_u); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_u))) __PYX_ERR(51, 1267, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_v); __Pyx_GIVEREF((PyObject *)__pyx_v_v); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_v))) __PYX_ERR(51, 1267, __pyx_L1_error); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TS.pyx":1248 * CHKERR( TS2SetSolution(self.ts, u.vec, v.vec) ) * * def getSolution2(self) -> tuple[Vec, Vec]: # <<<<<<<<<<<<<< * """Return the solution and time derivative at the present timestep. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TS.getSolution2", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_u); __Pyx_XDECREF((PyObject *)__pyx_v_v); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":1271 * # --- time span --- * * def setTimeSpan(self, tspan: Sequence[float]) -> None: # <<<<<<<<<<<<<< * """Set the time span. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_103setTimeSpan(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_102setTimeSpan, "TS.setTimeSpan(self, tspan: Sequence[float]) -> None\nSet the time span.\n\n Collective.\n\n The solution will be computed and stored for each time\n requested in the span. The times must be all increasing and correspond\n to the intermediate points for time integration.\n `ExactFinalTime.MATCHSTEP` must be used to make the last time step in\n each sub-interval match the intermediate points specified. The\n intermediate solutions are saved in a vector array that can be accessed\n with `getTimeSpanSolutions`.\n\n Parameters\n ----------\n tspan\n The sequence of time points.\n\n Notes\n -----\n ``-ts_time_span `` sets the time span from the commandline\n\n See Also\n --------\n petsc.TSSetTimeSpan\n\n \nSource code at petsc4py/PETSc/TS.pyx:1271"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_103setTimeSpan(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_tspan = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setTimeSpan (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tspan,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_tspan)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 1271, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setTimeSpan") < 0)) __PYX_ERR(51, 1271, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_tspan = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setTimeSpan", 1, 1, 1, __pyx_nargs); __PYX_ERR(51, 1271, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TS.setTimeSpan", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_102setTimeSpan(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_tspan); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_102setTimeSpan(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_tspan) { PetscInt __pyx_v_nt; PetscReal *__pyx_v_rtspan; CYTHON_UNUSED PyObject *__pyx_v_tmp = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setTimeSpan", 1); /* "petsc4py/PETSc/TS.pyx":1298 * * """ * cdef PetscInt nt = 0 # <<<<<<<<<<<<<< * cdef PetscReal *rtspan = NULL * cdef object tmp = oarray_r(tspan, &nt, &rtspan) */ __pyx_v_nt = 0; /* "petsc4py/PETSc/TS.pyx":1299 * """ * cdef PetscInt nt = 0 * cdef PetscReal *rtspan = NULL # <<<<<<<<<<<<<< * cdef object tmp = oarray_r(tspan, &nt, &rtspan) * CHKERR( TSSetTimeSpan(self.ts, nt, rtspan) ) */ __pyx_v_rtspan = NULL; /* "petsc4py/PETSc/TS.pyx":1300 * cdef PetscInt nt = 0 * cdef PetscReal *rtspan = NULL * cdef object tmp = oarray_r(tspan, &nt, &rtspan) # <<<<<<<<<<<<<< * CHKERR( TSSetTimeSpan(self.ts, nt, rtspan) ) * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_r(__pyx_v_tspan, (&__pyx_v_nt), (&__pyx_v_rtspan))); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 1300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_tmp = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/TS.pyx":1301 * cdef PetscReal *rtspan = NULL * cdef object tmp = oarray_r(tspan, &nt, &rtspan) * CHKERR( TSSetTimeSpan(self.ts, nt, rtspan) ) # <<<<<<<<<<<<<< * * def getTimeSpan(self) -> ArrayReal: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetTimeSpan(__pyx_v_self->ts, __pyx_v_nt, __pyx_v_rtspan)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1301, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":1271 * # --- time span --- * * def setTimeSpan(self, tspan: Sequence[float]) -> None: # <<<<<<<<<<<<<< * """Set the time span. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TS.setTimeSpan", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_tmp); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":1303 * CHKERR( TSSetTimeSpan(self.ts, nt, rtspan) ) * * def getTimeSpan(self) -> ArrayReal: # <<<<<<<<<<<<<< * """Return the time span. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_105getTimeSpan(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_104getTimeSpan, "TS.getTimeSpan(self) -> ArrayReal\nReturn the time span.\n\n Not collective.\n\n See Also\n --------\n petsc.TSGetTimeSpan\n\n \nSource code at petsc4py/PETSc/TS.pyx:1303"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_105getTimeSpan(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getTimeSpan (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getTimeSpan", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getTimeSpan", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_104getTimeSpan(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_104getTimeSpan(struct PyPetscTSObject *__pyx_v_self) { PetscReal const *__pyx_v_rtspan; PetscInt __pyx_v_nt; PyObject *__pyx_v_tspan = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getTimeSpan", 1); /* "petsc4py/PETSc/TS.pyx":1313 * * """ * cdef const PetscReal *rtspan = NULL # <<<<<<<<<<<<<< * cdef PetscInt nt = 0 * CHKERR( TSGetTimeSpan(self.ts, &nt, &rtspan) ) */ __pyx_v_rtspan = NULL; /* "petsc4py/PETSc/TS.pyx":1314 * """ * cdef const PetscReal *rtspan = NULL * cdef PetscInt nt = 0 # <<<<<<<<<<<<<< * CHKERR( TSGetTimeSpan(self.ts, &nt, &rtspan) ) * cdef object tspan = array_r(nt, rtspan) */ __pyx_v_nt = 0; /* "petsc4py/PETSc/TS.pyx":1315 * cdef const PetscReal *rtspan = NULL * cdef PetscInt nt = 0 * CHKERR( TSGetTimeSpan(self.ts, &nt, &rtspan) ) # <<<<<<<<<<<<<< * cdef object tspan = array_r(nt, rtspan) * return tspan */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetTimeSpan(__pyx_v_self->ts, (&__pyx_v_nt), (&__pyx_v_rtspan))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1315, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":1316 * cdef PetscInt nt = 0 * CHKERR( TSGetTimeSpan(self.ts, &nt, &rtspan) ) * cdef object tspan = array_r(nt, rtspan) # <<<<<<<<<<<<<< * return tspan * */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_r(__pyx_v_nt, __pyx_v_rtspan)); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 1316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_tspan = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/TS.pyx":1317 * CHKERR( TSGetTimeSpan(self.ts, &nt, &rtspan) ) * cdef object tspan = array_r(nt, rtspan) * return tspan # <<<<<<<<<<<<<< * * def getTimeSpanSolutions(self) -> list[Vec]: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_tspan); __pyx_r = __pyx_v_tspan; goto __pyx_L0; /* "petsc4py/PETSc/TS.pyx":1303 * CHKERR( TSSetTimeSpan(self.ts, nt, rtspan) ) * * def getTimeSpan(self) -> ArrayReal: # <<<<<<<<<<<<<< * """Return the time span. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TS.getTimeSpan", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_tspan); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":1319 * return tspan * * def getTimeSpanSolutions(self) -> list[Vec]: # <<<<<<<<<<<<<< * """Return the solutions at the times in the time span. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_107getTimeSpanSolutions(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_106getTimeSpanSolutions, "TS.getTimeSpanSolutions(self) -> list[Vec]\nReturn the solutions at the times in the time span.\n\n See Also\n --------\n setTimeSpan, petsc.TSGetTimeSpanSolutions\n\n \nSource code at petsc4py/PETSc/TS.pyx:1319"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_107getTimeSpanSolutions(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getTimeSpanSolutions (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getTimeSpanSolutions", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getTimeSpanSolutions", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_106getTimeSpanSolutions(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_106getTimeSpanSolutions(struct PyPetscTSObject *__pyx_v_self) { PetscInt __pyx_v_nt; Vec *__pyx_v_sols; PyObject *__pyx_v_sollist = 0; long __pyx_9genexpr11__pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PetscInt __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getTimeSpanSolutions", 1); /* "petsc4py/PETSc/TS.pyx":1327 * * """ * cdef PetscInt nt = 0 # <<<<<<<<<<<<<< * cdef PetscVec *sols = NULL * CHKERR( TSGetTimeSpanSolutions(self.ts, &nt, &sols) ) */ __pyx_v_nt = 0; /* "petsc4py/PETSc/TS.pyx":1328 * """ * cdef PetscInt nt = 0 * cdef PetscVec *sols = NULL # <<<<<<<<<<<<<< * CHKERR( TSGetTimeSpanSolutions(self.ts, &nt, &sols) ) * cdef object sollist = None */ __pyx_v_sols = NULL; /* "petsc4py/PETSc/TS.pyx":1329 * cdef PetscInt nt = 0 * cdef PetscVec *sols = NULL * CHKERR( TSGetTimeSpanSolutions(self.ts, &nt, &sols) ) # <<<<<<<<<<<<<< * cdef object sollist = None * if sols != NULL: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetTimeSpanSolutions(__pyx_v_self->ts, (&__pyx_v_nt), (&__pyx_v_sols))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1329, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":1330 * cdef PetscVec *sols = NULL * CHKERR( TSGetTimeSpanSolutions(self.ts, &nt, &sols) ) * cdef object sollist = None # <<<<<<<<<<<<<< * if sols != NULL: * sollist = [ref_Vec(sols[i]) for i from 0 <= i < nt] */ __Pyx_INCREF(Py_None); __pyx_v_sollist = Py_None; /* "petsc4py/PETSc/TS.pyx":1331 * CHKERR( TSGetTimeSpanSolutions(self.ts, &nt, &sols) ) * cdef object sollist = None * if sols != NULL: # <<<<<<<<<<<<<< * sollist = [ref_Vec(sols[i]) for i from 0 <= i < nt] * return sollist */ __pyx_t_2 = (__pyx_v_sols != NULL); if (__pyx_t_2) { /* "petsc4py/PETSc/TS.pyx":1332 * cdef object sollist = None * if sols != NULL: * sollist = [ref_Vec(sols[i]) for i from 0 <= i < nt] # <<<<<<<<<<<<<< * return sollist * */ { /* enter inner scope */ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 1332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_v_nt; for (__pyx_9genexpr11__pyx_v_i = 0; __pyx_9genexpr11__pyx_v_i < __pyx_t_4; __pyx_9genexpr11__pyx_v_i++) { __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec((__pyx_v_sols[__pyx_9genexpr11__pyx_v_i]))); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 1332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_5))) __PYX_ERR(51, 1332, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } } /* exit inner scope */ __Pyx_DECREF_SET(__pyx_v_sollist, __pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/TS.pyx":1331 * CHKERR( TSGetTimeSpanSolutions(self.ts, &nt, &sols) ) * cdef object sollist = None * if sols != NULL: # <<<<<<<<<<<<<< * sollist = [ref_Vec(sols[i]) for i from 0 <= i < nt] * return sollist */ } /* "petsc4py/PETSc/TS.pyx":1333 * if sols != NULL: * sollist = [ref_Vec(sols[i]) for i from 0 <= i < nt] * return sollist # <<<<<<<<<<<<<< * * # --- inner solver --- */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_sollist); __pyx_r = __pyx_v_sollist; goto __pyx_L0; /* "petsc4py/PETSc/TS.pyx":1319 * return tspan * * def getTimeSpanSolutions(self) -> list[Vec]: # <<<<<<<<<<<<<< * """Return the solutions at the times in the time span. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.TS.getTimeSpanSolutions", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_sollist); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":1337 * # --- inner solver --- * * def getSNES(self) -> SNES: # <<<<<<<<<<<<<< * """Return the `SNES` associated with the `TS`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_109getSNES(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_108getSNES, "TS.getSNES(self) -> SNES\nReturn the `SNES` associated with the `TS`.\n\n Not collective.\n\n See Also\n --------\n petsc.TSGetSNES\n\n \nSource code at petsc4py/PETSc/TS.pyx:1337"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_109getSNES(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSNES (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getSNES", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getSNES", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_108getSNES(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_108getSNES(struct PyPetscTSObject *__pyx_v_self) { struct PyPetscSNESObject *__pyx_v_snes = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSNES", 1); /* "petsc4py/PETSc/TS.pyx":1347 * * """ * cdef SNES snes = SNES() # <<<<<<<<<<<<<< * CHKERR( TSGetSNES(self.ts, &snes.snes) ) * CHKERR( PetscINCREF(snes.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SNES)); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 1347, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_snes = ((struct PyPetscSNESObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/TS.pyx":1348 * """ * cdef SNES snes = SNES() * CHKERR( TSGetSNES(self.ts, &snes.snes) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(snes.obj) ) * return snes */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetSNES(__pyx_v_self->ts, (&__pyx_v_snes->snes))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1348, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":1349 * cdef SNES snes = SNES() * CHKERR( TSGetSNES(self.ts, &snes.snes) ) * CHKERR( PetscINCREF(snes.obj) ) # <<<<<<<<<<<<<< * return snes * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_snes->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1349, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":1350 * CHKERR( TSGetSNES(self.ts, &snes.snes) ) * CHKERR( PetscINCREF(snes.obj) ) * return snes # <<<<<<<<<<<<<< * * def getKSP(self) -> KSP: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_snes); __pyx_r = ((PyObject *)__pyx_v_snes); goto __pyx_L0; /* "petsc4py/PETSc/TS.pyx":1337 * # --- inner solver --- * * def getSNES(self) -> SNES: # <<<<<<<<<<<<<< * """Return the `SNES` associated with the `TS`. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TS.getSNES", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_snes); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":1352 * return snes * * def getKSP(self) -> KSP: # <<<<<<<<<<<<<< * """Return the `KSP` associated with the `TS`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_111getKSP(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_110getKSP, "TS.getKSP(self) -> KSP\nReturn the `KSP` associated with the `TS`.\n\n Not collective.\n\n See Also\n --------\n petsc.TSGetKSP\n\n \nSource code at petsc4py/PETSc/TS.pyx:1352"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_111getKSP(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getKSP (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getKSP", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getKSP", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_110getKSP(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_110getKSP(struct PyPetscTSObject *__pyx_v_self) { struct PyPetscKSPObject *__pyx_v_ksp = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getKSP", 1); /* "petsc4py/PETSc/TS.pyx":1362 * * """ * cdef KSP ksp = KSP() # <<<<<<<<<<<<<< * CHKERR( TSGetKSP(self.ts, &ksp.ksp) ) * CHKERR( PetscINCREF(ksp.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_KSP)); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 1362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ksp = ((struct PyPetscKSPObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/TS.pyx":1363 * """ * cdef KSP ksp = KSP() * CHKERR( TSGetKSP(self.ts, &ksp.ksp) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(ksp.obj) ) * return ksp */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetKSP(__pyx_v_self->ts, (&__pyx_v_ksp->ksp))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1363, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":1364 * cdef KSP ksp = KSP() * CHKERR( TSGetKSP(self.ts, &ksp.ksp) ) * CHKERR( PetscINCREF(ksp.obj) ) # <<<<<<<<<<<<<< * return ksp * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ksp->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1364, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":1365 * CHKERR( TSGetKSP(self.ts, &ksp.ksp) ) * CHKERR( PetscINCREF(ksp.obj) ) * return ksp # <<<<<<<<<<<<<< * * # --- discretization space --- */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_ksp); __pyx_r = ((PyObject *)__pyx_v_ksp); goto __pyx_L0; /* "petsc4py/PETSc/TS.pyx":1352 * return snes * * def getKSP(self) -> KSP: # <<<<<<<<<<<<<< * """Return the `KSP` associated with the `TS`. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TS.getKSP", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ksp); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":1369 * # --- discretization space --- * * def getDM(self) -> DM: # <<<<<<<<<<<<<< * """Return the `DM` associated with the `TS`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_113getDM(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_112getDM, "TS.getDM(self) -> DM\nReturn the `DM` associated with the `TS`.\n\n Not collective.\n\n Only valid if nonlinear solvers or preconditioners are\n used which use the `DM`.\n\n See Also\n --------\n petsc.TSGetDM\n\n \nSource code at petsc4py/PETSc/TS.pyx:1369"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_113getDM(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getDM (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getDM", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getDM", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_112getDM(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_112getDM(struct PyPetscTSObject *__pyx_v_self) { DM __pyx_v_newdm; struct PyPetscDMObject *__pyx_v_dm = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getDM", 1); /* "petsc4py/PETSc/TS.pyx":1382 * * """ * cdef PetscDM newdm = NULL # <<<<<<<<<<<<<< * CHKERR( TSGetDM(self.ts, &newdm) ) * cdef DM dm = subtype_DM(newdm)() */ __pyx_v_newdm = NULL; /* "petsc4py/PETSc/TS.pyx":1383 * """ * cdef PetscDM newdm = NULL * CHKERR( TSGetDM(self.ts, &newdm) ) # <<<<<<<<<<<<<< * cdef DM dm = subtype_DM(newdm)() * dm.dm = newdm */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetDM(__pyx_v_self->ts, (&__pyx_v_newdm))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1383, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":1384 * cdef PetscDM newdm = NULL * CHKERR( TSGetDM(self.ts, &newdm) ) * cdef DM dm = subtype_DM(newdm)() # <<<<<<<<<<<<<< * dm.dm = newdm * CHKERR( PetscINCREF(dm.obj) ) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_newdm)); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 1384, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 1384, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(51, 1384, __pyx_L1_error) __pyx_v_dm = ((struct PyPetscDMObject *)__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/TS.pyx":1385 * CHKERR( TSGetDM(self.ts, &newdm) ) * cdef DM dm = subtype_DM(newdm)() * dm.dm = newdm # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(dm.obj) ) * return dm */ __pyx_v_dm->dm = __pyx_v_newdm; /* "petsc4py/PETSc/TS.pyx":1386 * cdef DM dm = subtype_DM(newdm)() * dm.dm = newdm * CHKERR( PetscINCREF(dm.obj) ) # <<<<<<<<<<<<<< * return dm * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_dm->__pyx_base.obj)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1386, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":1387 * dm.dm = newdm * CHKERR( PetscINCREF(dm.obj) ) * return dm # <<<<<<<<<<<<<< * * def setDM(self, DM dm) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_dm); __pyx_r = ((PyObject *)__pyx_v_dm); goto __pyx_L0; /* "petsc4py/PETSc/TS.pyx":1369 * # --- discretization space --- * * def getDM(self) -> DM: # <<<<<<<<<<<<<< * """Return the `DM` associated with the `TS`. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.getDM", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_dm); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":1389 * return dm * * def setDM(self, DM dm) -> None: # <<<<<<<<<<<<<< * """Set the DM that may be used by some nonlinear solvers or preconditioners. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_115setDM(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_114setDM, "TS.setDM(self, dm: DM) -> None\nSet the DM that may be used by some nonlinear solvers or preconditioners.\n\n Logically collective.\n\n Parameters\n ----------\n dm\n The `DM` object.\n\n See Also\n --------\n petsc.TSSetDM\n\n \nSource code at petsc4py/PETSc/TS.pyx:1389"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_115setDM(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscDMObject *__pyx_v_dm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setDM (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dm,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dm)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 1389, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setDM") < 0)) __PYX_ERR(51, 1389, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_dm = ((struct PyPetscDMObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setDM", 1, 1, 1, __pyx_nargs); __PYX_ERR(51, 1389, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TS.setDM", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_ptype_8petsc4py_5PETSc_DM, 0, "dm", 0))) __PYX_ERR(51, 1389, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_114setDM(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_dm); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_114setDM(struct PyPetscTSObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setDM", 1); /* "petsc4py/PETSc/TS.pyx":1404 * * """ * CHKERR( TSSetDM(self.ts, dm.dm) ) # <<<<<<<<<<<<<< * * # --- customization --- */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetDM(__pyx_v_self->ts, __pyx_v_dm->dm)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1404, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":1389 * return dm * * def setDM(self, DM dm) -> None: # <<<<<<<<<<<<<< * """Set the DM that may be used by some nonlinear solvers or preconditioners. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setDM", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":1408 * # --- customization --- * * def setTime(self, t: float) -> None: # <<<<<<<<<<<<<< * """Set the time. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_117setTime(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_116setTime, "TS.setTime(self, t: float) -> None\nSet the time.\n\n Logically collective.\n\n Parameters\n ----------\n t\n The time.\n\n See Also\n --------\n petsc.TSSetTime\n\n \nSource code at petsc4py/PETSc/TS.pyx:1408"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_117setTime(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_t = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setTime (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 1408, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setTime") < 0)) __PYX_ERR(51, 1408, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_t = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setTime", 1, 1, 1, __pyx_nargs); __PYX_ERR(51, 1408, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TS.setTime", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_116setTime(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_t); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_116setTime(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_t) { PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setTime", 1); /* "petsc4py/PETSc/TS.pyx":1423 * * """ * cdef PetscReal rval = asReal(t) # <<<<<<<<<<<<<< * CHKERR( TSSetTime(self.ts, rval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_t); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(51, 1423, __pyx_L1_error) __pyx_v_rval = __pyx_t_1; /* "petsc4py/PETSc/TS.pyx":1424 * """ * cdef PetscReal rval = asReal(t) * CHKERR( TSSetTime(self.ts, rval) ) # <<<<<<<<<<<<<< * * def getTime(self) -> float: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetTime(__pyx_v_self->ts, __pyx_v_rval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1424, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":1408 * # --- customization --- * * def setTime(self, t: float) -> None: # <<<<<<<<<<<<<< * """Set the time. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setTime", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":1426 * CHKERR( TSSetTime(self.ts, rval) ) * * def getTime(self) -> float: # <<<<<<<<<<<<<< * """Return the time of the most recently completed step. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_119getTime(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_118getTime, "TS.getTime(self) -> float\nReturn the time of the most recently completed step.\n\n Not collective.\n\n When called during time step evaluation (e.g. during\n residual evaluation or via hooks set using `setPreStep` or\n `setPostStep`), the time returned is at the start of the step.\n\n See Also\n --------\n petsc.TSGetTime\n\n \nSource code at petsc4py/PETSc/TS.pyx:1426"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_119getTime(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getTime (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getTime", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getTime", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_118getTime(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_118getTime(struct PyPetscTSObject *__pyx_v_self) { PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getTime", 1); /* "petsc4py/PETSc/TS.pyx":1440 * * """ * cdef PetscReal rval = 0 # <<<<<<<<<<<<<< * CHKERR( TSGetTime(self.ts, &rval) ) * return toReal(rval) */ __pyx_v_rval = 0.0; /* "petsc4py/PETSc/TS.pyx":1441 * """ * cdef PetscReal rval = 0 * CHKERR( TSGetTime(self.ts, &rval) ) # <<<<<<<<<<<<<< * return toReal(rval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetTime(__pyx_v_self->ts, (&__pyx_v_rval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1441, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":1442 * cdef PetscReal rval = 0 * CHKERR( TSGetTime(self.ts, &rval) ) * return toReal(rval) # <<<<<<<<<<<<<< * * def getPrevTime(self) -> float: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_rval); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 1442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TS.pyx":1426 * CHKERR( TSSetTime(self.ts, rval) ) * * def getTime(self) -> float: # <<<<<<<<<<<<<< * """Return the time of the most recently completed step. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TS.getTime", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":1444 * return toReal(rval) * * def getPrevTime(self) -> float: # <<<<<<<<<<<<<< * """Return the starting time of the previously completed step. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_121getPrevTime(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_120getPrevTime, "TS.getPrevTime(self) -> float\nReturn the starting time of the previously completed step.\n\n Not collective.\n\n See Also\n --------\n petsc.TSGetPrevTime\n\n \nSource code at petsc4py/PETSc/TS.pyx:1444"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_121getPrevTime(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getPrevTime (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getPrevTime", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getPrevTime", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_120getPrevTime(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_120getPrevTime(struct PyPetscTSObject *__pyx_v_self) { PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getPrevTime", 1); /* "petsc4py/PETSc/TS.pyx":1454 * * """ * cdef PetscReal rval = 0 # <<<<<<<<<<<<<< * CHKERR( TSGetPrevTime(self.ts, &rval) ) * return toReal(rval) */ __pyx_v_rval = 0.0; /* "petsc4py/PETSc/TS.pyx":1455 * """ * cdef PetscReal rval = 0 * CHKERR( TSGetPrevTime(self.ts, &rval) ) # <<<<<<<<<<<<<< * return toReal(rval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetPrevTime(__pyx_v_self->ts, (&__pyx_v_rval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1455, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":1456 * cdef PetscReal rval = 0 * CHKERR( TSGetPrevTime(self.ts, &rval) ) * return toReal(rval) # <<<<<<<<<<<<<< * * def getSolveTime(self) -> float: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_rval); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 1456, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TS.pyx":1444 * return toReal(rval) * * def getPrevTime(self) -> float: # <<<<<<<<<<<<<< * """Return the starting time of the previously completed step. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TS.getPrevTime", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":1458 * return toReal(rval) * * def getSolveTime(self) -> float: # <<<<<<<<<<<<<< * """Return the time after a call to `solve`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_123getSolveTime(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_122getSolveTime, "TS.getSolveTime(self) -> float\nReturn the time after a call to `solve`.\n\n Not collective.\n\n This time corresponds to the final time set with\n `setMaxTime`.\n\n See Also\n --------\n petsc.TSGetSolveTime\n\n \nSource code at petsc4py/PETSc/TS.pyx:1458"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_123getSolveTime(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSolveTime (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getSolveTime", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getSolveTime", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_122getSolveTime(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_122getSolveTime(struct PyPetscTSObject *__pyx_v_self) { PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSolveTime", 1); /* "petsc4py/PETSc/TS.pyx":1471 * * """ * cdef PetscReal rval = 0 # <<<<<<<<<<<<<< * CHKERR( TSGetSolveTime(self.ts, &rval) ) * return toReal(rval) */ __pyx_v_rval = 0.0; /* "petsc4py/PETSc/TS.pyx":1472 * """ * cdef PetscReal rval = 0 * CHKERR( TSGetSolveTime(self.ts, &rval) ) # <<<<<<<<<<<<<< * return toReal(rval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetSolveTime(__pyx_v_self->ts, (&__pyx_v_rval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1472, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":1473 * cdef PetscReal rval = 0 * CHKERR( TSGetSolveTime(self.ts, &rval) ) * return toReal(rval) # <<<<<<<<<<<<<< * * def setTimeStep(self, time_step: float) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_rval); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 1473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TS.pyx":1458 * return toReal(rval) * * def getSolveTime(self) -> float: # <<<<<<<<<<<<<< * """Return the time after a call to `solve`. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TS.getSolveTime", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":1475 * return toReal(rval) * * def setTimeStep(self, time_step: float) -> None: # <<<<<<<<<<<<<< * """Set the duration of the timestep. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_125setTimeStep(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_124setTimeStep, "TS.setTimeStep(self, time_step: float) -> None\nSet the duration of the timestep.\n\n Logically collective.\n\n Parameters\n ----------\n time_step\n the duration of the timestep\n\n See Also\n --------\n petsc.TSSetTimeStep\n\n \nSource code at petsc4py/PETSc/TS.pyx:1475"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_125setTimeStep(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_time_step = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setTimeStep (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_time_step,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_time_step)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 1475, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setTimeStep") < 0)) __PYX_ERR(51, 1475, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_time_step = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setTimeStep", 1, 1, 1, __pyx_nargs); __PYX_ERR(51, 1475, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TS.setTimeStep", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_124setTimeStep(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_time_step); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_124setTimeStep(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_time_step) { PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setTimeStep", 1); /* "petsc4py/PETSc/TS.pyx":1490 * * """ * cdef PetscReal rval = asReal(time_step) # <<<<<<<<<<<<<< * CHKERR( TSSetTimeStep(self.ts, rval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_time_step); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(51, 1490, __pyx_L1_error) __pyx_v_rval = __pyx_t_1; /* "petsc4py/PETSc/TS.pyx":1491 * """ * cdef PetscReal rval = asReal(time_step) * CHKERR( TSSetTimeStep(self.ts, rval) ) # <<<<<<<<<<<<<< * * def getTimeStep(self) -> float: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetTimeStep(__pyx_v_self->ts, __pyx_v_rval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1491, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":1475 * return toReal(rval) * * def setTimeStep(self, time_step: float) -> None: # <<<<<<<<<<<<<< * """Set the duration of the timestep. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setTimeStep", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":1493 * CHKERR( TSSetTimeStep(self.ts, rval) ) * * def getTimeStep(self) -> float: # <<<<<<<<<<<<<< * """Return the duration of the current timestep. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_127getTimeStep(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_126getTimeStep, "TS.getTimeStep(self) -> float\nReturn the duration of the current timestep.\n\n Not collective.\n\n See Also\n --------\n petsc.TSGetTimeStep\n\n \nSource code at petsc4py/PETSc/TS.pyx:1493"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_127getTimeStep(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getTimeStep (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getTimeStep", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getTimeStep", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_126getTimeStep(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_126getTimeStep(struct PyPetscTSObject *__pyx_v_self) { PetscReal __pyx_v_tstep; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getTimeStep", 1); /* "petsc4py/PETSc/TS.pyx":1503 * * """ * cdef PetscReal tstep = 0 # <<<<<<<<<<<<<< * CHKERR( TSGetTimeStep(self.ts, &tstep) ) * return toReal(tstep) */ __pyx_v_tstep = 0.0; /* "petsc4py/PETSc/TS.pyx":1504 * """ * cdef PetscReal tstep = 0 * CHKERR( TSGetTimeStep(self.ts, &tstep) ) # <<<<<<<<<<<<<< * return toReal(tstep) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetTimeStep(__pyx_v_self->ts, (&__pyx_v_tstep))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1504, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":1505 * cdef PetscReal tstep = 0 * CHKERR( TSGetTimeStep(self.ts, &tstep) ) * return toReal(tstep) # <<<<<<<<<<<<<< * * def setStepNumber(self, step_number: int) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_tstep); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 1505, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TS.pyx":1493 * CHKERR( TSSetTimeStep(self.ts, rval) ) * * def getTimeStep(self) -> float: # <<<<<<<<<<<<<< * """Return the duration of the current timestep. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TS.getTimeStep", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":1507 * return toReal(tstep) * * def setStepNumber(self, step_number: int) -> None: # <<<<<<<<<<<<<< * """Set the number of steps completed. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_129setStepNumber(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_128setStepNumber, "TS.setStepNumber(self, step_number: int) -> None\nSet the number of steps completed.\n\n Logically collective.\n\n For most uses of the `TS` solvers the user need\n not explicitly call `setStepNumber`, as the step counter is\n appropriately updated in `solve`/`step`/`rollBack`. Power users may call\n this routine to reinitialize timestepping by setting the step counter to\n zero (and time to the initial time) to solve a similar problem with\n different initial conditions or parameters. It may also be used to\n continue timestepping from a previously interrupted run in such a way\n that `TS` monitors will be called with a initial nonzero step counter.\n\n Parameters\n ----------\n step_number\n the number of steps completed\n\n See Also\n --------\n petsc.TSSetStepNumber\n\n \nSource code at petsc4py/PETSc/TS.pyx:1507"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_129setStepNumber(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_step_number = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setStepNumber (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_step_number,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_step_number)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 1507, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setStepNumber") < 0)) __PYX_ERR(51, 1507, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_step_number = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setStepNumber", 1, 1, 1, __pyx_nargs); __PYX_ERR(51, 1507, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TS.setStepNumber", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_128setStepNumber(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_step_number); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_128setStepNumber(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_step_number) { PetscInt __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setStepNumber", 1); /* "petsc4py/PETSc/TS.pyx":1531 * * """ * cdef PetscInt ival = asInt(step_number) # <<<<<<<<<<<<<< * CHKERR( TSSetStepNumber(self.ts, ival) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_step_number); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(51, 1531, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "petsc4py/PETSc/TS.pyx":1532 * """ * cdef PetscInt ival = asInt(step_number) * CHKERR( TSSetStepNumber(self.ts, ival) ) # <<<<<<<<<<<<<< * * def getStepNumber(self) -> int: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetStepNumber(__pyx_v_self->ts, __pyx_v_ival)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1532, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":1507 * return toReal(tstep) * * def setStepNumber(self, step_number: int) -> None: # <<<<<<<<<<<<<< * """Set the number of steps completed. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setStepNumber", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":1534 * CHKERR( TSSetStepNumber(self.ts, ival) ) * * def getStepNumber(self) -> int: # <<<<<<<<<<<<<< * """Return the number of time steps completed. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_131getStepNumber(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_130getStepNumber, "TS.getStepNumber(self) -> int\nReturn the number of time steps completed.\n\n Not collective.\n\n See Also\n --------\n petsc.TSGetStepNumber\n\n \nSource code at petsc4py/PETSc/TS.pyx:1534"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_131getStepNumber(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getStepNumber (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getStepNumber", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getStepNumber", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_130getStepNumber(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_130getStepNumber(struct PyPetscTSObject *__pyx_v_self) { PetscInt __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getStepNumber", 1); /* "petsc4py/PETSc/TS.pyx":1544 * * """ * cdef PetscInt ival = 0 # <<<<<<<<<<<<<< * CHKERR( TSGetStepNumber(self.ts, &ival) ) * return toInt(ival) */ __pyx_v_ival = 0; /* "petsc4py/PETSc/TS.pyx":1545 * """ * cdef PetscInt ival = 0 * CHKERR( TSGetStepNumber(self.ts, &ival) ) # <<<<<<<<<<<<<< * return toInt(ival) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetStepNumber(__pyx_v_self->ts, (&__pyx_v_ival))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1545, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":1546 * cdef PetscInt ival = 0 * CHKERR( TSGetStepNumber(self.ts, &ival) ) * return toInt(ival) # <<<<<<<<<<<<<< * * def setMaxTime(self, max_time: float) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ival); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 1546, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TS.pyx":1534 * CHKERR( TSSetStepNumber(self.ts, ival) ) * * def getStepNumber(self) -> int: # <<<<<<<<<<<<<< * """Return the number of time steps completed. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TS.getStepNumber", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":1548 * return toInt(ival) * * def setMaxTime(self, max_time: float) -> None: # <<<<<<<<<<<<<< * """Set the maximum (final) time. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_133setMaxTime(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_132setMaxTime, "TS.setMaxTime(self, max_time: float) -> None\nSet the maximum (final) time.\n\n Logically collective.\n\n Parameters\n ----------\n max_time\n the final time\n\n Notes\n -----\n ``-ts_max_time`` sets the max time from the commandline\n\n See Also\n --------\n petsc.TSSetMaxTime\n\n \nSource code at petsc4py/PETSc/TS.pyx:1548"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_133setMaxTime(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_max_time = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setMaxTime (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_max_time,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_max_time)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 1548, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setMaxTime") < 0)) __PYX_ERR(51, 1548, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_max_time = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setMaxTime", 1, 1, 1, __pyx_nargs); __PYX_ERR(51, 1548, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TS.setMaxTime", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_132setMaxTime(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_max_time); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_132setMaxTime(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_max_time) { PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setMaxTime", 1); /* "petsc4py/PETSc/TS.pyx":1567 * * """ * cdef PetscReal rval = asReal(max_time) # <<<<<<<<<<<<<< * CHKERR( TSSetMaxTime(self.ts, rval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_max_time); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(51, 1567, __pyx_L1_error) __pyx_v_rval = __pyx_t_1; /* "petsc4py/PETSc/TS.pyx":1568 * """ * cdef PetscReal rval = asReal(max_time) * CHKERR( TSSetMaxTime(self.ts, rval) ) # <<<<<<<<<<<<<< * * def getMaxTime(self) -> float: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetMaxTime(__pyx_v_self->ts, __pyx_v_rval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1568, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":1548 * return toInt(ival) * * def setMaxTime(self, max_time: float) -> None: # <<<<<<<<<<<<<< * """Set the maximum (final) time. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setMaxTime", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":1570 * CHKERR( TSSetMaxTime(self.ts, rval) ) * * def getMaxTime(self) -> float: # <<<<<<<<<<<<<< * """Return the maximum (final) time. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_135getMaxTime(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_134getMaxTime, "TS.getMaxTime(self) -> float\nReturn the maximum (final) time.\n\n Not collective.\n\n Defaults to ``5``.\n\n See Also\n --------\n petsc.TSGetMaxTime\n\n \nSource code at petsc4py/PETSc/TS.pyx:1570"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_135getMaxTime(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getMaxTime (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getMaxTime", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getMaxTime", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_134getMaxTime(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_134getMaxTime(struct PyPetscTSObject *__pyx_v_self) { PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getMaxTime", 1); /* "petsc4py/PETSc/TS.pyx":1582 * * """ * cdef PetscReal rval = 0 # <<<<<<<<<<<<<< * CHKERR( TSGetMaxTime(self.ts, &rval) ) * return toReal(rval) */ __pyx_v_rval = 0.0; /* "petsc4py/PETSc/TS.pyx":1583 * """ * cdef PetscReal rval = 0 * CHKERR( TSGetMaxTime(self.ts, &rval) ) # <<<<<<<<<<<<<< * return toReal(rval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetMaxTime(__pyx_v_self->ts, (&__pyx_v_rval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1583, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":1584 * cdef PetscReal rval = 0 * CHKERR( TSGetMaxTime(self.ts, &rval) ) * return toReal(rval) # <<<<<<<<<<<<<< * * def setMaxSteps(self, max_steps: int) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_rval); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 1584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TS.pyx":1570 * CHKERR( TSSetMaxTime(self.ts, rval) ) * * def getMaxTime(self) -> float: # <<<<<<<<<<<<<< * """Return the maximum (final) time. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TS.getMaxTime", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":1586 * return toReal(rval) * * def setMaxSteps(self, max_steps: int) -> None: # <<<<<<<<<<<<<< * """Set the maximum number of steps to use. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_137setMaxSteps(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_136setMaxSteps, "TS.setMaxSteps(self, max_steps: int) -> None\nSet the maximum number of steps to use.\n\n Logically collective.\n\n Defaults to ``5000``.\n\n Parameters\n ----------\n max_steps\n The maximum number of steps to use.\n\n See Also\n --------\n petsc.TSSetMaxSteps\n\n \nSource code at petsc4py/PETSc/TS.pyx:1586"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_137setMaxSteps(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_max_steps = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setMaxSteps (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_max_steps,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_max_steps)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 1586, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setMaxSteps") < 0)) __PYX_ERR(51, 1586, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_max_steps = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setMaxSteps", 1, 1, 1, __pyx_nargs); __PYX_ERR(51, 1586, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TS.setMaxSteps", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_136setMaxSteps(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_max_steps); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_136setMaxSteps(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_max_steps) { PetscInt __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setMaxSteps", 1); /* "petsc4py/PETSc/TS.pyx":1603 * * """ * cdef PetscInt ival = asInt(max_steps) # <<<<<<<<<<<<<< * CHKERR( TSSetMaxSteps(self.ts, ival) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_max_steps); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(51, 1603, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "petsc4py/PETSc/TS.pyx":1604 * """ * cdef PetscInt ival = asInt(max_steps) * CHKERR( TSSetMaxSteps(self.ts, ival) ) # <<<<<<<<<<<<<< * * def getMaxSteps(self) -> int: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetMaxSteps(__pyx_v_self->ts, __pyx_v_ival)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1604, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":1586 * return toReal(rval) * * def setMaxSteps(self, max_steps: int) -> None: # <<<<<<<<<<<<<< * """Set the maximum number of steps to use. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setMaxSteps", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":1606 * CHKERR( TSSetMaxSteps(self.ts, ival) ) * * def getMaxSteps(self) -> int: # <<<<<<<<<<<<<< * """Return the maximum number of steps to use. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_139getMaxSteps(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_138getMaxSteps, "TS.getMaxSteps(self) -> int\nReturn the maximum number of steps to use.\n\n Not collective.\n\n See Also\n --------\n petsc.TSGetMaxSteps\n\n \nSource code at petsc4py/PETSc/TS.pyx:1606"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_139getMaxSteps(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getMaxSteps (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getMaxSteps", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getMaxSteps", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_138getMaxSteps(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_138getMaxSteps(struct PyPetscTSObject *__pyx_v_self) { PetscInt __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getMaxSteps", 1); /* "petsc4py/PETSc/TS.pyx":1616 * * """ * cdef PetscInt ival = 0 # <<<<<<<<<<<<<< * CHKERR( TSGetMaxSteps(self.ts, &ival) ) * return toInt(ival) */ __pyx_v_ival = 0; /* "petsc4py/PETSc/TS.pyx":1617 * """ * cdef PetscInt ival = 0 * CHKERR( TSGetMaxSteps(self.ts, &ival) ) # <<<<<<<<<<<<<< * return toInt(ival) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetMaxSteps(__pyx_v_self->ts, (&__pyx_v_ival))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1617, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":1618 * cdef PetscInt ival = 0 * CHKERR( TSGetMaxSteps(self.ts, &ival) ) * return toInt(ival) # <<<<<<<<<<<<<< * * def getSNESIterations(self) -> int: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ival); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 1618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TS.pyx":1606 * CHKERR( TSSetMaxSteps(self.ts, ival) ) * * def getMaxSteps(self) -> int: # <<<<<<<<<<<<<< * """Return the maximum number of steps to use. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TS.getMaxSteps", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":1620 * return toInt(ival) * * def getSNESIterations(self) -> int: # <<<<<<<<<<<<<< * """Return the total number of nonlinear iterations used by the `TS`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_141getSNESIterations(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_140getSNESIterations, "TS.getSNESIterations(self) -> int\nReturn the total number of nonlinear iterations used by the `TS`.\n\n Not collective.\n\n This counter is reset to zero for each successive call\n to `solve`.\n\n See Also\n --------\n petsc.TSGetSNESIterations\n\n \nSource code at petsc4py/PETSc/TS.pyx:1620"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_141getSNESIterations(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSNESIterations (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getSNESIterations", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getSNESIterations", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_140getSNESIterations(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_140getSNESIterations(struct PyPetscTSObject *__pyx_v_self) { PetscInt __pyx_v_n; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSNESIterations", 1); /* "petsc4py/PETSc/TS.pyx":1633 * * """ * cdef PetscInt n = 0 # <<<<<<<<<<<<<< * CHKERR( TSGetSNESIterations(self.ts, &n) ) * return toInt(n) */ __pyx_v_n = 0; /* "petsc4py/PETSc/TS.pyx":1634 * """ * cdef PetscInt n = 0 * CHKERR( TSGetSNESIterations(self.ts, &n) ) # <<<<<<<<<<<<<< * return toInt(n) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetSNESIterations(__pyx_v_self->ts, (&__pyx_v_n))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1634, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":1635 * cdef PetscInt n = 0 * CHKERR( TSGetSNESIterations(self.ts, &n) ) * return toInt(n) # <<<<<<<<<<<<<< * * def getKSPIterations(self) -> int: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 1635, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TS.pyx":1620 * return toInt(ival) * * def getSNESIterations(self) -> int: # <<<<<<<<<<<<<< * """Return the total number of nonlinear iterations used by the `TS`. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TS.getSNESIterations", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":1637 * return toInt(n) * * def getKSPIterations(self) -> int: # <<<<<<<<<<<<<< * """Return the total number of linear iterations used by the `TS`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_143getKSPIterations(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_142getKSPIterations, "TS.getKSPIterations(self) -> int\nReturn the total number of linear iterations used by the `TS`.\n\n Not collective.\n\n This counter is reset to zero for each successive call\n to `solve`.\n\n See Also\n --------\n petsc.TSGetKSPIterations\n\n \nSource code at petsc4py/PETSc/TS.pyx:1637"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_143getKSPIterations(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getKSPIterations (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getKSPIterations", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getKSPIterations", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_142getKSPIterations(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_142getKSPIterations(struct PyPetscTSObject *__pyx_v_self) { PetscInt __pyx_v_n; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getKSPIterations", 1); /* "petsc4py/PETSc/TS.pyx":1650 * * """ * cdef PetscInt n = 0 # <<<<<<<<<<<<<< * CHKERR( TSGetKSPIterations(self.ts, &n) ) * return toInt(n) */ __pyx_v_n = 0; /* "petsc4py/PETSc/TS.pyx":1651 * """ * cdef PetscInt n = 0 * CHKERR( TSGetKSPIterations(self.ts, &n) ) # <<<<<<<<<<<<<< * return toInt(n) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetKSPIterations(__pyx_v_self->ts, (&__pyx_v_n))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1651, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":1652 * cdef PetscInt n = 0 * CHKERR( TSGetKSPIterations(self.ts, &n) ) * return toInt(n) # <<<<<<<<<<<<<< * * def setMaxStepRejections(self, n: int) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 1652, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TS.pyx":1637 * return toInt(n) * * def getKSPIterations(self) -> int: # <<<<<<<<<<<<<< * """Return the total number of linear iterations used by the `TS`. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TS.getKSPIterations", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":1654 * return toInt(n) * * def setMaxStepRejections(self, n: int) -> None: # <<<<<<<<<<<<<< * """Set the maximum number of step rejections before a time step fails. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_145setMaxStepRejections(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_144setMaxStepRejections, "TS.setMaxStepRejections(self, n: int) -> None\nSet the maximum number of step rejections before a time step fails.\n\n Not collective.\n\n Parameters\n ----------\n n\n The maximum number of rejected steps, use ``-1`` for unlimited.\n\n Notes\n -----\n ``-ts_max_reject`` can be used to set this from the commandline\n\n See Also\n --------\n petsc.TSSetMaxStepRejections\n\n \nSource code at petsc4py/PETSc/TS.pyx:1654"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_145setMaxStepRejections(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_n = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setMaxStepRejections (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 1654, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setMaxStepRejections") < 0)) __PYX_ERR(51, 1654, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_n = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setMaxStepRejections", 1, 1, 1, __pyx_nargs); __PYX_ERR(51, 1654, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TS.setMaxStepRejections", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_144setMaxStepRejections(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_n); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_144setMaxStepRejections(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_n) { PetscInt __pyx_v_rej; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setMaxStepRejections", 1); /* "petsc4py/PETSc/TS.pyx":1673 * * """ * cdef PetscInt rej = asInt(n) # <<<<<<<<<<<<<< * CHKERR( TSSetMaxStepRejections(self.ts, rej)) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_n); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(51, 1673, __pyx_L1_error) __pyx_v_rej = __pyx_t_1; /* "petsc4py/PETSc/TS.pyx":1674 * """ * cdef PetscInt rej = asInt(n) * CHKERR( TSSetMaxStepRejections(self.ts, rej)) # <<<<<<<<<<<<<< * * #def getMaxStepRejections(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetMaxStepRejections(__pyx_v_self->ts, __pyx_v_rej)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1674, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":1654 * return toInt(n) * * def setMaxStepRejections(self, n: int) -> None: # <<<<<<<<<<<<<< * """Set the maximum number of step rejections before a time step fails. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setMaxStepRejections", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":1681 * # return toInt(n) * * def getStepRejections(self) -> int: # <<<<<<<<<<<<<< * """Return the total number of rejected steps. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_147getStepRejections(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_146getStepRejections, "TS.getStepRejections(self) -> int\nReturn the total number of rejected steps.\n\n Not collective.\n\n This counter is reset to zero for each successive call\n to `solve`.\n\n See Also\n --------\n petsc.TSGetStepRejections\n\n \nSource code at petsc4py/PETSc/TS.pyx:1681"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_147getStepRejections(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getStepRejections (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getStepRejections", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getStepRejections", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_146getStepRejections(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_146getStepRejections(struct PyPetscTSObject *__pyx_v_self) { PetscInt __pyx_v_n; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getStepRejections", 1); /* "petsc4py/PETSc/TS.pyx":1694 * * """ * cdef PetscInt n = 0 # <<<<<<<<<<<<<< * CHKERR( TSGetStepRejections(self.ts, &n) ) * return toInt(n) */ __pyx_v_n = 0; /* "petsc4py/PETSc/TS.pyx":1695 * """ * cdef PetscInt n = 0 * CHKERR( TSGetStepRejections(self.ts, &n) ) # <<<<<<<<<<<<<< * return toInt(n) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetStepRejections(__pyx_v_self->ts, (&__pyx_v_n))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1695, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":1696 * cdef PetscInt n = 0 * CHKERR( TSGetStepRejections(self.ts, &n) ) * return toInt(n) # <<<<<<<<<<<<<< * * def setMaxSNESFailures(self, n: int) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 1696, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TS.pyx":1681 * # return toInt(n) * * def getStepRejections(self) -> int: # <<<<<<<<<<<<<< * """Return the total number of rejected steps. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TS.getStepRejections", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":1698 * return toInt(n) * * def setMaxSNESFailures(self, n: int) -> None: # <<<<<<<<<<<<<< * """Set the maximum number of SNES solves failures allowed. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_149setMaxSNESFailures(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_148setMaxSNESFailures, "TS.setMaxSNESFailures(self, n: int) -> None\nSet the maximum number of SNES solves failures allowed.\n\n Not collective.\n\n Parameters\n ----------\n n\n The maximum number of failed nonlinear solver, use ``-1`` for unlimited.\n\n See Also\n --------\n petsc.TSSetMaxSNESFailures\n\n \nSource code at petsc4py/PETSc/TS.pyx:1698"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_149setMaxSNESFailures(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_n = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setMaxSNESFailures (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 1698, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setMaxSNESFailures") < 0)) __PYX_ERR(51, 1698, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_n = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setMaxSNESFailures", 1, 1, 1, __pyx_nargs); __PYX_ERR(51, 1698, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TS.setMaxSNESFailures", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_148setMaxSNESFailures(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_n); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_148setMaxSNESFailures(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_n) { PetscInt __pyx_v_fails; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setMaxSNESFailures", 1); /* "petsc4py/PETSc/TS.pyx":1713 * * """ * cdef PetscInt fails = asInt(n) # <<<<<<<<<<<<<< * CHKERR( TSSetMaxSNESFailures(self.ts, fails)) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_n); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(51, 1713, __pyx_L1_error) __pyx_v_fails = __pyx_t_1; /* "petsc4py/PETSc/TS.pyx":1714 * """ * cdef PetscInt fails = asInt(n) * CHKERR( TSSetMaxSNESFailures(self.ts, fails)) # <<<<<<<<<<<<<< * * #def getMaxSNESFailures(self, n): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetMaxSNESFailures(__pyx_v_self->ts, __pyx_v_fails)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1714, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":1698 * return toInt(n) * * def setMaxSNESFailures(self, n: int) -> None: # <<<<<<<<<<<<<< * """Set the maximum number of SNES solves failures allowed. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setMaxSNESFailures", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":1721 * # return toInt(n) * * def getSNESFailures(self) -> int: # <<<<<<<<<<<<<< * """Return the total number of failed `SNES` solves in the `TS`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_151getSNESFailures(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_150getSNESFailures, "TS.getSNESFailures(self) -> int\nReturn the total number of failed `SNES` solves in the `TS`.\n\n Not collective.\n\n This counter is reset to zero for each successive call\n to `solve`.\n\n See Also\n --------\n petsc.TSGetSNESFailures\n\n \nSource code at petsc4py/PETSc/TS.pyx:1721"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_151getSNESFailures(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSNESFailures (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getSNESFailures", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getSNESFailures", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_150getSNESFailures(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_150getSNESFailures(struct PyPetscTSObject *__pyx_v_self) { PetscInt __pyx_v_n; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSNESFailures", 1); /* "petsc4py/PETSc/TS.pyx":1734 * * """ * cdef PetscInt n = 0 # <<<<<<<<<<<<<< * CHKERR( TSGetSNESFailures(self.ts, &n) ) * return toInt(n) */ __pyx_v_n = 0; /* "petsc4py/PETSc/TS.pyx":1735 * """ * cdef PetscInt n = 0 * CHKERR( TSGetSNESFailures(self.ts, &n) ) # <<<<<<<<<<<<<< * return toInt(n) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetSNESFailures(__pyx_v_self->ts, (&__pyx_v_n))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1735, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":1736 * cdef PetscInt n = 0 * CHKERR( TSGetSNESFailures(self.ts, &n) ) * return toInt(n) # <<<<<<<<<<<<<< * * def setErrorIfStepFails(self, flag: bool=True) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 1736, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TS.pyx":1721 * # return toInt(n) * * def getSNESFailures(self) -> int: # <<<<<<<<<<<<<< * """Return the total number of failed `SNES` solves in the `TS`. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TS.getSNESFailures", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":1738 * return toInt(n) * * def setErrorIfStepFails(self, flag: bool=True) -> None: # <<<<<<<<<<<<<< * """Immediately error is no step succeeds. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_153setErrorIfStepFails(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_152setErrorIfStepFails, "TS.setErrorIfStepFails(self, flag: bool = True) -> None\nImmediately error is no step succeeds.\n\n Not collective.\n\n Parameters\n ----------\n flag\n Enable to error if no step succeeds.\n\n Notes\n -----\n ``-ts_error_if_step_fails`` to enable from the commandline.\n\n See Also\n --------\n petsc.TSSetErrorIfStepFails\n\n \nSource code at petsc4py/PETSc/TS.pyx:1738"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_153setErrorIfStepFails(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_flag = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setErrorIfStepFails (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_True)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flag); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 1738, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setErrorIfStepFails") < 0)) __PYX_ERR(51, 1738, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_flag = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setErrorIfStepFails", 0, 0, 1, __pyx_nargs); __PYX_ERR(51, 1738, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TS.setErrorIfStepFails", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_152setErrorIfStepFails(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_flag); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_152setErrorIfStepFails(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_flag) { PetscBool __pyx_v_bval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setErrorIfStepFails", 1); /* "petsc4py/PETSc/TS.pyx":1757 * * """ * cdef PetscBool bval = flag # <<<<<<<<<<<<<< * CHKERR( TSSetErrorIfStepFails(self.ts, bval)) * */ __pyx_t_1 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_flag)); if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 1757, __pyx_L1_error) __pyx_v_bval = __pyx_t_1; /* "petsc4py/PETSc/TS.pyx":1758 * """ * cdef PetscBool bval = flag * CHKERR( TSSetErrorIfStepFails(self.ts, bval)) # <<<<<<<<<<<<<< * * def setTolerances(self, rtol: float=None, atol: float=None) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetErrorIfStepFails(__pyx_v_self->ts, __pyx_v_bval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1758, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":1738 * return toInt(n) * * def setErrorIfStepFails(self, flag: bool=True) -> None: # <<<<<<<<<<<<<< * """Immediately error is no step succeeds. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setErrorIfStepFails", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":1760 * CHKERR( TSSetErrorIfStepFails(self.ts, bval)) * * def setTolerances(self, rtol: float=None, atol: float=None) -> None: # <<<<<<<<<<<<<< * """Set tolerances for local truncation error when using an adaptive controller. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_155setTolerances(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_154setTolerances, "TS.setTolerances(self, rtol: float = None, atol: float = None) -> None\nSet tolerances for local truncation error when using an adaptive controller.\n\n Logically collective.\n\n Parameters\n ----------\n rtol\n The relative tolerance or `None` to leave the current value.\n atol\n The absolute tolerance or `None` to leave the current value.\n\n Notes\n -----\n ``-ts_rtol`` and ``-ts_atol`` may be used to set values from the commandline.\n\n See Also\n --------\n petsc.TSSetTolerances\n\n \nSource code at petsc4py/PETSc/TS.pyx:1760"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_155setTolerances(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_rtol = 0; PyObject *__pyx_v_atol = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setTolerances (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rtol,&__pyx_n_s_atol,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rtol); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 1760, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_atol); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 1760, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setTolerances") < 0)) __PYX_ERR(51, 1760, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_rtol = values[0]; __pyx_v_atol = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setTolerances", 0, 0, 2, __pyx_nargs); __PYX_ERR(51, 1760, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TS.setTolerances", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_154setTolerances(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_rtol, __pyx_v_atol); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_154setTolerances(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_rtol, PyObject *__pyx_v_atol) { PetscReal __pyx_v_rrtol; PetscReal __pyx_v_ratol; Vec __pyx_v_vrtol; Vec __pyx_v_vatol; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; Vec __pyx_t_2; PetscReal __pyx_t_3; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setTolerances", 1); /* "petsc4py/PETSc/TS.pyx":1781 * * """ * cdef PetscReal rrtol = PETSC_DEFAULT # <<<<<<<<<<<<<< * cdef PetscReal ratol = PETSC_DEFAULT * cdef PetscVec vrtol = NULL */ __pyx_v_rrtol = PETSC_DEFAULT; /* "petsc4py/PETSc/TS.pyx":1782 * """ * cdef PetscReal rrtol = PETSC_DEFAULT * cdef PetscReal ratol = PETSC_DEFAULT # <<<<<<<<<<<<<< * cdef PetscVec vrtol = NULL * cdef PetscVec vatol = NULL */ __pyx_v_ratol = PETSC_DEFAULT; /* "petsc4py/PETSc/TS.pyx":1783 * cdef PetscReal rrtol = PETSC_DEFAULT * cdef PetscReal ratol = PETSC_DEFAULT * cdef PetscVec vrtol = NULL # <<<<<<<<<<<<<< * cdef PetscVec vatol = NULL * if rtol is None: */ __pyx_v_vrtol = NULL; /* "petsc4py/PETSc/TS.pyx":1784 * cdef PetscReal ratol = PETSC_DEFAULT * cdef PetscVec vrtol = NULL * cdef PetscVec vatol = NULL # <<<<<<<<<<<<<< * if rtol is None: * pass */ __pyx_v_vatol = NULL; /* "petsc4py/PETSc/TS.pyx":1785 * cdef PetscVec vrtol = NULL * cdef PetscVec vatol = NULL * if rtol is None: # <<<<<<<<<<<<<< * pass * elif isinstance(rtol, Vec): */ __pyx_t_1 = (__pyx_v_rtol == Py_None); if (__pyx_t_1) { goto __pyx_L3; } /* "petsc4py/PETSc/TS.pyx":1787 * if rtol is None: * pass * elif isinstance(rtol, Vec): # <<<<<<<<<<<<<< * vrtol = (rtol).vec * else: */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_rtol, __pyx_ptype_8petsc4py_5PETSc_Vec); if (__pyx_t_1) { /* "petsc4py/PETSc/TS.pyx":1788 * pass * elif isinstance(rtol, Vec): * vrtol = (rtol).vec # <<<<<<<<<<<<<< * else: * rrtol = asReal(rtol) */ __pyx_t_2 = ((struct PyPetscVecObject *)__pyx_v_rtol)->vec; __pyx_v_vrtol = __pyx_t_2; /* "petsc4py/PETSc/TS.pyx":1787 * if rtol is None: * pass * elif isinstance(rtol, Vec): # <<<<<<<<<<<<<< * vrtol = (rtol).vec * else: */ goto __pyx_L3; } /* "petsc4py/PETSc/TS.pyx":1790 * vrtol = (rtol).vec * else: * rrtol = asReal(rtol) # <<<<<<<<<<<<<< * if atol is None: * pass */ /*else*/ { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_rtol); if (unlikely(__pyx_t_3 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(51, 1790, __pyx_L1_error) __pyx_v_rrtol = __pyx_t_3; } __pyx_L3:; /* "petsc4py/PETSc/TS.pyx":1791 * else: * rrtol = asReal(rtol) * if atol is None: # <<<<<<<<<<<<<< * pass * elif isinstance(atol, Vec): */ __pyx_t_1 = (__pyx_v_atol == Py_None); if (__pyx_t_1) { goto __pyx_L4; } /* "petsc4py/PETSc/TS.pyx":1793 * if atol is None: * pass * elif isinstance(atol, Vec): # <<<<<<<<<<<<<< * vatol = (atol).vec * else: */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_atol, __pyx_ptype_8petsc4py_5PETSc_Vec); if (__pyx_t_1) { /* "petsc4py/PETSc/TS.pyx":1794 * pass * elif isinstance(atol, Vec): * vatol = (atol).vec # <<<<<<<<<<<<<< * else: * ratol = asReal(atol) */ __pyx_t_2 = ((struct PyPetscVecObject *)__pyx_v_atol)->vec; __pyx_v_vatol = __pyx_t_2; /* "petsc4py/PETSc/TS.pyx":1793 * if atol is None: * pass * elif isinstance(atol, Vec): # <<<<<<<<<<<<<< * vatol = (atol).vec * else: */ goto __pyx_L4; } /* "petsc4py/PETSc/TS.pyx":1796 * vatol = (atol).vec * else: * ratol = asReal(atol) # <<<<<<<<<<<<<< * CHKERR( TSSetTolerances(self.ts, ratol, vatol, rrtol, vrtol) ) * */ /*else*/ { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_atol); if (unlikely(__pyx_t_3 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(51, 1796, __pyx_L1_error) __pyx_v_ratol = __pyx_t_3; } __pyx_L4:; /* "petsc4py/PETSc/TS.pyx":1797 * else: * ratol = asReal(atol) * CHKERR( TSSetTolerances(self.ts, ratol, vatol, rrtol, vrtol) ) # <<<<<<<<<<<<<< * * def getTolerances(self) ->tuple[float,float]: */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetTolerances(__pyx_v_self->ts, __pyx_v_ratol, __pyx_v_vatol, __pyx_v_rrtol, __pyx_v_vrtol)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1797, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":1760 * CHKERR( TSSetErrorIfStepFails(self.ts, bval)) * * def setTolerances(self, rtol: float=None, atol: float=None) -> None: # <<<<<<<<<<<<<< * """Set tolerances for local truncation error when using an adaptive controller. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setTolerances", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":1799 * CHKERR( TSSetTolerances(self.ts, ratol, vatol, rrtol, vrtol) ) * * def getTolerances(self) ->tuple[float,float]: # <<<<<<<<<<<<<< * """Return the tolerances for local truncation error. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_157getTolerances(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_156getTolerances, "TS.getTolerances(self) -> tuple[float, float]\nReturn the tolerances for local truncation error.\n\n Logically collective.\n\n Returns\n -------\n rtol : float\n the relative tolerance\n atol : float\n the absolute tolerance\n\n See Also\n --------\n petsc.TSGetTolerances\n\n \nSource code at petsc4py/PETSc/TS.pyx:1799"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_157getTolerances(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getTolerances (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getTolerances", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getTolerances", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_156getTolerances(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_156getTolerances(struct PyPetscTSObject *__pyx_v_self) { PetscReal __pyx_v_rrtol; PetscReal __pyx_v_ratol; Vec __pyx_v_vrtol; Vec __pyx_v_vatol; PyObject *__pyx_v_rtol = 0; PyObject *__pyx_v_atol = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getTolerances", 1); /* "petsc4py/PETSc/TS.pyx":1816 * * """ * cdef PetscReal rrtol = PETSC_DEFAULT # <<<<<<<<<<<<<< * cdef PetscReal ratol = PETSC_DEFAULT * cdef PetscVec vrtol = NULL */ __pyx_v_rrtol = PETSC_DEFAULT; /* "petsc4py/PETSc/TS.pyx":1817 * """ * cdef PetscReal rrtol = PETSC_DEFAULT * cdef PetscReal ratol = PETSC_DEFAULT # <<<<<<<<<<<<<< * cdef PetscVec vrtol = NULL * cdef PetscVec vatol = NULL */ __pyx_v_ratol = PETSC_DEFAULT; /* "petsc4py/PETSc/TS.pyx":1818 * cdef PetscReal rrtol = PETSC_DEFAULT * cdef PetscReal ratol = PETSC_DEFAULT * cdef PetscVec vrtol = NULL # <<<<<<<<<<<<<< * cdef PetscVec vatol = NULL * CHKERR( TSGetTolerances(self.ts, &ratol, &vatol, &rrtol, &vrtol) ) */ __pyx_v_vrtol = NULL; /* "petsc4py/PETSc/TS.pyx":1819 * cdef PetscReal ratol = PETSC_DEFAULT * cdef PetscVec vrtol = NULL * cdef PetscVec vatol = NULL # <<<<<<<<<<<<<< * CHKERR( TSGetTolerances(self.ts, &ratol, &vatol, &rrtol, &vrtol) ) * cdef object rtol = None */ __pyx_v_vatol = NULL; /* "petsc4py/PETSc/TS.pyx":1820 * cdef PetscVec vrtol = NULL * cdef PetscVec vatol = NULL * CHKERR( TSGetTolerances(self.ts, &ratol, &vatol, &rrtol, &vrtol) ) # <<<<<<<<<<<<<< * cdef object rtol = None * if vrtol != NULL: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetTolerances(__pyx_v_self->ts, (&__pyx_v_ratol), (&__pyx_v_vatol), (&__pyx_v_rrtol), (&__pyx_v_vrtol))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1820, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":1821 * cdef PetscVec vatol = NULL * CHKERR( TSGetTolerances(self.ts, &ratol, &vatol, &rrtol, &vrtol) ) * cdef object rtol = None # <<<<<<<<<<<<<< * if vrtol != NULL: * rtol = ref_Vec(vrtol) */ __Pyx_INCREF(Py_None); __pyx_v_rtol = Py_None; /* "petsc4py/PETSc/TS.pyx":1822 * CHKERR( TSGetTolerances(self.ts, &ratol, &vatol, &rrtol, &vrtol) ) * cdef object rtol = None * if vrtol != NULL: # <<<<<<<<<<<<<< * rtol = ref_Vec(vrtol) * else: */ __pyx_t_2 = (__pyx_v_vrtol != NULL); if (__pyx_t_2) { /* "petsc4py/PETSc/TS.pyx":1823 * cdef object rtol = None * if vrtol != NULL: * rtol = ref_Vec(vrtol) # <<<<<<<<<<<<<< * else: * rtol = toReal(rrtol) */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_vrtol)); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 1823, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_rtol, __pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/TS.pyx":1822 * CHKERR( TSGetTolerances(self.ts, &ratol, &vatol, &rrtol, &vrtol) ) * cdef object rtol = None * if vrtol != NULL: # <<<<<<<<<<<<<< * rtol = ref_Vec(vrtol) * else: */ goto __pyx_L3; } /* "petsc4py/PETSc/TS.pyx":1825 * rtol = ref_Vec(vrtol) * else: * rtol = toReal(rrtol) # <<<<<<<<<<<<<< * cdef object atol = None * if vatol != NULL: */ /*else*/ { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_rrtol); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 1825, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_rtol, __pyx_t_3); __pyx_t_3 = 0; } __pyx_L3:; /* "petsc4py/PETSc/TS.pyx":1826 * else: * rtol = toReal(rrtol) * cdef object atol = None # <<<<<<<<<<<<<< * if vatol != NULL: * atol = ref_Vec(vatol) */ __Pyx_INCREF(Py_None); __pyx_v_atol = Py_None; /* "petsc4py/PETSc/TS.pyx":1827 * rtol = toReal(rrtol) * cdef object atol = None * if vatol != NULL: # <<<<<<<<<<<<<< * atol = ref_Vec(vatol) * else: */ __pyx_t_2 = (__pyx_v_vatol != NULL); if (__pyx_t_2) { /* "petsc4py/PETSc/TS.pyx":1828 * cdef object atol = None * if vatol != NULL: * atol = ref_Vec(vatol) # <<<<<<<<<<<<<< * else: * atol = toReal(ratol) */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_vatol)); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 1828, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_atol, __pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/TS.pyx":1827 * rtol = toReal(rrtol) * cdef object atol = None * if vatol != NULL: # <<<<<<<<<<<<<< * atol = ref_Vec(vatol) * else: */ goto __pyx_L4; } /* "petsc4py/PETSc/TS.pyx":1830 * atol = ref_Vec(vatol) * else: * atol = toReal(ratol) # <<<<<<<<<<<<<< * return (rtol, atol) * */ /*else*/ { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_ratol); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 1830, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_atol, __pyx_t_3); __pyx_t_3 = 0; } __pyx_L4:; /* "petsc4py/PETSc/TS.pyx":1831 * else: * atol = toReal(ratol) * return (rtol, atol) # <<<<<<<<<<<<<< * * def setExactFinalTime(self, option: ExactFinalTime) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 1831, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_rtol); __Pyx_GIVEREF(__pyx_v_rtol); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_rtol)) __PYX_ERR(51, 1831, __pyx_L1_error); __Pyx_INCREF(__pyx_v_atol); __Pyx_GIVEREF(__pyx_v_atol); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_atol)) __PYX_ERR(51, 1831, __pyx_L1_error); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TS.pyx":1799 * CHKERR( TSSetTolerances(self.ts, ratol, vatol, rrtol, vrtol) ) * * def getTolerances(self) ->tuple[float,float]: # <<<<<<<<<<<<<< * """Return the tolerances for local truncation error. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.getTolerances", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rtol); __Pyx_XDECREF(__pyx_v_atol); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":1833 * return (rtol, atol) * * def setExactFinalTime(self, option: ExactFinalTime) -> None: # <<<<<<<<<<<<<< * """Set method of computing the final time step. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_159setExactFinalTime(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_158setExactFinalTime, "TS.setExactFinalTime(self, option: ExactFinalTime) -> None\nSet method of computing the final time step.\n\n Logically collective.\n\n Parameters\n ----------\n option\n The exact final time option\n\n Notes\n -----\n ``-ts_exact_final_time`` may be used to specify from the commandline.\n\n See Also\n --------\n petsc.TSSetExactFinalTime\n\n \nSource code at petsc4py/PETSc/TS.pyx:1833"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_159setExactFinalTime(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_option = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setExactFinalTime (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_option,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_option)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 1833, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setExactFinalTime") < 0)) __PYX_ERR(51, 1833, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_option = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setExactFinalTime", 1, 1, 1, __pyx_nargs); __PYX_ERR(51, 1833, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TS.setExactFinalTime", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_158setExactFinalTime(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_option); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_158setExactFinalTime(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_option) { TSExactFinalTimeOption __pyx_v_oval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations TSExactFinalTimeOption __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setExactFinalTime", 1); /* "petsc4py/PETSc/TS.pyx":1852 * * """ * cdef PetscTSExactFinalTimeOption oval = option # <<<<<<<<<<<<<< * CHKERR( TSSetExactFinalTime(self.ts, oval) ) * */ __pyx_t_1 = ((TSExactFinalTimeOption)__Pyx_PyInt_As_TSExactFinalTimeOption(__pyx_v_option)); if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 1852, __pyx_L1_error) __pyx_v_oval = __pyx_t_1; /* "petsc4py/PETSc/TS.pyx":1853 * """ * cdef PetscTSExactFinalTimeOption oval = option * CHKERR( TSSetExactFinalTime(self.ts, oval) ) # <<<<<<<<<<<<<< * * def setConvergedReason(self, reason: ConvergedReason) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetExactFinalTime(__pyx_v_self->ts, __pyx_v_oval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1853, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":1833 * return (rtol, atol) * * def setExactFinalTime(self, option: ExactFinalTime) -> None: # <<<<<<<<<<<<<< * """Set method of computing the final time step. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setExactFinalTime", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":1855 * CHKERR( TSSetExactFinalTime(self.ts, oval) ) * * def setConvergedReason(self, reason: ConvergedReason) -> None: # <<<<<<<<<<<<<< * """Set the reason for handling the convergence of `solve`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_161setConvergedReason(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_160setConvergedReason, "TS.setConvergedReason(self, reason: ConvergedReason) -> None\nSet the reason for handling the convergence of `solve`.\n\n Logically collective.\n\n Can only be called when `solve` is active and\n ``reason`` must contain common value.\n\n Parameters\n ----------\n reason\n The reason for convergence.\n\n See Also\n --------\n petsc.TSSetConvergedReason\n\n \nSource code at petsc4py/PETSc/TS.pyx:1855"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_161setConvergedReason(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_reason = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setConvergedReason (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_reason,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_reason)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 1855, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setConvergedReason") < 0)) __PYX_ERR(51, 1855, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_reason = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setConvergedReason", 1, 1, 1, __pyx_nargs); __PYX_ERR(51, 1855, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TS.setConvergedReason", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_160setConvergedReason(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_reason); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_160setConvergedReason(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_reason) { TSConvergedReason __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations TSConvergedReason __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setConvergedReason", 1); /* "petsc4py/PETSc/TS.pyx":1873 * * """ * cdef PetscTSConvergedReason cval = reason # <<<<<<<<<<<<<< * CHKERR( TSSetConvergedReason(self.ts, cval) ) * */ __pyx_t_1 = ((TSConvergedReason)__Pyx_PyInt_As_TSConvergedReason(__pyx_v_reason)); if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 1873, __pyx_L1_error) __pyx_v_cval = __pyx_t_1; /* "petsc4py/PETSc/TS.pyx":1874 * """ * cdef PetscTSConvergedReason cval = reason * CHKERR( TSSetConvergedReason(self.ts, cval) ) # <<<<<<<<<<<<<< * * def getConvergedReason(self) -> ConvergedReason: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetConvergedReason(__pyx_v_self->ts, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1874, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":1855 * CHKERR( TSSetExactFinalTime(self.ts, oval) ) * * def setConvergedReason(self, reason: ConvergedReason) -> None: # <<<<<<<<<<<<<< * """Set the reason for handling the convergence of `solve`. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setConvergedReason", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":1876 * CHKERR( TSSetConvergedReason(self.ts, cval) ) * * def getConvergedReason(self) -> ConvergedReason: # <<<<<<<<<<<<<< * """Return the reason the `TS` step was stopped. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_163getConvergedReason(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_162getConvergedReason, "TS.getConvergedReason(self) -> ConvergedReason\nReturn the reason the `TS` step was stopped.\n\n Not collective.\n\n Can only be called once `solve` is complete.\n\n See Also\n --------\n petsc.TSGetConvergedReason\n\n \nSource code at petsc4py/PETSc/TS.pyx:1876"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_163getConvergedReason(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getConvergedReason (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getConvergedReason", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getConvergedReason", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_162getConvergedReason(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_162getConvergedReason(struct PyPetscTSObject *__pyx_v_self) { TSConvergedReason __pyx_v_reason; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getConvergedReason", 1); /* "petsc4py/PETSc/TS.pyx":1888 * * """ * cdef PetscTSConvergedReason reason = TS_CONVERGED_ITERATING # <<<<<<<<<<<<<< * CHKERR( TSGetConvergedReason(self.ts, &reason) ) * return reason */ __pyx_v_reason = TS_CONVERGED_ITERATING; /* "petsc4py/PETSc/TS.pyx":1889 * """ * cdef PetscTSConvergedReason reason = TS_CONVERGED_ITERATING * CHKERR( TSGetConvergedReason(self.ts, &reason) ) # <<<<<<<<<<<<<< * return reason * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetConvergedReason(__pyx_v_self->ts, (&__pyx_v_reason))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1889, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":1890 * cdef PetscTSConvergedReason reason = TS_CONVERGED_ITERATING * CHKERR( TSGetConvergedReason(self.ts, &reason) ) * return reason # <<<<<<<<<<<<<< * * # --- monitoring --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_TSConvergedReason(__pyx_v_reason); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 1890, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TS.pyx":1876 * CHKERR( TSSetConvergedReason(self.ts, cval) ) * * def getConvergedReason(self) -> ConvergedReason: # <<<<<<<<<<<<<< * """Return the reason the `TS` step was stopped. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TS.getConvergedReason", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":1894 * # --- monitoring --- * * def setMonitor( # <<<<<<<<<<<<<< * self, * monitor: TSMonitorFunction, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_165setMonitor(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_164setMonitor, "TS.setMonitor(self, monitor: TSMonitorFunction, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nSet an additional monitor to the `TS`.\n\n Logically collective.\n\n Parameters\n ----------\n monitor\n The custom monitor function.\n args\n Additional positional arguments for ``monitor``.\n kargs\n Additional keyword arguments for ``monitor``.\n\n See Also\n --------\n petsc.TSMonitorSet\n\n \nSource code at petsc4py/PETSc/TS.pyx:1894"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_165setMonitor(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_monitor = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setMonitor (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_monitor,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; /* "petsc4py/PETSc/TS.pyx":1897 * self, * monitor: TSMonitorFunction, * args : tuple[Any, ...] | None = None, # <<<<<<<<<<<<<< * kargs : dict[str, Any] | None = None) -> None: * """Set an additional monitor to the `TS`. */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/TS.pyx":1898 * monitor: TSMonitorFunction, * args : tuple[Any, ...] | None = None, * kargs : dict[str, Any] | None = None) -> None: # <<<<<<<<<<<<<< * """Set an additional monitor to the `TS`. * */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_monitor)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 1894, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 1894, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 1894, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setMonitor") < 0)) __PYX_ERR(51, 1894, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_monitor = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setMonitor", 0, 1, 3, __pyx_nargs); __PYX_ERR(51, 1894, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TS.setMonitor", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_164setMonitor(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_monitor, __pyx_v_args, __pyx_v_kargs); /* "petsc4py/PETSc/TS.pyx":1894 * # --- monitoring --- * * def setMonitor( # <<<<<<<<<<<<<< * self, * monitor: TSMonitorFunction, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_164setMonitor(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_monitor, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_monitorlist = 0; PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setMonitor", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/TS.pyx":1917 * * """ * if monitor is None: return # <<<<<<<<<<<<<< * cdef object monitorlist = self.get_attr('__monitor__') * if monitorlist is None: */ __pyx_t_1 = (__pyx_v_monitor == Py_None); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } /* "petsc4py/PETSc/TS.pyx":1918 * """ * if monitor is None: return * cdef object monitorlist = self.get_attr('__monitor__') # <<<<<<<<<<<<<< * if monitorlist is None: * monitorlist = [] */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__monitor__")); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 1918, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_monitorlist = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/TS.pyx":1919 * if monitor is None: return * cdef object monitorlist = self.get_attr('__monitor__') * if monitorlist is None: # <<<<<<<<<<<<<< * monitorlist = [] * self.set_attr('__monitor__', monitorlist) */ __pyx_t_1 = (__pyx_v_monitorlist == Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/TS.pyx":1920 * cdef object monitorlist = self.get_attr('__monitor__') * if monitorlist is None: * monitorlist = [] # <<<<<<<<<<<<<< * self.set_attr('__monitor__', monitorlist) * CHKERR( TSMonitorSet(self.ts, TS_Monitor, NULL, NULL) ) */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 1920, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_monitorlist, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/TS.pyx":1921 * if monitorlist is None: * monitorlist = [] * self.set_attr('__monitor__', monitorlist) # <<<<<<<<<<<<<< * CHKERR( TSMonitorSet(self.ts, TS_Monitor, NULL, NULL) ) * if args is None: args = () */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__monitor__"), __pyx_v_monitorlist); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 1921, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/TS.pyx":1922 * monitorlist = [] * self.set_attr('__monitor__', monitorlist) * CHKERR( TSMonitorSet(self.ts, TS_Monitor, NULL, NULL) ) # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSMonitorSet(__pyx_v_self->ts, __pyx_f_8petsc4py_5PETSc_TS_Monitor, NULL, NULL)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1922, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":1919 * if monitor is None: return * cdef object monitorlist = self.get_attr('__monitor__') * if monitorlist is None: # <<<<<<<<<<<<<< * monitorlist = [] * self.set_attr('__monitor__', monitorlist) */ } /* "petsc4py/PETSc/TS.pyx":1923 * self.set_attr('__monitor__', monitorlist) * CHKERR( TSMonitorSet(self.ts, TS_Monitor, NULL, NULL) ) * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (monitor, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/TS.pyx":1924 * CHKERR( TSMonitorSet(self.ts, TS_Monitor, NULL, NULL) ) * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (monitor, args, kargs) * monitorlist.append(context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); if (__pyx_t_1) { __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 1924, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_2); __pyx_t_2 = 0; } /* "petsc4py/PETSc/TS.pyx":1925 * if args is None: args = () * if kargs is None: kargs = {} * context = (monitor, args, kargs) # <<<<<<<<<<<<<< * monitorlist.append(context) * */ __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 1925, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_monitor); __Pyx_GIVEREF(__pyx_v_monitor); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_monitor)) __PYX_ERR(51, 1925, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_args)) __PYX_ERR(51, 1925, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_kargs)) __PYX_ERR(51, 1925, __pyx_L1_error); __pyx_v_context = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/TS.pyx":1926 * if kargs is None: kargs = {} * context = (monitor, args, kargs) * monitorlist.append(context) # <<<<<<<<<<<<<< * * def getMonitor(self) -> list[tuple[TSMonitorFunction,tuple[Any, ...],dict[str, Any]]]: */ __pyx_t_4 = __Pyx_PyObject_Append(__pyx_v_monitorlist, __pyx_v_context); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(51, 1926, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":1894 * # --- monitoring --- * * def setMonitor( # <<<<<<<<<<<<<< * self, * monitor: TSMonitorFunction, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TS.setMonitor", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_monitorlist); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":1928 * monitorlist.append(context) * * def getMonitor(self) -> list[tuple[TSMonitorFunction,tuple[Any, ...],dict[str, Any]]]: # <<<<<<<<<<<<<< * """Return the monitor. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_167getMonitor(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_166getMonitor, "TS.getMonitor(self) -> list[tuple[TSMonitorFunction, tuple[Any, ...], dict[str, Any]]]\nReturn the monitor.\n\n See Also\n --------\n setMonitor\n\n \nSource code at petsc4py/PETSc/TS.pyx:1928"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_167getMonitor(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getMonitor (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getMonitor", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getMonitor", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_166getMonitor(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_166getMonitor(struct PyPetscTSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getMonitor", 1); /* "petsc4py/PETSc/TS.pyx":1936 * * """ * return self.get_attr('__monitor__') # <<<<<<<<<<<<<< * * def monitorCancel(self) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__monitor__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 1936, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TS.pyx":1928 * monitorlist.append(context) * * def getMonitor(self) -> list[tuple[TSMonitorFunction,tuple[Any, ...],dict[str, Any]]]: # <<<<<<<<<<<<<< * """Return the monitor. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TS.getMonitor", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":1938 * return self.get_attr('__monitor__') * * def monitorCancel(self) -> None: # <<<<<<<<<<<<<< * """Clear all the monitors that have been set. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_169monitorCancel(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_168monitorCancel, "TS.monitorCancel(self) -> None\nClear all the monitors that have been set.\n\n Logically collective.\n\n See Also\n --------\n petsc.TSMonitorCancel\n\n \nSource code at petsc4py/PETSc/TS.pyx:1938"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_169monitorCancel(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("monitorCancel (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("monitorCancel", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "monitorCancel", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_168monitorCancel(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_168monitorCancel(struct PyPetscTSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("monitorCancel", 1); /* "petsc4py/PETSc/TS.pyx":1948 * * """ * self.set_attr('__monitor__', None) # <<<<<<<<<<<<<< * CHKERR( TSMonitorCancel(self.ts) ) * */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__monitor__"), Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 1948, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/TS.pyx":1949 * """ * self.set_attr('__monitor__', None) * CHKERR( TSMonitorCancel(self.ts) ) # <<<<<<<<<<<<<< * * cancelMonitor = monitorCancel */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSMonitorCancel(__pyx_v_self->ts)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1949, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":1938 * return self.get_attr('__monitor__') * * def monitorCancel(self) -> None: # <<<<<<<<<<<<<< * """Clear all the monitors that have been set. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TS.monitorCancel", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":1953 * cancelMonitor = monitorCancel * * def monitor(self, step: int, time: float, Vec u=None) -> None: # <<<<<<<<<<<<<< * """Monitor the solve. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_171monitor(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_170monitor, "TS.monitor(self, step: int, time: float, u: Vec | None = None) -> None\nMonitor the solve.\n\n Parameters\n ----------\n step\n The step number that has just completed.\n time\n The model time of the state.\n u\n The state at the current model time.\n\n See Also\n --------\n petsc.TSMonitor\n\n \nSource code at petsc4py/PETSc/TS.pyx:1953"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_171monitor(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_step = 0; PyObject *__pyx_v_time = 0; struct PyPetscVecObject *__pyx_v_u = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("monitor (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_step,&__pyx_n_s_time,&__pyx_n_s_u,0}; values[2] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscVecObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_step)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 1953, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_time)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 1953, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("monitor", 0, 2, 3, 1); __PYX_ERR(51, 1953, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_u); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 1953, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "monitor") < 0)) __PYX_ERR(51, 1953, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_step = values[0]; __pyx_v_time = values[1]; __pyx_v_u = ((struct PyPetscVecObject *)values[2]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("monitor", 0, 2, 3, __pyx_nargs); __PYX_ERR(51, 1953, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TS.monitor", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_u), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "u", 0))) __PYX_ERR(51, 1953, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_170monitor(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_step, __pyx_v_time, __pyx_v_u); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_170monitor(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_step, PyObject *__pyx_v_time, struct PyPetscVecObject *__pyx_v_u) { PetscInt __pyx_v_ival; PetscReal __pyx_v_rval; Vec __pyx_v_uvec; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscReal __pyx_t_2; int __pyx_t_3; Vec __pyx_t_4; PetscErrorCode __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("monitor", 1); /* "petsc4py/PETSc/TS.pyx":1970 * * """ * cdef PetscInt ival = asInt(step) # <<<<<<<<<<<<<< * cdef PetscReal rval = asReal(time) * cdef PetscVec uvec = NULL */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_step); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(51, 1970, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "petsc4py/PETSc/TS.pyx":1971 * """ * cdef PetscInt ival = asInt(step) * cdef PetscReal rval = asReal(time) # <<<<<<<<<<<<<< * cdef PetscVec uvec = NULL * if u is not None: uvec = u.vec */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_time); if (unlikely(__pyx_t_2 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(51, 1971, __pyx_L1_error) __pyx_v_rval = __pyx_t_2; /* "petsc4py/PETSc/TS.pyx":1972 * cdef PetscInt ival = asInt(step) * cdef PetscReal rval = asReal(time) * cdef PetscVec uvec = NULL # <<<<<<<<<<<<<< * if u is not None: uvec = u.vec * if uvec == NULL: */ __pyx_v_uvec = NULL; /* "petsc4py/PETSc/TS.pyx":1973 * cdef PetscReal rval = asReal(time) * cdef PetscVec uvec = NULL * if u is not None: uvec = u.vec # <<<<<<<<<<<<<< * if uvec == NULL: * CHKERR( TSGetSolution(self.ts, &uvec) ) */ __pyx_t_3 = (((PyObject *)__pyx_v_u) != Py_None); if (__pyx_t_3) { __pyx_t_4 = __pyx_v_u->vec; __pyx_v_uvec = __pyx_t_4; } /* "petsc4py/PETSc/TS.pyx":1974 * cdef PetscVec uvec = NULL * if u is not None: uvec = u.vec * if uvec == NULL: # <<<<<<<<<<<<<< * CHKERR( TSGetSolution(self.ts, &uvec) ) * CHKERR( TSMonitor(self.ts, ival, rval, uvec) ) */ __pyx_t_3 = (__pyx_v_uvec == NULL); if (__pyx_t_3) { /* "petsc4py/PETSc/TS.pyx":1975 * if u is not None: uvec = u.vec * if uvec == NULL: * CHKERR( TSGetSolution(self.ts, &uvec) ) # <<<<<<<<<<<<<< * CHKERR( TSMonitor(self.ts, ival, rval, uvec) ) * */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetSolution(__pyx_v_self->ts, (&__pyx_v_uvec))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1975, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":1974 * cdef PetscVec uvec = NULL * if u is not None: uvec = u.vec * if uvec == NULL: # <<<<<<<<<<<<<< * CHKERR( TSGetSolution(self.ts, &uvec) ) * CHKERR( TSMonitor(self.ts, ival, rval, uvec) ) */ } /* "petsc4py/PETSc/TS.pyx":1976 * if uvec == NULL: * CHKERR( TSGetSolution(self.ts, &uvec) ) * CHKERR( TSMonitor(self.ts, ival, rval, uvec) ) # <<<<<<<<<<<<<< * * # --- event handling --- */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSMonitor(__pyx_v_self->ts, __pyx_v_ival, __pyx_v_rval, __pyx_v_uvec)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1976, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":1953 * cancelMonitor = monitorCancel * * def monitor(self, step: int, time: float, Vec u=None) -> None: # <<<<<<<<<<<<<< * """Monitor the solve. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.monitor", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":1980 * # --- event handling --- * * def setEventHandler( # <<<<<<<<<<<<<< * self, * direction: Sequence[int], */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_173setEventHandler(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_172setEventHandler, "TS.setEventHandler(self, direction: Sequence[int], terminate: Sequence[bool], eventhandler: TSEventHandlerFunction, postevent: TSPostEventFunction = None, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nSet a function used for detecting events.\n\n Logically collective.\n\n Parameters\n ----------\n direction\n Direction of zero crossing to be detected {-1,0,+1}.\n terminate\n Flags for each event to indicate stepping should be terminated.\n eventhandler\n Function for detecting the event\n postevent\n Function to execute after the event\n args\n Additional positional arguments for ``eventhandler``.\n kargs\n Additional keyword arguments for ``eventhandler``.\n\n See Also\n --------\n petsc.TSSetEventHandler\n\n \nSource code at petsc4py/PETSc/TS.pyx:1980"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_173setEventHandler(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_direction = 0; PyObject *__pyx_v_terminate = 0; PyObject *__pyx_v_eventhandler = 0; PyObject *__pyx_v_postevent = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[6] = {0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setEventHandler (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_direction,&__pyx_n_s_terminate,&__pyx_n_s_eventhandler,&__pyx_n_s_postevent,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; /* "petsc4py/PETSc/TS.pyx":1985 * terminate: Sequence[bool], * eventhandler: TSEventHandlerFunction, * postevent: TSPostEventFunction=None, # <<<<<<<<<<<<<< * args: tuple[Any, ...] | None = None, * kargs: dict[str, Any] | None = None) -> None: */ values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/TS.pyx":1986 * eventhandler: TSEventHandlerFunction, * postevent: TSPostEventFunction=None, * args: tuple[Any, ...] | None = None, # <<<<<<<<<<<<<< * kargs: dict[str, Any] | None = None) -> None: * """Set a function used for detecting events. */ values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/TS.pyx":1987 * postevent: TSPostEventFunction=None, * args: tuple[Any, ...] | None = None, * kargs: dict[str, Any] | None = None) -> None: # <<<<<<<<<<<<<< * """Set a function used for detecting events. * */ values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_direction)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 1980, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_terminate)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 1980, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setEventHandler", 0, 3, 6, 1); __PYX_ERR(51, 1980, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_eventhandler)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 1980, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setEventHandler", 0, 3, 6, 2); __PYX_ERR(51, 1980, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_postevent); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 1980, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 1980, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 1980, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setEventHandler") < 0)) __PYX_ERR(51, 1980, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_direction = values[0]; __pyx_v_terminate = values[1]; __pyx_v_eventhandler = values[2]; __pyx_v_postevent = values[3]; __pyx_v_args = values[4]; __pyx_v_kargs = values[5]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setEventHandler", 0, 3, 6, __pyx_nargs); __PYX_ERR(51, 1980, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TS.setEventHandler", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_172setEventHandler(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_direction, __pyx_v_terminate, __pyx_v_eventhandler, __pyx_v_postevent, __pyx_v_args, __pyx_v_kargs); /* "petsc4py/PETSc/TS.pyx":1980 * # --- event handling --- * * def setEventHandler( # <<<<<<<<<<<<<< * self, * direction: Sequence[int], */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_172setEventHandler(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_direction, PyObject *__pyx_v_terminate, PyObject *__pyx_v_eventhandler, PyObject *__pyx_v_postevent, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PetscInt __pyx_v_ndirs; PetscInt *__pyx_v_idirs; PetscInt __pyx_v_nterm; PetscBool *__pyx_v_iterm; PetscInt __pyx_v_nevents; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setEventHandler", 0); __Pyx_INCREF(__pyx_v_direction); __Pyx_INCREF(__pyx_v_terminate); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/TS.pyx":2012 * * """ * cdef PetscInt ndirs = 0 # <<<<<<<<<<<<<< * cdef PetscInt *idirs = NULL * direction = iarray_i(direction, &ndirs, &idirs) */ __pyx_v_ndirs = 0; /* "petsc4py/PETSc/TS.pyx":2013 * """ * cdef PetscInt ndirs = 0 * cdef PetscInt *idirs = NULL # <<<<<<<<<<<<<< * direction = iarray_i(direction, &ndirs, &idirs) * */ __pyx_v_idirs = NULL; /* "petsc4py/PETSc/TS.pyx":2014 * cdef PetscInt ndirs = 0 * cdef PetscInt *idirs = NULL * direction = iarray_i(direction, &ndirs, &idirs) # <<<<<<<<<<<<<< * * cdef PetscInt nterm = 0 */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_direction, (&__pyx_v_ndirs), (&__pyx_v_idirs))); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 2014, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_direction, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/TS.pyx":2016 * direction = iarray_i(direction, &ndirs, &idirs) * * cdef PetscInt nterm = 0 # <<<<<<<<<<<<<< * cdef PetscBool *iterm = NULL * terminate = iarray_b(terminate, &nterm, &iterm) */ __pyx_v_nterm = 0; /* "petsc4py/PETSc/TS.pyx":2017 * * cdef PetscInt nterm = 0 * cdef PetscBool *iterm = NULL # <<<<<<<<<<<<<< * terminate = iarray_b(terminate, &nterm, &iterm) * assert nterm == ndirs */ __pyx_v_iterm = NULL; /* "petsc4py/PETSc/TS.pyx":2018 * cdef PetscInt nterm = 0 * cdef PetscBool *iterm = NULL * terminate = iarray_b(terminate, &nterm, &iterm) # <<<<<<<<<<<<<< * assert nterm == ndirs * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_b(__pyx_v_terminate, (&__pyx_v_nterm), (&__pyx_v_iterm))); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 2018, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_terminate, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/TS.pyx":2019 * cdef PetscBool *iterm = NULL * terminate = iarray_b(terminate, &nterm, &iterm) * assert nterm == ndirs # <<<<<<<<<<<<<< * * cdef PetscInt nevents = ndirs */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_2 = (__pyx_v_nterm == __pyx_v_ndirs); if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(51, 2019, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(51, 2019, __pyx_L1_error) #endif /* "petsc4py/PETSc/TS.pyx":2021 * assert nterm == ndirs * * cdef PetscInt nevents = ndirs # <<<<<<<<<<<<<< * if eventhandler is not None: * if args is None: args = () */ __pyx_v_nevents = __pyx_v_ndirs; /* "petsc4py/PETSc/TS.pyx":2022 * * cdef PetscInt nevents = ndirs * if eventhandler is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_2 = (__pyx_v_eventhandler != Py_None); if (__pyx_t_2) { /* "petsc4py/PETSc/TS.pyx":2023 * cdef PetscInt nevents = ndirs * if eventhandler is not None: * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * self.set_attr('__eventhandler__', (eventhandler, args, kargs)) */ __pyx_t_2 = (__pyx_v_args == Py_None); if (__pyx_t_2) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/TS.pyx":2024 * if eventhandler is not None: * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * self.set_attr('__eventhandler__', (eventhandler, args, kargs)) * if postevent is not None: */ __pyx_t_2 = (__pyx_v_kargs == Py_None); if (__pyx_t_2) { __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 2024, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_1); __pyx_t_1 = 0; } /* "petsc4py/PETSc/TS.pyx":2025 * if args is None: args = () * if kargs is None: kargs = {} * self.set_attr('__eventhandler__', (eventhandler, args, kargs)) # <<<<<<<<<<<<<< * if postevent is not None: * self.set_attr('__postevent__', (postevent, args, kargs)) */ __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 2025, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_eventhandler); __Pyx_GIVEREF(__pyx_v_eventhandler); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_eventhandler)) __PYX_ERR(51, 2025, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_args)) __PYX_ERR(51, 2025, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_kargs)) __PYX_ERR(51, 2025, __pyx_L1_error); __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__eventhandler__"), __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 2025, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/TS.pyx":2026 * if kargs is None: kargs = {} * self.set_attr('__eventhandler__', (eventhandler, args, kargs)) * if postevent is not None: # <<<<<<<<<<<<<< * self.set_attr('__postevent__', (postevent, args, kargs)) * CHKERR( TSSetEventHandler(self.ts, nevents, idirs, iterm, TS_EventHandler, TS_PostEvent, NULL) ) */ __pyx_t_2 = (__pyx_v_postevent != Py_None); if (__pyx_t_2) { /* "petsc4py/PETSc/TS.pyx":2027 * self.set_attr('__eventhandler__', (eventhandler, args, kargs)) * if postevent is not None: * self.set_attr('__postevent__', (postevent, args, kargs)) # <<<<<<<<<<<<<< * CHKERR( TSSetEventHandler(self.ts, nevents, idirs, iterm, TS_EventHandler, TS_PostEvent, NULL) ) * else: */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 2027, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_postevent); __Pyx_GIVEREF(__pyx_v_postevent); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_postevent)) __PYX_ERR(51, 2027, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args)) __PYX_ERR(51, 2027, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs)) __PYX_ERR(51, 2027, __pyx_L1_error); __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__postevent__"), __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 2027, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/TS.pyx":2028 * if postevent is not None: * self.set_attr('__postevent__', (postevent, args, kargs)) * CHKERR( TSSetEventHandler(self.ts, nevents, idirs, iterm, TS_EventHandler, TS_PostEvent, NULL) ) # <<<<<<<<<<<<<< * else: * self.set_attr('__postevent__', None) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetEventHandler(__pyx_v_self->ts, __pyx_v_nevents, __pyx_v_idirs, __pyx_v_iterm, __pyx_f_8petsc4py_5PETSc_TS_EventHandler, __pyx_f_8petsc4py_5PETSc_TS_PostEvent, ((void *)NULL))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 2028, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":2026 * if kargs is None: kargs = {} * self.set_attr('__eventhandler__', (eventhandler, args, kargs)) * if postevent is not None: # <<<<<<<<<<<<<< * self.set_attr('__postevent__', (postevent, args, kargs)) * CHKERR( TSSetEventHandler(self.ts, nevents, idirs, iterm, TS_EventHandler, TS_PostEvent, NULL) ) */ goto __pyx_L6; } /* "petsc4py/PETSc/TS.pyx":2030 * CHKERR( TSSetEventHandler(self.ts, nevents, idirs, iterm, TS_EventHandler, TS_PostEvent, NULL) ) * else: * self.set_attr('__postevent__', None) # <<<<<<<<<<<<<< * CHKERR( TSSetEventHandler(self.ts, nevents, idirs, iterm, TS_EventHandler, NULL, NULL) ) * else: */ /*else*/ { __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__postevent__"), Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 2030, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/TS.pyx":2031 * else: * self.set_attr('__postevent__', None) * CHKERR( TSSetEventHandler(self.ts, nevents, idirs, iterm, TS_EventHandler, NULL, NULL) ) # <<<<<<<<<<<<<< * else: * CHKERR( TSSetEventHandler(self.ts, nevents, idirs, iterm, NULL, NULL, NULL) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetEventHandler(__pyx_v_self->ts, __pyx_v_nevents, __pyx_v_idirs, __pyx_v_iterm, __pyx_f_8petsc4py_5PETSc_TS_EventHandler, NULL, ((void *)NULL))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 2031, __pyx_L1_error) } __pyx_L6:; /* "petsc4py/PETSc/TS.pyx":2022 * * cdef PetscInt nevents = ndirs * if eventhandler is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ goto __pyx_L3; } /* "petsc4py/PETSc/TS.pyx":2033 * CHKERR( TSSetEventHandler(self.ts, nevents, idirs, iterm, TS_EventHandler, NULL, NULL) ) * else: * CHKERR( TSSetEventHandler(self.ts, nevents, idirs, iterm, NULL, NULL, NULL) ) # <<<<<<<<<<<<<< * * def setEventTolerances(self, tol: float=None, vtol: Sequence[float]=None) -> None: */ /*else*/ { __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetEventHandler(__pyx_v_self->ts, __pyx_v_nevents, __pyx_v_idirs, __pyx_v_iterm, NULL, NULL, ((void *)NULL))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 2033, __pyx_L1_error) } __pyx_L3:; /* "petsc4py/PETSc/TS.pyx":1980 * # --- event handling --- * * def setEventHandler( # <<<<<<<<<<<<<< * self, * direction: Sequence[int], */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.setEventHandler", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_direction); __Pyx_XDECREF(__pyx_v_terminate); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2035 * CHKERR( TSSetEventHandler(self.ts, nevents, idirs, iterm, NULL, NULL, NULL) ) * * def setEventTolerances(self, tol: float=None, vtol: Sequence[float]=None) -> None: # <<<<<<<<<<<<<< * """Set tolerances for event zero crossings when using event handler. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_175setEventTolerances(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_174setEventTolerances, "TS.setEventTolerances(self, tol: float = None, vtol: Sequence[float] = None) -> None\nSet tolerances for event zero crossings when using event handler.\n\n Logically collective.\n\n ``setEventHandler`` must have already been called.\n\n Parameters\n ----------\n tol\n The scalar tolerance or `None` to leave at the current value\n vtol\n A sequence of scalar tolerance for each event. Used in preference to\n ``tol`` if present. Set to `None` to leave at the current value.\n\n Notes\n -----\n ``-ts_event_tol`` can be used to set values from the commandline.\n\n See Also\n --------\n petsc.TSSetEventTolerances\n\n \nSource code at petsc4py/PETSc/TS.pyx:2035"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_175setEventTolerances(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_tol = 0; PyObject *__pyx_v_vtol = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setEventTolerances (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tol,&__pyx_n_s_vtol,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_tol); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 2035, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vtol); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 2035, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setEventTolerances") < 0)) __PYX_ERR(51, 2035, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_tol = values[0]; __pyx_v_vtol = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setEventTolerances", 0, 0, 2, __pyx_nargs); __PYX_ERR(51, 2035, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TS.setEventTolerances", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_174setEventTolerances(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_tol, __pyx_v_vtol); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_174setEventTolerances(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_tol, PyObject *__pyx_v_vtol) { PetscInt __pyx_v_nevents; PetscReal __pyx_v_tolr; PetscInt __pyx_v_ntolr; PetscReal *__pyx_v_vtolr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscReal __pyx_t_2; PetscErrorCode __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setEventTolerances", 0); __Pyx_INCREF(__pyx_v_vtol); /* "petsc4py/PETSc/TS.pyx":2059 * * """ * cdef PetscInt nevents = 0 # <<<<<<<<<<<<<< * cdef PetscReal tolr = PETSC_DEFAULT * cdef PetscInt ntolr = 0 */ __pyx_v_nevents = 0; /* "petsc4py/PETSc/TS.pyx":2060 * """ * cdef PetscInt nevents = 0 * cdef PetscReal tolr = PETSC_DEFAULT # <<<<<<<<<<<<<< * cdef PetscInt ntolr = 0 * cdef PetscReal *vtolr = NULL */ __pyx_v_tolr = PETSC_DEFAULT; /* "petsc4py/PETSc/TS.pyx":2061 * cdef PetscInt nevents = 0 * cdef PetscReal tolr = PETSC_DEFAULT * cdef PetscInt ntolr = 0 # <<<<<<<<<<<<<< * cdef PetscReal *vtolr = NULL * if tol is not None: */ __pyx_v_ntolr = 0; /* "petsc4py/PETSc/TS.pyx":2062 * cdef PetscReal tolr = PETSC_DEFAULT * cdef PetscInt ntolr = 0 * cdef PetscReal *vtolr = NULL # <<<<<<<<<<<<<< * if tol is not None: * tolr = asReal(tol) */ __pyx_v_vtolr = NULL; /* "petsc4py/PETSc/TS.pyx":2063 * cdef PetscInt ntolr = 0 * cdef PetscReal *vtolr = NULL * if tol is not None: # <<<<<<<<<<<<<< * tolr = asReal(tol) * if vtol is not None: */ __pyx_t_1 = (__pyx_v_tol != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/TS.pyx":2064 * cdef PetscReal *vtolr = NULL * if tol is not None: * tolr = asReal(tol) # <<<<<<<<<<<<<< * if vtol is not None: * CHKERR( TSGetNumEvents(self.ts, &nevents) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_tol); if (unlikely(__pyx_t_2 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(51, 2064, __pyx_L1_error) __pyx_v_tolr = __pyx_t_2; /* "petsc4py/PETSc/TS.pyx":2063 * cdef PetscInt ntolr = 0 * cdef PetscReal *vtolr = NULL * if tol is not None: # <<<<<<<<<<<<<< * tolr = asReal(tol) * if vtol is not None: */ } /* "petsc4py/PETSc/TS.pyx":2065 * if tol is not None: * tolr = asReal(tol) * if vtol is not None: # <<<<<<<<<<<<<< * CHKERR( TSGetNumEvents(self.ts, &nevents) ) * vtol = iarray_r(vtol, &ntolr, &vtolr) */ __pyx_t_1 = (__pyx_v_vtol != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/TS.pyx":2066 * tolr = asReal(tol) * if vtol is not None: * CHKERR( TSGetNumEvents(self.ts, &nevents) ) # <<<<<<<<<<<<<< * vtol = iarray_r(vtol, &ntolr, &vtolr) * assert ntolr == nevents */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetNumEvents(__pyx_v_self->ts, (&__pyx_v_nevents))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 2066, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":2067 * if vtol is not None: * CHKERR( TSGetNumEvents(self.ts, &nevents) ) * vtol = iarray_r(vtol, &ntolr, &vtolr) # <<<<<<<<<<<<<< * assert ntolr == nevents * CHKERR( TSSetEventTolerances(self.ts, tolr, vtolr) ) */ __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_r(__pyx_v_vtol, (&__pyx_v_ntolr), (&__pyx_v_vtolr))); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 2067, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_vtol, __pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/TS.pyx":2068 * CHKERR( TSGetNumEvents(self.ts, &nevents) ) * vtol = iarray_r(vtol, &ntolr, &vtolr) * assert ntolr == nevents # <<<<<<<<<<<<<< * CHKERR( TSSetEventTolerances(self.ts, tolr, vtolr) ) * */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_1 = (__pyx_v_ntolr == __pyx_v_nevents); if (unlikely(!__pyx_t_1)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(51, 2068, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(51, 2068, __pyx_L1_error) #endif /* "petsc4py/PETSc/TS.pyx":2065 * if tol is not None: * tolr = asReal(tol) * if vtol is not None: # <<<<<<<<<<<<<< * CHKERR( TSGetNumEvents(self.ts, &nevents) ) * vtol = iarray_r(vtol, &ntolr, &vtolr) */ } /* "petsc4py/PETSc/TS.pyx":2069 * vtol = iarray_r(vtol, &ntolr, &vtolr) * assert ntolr == nevents * CHKERR( TSSetEventTolerances(self.ts, tolr, vtolr) ) # <<<<<<<<<<<<<< * * def getNumEvents(self) -> int: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetEventTolerances(__pyx_v_self->ts, __pyx_v_tolr, __pyx_v_vtolr)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 2069, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":2035 * CHKERR( TSSetEventHandler(self.ts, nevents, idirs, iterm, NULL, NULL, NULL) ) * * def setEventTolerances(self, tol: float=None, vtol: Sequence[float]=None) -> None: # <<<<<<<<<<<<<< * """Set tolerances for event zero crossings when using event handler. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.TS.setEventTolerances", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_vtol); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2071 * CHKERR( TSSetEventTolerances(self.ts, tolr, vtolr) ) * * def getNumEvents(self) -> int: # <<<<<<<<<<<<<< * """Return the number of events. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_177getNumEvents(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_176getNumEvents, "TS.getNumEvents(self) -> int\nReturn the number of events.\n\n Logically collective.\n\n See Also\n --------\n petsc.TSGetNumEvents\n\n \nSource code at petsc4py/PETSc/TS.pyx:2071"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_177getNumEvents(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getNumEvents (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getNumEvents", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getNumEvents", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_176getNumEvents(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_176getNumEvents(struct PyPetscTSObject *__pyx_v_self) { PetscInt __pyx_v_nevents; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getNumEvents", 1); /* "petsc4py/PETSc/TS.pyx":2081 * * """ * cdef PetscInt nevents = 0 # <<<<<<<<<<<<<< * CHKERR( TSGetNumEvents(self.ts, &nevents) ) * return toInt(nevents) */ __pyx_v_nevents = 0; /* "petsc4py/PETSc/TS.pyx":2082 * """ * cdef PetscInt nevents = 0 * CHKERR( TSGetNumEvents(self.ts, &nevents) ) # <<<<<<<<<<<<<< * return toInt(nevents) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetNumEvents(__pyx_v_self->ts, (&__pyx_v_nevents))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 2082, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":2083 * cdef PetscInt nevents = 0 * CHKERR( TSGetNumEvents(self.ts, &nevents) ) * return toInt(nevents) # <<<<<<<<<<<<<< * * # --- solving --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nevents); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 2083, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TS.pyx":2071 * CHKERR( TSSetEventTolerances(self.ts, tolr, vtolr) ) * * def getNumEvents(self) -> int: # <<<<<<<<<<<<<< * """Return the number of events. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TS.getNumEvents", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2087 * # --- solving --- * * def setPreStep( # <<<<<<<<<<<<<< * self, * prestep: TSPreStepFunction, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_179setPreStep(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_178setPreStep, "TS.setPreStep(self, prestep: TSPreStepFunction, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nSet a function to be called at the beginning of each time step.\n\n Logically collective.\n\n Parameters\n ----------\n prestep\n The function to be called at the beginning of each step.\n args\n Additional positional arguments for ``prestep``.\n kargs\n Additional keyword arguments for ``prestep``.\n\n See Also\n --------\n petsc.TSSetPreStep\n\n \nSource code at petsc4py/PETSc/TS.pyx:2087"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_179setPreStep(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_prestep = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPreStep (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_prestep,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; /* "petsc4py/PETSc/TS.pyx":2090 * self, * prestep: TSPreStepFunction, * args: tuple[Any, ...] | None = None, # <<<<<<<<<<<<<< * kargs: dict[str, Any] | None = None) -> None: * """Set a function to be called at the beginning of each time step. */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/TS.pyx":2091 * prestep: TSPreStepFunction, * args: tuple[Any, ...] | None = None, * kargs: dict[str, Any] | None = None) -> None: # <<<<<<<<<<<<<< * """Set a function to be called at the beginning of each time step. * */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_prestep)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 2087, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 2087, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 2087, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setPreStep") < 0)) __PYX_ERR(51, 2087, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_prestep = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPreStep", 0, 1, 3, __pyx_nargs); __PYX_ERR(51, 2087, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TS.setPreStep", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_178setPreStep(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_prestep, __pyx_v_args, __pyx_v_kargs); /* "petsc4py/PETSc/TS.pyx":2087 * # --- solving --- * * def setPreStep( # <<<<<<<<<<<<<< * self, * prestep: TSPreStepFunction, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_178setPreStep(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_prestep, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPreStep", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/TS.pyx":2110 * * """ * if prestep is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = (__pyx_v_prestep != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/TS.pyx":2111 * """ * if prestep is not None: * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (prestep, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/TS.pyx":2112 * if prestep is not None: * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (prestep, args, kargs) * self.set_attr('__prestep__', context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); if (__pyx_t_1) { __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 2112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_2); __pyx_t_2 = 0; } /* "petsc4py/PETSc/TS.pyx":2113 * if args is None: args = () * if kargs is None: kargs = {} * context = (prestep, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__prestep__', context) * CHKERR( TSSetPreStep(self.ts, TS_PreStep) ) */ __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 2113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_prestep); __Pyx_GIVEREF(__pyx_v_prestep); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_prestep)) __PYX_ERR(51, 2113, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_args)) __PYX_ERR(51, 2113, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_kargs)) __PYX_ERR(51, 2113, __pyx_L1_error); __pyx_v_context = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/TS.pyx":2114 * if kargs is None: kargs = {} * context = (prestep, args, kargs) * self.set_attr('__prestep__', context) # <<<<<<<<<<<<<< * CHKERR( TSSetPreStep(self.ts, TS_PreStep) ) * else: */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__prestep__"), __pyx_v_context); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 2114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/TS.pyx":2115 * context = (prestep, args, kargs) * self.set_attr('__prestep__', context) * CHKERR( TSSetPreStep(self.ts, TS_PreStep) ) # <<<<<<<<<<<<<< * else: * self.set_attr('__prestep__', None) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetPreStep(__pyx_v_self->ts, __pyx_f_8petsc4py_5PETSc_TS_PreStep)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 2115, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":2110 * * """ * if prestep is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ goto __pyx_L3; } /* "petsc4py/PETSc/TS.pyx":2117 * CHKERR( TSSetPreStep(self.ts, TS_PreStep) ) * else: * self.set_attr('__prestep__', None) # <<<<<<<<<<<<<< * CHKERR( TSSetPreStep(self.ts, NULL) ) * */ /*else*/ { __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__prestep__"), Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 2117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/TS.pyx":2118 * else: * self.set_attr('__prestep__', None) * CHKERR( TSSetPreStep(self.ts, NULL) ) # <<<<<<<<<<<<<< * * def getPreStep(self) -> tuple[TSPreStepFunction,tuple[Any, ...] | None,dict[str, Any] | None]: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetPreStep(__pyx_v_self->ts, NULL)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 2118, __pyx_L1_error) } __pyx_L3:; /* "petsc4py/PETSc/TS.pyx":2087 * # --- solving --- * * def setPreStep( # <<<<<<<<<<<<<< * self, * prestep: TSPreStepFunction, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TS.setPreStep", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2120 * CHKERR( TSSetPreStep(self.ts, NULL) ) * * def getPreStep(self) -> tuple[TSPreStepFunction,tuple[Any, ...] | None,dict[str, Any] | None]: # <<<<<<<<<<<<<< * """Return the prestep function. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_181getPreStep(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_180getPreStep, "TS.getPreStep(self) -> tuple[TSPreStepFunction, tuple[Any, ...] | None, dict[str, Any] | None]\nReturn the prestep function.\n\n See Also\n --------\n setPreStep\n\n \nSource code at petsc4py/PETSc/TS.pyx:2120"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_181getPreStep(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getPreStep (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getPreStep", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getPreStep", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_180getPreStep(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_180getPreStep(struct PyPetscTSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getPreStep", 1); /* "petsc4py/PETSc/TS.pyx":2128 * * """ * return self.get_attr('__prestep__') # <<<<<<<<<<<<<< * * def setPostStep(self, */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__prestep__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 2128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TS.pyx":2120 * CHKERR( TSSetPreStep(self.ts, NULL) ) * * def getPreStep(self) -> tuple[TSPreStepFunction,tuple[Any, ...] | None,dict[str, Any] | None]: # <<<<<<<<<<<<<< * """Return the prestep function. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TS.getPreStep", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2130 * return self.get_attr('__prestep__') * * def setPostStep(self, # <<<<<<<<<<<<<< * poststep: TSPostStepFunction, * args: tuple[Any, ...] | None = None, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_183setPostStep(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_182setPostStep, "TS.setPostStep(self, poststep: TSPostStepFunction, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nSet a function to be called at the end of each time step.\n\n Logically collective.\n\n Parameters\n ----------\n poststep\n The function to be called at the end of each step.\n args\n Additional positional arguments for ``poststep``.\n kargs\n Additional keyword arguments for ``poststep``.\n\n See Also\n --------\n petsc.TSSetPostStep\n\n \nSource code at petsc4py/PETSc/TS.pyx:2130"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_183setPostStep(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_poststep = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPostStep (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_poststep,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; /* "petsc4py/PETSc/TS.pyx":2132 * def setPostStep(self, * poststep: TSPostStepFunction, * args: tuple[Any, ...] | None = None, # <<<<<<<<<<<<<< * kargs: dict[str, Any] | None = None) -> None: * """Set a function to be called at the end of each time step. */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/TS.pyx":2133 * poststep: TSPostStepFunction, * args: tuple[Any, ...] | None = None, * kargs: dict[str, Any] | None = None) -> None: # <<<<<<<<<<<<<< * """Set a function to be called at the end of each time step. * */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_poststep)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 2130, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 2130, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 2130, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setPostStep") < 0)) __PYX_ERR(51, 2130, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_poststep = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPostStep", 0, 1, 3, __pyx_nargs); __PYX_ERR(51, 2130, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TS.setPostStep", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_182setPostStep(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_poststep, __pyx_v_args, __pyx_v_kargs); /* "petsc4py/PETSc/TS.pyx":2130 * return self.get_attr('__prestep__') * * def setPostStep(self, # <<<<<<<<<<<<<< * poststep: TSPostStepFunction, * args: tuple[Any, ...] | None = None, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_182setPostStep(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_poststep, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPostStep", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/TS.pyx":2152 * * """ * if poststep is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = (__pyx_v_poststep != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/TS.pyx":2153 * """ * if poststep is not None: * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (poststep, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/TS.pyx":2154 * if poststep is not None: * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (poststep, args, kargs) * self.set_attr('__poststep__', context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); if (__pyx_t_1) { __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 2154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_2); __pyx_t_2 = 0; } /* "petsc4py/PETSc/TS.pyx":2155 * if args is None: args = () * if kargs is None: kargs = {} * context = (poststep, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__poststep__', context) * CHKERR( TSSetPostStep(self.ts, TS_PostStep) ) */ __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 2155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_poststep); __Pyx_GIVEREF(__pyx_v_poststep); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_poststep)) __PYX_ERR(51, 2155, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_args)) __PYX_ERR(51, 2155, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_kargs)) __PYX_ERR(51, 2155, __pyx_L1_error); __pyx_v_context = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/TS.pyx":2156 * if kargs is None: kargs = {} * context = (poststep, args, kargs) * self.set_attr('__poststep__', context) # <<<<<<<<<<<<<< * CHKERR( TSSetPostStep(self.ts, TS_PostStep) ) * else: */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__poststep__"), __pyx_v_context); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 2156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/TS.pyx":2157 * context = (poststep, args, kargs) * self.set_attr('__poststep__', context) * CHKERR( TSSetPostStep(self.ts, TS_PostStep) ) # <<<<<<<<<<<<<< * else: * self.set_attr('__poststep__', None) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetPostStep(__pyx_v_self->ts, __pyx_f_8petsc4py_5PETSc_TS_PostStep)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 2157, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":2152 * * """ * if poststep is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ goto __pyx_L3; } /* "petsc4py/PETSc/TS.pyx":2159 * CHKERR( TSSetPostStep(self.ts, TS_PostStep) ) * else: * self.set_attr('__poststep__', None) # <<<<<<<<<<<<<< * CHKERR( TSSetPostStep(self.ts, NULL) ) * */ /*else*/ { __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__poststep__"), Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 2159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/TS.pyx":2160 * else: * self.set_attr('__poststep__', None) * CHKERR( TSSetPostStep(self.ts, NULL) ) # <<<<<<<<<<<<<< * * def getPostStep(self) -> tuple[TSPostStepFunction,tuple[Any, ...] | None,dict[str, Any] | None]: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetPostStep(__pyx_v_self->ts, NULL)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 2160, __pyx_L1_error) } __pyx_L3:; /* "petsc4py/PETSc/TS.pyx":2130 * return self.get_attr('__prestep__') * * def setPostStep(self, # <<<<<<<<<<<<<< * poststep: TSPostStepFunction, * args: tuple[Any, ...] | None = None, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TS.setPostStep", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2162 * CHKERR( TSSetPostStep(self.ts, NULL) ) * * def getPostStep(self) -> tuple[TSPostStepFunction,tuple[Any, ...] | None,dict[str, Any] | None]: # <<<<<<<<<<<<<< * """Return the poststep function.""" * return self.get_attr('__poststep__') */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_185getPostStep(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_184getPostStep, "TS.getPostStep(self) -> tuple[TSPostStepFunction, tuple[Any, ...] | None, dict[str, Any] | None]\nReturn the poststep function.\nSource code at petsc4py/PETSc/TS.pyx:2162"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_185getPostStep(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getPostStep (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getPostStep", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getPostStep", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_184getPostStep(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_184getPostStep(struct PyPetscTSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getPostStep", 1); /* "petsc4py/PETSc/TS.pyx":2164 * def getPostStep(self) -> tuple[TSPostStepFunction,tuple[Any, ...] | None,dict[str, Any] | None]: * """Return the poststep function.""" * return self.get_attr('__poststep__') # <<<<<<<<<<<<<< * * def setUp(self) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__poststep__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 2164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TS.pyx":2162 * CHKERR( TSSetPostStep(self.ts, NULL) ) * * def getPostStep(self) -> tuple[TSPostStepFunction,tuple[Any, ...] | None,dict[str, Any] | None]: # <<<<<<<<<<<<<< * """Return the poststep function.""" * return self.get_attr('__poststep__') */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TS.getPostStep", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2166 * return self.get_attr('__poststep__') * * def setUp(self) -> None: # <<<<<<<<<<<<<< * """Set up the internal data structures for the `TS`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_187setUp(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_186setUp, "TS.setUp(self) -> None\nSet up the internal data structures for the `TS`.\n\n Collective.\n\n See Also\n --------\n petsc.TSSetUp\n\n \nSource code at petsc4py/PETSc/TS.pyx:2166"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_187setUp(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setUp (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("setUp", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setUp", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_186setUp(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_186setUp(struct PyPetscTSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setUp", 1); /* "petsc4py/PETSc/TS.pyx":2176 * * """ * CHKERR( TSSetUp(self.ts) ) # <<<<<<<<<<<<<< * * def reset(self) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetUp(__pyx_v_self->ts)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 2176, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":2166 * return self.get_attr('__poststep__') * * def setUp(self) -> None: # <<<<<<<<<<<<<< * """Set up the internal data structures for the `TS`. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setUp", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2178 * CHKERR( TSSetUp(self.ts) ) * * def reset(self) -> None: # <<<<<<<<<<<<<< * """Reset the `TS`, removing any allocated vectors and matrices. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_189reset(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_188reset, "TS.reset(self) -> None\nReset the `TS`, removing any allocated vectors and matrices.\n\n Collective.\n\n See Also\n --------\n petsc.TSReset\n\n \nSource code at petsc4py/PETSc/TS.pyx:2178"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_189reset(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("reset (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("reset", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "reset", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_188reset(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_188reset(struct PyPetscTSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("reset", 1); /* "petsc4py/PETSc/TS.pyx":2188 * * """ * CHKERR( TSReset(self.ts) ) # <<<<<<<<<<<<<< * * def step(self) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSReset(__pyx_v_self->ts)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 2188, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":2178 * CHKERR( TSSetUp(self.ts) ) * * def reset(self) -> None: # <<<<<<<<<<<<<< * """Reset the `TS`, removing any allocated vectors and matrices. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.reset", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2190 * CHKERR( TSReset(self.ts) ) * * def step(self) -> None: # <<<<<<<<<<<<<< * """Take one step. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_191step(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_190step, "TS.step(self) -> None\nTake one step.\n\n Collective.\n\n The preferred interface for the `TS` solvers is `solve`. If\n you need to execute code at the beginning or ending of each step, use\n `setPreStep` and `setPostStep` respectively.\n\n See Also\n --------\n petsc.TSStep\n\n \nSource code at petsc4py/PETSc/TS.pyx:2190"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_191step(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("step (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("step", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "step", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_190step(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_190step(struct PyPetscTSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("step", 1); /* "petsc4py/PETSc/TS.pyx":2204 * * """ * CHKERR( TSStep(self.ts) ) # <<<<<<<<<<<<<< * * def restartStep(self) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSStep(__pyx_v_self->ts)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 2204, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":2190 * CHKERR( TSReset(self.ts) ) * * def step(self) -> None: # <<<<<<<<<<<<<< * """Take one step. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.step", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2206 * CHKERR( TSStep(self.ts) ) * * def restartStep(self) -> None: # <<<<<<<<<<<<<< * """Flag the solver to restart the next step. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_193restartStep(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_192restartStep, "TS.restartStep(self) -> None\nFlag the solver to restart the next step.\n\n Collective.\n\n Multistep methods like TSBDF or Runge-Kutta methods with\n FSAL property require restarting the solver in the event of\n discontinuities. These discontinuities may be introduced as a\n consequence of explicitly modifications to the solution vector (which\n PETSc attempts to detect and handle) or problem coefficients (which\n PETSc is not able to detect). For the sake of correctness and maximum\n safety, users are expected to call TSRestart() whenever they introduce\n discontinuities in callback routines (e.g. prestep and poststep\n routines, or implicit/rhs function routines with discontinuous source\n terms).\n\n See Also\n --------\n petsc.TSRestartStep\n\n \nSource code at petsc4py/PETSc/TS.pyx:2206"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_193restartStep(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("restartStep (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("restartStep", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "restartStep", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_192restartStep(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_192restartStep(struct PyPetscTSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("restartStep", 1); /* "petsc4py/PETSc/TS.pyx":2227 * * """ * CHKERR( TSRestartStep(self.ts) ) # <<<<<<<<<<<<<< * * def rollBack(self) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSRestartStep(__pyx_v_self->ts)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 2227, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":2206 * CHKERR( TSStep(self.ts) ) * * def restartStep(self) -> None: # <<<<<<<<<<<<<< * """Flag the solver to restart the next step. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.restartStep", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2229 * CHKERR( TSRestartStep(self.ts) ) * * def rollBack(self) -> None: # <<<<<<<<<<<<<< * """Roll back one time step. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_195rollBack(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_194rollBack, "TS.rollBack(self) -> None\nRoll back one time step.\n\n See Also\n --------\n petsc.TSRollBack\n\n \nSource code at petsc4py/PETSc/TS.pyx:2229"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_195rollBack(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("rollBack (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("rollBack", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "rollBack", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_194rollBack(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_194rollBack(struct PyPetscTSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("rollBack", 1); /* "petsc4py/PETSc/TS.pyx":2237 * * """ * CHKERR( TSRollBack(self.ts) ) # <<<<<<<<<<<<<< * * def solve(self, Vec u) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSRollBack(__pyx_v_self->ts)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 2237, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":2229 * CHKERR( TSRestartStep(self.ts) ) * * def rollBack(self) -> None: # <<<<<<<<<<<<<< * """Roll back one time step. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.rollBack", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2239 * CHKERR( TSRollBack(self.ts) ) * * def solve(self, Vec u) -> None: # <<<<<<<<<<<<<< * """Step the requested number of timesteps. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_197solve(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_196solve, "TS.solve(self, u: Vec) -> None\nStep the requested number of timesteps.\n\n Collective.\n\n Parameters\n ----------\n u\n The solution vector. Can be `None` if `setSolution` was used and\n `setExactFinalTime` is not set as ``TS_EXACTFINALTIME_MATCHSTEP``.\n Otherwise this vector must contain the initial conditions and will\n contain the solution at the final requested time.\n\n See Also\n --------\n petsc.TSSolve\n\n \nSource code at petsc4py/PETSc/TS.pyx:2239"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_197solve(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_u = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("solve (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_u,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_u)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 2239, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "solve") < 0)) __PYX_ERR(51, 2239, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_u = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("solve", 1, 1, 1, __pyx_nargs); __PYX_ERR(51, 2239, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TS.solve", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_u), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "u", 0))) __PYX_ERR(51, 2239, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_196solve(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_u); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_196solve(struct PyPetscTSObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_u) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("solve", 1); /* "petsc4py/PETSc/TS.pyx":2257 * * """ * CHKERR( TSSolve(self.ts, u.vec) ) # <<<<<<<<<<<<<< * * def interpolate(self, t: float, Vec u) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSolve(__pyx_v_self->ts, __pyx_v_u->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 2257, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":2239 * CHKERR( TSRollBack(self.ts) ) * * def solve(self, Vec u) -> None: # <<<<<<<<<<<<<< * """Step the requested number of timesteps. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.solve", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2259 * CHKERR( TSSolve(self.ts, u.vec) ) * * def interpolate(self, t: float, Vec u) -> None: # <<<<<<<<<<<<<< * """Interpolate the solution to a given time. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_199interpolate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_198interpolate, "TS.interpolate(self, t: float, u: Vec) -> None\nInterpolate the solution to a given time.\n\n Collective.\n\n Parameters\n ----------\n t\n The time to interpolate.\n u\n The state vector to interpolate.\n\n See Also\n --------\n petsc.TSInterpolate\n\n \nSource code at petsc4py/PETSc/TS.pyx:2259"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_199interpolate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_t = 0; struct PyPetscVecObject *__pyx_v_u = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("interpolate (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_u,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 2259, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_u)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 2259, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("interpolate", 1, 2, 2, 1); __PYX_ERR(51, 2259, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "interpolate") < 0)) __PYX_ERR(51, 2259, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_t = values[0]; __pyx_v_u = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("interpolate", 1, 2, 2, __pyx_nargs); __PYX_ERR(51, 2259, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TS.interpolate", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_u), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "u", 0))) __PYX_ERR(51, 2259, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_198interpolate(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_t, __pyx_v_u); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_198interpolate(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_t, struct PyPetscVecObject *__pyx_v_u) { PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("interpolate", 1); /* "petsc4py/PETSc/TS.pyx":2276 * * """ * cdef PetscReal rval = asReal(t) # <<<<<<<<<<<<<< * CHKERR( TSInterpolate(self.ts, rval, u.vec) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_t); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(51, 2276, __pyx_L1_error) __pyx_v_rval = __pyx_t_1; /* "petsc4py/PETSc/TS.pyx":2277 * """ * cdef PetscReal rval = asReal(t) * CHKERR( TSInterpolate(self.ts, rval, u.vec) ) # <<<<<<<<<<<<<< * * def setStepLimits(self, hmin: float, hmax: float) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSInterpolate(__pyx_v_self->ts, __pyx_v_rval, __pyx_v_u->vec)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 2277, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":2259 * CHKERR( TSSolve(self.ts, u.vec) ) * * def interpolate(self, t: float, Vec u) -> None: # <<<<<<<<<<<<<< * """Interpolate the solution to a given time. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.interpolate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2279 * CHKERR( TSInterpolate(self.ts, rval, u.vec) ) * * def setStepLimits(self, hmin: float, hmax: float) -> None: # <<<<<<<<<<<<<< * """Set the minimum and maximum allowed step sizes. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_201setStepLimits(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_200setStepLimits, "TS.setStepLimits(self, hmin: float, hmax: float) -> None\nSet the minimum and maximum allowed step sizes.\n\n Logically collective.\n\n Parameters\n ----------\n hmin\n the minimum step size\n hmax\n the maximum step size\n\n See Also\n --------\n petsc.TSAdaptSetStepLimits\n\n \nSource code at petsc4py/PETSc/TS.pyx:2279"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_201setStepLimits(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_hmin = 0; PyObject *__pyx_v_hmax = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setStepLimits (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_hmin,&__pyx_n_s_hmax,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_hmin)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 2279, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_hmax)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 2279, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setStepLimits", 1, 2, 2, 1); __PYX_ERR(51, 2279, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setStepLimits") < 0)) __PYX_ERR(51, 2279, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_hmin = values[0]; __pyx_v_hmax = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setStepLimits", 1, 2, 2, __pyx_nargs); __PYX_ERR(51, 2279, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TS.setStepLimits", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_200setStepLimits(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_hmin, __pyx_v_hmax); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_200setStepLimits(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_hmin, PyObject *__pyx_v_hmax) { TSAdapt __pyx_v_tsadapt; PetscReal __pyx_v_hminr; PetscReal __pyx_v_hmaxr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setStepLimits", 1); /* "petsc4py/PETSc/TS.pyx":2296 * * """ * cdef PetscTSAdapt tsadapt = NULL # <<<<<<<<<<<<<< * cdef PetscReal hminr = toReal(hmin) * cdef PetscReal hmaxr = toReal(hmax) */ __pyx_v_tsadapt = NULL; /* "petsc4py/PETSc/TS.pyx":2297 * """ * cdef PetscTSAdapt tsadapt = NULL * cdef PetscReal hminr = toReal(hmin) # <<<<<<<<<<<<<< * cdef PetscReal hmaxr = toReal(hmax) * TSGetAdapt(self.ts, &tsadapt) */ __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_hmin); if (unlikely((__pyx_t_1 == ((PetscReal)-1)) && PyErr_Occurred())) __PYX_ERR(51, 2297, __pyx_L1_error) __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 2297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_1 == ((PetscReal)-1)) && PyErr_Occurred())) __PYX_ERR(51, 2297, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_hminr = __pyx_t_1; /* "petsc4py/PETSc/TS.pyx":2298 * cdef PetscTSAdapt tsadapt = NULL * cdef PetscReal hminr = toReal(hmin) * cdef PetscReal hmaxr = toReal(hmax) # <<<<<<<<<<<<<< * TSGetAdapt(self.ts, &tsadapt) * CHKERR( TSAdaptSetStepLimits(tsadapt, hminr, hmaxr) ) */ __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_hmax); if (unlikely((__pyx_t_1 == ((PetscReal)-1)) && PyErr_Occurred())) __PYX_ERR(51, 2298, __pyx_L1_error) __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 2298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_1 == ((PetscReal)-1)) && PyErr_Occurred())) __PYX_ERR(51, 2298, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_hmaxr = __pyx_t_1; /* "petsc4py/PETSc/TS.pyx":2299 * cdef PetscReal hminr = toReal(hmin) * cdef PetscReal hmaxr = toReal(hmax) * TSGetAdapt(self.ts, &tsadapt) # <<<<<<<<<<<<<< * CHKERR( TSAdaptSetStepLimits(tsadapt, hminr, hmaxr) ) * */ (void)(TSGetAdapt(__pyx_v_self->ts, (&__pyx_v_tsadapt))); /* "petsc4py/PETSc/TS.pyx":2300 * cdef PetscReal hmaxr = toReal(hmax) * TSGetAdapt(self.ts, &tsadapt) * CHKERR( TSAdaptSetStepLimits(tsadapt, hminr, hmaxr) ) # <<<<<<<<<<<<<< * * def getStepLimits(self) -> tuple[float,float]: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSAdaptSetStepLimits(__pyx_v_tsadapt, __pyx_v_hminr, __pyx_v_hmaxr)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 2300, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":2279 * CHKERR( TSInterpolate(self.ts, rval, u.vec) ) * * def setStepLimits(self, hmin: float, hmax: float) -> None: # <<<<<<<<<<<<<< * """Set the minimum and maximum allowed step sizes. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TS.setStepLimits", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2302 * CHKERR( TSAdaptSetStepLimits(tsadapt, hminr, hmaxr) ) * * def getStepLimits(self) -> tuple[float,float]: # <<<<<<<<<<<<<< * """Return the minimum and maximum allowed time step sizes. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_203getStepLimits(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_202getStepLimits, "TS.getStepLimits(self) -> tuple[float, float]\nReturn the minimum and maximum allowed time step sizes.\n\n See Also\n --------\n petsc.TSAdaptGetStepLimits\n\n \nSource code at petsc4py/PETSc/TS.pyx:2302"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_203getStepLimits(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getStepLimits (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getStepLimits", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getStepLimits", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_202getStepLimits(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_202getStepLimits(struct PyPetscTSObject *__pyx_v_self) { TSAdapt __pyx_v_tsadapt; PetscReal __pyx_v_hminr; PetscReal __pyx_v_hmaxr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscReal __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getStepLimits", 1); /* "petsc4py/PETSc/TS.pyx":2310 * * """ * cdef PetscTSAdapt tsadapt = NULL # <<<<<<<<<<<<<< * cdef PetscReal hminr = 0. * cdef PetscReal hmaxr = 0. */ __pyx_v_tsadapt = NULL; /* "petsc4py/PETSc/TS.pyx":2311 * """ * cdef PetscTSAdapt tsadapt = NULL * cdef PetscReal hminr = 0. # <<<<<<<<<<<<<< * cdef PetscReal hmaxr = 0. * TSGetAdapt(self.ts, &tsadapt) */ __pyx_v_hminr = 0.; /* "petsc4py/PETSc/TS.pyx":2312 * cdef PetscTSAdapt tsadapt = NULL * cdef PetscReal hminr = 0. * cdef PetscReal hmaxr = 0. # <<<<<<<<<<<<<< * TSGetAdapt(self.ts, &tsadapt) * CHKERR( TSAdaptGetStepLimits(tsadapt, &hminr, &hmaxr) ) */ __pyx_v_hmaxr = 0.; /* "petsc4py/PETSc/TS.pyx":2313 * cdef PetscReal hminr = 0. * cdef PetscReal hmaxr = 0. * TSGetAdapt(self.ts, &tsadapt) # <<<<<<<<<<<<<< * CHKERR( TSAdaptGetStepLimits(tsadapt, &hminr, &hmaxr) ) * return (asReal(hminr), asReal(hmaxr)) */ (void)(TSGetAdapt(__pyx_v_self->ts, (&__pyx_v_tsadapt))); /* "petsc4py/PETSc/TS.pyx":2314 * cdef PetscReal hmaxr = 0. * TSGetAdapt(self.ts, &tsadapt) * CHKERR( TSAdaptGetStepLimits(tsadapt, &hminr, &hmaxr) ) # <<<<<<<<<<<<<< * return (asReal(hminr), asReal(hmaxr)) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSAdaptGetStepLimits(__pyx_v_tsadapt, (&__pyx_v_hminr), (&__pyx_v_hmaxr))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 2314, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":2315 * TSGetAdapt(self.ts, &tsadapt) * CHKERR( TSAdaptGetStepLimits(tsadapt, &hminr, &hmaxr) ) * return (asReal(hminr), asReal(hmaxr)) # <<<<<<<<<<<<<< * * # --- Adjoint methods --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyFloat_FromDouble(__pyx_v_hminr); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 2315, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_t_2); if (unlikely(__pyx_t_3 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(51, 2315, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyFloat_FromDouble(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 2315, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyFloat_FromDouble(__pyx_v_hmaxr); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 2315, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_t_4); if (unlikely(__pyx_t_3 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(51, 2315, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyFloat_FromDouble(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 2315, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 2315, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2)) __PYX_ERR(51, 2315, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4)) __PYX_ERR(51, 2315, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_4 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TS.pyx":2302 * CHKERR( TSAdaptSetStepLimits(tsadapt, hminr, hmaxr) ) * * def getStepLimits(self) -> tuple[float,float]: # <<<<<<<<<<<<<< * """Return the minimum and maximum allowed time step sizes. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.TS.getStepLimits", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2319 * # --- Adjoint methods --- * * def setSaveTrajectory(self) -> None: # <<<<<<<<<<<<<< * """Enable to save solutions as an internal `TS` trajectory. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_205setSaveTrajectory(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_204setSaveTrajectory, "TS.setSaveTrajectory(self) -> None\nEnable to save solutions as an internal `TS` trajectory.\n\n Collective.\n\n This routine should be called after all `TS` options have\n been set.\n\n Notes\n -----\n ``-ts_save_trajectory`` can be used to save a trajectory to a file.\n\n See Also\n --------\n petsc.TSSetSaveTrajectory\n\n \nSource code at petsc4py/PETSc/TS.pyx:2319"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_205setSaveTrajectory(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setSaveTrajectory (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("setSaveTrajectory", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setSaveTrajectory", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_204setSaveTrajectory(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_204setSaveTrajectory(struct PyPetscTSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setSaveTrajectory", 1); /* "petsc4py/PETSc/TS.pyx":2336 * * """ * CHKERR(TSSetSaveTrajectory(self.ts)) # <<<<<<<<<<<<<< * * def removeTrajectory(self) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetSaveTrajectory(__pyx_v_self->ts)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 2336, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":2319 * # --- Adjoint methods --- * * def setSaveTrajectory(self) -> None: # <<<<<<<<<<<<<< * """Enable to save solutions as an internal `TS` trajectory. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setSaveTrajectory", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2338 * CHKERR(TSSetSaveTrajectory(self.ts)) * * def removeTrajectory(self) -> None: # <<<<<<<<<<<<<< * """Remove the internal `TS` trajectory object. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_207removeTrajectory(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_206removeTrajectory, "TS.removeTrajectory(self) -> None\nRemove the internal `TS` trajectory object.\n\n Collective.\n\n See Also\n --------\n petsc.TSRemoveTrajectory\n\n \nSource code at petsc4py/PETSc/TS.pyx:2338"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_207removeTrajectory(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("removeTrajectory (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("removeTrajectory", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "removeTrajectory", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_206removeTrajectory(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_206removeTrajectory(struct PyPetscTSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("removeTrajectory", 1); /* "petsc4py/PETSc/TS.pyx":2348 * * """ * CHKERR(TSRemoveTrajectory(self.ts)) # <<<<<<<<<<<<<< * * def getCostIntegral(self) -> Vec: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSRemoveTrajectory(__pyx_v_self->ts)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 2348, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":2338 * CHKERR(TSSetSaveTrajectory(self.ts)) * * def removeTrajectory(self) -> None: # <<<<<<<<<<<<<< * """Remove the internal `TS` trajectory object. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.removeTrajectory", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2350 * CHKERR(TSRemoveTrajectory(self.ts)) * * def getCostIntegral(self) -> Vec: # <<<<<<<<<<<<<< * """Return a vector of values of the integral term in the cost functions. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_209getCostIntegral(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_208getCostIntegral, "TS.getCostIntegral(self) -> Vec\nReturn a vector of values of the integral term in the cost functions.\n\n See Also\n --------\n petsc.TSGetCostIntegral\n\n \nSource code at petsc4py/PETSc/TS.pyx:2350"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_209getCostIntegral(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getCostIntegral (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getCostIntegral", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getCostIntegral", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_208getCostIntegral(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_208getCostIntegral(struct PyPetscTSObject *__pyx_v_self) { struct PyPetscVecObject *__pyx_v_cost = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getCostIntegral", 1); /* "petsc4py/PETSc/TS.pyx":2358 * * """ * cdef Vec cost = Vec() # <<<<<<<<<<<<<< * CHKERR( TSGetCostIntegral(self.ts, &cost.vec) ) * CHKERR( PetscINCREF(cost.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 2358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_cost = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/TS.pyx":2359 * """ * cdef Vec cost = Vec() * CHKERR( TSGetCostIntegral(self.ts, &cost.vec) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(cost.obj) ) * return cost */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetCostIntegral(__pyx_v_self->ts, (&__pyx_v_cost->vec))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 2359, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":2360 * cdef Vec cost = Vec() * CHKERR( TSGetCostIntegral(self.ts, &cost.vec) ) * CHKERR( PetscINCREF(cost.obj) ) # <<<<<<<<<<<<<< * return cost * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_cost->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 2360, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":2361 * CHKERR( TSGetCostIntegral(self.ts, &cost.vec) ) * CHKERR( PetscINCREF(cost.obj) ) * return cost # <<<<<<<<<<<<<< * * def setCostGradients( */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_cost); __pyx_r = ((PyObject *)__pyx_v_cost); goto __pyx_L0; /* "petsc4py/PETSc/TS.pyx":2350 * CHKERR(TSRemoveTrajectory(self.ts)) * * def getCostIntegral(self) -> Vec: # <<<<<<<<<<<<<< * """Return a vector of values of the integral term in the cost functions. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TS.getCostIntegral", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_cost); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2363 * return cost * * def setCostGradients( # <<<<<<<<<<<<<< * self, * vl: Vec | Sequence[Vec] | None, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_211setCostGradients(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_210setCostGradients, "TS.setCostGradients(self, vl: Vec | Sequence[Vec] | None, vm: Vec | Sequence[Vec] | None = None) -> None\nSet the cost gradients.\n\n Logically collective.\n\n Parameters\n ----------\n vl\n gradients with respect to the initial condition variables, the\n dimension and parallel layout of these vectors is the same as the\n ODE solution vector\n vm\n gradients with respect to the parameters, the number of entries in\n these vectors is the same as the number of parameters\n\n See Also\n --------\n petsc.TSSetCostGradients\n\n \nSource code at petsc4py/PETSc/TS.pyx:2363"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_211setCostGradients(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_vl = 0; PyObject *__pyx_v_vm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setCostGradients (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vl,&__pyx_n_s_vm,0}; /* "petsc4py/PETSc/TS.pyx":2366 * self, * vl: Vec | Sequence[Vec] | None, * vm: Vec | Sequence[Vec] | None = None) -> None: # <<<<<<<<<<<<<< * """Set the cost gradients. * */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vl)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 2363, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vm); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 2363, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setCostGradients") < 0)) __PYX_ERR(51, 2363, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_vl = values[0]; __pyx_v_vm = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setCostGradients", 0, 1, 2, __pyx_nargs); __PYX_ERR(51, 2363, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TS.setCostGradients", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_210setCostGradients(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_vl, __pyx_v_vm); /* "petsc4py/PETSc/TS.pyx":2363 * return cost * * def setCostGradients( # <<<<<<<<<<<<<< * self, * vl: Vec | Sequence[Vec] | None, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_210setCostGradients(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_vl, PyObject *__pyx_v_vm) { PetscInt __pyx_v_n; Vec *__pyx_v_vecl; Vec *__pyx_v_vecm; PyObject *__pyx_v_mem1 = 0; PyObject *__pyx_v_mem2 = 0; long __pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; PyObject *__pyx_t_4 = NULL; PetscInt __pyx_t_5; Vec __pyx_t_6; PetscErrorCode __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setCostGradients", 0); __Pyx_INCREF(__pyx_v_vl); __Pyx_INCREF(__pyx_v_vm); /* "petsc4py/PETSc/TS.pyx":2386 * * """ * cdef PetscInt n = 0; # <<<<<<<<<<<<<< * cdef PetscVec *vecl = NULL * cdef PetscVec *vecm = NULL */ __pyx_v_n = 0; /* "petsc4py/PETSc/TS.pyx":2387 * """ * cdef PetscInt n = 0; * cdef PetscVec *vecl = NULL # <<<<<<<<<<<<<< * cdef PetscVec *vecm = NULL * cdef mem1 = None, mem2 = None */ __pyx_v_vecl = NULL; /* "petsc4py/PETSc/TS.pyx":2388 * cdef PetscInt n = 0; * cdef PetscVec *vecl = NULL * cdef PetscVec *vecm = NULL # <<<<<<<<<<<<<< * cdef mem1 = None, mem2 = None * if isinstance(vl, Vec): vl = [vl] */ __pyx_v_vecm = NULL; /* "petsc4py/PETSc/TS.pyx":2389 * cdef PetscVec *vecl = NULL * cdef PetscVec *vecm = NULL * cdef mem1 = None, mem2 = None # <<<<<<<<<<<<<< * if isinstance(vl, Vec): vl = [vl] * if isinstance(vm, Vec): vm = [vm] */ __Pyx_INCREF(Py_None); __pyx_v_mem1 = Py_None; __Pyx_INCREF(Py_None); __pyx_v_mem2 = Py_None; /* "petsc4py/PETSc/TS.pyx":2390 * cdef PetscVec *vecm = NULL * cdef mem1 = None, mem2 = None * if isinstance(vl, Vec): vl = [vl] # <<<<<<<<<<<<<< * if isinstance(vm, Vec): vm = [vm] * if vl is not None: */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_vl, __pyx_ptype_8petsc4py_5PETSc_Vec); if (__pyx_t_1) { __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 2390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_vl); __Pyx_GIVEREF(__pyx_v_vl); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_v_vl)) __PYX_ERR(51, 2390, __pyx_L1_error); __Pyx_DECREF_SET(__pyx_v_vl, __pyx_t_2); __pyx_t_2 = 0; } /* "petsc4py/PETSc/TS.pyx":2391 * cdef mem1 = None, mem2 = None * if isinstance(vl, Vec): vl = [vl] * if isinstance(vm, Vec): vm = [vm] # <<<<<<<<<<<<<< * if vl is not None: * n = len(vl) */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_vm, __pyx_ptype_8petsc4py_5PETSc_Vec); if (__pyx_t_1) { __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 2391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_vm); __Pyx_GIVEREF(__pyx_v_vm); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_v_vm)) __PYX_ERR(51, 2391, __pyx_L1_error); __Pyx_DECREF_SET(__pyx_v_vm, __pyx_t_2); __pyx_t_2 = 0; } /* "petsc4py/PETSc/TS.pyx":2392 * if isinstance(vl, Vec): vl = [vl] * if isinstance(vm, Vec): vm = [vm] * if vl is not None: # <<<<<<<<<<<<<< * n = len(vl) * elif vm is not None: */ __pyx_t_1 = (__pyx_v_vl != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/TS.pyx":2393 * if isinstance(vm, Vec): vm = [vm] * if vl is not None: * n = len(vl) # <<<<<<<<<<<<<< * elif vm is not None: * n = len(vm) */ __pyx_t_3 = PyObject_Length(__pyx_v_vl); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(51, 2393, __pyx_L1_error) __pyx_v_n = ((PetscInt)__pyx_t_3); /* "petsc4py/PETSc/TS.pyx":2392 * if isinstance(vl, Vec): vl = [vl] * if isinstance(vm, Vec): vm = [vm] * if vl is not None: # <<<<<<<<<<<<<< * n = len(vl) * elif vm is not None: */ goto __pyx_L5; } /* "petsc4py/PETSc/TS.pyx":2394 * if vl is not None: * n = len(vl) * elif vm is not None: # <<<<<<<<<<<<<< * n = len(vm) * if vl is not None: */ __pyx_t_1 = (__pyx_v_vm != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/TS.pyx":2395 * n = len(vl) * elif vm is not None: * n = len(vm) # <<<<<<<<<<<<<< * if vl is not None: * assert len(vl) == n */ __pyx_t_3 = PyObject_Length(__pyx_v_vm); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(51, 2395, __pyx_L1_error) __pyx_v_n = ((PetscInt)__pyx_t_3); /* "petsc4py/PETSc/TS.pyx":2394 * if vl is not None: * n = len(vl) * elif vm is not None: # <<<<<<<<<<<<<< * n = len(vm) * if vl is not None: */ } __pyx_L5:; /* "petsc4py/PETSc/TS.pyx":2396 * elif vm is not None: * n = len(vm) * if vl is not None: # <<<<<<<<<<<<<< * assert len(vl) == n * mem1 = oarray_p(empty_p(n), NULL, &vecl) */ __pyx_t_1 = (__pyx_v_vl != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/TS.pyx":2397 * n = len(vm) * if vl is not None: * assert len(vl) == n # <<<<<<<<<<<<<< * mem1 = oarray_p(empty_p(n), NULL, &vecl) * for i from 0 <= i < n: */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_3 = PyObject_Length(__pyx_v_vl); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(51, 2397, __pyx_L1_error) __pyx_t_1 = (__pyx_t_3 == ((Py_ssize_t)__pyx_v_n)); if (unlikely(!__pyx_t_1)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(51, 2397, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(51, 2397, __pyx_L1_error) #endif /* "petsc4py/PETSc/TS.pyx":2398 * if vl is not None: * assert len(vl) == n * mem1 = oarray_p(empty_p(n), NULL, &vecl) # <<<<<<<<<<<<<< * for i from 0 <= i < n: * vecl[i] = (vl[i]).vec */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_n)); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 2398, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_2, NULL, ((void **)(&__pyx_v_vecl)))); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 2398, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_mem1, __pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/TS.pyx":2399 * assert len(vl) == n * mem1 = oarray_p(empty_p(n), NULL, &vecl) * for i from 0 <= i < n: # <<<<<<<<<<<<<< * vecl[i] = (vl[i]).vec * if vm is not None: */ __pyx_t_5 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) { /* "petsc4py/PETSc/TS.pyx":2400 * mem1 = oarray_p(empty_p(n), NULL, &vecl) * for i from 0 <= i < n: * vecl[i] = (vl[i]).vec # <<<<<<<<<<<<<< * if vm is not None: * assert len(vm) == n */ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_vl, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 2400, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (!(likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_8petsc4py_5PETSc_Vec)))) __PYX_ERR(51, 2400, __pyx_L1_error) __pyx_t_6 = ((struct PyPetscVecObject *)__pyx_t_4)->vec; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; (__pyx_v_vecl[__pyx_v_i]) = __pyx_t_6; } /* "petsc4py/PETSc/TS.pyx":2396 * elif vm is not None: * n = len(vm) * if vl is not None: # <<<<<<<<<<<<<< * assert len(vl) == n * mem1 = oarray_p(empty_p(n), NULL, &vecl) */ } /* "petsc4py/PETSc/TS.pyx":2401 * for i from 0 <= i < n: * vecl[i] = (vl[i]).vec * if vm is not None: # <<<<<<<<<<<<<< * assert len(vm) == n * mem2 = oarray_p(empty_p(n), NULL, &vecm) */ __pyx_t_1 = (__pyx_v_vm != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/TS.pyx":2402 * vecl[i] = (vl[i]).vec * if vm is not None: * assert len(vm) == n # <<<<<<<<<<<<<< * mem2 = oarray_p(empty_p(n), NULL, &vecm) * for i from 0 <= i < n: */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_3 = PyObject_Length(__pyx_v_vm); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(51, 2402, __pyx_L1_error) __pyx_t_1 = (__pyx_t_3 == ((Py_ssize_t)__pyx_v_n)); if (unlikely(!__pyx_t_1)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(51, 2402, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(51, 2402, __pyx_L1_error) #endif /* "petsc4py/PETSc/TS.pyx":2403 * if vm is not None: * assert len(vm) == n * mem2 = oarray_p(empty_p(n), NULL, &vecm) # <<<<<<<<<<<<<< * for i from 0 <= i < n: * vecm[i] = (vm[i]).vec */ __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_n)); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 2403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_4, NULL, ((void **)(&__pyx_v_vecm)))); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 2403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_mem2, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/TS.pyx":2404 * assert len(vm) == n * mem2 = oarray_p(empty_p(n), NULL, &vecm) * for i from 0 <= i < n: # <<<<<<<<<<<<<< * vecm[i] = (vm[i]).vec * self.set_attr('__costgradients_memory', (mem1, mem2)) */ __pyx_t_5 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) { /* "petsc4py/PETSc/TS.pyx":2405 * mem2 = oarray_p(empty_p(n), NULL, &vecm) * for i from 0 <= i < n: * vecm[i] = (vm[i]).vec # <<<<<<<<<<<<<< * self.set_attr('__costgradients_memory', (mem1, mem2)) * CHKERR( TSSetCostGradients(self.ts, n, vecl, vecm) ) */ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_vm, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 2405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (!(likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_Vec)))) __PYX_ERR(51, 2405, __pyx_L1_error) __pyx_t_6 = ((struct PyPetscVecObject *)__pyx_t_2)->vec; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; (__pyx_v_vecm[__pyx_v_i]) = __pyx_t_6; } /* "petsc4py/PETSc/TS.pyx":2401 * for i from 0 <= i < n: * vecl[i] = (vl[i]).vec * if vm is not None: # <<<<<<<<<<<<<< * assert len(vm) == n * mem2 = oarray_p(empty_p(n), NULL, &vecm) */ } /* "petsc4py/PETSc/TS.pyx":2406 * for i from 0 <= i < n: * vecm[i] = (vm[i]).vec * self.set_attr('__costgradients_memory', (mem1, mem2)) # <<<<<<<<<<<<<< * CHKERR( TSSetCostGradients(self.ts, n, vecl, vecm) ) * */ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 2406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_mem1); __Pyx_GIVEREF(__pyx_v_mem1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_mem1)) __PYX_ERR(51, 2406, __pyx_L1_error); __Pyx_INCREF(__pyx_v_mem2); __Pyx_GIVEREF(__pyx_v_mem2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_mem2)) __PYX_ERR(51, 2406, __pyx_L1_error); __pyx_t_4 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__costgradients_memory"), __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 2406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/TS.pyx":2407 * vecm[i] = (vm[i]).vec * self.set_attr('__costgradients_memory', (mem1, mem2)) * CHKERR( TSSetCostGradients(self.ts, n, vecl, vecm) ) # <<<<<<<<<<<<<< * * def getCostGradients(self) -> tuple[list[Vec],list[Vec]]: */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetCostGradients(__pyx_v_self->ts, __pyx_v_n, __pyx_v_vecl, __pyx_v_vecm)); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 2407, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":2363 * return cost * * def setCostGradients( # <<<<<<<<<<<<<< * self, * vl: Vec | Sequence[Vec] | None, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.TS.setCostGradients", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_mem1); __Pyx_XDECREF(__pyx_v_mem2); __Pyx_XDECREF(__pyx_v_vl); __Pyx_XDECREF(__pyx_v_vm); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2409 * CHKERR( TSSetCostGradients(self.ts, n, vecl, vecm) ) * * def getCostGradients(self) -> tuple[list[Vec],list[Vec]]: # <<<<<<<<<<<<<< * """Return the cost gradients. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_213getCostGradients(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_212getCostGradients, "TS.getCostGradients(self) -> tuple[list[Vec], list[Vec]]\nReturn the cost gradients.\n\n See Also\n --------\n setCostGradients, petsc.TSGetCostGradients\n\n \nSource code at petsc4py/PETSc/TS.pyx:2409"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_213getCostGradients(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getCostGradients (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getCostGradients", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getCostGradients", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_212getCostGradients(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_212getCostGradients(struct PyPetscTSObject *__pyx_v_self) { CYTHON_UNUSED PetscInt __pyx_v_i; PetscInt __pyx_v_n; Vec *__pyx_v_vecl; Vec *__pyx_v_vecm; PyObject *__pyx_v_vl = 0; PyObject *__pyx_v_vm = 0; PetscInt __pyx_9genexpr12__pyx_v_i; PetscInt __pyx_9genexpr13__pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PetscInt __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getCostGradients", 1); /* "petsc4py/PETSc/TS.pyx":2417 * * """ * cdef PetscInt i = 0, n = 0 # <<<<<<<<<<<<<< * cdef PetscVec *vecl = NULL * cdef PetscVec *vecm = NULL */ __pyx_v_i = 0; __pyx_v_n = 0; /* "petsc4py/PETSc/TS.pyx":2418 * """ * cdef PetscInt i = 0, n = 0 * cdef PetscVec *vecl = NULL # <<<<<<<<<<<<<< * cdef PetscVec *vecm = NULL * CHKERR( TSGetCostGradients(self.ts, &n, &vecl, &vecm) ) */ __pyx_v_vecl = NULL; /* "petsc4py/PETSc/TS.pyx":2419 * cdef PetscInt i = 0, n = 0 * cdef PetscVec *vecl = NULL * cdef PetscVec *vecm = NULL # <<<<<<<<<<<<<< * CHKERR( TSGetCostGradients(self.ts, &n, &vecl, &vecm) ) * cdef object vl = None, vm = None */ __pyx_v_vecm = NULL; /* "petsc4py/PETSc/TS.pyx":2420 * cdef PetscVec *vecl = NULL * cdef PetscVec *vecm = NULL * CHKERR( TSGetCostGradients(self.ts, &n, &vecl, &vecm) ) # <<<<<<<<<<<<<< * cdef object vl = None, vm = None * if vecl != NULL: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetCostGradients(__pyx_v_self->ts, (&__pyx_v_n), (&__pyx_v_vecl), (&__pyx_v_vecm))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 2420, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":2421 * cdef PetscVec *vecm = NULL * CHKERR( TSGetCostGradients(self.ts, &n, &vecl, &vecm) ) * cdef object vl = None, vm = None # <<<<<<<<<<<<<< * if vecl != NULL: * vl = [ref_Vec(vecl[i]) for i from 0 <= i < n] */ __Pyx_INCREF(Py_None); __pyx_v_vl = Py_None; __Pyx_INCREF(Py_None); __pyx_v_vm = Py_None; /* "petsc4py/PETSc/TS.pyx":2422 * CHKERR( TSGetCostGradients(self.ts, &n, &vecl, &vecm) ) * cdef object vl = None, vm = None * if vecl != NULL: # <<<<<<<<<<<<<< * vl = [ref_Vec(vecl[i]) for i from 0 <= i < n] * if vecm != NULL: */ __pyx_t_2 = (__pyx_v_vecl != NULL); if (__pyx_t_2) { /* "petsc4py/PETSc/TS.pyx":2423 * cdef object vl = None, vm = None * if vecl != NULL: * vl = [ref_Vec(vecl[i]) for i from 0 <= i < n] # <<<<<<<<<<<<<< * if vecm != NULL: * vm = [ref_Vec(vecm[i]) for i from 0 <= i < n] */ { /* enter inner scope */ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 2423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_v_n; for (__pyx_9genexpr12__pyx_v_i = 0; __pyx_9genexpr12__pyx_v_i < __pyx_t_4; __pyx_9genexpr12__pyx_v_i++) { __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec((__pyx_v_vecl[__pyx_9genexpr12__pyx_v_i]))); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 2423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_5))) __PYX_ERR(51, 2423, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } } /* exit inner scope */ __Pyx_DECREF_SET(__pyx_v_vl, __pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/TS.pyx":2422 * CHKERR( TSGetCostGradients(self.ts, &n, &vecl, &vecm) ) * cdef object vl = None, vm = None * if vecl != NULL: # <<<<<<<<<<<<<< * vl = [ref_Vec(vecl[i]) for i from 0 <= i < n] * if vecm != NULL: */ } /* "petsc4py/PETSc/TS.pyx":2424 * if vecl != NULL: * vl = [ref_Vec(vecl[i]) for i from 0 <= i < n] * if vecm != NULL: # <<<<<<<<<<<<<< * vm = [ref_Vec(vecm[i]) for i from 0 <= i < n] * return (vl, vm) */ __pyx_t_2 = (__pyx_v_vecm != NULL); if (__pyx_t_2) { /* "petsc4py/PETSc/TS.pyx":2425 * vl = [ref_Vec(vecl[i]) for i from 0 <= i < n] * if vecm != NULL: * vm = [ref_Vec(vecm[i]) for i from 0 <= i < n] # <<<<<<<<<<<<<< * return (vl, vm) * */ { /* enter inner scope */ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 2425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_v_n; for (__pyx_9genexpr13__pyx_v_i = 0; __pyx_9genexpr13__pyx_v_i < __pyx_t_4; __pyx_9genexpr13__pyx_v_i++) { __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec((__pyx_v_vecm[__pyx_9genexpr13__pyx_v_i]))); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 2425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_5))) __PYX_ERR(51, 2425, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } } /* exit inner scope */ __Pyx_DECREF_SET(__pyx_v_vm, __pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/TS.pyx":2424 * if vecl != NULL: * vl = [ref_Vec(vecl[i]) for i from 0 <= i < n] * if vecm != NULL: # <<<<<<<<<<<<<< * vm = [ref_Vec(vecm[i]) for i from 0 <= i < n] * return (vl, vm) */ } /* "petsc4py/PETSc/TS.pyx":2426 * if vecm != NULL: * vm = [ref_Vec(vecm[i]) for i from 0 <= i < n] * return (vl, vm) # <<<<<<<<<<<<<< * * def setRHSJacobianP( */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 2426, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_vl); __Pyx_GIVEREF(__pyx_v_vl); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_vl)) __PYX_ERR(51, 2426, __pyx_L1_error); __Pyx_INCREF(__pyx_v_vm); __Pyx_GIVEREF(__pyx_v_vm); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_vm)) __PYX_ERR(51, 2426, __pyx_L1_error); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TS.pyx":2409 * CHKERR( TSSetCostGradients(self.ts, n, vecl, vecm) ) * * def getCostGradients(self) -> tuple[list[Vec],list[Vec]]: # <<<<<<<<<<<<<< * """Return the cost gradients. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.TS.getCostGradients", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_vl); __Pyx_XDECREF(__pyx_v_vm); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2428 * return (vl, vm) * * def setRHSJacobianP( # <<<<<<<<<<<<<< * self, * jacobianp: TSRHSJacobianP, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_215setRHSJacobianP(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_214setRHSJacobianP, "TS.setRHSJacobianP(self, jacobianp: TSRHSJacobianP, A: Mat | None = None, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nSet the function that computes the Jacobian with respect to the parameters.\n\n Logically collective.\n\n Parameters\n ----------\n jacobianp\n The user-defined function.\n A\n The matrix into which the Jacobian will be computed.\n args\n Additional positional arguments for ``jacobianp``.\n kargs\n Additional keyword arguments for ``jacobianp``.\n\n See Also\n --------\n petsc.TSSetRHSJacobianP\n\n \nSource code at petsc4py/PETSc/TS.pyx:2428"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_215setRHSJacobianP(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_jacobianp = 0; struct PyPetscMatObject *__pyx_v_A = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setRHSJacobianP (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_jacobianp,&__pyx_n_s_A,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; /* "petsc4py/PETSc/TS.pyx":2431 * self, * jacobianp: TSRHSJacobianP, * Mat A=None, # <<<<<<<<<<<<<< * args: tuple[Any, ...] | None = None, * kargs: dict[str, Any] | None = None) -> None: */ values[1] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscMatObject *)Py_None)); /* "petsc4py/PETSc/TS.pyx":2432 * jacobianp: TSRHSJacobianP, * Mat A=None, * args: tuple[Any, ...] | None = None, # <<<<<<<<<<<<<< * kargs: dict[str, Any] | None = None) -> None: * """Set the function that computes the Jacobian with respect to the parameters. */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/TS.pyx":2433 * Mat A=None, * args: tuple[Any, ...] | None = None, * kargs: dict[str, Any] | None = None) -> None: # <<<<<<<<<<<<<< * """Set the function that computes the Jacobian with respect to the parameters. * */ values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_jacobianp)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 2428, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_A); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 2428, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 2428, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 2428, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setRHSJacobianP") < 0)) __PYX_ERR(51, 2428, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_jacobianp = values[0]; __pyx_v_A = ((struct PyPetscMatObject *)values[1]); __pyx_v_args = values[2]; __pyx_v_kargs = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setRHSJacobianP", 0, 1, 4, __pyx_nargs); __PYX_ERR(51, 2428, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TS.setRHSJacobianP", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_A), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "A", 0))) __PYX_ERR(51, 2431, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_214setRHSJacobianP(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_jacobianp, __pyx_v_A, __pyx_v_args, __pyx_v_kargs); /* "petsc4py/PETSc/TS.pyx":2428 * return (vl, vm) * * def setRHSJacobianP( # <<<<<<<<<<<<<< * self, * jacobianp: TSRHSJacobianP, */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_214setRHSJacobianP(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_jacobianp, struct PyPetscMatObject *__pyx_v_A, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { Mat __pyx_v_Amat; PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; Mat __pyx_t_2; PyObject *__pyx_t_3 = NULL; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setRHSJacobianP", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/TS.pyx":2454 * * """ * cdef PetscMat Amat=NULL # <<<<<<<<<<<<<< * if A is not None: Amat = A.mat * if jacobianp is not None: */ __pyx_v_Amat = NULL; /* "petsc4py/PETSc/TS.pyx":2455 * """ * cdef PetscMat Amat=NULL * if A is not None: Amat = A.mat # <<<<<<<<<<<<<< * if jacobianp is not None: * if args is None: args = () */ __pyx_t_1 = (((PyObject *)__pyx_v_A) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_A->mat; __pyx_v_Amat = __pyx_t_2; } /* "petsc4py/PETSc/TS.pyx":2456 * cdef PetscMat Amat=NULL * if A is not None: Amat = A.mat * if jacobianp is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = (__pyx_v_jacobianp != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/TS.pyx":2457 * if A is not None: Amat = A.mat * if jacobianp is not None: * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (jacobianp, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/TS.pyx":2458 * if jacobianp is not None: * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (jacobianp, args, kargs) * self.set_attr('__rhsjacobianp__', context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); if (__pyx_t_1) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 2458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "petsc4py/PETSc/TS.pyx":2459 * if args is None: args = () * if kargs is None: kargs = {} * context = (jacobianp, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__rhsjacobianp__', context) * CHKERR( TSSetRHSJacobianP(self.ts, Amat, TS_RHSJacobianP, context) ) */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 2459, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_jacobianp); __Pyx_GIVEREF(__pyx_v_jacobianp); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_jacobianp)) __PYX_ERR(51, 2459, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args)) __PYX_ERR(51, 2459, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs)) __PYX_ERR(51, 2459, __pyx_L1_error); __pyx_v_context = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/TS.pyx":2460 * if kargs is None: kargs = {} * context = (jacobianp, args, kargs) * self.set_attr('__rhsjacobianp__', context) # <<<<<<<<<<<<<< * CHKERR( TSSetRHSJacobianP(self.ts, Amat, TS_RHSJacobianP, context) ) * else: */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__rhsjacobianp__"), __pyx_v_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 2460, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/TS.pyx":2461 * context = (jacobianp, args, kargs) * self.set_attr('__rhsjacobianp__', context) * CHKERR( TSSetRHSJacobianP(self.ts, Amat, TS_RHSJacobianP, context) ) # <<<<<<<<<<<<<< * else: * CHKERR( TSSetRHSJacobianP(self.ts, Amat, NULL, NULL) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetRHSJacobianP(__pyx_v_self->ts, __pyx_v_Amat, __pyx_f_8petsc4py_5PETSc_TS_RHSJacobianP, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 2461, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":2456 * cdef PetscMat Amat=NULL * if A is not None: Amat = A.mat * if jacobianp is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ goto __pyx_L4; } /* "petsc4py/PETSc/TS.pyx":2463 * CHKERR( TSSetRHSJacobianP(self.ts, Amat, TS_RHSJacobianP, context) ) * else: * CHKERR( TSSetRHSJacobianP(self.ts, Amat, NULL, NULL) ) # <<<<<<<<<<<<<< * * def createQuadratureTS(self, forward: bool=True) -> TS: */ /*else*/ { __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetRHSJacobianP(__pyx_v_self->ts, __pyx_v_Amat, NULL, NULL)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 2463, __pyx_L1_error) } __pyx_L4:; /* "petsc4py/PETSc/TS.pyx":2428 * return (vl, vm) * * def setRHSJacobianP( # <<<<<<<<<<<<<< * self, * jacobianp: TSRHSJacobianP, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.setRHSJacobianP", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2465 * CHKERR( TSSetRHSJacobianP(self.ts, Amat, NULL, NULL) ) * * def createQuadratureTS(self, forward: bool=True) -> TS: # <<<<<<<<<<<<<< * """Create a sub `TS` that evaluates integrals over time. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_217createQuadratureTS(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_216createQuadratureTS, "TS.createQuadratureTS(self, forward: bool = True) -> TS\nCreate a sub `TS` that evaluates integrals over time.\n\n Parameters\n ----------\n forward\n Enable to evaluate forward in time.\n\n See Also\n --------\n petsc.TSCreateQuadratureTS\n\n \nSource code at petsc4py/PETSc/TS.pyx:2465"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_217createQuadratureTS(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_forward = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createQuadratureTS (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_forward,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_True)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_forward); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 2465, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createQuadratureTS") < 0)) __PYX_ERR(51, 2465, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_forward = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createQuadratureTS", 0, 0, 1, __pyx_nargs); __PYX_ERR(51, 2465, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TS.createQuadratureTS", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_216createQuadratureTS(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_forward); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_216createQuadratureTS(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_forward) { struct PyPetscTSObject *__pyx_v_qts = 0; PetscBool __pyx_v_fwd; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscBool __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createQuadratureTS", 1); /* "petsc4py/PETSc/TS.pyx":2478 * * """ * cdef TS qts = TS() # <<<<<<<<<<<<<< * cdef PetscBool fwd = forward * CHKERR( TSCreateQuadratureTS(self.ts, fwd, &qts.ts) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_TS)); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 2478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_qts = ((struct PyPetscTSObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/TS.pyx":2479 * """ * cdef TS qts = TS() * cdef PetscBool fwd = forward # <<<<<<<<<<<<<< * CHKERR( TSCreateQuadratureTS(self.ts, fwd, &qts.ts) ) * CHKERR( PetscINCREF(qts.obj) ) */ __pyx_t_2 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_forward)); if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 2479, __pyx_L1_error) __pyx_v_fwd = __pyx_t_2; /* "petsc4py/PETSc/TS.pyx":2480 * cdef TS qts = TS() * cdef PetscBool fwd = forward * CHKERR( TSCreateQuadratureTS(self.ts, fwd, &qts.ts) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(qts.obj) ) * return qts */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSCreateQuadratureTS(__pyx_v_self->ts, __pyx_v_fwd, (&__pyx_v_qts->ts))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 2480, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":2481 * cdef PetscBool fwd = forward * CHKERR( TSCreateQuadratureTS(self.ts, fwd, &qts.ts) ) * CHKERR( PetscINCREF(qts.obj) ) # <<<<<<<<<<<<<< * return qts * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_qts->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 2481, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":2482 * CHKERR( TSCreateQuadratureTS(self.ts, fwd, &qts.ts) ) * CHKERR( PetscINCREF(qts.obj) ) * return qts # <<<<<<<<<<<<<< * * def getQuadratureTS(self) -> tuple[bool, TS]: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_qts); __pyx_r = ((PyObject *)__pyx_v_qts); goto __pyx_L0; /* "petsc4py/PETSc/TS.pyx":2465 * CHKERR( TSSetRHSJacobianP(self.ts, Amat, NULL, NULL) ) * * def createQuadratureTS(self, forward: bool=True) -> TS: # <<<<<<<<<<<<<< * """Create a sub `TS` that evaluates integrals over time. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TS.createQuadratureTS", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_qts); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2484 * return qts * * def getQuadratureTS(self) -> tuple[bool, TS]: # <<<<<<<<<<<<<< * """Return the sub `TS` that evaluates integrals over time. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_219getQuadratureTS(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_218getQuadratureTS, "TS.getQuadratureTS(self) -> tuple[bool, TS]\nReturn the sub `TS` that evaluates integrals over time.\n\n Returns\n -------\n forward : bool\n True if evaluating the integral forward in time\n qts : TS\n The sub `TS`\n\n See Also\n --------\n petsc.TSGetQuadratureTS\n\n \nSource code at petsc4py/PETSc/TS.pyx:2484"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_219getQuadratureTS(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getQuadratureTS (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getQuadratureTS", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getQuadratureTS", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_218getQuadratureTS(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_218getQuadratureTS(struct PyPetscTSObject *__pyx_v_self) { struct PyPetscTSObject *__pyx_v_qts = 0; PetscBool __pyx_v_fwd; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getQuadratureTS", 1); /* "petsc4py/PETSc/TS.pyx":2499 * * """ * cdef TS qts = TS() # <<<<<<<<<<<<<< * cdef PetscBool fwd = PETSC_FALSE * CHKERR( TSGetQuadratureTS(self.ts, &fwd, &qts.ts) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_TS)); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 2499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_qts = ((struct PyPetscTSObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/TS.pyx":2500 * """ * cdef TS qts = TS() * cdef PetscBool fwd = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( TSGetQuadratureTS(self.ts, &fwd, &qts.ts) ) * CHKERR( PetscINCREF(qts.obj) ) */ __pyx_v_fwd = PETSC_FALSE; /* "petsc4py/PETSc/TS.pyx":2501 * cdef TS qts = TS() * cdef PetscBool fwd = PETSC_FALSE * CHKERR( TSGetQuadratureTS(self.ts, &fwd, &qts.ts) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(qts.obj) ) * return (toBool(fwd), qts) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetQuadratureTS(__pyx_v_self->ts, (&__pyx_v_fwd), (&__pyx_v_qts->ts))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 2501, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":2502 * cdef PetscBool fwd = PETSC_FALSE * CHKERR( TSGetQuadratureTS(self.ts, &fwd, &qts.ts) ) * CHKERR( PetscINCREF(qts.obj) ) # <<<<<<<<<<<<<< * return (toBool(fwd), qts) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_qts->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 2502, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":2503 * CHKERR( TSGetQuadratureTS(self.ts, &fwd, &qts.ts) ) * CHKERR( PetscINCREF(qts.obj) ) * return (toBool(fwd), qts) # <<<<<<<<<<<<<< * * def setRHSJacobianP( */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_fwd); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 2503, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 2503, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(51, 2503, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_qts); __Pyx_GIVEREF((PyObject *)__pyx_v_qts); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_qts))) __PYX_ERR(51, 2503, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TS.pyx":2484 * return qts * * def getQuadratureTS(self) -> tuple[bool, TS]: # <<<<<<<<<<<<<< * """Return the sub `TS` that evaluates integrals over time. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.getQuadratureTS", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_qts); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2505 * return (toBool(fwd), qts) * * def setRHSJacobianP( # <<<<<<<<<<<<<< * self, * rhsjacobianp: TSRHSJacobianP, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_221setRHSJacobianP(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_220setRHSJacobianP, "TS.setRHSJacobianP(self, rhsjacobianp: TSRHSJacobianP, A: Mat | None = None, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nSet the function that computes the Jacobian with respect to the parameters.\n\n Parameters\n ----------\n rhsjacobianp\n The function to compute the Jacobian\n A\n The JacobianP matrix\n args\n Additional positional arguments for ``rhsjacobianp``.\n kargs\n Additional keyword arguments for ``rhsjacobianp``.\n\n See Also\n --------\n petsc.TSSetRHSJacobianP\n\n \nSource code at petsc4py/PETSc/TS.pyx:2505"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_221setRHSJacobianP(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_rhsjacobianp = 0; struct PyPetscMatObject *__pyx_v_A = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setRHSJacobianP (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rhsjacobianp,&__pyx_n_s_A,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; /* "petsc4py/PETSc/TS.pyx":2508 * self, * rhsjacobianp: TSRHSJacobianP, * Mat A=None, # <<<<<<<<<<<<<< * args: tuple[Any, ...] | None = None, * kargs: dict[str, Any] | None = None) -> None: */ values[1] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscMatObject *)Py_None)); /* "petsc4py/PETSc/TS.pyx":2509 * rhsjacobianp: TSRHSJacobianP, * Mat A=None, * args: tuple[Any, ...] | None = None, # <<<<<<<<<<<<<< * kargs: dict[str, Any] | None = None) -> None: * """Set the function that computes the Jacobian with respect to the parameters. */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/TS.pyx":2510 * Mat A=None, * args: tuple[Any, ...] | None = None, * kargs: dict[str, Any] | None = None) -> None: # <<<<<<<<<<<<<< * """Set the function that computes the Jacobian with respect to the parameters. * */ values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rhsjacobianp)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 2505, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_A); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 2505, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 2505, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 2505, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setRHSJacobianP") < 0)) __PYX_ERR(51, 2505, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_rhsjacobianp = values[0]; __pyx_v_A = ((struct PyPetscMatObject *)values[1]); __pyx_v_args = values[2]; __pyx_v_kargs = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setRHSJacobianP", 0, 1, 4, __pyx_nargs); __PYX_ERR(51, 2505, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TS.setRHSJacobianP", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_A), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "A", 0))) __PYX_ERR(51, 2508, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_220setRHSJacobianP(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_rhsjacobianp, __pyx_v_A, __pyx_v_args, __pyx_v_kargs); /* "petsc4py/PETSc/TS.pyx":2505 * return (toBool(fwd), qts) * * def setRHSJacobianP( # <<<<<<<<<<<<<< * self, * rhsjacobianp: TSRHSJacobianP, */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_220setRHSJacobianP(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_rhsjacobianp, struct PyPetscMatObject *__pyx_v_A, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { Mat __pyx_v_Amat; PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; Mat __pyx_t_2; PyObject *__pyx_t_3 = NULL; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setRHSJacobianP", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/TS.pyx":2529 * * """ * cdef PetscMat Amat=NULL # <<<<<<<<<<<<<< * if A is not None: Amat = A.mat * if rhsjacobianp is not None: */ __pyx_v_Amat = NULL; /* "petsc4py/PETSc/TS.pyx":2530 * """ * cdef PetscMat Amat=NULL * if A is not None: Amat = A.mat # <<<<<<<<<<<<<< * if rhsjacobianp is not None: * if args is None: args = () */ __pyx_t_1 = (((PyObject *)__pyx_v_A) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_A->mat; __pyx_v_Amat = __pyx_t_2; } /* "petsc4py/PETSc/TS.pyx":2531 * cdef PetscMat Amat=NULL * if A is not None: Amat = A.mat * if rhsjacobianp is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = (__pyx_v_rhsjacobianp != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/TS.pyx":2532 * if A is not None: Amat = A.mat * if rhsjacobianp is not None: * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (rhsjacobianp, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/TS.pyx":2533 * if rhsjacobianp is not None: * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (rhsjacobianp, args, kargs) * self.set_attr('__rhsjacobianp__', context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); if (__pyx_t_1) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 2533, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "petsc4py/PETSc/TS.pyx":2534 * if args is None: args = () * if kargs is None: kargs = {} * context = (rhsjacobianp, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__rhsjacobianp__', context) * CHKERR( TSSetRHSJacobianP(self.ts, Amat, TS_RHSJacobianP, context) ) */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 2534, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_rhsjacobianp); __Pyx_GIVEREF(__pyx_v_rhsjacobianp); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_rhsjacobianp)) __PYX_ERR(51, 2534, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args)) __PYX_ERR(51, 2534, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs)) __PYX_ERR(51, 2534, __pyx_L1_error); __pyx_v_context = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/TS.pyx":2535 * if kargs is None: kargs = {} * context = (rhsjacobianp, args, kargs) * self.set_attr('__rhsjacobianp__', context) # <<<<<<<<<<<<<< * CHKERR( TSSetRHSJacobianP(self.ts, Amat, TS_RHSJacobianP, context) ) * else: */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__rhsjacobianp__"), __pyx_v_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 2535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/TS.pyx":2536 * context = (rhsjacobianp, args, kargs) * self.set_attr('__rhsjacobianp__', context) * CHKERR( TSSetRHSJacobianP(self.ts, Amat, TS_RHSJacobianP, context) ) # <<<<<<<<<<<<<< * else: * CHKERR( TSSetRHSJacobianP(self.ts, Amat, NULL, NULL) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetRHSJacobianP(__pyx_v_self->ts, __pyx_v_Amat, __pyx_f_8petsc4py_5PETSc_TS_RHSJacobianP, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 2536, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":2531 * cdef PetscMat Amat=NULL * if A is not None: Amat = A.mat * if rhsjacobianp is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ goto __pyx_L4; } /* "petsc4py/PETSc/TS.pyx":2538 * CHKERR( TSSetRHSJacobianP(self.ts, Amat, TS_RHSJacobianP, context) ) * else: * CHKERR( TSSetRHSJacobianP(self.ts, Amat, NULL, NULL) ) # <<<<<<<<<<<<<< * * def computeRHSJacobianP(self, t: float, Vec x, Mat J) -> None: */ /*else*/ { __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetRHSJacobianP(__pyx_v_self->ts, __pyx_v_Amat, NULL, NULL)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 2538, __pyx_L1_error) } __pyx_L4:; /* "petsc4py/PETSc/TS.pyx":2505 * return (toBool(fwd), qts) * * def setRHSJacobianP( # <<<<<<<<<<<<<< * self, * rhsjacobianp: TSRHSJacobianP, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.setRHSJacobianP", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2540 * CHKERR( TSSetRHSJacobianP(self.ts, Amat, NULL, NULL) ) * * def computeRHSJacobianP(self, t: float, Vec x, Mat J) -> None: # <<<<<<<<<<<<<< * """Run the user-defined JacobianP function. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_223computeRHSJacobianP(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_222computeRHSJacobianP, "TS.computeRHSJacobianP(self, t: float, x: Vec, J: Mat) -> None\nRun the user-defined JacobianP function.\n\n Parameters\n ----------\n t\n The time at which to compute the Jacobian.\n x\n The solution at which to compute the Jacobian.\n J\n The output Jacobian matrx.\n\n See Also\n --------\n petsc.TSComputeRHSJacobianP\n\n \nSource code at petsc4py/PETSc/TS.pyx:2540"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_223computeRHSJacobianP(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_t = 0; struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscMatObject *__pyx_v_J = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("computeRHSJacobianP (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_x,&__pyx_n_s_J,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 2540, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 2540, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("computeRHSJacobianP", 1, 3, 3, 1); __PYX_ERR(51, 2540, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_J)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 2540, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("computeRHSJacobianP", 1, 3, 3, 2); __PYX_ERR(51, 2540, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "computeRHSJacobianP") < 0)) __PYX_ERR(51, 2540, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_t = values[0]; __pyx_v_x = ((struct PyPetscVecObject *)values[1]); __pyx_v_J = ((struct PyPetscMatObject *)values[2]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("computeRHSJacobianP", 1, 3, 3, __pyx_nargs); __PYX_ERR(51, 2540, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TS.computeRHSJacobianP", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(51, 2540, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_J), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "J", 0))) __PYX_ERR(51, 2540, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_222computeRHSJacobianP(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_t, __pyx_v_x, __pyx_v_J); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_222computeRHSJacobianP(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_t, struct PyPetscVecObject *__pyx_v_x, struct PyPetscMatObject *__pyx_v_J) { PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("computeRHSJacobianP", 1); /* "petsc4py/PETSc/TS.pyx":2557 * * """ * cdef PetscReal rval = asReal(t) # <<<<<<<<<<<<<< * CHKERR( TSComputeRHSJacobianP(self.ts, rval, x.vec, J.mat) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_t); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(51, 2557, __pyx_L1_error) __pyx_v_rval = __pyx_t_1; /* "petsc4py/PETSc/TS.pyx":2558 * """ * cdef PetscReal rval = asReal(t) * CHKERR( TSComputeRHSJacobianP(self.ts, rval, x.vec, J.mat) ) # <<<<<<<<<<<<<< * * def adjointSetSteps(self, adjoint_steps: int) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSComputeRHSJacobianP(__pyx_v_self->ts, __pyx_v_rval, __pyx_v_x->vec, __pyx_v_J->mat)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 2558, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":2540 * CHKERR( TSSetRHSJacobianP(self.ts, Amat, NULL, NULL) ) * * def computeRHSJacobianP(self, t: float, Vec x, Mat J) -> None: # <<<<<<<<<<<<<< * """Run the user-defined JacobianP function. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.computeRHSJacobianP", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2560 * CHKERR( TSComputeRHSJacobianP(self.ts, rval, x.vec, J.mat) ) * * def adjointSetSteps(self, adjoint_steps: int) -> None: # <<<<<<<<<<<<<< * """Set the number of steps the adjoint solver should take backward in time. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_225adjointSetSteps(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_224adjointSetSteps, "TS.adjointSetSteps(self, adjoint_steps: int) -> None\nSet the number of steps the adjoint solver should take backward in time.\n\n Parameters\n ----------\n adjoint_steps\n The number of steps to take.\n\n See Also\n --------\n petsc.TSAdjointSetSteps\n\n \nSource code at petsc4py/PETSc/TS.pyx:2560"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_225adjointSetSteps(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_adjoint_steps = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("adjointSetSteps (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_adjoint_steps,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_adjoint_steps)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 2560, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "adjointSetSteps") < 0)) __PYX_ERR(51, 2560, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_adjoint_steps = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("adjointSetSteps", 1, 1, 1, __pyx_nargs); __PYX_ERR(51, 2560, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TS.adjointSetSteps", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_224adjointSetSteps(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_adjoint_steps); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_224adjointSetSteps(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_adjoint_steps) { PetscInt __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("adjointSetSteps", 1); /* "petsc4py/PETSc/TS.pyx":2573 * * """ * cdef PetscInt ival = asInt(adjoint_steps) # <<<<<<<<<<<<<< * CHKERR( TSAdjointSetSteps(self.ts, ival) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_adjoint_steps); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(51, 2573, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "petsc4py/PETSc/TS.pyx":2574 * """ * cdef PetscInt ival = asInt(adjoint_steps) * CHKERR( TSAdjointSetSteps(self.ts, ival) ) # <<<<<<<<<<<<<< * * def adjointSetUp(self) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSAdjointSetSteps(__pyx_v_self->ts, __pyx_v_ival)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 2574, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":2560 * CHKERR( TSComputeRHSJacobianP(self.ts, rval, x.vec, J.mat) ) * * def adjointSetSteps(self, adjoint_steps: int) -> None: # <<<<<<<<<<<<<< * """Set the number of steps the adjoint solver should take backward in time. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.adjointSetSteps", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2576 * CHKERR( TSAdjointSetSteps(self.ts, ival) ) * * def adjointSetUp(self) -> None: # <<<<<<<<<<<<<< * """Set up the internal data structures for the later use of an adjoint solver. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_227adjointSetUp(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_226adjointSetUp, "TS.adjointSetUp(self) -> None\nSet up the internal data structures for the later use of an adjoint solver.\n\n Collective.\n\n See Also\n --------\n petsc.TSAdjointSetUp\n\n \nSource code at petsc4py/PETSc/TS.pyx:2576"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_227adjointSetUp(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("adjointSetUp (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("adjointSetUp", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "adjointSetUp", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_226adjointSetUp(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_226adjointSetUp(struct PyPetscTSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("adjointSetUp", 1); /* "petsc4py/PETSc/TS.pyx":2586 * * """ * CHKERR(TSAdjointSetUp(self.ts)) # <<<<<<<<<<<<<< * * def adjointSolve(self) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSAdjointSetUp(__pyx_v_self->ts)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 2586, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":2576 * CHKERR( TSAdjointSetSteps(self.ts, ival) ) * * def adjointSetUp(self) -> None: # <<<<<<<<<<<<<< * """Set up the internal data structures for the later use of an adjoint solver. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.adjointSetUp", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2588 * CHKERR(TSAdjointSetUp(self.ts)) * * def adjointSolve(self) -> None: # <<<<<<<<<<<<<< * """Solve the discrete adjoint problem for an ODE/DAE. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_229adjointSolve(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_228adjointSolve, "TS.adjointSolve(self) -> None\nSolve the discrete adjoint problem for an ODE/DAE.\n\n Collective.\n\n See Also\n --------\n petsc.TSAdjointSolve\n\n \nSource code at petsc4py/PETSc/TS.pyx:2588"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_229adjointSolve(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("adjointSolve (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("adjointSolve", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "adjointSolve", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_228adjointSolve(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_228adjointSolve(struct PyPetscTSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("adjointSolve", 1); /* "petsc4py/PETSc/TS.pyx":2598 * * """ * CHKERR( TSAdjointSolve(self.ts) ) # <<<<<<<<<<<<<< * * def adjointStep(self) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSAdjointSolve(__pyx_v_self->ts)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 2598, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":2588 * CHKERR(TSAdjointSetUp(self.ts)) * * def adjointSolve(self) -> None: # <<<<<<<<<<<<<< * """Solve the discrete adjoint problem for an ODE/DAE. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.adjointSolve", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2600 * CHKERR( TSAdjointSolve(self.ts) ) * * def adjointStep(self) -> None: # <<<<<<<<<<<<<< * """Step one time step backward in the adjoint run. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_231adjointStep(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_230adjointStep, "TS.adjointStep(self) -> None\nStep one time step backward in the adjoint run.\n\n Collective.\n\n See Also\n --------\n petsc.TSAdjointStep\n\n \nSource code at petsc4py/PETSc/TS.pyx:2600"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_231adjointStep(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("adjointStep (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("adjointStep", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "adjointStep", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_230adjointStep(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_230adjointStep(struct PyPetscTSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("adjointStep", 1); /* "petsc4py/PETSc/TS.pyx":2610 * * """ * CHKERR(TSAdjointStep(self.ts)) # <<<<<<<<<<<<<< * * def adjointReset(self) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSAdjointStep(__pyx_v_self->ts)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 2610, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":2600 * CHKERR( TSAdjointSolve(self.ts) ) * * def adjointStep(self) -> None: # <<<<<<<<<<<<<< * """Step one time step backward in the adjoint run. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.adjointStep", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2612 * CHKERR(TSAdjointStep(self.ts)) * * def adjointReset(self) -> None: # <<<<<<<<<<<<<< * """Reset a `TS`, removing any allocated vectors and matrices. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_233adjointReset(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_232adjointReset, "TS.adjointReset(self) -> None\nReset a `TS`, removing any allocated vectors and matrices.\n\n Collective.\n\n See Also\n --------\n petsc.TSAdjointReset\n\n \nSource code at petsc4py/PETSc/TS.pyx:2612"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_233adjointReset(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("adjointReset (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("adjointReset", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "adjointReset", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_232adjointReset(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_232adjointReset(struct PyPetscTSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("adjointReset", 1); /* "petsc4py/PETSc/TS.pyx":2622 * * """ * CHKERR(TSAdjointReset(self.ts)) # <<<<<<<<<<<<<< * * # --- Python --- */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSAdjointReset(__pyx_v_self->ts)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 2622, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":2612 * CHKERR(TSAdjointStep(self.ts)) * * def adjointReset(self) -> None: # <<<<<<<<<<<<<< * """Reset a `TS`, removing any allocated vectors and matrices. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.adjointReset", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2626 * # --- Python --- * * def createPython(self, context: Any = None, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Create an integrator of Python type. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_235createPython(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_234createPython, "TS.createPython(self, context: Any = None, comm: Comm | None = None) -> Self\nCreate an integrator of Python type.\n\n Collective.\n\n Parameters\n ----------\n context\n An instance of the Python class implementing the required methods.\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n petsc_python_ts, setType, setPythonContext, Type.PYTHON\n\n \nSource code at petsc4py/PETSc/TS.pyx:2626"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_235createPython(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_context = 0; PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createPython (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_context,&__pyx_n_s_comm,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_context); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 2626, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 2626, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createPython") < 0)) __PYX_ERR(51, 2626, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_context = values[0]; __pyx_v_comm = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createPython", 0, 0, 2, __pyx_nargs); __PYX_ERR(51, 2626, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TS.createPython", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_234createPython(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_context, __pyx_v_comm); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_234createPython(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; TS __pyx_v_newts; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PetscErrorCode __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createPython", 1); /* "petsc4py/PETSc/TS.pyx":2643 * * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscTS newts = NULL * CHKERR( TSCreate(ccomm, &newts) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(51, 2643, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/TS.pyx":2644 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscTS newts = NULL # <<<<<<<<<<<<<< * CHKERR( TSCreate(ccomm, &newts) ) * CHKERR( PetscCLEAR(self.obj) ); self.ts = newts */ __pyx_v_newts = NULL; /* "petsc4py/PETSc/TS.pyx":2645 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscTS newts = NULL * CHKERR( TSCreate(ccomm, &newts) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.ts = newts * CHKERR( TSSetType(self.ts, TSPYTHON) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSCreate(__pyx_v_ccomm, (&__pyx_v_newts))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 2645, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":2646 * cdef PetscTS newts = NULL * CHKERR( TSCreate(ccomm, &newts) ) * CHKERR( PetscCLEAR(self.obj) ); self.ts = newts # <<<<<<<<<<<<<< * CHKERR( TSSetType(self.ts, TSPYTHON) ) * CHKERR( TSPythonSetContext(self.ts, context) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 2646, __pyx_L1_error) __pyx_v_self->ts = __pyx_v_newts; /* "petsc4py/PETSc/TS.pyx":2647 * CHKERR( TSCreate(ccomm, &newts) ) * CHKERR( PetscCLEAR(self.obj) ); self.ts = newts * CHKERR( TSSetType(self.ts, TSPYTHON) ) # <<<<<<<<<<<<<< * CHKERR( TSPythonSetContext(self.ts, context) ) * return self */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetType(__pyx_v_self->ts, TSPYTHON)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 2647, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":2648 * CHKERR( PetscCLEAR(self.obj) ); self.ts = newts * CHKERR( TSSetType(self.ts, TSPYTHON) ) * CHKERR( TSPythonSetContext(self.ts, context) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = TSPythonSetContext(__pyx_v_self->ts, ((void *)__pyx_v_context)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 2648, __pyx_L1_error) __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_t_2); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 2648, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":2649 * CHKERR( TSSetType(self.ts, TSPYTHON) ) * CHKERR( TSPythonSetContext(self.ts, context) ) * return self # <<<<<<<<<<<<<< * * def setPythonContext(self, context: Any) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/TS.pyx":2626 * # --- Python --- * * def createPython(self, context: Any = None, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Create an integrator of Python type. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.createPython", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2651 * return self * * def setPythonContext(self, context: Any) -> None: # <<<<<<<<<<<<<< * """Set the instance of the class implementing the required Python methods. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_237setPythonContext(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_236setPythonContext, "TS.setPythonContext(self, context: Any) -> None\nSet the instance of the class implementing the required Python methods.\n\n Not collective.\n\n See Also\n --------\n petsc_python_ts, getPythonContext\n\n \nSource code at petsc4py/PETSc/TS.pyx:2651"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_237setPythonContext(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_context = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPythonContext (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_context,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_context)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 2651, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setPythonContext") < 0)) __PYX_ERR(51, 2651, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_context = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPythonContext", 1, 1, 1, __pyx_nargs); __PYX_ERR(51, 2651, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TS.setPythonContext", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_236setPythonContext(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_context); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_236setPythonContext(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_context) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPythonContext", 1); /* "petsc4py/PETSc/TS.pyx":2661 * * """ * CHKERR( TSPythonSetContext(self.ts, context) ) # <<<<<<<<<<<<<< * * def getPythonContext(self) -> Any: */ __pyx_t_1 = TSPythonSetContext(__pyx_v_self->ts, ((void *)__pyx_v_context)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 2661, __pyx_L1_error) __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_t_1); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 2661, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":2651 * return self * * def setPythonContext(self, context: Any) -> None: # <<<<<<<<<<<<<< * """Set the instance of the class implementing the required Python methods. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setPythonContext", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2663 * CHKERR( TSPythonSetContext(self.ts, context) ) * * def getPythonContext(self) -> Any: # <<<<<<<<<<<<<< * """Return the instance of the class implementing the required Python methods. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_239getPythonContext(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_238getPythonContext, "TS.getPythonContext(self) -> Any\nReturn the instance of the class implementing the required Python methods.\n\n Not collective.\n\n See Also\n --------\n petsc_python_ts, setPythonContext\n\n \nSource code at petsc4py/PETSc/TS.pyx:2663"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_239getPythonContext(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getPythonContext (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getPythonContext", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getPythonContext", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_238getPythonContext(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_238getPythonContext(struct PyPetscTSObject *__pyx_v_self) { void *__pyx_v_context; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getPythonContext", 1); /* "petsc4py/PETSc/TS.pyx":2673 * * """ * cdef void *context = NULL # <<<<<<<<<<<<<< * CHKERR( TSPythonGetContext(self.ts, &context) ) * if context == NULL: return None */ __pyx_v_context = NULL; /* "petsc4py/PETSc/TS.pyx":2674 * """ * cdef void *context = NULL * CHKERR( TSPythonGetContext(self.ts, &context) ) # <<<<<<<<<<<<<< * if context == NULL: return None * else: return context */ __pyx_t_1 = TSPythonGetContext(__pyx_v_self->ts, (&__pyx_v_context)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 2674, __pyx_L1_error) __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_t_1); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 2674, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":2675 * cdef void *context = NULL * CHKERR( TSPythonGetContext(self.ts, &context) ) * if context == NULL: return None # <<<<<<<<<<<<<< * else: return context * */ __pyx_t_3 = (__pyx_v_context == NULL); if (__pyx_t_3) { __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } /* "petsc4py/PETSc/TS.pyx":2676 * CHKERR( TSPythonGetContext(self.ts, &context) ) * if context == NULL: return None * else: return context # <<<<<<<<<<<<<< * * def setPythonType(self, py_type: str) -> None: */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_context)); __pyx_r = ((PyObject *)__pyx_v_context); goto __pyx_L0; } /* "petsc4py/PETSc/TS.pyx":2663 * CHKERR( TSPythonSetContext(self.ts, context) ) * * def getPythonContext(self) -> Any: # <<<<<<<<<<<<<< * """Return the instance of the class implementing the required Python methods. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.getPythonContext", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2678 * else: return context * * def setPythonType(self, py_type: str) -> None: # <<<<<<<<<<<<<< * """Set the fully qualified Python name of the class to be used. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_241setPythonType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_240setPythonType, "TS.setPythonType(self, py_type: str) -> None\nSet the fully qualified Python name of the class to be used.\n\n Collective.\n\n See Also\n --------\n petsc_python_ts, setPythonContext, getPythonType, petsc.TSPythonSetType\n\n \nSource code at petsc4py/PETSc/TS.pyx:2678"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_241setPythonType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_py_type = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPythonType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_py_type,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_py_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 2678, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setPythonType") < 0)) __PYX_ERR(51, 2678, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_py_type = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPythonType", 1, 1, 1, __pyx_nargs); __PYX_ERR(51, 2678, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TS.setPythonType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_240setPythonType(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_py_type); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_240setPythonType(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_py_type) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPythonType", 0); __Pyx_INCREF(__pyx_v_py_type); /* "petsc4py/PETSc/TS.pyx":2688 * * """ * cdef const char *cval = NULL # <<<<<<<<<<<<<< * py_type = str2bytes(py_type, &cval) * CHKERR( TSPythonSetType(self.ts, cval) ) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/TS.pyx":2689 * """ * cdef const char *cval = NULL * py_type = str2bytes(py_type, &cval) # <<<<<<<<<<<<<< * CHKERR( TSPythonSetType(self.ts, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_py_type, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 2689, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_py_type, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/TS.pyx":2690 * cdef const char *cval = NULL * py_type = str2bytes(py_type, &cval) * CHKERR( TSPythonSetType(self.ts, cval) ) # <<<<<<<<<<<<<< * * def getPythonType(self) -> str: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSPythonSetType(__pyx_v_self->ts, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 2690, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":2678 * else: return context * * def setPythonType(self, py_type: str) -> None: # <<<<<<<<<<<<<< * """Set the fully qualified Python name of the class to be used. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TS.setPythonType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_py_type); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2692 * CHKERR( TSPythonSetType(self.ts, cval) ) * * def getPythonType(self) -> str: # <<<<<<<<<<<<<< * """Return the fully qualified Python name of the class used by the solver. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_243getPythonType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_242getPythonType, "TS.getPythonType(self) -> str\nReturn the fully qualified Python name of the class used by the solver.\n\n Not collective.\n\n See Also\n --------\n petsc_python_ts, setPythonContext, setPythonType, petsc.TSPythonGetType\n\n \nSource code at petsc4py/PETSc/TS.pyx:2692"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_243getPythonType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getPythonType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getPythonType", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getPythonType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_242getPythonType(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_242getPythonType(struct PyPetscTSObject *__pyx_v_self) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getPythonType", 1); /* "petsc4py/PETSc/TS.pyx":2702 * * """ * cdef const char *cval = NULL # <<<<<<<<<<<<<< * CHKERR( TSPythonGetType(self.ts, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/TS.pyx":2703 * """ * cdef const char *cval = NULL * CHKERR( TSPythonGetType(self.ts, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSPythonGetType(__pyx_v_self->ts, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 2703, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":2704 * cdef const char *cval = NULL * CHKERR( TSPythonGetType(self.ts, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * # --- Theta --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 2704, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TS.pyx":2692 * CHKERR( TSPythonSetType(self.ts, cval) ) * * def getPythonType(self) -> str: # <<<<<<<<<<<<<< * """Return the fully qualified Python name of the class used by the solver. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TS.getPythonType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2708 * # --- Theta --- * * def setTheta(self, theta: float) -> None: # <<<<<<<<<<<<<< * """Set the abscissa of the stage in ``(0,1]`` for `Type.THETA`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_245setTheta(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_244setTheta, "TS.setTheta(self, theta: float) -> None\nSet the abscissa of the stage in ``(0,1]`` for `Type.THETA`.\n\n Parameters\n ----------\n theta\n stage abscissa\n\n Notes\n -----\n ``-ts_theta_theta`` can be used to set a value from the commandline.\n\n See Also\n --------\n petsc.TSThetaSetTheta\n\n \nSource code at petsc4py/PETSc/TS.pyx:2708"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_245setTheta(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_theta = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setTheta (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_theta,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_theta)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 2708, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setTheta") < 0)) __PYX_ERR(51, 2708, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_theta = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setTheta", 1, 1, 1, __pyx_nargs); __PYX_ERR(51, 2708, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TS.setTheta", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_244setTheta(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_theta); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_244setTheta(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_theta) { PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setTheta", 1); /* "petsc4py/PETSc/TS.pyx":2725 * * """ * cdef PetscReal rval = asReal(theta) # <<<<<<<<<<<<<< * CHKERR( TSThetaSetTheta(self.ts, rval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_theta); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(51, 2725, __pyx_L1_error) __pyx_v_rval = __pyx_t_1; /* "petsc4py/PETSc/TS.pyx":2726 * """ * cdef PetscReal rval = asReal(theta) * CHKERR( TSThetaSetTheta(self.ts, rval) ) # <<<<<<<<<<<<<< * * def getTheta(self) -> float: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSThetaSetTheta(__pyx_v_self->ts, __pyx_v_rval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 2726, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":2708 * # --- Theta --- * * def setTheta(self, theta: float) -> None: # <<<<<<<<<<<<<< * """Set the abscissa of the stage in ``(0,1]`` for `Type.THETA`. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setTheta", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2728 * CHKERR( TSThetaSetTheta(self.ts, rval) ) * * def getTheta(self) -> float: # <<<<<<<<<<<<<< * """Return the abscissa of the stage in ``(0,1]`` for `Type.THETA`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_247getTheta(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_246getTheta, "TS.getTheta(self) -> float\nReturn the abscissa of the stage in ``(0,1]`` for `Type.THETA`.\n\n Not collective.\n\n See Also\n --------\n petsc.TSThetaGetTheta\n\n \nSource code at petsc4py/PETSc/TS.pyx:2728"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_247getTheta(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getTheta (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getTheta", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getTheta", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_246getTheta(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_246getTheta(struct PyPetscTSObject *__pyx_v_self) { PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getTheta", 1); /* "petsc4py/PETSc/TS.pyx":2738 * * """ * cdef PetscReal rval = 0 # <<<<<<<<<<<<<< * CHKERR( TSThetaGetTheta(self.ts, &rval) ) * return toReal(rval) */ __pyx_v_rval = 0.0; /* "petsc4py/PETSc/TS.pyx":2739 * """ * cdef PetscReal rval = 0 * CHKERR( TSThetaGetTheta(self.ts, &rval) ) # <<<<<<<<<<<<<< * return toReal(rval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSThetaGetTheta(__pyx_v_self->ts, (&__pyx_v_rval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 2739, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":2740 * cdef PetscReal rval = 0 * CHKERR( TSThetaGetTheta(self.ts, &rval) ) * return toReal(rval) # <<<<<<<<<<<<<< * * def setThetaEndpoint(self, flag=True) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_rval); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 2740, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TS.pyx":2728 * CHKERR( TSThetaSetTheta(self.ts, rval) ) * * def getTheta(self) -> float: # <<<<<<<<<<<<<< * """Return the abscissa of the stage in ``(0,1]`` for `Type.THETA`. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TS.getTheta", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2742 * return toReal(rval) * * def setThetaEndpoint(self, flag=True) -> None: # <<<<<<<<<<<<<< * """Set to use the endpoint variant of `Type.THETA`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_249setThetaEndpoint(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_248setThetaEndpoint, "TS.setThetaEndpoint(self, flag=True) -> None\nSet to use the endpoint variant of `Type.THETA`.\n\n Parameters\n ----------\n flag\n Enable to use the endpoint variant.\n\n See Also\n --------\n petsc.TSThetaSetEndpoint\n\n \nSource code at petsc4py/PETSc/TS.pyx:2742"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_249setThetaEndpoint(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_flag = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setThetaEndpoint (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_True)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flag); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 2742, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setThetaEndpoint") < 0)) __PYX_ERR(51, 2742, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_flag = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setThetaEndpoint", 0, 0, 1, __pyx_nargs); __PYX_ERR(51, 2742, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TS.setThetaEndpoint", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_248setThetaEndpoint(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_flag); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_248setThetaEndpoint(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_flag) { PetscBool __pyx_v_bval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setThetaEndpoint", 1); /* "petsc4py/PETSc/TS.pyx":2755 * * """ * cdef PetscBool bval = flag # <<<<<<<<<<<<<< * CHKERR( TSThetaSetEndpoint(self.ts, bval) ) * */ __pyx_t_1 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_flag)); if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 2755, __pyx_L1_error) __pyx_v_bval = __pyx_t_1; /* "petsc4py/PETSc/TS.pyx":2756 * """ * cdef PetscBool bval = flag * CHKERR( TSThetaSetEndpoint(self.ts, bval) ) # <<<<<<<<<<<<<< * * def getThetaEndpoint(self) -> bool: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSThetaSetEndpoint(__pyx_v_self->ts, __pyx_v_bval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 2756, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":2742 * return toReal(rval) * * def setThetaEndpoint(self, flag=True) -> None: # <<<<<<<<<<<<<< * """Set to use the endpoint variant of `Type.THETA`. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setThetaEndpoint", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2758 * CHKERR( TSThetaSetEndpoint(self.ts, bval) ) * * def getThetaEndpoint(self) -> bool: # <<<<<<<<<<<<<< * """Return whether the endpoint variable of `Type.THETA` is used. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_251getThetaEndpoint(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_250getThetaEndpoint, "TS.getThetaEndpoint(self) -> bool\nReturn whether the endpoint variable of `Type.THETA` is used.\n\n See Also\n --------\n petsc.TSThetaGetEndpoint\n\n \nSource code at petsc4py/PETSc/TS.pyx:2758"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_251getThetaEndpoint(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getThetaEndpoint (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getThetaEndpoint", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getThetaEndpoint", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_250getThetaEndpoint(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_250getThetaEndpoint(struct PyPetscTSObject *__pyx_v_self) { PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getThetaEndpoint", 1); /* "petsc4py/PETSc/TS.pyx":2766 * * """ * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( TSThetaGetEndpoint(self.ts, &flag) ) * return toBool(flag) */ __pyx_v_flag = PETSC_FALSE; /* "petsc4py/PETSc/TS.pyx":2767 * """ * cdef PetscBool flag = PETSC_FALSE * CHKERR( TSThetaGetEndpoint(self.ts, &flag) ) # <<<<<<<<<<<<<< * return toBool(flag) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSThetaGetEndpoint(__pyx_v_self->ts, (&__pyx_v_flag))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 2767, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":2768 * cdef PetscBool flag = PETSC_FALSE * CHKERR( TSThetaGetEndpoint(self.ts, &flag) ) * return toBool(flag) # <<<<<<<<<<<<<< * * # --- Alpha --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 2768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TS.pyx":2758 * CHKERR( TSThetaSetEndpoint(self.ts, bval) ) * * def getThetaEndpoint(self) -> bool: # <<<<<<<<<<<<<< * """Return whether the endpoint variable of `Type.THETA` is used. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TS.getThetaEndpoint", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2772 * # --- Alpha --- * * def setAlphaRadius(self, radius: float) -> None: # <<<<<<<<<<<<<< * """Set the spectral radius for `Type.ALPHA`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_253setAlphaRadius(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_252setAlphaRadius, "TS.setAlphaRadius(self, radius: float) -> None\nSet the spectral radius for `Type.ALPHA`.\n\n Logically collective.\n\n Parameters\n ----------\n radius\n the spectral radius\n\n Notes\n -----\n ``-ts_alpha_radius`` can be used to set this from the commandline.\n\n See Also\n --------\n petsc.TSAlphaSetRadius\n\n \nSource code at petsc4py/PETSc/TS.pyx:2772"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_253setAlphaRadius(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_radius = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setAlphaRadius (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_radius,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_radius)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 2772, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setAlphaRadius") < 0)) __PYX_ERR(51, 2772, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_radius = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setAlphaRadius", 1, 1, 1, __pyx_nargs); __PYX_ERR(51, 2772, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TS.setAlphaRadius", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_252setAlphaRadius(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_radius); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_252setAlphaRadius(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_radius) { PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setAlphaRadius", 1); /* "petsc4py/PETSc/TS.pyx":2791 * * """ * cdef PetscReal rval = asReal(radius) # <<<<<<<<<<<<<< * CHKERR( TSAlphaSetRadius(self.ts, rval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_radius); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(51, 2791, __pyx_L1_error) __pyx_v_rval = __pyx_t_1; /* "petsc4py/PETSc/TS.pyx":2792 * """ * cdef PetscReal rval = asReal(radius) * CHKERR( TSAlphaSetRadius(self.ts, rval) ) # <<<<<<<<<<<<<< * * def setAlphaParams( */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSAlphaSetRadius(__pyx_v_self->ts, __pyx_v_rval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 2792, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":2772 * # --- Alpha --- * * def setAlphaRadius(self, radius: float) -> None: # <<<<<<<<<<<<<< * """Set the spectral radius for `Type.ALPHA`. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setAlphaRadius", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2794 * CHKERR( TSAlphaSetRadius(self.ts, rval) ) * * def setAlphaParams( # <<<<<<<<<<<<<< * self, * alpha_m: float | None=None, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_255setAlphaParams(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_254setAlphaParams, "TS.setAlphaParams(self, alpha_m: float | None = None, alpha_f: float | None = None, gamma: float | None = None) -> None\nSet the algorithmic parameters for `Type.ALPHA`.\n\n Logically collective.\n\n Users should call `setAlphaRadius`.\n\n Parameters\n ----------\n alpha_m\n Parameter, leave `None` to keep current value.\n alpha_f\n Parameter, leave `None` to keep current value.\n gamma\n Parameter, leave `None` to keep current value.\n\n See Also\n --------\n petsc.TSAlphaSetParams\n\n \nSource code at petsc4py/PETSc/TS.pyx:2794"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_255setAlphaParams(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_alpha_m = 0; PyObject *__pyx_v_alpha_f = 0; PyObject *__pyx_v_gamma = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setAlphaParams (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_alpha_m,&__pyx_n_s_alpha_f,&__pyx_n_s_gamma,0}; /* "petsc4py/PETSc/TS.pyx":2796 * def setAlphaParams( * self, * alpha_m: float | None=None, # <<<<<<<<<<<<<< * alpha_f: float | None=None, * gamma: float | None=None) -> None: */ values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/TS.pyx":2797 * self, * alpha_m: float | None=None, * alpha_f: float | None=None, # <<<<<<<<<<<<<< * gamma: float | None=None) -> None: * """Set the algorithmic parameters for `Type.ALPHA`. */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/TS.pyx":2798 * alpha_m: float | None=None, * alpha_f: float | None=None, * gamma: float | None=None) -> None: # <<<<<<<<<<<<<< * """Set the algorithmic parameters for `Type.ALPHA`. * */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_alpha_m); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 2794, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_alpha_f); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 2794, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gamma); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 2794, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setAlphaParams") < 0)) __PYX_ERR(51, 2794, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_alpha_m = values[0]; __pyx_v_alpha_f = values[1]; __pyx_v_gamma = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setAlphaParams", 0, 0, 3, __pyx_nargs); __PYX_ERR(51, 2794, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TS.setAlphaParams", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_254setAlphaParams(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_alpha_m, __pyx_v_alpha_f, __pyx_v_gamma); /* "petsc4py/PETSc/TS.pyx":2794 * CHKERR( TSAlphaSetRadius(self.ts, rval) ) * * def setAlphaParams( # <<<<<<<<<<<<<< * self, * alpha_m: float | None=None, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_254setAlphaParams(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_alpha_m, PyObject *__pyx_v_alpha_f, PyObject *__pyx_v_gamma) { PetscReal __pyx_v_rval1; PetscReal __pyx_v_rval2; PetscReal __pyx_v_rval3; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PetscErrorCode __pyx_t_4; int __pyx_t_5; int __pyx_t_6; PetscReal __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setAlphaParams", 1); /* "petsc4py/PETSc/TS.pyx":2819 * * """ * cdef PetscReal rval1 = 0, rval2 = 0, rval3 = 0 # <<<<<<<<<<<<<< * try: CHKERR( TSAlphaGetParams(self.ts, &rval1, &rval2, &rval3) ) * except PetscError: pass */ __pyx_v_rval1 = 0.0; __pyx_v_rval2 = 0.0; __pyx_v_rval3 = 0.0; /* "petsc4py/PETSc/TS.pyx":2820 * """ * cdef PetscReal rval1 = 0, rval2 = 0, rval3 = 0 * try: CHKERR( TSAlphaGetParams(self.ts, &rval1, &rval2, &rval3) ) # <<<<<<<<<<<<<< * except PetscError: pass * if alpha_m is not None: rval1 = asReal(alpha_m) */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSAlphaGetParams(__pyx_v_self->ts, (&__pyx_v_rval1), (&__pyx_v_rval2), (&__pyx_v_rval3))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 2820, __pyx_L3_error) } __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L8_try_end; __pyx_L3_error:; /* "petsc4py/PETSc/TS.pyx":2821 * cdef PetscReal rval1 = 0, rval2 = 0, rval3 = 0 * try: CHKERR( TSAlphaGetParams(self.ts, &rval1, &rval2, &rval3) ) * except PetscError: pass # <<<<<<<<<<<<<< * if alpha_m is not None: rval1 = asReal(alpha_m) * if alpha_f is not None: rval2 = asReal(alpha_f) */ __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_v_8petsc4py_5PETSc_PetscError); if (__pyx_t_5) { __Pyx_ErrRestore(0,0,0); goto __pyx_L4_exception_handled; } goto __pyx_L5_except_error; /* "petsc4py/PETSc/TS.pyx":2820 * """ * cdef PetscReal rval1 = 0, rval2 = 0, rval3 = 0 * try: CHKERR( TSAlphaGetParams(self.ts, &rval1, &rval2, &rval3) ) # <<<<<<<<<<<<<< * except PetscError: pass * if alpha_m is not None: rval1 = asReal(alpha_m) */ __pyx_L5_except_error:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; __pyx_L4_exception_handled:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); __pyx_L8_try_end:; } /* "petsc4py/PETSc/TS.pyx":2822 * try: CHKERR( TSAlphaGetParams(self.ts, &rval1, &rval2, &rval3) ) * except PetscError: pass * if alpha_m is not None: rval1 = asReal(alpha_m) # <<<<<<<<<<<<<< * if alpha_f is not None: rval2 = asReal(alpha_f) * if gamma is not None: rval3 = asReal(gamma) */ __pyx_t_6 = (__pyx_v_alpha_m != Py_None); if (__pyx_t_6) { __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_alpha_m); if (unlikely(__pyx_t_7 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(51, 2822, __pyx_L1_error) __pyx_v_rval1 = __pyx_t_7; } /* "petsc4py/PETSc/TS.pyx":2823 * except PetscError: pass * if alpha_m is not None: rval1 = asReal(alpha_m) * if alpha_f is not None: rval2 = asReal(alpha_f) # <<<<<<<<<<<<<< * if gamma is not None: rval3 = asReal(gamma) * CHKERR( TSAlphaSetParams(self.ts, rval1, rval2, rval3) ) */ __pyx_t_6 = (__pyx_v_alpha_f != Py_None); if (__pyx_t_6) { __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_alpha_f); if (unlikely(__pyx_t_7 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(51, 2823, __pyx_L1_error) __pyx_v_rval2 = __pyx_t_7; } /* "petsc4py/PETSc/TS.pyx":2824 * if alpha_m is not None: rval1 = asReal(alpha_m) * if alpha_f is not None: rval2 = asReal(alpha_f) * if gamma is not None: rval3 = asReal(gamma) # <<<<<<<<<<<<<< * CHKERR( TSAlphaSetParams(self.ts, rval1, rval2, rval3) ) * */ __pyx_t_6 = (__pyx_v_gamma != Py_None); if (__pyx_t_6) { __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_gamma); if (unlikely(__pyx_t_7 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(51, 2824, __pyx_L1_error) __pyx_v_rval3 = __pyx_t_7; } /* "petsc4py/PETSc/TS.pyx":2825 * if alpha_f is not None: rval2 = asReal(alpha_f) * if gamma is not None: rval3 = asReal(gamma) * CHKERR( TSAlphaSetParams(self.ts, rval1, rval2, rval3) ) # <<<<<<<<<<<<<< * * def getAlphaParams(self) -> tuple[float, float, float]: */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSAlphaSetParams(__pyx_v_self->ts, __pyx_v_rval1, __pyx_v_rval2, __pyx_v_rval3)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 2825, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":2794 * CHKERR( TSAlphaSetRadius(self.ts, rval) ) * * def setAlphaParams( # <<<<<<<<<<<<<< * self, * alpha_m: float | None=None, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setAlphaParams", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2827 * CHKERR( TSAlphaSetParams(self.ts, rval1, rval2, rval3) ) * * def getAlphaParams(self) -> tuple[float, float, float]: # <<<<<<<<<<<<<< * """Return the algorithmic parameters for `Type.ALPHA`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_257getAlphaParams(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2TS_256getAlphaParams, "TS.getAlphaParams(self) -> tuple[float, float, float]\nReturn the algorithmic parameters for `Type.ALPHA`.\n\n See Also\n --------\n petsc.TSAlphaGetParams\n\n \nSource code at petsc4py/PETSc/TS.pyx:2827"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_257getAlphaParams(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getAlphaParams (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getAlphaParams", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getAlphaParams", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_256getAlphaParams(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_256getAlphaParams(struct PyPetscTSObject *__pyx_v_self) { PetscReal __pyx_v_rval1; PetscReal __pyx_v_rval2; PetscReal __pyx_v_rval3; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getAlphaParams", 1); /* "petsc4py/PETSc/TS.pyx":2835 * * """ * cdef PetscReal rval1 = 0, rval2 = 0, rval3 = 0 # <<<<<<<<<<<<<< * CHKERR( TSAlphaGetParams(self.ts, &rval1, &rval2, &rval3) ) * return (toReal(rval1), toReal(rval2), toReal(rval3)) */ __pyx_v_rval1 = 0.0; __pyx_v_rval2 = 0.0; __pyx_v_rval3 = 0.0; /* "petsc4py/PETSc/TS.pyx":2836 * """ * cdef PetscReal rval1 = 0, rval2 = 0, rval3 = 0 * CHKERR( TSAlphaGetParams(self.ts, &rval1, &rval2, &rval3) ) # <<<<<<<<<<<<<< * return (toReal(rval1), toReal(rval2), toReal(rval3)) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSAlphaGetParams(__pyx_v_self->ts, (&__pyx_v_rval1), (&__pyx_v_rval2), (&__pyx_v_rval3))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 2836, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":2837 * cdef PetscReal rval1 = 0, rval2 = 0, rval3 = 0 * CHKERR( TSAlphaGetParams(self.ts, &rval1, &rval2, &rval3) ) * return (toReal(rval1), toReal(rval2), toReal(rval3)) # <<<<<<<<<<<<<< * * # --- application context --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_rval1); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 2837, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_rval2); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 2837, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_rval3); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 2837, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 2837, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2)) __PYX_ERR(51, 2837, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3)) __PYX_ERR(51, 2837, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4)) __PYX_ERR(51, 2837, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TS.pyx":2827 * CHKERR( TSAlphaSetParams(self.ts, rval1, rval2, rval3) ) * * def getAlphaParams(self) -> tuple[float, float, float]: # <<<<<<<<<<<<<< * """Return the algorithmic parameters for `Type.ALPHA`. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.TS.getAlphaParams", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2843 * property appctx: * """Application context.""" * def __get__(self) -> Any: # <<<<<<<<<<<<<< * return self.getAppCtx() * def __set__(self, value) -> None: */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_6appctx_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_6appctx_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_6appctx___get__(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_6appctx___get__(struct PyPetscTSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/TS.pyx":2844 * """Application context.""" * def __get__(self) -> Any: * return self.getAppCtx() # <<<<<<<<<<<<<< * def __set__(self, value) -> None: * self.setAppCtx(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getAppCtx); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 2844, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 2844, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TS.pyx":2843 * property appctx: * """Application context.""" * def __get__(self) -> Any: # <<<<<<<<<<<<<< * return self.getAppCtx() * def __set__(self, value) -> None: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.appctx.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2845 * def __get__(self) -> Any: * return self.getAppCtx() * def __set__(self, value) -> None: # <<<<<<<<<<<<<< * self.setAppCtx(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_2TS_6appctx_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_2TS_6appctx_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_6appctx_2__set__(((struct PyPetscTSObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_2TS_6appctx_2__set__(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "petsc4py/PETSc/TS.pyx":2846 * return self.getAppCtx() * def __set__(self, value) -> None: * self.setAppCtx(value) # <<<<<<<<<<<<<< * * # --- discretization space --- */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setAppCtx); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 2846, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_value}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 2846, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/TS.pyx":2845 * def __get__(self) -> Any: * return self.getAppCtx() * def __set__(self, value) -> None: # <<<<<<<<<<<<<< * self.setAppCtx(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.appctx.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2852 * property dm: * """The `DM`.""" * def __get__(self) -> DM: # <<<<<<<<<<<<<< * return self.getDM() * def __set__(self, value) -> None: */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_2dm_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_2dm_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_2dm___get__(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_2dm___get__(struct PyPetscTSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/TS.pyx":2853 * """The `DM`.""" * def __get__(self) -> DM: * return self.getDM() # <<<<<<<<<<<<<< * def __set__(self, value) -> None: * self.setDM(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getDM); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 2853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 2853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TS.pyx":2852 * property dm: * """The `DM`.""" * def __get__(self) -> DM: # <<<<<<<<<<<<<< * return self.getDM() * def __set__(self, value) -> None: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.dm.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2854 * def __get__(self) -> DM: * return self.getDM() * def __set__(self, value) -> None: # <<<<<<<<<<<<<< * self.setDM(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_2TS_2dm_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_2TS_2dm_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_2dm_2__set__(((struct PyPetscTSObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_2TS_2dm_2__set__(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "petsc4py/PETSc/TS.pyx":2855 * return self.getDM() * def __set__(self, value) -> None: * self.setDM(value) # <<<<<<<<<<<<<< * * # --- xxx --- */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setDM); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 2855, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_value}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 2855, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/TS.pyx":2854 * def __get__(self) -> DM: * return self.getDM() * def __set__(self, value) -> None: # <<<<<<<<<<<<<< * self.setDM(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.dm.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2861 * property problem_type: * """The problem type.""" * def __get__(self) -> ProblemType: # <<<<<<<<<<<<<< * return self.getProblemType() * def __set__(self, value) -> None: */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_12problem_type_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_12problem_type_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_12problem_type___get__(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_12problem_type___get__(struct PyPetscTSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/TS.pyx":2862 * """The problem type.""" * def __get__(self) -> ProblemType: * return self.getProblemType() # <<<<<<<<<<<<<< * def __set__(self, value) -> None: * self.setProblemType(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getProblemType); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 2862, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 2862, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TS.pyx":2861 * property problem_type: * """The problem type.""" * def __get__(self) -> ProblemType: # <<<<<<<<<<<<<< * return self.getProblemType() * def __set__(self, value) -> None: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.problem_type.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2863 * def __get__(self) -> ProblemType: * return self.getProblemType() * def __set__(self, value) -> None: # <<<<<<<<<<<<<< * self.setProblemType(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_2TS_12problem_type_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_2TS_12problem_type_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_12problem_type_2__set__(((struct PyPetscTSObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_2TS_12problem_type_2__set__(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "petsc4py/PETSc/TS.pyx":2864 * return self.getProblemType() * def __set__(self, value) -> None: * self.setProblemType(value) # <<<<<<<<<<<<<< * * property equation_type: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setProblemType); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 2864, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_value}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 2864, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/TS.pyx":2863 * def __get__(self) -> ProblemType: * return self.getProblemType() * def __set__(self, value) -> None: # <<<<<<<<<<<<<< * self.setProblemType(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.problem_type.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2868 * property equation_type: * """The equation type.""" * def __get__(self) -> EquationType: # <<<<<<<<<<<<<< * return self.getEquationType() * def __set__(self, value) -> None: */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_13equation_type_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_13equation_type_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_13equation_type___get__(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_13equation_type___get__(struct PyPetscTSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/TS.pyx":2869 * """The equation type.""" * def __get__(self) -> EquationType: * return self.getEquationType() # <<<<<<<<<<<<<< * def __set__(self, value) -> None: * self.setEquationType(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getEquationType); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 2869, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 2869, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TS.pyx":2868 * property equation_type: * """The equation type.""" * def __get__(self) -> EquationType: # <<<<<<<<<<<<<< * return self.getEquationType() * def __set__(self, value) -> None: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.equation_type.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2870 * def __get__(self) -> EquationType: * return self.getEquationType() * def __set__(self, value) -> None: # <<<<<<<<<<<<<< * self.setEquationType(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_2TS_13equation_type_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_2TS_13equation_type_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_13equation_type_2__set__(((struct PyPetscTSObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_2TS_13equation_type_2__set__(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "petsc4py/PETSc/TS.pyx":2871 * return self.getEquationType() * def __set__(self, value) -> None: * self.setEquationType(value) # <<<<<<<<<<<<<< * * property snes: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setEquationType); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 2871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_value}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 2871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/TS.pyx":2870 * def __get__(self) -> EquationType: * return self.getEquationType() * def __set__(self, value) -> None: # <<<<<<<<<<<<<< * self.setEquationType(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.equation_type.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2875 * property snes: * """The `SNES`.""" * def __get__(self) -> SNES: # <<<<<<<<<<<<<< * return self.getSNES() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_4snes_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_4snes_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_4snes___get__(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_4snes___get__(struct PyPetscTSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/TS.pyx":2876 * """The `SNES`.""" * def __get__(self) -> SNES: * return self.getSNES() # <<<<<<<<<<<<<< * * property ksp: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getSNES); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 2876, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 2876, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TS.pyx":2875 * property snes: * """The `SNES`.""" * def __get__(self) -> SNES: # <<<<<<<<<<<<<< * return self.getSNES() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.snes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2880 * property ksp: * """The `KSP`.""" * def __get__(self) -> KSP: # <<<<<<<<<<<<<< * return self.getKSP() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_3ksp_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_3ksp_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_3ksp___get__(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_3ksp___get__(struct PyPetscTSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/TS.pyx":2881 * """The `KSP`.""" * def __get__(self) -> KSP: * return self.getKSP() # <<<<<<<<<<<<<< * * property vec_sol: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getKSP); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 2881, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 2881, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TS.pyx":2880 * property ksp: * """The `KSP`.""" * def __get__(self) -> KSP: # <<<<<<<<<<<<<< * return self.getKSP() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.ksp.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2885 * property vec_sol: * """The solution vector.""" * def __get__(self) -> Vec: # <<<<<<<<<<<<<< * return self.getSolution() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_7vec_sol_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_7vec_sol_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_7vec_sol___get__(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_7vec_sol___get__(struct PyPetscTSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/TS.pyx":2886 * """The solution vector.""" * def __get__(self) -> Vec: * return self.getSolution() # <<<<<<<<<<<<<< * * # --- xxx --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getSolution); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 2886, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 2886, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TS.pyx":2885 * property vec_sol: * """The solution vector.""" * def __get__(self) -> Vec: # <<<<<<<<<<<<<< * return self.getSolution() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.vec_sol.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2892 * property time: * """The current time.""" * def __get__(self) -> float: # <<<<<<<<<<<<<< * return self.getTime() * def __set__(self, value) -> None: */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_4time_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_4time_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_4time___get__(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_4time___get__(struct PyPetscTSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/TS.pyx":2893 * """The current time.""" * def __get__(self) -> float: * return self.getTime() # <<<<<<<<<<<<<< * def __set__(self, value) -> None: * self.setTime(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getTime); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 2893, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 2893, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TS.pyx":2892 * property time: * """The current time.""" * def __get__(self) -> float: # <<<<<<<<<<<<<< * return self.getTime() * def __set__(self, value) -> None: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.time.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2894 * def __get__(self) -> float: * return self.getTime() * def __set__(self, value) -> None: # <<<<<<<<<<<<<< * self.setTime(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_2TS_4time_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_2TS_4time_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_4time_2__set__(((struct PyPetscTSObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_2TS_4time_2__set__(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "petsc4py/PETSc/TS.pyx":2895 * return self.getTime() * def __set__(self, value) -> None: * self.setTime(value) # <<<<<<<<<<<<<< * * property time_step: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setTime); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 2895, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_value}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 2895, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/TS.pyx":2894 * def __get__(self) -> float: * return self.getTime() * def __set__(self, value) -> None: # <<<<<<<<<<<<<< * self.setTime(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.time.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2899 * property time_step: * """The current time step size.""" * def __get__(self) -> None: # <<<<<<<<<<<<<< * return self.getTimeStep() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_9time_step_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_9time_step_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_9time_step___get__(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_9time_step___get__(struct PyPetscTSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/TS.pyx":2900 * """The current time step size.""" * def __get__(self) -> None: * return self.getTimeStep() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setTimeStep(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getTimeStep); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 2900, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 2900, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TS.pyx":2899 * property time_step: * """The current time step size.""" * def __get__(self) -> None: # <<<<<<<<<<<<<< * return self.getTimeStep() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.time_step.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2901 * def __get__(self) -> None: * return self.getTimeStep() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setTimeStep(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_2TS_9time_step_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_2TS_9time_step_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_9time_step_2__set__(((struct PyPetscTSObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_2TS_9time_step_2__set__(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "petsc4py/PETSc/TS.pyx":2902 * return self.getTimeStep() * def __set__(self, value): * self.setTimeStep(value) # <<<<<<<<<<<<<< * * property step_number: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setTimeStep); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 2902, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_value}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 2902, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/TS.pyx":2901 * def __get__(self) -> None: * return self.getTimeStep() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setTimeStep(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.time_step.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2906 * property step_number: * """The current step number.""" * def __get__(self) -> int: # <<<<<<<<<<<<<< * return self.getStepNumber() * def __set__(self, value) -> None: */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_11step_number_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_11step_number_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_11step_number___get__(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_11step_number___get__(struct PyPetscTSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/TS.pyx":2907 * """The current step number.""" * def __get__(self) -> int: * return self.getStepNumber() # <<<<<<<<<<<<<< * def __set__(self, value) -> None: * self.setStepNumber(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getStepNumber); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 2907, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 2907, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TS.pyx":2906 * property step_number: * """The current step number.""" * def __get__(self) -> int: # <<<<<<<<<<<<<< * return self.getStepNumber() * def __set__(self, value) -> None: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.step_number.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2908 * def __get__(self) -> int: * return self.getStepNumber() * def __set__(self, value) -> None: # <<<<<<<<<<<<<< * self.setStepNumber(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_2TS_11step_number_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_2TS_11step_number_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_11step_number_2__set__(((struct PyPetscTSObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_2TS_11step_number_2__set__(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "petsc4py/PETSc/TS.pyx":2909 * return self.getStepNumber() * def __set__(self, value) -> None: * self.setStepNumber(value) # <<<<<<<<<<<<<< * * property max_time: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setStepNumber); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 2909, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_value}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 2909, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/TS.pyx":2908 * def __get__(self) -> int: * return self.getStepNumber() * def __set__(self, value) -> None: # <<<<<<<<<<<<<< * self.setStepNumber(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.step_number.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2913 * property max_time: * """The maximum time.""" * def __get__(self) -> float: # <<<<<<<<<<<<<< * return self.getMaxTime() * def __set__(self, value) -> None: */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_8max_time_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_8max_time_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_8max_time___get__(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_8max_time___get__(struct PyPetscTSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/TS.pyx":2914 * """The maximum time.""" * def __get__(self) -> float: * return self.getMaxTime() # <<<<<<<<<<<<<< * def __set__(self, value) -> None: * self.setMaxTime(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getMaxTime); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 2914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 2914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TS.pyx":2913 * property max_time: * """The maximum time.""" * def __get__(self) -> float: # <<<<<<<<<<<<<< * return self.getMaxTime() * def __set__(self, value) -> None: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.max_time.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2915 * def __get__(self) -> float: * return self.getMaxTime() * def __set__(self, value) -> None: # <<<<<<<<<<<<<< * self.setMaxTime(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_2TS_8max_time_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_2TS_8max_time_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_8max_time_2__set__(((struct PyPetscTSObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_2TS_8max_time_2__set__(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "petsc4py/PETSc/TS.pyx":2916 * return self.getMaxTime() * def __set__(self, value) -> None: * self.setMaxTime(value) # <<<<<<<<<<<<<< * * property max_steps: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setMaxTime); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 2916, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_value}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 2916, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/TS.pyx":2915 * def __get__(self) -> float: * return self.getMaxTime() * def __set__(self, value) -> None: # <<<<<<<<<<<<<< * self.setMaxTime(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.max_time.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2920 * property max_steps: * """The maximum number of steps.""" * def __get__(self) -> int: # <<<<<<<<<<<<<< * return self.getMaxSteps() * def __set__(self, value) -> None: */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_9max_steps_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_9max_steps_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_9max_steps___get__(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_9max_steps___get__(struct PyPetscTSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/TS.pyx":2921 * """The maximum number of steps.""" * def __get__(self) -> int: * return self.getMaxSteps() # <<<<<<<<<<<<<< * def __set__(self, value) -> None: * self.setMaxSteps(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getMaxSteps); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 2921, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 2921, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TS.pyx":2920 * property max_steps: * """The maximum number of steps.""" * def __get__(self) -> int: # <<<<<<<<<<<<<< * return self.getMaxSteps() * def __set__(self, value) -> None: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.max_steps.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2922 * def __get__(self) -> int: * return self.getMaxSteps() * def __set__(self, value) -> None: # <<<<<<<<<<<<<< * self.setMaxSteps(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_2TS_9max_steps_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_2TS_9max_steps_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_9max_steps_2__set__(((struct PyPetscTSObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_2TS_9max_steps_2__set__(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "petsc4py/PETSc/TS.pyx":2923 * return self.getMaxSteps() * def __set__(self, value) -> None: * self.setMaxSteps(value) # <<<<<<<<<<<<<< * * # --- convergence --- */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setMaxSteps); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 2923, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_value}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 2923, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/TS.pyx":2922 * def __get__(self) -> int: * return self.getMaxSteps() * def __set__(self, value) -> None: # <<<<<<<<<<<<<< * self.setMaxSteps(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.max_steps.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2929 * property rtol: * """The relative tolerance.""" * def __get__(self) -> float: # <<<<<<<<<<<<<< * return self.getTolerances()[0] * def __set__(self, value) -> None: */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_4rtol_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_4rtol_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_4rtol___get__(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_4rtol___get__(struct PyPetscTSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/TS.pyx":2930 * """The relative tolerance.""" * def __get__(self) -> float: * return self.getTolerances()[0] # <<<<<<<<<<<<<< * def __set__(self, value) -> None: * self.setTolerances(rtol=value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getTolerances); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 2930, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 2930, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 2930, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TS.pyx":2929 * property rtol: * """The relative tolerance.""" * def __get__(self) -> float: # <<<<<<<<<<<<<< * return self.getTolerances()[0] * def __set__(self, value) -> None: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.rtol.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2931 * def __get__(self) -> float: * return self.getTolerances()[0] * def __set__(self, value) -> None: # <<<<<<<<<<<<<< * self.setTolerances(rtol=value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_2TS_4rtol_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_2TS_4rtol_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_4rtol_2__set__(((struct PyPetscTSObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_2TS_4rtol_2__set__(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "petsc4py/PETSc/TS.pyx":2932 * return self.getTolerances()[0] * def __set__(self, value) -> None: * self.setTolerances(rtol=value) # <<<<<<<<<<<<<< * * property atol: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setTolerances); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 2932, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 2932, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_rtol, __pyx_v_value) < 0) __PYX_ERR(51, 2932, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 2932, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/TS.pyx":2931 * def __get__(self) -> float: * return self.getTolerances()[0] * def __set__(self, value) -> None: # <<<<<<<<<<<<<< * self.setTolerances(rtol=value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.rtol.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2936 * property atol: * """The absolute tolerance.""" * def __get__(self) -> float: # <<<<<<<<<<<<<< * return self.getTolerances()[1] * def __set__(self, value) -> None: */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_4atol_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_4atol_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_4atol___get__(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_4atol___get__(struct PyPetscTSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/TS.pyx":2937 * """The absolute tolerance.""" * def __get__(self) -> float: * return self.getTolerances()[1] # <<<<<<<<<<<<<< * def __set__(self, value) -> None: * self.setTolerances(atol=value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getTolerances); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 2937, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 2937, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 2937, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TS.pyx":2936 * property atol: * """The absolute tolerance.""" * def __get__(self) -> float: # <<<<<<<<<<<<<< * return self.getTolerances()[1] * def __set__(self, value) -> None: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.atol.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2938 * def __get__(self) -> float: * return self.getTolerances()[1] * def __set__(self, value) -> None: # <<<<<<<<<<<<<< * self.setTolerances(atol=value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_2TS_4atol_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_2TS_4atol_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_4atol_2__set__(((struct PyPetscTSObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_2TS_4atol_2__set__(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "petsc4py/PETSc/TS.pyx":2939 * return self.getTolerances()[1] * def __set__(self, value) -> None: * self.setTolerances(atol=value) # <<<<<<<<<<<<<< * * property reason: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setTolerances); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 2939, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 2939, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_atol, __pyx_v_value) < 0) __PYX_ERR(51, 2939, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 2939, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/TS.pyx":2938 * def __get__(self) -> float: * return self.getTolerances()[1] * def __set__(self, value) -> None: # <<<<<<<<<<<<<< * self.setTolerances(atol=value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.atol.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2943 * property reason: * """The converged reason.""" * def __get__(self) -> TSConvergedReason: # <<<<<<<<<<<<<< * return self.getConvergedReason() * def __set__(self, value) -> None: */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_6reason_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_6reason_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_6reason___get__(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_6reason___get__(struct PyPetscTSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/TS.pyx":2944 * """The converged reason.""" * def __get__(self) -> TSConvergedReason: * return self.getConvergedReason() # <<<<<<<<<<<<<< * def __set__(self, value) -> None: * self.setConvergedReason(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getConvergedReason); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 2944, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 2944, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TS.pyx":2943 * property reason: * """The converged reason.""" * def __get__(self) -> TSConvergedReason: # <<<<<<<<<<<<<< * return self.getConvergedReason() * def __set__(self, value) -> None: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.reason.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2945 * def __get__(self) -> TSConvergedReason: * return self.getConvergedReason() * def __set__(self, value) -> None: # <<<<<<<<<<<<<< * self.setConvergedReason(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_2TS_6reason_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_2TS_6reason_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_6reason_2__set__(((struct PyPetscTSObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_2TS_6reason_2__set__(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "petsc4py/PETSc/TS.pyx":2946 * return self.getConvergedReason() * def __set__(self, value) -> None: * self.setConvergedReason(value) # <<<<<<<<<<<<<< * * property iterating: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setConvergedReason); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 2946, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_value}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 2946, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/TS.pyx":2945 * def __get__(self) -> TSConvergedReason: * return self.getConvergedReason() * def __set__(self, value) -> None: # <<<<<<<<<<<<<< * self.setConvergedReason(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.reason.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2950 * property iterating: * """Indicates the `TS` is still iterating.""" * def __get__(self) -> bool: # <<<<<<<<<<<<<< * return self.reason == 0 * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_9iterating_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_9iterating_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_9iterating___get__(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_9iterating___get__(struct PyPetscTSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/TS.pyx":2951 * """Indicates the `TS` is still iterating.""" * def __get__(self) -> bool: * return self.reason == 0 # <<<<<<<<<<<<<< * * property converged: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reason); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 2951, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_t_1, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 2951, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TS.pyx":2950 * property iterating: * """Indicates the `TS` is still iterating.""" * def __get__(self) -> bool: # <<<<<<<<<<<<<< * return self.reason == 0 * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TS.iterating.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2955 * property converged: * """Indicates the `TS` has converged.""" * def __get__(self) -> bool: # <<<<<<<<<<<<<< * return self.reason > 0 * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_9converged_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_9converged_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_9converged___get__(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_9converged___get__(struct PyPetscTSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/TS.pyx":2956 * """Indicates the `TS` has converged.""" * def __get__(self) -> bool: * return self.reason > 0 # <<<<<<<<<<<<<< * * property diverged: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reason); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 2956, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 2956, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TS.pyx":2955 * property converged: * """Indicates the `TS` has converged.""" * def __get__(self) -> bool: # <<<<<<<<<<<<<< * return self.reason > 0 * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TS.converged.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TS.pyx":2960 * property diverged: * """Indicates the `TS` has stopped.""" * def __get__(self) -> bool: # <<<<<<<<<<<<<< * return self.reason < 0 * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_8diverged_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_8diverged_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_8diverged___get__(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_8diverged___get__(struct PyPetscTSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/TS.pyx":2961 * """Indicates the `TS` has stopped.""" * def __get__(self) -> bool: * return self.reason < 0 # <<<<<<<<<<<<<< * * # ----------------------------------------------------------------------------- */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reason); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 2961, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 2961, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TS.pyx":2960 * property diverged: * """Indicates the `TS` has stopped.""" * def __get__(self) -> bool: # <<<<<<<<<<<<<< * return self.reason < 0 * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TS.diverged.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":106 * Reason = TAOConvergedReason * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.tao * self.tao = NULL */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_3TAO_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_3TAO_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO___cinit__(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_3TAO___cinit__(struct PyPetscTAOObject *__pyx_v_self) { int __pyx_r; /* "petsc4py/PETSc/TAO.pyx":107 * * def __cinit__(self): * self.obj = &self.tao # <<<<<<<<<<<<<< * self.tao = NULL * */ __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->tao)); /* "petsc4py/PETSc/TAO.pyx":108 * def __cinit__(self): * self.obj = &self.tao * self.tao = NULL # <<<<<<<<<<<<<< * * def view(self, Viewer viewer=None) -> None: */ __pyx_v_self->tao = NULL; /* "petsc4py/PETSc/TAO.pyx":106 * Reason = TAOConvergedReason * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.tao * self.tao = NULL */ /* function exit code */ __pyx_r = 0; return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":110 * self.tao = NULL * * def view(self, Viewer viewer=None) -> None: # <<<<<<<<<<<<<< * """View the solver. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_3view(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_2view, "TAO.view(self, viewer: Viewer | None = None) -> None\nView the solver.\n\n Collective.\n\n Parameters\n ----------\n viewer\n A `Viewer` instance or `None` for the default viewer.\n\n See Also\n --------\n petsc.TaoView\n\n \nSource code at petsc4py/PETSc/TAO.pyx:110"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_3view(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscViewerObject *__pyx_v_viewer = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("view (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscViewerObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_viewer); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 110, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "view") < 0)) __PYX_ERR(52, 110, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, __pyx_nargs); __PYX_ERR(52, 110, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TAO.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(52, 110, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_2view(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_viewer); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_2view(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer) { PetscViewer __pyx_v_vwr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscViewer __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("view", 1); /* "petsc4py/PETSc/TAO.pyx":125 * * """ * cdef PetscViewer vwr = NULL # <<<<<<<<<<<<<< * if viewer is not None: vwr = viewer.vwr * CHKERR( TaoView(self.tao, vwr) ) */ __pyx_v_vwr = NULL; /* "petsc4py/PETSc/TAO.pyx":126 * """ * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr # <<<<<<<<<<<<<< * CHKERR( TaoView(self.tao, vwr) ) * */ __pyx_t_1 = (((PyObject *)__pyx_v_viewer) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_viewer->vwr; __pyx_v_vwr = __pyx_t_2; } /* "petsc4py/PETSc/TAO.pyx":127 * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr * CHKERR( TaoView(self.tao, vwr) ) # <<<<<<<<<<<<<< * * def destroy(self) -> Self: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoView(__pyx_v_self->tao, __pyx_v_vwr)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 127, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":110 * self.tao = NULL * * def view(self, Viewer viewer=None) -> None: # <<<<<<<<<<<<<< * """View the solver. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":129 * CHKERR( TaoView(self.tao, vwr) ) * * def destroy(self) -> Self: # <<<<<<<<<<<<<< * """Destroy the solver. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_5destroy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_4destroy, "TAO.destroy(self) -> Self\nDestroy the solver.\n\n Collective.\n\n See Also\n --------\n petsc.TaoDestroy\n\n \nSource code at petsc4py/PETSc/TAO.pyx:129"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_5destroy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("destroy (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_4destroy(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_4destroy(struct PyPetscTAOObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("destroy", 1); /* "petsc4py/PETSc/TAO.pyx":139 * * """ * CHKERR( TaoDestroy(&self.tao) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoDestroy((&__pyx_v_self->tao))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 139, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":140 * """ * CHKERR( TaoDestroy(&self.tao) ) * return self # <<<<<<<<<<<<<< * * def create(self, comm: Comm | None = None) -> Self: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/TAO.pyx":129 * CHKERR( TaoView(self.tao, vwr) ) * * def destroy(self) -> Self: # <<<<<<<<<<<<<< * """Destroy the solver. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":142 * return self * * def create(self, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Create a TAO solver. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_7create(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_6create, "TAO.create(self, comm: Comm | None = None) -> Self\nCreate a TAO solver.\n\n Collective.\n\n Parameters\n ----------\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n Sys.getDefaultComm, petsc.TaoCreate\n\n \nSource code at petsc4py/PETSc/TAO.pyx:142"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_7create(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 142, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "create") < 0)) __PYX_ERR(52, 142, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_comm = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, __pyx_nargs); __PYX_ERR(52, 142, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TAO.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_6create(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_comm); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_6create(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; Tao __pyx_v_newtao; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create", 1); /* "petsc4py/PETSc/TAO.pyx":157 * * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscTAO newtao = NULL * CHKERR( TaoCreate(ccomm, &newtao) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(52, 157, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/TAO.pyx":158 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscTAO newtao = NULL # <<<<<<<<<<<<<< * CHKERR( TaoCreate(ccomm, &newtao) ) * CHKERR( PetscCLEAR(self.obj) ); self.tao = newtao */ __pyx_v_newtao = NULL; /* "petsc4py/PETSc/TAO.pyx":159 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscTAO newtao = NULL * CHKERR( TaoCreate(ccomm, &newtao) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.tao = newtao * return self */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoCreate(__pyx_v_ccomm, (&__pyx_v_newtao))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 159, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":160 * cdef PetscTAO newtao = NULL * CHKERR( TaoCreate(ccomm, &newtao) ) * CHKERR( PetscCLEAR(self.obj) ); self.tao = newtao # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 160, __pyx_L1_error) __pyx_v_self->tao = __pyx_v_newtao; /* "petsc4py/PETSc/TAO.pyx":161 * CHKERR( TaoCreate(ccomm, &newtao) ) * CHKERR( PetscCLEAR(self.obj) ); self.tao = newtao * return self # <<<<<<<<<<<<<< * * def setType(self, tao_type: Type | str) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/TAO.pyx":142 * return self * * def create(self, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Create a TAO solver. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":163 * return self * * def setType(self, tao_type: Type | str) -> None: # <<<<<<<<<<<<<< * """Set the type of the solver. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_9setType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_8setType, "TAO.setType(self, tao_type: Type | str) -> None\nSet the type of the solver.\n\n Logically collective.\n\n Parameters\n ----------\n tao_type\n The type of the solver.\n\n See Also\n --------\n getType, petsc.TaoSetType\n\n \nSource code at petsc4py/PETSc/TAO.pyx:163"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_9setType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_tao_type = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tao_type,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_tao_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 163, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setType") < 0)) __PYX_ERR(52, 163, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_tao_type = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, __pyx_nargs); __PYX_ERR(52, 163, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TAO.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_8setType(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_tao_type); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_8setType(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_tao_type) { TaoType __pyx_v_ctype; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setType", 0); __Pyx_INCREF(__pyx_v_tao_type); /* "petsc4py/PETSc/TAO.pyx":178 * * """ * cdef PetscTAOType ctype = NULL # <<<<<<<<<<<<<< * tao_type = str2bytes(tao_type, &ctype) * CHKERR( TaoSetType(self.tao, ctype) ) */ __pyx_v_ctype = NULL; /* "petsc4py/PETSc/TAO.pyx":179 * """ * cdef PetscTAOType ctype = NULL * tao_type = str2bytes(tao_type, &ctype) # <<<<<<<<<<<<<< * CHKERR( TaoSetType(self.tao, ctype) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_tao_type, (&__pyx_v_ctype)); if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_tao_type, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/TAO.pyx":180 * cdef PetscTAOType ctype = NULL * tao_type = str2bytes(tao_type, &ctype) * CHKERR( TaoSetType(self.tao, ctype) ) # <<<<<<<<<<<<<< * * def getType(self) -> str: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSetType(__pyx_v_self->tao, __pyx_v_ctype)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 180, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":163 * return self * * def setType(self, tao_type: Type | str) -> None: # <<<<<<<<<<<<<< * """Set the type of the solver. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TAO.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_tao_type); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":182 * CHKERR( TaoSetType(self.tao, ctype) ) * * def getType(self) -> str: # <<<<<<<<<<<<<< * """Return the type of the solver. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_11getType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_10getType, "TAO.getType(self) -> str\nReturn the type of the solver.\n\n Not collective.\n\n See Also\n --------\n setType, petsc.TaoGetType\n\n \nSource code at petsc4py/PETSc/TAO.pyx:182"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_11getType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getType", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_10getType(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_10getType(struct PyPetscTAOObject *__pyx_v_self) { TaoType __pyx_v_ctype; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getType", 1); /* "petsc4py/PETSc/TAO.pyx":192 * * """ * cdef PetscTAOType ctype = NULL # <<<<<<<<<<<<<< * CHKERR( TaoGetType(self.tao, &ctype) ) * return bytes2str(ctype) */ __pyx_v_ctype = NULL; /* "petsc4py/PETSc/TAO.pyx":193 * """ * cdef PetscTAOType ctype = NULL * CHKERR( TaoGetType(self.tao, &ctype) ) # <<<<<<<<<<<<<< * return bytes2str(ctype) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoGetType(__pyx_v_self->tao, (&__pyx_v_ctype))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 193, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":194 * cdef PetscTAOType ctype = NULL * CHKERR( TaoGetType(self.tao, &ctype) ) * return bytes2str(ctype) # <<<<<<<<<<<<<< * * def setOptionsPrefix(self, prefix: str) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_ctype); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TAO.pyx":182 * CHKERR( TaoSetType(self.tao, ctype) ) * * def getType(self) -> str: # <<<<<<<<<<<<<< * """Return the type of the solver. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TAO.getType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":196 * return bytes2str(ctype) * * def setOptionsPrefix(self, prefix: str) -> None: # <<<<<<<<<<<<<< * """Set the prefix used for searching for options in the database. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_13setOptionsPrefix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_12setOptionsPrefix, "TAO.setOptionsPrefix(self, prefix: str) -> None\nSet the prefix used for searching for options in the database.\n\n Logically collective.\n\n See Also\n --------\n petsc_options, petsc.TaoSetOptionsPrefix\n\n \nSource code at petsc4py/PETSc/TAO.pyx:196"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_13setOptionsPrefix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_prefix = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setOptionsPrefix (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_prefix,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_prefix)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 196, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setOptionsPrefix") < 0)) __PYX_ERR(52, 196, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_prefix = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setOptionsPrefix", 1, 1, 1, __pyx_nargs); __PYX_ERR(52, 196, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TAO.setOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_12setOptionsPrefix(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_prefix); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_12setOptionsPrefix(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_prefix) { char const *__pyx_v_cprefix; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setOptionsPrefix", 0); __Pyx_INCREF(__pyx_v_prefix); /* "petsc4py/PETSc/TAO.pyx":206 * * """ * cdef const char *cprefix = NULL # <<<<<<<<<<<<<< * prefix = str2bytes(prefix, &cprefix) * CHKERR( TaoSetOptionsPrefix(self.tao, cprefix) ) */ __pyx_v_cprefix = NULL; /* "petsc4py/PETSc/TAO.pyx":207 * """ * cdef const char *cprefix = NULL * prefix = str2bytes(prefix, &cprefix) # <<<<<<<<<<<<<< * CHKERR( TaoSetOptionsPrefix(self.tao, cprefix) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_prefix, (&__pyx_v_cprefix)); if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_prefix, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/TAO.pyx":208 * cdef const char *cprefix = NULL * prefix = str2bytes(prefix, &cprefix) * CHKERR( TaoSetOptionsPrefix(self.tao, cprefix) ) # <<<<<<<<<<<<<< * * def appendOptionsPrefix(self, prefix: str) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSetOptionsPrefix(__pyx_v_self->tao, __pyx_v_cprefix)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 208, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":196 * return bytes2str(ctype) * * def setOptionsPrefix(self, prefix: str) -> None: # <<<<<<<<<<<<<< * """Set the prefix used for searching for options in the database. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TAO.setOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_prefix); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":210 * CHKERR( TaoSetOptionsPrefix(self.tao, cprefix) ) * * def appendOptionsPrefix(self, prefix: str) -> None: # <<<<<<<<<<<<<< * """Append to the prefix used for searching for options in the database. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_15appendOptionsPrefix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_14appendOptionsPrefix, "TAO.appendOptionsPrefix(self, prefix: str) -> None\nAppend to the prefix used for searching for options in the database.\n\n Logically collective.\n\n See Also\n --------\n petsc_options, setOptionsPrefix, petsc.TaoAppendOptionsPrefix\n\n \nSource code at petsc4py/PETSc/TAO.pyx:210"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_15appendOptionsPrefix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_prefix = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("appendOptionsPrefix (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_prefix,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_prefix)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 210, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "appendOptionsPrefix") < 0)) __PYX_ERR(52, 210, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_prefix = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("appendOptionsPrefix", 1, 1, 1, __pyx_nargs); __PYX_ERR(52, 210, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TAO.appendOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_14appendOptionsPrefix(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_prefix); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_14appendOptionsPrefix(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_prefix) { char const *__pyx_v_cprefix; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("appendOptionsPrefix", 0); __Pyx_INCREF(__pyx_v_prefix); /* "petsc4py/PETSc/TAO.pyx":220 * * """ * cdef const char *cprefix = NULL # <<<<<<<<<<<<<< * prefix = str2bytes(prefix, &cprefix) * CHKERR( TaoAppendOptionsPrefix(self.tao, cprefix) ) */ __pyx_v_cprefix = NULL; /* "petsc4py/PETSc/TAO.pyx":221 * """ * cdef const char *cprefix = NULL * prefix = str2bytes(prefix, &cprefix) # <<<<<<<<<<<<<< * CHKERR( TaoAppendOptionsPrefix(self.tao, cprefix) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_prefix, (&__pyx_v_cprefix)); if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_prefix, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/TAO.pyx":222 * cdef const char *cprefix = NULL * prefix = str2bytes(prefix, &cprefix) * CHKERR( TaoAppendOptionsPrefix(self.tao, cprefix) ) # <<<<<<<<<<<<<< * * def getOptionsPrefix(self) -> str: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoAppendOptionsPrefix(__pyx_v_self->tao, __pyx_v_cprefix)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 222, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":210 * CHKERR( TaoSetOptionsPrefix(self.tao, cprefix) ) * * def appendOptionsPrefix(self, prefix: str) -> None: # <<<<<<<<<<<<<< * """Append to the prefix used for searching for options in the database. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TAO.appendOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_prefix); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":224 * CHKERR( TaoAppendOptionsPrefix(self.tao, cprefix) ) * * def getOptionsPrefix(self) -> str: # <<<<<<<<<<<<<< * """Return the prefix used for searching for options in the database. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_17getOptionsPrefix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_16getOptionsPrefix, "TAO.getOptionsPrefix(self) -> str\nReturn the prefix used for searching for options in the database.\n\n Not collective.\n\n See Also\n --------\n petsc_options, setOptionsPrefix, petsc.TaoGetOptionsPrefix\n\n \nSource code at petsc4py/PETSc/TAO.pyx:224"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_17getOptionsPrefix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getOptionsPrefix (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getOptionsPrefix", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getOptionsPrefix", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_16getOptionsPrefix(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_16getOptionsPrefix(struct PyPetscTAOObject *__pyx_v_self) { char const *__pyx_v_prefix; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getOptionsPrefix", 1); /* "petsc4py/PETSc/TAO.pyx":234 * * """ * cdef const char *prefix = NULL # <<<<<<<<<<<<<< * CHKERR( TaoGetOptionsPrefix(self.tao, &prefix) ) * return bytes2str(prefix) */ __pyx_v_prefix = NULL; /* "petsc4py/PETSc/TAO.pyx":235 * """ * cdef const char *prefix = NULL * CHKERR( TaoGetOptionsPrefix(self.tao, &prefix) ) # <<<<<<<<<<<<<< * return bytes2str(prefix) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoGetOptionsPrefix(__pyx_v_self->tao, (&__pyx_v_prefix))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 235, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":236 * cdef const char *prefix = NULL * CHKERR( TaoGetOptionsPrefix(self.tao, &prefix) ) * return bytes2str(prefix) # <<<<<<<<<<<<<< * * def setFromOptions(self) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_prefix); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TAO.pyx":224 * CHKERR( TaoAppendOptionsPrefix(self.tao, cprefix) ) * * def getOptionsPrefix(self) -> str: # <<<<<<<<<<<<<< * """Return the prefix used for searching for options in the database. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TAO.getOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":238 * return bytes2str(prefix) * * def setFromOptions(self) -> None: # <<<<<<<<<<<<<< * """Configure the solver from the options database. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_19setFromOptions(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_18setFromOptions, "TAO.setFromOptions(self) -> None\nConfigure the solver from the options database.\n\n Collective.\n\n See Also\n --------\n petsc_options, petsc.TaoSetFromOptions\n\n \nSource code at petsc4py/PETSc/TAO.pyx:238"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_19setFromOptions(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFromOptions (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("setFromOptions", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setFromOptions", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_18setFromOptions(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_18setFromOptions(struct PyPetscTAOObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFromOptions", 1); /* "petsc4py/PETSc/TAO.pyx":248 * * """ * CHKERR( TaoSetFromOptions(self.tao) ) # <<<<<<<<<<<<<< * * def setUp(self) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSetFromOptions(__pyx_v_self->tao)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 248, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":238 * return bytes2str(prefix) * * def setFromOptions(self) -> None: # <<<<<<<<<<<<<< * """Configure the solver from the options database. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.setFromOptions", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":250 * CHKERR( TaoSetFromOptions(self.tao) ) * * def setUp(self) -> None: # <<<<<<<<<<<<<< * """Set up the internal data structures for using the solver. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_21setUp(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_20setUp, "TAO.setUp(self) -> None\nSet up the internal data structures for using the solver.\n\n Collective.\n\n See Also\n --------\n petsc.TaoSetUp\n\n \nSource code at petsc4py/PETSc/TAO.pyx:250"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_21setUp(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setUp (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("setUp", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setUp", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_20setUp(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_20setUp(struct PyPetscTAOObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setUp", 1); /* "petsc4py/PETSc/TAO.pyx":260 * * """ * CHKERR( TaoSetUp(self.tao) ) # <<<<<<<<<<<<<< * * # */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSetUp(__pyx_v_self->tao)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 260, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":250 * CHKERR( TaoSetFromOptions(self.tao) ) * * def setUp(self) -> None: # <<<<<<<<<<<<<< * """Set up the internal data structures for using the solver. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.setUp", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":264 * # * * def setInitialTrustRegionRadius(self, radius: float) -> None: # <<<<<<<<<<<<<< * """Set the initial trust region radius. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_23setInitialTrustRegionRadius(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_22setInitialTrustRegionRadius, "TAO.setInitialTrustRegionRadius(self, radius: float) -> None\nSet the initial trust region radius.\n\n Collective.\n\n See Also\n --------\n petsc.TaoSetInitialTrustRegionRadius\n\n \nSource code at petsc4py/PETSc/TAO.pyx:264"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_23setInitialTrustRegionRadius(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_radius = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setInitialTrustRegionRadius (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_radius,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_radius)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 264, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setInitialTrustRegionRadius") < 0)) __PYX_ERR(52, 264, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_radius = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setInitialTrustRegionRadius", 1, 1, 1, __pyx_nargs); __PYX_ERR(52, 264, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TAO.setInitialTrustRegionRadius", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_22setInitialTrustRegionRadius(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_radius); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_22setInitialTrustRegionRadius(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_radius) { PetscReal __pyx_v_cradius; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setInitialTrustRegionRadius", 1); /* "petsc4py/PETSc/TAO.pyx":274 * * """ * cdef PetscReal cradius = asReal(radius) # <<<<<<<<<<<<<< * CHKERR( TaoSetInitialTrustRegionRadius(self.tao, cradius) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_radius); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(52, 274, __pyx_L1_error) __pyx_v_cradius = __pyx_t_1; /* "petsc4py/PETSc/TAO.pyx":275 * """ * cdef PetscReal cradius = asReal(radius) * CHKERR( TaoSetInitialTrustRegionRadius(self.tao, cradius) ) # <<<<<<<<<<<<<< * * # -------------- */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSetInitialTrustRegionRadius(__pyx_v_self->tao, __pyx_v_cradius)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 275, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":264 * # * * def setInitialTrustRegionRadius(self, radius: float) -> None: # <<<<<<<<<<<<<< * """Set the initial trust region radius. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.setInitialTrustRegionRadius", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":279 * # -------------- * * def setAppCtx(self, appctx: Any) -> None: # <<<<<<<<<<<<<< * """Set the application context.""" * self.set_attr("__appctx__", appctx) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_25setAppCtx(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_24setAppCtx, "TAO.setAppCtx(self, appctx: Any) -> None\nSet the application context.\nSource code at petsc4py/PETSc/TAO.pyx:279"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_25setAppCtx(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_appctx = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setAppCtx (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_appctx,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_appctx)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 279, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setAppCtx") < 0)) __PYX_ERR(52, 279, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_appctx = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setAppCtx", 1, 1, 1, __pyx_nargs); __PYX_ERR(52, 279, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TAO.setAppCtx", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_24setAppCtx(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_appctx); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_24setAppCtx(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_appctx) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setAppCtx", 1); /* "petsc4py/PETSc/TAO.pyx":281 * def setAppCtx(self, appctx: Any) -> None: * """Set the application context.""" * self.set_attr("__appctx__", appctx) # <<<<<<<<<<<<<< * * def getAppCtx(self) -> Any: */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__appctx__"), __pyx_v_appctx); if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/TAO.pyx":279 * # -------------- * * def setAppCtx(self, appctx: Any) -> None: # <<<<<<<<<<<<<< * """Set the application context.""" * self.set_attr("__appctx__", appctx) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TAO.setAppCtx", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":283 * self.set_attr("__appctx__", appctx) * * def getAppCtx(self) -> Any: # <<<<<<<<<<<<<< * """Return the application context.""" * return self.get_attr("__appctx__") */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_27getAppCtx(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_26getAppCtx, "TAO.getAppCtx(self) -> Any\nReturn the application context.\nSource code at petsc4py/PETSc/TAO.pyx:283"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_27getAppCtx(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getAppCtx (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getAppCtx", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getAppCtx", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_26getAppCtx(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_26getAppCtx(struct PyPetscTAOObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getAppCtx", 1); /* "petsc4py/PETSc/TAO.pyx":285 * def getAppCtx(self) -> Any: * """Return the application context.""" * return self.get_attr("__appctx__") # <<<<<<<<<<<<<< * * def setSolution(self, Vec x) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__appctx__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TAO.pyx":283 * self.set_attr("__appctx__", appctx) * * def getAppCtx(self) -> Any: # <<<<<<<<<<<<<< * """Return the application context.""" * return self.get_attr("__appctx__") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TAO.getAppCtx", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":287 * return self.get_attr("__appctx__") * * def setSolution(self, Vec x) -> None: # <<<<<<<<<<<<<< * """Set the vector used to store the solution. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_29setSolution(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_28setSolution, "TAO.setSolution(self, x: Vec) -> None\nSet the vector used to store the solution.\n\n Collective.\n\n See Also\n --------\n getSolution, petsc.TaoSetSolution\n\n \nSource code at petsc4py/PETSc/TAO.pyx:287"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_29setSolution(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_x = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setSolution (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 287, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setSolution") < 0)) __PYX_ERR(52, 287, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_x = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setSolution", 1, 1, 1, __pyx_nargs); __PYX_ERR(52, 287, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TAO.setSolution", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(52, 287, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_28setSolution(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_x); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_28setSolution(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setSolution", 1); /* "petsc4py/PETSc/TAO.pyx":297 * * """ * CHKERR( TaoSetSolution(self.tao, x.vec) ) # <<<<<<<<<<<<<< * * def setObjective(self, objective: TAOObjectiveFunction, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSetSolution(__pyx_v_self->tao, __pyx_v_x->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 297, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":287 * return self.get_attr("__appctx__") * * def setSolution(self, Vec x) -> None: # <<<<<<<<<<<<<< * """Set the vector used to store the solution. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.setSolution", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":299 * CHKERR( TaoSetSolution(self.tao, x.vec) ) * * def setObjective(self, objective: TAOObjectiveFunction, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: # <<<<<<<<<<<<<< * """Set the objective function evaluation callback. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_31setObjective(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_30setObjective, "TAO.setObjective(self, objective: TAOObjectiveFunction, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nSet the objective function evaluation callback.\n\n Logically collective.\n\n Parameters\n ----------\n objective\n The objective function callback.\n args\n Positional arguments for the callback.\n kargs\n Keyword arguments for the callback.\n\n See Also\n --------\n setGradient, setObjectiveGradient, petsc.TaoSetObjective\n\n \nSource code at petsc4py/PETSc/TAO.pyx:299"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_31setObjective(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_objective = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setObjective (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_objective,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_objective)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 299, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 299, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 299, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setObjective") < 0)) __PYX_ERR(52, 299, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_objective = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setObjective", 0, 1, 3, __pyx_nargs); __PYX_ERR(52, 299, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TAO.setObjective", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_30setObjective(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_objective, __pyx_v_args, __pyx_v_kargs); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_30setObjective(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_objective, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setObjective", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/TAO.pyx":318 * * """ * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (objective, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/TAO.pyx":319 * """ * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (objective, args, kargs) * self.set_attr("__objective__", context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); if (__pyx_t_1) { __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_2); __pyx_t_2 = 0; } /* "petsc4py/PETSc/TAO.pyx":320 * if args is None: args = () * if kargs is None: kargs = {} * context = (objective, args, kargs) # <<<<<<<<<<<<<< * self.set_attr("__objective__", context) * CHKERR( TaoSetObjective(self.tao, TAO_Objective, context) ) */ __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_objective); __Pyx_GIVEREF(__pyx_v_objective); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_objective)) __PYX_ERR(52, 320, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_args)) __PYX_ERR(52, 320, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_kargs)) __PYX_ERR(52, 320, __pyx_L1_error); __pyx_v_context = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/TAO.pyx":321 * if kargs is None: kargs = {} * context = (objective, args, kargs) * self.set_attr("__objective__", context) # <<<<<<<<<<<<<< * CHKERR( TaoSetObjective(self.tao, TAO_Objective, context) ) * */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__objective__"), __pyx_v_context); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/TAO.pyx":322 * context = (objective, args, kargs) * self.set_attr("__objective__", context) * CHKERR( TaoSetObjective(self.tao, TAO_Objective, context) ) # <<<<<<<<<<<<<< * * def setResidual(self, residual: TAOResidualFunction, Vec R=None, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSetObjective(__pyx_v_self->tao, __pyx_f_8petsc4py_5PETSc_TAO_Objective, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 322, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":299 * CHKERR( TaoSetSolution(self.tao, x.vec) ) * * def setObjective(self, objective: TAOObjectiveFunction, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: # <<<<<<<<<<<<<< * """Set the objective function evaluation callback. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TAO.setObjective", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":324 * CHKERR( TaoSetObjective(self.tao, TAO_Objective, context) ) * * def setResidual(self, residual: TAOResidualFunction, Vec R=None, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: # <<<<<<<<<<<<<< * """Set the residual evaluation callback for least-squares applications. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_33setResidual(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_32setResidual, "TAO.setResidual(self, residual: TAOResidualFunction, R: Vec | None = None, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nSet the residual evaluation callback for least-squares applications.\n\n Logically collective.\n\n Parameters\n ----------\n residual\n The residual callback.\n R\n The vector to store the residual.\n args\n Positional arguments for the callback.\n kargs\n Keyword arguments for the callback.\n\n See Also\n --------\n setJacobianResidual, petsc.TaoSetResidualRoutine\n\n \nSource code at petsc4py/PETSc/TAO.pyx:324"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_33setResidual(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_residual = 0; struct PyPetscVecObject *__pyx_v_R = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setResidual (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_residual,&__pyx_n_s_R,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscVecObject *)Py_None)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_residual)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 324, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_R); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 324, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 324, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 324, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setResidual") < 0)) __PYX_ERR(52, 324, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_residual = values[0]; __pyx_v_R = ((struct PyPetscVecObject *)values[1]); __pyx_v_args = values[2]; __pyx_v_kargs = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setResidual", 0, 1, 4, __pyx_nargs); __PYX_ERR(52, 324, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TAO.setResidual", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_R), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "R", 0))) __PYX_ERR(52, 324, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_32setResidual(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_residual, __pyx_v_R, __pyx_v_args, __pyx_v_kargs); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_32setResidual(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_residual, struct PyPetscVecObject *__pyx_v_R, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { Vec __pyx_v_Rvec; PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; Vec __pyx_t_2; PyObject *__pyx_t_3 = NULL; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setResidual", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/TAO.pyx":345 * * """ * cdef PetscVec Rvec = NULL # <<<<<<<<<<<<<< * if R is not None: Rvec = R.vec * if args is None: args = () */ __pyx_v_Rvec = NULL; /* "petsc4py/PETSc/TAO.pyx":346 * """ * cdef PetscVec Rvec = NULL * if R is not None: Rvec = R.vec # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = (((PyObject *)__pyx_v_R) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_R->vec; __pyx_v_Rvec = __pyx_t_2; } /* "petsc4py/PETSc/TAO.pyx":347 * cdef PetscVec Rvec = NULL * if R is not None: Rvec = R.vec * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (residual, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/TAO.pyx":348 * if R is not None: Rvec = R.vec * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (residual, args, kargs) * self.set_attr("__residual__", context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); if (__pyx_t_1) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "petsc4py/PETSc/TAO.pyx":349 * if args is None: args = () * if kargs is None: kargs = {} * context = (residual, args, kargs) # <<<<<<<<<<<<<< * self.set_attr("__residual__", context) * CHKERR( TaoSetResidualRoutine(self.tao, Rvec, TAO_Residual, context) ) */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_residual); __Pyx_GIVEREF(__pyx_v_residual); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_residual)) __PYX_ERR(52, 349, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args)) __PYX_ERR(52, 349, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs)) __PYX_ERR(52, 349, __pyx_L1_error); __pyx_v_context = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/TAO.pyx":350 * if kargs is None: kargs = {} * context = (residual, args, kargs) * self.set_attr("__residual__", context) # <<<<<<<<<<<<<< * CHKERR( TaoSetResidualRoutine(self.tao, Rvec, TAO_Residual, context) ) * */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__residual__"), __pyx_v_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/TAO.pyx":351 * context = (residual, args, kargs) * self.set_attr("__residual__", context) * CHKERR( TaoSetResidualRoutine(self.tao, Rvec, TAO_Residual, context) ) # <<<<<<<<<<<<<< * * def setJacobianResidual(self, jacobian: TAOJacobianResidualFunction, Mat J=None, Mat P=None, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSetResidualRoutine(__pyx_v_self->tao, __pyx_v_Rvec, __pyx_f_8petsc4py_5PETSc_TAO_Residual, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 351, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":324 * CHKERR( TaoSetObjective(self.tao, TAO_Objective, context) ) * * def setResidual(self, residual: TAOResidualFunction, Vec R=None, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: # <<<<<<<<<<<<<< * """Set the residual evaluation callback for least-squares applications. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TAO.setResidual", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":353 * CHKERR( TaoSetResidualRoutine(self.tao, Rvec, TAO_Residual, context) ) * * def setJacobianResidual(self, jacobian: TAOJacobianResidualFunction, Mat J=None, Mat P=None, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: # <<<<<<<<<<<<<< * """Set the callback to compute the least-squares residual Jacobian. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_35setJacobianResidual(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_34setJacobianResidual, "TAO.setJacobianResidual(self, jacobian: TAOJacobianResidualFunction, J: Mat | None = None, P: Mat | None = None, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nSet the callback to compute the least-squares residual Jacobian.\n\n Logically collective.\n\n Parameters\n ----------\n jacobian\n The Jacobian callback.\n J\n The matrix to store the Jacobian.\n P\n The matrix to construct the preconditioner.\n args\n Positional arguments for the callback.\n kargs\n Keyword arguments for the callback.\n\n See Also\n --------\n setResidual, petsc.TaoSetJacobianResidualRoutine\n\n \nSource code at petsc4py/PETSc/TAO.pyx:353"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_35setJacobianResidual(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_jacobian = 0; struct PyPetscMatObject *__pyx_v_J = 0; struct PyPetscMatObject *__pyx_v_P = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setJacobianResidual (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_jacobian,&__pyx_n_s_J,&__pyx_n_s_P,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscMatObject *)Py_None)); values[2] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscMatObject *)Py_None)); values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_jacobian)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 353, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_J); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 353, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_P); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 353, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 353, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 353, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setJacobianResidual") < 0)) __PYX_ERR(52, 353, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_jacobian = values[0]; __pyx_v_J = ((struct PyPetscMatObject *)values[1]); __pyx_v_P = ((struct PyPetscMatObject *)values[2]); __pyx_v_args = values[3]; __pyx_v_kargs = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setJacobianResidual", 0, 1, 5, __pyx_nargs); __PYX_ERR(52, 353, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TAO.setJacobianResidual", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_J), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "J", 0))) __PYX_ERR(52, 353, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_P), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "P", 0))) __PYX_ERR(52, 353, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_34setJacobianResidual(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_jacobian, __pyx_v_J, __pyx_v_P, __pyx_v_args, __pyx_v_kargs); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_34setJacobianResidual(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_jacobian, struct PyPetscMatObject *__pyx_v_J, struct PyPetscMatObject *__pyx_v_P, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { Mat __pyx_v_Jmat; Mat __pyx_v_Pmat; PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; Mat __pyx_t_2; PyObject *__pyx_t_3 = NULL; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setJacobianResidual", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/TAO.pyx":376 * * """ * cdef PetscMat Jmat = NULL # <<<<<<<<<<<<<< * if J is not None: Jmat = J.mat * cdef PetscMat Pmat = Jmat */ __pyx_v_Jmat = NULL; /* "petsc4py/PETSc/TAO.pyx":377 * """ * cdef PetscMat Jmat = NULL * if J is not None: Jmat = J.mat # <<<<<<<<<<<<<< * cdef PetscMat Pmat = Jmat * if P is not None: Pmat = P.mat */ __pyx_t_1 = (((PyObject *)__pyx_v_J) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_J->mat; __pyx_v_Jmat = __pyx_t_2; } /* "petsc4py/PETSc/TAO.pyx":378 * cdef PetscMat Jmat = NULL * if J is not None: Jmat = J.mat * cdef PetscMat Pmat = Jmat # <<<<<<<<<<<<<< * if P is not None: Pmat = P.mat * if args is None: args = () */ __pyx_v_Pmat = __pyx_v_Jmat; /* "petsc4py/PETSc/TAO.pyx":379 * if J is not None: Jmat = J.mat * cdef PetscMat Pmat = Jmat * if P is not None: Pmat = P.mat # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = (((PyObject *)__pyx_v_P) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_P->mat; __pyx_v_Pmat = __pyx_t_2; } /* "petsc4py/PETSc/TAO.pyx":380 * cdef PetscMat Pmat = Jmat * if P is not None: Pmat = P.mat * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (jacobian, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/TAO.pyx":381 * if P is not None: Pmat = P.mat * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (jacobian, args, kargs) * self.set_attr("__jacobian_residual__", context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); if (__pyx_t_1) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "petsc4py/PETSc/TAO.pyx":382 * if args is None: args = () * if kargs is None: kargs = {} * context = (jacobian, args, kargs) # <<<<<<<<<<<<<< * self.set_attr("__jacobian_residual__", context) * CHKERR( TaoSetJacobianResidualRoutine(self.tao, Jmat, Pmat, TAO_JacobianResidual, context) ) */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 382, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_jacobian); __Pyx_GIVEREF(__pyx_v_jacobian); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_jacobian)) __PYX_ERR(52, 382, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args)) __PYX_ERR(52, 382, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs)) __PYX_ERR(52, 382, __pyx_L1_error); __pyx_v_context = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/TAO.pyx":383 * if kargs is None: kargs = {} * context = (jacobian, args, kargs) * self.set_attr("__jacobian_residual__", context) # <<<<<<<<<<<<<< * CHKERR( TaoSetJacobianResidualRoutine(self.tao, Jmat, Pmat, TAO_JacobianResidual, context) ) * */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__jacobian_residual__"), __pyx_v_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 383, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/TAO.pyx":384 * context = (jacobian, args, kargs) * self.set_attr("__jacobian_residual__", context) * CHKERR( TaoSetJacobianResidualRoutine(self.tao, Jmat, Pmat, TAO_JacobianResidual, context) ) # <<<<<<<<<<<<<< * * def setGradient(self, gradient: TAOGradientFunction, Vec g=None, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSetJacobianResidualRoutine(__pyx_v_self->tao, __pyx_v_Jmat, __pyx_v_Pmat, __pyx_f_8petsc4py_5PETSc_TAO_JacobianResidual, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 384, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":353 * CHKERR( TaoSetResidualRoutine(self.tao, Rvec, TAO_Residual, context) ) * * def setJacobianResidual(self, jacobian: TAOJacobianResidualFunction, Mat J=None, Mat P=None, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: # <<<<<<<<<<<<<< * """Set the callback to compute the least-squares residual Jacobian. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TAO.setJacobianResidual", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":386 * CHKERR( TaoSetJacobianResidualRoutine(self.tao, Jmat, Pmat, TAO_JacobianResidual, context) ) * * def setGradient(self, gradient: TAOGradientFunction, Vec g=None, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: # <<<<<<<<<<<<<< * """Set the gradient evaluation callback. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_37setGradient(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_36setGradient, "TAO.setGradient(self, gradient: TAOGradientFunction, g: Vec | None = None, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nSet the gradient evaluation callback.\n\n Logically collective.\n\n Parameters\n ----------\n gradient\n The gradient callback.\n g\n The vector to store the gradient.\n args\n Positional arguments for the callback.\n kargs\n Keyword arguments for the callback.\n\n See Also\n --------\n setObjective, setObjectiveGradient, setHessian, petsc.TaoSetGradient\n\n \nSource code at petsc4py/PETSc/TAO.pyx:386"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_37setGradient(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_gradient = 0; struct PyPetscVecObject *__pyx_v_g = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setGradient (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gradient,&__pyx_n_s_g,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscVecObject *)Py_None)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gradient)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 386, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_g); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 386, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 386, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 386, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setGradient") < 0)) __PYX_ERR(52, 386, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_gradient = values[0]; __pyx_v_g = ((struct PyPetscVecObject *)values[1]); __pyx_v_args = values[2]; __pyx_v_kargs = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setGradient", 0, 1, 4, __pyx_nargs); __PYX_ERR(52, 386, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TAO.setGradient", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_g), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "g", 0))) __PYX_ERR(52, 386, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_36setGradient(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_gradient, __pyx_v_g, __pyx_v_args, __pyx_v_kargs); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_36setGradient(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_gradient, struct PyPetscVecObject *__pyx_v_g, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { Vec __pyx_v_gvec; PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; Vec __pyx_t_2; PyObject *__pyx_t_3 = NULL; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setGradient", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/TAO.pyx":407 * * """ * cdef PetscVec gvec = NULL # <<<<<<<<<<<<<< * if g is not None: gvec = g.vec * if args is None: args = () */ __pyx_v_gvec = NULL; /* "petsc4py/PETSc/TAO.pyx":408 * """ * cdef PetscVec gvec = NULL * if g is not None: gvec = g.vec # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = (((PyObject *)__pyx_v_g) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_g->vec; __pyx_v_gvec = __pyx_t_2; } /* "petsc4py/PETSc/TAO.pyx":409 * cdef PetscVec gvec = NULL * if g is not None: gvec = g.vec * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (gradient, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/TAO.pyx":410 * if g is not None: gvec = g.vec * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (gradient, args, kargs) * self.set_attr("__gradient__", context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); if (__pyx_t_1) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "petsc4py/PETSc/TAO.pyx":411 * if args is None: args = () * if kargs is None: kargs = {} * context = (gradient, args, kargs) # <<<<<<<<<<<<<< * self.set_attr("__gradient__", context) * CHKERR( TaoSetGradient(self.tao, gvec, TAO_Gradient, context) ) */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_gradient); __Pyx_GIVEREF(__pyx_v_gradient); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_gradient)) __PYX_ERR(52, 411, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args)) __PYX_ERR(52, 411, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs)) __PYX_ERR(52, 411, __pyx_L1_error); __pyx_v_context = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/TAO.pyx":412 * if kargs is None: kargs = {} * context = (gradient, args, kargs) * self.set_attr("__gradient__", context) # <<<<<<<<<<<<<< * CHKERR( TaoSetGradient(self.tao, gvec, TAO_Gradient, context) ) * */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__gradient__"), __pyx_v_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/TAO.pyx":413 * context = (gradient, args, kargs) * self.set_attr("__gradient__", context) * CHKERR( TaoSetGradient(self.tao, gvec, TAO_Gradient, context) ) # <<<<<<<<<<<<<< * * def getGradient(self) -> tuple[Vec, TAOGradientFunction]: */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSetGradient(__pyx_v_self->tao, __pyx_v_gvec, __pyx_f_8petsc4py_5PETSc_TAO_Gradient, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 413, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":386 * CHKERR( TaoSetJacobianResidualRoutine(self.tao, Jmat, Pmat, TAO_JacobianResidual, context) ) * * def setGradient(self, gradient: TAOGradientFunction, Vec g=None, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: # <<<<<<<<<<<<<< * """Set the gradient evaluation callback. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TAO.setGradient", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":415 * CHKERR( TaoSetGradient(self.tao, gvec, TAO_Gradient, context) ) * * def getGradient(self) -> tuple[Vec, TAOGradientFunction]: # <<<<<<<<<<<<<< * """Return the vector used to store the gradient and the evaluation callback. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_39getGradient(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_38getGradient, "TAO.getGradient(self) -> tuple[Vec, TAOGradientFunction]\nReturn the vector used to store the gradient and the evaluation callback.\n\n Not collective.\n\n See Also\n --------\n setGradient, setHessian, petsc.TaoGetGradient\n\n \nSource code at petsc4py/PETSc/TAO.pyx:415"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_39getGradient(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getGradient (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getGradient", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getGradient", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_38getGradient(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_38getGradient(struct PyPetscTAOObject *__pyx_v_self) { struct PyPetscVecObject *__pyx_v_vec = 0; PyObject *__pyx_v_gradient = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getGradient", 1); /* "petsc4py/PETSc/TAO.pyx":425 * * """ * cdef Vec vec = Vec() # <<<<<<<<<<<<<< * CHKERR( TaoGetGradient(self.tao, &vec.vec, NULL, NULL) ) * CHKERR( PetscINCREF(vec.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/TAO.pyx":426 * """ * cdef Vec vec = Vec() * CHKERR( TaoGetGradient(self.tao, &vec.vec, NULL, NULL) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(vec.obj) ) * cdef object gradient = self.get_attr("__gradient__") */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoGetGradient(__pyx_v_self->tao, (&__pyx_v_vec->vec), NULL, NULL)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 426, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":427 * cdef Vec vec = Vec() * CHKERR( TaoGetGradient(self.tao, &vec.vec, NULL, NULL) ) * CHKERR( PetscINCREF(vec.obj) ) # <<<<<<<<<<<<<< * cdef object gradient = self.get_attr("__gradient__") * return (vec, gradient) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_vec->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 427, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":428 * CHKERR( TaoGetGradient(self.tao, &vec.vec, NULL, NULL) ) * CHKERR( PetscINCREF(vec.obj) ) * cdef object gradient = self.get_attr("__gradient__") # <<<<<<<<<<<<<< * return (vec, gradient) * */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__gradient__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_gradient = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/TAO.pyx":429 * CHKERR( PetscINCREF(vec.obj) ) * cdef object gradient = self.get_attr("__gradient__") * return (vec, gradient) # <<<<<<<<<<<<<< * * def setObjectiveGradient(self, objgrad: TAOObjectiveGradientFunction, Vec g=None, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF((PyObject *)__pyx_v_vec); __Pyx_GIVEREF((PyObject *)__pyx_v_vec); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_vec))) __PYX_ERR(52, 429, __pyx_L1_error); __Pyx_INCREF(__pyx_v_gradient); __Pyx_GIVEREF(__pyx_v_gradient); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_gradient)) __PYX_ERR(52, 429, __pyx_L1_error); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TAO.pyx":415 * CHKERR( TaoSetGradient(self.tao, gvec, TAO_Gradient, context) ) * * def getGradient(self) -> tuple[Vec, TAOGradientFunction]: # <<<<<<<<<<<<<< * """Return the vector used to store the gradient and the evaluation callback. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TAO.getGradient", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_vec); __Pyx_XDECREF(__pyx_v_gradient); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":431 * return (vec, gradient) * * def setObjectiveGradient(self, objgrad: TAOObjectiveGradientFunction, Vec g=None, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: # <<<<<<<<<<<<<< * """Set the objective function and gradient evaluation callback. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_41setObjectiveGradient(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_40setObjectiveGradient, "TAO.setObjectiveGradient(self, objgrad: TAOObjectiveGradientFunction, g: Vec | None = None, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nSet the objective function and gradient evaluation callback.\n\n Logically collective.\n\n Parameters\n ----------\n objgrad\n The objective function and gradient callback.\n g\n The vector to store the gradient.\n args\n Positional arguments for the callback.\n kargs\n Keyword arguments for the callback.\n\n See Also\n --------\n setObjective, setGradient, setHessian, getObjectiveAndGradient\n petsc.TaoSetObjectiveAndGradient\n\n \nSource code at petsc4py/PETSc/TAO.pyx:431"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_41setObjectiveGradient(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_objgrad = 0; struct PyPetscVecObject *__pyx_v_g = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setObjectiveGradient (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_objgrad,&__pyx_n_s_g,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscVecObject *)Py_None)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_objgrad)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 431, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_g); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 431, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 431, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 431, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setObjectiveGradient") < 0)) __PYX_ERR(52, 431, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_objgrad = values[0]; __pyx_v_g = ((struct PyPetscVecObject *)values[1]); __pyx_v_args = values[2]; __pyx_v_kargs = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setObjectiveGradient", 0, 1, 4, __pyx_nargs); __PYX_ERR(52, 431, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TAO.setObjectiveGradient", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_g), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "g", 0))) __PYX_ERR(52, 431, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_40setObjectiveGradient(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_objgrad, __pyx_v_g, __pyx_v_args, __pyx_v_kargs); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_40setObjectiveGradient(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_objgrad, struct PyPetscVecObject *__pyx_v_g, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { Vec __pyx_v_gvec; PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; Vec __pyx_t_2; PyObject *__pyx_t_3 = NULL; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setObjectiveGradient", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/TAO.pyx":453 * * """ * cdef PetscVec gvec = NULL # <<<<<<<<<<<<<< * if g is not None: gvec = g.vec * if args is None: args = () */ __pyx_v_gvec = NULL; /* "petsc4py/PETSc/TAO.pyx":454 * """ * cdef PetscVec gvec = NULL * if g is not None: gvec = g.vec # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = (((PyObject *)__pyx_v_g) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_g->vec; __pyx_v_gvec = __pyx_t_2; } /* "petsc4py/PETSc/TAO.pyx":455 * cdef PetscVec gvec = NULL * if g is not None: gvec = g.vec * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (objgrad, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/TAO.pyx":456 * if g is not None: gvec = g.vec * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (objgrad, args, kargs) * self.set_attr("__objgrad__", context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); if (__pyx_t_1) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 456, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "petsc4py/PETSc/TAO.pyx":457 * if args is None: args = () * if kargs is None: kargs = {} * context = (objgrad, args, kargs) # <<<<<<<<<<<<<< * self.set_attr("__objgrad__", context) * CHKERR( TaoSetObjectiveAndGradient(self.tao, gvec, TAO_ObjGrad, context) ) */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 457, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_objgrad); __Pyx_GIVEREF(__pyx_v_objgrad); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_objgrad)) __PYX_ERR(52, 457, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args)) __PYX_ERR(52, 457, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs)) __PYX_ERR(52, 457, __pyx_L1_error); __pyx_v_context = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/TAO.pyx":458 * if kargs is None: kargs = {} * context = (objgrad, args, kargs) * self.set_attr("__objgrad__", context) # <<<<<<<<<<<<<< * CHKERR( TaoSetObjectiveAndGradient(self.tao, gvec, TAO_ObjGrad, context) ) * */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__objgrad__"), __pyx_v_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/TAO.pyx":459 * context = (objgrad, args, kargs) * self.set_attr("__objgrad__", context) * CHKERR( TaoSetObjectiveAndGradient(self.tao, gvec, TAO_ObjGrad, context) ) # <<<<<<<<<<<<<< * * def getObjectiveAndGradient(self) -> tuple[Vec, TAOObjectiveGradientFunction]: */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSetObjectiveAndGradient(__pyx_v_self->tao, __pyx_v_gvec, __pyx_f_8petsc4py_5PETSc_TAO_ObjGrad, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 459, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":431 * return (vec, gradient) * * def setObjectiveGradient(self, objgrad: TAOObjectiveGradientFunction, Vec g=None, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: # <<<<<<<<<<<<<< * """Set the objective function and gradient evaluation callback. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TAO.setObjectiveGradient", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":461 * CHKERR( TaoSetObjectiveAndGradient(self.tao, gvec, TAO_ObjGrad, context) ) * * def getObjectiveAndGradient(self) -> tuple[Vec, TAOObjectiveGradientFunction]: # <<<<<<<<<<<<<< * """Return the vector used to store the gradient and the evaluation callback. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_43getObjectiveAndGradient(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_42getObjectiveAndGradient, "TAO.getObjectiveAndGradient(self) -> tuple[Vec, TAOObjectiveGradientFunction]\nReturn the vector used to store the gradient and the evaluation callback.\n\n Not collective.\n\n See Also\n --------\n setObjectiveGradient, petsc.TaoGetObjectiveAndGradient\n\n \nSource code at petsc4py/PETSc/TAO.pyx:461"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_43getObjectiveAndGradient(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getObjectiveAndGradient (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getObjectiveAndGradient", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getObjectiveAndGradient", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_42getObjectiveAndGradient(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_42getObjectiveAndGradient(struct PyPetscTAOObject *__pyx_v_self) { struct PyPetscVecObject *__pyx_v_vec = 0; PyObject *__pyx_v_objgrad = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getObjectiveAndGradient", 1); /* "petsc4py/PETSc/TAO.pyx":471 * * """ * cdef Vec vec = Vec() # <<<<<<<<<<<<<< * CHKERR( TaoGetObjectiveAndGradient(self.tao, &vec.vec, NULL, NULL) ) * CHKERR( PetscINCREF(vec.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/TAO.pyx":472 * """ * cdef Vec vec = Vec() * CHKERR( TaoGetObjectiveAndGradient(self.tao, &vec.vec, NULL, NULL) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(vec.obj) ) * cdef object objgrad = self.get_attr("__objgrad__") */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoGetObjectiveAndGradient(__pyx_v_self->tao, (&__pyx_v_vec->vec), NULL, NULL)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 472, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":473 * cdef Vec vec = Vec() * CHKERR( TaoGetObjectiveAndGradient(self.tao, &vec.vec, NULL, NULL) ) * CHKERR( PetscINCREF(vec.obj) ) # <<<<<<<<<<<<<< * cdef object objgrad = self.get_attr("__objgrad__") * return (vec, objgrad) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_vec->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 473, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":474 * CHKERR( TaoGetObjectiveAndGradient(self.tao, &vec.vec, NULL, NULL) ) * CHKERR( PetscINCREF(vec.obj) ) * cdef object objgrad = self.get_attr("__objgrad__") # <<<<<<<<<<<<<< * return (vec, objgrad) * */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__objgrad__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_objgrad = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/TAO.pyx":475 * CHKERR( PetscINCREF(vec.obj) ) * cdef object objgrad = self.get_attr("__objgrad__") * return (vec, objgrad) # <<<<<<<<<<<<<< * * def setVariableBounds(self, varbounds: tuple[Vec, Vec] | TAOVariableBoundsFunction, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF((PyObject *)__pyx_v_vec); __Pyx_GIVEREF((PyObject *)__pyx_v_vec); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_vec))) __PYX_ERR(52, 475, __pyx_L1_error); __Pyx_INCREF(__pyx_v_objgrad); __Pyx_GIVEREF(__pyx_v_objgrad); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_objgrad)) __PYX_ERR(52, 475, __pyx_L1_error); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TAO.pyx":461 * CHKERR( TaoSetObjectiveAndGradient(self.tao, gvec, TAO_ObjGrad, context) ) * * def getObjectiveAndGradient(self) -> tuple[Vec, TAOObjectiveGradientFunction]: # <<<<<<<<<<<<<< * """Return the vector used to store the gradient and the evaluation callback. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TAO.getObjectiveAndGradient", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_vec); __Pyx_XDECREF(__pyx_v_objgrad); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":477 * return (vec, objgrad) * * def setVariableBounds(self, varbounds: tuple[Vec, Vec] | TAOVariableBoundsFunction, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: # <<<<<<<<<<<<<< * """Set the upper and lower bounds for the optimization problem. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_45setVariableBounds(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_44setVariableBounds, "TAO.setVariableBounds(self, varbounds: tuple[Vec, Vec] | TAOVariableBoundsFunction, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nSet the upper and lower bounds for the optimization problem.\n\n Logically collective.\n\n Parameters\n ----------\n varbounds\n Either a tuple of `Vec` or a `TAOVariableBoundsFunction` callback.\n args\n Positional arguments for the callback.\n kargs\n Keyword arguments for the callback.\n\n See Also\n --------\n petsc.TaoSetVariableBounds, petsc.TaoSetVariableBoundsRoutine\n\n \nSource code at petsc4py/PETSc/TAO.pyx:477"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_45setVariableBounds(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_varbounds = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setVariableBounds (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_varbounds,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_varbounds)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 477, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 477, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 477, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setVariableBounds") < 0)) __PYX_ERR(52, 477, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_varbounds = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setVariableBounds", 0, 1, 3, __pyx_nargs); __PYX_ERR(52, 477, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TAO.setVariableBounds", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_44setVariableBounds(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_varbounds, __pyx_v_args, __pyx_v_kargs); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_44setVariableBounds(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_varbounds, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { struct PyPetscVecObject *__pyx_v_xl = 0; struct PyPetscVecObject *__pyx_v_xu = 0; PyObject *__pyx_v_ol = NULL; PyObject *__pyx_v_ou = NULL; PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *(*__pyx_t_6)(PyObject *); PetscErrorCode __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setVariableBounds", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/TAO.pyx":496 * * """ * cdef Vec xl = None, xu = None # <<<<<<<<<<<<<< * if (isinstance(varbounds, list) or isinstance(varbounds, tuple)): * ol, ou = varbounds */ __Pyx_INCREF(Py_None); __pyx_v_xl = ((struct PyPetscVecObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_xu = ((struct PyPetscVecObject *)Py_None); /* "petsc4py/PETSc/TAO.pyx":497 * """ * cdef Vec xl = None, xu = None * if (isinstance(varbounds, list) or isinstance(varbounds, tuple)): # <<<<<<<<<<<<<< * ol, ou = varbounds * xl = ol; xu = ou */ __pyx_t_2 = PyList_Check(__pyx_v_varbounds); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = PyTuple_Check(__pyx_v_varbounds); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "petsc4py/PETSc/TAO.pyx":498 * cdef Vec xl = None, xu = None * if (isinstance(varbounds, list) or isinstance(varbounds, tuple)): * ol, ou = varbounds # <<<<<<<<<<<<<< * xl = ol; xu = ou * CHKERR( TaoSetVariableBounds(self.tao, xl.vec, xu.vec) ) */ if ((likely(PyTuple_CheckExact(__pyx_v_varbounds))) || (PyList_CheckExact(__pyx_v_varbounds))) { PyObject* sequence = __pyx_v_varbounds; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(52, 498, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_3 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); #else __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { Py_ssize_t index = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_varbounds); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); index = 0; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 1; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(52, 498, __pyx_L1_error) __pyx_t_6 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L7_unpacking_done; __pyx_L6_unpacking_failed:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(52, 498, __pyx_L1_error) __pyx_L7_unpacking_done:; } __pyx_v_ol = __pyx_t_3; __pyx_t_3 = 0; __pyx_v_ou = __pyx_t_4; __pyx_t_4 = 0; /* "petsc4py/PETSc/TAO.pyx":499 * if (isinstance(varbounds, list) or isinstance(varbounds, tuple)): * ol, ou = varbounds * xl = ol; xu = ou # <<<<<<<<<<<<<< * CHKERR( TaoSetVariableBounds(self.tao, xl.vec, xu.vec) ) * return */ if (!(likely(__Pyx_TypeTest(__pyx_v_ol, __pyx_ptype_8petsc4py_5PETSc_Vec)))) __PYX_ERR(52, 499, __pyx_L1_error) __pyx_t_4 = __pyx_v_ol; __Pyx_INCREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_xl, ((struct PyPetscVecObject *)__pyx_t_4)); __pyx_t_4 = 0; if (!(likely(__Pyx_TypeTest(__pyx_v_ou, __pyx_ptype_8petsc4py_5PETSc_Vec)))) __PYX_ERR(52, 499, __pyx_L1_error) __pyx_t_4 = __pyx_v_ou; __Pyx_INCREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_xu, ((struct PyPetscVecObject *)__pyx_t_4)); __pyx_t_4 = 0; /* "petsc4py/PETSc/TAO.pyx":500 * ol, ou = varbounds * xl = ol; xu = ou * CHKERR( TaoSetVariableBounds(self.tao, xl.vec, xu.vec) ) # <<<<<<<<<<<<<< * return * if isinstance(varbounds, Vec): #FIXME */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSetVariableBounds(__pyx_v_self->tao, __pyx_v_xl->vec, __pyx_v_xu->vec)); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 500, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":501 * xl = ol; xu = ou * CHKERR( TaoSetVariableBounds(self.tao, xl.vec, xu.vec) ) * return # <<<<<<<<<<<<<< * if isinstance(varbounds, Vec): #FIXME * ol = varbounds; ou = args */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "petsc4py/PETSc/TAO.pyx":497 * """ * cdef Vec xl = None, xu = None * if (isinstance(varbounds, list) or isinstance(varbounds, tuple)): # <<<<<<<<<<<<<< * ol, ou = varbounds * xl = ol; xu = ou */ } /* "petsc4py/PETSc/TAO.pyx":502 * CHKERR( TaoSetVariableBounds(self.tao, xl.vec, xu.vec) ) * return * if isinstance(varbounds, Vec): #FIXME # <<<<<<<<<<<<<< * ol = varbounds; ou = args * xl = ol; xu = ou */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_varbounds, __pyx_ptype_8petsc4py_5PETSc_Vec); if (__pyx_t_1) { /* "petsc4py/PETSc/TAO.pyx":503 * return * if isinstance(varbounds, Vec): #FIXME * ol = varbounds; ou = args # <<<<<<<<<<<<<< * xl = ol; xu = ou * CHKERR( TaoSetVariableBounds(self.tao, xl.vec, xu.vec) ) */ __Pyx_INCREF(__pyx_v_varbounds); __pyx_v_ol = __pyx_v_varbounds; __Pyx_INCREF(__pyx_v_args); __pyx_v_ou = __pyx_v_args; /* "petsc4py/PETSc/TAO.pyx":504 * if isinstance(varbounds, Vec): #FIXME * ol = varbounds; ou = args * xl = ol; xu = ou # <<<<<<<<<<<<<< * CHKERR( TaoSetVariableBounds(self.tao, xl.vec, xu.vec) ) * return */ if (!(likely(__Pyx_TypeTest(__pyx_v_ol, __pyx_ptype_8petsc4py_5PETSc_Vec)))) __PYX_ERR(52, 504, __pyx_L1_error) __pyx_t_4 = __pyx_v_ol; __Pyx_INCREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_xl, ((struct PyPetscVecObject *)__pyx_t_4)); __pyx_t_4 = 0; if (!(likely(__Pyx_TypeTest(__pyx_v_ou, __pyx_ptype_8petsc4py_5PETSc_Vec)))) __PYX_ERR(52, 504, __pyx_L1_error) __pyx_t_4 = __pyx_v_ou; __Pyx_INCREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_xu, ((struct PyPetscVecObject *)__pyx_t_4)); __pyx_t_4 = 0; /* "petsc4py/PETSc/TAO.pyx":505 * ol = varbounds; ou = args * xl = ol; xu = ou * CHKERR( TaoSetVariableBounds(self.tao, xl.vec, xu.vec) ) # <<<<<<<<<<<<<< * return * if args is None: args = () */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSetVariableBounds(__pyx_v_self->tao, __pyx_v_xl->vec, __pyx_v_xu->vec)); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 505, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":506 * xl = ol; xu = ou * CHKERR( TaoSetVariableBounds(self.tao, xl.vec, xu.vec) ) * return # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "petsc4py/PETSc/TAO.pyx":502 * CHKERR( TaoSetVariableBounds(self.tao, xl.vec, xu.vec) ) * return * if isinstance(varbounds, Vec): #FIXME # <<<<<<<<<<<<<< * ol = varbounds; ou = args * xl = ol; xu = ou */ } /* "petsc4py/PETSc/TAO.pyx":507 * CHKERR( TaoSetVariableBounds(self.tao, xl.vec, xu.vec) ) * return * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (varbounds, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/TAO.pyx":508 * return * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (varbounds, args, kargs) * self.set_attr("__varbounds__", context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); if (__pyx_t_1) { __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 508, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_4); __pyx_t_4 = 0; } /* "petsc4py/PETSc/TAO.pyx":509 * if args is None: args = () * if kargs is None: kargs = {} * context = (varbounds, args, kargs) # <<<<<<<<<<<<<< * self.set_attr("__varbounds__", context) * CHKERR( TaoSetVariableBoundsRoutine(self.tao, TAO_VarBounds, context) ) */ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 509, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_varbounds); __Pyx_GIVEREF(__pyx_v_varbounds); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_varbounds)) __PYX_ERR(52, 509, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_args)) __PYX_ERR(52, 509, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_kargs)) __PYX_ERR(52, 509, __pyx_L1_error); __pyx_v_context = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/TAO.pyx":510 * if kargs is None: kargs = {} * context = (varbounds, args, kargs) * self.set_attr("__varbounds__", context) # <<<<<<<<<<<<<< * CHKERR( TaoSetVariableBoundsRoutine(self.tao, TAO_VarBounds, context) ) * */ __pyx_t_4 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__varbounds__"), __pyx_v_context); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 510, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/TAO.pyx":511 * context = (varbounds, args, kargs) * self.set_attr("__varbounds__", context) * CHKERR( TaoSetVariableBoundsRoutine(self.tao, TAO_VarBounds, context) ) # <<<<<<<<<<<<<< * * def setConstraints(self, constraints: TAOConstraintsFunction, Vec C=None, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSetVariableBoundsRoutine(__pyx_v_self->tao, __pyx_f_8petsc4py_5PETSc_TAO_VarBounds, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 511, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":477 * return (vec, objgrad) * * def setVariableBounds(self, varbounds: tuple[Vec, Vec] | TAOVariableBoundsFunction, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: # <<<<<<<<<<<<<< * """Set the upper and lower bounds for the optimization problem. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.TAO.setVariableBounds", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_xl); __Pyx_XDECREF((PyObject *)__pyx_v_xu); __Pyx_XDECREF(__pyx_v_ol); __Pyx_XDECREF(__pyx_v_ou); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":513 * CHKERR( TaoSetVariableBoundsRoutine(self.tao, TAO_VarBounds, context) ) * * def setConstraints(self, constraints: TAOConstraintsFunction, Vec C=None, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: # <<<<<<<<<<<<<< * """Set the callback to compute constraints. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_47setConstraints(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_46setConstraints, "TAO.setConstraints(self, constraints: TAOConstraintsFunction, C: Vec | None = None, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nSet the callback to compute constraints.\n\n Logically collective.\n\n Parameters\n ----------\n constraints\n The callback.\n C\n The vector to hold the constraints.\n args\n Positional arguments for the callback.\n kargs\n Keyword arguments for the callback.\n\n See Also\n --------\n petsc.TaoSetConstraintsRoutine\n\n \nSource code at petsc4py/PETSc/TAO.pyx:513"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_47setConstraints(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_constraints = 0; struct PyPetscVecObject *__pyx_v_C = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setConstraints (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_constraints,&__pyx_n_s_C,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscVecObject *)Py_None)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_constraints)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 513, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_C); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 513, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 513, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 513, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setConstraints") < 0)) __PYX_ERR(52, 513, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_constraints = values[0]; __pyx_v_C = ((struct PyPetscVecObject *)values[1]); __pyx_v_args = values[2]; __pyx_v_kargs = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setConstraints", 0, 1, 4, __pyx_nargs); __PYX_ERR(52, 513, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TAO.setConstraints", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_C), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "C", 0))) __PYX_ERR(52, 513, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_46setConstraints(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_constraints, __pyx_v_C, __pyx_v_args, __pyx_v_kargs); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_46setConstraints(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_constraints, struct PyPetscVecObject *__pyx_v_C, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { Vec __pyx_v_Cvec; PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; Vec __pyx_t_2; PyObject *__pyx_t_3 = NULL; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setConstraints", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/TAO.pyx":534 * * """ * cdef PetscVec Cvec = NULL # <<<<<<<<<<<<<< * if C is not None: Cvec = C.vec * if args is None: args = () */ __pyx_v_Cvec = NULL; /* "petsc4py/PETSc/TAO.pyx":535 * """ * cdef PetscVec Cvec = NULL * if C is not None: Cvec = C.vec # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = (((PyObject *)__pyx_v_C) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_C->vec; __pyx_v_Cvec = __pyx_t_2; } /* "petsc4py/PETSc/TAO.pyx":536 * cdef PetscVec Cvec = NULL * if C is not None: Cvec = C.vec * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (constraints, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/TAO.pyx":537 * if C is not None: Cvec = C.vec * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (constraints, args, kargs) * self.set_attr("__constraints__", context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); if (__pyx_t_1) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "petsc4py/PETSc/TAO.pyx":538 * if args is None: args = () * if kargs is None: kargs = {} * context = (constraints, args, kargs) # <<<<<<<<<<<<<< * self.set_attr("__constraints__", context) * CHKERR( TaoSetConstraintsRoutine(self.tao, Cvec, TAO_Constraints, context) ) */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_constraints); __Pyx_GIVEREF(__pyx_v_constraints); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_constraints)) __PYX_ERR(52, 538, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args)) __PYX_ERR(52, 538, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs)) __PYX_ERR(52, 538, __pyx_L1_error); __pyx_v_context = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/TAO.pyx":539 * if kargs is None: kargs = {} * context = (constraints, args, kargs) * self.set_attr("__constraints__", context) # <<<<<<<<<<<<<< * CHKERR( TaoSetConstraintsRoutine(self.tao, Cvec, TAO_Constraints, context) ) * */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__constraints__"), __pyx_v_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/TAO.pyx":540 * context = (constraints, args, kargs) * self.set_attr("__constraints__", context) * CHKERR( TaoSetConstraintsRoutine(self.tao, Cvec, TAO_Constraints, context) ) # <<<<<<<<<<<<<< * * def setHessian(self, hessian: TAOHessianFunction, Mat H=None, Mat P=None, */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSetConstraintsRoutine(__pyx_v_self->tao, __pyx_v_Cvec, __pyx_f_8petsc4py_5PETSc_TAO_Constraints, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 540, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":513 * CHKERR( TaoSetVariableBoundsRoutine(self.tao, TAO_VarBounds, context) ) * * def setConstraints(self, constraints: TAOConstraintsFunction, Vec C=None, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: # <<<<<<<<<<<<<< * """Set the callback to compute constraints. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TAO.setConstraints", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":542 * CHKERR( TaoSetConstraintsRoutine(self.tao, Cvec, TAO_Constraints, context) ) * * def setHessian(self, hessian: TAOHessianFunction, Mat H=None, Mat P=None, # <<<<<<<<<<<<<< * args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: * """Set the callback to compute the Hessian matrix. */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_49setHessian(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_48setHessian, "TAO.setHessian(self, hessian: TAOHessianFunction, H: Mat | None = None, P: Mat | None = None, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nSet the callback to compute the Hessian matrix.\n\n Logically collective.\n\n Parameters\n ----------\n hessian\n The Hessian callback.\n H\n The matrix to store the Hessian.\n P\n The matrix to construct the preconditioner.\n args\n Positional arguments for the callback.\n kargs\n Keyword arguments for the callback.\n\n See Also\n --------\n getHessian, setObjective, setObjectiveGradient, setGradient\n petsc.TaoSetHessian\n\n \nSource code at petsc4py/PETSc/TAO.pyx:542"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_49setHessian(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_hessian = 0; struct PyPetscMatObject *__pyx_v_H = 0; struct PyPetscMatObject *__pyx_v_P = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setHessian (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_hessian,&__pyx_n_s_H,&__pyx_n_s_P,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscMatObject *)Py_None)); values[2] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscMatObject *)Py_None)); /* "petsc4py/PETSc/TAO.pyx":543 * * def setHessian(self, hessian: TAOHessianFunction, Mat H=None, Mat P=None, * args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: # <<<<<<<<<<<<<< * """Set the callback to compute the Hessian matrix. * */ values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_hessian)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 542, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_H); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 542, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_P); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 542, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 542, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 542, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setHessian") < 0)) __PYX_ERR(52, 542, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_hessian = values[0]; __pyx_v_H = ((struct PyPetscMatObject *)values[1]); __pyx_v_P = ((struct PyPetscMatObject *)values[2]); __pyx_v_args = values[3]; __pyx_v_kargs = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setHessian", 0, 1, 5, __pyx_nargs); __PYX_ERR(52, 542, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TAO.setHessian", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_H), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "H", 0))) __PYX_ERR(52, 542, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_P), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "P", 0))) __PYX_ERR(52, 542, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_48setHessian(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_hessian, __pyx_v_H, __pyx_v_P, __pyx_v_args, __pyx_v_kargs); /* "petsc4py/PETSc/TAO.pyx":542 * CHKERR( TaoSetConstraintsRoutine(self.tao, Cvec, TAO_Constraints, context) ) * * def setHessian(self, hessian: TAOHessianFunction, Mat H=None, Mat P=None, # <<<<<<<<<<<<<< * args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: * """Set the callback to compute the Hessian matrix. */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_48setHessian(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_hessian, struct PyPetscMatObject *__pyx_v_H, struct PyPetscMatObject *__pyx_v_P, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { Mat __pyx_v_Hmat; Mat __pyx_v_Pmat; PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; Mat __pyx_t_2; PyObject *__pyx_t_3 = NULL; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setHessian", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/TAO.pyx":567 * * """ * cdef PetscMat Hmat = NULL # <<<<<<<<<<<<<< * if H is not None: Hmat = H.mat * cdef PetscMat Pmat = Hmat */ __pyx_v_Hmat = NULL; /* "petsc4py/PETSc/TAO.pyx":568 * """ * cdef PetscMat Hmat = NULL * if H is not None: Hmat = H.mat # <<<<<<<<<<<<<< * cdef PetscMat Pmat = Hmat * if P is not None: Pmat = P.mat */ __pyx_t_1 = (((PyObject *)__pyx_v_H) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_H->mat; __pyx_v_Hmat = __pyx_t_2; } /* "petsc4py/PETSc/TAO.pyx":569 * cdef PetscMat Hmat = NULL * if H is not None: Hmat = H.mat * cdef PetscMat Pmat = Hmat # <<<<<<<<<<<<<< * if P is not None: Pmat = P.mat * if args is None: args = () */ __pyx_v_Pmat = __pyx_v_Hmat; /* "petsc4py/PETSc/TAO.pyx":570 * if H is not None: Hmat = H.mat * cdef PetscMat Pmat = Hmat * if P is not None: Pmat = P.mat # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = (((PyObject *)__pyx_v_P) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_P->mat; __pyx_v_Pmat = __pyx_t_2; } /* "petsc4py/PETSc/TAO.pyx":571 * cdef PetscMat Pmat = Hmat * if P is not None: Pmat = P.mat * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (hessian, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/TAO.pyx":572 * if P is not None: Pmat = P.mat * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (hessian, args, kargs) * self.set_attr("__hessian__", context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); if (__pyx_t_1) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "petsc4py/PETSc/TAO.pyx":573 * if args is None: args = () * if kargs is None: kargs = {} * context = (hessian, args, kargs) # <<<<<<<<<<<<<< * self.set_attr("__hessian__", context) * CHKERR( TaoSetHessian(self.tao, Hmat, Pmat, TAO_Hessian, context) ) */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 573, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_hessian); __Pyx_GIVEREF(__pyx_v_hessian); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_hessian)) __PYX_ERR(52, 573, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args)) __PYX_ERR(52, 573, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs)) __PYX_ERR(52, 573, __pyx_L1_error); __pyx_v_context = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/TAO.pyx":574 * if kargs is None: kargs = {} * context = (hessian, args, kargs) * self.set_attr("__hessian__", context) # <<<<<<<<<<<<<< * CHKERR( TaoSetHessian(self.tao, Hmat, Pmat, TAO_Hessian, context) ) * */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__hessian__"), __pyx_v_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 574, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/TAO.pyx":575 * context = (hessian, args, kargs) * self.set_attr("__hessian__", context) * CHKERR( TaoSetHessian(self.tao, Hmat, Pmat, TAO_Hessian, context) ) # <<<<<<<<<<<<<< * * def getHessian(self) -> tuple[Mat, Mat, TAOHessianFunction]: */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSetHessian(__pyx_v_self->tao, __pyx_v_Hmat, __pyx_v_Pmat, __pyx_f_8petsc4py_5PETSc_TAO_Hessian, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 575, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":542 * CHKERR( TaoSetConstraintsRoutine(self.tao, Cvec, TAO_Constraints, context) ) * * def setHessian(self, hessian: TAOHessianFunction, Mat H=None, Mat P=None, # <<<<<<<<<<<<<< * args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: * """Set the callback to compute the Hessian matrix. */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TAO.setHessian", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":577 * CHKERR( TaoSetHessian(self.tao, Hmat, Pmat, TAO_Hessian, context) ) * * def getHessian(self) -> tuple[Mat, Mat, TAOHessianFunction]: # <<<<<<<<<<<<<< * """Return the matrices used to store the Hessian and the evaluation callback. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_51getHessian(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_50getHessian, "TAO.getHessian(self) -> tuple[Mat, Mat, TAOHessianFunction]\nReturn the matrices used to store the Hessian and the evaluation callback.\n\n Not collective.\n\n See Also\n --------\n setHessian, petsc.TaoGetHessian\n\n \nSource code at petsc4py/PETSc/TAO.pyx:577"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_51getHessian(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getHessian (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getHessian", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getHessian", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_50getHessian(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_50getHessian(struct PyPetscTAOObject *__pyx_v_self) { struct PyPetscMatObject *__pyx_v_J = 0; struct PyPetscMatObject *__pyx_v_P = 0; PyObject *__pyx_v_hessian = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getHessian", 1); /* "petsc4py/PETSc/TAO.pyx":587 * * """ * cdef Mat J = Mat() # <<<<<<<<<<<<<< * cdef Mat P = Mat() * CHKERR( TaoGetHessian(self.tao, &J.mat, &P.mat, NULL, NULL) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 587, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_J = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/TAO.pyx":588 * """ * cdef Mat J = Mat() * cdef Mat P = Mat() # <<<<<<<<<<<<<< * CHKERR( TaoGetHessian(self.tao, &J.mat, &P.mat, NULL, NULL) ) * CHKERR( PetscINCREF(J.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 588, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_P = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/TAO.pyx":589 * cdef Mat J = Mat() * cdef Mat P = Mat() * CHKERR( TaoGetHessian(self.tao, &J.mat, &P.mat, NULL, NULL) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(J.obj) ) * CHKERR( PetscINCREF(P.obj) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoGetHessian(__pyx_v_self->tao, (&__pyx_v_J->mat), (&__pyx_v_P->mat), NULL, NULL)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 589, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":590 * cdef Mat P = Mat() * CHKERR( TaoGetHessian(self.tao, &J.mat, &P.mat, NULL, NULL) ) * CHKERR( PetscINCREF(J.obj) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(P.obj) ) * cdef object hessian = self.get_attr("__hessian__") */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_J->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 590, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":591 * CHKERR( TaoGetHessian(self.tao, &J.mat, &P.mat, NULL, NULL) ) * CHKERR( PetscINCREF(J.obj) ) * CHKERR( PetscINCREF(P.obj) ) # <<<<<<<<<<<<<< * cdef object hessian = self.get_attr("__hessian__") * return (J, P, hessian) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_P->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 591, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":592 * CHKERR( PetscINCREF(J.obj) ) * CHKERR( PetscINCREF(P.obj) ) * cdef object hessian = self.get_attr("__hessian__") # <<<<<<<<<<<<<< * return (J, P, hessian) * */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__hessian__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_hessian = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/TAO.pyx":593 * CHKERR( PetscINCREF(P.obj) ) * cdef object hessian = self.get_attr("__hessian__") * return (J, P, hessian) # <<<<<<<<<<<<<< * * def setJacobian(self, jacobian: TAOJacobianFunction, Mat J=None, Mat P=None, */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF((PyObject *)__pyx_v_J); __Pyx_GIVEREF((PyObject *)__pyx_v_J); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_J))) __PYX_ERR(52, 593, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_P); __Pyx_GIVEREF((PyObject *)__pyx_v_P); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_P))) __PYX_ERR(52, 593, __pyx_L1_error); __Pyx_INCREF(__pyx_v_hessian); __Pyx_GIVEREF(__pyx_v_hessian); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_hessian)) __PYX_ERR(52, 593, __pyx_L1_error); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TAO.pyx":577 * CHKERR( TaoSetHessian(self.tao, Hmat, Pmat, TAO_Hessian, context) ) * * def getHessian(self) -> tuple[Mat, Mat, TAOHessianFunction]: # <<<<<<<<<<<<<< * """Return the matrices used to store the Hessian and the evaluation callback. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TAO.getHessian", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_J); __Pyx_XDECREF((PyObject *)__pyx_v_P); __Pyx_XDECREF(__pyx_v_hessian); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":595 * return (J, P, hessian) * * def setJacobian(self, jacobian: TAOJacobianFunction, Mat J=None, Mat P=None, # <<<<<<<<<<<<<< * args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: * """Set the callback to compute the Jacobian. */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_53setJacobian(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_52setJacobian, "TAO.setJacobian(self, jacobian: TAOJacobianFunction, J: Mat | None = None, P: Mat | None = None, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nSet the callback to compute the Jacobian.\n\n Logically collective.\n\n Parameters\n ----------\n jacobian\n The Jacobian callback.\n J\n The matrix to store the Jacobian.\n P\n The matrix to construct the preconditioner.\n args\n Positional arguments for the callback.\n kargs\n Keyword arguments for the callback.\n\n See Also\n --------\n petsc.TaoSetJacobianRoutine\n\n \nSource code at petsc4py/PETSc/TAO.pyx:595"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_53setJacobian(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_jacobian = 0; struct PyPetscMatObject *__pyx_v_J = 0; struct PyPetscMatObject *__pyx_v_P = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setJacobian (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_jacobian,&__pyx_n_s_J,&__pyx_n_s_P,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscMatObject *)Py_None)); values[2] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscMatObject *)Py_None)); /* "petsc4py/PETSc/TAO.pyx":596 * * def setJacobian(self, jacobian: TAOJacobianFunction, Mat J=None, Mat P=None, * args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: # <<<<<<<<<<<<<< * """Set the callback to compute the Jacobian. * */ values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_jacobian)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 595, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_J); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 595, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_P); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 595, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 595, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 595, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setJacobian") < 0)) __PYX_ERR(52, 595, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_jacobian = values[0]; __pyx_v_J = ((struct PyPetscMatObject *)values[1]); __pyx_v_P = ((struct PyPetscMatObject *)values[2]); __pyx_v_args = values[3]; __pyx_v_kargs = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setJacobian", 0, 1, 5, __pyx_nargs); __PYX_ERR(52, 595, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TAO.setJacobian", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_J), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "J", 0))) __PYX_ERR(52, 595, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_P), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "P", 0))) __PYX_ERR(52, 595, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_52setJacobian(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_jacobian, __pyx_v_J, __pyx_v_P, __pyx_v_args, __pyx_v_kargs); /* "petsc4py/PETSc/TAO.pyx":595 * return (J, P, hessian) * * def setJacobian(self, jacobian: TAOJacobianFunction, Mat J=None, Mat P=None, # <<<<<<<<<<<<<< * args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: * """Set the callback to compute the Jacobian. */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_52setJacobian(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_jacobian, struct PyPetscMatObject *__pyx_v_J, struct PyPetscMatObject *__pyx_v_P, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { Mat __pyx_v_Jmat; Mat __pyx_v_Pmat; PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; Mat __pyx_t_2; PyObject *__pyx_t_3 = NULL; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setJacobian", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/TAO.pyx":619 * * """ * cdef PetscMat Jmat = NULL # <<<<<<<<<<<<<< * if J is not None: Jmat = J.mat * cdef PetscMat Pmat = Jmat */ __pyx_v_Jmat = NULL; /* "petsc4py/PETSc/TAO.pyx":620 * """ * cdef PetscMat Jmat = NULL * if J is not None: Jmat = J.mat # <<<<<<<<<<<<<< * cdef PetscMat Pmat = Jmat * if P is not None: Pmat = P.mat */ __pyx_t_1 = (((PyObject *)__pyx_v_J) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_J->mat; __pyx_v_Jmat = __pyx_t_2; } /* "petsc4py/PETSc/TAO.pyx":621 * cdef PetscMat Jmat = NULL * if J is not None: Jmat = J.mat * cdef PetscMat Pmat = Jmat # <<<<<<<<<<<<<< * if P is not None: Pmat = P.mat * if args is None: args = () */ __pyx_v_Pmat = __pyx_v_Jmat; /* "petsc4py/PETSc/TAO.pyx":622 * if J is not None: Jmat = J.mat * cdef PetscMat Pmat = Jmat * if P is not None: Pmat = P.mat # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = (((PyObject *)__pyx_v_P) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_P->mat; __pyx_v_Pmat = __pyx_t_2; } /* "petsc4py/PETSc/TAO.pyx":623 * cdef PetscMat Pmat = Jmat * if P is not None: Pmat = P.mat * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (jacobian, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/TAO.pyx":624 * if P is not None: Pmat = P.mat * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (jacobian, args, kargs) * self.set_attr("__jacobian__", context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); if (__pyx_t_1) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 624, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "petsc4py/PETSc/TAO.pyx":625 * if args is None: args = () * if kargs is None: kargs = {} * context = (jacobian, args, kargs) # <<<<<<<<<<<<<< * self.set_attr("__jacobian__", context) * CHKERR( TaoSetJacobianRoutine(self.tao, Jmat, Pmat, TAO_Jacobian, context) ) */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 625, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_jacobian); __Pyx_GIVEREF(__pyx_v_jacobian); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_jacobian)) __PYX_ERR(52, 625, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args)) __PYX_ERR(52, 625, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs)) __PYX_ERR(52, 625, __pyx_L1_error); __pyx_v_context = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/TAO.pyx":626 * if kargs is None: kargs = {} * context = (jacobian, args, kargs) * self.set_attr("__jacobian__", context) # <<<<<<<<<<<<<< * CHKERR( TaoSetJacobianRoutine(self.tao, Jmat, Pmat, TAO_Jacobian, context) ) * */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__jacobian__"), __pyx_v_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 626, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/TAO.pyx":627 * context = (jacobian, args, kargs) * self.set_attr("__jacobian__", context) * CHKERR( TaoSetJacobianRoutine(self.tao, Jmat, Pmat, TAO_Jacobian, context) ) # <<<<<<<<<<<<<< * * def setStateDesignIS(self, IS state=None, IS design=None) -> None: */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSetJacobianRoutine(__pyx_v_self->tao, __pyx_v_Jmat, __pyx_v_Pmat, __pyx_f_8petsc4py_5PETSc_TAO_Jacobian, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 627, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":595 * return (J, P, hessian) * * def setJacobian(self, jacobian: TAOJacobianFunction, Mat J=None, Mat P=None, # <<<<<<<<<<<<<< * args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: * """Set the callback to compute the Jacobian. */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TAO.setJacobian", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":629 * CHKERR( TaoSetJacobianRoutine(self.tao, Jmat, Pmat, TAO_Jacobian, context) ) * * def setStateDesignIS(self, IS state=None, IS design=None) -> None: # <<<<<<<<<<<<<< * """Set the index sets indicating state and design variables. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_55setStateDesignIS(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_54setStateDesignIS, "TAO.setStateDesignIS(self, state: IS | None = None, design: IS | None = None) -> None\nSet the index sets indicating state and design variables.\n\n Collective.\n\n See Also\n --------\n petsc.TaoSetStateDesignIS\n\n \nSource code at petsc4py/PETSc/TAO.pyx:629"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_55setStateDesignIS(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscISObject *__pyx_v_state = 0; struct PyPetscISObject *__pyx_v_design = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setStateDesignIS (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_state,&__pyx_n_s_design,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscISObject *)Py_None)); values[1] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscISObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_state); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 629, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_design); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 629, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setStateDesignIS") < 0)) __PYX_ERR(52, 629, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_state = ((struct PyPetscISObject *)values[0]); __pyx_v_design = ((struct PyPetscISObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setStateDesignIS", 0, 0, 2, __pyx_nargs); __PYX_ERR(52, 629, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TAO.setStateDesignIS", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_state), __pyx_ptype_8petsc4py_5PETSc_IS, 1, "state", 0))) __PYX_ERR(52, 629, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_design), __pyx_ptype_8petsc4py_5PETSc_IS, 1, "design", 0))) __PYX_ERR(52, 629, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_54setStateDesignIS(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_state, __pyx_v_design); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_54setStateDesignIS(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_state, struct PyPetscISObject *__pyx_v_design) { IS __pyx_v_s_is; IS __pyx_v_d_is; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; IS __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setStateDesignIS", 1); /* "petsc4py/PETSc/TAO.pyx":639 * * """ * cdef PetscIS s_is = NULL, d_is = NULL # <<<<<<<<<<<<<< * if state is not None: s_is = state.iset * if design is not None: d_is = design.iset */ __pyx_v_s_is = NULL; __pyx_v_d_is = NULL; /* "petsc4py/PETSc/TAO.pyx":640 * """ * cdef PetscIS s_is = NULL, d_is = NULL * if state is not None: s_is = state.iset # <<<<<<<<<<<<<< * if design is not None: d_is = design.iset * CHKERR( TaoSetStateDesignIS(self.tao, s_is, d_is) ) */ __pyx_t_1 = (((PyObject *)__pyx_v_state) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_state->iset; __pyx_v_s_is = __pyx_t_2; } /* "petsc4py/PETSc/TAO.pyx":641 * cdef PetscIS s_is = NULL, d_is = NULL * if state is not None: s_is = state.iset * if design is not None: d_is = design.iset # <<<<<<<<<<<<<< * CHKERR( TaoSetStateDesignIS(self.tao, s_is, d_is) ) * */ __pyx_t_1 = (((PyObject *)__pyx_v_design) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_design->iset; __pyx_v_d_is = __pyx_t_2; } /* "petsc4py/PETSc/TAO.pyx":642 * if state is not None: s_is = state.iset * if design is not None: d_is = design.iset * CHKERR( TaoSetStateDesignIS(self.tao, s_is, d_is) ) # <<<<<<<<<<<<<< * * def setJacobianState(self, jacobian_state, Mat J=None, Mat P=None, Mat I=None, */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSetStateDesignIS(__pyx_v_self->tao, __pyx_v_s_is, __pyx_v_d_is)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 642, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":629 * CHKERR( TaoSetJacobianRoutine(self.tao, Jmat, Pmat, TAO_Jacobian, context) ) * * def setStateDesignIS(self, IS state=None, IS design=None) -> None: # <<<<<<<<<<<<<< * """Set the index sets indicating state and design variables. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.setStateDesignIS", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":644 * CHKERR( TaoSetStateDesignIS(self.tao, s_is, d_is) ) * * def setJacobianState(self, jacobian_state, Mat J=None, Mat P=None, Mat I=None, # <<<<<<<<<<<<<< * args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: * """Set Jacobian state callback. */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_57setJacobianState(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_56setJacobianState, "TAO.setJacobianState(self, jacobian_state, J: Mat | None = None, P: Mat | None = None, I: Mat | None = None, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nSet Jacobian state callback.\n\n Logically collective.\n\n See Also\n --------\n petsc.TaoSetJacobianStateRoutine\n\n \nSource code at petsc4py/PETSc/TAO.pyx:644"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_57setJacobianState(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_jacobian_state = 0; struct PyPetscMatObject *__pyx_v_J = 0; struct PyPetscMatObject *__pyx_v_P = 0; struct PyPetscMatObject *__pyx_v_I = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[6] = {0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setJacobianState (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_jacobian_state,&__pyx_n_s_J,&__pyx_n_s_P,&__pyx_n_s_I,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscMatObject *)Py_None)); values[2] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscMatObject *)Py_None)); values[3] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscMatObject *)Py_None)); /* "petsc4py/PETSc/TAO.pyx":645 * * def setJacobianState(self, jacobian_state, Mat J=None, Mat P=None, Mat I=None, * args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: # <<<<<<<<<<<<<< * """Set Jacobian state callback. * */ values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_jacobian_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 644, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_J); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 644, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_P); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 644, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_I); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 644, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 644, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 644, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setJacobianState") < 0)) __PYX_ERR(52, 644, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_jacobian_state = values[0]; __pyx_v_J = ((struct PyPetscMatObject *)values[1]); __pyx_v_P = ((struct PyPetscMatObject *)values[2]); __pyx_v_I = ((struct PyPetscMatObject *)values[3]); __pyx_v_args = values[4]; __pyx_v_kargs = values[5]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setJacobianState", 0, 1, 6, __pyx_nargs); __PYX_ERR(52, 644, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TAO.setJacobianState", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_J), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "J", 0))) __PYX_ERR(52, 644, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_P), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "P", 0))) __PYX_ERR(52, 644, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_I), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "I", 0))) __PYX_ERR(52, 644, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_56setJacobianState(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_jacobian_state, __pyx_v_J, __pyx_v_P, __pyx_v_I, __pyx_v_args, __pyx_v_kargs); /* "petsc4py/PETSc/TAO.pyx":644 * CHKERR( TaoSetStateDesignIS(self.tao, s_is, d_is) ) * * def setJacobianState(self, jacobian_state, Mat J=None, Mat P=None, Mat I=None, # <<<<<<<<<<<<<< * args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: * """Set Jacobian state callback. */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_56setJacobianState(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_jacobian_state, struct PyPetscMatObject *__pyx_v_J, struct PyPetscMatObject *__pyx_v_P, struct PyPetscMatObject *__pyx_v_I, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { Mat __pyx_v_Jmat; Mat __pyx_v_Pmat; Mat __pyx_v_Imat; PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; Mat __pyx_t_2; PyObject *__pyx_t_3 = NULL; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setJacobianState", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/TAO.pyx":655 * * """ * cdef PetscMat Jmat = NULL # <<<<<<<<<<<<<< * if J is not None: Jmat = J.mat * cdef PetscMat Pmat = Jmat */ __pyx_v_Jmat = NULL; /* "petsc4py/PETSc/TAO.pyx":656 * """ * cdef PetscMat Jmat = NULL * if J is not None: Jmat = J.mat # <<<<<<<<<<<<<< * cdef PetscMat Pmat = Jmat * if P is not None: Pmat = P.mat */ __pyx_t_1 = (((PyObject *)__pyx_v_J) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_J->mat; __pyx_v_Jmat = __pyx_t_2; } /* "petsc4py/PETSc/TAO.pyx":657 * cdef PetscMat Jmat = NULL * if J is not None: Jmat = J.mat * cdef PetscMat Pmat = Jmat # <<<<<<<<<<<<<< * if P is not None: Pmat = P.mat * cdef PetscMat Imat = NULL */ __pyx_v_Pmat = __pyx_v_Jmat; /* "petsc4py/PETSc/TAO.pyx":658 * if J is not None: Jmat = J.mat * cdef PetscMat Pmat = Jmat * if P is not None: Pmat = P.mat # <<<<<<<<<<<<<< * cdef PetscMat Imat = NULL * if I is not None: Imat = I.mat */ __pyx_t_1 = (((PyObject *)__pyx_v_P) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_P->mat; __pyx_v_Pmat = __pyx_t_2; } /* "petsc4py/PETSc/TAO.pyx":659 * cdef PetscMat Pmat = Jmat * if P is not None: Pmat = P.mat * cdef PetscMat Imat = NULL # <<<<<<<<<<<<<< * if I is not None: Imat = I.mat * if args is None: args = () */ __pyx_v_Imat = NULL; /* "petsc4py/PETSc/TAO.pyx":660 * if P is not None: Pmat = P.mat * cdef PetscMat Imat = NULL * if I is not None: Imat = I.mat # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = (((PyObject *)__pyx_v_I) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_I->mat; __pyx_v_Imat = __pyx_t_2; } /* "petsc4py/PETSc/TAO.pyx":661 * cdef PetscMat Imat = NULL * if I is not None: Imat = I.mat * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (jacobian_state, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/TAO.pyx":662 * if I is not None: Imat = I.mat * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (jacobian_state, args, kargs) * self.set_attr("__jacobian_state__", context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); if (__pyx_t_1) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 662, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "petsc4py/PETSc/TAO.pyx":663 * if args is None: args = () * if kargs is None: kargs = {} * context = (jacobian_state, args, kargs) # <<<<<<<<<<<<<< * self.set_attr("__jacobian_state__", context) * CHKERR( TaoSetJacobianStateRoutine(self.tao, Jmat, Pmat, Imat, */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 663, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_jacobian_state); __Pyx_GIVEREF(__pyx_v_jacobian_state); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_jacobian_state)) __PYX_ERR(52, 663, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args)) __PYX_ERR(52, 663, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs)) __PYX_ERR(52, 663, __pyx_L1_error); __pyx_v_context = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/TAO.pyx":664 * if kargs is None: kargs = {} * context = (jacobian_state, args, kargs) * self.set_attr("__jacobian_state__", context) # <<<<<<<<<<<<<< * CHKERR( TaoSetJacobianStateRoutine(self.tao, Jmat, Pmat, Imat, * TAO_JacobianState, context) ) */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__jacobian_state__"), __pyx_v_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 664, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/TAO.pyx":665 * context = (jacobian_state, args, kargs) * self.set_attr("__jacobian_state__", context) * CHKERR( TaoSetJacobianStateRoutine(self.tao, Jmat, Pmat, Imat, # <<<<<<<<<<<<<< * TAO_JacobianState, context) ) * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSetJacobianStateRoutine(__pyx_v_self->tao, __pyx_v_Jmat, __pyx_v_Pmat, __pyx_v_Imat, __pyx_f_8petsc4py_5PETSc_TAO_JacobianState, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 665, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":644 * CHKERR( TaoSetStateDesignIS(self.tao, s_is, d_is) ) * * def setJacobianState(self, jacobian_state, Mat J=None, Mat P=None, Mat I=None, # <<<<<<<<<<<<<< * args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: * """Set Jacobian state callback. */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TAO.setJacobianState", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":668 * TAO_JacobianState, context) ) * * def setJacobianDesign(self, jacobian_design, Mat J=None, # <<<<<<<<<<<<<< * args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: * """Set Jacobian design callback. */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_59setJacobianDesign(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_58setJacobianDesign, "TAO.setJacobianDesign(self, jacobian_design, J: Mat | None = None, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nSet Jacobian design callback.\n\n Logically collective.\n\n See Also\n --------\n petsc.TaoSetJacobianDesignRoutine\n\n \nSource code at petsc4py/PETSc/TAO.pyx:668"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_59setJacobianDesign(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_jacobian_design = 0; struct PyPetscMatObject *__pyx_v_J = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setJacobianDesign (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_jacobian_design,&__pyx_n_s_J,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscMatObject *)Py_None)); /* "petsc4py/PETSc/TAO.pyx":669 * * def setJacobianDesign(self, jacobian_design, Mat J=None, * args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: # <<<<<<<<<<<<<< * """Set Jacobian design callback. * */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_jacobian_design)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 668, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_J); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 668, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 668, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 668, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setJacobianDesign") < 0)) __PYX_ERR(52, 668, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_jacobian_design = values[0]; __pyx_v_J = ((struct PyPetscMatObject *)values[1]); __pyx_v_args = values[2]; __pyx_v_kargs = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setJacobianDesign", 0, 1, 4, __pyx_nargs); __PYX_ERR(52, 668, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TAO.setJacobianDesign", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_J), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "J", 0))) __PYX_ERR(52, 668, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_58setJacobianDesign(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_jacobian_design, __pyx_v_J, __pyx_v_args, __pyx_v_kargs); /* "petsc4py/PETSc/TAO.pyx":668 * TAO_JacobianState, context) ) * * def setJacobianDesign(self, jacobian_design, Mat J=None, # <<<<<<<<<<<<<< * args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: * """Set Jacobian design callback. */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_58setJacobianDesign(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_jacobian_design, struct PyPetscMatObject *__pyx_v_J, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { Mat __pyx_v_Jmat; PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; Mat __pyx_t_2; PyObject *__pyx_t_3 = NULL; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setJacobianDesign", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/TAO.pyx":679 * * """ * cdef PetscMat Jmat = NULL # <<<<<<<<<<<<<< * if J is not None: Jmat = J.mat * if args is None: args = () */ __pyx_v_Jmat = NULL; /* "petsc4py/PETSc/TAO.pyx":680 * """ * cdef PetscMat Jmat = NULL * if J is not None: Jmat = J.mat # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = (((PyObject *)__pyx_v_J) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_J->mat; __pyx_v_Jmat = __pyx_t_2; } /* "petsc4py/PETSc/TAO.pyx":681 * cdef PetscMat Jmat = NULL * if J is not None: Jmat = J.mat * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (jacobian_design, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/TAO.pyx":682 * if J is not None: Jmat = J.mat * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (jacobian_design, args, kargs) * self.set_attr("__jacobian_design__", context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); if (__pyx_t_1) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "petsc4py/PETSc/TAO.pyx":683 * if args is None: args = () * if kargs is None: kargs = {} * context = (jacobian_design, args, kargs) # <<<<<<<<<<<<<< * self.set_attr("__jacobian_design__", context) * CHKERR( TaoSetJacobianDesignRoutine(self.tao, Jmat, */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 683, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_jacobian_design); __Pyx_GIVEREF(__pyx_v_jacobian_design); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_jacobian_design)) __PYX_ERR(52, 683, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args)) __PYX_ERR(52, 683, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs)) __PYX_ERR(52, 683, __pyx_L1_error); __pyx_v_context = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/TAO.pyx":684 * if kargs is None: kargs = {} * context = (jacobian_design, args, kargs) * self.set_attr("__jacobian_design__", context) # <<<<<<<<<<<<<< * CHKERR( TaoSetJacobianDesignRoutine(self.tao, Jmat, * TAO_JacobianDesign, context) ) */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__jacobian_design__"), __pyx_v_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/TAO.pyx":685 * context = (jacobian_design, args, kargs) * self.set_attr("__jacobian_design__", context) * CHKERR( TaoSetJacobianDesignRoutine(self.tao, Jmat, # <<<<<<<<<<<<<< * TAO_JacobianDesign, context) ) * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSetJacobianDesignRoutine(__pyx_v_self->tao, __pyx_v_Jmat, __pyx_f_8petsc4py_5PETSc_TAO_JacobianDesign, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 685, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":668 * TAO_JacobianState, context) ) * * def setJacobianDesign(self, jacobian_design, Mat J=None, # <<<<<<<<<<<<<< * args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: * """Set Jacobian design callback. */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TAO.setJacobianDesign", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":688 * TAO_JacobianDesign, context) ) * * def setEqualityConstraints(self, equality_constraints, Vec c, # <<<<<<<<<<<<<< * args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: * """Set equality constraints callback. */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_61setEqualityConstraints(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_60setEqualityConstraints, "TAO.setEqualityConstraints(self, equality_constraints, c: Vec, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nSet equality constraints callback.\n\n Logically collective.\n\n See Also\n --------\n petsc.TaoSetEqualityConstraintsRoutine\n\n \nSource code at petsc4py/PETSc/TAO.pyx:688"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_61setEqualityConstraints(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_equality_constraints = 0; struct PyPetscVecObject *__pyx_v_c = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setEqualityConstraints (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_equality_constraints,&__pyx_n_s_c,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; /* "petsc4py/PETSc/TAO.pyx":689 * * def setEqualityConstraints(self, equality_constraints, Vec c, * args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: # <<<<<<<<<<<<<< * """Set equality constraints callback. * */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_equality_constraints)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 688, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_c)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 688, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setEqualityConstraints", 0, 2, 4, 1); __PYX_ERR(52, 688, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 688, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 688, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setEqualityConstraints") < 0)) __PYX_ERR(52, 688, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_equality_constraints = values[0]; __pyx_v_c = ((struct PyPetscVecObject *)values[1]); __pyx_v_args = values[2]; __pyx_v_kargs = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setEqualityConstraints", 0, 2, 4, __pyx_nargs); __PYX_ERR(52, 688, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TAO.setEqualityConstraints", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_c), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "c", 0))) __PYX_ERR(52, 688, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_60setEqualityConstraints(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_equality_constraints, __pyx_v_c, __pyx_v_args, __pyx_v_kargs); /* "petsc4py/PETSc/TAO.pyx":688 * TAO_JacobianDesign, context) ) * * def setEqualityConstraints(self, equality_constraints, Vec c, # <<<<<<<<<<<<<< * args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: * """Set equality constraints callback. */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_60setEqualityConstraints(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_equality_constraints, struct PyPetscVecObject *__pyx_v_c, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setEqualityConstraints", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/TAO.pyx":699 * * """ * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (equality_constraints, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/TAO.pyx":700 * """ * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (equality_constraints, args, kargs) * self.set_attr("__equality_constraints__", context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); if (__pyx_t_1) { __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 700, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_2); __pyx_t_2 = 0; } /* "petsc4py/PETSc/TAO.pyx":701 * if args is None: args = () * if kargs is None: kargs = {} * context = (equality_constraints, args, kargs) # <<<<<<<<<<<<<< * self.set_attr("__equality_constraints__", context) * CHKERR( TaoSetEqualityConstraintsRoutine(self.tao, c.vec, */ __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 701, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_equality_constraints); __Pyx_GIVEREF(__pyx_v_equality_constraints); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_equality_constraints)) __PYX_ERR(52, 701, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_args)) __PYX_ERR(52, 701, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_kargs)) __PYX_ERR(52, 701, __pyx_L1_error); __pyx_v_context = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/TAO.pyx":702 * if kargs is None: kargs = {} * context = (equality_constraints, args, kargs) * self.set_attr("__equality_constraints__", context) # <<<<<<<<<<<<<< * CHKERR( TaoSetEqualityConstraintsRoutine(self.tao, c.vec, * TAO_EqualityConstraints, context) ) */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__equality_constraints__"), __pyx_v_context); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 702, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/TAO.pyx":703 * context = (equality_constraints, args, kargs) * self.set_attr("__equality_constraints__", context) * CHKERR( TaoSetEqualityConstraintsRoutine(self.tao, c.vec, # <<<<<<<<<<<<<< * TAO_EqualityConstraints, context) ) * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSetEqualityConstraintsRoutine(__pyx_v_self->tao, __pyx_v_c->vec, __pyx_f_8petsc4py_5PETSc_TAO_EqualityConstraints, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 703, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":688 * TAO_JacobianDesign, context) ) * * def setEqualityConstraints(self, equality_constraints, Vec c, # <<<<<<<<<<<<<< * args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: * """Set equality constraints callback. */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TAO.setEqualityConstraints", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":706 * TAO_EqualityConstraints, context) ) * * def setJacobianEquality(self, jacobian_equality, Mat J=None, Mat P=None, # <<<<<<<<<<<<<< * args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: * """Set Jacobian equality constraints callback. */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_63setJacobianEquality(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_62setJacobianEquality, "TAO.setJacobianEquality(self, jacobian_equality, J: Mat | None = None, P: Mat | None = None, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nSet Jacobian equality constraints callback.\n\n Logically collective.\n\n See Also\n --------\n petsc.TaoSetJacobianEqualityRoutine\n\n \nSource code at petsc4py/PETSc/TAO.pyx:706"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_63setJacobianEquality(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_jacobian_equality = 0; struct PyPetscMatObject *__pyx_v_J = 0; struct PyPetscMatObject *__pyx_v_P = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setJacobianEquality (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_jacobian_equality,&__pyx_n_s_J,&__pyx_n_s_P,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscMatObject *)Py_None)); values[2] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscMatObject *)Py_None)); /* "petsc4py/PETSc/TAO.pyx":707 * * def setJacobianEquality(self, jacobian_equality, Mat J=None, Mat P=None, * args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: # <<<<<<<<<<<<<< * """Set Jacobian equality constraints callback. * */ values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_jacobian_equality)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 706, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_J); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 706, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_P); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 706, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 706, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 706, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setJacobianEquality") < 0)) __PYX_ERR(52, 706, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_jacobian_equality = values[0]; __pyx_v_J = ((struct PyPetscMatObject *)values[1]); __pyx_v_P = ((struct PyPetscMatObject *)values[2]); __pyx_v_args = values[3]; __pyx_v_kargs = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setJacobianEquality", 0, 1, 5, __pyx_nargs); __PYX_ERR(52, 706, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TAO.setJacobianEquality", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_J), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "J", 0))) __PYX_ERR(52, 706, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_P), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "P", 0))) __PYX_ERR(52, 706, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_62setJacobianEquality(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_jacobian_equality, __pyx_v_J, __pyx_v_P, __pyx_v_args, __pyx_v_kargs); /* "petsc4py/PETSc/TAO.pyx":706 * TAO_EqualityConstraints, context) ) * * def setJacobianEquality(self, jacobian_equality, Mat J=None, Mat P=None, # <<<<<<<<<<<<<< * args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: * """Set Jacobian equality constraints callback. */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_62setJacobianEquality(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_jacobian_equality, struct PyPetscMatObject *__pyx_v_J, struct PyPetscMatObject *__pyx_v_P, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { Mat __pyx_v_Jmat; Mat __pyx_v_Pmat; PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; Mat __pyx_t_2; PyObject *__pyx_t_3 = NULL; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setJacobianEquality", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/TAO.pyx":717 * * """ * cdef PetscMat Jmat = NULL # <<<<<<<<<<<<<< * if J is not None: Jmat = J.mat * cdef PetscMat Pmat = Jmat */ __pyx_v_Jmat = NULL; /* "petsc4py/PETSc/TAO.pyx":718 * """ * cdef PetscMat Jmat = NULL * if J is not None: Jmat = J.mat # <<<<<<<<<<<<<< * cdef PetscMat Pmat = Jmat * if P is not None: Pmat = P.mat */ __pyx_t_1 = (((PyObject *)__pyx_v_J) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_J->mat; __pyx_v_Jmat = __pyx_t_2; } /* "petsc4py/PETSc/TAO.pyx":719 * cdef PetscMat Jmat = NULL * if J is not None: Jmat = J.mat * cdef PetscMat Pmat = Jmat # <<<<<<<<<<<<<< * if P is not None: Pmat = P.mat * if args is None: args = () */ __pyx_v_Pmat = __pyx_v_Jmat; /* "petsc4py/PETSc/TAO.pyx":720 * if J is not None: Jmat = J.mat * cdef PetscMat Pmat = Jmat * if P is not None: Pmat = P.mat # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = (((PyObject *)__pyx_v_P) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_P->mat; __pyx_v_Pmat = __pyx_t_2; } /* "petsc4py/PETSc/TAO.pyx":721 * cdef PetscMat Pmat = Jmat * if P is not None: Pmat = P.mat * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (jacobian_equality, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/TAO.pyx":722 * if P is not None: Pmat = P.mat * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (jacobian_equality, args, kargs) * self.set_attr("__jacobian_equality__", context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); if (__pyx_t_1) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 722, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "petsc4py/PETSc/TAO.pyx":723 * if args is None: args = () * if kargs is None: kargs = {} * context = (jacobian_equality, args, kargs) # <<<<<<<<<<<<<< * self.set_attr("__jacobian_equality__", context) * CHKERR( TaoSetJacobianEqualityRoutine(self.tao, Jmat, Pmat, */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 723, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_jacobian_equality); __Pyx_GIVEREF(__pyx_v_jacobian_equality); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_jacobian_equality)) __PYX_ERR(52, 723, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args)) __PYX_ERR(52, 723, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs)) __PYX_ERR(52, 723, __pyx_L1_error); __pyx_v_context = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/TAO.pyx":724 * if kargs is None: kargs = {} * context = (jacobian_equality, args, kargs) * self.set_attr("__jacobian_equality__", context) # <<<<<<<<<<<<<< * CHKERR( TaoSetJacobianEqualityRoutine(self.tao, Jmat, Pmat, * TAO_JacobianEquality, context) ) */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__jacobian_equality__"), __pyx_v_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 724, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/TAO.pyx":725 * context = (jacobian_equality, args, kargs) * self.set_attr("__jacobian_equality__", context) * CHKERR( TaoSetJacobianEqualityRoutine(self.tao, Jmat, Pmat, # <<<<<<<<<<<<<< * TAO_JacobianEquality, context) ) * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSetJacobianEqualityRoutine(__pyx_v_self->tao, __pyx_v_Jmat, __pyx_v_Pmat, __pyx_f_8petsc4py_5PETSc_TAO_JacobianEquality, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 725, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":706 * TAO_EqualityConstraints, context) ) * * def setJacobianEquality(self, jacobian_equality, Mat J=None, Mat P=None, # <<<<<<<<<<<<<< * args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: * """Set Jacobian equality constraints callback. */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TAO.setJacobianEquality", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":728 * TAO_JacobianEquality, context) ) * * def setUpdate(self, update: TAOUpdateFunction, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: # <<<<<<<<<<<<<< * """Set the callback to compute update at each optimization step. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_65setUpdate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_64setUpdate, "TAO.setUpdate(self, update: TAOUpdateFunction, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nSet the callback to compute update at each optimization step.\n\n Logically collective.\n\n Parameters\n ----------\n update\n The update callback or `None` to reset it.\n args\n Positional arguments for the callback.\n kargs\n Keyword arguments for the callback.\n\n See Also\n --------\n getUpdate, petsc.TaoSetUpdate\n\n \nSource code at petsc4py/PETSc/TAO.pyx:728"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_65setUpdate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_update = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setUpdate (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_update,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_update)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 728, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 728, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 728, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setUpdate") < 0)) __PYX_ERR(52, 728, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_update = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setUpdate", 0, 1, 3, __pyx_nargs); __PYX_ERR(52, 728, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TAO.setUpdate", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_64setUpdate(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_update, __pyx_v_args, __pyx_v_kargs); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_64setUpdate(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_update, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setUpdate", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/TAO.pyx":747 * * """ * if update is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = (__pyx_v_update != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/TAO.pyx":748 * """ * if update is not None: * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (update, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/TAO.pyx":749 * if update is not None: * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (update, args, kargs) * self.set_attr('__update__', context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); if (__pyx_t_1) { __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 749, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_2); __pyx_t_2 = 0; } /* "petsc4py/PETSc/TAO.pyx":750 * if args is None: args = () * if kargs is None: kargs = {} * context = (update, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__update__', context) * CHKERR( TaoSetUpdate(self.tao, TAO_Update, context) ) */ __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 750, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_update); __Pyx_GIVEREF(__pyx_v_update); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_update)) __PYX_ERR(52, 750, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_args)) __PYX_ERR(52, 750, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_kargs)) __PYX_ERR(52, 750, __pyx_L1_error); __pyx_v_context = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/TAO.pyx":751 * if kargs is None: kargs = {} * context = (update, args, kargs) * self.set_attr('__update__', context) # <<<<<<<<<<<<<< * CHKERR( TaoSetUpdate(self.tao, TAO_Update, context) ) * else: */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__update__"), __pyx_v_context); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 751, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/TAO.pyx":752 * context = (update, args, kargs) * self.set_attr('__update__', context) * CHKERR( TaoSetUpdate(self.tao, TAO_Update, context) ) # <<<<<<<<<<<<<< * else: * self.set_attr('__update__', None) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSetUpdate(__pyx_v_self->tao, __pyx_f_8petsc4py_5PETSc_TAO_Update, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 752, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":747 * * """ * if update is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ goto __pyx_L3; } /* "petsc4py/PETSc/TAO.pyx":754 * CHKERR( TaoSetUpdate(self.tao, TAO_Update, context) ) * else: * self.set_attr('__update__', None) # <<<<<<<<<<<<<< * CHKERR( TaoSetUpdate(self.tao, NULL, NULL) ) * */ /*else*/ { __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__update__"), Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 754, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/TAO.pyx":755 * else: * self.set_attr('__update__', None) * CHKERR( TaoSetUpdate(self.tao, NULL, NULL) ) # <<<<<<<<<<<<<< * * def getUpdate(self) -> tuple[TAOUpdateFunction, tuple[Any,...], dict[str, Any]]: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSetUpdate(__pyx_v_self->tao, NULL, NULL)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 755, __pyx_L1_error) } __pyx_L3:; /* "petsc4py/PETSc/TAO.pyx":728 * TAO_JacobianEquality, context) ) * * def setUpdate(self, update: TAOUpdateFunction, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: # <<<<<<<<<<<<<< * """Set the callback to compute update at each optimization step. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TAO.setUpdate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":757 * CHKERR( TaoSetUpdate(self.tao, NULL, NULL) ) * * def getUpdate(self) -> tuple[TAOUpdateFunction, tuple[Any,...], dict[str, Any]]: # <<<<<<<<<<<<<< * """Return the callback to compute the update. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_67getUpdate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_66getUpdate, "TAO.getUpdate(self) -> tuple[TAOUpdateFunction, tuple[Any, ...], dict[str, Any]]\nReturn the callback to compute the update.\n\n Not collective.\n\n See Also\n --------\n setUpdate\n\n \nSource code at petsc4py/PETSc/TAO.pyx:757"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_67getUpdate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getUpdate (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getUpdate", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getUpdate", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_66getUpdate(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_66getUpdate(struct PyPetscTAOObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getUpdate", 1); /* "petsc4py/PETSc/TAO.pyx":767 * * """ * return self.get_attr('__update__') # <<<<<<<<<<<<<< * * # -------------- */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__update__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 767, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TAO.pyx":757 * CHKERR( TaoSetUpdate(self.tao, NULL, NULL) ) * * def getUpdate(self) -> tuple[TAOUpdateFunction, tuple[Any,...], dict[str, Any]]: # <<<<<<<<<<<<<< * """Return the callback to compute the update. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TAO.getUpdate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":771 * # -------------- * * def computeObjective(self, Vec x) -> float: # <<<<<<<<<<<<<< * """Compute the value of the objective function. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_69computeObjective(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_68computeObjective, "TAO.computeObjective(self, x: Vec) -> float\nCompute the value of the objective function.\n\n Collective.\n\n Parameters\n ----------\n x\n The parameter vector.\n\n See Also\n --------\n setObjective, petsc.TaoComputeObjective\n\n \nSource code at petsc4py/PETSc/TAO.pyx:771"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_69computeObjective(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_x = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("computeObjective (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 771, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "computeObjective") < 0)) __PYX_ERR(52, 771, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_x = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("computeObjective", 1, 1, 1, __pyx_nargs); __PYX_ERR(52, 771, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TAO.computeObjective", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(52, 771, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_68computeObjective(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_x); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_68computeObjective(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x) { PetscReal __pyx_v_f; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("computeObjective", 1); /* "petsc4py/PETSc/TAO.pyx":786 * * """ * cdef PetscReal f = 0 # <<<<<<<<<<<<<< * CHKERR( TaoComputeObjective(self.tao, x.vec, &f) ) * return toReal(f) */ __pyx_v_f = 0.0; /* "petsc4py/PETSc/TAO.pyx":787 * """ * cdef PetscReal f = 0 * CHKERR( TaoComputeObjective(self.tao, x.vec, &f) ) # <<<<<<<<<<<<<< * return toReal(f) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoComputeObjective(__pyx_v_self->tao, __pyx_v_x->vec, (&__pyx_v_f))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 787, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":788 * cdef PetscReal f = 0 * CHKERR( TaoComputeObjective(self.tao, x.vec, &f) ) * return toReal(f) # <<<<<<<<<<<<<< * * def computeResidual(self, Vec x, Vec f) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_f); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 788, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TAO.pyx":771 * # -------------- * * def computeObjective(self, Vec x) -> float: # <<<<<<<<<<<<<< * """Compute the value of the objective function. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TAO.computeObjective", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":790 * return toReal(f) * * def computeResidual(self, Vec x, Vec f) -> None: # <<<<<<<<<<<<<< * """Compute the residual. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_71computeResidual(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_70computeResidual, "TAO.computeResidual(self, x: Vec, f: Vec) -> None\nCompute the residual.\n\n Collective.\n\n Parameters\n ----------\n x\n The parameter vector.\n f\n The output vector.\n\n See Also\n --------\n setResidual, petsc.TaoComputeResidual\n\n \nSource code at petsc4py/PETSc/TAO.pyx:790"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_71computeResidual(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_f = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("computeResidual (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_f,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 790, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_f)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 790, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("computeResidual", 1, 2, 2, 1); __PYX_ERR(52, 790, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "computeResidual") < 0)) __PYX_ERR(52, 790, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_x = ((struct PyPetscVecObject *)values[0]); __pyx_v_f = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("computeResidual", 1, 2, 2, __pyx_nargs); __PYX_ERR(52, 790, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TAO.computeResidual", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(52, 790, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_f), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "f", 0))) __PYX_ERR(52, 790, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_70computeResidual(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_x, __pyx_v_f); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_70computeResidual(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_f) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("computeResidual", 1); /* "petsc4py/PETSc/TAO.pyx":807 * * """ * CHKERR( TaoComputeResidual(self.tao, x.vec, f.vec) ) # <<<<<<<<<<<<<< * * def computeGradient(self, Vec x, Vec g) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoComputeResidual(__pyx_v_self->tao, __pyx_v_x->vec, __pyx_v_f->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 807, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":790 * return toReal(f) * * def computeResidual(self, Vec x, Vec f) -> None: # <<<<<<<<<<<<<< * """Compute the residual. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.computeResidual", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":809 * CHKERR( TaoComputeResidual(self.tao, x.vec, f.vec) ) * * def computeGradient(self, Vec x, Vec g) -> None: # <<<<<<<<<<<<<< * """Compute the gradient of the objective function. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_73computeGradient(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_72computeGradient, "TAO.computeGradient(self, x: Vec, g: Vec) -> None\nCompute the gradient of the objective function.\n\n Collective.\n\n Parameters\n ----------\n x\n The parameter vector.\n g\n The output gradient vector.\n\n See Also\n --------\n setGradient, petsc.TaoComputeGradient\n\n \nSource code at petsc4py/PETSc/TAO.pyx:809"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_73computeGradient(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_g = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("computeGradient (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_g,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 809, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_g)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 809, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("computeGradient", 1, 2, 2, 1); __PYX_ERR(52, 809, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "computeGradient") < 0)) __PYX_ERR(52, 809, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_x = ((struct PyPetscVecObject *)values[0]); __pyx_v_g = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("computeGradient", 1, 2, 2, __pyx_nargs); __PYX_ERR(52, 809, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TAO.computeGradient", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(52, 809, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_g), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "g", 0))) __PYX_ERR(52, 809, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_72computeGradient(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_x, __pyx_v_g); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_72computeGradient(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_g) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("computeGradient", 1); /* "petsc4py/PETSc/TAO.pyx":826 * * """ * CHKERR( TaoComputeGradient(self.tao, x.vec, g.vec) ) # <<<<<<<<<<<<<< * * def computeObjectiveGradient(self, Vec x, Vec g) -> float: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoComputeGradient(__pyx_v_self->tao, __pyx_v_x->vec, __pyx_v_g->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 826, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":809 * CHKERR( TaoComputeResidual(self.tao, x.vec, f.vec) ) * * def computeGradient(self, Vec x, Vec g) -> None: # <<<<<<<<<<<<<< * """Compute the gradient of the objective function. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.computeGradient", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":828 * CHKERR( TaoComputeGradient(self.tao, x.vec, g.vec) ) * * def computeObjectiveGradient(self, Vec x, Vec g) -> float: # <<<<<<<<<<<<<< * """Compute the gradient of the objective function and its value. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_75computeObjectiveGradient(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_74computeObjectiveGradient, "TAO.computeObjectiveGradient(self, x: Vec, g: Vec) -> float\nCompute the gradient of the objective function and its value.\n\n Collective.\n\n Parameters\n ----------\n x\n The parameter vector.\n g\n The output gradient vector.\n\n See Also\n --------\n setObjectiveGradient, setGradient, setObjective\n petsc.TaoComputeObjectiveAndGradient\n\n \nSource code at petsc4py/PETSc/TAO.pyx:828"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_75computeObjectiveGradient(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_g = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("computeObjectiveGradient (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_g,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 828, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_g)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 828, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("computeObjectiveGradient", 1, 2, 2, 1); __PYX_ERR(52, 828, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "computeObjectiveGradient") < 0)) __PYX_ERR(52, 828, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_x = ((struct PyPetscVecObject *)values[0]); __pyx_v_g = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("computeObjectiveGradient", 1, 2, 2, __pyx_nargs); __PYX_ERR(52, 828, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TAO.computeObjectiveGradient", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(52, 828, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_g), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "g", 0))) __PYX_ERR(52, 828, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_74computeObjectiveGradient(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_x, __pyx_v_g); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_74computeObjectiveGradient(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_g) { PetscReal __pyx_v_f; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("computeObjectiveGradient", 1); /* "petsc4py/PETSc/TAO.pyx":846 * * """ * cdef PetscReal f = 0 # <<<<<<<<<<<<<< * CHKERR( TaoComputeObjectiveAndGradient(self.tao, x.vec, &f, g.vec) ) * return toReal(f) */ __pyx_v_f = 0.0; /* "petsc4py/PETSc/TAO.pyx":847 * """ * cdef PetscReal f = 0 * CHKERR( TaoComputeObjectiveAndGradient(self.tao, x.vec, &f, g.vec) ) # <<<<<<<<<<<<<< * return toReal(f) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoComputeObjectiveAndGradient(__pyx_v_self->tao, __pyx_v_x->vec, (&__pyx_v_f), __pyx_v_g->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 847, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":848 * cdef PetscReal f = 0 * CHKERR( TaoComputeObjectiveAndGradient(self.tao, x.vec, &f, g.vec) ) * return toReal(f) # <<<<<<<<<<<<<< * * def computeDualVariables(self, Vec xl, Vec xu) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_f); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 848, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TAO.pyx":828 * CHKERR( TaoComputeGradient(self.tao, x.vec, g.vec) ) * * def computeObjectiveGradient(self, Vec x, Vec g) -> float: # <<<<<<<<<<<<<< * """Compute the gradient of the objective function and its value. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TAO.computeObjectiveGradient", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":850 * return toReal(f) * * def computeDualVariables(self, Vec xl, Vec xu) -> None: # <<<<<<<<<<<<<< * """Compute the dual vectors corresponding to variables' bounds. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_77computeDualVariables(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_76computeDualVariables, "TAO.computeDualVariables(self, xl: Vec, xu: Vec) -> None\nCompute the dual vectors corresponding to variables' bounds.\n\n Collective.\n\n See Also\n --------\n petsc.TaoComputeDualVariables\n\n \nSource code at petsc4py/PETSc/TAO.pyx:850"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_77computeDualVariables(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_xl = 0; struct PyPetscVecObject *__pyx_v_xu = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("computeDualVariables (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_xl,&__pyx_n_s_xu,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_xl)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 850, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_xu)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 850, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("computeDualVariables", 1, 2, 2, 1); __PYX_ERR(52, 850, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "computeDualVariables") < 0)) __PYX_ERR(52, 850, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_xl = ((struct PyPetscVecObject *)values[0]); __pyx_v_xu = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("computeDualVariables", 1, 2, 2, __pyx_nargs); __PYX_ERR(52, 850, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TAO.computeDualVariables", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xl), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "xl", 0))) __PYX_ERR(52, 850, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xu), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "xu", 0))) __PYX_ERR(52, 850, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_76computeDualVariables(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_xl, __pyx_v_xu); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_76computeDualVariables(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_xl, struct PyPetscVecObject *__pyx_v_xu) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("computeDualVariables", 1); /* "petsc4py/PETSc/TAO.pyx":860 * * """ * CHKERR( TaoComputeDualVariables(self.tao, xl.vec, xu.vec) ) # <<<<<<<<<<<<<< * * def computeVariableBounds(self, Vec xl, Vec xu) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoComputeDualVariables(__pyx_v_self->tao, __pyx_v_xl->vec, __pyx_v_xu->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 860, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":850 * return toReal(f) * * def computeDualVariables(self, Vec xl, Vec xu) -> None: # <<<<<<<<<<<<<< * """Compute the dual vectors corresponding to variables' bounds. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.computeDualVariables", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":862 * CHKERR( TaoComputeDualVariables(self.tao, xl.vec, xu.vec) ) * * def computeVariableBounds(self, Vec xl, Vec xu) -> None: # <<<<<<<<<<<<<< * """Compute the vectors corresponding to variables' bounds. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_79computeVariableBounds(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_78computeVariableBounds, "TAO.computeVariableBounds(self, xl: Vec, xu: Vec) -> None\nCompute the vectors corresponding to variables' bounds.\n\n Collective.\n\n See Also\n --------\n setVariableBounds, petsc.TaoComputeVariableBounds\n\n \nSource code at petsc4py/PETSc/TAO.pyx:862"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_79computeVariableBounds(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_xl = 0; struct PyPetscVecObject *__pyx_v_xu = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("computeVariableBounds (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_xl,&__pyx_n_s_xu,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_xl)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 862, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_xu)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 862, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("computeVariableBounds", 1, 2, 2, 1); __PYX_ERR(52, 862, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "computeVariableBounds") < 0)) __PYX_ERR(52, 862, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_xl = ((struct PyPetscVecObject *)values[0]); __pyx_v_xu = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("computeVariableBounds", 1, 2, 2, __pyx_nargs); __PYX_ERR(52, 862, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TAO.computeVariableBounds", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xl), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "xl", 0))) __PYX_ERR(52, 862, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xu), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "xu", 0))) __PYX_ERR(52, 862, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_78computeVariableBounds(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_xl, __pyx_v_xu); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_78computeVariableBounds(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_xl, struct PyPetscVecObject *__pyx_v_xu) { Vec __pyx_v_Lvec; Vec __pyx_v_Uvec; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("computeVariableBounds", 1); /* "petsc4py/PETSc/TAO.pyx":872 * * """ * CHKERR( TaoComputeVariableBounds(self.tao) ) # <<<<<<<<<<<<<< * cdef PetscVec Lvec = NULL, Uvec = NULL * CHKERR( TaoGetVariableBounds(self.tao, &Lvec, &Uvec) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoComputeVariableBounds(__pyx_v_self->tao)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 872, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":873 * """ * CHKERR( TaoComputeVariableBounds(self.tao) ) * cdef PetscVec Lvec = NULL, Uvec = NULL # <<<<<<<<<<<<<< * CHKERR( TaoGetVariableBounds(self.tao, &Lvec, &Uvec) ) * if xl.vec != NULL: */ __pyx_v_Lvec = NULL; __pyx_v_Uvec = NULL; /* "petsc4py/PETSc/TAO.pyx":874 * CHKERR( TaoComputeVariableBounds(self.tao) ) * cdef PetscVec Lvec = NULL, Uvec = NULL * CHKERR( TaoGetVariableBounds(self.tao, &Lvec, &Uvec) ) # <<<<<<<<<<<<<< * if xl.vec != NULL: * if Lvec != NULL: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoGetVariableBounds(__pyx_v_self->tao, (&__pyx_v_Lvec), (&__pyx_v_Uvec))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 874, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":875 * cdef PetscVec Lvec = NULL, Uvec = NULL * CHKERR( TaoGetVariableBounds(self.tao, &Lvec, &Uvec) ) * if xl.vec != NULL: # <<<<<<<<<<<<<< * if Lvec != NULL: * CHKERR( VecCopy(Lvec, xl.vec) ) */ __pyx_t_2 = (__pyx_v_xl->vec != NULL); if (__pyx_t_2) { /* "petsc4py/PETSc/TAO.pyx":876 * CHKERR( TaoGetVariableBounds(self.tao, &Lvec, &Uvec) ) * if xl.vec != NULL: * if Lvec != NULL: # <<<<<<<<<<<<<< * CHKERR( VecCopy(Lvec, xl.vec) ) * else: */ __pyx_t_2 = (__pyx_v_Lvec != NULL); if (__pyx_t_2) { /* "petsc4py/PETSc/TAO.pyx":877 * if xl.vec != NULL: * if Lvec != NULL: * CHKERR( VecCopy(Lvec, xl.vec) ) # <<<<<<<<<<<<<< * else: * CHKERR( VecSet(xl.vec, PETSC_NINFINITY) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCopy(__pyx_v_Lvec, __pyx_v_xl->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 877, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":876 * CHKERR( TaoGetVariableBounds(self.tao, &Lvec, &Uvec) ) * if xl.vec != NULL: * if Lvec != NULL: # <<<<<<<<<<<<<< * CHKERR( VecCopy(Lvec, xl.vec) ) * else: */ goto __pyx_L4; } /* "petsc4py/PETSc/TAO.pyx":879 * CHKERR( VecCopy(Lvec, xl.vec) ) * else: * CHKERR( VecSet(xl.vec, PETSC_NINFINITY) ) # <<<<<<<<<<<<<< * if xu.vec != NULL: * if Uvec != NULL: */ /*else*/ { __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecSet(__pyx_v_xl->vec, ((PetscScalar)PETSC_NINFINITY))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 879, __pyx_L1_error) } __pyx_L4:; /* "petsc4py/PETSc/TAO.pyx":875 * cdef PetscVec Lvec = NULL, Uvec = NULL * CHKERR( TaoGetVariableBounds(self.tao, &Lvec, &Uvec) ) * if xl.vec != NULL: # <<<<<<<<<<<<<< * if Lvec != NULL: * CHKERR( VecCopy(Lvec, xl.vec) ) */ } /* "petsc4py/PETSc/TAO.pyx":880 * else: * CHKERR( VecSet(xl.vec, PETSC_NINFINITY) ) * if xu.vec != NULL: # <<<<<<<<<<<<<< * if Uvec != NULL: * CHKERR( VecCopy(Uvec, xu.vec) ) */ __pyx_t_2 = (__pyx_v_xu->vec != NULL); if (__pyx_t_2) { /* "petsc4py/PETSc/TAO.pyx":881 * CHKERR( VecSet(xl.vec, PETSC_NINFINITY) ) * if xu.vec != NULL: * if Uvec != NULL: # <<<<<<<<<<<<<< * CHKERR( VecCopy(Uvec, xu.vec) ) * else: */ __pyx_t_2 = (__pyx_v_Uvec != NULL); if (__pyx_t_2) { /* "petsc4py/PETSc/TAO.pyx":882 * if xu.vec != NULL: * if Uvec != NULL: * CHKERR( VecCopy(Uvec, xu.vec) ) # <<<<<<<<<<<<<< * else: * CHKERR( VecSet(xu.vec, PETSC_INFINITY) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCopy(__pyx_v_Uvec, __pyx_v_xu->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 882, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":881 * CHKERR( VecSet(xl.vec, PETSC_NINFINITY) ) * if xu.vec != NULL: * if Uvec != NULL: # <<<<<<<<<<<<<< * CHKERR( VecCopy(Uvec, xu.vec) ) * else: */ goto __pyx_L6; } /* "petsc4py/PETSc/TAO.pyx":884 * CHKERR( VecCopy(Uvec, xu.vec) ) * else: * CHKERR( VecSet(xu.vec, PETSC_INFINITY) ) # <<<<<<<<<<<<<< * * def computeConstraints(self, Vec x, Vec c) -> None: */ /*else*/ { __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecSet(__pyx_v_xu->vec, ((PetscScalar)PETSC_INFINITY))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 884, __pyx_L1_error) } __pyx_L6:; /* "petsc4py/PETSc/TAO.pyx":880 * else: * CHKERR( VecSet(xl.vec, PETSC_NINFINITY) ) * if xu.vec != NULL: # <<<<<<<<<<<<<< * if Uvec != NULL: * CHKERR( VecCopy(Uvec, xu.vec) ) */ } /* "petsc4py/PETSc/TAO.pyx":862 * CHKERR( TaoComputeDualVariables(self.tao, xl.vec, xu.vec) ) * * def computeVariableBounds(self, Vec xl, Vec xu) -> None: # <<<<<<<<<<<<<< * """Compute the vectors corresponding to variables' bounds. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.computeVariableBounds", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":886 * CHKERR( VecSet(xu.vec, PETSC_INFINITY) ) * * def computeConstraints(self, Vec x, Vec c) -> None: # <<<<<<<<<<<<<< * """Compute the vector corresponding to the constraints. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_81computeConstraints(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_80computeConstraints, "TAO.computeConstraints(self, x: Vec, c: Vec) -> None\nCompute the vector corresponding to the constraints.\n\n Collective.\n\n Parameters\n ----------\n x\n The parameter vector.\n c\n The output constraints vector.\n\n See Also\n --------\n setVariableBounds, petsc.TaoComputeVariableBounds\n\n \nSource code at petsc4py/PETSc/TAO.pyx:886"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_81computeConstraints(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_c = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("computeConstraints (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_c,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 886, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_c)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 886, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("computeConstraints", 1, 2, 2, 1); __PYX_ERR(52, 886, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "computeConstraints") < 0)) __PYX_ERR(52, 886, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_x = ((struct PyPetscVecObject *)values[0]); __pyx_v_c = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("computeConstraints", 1, 2, 2, __pyx_nargs); __PYX_ERR(52, 886, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TAO.computeConstraints", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(52, 886, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_c), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "c", 0))) __PYX_ERR(52, 886, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_80computeConstraints(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_x, __pyx_v_c); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_80computeConstraints(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_c) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("computeConstraints", 1); /* "petsc4py/PETSc/TAO.pyx":903 * * """ * CHKERR( TaoComputeConstraints(self.tao, x.vec, c.vec) ) # <<<<<<<<<<<<<< * * def computeHessian(self, Vec x, Mat H, Mat P=None) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoComputeConstraints(__pyx_v_self->tao, __pyx_v_x->vec, __pyx_v_c->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 903, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":886 * CHKERR( VecSet(xu.vec, PETSC_INFINITY) ) * * def computeConstraints(self, Vec x, Vec c) -> None: # <<<<<<<<<<<<<< * """Compute the vector corresponding to the constraints. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.computeConstraints", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":905 * CHKERR( TaoComputeConstraints(self.tao, x.vec, c.vec) ) * * def computeHessian(self, Vec x, Mat H, Mat P=None) -> None: # <<<<<<<<<<<<<< * """Compute the Hessian of the objective function. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_83computeHessian(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_82computeHessian, "TAO.computeHessian(self, x: Vec, H: Mat, P: Mat | None = None) -> None\nCompute the Hessian of the objective function.\n\n Collective.\n\n Parameters\n ----------\n x\n The parameter vector.\n H\n The output Hessian matrix.\n P\n The output Hessian matrix used to construct the preconditioner.\n\n See Also\n --------\n setHessian, petsc.TaoComputeHessian\n\n \nSource code at petsc4py/PETSc/TAO.pyx:905"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_83computeHessian(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscMatObject *__pyx_v_H = 0; struct PyPetscMatObject *__pyx_v_P = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("computeHessian (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_H,&__pyx_n_s_P,0}; values[2] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscMatObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 905, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_H)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 905, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("computeHessian", 0, 2, 3, 1); __PYX_ERR(52, 905, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_P); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 905, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "computeHessian") < 0)) __PYX_ERR(52, 905, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_x = ((struct PyPetscVecObject *)values[0]); __pyx_v_H = ((struct PyPetscMatObject *)values[1]); __pyx_v_P = ((struct PyPetscMatObject *)values[2]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("computeHessian", 0, 2, 3, __pyx_nargs); __PYX_ERR(52, 905, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TAO.computeHessian", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(52, 905, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_H), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "H", 0))) __PYX_ERR(52, 905, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_P), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "P", 0))) __PYX_ERR(52, 905, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_82computeHessian(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_x, __pyx_v_H, __pyx_v_P); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_82computeHessian(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscMatObject *__pyx_v_H, struct PyPetscMatObject *__pyx_v_P) { Mat __pyx_v_hmat; Mat __pyx_v_pmat; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Mat __pyx_t_1; int __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("computeHessian", 1); /* "petsc4py/PETSc/TAO.pyx":924 * * """ * cdef PetscMat hmat = H.mat, pmat = H.mat # <<<<<<<<<<<<<< * if P is not None: pmat = P.mat * CHKERR( TaoComputeHessian(self.tao, x.vec, hmat, pmat) ) */ __pyx_t_1 = __pyx_v_H->mat; __pyx_v_hmat = __pyx_t_1; __pyx_t_1 = __pyx_v_H->mat; __pyx_v_pmat = __pyx_t_1; /* "petsc4py/PETSc/TAO.pyx":925 * """ * cdef PetscMat hmat = H.mat, pmat = H.mat * if P is not None: pmat = P.mat # <<<<<<<<<<<<<< * CHKERR( TaoComputeHessian(self.tao, x.vec, hmat, pmat) ) * */ __pyx_t_2 = (((PyObject *)__pyx_v_P) != Py_None); if (__pyx_t_2) { __pyx_t_1 = __pyx_v_P->mat; __pyx_v_pmat = __pyx_t_1; } /* "petsc4py/PETSc/TAO.pyx":926 * cdef PetscMat hmat = H.mat, pmat = H.mat * if P is not None: pmat = P.mat * CHKERR( TaoComputeHessian(self.tao, x.vec, hmat, pmat) ) # <<<<<<<<<<<<<< * * def computeJacobian(self, Vec x, Mat J, Mat P=None) -> None: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoComputeHessian(__pyx_v_self->tao, __pyx_v_x->vec, __pyx_v_hmat, __pyx_v_pmat)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 926, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":905 * CHKERR( TaoComputeConstraints(self.tao, x.vec, c.vec) ) * * def computeHessian(self, Vec x, Mat H, Mat P=None) -> None: # <<<<<<<<<<<<<< * """Compute the Hessian of the objective function. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.computeHessian", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":928 * CHKERR( TaoComputeHessian(self.tao, x.vec, hmat, pmat) ) * * def computeJacobian(self, Vec x, Mat J, Mat P=None) -> None: # <<<<<<<<<<<<<< * """Compute the Jacobian. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_85computeJacobian(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_84computeJacobian, "TAO.computeJacobian(self, x: Vec, J: Mat, P: Mat | None = None) -> None\nCompute the Jacobian.\n\n Collective.\n\n Parameters\n ----------\n x\n The parameter vector.\n J\n The output Jacobian matrix.\n P\n The output Jacobian matrix used to construct the preconditioner.\n\n See Also\n --------\n setJacobian, petsc.TaoComputeJacobian\n\n \nSource code at petsc4py/PETSc/TAO.pyx:928"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_85computeJacobian(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscMatObject *__pyx_v_J = 0; struct PyPetscMatObject *__pyx_v_P = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("computeJacobian (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_J,&__pyx_n_s_P,0}; values[2] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscMatObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 928, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_J)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 928, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("computeJacobian", 0, 2, 3, 1); __PYX_ERR(52, 928, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_P); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 928, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "computeJacobian") < 0)) __PYX_ERR(52, 928, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_x = ((struct PyPetscVecObject *)values[0]); __pyx_v_J = ((struct PyPetscMatObject *)values[1]); __pyx_v_P = ((struct PyPetscMatObject *)values[2]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("computeJacobian", 0, 2, 3, __pyx_nargs); __PYX_ERR(52, 928, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TAO.computeJacobian", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(52, 928, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_J), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "J", 0))) __PYX_ERR(52, 928, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_P), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "P", 0))) __PYX_ERR(52, 928, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_84computeJacobian(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_x, __pyx_v_J, __pyx_v_P); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_84computeJacobian(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscMatObject *__pyx_v_J, struct PyPetscMatObject *__pyx_v_P) { Mat __pyx_v_jmat; Mat __pyx_v_pmat; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Mat __pyx_t_1; int __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("computeJacobian", 1); /* "petsc4py/PETSc/TAO.pyx":947 * * """ * cdef PetscMat jmat = J.mat, pmat = J.mat # <<<<<<<<<<<<<< * if P is not None: pmat = P.mat * CHKERR( TaoComputeJacobian(self.tao, x.vec, jmat, pmat) ) */ __pyx_t_1 = __pyx_v_J->mat; __pyx_v_jmat = __pyx_t_1; __pyx_t_1 = __pyx_v_J->mat; __pyx_v_pmat = __pyx_t_1; /* "petsc4py/PETSc/TAO.pyx":948 * """ * cdef PetscMat jmat = J.mat, pmat = J.mat * if P is not None: pmat = P.mat # <<<<<<<<<<<<<< * CHKERR( TaoComputeJacobian(self.tao, x.vec, jmat, pmat) ) * */ __pyx_t_2 = (((PyObject *)__pyx_v_P) != Py_None); if (__pyx_t_2) { __pyx_t_1 = __pyx_v_P->mat; __pyx_v_pmat = __pyx_t_1; } /* "petsc4py/PETSc/TAO.pyx":949 * cdef PetscMat jmat = J.mat, pmat = J.mat * if P is not None: pmat = P.mat * CHKERR( TaoComputeJacobian(self.tao, x.vec, jmat, pmat) ) # <<<<<<<<<<<<<< * * # -------------- */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoComputeJacobian(__pyx_v_self->tao, __pyx_v_x->vec, __pyx_v_jmat, __pyx_v_pmat)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 949, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":928 * CHKERR( TaoComputeHessian(self.tao, x.vec, hmat, pmat) ) * * def computeJacobian(self, Vec x, Mat J, Mat P=None) -> None: # <<<<<<<<<<<<<< * """Compute the Jacobian. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.computeJacobian", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":953 * # -------------- * * def setTolerances(self, gatol: float = None, grtol: float = None, gttol: float = None) -> None: # <<<<<<<<<<<<<< * """Set the tolerance parameters used in the solver convergence tests. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_87setTolerances(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_86setTolerances, "TAO.setTolerances(self, gatol: float = None, grtol: float = None, gttol: float = None) -> None\nSet the tolerance parameters used in the solver convergence tests.\n\n Collective.\n\n Parameters\n ----------\n gatol\n The absolute norm of the gradient. Defaults to `DEFAULT`.\n grtol\n The relative norm of the gradient with respect\n to the initial norm of the objective. Defaults to `DEFAULT`.\n gttol\n The relative norm of the gradient with respect\n to the initial norm of the gradient. Defaults to `DEFAULT`.\n\n See Also\n --------\n getTolerances, petsc.TaoSetTolerances\n\n \nSource code at petsc4py/PETSc/TAO.pyx:953"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_87setTolerances(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_gatol = 0; PyObject *__pyx_v_grtol = 0; PyObject *__pyx_v_gttol = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setTolerances (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gatol,&__pyx_n_s_grtol,&__pyx_n_s_gttol,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gatol); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 953, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_grtol); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 953, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gttol); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 953, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setTolerances") < 0)) __PYX_ERR(52, 953, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_gatol = values[0]; __pyx_v_grtol = values[1]; __pyx_v_gttol = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setTolerances", 0, 0, 3, __pyx_nargs); __PYX_ERR(52, 953, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TAO.setTolerances", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_86setTolerances(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_gatol, __pyx_v_grtol, __pyx_v_gttol); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_86setTolerances(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_gatol, PyObject *__pyx_v_grtol, PyObject *__pyx_v_gttol) { PetscReal __pyx_v__gatol; PetscReal __pyx_v__grtol; PetscReal __pyx_v__gttol; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscReal __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setTolerances", 1); /* "petsc4py/PETSc/TAO.pyx":974 * * """ * cdef PetscReal _gatol=PETSC_DEFAULT, _grtol=PETSC_DEFAULT, _gttol=PETSC_DEFAULT # <<<<<<<<<<<<<< * if gatol is not None: _gatol = asReal(gatol) * if grtol is not None: _grtol = asReal(grtol) */ __pyx_v__gatol = PETSC_DEFAULT; __pyx_v__grtol = PETSC_DEFAULT; __pyx_v__gttol = PETSC_DEFAULT; /* "petsc4py/PETSc/TAO.pyx":975 * """ * cdef PetscReal _gatol=PETSC_DEFAULT, _grtol=PETSC_DEFAULT, _gttol=PETSC_DEFAULT * if gatol is not None: _gatol = asReal(gatol) # <<<<<<<<<<<<<< * if grtol is not None: _grtol = asReal(grtol) * if gttol is not None: _gttol = asReal(gttol) */ __pyx_t_1 = (__pyx_v_gatol != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_gatol); if (unlikely(__pyx_t_2 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(52, 975, __pyx_L1_error) __pyx_v__gatol = __pyx_t_2; } /* "petsc4py/PETSc/TAO.pyx":976 * cdef PetscReal _gatol=PETSC_DEFAULT, _grtol=PETSC_DEFAULT, _gttol=PETSC_DEFAULT * if gatol is not None: _gatol = asReal(gatol) * if grtol is not None: _grtol = asReal(grtol) # <<<<<<<<<<<<<< * if gttol is not None: _gttol = asReal(gttol) * CHKERR( TaoSetTolerances(self.tao, _gatol, _grtol, _gttol) ) */ __pyx_t_1 = (__pyx_v_grtol != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_grtol); if (unlikely(__pyx_t_2 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(52, 976, __pyx_L1_error) __pyx_v__grtol = __pyx_t_2; } /* "petsc4py/PETSc/TAO.pyx":977 * if gatol is not None: _gatol = asReal(gatol) * if grtol is not None: _grtol = asReal(grtol) * if gttol is not None: _gttol = asReal(gttol) # <<<<<<<<<<<<<< * CHKERR( TaoSetTolerances(self.tao, _gatol, _grtol, _gttol) ) * */ __pyx_t_1 = (__pyx_v_gttol != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_gttol); if (unlikely(__pyx_t_2 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(52, 977, __pyx_L1_error) __pyx_v__gttol = __pyx_t_2; } /* "petsc4py/PETSc/TAO.pyx":978 * if grtol is not None: _grtol = asReal(grtol) * if gttol is not None: _gttol = asReal(gttol) * CHKERR( TaoSetTolerances(self.tao, _gatol, _grtol, _gttol) ) # <<<<<<<<<<<<<< * * def getTolerances(self) -> tuple[float, float, float]: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSetTolerances(__pyx_v_self->tao, __pyx_v__gatol, __pyx_v__grtol, __pyx_v__gttol)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 978, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":953 * # -------------- * * def setTolerances(self, gatol: float = None, grtol: float = None, gttol: float = None) -> None: # <<<<<<<<<<<<<< * """Set the tolerance parameters used in the solver convergence tests. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.setTolerances", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":980 * CHKERR( TaoSetTolerances(self.tao, _gatol, _grtol, _gttol) ) * * def getTolerances(self) -> tuple[float, float, float]: # <<<<<<<<<<<<<< * """Return the tolerance parameters used in the solver convergence tests. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_89getTolerances(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_88getTolerances, "TAO.getTolerances(self) -> tuple[float, float, float]\nReturn the tolerance parameters used in the solver convergence tests.\n\n Not collective.\n\n Returns\n -------\n gatol : float\n The absolute norm of the gradient.\n grtol : float\n The relative norm of the gradient with respect to\n the initial norm of the objective.\n gttol : float\n The relative norm of the gradient with respect to\n the initial norm of the gradient.\n\n See Also\n --------\n setTolerances, petsc.TaoGetTolerances\n\n \nSource code at petsc4py/PETSc/TAO.pyx:980"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_89getTolerances(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getTolerances (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getTolerances", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getTolerances", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_88getTolerances(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_88getTolerances(struct PyPetscTAOObject *__pyx_v_self) { PetscReal __pyx_v__gatol; PetscReal __pyx_v__grtol; PetscReal __pyx_v__gttol; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getTolerances", 1); /* "petsc4py/PETSc/TAO.pyx":1001 * * """ * cdef PetscReal _gatol=PETSC_DEFAULT, _grtol=PETSC_DEFAULT, _gttol=PETSC_DEFAULT # <<<<<<<<<<<<<< * CHKERR( TaoGetTolerances(self.tao, &_gatol, &_grtol, &_gttol) ) * return (toReal(_gatol), toReal(_grtol), toReal(_gttol)) */ __pyx_v__gatol = PETSC_DEFAULT; __pyx_v__grtol = PETSC_DEFAULT; __pyx_v__gttol = PETSC_DEFAULT; /* "petsc4py/PETSc/TAO.pyx":1002 * """ * cdef PetscReal _gatol=PETSC_DEFAULT, _grtol=PETSC_DEFAULT, _gttol=PETSC_DEFAULT * CHKERR( TaoGetTolerances(self.tao, &_gatol, &_grtol, &_gttol) ) # <<<<<<<<<<<<<< * return (toReal(_gatol), toReal(_grtol), toReal(_gttol)) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoGetTolerances(__pyx_v_self->tao, (&__pyx_v__gatol), (&__pyx_v__grtol), (&__pyx_v__gttol))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1002, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":1003 * cdef PetscReal _gatol=PETSC_DEFAULT, _grtol=PETSC_DEFAULT, _gttol=PETSC_DEFAULT * CHKERR( TaoGetTolerances(self.tao, &_gatol, &_grtol, &_gttol) ) * return (toReal(_gatol), toReal(_grtol), toReal(_gttol)) # <<<<<<<<<<<<<< * * def setMaximumIterations(self, mit: int) -> float: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v__gatol); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 1003, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v__grtol); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 1003, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v__gttol); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1003, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 1003, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2)) __PYX_ERR(52, 1003, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3)) __PYX_ERR(52, 1003, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4)) __PYX_ERR(52, 1003, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TAO.pyx":980 * CHKERR( TaoSetTolerances(self.tao, _gatol, _grtol, _gttol) ) * * def getTolerances(self) -> tuple[float, float, float]: # <<<<<<<<<<<<<< * """Return the tolerance parameters used in the solver convergence tests. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.TAO.getTolerances", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":1005 * return (toReal(_gatol), toReal(_grtol), toReal(_gttol)) * * def setMaximumIterations(self, mit: int) -> float: # <<<<<<<<<<<<<< * """Set the maximum number of solver iterations. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_91setMaximumIterations(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_90setMaximumIterations, "TAO.setMaximumIterations(self, mit: int) -> float\nSet the maximum number of solver iterations.\n\n Collective.\n\n See Also\n --------\n setTolerances, petsc.TaoSetMaximumIterations\n\n \nSource code at petsc4py/PETSc/TAO.pyx:1005"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_91setMaximumIterations(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_mit = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setMaximumIterations (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mit,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mit)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 1005, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setMaximumIterations") < 0)) __PYX_ERR(52, 1005, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_mit = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setMaximumIterations", 1, 1, 1, __pyx_nargs); __PYX_ERR(52, 1005, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TAO.setMaximumIterations", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_90setMaximumIterations(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_mit); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_90setMaximumIterations(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_mit) { PetscInt __pyx_v__mit; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setMaximumIterations", 1); /* "petsc4py/PETSc/TAO.pyx":1015 * * """ * cdef PetscInt _mit = asInt(mit) # <<<<<<<<<<<<<< * CHKERR( TaoSetMaximumIterations(self.tao, _mit) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_mit); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(52, 1015, __pyx_L1_error) __pyx_v__mit = __pyx_t_1; /* "petsc4py/PETSc/TAO.pyx":1016 * """ * cdef PetscInt _mit = asInt(mit) * CHKERR( TaoSetMaximumIterations(self.tao, _mit) ) # <<<<<<<<<<<<<< * * def getMaximumIterations(self) -> int: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSetMaximumIterations(__pyx_v_self->tao, __pyx_v__mit)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1016, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":1005 * return (toReal(_gatol), toReal(_grtol), toReal(_gttol)) * * def setMaximumIterations(self, mit: int) -> float: # <<<<<<<<<<<<<< * """Set the maximum number of solver iterations. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.setMaximumIterations", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":1018 * CHKERR( TaoSetMaximumIterations(self.tao, _mit) ) * * def getMaximumIterations(self) -> int: # <<<<<<<<<<<<<< * """Return the maximum number of solver iterations. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_93getMaximumIterations(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_92getMaximumIterations, "TAO.getMaximumIterations(self) -> int\nReturn the maximum number of solver iterations.\n\n Not collective.\n\n See Also\n --------\n setMaximumIterations, petsc.TaoGetMaximumIterations\n\n \nSource code at petsc4py/PETSc/TAO.pyx:1018"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_93getMaximumIterations(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getMaximumIterations (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getMaximumIterations", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getMaximumIterations", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_92getMaximumIterations(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_92getMaximumIterations(struct PyPetscTAOObject *__pyx_v_self) { PetscInt __pyx_v__mit; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getMaximumIterations", 1); /* "petsc4py/PETSc/TAO.pyx":1028 * * """ * cdef PetscInt _mit = PETSC_DEFAULT # <<<<<<<<<<<<<< * CHKERR( TaoGetMaximumIterations(self.tao, &_mit) ) * return toInt(_mit) */ __pyx_v__mit = PETSC_DEFAULT; /* "petsc4py/PETSc/TAO.pyx":1029 * """ * cdef PetscInt _mit = PETSC_DEFAULT * CHKERR( TaoGetMaximumIterations(self.tao, &_mit) ) # <<<<<<<<<<<<<< * return toInt(_mit) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoGetMaximumIterations(__pyx_v_self->tao, (&__pyx_v__mit))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1029, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":1030 * cdef PetscInt _mit = PETSC_DEFAULT * CHKERR( TaoGetMaximumIterations(self.tao, &_mit) ) * return toInt(_mit) # <<<<<<<<<<<<<< * * def setMaximumFunctionEvaluations(self, mit: int) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v__mit); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 1030, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TAO.pyx":1018 * CHKERR( TaoSetMaximumIterations(self.tao, _mit) ) * * def getMaximumIterations(self) -> int: # <<<<<<<<<<<<<< * """Return the maximum number of solver iterations. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TAO.getMaximumIterations", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":1032 * return toInt(_mit) * * def setMaximumFunctionEvaluations(self, mit: int) -> None: # <<<<<<<<<<<<<< * """Set the maximum number of objective evaluations within the solver. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_95setMaximumFunctionEvaluations(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_94setMaximumFunctionEvaluations, "TAO.setMaximumFunctionEvaluations(self, mit: int) -> None\nSet the maximum number of objective evaluations within the solver.\n\n Collective.\n\n See Also\n --------\n setMaximumIterations, petsc.TaoSetMaximumFunctionEvaluations\n\n \nSource code at petsc4py/PETSc/TAO.pyx:1032"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_95setMaximumFunctionEvaluations(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_mit = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setMaximumFunctionEvaluations (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mit,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mit)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 1032, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setMaximumFunctionEvaluations") < 0)) __PYX_ERR(52, 1032, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_mit = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setMaximumFunctionEvaluations", 1, 1, 1, __pyx_nargs); __PYX_ERR(52, 1032, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TAO.setMaximumFunctionEvaluations", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_94setMaximumFunctionEvaluations(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_mit); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_94setMaximumFunctionEvaluations(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_mit) { PetscInt __pyx_v__mit; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setMaximumFunctionEvaluations", 1); /* "petsc4py/PETSc/TAO.pyx":1042 * * """ * cdef PetscInt _mit = asInt(mit) # <<<<<<<<<<<<<< * CHKERR( TaoSetMaximumFunctionEvaluations(self.tao, _mit) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_mit); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(52, 1042, __pyx_L1_error) __pyx_v__mit = __pyx_t_1; /* "petsc4py/PETSc/TAO.pyx":1043 * """ * cdef PetscInt _mit = asInt(mit) * CHKERR( TaoSetMaximumFunctionEvaluations(self.tao, _mit) ) # <<<<<<<<<<<<<< * * def getMaximumFunctionEvaluations(self) -> int: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSetMaximumFunctionEvaluations(__pyx_v_self->tao, __pyx_v__mit)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1043, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":1032 * return toInt(_mit) * * def setMaximumFunctionEvaluations(self, mit: int) -> None: # <<<<<<<<<<<<<< * """Set the maximum number of objective evaluations within the solver. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.setMaximumFunctionEvaluations", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":1045 * CHKERR( TaoSetMaximumFunctionEvaluations(self.tao, _mit) ) * * def getMaximumFunctionEvaluations(self) -> int: # <<<<<<<<<<<<<< * """Return the maximum number of objective evaluations within the solver. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_97getMaximumFunctionEvaluations(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_96getMaximumFunctionEvaluations, "TAO.getMaximumFunctionEvaluations(self) -> int\nReturn the maximum number of objective evaluations within the solver.\n\n Not collective.\n\n See Also\n --------\n setMaximumFunctionEvaluations, petsc.TaoGetMaximumFunctionEvaluations\n\n \nSource code at petsc4py/PETSc/TAO.pyx:1045"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_97getMaximumFunctionEvaluations(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getMaximumFunctionEvaluations (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getMaximumFunctionEvaluations", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getMaximumFunctionEvaluations", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_96getMaximumFunctionEvaluations(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_96getMaximumFunctionEvaluations(struct PyPetscTAOObject *__pyx_v_self) { PetscInt __pyx_v__mit; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getMaximumFunctionEvaluations", 1); /* "petsc4py/PETSc/TAO.pyx":1055 * * """ * cdef PetscInt _mit = PETSC_DEFAULT # <<<<<<<<<<<<<< * CHKERR( TaoGetMaximumFunctionEvaluations(self.tao, &_mit) ) * return toInt(_mit) */ __pyx_v__mit = PETSC_DEFAULT; /* "petsc4py/PETSc/TAO.pyx":1056 * """ * cdef PetscInt _mit = PETSC_DEFAULT * CHKERR( TaoGetMaximumFunctionEvaluations(self.tao, &_mit) ) # <<<<<<<<<<<<<< * return toInt(_mit) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoGetMaximumFunctionEvaluations(__pyx_v_self->tao, (&__pyx_v__mit))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1056, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":1057 * cdef PetscInt _mit = PETSC_DEFAULT * CHKERR( TaoGetMaximumFunctionEvaluations(self.tao, &_mit) ) * return toInt(_mit) # <<<<<<<<<<<<<< * * def setConstraintTolerances(self, catol: float = None, crtol: float = None) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v__mit); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 1057, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TAO.pyx":1045 * CHKERR( TaoSetMaximumFunctionEvaluations(self.tao, _mit) ) * * def getMaximumFunctionEvaluations(self) -> int: # <<<<<<<<<<<<<< * """Return the maximum number of objective evaluations within the solver. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TAO.getMaximumFunctionEvaluations", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":1059 * return toInt(_mit) * * def setConstraintTolerances(self, catol: float = None, crtol: float = None) -> None: # <<<<<<<<<<<<<< * """Set the constraints tolerance parameters used in the solver convergence tests. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_99setConstraintTolerances(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_98setConstraintTolerances, "TAO.setConstraintTolerances(self, catol: float = None, crtol: float = None) -> None\nSet the constraints tolerance parameters used in the solver convergence tests.\n\n Collective.\n\n Parameters\n ----------\n catol\n The absolute norm of the constraints. Defaults to `DEFAULT`.\n crtol\n The relative norm of the constraints. Defaults to `DEFAULT`.\n\n See Also\n --------\n getConstraintTolerances, petsc.TaoSetConstraintTolerances\n\n \nSource code at petsc4py/PETSc/TAO.pyx:1059"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_99setConstraintTolerances(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_catol = 0; PyObject *__pyx_v_crtol = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setConstraintTolerances (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_catol,&__pyx_n_s_crtol,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_catol); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 1059, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_crtol); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 1059, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setConstraintTolerances") < 0)) __PYX_ERR(52, 1059, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_catol = values[0]; __pyx_v_crtol = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setConstraintTolerances", 0, 0, 2, __pyx_nargs); __PYX_ERR(52, 1059, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TAO.setConstraintTolerances", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_98setConstraintTolerances(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_catol, __pyx_v_crtol); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_98setConstraintTolerances(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_catol, PyObject *__pyx_v_crtol) { PetscReal __pyx_v__catol; PetscReal __pyx_v__crtol; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscReal __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setConstraintTolerances", 1); /* "petsc4py/PETSc/TAO.pyx":1076 * * """ * cdef PetscReal _catol=PETSC_DEFAULT, _crtol=PETSC_DEFAULT # <<<<<<<<<<<<<< * if catol is not None: _catol = asReal(catol) * if crtol is not None: _crtol = asReal(crtol) */ __pyx_v__catol = PETSC_DEFAULT; __pyx_v__crtol = PETSC_DEFAULT; /* "petsc4py/PETSc/TAO.pyx":1077 * """ * cdef PetscReal _catol=PETSC_DEFAULT, _crtol=PETSC_DEFAULT * if catol is not None: _catol = asReal(catol) # <<<<<<<<<<<<<< * if crtol is not None: _crtol = asReal(crtol) * CHKERR( TaoSetConstraintTolerances(self.tao, _catol, _crtol) ) */ __pyx_t_1 = (__pyx_v_catol != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_catol); if (unlikely(__pyx_t_2 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(52, 1077, __pyx_L1_error) __pyx_v__catol = __pyx_t_2; } /* "petsc4py/PETSc/TAO.pyx":1078 * cdef PetscReal _catol=PETSC_DEFAULT, _crtol=PETSC_DEFAULT * if catol is not None: _catol = asReal(catol) * if crtol is not None: _crtol = asReal(crtol) # <<<<<<<<<<<<<< * CHKERR( TaoSetConstraintTolerances(self.tao, _catol, _crtol) ) * */ __pyx_t_1 = (__pyx_v_crtol != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_crtol); if (unlikely(__pyx_t_2 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(52, 1078, __pyx_L1_error) __pyx_v__crtol = __pyx_t_2; } /* "petsc4py/PETSc/TAO.pyx":1079 * if catol is not None: _catol = asReal(catol) * if crtol is not None: _crtol = asReal(crtol) * CHKERR( TaoSetConstraintTolerances(self.tao, _catol, _crtol) ) # <<<<<<<<<<<<<< * * def getConstraintTolerances(self) -> tuple[float, float]: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSetConstraintTolerances(__pyx_v_self->tao, __pyx_v__catol, __pyx_v__crtol)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1079, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":1059 * return toInt(_mit) * * def setConstraintTolerances(self, catol: float = None, crtol: float = None) -> None: # <<<<<<<<<<<<<< * """Set the constraints tolerance parameters used in the solver convergence tests. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.setConstraintTolerances", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":1081 * CHKERR( TaoSetConstraintTolerances(self.tao, _catol, _crtol) ) * * def getConstraintTolerances(self) -> tuple[float, float]: # <<<<<<<<<<<<<< * """Return the constraints tolerance parameters used in the convergence tests. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_101getConstraintTolerances(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_100getConstraintTolerances, "TAO.getConstraintTolerances(self) -> tuple[float, float]\nReturn the constraints tolerance parameters used in the convergence tests.\n\n Not collective.\n\n Returns\n -------\n catol : float\n The absolute norm of the constraints.\n crtol : float\n The relative norm of the constraints.\n\n See Also\n --------\n setConstraintTolerances, petsc.TaoGetConstraintTolerances\n\n \nSource code at petsc4py/PETSc/TAO.pyx:1081"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_101getConstraintTolerances(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getConstraintTolerances (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getConstraintTolerances", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getConstraintTolerances", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_100getConstraintTolerances(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_100getConstraintTolerances(struct PyPetscTAOObject *__pyx_v_self) { PetscReal __pyx_v__catol; PetscReal __pyx_v__crtol; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getConstraintTolerances", 1); /* "petsc4py/PETSc/TAO.pyx":1098 * * """ * cdef PetscReal _catol=PETSC_DEFAULT, _crtol=PETSC_DEFAULT # <<<<<<<<<<<<<< * CHKERR( TaoGetConstraintTolerances(self.tao, &_catol, &_crtol) ) * return (toReal(_catol), toReal(_crtol)) */ __pyx_v__catol = PETSC_DEFAULT; __pyx_v__crtol = PETSC_DEFAULT; /* "petsc4py/PETSc/TAO.pyx":1099 * """ * cdef PetscReal _catol=PETSC_DEFAULT, _crtol=PETSC_DEFAULT * CHKERR( TaoGetConstraintTolerances(self.tao, &_catol, &_crtol) ) # <<<<<<<<<<<<<< * return (toReal(_catol), toReal(_crtol)) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoGetConstraintTolerances(__pyx_v_self->tao, (&__pyx_v__catol), (&__pyx_v__crtol))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1099, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":1100 * cdef PetscReal _catol=PETSC_DEFAULT, _crtol=PETSC_DEFAULT * CHKERR( TaoGetConstraintTolerances(self.tao, &_catol, &_crtol) ) * return (toReal(_catol), toReal(_crtol)) # <<<<<<<<<<<<<< * * def setConvergenceTest(self, converged: TAOConvergedFunction | None, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v__catol); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 1100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v__crtol); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 1100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(52, 1100, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(52, 1100, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TAO.pyx":1081 * CHKERR( TaoSetConstraintTolerances(self.tao, _catol, _crtol) ) * * def getConstraintTolerances(self) -> tuple[float, float]: # <<<<<<<<<<<<<< * """Return the constraints tolerance parameters used in the convergence tests. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.TAO.getConstraintTolerances", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":1102 * return (toReal(_catol), toReal(_crtol)) * * def setConvergenceTest(self, converged: TAOConvergedFunction | None, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: # <<<<<<<<<<<<<< * """Set the callback used to test for solver convergence. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_103setConvergenceTest(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_102setConvergenceTest, "TAO.setConvergenceTest(self, converged: TAOConvergedFunction | None, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nSet the callback used to test for solver convergence.\n\n Logically collective.\n\n Parameters\n ----------\n converged\n The callback. If `None`, reset to the default convergence test.\n args\n Positional arguments for the callback.\n kargs\n Keyword arguments for the callback.\n\n See Also\n --------\n getConvergenceTest, petsc.TaoSetConvergenceTest\n\n \nSource code at petsc4py/PETSc/TAO.pyx:1102"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_103setConvergenceTest(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_converged = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setConvergenceTest (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_converged,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_converged)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 1102, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 1102, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 1102, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setConvergenceTest") < 0)) __PYX_ERR(52, 1102, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_converged = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setConvergenceTest", 0, 1, 3, __pyx_nargs); __PYX_ERR(52, 1102, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TAO.setConvergenceTest", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_102setConvergenceTest(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_converged, __pyx_v_args, __pyx_v_kargs); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_102setConvergenceTest(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_converged, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setConvergenceTest", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/TAO.pyx":1121 * * """ * if converged is None: # <<<<<<<<<<<<<< * CHKERR( TaoSetConvergenceTest(self.tao, TaoDefaultConvergenceTest, NULL) ) * self.set_attr('__converged__', None) */ __pyx_t_1 = (__pyx_v_converged == Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/TAO.pyx":1122 * """ * if converged is None: * CHKERR( TaoSetConvergenceTest(self.tao, TaoDefaultConvergenceTest, NULL) ) # <<<<<<<<<<<<<< * self.set_attr('__converged__', None) * else: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSetConvergenceTest(__pyx_v_self->tao, TaoDefaultConvergenceTest, NULL)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1122, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":1123 * if converged is None: * CHKERR( TaoSetConvergenceTest(self.tao, TaoDefaultConvergenceTest, NULL) ) * self.set_attr('__converged__', None) # <<<<<<<<<<<<<< * else: * if args is None: args = () */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__converged__"), Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 1123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/TAO.pyx":1121 * * """ * if converged is None: # <<<<<<<<<<<<<< * CHKERR( TaoSetConvergenceTest(self.tao, TaoDefaultConvergenceTest, NULL) ) * self.set_attr('__converged__', None) */ goto __pyx_L3; } /* "petsc4py/PETSc/TAO.pyx":1125 * self.set_attr('__converged__', None) * else: * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * self.set_attr('__converged__', (converged, args, kargs)) */ /*else*/ { __pyx_t_1 = (__pyx_v_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/TAO.pyx":1126 * else: * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * self.set_attr('__converged__', (converged, args, kargs)) * CHKERR( TaoSetConvergenceTest(self.tao, TAO_Converged, NULL) ) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); if (__pyx_t_1) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 1126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "petsc4py/PETSc/TAO.pyx":1127 * if args is None: args = () * if kargs is None: kargs = {} * self.set_attr('__converged__', (converged, args, kargs)) # <<<<<<<<<<<<<< * CHKERR( TaoSetConvergenceTest(self.tao, TAO_Converged, NULL) ) * */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 1127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_converged); __Pyx_GIVEREF(__pyx_v_converged); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_converged)) __PYX_ERR(52, 1127, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args)) __PYX_ERR(52, 1127, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs)) __PYX_ERR(52, 1127, __pyx_L1_error); __pyx_t_4 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__converged__"), __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/TAO.pyx":1128 * if kargs is None: kargs = {} * self.set_attr('__converged__', (converged, args, kargs)) * CHKERR( TaoSetConvergenceTest(self.tao, TAO_Converged, NULL) ) # <<<<<<<<<<<<<< * * def getConvergenceTest(self) -> tuple[TAOConvergedFunction, tuple[Any, ...], dict[str, Any]]: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSetConvergenceTest(__pyx_v_self->tao, __pyx_f_8petsc4py_5PETSc_TAO_Converged, NULL)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1128, __pyx_L1_error) } __pyx_L3:; /* "petsc4py/PETSc/TAO.pyx":1102 * return (toReal(_catol), toReal(_crtol)) * * def setConvergenceTest(self, converged: TAOConvergedFunction | None, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: # <<<<<<<<<<<<<< * """Set the callback used to test for solver convergence. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.TAO.setConvergenceTest", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":1130 * CHKERR( TaoSetConvergenceTest(self.tao, TAO_Converged, NULL) ) * * def getConvergenceTest(self) -> tuple[TAOConvergedFunction, tuple[Any, ...], dict[str, Any]]: # <<<<<<<<<<<<<< * """Return the callback used to test for solver convergence. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_105getConvergenceTest(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_104getConvergenceTest, "TAO.getConvergenceTest(self) -> tuple[TAOConvergedFunction, tuple[Any, ...], dict[str, Any]]\nReturn the callback used to test for solver convergence.\n\n Not collective.\n\n See Also\n --------\n setConvergenceTest\n\n \nSource code at petsc4py/PETSc/TAO.pyx:1130"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_105getConvergenceTest(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getConvergenceTest (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getConvergenceTest", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getConvergenceTest", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_104getConvergenceTest(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_104getConvergenceTest(struct PyPetscTAOObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getConvergenceTest", 1); /* "petsc4py/PETSc/TAO.pyx":1140 * * """ * return self.get_attr('__converged__') # <<<<<<<<<<<<<< * * def setConvergedReason(self, reason: ConvergedReason) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__converged__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 1140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TAO.pyx":1130 * CHKERR( TaoSetConvergenceTest(self.tao, TAO_Converged, NULL) ) * * def getConvergenceTest(self) -> tuple[TAOConvergedFunction, tuple[Any, ...], dict[str, Any]]: # <<<<<<<<<<<<<< * """Return the callback used to test for solver convergence. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TAO.getConvergenceTest", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":1142 * return self.get_attr('__converged__') * * def setConvergedReason(self, reason: ConvergedReason) -> None: # <<<<<<<<<<<<<< * """Set the termination flag. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_107setConvergedReason(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_106setConvergedReason, "TAO.setConvergedReason(self, reason: ConvergedReason) -> None\nSet the termination flag.\n\n Collective.\n\n See Also\n --------\n getConvergedReason, petsc.TaoSetConvergedReason\n\n \nSource code at petsc4py/PETSc/TAO.pyx:1142"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_107setConvergedReason(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_reason = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setConvergedReason (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_reason,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_reason)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 1142, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setConvergedReason") < 0)) __PYX_ERR(52, 1142, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_reason = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setConvergedReason", 1, 1, 1, __pyx_nargs); __PYX_ERR(52, 1142, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TAO.setConvergedReason", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_106setConvergedReason(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_reason); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_106setConvergedReason(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_reason) { TaoConvergedReason __pyx_v_creason; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations TaoConvergedReason __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setConvergedReason", 1); /* "petsc4py/PETSc/TAO.pyx":1152 * * """ * cdef PetscTAOConvergedReason creason = reason # <<<<<<<<<<<<<< * CHKERR( TaoSetConvergedReason(self.tao, creason) ) * */ __pyx_t_1 = ((TaoConvergedReason)__Pyx_PyInt_As_TaoConvergedReason(__pyx_v_reason)); if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 1152, __pyx_L1_error) __pyx_v_creason = __pyx_t_1; /* "petsc4py/PETSc/TAO.pyx":1153 * """ * cdef PetscTAOConvergedReason creason = reason * CHKERR( TaoSetConvergedReason(self.tao, creason) ) # <<<<<<<<<<<<<< * * def getConvergedReason(self) -> ConvergedReason: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSetConvergedReason(__pyx_v_self->tao, __pyx_v_creason)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1153, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":1142 * return self.get_attr('__converged__') * * def setConvergedReason(self, reason: ConvergedReason) -> None: # <<<<<<<<<<<<<< * """Set the termination flag. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.setConvergedReason", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":1155 * CHKERR( TaoSetConvergedReason(self.tao, creason) ) * * def getConvergedReason(self) -> ConvergedReason: # <<<<<<<<<<<<<< * """Return the termination flag. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_109getConvergedReason(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_108getConvergedReason, "TAO.getConvergedReason(self) -> ConvergedReason\nReturn the termination flag.\n\n Not collective.\n\n See Also\n --------\n setConvergedReason, petsc.TaoGetConvergedReason\n\n \nSource code at petsc4py/PETSc/TAO.pyx:1155"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_109getConvergedReason(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getConvergedReason (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getConvergedReason", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getConvergedReason", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_108getConvergedReason(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_108getConvergedReason(struct PyPetscTAOObject *__pyx_v_self) { TaoConvergedReason __pyx_v_creason; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getConvergedReason", 1); /* "petsc4py/PETSc/TAO.pyx":1165 * * """ * cdef PetscTAOConvergedReason creason = TAO_CONTINUE_ITERATING # <<<<<<<<<<<<<< * CHKERR( TaoGetConvergedReason(self.tao, &creason) ) * return creason */ __pyx_v_creason = TAO_CONTINUE_ITERATING; /* "petsc4py/PETSc/TAO.pyx":1166 * """ * cdef PetscTAOConvergedReason creason = TAO_CONTINUE_ITERATING * CHKERR( TaoGetConvergedReason(self.tao, &creason) ) # <<<<<<<<<<<<<< * return creason * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoGetConvergedReason(__pyx_v_self->tao, (&__pyx_v_creason))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1166, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":1167 * cdef PetscTAOConvergedReason creason = TAO_CONTINUE_ITERATING * CHKERR( TaoGetConvergedReason(self.tao, &creason) ) * return creason # <<<<<<<<<<<<<< * * def setMonitor(self, monitor: TAOMonitorFunction, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_TaoConvergedReason(__pyx_v_creason); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 1167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TAO.pyx":1155 * CHKERR( TaoSetConvergedReason(self.tao, creason) ) * * def getConvergedReason(self) -> ConvergedReason: # <<<<<<<<<<<<<< * """Return the termination flag. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TAO.getConvergedReason", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":1169 * return creason * * def setMonitor(self, monitor: TAOMonitorFunction, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: # <<<<<<<<<<<<<< * """Set the callback used to monitor solver convergence. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_111setMonitor(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_110setMonitor, "TAO.setMonitor(self, monitor: TAOMonitorFunction, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nSet the callback used to monitor solver convergence.\n\n Logically collective.\n\n Parameters\n ----------\n monitor\n The callback.\n args\n Positional arguments for the callback.\n kargs\n Keyword arguments for the callback.\n\n See Also\n --------\n getMonitor, petsc.TaoSetMonitor\n\n \nSource code at petsc4py/PETSc/TAO.pyx:1169"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_111setMonitor(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_monitor = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setMonitor (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_monitor,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_monitor)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 1169, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 1169, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 1169, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setMonitor") < 0)) __PYX_ERR(52, 1169, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_monitor = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setMonitor", 0, 1, 3, __pyx_nargs); __PYX_ERR(52, 1169, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TAO.setMonitor", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_110setMonitor(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_monitor, __pyx_v_args, __pyx_v_kargs); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_110setMonitor(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_monitor, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_monitorlist = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setMonitor", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/TAO.pyx":1188 * * """ * if monitor is None: return # <<<<<<<<<<<<<< * cdef object monitorlist = self.get_attr('__monitor__') * if args is None: args = () */ __pyx_t_1 = (__pyx_v_monitor == Py_None); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } /* "petsc4py/PETSc/TAO.pyx":1189 * """ * if monitor is None: return * cdef object monitorlist = self.get_attr('__monitor__') # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__monitor__")); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 1189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_monitorlist = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/TAO.pyx":1190 * if monitor is None: return * cdef object monitorlist = self.get_attr('__monitor__') * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * if monitorlist is None: */ __pyx_t_1 = (__pyx_v_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/TAO.pyx":1191 * cdef object monitorlist = self.get_attr('__monitor__') * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * if monitorlist is None: * CHKERR( TaoSetMonitor(self.tao, TAO_Monitor, NULL, NULL) ) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); if (__pyx_t_1) { __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 1191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_2); __pyx_t_2 = 0; } /* "petsc4py/PETSc/TAO.pyx":1192 * if args is None: args = () * if kargs is None: kargs = {} * if monitorlist is None: # <<<<<<<<<<<<<< * CHKERR( TaoSetMonitor(self.tao, TAO_Monitor, NULL, NULL) ) * self.set_attr('__monitor__', [(monitor, args, kargs)]) */ __pyx_t_1 = (__pyx_v_monitorlist == Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/TAO.pyx":1193 * if kargs is None: kargs = {} * if monitorlist is None: * CHKERR( TaoSetMonitor(self.tao, TAO_Monitor, NULL, NULL) ) # <<<<<<<<<<<<<< * self.set_attr('__monitor__', [(monitor, args, kargs)]) * else: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSetMonitor(__pyx_v_self->tao, __pyx_f_8petsc4py_5PETSc_TAO_Monitor, NULL, NULL)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1193, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":1194 * if monitorlist is None: * CHKERR( TaoSetMonitor(self.tao, TAO_Monitor, NULL, NULL) ) * self.set_attr('__monitor__', [(monitor, args, kargs)]) # <<<<<<<<<<<<<< * else: * monitorlist.append((monitor, args, kargs)) */ __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 1194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_monitor); __Pyx_GIVEREF(__pyx_v_monitor); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_monitor)) __PYX_ERR(52, 1194, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_args)) __PYX_ERR(52, 1194, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_kargs)) __PYX_ERR(52, 1194, __pyx_L1_error); __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(52, 1194, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__monitor__"), __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 1194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/TAO.pyx":1192 * if args is None: args = () * if kargs is None: kargs = {} * if monitorlist is None: # <<<<<<<<<<<<<< * CHKERR( TaoSetMonitor(self.tao, TAO_Monitor, NULL, NULL) ) * self.set_attr('__monitor__', [(monitor, args, kargs)]) */ goto __pyx_L6; } /* "petsc4py/PETSc/TAO.pyx":1196 * self.set_attr('__monitor__', [(monitor, args, kargs)]) * else: * monitorlist.append((monitor, args, kargs)) # <<<<<<<<<<<<<< * * def getMonitor(self) -> list[tuple[TAOMonitorFunction, tuple[Any, ...], dict[str, Any]]]: */ /*else*/ { __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 1196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_monitor); __Pyx_GIVEREF(__pyx_v_monitor); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_monitor)) __PYX_ERR(52, 1196, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_args)) __PYX_ERR(52, 1196, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_kargs)) __PYX_ERR(52, 1196, __pyx_L1_error); __pyx_t_5 = __Pyx_PyObject_Append(__pyx_v_monitorlist, __pyx_t_2); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(52, 1196, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_L6:; /* "petsc4py/PETSc/TAO.pyx":1169 * return creason * * def setMonitor(self, monitor: TAOMonitorFunction, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: # <<<<<<<<<<<<<< * """Set the callback used to monitor solver convergence. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.TAO.setMonitor", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_monitorlist); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":1198 * monitorlist.append((monitor, args, kargs)) * * def getMonitor(self) -> list[tuple[TAOMonitorFunction, tuple[Any, ...], dict[str, Any]]]: # <<<<<<<<<<<<<< * """Return the callback used to monitor solver convergence. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_113getMonitor(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_112getMonitor, "TAO.getMonitor(self) -> list[tuple[TAOMonitorFunction, tuple[Any, ...], dict[str, Any]]]\nReturn the callback used to monitor solver convergence.\n\n Not collective.\n\n See Also\n --------\n setMonitor\n\n \nSource code at petsc4py/PETSc/TAO.pyx:1198"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_113getMonitor(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getMonitor (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getMonitor", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getMonitor", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_112getMonitor(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_112getMonitor(struct PyPetscTAOObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getMonitor", 1); /* "petsc4py/PETSc/TAO.pyx":1208 * * """ * return self.get_attr('__monitor__') # <<<<<<<<<<<<<< * * def cancelMonitor(self) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__monitor__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 1208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TAO.pyx":1198 * monitorlist.append((monitor, args, kargs)) * * def getMonitor(self) -> list[tuple[TAOMonitorFunction, tuple[Any, ...], dict[str, Any]]]: # <<<<<<<<<<<<<< * """Return the callback used to monitor solver convergence. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TAO.getMonitor", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":1210 * return self.get_attr('__monitor__') * * def cancelMonitor(self) -> None: # <<<<<<<<<<<<<< * """Cancel all the monitors of the solver. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_115cancelMonitor(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_114cancelMonitor, "TAO.cancelMonitor(self) -> None\nCancel all the monitors of the solver.\n\n Logically collective.\n\n See Also\n --------\n setMonitor, petsc.TaoCancelMonitors\n\n \nSource code at petsc4py/PETSc/TAO.pyx:1210"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_115cancelMonitor(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("cancelMonitor (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("cancelMonitor", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "cancelMonitor", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_114cancelMonitor(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_114cancelMonitor(struct PyPetscTAOObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("cancelMonitor", 1); /* "petsc4py/PETSc/TAO.pyx":1220 * * """ * CHKERR( TaoCancelMonitors(self.tao) ) # <<<<<<<<<<<<<< * self.set_attr('__monitor__', None) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoCancelMonitors(__pyx_v_self->tao)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1220, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":1221 * """ * CHKERR( TaoCancelMonitors(self.tao) ) * self.set_attr('__monitor__', None) # <<<<<<<<<<<<<< * * # Tao overwrites these statistics. Copy user defined only if present */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__monitor__"), Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 1221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/TAO.pyx":1210 * return self.get_attr('__monitor__') * * def cancelMonitor(self) -> None: # <<<<<<<<<<<<<< * """Cancel all the monitors of the solver. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TAO.cancelMonitor", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":1224 * * # Tao overwrites these statistics. Copy user defined only if present * def monitor(self, its: int = None, f: float = None, res: float = None, cnorm: float = None, step: float = None) -> None: # <<<<<<<<<<<<<< * """Monitor the solver. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_117monitor(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_116monitor, "TAO.monitor(self, its: int = None, f: float = None, res: float = None, cnorm: float = None, step: float = None) -> None\nMonitor the solver.\n\n Collective.\n\n This function should be called without arguments,\n unless users want to modify the values internally stored by the solver.\n\n Parameters\n ----------\n its\n Current number of iterations \n or `None` to use the value stored internally by the solver.\n f\n Current value of the objective function \n or `None` to use the value stored internally by the solver.\n res\n Current value of the residual norm \n or `None` to use the value stored internally by the solver.\n cnorm\n Current value of the constrains norm \n or `None` to use the value stored internally by the solver.\n step\n Current value of the step \n or `None` to use the value stored internally by the solver.\n\n See Also\n --------\n setMonitor, petsc.TaoMonitor\n\n \nSource code at petsc4py/PETSc/TAO.pyx:1224"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_117monitor(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_its = 0; PyObject *__pyx_v_f = 0; PyObject *__pyx_v_res = 0; PyObject *__pyx_v_cnorm = 0; PyObject *__pyx_v_step = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("monitor (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_its,&__pyx_n_s_f,&__pyx_n_s_res,&__pyx_n_s_cnorm,&__pyx_n_s_step,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_its); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 1224, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_f); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 1224, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_res); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 1224, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_cnorm); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 1224, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_step); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 1224, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "monitor") < 0)) __PYX_ERR(52, 1224, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_its = values[0]; __pyx_v_f = values[1]; __pyx_v_res = values[2]; __pyx_v_cnorm = values[3]; __pyx_v_step = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("monitor", 0, 0, 5, __pyx_nargs); __PYX_ERR(52, 1224, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TAO.monitor", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_116monitor(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_its, __pyx_v_f, __pyx_v_res, __pyx_v_cnorm, __pyx_v_step); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_116monitor(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_its, PyObject *__pyx_v_f, PyObject *__pyx_v_res, PyObject *__pyx_v_cnorm, PyObject *__pyx_v_step) { PetscInt __pyx_v_cits; PetscReal __pyx_v_cf; PetscReal __pyx_v_cres; PetscReal __pyx_v_ccnorm; PetscReal __pyx_v_cstep; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_t_2; PetscInt __pyx_t_3; PetscReal __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("monitor", 1); /* "petsc4py/PETSc/TAO.pyx":1255 * * """ * cdef PetscInt cits = 0 # <<<<<<<<<<<<<< * cdef PetscReal cf = 0.0 * cdef PetscReal cres = 0.0 */ __pyx_v_cits = 0; /* "petsc4py/PETSc/TAO.pyx":1256 * """ * cdef PetscInt cits = 0 * cdef PetscReal cf = 0.0 # <<<<<<<<<<<<<< * cdef PetscReal cres = 0.0 * cdef PetscReal ccnorm = 0.0 */ __pyx_v_cf = 0.0; /* "petsc4py/PETSc/TAO.pyx":1257 * cdef PetscInt cits = 0 * cdef PetscReal cf = 0.0 * cdef PetscReal cres = 0.0 # <<<<<<<<<<<<<< * cdef PetscReal ccnorm = 0.0 * cdef PetscReal cstep = 0.0 */ __pyx_v_cres = 0.0; /* "petsc4py/PETSc/TAO.pyx":1258 * cdef PetscReal cf = 0.0 * cdef PetscReal cres = 0.0 * cdef PetscReal ccnorm = 0.0 # <<<<<<<<<<<<<< * cdef PetscReal cstep = 0.0 * CHKERR( TaoGetSolutionStatus(self.tao, &cits, &cf, &cres, &ccnorm, &cstep, NULL) ) */ __pyx_v_ccnorm = 0.0; /* "petsc4py/PETSc/TAO.pyx":1259 * cdef PetscReal cres = 0.0 * cdef PetscReal ccnorm = 0.0 * cdef PetscReal cstep = 0.0 # <<<<<<<<<<<<<< * CHKERR( TaoGetSolutionStatus(self.tao, &cits, &cf, &cres, &ccnorm, &cstep, NULL) ) * if its is not None: */ __pyx_v_cstep = 0.0; /* "petsc4py/PETSc/TAO.pyx":1260 * cdef PetscReal ccnorm = 0.0 * cdef PetscReal cstep = 0.0 * CHKERR( TaoGetSolutionStatus(self.tao, &cits, &cf, &cres, &ccnorm, &cstep, NULL) ) # <<<<<<<<<<<<<< * if its is not None: * cits = asInt(its) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoGetSolutionStatus(__pyx_v_self->tao, (&__pyx_v_cits), (&__pyx_v_cf), (&__pyx_v_cres), (&__pyx_v_ccnorm), (&__pyx_v_cstep), NULL)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1260, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":1261 * cdef PetscReal cstep = 0.0 * CHKERR( TaoGetSolutionStatus(self.tao, &cits, &cf, &cres, &ccnorm, &cstep, NULL) ) * if its is not None: # <<<<<<<<<<<<<< * cits = asInt(its) * if f is not None: */ __pyx_t_2 = (__pyx_v_its != Py_None); if (__pyx_t_2) { /* "petsc4py/PETSc/TAO.pyx":1262 * CHKERR( TaoGetSolutionStatus(self.tao, &cits, &cf, &cres, &ccnorm, &cstep, NULL) ) * if its is not None: * cits = asInt(its) # <<<<<<<<<<<<<< * if f is not None: * cf = asReal(f) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_its); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(52, 1262, __pyx_L1_error) __pyx_v_cits = __pyx_t_3; /* "petsc4py/PETSc/TAO.pyx":1261 * cdef PetscReal cstep = 0.0 * CHKERR( TaoGetSolutionStatus(self.tao, &cits, &cf, &cres, &ccnorm, &cstep, NULL) ) * if its is not None: # <<<<<<<<<<<<<< * cits = asInt(its) * if f is not None: */ } /* "petsc4py/PETSc/TAO.pyx":1263 * if its is not None: * cits = asInt(its) * if f is not None: # <<<<<<<<<<<<<< * cf = asReal(f) * if res is not None: */ __pyx_t_2 = (__pyx_v_f != Py_None); if (__pyx_t_2) { /* "petsc4py/PETSc/TAO.pyx":1264 * cits = asInt(its) * if f is not None: * cf = asReal(f) # <<<<<<<<<<<<<< * if res is not None: * cres = asReal(res) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_f); if (unlikely(__pyx_t_4 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(52, 1264, __pyx_L1_error) __pyx_v_cf = __pyx_t_4; /* "petsc4py/PETSc/TAO.pyx":1263 * if its is not None: * cits = asInt(its) * if f is not None: # <<<<<<<<<<<<<< * cf = asReal(f) * if res is not None: */ } /* "petsc4py/PETSc/TAO.pyx":1265 * if f is not None: * cf = asReal(f) * if res is not None: # <<<<<<<<<<<<<< * cres = asReal(res) * if cnorm is not None: */ __pyx_t_2 = (__pyx_v_res != Py_None); if (__pyx_t_2) { /* "petsc4py/PETSc/TAO.pyx":1266 * cf = asReal(f) * if res is not None: * cres = asReal(res) # <<<<<<<<<<<<<< * if cnorm is not None: * ccnorm = asReal(cnorm) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_res); if (unlikely(__pyx_t_4 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(52, 1266, __pyx_L1_error) __pyx_v_cres = __pyx_t_4; /* "petsc4py/PETSc/TAO.pyx":1265 * if f is not None: * cf = asReal(f) * if res is not None: # <<<<<<<<<<<<<< * cres = asReal(res) * if cnorm is not None: */ } /* "petsc4py/PETSc/TAO.pyx":1267 * if res is not None: * cres = asReal(res) * if cnorm is not None: # <<<<<<<<<<<<<< * ccnorm = asReal(cnorm) * if step is not None: */ __pyx_t_2 = (__pyx_v_cnorm != Py_None); if (__pyx_t_2) { /* "petsc4py/PETSc/TAO.pyx":1268 * cres = asReal(res) * if cnorm is not None: * ccnorm = asReal(cnorm) # <<<<<<<<<<<<<< * if step is not None: * cstep = asReal(step) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_cnorm); if (unlikely(__pyx_t_4 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(52, 1268, __pyx_L1_error) __pyx_v_ccnorm = __pyx_t_4; /* "petsc4py/PETSc/TAO.pyx":1267 * if res is not None: * cres = asReal(res) * if cnorm is not None: # <<<<<<<<<<<<<< * ccnorm = asReal(cnorm) * if step is not None: */ } /* "petsc4py/PETSc/TAO.pyx":1269 * if cnorm is not None: * ccnorm = asReal(cnorm) * if step is not None: # <<<<<<<<<<<<<< * cstep = asReal(step) * CHKERR( TaoMonitor(self.tao, cits, cf, cres, ccnorm, cstep) ) */ __pyx_t_2 = (__pyx_v_step != Py_None); if (__pyx_t_2) { /* "petsc4py/PETSc/TAO.pyx":1270 * ccnorm = asReal(cnorm) * if step is not None: * cstep = asReal(step) # <<<<<<<<<<<<<< * CHKERR( TaoMonitor(self.tao, cits, cf, cres, ccnorm, cstep) ) * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_step); if (unlikely(__pyx_t_4 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(52, 1270, __pyx_L1_error) __pyx_v_cstep = __pyx_t_4; /* "petsc4py/PETSc/TAO.pyx":1269 * if cnorm is not None: * ccnorm = asReal(cnorm) * if step is not None: # <<<<<<<<<<<<<< * cstep = asReal(step) * CHKERR( TaoMonitor(self.tao, cits, cf, cres, ccnorm, cstep) ) */ } /* "petsc4py/PETSc/TAO.pyx":1271 * if step is not None: * cstep = asReal(step) * CHKERR( TaoMonitor(self.tao, cits, cf, cres, ccnorm, cstep) ) # <<<<<<<<<<<<<< * * # */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoMonitor(__pyx_v_self->tao, __pyx_v_cits, __pyx_v_cf, __pyx_v_cres, __pyx_v_ccnorm, __pyx_v_cstep)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1271, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":1224 * * # Tao overwrites these statistics. Copy user defined only if present * def monitor(self, its: int = None, f: float = None, res: float = None, cnorm: float = None, step: float = None) -> None: # <<<<<<<<<<<<<< * """Monitor the solver. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.monitor", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":1275 * # * * def solve(self, Vec x=None) -> None: # <<<<<<<<<<<<<< * """Solve the optimization problem. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_119solve(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_118solve, "TAO.solve(self, x: Vec | None = None) -> None\nSolve the optimization problem.\n\n Collective.\n\n Parameters\n ----------\n x\n The starting vector or `None` to use the vector stored internally.\n\n See Also\n --------\n setSolution, getSolution, petsc.TaoSolve\n\n \nSource code at petsc4py/PETSc/TAO.pyx:1275"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_119solve(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_x = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("solve (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscVecObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 1275, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "solve") < 0)) __PYX_ERR(52, 1275, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_x = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("solve", 0, 0, 1, __pyx_nargs); __PYX_ERR(52, 1275, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TAO.solve", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "x", 0))) __PYX_ERR(52, 1275, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_118solve(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_x); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_118solve(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("solve", 1); /* "petsc4py/PETSc/TAO.pyx":1290 * * """ * if x is not None: # <<<<<<<<<<<<<< * CHKERR( TaoSetSolution(self.tao, x.vec) ) * CHKERR( TaoSolve(self.tao) ) */ __pyx_t_1 = (((PyObject *)__pyx_v_x) != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/TAO.pyx":1291 * """ * if x is not None: * CHKERR( TaoSetSolution(self.tao, x.vec) ) # <<<<<<<<<<<<<< * CHKERR( TaoSolve(self.tao) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSetSolution(__pyx_v_self->tao, __pyx_v_x->vec)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1291, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":1290 * * """ * if x is not None: # <<<<<<<<<<<<<< * CHKERR( TaoSetSolution(self.tao, x.vec) ) * CHKERR( TaoSolve(self.tao) ) */ } /* "petsc4py/PETSc/TAO.pyx":1292 * if x is not None: * CHKERR( TaoSetSolution(self.tao, x.vec) ) * CHKERR( TaoSolve(self.tao) ) # <<<<<<<<<<<<<< * * def getSolution(self) -> Vec: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSolve(__pyx_v_self->tao)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1292, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":1275 * # * * def solve(self, Vec x=None) -> None: # <<<<<<<<<<<<<< * """Solve the optimization problem. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.solve", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":1294 * CHKERR( TaoSolve(self.tao) ) * * def getSolution(self) -> Vec: # <<<<<<<<<<<<<< * """Return the vector holding the solution. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_121getSolution(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_120getSolution, "TAO.getSolution(self) -> Vec\nReturn the vector holding the solution.\n\n Not collective.\n\n See Also\n --------\n setSolution, petsc.TaoGetSolution\n\n \nSource code at petsc4py/PETSc/TAO.pyx:1294"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_121getSolution(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSolution (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getSolution", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getSolution", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_120getSolution(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_120getSolution(struct PyPetscTAOObject *__pyx_v_self) { struct PyPetscVecObject *__pyx_v_vec = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSolution", 1); /* "petsc4py/PETSc/TAO.pyx":1304 * * """ * cdef Vec vec = Vec() # <<<<<<<<<<<<<< * CHKERR( TaoGetSolution(self.tao, &vec.vec) ) * CHKERR( PetscINCREF(vec.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 1304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/TAO.pyx":1305 * """ * cdef Vec vec = Vec() * CHKERR( TaoGetSolution(self.tao, &vec.vec) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(vec.obj) ) * return vec */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoGetSolution(__pyx_v_self->tao, (&__pyx_v_vec->vec))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1305, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":1306 * cdef Vec vec = Vec() * CHKERR( TaoGetSolution(self.tao, &vec.vec) ) * CHKERR( PetscINCREF(vec.obj) ) # <<<<<<<<<<<<<< * return vec * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_vec->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1306, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":1307 * CHKERR( TaoGetSolution(self.tao, &vec.vec) ) * CHKERR( PetscINCREF(vec.obj) ) * return vec # <<<<<<<<<<<<<< * * def setGradientNorm(self, Mat mat) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_vec); __pyx_r = ((PyObject *)__pyx_v_vec); goto __pyx_L0; /* "petsc4py/PETSc/TAO.pyx":1294 * CHKERR( TaoSolve(self.tao) ) * * def getSolution(self) -> Vec: # <<<<<<<<<<<<<< * """Return the vector holding the solution. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TAO.getSolution", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_vec); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":1309 * return vec * * def setGradientNorm(self, Mat mat) -> None: # <<<<<<<<<<<<<< * """Set the matrix used to compute inner products. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_123setGradientNorm(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_122setGradientNorm, "TAO.setGradientNorm(self, mat: Mat) -> None\nSet the matrix used to compute inner products.\n\n Collective.\n\n See Also\n --------\n getGradientNorm, petsc.TaoSetGradientNorm\n\n \nSource code at petsc4py/PETSc/TAO.pyx:1309"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_123setGradientNorm(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscMatObject *__pyx_v_mat = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setGradientNorm (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mat)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 1309, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setGradientNorm") < 0)) __PYX_ERR(52, 1309, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_mat = ((struct PyPetscMatObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setGradientNorm", 1, 1, 1, __pyx_nargs); __PYX_ERR(52, 1309, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TAO.setGradientNorm", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(52, 1309, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_122setGradientNorm(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_mat); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_122setGradientNorm(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setGradientNorm", 1); /* "petsc4py/PETSc/TAO.pyx":1319 * * """ * CHKERR( TaoSetGradientNorm(self.tao, mat.mat) ) # <<<<<<<<<<<<<< * * def getGradientNorm(self) -> Mat: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSetGradientNorm(__pyx_v_self->tao, __pyx_v_mat->mat)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1319, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":1309 * return vec * * def setGradientNorm(self, Mat mat) -> None: # <<<<<<<<<<<<<< * """Set the matrix used to compute inner products. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.setGradientNorm", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":1321 * CHKERR( TaoSetGradientNorm(self.tao, mat.mat) ) * * def getGradientNorm(self) -> Mat: # <<<<<<<<<<<<<< * """Return the matrix used to compute inner products. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_125getGradientNorm(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_124getGradientNorm, "TAO.getGradientNorm(self) -> Mat\nReturn the matrix used to compute inner products.\n\n Not collective.\n\n See Also\n --------\n setGradientNorm, petsc.TaoGetGradientNorm\n\n \nSource code at petsc4py/PETSc/TAO.pyx:1321"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_125getGradientNorm(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getGradientNorm (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getGradientNorm", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getGradientNorm", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_124getGradientNorm(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_124getGradientNorm(struct PyPetscTAOObject *__pyx_v_self) { struct PyPetscMatObject *__pyx_v_mat = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getGradientNorm", 1); /* "petsc4py/PETSc/TAO.pyx":1331 * * """ * cdef Mat mat = Mat() # <<<<<<<<<<<<<< * CHKERR( TaoGetGradientNorm(self.tao, &mat.mat) ) * CHKERR( PetscINCREF(mat.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 1331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_mat = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/TAO.pyx":1332 * """ * cdef Mat mat = Mat() * CHKERR( TaoGetGradientNorm(self.tao, &mat.mat) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(mat.obj) ) * return mat */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoGetGradientNorm(__pyx_v_self->tao, (&__pyx_v_mat->mat))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1332, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":1333 * cdef Mat mat = Mat() * CHKERR( TaoGetGradientNorm(self.tao, &mat.mat) ) * CHKERR( PetscINCREF(mat.obj) ) # <<<<<<<<<<<<<< * return mat * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_mat->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1333, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":1334 * CHKERR( TaoGetGradientNorm(self.tao, &mat.mat) ) * CHKERR( PetscINCREF(mat.obj) ) * return mat # <<<<<<<<<<<<<< * * def setLMVMH0(self, Mat mat) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_mat); __pyx_r = ((PyObject *)__pyx_v_mat); goto __pyx_L0; /* "petsc4py/PETSc/TAO.pyx":1321 * CHKERR( TaoSetGradientNorm(self.tao, mat.mat) ) * * def getGradientNorm(self) -> Mat: # <<<<<<<<<<<<<< * """Return the matrix used to compute inner products. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TAO.getGradientNorm", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_mat); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":1336 * return mat * * def setLMVMH0(self, Mat mat) -> None: # <<<<<<<<<<<<<< * """Set the initial Hessian for the quasi-Newton approximation. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_127setLMVMH0(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_126setLMVMH0, "TAO.setLMVMH0(self, mat: Mat) -> None\nSet the initial Hessian for the quasi-Newton approximation.\n\n Collective.\n\n See Also\n --------\n getLMVMH0, petsc.TaoLMVMSetH0\n\n \nSource code at petsc4py/PETSc/TAO.pyx:1336"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_127setLMVMH0(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscMatObject *__pyx_v_mat = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setLMVMH0 (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mat)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 1336, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setLMVMH0") < 0)) __PYX_ERR(52, 1336, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_mat = ((struct PyPetscMatObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setLMVMH0", 1, 1, 1, __pyx_nargs); __PYX_ERR(52, 1336, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TAO.setLMVMH0", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(52, 1336, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_126setLMVMH0(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_mat); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_126setLMVMH0(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setLMVMH0", 1); /* "petsc4py/PETSc/TAO.pyx":1346 * * """ * CHKERR( TaoLMVMSetH0(self.tao, mat.mat) ) # <<<<<<<<<<<<<< * * def getLMVMH0(self) -> Mat: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoLMVMSetH0(__pyx_v_self->tao, __pyx_v_mat->mat)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1346, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":1336 * return mat * * def setLMVMH0(self, Mat mat) -> None: # <<<<<<<<<<<<<< * """Set the initial Hessian for the quasi-Newton approximation. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.setLMVMH0", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":1348 * CHKERR( TaoLMVMSetH0(self.tao, mat.mat) ) * * def getLMVMH0(self) -> Mat: # <<<<<<<<<<<<<< * """Return the initial Hessian for the quasi-Newton approximation. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_129getLMVMH0(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_128getLMVMH0, "TAO.getLMVMH0(self) -> Mat\nReturn the initial Hessian for the quasi-Newton approximation.\n\n Not collective.\n\n See Also\n --------\n setLMVMH0, petsc.TaoLMVMGetH0\n\n \nSource code at petsc4py/PETSc/TAO.pyx:1348"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_129getLMVMH0(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getLMVMH0 (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getLMVMH0", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getLMVMH0", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_128getLMVMH0(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_128getLMVMH0(struct PyPetscTAOObject *__pyx_v_self) { struct PyPetscMatObject *__pyx_v_mat = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getLMVMH0", 1); /* "petsc4py/PETSc/TAO.pyx":1358 * * """ * cdef Mat mat = Mat() # <<<<<<<<<<<<<< * CHKERR( TaoLMVMGetH0(self.tao, &mat.mat) ) * CHKERR( PetscINCREF(mat.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 1358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_mat = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/TAO.pyx":1359 * """ * cdef Mat mat = Mat() * CHKERR( TaoLMVMGetH0(self.tao, &mat.mat) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(mat.obj) ) * return mat */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoLMVMGetH0(__pyx_v_self->tao, (&__pyx_v_mat->mat))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1359, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":1360 * cdef Mat mat = Mat() * CHKERR( TaoLMVMGetH0(self.tao, &mat.mat) ) * CHKERR( PetscINCREF(mat.obj) ) # <<<<<<<<<<<<<< * return mat * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_mat->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1360, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":1361 * CHKERR( TaoLMVMGetH0(self.tao, &mat.mat) ) * CHKERR( PetscINCREF(mat.obj) ) * return mat # <<<<<<<<<<<<<< * * def getLMVMH0KSP(self) -> KSP: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_mat); __pyx_r = ((PyObject *)__pyx_v_mat); goto __pyx_L0; /* "petsc4py/PETSc/TAO.pyx":1348 * CHKERR( TaoLMVMSetH0(self.tao, mat.mat) ) * * def getLMVMH0(self) -> Mat: # <<<<<<<<<<<<<< * """Return the initial Hessian for the quasi-Newton approximation. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TAO.getLMVMH0", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_mat); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":1363 * return mat * * def getLMVMH0KSP(self) -> KSP: # <<<<<<<<<<<<<< * """Return the `KSP` for the inverse of the initial Hessian approximation. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_131getLMVMH0KSP(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_130getLMVMH0KSP, "TAO.getLMVMH0KSP(self) -> KSP\nReturn the `KSP` for the inverse of the initial Hessian approximation.\n\n Not collective.\n\n See Also\n --------\n setLMVMH0, petsc.TaoLMVMGetH0KSP\n\n \nSource code at petsc4py/PETSc/TAO.pyx:1363"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_131getLMVMH0KSP(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getLMVMH0KSP (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getLMVMH0KSP", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getLMVMH0KSP", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_130getLMVMH0KSP(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_130getLMVMH0KSP(struct PyPetscTAOObject *__pyx_v_self) { struct PyPetscKSPObject *__pyx_v_ksp = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getLMVMH0KSP", 1); /* "petsc4py/PETSc/TAO.pyx":1373 * * """ * cdef KSP ksp = KSP() # <<<<<<<<<<<<<< * CHKERR( TaoLMVMGetH0KSP(self.tao, &ksp.ksp) ) * CHKERR( PetscINCREF(ksp.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_KSP)); if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 1373, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ksp = ((struct PyPetscKSPObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/TAO.pyx":1374 * """ * cdef KSP ksp = KSP() * CHKERR( TaoLMVMGetH0KSP(self.tao, &ksp.ksp) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(ksp.obj) ) * return ksp */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoLMVMGetH0KSP(__pyx_v_self->tao, (&__pyx_v_ksp->ksp))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1374, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":1375 * cdef KSP ksp = KSP() * CHKERR( TaoLMVMGetH0KSP(self.tao, &ksp.ksp) ) * CHKERR( PetscINCREF(ksp.obj) ) # <<<<<<<<<<<<<< * return ksp * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ksp->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1375, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":1376 * CHKERR( TaoLMVMGetH0KSP(self.tao, &ksp.ksp) ) * CHKERR( PetscINCREF(ksp.obj) ) * return ksp # <<<<<<<<<<<<<< * * def getVariableBounds(self) -> tuple[Vec, Vec]: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_ksp); __pyx_r = ((PyObject *)__pyx_v_ksp); goto __pyx_L0; /* "petsc4py/PETSc/TAO.pyx":1363 * return mat * * def getLMVMH0KSP(self) -> KSP: # <<<<<<<<<<<<<< * """Return the `KSP` for the inverse of the initial Hessian approximation. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TAO.getLMVMH0KSP", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ksp); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":1378 * return ksp * * def getVariableBounds(self) -> tuple[Vec, Vec]: # <<<<<<<<<<<<<< * """Return the upper and lower bounds vectors. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_133getVariableBounds(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_132getVariableBounds, "TAO.getVariableBounds(self) -> tuple[Vec, Vec]\nReturn the upper and lower bounds vectors.\n\n Not collective.\n\n See Also\n --------\n setVariableBounds, petsc.TaoGetVariableBounds\n\n \nSource code at petsc4py/PETSc/TAO.pyx:1378"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_133getVariableBounds(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getVariableBounds (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getVariableBounds", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getVariableBounds", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_132getVariableBounds(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_132getVariableBounds(struct PyPetscTAOObject *__pyx_v_self) { struct PyPetscVecObject *__pyx_v_xl = 0; struct PyPetscVecObject *__pyx_v_xu = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getVariableBounds", 1); /* "petsc4py/PETSc/TAO.pyx":1388 * * """ * cdef Vec xl = Vec(), xu = Vec() # <<<<<<<<<<<<<< * CHKERR( TaoGetVariableBounds(self.tao, &xl.vec, &xu.vec) ) * CHKERR( PetscINCREF(xl.obj) ); CHKERR( PetscINCREF(xu.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 1388, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_xl = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 1388, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_xu = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/TAO.pyx":1389 * """ * cdef Vec xl = Vec(), xu = Vec() * CHKERR( TaoGetVariableBounds(self.tao, &xl.vec, &xu.vec) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(xl.obj) ); CHKERR( PetscINCREF(xu.obj) ) * return (xl, xu) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoGetVariableBounds(__pyx_v_self->tao, (&__pyx_v_xl->vec), (&__pyx_v_xu->vec))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1389, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":1390 * cdef Vec xl = Vec(), xu = Vec() * CHKERR( TaoGetVariableBounds(self.tao, &xl.vec, &xu.vec) ) * CHKERR( PetscINCREF(xl.obj) ); CHKERR( PetscINCREF(xu.obj) ) # <<<<<<<<<<<<<< * return (xl, xu) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_xl->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1390, __pyx_L1_error) __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_xu->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1390, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":1391 * CHKERR( TaoGetVariableBounds(self.tao, &xl.vec, &xu.vec) ) * CHKERR( PetscINCREF(xl.obj) ); CHKERR( PetscINCREF(xu.obj) ) * return (xl, xu) # <<<<<<<<<<<<<< * * def setBNCGType(self, cg_type: BNCGType) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 1391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF((PyObject *)__pyx_v_xl); __Pyx_GIVEREF((PyObject *)__pyx_v_xl); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_xl))) __PYX_ERR(52, 1391, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_xu); __Pyx_GIVEREF((PyObject *)__pyx_v_xu); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_xu))) __PYX_ERR(52, 1391, __pyx_L1_error); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TAO.pyx":1378 * return ksp * * def getVariableBounds(self) -> tuple[Vec, Vec]: # <<<<<<<<<<<<<< * """Return the upper and lower bounds vectors. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TAO.getVariableBounds", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_xl); __Pyx_XDECREF((PyObject *)__pyx_v_xu); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":1393 * return (xl, xu) * * def setBNCGType(self, cg_type: BNCGType) -> None: # <<<<<<<<<<<<<< * """Set the type of the BNCG solver. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_135setBNCGType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_134setBNCGType, "TAO.setBNCGType(self, cg_type: BNCGType) -> None\nSet the type of the BNCG solver.\n\n Collective.\n\n See Also\n --------\n getBNCGType, petsc.TaoBNCGSetType\n\n \nSource code at petsc4py/PETSc/TAO.pyx:1393"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_135setBNCGType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_cg_type = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setBNCGType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cg_type,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_cg_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 1393, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setBNCGType") < 0)) __PYX_ERR(52, 1393, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_cg_type = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setBNCGType", 1, 1, 1, __pyx_nargs); __PYX_ERR(52, 1393, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TAO.setBNCGType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_134setBNCGType(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_cg_type); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_134setBNCGType(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_cg_type) { TaoBNCGType __pyx_v_ctype; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations TaoBNCGType __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setBNCGType", 1); /* "petsc4py/PETSc/TAO.pyx":1403 * * """ * cdef PetscTAOBNCGType ctype = cg_type # <<<<<<<<<<<<<< * CHKERR( TaoBNCGSetType(self.tao, ctype) ) * */ __pyx_t_1 = ((TaoBNCGType)__Pyx_PyInt_As_TaoBNCGType(__pyx_v_cg_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 1403, __pyx_L1_error) __pyx_v_ctype = __pyx_t_1; /* "petsc4py/PETSc/TAO.pyx":1404 * """ * cdef PetscTAOBNCGType ctype = cg_type * CHKERR( TaoBNCGSetType(self.tao, ctype) ) # <<<<<<<<<<<<<< * * def getBNCGType(self) -> BNCGType: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoBNCGSetType(__pyx_v_self->tao, __pyx_v_ctype)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1404, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":1393 * return (xl, xu) * * def setBNCGType(self, cg_type: BNCGType) -> None: # <<<<<<<<<<<<<< * """Set the type of the BNCG solver. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.setBNCGType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":1406 * CHKERR( TaoBNCGSetType(self.tao, ctype) ) * * def getBNCGType(self) -> BNCGType: # <<<<<<<<<<<<<< * """Return the type of the BNCG solver. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_137getBNCGType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_136getBNCGType, "TAO.getBNCGType(self) -> BNCGType\nReturn the type of the BNCG solver.\n\n Not collective.\n\n See Also\n --------\n setBNCGType, petsc.TaoBNCGGetType\n\n \nSource code at petsc4py/PETSc/TAO.pyx:1406"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_137getBNCGType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getBNCGType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getBNCGType", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getBNCGType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_136getBNCGType(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_136getBNCGType(struct PyPetscTAOObject *__pyx_v_self) { TaoBNCGType __pyx_v_cg_type; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getBNCGType", 1); /* "petsc4py/PETSc/TAO.pyx":1416 * * """ * cdef PetscTAOBNCGType cg_type = TAO_BNCG_SSML_BFGS # <<<<<<<<<<<<<< * CHKERR( TaoBNCGGetType(self.tao, &cg_type) ) * return cg_type */ __pyx_v_cg_type = TAO_BNCG_SSML_BFGS; /* "petsc4py/PETSc/TAO.pyx":1417 * """ * cdef PetscTAOBNCGType cg_type = TAO_BNCG_SSML_BFGS * CHKERR( TaoBNCGGetType(self.tao, &cg_type) ) # <<<<<<<<<<<<<< * return cg_type * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoBNCGGetType(__pyx_v_self->tao, (&__pyx_v_cg_type))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1417, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":1418 * cdef PetscTAOBNCGType cg_type = TAO_BNCG_SSML_BFGS * CHKERR( TaoBNCGGetType(self.tao, &cg_type) ) * return cg_type # <<<<<<<<<<<<<< * * def setIterationNumber(self, its: int) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_TaoBNCGType(__pyx_v_cg_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 1418, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TAO.pyx":1406 * CHKERR( TaoBNCGSetType(self.tao, ctype) ) * * def getBNCGType(self) -> BNCGType: # <<<<<<<<<<<<<< * """Return the type of the BNCG solver. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TAO.getBNCGType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":1420 * return cg_type * * def setIterationNumber(self, its: int) -> None: # <<<<<<<<<<<<<< * """Set the current iteration number. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_139setIterationNumber(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_138setIterationNumber, "TAO.setIterationNumber(self, its: int) -> None\nSet the current iteration number.\n\n Collective.\n\n See Also\n --------\n getIterationNumber, petsc.TaoSetIterationNumber\n\n \nSource code at petsc4py/PETSc/TAO.pyx:1420"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_139setIterationNumber(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_its = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setIterationNumber (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_its,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_its)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 1420, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setIterationNumber") < 0)) __PYX_ERR(52, 1420, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_its = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setIterationNumber", 1, 1, 1, __pyx_nargs); __PYX_ERR(52, 1420, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TAO.setIterationNumber", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_138setIterationNumber(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_its); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_138setIterationNumber(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_its) { PetscInt __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setIterationNumber", 1); /* "petsc4py/PETSc/TAO.pyx":1430 * * """ * cdef PetscInt ival = asInt(its) # <<<<<<<<<<<<<< * CHKERR( TaoSetIterationNumber(self.tao, ival) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_its); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(52, 1430, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "petsc4py/PETSc/TAO.pyx":1431 * """ * cdef PetscInt ival = asInt(its) * CHKERR( TaoSetIterationNumber(self.tao, ival) ) # <<<<<<<<<<<<<< * * def getIterationNumber(self) -> int: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSetIterationNumber(__pyx_v_self->tao, __pyx_v_ival)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1431, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":1420 * return cg_type * * def setIterationNumber(self, its: int) -> None: # <<<<<<<<<<<<<< * """Set the current iteration number. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.setIterationNumber", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":1433 * CHKERR( TaoSetIterationNumber(self.tao, ival) ) * * def getIterationNumber(self) -> int: # <<<<<<<<<<<<<< * """Return the current iteration number. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_141getIterationNumber(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_140getIterationNumber, "TAO.getIterationNumber(self) -> int\nReturn the current iteration number.\n\n Not collective.\n\n See Also\n --------\n setIterationNumber, petsc.TaoGetIterationNumber\n\n \nSource code at petsc4py/PETSc/TAO.pyx:1433"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_141getIterationNumber(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getIterationNumber (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getIterationNumber", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getIterationNumber", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_140getIterationNumber(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_140getIterationNumber(struct PyPetscTAOObject *__pyx_v_self) { PetscInt __pyx_v_its; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getIterationNumber", 1); /* "petsc4py/PETSc/TAO.pyx":1443 * * """ * cdef PetscInt its=0 # <<<<<<<<<<<<<< * CHKERR( TaoGetIterationNumber(self.tao, &its) ) * return toInt(its) */ __pyx_v_its = 0; /* "petsc4py/PETSc/TAO.pyx":1444 * """ * cdef PetscInt its=0 * CHKERR( TaoGetIterationNumber(self.tao, &its) ) # <<<<<<<<<<<<<< * return toInt(its) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoGetIterationNumber(__pyx_v_self->tao, (&__pyx_v_its))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1444, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":1445 * cdef PetscInt its=0 * CHKERR( TaoGetIterationNumber(self.tao, &its) ) * return toInt(its) # <<<<<<<<<<<<<< * * def getObjectiveValue(self) -> float: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_its); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 1445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TAO.pyx":1433 * CHKERR( TaoSetIterationNumber(self.tao, ival) ) * * def getIterationNumber(self) -> int: # <<<<<<<<<<<<<< * """Return the current iteration number. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TAO.getIterationNumber", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":1447 * return toInt(its) * * def getObjectiveValue(self) -> float: # <<<<<<<<<<<<<< * """Return the current value of the objective function. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_143getObjectiveValue(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_142getObjectiveValue, "TAO.getObjectiveValue(self) -> float\nReturn the current value of the objective function.\n\n Not collective.\n\n See Also\n --------\n setObjective, petsc.TaoGetSolutionStatus\n\n \nSource code at petsc4py/PETSc/TAO.pyx:1447"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_143getObjectiveValue(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getObjectiveValue (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getObjectiveValue", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getObjectiveValue", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_142getObjectiveValue(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_142getObjectiveValue(struct PyPetscTAOObject *__pyx_v_self) { PetscReal __pyx_v_fval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getObjectiveValue", 1); /* "petsc4py/PETSc/TAO.pyx":1457 * * """ * cdef PetscReal fval=0 # <<<<<<<<<<<<<< * CHKERR( TaoGetSolutionStatus(self.tao, NULL, &fval, NULL, NULL, NULL, NULL) ) * return toReal(fval) */ __pyx_v_fval = 0.0; /* "petsc4py/PETSc/TAO.pyx":1458 * """ * cdef PetscReal fval=0 * CHKERR( TaoGetSolutionStatus(self.tao, NULL, &fval, NULL, NULL, NULL, NULL) ) # <<<<<<<<<<<<<< * return toReal(fval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoGetSolutionStatus(__pyx_v_self->tao, NULL, (&__pyx_v_fval), NULL, NULL, NULL, NULL)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1458, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":1459 * cdef PetscReal fval=0 * CHKERR( TaoGetSolutionStatus(self.tao, NULL, &fval, NULL, NULL, NULL, NULL) ) * return toReal(fval) # <<<<<<<<<<<<<< * * getFunctionValue = getObjectiveValue */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_fval); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 1459, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TAO.pyx":1447 * return toInt(its) * * def getObjectiveValue(self) -> float: # <<<<<<<<<<<<<< * """Return the current value of the objective function. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TAO.getObjectiveValue", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":1463 * getFunctionValue = getObjectiveValue * * def getConvergedReason(self) -> ConvergedReason: # <<<<<<<<<<<<<< * """Return the reason for the solver convergence. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_145getConvergedReason(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_144getConvergedReason, "TAO.getConvergedReason(self) -> ConvergedReason\nReturn the reason for the solver convergence.\n\n Not collective.\n\n See Also\n --------\n petsc.TaoGetConvergedReason\n\n \nSource code at petsc4py/PETSc/TAO.pyx:1463"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_145getConvergedReason(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getConvergedReason (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getConvergedReason", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getConvergedReason", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_144getConvergedReason(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_144getConvergedReason(struct PyPetscTAOObject *__pyx_v_self) { TaoConvergedReason __pyx_v_reason; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getConvergedReason", 1); /* "petsc4py/PETSc/TAO.pyx":1473 * * """ * cdef PetscTAOConvergedReason reason = TAO_CONTINUE_ITERATING # <<<<<<<<<<<<<< * CHKERR( TaoGetConvergedReason(self.tao, &reason) ) * return reason */ __pyx_v_reason = TAO_CONTINUE_ITERATING; /* "petsc4py/PETSc/TAO.pyx":1474 * """ * cdef PetscTAOConvergedReason reason = TAO_CONTINUE_ITERATING * CHKERR( TaoGetConvergedReason(self.tao, &reason) ) # <<<<<<<<<<<<<< * return reason * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoGetConvergedReason(__pyx_v_self->tao, (&__pyx_v_reason))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1474, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":1475 * cdef PetscTAOConvergedReason reason = TAO_CONTINUE_ITERATING * CHKERR( TaoGetConvergedReason(self.tao, &reason) ) * return reason # <<<<<<<<<<<<<< * * def getSolutionNorm(self) -> tuple[float, float, float]: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_TaoConvergedReason(__pyx_v_reason); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 1475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TAO.pyx":1463 * getFunctionValue = getObjectiveValue * * def getConvergedReason(self) -> ConvergedReason: # <<<<<<<<<<<<<< * """Return the reason for the solver convergence. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TAO.getConvergedReason", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":1477 * return reason * * def getSolutionNorm(self) -> tuple[float, float, float]: # <<<<<<<<<<<<<< * """Return the objective function value and the norms of gradient and constraints. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_147getSolutionNorm(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_146getSolutionNorm, "TAO.getSolutionNorm(self) -> tuple[float, float, float]\nReturn the objective function value and the norms of gradient and constraints.\n\n Not collective.\n\n Returns\n -------\n f : float\n Current value of the objective function.\n res : float\n Current value of the residual norm.\n cnorm : float\n Current value of the constrains norm.\n\n See Also\n --------\n getSolutionStatus, petsc.TaoGetSolutionStatus\n\n \nSource code at petsc4py/PETSc/TAO.pyx:1477"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_147getSolutionNorm(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSolutionNorm (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getSolutionNorm", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getSolutionNorm", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_146getSolutionNorm(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_146getSolutionNorm(struct PyPetscTAOObject *__pyx_v_self) { PetscReal __pyx_v_gnorm; PetscReal __pyx_v_cnorm; PetscReal __pyx_v_fval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSolutionNorm", 1); /* "petsc4py/PETSc/TAO.pyx":1496 * * """ * cdef PetscReal gnorm=0 # <<<<<<<<<<<<<< * cdef PetscReal cnorm=0 * cdef PetscReal fval=0 */ __pyx_v_gnorm = 0.0; /* "petsc4py/PETSc/TAO.pyx":1497 * """ * cdef PetscReal gnorm=0 * cdef PetscReal cnorm=0 # <<<<<<<<<<<<<< * cdef PetscReal fval=0 * CHKERR( TaoGetSolutionStatus(self.tao, NULL, &fval, &gnorm, &cnorm, NULL, NULL) ) */ __pyx_v_cnorm = 0.0; /* "petsc4py/PETSc/TAO.pyx":1498 * cdef PetscReal gnorm=0 * cdef PetscReal cnorm=0 * cdef PetscReal fval=0 # <<<<<<<<<<<<<< * CHKERR( TaoGetSolutionStatus(self.tao, NULL, &fval, &gnorm, &cnorm, NULL, NULL) ) * return (toReal(fval), toReal(gnorm), toReal(cnorm)) */ __pyx_v_fval = 0.0; /* "petsc4py/PETSc/TAO.pyx":1499 * cdef PetscReal cnorm=0 * cdef PetscReal fval=0 * CHKERR( TaoGetSolutionStatus(self.tao, NULL, &fval, &gnorm, &cnorm, NULL, NULL) ) # <<<<<<<<<<<<<< * return (toReal(fval), toReal(gnorm), toReal(cnorm)) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoGetSolutionStatus(__pyx_v_self->tao, NULL, (&__pyx_v_fval), (&__pyx_v_gnorm), (&__pyx_v_cnorm), NULL, NULL)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1499, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":1500 * cdef PetscReal fval=0 * CHKERR( TaoGetSolutionStatus(self.tao, NULL, &fval, &gnorm, &cnorm, NULL, NULL) ) * return (toReal(fval), toReal(gnorm), toReal(cnorm)) # <<<<<<<<<<<<<< * * def getSolutionStatus(self) -> tuple[int, float, float, float, float, ConvergedReason]: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_fval); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 1500, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_gnorm); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 1500, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_cnorm); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1500, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 1500, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2)) __PYX_ERR(52, 1500, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3)) __PYX_ERR(52, 1500, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4)) __PYX_ERR(52, 1500, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TAO.pyx":1477 * return reason * * def getSolutionNorm(self) -> tuple[float, float, float]: # <<<<<<<<<<<<<< * """Return the objective function value and the norms of gradient and constraints. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.TAO.getSolutionNorm", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":1502 * return (toReal(fval), toReal(gnorm), toReal(cnorm)) * * def getSolutionStatus(self) -> tuple[int, float, float, float, float, ConvergedReason]: # <<<<<<<<<<<<<< * """Return the solution status. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_149getSolutionStatus(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_148getSolutionStatus, "TAO.getSolutionStatus(self) -> tuple[int, float, float, float, float, ConvergedReason]\nReturn the solution status.\n\n Not collective.\n\n Returns\n -------\n its : int\n Current number of iterations.\n f : float\n Current value of the objective function.\n res : float\n Current value of the residual norm.\n cnorm : float\n Current value of the constrains norm.\n step : float\n Current value of the step.\n reason : ConvergedReason\n Current value of converged reason.\n\n See Also\n --------\n petsc.TaoGetSolutionStatus\n\n \nSource code at petsc4py/PETSc/TAO.pyx:1502"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_149getSolutionStatus(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSolutionStatus (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getSolutionStatus", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getSolutionStatus", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_148getSolutionStatus(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_148getSolutionStatus(struct PyPetscTAOObject *__pyx_v_self) { PetscInt __pyx_v_its; PetscReal __pyx_v_fval; PetscReal __pyx_v_gnorm; PetscReal __pyx_v_cnorm; PetscReal __pyx_v_xdiff; TaoConvergedReason __pyx_v_reason; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSolutionStatus", 1); /* "petsc4py/PETSc/TAO.pyx":1527 * * """ * cdef PetscInt its=0 # <<<<<<<<<<<<<< * cdef PetscReal fval=0, gnorm=0, cnorm=0, xdiff=0 * cdef PetscTAOConvergedReason reason = TAO_CONTINUE_ITERATING */ __pyx_v_its = 0; /* "petsc4py/PETSc/TAO.pyx":1528 * """ * cdef PetscInt its=0 * cdef PetscReal fval=0, gnorm=0, cnorm=0, xdiff=0 # <<<<<<<<<<<<<< * cdef PetscTAOConvergedReason reason = TAO_CONTINUE_ITERATING * CHKERR( TaoGetSolutionStatus(self.tao, &its, */ __pyx_v_fval = 0.0; __pyx_v_gnorm = 0.0; __pyx_v_cnorm = 0.0; __pyx_v_xdiff = 0.0; /* "petsc4py/PETSc/TAO.pyx":1529 * cdef PetscInt its=0 * cdef PetscReal fval=0, gnorm=0, cnorm=0, xdiff=0 * cdef PetscTAOConvergedReason reason = TAO_CONTINUE_ITERATING # <<<<<<<<<<<<<< * CHKERR( TaoGetSolutionStatus(self.tao, &its, * &fval, &gnorm, &cnorm, &xdiff, */ __pyx_v_reason = TAO_CONTINUE_ITERATING; /* "petsc4py/PETSc/TAO.pyx":1530 * cdef PetscReal fval=0, gnorm=0, cnorm=0, xdiff=0 * cdef PetscTAOConvergedReason reason = TAO_CONTINUE_ITERATING * CHKERR( TaoGetSolutionStatus(self.tao, &its, # <<<<<<<<<<<<<< * &fval, &gnorm, &cnorm, &xdiff, * &reason) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoGetSolutionStatus(__pyx_v_self->tao, (&__pyx_v_its), (&__pyx_v_fval), (&__pyx_v_gnorm), (&__pyx_v_cnorm), (&__pyx_v_xdiff), (&__pyx_v_reason))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1530, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":1533 * &fval, &gnorm, &cnorm, &xdiff, * &reason) ) * return (toInt(its), toReal(fval), # <<<<<<<<<<<<<< * toReal(gnorm), toReal(cnorm), * toReal(xdiff), reason) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_its); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 1533, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_fval); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 1533, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "petsc4py/PETSc/TAO.pyx":1534 * &reason) ) * return (toInt(its), toReal(fval), * toReal(gnorm), toReal(cnorm), # <<<<<<<<<<<<<< * toReal(xdiff), reason) * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_gnorm); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1534, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_cnorm); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 1534, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); /* "petsc4py/PETSc/TAO.pyx":1535 * return (toInt(its), toReal(fval), * toReal(gnorm), toReal(cnorm), * toReal(xdiff), reason) # <<<<<<<<<<<<<< * * def getKSP(self) -> KSP: */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_xdiff); if (unlikely(!__pyx_t_6)) __PYX_ERR(52, 1535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyInt_From_TaoConvergedReason(__pyx_v_reason); if (unlikely(!__pyx_t_7)) __PYX_ERR(52, 1535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); /* "petsc4py/PETSc/TAO.pyx":1533 * &fval, &gnorm, &cnorm, &xdiff, * &reason) ) * return (toInt(its), toReal(fval), # <<<<<<<<<<<<<< * toReal(gnorm), toReal(cnorm), * toReal(xdiff), reason) */ __pyx_t_8 = PyTuple_New(6); if (unlikely(!__pyx_t_8)) __PYX_ERR(52, 1533, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2)) __PYX_ERR(52, 1533, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_3)) __PYX_ERR(52, 1533, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_4)) __PYX_ERR(52, 1533, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_5)) __PYX_ERR(52, 1533, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 4, __pyx_t_6)) __PYX_ERR(52, 1533, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 5, __pyx_t_7)) __PYX_ERR(52, 1533, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_r = __pyx_t_8; __pyx_t_8 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TAO.pyx":1502 * return (toReal(fval), toReal(gnorm), toReal(cnorm)) * * def getSolutionStatus(self) -> tuple[int, float, float, float, float, ConvergedReason]: # <<<<<<<<<<<<<< * """Return the solution status. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("petsc4py.PETSc.TAO.getSolutionStatus", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":1537 * toReal(xdiff), reason) * * def getKSP(self) -> KSP: # <<<<<<<<<<<<<< * """Return the linear solver used by the nonlinear solver. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_151getKSP(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_150getKSP, "TAO.getKSP(self) -> KSP\nReturn the linear solver used by the nonlinear solver.\n\n Not collective.\n\n See Also\n --------\n petsc.TaoGetKSP\n\n \nSource code at petsc4py/PETSc/TAO.pyx:1537"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_151getKSP(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getKSP (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getKSP", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getKSP", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_150getKSP(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_150getKSP(struct PyPetscTAOObject *__pyx_v_self) { struct PyPetscKSPObject *__pyx_v_ksp = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getKSP", 1); /* "petsc4py/PETSc/TAO.pyx":1547 * * """ * cdef KSP ksp = KSP() # <<<<<<<<<<<<<< * CHKERR( TaoGetKSP(self.tao, &ksp.ksp) ) * CHKERR( PetscINCREF(ksp.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_KSP)); if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 1547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ksp = ((struct PyPetscKSPObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/TAO.pyx":1548 * """ * cdef KSP ksp = KSP() * CHKERR( TaoGetKSP(self.tao, &ksp.ksp) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(ksp.obj) ) * return ksp */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoGetKSP(__pyx_v_self->tao, (&__pyx_v_ksp->ksp))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1548, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":1549 * cdef KSP ksp = KSP() * CHKERR( TaoGetKSP(self.tao, &ksp.ksp) ) * CHKERR( PetscINCREF(ksp.obj) ) # <<<<<<<<<<<<<< * return ksp * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ksp->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1549, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":1550 * CHKERR( TaoGetKSP(self.tao, &ksp.ksp) ) * CHKERR( PetscINCREF(ksp.obj) ) * return ksp # <<<<<<<<<<<<<< * * # BRGN routines */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_ksp); __pyx_r = ((PyObject *)__pyx_v_ksp); goto __pyx_L0; /* "petsc4py/PETSc/TAO.pyx":1537 * toReal(xdiff), reason) * * def getKSP(self) -> KSP: # <<<<<<<<<<<<<< * """Return the linear solver used by the nonlinear solver. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TAO.getKSP", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ksp); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":1554 * # BRGN routines * * def getBRGNSubsolver(self) -> TAO: # <<<<<<<<<<<<<< * """Return the subsolver inside the BRGN solver. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_153getBRGNSubsolver(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_152getBRGNSubsolver, "TAO.getBRGNSubsolver(self) -> TAO\nReturn the subsolver inside the BRGN solver.\n\n Not collective.\n\n See Also\n --------\n petsc.TaoBRGNGetSubsolver\n\n \nSource code at petsc4py/PETSc/TAO.pyx:1554"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_153getBRGNSubsolver(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getBRGNSubsolver (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getBRGNSubsolver", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getBRGNSubsolver", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_152getBRGNSubsolver(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_152getBRGNSubsolver(struct PyPetscTAOObject *__pyx_v_self) { struct PyPetscTAOObject *__pyx_v_subsolver = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getBRGNSubsolver", 1); /* "petsc4py/PETSc/TAO.pyx":1564 * * """ * cdef TAO subsolver = TAO() # <<<<<<<<<<<<<< * CHKERR( TaoBRGNGetSubsolver(self.tao, &subsolver.tao) ) * CHKERR( PetscINCREF(subsolver.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_TAO)); if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 1564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_subsolver = ((struct PyPetscTAOObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/TAO.pyx":1565 * """ * cdef TAO subsolver = TAO() * CHKERR( TaoBRGNGetSubsolver(self.tao, &subsolver.tao) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(subsolver.obj) ) * return subsolver */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoBRGNGetSubsolver(__pyx_v_self->tao, (&__pyx_v_subsolver->tao))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1565, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":1566 * cdef TAO subsolver = TAO() * CHKERR( TaoBRGNGetSubsolver(self.tao, &subsolver.tao) ) * CHKERR( PetscINCREF(subsolver.obj) ) # <<<<<<<<<<<<<< * return subsolver * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_subsolver->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1566, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":1567 * CHKERR( TaoBRGNGetSubsolver(self.tao, &subsolver.tao) ) * CHKERR( PetscINCREF(subsolver.obj) ) * return subsolver # <<<<<<<<<<<<<< * * def setBRGNRegularizerObjectiveGradient(self, objgrad, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_subsolver); __pyx_r = ((PyObject *)__pyx_v_subsolver); goto __pyx_L0; /* "petsc4py/PETSc/TAO.pyx":1554 * # BRGN routines * * def getBRGNSubsolver(self) -> TAO: # <<<<<<<<<<<<<< * """Return the subsolver inside the BRGN solver. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TAO.getBRGNSubsolver", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_subsolver); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":1569 * return subsolver * * def setBRGNRegularizerObjectiveGradient(self, objgrad, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: # <<<<<<<<<<<<<< * """Set the callback to compute the regularizer objective and gradient. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_155setBRGNRegularizerObjectiveGradient(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_154setBRGNRegularizerObjectiveGradient, "TAO.setBRGNRegularizerObjectiveGradient(self, objgrad, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nSet the callback to compute the regularizer objective and gradient.\n\n Logically collective.\n\n See Also\n --------\n petsc.TaoBRGNSetRegularizerObjectiveAndGradientRoutine\n\n \nSource code at petsc4py/PETSc/TAO.pyx:1569"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_155setBRGNRegularizerObjectiveGradient(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_objgrad = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setBRGNRegularizerObjectiveGradient (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_objgrad,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_objgrad)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 1569, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 1569, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 1569, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setBRGNRegularizerObjectiveGradient") < 0)) __PYX_ERR(52, 1569, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_objgrad = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setBRGNRegularizerObjectiveGradient", 0, 1, 3, __pyx_nargs); __PYX_ERR(52, 1569, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TAO.setBRGNRegularizerObjectiveGradient", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_154setBRGNRegularizerObjectiveGradient(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_objgrad, __pyx_v_args, __pyx_v_kargs); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_154setBRGNRegularizerObjectiveGradient(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_objgrad, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setBRGNRegularizerObjectiveGradient", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/TAO.pyx":1579 * * """ * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (objgrad, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/TAO.pyx":1580 * """ * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (objgrad, args, kargs) * self.set_attr("__brgnregobjgrad__", context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); if (__pyx_t_1) { __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 1580, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_2); __pyx_t_2 = 0; } /* "petsc4py/PETSc/TAO.pyx":1581 * if args is None: args = () * if kargs is None: kargs = {} * context = (objgrad, args, kargs) # <<<<<<<<<<<<<< * self.set_attr("__brgnregobjgrad__", context) * CHKERR( TaoBRGNSetRegularizerObjectiveAndGradientRoutine(self.tao, TAO_BRGNRegObjGrad, context) ) */ __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 1581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_objgrad); __Pyx_GIVEREF(__pyx_v_objgrad); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_objgrad)) __PYX_ERR(52, 1581, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_args)) __PYX_ERR(52, 1581, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_kargs)) __PYX_ERR(52, 1581, __pyx_L1_error); __pyx_v_context = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/TAO.pyx":1582 * if kargs is None: kargs = {} * context = (objgrad, args, kargs) * self.set_attr("__brgnregobjgrad__", context) # <<<<<<<<<<<<<< * CHKERR( TaoBRGNSetRegularizerObjectiveAndGradientRoutine(self.tao, TAO_BRGNRegObjGrad, context) ) * */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__brgnregobjgrad__"), __pyx_v_context); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 1582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/TAO.pyx":1583 * context = (objgrad, args, kargs) * self.set_attr("__brgnregobjgrad__", context) * CHKERR( TaoBRGNSetRegularizerObjectiveAndGradientRoutine(self.tao, TAO_BRGNRegObjGrad, context) ) # <<<<<<<<<<<<<< * * def setBRGNRegularizerHessian(self, hessian, Mat H=None, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoBRGNSetRegularizerObjectiveAndGradientRoutine(__pyx_v_self->tao, __pyx_f_8petsc4py_5PETSc_TAO_BRGNRegObjGrad, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1583, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":1569 * return subsolver * * def setBRGNRegularizerObjectiveGradient(self, objgrad, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: # <<<<<<<<<<<<<< * """Set the callback to compute the regularizer objective and gradient. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TAO.setBRGNRegularizerObjectiveGradient", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":1585 * CHKERR( TaoBRGNSetRegularizerObjectiveAndGradientRoutine(self.tao, TAO_BRGNRegObjGrad, context) ) * * def setBRGNRegularizerHessian(self, hessian, Mat H=None, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: # <<<<<<<<<<<<<< * """Set the callback to compute the regularizer Hessian. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_157setBRGNRegularizerHessian(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_156setBRGNRegularizerHessian, "TAO.setBRGNRegularizerHessian(self, hessian, H: Mat | None = None, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nSet the callback to compute the regularizer Hessian.\n\n Logically collective.\n\n See Also\n --------\n petsc.TaoBRGNSetRegularizerHessianRoutine\n\n \nSource code at petsc4py/PETSc/TAO.pyx:1585"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_157setBRGNRegularizerHessian(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_hessian = 0; struct PyPetscMatObject *__pyx_v_H = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setBRGNRegularizerHessian (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_hessian,&__pyx_n_s_H,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscMatObject *)Py_None)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_hessian)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 1585, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_H); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 1585, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 1585, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 1585, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setBRGNRegularizerHessian") < 0)) __PYX_ERR(52, 1585, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_hessian = values[0]; __pyx_v_H = ((struct PyPetscMatObject *)values[1]); __pyx_v_args = values[2]; __pyx_v_kargs = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setBRGNRegularizerHessian", 0, 1, 4, __pyx_nargs); __PYX_ERR(52, 1585, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TAO.setBRGNRegularizerHessian", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_H), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "H", 0))) __PYX_ERR(52, 1585, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_156setBRGNRegularizerHessian(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_hessian, __pyx_v_H, __pyx_v_args, __pyx_v_kargs); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_156setBRGNRegularizerHessian(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_hessian, struct PyPetscMatObject *__pyx_v_H, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { Mat __pyx_v_Hmat; PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; Mat __pyx_t_2; PyObject *__pyx_t_3 = NULL; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setBRGNRegularizerHessian", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/TAO.pyx":1595 * * """ * cdef PetscMat Hmat = NULL # <<<<<<<<<<<<<< * if H is not None: Hmat = H.mat * if args is None: args = () */ __pyx_v_Hmat = NULL; /* "petsc4py/PETSc/TAO.pyx":1596 * """ * cdef PetscMat Hmat = NULL * if H is not None: Hmat = H.mat # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = (((PyObject *)__pyx_v_H) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_H->mat; __pyx_v_Hmat = __pyx_t_2; } /* "petsc4py/PETSc/TAO.pyx":1597 * cdef PetscMat Hmat = NULL * if H is not None: Hmat = H.mat * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (hessian, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/TAO.pyx":1598 * if H is not None: Hmat = H.mat * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (hessian, args, kargs) * self.set_attr("__brgnreghessian__", context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); if (__pyx_t_1) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 1598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "petsc4py/PETSc/TAO.pyx":1599 * if args is None: args = () * if kargs is None: kargs = {} * context = (hessian, args, kargs) # <<<<<<<<<<<<<< * self.set_attr("__brgnreghessian__", context) * CHKERR( TaoBRGNSetRegularizerHessianRoutine(self.tao, Hmat, TAO_BRGNRegHessian, context) ) */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 1599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_hessian); __Pyx_GIVEREF(__pyx_v_hessian); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_hessian)) __PYX_ERR(52, 1599, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args)) __PYX_ERR(52, 1599, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs)) __PYX_ERR(52, 1599, __pyx_L1_error); __pyx_v_context = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/TAO.pyx":1600 * if kargs is None: kargs = {} * context = (hessian, args, kargs) * self.set_attr("__brgnreghessian__", context) # <<<<<<<<<<<<<< * CHKERR( TaoBRGNSetRegularizerHessianRoutine(self.tao, Hmat, TAO_BRGNRegHessian, context) ) * */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__brgnreghessian__"), __pyx_v_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 1600, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/TAO.pyx":1601 * context = (hessian, args, kargs) * self.set_attr("__brgnreghessian__", context) * CHKERR( TaoBRGNSetRegularizerHessianRoutine(self.tao, Hmat, TAO_BRGNRegHessian, context) ) # <<<<<<<<<<<<<< * * def setBRGNRegularizerWeight(self, weight: float) -> None: */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoBRGNSetRegularizerHessianRoutine(__pyx_v_self->tao, __pyx_v_Hmat, __pyx_f_8petsc4py_5PETSc_TAO_BRGNRegHessian, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1601, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":1585 * CHKERR( TaoBRGNSetRegularizerObjectiveAndGradientRoutine(self.tao, TAO_BRGNRegObjGrad, context) ) * * def setBRGNRegularizerHessian(self, hessian, Mat H=None, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: # <<<<<<<<<<<<<< * """Set the callback to compute the regularizer Hessian. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TAO.setBRGNRegularizerHessian", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":1603 * CHKERR( TaoBRGNSetRegularizerHessianRoutine(self.tao, Hmat, TAO_BRGNRegHessian, context) ) * * def setBRGNRegularizerWeight(self, weight: float) -> None: # <<<<<<<<<<<<<< * """Set the regularizer weight. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_159setBRGNRegularizerWeight(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_158setBRGNRegularizerWeight, "TAO.setBRGNRegularizerWeight(self, weight: float) -> None\nSet the regularizer weight.\n\n Collective.\n\n \nSource code at petsc4py/PETSc/TAO.pyx:1603"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_159setBRGNRegularizerWeight(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_weight = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setBRGNRegularizerWeight (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_weight,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_weight)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 1603, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setBRGNRegularizerWeight") < 0)) __PYX_ERR(52, 1603, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_weight = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setBRGNRegularizerWeight", 1, 1, 1, __pyx_nargs); __PYX_ERR(52, 1603, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TAO.setBRGNRegularizerWeight", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_158setBRGNRegularizerWeight(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_weight); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_158setBRGNRegularizerWeight(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_weight) { PetscReal __pyx_v_cweight; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setBRGNRegularizerWeight", 1); /* "petsc4py/PETSc/TAO.pyx":1609 * * """ * cdef PetscReal cweight = asReal(weight) # <<<<<<<<<<<<<< * CHKERR( TaoBRGNSetRegularizerWeight(self.tao, cweight) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_weight); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(52, 1609, __pyx_L1_error) __pyx_v_cweight = __pyx_t_1; /* "petsc4py/PETSc/TAO.pyx":1610 * """ * cdef PetscReal cweight = asReal(weight) * CHKERR( TaoBRGNSetRegularizerWeight(self.tao, cweight) ) # <<<<<<<<<<<<<< * * def setBRGNSmoothL1Epsilon(self, epsilon: float) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoBRGNSetRegularizerWeight(__pyx_v_self->tao, __pyx_v_cweight)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1610, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":1603 * CHKERR( TaoBRGNSetRegularizerHessianRoutine(self.tao, Hmat, TAO_BRGNRegHessian, context) ) * * def setBRGNRegularizerWeight(self, weight: float) -> None: # <<<<<<<<<<<<<< * """Set the regularizer weight. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.setBRGNRegularizerWeight", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":1612 * CHKERR( TaoBRGNSetRegularizerWeight(self.tao, cweight) ) * * def setBRGNSmoothL1Epsilon(self, epsilon: float) -> None: # <<<<<<<<<<<<<< * """Set the smooth L1 epsilon. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_161setBRGNSmoothL1Epsilon(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_160setBRGNSmoothL1Epsilon, "TAO.setBRGNSmoothL1Epsilon(self, epsilon: float) -> None\nSet the smooth L1 epsilon.\n\n Collective.\n\n See Also\n --------\n petsc.TaoBRGNSetL1SmoothEpsilon\n\n \nSource code at petsc4py/PETSc/TAO.pyx:1612"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_161setBRGNSmoothL1Epsilon(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_epsilon = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setBRGNSmoothL1Epsilon (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_epsilon,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_epsilon)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 1612, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setBRGNSmoothL1Epsilon") < 0)) __PYX_ERR(52, 1612, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_epsilon = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setBRGNSmoothL1Epsilon", 1, 1, 1, __pyx_nargs); __PYX_ERR(52, 1612, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TAO.setBRGNSmoothL1Epsilon", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_160setBRGNSmoothL1Epsilon(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_epsilon); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_160setBRGNSmoothL1Epsilon(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_epsilon) { PetscReal __pyx_v_ceps; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setBRGNSmoothL1Epsilon", 1); /* "petsc4py/PETSc/TAO.pyx":1622 * * """ * cdef PetscReal ceps = asReal(epsilon) # <<<<<<<<<<<<<< * CHKERR( TaoBRGNSetL1SmoothEpsilon(self.tao, ceps) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_epsilon); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(52, 1622, __pyx_L1_error) __pyx_v_ceps = __pyx_t_1; /* "petsc4py/PETSc/TAO.pyx":1623 * """ * cdef PetscReal ceps = asReal(epsilon) * CHKERR( TaoBRGNSetL1SmoothEpsilon(self.tao, ceps) ) # <<<<<<<<<<<<<< * * def setBRGNDictionaryMatrix(self, Mat D) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoBRGNSetL1SmoothEpsilon(__pyx_v_self->tao, __pyx_v_ceps)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1623, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":1612 * CHKERR( TaoBRGNSetRegularizerWeight(self.tao, cweight) ) * * def setBRGNSmoothL1Epsilon(self, epsilon: float) -> None: # <<<<<<<<<<<<<< * """Set the smooth L1 epsilon. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.setBRGNSmoothL1Epsilon", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":1625 * CHKERR( TaoBRGNSetL1SmoothEpsilon(self.tao, ceps) ) * * def setBRGNDictionaryMatrix(self, Mat D) -> None: # <<<<<<<<<<<<<< * """Set the dictionary matrix. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_163setBRGNDictionaryMatrix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_162setBRGNDictionaryMatrix, "TAO.setBRGNDictionaryMatrix(self, D: Mat) -> None\nSet the dictionary matrix.\n\n Collective.\n\n See Also\n --------\n petsc.TaoBRGNSetDictionaryMatrix\n\n \nSource code at petsc4py/PETSc/TAO.pyx:1625"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_163setBRGNDictionaryMatrix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscMatObject *__pyx_v_D = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setBRGNDictionaryMatrix (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_D,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_D)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 1625, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setBRGNDictionaryMatrix") < 0)) __PYX_ERR(52, 1625, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_D = ((struct PyPetscMatObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setBRGNDictionaryMatrix", 1, 1, 1, __pyx_nargs); __PYX_ERR(52, 1625, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TAO.setBRGNDictionaryMatrix", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_D), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "D", 0))) __PYX_ERR(52, 1625, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_162setBRGNDictionaryMatrix(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_D); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_162setBRGNDictionaryMatrix(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_D) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setBRGNDictionaryMatrix", 1); /* "petsc4py/PETSc/TAO.pyx":1635 * * """ * CHKERR( TaoBRGNSetDictionaryMatrix(self.tao, D.mat) ) # <<<<<<<<<<<<<< * * def getBRGNDampingVector(self) -> Vec: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoBRGNSetDictionaryMatrix(__pyx_v_self->tao, __pyx_v_D->mat)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1635, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":1625 * CHKERR( TaoBRGNSetL1SmoothEpsilon(self.tao, ceps) ) * * def setBRGNDictionaryMatrix(self, Mat D) -> None: # <<<<<<<<<<<<<< * """Set the dictionary matrix. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.setBRGNDictionaryMatrix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":1637 * CHKERR( TaoBRGNSetDictionaryMatrix(self.tao, D.mat) ) * * def getBRGNDampingVector(self) -> Vec: # <<<<<<<<<<<<<< * """Return the damping vector. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_165getBRGNDampingVector(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_164getBRGNDampingVector, "TAO.getBRGNDampingVector(self) -> Vec\nReturn the damping vector.\n\n Not collective.\n\n \nSource code at petsc4py/PETSc/TAO.pyx:1637"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_165getBRGNDampingVector(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getBRGNDampingVector (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getBRGNDampingVector", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getBRGNDampingVector", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_164getBRGNDampingVector(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_164getBRGNDampingVector(struct PyPetscTAOObject *__pyx_v_self) { struct PyPetscVecObject *__pyx_v_damp = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getBRGNDampingVector", 1); /* "petsc4py/PETSc/TAO.pyx":1647 * #-------- * #petsc.TaoBRGNGetDampingVector * cdef Vec damp = Vec() # <<<<<<<<<<<<<< * CHKERR( TaoBRGNGetDampingVector(self.tao, &damp.vec) ) * CHKERR( PetscINCREF(damp.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 1647, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_damp = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/TAO.pyx":1648 * #petsc.TaoBRGNGetDampingVector * cdef Vec damp = Vec() * CHKERR( TaoBRGNGetDampingVector(self.tao, &damp.vec) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(damp.obj) ) * return damp */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoBRGNGetDampingVector(__pyx_v_self->tao, (&__pyx_v_damp->vec))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1648, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":1649 * cdef Vec damp = Vec() * CHKERR( TaoBRGNGetDampingVector(self.tao, &damp.vec) ) * CHKERR( PetscINCREF(damp.obj) ) # <<<<<<<<<<<<<< * return damp * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_damp->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1649, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":1650 * CHKERR( TaoBRGNGetDampingVector(self.tao, &damp.vec) ) * CHKERR( PetscINCREF(damp.obj) ) * return damp # <<<<<<<<<<<<<< * * def createPython(self, context: Any = None, comm: Comm | None = None) -> Self: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_damp); __pyx_r = ((PyObject *)__pyx_v_damp); goto __pyx_L0; /* "petsc4py/PETSc/TAO.pyx":1637 * CHKERR( TaoBRGNSetDictionaryMatrix(self.tao, D.mat) ) * * def getBRGNDampingVector(self) -> Vec: # <<<<<<<<<<<<<< * """Return the damping vector. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TAO.getBRGNDampingVector", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_damp); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":1652 * return damp * * def createPython(self, context: Any = None, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Create an optimization solver of Python type. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_167createPython(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_166createPython, "TAO.createPython(self, context: Any = None, comm: Comm | None = None) -> Self\nCreate an optimization solver of Python type.\n\n Collective.\n\n Parameters\n ----------\n context\n An instance of the Python class implementing the required methods.\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n petsc_python_tao, setType, setPythonContext, Type.PYTHON\n\n \nSource code at petsc4py/PETSc/TAO.pyx:1652"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_167createPython(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_context = 0; PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createPython (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_context,&__pyx_n_s_comm,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_context); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 1652, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 1652, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createPython") < 0)) __PYX_ERR(52, 1652, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_context = values[0]; __pyx_v_comm = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createPython", 0, 0, 2, __pyx_nargs); __PYX_ERR(52, 1652, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TAO.createPython", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_166createPython(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_context, __pyx_v_comm); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_166createPython(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; Tao __pyx_v_tao; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PetscErrorCode __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createPython", 1); /* "petsc4py/PETSc/TAO.pyx":1669 * * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscTAO tao = NULL * CHKERR( TaoCreate(ccomm, &tao) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(52, 1669, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/TAO.pyx":1670 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscTAO tao = NULL # <<<<<<<<<<<<<< * CHKERR( TaoCreate(ccomm, &tao) ) * CHKERR( PetscCLEAR(self.obj) ); self.tao = tao */ __pyx_v_tao = NULL; /* "petsc4py/PETSc/TAO.pyx":1671 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscTAO tao = NULL * CHKERR( TaoCreate(ccomm, &tao) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.tao = tao * CHKERR( TaoSetType(self.tao, TAOPYTHON) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoCreate(__pyx_v_ccomm, (&__pyx_v_tao))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1671, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":1672 * cdef PetscTAO tao = NULL * CHKERR( TaoCreate(ccomm, &tao) ) * CHKERR( PetscCLEAR(self.obj) ); self.tao = tao # <<<<<<<<<<<<<< * CHKERR( TaoSetType(self.tao, TAOPYTHON) ) * CHKERR( TaoPythonSetContext(self.tao, context) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1672, __pyx_L1_error) __pyx_v_self->tao = __pyx_v_tao; /* "petsc4py/PETSc/TAO.pyx":1673 * CHKERR( TaoCreate(ccomm, &tao) ) * CHKERR( PetscCLEAR(self.obj) ); self.tao = tao * CHKERR( TaoSetType(self.tao, TAOPYTHON) ) # <<<<<<<<<<<<<< * CHKERR( TaoPythonSetContext(self.tao, context) ) * return self */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSetType(__pyx_v_self->tao, TAOPYTHON)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1673, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":1674 * CHKERR( PetscCLEAR(self.obj) ); self.tao = tao * CHKERR( TaoSetType(self.tao, TAOPYTHON) ) * CHKERR( TaoPythonSetContext(self.tao, context) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = TaoPythonSetContext(__pyx_v_self->tao, ((void *)__pyx_v_context)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1674, __pyx_L1_error) __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_t_2); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1674, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":1675 * CHKERR( TaoSetType(self.tao, TAOPYTHON) ) * CHKERR( TaoPythonSetContext(self.tao, context) ) * return self # <<<<<<<<<<<<<< * * def setPythonContext(self, context: Any) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/TAO.pyx":1652 * return damp * * def createPython(self, context: Any = None, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Create an optimization solver of Python type. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.createPython", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":1677 * return self * * def setPythonContext(self, context: Any) -> None: # <<<<<<<<<<<<<< * """Set the instance of the class implementing the required Python methods. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_169setPythonContext(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_168setPythonContext, "TAO.setPythonContext(self, context: Any) -> None\nSet the instance of the class implementing the required Python methods.\n\n Not collective.\n\n See Also\n --------\n petsc_python_tao, getPythonContext\n\n \nSource code at petsc4py/PETSc/TAO.pyx:1677"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_169setPythonContext(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_context = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPythonContext (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_context,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_context)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 1677, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setPythonContext") < 0)) __PYX_ERR(52, 1677, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_context = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPythonContext", 1, 1, 1, __pyx_nargs); __PYX_ERR(52, 1677, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TAO.setPythonContext", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_168setPythonContext(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_context); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_168setPythonContext(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_context) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPythonContext", 1); /* "petsc4py/PETSc/TAO.pyx":1687 * * """ * CHKERR( TaoPythonSetContext(self.tao, context) ) # <<<<<<<<<<<<<< * * def getPythonContext(self) -> Any: */ __pyx_t_1 = TaoPythonSetContext(__pyx_v_self->tao, ((void *)__pyx_v_context)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1687, __pyx_L1_error) __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_t_1); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1687, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":1677 * return self * * def setPythonContext(self, context: Any) -> None: # <<<<<<<<<<<<<< * """Set the instance of the class implementing the required Python methods. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.setPythonContext", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":1689 * CHKERR( TaoPythonSetContext(self.tao, context) ) * * def getPythonContext(self) -> Any: # <<<<<<<<<<<<<< * """Return the instance of the class implementing the required Python methods. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_171getPythonContext(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_170getPythonContext, "TAO.getPythonContext(self) -> Any\nReturn the instance of the class implementing the required Python methods.\n\n Not collective.\n\n See Also\n --------\n petsc_python_tao, setPythonContext\n\n \nSource code at petsc4py/PETSc/TAO.pyx:1689"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_171getPythonContext(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getPythonContext (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getPythonContext", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getPythonContext", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_170getPythonContext(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_170getPythonContext(struct PyPetscTAOObject *__pyx_v_self) { void *__pyx_v_context; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getPythonContext", 1); /* "petsc4py/PETSc/TAO.pyx":1699 * * """ * cdef void *context = NULL # <<<<<<<<<<<<<< * CHKERR( TaoPythonGetContext(self.tao, &context) ) * if context == NULL: return None */ __pyx_v_context = NULL; /* "petsc4py/PETSc/TAO.pyx":1700 * """ * cdef void *context = NULL * CHKERR( TaoPythonGetContext(self.tao, &context) ) # <<<<<<<<<<<<<< * if context == NULL: return None * else: return context */ __pyx_t_1 = TaoPythonGetContext(__pyx_v_self->tao, (&__pyx_v_context)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1700, __pyx_L1_error) __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_t_1); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1700, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":1701 * cdef void *context = NULL * CHKERR( TaoPythonGetContext(self.tao, &context) ) * if context == NULL: return None # <<<<<<<<<<<<<< * else: return context * */ __pyx_t_3 = (__pyx_v_context == NULL); if (__pyx_t_3) { __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } /* "petsc4py/PETSc/TAO.pyx":1702 * CHKERR( TaoPythonGetContext(self.tao, &context) ) * if context == NULL: return None * else: return context # <<<<<<<<<<<<<< * * def setPythonType(self, py_type: str) -> None: */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_context)); __pyx_r = ((PyObject *)__pyx_v_context); goto __pyx_L0; } /* "petsc4py/PETSc/TAO.pyx":1689 * CHKERR( TaoPythonSetContext(self.tao, context) ) * * def getPythonContext(self) -> Any: # <<<<<<<<<<<<<< * """Return the instance of the class implementing the required Python methods. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.getPythonContext", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":1704 * else: return context * * def setPythonType(self, py_type: str) -> None: # <<<<<<<<<<<<<< * """Set the fully qualified Python name of the class to be used. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_173setPythonType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_172setPythonType, "TAO.setPythonType(self, py_type: str) -> None\nSet the fully qualified Python name of the class to be used.\n\n Collective.\n\n See Also\n --------\n petsc_python_tao, setPythonContext, getPythonType\n petsc.TaoPythonSetType\n\n \nSource code at petsc4py/PETSc/TAO.pyx:1704"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_173setPythonType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_py_type = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPythonType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_py_type,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_py_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 1704, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setPythonType") < 0)) __PYX_ERR(52, 1704, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_py_type = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPythonType", 1, 1, 1, __pyx_nargs); __PYX_ERR(52, 1704, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TAO.setPythonType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_172setPythonType(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_py_type); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_172setPythonType(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_py_type) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPythonType", 0); __Pyx_INCREF(__pyx_v_py_type); /* "petsc4py/PETSc/TAO.pyx":1715 * * """ * cdef const char *cval = NULL # <<<<<<<<<<<<<< * py_type = str2bytes(py_type, &cval) * CHKERR( TaoPythonSetType(self.tao, cval) ) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/TAO.pyx":1716 * """ * cdef const char *cval = NULL * py_type = str2bytes(py_type, &cval) # <<<<<<<<<<<<<< * CHKERR( TaoPythonSetType(self.tao, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_py_type, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 1716, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_py_type, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/TAO.pyx":1717 * cdef const char *cval = NULL * py_type = str2bytes(py_type, &cval) * CHKERR( TaoPythonSetType(self.tao, cval) ) # <<<<<<<<<<<<<< * * def getPythonType(self) -> str: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoPythonSetType(__pyx_v_self->tao, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1717, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":1704 * else: return context * * def setPythonType(self, py_type: str) -> None: # <<<<<<<<<<<<<< * """Set the fully qualified Python name of the class to be used. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TAO.setPythonType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_py_type); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":1719 * CHKERR( TaoPythonSetType(self.tao, cval) ) * * def getPythonType(self) -> str: # <<<<<<<<<<<<<< * """Return the fully qualified Python name of the class used by the solver. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_175getPythonType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_174getPythonType, "TAO.getPythonType(self) -> str\nReturn the fully qualified Python name of the class used by the solver.\n\n Not collective.\n\n See Also\n --------\n petsc_python_tao, setPythonContext, setPythonType\n petsc.TaoPythonGetType\n\n \nSource code at petsc4py/PETSc/TAO.pyx:1719"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_175getPythonType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getPythonType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getPythonType", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getPythonType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_174getPythonType(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_174getPythonType(struct PyPetscTAOObject *__pyx_v_self) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getPythonType", 1); /* "petsc4py/PETSc/TAO.pyx":1730 * * """ * cdef const char *cval = NULL # <<<<<<<<<<<<<< * CHKERR( TaoPythonGetType(self.tao, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/TAO.pyx":1731 * """ * cdef const char *cval = NULL * CHKERR( TaoPythonGetType(self.tao, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoPythonGetType(__pyx_v_self->tao, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1731, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":1732 * cdef const char *cval = NULL * CHKERR( TaoPythonGetType(self.tao, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * def getLineSearch(self) -> TAOLineSearch: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 1732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TAO.pyx":1719 * CHKERR( TaoPythonSetType(self.tao, cval) ) * * def getPythonType(self) -> str: # <<<<<<<<<<<<<< * """Return the fully qualified Python name of the class used by the solver. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TAO.getPythonType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":1734 * return bytes2str(cval) * * def getLineSearch(self) -> TAOLineSearch: # <<<<<<<<<<<<<< * """Return the TAO Line Search object. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_177getLineSearch(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_3TAO_176getLineSearch, "TAO.getLineSearch(self) -> TAOLineSearch\nReturn the TAO Line Search object.\n\n Not collective.\n\n See Also\n -------\n petsc.TaoGetLineSearch\n\n \nSource code at petsc4py/PETSc/TAO.pyx:1734"); static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_177getLineSearch(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getLineSearch (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getLineSearch", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getLineSearch", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_176getLineSearch(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_176getLineSearch(struct PyPetscTAOObject *__pyx_v_self) { struct PyPetscTAOLineSearchObject *__pyx_v_ls = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getLineSearch", 1); /* "petsc4py/PETSc/TAO.pyx":1744 * * """ * cdef TAOLineSearch ls = TAOLineSearch() # <<<<<<<<<<<<<< * CHKERR( TaoGetLineSearch(self.tao, &ls.taols) ) * CHKERR( PetscINCREF(ls.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_TAOLineSearch)); if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 1744, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ls = ((struct PyPetscTAOLineSearchObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/TAO.pyx":1745 * """ * cdef TAOLineSearch ls = TAOLineSearch() * CHKERR( TaoGetLineSearch(self.tao, &ls.taols) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(ls.obj) ) * return ls */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoGetLineSearch(__pyx_v_self->tao, (&__pyx_v_ls->taols))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1745, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":1746 * cdef TAOLineSearch ls = TAOLineSearch() * CHKERR( TaoGetLineSearch(self.tao, &ls.taols) ) * CHKERR( PetscINCREF(ls.obj) ) # <<<<<<<<<<<<<< * return ls * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ls->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1746, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":1747 * CHKERR( TaoGetLineSearch(self.tao, &ls.taols) ) * CHKERR( PetscINCREF(ls.obj) ) * return ls # <<<<<<<<<<<<<< * * # --- backward compatibility --- */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_ls); __pyx_r = ((PyObject *)__pyx_v_ls); goto __pyx_L0; /* "petsc4py/PETSc/TAO.pyx":1734 * return bytes2str(cval) * * def getLineSearch(self) -> TAOLineSearch: # <<<<<<<<<<<<<< * """Return the TAO Line Search object. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TAO.getLineSearch", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ls); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":1757 * property appctx: * """Application context.""" * def __get__(self) -> Any: # <<<<<<<<<<<<<< * return self.getAppCtx() * def __set__(self, value: Any): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_6appctx_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_6appctx_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_6appctx___get__(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_6appctx___get__(struct PyPetscTAOObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/TAO.pyx":1758 * """Application context.""" * def __get__(self) -> Any: * return self.getAppCtx() # <<<<<<<<<<<<<< * def __set__(self, value: Any): * self.setAppCtx(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getAppCtx); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 1758, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 1758, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TAO.pyx":1757 * property appctx: * """Application context.""" * def __get__(self) -> Any: # <<<<<<<<<<<<<< * return self.getAppCtx() * def __set__(self, value: Any): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TAO.appctx.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":1759 * def __get__(self) -> Any: * return self.getAppCtx() * def __set__(self, value: Any): # <<<<<<<<<<<<<< * self.setAppCtx(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_3TAO_6appctx_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_3TAO_6appctx_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_6appctx_2__set__(((struct PyPetscTAOObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_3TAO_6appctx_2__set__(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "petsc4py/PETSc/TAO.pyx":1760 * return self.getAppCtx() * def __set__(self, value: Any): * self.setAppCtx(value) # <<<<<<<<<<<<<< * * # --- linear solver --- */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setAppCtx); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 1760, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_value}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 1760, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/TAO.pyx":1759 * def __get__(self) -> Any: * return self.getAppCtx() * def __set__(self, value: Any): # <<<<<<<<<<<<<< * self.setAppCtx(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TAO.appctx.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":1766 * property ksp: * """Linear solver.""" * def __get__(self) -> KSP: # <<<<<<<<<<<<<< * return self.getKSP() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_3ksp_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_3ksp_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_3ksp___get__(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_3ksp___get__(struct PyPetscTAOObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/TAO.pyx":1767 * """Linear solver.""" * def __get__(self) -> KSP: * return self.getKSP() # <<<<<<<<<<<<<< * * # --- tolerances --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getKSP); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 1767, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 1767, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TAO.pyx":1766 * property ksp: * """Linear solver.""" * def __get__(self) -> KSP: # <<<<<<<<<<<<<< * return self.getKSP() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TAO.ksp.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":1774 * property ftol: * """Broken.""" * def __get__(self) -> Any: # <<<<<<<<<<<<<< * return self.getFunctionTolerances() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_4ftol_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_4ftol_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_4ftol___get__(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_4ftol___get__(struct PyPetscTAOObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/TAO.pyx":1775 * """Broken.""" * def __get__(self) -> Any: * return self.getFunctionTolerances() # <<<<<<<<<<<<<< * def __set__(self, value): * if isinstance(value, (tuple, list)): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getFunctionTolerances); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 1775, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 1775, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TAO.pyx":1774 * property ftol: * """Broken.""" * def __get__(self) -> Any: # <<<<<<<<<<<<<< * return self.getFunctionTolerances() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TAO.ftol.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":1776 * def __get__(self) -> Any: * return self.getFunctionTolerances() * def __set__(self, value): # <<<<<<<<<<<<<< * if isinstance(value, (tuple, list)): * self.setFunctionTolerances(*value) */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_3TAO_4ftol_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_3TAO_4ftol_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_4ftol_2__set__(((struct PyPetscTAOObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_3TAO_4ftol_2__set__(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "petsc4py/PETSc/TAO.pyx":1777 * return self.getFunctionTolerances() * def __set__(self, value): * if isinstance(value, (tuple, list)): # <<<<<<<<<<<<<< * self.setFunctionTolerances(*value) * elif isinstance(value, dict): */ __pyx_t_2 = PyTuple_Check(__pyx_v_value); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = PyList_Check(__pyx_v_value); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "petsc4py/PETSc/TAO.pyx":1778 * def __set__(self, value): * if isinstance(value, (tuple, list)): * self.setFunctionTolerances(*value) # <<<<<<<<<<<<<< * elif isinstance(value, dict): * self.setFunctionTolerances(**value) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setFunctionTolerances); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 1778, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1778, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 1778, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/TAO.pyx":1777 * return self.getFunctionTolerances() * def __set__(self, value): * if isinstance(value, (tuple, list)): # <<<<<<<<<<<<<< * self.setFunctionTolerances(*value) * elif isinstance(value, dict): */ goto __pyx_L3; } /* "petsc4py/PETSc/TAO.pyx":1779 * if isinstance(value, (tuple, list)): * self.setFunctionTolerances(*value) * elif isinstance(value, dict): # <<<<<<<<<<<<<< * self.setFunctionTolerances(**value) * else: */ __pyx_t_1 = PyDict_Check(__pyx_v_value); if (likely(__pyx_t_1)) { /* "petsc4py/PETSc/TAO.pyx":1780 * self.setFunctionTolerances(*value) * elif isinstance(value, dict): * self.setFunctionTolerances(**value) # <<<<<<<<<<<<<< * else: * raise TypeError("expecting tuple/list or dict") */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setFunctionTolerances); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 1780, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (unlikely(__pyx_v_value == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(52, 1780, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_value))) { __pyx_t_4 = PyDict_Copy(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1780, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } else { __pyx_t_4 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1780, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 1780, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/TAO.pyx":1779 * if isinstance(value, (tuple, list)): * self.setFunctionTolerances(*value) * elif isinstance(value, dict): # <<<<<<<<<<<<<< * self.setFunctionTolerances(**value) * else: */ goto __pyx_L3; } /* "petsc4py/PETSc/TAO.pyx":1782 * self.setFunctionTolerances(**value) * else: * raise TypeError("expecting tuple/list or dict") # <<<<<<<<<<<<<< * * property gtol: */ /*else*/ { __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 1782, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(52, 1782, __pyx_L1_error) } __pyx_L3:; /* "petsc4py/PETSc/TAO.pyx":1776 * def __get__(self) -> Any: * return self.getFunctionTolerances() * def __set__(self, value): # <<<<<<<<<<<<<< * if isinstance(value, (tuple, list)): * self.setFunctionTolerances(*value) */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.TAO.ftol.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":1786 * property gtol: * """Broken.""" * def __get__(self) -> Any: # <<<<<<<<<<<<<< * return self.getGradientTolerances() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_4gtol_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_4gtol_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_4gtol___get__(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_4gtol___get__(struct PyPetscTAOObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/TAO.pyx":1787 * """Broken.""" * def __get__(self) -> Any: * return self.getGradientTolerances() # <<<<<<<<<<<<<< * def __set__(self, value): * if isinstance(value, (tuple, list)): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getGradientTolerances); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 1787, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 1787, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TAO.pyx":1786 * property gtol: * """Broken.""" * def __get__(self) -> Any: # <<<<<<<<<<<<<< * return self.getGradientTolerances() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TAO.gtol.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":1788 * def __get__(self) -> Any: * return self.getGradientTolerances() * def __set__(self, value): # <<<<<<<<<<<<<< * if isinstance(value, (tuple, list)): * self.getGradientTolerances(*value) */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_3TAO_4gtol_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_3TAO_4gtol_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_4gtol_2__set__(((struct PyPetscTAOObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_3TAO_4gtol_2__set__(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "petsc4py/PETSc/TAO.pyx":1789 * return self.getGradientTolerances() * def __set__(self, value): * if isinstance(value, (tuple, list)): # <<<<<<<<<<<<<< * self.getGradientTolerances(*value) * elif isinstance(value, dict): */ __pyx_t_2 = PyTuple_Check(__pyx_v_value); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = PyList_Check(__pyx_v_value); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "petsc4py/PETSc/TAO.pyx":1790 * def __set__(self, value): * if isinstance(value, (tuple, list)): * self.getGradientTolerances(*value) # <<<<<<<<<<<<<< * elif isinstance(value, dict): * self.getGradientTolerances(**value) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getGradientTolerances); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 1790, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1790, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 1790, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/TAO.pyx":1789 * return self.getGradientTolerances() * def __set__(self, value): * if isinstance(value, (tuple, list)): # <<<<<<<<<<<<<< * self.getGradientTolerances(*value) * elif isinstance(value, dict): */ goto __pyx_L3; } /* "petsc4py/PETSc/TAO.pyx":1791 * if isinstance(value, (tuple, list)): * self.getGradientTolerances(*value) * elif isinstance(value, dict): # <<<<<<<<<<<<<< * self.getGradientTolerances(**value) * else: */ __pyx_t_1 = PyDict_Check(__pyx_v_value); if (likely(__pyx_t_1)) { /* "petsc4py/PETSc/TAO.pyx":1792 * self.getGradientTolerances(*value) * elif isinstance(value, dict): * self.getGradientTolerances(**value) # <<<<<<<<<<<<<< * else: * raise TypeError("expecting tuple/list or dict") */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getGradientTolerances); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 1792, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (unlikely(__pyx_v_value == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(52, 1792, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_value))) { __pyx_t_4 = PyDict_Copy(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1792, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } else { __pyx_t_4 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1792, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 1792, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/TAO.pyx":1791 * if isinstance(value, (tuple, list)): * self.getGradientTolerances(*value) * elif isinstance(value, dict): # <<<<<<<<<<<<<< * self.getGradientTolerances(**value) * else: */ goto __pyx_L3; } /* "petsc4py/PETSc/TAO.pyx":1794 * self.getGradientTolerances(**value) * else: * raise TypeError("expecting tuple/list or dict") # <<<<<<<<<<<<<< * * property ctol: */ /*else*/ { __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 1794, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(52, 1794, __pyx_L1_error) } __pyx_L3:; /* "petsc4py/PETSc/TAO.pyx":1788 * def __get__(self) -> Any: * return self.getGradientTolerances() * def __set__(self, value): # <<<<<<<<<<<<<< * if isinstance(value, (tuple, list)): * self.getGradientTolerances(*value) */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.TAO.gtol.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":1798 * property ctol: * """Broken.""" * def __get__(self) -> Any: # <<<<<<<<<<<<<< * return self.getConstraintTolerances() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_4ctol_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_4ctol_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_4ctol___get__(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_4ctol___get__(struct PyPetscTAOObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/TAO.pyx":1799 * """Broken.""" * def __get__(self) -> Any: * return self.getConstraintTolerances() # <<<<<<<<<<<<<< * def __set__(self, value): * if isinstance(value, (tuple, list)): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getConstraintTolerances); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 1799, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 1799, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TAO.pyx":1798 * property ctol: * """Broken.""" * def __get__(self) -> Any: # <<<<<<<<<<<<<< * return self.getConstraintTolerances() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TAO.ctol.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":1800 * def __get__(self) -> Any: * return self.getConstraintTolerances() * def __set__(self, value): # <<<<<<<<<<<<<< * if isinstance(value, (tuple, list)): * self.getConstraintTolerances(*value) */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_3TAO_4ctol_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_3TAO_4ctol_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_4ctol_2__set__(((struct PyPetscTAOObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_3TAO_4ctol_2__set__(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "petsc4py/PETSc/TAO.pyx":1801 * return self.getConstraintTolerances() * def __set__(self, value): * if isinstance(value, (tuple, list)): # <<<<<<<<<<<<<< * self.getConstraintTolerances(*value) * elif isinstance(value, dict): */ __pyx_t_2 = PyTuple_Check(__pyx_v_value); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = PyList_Check(__pyx_v_value); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "petsc4py/PETSc/TAO.pyx":1802 * def __set__(self, value): * if isinstance(value, (tuple, list)): * self.getConstraintTolerances(*value) # <<<<<<<<<<<<<< * elif isinstance(value, dict): * self.getConstraintTolerances(**value) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getConstraintTolerances); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 1802, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1802, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 1802, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/TAO.pyx":1801 * return self.getConstraintTolerances() * def __set__(self, value): * if isinstance(value, (tuple, list)): # <<<<<<<<<<<<<< * self.getConstraintTolerances(*value) * elif isinstance(value, dict): */ goto __pyx_L3; } /* "petsc4py/PETSc/TAO.pyx":1803 * if isinstance(value, (tuple, list)): * self.getConstraintTolerances(*value) * elif isinstance(value, dict): # <<<<<<<<<<<<<< * self.getConstraintTolerances(**value) * else: */ __pyx_t_1 = PyDict_Check(__pyx_v_value); if (likely(__pyx_t_1)) { /* "petsc4py/PETSc/TAO.pyx":1804 * self.getConstraintTolerances(*value) * elif isinstance(value, dict): * self.getConstraintTolerances(**value) # <<<<<<<<<<<<<< * else: * raise TypeError("expecting tuple/list or dict") */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getConstraintTolerances); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 1804, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (unlikely(__pyx_v_value == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(52, 1804, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_value))) { __pyx_t_4 = PyDict_Copy(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1804, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } else { __pyx_t_4 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1804, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 1804, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/TAO.pyx":1803 * if isinstance(value, (tuple, list)): * self.getConstraintTolerances(*value) * elif isinstance(value, dict): # <<<<<<<<<<<<<< * self.getConstraintTolerances(**value) * else: */ goto __pyx_L3; } /* "petsc4py/PETSc/TAO.pyx":1806 * self.getConstraintTolerances(**value) * else: * raise TypeError("expecting tuple/list or dict") # <<<<<<<<<<<<<< * * # --- iteration --- */ /*else*/ { __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 1806, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(52, 1806, __pyx_L1_error) } __pyx_L3:; /* "petsc4py/PETSc/TAO.pyx":1800 * def __get__(self) -> Any: * return self.getConstraintTolerances() * def __set__(self, value): # <<<<<<<<<<<<<< * if isinstance(value, (tuple, list)): * self.getConstraintTolerances(*value) */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.TAO.ctol.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":1812 * property its: * """Number of iterations.""" * def __get__(self) -> int: # <<<<<<<<<<<<<< * return self.getIterationNumber() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_3its_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_3its_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_3its___get__(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_3its___get__(struct PyPetscTAOObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/TAO.pyx":1813 * """Number of iterations.""" * def __get__(self) -> int: * return self.getIterationNumber() # <<<<<<<<<<<<<< * * property gnorm: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getIterationNumber); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 1813, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 1813, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TAO.pyx":1812 * property its: * """Number of iterations.""" * def __get__(self) -> int: # <<<<<<<<<<<<<< * return self.getIterationNumber() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TAO.its.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":1817 * property gnorm: * """Gradient norm.""" * def __get__(self) -> float: # <<<<<<<<<<<<<< * return self.getSolutionNorm()[1] * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_5gnorm_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_5gnorm_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_5gnorm___get__(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_5gnorm___get__(struct PyPetscTAOObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/TAO.pyx":1818 * """Gradient norm.""" * def __get__(self) -> float: * return self.getSolutionNorm()[1] # <<<<<<<<<<<<<< * * property cnorm: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getSolutionNorm); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 1818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 1818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 1818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TAO.pyx":1817 * property gnorm: * """Gradient norm.""" * def __get__(self) -> float: # <<<<<<<<<<<<<< * return self.getSolutionNorm()[1] * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TAO.gnorm.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":1822 * property cnorm: * """Constraints norm.""" * def __get__(self) -> float: # <<<<<<<<<<<<<< * return self.getSolutionNorm()[2] * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_5cnorm_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_5cnorm_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_5cnorm___get__(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_5cnorm___get__(struct PyPetscTAOObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/TAO.pyx":1823 * """Constraints norm.""" * def __get__(self) -> float: * return self.getSolutionNorm()[2] # <<<<<<<<<<<<<< * * property solution: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getSolutionNorm); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 1823, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 1823, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 1823, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TAO.pyx":1822 * property cnorm: * """Constraints norm.""" * def __get__(self) -> float: # <<<<<<<<<<<<<< * return self.getSolutionNorm()[2] * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TAO.cnorm.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":1827 * property solution: * """Solution vector.""" * def __get__(self) -> Vec: # <<<<<<<<<<<<<< * return self.getSolution() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_8solution_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_8solution_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_8solution___get__(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_8solution___get__(struct PyPetscTAOObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/TAO.pyx":1828 * """Solution vector.""" * def __get__(self) -> Vec: * return self.getSolution() # <<<<<<<<<<<<<< * * property objective: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getSolution); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 1828, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 1828, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TAO.pyx":1827 * property solution: * """Solution vector.""" * def __get__(self) -> Vec: # <<<<<<<<<<<<<< * return self.getSolution() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TAO.solution.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":1832 * property objective: * """Objective value.""" * def __get__(self) -> float: # <<<<<<<<<<<<<< * return self.getObjectiveValue() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_9objective_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_9objective_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_9objective___get__(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_9objective___get__(struct PyPetscTAOObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/TAO.pyx":1833 * """Objective value.""" * def __get__(self) -> float: * return self.getObjectiveValue() # <<<<<<<<<<<<<< * * property function: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getObjectiveValue); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 1833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 1833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TAO.pyx":1832 * property objective: * """Objective value.""" * def __get__(self) -> float: # <<<<<<<<<<<<<< * return self.getObjectiveValue() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TAO.objective.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":1837 * property function: * """Objective value.""" * def __get__(self) -> float: # <<<<<<<<<<<<<< * return self.getFunctionValue() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_8function_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_8function_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_8function___get__(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_8function___get__(struct PyPetscTAOObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/TAO.pyx":1838 * """Objective value.""" * def __get__(self) -> float: * return self.getFunctionValue() # <<<<<<<<<<<<<< * * property gradient: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getFunctionValue); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 1838, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 1838, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TAO.pyx":1837 * property function: * """Objective value.""" * def __get__(self) -> float: # <<<<<<<<<<<<<< * return self.getFunctionValue() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TAO.function.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":1842 * property gradient: * """Gradient vector.""" * def __get__(self) -> Vec: # <<<<<<<<<<<<<< * return self.getGradient()[0] * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_8gradient_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_8gradient_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_8gradient___get__(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_8gradient___get__(struct PyPetscTAOObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/TAO.pyx":1843 * """Gradient vector.""" * def __get__(self) -> Vec: * return self.getGradient()[0] # <<<<<<<<<<<<<< * * # --- convergence --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getGradient); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 1843, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 1843, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 1843, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TAO.pyx":1842 * property gradient: * """Gradient vector.""" * def __get__(self) -> Vec: # <<<<<<<<<<<<<< * return self.getGradient()[0] * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TAO.gradient.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":1849 * property reason: * """Converged reason.""" * def __get__(self) -> ConvergedReason: # <<<<<<<<<<<<<< * return self.getConvergedReason() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_6reason_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_6reason_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_6reason___get__(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_6reason___get__(struct PyPetscTAOObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/TAO.pyx":1850 * """Converged reason.""" * def __get__(self) -> ConvergedReason: * return self.getConvergedReason() # <<<<<<<<<<<<<< * * property iterating: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getConvergedReason); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 1850, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 1850, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TAO.pyx":1849 * property reason: * """Converged reason.""" * def __get__(self) -> ConvergedReason: # <<<<<<<<<<<<<< * return self.getConvergedReason() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TAO.reason.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":1854 * property iterating: * """Boolean indicating if the solver has not converged yet.""" * def __get__(self) -> bool: # <<<<<<<<<<<<<< * return self.reason == 0 * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_9iterating_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_9iterating_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_9iterating___get__(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_9iterating___get__(struct PyPetscTAOObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/TAO.pyx":1855 * """Boolean indicating if the solver has not converged yet.""" * def __get__(self) -> bool: * return self.reason == 0 # <<<<<<<<<<<<<< * * property converged: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reason); if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 1855, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_t_1, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 1855, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TAO.pyx":1854 * property iterating: * """Boolean indicating if the solver has not converged yet.""" * def __get__(self) -> bool: # <<<<<<<<<<<<<< * return self.reason == 0 * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TAO.iterating.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":1859 * property converged: * """Boolean indicating if the solver has converged.""" * def __get__(self) -> bool: # <<<<<<<<<<<<<< * return self.reason > 0 * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_9converged_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_9converged_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_9converged___get__(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_9converged___get__(struct PyPetscTAOObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/TAO.pyx":1860 * """Boolean indicating if the solver has converged.""" * def __get__(self) -> bool: * return self.reason > 0 # <<<<<<<<<<<<<< * * property diverged: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reason); if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 1860, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 1860, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TAO.pyx":1859 * property converged: * """Boolean indicating if the solver has converged.""" * def __get__(self) -> bool: # <<<<<<<<<<<<<< * return self.reason > 0 * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TAO.converged.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":1864 * property diverged: * """Boolean indicating if the solver has failed.""" * def __get__(self) -> bool: # <<<<<<<<<<<<<< * return self.reason < 0 * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_8diverged_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_8diverged_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_8diverged___get__(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_8diverged___get__(struct PyPetscTAOObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/TAO.pyx":1865 * """Boolean indicating if the solver has failed.""" * def __get__(self) -> bool: * return self.reason < 0 # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reason); if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 1865, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 1865, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TAO.pyx":1864 * property diverged: * """Boolean indicating if the solver has failed.""" * def __get__(self) -> bool: # <<<<<<<<<<<<<< * return self.reason < 0 * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TAO.diverged.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":1911 * Reason = TAOLineSearchConvergedReason * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.taols * self.taols = NULL */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_8petsc4py_5PETSc_13TAOLineSearch___cinit__(((struct PyPetscTAOLineSearchObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_13TAOLineSearch___cinit__(struct PyPetscTAOLineSearchObject *__pyx_v_self) { int __pyx_r; /* "petsc4py/PETSc/TAO.pyx":1912 * * def __cinit__(self): * self.obj = &self.taols # <<<<<<<<<<<<<< * self.taols = NULL * */ __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->taols)); /* "petsc4py/PETSc/TAO.pyx":1913 * def __cinit__(self): * self.obj = &self.taols * self.taols = NULL # <<<<<<<<<<<<<< * * def view(self, Viewer viewer=None) -> None: */ __pyx_v_self->taols = NULL; /* "petsc4py/PETSc/TAO.pyx":1911 * Reason = TAOLineSearchConvergedReason * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.taols * self.taols = NULL */ /* function exit code */ __pyx_r = 0; return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":1915 * self.taols = NULL * * def view(self, Viewer viewer=None) -> None: # <<<<<<<<<<<<<< * """View the linesearch object. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_3view(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_13TAOLineSearch_2view, "TAOLineSearch.view(self, viewer: Viewer | None = None) -> None\nView the linesearch object.\n\n Collective.\n\n Parameters\n ----------\n viewer\n A `Viewer` instance or `None` for the default viewer.\n\n See Also\n --------\n petsc.TaoLineSearchView\n\n \nSource code at petsc4py/PETSc/TAO.pyx:1915"); static PyObject *__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_3view(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscViewerObject *__pyx_v_viewer = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("view (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscViewerObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_viewer); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 1915, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "view") < 0)) __PYX_ERR(52, 1915, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, __pyx_nargs); __PYX_ERR(52, 1915, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TAOLineSearch.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(52, 1915, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_13TAOLineSearch_2view(((struct PyPetscTAOLineSearchObject *)__pyx_v_self), __pyx_v_viewer); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_13TAOLineSearch_2view(struct PyPetscTAOLineSearchObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer) { PetscViewer __pyx_v_vwr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscViewer __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("view", 1); /* "petsc4py/PETSc/TAO.pyx":1930 * * """ * cdef PetscViewer vwr = NULL # <<<<<<<<<<<<<< * if viewer is not None: vwr = viewer.vwr * CHKERR( TaoLineSearchView(self.taols, vwr) ) */ __pyx_v_vwr = NULL; /* "petsc4py/PETSc/TAO.pyx":1931 * """ * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr # <<<<<<<<<<<<<< * CHKERR( TaoLineSearchView(self.taols, vwr) ) * */ __pyx_t_1 = (((PyObject *)__pyx_v_viewer) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_viewer->vwr; __pyx_v_vwr = __pyx_t_2; } /* "petsc4py/PETSc/TAO.pyx":1932 * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr * CHKERR( TaoLineSearchView(self.taols, vwr) ) # <<<<<<<<<<<<<< * * def destroy(self) -> Self: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoLineSearchView(__pyx_v_self->taols, __pyx_v_vwr)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1932, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":1915 * self.taols = NULL * * def view(self, Viewer viewer=None) -> None: # <<<<<<<<<<<<<< * """View the linesearch object. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAOLineSearch.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":1934 * CHKERR( TaoLineSearchView(self.taols, vwr) ) * * def destroy(self) -> Self: # <<<<<<<<<<<<<< * """Destroy the linesearch object. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_5destroy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_13TAOLineSearch_4destroy, "TAOLineSearch.destroy(self) -> Self\nDestroy the linesearch object.\n\n Collective.\n\n See Also\n --------\n petsc.TaoLineSearchDestroy\n\n \nSource code at petsc4py/PETSc/TAO.pyx:1934"); static PyObject *__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_5destroy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("destroy (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_13TAOLineSearch_4destroy(((struct PyPetscTAOLineSearchObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_13TAOLineSearch_4destroy(struct PyPetscTAOLineSearchObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("destroy", 1); /* "petsc4py/PETSc/TAO.pyx":1944 * * """ * CHKERR( TaoLineSearchDestroy(&self.taols) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoLineSearchDestroy((&__pyx_v_self->taols))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1944, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":1945 * """ * CHKERR( TaoLineSearchDestroy(&self.taols) ) * return self # <<<<<<<<<<<<<< * * def create(self, comm=None) -> Self: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/TAO.pyx":1934 * CHKERR( TaoLineSearchView(self.taols, vwr) ) * * def destroy(self) -> Self: # <<<<<<<<<<<<<< * """Destroy the linesearch object. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAOLineSearch.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":1947 * return self * * def create(self, comm=None) -> Self: # <<<<<<<<<<<<<< * """Create a TAO linesearch. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_7create(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_13TAOLineSearch_6create, "TAOLineSearch.create(self, comm=None) -> Self\nCreate a TAO linesearch.\n\n Collective.\n\n Parameters\n ----------\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n Sys.getDefaultComm, petsc.TaoLineSearchCreate\n\n \nSource code at petsc4py/PETSc/TAO.pyx:1947"); static PyObject *__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_7create(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 1947, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "create") < 0)) __PYX_ERR(52, 1947, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_comm = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, __pyx_nargs); __PYX_ERR(52, 1947, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TAOLineSearch.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_13TAOLineSearch_6create(((struct PyPetscTAOLineSearchObject *)__pyx_v_self), __pyx_v_comm); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_13TAOLineSearch_6create(struct PyPetscTAOLineSearchObject *__pyx_v_self, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; TaoLineSearch __pyx_v_newtaols; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create", 1); /* "petsc4py/PETSc/TAO.pyx":1962 * * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscTAOLineSearch newtaols = NULL * CHKERR( TaoLineSearchCreate(ccomm, &newtaols) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(52, 1962, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/TAO.pyx":1963 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscTAOLineSearch newtaols = NULL # <<<<<<<<<<<<<< * CHKERR( TaoLineSearchCreate(ccomm, &newtaols) ) * CHKERR( PetscCLEAR(self.obj) ); self.taols = newtaols */ __pyx_v_newtaols = NULL; /* "petsc4py/PETSc/TAO.pyx":1964 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscTAOLineSearch newtaols = NULL * CHKERR( TaoLineSearchCreate(ccomm, &newtaols) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.taols = newtaols * return self */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoLineSearchCreate(__pyx_v_ccomm, (&__pyx_v_newtaols))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1964, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":1965 * cdef PetscTAOLineSearch newtaols = NULL * CHKERR( TaoLineSearchCreate(ccomm, &newtaols) ) * CHKERR( PetscCLEAR(self.obj) ); self.taols = newtaols # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1965, __pyx_L1_error) __pyx_v_self->taols = __pyx_v_newtaols; /* "petsc4py/PETSc/TAO.pyx":1966 * CHKERR( TaoLineSearchCreate(ccomm, &newtaols) ) * CHKERR( PetscCLEAR(self.obj) ); self.taols = newtaols * return self # <<<<<<<<<<<<<< * * def setType(self, ls_type: Type | str) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/TAO.pyx":1947 * return self * * def create(self, comm=None) -> Self: # <<<<<<<<<<<<<< * """Create a TAO linesearch. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAOLineSearch.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":1968 * return self * * def setType(self, ls_type: Type | str) -> None: # <<<<<<<<<<<<<< * """Set the type of the linesearch. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_9setType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_13TAOLineSearch_8setType, "TAOLineSearch.setType(self, ls_type: Type | str) -> None\nSet the type of the linesearch.\n\n Logically collective.\n\n Parameters\n ----------\n ls_type\n The type of the solver.\n\n See Also\n --------\n getType, petsc.TaoLineSearchSetType\n\n \nSource code at petsc4py/PETSc/TAO.pyx:1968"); static PyObject *__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_9setType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_ls_type = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ls_type,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ls_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 1968, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setType") < 0)) __PYX_ERR(52, 1968, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_ls_type = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, __pyx_nargs); __PYX_ERR(52, 1968, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TAOLineSearch.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_13TAOLineSearch_8setType(((struct PyPetscTAOLineSearchObject *)__pyx_v_self), __pyx_v_ls_type); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_13TAOLineSearch_8setType(struct PyPetscTAOLineSearchObject *__pyx_v_self, PyObject *__pyx_v_ls_type) { TaoLineSearchType __pyx_v_ctype; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setType", 0); __Pyx_INCREF(__pyx_v_ls_type); /* "petsc4py/PETSc/TAO.pyx":1983 * * """ * cdef PetscTAOLineSearchType ctype = NULL # <<<<<<<<<<<<<< * ls_type = str2bytes(ls_type, &ctype) * CHKERR( TaoLineSearchSetType(self.taols, ctype) ) */ __pyx_v_ctype = NULL; /* "petsc4py/PETSc/TAO.pyx":1984 * """ * cdef PetscTAOLineSearchType ctype = NULL * ls_type = str2bytes(ls_type, &ctype) # <<<<<<<<<<<<<< * CHKERR( TaoLineSearchSetType(self.taols, ctype) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_ls_type, (&__pyx_v_ctype)); if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 1984, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_ls_type, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/TAO.pyx":1985 * cdef PetscTAOLineSearchType ctype = NULL * ls_type = str2bytes(ls_type, &ctype) * CHKERR( TaoLineSearchSetType(self.taols, ctype) ) # <<<<<<<<<<<<<< * * def getType(self) -> str: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoLineSearchSetType(__pyx_v_self->taols, __pyx_v_ctype)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1985, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":1968 * return self * * def setType(self, ls_type: Type | str) -> None: # <<<<<<<<<<<<<< * """Set the type of the linesearch. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TAOLineSearch.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ls_type); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":1987 * CHKERR( TaoLineSearchSetType(self.taols, ctype) ) * * def getType(self) -> str: # <<<<<<<<<<<<<< * """Return the type of the linesearch. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_11getType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_13TAOLineSearch_10getType, "TAOLineSearch.getType(self) -> str\nReturn the type of the linesearch.\n\n Not collective.\n\n See Also\n --------\n setType, petsc.TaoLineSearchGetType\n\n \nSource code at petsc4py/PETSc/TAO.pyx:1987"); static PyObject *__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_11getType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getType", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_13TAOLineSearch_10getType(((struct PyPetscTAOLineSearchObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_13TAOLineSearch_10getType(struct PyPetscTAOLineSearchObject *__pyx_v_self) { TaoLineSearchType __pyx_v_ctype; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getType", 1); /* "petsc4py/PETSc/TAO.pyx":1997 * * """ * cdef PetscTAOLineSearchType ctype = NULL # <<<<<<<<<<<<<< * CHKERR( TaoLineSearchGetType(self.taols, &ctype) ) * return bytes2str(ctype) */ __pyx_v_ctype = NULL; /* "petsc4py/PETSc/TAO.pyx":1998 * """ * cdef PetscTAOLineSearchType ctype = NULL * CHKERR( TaoLineSearchGetType(self.taols, &ctype) ) # <<<<<<<<<<<<<< * return bytes2str(ctype) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoLineSearchGetType(__pyx_v_self->taols, (&__pyx_v_ctype))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1998, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":1999 * cdef PetscTAOLineSearchType ctype = NULL * CHKERR( TaoLineSearchGetType(self.taols, &ctype) ) * return bytes2str(ctype) # <<<<<<<<<<<<<< * * def setFromOptions(self) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_ctype); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 1999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TAO.pyx":1987 * CHKERR( TaoLineSearchSetType(self.taols, ctype) ) * * def getType(self) -> str: # <<<<<<<<<<<<<< * """Return the type of the linesearch. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TAOLineSearch.getType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":2001 * return bytes2str(ctype) * * def setFromOptions(self) -> None: # <<<<<<<<<<<<<< * """Configure the linesearch from the options database. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_13setFromOptions(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_13TAOLineSearch_12setFromOptions, "TAOLineSearch.setFromOptions(self) -> None\nConfigure the linesearch from the options database.\n\n Collective.\n\n See Also\n --------\n petsc_options, petsc.TaoLineSearchSetFromOptions\n\n \nSource code at petsc4py/PETSc/TAO.pyx:2001"); static PyObject *__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_13setFromOptions(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFromOptions (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("setFromOptions", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setFromOptions", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_13TAOLineSearch_12setFromOptions(((struct PyPetscTAOLineSearchObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_13TAOLineSearch_12setFromOptions(struct PyPetscTAOLineSearchObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFromOptions", 1); /* "petsc4py/PETSc/TAO.pyx":2011 * * """ * CHKERR( TaoLineSearchSetFromOptions(self.taols) ) # <<<<<<<<<<<<<< * * def setUp(self) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoLineSearchSetFromOptions(__pyx_v_self->taols)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 2011, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":2001 * return bytes2str(ctype) * * def setFromOptions(self) -> None: # <<<<<<<<<<<<<< * """Configure the linesearch from the options database. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAOLineSearch.setFromOptions", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":2013 * CHKERR( TaoLineSearchSetFromOptions(self.taols) ) * * def setUp(self) -> None: # <<<<<<<<<<<<<< * """Set up the internal data structures for using the linesearch. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_15setUp(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_13TAOLineSearch_14setUp, "TAOLineSearch.setUp(self) -> None\nSet up the internal data structures for using the linesearch.\n\n Collective.\n\n See Also\n --------\n petsc.TaoLineSearchSetUp\n\n \nSource code at petsc4py/PETSc/TAO.pyx:2013"); static PyObject *__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_15setUp(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setUp (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("setUp", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setUp", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_13TAOLineSearch_14setUp(((struct PyPetscTAOLineSearchObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_13TAOLineSearch_14setUp(struct PyPetscTAOLineSearchObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setUp", 1); /* "petsc4py/PETSc/TAO.pyx":2023 * * """ * CHKERR( TaoLineSearchSetUp(self.taols) ) # <<<<<<<<<<<<<< * * def setOptionsPrefix(self, prefix) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoLineSearchSetUp(__pyx_v_self->taols)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 2023, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":2013 * CHKERR( TaoLineSearchSetFromOptions(self.taols) ) * * def setUp(self) -> None: # <<<<<<<<<<<<<< * """Set up the internal data structures for using the linesearch. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAOLineSearch.setUp", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":2025 * CHKERR( TaoLineSearchSetUp(self.taols) ) * * def setOptionsPrefix(self, prefix) -> None: # <<<<<<<<<<<<<< * """Set the prefix used for searching for options in the database. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_17setOptionsPrefix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_13TAOLineSearch_16setOptionsPrefix, "TAOLineSearch.setOptionsPrefix(self, prefix) -> None\nSet the prefix used for searching for options in the database.\n\n Logically collective.\n\n See Also\n --------\n petsc_options, petsc.TaoLineSearchSetOptionsPrefix\n\n \nSource code at petsc4py/PETSc/TAO.pyx:2025"); static PyObject *__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_17setOptionsPrefix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_prefix = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setOptionsPrefix (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_prefix,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_prefix)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 2025, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setOptionsPrefix") < 0)) __PYX_ERR(52, 2025, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_prefix = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setOptionsPrefix", 1, 1, 1, __pyx_nargs); __PYX_ERR(52, 2025, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TAOLineSearch.setOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_13TAOLineSearch_16setOptionsPrefix(((struct PyPetscTAOLineSearchObject *)__pyx_v_self), __pyx_v_prefix); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_13TAOLineSearch_16setOptionsPrefix(struct PyPetscTAOLineSearchObject *__pyx_v_self, PyObject *__pyx_v_prefix) { char const *__pyx_v_cprefix; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setOptionsPrefix", 0); __Pyx_INCREF(__pyx_v_prefix); /* "petsc4py/PETSc/TAO.pyx":2035 * * """ * cdef const char *cprefix = NULL # <<<<<<<<<<<<<< * prefix = str2bytes(prefix, &cprefix) * CHKERR( TaoLineSearchSetOptionsPrefix(self.taols, cprefix) ) */ __pyx_v_cprefix = NULL; /* "petsc4py/PETSc/TAO.pyx":2036 * """ * cdef const char *cprefix = NULL * prefix = str2bytes(prefix, &cprefix) # <<<<<<<<<<<<<< * CHKERR( TaoLineSearchSetOptionsPrefix(self.taols, cprefix) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_prefix, (&__pyx_v_cprefix)); if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 2036, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_prefix, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/TAO.pyx":2037 * cdef const char *cprefix = NULL * prefix = str2bytes(prefix, &cprefix) * CHKERR( TaoLineSearchSetOptionsPrefix(self.taols, cprefix) ) # <<<<<<<<<<<<<< * * def getOptionsPrefix(self) -> str: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoLineSearchSetOptionsPrefix(__pyx_v_self->taols, __pyx_v_cprefix)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 2037, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":2025 * CHKERR( TaoLineSearchSetUp(self.taols) ) * * def setOptionsPrefix(self, prefix) -> None: # <<<<<<<<<<<<<< * """Set the prefix used for searching for options in the database. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TAOLineSearch.setOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_prefix); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":2039 * CHKERR( TaoLineSearchSetOptionsPrefix(self.taols, cprefix) ) * * def getOptionsPrefix(self) -> str: # <<<<<<<<<<<<<< * """Return the prefix used for searching for options in the database. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_19getOptionsPrefix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_13TAOLineSearch_18getOptionsPrefix, "TAOLineSearch.getOptionsPrefix(self) -> str\nReturn the prefix used for searching for options in the database.\n\n Not collective.\n\n See Also\n --------\n petsc_options, setOptionsPrefix, petsc.TaoLineSearchGetOptionsPrefix\n\n \nSource code at petsc4py/PETSc/TAO.pyx:2039"); static PyObject *__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_19getOptionsPrefix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getOptionsPrefix (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getOptionsPrefix", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getOptionsPrefix", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_13TAOLineSearch_18getOptionsPrefix(((struct PyPetscTAOLineSearchObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_13TAOLineSearch_18getOptionsPrefix(struct PyPetscTAOLineSearchObject *__pyx_v_self) { char const *__pyx_v_prefix; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getOptionsPrefix", 1); /* "petsc4py/PETSc/TAO.pyx":2049 * * """ * cdef const char *prefix = NULL # <<<<<<<<<<<<<< * CHKERR( TaoLineSearchGetOptionsPrefix(self.taols, &prefix) ) * return bytes2str(prefix) */ __pyx_v_prefix = NULL; /* "petsc4py/PETSc/TAO.pyx":2050 * """ * cdef const char *prefix = NULL * CHKERR( TaoLineSearchGetOptionsPrefix(self.taols, &prefix) ) # <<<<<<<<<<<<<< * return bytes2str(prefix) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoLineSearchGetOptionsPrefix(__pyx_v_self->taols, (&__pyx_v_prefix))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 2050, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":2051 * cdef const char *prefix = NULL * CHKERR( TaoLineSearchGetOptionsPrefix(self.taols, &prefix) ) * return bytes2str(prefix) # <<<<<<<<<<<<<< * * def setObjective(self, objective : TAOLSObjectiveFunction, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_prefix); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 2051, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TAO.pyx":2039 * CHKERR( TaoLineSearchSetOptionsPrefix(self.taols, cprefix) ) * * def getOptionsPrefix(self) -> str: # <<<<<<<<<<<<<< * """Return the prefix used for searching for options in the database. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TAOLineSearch.getOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":2053 * return bytes2str(prefix) * * def setObjective(self, objective : TAOLSObjectiveFunction, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: # <<<<<<<<<<<<<< * """Set the objective function evaluation callback. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_21setObjective(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_13TAOLineSearch_20setObjective, "TAOLineSearch.setObjective(self, objective: TAOLSObjectiveFunction, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nSet the objective function evaluation callback.\n\n Logically collective.\n\n Parameters\n ----------\n objective\n The objective function callback.\n args\n Positional arguments for the callback.\n kargs\n Keyword arguments for the callback.\n\n See Also\n --------\n setGradient, setObjectiveGradient\n petsc.TaoLineSearchSetObjectiveRoutine\n\n \nSource code at petsc4py/PETSc/TAO.pyx:2053"); static PyObject *__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_21setObjective(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_objective = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setObjective (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_objective,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_objective)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 2053, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 2053, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 2053, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setObjective") < 0)) __PYX_ERR(52, 2053, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_objective = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setObjective", 0, 1, 3, __pyx_nargs); __PYX_ERR(52, 2053, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TAOLineSearch.setObjective", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_13TAOLineSearch_20setObjective(((struct PyPetscTAOLineSearchObject *)__pyx_v_self), __pyx_v_objective, __pyx_v_args, __pyx_v_kargs); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_13TAOLineSearch_20setObjective(struct PyPetscTAOLineSearchObject *__pyx_v_self, PyObject *__pyx_v_objective, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setObjective", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/TAO.pyx":2073 * * """ * CHKERR( TaoLineSearchSetObjectiveRoutine(self.taols, TAOLS_Objective, NULL) ) # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoLineSearchSetObjectiveRoutine(__pyx_v_self->taols, __pyx_f_8petsc4py_5PETSc_TAOLS_Objective, NULL)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 2073, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":2074 * """ * CHKERR( TaoLineSearchSetObjectiveRoutine(self.taols, TAOLS_Objective, NULL) ) * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * self.set_attr("__objective__", (objective, args, kargs)) */ __pyx_t_2 = (__pyx_v_args == Py_None); if (__pyx_t_2) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/TAO.pyx":2075 * CHKERR( TaoLineSearchSetObjectiveRoutine(self.taols, TAOLS_Objective, NULL) ) * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * self.set_attr("__objective__", (objective, args, kargs)) * */ __pyx_t_2 = (__pyx_v_kargs == Py_None); if (__pyx_t_2) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 2075, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "petsc4py/PETSc/TAO.pyx":2076 * if args is None: args = () * if kargs is None: kargs = {} * self.set_attr("__objective__", (objective, args, kargs)) # <<<<<<<<<<<<<< * * def setGradient(self, gradient: TAOLSGradientFunction, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 2076, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_objective); __Pyx_GIVEREF(__pyx_v_objective); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_objective)) __PYX_ERR(52, 2076, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args)) __PYX_ERR(52, 2076, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs)) __PYX_ERR(52, 2076, __pyx_L1_error); __pyx_t_4 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAOLineSearch *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__objective__"), __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 2076, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/TAO.pyx":2053 * return bytes2str(prefix) * * def setObjective(self, objective : TAOLSObjectiveFunction, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: # <<<<<<<<<<<<<< * """Set the objective function evaluation callback. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.TAOLineSearch.setObjective", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":2078 * self.set_attr("__objective__", (objective, args, kargs)) * * def setGradient(self, gradient: TAOLSGradientFunction, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: # <<<<<<<<<<<<<< * """Set the gradient evaluation callback. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_23setGradient(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_13TAOLineSearch_22setGradient, "TAOLineSearch.setGradient(self, gradient: TAOLSGradientFunction, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nSet the gradient evaluation callback.\n\n Logically collective.\n\n Parameters\n ----------\n gradient\n The gradient callback.\n g\n The vector to store the gradient.\n args\n Positional arguments for the callback.\n kargs\n Keyword arguments for the callback.\n\n See Also\n --------\n setObjective, setObjectiveGradient, setHessian\n petsc.TaoLineSearchSetGradientRoutine\n\n \nSource code at petsc4py/PETSc/TAO.pyx:2078"); static PyObject *__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_23setGradient(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_gradient = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setGradient (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gradient,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gradient)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 2078, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 2078, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 2078, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setGradient") < 0)) __PYX_ERR(52, 2078, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_gradient = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setGradient", 0, 1, 3, __pyx_nargs); __PYX_ERR(52, 2078, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TAOLineSearch.setGradient", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_13TAOLineSearch_22setGradient(((struct PyPetscTAOLineSearchObject *)__pyx_v_self), __pyx_v_gradient, __pyx_v_args, __pyx_v_kargs); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_13TAOLineSearch_22setGradient(struct PyPetscTAOLineSearchObject *__pyx_v_self, PyObject *__pyx_v_gradient, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setGradient", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/TAO.pyx":2100 * * """ * CHKERR( TaoLineSearchSetGradientRoutine(self.taols, TAOLS_Gradient, NULL) ) # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoLineSearchSetGradientRoutine(__pyx_v_self->taols, __pyx_f_8petsc4py_5PETSc_TAOLS_Gradient, NULL)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 2100, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":2101 * """ * CHKERR( TaoLineSearchSetGradientRoutine(self.taols, TAOLS_Gradient, NULL) ) * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * self.set_attr("__gradient__", (gradient, args, kargs)) */ __pyx_t_2 = (__pyx_v_args == Py_None); if (__pyx_t_2) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/TAO.pyx":2102 * CHKERR( TaoLineSearchSetGradientRoutine(self.taols, TAOLS_Gradient, NULL) ) * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * self.set_attr("__gradient__", (gradient, args, kargs)) * */ __pyx_t_2 = (__pyx_v_kargs == Py_None); if (__pyx_t_2) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 2102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "petsc4py/PETSc/TAO.pyx":2103 * if args is None: args = () * if kargs is None: kargs = {} * self.set_attr("__gradient__", (gradient, args, kargs)) # <<<<<<<<<<<<<< * * def setObjectiveGradient(self, objgrad: TAOLSObjectiveGradientFunction, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 2103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_gradient); __Pyx_GIVEREF(__pyx_v_gradient); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_gradient)) __PYX_ERR(52, 2103, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args)) __PYX_ERR(52, 2103, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs)) __PYX_ERR(52, 2103, __pyx_L1_error); __pyx_t_4 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAOLineSearch *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__gradient__"), __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 2103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/TAO.pyx":2078 * self.set_attr("__objective__", (objective, args, kargs)) * * def setGradient(self, gradient: TAOLSGradientFunction, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: # <<<<<<<<<<<<<< * """Set the gradient evaluation callback. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.TAOLineSearch.setGradient", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":2105 * self.set_attr("__gradient__", (gradient, args, kargs)) * * def setObjectiveGradient(self, objgrad: TAOLSObjectiveGradientFunction, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: # <<<<<<<<<<<<<< * """Set the objective function and gradient evaluation callback. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_25setObjectiveGradient(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_13TAOLineSearch_24setObjectiveGradient, "TAOLineSearch.setObjectiveGradient(self, objgrad: TAOLSObjectiveGradientFunction, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nSet the objective function and gradient evaluation callback.\n\n Logically collective.\n\n Parameters\n ----------\n objgrad\n The objective function and gradient callback.\n g\n The vector to store the gradient.\n args\n Positional arguments for the callback.\n kargs\n Keyword arguments for the callback.\n\n See Also\n --------\n setObjective, setGradient, setHessian, getObjectiveAndGradient\n petsc.TaoLineSearchSetObjectiveAndGradientRoutine\n\n \nSource code at petsc4py/PETSc/TAO.pyx:2105"); static PyObject *__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_25setObjectiveGradient(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_objgrad = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setObjectiveGradient (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_objgrad,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_objgrad)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 2105, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 2105, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 2105, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setObjectiveGradient") < 0)) __PYX_ERR(52, 2105, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_objgrad = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setObjectiveGradient", 0, 1, 3, __pyx_nargs); __PYX_ERR(52, 2105, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TAOLineSearch.setObjectiveGradient", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_13TAOLineSearch_24setObjectiveGradient(((struct PyPetscTAOLineSearchObject *)__pyx_v_self), __pyx_v_objgrad, __pyx_v_args, __pyx_v_kargs); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_13TAOLineSearch_24setObjectiveGradient(struct PyPetscTAOLineSearchObject *__pyx_v_self, PyObject *__pyx_v_objgrad, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setObjectiveGradient", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/TAO.pyx":2127 * * """ * CHKERR( TaoLineSearchSetObjectiveAndGradientRoutine(self.taols, TAOLS_ObjGrad, NULL) ) # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoLineSearchSetObjectiveAndGradientRoutine(__pyx_v_self->taols, __pyx_f_8petsc4py_5PETSc_TAOLS_ObjGrad, NULL)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 2127, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":2128 * """ * CHKERR( TaoLineSearchSetObjectiveAndGradientRoutine(self.taols, TAOLS_ObjGrad, NULL) ) * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * self.set_attr("__objgrad__", (objgrad, args, kargs)) */ __pyx_t_2 = (__pyx_v_args == Py_None); if (__pyx_t_2) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/TAO.pyx":2129 * CHKERR( TaoLineSearchSetObjectiveAndGradientRoutine(self.taols, TAOLS_ObjGrad, NULL) ) * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * self.set_attr("__objgrad__", (objgrad, args, kargs)) * */ __pyx_t_2 = (__pyx_v_kargs == Py_None); if (__pyx_t_2) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 2129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "petsc4py/PETSc/TAO.pyx":2130 * if args is None: args = () * if kargs is None: kargs = {} * self.set_attr("__objgrad__", (objgrad, args, kargs)) # <<<<<<<<<<<<<< * * def useTAORoutine(self, TAO tao) -> None: */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 2130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_objgrad); __Pyx_GIVEREF(__pyx_v_objgrad); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_objgrad)) __PYX_ERR(52, 2130, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args)) __PYX_ERR(52, 2130, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs)) __PYX_ERR(52, 2130, __pyx_L1_error); __pyx_t_4 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAOLineSearch *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__objgrad__"), __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 2130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/TAO.pyx":2105 * self.set_attr("__gradient__", (gradient, args, kargs)) * * def setObjectiveGradient(self, objgrad: TAOLSObjectiveGradientFunction, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: # <<<<<<<<<<<<<< * """Set the objective function and gradient evaluation callback. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.TAOLineSearch.setObjectiveGradient", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":2132 * self.set_attr("__objgrad__", (objgrad, args, kargs)) * * def useTAORoutine(self, TAO tao) -> None: # <<<<<<<<<<<<<< * """Use the objective and gradient evaluation routines from the given Tao object. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_27useTAORoutine(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_13TAOLineSearch_26useTAORoutine, "TAOLineSearch.useTAORoutine(self, tao: TAO) -> None\nUse the objective and gradient evaluation routines from the given Tao object.\n\n Logically collective.\n\n See Also\n --------\n petsc.TaoLineSearchUseTaoRoutines\n\n \nSource code at petsc4py/PETSc/TAO.pyx:2132"); static PyObject *__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_27useTAORoutine(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscTAOObject *__pyx_v_tao = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("useTAORoutine (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tao,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_tao)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 2132, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "useTAORoutine") < 0)) __PYX_ERR(52, 2132, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_tao = ((struct PyPetscTAOObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("useTAORoutine", 1, 1, 1, __pyx_nargs); __PYX_ERR(52, 2132, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TAOLineSearch.useTAORoutine", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tao), __pyx_ptype_8petsc4py_5PETSc_TAO, 0, "tao", 0))) __PYX_ERR(52, 2132, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_13TAOLineSearch_26useTAORoutine(((struct PyPetscTAOLineSearchObject *)__pyx_v_self), __pyx_v_tao); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_13TAOLineSearch_26useTAORoutine(struct PyPetscTAOLineSearchObject *__pyx_v_self, struct PyPetscTAOObject *__pyx_v_tao) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("useTAORoutine", 1); /* "petsc4py/PETSc/TAO.pyx":2142 * * """ * CHKERR( TaoLineSearchUseTaoRoutines(self.taols, tao.tao) ) # <<<<<<<<<<<<<< * * def apply(self, Vec x, Vec g, Vec s) -> tuple[float, float, str]: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoLineSearchUseTaoRoutines(__pyx_v_self->taols, __pyx_v_tao->tao)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 2142, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":2132 * self.set_attr("__objgrad__", (objgrad, args, kargs)) * * def useTAORoutine(self, TAO tao) -> None: # <<<<<<<<<<<<<< * """Use the objective and gradient evaluation routines from the given Tao object. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAOLineSearch.useTAORoutine", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/TAO.pyx":2144 * CHKERR( TaoLineSearchUseTaoRoutines(self.taols, tao.tao) ) * * def apply(self, Vec x, Vec g, Vec s) -> tuple[float, float, str]: # <<<<<<<<<<<<<< * """Performs a line-search in a given step direction. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_29apply(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_13TAOLineSearch_28apply, "TAOLineSearch.apply(self, x: Vec, g: Vec, s: Vec) -> tuple[float, float, str]\nPerforms a line-search in a given step direction.\n\n Collective.\n\n See Also\n --------\n petsc.TaoLineSearchApply\n\n \nSource code at petsc4py/PETSc/TAO.pyx:2144"); static PyObject *__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_29apply(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_g = 0; struct PyPetscVecObject *__pyx_v_s = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("apply (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_g,&__pyx_n_s_s_2,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 2144, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_g)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 2144, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("apply", 1, 3, 3, 1); __PYX_ERR(52, 2144, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_s_2)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 2144, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("apply", 1, 3, 3, 2); __PYX_ERR(52, 2144, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "apply") < 0)) __PYX_ERR(52, 2144, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_x = ((struct PyPetscVecObject *)values[0]); __pyx_v_g = ((struct PyPetscVecObject *)values[1]); __pyx_v_s = ((struct PyPetscVecObject *)values[2]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("apply", 1, 3, 3, __pyx_nargs); __PYX_ERR(52, 2144, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.TAOLineSearch.apply", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(52, 2144, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_g), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "g", 0))) __PYX_ERR(52, 2144, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_s), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "s", 0))) __PYX_ERR(52, 2144, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_13TAOLineSearch_28apply(((struct PyPetscTAOLineSearchObject *)__pyx_v_self), __pyx_v_x, __pyx_v_g, __pyx_v_s); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_13TAOLineSearch_28apply(struct PyPetscTAOLineSearchObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_g, struct PyPetscVecObject *__pyx_v_s) { PetscReal __pyx_v_f; PetscReal __pyx_v_steplen; TaoLineSearchConvergedReason __pyx_v_reason; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("apply", 1); /* "petsc4py/PETSc/TAO.pyx":2154 * * """ * cdef PetscReal f = 0 # <<<<<<<<<<<<<< * cdef PetscReal steplen = 0 * cdef PetscTAOLineSearchConvergedReason reason = TAOLINESEARCH_CONTINUE_ITERATING */ __pyx_v_f = 0.0; /* "petsc4py/PETSc/TAO.pyx":2155 * """ * cdef PetscReal f = 0 * cdef PetscReal steplen = 0 # <<<<<<<<<<<<<< * cdef PetscTAOLineSearchConvergedReason reason = TAOLINESEARCH_CONTINUE_ITERATING * CHKERR( TaoLineSearchApply(self.taols,x.vec,&f,g.vec,s.vec,&steplen,&reason)) */ __pyx_v_steplen = 0.0; /* "petsc4py/PETSc/TAO.pyx":2156 * cdef PetscReal f = 0 * cdef PetscReal steplen = 0 * cdef PetscTAOLineSearchConvergedReason reason = TAOLINESEARCH_CONTINUE_ITERATING # <<<<<<<<<<<<<< * CHKERR( TaoLineSearchApply(self.taols,x.vec,&f,g.vec,s.vec,&steplen,&reason)) * return (toReal(f), toReal(steplen), reason) */ __pyx_v_reason = TAOLINESEARCH_CONTINUE_ITERATING; /* "petsc4py/PETSc/TAO.pyx":2157 * cdef PetscReal steplen = 0 * cdef PetscTAOLineSearchConvergedReason reason = TAOLINESEARCH_CONTINUE_ITERATING * CHKERR( TaoLineSearchApply(self.taols,x.vec,&f,g.vec,s.vec,&steplen,&reason)) # <<<<<<<<<<<<<< * return (toReal(f), toReal(steplen), reason) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoLineSearchApply(__pyx_v_self->taols, __pyx_v_x->vec, (&__pyx_v_f), __pyx_v_g->vec, __pyx_v_s->vec, (&__pyx_v_steplen), (&__pyx_v_reason))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 2157, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":2158 * cdef PetscTAOLineSearchConvergedReason reason = TAOLINESEARCH_CONTINUE_ITERATING * CHKERR( TaoLineSearchApply(self.taols,x.vec,&f,g.vec,s.vec,&steplen,&reason)) * return (toReal(f), toReal(steplen), reason) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_f); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 2158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_steplen); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 2158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_TaoLineSearchConvergedReason(__pyx_v_reason); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 2158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 2158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2)) __PYX_ERR(52, 2158, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3)) __PYX_ERR(52, 2158, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4)) __PYX_ERR(52, 2158, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "petsc4py/PETSc/TAO.pyx":2144 * CHKERR( TaoLineSearchUseTaoRoutines(self.taols, tao.tao) ) * * def apply(self, Vec x, Vec g, Vec s) -> tuple[float, float, str]: # <<<<<<<<<<<<<< * """Performs a line-search in a given step direction. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.TAOLineSearch.apply", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/AO.pyx":15 * Type = AOType * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.ao * self.ao = NULL */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_2AO_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_2AO_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2AO___cinit__(((struct PyPetscAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_2AO___cinit__(struct PyPetscAOObject *__pyx_v_self) { int __pyx_r; /* "petsc4py/PETSc/AO.pyx":16 * * def __cinit__(self): * self.obj = &self.ao # <<<<<<<<<<<<<< * self.ao = NULL * */ __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->ao)); /* "petsc4py/PETSc/AO.pyx":17 * def __cinit__(self): * self.obj = &self.ao * self.ao = NULL # <<<<<<<<<<<<<< * * def view(self, Viewer viewer=None) -> None: */ __pyx_v_self->ao = NULL; /* "petsc4py/PETSc/AO.pyx":15 * Type = AOType * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.ao * self.ao = NULL */ /* function exit code */ __pyx_r = 0; return __pyx_r; } /* "petsc4py/PETSc/AO.pyx":19 * self.ao = NULL * * def view(self, Viewer viewer=None) -> None: # <<<<<<<<<<<<<< * """Display the application ordering. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2AO_3view(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2AO_2view, "AO.view(self, viewer: Viewer | None = None) -> None\nDisplay the application ordering.\n\n Collective.\n\n Parameters\n ----------\n viewer\n A `Viewer` to display the ordering.\n\n See Also\n --------\n petsc.AOView\n\n \nSource code at petsc4py/PETSc/AO.pyx:19"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2AO_3view(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscViewerObject *__pyx_v_viewer = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("view (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscViewerObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_viewer); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(53, 19, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "view") < 0)) __PYX_ERR(53, 19, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, __pyx_nargs); __PYX_ERR(53, 19, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.AO.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(53, 19, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2AO_2view(((struct PyPetscAOObject *)__pyx_v_self), __pyx_v_viewer); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2AO_2view(struct PyPetscAOObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer) { PetscViewer __pyx_v_cviewer; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscViewer __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("view", 1); /* "petsc4py/PETSc/AO.pyx":34 * * """ * cdef PetscViewer cviewer = NULL # <<<<<<<<<<<<<< * if viewer is not None: cviewer = viewer.vwr * CHKERR( AOView(self.ao, cviewer) ) */ __pyx_v_cviewer = NULL; /* "petsc4py/PETSc/AO.pyx":35 * """ * cdef PetscViewer cviewer = NULL * if viewer is not None: cviewer = viewer.vwr # <<<<<<<<<<<<<< * CHKERR( AOView(self.ao, cviewer) ) * */ __pyx_t_1 = (((PyObject *)__pyx_v_viewer) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_viewer->vwr; __pyx_v_cviewer = __pyx_t_2; } /* "petsc4py/PETSc/AO.pyx":36 * cdef PetscViewer cviewer = NULL * if viewer is not None: cviewer = viewer.vwr * CHKERR( AOView(self.ao, cviewer) ) # <<<<<<<<<<<<<< * * def destroy(self) -> Self: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(AOView(__pyx_v_self->ao, __pyx_v_cviewer)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(53, 36, __pyx_L1_error) /* "petsc4py/PETSc/AO.pyx":19 * self.ao = NULL * * def view(self, Viewer viewer=None) -> None: # <<<<<<<<<<<<<< * """Display the application ordering. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.AO.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/AO.pyx":38 * CHKERR( AOView(self.ao, cviewer) ) * * def destroy(self) -> Self: # <<<<<<<<<<<<<< * """Destroy the application ordering. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2AO_5destroy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2AO_4destroy, "AO.destroy(self) -> Self\nDestroy the application ordering.\n\n Collective.\n\n See Also\n --------\n petsc.AODestroy\n\n \nSource code at petsc4py/PETSc/AO.pyx:38"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2AO_5destroy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("destroy (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2AO_4destroy(((struct PyPetscAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2AO_4destroy(struct PyPetscAOObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("destroy", 1); /* "petsc4py/PETSc/AO.pyx":48 * * """ * CHKERR( AODestroy(&self.ao) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(AODestroy((&__pyx_v_self->ao))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(53, 48, __pyx_L1_error) /* "petsc4py/PETSc/AO.pyx":49 * """ * CHKERR( AODestroy(&self.ao) ) * return self # <<<<<<<<<<<<<< * * def createBasic( */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/AO.pyx":38 * CHKERR( AOView(self.ao, cviewer) ) * * def destroy(self) -> Self: # <<<<<<<<<<<<<< * """Destroy the application ordering. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.AO.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/AO.pyx":51 * return self * * def createBasic( # <<<<<<<<<<<<<< * self, * app: Sequence[int] | IS, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2AO_7createBasic(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2AO_6createBasic, "AO.createBasic(self, app: Sequence[int] | IS, petsc: Sequence[int] | IS | None = None, comm: Comm | None = None) -> Self\nReturn a basic application ordering using two orderings.\n\n Collective.\n\n The arrays/indices ``app`` and ``petsc`` must contain all the integers\n ``0`` to ``len(app)-1`` with no duplicates; that is there cannot be any\n \"holes\" in the indices. Use ``createMapping`` if you wish to have\n \"holes\" in the indices.\n\n Parameters\n ----------\n app\n The application ordering.\n petsc\n Another ordering (may be `None` to indicate the natural ordering,\n that is 0, 1, 2, 3, ...).\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n createMemoryScalable, createMapping, petsc.AOCreateBasicIS\n petsc.AOCreateBasic\n\n \nSource code at petsc4py/PETSc/AO.pyx:51"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2AO_7createBasic(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_app = 0; PyObject *__pyx_v_petsc = 0; PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createBasic (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_app,&__pyx_n_s_petsc,&__pyx_n_s_comm,0}; /* "petsc4py/PETSc/AO.pyx":54 * self, * app: Sequence[int] | IS, * petsc: Sequence[int] | IS | None = None, # <<<<<<<<<<<<<< * comm: Comm | None = None, * ) -> Self: */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/AO.pyx":55 * app: Sequence[int] | IS, * petsc: Sequence[int] | IS | None = None, * comm: Comm | None = None, # <<<<<<<<<<<<<< * ) -> Self: * """Return a basic application ordering using two orderings. */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_app)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(53, 51, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_petsc); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(53, 51, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(53, 51, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createBasic") < 0)) __PYX_ERR(53, 51, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_app = values[0]; __pyx_v_petsc = values[1]; __pyx_v_comm = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createBasic", 0, 1, 3, __pyx_nargs); __PYX_ERR(53, 51, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.AO.createBasic", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2AO_6createBasic(((struct PyPetscAOObject *)__pyx_v_self), __pyx_v_app, __pyx_v_petsc, __pyx_v_comm); /* "petsc4py/PETSc/AO.pyx":51 * return self * * def createBasic( # <<<<<<<<<<<<<< * self, * app: Sequence[int] | IS, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2AO_6createBasic(struct PyPetscAOObject *__pyx_v_self, PyObject *__pyx_v_app, PyObject *__pyx_v_petsc, PyObject *__pyx_v_comm) { IS __pyx_v_isapp; IS __pyx_v_ispetsc; PetscInt __pyx_v_napp; PetscInt *__pyx_v_idxapp; PetscInt __pyx_v_npetsc; PetscInt *__pyx_v_idxpetsc; MPI_Comm __pyx_v_ccomm; AO __pyx_v_newao; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; int __pyx_t_2; IS __pyx_t_3; PetscErrorCode __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createBasic", 0); __Pyx_INCREF(__pyx_v_app); __Pyx_INCREF(__pyx_v_petsc); /* "petsc4py/PETSc/AO.pyx":82 * * """ * cdef PetscIS isapp = NULL, ispetsc = NULL # <<<<<<<<<<<<<< * cdef PetscInt napp = 0, *idxapp = NULL, * cdef PetscInt npetsc = 0, *idxpetsc = NULL */ __pyx_v_isapp = NULL; __pyx_v_ispetsc = NULL; /* "petsc4py/PETSc/AO.pyx":83 * """ * cdef PetscIS isapp = NULL, ispetsc = NULL * cdef PetscInt napp = 0, *idxapp = NULL, # <<<<<<<<<<<<<< * cdef PetscInt npetsc = 0, *idxpetsc = NULL * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) */ __pyx_v_napp = 0; __pyx_v_idxapp = NULL; /* "petsc4py/PETSc/AO.pyx":84 * cdef PetscIS isapp = NULL, ispetsc = NULL * cdef PetscInt napp = 0, *idxapp = NULL, * cdef PetscInt npetsc = 0, *idxpetsc = NULL # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscAO newao = NULL */ __pyx_v_npetsc = 0; __pyx_v_idxpetsc = NULL; /* "petsc4py/PETSc/AO.pyx":85 * cdef PetscInt napp = 0, *idxapp = NULL, * cdef PetscInt npetsc = 0, *idxpetsc = NULL * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscAO newao = NULL * if isinstance(app, IS): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(53, 85, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/AO.pyx":86 * cdef PetscInt npetsc = 0, *idxpetsc = NULL * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscAO newao = NULL # <<<<<<<<<<<<<< * if isinstance(app, IS): * isapp = (app).iset */ __pyx_v_newao = NULL; /* "petsc4py/PETSc/AO.pyx":87 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscAO newao = NULL * if isinstance(app, IS): # <<<<<<<<<<<<<< * isapp = (app).iset * if petsc is not None: */ __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_app, __pyx_ptype_8petsc4py_5PETSc_IS); if (__pyx_t_2) { /* "petsc4py/PETSc/AO.pyx":88 * cdef PetscAO newao = NULL * if isinstance(app, IS): * isapp = (app).iset # <<<<<<<<<<<<<< * if petsc is not None: * ispetsc = (petsc).iset */ __pyx_t_3 = ((struct PyPetscISObject *)__pyx_v_app)->iset; __pyx_v_isapp = __pyx_t_3; /* "petsc4py/PETSc/AO.pyx":89 * if isinstance(app, IS): * isapp = (app).iset * if petsc is not None: # <<<<<<<<<<<<<< * ispetsc = (petsc).iset * CHKERR( AOCreateBasicIS(isapp, ispetsc, &newao) ) */ __pyx_t_2 = (__pyx_v_petsc != Py_None); if (__pyx_t_2) { /* "petsc4py/PETSc/AO.pyx":90 * isapp = (app).iset * if petsc is not None: * ispetsc = (petsc).iset # <<<<<<<<<<<<<< * CHKERR( AOCreateBasicIS(isapp, ispetsc, &newao) ) * else: */ if (!(likely(__Pyx_TypeTest(__pyx_v_petsc, __pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(53, 90, __pyx_L1_error) __pyx_t_3 = ((struct PyPetscISObject *)__pyx_v_petsc)->iset; __pyx_v_ispetsc = __pyx_t_3; /* "petsc4py/PETSc/AO.pyx":89 * if isinstance(app, IS): * isapp = (app).iset * if petsc is not None: # <<<<<<<<<<<<<< * ispetsc = (petsc).iset * CHKERR( AOCreateBasicIS(isapp, ispetsc, &newao) ) */ } /* "petsc4py/PETSc/AO.pyx":91 * if petsc is not None: * ispetsc = (petsc).iset * CHKERR( AOCreateBasicIS(isapp, ispetsc, &newao) ) # <<<<<<<<<<<<<< * else: * app = iarray_i(app, &napp, &idxapp) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(AOCreateBasicIS(__pyx_v_isapp, __pyx_v_ispetsc, (&__pyx_v_newao))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(53, 91, __pyx_L1_error) /* "petsc4py/PETSc/AO.pyx":87 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscAO newao = NULL * if isinstance(app, IS): # <<<<<<<<<<<<<< * isapp = (app).iset * if petsc is not None: */ goto __pyx_L3; } /* "petsc4py/PETSc/AO.pyx":93 * CHKERR( AOCreateBasicIS(isapp, ispetsc, &newao) ) * else: * app = iarray_i(app, &napp, &idxapp) # <<<<<<<<<<<<<< * if petsc is not None: * petsc = iarray_i(petsc, &npetsc, &idxpetsc) */ /*else*/ { __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_app, (&__pyx_v_napp), (&__pyx_v_idxapp))); if (unlikely(!__pyx_t_5)) __PYX_ERR(53, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_app, __pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/AO.pyx":94 * else: * app = iarray_i(app, &napp, &idxapp) * if petsc is not None: # <<<<<<<<<<<<<< * petsc = iarray_i(petsc, &npetsc, &idxpetsc) * assert napp == npetsc, "incompatible array sizes" */ __pyx_t_2 = (__pyx_v_petsc != Py_None); if (__pyx_t_2) { /* "petsc4py/PETSc/AO.pyx":95 * app = iarray_i(app, &napp, &idxapp) * if petsc is not None: * petsc = iarray_i(petsc, &npetsc, &idxpetsc) # <<<<<<<<<<<<<< * assert napp == npetsc, "incompatible array sizes" * CHKERR( AOCreateBasic(ccomm, napp, idxapp, idxpetsc, &newao) ) */ __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_petsc, (&__pyx_v_npetsc), (&__pyx_v_idxpetsc))); if (unlikely(!__pyx_t_5)) __PYX_ERR(53, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_petsc, __pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/AO.pyx":96 * if petsc is not None: * petsc = iarray_i(petsc, &npetsc, &idxpetsc) * assert napp == npetsc, "incompatible array sizes" # <<<<<<<<<<<<<< * CHKERR( AOCreateBasic(ccomm, napp, idxapp, idxpetsc, &newao) ) * CHKERR( PetscCLEAR(self.obj) ); self.ao = newao */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_2 = (__pyx_v_napp == __pyx_v_npetsc); if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_kp_s_incompatible_array_sizes, 0, 0); __PYX_ERR(53, 96, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(53, 96, __pyx_L1_error) #endif /* "petsc4py/PETSc/AO.pyx":94 * else: * app = iarray_i(app, &napp, &idxapp) * if petsc is not None: # <<<<<<<<<<<<<< * petsc = iarray_i(petsc, &npetsc, &idxpetsc) * assert napp == npetsc, "incompatible array sizes" */ } /* "petsc4py/PETSc/AO.pyx":97 * petsc = iarray_i(petsc, &npetsc, &idxpetsc) * assert napp == npetsc, "incompatible array sizes" * CHKERR( AOCreateBasic(ccomm, napp, idxapp, idxpetsc, &newao) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.ao = newao * return self */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(AOCreateBasic(__pyx_v_ccomm, __pyx_v_napp, __pyx_v_idxapp, __pyx_v_idxpetsc, (&__pyx_v_newao))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(53, 97, __pyx_L1_error) } __pyx_L3:; /* "petsc4py/PETSc/AO.pyx":98 * assert napp == npetsc, "incompatible array sizes" * CHKERR( AOCreateBasic(ccomm, napp, idxapp, idxpetsc, &newao) ) * CHKERR( PetscCLEAR(self.obj) ); self.ao = newao # <<<<<<<<<<<<<< * return self * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(53, 98, __pyx_L1_error) __pyx_v_self->ao = __pyx_v_newao; /* "petsc4py/PETSc/AO.pyx":99 * CHKERR( AOCreateBasic(ccomm, napp, idxapp, idxpetsc, &newao) ) * CHKERR( PetscCLEAR(self.obj) ); self.ao = newao * return self # <<<<<<<<<<<<<< * * def createMemoryScalable( */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/AO.pyx":51 * return self * * def createBasic( # <<<<<<<<<<<<<< * self, * app: Sequence[int] | IS, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.AO.createBasic", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_app); __Pyx_XDECREF(__pyx_v_petsc); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/AO.pyx":101 * return self * * def createMemoryScalable( # <<<<<<<<<<<<<< * self, * app: Sequence[int] | IS, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2AO_9createMemoryScalable(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2AO_8createMemoryScalable, "AO.createMemoryScalable(self, app: Sequence[int] | IS, petsc: Sequence[int] | IS | None = None, comm: Comm | None = None) -> Self\nReturn a memory scalable application ordering using two orderings.\n\n Collective.\n\n The arrays/indices ``app`` and ``petsc`` must contain all the integers\n ``0`` to ``len(app)-1`` with no duplicates; that is there cannot be any\n \"holes\" in the indices. Use ``createMapping`` if you wish to have\n \"holes\" in the indices.\n\n Comparing with ``createBasic``, this routine trades memory with message\n communication.\n\n Parameters\n ----------\n app\n The application ordering.\n petsc\n Another ordering (may be `None` to indicate the natural ordering,\n that is 0, 1, 2, 3, ...).\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n createBasic, createMapping, petsc.AOCreateMemoryScalableIS\n petsc.AOCreateMemoryScalable\n\n \nSource code at petsc4py/PETSc/AO.pyx:101"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2AO_9createMemoryScalable(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_app = 0; PyObject *__pyx_v_petsc = 0; PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createMemoryScalable (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_app,&__pyx_n_s_petsc,&__pyx_n_s_comm,0}; /* "petsc4py/PETSc/AO.pyx":104 * self, * app: Sequence[int] | IS, * petsc: Sequence[int] | IS | None = None, # <<<<<<<<<<<<<< * comm: Comm | None = None, * ) -> Self: */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/AO.pyx":105 * app: Sequence[int] | IS, * petsc: Sequence[int] | IS | None = None, * comm: Comm | None = None, # <<<<<<<<<<<<<< * ) -> Self: * """Return a memory scalable application ordering using two orderings. */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_app)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(53, 101, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_petsc); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(53, 101, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(53, 101, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createMemoryScalable") < 0)) __PYX_ERR(53, 101, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_app = values[0]; __pyx_v_petsc = values[1]; __pyx_v_comm = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createMemoryScalable", 0, 1, 3, __pyx_nargs); __PYX_ERR(53, 101, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.AO.createMemoryScalable", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2AO_8createMemoryScalable(((struct PyPetscAOObject *)__pyx_v_self), __pyx_v_app, __pyx_v_petsc, __pyx_v_comm); /* "petsc4py/PETSc/AO.pyx":101 * return self * * def createMemoryScalable( # <<<<<<<<<<<<<< * self, * app: Sequence[int] | IS, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2AO_8createMemoryScalable(struct PyPetscAOObject *__pyx_v_self, PyObject *__pyx_v_app, PyObject *__pyx_v_petsc, PyObject *__pyx_v_comm) { IS __pyx_v_isapp; IS __pyx_v_ispetsc; PetscInt __pyx_v_napp; PetscInt *__pyx_v_idxapp; PetscInt __pyx_v_npetsc; PetscInt *__pyx_v_idxpetsc; MPI_Comm __pyx_v_ccomm; AO __pyx_v_newao; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; int __pyx_t_2; IS __pyx_t_3; PetscErrorCode __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createMemoryScalable", 0); __Pyx_INCREF(__pyx_v_app); __Pyx_INCREF(__pyx_v_petsc); /* "petsc4py/PETSc/AO.pyx":135 * * """ * cdef PetscIS isapp = NULL, ispetsc = NULL # <<<<<<<<<<<<<< * cdef PetscInt napp = 0, *idxapp = NULL, * cdef PetscInt npetsc = 0, *idxpetsc = NULL */ __pyx_v_isapp = NULL; __pyx_v_ispetsc = NULL; /* "petsc4py/PETSc/AO.pyx":136 * """ * cdef PetscIS isapp = NULL, ispetsc = NULL * cdef PetscInt napp = 0, *idxapp = NULL, # <<<<<<<<<<<<<< * cdef PetscInt npetsc = 0, *idxpetsc = NULL * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) */ __pyx_v_napp = 0; __pyx_v_idxapp = NULL; /* "petsc4py/PETSc/AO.pyx":137 * cdef PetscIS isapp = NULL, ispetsc = NULL * cdef PetscInt napp = 0, *idxapp = NULL, * cdef PetscInt npetsc = 0, *idxpetsc = NULL # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscAO newao = NULL */ __pyx_v_npetsc = 0; __pyx_v_idxpetsc = NULL; /* "petsc4py/PETSc/AO.pyx":138 * cdef PetscInt napp = 0, *idxapp = NULL, * cdef PetscInt npetsc = 0, *idxpetsc = NULL * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscAO newao = NULL * if isinstance(app, IS): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(53, 138, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/AO.pyx":139 * cdef PetscInt npetsc = 0, *idxpetsc = NULL * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscAO newao = NULL # <<<<<<<<<<<<<< * if isinstance(app, IS): * isapp = (app).iset */ __pyx_v_newao = NULL; /* "petsc4py/PETSc/AO.pyx":140 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscAO newao = NULL * if isinstance(app, IS): # <<<<<<<<<<<<<< * isapp = (app).iset * if petsc is not None: */ __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_app, __pyx_ptype_8petsc4py_5PETSc_IS); if (__pyx_t_2) { /* "petsc4py/PETSc/AO.pyx":141 * cdef PetscAO newao = NULL * if isinstance(app, IS): * isapp = (app).iset # <<<<<<<<<<<<<< * if petsc is not None: * ispetsc = (petsc).iset */ __pyx_t_3 = ((struct PyPetscISObject *)__pyx_v_app)->iset; __pyx_v_isapp = __pyx_t_3; /* "petsc4py/PETSc/AO.pyx":142 * if isinstance(app, IS): * isapp = (app).iset * if petsc is not None: # <<<<<<<<<<<<<< * ispetsc = (petsc).iset * CHKERR( AOCreateMemoryScalableIS(isapp, ispetsc, &newao) ) */ __pyx_t_2 = (__pyx_v_petsc != Py_None); if (__pyx_t_2) { /* "petsc4py/PETSc/AO.pyx":143 * isapp = (app).iset * if petsc is not None: * ispetsc = (petsc).iset # <<<<<<<<<<<<<< * CHKERR( AOCreateMemoryScalableIS(isapp, ispetsc, &newao) ) * else: */ if (!(likely(__Pyx_TypeTest(__pyx_v_petsc, __pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(53, 143, __pyx_L1_error) __pyx_t_3 = ((struct PyPetscISObject *)__pyx_v_petsc)->iset; __pyx_v_ispetsc = __pyx_t_3; /* "petsc4py/PETSc/AO.pyx":142 * if isinstance(app, IS): * isapp = (app).iset * if petsc is not None: # <<<<<<<<<<<<<< * ispetsc = (petsc).iset * CHKERR( AOCreateMemoryScalableIS(isapp, ispetsc, &newao) ) */ } /* "petsc4py/PETSc/AO.pyx":144 * if petsc is not None: * ispetsc = (petsc).iset * CHKERR( AOCreateMemoryScalableIS(isapp, ispetsc, &newao) ) # <<<<<<<<<<<<<< * else: * app = iarray_i(app, &napp, &idxapp) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(AOCreateMemoryScalableIS(__pyx_v_isapp, __pyx_v_ispetsc, (&__pyx_v_newao))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(53, 144, __pyx_L1_error) /* "petsc4py/PETSc/AO.pyx":140 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscAO newao = NULL * if isinstance(app, IS): # <<<<<<<<<<<<<< * isapp = (app).iset * if petsc is not None: */ goto __pyx_L3; } /* "petsc4py/PETSc/AO.pyx":146 * CHKERR( AOCreateMemoryScalableIS(isapp, ispetsc, &newao) ) * else: * app = iarray_i(app, &napp, &idxapp) # <<<<<<<<<<<<<< * if petsc is not None: * petsc = iarray_i(petsc, &npetsc, &idxpetsc) */ /*else*/ { __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_app, (&__pyx_v_napp), (&__pyx_v_idxapp))); if (unlikely(!__pyx_t_5)) __PYX_ERR(53, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_app, __pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/AO.pyx":147 * else: * app = iarray_i(app, &napp, &idxapp) * if petsc is not None: # <<<<<<<<<<<<<< * petsc = iarray_i(petsc, &npetsc, &idxpetsc) * assert napp == npetsc, "incompatible array sizes" */ __pyx_t_2 = (__pyx_v_petsc != Py_None); if (__pyx_t_2) { /* "petsc4py/PETSc/AO.pyx":148 * app = iarray_i(app, &napp, &idxapp) * if petsc is not None: * petsc = iarray_i(petsc, &npetsc, &idxpetsc) # <<<<<<<<<<<<<< * assert napp == npetsc, "incompatible array sizes" * CHKERR( AOCreateMemoryScalable(ccomm, napp, idxapp, idxpetsc, &newao) ) */ __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_petsc, (&__pyx_v_npetsc), (&__pyx_v_idxpetsc))); if (unlikely(!__pyx_t_5)) __PYX_ERR(53, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_petsc, __pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/AO.pyx":149 * if petsc is not None: * petsc = iarray_i(petsc, &npetsc, &idxpetsc) * assert napp == npetsc, "incompatible array sizes" # <<<<<<<<<<<<<< * CHKERR( AOCreateMemoryScalable(ccomm, napp, idxapp, idxpetsc, &newao) ) * CHKERR( PetscCLEAR(self.obj) ); self.ao = newao */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_2 = (__pyx_v_napp == __pyx_v_npetsc); if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_kp_s_incompatible_array_sizes, 0, 0); __PYX_ERR(53, 149, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(53, 149, __pyx_L1_error) #endif /* "petsc4py/PETSc/AO.pyx":147 * else: * app = iarray_i(app, &napp, &idxapp) * if petsc is not None: # <<<<<<<<<<<<<< * petsc = iarray_i(petsc, &npetsc, &idxpetsc) * assert napp == npetsc, "incompatible array sizes" */ } /* "petsc4py/PETSc/AO.pyx":150 * petsc = iarray_i(petsc, &npetsc, &idxpetsc) * assert napp == npetsc, "incompatible array sizes" * CHKERR( AOCreateMemoryScalable(ccomm, napp, idxapp, idxpetsc, &newao) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.ao = newao * return self */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(AOCreateMemoryScalable(__pyx_v_ccomm, __pyx_v_napp, __pyx_v_idxapp, __pyx_v_idxpetsc, (&__pyx_v_newao))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(53, 150, __pyx_L1_error) } __pyx_L3:; /* "petsc4py/PETSc/AO.pyx":151 * assert napp == npetsc, "incompatible array sizes" * CHKERR( AOCreateMemoryScalable(ccomm, napp, idxapp, idxpetsc, &newao) ) * CHKERR( PetscCLEAR(self.obj) ); self.ao = newao # <<<<<<<<<<<<<< * return self * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(53, 151, __pyx_L1_error) __pyx_v_self->ao = __pyx_v_newao; /* "petsc4py/PETSc/AO.pyx":152 * CHKERR( AOCreateMemoryScalable(ccomm, napp, idxapp, idxpetsc, &newao) ) * CHKERR( PetscCLEAR(self.obj) ); self.ao = newao * return self # <<<<<<<<<<<<<< * * def createMapping( */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/AO.pyx":101 * return self * * def createMemoryScalable( # <<<<<<<<<<<<<< * self, * app: Sequence[int] | IS, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.AO.createMemoryScalable", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_app); __Pyx_XDECREF(__pyx_v_petsc); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/AO.pyx":154 * return self * * def createMapping( # <<<<<<<<<<<<<< * self, * app: Sequence[int] | IS, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2AO_11createMapping(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2AO_10createMapping, "AO.createMapping(self, app: Sequence[int] | IS, petsc: Sequence[int] | IS | None = None, comm: Comm | None = None) -> Self\nReturn an application mapping using two orderings.\n\n Collective.\n\n The arrays ``app`` and ``petsc`` need NOT contain all the integers\n ``0`` to ``len(app)-1``, that is there CAN be \"holes\" in the indices.\n Use ``createBasic`` if they do not have holes for better performance.\n\n Parameters\n ----------\n app\n The application ordering.\n petsc\n Another ordering. May be `None` to indicate the identity ordering.\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n createBasic, petsc.AOCreateMappingIS, petsc.AOCreateMapping\n\n \nSource code at petsc4py/PETSc/AO.pyx:154"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2AO_11createMapping(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_app = 0; PyObject *__pyx_v_petsc = 0; PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createMapping (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_app,&__pyx_n_s_petsc,&__pyx_n_s_comm,0}; /* "petsc4py/PETSc/AO.pyx":157 * self, * app: Sequence[int] | IS, * petsc: Sequence[int] | IS | None = None, # <<<<<<<<<<<<<< * comm: Comm | None = None, * ) -> Self: */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/AO.pyx":158 * app: Sequence[int] | IS, * petsc: Sequence[int] | IS | None = None, * comm: Comm | None = None, # <<<<<<<<<<<<<< * ) -> Self: * """Return an application mapping using two orderings. */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_app)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(53, 154, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_petsc); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(53, 154, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(53, 154, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createMapping") < 0)) __PYX_ERR(53, 154, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_app = values[0]; __pyx_v_petsc = values[1]; __pyx_v_comm = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createMapping", 0, 1, 3, __pyx_nargs); __PYX_ERR(53, 154, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.AO.createMapping", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2AO_10createMapping(((struct PyPetscAOObject *)__pyx_v_self), __pyx_v_app, __pyx_v_petsc, __pyx_v_comm); /* "petsc4py/PETSc/AO.pyx":154 * return self * * def createMapping( # <<<<<<<<<<<<<< * self, * app: Sequence[int] | IS, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2AO_10createMapping(struct PyPetscAOObject *__pyx_v_self, PyObject *__pyx_v_app, PyObject *__pyx_v_petsc, PyObject *__pyx_v_comm) { IS __pyx_v_isapp; IS __pyx_v_ispetsc; PetscInt __pyx_v_napp; PetscInt *__pyx_v_idxapp; PetscInt __pyx_v_npetsc; PetscInt *__pyx_v_idxpetsc; MPI_Comm __pyx_v_ccomm; AO __pyx_v_newao; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; int __pyx_t_2; IS __pyx_t_3; PetscErrorCode __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createMapping", 0); __Pyx_INCREF(__pyx_v_app); __Pyx_INCREF(__pyx_v_petsc); /* "petsc4py/PETSc/AO.pyx":182 * * """ * cdef PetscIS isapp = NULL, ispetsc = NULL # <<<<<<<<<<<<<< * cdef PetscInt napp = 0, *idxapp = NULL, * cdef PetscInt npetsc = 0, *idxpetsc = NULL */ __pyx_v_isapp = NULL; __pyx_v_ispetsc = NULL; /* "petsc4py/PETSc/AO.pyx":183 * """ * cdef PetscIS isapp = NULL, ispetsc = NULL * cdef PetscInt napp = 0, *idxapp = NULL, # <<<<<<<<<<<<<< * cdef PetscInt npetsc = 0, *idxpetsc = NULL * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) */ __pyx_v_napp = 0; __pyx_v_idxapp = NULL; /* "petsc4py/PETSc/AO.pyx":184 * cdef PetscIS isapp = NULL, ispetsc = NULL * cdef PetscInt napp = 0, *idxapp = NULL, * cdef PetscInt npetsc = 0, *idxpetsc = NULL # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscAO newao = NULL */ __pyx_v_npetsc = 0; __pyx_v_idxpetsc = NULL; /* "petsc4py/PETSc/AO.pyx":185 * cdef PetscInt napp = 0, *idxapp = NULL, * cdef PetscInt npetsc = 0, *idxpetsc = NULL * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscAO newao = NULL * if isinstance(app, IS): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(53, 185, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/AO.pyx":186 * cdef PetscInt npetsc = 0, *idxpetsc = NULL * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscAO newao = NULL # <<<<<<<<<<<<<< * if isinstance(app, IS): * isapp = (app).iset */ __pyx_v_newao = NULL; /* "petsc4py/PETSc/AO.pyx":187 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscAO newao = NULL * if isinstance(app, IS): # <<<<<<<<<<<<<< * isapp = (app).iset * if petsc is not None: */ __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_app, __pyx_ptype_8petsc4py_5PETSc_IS); if (__pyx_t_2) { /* "petsc4py/PETSc/AO.pyx":188 * cdef PetscAO newao = NULL * if isinstance(app, IS): * isapp = (app).iset # <<<<<<<<<<<<<< * if petsc is not None: * ispetsc = (petsc).iset */ __pyx_t_3 = ((struct PyPetscISObject *)__pyx_v_app)->iset; __pyx_v_isapp = __pyx_t_3; /* "petsc4py/PETSc/AO.pyx":189 * if isinstance(app, IS): * isapp = (app).iset * if petsc is not None: # <<<<<<<<<<<<<< * ispetsc = (petsc).iset * CHKERR( AOCreateMappingIS(isapp, ispetsc, &newao) ) */ __pyx_t_2 = (__pyx_v_petsc != Py_None); if (__pyx_t_2) { /* "petsc4py/PETSc/AO.pyx":190 * isapp = (app).iset * if petsc is not None: * ispetsc = (petsc).iset # <<<<<<<<<<<<<< * CHKERR( AOCreateMappingIS(isapp, ispetsc, &newao) ) * else: */ if (!(likely(__Pyx_TypeTest(__pyx_v_petsc, __pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(53, 190, __pyx_L1_error) __pyx_t_3 = ((struct PyPetscISObject *)__pyx_v_petsc)->iset; __pyx_v_ispetsc = __pyx_t_3; /* "petsc4py/PETSc/AO.pyx":189 * if isinstance(app, IS): * isapp = (app).iset * if petsc is not None: # <<<<<<<<<<<<<< * ispetsc = (petsc).iset * CHKERR( AOCreateMappingIS(isapp, ispetsc, &newao) ) */ } /* "petsc4py/PETSc/AO.pyx":191 * if petsc is not None: * ispetsc = (petsc).iset * CHKERR( AOCreateMappingIS(isapp, ispetsc, &newao) ) # <<<<<<<<<<<<<< * else: * app = iarray_i(app, &napp, &idxapp) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(AOCreateMappingIS(__pyx_v_isapp, __pyx_v_ispetsc, (&__pyx_v_newao))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(53, 191, __pyx_L1_error) /* "petsc4py/PETSc/AO.pyx":187 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscAO newao = NULL * if isinstance(app, IS): # <<<<<<<<<<<<<< * isapp = (app).iset * if petsc is not None: */ goto __pyx_L3; } /* "petsc4py/PETSc/AO.pyx":193 * CHKERR( AOCreateMappingIS(isapp, ispetsc, &newao) ) * else: * app = iarray_i(app, &napp, &idxapp) # <<<<<<<<<<<<<< * if petsc is not None: * petsc = iarray_i(petsc, &npetsc, &idxpetsc) */ /*else*/ { __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_app, (&__pyx_v_napp), (&__pyx_v_idxapp))); if (unlikely(!__pyx_t_5)) __PYX_ERR(53, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_app, __pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/AO.pyx":194 * else: * app = iarray_i(app, &napp, &idxapp) * if petsc is not None: # <<<<<<<<<<<<<< * petsc = iarray_i(petsc, &npetsc, &idxpetsc) * assert napp == npetsc, "incompatible array sizes" */ __pyx_t_2 = (__pyx_v_petsc != Py_None); if (__pyx_t_2) { /* "petsc4py/PETSc/AO.pyx":195 * app = iarray_i(app, &napp, &idxapp) * if petsc is not None: * petsc = iarray_i(petsc, &npetsc, &idxpetsc) # <<<<<<<<<<<<<< * assert napp == npetsc, "incompatible array sizes" * CHKERR( AOCreateMapping(ccomm, napp, idxapp, idxpetsc, &newao) ) */ __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_petsc, (&__pyx_v_npetsc), (&__pyx_v_idxpetsc))); if (unlikely(!__pyx_t_5)) __PYX_ERR(53, 195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_petsc, __pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/AO.pyx":196 * if petsc is not None: * petsc = iarray_i(petsc, &npetsc, &idxpetsc) * assert napp == npetsc, "incompatible array sizes" # <<<<<<<<<<<<<< * CHKERR( AOCreateMapping(ccomm, napp, idxapp, idxpetsc, &newao) ) * CHKERR( PetscCLEAR(self.obj) ); self.ao = newao */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_2 = (__pyx_v_napp == __pyx_v_npetsc); if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_kp_s_incompatible_array_sizes, 0, 0); __PYX_ERR(53, 196, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(53, 196, __pyx_L1_error) #endif /* "petsc4py/PETSc/AO.pyx":194 * else: * app = iarray_i(app, &napp, &idxapp) * if petsc is not None: # <<<<<<<<<<<<<< * petsc = iarray_i(petsc, &npetsc, &idxpetsc) * assert napp == npetsc, "incompatible array sizes" */ } /* "petsc4py/PETSc/AO.pyx":197 * petsc = iarray_i(petsc, &npetsc, &idxpetsc) * assert napp == npetsc, "incompatible array sizes" * CHKERR( AOCreateMapping(ccomm, napp, idxapp, idxpetsc, &newao) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.ao = newao * return self */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(AOCreateMapping(__pyx_v_ccomm, __pyx_v_napp, __pyx_v_idxapp, __pyx_v_idxpetsc, (&__pyx_v_newao))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(53, 197, __pyx_L1_error) } __pyx_L3:; /* "petsc4py/PETSc/AO.pyx":198 * assert napp == npetsc, "incompatible array sizes" * CHKERR( AOCreateMapping(ccomm, napp, idxapp, idxpetsc, &newao) ) * CHKERR( PetscCLEAR(self.obj) ); self.ao = newao # <<<<<<<<<<<<<< * return self * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(53, 198, __pyx_L1_error) __pyx_v_self->ao = __pyx_v_newao; /* "petsc4py/PETSc/AO.pyx":199 * CHKERR( AOCreateMapping(ccomm, napp, idxapp, idxpetsc, &newao) ) * CHKERR( PetscCLEAR(self.obj) ); self.ao = newao * return self # <<<<<<<<<<<<<< * * def getType(self) -> str: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/AO.pyx":154 * return self * * def createMapping( # <<<<<<<<<<<<<< * self, * app: Sequence[int] | IS, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.AO.createMapping", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_app); __Pyx_XDECREF(__pyx_v_petsc); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/AO.pyx":201 * return self * * def getType(self) -> str: # <<<<<<<<<<<<<< * """Return the application ordering type. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2AO_13getType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2AO_12getType, "AO.getType(self) -> str\nReturn the application ordering type.\n\n Not collective.\n\n See Also\n --------\n petsc.AOGetType\n\n \nSource code at petsc4py/PETSc/AO.pyx:201"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2AO_13getType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getType", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2AO_12getType(((struct PyPetscAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2AO_12getType(struct PyPetscAOObject *__pyx_v_self) { AOType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getType", 1); /* "petsc4py/PETSc/AO.pyx":211 * * """ * cdef PetscAOType cval = NULL # <<<<<<<<<<<<<< * CHKERR( AOGetType(self.ao, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/AO.pyx":212 * """ * cdef PetscAOType cval = NULL * CHKERR( AOGetType(self.ao, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(AOGetType(__pyx_v_self->ao, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(53, 212, __pyx_L1_error) /* "petsc4py/PETSc/AO.pyx":213 * cdef PetscAOType cval = NULL * CHKERR( AOGetType(self.ao, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * def app2petsc(self, indices: Sequence[int] | IS) -> Sequence[int] | IS: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(53, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/AO.pyx":201 * return self * * def getType(self) -> str: # <<<<<<<<<<<<<< * """Return the application ordering type. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.AO.getType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/AO.pyx":215 * return bytes2str(cval) * * def app2petsc(self, indices: Sequence[int] | IS) -> Sequence[int] | IS: # <<<<<<<<<<<<<< * """Map an application-defined ordering to the PETSc ordering. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2AO_15app2petsc(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2AO_14app2petsc, "AO.app2petsc(self, indices: Sequence[int] | IS) -> Sequence[int] | IS\nMap an application-defined ordering to the PETSc ordering.\n\n Collective.\n\n Any integers in ``indices`` that are negative are left unchanged. This\n allows one to convert, for example, neighbor lists that use negative\n entries to indicate nonexistent neighbors due to boundary conditions,\n etc.\n\n Integers that are out of range are mapped to -1.\n\n If ``IS`` is used, it cannot be of type stride or block.\n\n Parameters\n ----------\n indices\n The indices; to be replaced with their mapped values.\n\n See Also\n --------\n petsc2app, petsc.AOApplicationToPetscIS, petsc.AOApplicationToPetsc\n\n \nSource code at petsc4py/PETSc/AO.pyx:215"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2AO_15app2petsc(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_indices = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("app2petsc (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_indices,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_indices)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(53, 215, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "app2petsc") < 0)) __PYX_ERR(53, 215, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_indices = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("app2petsc", 1, 1, 1, __pyx_nargs); __PYX_ERR(53, 215, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.AO.app2petsc", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2AO_14app2petsc(((struct PyPetscAOObject *)__pyx_v_self), __pyx_v_indices); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2AO_14app2petsc(struct PyPetscAOObject *__pyx_v_self, PyObject *__pyx_v_indices) { IS __pyx_v_iset; PetscInt __pyx_v_nidx; PetscInt *__pyx_v_idx; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; IS __pyx_t_2; PetscErrorCode __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("app2petsc", 0); __Pyx_INCREF(__pyx_v_indices); /* "petsc4py/PETSc/AO.pyx":239 * * """ * cdef PetscIS iset = NULL # <<<<<<<<<<<<<< * cdef PetscInt nidx = 0, *idx = NULL * if isinstance(indices, IS): */ __pyx_v_iset = NULL; /* "petsc4py/PETSc/AO.pyx":240 * """ * cdef PetscIS iset = NULL * cdef PetscInt nidx = 0, *idx = NULL # <<<<<<<<<<<<<< * if isinstance(indices, IS): * iset = (indices).iset */ __pyx_v_nidx = 0; __pyx_v_idx = NULL; /* "petsc4py/PETSc/AO.pyx":241 * cdef PetscIS iset = NULL * cdef PetscInt nidx = 0, *idx = NULL * if isinstance(indices, IS): # <<<<<<<<<<<<<< * iset = (indices).iset * CHKERR( AOApplicationToPetscIS(self.ao, iset) ) */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_indices, __pyx_ptype_8petsc4py_5PETSc_IS); if (__pyx_t_1) { /* "petsc4py/PETSc/AO.pyx":242 * cdef PetscInt nidx = 0, *idx = NULL * if isinstance(indices, IS): * iset = (indices).iset # <<<<<<<<<<<<<< * CHKERR( AOApplicationToPetscIS(self.ao, iset) ) * else: */ __pyx_t_2 = ((struct PyPetscISObject *)__pyx_v_indices)->iset; __pyx_v_iset = __pyx_t_2; /* "petsc4py/PETSc/AO.pyx":243 * if isinstance(indices, IS): * iset = (indices).iset * CHKERR( AOApplicationToPetscIS(self.ao, iset) ) # <<<<<<<<<<<<<< * else: * indices = oarray_i(indices, &nidx, &idx) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(AOApplicationToPetscIS(__pyx_v_self->ao, __pyx_v_iset)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(53, 243, __pyx_L1_error) /* "petsc4py/PETSc/AO.pyx":241 * cdef PetscIS iset = NULL * cdef PetscInt nidx = 0, *idx = NULL * if isinstance(indices, IS): # <<<<<<<<<<<<<< * iset = (indices).iset * CHKERR( AOApplicationToPetscIS(self.ao, iset) ) */ goto __pyx_L3; } /* "petsc4py/PETSc/AO.pyx":245 * CHKERR( AOApplicationToPetscIS(self.ao, iset) ) * else: * indices = oarray_i(indices, &nidx, &idx) # <<<<<<<<<<<<<< * CHKERR( AOApplicationToPetsc(self.ao, nidx, idx) ) * return indices */ /*else*/ { __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_i(__pyx_v_indices, (&__pyx_v_nidx), (&__pyx_v_idx))); if (unlikely(!__pyx_t_4)) __PYX_ERR(53, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_indices, __pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/AO.pyx":246 * else: * indices = oarray_i(indices, &nidx, &idx) * CHKERR( AOApplicationToPetsc(self.ao, nidx, idx) ) # <<<<<<<<<<<<<< * return indices * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(AOApplicationToPetsc(__pyx_v_self->ao, __pyx_v_nidx, __pyx_v_idx)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(53, 246, __pyx_L1_error) } __pyx_L3:; /* "petsc4py/PETSc/AO.pyx":247 * indices = oarray_i(indices, &nidx, &idx) * CHKERR( AOApplicationToPetsc(self.ao, nidx, idx) ) * return indices # <<<<<<<<<<<<<< * * def petsc2app(self, indices: Sequence[int] | IS) -> Sequence[int] | IS: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_indices); __pyx_r = __pyx_v_indices; goto __pyx_L0; /* "petsc4py/PETSc/AO.pyx":215 * return bytes2str(cval) * * def app2petsc(self, indices: Sequence[int] | IS) -> Sequence[int] | IS: # <<<<<<<<<<<<<< * """Map an application-defined ordering to the PETSc ordering. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.AO.app2petsc", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_indices); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/AO.pyx":249 * return indices * * def petsc2app(self, indices: Sequence[int] | IS) -> Sequence[int] | IS: # <<<<<<<<<<<<<< * """Map a PETSc ordering to the application-defined ordering. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2AO_17petsc2app(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2AO_16petsc2app, "AO.petsc2app(self, indices: Sequence[int] | IS) -> Sequence[int] | IS\nMap a PETSc ordering to the application-defined ordering.\n\n Collective.\n\n Any integers in ``indices`` that are negative are left unchanged. This\n allows one to convert, for example, neighbor lists that use negative\n entries to indicate nonexistent neighbors due to boundary conditions,\n etc.\n\n Integers that are out of range are mapped to -1.\n\n If ``IS`` is used, it cannot be of type stride or block.\n\n Parameters\n ----------\n indices\n The indices; to be replaced with their mapped values.\n\n See Also\n --------\n app2petsc, petsc.AOPetscToApplicationIS, petsc.AOPetscToApplication\n\n \nSource code at petsc4py/PETSc/AO.pyx:249"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2AO_17petsc2app(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_indices = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("petsc2app (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_indices,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_indices)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(53, 249, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "petsc2app") < 0)) __PYX_ERR(53, 249, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_indices = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("petsc2app", 1, 1, 1, __pyx_nargs); __PYX_ERR(53, 249, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.AO.petsc2app", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2AO_16petsc2app(((struct PyPetscAOObject *)__pyx_v_self), __pyx_v_indices); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2AO_16petsc2app(struct PyPetscAOObject *__pyx_v_self, PyObject *__pyx_v_indices) { IS __pyx_v_iset; PetscInt __pyx_v_nidx; PetscInt *__pyx_v_idx; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; IS __pyx_t_2; PetscErrorCode __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("petsc2app", 0); __Pyx_INCREF(__pyx_v_indices); /* "petsc4py/PETSc/AO.pyx":273 * * """ * cdef PetscIS iset = NULL # <<<<<<<<<<<<<< * cdef PetscInt nidx = 0, *idx = NULL * if isinstance(indices, IS): */ __pyx_v_iset = NULL; /* "petsc4py/PETSc/AO.pyx":274 * """ * cdef PetscIS iset = NULL * cdef PetscInt nidx = 0, *idx = NULL # <<<<<<<<<<<<<< * if isinstance(indices, IS): * iset = (indices).iset */ __pyx_v_nidx = 0; __pyx_v_idx = NULL; /* "petsc4py/PETSc/AO.pyx":275 * cdef PetscIS iset = NULL * cdef PetscInt nidx = 0, *idx = NULL * if isinstance(indices, IS): # <<<<<<<<<<<<<< * iset = (indices).iset * CHKERR( AOPetscToApplicationIS(self.ao, iset) ) */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_indices, __pyx_ptype_8petsc4py_5PETSc_IS); if (__pyx_t_1) { /* "petsc4py/PETSc/AO.pyx":276 * cdef PetscInt nidx = 0, *idx = NULL * if isinstance(indices, IS): * iset = (indices).iset # <<<<<<<<<<<<<< * CHKERR( AOPetscToApplicationIS(self.ao, iset) ) * else: */ __pyx_t_2 = ((struct PyPetscISObject *)__pyx_v_indices)->iset; __pyx_v_iset = __pyx_t_2; /* "petsc4py/PETSc/AO.pyx":277 * if isinstance(indices, IS): * iset = (indices).iset * CHKERR( AOPetscToApplicationIS(self.ao, iset) ) # <<<<<<<<<<<<<< * else: * indices = oarray_i(indices, &nidx, &idx) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(AOPetscToApplicationIS(__pyx_v_self->ao, __pyx_v_iset)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(53, 277, __pyx_L1_error) /* "petsc4py/PETSc/AO.pyx":275 * cdef PetscIS iset = NULL * cdef PetscInt nidx = 0, *idx = NULL * if isinstance(indices, IS): # <<<<<<<<<<<<<< * iset = (indices).iset * CHKERR( AOPetscToApplicationIS(self.ao, iset) ) */ goto __pyx_L3; } /* "petsc4py/PETSc/AO.pyx":279 * CHKERR( AOPetscToApplicationIS(self.ao, iset) ) * else: * indices = oarray_i(indices, &nidx, &idx) # <<<<<<<<<<<<<< * CHKERR( AOPetscToApplication(self.ao, nidx, idx) ) * return indices */ /*else*/ { __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_i(__pyx_v_indices, (&__pyx_v_nidx), (&__pyx_v_idx))); if (unlikely(!__pyx_t_4)) __PYX_ERR(53, 279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_indices, __pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/AO.pyx":280 * else: * indices = oarray_i(indices, &nidx, &idx) * CHKERR( AOPetscToApplication(self.ao, nidx, idx) ) # <<<<<<<<<<<<<< * return indices * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(AOPetscToApplication(__pyx_v_self->ao, __pyx_v_nidx, __pyx_v_idx)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(53, 280, __pyx_L1_error) } __pyx_L3:; /* "petsc4py/PETSc/AO.pyx":281 * indices = oarray_i(indices, &nidx, &idx) * CHKERR( AOPetscToApplication(self.ao, nidx, idx) ) * return indices # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_indices); __pyx_r = __pyx_v_indices; goto __pyx_L0; /* "petsc4py/PETSc/AO.pyx":249 * return indices * * def petsc2app(self, indices: Sequence[int] | IS) -> Sequence[int] | IS: # <<<<<<<<<<<<<< * """Map a PETSc ordering to the application-defined ordering. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.AO.petsc2app", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_indices); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":59 * # * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.dm * self.dm = NULL */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_2DM_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_2DM_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM___cinit__(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_2DM___cinit__(struct PyPetscDMObject *__pyx_v_self) { int __pyx_r; /* "petsc4py/PETSc/DM.pyx":60 * * def __cinit__(self): * self.obj = &self.dm # <<<<<<<<<<<<<< * self.dm = NULL * */ __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->dm)); /* "petsc4py/PETSc/DM.pyx":61 * def __cinit__(self): * self.obj = &self.dm * self.dm = NULL # <<<<<<<<<<<<<< * * def view(self, Viewer viewer=None) -> None: */ __pyx_v_self->dm = NULL; /* "petsc4py/PETSc/DM.pyx":59 * # * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.dm * self.dm = NULL */ /* function exit code */ __pyx_r = 0; return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":63 * self.dm = NULL * * def view(self, Viewer viewer=None) -> None: # <<<<<<<<<<<<<< * """View the `DM`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_3view(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_2view, "DM.view(self, viewer: Viewer | None = None) -> None\nView the `DM`.\n\n Collective.\n\n Parameters\n ----------\n viewer\n The DM viewer.\n\n See Also\n --------\n petsc.DMView\n\n \nSource code at petsc4py/PETSc/DM.pyx:63"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_3view(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscViewerObject *__pyx_v_viewer = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("view (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscViewerObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_viewer); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 63, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "view") < 0)) __PYX_ERR(54, 63, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, __pyx_nargs); __PYX_ERR(54, 63, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DM.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(54, 63, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_2view(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_viewer); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_2view(struct PyPetscDMObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer) { PetscViewer __pyx_v_vwr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscViewer __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("view", 1); /* "petsc4py/PETSc/DM.pyx":78 * * """ * cdef PetscViewer vwr = NULL # <<<<<<<<<<<<<< * if viewer is not None: vwr = viewer.vwr * CHKERR( DMView(self.dm, vwr) ) */ __pyx_v_vwr = NULL; /* "petsc4py/PETSc/DM.pyx":79 * """ * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr # <<<<<<<<<<<<<< * CHKERR( DMView(self.dm, vwr) ) * */ __pyx_t_1 = (((PyObject *)__pyx_v_viewer) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_viewer->vwr; __pyx_v_vwr = __pyx_t_2; } /* "petsc4py/PETSc/DM.pyx":80 * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr * CHKERR( DMView(self.dm, vwr) ) # <<<<<<<<<<<<<< * * def load(self, Viewer viewer) -> Self: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMView(__pyx_v_self->dm, __pyx_v_vwr)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 80, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":63 * self.dm = NULL * * def view(self, Viewer viewer=None) -> None: # <<<<<<<<<<<<<< * """View the `DM`. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":82 * CHKERR( DMView(self.dm, vwr) ) * * def load(self, Viewer viewer) -> Self: # <<<<<<<<<<<<<< * """Return a `DM` stored in binary. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_5load(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_4load, "DM.load(self, viewer: Viewer) -> Self\nReturn a `DM` stored in binary.\n\n Collective.\n\n Parameters\n ----------\n viewer\n Viewer used to store the `DM`,\n like `Viewer.Type.BINARY` or `Viewer.Type.HDF5`.\n\n Notes\n -----\n When using `Viewer.Type.HDF5` format, one can save multiple `DMPlex` meshes\n in a single HDF5 files. This in turn requires one to name the `DMPlex`\n object with `Object.setName` before saving it with `DM.view` and before\n loading it with `DM.load` for identification of the mesh object.\n\n See Also\n --------\n DM.view, DM.load, Object.setName, petsc.DMLoad\n\n \nSource code at petsc4py/PETSc/DM.pyx:82"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_5load(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscViewerObject *__pyx_v_viewer = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("load (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_viewer)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 82, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "load") < 0)) __PYX_ERR(54, 82, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("load", 1, 1, 1, __pyx_nargs); __PYX_ERR(54, 82, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DM.load", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 0, "viewer", 0))) __PYX_ERR(54, 82, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_4load(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_viewer); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_4load(struct PyPetscDMObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("load", 1); /* "petsc4py/PETSc/DM.pyx":105 * * """ * CHKERR( DMLoad(self.dm, viewer.vwr) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMLoad(__pyx_v_self->dm, __pyx_v_viewer->vwr)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 105, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":106 * """ * CHKERR( DMLoad(self.dm, viewer.vwr) ) * return self # <<<<<<<<<<<<<< * * def destroy(self) -> Self: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/DM.pyx":82 * CHKERR( DMView(self.dm, vwr) ) * * def load(self, Viewer viewer) -> Self: # <<<<<<<<<<<<<< * """Return a `DM` stored in binary. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.load", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":108 * return self * * def destroy(self) -> Self: # <<<<<<<<<<<<<< * """Destroy the object. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_7destroy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_6destroy, "DM.destroy(self) -> Self\nDestroy the object.\n\n Collective.\n\n See Also\n --------\n petsc.DMDestroy\n\n \nSource code at petsc4py/PETSc/DM.pyx:108"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_7destroy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("destroy (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_6destroy(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_6destroy(struct PyPetscDMObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("destroy", 1); /* "petsc4py/PETSc/DM.pyx":118 * * """ * CHKERR( DMDestroy(&self.dm) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDestroy((&__pyx_v_self->dm))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 118, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":119 * """ * CHKERR( DMDestroy(&self.dm) ) * return self # <<<<<<<<<<<<<< * * def create(self, comm: Comm | None = None) -> Self: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/DM.pyx":108 * return self * * def destroy(self) -> Self: # <<<<<<<<<<<<<< * """Destroy the object. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":121 * return self * * def create(self, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Return an empty `DM`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_9create(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_8create, "DM.create(self, comm: Comm | None = None) -> Self\nReturn an empty `DM`.\n\n Collective.\n\n Parameters\n ----------\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n petsc.DMCreate\n\n \nSource code at petsc4py/PETSc/DM.pyx:121"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_9create(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 121, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "create") < 0)) __PYX_ERR(54, 121, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_comm = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, __pyx_nargs); __PYX_ERR(54, 121, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DM.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_8create(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_comm); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_8create(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; DM __pyx_v_newdm; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create", 1); /* "petsc4py/PETSc/DM.pyx":136 * * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscDM newdm = NULL * CHKERR( DMCreate(ccomm, &newdm) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(54, 136, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/DM.pyx":137 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscDM newdm = NULL # <<<<<<<<<<<<<< * CHKERR( DMCreate(ccomm, &newdm) ) * CHKERR( PetscCLEAR(self.obj) ); self.dm = newdm */ __pyx_v_newdm = NULL; /* "petsc4py/PETSc/DM.pyx":138 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscDM newdm = NULL * CHKERR( DMCreate(ccomm, &newdm) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.dm = newdm * return self */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCreate(__pyx_v_ccomm, (&__pyx_v_newdm))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 138, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":139 * cdef PetscDM newdm = NULL * CHKERR( DMCreate(ccomm, &newdm) ) * CHKERR( PetscCLEAR(self.obj) ); self.dm = newdm # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 139, __pyx_L1_error) __pyx_v_self->dm = __pyx_v_newdm; /* "petsc4py/PETSc/DM.pyx":140 * CHKERR( DMCreate(ccomm, &newdm) ) * CHKERR( PetscCLEAR(self.obj) ); self.dm = newdm * return self # <<<<<<<<<<<<<< * * def clone(self) -> DM: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/DM.pyx":121 * return self * * def create(self, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Return an empty `DM`. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":142 * return self * * def clone(self) -> DM: # <<<<<<<<<<<<<< * """Return the cloned `DM` . * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_11clone(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_10clone, "DM.clone(self) -> DM\nReturn the cloned `DM` .\n\n Collective.\n\n See Also\n --------\n petsc.DMClone\n\n \nSource code at petsc4py/PETSc/DM.pyx:142"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_11clone(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("clone (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("clone", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "clone", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_10clone(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_10clone(struct PyPetscDMObject *__pyx_v_self) { struct PyPetscDMObject *__pyx_v_dm = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PetscErrorCode __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("clone", 1); /* "petsc4py/PETSc/DM.pyx":152 * * """ * cdef DM dm = type(self)() # <<<<<<<<<<<<<< * CHKERR( DMClone(self.dm, &dm.dm) ) * return dm */ __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __pyx_t_2 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(54, 152, __pyx_L1_error) __pyx_v_dm = ((struct PyPetscDMObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DM.pyx":153 * """ * cdef DM dm = type(self)() * CHKERR( DMClone(self.dm, &dm.dm) ) # <<<<<<<<<<<<<< * return dm * */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMClone(__pyx_v_self->dm, (&__pyx_v_dm->dm))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 153, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":154 * cdef DM dm = type(self)() * CHKERR( DMClone(self.dm, &dm.dm) ) * return dm # <<<<<<<<<<<<<< * * def setType(self, dm_type: DM.Type | str) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_dm); __pyx_r = ((PyObject *)__pyx_v_dm); goto __pyx_L0; /* "petsc4py/PETSc/DM.pyx":142 * return self * * def clone(self) -> DM: # <<<<<<<<<<<<<< * """Return the cloned `DM` . * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DM.clone", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_dm); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":156 * return dm * * def setType(self, dm_type: DM.Type | str) -> None: # <<<<<<<<<<<<<< * """Build a `DM`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_13setType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_12setType, "DM.setType(self, dm_type: DM.Type | str) -> None\nBuild a `DM`.\n\n Collective.\n\n Parameters\n ----------\n dm_type\n The type of `DM`.\n\n Notes\n -----\n `DM` types are available in `DM.Type` class.\n\n See Also\n --------\n DM.Type, petsc.DMSetType\n\n \nSource code at petsc4py/PETSc/DM.pyx:156"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_13setType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_dm_type = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dm_type,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dm_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 156, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setType") < 0)) __PYX_ERR(54, 156, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_dm_type = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, __pyx_nargs); __PYX_ERR(54, 156, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DM.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_12setType(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_dm_type); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_12setType(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_dm_type) { DMType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setType", 0); __Pyx_INCREF(__pyx_v_dm_type); /* "petsc4py/PETSc/DM.pyx":175 * * """ * cdef PetscDMType cval = NULL # <<<<<<<<<<<<<< * dm_type = str2bytes(dm_type, &cval) * CHKERR( DMSetType(self.dm, cval) ) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/DM.pyx":176 * """ * cdef PetscDMType cval = NULL * dm_type = str2bytes(dm_type, &cval) # <<<<<<<<<<<<<< * CHKERR( DMSetType(self.dm, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_dm_type, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_dm_type, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DM.pyx":177 * cdef PetscDMType cval = NULL * dm_type = str2bytes(dm_type, &cval) * CHKERR( DMSetType(self.dm, cval) ) # <<<<<<<<<<<<<< * * def getType(self) -> str: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSetType(__pyx_v_self->dm, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 177, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":156 * return dm * * def setType(self, dm_type: DM.Type | str) -> None: # <<<<<<<<<<<<<< * """Build a `DM`. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DM.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_dm_type); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":179 * CHKERR( DMSetType(self.dm, cval) ) * * def getType(self) -> str: # <<<<<<<<<<<<<< * """Return the `DM` type name. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_15getType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_14getType, "DM.getType(self) -> str\nReturn the `DM` type name.\n\n Not collective.\n\n See Also\n --------\n petsc.DMGetType\n\n \nSource code at petsc4py/PETSc/DM.pyx:179"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_15getType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getType", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_14getType(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_14getType(struct PyPetscDMObject *__pyx_v_self) { DMType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getType", 1); /* "petsc4py/PETSc/DM.pyx":189 * * """ * cdef PetscDMType cval = NULL # <<<<<<<<<<<<<< * CHKERR( DMGetType(self.dm, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/DM.pyx":190 * """ * cdef PetscDMType cval = NULL * CHKERR( DMGetType(self.dm, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetType(__pyx_v_self->dm, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 190, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":191 * cdef PetscDMType cval = NULL * CHKERR( DMGetType(self.dm, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * def getDimension(self) -> int: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DM.pyx":179 * CHKERR( DMSetType(self.dm, cval) ) * * def getType(self) -> str: # <<<<<<<<<<<<<< * """Return the `DM` type name. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DM.getType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":193 * return bytes2str(cval) * * def getDimension(self) -> int: # <<<<<<<<<<<<<< * """Return the topological dimension of the `DM`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_17getDimension(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_16getDimension, "DM.getDimension(self) -> int\nReturn the topological dimension of the `DM`.\n\n Not collective.\n\n See Also\n --------\n petsc.DMGetDimension\n\n \nSource code at petsc4py/PETSc/DM.pyx:193"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_17getDimension(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getDimension (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getDimension", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getDimension", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_16getDimension(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_16getDimension(struct PyPetscDMObject *__pyx_v_self) { PetscInt __pyx_v_dim; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getDimension", 1); /* "petsc4py/PETSc/DM.pyx":203 * * """ * cdef PetscInt dim = 0 # <<<<<<<<<<<<<< * CHKERR( DMGetDimension(self.dm, &dim) ) * return toInt(dim) */ __pyx_v_dim = 0; /* "petsc4py/PETSc/DM.pyx":204 * """ * cdef PetscInt dim = 0 * CHKERR( DMGetDimension(self.dm, &dim) ) # <<<<<<<<<<<<<< * return toInt(dim) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetDimension(__pyx_v_self->dm, (&__pyx_v_dim))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 204, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":205 * cdef PetscInt dim = 0 * CHKERR( DMGetDimension(self.dm, &dim) ) * return toInt(dim) # <<<<<<<<<<<<<< * * def setDimension(self, dim: int) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_dim); if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DM.pyx":193 * return bytes2str(cval) * * def getDimension(self) -> int: # <<<<<<<<<<<<<< * """Return the topological dimension of the `DM`. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DM.getDimension", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":207 * return toInt(dim) * * def setDimension(self, dim: int) -> None: # <<<<<<<<<<<<<< * """Set the topological dimension of the `DM`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_19setDimension(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_18setDimension, "DM.setDimension(self, dim: int) -> None\nSet the topological dimension of the `DM`.\n\n Collective.\n\n Parameters\n ----------\n dim\n Topological dimension.\n\n See Also\n --------\n petsc.DMSetDimension\n\n \nSource code at petsc4py/PETSc/DM.pyx:207"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_19setDimension(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_dim = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setDimension (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dim,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dim)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 207, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setDimension") < 0)) __PYX_ERR(54, 207, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_dim = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setDimension", 1, 1, 1, __pyx_nargs); __PYX_ERR(54, 207, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DM.setDimension", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_18setDimension(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_dim); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_18setDimension(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_dim) { PetscInt __pyx_v_cdim; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setDimension", 1); /* "petsc4py/PETSc/DM.pyx":222 * * """ * cdef PetscInt cdim = asInt(dim) # <<<<<<<<<<<<<< * CHKERR( DMSetDimension(self.dm, cdim) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_dim); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(54, 222, __pyx_L1_error) __pyx_v_cdim = __pyx_t_1; /* "petsc4py/PETSc/DM.pyx":223 * """ * cdef PetscInt cdim = asInt(dim) * CHKERR( DMSetDimension(self.dm, cdim) ) # <<<<<<<<<<<<<< * * def getCoordinateDim(self) -> int: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSetDimension(__pyx_v_self->dm, __pyx_v_cdim)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 223, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":207 * return toInt(dim) * * def setDimension(self, dim: int) -> None: # <<<<<<<<<<<<<< * """Set the topological dimension of the `DM`. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.setDimension", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":225 * CHKERR( DMSetDimension(self.dm, cdim) ) * * def getCoordinateDim(self) -> int: # <<<<<<<<<<<<<< * """Return the dimension of embedding space for coordinates values. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_21getCoordinateDim(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_20getCoordinateDim, "DM.getCoordinateDim(self) -> int\nReturn the dimension of embedding space for coordinates values.\n\n Not collective.\n\n See Also\n --------\n petsc.DMGetCoordinateDim\n\n \nSource code at petsc4py/PETSc/DM.pyx:225"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_21getCoordinateDim(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getCoordinateDim (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getCoordinateDim", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getCoordinateDim", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_20getCoordinateDim(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_20getCoordinateDim(struct PyPetscDMObject *__pyx_v_self) { PetscInt __pyx_v_dim; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getCoordinateDim", 1); /* "petsc4py/PETSc/DM.pyx":235 * * """ * cdef PetscInt dim = 0 # <<<<<<<<<<<<<< * CHKERR( DMGetCoordinateDim(self.dm, &dim) ) * return toInt(dim) */ __pyx_v_dim = 0; /* "petsc4py/PETSc/DM.pyx":236 * """ * cdef PetscInt dim = 0 * CHKERR( DMGetCoordinateDim(self.dm, &dim) ) # <<<<<<<<<<<<<< * return toInt(dim) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetCoordinateDim(__pyx_v_self->dm, (&__pyx_v_dim))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 236, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":237 * cdef PetscInt dim = 0 * CHKERR( DMGetCoordinateDim(self.dm, &dim) ) * return toInt(dim) # <<<<<<<<<<<<<< * * def setCoordinateDim(self, dim: int) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_dim); if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DM.pyx":225 * CHKERR( DMSetDimension(self.dm, cdim) ) * * def getCoordinateDim(self) -> int: # <<<<<<<<<<<<<< * """Return the dimension of embedding space for coordinates values. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DM.getCoordinateDim", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":239 * return toInt(dim) * * def setCoordinateDim(self, dim: int) -> None: # <<<<<<<<<<<<<< * """Set the dimension of embedding space for coordinates values. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_23setCoordinateDim(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_22setCoordinateDim, "DM.setCoordinateDim(self, dim: int) -> None\nSet the dimension of embedding space for coordinates values.\n\n Not collective.\n\n Parameters\n ----------\n dim\n The embedding dimension.\n\n See Also\n --------\n petsc.DMSetCoordinateDim\n\n \nSource code at petsc4py/PETSc/DM.pyx:239"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_23setCoordinateDim(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_dim = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setCoordinateDim (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dim,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dim)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 239, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setCoordinateDim") < 0)) __PYX_ERR(54, 239, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_dim = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setCoordinateDim", 1, 1, 1, __pyx_nargs); __PYX_ERR(54, 239, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DM.setCoordinateDim", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_22setCoordinateDim(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_dim); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_22setCoordinateDim(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_dim) { PetscInt __pyx_v_cdim; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setCoordinateDim", 1); /* "petsc4py/PETSc/DM.pyx":254 * * """ * cdef PetscInt cdim = asInt(dim) # <<<<<<<<<<<<<< * CHKERR( DMSetCoordinateDim(self.dm, cdim) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_dim); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(54, 254, __pyx_L1_error) __pyx_v_cdim = __pyx_t_1; /* "petsc4py/PETSc/DM.pyx":255 * """ * cdef PetscInt cdim = asInt(dim) * CHKERR( DMSetCoordinateDim(self.dm, cdim) ) # <<<<<<<<<<<<<< * * def setOptionsPrefix(self, prefix: str) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSetCoordinateDim(__pyx_v_self->dm, __pyx_v_cdim)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 255, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":239 * return toInt(dim) * * def setCoordinateDim(self, dim: int) -> None: # <<<<<<<<<<<<<< * """Set the dimension of embedding space for coordinates values. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.setCoordinateDim", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":257 * CHKERR( DMSetCoordinateDim(self.dm, cdim) ) * * def setOptionsPrefix(self, prefix: str) -> None: # <<<<<<<<<<<<<< * """Set the prefix used for searching for options in the database. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_25setOptionsPrefix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_24setOptionsPrefix, "DM.setOptionsPrefix(self, prefix: str) -> None\nSet the prefix used for searching for options in the database.\n\n Logically collective.\n\n See Also\n --------\n petsc_options, getOptionsPrefix, petsc.DMSetOptionsPrefix\n\n \nSource code at petsc4py/PETSc/DM.pyx:257"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_25setOptionsPrefix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_prefix = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setOptionsPrefix (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_prefix,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_prefix)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 257, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setOptionsPrefix") < 0)) __PYX_ERR(54, 257, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_prefix = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setOptionsPrefix", 1, 1, 1, __pyx_nargs); __PYX_ERR(54, 257, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DM.setOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_24setOptionsPrefix(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_prefix); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_24setOptionsPrefix(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_prefix) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setOptionsPrefix", 0); __Pyx_INCREF(__pyx_v_prefix); /* "petsc4py/PETSc/DM.pyx":267 * * """ * cdef const char *cval = NULL # <<<<<<<<<<<<<< * prefix = str2bytes(prefix, &cval) * CHKERR( DMSetOptionsPrefix(self.dm, cval) ) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/DM.pyx":268 * """ * cdef const char *cval = NULL * prefix = str2bytes(prefix, &cval) # <<<<<<<<<<<<<< * CHKERR( DMSetOptionsPrefix(self.dm, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_prefix, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_prefix, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DM.pyx":269 * cdef const char *cval = NULL * prefix = str2bytes(prefix, &cval) * CHKERR( DMSetOptionsPrefix(self.dm, cval) ) # <<<<<<<<<<<<<< * * def getOptionsPrefix(self) -> str: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSetOptionsPrefix(__pyx_v_self->dm, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 269, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":257 * CHKERR( DMSetCoordinateDim(self.dm, cdim) ) * * def setOptionsPrefix(self, prefix: str) -> None: # <<<<<<<<<<<<<< * """Set the prefix used for searching for options in the database. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DM.setOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_prefix); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":271 * CHKERR( DMSetOptionsPrefix(self.dm, cval) ) * * def getOptionsPrefix(self) -> str: # <<<<<<<<<<<<<< * """Return the prefix used for searching for options in the database. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_27getOptionsPrefix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_26getOptionsPrefix, "DM.getOptionsPrefix(self) -> str\nReturn the prefix used for searching for options in the database.\n\n Not collective.\n\n See Also\n --------\n petsc_options, setOptionsPrefix, petsc.DMGetOptionsPrefix\n\n \nSource code at petsc4py/PETSc/DM.pyx:271"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_27getOptionsPrefix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getOptionsPrefix (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getOptionsPrefix", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getOptionsPrefix", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_26getOptionsPrefix(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_26getOptionsPrefix(struct PyPetscDMObject *__pyx_v_self) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getOptionsPrefix", 1); /* "petsc4py/PETSc/DM.pyx":281 * * """ * cdef const char *cval = NULL # <<<<<<<<<<<<<< * CHKERR( DMGetOptionsPrefix(self.dm, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/DM.pyx":282 * """ * cdef const char *cval = NULL * CHKERR( DMGetOptionsPrefix(self.dm, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetOptionsPrefix(__pyx_v_self->dm, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 282, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":283 * cdef const char *cval = NULL * CHKERR( DMGetOptionsPrefix(self.dm, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * def appendOptionsPrefix(self, prefix: str) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DM.pyx":271 * CHKERR( DMSetOptionsPrefix(self.dm, cval) ) * * def getOptionsPrefix(self) -> str: # <<<<<<<<<<<<<< * """Return the prefix used for searching for options in the database. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DM.getOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":285 * return bytes2str(cval) * * def appendOptionsPrefix(self, prefix: str) -> None: # <<<<<<<<<<<<<< * """Append to the prefix used for searching for options in the database. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_29appendOptionsPrefix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_28appendOptionsPrefix, "DM.appendOptionsPrefix(self, prefix: str) -> None\nAppend to the prefix used for searching for options in the database.\n\n Logically collective.\n\n See Also\n --------\n petsc_options, setOptionsPrefix, petsc.DMAppendOptionsPrefix\n\n \nSource code at petsc4py/PETSc/DM.pyx:285"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_29appendOptionsPrefix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_prefix = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("appendOptionsPrefix (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_prefix,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_prefix)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 285, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "appendOptionsPrefix") < 0)) __PYX_ERR(54, 285, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_prefix = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("appendOptionsPrefix", 1, 1, 1, __pyx_nargs); __PYX_ERR(54, 285, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DM.appendOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_28appendOptionsPrefix(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_prefix); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_28appendOptionsPrefix(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_prefix) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("appendOptionsPrefix", 0); __Pyx_INCREF(__pyx_v_prefix); /* "petsc4py/PETSc/DM.pyx":295 * * """ * cdef const char *cval = NULL # <<<<<<<<<<<<<< * prefix = str2bytes(prefix, &cval) * CHKERR( DMAppendOptionsPrefix(self.dm, cval) ) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/DM.pyx":296 * """ * cdef const char *cval = NULL * prefix = str2bytes(prefix, &cval) # <<<<<<<<<<<<<< * CHKERR( DMAppendOptionsPrefix(self.dm, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_prefix, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_prefix, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DM.pyx":297 * cdef const char *cval = NULL * prefix = str2bytes(prefix, &cval) * CHKERR( DMAppendOptionsPrefix(self.dm, cval) ) # <<<<<<<<<<<<<< * * def setFromOptions(self) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMAppendOptionsPrefix(__pyx_v_self->dm, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 297, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":285 * return bytes2str(cval) * * def appendOptionsPrefix(self, prefix: str) -> None: # <<<<<<<<<<<<<< * """Append to the prefix used for searching for options in the database. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DM.appendOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_prefix); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":299 * CHKERR( DMAppendOptionsPrefix(self.dm, cval) ) * * def setFromOptions(self) -> None: # <<<<<<<<<<<<<< * """Configure the object from the options database. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_31setFromOptions(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_30setFromOptions, "DM.setFromOptions(self) -> None\nConfigure the object from the options database.\n\n Collective.\n\n See Also\n --------\n petsc_options, petsc.DMSetFromOptions\n\n \nSource code at petsc4py/PETSc/DM.pyx:299"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_31setFromOptions(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFromOptions (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("setFromOptions", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setFromOptions", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_30setFromOptions(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_30setFromOptions(struct PyPetscDMObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFromOptions", 1); /* "petsc4py/PETSc/DM.pyx":309 * * """ * CHKERR( DMSetFromOptions(self.dm) ) # <<<<<<<<<<<<<< * * def viewFromOptions(self, name: str, Object obj=None) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSetFromOptions(__pyx_v_self->dm)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 309, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":299 * CHKERR( DMAppendOptionsPrefix(self.dm, cval) ) * * def setFromOptions(self) -> None: # <<<<<<<<<<<<<< * """Configure the object from the options database. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.setFromOptions", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":311 * CHKERR( DMSetFromOptions(self.dm) ) * * def viewFromOptions(self, name: str, Object obj=None) -> None: # <<<<<<<<<<<<<< * """View a `DM` based in the options. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_33viewFromOptions(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_32viewFromOptions, "DM.viewFromOptions(self, name: str, obj: Object | None = None) -> None\nView a `DM` based in the options.\n\n Collective.\n\n Parameters\n ----------\n name\n Name used to activate the viewing.\n obj\n Object provides the prefix for the options database.\n\n See Also\n --------\n petsc.DMViewFromOptions\n\n \nSource code at petsc4py/PETSc/DM.pyx:311"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_33viewFromOptions(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_name = 0; struct PyPetscObjectObject *__pyx_v_obj = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("viewFromOptions (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_obj,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscObjectObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 311, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_obj); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 311, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "viewFromOptions") < 0)) __PYX_ERR(54, 311, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_name = values[0]; __pyx_v_obj = ((struct PyPetscObjectObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("viewFromOptions", 0, 1, 2, __pyx_nargs); __PYX_ERR(54, 311, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DM.viewFromOptions", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_obj), __pyx_ptype_8petsc4py_5PETSc_Object, 1, "obj", 0))) __PYX_ERR(54, 311, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_32viewFromOptions(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_name, __pyx_v_obj); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_32viewFromOptions(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name, struct PyPetscObjectObject *__pyx_v_obj) { char const *__pyx_v_cname; CYTHON_UNUSED PyObject *__pyx_v__ = NULL; PetscObject __pyx_v_cobj; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("viewFromOptions", 1); /* "petsc4py/PETSc/DM.pyx":328 * * """ * cdef const char *cname = NULL # <<<<<<<<<<<<<< * _ = str2bytes(name, &cname) * cdef PetscObject cobj = NULL */ __pyx_v_cname = NULL; /* "petsc4py/PETSc/DM.pyx":329 * """ * cdef const char *cname = NULL * _ = str2bytes(name, &cname) # <<<<<<<<<<<<<< * cdef PetscObject cobj = NULL * if obj is not None: cobj = obj.obj[0] */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cname)); if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v__ = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/DM.pyx":330 * cdef const char *cname = NULL * _ = str2bytes(name, &cname) * cdef PetscObject cobj = NULL # <<<<<<<<<<<<<< * if obj is not None: cobj = obj.obj[0] * CHKERR( DMViewFromOptions(self.dm, cobj, cname) ) */ __pyx_v_cobj = NULL; /* "petsc4py/PETSc/DM.pyx":331 * _ = str2bytes(name, &cname) * cdef PetscObject cobj = NULL * if obj is not None: cobj = obj.obj[0] # <<<<<<<<<<<<<< * CHKERR( DMViewFromOptions(self.dm, cobj, cname) ) * */ __pyx_t_2 = (((PyObject *)__pyx_v_obj) != Py_None); if (__pyx_t_2) { __pyx_v_cobj = (__pyx_v_obj->obj[0]); } /* "petsc4py/PETSc/DM.pyx":332 * cdef PetscObject cobj = NULL * if obj is not None: cobj = obj.obj[0] * CHKERR( DMViewFromOptions(self.dm, cobj, cname) ) # <<<<<<<<<<<<<< * * def setUp(self) -> Self: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMViewFromOptions(__pyx_v_self->dm, __pyx_v_cobj, __pyx_v_cname)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 332, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":311 * CHKERR( DMSetFromOptions(self.dm) ) * * def viewFromOptions(self, name: str, Object obj=None) -> None: # <<<<<<<<<<<<<< * """View a `DM` based in the options. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DM.viewFromOptions", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v__); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":334 * CHKERR( DMViewFromOptions(self.dm, cobj, cname) ) * * def setUp(self) -> Self: # <<<<<<<<<<<<<< * """Return the data structure. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_35setUp(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_34setUp, "DM.setUp(self) -> Self\nReturn the data structure.\n\n Collective.\n\n See Also\n --------\n petsc.DMSetUp\n\n \nSource code at petsc4py/PETSc/DM.pyx:334"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_35setUp(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setUp (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("setUp", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setUp", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_34setUp(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_34setUp(struct PyPetscDMObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setUp", 1); /* "petsc4py/PETSc/DM.pyx":344 * * """ * CHKERR( DMSetUp(self.dm) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSetUp(__pyx_v_self->dm)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 344, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":345 * """ * CHKERR( DMSetUp(self.dm) ) * return self # <<<<<<<<<<<<<< * * # --- application context --- */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/DM.pyx":334 * CHKERR( DMViewFromOptions(self.dm, cobj, cname) ) * * def setUp(self) -> Self: # <<<<<<<<<<<<<< * """Return the data structure. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.setUp", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":349 * # --- application context --- * * def setAppCtx(self, appctx): # <<<<<<<<<<<<<< * self.set_attr('__appctx__', appctx) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_37setAppCtx(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_36setAppCtx, "DM.setAppCtx(self, appctx)\nSource code at petsc4py/PETSc/DM.pyx:349"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_37setAppCtx(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_appctx = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setAppCtx (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_appctx,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_appctx)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 349, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setAppCtx") < 0)) __PYX_ERR(54, 349, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_appctx = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setAppCtx", 1, 1, 1, __pyx_nargs); __PYX_ERR(54, 349, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DM.setAppCtx", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_36setAppCtx(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_appctx); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_36setAppCtx(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_appctx) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setAppCtx", 1); /* "petsc4py/PETSc/DM.pyx":350 * * def setAppCtx(self, appctx): * self.set_attr('__appctx__', appctx) # <<<<<<<<<<<<<< * * def getAppCtx(self): */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__appctx__"), __pyx_v_appctx); if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DM.pyx":349 * # --- application context --- * * def setAppCtx(self, appctx): # <<<<<<<<<<<<<< * self.set_attr('__appctx__', appctx) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DM.setAppCtx", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":352 * self.set_attr('__appctx__', appctx) * * def getAppCtx(self): # <<<<<<<<<<<<<< * return self.get_attr('__appctx__') * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_39getAppCtx(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_38getAppCtx, "DM.getAppCtx(self)\nSource code at petsc4py/PETSc/DM.pyx:352"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_39getAppCtx(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getAppCtx (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getAppCtx", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getAppCtx", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_38getAppCtx(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_38getAppCtx(struct PyPetscDMObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getAppCtx", 1); /* "petsc4py/PETSc/DM.pyx":353 * * def getAppCtx(self): * return self.get_attr('__appctx__') # <<<<<<<<<<<<<< * * # */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__appctx__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DM.pyx":352 * self.set_attr('__appctx__', appctx) * * def getAppCtx(self): # <<<<<<<<<<<<<< * return self.get_attr('__appctx__') * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DM.getAppCtx", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":357 * # * * def setBasicAdjacency(self, useCone: bool, useClosure: bool) -> None: # <<<<<<<<<<<<<< * """Set the flags for determining variable influence. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_41setBasicAdjacency(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_40setBasicAdjacency, "DM.setBasicAdjacency(self, useCone: bool, useClosure: bool) -> None\nSet the flags for determining variable influence.\n\n Not collective.\n\n Parameters\n ----------\n useCone : bool\n Whether adjacency uses cone information.\n useClosure : bool\n Whether adjacency is computed using full closure information.\n\n See Also\n --------\n petsc.DMSetBasicAdjacency\n\n \nSource code at petsc4py/PETSc/DM.pyx:357"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_41setBasicAdjacency(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_useCone = 0; PyObject *__pyx_v_useClosure = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setBasicAdjacency (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_useCone,&__pyx_n_s_useClosure,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_useCone)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 357, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_useClosure)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 357, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setBasicAdjacency", 1, 2, 2, 1); __PYX_ERR(54, 357, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setBasicAdjacency") < 0)) __PYX_ERR(54, 357, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_useCone = values[0]; __pyx_v_useClosure = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setBasicAdjacency", 1, 2, 2, __pyx_nargs); __PYX_ERR(54, 357, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DM.setBasicAdjacency", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_40setBasicAdjacency(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_useCone, __pyx_v_useClosure); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_40setBasicAdjacency(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_useCone, PyObject *__pyx_v_useClosure) { PetscBool __pyx_v_uC; PetscBool __pyx_v_uCl; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setBasicAdjacency", 1); /* "petsc4py/PETSc/DM.pyx":374 * * """ * cdef PetscBool uC = useCone # <<<<<<<<<<<<<< * cdef PetscBool uCl = useClosure * CHKERR( DMSetBasicAdjacency(self.dm, uC, uCl) ) */ __pyx_t_1 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_useCone)); if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 374, __pyx_L1_error) __pyx_v_uC = __pyx_t_1; /* "petsc4py/PETSc/DM.pyx":375 * """ * cdef PetscBool uC = useCone * cdef PetscBool uCl = useClosure # <<<<<<<<<<<<<< * CHKERR( DMSetBasicAdjacency(self.dm, uC, uCl) ) * */ __pyx_t_1 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_useClosure)); if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 375, __pyx_L1_error) __pyx_v_uCl = __pyx_t_1; /* "petsc4py/PETSc/DM.pyx":376 * cdef PetscBool uC = useCone * cdef PetscBool uCl = useClosure * CHKERR( DMSetBasicAdjacency(self.dm, uC, uCl) ) # <<<<<<<<<<<<<< * * def getBasicAdjacency(self) -> tuple[bool, bool]: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSetBasicAdjacency(__pyx_v_self->dm, __pyx_v_uC, __pyx_v_uCl)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 376, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":357 * # * * def setBasicAdjacency(self, useCone: bool, useClosure: bool) -> None: # <<<<<<<<<<<<<< * """Set the flags for determining variable influence. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.setBasicAdjacency", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":378 * CHKERR( DMSetBasicAdjacency(self.dm, uC, uCl) ) * * def getBasicAdjacency(self) -> tuple[bool, bool]: # <<<<<<<<<<<<<< * """Return the flags for determining variable influence. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_43getBasicAdjacency(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_42getBasicAdjacency, "DM.getBasicAdjacency(self) -> tuple[bool, bool]\nReturn the flags for determining variable influence.\n\n Not collective.\n\n Returns\n -------\n useCone : bool\n Whether adjacency uses cone information.\n useClosure : bool\n Whether adjacency is computed using full closure information.\n\n See Also\n --------\n petsc.DMGetBasicAdjacency\n\n \nSource code at petsc4py/PETSc/DM.pyx:378"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_43getBasicAdjacency(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getBasicAdjacency (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getBasicAdjacency", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getBasicAdjacency", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_42getBasicAdjacency(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_42getBasicAdjacency(struct PyPetscDMObject *__pyx_v_self) { PetscBool __pyx_v_uC; PetscBool __pyx_v_uCl; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getBasicAdjacency", 1); /* "petsc4py/PETSc/DM.pyx":395 * * """ * cdef PetscBool uC = PETSC_FALSE # <<<<<<<<<<<<<< * cdef PetscBool uCl = PETSC_FALSE * CHKERR( DMGetBasicAdjacency(self.dm, &uC, &uCl) ) */ __pyx_v_uC = PETSC_FALSE; /* "petsc4py/PETSc/DM.pyx":396 * """ * cdef PetscBool uC = PETSC_FALSE * cdef PetscBool uCl = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( DMGetBasicAdjacency(self.dm, &uC, &uCl) ) * return toBool(uC), toBool(uCl) */ __pyx_v_uCl = PETSC_FALSE; /* "petsc4py/PETSc/DM.pyx":397 * cdef PetscBool uC = PETSC_FALSE * cdef PetscBool uCl = PETSC_FALSE * CHKERR( DMGetBasicAdjacency(self.dm, &uC, &uCl) ) # <<<<<<<<<<<<<< * return toBool(uC), toBool(uCl) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetBasicAdjacency(__pyx_v_self->dm, (&__pyx_v_uC), (&__pyx_v_uCl))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 397, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":398 * cdef PetscBool uCl = PETSC_FALSE * CHKERR( DMGetBasicAdjacency(self.dm, &uC, &uCl) ) * return toBool(uC), toBool(uCl) # <<<<<<<<<<<<<< * * def setFieldAdjacency(self, field: int, useCone: bool, useClosure: bool) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_uC); if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 398, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_uCl); if (unlikely(!__pyx_t_3)) __PYX_ERR(54, 398, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 398, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(54, 398, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(54, 398, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DM.pyx":378 * CHKERR( DMSetBasicAdjacency(self.dm, uC, uCl) ) * * def getBasicAdjacency(self) -> tuple[bool, bool]: # <<<<<<<<<<<<<< * """Return the flags for determining variable influence. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.DM.getBasicAdjacency", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":400 * return toBool(uC), toBool(uCl) * * def setFieldAdjacency(self, field: int, useCone: bool, useClosure: bool) -> None: # <<<<<<<<<<<<<< * """Set the flags for determining variable influence. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_45setFieldAdjacency(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_44setFieldAdjacency, "DM.setFieldAdjacency(self, field: int, useCone: bool, useClosure: bool) -> None\nSet the flags for determining variable influence.\n\n Not collective.\n\n Parameters\n ----------\n field : int\n The field number.\n useCone : bool\n Whether adjacency uses cone information.\n useClosure : bool\n Whether adjacency is computed using full closure information.\n\n See Also\n --------\n petsc.DMSetAdjacency\n\n \nSource code at petsc4py/PETSc/DM.pyx:400"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_45setFieldAdjacency(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_field = 0; PyObject *__pyx_v_useCone = 0; PyObject *__pyx_v_useClosure = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFieldAdjacency (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_field,&__pyx_n_s_useCone,&__pyx_n_s_useClosure,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_field)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 400, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_useCone)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 400, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setFieldAdjacency", 1, 3, 3, 1); __PYX_ERR(54, 400, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_useClosure)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 400, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setFieldAdjacency", 1, 3, 3, 2); __PYX_ERR(54, 400, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setFieldAdjacency") < 0)) __PYX_ERR(54, 400, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_field = values[0]; __pyx_v_useCone = values[1]; __pyx_v_useClosure = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setFieldAdjacency", 1, 3, 3, __pyx_nargs); __PYX_ERR(54, 400, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DM.setFieldAdjacency", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_44setFieldAdjacency(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_field, __pyx_v_useCone, __pyx_v_useClosure); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_44setFieldAdjacency(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_useCone, PyObject *__pyx_v_useClosure) { PetscInt __pyx_v_f; PetscBool __pyx_v_uC; PetscBool __pyx_v_uCl; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscBool __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFieldAdjacency", 1); /* "petsc4py/PETSc/DM.pyx":419 * * """ * cdef PetscInt f = asInt(field) # <<<<<<<<<<<<<< * cdef PetscBool uC = useCone * cdef PetscBool uCl = useClosure */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_field); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(54, 419, __pyx_L1_error) __pyx_v_f = __pyx_t_1; /* "petsc4py/PETSc/DM.pyx":420 * """ * cdef PetscInt f = asInt(field) * cdef PetscBool uC = useCone # <<<<<<<<<<<<<< * cdef PetscBool uCl = useClosure * CHKERR( DMSetAdjacency(self.dm, f, uC, uCl) ) */ __pyx_t_2 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_useCone)); if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 420, __pyx_L1_error) __pyx_v_uC = __pyx_t_2; /* "petsc4py/PETSc/DM.pyx":421 * cdef PetscInt f = asInt(field) * cdef PetscBool uC = useCone * cdef PetscBool uCl = useClosure # <<<<<<<<<<<<<< * CHKERR( DMSetAdjacency(self.dm, f, uC, uCl) ) * */ __pyx_t_2 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_useClosure)); if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 421, __pyx_L1_error) __pyx_v_uCl = __pyx_t_2; /* "petsc4py/PETSc/DM.pyx":422 * cdef PetscBool uC = useCone * cdef PetscBool uCl = useClosure * CHKERR( DMSetAdjacency(self.dm, f, uC, uCl) ) # <<<<<<<<<<<<<< * * def getFieldAdjacency(self, field: int) -> tuple[bool, bool]: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSetAdjacency(__pyx_v_self->dm, __pyx_v_f, __pyx_v_uC, __pyx_v_uCl)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 422, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":400 * return toBool(uC), toBool(uCl) * * def setFieldAdjacency(self, field: int, useCone: bool, useClosure: bool) -> None: # <<<<<<<<<<<<<< * """Set the flags for determining variable influence. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.setFieldAdjacency", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":424 * CHKERR( DMSetAdjacency(self.dm, f, uC, uCl) ) * * def getFieldAdjacency(self, field: int) -> tuple[bool, bool]: # <<<<<<<<<<<<<< * """Return the flags for determining variable influence. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_47getFieldAdjacency(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_46getFieldAdjacency, "DM.getFieldAdjacency(self, field: int) -> tuple[bool, bool]\nReturn the flags for determining variable influence.\n\n Not collective.\n\n Parameters\n ----------\n field\n The field number.\n\n Returns\n -------\n useCone : bool\n Whether adjacency uses cone information.\n useClosure : bool\n Whether adjacency is computed using full closure information.\n\n See Also\n --------\n petsc.DMGetAdjacency\n\n \nSource code at petsc4py/PETSc/DM.pyx:424"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_47getFieldAdjacency(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_field = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getFieldAdjacency (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_field,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_field)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 424, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getFieldAdjacency") < 0)) __PYX_ERR(54, 424, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_field = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getFieldAdjacency", 1, 1, 1, __pyx_nargs); __PYX_ERR(54, 424, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DM.getFieldAdjacency", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_46getFieldAdjacency(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_field); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_46getFieldAdjacency(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_field) { PetscInt __pyx_v_f; PetscBool __pyx_v_uC; PetscBool __pyx_v_uCl; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getFieldAdjacency", 1); /* "petsc4py/PETSc/DM.pyx":446 * * """ * cdef PetscInt f = asInt(field) # <<<<<<<<<<<<<< * cdef PetscBool uC = PETSC_FALSE * cdef PetscBool uCl = PETSC_FALSE */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_field); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(54, 446, __pyx_L1_error) __pyx_v_f = __pyx_t_1; /* "petsc4py/PETSc/DM.pyx":447 * """ * cdef PetscInt f = asInt(field) * cdef PetscBool uC = PETSC_FALSE # <<<<<<<<<<<<<< * cdef PetscBool uCl = PETSC_FALSE * CHKERR( DMGetAdjacency(self.dm, f, &uC, &uCl) ) */ __pyx_v_uC = PETSC_FALSE; /* "petsc4py/PETSc/DM.pyx":448 * cdef PetscInt f = asInt(field) * cdef PetscBool uC = PETSC_FALSE * cdef PetscBool uCl = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( DMGetAdjacency(self.dm, f, &uC, &uCl) ) * return toBool(uC), toBool(uCl) */ __pyx_v_uCl = PETSC_FALSE; /* "petsc4py/PETSc/DM.pyx":449 * cdef PetscBool uC = PETSC_FALSE * cdef PetscBool uCl = PETSC_FALSE * CHKERR( DMGetAdjacency(self.dm, f, &uC, &uCl) ) # <<<<<<<<<<<<<< * return toBool(uC), toBool(uCl) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetAdjacency(__pyx_v_self->dm, __pyx_v_f, (&__pyx_v_uC), (&__pyx_v_uCl))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 449, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":450 * cdef PetscBool uCl = PETSC_FALSE * CHKERR( DMGetAdjacency(self.dm, f, &uC, &uCl) ) * return toBool(uC), toBool(uCl) # <<<<<<<<<<<<<< * * # */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_uC); if (unlikely(!__pyx_t_3)) __PYX_ERR(54, 450, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_uCl); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 450, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 450, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3)) __PYX_ERR(54, 450, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4)) __PYX_ERR(54, 450, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DM.pyx":424 * CHKERR( DMSetAdjacency(self.dm, f, uC, uCl) ) * * def getFieldAdjacency(self, field: int) -> tuple[bool, bool]: # <<<<<<<<<<<<<< * """Return the flags for determining variable influence. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.DM.getFieldAdjacency", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":454 * # * * def createSubDM(self, fields: Sequence[int]) -> tuple[IS, DM]: # <<<<<<<<<<<<<< * """Return `IS` and `DM` encapsulating a subproblem. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_49createSubDM(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_48createSubDM, "DM.createSubDM(self, fields: Sequence[int]) -> tuple[IS, DM]\nReturn `IS` and `DM` encapsulating a subproblem.\n\n Not collective.\n\n Returns\n -------\n iset : IS\n The global indices for all the degrees of freedom.\n subdm : DM\n The `DM` for the subproblem.\n\n See Also\n --------\n petsc.DMCreateSubDM\n\n \nSource code at petsc4py/PETSc/DM.pyx:454"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_49createSubDM(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_fields = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createSubDM (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fields,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fields)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 454, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createSubDM") < 0)) __PYX_ERR(54, 454, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_fields = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createSubDM", 1, 1, 1, __pyx_nargs); __PYX_ERR(54, 454, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DM.createSubDM", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_48createSubDM(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_fields); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_48createSubDM(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_fields) { struct PyPetscISObject *__pyx_v_iset = 0; struct PyPetscDMObject *__pyx_v_subdm = 0; PetscInt *__pyx_v_ifields; PetscInt __pyx_v_numFields; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createSubDM", 0); __Pyx_INCREF(__pyx_v_fields); /* "petsc4py/PETSc/DM.pyx":471 * * """ * cdef IS iset = IS() # <<<<<<<<<<<<<< * cdef DM subdm = DM() * cdef PetscInt *ifields = NULL */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_iset = ((struct PyPetscISObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DM.pyx":472 * """ * cdef IS iset = IS() * cdef DM subdm = DM() # <<<<<<<<<<<<<< * cdef PetscInt *ifields = NULL * cdef PetscInt numFields = 0 */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM)); if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 472, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_subdm = ((struct PyPetscDMObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DM.pyx":473 * cdef IS iset = IS() * cdef DM subdm = DM() * cdef PetscInt *ifields = NULL # <<<<<<<<<<<<<< * cdef PetscInt numFields = 0 * fields = iarray_i(fields, &numFields, &ifields) */ __pyx_v_ifields = NULL; /* "petsc4py/PETSc/DM.pyx":474 * cdef DM subdm = DM() * cdef PetscInt *ifields = NULL * cdef PetscInt numFields = 0 # <<<<<<<<<<<<<< * fields = iarray_i(fields, &numFields, &ifields) * CHKERR( DMCreateSubDM( self.dm, numFields, ifields, &iset.iset, &subdm.dm) ) */ __pyx_v_numFields = 0; /* "petsc4py/PETSc/DM.pyx":475 * cdef PetscInt *ifields = NULL * cdef PetscInt numFields = 0 * fields = iarray_i(fields, &numFields, &ifields) # <<<<<<<<<<<<<< * CHKERR( DMCreateSubDM( self.dm, numFields, ifields, &iset.iset, &subdm.dm) ) * return iset, subdm */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_fields, (&__pyx_v_numFields), (&__pyx_v_ifields))); if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_fields, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DM.pyx":476 * cdef PetscInt numFields = 0 * fields = iarray_i(fields, &numFields, &ifields) * CHKERR( DMCreateSubDM( self.dm, numFields, ifields, &iset.iset, &subdm.dm) ) # <<<<<<<<<<<<<< * return iset, subdm * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCreateSubDM(__pyx_v_self->dm, __pyx_v_numFields, __pyx_v_ifields, (&__pyx_v_iset->iset), (&__pyx_v_subdm->dm))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 476, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":477 * fields = iarray_i(fields, &numFields, &ifields) * CHKERR( DMCreateSubDM( self.dm, numFields, ifields, &iset.iset, &subdm.dm) ) * return iset, subdm # <<<<<<<<<<<<<< * * # */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 477, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF((PyObject *)__pyx_v_iset); __Pyx_GIVEREF((PyObject *)__pyx_v_iset); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_iset))) __PYX_ERR(54, 477, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_subdm); __Pyx_GIVEREF((PyObject *)__pyx_v_subdm); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_subdm))) __PYX_ERR(54, 477, __pyx_L1_error); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DM.pyx":454 * # * * def createSubDM(self, fields: Sequence[int]) -> tuple[IS, DM]: # <<<<<<<<<<<<<< * """Return `IS` and `DM` encapsulating a subproblem. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DM.createSubDM", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_iset); __Pyx_XDECREF((PyObject *)__pyx_v_subdm); __Pyx_XDECREF(__pyx_v_fields); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":481 * # * * def setAuxiliaryVec(self, Vec aux, label: DMLabel | None, value=0, part=0) -> None: # <<<<<<<<<<<<<< * """Set an auxiliary vector for a specific region. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_51setAuxiliaryVec(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_50setAuxiliaryVec, "DM.setAuxiliaryVec(self, aux: Vec, label: DMLabel | None, value=0, part=0) -> None\nSet an auxiliary vector for a specific region.\n\n Not collective.\n\n Parameters\n ----------\n aux\n The auxiliary vector.\n label\n The name of the `DMLabel`.\n value\n Indicate the region.\n part\n The equation part, or 0 is unused.\n\n See Also\n --------\n petsc.DMGetLabel, petsc.DMSetAuxiliaryVec\n\n \nSource code at petsc4py/PETSc/DM.pyx:481"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_51setAuxiliaryVec(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_aux = 0; PyObject *__pyx_v_label = 0; PyObject *__pyx_v_value = 0; PyObject *__pyx_v_part = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setAuxiliaryVec (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_aux,&__pyx_n_s_label,&__pyx_n_s_value,&__pyx_n_s_part,0}; values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_0)); values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_0)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_aux)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 481, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_label)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 481, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setAuxiliaryVec", 0, 2, 4, 1); __PYX_ERR(54, 481, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 481, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_part); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 481, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setAuxiliaryVec") < 0)) __PYX_ERR(54, 481, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_aux = ((struct PyPetscVecObject *)values[0]); __pyx_v_label = values[1]; __pyx_v_value = values[2]; __pyx_v_part = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setAuxiliaryVec", 0, 2, 4, __pyx_nargs); __PYX_ERR(54, 481, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DM.setAuxiliaryVec", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_aux), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "aux", 0))) __PYX_ERR(54, 481, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_50setAuxiliaryVec(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_aux, __pyx_v_label, __pyx_v_value, __pyx_v_part); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_50setAuxiliaryVec(struct PyPetscDMObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_aux, PyObject *__pyx_v_label, PyObject *__pyx_v_value, PyObject *__pyx_v_part) { PetscInt __pyx_v_cvalue; PetscInt __pyx_v_cpart; char const *__pyx_v_cval; DMLabel __pyx_v_clbl; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setAuxiliaryVec", 0); __Pyx_INCREF(__pyx_v_label); /* "petsc4py/PETSc/DM.pyx":502 * * """ * cdef PetscInt cvalue = asInt(value) # <<<<<<<<<<<<<< * cdef PetscInt cpart = asInt(part) * cdef const char *cval = NULL */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_value); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(54, 502, __pyx_L1_error) __pyx_v_cvalue = __pyx_t_1; /* "petsc4py/PETSc/DM.pyx":503 * """ * cdef PetscInt cvalue = asInt(value) * cdef PetscInt cpart = asInt(part) # <<<<<<<<<<<<<< * cdef const char *cval = NULL * cdef PetscDMLabel clbl = NULL */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_part); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(54, 503, __pyx_L1_error) __pyx_v_cpart = __pyx_t_1; /* "petsc4py/PETSc/DM.pyx":504 * cdef PetscInt cvalue = asInt(value) * cdef PetscInt cpart = asInt(part) * cdef const char *cval = NULL # <<<<<<<<<<<<<< * cdef PetscDMLabel clbl = NULL * label = str2bytes(label, &cval) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/DM.pyx":505 * cdef PetscInt cpart = asInt(part) * cdef const char *cval = NULL * cdef PetscDMLabel clbl = NULL # <<<<<<<<<<<<<< * label = str2bytes(label, &cval) * if cval == NULL: cval = b"" # XXX Should be fixed upstream */ __pyx_v_clbl = NULL; /* "petsc4py/PETSc/DM.pyx":506 * cdef const char *cval = NULL * cdef PetscDMLabel clbl = NULL * label = str2bytes(label, &cval) # <<<<<<<<<<<<<< * if cval == NULL: cval = b"" # XXX Should be fixed upstream * CHKERR( DMGetLabel(self.dm, cval, &clbl) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_label, (&__pyx_v_cval)); if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 506, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_label, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DM.pyx":507 * cdef PetscDMLabel clbl = NULL * label = str2bytes(label, &cval) * if cval == NULL: cval = b"" # XXX Should be fixed upstream # <<<<<<<<<<<<<< * CHKERR( DMGetLabel(self.dm, cval, &clbl) ) * CHKERR( DMSetAuxiliaryVec(self.dm, clbl, cvalue, cpart, aux.vec) ) */ __pyx_t_3 = (__pyx_v_cval == NULL); if (__pyx_t_3) { __pyx_v_cval = ((char const *)""); } /* "petsc4py/PETSc/DM.pyx":508 * label = str2bytes(label, &cval) * if cval == NULL: cval = b"" # XXX Should be fixed upstream * CHKERR( DMGetLabel(self.dm, cval, &clbl) ) # <<<<<<<<<<<<<< * CHKERR( DMSetAuxiliaryVec(self.dm, clbl, cvalue, cpart, aux.vec) ) * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetLabel(__pyx_v_self->dm, __pyx_v_cval, (&__pyx_v_clbl))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 508, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":509 * if cval == NULL: cval = b"" # XXX Should be fixed upstream * CHKERR( DMGetLabel(self.dm, cval, &clbl) ) * CHKERR( DMSetAuxiliaryVec(self.dm, clbl, cvalue, cpart, aux.vec) ) # <<<<<<<<<<<<<< * * def getAuxiliaryVec(self, label: str | None = None, value: int | None = 0, part: int | None = 0) -> Vec: */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSetAuxiliaryVec(__pyx_v_self->dm, __pyx_v_clbl, __pyx_v_cvalue, __pyx_v_cpart, __pyx_v_aux->vec)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 509, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":481 * # * * def setAuxiliaryVec(self, Vec aux, label: DMLabel | None, value=0, part=0) -> None: # <<<<<<<<<<<<<< * """Set an auxiliary vector for a specific region. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DM.setAuxiliaryVec", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_label); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":511 * CHKERR( DMSetAuxiliaryVec(self.dm, clbl, cvalue, cpart, aux.vec) ) * * def getAuxiliaryVec(self, label: str | None = None, value: int | None = 0, part: int | None = 0) -> Vec: # <<<<<<<<<<<<<< * """Return an auxiliary vector for region. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_53getAuxiliaryVec(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_52getAuxiliaryVec, "DM.getAuxiliaryVec(self, label: str | None = None, value: int | None = 0, part: int | None = 0) -> Vec\nReturn an auxiliary vector for region.\n\n Not collective.\n\n Parameters\n ----------\n label\n The name of the `DMLabel`.\n value\n Indicate the region.\n part\n The equation part, or 0 is unused.\n\n See Also\n --------\n DM.getLabel, petsc.DMGetAuxiliaryVec\n\n \nSource code at petsc4py/PETSc/DM.pyx:511"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_53getAuxiliaryVec(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_label = 0; PyObject *__pyx_v_value = 0; PyObject *__pyx_v_part = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getAuxiliaryVec (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_label,&__pyx_n_s_value,&__pyx_n_s_part,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_0)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_0)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_label); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 511, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 511, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_part); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 511, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getAuxiliaryVec") < 0)) __PYX_ERR(54, 511, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_label = values[0]; __pyx_v_value = values[1]; __pyx_v_part = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getAuxiliaryVec", 0, 0, 3, __pyx_nargs); __PYX_ERR(54, 511, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DM.getAuxiliaryVec", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_52getAuxiliaryVec(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_label, __pyx_v_value, __pyx_v_part); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_52getAuxiliaryVec(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_label, PyObject *__pyx_v_value, PyObject *__pyx_v_part) { PetscInt __pyx_v_cvalue; PetscInt __pyx_v_cpart; char const *__pyx_v_cval; DMLabel __pyx_v_clbl; struct PyPetscVecObject *__pyx_v_aux = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getAuxiliaryVec", 0); __Pyx_INCREF(__pyx_v_label); /* "petsc4py/PETSc/DM.pyx":530 * * """ * cdef PetscInt cvalue = asInt(value) # <<<<<<<<<<<<<< * cdef PetscInt cpart = asInt(part) * cdef const char *cval = NULL */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_value); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(54, 530, __pyx_L1_error) __pyx_v_cvalue = __pyx_t_1; /* "petsc4py/PETSc/DM.pyx":531 * """ * cdef PetscInt cvalue = asInt(value) * cdef PetscInt cpart = asInt(part) # <<<<<<<<<<<<<< * cdef const char *cval = NULL * cdef PetscDMLabel clbl = NULL */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_part); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(54, 531, __pyx_L1_error) __pyx_v_cpart = __pyx_t_1; /* "petsc4py/PETSc/DM.pyx":532 * cdef PetscInt cvalue = asInt(value) * cdef PetscInt cpart = asInt(part) * cdef const char *cval = NULL # <<<<<<<<<<<<<< * cdef PetscDMLabel clbl = NULL * cdef Vec aux = Vec() */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/DM.pyx":533 * cdef PetscInt cpart = asInt(part) * cdef const char *cval = NULL * cdef PetscDMLabel clbl = NULL # <<<<<<<<<<<<<< * cdef Vec aux = Vec() * label = str2bytes(label, &cval) */ __pyx_v_clbl = NULL; /* "petsc4py/PETSc/DM.pyx":534 * cdef const char *cval = NULL * cdef PetscDMLabel clbl = NULL * cdef Vec aux = Vec() # <<<<<<<<<<<<<< * label = str2bytes(label, &cval) * if cval == NULL: cval = b"" # XXX Should be fixed upstream */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 534, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_aux = ((struct PyPetscVecObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DM.pyx":535 * cdef PetscDMLabel clbl = NULL * cdef Vec aux = Vec() * label = str2bytes(label, &cval) # <<<<<<<<<<<<<< * if cval == NULL: cval = b"" # XXX Should be fixed upstream * CHKERR( DMGetLabel(self.dm, cval, &clbl) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_label, (&__pyx_v_cval)); if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_label, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DM.pyx":536 * cdef Vec aux = Vec() * label = str2bytes(label, &cval) * if cval == NULL: cval = b"" # XXX Should be fixed upstream # <<<<<<<<<<<<<< * CHKERR( DMGetLabel(self.dm, cval, &clbl) ) * CHKERR( DMGetAuxiliaryVec(self.dm, clbl, cvalue, cpart, &aux.vec) ) */ __pyx_t_3 = (__pyx_v_cval == NULL); if (__pyx_t_3) { __pyx_v_cval = ((char const *)""); } /* "petsc4py/PETSc/DM.pyx":537 * label = str2bytes(label, &cval) * if cval == NULL: cval = b"" # XXX Should be fixed upstream * CHKERR( DMGetLabel(self.dm, cval, &clbl) ) # <<<<<<<<<<<<<< * CHKERR( DMGetAuxiliaryVec(self.dm, clbl, cvalue, cpart, &aux.vec) ) * return aux */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetLabel(__pyx_v_self->dm, __pyx_v_cval, (&__pyx_v_clbl))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 537, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":538 * if cval == NULL: cval = b"" # XXX Should be fixed upstream * CHKERR( DMGetLabel(self.dm, cval, &clbl) ) * CHKERR( DMGetAuxiliaryVec(self.dm, clbl, cvalue, cpart, &aux.vec) ) # <<<<<<<<<<<<<< * return aux * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetAuxiliaryVec(__pyx_v_self->dm, __pyx_v_clbl, __pyx_v_cvalue, __pyx_v_cpart, (&__pyx_v_aux->vec))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 538, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":539 * CHKERR( DMGetLabel(self.dm, cval, &clbl) ) * CHKERR( DMGetAuxiliaryVec(self.dm, clbl, cvalue, cpart, &aux.vec) ) * return aux # <<<<<<<<<<<<<< * * def setNumFields(self, numFields: int) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_aux); __pyx_r = ((PyObject *)__pyx_v_aux); goto __pyx_L0; /* "petsc4py/PETSc/DM.pyx":511 * CHKERR( DMSetAuxiliaryVec(self.dm, clbl, cvalue, cpart, aux.vec) ) * * def getAuxiliaryVec(self, label: str | None = None, value: int | None = 0, part: int | None = 0) -> Vec: # <<<<<<<<<<<<<< * """Return an auxiliary vector for region. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DM.getAuxiliaryVec", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_aux); __Pyx_XDECREF(__pyx_v_label); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":541 * return aux * * def setNumFields(self, numFields: int) -> None: # <<<<<<<<<<<<<< * """Set the number of fields in the `DM`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_55setNumFields(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_54setNumFields, "DM.setNumFields(self, numFields: int) -> None\nSet the number of fields in the `DM`.\n\n Logically collective.\n\n See Also\n --------\n petsc.DMSetNumFields\n\n \nSource code at petsc4py/PETSc/DM.pyx:541"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_55setNumFields(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_numFields = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setNumFields (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_numFields,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_numFields)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 541, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setNumFields") < 0)) __PYX_ERR(54, 541, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_numFields = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setNumFields", 1, 1, 1, __pyx_nargs); __PYX_ERR(54, 541, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DM.setNumFields", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_54setNumFields(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_numFields); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_54setNumFields(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_numFields) { PetscInt __pyx_v_cnum; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setNumFields", 1); /* "petsc4py/PETSc/DM.pyx":551 * * """ * cdef PetscInt cnum = asInt(numFields) # <<<<<<<<<<<<<< * CHKERR( DMSetNumFields(self.dm, cnum) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_numFields); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(54, 551, __pyx_L1_error) __pyx_v_cnum = __pyx_t_1; /* "petsc4py/PETSc/DM.pyx":552 * """ * cdef PetscInt cnum = asInt(numFields) * CHKERR( DMSetNumFields(self.dm, cnum) ) # <<<<<<<<<<<<<< * * def getNumFields(self) -> int: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSetNumFields(__pyx_v_self->dm, __pyx_v_cnum)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 552, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":541 * return aux * * def setNumFields(self, numFields: int) -> None: # <<<<<<<<<<<<<< * """Set the number of fields in the `DM`. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.setNumFields", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":554 * CHKERR( DMSetNumFields(self.dm, cnum) ) * * def getNumFields(self) -> int: # <<<<<<<<<<<<<< * """Return the number of fields in the `DM`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_57getNumFields(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_56getNumFields, "DM.getNumFields(self) -> int\nReturn the number of fields in the `DM`.\n\n Not collective.\n\n See Also\n --------\n petsc.DMGetNumFields\n\n \nSource code at petsc4py/PETSc/DM.pyx:554"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_57getNumFields(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getNumFields (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getNumFields", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getNumFields", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_56getNumFields(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_56getNumFields(struct PyPetscDMObject *__pyx_v_self) { PetscInt __pyx_v_cnum; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getNumFields", 1); /* "petsc4py/PETSc/DM.pyx":564 * * """ * cdef PetscInt cnum = 0 # <<<<<<<<<<<<<< * CHKERR( DMGetNumFields(self.dm, &cnum) ) * return toInt(cnum) */ __pyx_v_cnum = 0; /* "petsc4py/PETSc/DM.pyx":565 * """ * cdef PetscInt cnum = 0 * CHKERR( DMGetNumFields(self.dm, &cnum) ) # <<<<<<<<<<<<<< * return toInt(cnum) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetNumFields(__pyx_v_self->dm, (&__pyx_v_cnum))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 565, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":566 * cdef PetscInt cnum = 0 * CHKERR( DMGetNumFields(self.dm, &cnum) ) * return toInt(cnum) # <<<<<<<<<<<<<< * * def setField(self, index: int, Object field, label: str | None = None) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_cnum); if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DM.pyx":554 * CHKERR( DMSetNumFields(self.dm, cnum) ) * * def getNumFields(self) -> int: # <<<<<<<<<<<<<< * """Return the number of fields in the `DM`. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DM.getNumFields", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":568 * return toInt(cnum) * * def setField(self, index: int, Object field, label: str | None = None) -> None: # <<<<<<<<<<<<<< * """Set the discretization object for a given `DM` field. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_59setField(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_58setField, "DM.setField(self, index: int, field: Object, label: str | None = None) -> None\nSet the discretization object for a given `DM` field.\n\n Logically collective.\n\n Parameters\n ----------\n index\n The field number.\n field\n The discretization object.\n label\n The name of the label indicating the support of the field,\n or `None` for the entire mesh.\n\n See Also\n --------\n petsc.DMSetField\n\n \nSource code at petsc4py/PETSc/DM.pyx:568"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_59setField(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_index = 0; struct PyPetscObjectObject *__pyx_v_field = 0; PyObject *__pyx_v_label = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setField (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_field,&__pyx_n_s_label,0}; values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_index)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 568, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_field)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 568, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setField", 0, 2, 3, 1); __PYX_ERR(54, 568, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_label); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 568, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setField") < 0)) __PYX_ERR(54, 568, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_index = values[0]; __pyx_v_field = ((struct PyPetscObjectObject *)values[1]); __pyx_v_label = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setField", 0, 2, 3, __pyx_nargs); __PYX_ERR(54, 568, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DM.setField", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_field), __pyx_ptype_8petsc4py_5PETSc_Object, 0, "field", 0))) __PYX_ERR(54, 568, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_58setField(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_index, __pyx_v_field, __pyx_v_label); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_58setField(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_index, struct PyPetscObjectObject *__pyx_v_field, PyObject *__pyx_v_label) { PetscInt __pyx_v_cidx; PetscObject __pyx_v_cobj; DMLabel __pyx_v_clbl; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setField", 1); /* "petsc4py/PETSc/DM.pyx":588 * * """ * cdef PetscInt cidx = asInt(index) # <<<<<<<<<<<<<< * cdef PetscObject cobj = field.obj[0] * cdef PetscDMLabel clbl = NULL */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_index); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(54, 588, __pyx_L1_error) __pyx_v_cidx = __pyx_t_1; /* "petsc4py/PETSc/DM.pyx":589 * """ * cdef PetscInt cidx = asInt(index) * cdef PetscObject cobj = field.obj[0] # <<<<<<<<<<<<<< * cdef PetscDMLabel clbl = NULL * assert label is None */ __pyx_v_cobj = (__pyx_v_field->obj[0]); /* "petsc4py/PETSc/DM.pyx":590 * cdef PetscInt cidx = asInt(index) * cdef PetscObject cobj = field.obj[0] * cdef PetscDMLabel clbl = NULL # <<<<<<<<<<<<<< * assert label is None * CHKERR( DMSetField(self.dm, cidx, clbl, cobj) ) */ __pyx_v_clbl = NULL; /* "petsc4py/PETSc/DM.pyx":591 * cdef PetscObject cobj = field.obj[0] * cdef PetscDMLabel clbl = NULL * assert label is None # <<<<<<<<<<<<<< * CHKERR( DMSetField(self.dm, cidx, clbl, cobj) ) * */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_2 = (__pyx_v_label == Py_None); if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(54, 591, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(54, 591, __pyx_L1_error) #endif /* "petsc4py/PETSc/DM.pyx":592 * cdef PetscDMLabel clbl = NULL * assert label is None * CHKERR( DMSetField(self.dm, cidx, clbl, cobj) ) # <<<<<<<<<<<<<< * * def getField(self, index: int) -> tuple[Object, None]: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSetField(__pyx_v_self->dm, __pyx_v_cidx, __pyx_v_clbl, __pyx_v_cobj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 592, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":568 * return toInt(cnum) * * def setField(self, index: int, Object field, label: str | None = None) -> None: # <<<<<<<<<<<<<< * """Set the discretization object for a given `DM` field. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.setField", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":594 * CHKERR( DMSetField(self.dm, cidx, clbl, cobj) ) * * def getField(self, index: int) -> tuple[Object, None]: # <<<<<<<<<<<<<< * """Return the discretization object for a given `DM` field. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_61getField(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_60getField, "DM.getField(self, index: int) -> tuple[Object, None]\nReturn the discretization object for a given `DM` field.\n\n Not collective.\n\n Parameters\n ----------\n index\n The field number.\n\n See Also\n --------\n petsc.DMGetField\n\n \nSource code at petsc4py/PETSc/DM.pyx:594"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_61getField(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_index = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getField (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_index)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 594, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getField") < 0)) __PYX_ERR(54, 594, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_index = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getField", 1, 1, 1, __pyx_nargs); __PYX_ERR(54, 594, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DM.getField", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_60getField(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_index); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_60getField(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_index) { PetscInt __pyx_v_cidx; PetscObject __pyx_v_cobj; DMLabel __pyx_v_clbl; struct PyPetscObjectObject *__pyx_v_field = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getField", 1); /* "petsc4py/PETSc/DM.pyx":609 * * """ * cdef PetscInt cidx = asInt(index) # <<<<<<<<<<<<<< * cdef PetscObject cobj = NULL * cdef PetscDMLabel clbl = NULL */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_index); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(54, 609, __pyx_L1_error) __pyx_v_cidx = __pyx_t_1; /* "petsc4py/PETSc/DM.pyx":610 * """ * cdef PetscInt cidx = asInt(index) * cdef PetscObject cobj = NULL # <<<<<<<<<<<<<< * cdef PetscDMLabel clbl = NULL * CHKERR( DMGetField(self.dm, cidx, &clbl, &cobj) ) */ __pyx_v_cobj = NULL; /* "petsc4py/PETSc/DM.pyx":611 * cdef PetscInt cidx = asInt(index) * cdef PetscObject cobj = NULL * cdef PetscDMLabel clbl = NULL # <<<<<<<<<<<<<< * CHKERR( DMGetField(self.dm, cidx, &clbl, &cobj) ) * assert clbl == NULL */ __pyx_v_clbl = NULL; /* "petsc4py/PETSc/DM.pyx":612 * cdef PetscObject cobj = NULL * cdef PetscDMLabel clbl = NULL * CHKERR( DMGetField(self.dm, cidx, &clbl, &cobj) ) # <<<<<<<<<<<<<< * assert clbl == NULL * cdef Object field = subtype_Object(cobj)() */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetField(__pyx_v_self->dm, __pyx_v_cidx, (&__pyx_v_clbl), (&__pyx_v_cobj))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 612, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":613 * cdef PetscDMLabel clbl = NULL * CHKERR( DMGetField(self.dm, cidx, &clbl, &cobj) ) * assert clbl == NULL # <<<<<<<<<<<<<< * cdef Object field = subtype_Object(cobj)() * field.obj[0] = cobj */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_3 = (__pyx_v_clbl == NULL); if (unlikely(!__pyx_t_3)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(54, 613, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(54, 613, __pyx_L1_error) #endif /* "petsc4py/PETSc/DM.pyx":614 * CHKERR( DMGetField(self.dm, cidx, &clbl, &cobj) ) * assert clbl == NULL * cdef Object field = subtype_Object(cobj)() # <<<<<<<<<<<<<< * field.obj[0] = cobj * CHKERR( PetscINCREF(field.obj) ) */ __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_Object(__pyx_v_cobj)); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_8petsc4py_5PETSc_Object))))) __PYX_ERR(54, 614, __pyx_L1_error) __pyx_v_field = ((struct PyPetscObjectObject *)__pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/DM.pyx":615 * assert clbl == NULL * cdef Object field = subtype_Object(cobj)() * field.obj[0] = cobj # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(field.obj) ) * return (field, None) # TODO REVIEW */ (__pyx_v_field->obj[0]) = __pyx_v_cobj; /* "petsc4py/PETSc/DM.pyx":616 * cdef Object field = subtype_Object(cobj)() * field.obj[0] = cobj * CHKERR( PetscINCREF(field.obj) ) # <<<<<<<<<<<<<< * return (field, None) # TODO REVIEW * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_field->obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 616, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":617 * field.obj[0] = cobj * CHKERR( PetscINCREF(field.obj) ) * return (field, None) # TODO REVIEW # <<<<<<<<<<<<<< * * def addField(self, Object field, label: str | None = None) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF((PyObject *)__pyx_v_field); __Pyx_GIVEREF((PyObject *)__pyx_v_field); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_field))) __PYX_ERR(54, 617, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, Py_None)) __PYX_ERR(54, 617, __pyx_L1_error); __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DM.pyx":594 * CHKERR( DMSetField(self.dm, cidx, clbl, cobj) ) * * def getField(self, index: int) -> tuple[Object, None]: # <<<<<<<<<<<<<< * """Return the discretization object for a given `DM` field. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.DM.getField", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_field); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":619 * return (field, None) # TODO REVIEW * * def addField(self, Object field, label: str | None = None) -> None: # <<<<<<<<<<<<<< * """Add a field to a `DM` object. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_63addField(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_62addField, "DM.addField(self, field: Object, label: str | None = None) -> None\nAdd a field to a `DM` object.\n\n Logically collective.\n\n Parameters\n ----------\n field\n The discretization object.\n label\n The name of the label indicating the support of the field,\n or `None` for the entire mesh.\n\n See Also\n --------\n petsc.DMAddField\n\n \nSource code at petsc4py/PETSc/DM.pyx:619"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_63addField(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscObjectObject *__pyx_v_field = 0; PyObject *__pyx_v_label = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("addField (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_field,&__pyx_n_s_label,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_field)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 619, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_label); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 619, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "addField") < 0)) __PYX_ERR(54, 619, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_field = ((struct PyPetscObjectObject *)values[0]); __pyx_v_label = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("addField", 0, 1, 2, __pyx_nargs); __PYX_ERR(54, 619, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DM.addField", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_field), __pyx_ptype_8petsc4py_5PETSc_Object, 0, "field", 0))) __PYX_ERR(54, 619, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_62addField(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_field, __pyx_v_label); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_62addField(struct PyPetscDMObject *__pyx_v_self, struct PyPetscObjectObject *__pyx_v_field, PyObject *__pyx_v_label) { PetscObject __pyx_v_cobj; DMLabel __pyx_v_clbl; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("addField", 1); /* "petsc4py/PETSc/DM.pyx":637 * * """ * cdef PetscObject cobj = field.obj[0] # <<<<<<<<<<<<<< * cdef PetscDMLabel clbl = NULL * assert label is None */ __pyx_v_cobj = (__pyx_v_field->obj[0]); /* "petsc4py/PETSc/DM.pyx":638 * """ * cdef PetscObject cobj = field.obj[0] * cdef PetscDMLabel clbl = NULL # <<<<<<<<<<<<<< * assert label is None * CHKERR( DMAddField(self.dm, clbl, cobj) ) */ __pyx_v_clbl = NULL; /* "petsc4py/PETSc/DM.pyx":639 * cdef PetscObject cobj = field.obj[0] * cdef PetscDMLabel clbl = NULL * assert label is None # <<<<<<<<<<<<<< * CHKERR( DMAddField(self.dm, clbl, cobj) ) * */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_1 = (__pyx_v_label == Py_None); if (unlikely(!__pyx_t_1)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(54, 639, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(54, 639, __pyx_L1_error) #endif /* "petsc4py/PETSc/DM.pyx":640 * cdef PetscDMLabel clbl = NULL * assert label is None * CHKERR( DMAddField(self.dm, clbl, cobj) ) # <<<<<<<<<<<<<< * * def clearFields(self) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMAddField(__pyx_v_self->dm, __pyx_v_clbl, __pyx_v_cobj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 640, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":619 * return (field, None) # TODO REVIEW * * def addField(self, Object field, label: str | None = None) -> None: # <<<<<<<<<<<<<< * """Add a field to a `DM` object. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.addField", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":642 * CHKERR( DMAddField(self.dm, clbl, cobj) ) * * def clearFields(self) -> None: # <<<<<<<<<<<<<< * """Remove all fields from the `DM`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_65clearFields(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_64clearFields, "DM.clearFields(self) -> None\nRemove all fields from the `DM`.\n\n Logically collective.\n\n See Also\n --------\n petsc.DMClearFields\n\n \nSource code at petsc4py/PETSc/DM.pyx:642"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_65clearFields(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("clearFields (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("clearFields", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "clearFields", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_64clearFields(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_64clearFields(struct PyPetscDMObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("clearFields", 1); /* "petsc4py/PETSc/DM.pyx":652 * * """ * CHKERR( DMClearFields(self.dm) ) # <<<<<<<<<<<<<< * * def copyFields(self, DM dm) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMClearFields(__pyx_v_self->dm)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 652, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":642 * CHKERR( DMAddField(self.dm, clbl, cobj) ) * * def clearFields(self) -> None: # <<<<<<<<<<<<<< * """Remove all fields from the `DM`. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.clearFields", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":654 * CHKERR( DMClearFields(self.dm) ) * * def copyFields(self, DM dm) -> None: # <<<<<<<<<<<<<< * """Copy the discretizations of this `DM` into another `DM`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_67copyFields(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_66copyFields, "DM.copyFields(self, dm: DM) -> None\nCopy the discretizations of this `DM` into another `DM`.\n\n Collective.\n\n Parameters\n ----------\n dm\n The `DM` that the fields are copied into.\n\n See Also\n --------\n petsc.DMCopyFields\n\n \nSource code at petsc4py/PETSc/DM.pyx:654"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_67copyFields(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscDMObject *__pyx_v_dm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("copyFields (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dm,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dm)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 654, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "copyFields") < 0)) __PYX_ERR(54, 654, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_dm = ((struct PyPetscDMObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("copyFields", 1, 1, 1, __pyx_nargs); __PYX_ERR(54, 654, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DM.copyFields", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_ptype_8petsc4py_5PETSc_DM, 0, "dm", 0))) __PYX_ERR(54, 654, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_66copyFields(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_dm); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_66copyFields(struct PyPetscDMObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("copyFields", 1); /* "petsc4py/PETSc/DM.pyx":669 * * """ * CHKERR( DMCopyFields(self.dm, dm.dm) ) # <<<<<<<<<<<<<< * * def createDS(self) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCopyFields(__pyx_v_self->dm, __pyx_v_dm->dm)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 669, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":654 * CHKERR( DMClearFields(self.dm) ) * * def copyFields(self, DM dm) -> None: # <<<<<<<<<<<<<< * """Copy the discretizations of this `DM` into another `DM`. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.copyFields", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":671 * CHKERR( DMCopyFields(self.dm, dm.dm) ) * * def createDS(self) -> None: # <<<<<<<<<<<<<< * """Create discrete systems. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_69createDS(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_68createDS, "DM.createDS(self) -> None\nCreate discrete systems.\n\n Collective.\n\n See Also\n --------\n petsc.DMCreateDS\n\n \nSource code at petsc4py/PETSc/DM.pyx:671"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_69createDS(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createDS (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("createDS", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "createDS", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_68createDS(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_68createDS(struct PyPetscDMObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createDS", 1); /* "petsc4py/PETSc/DM.pyx":681 * * """ * CHKERR( DMCreateDS(self.dm) ) # <<<<<<<<<<<<<< * * def clearDS(self) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCreateDS(__pyx_v_self->dm)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 681, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":671 * CHKERR( DMCopyFields(self.dm, dm.dm) ) * * def createDS(self) -> None: # <<<<<<<<<<<<<< * """Create discrete systems. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.createDS", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":683 * CHKERR( DMCreateDS(self.dm) ) * * def clearDS(self) -> None: # <<<<<<<<<<<<<< * """Remove all discrete systems from the `DM`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_71clearDS(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_70clearDS, "DM.clearDS(self) -> None\nRemove all discrete systems from the `DM`.\n\n Logically collective.\n\n See Also\n --------\n petsc.DMClearDS\n\n \nSource code at petsc4py/PETSc/DM.pyx:683"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_71clearDS(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("clearDS (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("clearDS", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "clearDS", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_70clearDS(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_70clearDS(struct PyPetscDMObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("clearDS", 1); /* "petsc4py/PETSc/DM.pyx":693 * * """ * CHKERR( DMClearDS(self.dm) ) # <<<<<<<<<<<<<< * * def getDS(self) -> DS: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMClearDS(__pyx_v_self->dm)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 693, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":683 * CHKERR( DMCreateDS(self.dm) ) * * def clearDS(self) -> None: # <<<<<<<<<<<<<< * """Remove all discrete systems from the `DM`. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.clearDS", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":695 * CHKERR( DMClearDS(self.dm) ) * * def getDS(self) -> DS: # <<<<<<<<<<<<<< * """Return default `DS`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_73getDS(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_72getDS, "DM.getDS(self) -> DS\nReturn default `DS`.\n\n Not collective.\n\n See Also\n --------\n petsc.DMGetDS\n\n \nSource code at petsc4py/PETSc/DM.pyx:695"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_73getDS(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getDS (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getDS", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getDS", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_72getDS(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_72getDS(struct PyPetscDMObject *__pyx_v_self) { struct PyPetscDSObject *__pyx_v_ds = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getDS", 1); /* "petsc4py/PETSc/DM.pyx":705 * * """ * cdef DS ds = DS() # <<<<<<<<<<<<<< * CHKERR( DMGetDS(self.dm, &ds.ds) ) * CHKERR( PetscINCREF(ds.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DS)); if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 705, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ds = ((struct PyPetscDSObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DM.pyx":706 * """ * cdef DS ds = DS() * CHKERR( DMGetDS(self.dm, &ds.ds) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(ds.obj) ) * return ds */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetDS(__pyx_v_self->dm, (&__pyx_v_ds->ds))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 706, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":707 * cdef DS ds = DS() * CHKERR( DMGetDS(self.dm, &ds.ds) ) * CHKERR( PetscINCREF(ds.obj) ) # <<<<<<<<<<<<<< * return ds * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ds->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 707, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":708 * CHKERR( DMGetDS(self.dm, &ds.ds) ) * CHKERR( PetscINCREF(ds.obj) ) * return ds # <<<<<<<<<<<<<< * * def copyDS(self, DM dm) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_ds); __pyx_r = ((PyObject *)__pyx_v_ds); goto __pyx_L0; /* "petsc4py/PETSc/DM.pyx":695 * CHKERR( DMClearDS(self.dm) ) * * def getDS(self) -> DS: # <<<<<<<<<<<<<< * """Return default `DS`. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DM.getDS", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ds); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":710 * return ds * * def copyDS(self, DM dm) -> None: # <<<<<<<<<<<<<< * """Copy the discrete systems for this `DM` into another `DM`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_75copyDS(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_74copyDS, "DM.copyDS(self, dm: DM) -> None\nCopy the discrete systems for this `DM` into another `DM`.\n\n Collective.\n\n Parameters\n ----------\n dm\n The `DM` that the discrete fields are copied into.\n\n See Also\n --------\n petsc.DMCopyDS\n\n \nSource code at petsc4py/PETSc/DM.pyx:710"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_75copyDS(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscDMObject *__pyx_v_dm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("copyDS (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dm,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dm)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 710, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "copyDS") < 0)) __PYX_ERR(54, 710, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_dm = ((struct PyPetscDMObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("copyDS", 1, 1, 1, __pyx_nargs); __PYX_ERR(54, 710, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DM.copyDS", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_ptype_8petsc4py_5PETSc_DM, 0, "dm", 0))) __PYX_ERR(54, 710, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_74copyDS(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_dm); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_74copyDS(struct PyPetscDMObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("copyDS", 1); /* "petsc4py/PETSc/DM.pyx":725 * * """ * CHKERR( DMCopyDS(self.dm, dm.dm) ) # <<<<<<<<<<<<<< * * def copyDisc(self, DM dm) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCopyDS(__pyx_v_self->dm, __pyx_v_dm->dm)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 725, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":710 * return ds * * def copyDS(self, DM dm) -> None: # <<<<<<<<<<<<<< * """Copy the discrete systems for this `DM` into another `DM`. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.copyDS", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":727 * CHKERR( DMCopyDS(self.dm, dm.dm) ) * * def copyDisc(self, DM dm) -> None: # <<<<<<<<<<<<<< * """Copy fields and discrete systems of a `DM` into another `DM`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_77copyDisc(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_76copyDisc, "DM.copyDisc(self, dm: DM) -> None\nCopy fields and discrete systems of a `DM` into another `DM`.\n\n Collective.\n\n Parameters\n ----------\n dm\n The `DM` that the fields and discrete systems are copied into.\n\n See Also\n --------\n petsc.DMCopyDisc\n\n \nSource code at petsc4py/PETSc/DM.pyx:727"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_77copyDisc(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscDMObject *__pyx_v_dm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("copyDisc (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dm,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dm)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 727, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "copyDisc") < 0)) __PYX_ERR(54, 727, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_dm = ((struct PyPetscDMObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("copyDisc", 1, 1, 1, __pyx_nargs); __PYX_ERR(54, 727, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DM.copyDisc", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_ptype_8petsc4py_5PETSc_DM, 0, "dm", 0))) __PYX_ERR(54, 727, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_76copyDisc(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_dm); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_76copyDisc(struct PyPetscDMObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("copyDisc", 1); /* "petsc4py/PETSc/DM.pyx":742 * * """ * CHKERR( DMCopyDisc(self.dm, dm.dm) ) # <<<<<<<<<<<<<< * * # */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCopyDisc(__pyx_v_self->dm, __pyx_v_dm->dm)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 742, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":727 * CHKERR( DMCopyDS(self.dm, dm.dm) ) * * def copyDisc(self, DM dm) -> None: # <<<<<<<<<<<<<< * """Copy fields and discrete systems of a `DM` into another `DM`. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.copyDisc", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":746 * # * * def getBlockSize(self) -> int: # <<<<<<<<<<<<<< * """Return the inherent block size associated with a `DM`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_79getBlockSize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_78getBlockSize, "DM.getBlockSize(self) -> int\nReturn the inherent block size associated with a `DM`.\n\n Not collective.\n\n See Also\n --------\n petsc.DMGetBlockSize\n\n \nSource code at petsc4py/PETSc/DM.pyx:746"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_79getBlockSize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getBlockSize (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getBlockSize", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getBlockSize", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_78getBlockSize(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_78getBlockSize(struct PyPetscDMObject *__pyx_v_self) { PetscInt __pyx_v_bs; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getBlockSize", 1); /* "petsc4py/PETSc/DM.pyx":756 * * """ * cdef PetscInt bs = 1 # <<<<<<<<<<<<<< * CHKERR( DMGetBlockSize(self.dm, &bs) ) * return toInt(bs) */ __pyx_v_bs = 1; /* "petsc4py/PETSc/DM.pyx":757 * """ * cdef PetscInt bs = 1 * CHKERR( DMGetBlockSize(self.dm, &bs) ) # <<<<<<<<<<<<<< * return toInt(bs) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetBlockSize(__pyx_v_self->dm, (&__pyx_v_bs))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 757, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":758 * cdef PetscInt bs = 1 * CHKERR( DMGetBlockSize(self.dm, &bs) ) * return toInt(bs) # <<<<<<<<<<<<<< * * def setVecType(self, vec_type: Vec.Type | str) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_bs); if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 758, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DM.pyx":746 * # * * def getBlockSize(self) -> int: # <<<<<<<<<<<<<< * """Return the inherent block size associated with a `DM`. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DM.getBlockSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":760 * return toInt(bs) * * def setVecType(self, vec_type: Vec.Type | str) -> None: # <<<<<<<<<<<<<< * """Set the type of vector. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_81setVecType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_80setVecType, "DM.setVecType(self, vec_type: Vec.Type | str) -> None\nSet the type of vector.\n\n Logically collective.\n\n See Also\n --------\n Vec.Type, petsc.DMSetVecType\n\n \nSource code at petsc4py/PETSc/DM.pyx:760"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_81setVecType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_vec_type = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setVecType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec_type,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vec_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 760, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setVecType") < 0)) __PYX_ERR(54, 760, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_vec_type = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setVecType", 1, 1, 1, __pyx_nargs); __PYX_ERR(54, 760, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DM.setVecType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_80setVecType(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_vec_type); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_80setVecType(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_vec_type) { VecType __pyx_v_vtype; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setVecType", 0); __Pyx_INCREF(__pyx_v_vec_type); /* "petsc4py/PETSc/DM.pyx":770 * * """ * cdef PetscVecType vtype = NULL # <<<<<<<<<<<<<< * vec_type = str2bytes(vec_type, &vtype) * CHKERR( DMSetVecType(self.dm, vtype) ) */ __pyx_v_vtype = NULL; /* "petsc4py/PETSc/DM.pyx":771 * """ * cdef PetscVecType vtype = NULL * vec_type = str2bytes(vec_type, &vtype) # <<<<<<<<<<<<<< * CHKERR( DMSetVecType(self.dm, vtype) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_vec_type, (&__pyx_v_vtype)); if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 771, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_vec_type, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DM.pyx":772 * cdef PetscVecType vtype = NULL * vec_type = str2bytes(vec_type, &vtype) * CHKERR( DMSetVecType(self.dm, vtype) ) # <<<<<<<<<<<<<< * * def createGlobalVec(self) -> Vec: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSetVecType(__pyx_v_self->dm, __pyx_v_vtype)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 772, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":760 * return toInt(bs) * * def setVecType(self, vec_type: Vec.Type | str) -> None: # <<<<<<<<<<<<<< * """Set the type of vector. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DM.setVecType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_vec_type); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":774 * CHKERR( DMSetVecType(self.dm, vtype) ) * * def createGlobalVec(self) -> Vec: # <<<<<<<<<<<<<< * """Return a global vector. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_83createGlobalVec(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_82createGlobalVec, "DM.createGlobalVec(self) -> Vec\nReturn a global vector.\n\n Collective.\n\n See Also\n --------\n petsc.DMCreateGlobalVector\n\n \nSource code at petsc4py/PETSc/DM.pyx:774"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_83createGlobalVec(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createGlobalVec (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("createGlobalVec", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "createGlobalVec", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_82createGlobalVec(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_82createGlobalVec(struct PyPetscDMObject *__pyx_v_self) { struct PyPetscVecObject *__pyx_v_vg = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createGlobalVec", 1); /* "petsc4py/PETSc/DM.pyx":784 * * """ * cdef Vec vg = Vec() # <<<<<<<<<<<<<< * CHKERR( DMCreateGlobalVector(self.dm, &vg.vec) ) * return vg */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 784, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_vg = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DM.pyx":785 * """ * cdef Vec vg = Vec() * CHKERR( DMCreateGlobalVector(self.dm, &vg.vec) ) # <<<<<<<<<<<<<< * return vg * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCreateGlobalVector(__pyx_v_self->dm, (&__pyx_v_vg->vec))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 785, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":786 * cdef Vec vg = Vec() * CHKERR( DMCreateGlobalVector(self.dm, &vg.vec) ) * return vg # <<<<<<<<<<<<<< * * def createLocalVec(self) -> Vec: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_vg); __pyx_r = ((PyObject *)__pyx_v_vg); goto __pyx_L0; /* "petsc4py/PETSc/DM.pyx":774 * CHKERR( DMSetVecType(self.dm, vtype) ) * * def createGlobalVec(self) -> Vec: # <<<<<<<<<<<<<< * """Return a global vector. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DM.createGlobalVec", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_vg); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":788 * return vg * * def createLocalVec(self) -> Vec: # <<<<<<<<<<<<<< * """Return a local vector. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_85createLocalVec(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_84createLocalVec, "DM.createLocalVec(self) -> Vec\nReturn a local vector.\n\n Not collective.\n\n See Also\n --------\n petsc.DMCreateLocalVector\n\n \nSource code at petsc4py/PETSc/DM.pyx:788"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_85createLocalVec(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createLocalVec (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("createLocalVec", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "createLocalVec", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_84createLocalVec(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_84createLocalVec(struct PyPetscDMObject *__pyx_v_self) { struct PyPetscVecObject *__pyx_v_vl = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createLocalVec", 1); /* "petsc4py/PETSc/DM.pyx":798 * * """ * cdef Vec vl = Vec() # <<<<<<<<<<<<<< * CHKERR( DMCreateLocalVector(self.dm, &vl.vec) ) * return vl */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 798, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_vl = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DM.pyx":799 * """ * cdef Vec vl = Vec() * CHKERR( DMCreateLocalVector(self.dm, &vl.vec) ) # <<<<<<<<<<<<<< * return vl * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCreateLocalVector(__pyx_v_self->dm, (&__pyx_v_vl->vec))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 799, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":800 * cdef Vec vl = Vec() * CHKERR( DMCreateLocalVector(self.dm, &vl.vec) ) * return vl # <<<<<<<<<<<<<< * * def getGlobalVec(self) -> Vec: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_vl); __pyx_r = ((PyObject *)__pyx_v_vl); goto __pyx_L0; /* "petsc4py/PETSc/DM.pyx":788 * return vg * * def createLocalVec(self) -> Vec: # <<<<<<<<<<<<<< * """Return a local vector. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DM.createLocalVec", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_vl); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":802 * return vl * * def getGlobalVec(self) -> Vec: # <<<<<<<<<<<<<< * """Return a global vector. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_87getGlobalVec(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_86getGlobalVec, "DM.getGlobalVec(self) -> Vec\nReturn a global vector.\n\n Collective.\n\n See Also\n --------\n petsc.DMGetGlobalVector\n\n \nSource code at petsc4py/PETSc/DM.pyx:802"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_87getGlobalVec(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getGlobalVec (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getGlobalVec", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getGlobalVec", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_86getGlobalVec(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_86getGlobalVec(struct PyPetscDMObject *__pyx_v_self) { struct PyPetscVecObject *__pyx_v_vg = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getGlobalVec", 1); /* "petsc4py/PETSc/DM.pyx":812 * * """ * cdef Vec vg = Vec() # <<<<<<<<<<<<<< * CHKERR( DMGetGlobalVector(self.dm, &vg.vec) ) * CHKERR( PetscINCREF(vg.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 812, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_vg = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DM.pyx":813 * """ * cdef Vec vg = Vec() * CHKERR( DMGetGlobalVector(self.dm, &vg.vec) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(vg.obj) ) * return vg */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetGlobalVector(__pyx_v_self->dm, (&__pyx_v_vg->vec))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 813, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":814 * cdef Vec vg = Vec() * CHKERR( DMGetGlobalVector(self.dm, &vg.vec) ) * CHKERR( PetscINCREF(vg.obj) ) # <<<<<<<<<<<<<< * return vg * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_vg->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 814, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":815 * CHKERR( DMGetGlobalVector(self.dm, &vg.vec) ) * CHKERR( PetscINCREF(vg.obj) ) * return vg # <<<<<<<<<<<<<< * * def restoreGlobalVec(self, Vec vg) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_vg); __pyx_r = ((PyObject *)__pyx_v_vg); goto __pyx_L0; /* "petsc4py/PETSc/DM.pyx":802 * return vl * * def getGlobalVec(self) -> Vec: # <<<<<<<<<<<<<< * """Return a global vector. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DM.getGlobalVec", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_vg); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":817 * return vg * * def restoreGlobalVec(self, Vec vg) -> None: # <<<<<<<<<<<<<< * """Restore a global vector. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_89restoreGlobalVec(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_88restoreGlobalVec, "DM.restoreGlobalVec(self, vg: Vec) -> None\nRestore a global vector.\n\n Not collective.\n\n Parameters\n ----------\n vg\n The global vector.\n\n See Also\n --------\n petsc.DMRestoreGlobalVector\n\n \nSource code at petsc4py/PETSc/DM.pyx:817"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_89restoreGlobalVec(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_vg = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("restoreGlobalVec (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vg,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vg)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 817, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "restoreGlobalVec") < 0)) __PYX_ERR(54, 817, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_vg = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("restoreGlobalVec", 1, 1, 1, __pyx_nargs); __PYX_ERR(54, 817, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DM.restoreGlobalVec", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vg), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vg", 0))) __PYX_ERR(54, 817, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_88restoreGlobalVec(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_vg); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_88restoreGlobalVec(struct PyPetscDMObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vg) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("restoreGlobalVec", 1); /* "petsc4py/PETSc/DM.pyx":832 * * """ * CHKERR( PetscObjectDereference(vg.vec) ) # <<<<<<<<<<<<<< * CHKERR( DMRestoreGlobalVector(self.dm, &vg.vec) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectDereference(((PetscObject)__pyx_v_vg->vec))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 832, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":833 * """ * CHKERR( PetscObjectDereference(vg.vec) ) * CHKERR( DMRestoreGlobalVector(self.dm, &vg.vec) ) # <<<<<<<<<<<<<< * * def getLocalVec(self) -> Vec: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMRestoreGlobalVector(__pyx_v_self->dm, (&__pyx_v_vg->vec))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 833, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":817 * return vg * * def restoreGlobalVec(self, Vec vg) -> None: # <<<<<<<<<<<<<< * """Restore a global vector. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.restoreGlobalVec", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":835 * CHKERR( DMRestoreGlobalVector(self.dm, &vg.vec) ) * * def getLocalVec(self) -> Vec: # <<<<<<<<<<<<<< * """Return a local vector. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_91getLocalVec(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_90getLocalVec, "DM.getLocalVec(self) -> Vec\nReturn a local vector.\n\n Not collective.\n\n See Also\n --------\n petsc.DMGetLocalVector\n\n \nSource code at petsc4py/PETSc/DM.pyx:835"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_91getLocalVec(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getLocalVec (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getLocalVec", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getLocalVec", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_90getLocalVec(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_90getLocalVec(struct PyPetscDMObject *__pyx_v_self) { struct PyPetscVecObject *__pyx_v_vl = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getLocalVec", 1); /* "petsc4py/PETSc/DM.pyx":845 * * """ * cdef Vec vl = Vec() # <<<<<<<<<<<<<< * CHKERR( DMGetLocalVector(self.dm, &vl.vec) ) * CHKERR( PetscINCREF(vl.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 845, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_vl = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DM.pyx":846 * """ * cdef Vec vl = Vec() * CHKERR( DMGetLocalVector(self.dm, &vl.vec) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(vl.obj) ) * return vl */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetLocalVector(__pyx_v_self->dm, (&__pyx_v_vl->vec))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 846, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":847 * cdef Vec vl = Vec() * CHKERR( DMGetLocalVector(self.dm, &vl.vec) ) * CHKERR( PetscINCREF(vl.obj) ) # <<<<<<<<<<<<<< * return vl * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_vl->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 847, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":848 * CHKERR( DMGetLocalVector(self.dm, &vl.vec) ) * CHKERR( PetscINCREF(vl.obj) ) * return vl # <<<<<<<<<<<<<< * * def restoreLocalVec(self, Vec vl) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_vl); __pyx_r = ((PyObject *)__pyx_v_vl); goto __pyx_L0; /* "petsc4py/PETSc/DM.pyx":835 * CHKERR( DMRestoreGlobalVector(self.dm, &vg.vec) ) * * def getLocalVec(self) -> Vec: # <<<<<<<<<<<<<< * """Return a local vector. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DM.getLocalVec", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_vl); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":850 * return vl * * def restoreLocalVec(self, Vec vl) -> None: # <<<<<<<<<<<<<< * """Restore a local vector. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_93restoreLocalVec(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_92restoreLocalVec, "DM.restoreLocalVec(self, vl: Vec) -> None\nRestore a local vector.\n\n Not collective.\n\n Parameters\n ----------\n vl\n The local vector.\n\n See Also\n --------\n petsc.DMRestoreLocalVector\n\n \nSource code at petsc4py/PETSc/DM.pyx:850"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_93restoreLocalVec(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_vl = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("restoreLocalVec (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vl,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vl)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 850, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "restoreLocalVec") < 0)) __PYX_ERR(54, 850, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_vl = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("restoreLocalVec", 1, 1, 1, __pyx_nargs); __PYX_ERR(54, 850, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DM.restoreLocalVec", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vl), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vl", 0))) __PYX_ERR(54, 850, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_92restoreLocalVec(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_vl); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_92restoreLocalVec(struct PyPetscDMObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vl) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("restoreLocalVec", 1); /* "petsc4py/PETSc/DM.pyx":865 * * """ * CHKERR( PetscObjectDereference(vl.vec) ) # <<<<<<<<<<<<<< * CHKERR( DMRestoreLocalVector(self.dm, &vl.vec) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectDereference(((PetscObject)__pyx_v_vl->vec))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 865, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":866 * """ * CHKERR( PetscObjectDereference(vl.vec) ) * CHKERR( DMRestoreLocalVector(self.dm, &vl.vec) ) # <<<<<<<<<<<<<< * * def globalToLocal(self, Vec vg, Vec vl, addv: InsertModeSpec | None = None) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMRestoreLocalVector(__pyx_v_self->dm, (&__pyx_v_vl->vec))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 866, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":850 * return vl * * def restoreLocalVec(self, Vec vl) -> None: # <<<<<<<<<<<<<< * """Restore a local vector. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.restoreLocalVec", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":868 * CHKERR( DMRestoreLocalVector(self.dm, &vl.vec) ) * * def globalToLocal(self, Vec vg, Vec vl, addv: InsertModeSpec | None = None) -> None: # <<<<<<<<<<<<<< * """Update local vectors from global vector. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_95globalToLocal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_94globalToLocal, "DM.globalToLocal(self, vg: Vec, vl: Vec, addv: InsertModeSpec | None = None) -> None\nUpdate local vectors from global vector.\n\n Neighborwise collective.\n\n Parameters\n ----------\n vg\n The global vector.\n vl\n The local vector.\n addv\n Insertion mode.\n\n See Also\n --------\n petsc.DMGlobalToLocalBegin, petsc.DMGlobalToLocalEnd\n\n \nSource code at petsc4py/PETSc/DM.pyx:868"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_95globalToLocal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_vg = 0; struct PyPetscVecObject *__pyx_v_vl = 0; PyObject *__pyx_v_addv = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("globalToLocal (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vg,&__pyx_n_s_vl,&__pyx_n_s_addv,0}; values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vg)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 868, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vl)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 868, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("globalToLocal", 0, 2, 3, 1); __PYX_ERR(54, 868, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_addv); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 868, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "globalToLocal") < 0)) __PYX_ERR(54, 868, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_vg = ((struct PyPetscVecObject *)values[0]); __pyx_v_vl = ((struct PyPetscVecObject *)values[1]); __pyx_v_addv = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("globalToLocal", 0, 2, 3, __pyx_nargs); __PYX_ERR(54, 868, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DM.globalToLocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vg), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vg", 0))) __PYX_ERR(54, 868, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vl), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vl", 0))) __PYX_ERR(54, 868, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_94globalToLocal(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_vg, __pyx_v_vl, __pyx_v_addv); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_94globalToLocal(struct PyPetscDMObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vg, struct PyPetscVecObject *__pyx_v_vl, PyObject *__pyx_v_addv) { InsertMode __pyx_v_im; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations InsertMode __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("globalToLocal", 1); /* "petsc4py/PETSc/DM.pyx":887 * * """ * cdef PetscInsertMode im = insertmode(addv) # <<<<<<<<<<<<<< * CHKERR( DMGlobalToLocalBegin(self.dm, vg.vec, im, vl.vec) ) * CHKERR( DMGlobalToLocalEnd (self.dm, vg.vec, im, vl.vec) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_insertmode(__pyx_v_addv); if (unlikely(__pyx_t_1 == ((InsertMode)((InsertMode)-1L)))) __PYX_ERR(54, 887, __pyx_L1_error) __pyx_v_im = __pyx_t_1; /* "petsc4py/PETSc/DM.pyx":888 * """ * cdef PetscInsertMode im = insertmode(addv) * CHKERR( DMGlobalToLocalBegin(self.dm, vg.vec, im, vl.vec) ) # <<<<<<<<<<<<<< * CHKERR( DMGlobalToLocalEnd (self.dm, vg.vec, im, vl.vec) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGlobalToLocalBegin(__pyx_v_self->dm, __pyx_v_vg->vec, __pyx_v_im, __pyx_v_vl->vec)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 888, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":889 * cdef PetscInsertMode im = insertmode(addv) * CHKERR( DMGlobalToLocalBegin(self.dm, vg.vec, im, vl.vec) ) * CHKERR( DMGlobalToLocalEnd (self.dm, vg.vec, im, vl.vec) ) # <<<<<<<<<<<<<< * * def localToGlobal(self, Vec vl, Vec vg, addv: InsertModeSpec | None = None) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGlobalToLocalEnd(__pyx_v_self->dm, __pyx_v_vg->vec, __pyx_v_im, __pyx_v_vl->vec)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 889, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":868 * CHKERR( DMRestoreLocalVector(self.dm, &vl.vec) ) * * def globalToLocal(self, Vec vg, Vec vl, addv: InsertModeSpec | None = None) -> None: # <<<<<<<<<<<<<< * """Update local vectors from global vector. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.globalToLocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":891 * CHKERR( DMGlobalToLocalEnd (self.dm, vg.vec, im, vl.vec) ) * * def localToGlobal(self, Vec vl, Vec vg, addv: InsertModeSpec | None = None) -> None: # <<<<<<<<<<<<<< * """Update global vectors from local vector. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_97localToGlobal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_96localToGlobal, "DM.localToGlobal(self, vl: Vec, vg: Vec, addv: InsertModeSpec | None = None) -> None\nUpdate global vectors from local vector.\n\n Neighborwise collective.\n\n Parameters\n ----------\n vl\n The local vector.\n vg\n The global vector.\n addv\n Insertion mode.\n\n See Also\n --------\n petsc.DMLocalToGlobalBegin, petsc.DMLocalToGlobalEnd\n\n \nSource code at petsc4py/PETSc/DM.pyx:891"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_97localToGlobal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_vl = 0; struct PyPetscVecObject *__pyx_v_vg = 0; PyObject *__pyx_v_addv = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("localToGlobal (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vl,&__pyx_n_s_vg,&__pyx_n_s_addv,0}; values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vl)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 891, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vg)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 891, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("localToGlobal", 0, 2, 3, 1); __PYX_ERR(54, 891, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_addv); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 891, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "localToGlobal") < 0)) __PYX_ERR(54, 891, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_vl = ((struct PyPetscVecObject *)values[0]); __pyx_v_vg = ((struct PyPetscVecObject *)values[1]); __pyx_v_addv = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("localToGlobal", 0, 2, 3, __pyx_nargs); __PYX_ERR(54, 891, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DM.localToGlobal", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vl), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vl", 0))) __PYX_ERR(54, 891, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vg), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vg", 0))) __PYX_ERR(54, 891, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_96localToGlobal(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_vl, __pyx_v_vg, __pyx_v_addv); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_96localToGlobal(struct PyPetscDMObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vl, struct PyPetscVecObject *__pyx_v_vg, PyObject *__pyx_v_addv) { InsertMode __pyx_v_im; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations InsertMode __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("localToGlobal", 1); /* "petsc4py/PETSc/DM.pyx":910 * * """ * cdef PetscInsertMode im = insertmode(addv) # <<<<<<<<<<<<<< * CHKERR( DMLocalToGlobalBegin(self.dm, vl.vec, im, vg.vec) ) * CHKERR( DMLocalToGlobalEnd(self.dm, vl.vec, im, vg.vec) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_insertmode(__pyx_v_addv); if (unlikely(__pyx_t_1 == ((InsertMode)((InsertMode)-1L)))) __PYX_ERR(54, 910, __pyx_L1_error) __pyx_v_im = __pyx_t_1; /* "petsc4py/PETSc/DM.pyx":911 * """ * cdef PetscInsertMode im = insertmode(addv) * CHKERR( DMLocalToGlobalBegin(self.dm, vl.vec, im, vg.vec) ) # <<<<<<<<<<<<<< * CHKERR( DMLocalToGlobalEnd(self.dm, vl.vec, im, vg.vec) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMLocalToGlobalBegin(__pyx_v_self->dm, __pyx_v_vl->vec, __pyx_v_im, __pyx_v_vg->vec)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 911, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":912 * cdef PetscInsertMode im = insertmode(addv) * CHKERR( DMLocalToGlobalBegin(self.dm, vl.vec, im, vg.vec) ) * CHKERR( DMLocalToGlobalEnd(self.dm, vl.vec, im, vg.vec) ) # <<<<<<<<<<<<<< * * def localToLocal(self, Vec vl, Vec vlg, addv: InsertModeSpec | None = None) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMLocalToGlobalEnd(__pyx_v_self->dm, __pyx_v_vl->vec, __pyx_v_im, __pyx_v_vg->vec)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 912, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":891 * CHKERR( DMGlobalToLocalEnd (self.dm, vg.vec, im, vl.vec) ) * * def localToGlobal(self, Vec vl, Vec vg, addv: InsertModeSpec | None = None) -> None: # <<<<<<<<<<<<<< * """Update global vectors from local vector. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.localToGlobal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":914 * CHKERR( DMLocalToGlobalEnd(self.dm, vl.vec, im, vg.vec) ) * * def localToLocal(self, Vec vl, Vec vlg, addv: InsertModeSpec | None = None) -> None: # <<<<<<<<<<<<<< * """Map the values from a local vector to another local vector. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_99localToLocal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_98localToLocal, "DM.localToLocal(self, vl: Vec, vlg: Vec, addv: InsertModeSpec | None = None) -> None\nMap the values from a local vector to another local vector.\n\n Neighborwise collective.\n\n Parameters\n ----------\n vl\n The local vector.\n vlg\n The global vector.\n addv\n Insertion mode.\n\n See Also\n --------\n petsc.DMLocalToLocalBegin, petsc.DMLocalToLocalEnd\n\n \nSource code at petsc4py/PETSc/DM.pyx:914"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_99localToLocal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_vl = 0; struct PyPetscVecObject *__pyx_v_vlg = 0; PyObject *__pyx_v_addv = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("localToLocal (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vl,&__pyx_n_s_vlg,&__pyx_n_s_addv,0}; values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vl)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 914, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vlg)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 914, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("localToLocal", 0, 2, 3, 1); __PYX_ERR(54, 914, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_addv); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 914, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "localToLocal") < 0)) __PYX_ERR(54, 914, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_vl = ((struct PyPetscVecObject *)values[0]); __pyx_v_vlg = ((struct PyPetscVecObject *)values[1]); __pyx_v_addv = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("localToLocal", 0, 2, 3, __pyx_nargs); __PYX_ERR(54, 914, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DM.localToLocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vl), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vl", 0))) __PYX_ERR(54, 914, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vlg), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vlg", 0))) __PYX_ERR(54, 914, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_98localToLocal(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_vl, __pyx_v_vlg, __pyx_v_addv); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_98localToLocal(struct PyPetscDMObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vl, struct PyPetscVecObject *__pyx_v_vlg, PyObject *__pyx_v_addv) { InsertMode __pyx_v_im; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations InsertMode __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("localToLocal", 1); /* "petsc4py/PETSc/DM.pyx":933 * * """ * cdef PetscInsertMode im = insertmode(addv) # <<<<<<<<<<<<<< * CHKERR( DMLocalToLocalBegin(self.dm, vl.vec, im, vlg.vec) ) * CHKERR( DMLocalToLocalEnd (self.dm, vl.vec, im, vlg.vec) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_insertmode(__pyx_v_addv); if (unlikely(__pyx_t_1 == ((InsertMode)((InsertMode)-1L)))) __PYX_ERR(54, 933, __pyx_L1_error) __pyx_v_im = __pyx_t_1; /* "petsc4py/PETSc/DM.pyx":934 * """ * cdef PetscInsertMode im = insertmode(addv) * CHKERR( DMLocalToLocalBegin(self.dm, vl.vec, im, vlg.vec) ) # <<<<<<<<<<<<<< * CHKERR( DMLocalToLocalEnd (self.dm, vl.vec, im, vlg.vec) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMLocalToLocalBegin(__pyx_v_self->dm, __pyx_v_vl->vec, __pyx_v_im, __pyx_v_vlg->vec)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 934, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":935 * cdef PetscInsertMode im = insertmode(addv) * CHKERR( DMLocalToLocalBegin(self.dm, vl.vec, im, vlg.vec) ) * CHKERR( DMLocalToLocalEnd (self.dm, vl.vec, im, vlg.vec) ) # <<<<<<<<<<<<<< * * def getLGMap(self) -> LGMap: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMLocalToLocalEnd(__pyx_v_self->dm, __pyx_v_vl->vec, __pyx_v_im, __pyx_v_vlg->vec)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 935, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":914 * CHKERR( DMLocalToGlobalEnd(self.dm, vl.vec, im, vg.vec) ) * * def localToLocal(self, Vec vl, Vec vlg, addv: InsertModeSpec | None = None) -> None: # <<<<<<<<<<<<<< * """Map the values from a local vector to another local vector. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.localToLocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":937 * CHKERR( DMLocalToLocalEnd (self.dm, vl.vec, im, vlg.vec) ) * * def getLGMap(self) -> LGMap: # <<<<<<<<<<<<<< * """Return local mapping to global mapping. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_101getLGMap(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_100getLGMap, "DM.getLGMap(self) -> LGMap\nReturn local mapping to global mapping.\n\n Collective.\n\n See Also\n --------\n petsc.DMGetLocalToGlobalMapping\n\n \nSource code at petsc4py/PETSc/DM.pyx:937"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_101getLGMap(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getLGMap (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getLGMap", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getLGMap", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_100getLGMap(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_100getLGMap(struct PyPetscDMObject *__pyx_v_self) { struct PyPetscLGMapObject *__pyx_v_lgm = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getLGMap", 1); /* "petsc4py/PETSc/DM.pyx":947 * * """ * cdef LGMap lgm = LGMap() # <<<<<<<<<<<<<< * CHKERR( DMGetLocalToGlobalMapping(self.dm, &lgm.lgm) ) * CHKERR( PetscINCREF(lgm.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_LGMap)); if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 947, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_lgm = ((struct PyPetscLGMapObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DM.pyx":948 * """ * cdef LGMap lgm = LGMap() * CHKERR( DMGetLocalToGlobalMapping(self.dm, &lgm.lgm) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(lgm.obj) ) * return lgm */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetLocalToGlobalMapping(__pyx_v_self->dm, (&__pyx_v_lgm->lgm))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 948, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":949 * cdef LGMap lgm = LGMap() * CHKERR( DMGetLocalToGlobalMapping(self.dm, &lgm.lgm) ) * CHKERR( PetscINCREF(lgm.obj) ) # <<<<<<<<<<<<<< * return lgm * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_lgm->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 949, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":950 * CHKERR( DMGetLocalToGlobalMapping(self.dm, &lgm.lgm) ) * CHKERR( PetscINCREF(lgm.obj) ) * return lgm # <<<<<<<<<<<<<< * * # */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_lgm); __pyx_r = ((PyObject *)__pyx_v_lgm); goto __pyx_L0; /* "petsc4py/PETSc/DM.pyx":937 * CHKERR( DMLocalToLocalEnd (self.dm, vl.vec, im, vlg.vec) ) * * def getLGMap(self) -> LGMap: # <<<<<<<<<<<<<< * """Return local mapping to global mapping. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DM.getLGMap", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_lgm); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":954 * # * * def getCoarseDM(self) -> DM: # <<<<<<<<<<<<<< * """Return the coarse `DM`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_103getCoarseDM(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_102getCoarseDM, "DM.getCoarseDM(self) -> DM\nReturn the coarse `DM`.\n\n Collective.\n\n See Also\n --------\n petsc.DMGetCoarseDM\n\n \nSource code at petsc4py/PETSc/DM.pyx:954"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_103getCoarseDM(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getCoarseDM (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getCoarseDM", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getCoarseDM", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_102getCoarseDM(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_102getCoarseDM(struct PyPetscDMObject *__pyx_v_self) { struct PyPetscDMObject *__pyx_v_cdm = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PetscErrorCode __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getCoarseDM", 1); /* "petsc4py/PETSc/DM.pyx":964 * * """ * cdef DM cdm = type(self)() # <<<<<<<<<<<<<< * CHKERR( DMGetCoarseDM(self.dm, &cdm.dm) ) * CHKERR( PetscINCREF(cdm.obj) ) */ __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __pyx_t_2 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 964, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(54, 964, __pyx_L1_error) __pyx_v_cdm = ((struct PyPetscDMObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DM.pyx":965 * """ * cdef DM cdm = type(self)() * CHKERR( DMGetCoarseDM(self.dm, &cdm.dm) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(cdm.obj) ) * return cdm */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetCoarseDM(__pyx_v_self->dm, (&__pyx_v_cdm->dm))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 965, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":966 * cdef DM cdm = type(self)() * CHKERR( DMGetCoarseDM(self.dm, &cdm.dm) ) * CHKERR( PetscINCREF(cdm.obj) ) # <<<<<<<<<<<<<< * return cdm * */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_cdm->__pyx_base.obj)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 966, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":967 * CHKERR( DMGetCoarseDM(self.dm, &cdm.dm) ) * CHKERR( PetscINCREF(cdm.obj) ) * return cdm # <<<<<<<<<<<<<< * * def setCoarseDM(self, DM dm) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_cdm); __pyx_r = ((PyObject *)__pyx_v_cdm); goto __pyx_L0; /* "petsc4py/PETSc/DM.pyx":954 * # * * def getCoarseDM(self) -> DM: # <<<<<<<<<<<<<< * """Return the coarse `DM`. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DM.getCoarseDM", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_cdm); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":969 * return cdm * * def setCoarseDM(self, DM dm) -> None: # <<<<<<<<<<<<<< * """Set the coarse `DM`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_105setCoarseDM(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_104setCoarseDM, "DM.setCoarseDM(self, dm: DM) -> None\nSet the coarse `DM`.\n\n Collective.\n\n See Also\n --------\n petsc.DMSetCoarseDM\n\n \nSource code at petsc4py/PETSc/DM.pyx:969"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_105setCoarseDM(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscDMObject *__pyx_v_dm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setCoarseDM (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dm,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dm)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 969, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setCoarseDM") < 0)) __PYX_ERR(54, 969, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_dm = ((struct PyPetscDMObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setCoarseDM", 1, 1, 1, __pyx_nargs); __PYX_ERR(54, 969, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DM.setCoarseDM", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_ptype_8petsc4py_5PETSc_DM, 0, "dm", 0))) __PYX_ERR(54, 969, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_104setCoarseDM(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_dm); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_104setCoarseDM(struct PyPetscDMObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setCoarseDM", 1); /* "petsc4py/PETSc/DM.pyx":979 * * """ * CHKERR( DMSetCoarseDM(self.dm, dm.dm) ) # <<<<<<<<<<<<<< * return * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSetCoarseDM(__pyx_v_self->dm, __pyx_v_dm->dm)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 979, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":980 * """ * CHKERR( DMSetCoarseDM(self.dm, dm.dm) ) * return # <<<<<<<<<<<<<< * * def getCoordinateDM(self) -> DM: */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "petsc4py/PETSc/DM.pyx":969 * return cdm * * def setCoarseDM(self, DM dm) -> None: # <<<<<<<<<<<<<< * """Set the coarse `DM`. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.setCoarseDM", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":982 * return * * def getCoordinateDM(self) -> DM: # <<<<<<<<<<<<<< * """Return the coordinate `DM`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_107getCoordinateDM(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_106getCoordinateDM, "DM.getCoordinateDM(self) -> DM\nReturn the coordinate `DM`.\n\n Collective.\n\n See Also\n --------\n petsc.DMGetCoordinateDM\n\n \nSource code at petsc4py/PETSc/DM.pyx:982"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_107getCoordinateDM(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getCoordinateDM (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getCoordinateDM", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getCoordinateDM", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_106getCoordinateDM(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_106getCoordinateDM(struct PyPetscDMObject *__pyx_v_self) { struct PyPetscDMObject *__pyx_v_cdm = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PetscErrorCode __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getCoordinateDM", 1); /* "petsc4py/PETSc/DM.pyx":992 * * """ * cdef DM cdm = type(self)() # <<<<<<<<<<<<<< * CHKERR( DMGetCoordinateDM(self.dm, &cdm.dm) ) * CHKERR( PetscINCREF(cdm.obj) ) */ __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __pyx_t_2 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 992, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(54, 992, __pyx_L1_error) __pyx_v_cdm = ((struct PyPetscDMObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DM.pyx":993 * """ * cdef DM cdm = type(self)() * CHKERR( DMGetCoordinateDM(self.dm, &cdm.dm) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(cdm.obj) ) * return cdm */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetCoordinateDM(__pyx_v_self->dm, (&__pyx_v_cdm->dm))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 993, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":994 * cdef DM cdm = type(self)() * CHKERR( DMGetCoordinateDM(self.dm, &cdm.dm) ) * CHKERR( PetscINCREF(cdm.obj) ) # <<<<<<<<<<<<<< * return cdm * */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_cdm->__pyx_base.obj)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 994, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":995 * CHKERR( DMGetCoordinateDM(self.dm, &cdm.dm) ) * CHKERR( PetscINCREF(cdm.obj) ) * return cdm # <<<<<<<<<<<<<< * * def getCoordinateSection(self) -> Section: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_cdm); __pyx_r = ((PyObject *)__pyx_v_cdm); goto __pyx_L0; /* "petsc4py/PETSc/DM.pyx":982 * return * * def getCoordinateDM(self) -> DM: # <<<<<<<<<<<<<< * """Return the coordinate `DM`. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DM.getCoordinateDM", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_cdm); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":997 * return cdm * * def getCoordinateSection(self) -> Section: # <<<<<<<<<<<<<< * """Return coordinate values layout over the mesh. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_109getCoordinateSection(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_108getCoordinateSection, "DM.getCoordinateSection(self) -> Section\nReturn coordinate values layout over the mesh.\n\n Collective.\n\n See Also\n --------\n petsc.DMGetCoordinateSection\n\n \nSource code at petsc4py/PETSc/DM.pyx:997"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_109getCoordinateSection(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getCoordinateSection (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getCoordinateSection", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getCoordinateSection", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_108getCoordinateSection(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_108getCoordinateSection(struct PyPetscDMObject *__pyx_v_self) { struct PyPetscSectionObject *__pyx_v_sec = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getCoordinateSection", 1); /* "petsc4py/PETSc/DM.pyx":1007 * * """ * cdef Section sec = Section() # <<<<<<<<<<<<<< * CHKERR( DMGetCoordinateSection(self.dm, &sec.sec) ) * CHKERR( PetscINCREF(sec.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Section)); if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 1007, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_sec = ((struct PyPetscSectionObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DM.pyx":1008 * """ * cdef Section sec = Section() * CHKERR( DMGetCoordinateSection(self.dm, &sec.sec) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(sec.obj) ) * return sec */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetCoordinateSection(__pyx_v_self->dm, (&__pyx_v_sec->sec))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1008, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":1009 * cdef Section sec = Section() * CHKERR( DMGetCoordinateSection(self.dm, &sec.sec) ) * CHKERR( PetscINCREF(sec.obj) ) # <<<<<<<<<<<<<< * return sec * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_sec->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1009, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":1010 * CHKERR( DMGetCoordinateSection(self.dm, &sec.sec) ) * CHKERR( PetscINCREF(sec.obj) ) * return sec # <<<<<<<<<<<<<< * * def setCoordinates(self, Vec c) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_sec); __pyx_r = ((PyObject *)__pyx_v_sec); goto __pyx_L0; /* "petsc4py/PETSc/DM.pyx":997 * return cdm * * def getCoordinateSection(self) -> Section: # <<<<<<<<<<<<<< * """Return coordinate values layout over the mesh. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DM.getCoordinateSection", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_sec); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":1012 * return sec * * def setCoordinates(self, Vec c) -> None: # <<<<<<<<<<<<<< * """Set a global vector that holds the coordinates. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_111setCoordinates(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_110setCoordinates, "DM.setCoordinates(self, c: Vec) -> None\nSet a global vector that holds the coordinates.\n\n Collective.\n\n Parameters\n ----------\n c\n Coordinate Vector.\n\n See Also\n --------\n petsc.DMSetCoordinates\n\n \nSource code at petsc4py/PETSc/DM.pyx:1012"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_111setCoordinates(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_c = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setCoordinates (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_c,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_c)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 1012, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setCoordinates") < 0)) __PYX_ERR(54, 1012, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_c = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setCoordinates", 1, 1, 1, __pyx_nargs); __PYX_ERR(54, 1012, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DM.setCoordinates", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_c), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "c", 0))) __PYX_ERR(54, 1012, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_110setCoordinates(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_c); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_110setCoordinates(struct PyPetscDMObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_c) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setCoordinates", 1); /* "petsc4py/PETSc/DM.pyx":1027 * * """ * CHKERR( DMSetCoordinates(self.dm, c.vec) ) # <<<<<<<<<<<<<< * * def getCoordinates(self) -> Vec: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSetCoordinates(__pyx_v_self->dm, __pyx_v_c->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1027, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":1012 * return sec * * def setCoordinates(self, Vec c) -> None: # <<<<<<<<<<<<<< * """Set a global vector that holds the coordinates. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.setCoordinates", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":1029 * CHKERR( DMSetCoordinates(self.dm, c.vec) ) * * def getCoordinates(self) -> Vec: # <<<<<<<<<<<<<< * """Return a global vector with the coordinates associated. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_113getCoordinates(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_112getCoordinates, "DM.getCoordinates(self) -> Vec\nReturn a global vector with the coordinates associated.\n\n Collective.\n\n See Also\n --------\n petsc.DMGetCoordinates\n\n \nSource code at petsc4py/PETSc/DM.pyx:1029"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_113getCoordinates(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getCoordinates (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getCoordinates", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getCoordinates", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_112getCoordinates(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_112getCoordinates(struct PyPetscDMObject *__pyx_v_self) { struct PyPetscVecObject *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getCoordinates", 1); /* "petsc4py/PETSc/DM.pyx":1039 * * """ * cdef Vec c = Vec() # <<<<<<<<<<<<<< * CHKERR( DMGetCoordinates(self.dm, &c.vec) ) * CHKERR( PetscINCREF(c.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 1039, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_c = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DM.pyx":1040 * """ * cdef Vec c = Vec() * CHKERR( DMGetCoordinates(self.dm, &c.vec) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(c.obj) ) * return c */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetCoordinates(__pyx_v_self->dm, (&__pyx_v_c->vec))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1040, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":1041 * cdef Vec c = Vec() * CHKERR( DMGetCoordinates(self.dm, &c.vec) ) * CHKERR( PetscINCREF(c.obj) ) # <<<<<<<<<<<<<< * return c * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_c->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1041, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":1042 * CHKERR( DMGetCoordinates(self.dm, &c.vec) ) * CHKERR( PetscINCREF(c.obj) ) * return c # <<<<<<<<<<<<<< * * def setCoordinatesLocal(self, Vec c) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_c); __pyx_r = ((PyObject *)__pyx_v_c); goto __pyx_L0; /* "petsc4py/PETSc/DM.pyx":1029 * CHKERR( DMSetCoordinates(self.dm, c.vec) ) * * def getCoordinates(self) -> Vec: # <<<<<<<<<<<<<< * """Return a global vector with the coordinates associated. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DM.getCoordinates", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":1044 * return c * * def setCoordinatesLocal(self, Vec c) -> None: # <<<<<<<<<<<<<< * """Set a local vector with the ghost point holding the coordinates. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_115setCoordinatesLocal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_114setCoordinatesLocal, "DM.setCoordinatesLocal(self, c: Vec) -> None\nSet a local vector with the ghost point holding the coordinates.\n\n Not collective.\n\n Parameters\n ----------\n c\n Coordinate Vector.\n\n See Also\n --------\n petsc.DMSetCoordinatesLocal\n\n \nSource code at petsc4py/PETSc/DM.pyx:1044"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_115setCoordinatesLocal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_c = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setCoordinatesLocal (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_c,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_c)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 1044, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setCoordinatesLocal") < 0)) __PYX_ERR(54, 1044, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_c = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setCoordinatesLocal", 1, 1, 1, __pyx_nargs); __PYX_ERR(54, 1044, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DM.setCoordinatesLocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_c), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "c", 0))) __PYX_ERR(54, 1044, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_114setCoordinatesLocal(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_c); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_114setCoordinatesLocal(struct PyPetscDMObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_c) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setCoordinatesLocal", 1); /* "petsc4py/PETSc/DM.pyx":1059 * * """ * CHKERR( DMSetCoordinatesLocal(self.dm, c.vec) ) # <<<<<<<<<<<<<< * * def getCoordinatesLocal(self) -> Vec: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSetCoordinatesLocal(__pyx_v_self->dm, __pyx_v_c->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1059, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":1044 * return c * * def setCoordinatesLocal(self, Vec c) -> None: # <<<<<<<<<<<<<< * """Set a local vector with the ghost point holding the coordinates. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.setCoordinatesLocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":1061 * CHKERR( DMSetCoordinatesLocal(self.dm, c.vec) ) * * def getCoordinatesLocal(self) -> Vec: # <<<<<<<<<<<<<< * """Return a local vector with the coordinates associated. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_117getCoordinatesLocal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_116getCoordinatesLocal, "DM.getCoordinatesLocal(self) -> Vec\nReturn a local vector with the coordinates associated.\n\n Collective the first time it is called.\n\n See Also\n --------\n petsc.DMGetCoordinatesLocal\n\n \nSource code at petsc4py/PETSc/DM.pyx:1061"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_117getCoordinatesLocal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getCoordinatesLocal (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getCoordinatesLocal", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getCoordinatesLocal", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_116getCoordinatesLocal(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_116getCoordinatesLocal(struct PyPetscDMObject *__pyx_v_self) { struct PyPetscVecObject *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getCoordinatesLocal", 1); /* "petsc4py/PETSc/DM.pyx":1071 * * """ * cdef Vec c = Vec() # <<<<<<<<<<<<<< * CHKERR( DMGetCoordinatesLocal(self.dm, &c.vec) ) * CHKERR( PetscINCREF(c.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 1071, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_c = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DM.pyx":1072 * """ * cdef Vec c = Vec() * CHKERR( DMGetCoordinatesLocal(self.dm, &c.vec) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(c.obj) ) * return c */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetCoordinatesLocal(__pyx_v_self->dm, (&__pyx_v_c->vec))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1072, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":1073 * cdef Vec c = Vec() * CHKERR( DMGetCoordinatesLocal(self.dm, &c.vec) ) * CHKERR( PetscINCREF(c.obj) ) # <<<<<<<<<<<<<< * return c * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_c->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1073, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":1074 * CHKERR( DMGetCoordinatesLocal(self.dm, &c.vec) ) * CHKERR( PetscINCREF(c.obj) ) * return c # <<<<<<<<<<<<<< * * def projectCoordinates(self, FE disc) -> Self: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_c); __pyx_r = ((PyObject *)__pyx_v_c); goto __pyx_L0; /* "petsc4py/PETSc/DM.pyx":1061 * CHKERR( DMSetCoordinatesLocal(self.dm, c.vec) ) * * def getCoordinatesLocal(self) -> Vec: # <<<<<<<<<<<<<< * """Return a local vector with the coordinates associated. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DM.getCoordinatesLocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":1076 * return c * * def projectCoordinates(self, FE disc) -> Self: # <<<<<<<<<<<<<< * """Project coordinates to a different space. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_119projectCoordinates(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_118projectCoordinates, "DM.projectCoordinates(self, disc: FE) -> Self\nProject coordinates to a different space.\n\n Parameters\n ----------\n disc\n The new coordinates discretization.\n\n See Also\n --------\n petsc.DMProjectCoordinates\n\n \nSource code at petsc4py/PETSc/DM.pyx:1076"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_119projectCoordinates(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscFEObject *__pyx_v_disc = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("projectCoordinates (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_disc,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_disc)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 1076, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "projectCoordinates") < 0)) __PYX_ERR(54, 1076, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_disc = ((struct PyPetscFEObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("projectCoordinates", 1, 1, 1, __pyx_nargs); __PYX_ERR(54, 1076, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DM.projectCoordinates", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_disc), __pyx_ptype_8petsc4py_5PETSc_FE, 0, "disc", 0))) __PYX_ERR(54, 1076, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_118projectCoordinates(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_disc); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_118projectCoordinates(struct PyPetscDMObject *__pyx_v_self, struct PyPetscFEObject *__pyx_v_disc) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("projectCoordinates", 1); /* "petsc4py/PETSc/DM.pyx":1089 * * """ * CHKERR( DMProjectCoordinates(self.dm, disc.fe)) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMProjectCoordinates(__pyx_v_self->dm, __pyx_v_disc->fe)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1089, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":1090 * """ * CHKERR( DMProjectCoordinates(self.dm, disc.fe)) * return self # <<<<<<<<<<<<<< * * def getBoundingBox(self) -> tuple[tuple[float, float], ...]: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/DM.pyx":1076 * return c * * def projectCoordinates(self, FE disc) -> Self: # <<<<<<<<<<<<<< * """Project coordinates to a different space. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.projectCoordinates", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":1092 * return self * * def getBoundingBox(self) -> tuple[tuple[float, float], ...]: # <<<<<<<<<<<<<< * """Return the dimension of embedding space for coordinates values. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_121getBoundingBox(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_120getBoundingBox, "DM.getBoundingBox(self) -> tuple[tuple[float, float], ...]\nReturn the dimension of embedding space for coordinates values.\n\n Not collective.\n\n See Also\n --------\n petsc.DMGetBoundingBox\n\n \nSource code at petsc4py/PETSc/DM.pyx:1092"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_121getBoundingBox(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getBoundingBox (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getBoundingBox", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getBoundingBox", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_120getBoundingBox(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_120getBoundingBox(struct PyPetscDMObject *__pyx_v_self) { PetscInt __pyx_v_dim; PetscReal __pyx_v_gmin[3]; PetscReal __pyx_v_gmax[3]; PetscInt __pyx_9genexpr14__pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscInt __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getBoundingBox", 1); /* "petsc4py/PETSc/DM.pyx":1102 * * """ * cdef PetscInt i,dim=0 # <<<<<<<<<<<<<< * CHKERR( DMGetCoordinateDim(self.dm, &dim) ) * cdef PetscReal gmin[3], gmax[3] */ __pyx_v_dim = 0; /* "petsc4py/PETSc/DM.pyx":1103 * """ * cdef PetscInt i,dim=0 * CHKERR( DMGetCoordinateDim(self.dm, &dim) ) # <<<<<<<<<<<<<< * cdef PetscReal gmin[3], gmax[3] * CHKERR( DMGetBoundingBox(self.dm, gmin, gmax) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetCoordinateDim(__pyx_v_self->dm, (&__pyx_v_dim))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1103, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":1105 * CHKERR( DMGetCoordinateDim(self.dm, &dim) ) * cdef PetscReal gmin[3], gmax[3] * CHKERR( DMGetBoundingBox(self.dm, gmin, gmax) ) # <<<<<<<<<<<<<< * return tuple([(toReal(gmin[i]), toReal(gmax[i])) * for i from 0 <= i < dim]) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetBoundingBox(__pyx_v_self->dm, __pyx_v_gmin, __pyx_v_gmax)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1105, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":1106 * cdef PetscReal gmin[3], gmax[3] * CHKERR( DMGetBoundingBox(self.dm, gmin, gmax) ) * return tuple([(toReal(gmin[i]), toReal(gmax[i])) # <<<<<<<<<<<<<< * for i from 0 <= i < dim]) * */ __Pyx_XDECREF(__pyx_r); { /* enter inner scope */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 1106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "petsc4py/PETSc/DM.pyx":1107 * CHKERR( DMGetBoundingBox(self.dm, gmin, gmax) ) * return tuple([(toReal(gmin[i]), toReal(gmax[i])) * for i from 0 <= i < dim]) # <<<<<<<<<<<<<< * * def getLocalBoundingBox(self) -> tuple[tuple[float, float], ...]: */ __pyx_t_3 = __pyx_v_dim; for (__pyx_9genexpr14__pyx_v_i = 0; __pyx_9genexpr14__pyx_v_i < __pyx_t_3; __pyx_9genexpr14__pyx_v_i++) { /* "petsc4py/PETSc/DM.pyx":1106 * cdef PetscReal gmin[3], gmax[3] * CHKERR( DMGetBoundingBox(self.dm, gmin, gmax) ) * return tuple([(toReal(gmin[i]), toReal(gmax[i])) # <<<<<<<<<<<<<< * for i from 0 <= i < dim]) * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toReal((__pyx_v_gmin[__pyx_9genexpr14__pyx_v_i])); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 1106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toReal((__pyx_v_gmax[__pyx_9genexpr14__pyx_v_i])); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 1106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(54, 1106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4)) __PYX_ERR(54, 1106, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5)) __PYX_ERR(54, 1106, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_5 = 0; if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(54, 1106, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } } /* exit inner scope */ __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(54, 1106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DM.pyx":1092 * return self * * def getBoundingBox(self) -> tuple[tuple[float, float], ...]: # <<<<<<<<<<<<<< * """Return the dimension of embedding space for coordinates values. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.DM.getBoundingBox", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":1109 * for i from 0 <= i < dim]) * * def getLocalBoundingBox(self) -> tuple[tuple[float, float], ...]: # <<<<<<<<<<<<<< * """Return the bounding box for the piece of the `DM`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_123getLocalBoundingBox(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_122getLocalBoundingBox, "DM.getLocalBoundingBox(self) -> tuple[tuple[float, float], ...]\nReturn the bounding box for the piece of the `DM`.\n\n Not collective.\n\n See Also\n --------\n petsc.DMGetLocalBoundingBox\n\n \nSource code at petsc4py/PETSc/DM.pyx:1109"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_123getLocalBoundingBox(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getLocalBoundingBox (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getLocalBoundingBox", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getLocalBoundingBox", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_122getLocalBoundingBox(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_122getLocalBoundingBox(struct PyPetscDMObject *__pyx_v_self) { PetscInt __pyx_v_dim; PetscReal __pyx_v_lmin[3]; PetscReal __pyx_v_lmax[3]; PetscInt __pyx_9genexpr15__pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscInt __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getLocalBoundingBox", 1); /* "petsc4py/PETSc/DM.pyx":1119 * * """ * cdef PetscInt i,dim=0 # <<<<<<<<<<<<<< * CHKERR( DMGetCoordinateDim(self.dm, &dim) ) * cdef PetscReal lmin[3], lmax[3] */ __pyx_v_dim = 0; /* "petsc4py/PETSc/DM.pyx":1120 * """ * cdef PetscInt i,dim=0 * CHKERR( DMGetCoordinateDim(self.dm, &dim) ) # <<<<<<<<<<<<<< * cdef PetscReal lmin[3], lmax[3] * CHKERR( DMGetLocalBoundingBox(self.dm, lmin, lmax) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetCoordinateDim(__pyx_v_self->dm, (&__pyx_v_dim))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1120, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":1122 * CHKERR( DMGetCoordinateDim(self.dm, &dim) ) * cdef PetscReal lmin[3], lmax[3] * CHKERR( DMGetLocalBoundingBox(self.dm, lmin, lmax) ) # <<<<<<<<<<<<<< * return tuple([(toReal(lmin[i]), toReal(lmax[i])) * for i from 0 <= i < dim]) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetLocalBoundingBox(__pyx_v_self->dm, __pyx_v_lmin, __pyx_v_lmax)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1122, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":1123 * cdef PetscReal lmin[3], lmax[3] * CHKERR( DMGetLocalBoundingBox(self.dm, lmin, lmax) ) * return tuple([(toReal(lmin[i]), toReal(lmax[i])) # <<<<<<<<<<<<<< * for i from 0 <= i < dim]) * */ __Pyx_XDECREF(__pyx_r); { /* enter inner scope */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 1123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "petsc4py/PETSc/DM.pyx":1124 * CHKERR( DMGetLocalBoundingBox(self.dm, lmin, lmax) ) * return tuple([(toReal(lmin[i]), toReal(lmax[i])) * for i from 0 <= i < dim]) # <<<<<<<<<<<<<< * * def localizeCoordinates(self) -> None: */ __pyx_t_3 = __pyx_v_dim; for (__pyx_9genexpr15__pyx_v_i = 0; __pyx_9genexpr15__pyx_v_i < __pyx_t_3; __pyx_9genexpr15__pyx_v_i++) { /* "petsc4py/PETSc/DM.pyx":1123 * cdef PetscReal lmin[3], lmax[3] * CHKERR( DMGetLocalBoundingBox(self.dm, lmin, lmax) ) * return tuple([(toReal(lmin[i]), toReal(lmax[i])) # <<<<<<<<<<<<<< * for i from 0 <= i < dim]) * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toReal((__pyx_v_lmin[__pyx_9genexpr15__pyx_v_i])); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 1123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toReal((__pyx_v_lmax[__pyx_9genexpr15__pyx_v_i])); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 1123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(54, 1123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4)) __PYX_ERR(54, 1123, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5)) __PYX_ERR(54, 1123, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_5 = 0; if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(54, 1123, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } } /* exit inner scope */ __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(54, 1123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DM.pyx":1109 * for i from 0 <= i < dim]) * * def getLocalBoundingBox(self) -> tuple[tuple[float, float], ...]: # <<<<<<<<<<<<<< * """Return the bounding box for the piece of the `DM`. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.DM.getLocalBoundingBox", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":1126 * for i from 0 <= i < dim]) * * def localizeCoordinates(self) -> None: # <<<<<<<<<<<<<< * """Create local coordinates for cells having periodic faces. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_125localizeCoordinates(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_124localizeCoordinates, "DM.localizeCoordinates(self) -> None\nCreate local coordinates for cells having periodic faces.\n\n Collective.\n\n Notes\n -----\n Used if the mesh is periodic.\n\n See Also\n --------\n petsc.DMLocalizeCoordinates\n\n \nSource code at petsc4py/PETSc/DM.pyx:1126"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_125localizeCoordinates(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("localizeCoordinates (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("localizeCoordinates", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "localizeCoordinates", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_124localizeCoordinates(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_124localizeCoordinates(struct PyPetscDMObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("localizeCoordinates", 1); /* "petsc4py/PETSc/DM.pyx":1140 * * """ * CHKERR( DMLocalizeCoordinates(self.dm) ) # <<<<<<<<<<<<<< * # * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMLocalizeCoordinates(__pyx_v_self->dm)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1140, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":1126 * for i from 0 <= i < dim]) * * def localizeCoordinates(self) -> None: # <<<<<<<<<<<<<< * """Create local coordinates for cells having periodic faces. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.localizeCoordinates", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":1143 * # * * def setMatType(self, mat_type: Mat.Type | str) -> None: # <<<<<<<<<<<<<< * """Set matrix type to be used by `DM.createMat`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_127setMatType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_126setMatType, "DM.setMatType(self, mat_type: Mat.Type | str) -> None\nSet matrix type to be used by `DM.createMat`.\n\n Logically collective.\n\n Parameters\n ----------\n mat_type\n The matrix type.\n\n Notes\n -----\n The option ``-dm_mat_type`` is used to set the matrix type.\n\n See Also\n --------\n petsc_options, petsc.DMSetMatType\n\n \nSource code at petsc4py/PETSc/DM.pyx:1143"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_127setMatType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_mat_type = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setMatType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat_type,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mat_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 1143, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setMatType") < 0)) __PYX_ERR(54, 1143, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_mat_type = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setMatType", 1, 1, 1, __pyx_nargs); __PYX_ERR(54, 1143, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DM.setMatType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_126setMatType(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_mat_type); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_126setMatType(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_mat_type) { MatType __pyx_v_mtype; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setMatType", 0); __Pyx_INCREF(__pyx_v_mat_type); /* "petsc4py/PETSc/DM.pyx":1162 * * """ * cdef PetscMatType mtype = NULL # <<<<<<<<<<<<<< * mat_type = str2bytes(mat_type, &mtype) * CHKERR( DMSetMatType(self.dm, mtype) ) */ __pyx_v_mtype = NULL; /* "petsc4py/PETSc/DM.pyx":1163 * """ * cdef PetscMatType mtype = NULL * mat_type = str2bytes(mat_type, &mtype) # <<<<<<<<<<<<<< * CHKERR( DMSetMatType(self.dm, mtype) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_mat_type, (&__pyx_v_mtype)); if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 1163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_mat_type, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DM.pyx":1164 * cdef PetscMatType mtype = NULL * mat_type = str2bytes(mat_type, &mtype) * CHKERR( DMSetMatType(self.dm, mtype) ) # <<<<<<<<<<<<<< * * def createMat(self) -> Mat: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSetMatType(__pyx_v_self->dm, __pyx_v_mtype)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1164, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":1143 * # * * def setMatType(self, mat_type: Mat.Type | str) -> None: # <<<<<<<<<<<<<< * """Set matrix type to be used by `DM.createMat`. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DM.setMatType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_mat_type); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":1166 * CHKERR( DMSetMatType(self.dm, mtype) ) * * def createMat(self) -> Mat: # <<<<<<<<<<<<<< * """Return an empty matrix. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_129createMat(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_128createMat, "DM.createMat(self) -> Mat\nReturn an empty matrix.\n\n Collective.\n\n See Also\n --------\n petsc.DMCreateMatrix\n\n \nSource code at petsc4py/PETSc/DM.pyx:1166"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_129createMat(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createMat (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("createMat", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "createMat", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_128createMat(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_128createMat(struct PyPetscDMObject *__pyx_v_self) { struct PyPetscMatObject *__pyx_v_mat = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createMat", 1); /* "petsc4py/PETSc/DM.pyx":1176 * * """ * cdef Mat mat = Mat() # <<<<<<<<<<<<<< * CHKERR( DMCreateMatrix(self.dm, &mat.mat) ) * return mat */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 1176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_mat = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DM.pyx":1177 * """ * cdef Mat mat = Mat() * CHKERR( DMCreateMatrix(self.dm, &mat.mat) ) # <<<<<<<<<<<<<< * return mat * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCreateMatrix(__pyx_v_self->dm, (&__pyx_v_mat->mat))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1177, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":1178 * cdef Mat mat = Mat() * CHKERR( DMCreateMatrix(self.dm, &mat.mat) ) * return mat # <<<<<<<<<<<<<< * * def createMassMatrix(self, DM dmf) -> Mat: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_mat); __pyx_r = ((PyObject *)__pyx_v_mat); goto __pyx_L0; /* "petsc4py/PETSc/DM.pyx":1166 * CHKERR( DMSetMatType(self.dm, mtype) ) * * def createMat(self) -> Mat: # <<<<<<<<<<<<<< * """Return an empty matrix. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DM.createMat", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_mat); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":1180 * return mat * * def createMassMatrix(self, DM dmf) -> Mat: # <<<<<<<<<<<<<< * """Return the mass matrix between this `DM` and the given `DM`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_131createMassMatrix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_130createMassMatrix, "DM.createMassMatrix(self, dmf: DM) -> Mat\nReturn the mass matrix between this `DM` and the given `DM`.\n\n Collective.\n\n Parameters\n ----------\n dmf\n The second `DM`.\n\n See Also\n --------\n petsc.DMCreateMassMatrix\n\n \nSource code at petsc4py/PETSc/DM.pyx:1180"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_131createMassMatrix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscDMObject *__pyx_v_dmf = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createMassMatrix (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dmf,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dmf)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 1180, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createMassMatrix") < 0)) __PYX_ERR(54, 1180, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_dmf = ((struct PyPetscDMObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createMassMatrix", 1, 1, 1, __pyx_nargs); __PYX_ERR(54, 1180, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DM.createMassMatrix", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dmf), __pyx_ptype_8petsc4py_5PETSc_DM, 0, "dmf", 0))) __PYX_ERR(54, 1180, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_130createMassMatrix(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_dmf); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_130createMassMatrix(struct PyPetscDMObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dmf) { struct PyPetscMatObject *__pyx_v_mat = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createMassMatrix", 1); /* "petsc4py/PETSc/DM.pyx":1195 * * """ * cdef Mat mat = Mat() # <<<<<<<<<<<<<< * CHKERR( DMCreateMassMatrix(self.dm, dmf.dm, &mat.mat) ) * return mat */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 1195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_mat = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DM.pyx":1196 * """ * cdef Mat mat = Mat() * CHKERR( DMCreateMassMatrix(self.dm, dmf.dm, &mat.mat) ) # <<<<<<<<<<<<<< * return mat * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCreateMassMatrix(__pyx_v_self->dm, __pyx_v_dmf->dm, (&__pyx_v_mat->mat))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1196, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":1197 * cdef Mat mat = Mat() * CHKERR( DMCreateMassMatrix(self.dm, dmf.dm, &mat.mat) ) * return mat # <<<<<<<<<<<<<< * * def createInterpolation(self, DM dm) -> tuple[Mat, Vec]: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_mat); __pyx_r = ((PyObject *)__pyx_v_mat); goto __pyx_L0; /* "petsc4py/PETSc/DM.pyx":1180 * return mat * * def createMassMatrix(self, DM dmf) -> Mat: # <<<<<<<<<<<<<< * """Return the mass matrix between this `DM` and the given `DM`. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DM.createMassMatrix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_mat); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":1199 * return mat * * def createInterpolation(self, DM dm) -> tuple[Mat, Vec]: # <<<<<<<<<<<<<< * """Return the interpolation matrix to a finer `DM`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_133createInterpolation(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_132createInterpolation, "DM.createInterpolation(self, dm: DM) -> tuple[Mat, Vec]\nReturn the interpolation matrix to a finer `DM`.\n\n Collective.\n\n Parameters\n ----------\n dm\n The second, finer `DM`.\n\n See Also\n --------\n petsc.DMCreateInterpolation\n\n \nSource code at petsc4py/PETSc/DM.pyx:1199"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_133createInterpolation(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscDMObject *__pyx_v_dm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createInterpolation (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dm,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dm)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 1199, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createInterpolation") < 0)) __PYX_ERR(54, 1199, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_dm = ((struct PyPetscDMObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createInterpolation", 1, 1, 1, __pyx_nargs); __PYX_ERR(54, 1199, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DM.createInterpolation", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_ptype_8petsc4py_5PETSc_DM, 0, "dm", 0))) __PYX_ERR(54, 1199, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_132createInterpolation(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_dm); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_132createInterpolation(struct PyPetscDMObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm) { struct PyPetscMatObject *__pyx_v_A = 0; struct PyPetscVecObject *__pyx_v_scale = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createInterpolation", 1); /* "petsc4py/PETSc/DM.pyx":1214 * * """ * cdef Mat A = Mat() # <<<<<<<<<<<<<< * cdef Vec scale = Vec() * CHKERR( DMCreateInterpolation(self.dm, dm.dm, */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 1214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_A = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DM.pyx":1215 * """ * cdef Mat A = Mat() * cdef Vec scale = Vec() # <<<<<<<<<<<<<< * CHKERR( DMCreateInterpolation(self.dm, dm.dm, * &A.mat, &scale.vec)) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 1215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_scale = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DM.pyx":1216 * cdef Mat A = Mat() * cdef Vec scale = Vec() * CHKERR( DMCreateInterpolation(self.dm, dm.dm, # <<<<<<<<<<<<<< * &A.mat, &scale.vec)) * return (A, scale) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCreateInterpolation(__pyx_v_self->dm, __pyx_v_dm->dm, (&__pyx_v_A->mat), (&__pyx_v_scale->vec))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1216, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":1218 * CHKERR( DMCreateInterpolation(self.dm, dm.dm, * &A.mat, &scale.vec)) * return (A, scale) # <<<<<<<<<<<<<< * * def createInjection(self, DM dm) -> Mat: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 1218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF((PyObject *)__pyx_v_A); __Pyx_GIVEREF((PyObject *)__pyx_v_A); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_A))) __PYX_ERR(54, 1218, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_scale); __Pyx_GIVEREF((PyObject *)__pyx_v_scale); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_scale))) __PYX_ERR(54, 1218, __pyx_L1_error); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DM.pyx":1199 * return mat * * def createInterpolation(self, DM dm) -> tuple[Mat, Vec]: # <<<<<<<<<<<<<< * """Return the interpolation matrix to a finer `DM`. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DM.createInterpolation", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_A); __Pyx_XDECREF((PyObject *)__pyx_v_scale); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":1220 * return (A, scale) * * def createInjection(self, DM dm) -> Mat: # <<<<<<<<<<<<<< * """Return the injection matrix into a finer `DM`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_135createInjection(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_134createInjection, "DM.createInjection(self, dm: DM) -> Mat\nReturn the injection matrix into a finer `DM`.\n\n Collective.\n\n Parameters\n ----------\n dm\n The second, finer `DM` object.\n\n See Also\n --------\n petsc.DMCreateInjection\n\n \nSource code at petsc4py/PETSc/DM.pyx:1220"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_135createInjection(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscDMObject *__pyx_v_dm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createInjection (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dm,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dm)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 1220, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createInjection") < 0)) __PYX_ERR(54, 1220, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_dm = ((struct PyPetscDMObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createInjection", 1, 1, 1, __pyx_nargs); __PYX_ERR(54, 1220, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DM.createInjection", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_ptype_8petsc4py_5PETSc_DM, 0, "dm", 0))) __PYX_ERR(54, 1220, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_134createInjection(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_dm); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_134createInjection(struct PyPetscDMObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm) { struct PyPetscMatObject *__pyx_v_inject = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createInjection", 1); /* "petsc4py/PETSc/DM.pyx":1235 * * """ * cdef Mat inject = Mat() # <<<<<<<<<<<<<< * CHKERR( DMCreateInjection(self.dm, dm.dm, &inject.mat) ) * return inject */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 1235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_inject = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DM.pyx":1236 * """ * cdef Mat inject = Mat() * CHKERR( DMCreateInjection(self.dm, dm.dm, &inject.mat) ) # <<<<<<<<<<<<<< * return inject * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCreateInjection(__pyx_v_self->dm, __pyx_v_dm->dm, (&__pyx_v_inject->mat))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1236, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":1237 * cdef Mat inject = Mat() * CHKERR( DMCreateInjection(self.dm, dm.dm, &inject.mat) ) * return inject # <<<<<<<<<<<<<< * * def createRestriction(self, DM dm) -> Mat: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_inject); __pyx_r = ((PyObject *)__pyx_v_inject); goto __pyx_L0; /* "petsc4py/PETSc/DM.pyx":1220 * return (A, scale) * * def createInjection(self, DM dm) -> Mat: # <<<<<<<<<<<<<< * """Return the injection matrix into a finer `DM`. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DM.createInjection", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_inject); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":1239 * return inject * * def createRestriction(self, DM dm) -> Mat: # <<<<<<<<<<<<<< * """Return the restriction matrix between this `DM` and the given `DM`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_137createRestriction(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_136createRestriction, "DM.createRestriction(self, dm: DM) -> Mat\nReturn the restriction matrix between this `DM` and the given `DM`.\n\n Collective.\n\n Parameters\n ----------\n dm\n The second, finer `DM` object.\n\n See Also\n --------\n petsc.DMCreateRestriction\n\n \nSource code at petsc4py/PETSc/DM.pyx:1239"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_137createRestriction(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscDMObject *__pyx_v_dm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createRestriction (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dm,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dm)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 1239, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createRestriction") < 0)) __PYX_ERR(54, 1239, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_dm = ((struct PyPetscDMObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createRestriction", 1, 1, 1, __pyx_nargs); __PYX_ERR(54, 1239, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DM.createRestriction", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_ptype_8petsc4py_5PETSc_DM, 0, "dm", 0))) __PYX_ERR(54, 1239, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_136createRestriction(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_dm); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_136createRestriction(struct PyPetscDMObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm) { struct PyPetscMatObject *__pyx_v_mat = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createRestriction", 1); /* "petsc4py/PETSc/DM.pyx":1254 * * """ * cdef Mat mat = Mat() # <<<<<<<<<<<<<< * CHKERR( DMCreateRestriction(self.dm, dm.dm, &mat.mat) ) * return mat */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 1254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_mat = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DM.pyx":1255 * """ * cdef Mat mat = Mat() * CHKERR( DMCreateRestriction(self.dm, dm.dm, &mat.mat) ) # <<<<<<<<<<<<<< * return mat * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCreateRestriction(__pyx_v_self->dm, __pyx_v_dm->dm, (&__pyx_v_mat->mat))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1255, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":1256 * cdef Mat mat = Mat() * CHKERR( DMCreateRestriction(self.dm, dm.dm, &mat.mat) ) * return mat # <<<<<<<<<<<<<< * * def convert(self, dm_type: DM.Type | str) -> DM: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_mat); __pyx_r = ((PyObject *)__pyx_v_mat); goto __pyx_L0; /* "petsc4py/PETSc/DM.pyx":1239 * return inject * * def createRestriction(self, DM dm) -> Mat: # <<<<<<<<<<<<<< * """Return the restriction matrix between this `DM` and the given `DM`. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DM.createRestriction", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_mat); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":1258 * return mat * * def convert(self, dm_type: DM.Type | str) -> DM: # <<<<<<<<<<<<<< * """Return a `DM` converted to another `DM`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_139convert(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_138convert, "DM.convert(self, dm_type: DM.Type | str) -> DM\nReturn a `DM` converted to another `DM`.\n\n Collective.\n\n Parameters\n ----------\n dm_type\n The new `DM.Type`, use ``\342\200\234same\342\200\235`` for the same type.\n\n See Also\n --------\n DM.Type, petsc.DMConvert\n\n \nSource code at petsc4py/PETSc/DM.pyx:1258"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_139convert(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_dm_type = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("convert (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dm_type,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dm_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 1258, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "convert") < 0)) __PYX_ERR(54, 1258, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_dm_type = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("convert", 1, 1, 1, __pyx_nargs); __PYX_ERR(54, 1258, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DM.convert", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_138convert(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_dm_type); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_138convert(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_dm_type) { DMType __pyx_v_cval; DM __pyx_v_newdm; struct PyPetscDMObject *__pyx_v_dm = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("convert", 0); __Pyx_INCREF(__pyx_v_dm_type); /* "petsc4py/PETSc/DM.pyx":1273 * * """ * cdef PetscDMType cval = NULL # <<<<<<<<<<<<<< * dm_type = str2bytes(dm_type, &cval) * cdef PetscDM newdm = NULL */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/DM.pyx":1274 * """ * cdef PetscDMType cval = NULL * dm_type = str2bytes(dm_type, &cval) # <<<<<<<<<<<<<< * cdef PetscDM newdm = NULL * CHKERR( DMConvert(self.dm, cval, &newdm) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_dm_type, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 1274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_dm_type, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DM.pyx":1275 * cdef PetscDMType cval = NULL * dm_type = str2bytes(dm_type, &cval) * cdef PetscDM newdm = NULL # <<<<<<<<<<<<<< * CHKERR( DMConvert(self.dm, cval, &newdm) ) * cdef DM dm = subtype_DM(newdm)() */ __pyx_v_newdm = NULL; /* "petsc4py/PETSc/DM.pyx":1276 * dm_type = str2bytes(dm_type, &cval) * cdef PetscDM newdm = NULL * CHKERR( DMConvert(self.dm, cval, &newdm) ) # <<<<<<<<<<<<<< * cdef DM dm = subtype_DM(newdm)() * dm.dm = newdm */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMConvert(__pyx_v_self->dm, __pyx_v_cval, (&__pyx_v_newdm))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1276, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":1277 * cdef PetscDM newdm = NULL * CHKERR( DMConvert(self.dm, cval, &newdm) ) * cdef DM dm = subtype_DM(newdm)() # <<<<<<<<<<<<<< * dm.dm = newdm * return dm */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_newdm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 1277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(54, 1277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_dm = ((struct PyPetscDMObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DM.pyx":1278 * CHKERR( DMConvert(self.dm, cval, &newdm) ) * cdef DM dm = subtype_DM(newdm)() * dm.dm = newdm # <<<<<<<<<<<<<< * return dm * */ __pyx_v_dm->dm = __pyx_v_newdm; /* "petsc4py/PETSc/DM.pyx":1279 * cdef DM dm = subtype_DM(newdm)() * dm.dm = newdm * return dm # <<<<<<<<<<<<<< * * def refine(self, comm: Comm | None = None) -> DM: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_dm); __pyx_r = ((PyObject *)__pyx_v_dm); goto __pyx_L0; /* "petsc4py/PETSc/DM.pyx":1258 * return mat * * def convert(self, dm_type: DM.Type | str) -> DM: # <<<<<<<<<<<<<< * """Return a `DM` converted to another `DM`. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DM.convert", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_dm); __Pyx_XDECREF(__pyx_v_dm_type); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":1281 * return dm * * def refine(self, comm: Comm | None = None) -> DM: # <<<<<<<<<<<<<< * """Return a refined `DM` object. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_141refine(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_140refine, "DM.refine(self, comm: Comm | None = None) -> DM\nReturn a refined `DM` object.\n\n Collective.\n\n Parameters\n ----------\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n petsc.DMRefine\n\n \nSource code at petsc4py/PETSc/DM.pyx:1281"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_141refine(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("refine (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 1281, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "refine") < 0)) __PYX_ERR(54, 1281, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_comm = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("refine", 0, 0, 1, __pyx_nargs); __PYX_ERR(54, 1281, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DM.refine", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_140refine(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_comm); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_140refine(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_dmcomm; DM __pyx_v_newdm; struct PyPetscDMObject *__pyx_v_dm = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; MPI_Comm __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("refine", 1); /* "petsc4py/PETSc/DM.pyx":1296 * * """ * cdef MPI_Comm dmcomm = MPI_COMM_NULL # <<<<<<<<<<<<<< * CHKERR( PetscObjectGetComm(self.dm, &dmcomm) ) * dmcomm = def_Comm(comm, dmcomm) */ __pyx_v_dmcomm = MPI_COMM_NULL; /* "petsc4py/PETSc/DM.pyx":1297 * """ * cdef MPI_Comm dmcomm = MPI_COMM_NULL * CHKERR( PetscObjectGetComm(self.dm, &dmcomm) ) # <<<<<<<<<<<<<< * dmcomm = def_Comm(comm, dmcomm) * cdef PetscDM newdm = NULL */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectGetComm(((PetscObject)__pyx_v_self->dm), (&__pyx_v_dmcomm))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1297, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":1298 * cdef MPI_Comm dmcomm = MPI_COMM_NULL * CHKERR( PetscObjectGetComm(self.dm, &dmcomm) ) * dmcomm = def_Comm(comm, dmcomm) # <<<<<<<<<<<<<< * cdef PetscDM newdm = NULL * CHKERR( DMRefine(self.dm, dmcomm, &newdm) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_dmcomm); if (unlikely(__pyx_t_2 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(54, 1298, __pyx_L1_error) __pyx_v_dmcomm = __pyx_t_2; /* "petsc4py/PETSc/DM.pyx":1299 * CHKERR( PetscObjectGetComm(self.dm, &dmcomm) ) * dmcomm = def_Comm(comm, dmcomm) * cdef PetscDM newdm = NULL # <<<<<<<<<<<<<< * CHKERR( DMRefine(self.dm, dmcomm, &newdm) ) * cdef DM dm = subtype_DM(newdm)() */ __pyx_v_newdm = NULL; /* "petsc4py/PETSc/DM.pyx":1300 * dmcomm = def_Comm(comm, dmcomm) * cdef PetscDM newdm = NULL * CHKERR( DMRefine(self.dm, dmcomm, &newdm) ) # <<<<<<<<<<<<<< * cdef DM dm = subtype_DM(newdm)() * dm.dm = newdm */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMRefine(__pyx_v_self->dm, __pyx_v_dmcomm, (&__pyx_v_newdm))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1300, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":1301 * cdef PetscDM newdm = NULL * CHKERR( DMRefine(self.dm, dmcomm, &newdm) ) * cdef DM dm = subtype_DM(newdm)() # <<<<<<<<<<<<<< * dm.dm = newdm * return dm */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_newdm)); if (unlikely(!__pyx_t_3)) __PYX_ERR(54, 1301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 1301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(54, 1301, __pyx_L1_error) __pyx_v_dm = ((struct PyPetscDMObject *)__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/DM.pyx":1302 * CHKERR( DMRefine(self.dm, dmcomm, &newdm) ) * cdef DM dm = subtype_DM(newdm)() * dm.dm = newdm # <<<<<<<<<<<<<< * return dm * */ __pyx_v_dm->dm = __pyx_v_newdm; /* "petsc4py/PETSc/DM.pyx":1303 * cdef DM dm = subtype_DM(newdm)() * dm.dm = newdm * return dm # <<<<<<<<<<<<<< * * def coarsen(self, comm: Comm | None = None) -> DM: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_dm); __pyx_r = ((PyObject *)__pyx_v_dm); goto __pyx_L0; /* "petsc4py/PETSc/DM.pyx":1281 * return dm * * def refine(self, comm: Comm | None = None) -> DM: # <<<<<<<<<<<<<< * """Return a refined `DM` object. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.DM.refine", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_dm); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":1305 * return dm * * def coarsen(self, comm: Comm | None = None) -> DM: # <<<<<<<<<<<<<< * """Return a coarsened `DM` object. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_143coarsen(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_142coarsen, "DM.coarsen(self, comm: Comm | None = None) -> DM\nReturn a coarsened `DM` object.\n\n Collective.\n\n Parameters\n ----------\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n petsc.DMCoarsen\n\n \nSource code at petsc4py/PETSc/DM.pyx:1305"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_143coarsen(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("coarsen (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 1305, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "coarsen") < 0)) __PYX_ERR(54, 1305, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_comm = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("coarsen", 0, 0, 1, __pyx_nargs); __PYX_ERR(54, 1305, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DM.coarsen", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_142coarsen(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_comm); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_142coarsen(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_dmcomm; DM __pyx_v_newdm; struct PyPetscDMObject *__pyx_v_dm = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; MPI_Comm __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("coarsen", 1); /* "petsc4py/PETSc/DM.pyx":1320 * * """ * cdef MPI_Comm dmcomm = MPI_COMM_NULL # <<<<<<<<<<<<<< * CHKERR( PetscObjectGetComm(self.dm, &dmcomm) ) * dmcomm = def_Comm(comm, dmcomm) */ __pyx_v_dmcomm = MPI_COMM_NULL; /* "petsc4py/PETSc/DM.pyx":1321 * """ * cdef MPI_Comm dmcomm = MPI_COMM_NULL * CHKERR( PetscObjectGetComm(self.dm, &dmcomm) ) # <<<<<<<<<<<<<< * dmcomm = def_Comm(comm, dmcomm) * cdef PetscDM newdm = NULL */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectGetComm(((PetscObject)__pyx_v_self->dm), (&__pyx_v_dmcomm))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1321, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":1322 * cdef MPI_Comm dmcomm = MPI_COMM_NULL * CHKERR( PetscObjectGetComm(self.dm, &dmcomm) ) * dmcomm = def_Comm(comm, dmcomm) # <<<<<<<<<<<<<< * cdef PetscDM newdm = NULL * CHKERR( DMCoarsen(self.dm, dmcomm, &newdm) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_dmcomm); if (unlikely(__pyx_t_2 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(54, 1322, __pyx_L1_error) __pyx_v_dmcomm = __pyx_t_2; /* "petsc4py/PETSc/DM.pyx":1323 * CHKERR( PetscObjectGetComm(self.dm, &dmcomm) ) * dmcomm = def_Comm(comm, dmcomm) * cdef PetscDM newdm = NULL # <<<<<<<<<<<<<< * CHKERR( DMCoarsen(self.dm, dmcomm, &newdm) ) * cdef DM dm = subtype_DM(newdm)() */ __pyx_v_newdm = NULL; /* "petsc4py/PETSc/DM.pyx":1324 * dmcomm = def_Comm(comm, dmcomm) * cdef PetscDM newdm = NULL * CHKERR( DMCoarsen(self.dm, dmcomm, &newdm) ) # <<<<<<<<<<<<<< * cdef DM dm = subtype_DM(newdm)() * dm.dm = newdm */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCoarsen(__pyx_v_self->dm, __pyx_v_dmcomm, (&__pyx_v_newdm))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1324, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":1325 * cdef PetscDM newdm = NULL * CHKERR( DMCoarsen(self.dm, dmcomm, &newdm) ) * cdef DM dm = subtype_DM(newdm)() # <<<<<<<<<<<<<< * dm.dm = newdm * return dm */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_newdm)); if (unlikely(!__pyx_t_3)) __PYX_ERR(54, 1325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 1325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(54, 1325, __pyx_L1_error) __pyx_v_dm = ((struct PyPetscDMObject *)__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/DM.pyx":1326 * CHKERR( DMCoarsen(self.dm, dmcomm, &newdm) ) * cdef DM dm = subtype_DM(newdm)() * dm.dm = newdm # <<<<<<<<<<<<<< * return dm * */ __pyx_v_dm->dm = __pyx_v_newdm; /* "petsc4py/PETSc/DM.pyx":1327 * cdef DM dm = subtype_DM(newdm)() * dm.dm = newdm * return dm # <<<<<<<<<<<<<< * * def refineHierarchy(self, nlevels: int) -> list: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_dm); __pyx_r = ((PyObject *)__pyx_v_dm); goto __pyx_L0; /* "petsc4py/PETSc/DM.pyx":1305 * return dm * * def coarsen(self, comm: Comm | None = None) -> DM: # <<<<<<<<<<<<<< * """Return a coarsened `DM` object. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.DM.coarsen", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_dm); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":1329 * return dm * * def refineHierarchy(self, nlevels: int) -> list: # <<<<<<<<<<<<<< * """Refine this `DM` and return the refined `DM` hierarchy. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_145refineHierarchy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_144refineHierarchy, "DM.refineHierarchy(self, nlevels: int) -> list\nRefine this `DM` and return the refined `DM` hierarchy.\n\n Collective.\n\n Parameters\n ----------\n nlevels\n The number of levels of refinement.\n\n See Also\n --------\n petsc.DMRefineHierarchy\n\n \nSource code at petsc4py/PETSc/DM.pyx:1329"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_145refineHierarchy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_nlevels = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("refineHierarchy (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nlevels,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_nlevels)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 1329, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "refineHierarchy") < 0)) __PYX_ERR(54, 1329, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_nlevels = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("refineHierarchy", 1, 1, 1, __pyx_nargs); __PYX_ERR(54, 1329, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DM.refineHierarchy", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_144refineHierarchy(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_nlevels); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_144refineHierarchy(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_nlevels) { PetscInt __pyx_v_i; PetscInt __pyx_v_n; DM *__pyx_v_newdmf; CYTHON_UNUSED PyObject *__pyx_v_tmp = 0; struct PyPetscDMObject *__pyx_v_dmf = 0; PyObject *__pyx_v_hierarchy = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PetscErrorCode __pyx_t_4; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("refineHierarchy", 1); /* "petsc4py/PETSc/DM.pyx":1344 * * """ * cdef PetscInt i, n = asInt(nlevels) # <<<<<<<<<<<<<< * cdef PetscDM *newdmf = NULL * cdef object tmp = oarray_p(empty_p(n), NULL, &newdmf) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_nlevels); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(54, 1344, __pyx_L1_error) __pyx_v_n = __pyx_t_1; /* "petsc4py/PETSc/DM.pyx":1345 * """ * cdef PetscInt i, n = asInt(nlevels) * cdef PetscDM *newdmf = NULL # <<<<<<<<<<<<<< * cdef object tmp = oarray_p(empty_p(n), NULL, &newdmf) * CHKERR( DMRefineHierarchy(self.dm, n, newdmf) ) */ __pyx_v_newdmf = NULL; /* "petsc4py/PETSc/DM.pyx":1346 * cdef PetscInt i, n = asInt(nlevels) * cdef PetscDM *newdmf = NULL * cdef object tmp = oarray_p(empty_p(n), NULL, &newdmf) # <<<<<<<<<<<<<< * CHKERR( DMRefineHierarchy(self.dm, n, newdmf) ) * cdef DM dmf = None */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_n)); if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 1346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_2, NULL, ((void **)(&__pyx_v_newdmf)))); if (unlikely(!__pyx_t_3)) __PYX_ERR(54, 1346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_tmp = __pyx_t_3; __pyx_t_3 = 0; /* "petsc4py/PETSc/DM.pyx":1347 * cdef PetscDM *newdmf = NULL * cdef object tmp = oarray_p(empty_p(n), NULL, &newdmf) * CHKERR( DMRefineHierarchy(self.dm, n, newdmf) ) # <<<<<<<<<<<<<< * cdef DM dmf = None * cdef list hierarchy = [] */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMRefineHierarchy(__pyx_v_self->dm, __pyx_v_n, __pyx_v_newdmf)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1347, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":1348 * cdef object tmp = oarray_p(empty_p(n), NULL, &newdmf) * CHKERR( DMRefineHierarchy(self.dm, n, newdmf) ) * cdef DM dmf = None # <<<<<<<<<<<<<< * cdef list hierarchy = [] * for i from 0 <= i < n: */ __Pyx_INCREF(Py_None); __pyx_v_dmf = ((struct PyPetscDMObject *)Py_None); /* "petsc4py/PETSc/DM.pyx":1349 * CHKERR( DMRefineHierarchy(self.dm, n, newdmf) ) * cdef DM dmf = None * cdef list hierarchy = [] # <<<<<<<<<<<<<< * for i from 0 <= i < n: * dmf = subtype_DM(newdmf[i])() */ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(54, 1349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_hierarchy = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/DM.pyx":1350 * cdef DM dmf = None * cdef list hierarchy = [] * for i from 0 <= i < n: # <<<<<<<<<<<<<< * dmf = subtype_DM(newdmf[i])() * dmf.dm = newdmf[i] */ __pyx_t_1 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { /* "petsc4py/PETSc/DM.pyx":1351 * cdef list hierarchy = [] * for i from 0 <= i < n: * dmf = subtype_DM(newdmf[i])() # <<<<<<<<<<<<<< * dmf.dm = newdmf[i] * hierarchy.append(dmf) */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM((__pyx_v_newdmf[__pyx_v_i]))); if (unlikely(!__pyx_t_3)) __PYX_ERR(54, 1351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 1351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(54, 1351, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_dmf, ((struct PyPetscDMObject *)__pyx_t_2)); __pyx_t_2 = 0; /* "petsc4py/PETSc/DM.pyx":1352 * for i from 0 <= i < n: * dmf = subtype_DM(newdmf[i])() * dmf.dm = newdmf[i] # <<<<<<<<<<<<<< * hierarchy.append(dmf) * return hierarchy */ __pyx_v_dmf->dm = (__pyx_v_newdmf[__pyx_v_i]); /* "petsc4py/PETSc/DM.pyx":1353 * dmf = subtype_DM(newdmf[i])() * dmf.dm = newdmf[i] * hierarchy.append(dmf) # <<<<<<<<<<<<<< * return hierarchy * */ __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_hierarchy, ((PyObject *)__pyx_v_dmf)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(54, 1353, __pyx_L1_error) } /* "petsc4py/PETSc/DM.pyx":1354 * dmf.dm = newdmf[i] * hierarchy.append(dmf) * return hierarchy # <<<<<<<<<<<<<< * * def coarsenHierarchy(self, nlevels: int) -> list: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_hierarchy); __pyx_r = __pyx_v_hierarchy; goto __pyx_L0; /* "petsc4py/PETSc/DM.pyx":1329 * return dm * * def refineHierarchy(self, nlevels: int) -> list: # <<<<<<<<<<<<<< * """Refine this `DM` and return the refined `DM` hierarchy. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DM.refineHierarchy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_tmp); __Pyx_XDECREF((PyObject *)__pyx_v_dmf); __Pyx_XDECREF(__pyx_v_hierarchy); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":1356 * return hierarchy * * def coarsenHierarchy(self, nlevels: int) -> list: # <<<<<<<<<<<<<< * """Coarsen this `DM` and return the coarsened `DM` hierarchy. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_147coarsenHierarchy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_146coarsenHierarchy, "DM.coarsenHierarchy(self, nlevels: int) -> list\nCoarsen this `DM` and return the coarsened `DM` hierarchy.\n\n Collective.\n\n Parameters\n ----------\n nlevels\n The number of levels of coarsening.\n\n See Also\n --------\n petsc.DMCoarsenHierarchy\n\n \nSource code at petsc4py/PETSc/DM.pyx:1356"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_147coarsenHierarchy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_nlevels = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("coarsenHierarchy (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nlevels,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_nlevels)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 1356, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "coarsenHierarchy") < 0)) __PYX_ERR(54, 1356, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_nlevels = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("coarsenHierarchy", 1, 1, 1, __pyx_nargs); __PYX_ERR(54, 1356, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DM.coarsenHierarchy", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_146coarsenHierarchy(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_nlevels); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_146coarsenHierarchy(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_nlevels) { PetscInt __pyx_v_i; PetscInt __pyx_v_n; DM *__pyx_v_newdmc; CYTHON_UNUSED PyObject *__pyx_v_tmp = 0; struct PyPetscDMObject *__pyx_v_dmc = 0; PyObject *__pyx_v_hierarchy = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PetscErrorCode __pyx_t_4; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("coarsenHierarchy", 1); /* "petsc4py/PETSc/DM.pyx":1371 * * """ * cdef PetscInt i, n = asInt(nlevels) # <<<<<<<<<<<<<< * cdef PetscDM *newdmc = NULL * cdef object tmp = oarray_p(empty_p(n),NULL, &newdmc) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_nlevels); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(54, 1371, __pyx_L1_error) __pyx_v_n = __pyx_t_1; /* "petsc4py/PETSc/DM.pyx":1372 * """ * cdef PetscInt i, n = asInt(nlevels) * cdef PetscDM *newdmc = NULL # <<<<<<<<<<<<<< * cdef object tmp = oarray_p(empty_p(n),NULL, &newdmc) * CHKERR( DMCoarsenHierarchy(self.dm, n, newdmc) ) */ __pyx_v_newdmc = NULL; /* "petsc4py/PETSc/DM.pyx":1373 * cdef PetscInt i, n = asInt(nlevels) * cdef PetscDM *newdmc = NULL * cdef object tmp = oarray_p(empty_p(n),NULL, &newdmc) # <<<<<<<<<<<<<< * CHKERR( DMCoarsenHierarchy(self.dm, n, newdmc) ) * cdef DM dmc = None */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_n)); if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 1373, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_2, NULL, ((void **)(&__pyx_v_newdmc)))); if (unlikely(!__pyx_t_3)) __PYX_ERR(54, 1373, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_tmp = __pyx_t_3; __pyx_t_3 = 0; /* "petsc4py/PETSc/DM.pyx":1374 * cdef PetscDM *newdmc = NULL * cdef object tmp = oarray_p(empty_p(n),NULL, &newdmc) * CHKERR( DMCoarsenHierarchy(self.dm, n, newdmc) ) # <<<<<<<<<<<<<< * cdef DM dmc = None * cdef list hierarchy = [] */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCoarsenHierarchy(__pyx_v_self->dm, __pyx_v_n, __pyx_v_newdmc)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1374, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":1375 * cdef object tmp = oarray_p(empty_p(n),NULL, &newdmc) * CHKERR( DMCoarsenHierarchy(self.dm, n, newdmc) ) * cdef DM dmc = None # <<<<<<<<<<<<<< * cdef list hierarchy = [] * for i from 0 <= i < n: */ __Pyx_INCREF(Py_None); __pyx_v_dmc = ((struct PyPetscDMObject *)Py_None); /* "petsc4py/PETSc/DM.pyx":1376 * CHKERR( DMCoarsenHierarchy(self.dm, n, newdmc) ) * cdef DM dmc = None * cdef list hierarchy = [] # <<<<<<<<<<<<<< * for i from 0 <= i < n: * dmc = subtype_DM(newdmc[i])() */ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(54, 1376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_hierarchy = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/DM.pyx":1377 * cdef DM dmc = None * cdef list hierarchy = [] * for i from 0 <= i < n: # <<<<<<<<<<<<<< * dmc = subtype_DM(newdmc[i])() * dmc.dm = newdmc[i] */ __pyx_t_1 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { /* "petsc4py/PETSc/DM.pyx":1378 * cdef list hierarchy = [] * for i from 0 <= i < n: * dmc = subtype_DM(newdmc[i])() # <<<<<<<<<<<<<< * dmc.dm = newdmc[i] * hierarchy.append(dmc) */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM((__pyx_v_newdmc[__pyx_v_i]))); if (unlikely(!__pyx_t_3)) __PYX_ERR(54, 1378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 1378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(54, 1378, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_dmc, ((struct PyPetscDMObject *)__pyx_t_2)); __pyx_t_2 = 0; /* "petsc4py/PETSc/DM.pyx":1379 * for i from 0 <= i < n: * dmc = subtype_DM(newdmc[i])() * dmc.dm = newdmc[i] # <<<<<<<<<<<<<< * hierarchy.append(dmc) * return hierarchy */ __pyx_v_dmc->dm = (__pyx_v_newdmc[__pyx_v_i]); /* "petsc4py/PETSc/DM.pyx":1380 * dmc = subtype_DM(newdmc[i])() * dmc.dm = newdmc[i] * hierarchy.append(dmc) # <<<<<<<<<<<<<< * return hierarchy * */ __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_hierarchy, ((PyObject *)__pyx_v_dmc)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(54, 1380, __pyx_L1_error) } /* "petsc4py/PETSc/DM.pyx":1381 * dmc.dm = newdmc[i] * hierarchy.append(dmc) * return hierarchy # <<<<<<<<<<<<<< * * def getRefineLevel(self) -> int: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_hierarchy); __pyx_r = __pyx_v_hierarchy; goto __pyx_L0; /* "petsc4py/PETSc/DM.pyx":1356 * return hierarchy * * def coarsenHierarchy(self, nlevels: int) -> list: # <<<<<<<<<<<<<< * """Coarsen this `DM` and return the coarsened `DM` hierarchy. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DM.coarsenHierarchy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_tmp); __Pyx_XDECREF((PyObject *)__pyx_v_dmc); __Pyx_XDECREF(__pyx_v_hierarchy); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":1383 * return hierarchy * * def getRefineLevel(self) -> int: # <<<<<<<<<<<<<< * """Return the refinement level. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_149getRefineLevel(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_148getRefineLevel, "DM.getRefineLevel(self) -> int\nReturn the refinement level.\n\n Not collective.\n\n See Also\n --------\n petsc.DMGetRefineLevel\n\n \nSource code at petsc4py/PETSc/DM.pyx:1383"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_149getRefineLevel(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getRefineLevel (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getRefineLevel", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getRefineLevel", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_148getRefineLevel(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_148getRefineLevel(struct PyPetscDMObject *__pyx_v_self) { PetscInt __pyx_v_n; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getRefineLevel", 1); /* "petsc4py/PETSc/DM.pyx":1393 * * """ * cdef PetscInt n = 0 # <<<<<<<<<<<<<< * CHKERR( DMGetRefineLevel(self.dm, &n) ) * return toInt(n) */ __pyx_v_n = 0; /* "petsc4py/PETSc/DM.pyx":1394 * """ * cdef PetscInt n = 0 * CHKERR( DMGetRefineLevel(self.dm, &n) ) # <<<<<<<<<<<<<< * return toInt(n) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetRefineLevel(__pyx_v_self->dm, (&__pyx_v_n))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1394, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":1395 * cdef PetscInt n = 0 * CHKERR( DMGetRefineLevel(self.dm, &n) ) * return toInt(n) # <<<<<<<<<<<<<< * * def setRefineLevel(self, level: int) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 1395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DM.pyx":1383 * return hierarchy * * def getRefineLevel(self) -> int: # <<<<<<<<<<<<<< * """Return the refinement level. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DM.getRefineLevel", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":1397 * return toInt(n) * * def setRefineLevel(self, level: int) -> None: # <<<<<<<<<<<<<< * """Set the number of refinements. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_151setRefineLevel(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_150setRefineLevel, "DM.setRefineLevel(self, level: int) -> None\nSet the number of refinements.\n\n Not collective.\n\n Parameters\n ----------\n nlevels\n The number of refinement.\n\n See Also\n --------\n petsc.DMSetRefineLevel\n\n \nSource code at petsc4py/PETSc/DM.pyx:1397"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_151setRefineLevel(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_level = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setRefineLevel (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_level)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 1397, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setRefineLevel") < 0)) __PYX_ERR(54, 1397, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_level = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setRefineLevel", 1, 1, 1, __pyx_nargs); __PYX_ERR(54, 1397, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DM.setRefineLevel", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_150setRefineLevel(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_level); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_150setRefineLevel(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_level) { PetscInt __pyx_v_clevel; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setRefineLevel", 1); /* "petsc4py/PETSc/DM.pyx":1412 * * """ * cdef PetscInt clevel = asInt(level) # <<<<<<<<<<<<<< * CHKERR( DMSetRefineLevel(self.dm, clevel) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_level); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(54, 1412, __pyx_L1_error) __pyx_v_clevel = __pyx_t_1; /* "petsc4py/PETSc/DM.pyx":1413 * """ * cdef PetscInt clevel = asInt(level) * CHKERR( DMSetRefineLevel(self.dm, clevel) ) # <<<<<<<<<<<<<< * * def getCoarsenLevel(self) -> int: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSetRefineLevel(__pyx_v_self->dm, __pyx_v_clevel)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1413, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":1397 * return toInt(n) * * def setRefineLevel(self, level: int) -> None: # <<<<<<<<<<<<<< * """Set the number of refinements. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.setRefineLevel", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":1415 * CHKERR( DMSetRefineLevel(self.dm, clevel) ) * * def getCoarsenLevel(self) -> int: # <<<<<<<<<<<<<< * """Return the number of coarsenings. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_153getCoarsenLevel(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_152getCoarsenLevel, "DM.getCoarsenLevel(self) -> int\nReturn the number of coarsenings.\n\n Not collective.\n\n See Also\n --------\n petsc.DMGetCoarsenLevel\n\n \nSource code at petsc4py/PETSc/DM.pyx:1415"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_153getCoarsenLevel(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getCoarsenLevel (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getCoarsenLevel", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getCoarsenLevel", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_152getCoarsenLevel(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_152getCoarsenLevel(struct PyPetscDMObject *__pyx_v_self) { PetscInt __pyx_v_n; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getCoarsenLevel", 1); /* "petsc4py/PETSc/DM.pyx":1425 * * """ * cdef PetscInt n = 0 # <<<<<<<<<<<<<< * CHKERR( DMGetCoarsenLevel(self.dm, &n) ) * return toInt(n) */ __pyx_v_n = 0; /* "petsc4py/PETSc/DM.pyx":1426 * """ * cdef PetscInt n = 0 * CHKERR( DMGetCoarsenLevel(self.dm, &n) ) # <<<<<<<<<<<<<< * return toInt(n) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetCoarsenLevel(__pyx_v_self->dm, (&__pyx_v_n))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1426, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":1427 * cdef PetscInt n = 0 * CHKERR( DMGetCoarsenLevel(self.dm, &n) ) * return toInt(n) # <<<<<<<<<<<<<< * * # */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 1427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DM.pyx":1415 * CHKERR( DMSetRefineLevel(self.dm, clevel) ) * * def getCoarsenLevel(self) -> int: # <<<<<<<<<<<<<< * """Return the number of coarsenings. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DM.getCoarsenLevel", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":1431 * # * * def adaptLabel(self, label: str) -> DM: # <<<<<<<<<<<<<< * """Adapt a `DM` based on a `DMLabel`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_155adaptLabel(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_154adaptLabel, "DM.adaptLabel(self, label: str) -> DM\nAdapt a `DM` based on a `DMLabel`.\n\n Collective.\n\n Parameters\n ----------\n label\n The name of the `DMLabel`.\n\n See Also\n --------\n petsc.DMAdaptLabel\n\n \nSource code at petsc4py/PETSc/DM.pyx:1431"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_155adaptLabel(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_label = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("adaptLabel (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_label,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_label)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 1431, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "adaptLabel") < 0)) __PYX_ERR(54, 1431, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_label = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("adaptLabel", 1, 1, 1, __pyx_nargs); __PYX_ERR(54, 1431, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DM.adaptLabel", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_154adaptLabel(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_label); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_154adaptLabel(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_label) { char const *__pyx_v_cval; DMLabel __pyx_v_clbl; struct PyPetscDMObject *__pyx_v_newdm = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("adaptLabel", 0); __Pyx_INCREF(__pyx_v_label); /* "petsc4py/PETSc/DM.pyx":1446 * * """ * cdef const char *cval = NULL # <<<<<<<<<<<<<< * cdef PetscDMLabel clbl = NULL * label = str2bytes(label, &cval) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/DM.pyx":1447 * """ * cdef const char *cval = NULL * cdef PetscDMLabel clbl = NULL # <<<<<<<<<<<<<< * label = str2bytes(label, &cval) * CHKERR( DMGetLabel(self.dm, cval, &clbl) ) */ __pyx_v_clbl = NULL; /* "petsc4py/PETSc/DM.pyx":1448 * cdef const char *cval = NULL * cdef PetscDMLabel clbl = NULL * label = str2bytes(label, &cval) # <<<<<<<<<<<<<< * CHKERR( DMGetLabel(self.dm, cval, &clbl) ) * cdef DM newdm = DMPlex() */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_label, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 1448, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_label, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DM.pyx":1449 * cdef PetscDMLabel clbl = NULL * label = str2bytes(label, &cval) * CHKERR( DMGetLabel(self.dm, cval, &clbl) ) # <<<<<<<<<<<<<< * cdef DM newdm = DMPlex() * CHKERR( DMAdaptLabel(self.dm, clbl, &newdm.dm) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetLabel(__pyx_v_self->dm, __pyx_v_cval, (&__pyx_v_clbl))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1449, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":1450 * label = str2bytes(label, &cval) * CHKERR( DMGetLabel(self.dm, cval, &clbl) ) * cdef DM newdm = DMPlex() # <<<<<<<<<<<<<< * CHKERR( DMAdaptLabel(self.dm, clbl, &newdm.dm) ) * return newdm */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DMPlex)); if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 1450, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_newdm = ((struct PyPetscDMObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DM.pyx":1451 * CHKERR( DMGetLabel(self.dm, cval, &clbl) ) * cdef DM newdm = DMPlex() * CHKERR( DMAdaptLabel(self.dm, clbl, &newdm.dm) ) # <<<<<<<<<<<<<< * return newdm * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMAdaptLabel(__pyx_v_self->dm, __pyx_v_clbl, (&__pyx_v_newdm->dm))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1451, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":1452 * cdef DM newdm = DMPlex() * CHKERR( DMAdaptLabel(self.dm, clbl, &newdm.dm) ) * return newdm # <<<<<<<<<<<<<< * * def adaptMetric( */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_newdm); __pyx_r = ((PyObject *)__pyx_v_newdm); goto __pyx_L0; /* "petsc4py/PETSc/DM.pyx":1431 * # * * def adaptLabel(self, label: str) -> DM: # <<<<<<<<<<<<<< * """Adapt a `DM` based on a `DMLabel`. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DM.adaptLabel", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_newdm); __Pyx_XDECREF(__pyx_v_label); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":1454 * return newdm * * def adaptMetric( # <<<<<<<<<<<<<< * self, * Vec metric, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_157adaptMetric(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_156adaptMetric, "DM.adaptMetric(self, metric: Vec, bdLabel: str | None = None, rgLabel: str | None = None) -> DM\nReturn a mesh adapted to the specified metric field.\n\n Parameters\n ----------\n metric\n The metric to which the mesh is adapted, defined vertex-wise.\n bdLabel\n Label for boundary tags.\n rgLabel\n Label for cell tag.\n\n See Also\n --------\n petsc.DMAdaptMetric\n\n \nSource code at petsc4py/PETSc/DM.pyx:1454"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_157adaptMetric(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_metric = 0; PyObject *__pyx_v_bdLabel = 0; PyObject *__pyx_v_rgLabel = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("adaptMetric (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_metric,&__pyx_n_s_bdLabel,&__pyx_n_s_rgLabel,0}; /* "petsc4py/PETSc/DM.pyx":1457 * self, * Vec metric, * bdLabel: str | None = None, # <<<<<<<<<<<<<< * rgLabel: str | None = None, * ) -> DM: */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/DM.pyx":1458 * Vec metric, * bdLabel: str | None = None, * rgLabel: str | None = None, # <<<<<<<<<<<<<< * ) -> DM: * """Return a mesh adapted to the specified metric field. */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_metric)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 1454, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_bdLabel); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 1454, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rgLabel); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 1454, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "adaptMetric") < 0)) __PYX_ERR(54, 1454, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_metric = ((struct PyPetscVecObject *)values[0]); __pyx_v_bdLabel = values[1]; __pyx_v_rgLabel = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("adaptMetric", 0, 1, 3, __pyx_nargs); __PYX_ERR(54, 1454, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DM.adaptMetric", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_metric), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "metric", 0))) __PYX_ERR(54, 1456, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_156adaptMetric(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_metric, __pyx_v_bdLabel, __pyx_v_rgLabel); /* "petsc4py/PETSc/DM.pyx":1454 * return newdm * * def adaptMetric( # <<<<<<<<<<<<<< * self, * Vec metric, */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_156adaptMetric(struct PyPetscDMObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_metric, PyObject *__pyx_v_bdLabel, PyObject *__pyx_v_rgLabel) { char const *__pyx_v_cval; DMLabel __pyx_v_cbdlbl; DMLabel __pyx_v_crglbl; struct PyPetscDMObject *__pyx_v_newdm = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("adaptMetric", 0); __Pyx_INCREF(__pyx_v_bdLabel); __Pyx_INCREF(__pyx_v_rgLabel); /* "petsc4py/PETSc/DM.pyx":1476 * * """ * cdef const char *cval = NULL # <<<<<<<<<<<<<< * cdef PetscDMLabel cbdlbl = NULL * cdef PetscDMLabel crglbl = NULL */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/DM.pyx":1477 * """ * cdef const char *cval = NULL * cdef PetscDMLabel cbdlbl = NULL # <<<<<<<<<<<<<< * cdef PetscDMLabel crglbl = NULL * bdLabel = str2bytes(bdLabel, &cval) */ __pyx_v_cbdlbl = NULL; /* "petsc4py/PETSc/DM.pyx":1478 * cdef const char *cval = NULL * cdef PetscDMLabel cbdlbl = NULL * cdef PetscDMLabel crglbl = NULL # <<<<<<<<<<<<<< * bdLabel = str2bytes(bdLabel, &cval) * if cval == NULL: cval = b"" # XXX Should be fixed upstream */ __pyx_v_crglbl = NULL; /* "petsc4py/PETSc/DM.pyx":1479 * cdef PetscDMLabel cbdlbl = NULL * cdef PetscDMLabel crglbl = NULL * bdLabel = str2bytes(bdLabel, &cval) # <<<<<<<<<<<<<< * if cval == NULL: cval = b"" # XXX Should be fixed upstream * CHKERR( DMGetLabel(self.dm, cval, &cbdlbl) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_bdLabel, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 1479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_bdLabel, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DM.pyx":1480 * cdef PetscDMLabel crglbl = NULL * bdLabel = str2bytes(bdLabel, &cval) * if cval == NULL: cval = b"" # XXX Should be fixed upstream # <<<<<<<<<<<<<< * CHKERR( DMGetLabel(self.dm, cval, &cbdlbl) ) * rgLabel = str2bytes(rgLabel, &cval) */ __pyx_t_2 = (__pyx_v_cval == NULL); if (__pyx_t_2) { __pyx_v_cval = ((char const *)""); } /* "petsc4py/PETSc/DM.pyx":1481 * bdLabel = str2bytes(bdLabel, &cval) * if cval == NULL: cval = b"" # XXX Should be fixed upstream * CHKERR( DMGetLabel(self.dm, cval, &cbdlbl) ) # <<<<<<<<<<<<<< * rgLabel = str2bytes(rgLabel, &cval) * if cval == NULL: cval = b"" # XXX Should be fixed upstream */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetLabel(__pyx_v_self->dm, __pyx_v_cval, (&__pyx_v_cbdlbl))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1481, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":1482 * if cval == NULL: cval = b"" # XXX Should be fixed upstream * CHKERR( DMGetLabel(self.dm, cval, &cbdlbl) ) * rgLabel = str2bytes(rgLabel, &cval) # <<<<<<<<<<<<<< * if cval == NULL: cval = b"" # XXX Should be fixed upstream * CHKERR( DMGetLabel(self.dm, cval, &crglbl) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_rgLabel, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 1482, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_rgLabel, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DM.pyx":1483 * CHKERR( DMGetLabel(self.dm, cval, &cbdlbl) ) * rgLabel = str2bytes(rgLabel, &cval) * if cval == NULL: cval = b"" # XXX Should be fixed upstream # <<<<<<<<<<<<<< * CHKERR( DMGetLabel(self.dm, cval, &crglbl) ) * cdef DM newdm = DMPlex() */ __pyx_t_2 = (__pyx_v_cval == NULL); if (__pyx_t_2) { __pyx_v_cval = ((char const *)""); } /* "petsc4py/PETSc/DM.pyx":1484 * rgLabel = str2bytes(rgLabel, &cval) * if cval == NULL: cval = b"" # XXX Should be fixed upstream * CHKERR( DMGetLabel(self.dm, cval, &crglbl) ) # <<<<<<<<<<<<<< * cdef DM newdm = DMPlex() * CHKERR( DMAdaptMetric(self.dm, metric.vec, cbdlbl, crglbl, &newdm.dm) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetLabel(__pyx_v_self->dm, __pyx_v_cval, (&__pyx_v_crglbl))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1484, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":1485 * if cval == NULL: cval = b"" # XXX Should be fixed upstream * CHKERR( DMGetLabel(self.dm, cval, &crglbl) ) * cdef DM newdm = DMPlex() # <<<<<<<<<<<<<< * CHKERR( DMAdaptMetric(self.dm, metric.vec, cbdlbl, crglbl, &newdm.dm) ) * return newdm */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DMPlex)); if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 1485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_newdm = ((struct PyPetscDMObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DM.pyx":1486 * CHKERR( DMGetLabel(self.dm, cval, &crglbl) ) * cdef DM newdm = DMPlex() * CHKERR( DMAdaptMetric(self.dm, metric.vec, cbdlbl, crglbl, &newdm.dm) ) # <<<<<<<<<<<<<< * return newdm * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMAdaptMetric(__pyx_v_self->dm, __pyx_v_metric->vec, __pyx_v_cbdlbl, __pyx_v_crglbl, (&__pyx_v_newdm->dm))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1486, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":1487 * cdef DM newdm = DMPlex() * CHKERR( DMAdaptMetric(self.dm, metric.vec, cbdlbl, crglbl, &newdm.dm) ) * return newdm # <<<<<<<<<<<<<< * * def getLabel(self, name: str) -> DMLabel: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_newdm); __pyx_r = ((PyObject *)__pyx_v_newdm); goto __pyx_L0; /* "petsc4py/PETSc/DM.pyx":1454 * return newdm * * def adaptMetric( # <<<<<<<<<<<<<< * self, * Vec metric, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DM.adaptMetric", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_newdm); __Pyx_XDECREF(__pyx_v_bdLabel); __Pyx_XDECREF(__pyx_v_rgLabel); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":1489 * return newdm * * def getLabel(self, name: str) -> DMLabel: # <<<<<<<<<<<<<< * """Return the label of a given name. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_159getLabel(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_158getLabel, "DM.getLabel(self, name: str) -> DMLabel\nReturn the label of a given name.\n\n Not collective.\n\n See Also\n --------\n petsc.DMGetLabel\n\n \nSource code at petsc4py/PETSc/DM.pyx:1489"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_159getLabel(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_name = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getLabel (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 1489, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getLabel") < 0)) __PYX_ERR(54, 1489, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_name = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getLabel", 1, 1, 1, __pyx_nargs); __PYX_ERR(54, 1489, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DM.getLabel", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_158getLabel(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_name); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_158getLabel(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name) { char const *__pyx_v_cname; struct PyPetscDMLabelObject *__pyx_v_dmlabel = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getLabel", 0); __Pyx_INCREF(__pyx_v_name); /* "petsc4py/PETSc/DM.pyx":1499 * * """ * cdef const char *cname = NULL # <<<<<<<<<<<<<< * cdef DMLabel dmlabel = DMLabel() * name = str2bytes(name, &cname) */ __pyx_v_cname = NULL; /* "petsc4py/PETSc/DM.pyx":1500 * """ * cdef const char *cname = NULL * cdef DMLabel dmlabel = DMLabel() # <<<<<<<<<<<<<< * name = str2bytes(name, &cname) * CHKERR( DMGetLabel(self.dm, cname, &dmlabel.dmlabel) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DMLabel)); if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 1500, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_dmlabel = ((struct PyPetscDMLabelObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DM.pyx":1501 * cdef const char *cname = NULL * cdef DMLabel dmlabel = DMLabel() * name = str2bytes(name, &cname) # <<<<<<<<<<<<<< * CHKERR( DMGetLabel(self.dm, cname, &dmlabel.dmlabel) ) * CHKERR( PetscINCREF(dmlabel.obj) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cname)); if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 1501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DM.pyx":1502 * cdef DMLabel dmlabel = DMLabel() * name = str2bytes(name, &cname) * CHKERR( DMGetLabel(self.dm, cname, &dmlabel.dmlabel) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(dmlabel.obj) ) * return dmlabel */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetLabel(__pyx_v_self->dm, __pyx_v_cname, (&__pyx_v_dmlabel->dmlabel))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1502, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":1503 * name = str2bytes(name, &cname) * CHKERR( DMGetLabel(self.dm, cname, &dmlabel.dmlabel) ) * CHKERR( PetscINCREF(dmlabel.obj) ) # <<<<<<<<<<<<<< * return dmlabel * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_dmlabel->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1503, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":1504 * CHKERR( DMGetLabel(self.dm, cname, &dmlabel.dmlabel) ) * CHKERR( PetscINCREF(dmlabel.obj) ) * return dmlabel # <<<<<<<<<<<<<< * * # */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_dmlabel); __pyx_r = ((PyObject *)__pyx_v_dmlabel); goto __pyx_L0; /* "petsc4py/PETSc/DM.pyx":1489 * return newdm * * def getLabel(self, name: str) -> DMLabel: # <<<<<<<<<<<<<< * """Return the label of a given name. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DM.getLabel", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_dmlabel); __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":1508 * # * * def setLocalSection(self, Section sec) -> None: # <<<<<<<<<<<<<< * """Set the `Section` encoding the local data layout for the `DM`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_161setLocalSection(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_160setLocalSection, "DM.setLocalSection(self, sec: Section) -> None\nSet the `Section` encoding the local data layout for the `DM`.\n\n See Also\n --------\n petsc.DMSetLocalSection\n\n \nSource code at petsc4py/PETSc/DM.pyx:1508"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_161setLocalSection(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscSectionObject *__pyx_v_sec = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setLocalSection (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sec,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sec)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 1508, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setLocalSection") < 0)) __PYX_ERR(54, 1508, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_sec = ((struct PyPetscSectionObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setLocalSection", 1, 1, 1, __pyx_nargs); __PYX_ERR(54, 1508, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DM.setLocalSection", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sec), __pyx_ptype_8petsc4py_5PETSc_Section, 0, "sec", 0))) __PYX_ERR(54, 1508, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_160setLocalSection(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_sec); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_160setLocalSection(struct PyPetscDMObject *__pyx_v_self, struct PyPetscSectionObject *__pyx_v_sec) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setLocalSection", 1); /* "petsc4py/PETSc/DM.pyx":1516 * * """ * CHKERR( DMSetLocalSection(self.dm, sec.sec) ) # <<<<<<<<<<<<<< * * def getLocalSection(self) -> Section: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSetLocalSection(__pyx_v_self->dm, __pyx_v_sec->sec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1516, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":1508 * # * * def setLocalSection(self, Section sec) -> None: # <<<<<<<<<<<<<< * """Set the `Section` encoding the local data layout for the `DM`. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.setLocalSection", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":1518 * CHKERR( DMSetLocalSection(self.dm, sec.sec) ) * * def getLocalSection(self) -> Section: # <<<<<<<<<<<<<< * """Return the `Section` encoding the local data layout for the `DM`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_163getLocalSection(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_162getLocalSection, "DM.getLocalSection(self) -> Section\nReturn the `Section` encoding the local data layout for the `DM`.\n\n See Also\n --------\n petsc.DMGetGlobalSection\n\n \nSource code at petsc4py/PETSc/DM.pyx:1518"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_163getLocalSection(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getLocalSection (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getLocalSection", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getLocalSection", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_162getLocalSection(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_162getLocalSection(struct PyPetscDMObject *__pyx_v_self) { struct PyPetscSectionObject *__pyx_v_sec = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getLocalSection", 1); /* "petsc4py/PETSc/DM.pyx":1526 * * """ * cdef Section sec = Section() # <<<<<<<<<<<<<< * CHKERR( DMGetLocalSection(self.dm, &sec.sec) ) * CHKERR( PetscINCREF(sec.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Section)); if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 1526, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_sec = ((struct PyPetscSectionObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DM.pyx":1527 * """ * cdef Section sec = Section() * CHKERR( DMGetLocalSection(self.dm, &sec.sec) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(sec.obj) ) * return sec */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetLocalSection(__pyx_v_self->dm, (&__pyx_v_sec->sec))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1527, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":1528 * cdef Section sec = Section() * CHKERR( DMGetLocalSection(self.dm, &sec.sec) ) * CHKERR( PetscINCREF(sec.obj) ) # <<<<<<<<<<<<<< * return sec * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_sec->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1528, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":1529 * CHKERR( DMGetLocalSection(self.dm, &sec.sec) ) * CHKERR( PetscINCREF(sec.obj) ) * return sec # <<<<<<<<<<<<<< * * def setGlobalSection(self, Section sec) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_sec); __pyx_r = ((PyObject *)__pyx_v_sec); goto __pyx_L0; /* "petsc4py/PETSc/DM.pyx":1518 * CHKERR( DMSetLocalSection(self.dm, sec.sec) ) * * def getLocalSection(self) -> Section: # <<<<<<<<<<<<<< * """Return the `Section` encoding the local data layout for the `DM`. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DM.getLocalSection", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_sec); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":1531 * return sec * * def setGlobalSection(self, Section sec) -> None: # <<<<<<<<<<<<<< * """Set the `Section` encoding the global data layout for the `DM`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_165setGlobalSection(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_164setGlobalSection, "DM.setGlobalSection(self, sec: Section) -> None\nSet the `Section` encoding the global data layout for the `DM`.\n\n See Also\n --------\n petsc.DMSetGlobalSection\n\n \nSource code at petsc4py/PETSc/DM.pyx:1531"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_165setGlobalSection(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscSectionObject *__pyx_v_sec = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setGlobalSection (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sec,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sec)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 1531, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setGlobalSection") < 0)) __PYX_ERR(54, 1531, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_sec = ((struct PyPetscSectionObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setGlobalSection", 1, 1, 1, __pyx_nargs); __PYX_ERR(54, 1531, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DM.setGlobalSection", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sec), __pyx_ptype_8petsc4py_5PETSc_Section, 0, "sec", 0))) __PYX_ERR(54, 1531, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_164setGlobalSection(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_sec); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_164setGlobalSection(struct PyPetscDMObject *__pyx_v_self, struct PyPetscSectionObject *__pyx_v_sec) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setGlobalSection", 1); /* "petsc4py/PETSc/DM.pyx":1539 * * """ * CHKERR( DMSetGlobalSection(self.dm, sec.sec) ) # <<<<<<<<<<<<<< * * def getGlobalSection(self) -> Section: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSetGlobalSection(__pyx_v_self->dm, __pyx_v_sec->sec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1539, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":1531 * return sec * * def setGlobalSection(self, Section sec) -> None: # <<<<<<<<<<<<<< * """Set the `Section` encoding the global data layout for the `DM`. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.setGlobalSection", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":1541 * CHKERR( DMSetGlobalSection(self.dm, sec.sec) ) * * def getGlobalSection(self) -> Section: # <<<<<<<<<<<<<< * """Return the `Section` encoding the global data layout for the `DM`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_167getGlobalSection(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_166getGlobalSection, "DM.getGlobalSection(self) -> Section\nReturn the `Section` encoding the global data layout for the `DM`.\n\n See Also\n --------\n petsc.DMGetGlobalSection\n\n \nSource code at petsc4py/PETSc/DM.pyx:1541"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_167getGlobalSection(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getGlobalSection (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getGlobalSection", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getGlobalSection", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_166getGlobalSection(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_166getGlobalSection(struct PyPetscDMObject *__pyx_v_self) { struct PyPetscSectionObject *__pyx_v_sec = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getGlobalSection", 1); /* "petsc4py/PETSc/DM.pyx":1549 * * """ * cdef Section sec = Section() # <<<<<<<<<<<<<< * CHKERR( DMGetGlobalSection(self.dm, &sec.sec) ) * CHKERR( PetscINCREF(sec.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Section)); if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 1549, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_sec = ((struct PyPetscSectionObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DM.pyx":1550 * """ * cdef Section sec = Section() * CHKERR( DMGetGlobalSection(self.dm, &sec.sec) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(sec.obj) ) * return sec */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetGlobalSection(__pyx_v_self->dm, (&__pyx_v_sec->sec))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1550, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":1551 * cdef Section sec = Section() * CHKERR( DMGetGlobalSection(self.dm, &sec.sec) ) * CHKERR( PetscINCREF(sec.obj) ) # <<<<<<<<<<<<<< * return sec * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_sec->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1551, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":1552 * CHKERR( DMGetGlobalSection(self.dm, &sec.sec) ) * CHKERR( PetscINCREF(sec.obj) ) * return sec # <<<<<<<<<<<<<< * * setSection = setLocalSection */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_sec); __pyx_r = ((PyObject *)__pyx_v_sec); goto __pyx_L0; /* "petsc4py/PETSc/DM.pyx":1541 * CHKERR( DMSetGlobalSection(self.dm, sec.sec) ) * * def getGlobalSection(self) -> Section: # <<<<<<<<<<<<<< * """Return the `Section` encoding the global data layout for the `DM`. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DM.getGlobalSection", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_sec); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":1563 * getDefaultGlobalSection = getGlobalSection * * def createSectionSF(self, Section localsec, Section globalsec) -> None: # <<<<<<<<<<<<<< * """Create the `SF` encoding the parallel DOF overlap for the `DM`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_169createSectionSF(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_168createSectionSF, "DM.createSectionSF(self, localsec: Section, globalsec: Section) -> None\nCreate the `SF` encoding the parallel DOF overlap for the `DM`.\n\n Parameters\n ----------\n localsec\n Describe the local data layout.\n globalsec\n Describe the global data layout.\n\n Notes\n -----\n Encoding based on the `Section` describing the data layout.\n\n See Also\n --------\n DM.getSectionSF, petsc.DMCreateSectionSF\n\n \nSource code at petsc4py/PETSc/DM.pyx:1563"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_169createSectionSF(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscSectionObject *__pyx_v_localsec = 0; struct PyPetscSectionObject *__pyx_v_globalsec = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createSectionSF (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_localsec,&__pyx_n_s_globalsec,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_localsec)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 1563, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_globalsec)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 1563, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("createSectionSF", 1, 2, 2, 1); __PYX_ERR(54, 1563, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createSectionSF") < 0)) __PYX_ERR(54, 1563, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_localsec = ((struct PyPetscSectionObject *)values[0]); __pyx_v_globalsec = ((struct PyPetscSectionObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createSectionSF", 1, 2, 2, __pyx_nargs); __PYX_ERR(54, 1563, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DM.createSectionSF", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_localsec), __pyx_ptype_8petsc4py_5PETSc_Section, 0, "localsec", 0))) __PYX_ERR(54, 1563, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_globalsec), __pyx_ptype_8petsc4py_5PETSc_Section, 0, "globalsec", 0))) __PYX_ERR(54, 1563, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_168createSectionSF(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_localsec, __pyx_v_globalsec); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_168createSectionSF(struct PyPetscDMObject *__pyx_v_self, struct PyPetscSectionObject *__pyx_v_localsec, struct PyPetscSectionObject *__pyx_v_globalsec) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createSectionSF", 1); /* "petsc4py/PETSc/DM.pyx":1582 * * """ * CHKERR( DMCreateSectionSF(self.dm, localsec.sec, globalsec.sec) ) # <<<<<<<<<<<<<< * * def getSectionSF(self) -> SF: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCreateSectionSF(__pyx_v_self->dm, __pyx_v_localsec->sec, __pyx_v_globalsec->sec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1582, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":1563 * getDefaultGlobalSection = getGlobalSection * * def createSectionSF(self, Section localsec, Section globalsec) -> None: # <<<<<<<<<<<<<< * """Create the `SF` encoding the parallel DOF overlap for the `DM`. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.createSectionSF", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":1584 * CHKERR( DMCreateSectionSF(self.dm, localsec.sec, globalsec.sec) ) * * def getSectionSF(self) -> SF: # <<<<<<<<<<<<<< * """Return the `Section` encoding the parallel DOF overlap. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_171getSectionSF(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_170getSectionSF, "DM.getSectionSF(self) -> SF\nReturn the `Section` encoding the parallel DOF overlap.\n\n See Also\n --------\n petsc.DMGetSectionSF\n\n \nSource code at petsc4py/PETSc/DM.pyx:1584"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_171getSectionSF(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSectionSF (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getSectionSF", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getSectionSF", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_170getSectionSF(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_170getSectionSF(struct PyPetscDMObject *__pyx_v_self) { struct PyPetscSFObject *__pyx_v_sf = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSectionSF", 1); /* "petsc4py/PETSc/DM.pyx":1592 * * """ * cdef SF sf = SF() # <<<<<<<<<<<<<< * CHKERR( DMGetSectionSF(self.dm, &sf.sf) ) * CHKERR( PetscINCREF(sf.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SF)); if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 1592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_sf = ((struct PyPetscSFObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DM.pyx":1593 * """ * cdef SF sf = SF() * CHKERR( DMGetSectionSF(self.dm, &sf.sf) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(sf.obj) ) * return sf */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetSectionSF(__pyx_v_self->dm, (&__pyx_v_sf->sf))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1593, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":1594 * cdef SF sf = SF() * CHKERR( DMGetSectionSF(self.dm, &sf.sf) ) * CHKERR( PetscINCREF(sf.obj) ) # <<<<<<<<<<<<<< * return sf * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_sf->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1594, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":1595 * CHKERR( DMGetSectionSF(self.dm, &sf.sf) ) * CHKERR( PetscINCREF(sf.obj) ) * return sf # <<<<<<<<<<<<<< * * def setSectionSF(self, SF sf) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_sf); __pyx_r = ((PyObject *)__pyx_v_sf); goto __pyx_L0; /* "petsc4py/PETSc/DM.pyx":1584 * CHKERR( DMCreateSectionSF(self.dm, localsec.sec, globalsec.sec) ) * * def getSectionSF(self) -> SF: # <<<<<<<<<<<<<< * """Return the `Section` encoding the parallel DOF overlap. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DM.getSectionSF", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_sf); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":1597 * return sf * * def setSectionSF(self, SF sf) -> None: # <<<<<<<<<<<<<< * """Set the `Section` encoding the parallel DOF overlap for the `DM`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_173setSectionSF(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_172setSectionSF, "DM.setSectionSF(self, sf: SF) -> None\nSet the `Section` encoding the parallel DOF overlap for the `DM`.\n\n See Also\n --------\n petsc.DMSetSectionSF\n\n \nSource code at petsc4py/PETSc/DM.pyx:1597"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_173setSectionSF(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscSFObject *__pyx_v_sf = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setSectionSF (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sf,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sf)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 1597, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setSectionSF") < 0)) __PYX_ERR(54, 1597, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_sf = ((struct PyPetscSFObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setSectionSF", 1, 1, 1, __pyx_nargs); __PYX_ERR(54, 1597, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DM.setSectionSF", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sf), __pyx_ptype_8petsc4py_5PETSc_SF, 0, "sf", 0))) __PYX_ERR(54, 1597, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_172setSectionSF(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_sf); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_172setSectionSF(struct PyPetscDMObject *__pyx_v_self, struct PyPetscSFObject *__pyx_v_sf) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setSectionSF", 1); /* "petsc4py/PETSc/DM.pyx":1605 * * """ * CHKERR( DMSetSectionSF(self.dm, sf.sf) ) # <<<<<<<<<<<<<< * * createDefaultSF = createSectionSF */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSetSectionSF(__pyx_v_self->dm, __pyx_v_sf->sf)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1605, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":1597 * return sf * * def setSectionSF(self, SF sf) -> None: # <<<<<<<<<<<<<< * """Set the `Section` encoding the parallel DOF overlap for the `DM`. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.setSectionSF", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":1611 * setDefaultSF = setSectionSF * * def getPointSF(self) -> SF: # <<<<<<<<<<<<<< * """Return the `SF` encoding the parallel DOF overlap for the `DM`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_175getPointSF(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_174getPointSF, "DM.getPointSF(self) -> SF\nReturn the `SF` encoding the parallel DOF overlap for the `DM`.\n\n See Also\n --------\n petsc.DMGetPointSF\n\n \nSource code at petsc4py/PETSc/DM.pyx:1611"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_175getPointSF(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getPointSF (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getPointSF", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getPointSF", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_174getPointSF(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_174getPointSF(struct PyPetscDMObject *__pyx_v_self) { struct PyPetscSFObject *__pyx_v_sf = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getPointSF", 1); /* "petsc4py/PETSc/DM.pyx":1619 * * """ * cdef SF sf = SF() # <<<<<<<<<<<<<< * CHKERR( DMGetPointSF(self.dm, &sf.sf) ) * CHKERR( PetscINCREF(sf.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SF)); if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 1619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_sf = ((struct PyPetscSFObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DM.pyx":1620 * """ * cdef SF sf = SF() * CHKERR( DMGetPointSF(self.dm, &sf.sf) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(sf.obj) ) * return sf */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetPointSF(__pyx_v_self->dm, (&__pyx_v_sf->sf))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1620, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":1621 * cdef SF sf = SF() * CHKERR( DMGetPointSF(self.dm, &sf.sf) ) * CHKERR( PetscINCREF(sf.obj) ) # <<<<<<<<<<<<<< * return sf * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_sf->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1621, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":1622 * CHKERR( DMGetPointSF(self.dm, &sf.sf) ) * CHKERR( PetscINCREF(sf.obj) ) * return sf # <<<<<<<<<<<<<< * * def setPointSF(self, SF sf) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_sf); __pyx_r = ((PyObject *)__pyx_v_sf); goto __pyx_L0; /* "petsc4py/PETSc/DM.pyx":1611 * setDefaultSF = setSectionSF * * def getPointSF(self) -> SF: # <<<<<<<<<<<<<< * """Return the `SF` encoding the parallel DOF overlap for the `DM`. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DM.getPointSF", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_sf); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":1624 * return sf * * def setPointSF(self, SF sf) -> None: # <<<<<<<<<<<<<< * """Set the `SF` encoding the parallel DOF overlap for the `DM`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_177setPointSF(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_176setPointSF, "DM.setPointSF(self, sf: SF) -> None\nSet the `SF` encoding the parallel DOF overlap for the `DM`.\n\n See Also\n --------\n petsc.DMSetPointSF\n\n \nSource code at petsc4py/PETSc/DM.pyx:1624"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_177setPointSF(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscSFObject *__pyx_v_sf = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPointSF (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sf,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sf)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 1624, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setPointSF") < 0)) __PYX_ERR(54, 1624, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_sf = ((struct PyPetscSFObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPointSF", 1, 1, 1, __pyx_nargs); __PYX_ERR(54, 1624, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DM.setPointSF", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sf), __pyx_ptype_8petsc4py_5PETSc_SF, 0, "sf", 0))) __PYX_ERR(54, 1624, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_176setPointSF(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_sf); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_176setPointSF(struct PyPetscDMObject *__pyx_v_self, struct PyPetscSFObject *__pyx_v_sf) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPointSF", 1); /* "petsc4py/PETSc/DM.pyx":1632 * * """ * CHKERR( DMSetPointSF(self.dm, sf.sf) ) # <<<<<<<<<<<<<< * * def getNumLabels(self) -> int: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSetPointSF(__pyx_v_self->dm, __pyx_v_sf->sf)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1632, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":1624 * return sf * * def setPointSF(self, SF sf) -> None: # <<<<<<<<<<<<<< * """Set the `SF` encoding the parallel DOF overlap for the `DM`. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.setPointSF", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":1634 * CHKERR( DMSetPointSF(self.dm, sf.sf) ) * * def getNumLabels(self) -> int: # <<<<<<<<<<<<<< * """Return the number of labels defined by on the `DM`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_179getNumLabels(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_178getNumLabels, "DM.getNumLabels(self) -> int\nReturn the number of labels defined by on the `DM`.\n\n Not collective.\n\n See Also\n --------\n petsc.DMGetNumLabels\n\n \nSource code at petsc4py/PETSc/DM.pyx:1634"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_179getNumLabels(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getNumLabels (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getNumLabels", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getNumLabels", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_178getNumLabels(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_178getNumLabels(struct PyPetscDMObject *__pyx_v_self) { PetscInt __pyx_v_nLabels; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getNumLabels", 1); /* "petsc4py/PETSc/DM.pyx":1644 * * """ * cdef PetscInt nLabels = 0 # <<<<<<<<<<<<<< * CHKERR( DMGetNumLabels(self.dm, &nLabels) ) * return toInt(nLabels) */ __pyx_v_nLabels = 0; /* "petsc4py/PETSc/DM.pyx":1645 * """ * cdef PetscInt nLabels = 0 * CHKERR( DMGetNumLabels(self.dm, &nLabels) ) # <<<<<<<<<<<<<< * return toInt(nLabels) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetNumLabels(__pyx_v_self->dm, (&__pyx_v_nLabels))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1645, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":1646 * cdef PetscInt nLabels = 0 * CHKERR( DMGetNumLabels(self.dm, &nLabels) ) * return toInt(nLabels) # <<<<<<<<<<<<<< * * def getLabelName(self, index: int) -> str: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nLabels); if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 1646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DM.pyx":1634 * CHKERR( DMSetPointSF(self.dm, sf.sf) ) * * def getNumLabels(self) -> int: # <<<<<<<<<<<<<< * """Return the number of labels defined by on the `DM`. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DM.getNumLabels", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":1648 * return toInt(nLabels) * * def getLabelName(self, index: int) -> str: # <<<<<<<<<<<<<< * """Return the name of nth label. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_181getLabelName(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_180getLabelName, "DM.getLabelName(self, index: int) -> str\nReturn the name of nth label.\n\n Not collective.\n\n Parameters\n ----------\n index\n The label number.\n\n See Also\n --------\n petsc.DMGetLabelName\n\n \nSource code at petsc4py/PETSc/DM.pyx:1648"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_181getLabelName(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_index = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getLabelName (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_index)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 1648, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getLabelName") < 0)) __PYX_ERR(54, 1648, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_index = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getLabelName", 1, 1, 1, __pyx_nargs); __PYX_ERR(54, 1648, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DM.getLabelName", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_180getLabelName(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_index); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_180getLabelName(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_index) { PetscInt __pyx_v_cindex; char const *__pyx_v_cname; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getLabelName", 1); /* "petsc4py/PETSc/DM.pyx":1663 * * """ * cdef PetscInt cindex = asInt(index) # <<<<<<<<<<<<<< * cdef const char *cname = NULL * CHKERR( DMGetLabelName(self.dm, cindex, &cname) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_index); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(54, 1663, __pyx_L1_error) __pyx_v_cindex = __pyx_t_1; /* "petsc4py/PETSc/DM.pyx":1664 * """ * cdef PetscInt cindex = asInt(index) * cdef const char *cname = NULL # <<<<<<<<<<<<<< * CHKERR( DMGetLabelName(self.dm, cindex, &cname) ) * return bytes2str(cname) */ __pyx_v_cname = NULL; /* "petsc4py/PETSc/DM.pyx":1665 * cdef PetscInt cindex = asInt(index) * cdef const char *cname = NULL * CHKERR( DMGetLabelName(self.dm, cindex, &cname) ) # <<<<<<<<<<<<<< * return bytes2str(cname) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetLabelName(__pyx_v_self->dm, __pyx_v_cindex, (&__pyx_v_cname))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1665, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":1666 * cdef const char *cname = NULL * CHKERR( DMGetLabelName(self.dm, cindex, &cname) ) * return bytes2str(cname) # <<<<<<<<<<<<<< * * def hasLabel(self, name: str) -> bool: */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cname); if (unlikely(!__pyx_t_3)) __PYX_ERR(54, 1666, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DM.pyx":1648 * return toInt(nLabels) * * def getLabelName(self, index: int) -> str: # <<<<<<<<<<<<<< * """Return the name of nth label. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DM.getLabelName", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":1668 * return bytes2str(cname) * * def hasLabel(self, name: str) -> bool: # <<<<<<<<<<<<<< * """Determine whether the `DM` has a label. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_183hasLabel(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_182hasLabel, "DM.hasLabel(self, name: str) -> bool\nDetermine whether the `DM` has a label.\n\n Not collective.\n\n Parameters\n ----------\n name\n The label name.\n\n See Also\n --------\n petsc.DMHasLabel\n\n \nSource code at petsc4py/PETSc/DM.pyx:1668"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_183hasLabel(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_name = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("hasLabel (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 1668, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "hasLabel") < 0)) __PYX_ERR(54, 1668, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_name = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("hasLabel", 1, 1, 1, __pyx_nargs); __PYX_ERR(54, 1668, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DM.hasLabel", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_182hasLabel(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_name); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_182hasLabel(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name) { PetscBool __pyx_v_flag; char const *__pyx_v_cname; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("hasLabel", 0); __Pyx_INCREF(__pyx_v_name); /* "petsc4py/PETSc/DM.pyx":1683 * * """ * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * cdef const char *cname = NULL * name = str2bytes(name, &cname) */ __pyx_v_flag = PETSC_FALSE; /* "petsc4py/PETSc/DM.pyx":1684 * """ * cdef PetscBool flag = PETSC_FALSE * cdef const char *cname = NULL # <<<<<<<<<<<<<< * name = str2bytes(name, &cname) * CHKERR( DMHasLabel(self.dm, cname, &flag) ) */ __pyx_v_cname = NULL; /* "petsc4py/PETSc/DM.pyx":1685 * cdef PetscBool flag = PETSC_FALSE * cdef const char *cname = NULL * name = str2bytes(name, &cname) # <<<<<<<<<<<<<< * CHKERR( DMHasLabel(self.dm, cname, &flag) ) * return toBool(flag) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cname)); if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 1685, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DM.pyx":1686 * cdef const char *cname = NULL * name = str2bytes(name, &cname) * CHKERR( DMHasLabel(self.dm, cname, &flag) ) # <<<<<<<<<<<<<< * return toBool(flag) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMHasLabel(__pyx_v_self->dm, __pyx_v_cname, (&__pyx_v_flag))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1686, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":1687 * name = str2bytes(name, &cname) * CHKERR( DMHasLabel(self.dm, cname, &flag) ) * return toBool(flag) # <<<<<<<<<<<<<< * * def createLabel(self, name: str) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 1687, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DM.pyx":1668 * return bytes2str(cname) * * def hasLabel(self, name: str) -> bool: # <<<<<<<<<<<<<< * """Determine whether the `DM` has a label. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DM.hasLabel", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":1689 * return toBool(flag) * * def createLabel(self, name: str) -> None: # <<<<<<<<<<<<<< * """Create a label of the given name if it does not already exist. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_185createLabel(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_184createLabel, "DM.createLabel(self, name: str) -> None\nCreate a label of the given name if it does not already exist.\n\n Not collective.\n\n Parameters\n ----------\n name\n The label name.\n\n See Also\n --------\n petsc.DMCreateLabel\n\n \nSource code at petsc4py/PETSc/DM.pyx:1689"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_185createLabel(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_name = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createLabel (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 1689, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createLabel") < 0)) __PYX_ERR(54, 1689, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_name = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createLabel", 1, 1, 1, __pyx_nargs); __PYX_ERR(54, 1689, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DM.createLabel", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_184createLabel(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_name); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_184createLabel(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name) { char const *__pyx_v_cname; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createLabel", 0); __Pyx_INCREF(__pyx_v_name); /* "petsc4py/PETSc/DM.pyx":1704 * * """ * cdef const char *cname = NULL # <<<<<<<<<<<<<< * name = str2bytes(name, &cname) * CHKERR( DMCreateLabel(self.dm, cname) ) */ __pyx_v_cname = NULL; /* "petsc4py/PETSc/DM.pyx":1705 * """ * cdef const char *cname = NULL * name = str2bytes(name, &cname) # <<<<<<<<<<<<<< * CHKERR( DMCreateLabel(self.dm, cname) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cname)); if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 1705, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DM.pyx":1706 * cdef const char *cname = NULL * name = str2bytes(name, &cname) * CHKERR( DMCreateLabel(self.dm, cname) ) # <<<<<<<<<<<<<< * * def removeLabel(self, name: str) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCreateLabel(__pyx_v_self->dm, __pyx_v_cname)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1706, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":1689 * return toBool(flag) * * def createLabel(self, name: str) -> None: # <<<<<<<<<<<<<< * """Create a label of the given name if it does not already exist. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DM.createLabel", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":1708 * CHKERR( DMCreateLabel(self.dm, cname) ) * * def removeLabel(self, name: str) -> None: # <<<<<<<<<<<<<< * """Remove and destroy the label by name. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_187removeLabel(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_186removeLabel, "DM.removeLabel(self, name: str) -> None\nRemove and destroy the label by name.\n\n Not collective.\n\n Parameters\n ----------\n name\n The label name.\n\n See Also\n --------\n petsc.DMRemoveLabel\n\n \nSource code at petsc4py/PETSc/DM.pyx:1708"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_187removeLabel(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_name = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("removeLabel (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 1708, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "removeLabel") < 0)) __PYX_ERR(54, 1708, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_name = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("removeLabel", 1, 1, 1, __pyx_nargs); __PYX_ERR(54, 1708, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DM.removeLabel", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_186removeLabel(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_name); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_186removeLabel(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name) { char const *__pyx_v_cname; DMLabel __pyx_v_clbl; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("removeLabel", 0); __Pyx_INCREF(__pyx_v_name); /* "petsc4py/PETSc/DM.pyx":1723 * * """ * cdef const char *cname = NULL # <<<<<<<<<<<<<< * cdef PetscDMLabel clbl = NULL * name = str2bytes(name, &cname) */ __pyx_v_cname = NULL; /* "petsc4py/PETSc/DM.pyx":1724 * """ * cdef const char *cname = NULL * cdef PetscDMLabel clbl = NULL # <<<<<<<<<<<<<< * name = str2bytes(name, &cname) * CHKERR( DMRemoveLabel(self.dm, cname, &clbl) ) */ __pyx_v_clbl = NULL; /* "petsc4py/PETSc/DM.pyx":1725 * cdef const char *cname = NULL * cdef PetscDMLabel clbl = NULL * name = str2bytes(name, &cname) # <<<<<<<<<<<<<< * CHKERR( DMRemoveLabel(self.dm, cname, &clbl) ) * # TODO: Once DMLabel is wrapped, this should return the label, like the C function. */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cname)); if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 1725, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DM.pyx":1726 * cdef PetscDMLabel clbl = NULL * name = str2bytes(name, &cname) * CHKERR( DMRemoveLabel(self.dm, cname, &clbl) ) # <<<<<<<<<<<<<< * # TODO: Once DMLabel is wrapped, this should return the label, like the C function. * CHKERR( DMLabelDestroy(&clbl) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMRemoveLabel(__pyx_v_self->dm, __pyx_v_cname, (&__pyx_v_clbl))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1726, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":1728 * CHKERR( DMRemoveLabel(self.dm, cname, &clbl) ) * # TODO: Once DMLabel is wrapped, this should return the label, like the C function. * CHKERR( DMLabelDestroy(&clbl) ) # <<<<<<<<<<<<<< * * def getLabelValue(self, name: str, point: int) -> int: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMLabelDestroy((&__pyx_v_clbl))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1728, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":1708 * CHKERR( DMCreateLabel(self.dm, cname) ) * * def removeLabel(self, name: str) -> None: # <<<<<<<<<<<<<< * """Remove and destroy the label by name. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DM.removeLabel", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":1730 * CHKERR( DMLabelDestroy(&clbl) ) * * def getLabelValue(self, name: str, point: int) -> int: # <<<<<<<<<<<<<< * """Return the value in `DMLabel` for the given point. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_189getLabelValue(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_188getLabelValue, "DM.getLabelValue(self, name: str, point: int) -> int\nReturn the value in `DMLabel` for the given point.\n\n Not collective.\n\n Parameters\n ----------\n name\n The label name.\n point\n The mesh point\n\n See Also\n --------\n petsc.DMGetLabelValue\n\n \nSource code at petsc4py/PETSc/DM.pyx:1730"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_189getLabelValue(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_name = 0; PyObject *__pyx_v_point = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getLabelValue (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_point,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 1730, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_point)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 1730, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("getLabelValue", 1, 2, 2, 1); __PYX_ERR(54, 1730, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getLabelValue") < 0)) __PYX_ERR(54, 1730, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_name = values[0]; __pyx_v_point = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getLabelValue", 1, 2, 2, __pyx_nargs); __PYX_ERR(54, 1730, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DM.getLabelValue", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_188getLabelValue(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_name, __pyx_v_point); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_188getLabelValue(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_point) { PetscInt __pyx_v_cpoint; PetscInt __pyx_v_value; char const *__pyx_v_cname; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getLabelValue", 0); __Pyx_INCREF(__pyx_v_name); /* "petsc4py/PETSc/DM.pyx":1747 * * """ * cdef PetscInt cpoint = asInt(point), value = 0 # <<<<<<<<<<<<<< * cdef const char *cname = NULL * name = str2bytes(name, &cname) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_point); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(54, 1747, __pyx_L1_error) __pyx_v_cpoint = __pyx_t_1; __pyx_v_value = 0; /* "petsc4py/PETSc/DM.pyx":1748 * """ * cdef PetscInt cpoint = asInt(point), value = 0 * cdef const char *cname = NULL # <<<<<<<<<<<<<< * name = str2bytes(name, &cname) * CHKERR( DMGetLabelValue(self.dm, cname, cpoint, &value) ) */ __pyx_v_cname = NULL; /* "petsc4py/PETSc/DM.pyx":1749 * cdef PetscInt cpoint = asInt(point), value = 0 * cdef const char *cname = NULL * name = str2bytes(name, &cname) # <<<<<<<<<<<<<< * CHKERR( DMGetLabelValue(self.dm, cname, cpoint, &value) ) * return toInt(value) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cname)); if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 1749, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DM.pyx":1750 * cdef const char *cname = NULL * name = str2bytes(name, &cname) * CHKERR( DMGetLabelValue(self.dm, cname, cpoint, &value) ) # <<<<<<<<<<<<<< * return toInt(value) * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetLabelValue(__pyx_v_self->dm, __pyx_v_cname, __pyx_v_cpoint, (&__pyx_v_value))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1750, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":1751 * name = str2bytes(name, &cname) * CHKERR( DMGetLabelValue(self.dm, cname, cpoint, &value) ) * return toInt(value) # <<<<<<<<<<<<<< * * def setLabelValue(self, name: str, point: int, value: int) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 1751, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DM.pyx":1730 * CHKERR( DMLabelDestroy(&clbl) ) * * def getLabelValue(self, name: str, point: int) -> int: # <<<<<<<<<<<<<< * """Return the value in `DMLabel` for the given point. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DM.getLabelValue", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":1753 * return toInt(value) * * def setLabelValue(self, name: str, point: int, value: int) -> None: # <<<<<<<<<<<<<< * """Set a point to a `DMLabel` with a given value. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_191setLabelValue(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_190setLabelValue, "DM.setLabelValue(self, name: str, point: int, value: int) -> None\nSet a point to a `DMLabel` with a given value.\n\n Not collective.\n\n Parameters\n ----------\n name\n The label name.\n point\n The mesh point.\n value\n The label value for the point.\n\n See Also\n --------\n petsc.DMSetLabelValue\n\n \nSource code at petsc4py/PETSc/DM.pyx:1753"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_191setLabelValue(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_name = 0; PyObject *__pyx_v_point = 0; PyObject *__pyx_v_value = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setLabelValue (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_point,&__pyx_n_s_value,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 1753, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_point)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 1753, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setLabelValue", 1, 3, 3, 1); __PYX_ERR(54, 1753, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 1753, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setLabelValue", 1, 3, 3, 2); __PYX_ERR(54, 1753, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setLabelValue") < 0)) __PYX_ERR(54, 1753, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_name = values[0]; __pyx_v_point = values[1]; __pyx_v_value = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setLabelValue", 1, 3, 3, __pyx_nargs); __PYX_ERR(54, 1753, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DM.setLabelValue", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_190setLabelValue(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_name, __pyx_v_point, __pyx_v_value); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_190setLabelValue(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_point, PyObject *__pyx_v_value) { PetscInt __pyx_v_cpoint; PetscInt __pyx_v_cvalue; char const *__pyx_v_cname; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setLabelValue", 0); __Pyx_INCREF(__pyx_v_name); /* "petsc4py/PETSc/DM.pyx":1772 * * """ * cdef PetscInt cpoint = asInt(point), cvalue = asInt(value) # <<<<<<<<<<<<<< * cdef const char *cname = NULL * name = str2bytes(name, &cname) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_point); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(54, 1772, __pyx_L1_error) __pyx_v_cpoint = __pyx_t_1; __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_value); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(54, 1772, __pyx_L1_error) __pyx_v_cvalue = __pyx_t_1; /* "petsc4py/PETSc/DM.pyx":1773 * """ * cdef PetscInt cpoint = asInt(point), cvalue = asInt(value) * cdef const char *cname = NULL # <<<<<<<<<<<<<< * name = str2bytes(name, &cname) * CHKERR( DMSetLabelValue(self.dm, cname, cpoint, cvalue) ) */ __pyx_v_cname = NULL; /* "petsc4py/PETSc/DM.pyx":1774 * cdef PetscInt cpoint = asInt(point), cvalue = asInt(value) * cdef const char *cname = NULL * name = str2bytes(name, &cname) # <<<<<<<<<<<<<< * CHKERR( DMSetLabelValue(self.dm, cname, cpoint, cvalue) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cname)); if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 1774, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DM.pyx":1775 * cdef const char *cname = NULL * name = str2bytes(name, &cname) * CHKERR( DMSetLabelValue(self.dm, cname, cpoint, cvalue) ) # <<<<<<<<<<<<<< * * def clearLabelValue(self, name: str, point: int, value: int) -> None: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSetLabelValue(__pyx_v_self->dm, __pyx_v_cname, __pyx_v_cpoint, __pyx_v_cvalue)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1775, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":1753 * return toInt(value) * * def setLabelValue(self, name: str, point: int, value: int) -> None: # <<<<<<<<<<<<<< * """Set a point to a `DMLabel` with a given value. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DM.setLabelValue", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":1777 * CHKERR( DMSetLabelValue(self.dm, cname, cpoint, cvalue) ) * * def clearLabelValue(self, name: str, point: int, value: int) -> None: # <<<<<<<<<<<<<< * """Remove a point from a `DMLabel` with given value. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_193clearLabelValue(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_192clearLabelValue, "DM.clearLabelValue(self, name: str, point: int, value: int) -> None\nRemove a point from a `DMLabel` with given value.\n\n Not collective.\n\n Parameters\n ----------\n name\n The label name.\n point\n The mesh point.\n value\n The label value for the point.\n\n See Also\n --------\n petsc.DMClearLabelValue\n\n \nSource code at petsc4py/PETSc/DM.pyx:1777"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_193clearLabelValue(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_name = 0; PyObject *__pyx_v_point = 0; PyObject *__pyx_v_value = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("clearLabelValue (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_point,&__pyx_n_s_value,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 1777, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_point)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 1777, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("clearLabelValue", 1, 3, 3, 1); __PYX_ERR(54, 1777, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 1777, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("clearLabelValue", 1, 3, 3, 2); __PYX_ERR(54, 1777, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "clearLabelValue") < 0)) __PYX_ERR(54, 1777, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_name = values[0]; __pyx_v_point = values[1]; __pyx_v_value = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("clearLabelValue", 1, 3, 3, __pyx_nargs); __PYX_ERR(54, 1777, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DM.clearLabelValue", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_192clearLabelValue(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_name, __pyx_v_point, __pyx_v_value); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_192clearLabelValue(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_point, PyObject *__pyx_v_value) { PetscInt __pyx_v_cpoint; PetscInt __pyx_v_cvalue; char const *__pyx_v_cname; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("clearLabelValue", 0); __Pyx_INCREF(__pyx_v_name); /* "petsc4py/PETSc/DM.pyx":1796 * * """ * cdef PetscInt cpoint = asInt(point), cvalue = asInt(value) # <<<<<<<<<<<<<< * cdef const char *cname = NULL * name = str2bytes(name, &cname) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_point); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(54, 1796, __pyx_L1_error) __pyx_v_cpoint = __pyx_t_1; __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_value); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(54, 1796, __pyx_L1_error) __pyx_v_cvalue = __pyx_t_1; /* "petsc4py/PETSc/DM.pyx":1797 * """ * cdef PetscInt cpoint = asInt(point), cvalue = asInt(value) * cdef const char *cname = NULL # <<<<<<<<<<<<<< * name = str2bytes(name, &cname) * CHKERR( DMClearLabelValue(self.dm, cname, cpoint, cvalue) ) */ __pyx_v_cname = NULL; /* "petsc4py/PETSc/DM.pyx":1798 * cdef PetscInt cpoint = asInt(point), cvalue = asInt(value) * cdef const char *cname = NULL * name = str2bytes(name, &cname) # <<<<<<<<<<<<<< * CHKERR( DMClearLabelValue(self.dm, cname, cpoint, cvalue) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cname)); if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 1798, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DM.pyx":1799 * cdef const char *cname = NULL * name = str2bytes(name, &cname) * CHKERR( DMClearLabelValue(self.dm, cname, cpoint, cvalue) ) # <<<<<<<<<<<<<< * * def getLabelSize(self, name: str) -> int: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMClearLabelValue(__pyx_v_self->dm, __pyx_v_cname, __pyx_v_cpoint, __pyx_v_cvalue)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1799, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":1777 * CHKERR( DMSetLabelValue(self.dm, cname, cpoint, cvalue) ) * * def clearLabelValue(self, name: str, point: int, value: int) -> None: # <<<<<<<<<<<<<< * """Remove a point from a `DMLabel` with given value. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DM.clearLabelValue", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":1801 * CHKERR( DMClearLabelValue(self.dm, cname, cpoint, cvalue) ) * * def getLabelSize(self, name: str) -> int: # <<<<<<<<<<<<<< * """Return the number of values that the `DMLabel` takes. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_195getLabelSize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_194getLabelSize, "DM.getLabelSize(self, name: str) -> int\nReturn the number of values that the `DMLabel` takes.\n\n Not collective.\n\n Parameters\n ----------\n name\n The label name.\n\n See Also\n --------\n petsc.DMLabelGetNumValues, petsc.DMGetLabelSize\n\n \nSource code at petsc4py/PETSc/DM.pyx:1801"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_195getLabelSize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_name = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getLabelSize (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 1801, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getLabelSize") < 0)) __PYX_ERR(54, 1801, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_name = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getLabelSize", 1, 1, 1, __pyx_nargs); __PYX_ERR(54, 1801, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DM.getLabelSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_194getLabelSize(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_name); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_194getLabelSize(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name) { PetscInt __pyx_v_size; char const *__pyx_v_cname; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getLabelSize", 0); __Pyx_INCREF(__pyx_v_name); /* "petsc4py/PETSc/DM.pyx":1816 * * """ * cdef PetscInt size = 0 # <<<<<<<<<<<<<< * cdef const char *cname = NULL * name = str2bytes(name, &cname) */ __pyx_v_size = 0; /* "petsc4py/PETSc/DM.pyx":1817 * """ * cdef PetscInt size = 0 * cdef const char *cname = NULL # <<<<<<<<<<<<<< * name = str2bytes(name, &cname) * CHKERR( DMGetLabelSize(self.dm, cname, &size) ) */ __pyx_v_cname = NULL; /* "petsc4py/PETSc/DM.pyx":1818 * cdef PetscInt size = 0 * cdef const char *cname = NULL * name = str2bytes(name, &cname) # <<<<<<<<<<<<<< * CHKERR( DMGetLabelSize(self.dm, cname, &size) ) * return toInt(size) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cname)); if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 1818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DM.pyx":1819 * cdef const char *cname = NULL * name = str2bytes(name, &cname) * CHKERR( DMGetLabelSize(self.dm, cname, &size) ) # <<<<<<<<<<<<<< * return toInt(size) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetLabelSize(__pyx_v_self->dm, __pyx_v_cname, (&__pyx_v_size))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1819, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":1820 * name = str2bytes(name, &cname) * CHKERR( DMGetLabelSize(self.dm, cname, &size) ) * return toInt(size) # <<<<<<<<<<<<<< * * def getLabelIdIS(self, name: str) -> IS: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 1820, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DM.pyx":1801 * CHKERR( DMClearLabelValue(self.dm, cname, cpoint, cvalue) ) * * def getLabelSize(self, name: str) -> int: # <<<<<<<<<<<<<< * """Return the number of values that the `DMLabel` takes. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DM.getLabelSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":1822 * return toInt(size) * * def getLabelIdIS(self, name: str) -> IS: # <<<<<<<<<<<<<< * """Return an `IS` of all values that the `DMLabel` takes. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_197getLabelIdIS(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_196getLabelIdIS, "DM.getLabelIdIS(self, name: str) -> IS\nReturn an `IS` of all values that the `DMLabel` takes.\n\n Not collective.\n\n Parameters\n ----------\n name\n The label name.\n\n See Also\n --------\n petsc.DMLabelGetValueIS, petsc.DMGetLabelIdIS\n\n \nSource code at petsc4py/PETSc/DM.pyx:1822"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_197getLabelIdIS(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_name = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getLabelIdIS (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 1822, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getLabelIdIS") < 0)) __PYX_ERR(54, 1822, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_name = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getLabelIdIS", 1, 1, 1, __pyx_nargs); __PYX_ERR(54, 1822, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DM.getLabelIdIS", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_196getLabelIdIS(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_name); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_196getLabelIdIS(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name) { char const *__pyx_v_cname; struct PyPetscISObject *__pyx_v_lis = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getLabelIdIS", 0); __Pyx_INCREF(__pyx_v_name); /* "petsc4py/PETSc/DM.pyx":1837 * * """ * cdef const char *cname = NULL # <<<<<<<<<<<<<< * name = str2bytes(name, &cname) * cdef IS lis = IS() */ __pyx_v_cname = NULL; /* "petsc4py/PETSc/DM.pyx":1838 * """ * cdef const char *cname = NULL * name = str2bytes(name, &cname) # <<<<<<<<<<<<<< * cdef IS lis = IS() * CHKERR( DMGetLabelIdIS(self.dm, cname, &lis.iset) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cname)); if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 1838, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DM.pyx":1839 * cdef const char *cname = NULL * name = str2bytes(name, &cname) * cdef IS lis = IS() # <<<<<<<<<<<<<< * CHKERR( DMGetLabelIdIS(self.dm, cname, &lis.iset) ) * return lis */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 1839, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_lis = ((struct PyPetscISObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DM.pyx":1840 * name = str2bytes(name, &cname) * cdef IS lis = IS() * CHKERR( DMGetLabelIdIS(self.dm, cname, &lis.iset) ) # <<<<<<<<<<<<<< * return lis * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetLabelIdIS(__pyx_v_self->dm, __pyx_v_cname, (&__pyx_v_lis->iset))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1840, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":1841 * cdef IS lis = IS() * CHKERR( DMGetLabelIdIS(self.dm, cname, &lis.iset) ) * return lis # <<<<<<<<<<<<<< * * def getStratumSize(self, name: str, value: int) -> int: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_lis); __pyx_r = ((PyObject *)__pyx_v_lis); goto __pyx_L0; /* "petsc4py/PETSc/DM.pyx":1822 * return toInt(size) * * def getLabelIdIS(self, name: str) -> IS: # <<<<<<<<<<<<<< * """Return an `IS` of all values that the `DMLabel` takes. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DM.getLabelIdIS", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_lis); __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":1843 * return lis * * def getStratumSize(self, name: str, value: int) -> int: # <<<<<<<<<<<<<< * """Return the number of points in a label stratum. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_199getStratumSize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_198getStratumSize, "DM.getStratumSize(self, name: str, value: int) -> int\nReturn the number of points in a label stratum.\n\n Not collective.\n\n Parameters\n ----------\n name\n The label name.\n value\n The stratum value.\n\n See Also\n --------\n petsc.DMGetStratumSize\n\n \nSource code at petsc4py/PETSc/DM.pyx:1843"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_199getStratumSize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_name = 0; PyObject *__pyx_v_value = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getStratumSize (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_value,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 1843, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 1843, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("getStratumSize", 1, 2, 2, 1); __PYX_ERR(54, 1843, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getStratumSize") < 0)) __PYX_ERR(54, 1843, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_name = values[0]; __pyx_v_value = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getStratumSize", 1, 2, 2, __pyx_nargs); __PYX_ERR(54, 1843, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DM.getStratumSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_198getStratumSize(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_name, __pyx_v_value); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_198getStratumSize(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value) { PetscInt __pyx_v_size; PetscInt __pyx_v_cvalue; char const *__pyx_v_cname; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getStratumSize", 0); __Pyx_INCREF(__pyx_v_name); /* "petsc4py/PETSc/DM.pyx":1860 * * """ * cdef PetscInt size = 0 # <<<<<<<<<<<<<< * cdef PetscInt cvalue = asInt(value) * cdef const char *cname = NULL */ __pyx_v_size = 0; /* "petsc4py/PETSc/DM.pyx":1861 * """ * cdef PetscInt size = 0 * cdef PetscInt cvalue = asInt(value) # <<<<<<<<<<<<<< * cdef const char *cname = NULL * name = str2bytes(name, &cname) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_value); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(54, 1861, __pyx_L1_error) __pyx_v_cvalue = __pyx_t_1; /* "petsc4py/PETSc/DM.pyx":1862 * cdef PetscInt size = 0 * cdef PetscInt cvalue = asInt(value) * cdef const char *cname = NULL # <<<<<<<<<<<<<< * name = str2bytes(name, &cname) * CHKERR( DMGetStratumSize(self.dm, cname, cvalue, &size) ) */ __pyx_v_cname = NULL; /* "petsc4py/PETSc/DM.pyx":1863 * cdef PetscInt cvalue = asInt(value) * cdef const char *cname = NULL * name = str2bytes(name, &cname) # <<<<<<<<<<<<<< * CHKERR( DMGetStratumSize(self.dm, cname, cvalue, &size) ) * return toInt(size) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cname)); if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 1863, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DM.pyx":1864 * cdef const char *cname = NULL * name = str2bytes(name, &cname) * CHKERR( DMGetStratumSize(self.dm, cname, cvalue, &size) ) # <<<<<<<<<<<<<< * return toInt(size) * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetStratumSize(__pyx_v_self->dm, __pyx_v_cname, __pyx_v_cvalue, (&__pyx_v_size))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1864, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":1865 * name = str2bytes(name, &cname) * CHKERR( DMGetStratumSize(self.dm, cname, cvalue, &size) ) * return toInt(size) # <<<<<<<<<<<<<< * * def getStratumIS(self, name: str, value: int) -> IS: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 1865, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DM.pyx":1843 * return lis * * def getStratumSize(self, name: str, value: int) -> int: # <<<<<<<<<<<<<< * """Return the number of points in a label stratum. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DM.getStratumSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":1867 * return toInt(size) * * def getStratumIS(self, name: str, value: int) -> IS: # <<<<<<<<<<<<<< * """Return the points in a label stratum. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_201getStratumIS(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_200getStratumIS, "DM.getStratumIS(self, name: str, value: int) -> IS\nReturn the points in a label stratum.\n\n Not collective.\n\n Parameters\n ----------\n name\n The label name.\n value\n The stratum value.\n\n See Also\n --------\n petsc.DMGetStratumIS\n\n \nSource code at petsc4py/PETSc/DM.pyx:1867"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_201getStratumIS(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_name = 0; PyObject *__pyx_v_value = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getStratumIS (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_value,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 1867, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 1867, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("getStratumIS", 1, 2, 2, 1); __PYX_ERR(54, 1867, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getStratumIS") < 0)) __PYX_ERR(54, 1867, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_name = values[0]; __pyx_v_value = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getStratumIS", 1, 2, 2, __pyx_nargs); __PYX_ERR(54, 1867, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DM.getStratumIS", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_200getStratumIS(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_name, __pyx_v_value); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_200getStratumIS(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value) { PetscInt __pyx_v_cvalue; char const *__pyx_v_cname; struct PyPetscISObject *__pyx_v_sis = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getStratumIS", 0); __Pyx_INCREF(__pyx_v_name); /* "petsc4py/PETSc/DM.pyx":1884 * * """ * cdef PetscInt cvalue = asInt(value) # <<<<<<<<<<<<<< * cdef const char *cname = NULL * name = str2bytes(name, &cname) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_value); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(54, 1884, __pyx_L1_error) __pyx_v_cvalue = __pyx_t_1; /* "petsc4py/PETSc/DM.pyx":1885 * """ * cdef PetscInt cvalue = asInt(value) * cdef const char *cname = NULL # <<<<<<<<<<<<<< * name = str2bytes(name, &cname) * cdef IS sis = IS() */ __pyx_v_cname = NULL; /* "petsc4py/PETSc/DM.pyx":1886 * cdef PetscInt cvalue = asInt(value) * cdef const char *cname = NULL * name = str2bytes(name, &cname) # <<<<<<<<<<<<<< * cdef IS sis = IS() * CHKERR( DMGetStratumIS(self.dm, cname, cvalue, &sis.iset) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cname)); if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 1886, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DM.pyx":1887 * cdef const char *cname = NULL * name = str2bytes(name, &cname) * cdef IS sis = IS() # <<<<<<<<<<<<<< * CHKERR( DMGetStratumIS(self.dm, cname, cvalue, &sis.iset) ) * return sis */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 1887, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_sis = ((struct PyPetscISObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DM.pyx":1888 * name = str2bytes(name, &cname) * cdef IS sis = IS() * CHKERR( DMGetStratumIS(self.dm, cname, cvalue, &sis.iset) ) # <<<<<<<<<<<<<< * return sis * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetStratumIS(__pyx_v_self->dm, __pyx_v_cname, __pyx_v_cvalue, (&__pyx_v_sis->iset))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1888, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":1889 * cdef IS sis = IS() * CHKERR( DMGetStratumIS(self.dm, cname, cvalue, &sis.iset) ) * return sis # <<<<<<<<<<<<<< * * def clearLabelStratum(self, name: str, value: int) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_sis); __pyx_r = ((PyObject *)__pyx_v_sis); goto __pyx_L0; /* "petsc4py/PETSc/DM.pyx":1867 * return toInt(size) * * def getStratumIS(self, name: str, value: int) -> IS: # <<<<<<<<<<<<<< * """Return the points in a label stratum. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DM.getStratumIS", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_sis); __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":1891 * return sis * * def clearLabelStratum(self, name: str, value: int) -> None: # <<<<<<<<<<<<<< * """Remove all points from a stratum. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_203clearLabelStratum(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_202clearLabelStratum, "DM.clearLabelStratum(self, name: str, value: int) -> None\nRemove all points from a stratum.\n\n Not collective.\n\n Parameters\n ----------\n name\n The label name.\n value\n The stratum value.\n\n See Also\n --------\n petsc.DMClearLabelStratum\n\n \nSource code at petsc4py/PETSc/DM.pyx:1891"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_203clearLabelStratum(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_name = 0; PyObject *__pyx_v_value = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("clearLabelStratum (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_value,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 1891, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 1891, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("clearLabelStratum", 1, 2, 2, 1); __PYX_ERR(54, 1891, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "clearLabelStratum") < 0)) __PYX_ERR(54, 1891, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_name = values[0]; __pyx_v_value = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("clearLabelStratum", 1, 2, 2, __pyx_nargs); __PYX_ERR(54, 1891, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DM.clearLabelStratum", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_202clearLabelStratum(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_name, __pyx_v_value); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_202clearLabelStratum(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value) { PetscInt __pyx_v_cvalue; char const *__pyx_v_cname; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("clearLabelStratum", 0); __Pyx_INCREF(__pyx_v_name); /* "petsc4py/PETSc/DM.pyx":1908 * * """ * cdef PetscInt cvalue = asInt(value) # <<<<<<<<<<<<<< * cdef const char *cname = NULL * name = str2bytes(name, &cname) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_value); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(54, 1908, __pyx_L1_error) __pyx_v_cvalue = __pyx_t_1; /* "petsc4py/PETSc/DM.pyx":1909 * """ * cdef PetscInt cvalue = asInt(value) * cdef const char *cname = NULL # <<<<<<<<<<<<<< * name = str2bytes(name, &cname) * CHKERR( DMClearLabelStratum(self.dm, cname, cvalue) ) */ __pyx_v_cname = NULL; /* "petsc4py/PETSc/DM.pyx":1910 * cdef PetscInt cvalue = asInt(value) * cdef const char *cname = NULL * name = str2bytes(name, &cname) # <<<<<<<<<<<<<< * CHKERR( DMClearLabelStratum(self.dm, cname, cvalue) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cname)); if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 1910, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DM.pyx":1911 * cdef const char *cname = NULL * name = str2bytes(name, &cname) * CHKERR( DMClearLabelStratum(self.dm, cname, cvalue) ) # <<<<<<<<<<<<<< * * def setLabelOutput(self, name: str, output: bool) -> None: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMClearLabelStratum(__pyx_v_self->dm, __pyx_v_cname, __pyx_v_cvalue)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1911, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":1891 * return sis * * def clearLabelStratum(self, name: str, value: int) -> None: # <<<<<<<<<<<<<< * """Remove all points from a stratum. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DM.clearLabelStratum", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":1913 * CHKERR( DMClearLabelStratum(self.dm, cname, cvalue) ) * * def setLabelOutput(self, name: str, output: bool) -> None: # <<<<<<<<<<<<<< * """Set if a given label should be saved to a view. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_205setLabelOutput(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_204setLabelOutput, "DM.setLabelOutput(self, name: str, output: bool) -> None\nSet if a given label should be saved to a view.\n\n Not collective.\n\n Parameters\n ----------\n name\n The label name.\n output\n If `True`, the label is saved to the viewer.\n\n See Also\n --------\n petsc.DMSetLabelOutput\n\n \nSource code at petsc4py/PETSc/DM.pyx:1913"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_205setLabelOutput(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_name = 0; PyObject *__pyx_v_output = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setLabelOutput (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_output,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 1913, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_output)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 1913, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setLabelOutput", 1, 2, 2, 1); __PYX_ERR(54, 1913, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setLabelOutput") < 0)) __PYX_ERR(54, 1913, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_name = values[0]; __pyx_v_output = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setLabelOutput", 1, 2, 2, __pyx_nargs); __PYX_ERR(54, 1913, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DM.setLabelOutput", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_204setLabelOutput(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_name, __pyx_v_output); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_204setLabelOutput(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_output) { char const *__pyx_v_cname; PetscBool __pyx_v_coutput; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscBool __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setLabelOutput", 0); __Pyx_INCREF(__pyx_v_name); /* "petsc4py/PETSc/DM.pyx":1930 * * """ * cdef const char *cname = NULL # <<<<<<<<<<<<<< * name = str2bytes(name, &cname) * cdef PetscBool coutput = output */ __pyx_v_cname = NULL; /* "petsc4py/PETSc/DM.pyx":1931 * """ * cdef const char *cname = NULL * name = str2bytes(name, &cname) # <<<<<<<<<<<<<< * cdef PetscBool coutput = output * CHKERR( DMSetLabelOutput(self.dm, cname, coutput) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cname)); if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 1931, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DM.pyx":1932 * cdef const char *cname = NULL * name = str2bytes(name, &cname) * cdef PetscBool coutput = output # <<<<<<<<<<<<<< * CHKERR( DMSetLabelOutput(self.dm, cname, coutput) ) * */ __pyx_t_2 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_output)); if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 1932, __pyx_L1_error) __pyx_v_coutput = __pyx_t_2; /* "petsc4py/PETSc/DM.pyx":1933 * name = str2bytes(name, &cname) * cdef PetscBool coutput = output * CHKERR( DMSetLabelOutput(self.dm, cname, coutput) ) # <<<<<<<<<<<<<< * * def getLabelOutput(self, name: str) -> bool: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSetLabelOutput(__pyx_v_self->dm, __pyx_v_cname, __pyx_v_coutput)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1933, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":1913 * CHKERR( DMClearLabelStratum(self.dm, cname, cvalue) ) * * def setLabelOutput(self, name: str, output: bool) -> None: # <<<<<<<<<<<<<< * """Set if a given label should be saved to a view. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DM.setLabelOutput", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":1935 * CHKERR( DMSetLabelOutput(self.dm, cname, coutput) ) * * def getLabelOutput(self, name: str) -> bool: # <<<<<<<<<<<<<< * """Return the output flag for a given label. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_207getLabelOutput(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_206getLabelOutput, "DM.getLabelOutput(self, name: str) -> bool\nReturn the output flag for a given label.\n\n Not collective.\n\n Parameters\n ----------\n name\n The label name.\n\n See Also\n --------\n petsc.DMGetLabelOutput\n\n \nSource code at petsc4py/PETSc/DM.pyx:1935"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_207getLabelOutput(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_name = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getLabelOutput (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 1935, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getLabelOutput") < 0)) __PYX_ERR(54, 1935, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_name = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getLabelOutput", 1, 1, 1, __pyx_nargs); __PYX_ERR(54, 1935, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DM.getLabelOutput", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_206getLabelOutput(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_name); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_206getLabelOutput(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name) { char const *__pyx_v_cname; PetscBool __pyx_v_coutput; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getLabelOutput", 0); __Pyx_INCREF(__pyx_v_name); /* "petsc4py/PETSc/DM.pyx":1950 * * """ * cdef const char *cname = NULL # <<<<<<<<<<<<<< * name = str2bytes(name, &cname) * cdef PetscBool coutput = PETSC_FALSE */ __pyx_v_cname = NULL; /* "petsc4py/PETSc/DM.pyx":1951 * """ * cdef const char *cname = NULL * name = str2bytes(name, &cname) # <<<<<<<<<<<<<< * cdef PetscBool coutput = PETSC_FALSE * CHKERR( DMGetLabelOutput(self.dm, cname, &coutput) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cname)); if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 1951, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DM.pyx":1952 * cdef const char *cname = NULL * name = str2bytes(name, &cname) * cdef PetscBool coutput = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( DMGetLabelOutput(self.dm, cname, &coutput) ) * return coutput */ __pyx_v_coutput = PETSC_FALSE; /* "petsc4py/PETSc/DM.pyx":1953 * name = str2bytes(name, &cname) * cdef PetscBool coutput = PETSC_FALSE * CHKERR( DMGetLabelOutput(self.dm, cname, &coutput) ) # <<<<<<<<<<<<<< * return coutput * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetLabelOutput(__pyx_v_self->dm, __pyx_v_cname, (&__pyx_v_coutput))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1953, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":1954 * cdef PetscBool coutput = PETSC_FALSE * CHKERR( DMGetLabelOutput(self.dm, cname, &coutput) ) * return coutput # <<<<<<<<<<<<<< * * # backward compatibility */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_PetscBool(__pyx_v_coutput); if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 1954, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DM.pyx":1935 * CHKERR( DMSetLabelOutput(self.dm, cname, coutput) ) * * def getLabelOutput(self, name: str) -> bool: # <<<<<<<<<<<<<< * """Return the output flag for a given label. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DM.getLabelOutput", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":1961 * getMatrix = createMatrix = createMat * * def setKSPComputeOperators( # <<<<<<<<<<<<<< * self, operators, * args: tuple[Any, ...] | None = None, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_209setKSPComputeOperators(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_208setKSPComputeOperators, "DM.setKSPComputeOperators(self, operators, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nMatrix associated with the linear system.\n\n Collective.\n\n Parameters\n ----------\n operator\n Callback function to compute the operators.\n args\n Positional arguments for the callback.\n kargs\n Keyword arguments for the callback.\n\n See Also\n --------\n petsc.DMKSPSetComputeOperators\n\n \nSource code at petsc4py/PETSc/DM.pyx:1961"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_209setKSPComputeOperators(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_operators = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setKSPComputeOperators (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_operators,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; /* "petsc4py/PETSc/DM.pyx":1963 * def setKSPComputeOperators( * self, operators, * args: tuple[Any, ...] | None = None, # <<<<<<<<<<<<<< * kargs: dict[str, Any] | None = None, * ) -> None: */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/DM.pyx":1964 * self, operators, * args: tuple[Any, ...] | None = None, * kargs: dict[str, Any] | None = None, # <<<<<<<<<<<<<< * ) -> None: * """Matrix associated with the linear system. */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_operators)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 1961, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 1961, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 1961, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setKSPComputeOperators") < 0)) __PYX_ERR(54, 1961, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_operators = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setKSPComputeOperators", 0, 1, 3, __pyx_nargs); __PYX_ERR(54, 1961, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DM.setKSPComputeOperators", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_208setKSPComputeOperators(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_operators, __pyx_v_args, __pyx_v_kargs); /* "petsc4py/PETSc/DM.pyx":1961 * getMatrix = createMatrix = createMat * * def setKSPComputeOperators( # <<<<<<<<<<<<<< * self, operators, * args: tuple[Any, ...] | None = None, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_208setKSPComputeOperators(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_operators, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setKSPComputeOperators", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/DM.pyx":1984 * * """ * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (operators, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/DM.pyx":1985 * """ * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (operators, args, kargs) * self.set_attr('__operators__', context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); if (__pyx_t_1) { __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 1985, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_2); __pyx_t_2 = 0; } /* "petsc4py/PETSc/DM.pyx":1986 * if args is None: args = () * if kargs is None: kargs = {} * context = (operators, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__operators__', context) * CHKERR( DMKSPSetComputeOperators(self.dm, KSP_ComputeOps, context) ) */ __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 1986, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_operators); __Pyx_GIVEREF(__pyx_v_operators); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_operators)) __PYX_ERR(54, 1986, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_args)) __PYX_ERR(54, 1986, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_kargs)) __PYX_ERR(54, 1986, __pyx_L1_error); __pyx_v_context = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DM.pyx":1987 * if kargs is None: kargs = {} * context = (operators, args, kargs) * self.set_attr('__operators__', context) # <<<<<<<<<<<<<< * CHKERR( DMKSPSetComputeOperators(self.dm, KSP_ComputeOps, context) ) * */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__operators__"), __pyx_v_context); if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 1987, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DM.pyx":1988 * context = (operators, args, kargs) * self.set_attr('__operators__', context) * CHKERR( DMKSPSetComputeOperators(self.dm, KSP_ComputeOps, context) ) # <<<<<<<<<<<<<< * * def createFieldDecomposition(self) -> tuple[list, list, list] : */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMKSPSetComputeOperators(__pyx_v_self->dm, __pyx_f_8petsc4py_5PETSc_KSP_ComputeOps, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1988, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":1961 * getMatrix = createMatrix = createMat * * def setKSPComputeOperators( # <<<<<<<<<<<<<< * self, operators, * args: tuple[Any, ...] | None = None, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DM.setKSPComputeOperators", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":1990 * CHKERR( DMKSPSetComputeOperators(self.dm, KSP_ComputeOps, context) ) * * def createFieldDecomposition(self) -> tuple[list, list, list] : # <<<<<<<<<<<<<< * """Return a list of `IS` objects. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_211createFieldDecomposition(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_210createFieldDecomposition, "DM.createFieldDecomposition(self) -> tuple[list, list, list]\nReturn a list of `IS` objects.\n\n Not collective.\n\n Notes\n -----\n The user is responsible for freeing all requested arrays.\n\n See Also\n --------\n petsc.DMCreateFieldDecomposition\n\n \nSource code at petsc4py/PETSc/DM.pyx:1990"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_211createFieldDecomposition(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createFieldDecomposition (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("createFieldDecomposition", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "createFieldDecomposition", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_210createFieldDecomposition(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_210createFieldDecomposition(struct PyPetscDMObject *__pyx_v_self) { PetscInt __pyx_v_clen; IS *__pyx_v_cis; DM *__pyx_v_cdm; char **__pyx_v_cnamelist; PyObject *__pyx_v_isets = 0; PyObject *__pyx_v_dms = 0; PyObject *__pyx_v_names = 0; struct PyPetscDMObject *__pyx_v_dm = 0; long __pyx_v_i; PyObject *__pyx_v_name = NULL; long __pyx_9genexpr16__pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscInt __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createFieldDecomposition", 1); /* "petsc4py/PETSc/DM.pyx":2004 * * """ * cdef PetscInt clen = 0 # <<<<<<<<<<<<<< * cdef PetscIS *cis = NULL * cdef PetscDM *cdm = NULL */ __pyx_v_clen = 0; /* "petsc4py/PETSc/DM.pyx":2005 * """ * cdef PetscInt clen = 0 * cdef PetscIS *cis = NULL # <<<<<<<<<<<<<< * cdef PetscDM *cdm = NULL * cdef char** cnamelist = NULL */ __pyx_v_cis = NULL; /* "petsc4py/PETSc/DM.pyx":2006 * cdef PetscInt clen = 0 * cdef PetscIS *cis = NULL * cdef PetscDM *cdm = NULL # <<<<<<<<<<<<<< * cdef char** cnamelist = NULL * */ __pyx_v_cdm = NULL; /* "petsc4py/PETSc/DM.pyx":2007 * cdef PetscIS *cis = NULL * cdef PetscDM *cdm = NULL * cdef char** cnamelist = NULL # <<<<<<<<<<<<<< * * CHKERR( DMCreateFieldDecomposition(self.dm, &clen, &cnamelist, &cis, &cdm) ) */ __pyx_v_cnamelist = NULL; /* "petsc4py/PETSc/DM.pyx":2009 * cdef char** cnamelist = NULL * * CHKERR( DMCreateFieldDecomposition(self.dm, &clen, &cnamelist, &cis, &cdm) ) # <<<<<<<<<<<<<< * * cdef list isets = [ref_IS(cis[i]) for i from 0 <= i < clen] */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCreateFieldDecomposition(__pyx_v_self->dm, (&__pyx_v_clen), (&__pyx_v_cnamelist), (&__pyx_v_cis), (&__pyx_v_cdm))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 2009, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":2011 * CHKERR( DMCreateFieldDecomposition(self.dm, &clen, &cnamelist, &cis, &cdm) ) * * cdef list isets = [ref_IS(cis[i]) for i from 0 <= i < clen] # <<<<<<<<<<<<<< * cdef list dms = [] * cdef list names = [] */ { /* enter inner scope */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 2011, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_v_clen; for (__pyx_9genexpr16__pyx_v_i = 0; __pyx_9genexpr16__pyx_v_i < __pyx_t_3; __pyx_9genexpr16__pyx_v_i++) { __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_IS((__pyx_v_cis[__pyx_9genexpr16__pyx_v_i]))); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 2011, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_4))) __PYX_ERR(54, 2011, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } } /* exit inner scope */ __pyx_v_isets = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DM.pyx":2012 * * cdef list isets = [ref_IS(cis[i]) for i from 0 <= i < clen] * cdef list dms = [] # <<<<<<<<<<<<<< * cdef list names = [] * cdef DM dm = None */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 2012, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_dms = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DM.pyx":2013 * cdef list isets = [ref_IS(cis[i]) for i from 0 <= i < clen] * cdef list dms = [] * cdef list names = [] # <<<<<<<<<<<<<< * cdef DM dm = None * */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 2013, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_names = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DM.pyx":2014 * cdef list dms = [] * cdef list names = [] * cdef DM dm = None # <<<<<<<<<<<<<< * * for i from 0 <= i < clen: */ __Pyx_INCREF(Py_None); __pyx_v_dm = ((struct PyPetscDMObject *)Py_None); /* "petsc4py/PETSc/DM.pyx":2016 * cdef DM dm = None * * for i from 0 <= i < clen: # <<<<<<<<<<<<<< * if cdm != NULL: * dm = subtype_DM(cdm[i])() */ __pyx_t_3 = __pyx_v_clen; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { /* "petsc4py/PETSc/DM.pyx":2017 * * for i from 0 <= i < clen: * if cdm != NULL: # <<<<<<<<<<<<<< * dm = subtype_DM(cdm[i])() * dm.dm = cdm[i] */ __pyx_t_5 = (__pyx_v_cdm != NULL); if (__pyx_t_5) { /* "petsc4py/PETSc/DM.pyx":2018 * for i from 0 <= i < clen: * if cdm != NULL: * dm = subtype_DM(cdm[i])() # <<<<<<<<<<<<<< * dm.dm = cdm[i] * CHKERR( PetscINCREF(dm.obj) ) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM((__pyx_v_cdm[__pyx_v_i]))); if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 2018, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 2018, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(54, 2018, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_dm, ((struct PyPetscDMObject *)__pyx_t_4)); __pyx_t_4 = 0; /* "petsc4py/PETSc/DM.pyx":2019 * if cdm != NULL: * dm = subtype_DM(cdm[i])() * dm.dm = cdm[i] # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(dm.obj) ) * dms.append(dm) */ __pyx_v_dm->dm = (__pyx_v_cdm[__pyx_v_i]); /* "petsc4py/PETSc/DM.pyx":2020 * dm = subtype_DM(cdm[i])() * dm.dm = cdm[i] * CHKERR( PetscINCREF(dm.obj) ) # <<<<<<<<<<<<<< * dms.append(dm) * else: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_dm->__pyx_base.obj)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 2020, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":2021 * dm.dm = cdm[i] * CHKERR( PetscINCREF(dm.obj) ) * dms.append(dm) # <<<<<<<<<<<<<< * else: * dms.append(None) */ __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_dms, ((PyObject *)__pyx_v_dm)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(54, 2021, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":2017 * * for i from 0 <= i < clen: * if cdm != NULL: # <<<<<<<<<<<<<< * dm = subtype_DM(cdm[i])() * dm.dm = cdm[i] */ goto __pyx_L7; } /* "petsc4py/PETSc/DM.pyx":2023 * dms.append(dm) * else: * dms.append(None) # <<<<<<<<<<<<<< * * name = bytes2str(cnamelist[i]) */ /*else*/ { __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_dms, Py_None); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(54, 2023, __pyx_L1_error) } __pyx_L7:; /* "petsc4py/PETSc/DM.pyx":2025 * dms.append(None) * * name = bytes2str(cnamelist[i]) # <<<<<<<<<<<<<< * names.append(name) * CHKERR( PetscFree(cnamelist[i]) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_bytes2str((__pyx_v_cnamelist[__pyx_v_i])); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 2025, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/DM.pyx":2026 * * name = bytes2str(cnamelist[i]) * names.append(name) # <<<<<<<<<<<<<< * CHKERR( PetscFree(cnamelist[i]) ) * */ __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_names, __pyx_v_name); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(54, 2026, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":2027 * name = bytes2str(cnamelist[i]) * names.append(name) * CHKERR( PetscFree(cnamelist[i]) ) # <<<<<<<<<<<<<< * * CHKERR( ISDestroy(&cis[i]) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree((__pyx_v_cnamelist[__pyx_v_i]))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 2027, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":2029 * CHKERR( PetscFree(cnamelist[i]) ) * * CHKERR( ISDestroy(&cis[i]) ) # <<<<<<<<<<<<<< * CHKERR( DMDestroy(&cdm[i]) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISDestroy((&(__pyx_v_cis[__pyx_v_i])))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 2029, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":2030 * * CHKERR( ISDestroy(&cis[i]) ) * CHKERR( DMDestroy(&cdm[i]) ) # <<<<<<<<<<<<<< * * CHKERR( PetscFree(cis) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDestroy((&(__pyx_v_cdm[__pyx_v_i])))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 2030, __pyx_L1_error) } /* "petsc4py/PETSc/DM.pyx":2032 * CHKERR( DMDestroy(&cdm[i]) ) * * CHKERR( PetscFree(cis) ) # <<<<<<<<<<<<<< * CHKERR( PetscFree(cdm) ) * CHKERR( PetscFree(cnamelist) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_cis)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 2032, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":2033 * * CHKERR( PetscFree(cis) ) * CHKERR( PetscFree(cdm) ) # <<<<<<<<<<<<<< * CHKERR( PetscFree(cnamelist) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_cdm)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 2033, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":2034 * CHKERR( PetscFree(cis) ) * CHKERR( PetscFree(cdm) ) * CHKERR( PetscFree(cnamelist) ) # <<<<<<<<<<<<<< * * return (names, isets, dms) # TODO REVIEW */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_cnamelist)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 2034, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":2036 * CHKERR( PetscFree(cnamelist) ) * * return (names, isets, dms) # TODO REVIEW # <<<<<<<<<<<<<< * * def setSNESFunction( */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 2036, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_names); __Pyx_GIVEREF(__pyx_v_names); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_names)) __PYX_ERR(54, 2036, __pyx_L1_error); __Pyx_INCREF(__pyx_v_isets); __Pyx_GIVEREF(__pyx_v_isets); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_isets)) __PYX_ERR(54, 2036, __pyx_L1_error); __Pyx_INCREF(__pyx_v_dms); __Pyx_GIVEREF(__pyx_v_dms); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_dms)) __PYX_ERR(54, 2036, __pyx_L1_error); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DM.pyx":1990 * CHKERR( DMKSPSetComputeOperators(self.dm, KSP_ComputeOps, context) ) * * def createFieldDecomposition(self) -> tuple[list, list, list] : # <<<<<<<<<<<<<< * """Return a list of `IS` objects. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.DM.createFieldDecomposition", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_isets); __Pyx_XDECREF(__pyx_v_dms); __Pyx_XDECREF(__pyx_v_names); __Pyx_XDECREF((PyObject *)__pyx_v_dm); __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":2038 * return (names, isets, dms) # TODO REVIEW * * def setSNESFunction( # <<<<<<<<<<<<<< * self, function: SNESFunction, * args: tuple[Any, ...] | None = None, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_213setSNESFunction(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_212setSNESFunction, "DM.setSNESFunction(self, function: SNESFunction, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nSet `SNES` residual evaluation function.\n\n Not collective.\n\n Parameters\n ----------\n function\n The callback.\n args\n Positional arguments for the callback.\n kargs\n Keyword arguments for the callback.\n\n See Also\n --------\n SNES.setFunction, petsc.DMSNESSetFunction\n\n \nSource code at petsc4py/PETSc/DM.pyx:2038"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_213setSNESFunction(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_function = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setSNESFunction (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_function,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; /* "petsc4py/PETSc/DM.pyx":2040 * def setSNESFunction( * self, function: SNESFunction, * args: tuple[Any, ...] | None = None, # <<<<<<<<<<<<<< * kargs: dict[str, Any] | None = None, * ) -> None: */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/DM.pyx":2041 * self, function: SNESFunction, * args: tuple[Any, ...] | None = None, * kargs: dict[str, Any] | None = None, # <<<<<<<<<<<<<< * ) -> None: * */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_function)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 2038, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 2038, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 2038, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setSNESFunction") < 0)) __PYX_ERR(54, 2038, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_function = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setSNESFunction", 0, 1, 3, __pyx_nargs); __PYX_ERR(54, 2038, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DM.setSNESFunction", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_212setSNESFunction(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_function, __pyx_v_args, __pyx_v_kargs); /* "petsc4py/PETSc/DM.pyx":2038 * return (names, isets, dms) # TODO REVIEW * * def setSNESFunction( # <<<<<<<<<<<<<< * self, function: SNESFunction, * args: tuple[Any, ...] | None = None, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_212setSNESFunction(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_function, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setSNESFunction", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/DM.pyx":2062 * * """ * if function is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = (__pyx_v_function != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/DM.pyx":2063 * """ * if function is not None: * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (function, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/DM.pyx":2064 * if function is not None: * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (function, args, kargs) * self.set_attr('__function__', context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); if (__pyx_t_1) { __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 2064, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_2); __pyx_t_2 = 0; } /* "petsc4py/PETSc/DM.pyx":2065 * if args is None: args = () * if kargs is None: kargs = {} * context = (function, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__function__', context) * CHKERR( DMSNESSetFunction(self.dm, SNES_Function, context) ) */ __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 2065, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_function); __Pyx_GIVEREF(__pyx_v_function); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_function)) __PYX_ERR(54, 2065, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_args)) __PYX_ERR(54, 2065, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_kargs)) __PYX_ERR(54, 2065, __pyx_L1_error); __pyx_v_context = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DM.pyx":2066 * if kargs is None: kargs = {} * context = (function, args, kargs) * self.set_attr('__function__', context) # <<<<<<<<<<<<<< * CHKERR( DMSNESSetFunction(self.dm, SNES_Function, context) ) * else: */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__function__"), __pyx_v_context); if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 2066, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DM.pyx":2067 * context = (function, args, kargs) * self.set_attr('__function__', context) * CHKERR( DMSNESSetFunction(self.dm, SNES_Function, context) ) # <<<<<<<<<<<<<< * else: * CHKERR( DMSNESSetFunction(self.dm, NULL, NULL) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSNESSetFunction(__pyx_v_self->dm, __pyx_f_8petsc4py_5PETSc_SNES_Function, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 2067, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":2062 * * """ * if function is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ goto __pyx_L3; } /* "petsc4py/PETSc/DM.pyx":2069 * CHKERR( DMSNESSetFunction(self.dm, SNES_Function, context) ) * else: * CHKERR( DMSNESSetFunction(self.dm, NULL, NULL) ) # <<<<<<<<<<<<<< * * def setSNESJacobian( */ /*else*/ { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSNESSetFunction(__pyx_v_self->dm, NULL, NULL)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 2069, __pyx_L1_error) } __pyx_L3:; /* "petsc4py/PETSc/DM.pyx":2038 * return (names, isets, dms) # TODO REVIEW * * def setSNESFunction( # <<<<<<<<<<<<<< * self, function: SNESFunction, * args: tuple[Any, ...] | None = None, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DM.setSNESFunction", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":2071 * CHKERR( DMSNESSetFunction(self.dm, NULL, NULL) ) * * def setSNESJacobian( # <<<<<<<<<<<<<< * self, jacobian: SNESJacobianFunction, * args: tuple[Any, ...] | None = None, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_215setSNESJacobian(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_214setSNESJacobian, "DM.setSNESJacobian(self, jacobian: SNESJacobianFunction, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nSet the `SNES` Jacobian evaluation function.\n\n Not collective.\n\n Parameters\n ----------\n jacobian\n The Jacobian callback.\n args\n Positional arguments for the callback.\n kargs\n Keyword arguments for the callback.\n\n See Also\n --------\n SNES.setJacobian, petsc.DMSNESSetJacobian\n\n \nSource code at petsc4py/PETSc/DM.pyx:2071"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_215setSNESJacobian(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_jacobian = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setSNESJacobian (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_jacobian,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; /* "petsc4py/PETSc/DM.pyx":2073 * def setSNESJacobian( * self, jacobian: SNESJacobianFunction, * args: tuple[Any, ...] | None = None, # <<<<<<<<<<<<<< * kargs: dict[str, Any] | None = None, * ) -> None: */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/DM.pyx":2074 * self, jacobian: SNESJacobianFunction, * args: tuple[Any, ...] | None = None, * kargs: dict[str, Any] | None = None, # <<<<<<<<<<<<<< * ) -> None: * """Set the `SNES` Jacobian evaluation function. */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_jacobian)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 2071, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 2071, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 2071, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setSNESJacobian") < 0)) __PYX_ERR(54, 2071, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_jacobian = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setSNESJacobian", 0, 1, 3, __pyx_nargs); __PYX_ERR(54, 2071, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DM.setSNESJacobian", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_214setSNESJacobian(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_jacobian, __pyx_v_args, __pyx_v_kargs); /* "petsc4py/PETSc/DM.pyx":2071 * CHKERR( DMSNESSetFunction(self.dm, NULL, NULL) ) * * def setSNESJacobian( # <<<<<<<<<<<<<< * self, jacobian: SNESJacobianFunction, * args: tuple[Any, ...] | None = None, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_214setSNESJacobian(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_jacobian, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setSNESJacobian", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/DM.pyx":2094 * * """ * if jacobian is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = (__pyx_v_jacobian != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/DM.pyx":2095 * """ * if jacobian is not None: * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (jacobian, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/DM.pyx":2096 * if jacobian is not None: * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (jacobian, args, kargs) * self.set_attr('__jacobian__', context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); if (__pyx_t_1) { __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 2096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_2); __pyx_t_2 = 0; } /* "petsc4py/PETSc/DM.pyx":2097 * if args is None: args = () * if kargs is None: kargs = {} * context = (jacobian, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__jacobian__', context) * CHKERR( DMSNESSetJacobian(self.dm, SNES_Jacobian, context) ) */ __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 2097, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_jacobian); __Pyx_GIVEREF(__pyx_v_jacobian); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_jacobian)) __PYX_ERR(54, 2097, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_args)) __PYX_ERR(54, 2097, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_kargs)) __PYX_ERR(54, 2097, __pyx_L1_error); __pyx_v_context = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DM.pyx":2098 * if kargs is None: kargs = {} * context = (jacobian, args, kargs) * self.set_attr('__jacobian__', context) # <<<<<<<<<<<<<< * CHKERR( DMSNESSetJacobian(self.dm, SNES_Jacobian, context) ) * else: */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__jacobian__"), __pyx_v_context); if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 2098, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DM.pyx":2099 * context = (jacobian, args, kargs) * self.set_attr('__jacobian__', context) * CHKERR( DMSNESSetJacobian(self.dm, SNES_Jacobian, context) ) # <<<<<<<<<<<<<< * else: * CHKERR( DMSNESSetJacobian(self.dm, NULL, NULL) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSNESSetJacobian(__pyx_v_self->dm, __pyx_f_8petsc4py_5PETSc_SNES_Jacobian, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 2099, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":2094 * * """ * if jacobian is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ goto __pyx_L3; } /* "petsc4py/PETSc/DM.pyx":2101 * CHKERR( DMSNESSetJacobian(self.dm, SNES_Jacobian, context) ) * else: * CHKERR( DMSNESSetJacobian(self.dm, NULL, NULL) ) # <<<<<<<<<<<<<< * * def addCoarsenHook( */ /*else*/ { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSNESSetJacobian(__pyx_v_self->dm, NULL, NULL)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 2101, __pyx_L1_error) } __pyx_L3:; /* "petsc4py/PETSc/DM.pyx":2071 * CHKERR( DMSNESSetFunction(self.dm, NULL, NULL) ) * * def setSNESJacobian( # <<<<<<<<<<<<<< * self, jacobian: SNESJacobianFunction, * args: tuple[Any, ...] | None = None, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DM.setSNESJacobian", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":2103 * CHKERR( DMSNESSetJacobian(self.dm, NULL, NULL) ) * * def addCoarsenHook( # <<<<<<<<<<<<<< * self, * coarsenhook: DMCoarsenHookFunction, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_217addCoarsenHook(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DM_216addCoarsenHook, "DM.addCoarsenHook(self, coarsenhook: DMCoarsenHookFunction, restricthook: DMRestrictHookFunction, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nAdd a callback to be executed when restricting to a coarser grid.\n\n Logically collective.\n\n Parameters\n ----------\n coarsenhook\n The coarsen hook function.\n restricthook\n The restrict hook function.\n args\n Positional arguments for the hooks.\n kargs\n Keyword arguments for the hooks.\n\n See Also\n --------\n petsc.DMCoarsenHookAdd\n\n \nSource code at petsc4py/PETSc/DM.pyx:2103"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_217addCoarsenHook(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_coarsenhook = 0; PyObject *__pyx_v_restricthook = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("addCoarsenHook (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_coarsenhook,&__pyx_n_s_restricthook,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; /* "petsc4py/PETSc/DM.pyx":2107 * coarsenhook: DMCoarsenHookFunction, * restricthook: DMRestrictHookFunction, * args: tuple[Any, ...] | None = None, # <<<<<<<<<<<<<< * kargs: dict[str, Any] | None = None, * ) -> None: */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/DM.pyx":2108 * restricthook: DMRestrictHookFunction, * args: tuple[Any, ...] | None = None, * kargs: dict[str, Any] | None = None, # <<<<<<<<<<<<<< * ) -> None: * """Add a callback to be executed when restricting to a coarser grid. */ values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_coarsenhook)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 2103, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_restricthook)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 2103, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("addCoarsenHook", 0, 2, 4, 1); __PYX_ERR(54, 2103, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 2103, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 2103, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "addCoarsenHook") < 0)) __PYX_ERR(54, 2103, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_coarsenhook = values[0]; __pyx_v_restricthook = values[1]; __pyx_v_args = values[2]; __pyx_v_kargs = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("addCoarsenHook", 0, 2, 4, __pyx_nargs); __PYX_ERR(54, 2103, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DM.addCoarsenHook", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_216addCoarsenHook(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_coarsenhook, __pyx_v_restricthook, __pyx_v_args, __pyx_v_kargs); /* "petsc4py/PETSc/DM.pyx":2103 * CHKERR( DMSNESSetJacobian(self.dm, NULL, NULL) ) * * def addCoarsenHook( # <<<<<<<<<<<<<< * self, * coarsenhook: DMCoarsenHookFunction, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_216addCoarsenHook(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_coarsenhook, PyObject *__pyx_v_restricthook, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_coarsencontext = NULL; PyObject *__pyx_v_coarsenhooks = NULL; PyObject *__pyx_v_restrictcontext = NULL; PyObject *__pyx_v_restricthooks = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("addCoarsenHook", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/DM.pyx":2130 * * """ * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * */ __pyx_t_1 = (__pyx_v_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/DM.pyx":2131 * """ * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * * if coarsenhook is not None: */ __pyx_t_1 = (__pyx_v_kargs == Py_None); if (__pyx_t_1) { __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 2131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_2); __pyx_t_2 = 0; } /* "petsc4py/PETSc/DM.pyx":2133 * if kargs is None: kargs = {} * * if coarsenhook is not None: # <<<<<<<<<<<<<< * coarsencontext = (coarsenhook, args, kargs) * */ __pyx_t_1 = (__pyx_v_coarsenhook != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/DM.pyx":2134 * * if coarsenhook is not None: * coarsencontext = (coarsenhook, args, kargs) # <<<<<<<<<<<<<< * * coarsenhooks = self.get_attr('__coarsenhooks__') */ __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 2134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_coarsenhook); __Pyx_GIVEREF(__pyx_v_coarsenhook); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_coarsenhook)) __PYX_ERR(54, 2134, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_args)) __PYX_ERR(54, 2134, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_kargs)) __PYX_ERR(54, 2134, __pyx_L1_error); __pyx_v_coarsencontext = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DM.pyx":2136 * coarsencontext = (coarsenhook, args, kargs) * * coarsenhooks = self.get_attr('__coarsenhooks__') # <<<<<<<<<<<<<< * if coarsenhooks is None: * coarsenhooks = [coarsencontext] */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__coarsenhooks__")); if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 2136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_coarsenhooks = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/DM.pyx":2137 * * coarsenhooks = self.get_attr('__coarsenhooks__') * if coarsenhooks is None: # <<<<<<<<<<<<<< * coarsenhooks = [coarsencontext] * CHKERR( DMCoarsenHookAdd(self.dm, DM_PyCoarsenHook, NULL, NULL) ) */ __pyx_t_1 = (__pyx_v_coarsenhooks == Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/DM.pyx":2138 * coarsenhooks = self.get_attr('__coarsenhooks__') * if coarsenhooks is None: * coarsenhooks = [coarsencontext] # <<<<<<<<<<<<<< * CHKERR( DMCoarsenHookAdd(self.dm, DM_PyCoarsenHook, NULL, NULL) ) * else: */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 2138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_coarsencontext); __Pyx_GIVEREF(__pyx_v_coarsencontext); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_v_coarsencontext)) __PYX_ERR(54, 2138, __pyx_L1_error); __Pyx_DECREF_SET(__pyx_v_coarsenhooks, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DM.pyx":2139 * if coarsenhooks is None: * coarsenhooks = [coarsencontext] * CHKERR( DMCoarsenHookAdd(self.dm, DM_PyCoarsenHook, NULL, NULL) ) # <<<<<<<<<<<<<< * else: * coarsenhooks.append(coarsencontext) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCoarsenHookAdd(__pyx_v_self->dm, __pyx_f_8petsc4py_5PETSc_DM_PyCoarsenHook, NULL, ((void *)NULL))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 2139, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":2137 * * coarsenhooks = self.get_attr('__coarsenhooks__') * if coarsenhooks is None: # <<<<<<<<<<<<<< * coarsenhooks = [coarsencontext] * CHKERR( DMCoarsenHookAdd(self.dm, DM_PyCoarsenHook, NULL, NULL) ) */ goto __pyx_L6; } /* "petsc4py/PETSc/DM.pyx":2141 * CHKERR( DMCoarsenHookAdd(self.dm, DM_PyCoarsenHook, NULL, NULL) ) * else: * coarsenhooks.append(coarsencontext) # <<<<<<<<<<<<<< * self.set_attr('__coarsenhooks__', coarsenhooks) * */ /*else*/ { __pyx_t_4 = __Pyx_PyObject_Append(__pyx_v_coarsenhooks, __pyx_v_coarsencontext); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(54, 2141, __pyx_L1_error) } __pyx_L6:; /* "petsc4py/PETSc/DM.pyx":2142 * else: * coarsenhooks.append(coarsencontext) * self.set_attr('__coarsenhooks__', coarsenhooks) # <<<<<<<<<<<<<< * * if restricthook is not None: */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__coarsenhooks__"), __pyx_v_coarsenhooks); if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 2142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DM.pyx":2133 * if kargs is None: kargs = {} * * if coarsenhook is not None: # <<<<<<<<<<<<<< * coarsencontext = (coarsenhook, args, kargs) * */ } /* "petsc4py/PETSc/DM.pyx":2144 * self.set_attr('__coarsenhooks__', coarsenhooks) * * if restricthook is not None: # <<<<<<<<<<<<<< * restrictcontext = (restricthook, args, kargs) * */ __pyx_t_1 = (__pyx_v_restricthook != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/DM.pyx":2145 * * if restricthook is not None: * restrictcontext = (restricthook, args, kargs) # <<<<<<<<<<<<<< * * restricthooks = self.get_attr('__restricthooks__') */ __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 2145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_restricthook); __Pyx_GIVEREF(__pyx_v_restricthook); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_restricthook)) __PYX_ERR(54, 2145, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_args)) __PYX_ERR(54, 2145, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_kargs)) __PYX_ERR(54, 2145, __pyx_L1_error); __pyx_v_restrictcontext = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DM.pyx":2147 * restrictcontext = (restricthook, args, kargs) * * restricthooks = self.get_attr('__restricthooks__') # <<<<<<<<<<<<<< * if restricthooks is None: * restricthooks = [restrictcontext] */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__restricthooks__")); if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 2147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_restricthooks = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/DM.pyx":2148 * * restricthooks = self.get_attr('__restricthooks__') * if restricthooks is None: # <<<<<<<<<<<<<< * restricthooks = [restrictcontext] * CHKERR( DMCoarsenHookAdd(self.dm, NULL, DM_PyRestrictHook, NULL) ) */ __pyx_t_1 = (__pyx_v_restricthooks == Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/DM.pyx":2149 * restricthooks = self.get_attr('__restricthooks__') * if restricthooks is None: * restricthooks = [restrictcontext] # <<<<<<<<<<<<<< * CHKERR( DMCoarsenHookAdd(self.dm, NULL, DM_PyRestrictHook, NULL) ) * else: */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 2149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_restrictcontext); __Pyx_GIVEREF(__pyx_v_restrictcontext); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_v_restrictcontext)) __PYX_ERR(54, 2149, __pyx_L1_error); __Pyx_DECREF_SET(__pyx_v_restricthooks, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DM.pyx":2150 * if restricthooks is None: * restricthooks = [restrictcontext] * CHKERR( DMCoarsenHookAdd(self.dm, NULL, DM_PyRestrictHook, NULL) ) # <<<<<<<<<<<<<< * else: * restricthooks.append(restrictcontext) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCoarsenHookAdd(__pyx_v_self->dm, NULL, __pyx_f_8petsc4py_5PETSc_DM_PyRestrictHook, ((void *)NULL))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 2150, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":2148 * * restricthooks = self.get_attr('__restricthooks__') * if restricthooks is None: # <<<<<<<<<<<<<< * restricthooks = [restrictcontext] * CHKERR( DMCoarsenHookAdd(self.dm, NULL, DM_PyRestrictHook, NULL) ) */ goto __pyx_L8; } /* "petsc4py/PETSc/DM.pyx":2152 * CHKERR( DMCoarsenHookAdd(self.dm, NULL, DM_PyRestrictHook, NULL) ) * else: * restricthooks.append(restrictcontext) # <<<<<<<<<<<<<< * self.set_attr('__restricthooks__', restricthooks) * */ /*else*/ { __pyx_t_4 = __Pyx_PyObject_Append(__pyx_v_restricthooks, __pyx_v_restrictcontext); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(54, 2152, __pyx_L1_error) } __pyx_L8:; /* "petsc4py/PETSc/DM.pyx":2153 * else: * restricthooks.append(restrictcontext) * self.set_attr('__restricthooks__', restricthooks) # <<<<<<<<<<<<<< * * # --- application context --- */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__restricthooks__"), __pyx_v_restricthooks); if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 2153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DM.pyx":2144 * self.set_attr('__coarsenhooks__', coarsenhooks) * * if restricthook is not None: # <<<<<<<<<<<<<< * restrictcontext = (restricthook, args, kargs) * */ } /* "petsc4py/PETSc/DM.pyx":2103 * CHKERR( DMSNESSetJacobian(self.dm, NULL, NULL) ) * * def addCoarsenHook( # <<<<<<<<<<<<<< * self, * coarsenhook: DMCoarsenHookFunction, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DM.addCoarsenHook", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_coarsencontext); __Pyx_XDECREF(__pyx_v_coarsenhooks); __Pyx_XDECREF(__pyx_v_restrictcontext); __Pyx_XDECREF(__pyx_v_restricthooks); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":2158 * * property appctx: * def __get__(self): # <<<<<<<<<<<<<< * return self.getAppCtx() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_6appctx_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_6appctx_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_6appctx___get__(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_6appctx___get__(struct PyPetscDMObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/DM.pyx":2159 * property appctx: * def __get__(self): * return self.getAppCtx() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setAppCtx(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getAppCtx); if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 2159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 2159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DM.pyx":2158 * * property appctx: * def __get__(self): # <<<<<<<<<<<<<< * return self.getAppCtx() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DM.appctx.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":2160 * def __get__(self): * return self.getAppCtx() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setAppCtx(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_2DM_6appctx_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_2DM_6appctx_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_6appctx_2__set__(((struct PyPetscDMObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_2DM_6appctx_2__set__(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "petsc4py/PETSc/DM.pyx":2161 * return self.getAppCtx() * def __set__(self, value): * self.setAppCtx(value) # <<<<<<<<<<<<<< * * # --- discretization space --- */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setAppCtx); if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 2161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_value}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 2161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DM.pyx":2160 * def __get__(self): * return self.getAppCtx() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setAppCtx(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DM.appctx.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":2166 * * property ds: * def __get__(self): # <<<<<<<<<<<<<< * return self.getDS() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_2ds_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_2ds_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_2ds___get__(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_2ds___get__(struct PyPetscDMObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/DM.pyx":2167 * property ds: * def __get__(self): * return self.getDS() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setDS(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getDS); if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 2167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 2167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DM.pyx":2166 * * property ds: * def __get__(self): # <<<<<<<<<<<<<< * return self.getDS() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DM.ds.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DM.pyx":2168 * def __get__(self): * return self.getDS() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setDS(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_2DM_2ds_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_2DM_2ds_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_2ds_2__set__(((struct PyPetscDMObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_2DM_2ds_2__set__(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "petsc4py/PETSc/DM.pyx":2169 * return self.getDS() * def __set__(self, value): * self.setDS(value) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setDS); if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 2169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_value}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 2169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DM.pyx":2168 * def __get__(self): * return self.getDS() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setDS(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DM.ds.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DS.pyx":15 * # * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.ds * self.ds = NULL */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_2DS_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_2DS_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DS___cinit__(((struct PyPetscDSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_2DS___cinit__(struct PyPetscDSObject *__pyx_v_self) { int __pyx_r; /* "petsc4py/PETSc/DS.pyx":16 * * def __cinit__(self): * self.obj = &self.ds # <<<<<<<<<<<<<< * self.ds = NULL * */ __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->ds)); /* "petsc4py/PETSc/DS.pyx":17 * def __cinit__(self): * self.obj = &self.ds * self.ds = NULL # <<<<<<<<<<<<<< * * def view(self, Viewer viewer=None) -> None: */ __pyx_v_self->ds = NULL; /* "petsc4py/PETSc/DS.pyx":15 * # * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.ds * self.ds = NULL */ /* function exit code */ __pyx_r = 0; return __pyx_r; } /* "petsc4py/PETSc/DS.pyx":19 * self.ds = NULL * * def view(self, Viewer viewer=None) -> None: # <<<<<<<<<<<<<< * """View a discrete system. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DS_3view(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DS_2view, "DS.view(self, viewer: Viewer | None = None) -> None\nView a discrete system.\n\n Collective.\n\n Parameters\n ----------\n viewer\n A `Viewer` to display the system.\n\n See Also\n --------\n petsc.PetscDSView\n\n \nSource code at petsc4py/PETSc/DS.pyx:19"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DS_3view(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscViewerObject *__pyx_v_viewer = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("view (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscViewerObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_viewer); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(55, 19, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "view") < 0)) __PYX_ERR(55, 19, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, __pyx_nargs); __PYX_ERR(55, 19, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DS.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(55, 19, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DS_2view(((struct PyPetscDSObject *)__pyx_v_self), __pyx_v_viewer); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_2view(struct PyPetscDSObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer) { PetscViewer __pyx_v_vwr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscViewer __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("view", 1); /* "petsc4py/PETSc/DS.pyx":34 * * """ * cdef PetscViewer vwr = NULL # <<<<<<<<<<<<<< * if viewer is not None: vwr = viewer.vwr * CHKERR( PetscDSView(self.ds, vwr) ) */ __pyx_v_vwr = NULL; /* "petsc4py/PETSc/DS.pyx":35 * """ * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr # <<<<<<<<<<<<<< * CHKERR( PetscDSView(self.ds, vwr) ) * */ __pyx_t_1 = (((PyObject *)__pyx_v_viewer) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_viewer->vwr; __pyx_v_vwr = __pyx_t_2; } /* "petsc4py/PETSc/DS.pyx":36 * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr * CHKERR( PetscDSView(self.ds, vwr) ) # <<<<<<<<<<<<<< * * def destroy(self) -> Self: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDSView(__pyx_v_self->ds, __pyx_v_vwr)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(55, 36, __pyx_L1_error) /* "petsc4py/PETSc/DS.pyx":19 * self.ds = NULL * * def view(self, Viewer viewer=None) -> None: # <<<<<<<<<<<<<< * """View a discrete system. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DS.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DS.pyx":38 * CHKERR( PetscDSView(self.ds, vwr) ) * * def destroy(self) -> Self: # <<<<<<<<<<<<<< * """Destroy the discrete system. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DS_5destroy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DS_4destroy, "DS.destroy(self) -> Self\nDestroy the discrete system.\n\n Collective.\n\n See Also\n --------\n create, petsc.PetscDSDestroy\n\n \nSource code at petsc4py/PETSc/DS.pyx:38"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DS_5destroy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("destroy (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DS_4destroy(((struct PyPetscDSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_4destroy(struct PyPetscDSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("destroy", 1); /* "petsc4py/PETSc/DS.pyx":48 * * """ * CHKERR( PetscDSDestroy(&self.ds) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDSDestroy((&__pyx_v_self->ds))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(55, 48, __pyx_L1_error) /* "petsc4py/PETSc/DS.pyx":49 * """ * CHKERR( PetscDSDestroy(&self.ds) ) * return self # <<<<<<<<<<<<<< * * def create(self, comm: Comm | None = None) -> Self: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/DS.pyx":38 * CHKERR( PetscDSView(self.ds, vwr) ) * * def destroy(self) -> Self: # <<<<<<<<<<<<<< * """Destroy the discrete system. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DS.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DS.pyx":51 * return self * * def create(self, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Create an empty DS. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DS_7create(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DS_6create, "DS.create(self, comm: Comm | None = None) -> Self\nCreate an empty DS.\n\n Collective.\n\n The type can then be set with `setType`.\n\n Parameters\n ----------\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n setType, destroy, petsc.PetscDSCreate\n\n \nSource code at petsc4py/PETSc/DS.pyx:51"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DS_7create(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(55, 51, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "create") < 0)) __PYX_ERR(55, 51, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_comm = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, __pyx_nargs); __PYX_ERR(55, 51, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DS.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DS_6create(((struct PyPetscDSObject *)__pyx_v_self), __pyx_v_comm); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_6create(struct PyPetscDSObject *__pyx_v_self, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PetscDS __pyx_v_newds; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create", 1); /* "petsc4py/PETSc/DS.pyx":68 * * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscDS newds = NULL * CHKERR( PetscDSCreate(ccomm, &newds) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(55, 68, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/DS.pyx":69 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscDS newds = NULL # <<<<<<<<<<<<<< * CHKERR( PetscDSCreate(ccomm, &newds) ) * CHKERR( PetscCLEAR(self.obj) ); self.ds = newds */ __pyx_v_newds = NULL; /* "petsc4py/PETSc/DS.pyx":70 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscDS newds = NULL * CHKERR( PetscDSCreate(ccomm, &newds) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.ds = newds * return self */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDSCreate(__pyx_v_ccomm, (&__pyx_v_newds))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(55, 70, __pyx_L1_error) /* "petsc4py/PETSc/DS.pyx":71 * cdef PetscDS newds = NULL * CHKERR( PetscDSCreate(ccomm, &newds) ) * CHKERR( PetscCLEAR(self.obj) ); self.ds = newds # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(55, 71, __pyx_L1_error) __pyx_v_self->ds = __pyx_v_newds; /* "petsc4py/PETSc/DS.pyx":72 * CHKERR( PetscDSCreate(ccomm, &newds) ) * CHKERR( PetscCLEAR(self.obj) ); self.ds = newds * return self # <<<<<<<<<<<<<< * * def setType(self, ds_type: Type | str) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/DS.pyx":51 * return self * * def create(self, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Create an empty DS. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DS.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DS.pyx":74 * return self * * def setType(self, ds_type: Type | str) -> None: # <<<<<<<<<<<<<< * """Build a particular type of a discrete system. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DS_9setType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DS_8setType, "DS.setType(self, ds_type: Type | str) -> None\nBuild a particular type of a discrete system.\n\n Collective.\n\n Parameters\n ----------\n ds_type\n The type of the discrete system.\n\n See Also\n --------\n getType, petsc.PetscDSSetType\n\n \nSource code at petsc4py/PETSc/DS.pyx:74"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DS_9setType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_ds_type = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ds_type,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ds_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(55, 74, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setType") < 0)) __PYX_ERR(55, 74, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_ds_type = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, __pyx_nargs); __PYX_ERR(55, 74, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DS.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DS_8setType(((struct PyPetscDSObject *)__pyx_v_self), __pyx_v_ds_type); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_8setType(struct PyPetscDSObject *__pyx_v_self, PyObject *__pyx_v_ds_type) { PetscDSType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setType", 0); __Pyx_INCREF(__pyx_v_ds_type); /* "petsc4py/PETSc/DS.pyx":89 * * """ * cdef PetscDSType cval = NULL # <<<<<<<<<<<<<< * ds_type = str2bytes(ds_type, &cval) * CHKERR( PetscDSSetType(self.ds, cval) ) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/DS.pyx":90 * """ * cdef PetscDSType cval = NULL * ds_type = str2bytes(ds_type, &cval) # <<<<<<<<<<<<<< * CHKERR( PetscDSSetType(self.ds, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_ds_type, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(55, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_ds_type, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DS.pyx":91 * cdef PetscDSType cval = NULL * ds_type = str2bytes(ds_type, &cval) * CHKERR( PetscDSSetType(self.ds, cval) ) # <<<<<<<<<<<<<< * * def getType(self) -> str: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDSSetType(__pyx_v_self->ds, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(55, 91, __pyx_L1_error) /* "petsc4py/PETSc/DS.pyx":74 * return self * * def setType(self, ds_type: Type | str) -> None: # <<<<<<<<<<<<<< * """Build a particular type of a discrete system. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DS.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ds_type); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DS.pyx":93 * CHKERR( PetscDSSetType(self.ds, cval) ) * * def getType(self) -> str: # <<<<<<<<<<<<<< * """Return the type of the discrete system. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DS_11getType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DS_10getType, "DS.getType(self) -> str\nReturn the type of the discrete system.\n\n Not collective.\n\n See Also\n --------\n setType, petsc.PetscDSGetType\n\n \nSource code at petsc4py/PETSc/DS.pyx:93"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DS_11getType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getType", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DS_10getType(((struct PyPetscDSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_10getType(struct PyPetscDSObject *__pyx_v_self) { PetscDSType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getType", 1); /* "petsc4py/PETSc/DS.pyx":103 * * """ * cdef PetscDSType cval = NULL # <<<<<<<<<<<<<< * CHKERR( PetscDSGetType(self.ds, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/DS.pyx":104 * """ * cdef PetscDSType cval = NULL * CHKERR( PetscDSGetType(self.ds, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDSGetType(__pyx_v_self->ds, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(55, 104, __pyx_L1_error) /* "petsc4py/PETSc/DS.pyx":105 * cdef PetscDSType cval = NULL * CHKERR( PetscDSGetType(self.ds, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * def setFromOptions(self) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(55, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DS.pyx":93 * CHKERR( PetscDSSetType(self.ds, cval) ) * * def getType(self) -> str: # <<<<<<<<<<<<<< * """Return the type of the discrete system. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DS.getType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DS.pyx":107 * return bytes2str(cval) * * def setFromOptions(self) -> None: # <<<<<<<<<<<<<< * """Set parameters in a `DS` from the options database. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DS_13setFromOptions(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DS_12setFromOptions, "DS.setFromOptions(self) -> None\nSet parameters in a `DS` from the options database.\n\n Collective.\n\n See Also\n --------\n petsc_options, petsc.PetscDSSetFromOptions\n\n \nSource code at petsc4py/PETSc/DS.pyx:107"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DS_13setFromOptions(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFromOptions (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("setFromOptions", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setFromOptions", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DS_12setFromOptions(((struct PyPetscDSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_12setFromOptions(struct PyPetscDSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFromOptions", 1); /* "petsc4py/PETSc/DS.pyx":117 * * """ * CHKERR( PetscDSSetFromOptions(self.ds) ) # <<<<<<<<<<<<<< * * def setUp(self) -> Self: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDSSetFromOptions(__pyx_v_self->ds)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(55, 117, __pyx_L1_error) /* "petsc4py/PETSc/DS.pyx":107 * return bytes2str(cval) * * def setFromOptions(self) -> None: # <<<<<<<<<<<<<< * """Set parameters in a `DS` from the options database. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DS.setFromOptions", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DS.pyx":119 * CHKERR( PetscDSSetFromOptions(self.ds) ) * * def setUp(self) -> Self: # <<<<<<<<<<<<<< * """Construct data structures for the discrete system. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DS_15setUp(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DS_14setUp, "DS.setUp(self) -> Self\nConstruct data structures for the discrete system.\n\n Collective.\n\n See Also\n --------\n petsc.PetscDSSetUp\n\n \nSource code at petsc4py/PETSc/DS.pyx:119"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DS_15setUp(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setUp (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("setUp", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setUp", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DS_14setUp(((struct PyPetscDSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_14setUp(struct PyPetscDSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setUp", 1); /* "petsc4py/PETSc/DS.pyx":129 * * """ * CHKERR( PetscDSSetUp(self.ds) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDSSetUp(__pyx_v_self->ds)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(55, 129, __pyx_L1_error) /* "petsc4py/PETSc/DS.pyx":130 * """ * CHKERR( PetscDSSetUp(self.ds) ) * return self # <<<<<<<<<<<<<< * * # */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/DS.pyx":119 * CHKERR( PetscDSSetFromOptions(self.ds) ) * * def setUp(self) -> Self: # <<<<<<<<<<<<<< * """Construct data structures for the discrete system. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DS.setUp", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DS.pyx":134 * # * * def getSpatialDimension(self) -> int: # <<<<<<<<<<<<<< * """Return the spatial dimension of the DS. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DS_17getSpatialDimension(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DS_16getSpatialDimension, "DS.getSpatialDimension(self) -> int\nReturn the spatial dimension of the DS.\n\n Not collective.\n\n The spatial dimension of the `DS` is the topological dimension of the\n discretizations.\n\n See Also\n --------\n petsc.PetscDSGetSpatialDimension\n\n \nSource code at petsc4py/PETSc/DS.pyx:134"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DS_17getSpatialDimension(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSpatialDimension (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getSpatialDimension", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getSpatialDimension", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DS_16getSpatialDimension(((struct PyPetscDSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_16getSpatialDimension(struct PyPetscDSObject *__pyx_v_self) { PetscInt __pyx_v_dim; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSpatialDimension", 1); /* "petsc4py/PETSc/DS.pyx":147 * * """ * cdef PetscInt dim = 0 # <<<<<<<<<<<<<< * CHKERR( PetscDSGetSpatialDimension(self.ds, &dim) ) * return toInt(dim) */ __pyx_v_dim = 0; /* "petsc4py/PETSc/DS.pyx":148 * """ * cdef PetscInt dim = 0 * CHKERR( PetscDSGetSpatialDimension(self.ds, &dim) ) # <<<<<<<<<<<<<< * return toInt(dim) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDSGetSpatialDimension(__pyx_v_self->ds, (&__pyx_v_dim))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(55, 148, __pyx_L1_error) /* "petsc4py/PETSc/DS.pyx":149 * cdef PetscInt dim = 0 * CHKERR( PetscDSGetSpatialDimension(self.ds, &dim) ) * return toInt(dim) # <<<<<<<<<<<<<< * * def getCoordinateDimension(self) -> int: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_dim); if (unlikely(!__pyx_t_2)) __PYX_ERR(55, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DS.pyx":134 * # * * def getSpatialDimension(self) -> int: # <<<<<<<<<<<<<< * """Return the spatial dimension of the DS. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DS.getSpatialDimension", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DS.pyx":151 * return toInt(dim) * * def getCoordinateDimension(self) -> int: # <<<<<<<<<<<<<< * """Return the coordinate dimension of the DS. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DS_19getCoordinateDimension(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DS_18getCoordinateDimension, "DS.getCoordinateDimension(self) -> int\nReturn the coordinate dimension of the DS.\n\n Not collective.\n\n The coordinate dimension of the `DS` is the dimension of the space into\n which the discretiaztions are embedded.\n\n See Also\n --------\n petsc.PetscDSGetCoordinateDimension\n\n \nSource code at petsc4py/PETSc/DS.pyx:151"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DS_19getCoordinateDimension(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getCoordinateDimension (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getCoordinateDimension", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getCoordinateDimension", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DS_18getCoordinateDimension(((struct PyPetscDSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_18getCoordinateDimension(struct PyPetscDSObject *__pyx_v_self) { PetscInt __pyx_v_dim; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getCoordinateDimension", 1); /* "petsc4py/PETSc/DS.pyx":164 * * """ * cdef PetscInt dim = 0 # <<<<<<<<<<<<<< * CHKERR( PetscDSGetCoordinateDimension(self.ds, &dim) ) * return toInt(dim) */ __pyx_v_dim = 0; /* "petsc4py/PETSc/DS.pyx":165 * """ * cdef PetscInt dim = 0 * CHKERR( PetscDSGetCoordinateDimension(self.ds, &dim) ) # <<<<<<<<<<<<<< * return toInt(dim) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDSGetCoordinateDimension(__pyx_v_self->ds, (&__pyx_v_dim))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(55, 165, __pyx_L1_error) /* "petsc4py/PETSc/DS.pyx":166 * cdef PetscInt dim = 0 * CHKERR( PetscDSGetCoordinateDimension(self.ds, &dim) ) * return toInt(dim) # <<<<<<<<<<<<<< * * def getNumFields(self) -> int: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_dim); if (unlikely(!__pyx_t_2)) __PYX_ERR(55, 166, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DS.pyx":151 * return toInt(dim) * * def getCoordinateDimension(self) -> int: # <<<<<<<<<<<<<< * """Return the coordinate dimension of the DS. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DS.getCoordinateDimension", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DS.pyx":168 * return toInt(dim) * * def getNumFields(self) -> int: # <<<<<<<<<<<<<< * """Return the number of fields in the DS. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DS_21getNumFields(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DS_20getNumFields, "DS.getNumFields(self) -> int\nReturn the number of fields in the DS.\n\n Not collective.\n\n See Also\n --------\n petsc.PetscDSGetNumFields\n\n \nSource code at petsc4py/PETSc/DS.pyx:168"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DS_21getNumFields(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getNumFields (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getNumFields", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getNumFields", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DS_20getNumFields(((struct PyPetscDSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_20getNumFields(struct PyPetscDSObject *__pyx_v_self) { PetscInt __pyx_v_nf; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getNumFields", 1); /* "petsc4py/PETSc/DS.pyx":178 * * """ * cdef PetscInt nf = 0 # <<<<<<<<<<<<<< * CHKERR( PetscDSGetNumFields(self.ds, &nf) ) * return toInt(nf) */ __pyx_v_nf = 0; /* "petsc4py/PETSc/DS.pyx":179 * """ * cdef PetscInt nf = 0 * CHKERR( PetscDSGetNumFields(self.ds, &nf) ) # <<<<<<<<<<<<<< * return toInt(nf) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDSGetNumFields(__pyx_v_self->ds, (&__pyx_v_nf))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(55, 179, __pyx_L1_error) /* "petsc4py/PETSc/DS.pyx":180 * cdef PetscInt nf = 0 * CHKERR( PetscDSGetNumFields(self.ds, &nf) ) * return toInt(nf) # <<<<<<<<<<<<<< * * def getFieldIndex(self, Object disc) -> int: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nf); if (unlikely(!__pyx_t_2)) __PYX_ERR(55, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DS.pyx":168 * return toInt(dim) * * def getNumFields(self) -> int: # <<<<<<<<<<<<<< * """Return the number of fields in the DS. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DS.getNumFields", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DS.pyx":182 * return toInt(nf) * * def getFieldIndex(self, Object disc) -> int: # <<<<<<<<<<<<<< * """Return the index of the given field. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DS_23getFieldIndex(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DS_22getFieldIndex, "DS.getFieldIndex(self, disc: Object) -> int\nReturn the index of the given field.\n\n Not collective.\n\n Parameters\n ----------\n disc\n The discretization object.\n\n See Also\n --------\n petsc.PetscDSGetFieldIndex\n\n \nSource code at petsc4py/PETSc/DS.pyx:182"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DS_23getFieldIndex(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscObjectObject *__pyx_v_disc = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getFieldIndex (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_disc,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_disc)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(55, 182, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getFieldIndex") < 0)) __PYX_ERR(55, 182, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_disc = ((struct PyPetscObjectObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getFieldIndex", 1, 1, 1, __pyx_nargs); __PYX_ERR(55, 182, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DS.getFieldIndex", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_disc), __pyx_ptype_8petsc4py_5PETSc_Object, 0, "disc", 0))) __PYX_ERR(55, 182, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DS_22getFieldIndex(((struct PyPetscDSObject *)__pyx_v_self), __pyx_v_disc); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_22getFieldIndex(struct PyPetscDSObject *__pyx_v_self, struct PyPetscObjectObject *__pyx_v_disc) { PetscInt __pyx_v_field; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getFieldIndex", 1); /* "petsc4py/PETSc/DS.pyx":197 * * """ * cdef PetscInt field = 0 # <<<<<<<<<<<<<< * CHKERR( PetscDSGetFieldIndex(self.ds, disc.obj[0], &field) ) * return toInt(field) */ __pyx_v_field = 0; /* "petsc4py/PETSc/DS.pyx":198 * """ * cdef PetscInt field = 0 * CHKERR( PetscDSGetFieldIndex(self.ds, disc.obj[0], &field) ) # <<<<<<<<<<<<<< * return toInt(field) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDSGetFieldIndex(__pyx_v_self->ds, (__pyx_v_disc->obj[0]), (&__pyx_v_field))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(55, 198, __pyx_L1_error) /* "petsc4py/PETSc/DS.pyx":199 * cdef PetscInt field = 0 * CHKERR( PetscDSGetFieldIndex(self.ds, disc.obj[0], &field) ) * return toInt(field) # <<<<<<<<<<<<<< * * def getTotalDimensions(self) -> int: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_field); if (unlikely(!__pyx_t_2)) __PYX_ERR(55, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DS.pyx":182 * return toInt(nf) * * def getFieldIndex(self, Object disc) -> int: # <<<<<<<<<<<<<< * """Return the index of the given field. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DS.getFieldIndex", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DS.pyx":201 * return toInt(field) * * def getTotalDimensions(self) -> int: # <<<<<<<<<<<<<< * """Return the total size of the approximation space for this system. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DS_25getTotalDimensions(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DS_24getTotalDimensions, "DS.getTotalDimensions(self) -> int\nReturn the total size of the approximation space for this system.\n\n Not collective.\n\n See Also\n --------\n petsc.PetscDSGetTotalDimension\n\n \nSource code at petsc4py/PETSc/DS.pyx:201"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DS_25getTotalDimensions(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getTotalDimensions (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getTotalDimensions", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getTotalDimensions", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DS_24getTotalDimensions(((struct PyPetscDSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_24getTotalDimensions(struct PyPetscDSObject *__pyx_v_self) { PetscInt __pyx_v_tdim; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getTotalDimensions", 1); /* "petsc4py/PETSc/DS.pyx":211 * * """ * cdef PetscInt tdim = 0 # <<<<<<<<<<<<<< * CHKERR( PetscDSGetTotalDimension(self.ds, &tdim) ) * return toInt(tdim) */ __pyx_v_tdim = 0; /* "petsc4py/PETSc/DS.pyx":212 * """ * cdef PetscInt tdim = 0 * CHKERR( PetscDSGetTotalDimension(self.ds, &tdim) ) # <<<<<<<<<<<<<< * return toInt(tdim) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDSGetTotalDimension(__pyx_v_self->ds, (&__pyx_v_tdim))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(55, 212, __pyx_L1_error) /* "petsc4py/PETSc/DS.pyx":213 * cdef PetscInt tdim = 0 * CHKERR( PetscDSGetTotalDimension(self.ds, &tdim) ) * return toInt(tdim) # <<<<<<<<<<<<<< * * def getTotalComponents(self) -> int: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_tdim); if (unlikely(!__pyx_t_2)) __PYX_ERR(55, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DS.pyx":201 * return toInt(field) * * def getTotalDimensions(self) -> int: # <<<<<<<<<<<<<< * """Return the total size of the approximation space for this system. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DS.getTotalDimensions", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DS.pyx":215 * return toInt(tdim) * * def getTotalComponents(self) -> int: # <<<<<<<<<<<<<< * """Return the total number of components in this system. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DS_27getTotalComponents(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DS_26getTotalComponents, "DS.getTotalComponents(self) -> int\nReturn the total number of components in this system.\n\n Not collective.\n\n See Also\n --------\n petsc.PetscDSGetTotalComponents\n\n \nSource code at petsc4py/PETSc/DS.pyx:215"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DS_27getTotalComponents(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getTotalComponents (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getTotalComponents", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getTotalComponents", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DS_26getTotalComponents(((struct PyPetscDSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_26getTotalComponents(struct PyPetscDSObject *__pyx_v_self) { PetscInt __pyx_v_tcmp; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getTotalComponents", 1); /* "petsc4py/PETSc/DS.pyx":225 * * """ * cdef PetscInt tcmp = 0 # <<<<<<<<<<<<<< * CHKERR( PetscDSGetTotalComponents(self.ds, &tcmp) ) * return toInt(tcmp) */ __pyx_v_tcmp = 0; /* "petsc4py/PETSc/DS.pyx":226 * """ * cdef PetscInt tcmp = 0 * CHKERR( PetscDSGetTotalComponents(self.ds, &tcmp) ) # <<<<<<<<<<<<<< * return toInt(tcmp) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDSGetTotalComponents(__pyx_v_self->ds, (&__pyx_v_tcmp))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(55, 226, __pyx_L1_error) /* "petsc4py/PETSc/DS.pyx":227 * cdef PetscInt tcmp = 0 * CHKERR( PetscDSGetTotalComponents(self.ds, &tcmp) ) * return toInt(tcmp) # <<<<<<<<<<<<<< * * def getDimensions(self) -> ArrayInt: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_tcmp); if (unlikely(!__pyx_t_2)) __PYX_ERR(55, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DS.pyx":215 * return toInt(tdim) * * def getTotalComponents(self) -> int: # <<<<<<<<<<<<<< * """Return the total number of components in this system. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DS.getTotalComponents", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DS.pyx":229 * return toInt(tcmp) * * def getDimensions(self) -> ArrayInt: # <<<<<<<<<<<<<< * """Return the size of the space for each field on an evaluation point. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DS_29getDimensions(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DS_28getDimensions, "DS.getDimensions(self) -> ArrayInt\nReturn the size of the space for each field on an evaluation point.\n\n Not collective.\n\n See Also\n --------\n petsc.PetscDSGetDimensions\n\n \nSource code at petsc4py/PETSc/DS.pyx:229"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DS_29getDimensions(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getDimensions (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getDimensions", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getDimensions", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DS_28getDimensions(((struct PyPetscDSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_28getDimensions(struct PyPetscDSObject *__pyx_v_self) { PetscInt __pyx_v_nf; PetscInt *__pyx_v_dims; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getDimensions", 1); /* "petsc4py/PETSc/DS.pyx":239 * * """ * cdef PetscInt nf = 0, *dims = NULL # <<<<<<<<<<<<<< * CHKERR( PetscDSGetNumFields(self.ds, &nf) ) * CHKERR( PetscDSGetDimensions(self.ds, &dims) ) */ __pyx_v_nf = 0; __pyx_v_dims = NULL; /* "petsc4py/PETSc/DS.pyx":240 * """ * cdef PetscInt nf = 0, *dims = NULL * CHKERR( PetscDSGetNumFields(self.ds, &nf) ) # <<<<<<<<<<<<<< * CHKERR( PetscDSGetDimensions(self.ds, &dims) ) * return array_i(nf, dims) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDSGetNumFields(__pyx_v_self->ds, (&__pyx_v_nf))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(55, 240, __pyx_L1_error) /* "petsc4py/PETSc/DS.pyx":241 * cdef PetscInt nf = 0, *dims = NULL * CHKERR( PetscDSGetNumFields(self.ds, &nf) ) * CHKERR( PetscDSGetDimensions(self.ds, &dims) ) # <<<<<<<<<<<<<< * return array_i(nf, dims) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDSGetDimensions(__pyx_v_self->ds, (&__pyx_v_dims))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(55, 241, __pyx_L1_error) /* "petsc4py/PETSc/DS.pyx":242 * CHKERR( PetscDSGetNumFields(self.ds, &nf) ) * CHKERR( PetscDSGetDimensions(self.ds, &dims) ) * return array_i(nf, dims) # <<<<<<<<<<<<<< * * def getComponents(self) -> ArrayInt: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i(__pyx_v_nf, __pyx_v_dims)); if (unlikely(!__pyx_t_2)) __PYX_ERR(55, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DS.pyx":229 * return toInt(tcmp) * * def getDimensions(self) -> ArrayInt: # <<<<<<<<<<<<<< * """Return the size of the space for each field on an evaluation point. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DS.getDimensions", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DS.pyx":244 * return array_i(nf, dims) * * def getComponents(self) -> ArrayInt: # <<<<<<<<<<<<<< * """Return the number of components for each field on an evaluation point. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DS_31getComponents(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DS_30getComponents, "DS.getComponents(self) -> ArrayInt\nReturn the number of components for each field on an evaluation point.\n\n Not collective.\n\n See Also\n --------\n petsc.PetscDSGetComponents\n\n \nSource code at petsc4py/PETSc/DS.pyx:244"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DS_31getComponents(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getComponents (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getComponents", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getComponents", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DS_30getComponents(((struct PyPetscDSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_30getComponents(struct PyPetscDSObject *__pyx_v_self) { PetscInt __pyx_v_nf; PetscInt *__pyx_v_cmps; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getComponents", 1); /* "petsc4py/PETSc/DS.pyx":254 * * """ * cdef PetscInt nf = 0, *cmps = NULL # <<<<<<<<<<<<<< * CHKERR( PetscDSGetNumFields(self.ds, &nf) ) * CHKERR( PetscDSGetComponents(self.ds, &cmps) ) */ __pyx_v_nf = 0; __pyx_v_cmps = NULL; /* "petsc4py/PETSc/DS.pyx":255 * """ * cdef PetscInt nf = 0, *cmps = NULL * CHKERR( PetscDSGetNumFields(self.ds, &nf) ) # <<<<<<<<<<<<<< * CHKERR( PetscDSGetComponents(self.ds, &cmps) ) * return array_i(nf, cmps) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDSGetNumFields(__pyx_v_self->ds, (&__pyx_v_nf))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(55, 255, __pyx_L1_error) /* "petsc4py/PETSc/DS.pyx":256 * cdef PetscInt nf = 0, *cmps = NULL * CHKERR( PetscDSGetNumFields(self.ds, &nf) ) * CHKERR( PetscDSGetComponents(self.ds, &cmps) ) # <<<<<<<<<<<<<< * return array_i(nf, cmps) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDSGetComponents(__pyx_v_self->ds, (&__pyx_v_cmps))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(55, 256, __pyx_L1_error) /* "petsc4py/PETSc/DS.pyx":257 * CHKERR( PetscDSGetNumFields(self.ds, &nf) ) * CHKERR( PetscDSGetComponents(self.ds, &cmps) ) * return array_i(nf, cmps) # <<<<<<<<<<<<<< * * def setDiscretisation(self, f: int, disc: Object) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i(__pyx_v_nf, __pyx_v_cmps)); if (unlikely(!__pyx_t_2)) __PYX_ERR(55, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DS.pyx":244 * return array_i(nf, dims) * * def getComponents(self) -> ArrayInt: # <<<<<<<<<<<<<< * """Return the number of components for each field on an evaluation point. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DS.getComponents", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DS.pyx":259 * return array_i(nf, cmps) * * def setDiscretisation(self, f: int, disc: Object) -> None: # <<<<<<<<<<<<<< * """Set the discretization object for the given field. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DS_33setDiscretisation(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2DS_32setDiscretisation, "DS.setDiscretisation(self, f: int, disc: Object) -> None\nSet the discretization object for the given field.\n\n Not collective.\n\n Parameters\n ----------\n f\n The field number.\n disc\n The discretization object.\n\n See Also\n --------\n petsc.PetscDSSetDiscretization\n\n \nSource code at petsc4py/PETSc/DS.pyx:259"); static PyObject *__pyx_pw_8petsc4py_5PETSc_2DS_33setDiscretisation(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_f = 0; PyObject *__pyx_v_disc = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setDiscretisation (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_f,&__pyx_n_s_disc,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_f)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(55, 259, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_disc)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(55, 259, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setDiscretisation", 1, 2, 2, 1); __PYX_ERR(55, 259, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setDiscretisation") < 0)) __PYX_ERR(55, 259, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_f = values[0]; __pyx_v_disc = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setDiscretisation", 1, 2, 2, __pyx_nargs); __PYX_ERR(55, 259, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DS.setDiscretisation", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DS_32setDiscretisation(((struct PyPetscDSObject *)__pyx_v_self), __pyx_v_f, __pyx_v_disc); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_32setDiscretisation(struct PyPetscDSObject *__pyx_v_self, PyObject *__pyx_v_f, PyObject *__pyx_v_disc) { PetscInt __pyx_v_cf; struct PyPetscFEObject *__pyx_v_fe = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setDiscretisation", 1); /* "petsc4py/PETSc/DS.pyx":276 * * """ * cdef PetscInt cf = asInt(f) # <<<<<<<<<<<<<< * cdef FE fe = disc * CHKERR( PetscDSSetDiscretization(self.ds, cf, fe.fe) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_f); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(55, 276, __pyx_L1_error) __pyx_v_cf = __pyx_t_1; /* "petsc4py/PETSc/DS.pyx":277 * """ * cdef PetscInt cf = asInt(f) * cdef FE fe = disc # <<<<<<<<<<<<<< * CHKERR( PetscDSSetDiscretization(self.ds, cf, fe.fe) ) * */ if (!(likely(((__pyx_v_disc) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_disc, __pyx_ptype_8petsc4py_5PETSc_FE))))) __PYX_ERR(55, 277, __pyx_L1_error) __pyx_t_2 = __pyx_v_disc; __Pyx_INCREF(__pyx_t_2); __pyx_v_fe = ((struct PyPetscFEObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DS.pyx":278 * cdef PetscInt cf = asInt(f) * cdef FE fe = disc * CHKERR( PetscDSSetDiscretization(self.ds, cf, fe.fe) ) # <<<<<<<<<<<<<< * * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDSSetDiscretization(__pyx_v_self->ds, __pyx_v_cf, ((PetscObject)__pyx_v_fe->fe))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(55, 278, __pyx_L1_error) /* "petsc4py/PETSc/DS.pyx":259 * return array_i(nf, cmps) * * def setDiscretisation(self, f: int, disc: Object) -> None: # <<<<<<<<<<<<<< * """Set the discretization object for the given field. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DS.setDiscretisation", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_fe); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMDA.pyx":26 * # * * def create( # <<<<<<<<<<<<<< * self, * dim: int | None = None, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_1create(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4DMDA_create, "DMDA.create(self, dim: int | None = None, dof: int | None = None, sizes: DimsSpec | None = None, proc_sizes: DimsSpec | None = None, boundary_type: tuple[DM.BoundaryType | int | str | bool, ...] | None = None, stencil_type: StencilType | None = None, stencil_width: int | None = None, setup: bool = True, ownership_ranges: tuple[Sequence[int], ...] | None = None, comm: Comm | None = None) -> Self\nCreate a ``DMDA`` object.\n\n Collective.\n\n This routine performs the following steps of the C API:\n - ``petsc.DMDACreate``\n - ``petsc.DMSetDimension``\n - ``petsc.DMDASetDof``\n - ``petsc.DMDASetSizes``\n - ``petsc.DMDASetNumProcs``\n - ``petsc.DMDASetOwnershipRanges``\n - ``petsc.DMDASetBoundaryType``\n - ``petsc.DMDASetStencilType``\n - ``petsc.DMDASetStencilWidth``\n - ``petsc.DMSetUp`` (optionally)\n\n Parameters\n ----------\n dim\n The number of dimensions.\n dof\n The number of degrees of freedom.\n sizes\n The number of elements in each dimension.\n proc_sizes\n The number of processes in x, y, z dimensions.\n boundary_type\n The boundary types.\n stencil_type\n The ghost/halo stencil type.\n stencil_width\n The width of the ghost/halo region.\n setup\n Whether to call the setup routine after creating the object.\n ownership_ranges\n Local x, y, z element counts, of length equal to ``proc_sizes``,\n summing to ``sizes``.\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n petsc.DMDACreate, petsc.DMSetDimension, petsc.DMDASetDof\n petsc.DMDASetSizes, petsc.DMDASetNumProcs\n petsc.DMDASetOwnershipRanges, petsc.DMDASetBoundaryType\n petsc.DMDASetStencilType, petsc.DMDASetStencilWidth, petsc.DMSetUp\n\n "" \nSource code at petsc4py/PETSc/DMDA.pyx:26"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_1create(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_dim = 0; PyObject *__pyx_v_dof = 0; PyObject *__pyx_v_sizes = 0; PyObject *__pyx_v_proc_sizes = 0; PyObject *__pyx_v_boundary_type = 0; PyObject *__pyx_v_stencil_type = 0; PyObject *__pyx_v_stencil_width = 0; int __pyx_v_setup; PyObject *__pyx_v_ownership_ranges = 0; PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dim,&__pyx_n_s_dof,&__pyx_n_s_sizes,&__pyx_n_s_proc_sizes,&__pyx_n_s_boundary_type,&__pyx_n_s_stencil_type,&__pyx_n_s_stencil_width,&__pyx_n_s_setup,&__pyx_n_s_ownership_ranges,&__pyx_n_s_comm,0}; /* "petsc4py/PETSc/DMDA.pyx":28 * def create( * self, * dim: int | None = None, # <<<<<<<<<<<<<< * dof: int | None = None, * sizes: DimsSpec | None = None, */ values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/DMDA.pyx":29 * self, * dim: int | None = None, * dof: int | None = None, # <<<<<<<<<<<<<< * sizes: DimsSpec | None = None, * proc_sizes: DimsSpec | None = None, */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/DMDA.pyx":30 * dim: int | None = None, * dof: int | None = None, * sizes: DimsSpec | None = None, # <<<<<<<<<<<<<< * proc_sizes: DimsSpec | None = None, * boundary_type: tuple[DM.BoundaryType | int | str | bool, ...] | None = None, */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/DMDA.pyx":31 * dof: int | None = None, * sizes: DimsSpec | None = None, * proc_sizes: DimsSpec | None = None, # <<<<<<<<<<<<<< * boundary_type: tuple[DM.BoundaryType | int | str | bool, ...] | None = None, * stencil_type: StencilType | None = None, */ values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/DMDA.pyx":32 * sizes: DimsSpec | None = None, * proc_sizes: DimsSpec | None = None, * boundary_type: tuple[DM.BoundaryType | int | str | bool, ...] | None = None, # <<<<<<<<<<<<<< * stencil_type: StencilType | None = None, * stencil_width: int | None = None, */ values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/DMDA.pyx":33 * proc_sizes: DimsSpec | None = None, * boundary_type: tuple[DM.BoundaryType | int | str | bool, ...] | None = None, * stencil_type: StencilType | None = None, # <<<<<<<<<<<<<< * stencil_width: int | None = None, * bint setup: bool = True, */ values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/DMDA.pyx":34 * boundary_type: tuple[DM.BoundaryType | int | str | bool, ...] | None = None, * stencil_type: StencilType | None = None, * stencil_width: int | None = None, # <<<<<<<<<<<<<< * bint setup: bool = True, * ownership_ranges: tuple[Sequence[int], ...] | None = None, */ values[6] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/DMDA.pyx":36 * stencil_width: int | None = None, * bint setup: bool = True, * ownership_ranges: tuple[Sequence[int], ...] | None = None, # <<<<<<<<<<<<<< * comm: Comm | None = None, * ) -> Self: */ values[8] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/DMDA.pyx":37 * bint setup: bool = True, * ownership_ranges: tuple[Sequence[int], ...] | None = None, * comm: Comm | None = None, # <<<<<<<<<<<<<< * ) -> Self: * """Create a ``DMDA`` object. */ values[9] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9); CYTHON_FALLTHROUGH; case 9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8); CYTHON_FALLTHROUGH; case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); CYTHON_FALLTHROUGH; case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dim); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(56, 26, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dof); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(56, 26, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sizes); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(56, 26, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_proc_sizes); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(56, 26, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_boundary_type); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(56, 26, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_stencil_type); if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(56, 26, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 6: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_stencil_width); if (value) { values[6] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(56, 26, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 7: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_setup); if (value) { values[7] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(56, 26, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 8: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ownership_ranges); if (value) { values[8] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(56, 26, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 9: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[9] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(56, 26, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "create") < 0)) __PYX_ERR(56, 26, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9); CYTHON_FALLTHROUGH; case 9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8); CYTHON_FALLTHROUGH; case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); CYTHON_FALLTHROUGH; case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_dim = values[0]; __pyx_v_dof = values[1]; __pyx_v_sizes = values[2]; __pyx_v_proc_sizes = values[3]; __pyx_v_boundary_type = values[4]; __pyx_v_stencil_type = values[5]; __pyx_v_stencil_width = values[6]; if (values[7]) { __pyx_v_setup = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_setup == (int)-1) && PyErr_Occurred())) __PYX_ERR(56, 35, __pyx_L3_error) } else { /* "petsc4py/PETSc/DMDA.pyx":35 * stencil_type: StencilType | None = None, * stencil_width: int | None = None, * bint setup: bool = True, # <<<<<<<<<<<<<< * ownership_ranges: tuple[Sequence[int], ...] | None = None, * comm: Comm | None = None, */ __pyx_v_setup = ((int)1); } __pyx_v_ownership_ranges = values[8]; __pyx_v_comm = values[9]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("create", 0, 0, 10, __pyx_nargs); __PYX_ERR(56, 26, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMDA.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_create(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self), __pyx_v_dim, __pyx_v_dof, __pyx_v_sizes, __pyx_v_proc_sizes, __pyx_v_boundary_type, __pyx_v_stencil_type, __pyx_v_stencil_width, __pyx_v_setup, __pyx_v_ownership_ranges, __pyx_v_comm); /* "petsc4py/PETSc/DMDA.pyx":26 * # * * def create( # <<<<<<<<<<<<<< * self, * dim: int | None = None, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_create(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_dim, PyObject *__pyx_v_dof, PyObject *__pyx_v_sizes, PyObject *__pyx_v_proc_sizes, PyObject *__pyx_v_boundary_type, PyObject *__pyx_v_stencil_type, PyObject *__pyx_v_stencil_width, int __pyx_v_setup, PyObject *__pyx_v_ownership_ranges, PyObject *__pyx_v_comm) { PyObject *__pyx_v_arg = 0; PetscInt __pyx_v_ndim; PetscInt __pyx_v_ndof; PetscInt __pyx_v_M; PetscInt __pyx_v_m; PetscInt *__pyx_v_lx; PetscInt __pyx_v_N; PetscInt __pyx_v_n; PetscInt *__pyx_v_ly; PetscInt __pyx_v_P; PetscInt __pyx_v_p; PetscInt *__pyx_v_lz; DMBoundaryType __pyx_v_btx; DMBoundaryType __pyx_v_bty; DMBoundaryType __pyx_v_btz; DMDAStencilType __pyx_v_stype; PetscInt __pyx_v_swidth; PyObject *__pyx_v_gsizes = 0; PyObject *__pyx_v_psizes = 0; PetscInt __pyx_v_gdim; PetscInt __pyx_v_pdim; MPI_Comm __pyx_v_ccomm; DM __pyx_v_newda; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_t_7; PetscInt __pyx_t_8; int __pyx_t_9; DMDAStencilType __pyx_t_10; MPI_Comm __pyx_t_11; PetscErrorCode __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create", 0); __Pyx_INCREF(__pyx_v_dim); __Pyx_INCREF(__pyx_v_sizes); __Pyx_INCREF(__pyx_v_ownership_ranges); /* "petsc4py/PETSc/DMDA.pyx":88 * """ * # * cdef object arg = None # <<<<<<<<<<<<<< * try: arg = tuple(dim) * except TypeError: pass */ __Pyx_INCREF(Py_None); __pyx_v_arg = Py_None; /* "petsc4py/PETSc/DMDA.pyx":89 * # * cdef object arg = None * try: arg = tuple(dim) # <<<<<<<<<<<<<< * except TypeError: pass * else: dim, sizes = None, arg */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_dim); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 89, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_arg, __pyx_t_4); __pyx_t_4 = 0; } /* "petsc4py/PETSc/DMDA.pyx":91 * try: arg = tuple(dim) * except TypeError: pass * else: dim, sizes = None, arg # <<<<<<<<<<<<<< * # * cdef PetscInt ndim = PETSC_DECIDE */ /*else:*/ { __pyx_t_4 = Py_None; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = __pyx_v_arg; __Pyx_INCREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_dim, __pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_sizes, __pyx_t_5); __pyx_t_5 = 0; } __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/DMDA.pyx":90 * cdef object arg = None * try: arg = tuple(dim) * except TypeError: pass # <<<<<<<<<<<<<< * else: dim, sizes = None, arg * # */ __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError); if (__pyx_t_6) { __Pyx_ErrRestore(0,0,0); goto __pyx_L4_exception_handled; } goto __pyx_L5_except_error; /* "petsc4py/PETSc/DMDA.pyx":89 * # * cdef object arg = None * try: arg = tuple(dim) # <<<<<<<<<<<<<< * except TypeError: pass * else: dim, sizes = None, arg */ __pyx_L5_except_error:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; __pyx_L4_exception_handled:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); __pyx_L8_try_end:; } /* "petsc4py/PETSc/DMDA.pyx":93 * else: dim, sizes = None, arg * # * cdef PetscInt ndim = PETSC_DECIDE # <<<<<<<<<<<<<< * cdef PetscInt ndof = PETSC_DECIDE * cdef PetscInt M = 1, m = PETSC_DECIDE, *lx = NULL */ __pyx_v_ndim = PETSC_DECIDE; /* "petsc4py/PETSc/DMDA.pyx":94 * # * cdef PetscInt ndim = PETSC_DECIDE * cdef PetscInt ndof = PETSC_DECIDE # <<<<<<<<<<<<<< * cdef PetscInt M = 1, m = PETSC_DECIDE, *lx = NULL * cdef PetscInt N = 1, n = PETSC_DECIDE, *ly = NULL */ __pyx_v_ndof = PETSC_DECIDE; /* "petsc4py/PETSc/DMDA.pyx":95 * cdef PetscInt ndim = PETSC_DECIDE * cdef PetscInt ndof = PETSC_DECIDE * cdef PetscInt M = 1, m = PETSC_DECIDE, *lx = NULL # <<<<<<<<<<<<<< * cdef PetscInt N = 1, n = PETSC_DECIDE, *ly = NULL * cdef PetscInt P = 1, p = PETSC_DECIDE, *lz = NULL */ __pyx_v_M = 1; __pyx_v_m = PETSC_DECIDE; __pyx_v_lx = NULL; /* "petsc4py/PETSc/DMDA.pyx":96 * cdef PetscInt ndof = PETSC_DECIDE * cdef PetscInt M = 1, m = PETSC_DECIDE, *lx = NULL * cdef PetscInt N = 1, n = PETSC_DECIDE, *ly = NULL # <<<<<<<<<<<<<< * cdef PetscInt P = 1, p = PETSC_DECIDE, *lz = NULL * cdef PetscDMBoundaryType btx = DM_BOUNDARY_NONE */ __pyx_v_N = 1; __pyx_v_n = PETSC_DECIDE; __pyx_v_ly = NULL; /* "petsc4py/PETSc/DMDA.pyx":97 * cdef PetscInt M = 1, m = PETSC_DECIDE, *lx = NULL * cdef PetscInt N = 1, n = PETSC_DECIDE, *ly = NULL * cdef PetscInt P = 1, p = PETSC_DECIDE, *lz = NULL # <<<<<<<<<<<<<< * cdef PetscDMBoundaryType btx = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE */ __pyx_v_P = 1; __pyx_v_p = PETSC_DECIDE; __pyx_v_lz = NULL; /* "petsc4py/PETSc/DMDA.pyx":98 * cdef PetscInt N = 1, n = PETSC_DECIDE, *ly = NULL * cdef PetscInt P = 1, p = PETSC_DECIDE, *lz = NULL * cdef PetscDMBoundaryType btx = DM_BOUNDARY_NONE # <<<<<<<<<<<<<< * cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE */ __pyx_v_btx = DM_BOUNDARY_NONE; /* "petsc4py/PETSc/DMDA.pyx":99 * cdef PetscInt P = 1, p = PETSC_DECIDE, *lz = NULL * cdef PetscDMBoundaryType btx = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE # <<<<<<<<<<<<<< * cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE * cdef PetscDMDAStencilType stype = DMDA_STENCIL_BOX */ __pyx_v_bty = DM_BOUNDARY_NONE; /* "petsc4py/PETSc/DMDA.pyx":100 * cdef PetscDMBoundaryType btx = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE # <<<<<<<<<<<<<< * cdef PetscDMDAStencilType stype = DMDA_STENCIL_BOX * cdef PetscInt swidth = PETSC_DECIDE */ __pyx_v_btz = DM_BOUNDARY_NONE; /* "petsc4py/PETSc/DMDA.pyx":101 * cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE * cdef PetscDMDAStencilType stype = DMDA_STENCIL_BOX # <<<<<<<<<<<<<< * cdef PetscInt swidth = PETSC_DECIDE * # grid and proc sizes */ __pyx_v_stype = DMDA_STENCIL_BOX; /* "petsc4py/PETSc/DMDA.pyx":102 * cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE * cdef PetscDMDAStencilType stype = DMDA_STENCIL_BOX * cdef PetscInt swidth = PETSC_DECIDE # <<<<<<<<<<<<<< * # grid and proc sizes * cdef object gsizes = sizes */ __pyx_v_swidth = PETSC_DECIDE; /* "petsc4py/PETSc/DMDA.pyx":104 * cdef PetscInt swidth = PETSC_DECIDE * # grid and proc sizes * cdef object gsizes = sizes # <<<<<<<<<<<<<< * cdef object psizes = proc_sizes * cdef PetscInt gdim = PETSC_DECIDE */ __Pyx_INCREF(__pyx_v_sizes); __pyx_v_gsizes = __pyx_v_sizes; /* "petsc4py/PETSc/DMDA.pyx":105 * # grid and proc sizes * cdef object gsizes = sizes * cdef object psizes = proc_sizes # <<<<<<<<<<<<<< * cdef PetscInt gdim = PETSC_DECIDE * cdef PetscInt pdim = PETSC_DECIDE */ __Pyx_INCREF(__pyx_v_proc_sizes); __pyx_v_psizes = __pyx_v_proc_sizes; /* "petsc4py/PETSc/DMDA.pyx":106 * cdef object gsizes = sizes * cdef object psizes = proc_sizes * cdef PetscInt gdim = PETSC_DECIDE # <<<<<<<<<<<<<< * cdef PetscInt pdim = PETSC_DECIDE * if sizes is not None: */ __pyx_v_gdim = PETSC_DECIDE; /* "petsc4py/PETSc/DMDA.pyx":107 * cdef object psizes = proc_sizes * cdef PetscInt gdim = PETSC_DECIDE * cdef PetscInt pdim = PETSC_DECIDE # <<<<<<<<<<<<<< * if sizes is not None: * gdim = asDims(gsizes, &M, &N, &P) */ __pyx_v_pdim = PETSC_DECIDE; /* "petsc4py/PETSc/DMDA.pyx":108 * cdef PetscInt gdim = PETSC_DECIDE * cdef PetscInt pdim = PETSC_DECIDE * if sizes is not None: # <<<<<<<<<<<<<< * gdim = asDims(gsizes, &M, &N, &P) * if psizes is not None: */ __pyx_t_7 = (__pyx_v_sizes != Py_None); if (__pyx_t_7) { /* "petsc4py/PETSc/DMDA.pyx":109 * cdef PetscInt pdim = PETSC_DECIDE * if sizes is not None: * gdim = asDims(gsizes, &M, &N, &P) # <<<<<<<<<<<<<< * if psizes is not None: * pdim = asDims(psizes, &m, &n, &p) */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_asDims(__pyx_v_gsizes, (&__pyx_v_M), (&__pyx_v_N), (&__pyx_v_P)); if (unlikely(__pyx_t_8 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(56, 109, __pyx_L1_error) __pyx_v_gdim = __pyx_t_8; /* "petsc4py/PETSc/DMDA.pyx":108 * cdef PetscInt gdim = PETSC_DECIDE * cdef PetscInt pdim = PETSC_DECIDE * if sizes is not None: # <<<<<<<<<<<<<< * gdim = asDims(gsizes, &M, &N, &P) * if psizes is not None: */ } /* "petsc4py/PETSc/DMDA.pyx":110 * if sizes is not None: * gdim = asDims(gsizes, &M, &N, &P) * if psizes is not None: # <<<<<<<<<<<<<< * pdim = asDims(psizes, &m, &n, &p) * if gdim>=0 and pdim>=0: */ __pyx_t_7 = (__pyx_v_psizes != Py_None); if (__pyx_t_7) { /* "petsc4py/PETSc/DMDA.pyx":111 * gdim = asDims(gsizes, &M, &N, &P) * if psizes is not None: * pdim = asDims(psizes, &m, &n, &p) # <<<<<<<<<<<<<< * if gdim>=0 and pdim>=0: * assert gdim == pdim */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_asDims(__pyx_v_psizes, (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_p)); if (unlikely(__pyx_t_8 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(56, 111, __pyx_L1_error) __pyx_v_pdim = __pyx_t_8; /* "petsc4py/PETSc/DMDA.pyx":110 * if sizes is not None: * gdim = asDims(gsizes, &M, &N, &P) * if psizes is not None: # <<<<<<<<<<<<<< * pdim = asDims(psizes, &m, &n, &p) * if gdim>=0 and pdim>=0: */ } /* "petsc4py/PETSc/DMDA.pyx":112 * if psizes is not None: * pdim = asDims(psizes, &m, &n, &p) * if gdim>=0 and pdim>=0: # <<<<<<<<<<<<<< * assert gdim == pdim * # dim and dof */ __pyx_t_9 = (__pyx_v_gdim >= 0); if (__pyx_t_9) { } else { __pyx_t_7 = __pyx_t_9; goto __pyx_L12_bool_binop_done; } __pyx_t_9 = (__pyx_v_pdim >= 0); __pyx_t_7 = __pyx_t_9; __pyx_L12_bool_binop_done:; if (__pyx_t_7) { /* "petsc4py/PETSc/DMDA.pyx":113 * pdim = asDims(psizes, &m, &n, &p) * if gdim>=0 and pdim>=0: * assert gdim == pdim # <<<<<<<<<<<<<< * # dim and dof * if dim is not None: ndim = asInt(dim) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_7 = (__pyx_v_gdim == __pyx_v_pdim); if (unlikely(!__pyx_t_7)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(56, 113, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(56, 113, __pyx_L1_error) #endif /* "petsc4py/PETSc/DMDA.pyx":112 * if psizes is not None: * pdim = asDims(psizes, &m, &n, &p) * if gdim>=0 and pdim>=0: # <<<<<<<<<<<<<< * assert gdim == pdim * # dim and dof */ } /* "petsc4py/PETSc/DMDA.pyx":115 * assert gdim == pdim * # dim and dof * if dim is not None: ndim = asInt(dim) # <<<<<<<<<<<<<< * if dof is not None: ndof = asInt(dof) * if ndim==PETSC_DECIDE: ndim = gdim */ __pyx_t_7 = (__pyx_v_dim != Py_None); if (__pyx_t_7) { __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_dim); if (unlikely(__pyx_t_8 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(56, 115, __pyx_L1_error) __pyx_v_ndim = __pyx_t_8; } /* "petsc4py/PETSc/DMDA.pyx":116 * # dim and dof * if dim is not None: ndim = asInt(dim) * if dof is not None: ndof = asInt(dof) # <<<<<<<<<<<<<< * if ndim==PETSC_DECIDE: ndim = gdim * if ndof==PETSC_DECIDE: ndof = 1 */ __pyx_t_7 = (__pyx_v_dof != Py_None); if (__pyx_t_7) { __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_dof); if (unlikely(__pyx_t_8 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(56, 116, __pyx_L1_error) __pyx_v_ndof = __pyx_t_8; } /* "petsc4py/PETSc/DMDA.pyx":117 * if dim is not None: ndim = asInt(dim) * if dof is not None: ndof = asInt(dof) * if ndim==PETSC_DECIDE: ndim = gdim # <<<<<<<<<<<<<< * if ndof==PETSC_DECIDE: ndof = 1 * # vertex distribution */ __pyx_t_7 = (__pyx_v_ndim == PETSC_DECIDE); if (__pyx_t_7) { __pyx_v_ndim = __pyx_v_gdim; } /* "petsc4py/PETSc/DMDA.pyx":118 * if dof is not None: ndof = asInt(dof) * if ndim==PETSC_DECIDE: ndim = gdim * if ndof==PETSC_DECIDE: ndof = 1 # <<<<<<<<<<<<<< * # vertex distribution * if ownership_ranges is not None: */ __pyx_t_7 = (__pyx_v_ndof == PETSC_DECIDE); if (__pyx_t_7) { __pyx_v_ndof = 1; } /* "petsc4py/PETSc/DMDA.pyx":120 * if ndof==PETSC_DECIDE: ndof = 1 * # vertex distribution * if ownership_ranges is not None: # <<<<<<<<<<<<<< * ownership_ranges = asOwnershipRanges(ownership_ranges, * ndim, &m, &n, &p, */ __pyx_t_7 = (__pyx_v_ownership_ranges != Py_None); if (__pyx_t_7) { /* "petsc4py/PETSc/DMDA.pyx":121 * # vertex distribution * if ownership_ranges is not None: * ownership_ranges = asOwnershipRanges(ownership_ranges, # <<<<<<<<<<<<<< * ndim, &m, &n, &p, * &lx, &ly, &lz) */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_asOwnershipRanges(__pyx_v_ownership_ranges, __pyx_v_ndim, (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_p), (&__pyx_v_lx), (&__pyx_v_ly), (&__pyx_v_lz)); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_ownership_ranges, __pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/DMDA.pyx":120 * if ndof==PETSC_DECIDE: ndof = 1 * # vertex distribution * if ownership_ranges is not None: # <<<<<<<<<<<<<< * ownership_ranges = asOwnershipRanges(ownership_ranges, * ndim, &m, &n, &p, */ } /* "petsc4py/PETSc/DMDA.pyx":125 * &lx, &ly, &lz) * # periodicity, stencil type & width * if boundary_type is not None: # <<<<<<<<<<<<<< * asBoundary(boundary_type, &btx, &bty, &btz) * if stencil_type is not None: */ __pyx_t_7 = (__pyx_v_boundary_type != Py_None); if (__pyx_t_7) { /* "petsc4py/PETSc/DMDA.pyx":126 * # periodicity, stencil type & width * if boundary_type is not None: * asBoundary(boundary_type, &btx, &bty, &btz) # <<<<<<<<<<<<<< * if stencil_type is not None: * stype = asStencil(stencil_type) */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_asBoundary(__pyx_v_boundary_type, (&__pyx_v_btx), (&__pyx_v_bty), (&__pyx_v_btz)); if (unlikely(__pyx_t_8 == ((PetscInt)-1L))) __PYX_ERR(56, 126, __pyx_L1_error) /* "petsc4py/PETSc/DMDA.pyx":125 * &lx, &ly, &lz) * # periodicity, stencil type & width * if boundary_type is not None: # <<<<<<<<<<<<<< * asBoundary(boundary_type, &btx, &bty, &btz) * if stencil_type is not None: */ } /* "petsc4py/PETSc/DMDA.pyx":127 * if boundary_type is not None: * asBoundary(boundary_type, &btx, &bty, &btz) * if stencil_type is not None: # <<<<<<<<<<<<<< * stype = asStencil(stencil_type) * if stencil_width is not None: */ __pyx_t_7 = (__pyx_v_stencil_type != Py_None); if (__pyx_t_7) { /* "petsc4py/PETSc/DMDA.pyx":128 * asBoundary(boundary_type, &btx, &bty, &btz) * if stencil_type is not None: * stype = asStencil(stencil_type) # <<<<<<<<<<<<<< * if stencil_width is not None: * swidth = asInt(stencil_width) */ __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_asStencil(__pyx_v_stencil_type); if (unlikely(__pyx_t_10 == ((DMDAStencilType)((DMDAStencilType)-1L)))) __PYX_ERR(56, 128, __pyx_L1_error) __pyx_v_stype = __pyx_t_10; /* "petsc4py/PETSc/DMDA.pyx":127 * if boundary_type is not None: * asBoundary(boundary_type, &btx, &bty, &btz) * if stencil_type is not None: # <<<<<<<<<<<<<< * stype = asStencil(stencil_type) * if stencil_width is not None: */ } /* "petsc4py/PETSc/DMDA.pyx":129 * if stencil_type is not None: * stype = asStencil(stencil_type) * if stencil_width is not None: # <<<<<<<<<<<<<< * swidth = asInt(stencil_width) * if setup and swidth == PETSC_DECIDE: swidth = 0 */ __pyx_t_7 = (__pyx_v_stencil_width != Py_None); if (__pyx_t_7) { /* "petsc4py/PETSc/DMDA.pyx":130 * stype = asStencil(stencil_type) * if stencil_width is not None: * swidth = asInt(stencil_width) # <<<<<<<<<<<<<< * if setup and swidth == PETSC_DECIDE: swidth = 0 * # create the DMDA object */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_stencil_width); if (unlikely(__pyx_t_8 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(56, 130, __pyx_L1_error) __pyx_v_swidth = __pyx_t_8; /* "petsc4py/PETSc/DMDA.pyx":129 * if stencil_type is not None: * stype = asStencil(stencil_type) * if stencil_width is not None: # <<<<<<<<<<<<<< * swidth = asInt(stencil_width) * if setup and swidth == PETSC_DECIDE: swidth = 0 */ } /* "petsc4py/PETSc/DMDA.pyx":131 * if stencil_width is not None: * swidth = asInt(stencil_width) * if setup and swidth == PETSC_DECIDE: swidth = 0 # <<<<<<<<<<<<<< * # create the DMDA object * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) */ if (__pyx_v_setup) { } else { __pyx_t_7 = __pyx_v_setup; goto __pyx_L23_bool_binop_done; } __pyx_t_9 = (__pyx_v_swidth == PETSC_DECIDE); __pyx_t_7 = __pyx_t_9; __pyx_L23_bool_binop_done:; if (__pyx_t_7) { __pyx_v_swidth = 0; } /* "petsc4py/PETSc/DMDA.pyx":133 * if setup and swidth == PETSC_DECIDE: swidth = 0 * # create the DMDA object * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscDM newda = NULL * CHKERR( DMDACreateND(ccomm, ndim, ndof, */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_11 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(56, 133, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_11; /* "petsc4py/PETSc/DMDA.pyx":134 * # create the DMDA object * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscDM newda = NULL # <<<<<<<<<<<<<< * CHKERR( DMDACreateND(ccomm, ndim, ndof, * M, N, P, m, n, p, lx, ly, lz, */ __pyx_v_newda = NULL; /* "petsc4py/PETSc/DMDA.pyx":135 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscDM newda = NULL * CHKERR( DMDACreateND(ccomm, ndim, ndof, # <<<<<<<<<<<<<< * M, N, P, m, n, p, lx, ly, lz, * btx, bty, btz, stype, swidth, */ __pyx_t_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDACreateND(__pyx_v_ccomm, __pyx_v_ndim, __pyx_v_ndof, __pyx_v_M, __pyx_v_N, __pyx_v_P, __pyx_v_m, __pyx_v_n, __pyx_v_p, __pyx_v_lx, __pyx_v_ly, __pyx_v_lz, __pyx_v_btx, __pyx_v_bty, __pyx_v_btz, __pyx_v_stype, __pyx_v_swidth, (&__pyx_v_newda))); if (unlikely(__pyx_t_12 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(56, 135, __pyx_L1_error) /* "petsc4py/PETSc/DMDA.pyx":139 * btx, bty, btz, stype, swidth, * &newda) ) * if setup and ndim > 0: CHKERR( DMSetUp(newda) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.dm = newda * return self */ if (__pyx_v_setup) { } else { __pyx_t_7 = __pyx_v_setup; goto __pyx_L26_bool_binop_done; } __pyx_t_9 = (__pyx_v_ndim > 0); __pyx_t_7 = __pyx_t_9; __pyx_L26_bool_binop_done:; if (__pyx_t_7) { __pyx_t_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSetUp(__pyx_v_newda)); if (unlikely(__pyx_t_12 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(56, 139, __pyx_L1_error) } /* "petsc4py/PETSc/DMDA.pyx":140 * &newda) ) * if setup and ndim > 0: CHKERR( DMSetUp(newda) ) * CHKERR( PetscCLEAR(self.obj) ); self.dm = newda # <<<<<<<<<<<<<< * return self * */ __pyx_t_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.__pyx_base.obj)); if (unlikely(__pyx_t_12 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(56, 140, __pyx_L1_error) __pyx_v_self->__pyx_base.dm = __pyx_v_newda; /* "petsc4py/PETSc/DMDA.pyx":141 * if setup and ndim > 0: CHKERR( DMSetUp(newda) ) * CHKERR( PetscCLEAR(self.obj) ); self.dm = newda * return self # <<<<<<<<<<<<<< * * def duplicate( */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/DMDA.pyx":26 * # * * def create( # <<<<<<<<<<<<<< * self, * dim: int | None = None, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_arg); __Pyx_XDECREF(__pyx_v_gsizes); __Pyx_XDECREF(__pyx_v_psizes); __Pyx_XDECREF(__pyx_v_dim); __Pyx_XDECREF(__pyx_v_sizes); __Pyx_XDECREF(__pyx_v_ownership_ranges); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMDA.pyx":143 * return self * * def duplicate( # <<<<<<<<<<<<<< * self, * dof: int | None = None, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_3duplicate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4DMDA_2duplicate, "DMDA.duplicate(self, dof: int | None = None, boundary_type: tuple[DM.BoundaryType | int | str | bool, ...] | None = None, stencil_type: StencilType | None = None, stencil_width: int | None = None) -> DMDA\nDuplicate a DMDA.\n\n Collective.\n\n This routine retrieves the information from the DMDA and recreates it.\n Parameters ``dof``, ``boundary_type``, ``stencil_type``,\n ``stencil_width`` will be overwritten, if provided.\n\n Parameters\n ----------\n dof\n The number of degrees of freedom.\n boundary_type\n Boundary types.\n stencil_type\n The ghost/halo stencil type.\n stencil_width\n The width of the ghost/halo region.\n\n See Also\n --------\n create, petsc.DMDAGetInfo, petsc.DMSetUp\n\n \nSource code at petsc4py/PETSc/DMDA.pyx:143"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_3duplicate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_dof = 0; PyObject *__pyx_v_boundary_type = 0; PyObject *__pyx_v_stencil_type = 0; PyObject *__pyx_v_stencil_width = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("duplicate (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dof,&__pyx_n_s_boundary_type,&__pyx_n_s_stencil_type,&__pyx_n_s_stencil_width,0}; /* "petsc4py/PETSc/DMDA.pyx":145 * def duplicate( * self, * dof: int | None = None, # <<<<<<<<<<<<<< * boundary_type: tuple[DM.BoundaryType | int | str | bool, ...] | None = None, * stencil_type: StencilType | None = None, */ values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/DMDA.pyx":146 * self, * dof: int | None = None, * boundary_type: tuple[DM.BoundaryType | int | str | bool, ...] | None = None, # <<<<<<<<<<<<<< * stencil_type: StencilType | None = None, * stencil_width: int | None = None, */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/DMDA.pyx":147 * dof: int | None = None, * boundary_type: tuple[DM.BoundaryType | int | str | bool, ...] | None = None, * stencil_type: StencilType | None = None, # <<<<<<<<<<<<<< * stencil_width: int | None = None, * ) -> DMDA: */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/DMDA.pyx":148 * boundary_type: tuple[DM.BoundaryType | int | str | bool, ...] | None = None, * stencil_type: StencilType | None = None, * stencil_width: int | None = None, # <<<<<<<<<<<<<< * ) -> DMDA: * """Duplicate a DMDA. */ values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dof); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(56, 143, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_boundary_type); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(56, 143, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_stencil_type); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(56, 143, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_stencil_width); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(56, 143, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "duplicate") < 0)) __PYX_ERR(56, 143, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_dof = values[0]; __pyx_v_boundary_type = values[1]; __pyx_v_stencil_type = values[2]; __pyx_v_stencil_width = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("duplicate", 0, 0, 4, __pyx_nargs); __PYX_ERR(56, 143, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMDA.duplicate", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_2duplicate(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self), __pyx_v_dof, __pyx_v_boundary_type, __pyx_v_stencil_type, __pyx_v_stencil_width); /* "petsc4py/PETSc/DMDA.pyx":143 * return self * * def duplicate( # <<<<<<<<<<<<<< * self, * dof: int | None = None, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_2duplicate(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_dof, PyObject *__pyx_v_boundary_type, PyObject *__pyx_v_stencil_type, PyObject *__pyx_v_stencil_width) { PetscInt __pyx_v_ndim; PetscInt __pyx_v_ndof; PetscInt __pyx_v_M; PetscInt __pyx_v_N; PetscInt __pyx_v_P; PetscInt __pyx_v_m; PetscInt __pyx_v_n; PetscInt __pyx_v_p; DMBoundaryType __pyx_v_btx; DMBoundaryType __pyx_v_bty; DMBoundaryType __pyx_v_btz; DMDAStencilType __pyx_v_stype; PetscInt __pyx_v_swidth; PetscInt const *__pyx_v_lx; PetscInt const *__pyx_v_ly; PetscInt const *__pyx_v_lz; MPI_Comm __pyx_v_comm; struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_da = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_t_2; PetscInt __pyx_t_3; DMDAStencilType __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("duplicate", 1); /* "petsc4py/PETSc/DMDA.pyx":174 * * """ * cdef PetscInt ndim = 0, ndof = 0 # <<<<<<<<<<<<<< * cdef PetscInt M = 1, N = 1, P = 1 * cdef PetscInt m = 1, n = 1, p = 1 */ __pyx_v_ndim = 0; __pyx_v_ndof = 0; /* "petsc4py/PETSc/DMDA.pyx":175 * """ * cdef PetscInt ndim = 0, ndof = 0 * cdef PetscInt M = 1, N = 1, P = 1 # <<<<<<<<<<<<<< * cdef PetscInt m = 1, n = 1, p = 1 * cdef PetscDMBoundaryType btx = DM_BOUNDARY_NONE */ __pyx_v_M = 1; __pyx_v_N = 1; __pyx_v_P = 1; /* "petsc4py/PETSc/DMDA.pyx":176 * cdef PetscInt ndim = 0, ndof = 0 * cdef PetscInt M = 1, N = 1, P = 1 * cdef PetscInt m = 1, n = 1, p = 1 # <<<<<<<<<<<<<< * cdef PetscDMBoundaryType btx = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE */ __pyx_v_m = 1; __pyx_v_n = 1; __pyx_v_p = 1; /* "petsc4py/PETSc/DMDA.pyx":177 * cdef PetscInt M = 1, N = 1, P = 1 * cdef PetscInt m = 1, n = 1, p = 1 * cdef PetscDMBoundaryType btx = DM_BOUNDARY_NONE # <<<<<<<<<<<<<< * cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE */ __pyx_v_btx = DM_BOUNDARY_NONE; /* "petsc4py/PETSc/DMDA.pyx":178 * cdef PetscInt m = 1, n = 1, p = 1 * cdef PetscDMBoundaryType btx = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE # <<<<<<<<<<<<<< * cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE * cdef PetscDMDAStencilType stype = DMDA_STENCIL_BOX */ __pyx_v_bty = DM_BOUNDARY_NONE; /* "petsc4py/PETSc/DMDA.pyx":179 * cdef PetscDMBoundaryType btx = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE # <<<<<<<<<<<<<< * cdef PetscDMDAStencilType stype = DMDA_STENCIL_BOX * cdef PetscInt swidth = PETSC_DECIDE */ __pyx_v_btz = DM_BOUNDARY_NONE; /* "petsc4py/PETSc/DMDA.pyx":180 * cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE * cdef PetscDMDAStencilType stype = DMDA_STENCIL_BOX # <<<<<<<<<<<<<< * cdef PetscInt swidth = PETSC_DECIDE * CHKERR( DMDAGetInfo(self.dm, */ __pyx_v_stype = DMDA_STENCIL_BOX; /* "petsc4py/PETSc/DMDA.pyx":181 * cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE * cdef PetscDMDAStencilType stype = DMDA_STENCIL_BOX * cdef PetscInt swidth = PETSC_DECIDE # <<<<<<<<<<<<<< * CHKERR( DMDAGetInfo(self.dm, * &ndim, */ __pyx_v_swidth = PETSC_DECIDE; /* "petsc4py/PETSc/DMDA.pyx":182 * cdef PetscDMDAStencilType stype = DMDA_STENCIL_BOX * cdef PetscInt swidth = PETSC_DECIDE * CHKERR( DMDAGetInfo(self.dm, # <<<<<<<<<<<<<< * &ndim, * &M, &N, &P, */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDAGetInfo(__pyx_v_self->__pyx_base.dm, (&__pyx_v_ndim), (&__pyx_v_M), (&__pyx_v_N), (&__pyx_v_P), (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_p), (&__pyx_v_ndof), (&__pyx_v_swidth), (&__pyx_v_btx), (&__pyx_v_bty), (&__pyx_v_btz), (&__pyx_v_stype))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(56, 182, __pyx_L1_error) /* "petsc4py/PETSc/DMDA.pyx":189 * &btx, &bty, &btz, * &stype) ) * cdef const PetscInt *lx = NULL, *ly = NULL, *lz = NULL # <<<<<<<<<<<<<< * CHKERR( DMDAGetOwnershipRanges(self.dm, &lx, &ly, &lz) ) * cdef MPI_Comm comm = MPI_COMM_NULL */ __pyx_v_lx = NULL; __pyx_v_ly = NULL; __pyx_v_lz = NULL; /* "petsc4py/PETSc/DMDA.pyx":190 * &stype) ) * cdef const PetscInt *lx = NULL, *ly = NULL, *lz = NULL * CHKERR( DMDAGetOwnershipRanges(self.dm, &lx, &ly, &lz) ) # <<<<<<<<<<<<<< * cdef MPI_Comm comm = MPI_COMM_NULL * CHKERR( PetscObjectGetComm(self.dm, &comm) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDAGetOwnershipRanges(__pyx_v_self->__pyx_base.dm, (&__pyx_v_lx), (&__pyx_v_ly), (&__pyx_v_lz))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(56, 190, __pyx_L1_error) /* "petsc4py/PETSc/DMDA.pyx":191 * cdef const PetscInt *lx = NULL, *ly = NULL, *lz = NULL * CHKERR( DMDAGetOwnershipRanges(self.dm, &lx, &ly, &lz) ) * cdef MPI_Comm comm = MPI_COMM_NULL # <<<<<<<<<<<<<< * CHKERR( PetscObjectGetComm(self.dm, &comm) ) * # */ __pyx_v_comm = MPI_COMM_NULL; /* "petsc4py/PETSc/DMDA.pyx":192 * CHKERR( DMDAGetOwnershipRanges(self.dm, &lx, &ly, &lz) ) * cdef MPI_Comm comm = MPI_COMM_NULL * CHKERR( PetscObjectGetComm(self.dm, &comm) ) # <<<<<<<<<<<<<< * # * if dof is not None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectGetComm(((PetscObject)__pyx_v_self->__pyx_base.dm), (&__pyx_v_comm))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(56, 192, __pyx_L1_error) /* "petsc4py/PETSc/DMDA.pyx":194 * CHKERR( PetscObjectGetComm(self.dm, &comm) ) * # * if dof is not None: # <<<<<<<<<<<<<< * ndof = asInt(dof) * if boundary_type is not None: */ __pyx_t_2 = (__pyx_v_dof != Py_None); if (__pyx_t_2) { /* "petsc4py/PETSc/DMDA.pyx":195 * # * if dof is not None: * ndof = asInt(dof) # <<<<<<<<<<<<<< * if boundary_type is not None: * asBoundary(boundary_type, &btx, &bty, &btz) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_dof); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(56, 195, __pyx_L1_error) __pyx_v_ndof = __pyx_t_3; /* "petsc4py/PETSc/DMDA.pyx":194 * CHKERR( PetscObjectGetComm(self.dm, &comm) ) * # * if dof is not None: # <<<<<<<<<<<<<< * ndof = asInt(dof) * if boundary_type is not None: */ } /* "petsc4py/PETSc/DMDA.pyx":196 * if dof is not None: * ndof = asInt(dof) * if boundary_type is not None: # <<<<<<<<<<<<<< * asBoundary(boundary_type, &btx, &bty, &btz) * if stencil_type is not None: */ __pyx_t_2 = (__pyx_v_boundary_type != Py_None); if (__pyx_t_2) { /* "petsc4py/PETSc/DMDA.pyx":197 * ndof = asInt(dof) * if boundary_type is not None: * asBoundary(boundary_type, &btx, &bty, &btz) # <<<<<<<<<<<<<< * if stencil_type is not None: * stype = asStencil(stencil_type) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asBoundary(__pyx_v_boundary_type, (&__pyx_v_btx), (&__pyx_v_bty), (&__pyx_v_btz)); if (unlikely(__pyx_t_3 == ((PetscInt)-1L))) __PYX_ERR(56, 197, __pyx_L1_error) /* "petsc4py/PETSc/DMDA.pyx":196 * if dof is not None: * ndof = asInt(dof) * if boundary_type is not None: # <<<<<<<<<<<<<< * asBoundary(boundary_type, &btx, &bty, &btz) * if stencil_type is not None: */ } /* "petsc4py/PETSc/DMDA.pyx":198 * if boundary_type is not None: * asBoundary(boundary_type, &btx, &bty, &btz) * if stencil_type is not None: # <<<<<<<<<<<<<< * stype = asStencil(stencil_type) * if stencil_width is not None: */ __pyx_t_2 = (__pyx_v_stencil_type != Py_None); if (__pyx_t_2) { /* "petsc4py/PETSc/DMDA.pyx":199 * asBoundary(boundary_type, &btx, &bty, &btz) * if stencil_type is not None: * stype = asStencil(stencil_type) # <<<<<<<<<<<<<< * if stencil_width is not None: * swidth = asInt(stencil_width) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asStencil(__pyx_v_stencil_type); if (unlikely(__pyx_t_4 == ((DMDAStencilType)((DMDAStencilType)-1L)))) __PYX_ERR(56, 199, __pyx_L1_error) __pyx_v_stype = __pyx_t_4; /* "petsc4py/PETSc/DMDA.pyx":198 * if boundary_type is not None: * asBoundary(boundary_type, &btx, &bty, &btz) * if stencil_type is not None: # <<<<<<<<<<<<<< * stype = asStencil(stencil_type) * if stencil_width is not None: */ } /* "petsc4py/PETSc/DMDA.pyx":200 * if stencil_type is not None: * stype = asStencil(stencil_type) * if stencil_width is not None: # <<<<<<<<<<<<<< * swidth = asInt(stencil_width) * # */ __pyx_t_2 = (__pyx_v_stencil_width != Py_None); if (__pyx_t_2) { /* "petsc4py/PETSc/DMDA.pyx":201 * stype = asStencil(stencil_type) * if stencil_width is not None: * swidth = asInt(stencil_width) # <<<<<<<<<<<<<< * # * cdef DMDA da = DMDA() */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_stencil_width); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(56, 201, __pyx_L1_error) __pyx_v_swidth = __pyx_t_3; /* "petsc4py/PETSc/DMDA.pyx":200 * if stencil_type is not None: * stype = asStencil(stencil_type) * if stencil_width is not None: # <<<<<<<<<<<<<< * swidth = asInt(stencil_width) * # */ } /* "petsc4py/PETSc/DMDA.pyx":203 * swidth = asInt(stencil_width) * # * cdef DMDA da = DMDA() # <<<<<<<<<<<<<< * CHKERR( DMDACreateND(comm, ndim, ndof, * M, N, P, m, n, p, lx, ly, lz, */ __pyx_t_5 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DMDA)); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_v_da = ((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/DMDA.pyx":204 * # * cdef DMDA da = DMDA() * CHKERR( DMDACreateND(comm, ndim, ndof, # <<<<<<<<<<<<<< * M, N, P, m, n, p, lx, ly, lz, * btx, bty, btz, stype, swidth, */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDACreateND(__pyx_v_comm, __pyx_v_ndim, __pyx_v_ndof, __pyx_v_M, __pyx_v_N, __pyx_v_P, __pyx_v_m, __pyx_v_n, __pyx_v_p, __pyx_v_lx, __pyx_v_ly, __pyx_v_lz, __pyx_v_btx, __pyx_v_bty, __pyx_v_btz, __pyx_v_stype, __pyx_v_swidth, (&__pyx_v_da->__pyx_base.dm))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(56, 204, __pyx_L1_error) /* "petsc4py/PETSc/DMDA.pyx":208 * btx, bty, btz, stype, swidth, * &da.dm) ) * CHKERR( DMSetUp(da.dm) ) # <<<<<<<<<<<<<< * return da * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSetUp(__pyx_v_da->__pyx_base.dm)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(56, 208, __pyx_L1_error) /* "petsc4py/PETSc/DMDA.pyx":209 * &da.dm) ) * CHKERR( DMSetUp(da.dm) ) * return da # <<<<<<<<<<<<<< * * # */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_da); __pyx_r = ((PyObject *)__pyx_v_da); goto __pyx_L0; /* "petsc4py/PETSc/DMDA.pyx":143 * return self * * def duplicate( # <<<<<<<<<<<<<< * self, * dof: int | None = None, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.duplicate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_da); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMDA.pyx":213 * # * * def setDim(self, dim: int) -> None: # <<<<<<<<<<<<<< * """Set the topological dimension. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_5setDim(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4DMDA_4setDim, "DMDA.setDim(self, dim: int) -> None\nSet the topological dimension.\n\n Collective.\n\n Parameters\n ----------\n dim\n Topological dimension.\n\n See Also\n --------\n getDim, petsc.DMSetDimension\n\n \nSource code at petsc4py/PETSc/DMDA.pyx:213"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_5setDim(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_dim = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setDim (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dim,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dim)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(56, 213, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setDim") < 0)) __PYX_ERR(56, 213, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_dim = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setDim", 1, 1, 1, __pyx_nargs); __PYX_ERR(56, 213, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMDA.setDim", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_4setDim(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self), __pyx_v_dim); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_4setDim(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_dim) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setDim", 1); /* "petsc4py/PETSc/DMDA.pyx":228 * * """ * return self.setDimension(dim) # <<<<<<<<<<<<<< * * def getDim(self) -> int: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setDimension); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_dim}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMDA.pyx":213 * # * * def setDim(self, dim: int) -> None: # <<<<<<<<<<<<<< * """Set the topological dimension. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.setDim", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMDA.pyx":230 * return self.setDimension(dim) * * def getDim(self) -> int: # <<<<<<<<<<<<<< * """Return the topological dimension. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_7getDim(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4DMDA_6getDim, "DMDA.getDim(self) -> int\nReturn the topological dimension.\n\n Not collective.\n\n See Also\n --------\n setDim, petsc.DMGetDimension\n\n \nSource code at petsc4py/PETSc/DMDA.pyx:230"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_7getDim(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getDim (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getDim", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getDim", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_6getDim(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_6getDim(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getDim", 1); /* "petsc4py/PETSc/DMDA.pyx":240 * * """ * return self.getDimension() # <<<<<<<<<<<<<< * * def setDof(self, dof: int) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getDimension); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMDA.pyx":230 * return self.setDimension(dim) * * def getDim(self) -> int: # <<<<<<<<<<<<<< * """Return the topological dimension. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.getDim", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMDA.pyx":242 * return self.getDimension() * * def setDof(self, dof: int) -> None: # <<<<<<<<<<<<<< * """Set the number of degrees of freedom per vertex. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_9setDof(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4DMDA_8setDof, "DMDA.setDof(self, dof: int) -> None\nSet the number of degrees of freedom per vertex.\n\n Not collective.\n\n Parameters\n ----------\n dof\n The number of degrees of freedom.\n\n See Also\n --------\n getDof, petsc.DMDASetDof\n\n \nSource code at petsc4py/PETSc/DMDA.pyx:242"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_9setDof(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_dof = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setDof (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dof,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dof)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(56, 242, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setDof") < 0)) __PYX_ERR(56, 242, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_dof = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setDof", 1, 1, 1, __pyx_nargs); __PYX_ERR(56, 242, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMDA.setDof", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_8setDof(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self), __pyx_v_dof); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_8setDof(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_dof) { PetscInt __pyx_v_ndof; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setDof", 1); /* "petsc4py/PETSc/DMDA.pyx":257 * * """ * cdef PetscInt ndof = asInt(dof) # <<<<<<<<<<<<<< * CHKERR( DMDASetDof(self.dm, ndof) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_dof); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(56, 257, __pyx_L1_error) __pyx_v_ndof = __pyx_t_1; /* "petsc4py/PETSc/DMDA.pyx":258 * """ * cdef PetscInt ndof = asInt(dof) * CHKERR( DMDASetDof(self.dm, ndof) ) # <<<<<<<<<<<<<< * * def getDof(self) -> int: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDASetDof(__pyx_v_self->__pyx_base.dm, __pyx_v_ndof)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(56, 258, __pyx_L1_error) /* "petsc4py/PETSc/DMDA.pyx":242 * return self.getDimension() * * def setDof(self, dof: int) -> None: # <<<<<<<<<<<<<< * """Set the number of degrees of freedom per vertex. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMDA.setDof", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMDA.pyx":260 * CHKERR( DMDASetDof(self.dm, ndof) ) * * def getDof(self) -> int: # <<<<<<<<<<<<<< * """Return the number of degrees of freedom per node. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_11getDof(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4DMDA_10getDof, "DMDA.getDof(self) -> int\nReturn the number of degrees of freedom per node.\n\n Not collective.\n\n See Also\n --------\n setDof, petsc.DMDAGetInfo\n\n \nSource code at petsc4py/PETSc/DMDA.pyx:260"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_11getDof(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getDof (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getDof", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getDof", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_10getDof(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_10getDof(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self) { PetscInt __pyx_v_dof; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getDof", 1); /* "petsc4py/PETSc/DMDA.pyx":270 * * """ * cdef PetscInt dof = 0 # <<<<<<<<<<<<<< * CHKERR( DMDAGetInfo(self.dm, * NULL, */ __pyx_v_dof = 0; /* "petsc4py/PETSc/DMDA.pyx":271 * """ * cdef PetscInt dof = 0 * CHKERR( DMDAGetInfo(self.dm, # <<<<<<<<<<<<<< * NULL, * NULL, NULL, NULL, */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDAGetInfo(__pyx_v_self->__pyx_base.dm, NULL, NULL, NULL, NULL, NULL, NULL, NULL, (&__pyx_v_dof), NULL, NULL, NULL, NULL, NULL)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(56, 271, __pyx_L1_error) /* "petsc4py/PETSc/DMDA.pyx":278 * NULL, NULL, NULL, * NULL) ) * return toInt(dof) # <<<<<<<<<<<<<< * * def setSizes(self, sizes: DimsSpec) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_dof); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMDA.pyx":260 * CHKERR( DMDASetDof(self.dm, ndof) ) * * def getDof(self) -> int: # <<<<<<<<<<<<<< * """Return the number of degrees of freedom per node. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.getDof", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMDA.pyx":280 * return toInt(dof) * * def setSizes(self, sizes: DimsSpec) -> None: # <<<<<<<<<<<<<< * """Set the number of grid points in each dimension. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_13setSizes(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4DMDA_12setSizes, "DMDA.setSizes(self, sizes: DimsSpec) -> None\nSet the number of grid points in each dimension.\n\n Logically collective.\n\n Parameters\n ----------\n sizes\n The global (x,), (x, y), or (x, y, z) size.\n\n See Also\n --------\n getSizes, petsc.DMDASetSizes\n\n \nSource code at petsc4py/PETSc/DMDA.pyx:280"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_13setSizes(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_sizes = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setSizes (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sizes,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sizes)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(56, 280, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setSizes") < 0)) __PYX_ERR(56, 280, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_sizes = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setSizes", 1, 1, 1, __pyx_nargs); __PYX_ERR(56, 280, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMDA.setSizes", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_12setSizes(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self), __pyx_v_sizes); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_12setSizes(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_sizes) { PyObject *__pyx_v_gsizes = 0; PetscInt __pyx_v_gdim; PetscInt __pyx_v_M; PetscInt __pyx_v_N; PetscInt __pyx_v_P; PetscInt __pyx_v_dim; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscInt __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setSizes", 1); /* "petsc4py/PETSc/DMDA.pyx":295 * * """ * cdef tuple gsizes = tuple(sizes) # <<<<<<<<<<<<<< * cdef PetscInt gdim = PETSC_DECIDE * cdef PetscInt M = 1 */ __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_sizes); if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_gsizes = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DMDA.pyx":296 * """ * cdef tuple gsizes = tuple(sizes) * cdef PetscInt gdim = PETSC_DECIDE # <<<<<<<<<<<<<< * cdef PetscInt M = 1 * cdef PetscInt N = 1 */ __pyx_v_gdim = PETSC_DECIDE; /* "petsc4py/PETSc/DMDA.pyx":297 * cdef tuple gsizes = tuple(sizes) * cdef PetscInt gdim = PETSC_DECIDE * cdef PetscInt M = 1 # <<<<<<<<<<<<<< * cdef PetscInt N = 1 * cdef PetscInt P = 1 */ __pyx_v_M = 1; /* "petsc4py/PETSc/DMDA.pyx":298 * cdef PetscInt gdim = PETSC_DECIDE * cdef PetscInt M = 1 * cdef PetscInt N = 1 # <<<<<<<<<<<<<< * cdef PetscInt P = 1 * gdim = asDims(gsizes, &M, &N, &P) */ __pyx_v_N = 1; /* "petsc4py/PETSc/DMDA.pyx":299 * cdef PetscInt M = 1 * cdef PetscInt N = 1 * cdef PetscInt P = 1 # <<<<<<<<<<<<<< * gdim = asDims(gsizes, &M, &N, &P) * cdef PetscInt dim = PETSC_DECIDE */ __pyx_v_P = 1; /* "petsc4py/PETSc/DMDA.pyx":300 * cdef PetscInt N = 1 * cdef PetscInt P = 1 * gdim = asDims(gsizes, &M, &N, &P) # <<<<<<<<<<<<<< * cdef PetscInt dim = PETSC_DECIDE * CHKERR( DMDAGetDim(self.dm, &dim) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asDims(__pyx_v_gsizes, (&__pyx_v_M), (&__pyx_v_N), (&__pyx_v_P)); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(56, 300, __pyx_L1_error) __pyx_v_gdim = __pyx_t_2; /* "petsc4py/PETSc/DMDA.pyx":301 * cdef PetscInt P = 1 * gdim = asDims(gsizes, &M, &N, &P) * cdef PetscInt dim = PETSC_DECIDE # <<<<<<<<<<<<<< * CHKERR( DMDAGetDim(self.dm, &dim) ) * if dim == PETSC_DECIDE: */ __pyx_v_dim = PETSC_DECIDE; /* "petsc4py/PETSc/DMDA.pyx":302 * gdim = asDims(gsizes, &M, &N, &P) * cdef PetscInt dim = PETSC_DECIDE * CHKERR( DMDAGetDim(self.dm, &dim) ) # <<<<<<<<<<<<<< * if dim == PETSC_DECIDE: * CHKERR( DMSetDimension(self.dm, gdim) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_DMDAGetDim(__pyx_v_self->__pyx_base.dm, (&__pyx_v_dim))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(56, 302, __pyx_L1_error) /* "petsc4py/PETSc/DMDA.pyx":303 * cdef PetscInt dim = PETSC_DECIDE * CHKERR( DMDAGetDim(self.dm, &dim) ) * if dim == PETSC_DECIDE: # <<<<<<<<<<<<<< * CHKERR( DMSetDimension(self.dm, gdim) ) * CHKERR( DMDASetSizes(self.dm, M, N, P) ) */ __pyx_t_4 = (__pyx_v_dim == PETSC_DECIDE); if (__pyx_t_4) { /* "petsc4py/PETSc/DMDA.pyx":304 * CHKERR( DMDAGetDim(self.dm, &dim) ) * if dim == PETSC_DECIDE: * CHKERR( DMSetDimension(self.dm, gdim) ) # <<<<<<<<<<<<<< * CHKERR( DMDASetSizes(self.dm, M, N, P) ) * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSetDimension(__pyx_v_self->__pyx_base.dm, __pyx_v_gdim)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(56, 304, __pyx_L1_error) /* "petsc4py/PETSc/DMDA.pyx":303 * cdef PetscInt dim = PETSC_DECIDE * CHKERR( DMDAGetDim(self.dm, &dim) ) * if dim == PETSC_DECIDE: # <<<<<<<<<<<<<< * CHKERR( DMSetDimension(self.dm, gdim) ) * CHKERR( DMDASetSizes(self.dm, M, N, P) ) */ } /* "petsc4py/PETSc/DMDA.pyx":305 * if dim == PETSC_DECIDE: * CHKERR( DMSetDimension(self.dm, gdim) ) * CHKERR( DMDASetSizes(self.dm, M, N, P) ) # <<<<<<<<<<<<<< * * def getSizes(self) -> tuple[int, ...]: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDASetSizes(__pyx_v_self->__pyx_base.dm, __pyx_v_M, __pyx_v_N, __pyx_v_P)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(56, 305, __pyx_L1_error) /* "petsc4py/PETSc/DMDA.pyx":280 * return toInt(dof) * * def setSizes(self, sizes: DimsSpec) -> None: # <<<<<<<<<<<<<< * """Set the number of grid points in each dimension. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.setSizes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_gsizes); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMDA.pyx":307 * CHKERR( DMDASetSizes(self.dm, M, N, P) ) * * def getSizes(self) -> tuple[int, ...]: # <<<<<<<<<<<<<< * """Return the number of grid points in each dimension. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_15getSizes(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4DMDA_14getSizes, "DMDA.getSizes(self) -> tuple[int, ...]\nReturn the number of grid points in each dimension.\n\n Not collective.\n\n See Also\n --------\n setSizes, petsc.DMDAGetInfo\n\n \nSource code at petsc4py/PETSc/DMDA.pyx:307"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_15getSizes(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSizes (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getSizes", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getSizes", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_14getSizes(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_14getSizes(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self) { PetscInt __pyx_v_dim; PetscInt __pyx_v_M; PetscInt __pyx_v_N; PetscInt __pyx_v_P; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSizes", 1); /* "petsc4py/PETSc/DMDA.pyx":317 * * """ * cdef PetscInt dim = 0 # <<<<<<<<<<<<<< * cdef PetscInt M = PETSC_DECIDE * cdef PetscInt N = PETSC_DECIDE */ __pyx_v_dim = 0; /* "petsc4py/PETSc/DMDA.pyx":318 * """ * cdef PetscInt dim = 0 * cdef PetscInt M = PETSC_DECIDE # <<<<<<<<<<<<<< * cdef PetscInt N = PETSC_DECIDE * cdef PetscInt P = PETSC_DECIDE */ __pyx_v_M = PETSC_DECIDE; /* "petsc4py/PETSc/DMDA.pyx":319 * cdef PetscInt dim = 0 * cdef PetscInt M = PETSC_DECIDE * cdef PetscInt N = PETSC_DECIDE # <<<<<<<<<<<<<< * cdef PetscInt P = PETSC_DECIDE * CHKERR( DMDAGetInfo(self.dm, */ __pyx_v_N = PETSC_DECIDE; /* "petsc4py/PETSc/DMDA.pyx":320 * cdef PetscInt M = PETSC_DECIDE * cdef PetscInt N = PETSC_DECIDE * cdef PetscInt P = PETSC_DECIDE # <<<<<<<<<<<<<< * CHKERR( DMDAGetInfo(self.dm, * &dim, */ __pyx_v_P = PETSC_DECIDE; /* "petsc4py/PETSc/DMDA.pyx":321 * cdef PetscInt N = PETSC_DECIDE * cdef PetscInt P = PETSC_DECIDE * CHKERR( DMDAGetInfo(self.dm, # <<<<<<<<<<<<<< * &dim, * &M, &N, &P, */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDAGetInfo(__pyx_v_self->__pyx_base.dm, (&__pyx_v_dim), (&__pyx_v_M), (&__pyx_v_N), (&__pyx_v_P), NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(56, 321, __pyx_L1_error) /* "petsc4py/PETSc/DMDA.pyx":328 * NULL, NULL, NULL, * NULL) ) * return toDims(dim, M, N, P) # <<<<<<<<<<<<<< * * def setProcSizes(self, proc_sizes: DimsSpec) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toDims(__pyx_v_dim, __pyx_v_M, __pyx_v_N, __pyx_v_P); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMDA.pyx":307 * CHKERR( DMDASetSizes(self.dm, M, N, P) ) * * def getSizes(self) -> tuple[int, ...]: # <<<<<<<<<<<<<< * """Return the number of grid points in each dimension. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.getSizes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMDA.pyx":330 * return toDims(dim, M, N, P) * * def setProcSizes(self, proc_sizes: DimsSpec) -> None: # <<<<<<<<<<<<<< * """Set the number of processes in each dimension. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_17setProcSizes(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4DMDA_16setProcSizes, "DMDA.setProcSizes(self, proc_sizes: DimsSpec) -> None\nSet the number of processes in each dimension.\n\n Logically collective.\n\n Parameters\n ----------\n proc_sizes\n The number of processes in (x,), (x, y), or (x, y, z) dimensions.\n\n See Also\n --------\n getProcSizes, petsc.DMDASetNumProcs\n\n \nSource code at petsc4py/PETSc/DMDA.pyx:330"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_17setProcSizes(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_proc_sizes = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setProcSizes (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_proc_sizes,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_proc_sizes)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(56, 330, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setProcSizes") < 0)) __PYX_ERR(56, 330, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_proc_sizes = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setProcSizes", 1, 1, 1, __pyx_nargs); __PYX_ERR(56, 330, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMDA.setProcSizes", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_16setProcSizes(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self), __pyx_v_proc_sizes); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_16setProcSizes(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_proc_sizes) { PyObject *__pyx_v_psizes = 0; PetscInt __pyx_v_pdim; PetscInt __pyx_v_m; PetscInt __pyx_v_n; PetscInt __pyx_v_p; PetscInt __pyx_v_dim; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscInt __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setProcSizes", 1); /* "petsc4py/PETSc/DMDA.pyx":345 * * """ * cdef tuple psizes = tuple(proc_sizes) # <<<<<<<<<<<<<< * cdef PetscInt pdim = PETSC_DECIDE * cdef PetscInt m = PETSC_DECIDE */ __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_proc_sizes); if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 345, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_psizes = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DMDA.pyx":346 * """ * cdef tuple psizes = tuple(proc_sizes) * cdef PetscInt pdim = PETSC_DECIDE # <<<<<<<<<<<<<< * cdef PetscInt m = PETSC_DECIDE * cdef PetscInt n = PETSC_DECIDE */ __pyx_v_pdim = PETSC_DECIDE; /* "petsc4py/PETSc/DMDA.pyx":347 * cdef tuple psizes = tuple(proc_sizes) * cdef PetscInt pdim = PETSC_DECIDE * cdef PetscInt m = PETSC_DECIDE # <<<<<<<<<<<<<< * cdef PetscInt n = PETSC_DECIDE * cdef PetscInt p = PETSC_DECIDE */ __pyx_v_m = PETSC_DECIDE; /* "petsc4py/PETSc/DMDA.pyx":348 * cdef PetscInt pdim = PETSC_DECIDE * cdef PetscInt m = PETSC_DECIDE * cdef PetscInt n = PETSC_DECIDE # <<<<<<<<<<<<<< * cdef PetscInt p = PETSC_DECIDE * pdim = asDims(psizes, &m, &n, &p) */ __pyx_v_n = PETSC_DECIDE; /* "petsc4py/PETSc/DMDA.pyx":349 * cdef PetscInt m = PETSC_DECIDE * cdef PetscInt n = PETSC_DECIDE * cdef PetscInt p = PETSC_DECIDE # <<<<<<<<<<<<<< * pdim = asDims(psizes, &m, &n, &p) * cdef PetscInt dim = PETSC_DECIDE */ __pyx_v_p = PETSC_DECIDE; /* "petsc4py/PETSc/DMDA.pyx":350 * cdef PetscInt n = PETSC_DECIDE * cdef PetscInt p = PETSC_DECIDE * pdim = asDims(psizes, &m, &n, &p) # <<<<<<<<<<<<<< * cdef PetscInt dim = PETSC_DECIDE * CHKERR( DMDAGetDim(self.dm, &dim) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asDims(__pyx_v_psizes, (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_p)); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(56, 350, __pyx_L1_error) __pyx_v_pdim = __pyx_t_2; /* "petsc4py/PETSc/DMDA.pyx":351 * cdef PetscInt p = PETSC_DECIDE * pdim = asDims(psizes, &m, &n, &p) * cdef PetscInt dim = PETSC_DECIDE # <<<<<<<<<<<<<< * CHKERR( DMDAGetDim(self.dm, &dim) ) * if dim == PETSC_DECIDE: */ __pyx_v_dim = PETSC_DECIDE; /* "petsc4py/PETSc/DMDA.pyx":352 * pdim = asDims(psizes, &m, &n, &p) * cdef PetscInt dim = PETSC_DECIDE * CHKERR( DMDAGetDim(self.dm, &dim) ) # <<<<<<<<<<<<<< * if dim == PETSC_DECIDE: * CHKERR( DMSetDimension(self.dm, pdim) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_DMDAGetDim(__pyx_v_self->__pyx_base.dm, (&__pyx_v_dim))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(56, 352, __pyx_L1_error) /* "petsc4py/PETSc/DMDA.pyx":353 * cdef PetscInt dim = PETSC_DECIDE * CHKERR( DMDAGetDim(self.dm, &dim) ) * if dim == PETSC_DECIDE: # <<<<<<<<<<<<<< * CHKERR( DMSetDimension(self.dm, pdim) ) * CHKERR( DMDASetNumProcs(self.dm, m, n, p) ) */ __pyx_t_4 = (__pyx_v_dim == PETSC_DECIDE); if (__pyx_t_4) { /* "petsc4py/PETSc/DMDA.pyx":354 * CHKERR( DMDAGetDim(self.dm, &dim) ) * if dim == PETSC_DECIDE: * CHKERR( DMSetDimension(self.dm, pdim) ) # <<<<<<<<<<<<<< * CHKERR( DMDASetNumProcs(self.dm, m, n, p) ) * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSetDimension(__pyx_v_self->__pyx_base.dm, __pyx_v_pdim)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(56, 354, __pyx_L1_error) /* "petsc4py/PETSc/DMDA.pyx":353 * cdef PetscInt dim = PETSC_DECIDE * CHKERR( DMDAGetDim(self.dm, &dim) ) * if dim == PETSC_DECIDE: # <<<<<<<<<<<<<< * CHKERR( DMSetDimension(self.dm, pdim) ) * CHKERR( DMDASetNumProcs(self.dm, m, n, p) ) */ } /* "petsc4py/PETSc/DMDA.pyx":355 * if dim == PETSC_DECIDE: * CHKERR( DMSetDimension(self.dm, pdim) ) * CHKERR( DMDASetNumProcs(self.dm, m, n, p) ) # <<<<<<<<<<<<<< * * def getProcSizes(self) -> tuple[int, ...]: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDASetNumProcs(__pyx_v_self->__pyx_base.dm, __pyx_v_m, __pyx_v_n, __pyx_v_p)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(56, 355, __pyx_L1_error) /* "petsc4py/PETSc/DMDA.pyx":330 * return toDims(dim, M, N, P) * * def setProcSizes(self, proc_sizes: DimsSpec) -> None: # <<<<<<<<<<<<<< * """Set the number of processes in each dimension. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.setProcSizes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_psizes); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMDA.pyx":357 * CHKERR( DMDASetNumProcs(self.dm, m, n, p) ) * * def getProcSizes(self) -> tuple[int, ...]: # <<<<<<<<<<<<<< * """Return the number of processes in each dimension. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_19getProcSizes(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4DMDA_18getProcSizes, "DMDA.getProcSizes(self) -> tuple[int, ...]\nReturn the number of processes in each dimension.\n\n Not collective.\n\n See Also\n --------\n setProcSizes, petsc.DMDAGetInfo\n\n \nSource code at petsc4py/PETSc/DMDA.pyx:357"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_19getProcSizes(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getProcSizes (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getProcSizes", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getProcSizes", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_18getProcSizes(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_18getProcSizes(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self) { PetscInt __pyx_v_dim; PetscInt __pyx_v_m; PetscInt __pyx_v_n; PetscInt __pyx_v_p; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getProcSizes", 1); /* "petsc4py/PETSc/DMDA.pyx":367 * * """ * cdef PetscInt dim = 0 # <<<<<<<<<<<<<< * cdef PetscInt m = PETSC_DECIDE * cdef PetscInt n = PETSC_DECIDE */ __pyx_v_dim = 0; /* "petsc4py/PETSc/DMDA.pyx":368 * """ * cdef PetscInt dim = 0 * cdef PetscInt m = PETSC_DECIDE # <<<<<<<<<<<<<< * cdef PetscInt n = PETSC_DECIDE * cdef PetscInt p = PETSC_DECIDE */ __pyx_v_m = PETSC_DECIDE; /* "petsc4py/PETSc/DMDA.pyx":369 * cdef PetscInt dim = 0 * cdef PetscInt m = PETSC_DECIDE * cdef PetscInt n = PETSC_DECIDE # <<<<<<<<<<<<<< * cdef PetscInt p = PETSC_DECIDE * CHKERR( DMDAGetInfo(self.dm, */ __pyx_v_n = PETSC_DECIDE; /* "petsc4py/PETSc/DMDA.pyx":370 * cdef PetscInt m = PETSC_DECIDE * cdef PetscInt n = PETSC_DECIDE * cdef PetscInt p = PETSC_DECIDE # <<<<<<<<<<<<<< * CHKERR( DMDAGetInfo(self.dm, * &dim, */ __pyx_v_p = PETSC_DECIDE; /* "petsc4py/PETSc/DMDA.pyx":371 * cdef PetscInt n = PETSC_DECIDE * cdef PetscInt p = PETSC_DECIDE * CHKERR( DMDAGetInfo(self.dm, # <<<<<<<<<<<<<< * &dim, * NULL, NULL, NULL, */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDAGetInfo(__pyx_v_self->__pyx_base.dm, (&__pyx_v_dim), NULL, NULL, NULL, (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_p), NULL, NULL, NULL, NULL, NULL, NULL)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(56, 371, __pyx_L1_error) /* "petsc4py/PETSc/DMDA.pyx":378 * NULL, NULL, NULL, * NULL) ) * return toDims(dim, m, n, p) # <<<<<<<<<<<<<< * * def setBoundaryType( */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toDims(__pyx_v_dim, __pyx_v_m, __pyx_v_n, __pyx_v_p); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMDA.pyx":357 * CHKERR( DMDASetNumProcs(self.dm, m, n, p) ) * * def getProcSizes(self) -> tuple[int, ...]: # <<<<<<<<<<<<<< * """Return the number of processes in each dimension. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.getProcSizes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMDA.pyx":380 * return toDims(dim, m, n, p) * * def setBoundaryType( # <<<<<<<<<<<<<< * self, * boundary_type: tuple[DM.BoundaryType | int | str | bool, ...], */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_21setBoundaryType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4DMDA_20setBoundaryType, "DMDA.setBoundaryType(self, boundary_type: tuple[DM.BoundaryType | int | str | bool, ...]) -> None\nSet the type of ghost nodes on domain boundaries.\n\n Not collective.\n\n Parameters\n ----------\n boundary_type\n The boundary type in (x), (x, y), or (x, y, z) dimensions.\n\n See Also\n --------\n getBoundaryType, petsc.DMDASetBoundaryType\n\n \nSource code at petsc4py/PETSc/DMDA.pyx:380"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_21setBoundaryType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_boundary_type = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setBoundaryType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_boundary_type,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_boundary_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(56, 380, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setBoundaryType") < 0)) __PYX_ERR(56, 380, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_boundary_type = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setBoundaryType", 1, 1, 1, __pyx_nargs); __PYX_ERR(56, 380, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMDA.setBoundaryType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_20setBoundaryType(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self), __pyx_v_boundary_type); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_20setBoundaryType(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_boundary_type) { DMBoundaryType __pyx_v_btx; DMBoundaryType __pyx_v_bty; DMBoundaryType __pyx_v_btz; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setBoundaryType", 1); /* "petsc4py/PETSc/DMDA.pyx":398 * * """ * cdef PetscDMBoundaryType btx = DM_BOUNDARY_NONE # <<<<<<<<<<<<<< * cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE */ __pyx_v_btx = DM_BOUNDARY_NONE; /* "petsc4py/PETSc/DMDA.pyx":399 * """ * cdef PetscDMBoundaryType btx = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE # <<<<<<<<<<<<<< * cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE * asBoundary(boundary_type, &btx, &bty, &btz) */ __pyx_v_bty = DM_BOUNDARY_NONE; /* "petsc4py/PETSc/DMDA.pyx":400 * cdef PetscDMBoundaryType btx = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE # <<<<<<<<<<<<<< * asBoundary(boundary_type, &btx, &bty, &btz) * CHKERR( DMDASetBoundaryType(self.dm, btx, bty, btz) ) */ __pyx_v_btz = DM_BOUNDARY_NONE; /* "petsc4py/PETSc/DMDA.pyx":401 * cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE * asBoundary(boundary_type, &btx, &bty, &btz) # <<<<<<<<<<<<<< * CHKERR( DMDASetBoundaryType(self.dm, btx, bty, btz) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asBoundary(__pyx_v_boundary_type, (&__pyx_v_btx), (&__pyx_v_bty), (&__pyx_v_btz)); if (unlikely(__pyx_t_1 == ((PetscInt)-1L))) __PYX_ERR(56, 401, __pyx_L1_error) /* "petsc4py/PETSc/DMDA.pyx":402 * cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE * asBoundary(boundary_type, &btx, &bty, &btz) * CHKERR( DMDASetBoundaryType(self.dm, btx, bty, btz) ) # <<<<<<<<<<<<<< * * def getBoundaryType(self) -> tuple[DM.BoundaryType, ...]: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDASetBoundaryType(__pyx_v_self->__pyx_base.dm, __pyx_v_btx, __pyx_v_bty, __pyx_v_btz)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(56, 402, __pyx_L1_error) /* "petsc4py/PETSc/DMDA.pyx":380 * return toDims(dim, m, n, p) * * def setBoundaryType( # <<<<<<<<<<<<<< * self, * boundary_type: tuple[DM.BoundaryType | int | str | bool, ...], */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMDA.setBoundaryType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMDA.pyx":404 * CHKERR( DMDASetBoundaryType(self.dm, btx, bty, btz) ) * * def getBoundaryType(self) -> tuple[DM.BoundaryType, ...]: # <<<<<<<<<<<<<< * """Return the type of ghost nodes at boundary in each dimension. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_23getBoundaryType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4DMDA_22getBoundaryType, "DMDA.getBoundaryType(self) -> tuple[DM.BoundaryType, ...]\nReturn the type of ghost nodes at boundary in each dimension.\n\n Not collective.\n\n See Also\n --------\n setBoundaryType\n\n \nSource code at petsc4py/PETSc/DMDA.pyx:404"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_23getBoundaryType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getBoundaryType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getBoundaryType", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getBoundaryType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_22getBoundaryType(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_22getBoundaryType(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self) { PetscInt __pyx_v_dim; DMBoundaryType __pyx_v_btx; DMBoundaryType __pyx_v_bty; DMBoundaryType __pyx_v_btz; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getBoundaryType", 1); /* "petsc4py/PETSc/DMDA.pyx":414 * * """ * cdef PetscInt dim = 0 # <<<<<<<<<<<<<< * cdef PetscDMBoundaryType btx = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE */ __pyx_v_dim = 0; /* "petsc4py/PETSc/DMDA.pyx":415 * """ * cdef PetscInt dim = 0 * cdef PetscDMBoundaryType btx = DM_BOUNDARY_NONE # <<<<<<<<<<<<<< * cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE */ __pyx_v_btx = DM_BOUNDARY_NONE; /* "petsc4py/PETSc/DMDA.pyx":416 * cdef PetscInt dim = 0 * cdef PetscDMBoundaryType btx = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE # <<<<<<<<<<<<<< * cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE * CHKERR( DMDAGetInfo(self.dm, */ __pyx_v_bty = DM_BOUNDARY_NONE; /* "petsc4py/PETSc/DMDA.pyx":417 * cdef PetscDMBoundaryType btx = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE # <<<<<<<<<<<<<< * CHKERR( DMDAGetInfo(self.dm, * &dim, */ __pyx_v_btz = DM_BOUNDARY_NONE; /* "petsc4py/PETSc/DMDA.pyx":418 * cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE * CHKERR( DMDAGetInfo(self.dm, # <<<<<<<<<<<<<< * &dim, * NULL, NULL, NULL, */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDAGetInfo(__pyx_v_self->__pyx_base.dm, (&__pyx_v_dim), NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, (&__pyx_v_btx), (&__pyx_v_bty), (&__pyx_v_btz), NULL)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(56, 418, __pyx_L1_error) /* "petsc4py/PETSc/DMDA.pyx":425 * &btx, &bty, &btz, * NULL) ) * return toDims(dim, btx, bty, btz) # <<<<<<<<<<<<<< * * def setStencilType(self, stencil_type: StencilType) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toDims(__pyx_v_dim, __pyx_v_btx, __pyx_v_bty, __pyx_v_btz); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMDA.pyx":404 * CHKERR( DMDASetBoundaryType(self.dm, btx, bty, btz) ) * * def getBoundaryType(self) -> tuple[DM.BoundaryType, ...]: # <<<<<<<<<<<<<< * """Return the type of ghost nodes at boundary in each dimension. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.getBoundaryType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMDA.pyx":427 * return toDims(dim, btx, bty, btz) * * def setStencilType(self, stencil_type: StencilType) -> None: # <<<<<<<<<<<<<< * """Set the stencil type. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_25setStencilType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4DMDA_24setStencilType, "DMDA.setStencilType(self, stencil_type: StencilType) -> None\nSet the stencil type.\n\n Logically collective.\n\n Parameters\n ----------\n stype\n The stencil type.\n\n See Also\n --------\n getStencilType, setStencil, petsc.DMDASetStencilType\n\n \nSource code at petsc4py/PETSc/DMDA.pyx:427"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_25setStencilType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_stencil_type = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setStencilType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stencil_type,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_stencil_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(56, 427, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setStencilType") < 0)) __PYX_ERR(56, 427, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_stencil_type = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setStencilType", 1, 1, 1, __pyx_nargs); __PYX_ERR(56, 427, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMDA.setStencilType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_24setStencilType(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self), __pyx_v_stencil_type); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_24setStencilType(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_stencil_type) { DMDAStencilType __pyx_v_stype; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations DMDAStencilType __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setStencilType", 1); /* "petsc4py/PETSc/DMDA.pyx":442 * * """ * cdef PetscDMDAStencilType stype = asStencil(stencil_type) # <<<<<<<<<<<<<< * CHKERR( DMDASetStencilType(self.dm, stype) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asStencil(__pyx_v_stencil_type); if (unlikely(__pyx_t_1 == ((DMDAStencilType)((DMDAStencilType)-1L)))) __PYX_ERR(56, 442, __pyx_L1_error) __pyx_v_stype = __pyx_t_1; /* "petsc4py/PETSc/DMDA.pyx":443 * """ * cdef PetscDMDAStencilType stype = asStencil(stencil_type) * CHKERR( DMDASetStencilType(self.dm, stype) ) # <<<<<<<<<<<<<< * * def getStencilType(self) -> StencilType: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDASetStencilType(__pyx_v_self->__pyx_base.dm, __pyx_v_stype)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(56, 443, __pyx_L1_error) /* "petsc4py/PETSc/DMDA.pyx":427 * return toDims(dim, btx, bty, btz) * * def setStencilType(self, stencil_type: StencilType) -> None: # <<<<<<<<<<<<<< * """Set the stencil type. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMDA.setStencilType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMDA.pyx":445 * CHKERR( DMDASetStencilType(self.dm, stype) ) * * def getStencilType(self) -> StencilType: # <<<<<<<<<<<<<< * """Return the stencil type. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_27getStencilType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4DMDA_26getStencilType, "DMDA.getStencilType(self) -> StencilType\nReturn the stencil type.\n\n Not collective.\n\n See Also\n --------\n setStencilType, petsc.DMDAGetInfo\n\n \nSource code at petsc4py/PETSc/DMDA.pyx:445"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_27getStencilType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getStencilType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getStencilType", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getStencilType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_26getStencilType(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_26getStencilType(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self) { DMDAStencilType __pyx_v_stype; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getStencilType", 1); /* "petsc4py/PETSc/DMDA.pyx":455 * * """ * cdef PetscDMDAStencilType stype = DMDA_STENCIL_BOX # <<<<<<<<<<<<<< * CHKERR( DMDAGetInfo(self.dm, * NULL, */ __pyx_v_stype = DMDA_STENCIL_BOX; /* "petsc4py/PETSc/DMDA.pyx":456 * """ * cdef PetscDMDAStencilType stype = DMDA_STENCIL_BOX * CHKERR( DMDAGetInfo(self.dm, # <<<<<<<<<<<<<< * NULL, * NULL, NULL, NULL, */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDAGetInfo(__pyx_v_self->__pyx_base.dm, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, (&__pyx_v_stype))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(56, 456, __pyx_L1_error) /* "petsc4py/PETSc/DMDA.pyx":463 * NULL, NULL, NULL, * &stype) ) * return stype # <<<<<<<<<<<<<< * * def setStencilWidth(self, stencil_width: int) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_DMDAStencilType(__pyx_v_stype); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 463, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMDA.pyx":445 * CHKERR( DMDASetStencilType(self.dm, stype) ) * * def getStencilType(self) -> StencilType: # <<<<<<<<<<<<<< * """Return the stencil type. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.getStencilType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMDA.pyx":465 * return stype * * def setStencilWidth(self, stencil_width: int) -> None: # <<<<<<<<<<<<<< * """Set the stencil width. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_29setStencilWidth(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4DMDA_28setStencilWidth, "DMDA.setStencilWidth(self, stencil_width: int) -> None\nSet the stencil width.\n\n Logically collective.\n\n Parameters\n ----------\n stencil_width\n The stencil width.\n\n See Also\n --------\n getStencilWidth, setStencil, petsc.DMDASetStencilWidth\n\n \nSource code at petsc4py/PETSc/DMDA.pyx:465"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_29setStencilWidth(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_stencil_width = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setStencilWidth (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stencil_width,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_stencil_width)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(56, 465, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setStencilWidth") < 0)) __PYX_ERR(56, 465, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_stencil_width = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setStencilWidth", 1, 1, 1, __pyx_nargs); __PYX_ERR(56, 465, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMDA.setStencilWidth", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_28setStencilWidth(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self), __pyx_v_stencil_width); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_28setStencilWidth(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_stencil_width) { PetscInt __pyx_v_swidth; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setStencilWidth", 1); /* "petsc4py/PETSc/DMDA.pyx":480 * * """ * cdef PetscInt swidth = asInt(stencil_width) # <<<<<<<<<<<<<< * CHKERR( DMDASetStencilWidth(self.dm, swidth) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_stencil_width); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(56, 480, __pyx_L1_error) __pyx_v_swidth = __pyx_t_1; /* "petsc4py/PETSc/DMDA.pyx":481 * """ * cdef PetscInt swidth = asInt(stencil_width) * CHKERR( DMDASetStencilWidth(self.dm, swidth) ) # <<<<<<<<<<<<<< * * def getStencilWidth(self) -> int: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDASetStencilWidth(__pyx_v_self->__pyx_base.dm, __pyx_v_swidth)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(56, 481, __pyx_L1_error) /* "petsc4py/PETSc/DMDA.pyx":465 * return stype * * def setStencilWidth(self, stencil_width: int) -> None: # <<<<<<<<<<<<<< * """Set the stencil width. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMDA.setStencilWidth", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMDA.pyx":483 * CHKERR( DMDASetStencilWidth(self.dm, swidth) ) * * def getStencilWidth(self) -> int: # <<<<<<<<<<<<<< * """Return the stencil width. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_31getStencilWidth(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4DMDA_30getStencilWidth, "DMDA.getStencilWidth(self) -> int\nReturn the stencil width.\n\n Not collective.\n\n See Also\n --------\n setStencilWidth\n\n \nSource code at petsc4py/PETSc/DMDA.pyx:483"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_31getStencilWidth(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getStencilWidth (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getStencilWidth", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getStencilWidth", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_30getStencilWidth(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_30getStencilWidth(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self) { PetscInt __pyx_v_swidth; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getStencilWidth", 1); /* "petsc4py/PETSc/DMDA.pyx":493 * * """ * cdef PetscInt swidth = 0 # <<<<<<<<<<<<<< * CHKERR( DMDAGetInfo(self.dm, * NULL, */ __pyx_v_swidth = 0; /* "petsc4py/PETSc/DMDA.pyx":494 * """ * cdef PetscInt swidth = 0 * CHKERR( DMDAGetInfo(self.dm, # <<<<<<<<<<<<<< * NULL, * NULL, NULL, NULL, */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDAGetInfo(__pyx_v_self->__pyx_base.dm, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, (&__pyx_v_swidth), NULL, NULL, NULL, NULL)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(56, 494, __pyx_L1_error) /* "petsc4py/PETSc/DMDA.pyx":501 * NULL, NULL, NULL, * NULL) ) * return toInt(swidth) # <<<<<<<<<<<<<< * * def setStencil( */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_swidth); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMDA.pyx":483 * CHKERR( DMDASetStencilWidth(self.dm, swidth) ) * * def getStencilWidth(self) -> int: # <<<<<<<<<<<<<< * """Return the stencil width. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.getStencilWidth", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMDA.pyx":503 * return toInt(swidth) * * def setStencil( # <<<<<<<<<<<<<< * self, * stencil_type: StencilType, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_33setStencil(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4DMDA_32setStencil, "DMDA.setStencil(self, stencil_type: StencilType, stencil_width: int) -> None\nSet the stencil type and width.\n\n Not collective.\n\n Parameters\n ----------\n stencil_type\n The stencil type.\n stencil_width\n The stencil width.\n\n See Also\n --------\n setStencilWidth, setStencilType, petsc.DMDASetStencilType\n petsc.DMDASetStencilWidth\n\n \nSource code at petsc4py/PETSc/DMDA.pyx:503"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_33setStencil(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_stencil_type = 0; PyObject *__pyx_v_stencil_width = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setStencil (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stencil_type,&__pyx_n_s_stencil_width,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_stencil_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(56, 503, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_stencil_width)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(56, 503, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setStencil", 1, 2, 2, 1); __PYX_ERR(56, 503, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setStencil") < 0)) __PYX_ERR(56, 503, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_stencil_type = values[0]; __pyx_v_stencil_width = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setStencil", 1, 2, 2, __pyx_nargs); __PYX_ERR(56, 503, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMDA.setStencil", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_32setStencil(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self), __pyx_v_stencil_type, __pyx_v_stencil_width); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_32setStencil(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_stencil_type, PyObject *__pyx_v_stencil_width) { DMDAStencilType __pyx_v_stype; PetscInt __pyx_v_swidth; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations DMDAStencilType __pyx_t_1; PetscInt __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setStencil", 1); /* "petsc4py/PETSc/DMDA.pyx":525 * * """ * cdef PetscDMDAStencilType stype = asStencil(stencil_type) # <<<<<<<<<<<<<< * cdef PetscInt swidth = asInt(stencil_width) * CHKERR( DMDASetStencilType(self.dm, stype) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asStencil(__pyx_v_stencil_type); if (unlikely(__pyx_t_1 == ((DMDAStencilType)((DMDAStencilType)-1L)))) __PYX_ERR(56, 525, __pyx_L1_error) __pyx_v_stype = __pyx_t_1; /* "petsc4py/PETSc/DMDA.pyx":526 * """ * cdef PetscDMDAStencilType stype = asStencil(stencil_type) * cdef PetscInt swidth = asInt(stencil_width) # <<<<<<<<<<<<<< * CHKERR( DMDASetStencilType(self.dm, stype) ) * CHKERR( DMDASetStencilWidth(self.dm, swidth) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_stencil_width); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(56, 526, __pyx_L1_error) __pyx_v_swidth = __pyx_t_2; /* "petsc4py/PETSc/DMDA.pyx":527 * cdef PetscDMDAStencilType stype = asStencil(stencil_type) * cdef PetscInt swidth = asInt(stencil_width) * CHKERR( DMDASetStencilType(self.dm, stype) ) # <<<<<<<<<<<<<< * CHKERR( DMDASetStencilWidth(self.dm, swidth) ) * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDASetStencilType(__pyx_v_self->__pyx_base.dm, __pyx_v_stype)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(56, 527, __pyx_L1_error) /* "petsc4py/PETSc/DMDA.pyx":528 * cdef PetscInt swidth = asInt(stencil_width) * CHKERR( DMDASetStencilType(self.dm, stype) ) * CHKERR( DMDASetStencilWidth(self.dm, swidth) ) # <<<<<<<<<<<<<< * * def getStencil(self) -> tuple[StencilType, int]: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDASetStencilWidth(__pyx_v_self->__pyx_base.dm, __pyx_v_swidth)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(56, 528, __pyx_L1_error) /* "petsc4py/PETSc/DMDA.pyx":503 * return toInt(swidth) * * def setStencil( # <<<<<<<<<<<<<< * self, * stencil_type: StencilType, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMDA.setStencil", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMDA.pyx":530 * CHKERR( DMDASetStencilWidth(self.dm, swidth) ) * * def getStencil(self) -> tuple[StencilType, int]: # <<<<<<<<<<<<<< * """Return the stencil type and width. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_35getStencil(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4DMDA_34getStencil, "DMDA.getStencil(self) -> tuple[StencilType, int]\nReturn the stencil type and width.\n\n Not collective.\n\n See Also\n --------\n getStencilType, getStencilWidth\n\n \nSource code at petsc4py/PETSc/DMDA.pyx:530"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_35getStencil(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getStencil (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getStencil", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getStencil", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_34getStencil(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_34getStencil(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self) { DMDAStencilType __pyx_v_stype; PetscInt __pyx_v_swidth; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getStencil", 1); /* "petsc4py/PETSc/DMDA.pyx":540 * * """ * cdef PetscDMDAStencilType stype = DMDA_STENCIL_BOX # <<<<<<<<<<<<<< * cdef PetscInt swidth = 0 * CHKERR( DMDAGetInfo(self.dm, */ __pyx_v_stype = DMDA_STENCIL_BOX; /* "petsc4py/PETSc/DMDA.pyx":541 * """ * cdef PetscDMDAStencilType stype = DMDA_STENCIL_BOX * cdef PetscInt swidth = 0 # <<<<<<<<<<<<<< * CHKERR( DMDAGetInfo(self.dm, * NULL, */ __pyx_v_swidth = 0; /* "petsc4py/PETSc/DMDA.pyx":542 * cdef PetscDMDAStencilType stype = DMDA_STENCIL_BOX * cdef PetscInt swidth = 0 * CHKERR( DMDAGetInfo(self.dm, # <<<<<<<<<<<<<< * NULL, * NULL, NULL, NULL, */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDAGetInfo(__pyx_v_self->__pyx_base.dm, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, (&__pyx_v_swidth), NULL, NULL, NULL, (&__pyx_v_stype))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(56, 542, __pyx_L1_error) /* "petsc4py/PETSc/DMDA.pyx":549 * NULL, NULL, NULL, * &stype) ) * return (toStencil(stype), toInt(swidth)) # <<<<<<<<<<<<<< * * # */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toStencil(__pyx_v_stype); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 549, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_swidth); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 549, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 549, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(56, 549, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(56, 549, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMDA.pyx":530 * CHKERR( DMDASetStencilWidth(self.dm, swidth) ) * * def getStencil(self) -> tuple[StencilType, int]: # <<<<<<<<<<<<<< * """Return the stencil type and width. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.getStencil", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMDA.pyx":553 * # * * def getRanges(self) -> tuple[tuple[int, int], ...]: # <<<<<<<<<<<<<< * """Return the ranges of the owned local region in each dimension. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_37getRanges(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4DMDA_36getRanges, "DMDA.getRanges(self) -> tuple[tuple[int, int], ...]\nReturn the ranges of the owned local region in each dimension.\n\n Not collective.\n\n Excluding ghost nodes.\n\n See Also\n --------\n getGhostRanges, getOwnershipRanges, getCorners, getGhostCorners\n petsc.DMDAGetCorners\n\n \nSource code at petsc4py/PETSc/DMDA.pyx:553"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_37getRanges(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getRanges (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getRanges", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getRanges", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_36getRanges(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_36getRanges(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self) { PetscInt __pyx_v_dim; PetscInt __pyx_v_x; PetscInt __pyx_v_y; PetscInt __pyx_v_z; PetscInt __pyx_v_m; PetscInt __pyx_v_n; PetscInt __pyx_v_p; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getRanges", 1); /* "petsc4py/PETSc/DMDA.pyx":566 * * """ * cdef PetscInt dim=0, x=0, y=0, z=0, m=0, n=0, p=0 # <<<<<<<<<<<<<< * CHKERR( DMDAGetDim(self.dm, &dim) ) * CHKERR( DMDAGetCorners(self.dm, */ __pyx_v_dim = 0; __pyx_v_x = 0; __pyx_v_y = 0; __pyx_v_z = 0; __pyx_v_m = 0; __pyx_v_n = 0; __pyx_v_p = 0; /* "petsc4py/PETSc/DMDA.pyx":567 * """ * cdef PetscInt dim=0, x=0, y=0, z=0, m=0, n=0, p=0 * CHKERR( DMDAGetDim(self.dm, &dim) ) # <<<<<<<<<<<<<< * CHKERR( DMDAGetCorners(self.dm, * &x, &y, &z, */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_DMDAGetDim(__pyx_v_self->__pyx_base.dm, (&__pyx_v_dim))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(56, 567, __pyx_L1_error) /* "petsc4py/PETSc/DMDA.pyx":568 * cdef PetscInt dim=0, x=0, y=0, z=0, m=0, n=0, p=0 * CHKERR( DMDAGetDim(self.dm, &dim) ) * CHKERR( DMDAGetCorners(self.dm, # <<<<<<<<<<<<<< * &x, &y, &z, * &m, &n, &p) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDAGetCorners(__pyx_v_self->__pyx_base.dm, (&__pyx_v_x), (&__pyx_v_y), (&__pyx_v_z), (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_p))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(56, 568, __pyx_L1_error) /* "petsc4py/PETSc/DMDA.pyx":571 * &x, &y, &z, * &m, &n, &p) ) * return ((toInt(x), toInt(x+m)), # <<<<<<<<<<<<<< * (toInt(y), toInt(y+n)), * (toInt(z), toInt(z+p)))[:dim] */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 571, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_x + __pyx_v_m)); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 571, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 571, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(56, 571, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(56, 571, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; /* "petsc4py/PETSc/DMDA.pyx":572 * &m, &n, &p) ) * return ((toInt(x), toInt(x+m)), * (toInt(y), toInt(y+n)), # <<<<<<<<<<<<<< * (toInt(z), toInt(z+p)))[:dim] * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_y + __pyx_v_n)); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3)) __PYX_ERR(56, 572, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2)) __PYX_ERR(56, 572, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_2 = 0; /* "petsc4py/PETSc/DMDA.pyx":573 * return ((toInt(x), toInt(x+m)), * (toInt(y), toInt(y+n)), * (toInt(z), toInt(z+p)))[:dim] # <<<<<<<<<<<<<< * * def getGhostRanges(self) -> tuple[tuple[int, int], ...]: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_z); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 573, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_z + __pyx_v_p)); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 573, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(56, 573, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2)) __PYX_ERR(56, 573, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3)) __PYX_ERR(56, 573, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; /* "petsc4py/PETSc/DMDA.pyx":571 * &x, &y, &z, * &m, &n, &p) ) * return ((toInt(x), toInt(x+m)), # <<<<<<<<<<<<<< * (toInt(y), toInt(y+n)), * (toInt(z), toInt(z+p)))[:dim] */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 571, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(56, 571, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5)) __PYX_ERR(56, 571, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_6)) __PYX_ERR(56, 571, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0; /* "petsc4py/PETSc/DMDA.pyx":573 * return ((toInt(x), toInt(x+m)), * (toInt(y), toInt(y+n)), * (toInt(z), toInt(z+p)))[:dim] # <<<<<<<<<<<<<< * * def getGhostRanges(self) -> tuple[tuple[int, int], ...]: */ __pyx_t_6 = __Pyx_PyTuple_GetSlice(__pyx_t_3, 0, ((Py_ssize_t)__pyx_v_dim)); if (unlikely(!__pyx_t_6)) __PYX_ERR(56, 573, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMDA.pyx":553 * # * * def getRanges(self) -> tuple[tuple[int, int], ...]: # <<<<<<<<<<<<<< * """Return the ranges of the owned local region in each dimension. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.getRanges", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMDA.pyx":575 * (toInt(z), toInt(z+p)))[:dim] * * def getGhostRanges(self) -> tuple[tuple[int, int], ...]: # <<<<<<<<<<<<<< * """Return the ranges of the local region in each dimension, including ghost nodes. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_39getGhostRanges(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4DMDA_38getGhostRanges, "DMDA.getGhostRanges(self) -> tuple[tuple[int, int], ...]\nReturn the ranges of the local region in each dimension, including ghost nodes.\n\n Not collective.\n\n See Also\n --------\n getRanges, getOwnershipRanges, getCorners, getGhostCorners\n petsc.DMDAGetGhostCorners\n\n \nSource code at petsc4py/PETSc/DMDA.pyx:575"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_39getGhostRanges(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getGhostRanges (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getGhostRanges", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getGhostRanges", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_38getGhostRanges(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_38getGhostRanges(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self) { PetscInt __pyx_v_dim; PetscInt __pyx_v_x; PetscInt __pyx_v_y; PetscInt __pyx_v_z; PetscInt __pyx_v_m; PetscInt __pyx_v_n; PetscInt __pyx_v_p; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getGhostRanges", 1); /* "petsc4py/PETSc/DMDA.pyx":586 * * """ * cdef PetscInt dim=0, x=0, y=0, z=0, m=0, n=0, p=0 # <<<<<<<<<<<<<< * CHKERR( DMDAGetDim(self.dm, &dim) ) * CHKERR( DMDAGetGhostCorners(self.dm, */ __pyx_v_dim = 0; __pyx_v_x = 0; __pyx_v_y = 0; __pyx_v_z = 0; __pyx_v_m = 0; __pyx_v_n = 0; __pyx_v_p = 0; /* "petsc4py/PETSc/DMDA.pyx":587 * """ * cdef PetscInt dim=0, x=0, y=0, z=0, m=0, n=0, p=0 * CHKERR( DMDAGetDim(self.dm, &dim) ) # <<<<<<<<<<<<<< * CHKERR( DMDAGetGhostCorners(self.dm, * &x, &y, &z, */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_DMDAGetDim(__pyx_v_self->__pyx_base.dm, (&__pyx_v_dim))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(56, 587, __pyx_L1_error) /* "petsc4py/PETSc/DMDA.pyx":588 * cdef PetscInt dim=0, x=0, y=0, z=0, m=0, n=0, p=0 * CHKERR( DMDAGetDim(self.dm, &dim) ) * CHKERR( DMDAGetGhostCorners(self.dm, # <<<<<<<<<<<<<< * &x, &y, &z, * &m, &n, &p) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDAGetGhostCorners(__pyx_v_self->__pyx_base.dm, (&__pyx_v_x), (&__pyx_v_y), (&__pyx_v_z), (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_p))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(56, 588, __pyx_L1_error) /* "petsc4py/PETSc/DMDA.pyx":591 * &x, &y, &z, * &m, &n, &p) ) * return ((toInt(x), toInt(x+m)), # <<<<<<<<<<<<<< * (toInt(y), toInt(y+n)), * (toInt(z), toInt(z+p)))[:dim] */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 591, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_x + __pyx_v_m)); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 591, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 591, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(56, 591, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(56, 591, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; /* "petsc4py/PETSc/DMDA.pyx":592 * &m, &n, &p) ) * return ((toInt(x), toInt(x+m)), * (toInt(y), toInt(y+n)), # <<<<<<<<<<<<<< * (toInt(z), toInt(z+p)))[:dim] * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_y + __pyx_v_n)); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3)) __PYX_ERR(56, 592, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2)) __PYX_ERR(56, 592, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_2 = 0; /* "petsc4py/PETSc/DMDA.pyx":593 * return ((toInt(x), toInt(x+m)), * (toInt(y), toInt(y+n)), * (toInt(z), toInt(z+p)))[:dim] # <<<<<<<<<<<<<< * * def getOwnershipRanges(self) -> tuple[ArrayInt, ...]: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_z); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_z + __pyx_v_p)); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(56, 593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2)) __PYX_ERR(56, 593, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3)) __PYX_ERR(56, 593, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; /* "petsc4py/PETSc/DMDA.pyx":591 * &x, &y, &z, * &m, &n, &p) ) * return ((toInt(x), toInt(x+m)), # <<<<<<<<<<<<<< * (toInt(y), toInt(y+n)), * (toInt(z), toInt(z+p)))[:dim] */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 591, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(56, 591, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5)) __PYX_ERR(56, 591, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_6)) __PYX_ERR(56, 591, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0; /* "petsc4py/PETSc/DMDA.pyx":593 * return ((toInt(x), toInt(x+m)), * (toInt(y), toInt(y+n)), * (toInt(z), toInt(z+p)))[:dim] # <<<<<<<<<<<<<< * * def getOwnershipRanges(self) -> tuple[ArrayInt, ...]: */ __pyx_t_6 = __Pyx_PyTuple_GetSlice(__pyx_t_3, 0, ((Py_ssize_t)__pyx_v_dim)); if (unlikely(!__pyx_t_6)) __PYX_ERR(56, 593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMDA.pyx":575 * (toInt(z), toInt(z+p)))[:dim] * * def getGhostRanges(self) -> tuple[tuple[int, int], ...]: # <<<<<<<<<<<<<< * """Return the ranges of the local region in each dimension, including ghost nodes. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.getGhostRanges", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMDA.pyx":595 * (toInt(z), toInt(z+p)))[:dim] * * def getOwnershipRanges(self) -> tuple[ArrayInt, ...]: # <<<<<<<<<<<<<< * """Return the ranges of indices in each dimension owned by each process. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_41getOwnershipRanges(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4DMDA_40getOwnershipRanges, "DMDA.getOwnershipRanges(self) -> tuple[ArrayInt, ...]\nReturn the ranges of indices in each dimension owned by each process.\n\n Not collective.\n\n These numbers are not multiplied by the number of DOFs per node.\n\n See Also\n --------\n getRanges, getGhostRanges, getCorners, getGhostCorners\n petsc.DMDAGetOwnershipRanges\n\n \nSource code at petsc4py/PETSc/DMDA.pyx:595"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_41getOwnershipRanges(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getOwnershipRanges (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getOwnershipRanges", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getOwnershipRanges", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_40getOwnershipRanges(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_40getOwnershipRanges(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self) { PetscInt __pyx_v_dim; PetscInt __pyx_v_m; PetscInt __pyx_v_n; PetscInt __pyx_v_p; PetscInt const *__pyx_v_lx; PetscInt const *__pyx_v_ly; PetscInt const *__pyx_v_lz; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getOwnershipRanges", 1); /* "petsc4py/PETSc/DMDA.pyx":608 * * """ * cdef PetscInt dim=0, m=0, n=0, p=0 # <<<<<<<<<<<<<< * cdef const PetscInt *lx = NULL, *ly = NULL, *lz = NULL * CHKERR( DMDAGetInfo(self.dm, */ __pyx_v_dim = 0; __pyx_v_m = 0; __pyx_v_n = 0; __pyx_v_p = 0; /* "petsc4py/PETSc/DMDA.pyx":609 * """ * cdef PetscInt dim=0, m=0, n=0, p=0 * cdef const PetscInt *lx = NULL, *ly = NULL, *lz = NULL # <<<<<<<<<<<<<< * CHKERR( DMDAGetInfo(self.dm, * &dim, */ __pyx_v_lx = NULL; __pyx_v_ly = NULL; __pyx_v_lz = NULL; /* "petsc4py/PETSc/DMDA.pyx":610 * cdef PetscInt dim=0, m=0, n=0, p=0 * cdef const PetscInt *lx = NULL, *ly = NULL, *lz = NULL * CHKERR( DMDAGetInfo(self.dm, # <<<<<<<<<<<<<< * &dim, * NULL, NULL, NULL, */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDAGetInfo(__pyx_v_self->__pyx_base.dm, (&__pyx_v_dim), NULL, NULL, NULL, (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_p), NULL, NULL, NULL, NULL, NULL, NULL)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(56, 610, __pyx_L1_error) /* "petsc4py/PETSc/DMDA.pyx":617 * NULL, NULL, NULL, * NULL) ) * CHKERR( DMDAGetOwnershipRanges(self.dm, &lx, &ly, &lz) ) # <<<<<<<<<<<<<< * return toOwnershipRanges(dim, m, n, p, lx, ly, lz) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDAGetOwnershipRanges(__pyx_v_self->__pyx_base.dm, (&__pyx_v_lx), (&__pyx_v_ly), (&__pyx_v_lz))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(56, 617, __pyx_L1_error) /* "petsc4py/PETSc/DMDA.pyx":618 * NULL) ) * CHKERR( DMDAGetOwnershipRanges(self.dm, &lx, &ly, &lz) ) * return toOwnershipRanges(dim, m, n, p, lx, ly, lz) # <<<<<<<<<<<<<< * * def getCorners(self) -> tuple[tuple[int, ...], tuple[int, ...]]: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toOwnershipRanges(__pyx_v_dim, __pyx_v_m, __pyx_v_n, __pyx_v_p, __pyx_v_lx, __pyx_v_ly, __pyx_v_lz); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMDA.pyx":595 * (toInt(z), toInt(z+p)))[:dim] * * def getOwnershipRanges(self) -> tuple[ArrayInt, ...]: # <<<<<<<<<<<<<< * """Return the ranges of indices in each dimension owned by each process. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.getOwnershipRanges", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMDA.pyx":620 * return toOwnershipRanges(dim, m, n, p, lx, ly, lz) * * def getCorners(self) -> tuple[tuple[int, ...], tuple[int, ...]]: # <<<<<<<<<<<<<< * """Return the lower left corner and the sizes of the owned local region. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_43getCorners(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4DMDA_42getCorners, "DMDA.getCorners(self) -> tuple[tuple[int, ...], tuple[int, ...]]\nReturn the lower left corner and the sizes of the owned local region.\n\n Not collective.\n\n Returns the global (x,y,z) indices of the lower left corner (first\n tuple) and size of the local region (second tuple).\n\n Excluding ghost points.\n\n The corner information is independent of the number of degrees of\n freedom per node. Thus the returned values can be thought of as\n coordinates on a logical grid, where each grid point has (potentially)\n several degrees of freedom.\n\n See Also\n --------\n getRanges, getGhostRanges, getOwnershipRanges, getGhostCorners\n petsc.DMDAGetCorners\n\n \nSource code at petsc4py/PETSc/DMDA.pyx:620"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_43getCorners(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getCorners (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getCorners", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getCorners", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_42getCorners(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_42getCorners(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self) { PetscInt __pyx_v_dim; PetscInt __pyx_v_x; PetscInt __pyx_v_y; PetscInt __pyx_v_z; PetscInt __pyx_v_m; PetscInt __pyx_v_n; PetscInt __pyx_v_p; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getCorners", 1); /* "petsc4py/PETSc/DMDA.pyx":641 * * """ * cdef PetscInt dim=0, x=0, y=0, z=0, m=0, n=0, p=0 # <<<<<<<<<<<<<< * CHKERR( DMDAGetDim(self.dm, &dim) ) * CHKERR( DMDAGetCorners(self.dm, */ __pyx_v_dim = 0; __pyx_v_x = 0; __pyx_v_y = 0; __pyx_v_z = 0; __pyx_v_m = 0; __pyx_v_n = 0; __pyx_v_p = 0; /* "petsc4py/PETSc/DMDA.pyx":642 * """ * cdef PetscInt dim=0, x=0, y=0, z=0, m=0, n=0, p=0 * CHKERR( DMDAGetDim(self.dm, &dim) ) # <<<<<<<<<<<<<< * CHKERR( DMDAGetCorners(self.dm, * &x, &y, &z, */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_DMDAGetDim(__pyx_v_self->__pyx_base.dm, (&__pyx_v_dim))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(56, 642, __pyx_L1_error) /* "petsc4py/PETSc/DMDA.pyx":643 * cdef PetscInt dim=0, x=0, y=0, z=0, m=0, n=0, p=0 * CHKERR( DMDAGetDim(self.dm, &dim) ) * CHKERR( DMDAGetCorners(self.dm, # <<<<<<<<<<<<<< * &x, &y, &z, * &m, &n, &p) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDAGetCorners(__pyx_v_self->__pyx_base.dm, (&__pyx_v_x), (&__pyx_v_y), (&__pyx_v_z), (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_p))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(56, 643, __pyx_L1_error) /* "petsc4py/PETSc/DMDA.pyx":646 * &x, &y, &z, * &m, &n, &p) ) * return ((toInt(x), toInt(y), toInt(z))[:dim], # <<<<<<<<<<<<<< * (toInt(m), toInt(n), toInt(p))[:dim]) * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_z); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2)) __PYX_ERR(56, 646, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3)) __PYX_ERR(56, 646, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4)) __PYX_ERR(56, 646, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyTuple_GetSlice(__pyx_t_5, 0, ((Py_ssize_t)__pyx_v_dim)); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/DMDA.pyx":647 * &m, &n, &p) ) * return ((toInt(x), toInt(y), toInt(z))[:dim], * (toInt(m), toInt(n), toInt(p))[:dim]) # <<<<<<<<<<<<<< * * def getGhostCorners(self) -> tuple[tuple[int, ...], tuple[int, ...]]: */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_m); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 647, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 647, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_p); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 647, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(56, 647, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5)) __PYX_ERR(56, 647, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3)) __PYX_ERR(56, 647, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_2)) __PYX_ERR(56, 647, __pyx_L1_error); __pyx_t_5 = 0; __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyTuple_GetSlice(__pyx_t_6, 0, ((Py_ssize_t)__pyx_v_dim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 647, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "petsc4py/PETSc/DMDA.pyx":646 * &x, &y, &z, * &m, &n, &p) ) * return ((toInt(x), toInt(y), toInt(z))[:dim], # <<<<<<<<<<<<<< * (toInt(m), toInt(n), toInt(p))[:dim]) * */ __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(56, 646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4)) __PYX_ERR(56, 646, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2)) __PYX_ERR(56, 646, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMDA.pyx":620 * return toOwnershipRanges(dim, m, n, p, lx, ly, lz) * * def getCorners(self) -> tuple[tuple[int, ...], tuple[int, ...]]: # <<<<<<<<<<<<<< * """Return the lower left corner and the sizes of the owned local region. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.getCorners", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMDA.pyx":649 * (toInt(m), toInt(n), toInt(p))[:dim]) * * def getGhostCorners(self) -> tuple[tuple[int, ...], tuple[int, ...]]: # <<<<<<<<<<<<<< * """Return the lower left corner and the size of the ghosted local region. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_45getGhostCorners(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4DMDA_44getGhostCorners, "DMDA.getGhostCorners(self) -> tuple[tuple[int, ...], tuple[int, ...]]\nReturn the lower left corner and the size of the ghosted local region.\n\n Not collective.\n\n Returns the global (x,y,z) indices of the lower left corner (first\n tuple) and size of the local region (second tuple).\n\n See Also\n --------\n getRanges, getGhostRanges, getOwnershipRanges, getCorners\n petsc.DMDAGetGhostCorners\n\n \nSource code at petsc4py/PETSc/DMDA.pyx:649"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_45getGhostCorners(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getGhostCorners (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getGhostCorners", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getGhostCorners", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_44getGhostCorners(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_44getGhostCorners(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self) { PetscInt __pyx_v_dim; PetscInt __pyx_v_x; PetscInt __pyx_v_y; PetscInt __pyx_v_z; PetscInt __pyx_v_m; PetscInt __pyx_v_n; PetscInt __pyx_v_p; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getGhostCorners", 1); /* "petsc4py/PETSc/DMDA.pyx":663 * * """ * cdef PetscInt dim=0, x=0, y=0, z=0, m=0, n=0, p=0 # <<<<<<<<<<<<<< * CHKERR( DMDAGetDim(self.dm, &dim) ) * CHKERR( DMDAGetGhostCorners(self.dm, */ __pyx_v_dim = 0; __pyx_v_x = 0; __pyx_v_y = 0; __pyx_v_z = 0; __pyx_v_m = 0; __pyx_v_n = 0; __pyx_v_p = 0; /* "petsc4py/PETSc/DMDA.pyx":664 * """ * cdef PetscInt dim=0, x=0, y=0, z=0, m=0, n=0, p=0 * CHKERR( DMDAGetDim(self.dm, &dim) ) # <<<<<<<<<<<<<< * CHKERR( DMDAGetGhostCorners(self.dm, * &x, &y, &z, */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_DMDAGetDim(__pyx_v_self->__pyx_base.dm, (&__pyx_v_dim))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(56, 664, __pyx_L1_error) /* "petsc4py/PETSc/DMDA.pyx":665 * cdef PetscInt dim=0, x=0, y=0, z=0, m=0, n=0, p=0 * CHKERR( DMDAGetDim(self.dm, &dim) ) * CHKERR( DMDAGetGhostCorners(self.dm, # <<<<<<<<<<<<<< * &x, &y, &z, * &m, &n, &p) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDAGetGhostCorners(__pyx_v_self->__pyx_base.dm, (&__pyx_v_x), (&__pyx_v_y), (&__pyx_v_z), (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_p))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(56, 665, __pyx_L1_error) /* "petsc4py/PETSc/DMDA.pyx":668 * &x, &y, &z, * &m, &n, &p) ) * return ((toInt(x), toInt(y), toInt(z))[:dim], # <<<<<<<<<<<<<< * (toInt(m), toInt(n), toInt(p))[:dim]) * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_z); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2)) __PYX_ERR(56, 668, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3)) __PYX_ERR(56, 668, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4)) __PYX_ERR(56, 668, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyTuple_GetSlice(__pyx_t_5, 0, ((Py_ssize_t)__pyx_v_dim)); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/DMDA.pyx":669 * &m, &n, &p) ) * return ((toInt(x), toInt(y), toInt(z))[:dim], * (toInt(m), toInt(n), toInt(p))[:dim]) # <<<<<<<<<<<<<< * * # */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_m); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 669, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 669, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_p); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 669, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(56, 669, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5)) __PYX_ERR(56, 669, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3)) __PYX_ERR(56, 669, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_2)) __PYX_ERR(56, 669, __pyx_L1_error); __pyx_t_5 = 0; __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyTuple_GetSlice(__pyx_t_6, 0, ((Py_ssize_t)__pyx_v_dim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 669, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "petsc4py/PETSc/DMDA.pyx":668 * &x, &y, &z, * &m, &n, &p) ) * return ((toInt(x), toInt(y), toInt(z))[:dim], # <<<<<<<<<<<<<< * (toInt(m), toInt(n), toInt(p))[:dim]) * */ __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(56, 668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4)) __PYX_ERR(56, 668, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2)) __PYX_ERR(56, 668, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMDA.pyx":649 * (toInt(m), toInt(n), toInt(p))[:dim]) * * def getGhostCorners(self) -> tuple[tuple[int, ...], tuple[int, ...]]: # <<<<<<<<<<<<<< * """Return the lower left corner and the size of the ghosted local region. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.getGhostCorners", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMDA.pyx":673 * # * * def setFieldName(self, field: int, name: str) -> None: # <<<<<<<<<<<<<< * """Set the name of individual field components. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_47setFieldName(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4DMDA_46setFieldName, "DMDA.setFieldName(self, field: int, name: str) -> None\nSet the name of individual field components.\n\n Logically collective.\n\n Parameters\n ----------\n field\n The field number for the DMDA (``0``, ``1``, ..., ``dof-1``),\n where ``dof`` indicates the number of degrees of freedom per node\n within the `DMDA`.\n name\n The name of the field (component).\n\n See Also\n --------\n getFieldName, petsc.DMDASetFieldName\n\n \nSource code at petsc4py/PETSc/DMDA.pyx:673"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_47setFieldName(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_field = 0; PyObject *__pyx_v_name = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFieldName (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_field,&__pyx_n_s_name,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_field)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(56, 673, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(56, 673, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setFieldName", 1, 2, 2, 1); __PYX_ERR(56, 673, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setFieldName") < 0)) __PYX_ERR(56, 673, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_field = values[0]; __pyx_v_name = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setFieldName", 1, 2, 2, __pyx_nargs); __PYX_ERR(56, 673, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMDA.setFieldName", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_46setFieldName(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self), __pyx_v_field, __pyx_v_name); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_46setFieldName(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_name) { PetscInt __pyx_v_ival; char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFieldName", 0); __Pyx_INCREF(__pyx_v_name); /* "petsc4py/PETSc/DMDA.pyx":692 * * """ * cdef PetscInt ival = asInt(field) # <<<<<<<<<<<<<< * cdef const char *cval = NULL * name = str2bytes(name, &cval) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_field); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(56, 692, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "petsc4py/PETSc/DMDA.pyx":693 * """ * cdef PetscInt ival = asInt(field) * cdef const char *cval = NULL # <<<<<<<<<<<<<< * name = str2bytes(name, &cval) * CHKERR( DMDASetFieldName(self.dm, ival, cval) ) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/DMDA.pyx":694 * cdef PetscInt ival = asInt(field) * cdef const char *cval = NULL * name = str2bytes(name, &cval) # <<<<<<<<<<<<<< * CHKERR( DMDASetFieldName(self.dm, ival, cval) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cval)); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 694, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DMDA.pyx":695 * cdef const char *cval = NULL * name = str2bytes(name, &cval) * CHKERR( DMDASetFieldName(self.dm, ival, cval) ) # <<<<<<<<<<<<<< * * def getFieldName(self, field: int) -> str: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDASetFieldName(__pyx_v_self->__pyx_base.dm, __pyx_v_ival, __pyx_v_cval)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(56, 695, __pyx_L1_error) /* "petsc4py/PETSc/DMDA.pyx":673 * # * * def setFieldName(self, field: int, name: str) -> None: # <<<<<<<<<<<<<< * """Set the name of individual field components. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.setFieldName", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMDA.pyx":697 * CHKERR( DMDASetFieldName(self.dm, ival, cval) ) * * def getFieldName(self, field: int) -> str: # <<<<<<<<<<<<<< * """Return the name of an individual field component. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_49getFieldName(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4DMDA_48getFieldName, "DMDA.getFieldName(self, field: int) -> str\nReturn the name of an individual field component.\n\n Not collective.\n\n Parameters\n ----------\n field\n The field number for the DMDA (``0``, ``1``, ..., ``dof-1``),\n where ``dof`` indicates the number of degrees of freedom per node\n within the `DMDA`.\n\n See Also\n --------\n setFieldName, petsc.DMDAGetFieldName\n\n \nSource code at petsc4py/PETSc/DMDA.pyx:697"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_49getFieldName(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_field = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getFieldName (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_field,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_field)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(56, 697, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getFieldName") < 0)) __PYX_ERR(56, 697, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_field = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getFieldName", 1, 1, 1, __pyx_nargs); __PYX_ERR(56, 697, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMDA.getFieldName", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_48getFieldName(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self), __pyx_v_field); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_48getFieldName(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_field) { PetscInt __pyx_v_ival; char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getFieldName", 1); /* "petsc4py/PETSc/DMDA.pyx":714 * * """ * cdef PetscInt ival = asInt(field) # <<<<<<<<<<<<<< * cdef const char *cval = NULL * CHKERR( DMDAGetFieldName(self.dm, ival, &cval) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_field); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(56, 714, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "petsc4py/PETSc/DMDA.pyx":715 * """ * cdef PetscInt ival = asInt(field) * cdef const char *cval = NULL # <<<<<<<<<<<<<< * CHKERR( DMDAGetFieldName(self.dm, ival, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/DMDA.pyx":716 * cdef PetscInt ival = asInt(field) * cdef const char *cval = NULL * CHKERR( DMDAGetFieldName(self.dm, ival, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDAGetFieldName(__pyx_v_self->__pyx_base.dm, __pyx_v_ival, (&__pyx_v_cval))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(56, 716, __pyx_L1_error) /* "petsc4py/PETSc/DMDA.pyx":717 * cdef const char *cval = NULL * CHKERR( DMDAGetFieldName(self.dm, ival, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * # */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 717, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMDA.pyx":697 * CHKERR( DMDASetFieldName(self.dm, ival, cval) ) * * def getFieldName(self, field: int) -> str: # <<<<<<<<<<<<<< * """Return the name of an individual field component. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.getFieldName", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMDA.pyx":721 * # * * def getVecArray(self, Vec vec) -> Any: # <<<<<<<<<<<<<< * """Get access to the vector. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_51getVecArray(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4DMDA_50getVecArray, "DMDA.getVecArray(self, vec: Vec) -> Any\nGet access to the vector.\n\n Not collective.\n\n Use via `with` context manager (PEP 343).\n\n Parameters\n ----------\n vec\n The vector to which access is being requested.\n\n \nSource code at petsc4py/PETSc/DMDA.pyx:721"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_51getVecArray(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_vec = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getVecArray (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vec)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(56, 721, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getVecArray") < 0)) __PYX_ERR(56, 721, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_vec = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getVecArray", 1, 1, 1, __pyx_nargs); __PYX_ERR(56, 721, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMDA.getVecArray", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(56, 721, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_50getVecArray(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self), __pyx_v_vec); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_50getVecArray(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getVecArray", 1); /* "petsc4py/PETSc/DMDA.pyx":734 * * """ * return _DMDA_Vec_array(self, vec) # <<<<<<<<<<<<<< * * # */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 734, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF((PyObject *)__pyx_v_self); __Pyx_GIVEREF((PyObject *)__pyx_v_self); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self))) __PYX_ERR(56, 734, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_vec); __Pyx_GIVEREF((PyObject *)__pyx_v_vec); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_vec))) __PYX_ERR(56, 734, __pyx_L1_error); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8petsc4py_5PETSc__DMDA_Vec_array), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 734, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMDA.pyx":721 * # * * def getVecArray(self, Vec vec) -> Any: # <<<<<<<<<<<<<< * """Get access to the vector. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.getVecArray", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMDA.pyx":738 * # * * def setUniformCoordinates( # <<<<<<<<<<<<<< * self, * xmin: float = 0, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_53setUniformCoordinates(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4DMDA_52setUniformCoordinates, "DMDA.setUniformCoordinates(self, xmin: float = 0, xmax: float = 1, ymin: float = 0, ymax: float = 1, zmin: float = 0, zmax: float = 1) -> None\nSet the DMDA coordinates to be a uniform grid.\n\n Collective.\n\n Parameters\n ----------\n xmin\n The minimum in the ``x`` dimension.\n xmax\n The maximum in the ``x`` dimension.\n ymin\n The minimum in the ``y`` dimension (value ignored for 1 dimensional\n problems).\n ymax\n The maximum in the ``y`` dimension (value ignored for 1 dimensional\n problems).\n zmin\n The minimum in the ``z`` dimension (value ignored for 1 or 2\n dimensional problems).\n zmax\n The maximum in the ``z`` dimension (value ignored for 1 or 2\n dimensional problems).\n\n See Also\n --------\n petsc.DMDASetUniformCoordinates\n\n \nSource code at petsc4py/PETSc/DMDA.pyx:738"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_53setUniformCoordinates(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_xmin = 0; PyObject *__pyx_v_xmax = 0; PyObject *__pyx_v_ymin = 0; PyObject *__pyx_v_ymax = 0; PyObject *__pyx_v_zmin = 0; PyObject *__pyx_v_zmax = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[6] = {0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setUniformCoordinates (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_xmin,&__pyx_n_s_xmax,&__pyx_n_s_ymin,&__pyx_n_s_ymax,&__pyx_n_s_zmin,&__pyx_n_s_zmax,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_0)); values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_1)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_0)); values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_1)); values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_0)); values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_1)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_xmin); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(56, 738, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_xmax); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(56, 738, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ymin); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(56, 738, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ymax); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(56, 738, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_zmin); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(56, 738, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_zmax); if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(56, 738, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setUniformCoordinates") < 0)) __PYX_ERR(56, 738, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_xmin = values[0]; __pyx_v_xmax = values[1]; __pyx_v_ymin = values[2]; __pyx_v_ymax = values[3]; __pyx_v_zmin = values[4]; __pyx_v_zmax = values[5]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setUniformCoordinates", 0, 0, 6, __pyx_nargs); __PYX_ERR(56, 738, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMDA.setUniformCoordinates", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_52setUniformCoordinates(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self), __pyx_v_xmin, __pyx_v_xmax, __pyx_v_ymin, __pyx_v_ymax, __pyx_v_zmin, __pyx_v_zmax); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_52setUniformCoordinates(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_xmin, PyObject *__pyx_v_xmax, PyObject *__pyx_v_ymin, PyObject *__pyx_v_ymax, PyObject *__pyx_v_zmin, PyObject *__pyx_v_zmax) { PetscReal __pyx_v__xmin; PetscReal __pyx_v__xmax; PetscReal __pyx_v__ymin; PetscReal __pyx_v__ymax; PetscReal __pyx_v__zmin; PetscReal __pyx_v__zmax; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setUniformCoordinates", 1); /* "petsc4py/PETSc/DMDA.pyx":775 * * """ * cdef PetscReal _xmin = asReal(xmin), _xmax = asReal(xmax) # <<<<<<<<<<<<<< * cdef PetscReal _ymin = asReal(ymin), _ymax = asReal(ymax) * cdef PetscReal _zmin = asReal(zmin), _zmax = asReal(zmax) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_xmin); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(56, 775, __pyx_L1_error) __pyx_v__xmin = __pyx_t_1; __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_xmax); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(56, 775, __pyx_L1_error) __pyx_v__xmax = __pyx_t_1; /* "petsc4py/PETSc/DMDA.pyx":776 * """ * cdef PetscReal _xmin = asReal(xmin), _xmax = asReal(xmax) * cdef PetscReal _ymin = asReal(ymin), _ymax = asReal(ymax) # <<<<<<<<<<<<<< * cdef PetscReal _zmin = asReal(zmin), _zmax = asReal(zmax) * CHKERR( DMDASetUniformCoordinates(self.dm, */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_ymin); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(56, 776, __pyx_L1_error) __pyx_v__ymin = __pyx_t_1; __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_ymax); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(56, 776, __pyx_L1_error) __pyx_v__ymax = __pyx_t_1; /* "petsc4py/PETSc/DMDA.pyx":777 * cdef PetscReal _xmin = asReal(xmin), _xmax = asReal(xmax) * cdef PetscReal _ymin = asReal(ymin), _ymax = asReal(ymax) * cdef PetscReal _zmin = asReal(zmin), _zmax = asReal(zmax) # <<<<<<<<<<<<<< * CHKERR( DMDASetUniformCoordinates(self.dm, * _xmin, _xmax, */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_zmin); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(56, 777, __pyx_L1_error) __pyx_v__zmin = __pyx_t_1; __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_zmax); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(56, 777, __pyx_L1_error) __pyx_v__zmax = __pyx_t_1; /* "petsc4py/PETSc/DMDA.pyx":778 * cdef PetscReal _ymin = asReal(ymin), _ymax = asReal(ymax) * cdef PetscReal _zmin = asReal(zmin), _zmax = asReal(zmax) * CHKERR( DMDASetUniformCoordinates(self.dm, # <<<<<<<<<<<<<< * _xmin, _xmax, * _ymin, _ymax, */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDASetUniformCoordinates(__pyx_v_self->__pyx_base.dm, __pyx_v__xmin, __pyx_v__xmax, __pyx_v__ymin, __pyx_v__ymax, __pyx_v__zmin, __pyx_v__zmax)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(56, 778, __pyx_L1_error) /* "petsc4py/PETSc/DMDA.pyx":738 * # * * def setUniformCoordinates( # <<<<<<<<<<<<<< * self, * xmin: float = 0, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMDA.setUniformCoordinates", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMDA.pyx":783 * _zmin, _zmax) ) * * def setCoordinateName(self, index: int, name: str) -> None: # <<<<<<<<<<<<<< * """Set the name of the coordinate dimension. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_55setCoordinateName(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4DMDA_54setCoordinateName, "DMDA.setCoordinateName(self, index: int, name: str) -> None\nSet the name of the coordinate dimension.\n\n Logically collective.\n\n Parameters\n ----------\n index\n The coordinate number for the DMDA (``0``, ``1``, ..., ``dim-1``).\n name\n The name of the coordinate.\n\n See Also\n --------\n getCoordinateName, petsc.DMDASetCoordinateName\n\n \nSource code at petsc4py/PETSc/DMDA.pyx:783"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_55setCoordinateName(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_index = 0; PyObject *__pyx_v_name = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setCoordinateName (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_name,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_index)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(56, 783, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(56, 783, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setCoordinateName", 1, 2, 2, 1); __PYX_ERR(56, 783, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setCoordinateName") < 0)) __PYX_ERR(56, 783, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_index = values[0]; __pyx_v_name = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setCoordinateName", 1, 2, 2, __pyx_nargs); __PYX_ERR(56, 783, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMDA.setCoordinateName", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_54setCoordinateName(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self), __pyx_v_index, __pyx_v_name); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_54setCoordinateName(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_name) { PetscInt __pyx_v_ival; char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setCoordinateName", 0); __Pyx_INCREF(__pyx_v_name); /* "petsc4py/PETSc/DMDA.pyx":800 * * """ * cdef PetscInt ival = asInt(index) # <<<<<<<<<<<<<< * cdef const char *cval = NULL * name = str2bytes(name, &cval) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_index); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(56, 800, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "petsc4py/PETSc/DMDA.pyx":801 * """ * cdef PetscInt ival = asInt(index) * cdef const char *cval = NULL # <<<<<<<<<<<<<< * name = str2bytes(name, &cval) * CHKERR( DMDASetCoordinateName(self.dm, ival, cval) ) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/DMDA.pyx":802 * cdef PetscInt ival = asInt(index) * cdef const char *cval = NULL * name = str2bytes(name, &cval) # <<<<<<<<<<<<<< * CHKERR( DMDASetCoordinateName(self.dm, ival, cval) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cval)); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 802, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DMDA.pyx":803 * cdef const char *cval = NULL * name = str2bytes(name, &cval) * CHKERR( DMDASetCoordinateName(self.dm, ival, cval) ) # <<<<<<<<<<<<<< * * def getCoordinateName(self, index: int) -> str: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDASetCoordinateName(__pyx_v_self->__pyx_base.dm, __pyx_v_ival, __pyx_v_cval)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(56, 803, __pyx_L1_error) /* "petsc4py/PETSc/DMDA.pyx":783 * _zmin, _zmax) ) * * def setCoordinateName(self, index: int, name: str) -> None: # <<<<<<<<<<<<<< * """Set the name of the coordinate dimension. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.setCoordinateName", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMDA.pyx":805 * CHKERR( DMDASetCoordinateName(self.dm, ival, cval) ) * * def getCoordinateName(self, index: int) -> str: # <<<<<<<<<<<<<< * """Return the name of a coordinate dimension. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_57getCoordinateName(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4DMDA_56getCoordinateName, "DMDA.getCoordinateName(self, index: int) -> str\nReturn the name of a coordinate dimension.\n\n Not collective.\n\n Parameters\n ----------\n index\n The coordinate number for the DMDA (``0``, ``1``, ..., ``dim-1``).\n\n See Also\n --------\n setCoordinateName, petsc.DMDAGetCoordinateName\n\n \nSource code at petsc4py/PETSc/DMDA.pyx:805"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_57getCoordinateName(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_index = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getCoordinateName (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_index)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(56, 805, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getCoordinateName") < 0)) __PYX_ERR(56, 805, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_index = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getCoordinateName", 1, 1, 1, __pyx_nargs); __PYX_ERR(56, 805, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMDA.getCoordinateName", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_56getCoordinateName(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self), __pyx_v_index); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_56getCoordinateName(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_index) { PetscInt __pyx_v_ival; char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getCoordinateName", 1); /* "petsc4py/PETSc/DMDA.pyx":820 * * """ * cdef PetscInt ival = asInt(index) # <<<<<<<<<<<<<< * cdef const char *cval = NULL * CHKERR( DMDAGetCoordinateName(self.dm, ival, &cval) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_index); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(56, 820, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "petsc4py/PETSc/DMDA.pyx":821 * """ * cdef PetscInt ival = asInt(index) * cdef const char *cval = NULL # <<<<<<<<<<<<<< * CHKERR( DMDAGetCoordinateName(self.dm, ival, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/DMDA.pyx":822 * cdef PetscInt ival = asInt(index) * cdef const char *cval = NULL * CHKERR( DMDAGetCoordinateName(self.dm, ival, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDAGetCoordinateName(__pyx_v_self->__pyx_base.dm, __pyx_v_ival, (&__pyx_v_cval))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(56, 822, __pyx_L1_error) /* "petsc4py/PETSc/DMDA.pyx":823 * cdef const char *cval = NULL * CHKERR( DMDAGetCoordinateName(self.dm, ival, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * # */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 823, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMDA.pyx":805 * CHKERR( DMDASetCoordinateName(self.dm, ival, cval) ) * * def getCoordinateName(self, index: int) -> str: # <<<<<<<<<<<<<< * """Return the name of a coordinate dimension. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.getCoordinateName", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMDA.pyx":827 * # * * def createNaturalVec(self) -> Vec: # <<<<<<<<<<<<<< * """Create a vector that will hold values in the natural numbering. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_59createNaturalVec(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4DMDA_58createNaturalVec, "DMDA.createNaturalVec(self) -> Vec\nCreate a vector that will hold values in the natural numbering.\n\n Collective.\n\n The number of local entries in the vector on each process is the same\n as in a vector created with `DM.createGlobalVec`.\n\n See Also\n --------\n petsc.DMDACreateNaturalVector\n\n \nSource code at petsc4py/PETSc/DMDA.pyx:827"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_59createNaturalVec(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createNaturalVec (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("createNaturalVec", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "createNaturalVec", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_58createNaturalVec(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_58createNaturalVec(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self) { struct PyPetscVecObject *__pyx_v_vn = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createNaturalVec", 1); /* "petsc4py/PETSc/DMDA.pyx":840 * * """ * cdef Vec vn = Vec() # <<<<<<<<<<<<<< * CHKERR( DMDACreateNaturalVector(self.dm, &vn.vec) ) * return vn */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 840, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_vn = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DMDA.pyx":841 * """ * cdef Vec vn = Vec() * CHKERR( DMDACreateNaturalVector(self.dm, &vn.vec) ) # <<<<<<<<<<<<<< * return vn * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDACreateNaturalVector(__pyx_v_self->__pyx_base.dm, (&__pyx_v_vn->vec))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(56, 841, __pyx_L1_error) /* "petsc4py/PETSc/DMDA.pyx":842 * cdef Vec vn = Vec() * CHKERR( DMDACreateNaturalVector(self.dm, &vn.vec) ) * return vn # <<<<<<<<<<<<<< * * def globalToNatural( */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_vn); __pyx_r = ((PyObject *)__pyx_v_vn); goto __pyx_L0; /* "petsc4py/PETSc/DMDA.pyx":827 * # * * def createNaturalVec(self) -> Vec: # <<<<<<<<<<<<<< * """Create a vector that will hold values in the natural numbering. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.createNaturalVec", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_vn); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMDA.pyx":844 * return vn * * def globalToNatural( # <<<<<<<<<<<<<< * self, * Vec vg, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_61globalToNatural(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4DMDA_60globalToNatural, "DMDA.globalToNatural(self, vg: Vec, vn: Vec, addv: InsertMode | None = None) -> None\nMap values to the \"natural\" grid ordering.\n\n Neighborwise collective.\n\n You must call `createNaturalVec` before using this routine.\n\n Parameters\n ----------\n vg\n The global vector in a grid ordering.\n vn\n The global vector in a \"natural\" ordering.\n addv\n The insertion mode.\n\n See Also\n --------\n naturalToGlobal, petsc.DMDAGlobalToNaturalBegin\n petsc.DMDAGlobalToNaturalEnd\n\n \nSource code at petsc4py/PETSc/DMDA.pyx:844"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_61globalToNatural(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_vg = 0; struct PyPetscVecObject *__pyx_v_vn = 0; PyObject *__pyx_v_addv = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("globalToNatural (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vg,&__pyx_n_s_vn,&__pyx_n_s_addv,0}; /* "petsc4py/PETSc/DMDA.pyx":848 * Vec vg, * Vec vn, * addv: InsertMode | None = None, # <<<<<<<<<<<<<< * ) -> None: * """Map values to the "natural" grid ordering. */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vg)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(56, 844, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vn)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(56, 844, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("globalToNatural", 0, 2, 3, 1); __PYX_ERR(56, 844, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_addv); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(56, 844, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "globalToNatural") < 0)) __PYX_ERR(56, 844, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_vg = ((struct PyPetscVecObject *)values[0]); __pyx_v_vn = ((struct PyPetscVecObject *)values[1]); __pyx_v_addv = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("globalToNatural", 0, 2, 3, __pyx_nargs); __PYX_ERR(56, 844, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMDA.globalToNatural", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vg), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vg", 0))) __PYX_ERR(56, 846, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vn), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vn", 0))) __PYX_ERR(56, 847, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_60globalToNatural(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self), __pyx_v_vg, __pyx_v_vn, __pyx_v_addv); /* "petsc4py/PETSc/DMDA.pyx":844 * return vn * * def globalToNatural( # <<<<<<<<<<<<<< * self, * Vec vg, */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_60globalToNatural(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vg, struct PyPetscVecObject *__pyx_v_vn, PyObject *__pyx_v_addv) { InsertMode __pyx_v_im; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations InsertMode __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("globalToNatural", 1); /* "petsc4py/PETSc/DMDA.pyx":871 * * """ * cdef PetscInsertMode im = insertmode(addv) # <<<<<<<<<<<<<< * CHKERR( DMDAGlobalToNaturalBegin(self.dm, vg.vec, im, vn.vec) ) * CHKERR( DMDAGlobalToNaturalEnd (self.dm, vg.vec, im, vn.vec) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_insertmode(__pyx_v_addv); if (unlikely(__pyx_t_1 == ((InsertMode)((InsertMode)-1L)))) __PYX_ERR(56, 871, __pyx_L1_error) __pyx_v_im = __pyx_t_1; /* "petsc4py/PETSc/DMDA.pyx":872 * """ * cdef PetscInsertMode im = insertmode(addv) * CHKERR( DMDAGlobalToNaturalBegin(self.dm, vg.vec, im, vn.vec) ) # <<<<<<<<<<<<<< * CHKERR( DMDAGlobalToNaturalEnd (self.dm, vg.vec, im, vn.vec) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDAGlobalToNaturalBegin(__pyx_v_self->__pyx_base.dm, __pyx_v_vg->vec, __pyx_v_im, __pyx_v_vn->vec)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(56, 872, __pyx_L1_error) /* "petsc4py/PETSc/DMDA.pyx":873 * cdef PetscInsertMode im = insertmode(addv) * CHKERR( DMDAGlobalToNaturalBegin(self.dm, vg.vec, im, vn.vec) ) * CHKERR( DMDAGlobalToNaturalEnd (self.dm, vg.vec, im, vn.vec) ) # <<<<<<<<<<<<<< * * def naturalToGlobal( */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDAGlobalToNaturalEnd(__pyx_v_self->__pyx_base.dm, __pyx_v_vg->vec, __pyx_v_im, __pyx_v_vn->vec)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(56, 873, __pyx_L1_error) /* "petsc4py/PETSc/DMDA.pyx":844 * return vn * * def globalToNatural( # <<<<<<<<<<<<<< * self, * Vec vg, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMDA.globalToNatural", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMDA.pyx":875 * CHKERR( DMDAGlobalToNaturalEnd (self.dm, vg.vec, im, vn.vec) ) * * def naturalToGlobal( # <<<<<<<<<<<<<< * self, * Vec vn, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_63naturalToGlobal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4DMDA_62naturalToGlobal, "DMDA.naturalToGlobal(self, vn: Vec, vg: Vec, addv: InsertMode | None = None) -> None\nMap values the to grid ordering.\n\n Neighborwise collective.\n\n Parameters\n ----------\n vn\n The global vector in a natural ordering.\n vg\n the global vector in a grid ordering.\n addv\n The insertion mode.\n\n See Also\n --------\n globalToNatural, petsc.DMDANaturalToGlobalBegin\n petsc.DMDANaturalToGlobalEnd\n\n \nSource code at petsc4py/PETSc/DMDA.pyx:875"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_63naturalToGlobal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_vn = 0; struct PyPetscVecObject *__pyx_v_vg = 0; PyObject *__pyx_v_addv = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("naturalToGlobal (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vn,&__pyx_n_s_vg,&__pyx_n_s_addv,0}; /* "petsc4py/PETSc/DMDA.pyx":879 * Vec vn, * Vec vg, * addv: InsertMode | None = None, # <<<<<<<<<<<<<< * ) -> None: * """Map values the to grid ordering. */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vn)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(56, 875, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vg)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(56, 875, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("naturalToGlobal", 0, 2, 3, 1); __PYX_ERR(56, 875, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_addv); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(56, 875, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "naturalToGlobal") < 0)) __PYX_ERR(56, 875, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_vn = ((struct PyPetscVecObject *)values[0]); __pyx_v_vg = ((struct PyPetscVecObject *)values[1]); __pyx_v_addv = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("naturalToGlobal", 0, 2, 3, __pyx_nargs); __PYX_ERR(56, 875, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMDA.naturalToGlobal", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vn), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vn", 0))) __PYX_ERR(56, 877, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vg), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vg", 0))) __PYX_ERR(56, 878, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_62naturalToGlobal(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self), __pyx_v_vn, __pyx_v_vg, __pyx_v_addv); /* "petsc4py/PETSc/DMDA.pyx":875 * CHKERR( DMDAGlobalToNaturalEnd (self.dm, vg.vec, im, vn.vec) ) * * def naturalToGlobal( # <<<<<<<<<<<<<< * self, * Vec vn, */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_62naturalToGlobal(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vn, struct PyPetscVecObject *__pyx_v_vg, PyObject *__pyx_v_addv) { InsertMode __pyx_v_im; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations InsertMode __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("naturalToGlobal", 1); /* "petsc4py/PETSc/DMDA.pyx":900 * * """ * cdef PetscInsertMode im = insertmode(addv) # <<<<<<<<<<<<<< * CHKERR( DMDANaturalToGlobalBegin(self.dm, vn.vec, im, vg.vec) ) * CHKERR( DMDANaturalToGlobalEnd (self.dm, vn.vec, im, vg.vec) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_insertmode(__pyx_v_addv); if (unlikely(__pyx_t_1 == ((InsertMode)((InsertMode)-1L)))) __PYX_ERR(56, 900, __pyx_L1_error) __pyx_v_im = __pyx_t_1; /* "petsc4py/PETSc/DMDA.pyx":901 * """ * cdef PetscInsertMode im = insertmode(addv) * CHKERR( DMDANaturalToGlobalBegin(self.dm, vn.vec, im, vg.vec) ) # <<<<<<<<<<<<<< * CHKERR( DMDANaturalToGlobalEnd (self.dm, vn.vec, im, vg.vec) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDANaturalToGlobalBegin(__pyx_v_self->__pyx_base.dm, __pyx_v_vn->vec, __pyx_v_im, __pyx_v_vg->vec)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(56, 901, __pyx_L1_error) /* "petsc4py/PETSc/DMDA.pyx":902 * cdef PetscInsertMode im = insertmode(addv) * CHKERR( DMDANaturalToGlobalBegin(self.dm, vn.vec, im, vg.vec) ) * CHKERR( DMDANaturalToGlobalEnd (self.dm, vn.vec, im, vg.vec) ) # <<<<<<<<<<<<<< * * # */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDANaturalToGlobalEnd(__pyx_v_self->__pyx_base.dm, __pyx_v_vn->vec, __pyx_v_im, __pyx_v_vg->vec)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(56, 902, __pyx_L1_error) /* "petsc4py/PETSc/DMDA.pyx":875 * CHKERR( DMDAGlobalToNaturalEnd (self.dm, vg.vec, im, vn.vec) ) * * def naturalToGlobal( # <<<<<<<<<<<<<< * self, * Vec vn, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMDA.naturalToGlobal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMDA.pyx":906 * # * * def getAO(self) -> AO: # <<<<<<<<<<<<<< * """Return the application ordering context for a distributed array. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_65getAO(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4DMDA_64getAO, "DMDA.getAO(self) -> AO\nReturn the application ordering context for a distributed array.\n\n Collective.\n\n The returned `AO` maps to the natural grid ordering that would be\n used for the `DMDA` if only 1 processor were employed (ordering most\n rapidly in the x-dimension, then y, then z). Multiple degrees of\n freedom are numbered for each node (rather than 1 component for the\n whole grid, then the next component, etc.).\n\n See Also\n --------\n petsc.DMDAGetAO\n\n \nSource code at petsc4py/PETSc/DMDA.pyx:906"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_65getAO(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getAO (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getAO", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getAO", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_64getAO(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_64getAO(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self) { struct PyPetscAOObject *__pyx_v_ao = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getAO", 1); /* "petsc4py/PETSc/DMDA.pyx":922 * * """ * cdef AO ao = AO() # <<<<<<<<<<<<<< * CHKERR( DMDAGetAO(self.dm, &ao.ao) ) * CHKERR( PetscINCREF(ao.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_AO)); if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 922, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ao = ((struct PyPetscAOObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DMDA.pyx":923 * """ * cdef AO ao = AO() * CHKERR( DMDAGetAO(self.dm, &ao.ao) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(ao.obj) ) * return ao */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDAGetAO(__pyx_v_self->__pyx_base.dm, (&__pyx_v_ao->ao))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(56, 923, __pyx_L1_error) /* "petsc4py/PETSc/DMDA.pyx":924 * cdef AO ao = AO() * CHKERR( DMDAGetAO(self.dm, &ao.ao) ) * CHKERR( PetscINCREF(ao.obj) ) # <<<<<<<<<<<<<< * return ao * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ao->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(56, 924, __pyx_L1_error) /* "petsc4py/PETSc/DMDA.pyx":925 * CHKERR( DMDAGetAO(self.dm, &ao.ao) ) * CHKERR( PetscINCREF(ao.obj) ) * return ao # <<<<<<<<<<<<<< * * def getScatter(self) -> tuple[Scatter, Scatter]: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_ao); __pyx_r = ((PyObject *)__pyx_v_ao); goto __pyx_L0; /* "petsc4py/PETSc/DMDA.pyx":906 * # * * def getAO(self) -> AO: # <<<<<<<<<<<<<< * """Return the application ordering context for a distributed array. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.getAO", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ao); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMDA.pyx":927 * return ao * * def getScatter(self) -> tuple[Scatter, Scatter]: # <<<<<<<<<<<<<< * """Return the global-to-local, and local-to-local scatter contexts. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_67getScatter(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4DMDA_66getScatter, "DMDA.getScatter(self) -> tuple[Scatter, Scatter]\nReturn the global-to-local, and local-to-local scatter contexts.\n\n Collective.\n\n See Also\n --------\n petsc.DMDAGetScatter\n\n \nSource code at petsc4py/PETSc/DMDA.pyx:927"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_67getScatter(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getScatter (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getScatter", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getScatter", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_66getScatter(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_66getScatter(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self) { struct PyPetscScatterObject *__pyx_v_l2g = 0; struct PyPetscScatterObject *__pyx_v_g2l = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getScatter", 1); /* "petsc4py/PETSc/DMDA.pyx":937 * * """ * cdef Scatter l2g = Scatter() # <<<<<<<<<<<<<< * cdef Scatter g2l = Scatter() * CHKERR( DMDAGetScatter(self.dm, &l2g.sct, &g2l.sct) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Scatter)); if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 937, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_l2g = ((struct PyPetscScatterObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DMDA.pyx":938 * """ * cdef Scatter l2g = Scatter() * cdef Scatter g2l = Scatter() # <<<<<<<<<<<<<< * CHKERR( DMDAGetScatter(self.dm, &l2g.sct, &g2l.sct) ) * CHKERR( PetscINCREF(l2g.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Scatter)); if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 938, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_g2l = ((struct PyPetscScatterObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DMDA.pyx":939 * cdef Scatter l2g = Scatter() * cdef Scatter g2l = Scatter() * CHKERR( DMDAGetScatter(self.dm, &l2g.sct, &g2l.sct) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(l2g.obj) ) * CHKERR( PetscINCREF(g2l.obj) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDAGetScatter(__pyx_v_self->__pyx_base.dm, (&__pyx_v_l2g->sct), (&__pyx_v_g2l->sct))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(56, 939, __pyx_L1_error) /* "petsc4py/PETSc/DMDA.pyx":940 * cdef Scatter g2l = Scatter() * CHKERR( DMDAGetScatter(self.dm, &l2g.sct, &g2l.sct) ) * CHKERR( PetscINCREF(l2g.obj) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(g2l.obj) ) * return (l2g, g2l) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_l2g->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(56, 940, __pyx_L1_error) /* "petsc4py/PETSc/DMDA.pyx":941 * CHKERR( DMDAGetScatter(self.dm, &l2g.sct, &g2l.sct) ) * CHKERR( PetscINCREF(l2g.obj) ) * CHKERR( PetscINCREF(g2l.obj) ) # <<<<<<<<<<<<<< * return (l2g, g2l) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_g2l->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(56, 941, __pyx_L1_error) /* "petsc4py/PETSc/DMDA.pyx":942 * CHKERR( PetscINCREF(l2g.obj) ) * CHKERR( PetscINCREF(g2l.obj) ) * return (l2g, g2l) # <<<<<<<<<<<<<< * * # */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 942, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF((PyObject *)__pyx_v_l2g); __Pyx_GIVEREF((PyObject *)__pyx_v_l2g); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_l2g))) __PYX_ERR(56, 942, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_g2l); __Pyx_GIVEREF((PyObject *)__pyx_v_g2l); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_g2l))) __PYX_ERR(56, 942, __pyx_L1_error); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMDA.pyx":927 * return ao * * def getScatter(self) -> tuple[Scatter, Scatter]: # <<<<<<<<<<<<<< * """Return the global-to-local, and local-to-local scatter contexts. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.getScatter", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_l2g); __Pyx_XDECREF((PyObject *)__pyx_v_g2l); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMDA.pyx":946 * # * * def setRefinementFactor( # <<<<<<<<<<<<<< * self, * refine_x: int = 2, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_69setRefinementFactor(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4DMDA_68setRefinementFactor, "DMDA.setRefinementFactor(self, refine_x: int = 2, refine_y: int = 2, refine_z: int = 2) -> None\nSet the ratios for the DMDA grid refinement.\n\n Logically collective.\n\n Parameters\n ----------\n refine_x\n Ratio of fine grid to coarse in x dimension.\n refine_y\n Ratio of fine grid to coarse in y dimension.\n refine_z\n Ratio of fine grid to coarse in z dimension.\n\n See Also\n --------\n getRefinementFactor, petsc.DMDASetRefinementFactor\n\n \nSource code at petsc4py/PETSc/DMDA.pyx:946"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_69setRefinementFactor(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_refine_x = 0; PyObject *__pyx_v_refine_y = 0; PyObject *__pyx_v_refine_z = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setRefinementFactor (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_refine_x,&__pyx_n_s_refine_y,&__pyx_n_s_refine_z,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_2)); values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_2)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_2)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_refine_x); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(56, 946, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_refine_y); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(56, 946, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_refine_z); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(56, 946, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setRefinementFactor") < 0)) __PYX_ERR(56, 946, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_refine_x = values[0]; __pyx_v_refine_y = values[1]; __pyx_v_refine_z = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setRefinementFactor", 0, 0, 3, __pyx_nargs); __PYX_ERR(56, 946, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMDA.setRefinementFactor", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_68setRefinementFactor(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self), __pyx_v_refine_x, __pyx_v_refine_y, __pyx_v_refine_z); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_68setRefinementFactor(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_refine_x, PyObject *__pyx_v_refine_y, PyObject *__pyx_v_refine_z) { PetscInt __pyx_v_refine[3]; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setRefinementFactor", 1); /* "petsc4py/PETSc/DMDA.pyx":971 * """ * cdef PetscInt refine[3] * refine[0] = asInt(refine_x) # <<<<<<<<<<<<<< * refine[1] = asInt(refine_y) * refine[2] = asInt(refine_z) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_refine_x); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(56, 971, __pyx_L1_error) (__pyx_v_refine[0]) = __pyx_t_1; /* "petsc4py/PETSc/DMDA.pyx":972 * cdef PetscInt refine[3] * refine[0] = asInt(refine_x) * refine[1] = asInt(refine_y) # <<<<<<<<<<<<<< * refine[2] = asInt(refine_z) * CHKERR( DMDASetRefinementFactor(self.dm, */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_refine_y); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(56, 972, __pyx_L1_error) (__pyx_v_refine[1]) = __pyx_t_1; /* "petsc4py/PETSc/DMDA.pyx":973 * refine[0] = asInt(refine_x) * refine[1] = asInt(refine_y) * refine[2] = asInt(refine_z) # <<<<<<<<<<<<<< * CHKERR( DMDASetRefinementFactor(self.dm, * refine[0], */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_refine_z); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(56, 973, __pyx_L1_error) (__pyx_v_refine[2]) = __pyx_t_1; /* "petsc4py/PETSc/DMDA.pyx":974 * refine[1] = asInt(refine_y) * refine[2] = asInt(refine_z) * CHKERR( DMDASetRefinementFactor(self.dm, # <<<<<<<<<<<<<< * refine[0], * refine[1], */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDASetRefinementFactor(__pyx_v_self->__pyx_base.dm, (__pyx_v_refine[0]), (__pyx_v_refine[1]), (__pyx_v_refine[2]))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(56, 974, __pyx_L1_error) /* "petsc4py/PETSc/DMDA.pyx":946 * # * * def setRefinementFactor( # <<<<<<<<<<<<<< * self, * refine_x: int = 2, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMDA.setRefinementFactor", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMDA.pyx":979 * refine[2]) ) * * def getRefinementFactor(self) -> tuple[int, ...]: # <<<<<<<<<<<<<< * """Return the ratios that the DMDA grid is refined in each dimension. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_71getRefinementFactor(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4DMDA_70getRefinementFactor, "DMDA.getRefinementFactor(self) -> tuple[int, ...]\nReturn the ratios that the DMDA grid is refined in each dimension.\n\n Not collective.\n\n See Also\n --------\n setRefinementFactor, petsc.DMDAGetRefinementFactor\n\n \nSource code at petsc4py/PETSc/DMDA.pyx:979"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_71getRefinementFactor(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getRefinementFactor (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getRefinementFactor", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getRefinementFactor", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_70getRefinementFactor(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_70getRefinementFactor(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self) { PetscInt __pyx_v_dim; PetscInt __pyx_v_refine[3]; PetscInt __pyx_9genexpr17__pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscInt __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getRefinementFactor", 1); /* "petsc4py/PETSc/DMDA.pyx":989 * * """ * cdef PetscInt i, dim = 0, refine[3] # <<<<<<<<<<<<<< * CHKERR( DMDAGetDim(self.dm, &dim) ) * CHKERR( DMDAGetRefinementFactor(self.dm, */ __pyx_v_dim = 0; /* "petsc4py/PETSc/DMDA.pyx":990 * """ * cdef PetscInt i, dim = 0, refine[3] * CHKERR( DMDAGetDim(self.dm, &dim) ) # <<<<<<<<<<<<<< * CHKERR( DMDAGetRefinementFactor(self.dm, * &refine[0], */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_DMDAGetDim(__pyx_v_self->__pyx_base.dm, (&__pyx_v_dim))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(56, 990, __pyx_L1_error) /* "petsc4py/PETSc/DMDA.pyx":991 * cdef PetscInt i, dim = 0, refine[3] * CHKERR( DMDAGetDim(self.dm, &dim) ) * CHKERR( DMDAGetRefinementFactor(self.dm, # <<<<<<<<<<<<<< * &refine[0], * &refine[1], */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDAGetRefinementFactor(__pyx_v_self->__pyx_base.dm, (&(__pyx_v_refine[0])), (&(__pyx_v_refine[1])), (&(__pyx_v_refine[2])))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(56, 991, __pyx_L1_error) /* "petsc4py/PETSc/DMDA.pyx":995 * &refine[1], * &refine[2]) ) * return tuple([toInt(refine[i]) for 0 <= i < dim]) # <<<<<<<<<<<<<< * * def setInterpolationType(self, interp_type: InterpolationType) -> None: */ __Pyx_XDECREF(__pyx_r); { /* enter inner scope */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 995, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_v_dim; for (__pyx_9genexpr17__pyx_v_i = 0; __pyx_9genexpr17__pyx_v_i < __pyx_t_3; __pyx_9genexpr17__pyx_v_i++) { __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_refine[__pyx_9genexpr17__pyx_v_i])); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 995, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_4))) __PYX_ERR(56, 995, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } } /* exit inner scope */ __pyx_t_4 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 995, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMDA.pyx":979 * refine[2]) ) * * def getRefinementFactor(self) -> tuple[int, ...]: # <<<<<<<<<<<<<< * """Return the ratios that the DMDA grid is refined in each dimension. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.getRefinementFactor", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMDA.pyx":997 * return tuple([toInt(refine[i]) for 0 <= i < dim]) * * def setInterpolationType(self, interp_type: InterpolationType) -> None: # <<<<<<<<<<<<<< * """Set the type of interpolation. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_73setInterpolationType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4DMDA_72setInterpolationType, "DMDA.setInterpolationType(self, interp_type: InterpolationType) -> None\nSet the type of interpolation.\n\n Logically collective.\n\n You should call this on the coarser of the two DMDAs you pass to\n `DM.createInterpolation`.\n\n Parameters\n ----------\n interp_type\n The interpolation type.\n\n See Also\n --------\n getInterpolationType, petsc.DMDASetInterpolationType\n\n \nSource code at petsc4py/PETSc/DMDA.pyx:997"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_73setInterpolationType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_interp_type = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setInterpolationType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_interp_type,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_interp_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(56, 997, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setInterpolationType") < 0)) __PYX_ERR(56, 997, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_interp_type = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setInterpolationType", 1, 1, 1, __pyx_nargs); __PYX_ERR(56, 997, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMDA.setInterpolationType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_72setInterpolationType(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self), __pyx_v_interp_type); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_72setInterpolationType(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_interp_type) { DMDAInterpolationType __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations DMDAInterpolationType __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setInterpolationType", 1); /* "petsc4py/PETSc/DMDA.pyx":1015 * * """ * cdef PetscDMDAInterpolationType ival = dainterpolationtype(interp_type) # <<<<<<<<<<<<<< * CHKERR( DMDASetInterpolationType(self.dm, ival) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_dainterpolationtype(__pyx_v_interp_type); if (unlikely(__pyx_t_1 == ((DMDAInterpolationType)((DMDAInterpolationType)-1L)))) __PYX_ERR(56, 1015, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "petsc4py/PETSc/DMDA.pyx":1016 * """ * cdef PetscDMDAInterpolationType ival = dainterpolationtype(interp_type) * CHKERR( DMDASetInterpolationType(self.dm, ival) ) # <<<<<<<<<<<<<< * * def getInterpolationType(self) -> InterpolationType: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDASetInterpolationType(__pyx_v_self->__pyx_base.dm, __pyx_v_ival)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(56, 1016, __pyx_L1_error) /* "petsc4py/PETSc/DMDA.pyx":997 * return tuple([toInt(refine[i]) for 0 <= i < dim]) * * def setInterpolationType(self, interp_type: InterpolationType) -> None: # <<<<<<<<<<<<<< * """Set the type of interpolation. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMDA.setInterpolationType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMDA.pyx":1018 * CHKERR( DMDASetInterpolationType(self.dm, ival) ) * * def getInterpolationType(self) -> InterpolationType: # <<<<<<<<<<<<<< * """Return the type of interpolation. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_75getInterpolationType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4DMDA_74getInterpolationType, "DMDA.getInterpolationType(self) -> InterpolationType\nReturn the type of interpolation.\n\n Not collective.\n\n See Also\n --------\n setInterpolationType, petsc.DMDAGetInterpolationType\n\n \nSource code at petsc4py/PETSc/DMDA.pyx:1018"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_75getInterpolationType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getInterpolationType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getInterpolationType", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getInterpolationType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_74getInterpolationType(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_74getInterpolationType(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self) { DMDAInterpolationType __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getInterpolationType", 1); /* "petsc4py/PETSc/DMDA.pyx":1028 * * """ * cdef PetscDMDAInterpolationType ival = DMDA_INTERPOLATION_Q0 # <<<<<<<<<<<<<< * CHKERR( DMDAGetInterpolationType(self.dm, &ival) ) * return ival */ __pyx_v_ival = DMDA_Q0; /* "petsc4py/PETSc/DMDA.pyx":1029 * """ * cdef PetscDMDAInterpolationType ival = DMDA_INTERPOLATION_Q0 * CHKERR( DMDAGetInterpolationType(self.dm, &ival) ) # <<<<<<<<<<<<<< * return ival * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDAGetInterpolationType(__pyx_v_self->__pyx_base.dm, (&__pyx_v_ival))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(56, 1029, __pyx_L1_error) /* "petsc4py/PETSc/DMDA.pyx":1030 * cdef PetscDMDAInterpolationType ival = DMDA_INTERPOLATION_Q0 * CHKERR( DMDAGetInterpolationType(self.dm, &ival) ) * return ival # <<<<<<<<<<<<<< * * # */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_long(((long)__pyx_v_ival)); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 1030, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMDA.pyx":1018 * CHKERR( DMDASetInterpolationType(self.dm, ival) ) * * def getInterpolationType(self) -> InterpolationType: # <<<<<<<<<<<<<< * """Return the type of interpolation. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.getInterpolationType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMDA.pyx":1034 * # * * def setElementType(self, elem_type: ElementType | str) -> None: # <<<<<<<<<<<<<< * """Set the element type to be returned by `getElements`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_77setElementType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4DMDA_76setElementType, "DMDA.setElementType(self, elem_type: ElementType | str) -> None\nSet the element type to be returned by `getElements`.\n\n Not collective.\n\n See Also\n --------\n getElementType, petsc.DMDASetElementType\n\n \nSource code at petsc4py/PETSc/DMDA.pyx:1034"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_77setElementType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_elem_type = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setElementType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_elem_type,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_elem_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(56, 1034, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setElementType") < 0)) __PYX_ERR(56, 1034, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_elem_type = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setElementType", 1, 1, 1, __pyx_nargs); __PYX_ERR(56, 1034, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMDA.setElementType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_76setElementType(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self), __pyx_v_elem_type); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_76setElementType(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_elem_type) { DMDAElementType __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations DMDAElementType __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setElementType", 1); /* "petsc4py/PETSc/DMDA.pyx":1044 * * """ * cdef PetscDMDAElementType ival = daelementtype(elem_type) # <<<<<<<<<<<<<< * CHKERR( DMDASetElementType(self.dm, ival) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_daelementtype(__pyx_v_elem_type); if (unlikely(__pyx_t_1 == ((DMDAElementType)((DMDAElementType)-1L)))) __PYX_ERR(56, 1044, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "petsc4py/PETSc/DMDA.pyx":1045 * """ * cdef PetscDMDAElementType ival = daelementtype(elem_type) * CHKERR( DMDASetElementType(self.dm, ival) ) # <<<<<<<<<<<<<< * * # FIXME: Return type */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDASetElementType(__pyx_v_self->__pyx_base.dm, __pyx_v_ival)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(56, 1045, __pyx_L1_error) /* "petsc4py/PETSc/DMDA.pyx":1034 * # * * def setElementType(self, elem_type: ElementType | str) -> None: # <<<<<<<<<<<<<< * """Set the element type to be returned by `getElements`. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMDA.setElementType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMDA.pyx":1048 * * # FIXME: Return type * def getElementType(self) -> ElementType: # <<<<<<<<<<<<<< * """Return the element type to be returned by `getElements`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_79getElementType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4DMDA_78getElementType, "DMDA.getElementType(self) -> ElementType\nReturn the element type to be returned by `getElements`.\n\n Not collective.\n\n See Also\n --------\n setElementType, petsc.DMDAGetElementType\n\n \nSource code at petsc4py/PETSc/DMDA.pyx:1048"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_79getElementType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getElementType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getElementType", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getElementType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_78getElementType(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_78getElementType(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self) { DMDAElementType __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getElementType", 1); /* "petsc4py/PETSc/DMDA.pyx":1058 * * """ * cdef PetscDMDAElementType ival = DMDA_ELEMENT_Q1 # <<<<<<<<<<<<<< * CHKERR( DMDAGetElementType(self.dm, &ival) ) * return ival */ __pyx_v_ival = DMDA_ELEMENT_Q1; /* "petsc4py/PETSc/DMDA.pyx":1059 * """ * cdef PetscDMDAElementType ival = DMDA_ELEMENT_Q1 * CHKERR( DMDAGetElementType(self.dm, &ival) ) # <<<<<<<<<<<<<< * return ival * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDAGetElementType(__pyx_v_self->__pyx_base.dm, (&__pyx_v_ival))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(56, 1059, __pyx_L1_error) /* "petsc4py/PETSc/DMDA.pyx":1060 * cdef PetscDMDAElementType ival = DMDA_ELEMENT_Q1 * CHKERR( DMDAGetElementType(self.dm, &ival) ) * return ival # <<<<<<<<<<<<<< * * def getElements(self, elem_type: ElementType | None = None) -> ArrayInt: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_long(((long)__pyx_v_ival)); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 1060, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMDA.pyx":1048 * * # FIXME: Return type * def getElementType(self) -> ElementType: # <<<<<<<<<<<<<< * """Return the element type to be returned by `getElements`. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.getElementType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMDA.pyx":1062 * return ival * * def getElements(self, elem_type: ElementType | None = None) -> ArrayInt: # <<<<<<<<<<<<<< * """Return an array containing the indices of all the local elements. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_81getElements(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4DMDA_80getElements, "DMDA.getElements(self, elem_type: ElementType | None = None) -> ArrayInt\nReturn an array containing the indices of all the local elements.\n\n Not collective.\n\n The elements are in local coordinates.\n\n Each process uniquely owns a subset of the elements. That is, no\n element is owned by two or more processes.\n\n Parameters\n ----------\n elem_type\n The element type.\n\n See Also\n --------\n petsc.DMDAGetElements\n\n \nSource code at petsc4py/PETSc/DMDA.pyx:1062"); static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_81getElements(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_elem_type = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getElements (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_elem_type,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_elem_type); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(56, 1062, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getElements") < 0)) __PYX_ERR(56, 1062, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_elem_type = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getElements", 0, 0, 1, __pyx_nargs); __PYX_ERR(56, 1062, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMDA.getElements", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_80getElements(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self), __pyx_v_elem_type); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_80getElements(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_elem_type) { PetscInt __pyx_v_dim; DMDAElementType __pyx_v_etype; PetscInt __pyx_v_nel; PetscInt __pyx_v_nen; PetscInt const *__pyx_v_elems; PyObject *__pyx_v_elements = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_t_2; DMDAElementType __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; int __pyx_t_8; char const *__pyx_t_9; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getElements", 1); /* "petsc4py/PETSc/DMDA.pyx":1082 * * """ * cdef PetscInt dim=0 # <<<<<<<<<<<<<< * cdef PetscDMDAElementType etype * cdef PetscInt nel=0, nen=0 */ __pyx_v_dim = 0; /* "petsc4py/PETSc/DMDA.pyx":1084 * cdef PetscInt dim=0 * cdef PetscDMDAElementType etype * cdef PetscInt nel=0, nen=0 # <<<<<<<<<<<<<< * cdef const PetscInt *elems=NULL * cdef object elements */ __pyx_v_nel = 0; __pyx_v_nen = 0; /* "petsc4py/PETSc/DMDA.pyx":1085 * cdef PetscDMDAElementType etype * cdef PetscInt nel=0, nen=0 * cdef const PetscInt *elems=NULL # <<<<<<<<<<<<<< * cdef object elements * CHKERR( DMDAGetDim(self.dm, &dim) ) */ __pyx_v_elems = NULL; /* "petsc4py/PETSc/DMDA.pyx":1087 * cdef const PetscInt *elems=NULL * cdef object elements * CHKERR( DMDAGetDim(self.dm, &dim) ) # <<<<<<<<<<<<<< * if elem_type is not None: * etype = daelementtype(elem_type) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_DMDAGetDim(__pyx_v_self->__pyx_base.dm, (&__pyx_v_dim))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(56, 1087, __pyx_L1_error) /* "petsc4py/PETSc/DMDA.pyx":1088 * cdef object elements * CHKERR( DMDAGetDim(self.dm, &dim) ) * if elem_type is not None: # <<<<<<<<<<<<<< * etype = daelementtype(elem_type) * CHKERR( DMDASetElementType(self.dm, etype) ) */ __pyx_t_2 = (__pyx_v_elem_type != Py_None); if (__pyx_t_2) { /* "petsc4py/PETSc/DMDA.pyx":1089 * CHKERR( DMDAGetDim(self.dm, &dim) ) * if elem_type is not None: * etype = daelementtype(elem_type) # <<<<<<<<<<<<<< * CHKERR( DMDASetElementType(self.dm, etype) ) * try: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_daelementtype(__pyx_v_elem_type); if (unlikely(__pyx_t_3 == ((DMDAElementType)((DMDAElementType)-1L)))) __PYX_ERR(56, 1089, __pyx_L1_error) __pyx_v_etype = __pyx_t_3; /* "petsc4py/PETSc/DMDA.pyx":1090 * if elem_type is not None: * etype = daelementtype(elem_type) * CHKERR( DMDASetElementType(self.dm, etype) ) # <<<<<<<<<<<<<< * try: * CHKERR( DMDAGetElements(self.dm, &nel, &nen, &elems) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDASetElementType(__pyx_v_self->__pyx_base.dm, __pyx_v_etype)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(56, 1090, __pyx_L1_error) /* "petsc4py/PETSc/DMDA.pyx":1088 * cdef object elements * CHKERR( DMDAGetDim(self.dm, &dim) ) * if elem_type is not None: # <<<<<<<<<<<<<< * etype = daelementtype(elem_type) * CHKERR( DMDASetElementType(self.dm, etype) ) */ } /* "petsc4py/PETSc/DMDA.pyx":1091 * etype = daelementtype(elem_type) * CHKERR( DMDASetElementType(self.dm, etype) ) * try: # <<<<<<<<<<<<<< * CHKERR( DMDAGetElements(self.dm, &nel, &nen, &elems) ) * elements = array_i(nel*nen, elems) */ /*try:*/ { /* "petsc4py/PETSc/DMDA.pyx":1092 * CHKERR( DMDASetElementType(self.dm, etype) ) * try: * CHKERR( DMDAGetElements(self.dm, &nel, &nen, &elems) ) # <<<<<<<<<<<<<< * elements = array_i(nel*nen, elems) * elements.shape = (toInt(nel), toInt(nen)) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDAGetElements(__pyx_v_self->__pyx_base.dm, (&__pyx_v_nel), (&__pyx_v_nen), (&__pyx_v_elems))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(56, 1092, __pyx_L5_error) /* "petsc4py/PETSc/DMDA.pyx":1093 * try: * CHKERR( DMDAGetElements(self.dm, &nel, &nen, &elems) ) * elements = array_i(nel*nen, elems) # <<<<<<<<<<<<<< * elements.shape = (toInt(nel), toInt(nen)) * finally: */ __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i((__pyx_v_nel * __pyx_v_nen), __pyx_v_elems)); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 1093, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_elements = __pyx_t_4; __pyx_t_4 = 0; /* "petsc4py/PETSc/DMDA.pyx":1094 * CHKERR( DMDAGetElements(self.dm, &nel, &nen, &elems) ) * elements = array_i(nel*nen, elems) * elements.shape = (toInt(nel), toInt(nen)) # <<<<<<<<<<<<<< * finally: * CHKERR( DMDARestoreElements(self.dm, &nel, &nen, &elems) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nel); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 1094, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nen); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 1094, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(56, 1094, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4)) __PYX_ERR(56, 1094, __pyx_L5_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5)) __PYX_ERR(56, 1094, __pyx_L5_error); __pyx_t_4 = 0; __pyx_t_5 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_elements, __pyx_n_s_shape, __pyx_t_6) < 0) __PYX_ERR(56, 1094, __pyx_L5_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } /* "petsc4py/PETSc/DMDA.pyx":1096 * elements.shape = (toInt(nel), toInt(nen)) * finally: * CHKERR( DMDARestoreElements(self.dm, &nel, &nen, &elems) ) # <<<<<<<<<<<<<< * return elements * */ /*finally:*/ { /*normal exit:*/{ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDARestoreElements(__pyx_v_self->__pyx_base.dm, (&__pyx_v_nel), (&__pyx_v_nen), (&__pyx_v_elems))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(56, 1096, __pyx_L1_error) goto __pyx_L6; } __pyx_L5_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12) < 0)) __Pyx_ErrFetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_15); __pyx_t_7 = __pyx_lineno; __pyx_t_8 = __pyx_clineno; __pyx_t_9 = __pyx_filename; { __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDARestoreElements(__pyx_v_self->__pyx_base.dm, (&__pyx_v_nel), (&__pyx_v_nen), (&__pyx_v_elems))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(56, 1096, __pyx_L8_error) } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); } __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_ErrRestore(__pyx_t_10, __pyx_t_11, __pyx_t_12); __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_lineno = __pyx_t_7; __pyx_clineno = __pyx_t_8; __pyx_filename = __pyx_t_9; goto __pyx_L1_error; __pyx_L8_error:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); } __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; goto __pyx_L1_error; } __pyx_L6:; } /* "petsc4py/PETSc/DMDA.pyx":1097 * finally: * CHKERR( DMDARestoreElements(self.dm, &nel, &nen, &elems) ) * return elements # <<<<<<<<<<<<<< * * # */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_elements); __pyx_r = __pyx_v_elements; goto __pyx_L0; /* "petsc4py/PETSc/DMDA.pyx":1062 * return ival * * def getElements(self, elem_type: ElementType | None = None) -> ArrayInt: # <<<<<<<<<<<<<< * """Return an array containing the indices of all the local elements. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.getElements", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_elements); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMDA.pyx":1103 * property dim: * """The grid dimension.""" * def __get__(self) -> int: # <<<<<<<<<<<<<< * return self.getDim() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_3dim_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_3dim_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_3dim___get__(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_3dim___get__(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/DMDA.pyx":1104 * """The grid dimension.""" * def __get__(self) -> int: * return self.getDim() # <<<<<<<<<<<<<< * * property dof: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getDim); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 1104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 1104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMDA.pyx":1103 * property dim: * """The grid dimension.""" * def __get__(self) -> int: # <<<<<<<<<<<<<< * return self.getDim() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.dim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMDA.pyx":1108 * property dof: * """The number of DOFs associated with each stratum of the grid.""" * def __get__(self) -> int: # <<<<<<<<<<<<<< * return self.getDof() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_3dof_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_3dof_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_3dof___get__(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_3dof___get__(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/DMDA.pyx":1109 * """The number of DOFs associated with each stratum of the grid.""" * def __get__(self) -> int: * return self.getDof() # <<<<<<<<<<<<<< * * property sizes: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getDof); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 1109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 1109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMDA.pyx":1108 * property dof: * """The number of DOFs associated with each stratum of the grid.""" * def __get__(self) -> int: # <<<<<<<<<<<<<< * return self.getDof() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.dof.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMDA.pyx":1113 * property sizes: * """The global dimension.""" * def __get__(self) -> tuple[int, ...]: # <<<<<<<<<<<<<< * return self.getSizes() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_5sizes_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_5sizes_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_5sizes___get__(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_5sizes___get__(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/DMDA.pyx":1114 * """The global dimension.""" * def __get__(self) -> tuple[int, ...]: * return self.getSizes() # <<<<<<<<<<<<<< * * property proc_sizes: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getSizes); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 1114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 1114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMDA.pyx":1113 * property sizes: * """The global dimension.""" * def __get__(self) -> tuple[int, ...]: # <<<<<<<<<<<<<< * return self.getSizes() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.sizes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMDA.pyx":1118 * property proc_sizes: * """The number of processes in each dimension in the global decomposition.""" * def __get__(self) -> tuple[int, ...]: # <<<<<<<<<<<<<< * return self.getProcSizes() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_10proc_sizes_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_10proc_sizes_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_10proc_sizes___get__(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_10proc_sizes___get__(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/DMDA.pyx":1119 * """The number of processes in each dimension in the global decomposition.""" * def __get__(self) -> tuple[int, ...]: * return self.getProcSizes() # <<<<<<<<<<<<<< * * property boundary_type: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getProcSizes); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 1119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 1119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMDA.pyx":1118 * property proc_sizes: * """The number of processes in each dimension in the global decomposition.""" * def __get__(self) -> tuple[int, ...]: # <<<<<<<<<<<<<< * return self.getProcSizes() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.proc_sizes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMDA.pyx":1123 * property boundary_type: * """Boundary types in each dimension.""" * def __get__(self) -> tuple[DM.BoundaryType, ...]: # <<<<<<<<<<<<<< * return self.getBoundaryType() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_13boundary_type_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_13boundary_type_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_13boundary_type___get__(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_13boundary_type___get__(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/DMDA.pyx":1124 * """Boundary types in each dimension.""" * def __get__(self) -> tuple[DM.BoundaryType, ...]: * return self.getBoundaryType() # <<<<<<<<<<<<<< * * property stencil: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getBoundaryType); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 1124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 1124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMDA.pyx":1123 * property boundary_type: * """Boundary types in each dimension.""" * def __get__(self) -> tuple[DM.BoundaryType, ...]: # <<<<<<<<<<<<<< * return self.getBoundaryType() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.boundary_type.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMDA.pyx":1128 * property stencil: * """Stencil type and width.""" * def __get__(self) -> tuple[StencilType, int]: # <<<<<<<<<<<<<< * return self.getStencil() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_7stencil_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_7stencil_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_7stencil___get__(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_7stencil___get__(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/DMDA.pyx":1129 * """Stencil type and width.""" * def __get__(self) -> tuple[StencilType, int]: * return self.getStencil() # <<<<<<<<<<<<<< * * property stencil_type: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getStencil); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 1129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 1129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMDA.pyx":1128 * property stencil: * """Stencil type and width.""" * def __get__(self) -> tuple[StencilType, int]: # <<<<<<<<<<<<<< * return self.getStencil() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.stencil.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMDA.pyx":1133 * property stencil_type: * """Stencil type.""" * def __get__(self) -> str: # <<<<<<<<<<<<<< * return self.getStencilType() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_12stencil_type_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_12stencil_type_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_12stencil_type___get__(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_12stencil_type___get__(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/DMDA.pyx":1134 * """Stencil type.""" * def __get__(self) -> str: * return self.getStencilType() # <<<<<<<<<<<<<< * * property stencil_width: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getStencilType); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 1134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 1134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMDA.pyx":1133 * property stencil_type: * """Stencil type.""" * def __get__(self) -> str: # <<<<<<<<<<<<<< * return self.getStencilType() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.stencil_type.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMDA.pyx":1138 * property stencil_width: * """Elementwise stencil width.""" * def __get__(self) -> int: # <<<<<<<<<<<<<< * return self.getStencilWidth() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_13stencil_width_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_13stencil_width_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_13stencil_width___get__(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_13stencil_width___get__(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/DMDA.pyx":1139 * """Elementwise stencil width.""" * def __get__(self) -> int: * return self.getStencilWidth() # <<<<<<<<<<<<<< * * property ranges: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getStencilWidth); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 1139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 1139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMDA.pyx":1138 * property stencil_width: * """Elementwise stencil width.""" * def __get__(self) -> int: # <<<<<<<<<<<<<< * return self.getStencilWidth() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.stencil_width.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMDA.pyx":1143 * property ranges: * """Ranges of the local region in each dimension.""" * def __get__(self) -> tuple[tuple[int, int], ...]: # <<<<<<<<<<<<<< * return self.getRanges() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_6ranges_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_6ranges_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_6ranges___get__(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_6ranges___get__(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/DMDA.pyx":1144 * """Ranges of the local region in each dimension.""" * def __get__(self) -> tuple[tuple[int, int], ...]: * return self.getRanges() # <<<<<<<<<<<<<< * * property ghost_ranges: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getRanges); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 1144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 1144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMDA.pyx":1143 * property ranges: * """Ranges of the local region in each dimension.""" * def __get__(self) -> tuple[tuple[int, int], ...]: # <<<<<<<<<<<<<< * return self.getRanges() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.ranges.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMDA.pyx":1148 * property ghost_ranges: * """Ranges of local region, including ghost nodes.""" * def __get__(self) -> tuple[tuple[int, int], ...]: # <<<<<<<<<<<<<< * return self.getGhostRanges() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_12ghost_ranges_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_12ghost_ranges_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_12ghost_ranges___get__(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_12ghost_ranges___get__(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/DMDA.pyx":1149 * """Ranges of local region, including ghost nodes.""" * def __get__(self) -> tuple[tuple[int, int], ...]: * return self.getGhostRanges() # <<<<<<<<<<<<<< * * property corners: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getGhostRanges); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 1149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 1149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMDA.pyx":1148 * property ghost_ranges: * """Ranges of local region, including ghost nodes.""" * def __get__(self) -> tuple[tuple[int, int], ...]: # <<<<<<<<<<<<<< * return self.getGhostRanges() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.ghost_ranges.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMDA.pyx":1153 * property corners: * """The lower left corner and size of local region in each dimension.""" * def __get__(self) -> tuple[tuple[int, ...], tuple[int, ...]]: # <<<<<<<<<<<<<< * return self.getCorners() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_7corners_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_7corners_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_7corners___get__(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_7corners___get__(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/DMDA.pyx":1154 * """The lower left corner and size of local region in each dimension.""" * def __get__(self) -> tuple[tuple[int, ...], tuple[int, ...]]: * return self.getCorners() # <<<<<<<<<<<<<< * * property ghost_corners: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getCorners); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 1154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 1154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMDA.pyx":1153 * property corners: * """The lower left corner and size of local region in each dimension.""" * def __get__(self) -> tuple[tuple[int, ...], tuple[int, ...]]: # <<<<<<<<<<<<<< * return self.getCorners() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.corners.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMDA.pyx":1158 * property ghost_corners: * """The lower left corner and size of local region in each dimension.""" * def __get__(self) -> tuple[tuple[int, ...], tuple[int, ...]]: # <<<<<<<<<<<<<< * return self.getGhostCorners() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_13ghost_corners_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_13ghost_corners_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_13ghost_corners___get__(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_13ghost_corners___get__(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/DMDA.pyx":1159 * """The lower left corner and size of local region in each dimension.""" * def __get__(self) -> tuple[tuple[int, ...], tuple[int, ...]]: * return self.getGhostCorners() # <<<<<<<<<<<<<< * * # backward compatibility */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getGhostCorners); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMDA.pyx":1158 * property ghost_corners: * """The lower left corner and size of local region in each dimension.""" * def __get__(self) -> tuple[tuple[int, ...], tuple[int, ...]]: # <<<<<<<<<<<<<< * return self.getGhostCorners() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.ghost_corners.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":22 * # * * def create(self, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Create a `DMPlex` object, which encapsulates an unstructured mesh. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_1create(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_create, "DMPlex.create(self, comm: Comm | None = None) -> Self\nCreate a `DMPlex` object, which encapsulates an unstructured mesh.\n\n Collective.\n\n Parameters\n ----------\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n DM, DMPlex, DM.create, DM.setType, petsc.DMPlexCreate\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:22"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_1create(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 22, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "create") < 0)) __PYX_ERR(57, 22, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_comm = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, __pyx_nargs); __PYX_ERR(57, 22, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_create(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_comm); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_create(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; DM __pyx_v_newdm; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create", 1); /* "petsc4py/PETSc/DMPlex.pyx":37 * * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscDM newdm = NULL * CHKERR( DMPlexCreate(ccomm, &newdm) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(57, 37, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":38 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscDM newdm = NULL # <<<<<<<<<<<<<< * CHKERR( DMPlexCreate(ccomm, &newdm) ) * CHKERR( PetscCLEAR(self.obj) ); self.dm = newdm */ __pyx_v_newdm = NULL; /* "petsc4py/PETSc/DMPlex.pyx":39 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscDM newdm = NULL * CHKERR( DMPlexCreate(ccomm, &newdm) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.dm = newdm * return self */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexCreate(__pyx_v_ccomm, (&__pyx_v_newdm))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 39, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":40 * cdef PetscDM newdm = NULL * CHKERR( DMPlexCreate(ccomm, &newdm) ) * CHKERR( PetscCLEAR(self.obj) ); self.dm = newdm # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 40, __pyx_L1_error) __pyx_v_self->__pyx_base.dm = __pyx_v_newdm; /* "petsc4py/PETSc/DMPlex.pyx":41 * CHKERR( DMPlexCreate(ccomm, &newdm) ) * CHKERR( PetscCLEAR(self.obj) ); self.dm = newdm * return self # <<<<<<<<<<<<<< * * def createFromCellList(self, dim: int, cells: Sequence[int], coords: Sequence[float], interpolate: bool | None = True, comm: Comm | None = None) -> Self: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":22 * # * * def create(self, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Create a `DMPlex` object, which encapsulates an unstructured mesh. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":43 * return self * * def createFromCellList(self, dim: int, cells: Sequence[int], coords: Sequence[float], interpolate: bool | None = True, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Create a `DMPlex` from a list of vertices for each cell on process 0. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_3createFromCellList(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_2createFromCellList, "DMPlex.createFromCellList(self, dim: int, cells: Sequence[int], coords: Sequence[float], interpolate: bool | None = True, comm: Comm | None = None) -> Self\nCreate a `DMPlex` from a list of vertices for each cell on process 0.\n\n Collective.\n\n Parameters\n ----------\n dim\n The topological dimension of the mesh.\n cells\n An array of number of cells times number of vertices on each cell.\n coords\n An array of number of vertices times spatial dimension for coordinates.\n interpolate\n Flag to interpolate the mesh.\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n DM, DMPlex, DMPlex.create, DMPlex.interpolate,\n petsc.DMPlexCreateFromCellListPetsc\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:43"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_3createFromCellList(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_dim = 0; PyObject *__pyx_v_cells = 0; PyObject *__pyx_v_coords = 0; PyObject *__pyx_v_interpolate = 0; PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createFromCellList (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dim,&__pyx_n_s_cells,&__pyx_n_s_coords,&__pyx_n_s_interpolate,&__pyx_n_s_comm,0}; values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_True)); values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dim)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 43, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_cells)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 43, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("createFromCellList", 0, 3, 5, 1); __PYX_ERR(57, 43, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_coords)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 43, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("createFromCellList", 0, 3, 5, 2); __PYX_ERR(57, 43, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_interpolate); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 43, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 43, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createFromCellList") < 0)) __PYX_ERR(57, 43, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_dim = values[0]; __pyx_v_cells = values[1]; __pyx_v_coords = values[2]; __pyx_v_interpolate = values[3]; __pyx_v_comm = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createFromCellList", 0, 3, 5, __pyx_nargs); __PYX_ERR(57, 43, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.createFromCellList", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_2createFromCellList(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_dim, __pyx_v_cells, __pyx_v_coords, __pyx_v_interpolate, __pyx_v_comm); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_2createFromCellList(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_dim, PyObject *__pyx_v_cells, PyObject *__pyx_v_coords, PyObject *__pyx_v_interpolate, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PetscBool __pyx_v_interp; DM __pyx_v_newdm; PetscInt __pyx_v_cdim; PetscInt __pyx_v_numCells; PetscInt __pyx_v_numCorners; PetscInt *__pyx_v_cellVertices; PetscInt __pyx_v_numVertices; PetscInt __pyx_v_spaceDim; PetscReal *__pyx_v_vertexCoords; int __pyx_v_npy_flags; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PetscBool __pyx_t_2; PetscInt __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PetscErrorCode __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createFromCellList", 0); __Pyx_INCREF(__pyx_v_cells); __Pyx_INCREF(__pyx_v_coords); /* "petsc4py/PETSc/DMPlex.pyx":67 * * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscBool interp = interpolate * cdef PetscDM newdm = NULL */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(57, 67, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":68 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscBool interp = interpolate # <<<<<<<<<<<<<< * cdef PetscDM newdm = NULL * cdef PetscInt cdim = asInt(dim) */ __pyx_t_2 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_interpolate)); if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 68, __pyx_L1_error) __pyx_v_interp = __pyx_t_2; /* "petsc4py/PETSc/DMPlex.pyx":69 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscBool interp = interpolate * cdef PetscDM newdm = NULL # <<<<<<<<<<<<<< * cdef PetscInt cdim = asInt(dim) * cdef PetscInt numCells = 0 */ __pyx_v_newdm = NULL; /* "petsc4py/PETSc/DMPlex.pyx":70 * cdef PetscBool interp = interpolate * cdef PetscDM newdm = NULL * cdef PetscInt cdim = asInt(dim) # <<<<<<<<<<<<<< * cdef PetscInt numCells = 0 * cdef PetscInt numCorners = 0 */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_dim); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(57, 70, __pyx_L1_error) __pyx_v_cdim = __pyx_t_3; /* "petsc4py/PETSc/DMPlex.pyx":71 * cdef PetscDM newdm = NULL * cdef PetscInt cdim = asInt(dim) * cdef PetscInt numCells = 0 # <<<<<<<<<<<<<< * cdef PetscInt numCorners = 0 * cdef PetscInt *cellVertices = NULL */ __pyx_v_numCells = 0; /* "petsc4py/PETSc/DMPlex.pyx":72 * cdef PetscInt cdim = asInt(dim) * cdef PetscInt numCells = 0 * cdef PetscInt numCorners = 0 # <<<<<<<<<<<<<< * cdef PetscInt *cellVertices = NULL * cdef PetscInt numVertices = 0 */ __pyx_v_numCorners = 0; /* "petsc4py/PETSc/DMPlex.pyx":73 * cdef PetscInt numCells = 0 * cdef PetscInt numCorners = 0 * cdef PetscInt *cellVertices = NULL # <<<<<<<<<<<<<< * cdef PetscInt numVertices = 0 * cdef PetscInt spaceDim= 0 */ __pyx_v_cellVertices = NULL; /* "petsc4py/PETSc/DMPlex.pyx":74 * cdef PetscInt numCorners = 0 * cdef PetscInt *cellVertices = NULL * cdef PetscInt numVertices = 0 # <<<<<<<<<<<<<< * cdef PetscInt spaceDim= 0 * cdef PetscReal *vertexCoords = NULL */ __pyx_v_numVertices = 0; /* "petsc4py/PETSc/DMPlex.pyx":75 * cdef PetscInt *cellVertices = NULL * cdef PetscInt numVertices = 0 * cdef PetscInt spaceDim= 0 # <<<<<<<<<<<<<< * cdef PetscReal *vertexCoords = NULL * cdef int npy_flags = NPY_ARRAY_ALIGNED|NPY_ARRAY_NOTSWAPPED|NPY_ARRAY_CARRAY */ __pyx_v_spaceDim = 0; /* "petsc4py/PETSc/DMPlex.pyx":76 * cdef PetscInt numVertices = 0 * cdef PetscInt spaceDim= 0 * cdef PetscReal *vertexCoords = NULL # <<<<<<<<<<<<<< * cdef int npy_flags = NPY_ARRAY_ALIGNED|NPY_ARRAY_NOTSWAPPED|NPY_ARRAY_CARRAY * cells = PyArray_FROM_OTF(cells, NPY_PETSC_INT, npy_flags) */ __pyx_v_vertexCoords = NULL; /* "petsc4py/PETSc/DMPlex.pyx":77 * cdef PetscInt spaceDim= 0 * cdef PetscReal *vertexCoords = NULL * cdef int npy_flags = NPY_ARRAY_ALIGNED|NPY_ARRAY_NOTSWAPPED|NPY_ARRAY_CARRAY # <<<<<<<<<<<<<< * cells = PyArray_FROM_OTF(cells, NPY_PETSC_INT, npy_flags) * coords = PyArray_FROM_OTF(coords, NPY_PETSC_REAL, npy_flags) */ __pyx_v_npy_flags = ((NPY_ARRAY_ALIGNED | NPY_ARRAY_NOTSWAPPED) | NPY_ARRAY_CARRAY); /* "petsc4py/PETSc/DMPlex.pyx":78 * cdef PetscReal *vertexCoords = NULL * cdef int npy_flags = NPY_ARRAY_ALIGNED|NPY_ARRAY_NOTSWAPPED|NPY_ARRAY_CARRAY * cells = PyArray_FROM_OTF(cells, NPY_PETSC_INT, npy_flags) # <<<<<<<<<<<<<< * coords = PyArray_FROM_OTF(coords, NPY_PETSC_REAL, npy_flags) * if PyArray_NDIM(cells) != 2: raise ValueError( */ __pyx_t_4 = ((PyObject *)PyArray_FROM_OTF(__pyx_v_cells, NPY_PETSC_INT, __pyx_v_npy_flags)); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_cells, __pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/DMPlex.pyx":79 * cdef int npy_flags = NPY_ARRAY_ALIGNED|NPY_ARRAY_NOTSWAPPED|NPY_ARRAY_CARRAY * cells = PyArray_FROM_OTF(cells, NPY_PETSC_INT, npy_flags) * coords = PyArray_FROM_OTF(coords, NPY_PETSC_REAL, npy_flags) # <<<<<<<<<<<<<< * if PyArray_NDIM(cells) != 2: raise ValueError( * ("cell indices must have two dimensions: " */ __pyx_t_4 = ((PyObject *)PyArray_FROM_OTF(__pyx_v_coords, NPY_PETSC_REAL, __pyx_v_npy_flags)); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_coords, __pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/DMPlex.pyx":80 * cells = PyArray_FROM_OTF(cells, NPY_PETSC_INT, npy_flags) * coords = PyArray_FROM_OTF(coords, NPY_PETSC_REAL, npy_flags) * if PyArray_NDIM(cells) != 2: raise ValueError( # <<<<<<<<<<<<<< * ("cell indices must have two dimensions: " * "cells.ndim=%d") % (PyArray_NDIM(cells)) ) */ if (!(likely(((__pyx_v_cells) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_cells, __pyx_ptype_8petsc4py_5PETSc_ndarray))))) __PYX_ERR(57, 80, __pyx_L1_error) __pyx_t_5 = (PyArray_NDIM(((PyArrayObject *)__pyx_v_cells)) != 2); if (unlikely(__pyx_t_5)) { /* "petsc4py/PETSc/DMPlex.pyx":82 * if PyArray_NDIM(cells) != 2: raise ValueError( * ("cell indices must have two dimensions: " * "cells.ndim=%d") % (PyArray_NDIM(cells)) ) # <<<<<<<<<<<<<< * if PyArray_NDIM(coords) != 2: raise ValueError( * ("coords vertices must have two dimensions: " */ if (!(likely(((__pyx_v_cells) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_cells, __pyx_ptype_8petsc4py_5PETSc_ndarray))))) __PYX_ERR(57, 82, __pyx_L1_error) __pyx_t_4 = __Pyx_PyInt_From_int(PyArray_NDIM(((PyArrayObject *)__pyx_v_cells))); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_cell_indices_must_have_two_dimen, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(57, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/DMPlex.pyx":80 * cells = PyArray_FROM_OTF(cells, NPY_PETSC_INT, npy_flags) * coords = PyArray_FROM_OTF(coords, NPY_PETSC_REAL, npy_flags) * if PyArray_NDIM(cells) != 2: raise ValueError( # <<<<<<<<<<<<<< * ("cell indices must have two dimensions: " * "cells.ndim=%d") % (PyArray_NDIM(cells)) ) */ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(57, 80, __pyx_L1_error) } /* "petsc4py/PETSc/DMPlex.pyx":83 * ("cell indices must have two dimensions: " * "cells.ndim=%d") % (PyArray_NDIM(cells)) ) * if PyArray_NDIM(coords) != 2: raise ValueError( # <<<<<<<<<<<<<< * ("coords vertices must have two dimensions: " * "coords.ndim=%d") % (PyArray_NDIM(coords)) ) */ if (!(likely(((__pyx_v_coords) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_coords, __pyx_ptype_8petsc4py_5PETSc_ndarray))))) __PYX_ERR(57, 83, __pyx_L1_error) __pyx_t_5 = (PyArray_NDIM(((PyArrayObject *)__pyx_v_coords)) != 2); if (unlikely(__pyx_t_5)) { /* "petsc4py/PETSc/DMPlex.pyx":85 * if PyArray_NDIM(coords) != 2: raise ValueError( * ("coords vertices must have two dimensions: " * "coords.ndim=%d") % (PyArray_NDIM(coords)) ) # <<<<<<<<<<<<<< * numCells = PyArray_DIM(cells, 0) * numCorners = PyArray_DIM(cells, 1) */ if (!(likely(((__pyx_v_coords) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_coords, __pyx_ptype_8petsc4py_5PETSc_ndarray))))) __PYX_ERR(57, 85, __pyx_L1_error) __pyx_t_4 = __Pyx_PyInt_From_int(PyArray_NDIM(((PyArrayObject *)__pyx_v_coords))); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_coords_vertices_must_have_two_di, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(57, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/DMPlex.pyx":83 * ("cell indices must have two dimensions: " * "cells.ndim=%d") % (PyArray_NDIM(cells)) ) * if PyArray_NDIM(coords) != 2: raise ValueError( # <<<<<<<<<<<<<< * ("coords vertices must have two dimensions: " * "coords.ndim=%d") % (PyArray_NDIM(coords)) ) */ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(57, 83, __pyx_L1_error) } /* "petsc4py/PETSc/DMPlex.pyx":86 * ("coords vertices must have two dimensions: " * "coords.ndim=%d") % (PyArray_NDIM(coords)) ) * numCells = PyArray_DIM(cells, 0) # <<<<<<<<<<<<<< * numCorners = PyArray_DIM(cells, 1) * numVertices = PyArray_DIM(coords, 0) */ if (!(likely(((__pyx_v_cells) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_cells, __pyx_ptype_8petsc4py_5PETSc_ndarray))))) __PYX_ERR(57, 86, __pyx_L1_error) __pyx_v_numCells = ((PetscInt)PyArray_DIM(((PyArrayObject *)__pyx_v_cells), 0)); /* "petsc4py/PETSc/DMPlex.pyx":87 * "coords.ndim=%d") % (PyArray_NDIM(coords)) ) * numCells = PyArray_DIM(cells, 0) * numCorners = PyArray_DIM(cells, 1) # <<<<<<<<<<<<<< * numVertices = PyArray_DIM(coords, 0) * spaceDim = PyArray_DIM(coords, 1) */ if (!(likely(((__pyx_v_cells) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_cells, __pyx_ptype_8petsc4py_5PETSc_ndarray))))) __PYX_ERR(57, 87, __pyx_L1_error) __pyx_v_numCorners = ((PetscInt)PyArray_DIM(((PyArrayObject *)__pyx_v_cells), 1)); /* "petsc4py/PETSc/DMPlex.pyx":88 * numCells = PyArray_DIM(cells, 0) * numCorners = PyArray_DIM(cells, 1) * numVertices = PyArray_DIM(coords, 0) # <<<<<<<<<<<<<< * spaceDim = PyArray_DIM(coords, 1) * cellVertices = PyArray_DATA(cells) */ if (!(likely(((__pyx_v_coords) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_coords, __pyx_ptype_8petsc4py_5PETSc_ndarray))))) __PYX_ERR(57, 88, __pyx_L1_error) __pyx_v_numVertices = ((PetscInt)PyArray_DIM(((PyArrayObject *)__pyx_v_coords), 0)); /* "petsc4py/PETSc/DMPlex.pyx":89 * numCorners = PyArray_DIM(cells, 1) * numVertices = PyArray_DIM(coords, 0) * spaceDim = PyArray_DIM(coords, 1) # <<<<<<<<<<<<<< * cellVertices = PyArray_DATA(cells) * vertexCoords = PyArray_DATA(coords) */ if (!(likely(((__pyx_v_coords) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_coords, __pyx_ptype_8petsc4py_5PETSc_ndarray))))) __PYX_ERR(57, 89, __pyx_L1_error) __pyx_v_spaceDim = ((PetscInt)PyArray_DIM(((PyArrayObject *)__pyx_v_coords), 1)); /* "petsc4py/PETSc/DMPlex.pyx":90 * numVertices = PyArray_DIM(coords, 0) * spaceDim = PyArray_DIM(coords, 1) * cellVertices = PyArray_DATA(cells) # <<<<<<<<<<<<<< * vertexCoords = PyArray_DATA(coords) * CHKERR( DMPlexCreateFromCellListPetsc(ccomm, cdim, numCells, numVertices, */ if (!(likely(((__pyx_v_cells) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_cells, __pyx_ptype_8petsc4py_5PETSc_ndarray))))) __PYX_ERR(57, 90, __pyx_L1_error) __pyx_v_cellVertices = ((PetscInt *)PyArray_DATA(((PyArrayObject *)__pyx_v_cells))); /* "petsc4py/PETSc/DMPlex.pyx":91 * spaceDim = PyArray_DIM(coords, 1) * cellVertices = PyArray_DATA(cells) * vertexCoords = PyArray_DATA(coords) # <<<<<<<<<<<<<< * CHKERR( DMPlexCreateFromCellListPetsc(ccomm, cdim, numCells, numVertices, * numCorners, interp, cellVertices, */ if (!(likely(((__pyx_v_coords) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_coords, __pyx_ptype_8petsc4py_5PETSc_ndarray))))) __PYX_ERR(57, 91, __pyx_L1_error) __pyx_v_vertexCoords = ((PetscReal *)PyArray_DATA(((PyArrayObject *)__pyx_v_coords))); /* "petsc4py/PETSc/DMPlex.pyx":92 * cellVertices = PyArray_DATA(cells) * vertexCoords = PyArray_DATA(coords) * CHKERR( DMPlexCreateFromCellListPetsc(ccomm, cdim, numCells, numVertices, # <<<<<<<<<<<<<< * numCorners, interp, cellVertices, * spaceDim, vertexCoords, &newdm) ) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexCreateFromCellListPetsc(__pyx_v_ccomm, __pyx_v_cdim, __pyx_v_numCells, __pyx_v_numVertices, __pyx_v_numCorners, __pyx_v_interp, __pyx_v_cellVertices, __pyx_v_spaceDim, __pyx_v_vertexCoords, (&__pyx_v_newdm))); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 92, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":95 * numCorners, interp, cellVertices, * spaceDim, vertexCoords, &newdm) ) * CHKERR( PetscCLEAR(self.obj) ); self.dm = newdm # <<<<<<<<<<<<<< * return self * */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.__pyx_base.obj)); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 95, __pyx_L1_error) __pyx_v_self->__pyx_base.dm = __pyx_v_newdm; /* "petsc4py/PETSc/DMPlex.pyx":96 * spaceDim, vertexCoords, &newdm) ) * CHKERR( PetscCLEAR(self.obj) ); self.dm = newdm * return self # <<<<<<<<<<<<<< * * def createBoxMesh(self, faces: Sequence[int], lower: Sequence[float] | None = (0,0,0), upper: Sequence[float] | None = (1,1,1), */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":43 * return self * * def createFromCellList(self, dim: int, cells: Sequence[int], coords: Sequence[float], interpolate: bool | None = True, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Create a `DMPlex` from a list of vertices for each cell on process 0. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.createFromCellList", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_cells); __Pyx_XDECREF(__pyx_v_coords); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":98 * return self * * def createBoxMesh(self, faces: Sequence[int], lower: Sequence[float] | None = (0,0,0), upper: Sequence[float] | None = (1,1,1), # <<<<<<<<<<<<<< * simplex: bool | None = True, periodic: Sequence | str | int | bool | None = False, interpolate: bool | None = True, comm: Comm | None = None) -> Self: * """Create a mesh on the tensor product of intervals. */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_5createBoxMesh(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_4createBoxMesh, "DMPlex.createBoxMesh(self, faces: Sequence[int], lower: Sequence[float] | None = (0, 0, 0), upper: Sequence[float] | None = (1, 1, 1), simplex: bool | None = True, periodic: Sequence | str | int | bool | None = False, interpolate: bool | None = True, comm: Comm | None = None) -> Self\nCreate a mesh on the tensor product of intervals.\n\n Collective.\n\n Parameters\n ----------\n faces\n Number of faces per dimension, or `None` for the default.\n lower\n The lower left corner.\n upper\n The upper right corner.\n simplex\n `True` for simplices, `False` for tensor cells.\n periodic\n The boundary type for the X,Y,Z direction,\n or `None` for `DM.BoundaryType.NONE`.\n interpolate\n Flag to create intermediate mesh entities (edges, faces).\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n DM, DMPlex, DM.setFromOptions, DMPlex.createFromFile, DM.setType\n DM.create, petsc.DMPlexCreateBoxMesh\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:98"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_5createBoxMesh(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_faces = 0; PyObject *__pyx_v_lower = 0; PyObject *__pyx_v_upper = 0; PyObject *__pyx_v_simplex = 0; PyObject *__pyx_v_periodic = 0; PyObject *__pyx_v_interpolate = 0; PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[7] = {0,0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createBoxMesh (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_faces,&__pyx_n_s_lower,&__pyx_n_s_upper,&__pyx_n_s_simplex,&__pyx_n_s_periodic,&__pyx_n_s_interpolate,&__pyx_n_s_comm,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_tuple__56)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_tuple__57)); /* "petsc4py/PETSc/DMPlex.pyx":99 * * def createBoxMesh(self, faces: Sequence[int], lower: Sequence[float] | None = (0,0,0), upper: Sequence[float] | None = (1,1,1), * simplex: bool | None = True, periodic: Sequence | str | int | bool | None = False, interpolate: bool | None = True, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Create a mesh on the tensor product of intervals. * */ values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_True)); values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False)); values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_True)); values[6] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_faces)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 98, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_lower); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 98, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_upper); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 98, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_simplex); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 98, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_periodic); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 98, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_interpolate); if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 98, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 6: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[6] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 98, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createBoxMesh") < 0)) __PYX_ERR(57, 98, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_faces = values[0]; __pyx_v_lower = values[1]; __pyx_v_upper = values[2]; __pyx_v_simplex = values[3]; __pyx_v_periodic = values[4]; __pyx_v_interpolate = values[5]; __pyx_v_comm = values[6]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createBoxMesh", 0, 1, 7, __pyx_nargs); __PYX_ERR(57, 98, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.createBoxMesh", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_4createBoxMesh(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_faces, __pyx_v_lower, __pyx_v_upper, __pyx_v_simplex, __pyx_v_periodic, __pyx_v_interpolate, __pyx_v_comm); /* "petsc4py/PETSc/DMPlex.pyx":98 * return self * * def createBoxMesh(self, faces: Sequence[int], lower: Sequence[float] | None = (0,0,0), upper: Sequence[float] | None = (1,1,1), # <<<<<<<<<<<<<< * simplex: bool | None = True, periodic: Sequence | str | int | bool | None = False, interpolate: bool | None = True, comm: Comm | None = None) -> Self: * """Create a mesh on the tensor product of intervals. */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_4createBoxMesh(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_faces, PyObject *__pyx_v_lower, PyObject *__pyx_v_upper, PyObject *__pyx_v_simplex, PyObject *__pyx_v_periodic, PyObject *__pyx_v_interpolate, PyObject *__pyx_v_comm) { Py_ssize_t __pyx_v_i; PetscInt __pyx_v_dim; PetscInt *__pyx_v_cfaces; PetscReal __pyx_v_clower[3]; PetscReal __pyx_v_cupper[3]; DMBoundaryType __pyx_v_btype[3]; PetscBool __pyx_v_csimplex; PetscBool __pyx_v_cinterp; MPI_Comm __pyx_v_ccomm; DM __pyx_v_newdm; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PetscInt __pyx_t_4; PetscReal __pyx_t_5; PetscBool __pyx_t_6; MPI_Comm __pyx_t_7; PetscErrorCode __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createBoxMesh", 0); __Pyx_INCREF(__pyx_v_faces); /* "petsc4py/PETSc/DMPlex.pyx":128 * * """ * cdef Py_ssize_t i = 0 # <<<<<<<<<<<<<< * cdef PetscInt dim = 0, *cfaces = NULL * faces = iarray_i(faces, &dim, &cfaces) */ __pyx_v_i = 0; /* "petsc4py/PETSc/DMPlex.pyx":129 * """ * cdef Py_ssize_t i = 0 * cdef PetscInt dim = 0, *cfaces = NULL # <<<<<<<<<<<<<< * faces = iarray_i(faces, &dim, &cfaces) * assert dim >= 1 and dim <= 3 */ __pyx_v_dim = 0; __pyx_v_cfaces = NULL; /* "petsc4py/PETSc/DMPlex.pyx":130 * cdef Py_ssize_t i = 0 * cdef PetscInt dim = 0, *cfaces = NULL * faces = iarray_i(faces, &dim, &cfaces) # <<<<<<<<<<<<<< * assert dim >= 1 and dim <= 3 * cdef PetscReal clower[3] */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_faces, (&__pyx_v_dim), (&__pyx_v_cfaces))); if (unlikely(!__pyx_t_1)) __PYX_ERR(57, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_faces, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DMPlex.pyx":131 * cdef PetscInt dim = 0, *cfaces = NULL * faces = iarray_i(faces, &dim, &cfaces) * assert dim >= 1 and dim <= 3 # <<<<<<<<<<<<<< * cdef PetscReal clower[3] * clower[0] = clower[1] = clower[2] = 0 */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_3 = (__pyx_v_dim >= 1); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L3_bool_binop_done; } __pyx_t_3 = (__pyx_v_dim <= 3); __pyx_t_2 = __pyx_t_3; __pyx_L3_bool_binop_done:; if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(57, 131, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(57, 131, __pyx_L1_error) #endif /* "petsc4py/PETSc/DMPlex.pyx":133 * assert dim >= 1 and dim <= 3 * cdef PetscReal clower[3] * clower[0] = clower[1] = clower[2] = 0 # <<<<<<<<<<<<<< * for i from 0 <= i < dim: clower[i] = lower[i] * cdef PetscReal cupper[3] */ (__pyx_v_clower[0]) = 0.0; (__pyx_v_clower[1]) = 0.0; (__pyx_v_clower[2]) = 0.0; /* "petsc4py/PETSc/DMPlex.pyx":134 * cdef PetscReal clower[3] * clower[0] = clower[1] = clower[2] = 0 * for i from 0 <= i < dim: clower[i] = lower[i] # <<<<<<<<<<<<<< * cdef PetscReal cupper[3] * cupper[0] = cupper[1] = cupper[2] = 1 */ __pyx_t_4 = __pyx_v_dim; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_lower, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(57, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_5 == ((PetscReal)-1)) && PyErr_Occurred())) __PYX_ERR(57, 134, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; (__pyx_v_clower[__pyx_v_i]) = __pyx_t_5; } /* "petsc4py/PETSc/DMPlex.pyx":136 * for i from 0 <= i < dim: clower[i] = lower[i] * cdef PetscReal cupper[3] * cupper[0] = cupper[1] = cupper[2] = 1 # <<<<<<<<<<<<<< * for i from 0 <= i < dim: cupper[i] = upper[i] * cdef PetscDMBoundaryType btype[3]; */ (__pyx_v_cupper[0]) = 1.0; (__pyx_v_cupper[1]) = 1.0; (__pyx_v_cupper[2]) = 1.0; /* "petsc4py/PETSc/DMPlex.pyx":137 * cdef PetscReal cupper[3] * cupper[0] = cupper[1] = cupper[2] = 1 * for i from 0 <= i < dim: cupper[i] = upper[i] # <<<<<<<<<<<<<< * cdef PetscDMBoundaryType btype[3]; * asBoundary(periodic, &btype[0], &btype[1], &btype[2]) */ __pyx_t_4 = __pyx_v_dim; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_upper, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(57, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_5 == ((PetscReal)-1)) && PyErr_Occurred())) __PYX_ERR(57, 137, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; (__pyx_v_cupper[__pyx_v_i]) = __pyx_t_5; } /* "petsc4py/PETSc/DMPlex.pyx":139 * for i from 0 <= i < dim: cupper[i] = upper[i] * cdef PetscDMBoundaryType btype[3]; * asBoundary(periodic, &btype[0], &btype[1], &btype[2]) # <<<<<<<<<<<<<< * cdef PetscBool csimplex = simplex * cdef PetscBool cinterp = interpolate */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asBoundary(__pyx_v_periodic, (&(__pyx_v_btype[0])), (&(__pyx_v_btype[1])), (&(__pyx_v_btype[2]))); if (unlikely(__pyx_t_4 == ((PetscInt)-1L))) __PYX_ERR(57, 139, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":140 * cdef PetscDMBoundaryType btype[3]; * asBoundary(periodic, &btype[0], &btype[1], &btype[2]) * cdef PetscBool csimplex = simplex # <<<<<<<<<<<<<< * cdef PetscBool cinterp = interpolate * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) */ __pyx_t_6 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_simplex)); if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 140, __pyx_L1_error) __pyx_v_csimplex = __pyx_t_6; /* "petsc4py/PETSc/DMPlex.pyx":141 * asBoundary(periodic, &btype[0], &btype[1], &btype[2]) * cdef PetscBool csimplex = simplex * cdef PetscBool cinterp = interpolate # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscDM newdm = NULL */ __pyx_t_6 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_interpolate)); if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 141, __pyx_L1_error) __pyx_v_cinterp = __pyx_t_6; /* "petsc4py/PETSc/DMPlex.pyx":142 * cdef PetscBool csimplex = simplex * cdef PetscBool cinterp = interpolate * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscDM newdm = NULL * CHKERR( DMPlexCreateBoxMesh(ccomm, dim, csimplex, cfaces, */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_7 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(57, 142, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_7; /* "petsc4py/PETSc/DMPlex.pyx":143 * cdef PetscBool cinterp = interpolate * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscDM newdm = NULL # <<<<<<<<<<<<<< * CHKERR( DMPlexCreateBoxMesh(ccomm, dim, csimplex, cfaces, * clower, cupper, btype, cinterp, &newdm) ) */ __pyx_v_newdm = NULL; /* "petsc4py/PETSc/DMPlex.pyx":144 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscDM newdm = NULL * CHKERR( DMPlexCreateBoxMesh(ccomm, dim, csimplex, cfaces, # <<<<<<<<<<<<<< * clower, cupper, btype, cinterp, &newdm) ) * CHKERR( PetscCLEAR(self.obj) ); self.dm = newdm */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexCreateBoxMesh(__pyx_v_ccomm, __pyx_v_dim, __pyx_v_csimplex, __pyx_v_cfaces, __pyx_v_clower, __pyx_v_cupper, __pyx_v_btype, __pyx_v_cinterp, (&__pyx_v_newdm))); if (unlikely(__pyx_t_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 144, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":146 * CHKERR( DMPlexCreateBoxMesh(ccomm, dim, csimplex, cfaces, * clower, cupper, btype, cinterp, &newdm) ) * CHKERR( PetscCLEAR(self.obj) ); self.dm = newdm # <<<<<<<<<<<<<< * return self * */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.__pyx_base.obj)); if (unlikely(__pyx_t_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 146, __pyx_L1_error) __pyx_v_self->__pyx_base.dm = __pyx_v_newdm; /* "petsc4py/PETSc/DMPlex.pyx":147 * clower, cupper, btype, cinterp, &newdm) ) * CHKERR( PetscCLEAR(self.obj) ); self.dm = newdm * return self # <<<<<<<<<<<<<< * * def createBoxSurfaceMesh(self, faces: Sequence[int], lower: Sequence[float] | None = (0,0,0), upper: Sequence[float] | None = (1,1,1), */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":98 * return self * * def createBoxMesh(self, faces: Sequence[int], lower: Sequence[float] | None = (0,0,0), upper: Sequence[float] | None = (1,1,1), # <<<<<<<<<<<<<< * simplex: bool | None = True, periodic: Sequence | str | int | bool | None = False, interpolate: bool | None = True, comm: Comm | None = None) -> Self: * """Create a mesh on the tensor product of intervals. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.createBoxMesh", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_faces); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":149 * return self * * def createBoxSurfaceMesh(self, faces: Sequence[int], lower: Sequence[float] | None = (0,0,0), upper: Sequence[float] | None = (1,1,1), # <<<<<<<<<<<<<< * interpolate: bool | None = True, comm: Comm | None = None) -> Self: * """Create a mesh on the surface of a box mesh using tensor cells. */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_7createBoxSurfaceMesh(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_6createBoxSurfaceMesh, "DMPlex.createBoxSurfaceMesh(self, faces: Sequence[int], lower: Sequence[float] | None = (0, 0, 0), upper: Sequence[float] | None = (1, 1, 1), interpolate: bool | None = True, comm: Comm | None = None) -> Self\nCreate a mesh on the surface of a box mesh using tensor cells.\n\n Collective.\n\n Parameters\n ----------\n faces\n Number of faces per dimension, or `None` for the default.\n lower\n The lower left corner.\n upper\n The upper right corner.\n interpolate\n Flag to create intermediate mesh pieces (edges, faces).\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n DM, DMPlex, DM.setFromOptions, DMPlex.createBoxMesh\n DMPlex.createFromFile, DM.setType, DM.create\n petsc.DMPlexCreateBoxSurfaceMesh\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:149"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_7createBoxSurfaceMesh(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_faces = 0; PyObject *__pyx_v_lower = 0; PyObject *__pyx_v_upper = 0; PyObject *__pyx_v_interpolate = 0; PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createBoxSurfaceMesh (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_faces,&__pyx_n_s_lower,&__pyx_n_s_upper,&__pyx_n_s_interpolate,&__pyx_n_s_comm,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_tuple__56)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_tuple__57)); /* "petsc4py/PETSc/DMPlex.pyx":150 * * def createBoxSurfaceMesh(self, faces: Sequence[int], lower: Sequence[float] | None = (0,0,0), upper: Sequence[float] | None = (1,1,1), * interpolate: bool | None = True, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Create a mesh on the surface of a box mesh using tensor cells. * */ values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_True)); values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_faces)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 149, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_lower); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 149, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_upper); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 149, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_interpolate); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 149, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 149, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createBoxSurfaceMesh") < 0)) __PYX_ERR(57, 149, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_faces = values[0]; __pyx_v_lower = values[1]; __pyx_v_upper = values[2]; __pyx_v_interpolate = values[3]; __pyx_v_comm = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createBoxSurfaceMesh", 0, 1, 5, __pyx_nargs); __PYX_ERR(57, 149, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.createBoxSurfaceMesh", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_6createBoxSurfaceMesh(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_faces, __pyx_v_lower, __pyx_v_upper, __pyx_v_interpolate, __pyx_v_comm); /* "petsc4py/PETSc/DMPlex.pyx":149 * return self * * def createBoxSurfaceMesh(self, faces: Sequence[int], lower: Sequence[float] | None = (0,0,0), upper: Sequence[float] | None = (1,1,1), # <<<<<<<<<<<<<< * interpolate: bool | None = True, comm: Comm | None = None) -> Self: * """Create a mesh on the surface of a box mesh using tensor cells. */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_6createBoxSurfaceMesh(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_faces, PyObject *__pyx_v_lower, PyObject *__pyx_v_upper, PyObject *__pyx_v_interpolate, PyObject *__pyx_v_comm) { Py_ssize_t __pyx_v_i; PetscInt __pyx_v_dim; PetscInt *__pyx_v_cfaces; PetscReal __pyx_v_clower[3]; PetscReal __pyx_v_cupper[3]; PetscBool __pyx_v_cinterp; MPI_Comm __pyx_v_ccomm; DM __pyx_v_newdm; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PetscInt __pyx_t_4; PetscReal __pyx_t_5; PetscBool __pyx_t_6; MPI_Comm __pyx_t_7; PetscErrorCode __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createBoxSurfaceMesh", 0); __Pyx_INCREF(__pyx_v_faces); /* "petsc4py/PETSc/DMPlex.pyx":175 * * """ * cdef Py_ssize_t i = 0 # <<<<<<<<<<<<<< * cdef PetscInt dim = 0, *cfaces = NULL * faces = iarray_i(faces, &dim, &cfaces) */ __pyx_v_i = 0; /* "petsc4py/PETSc/DMPlex.pyx":176 * """ * cdef Py_ssize_t i = 0 * cdef PetscInt dim = 0, *cfaces = NULL # <<<<<<<<<<<<<< * faces = iarray_i(faces, &dim, &cfaces) * assert dim >= 1 and dim <= 3 */ __pyx_v_dim = 0; __pyx_v_cfaces = NULL; /* "petsc4py/PETSc/DMPlex.pyx":177 * cdef Py_ssize_t i = 0 * cdef PetscInt dim = 0, *cfaces = NULL * faces = iarray_i(faces, &dim, &cfaces) # <<<<<<<<<<<<<< * assert dim >= 1 and dim <= 3 * cdef PetscReal clower[3] */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_faces, (&__pyx_v_dim), (&__pyx_v_cfaces))); if (unlikely(!__pyx_t_1)) __PYX_ERR(57, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_faces, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DMPlex.pyx":178 * cdef PetscInt dim = 0, *cfaces = NULL * faces = iarray_i(faces, &dim, &cfaces) * assert dim >= 1 and dim <= 3 # <<<<<<<<<<<<<< * cdef PetscReal clower[3] * clower[0] = clower[1] = clower[2] = 0 */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_3 = (__pyx_v_dim >= 1); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L3_bool_binop_done; } __pyx_t_3 = (__pyx_v_dim <= 3); __pyx_t_2 = __pyx_t_3; __pyx_L3_bool_binop_done:; if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(57, 178, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(57, 178, __pyx_L1_error) #endif /* "petsc4py/PETSc/DMPlex.pyx":180 * assert dim >= 1 and dim <= 3 * cdef PetscReal clower[3] * clower[0] = clower[1] = clower[2] = 0 # <<<<<<<<<<<<<< * for i from 0 <= i < dim: clower[i] = lower[i] * cdef PetscReal cupper[3] */ (__pyx_v_clower[0]) = 0.0; (__pyx_v_clower[1]) = 0.0; (__pyx_v_clower[2]) = 0.0; /* "petsc4py/PETSc/DMPlex.pyx":181 * cdef PetscReal clower[3] * clower[0] = clower[1] = clower[2] = 0 * for i from 0 <= i < dim: clower[i] = lower[i] # <<<<<<<<<<<<<< * cdef PetscReal cupper[3] * cupper[0] = cupper[1] = cupper[2] = 1 */ __pyx_t_4 = __pyx_v_dim; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_lower, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(57, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_5 == ((PetscReal)-1)) && PyErr_Occurred())) __PYX_ERR(57, 181, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; (__pyx_v_clower[__pyx_v_i]) = __pyx_t_5; } /* "petsc4py/PETSc/DMPlex.pyx":183 * for i from 0 <= i < dim: clower[i] = lower[i] * cdef PetscReal cupper[3] * cupper[0] = cupper[1] = cupper[2] = 1 # <<<<<<<<<<<<<< * for i from 0 <= i < dim: cupper[i] = upper[i] * cdef PetscBool cinterp = interpolate */ (__pyx_v_cupper[0]) = 1.0; (__pyx_v_cupper[1]) = 1.0; (__pyx_v_cupper[2]) = 1.0; /* "petsc4py/PETSc/DMPlex.pyx":184 * cdef PetscReal cupper[3] * cupper[0] = cupper[1] = cupper[2] = 1 * for i from 0 <= i < dim: cupper[i] = upper[i] # <<<<<<<<<<<<<< * cdef PetscBool cinterp = interpolate * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) */ __pyx_t_4 = __pyx_v_dim; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_upper, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(57, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_5 == ((PetscReal)-1)) && PyErr_Occurred())) __PYX_ERR(57, 184, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; (__pyx_v_cupper[__pyx_v_i]) = __pyx_t_5; } /* "petsc4py/PETSc/DMPlex.pyx":185 * cupper[0] = cupper[1] = cupper[2] = 1 * for i from 0 <= i < dim: cupper[i] = upper[i] * cdef PetscBool cinterp = interpolate # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscDM newdm = NULL */ __pyx_t_6 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_interpolate)); if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 185, __pyx_L1_error) __pyx_v_cinterp = __pyx_t_6; /* "petsc4py/PETSc/DMPlex.pyx":186 * for i from 0 <= i < dim: cupper[i] = upper[i] * cdef PetscBool cinterp = interpolate * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscDM newdm = NULL * CHKERR( DMPlexCreateBoxSurfaceMesh(ccomm, dim, cfaces, clower, cupper, cinterp, &newdm) ) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_7 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(57, 186, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_7; /* "petsc4py/PETSc/DMPlex.pyx":187 * cdef PetscBool cinterp = interpolate * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscDM newdm = NULL # <<<<<<<<<<<<<< * CHKERR( DMPlexCreateBoxSurfaceMesh(ccomm, dim, cfaces, clower, cupper, cinterp, &newdm) ) * CHKERR( PetscCLEAR(self.obj) ); self.dm = newdm */ __pyx_v_newdm = NULL; /* "petsc4py/PETSc/DMPlex.pyx":188 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscDM newdm = NULL * CHKERR( DMPlexCreateBoxSurfaceMesh(ccomm, dim, cfaces, clower, cupper, cinterp, &newdm) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.dm = newdm * return self */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexCreateBoxSurfaceMesh(__pyx_v_ccomm, __pyx_v_dim, __pyx_v_cfaces, __pyx_v_clower, __pyx_v_cupper, __pyx_v_cinterp, (&__pyx_v_newdm))); if (unlikely(__pyx_t_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 188, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":189 * cdef PetscDM newdm = NULL * CHKERR( DMPlexCreateBoxSurfaceMesh(ccomm, dim, cfaces, clower, cupper, cinterp, &newdm) ) * CHKERR( PetscCLEAR(self.obj) ); self.dm = newdm # <<<<<<<<<<<<<< * return self * */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.__pyx_base.obj)); if (unlikely(__pyx_t_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 189, __pyx_L1_error) __pyx_v_self->__pyx_base.dm = __pyx_v_newdm; /* "petsc4py/PETSc/DMPlex.pyx":190 * CHKERR( DMPlexCreateBoxSurfaceMesh(ccomm, dim, cfaces, clower, cupper, cinterp, &newdm) ) * CHKERR( PetscCLEAR(self.obj) ); self.dm = newdm * return self # <<<<<<<<<<<<<< * * def createFromFile(self, filename: str, plexname: str | None = "unnamed", interpolate: bool | None = True, comm: Comm | None = None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":149 * return self * * def createBoxSurfaceMesh(self, faces: Sequence[int], lower: Sequence[float] | None = (0,0,0), upper: Sequence[float] | None = (1,1,1), # <<<<<<<<<<<<<< * interpolate: bool | None = True, comm: Comm | None = None) -> Self: * """Create a mesh on the surface of a box mesh using tensor cells. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.createBoxSurfaceMesh", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_faces); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":192 * return self * * def createFromFile(self, filename: str, plexname: str | None = "unnamed", interpolate: bool | None = True, comm: Comm | None = None): # <<<<<<<<<<<<<< * """Create `DMPlex` from a file. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_9createFromFile(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_8createFromFile, "DMPlex.createFromFile(self, filename: str, plexname: str | None = 'unnamed', interpolate: bool | None = True, comm: Comm | None = None)\nCreate `DMPlex` from a file.\n\n Collective.\n\n Parameters\n ----------\n filename\n A file name.\n plexname\n The name of the resulting `DMPlex`,\n also used for intra-datafile lookup by some formats.\n interpolate\n Flag to create intermediate mesh pieces (edges, faces).\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n DM, DMPlex, DMPlex.createFromCellList, DMPlex.create, Object.setName\n DM.view, DM.load, petsc_options, petsc.DMPlexCreateFromFile\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:192"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_9createFromFile(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_filename = 0; PyObject *__pyx_v_plexname = 0; PyObject *__pyx_v_interpolate = 0; PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createFromFile (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filename,&__pyx_n_s_plexname,&__pyx_n_s_interpolate,&__pyx_n_s_comm,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_n_s_unnamed)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_True)); values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_filename)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 192, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_plexname); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 192, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_interpolate); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 192, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 192, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createFromFile") < 0)) __PYX_ERR(57, 192, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_filename = values[0]; __pyx_v_plexname = values[1]; __pyx_v_interpolate = values[2]; __pyx_v_comm = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createFromFile", 0, 1, 4, __pyx_nargs); __PYX_ERR(57, 192, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.createFromFile", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_8createFromFile(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_filename, __pyx_v_plexname, __pyx_v_interpolate, __pyx_v_comm); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_8createFromFile(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_plexname, PyObject *__pyx_v_interpolate, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PetscBool __pyx_v_interp; DM __pyx_v_newdm; char const *__pyx_v_cfile; char const *__pyx_v_pname; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PetscBool __pyx_t_2; PyObject *__pyx_t_3 = NULL; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createFromFile", 0); __Pyx_INCREF(__pyx_v_filename); __Pyx_INCREF(__pyx_v_plexname); /* "petsc4py/PETSc/DMPlex.pyx":215 * * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscBool interp = interpolate * cdef PetscDM newdm = NULL */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(57, 215, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":216 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscBool interp = interpolate # <<<<<<<<<<<<<< * cdef PetscDM newdm = NULL * cdef const char *cfile = NULL */ __pyx_t_2 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_interpolate)); if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 216, __pyx_L1_error) __pyx_v_interp = __pyx_t_2; /* "petsc4py/PETSc/DMPlex.pyx":217 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscBool interp = interpolate * cdef PetscDM newdm = NULL # <<<<<<<<<<<<<< * cdef const char *cfile = NULL * cdef const char *pname = NULL */ __pyx_v_newdm = NULL; /* "petsc4py/PETSc/DMPlex.pyx":218 * cdef PetscBool interp = interpolate * cdef PetscDM newdm = NULL * cdef const char *cfile = NULL # <<<<<<<<<<<<<< * cdef const char *pname = NULL * filename = str2bytes(filename, &cfile) */ __pyx_v_cfile = NULL; /* "petsc4py/PETSc/DMPlex.pyx":219 * cdef PetscDM newdm = NULL * cdef const char *cfile = NULL * cdef const char *pname = NULL # <<<<<<<<<<<<<< * filename = str2bytes(filename, &cfile) * plexname = str2bytes(plexname, &pname) */ __pyx_v_pname = NULL; /* "petsc4py/PETSc/DMPlex.pyx":220 * cdef const char *cfile = NULL * cdef const char *pname = NULL * filename = str2bytes(filename, &cfile) # <<<<<<<<<<<<<< * plexname = str2bytes(plexname, &pname) * CHKERR( DMPlexCreateFromFile(ccomm, cfile, pname, interp, &newdm) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_filename, (&__pyx_v_cfile)); if (unlikely(!__pyx_t_3)) __PYX_ERR(57, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_filename, __pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/DMPlex.pyx":221 * cdef const char *pname = NULL * filename = str2bytes(filename, &cfile) * plexname = str2bytes(plexname, &pname) # <<<<<<<<<<<<<< * CHKERR( DMPlexCreateFromFile(ccomm, cfile, pname, interp, &newdm) ) * CHKERR( PetscCLEAR(self.obj) ); self.dm = newdm */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_plexname, (&__pyx_v_pname)); if (unlikely(!__pyx_t_3)) __PYX_ERR(57, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_plexname, __pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/DMPlex.pyx":222 * filename = str2bytes(filename, &cfile) * plexname = str2bytes(plexname, &pname) * CHKERR( DMPlexCreateFromFile(ccomm, cfile, pname, interp, &newdm) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.dm = newdm * return self */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexCreateFromFile(__pyx_v_ccomm, __pyx_v_cfile, __pyx_v_pname, __pyx_v_interp, (&__pyx_v_newdm))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 222, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":223 * plexname = str2bytes(plexname, &pname) * CHKERR( DMPlexCreateFromFile(ccomm, cfile, pname, interp, &newdm) ) * CHKERR( PetscCLEAR(self.obj) ); self.dm = newdm # <<<<<<<<<<<<<< * return self * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 223, __pyx_L1_error) __pyx_v_self->__pyx_base.dm = __pyx_v_newdm; /* "petsc4py/PETSc/DMPlex.pyx":224 * CHKERR( DMPlexCreateFromFile(ccomm, cfile, pname, interp, &newdm) ) * CHKERR( PetscCLEAR(self.obj) ); self.dm = newdm * return self # <<<<<<<<<<<<<< * * def createCGNS(self, cgid: int, interpolate: bool | None = True, comm: Comm | None = None) -> Self: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":192 * return self * * def createFromFile(self, filename: str, plexname: str | None = "unnamed", interpolate: bool | None = True, comm: Comm | None = None): # <<<<<<<<<<<<<< * """Create `DMPlex` from a file. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.createFromFile", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_filename); __Pyx_XDECREF(__pyx_v_plexname); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":226 * return self * * def createCGNS(self, cgid: int, interpolate: bool | None = True, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Create a `DMPlex` mesh from a CGNS file. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_11createCGNS(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_10createCGNS, "DMPlex.createCGNS(self, cgid: int, interpolate: bool | None = True, comm: Comm | None = None) -> Self\nCreate a `DMPlex` mesh from a CGNS file.\n\n Collective.\n\n Parameters\n ----------\n cgid\n The CG id associated with a file and obtained using cg_open.\n interpolate\n Create faces and edges in the mesh.\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n DM, DMPlex, DMPlex.create, DMPlex.createCGNSFromFile\n DMPlex.createExodus, petsc.DMPlexCreateCGNS\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:226"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_11createCGNS(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_cgid = 0; PyObject *__pyx_v_interpolate = 0; PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createCGNS (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cgid,&__pyx_n_s_interpolate,&__pyx_n_s_comm,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_True)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_cgid)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 226, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_interpolate); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 226, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 226, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createCGNS") < 0)) __PYX_ERR(57, 226, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_cgid = values[0]; __pyx_v_interpolate = values[1]; __pyx_v_comm = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createCGNS", 0, 1, 3, __pyx_nargs); __PYX_ERR(57, 226, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.createCGNS", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_10createCGNS(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_cgid, __pyx_v_interpolate, __pyx_v_comm); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_10createCGNS(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_cgid, PyObject *__pyx_v_interpolate, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PetscBool __pyx_v_interp; DM __pyx_v_newdm; PetscInt __pyx_v_ccgid; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PetscBool __pyx_t_2; PetscInt __pyx_t_3; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createCGNS", 1); /* "petsc4py/PETSc/DMPlex.pyx":246 * * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscBool interp = interpolate * cdef PetscDM newdm = NULL */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(57, 246, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":247 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscBool interp = interpolate # <<<<<<<<<<<<<< * cdef PetscDM newdm = NULL * cdef PetscInt ccgid = asInt(cgid) */ __pyx_t_2 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_interpolate)); if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 247, __pyx_L1_error) __pyx_v_interp = __pyx_t_2; /* "petsc4py/PETSc/DMPlex.pyx":248 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscBool interp = interpolate * cdef PetscDM newdm = NULL # <<<<<<<<<<<<<< * cdef PetscInt ccgid = asInt(cgid) * CHKERR( DMPlexCreateCGNS(ccomm, ccgid, interp, &newdm) ) */ __pyx_v_newdm = NULL; /* "petsc4py/PETSc/DMPlex.pyx":249 * cdef PetscBool interp = interpolate * cdef PetscDM newdm = NULL * cdef PetscInt ccgid = asInt(cgid) # <<<<<<<<<<<<<< * CHKERR( DMPlexCreateCGNS(ccomm, ccgid, interp, &newdm) ) * CHKERR( PetscCLEAR(self.obj) ); self.dm = newdm */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_cgid); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(57, 249, __pyx_L1_error) __pyx_v_ccgid = __pyx_t_3; /* "petsc4py/PETSc/DMPlex.pyx":250 * cdef PetscDM newdm = NULL * cdef PetscInt ccgid = asInt(cgid) * CHKERR( DMPlexCreateCGNS(ccomm, ccgid, interp, &newdm) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.dm = newdm * return self */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexCreateCGNS(__pyx_v_ccomm, __pyx_v_ccgid, __pyx_v_interp, (&__pyx_v_newdm))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 250, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":251 * cdef PetscInt ccgid = asInt(cgid) * CHKERR( DMPlexCreateCGNS(ccomm, ccgid, interp, &newdm) ) * CHKERR( PetscCLEAR(self.obj) ); self.dm = newdm # <<<<<<<<<<<<<< * return self * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 251, __pyx_L1_error) __pyx_v_self->__pyx_base.dm = __pyx_v_newdm; /* "petsc4py/PETSc/DMPlex.pyx":252 * CHKERR( DMPlexCreateCGNS(ccomm, ccgid, interp, &newdm) ) * CHKERR( PetscCLEAR(self.obj) ); self.dm = newdm * return self # <<<<<<<<<<<<<< * * def createCGNSFromFile(self, filename: str, interpolate: bool | None = True, comm: Comm | None = None) -> Self: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":226 * return self * * def createCGNS(self, cgid: int, interpolate: bool | None = True, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Create a `DMPlex` mesh from a CGNS file. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.createCGNS", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":254 * return self * * def createCGNSFromFile(self, filename: str, interpolate: bool | None = True, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """"Create a `DMPlex` mesh from a CGNS file. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_13createCGNSFromFile(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_12createCGNSFromFile, "DMPlex.createCGNSFromFile(self, filename: str, interpolate: bool | None = True, comm: Comm | None = None) -> Self\n\"Create a `DMPlex` mesh from a CGNS file.\n\n Collective.\n\n Parameters\n ----------\n filename\n The name of the CGNS file.\n interpolate\n Create faces and edges in the mesh.\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n DM, DMPlex, DMPlex.create, DMPlex.createCGNS, DMPlex.createExodus\n petsc.DMPlexCreateCGNS\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:254"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_13createCGNSFromFile(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_filename = 0; PyObject *__pyx_v_interpolate = 0; PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createCGNSFromFile (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filename,&__pyx_n_s_interpolate,&__pyx_n_s_comm,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_True)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_filename)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 254, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_interpolate); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 254, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 254, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createCGNSFromFile") < 0)) __PYX_ERR(57, 254, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_filename = values[0]; __pyx_v_interpolate = values[1]; __pyx_v_comm = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createCGNSFromFile", 0, 1, 3, __pyx_nargs); __PYX_ERR(57, 254, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.createCGNSFromFile", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_12createCGNSFromFile(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_filename, __pyx_v_interpolate, __pyx_v_comm); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_12createCGNSFromFile(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_interpolate, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PetscBool __pyx_v_interp; DM __pyx_v_newdm; char const *__pyx_v_cfile; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PetscBool __pyx_t_2; PyObject *__pyx_t_3 = NULL; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createCGNSFromFile", 0); __Pyx_INCREF(__pyx_v_filename); /* "petsc4py/PETSc/DMPlex.pyx":274 * * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscBool interp = interpolate * cdef PetscDM newdm = NULL */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(57, 274, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":275 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscBool interp = interpolate # <<<<<<<<<<<<<< * cdef PetscDM newdm = NULL * cdef const char *cfile = NULL */ __pyx_t_2 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_interpolate)); if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 275, __pyx_L1_error) __pyx_v_interp = __pyx_t_2; /* "petsc4py/PETSc/DMPlex.pyx":276 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscBool interp = interpolate * cdef PetscDM newdm = NULL # <<<<<<<<<<<<<< * cdef const char *cfile = NULL * filename = str2bytes(filename, &cfile) */ __pyx_v_newdm = NULL; /* "petsc4py/PETSc/DMPlex.pyx":277 * cdef PetscBool interp = interpolate * cdef PetscDM newdm = NULL * cdef const char *cfile = NULL # <<<<<<<<<<<<<< * filename = str2bytes(filename, &cfile) * CHKERR( DMPlexCreateCGNSFromFile(ccomm, cfile, interp, &newdm) ) */ __pyx_v_cfile = NULL; /* "petsc4py/PETSc/DMPlex.pyx":278 * cdef PetscDM newdm = NULL * cdef const char *cfile = NULL * filename = str2bytes(filename, &cfile) # <<<<<<<<<<<<<< * CHKERR( DMPlexCreateCGNSFromFile(ccomm, cfile, interp, &newdm) ) * CHKERR( PetscCLEAR(self.obj) ); self.dm = newdm */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_filename, (&__pyx_v_cfile)); if (unlikely(!__pyx_t_3)) __PYX_ERR(57, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_filename, __pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/DMPlex.pyx":279 * cdef const char *cfile = NULL * filename = str2bytes(filename, &cfile) * CHKERR( DMPlexCreateCGNSFromFile(ccomm, cfile, interp, &newdm) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.dm = newdm * return self */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexCreateCGNSFromFile(__pyx_v_ccomm, __pyx_v_cfile, __pyx_v_interp, (&__pyx_v_newdm))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 279, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":280 * filename = str2bytes(filename, &cfile) * CHKERR( DMPlexCreateCGNSFromFile(ccomm, cfile, interp, &newdm) ) * CHKERR( PetscCLEAR(self.obj) ); self.dm = newdm # <<<<<<<<<<<<<< * return self * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 280, __pyx_L1_error) __pyx_v_self->__pyx_base.dm = __pyx_v_newdm; /* "petsc4py/PETSc/DMPlex.pyx":281 * CHKERR( DMPlexCreateCGNSFromFile(ccomm, cfile, interp, &newdm) ) * CHKERR( PetscCLEAR(self.obj) ); self.dm = newdm * return self # <<<<<<<<<<<<<< * * def createExodusFromFile(self, filename: str, interpolate: bool | None = True, comm: Comm | None = None) -> Self: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":254 * return self * * def createCGNSFromFile(self, filename: str, interpolate: bool | None = True, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """"Create a `DMPlex` mesh from a CGNS file. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.createCGNSFromFile", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_filename); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":283 * return self * * def createExodusFromFile(self, filename: str, interpolate: bool | None = True, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Create a `DMPlex` mesh from an ExodusII file. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_15createExodusFromFile(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_14createExodusFromFile, "DMPlex.createExodusFromFile(self, filename: str, interpolate: bool | None = True, comm: Comm | None = None) -> Self\nCreate a `DMPlex` mesh from an ExodusII file.\n\n Collective.\n\n Parameters\n ----------\n filename\n The name of the ExodusII file.\n interpolate\n Create faces and edges in the mesh.\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n DM, DMPlex, DM.create, DMPlex.createExodus\n petsc.DMPlexCreateExodusFromFile\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:283"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_15createExodusFromFile(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_filename = 0; PyObject *__pyx_v_interpolate = 0; PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createExodusFromFile (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filename,&__pyx_n_s_interpolate,&__pyx_n_s_comm,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_True)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_filename)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 283, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_interpolate); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 283, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 283, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createExodusFromFile") < 0)) __PYX_ERR(57, 283, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_filename = values[0]; __pyx_v_interpolate = values[1]; __pyx_v_comm = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createExodusFromFile", 0, 1, 3, __pyx_nargs); __PYX_ERR(57, 283, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.createExodusFromFile", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_14createExodusFromFile(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_filename, __pyx_v_interpolate, __pyx_v_comm); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_14createExodusFromFile(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_interpolate, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PetscBool __pyx_v_interp; DM __pyx_v_newdm; char const *__pyx_v_cfile; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PetscBool __pyx_t_2; PyObject *__pyx_t_3 = NULL; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createExodusFromFile", 0); __Pyx_INCREF(__pyx_v_filename); /* "petsc4py/PETSc/DMPlex.pyx":303 * * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscBool interp = interpolate * cdef PetscDM newdm = NULL */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(57, 303, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":304 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscBool interp = interpolate # <<<<<<<<<<<<<< * cdef PetscDM newdm = NULL * cdef const char *cfile = NULL */ __pyx_t_2 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_interpolate)); if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 304, __pyx_L1_error) __pyx_v_interp = __pyx_t_2; /* "petsc4py/PETSc/DMPlex.pyx":305 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscBool interp = interpolate * cdef PetscDM newdm = NULL # <<<<<<<<<<<<<< * cdef const char *cfile = NULL * filename = str2bytes(filename, &cfile) */ __pyx_v_newdm = NULL; /* "petsc4py/PETSc/DMPlex.pyx":306 * cdef PetscBool interp = interpolate * cdef PetscDM newdm = NULL * cdef const char *cfile = NULL # <<<<<<<<<<<<<< * filename = str2bytes(filename, &cfile) * CHKERR( DMPlexCreateExodusFromFile(ccomm, cfile, interp, &newdm) ) */ __pyx_v_cfile = NULL; /* "petsc4py/PETSc/DMPlex.pyx":307 * cdef PetscDM newdm = NULL * cdef const char *cfile = NULL * filename = str2bytes(filename, &cfile) # <<<<<<<<<<<<<< * CHKERR( DMPlexCreateExodusFromFile(ccomm, cfile, interp, &newdm) ) * CHKERR( PetscCLEAR(self.obj) ); self.dm = newdm */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_filename, (&__pyx_v_cfile)); if (unlikely(!__pyx_t_3)) __PYX_ERR(57, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_filename, __pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/DMPlex.pyx":308 * cdef const char *cfile = NULL * filename = str2bytes(filename, &cfile) * CHKERR( DMPlexCreateExodusFromFile(ccomm, cfile, interp, &newdm) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.dm = newdm * return self */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexCreateExodusFromFile(__pyx_v_ccomm, __pyx_v_cfile, __pyx_v_interp, (&__pyx_v_newdm))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 308, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":309 * filename = str2bytes(filename, &cfile) * CHKERR( DMPlexCreateExodusFromFile(ccomm, cfile, interp, &newdm) ) * CHKERR( PetscCLEAR(self.obj) ); self.dm = newdm # <<<<<<<<<<<<<< * return self * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 309, __pyx_L1_error) __pyx_v_self->__pyx_base.dm = __pyx_v_newdm; /* "petsc4py/PETSc/DMPlex.pyx":310 * CHKERR( DMPlexCreateExodusFromFile(ccomm, cfile, interp, &newdm) ) * CHKERR( PetscCLEAR(self.obj) ); self.dm = newdm * return self # <<<<<<<<<<<<<< * * def createExodus(self, exoid: int, interpolate: bool | None = True, comm: Comm | None = None) -> Self: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":283 * return self * * def createExodusFromFile(self, filename: str, interpolate: bool | None = True, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Create a `DMPlex` mesh from an ExodusII file. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.createExodusFromFile", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_filename); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":312 * return self * * def createExodus(self, exoid: int, interpolate: bool | None = True, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Create a `DMPlex` mesh from an ExodusII file ID. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_17createExodus(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_16createExodus, "DMPlex.createExodus(self, exoid: int, interpolate: bool | None = True, comm: Comm | None = None) -> Self\nCreate a `DMPlex` mesh from an ExodusII file ID.\n\n Collective.\n\n Parameters\n ----------\n exoid\n The ExodusII id associated with a exodus file and obtained using ex_open.\n interpolate\n Create faces and edges in the mesh,\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n DM, DMPlex, DM.create, petsc.DMPlexCreateExodus\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:312"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_17createExodus(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_exoid = 0; PyObject *__pyx_v_interpolate = 0; PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createExodus (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_exoid,&__pyx_n_s_interpolate,&__pyx_n_s_comm,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_True)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_exoid)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 312, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_interpolate); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 312, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 312, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createExodus") < 0)) __PYX_ERR(57, 312, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_exoid = values[0]; __pyx_v_interpolate = values[1]; __pyx_v_comm = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createExodus", 0, 1, 3, __pyx_nargs); __PYX_ERR(57, 312, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.createExodus", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_16createExodus(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_exoid, __pyx_v_interpolate, __pyx_v_comm); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_16createExodus(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_exoid, PyObject *__pyx_v_interpolate, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PetscBool __pyx_v_interp; DM __pyx_v_newdm; PetscInt __pyx_v_cexoid; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PetscBool __pyx_t_2; PetscInt __pyx_t_3; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createExodus", 1); /* "petsc4py/PETSc/DMPlex.pyx":331 * * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscBool interp = interpolate * cdef PetscDM newdm = NULL */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(57, 331, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":332 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscBool interp = interpolate # <<<<<<<<<<<<<< * cdef PetscDM newdm = NULL * cdef PetscInt cexoid = asInt(exoid) */ __pyx_t_2 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_interpolate)); if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 332, __pyx_L1_error) __pyx_v_interp = __pyx_t_2; /* "petsc4py/PETSc/DMPlex.pyx":333 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscBool interp = interpolate * cdef PetscDM newdm = NULL # <<<<<<<<<<<<<< * cdef PetscInt cexoid = asInt(exoid) * CHKERR( DMPlexCreateExodus(ccomm, cexoid, interp, &newdm) ) */ __pyx_v_newdm = NULL; /* "petsc4py/PETSc/DMPlex.pyx":334 * cdef PetscBool interp = interpolate * cdef PetscDM newdm = NULL * cdef PetscInt cexoid = asInt(exoid) # <<<<<<<<<<<<<< * CHKERR( DMPlexCreateExodus(ccomm, cexoid, interp, &newdm) ) * CHKERR( PetscCLEAR(self.obj) ); self.dm = newdm */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_exoid); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(57, 334, __pyx_L1_error) __pyx_v_cexoid = __pyx_t_3; /* "petsc4py/PETSc/DMPlex.pyx":335 * cdef PetscDM newdm = NULL * cdef PetscInt cexoid = asInt(exoid) * CHKERR( DMPlexCreateExodus(ccomm, cexoid, interp, &newdm) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.dm = newdm * return self */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexCreateExodus(__pyx_v_ccomm, __pyx_v_cexoid, __pyx_v_interp, (&__pyx_v_newdm))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 335, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":336 * cdef PetscInt cexoid = asInt(exoid) * CHKERR( DMPlexCreateExodus(ccomm, cexoid, interp, &newdm) ) * CHKERR( PetscCLEAR(self.obj) ); self.dm = newdm # <<<<<<<<<<<<<< * return self * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 336, __pyx_L1_error) __pyx_v_self->__pyx_base.dm = __pyx_v_newdm; /* "petsc4py/PETSc/DMPlex.pyx":337 * CHKERR( DMPlexCreateExodus(ccomm, cexoid, interp, &newdm) ) * CHKERR( PetscCLEAR(self.obj) ); self.dm = newdm * return self # <<<<<<<<<<<<<< * * def createGmsh(self, Viewer viewer, interpolate: bool | None = True, comm: Comm | None = None) -> Self: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":312 * return self * * def createExodus(self, exoid: int, interpolate: bool | None = True, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Create a `DMPlex` mesh from an ExodusII file ID. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.createExodus", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":339 * return self * * def createGmsh(self, Viewer viewer, interpolate: bool | None = True, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Create a `DMPlex` mesh from a Gmsh file viewer. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_19createGmsh(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_18createGmsh, "DMPlex.createGmsh(self, viewer: Viewer, interpolate: bool | None = True, comm: Comm | None = None) -> Self\nCreate a `DMPlex` mesh from a Gmsh file viewer.\n\n Collective.\n\n Parameters\n ----------\n viewer\n The `Viewer` associated with a Gmsh file.\n interpolate\n Create faces and edges in the mesh.\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n Notes\n -----\n ``-dm_plex_gmsh_hybrid`` forces triangular prisms to use tensor order.\n\n ``-dm_plex_gmsh_periodic`` allows for reading Gmsh periodic section.\n\n ``-dm_plex_gmsh_highorder`` allows for generating high-order coordinates.\n\n ``-dm_plex_gmsh_project`` projects high-order coordinates to a different space,\n use the prefix ``-dm_plex_gmsh_project_`` to define the space.\n\n ``-dm_plex_gmsh_use_regions`` generates labels with region names.\n\n ``-dm_plex_gmsh_mark_vertices`` adds vertices to generated labels.\n\n ``-dm_plex_gmsh_multiple_tags`` allows multiple tags for default labels.\n\n ``-dm_plex_gmsh_spacedim `` embedding space dimension.\n\n See Also\n --------\n DM, DMPlex, DM.create, petsc_options, petsc.DMPlexCreateGmsh\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:339"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_19createGmsh(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscViewerObject *__pyx_v_viewer = 0; PyObject *__pyx_v_interpolate = 0; PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createGmsh (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,&__pyx_n_s_interpolate,&__pyx_n_s_comm,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_True)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_viewer)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 339, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_interpolate); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 339, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 339, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createGmsh") < 0)) __PYX_ERR(57, 339, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); __pyx_v_interpolate = values[1]; __pyx_v_comm = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createGmsh", 0, 1, 3, __pyx_nargs); __PYX_ERR(57, 339, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.createGmsh", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 0, "viewer", 0))) __PYX_ERR(57, 339, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_18createGmsh(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_viewer, __pyx_v_interpolate, __pyx_v_comm); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_18createGmsh(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer, PyObject *__pyx_v_interpolate, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PetscBool __pyx_v_interp; DM __pyx_v_newdm; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PetscBool __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createGmsh", 1); /* "petsc4py/PETSc/DMPlex.pyx":370 * * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscBool interp = interpolate * cdef PetscDM newdm = NULL */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(57, 370, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":371 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscBool interp = interpolate # <<<<<<<<<<<<<< * cdef PetscDM newdm = NULL * CHKERR( DMPlexCreateGmsh(ccomm, viewer.vwr, interp, &newdm) ) */ __pyx_t_2 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_interpolate)); if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 371, __pyx_L1_error) __pyx_v_interp = __pyx_t_2; /* "petsc4py/PETSc/DMPlex.pyx":372 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscBool interp = interpolate * cdef PetscDM newdm = NULL # <<<<<<<<<<<<<< * CHKERR( DMPlexCreateGmsh(ccomm, viewer.vwr, interp, &newdm) ) * CHKERR( PetscCLEAR(self.obj) ); self.dm = newdm */ __pyx_v_newdm = NULL; /* "petsc4py/PETSc/DMPlex.pyx":373 * cdef PetscBool interp = interpolate * cdef PetscDM newdm = NULL * CHKERR( DMPlexCreateGmsh(ccomm, viewer.vwr, interp, &newdm) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.dm = newdm * return self */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexCreateGmsh(__pyx_v_ccomm, __pyx_v_viewer->vwr, __pyx_v_interp, (&__pyx_v_newdm))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 373, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":374 * cdef PetscDM newdm = NULL * CHKERR( DMPlexCreateGmsh(ccomm, viewer.vwr, interp, &newdm) ) * CHKERR( PetscCLEAR(self.obj) ); self.dm = newdm # <<<<<<<<<<<<<< * return self * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 374, __pyx_L1_error) __pyx_v_self->__pyx_base.dm = __pyx_v_newdm; /* "petsc4py/PETSc/DMPlex.pyx":375 * CHKERR( DMPlexCreateGmsh(ccomm, viewer.vwr, interp, &newdm) ) * CHKERR( PetscCLEAR(self.obj) ); self.dm = newdm * return self # <<<<<<<<<<<<<< * * def createCohesiveSubmesh(self, hasLagrange: bool, value: int) -> DMPlex: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":339 * return self * * def createGmsh(self, Viewer viewer, interpolate: bool | None = True, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Create a `DMPlex` mesh from a Gmsh file viewer. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.createGmsh", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":377 * return self * * def createCohesiveSubmesh(self, hasLagrange: bool, value: int) -> DMPlex: # <<<<<<<<<<<<<< * """Extract the hypersurface defined by one face of the cohesive cells. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_21createCohesiveSubmesh(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_20createCohesiveSubmesh, "DMPlex.createCohesiveSubmesh(self, hasLagrange: bool, value: int) -> DMPlex\nExtract the hypersurface defined by one face of the cohesive cells.\n\n Parameters\n ----------\n hasLagrange\n Flag indicating whether the mesh has Lagrange dofs in the cohesive cells.\n value\n A label value.\n\n See Also\n --------\n DM, DMPlex, petsc.DMPlexCreateCohesiveSubmesh\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:377"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_21createCohesiveSubmesh(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_hasLagrange = 0; PyObject *__pyx_v_value = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createCohesiveSubmesh (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_hasLagrange,&__pyx_n_s_value,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_hasLagrange)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 377, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 377, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("createCohesiveSubmesh", 1, 2, 2, 1); __PYX_ERR(57, 377, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createCohesiveSubmesh") < 0)) __PYX_ERR(57, 377, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_hasLagrange = values[0]; __pyx_v_value = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createCohesiveSubmesh", 1, 2, 2, __pyx_nargs); __PYX_ERR(57, 377, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.createCohesiveSubmesh", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_20createCohesiveSubmesh(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_hasLagrange, __pyx_v_value); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_20createCohesiveSubmesh(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_hasLagrange, PyObject *__pyx_v_value) { PetscBool __pyx_v_flag; PetscInt __pyx_v_cvalue; struct PyPetscDMObject *__pyx_v_subdm = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; PetscInt __pyx_t_2; PyObject *__pyx_t_3 = NULL; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createCohesiveSubmesh", 1); /* "petsc4py/PETSc/DMPlex.pyx":392 * * """ * cdef PetscBool flag = hasLagrange # <<<<<<<<<<<<<< * cdef PetscInt cvalue = asInt(value) * cdef DM subdm = DMPlex() */ __pyx_t_1 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_hasLagrange)); if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 392, __pyx_L1_error) __pyx_v_flag = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":393 * """ * cdef PetscBool flag = hasLagrange * cdef PetscInt cvalue = asInt(value) # <<<<<<<<<<<<<< * cdef DM subdm = DMPlex() * CHKERR( DMPlexCreateCohesiveSubmesh(self.dm, flag, NULL, cvalue, &subdm.dm) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_value); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(57, 393, __pyx_L1_error) __pyx_v_cvalue = __pyx_t_2; /* "petsc4py/PETSc/DMPlex.pyx":394 * cdef PetscBool flag = hasLagrange * cdef PetscInt cvalue = asInt(value) * cdef DM subdm = DMPlex() # <<<<<<<<<<<<<< * CHKERR( DMPlexCreateCohesiveSubmesh(self.dm, flag, NULL, cvalue, &subdm.dm) ) * return subdm */ __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DMPlex)); if (unlikely(!__pyx_t_3)) __PYX_ERR(57, 394, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_subdm = ((struct PyPetscDMObject *)__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/DMPlex.pyx":395 * cdef PetscInt cvalue = asInt(value) * cdef DM subdm = DMPlex() * CHKERR( DMPlexCreateCohesiveSubmesh(self.dm, flag, NULL, cvalue, &subdm.dm) ) # <<<<<<<<<<<<<< * return subdm * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexCreateCohesiveSubmesh(__pyx_v_self->__pyx_base.dm, __pyx_v_flag, NULL, __pyx_v_cvalue, (&__pyx_v_subdm->dm))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 395, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":396 * cdef DM subdm = DMPlex() * CHKERR( DMPlexCreateCohesiveSubmesh(self.dm, flag, NULL, cvalue, &subdm.dm) ) * return subdm # <<<<<<<<<<<<<< * * def getChart(self) -> tuple[int, int]: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_subdm); __pyx_r = ((PyObject *)__pyx_v_subdm); goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":377 * return self * * def createCohesiveSubmesh(self, hasLagrange: bool, value: int) -> DMPlex: # <<<<<<<<<<<<<< * """Extract the hypersurface defined by one face of the cohesive cells. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.createCohesiveSubmesh", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_subdm); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":398 * return subdm * * def getChart(self) -> tuple[int, int]: # <<<<<<<<<<<<<< * """Return the interval for all mesh points [``pStart``, ``pEnd``). * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_23getChart(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_22getChart, "DMPlex.getChart(self) -> tuple[int, int]\nReturn the interval for all mesh points [``pStart``, ``pEnd``).\n\n Not collective.\n\n Returns\n -------\n pStart : int\n The first mesh point.\n pEnd : int\n The upper bound for mesh points.\n\n See Also\n --------\n DM, DMPlex, DMPlex.create, DMPlex.setChart, petsc.DMPlexGetChart\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:398"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_23getChart(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getChart (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getChart", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getChart", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_22getChart(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_22getChart(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self) { PetscInt __pyx_v_pStart; PetscInt __pyx_v_pEnd; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getChart", 1); /* "petsc4py/PETSc/DMPlex.pyx":415 * * """ * cdef PetscInt pStart = 0, pEnd = 0 # <<<<<<<<<<<<<< * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) * return toInt(pStart), toInt(pEnd) */ __pyx_v_pStart = 0; __pyx_v_pEnd = 0; /* "petsc4py/PETSc/DMPlex.pyx":416 * """ * cdef PetscInt pStart = 0, pEnd = 0 * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) # <<<<<<<<<<<<<< * return toInt(pStart), toInt(pEnd) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetChart(__pyx_v_self->__pyx_base.dm, (&__pyx_v_pStart), (&__pyx_v_pEnd))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 416, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":417 * cdef PetscInt pStart = 0, pEnd = 0 * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) * return toInt(pStart), toInt(pEnd) # <<<<<<<<<<<<<< * * def setChart(self, pStart: int, pEnd: int) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_pStart); if (unlikely(!__pyx_t_2)) __PYX_ERR(57, 417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_pEnd); if (unlikely(!__pyx_t_3)) __PYX_ERR(57, 417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(57, 417, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(57, 417, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":398 * return subdm * * def getChart(self) -> tuple[int, int]: # <<<<<<<<<<<<<< * """Return the interval for all mesh points [``pStart``, ``pEnd``). * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getChart", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":419 * return toInt(pStart), toInt(pEnd) * * def setChart(self, pStart: int, pEnd: int) -> None: # <<<<<<<<<<<<<< * """Set the interval for all mesh points [``pStart``, ``pEnd``). * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_25setChart(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_24setChart, "DMPlex.setChart(self, pStart: int, pEnd: int) -> None\nSet the interval for all mesh points [``pStart``, ``pEnd``).\n\n Not collective.\n\n Parameters\n ----------\n pStart\n The first mesh point.\n pEnd\n The upper bound for mesh points.\n\n See Also\n --------\n DM, DMPlex, DMPlex.create, DMPlex.getChart, petsc.DMPlexSetChart\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:419"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_25setChart(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_pStart = 0; PyObject *__pyx_v_pEnd = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setChart (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pStart,&__pyx_n_s_pEnd,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pStart)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 419, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pEnd)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 419, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setChart", 1, 2, 2, 1); __PYX_ERR(57, 419, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setChart") < 0)) __PYX_ERR(57, 419, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_pStart = values[0]; __pyx_v_pEnd = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setChart", 1, 2, 2, __pyx_nargs); __PYX_ERR(57, 419, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.setChart", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_24setChart(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_pStart, __pyx_v_pEnd); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_24setChart(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_pStart, PyObject *__pyx_v_pEnd) { PetscInt __pyx_v_cStart; PetscInt __pyx_v_cEnd; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setChart", 1); /* "petsc4py/PETSc/DMPlex.pyx":436 * * """ * cdef PetscInt cStart = asInt(pStart) # <<<<<<<<<<<<<< * cdef PetscInt cEnd = asInt(pEnd) * CHKERR( DMPlexSetChart(self.dm, cStart, cEnd) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_pStart); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(57, 436, __pyx_L1_error) __pyx_v_cStart = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":437 * """ * cdef PetscInt cStart = asInt(pStart) * cdef PetscInt cEnd = asInt(pEnd) # <<<<<<<<<<<<<< * CHKERR( DMPlexSetChart(self.dm, cStart, cEnd) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_pEnd); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(57, 437, __pyx_L1_error) __pyx_v_cEnd = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":438 * cdef PetscInt cStart = asInt(pStart) * cdef PetscInt cEnd = asInt(pEnd) * CHKERR( DMPlexSetChart(self.dm, cStart, cEnd) ) # <<<<<<<<<<<<<< * * def getConeSize(self, p: int) -> int: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexSetChart(__pyx_v_self->__pyx_base.dm, __pyx_v_cStart, __pyx_v_cEnd)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 438, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":419 * return toInt(pStart), toInt(pEnd) * * def setChart(self, pStart: int, pEnd: int) -> None: # <<<<<<<<<<<<<< * """Set the interval for all mesh points [``pStart``, ``pEnd``). * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.setChart", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":440 * CHKERR( DMPlexSetChart(self.dm, cStart, cEnd) ) * * def getConeSize(self, p: int) -> int: # <<<<<<<<<<<<<< * """Return the number of in-edges for this point in the DAG. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_27getConeSize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_26getConeSize, "DMPlex.getConeSize(self, p: int) -> int\nReturn the number of in-edges for this point in the DAG.\n\n Not collective.\n\n Parameters\n ----------\n p\n The point, which must lie in the chart set with `DMPlex.setChart`.\n\n See Also\n --------\n DM, DMPlex, DMPlex.create, DMPlex.setConeSize, DMPlex.setChart\n petsc.DMPlexGetConeSize\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:440"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_27getConeSize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_p = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getConeSize (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_p,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 440, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getConeSize") < 0)) __PYX_ERR(57, 440, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_p = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getConeSize", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 440, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getConeSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_26getConeSize(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_p); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_26getConeSize(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p) { PetscInt __pyx_v_cp; PetscInt __pyx_v_pStart; PetscInt __pyx_v_pEnd; PetscInt __pyx_v_csize; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getConeSize", 1); /* "petsc4py/PETSc/DMPlex.pyx":456 * * """ * cdef PetscInt cp = asInt(p) # <<<<<<<<<<<<<< * cdef PetscInt pStart = 0, pEnd = 0 * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_p); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(57, 456, __pyx_L1_error) __pyx_v_cp = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":457 * """ * cdef PetscInt cp = asInt(p) * cdef PetscInt pStart = 0, pEnd = 0 # <<<<<<<<<<<<<< * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) * assert cp>=pStart and cp=pStart and cp__pyx_base.dm, (&__pyx_v_pStart), (&__pyx_v_pEnd))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 458, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":459 * cdef PetscInt pStart = 0, pEnd = 0 * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) * assert cp>=pStart and cp= __pyx_v_pStart); if (__pyx_t_4) { } else { __pyx_t_3 = __pyx_t_4; goto __pyx_L3_bool_binop_done; } __pyx_t_4 = (__pyx_v_cp < __pyx_v_pEnd); __pyx_t_3 = __pyx_t_4; __pyx_L3_bool_binop_done:; if (unlikely(!__pyx_t_3)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(57, 459, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(57, 459, __pyx_L1_error) #endif /* "petsc4py/PETSc/DMPlex.pyx":460 * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) * assert cp>=pStart and cp=pStart and cp__pyx_base.dm, __pyx_v_cp, (&__pyx_v_csize))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 461, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":462 * cdef PetscInt csize = 0 * CHKERR( DMPlexGetConeSize(self.dm, cp, &csize) ) * return toInt(csize) # <<<<<<<<<<<<<< * * def setConeSize(self, p: int, size: int) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_csize); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":440 * CHKERR( DMPlexSetChart(self.dm, cStart, cEnd) ) * * def getConeSize(self, p: int) -> int: # <<<<<<<<<<<<<< * """Return the number of in-edges for this point in the DAG. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getConeSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":464 * return toInt(csize) * * def setConeSize(self, p: int, size: int) -> None: # <<<<<<<<<<<<<< * """Set the number of in-edges for this point in the DAG. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_29setConeSize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_28setConeSize, "DMPlex.setConeSize(self, p: int, size: int) -> None\nSet the number of in-edges for this point in the DAG.\n\n Not collective.\n\n Parameters\n ----------\n p\n The point, which must lie in the chart set with `DMPlex.setChart`.\n size\n The cone size for point ``p``.\n\n See Also\n --------\n DM, DMPlex, DMPlex.create, DMPlex.getConeSize, DMPlex.setChart\n petsc.DMPlexSetConeSize\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:464"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_29setConeSize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_p = 0; PyObject *__pyx_v_size = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setConeSize (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_p,&__pyx_n_s_size,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 464, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 464, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setConeSize", 1, 2, 2, 1); __PYX_ERR(57, 464, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setConeSize") < 0)) __PYX_ERR(57, 464, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_p = values[0]; __pyx_v_size = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setConeSize", 1, 2, 2, __pyx_nargs); __PYX_ERR(57, 464, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.setConeSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_28setConeSize(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_p, __pyx_v_size); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_28setConeSize(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p, PyObject *__pyx_v_size) { PetscInt __pyx_v_cp; PetscInt __pyx_v_pStart; PetscInt __pyx_v_pEnd; PetscInt __pyx_v_csize; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setConeSize", 1); /* "petsc4py/PETSc/DMPlex.pyx":482 * * """ * cdef PetscInt cp = asInt(p) # <<<<<<<<<<<<<< * cdef PetscInt pStart = 0, pEnd = 0 * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_p); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(57, 482, __pyx_L1_error) __pyx_v_cp = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":483 * """ * cdef PetscInt cp = asInt(p) * cdef PetscInt pStart = 0, pEnd = 0 # <<<<<<<<<<<<<< * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) * assert cp>=pStart and cp=pStart and cp__pyx_base.dm, (&__pyx_v_pStart), (&__pyx_v_pEnd))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 484, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":485 * cdef PetscInt pStart = 0, pEnd = 0 * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) * assert cp>=pStart and cp= __pyx_v_pStart); if (__pyx_t_4) { } else { __pyx_t_3 = __pyx_t_4; goto __pyx_L3_bool_binop_done; } __pyx_t_4 = (__pyx_v_cp < __pyx_v_pEnd); __pyx_t_3 = __pyx_t_4; __pyx_L3_bool_binop_done:; if (unlikely(!__pyx_t_3)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(57, 485, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(57, 485, __pyx_L1_error) #endif /* "petsc4py/PETSc/DMPlex.pyx":486 * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) * assert cp>=pStart and cp=pStart and cp ArrayInt: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexSetConeSize(__pyx_v_self->__pyx_base.dm, __pyx_v_cp, __pyx_v_csize)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 487, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":464 * return toInt(csize) * * def setConeSize(self, p: int, size: int) -> None: # <<<<<<<<<<<<<< * """Set the number of in-edges for this point in the DAG. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.setConeSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":489 * CHKERR( DMPlexSetConeSize(self.dm, cp, csize) ) * * def getCone(self, p: int) -> ArrayInt: # <<<<<<<<<<<<<< * """Return the points on the in-edges for this point in the DAG. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_31getCone(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_30getCone, "DMPlex.getCone(self, p: int) -> ArrayInt\nReturn the points on the in-edges for this point in the DAG.\n\n Not collective.\n\n Parameters\n ----------\n p\n The point, which must lie in the chart set with `DMPlex.setChart`.\n\n See Also\n --------\n DM, DMPlex, DMPlex.getConeSize, DMPlex.setCone, DMPlex.setChart\n petsc.DMPlexGetCone\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:489"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_31getCone(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_p = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getCone (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_p,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 489, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getCone") < 0)) __PYX_ERR(57, 489, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_p = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getCone", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 489, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getCone", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_30getCone(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_p); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_30getCone(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p) { PetscInt __pyx_v_cp; PetscInt __pyx_v_pStart; PetscInt __pyx_v_pEnd; PetscInt __pyx_v_ncone; PetscInt const *__pyx_v_icone; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getCone", 1); /* "petsc4py/PETSc/DMPlex.pyx":505 * * """ * cdef PetscInt cp = asInt(p) # <<<<<<<<<<<<<< * cdef PetscInt pStart = 0, pEnd = 0 * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_p); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(57, 505, __pyx_L1_error) __pyx_v_cp = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":506 * """ * cdef PetscInt cp = asInt(p) * cdef PetscInt pStart = 0, pEnd = 0 # <<<<<<<<<<<<<< * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) * assert cp>=pStart and cp=pStart and cp__pyx_base.dm, (&__pyx_v_pStart), (&__pyx_v_pEnd))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 507, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":508 * cdef PetscInt pStart = 0, pEnd = 0 * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) * assert cp>=pStart and cp= __pyx_v_pStart); if (__pyx_t_4) { } else { __pyx_t_3 = __pyx_t_4; goto __pyx_L3_bool_binop_done; } __pyx_t_4 = (__pyx_v_cp < __pyx_v_pEnd); __pyx_t_3 = __pyx_t_4; __pyx_L3_bool_binop_done:; if (unlikely(!__pyx_t_3)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(57, 508, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(57, 508, __pyx_L1_error) #endif /* "petsc4py/PETSc/DMPlex.pyx":509 * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) * assert cp>=pStart and cp=pStart and cp__pyx_base.dm, __pyx_v_cp, (&__pyx_v_ncone))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 511, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":512 * cdef const PetscInt *icone = NULL * CHKERR( DMPlexGetConeSize(self.dm, cp, &ncone) ) * CHKERR( DMPlexGetCone(self.dm, cp, &icone) ) # <<<<<<<<<<<<<< * return array_i(ncone, icone) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetCone(__pyx_v_self->__pyx_base.dm, __pyx_v_cp, (&__pyx_v_icone))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 512, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":513 * CHKERR( DMPlexGetConeSize(self.dm, cp, &ncone) ) * CHKERR( DMPlexGetCone(self.dm, cp, &icone) ) * return array_i(ncone, icone) # <<<<<<<<<<<<<< * * def setCone(self, p: int, cone: Sequence[int], orientation: Sequence[int] | None = None) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i(__pyx_v_ncone, __pyx_v_icone)); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 513, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":489 * CHKERR( DMPlexSetConeSize(self.dm, cp, csize) ) * * def getCone(self, p: int) -> ArrayInt: # <<<<<<<<<<<<<< * """Return the points on the in-edges for this point in the DAG. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getCone", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":515 * return array_i(ncone, icone) * * def setCone(self, p: int, cone: Sequence[int], orientation: Sequence[int] | None = None) -> None: # <<<<<<<<<<<<<< * """Set the points on the in-edges for this point in the DAG. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_33setCone(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_32setCone, "DMPlex.setCone(self, p: int, cone: Sequence[int], orientation: Sequence[int] | None = None) -> None\nSet the points on the in-edges for this point in the DAG.\n\n Not collective.\n\n Parameters\n ----------\n p\n The point, which must lie in the chart set with `DMPlex.setChart`.\n cone\n An array of points which are on the in-edges for point ``p``.\n orientation\n An array of orientations, defaults to `None`.\n\n See Also\n --------\n DM, DMPlex, DMPlex.create, DMPlex.getCone, DMPlex.setChart\n DMPlex.setConeSize, DM.setUp, DMPlex.setSupport\n DMPlex.setSupportSize, petsc.DMPlexSetCone\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:515"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_33setCone(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_p = 0; PyObject *__pyx_v_cone = 0; PyObject *__pyx_v_orientation = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setCone (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_p,&__pyx_n_s_cone,&__pyx_n_s_orientation,0}; values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 515, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_cone)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 515, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setCone", 0, 2, 3, 1); __PYX_ERR(57, 515, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_orientation); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 515, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setCone") < 0)) __PYX_ERR(57, 515, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_p = values[0]; __pyx_v_cone = values[1]; __pyx_v_orientation = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setCone", 0, 2, 3, __pyx_nargs); __PYX_ERR(57, 515, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.setCone", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_32setCone(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_p, __pyx_v_cone, __pyx_v_orientation); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_32setCone(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p, PyObject *__pyx_v_cone, PyObject *__pyx_v_orientation) { PetscInt __pyx_v_cp; PetscInt __pyx_v_pStart; PetscInt __pyx_v_pEnd; PetscInt __pyx_v_ncone; PetscInt *__pyx_v_icone; PetscInt __pyx_v_norie; PetscInt *__pyx_v_iorie; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setCone", 0); __Pyx_INCREF(__pyx_v_cone); __Pyx_INCREF(__pyx_v_orientation); /* "petsc4py/PETSc/DMPlex.pyx":536 * * """ * cdef PetscInt cp = asInt(p) # <<<<<<<<<<<<<< * cdef PetscInt pStart = 0, pEnd = 0 * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_p); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(57, 536, __pyx_L1_error) __pyx_v_cp = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":537 * """ * cdef PetscInt cp = asInt(p) * cdef PetscInt pStart = 0, pEnd = 0 # <<<<<<<<<<<<<< * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) * assert cp>=pStart and cp=pStart and cp__pyx_base.dm, (&__pyx_v_pStart), (&__pyx_v_pEnd))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 538, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":539 * cdef PetscInt pStart = 0, pEnd = 0 * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) * assert cp>=pStart and cp= __pyx_v_pStart); if (__pyx_t_4) { } else { __pyx_t_3 = __pyx_t_4; goto __pyx_L3_bool_binop_done; } __pyx_t_4 = (__pyx_v_cp < __pyx_v_pEnd); __pyx_t_3 = __pyx_t_4; __pyx_L3_bool_binop_done:; if (unlikely(!__pyx_t_3)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(57, 539, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(57, 539, __pyx_L1_error) #endif /* "petsc4py/PETSc/DMPlex.pyx":541 * assert cp>=pStart and cp__pyx_base.dm, __pyx_v_cp, __pyx_v_ncone)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 544, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":545 * cone = iarray_i(cone, &ncone, &icone) * CHKERR( DMPlexSetConeSize(self.dm, cp, ncone) ) * CHKERR( DMPlexSetCone(self.dm, cp, icone) ) # <<<<<<<<<<<<<< * # * cdef PetscInt norie = 0 */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexSetCone(__pyx_v_self->__pyx_base.dm, __pyx_v_cp, __pyx_v_icone)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 545, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":547 * CHKERR( DMPlexSetCone(self.dm, cp, icone) ) * # * cdef PetscInt norie = 0 # <<<<<<<<<<<<<< * cdef PetscInt *iorie = NULL * if orientation is not None: */ __pyx_v_norie = 0; /* "petsc4py/PETSc/DMPlex.pyx":548 * # * cdef PetscInt norie = 0 * cdef PetscInt *iorie = NULL # <<<<<<<<<<<<<< * if orientation is not None: * orientation = iarray_i(orientation, &norie, &iorie) */ __pyx_v_iorie = NULL; /* "petsc4py/PETSc/DMPlex.pyx":549 * cdef PetscInt norie = 0 * cdef PetscInt *iorie = NULL * if orientation is not None: # <<<<<<<<<<<<<< * orientation = iarray_i(orientation, &norie, &iorie) * assert norie == ncone */ __pyx_t_3 = (__pyx_v_orientation != Py_None); if (__pyx_t_3) { /* "petsc4py/PETSc/DMPlex.pyx":550 * cdef PetscInt *iorie = NULL * if orientation is not None: * orientation = iarray_i(orientation, &norie, &iorie) # <<<<<<<<<<<<<< * assert norie == ncone * CHKERR( DMPlexSetConeOrientation(self.dm, cp, iorie) ) */ __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_orientation, (&__pyx_v_norie), (&__pyx_v_iorie))); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_orientation, __pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/DMPlex.pyx":551 * if orientation is not None: * orientation = iarray_i(orientation, &norie, &iorie) * assert norie == ncone # <<<<<<<<<<<<<< * CHKERR( DMPlexSetConeOrientation(self.dm, cp, iorie) ) * */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_3 = (__pyx_v_norie == __pyx_v_ncone); if (unlikely(!__pyx_t_3)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(57, 551, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(57, 551, __pyx_L1_error) #endif /* "petsc4py/PETSc/DMPlex.pyx":552 * orientation = iarray_i(orientation, &norie, &iorie) * assert norie == ncone * CHKERR( DMPlexSetConeOrientation(self.dm, cp, iorie) ) # <<<<<<<<<<<<<< * * def insertCone(self, p: int, conePos: int, conePoint: int) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexSetConeOrientation(__pyx_v_self->__pyx_base.dm, __pyx_v_cp, __pyx_v_iorie)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 552, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":549 * cdef PetscInt norie = 0 * cdef PetscInt *iorie = NULL * if orientation is not None: # <<<<<<<<<<<<<< * orientation = iarray_i(orientation, &norie, &iorie) * assert norie == ncone */ } /* "petsc4py/PETSc/DMPlex.pyx":515 * return array_i(ncone, icone) * * def setCone(self, p: int, cone: Sequence[int], orientation: Sequence[int] | None = None) -> None: # <<<<<<<<<<<<<< * """Set the points on the in-edges for this point in the DAG. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.setCone", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_cone); __Pyx_XDECREF(__pyx_v_orientation); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":554 * CHKERR( DMPlexSetConeOrientation(self.dm, cp, iorie) ) * * def insertCone(self, p: int, conePos: int, conePoint: int) -> None: # <<<<<<<<<<<<<< * """DMPlexInsertCone - Insert a point into the in-edges for the point p in the DAG. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_35insertCone(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_34insertCone, "DMPlex.insertCone(self, p: int, conePos: int, conePoint: int) -> None\nDMPlexInsertCone - Insert a point into the in-edges for the point p in the DAG.\n\n Not collective.\n\n Parameters\n ----------\n p\n The point, which must lie in the chart set with `DMPlex.setChart`.\n conePos\n The local index in the cone where the point should be put.\n conePoint\n The mesh point to insert.\n\n See Also\n --------\n DM, DMPlex, DMPlex.create, DMPlex.getCone, DMPlex.setChart\n DMPlex.setConeSize, DM.setUp, petsc.DMPlexInsertCone\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:554"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_35insertCone(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_p = 0; PyObject *__pyx_v_conePos = 0; PyObject *__pyx_v_conePoint = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("insertCone (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_p,&__pyx_n_s_conePos,&__pyx_n_s_conePoint,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 554, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_conePos)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 554, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("insertCone", 1, 3, 3, 1); __PYX_ERR(57, 554, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_conePoint)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 554, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("insertCone", 1, 3, 3, 2); __PYX_ERR(57, 554, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "insertCone") < 0)) __PYX_ERR(57, 554, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_p = values[0]; __pyx_v_conePos = values[1]; __pyx_v_conePoint = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("insertCone", 1, 3, 3, __pyx_nargs); __PYX_ERR(57, 554, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.insertCone", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_34insertCone(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_p, __pyx_v_conePos, __pyx_v_conePoint); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_34insertCone(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p, PyObject *__pyx_v_conePos, PyObject *__pyx_v_conePoint) { PetscInt __pyx_v_cp; PetscInt __pyx_v_cconePos; PetscInt __pyx_v_cconePoint; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("insertCone", 1); /* "petsc4py/PETSc/DMPlex.pyx":574 * * """ * cdef PetscInt cp = asInt(p) # <<<<<<<<<<<<<< * cdef PetscInt cconePos = asInt(conePos) * cdef PetscInt cconePoint = asInt(conePoint) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_p); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(57, 574, __pyx_L1_error) __pyx_v_cp = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":575 * """ * cdef PetscInt cp = asInt(p) * cdef PetscInt cconePos = asInt(conePos) # <<<<<<<<<<<<<< * cdef PetscInt cconePoint = asInt(conePoint) * CHKERR( DMPlexInsertCone(self.dm,cp,cconePos,cconePoint) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_conePos); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(57, 575, __pyx_L1_error) __pyx_v_cconePos = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":576 * cdef PetscInt cp = asInt(p) * cdef PetscInt cconePos = asInt(conePos) * cdef PetscInt cconePoint = asInt(conePoint) # <<<<<<<<<<<<<< * CHKERR( DMPlexInsertCone(self.dm,cp,cconePos,cconePoint) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_conePoint); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(57, 576, __pyx_L1_error) __pyx_v_cconePoint = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":577 * cdef PetscInt cconePos = asInt(conePos) * cdef PetscInt cconePoint = asInt(conePoint) * CHKERR( DMPlexInsertCone(self.dm,cp,cconePos,cconePoint) ) # <<<<<<<<<<<<<< * * def insertConeOrientation(self, p: int, conePos: int, coneOrientation: int) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexInsertCone(__pyx_v_self->__pyx_base.dm, __pyx_v_cp, __pyx_v_cconePos, __pyx_v_cconePoint)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 577, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":554 * CHKERR( DMPlexSetConeOrientation(self.dm, cp, iorie) ) * * def insertCone(self, p: int, conePos: int, conePoint: int) -> None: # <<<<<<<<<<<<<< * """DMPlexInsertCone - Insert a point into the in-edges for the point p in the DAG. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.insertCone", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":579 * CHKERR( DMPlexInsertCone(self.dm,cp,cconePos,cconePoint) ) * * def insertConeOrientation(self, p: int, conePos: int, coneOrientation: int) -> None: # <<<<<<<<<<<<<< * """Insert a point orientation for the in-edge for the point p in the DAG. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_37insertConeOrientation(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_36insertConeOrientation, "DMPlex.insertConeOrientation(self, p: int, conePos: int, coneOrientation: int) -> None\nInsert a point orientation for the in-edge for the point p in the DAG.\n\n Not collective.\n\n Parameters\n ----------\n p\n The point, which must lie in the chart set with `DMPlex.setChart`\n conePos\n The local index in the cone where the point should be put.\n coneOrientation\n The point orientation to insert.\n\n See Also\n --------\n DM, DMPlex, DMPlex.create, DMPlex.getCone, DMPlex.setChart\n DMPlex.setConeSize, DM.setUp, petsc.DMPlexInsertConeOrientation\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:579"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_37insertConeOrientation(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_p = 0; PyObject *__pyx_v_conePos = 0; PyObject *__pyx_v_coneOrientation = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("insertConeOrientation (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_p,&__pyx_n_s_conePos,&__pyx_n_s_coneOrientation,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 579, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_conePos)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 579, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("insertConeOrientation", 1, 3, 3, 1); __PYX_ERR(57, 579, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_coneOrientation)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 579, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("insertConeOrientation", 1, 3, 3, 2); __PYX_ERR(57, 579, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "insertConeOrientation") < 0)) __PYX_ERR(57, 579, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_p = values[0]; __pyx_v_conePos = values[1]; __pyx_v_coneOrientation = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("insertConeOrientation", 1, 3, 3, __pyx_nargs); __PYX_ERR(57, 579, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.insertConeOrientation", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_36insertConeOrientation(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_p, __pyx_v_conePos, __pyx_v_coneOrientation); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_36insertConeOrientation(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p, PyObject *__pyx_v_conePos, PyObject *__pyx_v_coneOrientation) { PetscInt __pyx_v_cp; PetscInt __pyx_v_cconePos; PetscInt __pyx_v_cconeOrientation; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("insertConeOrientation", 1); /* "petsc4py/PETSc/DMPlex.pyx":599 * * """ * cdef PetscInt cp = asInt(p) # <<<<<<<<<<<<<< * cdef PetscInt cconePos = asInt(conePos) * cdef PetscInt cconeOrientation = asInt(coneOrientation) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_p); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(57, 599, __pyx_L1_error) __pyx_v_cp = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":600 * """ * cdef PetscInt cp = asInt(p) * cdef PetscInt cconePos = asInt(conePos) # <<<<<<<<<<<<<< * cdef PetscInt cconeOrientation = asInt(coneOrientation) * CHKERR( DMPlexInsertConeOrientation(self.dm, cp, cconePos, cconeOrientation) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_conePos); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(57, 600, __pyx_L1_error) __pyx_v_cconePos = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":601 * cdef PetscInt cp = asInt(p) * cdef PetscInt cconePos = asInt(conePos) * cdef PetscInt cconeOrientation = asInt(coneOrientation) # <<<<<<<<<<<<<< * CHKERR( DMPlexInsertConeOrientation(self.dm, cp, cconePos, cconeOrientation) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_coneOrientation); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(57, 601, __pyx_L1_error) __pyx_v_cconeOrientation = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":602 * cdef PetscInt cconePos = asInt(conePos) * cdef PetscInt cconeOrientation = asInt(coneOrientation) * CHKERR( DMPlexInsertConeOrientation(self.dm, cp, cconePos, cconeOrientation) ) # <<<<<<<<<<<<<< * * def getConeOrientation(self, p: int) -> ArrayInt: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexInsertConeOrientation(__pyx_v_self->__pyx_base.dm, __pyx_v_cp, __pyx_v_cconePos, __pyx_v_cconeOrientation)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 602, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":579 * CHKERR( DMPlexInsertCone(self.dm,cp,cconePos,cconePoint) ) * * def insertConeOrientation(self, p: int, conePos: int, coneOrientation: int) -> None: # <<<<<<<<<<<<<< * """Insert a point orientation for the in-edge for the point p in the DAG. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.insertConeOrientation", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":604 * CHKERR( DMPlexInsertConeOrientation(self.dm, cp, cconePos, cconeOrientation) ) * * def getConeOrientation(self, p: int) -> ArrayInt: # <<<<<<<<<<<<<< * """Return the orientations on the in-edges for this point in the DAG. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_39getConeOrientation(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_38getConeOrientation, "DMPlex.getConeOrientation(self, p: int) -> ArrayInt\nReturn the orientations on the in-edges for this point in the DAG.\n\n Not collective.\n\n Parameters\n ----------\n p\n The point, which must lie in the chart set with `DMPlex.setChart`.\n\n See Also\n --------\n DM, DMPlex, DMPlex.create, DMPlex.getCone, DMPlex.setCone\n DMPlex.setChart, petsc.DMPlexGetConeOrientation\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:604"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_39getConeOrientation(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_p = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getConeOrientation (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_p,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 604, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getConeOrientation") < 0)) __PYX_ERR(57, 604, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_p = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getConeOrientation", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 604, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getConeOrientation", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_38getConeOrientation(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_p); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_38getConeOrientation(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p) { PetscInt __pyx_v_cp; PetscInt __pyx_v_pStart; PetscInt __pyx_v_pEnd; PetscInt __pyx_v_norie; PetscInt const *__pyx_v_iorie; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getConeOrientation", 1); /* "petsc4py/PETSc/DMPlex.pyx":620 * * """ * cdef PetscInt cp = asInt(p) # <<<<<<<<<<<<<< * cdef PetscInt pStart = 0, pEnd = 0 * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_p); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(57, 620, __pyx_L1_error) __pyx_v_cp = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":621 * """ * cdef PetscInt cp = asInt(p) * cdef PetscInt pStart = 0, pEnd = 0 # <<<<<<<<<<<<<< * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) * assert cp>=pStart and cp=pStart and cp__pyx_base.dm, (&__pyx_v_pStart), (&__pyx_v_pEnd))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 622, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":623 * cdef PetscInt pStart = 0, pEnd = 0 * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) * assert cp>=pStart and cp= __pyx_v_pStart); if (__pyx_t_4) { } else { __pyx_t_3 = __pyx_t_4; goto __pyx_L3_bool_binop_done; } __pyx_t_4 = (__pyx_v_cp < __pyx_v_pEnd); __pyx_t_3 = __pyx_t_4; __pyx_L3_bool_binop_done:; if (unlikely(!__pyx_t_3)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(57, 623, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(57, 623, __pyx_L1_error) #endif /* "petsc4py/PETSc/DMPlex.pyx":624 * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) * assert cp>=pStart and cp=pStart and cp__pyx_base.dm, __pyx_v_cp, (&__pyx_v_norie))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 626, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":627 * cdef const PetscInt *iorie = NULL * CHKERR( DMPlexGetConeSize(self.dm, cp, &norie) ) * CHKERR( DMPlexGetConeOrientation(self.dm, cp, &iorie) ) # <<<<<<<<<<<<<< * return array_i(norie, iorie) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetConeOrientation(__pyx_v_self->__pyx_base.dm, __pyx_v_cp, (&__pyx_v_iorie))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 627, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":628 * CHKERR( DMPlexGetConeSize(self.dm, cp, &norie) ) * CHKERR( DMPlexGetConeOrientation(self.dm, cp, &iorie) ) * return array_i(norie, iorie) # <<<<<<<<<<<<<< * * def setConeOrientation(self, p: int, orientation: Sequence[int]) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i(__pyx_v_norie, __pyx_v_iorie)); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 628, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":604 * CHKERR( DMPlexInsertConeOrientation(self.dm, cp, cconePos, cconeOrientation) ) * * def getConeOrientation(self, p: int) -> ArrayInt: # <<<<<<<<<<<<<< * """Return the orientations on the in-edges for this point in the DAG. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getConeOrientation", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":630 * return array_i(norie, iorie) * * def setConeOrientation(self, p: int, orientation: Sequence[int]) -> None: # <<<<<<<<<<<<<< * """Set the orientations on the in-edges for this point in the DAG. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_41setConeOrientation(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_40setConeOrientation, "DMPlex.setConeOrientation(self, p: int, orientation: Sequence[int]) -> None\nSet the orientations on the in-edges for this point in the DAG.\n\n Not collective.\n\n Parameters\n ----------\n p\n The point, which must lie in the chart set with `DMPlex.setChart`.\n orientation\n An array of orientations.\n\n See Also\n --------\n DM, DMPlex, DMPlex.create, DMPlex.getConeOrientation, DMPlex.setCone\n DMPlex.setChart, DMPlex.setConeSize, DM.setUp\n petsc.DMPlexSetConeOrientation\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:630"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_41setConeOrientation(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_p = 0; PyObject *__pyx_v_orientation = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setConeOrientation (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_p,&__pyx_n_s_orientation,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 630, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_orientation)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 630, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setConeOrientation", 1, 2, 2, 1); __PYX_ERR(57, 630, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setConeOrientation") < 0)) __PYX_ERR(57, 630, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_p = values[0]; __pyx_v_orientation = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setConeOrientation", 1, 2, 2, __pyx_nargs); __PYX_ERR(57, 630, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.setConeOrientation", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_40setConeOrientation(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_p, __pyx_v_orientation); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_40setConeOrientation(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p, PyObject *__pyx_v_orientation) { PetscInt __pyx_v_cp; PetscInt __pyx_v_pStart; PetscInt __pyx_v_pEnd; PetscInt __pyx_v_ncone; PetscInt __pyx_v_norie; PetscInt *__pyx_v_iorie; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setConeOrientation", 0); __Pyx_INCREF(__pyx_v_orientation); /* "petsc4py/PETSc/DMPlex.pyx":649 * * """ * cdef PetscInt cp = asInt(p) # <<<<<<<<<<<<<< * cdef PetscInt pStart = 0, pEnd = 0 * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_p); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(57, 649, __pyx_L1_error) __pyx_v_cp = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":650 * """ * cdef PetscInt cp = asInt(p) * cdef PetscInt pStart = 0, pEnd = 0 # <<<<<<<<<<<<<< * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) * assert cp>=pStart and cp=pStart and cp__pyx_base.dm, (&__pyx_v_pStart), (&__pyx_v_pEnd))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 651, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":652 * cdef PetscInt pStart = 0, pEnd = 0 * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) * assert cp>=pStart and cp= __pyx_v_pStart); if (__pyx_t_4) { } else { __pyx_t_3 = __pyx_t_4; goto __pyx_L3_bool_binop_done; } __pyx_t_4 = (__pyx_v_cp < __pyx_v_pEnd); __pyx_t_3 = __pyx_t_4; __pyx_L3_bool_binop_done:; if (unlikely(!__pyx_t_3)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(57, 652, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(57, 652, __pyx_L1_error) #endif /* "petsc4py/PETSc/DMPlex.pyx":653 * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) * assert cp>=pStart and cp=pStart and cp__pyx_base.dm, __pyx_v_cp, (&__pyx_v_ncone))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 654, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":655 * cdef PetscInt ncone = 0 * CHKERR( DMPlexGetConeSize(self.dm, cp, &ncone) ) * cdef PetscInt norie = 0 # <<<<<<<<<<<<<< * cdef PetscInt *iorie = NULL * orientation = iarray_i(orientation, &norie, &iorie) */ __pyx_v_norie = 0; /* "petsc4py/PETSc/DMPlex.pyx":656 * CHKERR( DMPlexGetConeSize(self.dm, cp, &ncone) ) * cdef PetscInt norie = 0 * cdef PetscInt *iorie = NULL # <<<<<<<<<<<<<< * orientation = iarray_i(orientation, &norie, &iorie) * assert norie == ncone */ __pyx_v_iorie = NULL; /* "petsc4py/PETSc/DMPlex.pyx":657 * cdef PetscInt norie = 0 * cdef PetscInt *iorie = NULL * orientation = iarray_i(orientation, &norie, &iorie) # <<<<<<<<<<<<<< * assert norie == ncone * CHKERR( DMPlexSetConeOrientation(self.dm, cp, iorie) ) */ __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_orientation, (&__pyx_v_norie), (&__pyx_v_iorie))); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 657, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_orientation, __pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/DMPlex.pyx":658 * cdef PetscInt *iorie = NULL * orientation = iarray_i(orientation, &norie, &iorie) * assert norie == ncone # <<<<<<<<<<<<<< * CHKERR( DMPlexSetConeOrientation(self.dm, cp, iorie) ) * */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_3 = (__pyx_v_norie == __pyx_v_ncone); if (unlikely(!__pyx_t_3)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(57, 658, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(57, 658, __pyx_L1_error) #endif /* "petsc4py/PETSc/DMPlex.pyx":659 * orientation = iarray_i(orientation, &norie, &iorie) * assert norie == ncone * CHKERR( DMPlexSetConeOrientation(self.dm, cp, iorie) ) # <<<<<<<<<<<<<< * * def setCellType(self, p: int, ctype: DM.PolytopeType) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexSetConeOrientation(__pyx_v_self->__pyx_base.dm, __pyx_v_cp, __pyx_v_iorie)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 659, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":630 * return array_i(norie, iorie) * * def setConeOrientation(self, p: int, orientation: Sequence[int]) -> None: # <<<<<<<<<<<<<< * """Set the orientations on the in-edges for this point in the DAG. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.setConeOrientation", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_orientation); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":661 * CHKERR( DMPlexSetConeOrientation(self.dm, cp, iorie) ) * * def setCellType(self, p: int, ctype: DM.PolytopeType) -> None: # <<<<<<<<<<<<<< * """Set the polytope type of a given cell. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_43setCellType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_42setCellType, "DMPlex.setCellType(self, p: int, ctype: DM.PolytopeType) -> None\nSet the polytope type of a given cell.\n\n Not collective.\n\n Parameters\n ----------\n p\n The cell.\n ctype\n The polytope type of the cell.\n\n See Also\n --------\n DM, DMPlex, DMPlex.getCellTypeLabel, DMPlex.getDepth, DM.createLabel\n petsc.DMPlexSetCellType\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:661"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_43setCellType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_p = 0; PyObject *__pyx_v_ctype = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setCellType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_p,&__pyx_n_s_ctype,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 661, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ctype)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 661, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setCellType", 1, 2, 2, 1); __PYX_ERR(57, 661, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setCellType") < 0)) __PYX_ERR(57, 661, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_p = values[0]; __pyx_v_ctype = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setCellType", 1, 2, 2, __pyx_nargs); __PYX_ERR(57, 661, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.setCellType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_42setCellType(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_p, __pyx_v_ctype); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_42setCellType(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p, PyObject *__pyx_v_ctype) { PetscInt __pyx_v_cp; DMPolytopeType __pyx_v_val; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; DMPolytopeType __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setCellType", 1); /* "petsc4py/PETSc/DMPlex.pyx":679 * * """ * cdef PetscInt cp = asInt(p) # <<<<<<<<<<<<<< * cdef PetscDMPolytopeType val = ctype * CHKERR( DMPlexSetCellType(self.dm, cp, val) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_p); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(57, 679, __pyx_L1_error) __pyx_v_cp = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":680 * """ * cdef PetscInt cp = asInt(p) * cdef PetscDMPolytopeType val = ctype # <<<<<<<<<<<<<< * CHKERR( DMPlexSetCellType(self.dm, cp, val) ) * */ __pyx_t_2 = ((DMPolytopeType)__Pyx_PyInt_As_DMPolytopeType(__pyx_v_ctype)); if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 680, __pyx_L1_error) __pyx_v_val = __pyx_t_2; /* "petsc4py/PETSc/DMPlex.pyx":681 * cdef PetscInt cp = asInt(p) * cdef PetscDMPolytopeType val = ctype * CHKERR( DMPlexSetCellType(self.dm, cp, val) ) # <<<<<<<<<<<<<< * * def getCellType(self, p: int) -> DM.PolytopeType: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexSetCellType(__pyx_v_self->__pyx_base.dm, __pyx_v_cp, __pyx_v_val)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 681, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":661 * CHKERR( DMPlexSetConeOrientation(self.dm, cp, iorie) ) * * def setCellType(self, p: int, ctype: DM.PolytopeType) -> None: # <<<<<<<<<<<<<< * """Set the polytope type of a given cell. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.setCellType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":683 * CHKERR( DMPlexSetCellType(self.dm, cp, val) ) * * def getCellType(self, p: int) -> DM.PolytopeType: # <<<<<<<<<<<<<< * """Return the polytope type of a given cell. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_45getCellType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_44getCellType, "DMPlex.getCellType(self, p: int) -> DM.PolytopeType\nReturn the polytope type of a given cell.\n\n Not collective.\n\n Parameters\n ----------\n p\n The cell.\n\n See Also\n --------\n DM, DMPlex, DM.PolytopeType, DMPlex.getCellTypeLabel, DMPlex.getDepth\n petsc.DMPlexGetCellType\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:683"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_45getCellType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_p = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getCellType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_p,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 683, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getCellType") < 0)) __PYX_ERR(57, 683, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_p = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getCellType", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 683, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getCellType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_44getCellType(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_p); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_44getCellType(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p) { PetscInt __pyx_v_cp; DMPolytopeType __pyx_v_ctype; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getCellType", 1); /* "petsc4py/PETSc/DMPlex.pyx":699 * * """ * cdef PetscInt cp = asInt(p) # <<<<<<<<<<<<<< * cdef PetscDMPolytopeType ctype = DM_POLYTOPE_UNKNOWN * CHKERR( DMPlexGetCellType(self.dm, cp, &ctype) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_p); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(57, 699, __pyx_L1_error) __pyx_v_cp = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":700 * """ * cdef PetscInt cp = asInt(p) * cdef PetscDMPolytopeType ctype = DM_POLYTOPE_UNKNOWN # <<<<<<<<<<<<<< * CHKERR( DMPlexGetCellType(self.dm, cp, &ctype) ) * return toInt(ctype) */ __pyx_v_ctype = DM_POLYTOPE_UNKNOWN; /* "petsc4py/PETSc/DMPlex.pyx":701 * cdef PetscInt cp = asInt(p) * cdef PetscDMPolytopeType ctype = DM_POLYTOPE_UNKNOWN * CHKERR( DMPlexGetCellType(self.dm, cp, &ctype) ) # <<<<<<<<<<<<<< * return toInt(ctype) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetCellType(__pyx_v_self->__pyx_base.dm, __pyx_v_cp, (&__pyx_v_ctype))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 701, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":702 * cdef PetscDMPolytopeType ctype = DM_POLYTOPE_UNKNOWN * CHKERR( DMPlexGetCellType(self.dm, cp, &ctype) ) * return toInt(ctype) # <<<<<<<<<<<<<< * * def getCellTypeLabel(self) -> DMLabel: */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ctype); if (unlikely(!__pyx_t_3)) __PYX_ERR(57, 702, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":683 * CHKERR( DMPlexSetCellType(self.dm, cp, val) ) * * def getCellType(self, p: int) -> DM.PolytopeType: # <<<<<<<<<<<<<< * """Return the polytope type of a given cell. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getCellType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":704 * return toInt(ctype) * * def getCellTypeLabel(self) -> DMLabel: # <<<<<<<<<<<<<< * """Return the `DMLabel` recording the polytope type of each cell. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_47getCellTypeLabel(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_46getCellTypeLabel, "DMPlex.getCellTypeLabel(self) -> DMLabel\nReturn the `DMLabel` recording the polytope type of each cell.\n\n Not collective.\n\n See Also\n --------\n DM, DMPlex, DMPlex.getCellType, DM.createLabel\n petsc.DMPlexGetCellTypeLabel\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:704"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_47getCellTypeLabel(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getCellTypeLabel (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getCellTypeLabel", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getCellTypeLabel", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_46getCellTypeLabel(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_46getCellTypeLabel(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self) { struct PyPetscDMLabelObject *__pyx_v_label = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getCellTypeLabel", 1); /* "petsc4py/PETSc/DMPlex.pyx":715 * * """ * cdef DMLabel label = DMLabel() # <<<<<<<<<<<<<< * CHKERR( DMPlexGetCellTypeLabel(self.dm, &label.dmlabel) ) * CHKERR( PetscINCREF(label.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DMLabel)); if (unlikely(!__pyx_t_1)) __PYX_ERR(57, 715, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_label = ((struct PyPetscDMLabelObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DMPlex.pyx":716 * """ * cdef DMLabel label = DMLabel() * CHKERR( DMPlexGetCellTypeLabel(self.dm, &label.dmlabel) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(label.obj) ) * return label */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetCellTypeLabel(__pyx_v_self->__pyx_base.dm, (&__pyx_v_label->dmlabel))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 716, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":717 * cdef DMLabel label = DMLabel() * CHKERR( DMPlexGetCellTypeLabel(self.dm, &label.dmlabel) ) * CHKERR( PetscINCREF(label.obj) ) # <<<<<<<<<<<<<< * return label * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_label->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 717, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":718 * CHKERR( DMPlexGetCellTypeLabel(self.dm, &label.dmlabel) ) * CHKERR( PetscINCREF(label.obj) ) * return label # <<<<<<<<<<<<<< * * def getSupportSize(self, p: int) -> int: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_label); __pyx_r = ((PyObject *)__pyx_v_label); goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":704 * return toInt(ctype) * * def getCellTypeLabel(self) -> DMLabel: # <<<<<<<<<<<<<< * """Return the `DMLabel` recording the polytope type of each cell. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getCellTypeLabel", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_label); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":720 * return label * * def getSupportSize(self, p: int) -> int: # <<<<<<<<<<<<<< * """Return the number of out-edges for this point in the DAG. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_49getSupportSize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_48getSupportSize, "DMPlex.getSupportSize(self, p: int) -> int\nReturn the number of out-edges for this point in the DAG.\n\n Not collective.\n\n Parameters\n ----------\n p\n The point, which must lie in the chart set with `DMPlex.setChart`.\n\n See Also\n --------\n DM, DMPlex, DMPlex.create, DMPlex.setConeSize, DMPlex.setChart\n DMPlex.getConeSize, petsc.DMPlexGetSupportSize\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:720"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_49getSupportSize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_p = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSupportSize (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_p,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 720, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getSupportSize") < 0)) __PYX_ERR(57, 720, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_p = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getSupportSize", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 720, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getSupportSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_48getSupportSize(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_p); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_48getSupportSize(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p) { PetscInt __pyx_v_cp; PetscInt __pyx_v_pStart; PetscInt __pyx_v_pEnd; PetscInt __pyx_v_ssize; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSupportSize", 1); /* "petsc4py/PETSc/DMPlex.pyx":736 * * """ * cdef PetscInt cp = asInt(p) # <<<<<<<<<<<<<< * cdef PetscInt pStart = 0, pEnd = 0 * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_p); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(57, 736, __pyx_L1_error) __pyx_v_cp = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":737 * """ * cdef PetscInt cp = asInt(p) * cdef PetscInt pStart = 0, pEnd = 0 # <<<<<<<<<<<<<< * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) * assert cp>=pStart and cp=pStart and cp__pyx_base.dm, (&__pyx_v_pStart), (&__pyx_v_pEnd))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 738, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":739 * cdef PetscInt pStart = 0, pEnd = 0 * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) * assert cp>=pStart and cp= __pyx_v_pStart); if (__pyx_t_4) { } else { __pyx_t_3 = __pyx_t_4; goto __pyx_L3_bool_binop_done; } __pyx_t_4 = (__pyx_v_cp < __pyx_v_pEnd); __pyx_t_3 = __pyx_t_4; __pyx_L3_bool_binop_done:; if (unlikely(!__pyx_t_3)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(57, 739, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(57, 739, __pyx_L1_error) #endif /* "petsc4py/PETSc/DMPlex.pyx":740 * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) * assert cp>=pStart and cp=pStart and cp__pyx_base.dm, __pyx_v_cp, (&__pyx_v_ssize))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 741, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":742 * cdef PetscInt ssize = 0 * CHKERR( DMPlexGetSupportSize(self.dm, cp, &ssize) ) * return toInt(ssize) # <<<<<<<<<<<<<< * * def setSupportSize(self, p: int, size: int) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ssize); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 742, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":720 * return label * * def getSupportSize(self, p: int) -> int: # <<<<<<<<<<<<<< * """Return the number of out-edges for this point in the DAG. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getSupportSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":744 * return toInt(ssize) * * def setSupportSize(self, p: int, size: int) -> None: # <<<<<<<<<<<<<< * """Set the number of out-edges for this point in the DAG. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_51setSupportSize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_50setSupportSize, "DMPlex.setSupportSize(self, p: int, size: int) -> None\nSet the number of out-edges for this point in the DAG.\n\n Not collective.\n\n Parameters\n ----------\n p\n The point, which must lie in the chart set with `DMPlex.setChart`.\n size\n The support size for point ``p``.\n\n See Also\n --------\n DM, DMPlex, DMPlex.create, DMPlex.getSupportSize, DMPlex.setChart\n petsc.DMPlexSetSupportSize\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:744"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_51setSupportSize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_p = 0; PyObject *__pyx_v_size = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setSupportSize (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_p,&__pyx_n_s_size,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 744, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 744, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setSupportSize", 1, 2, 2, 1); __PYX_ERR(57, 744, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setSupportSize") < 0)) __PYX_ERR(57, 744, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_p = values[0]; __pyx_v_size = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setSupportSize", 1, 2, 2, __pyx_nargs); __PYX_ERR(57, 744, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.setSupportSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_50setSupportSize(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_p, __pyx_v_size); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_50setSupportSize(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p, PyObject *__pyx_v_size) { PetscInt __pyx_v_cp; PetscInt __pyx_v_pStart; PetscInt __pyx_v_pEnd; PetscInt __pyx_v_ssize; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setSupportSize", 1); /* "petsc4py/PETSc/DMPlex.pyx":762 * * """ * cdef PetscInt cp = asInt(p) # <<<<<<<<<<<<<< * cdef PetscInt pStart = 0, pEnd = 0 * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_p); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(57, 762, __pyx_L1_error) __pyx_v_cp = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":763 * """ * cdef PetscInt cp = asInt(p) * cdef PetscInt pStart = 0, pEnd = 0 # <<<<<<<<<<<<<< * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) * assert cp>=pStart and cp=pStart and cp__pyx_base.dm, (&__pyx_v_pStart), (&__pyx_v_pEnd))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 764, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":765 * cdef PetscInt pStart = 0, pEnd = 0 * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) * assert cp>=pStart and cp= __pyx_v_pStart); if (__pyx_t_4) { } else { __pyx_t_3 = __pyx_t_4; goto __pyx_L3_bool_binop_done; } __pyx_t_4 = (__pyx_v_cp < __pyx_v_pEnd); __pyx_t_3 = __pyx_t_4; __pyx_L3_bool_binop_done:; if (unlikely(!__pyx_t_3)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(57, 765, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(57, 765, __pyx_L1_error) #endif /* "petsc4py/PETSc/DMPlex.pyx":766 * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) * assert cp>=pStart and cp=pStart and cp ArrayInt: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexSetSupportSize(__pyx_v_self->__pyx_base.dm, __pyx_v_cp, __pyx_v_ssize)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 767, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":744 * return toInt(ssize) * * def setSupportSize(self, p: int, size: int) -> None: # <<<<<<<<<<<<<< * """Set the number of out-edges for this point in the DAG. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.setSupportSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":769 * CHKERR( DMPlexSetSupportSize(self.dm, cp, ssize) ) * * def getSupport(self, p: int) -> ArrayInt: # <<<<<<<<<<<<<< * """Return the points on the out-edges for this point in the DAG. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_53getSupport(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_52getSupport, "DMPlex.getSupport(self, p: int) -> ArrayInt\nReturn the points on the out-edges for this point in the DAG.\n\n Not collective.\n\n Parameters\n ----------\n p\n The point, which must lie in the chart set with `DMPlex.setChart`.\n\n See Also\n --------\n DM, DMPlex, DMPlex.getSupportSize, DMPlex.setSupport, DMPlex.getCone\n DMPlex.setChart, petsc.DMPlexGetSupport\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:769"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_53getSupport(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_p = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSupport (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_p,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 769, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getSupport") < 0)) __PYX_ERR(57, 769, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_p = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getSupport", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 769, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getSupport", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_52getSupport(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_p); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_52getSupport(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p) { PetscInt __pyx_v_cp; PetscInt __pyx_v_pStart; PetscInt __pyx_v_pEnd; PetscInt __pyx_v_nsupp; PetscInt const *__pyx_v_isupp; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSupport", 1); /* "petsc4py/PETSc/DMPlex.pyx":785 * * """ * cdef PetscInt cp = asInt(p) # <<<<<<<<<<<<<< * cdef PetscInt pStart = 0, pEnd = 0 * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_p); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(57, 785, __pyx_L1_error) __pyx_v_cp = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":786 * """ * cdef PetscInt cp = asInt(p) * cdef PetscInt pStart = 0, pEnd = 0 # <<<<<<<<<<<<<< * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) * assert cp>=pStart and cp=pStart and cp__pyx_base.dm, (&__pyx_v_pStart), (&__pyx_v_pEnd))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 787, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":788 * cdef PetscInt pStart = 0, pEnd = 0 * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) * assert cp>=pStart and cp= __pyx_v_pStart); if (__pyx_t_4) { } else { __pyx_t_3 = __pyx_t_4; goto __pyx_L3_bool_binop_done; } __pyx_t_4 = (__pyx_v_cp < __pyx_v_pEnd); __pyx_t_3 = __pyx_t_4; __pyx_L3_bool_binop_done:; if (unlikely(!__pyx_t_3)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(57, 788, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(57, 788, __pyx_L1_error) #endif /* "petsc4py/PETSc/DMPlex.pyx":789 * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) * assert cp>=pStart and cp=pStart and cp__pyx_base.dm, __pyx_v_cp, (&__pyx_v_nsupp))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 791, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":792 * cdef const PetscInt *isupp = NULL * CHKERR( DMPlexGetSupportSize(self.dm, cp, &nsupp) ) * CHKERR( DMPlexGetSupport(self.dm, cp, &isupp) ) # <<<<<<<<<<<<<< * return array_i(nsupp, isupp) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetSupport(__pyx_v_self->__pyx_base.dm, __pyx_v_cp, (&__pyx_v_isupp))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 792, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":793 * CHKERR( DMPlexGetSupportSize(self.dm, cp, &nsupp) ) * CHKERR( DMPlexGetSupport(self.dm, cp, &isupp) ) * return array_i(nsupp, isupp) # <<<<<<<<<<<<<< * * def setSupport(self, p: int, supp: Sequence[int]) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i(__pyx_v_nsupp, __pyx_v_isupp)); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 793, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":769 * CHKERR( DMPlexSetSupportSize(self.dm, cp, ssize) ) * * def getSupport(self, p: int) -> ArrayInt: # <<<<<<<<<<<<<< * """Return the points on the out-edges for this point in the DAG. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getSupport", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":795 * return array_i(nsupp, isupp) * * def setSupport(self, p: int, supp: Sequence[int]) -> None: # <<<<<<<<<<<<<< * """Set the points on the out-edges for this point in the DAG. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_55setSupport(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_54setSupport, "DMPlex.setSupport(self, p: int, supp: Sequence[int]) -> None\nSet the points on the out-edges for this point in the DAG.\n\n Not collective.\n\n Parameters\n ----------\n p\n The point, which must lie in the chart set with `DMPlex.setChart`.\n supp\n An array of points which are on the out-edges for point ``p``.\n\n See Also\n --------\n DM, DMPlex, DMPlex.setCone, DMPlex.setConeSize, DMPlex.create\n DMPlex.getSupport, DMPlex.setChart, DMPlex.setSupportSize, DM.setUp\n petsc.DMPlexSetSupport\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:795"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_55setSupport(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_p = 0; PyObject *__pyx_v_supp = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setSupport (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_p,&__pyx_n_s_supp,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 795, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_supp)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 795, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setSupport", 1, 2, 2, 1); __PYX_ERR(57, 795, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setSupport") < 0)) __PYX_ERR(57, 795, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_p = values[0]; __pyx_v_supp = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setSupport", 1, 2, 2, __pyx_nargs); __PYX_ERR(57, 795, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.setSupport", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_54setSupport(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_p, __pyx_v_supp); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_54setSupport(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p, PyObject *__pyx_v_supp) { PetscInt __pyx_v_cp; PetscInt __pyx_v_pStart; PetscInt __pyx_v_pEnd; PetscInt __pyx_v_nsupp; PetscInt *__pyx_v_isupp; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setSupport", 0); __Pyx_INCREF(__pyx_v_supp); /* "petsc4py/PETSc/DMPlex.pyx":814 * * """ * cdef PetscInt cp = asInt(p) # <<<<<<<<<<<<<< * cdef PetscInt pStart = 0, pEnd = 0 * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_p); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(57, 814, __pyx_L1_error) __pyx_v_cp = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":815 * """ * cdef PetscInt cp = asInt(p) * cdef PetscInt pStart = 0, pEnd = 0 # <<<<<<<<<<<<<< * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) * assert cp>=pStart and cp=pStart and cp__pyx_base.dm, (&__pyx_v_pStart), (&__pyx_v_pEnd))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 816, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":817 * cdef PetscInt pStart = 0, pEnd = 0 * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) * assert cp>=pStart and cp= __pyx_v_pStart); if (__pyx_t_4) { } else { __pyx_t_3 = __pyx_t_4; goto __pyx_L3_bool_binop_done; } __pyx_t_4 = (__pyx_v_cp < __pyx_v_pEnd); __pyx_t_3 = __pyx_t_4; __pyx_L3_bool_binop_done:; if (unlikely(!__pyx_t_3)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(57, 817, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(57, 817, __pyx_L1_error) #endif /* "petsc4py/PETSc/DMPlex.pyx":818 * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) * assert cp>=pStart and cp=pStart and cp__pyx_base.dm, __pyx_v_cp, __pyx_v_nsupp)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 821, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":822 * supp = iarray_i(supp, &nsupp, &isupp) * CHKERR( DMPlexSetSupportSize(self.dm, cp, nsupp) ) * CHKERR( DMPlexSetSupport(self.dm, cp, isupp) ) # <<<<<<<<<<<<<< * * def getMaxSizes(self) -> tuple[int, int]: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexSetSupport(__pyx_v_self->__pyx_base.dm, __pyx_v_cp, __pyx_v_isupp)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 822, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":795 * return array_i(nsupp, isupp) * * def setSupport(self, p: int, supp: Sequence[int]) -> None: # <<<<<<<<<<<<<< * """Set the points on the out-edges for this point in the DAG. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.setSupport", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_supp); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":824 * CHKERR( DMPlexSetSupport(self.dm, cp, isupp) ) * * def getMaxSizes(self) -> tuple[int, int]: # <<<<<<<<<<<<<< * """Return the maximum number of in-edges and out-edges of the DAG. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_57getMaxSizes(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_56getMaxSizes, "DMPlex.getMaxSizes(self) -> tuple[int, int]\nReturn the maximum number of in-edges and out-edges of the DAG.\n\n Not collective.\n\n Returns\n -------\n maxConeSize : int\n The maximum number of in-edges.\n maxSupportSize : int\n The maximum number of out-edges.\n\n See Also\n --------\n DM, DMPlex, DMPlex.create, DMPlex.setConeSize, DMPlex.setChart\n petsc.DMPlexGetMaxSizes\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:824"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_57getMaxSizes(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getMaxSizes (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getMaxSizes", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getMaxSizes", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_56getMaxSizes(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_56getMaxSizes(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self) { PetscInt __pyx_v_maxConeSize; PetscInt __pyx_v_maxSupportSize; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getMaxSizes", 1); /* "petsc4py/PETSc/DMPlex.pyx":842 * * """ * cdef PetscInt maxConeSize = 0, maxSupportSize = 0 # <<<<<<<<<<<<<< * CHKERR( DMPlexGetMaxSizes(self.dm, &maxConeSize, &maxSupportSize) ) * return toInt(maxConeSize), toInt(maxSupportSize) */ __pyx_v_maxConeSize = 0; __pyx_v_maxSupportSize = 0; /* "petsc4py/PETSc/DMPlex.pyx":843 * """ * cdef PetscInt maxConeSize = 0, maxSupportSize = 0 * CHKERR( DMPlexGetMaxSizes(self.dm, &maxConeSize, &maxSupportSize) ) # <<<<<<<<<<<<<< * return toInt(maxConeSize), toInt(maxSupportSize) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetMaxSizes(__pyx_v_self->__pyx_base.dm, (&__pyx_v_maxConeSize), (&__pyx_v_maxSupportSize))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 843, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":844 * cdef PetscInt maxConeSize = 0, maxSupportSize = 0 * CHKERR( DMPlexGetMaxSizes(self.dm, &maxConeSize, &maxSupportSize) ) * return toInt(maxConeSize), toInt(maxSupportSize) # <<<<<<<<<<<<<< * * def symmetrize(self) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_maxConeSize); if (unlikely(!__pyx_t_2)) __PYX_ERR(57, 844, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_maxSupportSize); if (unlikely(!__pyx_t_3)) __PYX_ERR(57, 844, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 844, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(57, 844, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(57, 844, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":824 * CHKERR( DMPlexSetSupport(self.dm, cp, isupp) ) * * def getMaxSizes(self) -> tuple[int, int]: # <<<<<<<<<<<<<< * """Return the maximum number of in-edges and out-edges of the DAG. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getMaxSizes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":846 * return toInt(maxConeSize), toInt(maxSupportSize) * * def symmetrize(self) -> None: # <<<<<<<<<<<<<< * """Create support (out-edge) information from cone (in-edge) information. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_59symmetrize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_58symmetrize, "DMPlex.symmetrize(self) -> None\nCreate support (out-edge) information from cone (in-edge) information.\n\n Not collective.\n\n See Also\n --------\n DM, DMPlex, DMPlex.create, DMPlex.setChart, DMPlex.setConeSize\n DMPlex.setCone, petsc.DMPlexSymmetrize\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:846"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_59symmetrize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("symmetrize (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("symmetrize", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "symmetrize", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_58symmetrize(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_58symmetrize(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("symmetrize", 1); /* "petsc4py/PETSc/DMPlex.pyx":857 * * """ * CHKERR( DMPlexSymmetrize(self.dm) ) # <<<<<<<<<<<<<< * * def stratify(self) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexSymmetrize(__pyx_v_self->__pyx_base.dm)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 857, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":846 * return toInt(maxConeSize), toInt(maxSupportSize) * * def symmetrize(self) -> None: # <<<<<<<<<<<<<< * """Create support (out-edge) information from cone (in-edge) information. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.symmetrize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":859 * CHKERR( DMPlexSymmetrize(self.dm) ) * * def stratify(self) -> None: # <<<<<<<<<<<<<< * """Calculate the strata of DAG. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_61stratify(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_60stratify, "DMPlex.stratify(self) -> None\nCalculate the strata of DAG.\n\n Collective.\n\n See Also\n --------\n DM, DMPlex, DMPlex.create, DMPlex.symmetrize, petsc.DMPlexStratify\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:859"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_61stratify(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("stratify (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("stratify", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "stratify", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_60stratify(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_60stratify(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("stratify", 1); /* "petsc4py/PETSc/DMPlex.pyx":869 * * """ * CHKERR( DMPlexStratify(self.dm) ) # <<<<<<<<<<<<<< * * def orient(self) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexStratify(__pyx_v_self->__pyx_base.dm)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 869, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":859 * CHKERR( DMPlexSymmetrize(self.dm) ) * * def stratify(self) -> None: # <<<<<<<<<<<<<< * """Calculate the strata of DAG. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.stratify", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":871 * CHKERR( DMPlexStratify(self.dm) ) * * def orient(self) -> None: # <<<<<<<<<<<<<< * """Give a consistent orientation to the input mesh. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_63orient(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_62orient, "DMPlex.orient(self) -> None\nGive a consistent orientation to the input mesh.\n\n See Also\n --------\n DM, DMPlex, DM.create, petsc.DMPlexOrient\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:871"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_63orient(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("orient (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("orient", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "orient", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_62orient(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_62orient(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("orient", 1); /* "petsc4py/PETSc/DMPlex.pyx":879 * * """ * CHKERR( DMPlexOrient(self.dm) ) # <<<<<<<<<<<<<< * * def getCellNumbering(self) -> IS: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexOrient(__pyx_v_self->__pyx_base.dm)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 879, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":871 * CHKERR( DMPlexStratify(self.dm) ) * * def orient(self) -> None: # <<<<<<<<<<<<<< * """Give a consistent orientation to the input mesh. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.orient", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":881 * CHKERR( DMPlexOrient(self.dm) ) * * def getCellNumbering(self) -> IS: # <<<<<<<<<<<<<< * """Return a global cell numbering for all cells on this process. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_65getCellNumbering(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_64getCellNumbering, "DMPlex.getCellNumbering(self) -> IS\nReturn a global cell numbering for all cells on this process.\n\n See Also\n --------\n DM, DMPlex, DMPlex.getVertexNumbering, petsc.DMPlexGetCellNumbering\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:881"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_65getCellNumbering(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getCellNumbering (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getCellNumbering", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getCellNumbering", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_64getCellNumbering(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_64getCellNumbering(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self) { struct PyPetscISObject *__pyx_v_iset = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getCellNumbering", 1); /* "petsc4py/PETSc/DMPlex.pyx":889 * * """ * cdef IS iset = IS() # <<<<<<<<<<<<<< * CHKERR( DMPlexGetCellNumbering(self.dm, &iset.iset) ) * CHKERR( PetscINCREF(iset.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_1)) __PYX_ERR(57, 889, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_iset = ((struct PyPetscISObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DMPlex.pyx":890 * """ * cdef IS iset = IS() * CHKERR( DMPlexGetCellNumbering(self.dm, &iset.iset) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(iset.obj) ) * return iset */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetCellNumbering(__pyx_v_self->__pyx_base.dm, (&__pyx_v_iset->iset))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 890, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":891 * cdef IS iset = IS() * CHKERR( DMPlexGetCellNumbering(self.dm, &iset.iset) ) * CHKERR( PetscINCREF(iset.obj) ) # <<<<<<<<<<<<<< * return iset * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_iset->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 891, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":892 * CHKERR( DMPlexGetCellNumbering(self.dm, &iset.iset) ) * CHKERR( PetscINCREF(iset.obj) ) * return iset # <<<<<<<<<<<<<< * * def getVertexNumbering(self) -> IS: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_iset); __pyx_r = ((PyObject *)__pyx_v_iset); goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":881 * CHKERR( DMPlexOrient(self.dm) ) * * def getCellNumbering(self) -> IS: # <<<<<<<<<<<<<< * """Return a global cell numbering for all cells on this process. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getCellNumbering", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_iset); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":894 * return iset * * def getVertexNumbering(self) -> IS: # <<<<<<<<<<<<<< * """Return a global vertex numbering for all vertices on this process. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_67getVertexNumbering(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_66getVertexNumbering, "DMPlex.getVertexNumbering(self) -> IS\nReturn a global vertex numbering for all vertices on this process.\n\n See Also\n --------\n DM, DMPlex, DMPlex.getCellNumbering, petsc.DMPlexGetVertexNumbering\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:894"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_67getVertexNumbering(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getVertexNumbering (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getVertexNumbering", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getVertexNumbering", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_66getVertexNumbering(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_66getVertexNumbering(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self) { struct PyPetscISObject *__pyx_v_iset = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getVertexNumbering", 1); /* "petsc4py/PETSc/DMPlex.pyx":902 * * """ * cdef IS iset = IS() # <<<<<<<<<<<<<< * CHKERR( DMPlexGetVertexNumbering(self.dm, &iset.iset) ) * CHKERR( PetscINCREF(iset.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_1)) __PYX_ERR(57, 902, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_iset = ((struct PyPetscISObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DMPlex.pyx":903 * """ * cdef IS iset = IS() * CHKERR( DMPlexGetVertexNumbering(self.dm, &iset.iset) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(iset.obj) ) * return iset */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetVertexNumbering(__pyx_v_self->__pyx_base.dm, (&__pyx_v_iset->iset))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 903, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":904 * cdef IS iset = IS() * CHKERR( DMPlexGetVertexNumbering(self.dm, &iset.iset) ) * CHKERR( PetscINCREF(iset.obj) ) # <<<<<<<<<<<<<< * return iset * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_iset->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 904, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":905 * CHKERR( DMPlexGetVertexNumbering(self.dm, &iset.iset) ) * CHKERR( PetscINCREF(iset.obj) ) * return iset # <<<<<<<<<<<<<< * * def createPointNumbering(self) -> IS: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_iset); __pyx_r = ((PyObject *)__pyx_v_iset); goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":894 * return iset * * def getVertexNumbering(self) -> IS: # <<<<<<<<<<<<<< * """Return a global vertex numbering for all vertices on this process. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getVertexNumbering", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_iset); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":907 * return iset * * def createPointNumbering(self) -> IS: # <<<<<<<<<<<<<< * """Create a global numbering for all points. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_69createPointNumbering(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_68createPointNumbering, "DMPlex.createPointNumbering(self) -> IS\nCreate a global numbering for all points.\n\n Collective.\n\n See Also\n --------\n DM, DMPlex, DMPlex.getCellNumbering, petsc.DMPlexCreatePointNumbering\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:907"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_69createPointNumbering(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createPointNumbering (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("createPointNumbering", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "createPointNumbering", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_68createPointNumbering(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_68createPointNumbering(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self) { struct PyPetscISObject *__pyx_v_iset = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createPointNumbering", 1); /* "petsc4py/PETSc/DMPlex.pyx":917 * * """ * cdef IS iset = IS() # <<<<<<<<<<<<<< * CHKERR( DMPlexCreatePointNumbering(self.dm, &iset.iset) ) * return iset */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_1)) __PYX_ERR(57, 917, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_iset = ((struct PyPetscISObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DMPlex.pyx":918 * """ * cdef IS iset = IS() * CHKERR( DMPlexCreatePointNumbering(self.dm, &iset.iset) ) # <<<<<<<<<<<<<< * return iset * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexCreatePointNumbering(__pyx_v_self->__pyx_base.dm, (&__pyx_v_iset->iset))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 918, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":919 * cdef IS iset = IS() * CHKERR( DMPlexCreatePointNumbering(self.dm, &iset.iset) ) * return iset # <<<<<<<<<<<<<< * * def getDepth(self) -> int: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_iset); __pyx_r = ((PyObject *)__pyx_v_iset); goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":907 * return iset * * def createPointNumbering(self) -> IS: # <<<<<<<<<<<<<< * """Create a global numbering for all points. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.createPointNumbering", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_iset); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":921 * return iset * * def getDepth(self) -> int: # <<<<<<<<<<<<<< * """Return the depth of the DAG representing this mesh. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_71getDepth(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_70getDepth, "DMPlex.getDepth(self) -> int\nReturn the depth of the DAG representing this mesh.\n\n Not collective.\n\n See Also\n --------\n DM, DMPlex, DMPlex.getDepthStratum, DMPlex.symmetrize\n petsc.DMPlexGetDepth\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:921"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_71getDepth(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getDepth (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getDepth", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getDepth", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_70getDepth(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_70getDepth(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self) { PetscInt __pyx_v_depth; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getDepth", 1); /* "petsc4py/PETSc/DMPlex.pyx":932 * * """ * cdef PetscInt depth = 0 # <<<<<<<<<<<<<< * CHKERR( DMPlexGetDepth(self.dm,&depth) ) * return toInt(depth) */ __pyx_v_depth = 0; /* "petsc4py/PETSc/DMPlex.pyx":933 * """ * cdef PetscInt depth = 0 * CHKERR( DMPlexGetDepth(self.dm,&depth) ) # <<<<<<<<<<<<<< * return toInt(depth) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetDepth(__pyx_v_self->__pyx_base.dm, (&__pyx_v_depth))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 933, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":934 * cdef PetscInt depth = 0 * CHKERR( DMPlexGetDepth(self.dm,&depth) ) * return toInt(depth) # <<<<<<<<<<<<<< * * def getDepthStratum(self, svalue: int) -> tuple[int, int]: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_depth); if (unlikely(!__pyx_t_2)) __PYX_ERR(57, 934, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":921 * return iset * * def getDepth(self) -> int: # <<<<<<<<<<<<<< * """Return the depth of the DAG representing this mesh. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getDepth", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":936 * return toInt(depth) * * def getDepthStratum(self, svalue: int) -> tuple[int, int]: # <<<<<<<<<<<<<< * """Return the bounds [``start``, ``end``) for all points at a certain depth. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_73getDepthStratum(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_72getDepthStratum, "DMPlex.getDepthStratum(self, svalue: int) -> tuple[int, int]\nReturn the bounds [``start``, ``end``) for all points at a certain depth.\n\n Not collective.\n\n Parameters\n ----------\n svalue\n The requested depth.\n\n Returns\n -------\n pStart : int\n The first stratum point.\n pEnd : int\n The upper bound for stratum points.\n\n See Also\n --------\n DM, DMPlex, DMPlex.getHeightStratum, DMPlex.getDepth\n DMPlex.symmetrize, DMPlex.interpolate, petsc.DMPlexGetDepthStratum\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:936"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_73getDepthStratum(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_svalue = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getDepthStratum (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_svalue,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_svalue)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 936, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getDepthStratum") < 0)) __PYX_ERR(57, 936, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_svalue = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getDepthStratum", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 936, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getDepthStratum", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_72getDepthStratum(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_svalue); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_72getDepthStratum(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_svalue) { PetscInt __pyx_v_csvalue; PetscInt __pyx_v_sStart; PetscInt __pyx_v_sEnd; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getDepthStratum", 1); /* "petsc4py/PETSc/DMPlex.pyx":959 * * """ * cdef PetscInt csvalue = asInt(svalue), sStart = 0, sEnd = 0 # <<<<<<<<<<<<<< * CHKERR( DMPlexGetDepthStratum(self.dm, csvalue, &sStart, &sEnd) ) * return (toInt(sStart), toInt(sEnd)) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_svalue); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(57, 959, __pyx_L1_error) __pyx_v_csvalue = __pyx_t_1; __pyx_v_sStart = 0; __pyx_v_sEnd = 0; /* "petsc4py/PETSc/DMPlex.pyx":960 * """ * cdef PetscInt csvalue = asInt(svalue), sStart = 0, sEnd = 0 * CHKERR( DMPlexGetDepthStratum(self.dm, csvalue, &sStart, &sEnd) ) # <<<<<<<<<<<<<< * return (toInt(sStart), toInt(sEnd)) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetDepthStratum(__pyx_v_self->__pyx_base.dm, __pyx_v_csvalue, (&__pyx_v_sStart), (&__pyx_v_sEnd))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 960, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":961 * cdef PetscInt csvalue = asInt(svalue), sStart = 0, sEnd = 0 * CHKERR( DMPlexGetDepthStratum(self.dm, csvalue, &sStart, &sEnd) ) * return (toInt(sStart), toInt(sEnd)) # <<<<<<<<<<<<<< * * def getHeightStratum(self, svalue: int) -> tuple[int, int]: */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_sStart); if (unlikely(!__pyx_t_3)) __PYX_ERR(57, 961, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_sEnd); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 961, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 961, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3)) __PYX_ERR(57, 961, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4)) __PYX_ERR(57, 961, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":936 * return toInt(depth) * * def getDepthStratum(self, svalue: int) -> tuple[int, int]: # <<<<<<<<<<<<<< * """Return the bounds [``start``, ``end``) for all points at a certain depth. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getDepthStratum", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":963 * return (toInt(sStart), toInt(sEnd)) * * def getHeightStratum(self, svalue: int) -> tuple[int, int]: # <<<<<<<<<<<<<< * """Return the bounds [``start``, ``end``) for all points at a certain height. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_75getHeightStratum(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_74getHeightStratum, "DMPlex.getHeightStratum(self, svalue: int) -> tuple[int, int]\nReturn the bounds [``start``, ``end``) for all points at a certain height.\n\n Not collective.\n\n Parameters\n ----------\n svalue\n The requested height.\n\n Returns\n -------\n pStart : int\n The first stratum point.\n pEnd : int\n The upper bound for stratum points.\n\n See Also\n --------\n DM, DMPlex, DMPlex.getDepthStratum, DMPlex.getDepth\n petsc.DMPlexGetHeightStratum\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:963"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_75getHeightStratum(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_svalue = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getHeightStratum (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_svalue,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_svalue)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 963, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getHeightStratum") < 0)) __PYX_ERR(57, 963, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_svalue = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getHeightStratum", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 963, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getHeightStratum", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_74getHeightStratum(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_svalue); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_74getHeightStratum(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_svalue) { PetscInt __pyx_v_csvalue; PetscInt __pyx_v_sStart; PetscInt __pyx_v_sEnd; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getHeightStratum", 1); /* "petsc4py/PETSc/DMPlex.pyx":986 * * """ * cdef PetscInt csvalue = asInt(svalue), sStart = 0, sEnd = 0 # <<<<<<<<<<<<<< * CHKERR( DMPlexGetHeightStratum(self.dm, csvalue, &sStart, &sEnd) ) * return (toInt(sStart), toInt(sEnd)) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_svalue); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(57, 986, __pyx_L1_error) __pyx_v_csvalue = __pyx_t_1; __pyx_v_sStart = 0; __pyx_v_sEnd = 0; /* "petsc4py/PETSc/DMPlex.pyx":987 * """ * cdef PetscInt csvalue = asInt(svalue), sStart = 0, sEnd = 0 * CHKERR( DMPlexGetHeightStratum(self.dm, csvalue, &sStart, &sEnd) ) # <<<<<<<<<<<<<< * return (toInt(sStart), toInt(sEnd)) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetHeightStratum(__pyx_v_self->__pyx_base.dm, __pyx_v_csvalue, (&__pyx_v_sStart), (&__pyx_v_sEnd))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 987, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":988 * cdef PetscInt csvalue = asInt(svalue), sStart = 0, sEnd = 0 * CHKERR( DMPlexGetHeightStratum(self.dm, csvalue, &sStart, &sEnd) ) * return (toInt(sStart), toInt(sEnd)) # <<<<<<<<<<<<<< * * def getPointDepth(self, point: int) -> int: */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_sStart); if (unlikely(!__pyx_t_3)) __PYX_ERR(57, 988, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_sEnd); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 988, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 988, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3)) __PYX_ERR(57, 988, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4)) __PYX_ERR(57, 988, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":963 * return (toInt(sStart), toInt(sEnd)) * * def getHeightStratum(self, svalue: int) -> tuple[int, int]: # <<<<<<<<<<<<<< * """Return the bounds [``start``, ``end``) for all points at a certain height. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getHeightStratum", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":990 * return (toInt(sStart), toInt(sEnd)) * * def getPointDepth(self, point: int) -> int: # <<<<<<<<<<<<<< * """Return the *depth* of a given point. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_77getPointDepth(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_76getPointDepth, "DMPlex.getPointDepth(self, point: int) -> int\nReturn the *depth* of a given point.\n\n Not collective.\n\n Parameters\n ----------\n point\n The point.\n\n See Also\n --------\n DM, DMPlex, DMPlex.getDepthStratum, DMPlex.getDepth\n petsc.DMPlexGetPointDepth\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:990"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_77getPointDepth(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_point = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getPointDepth (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_point)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 990, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getPointDepth") < 0)) __PYX_ERR(57, 990, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_point = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getPointDepth", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 990, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getPointDepth", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_76getPointDepth(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_point); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_76getPointDepth(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_point) { PetscInt __pyx_v_cpoint; PetscInt __pyx_v_depth; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getPointDepth", 1); /* "petsc4py/PETSc/DMPlex.pyx":1006 * * """ * cdef PetscInt cpoint = asInt(point) # <<<<<<<<<<<<<< * cdef PetscInt depth = 0 * CHKERR( DMPlexGetPointDepth(self.dm, cpoint, &depth) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_point); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(57, 1006, __pyx_L1_error) __pyx_v_cpoint = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":1007 * """ * cdef PetscInt cpoint = asInt(point) * cdef PetscInt depth = 0 # <<<<<<<<<<<<<< * CHKERR( DMPlexGetPointDepth(self.dm, cpoint, &depth) ) * return toInt(depth) */ __pyx_v_depth = 0; /* "petsc4py/PETSc/DMPlex.pyx":1008 * cdef PetscInt cpoint = asInt(point) * cdef PetscInt depth = 0 * CHKERR( DMPlexGetPointDepth(self.dm, cpoint, &depth) ) # <<<<<<<<<<<<<< * return toInt(depth) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetPointDepth(__pyx_v_self->__pyx_base.dm, __pyx_v_cpoint, (&__pyx_v_depth))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1008, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":1009 * cdef PetscInt depth = 0 * CHKERR( DMPlexGetPointDepth(self.dm, cpoint, &depth) ) * return toInt(depth) # <<<<<<<<<<<<<< * * def getPointHeight(self, point: int) -> int: */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_depth); if (unlikely(!__pyx_t_3)) __PYX_ERR(57, 1009, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":990 * return (toInt(sStart), toInt(sEnd)) * * def getPointDepth(self, point: int) -> int: # <<<<<<<<<<<<<< * """Return the *depth* of a given point. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getPointDepth", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":1011 * return toInt(depth) * * def getPointHeight(self, point: int) -> int: # <<<<<<<<<<<<<< * """Return the *height* of a given point. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_79getPointHeight(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_78getPointHeight, "DMPlex.getPointHeight(self, point: int) -> int\nReturn the *height* of a given point.\n\n Not collective.\n\n Parameters\n ----------\n point\n The point.\n\n See Also\n --------\n DM, DMPlex, DMPlex.getHeightStratum\n petsc.DMPlexGetPointHeight\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:1011"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_79getPointHeight(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_point = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getPointHeight (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_point)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 1011, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getPointHeight") < 0)) __PYX_ERR(57, 1011, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_point = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getPointHeight", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 1011, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getPointHeight", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_78getPointHeight(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_point); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_78getPointHeight(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_point) { PetscInt __pyx_v_cpoint; PetscInt __pyx_v_height; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getPointHeight", 1); /* "petsc4py/PETSc/DMPlex.pyx":1027 * * """ * cdef PetscInt cpoint = asInt(point) # <<<<<<<<<<<<<< * cdef PetscInt height = 0 * CHKERR( DMPlexGetPointHeight(self.dm, cpoint, &height) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_point); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(57, 1027, __pyx_L1_error) __pyx_v_cpoint = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":1028 * """ * cdef PetscInt cpoint = asInt(point) * cdef PetscInt height = 0 # <<<<<<<<<<<<<< * CHKERR( DMPlexGetPointHeight(self.dm, cpoint, &height) ) * return toInt(height) */ __pyx_v_height = 0; /* "petsc4py/PETSc/DMPlex.pyx":1029 * cdef PetscInt cpoint = asInt(point) * cdef PetscInt height = 0 * CHKERR( DMPlexGetPointHeight(self.dm, cpoint, &height) ) # <<<<<<<<<<<<<< * return toInt(height) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetPointHeight(__pyx_v_self->__pyx_base.dm, __pyx_v_cpoint, (&__pyx_v_height))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1029, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":1030 * cdef PetscInt height = 0 * CHKERR( DMPlexGetPointHeight(self.dm, cpoint, &height) ) * return toInt(height) # <<<<<<<<<<<<<< * * def getMeet(self, points: Sequence[int]) -> ArrayInt: */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_height); if (unlikely(!__pyx_t_3)) __PYX_ERR(57, 1030, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":1011 * return toInt(depth) * * def getPointHeight(self, point: int) -> int: # <<<<<<<<<<<<<< * """Return the *height* of a given point. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getPointHeight", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":1032 * return toInt(height) * * def getMeet(self, points: Sequence[int]) -> ArrayInt: # <<<<<<<<<<<<<< * """Return an array for the meet of the set of points. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_81getMeet(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_80getMeet, "DMPlex.getMeet(self, points: Sequence[int]) -> ArrayInt\nReturn an array for the meet of the set of points.\n\n Not collective.\n\n Parameters\n ----------\n points\n The input points.\n\n See Also\n --------\n DM, DMPlex, DMPlex.getJoin, petsc.DMPlexGetMeet\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:1032"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_81getMeet(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_points = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getMeet (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_points,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_points)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 1032, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getMeet") < 0)) __PYX_ERR(57, 1032, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_points = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getMeet", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 1032, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getMeet", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_80getMeet(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_points); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_80getMeet(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_points) { PetscInt __pyx_v_numPoints; PetscInt *__pyx_v_ipoints; PetscInt __pyx_v_numCoveringPoints; PetscInt const *__pyx_v_coveringPoints; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_t_3; int __pyx_t_4; char const *__pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getMeet", 0); __Pyx_INCREF(__pyx_v_points); /* "petsc4py/PETSc/DMPlex.pyx":1047 * * """ * cdef PetscInt numPoints = 0 # <<<<<<<<<<<<<< * cdef PetscInt *ipoints = NULL * cdef PetscInt numCoveringPoints = 0 */ __pyx_v_numPoints = 0; /* "petsc4py/PETSc/DMPlex.pyx":1048 * """ * cdef PetscInt numPoints = 0 * cdef PetscInt *ipoints = NULL # <<<<<<<<<<<<<< * cdef PetscInt numCoveringPoints = 0 * cdef const PetscInt *coveringPoints = NULL */ __pyx_v_ipoints = NULL; /* "petsc4py/PETSc/DMPlex.pyx":1049 * cdef PetscInt numPoints = 0 * cdef PetscInt *ipoints = NULL * cdef PetscInt numCoveringPoints = 0 # <<<<<<<<<<<<<< * cdef const PetscInt *coveringPoints = NULL * points = iarray_i(points, &numPoints, &ipoints) */ __pyx_v_numCoveringPoints = 0; /* "petsc4py/PETSc/DMPlex.pyx":1050 * cdef PetscInt *ipoints = NULL * cdef PetscInt numCoveringPoints = 0 * cdef const PetscInt *coveringPoints = NULL # <<<<<<<<<<<<<< * points = iarray_i(points, &numPoints, &ipoints) * CHKERR( DMPlexGetMeet(self.dm, numPoints, ipoints, &numCoveringPoints, &coveringPoints) ) */ __pyx_v_coveringPoints = NULL; /* "petsc4py/PETSc/DMPlex.pyx":1051 * cdef PetscInt numCoveringPoints = 0 * cdef const PetscInt *coveringPoints = NULL * points = iarray_i(points, &numPoints, &ipoints) # <<<<<<<<<<<<<< * CHKERR( DMPlexGetMeet(self.dm, numPoints, ipoints, &numCoveringPoints, &coveringPoints) ) * try: */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_points, (&__pyx_v_numPoints), (&__pyx_v_ipoints))); if (unlikely(!__pyx_t_1)) __PYX_ERR(57, 1051, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_points, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DMPlex.pyx":1052 * cdef const PetscInt *coveringPoints = NULL * points = iarray_i(points, &numPoints, &ipoints) * CHKERR( DMPlexGetMeet(self.dm, numPoints, ipoints, &numCoveringPoints, &coveringPoints) ) # <<<<<<<<<<<<<< * try: * return array_i(numCoveringPoints, coveringPoints) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetMeet(__pyx_v_self->__pyx_base.dm, __pyx_v_numPoints, __pyx_v_ipoints, (&__pyx_v_numCoveringPoints), (&__pyx_v_coveringPoints))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1052, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":1053 * points = iarray_i(points, &numPoints, &ipoints) * CHKERR( DMPlexGetMeet(self.dm, numPoints, ipoints, &numCoveringPoints, &coveringPoints) ) * try: # <<<<<<<<<<<<<< * return array_i(numCoveringPoints, coveringPoints) * finally: */ /*try:*/ { /* "petsc4py/PETSc/DMPlex.pyx":1054 * CHKERR( DMPlexGetMeet(self.dm, numPoints, ipoints, &numCoveringPoints, &coveringPoints) ) * try: * return array_i(numCoveringPoints, coveringPoints) # <<<<<<<<<<<<<< * finally: * CHKERR( DMPlexRestoreMeet(self.dm, numPoints, ipoints, &numCoveringPoints, &coveringPoints) ) */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i(__pyx_v_numCoveringPoints, __pyx_v_coveringPoints)); if (unlikely(!__pyx_t_1)) __PYX_ERR(57, 1054, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L3_return; } /* "petsc4py/PETSc/DMPlex.pyx":1056 * return array_i(numCoveringPoints, coveringPoints) * finally: * CHKERR( DMPlexRestoreMeet(self.dm, numPoints, ipoints, &numCoveringPoints, &coveringPoints) ) # <<<<<<<<<<<<<< * * def getJoin(self, points: Sequence[int]) -> ArrayInt: */ /*finally:*/ { __pyx_L4_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __pyx_t_3 = __pyx_lineno; __pyx_t_4 = __pyx_clineno; __pyx_t_5 = __pyx_filename; { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexRestoreMeet(__pyx_v_self->__pyx_base.dm, __pyx_v_numPoints, __pyx_v_ipoints, (&__pyx_v_numCoveringPoints), (&__pyx_v_coveringPoints))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1056, __pyx_L7_error) } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); } __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ErrRestore(__pyx_t_6, __pyx_t_7, __pyx_t_8); __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_lineno = __pyx_t_3; __pyx_clineno = __pyx_t_4; __pyx_filename = __pyx_t_5; goto __pyx_L1_error; __pyx_L7_error:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); } __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; goto __pyx_L1_error; } __pyx_L3_return: { __pyx_t_11 = __pyx_r; __pyx_r = 0; __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexRestoreMeet(__pyx_v_self->__pyx_base.dm, __pyx_v_numPoints, __pyx_v_ipoints, (&__pyx_v_numCoveringPoints), (&__pyx_v_coveringPoints))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1056, __pyx_L1_error) __pyx_r = __pyx_t_11; __pyx_t_11 = 0; goto __pyx_L0; } } /* "petsc4py/PETSc/DMPlex.pyx":1032 * return toInt(height) * * def getMeet(self, points: Sequence[int]) -> ArrayInt: # <<<<<<<<<<<<<< * """Return an array for the meet of the set of points. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getMeet", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_points); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":1058 * CHKERR( DMPlexRestoreMeet(self.dm, numPoints, ipoints, &numCoveringPoints, &coveringPoints) ) * * def getJoin(self, points: Sequence[int]) -> ArrayInt: # <<<<<<<<<<<<<< * """Return an array for the join of the set of points. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_83getJoin(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_82getJoin, "DMPlex.getJoin(self, points: Sequence[int]) -> ArrayInt\nReturn an array for the join of the set of points.\n\n Not collective.\n\n Parameters\n ----------\n points\n The input points.\n\n See Also\n --------\n DM, DMPlex, DMPlex.getMeet, petsc.DMPlexGetJoin\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:1058"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_83getJoin(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_points = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getJoin (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_points,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_points)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 1058, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getJoin") < 0)) __PYX_ERR(57, 1058, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_points = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getJoin", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 1058, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getJoin", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_82getJoin(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_points); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_82getJoin(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_points) { PetscInt __pyx_v_numPoints; PetscInt *__pyx_v_ipoints; PetscInt __pyx_v_numCoveringPoints; PetscInt const *__pyx_v_coveringPoints; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_t_3; int __pyx_t_4; char const *__pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getJoin", 0); __Pyx_INCREF(__pyx_v_points); /* "petsc4py/PETSc/DMPlex.pyx":1073 * * """ * cdef PetscInt numPoints = 0 # <<<<<<<<<<<<<< * cdef PetscInt *ipoints = NULL * cdef PetscInt numCoveringPoints = 0 */ __pyx_v_numPoints = 0; /* "petsc4py/PETSc/DMPlex.pyx":1074 * """ * cdef PetscInt numPoints = 0 * cdef PetscInt *ipoints = NULL # <<<<<<<<<<<<<< * cdef PetscInt numCoveringPoints = 0 * cdef const PetscInt *coveringPoints = NULL */ __pyx_v_ipoints = NULL; /* "petsc4py/PETSc/DMPlex.pyx":1075 * cdef PetscInt numPoints = 0 * cdef PetscInt *ipoints = NULL * cdef PetscInt numCoveringPoints = 0 # <<<<<<<<<<<<<< * cdef const PetscInt *coveringPoints = NULL * points = iarray_i(points, &numPoints, &ipoints) */ __pyx_v_numCoveringPoints = 0; /* "petsc4py/PETSc/DMPlex.pyx":1076 * cdef PetscInt *ipoints = NULL * cdef PetscInt numCoveringPoints = 0 * cdef const PetscInt *coveringPoints = NULL # <<<<<<<<<<<<<< * points = iarray_i(points, &numPoints, &ipoints) * CHKERR( DMPlexGetJoin(self.dm, numPoints, ipoints, &numCoveringPoints, &coveringPoints) ) */ __pyx_v_coveringPoints = NULL; /* "petsc4py/PETSc/DMPlex.pyx":1077 * cdef PetscInt numCoveringPoints = 0 * cdef const PetscInt *coveringPoints = NULL * points = iarray_i(points, &numPoints, &ipoints) # <<<<<<<<<<<<<< * CHKERR( DMPlexGetJoin(self.dm, numPoints, ipoints, &numCoveringPoints, &coveringPoints) ) * try: */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_points, (&__pyx_v_numPoints), (&__pyx_v_ipoints))); if (unlikely(!__pyx_t_1)) __PYX_ERR(57, 1077, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_points, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DMPlex.pyx":1078 * cdef const PetscInt *coveringPoints = NULL * points = iarray_i(points, &numPoints, &ipoints) * CHKERR( DMPlexGetJoin(self.dm, numPoints, ipoints, &numCoveringPoints, &coveringPoints) ) # <<<<<<<<<<<<<< * try: * return array_i(numCoveringPoints, coveringPoints) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetJoin(__pyx_v_self->__pyx_base.dm, __pyx_v_numPoints, __pyx_v_ipoints, (&__pyx_v_numCoveringPoints), (&__pyx_v_coveringPoints))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1078, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":1079 * points = iarray_i(points, &numPoints, &ipoints) * CHKERR( DMPlexGetJoin(self.dm, numPoints, ipoints, &numCoveringPoints, &coveringPoints) ) * try: # <<<<<<<<<<<<<< * return array_i(numCoveringPoints, coveringPoints) * finally: */ /*try:*/ { /* "petsc4py/PETSc/DMPlex.pyx":1080 * CHKERR( DMPlexGetJoin(self.dm, numPoints, ipoints, &numCoveringPoints, &coveringPoints) ) * try: * return array_i(numCoveringPoints, coveringPoints) # <<<<<<<<<<<<<< * finally: * CHKERR( DMPlexRestoreJoin(self.dm, numPoints, ipoints, &numCoveringPoints, &coveringPoints) ) */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i(__pyx_v_numCoveringPoints, __pyx_v_coveringPoints)); if (unlikely(!__pyx_t_1)) __PYX_ERR(57, 1080, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L3_return; } /* "petsc4py/PETSc/DMPlex.pyx":1082 * return array_i(numCoveringPoints, coveringPoints) * finally: * CHKERR( DMPlexRestoreJoin(self.dm, numPoints, ipoints, &numCoveringPoints, &coveringPoints) ) # <<<<<<<<<<<<<< * * def getFullJoin(self, points: Sequence[int]) -> ArrayInt: */ /*finally:*/ { __pyx_L4_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __pyx_t_3 = __pyx_lineno; __pyx_t_4 = __pyx_clineno; __pyx_t_5 = __pyx_filename; { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexRestoreJoin(__pyx_v_self->__pyx_base.dm, __pyx_v_numPoints, __pyx_v_ipoints, (&__pyx_v_numCoveringPoints), (&__pyx_v_coveringPoints))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1082, __pyx_L7_error) } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); } __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ErrRestore(__pyx_t_6, __pyx_t_7, __pyx_t_8); __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_lineno = __pyx_t_3; __pyx_clineno = __pyx_t_4; __pyx_filename = __pyx_t_5; goto __pyx_L1_error; __pyx_L7_error:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); } __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; goto __pyx_L1_error; } __pyx_L3_return: { __pyx_t_11 = __pyx_r; __pyx_r = 0; __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexRestoreJoin(__pyx_v_self->__pyx_base.dm, __pyx_v_numPoints, __pyx_v_ipoints, (&__pyx_v_numCoveringPoints), (&__pyx_v_coveringPoints))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1082, __pyx_L1_error) __pyx_r = __pyx_t_11; __pyx_t_11 = 0; goto __pyx_L0; } } /* "petsc4py/PETSc/DMPlex.pyx":1058 * CHKERR( DMPlexRestoreMeet(self.dm, numPoints, ipoints, &numCoveringPoints, &coveringPoints) ) * * def getJoin(self, points: Sequence[int]) -> ArrayInt: # <<<<<<<<<<<<<< * """Return an array for the join of the set of points. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getJoin", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_points); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":1084 * CHKERR( DMPlexRestoreJoin(self.dm, numPoints, ipoints, &numCoveringPoints, &coveringPoints) ) * * def getFullJoin(self, points: Sequence[int]) -> ArrayInt: # <<<<<<<<<<<<<< * """Return an array for the join of the set of points. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_85getFullJoin(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_84getFullJoin, "DMPlex.getFullJoin(self, points: Sequence[int]) -> ArrayInt\nReturn an array for the join of the set of points.\n\n Not collective.\n\n Parameters\n ----------\n points\n The input points.\n\n See Also\n --------\n DM, DMPlex, DMPlex.getJoin, DMPlex.getMeet, petsc.DMPlexGetFullJoin\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:1084"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_85getFullJoin(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_points = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getFullJoin (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_points,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_points)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 1084, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getFullJoin") < 0)) __PYX_ERR(57, 1084, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_points = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getFullJoin", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 1084, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getFullJoin", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_84getFullJoin(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_points); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_84getFullJoin(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_points) { PetscInt __pyx_v_numPoints; PetscInt *__pyx_v_ipoints; PetscInt __pyx_v_numCoveringPoints; PetscInt const *__pyx_v_coveringPoints; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_t_3; int __pyx_t_4; char const *__pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getFullJoin", 0); __Pyx_INCREF(__pyx_v_points); /* "petsc4py/PETSc/DMPlex.pyx":1099 * * """ * cdef PetscInt numPoints = 0 # <<<<<<<<<<<<<< * cdef PetscInt *ipoints = NULL * cdef PetscInt numCoveringPoints = 0 */ __pyx_v_numPoints = 0; /* "petsc4py/PETSc/DMPlex.pyx":1100 * """ * cdef PetscInt numPoints = 0 * cdef PetscInt *ipoints = NULL # <<<<<<<<<<<<<< * cdef PetscInt numCoveringPoints = 0 * cdef const PetscInt *coveringPoints = NULL */ __pyx_v_ipoints = NULL; /* "petsc4py/PETSc/DMPlex.pyx":1101 * cdef PetscInt numPoints = 0 * cdef PetscInt *ipoints = NULL * cdef PetscInt numCoveringPoints = 0 # <<<<<<<<<<<<<< * cdef const PetscInt *coveringPoints = NULL * points = iarray_i(points, &numPoints, &ipoints) */ __pyx_v_numCoveringPoints = 0; /* "petsc4py/PETSc/DMPlex.pyx":1102 * cdef PetscInt *ipoints = NULL * cdef PetscInt numCoveringPoints = 0 * cdef const PetscInt *coveringPoints = NULL # <<<<<<<<<<<<<< * points = iarray_i(points, &numPoints, &ipoints) * CHKERR( DMPlexGetFullJoin(self.dm, numPoints, ipoints, &numCoveringPoints, &coveringPoints) ) */ __pyx_v_coveringPoints = NULL; /* "petsc4py/PETSc/DMPlex.pyx":1103 * cdef PetscInt numCoveringPoints = 0 * cdef const PetscInt *coveringPoints = NULL * points = iarray_i(points, &numPoints, &ipoints) # <<<<<<<<<<<<<< * CHKERR( DMPlexGetFullJoin(self.dm, numPoints, ipoints, &numCoveringPoints, &coveringPoints) ) * try: */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_points, (&__pyx_v_numPoints), (&__pyx_v_ipoints))); if (unlikely(!__pyx_t_1)) __PYX_ERR(57, 1103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_points, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DMPlex.pyx":1104 * cdef const PetscInt *coveringPoints = NULL * points = iarray_i(points, &numPoints, &ipoints) * CHKERR( DMPlexGetFullJoin(self.dm, numPoints, ipoints, &numCoveringPoints, &coveringPoints) ) # <<<<<<<<<<<<<< * try: * return array_i(numCoveringPoints, coveringPoints) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetFullJoin(__pyx_v_self->__pyx_base.dm, __pyx_v_numPoints, __pyx_v_ipoints, (&__pyx_v_numCoveringPoints), (&__pyx_v_coveringPoints))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1104, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":1105 * points = iarray_i(points, &numPoints, &ipoints) * CHKERR( DMPlexGetFullJoin(self.dm, numPoints, ipoints, &numCoveringPoints, &coveringPoints) ) * try: # <<<<<<<<<<<<<< * return array_i(numCoveringPoints, coveringPoints) * finally: */ /*try:*/ { /* "petsc4py/PETSc/DMPlex.pyx":1106 * CHKERR( DMPlexGetFullJoin(self.dm, numPoints, ipoints, &numCoveringPoints, &coveringPoints) ) * try: * return array_i(numCoveringPoints, coveringPoints) # <<<<<<<<<<<<<< * finally: * CHKERR( DMPlexRestoreJoin(self.dm, numPoints, ipoints, &numCoveringPoints, &coveringPoints) ) */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i(__pyx_v_numCoveringPoints, __pyx_v_coveringPoints)); if (unlikely(!__pyx_t_1)) __PYX_ERR(57, 1106, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L3_return; } /* "petsc4py/PETSc/DMPlex.pyx":1108 * return array_i(numCoveringPoints, coveringPoints) * finally: * CHKERR( DMPlexRestoreJoin(self.dm, numPoints, ipoints, &numCoveringPoints, &coveringPoints) ) # <<<<<<<<<<<<<< * * def getTransitiveClosure(self, p: int, useCone: bool | None = True) -> tuple[ArrayInt, ArrayInt]: */ /*finally:*/ { __pyx_L4_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __pyx_t_3 = __pyx_lineno; __pyx_t_4 = __pyx_clineno; __pyx_t_5 = __pyx_filename; { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexRestoreJoin(__pyx_v_self->__pyx_base.dm, __pyx_v_numPoints, __pyx_v_ipoints, (&__pyx_v_numCoveringPoints), (&__pyx_v_coveringPoints))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1108, __pyx_L7_error) } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); } __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ErrRestore(__pyx_t_6, __pyx_t_7, __pyx_t_8); __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_lineno = __pyx_t_3; __pyx_clineno = __pyx_t_4; __pyx_filename = __pyx_t_5; goto __pyx_L1_error; __pyx_L7_error:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); } __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; goto __pyx_L1_error; } __pyx_L3_return: { __pyx_t_11 = __pyx_r; __pyx_r = 0; __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexRestoreJoin(__pyx_v_self->__pyx_base.dm, __pyx_v_numPoints, __pyx_v_ipoints, (&__pyx_v_numCoveringPoints), (&__pyx_v_coveringPoints))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1108, __pyx_L1_error) __pyx_r = __pyx_t_11; __pyx_t_11 = 0; goto __pyx_L0; } } /* "petsc4py/PETSc/DMPlex.pyx":1084 * CHKERR( DMPlexRestoreJoin(self.dm, numPoints, ipoints, &numCoveringPoints, &coveringPoints) ) * * def getFullJoin(self, points: Sequence[int]) -> ArrayInt: # <<<<<<<<<<<<<< * """Return an array for the join of the set of points. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getFullJoin", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_points); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":1110 * CHKERR( DMPlexRestoreJoin(self.dm, numPoints, ipoints, &numCoveringPoints, &coveringPoints) ) * * def getTransitiveClosure(self, p: int, useCone: bool | None = True) -> tuple[ArrayInt, ArrayInt]: # <<<<<<<<<<<<<< * """Return the points and orientations on the transitive closure of this point. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_87getTransitiveClosure(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_86getTransitiveClosure, "DMPlex.getTransitiveClosure(self, p: int, useCone: bool | None = True) -> tuple[ArrayInt, ArrayInt]\nReturn the points and orientations on the transitive closure of this point.\n\n Not collective.\n\n Parameters\n ----------\n p\n The mesh point.\n useCone\n `True` for the closure, otherwise return the star.\n\n Returns\n -------\n points : ArrayInt\n The points.\n orientations : ArrayInt\n The orientations.\n\n See Also\n --------\n DM, DMPlex, DMPlex.create, DMPlex.setCone, DMPlex.setChart\n DMPlex.getCone, petsc.DMPlexGetTransitiveClosure\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:1110"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_87getTransitiveClosure(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_p = 0; PyObject *__pyx_v_useCone = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getTransitiveClosure (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_p,&__pyx_n_s_useCone,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_True)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 1110, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_useCone); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 1110, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getTransitiveClosure") < 0)) __PYX_ERR(57, 1110, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_p = values[0]; __pyx_v_useCone = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getTransitiveClosure", 0, 1, 2, __pyx_nargs); __PYX_ERR(57, 1110, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getTransitiveClosure", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_86getTransitiveClosure(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_p, __pyx_v_useCone); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_86getTransitiveClosure(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p, PyObject *__pyx_v_useCone) { PetscInt __pyx_v_cp; PetscInt __pyx_v_pStart; PetscInt __pyx_v_pEnd; PetscBool __pyx_v_cuseCone; PetscInt __pyx_v_numPoints; PetscInt *__pyx_v_points; PyArrayObject *__pyx_v_out = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PetscBool __pyx_t_5; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; int __pyx_t_8; char const *__pyx_t_9; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getTransitiveClosure", 1); /* "petsc4py/PETSc/DMPlex.pyx":1135 * * """ * cdef PetscInt cp = asInt(p) # <<<<<<<<<<<<<< * cdef PetscInt pStart = 0, pEnd = 0 * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_p); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(57, 1135, __pyx_L1_error) __pyx_v_cp = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":1136 * """ * cdef PetscInt cp = asInt(p) * cdef PetscInt pStart = 0, pEnd = 0 # <<<<<<<<<<<<<< * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) * assert cp>=pStart and cp=pStart and cp__pyx_base.dm, (&__pyx_v_pStart), (&__pyx_v_pEnd))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1137, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":1138 * cdef PetscInt pStart = 0, pEnd = 0 * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) * assert cp>=pStart and cp= __pyx_v_pStart); if (__pyx_t_4) { } else { __pyx_t_3 = __pyx_t_4; goto __pyx_L3_bool_binop_done; } __pyx_t_4 = (__pyx_v_cp < __pyx_v_pEnd); __pyx_t_3 = __pyx_t_4; __pyx_L3_bool_binop_done:; if (unlikely(!__pyx_t_3)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(57, 1138, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(57, 1138, __pyx_L1_error) #endif /* "petsc4py/PETSc/DMPlex.pyx":1139 * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) * assert cp>=pStart and cp=pStart and cp__pyx_base.dm, __pyx_v_cp, __pyx_v_cuseCone, (&__pyx_v_numPoints), (&__pyx_v_points))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1142, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":1143 * cdef PetscInt *points = NULL * CHKERR( DMPlexGetTransitiveClosure(self.dm, cp, cuseCone, &numPoints, &points) ) * try: # <<<<<<<<<<<<<< * out = array_i(2*numPoints,points) * finally: */ /*try:*/ { /* "petsc4py/PETSc/DMPlex.pyx":1144 * CHKERR( DMPlexGetTransitiveClosure(self.dm, cp, cuseCone, &numPoints, &points) ) * try: * out = array_i(2*numPoints,points) # <<<<<<<<<<<<<< * finally: * CHKERR( DMPlexRestoreTransitiveClosure(self.dm, cp, cuseCone, &numPoints, &points) ) */ __pyx_t_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i((2 * __pyx_v_numPoints), __pyx_v_points)); if (unlikely(!__pyx_t_6)) __PYX_ERR(57, 1144, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_out = ((PyArrayObject *)__pyx_t_6); __pyx_t_6 = 0; } /* "petsc4py/PETSc/DMPlex.pyx":1146 * out = array_i(2*numPoints,points) * finally: * CHKERR( DMPlexRestoreTransitiveClosure(self.dm, cp, cuseCone, &numPoints, &points) ) # <<<<<<<<<<<<<< * return out[::2],out[1::2] * */ /*finally:*/ { /*normal exit:*/{ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexRestoreTransitiveClosure(__pyx_v_self->__pyx_base.dm, __pyx_v_cp, __pyx_v_cuseCone, (&__pyx_v_numPoints), (&__pyx_v_points))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1146, __pyx_L1_error) goto __pyx_L7; } __pyx_L6_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12) < 0)) __Pyx_ErrFetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_15); __pyx_t_7 = __pyx_lineno; __pyx_t_8 = __pyx_clineno; __pyx_t_9 = __pyx_filename; { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexRestoreTransitiveClosure(__pyx_v_self->__pyx_base.dm, __pyx_v_cp, __pyx_v_cuseCone, (&__pyx_v_numPoints), (&__pyx_v_points))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1146, __pyx_L9_error) } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); } __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_ErrRestore(__pyx_t_10, __pyx_t_11, __pyx_t_12); __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_lineno = __pyx_t_7; __pyx_clineno = __pyx_t_8; __pyx_filename = __pyx_t_9; goto __pyx_L1_error; __pyx_L9_error:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); } __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; goto __pyx_L1_error; } __pyx_L7:; } /* "petsc4py/PETSc/DMPlex.pyx":1147 * finally: * CHKERR( DMPlexRestoreTransitiveClosure(self.dm, cp, cuseCone, &numPoints, &points) ) * return out[::2],out[1::2] # <<<<<<<<<<<<<< * * def vecGetClosure(self, Section sec, Vec vec, p: int) -> ArrayScalar: */ __Pyx_XDECREF(__pyx_r); __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_out), __pyx_slice__58); if (unlikely(!__pyx_t_6)) __PYX_ERR(57, 1147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_16 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_out), __pyx_slice__59); if (unlikely(!__pyx_t_16)) __PYX_ERR(57, 1147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_17 = PyTuple_New(2); if (unlikely(!__pyx_t_17)) __PYX_ERR(57, 1147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); __Pyx_GIVEREF(__pyx_t_6); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_6)) __PYX_ERR(57, 1147, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_16); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_t_16)) __PYX_ERR(57, 1147, __pyx_L1_error); __pyx_t_6 = 0; __pyx_t_16 = 0; __pyx_r = __pyx_t_17; __pyx_t_17 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":1110 * CHKERR( DMPlexRestoreJoin(self.dm, numPoints, ipoints, &numCoveringPoints, &coveringPoints) ) * * def getTransitiveClosure(self, p: int, useCone: bool | None = True) -> tuple[ArrayInt, ArrayInt]: # <<<<<<<<<<<<<< * """Return the points and orientations on the transitive closure of this point. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_16); __Pyx_XDECREF(__pyx_t_17); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getTransitiveClosure", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_out); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":1149 * return out[::2],out[1::2] * * def vecGetClosure(self, Section sec, Vec vec, p: int) -> ArrayScalar: # <<<<<<<<<<<<<< * """Return an array of values on the closure of ``p``. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_89vecGetClosure(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_88vecGetClosure, "DMPlex.vecGetClosure(self, sec: Section, vec: Vec, p: int) -> ArrayScalar\nReturn an array of values on the closure of ``p``.\n\n Not collective.\n\n Parameters\n ----------\n sec\n The section describing the layout in ``vec``.\n vec\n The local vector.\n p\n The point in the `DMPlex`.\n\n See Also\n --------\n DM, DMPlex, petsc.DMPlexVecRestoreClosure\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:1149"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_89vecGetClosure(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscSectionObject *__pyx_v_sec = 0; struct PyPetscVecObject *__pyx_v_vec = 0; PyObject *__pyx_v_p = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("vecGetClosure (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sec,&__pyx_n_s_vec,&__pyx_n_s_p,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sec)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 1149, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vec)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 1149, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("vecGetClosure", 1, 3, 3, 1); __PYX_ERR(57, 1149, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 1149, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("vecGetClosure", 1, 3, 3, 2); __PYX_ERR(57, 1149, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "vecGetClosure") < 0)) __PYX_ERR(57, 1149, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_sec = ((struct PyPetscSectionObject *)values[0]); __pyx_v_vec = ((struct PyPetscVecObject *)values[1]); __pyx_v_p = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("vecGetClosure", 1, 3, 3, __pyx_nargs); __PYX_ERR(57, 1149, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.vecGetClosure", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sec), __pyx_ptype_8petsc4py_5PETSc_Section, 0, "sec", 0))) __PYX_ERR(57, 1149, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(57, 1149, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_88vecGetClosure(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_sec, __pyx_v_vec, __pyx_v_p); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_88vecGetClosure(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscSectionObject *__pyx_v_sec, struct PyPetscVecObject *__pyx_v_vec, PyObject *__pyx_v_p) { PetscInt __pyx_v_cp; PetscInt __pyx_v_csize; PetscScalar *__pyx_v_cvals; PyArrayObject *__pyx_v_closure = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; char const *__pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("vecGetClosure", 1); /* "petsc4py/PETSc/DMPlex.pyx":1168 * * """ * cdef PetscInt cp = asInt(p), csize = 0 # <<<<<<<<<<<<<< * cdef PetscScalar *cvals = NULL * CHKERR( DMPlexVecGetClosure(self.dm, sec.sec, vec.vec, cp, &csize, &cvals) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_p); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(57, 1168, __pyx_L1_error) __pyx_v_cp = __pyx_t_1; __pyx_v_csize = 0; /* "petsc4py/PETSc/DMPlex.pyx":1169 * """ * cdef PetscInt cp = asInt(p), csize = 0 * cdef PetscScalar *cvals = NULL # <<<<<<<<<<<<<< * CHKERR( DMPlexVecGetClosure(self.dm, sec.sec, vec.vec, cp, &csize, &cvals) ) * try: */ __pyx_v_cvals = NULL; /* "petsc4py/PETSc/DMPlex.pyx":1170 * cdef PetscInt cp = asInt(p), csize = 0 * cdef PetscScalar *cvals = NULL * CHKERR( DMPlexVecGetClosure(self.dm, sec.sec, vec.vec, cp, &csize, &cvals) ) # <<<<<<<<<<<<<< * try: * closure = array_s(csize, cvals) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexVecGetClosure(__pyx_v_self->__pyx_base.dm, __pyx_v_sec->sec, __pyx_v_vec->vec, __pyx_v_cp, (&__pyx_v_csize), (&__pyx_v_cvals))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1170, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":1171 * cdef PetscScalar *cvals = NULL * CHKERR( DMPlexVecGetClosure(self.dm, sec.sec, vec.vec, cp, &csize, &cvals) ) * try: # <<<<<<<<<<<<<< * closure = array_s(csize, cvals) * finally: */ /*try:*/ { /* "petsc4py/PETSc/DMPlex.pyx":1172 * CHKERR( DMPlexVecGetClosure(self.dm, sec.sec, vec.vec, cp, &csize, &cvals) ) * try: * closure = array_s(csize, cvals) # <<<<<<<<<<<<<< * finally: * CHKERR( DMPlexVecRestoreClosure(self.dm, sec.sec, vec.vec, cp, &csize, &cvals) ) */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_s(__pyx_v_csize, __pyx_v_cvals)); if (unlikely(!__pyx_t_3)) __PYX_ERR(57, 1172, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_closure = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; } /* "petsc4py/PETSc/DMPlex.pyx":1174 * closure = array_s(csize, cvals) * finally: * CHKERR( DMPlexVecRestoreClosure(self.dm, sec.sec, vec.vec, cp, &csize, &cvals) ) # <<<<<<<<<<<<<< * return closure * */ /*finally:*/ { /*normal exit:*/{ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexVecRestoreClosure(__pyx_v_self->__pyx_base.dm, __pyx_v_sec->sec, __pyx_v_vec->vec, __pyx_v_cp, (&__pyx_v_csize), (&__pyx_v_cvals))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1174, __pyx_L1_error) goto __pyx_L5; } __pyx_L4_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename; { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexVecRestoreClosure(__pyx_v_self->__pyx_base.dm, __pyx_v_sec->sec, __pyx_v_vec->vec, __pyx_v_cp, (&__pyx_v_csize), (&__pyx_v_cvals))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1174, __pyx_L7_error) } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); } __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9); __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6; goto __pyx_L1_error; __pyx_L7_error:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); } __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; goto __pyx_L1_error; } __pyx_L5:; } /* "petsc4py/PETSc/DMPlex.pyx":1175 * finally: * CHKERR( DMPlexVecRestoreClosure(self.dm, sec.sec, vec.vec, cp, &csize, &cvals) ) * return closure # <<<<<<<<<<<<<< * * def getVecClosure(self, Section sec or None, Vec vec, point: int) -> ArrayScalar: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_closure); __pyx_r = ((PyObject *)__pyx_v_closure); goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":1149 * return out[::2],out[1::2] * * def vecGetClosure(self, Section sec, Vec vec, p: int) -> ArrayScalar: # <<<<<<<<<<<<<< * """Return an array of values on the closure of ``p``. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.vecGetClosure", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_closure); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":1177 * return closure * * def getVecClosure(self, Section sec or None, Vec vec, point: int) -> ArrayScalar: # <<<<<<<<<<<<<< * """Return an array of the values on the closure of a point. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_91getVecClosure(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_90getVecClosure, "DMPlex.getVecClosure(self, sec: Section, vec: Vec, point: int) -> ArrayScalar\nReturn an array of the values on the closure of a point.\n\n Not collective.\n\n Parameters\n ----------\n sec\n The `Section` describing the layout in ``vec``\n or `None` to use the default section.\n vec\n The local vector.\n point\n The point in the `DMPlex`.\n\n See Also\n --------\n DM, DMPlex, petsc.DMPlexVecRestoreClosure\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:1177"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_91getVecClosure(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscSectionObject *__pyx_v_sec = 0; struct PyPetscVecObject *__pyx_v_vec = 0; PyObject *__pyx_v_point = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getVecClosure (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sec,&__pyx_n_s_vec,&__pyx_n_s_point,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sec)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 1177, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vec)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 1177, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("getVecClosure", 1, 3, 3, 1); __PYX_ERR(57, 1177, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_point)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 1177, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("getVecClosure", 1, 3, 3, 2); __PYX_ERR(57, 1177, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getVecClosure") < 0)) __PYX_ERR(57, 1177, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_sec = ((struct PyPetscSectionObject *)values[0]); __pyx_v_vec = ((struct PyPetscVecObject *)values[1]); __pyx_v_point = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getVecClosure", 1, 3, 3, __pyx_nargs); __PYX_ERR(57, 1177, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getVecClosure", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sec), __pyx_ptype_8petsc4py_5PETSc_Section, 1, "sec", 0))) __PYX_ERR(57, 1177, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(57, 1177, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_90getVecClosure(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_sec, __pyx_v_vec, __pyx_v_point); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_90getVecClosure(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscSectionObject *__pyx_v_sec, struct PyPetscVecObject *__pyx_v_vec, PyObject *__pyx_v_point) { PetscSection __pyx_v_csec; PetscInt __pyx_v_cp; PetscInt __pyx_v_csize; PetscScalar *__pyx_v_cvals; PyArrayObject *__pyx_v_closure = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscSection __pyx_t_1; int __pyx_t_2; PetscInt __pyx_t_3; PetscErrorCode __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_t_7; char const *__pyx_t_8; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getVecClosure", 1); /* "petsc4py/PETSc/DMPlex.pyx":1197 * * """ * cdef PetscSection csec = sec.sec if sec is not None else NULL # <<<<<<<<<<<<<< * cdef PetscInt cp = asInt(point), csize = 0 * cdef PetscScalar *cvals = NULL */ __pyx_t_2 = (((PyObject *)__pyx_v_sec) != Py_None); if (__pyx_t_2) { __pyx_t_1 = __pyx_v_sec->sec; } else { __pyx_t_1 = NULL; } __pyx_v_csec = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":1198 * """ * cdef PetscSection csec = sec.sec if sec is not None else NULL * cdef PetscInt cp = asInt(point), csize = 0 # <<<<<<<<<<<<<< * cdef PetscScalar *cvals = NULL * CHKERR( DMPlexVecGetClosure(self.dm, csec, vec.vec, cp, &csize, &cvals) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_point); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(57, 1198, __pyx_L1_error) __pyx_v_cp = __pyx_t_3; __pyx_v_csize = 0; /* "petsc4py/PETSc/DMPlex.pyx":1199 * cdef PetscSection csec = sec.sec if sec is not None else NULL * cdef PetscInt cp = asInt(point), csize = 0 * cdef PetscScalar *cvals = NULL # <<<<<<<<<<<<<< * CHKERR( DMPlexVecGetClosure(self.dm, csec, vec.vec, cp, &csize, &cvals) ) * try: */ __pyx_v_cvals = NULL; /* "petsc4py/PETSc/DMPlex.pyx":1200 * cdef PetscInt cp = asInt(point), csize = 0 * cdef PetscScalar *cvals = NULL * CHKERR( DMPlexVecGetClosure(self.dm, csec, vec.vec, cp, &csize, &cvals) ) # <<<<<<<<<<<<<< * try: * closure = array_s(csize, cvals) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexVecGetClosure(__pyx_v_self->__pyx_base.dm, __pyx_v_csec, __pyx_v_vec->vec, __pyx_v_cp, (&__pyx_v_csize), (&__pyx_v_cvals))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1200, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":1201 * cdef PetscScalar *cvals = NULL * CHKERR( DMPlexVecGetClosure(self.dm, csec, vec.vec, cp, &csize, &cvals) ) * try: # <<<<<<<<<<<<<< * closure = array_s(csize, cvals) * finally: */ /*try:*/ { /* "petsc4py/PETSc/DMPlex.pyx":1202 * CHKERR( DMPlexVecGetClosure(self.dm, csec, vec.vec, cp, &csize, &cvals) ) * try: * closure = array_s(csize, cvals) # <<<<<<<<<<<<<< * finally: * CHKERR( DMPlexVecRestoreClosure(self.dm, csec, vec.vec, cp, &csize, &cvals) ) */ __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_s(__pyx_v_csize, __pyx_v_cvals)); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 1202, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_5); __pyx_v_closure = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; } /* "petsc4py/PETSc/DMPlex.pyx":1204 * closure = array_s(csize, cvals) * finally: * CHKERR( DMPlexVecRestoreClosure(self.dm, csec, vec.vec, cp, &csize, &cvals) ) # <<<<<<<<<<<<<< * return closure * */ /*finally:*/ { /*normal exit:*/{ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexVecRestoreClosure(__pyx_v_self->__pyx_base.dm, __pyx_v_csec, __pyx_v_vec->vec, __pyx_v_cp, (&__pyx_v_csize), (&__pyx_v_cvals))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1204, __pyx_L1_error) goto __pyx_L5; } __pyx_L4_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11) < 0)) __Pyx_ErrFetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_14); __pyx_t_6 = __pyx_lineno; __pyx_t_7 = __pyx_clineno; __pyx_t_8 = __pyx_filename; { __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexVecRestoreClosure(__pyx_v_self->__pyx_base.dm, __pyx_v_csec, __pyx_v_vec->vec, __pyx_v_cp, (&__pyx_v_csize), (&__pyx_v_cvals))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1204, __pyx_L7_error) } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); } __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_ErrRestore(__pyx_t_9, __pyx_t_10, __pyx_t_11); __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_lineno = __pyx_t_6; __pyx_clineno = __pyx_t_7; __pyx_filename = __pyx_t_8; goto __pyx_L1_error; __pyx_L7_error:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); } __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; goto __pyx_L1_error; } __pyx_L5:; } /* "petsc4py/PETSc/DMPlex.pyx":1205 * finally: * CHKERR( DMPlexVecRestoreClosure(self.dm, csec, vec.vec, cp, &csize, &cvals) ) * return closure # <<<<<<<<<<<<<< * * def setVecClosure(self, Section sec or None, Vec vec, point: int, values: Sequence[Scalar], addv: InsertModeSpec | None = None) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_closure); __pyx_r = ((PyObject *)__pyx_v_closure); goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":1177 * return closure * * def getVecClosure(self, Section sec or None, Vec vec, point: int) -> ArrayScalar: # <<<<<<<<<<<<<< * """Return an array of the values on the closure of a point. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getVecClosure", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_closure); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":1207 * return closure * * def setVecClosure(self, Section sec or None, Vec vec, point: int, values: Sequence[Scalar], addv: InsertModeSpec | None = None) -> None: # <<<<<<<<<<<<<< * """Set an array of the values on the closure of ``point``. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_93setVecClosure(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_92setVecClosure, "DMPlex.setVecClosure(self, sec: Section, vec: Vec, point: int, values: Sequence[Scalar], addv: InsertModeSpec | None = None) -> None\nSet an array of the values on the closure of ``point``.\n\n Not collective.\n\n Parameters\n ----------\n sec\n The section describing the layout in ``vec``,\n or `None` to use the default section.\n vec\n The local vector.\n point\n The point in the `DMPlex`.\n values\n The array of values.\n mode\n The insertion mode.\n\n See Also\n --------\n DM, DMPlex, petsc.DMPlexVecSetClosure\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:1207"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_93setVecClosure(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscSectionObject *__pyx_v_sec = 0; struct PyPetscVecObject *__pyx_v_vec = 0; PyObject *__pyx_v_point = 0; PyObject *__pyx_v_values = 0; PyObject *__pyx_v_addv = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setVecClosure (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sec,&__pyx_n_s_vec,&__pyx_n_s_point,&__pyx_n_s_values,&__pyx_n_s_addv,0}; values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sec)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 1207, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vec)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 1207, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setVecClosure", 0, 4, 5, 1); __PYX_ERR(57, 1207, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_point)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 1207, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setVecClosure", 0, 4, 5, 2); __PYX_ERR(57, 1207, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_values)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 1207, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setVecClosure", 0, 4, 5, 3); __PYX_ERR(57, 1207, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_addv); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 1207, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setVecClosure") < 0)) __PYX_ERR(57, 1207, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_sec = ((struct PyPetscSectionObject *)values[0]); __pyx_v_vec = ((struct PyPetscVecObject *)values[1]); __pyx_v_point = values[2]; __pyx_v_values = values[3]; __pyx_v_addv = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setVecClosure", 0, 4, 5, __pyx_nargs); __PYX_ERR(57, 1207, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.setVecClosure", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sec), __pyx_ptype_8petsc4py_5PETSc_Section, 1, "sec", 0))) __PYX_ERR(57, 1207, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(57, 1207, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_92setVecClosure(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_sec, __pyx_v_vec, __pyx_v_point, __pyx_v_values, __pyx_v_addv); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_92setVecClosure(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscSectionObject *__pyx_v_sec, struct PyPetscVecObject *__pyx_v_vec, PyObject *__pyx_v_point, PyObject *__pyx_v_values, PyObject *__pyx_v_addv) { PetscSection __pyx_v_csec; PetscInt __pyx_v_cp; PetscInt __pyx_v_csize; PetscScalar *__pyx_v_cvals; CYTHON_UNUSED PyObject *__pyx_v_tmp = 0; InsertMode __pyx_v_im; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscSection __pyx_t_1; int __pyx_t_2; PetscInt __pyx_t_3; PyObject *__pyx_t_4 = NULL; InsertMode __pyx_t_5; PetscErrorCode __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setVecClosure", 1); /* "petsc4py/PETSc/DMPlex.pyx":1231 * * """ * cdef PetscSection csec = sec.sec if sec is not None else NULL # <<<<<<<<<<<<<< * cdef PetscInt cp = asInt(point) * cdef PetscInt csize = 0 */ __pyx_t_2 = (((PyObject *)__pyx_v_sec) != Py_None); if (__pyx_t_2) { __pyx_t_1 = __pyx_v_sec->sec; } else { __pyx_t_1 = NULL; } __pyx_v_csec = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":1232 * """ * cdef PetscSection csec = sec.sec if sec is not None else NULL * cdef PetscInt cp = asInt(point) # <<<<<<<<<<<<<< * cdef PetscInt csize = 0 * cdef PetscScalar *cvals = NULL */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_point); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(57, 1232, __pyx_L1_error) __pyx_v_cp = __pyx_t_3; /* "petsc4py/PETSc/DMPlex.pyx":1233 * cdef PetscSection csec = sec.sec if sec is not None else NULL * cdef PetscInt cp = asInt(point) * cdef PetscInt csize = 0 # <<<<<<<<<<<<<< * cdef PetscScalar *cvals = NULL * cdef object tmp = iarray_s(values, &csize, &cvals) */ __pyx_v_csize = 0; /* "petsc4py/PETSc/DMPlex.pyx":1234 * cdef PetscInt cp = asInt(point) * cdef PetscInt csize = 0 * cdef PetscScalar *cvals = NULL # <<<<<<<<<<<<<< * cdef object tmp = iarray_s(values, &csize, &cvals) * cdef PetscInsertMode im = insertmode(addv) */ __pyx_v_cvals = NULL; /* "petsc4py/PETSc/DMPlex.pyx":1235 * cdef PetscInt csize = 0 * cdef PetscScalar *cvals = NULL * cdef object tmp = iarray_s(values, &csize, &cvals) # <<<<<<<<<<<<<< * cdef PetscInsertMode im = insertmode(addv) * CHKERR( DMPlexVecSetClosure(self.dm, csec, vec.vec, cp, cvals, im) ) */ __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_s(__pyx_v_values, (&__pyx_v_csize), (&__pyx_v_cvals))); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 1235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_tmp = __pyx_t_4; __pyx_t_4 = 0; /* "petsc4py/PETSc/DMPlex.pyx":1236 * cdef PetscScalar *cvals = NULL * cdef object tmp = iarray_s(values, &csize, &cvals) * cdef PetscInsertMode im = insertmode(addv) # <<<<<<<<<<<<<< * CHKERR( DMPlexVecSetClosure(self.dm, csec, vec.vec, cp, cvals, im) ) * */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_insertmode(__pyx_v_addv); if (unlikely(__pyx_t_5 == ((InsertMode)((InsertMode)-1L)))) __PYX_ERR(57, 1236, __pyx_L1_error) __pyx_v_im = __pyx_t_5; /* "petsc4py/PETSc/DMPlex.pyx":1237 * cdef object tmp = iarray_s(values, &csize, &cvals) * cdef PetscInsertMode im = insertmode(addv) * CHKERR( DMPlexVecSetClosure(self.dm, csec, vec.vec, cp, cvals, im) ) # <<<<<<<<<<<<<< * * def setMatClosure(self, Section sec or None, Section gsec or None, */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexVecSetClosure(__pyx_v_self->__pyx_base.dm, __pyx_v_csec, __pyx_v_vec->vec, __pyx_v_cp, __pyx_v_cvals, __pyx_v_im)); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1237, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":1207 * return closure * * def setVecClosure(self, Section sec or None, Vec vec, point: int, values: Sequence[Scalar], addv: InsertModeSpec | None = None) -> None: # <<<<<<<<<<<<<< * """Set an array of the values on the closure of ``point``. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.setVecClosure", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_tmp); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":1239 * CHKERR( DMPlexVecSetClosure(self.dm, csec, vec.vec, cp, cvals, im) ) * * def setMatClosure(self, Section sec or None, Section gsec or None, # <<<<<<<<<<<<<< * Mat mat, point: int, values: Sequence[Scalar], addv: InsertModeSpec | None = None) -> None: * """Set an array of the values on the closure of ``point``. */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_95setMatClosure(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_94setMatClosure, "DMPlex.setMatClosure(self, sec: Section, gsec: Section, mat: Mat, point: int, values: Sequence[Scalar], addv: InsertModeSpec | None = None) -> None\nSet an array of the values on the closure of ``point``.\n\n Not collective.\n\n Parameters\n ----------\n sec\n The section describing the layout in ``mat``,\n or `None` to use the default section.\n gsec\n The section describing the layout in ``mat``,\n or `None` to use the default global section.\n mat\n The matrix.\n point\n The point in the `DMPlex`.\n values\n The array of values.\n mode\n The insertion mode.\n\n See Also\n --------\n DM, DMPlex, petsc.DMPlexMatSetClosure\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:1239"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_95setMatClosure(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscSectionObject *__pyx_v_sec = 0; struct PyPetscSectionObject *__pyx_v_gsec = 0; struct PyPetscMatObject *__pyx_v_mat = 0; PyObject *__pyx_v_point = 0; PyObject *__pyx_v_values = 0; PyObject *__pyx_v_addv = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[6] = {0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setMatClosure (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sec,&__pyx_n_s_gsec,&__pyx_n_s_mat,&__pyx_n_s_point,&__pyx_n_s_values,&__pyx_n_s_addv,0}; /* "petsc4py/PETSc/DMPlex.pyx":1240 * * def setMatClosure(self, Section sec or None, Section gsec or None, * Mat mat, point: int, values: Sequence[Scalar], addv: InsertModeSpec | None = None) -> None: # <<<<<<<<<<<<<< * """Set an array of the values on the closure of ``point``. * */ values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sec)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 1239, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gsec)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 1239, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setMatClosure", 0, 5, 6, 1); __PYX_ERR(57, 1239, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mat)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 1239, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setMatClosure", 0, 5, 6, 2); __PYX_ERR(57, 1239, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_point)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 1239, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setMatClosure", 0, 5, 6, 3); __PYX_ERR(57, 1239, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_values)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 1239, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setMatClosure", 0, 5, 6, 4); __PYX_ERR(57, 1239, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_addv); if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 1239, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setMatClosure") < 0)) __PYX_ERR(57, 1239, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_sec = ((struct PyPetscSectionObject *)values[0]); __pyx_v_gsec = ((struct PyPetscSectionObject *)values[1]); __pyx_v_mat = ((struct PyPetscMatObject *)values[2]); __pyx_v_point = values[3]; __pyx_v_values = values[4]; __pyx_v_addv = values[5]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setMatClosure", 0, 5, 6, __pyx_nargs); __PYX_ERR(57, 1239, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.setMatClosure", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sec), __pyx_ptype_8petsc4py_5PETSc_Section, 1, "sec", 0))) __PYX_ERR(57, 1239, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gsec), __pyx_ptype_8petsc4py_5PETSc_Section, 1, "gsec", 0))) __PYX_ERR(57, 1239, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(57, 1240, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_94setMatClosure(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_sec, __pyx_v_gsec, __pyx_v_mat, __pyx_v_point, __pyx_v_values, __pyx_v_addv); /* "petsc4py/PETSc/DMPlex.pyx":1239 * CHKERR( DMPlexVecSetClosure(self.dm, csec, vec.vec, cp, cvals, im) ) * * def setMatClosure(self, Section sec or None, Section gsec or None, # <<<<<<<<<<<<<< * Mat mat, point: int, values: Sequence[Scalar], addv: InsertModeSpec | None = None) -> None: * """Set an array of the values on the closure of ``point``. */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_94setMatClosure(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscSectionObject *__pyx_v_sec, struct PyPetscSectionObject *__pyx_v_gsec, struct PyPetscMatObject *__pyx_v_mat, PyObject *__pyx_v_point, PyObject *__pyx_v_values, PyObject *__pyx_v_addv) { PetscSection __pyx_v_csec; PetscSection __pyx_v_cgsec; PetscInt __pyx_v_cp; PetscInt __pyx_v_csize; PetscScalar *__pyx_v_cvals; CYTHON_UNUSED PyObject *__pyx_v_tmp = 0; InsertMode __pyx_v_im; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscSection __pyx_t_1; int __pyx_t_2; PetscInt __pyx_t_3; PyObject *__pyx_t_4 = NULL; InsertMode __pyx_t_5; PetscErrorCode __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setMatClosure", 1); /* "petsc4py/PETSc/DMPlex.pyx":1267 * * """ * cdef PetscSection csec = sec.sec if sec is not None else NULL # <<<<<<<<<<<<<< * cdef PetscSection cgsec = gsec.sec if gsec is not None else NULL * cdef PetscInt cp = asInt(point) */ __pyx_t_2 = (((PyObject *)__pyx_v_sec) != Py_None); if (__pyx_t_2) { __pyx_t_1 = __pyx_v_sec->sec; } else { __pyx_t_1 = NULL; } __pyx_v_csec = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":1268 * """ * cdef PetscSection csec = sec.sec if sec is not None else NULL * cdef PetscSection cgsec = gsec.sec if gsec is not None else NULL # <<<<<<<<<<<<<< * cdef PetscInt cp = asInt(point) * cdef PetscInt csize = 0 */ __pyx_t_2 = (((PyObject *)__pyx_v_gsec) != Py_None); if (__pyx_t_2) { __pyx_t_1 = __pyx_v_gsec->sec; } else { __pyx_t_1 = NULL; } __pyx_v_cgsec = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":1269 * cdef PetscSection csec = sec.sec if sec is not None else NULL * cdef PetscSection cgsec = gsec.sec if gsec is not None else NULL * cdef PetscInt cp = asInt(point) # <<<<<<<<<<<<<< * cdef PetscInt csize = 0 * cdef PetscScalar *cvals = NULL */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_point); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(57, 1269, __pyx_L1_error) __pyx_v_cp = __pyx_t_3; /* "petsc4py/PETSc/DMPlex.pyx":1270 * cdef PetscSection cgsec = gsec.sec if gsec is not None else NULL * cdef PetscInt cp = asInt(point) * cdef PetscInt csize = 0 # <<<<<<<<<<<<<< * cdef PetscScalar *cvals = NULL * cdef object tmp = iarray_s(values, &csize, &cvals) */ __pyx_v_csize = 0; /* "petsc4py/PETSc/DMPlex.pyx":1271 * cdef PetscInt cp = asInt(point) * cdef PetscInt csize = 0 * cdef PetscScalar *cvals = NULL # <<<<<<<<<<<<<< * cdef object tmp = iarray_s(values, &csize, &cvals) * cdef PetscInsertMode im = insertmode(addv) */ __pyx_v_cvals = NULL; /* "petsc4py/PETSc/DMPlex.pyx":1272 * cdef PetscInt csize = 0 * cdef PetscScalar *cvals = NULL * cdef object tmp = iarray_s(values, &csize, &cvals) # <<<<<<<<<<<<<< * cdef PetscInsertMode im = insertmode(addv) * CHKERR( DMPlexMatSetClosure(self.dm, csec, cgsec, mat.mat, cp, cvals, im) ) */ __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_s(__pyx_v_values, (&__pyx_v_csize), (&__pyx_v_cvals))); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 1272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_tmp = __pyx_t_4; __pyx_t_4 = 0; /* "petsc4py/PETSc/DMPlex.pyx":1273 * cdef PetscScalar *cvals = NULL * cdef object tmp = iarray_s(values, &csize, &cvals) * cdef PetscInsertMode im = insertmode(addv) # <<<<<<<<<<<<<< * CHKERR( DMPlexMatSetClosure(self.dm, csec, cgsec, mat.mat, cp, cvals, im) ) * */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_insertmode(__pyx_v_addv); if (unlikely(__pyx_t_5 == ((InsertMode)((InsertMode)-1L)))) __PYX_ERR(57, 1273, __pyx_L1_error) __pyx_v_im = __pyx_t_5; /* "petsc4py/PETSc/DMPlex.pyx":1274 * cdef object tmp = iarray_s(values, &csize, &cvals) * cdef PetscInsertMode im = insertmode(addv) * CHKERR( DMPlexMatSetClosure(self.dm, csec, cgsec, mat.mat, cp, cvals, im) ) # <<<<<<<<<<<<<< * * def generate(self, DMPlex boundary, name: str | None = None, interpolate: bool | None = True) -> Self: */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexMatSetClosure(__pyx_v_self->__pyx_base.dm, __pyx_v_csec, __pyx_v_cgsec, __pyx_v_mat->mat, __pyx_v_cp, __pyx_v_cvals, __pyx_v_im)); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1274, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":1239 * CHKERR( DMPlexVecSetClosure(self.dm, csec, vec.vec, cp, cvals, im) ) * * def setMatClosure(self, Section sec or None, Section gsec or None, # <<<<<<<<<<<<<< * Mat mat, point: int, values: Sequence[Scalar], addv: InsertModeSpec | None = None) -> None: * """Set an array of the values on the closure of ``point``. */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.setMatClosure", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_tmp); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":1276 * CHKERR( DMPlexMatSetClosure(self.dm, csec, cgsec, mat.mat, cp, cvals, im) ) * * def generate(self, DMPlex boundary, name: str | None = None, interpolate: bool | None = True) -> Self: # <<<<<<<<<<<<<< * """Generate a mesh. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_97generate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_96generate, "DMPlex.generate(self, boundary: DMPlex, name: str | None = None, interpolate: bool | None = True) -> Self\nGenerate a mesh.\n\n Not collective.\n\n Parameters\n ----------\n boundary\n The `DMPlex` boundary object.\n name\n The mesh generation package name.\n interpolate\n Flag to create intermediate mesh elements.\n\n See Also\n --------\n DM, DMPlex, DMPlex.create, DM.refine, petsc_options\n petsc.DMPlexGenerate\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:1276"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_97generate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_boundary = 0; PyObject *__pyx_v_name = 0; PyObject *__pyx_v_interpolate = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("generate (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_boundary,&__pyx_n_s_name,&__pyx_n_s_interpolate,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_True)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_boundary)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 1276, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 1276, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_interpolate); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 1276, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "generate") < 0)) __PYX_ERR(57, 1276, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_boundary = ((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)values[0]); __pyx_v_name = values[1]; __pyx_v_interpolate = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("generate", 0, 1, 3, __pyx_nargs); __PYX_ERR(57, 1276, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.generate", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_boundary), __pyx_ptype_8petsc4py_5PETSc_DMPlex, 0, "boundary", 0))) __PYX_ERR(57, 1276, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_96generate(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_boundary, __pyx_v_name, __pyx_v_interpolate); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_96generate(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_boundary, PyObject *__pyx_v_name, PyObject *__pyx_v_interpolate) { PetscBool __pyx_v_interp; char const *__pyx_v_cname; DM __pyx_v_newdm; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("generate", 0); __Pyx_INCREF(__pyx_v_name); /* "petsc4py/PETSc/DMPlex.pyx":1296 * * """ * cdef PetscBool interp = interpolate # <<<<<<<<<<<<<< * cdef const char *cname = NULL * if name: name = str2bytes(name, &cname) */ __pyx_t_1 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_interpolate)); if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 1296, __pyx_L1_error) __pyx_v_interp = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":1297 * """ * cdef PetscBool interp = interpolate * cdef const char *cname = NULL # <<<<<<<<<<<<<< * if name: name = str2bytes(name, &cname) * cdef PetscDM newdm = NULL */ __pyx_v_cname = NULL; /* "petsc4py/PETSc/DMPlex.pyx":1298 * cdef PetscBool interp = interpolate * cdef const char *cname = NULL * if name: name = str2bytes(name, &cname) # <<<<<<<<<<<<<< * cdef PetscDM newdm = NULL * CHKERR( DMPlexGenerate(boundary.dm, cname, interp, &newdm) ) */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_name); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(57, 1298, __pyx_L1_error) if (__pyx_t_2) { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cname)); if (unlikely(!__pyx_t_3)) __PYX_ERR(57, 1298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_3); __pyx_t_3 = 0; } /* "petsc4py/PETSc/DMPlex.pyx":1299 * cdef const char *cname = NULL * if name: name = str2bytes(name, &cname) * cdef PetscDM newdm = NULL # <<<<<<<<<<<<<< * CHKERR( DMPlexGenerate(boundary.dm, cname, interp, &newdm) ) * CHKERR( PetscCLEAR(self.obj) ); self.dm = newdm */ __pyx_v_newdm = NULL; /* "petsc4py/PETSc/DMPlex.pyx":1300 * if name: name = str2bytes(name, &cname) * cdef PetscDM newdm = NULL * CHKERR( DMPlexGenerate(boundary.dm, cname, interp, &newdm) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.dm = newdm * return self */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGenerate(__pyx_v_boundary->__pyx_base.dm, __pyx_v_cname, __pyx_v_interp, (&__pyx_v_newdm))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1300, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":1301 * cdef PetscDM newdm = NULL * CHKERR( DMPlexGenerate(boundary.dm, cname, interp, &newdm) ) * CHKERR( PetscCLEAR(self.obj) ); self.dm = newdm # <<<<<<<<<<<<<< * return self * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1301, __pyx_L1_error) __pyx_v_self->__pyx_base.dm = __pyx_v_newdm; /* "petsc4py/PETSc/DMPlex.pyx":1302 * CHKERR( DMPlexGenerate(boundary.dm, cname, interp, &newdm) ) * CHKERR( PetscCLEAR(self.obj) ); self.dm = newdm * return self # <<<<<<<<<<<<<< * * def setTriangleOptions(self, opts: str) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":1276 * CHKERR( DMPlexMatSetClosure(self.dm, csec, cgsec, mat.mat, cp, cvals, im) ) * * def generate(self, DMPlex boundary, name: str | None = None, interpolate: bool | None = True) -> Self: # <<<<<<<<<<<<<< * """Generate a mesh. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.generate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":1304 * return self * * def setTriangleOptions(self, opts: str) -> None: # <<<<<<<<<<<<<< * """Set the options used for the Triangle mesh generator. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_99setTriangleOptions(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_98setTriangleOptions, "DMPlex.setTriangleOptions(self, opts: str) -> None\nSet the options used for the Triangle mesh generator.\n\n Not collective.\n\n Parameters\n ----------\n opts\n The command line options.\n\n See Also\n --------\n petsc_options, DM, DMPlex, DMPlex.setTetGenOptions, DMPlex.generate\n petsc.DMPlexTriangleSetOptions\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:1304"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_99setTriangleOptions(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_opts = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setTriangleOptions (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_opts,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_opts)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 1304, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setTriangleOptions") < 0)) __PYX_ERR(57, 1304, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_opts = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setTriangleOptions", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 1304, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.setTriangleOptions", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_98setTriangleOptions(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_opts); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_98setTriangleOptions(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_opts) { char const *__pyx_v_copts; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setTriangleOptions", 0); __Pyx_INCREF(__pyx_v_opts); /* "petsc4py/PETSc/DMPlex.pyx":1320 * * """ * cdef const char *copts = NULL # <<<<<<<<<<<<<< * opts = str2bytes(opts, &copts) * CHKERR( DMPlexTriangleSetOptions(self.dm, copts) ) */ __pyx_v_copts = NULL; /* "petsc4py/PETSc/DMPlex.pyx":1321 * """ * cdef const char *copts = NULL * opts = str2bytes(opts, &copts) # <<<<<<<<<<<<<< * CHKERR( DMPlexTriangleSetOptions(self.dm, copts) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_opts, (&__pyx_v_copts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(57, 1321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_opts, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DMPlex.pyx":1322 * cdef const char *copts = NULL * opts = str2bytes(opts, &copts) * CHKERR( DMPlexTriangleSetOptions(self.dm, copts) ) # <<<<<<<<<<<<<< * * def setTetGenOptions(self, opts: str) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexTriangleSetOptions(__pyx_v_self->__pyx_base.dm, __pyx_v_copts)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1322, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":1304 * return self * * def setTriangleOptions(self, opts: str) -> None: # <<<<<<<<<<<<<< * """Set the options used for the Triangle mesh generator. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.setTriangleOptions", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_opts); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":1324 * CHKERR( DMPlexTriangleSetOptions(self.dm, copts) ) * * def setTetGenOptions(self, opts: str) -> None: # <<<<<<<<<<<<<< * """Set the options used for the Tetgen mesh generator. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_101setTetGenOptions(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_100setTetGenOptions, "DMPlex.setTetGenOptions(self, opts: str) -> None\nSet the options used for the Tetgen mesh generator.\n\n Not collective.\n\n Parameters\n ----------\n opts\n The command line options.\n\n See Also\n --------\n petsc_options, DM, DMPlex, DMPlex.setTriangleOptions, DMPlex.generate\n petsc.DMPlexTetgenSetOptions\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:1324"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_101setTetGenOptions(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_opts = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setTetGenOptions (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_opts,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_opts)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 1324, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setTetGenOptions") < 0)) __PYX_ERR(57, 1324, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_opts = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setTetGenOptions", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 1324, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.setTetGenOptions", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_100setTetGenOptions(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_opts); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_100setTetGenOptions(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_opts) { char const *__pyx_v_copts; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setTetGenOptions", 0); __Pyx_INCREF(__pyx_v_opts); /* "petsc4py/PETSc/DMPlex.pyx":1340 * * """ * cdef const char *copts = NULL # <<<<<<<<<<<<<< * opts = str2bytes(opts, &copts) * CHKERR( DMPlexTetgenSetOptions(self.dm, copts) ) */ __pyx_v_copts = NULL; /* "petsc4py/PETSc/DMPlex.pyx":1341 * """ * cdef const char *copts = NULL * opts = str2bytes(opts, &copts) # <<<<<<<<<<<<<< * CHKERR( DMPlexTetgenSetOptions(self.dm, copts) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_opts, (&__pyx_v_copts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(57, 1341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_opts, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DMPlex.pyx":1342 * cdef const char *copts = NULL * opts = str2bytes(opts, &copts) * CHKERR( DMPlexTetgenSetOptions(self.dm, copts) ) # <<<<<<<<<<<<<< * * def markBoundaryFaces(self, label: str, value: int | None = None) -> DMLabel: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexTetgenSetOptions(__pyx_v_self->__pyx_base.dm, __pyx_v_copts)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1342, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":1324 * CHKERR( DMPlexTriangleSetOptions(self.dm, copts) ) * * def setTetGenOptions(self, opts: str) -> None: # <<<<<<<<<<<<<< * """Set the options used for the Tetgen mesh generator. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.setTetGenOptions", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_opts); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":1344 * CHKERR( DMPlexTetgenSetOptions(self.dm, copts) ) * * def markBoundaryFaces(self, label: str, value: int | None = None) -> DMLabel: # <<<<<<<<<<<<<< * """Mark all faces on the boundary. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_103markBoundaryFaces(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_102markBoundaryFaces, "DMPlex.markBoundaryFaces(self, label: str, value: int | None = None) -> DMLabel\nMark all faces on the boundary.\n\n Not collective.\n\n Parameters\n ----------\n value\n The marker value, or `DETERMINE` or `None` to use some\n value in the closure (or 1 if none are found).\n\n See Also\n --------\n DM, DMPlex, DMLabel.create, DM.createLabel\n petsc.DMPlexMarkBoundaryFaces\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:1344"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_103markBoundaryFaces(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_label = 0; PyObject *__pyx_v_value = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("markBoundaryFaces (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_label,&__pyx_n_s_value,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_label)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 1344, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 1344, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "markBoundaryFaces") < 0)) __PYX_ERR(57, 1344, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_label = values[0]; __pyx_v_value = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("markBoundaryFaces", 0, 1, 2, __pyx_nargs); __PYX_ERR(57, 1344, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.markBoundaryFaces", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_102markBoundaryFaces(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_label, __pyx_v_value); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_102markBoundaryFaces(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_label, PyObject *__pyx_v_value) { PetscInt __pyx_v_ival; char const *__pyx_v_cval; DMLabel __pyx_v_clbl; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscInt __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_t_7; PetscErrorCode __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("markBoundaryFaces", 0); __Pyx_INCREF(__pyx_v_label); /* "petsc4py/PETSc/DMPlex.pyx":1361 * * """ * cdef PetscInt ival = PETSC_DETERMINE # <<<<<<<<<<<<<< * if value is not None: ival = asInt(value) * if not self.hasLabel(label): */ __pyx_v_ival = PETSC_DETERMINE; /* "petsc4py/PETSc/DMPlex.pyx":1362 * """ * cdef PetscInt ival = PETSC_DETERMINE * if value is not None: ival = asInt(value) # <<<<<<<<<<<<<< * if not self.hasLabel(label): * self.createLabel(label) */ __pyx_t_1 = (__pyx_v_value != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_value); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(57, 1362, __pyx_L1_error) __pyx_v_ival = __pyx_t_2; } /* "petsc4py/PETSc/DMPlex.pyx":1363 * cdef PetscInt ival = PETSC_DETERMINE * if value is not None: ival = asInt(value) * if not self.hasLabel(label): # <<<<<<<<<<<<<< * self.createLabel(label) * cdef const char *cval = NULL */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_hasLabel); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 1363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_label}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(57, 1363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(57, 1363, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_7 = (!__pyx_t_1); if (__pyx_t_7) { /* "petsc4py/PETSc/DMPlex.pyx":1364 * if value is not None: ival = asInt(value) * if not self.hasLabel(label): * self.createLabel(label) # <<<<<<<<<<<<<< * cdef const char *cval = NULL * label = str2bytes(label, &cval) */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_createLabel); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 1364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_label}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(57, 1364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/DMPlex.pyx":1363 * cdef PetscInt ival = PETSC_DETERMINE * if value is not None: ival = asInt(value) * if not self.hasLabel(label): # <<<<<<<<<<<<<< * self.createLabel(label) * cdef const char *cval = NULL */ } /* "petsc4py/PETSc/DMPlex.pyx":1365 * if not self.hasLabel(label): * self.createLabel(label) * cdef const char *cval = NULL # <<<<<<<<<<<<<< * label = str2bytes(label, &cval) * cdef PetscDMLabel clbl = NULL */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/DMPlex.pyx":1366 * self.createLabel(label) * cdef const char *cval = NULL * label = str2bytes(label, &cval) # <<<<<<<<<<<<<< * cdef PetscDMLabel clbl = NULL * CHKERR( DMGetLabel(self.dm, cval, &clbl) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_label, (&__pyx_v_cval)); if (unlikely(!__pyx_t_3)) __PYX_ERR(57, 1366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_label, __pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/DMPlex.pyx":1367 * cdef const char *cval = NULL * label = str2bytes(label, &cval) * cdef PetscDMLabel clbl = NULL # <<<<<<<<<<<<<< * CHKERR( DMGetLabel(self.dm, cval, &clbl) ) * CHKERR( DMPlexMarkBoundaryFaces(self.dm, ival, clbl) ) */ __pyx_v_clbl = NULL; /* "petsc4py/PETSc/DMPlex.pyx":1368 * label = str2bytes(label, &cval) * cdef PetscDMLabel clbl = NULL * CHKERR( DMGetLabel(self.dm, cval, &clbl) ) # <<<<<<<<<<<<<< * CHKERR( DMPlexMarkBoundaryFaces(self.dm, ival, clbl) ) * */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetLabel(__pyx_v_self->__pyx_base.dm, __pyx_v_cval, (&__pyx_v_clbl))); if (unlikely(__pyx_t_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1368, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":1369 * cdef PetscDMLabel clbl = NULL * CHKERR( DMGetLabel(self.dm, cval, &clbl) ) * CHKERR( DMPlexMarkBoundaryFaces(self.dm, ival, clbl) ) # <<<<<<<<<<<<<< * * def labelComplete(self, DMLabel label) -> None: */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexMarkBoundaryFaces(__pyx_v_self->__pyx_base.dm, __pyx_v_ival, __pyx_v_clbl)); if (unlikely(__pyx_t_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1369, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":1344 * CHKERR( DMPlexTetgenSetOptions(self.dm, copts) ) * * def markBoundaryFaces(self, label: str, value: int | None = None) -> DMLabel: # <<<<<<<<<<<<<< * """Mark all faces on the boundary. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.markBoundaryFaces", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_label); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":1371 * CHKERR( DMPlexMarkBoundaryFaces(self.dm, ival, clbl) ) * * def labelComplete(self, DMLabel label) -> None: # <<<<<<<<<<<<<< * """Add the transitive closure to the surface. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_105labelComplete(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_104labelComplete, "DMPlex.labelComplete(self, label: DMLabel) -> None\nAdd the transitive closure to the surface.\n\n Parameters\n ----------\n label\n A `DMLabel` marking the surface points.\n\n See Also\n --------\n DM, DMPlex, DMPlex.labelCohesiveComplete, petsc.DMPlexLabelComplete\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:1371"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_105labelComplete(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscDMLabelObject *__pyx_v_label = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("labelComplete (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_label,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_label)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 1371, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "labelComplete") < 0)) __PYX_ERR(57, 1371, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_label = ((struct PyPetscDMLabelObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("labelComplete", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 1371, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.labelComplete", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_label), __pyx_ptype_8petsc4py_5PETSc_DMLabel, 0, "label", 0))) __PYX_ERR(57, 1371, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_104labelComplete(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_label); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_104labelComplete(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscDMLabelObject *__pyx_v_label) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("labelComplete", 1); /* "petsc4py/PETSc/DMPlex.pyx":1384 * * """ * CHKERR( DMPlexLabelComplete(self.dm, label.dmlabel) ) # <<<<<<<<<<<<<< * * def labelCohesiveComplete(self, DMLabel label, DMLabel bdlabel, bdvalue: int, flip: bool, DMPlex subdm) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexLabelComplete(__pyx_v_self->__pyx_base.dm, __pyx_v_label->dmlabel)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1384, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":1371 * CHKERR( DMPlexMarkBoundaryFaces(self.dm, ival, clbl) ) * * def labelComplete(self, DMLabel label) -> None: # <<<<<<<<<<<<<< * """Add the transitive closure to the surface. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.labelComplete", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":1386 * CHKERR( DMPlexLabelComplete(self.dm, label.dmlabel) ) * * def labelCohesiveComplete(self, DMLabel label, DMLabel bdlabel, bdvalue: int, flip: bool, DMPlex subdm) -> None: # <<<<<<<<<<<<<< * """Add all other mesh pieces to complete the surface. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_107labelCohesiveComplete(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_106labelCohesiveComplete, "DMPlex.labelCohesiveComplete(self, label: DMLabel, bdlabel: DMLabel, bdvalue: int, flip: bool, subdm: DMPlex) -> None\nAdd all other mesh pieces to complete the surface.\n\n Parameters\n ----------\n label\n A `DMLabel` marking the surface.\n bdlabel\n A `DMLabel` marking the vertices on the boundary\n which will not be duplicated.\n bdvalue\n Value of `DMLabel` marking the vertices on the boundary.\n flip\n Flag to flip the submesh normal and replace points\n on the other side.\n subdm\n The `DMPlex` associated with the label.\n\n See Also\n --------\n DM, DMPlex, DMPlex.labelComplete\n petsc.DMPlexLabelCohesiveComplete\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:1386"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_107labelCohesiveComplete(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscDMLabelObject *__pyx_v_label = 0; struct PyPetscDMLabelObject *__pyx_v_bdlabel = 0; PyObject *__pyx_v_bdvalue = 0; PyObject *__pyx_v_flip = 0; struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_subdm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("labelCohesiveComplete (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_label,&__pyx_n_s_bdlabel,&__pyx_n_s_bdvalue,&__pyx_n_s_flip,&__pyx_n_s_subdm,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_label)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 1386, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_bdlabel)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 1386, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("labelCohesiveComplete", 1, 5, 5, 1); __PYX_ERR(57, 1386, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_bdvalue)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 1386, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("labelCohesiveComplete", 1, 5, 5, 2); __PYX_ERR(57, 1386, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flip)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 1386, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("labelCohesiveComplete", 1, 5, 5, 3); __PYX_ERR(57, 1386, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_subdm)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 1386, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("labelCohesiveComplete", 1, 5, 5, 4); __PYX_ERR(57, 1386, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "labelCohesiveComplete") < 0)) __PYX_ERR(57, 1386, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 5)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); } __pyx_v_label = ((struct PyPetscDMLabelObject *)values[0]); __pyx_v_bdlabel = ((struct PyPetscDMLabelObject *)values[1]); __pyx_v_bdvalue = values[2]; __pyx_v_flip = values[3]; __pyx_v_subdm = ((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)values[4]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("labelCohesiveComplete", 1, 5, 5, __pyx_nargs); __PYX_ERR(57, 1386, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.labelCohesiveComplete", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_label), __pyx_ptype_8petsc4py_5PETSc_DMLabel, 0, "label", 0))) __PYX_ERR(57, 1386, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bdlabel), __pyx_ptype_8petsc4py_5PETSc_DMLabel, 0, "bdlabel", 0))) __PYX_ERR(57, 1386, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subdm), __pyx_ptype_8petsc4py_5PETSc_DMPlex, 0, "subdm", 0))) __PYX_ERR(57, 1386, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_106labelCohesiveComplete(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_label, __pyx_v_bdlabel, __pyx_v_bdvalue, __pyx_v_flip, __pyx_v_subdm); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_106labelCohesiveComplete(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscDMLabelObject *__pyx_v_label, struct PyPetscDMLabelObject *__pyx_v_bdlabel, PyObject *__pyx_v_bdvalue, PyObject *__pyx_v_flip, struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_subdm) { PetscBool __pyx_v_flg; PetscInt __pyx_v_val; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; PetscInt __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("labelCohesiveComplete", 1); /* "petsc4py/PETSc/DMPlex.pyx":1410 * * """ * cdef PetscBool flg = flip # <<<<<<<<<<<<<< * cdef PetscInt val = asInt(bdvalue) * CHKERR( DMPlexLabelCohesiveComplete(self.dm, label.dmlabel, bdlabel.dmlabel, val, flg, subdm.dm) ) */ __pyx_t_1 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_flip)); if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 1410, __pyx_L1_error) __pyx_v_flg = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":1411 * """ * cdef PetscBool flg = flip * cdef PetscInt val = asInt(bdvalue) # <<<<<<<<<<<<<< * CHKERR( DMPlexLabelCohesiveComplete(self.dm, label.dmlabel, bdlabel.dmlabel, val, flg, subdm.dm) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_bdvalue); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(57, 1411, __pyx_L1_error) __pyx_v_val = __pyx_t_2; /* "petsc4py/PETSc/DMPlex.pyx":1412 * cdef PetscBool flg = flip * cdef PetscInt val = asInt(bdvalue) * CHKERR( DMPlexLabelCohesiveComplete(self.dm, label.dmlabel, bdlabel.dmlabel, val, flg, subdm.dm) ) # <<<<<<<<<<<<<< * * def setAdjacencyUseAnchors(self, useAnchors: bool = True) -> None: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexLabelCohesiveComplete(__pyx_v_self->__pyx_base.dm, __pyx_v_label->dmlabel, __pyx_v_bdlabel->dmlabel, __pyx_v_val, __pyx_v_flg, __pyx_v_subdm->__pyx_base.dm)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1412, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":1386 * CHKERR( DMPlexLabelComplete(self.dm, label.dmlabel) ) * * def labelCohesiveComplete(self, DMLabel label, DMLabel bdlabel, bdvalue: int, flip: bool, DMPlex subdm) -> None: # <<<<<<<<<<<<<< * """Add all other mesh pieces to complete the surface. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.labelCohesiveComplete", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":1414 * CHKERR( DMPlexLabelCohesiveComplete(self.dm, label.dmlabel, bdlabel.dmlabel, val, flg, subdm.dm) ) * * def setAdjacencyUseAnchors(self, useAnchors: bool = True) -> None: # <<<<<<<<<<<<<< * """Define adjacency in the mesh using the point-to-point constraints. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_109setAdjacencyUseAnchors(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_108setAdjacencyUseAnchors, "DMPlex.setAdjacencyUseAnchors(self, useAnchors: bool = True) -> None\nDefine adjacency in the mesh using the point-to-point constraints.\n\n Parameters\n ----------\n useAnchors\n Flag to use the constraints.\n If `True`, then constrained points are omitted from `DMPlex.getAdjacency`,\n and their anchor points appear in their place.\n\n See Also\n --------\n DMPlex, DMPlex.getAdjacency, DMPlex.distribute\n petsc.DMPlexSetAdjacencyUseAnchors\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:1414"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_109setAdjacencyUseAnchors(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_useAnchors = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setAdjacencyUseAnchors (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_useAnchors,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_True)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_useAnchors); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 1414, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setAdjacencyUseAnchors") < 0)) __PYX_ERR(57, 1414, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_useAnchors = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setAdjacencyUseAnchors", 0, 0, 1, __pyx_nargs); __PYX_ERR(57, 1414, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.setAdjacencyUseAnchors", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_108setAdjacencyUseAnchors(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_useAnchors); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_108setAdjacencyUseAnchors(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_useAnchors) { PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setAdjacencyUseAnchors", 1); /* "petsc4py/PETSc/DMPlex.pyx":1430 * * """ * cdef PetscBool flag = useAnchors # <<<<<<<<<<<<<< * CHKERR( DMPlexSetAdjacencyUseAnchors(self.dm, flag) ) * */ __pyx_t_1 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_useAnchors)); if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 1430, __pyx_L1_error) __pyx_v_flag = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":1431 * """ * cdef PetscBool flag = useAnchors * CHKERR( DMPlexSetAdjacencyUseAnchors(self.dm, flag) ) # <<<<<<<<<<<<<< * * def getAdjacencyUseAnchors(self) -> bool: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexSetAdjacencyUseAnchors(__pyx_v_self->__pyx_base.dm, __pyx_v_flag)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1431, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":1414 * CHKERR( DMPlexLabelCohesiveComplete(self.dm, label.dmlabel, bdlabel.dmlabel, val, flg, subdm.dm) ) * * def setAdjacencyUseAnchors(self, useAnchors: bool = True) -> None: # <<<<<<<<<<<<<< * """Define adjacency in the mesh using the point-to-point constraints. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.setAdjacencyUseAnchors", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":1433 * CHKERR( DMPlexSetAdjacencyUseAnchors(self.dm, flag) ) * * def getAdjacencyUseAnchors(self) -> bool: # <<<<<<<<<<<<<< * """Query whether adjacency in the mesh uses the point-to-point constraints. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_111getAdjacencyUseAnchors(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_110getAdjacencyUseAnchors, "DMPlex.getAdjacencyUseAnchors(self) -> bool\nQuery whether adjacency in the mesh uses the point-to-point constraints.\n\n See Also\n --------\n DMPlex, DMPlex.getAdjacency, DMPlex.distribute\n petsc.DMPlexGetAdjacencyUseAnchors\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:1433"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_111getAdjacencyUseAnchors(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getAdjacencyUseAnchors (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getAdjacencyUseAnchors", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getAdjacencyUseAnchors", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_110getAdjacencyUseAnchors(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_110getAdjacencyUseAnchors(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self) { PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getAdjacencyUseAnchors", 1); /* "petsc4py/PETSc/DMPlex.pyx":1442 * * """ * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( DMPlexGetAdjacencyUseAnchors(self.dm, &flag) ) * return toBool(flag) */ __pyx_v_flag = PETSC_FALSE; /* "petsc4py/PETSc/DMPlex.pyx":1443 * """ * cdef PetscBool flag = PETSC_FALSE * CHKERR( DMPlexGetAdjacencyUseAnchors(self.dm, &flag) ) # <<<<<<<<<<<<<< * return toBool(flag) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetAdjacencyUseAnchors(__pyx_v_self->__pyx_base.dm, (&__pyx_v_flag))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1443, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":1444 * cdef PetscBool flag = PETSC_FALSE * CHKERR( DMPlexGetAdjacencyUseAnchors(self.dm, &flag) ) * return toBool(flag) # <<<<<<<<<<<<<< * * def getAdjacency(self, p: int) -> ArrayInt: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(57, 1444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":1433 * CHKERR( DMPlexSetAdjacencyUseAnchors(self.dm, flag) ) * * def getAdjacencyUseAnchors(self) -> bool: # <<<<<<<<<<<<<< * """Query whether adjacency in the mesh uses the point-to-point constraints. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getAdjacencyUseAnchors", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":1446 * return toBool(flag) * * def getAdjacency(self, p: int) -> ArrayInt: # <<<<<<<<<<<<<< * """Return all points adjacent to the given point. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_113getAdjacency(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_112getAdjacency, "DMPlex.getAdjacency(self, p: int) -> ArrayInt\nReturn all points adjacent to the given point.\n\n Parameters\n ----------\n p\n The point.\n\n See Also\n --------\n DMPlex, DMPlex.distribute, petsc.DMPlexGetAdjacency\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:1446"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_113getAdjacency(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_p = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getAdjacency (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_p,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 1446, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getAdjacency") < 0)) __PYX_ERR(57, 1446, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_p = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getAdjacency", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 1446, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getAdjacency", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_112getAdjacency(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_p); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_112getAdjacency(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p) { PetscInt __pyx_v_cp; PetscInt __pyx_v_nadj; PetscInt *__pyx_v_iadj; PyArrayObject *__pyx_v_adjacency = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; char const *__pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getAdjacency", 1); /* "petsc4py/PETSc/DMPlex.pyx":1459 * * """ * cdef PetscInt cp = asInt(p) # <<<<<<<<<<<<<< * cdef PetscInt nadj = PETSC_DETERMINE * cdef PetscInt *iadj = NULL */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_p); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(57, 1459, __pyx_L1_error) __pyx_v_cp = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":1460 * """ * cdef PetscInt cp = asInt(p) * cdef PetscInt nadj = PETSC_DETERMINE # <<<<<<<<<<<<<< * cdef PetscInt *iadj = NULL * CHKERR( DMPlexGetAdjacency(self.dm, cp, &nadj, &iadj) ) */ __pyx_v_nadj = PETSC_DETERMINE; /* "petsc4py/PETSc/DMPlex.pyx":1461 * cdef PetscInt cp = asInt(p) * cdef PetscInt nadj = PETSC_DETERMINE * cdef PetscInt *iadj = NULL # <<<<<<<<<<<<<< * CHKERR( DMPlexGetAdjacency(self.dm, cp, &nadj, &iadj) ) * try: */ __pyx_v_iadj = NULL; /* "petsc4py/PETSc/DMPlex.pyx":1462 * cdef PetscInt nadj = PETSC_DETERMINE * cdef PetscInt *iadj = NULL * CHKERR( DMPlexGetAdjacency(self.dm, cp, &nadj, &iadj) ) # <<<<<<<<<<<<<< * try: * adjacency = array_i(nadj, iadj) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetAdjacency(__pyx_v_self->__pyx_base.dm, __pyx_v_cp, (&__pyx_v_nadj), (&__pyx_v_iadj))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1462, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":1463 * cdef PetscInt *iadj = NULL * CHKERR( DMPlexGetAdjacency(self.dm, cp, &nadj, &iadj) ) * try: # <<<<<<<<<<<<<< * adjacency = array_i(nadj, iadj) * finally: */ /*try:*/ { /* "petsc4py/PETSc/DMPlex.pyx":1464 * CHKERR( DMPlexGetAdjacency(self.dm, cp, &nadj, &iadj) ) * try: * adjacency = array_i(nadj, iadj) # <<<<<<<<<<<<<< * finally: * CHKERR( PetscFree(iadj) ) */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i(__pyx_v_nadj, __pyx_v_iadj)); if (unlikely(!__pyx_t_3)) __PYX_ERR(57, 1464, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_adjacency = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; } /* "petsc4py/PETSc/DMPlex.pyx":1466 * adjacency = array_i(nadj, iadj) * finally: * CHKERR( PetscFree(iadj) ) # <<<<<<<<<<<<<< * return adjacency * */ /*finally:*/ { /*normal exit:*/{ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_iadj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1466, __pyx_L1_error) goto __pyx_L5; } __pyx_L4_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename; { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_iadj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1466, __pyx_L7_error) } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); } __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9); __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6; goto __pyx_L1_error; __pyx_L7_error:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); } __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; goto __pyx_L1_error; } __pyx_L5:; } /* "petsc4py/PETSc/DMPlex.pyx":1467 * finally: * CHKERR( PetscFree(iadj) ) * return adjacency # <<<<<<<<<<<<<< * * def setPartitioner(self, Partitioner part): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_adjacency); __pyx_r = ((PyObject *)__pyx_v_adjacency); goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":1446 * return toBool(flag) * * def getAdjacency(self, p: int) -> ArrayInt: # <<<<<<<<<<<<<< * """Return all points adjacent to the given point. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getAdjacency", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_adjacency); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":1469 * return adjacency * * def setPartitioner(self, Partitioner part): # <<<<<<<<<<<<<< * """Set the mesh partitioner. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_115setPartitioner(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_114setPartitioner, "DMPlex.setPartitioner(self, part: Partitioner)\nSet the mesh partitioner.\n\n Logically collective.\n\n Parameters\n ----------\n part\n The partitioner.\n\n See Also\n --------\n DM, DMPlex, Partitioner, DMPlex.distribute, DMPlex.getPartitioner\n Partitioner.create, petsc.DMPlexSetPartitioner\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:1469"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_115setPartitioner(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscPartitionerObject *__pyx_v_part = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPartitioner (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_part,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_part)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 1469, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setPartitioner") < 0)) __PYX_ERR(57, 1469, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_part = ((struct PyPetscPartitionerObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPartitioner", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 1469, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.setPartitioner", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_part), __pyx_ptype_8petsc4py_5PETSc_Partitioner, 0, "part", 0))) __PYX_ERR(57, 1469, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_114setPartitioner(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_part); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_114setPartitioner(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscPartitionerObject *__pyx_v_part) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPartitioner", 1); /* "petsc4py/PETSc/DMPlex.pyx":1485 * * """ * CHKERR( DMPlexSetPartitioner(self.dm, part.part) ) # <<<<<<<<<<<<<< * * def getPartitioner(self) -> Partitioner: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexSetPartitioner(__pyx_v_self->__pyx_base.dm, __pyx_v_part->part)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1485, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":1469 * return adjacency * * def setPartitioner(self, Partitioner part): # <<<<<<<<<<<<<< * """Set the mesh partitioner. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.setPartitioner", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":1487 * CHKERR( DMPlexSetPartitioner(self.dm, part.part) ) * * def getPartitioner(self) -> Partitioner: # <<<<<<<<<<<<<< * """Return the mesh partitioner. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_117getPartitioner(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_116getPartitioner, "DMPlex.getPartitioner(self) -> Partitioner\nReturn the mesh partitioner.\n\n Not collective.\n\n See Also\n --------\n DM, DMPlex, Partitioner, Section, DMPlex.distribute\n DMPlex.setPartitioner, Partitioner.create\n petsc.PetscPartitionerDMPlexPartition, petsc.DMPlexGetPartitioner\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:1487"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_117getPartitioner(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getPartitioner (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getPartitioner", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getPartitioner", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_116getPartitioner(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_116getPartitioner(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self) { struct PyPetscPartitionerObject *__pyx_v_part = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getPartitioner", 1); /* "petsc4py/PETSc/DMPlex.pyx":1499 * * """ * cdef Partitioner part = Partitioner() # <<<<<<<<<<<<<< * CHKERR( DMPlexGetPartitioner(self.dm, &part.part) ) * CHKERR( PetscINCREF(part.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Partitioner)); if (unlikely(!__pyx_t_1)) __PYX_ERR(57, 1499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_part = ((struct PyPetscPartitionerObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DMPlex.pyx":1500 * """ * cdef Partitioner part = Partitioner() * CHKERR( DMPlexGetPartitioner(self.dm, &part.part) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(part.obj) ) * return part */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetPartitioner(__pyx_v_self->__pyx_base.dm, (&__pyx_v_part->part))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1500, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":1501 * cdef Partitioner part = Partitioner() * CHKERR( DMPlexGetPartitioner(self.dm, &part.part) ) * CHKERR( PetscINCREF(part.obj) ) # <<<<<<<<<<<<<< * return part * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_part->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1501, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":1502 * CHKERR( DMPlexGetPartitioner(self.dm, &part.part) ) * CHKERR( PetscINCREF(part.obj) ) * return part # <<<<<<<<<<<<<< * * def rebalanceSharedPoints(self, entityDepth: int | None = 0, useInitialGuess: bool | None = True, parallel: bool | None = True) -> bool: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_part); __pyx_r = ((PyObject *)__pyx_v_part); goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":1487 * CHKERR( DMPlexSetPartitioner(self.dm, part.part) ) * * def getPartitioner(self) -> Partitioner: # <<<<<<<<<<<<<< * """Return the mesh partitioner. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getPartitioner", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_part); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":1504 * return part * * def rebalanceSharedPoints(self, entityDepth: int | None = 0, useInitialGuess: bool | None = True, parallel: bool | None = True) -> bool: # <<<<<<<<<<<<<< * """Redistribute shared points in order to achieve better balancing. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_119rebalanceSharedPoints(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_118rebalanceSharedPoints, "DMPlex.rebalanceSharedPoints(self, entityDepth: int | None = 0, useInitialGuess: bool | None = True, parallel: bool | None = True) -> bool\nRedistribute shared points in order to achieve better balancing.\n\n Parameters\n ----------\n entityDepth\n Depth of the entity to balance (e.g., 0 -> balance vertices).\n useInitialGuess\n Whether to use the current distribution as initial guess.\n parallel\n Whether to use ParMETIS and do the partition in parallel\n or gather the graph onto a single process.\n\n Returns\n -------\n success : bool\n Whether the graph partitioning was successful or not.\n Unsuccessful simply means no change to the partitioning.\n\n See Also\n --------\n DM, DMPlex, DMPlex.distribute, petsc_options\n petsc.DMPlexRebalanceSharedPoints\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:1504"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_119rebalanceSharedPoints(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_entityDepth = 0; PyObject *__pyx_v_useInitialGuess = 0; PyObject *__pyx_v_parallel = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("rebalanceSharedPoints (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_entityDepth,&__pyx_n_s_useInitialGuess,&__pyx_n_s_parallel,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_0)); values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_True)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_True)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_entityDepth); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 1504, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_useInitialGuess); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 1504, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_parallel); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 1504, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "rebalanceSharedPoints") < 0)) __PYX_ERR(57, 1504, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_entityDepth = values[0]; __pyx_v_useInitialGuess = values[1]; __pyx_v_parallel = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("rebalanceSharedPoints", 0, 0, 3, __pyx_nargs); __PYX_ERR(57, 1504, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.rebalanceSharedPoints", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_118rebalanceSharedPoints(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_entityDepth, __pyx_v_useInitialGuess, __pyx_v_parallel); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_118rebalanceSharedPoints(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_entityDepth, PyObject *__pyx_v_useInitialGuess, PyObject *__pyx_v_parallel) { PetscInt __pyx_v_centityDepth; PetscBool __pyx_v_cuseInitialGuess; PetscBool __pyx_v_cparallel; PetscBool __pyx_v_csuccess; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscBool __pyx_t_2; PetscErrorCode __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("rebalanceSharedPoints", 1); /* "petsc4py/PETSc/DMPlex.pyx":1529 * * """ * cdef PetscInt centityDepth = asInt(entityDepth) # <<<<<<<<<<<<<< * cdef PetscBool cuseInitialGuess = asBool(useInitialGuess) * cdef PetscBool cparallel = asBool(parallel) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_entityDepth); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(57, 1529, __pyx_L1_error) __pyx_v_centityDepth = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":1530 * """ * cdef PetscInt centityDepth = asInt(entityDepth) * cdef PetscBool cuseInitialGuess = asBool(useInitialGuess) # <<<<<<<<<<<<<< * cdef PetscBool cparallel = asBool(parallel) * cdef PetscBool csuccess = PETSC_FALSE */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asBool(__pyx_v_useInitialGuess); if (unlikely(__pyx_t_2 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(57, 1530, __pyx_L1_error) __pyx_v_cuseInitialGuess = __pyx_t_2; /* "petsc4py/PETSc/DMPlex.pyx":1531 * cdef PetscInt centityDepth = asInt(entityDepth) * cdef PetscBool cuseInitialGuess = asBool(useInitialGuess) * cdef PetscBool cparallel = asBool(parallel) # <<<<<<<<<<<<<< * cdef PetscBool csuccess = PETSC_FALSE * CHKERR( DMPlexRebalanceSharedPoints(self.dm, centityDepth, cuseInitialGuess, cparallel, &csuccess) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asBool(__pyx_v_parallel); if (unlikely(__pyx_t_2 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(57, 1531, __pyx_L1_error) __pyx_v_cparallel = __pyx_t_2; /* "petsc4py/PETSc/DMPlex.pyx":1532 * cdef PetscBool cuseInitialGuess = asBool(useInitialGuess) * cdef PetscBool cparallel = asBool(parallel) * cdef PetscBool csuccess = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( DMPlexRebalanceSharedPoints(self.dm, centityDepth, cuseInitialGuess, cparallel, &csuccess) ) * return toBool(csuccess) */ __pyx_v_csuccess = PETSC_FALSE; /* "petsc4py/PETSc/DMPlex.pyx":1533 * cdef PetscBool cparallel = asBool(parallel) * cdef PetscBool csuccess = PETSC_FALSE * CHKERR( DMPlexRebalanceSharedPoints(self.dm, centityDepth, cuseInitialGuess, cparallel, &csuccess) ) # <<<<<<<<<<<<<< * return toBool(csuccess) * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexRebalanceSharedPoints(__pyx_v_self->__pyx_base.dm, __pyx_v_centityDepth, __pyx_v_cuseInitialGuess, __pyx_v_cparallel, (&__pyx_v_csuccess))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1533, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":1534 * cdef PetscBool csuccess = PETSC_FALSE * CHKERR( DMPlexRebalanceSharedPoints(self.dm, centityDepth, cuseInitialGuess, cparallel, &csuccess) ) * return toBool(csuccess) # <<<<<<<<<<<<<< * * def distribute(self, overlap: int | None = 0) -> SF or None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_csuccess); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 1534, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":1504 * return part * * def rebalanceSharedPoints(self, entityDepth: int | None = 0, useInitialGuess: bool | None = True, parallel: bool | None = True) -> bool: # <<<<<<<<<<<<<< * """Redistribute shared points in order to achieve better balancing. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.rebalanceSharedPoints", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":1536 * return toBool(csuccess) * * def distribute(self, overlap: int | None = 0) -> SF or None: # <<<<<<<<<<<<<< * """Distribute the mesh and any associated sections. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_121distribute(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_120distribute, "DMPlex.distribute(self, overlap: int | None = 0) -> SF or None\nDistribute the mesh and any associated sections.\n\n Collective.\n\n Parameters\n ----------\n overlap\n The overlap of partitions.\n\n Returns\n -------\n sf : SF or None\n The `SF` used for point distribution, or `None` if not distributed.\n\n See Also\n --------\n DM, DMPlex, DMPlex.create, petsc.DMPlexDistribute\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:1536"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_121distribute(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_overlap = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("distribute (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_overlap,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_0)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_overlap); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 1536, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "distribute") < 0)) __PYX_ERR(57, 1536, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_overlap = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("distribute", 0, 0, 1, __pyx_nargs); __PYX_ERR(57, 1536, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.distribute", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_120distribute(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_overlap); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_120distribute(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_overlap) { DM __pyx_v_dmParallel; PetscInt __pyx_v_coverlap; struct PyPetscSFObject *__pyx_v_sf = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("distribute", 1); /* "petsc4py/PETSc/DMPlex.pyx":1556 * * """ * cdef PetscDM dmParallel = NULL # <<<<<<<<<<<<<< * cdef PetscInt coverlap = asInt(overlap) * cdef SF sf = SF() */ __pyx_v_dmParallel = NULL; /* "petsc4py/PETSc/DMPlex.pyx":1557 * """ * cdef PetscDM dmParallel = NULL * cdef PetscInt coverlap = asInt(overlap) # <<<<<<<<<<<<<< * cdef SF sf = SF() * CHKERR( DMPlexDistribute(self.dm, coverlap, &sf.sf, &dmParallel) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_overlap); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(57, 1557, __pyx_L1_error) __pyx_v_coverlap = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":1558 * cdef PetscDM dmParallel = NULL * cdef PetscInt coverlap = asInt(overlap) * cdef SF sf = SF() # <<<<<<<<<<<<<< * CHKERR( DMPlexDistribute(self.dm, coverlap, &sf.sf, &dmParallel) ) * if dmParallel != NULL: */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SF)); if (unlikely(!__pyx_t_2)) __PYX_ERR(57, 1558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_sf = ((struct PyPetscSFObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DMPlex.pyx":1559 * cdef PetscInt coverlap = asInt(overlap) * cdef SF sf = SF() * CHKERR( DMPlexDistribute(self.dm, coverlap, &sf.sf, &dmParallel) ) # <<<<<<<<<<<<<< * if dmParallel != NULL: * CHKERR( PetscCLEAR(self.obj) ); self.dm = dmParallel */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexDistribute(__pyx_v_self->__pyx_base.dm, __pyx_v_coverlap, (&__pyx_v_sf->sf), (&__pyx_v_dmParallel))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1559, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":1560 * cdef SF sf = SF() * CHKERR( DMPlexDistribute(self.dm, coverlap, &sf.sf, &dmParallel) ) * if dmParallel != NULL: # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.dm = dmParallel * return sf */ __pyx_t_4 = (__pyx_v_dmParallel != NULL); if (__pyx_t_4) { /* "petsc4py/PETSc/DMPlex.pyx":1561 * CHKERR( DMPlexDistribute(self.dm, coverlap, &sf.sf, &dmParallel) ) * if dmParallel != NULL: * CHKERR( PetscCLEAR(self.obj) ); self.dm = dmParallel # <<<<<<<<<<<<<< * return sf * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1561, __pyx_L1_error) __pyx_v_self->__pyx_base.dm = __pyx_v_dmParallel; /* "petsc4py/PETSc/DMPlex.pyx":1562 * if dmParallel != NULL: * CHKERR( PetscCLEAR(self.obj) ); self.dm = dmParallel * return sf # <<<<<<<<<<<<<< * * def distributeOverlap(self, overlap: int | None = 0) -> SF: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_sf); __pyx_r = ((PyObject *)__pyx_v_sf); goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":1560 * cdef SF sf = SF() * CHKERR( DMPlexDistribute(self.dm, coverlap, &sf.sf, &dmParallel) ) * if dmParallel != NULL: # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.dm = dmParallel * return sf */ } /* "petsc4py/PETSc/DMPlex.pyx":1536 * return toBool(csuccess) * * def distribute(self, overlap: int | None = 0) -> SF or None: # <<<<<<<<<<<<<< * """Distribute the mesh and any associated sections. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.distribute", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_sf); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":1564 * return sf * * def distributeOverlap(self, overlap: int | None = 0) -> SF: # <<<<<<<<<<<<<< * """Add partition overlap to a distributed non-overlapping `DMPlex`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_123distributeOverlap(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_122distributeOverlap, "DMPlex.distributeOverlap(self, overlap: int | None = 0) -> SF\nAdd partition overlap to a distributed non-overlapping `DMPlex`.\n\n Collective.\n\n Parameters\n ----------\n overlap\n The overlap of partitions (the same on all ranks).\n\n Returns\n -------\n sf : SF\n The `SF` used for point distribution.\n\n See Also\n --------\n DM, DMPlex, SF, DMPlex.create, DMPlex.distribute,\n petsc.DMPlexDistributeOverlap\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:1564"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_123distributeOverlap(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_overlap = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("distributeOverlap (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_overlap,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_0)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_overlap); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 1564, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "distributeOverlap") < 0)) __PYX_ERR(57, 1564, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_overlap = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("distributeOverlap", 0, 0, 1, __pyx_nargs); __PYX_ERR(57, 1564, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.distributeOverlap", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_122distributeOverlap(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_overlap); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_122distributeOverlap(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_overlap) { PetscInt __pyx_v_coverlap; struct PyPetscSFObject *__pyx_v_sf = 0; DM __pyx_v_dmOverlap; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("distributeOverlap", 1); /* "petsc4py/PETSc/DMPlex.pyx":1585 * * """ * cdef PetscInt coverlap = asInt(overlap) # <<<<<<<<<<<<<< * cdef SF sf = SF() * cdef PetscDM dmOverlap = NULL */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_overlap); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(57, 1585, __pyx_L1_error) __pyx_v_coverlap = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":1586 * """ * cdef PetscInt coverlap = asInt(overlap) * cdef SF sf = SF() # <<<<<<<<<<<<<< * cdef PetscDM dmOverlap = NULL * CHKERR( DMPlexDistributeOverlap(self.dm, coverlap, */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SF)); if (unlikely(!__pyx_t_2)) __PYX_ERR(57, 1586, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_sf = ((struct PyPetscSFObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DMPlex.pyx":1587 * cdef PetscInt coverlap = asInt(overlap) * cdef SF sf = SF() * cdef PetscDM dmOverlap = NULL # <<<<<<<<<<<<<< * CHKERR( DMPlexDistributeOverlap(self.dm, coverlap, * &sf.sf, &dmOverlap) ) */ __pyx_v_dmOverlap = NULL; /* "petsc4py/PETSc/DMPlex.pyx":1588 * cdef SF sf = SF() * cdef PetscDM dmOverlap = NULL * CHKERR( DMPlexDistributeOverlap(self.dm, coverlap, # <<<<<<<<<<<<<< * &sf.sf, &dmOverlap) ) * CHKERR( PetscCLEAR(self.obj) ); self.dm = dmOverlap */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexDistributeOverlap(__pyx_v_self->__pyx_base.dm, __pyx_v_coverlap, (&__pyx_v_sf->sf), (&__pyx_v_dmOverlap))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1588, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":1590 * CHKERR( DMPlexDistributeOverlap(self.dm, coverlap, * &sf.sf, &dmOverlap) ) * CHKERR( PetscCLEAR(self.obj) ); self.dm = dmOverlap # <<<<<<<<<<<<<< * return sf * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1590, __pyx_L1_error) __pyx_v_self->__pyx_base.dm = __pyx_v_dmOverlap; /* "petsc4py/PETSc/DMPlex.pyx":1591 * &sf.sf, &dmOverlap) ) * CHKERR( PetscCLEAR(self.obj) ); self.dm = dmOverlap * return sf # <<<<<<<<<<<<<< * * def isDistributed(self) -> bool: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_sf); __pyx_r = ((PyObject *)__pyx_v_sf); goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":1564 * return sf * * def distributeOverlap(self, overlap: int | None = 0) -> SF: # <<<<<<<<<<<<<< * """Add partition overlap to a distributed non-overlapping `DMPlex`. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.distributeOverlap", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_sf); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":1593 * return sf * * def isDistributed(self) -> bool: # <<<<<<<<<<<<<< * """Return the flag indicating if the mesh is distributed. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_125isDistributed(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_124isDistributed, "DMPlex.isDistributed(self) -> bool\nReturn the flag indicating if the mesh is distributed.\n\n Collective.\n\n See Also\n --------\n DM, DMPlex, DMPlex.distribute, petsc.DMPlexIsDistributed\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:1593"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_125isDistributed(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("isDistributed (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("isDistributed", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "isDistributed", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_124isDistributed(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_124isDistributed(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self) { PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("isDistributed", 1); /* "petsc4py/PETSc/DMPlex.pyx":1603 * * """ * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( DMPlexIsDistributed(self.dm, &flag) ) * return toBool(flag) */ __pyx_v_flag = PETSC_FALSE; /* "petsc4py/PETSc/DMPlex.pyx":1604 * """ * cdef PetscBool flag = PETSC_FALSE * CHKERR( DMPlexIsDistributed(self.dm, &flag) ) # <<<<<<<<<<<<<< * return toBool(flag) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexIsDistributed(__pyx_v_self->__pyx_base.dm, (&__pyx_v_flag))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1604, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":1605 * cdef PetscBool flag = PETSC_FALSE * CHKERR( DMPlexIsDistributed(self.dm, &flag) ) * return toBool(flag) # <<<<<<<<<<<<<< * * def isSimplex(self) -> bool: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(57, 1605, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":1593 * return sf * * def isDistributed(self) -> bool: # <<<<<<<<<<<<<< * """Return the flag indicating if the mesh is distributed. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.isDistributed", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":1607 * return toBool(flag) * * def isSimplex(self) -> bool: # <<<<<<<<<<<<<< * """Return the flag indicating if the first cell is a simplex. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_127isSimplex(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_126isSimplex, "DMPlex.isSimplex(self) -> bool\nReturn the flag indicating if the first cell is a simplex.\n\n See Also\n --------\n DM, DMPlex, DMPlex.getCellType, DMPlex.getHeightStratum\n petsc.DMPlexIsSimplex\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:1607"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_127isSimplex(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("isSimplex (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("isSimplex", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "isSimplex", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_126isSimplex(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_126isSimplex(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self) { PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("isSimplex", 1); /* "petsc4py/PETSc/DMPlex.pyx":1616 * * """ * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( DMPlexIsSimplex(self.dm, &flag) ) * return toBool(flag) */ __pyx_v_flag = PETSC_FALSE; /* "petsc4py/PETSc/DMPlex.pyx":1617 * """ * cdef PetscBool flag = PETSC_FALSE * CHKERR( DMPlexIsSimplex(self.dm, &flag) ) # <<<<<<<<<<<<<< * return toBool(flag) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexIsSimplex(__pyx_v_self->__pyx_base.dm, (&__pyx_v_flag))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1617, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":1618 * cdef PetscBool flag = PETSC_FALSE * CHKERR( DMPlexIsSimplex(self.dm, &flag) ) * return toBool(flag) # <<<<<<<<<<<<<< * * def distributeGetDefault(self) -> bool: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(57, 1618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":1607 * return toBool(flag) * * def isSimplex(self) -> bool: # <<<<<<<<<<<<<< * """Return the flag indicating if the first cell is a simplex. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.isSimplex", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":1620 * return toBool(flag) * * def distributeGetDefault(self) -> bool: # <<<<<<<<<<<<<< * """Return a flag indicating whether the `DM` should be distributed by default. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_129distributeGetDefault(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_128distributeGetDefault, "DMPlex.distributeGetDefault(self) -> bool\nReturn a flag indicating whether the `DM` should be distributed by default.\n\n Not collective.\n\n Returns\n -------\n dist : bool\n Flag indicating whether the `DMPlex` should be distributed by default.\n\n See Also\n --------\n DM, DMPlex, DMPlex.distributeSetDefault, DMPlex.distribute\n petsc.DMPlexDistributeGetDefault\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:1620"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_129distributeGetDefault(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("distributeGetDefault (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("distributeGetDefault", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "distributeGetDefault", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_128distributeGetDefault(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_128distributeGetDefault(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self) { PetscBool __pyx_v_dist; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("distributeGetDefault", 1); /* "petsc4py/PETSc/DMPlex.pyx":1636 * * """ * cdef PetscBool dist = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( DMPlexDistributeGetDefault(self.dm, &dist) ) * return toBool(dist) */ __pyx_v_dist = PETSC_FALSE; /* "petsc4py/PETSc/DMPlex.pyx":1637 * """ * cdef PetscBool dist = PETSC_FALSE * CHKERR( DMPlexDistributeGetDefault(self.dm, &dist) ) # <<<<<<<<<<<<<< * return toBool(dist) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexDistributeGetDefault(__pyx_v_self->__pyx_base.dm, (&__pyx_v_dist))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1637, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":1638 * cdef PetscBool dist = PETSC_FALSE * CHKERR( DMPlexDistributeGetDefault(self.dm, &dist) ) * return toBool(dist) # <<<<<<<<<<<<<< * * def distributeSetDefault(self, flag: bool) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_dist); if (unlikely(!__pyx_t_2)) __PYX_ERR(57, 1638, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":1620 * return toBool(flag) * * def distributeGetDefault(self) -> bool: # <<<<<<<<<<<<<< * """Return a flag indicating whether the `DM` should be distributed by default. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.distributeGetDefault", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":1640 * return toBool(dist) * * def distributeSetDefault(self, flag: bool) -> None: # <<<<<<<<<<<<<< * """Set flag indicating whether the `DMPlex` should be distributed by default. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_131distributeSetDefault(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_130distributeSetDefault, "DMPlex.distributeSetDefault(self, flag: bool) -> None\nSet flag indicating whether the `DMPlex` should be distributed by default.\n\n Logically collective.\n\n Parameters\n ----------\n flag\n Flag indicating whether the `DMPlex` should be distributed by default.\n\n See Also\n --------\n DMPlex, DMPlex.distributeGetDefault, DMPlex.distribute\n petsc.DMPlexDistributeSetDefault\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:1640"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_131distributeSetDefault(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_flag = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("distributeSetDefault (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flag)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 1640, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "distributeSetDefault") < 0)) __PYX_ERR(57, 1640, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_flag = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("distributeSetDefault", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 1640, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.distributeSetDefault", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_130distributeSetDefault(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_flag); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_130distributeSetDefault(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_flag) { PetscBool __pyx_v_dist; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("distributeSetDefault", 1); /* "petsc4py/PETSc/DMPlex.pyx":1656 * * """ * cdef PetscBool dist = asBool(flag) # <<<<<<<<<<<<<< * CHKERR( DMPlexDistributeSetDefault(self.dm, dist) ) * return */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asBool(__pyx_v_flag); if (unlikely(__pyx_t_1 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(57, 1656, __pyx_L1_error) __pyx_v_dist = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":1657 * """ * cdef PetscBool dist = asBool(flag) * CHKERR( DMPlexDistributeSetDefault(self.dm, dist) ) # <<<<<<<<<<<<<< * return * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexDistributeSetDefault(__pyx_v_self->__pyx_base.dm, __pyx_v_dist)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1657, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":1658 * cdef PetscBool dist = asBool(flag) * CHKERR( DMPlexDistributeSetDefault(self.dm, dist) ) * return # <<<<<<<<<<<<<< * * def distributionSetName(self, name: str) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":1640 * return toBool(dist) * * def distributeSetDefault(self, flag: bool) -> None: # <<<<<<<<<<<<<< * """Set flag indicating whether the `DMPlex` should be distributed by default. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.distributeSetDefault", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":1660 * return * * def distributionSetName(self, name: str) -> None: # <<<<<<<<<<<<<< * """Set the name of the specific parallel distribution. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_133distributionSetName(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_132distributionSetName, "DMPlex.distributionSetName(self, name: str) -> None\nSet the name of the specific parallel distribution.\n\n Parameters\n ----------\n name\n The name of the specific parallel distribution.\n\n See Also\n --------\n DMPlex, DMPlex.distributionGetName, DMPlex.topologyView\n DMPlex.topologyLoad, petsc.DMPlexDistributionSetName\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:1660"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_133distributionSetName(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_name = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("distributionSetName (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 1660, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "distributionSetName") < 0)) __PYX_ERR(57, 1660, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_name = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("distributionSetName", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 1660, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.distributionSetName", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_132distributionSetName(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_name); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_132distributionSetName(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_name) { char const *__pyx_v_cname; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("distributionSetName", 0); __Pyx_INCREF(__pyx_v_name); /* "petsc4py/PETSc/DMPlex.pyx":1674 * * """ * cdef const char *cname = NULL # <<<<<<<<<<<<<< * if name is not None: * name = str2bytes(name, &cname) */ __pyx_v_cname = NULL; /* "petsc4py/PETSc/DMPlex.pyx":1675 * """ * cdef const char *cname = NULL * if name is not None: # <<<<<<<<<<<<<< * name = str2bytes(name, &cname) * CHKERR( DMPlexDistributionSetName(self.dm, cname) ) */ __pyx_t_1 = (__pyx_v_name != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/DMPlex.pyx":1676 * cdef const char *cname = NULL * if name is not None: * name = str2bytes(name, &cname) # <<<<<<<<<<<<<< * CHKERR( DMPlexDistributionSetName(self.dm, cname) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cname)); if (unlikely(!__pyx_t_2)) __PYX_ERR(57, 1676, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DMPlex.pyx":1675 * """ * cdef const char *cname = NULL * if name is not None: # <<<<<<<<<<<<<< * name = str2bytes(name, &cname) * CHKERR( DMPlexDistributionSetName(self.dm, cname) ) */ } /* "petsc4py/PETSc/DMPlex.pyx":1677 * if name is not None: * name = str2bytes(name, &cname) * CHKERR( DMPlexDistributionSetName(self.dm, cname) ) # <<<<<<<<<<<<<< * * def distributionGetName(self) -> str: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexDistributionSetName(__pyx_v_self->__pyx_base.dm, __pyx_v_cname)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1677, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":1660 * return * * def distributionSetName(self, name: str) -> None: # <<<<<<<<<<<<<< * """Set the name of the specific parallel distribution. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.distributionSetName", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":1679 * CHKERR( DMPlexDistributionSetName(self.dm, cname) ) * * def distributionGetName(self) -> str: # <<<<<<<<<<<<<< * """Retrieve the name of the specific parallel distribution. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_135distributionGetName(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_134distributionGetName, "DMPlex.distributionGetName(self) -> str\nRetrieve the name of the specific parallel distribution.\n\n Returns\n -------\n name : str\n The name of the specific parallel distribution.\n\n See Also\n --------\n DMPlex, DMPlex.distributionSetName, DMPlex.topologyView\n DMPlex.topologyLoad, petsc.DMPlexDistributionGetName\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:1679"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_135distributionGetName(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("distributionGetName (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("distributionGetName", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "distributionGetName", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_134distributionGetName(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_134distributionGetName(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self) { char const *__pyx_v_cname; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("distributionGetName", 1); /* "petsc4py/PETSc/DMPlex.pyx":1693 * * """ * cdef const char *cname = NULL # <<<<<<<<<<<<<< * CHKERR( DMPlexDistributionGetName(self.dm, &cname) ) * return bytes2str(cname) */ __pyx_v_cname = NULL; /* "petsc4py/PETSc/DMPlex.pyx":1694 * """ * cdef const char *cname = NULL * CHKERR( DMPlexDistributionGetName(self.dm, &cname) ) # <<<<<<<<<<<<<< * return bytes2str(cname) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexDistributionGetName(__pyx_v_self->__pyx_base.dm, (&__pyx_v_cname))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1694, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":1695 * cdef const char *cname = NULL * CHKERR( DMPlexDistributionGetName(self.dm, &cname) ) * return bytes2str(cname) # <<<<<<<<<<<<<< * * def interpolate(self) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cname); if (unlikely(!__pyx_t_2)) __PYX_ERR(57, 1695, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":1679 * CHKERR( DMPlexDistributionSetName(self.dm, cname) ) * * def distributionGetName(self) -> str: # <<<<<<<<<<<<<< * """Retrieve the name of the specific parallel distribution. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.distributionGetName", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":1697 * return bytes2str(cname) * * def interpolate(self) -> None: # <<<<<<<<<<<<<< * """Convert to a mesh with all intermediate faces, edges, etc. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_137interpolate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_136interpolate, "DMPlex.interpolate(self) -> None\nConvert to a mesh with all intermediate faces, edges, etc.\n\n Collective.\n\n See Also\n --------\n DMPlex, DMPlex.uninterpolate, DMPlex.createFromCellList\n petsc.DMPlexInterpolate\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:1697"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_137interpolate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("interpolate (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("interpolate", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "interpolate", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_136interpolate(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_136interpolate(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self) { DM __pyx_v_newdm; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("interpolate", 1); /* "petsc4py/PETSc/DMPlex.pyx":1708 * * """ * cdef PetscDM newdm = NULL # <<<<<<<<<<<<<< * CHKERR( DMPlexInterpolate(self.dm, &newdm) ) * CHKERR( PetscCLEAR(self.obj) ); self.dm = newdm */ __pyx_v_newdm = NULL; /* "petsc4py/PETSc/DMPlex.pyx":1709 * """ * cdef PetscDM newdm = NULL * CHKERR( DMPlexInterpolate(self.dm, &newdm) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.dm = newdm * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexInterpolate(__pyx_v_self->__pyx_base.dm, (&__pyx_v_newdm))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1709, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":1710 * cdef PetscDM newdm = NULL * CHKERR( DMPlexInterpolate(self.dm, &newdm) ) * CHKERR( PetscCLEAR(self.obj) ); self.dm = newdm # <<<<<<<<<<<<<< * * def uninterpolate(self) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.__pyx_base.obj)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1710, __pyx_L1_error) __pyx_v_self->__pyx_base.dm = __pyx_v_newdm; /* "petsc4py/PETSc/DMPlex.pyx":1697 * return bytes2str(cname) * * def interpolate(self) -> None: # <<<<<<<<<<<<<< * """Convert to a mesh with all intermediate faces, edges, etc. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.interpolate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":1712 * CHKERR( PetscCLEAR(self.obj) ); self.dm = newdm * * def uninterpolate(self) -> None: # <<<<<<<<<<<<<< * """Convert to a mesh with only cells and vertices. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_139uninterpolate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_138uninterpolate, "DMPlex.uninterpolate(self) -> None\nConvert to a mesh with only cells and vertices.\n\n Collective.\n\n See Also\n --------\n DMPlex, DMPlex.interpolate, DMPlex.createFromCellList\n petsc.DMPlexUninterpolate\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:1712"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_139uninterpolate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("uninterpolate (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("uninterpolate", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "uninterpolate", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_138uninterpolate(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_138uninterpolate(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self) { DM __pyx_v_newdm; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("uninterpolate", 1); /* "petsc4py/PETSc/DMPlex.pyx":1723 * * """ * cdef PetscDM newdm = NULL # <<<<<<<<<<<<<< * CHKERR( DMPlexUninterpolate(self.dm, &newdm) ) * CHKERR( PetscCLEAR(self.obj) ); self.dm = newdm */ __pyx_v_newdm = NULL; /* "petsc4py/PETSc/DMPlex.pyx":1724 * """ * cdef PetscDM newdm = NULL * CHKERR( DMPlexUninterpolate(self.dm, &newdm) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.dm = newdm * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexUninterpolate(__pyx_v_self->__pyx_base.dm, (&__pyx_v_newdm))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1724, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":1725 * cdef PetscDM newdm = NULL * CHKERR( DMPlexUninterpolate(self.dm, &newdm) ) * CHKERR( PetscCLEAR(self.obj) ); self.dm = newdm # <<<<<<<<<<<<<< * * def distributeField(self, SF sf, Section sec, Vec vec, */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.__pyx_base.obj)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1725, __pyx_L1_error) __pyx_v_self->__pyx_base.dm = __pyx_v_newdm; /* "petsc4py/PETSc/DMPlex.pyx":1712 * CHKERR( PetscCLEAR(self.obj) ); self.dm = newdm * * def uninterpolate(self) -> None: # <<<<<<<<<<<<<< * """Convert to a mesh with only cells and vertices. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.uninterpolate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":1727 * CHKERR( PetscCLEAR(self.obj) ); self.dm = newdm * * def distributeField(self, SF sf, Section sec, Vec vec, # <<<<<<<<<<<<<< * Section newsec=None, Vec newvec=None) -> tuple[Section, Vec]: * """Distribute field data with a with a given `SF`. */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_141distributeField(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_140distributeField, "DMPlex.distributeField(self, sf: SF, sec: Section, vec: Vec, newsec: Section | None = None, newvec: Vec | None = None) -> tuple[Section, Vec]\nDistribute field data with a with a given `SF`.\n\n Collective.\n\n Parameters\n ----------\n sf\n The `SF` describing the communication pattern.\n sec\n The `Section` for existing data layout.\n vec\n The existing data in a local vector.\n newsec\n The `SF` describing the new data layout.\n newvec\n The new data in a local vector.\n\n Returns\n -------\n newSection : Section\n The `SF` describing the new data layout.\n newVec : Vec\n The new data in a local vector.\n\n See Also\n --------\n DMPlex, DMPlex.distribute, petsc.DMPlexDistributeField\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:1727"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_141distributeField(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscSFObject *__pyx_v_sf = 0; struct PyPetscSectionObject *__pyx_v_sec = 0; struct PyPetscVecObject *__pyx_v_vec = 0; struct PyPetscSectionObject *__pyx_v_newsec = 0; struct PyPetscVecObject *__pyx_v_newvec = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("distributeField (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sf,&__pyx_n_s_sec,&__pyx_n_s_vec,&__pyx_n_s_newsec,&__pyx_n_s_newvec,0}; /* "petsc4py/PETSc/DMPlex.pyx":1728 * * def distributeField(self, SF sf, Section sec, Vec vec, * Section newsec=None, Vec newvec=None) -> tuple[Section, Vec]: # <<<<<<<<<<<<<< * """Distribute field data with a with a given `SF`. * */ values[3] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscSectionObject *)Py_None)); values[4] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscVecObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sf)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 1727, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sec)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 1727, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("distributeField", 0, 3, 5, 1); __PYX_ERR(57, 1727, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vec)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 1727, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("distributeField", 0, 3, 5, 2); __PYX_ERR(57, 1727, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_newsec); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 1727, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_newvec); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 1727, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "distributeField") < 0)) __PYX_ERR(57, 1727, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_sf = ((struct PyPetscSFObject *)values[0]); __pyx_v_sec = ((struct PyPetscSectionObject *)values[1]); __pyx_v_vec = ((struct PyPetscVecObject *)values[2]); __pyx_v_newsec = ((struct PyPetscSectionObject *)values[3]); __pyx_v_newvec = ((struct PyPetscVecObject *)values[4]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("distributeField", 0, 3, 5, __pyx_nargs); __PYX_ERR(57, 1727, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.distributeField", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sf), __pyx_ptype_8petsc4py_5PETSc_SF, 0, "sf", 0))) __PYX_ERR(57, 1727, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sec), __pyx_ptype_8petsc4py_5PETSc_Section, 0, "sec", 0))) __PYX_ERR(57, 1727, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(57, 1727, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_newsec), __pyx_ptype_8petsc4py_5PETSc_Section, 1, "newsec", 0))) __PYX_ERR(57, 1728, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_newvec), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "newvec", 0))) __PYX_ERR(57, 1728, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_140distributeField(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_sf, __pyx_v_sec, __pyx_v_vec, __pyx_v_newsec, __pyx_v_newvec); /* "petsc4py/PETSc/DMPlex.pyx":1727 * CHKERR( PetscCLEAR(self.obj) ); self.dm = newdm * * def distributeField(self, SF sf, Section sec, Vec vec, # <<<<<<<<<<<<<< * Section newsec=None, Vec newvec=None) -> tuple[Section, Vec]: * """Distribute field data with a with a given `SF`. */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_140distributeField(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscSFObject *__pyx_v_sf, struct PyPetscSectionObject *__pyx_v_sec, struct PyPetscVecObject *__pyx_v_vec, struct PyPetscSectionObject *__pyx_v_newsec, struct PyPetscVecObject *__pyx_v_newvec) { MPI_Comm __pyx_v_ccomm; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("distributeField", 0); __Pyx_INCREF((PyObject *)__pyx_v_newsec); __Pyx_INCREF((PyObject *)__pyx_v_newvec); /* "petsc4py/PETSc/DMPlex.pyx":1758 * * """ * cdef MPI_Comm ccomm = MPI_COMM_NULL # <<<<<<<<<<<<<< * if newsec is None: newsec = Section() * if newvec is None: newvec = Vec() */ __pyx_v_ccomm = MPI_COMM_NULL; /* "petsc4py/PETSc/DMPlex.pyx":1759 * """ * cdef MPI_Comm ccomm = MPI_COMM_NULL * if newsec is None: newsec = Section() # <<<<<<<<<<<<<< * if newvec is None: newvec = Vec() * if newsec.sec == NULL: */ __pyx_t_1 = (((PyObject *)__pyx_v_newsec) == Py_None); if (__pyx_t_1) { __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Section)); if (unlikely(!__pyx_t_2)) __PYX_ERR(57, 1759, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_newsec, ((struct PyPetscSectionObject *)__pyx_t_2)); __pyx_t_2 = 0; } /* "petsc4py/PETSc/DMPlex.pyx":1760 * cdef MPI_Comm ccomm = MPI_COMM_NULL * if newsec is None: newsec = Section() * if newvec is None: newvec = Vec() # <<<<<<<<<<<<<< * if newsec.sec == NULL: * CHKERR( PetscObjectGetComm(sec.sec, &ccomm) ) */ __pyx_t_1 = (((PyObject *)__pyx_v_newvec) == Py_None); if (__pyx_t_1) { __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_2)) __PYX_ERR(57, 1760, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_newvec, ((struct PyPetscVecObject *)__pyx_t_2)); __pyx_t_2 = 0; } /* "petsc4py/PETSc/DMPlex.pyx":1761 * if newsec is None: newsec = Section() * if newvec is None: newvec = Vec() * if newsec.sec == NULL: # <<<<<<<<<<<<<< * CHKERR( PetscObjectGetComm(sec.sec, &ccomm) ) * CHKERR( PetscSectionCreate(ccomm, &newsec.sec) ) */ __pyx_t_1 = (__pyx_v_newsec->sec == NULL); if (__pyx_t_1) { /* "petsc4py/PETSc/DMPlex.pyx":1762 * if newvec is None: newvec = Vec() * if newsec.sec == NULL: * CHKERR( PetscObjectGetComm(sec.sec, &ccomm) ) # <<<<<<<<<<<<<< * CHKERR( PetscSectionCreate(ccomm, &newsec.sec) ) * if newvec.vec == NULL: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectGetComm(((PetscObject)__pyx_v_sec->sec), (&__pyx_v_ccomm))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1762, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":1763 * if newsec.sec == NULL: * CHKERR( PetscObjectGetComm(sec.sec, &ccomm) ) * CHKERR( PetscSectionCreate(ccomm, &newsec.sec) ) # <<<<<<<<<<<<<< * if newvec.vec == NULL: * CHKERR( PetscObjectGetComm(vec.vec, &ccomm) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionCreate(__pyx_v_ccomm, (&__pyx_v_newsec->sec))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1763, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":1761 * if newsec is None: newsec = Section() * if newvec is None: newvec = Vec() * if newsec.sec == NULL: # <<<<<<<<<<<<<< * CHKERR( PetscObjectGetComm(sec.sec, &ccomm) ) * CHKERR( PetscSectionCreate(ccomm, &newsec.sec) ) */ } /* "petsc4py/PETSc/DMPlex.pyx":1764 * CHKERR( PetscObjectGetComm(sec.sec, &ccomm) ) * CHKERR( PetscSectionCreate(ccomm, &newsec.sec) ) * if newvec.vec == NULL: # <<<<<<<<<<<<<< * CHKERR( PetscObjectGetComm(vec.vec, &ccomm) ) * CHKERR( VecCreate(ccomm, &newvec.vec) ) */ __pyx_t_1 = (__pyx_v_newvec->vec == NULL); if (__pyx_t_1) { /* "petsc4py/PETSc/DMPlex.pyx":1765 * CHKERR( PetscSectionCreate(ccomm, &newsec.sec) ) * if newvec.vec == NULL: * CHKERR( PetscObjectGetComm(vec.vec, &ccomm) ) # <<<<<<<<<<<<<< * CHKERR( VecCreate(ccomm, &newvec.vec) ) * CHKERR( DMPlexDistributeField(self.dm, sf.sf, */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectGetComm(((PetscObject)__pyx_v_vec->vec), (&__pyx_v_ccomm))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1765, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":1766 * if newvec.vec == NULL: * CHKERR( PetscObjectGetComm(vec.vec, &ccomm) ) * CHKERR( VecCreate(ccomm, &newvec.vec) ) # <<<<<<<<<<<<<< * CHKERR( DMPlexDistributeField(self.dm, sf.sf, * sec.sec, vec.vec, */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCreate(__pyx_v_ccomm, (&__pyx_v_newvec->vec))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1766, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":1764 * CHKERR( PetscObjectGetComm(sec.sec, &ccomm) ) * CHKERR( PetscSectionCreate(ccomm, &newsec.sec) ) * if newvec.vec == NULL: # <<<<<<<<<<<<<< * CHKERR( PetscObjectGetComm(vec.vec, &ccomm) ) * CHKERR( VecCreate(ccomm, &newvec.vec) ) */ } /* "petsc4py/PETSc/DMPlex.pyx":1767 * CHKERR( PetscObjectGetComm(vec.vec, &ccomm) ) * CHKERR( VecCreate(ccomm, &newvec.vec) ) * CHKERR( DMPlexDistributeField(self.dm, sf.sf, # <<<<<<<<<<<<<< * sec.sec, vec.vec, * newsec.sec, newvec.vec)) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexDistributeField(__pyx_v_self->__pyx_base.dm, __pyx_v_sf->sf, __pyx_v_sec->sec, __pyx_v_vec->vec, __pyx_v_newsec->sec, __pyx_v_newvec->vec)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1767, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":1770 * sec.sec, vec.vec, * newsec.sec, newvec.vec)) * return (newsec, newvec) # <<<<<<<<<<<<<< * * def getMinRadius(self) -> float: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(57, 1770, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF((PyObject *)__pyx_v_newsec); __Pyx_GIVEREF((PyObject *)__pyx_v_newsec); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_newsec))) __PYX_ERR(57, 1770, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_newvec); __Pyx_GIVEREF((PyObject *)__pyx_v_newvec); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_newvec))) __PYX_ERR(57, 1770, __pyx_L1_error); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":1727 * CHKERR( PetscCLEAR(self.obj) ); self.dm = newdm * * def distributeField(self, SF sf, Section sec, Vec vec, # <<<<<<<<<<<<<< * Section newsec=None, Vec newvec=None) -> tuple[Section, Vec]: * """Distribute field data with a with a given `SF`. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.distributeField", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_newsec); __Pyx_XDECREF((PyObject *)__pyx_v_newvec); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":1772 * return (newsec, newvec) * * def getMinRadius(self) -> float: # <<<<<<<<<<<<<< * """Return the minimum distance from any cell centroid to a face. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_143getMinRadius(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_142getMinRadius, "DMPlex.getMinRadius(self) -> float\nReturn the minimum distance from any cell centroid to a face.\n\n Not collective.\n\n See Also\n --------\n DMPlex, DM.getCoordinates, petsc.DMPlexGetMinRadius\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:1772"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_143getMinRadius(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getMinRadius (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getMinRadius", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getMinRadius", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_142getMinRadius(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_142getMinRadius(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self) { PetscReal __pyx_v_cminradius; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscReal __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getMinRadius", 1); /* "petsc4py/PETSc/DMPlex.pyx":1782 * * """ * cdef PetscReal cminradius = 0. # <<<<<<<<<<<<<< * CHKERR( DMPlexGetMinRadius(self.dm, &cminradius)) * return asReal(cminradius) */ __pyx_v_cminradius = 0.; /* "petsc4py/PETSc/DMPlex.pyx":1783 * """ * cdef PetscReal cminradius = 0. * CHKERR( DMPlexGetMinRadius(self.dm, &cminradius)) # <<<<<<<<<<<<<< * return asReal(cminradius) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetMinRadius(__pyx_v_self->__pyx_base.dm, (&__pyx_v_cminradius))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1783, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":1784 * cdef PetscReal cminradius = 0. * CHKERR( DMPlexGetMinRadius(self.dm, &cminradius)) * return asReal(cminradius) # <<<<<<<<<<<<<< * * def createCoarsePointIS(self) -> IS: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyFloat_FromDouble(__pyx_v_cminradius); if (unlikely(!__pyx_t_2)) __PYX_ERR(57, 1784, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_t_2); if (unlikely(__pyx_t_3 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(57, 1784, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyFloat_FromDouble(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(57, 1784, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":1772 * return (newsec, newvec) * * def getMinRadius(self) -> float: # <<<<<<<<<<<<<< * """Return the minimum distance from any cell centroid to a face. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getMinRadius", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":1786 * return asReal(cminradius) * * def createCoarsePointIS(self) -> IS: # <<<<<<<<<<<<<< * """Create an `IS` covering the coarse `DMPlex` chart with the fine points as data. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_145createCoarsePointIS(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_144createCoarsePointIS, "DMPlex.createCoarsePointIS(self) -> IS\nCreate an `IS` covering the coarse `DMPlex` chart with the fine points as data.\n\n Collective.\n\n Returns\n -------\n fpointIS : IS\n The `IS` of all the fine points which exist in the original coarse mesh.\n\n See Also\n --------\n DM, DMPlex, IS, DM.refine, DMPlex.setRefinementUniform\n petsc.DMPlexCreateCoarsePointIS\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:1786"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_145createCoarsePointIS(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createCoarsePointIS (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("createCoarsePointIS", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "createCoarsePointIS", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_144createCoarsePointIS(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_144createCoarsePointIS(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self) { struct PyPetscISObject *__pyx_v_fpoint = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createCoarsePointIS", 1); /* "petsc4py/PETSc/DMPlex.pyx":1802 * * """ * cdef IS fpoint = IS() # <<<<<<<<<<<<<< * CHKERR( DMPlexCreateCoarsePointIS(self.dm, &fpoint.iset) ) * return fpoint */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_1)) __PYX_ERR(57, 1802, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_fpoint = ((struct PyPetscISObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DMPlex.pyx":1803 * """ * cdef IS fpoint = IS() * CHKERR( DMPlexCreateCoarsePointIS(self.dm, &fpoint.iset) ) # <<<<<<<<<<<<<< * return fpoint * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexCreateCoarsePointIS(__pyx_v_self->__pyx_base.dm, (&__pyx_v_fpoint->iset))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1803, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":1804 * cdef IS fpoint = IS() * CHKERR( DMPlexCreateCoarsePointIS(self.dm, &fpoint.iset) ) * return fpoint # <<<<<<<<<<<<<< * * def createSection(self, numComp: Sequence[int], numDof: Sequence[int], */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_fpoint); __pyx_r = ((PyObject *)__pyx_v_fpoint); goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":1786 * return asReal(cminradius) * * def createCoarsePointIS(self) -> IS: # <<<<<<<<<<<<<< * """Create an `IS` covering the coarse `DMPlex` chart with the fine points as data. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.createCoarsePointIS", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_fpoint); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":1806 * return fpoint * * def createSection(self, numComp: Sequence[int], numDof: Sequence[int], # <<<<<<<<<<<<<< * bcField: Sequence[int] | None = None, bcComps: Sequence[IS] | None = None, bcPoints: Sequence[IS] | None = None, * IS perm=None) -> Section: */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_147createSection(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_146createSection, "DMPlex.createSection(self, numComp: Sequence[int], numDof: Sequence[int], bcField: Sequence[int] | None = None, bcComps: Sequence[IS] | None = None, bcPoints: Sequence[IS] | None = None, perm: IS | None = None) -> Section\nCreate a `Section` based upon the DOF layout specification provided.\n\n Not collective.\n\n Parameters\n ----------\n numComp\n An array of size ``numFields`` holding the number of components per field.\n numDof\n An array of size ``numFields*(dim+1)`` holding the number of DOFs\n per field on a mesh piece of dimension ``dim``.\n bcField\n An array of size ``numBC`` giving the field number for each boundary\n condition, where ``numBC`` is the number of boundary conditions.\n bcComps\n An array of size ``numBC`` giving an `IS` holding the field\n components to which each boundary condition applies.\n bcPoints\n An array of size ``numBC`` giving an `IS` holding the `DMPlex` points\n to which each boundary condition applies.\n perm\n Permutation of the chart.\n\n See Also\n --------\n DM, DMPlex, DMPlex.create, Section.create, Section.setPermutation\n petsc.DMPlexCreateSection\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:1806"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_147createSection(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_numComp = 0; PyObject *__pyx_v_numDof = 0; PyObject *__pyx_v_bcField = 0; PyObject *__pyx_v_bcComps = 0; PyObject *__pyx_v_bcPoints = 0; struct PyPetscISObject *__pyx_v_perm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[6] = {0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createSection (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_numComp,&__pyx_n_s_numDof,&__pyx_n_s_bcField,&__pyx_n_s_bcComps,&__pyx_n_s_bcPoints,&__pyx_n_s_perm,0}; /* "petsc4py/PETSc/DMPlex.pyx":1807 * * def createSection(self, numComp: Sequence[int], numDof: Sequence[int], * bcField: Sequence[int] | None = None, bcComps: Sequence[IS] | None = None, bcPoints: Sequence[IS] | None = None, # <<<<<<<<<<<<<< * IS perm=None) -> Section: * """Create a `Section` based upon the DOF layout specification provided. */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/DMPlex.pyx":1808 * def createSection(self, numComp: Sequence[int], numDof: Sequence[int], * bcField: Sequence[int] | None = None, bcComps: Sequence[IS] | None = None, bcPoints: Sequence[IS] | None = None, * IS perm=None) -> Section: # <<<<<<<<<<<<<< * """Create a `Section` based upon the DOF layout specification provided. * */ values[5] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscISObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_numComp)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 1806, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_numDof)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 1806, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("createSection", 0, 2, 6, 1); __PYX_ERR(57, 1806, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_bcField); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 1806, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_bcComps); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 1806, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_bcPoints); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 1806, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_perm); if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 1806, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createSection") < 0)) __PYX_ERR(57, 1806, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_numComp = values[0]; __pyx_v_numDof = values[1]; __pyx_v_bcField = values[2]; __pyx_v_bcComps = values[3]; __pyx_v_bcPoints = values[4]; __pyx_v_perm = ((struct PyPetscISObject *)values[5]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createSection", 0, 2, 6, __pyx_nargs); __PYX_ERR(57, 1806, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.createSection", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_perm), __pyx_ptype_8petsc4py_5PETSc_IS, 1, "perm", 0))) __PYX_ERR(57, 1808, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_146createSection(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_numComp, __pyx_v_numDof, __pyx_v_bcField, __pyx_v_bcComps, __pyx_v_bcPoints, __pyx_v_perm); /* "petsc4py/PETSc/DMPlex.pyx":1806 * return fpoint * * def createSection(self, numComp: Sequence[int], numDof: Sequence[int], # <<<<<<<<<<<<<< * bcField: Sequence[int] | None = None, bcComps: Sequence[IS] | None = None, bcPoints: Sequence[IS] | None = None, * IS perm=None) -> Section: */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_146createSection(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_numComp, PyObject *__pyx_v_numDof, PyObject *__pyx_v_bcField, PyObject *__pyx_v_bcComps, PyObject *__pyx_v_bcPoints, struct PyPetscISObject *__pyx_v_perm) { PetscInt __pyx_v_dim; PetscInt __pyx_v_ncomp; PetscInt __pyx_v_ndof; PetscInt *__pyx_v_icomp; PetscInt *__pyx_v_idof; PetscInt __pyx_v_nbc; PetscInt __pyx_v_i; PetscInt *__pyx_v_bcfield; IS *__pyx_v_bccomps; IS *__pyx_v_bcpoints; CYTHON_UNUSED PyArrayObject *__pyx_v_tmp1 = NULL; CYTHON_UNUSED PyArrayObject *__pyx_v_tmp2 = NULL; IS __pyx_v_cperm; struct PyPetscSectionObject *__pyx_v_sec = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PetscInt __pyx_t_6; IS __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createSection", 0); __Pyx_INCREF(__pyx_v_numComp); __Pyx_INCREF(__pyx_v_numDof); __Pyx_INCREF(__pyx_v_bcField); __Pyx_INCREF(__pyx_v_bcComps); __Pyx_INCREF(__pyx_v_bcPoints); /* "petsc4py/PETSc/DMPlex.pyx":1839 * """ * # topological dimension * cdef PetscInt dim = 0 # <<<<<<<<<<<<<< * CHKERR( DMGetDimension(self.dm, &dim) ) * # components and DOFs */ __pyx_v_dim = 0; /* "petsc4py/PETSc/DMPlex.pyx":1840 * # topological dimension * cdef PetscInt dim = 0 * CHKERR( DMGetDimension(self.dm, &dim) ) # <<<<<<<<<<<<<< * # components and DOFs * cdef PetscInt ncomp = 0, ndof = 0 */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetDimension(__pyx_v_self->__pyx_base.dm, (&__pyx_v_dim))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1840, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":1842 * CHKERR( DMGetDimension(self.dm, &dim) ) * # components and DOFs * cdef PetscInt ncomp = 0, ndof = 0 # <<<<<<<<<<<<<< * cdef PetscInt *icomp = NULL, *idof = NULL * numComp = iarray_i(numComp, &ncomp, &icomp) */ __pyx_v_ncomp = 0; __pyx_v_ndof = 0; /* "petsc4py/PETSc/DMPlex.pyx":1843 * # components and DOFs * cdef PetscInt ncomp = 0, ndof = 0 * cdef PetscInt *icomp = NULL, *idof = NULL # <<<<<<<<<<<<<< * numComp = iarray_i(numComp, &ncomp, &icomp) * numDof = iarray_i(numDof, &ndof, &idof) */ __pyx_v_icomp = NULL; __pyx_v_idof = NULL; /* "petsc4py/PETSc/DMPlex.pyx":1844 * cdef PetscInt ncomp = 0, ndof = 0 * cdef PetscInt *icomp = NULL, *idof = NULL * numComp = iarray_i(numComp, &ncomp, &icomp) # <<<<<<<<<<<<<< * numDof = iarray_i(numDof, &ndof, &idof) * assert ndof == ncomp*(dim+1) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_numComp, (&__pyx_v_ncomp), (&__pyx_v_icomp))); if (unlikely(!__pyx_t_2)) __PYX_ERR(57, 1844, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_numComp, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DMPlex.pyx":1845 * cdef PetscInt *icomp = NULL, *idof = NULL * numComp = iarray_i(numComp, &ncomp, &icomp) * numDof = iarray_i(numDof, &ndof, &idof) # <<<<<<<<<<<<<< * assert ndof == ncomp*(dim+1) * # boundary conditions */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_numDof, (&__pyx_v_ndof), (&__pyx_v_idof))); if (unlikely(!__pyx_t_2)) __PYX_ERR(57, 1845, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_numDof, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DMPlex.pyx":1846 * numComp = iarray_i(numComp, &ncomp, &icomp) * numDof = iarray_i(numDof, &ndof, &idof) * assert ndof == ncomp*(dim+1) # <<<<<<<<<<<<<< * # boundary conditions * cdef PetscInt nbc = 0, i = 0 */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_3 = (__pyx_v_ndof == (__pyx_v_ncomp * (__pyx_v_dim + 1))); if (unlikely(!__pyx_t_3)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(57, 1846, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(57, 1846, __pyx_L1_error) #endif /* "petsc4py/PETSc/DMPlex.pyx":1848 * assert ndof == ncomp*(dim+1) * # boundary conditions * cdef PetscInt nbc = 0, i = 0 # <<<<<<<<<<<<<< * cdef PetscInt *bcfield = NULL * cdef PetscIS *bccomps = NULL */ __pyx_v_nbc = 0; __pyx_v_i = 0; /* "petsc4py/PETSc/DMPlex.pyx":1849 * # boundary conditions * cdef PetscInt nbc = 0, i = 0 * cdef PetscInt *bcfield = NULL # <<<<<<<<<<<<<< * cdef PetscIS *bccomps = NULL * cdef PetscIS *bcpoints = NULL */ __pyx_v_bcfield = NULL; /* "petsc4py/PETSc/DMPlex.pyx":1850 * cdef PetscInt nbc = 0, i = 0 * cdef PetscInt *bcfield = NULL * cdef PetscIS *bccomps = NULL # <<<<<<<<<<<<<< * cdef PetscIS *bcpoints = NULL * if bcField is not None: */ __pyx_v_bccomps = NULL; /* "petsc4py/PETSc/DMPlex.pyx":1851 * cdef PetscInt *bcfield = NULL * cdef PetscIS *bccomps = NULL * cdef PetscIS *bcpoints = NULL # <<<<<<<<<<<<<< * if bcField is not None: * bcField = iarray_i(bcField, &nbc, &bcfield) */ __pyx_v_bcpoints = NULL; /* "petsc4py/PETSc/DMPlex.pyx":1852 * cdef PetscIS *bccomps = NULL * cdef PetscIS *bcpoints = NULL * if bcField is not None: # <<<<<<<<<<<<<< * bcField = iarray_i(bcField, &nbc, &bcfield) * if bcComps is not None: */ __pyx_t_3 = (__pyx_v_bcField != Py_None); if (__pyx_t_3) { /* "petsc4py/PETSc/DMPlex.pyx":1853 * cdef PetscIS *bcpoints = NULL * if bcField is not None: * bcField = iarray_i(bcField, &nbc, &bcfield) # <<<<<<<<<<<<<< * if bcComps is not None: * bcComps = list(bcComps) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_bcField, (&__pyx_v_nbc), (&__pyx_v_bcfield))); if (unlikely(!__pyx_t_2)) __PYX_ERR(57, 1853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_bcField, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DMPlex.pyx":1854 * if bcField is not None: * bcField = iarray_i(bcField, &nbc, &bcfield) * if bcComps is not None: # <<<<<<<<<<<<<< * bcComps = list(bcComps) * assert len(bcComps) == nbc */ __pyx_t_3 = (__pyx_v_bcComps != Py_None); if (__pyx_t_3) { /* "petsc4py/PETSc/DMPlex.pyx":1855 * bcField = iarray_i(bcField, &nbc, &bcfield) * if bcComps is not None: * bcComps = list(bcComps) # <<<<<<<<<<<<<< * assert len(bcComps) == nbc * tmp1 = oarray_p(empty_p(nbc), NULL, &bccomps) */ __pyx_t_2 = PySequence_List(__pyx_v_bcComps); if (unlikely(!__pyx_t_2)) __PYX_ERR(57, 1855, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_bcComps, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DMPlex.pyx":1856 * if bcComps is not None: * bcComps = list(bcComps) * assert len(bcComps) == nbc # <<<<<<<<<<<<<< * tmp1 = oarray_p(empty_p(nbc), NULL, &bccomps) * for i from 0 <= i < nbc: */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_4 = PyObject_Length(__pyx_v_bcComps); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(57, 1856, __pyx_L1_error) __pyx_t_3 = (__pyx_t_4 == __pyx_v_nbc); if (unlikely(!__pyx_t_3)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(57, 1856, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(57, 1856, __pyx_L1_error) #endif /* "petsc4py/PETSc/DMPlex.pyx":1857 * bcComps = list(bcComps) * assert len(bcComps) == nbc * tmp1 = oarray_p(empty_p(nbc), NULL, &bccomps) # <<<<<<<<<<<<<< * for i from 0 <= i < nbc: * bccomps[i] = (bcComps[i]).iset */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_nbc)); if (unlikely(!__pyx_t_2)) __PYX_ERR(57, 1857, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_2, NULL, ((void **)(&__pyx_v_bccomps)))); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 1857, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_tmp1 = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/DMPlex.pyx":1858 * assert len(bcComps) == nbc * tmp1 = oarray_p(empty_p(nbc), NULL, &bccomps) * for i from 0 <= i < nbc: # <<<<<<<<<<<<<< * bccomps[i] = (bcComps[i]).iset * if bcPoints is not None: */ __pyx_t_6 = __pyx_v_nbc; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_6; __pyx_v_i++) { /* "petsc4py/PETSc/DMPlex.pyx":1859 * tmp1 = oarray_p(empty_p(nbc), NULL, &bccomps) * for i from 0 <= i < nbc: * bccomps[i] = (bcComps[i]).iset # <<<<<<<<<<<<<< * if bcPoints is not None: * bcPoints = list(bcPoints) */ __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_bcComps, ((Py_ssize_t)__pyx_v_i), Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 1859, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (!(likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(57, 1859, __pyx_L1_error) __pyx_t_7 = ((struct PyPetscISObject *)__pyx_t_5)->iset; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; (__pyx_v_bccomps[__pyx_v_i]) = __pyx_t_7; } /* "petsc4py/PETSc/DMPlex.pyx":1854 * if bcField is not None: * bcField = iarray_i(bcField, &nbc, &bcfield) * if bcComps is not None: # <<<<<<<<<<<<<< * bcComps = list(bcComps) * assert len(bcComps) == nbc */ } /* "petsc4py/PETSc/DMPlex.pyx":1860 * for i from 0 <= i < nbc: * bccomps[i] = (bcComps[i]).iset * if bcPoints is not None: # <<<<<<<<<<<<<< * bcPoints = list(bcPoints) * assert len(bcPoints) == nbc */ __pyx_t_3 = (__pyx_v_bcPoints != Py_None); if (likely(__pyx_t_3)) { /* "petsc4py/PETSc/DMPlex.pyx":1861 * bccomps[i] = (bcComps[i]).iset * if bcPoints is not None: * bcPoints = list(bcPoints) # <<<<<<<<<<<<<< * assert len(bcPoints) == nbc * tmp2 = oarray_p(empty_p(nbc), NULL, &bcpoints) */ __pyx_t_5 = PySequence_List(__pyx_v_bcPoints); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 1861, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_bcPoints, __pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/DMPlex.pyx":1862 * if bcPoints is not None: * bcPoints = list(bcPoints) * assert len(bcPoints) == nbc # <<<<<<<<<<<<<< * tmp2 = oarray_p(empty_p(nbc), NULL, &bcpoints) * for i from 0 <= i < nbc: */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_4 = PyObject_Length(__pyx_v_bcPoints); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(57, 1862, __pyx_L1_error) __pyx_t_3 = (__pyx_t_4 == __pyx_v_nbc); if (unlikely(!__pyx_t_3)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(57, 1862, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(57, 1862, __pyx_L1_error) #endif /* "petsc4py/PETSc/DMPlex.pyx":1863 * bcPoints = list(bcPoints) * assert len(bcPoints) == nbc * tmp2 = oarray_p(empty_p(nbc), NULL, &bcpoints) # <<<<<<<<<<<<<< * for i from 0 <= i < nbc: * bcpoints[i] = (bcPoints[i]).iset */ __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_nbc)); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 1863, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_5, NULL, ((void **)(&__pyx_v_bcpoints)))); if (unlikely(!__pyx_t_2)) __PYX_ERR(57, 1863, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_tmp2 = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DMPlex.pyx":1864 * assert len(bcPoints) == nbc * tmp2 = oarray_p(empty_p(nbc), NULL, &bcpoints) * for i from 0 <= i < nbc: # <<<<<<<<<<<<<< * bcpoints[i] = (bcPoints[i]).iset * else: */ __pyx_t_6 = __pyx_v_nbc; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_6; __pyx_v_i++) { /* "petsc4py/PETSc/DMPlex.pyx":1865 * tmp2 = oarray_p(empty_p(nbc), NULL, &bcpoints) * for i from 0 <= i < nbc: * bcpoints[i] = (bcPoints[i]).iset # <<<<<<<<<<<<<< * else: * raise ValueError("bcPoints is a required argument") */ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_bcPoints, ((Py_ssize_t)__pyx_v_i), Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(57, 1865, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (!(likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(57, 1865, __pyx_L1_error) __pyx_t_7 = ((struct PyPetscISObject *)__pyx_t_2)->iset; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; (__pyx_v_bcpoints[__pyx_v_i]) = __pyx_t_7; } /* "petsc4py/PETSc/DMPlex.pyx":1860 * for i from 0 <= i < nbc: * bccomps[i] = (bcComps[i]).iset * if bcPoints is not None: # <<<<<<<<<<<<<< * bcPoints = list(bcPoints) * assert len(bcPoints) == nbc */ goto __pyx_L7; } /* "petsc4py/PETSc/DMPlex.pyx":1867 * bcpoints[i] = (bcPoints[i]).iset * else: * raise ValueError("bcPoints is a required argument") # <<<<<<<<<<<<<< * else: * assert bcComps is None */ /*else*/ { __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__60, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(57, 1867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(57, 1867, __pyx_L1_error) } __pyx_L7:; /* "petsc4py/PETSc/DMPlex.pyx":1852 * cdef PetscIS *bccomps = NULL * cdef PetscIS *bcpoints = NULL * if bcField is not None: # <<<<<<<<<<<<<< * bcField = iarray_i(bcField, &nbc, &bcfield) * if bcComps is not None: */ goto __pyx_L3; } /* "petsc4py/PETSc/DMPlex.pyx":1869 * raise ValueError("bcPoints is a required argument") * else: * assert bcComps is None # <<<<<<<<<<<<<< * assert bcPoints is None * # optional chart permutations */ /*else*/ { #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_3 = (__pyx_v_bcComps == Py_None); if (unlikely(!__pyx_t_3)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(57, 1869, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(57, 1869, __pyx_L1_error) #endif /* "petsc4py/PETSc/DMPlex.pyx":1870 * else: * assert bcComps is None * assert bcPoints is None # <<<<<<<<<<<<<< * # optional chart permutations * cdef PetscIS cperm = NULL */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_3 = (__pyx_v_bcPoints == Py_None); if (unlikely(!__pyx_t_3)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(57, 1870, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(57, 1870, __pyx_L1_error) #endif } __pyx_L3:; /* "petsc4py/PETSc/DMPlex.pyx":1872 * assert bcPoints is None * # optional chart permutations * cdef PetscIS cperm = NULL # <<<<<<<<<<<<<< * if perm is not None: cperm = perm.iset * # create section */ __pyx_v_cperm = NULL; /* "petsc4py/PETSc/DMPlex.pyx":1873 * # optional chart permutations * cdef PetscIS cperm = NULL * if perm is not None: cperm = perm.iset # <<<<<<<<<<<<<< * # create section * cdef Section sec = Section() */ __pyx_t_3 = (((PyObject *)__pyx_v_perm) != Py_None); if (__pyx_t_3) { __pyx_t_7 = __pyx_v_perm->iset; __pyx_v_cperm = __pyx_t_7; } /* "petsc4py/PETSc/DMPlex.pyx":1875 * if perm is not None: cperm = perm.iset * # create section * cdef Section sec = Section() # <<<<<<<<<<<<<< * CHKERR( DMPlexCreateSection(self.dm, NULL, icomp, idof, * nbc, bcfield, bccomps, bcpoints, */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Section)); if (unlikely(!__pyx_t_2)) __PYX_ERR(57, 1875, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_sec = ((struct PyPetscSectionObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DMPlex.pyx":1876 * # create section * cdef Section sec = Section() * CHKERR( DMPlexCreateSection(self.dm, NULL, icomp, idof, # <<<<<<<<<<<<<< * nbc, bcfield, bccomps, bcpoints, * cperm, &sec.sec) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexCreateSection(__pyx_v_self->__pyx_base.dm, NULL, __pyx_v_icomp, __pyx_v_idof, __pyx_v_nbc, __pyx_v_bcfield, __pyx_v_bccomps, __pyx_v_bcpoints, __pyx_v_cperm, (&__pyx_v_sec->sec))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1876, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":1879 * nbc, bcfield, bccomps, bcpoints, * cperm, &sec.sec) ) * return sec # <<<<<<<<<<<<<< * * def getPointLocal(self, point: int) -> tuple[int, int]: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_sec); __pyx_r = ((PyObject *)__pyx_v_sec); goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":1806 * return fpoint * * def createSection(self, numComp: Sequence[int], numDof: Sequence[int], # <<<<<<<<<<<<<< * bcField: Sequence[int] | None = None, bcComps: Sequence[IS] | None = None, bcPoints: Sequence[IS] | None = None, * IS perm=None) -> Section: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.createSection", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_tmp1); __Pyx_XDECREF((PyObject *)__pyx_v_tmp2); __Pyx_XDECREF((PyObject *)__pyx_v_sec); __Pyx_XDECREF(__pyx_v_numComp); __Pyx_XDECREF(__pyx_v_numDof); __Pyx_XDECREF(__pyx_v_bcField); __Pyx_XDECREF(__pyx_v_bcComps); __Pyx_XDECREF(__pyx_v_bcPoints); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":1881 * return sec * * def getPointLocal(self, point: int) -> tuple[int, int]: # <<<<<<<<<<<<<< * """Return location of point data in local `Vec`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_149getPointLocal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_148getPointLocal, "DMPlex.getPointLocal(self, point: int) -> tuple[int, int]\nReturn location of point data in local `Vec`.\n\n Not collective.\n\n Parameters\n ----------\n point\n The topological point.\n\n Returns\n -------\n start : int\n Start of point data.\n end : int\n End of point data.\n\n See Also\n --------\n DM, DMPlex, DMPlex.getPointLocalField, Section.getOffset\n Section.getDof, petsc.DMPlexGetPointLocal\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:1881"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_149getPointLocal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_point = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getPointLocal (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_point)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 1881, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getPointLocal") < 0)) __PYX_ERR(57, 1881, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_point = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getPointLocal", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 1881, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getPointLocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_148getPointLocal(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_point); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_148getPointLocal(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_point) { PetscInt __pyx_v_start; PetscInt __pyx_v_end; PetscInt __pyx_v_cpoint; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getPointLocal", 1); /* "petsc4py/PETSc/DMPlex.pyx":1904 * * """ * cdef PetscInt start = 0, end = 0 # <<<<<<<<<<<<<< * cdef PetscInt cpoint = asInt(point) * CHKERR( DMPlexGetPointLocal(self.dm, cpoint, &start, &end) ) */ __pyx_v_start = 0; __pyx_v_end = 0; /* "petsc4py/PETSc/DMPlex.pyx":1905 * """ * cdef PetscInt start = 0, end = 0 * cdef PetscInt cpoint = asInt(point) # <<<<<<<<<<<<<< * CHKERR( DMPlexGetPointLocal(self.dm, cpoint, &start, &end) ) * return toInt(start), toInt(end) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_point); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(57, 1905, __pyx_L1_error) __pyx_v_cpoint = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":1906 * cdef PetscInt start = 0, end = 0 * cdef PetscInt cpoint = asInt(point) * CHKERR( DMPlexGetPointLocal(self.dm, cpoint, &start, &end) ) # <<<<<<<<<<<<<< * return toInt(start), toInt(end) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetPointLocal(__pyx_v_self->__pyx_base.dm, __pyx_v_cpoint, (&__pyx_v_start), (&__pyx_v_end))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1906, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":1907 * cdef PetscInt cpoint = asInt(point) * CHKERR( DMPlexGetPointLocal(self.dm, cpoint, &start, &end) ) * return toInt(start), toInt(end) # <<<<<<<<<<<<<< * * def getPointLocalField(self, point: int, field: int) -> tuple[int, int]: */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(57, 1907, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_end); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 1907, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 1907, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3)) __PYX_ERR(57, 1907, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4)) __PYX_ERR(57, 1907, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":1881 * return sec * * def getPointLocal(self, point: int) -> tuple[int, int]: # <<<<<<<<<<<<<< * """Return location of point data in local `Vec`. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getPointLocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":1909 * return toInt(start), toInt(end) * * def getPointLocalField(self, point: int, field: int) -> tuple[int, int]: # <<<<<<<<<<<<<< * """Return location of point field data in local `Vec`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_151getPointLocalField(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_150getPointLocalField, "DMPlex.getPointLocalField(self, point: int, field: int) -> tuple[int, int]\nReturn location of point field data in local `Vec`.\n\n Not collective.\n\n Parameters\n ----------\n point\n The topological point.\n field\n The field number.\n\n Returns\n -------\n start : int\n Start of point data.\n end : int\n End of point data.\n\n See Also\n --------\n DM, DMPlex, DMPlex.getPointLocal, Section.getOffset\n petsc.DMPlexGetPointLocalField\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:1909"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_151getPointLocalField(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_point = 0; PyObject *__pyx_v_field = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getPointLocalField (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,&__pyx_n_s_field,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_point)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 1909, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_field)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 1909, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("getPointLocalField", 1, 2, 2, 1); __PYX_ERR(57, 1909, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getPointLocalField") < 0)) __PYX_ERR(57, 1909, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_point = values[0]; __pyx_v_field = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getPointLocalField", 1, 2, 2, __pyx_nargs); __PYX_ERR(57, 1909, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getPointLocalField", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_150getPointLocalField(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_point, __pyx_v_field); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_150getPointLocalField(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field) { PetscInt __pyx_v_start; PetscInt __pyx_v_end; PetscInt __pyx_v_cpoint; PetscInt __pyx_v_cfield; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getPointLocalField", 1); /* "petsc4py/PETSc/DMPlex.pyx":1934 * * """ * cdef PetscInt start = 0, end = 0 # <<<<<<<<<<<<<< * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cfield = asInt(field) */ __pyx_v_start = 0; __pyx_v_end = 0; /* "petsc4py/PETSc/DMPlex.pyx":1935 * """ * cdef PetscInt start = 0, end = 0 * cdef PetscInt cpoint = asInt(point) # <<<<<<<<<<<<<< * cdef PetscInt cfield = asInt(field) * CHKERR( DMPlexGetPointLocalField(self.dm, cpoint, cfield, &start, &end) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_point); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(57, 1935, __pyx_L1_error) __pyx_v_cpoint = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":1936 * cdef PetscInt start = 0, end = 0 * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cfield = asInt(field) # <<<<<<<<<<<<<< * CHKERR( DMPlexGetPointLocalField(self.dm, cpoint, cfield, &start, &end) ) * return toInt(start), toInt(end) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_field); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(57, 1936, __pyx_L1_error) __pyx_v_cfield = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":1937 * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cfield = asInt(field) * CHKERR( DMPlexGetPointLocalField(self.dm, cpoint, cfield, &start, &end) ) # <<<<<<<<<<<<<< * return toInt(start), toInt(end) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetPointLocalField(__pyx_v_self->__pyx_base.dm, __pyx_v_cpoint, __pyx_v_cfield, (&__pyx_v_start), (&__pyx_v_end))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1937, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":1938 * cdef PetscInt cfield = asInt(field) * CHKERR( DMPlexGetPointLocalField(self.dm, cpoint, cfield, &start, &end) ) * return toInt(start), toInt(end) # <<<<<<<<<<<<<< * * def getPointGlobal(self, point: int) -> tuple[int, int]: */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(57, 1938, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_end); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 1938, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 1938, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3)) __PYX_ERR(57, 1938, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4)) __PYX_ERR(57, 1938, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":1909 * return toInt(start), toInt(end) * * def getPointLocalField(self, point: int, field: int) -> tuple[int, int]: # <<<<<<<<<<<<<< * """Return location of point field data in local `Vec`. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getPointLocalField", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":1940 * return toInt(start), toInt(end) * * def getPointGlobal(self, point: int) -> tuple[int, int]: # <<<<<<<<<<<<<< * """Return location of point data in global `Vec`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_153getPointGlobal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_152getPointGlobal, "DMPlex.getPointGlobal(self, point: int) -> tuple[int, int]\nReturn location of point data in global `Vec`.\n\n Not collective.\n\n Parameters\n ----------\n point\n The topological point.\n\n Returns\n -------\n start : int\n Start of point data; returns ``-(globalStart+1)`` if point is not owned.\n end : int\n End of point data; returns ``-(globalEnd+1)`` if point is not owned.\n\n See Also\n --------\n DM, DMPlex, DMPlex.getPointGlobalField, Section.getOffset\n Section.getDof, DMPlex.getPointLocal, petsc.DMPlexGetPointGlobal\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:1940"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_153getPointGlobal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_point = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getPointGlobal (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_point)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 1940, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getPointGlobal") < 0)) __PYX_ERR(57, 1940, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_point = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getPointGlobal", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 1940, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getPointGlobal", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_152getPointGlobal(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_point); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_152getPointGlobal(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_point) { PetscInt __pyx_v_start; PetscInt __pyx_v_end; PetscInt __pyx_v_cpoint; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getPointGlobal", 1); /* "petsc4py/PETSc/DMPlex.pyx":1963 * * """ * cdef PetscInt start = 0, end = 0 # <<<<<<<<<<<<<< * cdef PetscInt cpoint = asInt(point) * CHKERR( DMPlexGetPointGlobal(self.dm, cpoint, &start, &end) ) */ __pyx_v_start = 0; __pyx_v_end = 0; /* "petsc4py/PETSc/DMPlex.pyx":1964 * """ * cdef PetscInt start = 0, end = 0 * cdef PetscInt cpoint = asInt(point) # <<<<<<<<<<<<<< * CHKERR( DMPlexGetPointGlobal(self.dm, cpoint, &start, &end) ) * return toInt(start), toInt(end) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_point); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(57, 1964, __pyx_L1_error) __pyx_v_cpoint = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":1965 * cdef PetscInt start = 0, end = 0 * cdef PetscInt cpoint = asInt(point) * CHKERR( DMPlexGetPointGlobal(self.dm, cpoint, &start, &end) ) # <<<<<<<<<<<<<< * return toInt(start), toInt(end) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetPointGlobal(__pyx_v_self->__pyx_base.dm, __pyx_v_cpoint, (&__pyx_v_start), (&__pyx_v_end))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1965, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":1966 * cdef PetscInt cpoint = asInt(point) * CHKERR( DMPlexGetPointGlobal(self.dm, cpoint, &start, &end) ) * return toInt(start), toInt(end) # <<<<<<<<<<<<<< * * def getPointGlobalField(self, point: int, field: int) -> tuple[int, int]: */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(57, 1966, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_end); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 1966, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 1966, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3)) __PYX_ERR(57, 1966, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4)) __PYX_ERR(57, 1966, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":1940 * return toInt(start), toInt(end) * * def getPointGlobal(self, point: int) -> tuple[int, int]: # <<<<<<<<<<<<<< * """Return location of point data in global `Vec`. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getPointGlobal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":1968 * return toInt(start), toInt(end) * * def getPointGlobalField(self, point: int, field: int) -> tuple[int, int]: # <<<<<<<<<<<<<< * """Return location of point field data in global `Vec`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_155getPointGlobalField(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_154getPointGlobalField, "DMPlex.getPointGlobalField(self, point: int, field: int) -> tuple[int, int]\nReturn location of point field data in global `Vec`.\n\n Not collective.\n\n Parameters\n ----------\n point\n The topological point.\n field\n The field number.\n\n Returns\n -------\n start : int\n Start of point data; returns ``-(globalStart+1)`` if point is not owned.\n end : int\n End of point data; returns ``-(globalEnd+1)`` if point is not owned.\n\n See Also\n --------\n DM, DMPlex, DMPlex.getPointGlobal, Section.getOffset, Section.getDof\n DMPlex.getPointLocal, petsc.DMPlexGetPointGlobalField\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:1968"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_155getPointGlobalField(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_point = 0; PyObject *__pyx_v_field = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getPointGlobalField (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,&__pyx_n_s_field,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_point)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 1968, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_field)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 1968, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("getPointGlobalField", 1, 2, 2, 1); __PYX_ERR(57, 1968, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getPointGlobalField") < 0)) __PYX_ERR(57, 1968, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_point = values[0]; __pyx_v_field = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getPointGlobalField", 1, 2, 2, __pyx_nargs); __PYX_ERR(57, 1968, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getPointGlobalField", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_154getPointGlobalField(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_point, __pyx_v_field); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_154getPointGlobalField(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field) { PetscInt __pyx_v_start; PetscInt __pyx_v_end; PetscInt __pyx_v_cpoint; PetscInt __pyx_v_cfield; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getPointGlobalField", 1); /* "petsc4py/PETSc/DMPlex.pyx":1993 * * """ * cdef PetscInt start = 0, end = 0 # <<<<<<<<<<<<<< * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cfield = asInt(field) */ __pyx_v_start = 0; __pyx_v_end = 0; /* "petsc4py/PETSc/DMPlex.pyx":1994 * """ * cdef PetscInt start = 0, end = 0 * cdef PetscInt cpoint = asInt(point) # <<<<<<<<<<<<<< * cdef PetscInt cfield = asInt(field) * CHKERR( DMPlexGetPointGlobalField(self.dm, cpoint, cfield, &start, &end) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_point); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(57, 1994, __pyx_L1_error) __pyx_v_cpoint = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":1995 * cdef PetscInt start = 0, end = 0 * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cfield = asInt(field) # <<<<<<<<<<<<<< * CHKERR( DMPlexGetPointGlobalField(self.dm, cpoint, cfield, &start, &end) ) * return toInt(start), toInt(end) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_field); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(57, 1995, __pyx_L1_error) __pyx_v_cfield = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":1996 * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cfield = asInt(field) * CHKERR( DMPlexGetPointGlobalField(self.dm, cpoint, cfield, &start, &end) ) # <<<<<<<<<<<<<< * return toInt(start), toInt(end) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetPointGlobalField(__pyx_v_self->__pyx_base.dm, __pyx_v_cpoint, __pyx_v_cfield, (&__pyx_v_start), (&__pyx_v_end))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1996, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":1997 * cdef PetscInt cfield = asInt(field) * CHKERR( DMPlexGetPointGlobalField(self.dm, cpoint, cfield, &start, &end) ) * return toInt(start), toInt(end) # <<<<<<<<<<<<<< * * def createClosureIndex(self, Section sec or None) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(57, 1997, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_end); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 1997, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 1997, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3)) __PYX_ERR(57, 1997, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4)) __PYX_ERR(57, 1997, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":1968 * return toInt(start), toInt(end) * * def getPointGlobalField(self, point: int, field: int) -> tuple[int, int]: # <<<<<<<<<<<<<< * """Return location of point field data in global `Vec`. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getPointGlobalField", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":1999 * return toInt(start), toInt(end) * * def createClosureIndex(self, Section sec or None) -> None: # <<<<<<<<<<<<<< * """Calculate an index for ``sec`` for the closure operation. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_157createClosureIndex(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_156createClosureIndex, "DMPlex.createClosureIndex(self, sec: Section) -> None\nCalculate an index for ``sec`` for the closure operation.\n\n Not collective.\n\n Parameters\n ----------\n sec\n The `Section` describing the layout in the local vector,\n or `None` to use the default section.\n\n See Also\n --------\n DM, DMPlex, Section, DMPlex.vecGetClosure\n petsc.DMPlexCreateClosureIndex\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:1999"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_157createClosureIndex(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscSectionObject *__pyx_v_sec = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createClosureIndex (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sec,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sec)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 1999, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createClosureIndex") < 0)) __PYX_ERR(57, 1999, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_sec = ((struct PyPetscSectionObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createClosureIndex", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 1999, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.createClosureIndex", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sec), __pyx_ptype_8petsc4py_5PETSc_Section, 1, "sec", 0))) __PYX_ERR(57, 1999, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_156createClosureIndex(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_sec); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_156createClosureIndex(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscSectionObject *__pyx_v_sec) { PetscSection __pyx_v_csec; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscSection __pyx_t_1; int __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createClosureIndex", 1); /* "petsc4py/PETSc/DMPlex.pyx":2016 * * """ * cdef PetscSection csec = sec.sec if sec is not None else NULL # <<<<<<<<<<<<<< * CHKERR( DMPlexCreateClosureIndex(self.dm, csec) ) * */ __pyx_t_2 = (((PyObject *)__pyx_v_sec) != Py_None); if (__pyx_t_2) { __pyx_t_1 = __pyx_v_sec->sec; } else { __pyx_t_1 = NULL; } __pyx_v_csec = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":2017 * """ * cdef PetscSection csec = sec.sec if sec is not None else NULL * CHKERR( DMPlexCreateClosureIndex(self.dm, csec) ) # <<<<<<<<<<<<<< * * # */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexCreateClosureIndex(__pyx_v_self->__pyx_base.dm, __pyx_v_csec)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 2017, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":1999 * return toInt(start), toInt(end) * * def createClosureIndex(self, Section sec or None) -> None: # <<<<<<<<<<<<<< * """Calculate an index for ``sec`` for the closure operation. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.createClosureIndex", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":2021 * # * * def setRefinementUniform(self, refinementUniform: bool | None = True) -> None: # <<<<<<<<<<<<<< * """Set the flag for uniform refinement. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_159setRefinementUniform(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_158setRefinementUniform, "DMPlex.setRefinementUniform(self, refinementUniform: bool | None = True) -> None\nSet the flag for uniform refinement.\n\n Parameters\n ----------\n refinementUniform\n The flag for uniform refinement.\n\n See Also\n --------\n DM, DMPlex, DM.refine, DMPlex.getRefinementUniform\n DMPlex.getRefinementLimit, DMPlex.setRefinementLimit\n petsc.DMPlexSetRefinementUniform\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:2021"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_159setRefinementUniform(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_refinementUniform = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setRefinementUniform (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_refinementUniform,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_True)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_refinementUniform); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 2021, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setRefinementUniform") < 0)) __PYX_ERR(57, 2021, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_refinementUniform = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setRefinementUniform", 0, 0, 1, __pyx_nargs); __PYX_ERR(57, 2021, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.setRefinementUniform", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_158setRefinementUniform(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_refinementUniform); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_158setRefinementUniform(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_refinementUniform) { PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setRefinementUniform", 1); /* "petsc4py/PETSc/DMPlex.pyx":2036 * * """ * cdef PetscBool flag = refinementUniform # <<<<<<<<<<<<<< * CHKERR( DMPlexSetRefinementUniform(self.dm, flag) ) * */ __pyx_t_1 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_refinementUniform)); if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 2036, __pyx_L1_error) __pyx_v_flag = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":2037 * """ * cdef PetscBool flag = refinementUniform * CHKERR( DMPlexSetRefinementUniform(self.dm, flag) ) # <<<<<<<<<<<<<< * * def getRefinementUniform(self) -> bool: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexSetRefinementUniform(__pyx_v_self->__pyx_base.dm, __pyx_v_flag)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 2037, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":2021 * # * * def setRefinementUniform(self, refinementUniform: bool | None = True) -> None: # <<<<<<<<<<<<<< * """Set the flag for uniform refinement. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.setRefinementUniform", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":2039 * CHKERR( DMPlexSetRefinementUniform(self.dm, flag) ) * * def getRefinementUniform(self) -> bool: # <<<<<<<<<<<<<< * """Retrieve the flag for uniform refinement. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_161getRefinementUniform(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_160getRefinementUniform, "DMPlex.getRefinementUniform(self) -> bool\nRetrieve the flag for uniform refinement.\n\n Returns\n -------\n refinementUniform : bool\n The flag for uniform refinement.\n\n See Also\n --------\n DM, DMPlex, DM.refine, DMPlex.setRefinementUniform\n DMPlex.getRefinementLimit, DMPlex.setRefinementLimit\n petsc.DMPlexGetRefinementUniform\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:2039"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_161getRefinementUniform(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getRefinementUniform (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getRefinementUniform", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getRefinementUniform", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_160getRefinementUniform(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_160getRefinementUniform(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self) { PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getRefinementUniform", 1); /* "petsc4py/PETSc/DMPlex.pyx":2054 * * """ * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( DMPlexGetRefinementUniform(self.dm, &flag) ) * return toBool(flag) */ __pyx_v_flag = PETSC_FALSE; /* "petsc4py/PETSc/DMPlex.pyx":2055 * """ * cdef PetscBool flag = PETSC_FALSE * CHKERR( DMPlexGetRefinementUniform(self.dm, &flag) ) # <<<<<<<<<<<<<< * return toBool(flag) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetRefinementUniform(__pyx_v_self->__pyx_base.dm, (&__pyx_v_flag))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 2055, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":2056 * cdef PetscBool flag = PETSC_FALSE * CHKERR( DMPlexGetRefinementUniform(self.dm, &flag) ) * return toBool(flag) # <<<<<<<<<<<<<< * * def setRefinementLimit(self, refinementLimit: float) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(57, 2056, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":2039 * CHKERR( DMPlexSetRefinementUniform(self.dm, flag) ) * * def getRefinementUniform(self) -> bool: # <<<<<<<<<<<<<< * """Retrieve the flag for uniform refinement. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getRefinementUniform", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":2058 * return toBool(flag) * * def setRefinementLimit(self, refinementLimit: float) -> None: # <<<<<<<<<<<<<< * """Set the maximum cell volume for refinement. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_163setRefinementLimit(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_162setRefinementLimit, "DMPlex.setRefinementLimit(self, refinementLimit: float) -> None\nSet the maximum cell volume for refinement.\n\n Parameters\n ----------\n refinementLimit\n The maximum cell volume in the refined mesh.\n\n See Also\n --------\n DM, DMPlex, DM.refine, DMPlex.getRefinementLimit\n DMPlex.getRefinementUniform, DMPlex.setRefinementUniform\n petsc.DMPlexSetRefinementLimit\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:2058"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_163setRefinementLimit(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_refinementLimit = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setRefinementLimit (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_refinementLimit,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_refinementLimit)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 2058, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setRefinementLimit") < 0)) __PYX_ERR(57, 2058, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_refinementLimit = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setRefinementLimit", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 2058, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.setRefinementLimit", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_162setRefinementLimit(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_refinementLimit); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_162setRefinementLimit(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_refinementLimit) { PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setRefinementLimit", 1); /* "petsc4py/PETSc/DMPlex.pyx":2073 * * """ * cdef PetscReal rval = asReal(refinementLimit) # <<<<<<<<<<<<<< * CHKERR( DMPlexSetRefinementLimit(self.dm, rval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_refinementLimit); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(57, 2073, __pyx_L1_error) __pyx_v_rval = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":2074 * """ * cdef PetscReal rval = asReal(refinementLimit) * CHKERR( DMPlexSetRefinementLimit(self.dm, rval) ) # <<<<<<<<<<<<<< * * def getRefinementLimit(self) -> float: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexSetRefinementLimit(__pyx_v_self->__pyx_base.dm, __pyx_v_rval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 2074, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":2058 * return toBool(flag) * * def setRefinementLimit(self, refinementLimit: float) -> None: # <<<<<<<<<<<<<< * """Set the maximum cell volume for refinement. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.setRefinementLimit", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":2076 * CHKERR( DMPlexSetRefinementLimit(self.dm, rval) ) * * def getRefinementLimit(self) -> float: # <<<<<<<<<<<<<< * """Retrieve the maximum cell volume for refinement. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_165getRefinementLimit(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_164getRefinementLimit, "DMPlex.getRefinementLimit(self) -> float\nRetrieve the maximum cell volume for refinement.\n\n See Also\n --------\n DM, DMPlex, DM.refine, DMPlex.setRefinementLimit\n DMPlex.getRefinementUniform, DMPlex.setRefinementUniform\n petsc.DMPlexGetRefinementLimit\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:2076"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_165getRefinementLimit(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getRefinementLimit (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getRefinementLimit", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getRefinementLimit", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_164getRefinementLimit(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_164getRefinementLimit(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self) { PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getRefinementLimit", 1); /* "petsc4py/PETSc/DMPlex.pyx":2086 * * """ * cdef PetscReal rval = 0.0 # <<<<<<<<<<<<<< * CHKERR( DMPlexGetRefinementLimit(self.dm, &rval) ) * return toReal(rval) */ __pyx_v_rval = 0.0; /* "petsc4py/PETSc/DMPlex.pyx":2087 * """ * cdef PetscReal rval = 0.0 * CHKERR( DMPlexGetRefinementLimit(self.dm, &rval) ) # <<<<<<<<<<<<<< * return toReal(rval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetRefinementLimit(__pyx_v_self->__pyx_base.dm, (&__pyx_v_rval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 2087, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":2088 * cdef PetscReal rval = 0.0 * CHKERR( DMPlexGetRefinementLimit(self.dm, &rval) ) * return toReal(rval) # <<<<<<<<<<<<<< * * def getOrdering(self, otype: Mat.OrderingType) -> IS: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_rval); if (unlikely(!__pyx_t_2)) __PYX_ERR(57, 2088, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":2076 * CHKERR( DMPlexSetRefinementLimit(self.dm, rval) ) * * def getRefinementLimit(self) -> float: # <<<<<<<<<<<<<< * """Retrieve the maximum cell volume for refinement. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getRefinementLimit", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":2090 * return toReal(rval) * * def getOrdering(self, otype: Mat.OrderingType) -> IS: # <<<<<<<<<<<<<< * """Calculate a reordering of the mesh. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_167getOrdering(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_166getOrdering, "DMPlex.getOrdering(self, otype: Mat.OrderingType) -> IS\nCalculate a reordering of the mesh.\n\n Collective.\n\n Parameters\n ----------\n otype\n Type of reordering, see `Mat.OrderingType`.\n\n Returns\n -------\n perm : IS\n The point permutation.\n\n See Also\n --------\n DMPlex, DMPlex.permute, Mat.OrderingType, Mat.getOrdering\n petsc.DMPlexGetOrdering\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:2090"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_167getOrdering(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_otype = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getOrdering (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_otype,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_otype)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 2090, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getOrdering") < 0)) __PYX_ERR(57, 2090, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_otype = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getOrdering", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 2090, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getOrdering", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_166getOrdering(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_otype); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_166getOrdering(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_otype) { MatOrderingType __pyx_v_cval; DMLabel __pyx_v_label; struct PyPetscISObject *__pyx_v_perm = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getOrdering", 0); __Pyx_INCREF(__pyx_v_otype); /* "petsc4py/PETSc/DMPlex.pyx":2111 * * """ * cdef PetscMatOrderingType cval = NULL # <<<<<<<<<<<<<< * cdef PetscDMLabel label = NULL * otype = str2bytes(otype, &cval) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/DMPlex.pyx":2112 * """ * cdef PetscMatOrderingType cval = NULL * cdef PetscDMLabel label = NULL # <<<<<<<<<<<<<< * otype = str2bytes(otype, &cval) * cdef IS perm = IS() */ __pyx_v_label = NULL; /* "petsc4py/PETSc/DMPlex.pyx":2113 * cdef PetscMatOrderingType cval = NULL * cdef PetscDMLabel label = NULL * otype = str2bytes(otype, &cval) # <<<<<<<<<<<<<< * cdef IS perm = IS() * CHKERR( DMPlexGetOrdering(self.dm, cval, label, &perm.iset) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_otype, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(57, 2113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_otype, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DMPlex.pyx":2114 * cdef PetscDMLabel label = NULL * otype = str2bytes(otype, &cval) * cdef IS perm = IS() # <<<<<<<<<<<<<< * CHKERR( DMPlexGetOrdering(self.dm, cval, label, &perm.iset) ) * return perm */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_1)) __PYX_ERR(57, 2114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_perm = ((struct PyPetscISObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DMPlex.pyx":2115 * otype = str2bytes(otype, &cval) * cdef IS perm = IS() * CHKERR( DMPlexGetOrdering(self.dm, cval, label, &perm.iset) ) # <<<<<<<<<<<<<< * return perm * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetOrdering(__pyx_v_self->__pyx_base.dm, __pyx_v_cval, __pyx_v_label, (&__pyx_v_perm->iset))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 2115, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":2116 * cdef IS perm = IS() * CHKERR( DMPlexGetOrdering(self.dm, cval, label, &perm.iset) ) * return perm # <<<<<<<<<<<<<< * * def permute(self, IS perm) -> DMPlex: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_perm); __pyx_r = ((PyObject *)__pyx_v_perm); goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":2090 * return toReal(rval) * * def getOrdering(self, otype: Mat.OrderingType) -> IS: # <<<<<<<<<<<<<< * """Calculate a reordering of the mesh. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getOrdering", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_perm); __Pyx_XDECREF(__pyx_v_otype); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":2118 * return perm * * def permute(self, IS perm) -> DMPlex: # <<<<<<<<<<<<<< * """Reorder the mesh according to the input permutation. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_169permute(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_168permute, "DMPlex.permute(self, perm: IS) -> DMPlex\nReorder the mesh according to the input permutation.\n\n Collective.\n\n Parameters\n ----------\n perm\n The point permutation, ``perm[old point number] = new point number``.\n\n Returns\n -------\n pdm : DMPlex\n The permuted `DMPlex`.\n\n See Also\n --------\n DMPlex, Mat.permute, petsc.DMPlexPermute\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:2118"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_169permute(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscISObject *__pyx_v_perm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("permute (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_perm,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_perm)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 2118, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "permute") < 0)) __PYX_ERR(57, 2118, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_perm = ((struct PyPetscISObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("permute", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 2118, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.permute", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_perm), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "perm", 0))) __PYX_ERR(57, 2118, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_168permute(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_perm); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_168permute(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscISObject *__pyx_v_perm) { struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_dm = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PetscErrorCode __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("permute", 1); /* "petsc4py/PETSc/DMPlex.pyx":2138 * * """ * cdef DMPlex dm = type(self)() # <<<<<<<<<<<<<< * CHKERR( DMPlexPermute(self.dm, perm.iset, &dm.dm) ) * return dm */ __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __pyx_t_2 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(57, 2138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_dm = ((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DMPlex.pyx":2139 * """ * cdef DMPlex dm = type(self)() * CHKERR( DMPlexPermute(self.dm, perm.iset, &dm.dm) ) # <<<<<<<<<<<<<< * return dm * */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexPermute(__pyx_v_self->__pyx_base.dm, __pyx_v_perm->iset, (&__pyx_v_dm->__pyx_base.dm))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 2139, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":2140 * cdef DMPlex dm = type(self)() * CHKERR( DMPlexPermute(self.dm, perm.iset, &dm.dm) ) * return dm # <<<<<<<<<<<<<< * * def reorderGetDefault(self) -> DMPlex.ReorderDefaultFlag: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_dm); __pyx_r = ((PyObject *)__pyx_v_dm); goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":2118 * return perm * * def permute(self, IS perm) -> DMPlex: # <<<<<<<<<<<<<< * """Reorder the mesh according to the input permutation. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.permute", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_dm); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":2142 * return dm * * def reorderGetDefault(self) -> DMPlex.ReorderDefaultFlag: # <<<<<<<<<<<<<< * """Return flag indicating whether the `DMPlex` should be reordered by default. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_171reorderGetDefault(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_170reorderGetDefault, "DMPlex.reorderGetDefault(self) -> DMPlex.ReorderDefaultFlag\nReturn flag indicating whether the `DMPlex` should be reordered by default.\n\n Not collective.\n\n See Also\n --------\n `DMPlex.reorderSetDefault`, petsc.DMPlexReorderGetDefault\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:2142"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_171reorderGetDefault(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("reorderGetDefault (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("reorderGetDefault", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "reorderGetDefault", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_170reorderGetDefault(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_170reorderGetDefault(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self) { DMPlexReorderDefaultFlag __pyx_v_reorder; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("reorderGetDefault", 1); /* "petsc4py/PETSc/DMPlex.pyx":2152 * * """ * cdef PetscDMPlexReorderDefaultFlag reorder = DMPLEX_REORDER_DEFAULT_NOTSET # <<<<<<<<<<<<<< * CHKERR( DMPlexReorderGetDefault(self.dm, &reorder) ) * return reorder */ __pyx_v_reorder = DMPLEX_REORDER_DEFAULT_NOTSET; /* "petsc4py/PETSc/DMPlex.pyx":2153 * """ * cdef PetscDMPlexReorderDefaultFlag reorder = DMPLEX_REORDER_DEFAULT_NOTSET * CHKERR( DMPlexReorderGetDefault(self.dm, &reorder) ) # <<<<<<<<<<<<<< * return reorder * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexReorderGetDefault(__pyx_v_self->__pyx_base.dm, (&__pyx_v_reorder))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 2153, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":2154 * cdef PetscDMPlexReorderDefaultFlag reorder = DMPLEX_REORDER_DEFAULT_NOTSET * CHKERR( DMPlexReorderGetDefault(self.dm, &reorder) ) * return reorder # <<<<<<<<<<<<<< * * def reorderSetDefault(self, flag: DMPlex.ReorderDefaultFlag): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_DMPlexReorderDefaultFlag(__pyx_v_reorder); if (unlikely(!__pyx_t_2)) __PYX_ERR(57, 2154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":2142 * return dm * * def reorderGetDefault(self) -> DMPlex.ReorderDefaultFlag: # <<<<<<<<<<<<<< * """Return flag indicating whether the `DMPlex` should be reordered by default. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.reorderGetDefault", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":2156 * return reorder * * def reorderSetDefault(self, flag: DMPlex.ReorderDefaultFlag): # <<<<<<<<<<<<<< * """Set flag indicating whether the DM should be reordered by default. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_173reorderSetDefault(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_172reorderSetDefault, "DMPlex.reorderSetDefault(self, flag: DMPlex.ReorderDefaultFlag)\nSet flag indicating whether the DM should be reordered by default.\n\n Logically collective.\n\n Parameters\n ----------\n reorder\n Flag for reordering.\n\n See Also\n --------\n DMPlex.reorderGetDefault, petsc.DMPlexReorderSetDefault\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:2156"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_173reorderSetDefault(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_flag = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("reorderSetDefault (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flag)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 2156, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "reorderSetDefault") < 0)) __PYX_ERR(57, 2156, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_flag = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("reorderSetDefault", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 2156, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.reorderSetDefault", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_172reorderSetDefault(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_flag); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_172reorderSetDefault(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_flag) { DMPlexReorderDefaultFlag __pyx_v_reorder; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations DMPlexReorderDefaultFlag __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("reorderSetDefault", 1); /* "petsc4py/PETSc/DMPlex.pyx":2171 * * """ * cdef PetscDMPlexReorderDefaultFlag reorder = flag # <<<<<<<<<<<<<< * CHKERR( DMPlexReorderSetDefault(self.dm, reorder) ) * return */ __pyx_t_1 = ((DMPlexReorderDefaultFlag)__Pyx_PyInt_As_DMPlexReorderDefaultFlag(__pyx_v_flag)); if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 2171, __pyx_L1_error) __pyx_v_reorder = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":2172 * """ * cdef PetscDMPlexReorderDefaultFlag reorder = flag * CHKERR( DMPlexReorderSetDefault(self.dm, reorder) ) # <<<<<<<<<<<<<< * return * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexReorderSetDefault(__pyx_v_self->__pyx_base.dm, __pyx_v_reorder)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 2172, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":2173 * cdef PetscDMPlexReorderDefaultFlag reorder = flag * CHKERR( DMPlexReorderSetDefault(self.dm, reorder) ) * return # <<<<<<<<<<<<<< * * # */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":2156 * return reorder * * def reorderSetDefault(self, flag: DMPlex.ReorderDefaultFlag): # <<<<<<<<<<<<<< * """Set flag indicating whether the DM should be reordered by default. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.reorderSetDefault", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":2177 * # * * def computeCellGeometryFVM(self, cell: int) -> tuple[float, ArrayReal, ArrayReal]: # <<<<<<<<<<<<<< * """Compute the volume for a given cell. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_175computeCellGeometryFVM(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_174computeCellGeometryFVM, "DMPlex.computeCellGeometryFVM(self, cell: int) -> tuple[float, ArrayReal, ArrayReal]\nCompute the volume for a given cell.\n\n Collective.\n\n Parameters\n ----------\n cell\n The cell.\n\n Returns\n -------\n volume : float\n The cell volume.\n centroid : ArrayReal\n The cell centroid.\n normal : ArrayReal\n The cell normal, if appropriate.\n\n See Also\n --------\n DMPlex, DM.getCoordinateSection, DM.getCoordinates\n petsc.DMPlexComputeCellGeometryFVM\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:2177"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_175computeCellGeometryFVM(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_cell = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("computeCellGeometryFVM (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cell,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_cell)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 2177, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "computeCellGeometryFVM") < 0)) __PYX_ERR(57, 2177, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_cell = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("computeCellGeometryFVM", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 2177, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.computeCellGeometryFVM", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_174computeCellGeometryFVM(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_cell); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_174computeCellGeometryFVM(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_cell) { PetscInt __pyx_v_cdim; PetscInt __pyx_v_ccell; PetscReal __pyx_v_vol; PetscReal __pyx_v_centroid[3]; PetscReal __pyx_v_normal[3]; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("computeCellGeometryFVM", 1); /* "petsc4py/PETSc/DMPlex.pyx":2202 * * """ * cdef PetscInt cdim = 0 # <<<<<<<<<<<<<< * cdef PetscInt ccell = asInt(cell) * CHKERR( DMGetCoordinateDim(self.dm, &cdim) ) */ __pyx_v_cdim = 0; /* "petsc4py/PETSc/DMPlex.pyx":2203 * """ * cdef PetscInt cdim = 0 * cdef PetscInt ccell = asInt(cell) # <<<<<<<<<<<<<< * CHKERR( DMGetCoordinateDim(self.dm, &cdim) ) * cdef PetscReal vol = 0, centroid[3], normal[3] */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_cell); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(57, 2203, __pyx_L1_error) __pyx_v_ccell = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":2204 * cdef PetscInt cdim = 0 * cdef PetscInt ccell = asInt(cell) * CHKERR( DMGetCoordinateDim(self.dm, &cdim) ) # <<<<<<<<<<<<<< * cdef PetscReal vol = 0, centroid[3], normal[3] * CHKERR( DMPlexComputeCellGeometryFVM(self.dm, ccell, &vol, centroid, normal) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetCoordinateDim(__pyx_v_self->__pyx_base.dm, (&__pyx_v_cdim))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 2204, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":2205 * cdef PetscInt ccell = asInt(cell) * CHKERR( DMGetCoordinateDim(self.dm, &cdim) ) * cdef PetscReal vol = 0, centroid[3], normal[3] # <<<<<<<<<<<<<< * CHKERR( DMPlexComputeCellGeometryFVM(self.dm, ccell, &vol, centroid, normal) ) * return (toReal(vol), array_r(cdim, centroid), array_r(cdim, normal)) */ __pyx_v_vol = 0.0; /* "petsc4py/PETSc/DMPlex.pyx":2206 * CHKERR( DMGetCoordinateDim(self.dm, &cdim) ) * cdef PetscReal vol = 0, centroid[3], normal[3] * CHKERR( DMPlexComputeCellGeometryFVM(self.dm, ccell, &vol, centroid, normal) ) # <<<<<<<<<<<<<< * return (toReal(vol), array_r(cdim, centroid), array_r(cdim, normal)) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexComputeCellGeometryFVM(__pyx_v_self->__pyx_base.dm, __pyx_v_ccell, (&__pyx_v_vol), __pyx_v_centroid, __pyx_v_normal)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 2206, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":2207 * cdef PetscReal vol = 0, centroid[3], normal[3] * CHKERR( DMPlexComputeCellGeometryFVM(self.dm, ccell, &vol, centroid, normal) ) * return (toReal(vol), array_r(cdim, centroid), array_r(cdim, normal)) # <<<<<<<<<<<<<< * * def constructGhostCells(self, labelName: str | None = None) -> int: */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_vol); if (unlikely(!__pyx_t_3)) __PYX_ERR(57, 2207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_r(__pyx_v_cdim, __pyx_v_centroid)); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 2207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_r(__pyx_v_cdim, __pyx_v_normal)); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 2207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(57, 2207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3)) __PYX_ERR(57, 2207, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4)) __PYX_ERR(57, 2207, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_5)) __PYX_ERR(57, 2207, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":2177 * # * * def computeCellGeometryFVM(self, cell: int) -> tuple[float, ArrayReal, ArrayReal]: # <<<<<<<<<<<<<< * """Compute the volume for a given cell. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.computeCellGeometryFVM", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":2209 * return (toReal(vol), array_r(cdim, centroid), array_r(cdim, normal)) * * def constructGhostCells(self, labelName: str | None = None) -> int: # <<<<<<<<<<<<<< * """Construct ghost cells which connect to every boundary face. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_177constructGhostCells(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_176constructGhostCells, "DMPlex.constructGhostCells(self, labelName: str | None = None) -> int\nConstruct ghost cells which connect to every boundary face.\n\n Collective.\n\n Parameters\n ----------\n labelName\n The name of the label specifying the boundary faces.\n Defaults to ``\"Face Sets\"``.\n\n Returns\n -------\n numGhostCells : int\n The number of ghost cells added to the `DMPlex`.\n\n See Also\n --------\n DM, DMPlex, DM.create, petsc.DMPlexConstructGhostCells\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:2209"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_177constructGhostCells(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_labelName = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("constructGhostCells (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_labelName,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_labelName); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 2209, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "constructGhostCells") < 0)) __PYX_ERR(57, 2209, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_labelName = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("constructGhostCells", 0, 0, 1, __pyx_nargs); __PYX_ERR(57, 2209, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.constructGhostCells", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_176constructGhostCells(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_labelName); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_176constructGhostCells(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_labelName) { char const *__pyx_v_cname; PetscInt __pyx_v_numGhostCells; DM __pyx_v_dmGhosted; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("constructGhostCells", 0); __Pyx_INCREF(__pyx_v_labelName); /* "petsc4py/PETSc/DMPlex.pyx":2230 * * """ * cdef const char *cname = NULL # <<<<<<<<<<<<<< * labelName = str2bytes(labelName, &cname) * cdef PetscInt numGhostCells = 0 */ __pyx_v_cname = NULL; /* "petsc4py/PETSc/DMPlex.pyx":2231 * """ * cdef const char *cname = NULL * labelName = str2bytes(labelName, &cname) # <<<<<<<<<<<<<< * cdef PetscInt numGhostCells = 0 * cdef PetscDM dmGhosted = NULL */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_labelName, (&__pyx_v_cname)); if (unlikely(!__pyx_t_1)) __PYX_ERR(57, 2231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_labelName, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DMPlex.pyx":2232 * cdef const char *cname = NULL * labelName = str2bytes(labelName, &cname) * cdef PetscInt numGhostCells = 0 # <<<<<<<<<<<<<< * cdef PetscDM dmGhosted = NULL * CHKERR( DMPlexConstructGhostCells(self.dm, cname, &numGhostCells, &dmGhosted)) */ __pyx_v_numGhostCells = 0; /* "petsc4py/PETSc/DMPlex.pyx":2233 * labelName = str2bytes(labelName, &cname) * cdef PetscInt numGhostCells = 0 * cdef PetscDM dmGhosted = NULL # <<<<<<<<<<<<<< * CHKERR( DMPlexConstructGhostCells(self.dm, cname, &numGhostCells, &dmGhosted)) * CHKERR( PetscCLEAR(self.obj) ); self.dm = dmGhosted */ __pyx_v_dmGhosted = NULL; /* "petsc4py/PETSc/DMPlex.pyx":2234 * cdef PetscInt numGhostCells = 0 * cdef PetscDM dmGhosted = NULL * CHKERR( DMPlexConstructGhostCells(self.dm, cname, &numGhostCells, &dmGhosted)) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.dm = dmGhosted * return toInt(numGhostCells) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexConstructGhostCells(__pyx_v_self->__pyx_base.dm, __pyx_v_cname, (&__pyx_v_numGhostCells), (&__pyx_v_dmGhosted))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 2234, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":2235 * cdef PetscDM dmGhosted = NULL * CHKERR( DMPlexConstructGhostCells(self.dm, cname, &numGhostCells, &dmGhosted)) * CHKERR( PetscCLEAR(self.obj) ); self.dm = dmGhosted # <<<<<<<<<<<<<< * return toInt(numGhostCells) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 2235, __pyx_L1_error) __pyx_v_self->__pyx_base.dm = __pyx_v_dmGhosted; /* "petsc4py/PETSc/DMPlex.pyx":2236 * CHKERR( DMPlexConstructGhostCells(self.dm, cname, &numGhostCells, &dmGhosted)) * CHKERR( PetscCLEAR(self.obj) ); self.dm = dmGhosted * return toInt(numGhostCells) # <<<<<<<<<<<<<< * * # Metric */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_numGhostCells); if (unlikely(!__pyx_t_1)) __PYX_ERR(57, 2236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":2209 * return (toReal(vol), array_r(cdim, centroid), array_r(cdim, normal)) * * def constructGhostCells(self, labelName: str | None = None) -> int: # <<<<<<<<<<<<<< * """Construct ghost cells which connect to every boundary face. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.constructGhostCells", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_labelName); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":2240 * # Metric * * def metricSetFromOptions(self) -> None: # <<<<<<<<<<<<<< * CHKERR( DMPlexMetricSetFromOptions(self.dm) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_179metricSetFromOptions(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_178metricSetFromOptions, "DMPlex.metricSetFromOptions(self) -> None\nSource code at petsc4py/PETSc/DMPlex.pyx:2240"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_179metricSetFromOptions(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("metricSetFromOptions (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("metricSetFromOptions", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "metricSetFromOptions", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_178metricSetFromOptions(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_178metricSetFromOptions(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("metricSetFromOptions", 1); /* "petsc4py/PETSc/DMPlex.pyx":2241 * * def metricSetFromOptions(self) -> None: * CHKERR( DMPlexMetricSetFromOptions(self.dm) ) # <<<<<<<<<<<<<< * * def metricSetUniform(self, uniform: bool) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexMetricSetFromOptions(__pyx_v_self->__pyx_base.dm)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 2241, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":2240 * # Metric * * def metricSetFromOptions(self) -> None: # <<<<<<<<<<<<<< * CHKERR( DMPlexMetricSetFromOptions(self.dm) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.metricSetFromOptions", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":2243 * CHKERR( DMPlexMetricSetFromOptions(self.dm) ) * * def metricSetUniform(self, uniform: bool) -> None: # <<<<<<<<<<<<<< * """Record whether the metric is uniform or not. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_181metricSetUniform(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_180metricSetUniform, "DMPlex.metricSetUniform(self, uniform: bool) -> None\nRecord whether the metric is uniform or not.\n\n Parameters\n ----------\n uniform\n Flag indicating whether the metric is uniform or not.\n\n See Also\n --------\n DMPlex.metricIsUniform, DMPlex.metricSetIsotropic\n DMPlex.metricSetRestrictAnisotropyFirst, petsc.DMPlexMetricSetUniform\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:2243"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_181metricSetUniform(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_uniform = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("metricSetUniform (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_uniform,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_uniform)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 2243, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "metricSetUniform") < 0)) __PYX_ERR(57, 2243, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_uniform = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("metricSetUniform", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 2243, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.metricSetUniform", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_180metricSetUniform(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_uniform); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_180metricSetUniform(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_uniform) { PetscBool __pyx_v_bval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("metricSetUniform", 1); /* "petsc4py/PETSc/DMPlex.pyx":2257 * * """ * cdef PetscBool bval = asBool(uniform) # <<<<<<<<<<<<<< * CHKERR( DMPlexMetricSetUniform(self.dm, bval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asBool(__pyx_v_uniform); if (unlikely(__pyx_t_1 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(57, 2257, __pyx_L1_error) __pyx_v_bval = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":2258 * """ * cdef PetscBool bval = asBool(uniform) * CHKERR( DMPlexMetricSetUniform(self.dm, bval) ) # <<<<<<<<<<<<<< * * def metricIsUniform(self) -> bool: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexMetricSetUniform(__pyx_v_self->__pyx_base.dm, __pyx_v_bval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 2258, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":2243 * CHKERR( DMPlexMetricSetFromOptions(self.dm) ) * * def metricSetUniform(self, uniform: bool) -> None: # <<<<<<<<<<<<<< * """Record whether the metric is uniform or not. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.metricSetUniform", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":2260 * CHKERR( DMPlexMetricSetUniform(self.dm, bval) ) * * def metricIsUniform(self) -> bool: # <<<<<<<<<<<<<< * """Return the flag indicating whether the metric is uniform or not. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_183metricIsUniform(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_182metricIsUniform, "DMPlex.metricIsUniform(self) -> bool\nReturn the flag indicating whether the metric is uniform or not.\n\n See Also\n --------\n DMPlex.metricSetUniform, DMPlex.metricRestrictAnisotropyFirst\n petsc.DMPlexMetricIsUniform\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:2260"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_183metricIsUniform(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("metricIsUniform (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("metricIsUniform", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "metricIsUniform", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_182metricIsUniform(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_182metricIsUniform(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self) { PetscBool __pyx_v_uniform; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("metricIsUniform", 1); /* "petsc4py/PETSc/DMPlex.pyx":2269 * * """ * cdef PetscBool uniform = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( DMPlexMetricIsUniform(self.dm, &uniform) ) * return toBool(uniform) */ __pyx_v_uniform = PETSC_FALSE; /* "petsc4py/PETSc/DMPlex.pyx":2270 * """ * cdef PetscBool uniform = PETSC_FALSE * CHKERR( DMPlexMetricIsUniform(self.dm, &uniform) ) # <<<<<<<<<<<<<< * return toBool(uniform) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexMetricIsUniform(__pyx_v_self->__pyx_base.dm, (&__pyx_v_uniform))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 2270, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":2271 * cdef PetscBool uniform = PETSC_FALSE * CHKERR( DMPlexMetricIsUniform(self.dm, &uniform) ) * return toBool(uniform) # <<<<<<<<<<<<<< * * def metricSetIsotropic(self, isotropic: bool) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_uniform); if (unlikely(!__pyx_t_2)) __PYX_ERR(57, 2271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":2260 * CHKERR( DMPlexMetricSetUniform(self.dm, bval) ) * * def metricIsUniform(self) -> bool: # <<<<<<<<<<<<<< * """Return the flag indicating whether the metric is uniform or not. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.metricIsUniform", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":2273 * return toBool(uniform) * * def metricSetIsotropic(self, isotropic: bool) -> None: # <<<<<<<<<<<<<< * """Record whether the metric is isotropic or not. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_185metricSetIsotropic(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_184metricSetIsotropic, "DMPlex.metricSetIsotropic(self, isotropic: bool) -> None\nRecord whether the metric is isotropic or not.\n\n Parameters\n ----------\n isotropic\n Flag indicating whether the metric is isotropic or not.\n\n See Also\n --------\n DMPlex.metricIsIsotropic, DMPlex.metricSetUniform\n DMPlex.metricSetRestrictAnisotropyFirst, petsc.DMPlexMetricSetIsotropic\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:2273"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_185metricSetIsotropic(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_isotropic = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("metricSetIsotropic (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_isotropic,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_isotropic)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 2273, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "metricSetIsotropic") < 0)) __PYX_ERR(57, 2273, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_isotropic = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("metricSetIsotropic", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 2273, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.metricSetIsotropic", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_184metricSetIsotropic(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_isotropic); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_184metricSetIsotropic(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_isotropic) { PetscBool __pyx_v_bval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("metricSetIsotropic", 1); /* "petsc4py/PETSc/DMPlex.pyx":2287 * * """ * cdef PetscBool bval = asBool(isotropic) # <<<<<<<<<<<<<< * CHKERR( DMPlexMetricSetIsotropic(self.dm, bval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asBool(__pyx_v_isotropic); if (unlikely(__pyx_t_1 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(57, 2287, __pyx_L1_error) __pyx_v_bval = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":2288 * """ * cdef PetscBool bval = asBool(isotropic) * CHKERR( DMPlexMetricSetIsotropic(self.dm, bval) ) # <<<<<<<<<<<<<< * * def metricIsIsotropic(self) -> bool: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexMetricSetIsotropic(__pyx_v_self->__pyx_base.dm, __pyx_v_bval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 2288, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":2273 * return toBool(uniform) * * def metricSetIsotropic(self, isotropic: bool) -> None: # <<<<<<<<<<<<<< * """Record whether the metric is isotropic or not. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.metricSetIsotropic", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":2290 * CHKERR( DMPlexMetricSetIsotropic(self.dm, bval) ) * * def metricIsIsotropic(self) -> bool: # <<<<<<<<<<<<<< * """Return the flag indicating whether the metric is isotropic or not. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_187metricIsIsotropic(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_186metricIsIsotropic, "DMPlex.metricIsIsotropic(self) -> bool\nReturn the flag indicating whether the metric is isotropic or not.\n\n See Also\n --------\n DMPlex.metricSetIsotropic, DMPlex.metricIsUniform\n DMPlex.metricRestrictAnisotropyFirst, petsc.DMPlexMetricIsIsotropic\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:2290"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_187metricIsIsotropic(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("metricIsIsotropic (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("metricIsIsotropic", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "metricIsIsotropic", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_186metricIsIsotropic(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_186metricIsIsotropic(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self) { PetscBool __pyx_v_isotropic; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("metricIsIsotropic", 1); /* "petsc4py/PETSc/DMPlex.pyx":2299 * * """ * cdef PetscBool isotropic = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( DMPlexMetricIsIsotropic(self.dm, &isotropic) ) * return toBool(isotropic) */ __pyx_v_isotropic = PETSC_FALSE; /* "petsc4py/PETSc/DMPlex.pyx":2300 * """ * cdef PetscBool isotropic = PETSC_FALSE * CHKERR( DMPlexMetricIsIsotropic(self.dm, &isotropic) ) # <<<<<<<<<<<<<< * return toBool(isotropic) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexMetricIsIsotropic(__pyx_v_self->__pyx_base.dm, (&__pyx_v_isotropic))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 2300, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":2301 * cdef PetscBool isotropic = PETSC_FALSE * CHKERR( DMPlexMetricIsIsotropic(self.dm, &isotropic) ) * return toBool(isotropic) # <<<<<<<<<<<<<< * * def metricSetRestrictAnisotropyFirst(self, restrictAnisotropyFirst: bool) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_isotropic); if (unlikely(!__pyx_t_2)) __PYX_ERR(57, 2301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":2290 * CHKERR( DMPlexMetricSetIsotropic(self.dm, bval) ) * * def metricIsIsotropic(self) -> bool: # <<<<<<<<<<<<<< * """Return the flag indicating whether the metric is isotropic or not. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.metricIsIsotropic", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":2303 * return toBool(isotropic) * * def metricSetRestrictAnisotropyFirst(self, restrictAnisotropyFirst: bool) -> None: # <<<<<<<<<<<<<< * """Record whether anisotropy is be restricted before normalization or after. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_189metricSetRestrictAnisotropyFirst(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_188metricSetRestrictAnisotropyFirst, "DMPlex.metricSetRestrictAnisotropyFirst(self, restrictAnisotropyFirst: bool) -> None\nRecord whether anisotropy is be restricted before normalization or after.\n\n Parameters\n ----------\n restrictAnisotropyFirst\n Flag indicating if anisotropy is restricted before normalization or after.\n\n See Also\n --------\n DMPlex.metricSetIsotropic, DMPlex.metricRestrictAnisotropyFirst\n petsc.DMPlexMetricSetRestrictAnisotropyFirst\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:2303"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_189metricSetRestrictAnisotropyFirst(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_restrictAnisotropyFirst = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("metricSetRestrictAnisotropyFirst (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_restrictAnisotropyFirst,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_restrictAnisotropyFirst)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 2303, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "metricSetRestrictAnisotropyFirst") < 0)) __PYX_ERR(57, 2303, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_restrictAnisotropyFirst = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("metricSetRestrictAnisotropyFirst", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 2303, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.metricSetRestrictAnisotropyFirst", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_188metricSetRestrictAnisotropyFirst(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_restrictAnisotropyFirst); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_188metricSetRestrictAnisotropyFirst(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_restrictAnisotropyFirst) { PetscBool __pyx_v_bval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("metricSetRestrictAnisotropyFirst", 1); /* "petsc4py/PETSc/DMPlex.pyx":2317 * * """ * cdef PetscBool bval = asBool(restrictAnisotropyFirst) # <<<<<<<<<<<<<< * CHKERR( DMPlexMetricSetRestrictAnisotropyFirst(self.dm, bval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asBool(__pyx_v_restrictAnisotropyFirst); if (unlikely(__pyx_t_1 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(57, 2317, __pyx_L1_error) __pyx_v_bval = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":2318 * """ * cdef PetscBool bval = asBool(restrictAnisotropyFirst) * CHKERR( DMPlexMetricSetRestrictAnisotropyFirst(self.dm, bval) ) # <<<<<<<<<<<<<< * * def metricRestrictAnisotropyFirst(self) -> bool: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexMetricSetRestrictAnisotropyFirst(__pyx_v_self->__pyx_base.dm, __pyx_v_bval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 2318, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":2303 * return toBool(isotropic) * * def metricSetRestrictAnisotropyFirst(self, restrictAnisotropyFirst: bool) -> None: # <<<<<<<<<<<<<< * """Record whether anisotropy is be restricted before normalization or after. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.metricSetRestrictAnisotropyFirst", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":2320 * CHKERR( DMPlexMetricSetRestrictAnisotropyFirst(self.dm, bval) ) * * def metricRestrictAnisotropyFirst(self) -> bool: # <<<<<<<<<<<<<< * """Return ``true`` if anisotropy is restricted before normalization. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_191metricRestrictAnisotropyFirst(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_190metricRestrictAnisotropyFirst, "DMPlex.metricRestrictAnisotropyFirst(self) -> bool\nReturn ``true`` if anisotropy is restricted before normalization.\n\n See Also\n --------\n DMPlex.metricIsIsotropic, DMPlex.metricSetRestrictAnisotropyFirst\n petsc.DMPlexMetricRestrictAnisotropyFirst\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:2320"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_191metricRestrictAnisotropyFirst(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("metricRestrictAnisotropyFirst (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("metricRestrictAnisotropyFirst", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "metricRestrictAnisotropyFirst", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_190metricRestrictAnisotropyFirst(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_190metricRestrictAnisotropyFirst(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self) { PetscBool __pyx_v_restrictAnisotropyFirst; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("metricRestrictAnisotropyFirst", 1); /* "petsc4py/PETSc/DMPlex.pyx":2329 * * """ * cdef PetscBool restrictAnisotropyFirst = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( DMPlexMetricRestrictAnisotropyFirst(self.dm, &restrictAnisotropyFirst) ) * return toBool(restrictAnisotropyFirst) */ __pyx_v_restrictAnisotropyFirst = PETSC_FALSE; /* "petsc4py/PETSc/DMPlex.pyx":2330 * """ * cdef PetscBool restrictAnisotropyFirst = PETSC_FALSE * CHKERR( DMPlexMetricRestrictAnisotropyFirst(self.dm, &restrictAnisotropyFirst) ) # <<<<<<<<<<<<<< * return toBool(restrictAnisotropyFirst) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexMetricRestrictAnisotropyFirst(__pyx_v_self->__pyx_base.dm, (&__pyx_v_restrictAnisotropyFirst))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 2330, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":2331 * cdef PetscBool restrictAnisotropyFirst = PETSC_FALSE * CHKERR( DMPlexMetricRestrictAnisotropyFirst(self.dm, &restrictAnisotropyFirst) ) * return toBool(restrictAnisotropyFirst) # <<<<<<<<<<<<<< * * def metricSetNoInsertion(self, noInsert: bool) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_restrictAnisotropyFirst); if (unlikely(!__pyx_t_2)) __PYX_ERR(57, 2331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":2320 * CHKERR( DMPlexMetricSetRestrictAnisotropyFirst(self.dm, bval) ) * * def metricRestrictAnisotropyFirst(self) -> bool: # <<<<<<<<<<<<<< * """Return ``true`` if anisotropy is restricted before normalization. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.metricRestrictAnisotropyFirst", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":2333 * return toBool(restrictAnisotropyFirst) * * def metricSetNoInsertion(self, noInsert: bool) -> None: # <<<<<<<<<<<<<< * """Set the flag indicating whether node insertion should be turned off. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_193metricSetNoInsertion(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_192metricSetNoInsertion, "DMPlex.metricSetNoInsertion(self, noInsert: bool) -> None\nSet the flag indicating whether node insertion should be turned off.\n\n Parameters\n ----------\n noInsert\n Flag indicating whether node insertion and deletion should be turned off.\n\n See Also\n --------\n DMPlex.metricNoInsertion, DMPlex.metricSetNoSwapping\n DMPlex.metricSetNoMovement, DMPlex.metricSetNoSurf\n petsc.DMPlexMetricSetNoInsertion\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:2333"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_193metricSetNoInsertion(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_noInsert = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("metricSetNoInsertion (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_noInsert,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_noInsert)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 2333, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "metricSetNoInsertion") < 0)) __PYX_ERR(57, 2333, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_noInsert = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("metricSetNoInsertion", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 2333, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.metricSetNoInsertion", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_192metricSetNoInsertion(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_noInsert); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_192metricSetNoInsertion(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_noInsert) { PetscBool __pyx_v_bval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("metricSetNoInsertion", 1); /* "petsc4py/PETSc/DMPlex.pyx":2348 * * """ * cdef PetscBool bval = asBool(noInsert) # <<<<<<<<<<<<<< * CHKERR( DMPlexMetricSetNoInsertion(self.dm, bval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asBool(__pyx_v_noInsert); if (unlikely(__pyx_t_1 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(57, 2348, __pyx_L1_error) __pyx_v_bval = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":2349 * """ * cdef PetscBool bval = asBool(noInsert) * CHKERR( DMPlexMetricSetNoInsertion(self.dm, bval) ) # <<<<<<<<<<<<<< * * def metricNoInsertion(self) -> bool: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexMetricSetNoInsertion(__pyx_v_self->__pyx_base.dm, __pyx_v_bval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 2349, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":2333 * return toBool(restrictAnisotropyFirst) * * def metricSetNoInsertion(self, noInsert: bool) -> None: # <<<<<<<<<<<<<< * """Set the flag indicating whether node insertion should be turned off. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.metricSetNoInsertion", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":2351 * CHKERR( DMPlexMetricSetNoInsertion(self.dm, bval) ) * * def metricNoInsertion(self) -> bool: # <<<<<<<<<<<<<< * """Return the flag indicating whether node insertion and deletion are turned off. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_195metricNoInsertion(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_194metricNoInsertion, "DMPlex.metricNoInsertion(self) -> bool\nReturn the flag indicating whether node insertion and deletion are turned off.\n\n See Also\n --------\n DMPlex.metricSetNoInsertion, DMPlex.metricNoSwapping\n DMPlex.metricNoMovement, DMPlex.metricNoSurf\n petsc.DMPlexMetricNoInsertion\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:2351"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_195metricNoInsertion(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("metricNoInsertion (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("metricNoInsertion", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "metricNoInsertion", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_194metricNoInsertion(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_194metricNoInsertion(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self) { PetscBool __pyx_v_noInsert; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("metricNoInsertion", 1); /* "petsc4py/PETSc/DMPlex.pyx":2361 * * """ * cdef PetscBool noInsert = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( DMPlexMetricNoInsertion(self.dm, &noInsert) ) * return toBool(noInsert) */ __pyx_v_noInsert = PETSC_FALSE; /* "petsc4py/PETSc/DMPlex.pyx":2362 * """ * cdef PetscBool noInsert = PETSC_FALSE * CHKERR( DMPlexMetricNoInsertion(self.dm, &noInsert) ) # <<<<<<<<<<<<<< * return toBool(noInsert) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexMetricNoInsertion(__pyx_v_self->__pyx_base.dm, (&__pyx_v_noInsert))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 2362, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":2363 * cdef PetscBool noInsert = PETSC_FALSE * CHKERR( DMPlexMetricNoInsertion(self.dm, &noInsert) ) * return toBool(noInsert) # <<<<<<<<<<<<<< * * def metricSetNoSwapping(self, noSwap: bool) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_noInsert); if (unlikely(!__pyx_t_2)) __PYX_ERR(57, 2363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":2351 * CHKERR( DMPlexMetricSetNoInsertion(self.dm, bval) ) * * def metricNoInsertion(self) -> bool: # <<<<<<<<<<<<<< * """Return the flag indicating whether node insertion and deletion are turned off. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.metricNoInsertion", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":2365 * return toBool(noInsert) * * def metricSetNoSwapping(self, noSwap: bool) -> None: # <<<<<<<<<<<<<< * """Set the flag indicating whether facet swapping should be turned off. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_197metricSetNoSwapping(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_196metricSetNoSwapping, "DMPlex.metricSetNoSwapping(self, noSwap: bool) -> None\nSet the flag indicating whether facet swapping should be turned off.\n\n Parameters\n ----------\n noSwap\n Flag indicating whether facet swapping should be turned off.\n\n See Also\n --------\n DMPlex.metricNoSwapping, DMPlex.metricSetNoInsertion\n DMPlex.metricSetNoMovement, DMPlex.metricSetNoSurf\n petsc.DMPlexMetricSetNoSwapping\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:2365"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_197metricSetNoSwapping(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_noSwap = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("metricSetNoSwapping (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_noSwap,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_noSwap)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 2365, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "metricSetNoSwapping") < 0)) __PYX_ERR(57, 2365, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_noSwap = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("metricSetNoSwapping", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 2365, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.metricSetNoSwapping", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_196metricSetNoSwapping(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_noSwap); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_196metricSetNoSwapping(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_noSwap) { PetscBool __pyx_v_bval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("metricSetNoSwapping", 1); /* "petsc4py/PETSc/DMPlex.pyx":2380 * * """ * cdef PetscBool bval = asBool(noSwap) # <<<<<<<<<<<<<< * CHKERR( DMPlexMetricSetNoSwapping(self.dm, bval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asBool(__pyx_v_noSwap); if (unlikely(__pyx_t_1 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(57, 2380, __pyx_L1_error) __pyx_v_bval = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":2381 * """ * cdef PetscBool bval = asBool(noSwap) * CHKERR( DMPlexMetricSetNoSwapping(self.dm, bval) ) # <<<<<<<<<<<<<< * * def metricNoSwapping(self) -> bool: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexMetricSetNoSwapping(__pyx_v_self->__pyx_base.dm, __pyx_v_bval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 2381, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":2365 * return toBool(noInsert) * * def metricSetNoSwapping(self, noSwap: bool) -> None: # <<<<<<<<<<<<<< * """Set the flag indicating whether facet swapping should be turned off. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.metricSetNoSwapping", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":2383 * CHKERR( DMPlexMetricSetNoSwapping(self.dm, bval) ) * * def metricNoSwapping(self) -> bool: # <<<<<<<<<<<<<< * """Return the flag indicating whether facet swapping is turned off. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_199metricNoSwapping(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_198metricNoSwapping, "DMPlex.metricNoSwapping(self) -> bool\nReturn the flag indicating whether facet swapping is turned off.\n\n See Also\n --------\n DMPlex.metricSetNoSwapping, DMPlex.metricNoInsertion\n DMPlex.metricNoMovement, DMPlex.metricNoSurf\n petsc.DMPlexMetricNoSwapping\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:2383"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_199metricNoSwapping(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("metricNoSwapping (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("metricNoSwapping", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "metricNoSwapping", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_198metricNoSwapping(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_198metricNoSwapping(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self) { PetscBool __pyx_v_noSwap; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("metricNoSwapping", 1); /* "petsc4py/PETSc/DMPlex.pyx":2393 * * """ * cdef PetscBool noSwap = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( DMPlexMetricNoSwapping(self.dm, &noSwap) ) * return toBool(noSwap) */ __pyx_v_noSwap = PETSC_FALSE; /* "petsc4py/PETSc/DMPlex.pyx":2394 * """ * cdef PetscBool noSwap = PETSC_FALSE * CHKERR( DMPlexMetricNoSwapping(self.dm, &noSwap) ) # <<<<<<<<<<<<<< * return toBool(noSwap) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexMetricNoSwapping(__pyx_v_self->__pyx_base.dm, (&__pyx_v_noSwap))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 2394, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":2395 * cdef PetscBool noSwap = PETSC_FALSE * CHKERR( DMPlexMetricNoSwapping(self.dm, &noSwap) ) * return toBool(noSwap) # <<<<<<<<<<<<<< * * def metricSetNoMovement(self, noMove: bool) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_noSwap); if (unlikely(!__pyx_t_2)) __PYX_ERR(57, 2395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":2383 * CHKERR( DMPlexMetricSetNoSwapping(self.dm, bval) ) * * def metricNoSwapping(self) -> bool: # <<<<<<<<<<<<<< * """Return the flag indicating whether facet swapping is turned off. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.metricNoSwapping", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":2397 * return toBool(noSwap) * * def metricSetNoMovement(self, noMove: bool) -> None: # <<<<<<<<<<<<<< * """Set the flag indicating whether node movement should be turned off. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_201metricSetNoMovement(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_200metricSetNoMovement, "DMPlex.metricSetNoMovement(self, noMove: bool) -> None\nSet the flag indicating whether node movement should be turned off.\n\n Parameters\n ----------\n noMove\n Flag indicating whether node movement should be turned off.\n\n See Also\n --------\n DMPlex.metricNoMovement, DMPlex.metricSetNoInsertion\n DMPlex.metricSetNoSwapping, DMPlex.metricSetNoSurf\n petsc.DMPlexMetricSetNoMovement\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:2397"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_201metricSetNoMovement(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_noMove = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("metricSetNoMovement (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_noMove,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_noMove)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 2397, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "metricSetNoMovement") < 0)) __PYX_ERR(57, 2397, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_noMove = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("metricSetNoMovement", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 2397, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.metricSetNoMovement", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_200metricSetNoMovement(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_noMove); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_200metricSetNoMovement(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_noMove) { PetscBool __pyx_v_bval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("metricSetNoMovement", 1); /* "petsc4py/PETSc/DMPlex.pyx":2412 * * """ * cdef PetscBool bval = asBool(noMove) # <<<<<<<<<<<<<< * CHKERR( DMPlexMetricSetNoMovement(self.dm, bval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asBool(__pyx_v_noMove); if (unlikely(__pyx_t_1 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(57, 2412, __pyx_L1_error) __pyx_v_bval = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":2413 * """ * cdef PetscBool bval = asBool(noMove) * CHKERR( DMPlexMetricSetNoMovement(self.dm, bval) ) # <<<<<<<<<<<<<< * * def metricNoMovement(self) -> bool: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexMetricSetNoMovement(__pyx_v_self->__pyx_base.dm, __pyx_v_bval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 2413, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":2397 * return toBool(noSwap) * * def metricSetNoMovement(self, noMove: bool) -> None: # <<<<<<<<<<<<<< * """Set the flag indicating whether node movement should be turned off. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.metricSetNoMovement", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":2415 * CHKERR( DMPlexMetricSetNoMovement(self.dm, bval) ) * * def metricNoMovement(self) -> bool: # <<<<<<<<<<<<<< * """Return the flag indicating whether node movement is turned off. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_203metricNoMovement(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_202metricNoMovement, "DMPlex.metricNoMovement(self) -> bool\nReturn the flag indicating whether node movement is turned off.\n\n See Also\n --------\n DMPlex.metricSetNoMovement, DMPlex.metricNoInsertion\n DMPlex.metricNoSwapping, DMPlex.metricNoSurf\n petsc.DMPlexMetricNoMovement\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:2415"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_203metricNoMovement(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("metricNoMovement (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("metricNoMovement", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "metricNoMovement", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_202metricNoMovement(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_202metricNoMovement(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self) { PetscBool __pyx_v_noMove; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("metricNoMovement", 1); /* "petsc4py/PETSc/DMPlex.pyx":2425 * * """ * cdef PetscBool noMove = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( DMPlexMetricNoMovement(self.dm, &noMove) ) * return toBool(noMove) */ __pyx_v_noMove = PETSC_FALSE; /* "petsc4py/PETSc/DMPlex.pyx":2426 * """ * cdef PetscBool noMove = PETSC_FALSE * CHKERR( DMPlexMetricNoMovement(self.dm, &noMove) ) # <<<<<<<<<<<<<< * return toBool(noMove) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexMetricNoMovement(__pyx_v_self->__pyx_base.dm, (&__pyx_v_noMove))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 2426, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":2427 * cdef PetscBool noMove = PETSC_FALSE * CHKERR( DMPlexMetricNoMovement(self.dm, &noMove) ) * return toBool(noMove) # <<<<<<<<<<<<<< * * def metricSetNoSurf(self, noSurf: bool) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_noMove); if (unlikely(!__pyx_t_2)) __PYX_ERR(57, 2427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":2415 * CHKERR( DMPlexMetricSetNoMovement(self.dm, bval) ) * * def metricNoMovement(self) -> bool: # <<<<<<<<<<<<<< * """Return the flag indicating whether node movement is turned off. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.metricNoMovement", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":2429 * return toBool(noMove) * * def metricSetNoSurf(self, noSurf: bool) -> None: # <<<<<<<<<<<<<< * """Set the flag indicating whether surface modification should be turned off. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_205metricSetNoSurf(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_204metricSetNoSurf, "DMPlex.metricSetNoSurf(self, noSurf: bool) -> None\nSet the flag indicating whether surface modification should be turned off.\n\n Parameters\n ----------\n noSurf\n Flag indicating whether surface modification should be turned off.\n\n See Also\n --------\n DMPlex.metricNoSurf, DMPlex.metricSetNoMovement\n DMPlex.metricSetNoInsertion, DMPlex.metricSetNoSwapping\n petsc.DMPlexMetricSetNoSurf\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:2429"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_205metricSetNoSurf(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_noSurf = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("metricSetNoSurf (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_noSurf,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_noSurf)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 2429, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "metricSetNoSurf") < 0)) __PYX_ERR(57, 2429, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_noSurf = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("metricSetNoSurf", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 2429, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.metricSetNoSurf", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_204metricSetNoSurf(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_noSurf); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_204metricSetNoSurf(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_noSurf) { PetscBool __pyx_v_bval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("metricSetNoSurf", 1); /* "petsc4py/PETSc/DMPlex.pyx":2444 * * """ * cdef PetscBool bval = asBool(noSurf) # <<<<<<<<<<<<<< * CHKERR( DMPlexMetricSetNoSurf(self.dm, bval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asBool(__pyx_v_noSurf); if (unlikely(__pyx_t_1 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(57, 2444, __pyx_L1_error) __pyx_v_bval = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":2445 * """ * cdef PetscBool bval = asBool(noSurf) * CHKERR( DMPlexMetricSetNoSurf(self.dm, bval) ) # <<<<<<<<<<<<<< * * def metricNoSurf(self) -> bool: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexMetricSetNoSurf(__pyx_v_self->__pyx_base.dm, __pyx_v_bval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 2445, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":2429 * return toBool(noMove) * * def metricSetNoSurf(self, noSurf: bool) -> None: # <<<<<<<<<<<<<< * """Set the flag indicating whether surface modification should be turned off. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.metricSetNoSurf", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":2447 * CHKERR( DMPlexMetricSetNoSurf(self.dm, bval) ) * * def metricNoSurf(self) -> bool: # <<<<<<<<<<<<<< * """Return the flag indicating whether surface modification is turned off. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_207metricNoSurf(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_206metricNoSurf, "DMPlex.metricNoSurf(self) -> bool\nReturn the flag indicating whether surface modification is turned off.\n\n See Also\n --------\n DMPlex.metricSetNoSurf, DMPlex.metricNoMovement\n DMPlex.metricNoInsertion, DMPlex.metricNoSwapping\n petsc.DMPlexMetricNoSurf\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:2447"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_207metricNoSurf(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("metricNoSurf (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("metricNoSurf", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "metricNoSurf", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_206metricNoSurf(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_206metricNoSurf(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self) { PetscBool __pyx_v_noSurf; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("metricNoSurf", 1); /* "petsc4py/PETSc/DMPlex.pyx":2457 * * """ * cdef PetscBool noSurf = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( DMPlexMetricNoSurf(self.dm, &noSurf) ) * return toBool(noSurf) */ __pyx_v_noSurf = PETSC_FALSE; /* "petsc4py/PETSc/DMPlex.pyx":2458 * """ * cdef PetscBool noSurf = PETSC_FALSE * CHKERR( DMPlexMetricNoSurf(self.dm, &noSurf) ) # <<<<<<<<<<<<<< * return toBool(noSurf) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexMetricNoSurf(__pyx_v_self->__pyx_base.dm, (&__pyx_v_noSurf))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 2458, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":2459 * cdef PetscBool noSurf = PETSC_FALSE * CHKERR( DMPlexMetricNoSurf(self.dm, &noSurf) ) * return toBool(noSurf) # <<<<<<<<<<<<<< * * def metricSetVerbosity(self, verbosity: int) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_noSurf); if (unlikely(!__pyx_t_2)) __PYX_ERR(57, 2459, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":2447 * CHKERR( DMPlexMetricSetNoSurf(self.dm, bval) ) * * def metricNoSurf(self) -> bool: # <<<<<<<<<<<<<< * """Return the flag indicating whether surface modification is turned off. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.metricNoSurf", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":2461 * return toBool(noSurf) * * def metricSetVerbosity(self, verbosity: int) -> None: # <<<<<<<<<<<<<< * """Set the verbosity of the mesh adaptation package. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_209metricSetVerbosity(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_208metricSetVerbosity, "DMPlex.metricSetVerbosity(self, verbosity: int) -> None\nSet the verbosity of the mesh adaptation package.\n\n Parameters\n ----------\n verbosity\n The verbosity, where -1 is silent and 10 is maximum.\n\n See Also\n --------\n DMPlex.metricGetVerbosity, DMPlex.metricSetNumIterations\n petsc.DMPlexMetricSetVerbosity\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:2461"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_209metricSetVerbosity(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_verbosity = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("metricSetVerbosity (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_verbosity,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_verbosity)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 2461, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "metricSetVerbosity") < 0)) __PYX_ERR(57, 2461, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_verbosity = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("metricSetVerbosity", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 2461, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.metricSetVerbosity", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_208metricSetVerbosity(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_verbosity); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_208metricSetVerbosity(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_verbosity) { PetscInt __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("metricSetVerbosity", 1); /* "petsc4py/PETSc/DMPlex.pyx":2475 * * """ * cdef PetscInt ival = asInt(verbosity) # <<<<<<<<<<<<<< * CHKERR( DMPlexMetricSetVerbosity(self.dm, ival) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_verbosity); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(57, 2475, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":2476 * """ * cdef PetscInt ival = asInt(verbosity) * CHKERR( DMPlexMetricSetVerbosity(self.dm, ival) ) # <<<<<<<<<<<<<< * * def metricGetVerbosity(self) -> int: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexMetricSetVerbosity(__pyx_v_self->__pyx_base.dm, __pyx_v_ival)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 2476, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":2461 * return toBool(noSurf) * * def metricSetVerbosity(self, verbosity: int) -> None: # <<<<<<<<<<<<<< * """Set the verbosity of the mesh adaptation package. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.metricSetVerbosity", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":2478 * CHKERR( DMPlexMetricSetVerbosity(self.dm, ival) ) * * def metricGetVerbosity(self) -> int: # <<<<<<<<<<<<<< * """Return the verbosity of the mesh adaptation package. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_211metricGetVerbosity(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_210metricGetVerbosity, "DMPlex.metricGetVerbosity(self) -> int\nReturn the verbosity of the mesh adaptation package.\n\n Returns\n -------\n verbosity : int\n The verbosity, where -1 is silent and 10 is maximum.\n\n See Also\n --------\n DMPlex.metricSetVerbosity, DMPlex.metricGetNumIterations\n petsc.DMPlexMetricGetVerbosity\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:2478"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_211metricGetVerbosity(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("metricGetVerbosity (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("metricGetVerbosity", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "metricGetVerbosity", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_210metricGetVerbosity(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_210metricGetVerbosity(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self) { PetscInt __pyx_v_verbosity; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("metricGetVerbosity", 1); /* "petsc4py/PETSc/DMPlex.pyx":2492 * * """ * cdef PetscInt verbosity = 0 # <<<<<<<<<<<<<< * CHKERR( DMPlexMetricGetVerbosity(self.dm, &verbosity) ) * return toInt(verbosity) */ __pyx_v_verbosity = 0; /* "petsc4py/PETSc/DMPlex.pyx":2493 * """ * cdef PetscInt verbosity = 0 * CHKERR( DMPlexMetricGetVerbosity(self.dm, &verbosity) ) # <<<<<<<<<<<<<< * return toInt(verbosity) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexMetricGetVerbosity(__pyx_v_self->__pyx_base.dm, (&__pyx_v_verbosity))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 2493, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":2494 * cdef PetscInt verbosity = 0 * CHKERR( DMPlexMetricGetVerbosity(self.dm, &verbosity) ) * return toInt(verbosity) # <<<<<<<<<<<<<< * * def metricSetNumIterations(self, numIter: int) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_verbosity); if (unlikely(!__pyx_t_2)) __PYX_ERR(57, 2494, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":2478 * CHKERR( DMPlexMetricSetVerbosity(self.dm, ival) ) * * def metricGetVerbosity(self) -> int: # <<<<<<<<<<<<<< * """Return the verbosity of the mesh adaptation package. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.metricGetVerbosity", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":2496 * return toInt(verbosity) * * def metricSetNumIterations(self, numIter: int) -> None: # <<<<<<<<<<<<<< * """Set the number of parallel adaptation iterations. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_213metricSetNumIterations(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_212metricSetNumIterations, "DMPlex.metricSetNumIterations(self, numIter: int) -> None\nSet the number of parallel adaptation iterations.\n\n Parameters\n ----------\n numIter\n The number of parallel adaptation iterations.\n\n See Also\n --------\n DMPlex.metricSetVerbosity, DMPlex.metricGetNumIterations\n petsc.DMPlexMetricSetNumIterations\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:2496"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_213metricSetNumIterations(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_numIter = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("metricSetNumIterations (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_numIter,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_numIter)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 2496, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "metricSetNumIterations") < 0)) __PYX_ERR(57, 2496, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_numIter = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("metricSetNumIterations", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 2496, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.metricSetNumIterations", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_212metricSetNumIterations(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_numIter); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_212metricSetNumIterations(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_numIter) { PetscInt __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("metricSetNumIterations", 1); /* "petsc4py/PETSc/DMPlex.pyx":2510 * * """ * cdef PetscInt ival = asInt(numIter) # <<<<<<<<<<<<<< * CHKERR( DMPlexMetricSetNumIterations(self.dm, ival) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_numIter); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(57, 2510, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":2511 * """ * cdef PetscInt ival = asInt(numIter) * CHKERR( DMPlexMetricSetNumIterations(self.dm, ival) ) # <<<<<<<<<<<<<< * * def metricGetNumIterations(self) -> int: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexMetricSetNumIterations(__pyx_v_self->__pyx_base.dm, __pyx_v_ival)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 2511, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":2496 * return toInt(verbosity) * * def metricSetNumIterations(self, numIter: int) -> None: # <<<<<<<<<<<<<< * """Set the number of parallel adaptation iterations. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.metricSetNumIterations", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":2513 * CHKERR( DMPlexMetricSetNumIterations(self.dm, ival) ) * * def metricGetNumIterations(self) -> int: # <<<<<<<<<<<<<< * """Return the number of parallel adaptation iterations. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_215metricGetNumIterations(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_214metricGetNumIterations, "DMPlex.metricGetNumIterations(self) -> int\nReturn the number of parallel adaptation iterations.\n\n See Also\n --------\n DMPlex.metricSetNumIterations, DMPlex.metricGetVerbosity\n petsc.DMPlexMetricGetNumIterations\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:2513"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_215metricGetNumIterations(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("metricGetNumIterations (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("metricGetNumIterations", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "metricGetNumIterations", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_214metricGetNumIterations(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_214metricGetNumIterations(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self) { PetscInt __pyx_v_numIter; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("metricGetNumIterations", 1); /* "petsc4py/PETSc/DMPlex.pyx":2522 * * """ * cdef PetscInt numIter = 0 # <<<<<<<<<<<<<< * CHKERR( DMPlexMetricGetNumIterations(self.dm, &numIter) ) * return toInt(numIter) */ __pyx_v_numIter = 0; /* "petsc4py/PETSc/DMPlex.pyx":2523 * """ * cdef PetscInt numIter = 0 * CHKERR( DMPlexMetricGetNumIterations(self.dm, &numIter) ) # <<<<<<<<<<<<<< * return toInt(numIter) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexMetricGetNumIterations(__pyx_v_self->__pyx_base.dm, (&__pyx_v_numIter))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 2523, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":2524 * cdef PetscInt numIter = 0 * CHKERR( DMPlexMetricGetNumIterations(self.dm, &numIter) ) * return toInt(numIter) # <<<<<<<<<<<<<< * * def metricSetMinimumMagnitude(self, h_min: float) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_numIter); if (unlikely(!__pyx_t_2)) __PYX_ERR(57, 2524, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":2513 * CHKERR( DMPlexMetricSetNumIterations(self.dm, ival) ) * * def metricGetNumIterations(self) -> int: # <<<<<<<<<<<<<< * """Return the number of parallel adaptation iterations. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.metricGetNumIterations", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":2526 * return toInt(numIter) * * def metricSetMinimumMagnitude(self, h_min: float) -> None: # <<<<<<<<<<<<<< * """Set the minimum tolerated metric magnitude. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_217metricSetMinimumMagnitude(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_216metricSetMinimumMagnitude, "DMPlex.metricSetMinimumMagnitude(self, h_min: float) -> None\nSet the minimum tolerated metric magnitude.\n\n Parameters\n ----------\n h_min\n The minimum tolerated metric magnitude.\n\n See Also\n --------\n DMPlex.metricGetMinimumMagnitude, DMPlex.metricSetMaximumMagnitude\n petsc.DMPlexMetricSetMinimumMagnitude\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:2526"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_217metricSetMinimumMagnitude(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_h_min = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("metricSetMinimumMagnitude (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_h_min,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_h_min)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 2526, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "metricSetMinimumMagnitude") < 0)) __PYX_ERR(57, 2526, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_h_min = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("metricSetMinimumMagnitude", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 2526, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.metricSetMinimumMagnitude", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_216metricSetMinimumMagnitude(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_h_min); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_216metricSetMinimumMagnitude(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_h_min) { PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("metricSetMinimumMagnitude", 1); /* "petsc4py/PETSc/DMPlex.pyx":2540 * * """ * cdef PetscReal rval = asReal(h_min) # <<<<<<<<<<<<<< * CHKERR( DMPlexMetricSetMinimumMagnitude(self.dm, rval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_h_min); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(57, 2540, __pyx_L1_error) __pyx_v_rval = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":2541 * """ * cdef PetscReal rval = asReal(h_min) * CHKERR( DMPlexMetricSetMinimumMagnitude(self.dm, rval) ) # <<<<<<<<<<<<<< * * def metricGetMinimumMagnitude(self) -> float: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexMetricSetMinimumMagnitude(__pyx_v_self->__pyx_base.dm, __pyx_v_rval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 2541, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":2526 * return toInt(numIter) * * def metricSetMinimumMagnitude(self, h_min: float) -> None: # <<<<<<<<<<<<<< * """Set the minimum tolerated metric magnitude. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.metricSetMinimumMagnitude", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":2543 * CHKERR( DMPlexMetricSetMinimumMagnitude(self.dm, rval) ) * * def metricGetMinimumMagnitude(self) -> float: # <<<<<<<<<<<<<< * """Return the minimum tolerated metric magnitude. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_219metricGetMinimumMagnitude(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_218metricGetMinimumMagnitude, "DMPlex.metricGetMinimumMagnitude(self) -> float\nReturn the minimum tolerated metric magnitude.\n\n See Also\n --------\n DMPlex.metricSetMinimumMagnitude, DMPlex.metricGetMaximumMagnitude\n petsc.DMPlexMetricGetMinimumMagnitude\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:2543"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_219metricGetMinimumMagnitude(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("metricGetMinimumMagnitude (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("metricGetMinimumMagnitude", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "metricGetMinimumMagnitude", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_218metricGetMinimumMagnitude(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_218metricGetMinimumMagnitude(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self) { PetscReal __pyx_v_h_min; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("metricGetMinimumMagnitude", 1); /* "petsc4py/PETSc/DMPlex.pyx":2552 * * """ * cdef PetscReal h_min = 0 # <<<<<<<<<<<<<< * CHKERR( DMPlexMetricGetMinimumMagnitude(self.dm, &h_min) ) * return toReal(h_min) */ __pyx_v_h_min = 0.0; /* "petsc4py/PETSc/DMPlex.pyx":2553 * """ * cdef PetscReal h_min = 0 * CHKERR( DMPlexMetricGetMinimumMagnitude(self.dm, &h_min) ) # <<<<<<<<<<<<<< * return toReal(h_min) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexMetricGetMinimumMagnitude(__pyx_v_self->__pyx_base.dm, (&__pyx_v_h_min))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 2553, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":2554 * cdef PetscReal h_min = 0 * CHKERR( DMPlexMetricGetMinimumMagnitude(self.dm, &h_min) ) * return toReal(h_min) # <<<<<<<<<<<<<< * * def metricSetMaximumMagnitude(self, h_max: float) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_h_min); if (unlikely(!__pyx_t_2)) __PYX_ERR(57, 2554, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":2543 * CHKERR( DMPlexMetricSetMinimumMagnitude(self.dm, rval) ) * * def metricGetMinimumMagnitude(self) -> float: # <<<<<<<<<<<<<< * """Return the minimum tolerated metric magnitude. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.metricGetMinimumMagnitude", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":2556 * return toReal(h_min) * * def metricSetMaximumMagnitude(self, h_max: float) -> None: # <<<<<<<<<<<<<< * """Set the maximum tolerated metric magnitude. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_221metricSetMaximumMagnitude(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_220metricSetMaximumMagnitude, "DMPlex.metricSetMaximumMagnitude(self, h_max: float) -> None\nSet the maximum tolerated metric magnitude.\n\n Parameters\n ----------\n h_max\n The maximum tolerated metric magnitude.\n\n See Also\n --------\n DMPlex.metricGetMaximumMagnitude, DMPlex.metricSetMinimumMagnitude\n petsc.DMPlexMetricSetMaximumMagnitude\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:2556"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_221metricSetMaximumMagnitude(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_h_max = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("metricSetMaximumMagnitude (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_h_max,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_h_max)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 2556, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "metricSetMaximumMagnitude") < 0)) __PYX_ERR(57, 2556, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_h_max = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("metricSetMaximumMagnitude", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 2556, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.metricSetMaximumMagnitude", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_220metricSetMaximumMagnitude(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_h_max); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_220metricSetMaximumMagnitude(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_h_max) { PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("metricSetMaximumMagnitude", 1); /* "petsc4py/PETSc/DMPlex.pyx":2570 * * """ * cdef PetscReal rval = asReal(h_max) # <<<<<<<<<<<<<< * CHKERR( DMPlexMetricSetMaximumMagnitude(self.dm, rval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_h_max); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(57, 2570, __pyx_L1_error) __pyx_v_rval = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":2571 * """ * cdef PetscReal rval = asReal(h_max) * CHKERR( DMPlexMetricSetMaximumMagnitude(self.dm, rval) ) # <<<<<<<<<<<<<< * * def metricGetMaximumMagnitude(self) -> float: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexMetricSetMaximumMagnitude(__pyx_v_self->__pyx_base.dm, __pyx_v_rval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 2571, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":2556 * return toReal(h_min) * * def metricSetMaximumMagnitude(self, h_max: float) -> None: # <<<<<<<<<<<<<< * """Set the maximum tolerated metric magnitude. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.metricSetMaximumMagnitude", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":2573 * CHKERR( DMPlexMetricSetMaximumMagnitude(self.dm, rval) ) * * def metricGetMaximumMagnitude(self) -> float: # <<<<<<<<<<<<<< * """Return the maximum tolerated metric magnitude. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_223metricGetMaximumMagnitude(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_222metricGetMaximumMagnitude, "DMPlex.metricGetMaximumMagnitude(self) -> float\nReturn the maximum tolerated metric magnitude.\n\n See Also\n --------\n DMPlex.metricSetMaximumMagnitude, DMPlex.metricGetMinimumMagnitude\n petsc.DMPlexMetricGetMaximumMagnitude\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:2573"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_223metricGetMaximumMagnitude(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("metricGetMaximumMagnitude (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("metricGetMaximumMagnitude", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "metricGetMaximumMagnitude", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_222metricGetMaximumMagnitude(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_222metricGetMaximumMagnitude(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self) { PetscReal __pyx_v_h_max; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("metricGetMaximumMagnitude", 1); /* "petsc4py/PETSc/DMPlex.pyx":2582 * * """ * cdef PetscReal h_max = 0 # <<<<<<<<<<<<<< * CHKERR( DMPlexMetricGetMaximumMagnitude(self.dm, &h_max) ) * return toReal(h_max) */ __pyx_v_h_max = 0.0; /* "petsc4py/PETSc/DMPlex.pyx":2583 * """ * cdef PetscReal h_max = 0 * CHKERR( DMPlexMetricGetMaximumMagnitude(self.dm, &h_max) ) # <<<<<<<<<<<<<< * return toReal(h_max) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexMetricGetMaximumMagnitude(__pyx_v_self->__pyx_base.dm, (&__pyx_v_h_max))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 2583, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":2584 * cdef PetscReal h_max = 0 * CHKERR( DMPlexMetricGetMaximumMagnitude(self.dm, &h_max) ) * return toReal(h_max) # <<<<<<<<<<<<<< * * def metricSetMaximumAnisotropy(self, a_max: float) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_h_max); if (unlikely(!__pyx_t_2)) __PYX_ERR(57, 2584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":2573 * CHKERR( DMPlexMetricSetMaximumMagnitude(self.dm, rval) ) * * def metricGetMaximumMagnitude(self) -> float: # <<<<<<<<<<<<<< * """Return the maximum tolerated metric magnitude. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.metricGetMaximumMagnitude", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":2586 * return toReal(h_max) * * def metricSetMaximumAnisotropy(self, a_max: float) -> None: # <<<<<<<<<<<<<< * """Set the maximum tolerated metric anisotropy. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_225metricSetMaximumAnisotropy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_224metricSetMaximumAnisotropy, "DMPlex.metricSetMaximumAnisotropy(self, a_max: float) -> None\nSet the maximum tolerated metric anisotropy.\n\n Parameters\n ----------\n a_max\n The maximum tolerated metric anisotropy.\n\n See Also\n --------\n DMPlex.metricGetMaximumAnisotropy, DMPlex.metricSetMaximumMagnitude\n petsc.DMPlexMetricSetMaximumAnisotropy\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:2586"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_225metricSetMaximumAnisotropy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_a_max = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("metricSetMaximumAnisotropy (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a_max,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a_max)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 2586, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "metricSetMaximumAnisotropy") < 0)) __PYX_ERR(57, 2586, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_a_max = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("metricSetMaximumAnisotropy", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 2586, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.metricSetMaximumAnisotropy", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_224metricSetMaximumAnisotropy(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_a_max); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_224metricSetMaximumAnisotropy(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_a_max) { PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("metricSetMaximumAnisotropy", 1); /* "petsc4py/PETSc/DMPlex.pyx":2600 * * """ * cdef PetscReal rval = asReal(a_max) # <<<<<<<<<<<<<< * CHKERR( DMPlexMetricSetMaximumAnisotropy(self.dm, rval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_a_max); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(57, 2600, __pyx_L1_error) __pyx_v_rval = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":2601 * """ * cdef PetscReal rval = asReal(a_max) * CHKERR( DMPlexMetricSetMaximumAnisotropy(self.dm, rval) ) # <<<<<<<<<<<<<< * * def metricGetMaximumAnisotropy(self) -> float: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexMetricSetMaximumAnisotropy(__pyx_v_self->__pyx_base.dm, __pyx_v_rval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 2601, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":2586 * return toReal(h_max) * * def metricSetMaximumAnisotropy(self, a_max: float) -> None: # <<<<<<<<<<<<<< * """Set the maximum tolerated metric anisotropy. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.metricSetMaximumAnisotropy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":2603 * CHKERR( DMPlexMetricSetMaximumAnisotropy(self.dm, rval) ) * * def metricGetMaximumAnisotropy(self) -> float: # <<<<<<<<<<<<<< * """Return the maximum tolerated metric anisotropy. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_227metricGetMaximumAnisotropy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_226metricGetMaximumAnisotropy, "DMPlex.metricGetMaximumAnisotropy(self) -> float\nReturn the maximum tolerated metric anisotropy.\n\n See Also\n --------\n DMPlex.metricSetMaximumAnisotropy, DMPlex.metricGetMaximumMagnitude\n petsc.DMPlexMetricGetMaximumAnisotropy\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:2603"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_227metricGetMaximumAnisotropy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("metricGetMaximumAnisotropy (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("metricGetMaximumAnisotropy", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "metricGetMaximumAnisotropy", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_226metricGetMaximumAnisotropy(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_226metricGetMaximumAnisotropy(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self) { PetscReal __pyx_v_a_max; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("metricGetMaximumAnisotropy", 1); /* "petsc4py/PETSc/DMPlex.pyx":2612 * * """ * cdef PetscReal a_max = 0 # <<<<<<<<<<<<<< * CHKERR( DMPlexMetricGetMaximumAnisotropy(self.dm, &a_max) ) * return toReal(a_max) */ __pyx_v_a_max = 0.0; /* "petsc4py/PETSc/DMPlex.pyx":2613 * """ * cdef PetscReal a_max = 0 * CHKERR( DMPlexMetricGetMaximumAnisotropy(self.dm, &a_max) ) # <<<<<<<<<<<<<< * return toReal(a_max) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexMetricGetMaximumAnisotropy(__pyx_v_self->__pyx_base.dm, (&__pyx_v_a_max))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 2613, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":2614 * cdef PetscReal a_max = 0 * CHKERR( DMPlexMetricGetMaximumAnisotropy(self.dm, &a_max) ) * return toReal(a_max) # <<<<<<<<<<<<<< * * def metricSetTargetComplexity(self, targetComplexity: float) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_a_max); if (unlikely(!__pyx_t_2)) __PYX_ERR(57, 2614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":2603 * CHKERR( DMPlexMetricSetMaximumAnisotropy(self.dm, rval) ) * * def metricGetMaximumAnisotropy(self) -> float: # <<<<<<<<<<<<<< * """Return the maximum tolerated metric anisotropy. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.metricGetMaximumAnisotropy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":2616 * return toReal(a_max) * * def metricSetTargetComplexity(self, targetComplexity: float) -> None: # <<<<<<<<<<<<<< * """Set the target metric complexity. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_229metricSetTargetComplexity(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_228metricSetTargetComplexity, "DMPlex.metricSetTargetComplexity(self, targetComplexity: float) -> None\nSet the target metric complexity.\n\n Parameters\n ----------\n targetComplexity\n The target metric complexity.\n\n See Also\n --------\n DMPlex.metricGetTargetComplexity, DMPlex.metricSetNormalizationOrder\n petsc.DMPlexMetricSetTargetComplexity\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:2616"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_229metricSetTargetComplexity(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_targetComplexity = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("metricSetTargetComplexity (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_targetComplexity,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_targetComplexity)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 2616, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "metricSetTargetComplexity") < 0)) __PYX_ERR(57, 2616, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_targetComplexity = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("metricSetTargetComplexity", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 2616, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.metricSetTargetComplexity", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_228metricSetTargetComplexity(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_targetComplexity); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_228metricSetTargetComplexity(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_targetComplexity) { PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("metricSetTargetComplexity", 1); /* "petsc4py/PETSc/DMPlex.pyx":2630 * * """ * cdef PetscReal rval = asReal(targetComplexity) # <<<<<<<<<<<<<< * CHKERR( DMPlexMetricSetTargetComplexity(self.dm, rval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_targetComplexity); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(57, 2630, __pyx_L1_error) __pyx_v_rval = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":2631 * """ * cdef PetscReal rval = asReal(targetComplexity) * CHKERR( DMPlexMetricSetTargetComplexity(self.dm, rval) ) # <<<<<<<<<<<<<< * * def metricGetTargetComplexity(self) -> float: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexMetricSetTargetComplexity(__pyx_v_self->__pyx_base.dm, __pyx_v_rval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 2631, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":2616 * return toReal(a_max) * * def metricSetTargetComplexity(self, targetComplexity: float) -> None: # <<<<<<<<<<<<<< * """Set the target metric complexity. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.metricSetTargetComplexity", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":2633 * CHKERR( DMPlexMetricSetTargetComplexity(self.dm, rval) ) * * def metricGetTargetComplexity(self) -> float: # <<<<<<<<<<<<<< * """Return the target metric complexity. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_231metricGetTargetComplexity(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_230metricGetTargetComplexity, "DMPlex.metricGetTargetComplexity(self) -> float\nReturn the target metric complexity.\n\n See Also\n --------\n DMPlex.metricSetTargetComplexity, DMPlex.metricGetNormalizationOrder\n petsc.DMPlexMetricGetTargetComplexity\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:2633"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_231metricGetTargetComplexity(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("metricGetTargetComplexity (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("metricGetTargetComplexity", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "metricGetTargetComplexity", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_230metricGetTargetComplexity(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_230metricGetTargetComplexity(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self) { PetscReal __pyx_v_targetComplexity; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("metricGetTargetComplexity", 1); /* "petsc4py/PETSc/DMPlex.pyx":2642 * * """ * cdef PetscReal targetComplexity = 0 # <<<<<<<<<<<<<< * CHKERR( DMPlexMetricGetTargetComplexity(self.dm, &targetComplexity) ) * return toReal(targetComplexity) */ __pyx_v_targetComplexity = 0.0; /* "petsc4py/PETSc/DMPlex.pyx":2643 * """ * cdef PetscReal targetComplexity = 0 * CHKERR( DMPlexMetricGetTargetComplexity(self.dm, &targetComplexity) ) # <<<<<<<<<<<<<< * return toReal(targetComplexity) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexMetricGetTargetComplexity(__pyx_v_self->__pyx_base.dm, (&__pyx_v_targetComplexity))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 2643, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":2644 * cdef PetscReal targetComplexity = 0 * CHKERR( DMPlexMetricGetTargetComplexity(self.dm, &targetComplexity) ) * return toReal(targetComplexity) # <<<<<<<<<<<<<< * * def metricSetNormalizationOrder(self, p: float) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_targetComplexity); if (unlikely(!__pyx_t_2)) __PYX_ERR(57, 2644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":2633 * CHKERR( DMPlexMetricSetTargetComplexity(self.dm, rval) ) * * def metricGetTargetComplexity(self) -> float: # <<<<<<<<<<<<<< * """Return the target metric complexity. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.metricGetTargetComplexity", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":2646 * return toReal(targetComplexity) * * def metricSetNormalizationOrder(self, p: float) -> None: # <<<<<<<<<<<<<< * """Set the order p for L-p normalization. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_233metricSetNormalizationOrder(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_232metricSetNormalizationOrder, "DMPlex.metricSetNormalizationOrder(self, p: float) -> None\nSet the order p for L-p normalization.\n\n Parameters\n ----------\n p\n The normalization order.\n\n See Also\n --------\n DMPlex.metricGetNormalizationOrder, DMPlex.metricSetTargetComplexity\n petsc.DMPlexMetricSetNormalizationOrder\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:2646"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_233metricSetNormalizationOrder(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_p = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("metricSetNormalizationOrder (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_p,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 2646, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "metricSetNormalizationOrder") < 0)) __PYX_ERR(57, 2646, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_p = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("metricSetNormalizationOrder", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 2646, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.metricSetNormalizationOrder", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_232metricSetNormalizationOrder(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_p); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_232metricSetNormalizationOrder(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p) { PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("metricSetNormalizationOrder", 1); /* "petsc4py/PETSc/DMPlex.pyx":2660 * * """ * cdef PetscReal rval = asReal(p) # <<<<<<<<<<<<<< * CHKERR( DMPlexMetricSetNormalizationOrder(self.dm, rval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_p); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(57, 2660, __pyx_L1_error) __pyx_v_rval = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":2661 * """ * cdef PetscReal rval = asReal(p) * CHKERR( DMPlexMetricSetNormalizationOrder(self.dm, rval) ) # <<<<<<<<<<<<<< * * def metricGetNormalizationOrder(self) -> float: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexMetricSetNormalizationOrder(__pyx_v_self->__pyx_base.dm, __pyx_v_rval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 2661, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":2646 * return toReal(targetComplexity) * * def metricSetNormalizationOrder(self, p: float) -> None: # <<<<<<<<<<<<<< * """Set the order p for L-p normalization. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.metricSetNormalizationOrder", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":2663 * CHKERR( DMPlexMetricSetNormalizationOrder(self.dm, rval) ) * * def metricGetNormalizationOrder(self) -> float: # <<<<<<<<<<<<<< * """Return the order p for L-p normalization. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_235metricGetNormalizationOrder(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_234metricGetNormalizationOrder, "DMPlex.metricGetNormalizationOrder(self) -> float\nReturn the order p for L-p normalization.\n\n See Also\n --------\n DMPlex.metricSetNormalizationOrder, DMPlex.metricGetTargetComplexity\n petsc.DMPlexMetricGetNormalizationOrder\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:2663"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_235metricGetNormalizationOrder(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("metricGetNormalizationOrder (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("metricGetNormalizationOrder", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "metricGetNormalizationOrder", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_234metricGetNormalizationOrder(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_234metricGetNormalizationOrder(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self) { PetscReal __pyx_v_p; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("metricGetNormalizationOrder", 1); /* "petsc4py/PETSc/DMPlex.pyx":2672 * * """ * cdef PetscReal p = 0 # <<<<<<<<<<<<<< * CHKERR( DMPlexMetricGetNormalizationOrder(self.dm, &p) ) * return toReal(p) */ __pyx_v_p = 0.0; /* "petsc4py/PETSc/DMPlex.pyx":2673 * """ * cdef PetscReal p = 0 * CHKERR( DMPlexMetricGetNormalizationOrder(self.dm, &p) ) # <<<<<<<<<<<<<< * return toReal(p) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexMetricGetNormalizationOrder(__pyx_v_self->__pyx_base.dm, (&__pyx_v_p))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 2673, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":2674 * cdef PetscReal p = 0 * CHKERR( DMPlexMetricGetNormalizationOrder(self.dm, &p) ) * return toReal(p) # <<<<<<<<<<<<<< * * def metricSetGradationFactor(self, beta: float) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_p); if (unlikely(!__pyx_t_2)) __PYX_ERR(57, 2674, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":2663 * CHKERR( DMPlexMetricSetNormalizationOrder(self.dm, rval) ) * * def metricGetNormalizationOrder(self) -> float: # <<<<<<<<<<<<<< * """Return the order p for L-p normalization. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.metricGetNormalizationOrder", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":2676 * return toReal(p) * * def metricSetGradationFactor(self, beta: float) -> None: # <<<<<<<<<<<<<< * """Set the metric gradation factor. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_237metricSetGradationFactor(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_236metricSetGradationFactor, "DMPlex.metricSetGradationFactor(self, beta: float) -> None\nSet the metric gradation factor.\n\n Parameters\n ----------\n beta\n The metric gradation factor.\n\n See Also\n --------\n DMPlex.metricGetGradationFactor, DMPlex.metricSetHausdorffNumber\n petsc.DMPlexMetricSetGradationFactor\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:2676"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_237metricSetGradationFactor(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_beta = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("metricSetGradationFactor (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_beta,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_beta)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 2676, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "metricSetGradationFactor") < 0)) __PYX_ERR(57, 2676, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_beta = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("metricSetGradationFactor", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 2676, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.metricSetGradationFactor", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_236metricSetGradationFactor(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_beta); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_236metricSetGradationFactor(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_beta) { PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("metricSetGradationFactor", 1); /* "petsc4py/PETSc/DMPlex.pyx":2690 * * """ * cdef PetscReal rval = asReal(beta) # <<<<<<<<<<<<<< * CHKERR( DMPlexMetricSetGradationFactor(self.dm, rval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_beta); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(57, 2690, __pyx_L1_error) __pyx_v_rval = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":2691 * """ * cdef PetscReal rval = asReal(beta) * CHKERR( DMPlexMetricSetGradationFactor(self.dm, rval) ) # <<<<<<<<<<<<<< * * def metricGetGradationFactor(self) -> float: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexMetricSetGradationFactor(__pyx_v_self->__pyx_base.dm, __pyx_v_rval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 2691, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":2676 * return toReal(p) * * def metricSetGradationFactor(self, beta: float) -> None: # <<<<<<<<<<<<<< * """Set the metric gradation factor. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.metricSetGradationFactor", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":2693 * CHKERR( DMPlexMetricSetGradationFactor(self.dm, rval) ) * * def metricGetGradationFactor(self) -> float: # <<<<<<<<<<<<<< * """Return the metric gradation factor. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_239metricGetGradationFactor(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_238metricGetGradationFactor, "DMPlex.metricGetGradationFactor(self) -> float\nReturn the metric gradation factor.\n\n See Also\n --------\n DMPlex.metricSetGradationFactor, DMPlex.metricGetHausdorffNumber\n petsc.DMPlexMetricGetGradationFactor\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:2693"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_239metricGetGradationFactor(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("metricGetGradationFactor (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("metricGetGradationFactor", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "metricGetGradationFactor", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_238metricGetGradationFactor(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_238metricGetGradationFactor(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self) { PetscReal __pyx_v_beta; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("metricGetGradationFactor", 1); /* "petsc4py/PETSc/DMPlex.pyx":2702 * * """ * cdef PetscReal beta = 0 # <<<<<<<<<<<<<< * CHKERR( DMPlexMetricGetGradationFactor(self.dm, &beta) ) * return toReal(beta) */ __pyx_v_beta = 0.0; /* "petsc4py/PETSc/DMPlex.pyx":2703 * """ * cdef PetscReal beta = 0 * CHKERR( DMPlexMetricGetGradationFactor(self.dm, &beta) ) # <<<<<<<<<<<<<< * return toReal(beta) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexMetricGetGradationFactor(__pyx_v_self->__pyx_base.dm, (&__pyx_v_beta))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 2703, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":2704 * cdef PetscReal beta = 0 * CHKERR( DMPlexMetricGetGradationFactor(self.dm, &beta) ) * return toReal(beta) # <<<<<<<<<<<<<< * * def metricSetHausdorffNumber(self, hausd: float) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_beta); if (unlikely(!__pyx_t_2)) __PYX_ERR(57, 2704, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":2693 * CHKERR( DMPlexMetricSetGradationFactor(self.dm, rval) ) * * def metricGetGradationFactor(self) -> float: # <<<<<<<<<<<<<< * """Return the metric gradation factor. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.metricGetGradationFactor", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":2706 * return toReal(beta) * * def metricSetHausdorffNumber(self, hausd: float) -> None: # <<<<<<<<<<<<<< * """Set the metric Hausdorff number. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_241metricSetHausdorffNumber(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_240metricSetHausdorffNumber, "DMPlex.metricSetHausdorffNumber(self, hausd: float) -> None\nSet the metric Hausdorff number.\n\n Parameters\n ----------\n hausd\n The metric Hausdorff number.\n\n See Also\n --------\n DMPlex.metricSetGradationFactor, DMPlex.metricGetHausdorffNumber\n petsc.DMPlexMetricSetHausdorffNumber\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:2706"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_241metricSetHausdorffNumber(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_hausd = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("metricSetHausdorffNumber (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_hausd,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_hausd)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 2706, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "metricSetHausdorffNumber") < 0)) __PYX_ERR(57, 2706, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_hausd = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("metricSetHausdorffNumber", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 2706, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.metricSetHausdorffNumber", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_240metricSetHausdorffNumber(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_hausd); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_240metricSetHausdorffNumber(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_hausd) { PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("metricSetHausdorffNumber", 1); /* "petsc4py/PETSc/DMPlex.pyx":2720 * * """ * cdef PetscReal rval = asReal(hausd) # <<<<<<<<<<<<<< * CHKERR( DMPlexMetricSetHausdorffNumber(self.dm, rval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_hausd); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(57, 2720, __pyx_L1_error) __pyx_v_rval = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":2721 * """ * cdef PetscReal rval = asReal(hausd) * CHKERR( DMPlexMetricSetHausdorffNumber(self.dm, rval) ) # <<<<<<<<<<<<<< * * def metricGetHausdorffNumber(self) -> float: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexMetricSetHausdorffNumber(__pyx_v_self->__pyx_base.dm, __pyx_v_rval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 2721, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":2706 * return toReal(beta) * * def metricSetHausdorffNumber(self, hausd: float) -> None: # <<<<<<<<<<<<<< * """Set the metric Hausdorff number. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.metricSetHausdorffNumber", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":2723 * CHKERR( DMPlexMetricSetHausdorffNumber(self.dm, rval) ) * * def metricGetHausdorffNumber(self) -> float: # <<<<<<<<<<<<<< * """Return the metric Hausdorff number. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_243metricGetHausdorffNumber(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_242metricGetHausdorffNumber, "DMPlex.metricGetHausdorffNumber(self) -> float\nReturn the metric Hausdorff number.\n\n See Also\n --------\n DMPlex.metricGetGradationFactor, DMPlex.metricSetHausdorffNumber\n petsc.DMPlexMetricGetHausdorffNumber\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:2723"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_243metricGetHausdorffNumber(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("metricGetHausdorffNumber (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("metricGetHausdorffNumber", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "metricGetHausdorffNumber", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_242metricGetHausdorffNumber(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_242metricGetHausdorffNumber(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self) { PetscReal __pyx_v_hausd; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("metricGetHausdorffNumber", 1); /* "petsc4py/PETSc/DMPlex.pyx":2732 * * """ * cdef PetscReal hausd = 0 # <<<<<<<<<<<<<< * CHKERR( DMPlexMetricGetHausdorffNumber(self.dm, &hausd) ) * return toReal(hausd) */ __pyx_v_hausd = 0.0; /* "petsc4py/PETSc/DMPlex.pyx":2733 * """ * cdef PetscReal hausd = 0 * CHKERR( DMPlexMetricGetHausdorffNumber(self.dm, &hausd) ) # <<<<<<<<<<<<<< * return toReal(hausd) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexMetricGetHausdorffNumber(__pyx_v_self->__pyx_base.dm, (&__pyx_v_hausd))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 2733, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":2734 * cdef PetscReal hausd = 0 * CHKERR( DMPlexMetricGetHausdorffNumber(self.dm, &hausd) ) * return toReal(hausd) # <<<<<<<<<<<<<< * * def metricCreate(self, field: int | None = 0) -> Vec: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_hausd); if (unlikely(!__pyx_t_2)) __PYX_ERR(57, 2734, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":2723 * CHKERR( DMPlexMetricSetHausdorffNumber(self.dm, rval) ) * * def metricGetHausdorffNumber(self) -> float: # <<<<<<<<<<<<<< * """Return the metric Hausdorff number. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.metricGetHausdorffNumber", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":2736 * return toReal(hausd) * * def metricCreate(self, field: int | None = 0) -> Vec: # <<<<<<<<<<<<<< * """Create a Riemannian metric field. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_245metricCreate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_244metricCreate, "DMPlex.metricCreate(self, field: int | None = 0) -> Vec\nCreate a Riemannian metric field.\n\n Parameters\n ----------\n field\n The field number to use.\n\n See Also\n --------\n DMPlex.metricCreateUniform, DMPlex.metricCreateIsotropic\n petsc_options, petsc.DMPlexMetricCreate\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:2736"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_245metricCreate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_field = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("metricCreate (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_field,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_0)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_field); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 2736, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "metricCreate") < 0)) __PYX_ERR(57, 2736, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_field = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("metricCreate", 0, 0, 1, __pyx_nargs); __PYX_ERR(57, 2736, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.metricCreate", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_244metricCreate(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_field); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_244metricCreate(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_field) { PetscInt __pyx_v_ival; struct PyPetscVecObject *__pyx_v_metric = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("metricCreate", 1); /* "petsc4py/PETSc/DMPlex.pyx":2750 * * """ * cdef PetscInt ival = asInt(field) # <<<<<<<<<<<<<< * cdef Vec metric = Vec() * CHKERR( DMPlexMetricCreate(self.dm, ival, &metric.vec) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_field); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(57, 2750, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":2751 * """ * cdef PetscInt ival = asInt(field) * cdef Vec metric = Vec() # <<<<<<<<<<<<<< * CHKERR( DMPlexMetricCreate(self.dm, ival, &metric.vec) ) * return metric */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_2)) __PYX_ERR(57, 2751, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_metric = ((struct PyPetscVecObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DMPlex.pyx":2752 * cdef PetscInt ival = asInt(field) * cdef Vec metric = Vec() * CHKERR( DMPlexMetricCreate(self.dm, ival, &metric.vec) ) # <<<<<<<<<<<<<< * return metric * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexMetricCreate(__pyx_v_self->__pyx_base.dm, __pyx_v_ival, (&__pyx_v_metric->vec))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 2752, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":2753 * cdef Vec metric = Vec() * CHKERR( DMPlexMetricCreate(self.dm, ival, &metric.vec) ) * return metric # <<<<<<<<<<<<<< * * def metricCreateUniform(self, alpha: float, field: int | None = 0) -> Vec: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_metric); __pyx_r = ((PyObject *)__pyx_v_metric); goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":2736 * return toReal(hausd) * * def metricCreate(self, field: int | None = 0) -> Vec: # <<<<<<<<<<<<<< * """Create a Riemannian metric field. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.metricCreate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_metric); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":2755 * return metric * * def metricCreateUniform(self, alpha: float, field: int | None = 0) -> Vec: # <<<<<<<<<<<<<< * """Construct a uniform isotropic metric. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_247metricCreateUniform(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_246metricCreateUniform, "DMPlex.metricCreateUniform(self, alpha: float, field: int | None = 0) -> Vec\nConstruct a uniform isotropic metric.\n\n Parameters\n ----------\n alpha\n Scaling parameter for the diagonal.\n field\n The field number to use.\n\n See Also\n --------\n DMPlex.metricCreate, DMPlex.metricCreateIsotropic\n petsc.DMPlexMetricCreateUniform\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:2755"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_247metricCreateUniform(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_alpha = 0; PyObject *__pyx_v_field = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("metricCreateUniform (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_alpha,&__pyx_n_s_field,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_0)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_alpha)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 2755, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_field); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 2755, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "metricCreateUniform") < 0)) __PYX_ERR(57, 2755, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_alpha = values[0]; __pyx_v_field = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("metricCreateUniform", 0, 1, 2, __pyx_nargs); __PYX_ERR(57, 2755, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.metricCreateUniform", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_246metricCreateUniform(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_alpha, __pyx_v_field); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_246metricCreateUniform(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_alpha, PyObject *__pyx_v_field) { PetscInt __pyx_v_ival; PetscReal __pyx_v_rval; struct PyPetscVecObject *__pyx_v_metric = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscReal __pyx_t_2; PyObject *__pyx_t_3 = NULL; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("metricCreateUniform", 1); /* "petsc4py/PETSc/DMPlex.pyx":2771 * * """ * cdef PetscInt ival = asInt(field) # <<<<<<<<<<<<<< * cdef PetscReal rval = asReal(alpha) * cdef Vec metric = Vec() */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_field); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(57, 2771, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":2772 * """ * cdef PetscInt ival = asInt(field) * cdef PetscReal rval = asReal(alpha) # <<<<<<<<<<<<<< * cdef Vec metric = Vec() * CHKERR( DMPlexMetricCreateUniform(self.dm, ival, rval, &metric.vec) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_alpha); if (unlikely(__pyx_t_2 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(57, 2772, __pyx_L1_error) __pyx_v_rval = __pyx_t_2; /* "petsc4py/PETSc/DMPlex.pyx":2773 * cdef PetscInt ival = asInt(field) * cdef PetscReal rval = asReal(alpha) * cdef Vec metric = Vec() # <<<<<<<<<<<<<< * CHKERR( DMPlexMetricCreateUniform(self.dm, ival, rval, &metric.vec) ) * return metric */ __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_3)) __PYX_ERR(57, 2773, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_metric = ((struct PyPetscVecObject *)__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/DMPlex.pyx":2774 * cdef PetscReal rval = asReal(alpha) * cdef Vec metric = Vec() * CHKERR( DMPlexMetricCreateUniform(self.dm, ival, rval, &metric.vec) ) # <<<<<<<<<<<<<< * return metric * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexMetricCreateUniform(__pyx_v_self->__pyx_base.dm, __pyx_v_ival, __pyx_v_rval, (&__pyx_v_metric->vec))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 2774, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":2775 * cdef Vec metric = Vec() * CHKERR( DMPlexMetricCreateUniform(self.dm, ival, rval, &metric.vec) ) * return metric # <<<<<<<<<<<<<< * * def metricCreateIsotropic(self, Vec indicator, field: int | None = 0) -> Vec: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_metric); __pyx_r = ((PyObject *)__pyx_v_metric); goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":2755 * return metric * * def metricCreateUniform(self, alpha: float, field: int | None = 0) -> Vec: # <<<<<<<<<<<<<< * """Construct a uniform isotropic metric. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.metricCreateUniform", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_metric); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":2777 * return metric * * def metricCreateIsotropic(self, Vec indicator, field: int | None = 0) -> Vec: # <<<<<<<<<<<<<< * """Construct an isotropic metric from an error indicator. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_249metricCreateIsotropic(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_248metricCreateIsotropic, "DMPlex.metricCreateIsotropic(self, indicator: Vec, field: int | None = 0) -> Vec\nConstruct an isotropic metric from an error indicator.\n\n Parameters\n ----------\n indicator\n The error indicator.\n field\n The field number to use.\n\n See Also\n --------\n DMPlex.metricCreate, DMPlex.metricCreateUniform\n petsc.DMPlexMetricCreateIsotropic\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:2777"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_249metricCreateIsotropic(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_indicator = 0; PyObject *__pyx_v_field = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("metricCreateIsotropic (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_indicator,&__pyx_n_s_field,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_0)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_indicator)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 2777, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_field); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 2777, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "metricCreateIsotropic") < 0)) __PYX_ERR(57, 2777, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_indicator = ((struct PyPetscVecObject *)values[0]); __pyx_v_field = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("metricCreateIsotropic", 0, 1, 2, __pyx_nargs); __PYX_ERR(57, 2777, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.metricCreateIsotropic", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indicator), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "indicator", 0))) __PYX_ERR(57, 2777, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_248metricCreateIsotropic(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_indicator, __pyx_v_field); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_248metricCreateIsotropic(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscVecObject *__pyx_v_indicator, PyObject *__pyx_v_field) { PetscInt __pyx_v_ival; struct PyPetscVecObject *__pyx_v_metric = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("metricCreateIsotropic", 1); /* "petsc4py/PETSc/DMPlex.pyx":2793 * * """ * cdef PetscInt ival = asInt(field) # <<<<<<<<<<<<<< * cdef Vec metric = Vec() * CHKERR( DMPlexMetricCreateIsotropic(self.dm, ival, indicator.vec, &metric.vec) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_field); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(57, 2793, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":2794 * """ * cdef PetscInt ival = asInt(field) * cdef Vec metric = Vec() # <<<<<<<<<<<<<< * CHKERR( DMPlexMetricCreateIsotropic(self.dm, ival, indicator.vec, &metric.vec) ) * return metric */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_2)) __PYX_ERR(57, 2794, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_metric = ((struct PyPetscVecObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DMPlex.pyx":2795 * cdef PetscInt ival = asInt(field) * cdef Vec metric = Vec() * CHKERR( DMPlexMetricCreateIsotropic(self.dm, ival, indicator.vec, &metric.vec) ) # <<<<<<<<<<<<<< * return metric * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexMetricCreateIsotropic(__pyx_v_self->__pyx_base.dm, __pyx_v_ival, __pyx_v_indicator->vec, (&__pyx_v_metric->vec))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 2795, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":2796 * cdef Vec metric = Vec() * CHKERR( DMPlexMetricCreateIsotropic(self.dm, ival, indicator.vec, &metric.vec) ) * return metric # <<<<<<<<<<<<<< * * def metricDeterminantCreate(self, field: int | None = 0) -> tuple[Vec, DM]: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_metric); __pyx_r = ((PyObject *)__pyx_v_metric); goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":2777 * return metric * * def metricCreateIsotropic(self, Vec indicator, field: int | None = 0) -> Vec: # <<<<<<<<<<<<<< * """Construct an isotropic metric from an error indicator. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.metricCreateIsotropic", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_metric); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":2798 * return metric * * def metricDeterminantCreate(self, field: int | None = 0) -> tuple[Vec, DM]: # <<<<<<<<<<<<<< * """Create the determinant field for a Riemannian metric. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_251metricDeterminantCreate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_250metricDeterminantCreate, "DMPlex.metricDeterminantCreate(self, field: int | None = 0) -> tuple[Vec, DM]\nCreate the determinant field for a Riemannian metric.\n\n Parameters\n ----------\n field\n The field number to use.\n\n Returns\n -------\n determinant : Vec\n The determinant field.\n dmDet : DM\n The corresponding DM\n\n See Also\n --------\n DMPlex.metricCreateUniform, DMPlex.metricCreateIsotropic\n DMPlex.metricCreate, petsc.DMPlexMetricDeterminantCreate\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:2798"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_251metricDeterminantCreate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_field = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("metricDeterminantCreate (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_field,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_0)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_field); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 2798, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "metricDeterminantCreate") < 0)) __PYX_ERR(57, 2798, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_field = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("metricDeterminantCreate", 0, 0, 1, __pyx_nargs); __PYX_ERR(57, 2798, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.metricDeterminantCreate", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_250metricDeterminantCreate(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_field); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_250metricDeterminantCreate(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_field) { PetscInt __pyx_v_ival; struct PyPetscVecObject *__pyx_v_determinant = 0; struct PyPetscDMObject *__pyx_v_dmDet = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("metricDeterminantCreate", 1); /* "petsc4py/PETSc/DMPlex.pyx":2819 * * """ * cdef PetscInt ival = asInt(field) # <<<<<<<<<<<<<< * cdef Vec determinant = Vec() * cdef DM dmDet = DM() */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_field); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(57, 2819, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":2820 * """ * cdef PetscInt ival = asInt(field) * cdef Vec determinant = Vec() # <<<<<<<<<<<<<< * cdef DM dmDet = DM() * CHKERR( DMPlexMetricDeterminantCreate(self.dm, ival, &determinant.vec, &dmDet.dm) ) */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_2)) __PYX_ERR(57, 2820, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_determinant = ((struct PyPetscVecObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DMPlex.pyx":2821 * cdef PetscInt ival = asInt(field) * cdef Vec determinant = Vec() * cdef DM dmDet = DM() # <<<<<<<<<<<<<< * CHKERR( DMPlexMetricDeterminantCreate(self.dm, ival, &determinant.vec, &dmDet.dm) ) * return (determinant, dmDet) */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM)); if (unlikely(!__pyx_t_2)) __PYX_ERR(57, 2821, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_dmDet = ((struct PyPetscDMObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DMPlex.pyx":2822 * cdef Vec determinant = Vec() * cdef DM dmDet = DM() * CHKERR( DMPlexMetricDeterminantCreate(self.dm, ival, &determinant.vec, &dmDet.dm) ) # <<<<<<<<<<<<<< * return (determinant, dmDet) * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexMetricDeterminantCreate(__pyx_v_self->__pyx_base.dm, __pyx_v_ival, (&__pyx_v_determinant->vec), (&__pyx_v_dmDet->dm))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 2822, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":2823 * cdef DM dmDet = DM() * CHKERR( DMPlexMetricDeterminantCreate(self.dm, ival, &determinant.vec, &dmDet.dm) ) * return (determinant, dmDet) # <<<<<<<<<<<<<< * * def metricEnforceSPD(self, Vec metric, Vec ometric, Vec determinant, restrictSizes: bool | None = False, restrictAnisotropy: bool | None = False) -> tuple[Vec, Vec]: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(57, 2823, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF((PyObject *)__pyx_v_determinant); __Pyx_GIVEREF((PyObject *)__pyx_v_determinant); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_determinant))) __PYX_ERR(57, 2823, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_dmDet); __Pyx_GIVEREF((PyObject *)__pyx_v_dmDet); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_dmDet))) __PYX_ERR(57, 2823, __pyx_L1_error); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":2798 * return metric * * def metricDeterminantCreate(self, field: int | None = 0) -> tuple[Vec, DM]: # <<<<<<<<<<<<<< * """Create the determinant field for a Riemannian metric. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.metricDeterminantCreate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_determinant); __Pyx_XDECREF((PyObject *)__pyx_v_dmDet); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":2825 * return (determinant, dmDet) * * def metricEnforceSPD(self, Vec metric, Vec ometric, Vec determinant, restrictSizes: bool | None = False, restrictAnisotropy: bool | None = False) -> tuple[Vec, Vec]: # <<<<<<<<<<<<<< * """Enforce symmetric positive-definiteness of a metric. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_253metricEnforceSPD(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_252metricEnforceSPD, "DMPlex.metricEnforceSPD(self, metric: Vec, ometric: Vec, determinant: Vec, restrictSizes: bool | None = False, restrictAnisotropy: bool | None = False) -> tuple[Vec, Vec]\nEnforce symmetric positive-definiteness of a metric.\n\n Parameters\n ----------\n metric\n The metric.\n ometric\n The output metric.\n determinant\n The output determinant.\n restrictSizes\n Flag indicating whether maximum/minimum magnitudes should be enforced.\n restrictAnisotropy\n Flag indicating whether maximum anisotropy should be enforced.\n\n Returns\n -------\n ometric : Vec\n The output metric.\n determinant : Vec\n The output determinant.\n\n See Also\n --------\n DMPlex.metricNormalize, DMPlex.metricIntersection2\n DMPlex.metricIntersection3, petsc_options, petsc.DMPlexMetricEnforceSPD\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:2825"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_253metricEnforceSPD(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_metric = 0; struct PyPetscVecObject *__pyx_v_ometric = 0; struct PyPetscVecObject *__pyx_v_determinant = 0; PyObject *__pyx_v_restrictSizes = 0; PyObject *__pyx_v_restrictAnisotropy = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("metricEnforceSPD (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_metric,&__pyx_n_s_ometric,&__pyx_n_s_determinant,&__pyx_n_s_restrictSizes,&__pyx_n_s_restrictAnisotropy,0}; values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False)); values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_metric)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 2825, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ometric)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 2825, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("metricEnforceSPD", 0, 3, 5, 1); __PYX_ERR(57, 2825, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_determinant)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 2825, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("metricEnforceSPD", 0, 3, 5, 2); __PYX_ERR(57, 2825, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_restrictSizes); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 2825, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_restrictAnisotropy); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 2825, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "metricEnforceSPD") < 0)) __PYX_ERR(57, 2825, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_metric = ((struct PyPetscVecObject *)values[0]); __pyx_v_ometric = ((struct PyPetscVecObject *)values[1]); __pyx_v_determinant = ((struct PyPetscVecObject *)values[2]); __pyx_v_restrictSizes = values[3]; __pyx_v_restrictAnisotropy = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("metricEnforceSPD", 0, 3, 5, __pyx_nargs); __PYX_ERR(57, 2825, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.metricEnforceSPD", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_metric), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "metric", 0))) __PYX_ERR(57, 2825, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ometric), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "ometric", 0))) __PYX_ERR(57, 2825, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_determinant), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "determinant", 0))) __PYX_ERR(57, 2825, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_252metricEnforceSPD(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_metric, __pyx_v_ometric, __pyx_v_determinant, __pyx_v_restrictSizes, __pyx_v_restrictAnisotropy); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_252metricEnforceSPD(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscVecObject *__pyx_v_metric, struct PyPetscVecObject *__pyx_v_ometric, struct PyPetscVecObject *__pyx_v_determinant, PyObject *__pyx_v_restrictSizes, PyObject *__pyx_v_restrictAnisotropy) { PetscBool __pyx_v_bval_rs; PetscBool __pyx_v_bval_ra; CYTHON_UNUSED struct PyPetscDMObject *__pyx_v_dmDet = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("metricEnforceSPD", 1); /* "petsc4py/PETSc/DMPlex.pyx":2854 * * """ * cdef PetscBool bval_rs = asBool(restrictSizes) # <<<<<<<<<<<<<< * cdef PetscBool bval_ra = asBool(restrictAnisotropy) * cdef DM dmDet = DM() */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asBool(__pyx_v_restrictSizes); if (unlikely(__pyx_t_1 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(57, 2854, __pyx_L1_error) __pyx_v_bval_rs = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":2855 * """ * cdef PetscBool bval_rs = asBool(restrictSizes) * cdef PetscBool bval_ra = asBool(restrictAnisotropy) # <<<<<<<<<<<<<< * cdef DM dmDet = DM() * CHKERR( DMPlexMetricEnforceSPD(self.dm, metric.vec, bval_rs, bval_ra, ometric.vec, determinant.vec) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asBool(__pyx_v_restrictAnisotropy); if (unlikely(__pyx_t_1 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(57, 2855, __pyx_L1_error) __pyx_v_bval_ra = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":2856 * cdef PetscBool bval_rs = asBool(restrictSizes) * cdef PetscBool bval_ra = asBool(restrictAnisotropy) * cdef DM dmDet = DM() # <<<<<<<<<<<<<< * CHKERR( DMPlexMetricEnforceSPD(self.dm, metric.vec, bval_rs, bval_ra, ometric.vec, determinant.vec) ) * return (ometric, determinant) */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM)); if (unlikely(!__pyx_t_2)) __PYX_ERR(57, 2856, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_dmDet = ((struct PyPetscDMObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DMPlex.pyx":2857 * cdef PetscBool bval_ra = asBool(restrictAnisotropy) * cdef DM dmDet = DM() * CHKERR( DMPlexMetricEnforceSPD(self.dm, metric.vec, bval_rs, bval_ra, ometric.vec, determinant.vec) ) # <<<<<<<<<<<<<< * return (ometric, determinant) * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexMetricEnforceSPD(__pyx_v_self->__pyx_base.dm, __pyx_v_metric->vec, __pyx_v_bval_rs, __pyx_v_bval_ra, __pyx_v_ometric->vec, __pyx_v_determinant->vec)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 2857, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":2858 * cdef DM dmDet = DM() * CHKERR( DMPlexMetricEnforceSPD(self.dm, metric.vec, bval_rs, bval_ra, ometric.vec, determinant.vec) ) * return (ometric, determinant) # <<<<<<<<<<<<<< * * def metricNormalize(self, Vec metric, Vec ometric, Vec determinant, restrictSizes: bool | None = True, restrictAnisotropy: bool | None = True) -> tuple[Vec, Vec]: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(57, 2858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF((PyObject *)__pyx_v_ometric); __Pyx_GIVEREF((PyObject *)__pyx_v_ometric); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_ometric))) __PYX_ERR(57, 2858, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_determinant); __Pyx_GIVEREF((PyObject *)__pyx_v_determinant); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_determinant))) __PYX_ERR(57, 2858, __pyx_L1_error); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":2825 * return (determinant, dmDet) * * def metricEnforceSPD(self, Vec metric, Vec ometric, Vec determinant, restrictSizes: bool | None = False, restrictAnisotropy: bool | None = False) -> tuple[Vec, Vec]: # <<<<<<<<<<<<<< * """Enforce symmetric positive-definiteness of a metric. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.metricEnforceSPD", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_dmDet); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":2860 * return (ometric, determinant) * * def metricNormalize(self, Vec metric, Vec ometric, Vec determinant, restrictSizes: bool | None = True, restrictAnisotropy: bool | None = True) -> tuple[Vec, Vec]: # <<<<<<<<<<<<<< * """Apply L-p normalization to a metric. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_255metricNormalize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_254metricNormalize, "DMPlex.metricNormalize(self, metric: Vec, ometric: Vec, determinant: Vec, restrictSizes: bool | None = True, restrictAnisotropy: bool | None = True) -> tuple[Vec, Vec]\nApply L-p normalization to a metric.\n\n Parameters\n ----------\n metric\n The metric.\n ometric\n The output metric.\n determinant\n The output determinant.\n restrictSizes\n Flag indicating whether maximum/minimum magnitudes should be enforced.\n restrictAnisotropy\n Flag indicating whether maximum anisotropy should be enforced.\n\n Returns\n -------\n ometric : Vec\n The output normalized metric.\n determinant : Vec\n The output determinant.\n\n See Also\n --------\n DMPlex.metricEnforceSPD, DMPlex.metricIntersection2\n DMPlex.metricIntersection3, petsc_options, petsc.DMPlexMetricNormalize\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:2860"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_255metricNormalize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_metric = 0; struct PyPetscVecObject *__pyx_v_ometric = 0; struct PyPetscVecObject *__pyx_v_determinant = 0; PyObject *__pyx_v_restrictSizes = 0; PyObject *__pyx_v_restrictAnisotropy = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("metricNormalize (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_metric,&__pyx_n_s_ometric,&__pyx_n_s_determinant,&__pyx_n_s_restrictSizes,&__pyx_n_s_restrictAnisotropy,0}; values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_True)); values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_True)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_metric)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 2860, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ometric)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 2860, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("metricNormalize", 0, 3, 5, 1); __PYX_ERR(57, 2860, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_determinant)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 2860, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("metricNormalize", 0, 3, 5, 2); __PYX_ERR(57, 2860, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_restrictSizes); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 2860, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_restrictAnisotropy); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 2860, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "metricNormalize") < 0)) __PYX_ERR(57, 2860, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_metric = ((struct PyPetscVecObject *)values[0]); __pyx_v_ometric = ((struct PyPetscVecObject *)values[1]); __pyx_v_determinant = ((struct PyPetscVecObject *)values[2]); __pyx_v_restrictSizes = values[3]; __pyx_v_restrictAnisotropy = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("metricNormalize", 0, 3, 5, __pyx_nargs); __PYX_ERR(57, 2860, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.metricNormalize", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_metric), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "metric", 0))) __PYX_ERR(57, 2860, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ometric), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "ometric", 0))) __PYX_ERR(57, 2860, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_determinant), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "determinant", 0))) __PYX_ERR(57, 2860, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_254metricNormalize(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_metric, __pyx_v_ometric, __pyx_v_determinant, __pyx_v_restrictSizes, __pyx_v_restrictAnisotropy); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_254metricNormalize(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscVecObject *__pyx_v_metric, struct PyPetscVecObject *__pyx_v_ometric, struct PyPetscVecObject *__pyx_v_determinant, PyObject *__pyx_v_restrictSizes, PyObject *__pyx_v_restrictAnisotropy) { PetscBool __pyx_v_bval_rs; PetscBool __pyx_v_bval_ra; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("metricNormalize", 1); /* "petsc4py/PETSc/DMPlex.pyx":2889 * * """ * cdef PetscBool bval_rs = asBool(restrictSizes) # <<<<<<<<<<<<<< * cdef PetscBool bval_ra = asBool(restrictAnisotropy) * CHKERR( DMPlexMetricNormalize(self.dm, metric.vec, bval_rs, bval_ra, ometric.vec, determinant.vec) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asBool(__pyx_v_restrictSizes); if (unlikely(__pyx_t_1 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(57, 2889, __pyx_L1_error) __pyx_v_bval_rs = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":2890 * """ * cdef PetscBool bval_rs = asBool(restrictSizes) * cdef PetscBool bval_ra = asBool(restrictAnisotropy) # <<<<<<<<<<<<<< * CHKERR( DMPlexMetricNormalize(self.dm, metric.vec, bval_rs, bval_ra, ometric.vec, determinant.vec) ) * return (ometric, determinant) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asBool(__pyx_v_restrictAnisotropy); if (unlikely(__pyx_t_1 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(57, 2890, __pyx_L1_error) __pyx_v_bval_ra = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":2891 * cdef PetscBool bval_rs = asBool(restrictSizes) * cdef PetscBool bval_ra = asBool(restrictAnisotropy) * CHKERR( DMPlexMetricNormalize(self.dm, metric.vec, bval_rs, bval_ra, ometric.vec, determinant.vec) ) # <<<<<<<<<<<<<< * return (ometric, determinant) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexMetricNormalize(__pyx_v_self->__pyx_base.dm, __pyx_v_metric->vec, __pyx_v_bval_rs, __pyx_v_bval_ra, __pyx_v_ometric->vec, __pyx_v_determinant->vec)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 2891, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":2892 * cdef PetscBool bval_ra = asBool(restrictAnisotropy) * CHKERR( DMPlexMetricNormalize(self.dm, metric.vec, bval_rs, bval_ra, ometric.vec, determinant.vec) ) * return (ometric, determinant) # <<<<<<<<<<<<<< * * def metricAverage2(self, Vec metric1, Vec metric2, Vec metricAvg) -> Vec: */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(57, 2892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF((PyObject *)__pyx_v_ometric); __Pyx_GIVEREF((PyObject *)__pyx_v_ometric); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_ometric))) __PYX_ERR(57, 2892, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_determinant); __Pyx_GIVEREF((PyObject *)__pyx_v_determinant); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_determinant))) __PYX_ERR(57, 2892, __pyx_L1_error); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":2860 * return (ometric, determinant) * * def metricNormalize(self, Vec metric, Vec ometric, Vec determinant, restrictSizes: bool | None = True, restrictAnisotropy: bool | None = True) -> tuple[Vec, Vec]: # <<<<<<<<<<<<<< * """Apply L-p normalization to a metric. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.metricNormalize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":2894 * return (ometric, determinant) * * def metricAverage2(self, Vec metric1, Vec metric2, Vec metricAvg) -> Vec: # <<<<<<<<<<<<<< * """Compute and return the unweighted average of two metrics. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_257metricAverage2(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_256metricAverage2, "DMPlex.metricAverage2(self, metric1: Vec, metric2: Vec, metricAvg: Vec) -> Vec\nCompute and return the unweighted average of two metrics.\n\n Parameters\n ----------\n metric1\n The first metric to be averaged.\n metric2\n The second metric to be averaged.\n metricAvg\n The output averaged metric.\n\n See Also\n --------\n DMPlex.metricAverage3, petsc.DMPlexMetricAverage2\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:2894"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_257metricAverage2(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_metric1 = 0; struct PyPetscVecObject *__pyx_v_metric2 = 0; struct PyPetscVecObject *__pyx_v_metricAvg = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("metricAverage2 (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_metric1,&__pyx_n_s_metric2,&__pyx_n_s_metricAvg,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_metric1)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 2894, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_metric2)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 2894, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("metricAverage2", 1, 3, 3, 1); __PYX_ERR(57, 2894, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_metricAvg)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 2894, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("metricAverage2", 1, 3, 3, 2); __PYX_ERR(57, 2894, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "metricAverage2") < 0)) __PYX_ERR(57, 2894, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_metric1 = ((struct PyPetscVecObject *)values[0]); __pyx_v_metric2 = ((struct PyPetscVecObject *)values[1]); __pyx_v_metricAvg = ((struct PyPetscVecObject *)values[2]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("metricAverage2", 1, 3, 3, __pyx_nargs); __PYX_ERR(57, 2894, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.metricAverage2", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_metric1), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "metric1", 0))) __PYX_ERR(57, 2894, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_metric2), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "metric2", 0))) __PYX_ERR(57, 2894, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_metricAvg), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "metricAvg", 0))) __PYX_ERR(57, 2894, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_256metricAverage2(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_metric1, __pyx_v_metric2, __pyx_v_metricAvg); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_256metricAverage2(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscVecObject *__pyx_v_metric1, struct PyPetscVecObject *__pyx_v_metric2, struct PyPetscVecObject *__pyx_v_metricAvg) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("metricAverage2", 1); /* "petsc4py/PETSc/DMPlex.pyx":2911 * * """ * CHKERR( DMPlexMetricAverage2(self.dm, metric1.vec, metric2.vec, metricAvg.vec) ) # <<<<<<<<<<<<<< * return metricAvg * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexMetricAverage2(__pyx_v_self->__pyx_base.dm, __pyx_v_metric1->vec, __pyx_v_metric2->vec, __pyx_v_metricAvg->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 2911, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":2912 * """ * CHKERR( DMPlexMetricAverage2(self.dm, metric1.vec, metric2.vec, metricAvg.vec) ) * return metricAvg # <<<<<<<<<<<<<< * * def metricAverage3(self, Vec metric1, Vec metric2, Vec metric3, Vec metricAvg) -> Vec: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_metricAvg); __pyx_r = ((PyObject *)__pyx_v_metricAvg); goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":2894 * return (ometric, determinant) * * def metricAverage2(self, Vec metric1, Vec metric2, Vec metricAvg) -> Vec: # <<<<<<<<<<<<<< * """Compute and return the unweighted average of two metrics. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.metricAverage2", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":2914 * return metricAvg * * def metricAverage3(self, Vec metric1, Vec metric2, Vec metric3, Vec metricAvg) -> Vec: # <<<<<<<<<<<<<< * """Compute and return the unweighted average of three metrics. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_259metricAverage3(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_258metricAverage3, "DMPlex.metricAverage3(self, metric1: Vec, metric2: Vec, metric3: Vec, metricAvg: Vec) -> Vec\nCompute and return the unweighted average of three metrics.\n\n Parameters\n ----------\n metric1\n The first metric to be averaged.\n metric2\n The second metric to be averaged.\n metric3\n The third metric to be averaged.\n metricAvg\n The output averaged metric.\n\n See Also\n --------\n DMPlex.metricAverage2, petsc.DMPlexMetricAverage3\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:2914"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_259metricAverage3(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_metric1 = 0; struct PyPetscVecObject *__pyx_v_metric2 = 0; struct PyPetscVecObject *__pyx_v_metric3 = 0; struct PyPetscVecObject *__pyx_v_metricAvg = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("metricAverage3 (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_metric1,&__pyx_n_s_metric2,&__pyx_n_s_metric3,&__pyx_n_s_metricAvg,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_metric1)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 2914, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_metric2)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 2914, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("metricAverage3", 1, 4, 4, 1); __PYX_ERR(57, 2914, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_metric3)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 2914, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("metricAverage3", 1, 4, 4, 2); __PYX_ERR(57, 2914, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_metricAvg)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 2914, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("metricAverage3", 1, 4, 4, 3); __PYX_ERR(57, 2914, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "metricAverage3") < 0)) __PYX_ERR(57, 2914, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 4)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); } __pyx_v_metric1 = ((struct PyPetscVecObject *)values[0]); __pyx_v_metric2 = ((struct PyPetscVecObject *)values[1]); __pyx_v_metric3 = ((struct PyPetscVecObject *)values[2]); __pyx_v_metricAvg = ((struct PyPetscVecObject *)values[3]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("metricAverage3", 1, 4, 4, __pyx_nargs); __PYX_ERR(57, 2914, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.metricAverage3", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_metric1), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "metric1", 0))) __PYX_ERR(57, 2914, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_metric2), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "metric2", 0))) __PYX_ERR(57, 2914, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_metric3), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "metric3", 0))) __PYX_ERR(57, 2914, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_metricAvg), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "metricAvg", 0))) __PYX_ERR(57, 2914, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_258metricAverage3(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_metric1, __pyx_v_metric2, __pyx_v_metric3, __pyx_v_metricAvg); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_258metricAverage3(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscVecObject *__pyx_v_metric1, struct PyPetscVecObject *__pyx_v_metric2, struct PyPetscVecObject *__pyx_v_metric3, struct PyPetscVecObject *__pyx_v_metricAvg) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("metricAverage3", 1); /* "petsc4py/PETSc/DMPlex.pyx":2933 * * """ * CHKERR( DMPlexMetricAverage3(self.dm, metric1.vec, metric2.vec, metric3.vec, metricAvg.vec) ) # <<<<<<<<<<<<<< * return metricAvg * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexMetricAverage3(__pyx_v_self->__pyx_base.dm, __pyx_v_metric1->vec, __pyx_v_metric2->vec, __pyx_v_metric3->vec, __pyx_v_metricAvg->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 2933, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":2934 * """ * CHKERR( DMPlexMetricAverage3(self.dm, metric1.vec, metric2.vec, metric3.vec, metricAvg.vec) ) * return metricAvg # <<<<<<<<<<<<<< * * def metricIntersection2(self, Vec metric1, Vec metric2, Vec metricInt) -> Vec: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_metricAvg); __pyx_r = ((PyObject *)__pyx_v_metricAvg); goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":2914 * return metricAvg * * def metricAverage3(self, Vec metric1, Vec metric2, Vec metric3, Vec metricAvg) -> Vec: # <<<<<<<<<<<<<< * """Compute and return the unweighted average of three metrics. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.metricAverage3", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":2936 * return metricAvg * * def metricIntersection2(self, Vec metric1, Vec metric2, Vec metricInt) -> Vec: # <<<<<<<<<<<<<< * """Compute and return the intersection of two metrics. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_261metricIntersection2(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_260metricIntersection2, "DMPlex.metricIntersection2(self, metric1: Vec, metric2: Vec, metricInt: Vec) -> Vec\nCompute and return the intersection of two metrics.\n\n Parameters\n ----------\n metric1\n The first metric to be intersected.\n metric2\n The second metric to be intersected.\n metricInt\n The output intersected metric.\n\n See Also\n --------\n DMPlex.metricIntersection3, petsc.DMPlexMetricIntersection2\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:2936"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_261metricIntersection2(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_metric1 = 0; struct PyPetscVecObject *__pyx_v_metric2 = 0; struct PyPetscVecObject *__pyx_v_metricInt = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("metricIntersection2 (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_metric1,&__pyx_n_s_metric2,&__pyx_n_s_metricInt,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_metric1)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 2936, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_metric2)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 2936, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("metricIntersection2", 1, 3, 3, 1); __PYX_ERR(57, 2936, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_metricInt)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 2936, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("metricIntersection2", 1, 3, 3, 2); __PYX_ERR(57, 2936, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "metricIntersection2") < 0)) __PYX_ERR(57, 2936, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_metric1 = ((struct PyPetscVecObject *)values[0]); __pyx_v_metric2 = ((struct PyPetscVecObject *)values[1]); __pyx_v_metricInt = ((struct PyPetscVecObject *)values[2]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("metricIntersection2", 1, 3, 3, __pyx_nargs); __PYX_ERR(57, 2936, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.metricIntersection2", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_metric1), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "metric1", 0))) __PYX_ERR(57, 2936, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_metric2), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "metric2", 0))) __PYX_ERR(57, 2936, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_metricInt), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "metricInt", 0))) __PYX_ERR(57, 2936, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_260metricIntersection2(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_metric1, __pyx_v_metric2, __pyx_v_metricInt); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_260metricIntersection2(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscVecObject *__pyx_v_metric1, struct PyPetscVecObject *__pyx_v_metric2, struct PyPetscVecObject *__pyx_v_metricInt) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("metricIntersection2", 1); /* "petsc4py/PETSc/DMPlex.pyx":2953 * * """ * CHKERR( DMPlexMetricIntersection2(self.dm, metric1.vec, metric2.vec, metricInt.vec) ) # <<<<<<<<<<<<<< * return metricInt * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexMetricIntersection2(__pyx_v_self->__pyx_base.dm, __pyx_v_metric1->vec, __pyx_v_metric2->vec, __pyx_v_metricInt->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 2953, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":2954 * """ * CHKERR( DMPlexMetricIntersection2(self.dm, metric1.vec, metric2.vec, metricInt.vec) ) * return metricInt # <<<<<<<<<<<<<< * * def metricIntersection3(self, Vec metric1, Vec metric2, Vec metric3, Vec metricInt) -> Vec: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_metricInt); __pyx_r = ((PyObject *)__pyx_v_metricInt); goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":2936 * return metricAvg * * def metricIntersection2(self, Vec metric1, Vec metric2, Vec metricInt) -> Vec: # <<<<<<<<<<<<<< * """Compute and return the intersection of two metrics. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.metricIntersection2", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":2956 * return metricInt * * def metricIntersection3(self, Vec metric1, Vec metric2, Vec metric3, Vec metricInt) -> Vec: # <<<<<<<<<<<<<< * """Compute the intersection of three metrics. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_263metricIntersection3(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_262metricIntersection3, "DMPlex.metricIntersection3(self, metric1: Vec, metric2: Vec, metric3: Vec, metricInt: Vec) -> Vec\nCompute the intersection of three metrics.\n\n Parameters\n ----------\n metric1\n The first metric to be intersected.\n metric2\n The second metric to be intersected.\n metric3\n The third metric to be intersected.\n metricInt\n The output intersected metric.\n\n See Also\n --------\n DMPlex.metricIntersection2, petsc.DMPlexMetricIntersection3\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:2956"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_263metricIntersection3(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_metric1 = 0; struct PyPetscVecObject *__pyx_v_metric2 = 0; struct PyPetscVecObject *__pyx_v_metric3 = 0; struct PyPetscVecObject *__pyx_v_metricInt = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("metricIntersection3 (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_metric1,&__pyx_n_s_metric2,&__pyx_n_s_metric3,&__pyx_n_s_metricInt,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_metric1)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 2956, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_metric2)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 2956, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("metricIntersection3", 1, 4, 4, 1); __PYX_ERR(57, 2956, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_metric3)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 2956, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("metricIntersection3", 1, 4, 4, 2); __PYX_ERR(57, 2956, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_metricInt)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 2956, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("metricIntersection3", 1, 4, 4, 3); __PYX_ERR(57, 2956, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "metricIntersection3") < 0)) __PYX_ERR(57, 2956, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 4)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); } __pyx_v_metric1 = ((struct PyPetscVecObject *)values[0]); __pyx_v_metric2 = ((struct PyPetscVecObject *)values[1]); __pyx_v_metric3 = ((struct PyPetscVecObject *)values[2]); __pyx_v_metricInt = ((struct PyPetscVecObject *)values[3]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("metricIntersection3", 1, 4, 4, __pyx_nargs); __PYX_ERR(57, 2956, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.metricIntersection3", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_metric1), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "metric1", 0))) __PYX_ERR(57, 2956, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_metric2), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "metric2", 0))) __PYX_ERR(57, 2956, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_metric3), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "metric3", 0))) __PYX_ERR(57, 2956, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_metricInt), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "metricInt", 0))) __PYX_ERR(57, 2956, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_262metricIntersection3(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_metric1, __pyx_v_metric2, __pyx_v_metric3, __pyx_v_metricInt); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_262metricIntersection3(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscVecObject *__pyx_v_metric1, struct PyPetscVecObject *__pyx_v_metric2, struct PyPetscVecObject *__pyx_v_metric3, struct PyPetscVecObject *__pyx_v_metricInt) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("metricIntersection3", 1); /* "petsc4py/PETSc/DMPlex.pyx":2975 * * """ * CHKERR( DMPlexMetricIntersection3(self.dm, metric1.vec, metric2.vec, metric3.vec, metricInt.vec) ) # <<<<<<<<<<<<<< * return metricInt * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexMetricIntersection3(__pyx_v_self->__pyx_base.dm, __pyx_v_metric1->vec, __pyx_v_metric2->vec, __pyx_v_metric3->vec, __pyx_v_metricInt->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 2975, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":2976 * """ * CHKERR( DMPlexMetricIntersection3(self.dm, metric1.vec, metric2.vec, metric3.vec, metricInt.vec) ) * return metricInt # <<<<<<<<<<<<<< * * def computeGradientClementInterpolant(self, Vec locX, Vec locC) -> Vec: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_metricInt); __pyx_r = ((PyObject *)__pyx_v_metricInt); goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":2956 * return metricInt * * def metricIntersection3(self, Vec metric1, Vec metric2, Vec metric3, Vec metricInt) -> Vec: # <<<<<<<<<<<<<< * """Compute the intersection of three metrics. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.metricIntersection3", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":2978 * return metricInt * * def computeGradientClementInterpolant(self, Vec locX, Vec locC) -> Vec: # <<<<<<<<<<<<<< * """Return the L2 projection of the cellwise gradient of a function onto P1. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_265computeGradientClementInterpolant(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_264computeGradientClementInterpolant, "DMPlex.computeGradientClementInterpolant(self, locX: Vec, locC: Vec) -> Vec\nReturn the L2 projection of the cellwise gradient of a function onto P1.\n\n Collective.\n\n Parameters\n ----------\n locX\n The coefficient vector of the function.\n locC\n The output `Vec` which holds the Clement interpolant of the gradient.\n\n See Also\n --------\n DM, DMPlex, petsc.DMPlexComputeGradientClementInterpolant\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:2978"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_265computeGradientClementInterpolant(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_locX = 0; struct PyPetscVecObject *__pyx_v_locC = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("computeGradientClementInterpolant (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_locX,&__pyx_n_s_locC,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_locX)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 2978, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_locC)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 2978, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("computeGradientClementInterpolant", 1, 2, 2, 1); __PYX_ERR(57, 2978, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "computeGradientClementInterpolant") < 0)) __PYX_ERR(57, 2978, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_locX = ((struct PyPetscVecObject *)values[0]); __pyx_v_locC = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("computeGradientClementInterpolant", 1, 2, 2, __pyx_nargs); __PYX_ERR(57, 2978, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.computeGradientClementInterpolant", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_locX), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "locX", 0))) __PYX_ERR(57, 2978, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_locC), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "locC", 0))) __PYX_ERR(57, 2978, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_264computeGradientClementInterpolant(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_locX, __pyx_v_locC); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_264computeGradientClementInterpolant(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscVecObject *__pyx_v_locX, struct PyPetscVecObject *__pyx_v_locC) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("computeGradientClementInterpolant", 1); /* "petsc4py/PETSc/DMPlex.pyx":2995 * * """ * CHKERR( DMPlexComputeGradientClementInterpolant(self.dm, locX.vec, locC.vec) ) # <<<<<<<<<<<<<< * return locC * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexComputeGradientClementInterpolant(__pyx_v_self->__pyx_base.dm, __pyx_v_locX->vec, __pyx_v_locC->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 2995, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":2996 * """ * CHKERR( DMPlexComputeGradientClementInterpolant(self.dm, locX.vec, locC.vec) ) * return locC # <<<<<<<<<<<<<< * * # View */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_locC); __pyx_r = ((PyObject *)__pyx_v_locC); goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":2978 * return metricInt * * def computeGradientClementInterpolant(self, Vec locX, Vec locC) -> Vec: # <<<<<<<<<<<<<< * """Return the L2 projection of the cellwise gradient of a function onto P1. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.computeGradientClementInterpolant", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":3000 * # View * * def topologyView(self, Viewer viewer) -> None: # <<<<<<<<<<<<<< * """Save a `DMPlex` topology into a file. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_267topologyView(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_266topologyView, "DMPlex.topologyView(self, viewer: Viewer) -> None\nSave a `DMPlex` topology into a file.\n\n Collective.\n\n Parameters\n ----------\n viewer\n The `Viewer` for saving.\n\n See Also\n --------\n DM, DMPlex, DM.view, DMPlex.coordinatesView, DMPlex.labelsView\n DMPlex.topologyLoad, Viewer, petsc.DMPlexTopologyView\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:3000"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_267topologyView(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscViewerObject *__pyx_v_viewer = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("topologyView (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_viewer)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 3000, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "topologyView") < 0)) __PYX_ERR(57, 3000, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("topologyView", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 3000, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.topologyView", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 0, "viewer", 0))) __PYX_ERR(57, 3000, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_266topologyView(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_viewer); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_266topologyView(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("topologyView", 1); /* "petsc4py/PETSc/DMPlex.pyx":3016 * * """ * CHKERR( DMPlexTopologyView(self.dm, viewer.vwr)) # <<<<<<<<<<<<<< * * def coordinatesView(self, Viewer viewer) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexTopologyView(__pyx_v_self->__pyx_base.dm, __pyx_v_viewer->vwr)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 3016, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":3000 * # View * * def topologyView(self, Viewer viewer) -> None: # <<<<<<<<<<<<<< * """Save a `DMPlex` topology into a file. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.topologyView", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":3018 * CHKERR( DMPlexTopologyView(self.dm, viewer.vwr)) * * def coordinatesView(self, Viewer viewer) -> None: # <<<<<<<<<<<<<< * """Save `DMPlex` coordinates into a file. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_269coordinatesView(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_268coordinatesView, "DMPlex.coordinatesView(self, viewer: Viewer) -> None\nSave `DMPlex` coordinates into a file.\n\n Collective.\n\n Parameters\n ----------\n viewer\n The `Viewer` for saving.\n\n See Also\n --------\n DM, DMPlex, DM.view, DMPlex.topologyView, DMPlex.labelsView\n DMPlex.coordinatesLoad, Viewer, petsc.DMPlexCoordinatesView\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:3018"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_269coordinatesView(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscViewerObject *__pyx_v_viewer = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("coordinatesView (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_viewer)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 3018, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "coordinatesView") < 0)) __PYX_ERR(57, 3018, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("coordinatesView", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 3018, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.coordinatesView", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 0, "viewer", 0))) __PYX_ERR(57, 3018, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_268coordinatesView(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_viewer); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_268coordinatesView(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("coordinatesView", 1); /* "petsc4py/PETSc/DMPlex.pyx":3034 * * """ * CHKERR( DMPlexCoordinatesView(self.dm, viewer.vwr)) # <<<<<<<<<<<<<< * * def labelsView(self, Viewer viewer) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexCoordinatesView(__pyx_v_self->__pyx_base.dm, __pyx_v_viewer->vwr)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 3034, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":3018 * CHKERR( DMPlexTopologyView(self.dm, viewer.vwr)) * * def coordinatesView(self, Viewer viewer) -> None: # <<<<<<<<<<<<<< * """Save `DMPlex` coordinates into a file. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.coordinatesView", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":3036 * CHKERR( DMPlexCoordinatesView(self.dm, viewer.vwr)) * * def labelsView(self, Viewer viewer) -> None: # <<<<<<<<<<<<<< * """Save `DMPlex` labels into a file. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_271labelsView(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_270labelsView, "DMPlex.labelsView(self, viewer: Viewer) -> None\nSave `DMPlex` labels into a file.\n\n Collective.\n\n Parameters\n ----------\n viewer\n The `Viewer` for saving.\n\n See Also\n --------\n DM, DMPlex, DM.view, DMPlex.topologyView, DMPlex.coordinatesView\n DMPlex.labelsLoad, Viewer, petsc.DMPlexLabelsView\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:3036"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_271labelsView(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscViewerObject *__pyx_v_viewer = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("labelsView (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_viewer)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 3036, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "labelsView") < 0)) __PYX_ERR(57, 3036, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("labelsView", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 3036, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.labelsView", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 0, "viewer", 0))) __PYX_ERR(57, 3036, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_270labelsView(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_viewer); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_270labelsView(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("labelsView", 1); /* "petsc4py/PETSc/DMPlex.pyx":3052 * * """ * CHKERR( DMPlexLabelsView(self.dm, viewer.vwr)) # <<<<<<<<<<<<<< * * def sectionView(self, Viewer viewer, DM sectiondm) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexLabelsView(__pyx_v_self->__pyx_base.dm, __pyx_v_viewer->vwr)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 3052, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":3036 * CHKERR( DMPlexCoordinatesView(self.dm, viewer.vwr)) * * def labelsView(self, Viewer viewer) -> None: # <<<<<<<<<<<<<< * """Save `DMPlex` labels into a file. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.labelsView", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":3054 * CHKERR( DMPlexLabelsView(self.dm, viewer.vwr)) * * def sectionView(self, Viewer viewer, DM sectiondm) -> None: # <<<<<<<<<<<<<< * """Save a section associated with a `DMPlex`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_273sectionView(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_272sectionView, "DMPlex.sectionView(self, viewer: Viewer, sectiondm: DM) -> None\nSave a section associated with a `DMPlex`.\n\n Collective.\n\n Parameters\n ----------\n viewer\n The `Viewer` for saving.\n sectiondm\n The `DM` that contains the section to be saved.\n\n See Also\n --------\n DM, DMPlex, DM.view, DMPlex.topologyView, DMPlex.coordinatesView\n DMPlex.labelsView, DMPlex.globalVectorView, DMPlex.localVectorView\n DMPlex.sectionLoad, Viewer, petsc.DMPlexSectionView\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:3054"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_273sectionView(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscViewerObject *__pyx_v_viewer = 0; struct PyPetscDMObject *__pyx_v_sectiondm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("sectionView (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,&__pyx_n_s_sectiondm,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_viewer)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 3054, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sectiondm)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 3054, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("sectionView", 1, 2, 2, 1); __PYX_ERR(57, 3054, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "sectionView") < 0)) __PYX_ERR(57, 3054, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); __pyx_v_sectiondm = ((struct PyPetscDMObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("sectionView", 1, 2, 2, __pyx_nargs); __PYX_ERR(57, 3054, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.sectionView", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 0, "viewer", 0))) __PYX_ERR(57, 3054, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sectiondm), __pyx_ptype_8petsc4py_5PETSc_DM, 0, "sectiondm", 0))) __PYX_ERR(57, 3054, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_272sectionView(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_viewer, __pyx_v_sectiondm); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_272sectionView(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer, struct PyPetscDMObject *__pyx_v_sectiondm) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("sectionView", 1); /* "petsc4py/PETSc/DMPlex.pyx":3073 * * """ * CHKERR( DMPlexSectionView(self.dm, viewer.vwr, sectiondm.dm)) # <<<<<<<<<<<<<< * * def globalVectorView(self, Viewer viewer, DM sectiondm, Vec vec) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexSectionView(__pyx_v_self->__pyx_base.dm, __pyx_v_viewer->vwr, __pyx_v_sectiondm->dm)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 3073, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":3054 * CHKERR( DMPlexLabelsView(self.dm, viewer.vwr)) * * def sectionView(self, Viewer viewer, DM sectiondm) -> None: # <<<<<<<<<<<<<< * """Save a section associated with a `DMPlex`. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.sectionView", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":3075 * CHKERR( DMPlexSectionView(self.dm, viewer.vwr, sectiondm.dm)) * * def globalVectorView(self, Viewer viewer, DM sectiondm, Vec vec) -> None: # <<<<<<<<<<<<<< * """Save a global vector. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_275globalVectorView(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_274globalVectorView, "DMPlex.globalVectorView(self, viewer: Viewer, sectiondm: DM, vec: Vec) -> None\nSave a global vector.\n\n Collective.\n\n Parameters\n ----------\n viewer\n The `Viewer` to save data with.\n sectiondm\n The `DM` containing the global section on which ``vec``\n is defined; may be the same as this `DMPlex` object.\n vec\n The global vector to be saved.\n\n See Also\n --------\n DM, DMPlex, DMPlex.topologyView, DMPlex.sectionView\n DMPlex.localVectorView, DMPlex.globalVectorLoad\n DMPlex.localVectorLoad, petsc.DMPlexGlobalVectorView\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:3075"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_275globalVectorView(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscViewerObject *__pyx_v_viewer = 0; struct PyPetscDMObject *__pyx_v_sectiondm = 0; struct PyPetscVecObject *__pyx_v_vec = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("globalVectorView (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,&__pyx_n_s_sectiondm,&__pyx_n_s_vec,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_viewer)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 3075, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sectiondm)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 3075, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("globalVectorView", 1, 3, 3, 1); __PYX_ERR(57, 3075, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vec)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 3075, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("globalVectorView", 1, 3, 3, 2); __PYX_ERR(57, 3075, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "globalVectorView") < 0)) __PYX_ERR(57, 3075, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); __pyx_v_sectiondm = ((struct PyPetscDMObject *)values[1]); __pyx_v_vec = ((struct PyPetscVecObject *)values[2]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("globalVectorView", 1, 3, 3, __pyx_nargs); __PYX_ERR(57, 3075, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.globalVectorView", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 0, "viewer", 0))) __PYX_ERR(57, 3075, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sectiondm), __pyx_ptype_8petsc4py_5PETSc_DM, 0, "sectiondm", 0))) __PYX_ERR(57, 3075, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(57, 3075, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_274globalVectorView(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_viewer, __pyx_v_sectiondm, __pyx_v_vec); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_274globalVectorView(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer, struct PyPetscDMObject *__pyx_v_sectiondm, struct PyPetscVecObject *__pyx_v_vec) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("globalVectorView", 1); /* "petsc4py/PETSc/DMPlex.pyx":3097 * * """ * CHKERR( DMPlexGlobalVectorView(self.dm, viewer.vwr, sectiondm.dm, vec.vec)) # <<<<<<<<<<<<<< * * def localVectorView(self, Viewer viewer, DM sectiondm, Vec vec) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGlobalVectorView(__pyx_v_self->__pyx_base.dm, __pyx_v_viewer->vwr, __pyx_v_sectiondm->dm, __pyx_v_vec->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 3097, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":3075 * CHKERR( DMPlexSectionView(self.dm, viewer.vwr, sectiondm.dm)) * * def globalVectorView(self, Viewer viewer, DM sectiondm, Vec vec) -> None: # <<<<<<<<<<<<<< * """Save a global vector. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.globalVectorView", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":3099 * CHKERR( DMPlexGlobalVectorView(self.dm, viewer.vwr, sectiondm.dm, vec.vec)) * * def localVectorView(self, Viewer viewer, DM sectiondm, Vec vec) -> None: # <<<<<<<<<<<<<< * """Save a local vector. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_277localVectorView(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_276localVectorView, "DMPlex.localVectorView(self, viewer: Viewer, sectiondm: DM, vec: Vec) -> None\nSave a local vector.\n\n Collective.\n\n Parameters\n ----------\n viewer\n The `Viewer` to save data with.\n sectiondm\n The `DM` that contains the local section on which ``vec`` is\n defined; may be the same as this `DMPlex` object.\n vec\n The local vector to be saved.\n\n See Also\n --------\n DM, DMPlex, DMPlex.topologyView, DMPlex.sectionView\n DMPlex.globalVectorView, DMPlex.globalVectorLoad\n DMPlex.localVectorLoad, petsc.DMPlexLocalVectorView\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:3099"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_277localVectorView(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscViewerObject *__pyx_v_viewer = 0; struct PyPetscDMObject *__pyx_v_sectiondm = 0; struct PyPetscVecObject *__pyx_v_vec = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("localVectorView (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,&__pyx_n_s_sectiondm,&__pyx_n_s_vec,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_viewer)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 3099, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sectiondm)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 3099, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("localVectorView", 1, 3, 3, 1); __PYX_ERR(57, 3099, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vec)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 3099, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("localVectorView", 1, 3, 3, 2); __PYX_ERR(57, 3099, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "localVectorView") < 0)) __PYX_ERR(57, 3099, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); __pyx_v_sectiondm = ((struct PyPetscDMObject *)values[1]); __pyx_v_vec = ((struct PyPetscVecObject *)values[2]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("localVectorView", 1, 3, 3, __pyx_nargs); __PYX_ERR(57, 3099, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.localVectorView", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 0, "viewer", 0))) __PYX_ERR(57, 3099, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sectiondm), __pyx_ptype_8petsc4py_5PETSc_DM, 0, "sectiondm", 0))) __PYX_ERR(57, 3099, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(57, 3099, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_276localVectorView(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_viewer, __pyx_v_sectiondm, __pyx_v_vec); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_276localVectorView(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer, struct PyPetscDMObject *__pyx_v_sectiondm, struct PyPetscVecObject *__pyx_v_vec) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("localVectorView", 1); /* "petsc4py/PETSc/DMPlex.pyx":3121 * * """ * CHKERR( DMPlexLocalVectorView(self.dm, viewer.vwr, sectiondm.dm, vec.vec)) # <<<<<<<<<<<<<< * * # Load */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexLocalVectorView(__pyx_v_self->__pyx_base.dm, __pyx_v_viewer->vwr, __pyx_v_sectiondm->dm, __pyx_v_vec->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 3121, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":3099 * CHKERR( DMPlexGlobalVectorView(self.dm, viewer.vwr, sectiondm.dm, vec.vec)) * * def localVectorView(self, Viewer viewer, DM sectiondm, Vec vec) -> None: # <<<<<<<<<<<<<< * """Save a local vector. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.localVectorView", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":3125 * # Load * * def topologyLoad(self, Viewer viewer) -> SF: # <<<<<<<<<<<<<< * """Load a topology into this `DMPlex` object. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_279topologyLoad(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_278topologyLoad, "DMPlex.topologyLoad(self, viewer: Viewer) -> SF\nLoad a topology into this `DMPlex` object.\n\n Collective.\n\n Parameters\n ----------\n viewer\n The `Viewer` for the saved topology\n\n Returns\n -------\n sfxc : SF\n The `SF` that pushes points in ``[0, N)`` to the associated points\n in the loaded `DMPlex`, where ``N`` is the global number of points.\n\n See Also\n --------\n DM, DMPlex, DM.load, DMPlex.coordinatesLoad, DMPlex.labelsLoad\n DM.view, SF, Viewer, petsc.DMPlexTopologyLoad\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:3125"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_279topologyLoad(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscViewerObject *__pyx_v_viewer = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("topologyLoad (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_viewer)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 3125, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "topologyLoad") < 0)) __PYX_ERR(57, 3125, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("topologyLoad", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 3125, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.topologyLoad", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 0, "viewer", 0))) __PYX_ERR(57, 3125, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_278topologyLoad(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_viewer); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_278topologyLoad(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer) { struct PyPetscSFObject *__pyx_v_sf = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("topologyLoad", 1); /* "petsc4py/PETSc/DMPlex.pyx":3147 * * """ * cdef SF sf = SF() # <<<<<<<<<<<<<< * CHKERR( DMPlexTopologyLoad(self.dm, viewer.vwr, &sf.sf)) * return sf */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SF)); if (unlikely(!__pyx_t_1)) __PYX_ERR(57, 3147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_sf = ((struct PyPetscSFObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DMPlex.pyx":3148 * """ * cdef SF sf = SF() * CHKERR( DMPlexTopologyLoad(self.dm, viewer.vwr, &sf.sf)) # <<<<<<<<<<<<<< * return sf * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexTopologyLoad(__pyx_v_self->__pyx_base.dm, __pyx_v_viewer->vwr, (&__pyx_v_sf->sf))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 3148, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":3149 * cdef SF sf = SF() * CHKERR( DMPlexTopologyLoad(self.dm, viewer.vwr, &sf.sf)) * return sf # <<<<<<<<<<<<<< * * def coordinatesLoad(self, Viewer viewer, SF sfxc) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_sf); __pyx_r = ((PyObject *)__pyx_v_sf); goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":3125 * # Load * * def topologyLoad(self, Viewer viewer) -> SF: # <<<<<<<<<<<<<< * """Load a topology into this `DMPlex` object. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.topologyLoad", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_sf); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":3151 * return sf * * def coordinatesLoad(self, Viewer viewer, SF sfxc) -> None: # <<<<<<<<<<<<<< * """Load coordinates into this `DMPlex` object. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_281coordinatesLoad(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_280coordinatesLoad, "DMPlex.coordinatesLoad(self, viewer: Viewer, sfxc: SF) -> None\nLoad coordinates into this `DMPlex` object.\n\n Collective.\n\n Parameters\n ----------\n viewer\n The `Viewer` for the saved coordinates.\n sfxc\n The `SF` returned by `topologyLoad`.\n\n See Also\n --------\n DM, DMPlex, DM.load, DMPlex.topologyLoad, DMPlex.labelsLoad, DM.view\n SF, Viewer, petsc.DMPlexCoordinatesLoad\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:3151"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_281coordinatesLoad(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscViewerObject *__pyx_v_viewer = 0; struct PyPetscSFObject *__pyx_v_sfxc = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("coordinatesLoad (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,&__pyx_n_s_sfxc,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_viewer)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 3151, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sfxc)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 3151, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("coordinatesLoad", 1, 2, 2, 1); __PYX_ERR(57, 3151, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "coordinatesLoad") < 0)) __PYX_ERR(57, 3151, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); __pyx_v_sfxc = ((struct PyPetscSFObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("coordinatesLoad", 1, 2, 2, __pyx_nargs); __PYX_ERR(57, 3151, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.coordinatesLoad", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 0, "viewer", 0))) __PYX_ERR(57, 3151, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sfxc), __pyx_ptype_8petsc4py_5PETSc_SF, 0, "sfxc", 0))) __PYX_ERR(57, 3151, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_280coordinatesLoad(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_viewer, __pyx_v_sfxc); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_280coordinatesLoad(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer, struct PyPetscSFObject *__pyx_v_sfxc) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("coordinatesLoad", 1); /* "petsc4py/PETSc/DMPlex.pyx":3169 * * """ * CHKERR( DMPlexCoordinatesLoad(self.dm, viewer.vwr, sfxc.sf)) # <<<<<<<<<<<<<< * * def labelsLoad(self, Viewer viewer, SF sfxc) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexCoordinatesLoad(__pyx_v_self->__pyx_base.dm, __pyx_v_viewer->vwr, __pyx_v_sfxc->sf)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 3169, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":3151 * return sf * * def coordinatesLoad(self, Viewer viewer, SF sfxc) -> None: # <<<<<<<<<<<<<< * """Load coordinates into this `DMPlex` object. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.coordinatesLoad", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":3171 * CHKERR( DMPlexCoordinatesLoad(self.dm, viewer.vwr, sfxc.sf)) * * def labelsLoad(self, Viewer viewer, SF sfxc) -> None: # <<<<<<<<<<<<<< * """Load labels into this `DMPlex` object. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_283labelsLoad(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_282labelsLoad, "DMPlex.labelsLoad(self, viewer: Viewer, sfxc: SF) -> None\nLoad labels into this `DMPlex` object.\n\n Collective.\n\n Parameters\n ----------\n viewer\n The `Viewer` for the saved labels.\n sfxc\n The `SF` returned by `topologyLoad`.\n\n See Also\n --------\n DM, DMPlex, DM.load, DMPlex.topologyLoad, DMPlex.coordinatesLoad\n DM.view, SF, Viewer, petsc.DMPlexLabelsLoad\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:3171"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_283labelsLoad(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscViewerObject *__pyx_v_viewer = 0; struct PyPetscSFObject *__pyx_v_sfxc = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("labelsLoad (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,&__pyx_n_s_sfxc,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_viewer)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 3171, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sfxc)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 3171, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("labelsLoad", 1, 2, 2, 1); __PYX_ERR(57, 3171, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "labelsLoad") < 0)) __PYX_ERR(57, 3171, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); __pyx_v_sfxc = ((struct PyPetscSFObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("labelsLoad", 1, 2, 2, __pyx_nargs); __PYX_ERR(57, 3171, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.labelsLoad", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 0, "viewer", 0))) __PYX_ERR(57, 3171, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sfxc), __pyx_ptype_8petsc4py_5PETSc_SF, 0, "sfxc", 0))) __PYX_ERR(57, 3171, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_282labelsLoad(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_viewer, __pyx_v_sfxc); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_282labelsLoad(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer, struct PyPetscSFObject *__pyx_v_sfxc) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("labelsLoad", 1); /* "petsc4py/PETSc/DMPlex.pyx":3189 * * """ * CHKERR( DMPlexLabelsLoad(self.dm, viewer.vwr, sfxc.sf)) # <<<<<<<<<<<<<< * * def sectionLoad(self, Viewer viewer, DM sectiondm, SF sfxc) -> tuple[SF, SF]: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexLabelsLoad(__pyx_v_self->__pyx_base.dm, __pyx_v_viewer->vwr, __pyx_v_sfxc->sf)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 3189, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":3171 * CHKERR( DMPlexCoordinatesLoad(self.dm, viewer.vwr, sfxc.sf)) * * def labelsLoad(self, Viewer viewer, SF sfxc) -> None: # <<<<<<<<<<<<<< * """Load labels into this `DMPlex` object. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.labelsLoad", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":3191 * CHKERR( DMPlexLabelsLoad(self.dm, viewer.vwr, sfxc.sf)) * * def sectionLoad(self, Viewer viewer, DM sectiondm, SF sfxc) -> tuple[SF, SF]: # <<<<<<<<<<<<<< * """Load section into a `DM`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_285sectionLoad(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_284sectionLoad, "DMPlex.sectionLoad(self, viewer: Viewer, sectiondm: DM, sfxc: SF) -> tuple[SF, SF]\nLoad section into a `DM`.\n\n Collective.\n\n Parameters\n ----------\n viewer\n The `Viewer` that represents the on-disk section (``sectionA``).\n sectiondm\n The `DM` into which the on-disk section (``sectionA``) is migrated.\n sfxc\n The `SF` returned by `topologyLoad`.\n\n Returns\n -------\n gsf : SF\n The `SF` that migrates any on-disk `Vec` data associated with\n ``sectionA`` into a global `Vec` associated with the\n ``sectiondm``'s global section (`None` if not needed).\n lsf : SF\n The `SF` that migrates any on-disk `Vec` data associated with\n ``sectionA`` into a local `Vec` associated with the ``sectiondm``'s\n local section (`None` if not needed).\n\n See Also\n --------\n DM, DMPlex, DM.load, DMPlex.topologyLoad, DMPlex.coordinatesLoad\n DMPlex.labelsLoad, DMPlex.globalVectorLoad, DMPlex.localVectorLoad\n DMPlex.sectionView, SF, Viewer, petsc.DMPlexSectionLoad\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:3191"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_285sectionLoad(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscViewerObject *__pyx_v_viewer = 0; struct PyPetscDMObject *__pyx_v_sectiondm = 0; struct PyPetscSFObject *__pyx_v_sfxc = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("sectionLoad (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,&__pyx_n_s_sectiondm,&__pyx_n_s_sfxc,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_viewer)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 3191, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sectiondm)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 3191, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("sectionLoad", 1, 3, 3, 1); __PYX_ERR(57, 3191, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sfxc)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 3191, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("sectionLoad", 1, 3, 3, 2); __PYX_ERR(57, 3191, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "sectionLoad") < 0)) __PYX_ERR(57, 3191, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); __pyx_v_sectiondm = ((struct PyPetscDMObject *)values[1]); __pyx_v_sfxc = ((struct PyPetscSFObject *)values[2]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("sectionLoad", 1, 3, 3, __pyx_nargs); __PYX_ERR(57, 3191, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.sectionLoad", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 0, "viewer", 0))) __PYX_ERR(57, 3191, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sectiondm), __pyx_ptype_8petsc4py_5PETSc_DM, 0, "sectiondm", 0))) __PYX_ERR(57, 3191, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sfxc), __pyx_ptype_8petsc4py_5PETSc_SF, 0, "sfxc", 0))) __PYX_ERR(57, 3191, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_284sectionLoad(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_viewer, __pyx_v_sectiondm, __pyx_v_sfxc); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_284sectionLoad(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer, struct PyPetscDMObject *__pyx_v_sectiondm, struct PyPetscSFObject *__pyx_v_sfxc) { struct PyPetscSFObject *__pyx_v_gsf = 0; struct PyPetscSFObject *__pyx_v_lsf = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("sectionLoad", 1); /* "petsc4py/PETSc/DMPlex.pyx":3223 * * """ * cdef SF gsf = SF() # <<<<<<<<<<<<<< * cdef SF lsf = SF() * CHKERR( DMPlexSectionLoad(self.dm, viewer.vwr, sectiondm.dm, sfxc.sf, &gsf.sf, &lsf.sf)) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SF)); if (unlikely(!__pyx_t_1)) __PYX_ERR(57, 3223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_gsf = ((struct PyPetscSFObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DMPlex.pyx":3224 * """ * cdef SF gsf = SF() * cdef SF lsf = SF() # <<<<<<<<<<<<<< * CHKERR( DMPlexSectionLoad(self.dm, viewer.vwr, sectiondm.dm, sfxc.sf, &gsf.sf, &lsf.sf)) * return gsf, lsf */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SF)); if (unlikely(!__pyx_t_1)) __PYX_ERR(57, 3224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_lsf = ((struct PyPetscSFObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DMPlex.pyx":3225 * cdef SF gsf = SF() * cdef SF lsf = SF() * CHKERR( DMPlexSectionLoad(self.dm, viewer.vwr, sectiondm.dm, sfxc.sf, &gsf.sf, &lsf.sf)) # <<<<<<<<<<<<<< * return gsf, lsf * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexSectionLoad(__pyx_v_self->__pyx_base.dm, __pyx_v_viewer->vwr, __pyx_v_sectiondm->dm, __pyx_v_sfxc->sf, (&__pyx_v_gsf->sf), (&__pyx_v_lsf->sf))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 3225, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":3226 * cdef SF lsf = SF() * CHKERR( DMPlexSectionLoad(self.dm, viewer.vwr, sectiondm.dm, sfxc.sf, &gsf.sf, &lsf.sf)) * return gsf, lsf # <<<<<<<<<<<<<< * * def globalVectorLoad(self, Viewer viewer, DM sectiondm, SF sf, Vec vec) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(57, 3226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF((PyObject *)__pyx_v_gsf); __Pyx_GIVEREF((PyObject *)__pyx_v_gsf); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_gsf))) __PYX_ERR(57, 3226, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_lsf); __Pyx_GIVEREF((PyObject *)__pyx_v_lsf); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_lsf))) __PYX_ERR(57, 3226, __pyx_L1_error); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":3191 * CHKERR( DMPlexLabelsLoad(self.dm, viewer.vwr, sfxc.sf)) * * def sectionLoad(self, Viewer viewer, DM sectiondm, SF sfxc) -> tuple[SF, SF]: # <<<<<<<<<<<<<< * """Load section into a `DM`. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.sectionLoad", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_gsf); __Pyx_XDECREF((PyObject *)__pyx_v_lsf); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":3228 * return gsf, lsf * * def globalVectorLoad(self, Viewer viewer, DM sectiondm, SF sf, Vec vec) -> None: # <<<<<<<<<<<<<< * """Load on-disk vector data into a global vector. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_287globalVectorLoad(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_286globalVectorLoad, "DMPlex.globalVectorLoad(self, viewer: Viewer, sectiondm: DM, sf: SF, vec: Vec) -> None\nLoad on-disk vector data into a global vector.\n\n Collective.\n\n Parameters\n ----------\n viewer\n The `Viewer` that represents the on-disk vector data.\n sectiondm\n The `DM` that contains the global section on which vec is defined.\n sf\n The `SF` that migrates the on-disk vector data into vec.\n vec\n The global vector to set values of.\n\n See Also\n --------\n DM, DMPlex, DMPlex.topologyLoad, DMPlex.sectionLoad\n DMPlex.localVectorLoad, DMPlex.globalVectorView\n DMPlex.localVectorView, SF, Viewer, petsc.DMPlexGlobalVectorLoad\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:3228"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_287globalVectorLoad(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscViewerObject *__pyx_v_viewer = 0; struct PyPetscDMObject *__pyx_v_sectiondm = 0; struct PyPetscSFObject *__pyx_v_sf = 0; struct PyPetscVecObject *__pyx_v_vec = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("globalVectorLoad (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,&__pyx_n_s_sectiondm,&__pyx_n_s_sf,&__pyx_n_s_vec,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_viewer)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 3228, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sectiondm)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 3228, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("globalVectorLoad", 1, 4, 4, 1); __PYX_ERR(57, 3228, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sf)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 3228, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("globalVectorLoad", 1, 4, 4, 2); __PYX_ERR(57, 3228, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vec)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 3228, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("globalVectorLoad", 1, 4, 4, 3); __PYX_ERR(57, 3228, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "globalVectorLoad") < 0)) __PYX_ERR(57, 3228, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 4)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); __pyx_v_sectiondm = ((struct PyPetscDMObject *)values[1]); __pyx_v_sf = ((struct PyPetscSFObject *)values[2]); __pyx_v_vec = ((struct PyPetscVecObject *)values[3]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("globalVectorLoad", 1, 4, 4, __pyx_nargs); __PYX_ERR(57, 3228, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.globalVectorLoad", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 0, "viewer", 0))) __PYX_ERR(57, 3228, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sectiondm), __pyx_ptype_8petsc4py_5PETSc_DM, 0, "sectiondm", 0))) __PYX_ERR(57, 3228, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sf), __pyx_ptype_8petsc4py_5PETSc_SF, 0, "sf", 0))) __PYX_ERR(57, 3228, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(57, 3228, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_286globalVectorLoad(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_viewer, __pyx_v_sectiondm, __pyx_v_sf, __pyx_v_vec); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_286globalVectorLoad(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer, struct PyPetscDMObject *__pyx_v_sectiondm, struct PyPetscSFObject *__pyx_v_sf, struct PyPetscVecObject *__pyx_v_vec) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("globalVectorLoad", 1); /* "petsc4py/PETSc/DMPlex.pyx":3251 * * """ * CHKERR( DMPlexGlobalVectorLoad(self.dm, viewer.vwr, sectiondm.dm, sf.sf, vec.vec)) # <<<<<<<<<<<<<< * * def localVectorLoad(self, Viewer viewer, DM sectiondm, SF sf, Vec vec) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGlobalVectorLoad(__pyx_v_self->__pyx_base.dm, __pyx_v_viewer->vwr, __pyx_v_sectiondm->dm, __pyx_v_sf->sf, __pyx_v_vec->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 3251, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":3228 * return gsf, lsf * * def globalVectorLoad(self, Viewer viewer, DM sectiondm, SF sf, Vec vec) -> None: # <<<<<<<<<<<<<< * """Load on-disk vector data into a global vector. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.globalVectorLoad", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":3253 * CHKERR( DMPlexGlobalVectorLoad(self.dm, viewer.vwr, sectiondm.dm, sf.sf, vec.vec)) * * def localVectorLoad(self, Viewer viewer, DM sectiondm, SF sf, Vec vec) -> None: # <<<<<<<<<<<<<< * """Load on-disk vector data into a local vector. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_289localVectorLoad(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMPlex_288localVectorLoad, "DMPlex.localVectorLoad(self, viewer: Viewer, sectiondm: DM, sf: SF, vec: Vec) -> None\nLoad on-disk vector data into a local vector.\n\n Collective.\n\n Parameters\n ----------\n viewer\n The `Viewer` that represents the on-disk vector data.\n sectiondm\n The `DM` that contains the local section on which vec is defined.\n sf\n The `SF` that migrates the on-disk vector data into vec.\n vec\n The local vector to set values of.\n\n See Also\n --------\n DM, DMPlex, DMPlex.topologyLoad, DMPlex.sectionLoad\n DMPlex.globalVectorLoad, DMPlex.globalVectorView\n DMPlex.localVectorView, SF, Viewer, petsc.DMPlexLocalVectorLoad\n\n \nSource code at petsc4py/PETSc/DMPlex.pyx:3253"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_289localVectorLoad(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscViewerObject *__pyx_v_viewer = 0; struct PyPetscDMObject *__pyx_v_sectiondm = 0; struct PyPetscSFObject *__pyx_v_sf = 0; struct PyPetscVecObject *__pyx_v_vec = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("localVectorLoad (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,&__pyx_n_s_sectiondm,&__pyx_n_s_sf,&__pyx_n_s_vec,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_viewer)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 3253, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sectiondm)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 3253, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("localVectorLoad", 1, 4, 4, 1); __PYX_ERR(57, 3253, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sf)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 3253, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("localVectorLoad", 1, 4, 4, 2); __PYX_ERR(57, 3253, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vec)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 3253, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("localVectorLoad", 1, 4, 4, 3); __PYX_ERR(57, 3253, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "localVectorLoad") < 0)) __PYX_ERR(57, 3253, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 4)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); __pyx_v_sectiondm = ((struct PyPetscDMObject *)values[1]); __pyx_v_sf = ((struct PyPetscSFObject *)values[2]); __pyx_v_vec = ((struct PyPetscVecObject *)values[3]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("localVectorLoad", 1, 4, 4, __pyx_nargs); __PYX_ERR(57, 3253, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.localVectorLoad", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 0, "viewer", 0))) __PYX_ERR(57, 3253, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sectiondm), __pyx_ptype_8petsc4py_5PETSc_DM, 0, "sectiondm", 0))) __PYX_ERR(57, 3253, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sf), __pyx_ptype_8petsc4py_5PETSc_SF, 0, "sf", 0))) __PYX_ERR(57, 3253, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(57, 3253, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_288localVectorLoad(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_viewer, __pyx_v_sectiondm, __pyx_v_sf, __pyx_v_vec); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_288localVectorLoad(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer, struct PyPetscDMObject *__pyx_v_sectiondm, struct PyPetscSFObject *__pyx_v_sf, struct PyPetscVecObject *__pyx_v_vec) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("localVectorLoad", 1); /* "petsc4py/PETSc/DMPlex.pyx":3276 * * """ * CHKERR( DMPlexLocalVectorLoad(self.dm, viewer.vwr, sectiondm.dm, sf.sf, vec.vec)) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexLocalVectorLoad(__pyx_v_self->__pyx_base.dm, __pyx_v_viewer->vwr, __pyx_v_sectiondm->dm, __pyx_v_sf->sf, __pyx_v_vec->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 3276, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":3253 * CHKERR( DMPlexGlobalVectorLoad(self.dm, viewer.vwr, sectiondm.dm, sf.sf, vec.vec)) * * def localVectorLoad(self, Viewer viewer, DM sectiondm, SF sf, Vec vec) -> None: # <<<<<<<<<<<<<< * """Load on-disk vector data into a local vector. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.localVectorLoad", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":3297 * cdef class DMPlexTransform(Object): * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.tr * self.tr = NULL */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_15DMPlexTransform_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_15DMPlexTransform_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_8petsc4py_5PETSc_15DMPlexTransform___cinit__(((struct PyPetscDMPlexTransformObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_15DMPlexTransform___cinit__(struct PyPetscDMPlexTransformObject *__pyx_v_self) { int __pyx_r; /* "petsc4py/PETSc/DMPlex.pyx":3298 * * def __cinit__(self): * self.obj = &self.tr # <<<<<<<<<<<<<< * self.tr = NULL * */ __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->tr)); /* "petsc4py/PETSc/DMPlex.pyx":3299 * def __cinit__(self): * self.obj = &self.tr * self.tr = NULL # <<<<<<<<<<<<<< * * def apply(self, DM dm): */ __pyx_v_self->tr = NULL; /* "petsc4py/PETSc/DMPlex.pyx":3297 * cdef class DMPlexTransform(Object): * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.tr * self.tr = NULL */ /* function exit code */ __pyx_r = 0; return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":3301 * self.tr = NULL * * def apply(self, DM dm): # <<<<<<<<<<<<<< * cdef DMPlex newdm = DMPlex() * CHKERR( DMPlexTransformApply(self.tr, dm.dm, &newdm.dm) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_15DMPlexTransform_3apply(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_15DMPlexTransform_2apply, "DMPlexTransform.apply(self, dm: DM)\nSource code at petsc4py/PETSc/DMPlex.pyx:3301"); static PyObject *__pyx_pw_8petsc4py_5PETSc_15DMPlexTransform_3apply(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscDMObject *__pyx_v_dm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("apply (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dm,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dm)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 3301, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "apply") < 0)) __PYX_ERR(57, 3301, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_dm = ((struct PyPetscDMObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("apply", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 3301, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlexTransform.apply", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_ptype_8petsc4py_5PETSc_DM, 0, "dm", 0))) __PYX_ERR(57, 3301, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_15DMPlexTransform_2apply(((struct PyPetscDMPlexTransformObject *)__pyx_v_self), __pyx_v_dm); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_15DMPlexTransform_2apply(struct PyPetscDMPlexTransformObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm) { struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_newdm = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("apply", 1); /* "petsc4py/PETSc/DMPlex.pyx":3302 * * def apply(self, DM dm): * cdef DMPlex newdm = DMPlex() # <<<<<<<<<<<<<< * CHKERR( DMPlexTransformApply(self.tr, dm.dm, &newdm.dm) ) * return newdm */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DMPlex)); if (unlikely(!__pyx_t_1)) __PYX_ERR(57, 3302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_newdm = ((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DMPlex.pyx":3303 * def apply(self, DM dm): * cdef DMPlex newdm = DMPlex() * CHKERR( DMPlexTransformApply(self.tr, dm.dm, &newdm.dm) ) # <<<<<<<<<<<<<< * return newdm * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexTransformApply(__pyx_v_self->tr, __pyx_v_dm->dm, (&__pyx_v_newdm->__pyx_base.dm))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 3303, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":3304 * cdef DMPlex newdm = DMPlex() * CHKERR( DMPlexTransformApply(self.tr, dm.dm, &newdm.dm) ) * return newdm # <<<<<<<<<<<<<< * * def create(self, comm=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_newdm); __pyx_r = ((PyObject *)__pyx_v_newdm); goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":3301 * self.tr = NULL * * def apply(self, DM dm): # <<<<<<<<<<<<<< * cdef DMPlex newdm = DMPlex() * CHKERR( DMPlexTransformApply(self.tr, dm.dm, &newdm.dm) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMPlexTransform.apply", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_newdm); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":3306 * return newdm * * def create(self, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscDMPlexTransform newtr = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_15DMPlexTransform_5create(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_15DMPlexTransform_4create, "DMPlexTransform.create(self, comm=None)\nSource code at petsc4py/PETSc/DMPlex.pyx:3306"); static PyObject *__pyx_pw_8petsc4py_5PETSc_15DMPlexTransform_5create(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 3306, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "create") < 0)) __PYX_ERR(57, 3306, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_comm = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, __pyx_nargs); __PYX_ERR(57, 3306, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlexTransform.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_15DMPlexTransform_4create(((struct PyPetscDMPlexTransformObject *)__pyx_v_self), __pyx_v_comm); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_15DMPlexTransform_4create(struct PyPetscDMPlexTransformObject *__pyx_v_self, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; DMPlexTransform __pyx_v_newtr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create", 1); /* "petsc4py/PETSc/DMPlex.pyx":3307 * * def create(self, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscDMPlexTransform newtr = NULL * CHKERR( DMPlexTransformCreate(ccomm, &newtr) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(57, 3307, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/DMPlex.pyx":3308 * def create(self, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscDMPlexTransform newtr = NULL # <<<<<<<<<<<<<< * CHKERR( DMPlexTransformCreate(ccomm, &newtr) ) * CHKERR( PetscCLEAR(self.obj) ) */ __pyx_v_newtr = NULL; /* "petsc4py/PETSc/DMPlex.pyx":3309 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscDMPlexTransform newtr = NULL * CHKERR( DMPlexTransformCreate(ccomm, &newtr) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ) * self.tr = newtr */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexTransformCreate(__pyx_v_ccomm, (&__pyx_v_newtr))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 3309, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":3310 * cdef PetscDMPlexTransform newtr = NULL * CHKERR( DMPlexTransformCreate(ccomm, &newtr) ) * CHKERR( PetscCLEAR(self.obj) ) # <<<<<<<<<<<<<< * self.tr = newtr * return self */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 3310, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":3311 * CHKERR( DMPlexTransformCreate(ccomm, &newtr) ) * CHKERR( PetscCLEAR(self.obj) ) * self.tr = newtr # <<<<<<<<<<<<<< * return self * */ __pyx_v_self->tr = __pyx_v_newtr; /* "petsc4py/PETSc/DMPlex.pyx":3312 * CHKERR( PetscCLEAR(self.obj) ) * self.tr = newtr * return self # <<<<<<<<<<<<<< * * def destroy(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":3306 * return newdm * * def create(self, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscDMPlexTransform newtr = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlexTransform.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":3314 * return self * * def destroy(self): # <<<<<<<<<<<<<< * CHKERR( DMPlexTransformDestroy(&self.tr) ) * return self */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_15DMPlexTransform_7destroy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_15DMPlexTransform_6destroy, "DMPlexTransform.destroy(self)\nSource code at petsc4py/PETSc/DMPlex.pyx:3314"); static PyObject *__pyx_pw_8petsc4py_5PETSc_15DMPlexTransform_7destroy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("destroy (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_15DMPlexTransform_6destroy(((struct PyPetscDMPlexTransformObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_15DMPlexTransform_6destroy(struct PyPetscDMPlexTransformObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("destroy", 1); /* "petsc4py/PETSc/DMPlex.pyx":3315 * * def destroy(self): * CHKERR( DMPlexTransformDestroy(&self.tr) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexTransformDestroy((&__pyx_v_self->tr))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 3315, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":3316 * def destroy(self): * CHKERR( DMPlexTransformDestroy(&self.tr) ) * return self # <<<<<<<<<<<<<< * * def getType(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":3314 * return self * * def destroy(self): # <<<<<<<<<<<<<< * CHKERR( DMPlexTransformDestroy(&self.tr) ) * return self */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlexTransform.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":3318 * return self * * def getType(self): # <<<<<<<<<<<<<< * cdef PetscDMPlexTransformType cval = NULL * CHKERR( DMPlexTransformGetType(self.tr, &cval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_15DMPlexTransform_9getType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_15DMPlexTransform_8getType, "DMPlexTransform.getType(self)\nSource code at petsc4py/PETSc/DMPlex.pyx:3318"); static PyObject *__pyx_pw_8petsc4py_5PETSc_15DMPlexTransform_9getType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getType", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_15DMPlexTransform_8getType(((struct PyPetscDMPlexTransformObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_15DMPlexTransform_8getType(struct PyPetscDMPlexTransformObject *__pyx_v_self) { DMPlexTransformType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getType", 1); /* "petsc4py/PETSc/DMPlex.pyx":3319 * * def getType(self): * cdef PetscDMPlexTransformType cval = NULL # <<<<<<<<<<<<<< * CHKERR( DMPlexTransformGetType(self.tr, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/DMPlex.pyx":3320 * def getType(self): * cdef PetscDMPlexTransformType cval = NULL * CHKERR( DMPlexTransformGetType(self.tr, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexTransformGetType(__pyx_v_self->tr, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 3320, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":3321 * cdef PetscDMPlexTransformType cval = NULL * CHKERR( DMPlexTransformGetType(self.tr, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * def setUp(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(57, 3321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":3318 * return self * * def getType(self): # <<<<<<<<<<<<<< * cdef PetscDMPlexTransformType cval = NULL * CHKERR( DMPlexTransformGetType(self.tr, &cval) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMPlexTransform.getType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":3323 * return bytes2str(cval) * * def setUp(self): # <<<<<<<<<<<<<< * CHKERR( DMPlexTransformSetUp(self.tr) ) * return self */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_15DMPlexTransform_11setUp(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_15DMPlexTransform_10setUp, "DMPlexTransform.setUp(self)\nSource code at petsc4py/PETSc/DMPlex.pyx:3323"); static PyObject *__pyx_pw_8petsc4py_5PETSc_15DMPlexTransform_11setUp(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setUp (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("setUp", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setUp", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_15DMPlexTransform_10setUp(((struct PyPetscDMPlexTransformObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_15DMPlexTransform_10setUp(struct PyPetscDMPlexTransformObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setUp", 1); /* "petsc4py/PETSc/DMPlex.pyx":3324 * * def setUp(self): * CHKERR( DMPlexTransformSetUp(self.tr) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexTransformSetUp(__pyx_v_self->tr)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 3324, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":3325 * def setUp(self): * CHKERR( DMPlexTransformSetUp(self.tr) ) * return self # <<<<<<<<<<<<<< * * def setType(self, tr_type): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/DMPlex.pyx":3323 * return bytes2str(cval) * * def setUp(self): # <<<<<<<<<<<<<< * CHKERR( DMPlexTransformSetUp(self.tr) ) * return self */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlexTransform.setUp", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":3327 * return self * * def setType(self, tr_type): # <<<<<<<<<<<<<< * cdef PetscDMPlexTransformType cval = NULL * tr_type = str2bytes(tr_type, &cval) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_15DMPlexTransform_13setType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_15DMPlexTransform_12setType, "DMPlexTransform.setType(self, tr_type)\nSource code at petsc4py/PETSc/DMPlex.pyx:3327"); static PyObject *__pyx_pw_8petsc4py_5PETSc_15DMPlexTransform_13setType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_tr_type = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tr_type,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_tr_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 3327, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setType") < 0)) __PYX_ERR(57, 3327, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_tr_type = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 3327, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlexTransform.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_15DMPlexTransform_12setType(((struct PyPetscDMPlexTransformObject *)__pyx_v_self), __pyx_v_tr_type); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_15DMPlexTransform_12setType(struct PyPetscDMPlexTransformObject *__pyx_v_self, PyObject *__pyx_v_tr_type) { DMPlexTransformType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setType", 0); __Pyx_INCREF(__pyx_v_tr_type); /* "petsc4py/PETSc/DMPlex.pyx":3328 * * def setType(self, tr_type): * cdef PetscDMPlexTransformType cval = NULL # <<<<<<<<<<<<<< * tr_type = str2bytes(tr_type, &cval) * CHKERR( DMPlexTransformSetType(self.tr, cval) ) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/DMPlex.pyx":3329 * def setType(self, tr_type): * cdef PetscDMPlexTransformType cval = NULL * tr_type = str2bytes(tr_type, &cval) # <<<<<<<<<<<<<< * CHKERR( DMPlexTransformSetType(self.tr, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_tr_type, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(57, 3329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_tr_type, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DMPlex.pyx":3330 * cdef PetscDMPlexTransformType cval = NULL * tr_type = str2bytes(tr_type, &cval) * CHKERR( DMPlexTransformSetType(self.tr, cval) ) # <<<<<<<<<<<<<< * * def setDM(self, DM dm): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexTransformSetType(__pyx_v_self->tr, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 3330, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":3327 * return self * * def setType(self, tr_type): # <<<<<<<<<<<<<< * cdef PetscDMPlexTransformType cval = NULL * tr_type = str2bytes(tr_type, &cval) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMPlexTransform.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_tr_type); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":3332 * CHKERR( DMPlexTransformSetType(self.tr, cval) ) * * def setDM(self, DM dm): # <<<<<<<<<<<<<< * CHKERR( DMPlexTransformSetDM(self.tr, dm.dm) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_15DMPlexTransform_15setDM(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_15DMPlexTransform_14setDM, "DMPlexTransform.setDM(self, dm: DM)\nSource code at petsc4py/PETSc/DMPlex.pyx:3332"); static PyObject *__pyx_pw_8petsc4py_5PETSc_15DMPlexTransform_15setDM(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscDMObject *__pyx_v_dm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setDM (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dm,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dm)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 3332, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setDM") < 0)) __PYX_ERR(57, 3332, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_dm = ((struct PyPetscDMObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setDM", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 3332, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlexTransform.setDM", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_ptype_8petsc4py_5PETSc_DM, 0, "dm", 0))) __PYX_ERR(57, 3332, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_15DMPlexTransform_14setDM(((struct PyPetscDMPlexTransformObject *)__pyx_v_self), __pyx_v_dm); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_15DMPlexTransform_14setDM(struct PyPetscDMPlexTransformObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setDM", 1); /* "petsc4py/PETSc/DMPlex.pyx":3333 * * def setDM(self, DM dm): * CHKERR( DMPlexTransformSetDM(self.tr, dm.dm) ) # <<<<<<<<<<<<<< * * def setFromOptions(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexTransformSetDM(__pyx_v_self->tr, __pyx_v_dm->dm)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 3333, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":3332 * CHKERR( DMPlexTransformSetType(self.tr, cval) ) * * def setDM(self, DM dm): # <<<<<<<<<<<<<< * CHKERR( DMPlexTransformSetDM(self.tr, dm.dm) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlexTransform.setDM", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":3335 * CHKERR( DMPlexTransformSetDM(self.tr, dm.dm) ) * * def setFromOptions(self): # <<<<<<<<<<<<<< * CHKERR( DMPlexTransformSetFromOptions(self.tr) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_15DMPlexTransform_17setFromOptions(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_15DMPlexTransform_16setFromOptions, "DMPlexTransform.setFromOptions(self)\nSource code at petsc4py/PETSc/DMPlex.pyx:3335"); static PyObject *__pyx_pw_8petsc4py_5PETSc_15DMPlexTransform_17setFromOptions(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFromOptions (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("setFromOptions", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setFromOptions", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_15DMPlexTransform_16setFromOptions(((struct PyPetscDMPlexTransformObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_15DMPlexTransform_16setFromOptions(struct PyPetscDMPlexTransformObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFromOptions", 1); /* "petsc4py/PETSc/DMPlex.pyx":3336 * * def setFromOptions(self): * CHKERR( DMPlexTransformSetFromOptions(self.tr) ) # <<<<<<<<<<<<<< * * def view(self, Viewer viewer=None): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexTransformSetFromOptions(__pyx_v_self->tr)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 3336, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":3335 * CHKERR( DMPlexTransformSetDM(self.tr, dm.dm) ) * * def setFromOptions(self): # <<<<<<<<<<<<<< * CHKERR( DMPlexTransformSetFromOptions(self.tr) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlexTransform.setFromOptions", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMPlex.pyx":3338 * CHKERR( DMPlexTransformSetFromOptions(self.tr) ) * * def view(self, Viewer viewer=None): # <<<<<<<<<<<<<< * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_15DMPlexTransform_19view(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_15DMPlexTransform_18view, "DMPlexTransform.view(self, viewer: Viewer | None = None)\nSource code at petsc4py/PETSc/DMPlex.pyx:3338"); static PyObject *__pyx_pw_8petsc4py_5PETSc_15DMPlexTransform_19view(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscViewerObject *__pyx_v_viewer = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("view (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscViewerObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_viewer); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 3338, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "view") < 0)) __PYX_ERR(57, 3338, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, __pyx_nargs); __PYX_ERR(57, 3338, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMPlexTransform.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(57, 3338, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_15DMPlexTransform_18view(((struct PyPetscDMPlexTransformObject *)__pyx_v_self), __pyx_v_viewer); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_15DMPlexTransform_18view(struct PyPetscDMPlexTransformObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer) { PetscViewer __pyx_v_vwr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscViewer __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("view", 1); /* "petsc4py/PETSc/DMPlex.pyx":3339 * * def view(self, Viewer viewer=None): * cdef PetscViewer vwr = NULL # <<<<<<<<<<<<<< * if viewer is not None: vwr = viewer.vwr * CHKERR( DMPlexTransformView(self.tr, vwr) ) */ __pyx_v_vwr = NULL; /* "petsc4py/PETSc/DMPlex.pyx":3340 * def view(self, Viewer viewer=None): * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr # <<<<<<<<<<<<<< * CHKERR( DMPlexTransformView(self.tr, vwr) ) */ __pyx_t_1 = (((PyObject *)__pyx_v_viewer) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_viewer->vwr; __pyx_v_vwr = __pyx_t_2; } /* "petsc4py/PETSc/DMPlex.pyx":3341 * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr * CHKERR( DMPlexTransformView(self.tr, vwr) ) # <<<<<<<<<<<<<< */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexTransformView(__pyx_v_self->tr, __pyx_v_vwr)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 3341, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":3338 * CHKERR( DMPlexTransformSetFromOptions(self.tr) ) * * def view(self, Viewer viewer=None): # <<<<<<<<<<<<<< * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlexTransform.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMStag.pyx":46 * StencilLocation = DMStagStencilLocation * * def create( # <<<<<<<<<<<<<< * self, * dim: int, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_1create(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMStag_create, "DMStag.create(self, dim: int, dofs: tuple[int, ...] | None = None, sizes: tuple[int, ...] | None = None, boundary_types: tuple[DM.BoundaryType | int | str | bool, ...] | None = None, stencil_type: StencilType | None = None, stencil_width: int | None = None, proc_sizes: tuple[int, ...] | None = None, ownership_ranges: tuple[Sequence[int], ...] | None = None, comm: Comm | None = None, setUp: bool | None = False) -> Self\nCreate a DMDA object.\n\n Collective.\n\n Creates an object to manage data living on the elements and vertices /\n the elements, faces, and vertices / the elements, faces, edges, and\n vertices of a parallelized regular 1D / 2D / 3D grid.\n\n Parameters\n ----------\n dim\n The number of dimensions.\n dofs\n The number of degrees of freedom per vertex, element (1D); vertex,\n face, element (2D); or vertex, edge, face, element (3D).\n sizes\n The number of elements in each dimension.\n boundary_types\n The boundary types.\n stencil_type\n The ghost/halo stencil type.\n stencil_width\n The width of the ghost/halo region.\n proc_sizes\n The number of processes in x, y, z dimensions.\n ownership_ranges\n Local x, y, z element counts, of length equal to ``proc_sizes``,\n summing to ``sizes``.\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n setUp\n Whether to call the setup routine after creating the object.\n\n See Also\n --------\n petsc.DMStagCreate1d, petsc.DMStagCreate2d, petsc.DMStagCreate3d\n petsc.DMSetUp\n\n \nSource code at petsc4py/PETSc/DMStag.pyx:46"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_1create(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_dim = 0; PyObject *__pyx_v_dofs = 0; PyObject *__pyx_v_sizes = 0; PyObject *__pyx_v_boundary_types = 0; PyObject *__pyx_v_stencil_type = 0; PyObject *__pyx_v_stencil_width = 0; PyObject *__pyx_v_proc_sizes = 0; PyObject *__pyx_v_ownership_ranges = 0; PyObject *__pyx_v_comm = 0; PyObject *__pyx_v_setUp = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dim,&__pyx_n_s_dofs,&__pyx_n_s_sizes,&__pyx_n_s_boundary_types,&__pyx_n_s_stencil_type,&__pyx_n_s_stencil_width,&__pyx_n_s_proc_sizes,&__pyx_n_s_ownership_ranges,&__pyx_n_s_comm,&__pyx_n_s_setUp,0}; /* "petsc4py/PETSc/DMStag.pyx":49 * self, * dim: int, * dofs: tuple[int, ...] | None = None, # <<<<<<<<<<<<<< * sizes: tuple[int, ...] | None = None, * boundary_types: tuple[DM.BoundaryType | int | str | bool, ...] | None = None, */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/DMStag.pyx":50 * dim: int, * dofs: tuple[int, ...] | None = None, * sizes: tuple[int, ...] | None = None, # <<<<<<<<<<<<<< * boundary_types: tuple[DM.BoundaryType | int | str | bool, ...] | None = None, * stencil_type: StencilType | None = None, */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/DMStag.pyx":51 * dofs: tuple[int, ...] | None = None, * sizes: tuple[int, ...] | None = None, * boundary_types: tuple[DM.BoundaryType | int | str | bool, ...] | None = None, # <<<<<<<<<<<<<< * stencil_type: StencilType | None = None, * stencil_width: int | None = None, */ values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/DMStag.pyx":52 * sizes: tuple[int, ...] | None = None, * boundary_types: tuple[DM.BoundaryType | int | str | bool, ...] | None = None, * stencil_type: StencilType | None = None, # <<<<<<<<<<<<<< * stencil_width: int | None = None, * proc_sizes: tuple[int, ...] | None = None, */ values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/DMStag.pyx":53 * boundary_types: tuple[DM.BoundaryType | int | str | bool, ...] | None = None, * stencil_type: StencilType | None = None, * stencil_width: int | None = None, # <<<<<<<<<<<<<< * proc_sizes: tuple[int, ...] | None = None, * ownership_ranges: tuple[Sequence[int], ...] | None = None, */ values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/DMStag.pyx":54 * stencil_type: StencilType | None = None, * stencil_width: int | None = None, * proc_sizes: tuple[int, ...] | None = None, # <<<<<<<<<<<<<< * ownership_ranges: tuple[Sequence[int], ...] | None = None, * comm: Comm | None = None, */ values[6] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/DMStag.pyx":55 * stencil_width: int | None = None, * proc_sizes: tuple[int, ...] | None = None, * ownership_ranges: tuple[Sequence[int], ...] | None = None, # <<<<<<<<<<<<<< * comm: Comm | None = None, * setUp: bool | None = False, */ values[7] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/DMStag.pyx":56 * proc_sizes: tuple[int, ...] | None = None, * ownership_ranges: tuple[Sequence[int], ...] | None = None, * comm: Comm | None = None, # <<<<<<<<<<<<<< * setUp: bool | None = False, * ) -> Self: */ values[8] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/DMStag.pyx":57 * ownership_ranges: tuple[Sequence[int], ...] | None = None, * comm: Comm | None = None, * setUp: bool | None = False, # <<<<<<<<<<<<<< * ) -> Self: * """Create a DMDA object. */ values[9] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9); CYTHON_FALLTHROUGH; case 9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8); CYTHON_FALLTHROUGH; case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); CYTHON_FALLTHROUGH; case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dim)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(58, 46, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dofs); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(58, 46, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sizes); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(58, 46, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_boundary_types); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(58, 46, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_stencil_type); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(58, 46, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_stencil_width); if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(58, 46, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 6: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_proc_sizes); if (value) { values[6] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(58, 46, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 7: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ownership_ranges); if (value) { values[7] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(58, 46, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 8: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[8] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(58, 46, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 9: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_setUp); if (value) { values[9] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(58, 46, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "create") < 0)) __PYX_ERR(58, 46, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9); CYTHON_FALLTHROUGH; case 9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8); CYTHON_FALLTHROUGH; case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); CYTHON_FALLTHROUGH; case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_dim = values[0]; __pyx_v_dofs = values[1]; __pyx_v_sizes = values[2]; __pyx_v_boundary_types = values[3]; __pyx_v_stencil_type = values[4]; __pyx_v_stencil_width = values[5]; __pyx_v_proc_sizes = values[6]; __pyx_v_ownership_ranges = values[7]; __pyx_v_comm = values[8]; __pyx_v_setUp = values[9]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("create", 0, 1, 10, __pyx_nargs); __PYX_ERR(58, 46, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMStag.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_create(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self), __pyx_v_dim, __pyx_v_dofs, __pyx_v_sizes, __pyx_v_boundary_types, __pyx_v_stencil_type, __pyx_v_stencil_width, __pyx_v_proc_sizes, __pyx_v_ownership_ranges, __pyx_v_comm, __pyx_v_setUp); /* "petsc4py/PETSc/DMStag.pyx":46 * StencilLocation = DMStagStencilLocation * * def create( # <<<<<<<<<<<<<< * self, * dim: int, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_create(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_dim, PyObject *__pyx_v_dofs, PyObject *__pyx_v_sizes, PyObject *__pyx_v_boundary_types, PyObject *__pyx_v_stencil_type, PyObject *__pyx_v_stencil_width, PyObject *__pyx_v_proc_sizes, PyObject *__pyx_v_ownership_ranges, PyObject *__pyx_v_comm, PyObject *__pyx_v_setUp) { PetscInt __pyx_v_ndim; PyObject *__pyx_v_gsizes = 0; PetscInt __pyx_v_nsizes; PetscInt __pyx_v_M; PetscInt __pyx_v_N; PetscInt __pyx_v_P; PyObject *__pyx_v_cdofs = 0; PetscInt __pyx_v_ndofs; PetscInt __pyx_v_dof0; PetscInt __pyx_v_dof1; PetscInt __pyx_v_dof2; PetscInt __pyx_v_dof3; DMBoundaryType __pyx_v_btx; DMBoundaryType __pyx_v_bty; DMBoundaryType __pyx_v_btz; PetscInt __pyx_v_swidth; DMStagStencilType __pyx_v_stype; MPI_Comm __pyx_v_ccomm; PyObject *__pyx_v_psizes = 0; PetscInt __pyx_v_nprocs; PetscInt __pyx_v_m; PetscInt __pyx_v_n; PetscInt __pyx_v_p; PetscInt *__pyx_v_lx; PetscInt *__pyx_v_ly; PetscInt *__pyx_v_lz; PyObject *__pyx_v_nranges = NULL; DM __pyx_v_newda; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; DMStagStencilType __pyx_t_3; MPI_Comm __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PetscErrorCode __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create", 1); /* "petsc4py/PETSc/DMStag.pyx":99 * """ * # ndim * cdef PetscInt ndim = asInt(dim) # <<<<<<<<<<<<<< * * # sizes */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_dim); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(58, 99, __pyx_L1_error) __pyx_v_ndim = __pyx_t_1; /* "petsc4py/PETSc/DMStag.pyx":102 * * # sizes * cdef object gsizes = sizes # <<<<<<<<<<<<<< * cdef PetscInt nsizes=PETSC_DECIDE, M=1, N=1, P=1 * if sizes is not None: */ __Pyx_INCREF(__pyx_v_sizes); __pyx_v_gsizes = __pyx_v_sizes; /* "petsc4py/PETSc/DMStag.pyx":103 * # sizes * cdef object gsizes = sizes * cdef PetscInt nsizes=PETSC_DECIDE, M=1, N=1, P=1 # <<<<<<<<<<<<<< * if sizes is not None: * nsizes = asStagDims(gsizes, &M, &N, &P) */ __pyx_v_nsizes = PETSC_DECIDE; __pyx_v_M = 1; __pyx_v_N = 1; __pyx_v_P = 1; /* "petsc4py/PETSc/DMStag.pyx":104 * cdef object gsizes = sizes * cdef PetscInt nsizes=PETSC_DECIDE, M=1, N=1, P=1 * if sizes is not None: # <<<<<<<<<<<<<< * nsizes = asStagDims(gsizes, &M, &N, &P) * assert(nsizes==ndim) */ __pyx_t_2 = (__pyx_v_sizes != Py_None); if (__pyx_t_2) { /* "petsc4py/PETSc/DMStag.pyx":105 * cdef PetscInt nsizes=PETSC_DECIDE, M=1, N=1, P=1 * if sizes is not None: * nsizes = asStagDims(gsizes, &M, &N, &P) # <<<<<<<<<<<<<< * assert(nsizes==ndim) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asStagDims(__pyx_v_gsizes, (&__pyx_v_M), (&__pyx_v_N), (&__pyx_v_P)); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(58, 105, __pyx_L1_error) __pyx_v_nsizes = __pyx_t_1; /* "petsc4py/PETSc/DMStag.pyx":106 * if sizes is not None: * nsizes = asStagDims(gsizes, &M, &N, &P) * assert(nsizes==ndim) # <<<<<<<<<<<<<< * * # dofs */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_2 = (__pyx_v_nsizes == __pyx_v_ndim); if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(58, 106, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(58, 106, __pyx_L1_error) #endif /* "petsc4py/PETSc/DMStag.pyx":104 * cdef object gsizes = sizes * cdef PetscInt nsizes=PETSC_DECIDE, M=1, N=1, P=1 * if sizes is not None: # <<<<<<<<<<<<<< * nsizes = asStagDims(gsizes, &M, &N, &P) * assert(nsizes==ndim) */ } /* "petsc4py/PETSc/DMStag.pyx":109 * * # dofs * cdef object cdofs = dofs # <<<<<<<<<<<<<< * cdef PetscInt ndofs=PETSC_DECIDE, dof0=1, dof1=0, dof2=0, dof3=0 * if dofs is not None: */ __Pyx_INCREF(__pyx_v_dofs); __pyx_v_cdofs = __pyx_v_dofs; /* "petsc4py/PETSc/DMStag.pyx":110 * # dofs * cdef object cdofs = dofs * cdef PetscInt ndofs=PETSC_DECIDE, dof0=1, dof1=0, dof2=0, dof3=0 # <<<<<<<<<<<<<< * if dofs is not None: * ndofs = asDofs(cdofs, &dof0, &dof1, &dof2, &dof3) */ __pyx_v_ndofs = PETSC_DECIDE; __pyx_v_dof0 = 1; __pyx_v_dof1 = 0; __pyx_v_dof2 = 0; __pyx_v_dof3 = 0; /* "petsc4py/PETSc/DMStag.pyx":111 * cdef object cdofs = dofs * cdef PetscInt ndofs=PETSC_DECIDE, dof0=1, dof1=0, dof2=0, dof3=0 * if dofs is not None: # <<<<<<<<<<<<<< * ndofs = asDofs(cdofs, &dof0, &dof1, &dof2, &dof3) * assert(ndofs==ndim+1) */ __pyx_t_2 = (__pyx_v_dofs != Py_None); if (__pyx_t_2) { /* "petsc4py/PETSc/DMStag.pyx":112 * cdef PetscInt ndofs=PETSC_DECIDE, dof0=1, dof1=0, dof2=0, dof3=0 * if dofs is not None: * ndofs = asDofs(cdofs, &dof0, &dof1, &dof2, &dof3) # <<<<<<<<<<<<<< * assert(ndofs==ndim+1) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asDofs(__pyx_v_cdofs, (&__pyx_v_dof0), (&__pyx_v_dof1), (&__pyx_v_dof2), (&__pyx_v_dof3)); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(58, 112, __pyx_L1_error) __pyx_v_ndofs = __pyx_t_1; /* "petsc4py/PETSc/DMStag.pyx":113 * if dofs is not None: * ndofs = asDofs(cdofs, &dof0, &dof1, &dof2, &dof3) * assert(ndofs==ndim+1) # <<<<<<<<<<<<<< * * # boundary types */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_2 = (__pyx_v_ndofs == (__pyx_v_ndim + 1)); if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(58, 113, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(58, 113, __pyx_L1_error) #endif /* "petsc4py/PETSc/DMStag.pyx":111 * cdef object cdofs = dofs * cdef PetscInt ndofs=PETSC_DECIDE, dof0=1, dof1=0, dof2=0, dof3=0 * if dofs is not None: # <<<<<<<<<<<<<< * ndofs = asDofs(cdofs, &dof0, &dof1, &dof2, &dof3) * assert(ndofs==ndim+1) */ } /* "petsc4py/PETSc/DMStag.pyx":116 * * # boundary types * cdef PetscDMBoundaryType btx = DM_BOUNDARY_NONE # <<<<<<<<<<<<<< * cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE */ __pyx_v_btx = DM_BOUNDARY_NONE; /* "petsc4py/PETSc/DMStag.pyx":117 * # boundary types * cdef PetscDMBoundaryType btx = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE # <<<<<<<<<<<<<< * cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE * asBoundary(boundary_types, &btx, &bty, &btz) */ __pyx_v_bty = DM_BOUNDARY_NONE; /* "petsc4py/PETSc/DMStag.pyx":118 * cdef PetscDMBoundaryType btx = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE # <<<<<<<<<<<<<< * asBoundary(boundary_types, &btx, &bty, &btz) * */ __pyx_v_btz = DM_BOUNDARY_NONE; /* "petsc4py/PETSc/DMStag.pyx":119 * cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE * asBoundary(boundary_types, &btx, &bty, &btz) # <<<<<<<<<<<<<< * * # stencil */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asBoundary(__pyx_v_boundary_types, (&__pyx_v_btx), (&__pyx_v_bty), (&__pyx_v_btz)); if (unlikely(__pyx_t_1 == ((PetscInt)-1L))) __PYX_ERR(58, 119, __pyx_L1_error) /* "petsc4py/PETSc/DMStag.pyx":122 * * # stencil * cdef PetscInt swidth = 0 # <<<<<<<<<<<<<< * if stencil_width is not None: * swidth = asInt(stencil_width) */ __pyx_v_swidth = 0; /* "petsc4py/PETSc/DMStag.pyx":123 * # stencil * cdef PetscInt swidth = 0 * if stencil_width is not None: # <<<<<<<<<<<<<< * swidth = asInt(stencil_width) * cdef PetscDMStagStencilType stype = DMSTAG_STENCIL_NONE */ __pyx_t_2 = (__pyx_v_stencil_width != Py_None); if (__pyx_t_2) { /* "petsc4py/PETSc/DMStag.pyx":124 * cdef PetscInt swidth = 0 * if stencil_width is not None: * swidth = asInt(stencil_width) # <<<<<<<<<<<<<< * cdef PetscDMStagStencilType stype = DMSTAG_STENCIL_NONE * if stencil_type is not None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_stencil_width); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(58, 124, __pyx_L1_error) __pyx_v_swidth = __pyx_t_1; /* "petsc4py/PETSc/DMStag.pyx":123 * # stencil * cdef PetscInt swidth = 0 * if stencil_width is not None: # <<<<<<<<<<<<<< * swidth = asInt(stencil_width) * cdef PetscDMStagStencilType stype = DMSTAG_STENCIL_NONE */ } /* "petsc4py/PETSc/DMStag.pyx":125 * if stencil_width is not None: * swidth = asInt(stencil_width) * cdef PetscDMStagStencilType stype = DMSTAG_STENCIL_NONE # <<<<<<<<<<<<<< * if stencil_type is not None: * stype = asStagStencil(stencil_type) */ __pyx_v_stype = DMSTAG_STENCIL_NONE; /* "petsc4py/PETSc/DMStag.pyx":126 * swidth = asInt(stencil_width) * cdef PetscDMStagStencilType stype = DMSTAG_STENCIL_NONE * if stencil_type is not None: # <<<<<<<<<<<<<< * stype = asStagStencil(stencil_type) * */ __pyx_t_2 = (__pyx_v_stencil_type != Py_None); if (__pyx_t_2) { /* "petsc4py/PETSc/DMStag.pyx":127 * cdef PetscDMStagStencilType stype = DMSTAG_STENCIL_NONE * if stencil_type is not None: * stype = asStagStencil(stencil_type) # <<<<<<<<<<<<<< * * # comm */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asStagStencil(__pyx_v_stencil_type); if (unlikely(__pyx_t_3 == ((DMStagStencilType)((DMStagStencilType)-1L)))) __PYX_ERR(58, 127, __pyx_L1_error) __pyx_v_stype = __pyx_t_3; /* "petsc4py/PETSc/DMStag.pyx":126 * swidth = asInt(stencil_width) * cdef PetscDMStagStencilType stype = DMSTAG_STENCIL_NONE * if stencil_type is not None: # <<<<<<<<<<<<<< * stype = asStagStencil(stencil_type) * */ } /* "petsc4py/PETSc/DMStag.pyx":130 * * # comm * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * * # proc sizes */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_4 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(58, 130, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_4; /* "petsc4py/PETSc/DMStag.pyx":133 * * # proc sizes * cdef object psizes = proc_sizes # <<<<<<<<<<<<<< * cdef PetscInt nprocs=PETSC_DECIDE, m=PETSC_DECIDE, n=PETSC_DECIDE, p=PETSC_DECIDE * if proc_sizes is not None: */ __Pyx_INCREF(__pyx_v_proc_sizes); __pyx_v_psizes = __pyx_v_proc_sizes; /* "petsc4py/PETSc/DMStag.pyx":134 * # proc sizes * cdef object psizes = proc_sizes * cdef PetscInt nprocs=PETSC_DECIDE, m=PETSC_DECIDE, n=PETSC_DECIDE, p=PETSC_DECIDE # <<<<<<<<<<<<<< * if proc_sizes is not None: * nprocs = asStagDims(psizes, &m, &n, &p) */ __pyx_v_nprocs = PETSC_DECIDE; __pyx_v_m = PETSC_DECIDE; __pyx_v_n = PETSC_DECIDE; __pyx_v_p = PETSC_DECIDE; /* "petsc4py/PETSc/DMStag.pyx":135 * cdef object psizes = proc_sizes * cdef PetscInt nprocs=PETSC_DECIDE, m=PETSC_DECIDE, n=PETSC_DECIDE, p=PETSC_DECIDE * if proc_sizes is not None: # <<<<<<<<<<<<<< * nprocs = asStagDims(psizes, &m, &n, &p) * assert(nprocs==ndim) */ __pyx_t_2 = (__pyx_v_proc_sizes != Py_None); if (__pyx_t_2) { /* "petsc4py/PETSc/DMStag.pyx":136 * cdef PetscInt nprocs=PETSC_DECIDE, m=PETSC_DECIDE, n=PETSC_DECIDE, p=PETSC_DECIDE * if proc_sizes is not None: * nprocs = asStagDims(psizes, &m, &n, &p) # <<<<<<<<<<<<<< * assert(nprocs==ndim) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asStagDims(__pyx_v_psizes, (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_p)); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(58, 136, __pyx_L1_error) __pyx_v_nprocs = __pyx_t_1; /* "petsc4py/PETSc/DMStag.pyx":137 * if proc_sizes is not None: * nprocs = asStagDims(psizes, &m, &n, &p) * assert(nprocs==ndim) # <<<<<<<<<<<<<< * * # ownership ranges */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_2 = (__pyx_v_nprocs == __pyx_v_ndim); if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(58, 137, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(58, 137, __pyx_L1_error) #endif /* "petsc4py/PETSc/DMStag.pyx":135 * cdef object psizes = proc_sizes * cdef PetscInt nprocs=PETSC_DECIDE, m=PETSC_DECIDE, n=PETSC_DECIDE, p=PETSC_DECIDE * if proc_sizes is not None: # <<<<<<<<<<<<<< * nprocs = asStagDims(psizes, &m, &n, &p) * assert(nprocs==ndim) */ } /* "petsc4py/PETSc/DMStag.pyx":140 * * # ownership ranges * cdef PetscInt *lx = NULL, *ly = NULL, *lz = NULL # <<<<<<<<<<<<<< * if ownership_ranges is not None: * nranges = asStagOwnershipRanges(ownership_ranges, ndim, &m, &n, &p, &lx, &ly, &lz) */ __pyx_v_lx = NULL; __pyx_v_ly = NULL; __pyx_v_lz = NULL; /* "petsc4py/PETSc/DMStag.pyx":141 * # ownership ranges * cdef PetscInt *lx = NULL, *ly = NULL, *lz = NULL * if ownership_ranges is not None: # <<<<<<<<<<<<<< * nranges = asStagOwnershipRanges(ownership_ranges, ndim, &m, &n, &p, &lx, &ly, &lz) * assert(nranges==ndim) */ __pyx_t_2 = (__pyx_v_ownership_ranges != Py_None); if (__pyx_t_2) { /* "petsc4py/PETSc/DMStag.pyx":142 * cdef PetscInt *lx = NULL, *ly = NULL, *lz = NULL * if ownership_ranges is not None: * nranges = asStagOwnershipRanges(ownership_ranges, ndim, &m, &n, &p, &lx, &ly, &lz) # <<<<<<<<<<<<<< * assert(nranges==ndim) * */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_asStagOwnershipRanges(__pyx_v_ownership_ranges, __pyx_v_ndim, (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_p), (&__pyx_v_lx), (&__pyx_v_ly), (&__pyx_v_lz)); if (unlikely(!__pyx_t_5)) __PYX_ERR(58, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_v_nranges = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/DMStag.pyx":143 * if ownership_ranges is not None: * nranges = asStagOwnershipRanges(ownership_ranges, ndim, &m, &n, &p, &lx, &ly, &lz) * assert(nranges==ndim) # <<<<<<<<<<<<<< * * # create */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_5 = __Pyx_PyInt_From_PetscInt(__pyx_v_ndim); if (unlikely(!__pyx_t_5)) __PYX_ERR(58, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyObject_RichCompare(__pyx_v_nranges, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(58, 143, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(58, 143, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(58, 143, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(58, 143, __pyx_L1_error) #endif /* "petsc4py/PETSc/DMStag.pyx":141 * # ownership ranges * cdef PetscInt *lx = NULL, *ly = NULL, *lz = NULL * if ownership_ranges is not None: # <<<<<<<<<<<<<< * nranges = asStagOwnershipRanges(ownership_ranges, ndim, &m, &n, &p, &lx, &ly, &lz) * assert(nranges==ndim) */ } /* "petsc4py/PETSc/DMStag.pyx":146 * * # create * cdef PetscDM newda = NULL # <<<<<<<<<<<<<< * if dim == 1: * CHKERR( DMStagCreate1d(ccomm, btx, M, dof0, dof1, stype, swidth, lx, &newda) ) */ __pyx_v_newda = NULL; /* "petsc4py/PETSc/DMStag.pyx":147 * # create * cdef PetscDM newda = NULL * if dim == 1: # <<<<<<<<<<<<<< * CHKERR( DMStagCreate1d(ccomm, btx, M, dof0, dof1, stype, swidth, lx, &newda) ) * if dim == 2: */ __pyx_t_2 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_dim, __pyx_int_1, 1, 0)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(58, 147, __pyx_L1_error) if (__pyx_t_2) { /* "petsc4py/PETSc/DMStag.pyx":148 * cdef PetscDM newda = NULL * if dim == 1: * CHKERR( DMStagCreate1d(ccomm, btx, M, dof0, dof1, stype, swidth, lx, &newda) ) # <<<<<<<<<<<<<< * if dim == 2: * CHKERR( DMStagCreate2d(ccomm, btx, bty, M, N, m, n, dof0, dof1, dof2, stype, swidth, lx, ly, &newda) ) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMStagCreate1d(__pyx_v_ccomm, __pyx_v_btx, __pyx_v_M, __pyx_v_dof0, __pyx_v_dof1, __pyx_v_stype, __pyx_v_swidth, __pyx_v_lx, (&__pyx_v_newda))); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(58, 148, __pyx_L1_error) /* "petsc4py/PETSc/DMStag.pyx":147 * # create * cdef PetscDM newda = NULL * if dim == 1: # <<<<<<<<<<<<<< * CHKERR( DMStagCreate1d(ccomm, btx, M, dof0, dof1, stype, swidth, lx, &newda) ) * if dim == 2: */ } /* "petsc4py/PETSc/DMStag.pyx":149 * if dim == 1: * CHKERR( DMStagCreate1d(ccomm, btx, M, dof0, dof1, stype, swidth, lx, &newda) ) * if dim == 2: # <<<<<<<<<<<<<< * CHKERR( DMStagCreate2d(ccomm, btx, bty, M, N, m, n, dof0, dof1, dof2, stype, swidth, lx, ly, &newda) ) * if dim == 3: */ __pyx_t_2 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_dim, __pyx_int_2, 2, 0)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(58, 149, __pyx_L1_error) if (__pyx_t_2) { /* "petsc4py/PETSc/DMStag.pyx":150 * CHKERR( DMStagCreate1d(ccomm, btx, M, dof0, dof1, stype, swidth, lx, &newda) ) * if dim == 2: * CHKERR( DMStagCreate2d(ccomm, btx, bty, M, N, m, n, dof0, dof1, dof2, stype, swidth, lx, ly, &newda) ) # <<<<<<<<<<<<<< * if dim == 3: * CHKERR( DMStagCreate3d(ccomm, btx, bty, btz, M, N, P, m, n, p, dof0, dof1, dof2, dof3, stype, swidth, lx, ly, lz, &newda) ) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMStagCreate2d(__pyx_v_ccomm, __pyx_v_btx, __pyx_v_bty, __pyx_v_M, __pyx_v_N, __pyx_v_m, __pyx_v_n, __pyx_v_dof0, __pyx_v_dof1, __pyx_v_dof2, __pyx_v_stype, __pyx_v_swidth, __pyx_v_lx, __pyx_v_ly, (&__pyx_v_newda))); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(58, 150, __pyx_L1_error) /* "petsc4py/PETSc/DMStag.pyx":149 * if dim == 1: * CHKERR( DMStagCreate1d(ccomm, btx, M, dof0, dof1, stype, swidth, lx, &newda) ) * if dim == 2: # <<<<<<<<<<<<<< * CHKERR( DMStagCreate2d(ccomm, btx, bty, M, N, m, n, dof0, dof1, dof2, stype, swidth, lx, ly, &newda) ) * if dim == 3: */ } /* "petsc4py/PETSc/DMStag.pyx":151 * if dim == 2: * CHKERR( DMStagCreate2d(ccomm, btx, bty, M, N, m, n, dof0, dof1, dof2, stype, swidth, lx, ly, &newda) ) * if dim == 3: # <<<<<<<<<<<<<< * CHKERR( DMStagCreate3d(ccomm, btx, bty, btz, M, N, P, m, n, p, dof0, dof1, dof2, dof3, stype, swidth, lx, ly, lz, &newda) ) * CHKERR( PetscCLEAR(self.obj) ); self.dm = newda */ __pyx_t_2 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_dim, __pyx_int_3, 3, 0)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(58, 151, __pyx_L1_error) if (__pyx_t_2) { /* "petsc4py/PETSc/DMStag.pyx":152 * CHKERR( DMStagCreate2d(ccomm, btx, bty, M, N, m, n, dof0, dof1, dof2, stype, swidth, lx, ly, &newda) ) * if dim == 3: * CHKERR( DMStagCreate3d(ccomm, btx, bty, btz, M, N, P, m, n, p, dof0, dof1, dof2, dof3, stype, swidth, lx, ly, lz, &newda) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.dm = newda * if setUp: */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMStagCreate3d(__pyx_v_ccomm, __pyx_v_btx, __pyx_v_bty, __pyx_v_btz, __pyx_v_M, __pyx_v_N, __pyx_v_P, __pyx_v_m, __pyx_v_n, __pyx_v_p, __pyx_v_dof0, __pyx_v_dof1, __pyx_v_dof2, __pyx_v_dof3, __pyx_v_stype, __pyx_v_swidth, __pyx_v_lx, __pyx_v_ly, __pyx_v_lz, (&__pyx_v_newda))); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(58, 152, __pyx_L1_error) /* "petsc4py/PETSc/DMStag.pyx":151 * if dim == 2: * CHKERR( DMStagCreate2d(ccomm, btx, bty, M, N, m, n, dof0, dof1, dof2, stype, swidth, lx, ly, &newda) ) * if dim == 3: # <<<<<<<<<<<<<< * CHKERR( DMStagCreate3d(ccomm, btx, bty, btz, M, N, P, m, n, p, dof0, dof1, dof2, dof3, stype, swidth, lx, ly, lz, &newda) ) * CHKERR( PetscCLEAR(self.obj) ); self.dm = newda */ } /* "petsc4py/PETSc/DMStag.pyx":153 * if dim == 3: * CHKERR( DMStagCreate3d(ccomm, btx, bty, btz, M, N, P, m, n, p, dof0, dof1, dof2, dof3, stype, swidth, lx, ly, lz, &newda) ) * CHKERR( PetscCLEAR(self.obj) ); self.dm = newda # <<<<<<<<<<<<<< * if setUp: * CHKERR( DMSetUp(self.dm) ) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.__pyx_base.obj)); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(58, 153, __pyx_L1_error) __pyx_v_self->__pyx_base.dm = __pyx_v_newda; /* "petsc4py/PETSc/DMStag.pyx":154 * CHKERR( DMStagCreate3d(ccomm, btx, bty, btz, M, N, P, m, n, p, dof0, dof1, dof2, dof3, stype, swidth, lx, ly, lz, &newda) ) * CHKERR( PetscCLEAR(self.obj) ); self.dm = newda * if setUp: # <<<<<<<<<<<<<< * CHKERR( DMSetUp(self.dm) ) * return self */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_setUp); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(58, 154, __pyx_L1_error) if (__pyx_t_2) { /* "petsc4py/PETSc/DMStag.pyx":155 * CHKERR( PetscCLEAR(self.obj) ); self.dm = newda * if setUp: * CHKERR( DMSetUp(self.dm) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSetUp(__pyx_v_self->__pyx_base.dm)); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(58, 155, __pyx_L1_error) /* "petsc4py/PETSc/DMStag.pyx":154 * CHKERR( DMStagCreate3d(ccomm, btx, bty, btz, M, N, P, m, n, p, dof0, dof1, dof2, dof3, stype, swidth, lx, ly, lz, &newda) ) * CHKERR( PetscCLEAR(self.obj) ); self.dm = newda * if setUp: # <<<<<<<<<<<<<< * CHKERR( DMSetUp(self.dm) ) * return self */ } /* "petsc4py/PETSc/DMStag.pyx":156 * if setUp: * CHKERR( DMSetUp(self.dm) ) * return self # <<<<<<<<<<<<<< * * # Setters */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/DMStag.pyx":46 * StencilLocation = DMStagStencilLocation * * def create( # <<<<<<<<<<<<<< * self, * dim: int, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_gsizes); __Pyx_XDECREF(__pyx_v_cdofs); __Pyx_XDECREF(__pyx_v_psizes); __Pyx_XDECREF(__pyx_v_nranges); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMStag.pyx":160 * # Setters * * def setStencilWidth(self, swidth: int) -> None: # <<<<<<<<<<<<<< * """Set elementwise stencil width. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_3setStencilWidth(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMStag_2setStencilWidth, "DMStag.setStencilWidth(self, swidth: int) -> None\nSet elementwise stencil width.\n\n Logically collective.\n\n The width value is not used when `StencilType.NONE` is specified.\n\n Parameters\n ----------\n swidth\n Stencil/halo/ghost width in elements.\n\n See Also\n --------\n petsc.DMStagSetStencilWidth\n\n \nSource code at petsc4py/PETSc/DMStag.pyx:160"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_3setStencilWidth(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_swidth = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setStencilWidth (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_swidth,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_swidth)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(58, 160, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setStencilWidth") < 0)) __PYX_ERR(58, 160, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_swidth = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setStencilWidth", 1, 1, 1, __pyx_nargs); __PYX_ERR(58, 160, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMStag.setStencilWidth", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_2setStencilWidth(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self), __pyx_v_swidth); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_2setStencilWidth(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_swidth) { PetscInt __pyx_v_sw; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setStencilWidth", 1); /* "petsc4py/PETSc/DMStag.pyx":177 * * """ * cdef PetscInt sw = asInt(swidth) # <<<<<<<<<<<<<< * CHKERR( DMStagSetStencilWidth(self.dm, sw) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_swidth); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(58, 177, __pyx_L1_error) __pyx_v_sw = __pyx_t_1; /* "petsc4py/PETSc/DMStag.pyx":178 * """ * cdef PetscInt sw = asInt(swidth) * CHKERR( DMStagSetStencilWidth(self.dm, sw) ) # <<<<<<<<<<<<<< * * def setStencilType(self, stenciltype: StencilType | str) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMStagSetStencilWidth(__pyx_v_self->__pyx_base.dm, __pyx_v_sw)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(58, 178, __pyx_L1_error) /* "petsc4py/PETSc/DMStag.pyx":160 * # Setters * * def setStencilWidth(self, swidth: int) -> None: # <<<<<<<<<<<<<< * """Set elementwise stencil width. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMStag.setStencilWidth", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMStag.pyx":180 * CHKERR( DMStagSetStencilWidth(self.dm, sw) ) * * def setStencilType(self, stenciltype: StencilType | str) -> None: # <<<<<<<<<<<<<< * """Set elementwise ghost/halo stencil type. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_5setStencilType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMStag_4setStencilType, "DMStag.setStencilType(self, stenciltype: StencilType | str) -> None\nSet elementwise ghost/halo stencil type.\n\n Logically collective.\n\n Parameters\n ----------\n stenciltype\n The elementwise ghost stencil type.\n\n See Also\n --------\n getStencilType, petsc.DMStagSetStencilType\n\n \nSource code at petsc4py/PETSc/DMStag.pyx:180"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_5setStencilType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_stenciltype = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setStencilType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stenciltype,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_stenciltype)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(58, 180, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setStencilType") < 0)) __PYX_ERR(58, 180, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_stenciltype = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setStencilType", 1, 1, 1, __pyx_nargs); __PYX_ERR(58, 180, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMStag.setStencilType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_4setStencilType(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self), __pyx_v_stenciltype); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_4setStencilType(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_stenciltype) { DMStagStencilType __pyx_v_stype; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations DMStagStencilType __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setStencilType", 1); /* "petsc4py/PETSc/DMStag.pyx":195 * * """ * cdef PetscDMStagStencilType stype = asStagStencil(stenciltype) # <<<<<<<<<<<<<< * CHKERR( DMStagSetStencilType(self.dm, stype) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asStagStencil(__pyx_v_stenciltype); if (unlikely(__pyx_t_1 == ((DMStagStencilType)((DMStagStencilType)-1L)))) __PYX_ERR(58, 195, __pyx_L1_error) __pyx_v_stype = __pyx_t_1; /* "petsc4py/PETSc/DMStag.pyx":196 * """ * cdef PetscDMStagStencilType stype = asStagStencil(stenciltype) * CHKERR( DMStagSetStencilType(self.dm, stype) ) # <<<<<<<<<<<<<< * * def setBoundaryTypes( */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMStagSetStencilType(__pyx_v_self->__pyx_base.dm, __pyx_v_stype)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(58, 196, __pyx_L1_error) /* "petsc4py/PETSc/DMStag.pyx":180 * CHKERR( DMStagSetStencilWidth(self.dm, sw) ) * * def setStencilType(self, stenciltype: StencilType | str) -> None: # <<<<<<<<<<<<<< * """Set elementwise ghost/halo stencil type. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMStag.setStencilType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMStag.pyx":198 * CHKERR( DMStagSetStencilType(self.dm, stype) ) * * def setBoundaryTypes( # <<<<<<<<<<<<<< * self, * boundary_types: tuple[DM.BoundaryType | int | str | bool, ...], */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_7setBoundaryTypes(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMStag_6setBoundaryTypes, "DMStag.setBoundaryTypes(self, boundary_types: tuple[DM.BoundaryType | int | str | bool, ...]) -> None\nSet the boundary types.\n\n Logically collective.\n\n Parameters\n ----------\n boundary_types\n Boundary types for one/two/three dimensions.\n\n See Also\n --------\n getBoundaryTypes, petsc.DMStagSetBoundaryTypes\n\n \nSource code at petsc4py/PETSc/DMStag.pyx:198"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_7setBoundaryTypes(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_boundary_types = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setBoundaryTypes (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_boundary_types,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_boundary_types)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(58, 198, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setBoundaryTypes") < 0)) __PYX_ERR(58, 198, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_boundary_types = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setBoundaryTypes", 1, 1, 1, __pyx_nargs); __PYX_ERR(58, 198, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMStag.setBoundaryTypes", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_6setBoundaryTypes(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self), __pyx_v_boundary_types); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_6setBoundaryTypes(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_boundary_types) { DMBoundaryType __pyx_v_btx; DMBoundaryType __pyx_v_bty; DMBoundaryType __pyx_v_btz; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setBoundaryTypes", 1); /* "petsc4py/PETSc/DMStag.pyx":216 * * """ * cdef PetscDMBoundaryType btx = DM_BOUNDARY_NONE # <<<<<<<<<<<<<< * cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE */ __pyx_v_btx = DM_BOUNDARY_NONE; /* "petsc4py/PETSc/DMStag.pyx":217 * """ * cdef PetscDMBoundaryType btx = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE # <<<<<<<<<<<<<< * cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE * asBoundary(boundary_types, &btx, &bty, &btz) */ __pyx_v_bty = DM_BOUNDARY_NONE; /* "petsc4py/PETSc/DMStag.pyx":218 * cdef PetscDMBoundaryType btx = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE # <<<<<<<<<<<<<< * asBoundary(boundary_types, &btx, &bty, &btz) * CHKERR( DMStagSetBoundaryTypes(self.dm, btx, bty, btz) ) */ __pyx_v_btz = DM_BOUNDARY_NONE; /* "petsc4py/PETSc/DMStag.pyx":219 * cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE * asBoundary(boundary_types, &btx, &bty, &btz) # <<<<<<<<<<<<<< * CHKERR( DMStagSetBoundaryTypes(self.dm, btx, bty, btz) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asBoundary(__pyx_v_boundary_types, (&__pyx_v_btx), (&__pyx_v_bty), (&__pyx_v_btz)); if (unlikely(__pyx_t_1 == ((PetscInt)-1L))) __PYX_ERR(58, 219, __pyx_L1_error) /* "petsc4py/PETSc/DMStag.pyx":220 * cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE * asBoundary(boundary_types, &btx, &bty, &btz) * CHKERR( DMStagSetBoundaryTypes(self.dm, btx, bty, btz) ) # <<<<<<<<<<<<<< * * def setDof(self, dofs: tuple[int, ...]) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMStagSetBoundaryTypes(__pyx_v_self->__pyx_base.dm, __pyx_v_btx, __pyx_v_bty, __pyx_v_btz)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(58, 220, __pyx_L1_error) /* "petsc4py/PETSc/DMStag.pyx":198 * CHKERR( DMStagSetStencilType(self.dm, stype) ) * * def setBoundaryTypes( # <<<<<<<<<<<<<< * self, * boundary_types: tuple[DM.BoundaryType | int | str | bool, ...], */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMStag.setBoundaryTypes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMStag.pyx":222 * CHKERR( DMStagSetBoundaryTypes(self.dm, btx, bty, btz) ) * * def setDof(self, dofs: tuple[int, ...]) -> None: # <<<<<<<<<<<<<< * """Set DOFs/stratum. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_9setDof(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMStag_8setDof, "DMStag.setDof(self, dofs: tuple[int, ...]) -> None\nSet DOFs/stratum.\n\n Logically collective.\n\n Parameters\n ----------\n dofs\n The number of points per 0-cell (vertex/node), 1-cell (element in\n 1D, edge in 2D and 3D), 2-cell (element in 2D, face in 3D), or\n 3-cell (element in 3D).\n\n See Also\n --------\n petsc.DMStagSetDOF\n\n \nSource code at petsc4py/PETSc/DMStag.pyx:222"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_9setDof(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_dofs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setDof (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dofs,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dofs)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(58, 222, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setDof") < 0)) __PYX_ERR(58, 222, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_dofs = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setDof", 1, 1, 1, __pyx_nargs); __PYX_ERR(58, 222, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMStag.setDof", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_8setDof(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self), __pyx_v_dofs); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_8setDof(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_dofs) { PyObject *__pyx_v_gdofs = 0; CYTHON_UNUSED PetscInt __pyx_v_gdim; PetscInt __pyx_v_dof0; PetscInt __pyx_v_dof1; PetscInt __pyx_v_dof2; PetscInt __pyx_v_dof3; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscInt __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setDof", 1); /* "petsc4py/PETSc/DMStag.pyx":239 * * """ * cdef tuple gdofs = tuple(dofs) # <<<<<<<<<<<<<< * cdef PetscInt gdim=PETSC_DECIDE, dof0=1, dof1=0, dof2=0, dof3=0 * gdim = asDofs(gdofs, &dof0, &dof1, &dof2, &dof3) */ __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_dofs); if (unlikely(!__pyx_t_1)) __PYX_ERR(58, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_gdofs = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DMStag.pyx":240 * """ * cdef tuple gdofs = tuple(dofs) * cdef PetscInt gdim=PETSC_DECIDE, dof0=1, dof1=0, dof2=0, dof3=0 # <<<<<<<<<<<<<< * gdim = asDofs(gdofs, &dof0, &dof1, &dof2, &dof3) * CHKERR( DMStagSetDOF(self.dm, dof0, dof1, dof2, dof3) ) */ __pyx_v_gdim = PETSC_DECIDE; __pyx_v_dof0 = 1; __pyx_v_dof1 = 0; __pyx_v_dof2 = 0; __pyx_v_dof3 = 0; /* "petsc4py/PETSc/DMStag.pyx":241 * cdef tuple gdofs = tuple(dofs) * cdef PetscInt gdim=PETSC_DECIDE, dof0=1, dof1=0, dof2=0, dof3=0 * gdim = asDofs(gdofs, &dof0, &dof1, &dof2, &dof3) # <<<<<<<<<<<<<< * CHKERR( DMStagSetDOF(self.dm, dof0, dof1, dof2, dof3) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asDofs(__pyx_v_gdofs, (&__pyx_v_dof0), (&__pyx_v_dof1), (&__pyx_v_dof2), (&__pyx_v_dof3)); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(58, 241, __pyx_L1_error) __pyx_v_gdim = __pyx_t_2; /* "petsc4py/PETSc/DMStag.pyx":242 * cdef PetscInt gdim=PETSC_DECIDE, dof0=1, dof1=0, dof2=0, dof3=0 * gdim = asDofs(gdofs, &dof0, &dof1, &dof2, &dof3) * CHKERR( DMStagSetDOF(self.dm, dof0, dof1, dof2, dof3) ) # <<<<<<<<<<<<<< * * def setGlobalSizes(self, sizes: tuple[int, ...]) -> None: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMStagSetDOF(__pyx_v_self->__pyx_base.dm, __pyx_v_dof0, __pyx_v_dof1, __pyx_v_dof2, __pyx_v_dof3)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(58, 242, __pyx_L1_error) /* "petsc4py/PETSc/DMStag.pyx":222 * CHKERR( DMStagSetBoundaryTypes(self.dm, btx, bty, btz) ) * * def setDof(self, dofs: tuple[int, ...]) -> None: # <<<<<<<<<<<<<< * """Set DOFs/stratum. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.setDof", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_gdofs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMStag.pyx":244 * CHKERR( DMStagSetDOF(self.dm, dof0, dof1, dof2, dof3) ) * * def setGlobalSizes(self, sizes: tuple[int, ...]) -> None: # <<<<<<<<<<<<<< * """Set global element counts in each dimension. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_11setGlobalSizes(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMStag_10setGlobalSizes, "DMStag.setGlobalSizes(self, sizes: tuple[int, ...]) -> None\nSet global element counts in each dimension.\n\n Logically collective.\n\n Parameters\n ----------\n sizes\n Global elementwise size in the one/two/three dimensions.\n\n See Also\n --------\n petsc.DMStagSetGlobalSizes\n\n \nSource code at petsc4py/PETSc/DMStag.pyx:244"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_11setGlobalSizes(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_sizes = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setGlobalSizes (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sizes,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sizes)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(58, 244, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setGlobalSizes") < 0)) __PYX_ERR(58, 244, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_sizes = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setGlobalSizes", 1, 1, 1, __pyx_nargs); __PYX_ERR(58, 244, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMStag.setGlobalSizes", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_10setGlobalSizes(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self), __pyx_v_sizes); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_10setGlobalSizes(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_sizes) { PyObject *__pyx_v_gsizes = 0; CYTHON_UNUSED PetscInt __pyx_v_gdim; PetscInt __pyx_v_M; PetscInt __pyx_v_N; PetscInt __pyx_v_P; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscInt __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setGlobalSizes", 1); /* "petsc4py/PETSc/DMStag.pyx":259 * * """ * cdef tuple gsizes = tuple(sizes) # <<<<<<<<<<<<<< * cdef PetscInt gdim=PETSC_DECIDE, M=1, N=1, P=1 * gdim = asStagDims(gsizes, &M, &N, &P) */ __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_sizes); if (unlikely(!__pyx_t_1)) __PYX_ERR(58, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_gsizes = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DMStag.pyx":260 * """ * cdef tuple gsizes = tuple(sizes) * cdef PetscInt gdim=PETSC_DECIDE, M=1, N=1, P=1 # <<<<<<<<<<<<<< * gdim = asStagDims(gsizes, &M, &N, &P) * CHKERR( DMStagSetGlobalSizes(self.dm, M, N, P) ) */ __pyx_v_gdim = PETSC_DECIDE; __pyx_v_M = 1; __pyx_v_N = 1; __pyx_v_P = 1; /* "petsc4py/PETSc/DMStag.pyx":261 * cdef tuple gsizes = tuple(sizes) * cdef PetscInt gdim=PETSC_DECIDE, M=1, N=1, P=1 * gdim = asStagDims(gsizes, &M, &N, &P) # <<<<<<<<<<<<<< * CHKERR( DMStagSetGlobalSizes(self.dm, M, N, P) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asStagDims(__pyx_v_gsizes, (&__pyx_v_M), (&__pyx_v_N), (&__pyx_v_P)); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(58, 261, __pyx_L1_error) __pyx_v_gdim = __pyx_t_2; /* "petsc4py/PETSc/DMStag.pyx":262 * cdef PetscInt gdim=PETSC_DECIDE, M=1, N=1, P=1 * gdim = asStagDims(gsizes, &M, &N, &P) * CHKERR( DMStagSetGlobalSizes(self.dm, M, N, P) ) # <<<<<<<<<<<<<< * * def setProcSizes(self, sizes: tuple[int, ...]) -> None: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMStagSetGlobalSizes(__pyx_v_self->__pyx_base.dm, __pyx_v_M, __pyx_v_N, __pyx_v_P)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(58, 262, __pyx_L1_error) /* "petsc4py/PETSc/DMStag.pyx":244 * CHKERR( DMStagSetDOF(self.dm, dof0, dof1, dof2, dof3) ) * * def setGlobalSizes(self, sizes: tuple[int, ...]) -> None: # <<<<<<<<<<<<<< * """Set global element counts in each dimension. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.setGlobalSizes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_gsizes); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMStag.pyx":264 * CHKERR( DMStagSetGlobalSizes(self.dm, M, N, P) ) * * def setProcSizes(self, sizes: tuple[int, ...]) -> None: # <<<<<<<<<<<<<< * """Set the number of processes in each dimension in the global process grid. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_13setProcSizes(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMStag_12setProcSizes, "DMStag.setProcSizes(self, sizes: tuple[int, ...]) -> None\nSet the number of processes in each dimension in the global process grid.\n\n Logically collective.\n\n Parameters\n ----------\n sizes\n Number of processes in one/two/three dimensions.\n\n See Also\n --------\n petsc.DMStagSetNumRanks\n\n \nSource code at petsc4py/PETSc/DMStag.pyx:264"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_13setProcSizes(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_sizes = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setProcSizes (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sizes,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sizes)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(58, 264, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setProcSizes") < 0)) __PYX_ERR(58, 264, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_sizes = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setProcSizes", 1, 1, 1, __pyx_nargs); __PYX_ERR(58, 264, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMStag.setProcSizes", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_12setProcSizes(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self), __pyx_v_sizes); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_12setProcSizes(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_sizes) { PyObject *__pyx_v_psizes = 0; CYTHON_UNUSED PetscInt __pyx_v_pdim; PetscInt __pyx_v_m; PetscInt __pyx_v_n; PetscInt __pyx_v_p; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscInt __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setProcSizes", 1); /* "petsc4py/PETSc/DMStag.pyx":279 * * """ * cdef tuple psizes = tuple(sizes) # <<<<<<<<<<<<<< * cdef PetscInt pdim=PETSC_DECIDE, m=PETSC_DECIDE, n=PETSC_DECIDE, p=PETSC_DECIDE * pdim = asStagDims(psizes, &m, &n, &p) */ __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_sizes); if (unlikely(!__pyx_t_1)) __PYX_ERR(58, 279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_psizes = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DMStag.pyx":280 * """ * cdef tuple psizes = tuple(sizes) * cdef PetscInt pdim=PETSC_DECIDE, m=PETSC_DECIDE, n=PETSC_DECIDE, p=PETSC_DECIDE # <<<<<<<<<<<<<< * pdim = asStagDims(psizes, &m, &n, &p) * CHKERR( DMStagSetNumRanks(self.dm, m, n, p) ) */ __pyx_v_pdim = PETSC_DECIDE; __pyx_v_m = PETSC_DECIDE; __pyx_v_n = PETSC_DECIDE; __pyx_v_p = PETSC_DECIDE; /* "petsc4py/PETSc/DMStag.pyx":281 * cdef tuple psizes = tuple(sizes) * cdef PetscInt pdim=PETSC_DECIDE, m=PETSC_DECIDE, n=PETSC_DECIDE, p=PETSC_DECIDE * pdim = asStagDims(psizes, &m, &n, &p) # <<<<<<<<<<<<<< * CHKERR( DMStagSetNumRanks(self.dm, m, n, p) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asStagDims(__pyx_v_psizes, (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_p)); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(58, 281, __pyx_L1_error) __pyx_v_pdim = __pyx_t_2; /* "petsc4py/PETSc/DMStag.pyx":282 * cdef PetscInt pdim=PETSC_DECIDE, m=PETSC_DECIDE, n=PETSC_DECIDE, p=PETSC_DECIDE * pdim = asStagDims(psizes, &m, &n, &p) * CHKERR( DMStagSetNumRanks(self.dm, m, n, p) ) # <<<<<<<<<<<<<< * * def setOwnershipRanges(self, ranges: tuple[Sequence[int], ...]) -> None: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMStagSetNumRanks(__pyx_v_self->__pyx_base.dm, __pyx_v_m, __pyx_v_n, __pyx_v_p)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(58, 282, __pyx_L1_error) /* "petsc4py/PETSc/DMStag.pyx":264 * CHKERR( DMStagSetGlobalSizes(self.dm, M, N, P) ) * * def setProcSizes(self, sizes: tuple[int, ...]) -> None: # <<<<<<<<<<<<<< * """Set the number of processes in each dimension in the global process grid. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.setProcSizes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_psizes); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMStag.pyx":284 * CHKERR( DMStagSetNumRanks(self.dm, m, n, p) ) * * def setOwnershipRanges(self, ranges: tuple[Sequence[int], ...]) -> None: # <<<<<<<<<<<<<< * """Set elements per process in each dimension. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_15setOwnershipRanges(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMStag_14setOwnershipRanges, "DMStag.setOwnershipRanges(self, ranges: tuple[Sequence[int], ...]) -> None\nSet elements per process in each dimension.\n\n Logically collective.\n\n Parameters\n ----------\n ranges\n Element counts for each process in one/two/three dimensions.\n\n See Also\n --------\n getOwnershipRanges, petsc.DMStagSetOwnershipRanges\n\n \nSource code at petsc4py/PETSc/DMStag.pyx:284"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_15setOwnershipRanges(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_ranges = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setOwnershipRanges (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ranges,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ranges)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(58, 284, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setOwnershipRanges") < 0)) __PYX_ERR(58, 284, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_ranges = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setOwnershipRanges", 1, 1, 1, __pyx_nargs); __PYX_ERR(58, 284, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMStag.setOwnershipRanges", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_14setOwnershipRanges(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self), __pyx_v_ranges); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_14setOwnershipRanges(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_ranges) { PetscInt __pyx_v_dim; PetscInt __pyx_v_m; PetscInt __pyx_v_n; PetscInt __pyx_v_p; PetscInt *__pyx_v_lx; PetscInt *__pyx_v_ly; PetscInt *__pyx_v_lz; CYTHON_UNUSED PyObject *__pyx_v_ownership_ranges = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setOwnershipRanges", 1); /* "petsc4py/PETSc/DMStag.pyx":299 * * """ * cdef PetscInt dim=0, m=PETSC_DECIDE, n=PETSC_DECIDE, p=PETSC_DECIDE # <<<<<<<<<<<<<< * cdef PetscInt *lx = NULL, *ly = NULL, *lz = NULL * CHKERR( DMGetDimension(self.dm, &dim) ) */ __pyx_v_dim = 0; __pyx_v_m = PETSC_DECIDE; __pyx_v_n = PETSC_DECIDE; __pyx_v_p = PETSC_DECIDE; /* "petsc4py/PETSc/DMStag.pyx":300 * """ * cdef PetscInt dim=0, m=PETSC_DECIDE, n=PETSC_DECIDE, p=PETSC_DECIDE * cdef PetscInt *lx = NULL, *ly = NULL, *lz = NULL # <<<<<<<<<<<<<< * CHKERR( DMGetDimension(self.dm, &dim) ) * CHKERR( DMStagGetNumRanks(self.dm, &m, &n, &p) ) */ __pyx_v_lx = NULL; __pyx_v_ly = NULL; __pyx_v_lz = NULL; /* "petsc4py/PETSc/DMStag.pyx":301 * cdef PetscInt dim=0, m=PETSC_DECIDE, n=PETSC_DECIDE, p=PETSC_DECIDE * cdef PetscInt *lx = NULL, *ly = NULL, *lz = NULL * CHKERR( DMGetDimension(self.dm, &dim) ) # <<<<<<<<<<<<<< * CHKERR( DMStagGetNumRanks(self.dm, &m, &n, &p) ) * ownership_ranges = asStagOwnershipRanges(ranges, dim, &m, &n, &p, &lx, &ly, &lz) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetDimension(__pyx_v_self->__pyx_base.dm, (&__pyx_v_dim))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(58, 301, __pyx_L1_error) /* "petsc4py/PETSc/DMStag.pyx":302 * cdef PetscInt *lx = NULL, *ly = NULL, *lz = NULL * CHKERR( DMGetDimension(self.dm, &dim) ) * CHKERR( DMStagGetNumRanks(self.dm, &m, &n, &p) ) # <<<<<<<<<<<<<< * ownership_ranges = asStagOwnershipRanges(ranges, dim, &m, &n, &p, &lx, &ly, &lz) * CHKERR( DMStagSetOwnershipRanges(self.dm, lx, ly, lz) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMStagGetNumRanks(__pyx_v_self->__pyx_base.dm, (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_p))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(58, 302, __pyx_L1_error) /* "petsc4py/PETSc/DMStag.pyx":303 * CHKERR( DMGetDimension(self.dm, &dim) ) * CHKERR( DMStagGetNumRanks(self.dm, &m, &n, &p) ) * ownership_ranges = asStagOwnershipRanges(ranges, dim, &m, &n, &p, &lx, &ly, &lz) # <<<<<<<<<<<<<< * CHKERR( DMStagSetOwnershipRanges(self.dm, lx, ly, lz) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asStagOwnershipRanges(__pyx_v_ranges, __pyx_v_dim, (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_p), (&__pyx_v_lx), (&__pyx_v_ly), (&__pyx_v_lz)); if (unlikely(!__pyx_t_2)) __PYX_ERR(58, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_ownership_ranges = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DMStag.pyx":304 * CHKERR( DMStagGetNumRanks(self.dm, &m, &n, &p) ) * ownership_ranges = asStagOwnershipRanges(ranges, dim, &m, &n, &p, &lx, &ly, &lz) * CHKERR( DMStagSetOwnershipRanges(self.dm, lx, ly, lz) ) # <<<<<<<<<<<<<< * * # Getters */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMStagSetOwnershipRanges(__pyx_v_self->__pyx_base.dm, __pyx_v_lx, __pyx_v_ly, __pyx_v_lz)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(58, 304, __pyx_L1_error) /* "petsc4py/PETSc/DMStag.pyx":284 * CHKERR( DMStagSetNumRanks(self.dm, m, n, p) ) * * def setOwnershipRanges(self, ranges: tuple[Sequence[int], ...]) -> None: # <<<<<<<<<<<<<< * """Set elements per process in each dimension. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.setOwnershipRanges", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ownership_ranges); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMStag.pyx":308 * # Getters * * def getDim(self) -> int: # <<<<<<<<<<<<<< * """Return the number of dimensions. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_17getDim(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMStag_16getDim, "DMStag.getDim(self) -> int\nReturn the number of dimensions.\n\n Not collective.\n\n \nSource code at petsc4py/PETSc/DMStag.pyx:308"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_17getDim(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getDim (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getDim", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getDim", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_16getDim(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_16getDim(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getDim", 1); /* "petsc4py/PETSc/DMStag.pyx":314 * * """ * return self.getDimension() # <<<<<<<<<<<<<< * * def getEntriesPerElement(self) -> int: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getDimension); if (unlikely(!__pyx_t_2)) __PYX_ERR(58, 314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(58, 314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMStag.pyx":308 * # Getters * * def getDim(self) -> int: # <<<<<<<<<<<<<< * """Return the number of dimensions. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.getDim", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMStag.pyx":316 * return self.getDimension() * * def getEntriesPerElement(self) -> int: # <<<<<<<<<<<<<< * """Return the number of entries per element in the local representation. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_19getEntriesPerElement(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMStag_18getEntriesPerElement, "DMStag.getEntriesPerElement(self) -> int\nReturn the number of entries per element in the local representation.\n\n Not collective.\n\n This is the natural block size for most local operations.\n\n See Also\n --------\n petsc.DMStagGetEntriesPerElement\n\n \nSource code at petsc4py/PETSc/DMStag.pyx:316"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_19getEntriesPerElement(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getEntriesPerElement (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getEntriesPerElement", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getEntriesPerElement", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_18getEntriesPerElement(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_18getEntriesPerElement(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self) { PetscInt __pyx_v_epe; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getEntriesPerElement", 1); /* "petsc4py/PETSc/DMStag.pyx":328 * * """ * cdef PetscInt epe=0 # <<<<<<<<<<<<<< * CHKERR( DMStagGetEntriesPerElement(self.dm, &epe) ) * return toInt(epe) */ __pyx_v_epe = 0; /* "petsc4py/PETSc/DMStag.pyx":329 * """ * cdef PetscInt epe=0 * CHKERR( DMStagGetEntriesPerElement(self.dm, &epe) ) # <<<<<<<<<<<<<< * return toInt(epe) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMStagGetEntriesPerElement(__pyx_v_self->__pyx_base.dm, (&__pyx_v_epe))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(58, 329, __pyx_L1_error) /* "petsc4py/PETSc/DMStag.pyx":330 * cdef PetscInt epe=0 * CHKERR( DMStagGetEntriesPerElement(self.dm, &epe) ) * return toInt(epe) # <<<<<<<<<<<<<< * * def getStencilWidth(self) -> int: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_epe); if (unlikely(!__pyx_t_2)) __PYX_ERR(58, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMStag.pyx":316 * return self.getDimension() * * def getEntriesPerElement(self) -> int: # <<<<<<<<<<<<<< * """Return the number of entries per element in the local representation. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.getEntriesPerElement", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMStag.pyx":332 * return toInt(epe) * * def getStencilWidth(self) -> int: # <<<<<<<<<<<<<< * """Return elementwise stencil width. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_21getStencilWidth(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMStag_20getStencilWidth, "DMStag.getStencilWidth(self) -> int\nReturn elementwise stencil width.\n\n Not collective.\n\n See Also\n --------\n petsc.DMStagGetStencilWidth\n\n \nSource code at petsc4py/PETSc/DMStag.pyx:332"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_21getStencilWidth(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getStencilWidth (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getStencilWidth", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getStencilWidth", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_20getStencilWidth(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_20getStencilWidth(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self) { PetscInt __pyx_v_swidth; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getStencilWidth", 1); /* "petsc4py/PETSc/DMStag.pyx":342 * * """ * cdef PetscInt swidth=0 # <<<<<<<<<<<<<< * CHKERR( DMStagGetStencilWidth(self.dm, &swidth) ) * return toInt(swidth) */ __pyx_v_swidth = 0; /* "petsc4py/PETSc/DMStag.pyx":343 * """ * cdef PetscInt swidth=0 * CHKERR( DMStagGetStencilWidth(self.dm, &swidth) ) # <<<<<<<<<<<<<< * return toInt(swidth) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMStagGetStencilWidth(__pyx_v_self->__pyx_base.dm, (&__pyx_v_swidth))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(58, 343, __pyx_L1_error) /* "petsc4py/PETSc/DMStag.pyx":344 * cdef PetscInt swidth=0 * CHKERR( DMStagGetStencilWidth(self.dm, &swidth) ) * return toInt(swidth) # <<<<<<<<<<<<<< * * def getDof(self) -> tuple[int, ...]: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_swidth); if (unlikely(!__pyx_t_2)) __PYX_ERR(58, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMStag.pyx":332 * return toInt(epe) * * def getStencilWidth(self) -> int: # <<<<<<<<<<<<<< * """Return elementwise stencil width. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.getStencilWidth", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMStag.pyx":346 * return toInt(swidth) * * def getDof(self) -> tuple[int, ...]: # <<<<<<<<<<<<<< * """Get number of DOFs associated with each stratum of the grid. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_23getDof(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMStag_22getDof, "DMStag.getDof(self) -> tuple[int, ...]\nGet number of DOFs associated with each stratum of the grid.\n\n Not collective.\n\n See Also\n --------\n petsc.DMStagGetDOF\n\n \nSource code at petsc4py/PETSc/DMStag.pyx:346"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_23getDof(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getDof (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getDof", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getDof", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_22getDof(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_22getDof(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self) { PetscInt __pyx_v_dim; PetscInt __pyx_v_dof0; PetscInt __pyx_v_dof1; PetscInt __pyx_v_dof2; PetscInt __pyx_v_dof3; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getDof", 1); /* "petsc4py/PETSc/DMStag.pyx":356 * * """ * cdef PetscInt dim=0, dof0=0, dof1=0, dof2=0, dof3=0 # <<<<<<<<<<<<<< * CHKERR( DMStagGetDOF(self.dm, &dof0, &dof1, &dof2, &dof3) ) * CHKERR( DMGetDimension(self.dm, &dim) ) */ __pyx_v_dim = 0; __pyx_v_dof0 = 0; __pyx_v_dof1 = 0; __pyx_v_dof2 = 0; __pyx_v_dof3 = 0; /* "petsc4py/PETSc/DMStag.pyx":357 * """ * cdef PetscInt dim=0, dof0=0, dof1=0, dof2=0, dof3=0 * CHKERR( DMStagGetDOF(self.dm, &dof0, &dof1, &dof2, &dof3) ) # <<<<<<<<<<<<<< * CHKERR( DMGetDimension(self.dm, &dim) ) * return toDofs(dim+1,dof0,dof1,dof2,dof3) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMStagGetDOF(__pyx_v_self->__pyx_base.dm, (&__pyx_v_dof0), (&__pyx_v_dof1), (&__pyx_v_dof2), (&__pyx_v_dof3))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(58, 357, __pyx_L1_error) /* "petsc4py/PETSc/DMStag.pyx":358 * cdef PetscInt dim=0, dof0=0, dof1=0, dof2=0, dof3=0 * CHKERR( DMStagGetDOF(self.dm, &dof0, &dof1, &dof2, &dof3) ) * CHKERR( DMGetDimension(self.dm, &dim) ) # <<<<<<<<<<<<<< * return toDofs(dim+1,dof0,dof1,dof2,dof3) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetDimension(__pyx_v_self->__pyx_base.dm, (&__pyx_v_dim))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(58, 358, __pyx_L1_error) /* "petsc4py/PETSc/DMStag.pyx":359 * CHKERR( DMStagGetDOF(self.dm, &dof0, &dof1, &dof2, &dof3) ) * CHKERR( DMGetDimension(self.dm, &dim) ) * return toDofs(dim+1,dof0,dof1,dof2,dof3) # <<<<<<<<<<<<<< * * def getCorners(self) -> tuple[tuple[int, ...], tuple[int, ...], tuple[int, ...]]: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toDofs((__pyx_v_dim + 1), __pyx_v_dof0, __pyx_v_dof1, __pyx_v_dof2, __pyx_v_dof3); if (unlikely(!__pyx_t_2)) __PYX_ERR(58, 359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMStag.pyx":346 * return toInt(swidth) * * def getDof(self) -> tuple[int, ...]: # <<<<<<<<<<<<<< * """Get number of DOFs associated with each stratum of the grid. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.getDof", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMStag.pyx":361 * return toDofs(dim+1,dof0,dof1,dof2,dof3) * * def getCorners(self) -> tuple[tuple[int, ...], tuple[int, ...], tuple[int, ...]]: # <<<<<<<<<<<<<< * """Return starting element index, width and number of partial elements. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_25getCorners(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMStag_24getCorners, "DMStag.getCorners(self) -> tuple[tuple[int, ...], tuple[int, ...], tuple[int, ...]]\nReturn starting element index, width and number of partial elements.\n\n Not collective.\n\n The returned value is calculated excluding ghost points.\n\n The number of extra partial elements is either ``1`` or ``0``. The\n value is ``1`` on right, top, and front non-periodic domain\n (\"physical\") boundaries, in the x, y, and z dimensions respectively,\n and otherwise ``0``.\n\n See Also\n --------\n getGhostCorners, petsc.DMStagGetCorners, petsc.DMGetDimension\n\n \nSource code at petsc4py/PETSc/DMStag.pyx:361"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_25getCorners(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getCorners (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getCorners", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getCorners", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_24getCorners(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_24getCorners(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self) { PetscInt __pyx_v_dim; PetscInt __pyx_v_x; PetscInt __pyx_v_y; PetscInt __pyx_v_z; PetscInt __pyx_v_m; PetscInt __pyx_v_n; PetscInt __pyx_v_p; PetscInt __pyx_v_nExtrax; PetscInt __pyx_v_nExtray; PetscInt __pyx_v_nExtraz; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscInt __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getCorners", 1); /* "petsc4py/PETSc/DMStag.pyx":378 * * """ * cdef PetscInt dim=0, x=0, y=0, z=0, m=0, n=0, p=0, nExtrax=0, nExtray=0, nExtraz=0 # <<<<<<<<<<<<<< * CHKERR( DMGetDimension(self.dm, &dim) ) * CHKERR( DMStagGetCorners(self.dm, &x, &y, &z, &m, &n, &p, &nExtrax, &nExtray, &nExtraz) ) */ __pyx_v_dim = 0; __pyx_v_x = 0; __pyx_v_y = 0; __pyx_v_z = 0; __pyx_v_m = 0; __pyx_v_n = 0; __pyx_v_p = 0; __pyx_v_nExtrax = 0; __pyx_v_nExtray = 0; __pyx_v_nExtraz = 0; /* "petsc4py/PETSc/DMStag.pyx":379 * """ * cdef PetscInt dim=0, x=0, y=0, z=0, m=0, n=0, p=0, nExtrax=0, nExtray=0, nExtraz=0 * CHKERR( DMGetDimension(self.dm, &dim) ) # <<<<<<<<<<<<<< * CHKERR( DMStagGetCorners(self.dm, &x, &y, &z, &m, &n, &p, &nExtrax, &nExtray, &nExtraz) ) * return (asInt(x), asInt(y), asInt(z))[:dim], (asInt(m), asInt(n), asInt(p))[:dim], (asInt(nExtrax), asInt(nExtray), asInt(nExtraz))[:dim] */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetDimension(__pyx_v_self->__pyx_base.dm, (&__pyx_v_dim))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(58, 379, __pyx_L1_error) /* "petsc4py/PETSc/DMStag.pyx":380 * cdef PetscInt dim=0, x=0, y=0, z=0, m=0, n=0, p=0, nExtrax=0, nExtray=0, nExtraz=0 * CHKERR( DMGetDimension(self.dm, &dim) ) * CHKERR( DMStagGetCorners(self.dm, &x, &y, &z, &m, &n, &p, &nExtrax, &nExtray, &nExtraz) ) # <<<<<<<<<<<<<< * return (asInt(x), asInt(y), asInt(z))[:dim], (asInt(m), asInt(n), asInt(p))[:dim], (asInt(nExtrax), asInt(nExtray), asInt(nExtraz))[:dim] * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMStagGetCorners(__pyx_v_self->__pyx_base.dm, (&__pyx_v_x), (&__pyx_v_y), (&__pyx_v_z), (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_p), (&__pyx_v_nExtrax), (&__pyx_v_nExtray), (&__pyx_v_nExtraz))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(58, 380, __pyx_L1_error) /* "petsc4py/PETSc/DMStag.pyx":381 * CHKERR( DMGetDimension(self.dm, &dim) ) * CHKERR( DMStagGetCorners(self.dm, &x, &y, &z, &m, &n, &p, &nExtrax, &nExtray, &nExtraz) ) * return (asInt(x), asInt(y), asInt(z))[:dim], (asInt(m), asInt(n), asInt(p))[:dim], (asInt(nExtrax), asInt(nExtray), asInt(nExtraz))[:dim] # <<<<<<<<<<<<<< * * def getGhostCorners(self) -> tuple[tuple[int, ...], tuple[int, ...]]: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_PetscInt(__pyx_v_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(58, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_t_2); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(58, 381, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_PetscInt(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(58, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyInt_From_PetscInt(__pyx_v_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(58, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_t_4); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(58, 381, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_From_PetscInt(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(58, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_PetscInt(__pyx_v_z); if (unlikely(!__pyx_t_5)) __PYX_ERR(58, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_t_5); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(58, 381, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyInt_From_PetscInt(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(58, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(58, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2)) __PYX_ERR(58, 381, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4)) __PYX_ERR(58, 381, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_5)) __PYX_ERR(58, 381, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_t_6, 0, ((Py_ssize_t)__pyx_v_dim), NULL, NULL, NULL, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(58, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyInt_From_PetscInt(__pyx_v_m); if (unlikely(!__pyx_t_6)) __PYX_ERR(58, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_t_6); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(58, 381, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyInt_From_PetscInt(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(58, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = __Pyx_PyInt_From_PetscInt(__pyx_v_n); if (unlikely(!__pyx_t_4)) __PYX_ERR(58, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_t_4); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(58, 381, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_From_PetscInt(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(58, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyInt_From_PetscInt(__pyx_v_p); if (unlikely(!__pyx_t_2)) __PYX_ERR(58, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_t_2); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(58, 381, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_PetscInt(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(58, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(58, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_6); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6)) __PYX_ERR(58, 381, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4)) __PYX_ERR(58, 381, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_2)) __PYX_ERR(58, 381, __pyx_L1_error); __pyx_t_6 = 0; __pyx_t_4 = 0; __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_t_7, 0, ((Py_ssize_t)__pyx_v_dim), NULL, NULL, NULL, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(58, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyInt_From_PetscInt(__pyx_v_nExtrax); if (unlikely(!__pyx_t_7)) __PYX_ERR(58, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_t_7); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(58, 381, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyInt_From_PetscInt(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(58, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_4 = __Pyx_PyInt_From_PetscInt(__pyx_v_nExtray); if (unlikely(!__pyx_t_4)) __PYX_ERR(58, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_t_4); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(58, 381, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_From_PetscInt(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(58, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyInt_From_PetscInt(__pyx_v_nExtraz); if (unlikely(!__pyx_t_6)) __PYX_ERR(58, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_t_6); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(58, 381, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyInt_From_PetscInt(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(58, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(58, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7)) __PYX_ERR(58, 381, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_4)) __PYX_ERR(58, 381, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_6)) __PYX_ERR(58, 381, __pyx_L1_error); __pyx_t_7 = 0; __pyx_t_4 = 0; __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_t_8, 0, ((Py_ssize_t)__pyx_v_dim), NULL, NULL, NULL, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(58, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(58, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5)) __PYX_ERR(58, 381, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_2)) __PYX_ERR(58, 381, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_6)) __PYX_ERR(58, 381, __pyx_L1_error); __pyx_t_5 = 0; __pyx_t_2 = 0; __pyx_t_6 = 0; __pyx_r = __pyx_t_8; __pyx_t_8 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMStag.pyx":361 * return toDofs(dim+1,dof0,dof1,dof2,dof3) * * def getCorners(self) -> tuple[tuple[int, ...], tuple[int, ...], tuple[int, ...]]: # <<<<<<<<<<<<<< * """Return starting element index, width and number of partial elements. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.getCorners", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMStag.pyx":383 * return (asInt(x), asInt(y), asInt(z))[:dim], (asInt(m), asInt(n), asInt(p))[:dim], (asInt(nExtrax), asInt(nExtray), asInt(nExtraz))[:dim] * * def getGhostCorners(self) -> tuple[tuple[int, ...], tuple[int, ...]]: # <<<<<<<<<<<<<< * """Return starting element index and width of local region. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_27getGhostCorners(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMStag_26getGhostCorners, "DMStag.getGhostCorners(self) -> tuple[tuple[int, ...], tuple[int, ...]]\nReturn starting element index and width of local region.\n\n Not collective.\n\n See Also\n --------\n getCorners, petsc.DMStagGetGhostCorners\n\n \nSource code at petsc4py/PETSc/DMStag.pyx:383"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_27getGhostCorners(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getGhostCorners (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getGhostCorners", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getGhostCorners", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_26getGhostCorners(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_26getGhostCorners(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self) { PetscInt __pyx_v_dim; PetscInt __pyx_v_x; PetscInt __pyx_v_y; PetscInt __pyx_v_z; PetscInt __pyx_v_m; PetscInt __pyx_v_n; PetscInt __pyx_v_p; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscInt __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getGhostCorners", 1); /* "petsc4py/PETSc/DMStag.pyx":393 * * """ * cdef PetscInt dim=0, x=0, y=0, z=0, m=0, n=0, p=0 # <<<<<<<<<<<<<< * CHKERR( DMGetDimension(self.dm, &dim) ) * CHKERR( DMStagGetGhostCorners(self.dm, &x, &y, &z, &m, &n, &p) ) */ __pyx_v_dim = 0; __pyx_v_x = 0; __pyx_v_y = 0; __pyx_v_z = 0; __pyx_v_m = 0; __pyx_v_n = 0; __pyx_v_p = 0; /* "petsc4py/PETSc/DMStag.pyx":394 * """ * cdef PetscInt dim=0, x=0, y=0, z=0, m=0, n=0, p=0 * CHKERR( DMGetDimension(self.dm, &dim) ) # <<<<<<<<<<<<<< * CHKERR( DMStagGetGhostCorners(self.dm, &x, &y, &z, &m, &n, &p) ) * return (asInt(x), asInt(y), asInt(z))[:dim], (asInt(m), asInt(n), asInt(p))[:dim] */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetDimension(__pyx_v_self->__pyx_base.dm, (&__pyx_v_dim))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(58, 394, __pyx_L1_error) /* "petsc4py/PETSc/DMStag.pyx":395 * cdef PetscInt dim=0, x=0, y=0, z=0, m=0, n=0, p=0 * CHKERR( DMGetDimension(self.dm, &dim) ) * CHKERR( DMStagGetGhostCorners(self.dm, &x, &y, &z, &m, &n, &p) ) # <<<<<<<<<<<<<< * return (asInt(x), asInt(y), asInt(z))[:dim], (asInt(m), asInt(n), asInt(p))[:dim] * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMStagGetGhostCorners(__pyx_v_self->__pyx_base.dm, (&__pyx_v_x), (&__pyx_v_y), (&__pyx_v_z), (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_p))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(58, 395, __pyx_L1_error) /* "petsc4py/PETSc/DMStag.pyx":396 * CHKERR( DMGetDimension(self.dm, &dim) ) * CHKERR( DMStagGetGhostCorners(self.dm, &x, &y, &z, &m, &n, &p) ) * return (asInt(x), asInt(y), asInt(z))[:dim], (asInt(m), asInt(n), asInt(p))[:dim] # <<<<<<<<<<<<<< * * def getLocalSizes(self) -> tuple[int, ...]: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_PetscInt(__pyx_v_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(58, 396, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_t_2); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(58, 396, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_PetscInt(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(58, 396, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyInt_From_PetscInt(__pyx_v_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(58, 396, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_t_4); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(58, 396, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_From_PetscInt(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(58, 396, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_PetscInt(__pyx_v_z); if (unlikely(!__pyx_t_5)) __PYX_ERR(58, 396, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_t_5); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(58, 396, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyInt_From_PetscInt(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(58, 396, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(58, 396, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2)) __PYX_ERR(58, 396, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4)) __PYX_ERR(58, 396, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_5)) __PYX_ERR(58, 396, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_t_6, 0, ((Py_ssize_t)__pyx_v_dim), NULL, NULL, NULL, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(58, 396, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyInt_From_PetscInt(__pyx_v_m); if (unlikely(!__pyx_t_6)) __PYX_ERR(58, 396, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_t_6); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(58, 396, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyInt_From_PetscInt(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(58, 396, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = __Pyx_PyInt_From_PetscInt(__pyx_v_n); if (unlikely(!__pyx_t_4)) __PYX_ERR(58, 396, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_t_4); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(58, 396, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_From_PetscInt(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(58, 396, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyInt_From_PetscInt(__pyx_v_p); if (unlikely(!__pyx_t_2)) __PYX_ERR(58, 396, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_t_2); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(58, 396, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_PetscInt(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(58, 396, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(58, 396, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_6); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6)) __PYX_ERR(58, 396, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4)) __PYX_ERR(58, 396, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_2)) __PYX_ERR(58, 396, __pyx_L1_error); __pyx_t_6 = 0; __pyx_t_4 = 0; __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_t_7, 0, ((Py_ssize_t)__pyx_v_dim), NULL, NULL, NULL, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(58, 396, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(58, 396, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5)) __PYX_ERR(58, 396, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_2)) __PYX_ERR(58, 396, __pyx_L1_error); __pyx_t_5 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_7; __pyx_t_7 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMStag.pyx":383 * return (asInt(x), asInt(y), asInt(z))[:dim], (asInt(m), asInt(n), asInt(p))[:dim], (asInt(nExtrax), asInt(nExtray), asInt(nExtraz))[:dim] * * def getGhostCorners(self) -> tuple[tuple[int, ...], tuple[int, ...]]: # <<<<<<<<<<<<<< * """Return starting element index and width of local region. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.getGhostCorners", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMStag.pyx":398 * return (asInt(x), asInt(y), asInt(z))[:dim], (asInt(m), asInt(n), asInt(p))[:dim] * * def getLocalSizes(self) -> tuple[int, ...]: # <<<<<<<<<<<<<< * """Return local elementwise sizes in each dimension. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_29getLocalSizes(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMStag_28getLocalSizes, "DMStag.getLocalSizes(self) -> tuple[int, ...]\nReturn local elementwise sizes in each dimension.\n\n Not collective.\n\n The returned value is calculated excluding ghost points.\n\n See Also\n --------\n getGlobalSizes, petsc.DMStagGetLocalSizes\n\n \nSource code at petsc4py/PETSc/DMStag.pyx:398"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_29getLocalSizes(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getLocalSizes (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getLocalSizes", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getLocalSizes", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_28getLocalSizes(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_28getLocalSizes(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self) { PetscInt __pyx_v_dim; PetscInt __pyx_v_m; PetscInt __pyx_v_n; PetscInt __pyx_v_p; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getLocalSizes", 1); /* "petsc4py/PETSc/DMStag.pyx":410 * * """ * cdef PetscInt dim=0, m=PETSC_DECIDE, n=PETSC_DECIDE, p=PETSC_DECIDE # <<<<<<<<<<<<<< * CHKERR( DMGetDimension(self.dm, &dim) ) * CHKERR( DMStagGetLocalSizes(self.dm, &m, &n, &p) ) */ __pyx_v_dim = 0; __pyx_v_m = PETSC_DECIDE; __pyx_v_n = PETSC_DECIDE; __pyx_v_p = PETSC_DECIDE; /* "petsc4py/PETSc/DMStag.pyx":411 * """ * cdef PetscInt dim=0, m=PETSC_DECIDE, n=PETSC_DECIDE, p=PETSC_DECIDE * CHKERR( DMGetDimension(self.dm, &dim) ) # <<<<<<<<<<<<<< * CHKERR( DMStagGetLocalSizes(self.dm, &m, &n, &p) ) * return toStagDims(dim, m, n, p) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetDimension(__pyx_v_self->__pyx_base.dm, (&__pyx_v_dim))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(58, 411, __pyx_L1_error) /* "petsc4py/PETSc/DMStag.pyx":412 * cdef PetscInt dim=0, m=PETSC_DECIDE, n=PETSC_DECIDE, p=PETSC_DECIDE * CHKERR( DMGetDimension(self.dm, &dim) ) * CHKERR( DMStagGetLocalSizes(self.dm, &m, &n, &p) ) # <<<<<<<<<<<<<< * return toStagDims(dim, m, n, p) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMStagGetLocalSizes(__pyx_v_self->__pyx_base.dm, (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_p))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(58, 412, __pyx_L1_error) /* "petsc4py/PETSc/DMStag.pyx":413 * CHKERR( DMGetDimension(self.dm, &dim) ) * CHKERR( DMStagGetLocalSizes(self.dm, &m, &n, &p) ) * return toStagDims(dim, m, n, p) # <<<<<<<<<<<<<< * * def getGlobalSizes(self) -> tuple[int, ...]: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toStagDims(__pyx_v_dim, __pyx_v_m, __pyx_v_n, __pyx_v_p); if (unlikely(!__pyx_t_2)) __PYX_ERR(58, 413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMStag.pyx":398 * return (asInt(x), asInt(y), asInt(z))[:dim], (asInt(m), asInt(n), asInt(p))[:dim] * * def getLocalSizes(self) -> tuple[int, ...]: # <<<<<<<<<<<<<< * """Return local elementwise sizes in each dimension. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.getLocalSizes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMStag.pyx":415 * return toStagDims(dim, m, n, p) * * def getGlobalSizes(self) -> tuple[int, ...]: # <<<<<<<<<<<<<< * """Return global element counts in each dimension. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_31getGlobalSizes(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMStag_30getGlobalSizes, "DMStag.getGlobalSizes(self) -> tuple[int, ...]\nReturn global element counts in each dimension.\n\n Not collective.\n\n See Also\n --------\n getLocalSizes, petsc.DMStagGetGlobalSizes\n\n \nSource code at petsc4py/PETSc/DMStag.pyx:415"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_31getGlobalSizes(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getGlobalSizes (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getGlobalSizes", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getGlobalSizes", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_30getGlobalSizes(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_30getGlobalSizes(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self) { PetscInt __pyx_v_dim; PetscInt __pyx_v_m; PetscInt __pyx_v_n; PetscInt __pyx_v_p; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getGlobalSizes", 1); /* "petsc4py/PETSc/DMStag.pyx":425 * * """ * cdef PetscInt dim=0, m=PETSC_DECIDE, n=PETSC_DECIDE, p=PETSC_DECIDE # <<<<<<<<<<<<<< * CHKERR( DMGetDimension(self.dm, &dim) ) * CHKERR( DMStagGetGlobalSizes(self.dm, &m, &n, &p) ) */ __pyx_v_dim = 0; __pyx_v_m = PETSC_DECIDE; __pyx_v_n = PETSC_DECIDE; __pyx_v_p = PETSC_DECIDE; /* "petsc4py/PETSc/DMStag.pyx":426 * """ * cdef PetscInt dim=0, m=PETSC_DECIDE, n=PETSC_DECIDE, p=PETSC_DECIDE * CHKERR( DMGetDimension(self.dm, &dim) ) # <<<<<<<<<<<<<< * CHKERR( DMStagGetGlobalSizes(self.dm, &m, &n, &p) ) * return toStagDims(dim, m, n, p) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetDimension(__pyx_v_self->__pyx_base.dm, (&__pyx_v_dim))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(58, 426, __pyx_L1_error) /* "petsc4py/PETSc/DMStag.pyx":427 * cdef PetscInt dim=0, m=PETSC_DECIDE, n=PETSC_DECIDE, p=PETSC_DECIDE * CHKERR( DMGetDimension(self.dm, &dim) ) * CHKERR( DMStagGetGlobalSizes(self.dm, &m, &n, &p) ) # <<<<<<<<<<<<<< * return toStagDims(dim, m, n, p) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMStagGetGlobalSizes(__pyx_v_self->__pyx_base.dm, (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_p))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(58, 427, __pyx_L1_error) /* "petsc4py/PETSc/DMStag.pyx":428 * CHKERR( DMGetDimension(self.dm, &dim) ) * CHKERR( DMStagGetGlobalSizes(self.dm, &m, &n, &p) ) * return toStagDims(dim, m, n, p) # <<<<<<<<<<<<<< * * def getProcSizes(self) -> tuple[int, ...]: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toStagDims(__pyx_v_dim, __pyx_v_m, __pyx_v_n, __pyx_v_p); if (unlikely(!__pyx_t_2)) __PYX_ERR(58, 428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMStag.pyx":415 * return toStagDims(dim, m, n, p) * * def getGlobalSizes(self) -> tuple[int, ...]: # <<<<<<<<<<<<<< * """Return global element counts in each dimension. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.getGlobalSizes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMStag.pyx":430 * return toStagDims(dim, m, n, p) * * def getProcSizes(self) -> tuple[int, ...]: # <<<<<<<<<<<<<< * """Return number of processes in each dimension. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_33getProcSizes(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMStag_32getProcSizes, "DMStag.getProcSizes(self) -> tuple[int, ...]\nReturn number of processes in each dimension.\n\n Not collective.\n\n See Also\n --------\n petsc.DMStagGetNumRanks\n\n \nSource code at petsc4py/PETSc/DMStag.pyx:430"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_33getProcSizes(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getProcSizes (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getProcSizes", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getProcSizes", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_32getProcSizes(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_32getProcSizes(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self) { PetscInt __pyx_v_dim; PetscInt __pyx_v_m; PetscInt __pyx_v_n; PetscInt __pyx_v_p; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getProcSizes", 1); /* "petsc4py/PETSc/DMStag.pyx":440 * * """ * cdef PetscInt dim=0, m=PETSC_DECIDE, n=PETSC_DECIDE, p=PETSC_DECIDE # <<<<<<<<<<<<<< * CHKERR( DMGetDimension(self.dm, &dim) ) * CHKERR( DMStagGetNumRanks(self.dm, &m, &n, &p) ) */ __pyx_v_dim = 0; __pyx_v_m = PETSC_DECIDE; __pyx_v_n = PETSC_DECIDE; __pyx_v_p = PETSC_DECIDE; /* "petsc4py/PETSc/DMStag.pyx":441 * """ * cdef PetscInt dim=0, m=PETSC_DECIDE, n=PETSC_DECIDE, p=PETSC_DECIDE * CHKERR( DMGetDimension(self.dm, &dim) ) # <<<<<<<<<<<<<< * CHKERR( DMStagGetNumRanks(self.dm, &m, &n, &p) ) * return toStagDims(dim, m, n, p) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetDimension(__pyx_v_self->__pyx_base.dm, (&__pyx_v_dim))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(58, 441, __pyx_L1_error) /* "petsc4py/PETSc/DMStag.pyx":442 * cdef PetscInt dim=0, m=PETSC_DECIDE, n=PETSC_DECIDE, p=PETSC_DECIDE * CHKERR( DMGetDimension(self.dm, &dim) ) * CHKERR( DMStagGetNumRanks(self.dm, &m, &n, &p) ) # <<<<<<<<<<<<<< * return toStagDims(dim, m, n, p) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMStagGetNumRanks(__pyx_v_self->__pyx_base.dm, (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_p))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(58, 442, __pyx_L1_error) /* "petsc4py/PETSc/DMStag.pyx":443 * CHKERR( DMGetDimension(self.dm, &dim) ) * CHKERR( DMStagGetNumRanks(self.dm, &m, &n, &p) ) * return toStagDims(dim, m, n, p) # <<<<<<<<<<<<<< * * def getStencilType(self) -> str: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toStagDims(__pyx_v_dim, __pyx_v_m, __pyx_v_n, __pyx_v_p); if (unlikely(!__pyx_t_2)) __PYX_ERR(58, 443, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMStag.pyx":430 * return toStagDims(dim, m, n, p) * * def getProcSizes(self) -> tuple[int, ...]: # <<<<<<<<<<<<<< * """Return number of processes in each dimension. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.getProcSizes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMStag.pyx":445 * return toStagDims(dim, m, n, p) * * def getStencilType(self) -> str: # <<<<<<<<<<<<<< * """Return elementwise ghost/halo stencil type. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_35getStencilType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMStag_34getStencilType, "DMStag.getStencilType(self) -> str\nReturn elementwise ghost/halo stencil type.\n\n Not collective.\n\n See Also\n --------\n setStencilType, petsc.DMStagGetStencilType\n\n \nSource code at petsc4py/PETSc/DMStag.pyx:445"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_35getStencilType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getStencilType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getStencilType", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getStencilType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_34getStencilType(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_34getStencilType(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self) { DMStagStencilType __pyx_v_stype; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getStencilType", 1); /* "petsc4py/PETSc/DMStag.pyx":455 * * """ * cdef PetscDMStagStencilType stype = DMSTAG_STENCIL_BOX # <<<<<<<<<<<<<< * CHKERR( DMStagGetStencilType(self.dm, &stype) ) * return toStagStencil(stype) */ __pyx_v_stype = DMSTAG_STENCIL_BOX; /* "petsc4py/PETSc/DMStag.pyx":456 * """ * cdef PetscDMStagStencilType stype = DMSTAG_STENCIL_BOX * CHKERR( DMStagGetStencilType(self.dm, &stype) ) # <<<<<<<<<<<<<< * return toStagStencil(stype) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMStagGetStencilType(__pyx_v_self->__pyx_base.dm, (&__pyx_v_stype))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(58, 456, __pyx_L1_error) /* "petsc4py/PETSc/DMStag.pyx":457 * cdef PetscDMStagStencilType stype = DMSTAG_STENCIL_BOX * CHKERR( DMStagGetStencilType(self.dm, &stype) ) * return toStagStencil(stype) # <<<<<<<<<<<<<< * * def getOwnershipRanges(self) -> tuple[Sequence[int], ...]: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toStagStencil(__pyx_v_stype); if (unlikely(!__pyx_t_2)) __PYX_ERR(58, 457, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMStag.pyx":445 * return toStagDims(dim, m, n, p) * * def getStencilType(self) -> str: # <<<<<<<<<<<<<< * """Return elementwise ghost/halo stencil type. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.getStencilType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMStag.pyx":459 * return toStagStencil(stype) * * def getOwnershipRanges(self) -> tuple[Sequence[int], ...]: # <<<<<<<<<<<<<< * """Return elements per process in each dimension. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_37getOwnershipRanges(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMStag_36getOwnershipRanges, "DMStag.getOwnershipRanges(self) -> tuple[Sequence[int], ...]\nReturn elements per process in each dimension.\n\n Not collective.\n\n See Also\n --------\n setOwnershipRanges, petsc.DMStagGetOwnershipRanges\n\n \nSource code at petsc4py/PETSc/DMStag.pyx:459"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_37getOwnershipRanges(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getOwnershipRanges (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getOwnershipRanges", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getOwnershipRanges", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_36getOwnershipRanges(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_36getOwnershipRanges(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self) { PetscInt __pyx_v_dim; PetscInt __pyx_v_m; PetscInt __pyx_v_n; PetscInt __pyx_v_p; PetscInt const *__pyx_v_lx; PetscInt const *__pyx_v_ly; PetscInt const *__pyx_v_lz; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getOwnershipRanges", 1); /* "petsc4py/PETSc/DMStag.pyx":469 * * """ * cdef PetscInt dim=0, m=0, n=0, p=0 # <<<<<<<<<<<<<< * cdef const PetscInt *lx = NULL, *ly = NULL, *lz = NULL * CHKERR( DMGetDimension(self.dm, &dim) ) */ __pyx_v_dim = 0; __pyx_v_m = 0; __pyx_v_n = 0; __pyx_v_p = 0; /* "petsc4py/PETSc/DMStag.pyx":470 * """ * cdef PetscInt dim=0, m=0, n=0, p=0 * cdef const PetscInt *lx = NULL, *ly = NULL, *lz = NULL # <<<<<<<<<<<<<< * CHKERR( DMGetDimension(self.dm, &dim) ) * CHKERR( DMStagGetNumRanks(self.dm, &m, &n, &p) ) */ __pyx_v_lx = NULL; __pyx_v_ly = NULL; __pyx_v_lz = NULL; /* "petsc4py/PETSc/DMStag.pyx":471 * cdef PetscInt dim=0, m=0, n=0, p=0 * cdef const PetscInt *lx = NULL, *ly = NULL, *lz = NULL * CHKERR( DMGetDimension(self.dm, &dim) ) # <<<<<<<<<<<<<< * CHKERR( DMStagGetNumRanks(self.dm, &m, &n, &p) ) * CHKERR( DMStagGetOwnershipRanges(self.dm, &lx, &ly, &lz) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetDimension(__pyx_v_self->__pyx_base.dm, (&__pyx_v_dim))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(58, 471, __pyx_L1_error) /* "petsc4py/PETSc/DMStag.pyx":472 * cdef const PetscInt *lx = NULL, *ly = NULL, *lz = NULL * CHKERR( DMGetDimension(self.dm, &dim) ) * CHKERR( DMStagGetNumRanks(self.dm, &m, &n, &p) ) # <<<<<<<<<<<<<< * CHKERR( DMStagGetOwnershipRanges(self.dm, &lx, &ly, &lz) ) * return toStagOwnershipRanges(dim, m, n, p, lx, ly, lz) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMStagGetNumRanks(__pyx_v_self->__pyx_base.dm, (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_p))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(58, 472, __pyx_L1_error) /* "petsc4py/PETSc/DMStag.pyx":473 * CHKERR( DMGetDimension(self.dm, &dim) ) * CHKERR( DMStagGetNumRanks(self.dm, &m, &n, &p) ) * CHKERR( DMStagGetOwnershipRanges(self.dm, &lx, &ly, &lz) ) # <<<<<<<<<<<<<< * return toStagOwnershipRanges(dim, m, n, p, lx, ly, lz) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMStagGetOwnershipRanges(__pyx_v_self->__pyx_base.dm, (&__pyx_v_lx), (&__pyx_v_ly), (&__pyx_v_lz))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(58, 473, __pyx_L1_error) /* "petsc4py/PETSc/DMStag.pyx":474 * CHKERR( DMStagGetNumRanks(self.dm, &m, &n, &p) ) * CHKERR( DMStagGetOwnershipRanges(self.dm, &lx, &ly, &lz) ) * return toStagOwnershipRanges(dim, m, n, p, lx, ly, lz) # <<<<<<<<<<<<<< * * def getBoundaryTypes(self) -> tuple[str, ...]: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toStagOwnershipRanges(__pyx_v_dim, __pyx_v_m, __pyx_v_n, __pyx_v_p, __pyx_v_lx, __pyx_v_ly, __pyx_v_lz); if (unlikely(!__pyx_t_2)) __PYX_ERR(58, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMStag.pyx":459 * return toStagStencil(stype) * * def getOwnershipRanges(self) -> tuple[Sequence[int], ...]: # <<<<<<<<<<<<<< * """Return elements per process in each dimension. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.getOwnershipRanges", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMStag.pyx":476 * return toStagOwnershipRanges(dim, m, n, p, lx, ly, lz) * * def getBoundaryTypes(self) -> tuple[str, ...]: # <<<<<<<<<<<<<< * """Return boundary types in each dimension. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_39getBoundaryTypes(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMStag_38getBoundaryTypes, "DMStag.getBoundaryTypes(self) -> tuple[str, ...]\nReturn boundary types in each dimension.\n\n Not collective.\n\n See Also\n --------\n setBoundaryTypes, petsc.DMStagGetBoundaryTypes\n\n \nSource code at petsc4py/PETSc/DMStag.pyx:476"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_39getBoundaryTypes(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getBoundaryTypes (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getBoundaryTypes", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getBoundaryTypes", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_38getBoundaryTypes(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_38getBoundaryTypes(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self) { PetscInt __pyx_v_dim; DMBoundaryType __pyx_v_btx; DMBoundaryType __pyx_v_bty; DMBoundaryType __pyx_v_btz; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getBoundaryTypes", 1); /* "petsc4py/PETSc/DMStag.pyx":486 * * """ * cdef PetscInt dim=0 # <<<<<<<<<<<<<< * cdef PetscDMBoundaryType btx = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE */ __pyx_v_dim = 0; /* "petsc4py/PETSc/DMStag.pyx":487 * """ * cdef PetscInt dim=0 * cdef PetscDMBoundaryType btx = DM_BOUNDARY_NONE # <<<<<<<<<<<<<< * cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE */ __pyx_v_btx = DM_BOUNDARY_NONE; /* "petsc4py/PETSc/DMStag.pyx":488 * cdef PetscInt dim=0 * cdef PetscDMBoundaryType btx = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE # <<<<<<<<<<<<<< * cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE * CHKERR( DMGetDimension(self.dm, &dim) ) */ __pyx_v_bty = DM_BOUNDARY_NONE; /* "petsc4py/PETSc/DMStag.pyx":489 * cdef PetscDMBoundaryType btx = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE # <<<<<<<<<<<<<< * CHKERR( DMGetDimension(self.dm, &dim) ) * CHKERR( DMStagGetBoundaryTypes(self.dm, &btx, &bty, &btz) ) */ __pyx_v_btz = DM_BOUNDARY_NONE; /* "petsc4py/PETSc/DMStag.pyx":490 * cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE * CHKERR( DMGetDimension(self.dm, &dim) ) # <<<<<<<<<<<<<< * CHKERR( DMStagGetBoundaryTypes(self.dm, &btx, &bty, &btz) ) * return toStagBoundaryTypes(dim, btx, bty, btz) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetDimension(__pyx_v_self->__pyx_base.dm, (&__pyx_v_dim))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(58, 490, __pyx_L1_error) /* "petsc4py/PETSc/DMStag.pyx":491 * cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE * CHKERR( DMGetDimension(self.dm, &dim) ) * CHKERR( DMStagGetBoundaryTypes(self.dm, &btx, &bty, &btz) ) # <<<<<<<<<<<<<< * return toStagBoundaryTypes(dim, btx, bty, btz) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMStagGetBoundaryTypes(__pyx_v_self->__pyx_base.dm, (&__pyx_v_btx), (&__pyx_v_bty), (&__pyx_v_btz))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(58, 491, __pyx_L1_error) /* "petsc4py/PETSc/DMStag.pyx":492 * CHKERR( DMGetDimension(self.dm, &dim) ) * CHKERR( DMStagGetBoundaryTypes(self.dm, &btx, &bty, &btz) ) * return toStagBoundaryTypes(dim, btx, bty, btz) # <<<<<<<<<<<<<< * * def getIsFirstRank(self) -> tuple[int, ...]: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toStagBoundaryTypes(__pyx_v_dim, __pyx_v_btx, __pyx_v_bty, __pyx_v_btz); if (unlikely(!__pyx_t_2)) __PYX_ERR(58, 492, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMStag.pyx":476 * return toStagOwnershipRanges(dim, m, n, p, lx, ly, lz) * * def getBoundaryTypes(self) -> tuple[str, ...]: # <<<<<<<<<<<<<< * """Return boundary types in each dimension. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.getBoundaryTypes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMStag.pyx":494 * return toStagBoundaryTypes(dim, btx, bty, btz) * * def getIsFirstRank(self) -> tuple[int, ...]: # <<<<<<<<<<<<<< * """Return whether this process is first in each dimension in the process grid. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_41getIsFirstRank(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMStag_40getIsFirstRank, "DMStag.getIsFirstRank(self) -> tuple[int, ...]\nReturn whether this process is first in each dimension in the process grid.\n\n Not collective.\n\n See Also\n --------\n petsc.DMStagGetIsFirstRank\n\n \nSource code at petsc4py/PETSc/DMStag.pyx:494"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_41getIsFirstRank(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getIsFirstRank (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getIsFirstRank", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getIsFirstRank", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_40getIsFirstRank(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_40getIsFirstRank(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self) { PetscBool __pyx_v_rank0; PetscBool __pyx_v_rank1; PetscBool __pyx_v_rank2; PetscInt __pyx_v_dim; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getIsFirstRank", 1); /* "petsc4py/PETSc/DMStag.pyx":504 * * """ * cdef PetscBool rank0=PETSC_FALSE, rank1=PETSC_FALSE, rank2=PETSC_FALSE # <<<<<<<<<<<<<< * cdef PetscInt dim=0 * CHKERR( DMGetDimension(self.dm, &dim) ) */ __pyx_v_rank0 = PETSC_FALSE; __pyx_v_rank1 = PETSC_FALSE; __pyx_v_rank2 = PETSC_FALSE; /* "petsc4py/PETSc/DMStag.pyx":505 * """ * cdef PetscBool rank0=PETSC_FALSE, rank1=PETSC_FALSE, rank2=PETSC_FALSE * cdef PetscInt dim=0 # <<<<<<<<<<<<<< * CHKERR( DMGetDimension(self.dm, &dim) ) * CHKERR( DMStagGetIsFirstRank(self.dm, &rank0, &rank1, &rank2) ) */ __pyx_v_dim = 0; /* "petsc4py/PETSc/DMStag.pyx":506 * cdef PetscBool rank0=PETSC_FALSE, rank1=PETSC_FALSE, rank2=PETSC_FALSE * cdef PetscInt dim=0 * CHKERR( DMGetDimension(self.dm, &dim) ) # <<<<<<<<<<<<<< * CHKERR( DMStagGetIsFirstRank(self.dm, &rank0, &rank1, &rank2) ) * return toStagDims(dim, rank0, rank1, rank2) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetDimension(__pyx_v_self->__pyx_base.dm, (&__pyx_v_dim))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(58, 506, __pyx_L1_error) /* "petsc4py/PETSc/DMStag.pyx":507 * cdef PetscInt dim=0 * CHKERR( DMGetDimension(self.dm, &dim) ) * CHKERR( DMStagGetIsFirstRank(self.dm, &rank0, &rank1, &rank2) ) # <<<<<<<<<<<<<< * return toStagDims(dim, rank0, rank1, rank2) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMStagGetIsFirstRank(__pyx_v_self->__pyx_base.dm, (&__pyx_v_rank0), (&__pyx_v_rank1), (&__pyx_v_rank2))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(58, 507, __pyx_L1_error) /* "petsc4py/PETSc/DMStag.pyx":508 * CHKERR( DMGetDimension(self.dm, &dim) ) * CHKERR( DMStagGetIsFirstRank(self.dm, &rank0, &rank1, &rank2) ) * return toStagDims(dim, rank0, rank1, rank2) # <<<<<<<<<<<<<< * * def getIsLastRank(self) -> tuple[int, ...]: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toStagDims(__pyx_v_dim, __pyx_v_rank0, __pyx_v_rank1, __pyx_v_rank2); if (unlikely(!__pyx_t_2)) __PYX_ERR(58, 508, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMStag.pyx":494 * return toStagBoundaryTypes(dim, btx, bty, btz) * * def getIsFirstRank(self) -> tuple[int, ...]: # <<<<<<<<<<<<<< * """Return whether this process is first in each dimension in the process grid. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.getIsFirstRank", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMStag.pyx":510 * return toStagDims(dim, rank0, rank1, rank2) * * def getIsLastRank(self) -> tuple[int, ...]: # <<<<<<<<<<<<<< * """Return whether this process is last in each dimension in the process grid. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_43getIsLastRank(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMStag_42getIsLastRank, "DMStag.getIsLastRank(self) -> tuple[int, ...]\nReturn whether this process is last in each dimension in the process grid.\n\n Not collective.\n\n See Also\n --------\n petsc.DMStagGetIsLastRank\n\n \nSource code at petsc4py/PETSc/DMStag.pyx:510"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_43getIsLastRank(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getIsLastRank (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getIsLastRank", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getIsLastRank", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_42getIsLastRank(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_42getIsLastRank(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self) { PetscBool __pyx_v_rank0; PetscBool __pyx_v_rank1; PetscBool __pyx_v_rank2; PetscInt __pyx_v_dim; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getIsLastRank", 1); /* "petsc4py/PETSc/DMStag.pyx":520 * * """ * cdef PetscBool rank0=PETSC_FALSE, rank1=PETSC_FALSE, rank2=PETSC_FALSE # <<<<<<<<<<<<<< * cdef PetscInt dim=0 * CHKERR( DMGetDimension(self.dm, &dim) ) */ __pyx_v_rank0 = PETSC_FALSE; __pyx_v_rank1 = PETSC_FALSE; __pyx_v_rank2 = PETSC_FALSE; /* "petsc4py/PETSc/DMStag.pyx":521 * """ * cdef PetscBool rank0=PETSC_FALSE, rank1=PETSC_FALSE, rank2=PETSC_FALSE * cdef PetscInt dim=0 # <<<<<<<<<<<<<< * CHKERR( DMGetDimension(self.dm, &dim) ) * CHKERR( DMStagGetIsLastRank(self.dm, &rank0, &rank1, &rank2) ) */ __pyx_v_dim = 0; /* "petsc4py/PETSc/DMStag.pyx":522 * cdef PetscBool rank0=PETSC_FALSE, rank1=PETSC_FALSE, rank2=PETSC_FALSE * cdef PetscInt dim=0 * CHKERR( DMGetDimension(self.dm, &dim) ) # <<<<<<<<<<<<<< * CHKERR( DMStagGetIsLastRank(self.dm, &rank0, &rank1, &rank2) ) * return toStagDims(dim, rank0, rank1, rank2) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetDimension(__pyx_v_self->__pyx_base.dm, (&__pyx_v_dim))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(58, 522, __pyx_L1_error) /* "petsc4py/PETSc/DMStag.pyx":523 * cdef PetscInt dim=0 * CHKERR( DMGetDimension(self.dm, &dim) ) * CHKERR( DMStagGetIsLastRank(self.dm, &rank0, &rank1, &rank2) ) # <<<<<<<<<<<<<< * return toStagDims(dim, rank0, rank1, rank2) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMStagGetIsLastRank(__pyx_v_self->__pyx_base.dm, (&__pyx_v_rank0), (&__pyx_v_rank1), (&__pyx_v_rank2))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(58, 523, __pyx_L1_error) /* "petsc4py/PETSc/DMStag.pyx":524 * CHKERR( DMGetDimension(self.dm, &dim) ) * CHKERR( DMStagGetIsLastRank(self.dm, &rank0, &rank1, &rank2) ) * return toStagDims(dim, rank0, rank1, rank2) # <<<<<<<<<<<<<< * * # Coordinate-related functions */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toStagDims(__pyx_v_dim, __pyx_v_rank0, __pyx_v_rank1, __pyx_v_rank2); if (unlikely(!__pyx_t_2)) __PYX_ERR(58, 524, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMStag.pyx":510 * return toStagDims(dim, rank0, rank1, rank2) * * def getIsLastRank(self) -> tuple[int, ...]: # <<<<<<<<<<<<<< * """Return whether this process is last in each dimension in the process grid. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.getIsLastRank", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMStag.pyx":528 * # Coordinate-related functions * * def setUniformCoordinatesExplicit( # <<<<<<<<<<<<<< * self, * xmin: float = 0, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_45setUniformCoordinatesExplicit(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMStag_44setUniformCoordinatesExplicit, "DMStag.setUniformCoordinatesExplicit(self, xmin: float = 0, xmax: float = 1, ymin: float = 0, ymax: float = 1, zmin: float = 0, zmax: float = 1) -> None\nSet coordinates to be a uniform grid, storing all values.\n\n Collective.\n\n Parameters\n ----------\n xmin\n The minimum global coordinate value in the x dimension.\n xmax\n The maximum global coordinate value in the x dimension.\n ymin\n The minimum global coordinate value in the y dimension.\n ymax\n The maximum global coordinate value in the y dimension.\n zmin\n The minimum global coordinate value in the z dimension.\n zmax\n The maximum global coordinate value in the z dimension.\n\n See Also\n --------\n setUniformCoordinatesProduct, setUniformCoordinates\n petsc.DMStagSetUniformCoordinatesExplicit\n\n \nSource code at petsc4py/PETSc/DMStag.pyx:528"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_45setUniformCoordinatesExplicit(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_xmin = 0; PyObject *__pyx_v_xmax = 0; PyObject *__pyx_v_ymin = 0; PyObject *__pyx_v_ymax = 0; PyObject *__pyx_v_zmin = 0; PyObject *__pyx_v_zmax = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[6] = {0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setUniformCoordinatesExplicit (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_xmin,&__pyx_n_s_xmax,&__pyx_n_s_ymin,&__pyx_n_s_ymax,&__pyx_n_s_zmin,&__pyx_n_s_zmax,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_0)); values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_1)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_0)); values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_1)); values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_0)); values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_1)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_xmin); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(58, 528, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_xmax); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(58, 528, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ymin); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(58, 528, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ymax); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(58, 528, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_zmin); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(58, 528, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_zmax); if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(58, 528, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setUniformCoordinatesExplicit") < 0)) __PYX_ERR(58, 528, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_xmin = values[0]; __pyx_v_xmax = values[1]; __pyx_v_ymin = values[2]; __pyx_v_ymax = values[3]; __pyx_v_zmin = values[4]; __pyx_v_zmax = values[5]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setUniformCoordinatesExplicit", 0, 0, 6, __pyx_nargs); __PYX_ERR(58, 528, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMStag.setUniformCoordinatesExplicit", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_44setUniformCoordinatesExplicit(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self), __pyx_v_xmin, __pyx_v_xmax, __pyx_v_ymin, __pyx_v_ymax, __pyx_v_zmin, __pyx_v_zmax); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_44setUniformCoordinatesExplicit(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_xmin, PyObject *__pyx_v_xmax, PyObject *__pyx_v_ymin, PyObject *__pyx_v_ymax, PyObject *__pyx_v_zmin, PyObject *__pyx_v_zmax) { PetscReal __pyx_v__xmin; PetscReal __pyx_v__xmax; PetscReal __pyx_v__ymin; PetscReal __pyx_v__ymax; PetscReal __pyx_v__zmin; PetscReal __pyx_v__zmax; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setUniformCoordinatesExplicit", 1); /* "petsc4py/PETSc/DMStag.pyx":562 * * """ * cdef PetscReal _xmin = asReal(xmin), _xmax = asReal(xmax) # <<<<<<<<<<<<<< * cdef PetscReal _ymin = asReal(ymin), _ymax = asReal(ymax) * cdef PetscReal _zmin = asReal(zmin), _zmax = asReal(zmax) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_xmin); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(58, 562, __pyx_L1_error) __pyx_v__xmin = __pyx_t_1; __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_xmax); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(58, 562, __pyx_L1_error) __pyx_v__xmax = __pyx_t_1; /* "petsc4py/PETSc/DMStag.pyx":563 * """ * cdef PetscReal _xmin = asReal(xmin), _xmax = asReal(xmax) * cdef PetscReal _ymin = asReal(ymin), _ymax = asReal(ymax) # <<<<<<<<<<<<<< * cdef PetscReal _zmin = asReal(zmin), _zmax = asReal(zmax) * CHKERR( DMStagSetUniformCoordinatesExplicit(self.dm, _xmin, _xmax, _ymin, _ymax, _zmin, _zmax) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_ymin); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(58, 563, __pyx_L1_error) __pyx_v__ymin = __pyx_t_1; __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_ymax); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(58, 563, __pyx_L1_error) __pyx_v__ymax = __pyx_t_1; /* "petsc4py/PETSc/DMStag.pyx":564 * cdef PetscReal _xmin = asReal(xmin), _xmax = asReal(xmax) * cdef PetscReal _ymin = asReal(ymin), _ymax = asReal(ymax) * cdef PetscReal _zmin = asReal(zmin), _zmax = asReal(zmax) # <<<<<<<<<<<<<< * CHKERR( DMStagSetUniformCoordinatesExplicit(self.dm, _xmin, _xmax, _ymin, _ymax, _zmin, _zmax) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_zmin); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(58, 564, __pyx_L1_error) __pyx_v__zmin = __pyx_t_1; __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_zmax); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(58, 564, __pyx_L1_error) __pyx_v__zmax = __pyx_t_1; /* "petsc4py/PETSc/DMStag.pyx":565 * cdef PetscReal _ymin = asReal(ymin), _ymax = asReal(ymax) * cdef PetscReal _zmin = asReal(zmin), _zmax = asReal(zmax) * CHKERR( DMStagSetUniformCoordinatesExplicit(self.dm, _xmin, _xmax, _ymin, _ymax, _zmin, _zmax) ) # <<<<<<<<<<<<<< * * def setUniformCoordinatesProduct( */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMStagSetUniformCoordinatesExplicit(__pyx_v_self->__pyx_base.dm, __pyx_v__xmin, __pyx_v__xmax, __pyx_v__ymin, __pyx_v__ymax, __pyx_v__zmin, __pyx_v__zmax)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(58, 565, __pyx_L1_error) /* "petsc4py/PETSc/DMStag.pyx":528 * # Coordinate-related functions * * def setUniformCoordinatesExplicit( # <<<<<<<<<<<<<< * self, * xmin: float = 0, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMStag.setUniformCoordinatesExplicit", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMStag.pyx":567 * CHKERR( DMStagSetUniformCoordinatesExplicit(self.dm, _xmin, _xmax, _ymin, _ymax, _zmin, _zmax) ) * * def setUniformCoordinatesProduct( # <<<<<<<<<<<<<< * self, * xmin: float = 0, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_47setUniformCoordinatesProduct(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMStag_46setUniformCoordinatesProduct, "DMStag.setUniformCoordinatesProduct(self, xmin: float = 0, xmax: float = 1, ymin: float = 0, ymax: float = 1, zmin: float = 0, zmax: float = 1) -> None\nCreate uniform coordinates, as a product of 1D arrays.\n\n Collective.\n\n The per-dimension 1-dimensional `DMStag` objects that comprise the\n product always have active 0-cells (vertices, element boundaries) and\n 1-cells (element centers).\n\n Parameters\n ----------\n xmin\n The minimum global coordinate value in the x dimension.\n xmax\n The maximum global coordinate value in the x dimension.\n ymin\n The minimum global coordinate value in the y dimension.\n ymax\n The maximum global coordinate value in the y dimension.\n zmin\n The minimum global coordinate value in the z dimension.\n zmax\n The maximum global coordinate value in the z dimension.\n\n See Also\n --------\n setUniformCoordinatesExplicit, setUniformCoordinates\n petsc.DMStagSetUniformCoordinatesProduct\n\n \nSource code at petsc4py/PETSc/DMStag.pyx:567"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_47setUniformCoordinatesProduct(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_xmin = 0; PyObject *__pyx_v_xmax = 0; PyObject *__pyx_v_ymin = 0; PyObject *__pyx_v_ymax = 0; PyObject *__pyx_v_zmin = 0; PyObject *__pyx_v_zmax = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[6] = {0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setUniformCoordinatesProduct (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_xmin,&__pyx_n_s_xmax,&__pyx_n_s_ymin,&__pyx_n_s_ymax,&__pyx_n_s_zmin,&__pyx_n_s_zmax,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_0)); values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_1)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_0)); values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_1)); values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_0)); values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_1)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_xmin); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(58, 567, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_xmax); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(58, 567, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ymin); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(58, 567, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ymax); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(58, 567, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_zmin); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(58, 567, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_zmax); if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(58, 567, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setUniformCoordinatesProduct") < 0)) __PYX_ERR(58, 567, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_xmin = values[0]; __pyx_v_xmax = values[1]; __pyx_v_ymin = values[2]; __pyx_v_ymax = values[3]; __pyx_v_zmin = values[4]; __pyx_v_zmax = values[5]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setUniformCoordinatesProduct", 0, 0, 6, __pyx_nargs); __PYX_ERR(58, 567, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMStag.setUniformCoordinatesProduct", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_46setUniformCoordinatesProduct(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self), __pyx_v_xmin, __pyx_v_xmax, __pyx_v_ymin, __pyx_v_ymax, __pyx_v_zmin, __pyx_v_zmax); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_46setUniformCoordinatesProduct(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_xmin, PyObject *__pyx_v_xmax, PyObject *__pyx_v_ymin, PyObject *__pyx_v_ymax, PyObject *__pyx_v_zmin, PyObject *__pyx_v_zmax) { PetscReal __pyx_v__xmin; PetscReal __pyx_v__xmax; PetscReal __pyx_v__ymin; PetscReal __pyx_v__ymax; PetscReal __pyx_v__zmin; PetscReal __pyx_v__zmax; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setUniformCoordinatesProduct", 1); /* "petsc4py/PETSc/DMStag.pyx":605 * * """ * cdef PetscReal _xmin = asReal(xmin), _xmax = asReal(xmax) # <<<<<<<<<<<<<< * cdef PetscReal _ymin = asReal(ymin), _ymax = asReal(ymax) * cdef PetscReal _zmin = asReal(zmin), _zmax = asReal(zmax) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_xmin); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(58, 605, __pyx_L1_error) __pyx_v__xmin = __pyx_t_1; __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_xmax); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(58, 605, __pyx_L1_error) __pyx_v__xmax = __pyx_t_1; /* "petsc4py/PETSc/DMStag.pyx":606 * """ * cdef PetscReal _xmin = asReal(xmin), _xmax = asReal(xmax) * cdef PetscReal _ymin = asReal(ymin), _ymax = asReal(ymax) # <<<<<<<<<<<<<< * cdef PetscReal _zmin = asReal(zmin), _zmax = asReal(zmax) * CHKERR( DMStagSetUniformCoordinatesProduct(self.dm, _xmin, _xmax, _ymin, _ymax, _zmin, _zmax) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_ymin); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(58, 606, __pyx_L1_error) __pyx_v__ymin = __pyx_t_1; __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_ymax); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(58, 606, __pyx_L1_error) __pyx_v__ymax = __pyx_t_1; /* "petsc4py/PETSc/DMStag.pyx":607 * cdef PetscReal _xmin = asReal(xmin), _xmax = asReal(xmax) * cdef PetscReal _ymin = asReal(ymin), _ymax = asReal(ymax) * cdef PetscReal _zmin = asReal(zmin), _zmax = asReal(zmax) # <<<<<<<<<<<<<< * CHKERR( DMStagSetUniformCoordinatesProduct(self.dm, _xmin, _xmax, _ymin, _ymax, _zmin, _zmax) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_zmin); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(58, 607, __pyx_L1_error) __pyx_v__zmin = __pyx_t_1; __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_zmax); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(58, 607, __pyx_L1_error) __pyx_v__zmax = __pyx_t_1; /* "petsc4py/PETSc/DMStag.pyx":608 * cdef PetscReal _ymin = asReal(ymin), _ymax = asReal(ymax) * cdef PetscReal _zmin = asReal(zmin), _zmax = asReal(zmax) * CHKERR( DMStagSetUniformCoordinatesProduct(self.dm, _xmin, _xmax, _ymin, _ymax, _zmin, _zmax) ) # <<<<<<<<<<<<<< * * def setUniformCoordinates( */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMStagSetUniformCoordinatesProduct(__pyx_v_self->__pyx_base.dm, __pyx_v__xmin, __pyx_v__xmax, __pyx_v__ymin, __pyx_v__ymax, __pyx_v__zmin, __pyx_v__zmax)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(58, 608, __pyx_L1_error) /* "petsc4py/PETSc/DMStag.pyx":567 * CHKERR( DMStagSetUniformCoordinatesExplicit(self.dm, _xmin, _xmax, _ymin, _ymax, _zmin, _zmax) ) * * def setUniformCoordinatesProduct( # <<<<<<<<<<<<<< * self, * xmin: float = 0, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMStag.setUniformCoordinatesProduct", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMStag.pyx":610 * CHKERR( DMStagSetUniformCoordinatesProduct(self.dm, _xmin, _xmax, _ymin, _ymax, _zmin, _zmax) ) * * def setUniformCoordinates( # <<<<<<<<<<<<<< * self, * xmin: float = 0, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_49setUniformCoordinates(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMStag_48setUniformCoordinates, "DMStag.setUniformCoordinates(self, xmin: float = 0, xmax: float = 1, ymin: float = 0, ymax: float = 1, zmin: float = 0, zmax: float = 1) -> None\nSet the coordinates to be a uniform grid..\n\n Collective.\n\n Local coordinates are populated, linearly extrapolated to ghost cells,\n including those outside the physical domain. This is also done in case\n of periodic boundaries, meaning that the same global point may have\n different coordinates in different local representations, which are\n equivalent assuming a periodicity implied by the arguments to this\n function, i.e., two points are equivalent if their difference is a\n multiple of ``xmax-xmin`` in the x dimension, ``ymax-ymin`` in the y\n dimension, and ``zmax-zmin`` in the z dimension.\n\n Parameters\n ----------\n xmin\n The minimum global coordinate value in the x dimension.\n xmax\n The maximum global coordinate value in the x dimension.\n ymin\n The minimum global coordinate value in the y dimension.\n ymax\n The maximum global coordinate value in the y dimension.\n zmin\n The minimum global coordinate value in the z dimension.\n zmax\n The maximum global coordinate value in the z dimension.\n\n See Also\n --------\n setUniformCoordinatesExplicit, setUniformCoordinatesProduct\n petsc.DMStagSetUniformCoordinates\n\n \nSource code at petsc4py/PETSc/DMStag.pyx:610"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_49setUniformCoordinates(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_xmin = 0; PyObject *__pyx_v_xmax = 0; PyObject *__pyx_v_ymin = 0; PyObject *__pyx_v_ymax = 0; PyObject *__pyx_v_zmin = 0; PyObject *__pyx_v_zmax = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[6] = {0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setUniformCoordinates (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_xmin,&__pyx_n_s_xmax,&__pyx_n_s_ymin,&__pyx_n_s_ymax,&__pyx_n_s_zmin,&__pyx_n_s_zmax,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_0)); values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_1)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_0)); values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_1)); values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_0)); values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_1)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_xmin); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(58, 610, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_xmax); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(58, 610, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ymin); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(58, 610, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ymax); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(58, 610, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_zmin); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(58, 610, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_zmax); if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(58, 610, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setUniformCoordinates") < 0)) __PYX_ERR(58, 610, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_xmin = values[0]; __pyx_v_xmax = values[1]; __pyx_v_ymin = values[2]; __pyx_v_ymax = values[3]; __pyx_v_zmin = values[4]; __pyx_v_zmax = values[5]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setUniformCoordinates", 0, 0, 6, __pyx_nargs); __PYX_ERR(58, 610, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMStag.setUniformCoordinates", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_48setUniformCoordinates(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self), __pyx_v_xmin, __pyx_v_xmax, __pyx_v_ymin, __pyx_v_ymax, __pyx_v_zmin, __pyx_v_zmax); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_48setUniformCoordinates(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_xmin, PyObject *__pyx_v_xmax, PyObject *__pyx_v_ymin, PyObject *__pyx_v_ymax, PyObject *__pyx_v_zmin, PyObject *__pyx_v_zmax) { PetscReal __pyx_v__xmin; PetscReal __pyx_v__xmax; PetscReal __pyx_v__ymin; PetscReal __pyx_v__ymax; PetscReal __pyx_v__zmin; PetscReal __pyx_v__zmax; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setUniformCoordinates", 1); /* "petsc4py/PETSc/DMStag.pyx":653 * * """ * cdef PetscReal _xmin = asReal(xmin), _xmax = asReal(xmax) # <<<<<<<<<<<<<< * cdef PetscReal _ymin = asReal(ymin), _ymax = asReal(ymax) * cdef PetscReal _zmin = asReal(zmin), _zmax = asReal(zmax) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_xmin); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(58, 653, __pyx_L1_error) __pyx_v__xmin = __pyx_t_1; __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_xmax); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(58, 653, __pyx_L1_error) __pyx_v__xmax = __pyx_t_1; /* "petsc4py/PETSc/DMStag.pyx":654 * """ * cdef PetscReal _xmin = asReal(xmin), _xmax = asReal(xmax) * cdef PetscReal _ymin = asReal(ymin), _ymax = asReal(ymax) # <<<<<<<<<<<<<< * cdef PetscReal _zmin = asReal(zmin), _zmax = asReal(zmax) * CHKERR( DMStagSetUniformCoordinates(self.dm, _xmin, _xmax, _ymin, _ymax, _zmin, _zmax) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_ymin); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(58, 654, __pyx_L1_error) __pyx_v__ymin = __pyx_t_1; __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_ymax); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(58, 654, __pyx_L1_error) __pyx_v__ymax = __pyx_t_1; /* "petsc4py/PETSc/DMStag.pyx":655 * cdef PetscReal _xmin = asReal(xmin), _xmax = asReal(xmax) * cdef PetscReal _ymin = asReal(ymin), _ymax = asReal(ymax) * cdef PetscReal _zmin = asReal(zmin), _zmax = asReal(zmax) # <<<<<<<<<<<<<< * CHKERR( DMStagSetUniformCoordinates(self.dm, _xmin, _xmax, _ymin, _ymax, _zmin, _zmax) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_zmin); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(58, 655, __pyx_L1_error) __pyx_v__zmin = __pyx_t_1; __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_zmax); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(58, 655, __pyx_L1_error) __pyx_v__zmax = __pyx_t_1; /* "petsc4py/PETSc/DMStag.pyx":656 * cdef PetscReal _ymin = asReal(ymin), _ymax = asReal(ymax) * cdef PetscReal _zmin = asReal(zmin), _zmax = asReal(zmax) * CHKERR( DMStagSetUniformCoordinates(self.dm, _xmin, _xmax, _ymin, _ymax, _zmin, _zmax) ) # <<<<<<<<<<<<<< * * def setCoordinateDMType(self, dmtype: DM.Type) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMStagSetUniformCoordinates(__pyx_v_self->__pyx_base.dm, __pyx_v__xmin, __pyx_v__xmax, __pyx_v__ymin, __pyx_v__ymax, __pyx_v__zmin, __pyx_v__zmax)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(58, 656, __pyx_L1_error) /* "petsc4py/PETSc/DMStag.pyx":610 * CHKERR( DMStagSetUniformCoordinatesProduct(self.dm, _xmin, _xmax, _ymin, _ymax, _zmin, _zmax) ) * * def setUniformCoordinates( # <<<<<<<<<<<<<< * self, * xmin: float = 0, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMStag.setUniformCoordinates", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMStag.pyx":658 * CHKERR( DMStagSetUniformCoordinates(self.dm, _xmin, _xmax, _ymin, _ymax, _zmin, _zmax) ) * * def setCoordinateDMType(self, dmtype: DM.Type) -> None: # <<<<<<<<<<<<<< * """Set the type to store coordinates. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_51setCoordinateDMType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMStag_50setCoordinateDMType, "DMStag.setCoordinateDMType(self, dmtype: DM.Type) -> None\nSet the type to store coordinates.\n\n Logically collective.\n\n Parameters\n ----------\n dmtype\n The type to store coordinates.\n\n See Also\n --------\n petsc.DMStagSetCoordinateDMType\n\n \nSource code at petsc4py/PETSc/DMStag.pyx:658"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_51setCoordinateDMType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_dmtype = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setCoordinateDMType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dmtype,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dmtype)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(58, 658, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setCoordinateDMType") < 0)) __PYX_ERR(58, 658, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_dmtype = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setCoordinateDMType", 1, 1, 1, __pyx_nargs); __PYX_ERR(58, 658, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMStag.setCoordinateDMType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_50setCoordinateDMType(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self), __pyx_v_dmtype); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_50setCoordinateDMType(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_dmtype) { DMType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setCoordinateDMType", 0); __Pyx_INCREF(__pyx_v_dmtype); /* "petsc4py/PETSc/DMStag.pyx":673 * * """ * cdef PetscDMType cval = NULL # <<<<<<<<<<<<<< * dmtype = str2bytes(dmtype, &cval) * CHKERR( DMStagSetCoordinateDMType(self.dm, cval) ) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/DMStag.pyx":674 * """ * cdef PetscDMType cval = NULL * dmtype = str2bytes(dmtype, &cval) # <<<<<<<<<<<<<< * CHKERR( DMStagSetCoordinateDMType(self.dm, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_dmtype, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(58, 674, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_dmtype, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DMStag.pyx":675 * cdef PetscDMType cval = NULL * dmtype = str2bytes(dmtype, &cval) * CHKERR( DMStagSetCoordinateDMType(self.dm, cval) ) # <<<<<<<<<<<<<< * * # Location slot related functions */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMStagSetCoordinateDMType(__pyx_v_self->__pyx_base.dm, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(58, 675, __pyx_L1_error) /* "petsc4py/PETSc/DMStag.pyx":658 * CHKERR( DMStagSetUniformCoordinates(self.dm, _xmin, _xmax, _ymin, _ymax, _zmin, _zmax) ) * * def setCoordinateDMType(self, dmtype: DM.Type) -> None: # <<<<<<<<<<<<<< * """Set the type to store coordinates. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.setCoordinateDMType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_dmtype); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMStag.pyx":679 * # Location slot related functions * * def getLocationSlot(self, loc: StencilLocation, c: int) -> int: # <<<<<<<<<<<<<< * """Return index to use in accessing raw local arrays. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_53getLocationSlot(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMStag_52getLocationSlot, "DMStag.getLocationSlot(self, loc: StencilLocation, c: int) -> int\nReturn index to use in accessing raw local arrays.\n\n Not collective.\n\n Parameters\n ----------\n loc\n Location relative to an element.\n c\n Component.\n\n See Also\n --------\n petsc.DMStagGetLocationSlot\n\n \nSource code at petsc4py/PETSc/DMStag.pyx:679"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_53getLocationSlot(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_loc = 0; PyObject *__pyx_v_c = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getLocationSlot (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loc,&__pyx_n_s_c,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_loc)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(58, 679, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_c)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(58, 679, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("getLocationSlot", 1, 2, 2, 1); __PYX_ERR(58, 679, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getLocationSlot") < 0)) __PYX_ERR(58, 679, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_loc = values[0]; __pyx_v_c = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getLocationSlot", 1, 2, 2, __pyx_nargs); __PYX_ERR(58, 679, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMStag.getLocationSlot", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_52getLocationSlot(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self), __pyx_v_loc, __pyx_v_c); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_52getLocationSlot(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_loc, PyObject *__pyx_v_c) { PetscInt __pyx_v_slot; PetscInt __pyx_v_comp; DMStagStencilLocation __pyx_v_sloc; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; DMStagStencilLocation __pyx_t_2; PetscErrorCode __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getLocationSlot", 1); /* "petsc4py/PETSc/DMStag.pyx":696 * * """ * cdef PetscInt slot=0 # <<<<<<<<<<<<<< * cdef PetscInt comp=asInt(c) * cdef PetscDMStagStencilLocation sloc = asStagStencilLocation(loc) */ __pyx_v_slot = 0; /* "petsc4py/PETSc/DMStag.pyx":697 * """ * cdef PetscInt slot=0 * cdef PetscInt comp=asInt(c) # <<<<<<<<<<<<<< * cdef PetscDMStagStencilLocation sloc = asStagStencilLocation(loc) * CHKERR( DMStagGetLocationSlot(self.dm, sloc, comp, &slot) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_c); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(58, 697, __pyx_L1_error) __pyx_v_comp = __pyx_t_1; /* "petsc4py/PETSc/DMStag.pyx":698 * cdef PetscInt slot=0 * cdef PetscInt comp=asInt(c) * cdef PetscDMStagStencilLocation sloc = asStagStencilLocation(loc) # <<<<<<<<<<<<<< * CHKERR( DMStagGetLocationSlot(self.dm, sloc, comp, &slot) ) * return toInt(slot) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asStagStencilLocation(__pyx_v_loc); if (unlikely(__pyx_t_2 == ((DMStagStencilLocation)((DMStagStencilLocation)-1L)))) __PYX_ERR(58, 698, __pyx_L1_error) __pyx_v_sloc = __pyx_t_2; /* "petsc4py/PETSc/DMStag.pyx":699 * cdef PetscInt comp=asInt(c) * cdef PetscDMStagStencilLocation sloc = asStagStencilLocation(loc) * CHKERR( DMStagGetLocationSlot(self.dm, sloc, comp, &slot) ) # <<<<<<<<<<<<<< * return toInt(slot) * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMStagGetLocationSlot(__pyx_v_self->__pyx_base.dm, __pyx_v_sloc, __pyx_v_comp, (&__pyx_v_slot))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(58, 699, __pyx_L1_error) /* "petsc4py/PETSc/DMStag.pyx":700 * cdef PetscDMStagStencilLocation sloc = asStagStencilLocation(loc) * CHKERR( DMStagGetLocationSlot(self.dm, sloc, comp, &slot) ) * return toInt(slot) # <<<<<<<<<<<<<< * * def getProductCoordinateLocationSlot(self, loc: StencilLocation) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_slot); if (unlikely(!__pyx_t_4)) __PYX_ERR(58, 700, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMStag.pyx":679 * # Location slot related functions * * def getLocationSlot(self, loc: StencilLocation, c: int) -> int: # <<<<<<<<<<<<<< * """Return index to use in accessing raw local arrays. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.getLocationSlot", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMStag.pyx":702 * return toInt(slot) * * def getProductCoordinateLocationSlot(self, loc: StencilLocation) -> None: # <<<<<<<<<<<<<< * """Return slot for use with local product coordinate arrays. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_55getProductCoordinateLocationSlot(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMStag_54getProductCoordinateLocationSlot, "DMStag.getProductCoordinateLocationSlot(self, loc: StencilLocation) -> None\nReturn slot for use with local product coordinate arrays.\n\n Not collective.\n\n Parameters\n ----------\n loc\n The grid location.\n\n See Also\n --------\n petsc.DMStagGetProductCoordinateLocationSlot\n\n \nSource code at petsc4py/PETSc/DMStag.pyx:702"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_55getProductCoordinateLocationSlot(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_loc = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getProductCoordinateLocationSlot (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loc,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_loc)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(58, 702, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getProductCoordinateLocationSlot") < 0)) __PYX_ERR(58, 702, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_loc = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getProductCoordinateLocationSlot", 1, 1, 1, __pyx_nargs); __PYX_ERR(58, 702, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMStag.getProductCoordinateLocationSlot", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_54getProductCoordinateLocationSlot(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self), __pyx_v_loc); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_54getProductCoordinateLocationSlot(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_loc) { PetscInt __pyx_v_slot; DMStagStencilLocation __pyx_v_sloc; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations DMStagStencilLocation __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getProductCoordinateLocationSlot", 1); /* "petsc4py/PETSc/DMStag.pyx":717 * * """ * cdef PetscInt slot=0 # <<<<<<<<<<<<<< * cdef PetscDMStagStencilLocation sloc = asStagStencilLocation(loc) * CHKERR( DMStagGetProductCoordinateLocationSlot(self.dm, sloc, &slot) ) */ __pyx_v_slot = 0; /* "petsc4py/PETSc/DMStag.pyx":718 * """ * cdef PetscInt slot=0 * cdef PetscDMStagStencilLocation sloc = asStagStencilLocation(loc) # <<<<<<<<<<<<<< * CHKERR( DMStagGetProductCoordinateLocationSlot(self.dm, sloc, &slot) ) * return toInt(slot) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asStagStencilLocation(__pyx_v_loc); if (unlikely(__pyx_t_1 == ((DMStagStencilLocation)((DMStagStencilLocation)-1L)))) __PYX_ERR(58, 718, __pyx_L1_error) __pyx_v_sloc = __pyx_t_1; /* "petsc4py/PETSc/DMStag.pyx":719 * cdef PetscInt slot=0 * cdef PetscDMStagStencilLocation sloc = asStagStencilLocation(loc) * CHKERR( DMStagGetProductCoordinateLocationSlot(self.dm, sloc, &slot) ) # <<<<<<<<<<<<<< * return toInt(slot) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMStagGetProductCoordinateLocationSlot(__pyx_v_self->__pyx_base.dm, __pyx_v_sloc, (&__pyx_v_slot))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(58, 719, __pyx_L1_error) /* "petsc4py/PETSc/DMStag.pyx":720 * cdef PetscDMStagStencilLocation sloc = asStagStencilLocation(loc) * CHKERR( DMStagGetProductCoordinateLocationSlot(self.dm, sloc, &slot) ) * return toInt(slot) # <<<<<<<<<<<<<< * * def getLocationDof(self, loc: StencilLocation) -> int: */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_slot); if (unlikely(!__pyx_t_3)) __PYX_ERR(58, 720, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMStag.pyx":702 * return toInt(slot) * * def getProductCoordinateLocationSlot(self, loc: StencilLocation) -> None: # <<<<<<<<<<<<<< * """Return slot for use with local product coordinate arrays. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.getProductCoordinateLocationSlot", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMStag.pyx":722 * return toInt(slot) * * def getLocationDof(self, loc: StencilLocation) -> int: # <<<<<<<<<<<<<< * """Return number of DOFs associated with a given point on the grid. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_57getLocationDof(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMStag_56getLocationDof, "DMStag.getLocationDof(self, loc: StencilLocation) -> int\nReturn number of DOFs associated with a given point on the grid.\n\n Not collective.\n\n Parameters\n ----------\n loc\n The grid point.\n\n See Also\n --------\n petsc.DMStagGetLocationDOF\n\n \nSource code at petsc4py/PETSc/DMStag.pyx:722"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_57getLocationDof(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_loc = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getLocationDof (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loc,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_loc)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(58, 722, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getLocationDof") < 0)) __PYX_ERR(58, 722, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_loc = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getLocationDof", 1, 1, 1, __pyx_nargs); __PYX_ERR(58, 722, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMStag.getLocationDof", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_56getLocationDof(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self), __pyx_v_loc); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_56getLocationDof(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_loc) { PetscInt __pyx_v_dof; DMStagStencilLocation __pyx_v_sloc; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations DMStagStencilLocation __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getLocationDof", 1); /* "petsc4py/PETSc/DMStag.pyx":737 * * """ * cdef PetscInt dof=0 # <<<<<<<<<<<<<< * cdef PetscDMStagStencilLocation sloc = asStagStencilLocation(loc) * CHKERR( DMStagGetLocationDOF(self.dm, sloc, &dof) ) */ __pyx_v_dof = 0; /* "petsc4py/PETSc/DMStag.pyx":738 * """ * cdef PetscInt dof=0 * cdef PetscDMStagStencilLocation sloc = asStagStencilLocation(loc) # <<<<<<<<<<<<<< * CHKERR( DMStagGetLocationDOF(self.dm, sloc, &dof) ) * return toInt(dof) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asStagStencilLocation(__pyx_v_loc); if (unlikely(__pyx_t_1 == ((DMStagStencilLocation)((DMStagStencilLocation)-1L)))) __PYX_ERR(58, 738, __pyx_L1_error) __pyx_v_sloc = __pyx_t_1; /* "petsc4py/PETSc/DMStag.pyx":739 * cdef PetscInt dof=0 * cdef PetscDMStagStencilLocation sloc = asStagStencilLocation(loc) * CHKERR( DMStagGetLocationDOF(self.dm, sloc, &dof) ) # <<<<<<<<<<<<<< * return toInt(dof) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMStagGetLocationDOF(__pyx_v_self->__pyx_base.dm, __pyx_v_sloc, (&__pyx_v_dof))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(58, 739, __pyx_L1_error) /* "petsc4py/PETSc/DMStag.pyx":740 * cdef PetscDMStagStencilLocation sloc = asStagStencilLocation(loc) * CHKERR( DMStagGetLocationDOF(self.dm, sloc, &dof) ) * return toInt(dof) # <<<<<<<<<<<<<< * * # Random other functions */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_dof); if (unlikely(!__pyx_t_3)) __PYX_ERR(58, 740, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMStag.pyx":722 * return toInt(slot) * * def getLocationDof(self, loc: StencilLocation) -> int: # <<<<<<<<<<<<<< * """Return number of DOFs associated with a given point on the grid. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.getLocationDof", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMStag.pyx":744 * # Random other functions * * def migrateVec(self, Vec vec, DM dmTo, Vec vecTo) -> None: # <<<<<<<<<<<<<< * """Transfer a vector between two ``DMStag`` objects. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_59migrateVec(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMStag_58migrateVec, "DMStag.migrateVec(self, vec: Vec, dmTo: DM, vecTo: Vec) -> None\nTransfer a vector between two ``DMStag`` objects.\n\n Collective.\n\n Currently only implemented to migrate global vectors to global vectors.\n\n Parameters\n ----------\n vec\n The source vector.\n dmTo\n The compatible destination object.\n vecTo\n The destination vector.\n\n See Also\n --------\n petsc.DMStagMigrateVec\n\n \nSource code at petsc4py/PETSc/DMStag.pyx:744"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_59migrateVec(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_vec = 0; struct PyPetscDMObject *__pyx_v_dmTo = 0; struct PyPetscVecObject *__pyx_v_vecTo = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("migrateVec (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec,&__pyx_n_s_dmTo,&__pyx_n_s_vecTo,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vec)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(58, 744, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dmTo)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(58, 744, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("migrateVec", 1, 3, 3, 1); __PYX_ERR(58, 744, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vecTo)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(58, 744, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("migrateVec", 1, 3, 3, 2); __PYX_ERR(58, 744, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "migrateVec") < 0)) __PYX_ERR(58, 744, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_vec = ((struct PyPetscVecObject *)values[0]); __pyx_v_dmTo = ((struct PyPetscDMObject *)values[1]); __pyx_v_vecTo = ((struct PyPetscVecObject *)values[2]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("migrateVec", 1, 3, 3, __pyx_nargs); __PYX_ERR(58, 744, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMStag.migrateVec", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(58, 744, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dmTo), __pyx_ptype_8petsc4py_5PETSc_DM, 0, "dmTo", 0))) __PYX_ERR(58, 744, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vecTo), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vecTo", 0))) __PYX_ERR(58, 744, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_58migrateVec(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self), __pyx_v_vec, __pyx_v_dmTo, __pyx_v_vecTo); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_58migrateVec(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec, struct PyPetscDMObject *__pyx_v_dmTo, struct PyPetscVecObject *__pyx_v_vecTo) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("migrateVec", 1); /* "petsc4py/PETSc/DMStag.pyx":765 * * """ * CHKERR( DMStagMigrateVec(self.dm, vec.vec, dmTo.dm, vecTo.vec ) ) # <<<<<<<<<<<<<< * * def createCompatibleDMStag(self, dofs: tuple[int, ...]) -> DM: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMStagMigrateVec(__pyx_v_self->__pyx_base.dm, __pyx_v_vec->vec, __pyx_v_dmTo->dm, __pyx_v_vecTo->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(58, 765, __pyx_L1_error) /* "petsc4py/PETSc/DMStag.pyx":744 * # Random other functions * * def migrateVec(self, Vec vec, DM dmTo, Vec vecTo) -> None: # <<<<<<<<<<<<<< * """Transfer a vector between two ``DMStag`` objects. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMStag.migrateVec", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMStag.pyx":767 * CHKERR( DMStagMigrateVec(self.dm, vec.vec, dmTo.dm, vecTo.vec ) ) * * def createCompatibleDMStag(self, dofs: tuple[int, ...]) -> DM: # <<<<<<<<<<<<<< * """Create a compatible ``DMStag`` with different DOFs/stratum. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_61createCompatibleDMStag(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMStag_60createCompatibleDMStag, "DMStag.createCompatibleDMStag(self, dofs: tuple[int, ...]) -> DM\nCreate a compatible ``DMStag`` with different DOFs/stratum.\n\n Collective.\n\n Parameters\n ----------\n dofs\n The number of DOFs on the strata in the new `DMStag`.\n\n See Also\n --------\n petsc.DMStagCreateCompatibleDMStag\n\n \nSource code at petsc4py/PETSc/DMStag.pyx:767"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_61createCompatibleDMStag(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_dofs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createCompatibleDMStag (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dofs,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dofs)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(58, 767, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createCompatibleDMStag") < 0)) __PYX_ERR(58, 767, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_dofs = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createCompatibleDMStag", 1, 1, 1, __pyx_nargs); __PYX_ERR(58, 767, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMStag.createCompatibleDMStag", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_60createCompatibleDMStag(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self), __pyx_v_dofs); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_60createCompatibleDMStag(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_dofs) { PyObject *__pyx_v_gdofs = 0; CYTHON_UNUSED PetscInt __pyx_v_gdim; PetscInt __pyx_v_dof0; PetscInt __pyx_v_dof1; PetscInt __pyx_v_dof2; PetscInt __pyx_v_dof3; DM __pyx_v_newda; struct PyPetscDMObject *__pyx_v_newdm = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscInt __pyx_t_2; PetscErrorCode __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createCompatibleDMStag", 1); /* "petsc4py/PETSc/DMStag.pyx":782 * * """ * cdef tuple gdofs = tuple(dofs) # <<<<<<<<<<<<<< * cdef PetscInt gdim=PETSC_DECIDE, dof0=1, dof1=0, dof2=0, dof3=0 * gdim = asDofs(gdofs, &dof0, &dof1, &dof2, &dof3) */ __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_dofs); if (unlikely(!__pyx_t_1)) __PYX_ERR(58, 782, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_gdofs = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DMStag.pyx":783 * """ * cdef tuple gdofs = tuple(dofs) * cdef PetscInt gdim=PETSC_DECIDE, dof0=1, dof1=0, dof2=0, dof3=0 # <<<<<<<<<<<<<< * gdim = asDofs(gdofs, &dof0, &dof1, &dof2, &dof3) * cdef PetscDM newda = NULL */ __pyx_v_gdim = PETSC_DECIDE; __pyx_v_dof0 = 1; __pyx_v_dof1 = 0; __pyx_v_dof2 = 0; __pyx_v_dof3 = 0; /* "petsc4py/PETSc/DMStag.pyx":784 * cdef tuple gdofs = tuple(dofs) * cdef PetscInt gdim=PETSC_DECIDE, dof0=1, dof1=0, dof2=0, dof3=0 * gdim = asDofs(gdofs, &dof0, &dof1, &dof2, &dof3) # <<<<<<<<<<<<<< * cdef PetscDM newda = NULL * CHKERR( DMStagCreateCompatibleDMStag(self.dm, dof0, dof1, dof2, dof3, &newda) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asDofs(__pyx_v_gdofs, (&__pyx_v_dof0), (&__pyx_v_dof1), (&__pyx_v_dof2), (&__pyx_v_dof3)); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(58, 784, __pyx_L1_error) __pyx_v_gdim = __pyx_t_2; /* "petsc4py/PETSc/DMStag.pyx":785 * cdef PetscInt gdim=PETSC_DECIDE, dof0=1, dof1=0, dof2=0, dof3=0 * gdim = asDofs(gdofs, &dof0, &dof1, &dof2, &dof3) * cdef PetscDM newda = NULL # <<<<<<<<<<<<<< * CHKERR( DMStagCreateCompatibleDMStag(self.dm, dof0, dof1, dof2, dof3, &newda) ) * cdef DM newdm = type(self)() */ __pyx_v_newda = NULL; /* "petsc4py/PETSc/DMStag.pyx":786 * gdim = asDofs(gdofs, &dof0, &dof1, &dof2, &dof3) * cdef PetscDM newda = NULL * CHKERR( DMStagCreateCompatibleDMStag(self.dm, dof0, dof1, dof2, dof3, &newda) ) # <<<<<<<<<<<<<< * cdef DM newdm = type(self)() * CHKERR( PetscCLEAR(newdm.obj) ); newdm.dm = newda */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMStagCreateCompatibleDMStag(__pyx_v_self->__pyx_base.dm, __pyx_v_dof0, __pyx_v_dof1, __pyx_v_dof2, __pyx_v_dof3, (&__pyx_v_newda))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(58, 786, __pyx_L1_error) /* "petsc4py/PETSc/DMStag.pyx":787 * cdef PetscDM newda = NULL * CHKERR( DMStagCreateCompatibleDMStag(self.dm, dof0, dof1, dof2, dof3, &newda) ) * cdef DM newdm = type(self)() # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(newdm.obj) ); newdm.dm = newda * return newdm */ __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __pyx_t_4 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(58, 787, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(58, 787, __pyx_L1_error) __pyx_v_newdm = ((struct PyPetscDMObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DMStag.pyx":788 * CHKERR( DMStagCreateCompatibleDMStag(self.dm, dof0, dof1, dof2, dof3, &newda) ) * cdef DM newdm = type(self)() * CHKERR( PetscCLEAR(newdm.obj) ); newdm.dm = newda # <<<<<<<<<<<<<< * return newdm * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_newdm->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(58, 788, __pyx_L1_error) __pyx_v_newdm->dm = __pyx_v_newda; /* "petsc4py/PETSc/DMStag.pyx":789 * cdef DM newdm = type(self)() * CHKERR( PetscCLEAR(newdm.obj) ); newdm.dm = newda * return newdm # <<<<<<<<<<<<<< * * def VecSplitToDMDA( */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_newdm); __pyx_r = ((PyObject *)__pyx_v_newdm); goto __pyx_L0; /* "petsc4py/PETSc/DMStag.pyx":767 * CHKERR( DMStagMigrateVec(self.dm, vec.vec, dmTo.dm, vecTo.vec ) ) * * def createCompatibleDMStag(self, dofs: tuple[int, ...]) -> DM: # <<<<<<<<<<<<<< * """Create a compatible ``DMStag`` with different DOFs/stratum. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.createCompatibleDMStag", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_gdofs); __Pyx_XDECREF((PyObject *)__pyx_v_newdm); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMStag.pyx":791 * return newdm * * def VecSplitToDMDA( # <<<<<<<<<<<<<< * self, * Vec vec, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_63VecSplitToDMDA(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMStag_62VecSplitToDMDA, "DMStag.VecSplitToDMDA(self, vec: Vec, loc: StencilLocation, c: int) -> tuple[DMDA, Vec]\nReturn ``DMDA``, ``Vec`` from a subgrid of a ``DMStag``, its ``Vec``.\n\n Collective.\n\n If a ``c`` value of ``-k`` is provided, the first ``k`` DOFs for that\n position are extracted, padding with zero values if needed. If a\n non-negative value is provided, a single DOF is extracted.\n\n Parameters\n ----------\n vec\n The ``Vec`` object.\n loc\n Which subgrid to extract.\n c\n Which component to extract.\n\n See Also\n --------\n petsc.DMStagVecSplitToDMDA\n\n \nSource code at petsc4py/PETSc/DMStag.pyx:791"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_63VecSplitToDMDA(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_vec = 0; PyObject *__pyx_v_loc = 0; PyObject *__pyx_v_c = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("VecSplitToDMDA (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec,&__pyx_n_s_loc,&__pyx_n_s_c,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vec)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(58, 791, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_loc)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(58, 791, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("VecSplitToDMDA", 1, 3, 3, 1); __PYX_ERR(58, 791, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_c)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(58, 791, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("VecSplitToDMDA", 1, 3, 3, 2); __PYX_ERR(58, 791, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "VecSplitToDMDA") < 0)) __PYX_ERR(58, 791, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_vec = ((struct PyPetscVecObject *)values[0]); __pyx_v_loc = values[1]; __pyx_v_c = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("VecSplitToDMDA", 1, 3, 3, __pyx_nargs); __PYX_ERR(58, 791, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMStag.VecSplitToDMDA", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(58, 793, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_62VecSplitToDMDA(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self), __pyx_v_vec, __pyx_v_loc, __pyx_v_c); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_62VecSplitToDMDA(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec, PyObject *__pyx_v_loc, PyObject *__pyx_v_c) { PetscInt __pyx_v_pc; DMStagStencilLocation __pyx_v_sloc; DM __pyx_v_pda; Vec __pyx_v_pdavec; struct PyPetscDMObject *__pyx_v_da = 0; struct PyPetscVecObject *__pyx_v_davec = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; DMStagStencilLocation __pyx_t_2; PetscErrorCode __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("VecSplitToDMDA", 1); /* "petsc4py/PETSc/DMStag.pyx":819 * * """ * cdef PetscInt pc = asInt(c) # <<<<<<<<<<<<<< * cdef PetscDMStagStencilLocation sloc = asStagStencilLocation(loc) * cdef PetscDM pda = NULL */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_c); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(58, 819, __pyx_L1_error) __pyx_v_pc = __pyx_t_1; /* "petsc4py/PETSc/DMStag.pyx":820 * """ * cdef PetscInt pc = asInt(c) * cdef PetscDMStagStencilLocation sloc = asStagStencilLocation(loc) # <<<<<<<<<<<<<< * cdef PetscDM pda = NULL * cdef PetscVec pdavec = NULL */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asStagStencilLocation(__pyx_v_loc); if (unlikely(__pyx_t_2 == ((DMStagStencilLocation)((DMStagStencilLocation)-1L)))) __PYX_ERR(58, 820, __pyx_L1_error) __pyx_v_sloc = __pyx_t_2; /* "petsc4py/PETSc/DMStag.pyx":821 * cdef PetscInt pc = asInt(c) * cdef PetscDMStagStencilLocation sloc = asStagStencilLocation(loc) * cdef PetscDM pda = NULL # <<<<<<<<<<<<<< * cdef PetscVec pdavec = NULL * CHKERR( DMStagVecSplitToDMDA(self.dm, vec.vec, sloc, pc, &pda, &pdavec) ) */ __pyx_v_pda = NULL; /* "petsc4py/PETSc/DMStag.pyx":822 * cdef PetscDMStagStencilLocation sloc = asStagStencilLocation(loc) * cdef PetscDM pda = NULL * cdef PetscVec pdavec = NULL # <<<<<<<<<<<<<< * CHKERR( DMStagVecSplitToDMDA(self.dm, vec.vec, sloc, pc, &pda, &pdavec) ) * cdef DM da = DMDA() */ __pyx_v_pdavec = NULL; /* "petsc4py/PETSc/DMStag.pyx":823 * cdef PetscDM pda = NULL * cdef PetscVec pdavec = NULL * CHKERR( DMStagVecSplitToDMDA(self.dm, vec.vec, sloc, pc, &pda, &pdavec) ) # <<<<<<<<<<<<<< * cdef DM da = DMDA() * CHKERR( PetscCLEAR(da.obj) ); da.dm = pda */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMStagVecSplitToDMDA(__pyx_v_self->__pyx_base.dm, __pyx_v_vec->vec, __pyx_v_sloc, __pyx_v_pc, (&__pyx_v_pda), (&__pyx_v_pdavec))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(58, 823, __pyx_L1_error) /* "petsc4py/PETSc/DMStag.pyx":824 * cdef PetscVec pdavec = NULL * CHKERR( DMStagVecSplitToDMDA(self.dm, vec.vec, sloc, pc, &pda, &pdavec) ) * cdef DM da = DMDA() # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(da.obj) ); da.dm = pda * cdef Vec davec = Vec() */ __pyx_t_4 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DMDA)); if (unlikely(!__pyx_t_4)) __PYX_ERR(58, 824, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_da = ((struct PyPetscDMObject *)__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/DMStag.pyx":825 * CHKERR( DMStagVecSplitToDMDA(self.dm, vec.vec, sloc, pc, &pda, &pdavec) ) * cdef DM da = DMDA() * CHKERR( PetscCLEAR(da.obj) ); da.dm = pda # <<<<<<<<<<<<<< * cdef Vec davec = Vec() * CHKERR( PetscCLEAR(davec.obj) ); davec.vec = pdavec */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_da->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(58, 825, __pyx_L1_error) __pyx_v_da->dm = __pyx_v_pda; /* "petsc4py/PETSc/DMStag.pyx":826 * cdef DM da = DMDA() * CHKERR( PetscCLEAR(da.obj) ); da.dm = pda * cdef Vec davec = Vec() # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(davec.obj) ); davec.vec = pdavec * return (da,davec) */ __pyx_t_4 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_4)) __PYX_ERR(58, 826, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_davec = ((struct PyPetscVecObject *)__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/DMStag.pyx":827 * CHKERR( PetscCLEAR(da.obj) ); da.dm = pda * cdef Vec davec = Vec() * CHKERR( PetscCLEAR(davec.obj) ); davec.vec = pdavec # <<<<<<<<<<<<<< * return (da,davec) * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_davec->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(58, 827, __pyx_L1_error) __pyx_v_davec->vec = __pyx_v_pdavec; /* "petsc4py/PETSc/DMStag.pyx":828 * cdef Vec davec = Vec() * CHKERR( PetscCLEAR(davec.obj) ); davec.vec = pdavec * return (da,davec) # <<<<<<<<<<<<<< * * def getVecArray(self, Vec vec) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(58, 828, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF((PyObject *)__pyx_v_da); __Pyx_GIVEREF((PyObject *)__pyx_v_da); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_da))) __PYX_ERR(58, 828, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_davec); __Pyx_GIVEREF((PyObject *)__pyx_v_davec); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_davec))) __PYX_ERR(58, 828, __pyx_L1_error); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMStag.pyx":791 * return newdm * * def VecSplitToDMDA( # <<<<<<<<<<<<<< * self, * Vec vec, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.VecSplitToDMDA", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_da); __Pyx_XDECREF((PyObject *)__pyx_v_davec); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMStag.pyx":830 * return (da,davec) * * def getVecArray(self, Vec vec) -> None: # <<<<<<<<<<<<<< * """**Not implemented in petsc4py.**""" * raise NotImplementedError('getVecArray for DMStag not yet implemented in petsc4py') */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_65getVecArray(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMStag_64getVecArray, "DMStag.getVecArray(self, vec: Vec) -> None\n**Not implemented in petsc4py.**\nSource code at petsc4py/PETSc/DMStag.pyx:830"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_65getVecArray(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED struct PyPetscVecObject *__pyx_v_vec = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getVecArray (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vec)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(58, 830, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getVecArray") < 0)) __PYX_ERR(58, 830, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_vec = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getVecArray", 1, 1, 1, __pyx_nargs); __PYX_ERR(58, 830, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMStag.getVecArray", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(58, 830, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_64getVecArray(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self), __pyx_v_vec); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_64getVecArray(CYTHON_UNUSED struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, CYTHON_UNUSED struct PyPetscVecObject *__pyx_v_vec) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getVecArray", 1); /* "petsc4py/PETSc/DMStag.pyx":832 * def getVecArray(self, Vec vec) -> None: * """**Not implemented in petsc4py.**""" * raise NotImplementedError('getVecArray for DMStag not yet implemented in petsc4py') # <<<<<<<<<<<<<< * * def get1dCoordinatecArrays(self) -> None: */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__61, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(58, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(58, 832, __pyx_L1_error) /* "petsc4py/PETSc/DMStag.pyx":830 * return (da,davec) * * def getVecArray(self, Vec vec) -> None: # <<<<<<<<<<<<<< * """**Not implemented in petsc4py.**""" * raise NotImplementedError('getVecArray for DMStag not yet implemented in petsc4py') */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.getVecArray", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMStag.pyx":834 * raise NotImplementedError('getVecArray for DMStag not yet implemented in petsc4py') * * def get1dCoordinatecArrays(self) -> None: # <<<<<<<<<<<<<< * """**Not implemented in petsc4py.**""" * raise NotImplementedError('get1dCoordinatecArrays for DMStag not yet implemented in petsc4py') */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_67get1dCoordinatecArrays(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6DMStag_66get1dCoordinatecArrays, "DMStag.get1dCoordinatecArrays(self) -> None\n**Not implemented in petsc4py.**\nSource code at petsc4py/PETSc/DMStag.pyx:834"); static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_67get1dCoordinatecArrays(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get1dCoordinatecArrays (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get1dCoordinatecArrays", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get1dCoordinatecArrays", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_66get1dCoordinatecArrays(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_66get1dCoordinatecArrays(CYTHON_UNUSED struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get1dCoordinatecArrays", 1); /* "petsc4py/PETSc/DMStag.pyx":836 * def get1dCoordinatecArrays(self) -> None: * """**Not implemented in petsc4py.**""" * raise NotImplementedError('get1dCoordinatecArrays for DMStag not yet implemented in petsc4py') # <<<<<<<<<<<<<< * * property dim: */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__62, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(58, 836, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(58, 836, __pyx_L1_error) /* "petsc4py/PETSc/DMStag.pyx":834 * raise NotImplementedError('getVecArray for DMStag not yet implemented in petsc4py') * * def get1dCoordinatecArrays(self) -> None: # <<<<<<<<<<<<<< * """**Not implemented in petsc4py.**""" * raise NotImplementedError('get1dCoordinatecArrays for DMStag not yet implemented in petsc4py') */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.get1dCoordinatecArrays", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMStag.pyx":840 * property dim: * """The dimension.""" * def __get__(self) -> int: # <<<<<<<<<<<<<< * return self.getDim() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_3dim_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_3dim_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_3dim___get__(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_3dim___get__(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/DMStag.pyx":841 * """The dimension.""" * def __get__(self) -> int: * return self.getDim() # <<<<<<<<<<<<<< * * property dofs: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getDim); if (unlikely(!__pyx_t_2)) __PYX_ERR(58, 841, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(58, 841, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMStag.pyx":840 * property dim: * """The dimension.""" * def __get__(self) -> int: # <<<<<<<<<<<<<< * return self.getDim() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.dim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMStag.pyx":845 * property dofs: * """The number of DOFs associated with each stratum of the grid.""" * def __get__(self) -> tuple[int, ...]: # <<<<<<<<<<<<<< * return self.getDof() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_4dofs_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_4dofs_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_4dofs___get__(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_4dofs___get__(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/DMStag.pyx":846 * """The number of DOFs associated with each stratum of the grid.""" * def __get__(self) -> tuple[int, ...]: * return self.getDof() # <<<<<<<<<<<<<< * * property entries_per_element: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getDof); if (unlikely(!__pyx_t_2)) __PYX_ERR(58, 846, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(58, 846, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMStag.pyx":845 * property dofs: * """The number of DOFs associated with each stratum of the grid.""" * def __get__(self) -> tuple[int, ...]: # <<<<<<<<<<<<<< * return self.getDof() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.dofs.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMStag.pyx":850 * property entries_per_element: * """The number of entries per element in the local representation.""" * def __get__(self) -> int: # <<<<<<<<<<<<<< * return self.getEntriesPerElement() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_19entries_per_element_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_19entries_per_element_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_19entries_per_element___get__(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_19entries_per_element___get__(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/DMStag.pyx":851 * """The number of entries per element in the local representation.""" * def __get__(self) -> int: * return self.getEntriesPerElement() # <<<<<<<<<<<<<< * * property global_sizes: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getEntriesPerElement); if (unlikely(!__pyx_t_2)) __PYX_ERR(58, 851, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(58, 851, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMStag.pyx":850 * property entries_per_element: * """The number of entries per element in the local representation.""" * def __get__(self) -> int: # <<<<<<<<<<<<<< * return self.getEntriesPerElement() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.entries_per_element.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMStag.pyx":855 * property global_sizes: * """Global element counts in each dimension.""" * def __get__(self) -> tuple[int, ...]: # <<<<<<<<<<<<<< * return self.getGlobalSizes() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_12global_sizes_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_12global_sizes_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_12global_sizes___get__(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_12global_sizes___get__(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/DMStag.pyx":856 * """Global element counts in each dimension.""" * def __get__(self) -> tuple[int, ...]: * return self.getGlobalSizes() # <<<<<<<<<<<<<< * * property local_sizes: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getGlobalSizes); if (unlikely(!__pyx_t_2)) __PYX_ERR(58, 856, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(58, 856, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMStag.pyx":855 * property global_sizes: * """Global element counts in each dimension.""" * def __get__(self) -> tuple[int, ...]: # <<<<<<<<<<<<<< * return self.getGlobalSizes() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.global_sizes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMStag.pyx":860 * property local_sizes: * """Local elementwise sizes in each dimension.""" * def __get__(self) -> tuple[int, ...]: # <<<<<<<<<<<<<< * return self.getLocalSizes() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_11local_sizes_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_11local_sizes_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_11local_sizes___get__(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_11local_sizes___get__(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/DMStag.pyx":861 * """Local elementwise sizes in each dimension.""" * def __get__(self) -> tuple[int, ...]: * return self.getLocalSizes() # <<<<<<<<<<<<<< * * property proc_sizes: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getLocalSizes); if (unlikely(!__pyx_t_2)) __PYX_ERR(58, 861, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(58, 861, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMStag.pyx":860 * property local_sizes: * """Local elementwise sizes in each dimension.""" * def __get__(self) -> tuple[int, ...]: # <<<<<<<<<<<<<< * return self.getLocalSizes() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.local_sizes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMStag.pyx":865 * property proc_sizes: * """The number of processes in each dimension in the global decomposition.""" * def __get__(self) -> tuple[int, ...]: # <<<<<<<<<<<<<< * return self.getProcSizes() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_10proc_sizes_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_10proc_sizes_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_10proc_sizes___get__(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_10proc_sizes___get__(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/DMStag.pyx":866 * """The number of processes in each dimension in the global decomposition.""" * def __get__(self) -> tuple[int, ...]: * return self.getProcSizes() # <<<<<<<<<<<<<< * * property boundary_types: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getProcSizes); if (unlikely(!__pyx_t_2)) __PYX_ERR(58, 866, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(58, 866, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMStag.pyx":865 * property proc_sizes: * """The number of processes in each dimension in the global decomposition.""" * def __get__(self) -> tuple[int, ...]: # <<<<<<<<<<<<<< * return self.getProcSizes() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.proc_sizes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMStag.pyx":870 * property boundary_types: * """Boundary types in each dimension.""" * def __get__(self) -> tuple[str, ...]: # <<<<<<<<<<<<<< * return self.getBoundaryTypes() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_14boundary_types_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_14boundary_types_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_14boundary_types___get__(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_14boundary_types___get__(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/DMStag.pyx":871 * """Boundary types in each dimension.""" * def __get__(self) -> tuple[str, ...]: * return self.getBoundaryTypes() # <<<<<<<<<<<<<< * * property stencil_type: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getBoundaryTypes); if (unlikely(!__pyx_t_2)) __PYX_ERR(58, 871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(58, 871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMStag.pyx":870 * property boundary_types: * """Boundary types in each dimension.""" * def __get__(self) -> tuple[str, ...]: # <<<<<<<<<<<<<< * return self.getBoundaryTypes() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.boundary_types.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMStag.pyx":875 * property stencil_type: * """Stencil type.""" * def __get__(self) -> str: # <<<<<<<<<<<<<< * return self.getStencilType() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_12stencil_type_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_12stencil_type_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_12stencil_type___get__(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_12stencil_type___get__(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/DMStag.pyx":876 * """Stencil type.""" * def __get__(self) -> str: * return self.getStencilType() # <<<<<<<<<<<<<< * * property stencil_width: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getStencilType); if (unlikely(!__pyx_t_2)) __PYX_ERR(58, 876, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(58, 876, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMStag.pyx":875 * property stencil_type: * """Stencil type.""" * def __get__(self) -> str: # <<<<<<<<<<<<<< * return self.getStencilType() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.stencil_type.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMStag.pyx":880 * property stencil_width: * """Elementwise stencil width.""" * def __get__(self) -> int: # <<<<<<<<<<<<<< * return self.getStencilWidth() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_13stencil_width_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_13stencil_width_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_13stencil_width___get__(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_13stencil_width___get__(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/DMStag.pyx":881 * """Elementwise stencil width.""" * def __get__(self) -> int: * return self.getStencilWidth() # <<<<<<<<<<<<<< * * property corners: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getStencilWidth); if (unlikely(!__pyx_t_2)) __PYX_ERR(58, 881, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(58, 881, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMStag.pyx":880 * property stencil_width: * """Elementwise stencil width.""" * def __get__(self) -> int: # <<<<<<<<<<<<<< * return self.getStencilWidth() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.stencil_width.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMStag.pyx":885 * property corners: * """The lower left corner and size of local region in each dimension.""" * def __get__(self) -> tuple[tuple[int, ...], tuple[int, ...]]: # <<<<<<<<<<<<<< * return self.getCorners() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_7corners_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_7corners_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_7corners___get__(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_7corners___get__(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/DMStag.pyx":886 * """The lower left corner and size of local region in each dimension.""" * def __get__(self) -> tuple[tuple[int, ...], tuple[int, ...]]: * return self.getCorners() # <<<<<<<<<<<<<< * * property ghost_corners: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getCorners); if (unlikely(!__pyx_t_2)) __PYX_ERR(58, 886, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(58, 886, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMStag.pyx":885 * property corners: * """The lower left corner and size of local region in each dimension.""" * def __get__(self) -> tuple[tuple[int, ...], tuple[int, ...]]: # <<<<<<<<<<<<<< * return self.getCorners() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.corners.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMStag.pyx":890 * property ghost_corners: * """The lower left corner and size of local region in each dimension.""" * def __get__(self) -> tuple[tuple[int, ...], tuple[int, ...]]: # <<<<<<<<<<<<<< * return self.getGhostCorners() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_13ghost_corners_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_13ghost_corners_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_13ghost_corners___get__(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_13ghost_corners___get__(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "petsc4py/PETSc/DMStag.pyx":891 * """The lower left corner and size of local region in each dimension.""" * def __get__(self) -> tuple[tuple[int, ...], tuple[int, ...]]: * return self.getGhostCorners() # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getGhostCorners); if (unlikely(!__pyx_t_2)) __PYX_ERR(58, 891, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(58, 891, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMStag.pyx":890 * property ghost_corners: * """The lower left corner and size of local region in each dimension.""" * def __get__(self) -> tuple[tuple[int, ...], tuple[int, ...]]: # <<<<<<<<<<<<<< * return self.getGhostCorners() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.ghost_corners.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMComposite.pyx":6 * """A DM object that is used to manage data for a collection of DMs.""" * * def create(self, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Create a composite object. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_11DMComposite_1create(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_11DMComposite_create, "DMComposite.create(self, comm: Comm | None = None) -> Self\nCreate a composite object.\n\n Collective.\n\n Parameters\n ----------\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n petsc.DMCompositeCreate\n\n \nSource code at petsc4py/PETSc/DMComposite.pyx:6"); static PyObject *__pyx_pw_8petsc4py_5PETSc_11DMComposite_1create(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(59, 6, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "create") < 0)) __PYX_ERR(59, 6, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_comm = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, __pyx_nargs); __PYX_ERR(59, 6, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMComposite.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_11DMComposite_create(((struct __pyx_obj_8petsc4py_5PETSc_DMComposite *)__pyx_v_self), __pyx_v_comm); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_11DMComposite_create(struct __pyx_obj_8petsc4py_5PETSc_DMComposite *__pyx_v_self, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; DM __pyx_v_newdm; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create", 1); /* "petsc4py/PETSc/DMComposite.pyx":21 * * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscDM newdm = NULL * CHKERR( DMCompositeCreate(ccomm, &newdm) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(59, 21, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/DMComposite.pyx":22 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscDM newdm = NULL # <<<<<<<<<<<<<< * CHKERR( DMCompositeCreate(ccomm, &newdm) ) * CHKERR( PetscCLEAR(self.obj) ); self.dm = newdm */ __pyx_v_newdm = NULL; /* "petsc4py/PETSc/DMComposite.pyx":23 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscDM newdm = NULL * CHKERR( DMCompositeCreate(ccomm, &newdm) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.dm = newdm * return self */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCompositeCreate(__pyx_v_ccomm, (&__pyx_v_newdm))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(59, 23, __pyx_L1_error) /* "petsc4py/PETSc/DMComposite.pyx":24 * cdef PetscDM newdm = NULL * CHKERR( DMCompositeCreate(ccomm, &newdm) ) * CHKERR( PetscCLEAR(self.obj) ); self.dm = newdm # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(59, 24, __pyx_L1_error) __pyx_v_self->__pyx_base.dm = __pyx_v_newdm; /* "petsc4py/PETSc/DMComposite.pyx":25 * CHKERR( DMCompositeCreate(ccomm, &newdm) ) * CHKERR( PetscCLEAR(self.obj) ); self.dm = newdm * return self # <<<<<<<<<<<<<< * * def addDM(self, DM dm, *args: DM) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/DMComposite.pyx":6 * """A DM object that is used to manage data for a collection of DMs.""" * * def create(self, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Create a composite object. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMComposite.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMComposite.pyx":27 * return self * * def addDM(self, DM dm, *args: DM) -> None: # <<<<<<<<<<<<<< * """Add a DM vector to the composite. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_11DMComposite_3addDM(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_11DMComposite_2addDM, "DMComposite.addDM(self, dm: DM, *args: DM) -> None\nAdd a DM vector to the composite.\n\n Collective.\n\n Parameters\n ----------\n dm\n The DM object.\n *args\n Additional DM objects.\n\n See Also\n --------\n petsc.DMCompositeAddDM\n\n \nSource code at petsc4py/PETSc/DMComposite.pyx:27"); static PyObject *__pyx_pw_8petsc4py_5PETSc_11DMComposite_3addDM(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscDMObject *__pyx_v_dm = 0; PyObject *__pyx_v_args = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("addDM (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); __pyx_v_args = __Pyx_ArgsSlice_FASTCALL(__pyx_args, 1, __pyx_nargs); if (unlikely(!__pyx_v_args)) { __Pyx_RefNannyFinishContext(); return NULL; } __Pyx_GOTREF(__pyx_v_args); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dm,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { default: case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dm)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(59, 27, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; const Py_ssize_t used_pos_args = (kwd_pos_args < 1) ? kwd_pos_args : 1; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, used_pos_args, "addDM") < 0)) __PYX_ERR(59, 27, __pyx_L3_error) } } else if (unlikely(__pyx_nargs < 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_dm = ((struct PyPetscDMObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("addDM", 0, 1, 1, __pyx_nargs); __PYX_ERR(59, 27, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; __Pyx_AddTraceback("petsc4py.PETSc.DMComposite.addDM", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_ptype_8petsc4py_5PETSc_DM, 0, "dm", 0))) __PYX_ERR(59, 27, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_11DMComposite_2addDM(((struct __pyx_obj_8petsc4py_5PETSc_DMComposite *)__pyx_v_self), __pyx_v_dm, __pyx_v_args); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_DECREF(__pyx_v_args); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_11DMComposite_2addDM(struct __pyx_obj_8petsc4py_5PETSc_DMComposite *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm, PyObject *__pyx_v_args) { PyObject *__pyx_v_item = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("addDM", 0); __Pyx_INCREF((PyObject *)__pyx_v_dm); /* "petsc4py/PETSc/DMComposite.pyx":44 * * """ * CHKERR( DMCompositeAddDM(self.dm, dm.dm) ) # <<<<<<<<<<<<<< * cdef object item * for item in args: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCompositeAddDM(__pyx_v_self->__pyx_base.dm, __pyx_v_dm->dm)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(59, 44, __pyx_L1_error) /* "petsc4py/PETSc/DMComposite.pyx":46 * CHKERR( DMCompositeAddDM(self.dm, dm.dm) ) * cdef object item * for item in args: # <<<<<<<<<<<<<< * dm = item * CHKERR( DMCompositeAddDM(self.dm, dm.dm) ) */ __pyx_t_2 = __pyx_v_args; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(59, 46, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(59, 46, __pyx_L1_error) #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(59, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/DMComposite.pyx":47 * cdef object item * for item in args: * dm = item # <<<<<<<<<<<<<< * CHKERR( DMCompositeAddDM(self.dm, dm.dm) ) * */ if (!(likely(__Pyx_TypeTest(__pyx_v_item, __pyx_ptype_8petsc4py_5PETSc_DM)))) __PYX_ERR(59, 47, __pyx_L1_error) __pyx_t_4 = __pyx_v_item; __Pyx_INCREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_dm, ((struct PyPetscDMObject *)__pyx_t_4)); __pyx_t_4 = 0; /* "petsc4py/PETSc/DMComposite.pyx":48 * for item in args: * dm = item * CHKERR( DMCompositeAddDM(self.dm, dm.dm) ) # <<<<<<<<<<<<<< * * def getNumber(self) -> int: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCompositeAddDM(__pyx_v_self->__pyx_base.dm, __pyx_v_dm->dm)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(59, 48, __pyx_L1_error) /* "petsc4py/PETSc/DMComposite.pyx":46 * CHKERR( DMCompositeAddDM(self.dm, dm.dm) ) * cdef object item * for item in args: # <<<<<<<<<<<<<< * dm = item * CHKERR( DMCompositeAddDM(self.dm, dm.dm) ) */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DMComposite.pyx":27 * return self * * def addDM(self, DM dm, *args: DM) -> None: # <<<<<<<<<<<<<< * """Add a DM vector to the composite. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.DMComposite.addDM", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_item); __Pyx_XDECREF((PyObject *)__pyx_v_dm); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMComposite.pyx":50 * CHKERR( DMCompositeAddDM(self.dm, dm.dm) ) * * def getNumber(self) -> int: # <<<<<<<<<<<<<< * """Get number of sub-DMs contained in the composite. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_11DMComposite_5getNumber(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_11DMComposite_4getNumber, "DMComposite.getNumber(self) -> int\nGet number of sub-DMs contained in the composite.\n\n Not collective.\n\n See Also\n --------\n petsc.DMCompositeGetNumberDM\n\n \nSource code at petsc4py/PETSc/DMComposite.pyx:50"); static PyObject *__pyx_pw_8petsc4py_5PETSc_11DMComposite_5getNumber(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getNumber (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getNumber", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getNumber", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_11DMComposite_4getNumber(((struct __pyx_obj_8petsc4py_5PETSc_DMComposite *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_11DMComposite_4getNumber(struct __pyx_obj_8petsc4py_5PETSc_DMComposite *__pyx_v_self) { PetscInt __pyx_v_n; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getNumber", 1); /* "petsc4py/PETSc/DMComposite.pyx":60 * * """ * cdef PetscInt n = 0 # <<<<<<<<<<<<<< * CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) * return toInt(n) */ __pyx_v_n = 0; /* "petsc4py/PETSc/DMComposite.pyx":61 * """ * cdef PetscInt n = 0 * CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) # <<<<<<<<<<<<<< * return toInt(n) * getNumberDM = getNumber */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCompositeGetNumberDM(__pyx_v_self->__pyx_base.dm, (&__pyx_v_n))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(59, 61, __pyx_L1_error) /* "petsc4py/PETSc/DMComposite.pyx":62 * cdef PetscInt n = 0 * CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) * return toInt(n) # <<<<<<<<<<<<<< * getNumberDM = getNumber * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(59, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMComposite.pyx":50 * CHKERR( DMCompositeAddDM(self.dm, dm.dm) ) * * def getNumber(self) -> int: # <<<<<<<<<<<<<< * """Get number of sub-DMs contained in the composite. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMComposite.getNumber", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMComposite.pyx":65 * getNumberDM = getNumber * * def getEntries(self) -> list[DM]: # <<<<<<<<<<<<<< * """Return sub-DMs contained in the composite. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_11DMComposite_7getEntries(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_11DMComposite_6getEntries, "DMComposite.getEntries(self) -> list[DM]\nReturn sub-DMs contained in the composite.\n\n Not collective.\n\n See Also\n --------\n petsc.DMCompositeGetEntriesArray\n\n \nSource code at petsc4py/PETSc/DMComposite.pyx:65"); static PyObject *__pyx_pw_8petsc4py_5PETSc_11DMComposite_7getEntries(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getEntries (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getEntries", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getEntries", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_11DMComposite_6getEntries(((struct __pyx_obj_8petsc4py_5PETSc_DMComposite *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_11DMComposite_6getEntries(struct __pyx_obj_8petsc4py_5PETSc_DMComposite *__pyx_v_self) { PetscInt __pyx_v_i; PetscInt __pyx_v_n; DM *__pyx_v_cdms; CYTHON_UNUSED PyObject *__pyx_v_tmp = 0; struct PyPetscDMObject *__pyx_v_entry = 0; PyObject *__pyx_v_entries = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PetscInt __pyx_t_4; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getEntries", 1); /* "petsc4py/PETSc/DMComposite.pyx":75 * * """ * cdef PetscInt i, n = 0 # <<<<<<<<<<<<<< * cdef PetscDM *cdms = NULL * CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) */ __pyx_v_n = 0; /* "petsc4py/PETSc/DMComposite.pyx":76 * """ * cdef PetscInt i, n = 0 * cdef PetscDM *cdms = NULL # <<<<<<<<<<<<<< * CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) * cdef object tmp = oarray_p(empty_p(n), NULL, &cdms) */ __pyx_v_cdms = NULL; /* "petsc4py/PETSc/DMComposite.pyx":77 * cdef PetscInt i, n = 0 * cdef PetscDM *cdms = NULL * CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) # <<<<<<<<<<<<<< * cdef object tmp = oarray_p(empty_p(n), NULL, &cdms) * CHKERR( DMCompositeGetEntriesArray(self.dm, cdms) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCompositeGetNumberDM(__pyx_v_self->__pyx_base.dm, (&__pyx_v_n))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(59, 77, __pyx_L1_error) /* "petsc4py/PETSc/DMComposite.pyx":78 * cdef PetscDM *cdms = NULL * CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) * cdef object tmp = oarray_p(empty_p(n), NULL, &cdms) # <<<<<<<<<<<<<< * CHKERR( DMCompositeGetEntriesArray(self.dm, cdms) ) * cdef DM entry = None */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_n)); if (unlikely(!__pyx_t_2)) __PYX_ERR(59, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_2, NULL, ((void **)(&__pyx_v_cdms)))); if (unlikely(!__pyx_t_3)) __PYX_ERR(59, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_tmp = __pyx_t_3; __pyx_t_3 = 0; /* "petsc4py/PETSc/DMComposite.pyx":79 * CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) * cdef object tmp = oarray_p(empty_p(n), NULL, &cdms) * CHKERR( DMCompositeGetEntriesArray(self.dm, cdms) ) # <<<<<<<<<<<<<< * cdef DM entry = None * cdef list entries = [] */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCompositeGetEntriesArray(__pyx_v_self->__pyx_base.dm, __pyx_v_cdms)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(59, 79, __pyx_L1_error) /* "petsc4py/PETSc/DMComposite.pyx":80 * cdef object tmp = oarray_p(empty_p(n), NULL, &cdms) * CHKERR( DMCompositeGetEntriesArray(self.dm, cdms) ) * cdef DM entry = None # <<<<<<<<<<<<<< * cdef list entries = [] * for i from 0 <= i < n: */ __Pyx_INCREF(Py_None); __pyx_v_entry = ((struct PyPetscDMObject *)Py_None); /* "petsc4py/PETSc/DMComposite.pyx":81 * CHKERR( DMCompositeGetEntriesArray(self.dm, cdms) ) * cdef DM entry = None * cdef list entries = [] # <<<<<<<<<<<<<< * for i from 0 <= i < n: * entry = subtype_DM(cdms[i])() */ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(59, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_entries = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/DMComposite.pyx":82 * cdef DM entry = None * cdef list entries = [] * for i from 0 <= i < n: # <<<<<<<<<<<<<< * entry = subtype_DM(cdms[i])() * entry.dm = cdms[i] */ __pyx_t_4 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { /* "petsc4py/PETSc/DMComposite.pyx":83 * cdef list entries = [] * for i from 0 <= i < n: * entry = subtype_DM(cdms[i])() # <<<<<<<<<<<<<< * entry.dm = cdms[i] * CHKERR( PetscINCREF(entry.obj) ) */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM((__pyx_v_cdms[__pyx_v_i]))); if (unlikely(!__pyx_t_3)) __PYX_ERR(59, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(59, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(59, 83, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_entry, ((struct PyPetscDMObject *)__pyx_t_2)); __pyx_t_2 = 0; /* "petsc4py/PETSc/DMComposite.pyx":84 * for i from 0 <= i < n: * entry = subtype_DM(cdms[i])() * entry.dm = cdms[i] # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(entry.obj) ) * entries.append(entry) */ __pyx_v_entry->dm = (__pyx_v_cdms[__pyx_v_i]); /* "petsc4py/PETSc/DMComposite.pyx":85 * entry = subtype_DM(cdms[i])() * entry.dm = cdms[i] * CHKERR( PetscINCREF(entry.obj) ) # <<<<<<<<<<<<<< * entries.append(entry) * return entries */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_entry->__pyx_base.obj)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(59, 85, __pyx_L1_error) /* "petsc4py/PETSc/DMComposite.pyx":86 * entry.dm = cdms[i] * CHKERR( PetscINCREF(entry.obj) ) * entries.append(entry) # <<<<<<<<<<<<<< * return entries * */ __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_entries, ((PyObject *)__pyx_v_entry)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(59, 86, __pyx_L1_error) } /* "petsc4py/PETSc/DMComposite.pyx":87 * CHKERR( PetscINCREF(entry.obj) ) * entries.append(entry) * return entries # <<<<<<<<<<<<<< * * def scatter(self, Vec gvec, lvecs: Sequence[Vec]) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_entries); __pyx_r = __pyx_v_entries; goto __pyx_L0; /* "petsc4py/PETSc/DMComposite.pyx":65 * getNumberDM = getNumber * * def getEntries(self) -> list[DM]: # <<<<<<<<<<<<<< * """Return sub-DMs contained in the composite. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMComposite.getEntries", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_tmp); __Pyx_XDECREF((PyObject *)__pyx_v_entry); __Pyx_XDECREF(__pyx_v_entries); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMComposite.pyx":89 * return entries * * def scatter(self, Vec gvec, lvecs: Sequence[Vec]) -> None: # <<<<<<<<<<<<<< * """Scatter coupled global vector into split local vectors. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_11DMComposite_9scatter(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_11DMComposite_8scatter, "DMComposite.scatter(self, gvec: Vec, lvecs: Sequence[Vec]) -> None\nScatter coupled global vector into split local vectors.\n\n Collective.\n\n Parameters\n ----------\n gvec\n The global vector.\n lvecs\n Array of local vectors.\n\n See Also\n --------\n gather, petsc.DMCompositeScatterArray\n\n \nSource code at petsc4py/PETSc/DMComposite.pyx:89"); static PyObject *__pyx_pw_8petsc4py_5PETSc_11DMComposite_9scatter(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_gvec = 0; PyObject *__pyx_v_lvecs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("scatter (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gvec,&__pyx_n_s_lvecs,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gvec)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(59, 89, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_lvecs)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(59, 89, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("scatter", 1, 2, 2, 1); __PYX_ERR(59, 89, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "scatter") < 0)) __PYX_ERR(59, 89, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_gvec = ((struct PyPetscVecObject *)values[0]); __pyx_v_lvecs = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("scatter", 1, 2, 2, __pyx_nargs); __PYX_ERR(59, 89, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMComposite.scatter", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gvec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "gvec", 0))) __PYX_ERR(59, 89, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_11DMComposite_8scatter(((struct __pyx_obj_8petsc4py_5PETSc_DMComposite *)__pyx_v_self), __pyx_v_gvec, __pyx_v_lvecs); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_11DMComposite_8scatter(struct __pyx_obj_8petsc4py_5PETSc_DMComposite *__pyx_v_self, struct PyPetscVecObject *__pyx_v_gvec, PyObject *__pyx_v_lvecs) { PetscInt __pyx_v_i; PetscInt __pyx_v_n; Vec *__pyx_v_clvecs; CYTHON_UNUSED PyObject *__pyx_v_tmp = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PetscInt __pyx_t_4; Vec __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("scatter", 1); /* "petsc4py/PETSc/DMComposite.pyx":106 * * """ * cdef PetscInt i, n = 0 # <<<<<<<<<<<<<< * CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) * cdef PetscVec *clvecs = NULL */ __pyx_v_n = 0; /* "petsc4py/PETSc/DMComposite.pyx":107 * """ * cdef PetscInt i, n = 0 * CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) # <<<<<<<<<<<<<< * cdef PetscVec *clvecs = NULL * cdef object tmp = oarray_p(empty_p(n), NULL, &clvecs) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCompositeGetNumberDM(__pyx_v_self->__pyx_base.dm, (&__pyx_v_n))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(59, 107, __pyx_L1_error) /* "petsc4py/PETSc/DMComposite.pyx":108 * cdef PetscInt i, n = 0 * CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) * cdef PetscVec *clvecs = NULL # <<<<<<<<<<<<<< * cdef object tmp = oarray_p(empty_p(n), NULL, &clvecs) * for i from 0 <= i < n: */ __pyx_v_clvecs = NULL; /* "petsc4py/PETSc/DMComposite.pyx":109 * CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) * cdef PetscVec *clvecs = NULL * cdef object tmp = oarray_p(empty_p(n), NULL, &clvecs) # <<<<<<<<<<<<<< * for i from 0 <= i < n: * clvecs[i] = (lvecs[i]).vec */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_n)); if (unlikely(!__pyx_t_2)) __PYX_ERR(59, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_2, NULL, ((void **)(&__pyx_v_clvecs)))); if (unlikely(!__pyx_t_3)) __PYX_ERR(59, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_tmp = __pyx_t_3; __pyx_t_3 = 0; /* "petsc4py/PETSc/DMComposite.pyx":110 * cdef PetscVec *clvecs = NULL * cdef object tmp = oarray_p(empty_p(n), NULL, &clvecs) * for i from 0 <= i < n: # <<<<<<<<<<<<<< * clvecs[i] = (lvecs[i]).vec * CHKERR( DMCompositeScatterArray(self.dm, gvec.vec, clvecs) ) */ __pyx_t_4 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { /* "petsc4py/PETSc/DMComposite.pyx":111 * cdef object tmp = oarray_p(empty_p(n), NULL, &clvecs) * for i from 0 <= i < n: * clvecs[i] = (lvecs[i]).vec # <<<<<<<<<<<<<< * CHKERR( DMCompositeScatterArray(self.dm, gvec.vec, clvecs) ) * */ __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_lvecs, ((Py_ssize_t)__pyx_v_i), Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(59, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (!(likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_8petsc4py_5PETSc_Vec)))) __PYX_ERR(59, 111, __pyx_L1_error) __pyx_t_5 = ((struct PyPetscVecObject *)__pyx_t_3)->vec; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; (__pyx_v_clvecs[__pyx_v_i]) = __pyx_t_5; } /* "petsc4py/PETSc/DMComposite.pyx":112 * for i from 0 <= i < n: * clvecs[i] = (lvecs[i]).vec * CHKERR( DMCompositeScatterArray(self.dm, gvec.vec, clvecs) ) # <<<<<<<<<<<<<< * * def gather(self, Vec gvec, imode: InsertModeSpec, lvecs: Sequence[Vec]) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCompositeScatterArray(__pyx_v_self->__pyx_base.dm, __pyx_v_gvec->vec, __pyx_v_clvecs)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(59, 112, __pyx_L1_error) /* "petsc4py/PETSc/DMComposite.pyx":89 * return entries * * def scatter(self, Vec gvec, lvecs: Sequence[Vec]) -> None: # <<<<<<<<<<<<<< * """Scatter coupled global vector into split local vectors. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMComposite.scatter", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_tmp); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMComposite.pyx":114 * CHKERR( DMCompositeScatterArray(self.dm, gvec.vec, clvecs) ) * * def gather(self, Vec gvec, imode: InsertModeSpec, lvecs: Sequence[Vec]) -> None: # <<<<<<<<<<<<<< * """Gather split local vectors into a coupled global vector. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_11DMComposite_11gather(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_11DMComposite_10gather, "DMComposite.gather(self, gvec: Vec, imode: InsertModeSpec, lvecs: Sequence[Vec]) -> None\nGather split local vectors into a coupled global vector.\n\n Collective.\n\n Parameters\n ----------\n gvec\n The global vector.\n imode\n The insertion mode.\n lvecs\n The individual sequential vectors.\n\n See Also\n --------\n scatter, petsc.DMCompositeGatherArray\n\n \nSource code at petsc4py/PETSc/DMComposite.pyx:114"); static PyObject *__pyx_pw_8petsc4py_5PETSc_11DMComposite_11gather(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_gvec = 0; PyObject *__pyx_v_imode = 0; PyObject *__pyx_v_lvecs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("gather (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gvec,&__pyx_n_s_imode,&__pyx_n_s_lvecs,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gvec)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(59, 114, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_imode)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(59, 114, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("gather", 1, 3, 3, 1); __PYX_ERR(59, 114, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_lvecs)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(59, 114, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("gather", 1, 3, 3, 2); __PYX_ERR(59, 114, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "gather") < 0)) __PYX_ERR(59, 114, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_gvec = ((struct PyPetscVecObject *)values[0]); __pyx_v_imode = values[1]; __pyx_v_lvecs = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("gather", 1, 3, 3, __pyx_nargs); __PYX_ERR(59, 114, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMComposite.gather", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gvec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "gvec", 0))) __PYX_ERR(59, 114, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_11DMComposite_10gather(((struct __pyx_obj_8petsc4py_5PETSc_DMComposite *)__pyx_v_self), __pyx_v_gvec, __pyx_v_imode, __pyx_v_lvecs); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_11DMComposite_10gather(struct __pyx_obj_8petsc4py_5PETSc_DMComposite *__pyx_v_self, struct PyPetscVecObject *__pyx_v_gvec, PyObject *__pyx_v_imode, PyObject *__pyx_v_lvecs) { InsertMode __pyx_v_cimode; PetscInt __pyx_v_i; PetscInt __pyx_v_n; Vec *__pyx_v_clvecs; CYTHON_UNUSED PyObject *__pyx_v_tmp = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations InsertMode __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PetscInt __pyx_t_5; Vec __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("gather", 1); /* "petsc4py/PETSc/DMComposite.pyx":133 * * """ * cdef PetscInsertMode cimode = insertmode(imode) # <<<<<<<<<<<<<< * cdef PetscInt i, n = 0 * CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_insertmode(__pyx_v_imode); if (unlikely(__pyx_t_1 == ((InsertMode)((InsertMode)-1L)))) __PYX_ERR(59, 133, __pyx_L1_error) __pyx_v_cimode = __pyx_t_1; /* "petsc4py/PETSc/DMComposite.pyx":134 * """ * cdef PetscInsertMode cimode = insertmode(imode) * cdef PetscInt i, n = 0 # <<<<<<<<<<<<<< * CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) * cdef PetscVec *clvecs = NULL */ __pyx_v_n = 0; /* "petsc4py/PETSc/DMComposite.pyx":135 * cdef PetscInsertMode cimode = insertmode(imode) * cdef PetscInt i, n = 0 * CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) # <<<<<<<<<<<<<< * cdef PetscVec *clvecs = NULL * cdef object tmp = oarray_p(empty_p(n), NULL, &clvecs) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCompositeGetNumberDM(__pyx_v_self->__pyx_base.dm, (&__pyx_v_n))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(59, 135, __pyx_L1_error) /* "petsc4py/PETSc/DMComposite.pyx":136 * cdef PetscInt i, n = 0 * CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) * cdef PetscVec *clvecs = NULL # <<<<<<<<<<<<<< * cdef object tmp = oarray_p(empty_p(n), NULL, &clvecs) * for i from 0 <= i < n: */ __pyx_v_clvecs = NULL; /* "petsc4py/PETSc/DMComposite.pyx":137 * CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) * cdef PetscVec *clvecs = NULL * cdef object tmp = oarray_p(empty_p(n), NULL, &clvecs) # <<<<<<<<<<<<<< * for i from 0 <= i < n: * clvecs[i] = (lvecs[i]).vec */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_n)); if (unlikely(!__pyx_t_3)) __PYX_ERR(59, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_3, NULL, ((void **)(&__pyx_v_clvecs)))); if (unlikely(!__pyx_t_4)) __PYX_ERR(59, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_tmp = __pyx_t_4; __pyx_t_4 = 0; /* "petsc4py/PETSc/DMComposite.pyx":138 * cdef PetscVec *clvecs = NULL * cdef object tmp = oarray_p(empty_p(n), NULL, &clvecs) * for i from 0 <= i < n: # <<<<<<<<<<<<<< * clvecs[i] = (lvecs[i]).vec * CHKERR( DMCompositeGatherArray(self.dm, cimode, gvec.vec, clvecs) ) */ __pyx_t_5 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) { /* "petsc4py/PETSc/DMComposite.pyx":139 * cdef object tmp = oarray_p(empty_p(n), NULL, &clvecs) * for i from 0 <= i < n: * clvecs[i] = (lvecs[i]).vec # <<<<<<<<<<<<<< * CHKERR( DMCompositeGatherArray(self.dm, cimode, gvec.vec, clvecs) ) * */ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_lvecs, ((Py_ssize_t)__pyx_v_i), Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(59, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (!(likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_8petsc4py_5PETSc_Vec)))) __PYX_ERR(59, 139, __pyx_L1_error) __pyx_t_6 = ((struct PyPetscVecObject *)__pyx_t_4)->vec; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; (__pyx_v_clvecs[__pyx_v_i]) = __pyx_t_6; } /* "petsc4py/PETSc/DMComposite.pyx":140 * for i from 0 <= i < n: * clvecs[i] = (lvecs[i]).vec * CHKERR( DMCompositeGatherArray(self.dm, cimode, gvec.vec, clvecs) ) # <<<<<<<<<<<<<< * * def getGlobalISs(self) -> list[IS]: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCompositeGatherArray(__pyx_v_self->__pyx_base.dm, __pyx_v_cimode, __pyx_v_gvec->vec, __pyx_v_clvecs)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(59, 140, __pyx_L1_error) /* "petsc4py/PETSc/DMComposite.pyx":114 * CHKERR( DMCompositeScatterArray(self.dm, gvec.vec, clvecs) ) * * def gather(self, Vec gvec, imode: InsertModeSpec, lvecs: Sequence[Vec]) -> None: # <<<<<<<<<<<<<< * """Gather split local vectors into a coupled global vector. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.DMComposite.gather", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_tmp); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMComposite.pyx":142 * CHKERR( DMCompositeGatherArray(self.dm, cimode, gvec.vec, clvecs) ) * * def getGlobalISs(self) -> list[IS]: # <<<<<<<<<<<<<< * """Return the index sets for each composed object in the composite. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_11DMComposite_13getGlobalISs(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_11DMComposite_12getGlobalISs, "DMComposite.getGlobalISs(self) -> list[IS]\nReturn the index sets for each composed object in the composite.\n\n Collective.\n\n These could be used to extract a subset of vector entries for a\n \"multi-physics\" preconditioner.\n\n Use `getLocalISs` for index sets in the packed local numbering, and\n `getLGMaps` for to map local sub-DM (including ghost) indices to packed\n global indices.\n\n See Also\n --------\n petsc.DMCompositeGetGlobalISs\n\n \nSource code at petsc4py/PETSc/DMComposite.pyx:142"); static PyObject *__pyx_pw_8petsc4py_5PETSc_11DMComposite_13getGlobalISs(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getGlobalISs (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getGlobalISs", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getGlobalISs", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_11DMComposite_12getGlobalISs(((struct __pyx_obj_8petsc4py_5PETSc_DMComposite *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_11DMComposite_12getGlobalISs(struct __pyx_obj_8petsc4py_5PETSc_DMComposite *__pyx_v_self) { PetscInt __pyx_v_i; PetscInt __pyx_v_n; IS *__pyx_v_cis; PyObject *__pyx_v_isets = 0; PetscInt __pyx_9genexpr18__pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscInt __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getGlobalISs", 1); /* "petsc4py/PETSc/DMComposite.pyx":159 * * """ * cdef PetscInt i, n = 0 # <<<<<<<<<<<<<< * cdef PetscIS *cis = NULL * CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) */ __pyx_v_n = 0; /* "petsc4py/PETSc/DMComposite.pyx":160 * """ * cdef PetscInt i, n = 0 * cdef PetscIS *cis = NULL # <<<<<<<<<<<<<< * CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) * CHKERR( DMCompositeGetGlobalISs(self.dm, &cis) ) */ __pyx_v_cis = NULL; /* "petsc4py/PETSc/DMComposite.pyx":161 * cdef PetscInt i, n = 0 * cdef PetscIS *cis = NULL * CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) # <<<<<<<<<<<<<< * CHKERR( DMCompositeGetGlobalISs(self.dm, &cis) ) * cdef object isets = [ref_IS(cis[i]) for i from 0 <= i < n] */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCompositeGetNumberDM(__pyx_v_self->__pyx_base.dm, (&__pyx_v_n))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(59, 161, __pyx_L1_error) /* "petsc4py/PETSc/DMComposite.pyx":162 * cdef PetscIS *cis = NULL * CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) * CHKERR( DMCompositeGetGlobalISs(self.dm, &cis) ) # <<<<<<<<<<<<<< * cdef object isets = [ref_IS(cis[i]) for i from 0 <= i < n] * for i from 0 <= i < n: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCompositeGetGlobalISs(__pyx_v_self->__pyx_base.dm, (&__pyx_v_cis))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(59, 162, __pyx_L1_error) /* "petsc4py/PETSc/DMComposite.pyx":163 * CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) * CHKERR( DMCompositeGetGlobalISs(self.dm, &cis) ) * cdef object isets = [ref_IS(cis[i]) for i from 0 <= i < n] # <<<<<<<<<<<<<< * for i from 0 <= i < n: * CHKERR( ISDestroy(&cis[i]) ) */ { /* enter inner scope */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(59, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_v_n; for (__pyx_9genexpr18__pyx_v_i = 0; __pyx_9genexpr18__pyx_v_i < __pyx_t_3; __pyx_9genexpr18__pyx_v_i++) { __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_IS((__pyx_v_cis[__pyx_9genexpr18__pyx_v_i]))); if (unlikely(!__pyx_t_4)) __PYX_ERR(59, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_4))) __PYX_ERR(59, 163, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } } /* exit inner scope */ __pyx_v_isets = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/DMComposite.pyx":164 * CHKERR( DMCompositeGetGlobalISs(self.dm, &cis) ) * cdef object isets = [ref_IS(cis[i]) for i from 0 <= i < n] * for i from 0 <= i < n: # <<<<<<<<<<<<<< * CHKERR( ISDestroy(&cis[i]) ) * CHKERR( PetscFree(cis) ) */ __pyx_t_3 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { /* "petsc4py/PETSc/DMComposite.pyx":165 * cdef object isets = [ref_IS(cis[i]) for i from 0 <= i < n] * for i from 0 <= i < n: * CHKERR( ISDestroy(&cis[i]) ) # <<<<<<<<<<<<<< * CHKERR( PetscFree(cis) ) * return isets */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISDestroy((&(__pyx_v_cis[__pyx_v_i])))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(59, 165, __pyx_L1_error) } /* "petsc4py/PETSc/DMComposite.pyx":166 * for i from 0 <= i < n: * CHKERR( ISDestroy(&cis[i]) ) * CHKERR( PetscFree(cis) ) # <<<<<<<<<<<<<< * return isets * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_cis)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(59, 166, __pyx_L1_error) /* "petsc4py/PETSc/DMComposite.pyx":167 * CHKERR( ISDestroy(&cis[i]) ) * CHKERR( PetscFree(cis) ) * return isets # <<<<<<<<<<<<<< * * def getLocalISs(self) -> list[IS]: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_isets); __pyx_r = __pyx_v_isets; goto __pyx_L0; /* "petsc4py/PETSc/DMComposite.pyx":142 * CHKERR( DMCompositeGatherArray(self.dm, cimode, gvec.vec, clvecs) ) * * def getGlobalISs(self) -> list[IS]: # <<<<<<<<<<<<<< * """Return the index sets for each composed object in the composite. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.DMComposite.getGlobalISs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_isets); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMComposite.pyx":169 * return isets * * def getLocalISs(self) -> list[IS]: # <<<<<<<<<<<<<< * """Return index sets for each component of a composite local vector. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_11DMComposite_15getLocalISs(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_11DMComposite_14getLocalISs, "DMComposite.getLocalISs(self) -> list[IS]\nReturn index sets for each component of a composite local vector.\n\n Not collective.\n\n To get the composite global indices at all local points (including\n ghosts), use `getLGMaps`.\n\n To get index sets for pieces of the composite global vector, use\n `getGlobalISs`.\n\n See Also\n --------\n petsc.DMCompositeGetLocalISs\n\n \nSource code at petsc4py/PETSc/DMComposite.pyx:169"); static PyObject *__pyx_pw_8petsc4py_5PETSc_11DMComposite_15getLocalISs(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getLocalISs (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getLocalISs", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getLocalISs", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_11DMComposite_14getLocalISs(((struct __pyx_obj_8petsc4py_5PETSc_DMComposite *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_11DMComposite_14getLocalISs(struct __pyx_obj_8petsc4py_5PETSc_DMComposite *__pyx_v_self) { PetscInt __pyx_v_i; PetscInt __pyx_v_n; IS *__pyx_v_cis; PyObject *__pyx_v_isets = 0; PetscInt __pyx_9genexpr19__pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscInt __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getLocalISs", 1); /* "petsc4py/PETSc/DMComposite.pyx":185 * * """ * cdef PetscInt i, n = 0 # <<<<<<<<<<<<<< * cdef PetscIS *cis = NULL * CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) */ __pyx_v_n = 0; /* "petsc4py/PETSc/DMComposite.pyx":186 * """ * cdef PetscInt i, n = 0 * cdef PetscIS *cis = NULL # <<<<<<<<<<<<<< * CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) * CHKERR( DMCompositeGetLocalISs(self.dm, &cis) ) */ __pyx_v_cis = NULL; /* "petsc4py/PETSc/DMComposite.pyx":187 * cdef PetscInt i, n = 0 * cdef PetscIS *cis = NULL * CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) # <<<<<<<<<<<<<< * CHKERR( DMCompositeGetLocalISs(self.dm, &cis) ) * cdef object isets = [ref_IS(cis[i]) for i from 0 <= i < n] */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCompositeGetNumberDM(__pyx_v_self->__pyx_base.dm, (&__pyx_v_n))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(59, 187, __pyx_L1_error) /* "petsc4py/PETSc/DMComposite.pyx":188 * cdef PetscIS *cis = NULL * CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) * CHKERR( DMCompositeGetLocalISs(self.dm, &cis) ) # <<<<<<<<<<<<<< * cdef object isets = [ref_IS(cis[i]) for i from 0 <= i < n] * for i from 0 <= i < n: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCompositeGetLocalISs(__pyx_v_self->__pyx_base.dm, (&__pyx_v_cis))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(59, 188, __pyx_L1_error) /* "petsc4py/PETSc/DMComposite.pyx":189 * CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) * CHKERR( DMCompositeGetLocalISs(self.dm, &cis) ) * cdef object isets = [ref_IS(cis[i]) for i from 0 <= i < n] # <<<<<<<<<<<<<< * for i from 0 <= i < n: * CHKERR( ISDestroy(&cis[i]) ) */ { /* enter inner scope */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(59, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_v_n; for (__pyx_9genexpr19__pyx_v_i = 0; __pyx_9genexpr19__pyx_v_i < __pyx_t_3; __pyx_9genexpr19__pyx_v_i++) { __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_IS((__pyx_v_cis[__pyx_9genexpr19__pyx_v_i]))); if (unlikely(!__pyx_t_4)) __PYX_ERR(59, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_4))) __PYX_ERR(59, 189, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } } /* exit inner scope */ __pyx_v_isets = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/DMComposite.pyx":190 * CHKERR( DMCompositeGetLocalISs(self.dm, &cis) ) * cdef object isets = [ref_IS(cis[i]) for i from 0 <= i < n] * for i from 0 <= i < n: # <<<<<<<<<<<<<< * CHKERR( ISDestroy(&cis[i]) ) * CHKERR( PetscFree(cis) ) */ __pyx_t_3 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { /* "petsc4py/PETSc/DMComposite.pyx":191 * cdef object isets = [ref_IS(cis[i]) for i from 0 <= i < n] * for i from 0 <= i < n: * CHKERR( ISDestroy(&cis[i]) ) # <<<<<<<<<<<<<< * CHKERR( PetscFree(cis) ) * return isets */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISDestroy((&(__pyx_v_cis[__pyx_v_i])))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(59, 191, __pyx_L1_error) } /* "petsc4py/PETSc/DMComposite.pyx":192 * for i from 0 <= i < n: * CHKERR( ISDestroy(&cis[i]) ) * CHKERR( PetscFree(cis) ) # <<<<<<<<<<<<<< * return isets * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_cis)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(59, 192, __pyx_L1_error) /* "petsc4py/PETSc/DMComposite.pyx":193 * CHKERR( ISDestroy(&cis[i]) ) * CHKERR( PetscFree(cis) ) * return isets # <<<<<<<<<<<<<< * * def getLGMaps(self) -> list[LGMap]: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_isets); __pyx_r = __pyx_v_isets; goto __pyx_L0; /* "petsc4py/PETSc/DMComposite.pyx":169 * return isets * * def getLocalISs(self) -> list[IS]: # <<<<<<<<<<<<<< * """Return index sets for each component of a composite local vector. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.DMComposite.getLocalISs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_isets); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMComposite.pyx":195 * return isets * * def getLGMaps(self) -> list[LGMap]: # <<<<<<<<<<<<<< * """Return a local-to-global mapping for each DM in the composite. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_11DMComposite_17getLGMaps(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_11DMComposite_16getLGMaps, "DMComposite.getLGMaps(self) -> list[LGMap]\nReturn a local-to-global mapping for each DM in the composite.\n\n Collective.\n\n Note that this includes all the ghost points that individual ghosted\n DMDA may have.\n\n See Also\n --------\n petsc.DMCompositeGetISLocalToGlobalMappings\n\n \nSource code at petsc4py/PETSc/DMComposite.pyx:195"); static PyObject *__pyx_pw_8petsc4py_5PETSc_11DMComposite_17getLGMaps(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getLGMaps (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getLGMaps", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getLGMaps", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_11DMComposite_16getLGMaps(((struct __pyx_obj_8petsc4py_5PETSc_DMComposite *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_11DMComposite_16getLGMaps(struct __pyx_obj_8petsc4py_5PETSc_DMComposite *__pyx_v_self) { PetscInt __pyx_v_i; PetscInt __pyx_v_n; ISLocalToGlobalMapping *__pyx_v_clgm; PyObject *__pyx_v_lgms = 0; PetscInt __pyx_9genexpr20__pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscInt __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getLGMaps", 1); /* "petsc4py/PETSc/DMComposite.pyx":208 * * """ * cdef PetscInt i, n = 0 # <<<<<<<<<<<<<< * cdef PetscLGMap *clgm = NULL * CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) */ __pyx_v_n = 0; /* "petsc4py/PETSc/DMComposite.pyx":209 * """ * cdef PetscInt i, n = 0 * cdef PetscLGMap *clgm = NULL # <<<<<<<<<<<<<< * CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) * CHKERR( DMCompositeGetISLocalToGlobalMappings(self.dm, &clgm) ) */ __pyx_v_clgm = NULL; /* "petsc4py/PETSc/DMComposite.pyx":210 * cdef PetscInt i, n = 0 * cdef PetscLGMap *clgm = NULL * CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) # <<<<<<<<<<<<<< * CHKERR( DMCompositeGetISLocalToGlobalMappings(self.dm, &clgm) ) * cdef object lgms = [ref_LGMap(clgm[i]) for i from 0 <= i < n] */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCompositeGetNumberDM(__pyx_v_self->__pyx_base.dm, (&__pyx_v_n))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(59, 210, __pyx_L1_error) /* "petsc4py/PETSc/DMComposite.pyx":211 * cdef PetscLGMap *clgm = NULL * CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) * CHKERR( DMCompositeGetISLocalToGlobalMappings(self.dm, &clgm) ) # <<<<<<<<<<<<<< * cdef object lgms = [ref_LGMap(clgm[i]) for i from 0 <= i < n] * for i from 0 <= i < n: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCompositeGetISLocalToGlobalMappings(__pyx_v_self->__pyx_base.dm, (&__pyx_v_clgm))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(59, 211, __pyx_L1_error) /* "petsc4py/PETSc/DMComposite.pyx":212 * CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) * CHKERR( DMCompositeGetISLocalToGlobalMappings(self.dm, &clgm) ) * cdef object lgms = [ref_LGMap(clgm[i]) for i from 0 <= i < n] # <<<<<<<<<<<<<< * for i from 0 <= i < n: * CHKERR( ISLocalToGlobalMappingDestroy(&clgm[i]) ) */ { /* enter inner scope */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(59, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_v_n; for (__pyx_9genexpr20__pyx_v_i = 0; __pyx_9genexpr20__pyx_v_i < __pyx_t_3; __pyx_9genexpr20__pyx_v_i++) { __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_LGMap((__pyx_v_clgm[__pyx_9genexpr20__pyx_v_i]))); if (unlikely(!__pyx_t_4)) __PYX_ERR(59, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_4))) __PYX_ERR(59, 212, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } } /* exit inner scope */ __pyx_v_lgms = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/DMComposite.pyx":213 * CHKERR( DMCompositeGetISLocalToGlobalMappings(self.dm, &clgm) ) * cdef object lgms = [ref_LGMap(clgm[i]) for i from 0 <= i < n] * for i from 0 <= i < n: # <<<<<<<<<<<<<< * CHKERR( ISLocalToGlobalMappingDestroy(&clgm[i]) ) * CHKERR( PetscFree(clgm) ) */ __pyx_t_3 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { /* "petsc4py/PETSc/DMComposite.pyx":214 * cdef object lgms = [ref_LGMap(clgm[i]) for i from 0 <= i < n] * for i from 0 <= i < n: * CHKERR( ISLocalToGlobalMappingDestroy(&clgm[i]) ) # <<<<<<<<<<<<<< * CHKERR( PetscFree(clgm) ) * return lgms */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISLocalToGlobalMappingDestroy((&(__pyx_v_clgm[__pyx_v_i])))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(59, 214, __pyx_L1_error) } /* "petsc4py/PETSc/DMComposite.pyx":215 * for i from 0 <= i < n: * CHKERR( ISLocalToGlobalMappingDestroy(&clgm[i]) ) * CHKERR( PetscFree(clgm) ) # <<<<<<<<<<<<<< * return lgms * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_clgm)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(59, 215, __pyx_L1_error) /* "petsc4py/PETSc/DMComposite.pyx":216 * CHKERR( ISLocalToGlobalMappingDestroy(&clgm[i]) ) * CHKERR( PetscFree(clgm) ) * return lgms # <<<<<<<<<<<<<< * * def getAccess(self, Vec gvec, locs: Sequence[int] | None = None) -> Any: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_lgms); __pyx_r = __pyx_v_lgms; goto __pyx_L0; /* "petsc4py/PETSc/DMComposite.pyx":195 * return isets * * def getLGMaps(self) -> list[LGMap]: # <<<<<<<<<<<<<< * """Return a local-to-global mapping for each DM in the composite. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.DMComposite.getLGMaps", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_lgms); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMComposite.pyx":218 * return lgms * * def getAccess(self, Vec gvec, locs: Sequence[int] | None = None) -> Any: # <<<<<<<<<<<<<< * """Get access to the individual vectors from the global vector. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_11DMComposite_19getAccess(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_11DMComposite_18getAccess, "DMComposite.getAccess(self, gvec: Vec, locs: Sequence[int] | None = None) -> Any\nGet access to the individual vectors from the global vector.\n\n Not collective.\n\n Use via `with` context manager (PEP 343).\n\n Parameters\n ----------\n gvec\n The global vector.\n locs\n Indices of vectors wanted, or `None` to get all vectors.\n\n \nSource code at petsc4py/PETSc/DMComposite.pyx:218"); static PyObject *__pyx_pw_8petsc4py_5PETSc_11DMComposite_19getAccess(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_gvec = 0; PyObject *__pyx_v_locs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getAccess (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gvec,&__pyx_n_s_locs,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gvec)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(59, 218, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_locs); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(59, 218, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getAccess") < 0)) __PYX_ERR(59, 218, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_gvec = ((struct PyPetscVecObject *)values[0]); __pyx_v_locs = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getAccess", 0, 1, 2, __pyx_nargs); __PYX_ERR(59, 218, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMComposite.getAccess", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gvec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "gvec", 0))) __PYX_ERR(59, 218, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_11DMComposite_18getAccess(((struct __pyx_obj_8petsc4py_5PETSc_DMComposite *)__pyx_v_self), __pyx_v_gvec, __pyx_v_locs); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_11DMComposite_18getAccess(struct __pyx_obj_8petsc4py_5PETSc_DMComposite *__pyx_v_self, struct PyPetscVecObject *__pyx_v_gvec, PyObject *__pyx_v_locs) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getAccess", 1); /* "petsc4py/PETSc/DMComposite.pyx":233 * * """ * return _DMComposite_access(self, gvec, locs) # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(59, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF((PyObject *)__pyx_v_self); __Pyx_GIVEREF((PyObject *)__pyx_v_self); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self))) __PYX_ERR(59, 233, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_gvec); __Pyx_GIVEREF((PyObject *)__pyx_v_gvec); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_gvec))) __PYX_ERR(59, 233, __pyx_L1_error); __Pyx_INCREF(__pyx_v_locs); __Pyx_GIVEREF(__pyx_v_locs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_locs)) __PYX_ERR(59, 233, __pyx_L1_error); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8petsc4py_5PETSc__DMComposite_access), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(59, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMComposite.pyx":218 * return lgms * * def getAccess(self, Vec gvec, locs: Sequence[int] | None = None) -> Any: # <<<<<<<<<<<<<< * """Get access to the individual vectors from the global vector. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMComposite.getAccess", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMShell.pyx":4 * """A shell DM object, used to manage user-defined problem data.""" * * def create(self, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Creates a shell DM object. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_1create(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMShell_create, "DMShell.create(self, comm: Comm | None = None) -> Self\nCreates a shell DM object.\n\n Collective.\n\n Parameters\n ----------\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n petsc.DMShellCreate\n\n \nSource code at petsc4py/PETSc/DMShell.pyx:4"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_1create(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(60, 4, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "create") < 0)) __PYX_ERR(60, 4, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_comm = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, __pyx_nargs); __PYX_ERR(60, 4, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMShell.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMShell_create(((struct __pyx_obj_8petsc4py_5PETSc_DMShell *)__pyx_v_self), __pyx_v_comm); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_create(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; DM __pyx_v_newdm; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create", 1); /* "petsc4py/PETSc/DMShell.pyx":19 * * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscDM newdm = NULL * CHKERR( DMShellCreate(ccomm, &newdm) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(60, 19, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/DMShell.pyx":20 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscDM newdm = NULL # <<<<<<<<<<<<<< * CHKERR( DMShellCreate(ccomm, &newdm) ) * CHKERR( PetscCLEAR(self.obj) ); self.dm = newdm */ __pyx_v_newdm = NULL; /* "petsc4py/PETSc/DMShell.pyx":21 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscDM newdm = NULL * CHKERR( DMShellCreate(ccomm, &newdm) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.dm = newdm * return self */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMShellCreate(__pyx_v_ccomm, (&__pyx_v_newdm))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(60, 21, __pyx_L1_error) /* "petsc4py/PETSc/DMShell.pyx":22 * cdef PetscDM newdm = NULL * CHKERR( DMShellCreate(ccomm, &newdm) ) * CHKERR( PetscCLEAR(self.obj) ); self.dm = newdm # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(60, 22, __pyx_L1_error) __pyx_v_self->__pyx_base.dm = __pyx_v_newdm; /* "petsc4py/PETSc/DMShell.pyx":23 * CHKERR( DMShellCreate(ccomm, &newdm) ) * CHKERR( PetscCLEAR(self.obj) ); self.dm = newdm * return self # <<<<<<<<<<<<<< * * def setMatrix(self, Mat mat) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/DMShell.pyx":4 * """A shell DM object, used to manage user-defined problem data.""" * * def create(self, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Creates a shell DM object. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMShell.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMShell.pyx":25 * return self * * def setMatrix(self, Mat mat) -> None: # <<<<<<<<<<<<<< * """Set a template matrix. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_3setMatrix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMShell_2setMatrix, "DMShell.setMatrix(self, mat: Mat) -> None\nSet a template matrix.\n\n Collective.\n\n Parameters\n ----------\n mat\n The template matrix.\n\n See Also\n --------\n petsc.DMShellSetMatrix\n\n \nSource code at petsc4py/PETSc/DMShell.pyx:25"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_3setMatrix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscMatObject *__pyx_v_mat = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setMatrix (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mat)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(60, 25, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setMatrix") < 0)) __PYX_ERR(60, 25, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_mat = ((struct PyPetscMatObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setMatrix", 1, 1, 1, __pyx_nargs); __PYX_ERR(60, 25, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setMatrix", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(60, 25, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMShell_2setMatrix(((struct __pyx_obj_8petsc4py_5PETSc_DMShell *)__pyx_v_self), __pyx_v_mat); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_2setMatrix(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setMatrix", 1); /* "petsc4py/PETSc/DMShell.pyx":40 * * """ * CHKERR( DMShellSetMatrix(self.dm, mat.mat) ) # <<<<<<<<<<<<<< * * def setGlobalVector(self, Vec gv) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMShellSetMatrix(__pyx_v_self->__pyx_base.dm, __pyx_v_mat->mat)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(60, 40, __pyx_L1_error) /* "petsc4py/PETSc/DMShell.pyx":25 * return self * * def setMatrix(self, Mat mat) -> None: # <<<<<<<<<<<<<< * """Set a template matrix. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setMatrix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMShell.pyx":42 * CHKERR( DMShellSetMatrix(self.dm, mat.mat) ) * * def setGlobalVector(self, Vec gv) -> None: # <<<<<<<<<<<<<< * """Set a template global vector. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_5setGlobalVector(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMShell_4setGlobalVector, "DMShell.setGlobalVector(self, gv: Vec) -> None\nSet a template global vector.\n\n Logically collective.\n\n Parameters\n ----------\n gv\n Template vector.\n\n See Also\n --------\n setLocalVector, petsc.DMShellSetGlobalVector\n\n \nSource code at petsc4py/PETSc/DMShell.pyx:42"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_5setGlobalVector(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_gv = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setGlobalVector (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gv,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gv)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(60, 42, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setGlobalVector") < 0)) __PYX_ERR(60, 42, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_gv = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setGlobalVector", 1, 1, 1, __pyx_nargs); __PYX_ERR(60, 42, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setGlobalVector", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gv), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "gv", 0))) __PYX_ERR(60, 42, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMShell_4setGlobalVector(((struct __pyx_obj_8petsc4py_5PETSc_DMShell *)__pyx_v_self), __pyx_v_gv); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_4setGlobalVector(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, struct PyPetscVecObject *__pyx_v_gv) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setGlobalVector", 1); /* "petsc4py/PETSc/DMShell.pyx":57 * * """ * CHKERR( DMShellSetGlobalVector(self.dm, gv.vec) ) # <<<<<<<<<<<<<< * * def setLocalVector(self, Vec lv) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMShellSetGlobalVector(__pyx_v_self->__pyx_base.dm, __pyx_v_gv->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(60, 57, __pyx_L1_error) /* "petsc4py/PETSc/DMShell.pyx":42 * CHKERR( DMShellSetMatrix(self.dm, mat.mat) ) * * def setGlobalVector(self, Vec gv) -> None: # <<<<<<<<<<<<<< * """Set a template global vector. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setGlobalVector", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMShell.pyx":59 * CHKERR( DMShellSetGlobalVector(self.dm, gv.vec) ) * * def setLocalVector(self, Vec lv) -> None: # <<<<<<<<<<<<<< * """Set a template local vector. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_7setLocalVector(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMShell_6setLocalVector, "DMShell.setLocalVector(self, lv: Vec) -> None\nSet a template local vector.\n\n Logically collective.\n\n Parameters\n ----------\n lv\n Template vector.\n\n See Also\n --------\n setGlobalVector, petsc.DMShellSetLocalVector\n\n \nSource code at petsc4py/PETSc/DMShell.pyx:59"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_7setLocalVector(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_lv = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setLocalVector (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_lv,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_lv)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(60, 59, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setLocalVector") < 0)) __PYX_ERR(60, 59, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_lv = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setLocalVector", 1, 1, 1, __pyx_nargs); __PYX_ERR(60, 59, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setLocalVector", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lv), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "lv", 0))) __PYX_ERR(60, 59, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMShell_6setLocalVector(((struct __pyx_obj_8petsc4py_5PETSc_DMShell *)__pyx_v_self), __pyx_v_lv); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_6setLocalVector(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, struct PyPetscVecObject *__pyx_v_lv) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setLocalVector", 1); /* "petsc4py/PETSc/DMShell.pyx":74 * * """ * CHKERR( DMShellSetLocalVector(self.dm, lv.vec) ) # <<<<<<<<<<<<<< * * def setCreateGlobalVector( */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMShellSetLocalVector(__pyx_v_self->__pyx_base.dm, __pyx_v_lv->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(60, 74, __pyx_L1_error) /* "petsc4py/PETSc/DMShell.pyx":59 * CHKERR( DMShellSetGlobalVector(self.dm, gv.vec) ) * * def setLocalVector(self, Vec lv) -> None: # <<<<<<<<<<<<<< * """Set a template local vector. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setLocalVector", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMShell.pyx":76 * CHKERR( DMShellSetLocalVector(self.dm, lv.vec) ) * * def setCreateGlobalVector( # <<<<<<<<<<<<<< * self, * create_gvec: Callable[[DM], Vec] | None, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_9setCreateGlobalVector(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMShell_8setCreateGlobalVector, "DMShell.setCreateGlobalVector(self, create_gvec: Callable[[DM], Vec] | None, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nSet the routine to create a global vector.\n\n Logically collective.\n\n Parameters\n ----------\n create_gvec\n The creation routine.\n args\n Additional positional arguments for ``create_gvec``.\n kargs\n Additional keyword arguments for ``create_gvec``.\n\n See Also\n --------\n setCreateLocalVector, petsc.DMShellSetCreateGlobalVector\n\n \nSource code at petsc4py/PETSc/DMShell.pyx:76"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_9setCreateGlobalVector(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_create_gvec = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setCreateGlobalVector (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_create_gvec,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; /* "petsc4py/PETSc/DMShell.pyx":79 * self, * create_gvec: Callable[[DM], Vec] | None, * args: tuple[Any, ...] | None = None, # <<<<<<<<<<<<<< * kargs: dict[str, Any] | None = None, * ) -> None: */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/DMShell.pyx":80 * create_gvec: Callable[[DM], Vec] | None, * args: tuple[Any, ...] | None = None, * kargs: dict[str, Any] | None = None, # <<<<<<<<<<<<<< * ) -> None: * """Set the routine to create a global vector. */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_create_gvec)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(60, 76, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(60, 76, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(60, 76, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setCreateGlobalVector") < 0)) __PYX_ERR(60, 76, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_create_gvec = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setCreateGlobalVector", 0, 1, 3, __pyx_nargs); __PYX_ERR(60, 76, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setCreateGlobalVector", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMShell_8setCreateGlobalVector(((struct __pyx_obj_8petsc4py_5PETSc_DMShell *)__pyx_v_self), __pyx_v_create_gvec, __pyx_v_args, __pyx_v_kargs); /* "petsc4py/PETSc/DMShell.pyx":76 * CHKERR( DMShellSetLocalVector(self.dm, lv.vec) ) * * def setCreateGlobalVector( # <<<<<<<<<<<<<< * self, * create_gvec: Callable[[DM], Vec] | None, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_8setCreateGlobalVector(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_create_gvec, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setCreateGlobalVector", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/DMShell.pyx":100 * * """ * if create_gvec is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = (__pyx_v_create_gvec != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/DMShell.pyx":101 * """ * if create_gvec is not None: * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (create_gvec, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/DMShell.pyx":102 * if create_gvec is not None: * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (create_gvec, args, kargs) * self.set_attr('__create_global_vector__', context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); if (__pyx_t_1) { __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(60, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_2); __pyx_t_2 = 0; } /* "petsc4py/PETSc/DMShell.pyx":103 * if args is None: args = () * if kargs is None: kargs = {} * context = (create_gvec, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__create_global_vector__', context) * CHKERR( DMShellSetCreateGlobalVector(self.dm, DMSHELL_CreateGlobalVector) ) */ __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(60, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_create_gvec); __Pyx_GIVEREF(__pyx_v_create_gvec); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_create_gvec)) __PYX_ERR(60, 103, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_args)) __PYX_ERR(60, 103, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_kargs)) __PYX_ERR(60, 103, __pyx_L1_error); __pyx_v_context = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DMShell.pyx":104 * if kargs is None: kargs = {} * context = (create_gvec, args, kargs) * self.set_attr('__create_global_vector__', context) # <<<<<<<<<<<<<< * CHKERR( DMShellSetCreateGlobalVector(self.dm, DMSHELL_CreateGlobalVector) ) * else: */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DMShell *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__create_global_vector__"), __pyx_v_context); if (unlikely(!__pyx_t_2)) __PYX_ERR(60, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DMShell.pyx":105 * context = (create_gvec, args, kargs) * self.set_attr('__create_global_vector__', context) * CHKERR( DMShellSetCreateGlobalVector(self.dm, DMSHELL_CreateGlobalVector) ) # <<<<<<<<<<<<<< * else: * CHKERR( DMShellSetCreateGlobalVector(self.dm, NULL) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMShellSetCreateGlobalVector(__pyx_v_self->__pyx_base.dm, __pyx_f_8petsc4py_5PETSc_DMSHELL_CreateGlobalVector)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(60, 105, __pyx_L1_error) /* "petsc4py/PETSc/DMShell.pyx":100 * * """ * if create_gvec is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ goto __pyx_L3; } /* "petsc4py/PETSc/DMShell.pyx":107 * CHKERR( DMShellSetCreateGlobalVector(self.dm, DMSHELL_CreateGlobalVector) ) * else: * CHKERR( DMShellSetCreateGlobalVector(self.dm, NULL) ) # <<<<<<<<<<<<<< * * def setCreateLocalVector( */ /*else*/ { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMShellSetCreateGlobalVector(__pyx_v_self->__pyx_base.dm, NULL)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(60, 107, __pyx_L1_error) } __pyx_L3:; /* "petsc4py/PETSc/DMShell.pyx":76 * CHKERR( DMShellSetLocalVector(self.dm, lv.vec) ) * * def setCreateGlobalVector( # <<<<<<<<<<<<<< * self, * create_gvec: Callable[[DM], Vec] | None, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setCreateGlobalVector", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMShell.pyx":109 * CHKERR( DMShellSetCreateGlobalVector(self.dm, NULL) ) * * def setCreateLocalVector( # <<<<<<<<<<<<<< * self, * create_lvec: Callable[[DM], Vec] | None, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_11setCreateLocalVector(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMShell_10setCreateLocalVector, "DMShell.setCreateLocalVector(self, create_lvec: Callable[[DM], Vec] | None, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nSet the routine to create a local vector.\n\n Logically collective.\n\n Parameters\n ----------\n create_lvec\n The creation routine.\n args\n Additional positional arguments for ``create_lvec``.\n kargs\n Additional keyword arguments for ``create_lvec``.\n\n See Also\n --------\n setCreateGlobalVector, petsc.DMShellSetCreateLocalVector\n\n \nSource code at petsc4py/PETSc/DMShell.pyx:109"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_11setCreateLocalVector(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_create_lvec = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setCreateLocalVector (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_create_lvec,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; /* "petsc4py/PETSc/DMShell.pyx":112 * self, * create_lvec: Callable[[DM], Vec] | None, * args: tuple[Any, ...] | None = None, # <<<<<<<<<<<<<< * kargs: dict[str, Any] | None = None, * ) -> None: */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/DMShell.pyx":113 * create_lvec: Callable[[DM], Vec] | None, * args: tuple[Any, ...] | None = None, * kargs: dict[str, Any] | None = None, # <<<<<<<<<<<<<< * ) -> None: * """Set the routine to create a local vector. */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_create_lvec)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(60, 109, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(60, 109, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(60, 109, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setCreateLocalVector") < 0)) __PYX_ERR(60, 109, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_create_lvec = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setCreateLocalVector", 0, 1, 3, __pyx_nargs); __PYX_ERR(60, 109, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setCreateLocalVector", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMShell_10setCreateLocalVector(((struct __pyx_obj_8petsc4py_5PETSc_DMShell *)__pyx_v_self), __pyx_v_create_lvec, __pyx_v_args, __pyx_v_kargs); /* "petsc4py/PETSc/DMShell.pyx":109 * CHKERR( DMShellSetCreateGlobalVector(self.dm, NULL) ) * * def setCreateLocalVector( # <<<<<<<<<<<<<< * self, * create_lvec: Callable[[DM], Vec] | None, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_10setCreateLocalVector(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_create_lvec, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setCreateLocalVector", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/DMShell.pyx":133 * * """ * if create_lvec is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = (__pyx_v_create_lvec != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/DMShell.pyx":134 * """ * if create_lvec is not None: * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (create_lvec, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/DMShell.pyx":135 * if create_lvec is not None: * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (create_lvec, args, kargs) * self.set_attr('__create_local_vector__', context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); if (__pyx_t_1) { __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(60, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_2); __pyx_t_2 = 0; } /* "petsc4py/PETSc/DMShell.pyx":136 * if args is None: args = () * if kargs is None: kargs = {} * context = (create_lvec, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__create_local_vector__', context) * CHKERR( DMShellSetCreateLocalVector(self.dm, DMSHELL_CreateLocalVector) ) */ __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(60, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_create_lvec); __Pyx_GIVEREF(__pyx_v_create_lvec); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_create_lvec)) __PYX_ERR(60, 136, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_args)) __PYX_ERR(60, 136, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_kargs)) __PYX_ERR(60, 136, __pyx_L1_error); __pyx_v_context = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DMShell.pyx":137 * if kargs is None: kargs = {} * context = (create_lvec, args, kargs) * self.set_attr('__create_local_vector__', context) # <<<<<<<<<<<<<< * CHKERR( DMShellSetCreateLocalVector(self.dm, DMSHELL_CreateLocalVector) ) * else: */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DMShell *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__create_local_vector__"), __pyx_v_context); if (unlikely(!__pyx_t_2)) __PYX_ERR(60, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DMShell.pyx":138 * context = (create_lvec, args, kargs) * self.set_attr('__create_local_vector__', context) * CHKERR( DMShellSetCreateLocalVector(self.dm, DMSHELL_CreateLocalVector) ) # <<<<<<<<<<<<<< * else: * CHKERR( DMShellSetCreateLocalVector(self.dm, NULL) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMShellSetCreateLocalVector(__pyx_v_self->__pyx_base.dm, __pyx_f_8petsc4py_5PETSc_DMSHELL_CreateLocalVector)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(60, 138, __pyx_L1_error) /* "petsc4py/PETSc/DMShell.pyx":133 * * """ * if create_lvec is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ goto __pyx_L3; } /* "petsc4py/PETSc/DMShell.pyx":140 * CHKERR( DMShellSetCreateLocalVector(self.dm, DMSHELL_CreateLocalVector) ) * else: * CHKERR( DMShellSetCreateLocalVector(self.dm, NULL) ) # <<<<<<<<<<<<<< * * def setGlobalToLocal( */ /*else*/ { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMShellSetCreateLocalVector(__pyx_v_self->__pyx_base.dm, NULL)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(60, 140, __pyx_L1_error) } __pyx_L3:; /* "petsc4py/PETSc/DMShell.pyx":109 * CHKERR( DMShellSetCreateGlobalVector(self.dm, NULL) ) * * def setCreateLocalVector( # <<<<<<<<<<<<<< * self, * create_lvec: Callable[[DM], Vec] | None, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setCreateLocalVector", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMShell.pyx":142 * CHKERR( DMShellSetCreateLocalVector(self.dm, NULL) ) * * def setGlobalToLocal( # <<<<<<<<<<<<<< * self, * begin: Callable[[DM, Vec, InsertMode, Vec], None] | None, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_13setGlobalToLocal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMShell_12setGlobalToLocal, "DMShell.setGlobalToLocal(self, begin: Callable[[DM, Vec, InsertMode, Vec], None] | None, end: Callable[[DM, Vec, InsertMode, Vec], None] | None, begin_args: tuple[Any, ...] | None = None, begin_kargs: dict[str, Any] | None = None, end_args: tuple[Any, ...] | None = None, end_kargs: dict[str, Any] | None = None) -> None\nSet the routines used to perform a global to local scatter.\n\n Logically collective.\n\n Parameters\n ----------\n dm\n The `DMShell`.\n begin\n The routine which begins the global to local scatter.\n end\n The routine which ends the global to local scatter.\n begin_args\n Additional positional arguments for ``begin``.\n begin_kargs\n Additional keyword arguments for ``begin``.\n end_args\n Additional positional arguments for ``end``.\n end_kargs\n Additional keyword arguments for ``end``.\n\n See Also\n --------\n petsc.DMShellSetGlobalToLocal\n\n \nSource code at petsc4py/PETSc/DMShell.pyx:142"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_13setGlobalToLocal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_begin = 0; PyObject *__pyx_v_end = 0; PyObject *__pyx_v_begin_args = 0; PyObject *__pyx_v_begin_kargs = 0; PyObject *__pyx_v_end_args = 0; PyObject *__pyx_v_end_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[6] = {0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setGlobalToLocal (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_begin,&__pyx_n_s_end,&__pyx_n_s_begin_args,&__pyx_n_s_begin_kargs,&__pyx_n_s_end_args,&__pyx_n_s_end_kargs,0}; /* "petsc4py/PETSc/DMShell.pyx":146 * begin: Callable[[DM, Vec, InsertMode, Vec], None] | None, * end: Callable[[DM, Vec, InsertMode, Vec], None] | None, * begin_args: tuple[Any, ...] | None = None, # <<<<<<<<<<<<<< * begin_kargs: dict[str, Any] | None = None, * end_args: tuple[Any, ...] | None = None, */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/DMShell.pyx":147 * end: Callable[[DM, Vec, InsertMode, Vec], None] | None, * begin_args: tuple[Any, ...] | None = None, * begin_kargs: dict[str, Any] | None = None, # <<<<<<<<<<<<<< * end_args: tuple[Any, ...] | None = None, * end_kargs: dict[str, Any] | None = None, */ values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/DMShell.pyx":148 * begin_args: tuple[Any, ...] | None = None, * begin_kargs: dict[str, Any] | None = None, * end_args: tuple[Any, ...] | None = None, # <<<<<<<<<<<<<< * end_kargs: dict[str, Any] | None = None, * ) -> None: */ values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/DMShell.pyx":149 * begin_kargs: dict[str, Any] | None = None, * end_args: tuple[Any, ...] | None = None, * end_kargs: dict[str, Any] | None = None, # <<<<<<<<<<<<<< * ) -> None: * """Set the routines used to perform a global to local scatter. */ values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_begin)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(60, 142, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_end)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(60, 142, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setGlobalToLocal", 0, 2, 6, 1); __PYX_ERR(60, 142, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_begin_args); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(60, 142, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_begin_kargs); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(60, 142, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_end_args); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(60, 142, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_end_kargs); if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(60, 142, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setGlobalToLocal") < 0)) __PYX_ERR(60, 142, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_begin = values[0]; __pyx_v_end = values[1]; __pyx_v_begin_args = values[2]; __pyx_v_begin_kargs = values[3]; __pyx_v_end_args = values[4]; __pyx_v_end_kargs = values[5]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setGlobalToLocal", 0, 2, 6, __pyx_nargs); __PYX_ERR(60, 142, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setGlobalToLocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMShell_12setGlobalToLocal(((struct __pyx_obj_8petsc4py_5PETSc_DMShell *)__pyx_v_self), __pyx_v_begin, __pyx_v_end, __pyx_v_begin_args, __pyx_v_begin_kargs, __pyx_v_end_args, __pyx_v_end_kargs); /* "petsc4py/PETSc/DMShell.pyx":142 * CHKERR( DMShellSetCreateLocalVector(self.dm, NULL) ) * * def setGlobalToLocal( # <<<<<<<<<<<<<< * self, * begin: Callable[[DM, Vec, InsertMode, Vec], None] | None, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_12setGlobalToLocal(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_begin, PyObject *__pyx_v_end, PyObject *__pyx_v_begin_args, PyObject *__pyx_v_begin_kargs, PyObject *__pyx_v_end_args, PyObject *__pyx_v_end_kargs) { __pyx_t_8petsc4py_5PETSc_PetscDMShellXToYFunction __pyx_v_cbegin; __pyx_t_8petsc4py_5PETSc_PetscDMShellXToYFunction __pyx_v_cend; PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setGlobalToLocal", 0); __Pyx_INCREF(__pyx_v_begin_args); __Pyx_INCREF(__pyx_v_begin_kargs); __Pyx_INCREF(__pyx_v_end_args); __Pyx_INCREF(__pyx_v_end_kargs); /* "petsc4py/PETSc/DMShell.pyx":177 * * """ * cdef PetscDMShellXToYFunction cbegin = NULL, cend = NULL # <<<<<<<<<<<<<< * if begin is not None: * if begin_args is None: begin_args = () */ __pyx_v_cbegin = NULL; __pyx_v_cend = NULL; /* "petsc4py/PETSc/DMShell.pyx":178 * """ * cdef PetscDMShellXToYFunction cbegin = NULL, cend = NULL * if begin is not None: # <<<<<<<<<<<<<< * if begin_args is None: begin_args = () * if begin_kargs is None: begin_kargs = {} */ __pyx_t_1 = (__pyx_v_begin != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/DMShell.pyx":179 * cdef PetscDMShellXToYFunction cbegin = NULL, cend = NULL * if begin is not None: * if begin_args is None: begin_args = () # <<<<<<<<<<<<<< * if begin_kargs is None: begin_kargs = {} * context = (begin, begin_args, begin_kargs) */ __pyx_t_1 = (__pyx_v_begin_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_begin_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/DMShell.pyx":180 * if begin is not None: * if begin_args is None: begin_args = () * if begin_kargs is None: begin_kargs = {} # <<<<<<<<<<<<<< * context = (begin, begin_args, begin_kargs) * self.set_attr('__g2l_begin__', context) */ __pyx_t_1 = (__pyx_v_begin_kargs == Py_None); if (__pyx_t_1) { __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(60, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_begin_kargs, __pyx_t_2); __pyx_t_2 = 0; } /* "petsc4py/PETSc/DMShell.pyx":181 * if begin_args is None: begin_args = () * if begin_kargs is None: begin_kargs = {} * context = (begin, begin_args, begin_kargs) # <<<<<<<<<<<<<< * self.set_attr('__g2l_begin__', context) * cbegin = &DMSHELL_GlobalToLocalBegin */ __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(60, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_begin); __Pyx_GIVEREF(__pyx_v_begin); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_begin)) __PYX_ERR(60, 181, __pyx_L1_error); __Pyx_INCREF(__pyx_v_begin_args); __Pyx_GIVEREF(__pyx_v_begin_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_begin_args)) __PYX_ERR(60, 181, __pyx_L1_error); __Pyx_INCREF(__pyx_v_begin_kargs); __Pyx_GIVEREF(__pyx_v_begin_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_begin_kargs)) __PYX_ERR(60, 181, __pyx_L1_error); __pyx_v_context = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DMShell.pyx":182 * if begin_kargs is None: begin_kargs = {} * context = (begin, begin_args, begin_kargs) * self.set_attr('__g2l_begin__', context) # <<<<<<<<<<<<<< * cbegin = &DMSHELL_GlobalToLocalBegin * if end is not None: */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DMShell *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__g2l_begin__"), __pyx_v_context); if (unlikely(!__pyx_t_2)) __PYX_ERR(60, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DMShell.pyx":183 * context = (begin, begin_args, begin_kargs) * self.set_attr('__g2l_begin__', context) * cbegin = &DMSHELL_GlobalToLocalBegin # <<<<<<<<<<<<<< * if end is not None: * if end_args is None: end_args = () */ __pyx_v_cbegin = (&__pyx_f_8petsc4py_5PETSc_DMSHELL_GlobalToLocalBegin); /* "petsc4py/PETSc/DMShell.pyx":178 * """ * cdef PetscDMShellXToYFunction cbegin = NULL, cend = NULL * if begin is not None: # <<<<<<<<<<<<<< * if begin_args is None: begin_args = () * if begin_kargs is None: begin_kargs = {} */ } /* "petsc4py/PETSc/DMShell.pyx":184 * self.set_attr('__g2l_begin__', context) * cbegin = &DMSHELL_GlobalToLocalBegin * if end is not None: # <<<<<<<<<<<<<< * if end_args is None: end_args = () * if end_kargs is None: end_kargs = {} */ __pyx_t_1 = (__pyx_v_end != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/DMShell.pyx":185 * cbegin = &DMSHELL_GlobalToLocalBegin * if end is not None: * if end_args is None: end_args = () # <<<<<<<<<<<<<< * if end_kargs is None: end_kargs = {} * context = (end, end_args, end_kargs) */ __pyx_t_1 = (__pyx_v_end_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_end_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/DMShell.pyx":186 * if end is not None: * if end_args is None: end_args = () * if end_kargs is None: end_kargs = {} # <<<<<<<<<<<<<< * context = (end, end_args, end_kargs) * self.set_attr('__g2l_end__', context) */ __pyx_t_1 = (__pyx_v_end_kargs == Py_None); if (__pyx_t_1) { __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(60, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_end_kargs, __pyx_t_2); __pyx_t_2 = 0; } /* "petsc4py/PETSc/DMShell.pyx":187 * if end_args is None: end_args = () * if end_kargs is None: end_kargs = {} * context = (end, end_args, end_kargs) # <<<<<<<<<<<<<< * self.set_attr('__g2l_end__', context) * cend = &DMSHELL_GlobalToLocalEnd */ __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(60, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_end); __Pyx_GIVEREF(__pyx_v_end); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_end)) __PYX_ERR(60, 187, __pyx_L1_error); __Pyx_INCREF(__pyx_v_end_args); __Pyx_GIVEREF(__pyx_v_end_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_end_args)) __PYX_ERR(60, 187, __pyx_L1_error); __Pyx_INCREF(__pyx_v_end_kargs); __Pyx_GIVEREF(__pyx_v_end_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_end_kargs)) __PYX_ERR(60, 187, __pyx_L1_error); __Pyx_XDECREF_SET(__pyx_v_context, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; /* "petsc4py/PETSc/DMShell.pyx":188 * if end_kargs is None: end_kargs = {} * context = (end, end_args, end_kargs) * self.set_attr('__g2l_end__', context) # <<<<<<<<<<<<<< * cend = &DMSHELL_GlobalToLocalEnd * CHKERR( DMShellSetGlobalToLocal(self.dm, cbegin, cend) ) */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DMShell *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__g2l_end__"), __pyx_v_context); if (unlikely(!__pyx_t_2)) __PYX_ERR(60, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DMShell.pyx":189 * context = (end, end_args, end_kargs) * self.set_attr('__g2l_end__', context) * cend = &DMSHELL_GlobalToLocalEnd # <<<<<<<<<<<<<< * CHKERR( DMShellSetGlobalToLocal(self.dm, cbegin, cend) ) * */ __pyx_v_cend = (&__pyx_f_8petsc4py_5PETSc_DMSHELL_GlobalToLocalEnd); /* "petsc4py/PETSc/DMShell.pyx":184 * self.set_attr('__g2l_begin__', context) * cbegin = &DMSHELL_GlobalToLocalBegin * if end is not None: # <<<<<<<<<<<<<< * if end_args is None: end_args = () * if end_kargs is None: end_kargs = {} */ } /* "petsc4py/PETSc/DMShell.pyx":190 * self.set_attr('__g2l_end__', context) * cend = &DMSHELL_GlobalToLocalEnd * CHKERR( DMShellSetGlobalToLocal(self.dm, cbegin, cend) ) # <<<<<<<<<<<<<< * * def setGlobalToLocalVecScatter(self, Scatter gtol) -> None: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMShellSetGlobalToLocal(__pyx_v_self->__pyx_base.dm, __pyx_v_cbegin, __pyx_v_cend)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(60, 190, __pyx_L1_error) /* "petsc4py/PETSc/DMShell.pyx":142 * CHKERR( DMShellSetCreateLocalVector(self.dm, NULL) ) * * def setGlobalToLocal( # <<<<<<<<<<<<<< * self, * begin: Callable[[DM, Vec, InsertMode, Vec], None] | None, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setGlobalToLocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_begin_args); __Pyx_XDECREF(__pyx_v_begin_kargs); __Pyx_XDECREF(__pyx_v_end_args); __Pyx_XDECREF(__pyx_v_end_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMShell.pyx":192 * CHKERR( DMShellSetGlobalToLocal(self.dm, cbegin, cend) ) * * def setGlobalToLocalVecScatter(self, Scatter gtol) -> None: # <<<<<<<<<<<<<< * """Set a `Scatter` context for global to local communication. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_15setGlobalToLocalVecScatter(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMShell_14setGlobalToLocalVecScatter, "DMShell.setGlobalToLocalVecScatter(self, gtol: Scatter) -> None\nSet a `Scatter` context for global to local communication.\n\n Logically collective.\n\n Parameters\n ----------\n gtol\n The global to local `Scatter` context.\n\n See Also\n --------\n petsc.DMShellSetGlobalToLocalVecScatter\n\n \nSource code at petsc4py/PETSc/DMShell.pyx:192"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_15setGlobalToLocalVecScatter(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscScatterObject *__pyx_v_gtol = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setGlobalToLocalVecScatter (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gtol,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gtol)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(60, 192, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setGlobalToLocalVecScatter") < 0)) __PYX_ERR(60, 192, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_gtol = ((struct PyPetscScatterObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setGlobalToLocalVecScatter", 1, 1, 1, __pyx_nargs); __PYX_ERR(60, 192, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setGlobalToLocalVecScatter", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gtol), __pyx_ptype_8petsc4py_5PETSc_Scatter, 0, "gtol", 0))) __PYX_ERR(60, 192, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMShell_14setGlobalToLocalVecScatter(((struct __pyx_obj_8petsc4py_5PETSc_DMShell *)__pyx_v_self), __pyx_v_gtol); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_14setGlobalToLocalVecScatter(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, struct PyPetscScatterObject *__pyx_v_gtol) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setGlobalToLocalVecScatter", 1); /* "petsc4py/PETSc/DMShell.pyx":207 * * """ * CHKERR( DMShellSetGlobalToLocalVecScatter(self.dm, gtol.sct) ) # <<<<<<<<<<<<<< * * def setLocalToGlobal( */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMShellSetGlobalToLocalVecScatter(__pyx_v_self->__pyx_base.dm, __pyx_v_gtol->sct)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(60, 207, __pyx_L1_error) /* "petsc4py/PETSc/DMShell.pyx":192 * CHKERR( DMShellSetGlobalToLocal(self.dm, cbegin, cend) ) * * def setGlobalToLocalVecScatter(self, Scatter gtol) -> None: # <<<<<<<<<<<<<< * """Set a `Scatter` context for global to local communication. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setGlobalToLocalVecScatter", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMShell.pyx":209 * CHKERR( DMShellSetGlobalToLocalVecScatter(self.dm, gtol.sct) ) * * def setLocalToGlobal( # <<<<<<<<<<<<<< * self, * begin: Callable[[DM, Vec, InsertMode, Vec], None] | None, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_17setLocalToGlobal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMShell_16setLocalToGlobal, "DMShell.setLocalToGlobal(self, begin: Callable[[DM, Vec, InsertMode, Vec], None] | None, end: Callable[[DM, Vec, InsertMode, Vec], None] | None, begin_args: tuple[Any, ...] | None = None, begin_kargs: dict[str, Any] | None = None, end_args: tuple[Any, ...] | None = None, end_kargs: dict[str, Any] | None = None) -> None\nSet the routines used to perform a local to global scatter.\n\n Logically collective.\n\n Parameters\n ----------\n begin\n The routine which begins the local to global scatter.\n end\n The routine which ends the local to global scatter.\n begin_args\n Additional positional arguments for ``begin``.\n begin_kargs\n Additional keyword arguments for ``begin``.\n end_args\n Additional positional arguments for ``end``.\n end_kargs\n Additional keyword arguments for ``end``.\n\n See Also\n --------\n petsc.DMShellSetLocalToGlobal\n\n \nSource code at petsc4py/PETSc/DMShell.pyx:209"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_17setLocalToGlobal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_begin = 0; PyObject *__pyx_v_end = 0; PyObject *__pyx_v_begin_args = 0; PyObject *__pyx_v_begin_kargs = 0; PyObject *__pyx_v_end_args = 0; PyObject *__pyx_v_end_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[6] = {0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setLocalToGlobal (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_begin,&__pyx_n_s_end,&__pyx_n_s_begin_args,&__pyx_n_s_begin_kargs,&__pyx_n_s_end_args,&__pyx_n_s_end_kargs,0}; /* "petsc4py/PETSc/DMShell.pyx":213 * begin: Callable[[DM, Vec, InsertMode, Vec], None] | None, * end: Callable[[DM, Vec, InsertMode, Vec], None] | None, * begin_args: tuple[Any, ...] | None = None, # <<<<<<<<<<<<<< * begin_kargs: dict[str, Any] | None = None, * end_args: tuple[Any, ...] | None = None, */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/DMShell.pyx":214 * end: Callable[[DM, Vec, InsertMode, Vec], None] | None, * begin_args: tuple[Any, ...] | None = None, * begin_kargs: dict[str, Any] | None = None, # <<<<<<<<<<<<<< * end_args: tuple[Any, ...] | None = None, * end_kargs: dict[str, Any] | None = None, */ values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/DMShell.pyx":215 * begin_args: tuple[Any, ...] | None = None, * begin_kargs: dict[str, Any] | None = None, * end_args: tuple[Any, ...] | None = None, # <<<<<<<<<<<<<< * end_kargs: dict[str, Any] | None = None, * ) -> None: */ values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/DMShell.pyx":216 * begin_kargs: dict[str, Any] | None = None, * end_args: tuple[Any, ...] | None = None, * end_kargs: dict[str, Any] | None = None, # <<<<<<<<<<<<<< * ) -> None: * """Set the routines used to perform a local to global scatter. */ values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_begin)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(60, 209, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_end)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(60, 209, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setLocalToGlobal", 0, 2, 6, 1); __PYX_ERR(60, 209, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_begin_args); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(60, 209, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_begin_kargs); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(60, 209, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_end_args); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(60, 209, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_end_kargs); if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(60, 209, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setLocalToGlobal") < 0)) __PYX_ERR(60, 209, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_begin = values[0]; __pyx_v_end = values[1]; __pyx_v_begin_args = values[2]; __pyx_v_begin_kargs = values[3]; __pyx_v_end_args = values[4]; __pyx_v_end_kargs = values[5]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setLocalToGlobal", 0, 2, 6, __pyx_nargs); __PYX_ERR(60, 209, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setLocalToGlobal", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMShell_16setLocalToGlobal(((struct __pyx_obj_8petsc4py_5PETSc_DMShell *)__pyx_v_self), __pyx_v_begin, __pyx_v_end, __pyx_v_begin_args, __pyx_v_begin_kargs, __pyx_v_end_args, __pyx_v_end_kargs); /* "petsc4py/PETSc/DMShell.pyx":209 * CHKERR( DMShellSetGlobalToLocalVecScatter(self.dm, gtol.sct) ) * * def setLocalToGlobal( # <<<<<<<<<<<<<< * self, * begin: Callable[[DM, Vec, InsertMode, Vec], None] | None, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_16setLocalToGlobal(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_begin, PyObject *__pyx_v_end, PyObject *__pyx_v_begin_args, PyObject *__pyx_v_begin_kargs, PyObject *__pyx_v_end_args, PyObject *__pyx_v_end_kargs) { __pyx_t_8petsc4py_5PETSc_PetscDMShellXToYFunction __pyx_v_cbegin; __pyx_t_8petsc4py_5PETSc_PetscDMShellXToYFunction __pyx_v_cend; PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setLocalToGlobal", 0); __Pyx_INCREF(__pyx_v_begin_args); __Pyx_INCREF(__pyx_v_begin_kargs); __Pyx_INCREF(__pyx_v_end_args); __Pyx_INCREF(__pyx_v_end_kargs); /* "petsc4py/PETSc/DMShell.pyx":242 * * """ * cdef PetscDMShellXToYFunction cbegin = NULL, cend = NULL # <<<<<<<<<<<<<< * if begin is not None: * if begin_args is None: begin_args = () */ __pyx_v_cbegin = NULL; __pyx_v_cend = NULL; /* "petsc4py/PETSc/DMShell.pyx":243 * """ * cdef PetscDMShellXToYFunction cbegin = NULL, cend = NULL * if begin is not None: # <<<<<<<<<<<<<< * if begin_args is None: begin_args = () * if begin_kargs is None: begin_kargs = {} */ __pyx_t_1 = (__pyx_v_begin != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/DMShell.pyx":244 * cdef PetscDMShellXToYFunction cbegin = NULL, cend = NULL * if begin is not None: * if begin_args is None: begin_args = () # <<<<<<<<<<<<<< * if begin_kargs is None: begin_kargs = {} * context = (begin, begin_args, begin_kargs) */ __pyx_t_1 = (__pyx_v_begin_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_begin_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/DMShell.pyx":245 * if begin is not None: * if begin_args is None: begin_args = () * if begin_kargs is None: begin_kargs = {} # <<<<<<<<<<<<<< * context = (begin, begin_args, begin_kargs) * self.set_attr('__l2g_begin__', context) */ __pyx_t_1 = (__pyx_v_begin_kargs == Py_None); if (__pyx_t_1) { __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(60, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_begin_kargs, __pyx_t_2); __pyx_t_2 = 0; } /* "petsc4py/PETSc/DMShell.pyx":246 * if begin_args is None: begin_args = () * if begin_kargs is None: begin_kargs = {} * context = (begin, begin_args, begin_kargs) # <<<<<<<<<<<<<< * self.set_attr('__l2g_begin__', context) * cbegin = &DMSHELL_LocalToGlobalBegin */ __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(60, 246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_begin); __Pyx_GIVEREF(__pyx_v_begin); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_begin)) __PYX_ERR(60, 246, __pyx_L1_error); __Pyx_INCREF(__pyx_v_begin_args); __Pyx_GIVEREF(__pyx_v_begin_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_begin_args)) __PYX_ERR(60, 246, __pyx_L1_error); __Pyx_INCREF(__pyx_v_begin_kargs); __Pyx_GIVEREF(__pyx_v_begin_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_begin_kargs)) __PYX_ERR(60, 246, __pyx_L1_error); __pyx_v_context = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DMShell.pyx":247 * if begin_kargs is None: begin_kargs = {} * context = (begin, begin_args, begin_kargs) * self.set_attr('__l2g_begin__', context) # <<<<<<<<<<<<<< * cbegin = &DMSHELL_LocalToGlobalBegin * if end is not None: */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DMShell *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__l2g_begin__"), __pyx_v_context); if (unlikely(!__pyx_t_2)) __PYX_ERR(60, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DMShell.pyx":248 * context = (begin, begin_args, begin_kargs) * self.set_attr('__l2g_begin__', context) * cbegin = &DMSHELL_LocalToGlobalBegin # <<<<<<<<<<<<<< * if end is not None: * if end_args is None: end_args = () */ __pyx_v_cbegin = (&__pyx_f_8petsc4py_5PETSc_DMSHELL_LocalToGlobalBegin); /* "petsc4py/PETSc/DMShell.pyx":243 * """ * cdef PetscDMShellXToYFunction cbegin = NULL, cend = NULL * if begin is not None: # <<<<<<<<<<<<<< * if begin_args is None: begin_args = () * if begin_kargs is None: begin_kargs = {} */ } /* "petsc4py/PETSc/DMShell.pyx":249 * self.set_attr('__l2g_begin__', context) * cbegin = &DMSHELL_LocalToGlobalBegin * if end is not None: # <<<<<<<<<<<<<< * if end_args is None: end_args = () * if end_kargs is None: end_kargs = {} */ __pyx_t_1 = (__pyx_v_end != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/DMShell.pyx":250 * cbegin = &DMSHELL_LocalToGlobalBegin * if end is not None: * if end_args is None: end_args = () # <<<<<<<<<<<<<< * if end_kargs is None: end_kargs = {} * context = (end, end_args, end_kargs) */ __pyx_t_1 = (__pyx_v_end_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_end_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/DMShell.pyx":251 * if end is not None: * if end_args is None: end_args = () * if end_kargs is None: end_kargs = {} # <<<<<<<<<<<<<< * context = (end, end_args, end_kargs) * self.set_attr('__l2g_end__', context) */ __pyx_t_1 = (__pyx_v_end_kargs == Py_None); if (__pyx_t_1) { __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(60, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_end_kargs, __pyx_t_2); __pyx_t_2 = 0; } /* "petsc4py/PETSc/DMShell.pyx":252 * if end_args is None: end_args = () * if end_kargs is None: end_kargs = {} * context = (end, end_args, end_kargs) # <<<<<<<<<<<<<< * self.set_attr('__l2g_end__', context) * cend = &DMSHELL_LocalToGlobalEnd */ __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(60, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_end); __Pyx_GIVEREF(__pyx_v_end); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_end)) __PYX_ERR(60, 252, __pyx_L1_error); __Pyx_INCREF(__pyx_v_end_args); __Pyx_GIVEREF(__pyx_v_end_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_end_args)) __PYX_ERR(60, 252, __pyx_L1_error); __Pyx_INCREF(__pyx_v_end_kargs); __Pyx_GIVEREF(__pyx_v_end_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_end_kargs)) __PYX_ERR(60, 252, __pyx_L1_error); __Pyx_XDECREF_SET(__pyx_v_context, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; /* "petsc4py/PETSc/DMShell.pyx":253 * if end_kargs is None: end_kargs = {} * context = (end, end_args, end_kargs) * self.set_attr('__l2g_end__', context) # <<<<<<<<<<<<<< * cend = &DMSHELL_LocalToGlobalEnd * CHKERR( DMShellSetLocalToGlobal(self.dm, cbegin, cend) ) */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DMShell *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__l2g_end__"), __pyx_v_context); if (unlikely(!__pyx_t_2)) __PYX_ERR(60, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DMShell.pyx":254 * context = (end, end_args, end_kargs) * self.set_attr('__l2g_end__', context) * cend = &DMSHELL_LocalToGlobalEnd # <<<<<<<<<<<<<< * CHKERR( DMShellSetLocalToGlobal(self.dm, cbegin, cend) ) * */ __pyx_v_cend = (&__pyx_f_8petsc4py_5PETSc_DMSHELL_LocalToGlobalEnd); /* "petsc4py/PETSc/DMShell.pyx":249 * self.set_attr('__l2g_begin__', context) * cbegin = &DMSHELL_LocalToGlobalBegin * if end is not None: # <<<<<<<<<<<<<< * if end_args is None: end_args = () * if end_kargs is None: end_kargs = {} */ } /* "petsc4py/PETSc/DMShell.pyx":255 * self.set_attr('__l2g_end__', context) * cend = &DMSHELL_LocalToGlobalEnd * CHKERR( DMShellSetLocalToGlobal(self.dm, cbegin, cend) ) # <<<<<<<<<<<<<< * * def setLocalToGlobalVecScatter(self, Scatter ltog) -> None: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMShellSetLocalToGlobal(__pyx_v_self->__pyx_base.dm, __pyx_v_cbegin, __pyx_v_cend)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(60, 255, __pyx_L1_error) /* "petsc4py/PETSc/DMShell.pyx":209 * CHKERR( DMShellSetGlobalToLocalVecScatter(self.dm, gtol.sct) ) * * def setLocalToGlobal( # <<<<<<<<<<<<<< * self, * begin: Callable[[DM, Vec, InsertMode, Vec], None] | None, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setLocalToGlobal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_begin_args); __Pyx_XDECREF(__pyx_v_begin_kargs); __Pyx_XDECREF(__pyx_v_end_args); __Pyx_XDECREF(__pyx_v_end_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMShell.pyx":257 * CHKERR( DMShellSetLocalToGlobal(self.dm, cbegin, cend) ) * * def setLocalToGlobalVecScatter(self, Scatter ltog) -> None: # <<<<<<<<<<<<<< * """Set a `Scatter` context for local to global communication. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_19setLocalToGlobalVecScatter(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMShell_18setLocalToGlobalVecScatter, "DMShell.setLocalToGlobalVecScatter(self, ltog: Scatter) -> None\nSet a `Scatter` context for local to global communication.\n\n Logically collective.\n\n Parameters\n ----------\n ltog\n The local to global `Scatter` context.\n\n See Also\n --------\n petsc.DMShellSetLocalToGlobalVecScatter\n\n \nSource code at petsc4py/PETSc/DMShell.pyx:257"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_19setLocalToGlobalVecScatter(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscScatterObject *__pyx_v_ltog = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setLocalToGlobalVecScatter (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ltog,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ltog)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(60, 257, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setLocalToGlobalVecScatter") < 0)) __PYX_ERR(60, 257, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_ltog = ((struct PyPetscScatterObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setLocalToGlobalVecScatter", 1, 1, 1, __pyx_nargs); __PYX_ERR(60, 257, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setLocalToGlobalVecScatter", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ltog), __pyx_ptype_8petsc4py_5PETSc_Scatter, 0, "ltog", 0))) __PYX_ERR(60, 257, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMShell_18setLocalToGlobalVecScatter(((struct __pyx_obj_8petsc4py_5PETSc_DMShell *)__pyx_v_self), __pyx_v_ltog); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_18setLocalToGlobalVecScatter(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, struct PyPetscScatterObject *__pyx_v_ltog) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setLocalToGlobalVecScatter", 1); /* "petsc4py/PETSc/DMShell.pyx":272 * * """ * CHKERR( DMShellSetLocalToGlobalVecScatter(self.dm, ltog.sct) ) # <<<<<<<<<<<<<< * * def setLocalToLocal( */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMShellSetLocalToGlobalVecScatter(__pyx_v_self->__pyx_base.dm, __pyx_v_ltog->sct)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(60, 272, __pyx_L1_error) /* "petsc4py/PETSc/DMShell.pyx":257 * CHKERR( DMShellSetLocalToGlobal(self.dm, cbegin, cend) ) * * def setLocalToGlobalVecScatter(self, Scatter ltog) -> None: # <<<<<<<<<<<<<< * """Set a `Scatter` context for local to global communication. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setLocalToGlobalVecScatter", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMShell.pyx":274 * CHKERR( DMShellSetLocalToGlobalVecScatter(self.dm, ltog.sct) ) * * def setLocalToLocal( # <<<<<<<<<<<<<< * self, * begin: Callable[[DM, Vec, InsertMode, Vec], None] | None, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_21setLocalToLocal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMShell_20setLocalToLocal, "DMShell.setLocalToLocal(self, begin: Callable[[DM, Vec, InsertMode, Vec], None] | None, end: Callable[[DM, Vec, InsertMode, Vec], None] | None, begin_args: tuple[Any, ...] | None = None, begin_kargs: dict[str, Any] | None = None, end_args: tuple[Any, ...] | None = None, end_kargs: dict[str, Any] | None = None) -> None\nSet the routines used to perform a local to local scatter.\n\n Logically collective.\n\n Parameters\n ----------\n begin\n The routine which begins the local to local scatter.\n end\n The routine which ends the local to local scatter.\n begin_args\n Additional positional arguments for ``begin``.\n begin_kargs\n Additional keyword arguments for ``begin``.\n end_args\n Additional positional arguments for ``end``.\n end_kargs\n Additional keyword arguments for ``end``.\n\n See Also\n --------\n petsc.DMShellSetLocalToLocal\n\n \nSource code at petsc4py/PETSc/DMShell.pyx:274"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_21setLocalToLocal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_begin = 0; PyObject *__pyx_v_end = 0; PyObject *__pyx_v_begin_args = 0; PyObject *__pyx_v_begin_kargs = 0; PyObject *__pyx_v_end_args = 0; PyObject *__pyx_v_end_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[6] = {0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setLocalToLocal (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_begin,&__pyx_n_s_end,&__pyx_n_s_begin_args,&__pyx_n_s_begin_kargs,&__pyx_n_s_end_args,&__pyx_n_s_end_kargs,0}; /* "petsc4py/PETSc/DMShell.pyx":278 * begin: Callable[[DM, Vec, InsertMode, Vec], None] | None, * end: Callable[[DM, Vec, InsertMode, Vec], None] | None, * begin_args: tuple[Any, ...] | None = None, # <<<<<<<<<<<<<< * begin_kargs: dict[str, Any] | None = None, * end_args: tuple[Any, ...] | None = None, */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/DMShell.pyx":279 * end: Callable[[DM, Vec, InsertMode, Vec], None] | None, * begin_args: tuple[Any, ...] | None = None, * begin_kargs: dict[str, Any] | None = None, # <<<<<<<<<<<<<< * end_args: tuple[Any, ...] | None = None, * end_kargs: dict[str, Any] | None = None, */ values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/DMShell.pyx":280 * begin_args: tuple[Any, ...] | None = None, * begin_kargs: dict[str, Any] | None = None, * end_args: tuple[Any, ...] | None = None, # <<<<<<<<<<<<<< * end_kargs: dict[str, Any] | None = None, * ) -> None: */ values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/DMShell.pyx":281 * begin_kargs: dict[str, Any] | None = None, * end_args: tuple[Any, ...] | None = None, * end_kargs: dict[str, Any] | None = None, # <<<<<<<<<<<<<< * ) -> None: * """Set the routines used to perform a local to local scatter. */ values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_begin)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(60, 274, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_end)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(60, 274, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setLocalToLocal", 0, 2, 6, 1); __PYX_ERR(60, 274, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_begin_args); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(60, 274, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_begin_kargs); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(60, 274, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_end_args); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(60, 274, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_end_kargs); if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(60, 274, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setLocalToLocal") < 0)) __PYX_ERR(60, 274, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_begin = values[0]; __pyx_v_end = values[1]; __pyx_v_begin_args = values[2]; __pyx_v_begin_kargs = values[3]; __pyx_v_end_args = values[4]; __pyx_v_end_kargs = values[5]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setLocalToLocal", 0, 2, 6, __pyx_nargs); __PYX_ERR(60, 274, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setLocalToLocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMShell_20setLocalToLocal(((struct __pyx_obj_8petsc4py_5PETSc_DMShell *)__pyx_v_self), __pyx_v_begin, __pyx_v_end, __pyx_v_begin_args, __pyx_v_begin_kargs, __pyx_v_end_args, __pyx_v_end_kargs); /* "petsc4py/PETSc/DMShell.pyx":274 * CHKERR( DMShellSetLocalToGlobalVecScatter(self.dm, ltog.sct) ) * * def setLocalToLocal( # <<<<<<<<<<<<<< * self, * begin: Callable[[DM, Vec, InsertMode, Vec], None] | None, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_20setLocalToLocal(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_begin, PyObject *__pyx_v_end, PyObject *__pyx_v_begin_args, PyObject *__pyx_v_begin_kargs, PyObject *__pyx_v_end_args, PyObject *__pyx_v_end_kargs) { __pyx_t_8petsc4py_5PETSc_PetscDMShellXToYFunction __pyx_v_cbegin; __pyx_t_8petsc4py_5PETSc_PetscDMShellXToYFunction __pyx_v_cend; PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setLocalToLocal", 0); __Pyx_INCREF(__pyx_v_begin_args); __Pyx_INCREF(__pyx_v_begin_kargs); __Pyx_INCREF(__pyx_v_end_args); __Pyx_INCREF(__pyx_v_end_kargs); /* "petsc4py/PETSc/DMShell.pyx":307 * * """ * cdef PetscDMShellXToYFunction cbegin = NULL, cend = NULL # <<<<<<<<<<<<<< * cbegin = NULL * cend = NULL */ __pyx_v_cbegin = NULL; __pyx_v_cend = NULL; /* "petsc4py/PETSc/DMShell.pyx":308 * """ * cdef PetscDMShellXToYFunction cbegin = NULL, cend = NULL * cbegin = NULL # <<<<<<<<<<<<<< * cend = NULL * if begin is not None: */ __pyx_v_cbegin = NULL; /* "petsc4py/PETSc/DMShell.pyx":309 * cdef PetscDMShellXToYFunction cbegin = NULL, cend = NULL * cbegin = NULL * cend = NULL # <<<<<<<<<<<<<< * if begin is not None: * if begin_args is None: begin_args = () */ __pyx_v_cend = NULL; /* "petsc4py/PETSc/DMShell.pyx":310 * cbegin = NULL * cend = NULL * if begin is not None: # <<<<<<<<<<<<<< * if begin_args is None: begin_args = () * if begin_kargs is None: begin_kargs = {} */ __pyx_t_1 = (__pyx_v_begin != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/DMShell.pyx":311 * cend = NULL * if begin is not None: * if begin_args is None: begin_args = () # <<<<<<<<<<<<<< * if begin_kargs is None: begin_kargs = {} * context = (begin, begin_args, begin_kargs) */ __pyx_t_1 = (__pyx_v_begin_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_begin_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/DMShell.pyx":312 * if begin is not None: * if begin_args is None: begin_args = () * if begin_kargs is None: begin_kargs = {} # <<<<<<<<<<<<<< * context = (begin, begin_args, begin_kargs) * self.set_attr('__l2l_begin__', context) */ __pyx_t_1 = (__pyx_v_begin_kargs == Py_None); if (__pyx_t_1) { __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(60, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_begin_kargs, __pyx_t_2); __pyx_t_2 = 0; } /* "petsc4py/PETSc/DMShell.pyx":313 * if begin_args is None: begin_args = () * if begin_kargs is None: begin_kargs = {} * context = (begin, begin_args, begin_kargs) # <<<<<<<<<<<<<< * self.set_attr('__l2l_begin__', context) * cbegin = &DMSHELL_LocalToLocalBegin */ __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(60, 313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_begin); __Pyx_GIVEREF(__pyx_v_begin); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_begin)) __PYX_ERR(60, 313, __pyx_L1_error); __Pyx_INCREF(__pyx_v_begin_args); __Pyx_GIVEREF(__pyx_v_begin_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_begin_args)) __PYX_ERR(60, 313, __pyx_L1_error); __Pyx_INCREF(__pyx_v_begin_kargs); __Pyx_GIVEREF(__pyx_v_begin_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_begin_kargs)) __PYX_ERR(60, 313, __pyx_L1_error); __pyx_v_context = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DMShell.pyx":314 * if begin_kargs is None: begin_kargs = {} * context = (begin, begin_args, begin_kargs) * self.set_attr('__l2l_begin__', context) # <<<<<<<<<<<<<< * cbegin = &DMSHELL_LocalToLocalBegin * if end is not None: */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DMShell *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__l2l_begin__"), __pyx_v_context); if (unlikely(!__pyx_t_2)) __PYX_ERR(60, 314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DMShell.pyx":315 * context = (begin, begin_args, begin_kargs) * self.set_attr('__l2l_begin__', context) * cbegin = &DMSHELL_LocalToLocalBegin # <<<<<<<<<<<<<< * if end is not None: * if end_args is None: end_args = () */ __pyx_v_cbegin = (&__pyx_f_8petsc4py_5PETSc_DMSHELL_LocalToLocalBegin); /* "petsc4py/PETSc/DMShell.pyx":310 * cbegin = NULL * cend = NULL * if begin is not None: # <<<<<<<<<<<<<< * if begin_args is None: begin_args = () * if begin_kargs is None: begin_kargs = {} */ } /* "petsc4py/PETSc/DMShell.pyx":316 * self.set_attr('__l2l_begin__', context) * cbegin = &DMSHELL_LocalToLocalBegin * if end is not None: # <<<<<<<<<<<<<< * if end_args is None: end_args = () * if end_kargs is None: end_kargs = {} */ __pyx_t_1 = (__pyx_v_end != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/DMShell.pyx":317 * cbegin = &DMSHELL_LocalToLocalBegin * if end is not None: * if end_args is None: end_args = () # <<<<<<<<<<<<<< * if end_kargs is None: end_kargs = {} * context = (end, end_args, end_kargs) */ __pyx_t_1 = (__pyx_v_end_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_end_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/DMShell.pyx":318 * if end is not None: * if end_args is None: end_args = () * if end_kargs is None: end_kargs = {} # <<<<<<<<<<<<<< * context = (end, end_args, end_kargs) * self.set_attr('__l2l_end__', context) */ __pyx_t_1 = (__pyx_v_end_kargs == Py_None); if (__pyx_t_1) { __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(60, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_end_kargs, __pyx_t_2); __pyx_t_2 = 0; } /* "petsc4py/PETSc/DMShell.pyx":319 * if end_args is None: end_args = () * if end_kargs is None: end_kargs = {} * context = (end, end_args, end_kargs) # <<<<<<<<<<<<<< * self.set_attr('__l2l_end__', context) * cend = &DMSHELL_LocalToLocalEnd */ __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(60, 319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_end); __Pyx_GIVEREF(__pyx_v_end); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_end)) __PYX_ERR(60, 319, __pyx_L1_error); __Pyx_INCREF(__pyx_v_end_args); __Pyx_GIVEREF(__pyx_v_end_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_end_args)) __PYX_ERR(60, 319, __pyx_L1_error); __Pyx_INCREF(__pyx_v_end_kargs); __Pyx_GIVEREF(__pyx_v_end_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_end_kargs)) __PYX_ERR(60, 319, __pyx_L1_error); __Pyx_XDECREF_SET(__pyx_v_context, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; /* "petsc4py/PETSc/DMShell.pyx":320 * if end_kargs is None: end_kargs = {} * context = (end, end_args, end_kargs) * self.set_attr('__l2l_end__', context) # <<<<<<<<<<<<<< * cend = &DMSHELL_LocalToLocalEnd * CHKERR( DMShellSetLocalToLocal(self.dm, cbegin, cend) ) */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DMShell *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__l2l_end__"), __pyx_v_context); if (unlikely(!__pyx_t_2)) __PYX_ERR(60, 320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DMShell.pyx":321 * context = (end, end_args, end_kargs) * self.set_attr('__l2l_end__', context) * cend = &DMSHELL_LocalToLocalEnd # <<<<<<<<<<<<<< * CHKERR( DMShellSetLocalToLocal(self.dm, cbegin, cend) ) * */ __pyx_v_cend = (&__pyx_f_8petsc4py_5PETSc_DMSHELL_LocalToLocalEnd); /* "petsc4py/PETSc/DMShell.pyx":316 * self.set_attr('__l2l_begin__', context) * cbegin = &DMSHELL_LocalToLocalBegin * if end is not None: # <<<<<<<<<<<<<< * if end_args is None: end_args = () * if end_kargs is None: end_kargs = {} */ } /* "petsc4py/PETSc/DMShell.pyx":322 * self.set_attr('__l2l_end__', context) * cend = &DMSHELL_LocalToLocalEnd * CHKERR( DMShellSetLocalToLocal(self.dm, cbegin, cend) ) # <<<<<<<<<<<<<< * * def setLocalToLocalVecScatter(self, Scatter ltol) -> None: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMShellSetLocalToLocal(__pyx_v_self->__pyx_base.dm, __pyx_v_cbegin, __pyx_v_cend)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(60, 322, __pyx_L1_error) /* "petsc4py/PETSc/DMShell.pyx":274 * CHKERR( DMShellSetLocalToGlobalVecScatter(self.dm, ltog.sct) ) * * def setLocalToLocal( # <<<<<<<<<<<<<< * self, * begin: Callable[[DM, Vec, InsertMode, Vec], None] | None, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setLocalToLocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_begin_args); __Pyx_XDECREF(__pyx_v_begin_kargs); __Pyx_XDECREF(__pyx_v_end_args); __Pyx_XDECREF(__pyx_v_end_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMShell.pyx":324 * CHKERR( DMShellSetLocalToLocal(self.dm, cbegin, cend) ) * * def setLocalToLocalVecScatter(self, Scatter ltol) -> None: # <<<<<<<<<<<<<< * """Set a ``Scatter`` context for local to local communication. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_23setLocalToLocalVecScatter(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMShell_22setLocalToLocalVecScatter, "DMShell.setLocalToLocalVecScatter(self, ltol: Scatter) -> None\nSet a ``Scatter`` context for local to local communication.\n\n Logically collective.\n\n Parameters\n ----------\n ltol\n The local to local ``Scatter`` context.\n\n See Also\n --------\n petsc.DMShellSetLocalToLocalVecScatter\n\n \nSource code at petsc4py/PETSc/DMShell.pyx:324"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_23setLocalToLocalVecScatter(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscScatterObject *__pyx_v_ltol = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setLocalToLocalVecScatter (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ltol,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ltol)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(60, 324, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setLocalToLocalVecScatter") < 0)) __PYX_ERR(60, 324, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_ltol = ((struct PyPetscScatterObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setLocalToLocalVecScatter", 1, 1, 1, __pyx_nargs); __PYX_ERR(60, 324, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setLocalToLocalVecScatter", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ltol), __pyx_ptype_8petsc4py_5PETSc_Scatter, 0, "ltol", 0))) __PYX_ERR(60, 324, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMShell_22setLocalToLocalVecScatter(((struct __pyx_obj_8petsc4py_5PETSc_DMShell *)__pyx_v_self), __pyx_v_ltol); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_22setLocalToLocalVecScatter(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, struct PyPetscScatterObject *__pyx_v_ltol) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setLocalToLocalVecScatter", 1); /* "petsc4py/PETSc/DMShell.pyx":339 * * """ * CHKERR( DMShellSetLocalToLocalVecScatter(self.dm, ltol.sct) ) # <<<<<<<<<<<<<< * * def setCreateMatrix( */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMShellSetLocalToLocalVecScatter(__pyx_v_self->__pyx_base.dm, __pyx_v_ltol->sct)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(60, 339, __pyx_L1_error) /* "petsc4py/PETSc/DMShell.pyx":324 * CHKERR( DMShellSetLocalToLocal(self.dm, cbegin, cend) ) * * def setLocalToLocalVecScatter(self, Scatter ltol) -> None: # <<<<<<<<<<<<<< * """Set a ``Scatter`` context for local to local communication. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setLocalToLocalVecScatter", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMShell.pyx":341 * CHKERR( DMShellSetLocalToLocalVecScatter(self.dm, ltol.sct) ) * * def setCreateMatrix( # <<<<<<<<<<<<<< * self, * create_matrix: Callable[[DM], Mat] | None, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_25setCreateMatrix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMShell_24setCreateMatrix, "DMShell.setCreateMatrix(self, create_matrix: Callable[[DM], Mat] | None, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nSet the routine to create a matrix.\n\n Logically collective.\n\n Parameters\n ----------\n create_matrix\n The function to create a matrix.\n args\n Additional positional arguments for ``create_matrix``.\n kargs\n Additional keyword arguments for ``create_matrix``.\n\n See Also\n --------\n petsc.DMShellSetCreateMatrix\n\n \nSource code at petsc4py/PETSc/DMShell.pyx:341"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_25setCreateMatrix(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_create_matrix = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setCreateMatrix (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_create_matrix,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; /* "petsc4py/PETSc/DMShell.pyx":344 * self, * create_matrix: Callable[[DM], Mat] | None, * args: tuple[Any, ...] | None = None, # <<<<<<<<<<<<<< * kargs: dict[str, Any] | None = None, * ) -> None: */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/DMShell.pyx":345 * create_matrix: Callable[[DM], Mat] | None, * args: tuple[Any, ...] | None = None, * kargs: dict[str, Any] | None = None, # <<<<<<<<<<<<<< * ) -> None: * """Set the routine to create a matrix. */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_create_matrix)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(60, 341, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(60, 341, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(60, 341, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setCreateMatrix") < 0)) __PYX_ERR(60, 341, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_create_matrix = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setCreateMatrix", 0, 1, 3, __pyx_nargs); __PYX_ERR(60, 341, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setCreateMatrix", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMShell_24setCreateMatrix(((struct __pyx_obj_8petsc4py_5PETSc_DMShell *)__pyx_v_self), __pyx_v_create_matrix, __pyx_v_args, __pyx_v_kargs); /* "petsc4py/PETSc/DMShell.pyx":341 * CHKERR( DMShellSetLocalToLocalVecScatter(self.dm, ltol.sct) ) * * def setCreateMatrix( # <<<<<<<<<<<<<< * self, * create_matrix: Callable[[DM], Mat] | None, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_24setCreateMatrix(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_create_matrix, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setCreateMatrix", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/DMShell.pyx":365 * * """ * if create_matrix is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = (__pyx_v_create_matrix != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/DMShell.pyx":366 * """ * if create_matrix is not None: * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (create_matrix, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/DMShell.pyx":367 * if create_matrix is not None: * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (create_matrix, args, kargs) * self.set_attr('__create_matrix__', context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); if (__pyx_t_1) { __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(60, 367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_2); __pyx_t_2 = 0; } /* "petsc4py/PETSc/DMShell.pyx":368 * if args is None: args = () * if kargs is None: kargs = {} * context = (create_matrix, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__create_matrix__', context) * CHKERR( DMShellSetCreateMatrix(self.dm, DMSHELL_CreateMatrix) ) */ __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(60, 368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_create_matrix); __Pyx_GIVEREF(__pyx_v_create_matrix); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_create_matrix)) __PYX_ERR(60, 368, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_args)) __PYX_ERR(60, 368, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_kargs)) __PYX_ERR(60, 368, __pyx_L1_error); __pyx_v_context = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DMShell.pyx":369 * if kargs is None: kargs = {} * context = (create_matrix, args, kargs) * self.set_attr('__create_matrix__', context) # <<<<<<<<<<<<<< * CHKERR( DMShellSetCreateMatrix(self.dm, DMSHELL_CreateMatrix) ) * else: */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DMShell *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__create_matrix__"), __pyx_v_context); if (unlikely(!__pyx_t_2)) __PYX_ERR(60, 369, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DMShell.pyx":370 * context = (create_matrix, args, kargs) * self.set_attr('__create_matrix__', context) * CHKERR( DMShellSetCreateMatrix(self.dm, DMSHELL_CreateMatrix) ) # <<<<<<<<<<<<<< * else: * CHKERR( DMShellSetCreateMatrix(self.dm, NULL) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMShellSetCreateMatrix(__pyx_v_self->__pyx_base.dm, __pyx_f_8petsc4py_5PETSc_DMSHELL_CreateMatrix)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(60, 370, __pyx_L1_error) /* "petsc4py/PETSc/DMShell.pyx":365 * * """ * if create_matrix is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ goto __pyx_L3; } /* "petsc4py/PETSc/DMShell.pyx":372 * CHKERR( DMShellSetCreateMatrix(self.dm, DMSHELL_CreateMatrix) ) * else: * CHKERR( DMShellSetCreateMatrix(self.dm, NULL) ) # <<<<<<<<<<<<<< * * def setCoarsen( */ /*else*/ { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMShellSetCreateMatrix(__pyx_v_self->__pyx_base.dm, NULL)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(60, 372, __pyx_L1_error) } __pyx_L3:; /* "petsc4py/PETSc/DMShell.pyx":341 * CHKERR( DMShellSetLocalToLocalVecScatter(self.dm, ltol.sct) ) * * def setCreateMatrix( # <<<<<<<<<<<<<< * self, * create_matrix: Callable[[DM], Mat] | None, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setCreateMatrix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMShell.pyx":374 * CHKERR( DMShellSetCreateMatrix(self.dm, NULL) ) * * def setCoarsen( # <<<<<<<<<<<<<< * self, * coarsen: Callable[[DM, Comm], DM] | None, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_27setCoarsen(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMShell_26setCoarsen, "DMShell.setCoarsen(self, coarsen: Callable[[DM, Comm], DM] | None, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nSet the routine used to coarsen the `DMShell`.\n\n Logically collective.\n\n Parameters\n ----------\n coarsen\n The routine which coarsens the DM.\n args\n Additional positional arguments for ``coarsen``.\n kargs\n Additional keyword arguments for ``coarsen``.\n\n See Also\n --------\n setRefine, petsc.DMShellSetCoarsen\n\n \nSource code at petsc4py/PETSc/DMShell.pyx:374"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_27setCoarsen(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_coarsen = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setCoarsen (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_coarsen,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; /* "petsc4py/PETSc/DMShell.pyx":377 * self, * coarsen: Callable[[DM, Comm], DM] | None, * args: tuple[Any, ...] | None = None, # <<<<<<<<<<<<<< * kargs: dict[str, Any] | None = None, * ) -> None: */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/DMShell.pyx":378 * coarsen: Callable[[DM, Comm], DM] | None, * args: tuple[Any, ...] | None = None, * kargs: dict[str, Any] | None = None, # <<<<<<<<<<<<<< * ) -> None: * """Set the routine used to coarsen the `DMShell`. */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_coarsen)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(60, 374, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(60, 374, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(60, 374, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setCoarsen") < 0)) __PYX_ERR(60, 374, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_coarsen = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setCoarsen", 0, 1, 3, __pyx_nargs); __PYX_ERR(60, 374, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setCoarsen", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMShell_26setCoarsen(((struct __pyx_obj_8petsc4py_5PETSc_DMShell *)__pyx_v_self), __pyx_v_coarsen, __pyx_v_args, __pyx_v_kargs); /* "petsc4py/PETSc/DMShell.pyx":374 * CHKERR( DMShellSetCreateMatrix(self.dm, NULL) ) * * def setCoarsen( # <<<<<<<<<<<<<< * self, * coarsen: Callable[[DM, Comm], DM] | None, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_26setCoarsen(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_coarsen, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setCoarsen", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/DMShell.pyx":398 * * """ * if coarsen is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = (__pyx_v_coarsen != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/DMShell.pyx":399 * """ * if coarsen is not None: * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (coarsen, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/DMShell.pyx":400 * if coarsen is not None: * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (coarsen, args, kargs) * self.set_attr('__coarsen__', context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); if (__pyx_t_1) { __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(60, 400, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_2); __pyx_t_2 = 0; } /* "petsc4py/PETSc/DMShell.pyx":401 * if args is None: args = () * if kargs is None: kargs = {} * context = (coarsen, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__coarsen__', context) * CHKERR( DMShellSetCoarsen(self.dm, DMSHELL_Coarsen) ) */ __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(60, 401, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_coarsen); __Pyx_GIVEREF(__pyx_v_coarsen); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_coarsen)) __PYX_ERR(60, 401, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_args)) __PYX_ERR(60, 401, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_kargs)) __PYX_ERR(60, 401, __pyx_L1_error); __pyx_v_context = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DMShell.pyx":402 * if kargs is None: kargs = {} * context = (coarsen, args, kargs) * self.set_attr('__coarsen__', context) # <<<<<<<<<<<<<< * CHKERR( DMShellSetCoarsen(self.dm, DMSHELL_Coarsen) ) * else: */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DMShell *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__coarsen__"), __pyx_v_context); if (unlikely(!__pyx_t_2)) __PYX_ERR(60, 402, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DMShell.pyx":403 * context = (coarsen, args, kargs) * self.set_attr('__coarsen__', context) * CHKERR( DMShellSetCoarsen(self.dm, DMSHELL_Coarsen) ) # <<<<<<<<<<<<<< * else: * CHKERR( DMShellSetCoarsen(self.dm, NULL) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMShellSetCoarsen(__pyx_v_self->__pyx_base.dm, __pyx_f_8petsc4py_5PETSc_DMSHELL_Coarsen)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(60, 403, __pyx_L1_error) /* "petsc4py/PETSc/DMShell.pyx":398 * * """ * if coarsen is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ goto __pyx_L3; } /* "petsc4py/PETSc/DMShell.pyx":405 * CHKERR( DMShellSetCoarsen(self.dm, DMSHELL_Coarsen) ) * else: * CHKERR( DMShellSetCoarsen(self.dm, NULL) ) # <<<<<<<<<<<<<< * * def setRefine( */ /*else*/ { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMShellSetCoarsen(__pyx_v_self->__pyx_base.dm, NULL)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(60, 405, __pyx_L1_error) } __pyx_L3:; /* "petsc4py/PETSc/DMShell.pyx":374 * CHKERR( DMShellSetCreateMatrix(self.dm, NULL) ) * * def setCoarsen( # <<<<<<<<<<<<<< * self, * coarsen: Callable[[DM, Comm], DM] | None, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setCoarsen", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMShell.pyx":407 * CHKERR( DMShellSetCoarsen(self.dm, NULL) ) * * def setRefine( # <<<<<<<<<<<<<< * self, * refine: Callable[[DM, Comm], DM] | None, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_29setRefine(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMShell_28setRefine, "DMShell.setRefine(self, refine: Callable[[DM, Comm], DM] | None, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nSet the routine used to refine the `DMShell`.\n\n Logically collective.\n\n Parameters\n ----------\n refine\n The routine which refines the DM.\n args\n Additional positional arguments for ``refine``.\n kargs\n Additional keyword arguments for ``refine``.\n\n See Also\n --------\n setCoarsen, petsc.DMShellSetRefine\n\n \nSource code at petsc4py/PETSc/DMShell.pyx:407"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_29setRefine(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_refine = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setRefine (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_refine,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; /* "petsc4py/PETSc/DMShell.pyx":410 * self, * refine: Callable[[DM, Comm], DM] | None, * args: tuple[Any, ...] | None = None, # <<<<<<<<<<<<<< * kargs: dict[str, Any] | None = None, * ) -> None: */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/DMShell.pyx":411 * refine: Callable[[DM, Comm], DM] | None, * args: tuple[Any, ...] | None = None, * kargs: dict[str, Any] | None = None, # <<<<<<<<<<<<<< * ) -> None: * """Set the routine used to refine the `DMShell`. */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_refine)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(60, 407, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(60, 407, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(60, 407, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setRefine") < 0)) __PYX_ERR(60, 407, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_refine = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setRefine", 0, 1, 3, __pyx_nargs); __PYX_ERR(60, 407, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setRefine", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMShell_28setRefine(((struct __pyx_obj_8petsc4py_5PETSc_DMShell *)__pyx_v_self), __pyx_v_refine, __pyx_v_args, __pyx_v_kargs); /* "petsc4py/PETSc/DMShell.pyx":407 * CHKERR( DMShellSetCoarsen(self.dm, NULL) ) * * def setRefine( # <<<<<<<<<<<<<< * self, * refine: Callable[[DM, Comm], DM] | None, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_28setRefine(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_refine, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setRefine", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/DMShell.pyx":431 * * """ * if refine is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = (__pyx_v_refine != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/DMShell.pyx":432 * """ * if refine is not None: * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (refine, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/DMShell.pyx":433 * if refine is not None: * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (refine, args, kargs) * self.set_attr('__refine__', context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); if (__pyx_t_1) { __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(60, 433, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_2); __pyx_t_2 = 0; } /* "petsc4py/PETSc/DMShell.pyx":434 * if args is None: args = () * if kargs is None: kargs = {} * context = (refine, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__refine__', context) * CHKERR( DMShellSetRefine(self.dm, DMSHELL_Refine) ) */ __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(60, 434, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_refine); __Pyx_GIVEREF(__pyx_v_refine); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_refine)) __PYX_ERR(60, 434, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_args)) __PYX_ERR(60, 434, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_kargs)) __PYX_ERR(60, 434, __pyx_L1_error); __pyx_v_context = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DMShell.pyx":435 * if kargs is None: kargs = {} * context = (refine, args, kargs) * self.set_attr('__refine__', context) # <<<<<<<<<<<<<< * CHKERR( DMShellSetRefine(self.dm, DMSHELL_Refine) ) * else: */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DMShell *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__refine__"), __pyx_v_context); if (unlikely(!__pyx_t_2)) __PYX_ERR(60, 435, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DMShell.pyx":436 * context = (refine, args, kargs) * self.set_attr('__refine__', context) * CHKERR( DMShellSetRefine(self.dm, DMSHELL_Refine) ) # <<<<<<<<<<<<<< * else: * CHKERR( DMShellSetRefine(self.dm, NULL) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMShellSetRefine(__pyx_v_self->__pyx_base.dm, __pyx_f_8petsc4py_5PETSc_DMSHELL_Refine)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(60, 436, __pyx_L1_error) /* "petsc4py/PETSc/DMShell.pyx":431 * * """ * if refine is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ goto __pyx_L3; } /* "petsc4py/PETSc/DMShell.pyx":438 * CHKERR( DMShellSetRefine(self.dm, DMSHELL_Refine) ) * else: * CHKERR( DMShellSetRefine(self.dm, NULL) ) # <<<<<<<<<<<<<< * * def setCreateInterpolation( */ /*else*/ { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMShellSetRefine(__pyx_v_self->__pyx_base.dm, NULL)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(60, 438, __pyx_L1_error) } __pyx_L3:; /* "petsc4py/PETSc/DMShell.pyx":407 * CHKERR( DMShellSetCoarsen(self.dm, NULL) ) * * def setRefine( # <<<<<<<<<<<<<< * self, * refine: Callable[[DM, Comm], DM] | None, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setRefine", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMShell.pyx":440 * CHKERR( DMShellSetRefine(self.dm, NULL) ) * * def setCreateInterpolation( # <<<<<<<<<<<<<< * self, * create_interpolation: Callable[[DM, DM], tuple[Mat, Vec]] | None, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_31setCreateInterpolation(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMShell_30setCreateInterpolation, "DMShell.setCreateInterpolation(self, create_interpolation: Callable[[DM, DM], tuple[Mat, Vec]] | None, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nSet the routine used to create the interpolation operator.\n\n Logically collective.\n\n Parameters\n ----------\n create_interpolation\n The routine to create the interpolation.\n args\n Additional positional arguments for ``create_interpolation``.\n kargs\n Additional keyword arguments for ``create_interpolation``.\n\n See Also\n --------\n petsc.DMShellSetCreateInterpolation\n\n \nSource code at petsc4py/PETSc/DMShell.pyx:440"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_31setCreateInterpolation(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_create_interpolation = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setCreateInterpolation (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_create_interpolation,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; /* "petsc4py/PETSc/DMShell.pyx":443 * self, * create_interpolation: Callable[[DM, DM], tuple[Mat, Vec]] | None, * args: tuple[Any, ...] | None = None, # <<<<<<<<<<<<<< * kargs: dict[str, Any] | None = None, * ) -> None: */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/DMShell.pyx":444 * create_interpolation: Callable[[DM, DM], tuple[Mat, Vec]] | None, * args: tuple[Any, ...] | None = None, * kargs: dict[str, Any] | None = None, # <<<<<<<<<<<<<< * ) -> None: * """Set the routine used to create the interpolation operator. */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_create_interpolation)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(60, 440, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(60, 440, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(60, 440, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setCreateInterpolation") < 0)) __PYX_ERR(60, 440, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_create_interpolation = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setCreateInterpolation", 0, 1, 3, __pyx_nargs); __PYX_ERR(60, 440, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setCreateInterpolation", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMShell_30setCreateInterpolation(((struct __pyx_obj_8petsc4py_5PETSc_DMShell *)__pyx_v_self), __pyx_v_create_interpolation, __pyx_v_args, __pyx_v_kargs); /* "petsc4py/PETSc/DMShell.pyx":440 * CHKERR( DMShellSetRefine(self.dm, NULL) ) * * def setCreateInterpolation( # <<<<<<<<<<<<<< * self, * create_interpolation: Callable[[DM, DM], tuple[Mat, Vec]] | None, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_30setCreateInterpolation(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_create_interpolation, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setCreateInterpolation", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/DMShell.pyx":464 * * """ * if create_interpolation is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = (__pyx_v_create_interpolation != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/DMShell.pyx":465 * """ * if create_interpolation is not None: * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (create_interpolation, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/DMShell.pyx":466 * if create_interpolation is not None: * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (create_interpolation, args, kargs) * self.set_attr('__create_interpolation__', context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); if (__pyx_t_1) { __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(60, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_2); __pyx_t_2 = 0; } /* "petsc4py/PETSc/DMShell.pyx":467 * if args is None: args = () * if kargs is None: kargs = {} * context = (create_interpolation, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__create_interpolation__', context) * CHKERR( DMShellSetCreateInterpolation(self.dm, DMSHELL_CreateInterpolation) ) */ __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(60, 467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_create_interpolation); __Pyx_GIVEREF(__pyx_v_create_interpolation); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_create_interpolation)) __PYX_ERR(60, 467, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_args)) __PYX_ERR(60, 467, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_kargs)) __PYX_ERR(60, 467, __pyx_L1_error); __pyx_v_context = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DMShell.pyx":468 * if kargs is None: kargs = {} * context = (create_interpolation, args, kargs) * self.set_attr('__create_interpolation__', context) # <<<<<<<<<<<<<< * CHKERR( DMShellSetCreateInterpolation(self.dm, DMSHELL_CreateInterpolation) ) * else: */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DMShell *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__create_interpolation__"), __pyx_v_context); if (unlikely(!__pyx_t_2)) __PYX_ERR(60, 468, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DMShell.pyx":469 * context = (create_interpolation, args, kargs) * self.set_attr('__create_interpolation__', context) * CHKERR( DMShellSetCreateInterpolation(self.dm, DMSHELL_CreateInterpolation) ) # <<<<<<<<<<<<<< * else: * CHKERR( DMShellSetCreateInterpolation(self.dm, NULL) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMShellSetCreateInterpolation(__pyx_v_self->__pyx_base.dm, __pyx_f_8petsc4py_5PETSc_DMSHELL_CreateInterpolation)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(60, 469, __pyx_L1_error) /* "petsc4py/PETSc/DMShell.pyx":464 * * """ * if create_interpolation is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ goto __pyx_L3; } /* "petsc4py/PETSc/DMShell.pyx":471 * CHKERR( DMShellSetCreateInterpolation(self.dm, DMSHELL_CreateInterpolation) ) * else: * CHKERR( DMShellSetCreateInterpolation(self.dm, NULL) ) # <<<<<<<<<<<<<< * * def setCreateInjection( */ /*else*/ { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMShellSetCreateInterpolation(__pyx_v_self->__pyx_base.dm, NULL)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(60, 471, __pyx_L1_error) } __pyx_L3:; /* "petsc4py/PETSc/DMShell.pyx":440 * CHKERR( DMShellSetRefine(self.dm, NULL) ) * * def setCreateInterpolation( # <<<<<<<<<<<<<< * self, * create_interpolation: Callable[[DM, DM], tuple[Mat, Vec]] | None, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setCreateInterpolation", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMShell.pyx":473 * CHKERR( DMShellSetCreateInterpolation(self.dm, NULL) ) * * def setCreateInjection( # <<<<<<<<<<<<<< * self, * create_injection: Callable[[DM, DM], Mat] | None, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_33setCreateInjection(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMShell_32setCreateInjection, "DMShell.setCreateInjection(self, create_injection: Callable[[DM, DM], Mat] | None, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nSet the routine used to create the injection operator.\n\n Logically collective.\n\n Parameters\n ----------\n create_injection\n The routine to create the injection.\n args\n Additional positional arguments for ``create_injection``.\n kargs\n Additional keyword arguments for ``create_injection``.\n\n See Also\n --------\n petsc.DMShellSetCreateInjection\n\n \nSource code at petsc4py/PETSc/DMShell.pyx:473"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_33setCreateInjection(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_create_injection = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setCreateInjection (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_create_injection,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; /* "petsc4py/PETSc/DMShell.pyx":476 * self, * create_injection: Callable[[DM, DM], Mat] | None, * args: tuple[Any, ...] | None = None, # <<<<<<<<<<<<<< * kargs: dict[str, Any] | None = None, * ) -> None: */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/DMShell.pyx":477 * create_injection: Callable[[DM, DM], Mat] | None, * args: tuple[Any, ...] | None = None, * kargs: dict[str, Any] | None = None, # <<<<<<<<<<<<<< * ) -> None: * """Set the routine used to create the injection operator. */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_create_injection)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(60, 473, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(60, 473, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(60, 473, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setCreateInjection") < 0)) __PYX_ERR(60, 473, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_create_injection = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setCreateInjection", 0, 1, 3, __pyx_nargs); __PYX_ERR(60, 473, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setCreateInjection", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMShell_32setCreateInjection(((struct __pyx_obj_8petsc4py_5PETSc_DMShell *)__pyx_v_self), __pyx_v_create_injection, __pyx_v_args, __pyx_v_kargs); /* "petsc4py/PETSc/DMShell.pyx":473 * CHKERR( DMShellSetCreateInterpolation(self.dm, NULL) ) * * def setCreateInjection( # <<<<<<<<<<<<<< * self, * create_injection: Callable[[DM, DM], Mat] | None, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_32setCreateInjection(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_create_injection, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setCreateInjection", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/DMShell.pyx":497 * * """ * if create_injection is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = (__pyx_v_create_injection != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/DMShell.pyx":498 * """ * if create_injection is not None: * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (create_injection, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/DMShell.pyx":499 * if create_injection is not None: * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (create_injection, args, kargs) * self.set_attr('__create_injection__', context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); if (__pyx_t_1) { __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(60, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_2); __pyx_t_2 = 0; } /* "petsc4py/PETSc/DMShell.pyx":500 * if args is None: args = () * if kargs is None: kargs = {} * context = (create_injection, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__create_injection__', context) * CHKERR( DMShellSetCreateInjection(self.dm, DMSHELL_CreateInjection) ) */ __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(60, 500, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_create_injection); __Pyx_GIVEREF(__pyx_v_create_injection); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_create_injection)) __PYX_ERR(60, 500, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_args)) __PYX_ERR(60, 500, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_kargs)) __PYX_ERR(60, 500, __pyx_L1_error); __pyx_v_context = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DMShell.pyx":501 * if kargs is None: kargs = {} * context = (create_injection, args, kargs) * self.set_attr('__create_injection__', context) # <<<<<<<<<<<<<< * CHKERR( DMShellSetCreateInjection(self.dm, DMSHELL_CreateInjection) ) * else: */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DMShell *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__create_injection__"), __pyx_v_context); if (unlikely(!__pyx_t_2)) __PYX_ERR(60, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DMShell.pyx":502 * context = (create_injection, args, kargs) * self.set_attr('__create_injection__', context) * CHKERR( DMShellSetCreateInjection(self.dm, DMSHELL_CreateInjection) ) # <<<<<<<<<<<<<< * else: * CHKERR( DMShellSetCreateInjection(self.dm, NULL) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMShellSetCreateInjection(__pyx_v_self->__pyx_base.dm, __pyx_f_8petsc4py_5PETSc_DMSHELL_CreateInjection)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(60, 502, __pyx_L1_error) /* "petsc4py/PETSc/DMShell.pyx":497 * * """ * if create_injection is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ goto __pyx_L3; } /* "petsc4py/PETSc/DMShell.pyx":504 * CHKERR( DMShellSetCreateInjection(self.dm, DMSHELL_CreateInjection) ) * else: * CHKERR( DMShellSetCreateInjection(self.dm, NULL) ) # <<<<<<<<<<<<<< * * def setCreateRestriction( */ /*else*/ { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMShellSetCreateInjection(__pyx_v_self->__pyx_base.dm, NULL)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(60, 504, __pyx_L1_error) } __pyx_L3:; /* "petsc4py/PETSc/DMShell.pyx":473 * CHKERR( DMShellSetCreateInterpolation(self.dm, NULL) ) * * def setCreateInjection( # <<<<<<<<<<<<<< * self, * create_injection: Callable[[DM, DM], Mat] | None, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setCreateInjection", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMShell.pyx":506 * CHKERR( DMShellSetCreateInjection(self.dm, NULL) ) * * def setCreateRestriction( # <<<<<<<<<<<<<< * self, * create_restriction: Callable[[DM, DM], Mat] | None, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_35setCreateRestriction(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMShell_34setCreateRestriction, "DMShell.setCreateRestriction(self, create_restriction: Callable[[DM, DM], Mat] | None, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nSet the routine used to create the restriction operator.\n\n Logically collective.\n\n Parameters\n ----------\n create_restriction\n The routine to create the restriction\n args\n Additional positional arguments for ``create_restriction``.\n kargs\n Additional keyword arguments for ``create_restriction``.\n\n See Also\n --------\n petsc.DMShellSetCreateRestriction\n\n \nSource code at petsc4py/PETSc/DMShell.pyx:506"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_35setCreateRestriction(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_create_restriction = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setCreateRestriction (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_create_restriction,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; /* "petsc4py/PETSc/DMShell.pyx":509 * self, * create_restriction: Callable[[DM, DM], Mat] | None, * args: tuple[Any, ...] | None = None, # <<<<<<<<<<<<<< * kargs: dict[str, Any] | None = None, * ) -> None: */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/DMShell.pyx":510 * create_restriction: Callable[[DM, DM], Mat] | None, * args: tuple[Any, ...] | None = None, * kargs: dict[str, Any] | None = None, # <<<<<<<<<<<<<< * ) -> None: * """Set the routine used to create the restriction operator. */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_create_restriction)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(60, 506, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(60, 506, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(60, 506, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setCreateRestriction") < 0)) __PYX_ERR(60, 506, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_create_restriction = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setCreateRestriction", 0, 1, 3, __pyx_nargs); __PYX_ERR(60, 506, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setCreateRestriction", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMShell_34setCreateRestriction(((struct __pyx_obj_8petsc4py_5PETSc_DMShell *)__pyx_v_self), __pyx_v_create_restriction, __pyx_v_args, __pyx_v_kargs); /* "petsc4py/PETSc/DMShell.pyx":506 * CHKERR( DMShellSetCreateInjection(self.dm, NULL) ) * * def setCreateRestriction( # <<<<<<<<<<<<<< * self, * create_restriction: Callable[[DM, DM], Mat] | None, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_34setCreateRestriction(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_create_restriction, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setCreateRestriction", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/DMShell.pyx":530 * * """ * if create_restriction is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = (__pyx_v_create_restriction != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/DMShell.pyx":531 * """ * if create_restriction is not None: * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (create_restriction, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/DMShell.pyx":532 * if create_restriction is not None: * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (create_restriction, args, kargs) * self.set_attr('__create_restriction__', context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); if (__pyx_t_1) { __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(60, 532, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_2); __pyx_t_2 = 0; } /* "petsc4py/PETSc/DMShell.pyx":533 * if args is None: args = () * if kargs is None: kargs = {} * context = (create_restriction, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__create_restriction__', context) * CHKERR( DMShellSetCreateRestriction(self.dm, DMSHELL_CreateRestriction) ) */ __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(60, 533, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_create_restriction); __Pyx_GIVEREF(__pyx_v_create_restriction); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_create_restriction)) __PYX_ERR(60, 533, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_args)) __PYX_ERR(60, 533, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_kargs)) __PYX_ERR(60, 533, __pyx_L1_error); __pyx_v_context = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DMShell.pyx":534 * if kargs is None: kargs = {} * context = (create_restriction, args, kargs) * self.set_attr('__create_restriction__', context) # <<<<<<<<<<<<<< * CHKERR( DMShellSetCreateRestriction(self.dm, DMSHELL_CreateRestriction) ) * else: */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DMShell *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__create_restriction__"), __pyx_v_context); if (unlikely(!__pyx_t_2)) __PYX_ERR(60, 534, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DMShell.pyx":535 * context = (create_restriction, args, kargs) * self.set_attr('__create_restriction__', context) * CHKERR( DMShellSetCreateRestriction(self.dm, DMSHELL_CreateRestriction) ) # <<<<<<<<<<<<<< * else: * CHKERR( DMShellSetCreateRestriction(self.dm, NULL) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMShellSetCreateRestriction(__pyx_v_self->__pyx_base.dm, __pyx_f_8petsc4py_5PETSc_DMSHELL_CreateRestriction)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(60, 535, __pyx_L1_error) /* "petsc4py/PETSc/DMShell.pyx":530 * * """ * if create_restriction is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ goto __pyx_L3; } /* "petsc4py/PETSc/DMShell.pyx":537 * CHKERR( DMShellSetCreateRestriction(self.dm, DMSHELL_CreateRestriction) ) * else: * CHKERR( DMShellSetCreateRestriction(self.dm, NULL) ) # <<<<<<<<<<<<<< * * def setCreateFieldDecomposition( */ /*else*/ { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMShellSetCreateRestriction(__pyx_v_self->__pyx_base.dm, NULL)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(60, 537, __pyx_L1_error) } __pyx_L3:; /* "petsc4py/PETSc/DMShell.pyx":506 * CHKERR( DMShellSetCreateInjection(self.dm, NULL) ) * * def setCreateRestriction( # <<<<<<<<<<<<<< * self, * create_restriction: Callable[[DM, DM], Mat] | None, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setCreateRestriction", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMShell.pyx":539 * CHKERR( DMShellSetCreateRestriction(self.dm, NULL) ) * * def setCreateFieldDecomposition( # <<<<<<<<<<<<<< * self, * decomp: Callable[[DM], tuple[list[str] | None, list[IS] | None, list[DM] | None]] | None, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_37setCreateFieldDecomposition(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMShell_36setCreateFieldDecomposition, "DMShell.setCreateFieldDecomposition(self, decomp: Callable[[DM], tuple[list[str] | None, list[IS] | None, list[DM] | None]] | None, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nSet the routine used to create a field decomposition.\n\n Logically collective.\n\n Parameters\n ----------\n decomp\n The routine to create the decomposition.\n args\n Additional positional arguments for ``decomp``.\n kargs\n Additional keyword arguments for ``decomp``.\n\n See Also\n --------\n petsc.DMShellSetCreateFieldDecomposition\n\n \nSource code at petsc4py/PETSc/DMShell.pyx:539"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_37setCreateFieldDecomposition(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_decomp = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setCreateFieldDecomposition (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_decomp,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; /* "petsc4py/PETSc/DMShell.pyx":542 * self, * decomp: Callable[[DM], tuple[list[str] | None, list[IS] | None, list[DM] | None]] | None, * args: tuple[Any, ...] | None = None, # <<<<<<<<<<<<<< * kargs: dict[str, Any] | None = None, * ) -> None: */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/DMShell.pyx":543 * decomp: Callable[[DM], tuple[list[str] | None, list[IS] | None, list[DM] | None]] | None, * args: tuple[Any, ...] | None = None, * kargs: dict[str, Any] | None = None, # <<<<<<<<<<<<<< * ) -> None: * """Set the routine used to create a field decomposition. */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_decomp)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(60, 539, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(60, 539, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(60, 539, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setCreateFieldDecomposition") < 0)) __PYX_ERR(60, 539, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_decomp = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setCreateFieldDecomposition", 0, 1, 3, __pyx_nargs); __PYX_ERR(60, 539, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setCreateFieldDecomposition", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMShell_36setCreateFieldDecomposition(((struct __pyx_obj_8petsc4py_5PETSc_DMShell *)__pyx_v_self), __pyx_v_decomp, __pyx_v_args, __pyx_v_kargs); /* "petsc4py/PETSc/DMShell.pyx":539 * CHKERR( DMShellSetCreateRestriction(self.dm, NULL) ) * * def setCreateFieldDecomposition( # <<<<<<<<<<<<<< * self, * decomp: Callable[[DM], tuple[list[str] | None, list[IS] | None, list[DM] | None]] | None, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_36setCreateFieldDecomposition(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_decomp, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setCreateFieldDecomposition", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/DMShell.pyx":563 * * """ * if decomp is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = (__pyx_v_decomp != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/DMShell.pyx":564 * """ * if decomp is not None: * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (decomp, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/DMShell.pyx":565 * if decomp is not None: * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (decomp, args, kargs) * self.set_attr('__create_field_decomp__', context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); if (__pyx_t_1) { __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(60, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_2); __pyx_t_2 = 0; } /* "petsc4py/PETSc/DMShell.pyx":566 * if args is None: args = () * if kargs is None: kargs = {} * context = (decomp, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__create_field_decomp__', context) * CHKERR( DMShellSetCreateFieldDecomposition(self.dm, DMSHELL_CreateFieldDecomposition) ) */ __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(60, 566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_decomp); __Pyx_GIVEREF(__pyx_v_decomp); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_decomp)) __PYX_ERR(60, 566, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_args)) __PYX_ERR(60, 566, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_kargs)) __PYX_ERR(60, 566, __pyx_L1_error); __pyx_v_context = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DMShell.pyx":567 * if kargs is None: kargs = {} * context = (decomp, args, kargs) * self.set_attr('__create_field_decomp__', context) # <<<<<<<<<<<<<< * CHKERR( DMShellSetCreateFieldDecomposition(self.dm, DMSHELL_CreateFieldDecomposition) ) * else: */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DMShell *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__create_field_decomp__"), __pyx_v_context); if (unlikely(!__pyx_t_2)) __PYX_ERR(60, 567, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DMShell.pyx":568 * context = (decomp, args, kargs) * self.set_attr('__create_field_decomp__', context) * CHKERR( DMShellSetCreateFieldDecomposition(self.dm, DMSHELL_CreateFieldDecomposition) ) # <<<<<<<<<<<<<< * else: * CHKERR( DMShellSetCreateFieldDecomposition(self.dm, NULL) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMShellSetCreateFieldDecomposition(__pyx_v_self->__pyx_base.dm, __pyx_f_8petsc4py_5PETSc_DMSHELL_CreateFieldDecomposition)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(60, 568, __pyx_L1_error) /* "petsc4py/PETSc/DMShell.pyx":563 * * """ * if decomp is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ goto __pyx_L3; } /* "petsc4py/PETSc/DMShell.pyx":570 * CHKERR( DMShellSetCreateFieldDecomposition(self.dm, DMSHELL_CreateFieldDecomposition) ) * else: * CHKERR( DMShellSetCreateFieldDecomposition(self.dm, NULL) ) # <<<<<<<<<<<<<< * * def setCreateDomainDecomposition( */ /*else*/ { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMShellSetCreateFieldDecomposition(__pyx_v_self->__pyx_base.dm, NULL)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(60, 570, __pyx_L1_error) } __pyx_L3:; /* "petsc4py/PETSc/DMShell.pyx":539 * CHKERR( DMShellSetCreateRestriction(self.dm, NULL) ) * * def setCreateFieldDecomposition( # <<<<<<<<<<<<<< * self, * decomp: Callable[[DM], tuple[list[str] | None, list[IS] | None, list[DM] | None]] | None, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setCreateFieldDecomposition", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMShell.pyx":572 * CHKERR( DMShellSetCreateFieldDecomposition(self.dm, NULL) ) * * def setCreateDomainDecomposition( # <<<<<<<<<<<<<< * self, * decomp: Callable[[DM], tuple[list[str] | None, list[IS] | None, list[IS] | None, list[DM] | None]] | None, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_39setCreateDomainDecomposition(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMShell_38setCreateDomainDecomposition, "DMShell.setCreateDomainDecomposition(self, decomp: Callable[[DM], tuple[list[str] | None, list[IS] | None, list[IS] | None, list[DM] | None]] | None, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nSet the routine used to create a domain decomposition.\n\n Logically collective.\n\n Parameters\n ----------\n decomp\n The routine to create the decomposition.\n args\n Additional positional arguments for ``decomp``.\n kargs\n Additional keyword arguments for ``decomp``.\n\n See Also\n --------\n petsc.DMShellSetCreateDomainDecomposition\n\n \nSource code at petsc4py/PETSc/DMShell.pyx:572"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_39setCreateDomainDecomposition(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_decomp = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setCreateDomainDecomposition (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_decomp,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; /* "petsc4py/PETSc/DMShell.pyx":575 * self, * decomp: Callable[[DM], tuple[list[str] | None, list[IS] | None, list[IS] | None, list[DM] | None]] | None, * args: tuple[Any, ...] | None = None, # <<<<<<<<<<<<<< * kargs: dict[str, Any] | None = None, * ) -> None: */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/DMShell.pyx":576 * decomp: Callable[[DM], tuple[list[str] | None, list[IS] | None, list[IS] | None, list[DM] | None]] | None, * args: tuple[Any, ...] | None = None, * kargs: dict[str, Any] | None = None, # <<<<<<<<<<<<<< * ) -> None: * """Set the routine used to create a domain decomposition. */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_decomp)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(60, 572, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(60, 572, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(60, 572, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setCreateDomainDecomposition") < 0)) __PYX_ERR(60, 572, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_decomp = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setCreateDomainDecomposition", 0, 1, 3, __pyx_nargs); __PYX_ERR(60, 572, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setCreateDomainDecomposition", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMShell_38setCreateDomainDecomposition(((struct __pyx_obj_8petsc4py_5PETSc_DMShell *)__pyx_v_self), __pyx_v_decomp, __pyx_v_args, __pyx_v_kargs); /* "petsc4py/PETSc/DMShell.pyx":572 * CHKERR( DMShellSetCreateFieldDecomposition(self.dm, NULL) ) * * def setCreateDomainDecomposition( # <<<<<<<<<<<<<< * self, * decomp: Callable[[DM], tuple[list[str] | None, list[IS] | None, list[IS] | None, list[DM] | None]] | None, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_38setCreateDomainDecomposition(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_decomp, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setCreateDomainDecomposition", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/DMShell.pyx":596 * * """ * if decomp is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = (__pyx_v_decomp != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/DMShell.pyx":597 * """ * if decomp is not None: * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (decomp, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/DMShell.pyx":598 * if decomp is not None: * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (decomp, args, kargs) * self.set_attr('__create_domain_decomp__', context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); if (__pyx_t_1) { __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(60, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_2); __pyx_t_2 = 0; } /* "petsc4py/PETSc/DMShell.pyx":599 * if args is None: args = () * if kargs is None: kargs = {} * context = (decomp, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__create_domain_decomp__', context) * CHKERR( DMShellSetCreateDomainDecomposition(self.dm, DMSHELL_CreateDomainDecomposition) ) */ __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(60, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_decomp); __Pyx_GIVEREF(__pyx_v_decomp); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_decomp)) __PYX_ERR(60, 599, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_args)) __PYX_ERR(60, 599, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_kargs)) __PYX_ERR(60, 599, __pyx_L1_error); __pyx_v_context = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DMShell.pyx":600 * if kargs is None: kargs = {} * context = (decomp, args, kargs) * self.set_attr('__create_domain_decomp__', context) # <<<<<<<<<<<<<< * CHKERR( DMShellSetCreateDomainDecomposition(self.dm, DMSHELL_CreateDomainDecomposition) ) * else: */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DMShell *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__create_domain_decomp__"), __pyx_v_context); if (unlikely(!__pyx_t_2)) __PYX_ERR(60, 600, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DMShell.pyx":601 * context = (decomp, args, kargs) * self.set_attr('__create_domain_decomp__', context) * CHKERR( DMShellSetCreateDomainDecomposition(self.dm, DMSHELL_CreateDomainDecomposition) ) # <<<<<<<<<<<<<< * else: * CHKERR( DMShellSetCreateDomainDecomposition(self.dm, NULL) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMShellSetCreateDomainDecomposition(__pyx_v_self->__pyx_base.dm, __pyx_f_8petsc4py_5PETSc_DMSHELL_CreateDomainDecomposition)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(60, 601, __pyx_L1_error) /* "petsc4py/PETSc/DMShell.pyx":596 * * """ * if decomp is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ goto __pyx_L3; } /* "petsc4py/PETSc/DMShell.pyx":603 * CHKERR( DMShellSetCreateDomainDecomposition(self.dm, DMSHELL_CreateDomainDecomposition) ) * else: * CHKERR( DMShellSetCreateDomainDecomposition(self.dm, NULL) ) # <<<<<<<<<<<<<< * * def setCreateDomainDecompositionScatters( */ /*else*/ { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMShellSetCreateDomainDecomposition(__pyx_v_self->__pyx_base.dm, NULL)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(60, 603, __pyx_L1_error) } __pyx_L3:; /* "petsc4py/PETSc/DMShell.pyx":572 * CHKERR( DMShellSetCreateFieldDecomposition(self.dm, NULL) ) * * def setCreateDomainDecomposition( # <<<<<<<<<<<<<< * self, * decomp: Callable[[DM], tuple[list[str] | None, list[IS] | None, list[IS] | None, list[DM] | None]] | None, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setCreateDomainDecomposition", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMShell.pyx":605 * CHKERR( DMShellSetCreateDomainDecomposition(self.dm, NULL) ) * * def setCreateDomainDecompositionScatters( # <<<<<<<<<<<<<< * self, * scatter: Callable[[DM, list[DM]], tuple[list[Scatter], list[Scatter], list[Scatter]]] | None, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_41setCreateDomainDecompositionScatters(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMShell_40setCreateDomainDecompositionScatters, "DMShell.setCreateDomainDecompositionScatters(self, scatter: Callable[[DM, list[DM]], tuple[list[Scatter], list[Scatter], list[Scatter]]] | None, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nSet the routine used to create the scatter contexts for domain decomposition.\n\n Logically collective.\n\n Parameters\n ----------\n scatter\n The routine to create the scatters.\n args\n Additional positional arguments for ``scatter``.\n kargs\n Additional keyword arguments for ``scatter``.\n\n See Also\n --------\n petsc.DMShellSetCreateDomainDecompositionScatters\n\n \nSource code at petsc4py/PETSc/DMShell.pyx:605"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_41setCreateDomainDecompositionScatters(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_scatter = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setCreateDomainDecompositionScatters (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_scatter,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; /* "petsc4py/PETSc/DMShell.pyx":608 * self, * scatter: Callable[[DM, list[DM]], tuple[list[Scatter], list[Scatter], list[Scatter]]] | None, * args: tuple[Any, ...] | None = None, # <<<<<<<<<<<<<< * kargs: dict[str, Any] | None = None, * ) -> None: */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/DMShell.pyx":609 * scatter: Callable[[DM, list[DM]], tuple[list[Scatter], list[Scatter], list[Scatter]]] | None, * args: tuple[Any, ...] | None = None, * kargs: dict[str, Any] | None = None, # <<<<<<<<<<<<<< * ) -> None: * """Set the routine used to create the scatter contexts for domain decomposition. */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_scatter)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(60, 605, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(60, 605, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(60, 605, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setCreateDomainDecompositionScatters") < 0)) __PYX_ERR(60, 605, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_scatter = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setCreateDomainDecompositionScatters", 0, 1, 3, __pyx_nargs); __PYX_ERR(60, 605, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setCreateDomainDecompositionScatters", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMShell_40setCreateDomainDecompositionScatters(((struct __pyx_obj_8petsc4py_5PETSc_DMShell *)__pyx_v_self), __pyx_v_scatter, __pyx_v_args, __pyx_v_kargs); /* "petsc4py/PETSc/DMShell.pyx":605 * CHKERR( DMShellSetCreateDomainDecomposition(self.dm, NULL) ) * * def setCreateDomainDecompositionScatters( # <<<<<<<<<<<<<< * self, * scatter: Callable[[DM, list[DM]], tuple[list[Scatter], list[Scatter], list[Scatter]]] | None, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_40setCreateDomainDecompositionScatters(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_scatter, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setCreateDomainDecompositionScatters", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/DMShell.pyx":629 * * """ * if scatter is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = (__pyx_v_scatter != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/DMShell.pyx":630 * """ * if scatter is not None: * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (scatter, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/DMShell.pyx":631 * if scatter is not None: * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (scatter, args, kargs) * self.set_attr('__create_domain_decomp_scatters__', context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); if (__pyx_t_1) { __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(60, 631, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_2); __pyx_t_2 = 0; } /* "petsc4py/PETSc/DMShell.pyx":632 * if args is None: args = () * if kargs is None: kargs = {} * context = (scatter, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__create_domain_decomp_scatters__', context) * CHKERR( DMShellSetCreateDomainDecompositionScatters(self.dm, DMSHELL_CreateDomainDecompositionScatters) ) */ __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(60, 632, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_scatter); __Pyx_GIVEREF(__pyx_v_scatter); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_scatter)) __PYX_ERR(60, 632, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_args)) __PYX_ERR(60, 632, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_kargs)) __PYX_ERR(60, 632, __pyx_L1_error); __pyx_v_context = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DMShell.pyx":633 * if kargs is None: kargs = {} * context = (scatter, args, kargs) * self.set_attr('__create_domain_decomp_scatters__', context) # <<<<<<<<<<<<<< * CHKERR( DMShellSetCreateDomainDecompositionScatters(self.dm, DMSHELL_CreateDomainDecompositionScatters) ) * else: */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DMShell *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__create_domain_decomp_scatters__"), __pyx_v_context); if (unlikely(!__pyx_t_2)) __PYX_ERR(60, 633, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DMShell.pyx":634 * context = (scatter, args, kargs) * self.set_attr('__create_domain_decomp_scatters__', context) * CHKERR( DMShellSetCreateDomainDecompositionScatters(self.dm, DMSHELL_CreateDomainDecompositionScatters) ) # <<<<<<<<<<<<<< * else: * CHKERR( DMShellSetCreateDomainDecompositionScatters(self.dm, NULL) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMShellSetCreateDomainDecompositionScatters(__pyx_v_self->__pyx_base.dm, __pyx_f_8petsc4py_5PETSc_DMSHELL_CreateDomainDecompositionScatters)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(60, 634, __pyx_L1_error) /* "petsc4py/PETSc/DMShell.pyx":629 * * """ * if scatter is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ goto __pyx_L3; } /* "petsc4py/PETSc/DMShell.pyx":636 * CHKERR( DMShellSetCreateDomainDecompositionScatters(self.dm, DMSHELL_CreateDomainDecompositionScatters) ) * else: * CHKERR( DMShellSetCreateDomainDecompositionScatters(self.dm, NULL) ) # <<<<<<<<<<<<<< * * def setCreateSubDM( */ /*else*/ { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMShellSetCreateDomainDecompositionScatters(__pyx_v_self->__pyx_base.dm, NULL)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(60, 636, __pyx_L1_error) } __pyx_L3:; /* "petsc4py/PETSc/DMShell.pyx":605 * CHKERR( DMShellSetCreateDomainDecomposition(self.dm, NULL) ) * * def setCreateDomainDecompositionScatters( # <<<<<<<<<<<<<< * self, * scatter: Callable[[DM, list[DM]], tuple[list[Scatter], list[Scatter], list[Scatter]]] | None, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setCreateDomainDecompositionScatters", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMShell.pyx":638 * CHKERR( DMShellSetCreateDomainDecompositionScatters(self.dm, NULL) ) * * def setCreateSubDM( # <<<<<<<<<<<<<< * self, * create_subdm: Callable[[DM, Sequence[int]], tuple[IS, DM]] | None, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_43setCreateSubDM(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMShell_42setCreateSubDM, "DMShell.setCreateSubDM(self, create_subdm: Callable[[DM, Sequence[int]], tuple[IS, DM]] | None, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nSet the routine used to create a sub DM from the `DMShell`.\n\n Logically collective.\n\n Parameters\n ----------\n subdm\n The routine to create the decomposition.\n args\n Additional positional arguments for ``subdm``.\n kargs\n Additional keyword arguments for ``subdm``.\n\n See Also\n --------\n petsc.DMShellSetCreateSubDM\n\n \nSource code at petsc4py/PETSc/DMShell.pyx:638"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_43setCreateSubDM(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_create_subdm = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setCreateSubDM (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_create_subdm,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; /* "petsc4py/PETSc/DMShell.pyx":641 * self, * create_subdm: Callable[[DM, Sequence[int]], tuple[IS, DM]] | None, * args: tuple[Any, ...] | None = None, # <<<<<<<<<<<<<< * kargs: dict[str, Any] | None = None, * ) -> None: */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/DMShell.pyx":642 * create_subdm: Callable[[DM, Sequence[int]], tuple[IS, DM]] | None, * args: tuple[Any, ...] | None = None, * kargs: dict[str, Any] | None = None, # <<<<<<<<<<<<<< * ) -> None: * """Set the routine used to create a sub DM from the `DMShell`. */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_create_subdm)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(60, 638, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(60, 638, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kargs); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(60, 638, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setCreateSubDM") < 0)) __PYX_ERR(60, 638, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_create_subdm = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setCreateSubDM", 0, 1, 3, __pyx_nargs); __PYX_ERR(60, 638, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setCreateSubDM", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMShell_42setCreateSubDM(((struct __pyx_obj_8petsc4py_5PETSc_DMShell *)__pyx_v_self), __pyx_v_create_subdm, __pyx_v_args, __pyx_v_kargs); /* "petsc4py/PETSc/DMShell.pyx":638 * CHKERR( DMShellSetCreateDomainDecompositionScatters(self.dm, NULL) ) * * def setCreateSubDM( # <<<<<<<<<<<<<< * self, * create_subdm: Callable[[DM, Sequence[int]], tuple[IS, DM]] | None, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_42setCreateSubDM(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_create_subdm, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setCreateSubDM", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "petsc4py/PETSc/DMShell.pyx":662 * * """ * if create_subdm is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = (__pyx_v_create_subdm != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/DMShell.pyx":663 * """ * if create_subdm is not None: * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (create_subdm, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "petsc4py/PETSc/DMShell.pyx":664 * if create_subdm is not None: * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (create_subdm, args, kargs) * self.set_attr('__create_subdm__', context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); if (__pyx_t_1) { __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(60, 664, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_2); __pyx_t_2 = 0; } /* "petsc4py/PETSc/DMShell.pyx":665 * if args is None: args = () * if kargs is None: kargs = {} * context = (create_subdm, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__create_subdm__', context) * CHKERR( DMShellSetCreateSubDM(self.dm, DMSHELL_CreateSubDM) ) */ __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(60, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_create_subdm); __Pyx_GIVEREF(__pyx_v_create_subdm); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_create_subdm)) __PYX_ERR(60, 665, __pyx_L1_error); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_args)) __PYX_ERR(60, 665, __pyx_L1_error); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_kargs)) __PYX_ERR(60, 665, __pyx_L1_error); __pyx_v_context = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DMShell.pyx":666 * if kargs is None: kargs = {} * context = (create_subdm, args, kargs) * self.set_attr('__create_subdm__', context) # <<<<<<<<<<<<<< * CHKERR( DMShellSetCreateSubDM(self.dm, DMSHELL_CreateSubDM) ) * else: */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DMShell *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__create_subdm__"), __pyx_v_context); if (unlikely(!__pyx_t_2)) __PYX_ERR(60, 666, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DMShell.pyx":667 * context = (create_subdm, args, kargs) * self.set_attr('__create_subdm__', context) * CHKERR( DMShellSetCreateSubDM(self.dm, DMSHELL_CreateSubDM) ) # <<<<<<<<<<<<<< * else: * CHKERR( DMShellSetCreateSubDM(self.dm, NULL) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMShellSetCreateSubDM(__pyx_v_self->__pyx_base.dm, __pyx_f_8petsc4py_5PETSc_DMSHELL_CreateSubDM)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(60, 667, __pyx_L1_error) /* "petsc4py/PETSc/DMShell.pyx":662 * * """ * if create_subdm is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ goto __pyx_L3; } /* "petsc4py/PETSc/DMShell.pyx":669 * CHKERR( DMShellSetCreateSubDM(self.dm, DMSHELL_CreateSubDM) ) * else: * CHKERR( DMShellSetCreateSubDM(self.dm, NULL) ) # <<<<<<<<<<<<<< */ /*else*/ { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMShellSetCreateSubDM(__pyx_v_self->__pyx_base.dm, NULL)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(60, 669, __pyx_L1_error) } __pyx_L3:; /* "petsc4py/PETSc/DMShell.pyx":638 * CHKERR( DMShellSetCreateDomainDecompositionScatters(self.dm, NULL) ) * * def setCreateSubDM( # <<<<<<<<<<<<<< * self, * create_subdm: Callable[[DM, Sequence[int]], tuple[IS, DM]] | None, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setCreateSubDM", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMLabel.pyx":4 * cdef class DMLabel(Object): * """An object representing a subset of mesh entities from a `DM`.""" * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.dmlabel * self.dmlabel = NULL */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_7DMLabel_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_7DMLabel_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMLabel___cinit__(((struct PyPetscDMLabelObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_7DMLabel___cinit__(struct PyPetscDMLabelObject *__pyx_v_self) { int __pyx_r; /* "petsc4py/PETSc/DMLabel.pyx":5 * """An object representing a subset of mesh entities from a `DM`.""" * def __cinit__(self): * self.obj = &self.dmlabel # <<<<<<<<<<<<<< * self.dmlabel = NULL * */ __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->dmlabel)); /* "petsc4py/PETSc/DMLabel.pyx":6 * def __cinit__(self): * self.obj = &self.dmlabel * self.dmlabel = NULL # <<<<<<<<<<<<<< * * def destroy(self) -> Self: */ __pyx_v_self->dmlabel = NULL; /* "petsc4py/PETSc/DMLabel.pyx":4 * cdef class DMLabel(Object): * """An object representing a subset of mesh entities from a `DM`.""" * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.dmlabel * self.dmlabel = NULL */ /* function exit code */ __pyx_r = 0; return __pyx_r; } /* "petsc4py/PETSc/DMLabel.pyx":8 * self.dmlabel = NULL * * def destroy(self) -> Self: # <<<<<<<<<<<<<< * """Destroy the label. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_3destroy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMLabel_2destroy, "DMLabel.destroy(self) -> Self\nDestroy the label.\n\n Collective.\n\n See Also\n --------\n petsc.DMLabelDestroy\n\n \nSource code at petsc4py/PETSc/DMLabel.pyx:8"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_3destroy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("destroy (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMLabel_2destroy(((struct PyPetscDMLabelObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_2destroy(struct PyPetscDMLabelObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("destroy", 1); /* "petsc4py/PETSc/DMLabel.pyx":18 * * """ * CHKERR( DMLabelDestroy(&self.dmlabel) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMLabelDestroy((&__pyx_v_self->dmlabel))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(61, 18, __pyx_L1_error) /* "petsc4py/PETSc/DMLabel.pyx":19 * """ * CHKERR( DMLabelDestroy(&self.dmlabel) ) * return self # <<<<<<<<<<<<<< * * def view(self, Viewer viewer=None) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/DMLabel.pyx":8 * self.dmlabel = NULL * * def destroy(self) -> Self: # <<<<<<<<<<<<<< * """Destroy the label. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMLabel.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMLabel.pyx":21 * return self * * def view(self, Viewer viewer=None) -> None: # <<<<<<<<<<<<<< * """View the label. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_5view(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMLabel_4view, "DMLabel.view(self, viewer: Viewer | None = None) -> None\nView the label.\n\n Collective.\n\n Parameters\n ----------\n viewer\n A `Viewer` to display the graph.\n\n See Also\n --------\n petsc.DMLabelView\n\n \nSource code at petsc4py/PETSc/DMLabel.pyx:21"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_5view(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscViewerObject *__pyx_v_viewer = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("view (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscViewerObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_viewer); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(61, 21, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "view") < 0)) __PYX_ERR(61, 21, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, __pyx_nargs); __PYX_ERR(61, 21, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMLabel.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(61, 21, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMLabel_4view(((struct PyPetscDMLabelObject *)__pyx_v_self), __pyx_v_viewer); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_4view(struct PyPetscDMLabelObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer) { PetscViewer __pyx_v_vwr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscViewer __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("view", 1); /* "petsc4py/PETSc/DMLabel.pyx":36 * * """ * cdef PetscViewer vwr = NULL # <<<<<<<<<<<<<< * if viewer is not None: vwr = viewer.vwr * CHKERR( DMLabelView(self.dmlabel, vwr) ) */ __pyx_v_vwr = NULL; /* "petsc4py/PETSc/DMLabel.pyx":37 * """ * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr # <<<<<<<<<<<<<< * CHKERR( DMLabelView(self.dmlabel, vwr) ) * */ __pyx_t_1 = (((PyObject *)__pyx_v_viewer) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_viewer->vwr; __pyx_v_vwr = __pyx_t_2; } /* "petsc4py/PETSc/DMLabel.pyx":38 * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr * CHKERR( DMLabelView(self.dmlabel, vwr) ) # <<<<<<<<<<<<<< * * def create(self, name: str, comm: Comm | None = None) -> Self: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMLabelView(__pyx_v_self->dmlabel, __pyx_v_vwr)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(61, 38, __pyx_L1_error) /* "petsc4py/PETSc/DMLabel.pyx":21 * return self * * def view(self, Viewer viewer=None) -> None: # <<<<<<<<<<<<<< * """View the label. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMLabel.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMLabel.pyx":40 * CHKERR( DMLabelView(self.dmlabel, vwr) ) * * def create(self, name: str, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Create a `DMLabel` object, which is a multimap. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_7create(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMLabel_6create, "DMLabel.create(self, name: str, comm: Comm | None = None) -> Self\nCreate a `DMLabel` object, which is a multimap.\n\n Collective.\n\n Parameters\n ----------\n name\n The label name.\n comm\n MPI communicator, defaults to `COMM_SELF`.\n\n See Also\n --------\n petsc.DMLabelCreate\n\n \nSource code at petsc4py/PETSc/DMLabel.pyx:40"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_7create(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_name = 0; PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_comm,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(61, 40, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(61, 40, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "create") < 0)) __PYX_ERR(61, 40, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_name = values[0]; __pyx_v_comm = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("create", 0, 1, 2, __pyx_nargs); __PYX_ERR(61, 40, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMLabel.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMLabel_6create(((struct PyPetscDMLabelObject *)__pyx_v_self), __pyx_v_name, __pyx_v_comm); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_6create(struct PyPetscDMLabelObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; DMLabel __pyx_v_newdmlabel; char const *__pyx_v_cname; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create", 0); __Pyx_INCREF(__pyx_v_name); /* "petsc4py/PETSc/DMLabel.pyx":57 * * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_SELF) # <<<<<<<<<<<<<< * cdef PetscDMLabel newdmlabel = NULL * cdef const char *cname = NULL */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, PETSC_COMM_SELF); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(61, 57, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/DMLabel.pyx":58 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_SELF) * cdef PetscDMLabel newdmlabel = NULL # <<<<<<<<<<<<<< * cdef const char *cname = NULL * name = str2bytes(name, &cname) */ __pyx_v_newdmlabel = NULL; /* "petsc4py/PETSc/DMLabel.pyx":59 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_SELF) * cdef PetscDMLabel newdmlabel = NULL * cdef const char *cname = NULL # <<<<<<<<<<<<<< * name = str2bytes(name, &cname) * CHKERR( DMLabelCreate(ccomm, cname, &newdmlabel) ) */ __pyx_v_cname = NULL; /* "petsc4py/PETSc/DMLabel.pyx":60 * cdef PetscDMLabel newdmlabel = NULL * cdef const char *cname = NULL * name = str2bytes(name, &cname) # <<<<<<<<<<<<<< * CHKERR( DMLabelCreate(ccomm, cname, &newdmlabel) ) * CHKERR( PetscCLEAR(self.obj) ); self.dmlabel = newdmlabel */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cname)); if (unlikely(!__pyx_t_2)) __PYX_ERR(61, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DMLabel.pyx":61 * cdef const char *cname = NULL * name = str2bytes(name, &cname) * CHKERR( DMLabelCreate(ccomm, cname, &newdmlabel) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.dmlabel = newdmlabel * return self */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMLabelCreate(__pyx_v_ccomm, __pyx_v_cname, (&__pyx_v_newdmlabel))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(61, 61, __pyx_L1_error) /* "petsc4py/PETSc/DMLabel.pyx":62 * name = str2bytes(name, &cname) * CHKERR( DMLabelCreate(ccomm, cname, &newdmlabel) ) * CHKERR( PetscCLEAR(self.obj) ); self.dmlabel = newdmlabel # <<<<<<<<<<<<<< * return self * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(61, 62, __pyx_L1_error) __pyx_v_self->dmlabel = __pyx_v_newdmlabel; /* "petsc4py/PETSc/DMLabel.pyx":63 * CHKERR( DMLabelCreate(ccomm, cname, &newdmlabel) ) * CHKERR( PetscCLEAR(self.obj) ); self.dmlabel = newdmlabel * return self # <<<<<<<<<<<<<< * * def duplicate(self) -> DMLabel: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/DMLabel.pyx":40 * CHKERR( DMLabelView(self.dmlabel, vwr) ) * * def create(self, name: str, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Create a `DMLabel` object, which is a multimap. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMLabel.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMLabel.pyx":65 * return self * * def duplicate(self) -> DMLabel: # <<<<<<<<<<<<<< * """Duplicate the `DMLabel`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_9duplicate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMLabel_8duplicate, "DMLabel.duplicate(self) -> DMLabel\nDuplicate the `DMLabel`.\n\n Collective.\n\n See Also\n --------\n petsc.DMLabelDuplicate\n\n \nSource code at petsc4py/PETSc/DMLabel.pyx:65"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_9duplicate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("duplicate (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("duplicate", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "duplicate", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMLabel_8duplicate(((struct PyPetscDMLabelObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_8duplicate(struct PyPetscDMLabelObject *__pyx_v_self) { struct PyPetscDMLabelObject *__pyx_v_new = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("duplicate", 1); /* "petsc4py/PETSc/DMLabel.pyx":75 * * """ * cdef DMLabel new = DMLabel() # <<<<<<<<<<<<<< * CHKERR( DMLabelDuplicate(self.dmlabel, &new.dmlabel) ) * return new */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DMLabel)); if (unlikely(!__pyx_t_1)) __PYX_ERR(61, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_new = ((struct PyPetscDMLabelObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DMLabel.pyx":76 * """ * cdef DMLabel new = DMLabel() * CHKERR( DMLabelDuplicate(self.dmlabel, &new.dmlabel) ) # <<<<<<<<<<<<<< * return new * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMLabelDuplicate(__pyx_v_self->dmlabel, (&__pyx_v_new->dmlabel))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(61, 76, __pyx_L1_error) /* "petsc4py/PETSc/DMLabel.pyx":77 * cdef DMLabel new = DMLabel() * CHKERR( DMLabelDuplicate(self.dmlabel, &new.dmlabel) ) * return new # <<<<<<<<<<<<<< * * def reset(self) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_new); __pyx_r = ((PyObject *)__pyx_v_new); goto __pyx_L0; /* "petsc4py/PETSc/DMLabel.pyx":65 * return self * * def duplicate(self) -> DMLabel: # <<<<<<<<<<<<<< * """Duplicate the `DMLabel`. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMLabel.duplicate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_new); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMLabel.pyx":79 * return new * * def reset(self) -> None: # <<<<<<<<<<<<<< * """Destroy internal data structures in the `DMLabel`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_11reset(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMLabel_10reset, "DMLabel.reset(self) -> None\nDestroy internal data structures in the `DMLabel`.\n\n Not collective.\n\n See Also\n --------\n petsc.DMLabelReset\n\n \nSource code at petsc4py/PETSc/DMLabel.pyx:79"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_11reset(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("reset (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("reset", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "reset", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMLabel_10reset(((struct PyPetscDMLabelObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_10reset(struct PyPetscDMLabelObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("reset", 1); /* "petsc4py/PETSc/DMLabel.pyx":89 * * """ * CHKERR( DMLabelReset(self.dmlabel) ) # <<<<<<<<<<<<<< * * def insertIS(self, IS iset, value: int) -> Self: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMLabelReset(__pyx_v_self->dmlabel)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(61, 89, __pyx_L1_error) /* "petsc4py/PETSc/DMLabel.pyx":79 * return new * * def reset(self) -> None: # <<<<<<<<<<<<<< * """Destroy internal data structures in the `DMLabel`. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMLabel.reset", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMLabel.pyx":91 * CHKERR( DMLabelReset(self.dmlabel) ) * * def insertIS(self, IS iset, value: int) -> Self: # <<<<<<<<<<<<<< * """Set all points in the `IS` to a value. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_13insertIS(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMLabel_12insertIS, "DMLabel.insertIS(self, iset: IS, value: int) -> Self\nSet all points in the `IS` to a value.\n\n Not collective.\n\n Parameters\n ----------\n iset\n The point IS.\n value\n The point value.\n\n See Also\n --------\n petsc.DMLabelInsertIS\n\n \nSource code at petsc4py/PETSc/DMLabel.pyx:91"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_13insertIS(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscISObject *__pyx_v_iset = 0; PyObject *__pyx_v_value = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("insertIS (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_iset,&__pyx_n_s_value,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_iset)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(61, 91, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(61, 91, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("insertIS", 1, 2, 2, 1); __PYX_ERR(61, 91, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "insertIS") < 0)) __PYX_ERR(61, 91, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_iset = ((struct PyPetscISObject *)values[0]); __pyx_v_value = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("insertIS", 1, 2, 2, __pyx_nargs); __PYX_ERR(61, 91, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMLabel.insertIS", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iset), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "iset", 0))) __PYX_ERR(61, 91, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMLabel_12insertIS(((struct PyPetscDMLabelObject *)__pyx_v_self), __pyx_v_iset, __pyx_v_value); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_12insertIS(struct PyPetscDMLabelObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset, PyObject *__pyx_v_value) { PetscInt __pyx_v_cvalue; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("insertIS", 1); /* "petsc4py/PETSc/DMLabel.pyx":108 * * """ * cdef PetscInt cvalue = asInt(value) # <<<<<<<<<<<<<< * CHKERR( DMLabelInsertIS(self.dmlabel, iset.iset, cvalue) ) * return self */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_value); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(61, 108, __pyx_L1_error) __pyx_v_cvalue = __pyx_t_1; /* "petsc4py/PETSc/DMLabel.pyx":109 * """ * cdef PetscInt cvalue = asInt(value) * CHKERR( DMLabelInsertIS(self.dmlabel, iset.iset, cvalue) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMLabelInsertIS(__pyx_v_self->dmlabel, __pyx_v_iset->iset, __pyx_v_cvalue)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(61, 109, __pyx_L1_error) /* "petsc4py/PETSc/DMLabel.pyx":110 * cdef PetscInt cvalue = asInt(value) * CHKERR( DMLabelInsertIS(self.dmlabel, iset.iset, cvalue) ) * return self # <<<<<<<<<<<<<< * * def setValue(self, point: int, value: int) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/DMLabel.pyx":91 * CHKERR( DMLabelReset(self.dmlabel) ) * * def insertIS(self, IS iset, value: int) -> Self: # <<<<<<<<<<<<<< * """Set all points in the `IS` to a value. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMLabel.insertIS", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMLabel.pyx":112 * return self * * def setValue(self, point: int, value: int) -> None: # <<<<<<<<<<<<<< * """Set the value a label assigns to a point. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_15setValue(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMLabel_14setValue, "DMLabel.setValue(self, point: int, value: int) -> None\nSet the value a label assigns to a point.\n\n Not collective.\n\n If the value is the same as the label's default value (which is\n initially ``-1``, and can be changed with `setDefaultValue`), this\n function will do nothing.\n\n Parameters\n ----------\n point\n The point.\n value\n The point value.\n\n See Also\n --------\n getValue, setDefaultValue, petsc.DMLabelSetValue\n\n \nSource code at petsc4py/PETSc/DMLabel.pyx:112"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_15setValue(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_point = 0; PyObject *__pyx_v_value = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setValue (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,&__pyx_n_s_value,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_point)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(61, 112, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(61, 112, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setValue", 1, 2, 2, 1); __PYX_ERR(61, 112, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setValue") < 0)) __PYX_ERR(61, 112, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_point = values[0]; __pyx_v_value = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setValue", 1, 2, 2, __pyx_nargs); __PYX_ERR(61, 112, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMLabel.setValue", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMLabel_14setValue(((struct PyPetscDMLabelObject *)__pyx_v_self), __pyx_v_point, __pyx_v_value); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_14setValue(struct PyPetscDMLabelObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_value) { PetscInt __pyx_v_cpoint; PetscInt __pyx_v_cvalue; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setValue", 1); /* "petsc4py/PETSc/DMLabel.pyx":133 * * """ * cdef PetscInt cpoint = asInt(point) # <<<<<<<<<<<<<< * cdef PetscInt cvalue = asInt(value) * CHKERR( DMLabelSetValue(self.dmlabel, cpoint, cvalue) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_point); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(61, 133, __pyx_L1_error) __pyx_v_cpoint = __pyx_t_1; /* "petsc4py/PETSc/DMLabel.pyx":134 * """ * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cvalue = asInt(value) # <<<<<<<<<<<<<< * CHKERR( DMLabelSetValue(self.dmlabel, cpoint, cvalue) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_value); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(61, 134, __pyx_L1_error) __pyx_v_cvalue = __pyx_t_1; /* "petsc4py/PETSc/DMLabel.pyx":135 * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cvalue = asInt(value) * CHKERR( DMLabelSetValue(self.dmlabel, cpoint, cvalue) ) # <<<<<<<<<<<<<< * * def getValue(self, point: int) -> int: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMLabelSetValue(__pyx_v_self->dmlabel, __pyx_v_cpoint, __pyx_v_cvalue)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(61, 135, __pyx_L1_error) /* "petsc4py/PETSc/DMLabel.pyx":112 * return self * * def setValue(self, point: int, value: int) -> None: # <<<<<<<<<<<<<< * """Set the value a label assigns to a point. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMLabel.setValue", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMLabel.pyx":137 * CHKERR( DMLabelSetValue(self.dmlabel, cpoint, cvalue) ) * * def getValue(self, point: int) -> int: # <<<<<<<<<<<<<< * """Return the value a label assigns to a point. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_17getValue(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMLabel_16getValue, "DMLabel.getValue(self, point: int) -> int\nReturn the value a label assigns to a point.\n\n Not collective.\n\n If no value was assigned, a default value will be returned\n The default value, initially ``-1``, can be changed with\n `setDefaultValue`.\n\n Parameters\n ----------\n point\n The point.\n\n See Also\n --------\n setValue, setDefaultValue, petsc.DMLabelGetValue\n\n \nSource code at petsc4py/PETSc/DMLabel.pyx:137"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_17getValue(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_point = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getValue (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_point)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(61, 137, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getValue") < 0)) __PYX_ERR(61, 137, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_point = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getValue", 1, 1, 1, __pyx_nargs); __PYX_ERR(61, 137, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMLabel.getValue", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMLabel_16getValue(((struct PyPetscDMLabelObject *)__pyx_v_self), __pyx_v_point); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_16getValue(struct PyPetscDMLabelObject *__pyx_v_self, PyObject *__pyx_v_point) { PetscInt __pyx_v_cpoint; PetscInt __pyx_v_cvalue; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getValue", 1); /* "petsc4py/PETSc/DMLabel.pyx":156 * * """ * cdef PetscInt cpoint = asInt(point) # <<<<<<<<<<<<<< * cdef PetscInt cvalue = 0 * CHKERR( DMLabelGetValue(self.dmlabel, cpoint, &cvalue) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_point); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(61, 156, __pyx_L1_error) __pyx_v_cpoint = __pyx_t_1; /* "petsc4py/PETSc/DMLabel.pyx":157 * """ * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cvalue = 0 # <<<<<<<<<<<<<< * CHKERR( DMLabelGetValue(self.dmlabel, cpoint, &cvalue) ) * return toInt(cvalue) */ __pyx_v_cvalue = 0; /* "petsc4py/PETSc/DMLabel.pyx":158 * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cvalue = 0 * CHKERR( DMLabelGetValue(self.dmlabel, cpoint, &cvalue) ) # <<<<<<<<<<<<<< * return toInt(cvalue) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMLabelGetValue(__pyx_v_self->dmlabel, __pyx_v_cpoint, (&__pyx_v_cvalue))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(61, 158, __pyx_L1_error) /* "petsc4py/PETSc/DMLabel.pyx":159 * cdef PetscInt cvalue = 0 * CHKERR( DMLabelGetValue(self.dmlabel, cpoint, &cvalue) ) * return toInt(cvalue) # <<<<<<<<<<<<<< * * def getDefaultValue(self) -> int: */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_cvalue); if (unlikely(!__pyx_t_3)) __PYX_ERR(61, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMLabel.pyx":137 * CHKERR( DMLabelSetValue(self.dmlabel, cpoint, cvalue) ) * * def getValue(self, point: int) -> int: # <<<<<<<<<<<<<< * """Return the value a label assigns to a point. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMLabel.getValue", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMLabel.pyx":161 * return toInt(cvalue) * * def getDefaultValue(self) -> int: # <<<<<<<<<<<<<< * """Return the default value returned by `getValue`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_19getDefaultValue(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMLabel_18getDefaultValue, "DMLabel.getDefaultValue(self) -> int\nReturn the default value returned by `getValue`.\n\n Not collective.\n\n The default value is returned if a point has not been explicitly given\n a value. When a label is created, it is initialized to ``-1``.\n\n See Also\n --------\n setDefaultValue, petsc.DMLabelGetDefaultValue\n\n \nSource code at petsc4py/PETSc/DMLabel.pyx:161"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_19getDefaultValue(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getDefaultValue (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getDefaultValue", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getDefaultValue", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMLabel_18getDefaultValue(((struct PyPetscDMLabelObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_18getDefaultValue(struct PyPetscDMLabelObject *__pyx_v_self) { PetscInt __pyx_v_cvalue; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getDefaultValue", 1); /* "petsc4py/PETSc/DMLabel.pyx":174 * * """ * cdef PetscInt cvalue = 0 # <<<<<<<<<<<<<< * CHKERR( DMLabelGetDefaultValue(self.dmlabel, &cvalue) ) * return toInt(cvalue) */ __pyx_v_cvalue = 0; /* "petsc4py/PETSc/DMLabel.pyx":175 * """ * cdef PetscInt cvalue = 0 * CHKERR( DMLabelGetDefaultValue(self.dmlabel, &cvalue) ) # <<<<<<<<<<<<<< * return toInt(cvalue) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMLabelGetDefaultValue(__pyx_v_self->dmlabel, (&__pyx_v_cvalue))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(61, 175, __pyx_L1_error) /* "petsc4py/PETSc/DMLabel.pyx":176 * cdef PetscInt cvalue = 0 * CHKERR( DMLabelGetDefaultValue(self.dmlabel, &cvalue) ) * return toInt(cvalue) # <<<<<<<<<<<<<< * * def setDefaultValue(self, value: int) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_cvalue); if (unlikely(!__pyx_t_2)) __PYX_ERR(61, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMLabel.pyx":161 * return toInt(cvalue) * * def getDefaultValue(self) -> int: # <<<<<<<<<<<<<< * """Return the default value returned by `getValue`. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMLabel.getDefaultValue", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMLabel.pyx":178 * return toInt(cvalue) * * def setDefaultValue(self, value: int) -> None: # <<<<<<<<<<<<<< * """Set the default value returned by `getValue`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_21setDefaultValue(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMLabel_20setDefaultValue, "DMLabel.setDefaultValue(self, value: int) -> None\nSet the default value returned by `getValue`.\n\n Not collective.\n\n The value is used if a point has not been explicitly given a value.\n When a label is created, the default value is initialized to ``-1``.\n\n Parameters\n ----------\n value\n The default value.\n\n See Also\n --------\n getDefaultValue, petsc.DMLabelSetDefaultValue\n\n \nSource code at petsc4py/PETSc/DMLabel.pyx:178"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_21setDefaultValue(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_value = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setDefaultValue (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_value,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(61, 178, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setDefaultValue") < 0)) __PYX_ERR(61, 178, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_value = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setDefaultValue", 1, 1, 1, __pyx_nargs); __PYX_ERR(61, 178, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMLabel.setDefaultValue", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMLabel_20setDefaultValue(((struct PyPetscDMLabelObject *)__pyx_v_self), __pyx_v_value); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_20setDefaultValue(struct PyPetscDMLabelObject *__pyx_v_self, PyObject *__pyx_v_value) { PetscInt __pyx_v_cvalue; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setDefaultValue", 1); /* "petsc4py/PETSc/DMLabel.pyx":196 * * """ * cdef PetscInt cvalue = asInt(value) # <<<<<<<<<<<<<< * CHKERR( DMLabelSetDefaultValue(self.dmlabel, cvalue) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_value); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(61, 196, __pyx_L1_error) __pyx_v_cvalue = __pyx_t_1; /* "petsc4py/PETSc/DMLabel.pyx":197 * """ * cdef PetscInt cvalue = asInt(value) * CHKERR( DMLabelSetDefaultValue(self.dmlabel, cvalue) ) # <<<<<<<<<<<<<< * * def clearValue(self, point: int, value: int) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMLabelSetDefaultValue(__pyx_v_self->dmlabel, __pyx_v_cvalue)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(61, 197, __pyx_L1_error) /* "petsc4py/PETSc/DMLabel.pyx":178 * return toInt(cvalue) * * def setDefaultValue(self, value: int) -> None: # <<<<<<<<<<<<<< * """Set the default value returned by `getValue`. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMLabel.setDefaultValue", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMLabel.pyx":199 * CHKERR( DMLabelSetDefaultValue(self.dmlabel, cvalue) ) * * def clearValue(self, point: int, value: int) -> None: # <<<<<<<<<<<<<< * """Clear the value a label assigns to a point. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_23clearValue(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMLabel_22clearValue, "DMLabel.clearValue(self, point: int, value: int) -> None\nClear the value a label assigns to a point.\n\n Not collective.\n\n Parameters\n ----------\n point\n The point.\n value\n The point value.\n\n See Also\n --------\n petsc.DMLabelClearValue\n\n \nSource code at petsc4py/PETSc/DMLabel.pyx:199"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_23clearValue(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_point = 0; PyObject *__pyx_v_value = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("clearValue (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,&__pyx_n_s_value,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_point)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(61, 199, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(61, 199, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("clearValue", 1, 2, 2, 1); __PYX_ERR(61, 199, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "clearValue") < 0)) __PYX_ERR(61, 199, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_point = values[0]; __pyx_v_value = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("clearValue", 1, 2, 2, __pyx_nargs); __PYX_ERR(61, 199, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMLabel.clearValue", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMLabel_22clearValue(((struct PyPetscDMLabelObject *)__pyx_v_self), __pyx_v_point, __pyx_v_value); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_22clearValue(struct PyPetscDMLabelObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_value) { PetscInt __pyx_v_cpoint; PetscInt __pyx_v_cvalue; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("clearValue", 1); /* "petsc4py/PETSc/DMLabel.pyx":216 * * """ * cdef PetscInt cpoint = asInt(point) # <<<<<<<<<<<<<< * cdef PetscInt cvalue = asInt(value) * CHKERR( DMLabelClearValue(self.dmlabel, cpoint, cvalue) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_point); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(61, 216, __pyx_L1_error) __pyx_v_cpoint = __pyx_t_1; /* "petsc4py/PETSc/DMLabel.pyx":217 * """ * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cvalue = asInt(value) # <<<<<<<<<<<<<< * CHKERR( DMLabelClearValue(self.dmlabel, cpoint, cvalue) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_value); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(61, 217, __pyx_L1_error) __pyx_v_cvalue = __pyx_t_1; /* "petsc4py/PETSc/DMLabel.pyx":218 * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cvalue = asInt(value) * CHKERR( DMLabelClearValue(self.dmlabel, cpoint, cvalue) ) # <<<<<<<<<<<<<< * * def addStratum(self, value: int) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMLabelClearValue(__pyx_v_self->dmlabel, __pyx_v_cpoint, __pyx_v_cvalue)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(61, 218, __pyx_L1_error) /* "petsc4py/PETSc/DMLabel.pyx":199 * CHKERR( DMLabelSetDefaultValue(self.dmlabel, cvalue) ) * * def clearValue(self, point: int, value: int) -> None: # <<<<<<<<<<<<<< * """Clear the value a label assigns to a point. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMLabel.clearValue", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMLabel.pyx":220 * CHKERR( DMLabelClearValue(self.dmlabel, cpoint, cvalue) ) * * def addStratum(self, value: int) -> None: # <<<<<<<<<<<<<< * """Add a new stratum value in a `DMLabel`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_25addStratum(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMLabel_24addStratum, "DMLabel.addStratum(self, value: int) -> None\nAdd a new stratum value in a `DMLabel`.\n\n Parameters\n ----------\n value\n The stratum value.\n\n See Also\n --------\n addStrata, addStrataIS, petsc.DMLabelAddStratum\n\n \nSource code at petsc4py/PETSc/DMLabel.pyx:220"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_25addStratum(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_value = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("addStratum (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_value,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(61, 220, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "addStratum") < 0)) __PYX_ERR(61, 220, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_value = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("addStratum", 1, 1, 1, __pyx_nargs); __PYX_ERR(61, 220, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMLabel.addStratum", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMLabel_24addStratum(((struct PyPetscDMLabelObject *)__pyx_v_self), __pyx_v_value); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_24addStratum(struct PyPetscDMLabelObject *__pyx_v_self, PyObject *__pyx_v_value) { PetscInt __pyx_v_cvalue; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("addStratum", 1); /* "petsc4py/PETSc/DMLabel.pyx":233 * * """ * cdef PetscInt cvalue = asInt(value) # <<<<<<<<<<<<<< * CHKERR( DMLabelAddStratum(self.dmlabel, cvalue) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_value); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(61, 233, __pyx_L1_error) __pyx_v_cvalue = __pyx_t_1; /* "petsc4py/PETSc/DMLabel.pyx":234 * """ * cdef PetscInt cvalue = asInt(value) * CHKERR( DMLabelAddStratum(self.dmlabel, cvalue) ) # <<<<<<<<<<<<<< * * def addStrata(self, strata: Sequence[int]) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMLabelAddStratum(__pyx_v_self->dmlabel, __pyx_v_cvalue)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(61, 234, __pyx_L1_error) /* "petsc4py/PETSc/DMLabel.pyx":220 * CHKERR( DMLabelClearValue(self.dmlabel, cpoint, cvalue) ) * * def addStratum(self, value: int) -> None: # <<<<<<<<<<<<<< * """Add a new stratum value in a `DMLabel`. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMLabel.addStratum", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMLabel.pyx":236 * CHKERR( DMLabelAddStratum(self.dmlabel, cvalue) ) * * def addStrata(self, strata: Sequence[int]) -> None: # <<<<<<<<<<<<<< * """Add new stratum values in a `DMLabel`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_27addStrata(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMLabel_26addStrata, "DMLabel.addStrata(self, strata: Sequence[int]) -> None\nAdd new stratum values in a `DMLabel`.\n\n Not collective.\n\n Parameters\n ----------\n strata\n The stratum values.\n\n See Also\n --------\n addStrataIS, addStratum, petsc.DMLabelAddStrata\n\n \nSource code at petsc4py/PETSc/DMLabel.pyx:236"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_27addStrata(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_strata = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("addStrata (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_strata,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_strata)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(61, 236, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "addStrata") < 0)) __PYX_ERR(61, 236, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_strata = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("addStrata", 1, 1, 1, __pyx_nargs); __PYX_ERR(61, 236, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMLabel.addStrata", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMLabel_26addStrata(((struct PyPetscDMLabelObject *)__pyx_v_self), __pyx_v_strata); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_26addStrata(struct PyPetscDMLabelObject *__pyx_v_self, PyObject *__pyx_v_strata) { PetscInt *__pyx_v_istrata; PetscInt __pyx_v_numStrata; CYTHON_UNUSED PyArrayObject *__pyx_v_fields = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("addStrata", 1); /* "petsc4py/PETSc/DMLabel.pyx":251 * * """ * cdef PetscInt *istrata = NULL # <<<<<<<<<<<<<< * cdef PetscInt numStrata = 0 * fields = iarray_i(strata, &numStrata, &istrata) */ __pyx_v_istrata = NULL; /* "petsc4py/PETSc/DMLabel.pyx":252 * """ * cdef PetscInt *istrata = NULL * cdef PetscInt numStrata = 0 # <<<<<<<<<<<<<< * fields = iarray_i(strata, &numStrata, &istrata) * CHKERR( DMLabelAddStrata(self.dmlabel, numStrata, istrata) ) */ __pyx_v_numStrata = 0; /* "petsc4py/PETSc/DMLabel.pyx":253 * cdef PetscInt *istrata = NULL * cdef PetscInt numStrata = 0 * fields = iarray_i(strata, &numStrata, &istrata) # <<<<<<<<<<<<<< * CHKERR( DMLabelAddStrata(self.dmlabel, numStrata, istrata) ) * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_strata, (&__pyx_v_numStrata), (&__pyx_v_istrata))); if (unlikely(!__pyx_t_1)) __PYX_ERR(61, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_fields = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DMLabel.pyx":254 * cdef PetscInt numStrata = 0 * fields = iarray_i(strata, &numStrata, &istrata) * CHKERR( DMLabelAddStrata(self.dmlabel, numStrata, istrata) ) # <<<<<<<<<<<<<< * * def addStrataIS(self, IS iset) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMLabelAddStrata(__pyx_v_self->dmlabel, __pyx_v_numStrata, __pyx_v_istrata)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(61, 254, __pyx_L1_error) /* "petsc4py/PETSc/DMLabel.pyx":236 * CHKERR( DMLabelAddStratum(self.dmlabel, cvalue) ) * * def addStrata(self, strata: Sequence[int]) -> None: # <<<<<<<<<<<<<< * """Add new stratum values in a `DMLabel`. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMLabel.addStrata", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_fields); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMLabel.pyx":256 * CHKERR( DMLabelAddStrata(self.dmlabel, numStrata, istrata) ) * * def addStrataIS(self, IS iset) -> None: # <<<<<<<<<<<<<< * """Add new stratum values in a `DMLabel`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_29addStrataIS(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMLabel_28addStrataIS, "DMLabel.addStrataIS(self, iset: IS) -> None\nAdd new stratum values in a `DMLabel`.\n\n Not collective.\n\n Parameters\n ----------\n iset\n Index set with stratum values.\n\n See Also\n --------\n addStrata, addStratum, petsc.DMLabelAddStrataIS\n\n \nSource code at petsc4py/PETSc/DMLabel.pyx:256"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_29addStrataIS(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscISObject *__pyx_v_iset = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("addStrataIS (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_iset,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_iset)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(61, 256, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "addStrataIS") < 0)) __PYX_ERR(61, 256, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_iset = ((struct PyPetscISObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("addStrataIS", 1, 1, 1, __pyx_nargs); __PYX_ERR(61, 256, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMLabel.addStrataIS", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iset), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "iset", 0))) __PYX_ERR(61, 256, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMLabel_28addStrataIS(((struct PyPetscDMLabelObject *)__pyx_v_self), __pyx_v_iset); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_28addStrataIS(struct PyPetscDMLabelObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("addStrataIS", 1); /* "petsc4py/PETSc/DMLabel.pyx":271 * * """ * CHKERR( DMLabelAddStrataIS(self.dmlabel, iset.iset) ) # <<<<<<<<<<<<<< * * def getNumValues(self) -> int: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMLabelAddStrataIS(__pyx_v_self->dmlabel, __pyx_v_iset->iset)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(61, 271, __pyx_L1_error) /* "petsc4py/PETSc/DMLabel.pyx":256 * CHKERR( DMLabelAddStrata(self.dmlabel, numStrata, istrata) ) * * def addStrataIS(self, IS iset) -> None: # <<<<<<<<<<<<<< * """Add new stratum values in a `DMLabel`. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMLabel.addStrataIS", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMLabel.pyx":273 * CHKERR( DMLabelAddStrataIS(self.dmlabel, iset.iset) ) * * def getNumValues(self) -> int: # <<<<<<<<<<<<<< * """Return the number of values that the `DMLabel` takes. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_31getNumValues(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMLabel_30getNumValues, "DMLabel.getNumValues(self) -> int\nReturn the number of values that the `DMLabel` takes.\n\n Not collective.\n\n See Also\n --------\n petsc.DMLabelGetNumValues\n\n \nSource code at petsc4py/PETSc/DMLabel.pyx:273"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_31getNumValues(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getNumValues (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getNumValues", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getNumValues", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMLabel_30getNumValues(((struct PyPetscDMLabelObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_30getNumValues(struct PyPetscDMLabelObject *__pyx_v_self) { PetscInt __pyx_v_numValues; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getNumValues", 1); /* "petsc4py/PETSc/DMLabel.pyx":283 * * """ * cdef PetscInt numValues = 0 # <<<<<<<<<<<<<< * CHKERR( DMLabelGetNumValues(self.dmlabel, &numValues) ) * return toInt(numValues) */ __pyx_v_numValues = 0; /* "petsc4py/PETSc/DMLabel.pyx":284 * """ * cdef PetscInt numValues = 0 * CHKERR( DMLabelGetNumValues(self.dmlabel, &numValues) ) # <<<<<<<<<<<<<< * return toInt(numValues) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMLabelGetNumValues(__pyx_v_self->dmlabel, (&__pyx_v_numValues))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(61, 284, __pyx_L1_error) /* "petsc4py/PETSc/DMLabel.pyx":285 * cdef PetscInt numValues = 0 * CHKERR( DMLabelGetNumValues(self.dmlabel, &numValues) ) * return toInt(numValues) # <<<<<<<<<<<<<< * * def getValueIS(self) -> IS: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_numValues); if (unlikely(!__pyx_t_2)) __PYX_ERR(61, 285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMLabel.pyx":273 * CHKERR( DMLabelAddStrataIS(self.dmlabel, iset.iset) ) * * def getNumValues(self) -> int: # <<<<<<<<<<<<<< * """Return the number of values that the `DMLabel` takes. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMLabel.getNumValues", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMLabel.pyx":287 * return toInt(numValues) * * def getValueIS(self) -> IS: # <<<<<<<<<<<<<< * """Return an `IS` of all values that the `DMLabel` takes. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_33getValueIS(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMLabel_32getValueIS, "DMLabel.getValueIS(self) -> IS\nReturn an `IS` of all values that the `DMLabel` takes.\n\n Not collective.\n\n See Also\n --------\n petsc.DMLabelGetValueIS\n\n \nSource code at petsc4py/PETSc/DMLabel.pyx:287"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_33getValueIS(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getValueIS (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getValueIS", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getValueIS", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMLabel_32getValueIS(((struct PyPetscDMLabelObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_32getValueIS(struct PyPetscDMLabelObject *__pyx_v_self) { struct PyPetscISObject *__pyx_v_iset = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getValueIS", 1); /* "petsc4py/PETSc/DMLabel.pyx":297 * * """ * cdef IS iset = IS() # <<<<<<<<<<<<<< * CHKERR( DMLabelGetValueIS(self.dmlabel, &iset.iset) ) * return iset */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_1)) __PYX_ERR(61, 297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_iset = ((struct PyPetscISObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DMLabel.pyx":298 * """ * cdef IS iset = IS() * CHKERR( DMLabelGetValueIS(self.dmlabel, &iset.iset) ) # <<<<<<<<<<<<<< * return iset * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMLabelGetValueIS(__pyx_v_self->dmlabel, (&__pyx_v_iset->iset))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(61, 298, __pyx_L1_error) /* "petsc4py/PETSc/DMLabel.pyx":299 * cdef IS iset = IS() * CHKERR( DMLabelGetValueIS(self.dmlabel, &iset.iset) ) * return iset # <<<<<<<<<<<<<< * * def stratumHasPoint(self, value: int, point: int) -> bool: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_iset); __pyx_r = ((PyObject *)__pyx_v_iset); goto __pyx_L0; /* "petsc4py/PETSc/DMLabel.pyx":287 * return toInt(numValues) * * def getValueIS(self) -> IS: # <<<<<<<<<<<<<< * """Return an `IS` of all values that the `DMLabel` takes. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMLabel.getValueIS", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_iset); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMLabel.pyx":301 * return iset * * def stratumHasPoint(self, value: int, point: int) -> bool: # <<<<<<<<<<<<<< * """Return whether the stratum contains a point. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_35stratumHasPoint(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMLabel_34stratumHasPoint, "DMLabel.stratumHasPoint(self, value: int, point: int) -> bool\nReturn whether the stratum contains a point.\n\n Not collective.\n\n Parameters\n ----------\n value\n The stratum value.\n point\n The point.\n\n See Also\n --------\n petsc.DMLabelStratumHasPoint\n\n \nSource code at petsc4py/PETSc/DMLabel.pyx:301"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_35stratumHasPoint(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_value = 0; PyObject *__pyx_v_point = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("stratumHasPoint (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_value,&__pyx_n_s_point,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(61, 301, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_point)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(61, 301, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("stratumHasPoint", 1, 2, 2, 1); __PYX_ERR(61, 301, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "stratumHasPoint") < 0)) __PYX_ERR(61, 301, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_value = values[0]; __pyx_v_point = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("stratumHasPoint", 1, 2, 2, __pyx_nargs); __PYX_ERR(61, 301, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMLabel.stratumHasPoint", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMLabel_34stratumHasPoint(((struct PyPetscDMLabelObject *)__pyx_v_self), __pyx_v_value, __pyx_v_point); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_34stratumHasPoint(struct PyPetscDMLabelObject *__pyx_v_self, PyObject *__pyx_v_value, PyObject *__pyx_v_point) { PetscInt __pyx_v_cpoint; PetscInt __pyx_v_cvalue; PetscBool __pyx_v_ccontains; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("stratumHasPoint", 1); /* "petsc4py/PETSc/DMLabel.pyx":318 * * """ * cdef PetscInt cpoint = asInt(point) # <<<<<<<<<<<<<< * cdef PetscInt cvalue = asInt(value) * cdef PetscBool ccontains = PETSC_FALSE */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_point); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(61, 318, __pyx_L1_error) __pyx_v_cpoint = __pyx_t_1; /* "petsc4py/PETSc/DMLabel.pyx":319 * """ * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cvalue = asInt(value) # <<<<<<<<<<<<<< * cdef PetscBool ccontains = PETSC_FALSE * CHKERR( DMLabelStratumHasPoint(self.dmlabel, cvalue, cpoint, &ccontains) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_value); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(61, 319, __pyx_L1_error) __pyx_v_cvalue = __pyx_t_1; /* "petsc4py/PETSc/DMLabel.pyx":320 * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cvalue = asInt(value) * cdef PetscBool ccontains = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( DMLabelStratumHasPoint(self.dmlabel, cvalue, cpoint, &ccontains) ) * return toBool(ccontains) */ __pyx_v_ccontains = PETSC_FALSE; /* "petsc4py/PETSc/DMLabel.pyx":321 * cdef PetscInt cvalue = asInt(value) * cdef PetscBool ccontains = PETSC_FALSE * CHKERR( DMLabelStratumHasPoint(self.dmlabel, cvalue, cpoint, &ccontains) ) # <<<<<<<<<<<<<< * return toBool(ccontains) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMLabelStratumHasPoint(__pyx_v_self->dmlabel, __pyx_v_cvalue, __pyx_v_cpoint, (&__pyx_v_ccontains))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(61, 321, __pyx_L1_error) /* "petsc4py/PETSc/DMLabel.pyx":322 * cdef PetscBool ccontains = PETSC_FALSE * CHKERR( DMLabelStratumHasPoint(self.dmlabel, cvalue, cpoint, &ccontains) ) * return toBool(ccontains) # <<<<<<<<<<<<<< * * def hasStratum(self, value: int) -> bool: */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_ccontains); if (unlikely(!__pyx_t_3)) __PYX_ERR(61, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMLabel.pyx":301 * return iset * * def stratumHasPoint(self, value: int, point: int) -> bool: # <<<<<<<<<<<<<< * """Return whether the stratum contains a point. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMLabel.stratumHasPoint", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMLabel.pyx":324 * return toBool(ccontains) * * def hasStratum(self, value: int) -> bool: # <<<<<<<<<<<<<< * """Determine whether points exist with the given value. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_37hasStratum(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMLabel_36hasStratum, "DMLabel.hasStratum(self, value: int) -> bool\nDetermine whether points exist with the given value.\n\n Not collective.\n\n Parameters\n ----------\n value\n The stratum value.\n\n See Also\n --------\n petsc.DMLabelHasStratum\n\n \nSource code at petsc4py/PETSc/DMLabel.pyx:324"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_37hasStratum(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_value = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("hasStratum (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_value,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(61, 324, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "hasStratum") < 0)) __PYX_ERR(61, 324, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_value = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("hasStratum", 1, 1, 1, __pyx_nargs); __PYX_ERR(61, 324, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMLabel.hasStratum", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMLabel_36hasStratum(((struct PyPetscDMLabelObject *)__pyx_v_self), __pyx_v_value); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_36hasStratum(struct PyPetscDMLabelObject *__pyx_v_self, PyObject *__pyx_v_value) { PetscInt __pyx_v_cvalue; PetscBool __pyx_v_cexists; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("hasStratum", 1); /* "petsc4py/PETSc/DMLabel.pyx":339 * * """ * cdef PetscInt cvalue = asInt(value) # <<<<<<<<<<<<<< * cdef PetscBool cexists = PETSC_FALSE * CHKERR( DMLabelHasStratum(self.dmlabel, cvalue, &cexists) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_value); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(61, 339, __pyx_L1_error) __pyx_v_cvalue = __pyx_t_1; /* "petsc4py/PETSc/DMLabel.pyx":340 * """ * cdef PetscInt cvalue = asInt(value) * cdef PetscBool cexists = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( DMLabelHasStratum(self.dmlabel, cvalue, &cexists) ) * return toBool(cexists) */ __pyx_v_cexists = PETSC_FALSE; /* "petsc4py/PETSc/DMLabel.pyx":341 * cdef PetscInt cvalue = asInt(value) * cdef PetscBool cexists = PETSC_FALSE * CHKERR( DMLabelHasStratum(self.dmlabel, cvalue, &cexists) ) # <<<<<<<<<<<<<< * return toBool(cexists) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMLabelHasStratum(__pyx_v_self->dmlabel, __pyx_v_cvalue, (&__pyx_v_cexists))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(61, 341, __pyx_L1_error) /* "petsc4py/PETSc/DMLabel.pyx":342 * cdef PetscBool cexists = PETSC_FALSE * CHKERR( DMLabelHasStratum(self.dmlabel, cvalue, &cexists) ) * return toBool(cexists) # <<<<<<<<<<<<<< * * def getStratumSize(self, stratum: int) -> int: */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_cexists); if (unlikely(!__pyx_t_3)) __PYX_ERR(61, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMLabel.pyx":324 * return toBool(ccontains) * * def hasStratum(self, value: int) -> bool: # <<<<<<<<<<<<<< * """Determine whether points exist with the given value. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMLabel.hasStratum", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMLabel.pyx":344 * return toBool(cexists) * * def getStratumSize(self, stratum: int) -> int: # <<<<<<<<<<<<<< * """Return the size of a stratum. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_39getStratumSize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMLabel_38getStratumSize, "DMLabel.getStratumSize(self, stratum: int) -> int\nReturn the size of a stratum.\n\n Not collective.\n\n Parameters\n ----------\n stratum\n The stratum value.\n\n See Also\n --------\n petsc.DMLabelGetStratumSize\n\n \nSource code at petsc4py/PETSc/DMLabel.pyx:344"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_39getStratumSize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_stratum = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getStratumSize (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stratum,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_stratum)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(61, 344, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getStratumSize") < 0)) __PYX_ERR(61, 344, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_stratum = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getStratumSize", 1, 1, 1, __pyx_nargs); __PYX_ERR(61, 344, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMLabel.getStratumSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMLabel_38getStratumSize(((struct PyPetscDMLabelObject *)__pyx_v_self), __pyx_v_stratum); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_38getStratumSize(struct PyPetscDMLabelObject *__pyx_v_self, PyObject *__pyx_v_stratum) { PetscInt __pyx_v_cstratum; PetscInt __pyx_v_csize; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getStratumSize", 1); /* "petsc4py/PETSc/DMLabel.pyx":359 * * """ * cdef PetscInt cstratum = asInt(stratum) # <<<<<<<<<<<<<< * cdef PetscInt csize = 0 * CHKERR( DMLabelGetStratumSize(self.dmlabel, cstratum, &csize) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_stratum); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(61, 359, __pyx_L1_error) __pyx_v_cstratum = __pyx_t_1; /* "petsc4py/PETSc/DMLabel.pyx":360 * """ * cdef PetscInt cstratum = asInt(stratum) * cdef PetscInt csize = 0 # <<<<<<<<<<<<<< * CHKERR( DMLabelGetStratumSize(self.dmlabel, cstratum, &csize) ) * return toInt(csize) */ __pyx_v_csize = 0; /* "petsc4py/PETSc/DMLabel.pyx":361 * cdef PetscInt cstratum = asInt(stratum) * cdef PetscInt csize = 0 * CHKERR( DMLabelGetStratumSize(self.dmlabel, cstratum, &csize) ) # <<<<<<<<<<<<<< * return toInt(csize) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMLabelGetStratumSize(__pyx_v_self->dmlabel, __pyx_v_cstratum, (&__pyx_v_csize))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(61, 361, __pyx_L1_error) /* "petsc4py/PETSc/DMLabel.pyx":362 * cdef PetscInt csize = 0 * CHKERR( DMLabelGetStratumSize(self.dmlabel, cstratum, &csize) ) * return toInt(csize) # <<<<<<<<<<<<<< * * def getStratumIS(self, stratum: int) -> IS: */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_csize); if (unlikely(!__pyx_t_3)) __PYX_ERR(61, 362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMLabel.pyx":344 * return toBool(cexists) * * def getStratumSize(self, stratum: int) -> int: # <<<<<<<<<<<<<< * """Return the size of a stratum. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMLabel.getStratumSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMLabel.pyx":364 * return toInt(csize) * * def getStratumIS(self, stratum: int) -> IS: # <<<<<<<<<<<<<< * """Return an `IS` with the stratum points. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_41getStratumIS(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMLabel_40getStratumIS, "DMLabel.getStratumIS(self, stratum: int) -> IS\nReturn an `IS` with the stratum points.\n\n Not collective.\n\n Parameters\n ----------\n stratum\n The stratum value.\n\n See Also\n --------\n setStratumIS, petsc.DMLabelGetStratumIS\n\n \nSource code at petsc4py/PETSc/DMLabel.pyx:364"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_41getStratumIS(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_stratum = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getStratumIS (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stratum,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_stratum)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(61, 364, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getStratumIS") < 0)) __PYX_ERR(61, 364, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_stratum = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getStratumIS", 1, 1, 1, __pyx_nargs); __PYX_ERR(61, 364, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMLabel.getStratumIS", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMLabel_40getStratumIS(((struct PyPetscDMLabelObject *)__pyx_v_self), __pyx_v_stratum); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_40getStratumIS(struct PyPetscDMLabelObject *__pyx_v_self, PyObject *__pyx_v_stratum) { PetscInt __pyx_v_cstratum; struct PyPetscISObject *__pyx_v_iset = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getStratumIS", 1); /* "petsc4py/PETSc/DMLabel.pyx":379 * * """ * cdef PetscInt cstratum = asInt(stratum) # <<<<<<<<<<<<<< * cdef IS iset = IS() * CHKERR( DMLabelGetStratumIS(self.dmlabel, cstratum, &iset.iset) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_stratum); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(61, 379, __pyx_L1_error) __pyx_v_cstratum = __pyx_t_1; /* "petsc4py/PETSc/DMLabel.pyx":380 * """ * cdef PetscInt cstratum = asInt(stratum) * cdef IS iset = IS() # <<<<<<<<<<<<<< * CHKERR( DMLabelGetStratumIS(self.dmlabel, cstratum, &iset.iset) ) * return iset */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_2)) __PYX_ERR(61, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_iset = ((struct PyPetscISObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DMLabel.pyx":381 * cdef PetscInt cstratum = asInt(stratum) * cdef IS iset = IS() * CHKERR( DMLabelGetStratumIS(self.dmlabel, cstratum, &iset.iset) ) # <<<<<<<<<<<<<< * return iset * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMLabelGetStratumIS(__pyx_v_self->dmlabel, __pyx_v_cstratum, (&__pyx_v_iset->iset))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(61, 381, __pyx_L1_error) /* "petsc4py/PETSc/DMLabel.pyx":382 * cdef IS iset = IS() * CHKERR( DMLabelGetStratumIS(self.dmlabel, cstratum, &iset.iset) ) * return iset # <<<<<<<<<<<<<< * * def setStratumIS(self, stratum: int, IS iset) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_iset); __pyx_r = ((PyObject *)__pyx_v_iset); goto __pyx_L0; /* "petsc4py/PETSc/DMLabel.pyx":364 * return toInt(csize) * * def getStratumIS(self, stratum: int) -> IS: # <<<<<<<<<<<<<< * """Return an `IS` with the stratum points. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMLabel.getStratumIS", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_iset); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMLabel.pyx":384 * return iset * * def setStratumIS(self, stratum: int, IS iset) -> None: # <<<<<<<<<<<<<< * """Set the stratum points using an `IS`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_43setStratumIS(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMLabel_42setStratumIS, "DMLabel.setStratumIS(self, stratum: int, iset: IS) -> None\nSet the stratum points using an `IS`.\n\n Not collective.\n\n Parameters\n ----------\n stratum\n The stratum value.\n iset\n The stratum points.\n\n See Also\n --------\n getStratumIS, petsc.DMLabelSetStratumIS\n\n \nSource code at petsc4py/PETSc/DMLabel.pyx:384"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_43setStratumIS(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_stratum = 0; struct PyPetscISObject *__pyx_v_iset = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setStratumIS (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stratum,&__pyx_n_s_iset,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_stratum)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(61, 384, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_iset)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(61, 384, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setStratumIS", 1, 2, 2, 1); __PYX_ERR(61, 384, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setStratumIS") < 0)) __PYX_ERR(61, 384, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_stratum = values[0]; __pyx_v_iset = ((struct PyPetscISObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setStratumIS", 1, 2, 2, __pyx_nargs); __PYX_ERR(61, 384, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMLabel.setStratumIS", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iset), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "iset", 0))) __PYX_ERR(61, 384, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMLabel_42setStratumIS(((struct PyPetscDMLabelObject *)__pyx_v_self), __pyx_v_stratum, __pyx_v_iset); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_42setStratumIS(struct PyPetscDMLabelObject *__pyx_v_self, PyObject *__pyx_v_stratum, struct PyPetscISObject *__pyx_v_iset) { PetscInt __pyx_v_cstratum; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setStratumIS", 1); /* "petsc4py/PETSc/DMLabel.pyx":401 * * """ * cdef PetscInt cstratum = asInt(stratum) # <<<<<<<<<<<<<< * CHKERR( DMLabelSetStratumIS(self.dmlabel, cstratum, iset.iset) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_stratum); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(61, 401, __pyx_L1_error) __pyx_v_cstratum = __pyx_t_1; /* "petsc4py/PETSc/DMLabel.pyx":402 * """ * cdef PetscInt cstratum = asInt(stratum) * CHKERR( DMLabelSetStratumIS(self.dmlabel, cstratum, iset.iset) ) # <<<<<<<<<<<<<< * * def clearStratum(self, stratum: int) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMLabelSetStratumIS(__pyx_v_self->dmlabel, __pyx_v_cstratum, __pyx_v_iset->iset)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(61, 402, __pyx_L1_error) /* "petsc4py/PETSc/DMLabel.pyx":384 * return iset * * def setStratumIS(self, stratum: int, IS iset) -> None: # <<<<<<<<<<<<<< * """Set the stratum points using an `IS`. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMLabel.setStratumIS", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMLabel.pyx":404 * CHKERR( DMLabelSetStratumIS(self.dmlabel, cstratum, iset.iset) ) * * def clearStratum(self, stratum: int) -> None: # <<<<<<<<<<<<<< * """Remove a stratum. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_45clearStratum(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMLabel_44clearStratum, "DMLabel.clearStratum(self, stratum: int) -> None\nRemove a stratum.\n\n Not collective.\n\n Parameters\n ----------\n stratum\n The stratum value.\n\n See Also\n --------\n petsc.DMLabelClearStratum\n\n \nSource code at petsc4py/PETSc/DMLabel.pyx:404"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_45clearStratum(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_stratum = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("clearStratum (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stratum,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_stratum)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(61, 404, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "clearStratum") < 0)) __PYX_ERR(61, 404, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_stratum = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("clearStratum", 1, 1, 1, __pyx_nargs); __PYX_ERR(61, 404, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMLabel.clearStratum", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMLabel_44clearStratum(((struct PyPetscDMLabelObject *)__pyx_v_self), __pyx_v_stratum); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_44clearStratum(struct PyPetscDMLabelObject *__pyx_v_self, PyObject *__pyx_v_stratum) { PetscInt __pyx_v_cstratum; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("clearStratum", 1); /* "petsc4py/PETSc/DMLabel.pyx":419 * * """ * cdef PetscInt cstratum = asInt(stratum) # <<<<<<<<<<<<<< * CHKERR( DMLabelClearStratum(self.dmlabel, cstratum) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_stratum); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(61, 419, __pyx_L1_error) __pyx_v_cstratum = __pyx_t_1; /* "petsc4py/PETSc/DMLabel.pyx":420 * """ * cdef PetscInt cstratum = asInt(stratum) * CHKERR( DMLabelClearStratum(self.dmlabel, cstratum) ) # <<<<<<<<<<<<<< * * def computeIndex(self) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMLabelClearStratum(__pyx_v_self->dmlabel, __pyx_v_cstratum)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(61, 420, __pyx_L1_error) /* "petsc4py/PETSc/DMLabel.pyx":404 * CHKERR( DMLabelSetStratumIS(self.dmlabel, cstratum, iset.iset) ) * * def clearStratum(self, stratum: int) -> None: # <<<<<<<<<<<<<< * """Remove a stratum. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMLabel.clearStratum", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMLabel.pyx":422 * CHKERR( DMLabelClearStratum(self.dmlabel, cstratum) ) * * def computeIndex(self) -> None: # <<<<<<<<<<<<<< * """Create an index structure for membership determination. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_47computeIndex(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMLabel_46computeIndex, "DMLabel.computeIndex(self) -> None\nCreate an index structure for membership determination.\n\n Not collective.\n\n Automatically determines the bounds.\n\n See Also\n --------\n petsc.DMLabelComputeIndex\n\n \nSource code at petsc4py/PETSc/DMLabel.pyx:422"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_47computeIndex(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("computeIndex (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("computeIndex", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "computeIndex", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMLabel_46computeIndex(((struct PyPetscDMLabelObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_46computeIndex(struct PyPetscDMLabelObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("computeIndex", 1); /* "petsc4py/PETSc/DMLabel.pyx":434 * * """ * CHKERR( DMLabelComputeIndex(self.dmlabel) ) # <<<<<<<<<<<<<< * * def createIndex(self, pStart: int, pEnd: int) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMLabelComputeIndex(__pyx_v_self->dmlabel)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(61, 434, __pyx_L1_error) /* "petsc4py/PETSc/DMLabel.pyx":422 * CHKERR( DMLabelClearStratum(self.dmlabel, cstratum) ) * * def computeIndex(self) -> None: # <<<<<<<<<<<<<< * """Create an index structure for membership determination. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMLabel.computeIndex", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMLabel.pyx":436 * CHKERR( DMLabelComputeIndex(self.dmlabel) ) * * def createIndex(self, pStart: int, pEnd: int) -> None: # <<<<<<<<<<<<<< * """Create an index structure for membership determination. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_49createIndex(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMLabel_48createIndex, "DMLabel.createIndex(self, pStart: int, pEnd: int) -> None\nCreate an index structure for membership determination.\n\n Not collective.\n\n Parameters\n ----------\n pStart\n The smallest point.\n pEnd\n The largest point + 1.\n\n See Also\n --------\n destroyIndex, petsc.DMLabelCreateIndex\n\n \nSource code at petsc4py/PETSc/DMLabel.pyx:436"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_49createIndex(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_pStart = 0; PyObject *__pyx_v_pEnd = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createIndex (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pStart,&__pyx_n_s_pEnd,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pStart)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(61, 436, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pEnd)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(61, 436, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("createIndex", 1, 2, 2, 1); __PYX_ERR(61, 436, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createIndex") < 0)) __PYX_ERR(61, 436, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_pStart = values[0]; __pyx_v_pEnd = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createIndex", 1, 2, 2, __pyx_nargs); __PYX_ERR(61, 436, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMLabel.createIndex", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMLabel_48createIndex(((struct PyPetscDMLabelObject *)__pyx_v_self), __pyx_v_pStart, __pyx_v_pEnd); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_48createIndex(struct PyPetscDMLabelObject *__pyx_v_self, PyObject *__pyx_v_pStart, PyObject *__pyx_v_pEnd) { PetscInt __pyx_v_cpstart; PetscInt __pyx_v_cpend; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createIndex", 1); /* "petsc4py/PETSc/DMLabel.pyx":453 * * """ * cdef PetscInt cpstart = asInt(pStart), cpend = asInt(pEnd) # <<<<<<<<<<<<<< * CHKERR( DMLabelCreateIndex(self.dmlabel, cpstart, cpend) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_pStart); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(61, 453, __pyx_L1_error) __pyx_v_cpstart = __pyx_t_1; __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_pEnd); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(61, 453, __pyx_L1_error) __pyx_v_cpend = __pyx_t_1; /* "petsc4py/PETSc/DMLabel.pyx":454 * """ * cdef PetscInt cpstart = asInt(pStart), cpend = asInt(pEnd) * CHKERR( DMLabelCreateIndex(self.dmlabel, cpstart, cpend) ) # <<<<<<<<<<<<<< * * def destroyIndex(self) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMLabelCreateIndex(__pyx_v_self->dmlabel, __pyx_v_cpstart, __pyx_v_cpend)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(61, 454, __pyx_L1_error) /* "petsc4py/PETSc/DMLabel.pyx":436 * CHKERR( DMLabelComputeIndex(self.dmlabel) ) * * def createIndex(self, pStart: int, pEnd: int) -> None: # <<<<<<<<<<<<<< * """Create an index structure for membership determination. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMLabel.createIndex", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMLabel.pyx":456 * CHKERR( DMLabelCreateIndex(self.dmlabel, cpstart, cpend) ) * * def destroyIndex(self) -> None: # <<<<<<<<<<<<<< * """Destroy the index structure. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_51destroyIndex(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMLabel_50destroyIndex, "DMLabel.destroyIndex(self) -> None\nDestroy the index structure.\n\n Not collective.\n\n See Also\n --------\n createIndex, petsc.DMLabelDestroyIndex\n\n \nSource code at petsc4py/PETSc/DMLabel.pyx:456"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_51destroyIndex(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("destroyIndex (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("destroyIndex", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroyIndex", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMLabel_50destroyIndex(((struct PyPetscDMLabelObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_50destroyIndex(struct PyPetscDMLabelObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("destroyIndex", 1); /* "petsc4py/PETSc/DMLabel.pyx":466 * * """ * CHKERR( DMLabelDestroyIndex(self.dmlabel) ) # <<<<<<<<<<<<<< * * def hasValue(self, value: int) -> bool: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMLabelDestroyIndex(__pyx_v_self->dmlabel)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(61, 466, __pyx_L1_error) /* "petsc4py/PETSc/DMLabel.pyx":456 * CHKERR( DMLabelCreateIndex(self.dmlabel, cpstart, cpend) ) * * def destroyIndex(self) -> None: # <<<<<<<<<<<<<< * """Destroy the index structure. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMLabel.destroyIndex", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMLabel.pyx":468 * CHKERR( DMLabelDestroyIndex(self.dmlabel) ) * * def hasValue(self, value: int) -> bool: # <<<<<<<<<<<<<< * """Determine whether a label assigns the value to any point. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_53hasValue(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMLabel_52hasValue, "DMLabel.hasValue(self, value: int) -> bool\nDetermine whether a label assigns the value to any point.\n\n Not collective.\n\n Parameters\n ----------\n value\n The value.\n\n See Also\n --------\n hasPoint, petsc.DMLabelHasValue\n\n \nSource code at petsc4py/PETSc/DMLabel.pyx:468"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_53hasValue(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_value = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("hasValue (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_value,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(61, 468, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "hasValue") < 0)) __PYX_ERR(61, 468, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_value = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("hasValue", 1, 1, 1, __pyx_nargs); __PYX_ERR(61, 468, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMLabel.hasValue", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMLabel_52hasValue(((struct PyPetscDMLabelObject *)__pyx_v_self), __pyx_v_value); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_52hasValue(struct PyPetscDMLabelObject *__pyx_v_self, PyObject *__pyx_v_value) { PetscInt __pyx_v_cvalue; PetscBool __pyx_v_cexists; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("hasValue", 1); /* "petsc4py/PETSc/DMLabel.pyx":483 * * """ * cdef PetscInt cvalue = asInt(value) # <<<<<<<<<<<<<< * cdef PetscBool cexists = PETSC_FALSE * CHKERR( DMLabelHasValue(self.dmlabel, cvalue, &cexists) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_value); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(61, 483, __pyx_L1_error) __pyx_v_cvalue = __pyx_t_1; /* "petsc4py/PETSc/DMLabel.pyx":484 * """ * cdef PetscInt cvalue = asInt(value) * cdef PetscBool cexists = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( DMLabelHasValue(self.dmlabel, cvalue, &cexists) ) * return toBool(cexists) */ __pyx_v_cexists = PETSC_FALSE; /* "petsc4py/PETSc/DMLabel.pyx":485 * cdef PetscInt cvalue = asInt(value) * cdef PetscBool cexists = PETSC_FALSE * CHKERR( DMLabelHasValue(self.dmlabel, cvalue, &cexists) ) # <<<<<<<<<<<<<< * return toBool(cexists) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMLabelHasValue(__pyx_v_self->dmlabel, __pyx_v_cvalue, (&__pyx_v_cexists))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(61, 485, __pyx_L1_error) /* "petsc4py/PETSc/DMLabel.pyx":486 * cdef PetscBool cexists = PETSC_FALSE * CHKERR( DMLabelHasValue(self.dmlabel, cvalue, &cexists) ) * return toBool(cexists) # <<<<<<<<<<<<<< * * def hasPoint(self, point: int) -> bool: */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_cexists); if (unlikely(!__pyx_t_3)) __PYX_ERR(61, 486, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMLabel.pyx":468 * CHKERR( DMLabelDestroyIndex(self.dmlabel) ) * * def hasValue(self, value: int) -> bool: # <<<<<<<<<<<<<< * """Determine whether a label assigns the value to any point. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMLabel.hasValue", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMLabel.pyx":488 * return toBool(cexists) * * def hasPoint(self, point: int) -> bool: # <<<<<<<<<<<<<< * """Determine whether the label contains a point. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_55hasPoint(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMLabel_54hasPoint, "DMLabel.hasPoint(self, point: int) -> bool\nDetermine whether the label contains a point.\n\n Not collective.\n\n The user must call `createIndex` before this function.\n\n Parameters\n ----------\n point\n The point.\n\n See Also\n --------\n hasValue, petsc.DMLabelHasPoint\n\n \nSource code at petsc4py/PETSc/DMLabel.pyx:488"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_55hasPoint(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_point = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("hasPoint (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_point)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(61, 488, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "hasPoint") < 0)) __PYX_ERR(61, 488, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_point = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("hasPoint", 1, 1, 1, __pyx_nargs); __PYX_ERR(61, 488, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMLabel.hasPoint", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMLabel_54hasPoint(((struct PyPetscDMLabelObject *)__pyx_v_self), __pyx_v_point); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_54hasPoint(struct PyPetscDMLabelObject *__pyx_v_self, PyObject *__pyx_v_point) { PetscInt __pyx_v_cpoint; PetscBool __pyx_v_cexists; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("hasPoint", 1); /* "petsc4py/PETSc/DMLabel.pyx":505 * * """ * cdef PetscInt cpoint = asInt(point) # <<<<<<<<<<<<<< * cdef PetscBool cexists = PETSC_FALSE * CHKERR( DMLabelHasPoint(self.dmlabel, cpoint, &cexists) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_point); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(61, 505, __pyx_L1_error) __pyx_v_cpoint = __pyx_t_1; /* "petsc4py/PETSc/DMLabel.pyx":506 * """ * cdef PetscInt cpoint = asInt(point) * cdef PetscBool cexists = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( DMLabelHasPoint(self.dmlabel, cpoint, &cexists) ) * return toBool(cexists) */ __pyx_v_cexists = PETSC_FALSE; /* "petsc4py/PETSc/DMLabel.pyx":507 * cdef PetscInt cpoint = asInt(point) * cdef PetscBool cexists = PETSC_FALSE * CHKERR( DMLabelHasPoint(self.dmlabel, cpoint, &cexists) ) # <<<<<<<<<<<<<< * return toBool(cexists) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMLabelHasPoint(__pyx_v_self->dmlabel, __pyx_v_cpoint, (&__pyx_v_cexists))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(61, 507, __pyx_L1_error) /* "petsc4py/PETSc/DMLabel.pyx":508 * cdef PetscBool cexists = PETSC_FALSE * CHKERR( DMLabelHasPoint(self.dmlabel, cpoint, &cexists) ) * return toBool(cexists) # <<<<<<<<<<<<<< * * def getBounds(self) -> tuple[int, int]: */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_cexists); if (unlikely(!__pyx_t_3)) __PYX_ERR(61, 508, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMLabel.pyx":488 * return toBool(cexists) * * def hasPoint(self, point: int) -> bool: # <<<<<<<<<<<<<< * """Determine whether the label contains a point. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMLabel.hasPoint", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMLabel.pyx":510 * return toBool(cexists) * * def getBounds(self) -> tuple[int, int]: # <<<<<<<<<<<<<< * """Return the smallest and largest point in the label. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_57getBounds(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMLabel_56getBounds, "DMLabel.getBounds(self) -> tuple[int, int]\nReturn the smallest and largest point in the label.\n\n Not collective.\n\n The returned values are the smallest point and the largest point + 1.\n\n See Also\n --------\n petsc.DMLabelGetBounds\n\n \nSource code at petsc4py/PETSc/DMLabel.pyx:510"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_57getBounds(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getBounds (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getBounds", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getBounds", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMLabel_56getBounds(((struct PyPetscDMLabelObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_56getBounds(struct PyPetscDMLabelObject *__pyx_v_self) { PetscInt __pyx_v_cpstart; PetscInt __pyx_v_cpend; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getBounds", 1); /* "petsc4py/PETSc/DMLabel.pyx":522 * * """ * cdef PetscInt cpstart = 0, cpend = 0 # <<<<<<<<<<<<<< * CHKERR( DMLabelGetBounds(self.dmlabel, &cpstart, &cpend) ) * return toInt(cpstart), toInt(cpend) */ __pyx_v_cpstart = 0; __pyx_v_cpend = 0; /* "petsc4py/PETSc/DMLabel.pyx":523 * """ * cdef PetscInt cpstart = 0, cpend = 0 * CHKERR( DMLabelGetBounds(self.dmlabel, &cpstart, &cpend) ) # <<<<<<<<<<<<<< * return toInt(cpstart), toInt(cpend) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMLabelGetBounds(__pyx_v_self->dmlabel, (&__pyx_v_cpstart), (&__pyx_v_cpend))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(61, 523, __pyx_L1_error) /* "petsc4py/PETSc/DMLabel.pyx":524 * cdef PetscInt cpstart = 0, cpend = 0 * CHKERR( DMLabelGetBounds(self.dmlabel, &cpstart, &cpend) ) * return toInt(cpstart), toInt(cpend) # <<<<<<<<<<<<<< * * def filter(self, start: int, end: int) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_cpstart); if (unlikely(!__pyx_t_2)) __PYX_ERR(61, 524, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_cpend); if (unlikely(!__pyx_t_3)) __PYX_ERR(61, 524, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(61, 524, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(61, 524, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(61, 524, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMLabel.pyx":510 * return toBool(cexists) * * def getBounds(self) -> tuple[int, int]: # <<<<<<<<<<<<<< * """Return the smallest and largest point in the label. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.DMLabel.getBounds", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMLabel.pyx":526 * return toInt(cpstart), toInt(cpend) * * def filter(self, start: int, end: int) -> None: # <<<<<<<<<<<<<< * """Remove all points outside of [start, end). * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_59filter(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMLabel_58filter, "DMLabel.filter(self, start: int, end: int) -> None\nRemove all points outside of [start, end).\n\n Not collective.\n\n Parameters\n ----------\n start\n The first point kept.\n end\n One more than the last point kept.\n\n See Also\n --------\n petsc.DMLabelFilter\n\n \nSource code at petsc4py/PETSc/DMLabel.pyx:526"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_59filter(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_start = 0; PyObject *__pyx_v_end = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("filter (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_start,&__pyx_n_s_end,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_start)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(61, 526, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_end)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(61, 526, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("filter", 1, 2, 2, 1); __PYX_ERR(61, 526, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "filter") < 0)) __PYX_ERR(61, 526, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_start = values[0]; __pyx_v_end = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("filter", 1, 2, 2, __pyx_nargs); __PYX_ERR(61, 526, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMLabel.filter", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMLabel_58filter(((struct PyPetscDMLabelObject *)__pyx_v_self), __pyx_v_start, __pyx_v_end); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_58filter(struct PyPetscDMLabelObject *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_end) { PetscInt __pyx_v_cstart; PetscInt __pyx_v_cend; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("filter", 1); /* "petsc4py/PETSc/DMLabel.pyx":543 * * """ * cdef PetscInt cstart = asInt(start), cend = asInt(end) # <<<<<<<<<<<<<< * CHKERR( DMLabelFilter(self.dmlabel, cstart, cend) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_start); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(61, 543, __pyx_L1_error) __pyx_v_cstart = __pyx_t_1; __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_end); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(61, 543, __pyx_L1_error) __pyx_v_cend = __pyx_t_1; /* "petsc4py/PETSc/DMLabel.pyx":544 * """ * cdef PetscInt cstart = asInt(start), cend = asInt(end) * CHKERR( DMLabelFilter(self.dmlabel, cstart, cend) ) # <<<<<<<<<<<<<< * * def permute(self, IS permutation) -> DMLabel: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMLabelFilter(__pyx_v_self->dmlabel, __pyx_v_cstart, __pyx_v_cend)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(61, 544, __pyx_L1_error) /* "petsc4py/PETSc/DMLabel.pyx":526 * return toInt(cpstart), toInt(cpend) * * def filter(self, start: int, end: int) -> None: # <<<<<<<<<<<<<< * """Remove all points outside of [start, end). * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMLabel.filter", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMLabel.pyx":546 * CHKERR( DMLabelFilter(self.dmlabel, cstart, cend) ) * * def permute(self, IS permutation) -> DMLabel: # <<<<<<<<<<<<<< * """Create a new label with permuted points. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_61permute(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMLabel_60permute, "DMLabel.permute(self, permutation: IS) -> DMLabel\nCreate a new label with permuted points.\n\n Not collective.\n\n Parameters\n ----------\n permutation\n The point permutation.\n\n See Also\n --------\n petsc.DMLabelPermute\n\n \nSource code at petsc4py/PETSc/DMLabel.pyx:546"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_61permute(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscISObject *__pyx_v_permutation = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("permute (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_permutation,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_permutation)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(61, 546, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "permute") < 0)) __PYX_ERR(61, 546, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_permutation = ((struct PyPetscISObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("permute", 1, 1, 1, __pyx_nargs); __PYX_ERR(61, 546, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMLabel.permute", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_permutation), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "permutation", 0))) __PYX_ERR(61, 546, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMLabel_60permute(((struct PyPetscDMLabelObject *)__pyx_v_self), __pyx_v_permutation); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_60permute(struct PyPetscDMLabelObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_permutation) { struct PyPetscDMLabelObject *__pyx_v_new = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("permute", 1); /* "petsc4py/PETSc/DMLabel.pyx":561 * * """ * cdef DMLabel new = DMLabel() # <<<<<<<<<<<<<< * CHKERR( DMLabelPermute(self.dmlabel, permutation.iset, &new.dmlabel) ) * return new */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DMLabel)); if (unlikely(!__pyx_t_1)) __PYX_ERR(61, 561, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_new = ((struct PyPetscDMLabelObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DMLabel.pyx":562 * """ * cdef DMLabel new = DMLabel() * CHKERR( DMLabelPermute(self.dmlabel, permutation.iset, &new.dmlabel) ) # <<<<<<<<<<<<<< * return new * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMLabelPermute(__pyx_v_self->dmlabel, __pyx_v_permutation->iset, (&__pyx_v_new->dmlabel))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(61, 562, __pyx_L1_error) /* "petsc4py/PETSc/DMLabel.pyx":563 * cdef DMLabel new = DMLabel() * CHKERR( DMLabelPermute(self.dmlabel, permutation.iset, &new.dmlabel) ) * return new # <<<<<<<<<<<<<< * * def distribute(self, SF sf) -> DMLabel: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_new); __pyx_r = ((PyObject *)__pyx_v_new); goto __pyx_L0; /* "petsc4py/PETSc/DMLabel.pyx":546 * CHKERR( DMLabelFilter(self.dmlabel, cstart, cend) ) * * def permute(self, IS permutation) -> DMLabel: # <<<<<<<<<<<<<< * """Create a new label with permuted points. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMLabel.permute", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_new); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMLabel.pyx":565 * return new * * def distribute(self, SF sf) -> DMLabel: # <<<<<<<<<<<<<< * """Create a new label pushed forward over the `SF`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_63distribute(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMLabel_62distribute, "DMLabel.distribute(self, sf: SF) -> DMLabel\nCreate a new label pushed forward over the `SF`.\n\n Collective.\n\n Parameters\n ----------\n sf\n The map from old to new distribution.\n\n See Also\n --------\n gather, petsc.DMLabelDistribute\n\n \nSource code at petsc4py/PETSc/DMLabel.pyx:565"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_63distribute(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscSFObject *__pyx_v_sf = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("distribute (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sf,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sf)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(61, 565, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "distribute") < 0)) __PYX_ERR(61, 565, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_sf = ((struct PyPetscSFObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("distribute", 1, 1, 1, __pyx_nargs); __PYX_ERR(61, 565, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMLabel.distribute", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sf), __pyx_ptype_8petsc4py_5PETSc_SF, 0, "sf", 0))) __PYX_ERR(61, 565, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMLabel_62distribute(((struct PyPetscDMLabelObject *)__pyx_v_self), __pyx_v_sf); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_62distribute(struct PyPetscDMLabelObject *__pyx_v_self, struct PyPetscSFObject *__pyx_v_sf) { struct PyPetscDMLabelObject *__pyx_v_new = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("distribute", 1); /* "petsc4py/PETSc/DMLabel.pyx":580 * * """ * cdef DMLabel new = DMLabel() # <<<<<<<<<<<<<< * CHKERR( DMLabelDistribute(self.dmlabel, sf.sf, &new.dmlabel) ) * return new */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DMLabel)); if (unlikely(!__pyx_t_1)) __PYX_ERR(61, 580, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_new = ((struct PyPetscDMLabelObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DMLabel.pyx":581 * """ * cdef DMLabel new = DMLabel() * CHKERR( DMLabelDistribute(self.dmlabel, sf.sf, &new.dmlabel) ) # <<<<<<<<<<<<<< * return new * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMLabelDistribute(__pyx_v_self->dmlabel, __pyx_v_sf->sf, (&__pyx_v_new->dmlabel))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(61, 581, __pyx_L1_error) /* "petsc4py/PETSc/DMLabel.pyx":582 * cdef DMLabel new = DMLabel() * CHKERR( DMLabelDistribute(self.dmlabel, sf.sf, &new.dmlabel) ) * return new # <<<<<<<<<<<<<< * * def gather(self, SF sf) -> DMLabel: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_new); __pyx_r = ((PyObject *)__pyx_v_new); goto __pyx_L0; /* "petsc4py/PETSc/DMLabel.pyx":565 * return new * * def distribute(self, SF sf) -> DMLabel: # <<<<<<<<<<<<<< * """Create a new label pushed forward over the `SF`. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMLabel.distribute", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_new); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMLabel.pyx":584 * return new * * def gather(self, SF sf) -> DMLabel: # <<<<<<<<<<<<<< * """Gather all label values from leaves into roots. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_65gather(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMLabel_64gather, "DMLabel.gather(self, sf: SF) -> DMLabel\nGather all label values from leaves into roots.\n\n Collective.\n\n This is the inverse operation to `distribute`.\n\n Parameters\n ----------\n sf\n The `SF` communication map.\n\n See Also\n --------\n distribute, petsc.DMLabelGather\n\n \nSource code at petsc4py/PETSc/DMLabel.pyx:584"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_65gather(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscSFObject *__pyx_v_sf = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("gather (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sf,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sf)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(61, 584, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "gather") < 0)) __PYX_ERR(61, 584, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_sf = ((struct PyPetscSFObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("gather", 1, 1, 1, __pyx_nargs); __PYX_ERR(61, 584, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMLabel.gather", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sf), __pyx_ptype_8petsc4py_5PETSc_SF, 0, "sf", 0))) __PYX_ERR(61, 584, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMLabel_64gather(((struct PyPetscDMLabelObject *)__pyx_v_self), __pyx_v_sf); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_64gather(struct PyPetscDMLabelObject *__pyx_v_self, struct PyPetscSFObject *__pyx_v_sf) { struct PyPetscDMLabelObject *__pyx_v_new = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("gather", 1); /* "petsc4py/PETSc/DMLabel.pyx":601 * * """ * cdef DMLabel new = DMLabel() # <<<<<<<<<<<<<< * CHKERR( DMLabelGather(self.dmlabel, sf.sf, &new.dmlabel) ) * return new */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DMLabel)); if (unlikely(!__pyx_t_1)) __PYX_ERR(61, 601, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_new = ((struct PyPetscDMLabelObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DMLabel.pyx":602 * """ * cdef DMLabel new = DMLabel() * CHKERR( DMLabelGather(self.dmlabel, sf.sf, &new.dmlabel) ) # <<<<<<<<<<<<<< * return new * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMLabelGather(__pyx_v_self->dmlabel, __pyx_v_sf->sf, (&__pyx_v_new->dmlabel))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(61, 602, __pyx_L1_error) /* "petsc4py/PETSc/DMLabel.pyx":603 * cdef DMLabel new = DMLabel() * CHKERR( DMLabelGather(self.dmlabel, sf.sf, &new.dmlabel) ) * return new # <<<<<<<<<<<<<< * * def convertToSection(self) -> tuple[Section, IS]: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_new); __pyx_r = ((PyObject *)__pyx_v_new); goto __pyx_L0; /* "petsc4py/PETSc/DMLabel.pyx":584 * return new * * def gather(self, SF sf) -> DMLabel: # <<<<<<<<<<<<<< * """Gather all label values from leaves into roots. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMLabel.gather", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_new); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMLabel.pyx":605 * return new * * def convertToSection(self) -> tuple[Section, IS]: # <<<<<<<<<<<<<< * """Return a `Section` and `IS` that encode the label. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_67convertToSection(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMLabel_66convertToSection, "DMLabel.convertToSection(self) -> tuple[Section, IS]\nReturn a `Section` and `IS` that encode the label.\n\n Not collective.\n\n See Also\n --------\n petsc.DMLabelConvertToSection\n\n \nSource code at petsc4py/PETSc/DMLabel.pyx:605"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_67convertToSection(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("convertToSection (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("convertToSection", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "convertToSection", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMLabel_66convertToSection(((struct PyPetscDMLabelObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_66convertToSection(struct PyPetscDMLabelObject *__pyx_v_self) { struct PyPetscSectionObject *__pyx_v_section = 0; struct PyPetscISObject *__pyx_v_iset = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("convertToSection", 1); /* "petsc4py/PETSc/DMLabel.pyx":615 * * """ * cdef Section section = Section() # <<<<<<<<<<<<<< * cdef IS iset = IS() * CHKERR( DMLabelConvertToSection(self.dmlabel, §ion.sec, &iset.iset) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Section)); if (unlikely(!__pyx_t_1)) __PYX_ERR(61, 615, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_section = ((struct PyPetscSectionObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DMLabel.pyx":616 * """ * cdef Section section = Section() * cdef IS iset = IS() # <<<<<<<<<<<<<< * CHKERR( DMLabelConvertToSection(self.dmlabel, §ion.sec, &iset.iset) ) * return section, iset */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_1)) __PYX_ERR(61, 616, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_iset = ((struct PyPetscISObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DMLabel.pyx":617 * cdef Section section = Section() * cdef IS iset = IS() * CHKERR( DMLabelConvertToSection(self.dmlabel, §ion.sec, &iset.iset) ) # <<<<<<<<<<<<<< * return section, iset * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMLabelConvertToSection(__pyx_v_self->dmlabel, (&__pyx_v_section->sec), (&__pyx_v_iset->iset))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(61, 617, __pyx_L1_error) /* "petsc4py/PETSc/DMLabel.pyx":618 * cdef IS iset = IS() * CHKERR( DMLabelConvertToSection(self.dmlabel, §ion.sec, &iset.iset) ) * return section, iset # <<<<<<<<<<<<<< * * def getNonEmptyStratumValuesIS(self) -> IS: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(61, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF((PyObject *)__pyx_v_section); __Pyx_GIVEREF((PyObject *)__pyx_v_section); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_section))) __PYX_ERR(61, 618, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_iset); __Pyx_GIVEREF((PyObject *)__pyx_v_iset); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_iset))) __PYX_ERR(61, 618, __pyx_L1_error); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMLabel.pyx":605 * return new * * def convertToSection(self) -> tuple[Section, IS]: # <<<<<<<<<<<<<< * """Return a `Section` and `IS` that encode the label. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMLabel.convertToSection", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_section); __Pyx_XDECREF((PyObject *)__pyx_v_iset); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMLabel.pyx":620 * return section, iset * * def getNonEmptyStratumValuesIS(self) -> IS: # <<<<<<<<<<<<<< * """Return an `IS` of all values that the `DMLabel` takes. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_69getNonEmptyStratumValuesIS(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMLabel_68getNonEmptyStratumValuesIS, "DMLabel.getNonEmptyStratumValuesIS(self) -> IS\nReturn an `IS` of all values that the `DMLabel` takes.\n\n Not collective.\n\n See Also\n --------\n petsc.DMLabelGetNonEmptyStratumValuesIS\n\n \nSource code at petsc4py/PETSc/DMLabel.pyx:620"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_69getNonEmptyStratumValuesIS(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getNonEmptyStratumValuesIS (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getNonEmptyStratumValuesIS", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getNonEmptyStratumValuesIS", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMLabel_68getNonEmptyStratumValuesIS(((struct PyPetscDMLabelObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_68getNonEmptyStratumValuesIS(struct PyPetscDMLabelObject *__pyx_v_self) { struct PyPetscISObject *__pyx_v_iset = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getNonEmptyStratumValuesIS", 1); /* "petsc4py/PETSc/DMLabel.pyx":630 * * """ * cdef IS iset = IS() # <<<<<<<<<<<<<< * CHKERR( DMLabelGetNonEmptyStratumValuesIS(self.dmlabel, &iset.iset) ) * return iset */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_1)) __PYX_ERR(61, 630, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_iset = ((struct PyPetscISObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DMLabel.pyx":631 * """ * cdef IS iset = IS() * CHKERR( DMLabelGetNonEmptyStratumValuesIS(self.dmlabel, &iset.iset) ) # <<<<<<<<<<<<<< * return iset */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMLabelGetNonEmptyStratumValuesIS(__pyx_v_self->dmlabel, (&__pyx_v_iset->iset))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(61, 631, __pyx_L1_error) /* "petsc4py/PETSc/DMLabel.pyx":632 * cdef IS iset = IS() * CHKERR( DMLabelGetNonEmptyStratumValuesIS(self.dmlabel, &iset.iset) ) * return iset # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_iset); __pyx_r = ((PyObject *)__pyx_v_iset); goto __pyx_L0; /* "petsc4py/PETSc/DMLabel.pyx":620 * return section, iset * * def getNonEmptyStratumValuesIS(self) -> IS: # <<<<<<<<<<<<<< * """Return an `IS` of all values that the `DMLabel` takes. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMLabel.getNonEmptyStratumValuesIS", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_iset); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMSwarm.pyx":32 * PICLayoutType = DMSwarmPICLayoutType * * def create(self, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Create an empty DM object and set its type to `DM.Type.SWARM`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_1create(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMSwarm_create, "DMSwarm.create(self, comm: Comm | None = None) -> Self\nCreate an empty DM object and set its type to `DM.Type.SWARM`.\n\n Collective.\n\n DMs are the abstract objects in PETSc that mediate between meshes and\n discretizations and the algebraic solvers, time integrators, and\n optimization algorithms.\n\n Parameters\n ----------\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n petsc.DMCreate, petsc.DMSetType\n\n \nSource code at petsc4py/PETSc/DMSwarm.pyx:32"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_1create(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(62, 32, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "create") < 0)) __PYX_ERR(62, 32, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_comm = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, __pyx_nargs); __PYX_ERR(62, 32, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_create(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_comm); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_create(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; DM __pyx_v_newdm; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create", 1); /* "petsc4py/PETSc/DMSwarm.pyx":51 * * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscDM newdm = NULL * CHKERR( DMCreate(ccomm, &newdm) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(62, 51, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/DMSwarm.pyx":52 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscDM newdm = NULL # <<<<<<<<<<<<<< * CHKERR( DMCreate(ccomm, &newdm) ) * CHKERR( PetscCLEAR(self.obj) ); self.dm = newdm */ __pyx_v_newdm = NULL; /* "petsc4py/PETSc/DMSwarm.pyx":53 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscDM newdm = NULL * CHKERR( DMCreate(ccomm, &newdm) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.dm = newdm * CHKERR( DMSetType(self.dm, DMSWARM) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCreate(__pyx_v_ccomm, (&__pyx_v_newdm))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(62, 53, __pyx_L1_error) /* "petsc4py/PETSc/DMSwarm.pyx":54 * cdef PetscDM newdm = NULL * CHKERR( DMCreate(ccomm, &newdm) ) * CHKERR( PetscCLEAR(self.obj) ); self.dm = newdm # <<<<<<<<<<<<<< * CHKERR( DMSetType(self.dm, DMSWARM) ) * return self */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(62, 54, __pyx_L1_error) __pyx_v_self->__pyx_base.dm = __pyx_v_newdm; /* "petsc4py/PETSc/DMSwarm.pyx":55 * CHKERR( DMCreate(ccomm, &newdm) ) * CHKERR( PetscCLEAR(self.obj) ); self.dm = newdm * CHKERR( DMSetType(self.dm, DMSWARM) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSetType(__pyx_v_self->__pyx_base.dm, DMSWARM)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(62, 55, __pyx_L1_error) /* "petsc4py/PETSc/DMSwarm.pyx":56 * CHKERR( PetscCLEAR(self.obj) ); self.dm = newdm * CHKERR( DMSetType(self.dm, DMSWARM) ) * return self # <<<<<<<<<<<<<< * * def createGlobalVectorFromField(self, fieldname: str) -> Vec: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/DMSwarm.pyx":32 * PICLayoutType = DMSwarmPICLayoutType * * def create(self, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Create an empty DM object and set its type to `DM.Type.SWARM`. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMSwarm.pyx":58 * return self * * def createGlobalVectorFromField(self, fieldname: str) -> Vec: # <<<<<<<<<<<<<< * """Create a global `Vec` object associated with a given field. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_3createGlobalVectorFromField(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMSwarm_2createGlobalVectorFromField, "DMSwarm.createGlobalVectorFromField(self, fieldname: str) -> Vec\nCreate a global `Vec` object associated with a given field.\n\n Collective.\n\n The vector must be returned to the `DMSwarm` using a matching call to\n `destroyGlobalVectorFromField`.\n\n Parameters\n ----------\n fieldname\n The textual name given to a registered field.\n\n See Also\n --------\n destroyGlobalVectorFromField, petsc.DMSwarmCreateGlobalVectorFromField\n\n \nSource code at petsc4py/PETSc/DMSwarm.pyx:58"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_3createGlobalVectorFromField(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_fieldname = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createGlobalVectorFromField (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fieldname,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fieldname)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(62, 58, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createGlobalVectorFromField") < 0)) __PYX_ERR(62, 58, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_fieldname = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createGlobalVectorFromField", 1, 1, 1, __pyx_nargs); __PYX_ERR(62, 58, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.createGlobalVectorFromField", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_2createGlobalVectorFromField(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_fieldname); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_2createGlobalVectorFromField(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_fieldname) { char const *__pyx_v_cfieldname; struct PyPetscVecObject *__pyx_v_vg = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createGlobalVectorFromField", 0); __Pyx_INCREF(__pyx_v_fieldname); /* "petsc4py/PETSc/DMSwarm.pyx":76 * * """ * cdef const char *cfieldname = NULL # <<<<<<<<<<<<<< * cdef Vec vg = Vec() * fieldname = str2bytes(fieldname, &cfieldname) */ __pyx_v_cfieldname = NULL; /* "petsc4py/PETSc/DMSwarm.pyx":77 * """ * cdef const char *cfieldname = NULL * cdef Vec vg = Vec() # <<<<<<<<<<<<<< * fieldname = str2bytes(fieldname, &cfieldname) * CHKERR( DMSwarmCreateGlobalVectorFromField(self.dm, cfieldname, &vg.vec) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(62, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_vg = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DMSwarm.pyx":78 * cdef const char *cfieldname = NULL * cdef Vec vg = Vec() * fieldname = str2bytes(fieldname, &cfieldname) # <<<<<<<<<<<<<< * CHKERR( DMSwarmCreateGlobalVectorFromField(self.dm, cfieldname, &vg.vec) ) * return vg */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_fieldname, (&__pyx_v_cfieldname)); if (unlikely(!__pyx_t_1)) __PYX_ERR(62, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_fieldname, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DMSwarm.pyx":79 * cdef Vec vg = Vec() * fieldname = str2bytes(fieldname, &cfieldname) * CHKERR( DMSwarmCreateGlobalVectorFromField(self.dm, cfieldname, &vg.vec) ) # <<<<<<<<<<<<<< * return vg * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmCreateGlobalVectorFromField(__pyx_v_self->__pyx_base.dm, __pyx_v_cfieldname, (&__pyx_v_vg->vec))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(62, 79, __pyx_L1_error) /* "petsc4py/PETSc/DMSwarm.pyx":80 * fieldname = str2bytes(fieldname, &cfieldname) * CHKERR( DMSwarmCreateGlobalVectorFromField(self.dm, cfieldname, &vg.vec) ) * return vg # <<<<<<<<<<<<<< * * def destroyGlobalVectorFromField(self, fieldname: str) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_vg); __pyx_r = ((PyObject *)__pyx_v_vg); goto __pyx_L0; /* "petsc4py/PETSc/DMSwarm.pyx":58 * return self * * def createGlobalVectorFromField(self, fieldname: str) -> Vec: # <<<<<<<<<<<<<< * """Create a global `Vec` object associated with a given field. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.createGlobalVectorFromField", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_vg); __Pyx_XDECREF(__pyx_v_fieldname); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMSwarm.pyx":82 * return vg * * def destroyGlobalVectorFromField(self, fieldname: str) -> None: # <<<<<<<<<<<<<< * """Destroy the global `Vec` object associated with a given field. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_5destroyGlobalVectorFromField(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMSwarm_4destroyGlobalVectorFromField, "DMSwarm.destroyGlobalVectorFromField(self, fieldname: str) -> None\nDestroy the global `Vec` object associated with a given field.\n\n Collective.\n\n Parameters\n ----------\n fieldname\n The textual name given to a registered field.\n\n See Also\n --------\n createGlobalVectorFromField, petsc.DMSwarmDestroyGlobalVectorFromField\n\n \nSource code at petsc4py/PETSc/DMSwarm.pyx:82"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_5destroyGlobalVectorFromField(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_fieldname = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("destroyGlobalVectorFromField (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fieldname,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fieldname)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(62, 82, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "destroyGlobalVectorFromField") < 0)) __PYX_ERR(62, 82, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_fieldname = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("destroyGlobalVectorFromField", 1, 1, 1, __pyx_nargs); __PYX_ERR(62, 82, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.destroyGlobalVectorFromField", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_4destroyGlobalVectorFromField(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_fieldname); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_4destroyGlobalVectorFromField(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_fieldname) { char const *__pyx_v_cfieldname; Vec __pyx_v_vec; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("destroyGlobalVectorFromField", 0); __Pyx_INCREF(__pyx_v_fieldname); /* "petsc4py/PETSc/DMSwarm.pyx":97 * * """ * cdef const char *cfieldname = NULL # <<<<<<<<<<<<<< * cdef PetscVec vec = NULL * fieldname = str2bytes(fieldname, &cfieldname) */ __pyx_v_cfieldname = NULL; /* "petsc4py/PETSc/DMSwarm.pyx":98 * """ * cdef const char *cfieldname = NULL * cdef PetscVec vec = NULL # <<<<<<<<<<<<<< * fieldname = str2bytes(fieldname, &cfieldname) * CHKERR( DMSwarmDestroyGlobalVectorFromField(self.dm, cfieldname, &vec) ) */ __pyx_v_vec = NULL; /* "petsc4py/PETSc/DMSwarm.pyx":99 * cdef const char *cfieldname = NULL * cdef PetscVec vec = NULL * fieldname = str2bytes(fieldname, &cfieldname) # <<<<<<<<<<<<<< * CHKERR( DMSwarmDestroyGlobalVectorFromField(self.dm, cfieldname, &vec) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_fieldname, (&__pyx_v_cfieldname)); if (unlikely(!__pyx_t_1)) __PYX_ERR(62, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_fieldname, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DMSwarm.pyx":100 * cdef PetscVec vec = NULL * fieldname = str2bytes(fieldname, &cfieldname) * CHKERR( DMSwarmDestroyGlobalVectorFromField(self.dm, cfieldname, &vec) ) # <<<<<<<<<<<<<< * * def createLocalVectorFromField(self, fieldname: str) -> Vec: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmDestroyGlobalVectorFromField(__pyx_v_self->__pyx_base.dm, __pyx_v_cfieldname, (&__pyx_v_vec))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(62, 100, __pyx_L1_error) /* "petsc4py/PETSc/DMSwarm.pyx":82 * return vg * * def destroyGlobalVectorFromField(self, fieldname: str) -> None: # <<<<<<<<<<<<<< * """Destroy the global `Vec` object associated with a given field. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.destroyGlobalVectorFromField", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_fieldname); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMSwarm.pyx":102 * CHKERR( DMSwarmDestroyGlobalVectorFromField(self.dm, cfieldname, &vec) ) * * def createLocalVectorFromField(self, fieldname: str) -> Vec: # <<<<<<<<<<<<<< * """Create a local `Vec` object associated with a given field. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_7createLocalVectorFromField(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMSwarm_6createLocalVectorFromField, "DMSwarm.createLocalVectorFromField(self, fieldname: str) -> Vec\nCreate a local `Vec` object associated with a given field.\n\n Collective.\n\n The vector must be returned to the `DMSwarm` using a matching call\n to `destroyLocalVectorFromField`.\n\n Parameters\n ----------\n fieldname\n The textual name given to a registered field.\n\n See Also\n --------\n destroyLocalVectorFromField, petsc.DMSwarmCreateLocalVectorFromField\n\n \nSource code at petsc4py/PETSc/DMSwarm.pyx:102"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_7createLocalVectorFromField(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_fieldname = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createLocalVectorFromField (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fieldname,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fieldname)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(62, 102, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "createLocalVectorFromField") < 0)) __PYX_ERR(62, 102, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_fieldname = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createLocalVectorFromField", 1, 1, 1, __pyx_nargs); __PYX_ERR(62, 102, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.createLocalVectorFromField", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_6createLocalVectorFromField(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_fieldname); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_6createLocalVectorFromField(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_fieldname) { char const *__pyx_v_cfieldname; struct PyPetscVecObject *__pyx_v_vl = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createLocalVectorFromField", 0); __Pyx_INCREF(__pyx_v_fieldname); /* "petsc4py/PETSc/DMSwarm.pyx":120 * * """ * cdef const char *cfieldname = NULL # <<<<<<<<<<<<<< * cdef Vec vl = Vec() * fieldname = str2bytes(fieldname, &cfieldname) */ __pyx_v_cfieldname = NULL; /* "petsc4py/PETSc/DMSwarm.pyx":121 * """ * cdef const char *cfieldname = NULL * cdef Vec vl = Vec() # <<<<<<<<<<<<<< * fieldname = str2bytes(fieldname, &cfieldname) * CHKERR( DMSwarmCreateLocalVectorFromField(self.dm, cfieldname, &vl.vec) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(62, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_vl = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DMSwarm.pyx":122 * cdef const char *cfieldname = NULL * cdef Vec vl = Vec() * fieldname = str2bytes(fieldname, &cfieldname) # <<<<<<<<<<<<<< * CHKERR( DMSwarmCreateLocalVectorFromField(self.dm, cfieldname, &vl.vec) ) * return vl */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_fieldname, (&__pyx_v_cfieldname)); if (unlikely(!__pyx_t_1)) __PYX_ERR(62, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_fieldname, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DMSwarm.pyx":123 * cdef Vec vl = Vec() * fieldname = str2bytes(fieldname, &cfieldname) * CHKERR( DMSwarmCreateLocalVectorFromField(self.dm, cfieldname, &vl.vec) ) # <<<<<<<<<<<<<< * return vl * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmCreateLocalVectorFromField(__pyx_v_self->__pyx_base.dm, __pyx_v_cfieldname, (&__pyx_v_vl->vec))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(62, 123, __pyx_L1_error) /* "petsc4py/PETSc/DMSwarm.pyx":124 * fieldname = str2bytes(fieldname, &cfieldname) * CHKERR( DMSwarmCreateLocalVectorFromField(self.dm, cfieldname, &vl.vec) ) * return vl # <<<<<<<<<<<<<< * * def destroyLocalVectorFromField(self, fieldname: str) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_vl); __pyx_r = ((PyObject *)__pyx_v_vl); goto __pyx_L0; /* "petsc4py/PETSc/DMSwarm.pyx":102 * CHKERR( DMSwarmDestroyGlobalVectorFromField(self.dm, cfieldname, &vec) ) * * def createLocalVectorFromField(self, fieldname: str) -> Vec: # <<<<<<<<<<<<<< * """Create a local `Vec` object associated with a given field. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.createLocalVectorFromField", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_vl); __Pyx_XDECREF(__pyx_v_fieldname); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMSwarm.pyx":126 * return vl * * def destroyLocalVectorFromField(self, fieldname: str) -> None: # <<<<<<<<<<<<<< * """Destroy the local `Vec` object associated with a given field. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_9destroyLocalVectorFromField(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMSwarm_8destroyLocalVectorFromField, "DMSwarm.destroyLocalVectorFromField(self, fieldname: str) -> None\nDestroy the local `Vec` object associated with a given field.\n\n Collective.\n\n Parameters\n ----------\n fieldname\n The textual name given to a registered field.\n\n See Also\n --------\n createLocalVectorFromField, petsc.DMSwarmDestroyLocalVectorFromField\n\n \nSource code at petsc4py/PETSc/DMSwarm.pyx:126"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_9destroyLocalVectorFromField(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_fieldname = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("destroyLocalVectorFromField (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fieldname,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fieldname)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(62, 126, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "destroyLocalVectorFromField") < 0)) __PYX_ERR(62, 126, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_fieldname = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("destroyLocalVectorFromField", 1, 1, 1, __pyx_nargs); __PYX_ERR(62, 126, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.destroyLocalVectorFromField", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_8destroyLocalVectorFromField(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_fieldname); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_8destroyLocalVectorFromField(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_fieldname) { char const *__pyx_v_cfieldname; Vec __pyx_v_vec; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("destroyLocalVectorFromField", 0); __Pyx_INCREF(__pyx_v_fieldname); /* "petsc4py/PETSc/DMSwarm.pyx":141 * * """ * cdef const char *cfieldname = NULL # <<<<<<<<<<<<<< * cdef PetscVec vec * fieldname = str2bytes(fieldname, &cfieldname) */ __pyx_v_cfieldname = NULL; /* "petsc4py/PETSc/DMSwarm.pyx":143 * cdef const char *cfieldname = NULL * cdef PetscVec vec * fieldname = str2bytes(fieldname, &cfieldname) # <<<<<<<<<<<<<< * CHKERR( DMSwarmDestroyLocalVectorFromField(self.dm, cfieldname, &vec) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_fieldname, (&__pyx_v_cfieldname)); if (unlikely(!__pyx_t_1)) __PYX_ERR(62, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_fieldname, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DMSwarm.pyx":144 * cdef PetscVec vec * fieldname = str2bytes(fieldname, &cfieldname) * CHKERR( DMSwarmDestroyLocalVectorFromField(self.dm, cfieldname, &vec) ) # <<<<<<<<<<<<<< * * def initializeFieldRegister(self) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmDestroyLocalVectorFromField(__pyx_v_self->__pyx_base.dm, __pyx_v_cfieldname, (&__pyx_v_vec))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(62, 144, __pyx_L1_error) /* "petsc4py/PETSc/DMSwarm.pyx":126 * return vl * * def destroyLocalVectorFromField(self, fieldname: str) -> None: # <<<<<<<<<<<<<< * """Destroy the local `Vec` object associated with a given field. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.destroyLocalVectorFromField", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_fieldname); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMSwarm.pyx":146 * CHKERR( DMSwarmDestroyLocalVectorFromField(self.dm, cfieldname, &vec) ) * * def initializeFieldRegister(self) -> None: # <<<<<<<<<<<<<< * """Initiate the registration of fields to a `DMSwarm`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_11initializeFieldRegister(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMSwarm_10initializeFieldRegister, "DMSwarm.initializeFieldRegister(self) -> None\nInitiate the registration of fields to a `DMSwarm`.\n\n Collective.\n\n After all fields have been registered, you must call `finalizeFieldRegister`.\n\n See Also\n --------\n finalizeFieldRegister, petsc.DMSwarmInitializeFieldRegister\n\n \nSource code at petsc4py/PETSc/DMSwarm.pyx:146"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_11initializeFieldRegister(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("initializeFieldRegister (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("initializeFieldRegister", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "initializeFieldRegister", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_10initializeFieldRegister(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_10initializeFieldRegister(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("initializeFieldRegister", 1); /* "petsc4py/PETSc/DMSwarm.pyx":158 * * """ * CHKERR( DMSwarmInitializeFieldRegister(self.dm) ) # <<<<<<<<<<<<<< * * def finalizeFieldRegister(self) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmInitializeFieldRegister(__pyx_v_self->__pyx_base.dm)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(62, 158, __pyx_L1_error) /* "petsc4py/PETSc/DMSwarm.pyx":146 * CHKERR( DMSwarmDestroyLocalVectorFromField(self.dm, cfieldname, &vec) ) * * def initializeFieldRegister(self) -> None: # <<<<<<<<<<<<<< * """Initiate the registration of fields to a `DMSwarm`. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.initializeFieldRegister", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMSwarm.pyx":160 * CHKERR( DMSwarmInitializeFieldRegister(self.dm) ) * * def finalizeFieldRegister(self) -> None: # <<<<<<<<<<<<<< * """Finalize the registration of fields to a `DMSwarm`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_13finalizeFieldRegister(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMSwarm_12finalizeFieldRegister, "DMSwarm.finalizeFieldRegister(self) -> None\nFinalize the registration of fields to a `DMSwarm`.\n\n Collective.\n\n See Also\n --------\n initializeFieldRegister, petsc.DMSwarmFinalizeFieldRegister\n\n \nSource code at petsc4py/PETSc/DMSwarm.pyx:160"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_13finalizeFieldRegister(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("finalizeFieldRegister (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("finalizeFieldRegister", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "finalizeFieldRegister", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_12finalizeFieldRegister(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_12finalizeFieldRegister(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("finalizeFieldRegister", 1); /* "petsc4py/PETSc/DMSwarm.pyx":170 * * """ * CHKERR( DMSwarmFinalizeFieldRegister(self.dm) ) # <<<<<<<<<<<<<< * * def setLocalSizes(self, nlocal: int, buffer: int) -> Self: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmFinalizeFieldRegister(__pyx_v_self->__pyx_base.dm)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(62, 170, __pyx_L1_error) /* "petsc4py/PETSc/DMSwarm.pyx":160 * CHKERR( DMSwarmInitializeFieldRegister(self.dm) ) * * def finalizeFieldRegister(self) -> None: # <<<<<<<<<<<<<< * """Finalize the registration of fields to a `DMSwarm`. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.finalizeFieldRegister", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMSwarm.pyx":172 * CHKERR( DMSwarmFinalizeFieldRegister(self.dm) ) * * def setLocalSizes(self, nlocal: int, buffer: int) -> Self: # <<<<<<<<<<<<<< * """Set the length of all registered fields on the `DMSwarm`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_15setLocalSizes(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMSwarm_14setLocalSizes, "DMSwarm.setLocalSizes(self, nlocal: int, buffer: int) -> Self\nSet the length of all registered fields on the `DMSwarm`.\n\n Not collective.\n\n Parameters\n ----------\n nlocal\n The length of each registered field.\n buffer\n The length of the buffer used for efficient dynamic resizing.\n\n See Also\n --------\n petsc.DMSwarmSetLocalSizes\n\n \nSource code at petsc4py/PETSc/DMSwarm.pyx:172"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_15setLocalSizes(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_nlocal = 0; PyObject *__pyx_v_buffer = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setLocalSizes (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nlocal,&__pyx_n_s_buffer,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_nlocal)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(62, 172, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_buffer)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(62, 172, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setLocalSizes", 1, 2, 2, 1); __PYX_ERR(62, 172, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setLocalSizes") < 0)) __PYX_ERR(62, 172, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_nlocal = values[0]; __pyx_v_buffer = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setLocalSizes", 1, 2, 2, __pyx_nargs); __PYX_ERR(62, 172, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.setLocalSizes", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_14setLocalSizes(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_nlocal, __pyx_v_buffer); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_14setLocalSizes(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_nlocal, PyObject *__pyx_v_buffer) { PetscInt __pyx_v_cnlocal; PetscInt __pyx_v_cbuffer; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setLocalSizes", 1); /* "petsc4py/PETSc/DMSwarm.pyx":189 * * """ * cdef PetscInt cnlocal = asInt(nlocal) # <<<<<<<<<<<<<< * cdef PetscInt cbuffer = asInt(buffer) * CHKERR( DMSwarmSetLocalSizes(self.dm, cnlocal, cbuffer) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_nlocal); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(62, 189, __pyx_L1_error) __pyx_v_cnlocal = __pyx_t_1; /* "petsc4py/PETSc/DMSwarm.pyx":190 * """ * cdef PetscInt cnlocal = asInt(nlocal) * cdef PetscInt cbuffer = asInt(buffer) # <<<<<<<<<<<<<< * CHKERR( DMSwarmSetLocalSizes(self.dm, cnlocal, cbuffer) ) * return self */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_buffer); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(62, 190, __pyx_L1_error) __pyx_v_cbuffer = __pyx_t_1; /* "petsc4py/PETSc/DMSwarm.pyx":191 * cdef PetscInt cnlocal = asInt(nlocal) * cdef PetscInt cbuffer = asInt(buffer) * CHKERR( DMSwarmSetLocalSizes(self.dm, cnlocal, cbuffer) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmSetLocalSizes(__pyx_v_self->__pyx_base.dm, __pyx_v_cnlocal, __pyx_v_cbuffer)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(62, 191, __pyx_L1_error) /* "petsc4py/PETSc/DMSwarm.pyx":192 * cdef PetscInt cbuffer = asInt(buffer) * CHKERR( DMSwarmSetLocalSizes(self.dm, cnlocal, cbuffer) ) * return self # <<<<<<<<<<<<<< * * def registerField(self, fieldname: str, blocksize: int, dtype: dtype = ScalarType) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/DMSwarm.pyx":172 * CHKERR( DMSwarmFinalizeFieldRegister(self.dm) ) * * def setLocalSizes(self, nlocal: int, buffer: int) -> Self: # <<<<<<<<<<<<<< * """Set the length of all registered fields on the `DMSwarm`. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.setLocalSizes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMSwarm.pyx":194 * return self * * def registerField(self, fieldname: str, blocksize: int, dtype: dtype = ScalarType) -> None: # <<<<<<<<<<<<<< * """Register a field to a `DMSwarm` with a native PETSc data type. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_17registerField(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMSwarm_16registerField, "DMSwarm.registerField(self, fieldname: str, blocksize: int, dtype: dtype = ScalarType) -> None\nRegister a field to a `DMSwarm` with a native PETSc data type.\n\n Collective.\n\n Parameters\n ----------\n fieldname\n The textual name to identify this field.\n blocksize\n The number of each data type.\n dtype\n A valid PETSc data type.\n\n See Also\n --------\n petsc.DMSwarmRegisterPetscDatatypeField\n\n \nSource code at petsc4py/PETSc/DMSwarm.pyx:194"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_17registerField(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_fieldname = 0; PyObject *__pyx_v_blocksize = 0; PyObject *__pyx_v_dtype = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("registerField (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fieldname,&__pyx_n_s_blocksize,&__pyx_n_s_dtype,0}; values[2] = __Pyx_Arg_NewRef_FASTCALL(__pyx_k__63); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fieldname)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(62, 194, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_blocksize)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(62, 194, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("registerField", 0, 2, 3, 1); __PYX_ERR(62, 194, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dtype); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(62, 194, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "registerField") < 0)) __PYX_ERR(62, 194, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_fieldname = values[0]; __pyx_v_blocksize = values[1]; __pyx_v_dtype = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("registerField", 0, 2, 3, __pyx_nargs); __PYX_ERR(62, 194, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.registerField", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_16registerField(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_fieldname, __pyx_v_blocksize, __pyx_v_dtype); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_16registerField(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_fieldname, PyObject *__pyx_v_blocksize, PyObject *__pyx_v_dtype) { char const *__pyx_v_cfieldname; PetscInt __pyx_v_cblocksize; PetscDataType __pyx_v_ctype; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PetscErrorCode __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("registerField", 0); __Pyx_INCREF(__pyx_v_fieldname); /* "petsc4py/PETSc/DMSwarm.pyx":213 * * """ * cdef const char *cfieldname = NULL # <<<<<<<<<<<<<< * cdef PetscInt cblocksize = asInt(blocksize) * cdef PetscDataType ctype = PETSC_DATATYPE_UNKNOWN */ __pyx_v_cfieldname = NULL; /* "petsc4py/PETSc/DMSwarm.pyx":214 * """ * cdef const char *cfieldname = NULL * cdef PetscInt cblocksize = asInt(blocksize) # <<<<<<<<<<<<<< * cdef PetscDataType ctype = PETSC_DATATYPE_UNKNOWN * if dtype == IntType: ctype = PETSC_INT */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_blocksize); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(62, 214, __pyx_L1_error) __pyx_v_cblocksize = __pyx_t_1; /* "petsc4py/PETSc/DMSwarm.pyx":215 * cdef const char *cfieldname = NULL * cdef PetscInt cblocksize = asInt(blocksize) * cdef PetscDataType ctype = PETSC_DATATYPE_UNKNOWN # <<<<<<<<<<<<<< * if dtype == IntType: ctype = PETSC_INT * if dtype == RealType: ctype = PETSC_REAL */ __pyx_v_ctype = PETSC_DATATYPE_UNKNOWN; /* "petsc4py/PETSc/DMSwarm.pyx":216 * cdef PetscInt cblocksize = asInt(blocksize) * cdef PetscDataType ctype = PETSC_DATATYPE_UNKNOWN * if dtype == IntType: ctype = PETSC_INT # <<<<<<<<<<<<<< * if dtype == RealType: ctype = PETSC_REAL * if dtype == ScalarType: ctype = PETSC_SCALAR */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_IntType); if (unlikely(!__pyx_t_2)) __PYX_ERR(62, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyObject_RichCompare(__pyx_v_dtype, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(62, 216, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(62, 216, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { __pyx_v_ctype = PETSC_INT; } /* "petsc4py/PETSc/DMSwarm.pyx":217 * cdef PetscDataType ctype = PETSC_DATATYPE_UNKNOWN * if dtype == IntType: ctype = PETSC_INT * if dtype == RealType: ctype = PETSC_REAL # <<<<<<<<<<<<<< * if dtype == ScalarType: ctype = PETSC_SCALAR * if dtype == ComplexType: ctype = PETSC_COMPLEX */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_RealType); if (unlikely(!__pyx_t_3)) __PYX_ERR(62, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyObject_RichCompare(__pyx_v_dtype, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(62, 217, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(62, 217, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_4) { __pyx_v_ctype = PETSC_REAL; } /* "petsc4py/PETSc/DMSwarm.pyx":218 * if dtype == IntType: ctype = PETSC_INT * if dtype == RealType: ctype = PETSC_REAL * if dtype == ScalarType: ctype = PETSC_SCALAR # <<<<<<<<<<<<<< * if dtype == ComplexType: ctype = PETSC_COMPLEX * assert ctype != PETSC_DATATYPE_UNKNOWN */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ScalarType); if (unlikely(!__pyx_t_2)) __PYX_ERR(62, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyObject_RichCompare(__pyx_v_dtype, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(62, 218, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(62, 218, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { __pyx_v_ctype = PETSC_SCALAR; } /* "petsc4py/PETSc/DMSwarm.pyx":219 * if dtype == RealType: ctype = PETSC_REAL * if dtype == ScalarType: ctype = PETSC_SCALAR * if dtype == ComplexType: ctype = PETSC_COMPLEX # <<<<<<<<<<<<<< * assert ctype != PETSC_DATATYPE_UNKNOWN * fieldname = str2bytes(fieldname, &cfieldname) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ComplexType); if (unlikely(!__pyx_t_3)) __PYX_ERR(62, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyObject_RichCompare(__pyx_v_dtype, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(62, 219, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(62, 219, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_4) { __pyx_v_ctype = PETSC_COMPLEX; } /* "petsc4py/PETSc/DMSwarm.pyx":220 * if dtype == ScalarType: ctype = PETSC_SCALAR * if dtype == ComplexType: ctype = PETSC_COMPLEX * assert ctype != PETSC_DATATYPE_UNKNOWN # <<<<<<<<<<<<<< * fieldname = str2bytes(fieldname, &cfieldname) * CHKERR( DMSwarmRegisterPetscDatatypeField(self.dm, cfieldname, cblocksize, ctype) ) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_4 = (__pyx_v_ctype != PETSC_DATATYPE_UNKNOWN); if (unlikely(!__pyx_t_4)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(62, 220, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(62, 220, __pyx_L1_error) #endif /* "petsc4py/PETSc/DMSwarm.pyx":221 * if dtype == ComplexType: ctype = PETSC_COMPLEX * assert ctype != PETSC_DATATYPE_UNKNOWN * fieldname = str2bytes(fieldname, &cfieldname) # <<<<<<<<<<<<<< * CHKERR( DMSwarmRegisterPetscDatatypeField(self.dm, cfieldname, cblocksize, ctype) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_fieldname, (&__pyx_v_cfieldname)); if (unlikely(!__pyx_t_2)) __PYX_ERR(62, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_fieldname, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DMSwarm.pyx":222 * assert ctype != PETSC_DATATYPE_UNKNOWN * fieldname = str2bytes(fieldname, &cfieldname) * CHKERR( DMSwarmRegisterPetscDatatypeField(self.dm, cfieldname, cblocksize, ctype) ) # <<<<<<<<<<<<<< * * def getField(self, fieldname: str) -> Sequence[int | float | complex]: */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmRegisterPetscDatatypeField(__pyx_v_self->__pyx_base.dm, __pyx_v_cfieldname, __pyx_v_cblocksize, __pyx_v_ctype)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(62, 222, __pyx_L1_error) /* "petsc4py/PETSc/DMSwarm.pyx":194 * return self * * def registerField(self, fieldname: str, blocksize: int, dtype: dtype = ScalarType) -> None: # <<<<<<<<<<<<<< * """Register a field to a `DMSwarm` with a native PETSc data type. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.registerField", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_fieldname); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMSwarm.pyx":224 * CHKERR( DMSwarmRegisterPetscDatatypeField(self.dm, cfieldname, cblocksize, ctype) ) * * def getField(self, fieldname: str) -> Sequence[int | float | complex]: # <<<<<<<<<<<<<< * """Return arrays storing all entries associated with a field. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_19getField(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMSwarm_18getField, "DMSwarm.getField(self, fieldname: str) -> Sequence[int | float | complex]\nReturn arrays storing all entries associated with a field.\n\n Not collective.\n\n The returned array contains underlying values of the field.\n\n The array must be returned to the `DMSwarm` using a matching call to\n `restoreField`.\n\n Parameters\n ----------\n fieldname\n The textual name to identify this field.\n\n Returns\n -------\n `numpy.ndarray`\n The type of the entries in the array will match the type of the\n field.\n\n See Also\n --------\n restoreField, petsc.DMSwarmGetField\n\n \nSource code at petsc4py/PETSc/DMSwarm.pyx:224"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_19getField(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_fieldname = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getField (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fieldname,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fieldname)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(62, 224, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getField") < 0)) __PYX_ERR(62, 224, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_fieldname = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getField", 1, 1, 1, __pyx_nargs); __PYX_ERR(62, 224, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.getField", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_18getField(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_fieldname); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_18getField(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_fieldname) { char const *__pyx_v_cfieldname; PetscInt __pyx_v_blocksize; PetscDataType __pyx_v_ctype; PetscReal *__pyx_v_data; PetscInt __pyx_v_nlocal; int __pyx_v_typenum; npy_intp __pyx_v_s; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getField", 0); __Pyx_INCREF(__pyx_v_fieldname); /* "petsc4py/PETSc/DMSwarm.pyx":250 * * """ * cdef const char *cfieldname = NULL # <<<<<<<<<<<<<< * cdef PetscInt blocksize = 0 * cdef PetscDataType ctype = PETSC_DATATYPE_UNKNOWN */ __pyx_v_cfieldname = NULL; /* "petsc4py/PETSc/DMSwarm.pyx":251 * """ * cdef const char *cfieldname = NULL * cdef PetscInt blocksize = 0 # <<<<<<<<<<<<<< * cdef PetscDataType ctype = PETSC_DATATYPE_UNKNOWN * cdef PetscReal *data = NULL */ __pyx_v_blocksize = 0; /* "petsc4py/PETSc/DMSwarm.pyx":252 * cdef const char *cfieldname = NULL * cdef PetscInt blocksize = 0 * cdef PetscDataType ctype = PETSC_DATATYPE_UNKNOWN # <<<<<<<<<<<<<< * cdef PetscReal *data = NULL * cdef PetscInt nlocal = 0 */ __pyx_v_ctype = PETSC_DATATYPE_UNKNOWN; /* "petsc4py/PETSc/DMSwarm.pyx":253 * cdef PetscInt blocksize = 0 * cdef PetscDataType ctype = PETSC_DATATYPE_UNKNOWN * cdef PetscReal *data = NULL # <<<<<<<<<<<<<< * cdef PetscInt nlocal = 0 * fieldname = str2bytes(fieldname, &cfieldname) */ __pyx_v_data = NULL; /* "petsc4py/PETSc/DMSwarm.pyx":254 * cdef PetscDataType ctype = PETSC_DATATYPE_UNKNOWN * cdef PetscReal *data = NULL * cdef PetscInt nlocal = 0 # <<<<<<<<<<<<<< * fieldname = str2bytes(fieldname, &cfieldname) * CHKERR( DMSwarmGetField(self.dm, cfieldname, &blocksize, &ctype, &data) ) */ __pyx_v_nlocal = 0; /* "petsc4py/PETSc/DMSwarm.pyx":255 * cdef PetscReal *data = NULL * cdef PetscInt nlocal = 0 * fieldname = str2bytes(fieldname, &cfieldname) # <<<<<<<<<<<<<< * CHKERR( DMSwarmGetField(self.dm, cfieldname, &blocksize, &ctype, &data) ) * CHKERR( DMSwarmGetLocalSize(self.dm, &nlocal) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_fieldname, (&__pyx_v_cfieldname)); if (unlikely(!__pyx_t_1)) __PYX_ERR(62, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_fieldname, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DMSwarm.pyx":256 * cdef PetscInt nlocal = 0 * fieldname = str2bytes(fieldname, &cfieldname) * CHKERR( DMSwarmGetField(self.dm, cfieldname, &blocksize, &ctype, &data) ) # <<<<<<<<<<<<<< * CHKERR( DMSwarmGetLocalSize(self.dm, &nlocal) ) * cdef int typenum = -1 */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmGetField(__pyx_v_self->__pyx_base.dm, __pyx_v_cfieldname, (&__pyx_v_blocksize), (&__pyx_v_ctype), ((void **)(&__pyx_v_data)))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(62, 256, __pyx_L1_error) /* "petsc4py/PETSc/DMSwarm.pyx":257 * fieldname = str2bytes(fieldname, &cfieldname) * CHKERR( DMSwarmGetField(self.dm, cfieldname, &blocksize, &ctype, &data) ) * CHKERR( DMSwarmGetLocalSize(self.dm, &nlocal) ) # <<<<<<<<<<<<<< * cdef int typenum = -1 * if ctype == PETSC_INT: typenum = NPY_PETSC_INT */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmGetLocalSize(__pyx_v_self->__pyx_base.dm, (&__pyx_v_nlocal))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(62, 257, __pyx_L1_error) /* "petsc4py/PETSc/DMSwarm.pyx":258 * CHKERR( DMSwarmGetField(self.dm, cfieldname, &blocksize, &ctype, &data) ) * CHKERR( DMSwarmGetLocalSize(self.dm, &nlocal) ) * cdef int typenum = -1 # <<<<<<<<<<<<<< * if ctype == PETSC_INT: typenum = NPY_PETSC_INT * if ctype == PETSC_REAL: typenum = NPY_PETSC_REAL */ __pyx_v_typenum = -1; /* "petsc4py/PETSc/DMSwarm.pyx":259 * CHKERR( DMSwarmGetLocalSize(self.dm, &nlocal) ) * cdef int typenum = -1 * if ctype == PETSC_INT: typenum = NPY_PETSC_INT # <<<<<<<<<<<<<< * if ctype == PETSC_REAL: typenum = NPY_PETSC_REAL * if ctype == PETSC_SCALAR: typenum = NPY_PETSC_SCALAR */ __pyx_t_3 = (__pyx_v_ctype == PETSC_INT); if (__pyx_t_3) { __pyx_v_typenum = NPY_PETSC_INT; } /* "petsc4py/PETSc/DMSwarm.pyx":260 * cdef int typenum = -1 * if ctype == PETSC_INT: typenum = NPY_PETSC_INT * if ctype == PETSC_REAL: typenum = NPY_PETSC_REAL # <<<<<<<<<<<<<< * if ctype == PETSC_SCALAR: typenum = NPY_PETSC_SCALAR * if ctype == PETSC_COMPLEX: typenum = NPY_PETSC_COMPLEX */ __pyx_t_3 = (__pyx_v_ctype == PETSC_REAL); if (__pyx_t_3) { __pyx_v_typenum = NPY_PETSC_REAL; } /* "petsc4py/PETSc/DMSwarm.pyx":261 * if ctype == PETSC_INT: typenum = NPY_PETSC_INT * if ctype == PETSC_REAL: typenum = NPY_PETSC_REAL * if ctype == PETSC_SCALAR: typenum = NPY_PETSC_SCALAR # <<<<<<<<<<<<<< * if ctype == PETSC_COMPLEX: typenum = NPY_PETSC_COMPLEX * assert typenum != -1 */ __pyx_t_3 = (__pyx_v_ctype == PETSC_SCALAR); if (__pyx_t_3) { __pyx_v_typenum = NPY_PETSC_SCALAR; } /* "petsc4py/PETSc/DMSwarm.pyx":262 * if ctype == PETSC_REAL: typenum = NPY_PETSC_REAL * if ctype == PETSC_SCALAR: typenum = NPY_PETSC_SCALAR * if ctype == PETSC_COMPLEX: typenum = NPY_PETSC_COMPLEX # <<<<<<<<<<<<<< * assert typenum != -1 * cdef npy_intp s = nlocal * blocksize */ __pyx_t_3 = (__pyx_v_ctype == PETSC_COMPLEX); if (__pyx_t_3) { __pyx_v_typenum = NPY_PETSC_COMPLEX; } /* "petsc4py/PETSc/DMSwarm.pyx":263 * if ctype == PETSC_SCALAR: typenum = NPY_PETSC_SCALAR * if ctype == PETSC_COMPLEX: typenum = NPY_PETSC_COMPLEX * assert typenum != -1 # <<<<<<<<<<<<<< * cdef npy_intp s = nlocal * blocksize * return PyArray_SimpleNewFromData(1, &s, typenum, data) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_3 = (__pyx_v_typenum != -1L); if (unlikely(!__pyx_t_3)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(62, 263, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(62, 263, __pyx_L1_error) #endif /* "petsc4py/PETSc/DMSwarm.pyx":264 * if ctype == PETSC_COMPLEX: typenum = NPY_PETSC_COMPLEX * assert typenum != -1 * cdef npy_intp s = nlocal * blocksize # <<<<<<<<<<<<<< * return PyArray_SimpleNewFromData(1, &s, typenum, data) * */ __pyx_v_s = (((npy_intp)__pyx_v_nlocal) * __pyx_v_blocksize); /* "petsc4py/PETSc/DMSwarm.pyx":265 * assert typenum != -1 * cdef npy_intp s = nlocal * blocksize * return PyArray_SimpleNewFromData(1, &s, typenum, data) # <<<<<<<<<<<<<< * * def restoreField(self, fieldname: str) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((PyObject *)PyArray_SimpleNewFromData(1, (&__pyx_v_s), __pyx_v_typenum, __pyx_v_data)); if (unlikely(!__pyx_t_1)) __PYX_ERR(62, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_t_1)); __pyx_r = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMSwarm.pyx":224 * CHKERR( DMSwarmRegisterPetscDatatypeField(self.dm, cfieldname, cblocksize, ctype) ) * * def getField(self, fieldname: str) -> Sequence[int | float | complex]: # <<<<<<<<<<<<<< * """Return arrays storing all entries associated with a field. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.getField", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_fieldname); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMSwarm.pyx":267 * return PyArray_SimpleNewFromData(1, &s, typenum, data) * * def restoreField(self, fieldname: str) -> None: # <<<<<<<<<<<<<< * """Restore accesses associated with a registered field. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_21restoreField(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMSwarm_20restoreField, "DMSwarm.restoreField(self, fieldname: str) -> None\nRestore accesses associated with a registered field.\n\n Not collective.\n\n Parameters\n ----------\n fieldname\n The textual name to identify this field.\n\n See Also\n --------\n getField, petsc.DMSwarmRestoreField\n\n \nSource code at petsc4py/PETSc/DMSwarm.pyx:267"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_21restoreField(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_fieldname = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("restoreField (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fieldname,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fieldname)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(62, 267, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "restoreField") < 0)) __PYX_ERR(62, 267, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_fieldname = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("restoreField", 1, 1, 1, __pyx_nargs); __PYX_ERR(62, 267, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.restoreField", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_20restoreField(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_fieldname); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_20restoreField(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_fieldname) { char const *__pyx_v_cfieldname; PetscInt __pyx_v_blocksize; PetscDataType __pyx_v_ctype; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("restoreField", 0); __Pyx_INCREF(__pyx_v_fieldname); /* "petsc4py/PETSc/DMSwarm.pyx":282 * * """ * cdef const char *cfieldname = NULL # <<<<<<<<<<<<<< * cdef PetscInt blocksize = 0 * cdef PetscDataType ctype = PETSC_DATATYPE_UNKNOWN */ __pyx_v_cfieldname = NULL; /* "petsc4py/PETSc/DMSwarm.pyx":283 * """ * cdef const char *cfieldname = NULL * cdef PetscInt blocksize = 0 # <<<<<<<<<<<<<< * cdef PetscDataType ctype = PETSC_DATATYPE_UNKNOWN * fieldname = str2bytes(fieldname, &cfieldname) */ __pyx_v_blocksize = 0; /* "petsc4py/PETSc/DMSwarm.pyx":284 * cdef const char *cfieldname = NULL * cdef PetscInt blocksize = 0 * cdef PetscDataType ctype = PETSC_DATATYPE_UNKNOWN # <<<<<<<<<<<<<< * fieldname = str2bytes(fieldname, &cfieldname) * CHKERR( DMSwarmRestoreField(self.dm, cfieldname, &blocksize, &ctype, 0) ) */ __pyx_v_ctype = PETSC_DATATYPE_UNKNOWN; /* "petsc4py/PETSc/DMSwarm.pyx":285 * cdef PetscInt blocksize = 0 * cdef PetscDataType ctype = PETSC_DATATYPE_UNKNOWN * fieldname = str2bytes(fieldname, &cfieldname) # <<<<<<<<<<<<<< * CHKERR( DMSwarmRestoreField(self.dm, cfieldname, &blocksize, &ctype, 0) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_fieldname, (&__pyx_v_cfieldname)); if (unlikely(!__pyx_t_1)) __PYX_ERR(62, 285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_fieldname, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DMSwarm.pyx":286 * cdef PetscDataType ctype = PETSC_DATATYPE_UNKNOWN * fieldname = str2bytes(fieldname, &cfieldname) * CHKERR( DMSwarmRestoreField(self.dm, cfieldname, &blocksize, &ctype, 0) ) # <<<<<<<<<<<<<< * * def vectorDefineField(self, fieldname: str) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmRestoreField(__pyx_v_self->__pyx_base.dm, __pyx_v_cfieldname, (&__pyx_v_blocksize), (&__pyx_v_ctype), ((void **)0))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(62, 286, __pyx_L1_error) /* "petsc4py/PETSc/DMSwarm.pyx":267 * return PyArray_SimpleNewFromData(1, &s, typenum, data) * * def restoreField(self, fieldname: str) -> None: # <<<<<<<<<<<<<< * """Restore accesses associated with a registered field. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.restoreField", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_fieldname); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMSwarm.pyx":288 * CHKERR( DMSwarmRestoreField(self.dm, cfieldname, &blocksize, &ctype, 0) ) * * def vectorDefineField(self, fieldname: str) -> None: # <<<<<<<<<<<<<< * """Set the field from which to define a `Vec` object. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_23vectorDefineField(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMSwarm_22vectorDefineField, "DMSwarm.vectorDefineField(self, fieldname: str) -> None\nSet the field from which to define a `Vec` object.\n\n Collective.\n\n The field will be used when `DM.createLocalVec`, or\n `DM.createGlobalVec` is called.\n\n Parameters\n ----------\n fieldname\n The textual name given to a registered field.\n\n See Also\n --------\n petsc.DMSwarmVectorDefineField\n\n \nSource code at petsc4py/PETSc/DMSwarm.pyx:288"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_23vectorDefineField(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_fieldname = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("vectorDefineField (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fieldname,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fieldname)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(62, 288, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "vectorDefineField") < 0)) __PYX_ERR(62, 288, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_fieldname = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("vectorDefineField", 1, 1, 1, __pyx_nargs); __PYX_ERR(62, 288, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.vectorDefineField", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_22vectorDefineField(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_fieldname); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_22vectorDefineField(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_fieldname) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("vectorDefineField", 0); __Pyx_INCREF(__pyx_v_fieldname); /* "petsc4py/PETSc/DMSwarm.pyx":306 * * """ * cdef const char *cval = NULL # <<<<<<<<<<<<<< * fieldname = str2bytes(fieldname, &cval) * CHKERR( DMSwarmVectorDefineField(self.dm, cval) ) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/DMSwarm.pyx":307 * """ * cdef const char *cval = NULL * fieldname = str2bytes(fieldname, &cval) # <<<<<<<<<<<<<< * CHKERR( DMSwarmVectorDefineField(self.dm, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_fieldname, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(62, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_fieldname, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DMSwarm.pyx":308 * cdef const char *cval = NULL * fieldname = str2bytes(fieldname, &cval) * CHKERR( DMSwarmVectorDefineField(self.dm, cval) ) # <<<<<<<<<<<<<< * * def addPoint(self) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmVectorDefineField(__pyx_v_self->__pyx_base.dm, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(62, 308, __pyx_L1_error) /* "petsc4py/PETSc/DMSwarm.pyx":288 * CHKERR( DMSwarmRestoreField(self.dm, cfieldname, &blocksize, &ctype, 0) ) * * def vectorDefineField(self, fieldname: str) -> None: # <<<<<<<<<<<<<< * """Set the field from which to define a `Vec` object. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.vectorDefineField", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_fieldname); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMSwarm.pyx":310 * CHKERR( DMSwarmVectorDefineField(self.dm, cval) ) * * def addPoint(self) -> None: # <<<<<<<<<<<<<< * """Add space for one new point in the `DMSwarm`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_25addPoint(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMSwarm_24addPoint, "DMSwarm.addPoint(self) -> None\nAdd space for one new point in the `DMSwarm`.\n\n Not collective.\n\n See Also\n --------\n petsc.DMSwarmAddPoint\n\n \nSource code at petsc4py/PETSc/DMSwarm.pyx:310"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_25addPoint(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("addPoint (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("addPoint", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "addPoint", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_24addPoint(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_24addPoint(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("addPoint", 1); /* "petsc4py/PETSc/DMSwarm.pyx":320 * * """ * CHKERR( DMSwarmAddPoint(self.dm) ) # <<<<<<<<<<<<<< * * def addNPoints(self, npoints: int) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmAddPoint(__pyx_v_self->__pyx_base.dm)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(62, 320, __pyx_L1_error) /* "petsc4py/PETSc/DMSwarm.pyx":310 * CHKERR( DMSwarmVectorDefineField(self.dm, cval) ) * * def addPoint(self) -> None: # <<<<<<<<<<<<<< * """Add space for one new point in the `DMSwarm`. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.addPoint", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMSwarm.pyx":322 * CHKERR( DMSwarmAddPoint(self.dm) ) * * def addNPoints(self, npoints: int) -> None: # <<<<<<<<<<<<<< * """Add space for a number of new points in the `DMSwarm`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_27addNPoints(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMSwarm_26addNPoints, "DMSwarm.addNPoints(self, npoints: int) -> None\nAdd space for a number of new points in the `DMSwarm`.\n\n Not collective.\n\n Parameters\n ----------\n npoints\n The number of new points to add.\n\n See Also\n --------\n petsc.DMSwarmAddNPoints\n\n \nSource code at petsc4py/PETSc/DMSwarm.pyx:322"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_27addNPoints(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_npoints = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("addNPoints (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_npoints,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_npoints)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(62, 322, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "addNPoints") < 0)) __PYX_ERR(62, 322, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_npoints = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("addNPoints", 1, 1, 1, __pyx_nargs); __PYX_ERR(62, 322, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.addNPoints", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_26addNPoints(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_npoints); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_26addNPoints(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_npoints) { PetscInt __pyx_v_cnpoints; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("addNPoints", 1); /* "petsc4py/PETSc/DMSwarm.pyx":337 * * """ * cdef PetscInt cnpoints = asInt(npoints) # <<<<<<<<<<<<<< * CHKERR( DMSwarmAddNPoints(self.dm, cnpoints) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_npoints); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(62, 337, __pyx_L1_error) __pyx_v_cnpoints = __pyx_t_1; /* "petsc4py/PETSc/DMSwarm.pyx":338 * """ * cdef PetscInt cnpoints = asInt(npoints) * CHKERR( DMSwarmAddNPoints(self.dm, cnpoints) ) # <<<<<<<<<<<<<< * * def removePoint(self) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmAddNPoints(__pyx_v_self->__pyx_base.dm, __pyx_v_cnpoints)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(62, 338, __pyx_L1_error) /* "petsc4py/PETSc/DMSwarm.pyx":322 * CHKERR( DMSwarmAddPoint(self.dm) ) * * def addNPoints(self, npoints: int) -> None: # <<<<<<<<<<<<<< * """Add space for a number of new points in the `DMSwarm`. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.addNPoints", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMSwarm.pyx":340 * CHKERR( DMSwarmAddNPoints(self.dm, cnpoints) ) * * def removePoint(self) -> None: # <<<<<<<<<<<<<< * """Remove the last point from the `DMSwarm`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_29removePoint(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMSwarm_28removePoint, "DMSwarm.removePoint(self) -> None\nRemove the last point from the `DMSwarm`.\n\n Not collective.\n\n See Also\n --------\n petsc.DMSwarmRemovePoint\n\n \nSource code at petsc4py/PETSc/DMSwarm.pyx:340"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_29removePoint(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("removePoint (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("removePoint", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "removePoint", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_28removePoint(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_28removePoint(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("removePoint", 1); /* "petsc4py/PETSc/DMSwarm.pyx":350 * * """ * CHKERR( DMSwarmRemovePoint(self.dm) ) # <<<<<<<<<<<<<< * * def removePointAtIndex(self, index: int) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmRemovePoint(__pyx_v_self->__pyx_base.dm)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(62, 350, __pyx_L1_error) /* "petsc4py/PETSc/DMSwarm.pyx":340 * CHKERR( DMSwarmAddNPoints(self.dm, cnpoints) ) * * def removePoint(self) -> None: # <<<<<<<<<<<<<< * """Remove the last point from the `DMSwarm`. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.removePoint", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMSwarm.pyx":352 * CHKERR( DMSwarmRemovePoint(self.dm) ) * * def removePointAtIndex(self, index: int) -> None: # <<<<<<<<<<<<<< * """Remove a specific point from the `DMSwarm`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_31removePointAtIndex(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMSwarm_30removePointAtIndex, "DMSwarm.removePointAtIndex(self, index: int) -> None\nRemove a specific point from the `DMSwarm`.\n\n Not collective.\n\n Parameters\n ----------\n index\n Index of point to remove\n\n See Also\n --------\n petsc.DMSwarmRemovePointAtIndex\n\n \nSource code at petsc4py/PETSc/DMSwarm.pyx:352"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_31removePointAtIndex(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_index = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("removePointAtIndex (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_index)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(62, 352, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "removePointAtIndex") < 0)) __PYX_ERR(62, 352, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_index = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("removePointAtIndex", 1, 1, 1, __pyx_nargs); __PYX_ERR(62, 352, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.removePointAtIndex", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_30removePointAtIndex(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_index); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_30removePointAtIndex(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_index) { PetscInt __pyx_v_cindex; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("removePointAtIndex", 1); /* "petsc4py/PETSc/DMSwarm.pyx":367 * * """ * cdef PetscInt cindex = asInt(index) # <<<<<<<<<<<<<< * CHKERR( DMSwarmRemovePointAtIndex(self.dm, cindex) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_index); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(62, 367, __pyx_L1_error) __pyx_v_cindex = __pyx_t_1; /* "petsc4py/PETSc/DMSwarm.pyx":368 * """ * cdef PetscInt cindex = asInt(index) * CHKERR( DMSwarmRemovePointAtIndex(self.dm, cindex) ) # <<<<<<<<<<<<<< * * def copyPoint(self, pi: int, pj: int) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmRemovePointAtIndex(__pyx_v_self->__pyx_base.dm, __pyx_v_cindex)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(62, 368, __pyx_L1_error) /* "petsc4py/PETSc/DMSwarm.pyx":352 * CHKERR( DMSwarmRemovePoint(self.dm) ) * * def removePointAtIndex(self, index: int) -> None: # <<<<<<<<<<<<<< * """Remove a specific point from the `DMSwarm`. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.removePointAtIndex", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMSwarm.pyx":370 * CHKERR( DMSwarmRemovePointAtIndex(self.dm, cindex) ) * * def copyPoint(self, pi: int, pj: int) -> None: # <<<<<<<<<<<<<< * """Copy point pi to point pj in the `DMSwarm`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_33copyPoint(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMSwarm_32copyPoint, "DMSwarm.copyPoint(self, pi: int, pj: int) -> None\nCopy point pi to point pj in the `DMSwarm`.\n\n Not collective.\n\n Parameters\n ----------\n pi\n The index of the point to copy (source).\n pj\n The point index where the copy should be located (destination).\n\n See Also\n --------\n petsc.DMSwarmCopyPoint\n\n \nSource code at petsc4py/PETSc/DMSwarm.pyx:370"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_33copyPoint(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_pi = 0; PyObject *__pyx_v_pj = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("copyPoint (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pi,&__pyx_n_s_pj,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pi)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(62, 370, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pj)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(62, 370, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("copyPoint", 1, 2, 2, 1); __PYX_ERR(62, 370, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "copyPoint") < 0)) __PYX_ERR(62, 370, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_pi = values[0]; __pyx_v_pj = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("copyPoint", 1, 2, 2, __pyx_nargs); __PYX_ERR(62, 370, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.copyPoint", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_32copyPoint(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_pi, __pyx_v_pj); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_32copyPoint(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_pi, PyObject *__pyx_v_pj) { PetscInt __pyx_v_cpi; PetscInt __pyx_v_cpj; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("copyPoint", 1); /* "petsc4py/PETSc/DMSwarm.pyx":387 * * """ * cdef PetscInt cpi = asInt(pi) # <<<<<<<<<<<<<< * cdef PetscInt cpj = asInt(pj) * CHKERR( DMSwarmCopyPoint(self.dm, cpi, cpj) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_pi); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(62, 387, __pyx_L1_error) __pyx_v_cpi = __pyx_t_1; /* "petsc4py/PETSc/DMSwarm.pyx":388 * """ * cdef PetscInt cpi = asInt(pi) * cdef PetscInt cpj = asInt(pj) # <<<<<<<<<<<<<< * CHKERR( DMSwarmCopyPoint(self.dm, cpi, cpj) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_pj); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(62, 388, __pyx_L1_error) __pyx_v_cpj = __pyx_t_1; /* "petsc4py/PETSc/DMSwarm.pyx":389 * cdef PetscInt cpi = asInt(pi) * cdef PetscInt cpj = asInt(pj) * CHKERR( DMSwarmCopyPoint(self.dm, cpi, cpj) ) # <<<<<<<<<<<<<< * * def getLocalSize(self) -> int: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmCopyPoint(__pyx_v_self->__pyx_base.dm, __pyx_v_cpi, __pyx_v_cpj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(62, 389, __pyx_L1_error) /* "petsc4py/PETSc/DMSwarm.pyx":370 * CHKERR( DMSwarmRemovePointAtIndex(self.dm, cindex) ) * * def copyPoint(self, pi: int, pj: int) -> None: # <<<<<<<<<<<<<< * """Copy point pi to point pj in the `DMSwarm`. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.copyPoint", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMSwarm.pyx":391 * CHKERR( DMSwarmCopyPoint(self.dm, cpi, cpj) ) * * def getLocalSize(self) -> int: # <<<<<<<<<<<<<< * """Return the local length of fields registered. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_35getLocalSize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMSwarm_34getLocalSize, "DMSwarm.getLocalSize(self) -> int\nReturn the local length of fields registered.\n\n Not collective.\n\n See Also\n --------\n petsc.DMSwarmGetLocalSize\n\n \nSource code at petsc4py/PETSc/DMSwarm.pyx:391"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_35getLocalSize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getLocalSize (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getLocalSize", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getLocalSize", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_34getLocalSize(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_34getLocalSize(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self) { PetscInt __pyx_v_size; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getLocalSize", 1); /* "petsc4py/PETSc/DMSwarm.pyx":401 * * """ * cdef PetscInt size = asInt(0) # <<<<<<<<<<<<<< * CHKERR( DMSwarmGetLocalSize(self.dm, &size) ) * return toInt(size) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_int_0); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(62, 401, __pyx_L1_error) __pyx_v_size = __pyx_t_1; /* "petsc4py/PETSc/DMSwarm.pyx":402 * """ * cdef PetscInt size = asInt(0) * CHKERR( DMSwarmGetLocalSize(self.dm, &size) ) # <<<<<<<<<<<<<< * return toInt(size) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmGetLocalSize(__pyx_v_self->__pyx_base.dm, (&__pyx_v_size))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(62, 402, __pyx_L1_error) /* "petsc4py/PETSc/DMSwarm.pyx":403 * cdef PetscInt size = asInt(0) * CHKERR( DMSwarmGetLocalSize(self.dm, &size) ) * return toInt(size) # <<<<<<<<<<<<<< * * def getSize(self) -> int: */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(62, 403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMSwarm.pyx":391 * CHKERR( DMSwarmCopyPoint(self.dm, cpi, cpj) ) * * def getLocalSize(self) -> int: # <<<<<<<<<<<<<< * """Return the local length of fields registered. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.getLocalSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMSwarm.pyx":405 * return toInt(size) * * def getSize(self) -> int: # <<<<<<<<<<<<<< * """Return the total length of fields registered. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_37getSize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMSwarm_36getSize, "DMSwarm.getSize(self) -> int\nReturn the total length of fields registered.\n\n Collective.\n\n See Also\n --------\n petsc.DMSwarmGetSize\n\n \nSource code at petsc4py/PETSc/DMSwarm.pyx:405"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_37getSize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSize (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getSize", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getSize", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_36getSize(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_36getSize(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self) { PetscInt __pyx_v_size; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSize", 1); /* "petsc4py/PETSc/DMSwarm.pyx":415 * * """ * cdef PetscInt size = asInt(0) # <<<<<<<<<<<<<< * CHKERR( DMSwarmGetSize(self.dm, &size) ) * return toInt(size) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_int_0); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(62, 415, __pyx_L1_error) __pyx_v_size = __pyx_t_1; /* "petsc4py/PETSc/DMSwarm.pyx":416 * """ * cdef PetscInt size = asInt(0) * CHKERR( DMSwarmGetSize(self.dm, &size) ) # <<<<<<<<<<<<<< * return toInt(size) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmGetSize(__pyx_v_self->__pyx_base.dm, (&__pyx_v_size))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(62, 416, __pyx_L1_error) /* "petsc4py/PETSc/DMSwarm.pyx":417 * cdef PetscInt size = asInt(0) * CHKERR( DMSwarmGetSize(self.dm, &size) ) * return toInt(size) # <<<<<<<<<<<<<< * * def migrate(self, remove_sent_points: bool = False) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(62, 417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMSwarm.pyx":405 * return toInt(size) * * def getSize(self) -> int: # <<<<<<<<<<<<<< * """Return the total length of fields registered. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.getSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMSwarm.pyx":419 * return toInt(size) * * def migrate(self, remove_sent_points: bool = False) -> None: # <<<<<<<<<<<<<< * """Relocate points defined in the `DMSwarm` to other MPI ranks. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_39migrate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMSwarm_38migrate, "DMSwarm.migrate(self, remove_sent_points: bool = False) -> None\nRelocate points defined in the `DMSwarm` to other MPI ranks.\n\n Collective.\n\n Parameters\n ----------\n remove_sent_points\n Flag indicating if sent points should be removed from the current\n MPI rank.\n\n See Also\n --------\n petsc.DMSwarmMigrate\n\n \nSource code at petsc4py/PETSc/DMSwarm.pyx:419"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_39migrate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_remove_sent_points = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("migrate (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_remove_sent_points,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_remove_sent_points); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(62, 419, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "migrate") < 0)) __PYX_ERR(62, 419, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_remove_sent_points = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("migrate", 0, 0, 1, __pyx_nargs); __PYX_ERR(62, 419, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.migrate", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_38migrate(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_remove_sent_points); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_38migrate(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_remove_sent_points) { PetscBool __pyx_v_remove_pts; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("migrate", 1); /* "petsc4py/PETSc/DMSwarm.pyx":435 * * """ * cdef PetscBool remove_pts = asBool(remove_sent_points) # <<<<<<<<<<<<<< * CHKERR( DMSwarmMigrate(self.dm, remove_pts) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asBool(__pyx_v_remove_sent_points); if (unlikely(__pyx_t_1 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(62, 435, __pyx_L1_error) __pyx_v_remove_pts = __pyx_t_1; /* "petsc4py/PETSc/DMSwarm.pyx":436 * """ * cdef PetscBool remove_pts = asBool(remove_sent_points) * CHKERR( DMSwarmMigrate(self.dm, remove_pts) ) # <<<<<<<<<<<<<< * * def collectViewCreate(self) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmMigrate(__pyx_v_self->__pyx_base.dm, __pyx_v_remove_pts)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(62, 436, __pyx_L1_error) /* "petsc4py/PETSc/DMSwarm.pyx":419 * return toInt(size) * * def migrate(self, remove_sent_points: bool = False) -> None: # <<<<<<<<<<<<<< * """Relocate points defined in the `DMSwarm` to other MPI ranks. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.migrate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMSwarm.pyx":438 * CHKERR( DMSwarmMigrate(self.dm, remove_pts) ) * * def collectViewCreate(self) -> None: # <<<<<<<<<<<<<< * """Apply a collection method and gather points in neighbor ranks. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_41collectViewCreate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMSwarm_40collectViewCreate, "DMSwarm.collectViewCreate(self) -> None\nApply a collection method and gather points in neighbor ranks.\n\n Collective.\n\n See Also\n --------\n collectViewDestroy, petsc.DMSwarmCollectViewCreate\n\n \nSource code at petsc4py/PETSc/DMSwarm.pyx:438"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_41collectViewCreate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("collectViewCreate (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("collectViewCreate", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "collectViewCreate", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_40collectViewCreate(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_40collectViewCreate(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("collectViewCreate", 1); /* "petsc4py/PETSc/DMSwarm.pyx":448 * * """ * CHKERR( DMSwarmCollectViewCreate(self.dm) ) # <<<<<<<<<<<<<< * * def collectViewDestroy(self) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmCollectViewCreate(__pyx_v_self->__pyx_base.dm)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(62, 448, __pyx_L1_error) /* "petsc4py/PETSc/DMSwarm.pyx":438 * CHKERR( DMSwarmMigrate(self.dm, remove_pts) ) * * def collectViewCreate(self) -> None: # <<<<<<<<<<<<<< * """Apply a collection method and gather points in neighbor ranks. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.collectViewCreate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMSwarm.pyx":450 * CHKERR( DMSwarmCollectViewCreate(self.dm) ) * * def collectViewDestroy(self) -> None: # <<<<<<<<<<<<<< * """Reset the `DMSwarm` to the size prior to calling `collectViewCreate`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_43collectViewDestroy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMSwarm_42collectViewDestroy, "DMSwarm.collectViewDestroy(self) -> None\nReset the `DMSwarm` to the size prior to calling `collectViewCreate`.\n\n Collective.\n\n See Also\n --------\n collectViewCreate, petsc.DMSwarmCollectViewDestroy\n\n \nSource code at petsc4py/PETSc/DMSwarm.pyx:450"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_43collectViewDestroy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("collectViewDestroy (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("collectViewDestroy", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "collectViewDestroy", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_42collectViewDestroy(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_42collectViewDestroy(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("collectViewDestroy", 1); /* "petsc4py/PETSc/DMSwarm.pyx":460 * * """ * CHKERR( DMSwarmCollectViewDestroy(self.dm) ) # <<<<<<<<<<<<<< * * def setCellDM(self, DM dm) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmCollectViewDestroy(__pyx_v_self->__pyx_base.dm)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(62, 460, __pyx_L1_error) /* "petsc4py/PETSc/DMSwarm.pyx":450 * CHKERR( DMSwarmCollectViewCreate(self.dm) ) * * def collectViewDestroy(self) -> None: # <<<<<<<<<<<<<< * """Reset the `DMSwarm` to the size prior to calling `collectViewCreate`. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.collectViewDestroy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMSwarm.pyx":462 * CHKERR( DMSwarmCollectViewDestroy(self.dm) ) * * def setCellDM(self, DM dm) -> None: # <<<<<<<<<<<<<< * """Attach a `DM` to a `DMSwarm`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_45setCellDM(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMSwarm_44setCellDM, "DMSwarm.setCellDM(self, dm: DM) -> None\nAttach a `DM` to a `DMSwarm`.\n\n Collective.\n\n Parameters\n ----------\n dm\n The `DM` to attach to the `DMSwarm`.\n\n See Also\n --------\n getCellDM, petsc.DMSwarmSetCellDM\n\n \nSource code at petsc4py/PETSc/DMSwarm.pyx:462"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_45setCellDM(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscDMObject *__pyx_v_dm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setCellDM (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dm,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dm)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(62, 462, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setCellDM") < 0)) __PYX_ERR(62, 462, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_dm = ((struct PyPetscDMObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setCellDM", 1, 1, 1, __pyx_nargs); __PYX_ERR(62, 462, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.setCellDM", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_ptype_8petsc4py_5PETSc_DM, 0, "dm", 0))) __PYX_ERR(62, 462, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_44setCellDM(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_dm); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_44setCellDM(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setCellDM", 1); /* "petsc4py/PETSc/DMSwarm.pyx":477 * * """ * CHKERR( DMSwarmSetCellDM(self.dm, dm.dm) ) # <<<<<<<<<<<<<< * * def getCellDM(self) -> DM: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmSetCellDM(__pyx_v_self->__pyx_base.dm, __pyx_v_dm->dm)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(62, 477, __pyx_L1_error) /* "petsc4py/PETSc/DMSwarm.pyx":462 * CHKERR( DMSwarmCollectViewDestroy(self.dm) ) * * def setCellDM(self, DM dm) -> None: # <<<<<<<<<<<<<< * """Attach a `DM` to a `DMSwarm`. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.setCellDM", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMSwarm.pyx":479 * CHKERR( DMSwarmSetCellDM(self.dm, dm.dm) ) * * def getCellDM(self) -> DM: # <<<<<<<<<<<<<< * """Return `DM` cell attached to `DMSwarm`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_47getCellDM(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMSwarm_46getCellDM, "DMSwarm.getCellDM(self) -> DM\nReturn `DM` cell attached to `DMSwarm`.\n\n Collective.\n\n See Also\n --------\n setCellDM, petsc.DMSwarmGetCellDM\n\n \nSource code at petsc4py/PETSc/DMSwarm.pyx:479"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_47getCellDM(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getCellDM (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getCellDM", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getCellDM", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_46getCellDM(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_46getCellDM(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self) { DM __pyx_v_newdm; struct PyPetscDMObject *__pyx_v_dm = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getCellDM", 1); /* "petsc4py/PETSc/DMSwarm.pyx":489 * * """ * cdef PetscDM newdm = NULL # <<<<<<<<<<<<<< * CHKERR( DMSwarmGetCellDM(self.dm, &newdm) ) * cdef DM dm = subtype_DM(newdm)() */ __pyx_v_newdm = NULL; /* "petsc4py/PETSc/DMSwarm.pyx":490 * """ * cdef PetscDM newdm = NULL * CHKERR( DMSwarmGetCellDM(self.dm, &newdm) ) # <<<<<<<<<<<<<< * cdef DM dm = subtype_DM(newdm)() * dm.dm = newdm */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmGetCellDM(__pyx_v_self->__pyx_base.dm, (&__pyx_v_newdm))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(62, 490, __pyx_L1_error) /* "petsc4py/PETSc/DMSwarm.pyx":491 * cdef PetscDM newdm = NULL * CHKERR( DMSwarmGetCellDM(self.dm, &newdm) ) * cdef DM dm = subtype_DM(newdm)() # <<<<<<<<<<<<<< * dm.dm = newdm * CHKERR( PetscINCREF(dm.obj) ) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_newdm)); if (unlikely(!__pyx_t_2)) __PYX_ERR(62, 491, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(62, 491, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(62, 491, __pyx_L1_error) __pyx_v_dm = ((struct PyPetscDMObject *)__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/DMSwarm.pyx":492 * CHKERR( DMSwarmGetCellDM(self.dm, &newdm) ) * cdef DM dm = subtype_DM(newdm)() * dm.dm = newdm # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(dm.obj) ) * return dm */ __pyx_v_dm->dm = __pyx_v_newdm; /* "petsc4py/PETSc/DMSwarm.pyx":493 * cdef DM dm = subtype_DM(newdm)() * dm.dm = newdm * CHKERR( PetscINCREF(dm.obj) ) # <<<<<<<<<<<<<< * return dm * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_dm->__pyx_base.obj)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(62, 493, __pyx_L1_error) /* "petsc4py/PETSc/DMSwarm.pyx":494 * dm.dm = newdm * CHKERR( PetscINCREF(dm.obj) ) * return dm # <<<<<<<<<<<<<< * * def setType(self, dmswarm_type: Type | str) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_dm); __pyx_r = ((PyObject *)__pyx_v_dm); goto __pyx_L0; /* "petsc4py/PETSc/DMSwarm.pyx":479 * CHKERR( DMSwarmSetCellDM(self.dm, dm.dm) ) * * def getCellDM(self) -> DM: # <<<<<<<<<<<<<< * """Return `DM` cell attached to `DMSwarm`. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.getCellDM", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_dm); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMSwarm.pyx":496 * return dm * * def setType(self, dmswarm_type: Type | str) -> None: # <<<<<<<<<<<<<< * """Set particular flavor of `DMSwarm`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_49setType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMSwarm_48setType, "DMSwarm.setType(self, dmswarm_type: Type | str) -> None\nSet particular flavor of `DMSwarm`.\n\n Collective.\n\n Parameters\n ----------\n dmswarm_type\n The `DMSwarm` type.\n\n See Also\n --------\n petsc.DMSwarmSetType\n\n \nSource code at petsc4py/PETSc/DMSwarm.pyx:496"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_49setType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_dmswarm_type = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dmswarm_type,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dmswarm_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(62, 496, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setType") < 0)) __PYX_ERR(62, 496, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_dmswarm_type = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, __pyx_nargs); __PYX_ERR(62, 496, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_48setType(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_dmswarm_type); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_48setType(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_dmswarm_type) { DMSwarmType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations DMSwarmType __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setType", 1); /* "petsc4py/PETSc/DMSwarm.pyx":511 * * """ * cdef PetscDMSwarmType cval = dmswarm_type # <<<<<<<<<<<<<< * CHKERR( DMSwarmSetType(self.dm, cval) ) * */ __pyx_t_1 = ((DMSwarmType)__Pyx_PyInt_As_DMSwarmType(__pyx_v_dmswarm_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(62, 511, __pyx_L1_error) __pyx_v_cval = __pyx_t_1; /* "petsc4py/PETSc/DMSwarm.pyx":512 * """ * cdef PetscDMSwarmType cval = dmswarm_type * CHKERR( DMSwarmSetType(self.dm, cval) ) # <<<<<<<<<<<<<< * * def setPointsUniformCoordinates( */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmSetType(__pyx_v_self->__pyx_base.dm, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(62, 512, __pyx_L1_error) /* "petsc4py/PETSc/DMSwarm.pyx":496 * return dm * * def setType(self, dmswarm_type: Type | str) -> None: # <<<<<<<<<<<<<< * """Set particular flavor of `DMSwarm`. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMSwarm.pyx":514 * CHKERR( DMSwarmSetType(self.dm, cval) ) * * def setPointsUniformCoordinates( # <<<<<<<<<<<<<< * self, * min: Sequence[float], */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_51setPointsUniformCoordinates(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMSwarm_50setPointsUniformCoordinates, "DMSwarm.setPointsUniformCoordinates(self, min: Sequence[float], max: Sequence[float], npoints: Sequence[int], mode: InsertMode | None = None) -> Self\nSet point coordinates in a `DMSwarm` on a regular (ijk) grid.\n\n Collective.\n\n Parameters\n ----------\n min\n Minimum coordinate values in the x, y, z directions (array of\n length ``dim``).\n max\n Maximum coordinate values in the x, y, z directions (array of\n length ``dim``).\n npoints\n Number of points in each spatial direction (array of length ``dim``).\n mode\n Indicates whether to append points to the swarm (`InsertMode.ADD`),\n or override existing points (`InsertMode.INSERT`).\n\n See Also\n --------\n petsc.DMSwarmSetPointsUniformCoordinates\n\n \nSource code at petsc4py/PETSc/DMSwarm.pyx:514"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_51setPointsUniformCoordinates(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_min = 0; PyObject *__pyx_v_max = 0; PyObject *__pyx_v_npoints = 0; PyObject *__pyx_v_mode = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPointsUniformCoordinates (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_min,&__pyx_n_s_max,&__pyx_n_s_npoints,&__pyx_n_s_mode,0}; /* "petsc4py/PETSc/DMSwarm.pyx":519 * max: Sequence[float], * npoints: Sequence[int], * mode: InsertMode | None = None, # <<<<<<<<<<<<<< * ) -> Self: * """Set point coordinates in a `DMSwarm` on a regular (ijk) grid. */ values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_min)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(62, 514, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_max)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(62, 514, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setPointsUniformCoordinates", 0, 3, 4, 1); __PYX_ERR(62, 514, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_npoints)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(62, 514, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setPointsUniformCoordinates", 0, 3, 4, 2); __PYX_ERR(62, 514, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mode); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(62, 514, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setPointsUniformCoordinates") < 0)) __PYX_ERR(62, 514, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_min = values[0]; __pyx_v_max = values[1]; __pyx_v_npoints = values[2]; __pyx_v_mode = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPointsUniformCoordinates", 0, 3, 4, __pyx_nargs); __PYX_ERR(62, 514, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.setPointsUniformCoordinates", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_50setPointsUniformCoordinates(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_min, __pyx_v_max, __pyx_v_npoints, __pyx_v_mode); /* "petsc4py/PETSc/DMSwarm.pyx":514 * CHKERR( DMSwarmSetType(self.dm, cval) ) * * def setPointsUniformCoordinates( # <<<<<<<<<<<<<< * self, * min: Sequence[float], */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_50setPointsUniformCoordinates(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_min, PyObject *__pyx_v_max, PyObject *__pyx_v_npoints, PyObject *__pyx_v_mode) { PetscInt __pyx_v_dim; PetscReal __pyx_v_cmin[3]; long __pyx_v_i; PetscReal __pyx_v_cmax[3]; PetscInt __pyx_v_cnpoints[3]; InsertMode __pyx_v_cmode; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; PetscReal __pyx_t_3; PyObject *__pyx_t_4 = NULL; PetscInt __pyx_t_5; InsertMode __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPointsUniformCoordinates", 1); /* "petsc4py/PETSc/DMSwarm.pyx":544 * * """ * cdef PetscInt dim = asInt(0) # <<<<<<<<<<<<<< * CHKERR( DMGetDimension(self.dm, &dim) ) * cdef PetscReal cmin[3] */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_int_0); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(62, 544, __pyx_L1_error) __pyx_v_dim = __pyx_t_1; /* "petsc4py/PETSc/DMSwarm.pyx":545 * """ * cdef PetscInt dim = asInt(0) * CHKERR( DMGetDimension(self.dm, &dim) ) # <<<<<<<<<<<<<< * cdef PetscReal cmin[3] * cmin[0] = cmin[1] = cmin[2] = asReal(0.) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetDimension(__pyx_v_self->__pyx_base.dm, (&__pyx_v_dim))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(62, 545, __pyx_L1_error) /* "petsc4py/PETSc/DMSwarm.pyx":547 * CHKERR( DMGetDimension(self.dm, &dim) ) * cdef PetscReal cmin[3] * cmin[0] = cmin[1] = cmin[2] = asReal(0.) # <<<<<<<<<<<<<< * for i from 0 <= i < dim: cmin[i] = min[i] * cdef PetscReal cmax[3] */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_float_0_); if (unlikely(__pyx_t_3 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(62, 547, __pyx_L1_error) (__pyx_v_cmin[0]) = __pyx_t_3; (__pyx_v_cmin[1]) = __pyx_t_3; (__pyx_v_cmin[2]) = __pyx_t_3; /* "petsc4py/PETSc/DMSwarm.pyx":548 * cdef PetscReal cmin[3] * cmin[0] = cmin[1] = cmin[2] = asReal(0.) * for i from 0 <= i < dim: cmin[i] = min[i] # <<<<<<<<<<<<<< * cdef PetscReal cmax[3] * cmax[0] = cmax[1] = cmax[2] = asReal(0.) */ __pyx_t_1 = __pyx_v_dim; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_min, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 548, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_3 == ((PetscReal)-1)) && PyErr_Occurred())) __PYX_ERR(62, 548, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; (__pyx_v_cmin[__pyx_v_i]) = __pyx_t_3; } /* "petsc4py/PETSc/DMSwarm.pyx":550 * for i from 0 <= i < dim: cmin[i] = min[i] * cdef PetscReal cmax[3] * cmax[0] = cmax[1] = cmax[2] = asReal(0.) # <<<<<<<<<<<<<< * for i from 0 <= i < dim: cmax[i] = max[i] * cdef PetscInt cnpoints[3] */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_float_0_); if (unlikely(__pyx_t_3 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(62, 550, __pyx_L1_error) (__pyx_v_cmax[0]) = __pyx_t_3; (__pyx_v_cmax[1]) = __pyx_t_3; (__pyx_v_cmax[2]) = __pyx_t_3; /* "petsc4py/PETSc/DMSwarm.pyx":551 * cdef PetscReal cmax[3] * cmax[0] = cmax[1] = cmax[2] = asReal(0.) * for i from 0 <= i < dim: cmax[i] = max[i] # <<<<<<<<<<<<<< * cdef PetscInt cnpoints[3] * cnpoints[0] = cnpoints[1] = cnpoints[2] = asInt(0) */ __pyx_t_1 = __pyx_v_dim; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_max, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_3 == ((PetscReal)-1)) && PyErr_Occurred())) __PYX_ERR(62, 551, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; (__pyx_v_cmax[__pyx_v_i]) = __pyx_t_3; } /* "petsc4py/PETSc/DMSwarm.pyx":553 * for i from 0 <= i < dim: cmax[i] = max[i] * cdef PetscInt cnpoints[3] * cnpoints[0] = cnpoints[1] = cnpoints[2] = asInt(0) # <<<<<<<<<<<<<< * for i from 0 <= i < dim: cnpoints[i] = npoints[i] * cdef PetscInsertMode cmode = insertmode(mode) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_int_0); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(62, 553, __pyx_L1_error) (__pyx_v_cnpoints[0]) = __pyx_t_1; (__pyx_v_cnpoints[1]) = __pyx_t_1; (__pyx_v_cnpoints[2]) = __pyx_t_1; /* "petsc4py/PETSc/DMSwarm.pyx":554 * cdef PetscInt cnpoints[3] * cnpoints[0] = cnpoints[1] = cnpoints[2] = asInt(0) * for i from 0 <= i < dim: cnpoints[i] = npoints[i] # <<<<<<<<<<<<<< * cdef PetscInsertMode cmode = insertmode(mode) * CHKERR( DMSwarmSetPointsUniformCoordinates(self.dm, cmin, cmax, cnpoints, cmode) ) */ __pyx_t_1 = __pyx_v_dim; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_npoints, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 554, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_As_PetscInt(__pyx_t_4); if (unlikely((__pyx_t_5 == ((PetscInt)-1)) && PyErr_Occurred())) __PYX_ERR(62, 554, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; (__pyx_v_cnpoints[__pyx_v_i]) = __pyx_t_5; } /* "petsc4py/PETSc/DMSwarm.pyx":555 * cnpoints[0] = cnpoints[1] = cnpoints[2] = asInt(0) * for i from 0 <= i < dim: cnpoints[i] = npoints[i] * cdef PetscInsertMode cmode = insertmode(mode) # <<<<<<<<<<<<<< * CHKERR( DMSwarmSetPointsUniformCoordinates(self.dm, cmin, cmax, cnpoints, cmode) ) * return self */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_insertmode(__pyx_v_mode); if (unlikely(__pyx_t_6 == ((InsertMode)((InsertMode)-1L)))) __PYX_ERR(62, 555, __pyx_L1_error) __pyx_v_cmode = __pyx_t_6; /* "petsc4py/PETSc/DMSwarm.pyx":556 * for i from 0 <= i < dim: cnpoints[i] = npoints[i] * cdef PetscInsertMode cmode = insertmode(mode) * CHKERR( DMSwarmSetPointsUniformCoordinates(self.dm, cmin, cmax, cnpoints, cmode) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmSetPointsUniformCoordinates(__pyx_v_self->__pyx_base.dm, __pyx_v_cmin, __pyx_v_cmax, __pyx_v_cnpoints, __pyx_v_cmode)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(62, 556, __pyx_L1_error) /* "petsc4py/PETSc/DMSwarm.pyx":557 * cdef PetscInsertMode cmode = insertmode(mode) * CHKERR( DMSwarmSetPointsUniformCoordinates(self.dm, cmin, cmax, cnpoints, cmode) ) * return self # <<<<<<<<<<<<<< * * def setPointCoordinates( */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/DMSwarm.pyx":514 * CHKERR( DMSwarmSetType(self.dm, cval) ) * * def setPointsUniformCoordinates( # <<<<<<<<<<<<<< * self, * min: Sequence[float], */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.setPointsUniformCoordinates", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMSwarm.pyx":559 * return self * * def setPointCoordinates( # <<<<<<<<<<<<<< * self, * coordinates: Sequence[float], */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_53setPointCoordinates(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMSwarm_52setPointCoordinates, "DMSwarm.setPointCoordinates(self, coordinates: Sequence[float], redundant: bool = False, mode: InsertMode | None = None) -> None\nSet point coordinates in a `DMSwarm` from a user-defined list.\n\n Collective.\n\n Parameters\n ----------\n coordinates\n The coordinate values.\n redundant\n If set to `True`, it is assumed that coordinates are only valid on\n rank 0 and should be broadcast to other ranks.\n mode\n Indicates whether to append points to the swarm (`InsertMode.ADD`),\n or override existing points (`InsertMode.INSERT`).\n\n See Also\n --------\n petsc.DMSwarmSetPointCoordinates\n\n \nSource code at petsc4py/PETSc/DMSwarm.pyx:559"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_53setPointCoordinates(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_coordinates = 0; PyObject *__pyx_v_redundant = 0; PyObject *__pyx_v_mode = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPointCoordinates (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_coordinates,&__pyx_n_s_redundant,&__pyx_n_s_mode,0}; /* "petsc4py/PETSc/DMSwarm.pyx":562 * self, * coordinates: Sequence[float], * redundant: bool = False, # <<<<<<<<<<<<<< * mode: InsertMode | None = None * ) -> None: */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False)); /* "petsc4py/PETSc/DMSwarm.pyx":563 * coordinates: Sequence[float], * redundant: bool = False, * mode: InsertMode | None = None # <<<<<<<<<<<<<< * ) -> None: * """Set point coordinates in a `DMSwarm` from a user-defined list. */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_coordinates)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(62, 559, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_redundant); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(62, 559, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mode); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(62, 559, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setPointCoordinates") < 0)) __PYX_ERR(62, 559, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_coordinates = values[0]; __pyx_v_redundant = values[1]; __pyx_v_mode = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPointCoordinates", 0, 1, 3, __pyx_nargs); __PYX_ERR(62, 559, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.setPointCoordinates", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_52setPointCoordinates(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_coordinates, __pyx_v_redundant, __pyx_v_mode); /* "petsc4py/PETSc/DMSwarm.pyx":559 * return self * * def setPointCoordinates( # <<<<<<<<<<<<<< * self, * coordinates: Sequence[float], */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_52setPointCoordinates(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_coordinates, PyObject *__pyx_v_redundant, PyObject *__pyx_v_mode) { PyArrayObject *__pyx_v_xyz = 0; PetscInt __pyx_v_cnpoints; PetscBool __pyx_v_credundant; InsertMode __pyx_v_cmode; PetscReal *__pyx_v_coords; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PetscBool __pyx_t_4; InsertMode __pyx_t_5; PetscErrorCode __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPointCoordinates", 1); /* "petsc4py/PETSc/DMSwarm.pyx":585 * * """ * cdef ndarray xyz = iarray(coordinates, NPY_PETSC_REAL) # <<<<<<<<<<<<<< * if PyArray_ISFORTRAN(xyz): xyz = PyArray_Copy(xyz) * if PyArray_NDIM(xyz) != 2: raise ValueError( */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray(__pyx_v_coordinates, NPY_PETSC_REAL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(62, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_xyz = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DMSwarm.pyx":586 * """ * cdef ndarray xyz = iarray(coordinates, NPY_PETSC_REAL) * if PyArray_ISFORTRAN(xyz): xyz = PyArray_Copy(xyz) # <<<<<<<<<<<<<< * if PyArray_NDIM(xyz) != 2: raise ValueError( * ("coordinates must have two dimensions: " */ __pyx_t_2 = PyArray_ISFORTRAN(__pyx_v_xyz); if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)PyArray_Copy(__pyx_v_xyz)); if (unlikely(!__pyx_t_1)) __PYX_ERR(62, 586, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_xyz, ((PyArrayObject *)__pyx_t_1)); __pyx_t_1 = 0; } /* "petsc4py/PETSc/DMSwarm.pyx":587 * cdef ndarray xyz = iarray(coordinates, NPY_PETSC_REAL) * if PyArray_ISFORTRAN(xyz): xyz = PyArray_Copy(xyz) * if PyArray_NDIM(xyz) != 2: raise ValueError( # <<<<<<<<<<<<<< * ("coordinates must have two dimensions: " * "coordinates.ndim=%d") % (PyArray_NDIM(xyz)) ) */ __pyx_t_2 = (PyArray_NDIM(__pyx_v_xyz) != 2); if (unlikely(__pyx_t_2)) { /* "petsc4py/PETSc/DMSwarm.pyx":589 * if PyArray_NDIM(xyz) != 2: raise ValueError( * ("coordinates must have two dimensions: " * "coordinates.ndim=%d") % (PyArray_NDIM(xyz)) ) # <<<<<<<<<<<<<< * cdef PetscInt cnpoints = PyArray_DIM(xyz, 0) * cdef PetscBool credundant = asBool(redundant) */ __pyx_t_1 = __Pyx_PyInt_From_int(PyArray_NDIM(__pyx_v_xyz)); if (unlikely(!__pyx_t_1)) __PYX_ERR(62, 589, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_coordinates_must_have_two_dimens, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(62, 589, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DMSwarm.pyx":587 * cdef ndarray xyz = iarray(coordinates, NPY_PETSC_REAL) * if PyArray_ISFORTRAN(xyz): xyz = PyArray_Copy(xyz) * if PyArray_NDIM(xyz) != 2: raise ValueError( # <<<<<<<<<<<<<< * ("coordinates must have two dimensions: " * "coordinates.ndim=%d") % (PyArray_NDIM(xyz)) ) */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(62, 587, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(62, 587, __pyx_L1_error) } /* "petsc4py/PETSc/DMSwarm.pyx":590 * ("coordinates must have two dimensions: " * "coordinates.ndim=%d") % (PyArray_NDIM(xyz)) ) * cdef PetscInt cnpoints = PyArray_DIM(xyz, 0) # <<<<<<<<<<<<<< * cdef PetscBool credundant = asBool(redundant) * cdef PetscInsertMode cmode = insertmode(mode) */ __pyx_v_cnpoints = ((PetscInt)PyArray_DIM(__pyx_v_xyz, 0)); /* "petsc4py/PETSc/DMSwarm.pyx":591 * "coordinates.ndim=%d") % (PyArray_NDIM(xyz)) ) * cdef PetscInt cnpoints = PyArray_DIM(xyz, 0) * cdef PetscBool credundant = asBool(redundant) # <<<<<<<<<<<<<< * cdef PetscInsertMode cmode = insertmode(mode) * cdef PetscReal *coords = PyArray_DATA(xyz) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asBool(__pyx_v_redundant); if (unlikely(__pyx_t_4 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(62, 591, __pyx_L1_error) __pyx_v_credundant = __pyx_t_4; /* "petsc4py/PETSc/DMSwarm.pyx":592 * cdef PetscInt cnpoints = PyArray_DIM(xyz, 0) * cdef PetscBool credundant = asBool(redundant) * cdef PetscInsertMode cmode = insertmode(mode) # <<<<<<<<<<<<<< * cdef PetscReal *coords = PyArray_DATA(xyz) * CHKERR( DMSwarmSetPointCoordinates(self.dm, cnpoints, coords, credundant, cmode) ) */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_insertmode(__pyx_v_mode); if (unlikely(__pyx_t_5 == ((InsertMode)((InsertMode)-1L)))) __PYX_ERR(62, 592, __pyx_L1_error) __pyx_v_cmode = __pyx_t_5; /* "petsc4py/PETSc/DMSwarm.pyx":593 * cdef PetscBool credundant = asBool(redundant) * cdef PetscInsertMode cmode = insertmode(mode) * cdef PetscReal *coords = PyArray_DATA(xyz) # <<<<<<<<<<<<<< * CHKERR( DMSwarmSetPointCoordinates(self.dm, cnpoints, coords, credundant, cmode) ) * */ __pyx_v_coords = ((PetscReal *)PyArray_DATA(__pyx_v_xyz)); /* "petsc4py/PETSc/DMSwarm.pyx":594 * cdef PetscInsertMode cmode = insertmode(mode) * cdef PetscReal *coords = PyArray_DATA(xyz) * CHKERR( DMSwarmSetPointCoordinates(self.dm, cnpoints, coords, credundant, cmode) ) # <<<<<<<<<<<<<< * * def insertPointUsingCellDM(self, layoutType: PICLayoutType, fill_param: int) -> None: */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmSetPointCoordinates(__pyx_v_self->__pyx_base.dm, __pyx_v_cnpoints, __pyx_v_coords, __pyx_v_credundant, __pyx_v_cmode)); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(62, 594, __pyx_L1_error) /* "petsc4py/PETSc/DMSwarm.pyx":559 * return self * * def setPointCoordinates( # <<<<<<<<<<<<<< * self, * coordinates: Sequence[float], */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.setPointCoordinates", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_xyz); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMSwarm.pyx":596 * CHKERR( DMSwarmSetPointCoordinates(self.dm, cnpoints, coords, credundant, cmode) ) * * def insertPointUsingCellDM(self, layoutType: PICLayoutType, fill_param: int) -> None: # <<<<<<<<<<<<<< * """Insert point coordinates within each cell. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_55insertPointUsingCellDM(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMSwarm_54insertPointUsingCellDM, "DMSwarm.insertPointUsingCellDM(self, layoutType: PICLayoutType, fill_param: int) -> None\nInsert point coordinates within each cell.\n\n Not collective.\n\n Parameters\n ----------\n layout_type\n Method used to fill each cell with the cell DM.\n fill_param\n Parameter controlling how many points per cell are added (the\n meaning of this parameter is dependent on the layout type).\n\n See Also\n --------\n petsc.DMSwarmInsertPointsUsingCellDM\n\n \nSource code at petsc4py/PETSc/DMSwarm.pyx:596"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_55insertPointUsingCellDM(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_layoutType = 0; PyObject *__pyx_v_fill_param = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("insertPointUsingCellDM (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_layoutType,&__pyx_n_s_fill_param,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_layoutType)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(62, 596, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fill_param)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(62, 596, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("insertPointUsingCellDM", 1, 2, 2, 1); __PYX_ERR(62, 596, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "insertPointUsingCellDM") < 0)) __PYX_ERR(62, 596, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_layoutType = values[0]; __pyx_v_fill_param = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("insertPointUsingCellDM", 1, 2, 2, __pyx_nargs); __PYX_ERR(62, 596, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.insertPointUsingCellDM", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_54insertPointUsingCellDM(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_layoutType, __pyx_v_fill_param); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_54insertPointUsingCellDM(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_layoutType, PyObject *__pyx_v_fill_param) { DMSwarmPICLayoutType __pyx_v_clayoutType; PetscInt __pyx_v_cfill_param; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations DMSwarmPICLayoutType __pyx_t_1; PetscInt __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("insertPointUsingCellDM", 1); /* "petsc4py/PETSc/DMSwarm.pyx":614 * * """ * cdef PetscDMSwarmPICLayoutType clayoutType = layoutType # <<<<<<<<<<<<<< * cdef PetscInt cfill_param = asInt(fill_param) * CHKERR( DMSwarmInsertPointsUsingCellDM(self.dm, clayoutType, cfill_param) ) */ __pyx_t_1 = ((DMSwarmPICLayoutType)__Pyx_PyInt_As_DMSwarmPICLayoutType(__pyx_v_layoutType)); if (unlikely(PyErr_Occurred())) __PYX_ERR(62, 614, __pyx_L1_error) __pyx_v_clayoutType = __pyx_t_1; /* "petsc4py/PETSc/DMSwarm.pyx":615 * """ * cdef PetscDMSwarmPICLayoutType clayoutType = layoutType * cdef PetscInt cfill_param = asInt(fill_param) # <<<<<<<<<<<<<< * CHKERR( DMSwarmInsertPointsUsingCellDM(self.dm, clayoutType, cfill_param) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_fill_param); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(62, 615, __pyx_L1_error) __pyx_v_cfill_param = __pyx_t_2; /* "petsc4py/PETSc/DMSwarm.pyx":616 * cdef PetscDMSwarmPICLayoutType clayoutType = layoutType * cdef PetscInt cfill_param = asInt(fill_param) * CHKERR( DMSwarmInsertPointsUsingCellDM(self.dm, clayoutType, cfill_param) ) # <<<<<<<<<<<<<< * * def setPointCoordinatesCellwise(self, coordinates: Sequence[float]) -> None: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmInsertPointsUsingCellDM(__pyx_v_self->__pyx_base.dm, __pyx_v_clayoutType, __pyx_v_cfill_param)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(62, 616, __pyx_L1_error) /* "petsc4py/PETSc/DMSwarm.pyx":596 * CHKERR( DMSwarmSetPointCoordinates(self.dm, cnpoints, coords, credundant, cmode) ) * * def insertPointUsingCellDM(self, layoutType: PICLayoutType, fill_param: int) -> None: # <<<<<<<<<<<<<< * """Insert point coordinates within each cell. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.insertPointUsingCellDM", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMSwarm.pyx":618 * CHKERR( DMSwarmInsertPointsUsingCellDM(self.dm, clayoutType, cfill_param) ) * * def setPointCoordinatesCellwise(self, coordinates: Sequence[float]) -> None: # <<<<<<<<<<<<<< * """Insert point coordinates within each cell. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_57setPointCoordinatesCellwise(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMSwarm_56setPointCoordinatesCellwise, "DMSwarm.setPointCoordinatesCellwise(self, coordinates: Sequence[float]) -> None\nInsert point coordinates within each cell.\n\n Not collective.\n\n Point coordinates are defined over the reference cell.\n\n Parameters\n ----------\n coordinates\n The coordinates (defined in the local coordinate system for each\n cell) to insert.\n\n See Also\n --------\n petsc.DMSwarmSetPointCoordinatesCellwise\n\n \nSource code at petsc4py/PETSc/DMSwarm.pyx:618"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_57setPointCoordinatesCellwise(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_coordinates = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPointCoordinatesCellwise (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_coordinates,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_coordinates)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(62, 618, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setPointCoordinatesCellwise") < 0)) __PYX_ERR(62, 618, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_coordinates = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPointCoordinatesCellwise", 1, 1, 1, __pyx_nargs); __PYX_ERR(62, 618, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.setPointCoordinatesCellwise", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_56setPointCoordinatesCellwise(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_coordinates); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_56setPointCoordinatesCellwise(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_coordinates) { PyArrayObject *__pyx_v_xyz = 0; PetscInt __pyx_v_cnpoints; PetscReal *__pyx_v_coords; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPointCoordinatesCellwise", 1); /* "petsc4py/PETSc/DMSwarm.pyx":636 * * """ * cdef ndarray xyz = iarray(coordinates, NPY_PETSC_REAL) # <<<<<<<<<<<<<< * if PyArray_ISFORTRAN(xyz): xyz = PyArray_Copy(xyz) * if PyArray_NDIM(xyz) != 2: raise ValueError( */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray(__pyx_v_coordinates, NPY_PETSC_REAL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(62, 636, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_xyz = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DMSwarm.pyx":637 * """ * cdef ndarray xyz = iarray(coordinates, NPY_PETSC_REAL) * if PyArray_ISFORTRAN(xyz): xyz = PyArray_Copy(xyz) # <<<<<<<<<<<<<< * if PyArray_NDIM(xyz) != 2: raise ValueError( * ("coordinates must have two dimensions: " */ __pyx_t_2 = PyArray_ISFORTRAN(__pyx_v_xyz); if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)PyArray_Copy(__pyx_v_xyz)); if (unlikely(!__pyx_t_1)) __PYX_ERR(62, 637, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_xyz, ((PyArrayObject *)__pyx_t_1)); __pyx_t_1 = 0; } /* "petsc4py/PETSc/DMSwarm.pyx":638 * cdef ndarray xyz = iarray(coordinates, NPY_PETSC_REAL) * if PyArray_ISFORTRAN(xyz): xyz = PyArray_Copy(xyz) * if PyArray_NDIM(xyz) != 2: raise ValueError( # <<<<<<<<<<<<<< * ("coordinates must have two dimensions: " * "coordinates.ndim=%d") % (PyArray_NDIM(xyz)) ) */ __pyx_t_2 = (PyArray_NDIM(__pyx_v_xyz) != 2); if (unlikely(__pyx_t_2)) { /* "petsc4py/PETSc/DMSwarm.pyx":640 * if PyArray_NDIM(xyz) != 2: raise ValueError( * ("coordinates must have two dimensions: " * "coordinates.ndim=%d") % (PyArray_NDIM(xyz)) ) # <<<<<<<<<<<<<< * cdef PetscInt cnpoints = PyArray_DIM(xyz, 0) * cdef PetscReal *coords = PyArray_DATA(xyz) */ __pyx_t_1 = __Pyx_PyInt_From_int(PyArray_NDIM(__pyx_v_xyz)); if (unlikely(!__pyx_t_1)) __PYX_ERR(62, 640, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_coordinates_must_have_two_dimens, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(62, 640, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DMSwarm.pyx":638 * cdef ndarray xyz = iarray(coordinates, NPY_PETSC_REAL) * if PyArray_ISFORTRAN(xyz): xyz = PyArray_Copy(xyz) * if PyArray_NDIM(xyz) != 2: raise ValueError( # <<<<<<<<<<<<<< * ("coordinates must have two dimensions: " * "coordinates.ndim=%d") % (PyArray_NDIM(xyz)) ) */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(62, 638, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(62, 638, __pyx_L1_error) } /* "petsc4py/PETSc/DMSwarm.pyx":641 * ("coordinates must have two dimensions: " * "coordinates.ndim=%d") % (PyArray_NDIM(xyz)) ) * cdef PetscInt cnpoints = PyArray_DIM(xyz, 0) # <<<<<<<<<<<<<< * cdef PetscReal *coords = PyArray_DATA(xyz) * CHKERR( DMSwarmSetPointCoordinatesCellwise(self.dm, cnpoints, coords) ) */ __pyx_v_cnpoints = ((PetscInt)PyArray_DIM(__pyx_v_xyz, 0)); /* "petsc4py/PETSc/DMSwarm.pyx":642 * "coordinates.ndim=%d") % (PyArray_NDIM(xyz)) ) * cdef PetscInt cnpoints = PyArray_DIM(xyz, 0) * cdef PetscReal *coords = PyArray_DATA(xyz) # <<<<<<<<<<<<<< * CHKERR( DMSwarmSetPointCoordinatesCellwise(self.dm, cnpoints, coords) ) * */ __pyx_v_coords = ((PetscReal *)PyArray_DATA(__pyx_v_xyz)); /* "petsc4py/PETSc/DMSwarm.pyx":643 * cdef PetscInt cnpoints = PyArray_DIM(xyz, 0) * cdef PetscReal *coords = PyArray_DATA(xyz) * CHKERR( DMSwarmSetPointCoordinatesCellwise(self.dm, cnpoints, coords) ) # <<<<<<<<<<<<<< * * def viewFieldsXDMF(self, filename: str, fieldnames: Sequence[str]) -> None: */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmSetPointCoordinatesCellwise(__pyx_v_self->__pyx_base.dm, __pyx_v_cnpoints, __pyx_v_coords)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(62, 643, __pyx_L1_error) /* "petsc4py/PETSc/DMSwarm.pyx":618 * CHKERR( DMSwarmInsertPointsUsingCellDM(self.dm, clayoutType, cfill_param) ) * * def setPointCoordinatesCellwise(self, coordinates: Sequence[float]) -> None: # <<<<<<<<<<<<<< * """Insert point coordinates within each cell. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.setPointCoordinatesCellwise", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_xyz); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMSwarm.pyx":645 * CHKERR( DMSwarmSetPointCoordinatesCellwise(self.dm, cnpoints, coords) ) * * def viewFieldsXDMF(self, filename: str, fieldnames: Sequence[str]) -> None: # <<<<<<<<<<<<<< * """Write a selection of `DMSwarm` fields to an XDMF3 file. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_59viewFieldsXDMF(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMSwarm_58viewFieldsXDMF, "DMSwarm.viewFieldsXDMF(self, filename: str, fieldnames: Sequence[str]) -> None\nWrite a selection of `DMSwarm` fields to an XDMF3 file.\n\n Collective.\n\n Parameters\n ----------\n filename\n The file name of the XDMF file (must have the extension .xmf).\n fieldnames\n Array containing the textual names of fields to write.\n\n See Also\n --------\n petsc.DMSwarmViewFieldsXDMF\n\n \nSource code at petsc4py/PETSc/DMSwarm.pyx:645"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_59viewFieldsXDMF(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_filename = 0; PyObject *__pyx_v_fieldnames = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("viewFieldsXDMF (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filename,&__pyx_n_s_fieldnames,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_filename)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(62, 645, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fieldnames)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(62, 645, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("viewFieldsXDMF", 1, 2, 2, 1); __PYX_ERR(62, 645, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "viewFieldsXDMF") < 0)) __PYX_ERR(62, 645, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_filename = values[0]; __pyx_v_fieldnames = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("viewFieldsXDMF", 1, 2, 2, __pyx_nargs); __PYX_ERR(62, 645, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.viewFieldsXDMF", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_58viewFieldsXDMF(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_filename, __pyx_v_fieldnames); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_58viewFieldsXDMF(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_fieldnames) { char const *__pyx_v_cval; char const *__pyx_v_cfilename; PetscInt __pyx_v_cnfields; char const **__pyx_v_cfieldnames; CYTHON_UNUSED PyObject *__pyx_v_tmp = 0; long __pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; PyObject *__pyx_t_3 = NULL; PetscInt __pyx_t_4; PetscErrorCode __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("viewFieldsXDMF", 0); __Pyx_INCREF(__pyx_v_filename); __Pyx_INCREF(__pyx_v_fieldnames); /* "petsc4py/PETSc/DMSwarm.pyx":662 * * """ * cdef const char *cval = NULL # <<<<<<<<<<<<<< * cdef const char *cfilename = NULL * filename = str2bytes(filename, &cfilename) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/DMSwarm.pyx":663 * """ * cdef const char *cval = NULL * cdef const char *cfilename = NULL # <<<<<<<<<<<<<< * filename = str2bytes(filename, &cfilename) * cdef PetscInt cnfields = len(fieldnames) */ __pyx_v_cfilename = NULL; /* "petsc4py/PETSc/DMSwarm.pyx":664 * cdef const char *cval = NULL * cdef const char *cfilename = NULL * filename = str2bytes(filename, &cfilename) # <<<<<<<<<<<<<< * cdef PetscInt cnfields = len(fieldnames) * cdef const char** cfieldnames = NULL */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_filename, (&__pyx_v_cfilename)); if (unlikely(!__pyx_t_1)) __PYX_ERR(62, 664, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_filename, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DMSwarm.pyx":665 * cdef const char *cfilename = NULL * filename = str2bytes(filename, &cfilename) * cdef PetscInt cnfields = len(fieldnames) # <<<<<<<<<<<<<< * cdef const char** cfieldnames = NULL * cdef object tmp = oarray_p(empty_p(cnfields), NULL, &cfieldnames) */ __pyx_t_2 = PyObject_Length(__pyx_v_fieldnames); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(62, 665, __pyx_L1_error) __pyx_v_cnfields = ((PetscInt)__pyx_t_2); /* "petsc4py/PETSc/DMSwarm.pyx":666 * filename = str2bytes(filename, &cfilename) * cdef PetscInt cnfields = len(fieldnames) * cdef const char** cfieldnames = NULL # <<<<<<<<<<<<<< * cdef object tmp = oarray_p(empty_p(cnfields), NULL, &cfieldnames) * fieldnames = list(fieldnames) */ __pyx_v_cfieldnames = NULL; /* "petsc4py/PETSc/DMSwarm.pyx":667 * cdef PetscInt cnfields = len(fieldnames) * cdef const char** cfieldnames = NULL * cdef object tmp = oarray_p(empty_p(cnfields), NULL, &cfieldnames) # <<<<<<<<<<<<<< * fieldnames = list(fieldnames) * for i from 0 <= i < cnfields: */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_cnfields)); if (unlikely(!__pyx_t_1)) __PYX_ERR(62, 667, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_1, NULL, ((void **)(&__pyx_v_cfieldnames)))); if (unlikely(!__pyx_t_3)) __PYX_ERR(62, 667, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_tmp = __pyx_t_3; __pyx_t_3 = 0; /* "petsc4py/PETSc/DMSwarm.pyx":668 * cdef const char** cfieldnames = NULL * cdef object tmp = oarray_p(empty_p(cnfields), NULL, &cfieldnames) * fieldnames = list(fieldnames) # <<<<<<<<<<<<<< * for i from 0 <= i < cnfields: * fieldnames[i] = str2bytes(fieldnames[i], &cval) */ __pyx_t_3 = PySequence_List(__pyx_v_fieldnames); if (unlikely(!__pyx_t_3)) __PYX_ERR(62, 668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_fieldnames, __pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/DMSwarm.pyx":669 * cdef object tmp = oarray_p(empty_p(cnfields), NULL, &cfieldnames) * fieldnames = list(fieldnames) * for i from 0 <= i < cnfields: # <<<<<<<<<<<<<< * fieldnames[i] = str2bytes(fieldnames[i], &cval) * cfieldnames[i] = cval */ __pyx_t_4 = __pyx_v_cnfields; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { /* "petsc4py/PETSc/DMSwarm.pyx":670 * fieldnames = list(fieldnames) * for i from 0 <= i < cnfields: * fieldnames[i] = str2bytes(fieldnames[i], &cval) # <<<<<<<<<<<<<< * cfieldnames[i] = cval * CHKERR( DMSwarmViewFieldsXDMF(self.dm, cfilename, cnfields, cfieldnames ) ) */ __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_fieldnames, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(62, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_t_3, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(62, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely((__Pyx_SetItemInt(__pyx_v_fieldnames, __pyx_v_i, __pyx_t_1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1) < 0))) __PYX_ERR(62, 670, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DMSwarm.pyx":671 * for i from 0 <= i < cnfields: * fieldnames[i] = str2bytes(fieldnames[i], &cval) * cfieldnames[i] = cval # <<<<<<<<<<<<<< * CHKERR( DMSwarmViewFieldsXDMF(self.dm, cfilename, cnfields, cfieldnames ) ) * */ (__pyx_v_cfieldnames[__pyx_v_i]) = __pyx_v_cval; } /* "petsc4py/PETSc/DMSwarm.pyx":672 * fieldnames[i] = str2bytes(fieldnames[i], &cval) * cfieldnames[i] = cval * CHKERR( DMSwarmViewFieldsXDMF(self.dm, cfilename, cnfields, cfieldnames ) ) # <<<<<<<<<<<<<< * * def viewXDMF(self, filename: str) -> None: */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmViewFieldsXDMF(__pyx_v_self->__pyx_base.dm, __pyx_v_cfilename, __pyx_v_cnfields, __pyx_v_cfieldnames)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(62, 672, __pyx_L1_error) /* "petsc4py/PETSc/DMSwarm.pyx":645 * CHKERR( DMSwarmSetPointCoordinatesCellwise(self.dm, cnpoints, coords) ) * * def viewFieldsXDMF(self, filename: str, fieldnames: Sequence[str]) -> None: # <<<<<<<<<<<<<< * """Write a selection of `DMSwarm` fields to an XDMF3 file. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.viewFieldsXDMF", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_tmp); __Pyx_XDECREF(__pyx_v_filename); __Pyx_XDECREF(__pyx_v_fieldnames); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMSwarm.pyx":674 * CHKERR( DMSwarmViewFieldsXDMF(self.dm, cfilename, cnfields, cfieldnames ) ) * * def viewXDMF(self, filename: str) -> None: # <<<<<<<<<<<<<< * """Write this `DMSwarm` fields to an XDMF3 file. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_61viewXDMF(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMSwarm_60viewXDMF, "DMSwarm.viewXDMF(self, filename: str) -> None\nWrite this `DMSwarm` fields to an XDMF3 file.\n\n Collective.\n\n Parameters\n ----------\n filename\n The file name of the XDMF file (must have the extension .xmf).\n\n See Also\n --------\n petsc.DMSwarmViewXDMF\n\n \nSource code at petsc4py/PETSc/DMSwarm.pyx:674"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_61viewXDMF(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_filename = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("viewXDMF (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filename,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_filename)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(62, 674, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "viewXDMF") < 0)) __PYX_ERR(62, 674, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_filename = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("viewXDMF", 1, 1, 1, __pyx_nargs); __PYX_ERR(62, 674, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.viewXDMF", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_60viewXDMF(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_filename); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_60viewXDMF(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_filename) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("viewXDMF", 0); __Pyx_INCREF(__pyx_v_filename); /* "petsc4py/PETSc/DMSwarm.pyx":689 * * """ * cdef const char *cval = NULL # <<<<<<<<<<<<<< * filename = str2bytes(filename, &cval) * CHKERR( DMSwarmViewXDMF(self.dm, cval) ) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/DMSwarm.pyx":690 * """ * cdef const char *cval = NULL * filename = str2bytes(filename, &cval) # <<<<<<<<<<<<<< * CHKERR( DMSwarmViewXDMF(self.dm, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_filename, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(62, 690, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_filename, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DMSwarm.pyx":691 * cdef const char *cval = NULL * filename = str2bytes(filename, &cval) * CHKERR( DMSwarmViewXDMF(self.dm, cval) ) # <<<<<<<<<<<<<< * * def sortGetAccess(self) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmViewXDMF(__pyx_v_self->__pyx_base.dm, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(62, 691, __pyx_L1_error) /* "petsc4py/PETSc/DMSwarm.pyx":674 * CHKERR( DMSwarmViewFieldsXDMF(self.dm, cfilename, cnfields, cfieldnames ) ) * * def viewXDMF(self, filename: str) -> None: # <<<<<<<<<<<<<< * """Write this `DMSwarm` fields to an XDMF3 file. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.viewXDMF", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_filename); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMSwarm.pyx":693 * CHKERR( DMSwarmViewXDMF(self.dm, cval) ) * * def sortGetAccess(self) -> None: # <<<<<<<<<<<<<< * """Setup up a `DMSwarm` point sort context. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_63sortGetAccess(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMSwarm_62sortGetAccess, "DMSwarm.sortGetAccess(self) -> None\nSetup up a `DMSwarm` point sort context.\n\n Not collective.\n\n The point sort context is used for efficient traversal of points within\n a cell.\n\n You must call `sortRestoreAccess` when you no longer need access to the\n sort context.\n\n See Also\n --------\n sortRestoreAccess, petsc.DMSwarmSortGetAccess\n\n \nSource code at petsc4py/PETSc/DMSwarm.pyx:693"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_63sortGetAccess(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("sortGetAccess (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("sortGetAccess", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "sortGetAccess", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_62sortGetAccess(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_62sortGetAccess(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("sortGetAccess", 1); /* "petsc4py/PETSc/DMSwarm.pyx":709 * * """ * CHKERR( DMSwarmSortGetAccess(self.dm) ) # <<<<<<<<<<<<<< * * def sortRestoreAccess(self) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmSortGetAccess(__pyx_v_self->__pyx_base.dm)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(62, 709, __pyx_L1_error) /* "petsc4py/PETSc/DMSwarm.pyx":693 * CHKERR( DMSwarmViewXDMF(self.dm, cval) ) * * def sortGetAccess(self) -> None: # <<<<<<<<<<<<<< * """Setup up a `DMSwarm` point sort context. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.sortGetAccess", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMSwarm.pyx":711 * CHKERR( DMSwarmSortGetAccess(self.dm) ) * * def sortRestoreAccess(self) -> None: # <<<<<<<<<<<<<< * """Invalidate the `DMSwarm` point sorting context. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_65sortRestoreAccess(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMSwarm_64sortRestoreAccess, "DMSwarm.sortRestoreAccess(self) -> None\nInvalidate the `DMSwarm` point sorting context.\n\n Not collective.\n\n See Also\n --------\n sortGetAccess, petsc.DMSwarmSortRestoreAccess\n\n \nSource code at petsc4py/PETSc/DMSwarm.pyx:711"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_65sortRestoreAccess(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("sortRestoreAccess (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("sortRestoreAccess", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "sortRestoreAccess", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_64sortRestoreAccess(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_64sortRestoreAccess(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("sortRestoreAccess", 1); /* "petsc4py/PETSc/DMSwarm.pyx":721 * * """ * CHKERR( DMSwarmSortRestoreAccess(self.dm) ) # <<<<<<<<<<<<<< * * def sortGetPointsPerCell(self, e: int) -> list[int]: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmSortRestoreAccess(__pyx_v_self->__pyx_base.dm)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(62, 721, __pyx_L1_error) /* "petsc4py/PETSc/DMSwarm.pyx":711 * CHKERR( DMSwarmSortGetAccess(self.dm) ) * * def sortRestoreAccess(self) -> None: # <<<<<<<<<<<<<< * """Invalidate the `DMSwarm` point sorting context. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.sortRestoreAccess", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMSwarm.pyx":723 * CHKERR( DMSwarmSortRestoreAccess(self.dm) ) * * def sortGetPointsPerCell(self, e: int) -> list[int]: # <<<<<<<<<<<<<< * """Create an array of point indices for all points in a cell. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_67sortGetPointsPerCell(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMSwarm_66sortGetPointsPerCell, "DMSwarm.sortGetPointsPerCell(self, e: int) -> list[int]\nCreate an array of point indices for all points in a cell.\n\n Not collective.\n\n Parameters\n ----------\n e\n The index of the cell.\n\n See Also\n --------\n petsc.DMSwarmSortGetPointsPerCell\n\n \nSource code at petsc4py/PETSc/DMSwarm.pyx:723"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_67sortGetPointsPerCell(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_e = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("sortGetPointsPerCell (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_e,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_e)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(62, 723, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "sortGetPointsPerCell") < 0)) __PYX_ERR(62, 723, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_e = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("sortGetPointsPerCell", 1, 1, 1, __pyx_nargs); __PYX_ERR(62, 723, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.sortGetPointsPerCell", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_66sortGetPointsPerCell(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_e); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_66sortGetPointsPerCell(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_e) { PetscInt __pyx_v_ce; PetscInt __pyx_v_cnpoints; PetscInt *__pyx_v_cpidlist; PyObject *__pyx_v_pidlist = 0; PetscInt __pyx_v_npoints; long __pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; PetscInt __pyx_t_4; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("sortGetPointsPerCell", 1); /* "petsc4py/PETSc/DMSwarm.pyx":738 * * """ * cdef PetscInt ce = asInt(e) # <<<<<<<<<<<<<< * cdef PetscInt cnpoints = asInt(0) * cdef PetscInt *cpidlist = NULL */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_e); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(62, 738, __pyx_L1_error) __pyx_v_ce = __pyx_t_1; /* "petsc4py/PETSc/DMSwarm.pyx":739 * """ * cdef PetscInt ce = asInt(e) * cdef PetscInt cnpoints = asInt(0) # <<<<<<<<<<<<<< * cdef PetscInt *cpidlist = NULL * cdef list pidlist = [] */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_int_0); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(62, 739, __pyx_L1_error) __pyx_v_cnpoints = __pyx_t_1; /* "petsc4py/PETSc/DMSwarm.pyx":740 * cdef PetscInt ce = asInt(e) * cdef PetscInt cnpoints = asInt(0) * cdef PetscInt *cpidlist = NULL # <<<<<<<<<<<<<< * cdef list pidlist = [] * CHKERR( DMSwarmSortGetPointsPerCell(self.dm, ce, &cnpoints, &cpidlist) ) */ __pyx_v_cpidlist = NULL; /* "petsc4py/PETSc/DMSwarm.pyx":741 * cdef PetscInt cnpoints = asInt(0) * cdef PetscInt *cpidlist = NULL * cdef list pidlist = [] # <<<<<<<<<<<<<< * CHKERR( DMSwarmSortGetPointsPerCell(self.dm, ce, &cnpoints, &cpidlist) ) * npoints = asInt(cnpoints) */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(62, 741, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_pidlist = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DMSwarm.pyx":742 * cdef PetscInt *cpidlist = NULL * cdef list pidlist = [] * CHKERR( DMSwarmSortGetPointsPerCell(self.dm, ce, &cnpoints, &cpidlist) ) # <<<<<<<<<<<<<< * npoints = asInt(cnpoints) * for i from 0 <= i < npoints: pidlist.append(asInt(cpidlist[i])) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmSortGetPointsPerCell(__pyx_v_self->__pyx_base.dm, __pyx_v_ce, (&__pyx_v_cnpoints), (&__pyx_v_cpidlist))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(62, 742, __pyx_L1_error) /* "petsc4py/PETSc/DMSwarm.pyx":743 * cdef list pidlist = [] * CHKERR( DMSwarmSortGetPointsPerCell(self.dm, ce, &cnpoints, &cpidlist) ) * npoints = asInt(cnpoints) # <<<<<<<<<<<<<< * for i from 0 <= i < npoints: pidlist.append(asInt(cpidlist[i])) * return pidlist */ __pyx_t_2 = __Pyx_PyInt_From_PetscInt(__pyx_v_cnpoints); if (unlikely(!__pyx_t_2)) __PYX_ERR(62, 743, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_t_2); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(62, 743, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_npoints = __pyx_t_1; /* "petsc4py/PETSc/DMSwarm.pyx":744 * CHKERR( DMSwarmSortGetPointsPerCell(self.dm, ce, &cnpoints, &cpidlist) ) * npoints = asInt(cnpoints) * for i from 0 <= i < npoints: pidlist.append(asInt(cpidlist[i])) # <<<<<<<<<<<<<< * return pidlist * */ __pyx_t_1 = __pyx_v_npoints; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { __pyx_t_2 = __Pyx_PyInt_From_PetscInt((__pyx_v_cpidlist[__pyx_v_i])); if (unlikely(!__pyx_t_2)) __PYX_ERR(62, 744, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_t_2); if (unlikely(__pyx_t_4 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(62, 744, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_PetscInt(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(62, 744, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_pidlist, __pyx_t_2); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(62, 744, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } /* "petsc4py/PETSc/DMSwarm.pyx":745 * npoints = asInt(cnpoints) * for i from 0 <= i < npoints: pidlist.append(asInt(cpidlist[i])) * return pidlist # <<<<<<<<<<<<<< * * def sortGetNumberOfPointsPerCell(self, e: int) -> int: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_pidlist); __pyx_r = __pyx_v_pidlist; goto __pyx_L0; /* "petsc4py/PETSc/DMSwarm.pyx":723 * CHKERR( DMSwarmSortRestoreAccess(self.dm) ) * * def sortGetPointsPerCell(self, e: int) -> list[int]: # <<<<<<<<<<<<<< * """Create an array of point indices for all points in a cell. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.sortGetPointsPerCell", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_pidlist); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMSwarm.pyx":747 * return pidlist * * def sortGetNumberOfPointsPerCell(self, e: int) -> int: # <<<<<<<<<<<<<< * """Return the number of points in a cell. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_69sortGetNumberOfPointsPerCell(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMSwarm_68sortGetNumberOfPointsPerCell, "DMSwarm.sortGetNumberOfPointsPerCell(self, e: int) -> int\nReturn the number of points in a cell.\n\n Not collective.\n\n Parameters\n ----------\n e\n The index of the cell.\n\n See Also\n --------\n petsc.DMSwarmSortGetNumberOfPointsPerCell\n\n \nSource code at petsc4py/PETSc/DMSwarm.pyx:747"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_69sortGetNumberOfPointsPerCell(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_e = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("sortGetNumberOfPointsPerCell (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_e,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_e)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(62, 747, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "sortGetNumberOfPointsPerCell") < 0)) __PYX_ERR(62, 747, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_e = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("sortGetNumberOfPointsPerCell", 1, 1, 1, __pyx_nargs); __PYX_ERR(62, 747, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.sortGetNumberOfPointsPerCell", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_68sortGetNumberOfPointsPerCell(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_e); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_68sortGetNumberOfPointsPerCell(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_e) { PetscInt __pyx_v_ce; PetscInt __pyx_v_npoints; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("sortGetNumberOfPointsPerCell", 1); /* "petsc4py/PETSc/DMSwarm.pyx":762 * * """ * cdef PetscInt ce = asInt(e) # <<<<<<<<<<<<<< * cdef PetscInt npoints = asInt(0) * CHKERR( DMSwarmSortGetNumberOfPointsPerCell(self.dm, ce, &npoints) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_e); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(62, 762, __pyx_L1_error) __pyx_v_ce = __pyx_t_1; /* "petsc4py/PETSc/DMSwarm.pyx":763 * """ * cdef PetscInt ce = asInt(e) * cdef PetscInt npoints = asInt(0) # <<<<<<<<<<<<<< * CHKERR( DMSwarmSortGetNumberOfPointsPerCell(self.dm, ce, &npoints) ) * return toInt(npoints) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_int_0); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(62, 763, __pyx_L1_error) __pyx_v_npoints = __pyx_t_1; /* "petsc4py/PETSc/DMSwarm.pyx":764 * cdef PetscInt ce = asInt(e) * cdef PetscInt npoints = asInt(0) * CHKERR( DMSwarmSortGetNumberOfPointsPerCell(self.dm, ce, &npoints) ) # <<<<<<<<<<<<<< * return toInt(npoints) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmSortGetNumberOfPointsPerCell(__pyx_v_self->__pyx_base.dm, __pyx_v_ce, (&__pyx_v_npoints))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(62, 764, __pyx_L1_error) /* "petsc4py/PETSc/DMSwarm.pyx":765 * cdef PetscInt npoints = asInt(0) * CHKERR( DMSwarmSortGetNumberOfPointsPerCell(self.dm, ce, &npoints) ) * return toInt(npoints) # <<<<<<<<<<<<<< * * def sortGetIsValid(self) -> bool: */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_npoints); if (unlikely(!__pyx_t_3)) __PYX_ERR(62, 765, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMSwarm.pyx":747 * return pidlist * * def sortGetNumberOfPointsPerCell(self, e: int) -> int: # <<<<<<<<<<<<<< * """Return the number of points in a cell. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.sortGetNumberOfPointsPerCell", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMSwarm.pyx":767 * return toInt(npoints) * * def sortGetIsValid(self) -> bool: # <<<<<<<<<<<<<< * """Return whether the sort context is up-to-date. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_71sortGetIsValid(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMSwarm_70sortGetIsValid, "DMSwarm.sortGetIsValid(self) -> bool\nReturn whether the sort context is up-to-date.\n\n Not collective.\n\n Returns the flag associated with a `DMSwarm` point sorting context.\n\n See Also\n --------\n petsc.DMSwarmSortGetIsValid\n\n \nSource code at petsc4py/PETSc/DMSwarm.pyx:767"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_71sortGetIsValid(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("sortGetIsValid (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("sortGetIsValid", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "sortGetIsValid", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_70sortGetIsValid(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_70sortGetIsValid(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self) { PetscBool __pyx_v_isValid; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("sortGetIsValid", 1); /* "petsc4py/PETSc/DMSwarm.pyx":779 * * """ * cdef PetscBool isValid = asBool(False) # <<<<<<<<<<<<<< * CHKERR( DMSwarmSortGetIsValid(self.dm, &isValid) ) * return toBool(isValid) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asBool(Py_False); if (unlikely(__pyx_t_1 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(62, 779, __pyx_L1_error) __pyx_v_isValid = __pyx_t_1; /* "petsc4py/PETSc/DMSwarm.pyx":780 * """ * cdef PetscBool isValid = asBool(False) * CHKERR( DMSwarmSortGetIsValid(self.dm, &isValid) ) # <<<<<<<<<<<<<< * return toBool(isValid) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmSortGetIsValid(__pyx_v_self->__pyx_base.dm, (&__pyx_v_isValid))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(62, 780, __pyx_L1_error) /* "petsc4py/PETSc/DMSwarm.pyx":781 * cdef PetscBool isValid = asBool(False) * CHKERR( DMSwarmSortGetIsValid(self.dm, &isValid) ) * return toBool(isValid) # <<<<<<<<<<<<<< * * def sortGetSizes(self) -> tuple[int, int]: */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_isValid); if (unlikely(!__pyx_t_3)) __PYX_ERR(62, 781, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMSwarm.pyx":767 * return toInt(npoints) * * def sortGetIsValid(self) -> bool: # <<<<<<<<<<<<<< * """Return whether the sort context is up-to-date. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.sortGetIsValid", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMSwarm.pyx":783 * return toBool(isValid) * * def sortGetSizes(self) -> tuple[int, int]: # <<<<<<<<<<<<<< * """Return the sizes associated with a `DMSwarm` point sorting context. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_73sortGetSizes(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMSwarm_72sortGetSizes, "DMSwarm.sortGetSizes(self) -> tuple[int, int]\nReturn the sizes associated with a `DMSwarm` point sorting context.\n\n Not collective.\n\n Returns\n -------\n ncells : int\n Number of cells within the sort context.\n npoints : int\n Number of points used to create the sort context.\n\n See Also\n --------\n petsc.DMSwarmSortGetSizes\n\n \nSource code at petsc4py/PETSc/DMSwarm.pyx:783"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_73sortGetSizes(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("sortGetSizes (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("sortGetSizes", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "sortGetSizes", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_72sortGetSizes(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_72sortGetSizes(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self) { PetscInt __pyx_v_ncells; PetscInt __pyx_v_npoints; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("sortGetSizes", 1); /* "petsc4py/PETSc/DMSwarm.pyx":800 * * """ * cdef PetscInt ncells = asInt(0) # <<<<<<<<<<<<<< * cdef PetscInt npoints = asInt(0) * CHKERR( DMSwarmSortGetSizes(self.dm, &ncells, &npoints) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_int_0); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(62, 800, __pyx_L1_error) __pyx_v_ncells = __pyx_t_1; /* "petsc4py/PETSc/DMSwarm.pyx":801 * """ * cdef PetscInt ncells = asInt(0) * cdef PetscInt npoints = asInt(0) # <<<<<<<<<<<<<< * CHKERR( DMSwarmSortGetSizes(self.dm, &ncells, &npoints) ) * return (toInt(ncells), toInt(npoints)) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_int_0); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(62, 801, __pyx_L1_error) __pyx_v_npoints = __pyx_t_1; /* "petsc4py/PETSc/DMSwarm.pyx":802 * cdef PetscInt ncells = asInt(0) * cdef PetscInt npoints = asInt(0) * CHKERR( DMSwarmSortGetSizes(self.dm, &ncells, &npoints) ) # <<<<<<<<<<<<<< * return (toInt(ncells), toInt(npoints)) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmSortGetSizes(__pyx_v_self->__pyx_base.dm, (&__pyx_v_ncells), (&__pyx_v_npoints))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(62, 802, __pyx_L1_error) /* "petsc4py/PETSc/DMSwarm.pyx":803 * cdef PetscInt npoints = asInt(0) * CHKERR( DMSwarmSortGetSizes(self.dm, &ncells, &npoints) ) * return (toInt(ncells), toInt(npoints)) # <<<<<<<<<<<<<< * * def projectFields(self, fieldnames: Sequence[str], vecs: Sequence[Vec], mode: ScatterModeSpec = None) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ncells); if (unlikely(!__pyx_t_3)) __PYX_ERR(62, 803, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_npoints); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 803, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(62, 803, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3)) __PYX_ERR(62, 803, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4)) __PYX_ERR(62, 803, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMSwarm.pyx":783 * return toBool(isValid) * * def sortGetSizes(self) -> tuple[int, int]: # <<<<<<<<<<<<<< * """Return the sizes associated with a `DMSwarm` point sorting context. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.sortGetSizes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMSwarm.pyx":805 * return (toInt(ncells), toInt(npoints)) * * def projectFields(self, fieldnames: Sequence[str], vecs: Sequence[Vec], mode: ScatterModeSpec = None) -> None: # <<<<<<<<<<<<<< * """Project a set of `DMSwarm` fields onto the cell `DM`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_75projectFields(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7DMSwarm_74projectFields, "DMSwarm.projectFields(self, fieldnames: Sequence[str], vecs: Sequence[Vec], mode: ScatterModeSpec = None) -> None\nProject a set of `DMSwarm` fields onto the cell `DM`.\n\n Collective.\n\n Parameters\n ----------\n fieldnames\n The textual names of the swarm fields to project.\n\n See Also\n --------\n petsc.DMSwarmProjectFields\n\n \nSource code at petsc4py/PETSc/DMSwarm.pyx:805"); static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_75projectFields(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_fieldnames = 0; PyObject *__pyx_v_vecs = 0; PyObject *__pyx_v_mode = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("projectFields (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fieldnames,&__pyx_n_s_vecs,&__pyx_n_s_mode,0}; values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fieldnames)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(62, 805, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vecs)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(62, 805, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("projectFields", 0, 2, 3, 1); __PYX_ERR(62, 805, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mode); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(62, 805, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "projectFields") < 0)) __PYX_ERR(62, 805, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_fieldnames = values[0]; __pyx_v_vecs = values[1]; __pyx_v_mode = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("projectFields", 0, 2, 3, __pyx_nargs); __PYX_ERR(62, 805, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.projectFields", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_74projectFields(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_fieldnames, __pyx_v_vecs, __pyx_v_mode); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_74projectFields(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_fieldnames, PyObject *__pyx_v_vecs, PyObject *__pyx_v_mode) { char const *__pyx_v_cval; PetscInt __pyx_v_cnfields; char const **__pyx_v_cfieldnames; CYTHON_UNUSED PyObject *__pyx_v_tmp = 0; Vec *__pyx_v_cfieldvecs; CYTHON_UNUSED PyObject *__pyx_v_tmp2 = 0; ScatterMode __pyx_v_cmode; long __pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; ScatterMode __pyx_t_4; PetscInt __pyx_t_5; Vec __pyx_t_6; PetscErrorCode __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("projectFields", 0); __Pyx_INCREF(__pyx_v_fieldnames); /* "petsc4py/PETSc/DMSwarm.pyx":820 * * """ * cdef const char *cval = NULL # <<<<<<<<<<<<<< * cdef PetscInt cnfields = len(fieldnames) * cdef const char** cfieldnames = NULL */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/DMSwarm.pyx":821 * """ * cdef const char *cval = NULL * cdef PetscInt cnfields = len(fieldnames) # <<<<<<<<<<<<<< * cdef const char** cfieldnames = NULL * cdef object tmp = oarray_p(empty_p(cnfields), NULL, &cfieldnames) */ __pyx_t_1 = PyObject_Length(__pyx_v_fieldnames); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(62, 821, __pyx_L1_error) __pyx_v_cnfields = ((PetscInt)__pyx_t_1); /* "petsc4py/PETSc/DMSwarm.pyx":822 * cdef const char *cval = NULL * cdef PetscInt cnfields = len(fieldnames) * cdef const char** cfieldnames = NULL # <<<<<<<<<<<<<< * cdef object tmp = oarray_p(empty_p(cnfields), NULL, &cfieldnames) * cdef PetscVec *cfieldvecs */ __pyx_v_cfieldnames = NULL; /* "petsc4py/PETSc/DMSwarm.pyx":823 * cdef PetscInt cnfields = len(fieldnames) * cdef const char** cfieldnames = NULL * cdef object tmp = oarray_p(empty_p(cnfields), NULL, &cfieldnames) # <<<<<<<<<<<<<< * cdef PetscVec *cfieldvecs * cdef object tmp2 = oarray_p(empty_p(cnfields), NULL, &cfieldvecs) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_cnfields)); if (unlikely(!__pyx_t_2)) __PYX_ERR(62, 823, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_2, NULL, ((void **)(&__pyx_v_cfieldnames)))); if (unlikely(!__pyx_t_3)) __PYX_ERR(62, 823, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_tmp = __pyx_t_3; __pyx_t_3 = 0; /* "petsc4py/PETSc/DMSwarm.pyx":825 * cdef object tmp = oarray_p(empty_p(cnfields), NULL, &cfieldnames) * cdef PetscVec *cfieldvecs * cdef object tmp2 = oarray_p(empty_p(cnfields), NULL, &cfieldvecs) # <<<<<<<<<<<<<< * cdef PetscScatterMode cmode = scattermode(mode) * fieldnames = list(fieldnames) */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_cnfields)); if (unlikely(!__pyx_t_3)) __PYX_ERR(62, 825, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_3, NULL, ((void **)(&__pyx_v_cfieldvecs)))); if (unlikely(!__pyx_t_2)) __PYX_ERR(62, 825, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_tmp2 = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/DMSwarm.pyx":826 * cdef PetscVec *cfieldvecs * cdef object tmp2 = oarray_p(empty_p(cnfields), NULL, &cfieldvecs) * cdef PetscScatterMode cmode = scattermode(mode) # <<<<<<<<<<<<<< * fieldnames = list(fieldnames) * for i from 0 <= i < cnfields: */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_scattermode(__pyx_v_mode); if (unlikely(__pyx_t_4 == ((ScatterMode)((ScatterMode)-1L)))) __PYX_ERR(62, 826, __pyx_L1_error) __pyx_v_cmode = __pyx_t_4; /* "petsc4py/PETSc/DMSwarm.pyx":827 * cdef object tmp2 = oarray_p(empty_p(cnfields), NULL, &cfieldvecs) * cdef PetscScatterMode cmode = scattermode(mode) * fieldnames = list(fieldnames) # <<<<<<<<<<<<<< * for i from 0 <= i < cnfields: * fieldnames[i] = str2bytes(fieldnames[i], &cval) */ __pyx_t_2 = PySequence_List(__pyx_v_fieldnames); if (unlikely(!__pyx_t_2)) __PYX_ERR(62, 827, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_fieldnames, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/DMSwarm.pyx":828 * cdef PetscScatterMode cmode = scattermode(mode) * fieldnames = list(fieldnames) * for i from 0 <= i < cnfields: # <<<<<<<<<<<<<< * fieldnames[i] = str2bytes(fieldnames[i], &cval) * cfieldnames[i] = cval */ __pyx_t_5 = __pyx_v_cnfields; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) { /* "petsc4py/PETSc/DMSwarm.pyx":829 * fieldnames = list(fieldnames) * for i from 0 <= i < cnfields: * fieldnames[i] = str2bytes(fieldnames[i], &cval) # <<<<<<<<<<<<<< * cfieldnames[i] = cval * cfieldvecs[i] = ((vecs[i])).vec */ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_fieldnames, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(62, 829, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_t_2, (&__pyx_v_cval)); if (unlikely(!__pyx_t_3)) __PYX_ERR(62, 829, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely((__Pyx_SetItemInt(__pyx_v_fieldnames, __pyx_v_i, __pyx_t_3, long, 1, __Pyx_PyInt_From_long, 0, 1, 1) < 0))) __PYX_ERR(62, 829, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/DMSwarm.pyx":830 * for i from 0 <= i < cnfields: * fieldnames[i] = str2bytes(fieldnames[i], &cval) * cfieldnames[i] = cval # <<<<<<<<<<<<<< * cfieldvecs[i] = ((vecs[i])).vec * CHKERR( DMSwarmProjectFields(self.dm, cnfields, cfieldnames, cfieldvecs, cmode) ) */ (__pyx_v_cfieldnames[__pyx_v_i]) = __pyx_v_cval; /* "petsc4py/PETSc/DMSwarm.pyx":831 * fieldnames[i] = str2bytes(fieldnames[i], &cval) * cfieldnames[i] = cval * cfieldvecs[i] = ((vecs[i])).vec # <<<<<<<<<<<<<< * CHKERR( DMSwarmProjectFields(self.dm, cnfields, cfieldnames, cfieldvecs, cmode) ) * return */ __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_vecs, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(62, 831, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (!(likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_8petsc4py_5PETSc_Vec)))) __PYX_ERR(62, 831, __pyx_L1_error) __pyx_t_6 = ((struct PyPetscVecObject *)__pyx_t_3)->vec; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; (__pyx_v_cfieldvecs[__pyx_v_i]) = __pyx_t_6; } /* "petsc4py/PETSc/DMSwarm.pyx":832 * cfieldnames[i] = cval * cfieldvecs[i] = ((vecs[i])).vec * CHKERR( DMSwarmProjectFields(self.dm, cnfields, cfieldnames, cfieldvecs, cmode) ) # <<<<<<<<<<<<<< * return * */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmProjectFields(__pyx_v_self->__pyx_base.dm, __pyx_v_cnfields, __pyx_v_cfieldnames, __pyx_v_cfieldvecs, __pyx_v_cmode)); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(62, 832, __pyx_L1_error) /* "petsc4py/PETSc/DMSwarm.pyx":833 * cfieldvecs[i] = ((vecs[i])).vec * CHKERR( DMSwarmProjectFields(self.dm, cnfields, cfieldnames, cfieldvecs, cmode) ) * return # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "petsc4py/PETSc/DMSwarm.pyx":805 * return (toInt(ncells), toInt(npoints)) * * def projectFields(self, fieldnames: Sequence[str], vecs: Sequence[Vec], mode: ScatterModeSpec = None) -> None: # <<<<<<<<<<<<<< * """Project a set of `DMSwarm` fields onto the cell `DM`. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.projectFields", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_tmp); __Pyx_XDECREF(__pyx_v_tmp2); __Pyx_XDECREF(__pyx_v_fieldnames); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Partitioner.pyx":19 * Type = PartitionerType * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.part * self.part = NULL */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_11Partitioner_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_11Partitioner_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_8petsc4py_5PETSc_11Partitioner___cinit__(((struct PyPetscPartitionerObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_11Partitioner___cinit__(struct PyPetscPartitionerObject *__pyx_v_self) { int __pyx_r; /* "petsc4py/PETSc/Partitioner.pyx":20 * * def __cinit__(self): * self.obj = &self.part # <<<<<<<<<<<<<< * self.part = NULL * */ __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->part)); /* "petsc4py/PETSc/Partitioner.pyx":21 * def __cinit__(self): * self.obj = &self.part * self.part = NULL # <<<<<<<<<<<<<< * * def view(self, Viewer viewer=None) -> None: */ __pyx_v_self->part = NULL; /* "petsc4py/PETSc/Partitioner.pyx":19 * Type = PartitionerType * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.part * self.part = NULL */ /* function exit code */ __pyx_r = 0; return __pyx_r; } /* "petsc4py/PETSc/Partitioner.pyx":23 * self.part = NULL * * def view(self, Viewer viewer=None) -> None: # <<<<<<<<<<<<<< * """View the partitioner. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_11Partitioner_3view(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_11Partitioner_2view, "Partitioner.view(self, viewer: Viewer | None = None) -> None\nView the partitioner.\n\n Collective.\n\n Parameters\n ----------\n viewer\n A `Viewer` to display the graph.\n\n See Also\n --------\n petsc.PetscPartitionerView\n\n \nSource code at petsc4py/PETSc/Partitioner.pyx:23"); static PyObject *__pyx_pw_8petsc4py_5PETSc_11Partitioner_3view(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscViewerObject *__pyx_v_viewer = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("view (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscViewerObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_viewer); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(63, 23, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "view") < 0)) __PYX_ERR(63, 23, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, __pyx_nargs); __PYX_ERR(63, 23, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Partitioner.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(63, 23, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_11Partitioner_2view(((struct PyPetscPartitionerObject *)__pyx_v_self), __pyx_v_viewer); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_11Partitioner_2view(struct PyPetscPartitionerObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer) { PetscViewer __pyx_v_vwr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscViewer __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("view", 1); /* "petsc4py/PETSc/Partitioner.pyx":38 * * """ * cdef PetscViewer vwr = NULL # <<<<<<<<<<<<<< * if viewer is not None: vwr = viewer.vwr * CHKERR( PetscPartitionerView(self.part, vwr) ) */ __pyx_v_vwr = NULL; /* "petsc4py/PETSc/Partitioner.pyx":39 * """ * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr # <<<<<<<<<<<<<< * CHKERR( PetscPartitionerView(self.part, vwr) ) * */ __pyx_t_1 = (((PyObject *)__pyx_v_viewer) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_viewer->vwr; __pyx_v_vwr = __pyx_t_2; } /* "petsc4py/PETSc/Partitioner.pyx":40 * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr * CHKERR( PetscPartitionerView(self.part, vwr) ) # <<<<<<<<<<<<<< * * def destroy(self) -> Self: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscPartitionerView(__pyx_v_self->part, __pyx_v_vwr)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(63, 40, __pyx_L1_error) /* "petsc4py/PETSc/Partitioner.pyx":23 * self.part = NULL * * def view(self, Viewer viewer=None) -> None: # <<<<<<<<<<<<<< * """View the partitioner. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Partitioner.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Partitioner.pyx":42 * CHKERR( PetscPartitionerView(self.part, vwr) ) * * def destroy(self) -> Self: # <<<<<<<<<<<<<< * """Destroy the partitioner object. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_11Partitioner_5destroy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_11Partitioner_4destroy, "Partitioner.destroy(self) -> Self\nDestroy the partitioner object.\n\n Collective.\n\n See Also\n --------\n petsc.PetscPartitionerDestroy\n\n \nSource code at petsc4py/PETSc/Partitioner.pyx:42"); static PyObject *__pyx_pw_8petsc4py_5PETSc_11Partitioner_5destroy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("destroy (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_11Partitioner_4destroy(((struct PyPetscPartitionerObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_11Partitioner_4destroy(struct PyPetscPartitionerObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("destroy", 1); /* "petsc4py/PETSc/Partitioner.pyx":52 * * """ * CHKERR( PetscPartitionerDestroy(&self.part) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscPartitionerDestroy((&__pyx_v_self->part))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(63, 52, __pyx_L1_error) /* "petsc4py/PETSc/Partitioner.pyx":53 * """ * CHKERR( PetscPartitionerDestroy(&self.part) ) * return self # <<<<<<<<<<<<<< * * def create(self, comm: Comm | None = None) -> Self: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Partitioner.pyx":42 * CHKERR( PetscPartitionerView(self.part, vwr) ) * * def destroy(self) -> Self: # <<<<<<<<<<<<<< * """Destroy the partitioner object. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Partitioner.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Partitioner.pyx":55 * return self * * def create(self, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Create an empty partitioner object. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_11Partitioner_7create(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_11Partitioner_6create, "Partitioner.create(self, comm: Comm | None = None) -> Self\nCreate an empty partitioner object.\n\n Collective.\n\n The type can be set with `setType`.\n\n Parameters\n ----------\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n setType, petsc.PetscPartitionerCreate\n\n \nSource code at petsc4py/PETSc/Partitioner.pyx:55"); static PyObject *__pyx_pw_8petsc4py_5PETSc_11Partitioner_7create(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(63, 55, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "create") < 0)) __PYX_ERR(63, 55, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_comm = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, __pyx_nargs); __PYX_ERR(63, 55, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Partitioner.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_11Partitioner_6create(((struct PyPetscPartitionerObject *)__pyx_v_self), __pyx_v_comm); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_11Partitioner_6create(struct PyPetscPartitionerObject *__pyx_v_self, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PetscPartitioner __pyx_v_newpart; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create", 1); /* "petsc4py/PETSc/Partitioner.pyx":72 * * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscPartitioner newpart = NULL * CHKERR( PetscPartitionerCreate(ccomm, &newpart) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(63, 72, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/Partitioner.pyx":73 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscPartitioner newpart = NULL # <<<<<<<<<<<<<< * CHKERR( PetscPartitionerCreate(ccomm, &newpart) ) * CHKERR( PetscCLEAR(self.obj) ); self.part = newpart */ __pyx_v_newpart = NULL; /* "petsc4py/PETSc/Partitioner.pyx":74 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscPartitioner newpart = NULL * CHKERR( PetscPartitionerCreate(ccomm, &newpart) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.part = newpart * return self */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscPartitionerCreate(__pyx_v_ccomm, (&__pyx_v_newpart))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(63, 74, __pyx_L1_error) /* "petsc4py/PETSc/Partitioner.pyx":75 * cdef PetscPartitioner newpart = NULL * CHKERR( PetscPartitionerCreate(ccomm, &newpart) ) * CHKERR( PetscCLEAR(self.obj) ); self.part = newpart # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(63, 75, __pyx_L1_error) __pyx_v_self->part = __pyx_v_newpart; /* "petsc4py/PETSc/Partitioner.pyx":76 * CHKERR( PetscPartitionerCreate(ccomm, &newpart) ) * CHKERR( PetscCLEAR(self.obj) ); self.part = newpart * return self # <<<<<<<<<<<<<< * * def setType(self, part_type: Type | str) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Partitioner.pyx":55 * return self * * def create(self, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Create an empty partitioner object. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Partitioner.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Partitioner.pyx":78 * return self * * def setType(self, part_type: Type | str) -> None: # <<<<<<<<<<<<<< * """Build a particular type of the partitioner. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_11Partitioner_9setType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_11Partitioner_8setType, "Partitioner.setType(self, part_type: Type | str) -> None\nBuild a particular type of the partitioner.\n\n Collective.\n\n Parameters\n ----------\n part_type\n The kind of partitioner.\n\n See Also\n --------\n getType, petsc.PetscPartitionerSetType\n\n \nSource code at petsc4py/PETSc/Partitioner.pyx:78"); static PyObject *__pyx_pw_8petsc4py_5PETSc_11Partitioner_9setType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_part_type = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_part_type,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_part_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(63, 78, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setType") < 0)) __PYX_ERR(63, 78, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_part_type = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, __pyx_nargs); __PYX_ERR(63, 78, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Partitioner.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_11Partitioner_8setType(((struct PyPetscPartitionerObject *)__pyx_v_self), __pyx_v_part_type); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_11Partitioner_8setType(struct PyPetscPartitionerObject *__pyx_v_self, PyObject *__pyx_v_part_type) { PetscPartitionerType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setType", 0); __Pyx_INCREF(__pyx_v_part_type); /* "petsc4py/PETSc/Partitioner.pyx":93 * * """ * cdef PetscPartitionerType cval = NULL # <<<<<<<<<<<<<< * part_type = str2bytes(part_type, &cval) * CHKERR( PetscPartitionerSetType(self.part, cval) ) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/Partitioner.pyx":94 * """ * cdef PetscPartitionerType cval = NULL * part_type = str2bytes(part_type, &cval) # <<<<<<<<<<<<<< * CHKERR( PetscPartitionerSetType(self.part, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_part_type, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(63, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_part_type, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Partitioner.pyx":95 * cdef PetscPartitionerType cval = NULL * part_type = str2bytes(part_type, &cval) * CHKERR( PetscPartitionerSetType(self.part, cval) ) # <<<<<<<<<<<<<< * * def getType(self) -> Type: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscPartitionerSetType(__pyx_v_self->part, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(63, 95, __pyx_L1_error) /* "petsc4py/PETSc/Partitioner.pyx":78 * return self * * def setType(self, part_type: Type | str) -> None: # <<<<<<<<<<<<<< * """Build a particular type of the partitioner. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Partitioner.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_part_type); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Partitioner.pyx":97 * CHKERR( PetscPartitionerSetType(self.part, cval) ) * * def getType(self) -> Type: # <<<<<<<<<<<<<< * """Return the partitioner type. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_11Partitioner_11getType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_11Partitioner_10getType, "Partitioner.getType(self) -> Type\nReturn the partitioner type.\n\n Not collective.\n\n See Also\n --------\n setType, petsc.PetscPartitionerGetType\n\n \nSource code at petsc4py/PETSc/Partitioner.pyx:97"); static PyObject *__pyx_pw_8petsc4py_5PETSc_11Partitioner_11getType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getType", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_11Partitioner_10getType(((struct PyPetscPartitionerObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_11Partitioner_10getType(struct PyPetscPartitionerObject *__pyx_v_self) { PetscPartitionerType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getType", 1); /* "petsc4py/PETSc/Partitioner.pyx":107 * * """ * cdef PetscPartitionerType cval = NULL # <<<<<<<<<<<<<< * CHKERR( PetscPartitionerGetType(self.part, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/Partitioner.pyx":108 * """ * cdef PetscPartitionerType cval = NULL * CHKERR( PetscPartitionerGetType(self.part, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscPartitionerGetType(__pyx_v_self->part, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(63, 108, __pyx_L1_error) /* "petsc4py/PETSc/Partitioner.pyx":109 * cdef PetscPartitionerType cval = NULL * CHKERR( PetscPartitionerGetType(self.part, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * def setFromOptions(self) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(63, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Partitioner.pyx":97 * CHKERR( PetscPartitionerSetType(self.part, cval) ) * * def getType(self) -> Type: # <<<<<<<<<<<<<< * """Return the partitioner type. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Partitioner.getType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Partitioner.pyx":111 * return bytes2str(cval) * * def setFromOptions(self) -> None: # <<<<<<<<<<<<<< * """Set parameters in the partitioner from the options database. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_11Partitioner_13setFromOptions(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_11Partitioner_12setFromOptions, "Partitioner.setFromOptions(self) -> None\nSet parameters in the partitioner from the options database.\n\n Collective.\n\n See Also\n --------\n petsc_options, petsc.PetscPartitionerSetFromOptions\n\n \nSource code at petsc4py/PETSc/Partitioner.pyx:111"); static PyObject *__pyx_pw_8petsc4py_5PETSc_11Partitioner_13setFromOptions(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFromOptions (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("setFromOptions", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setFromOptions", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_11Partitioner_12setFromOptions(((struct PyPetscPartitionerObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_11Partitioner_12setFromOptions(struct PyPetscPartitionerObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFromOptions", 1); /* "petsc4py/PETSc/Partitioner.pyx":121 * * """ * CHKERR( PetscPartitionerSetFromOptions(self.part) ) # <<<<<<<<<<<<<< * * def setUp(self) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscPartitionerSetFromOptions(__pyx_v_self->part)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(63, 121, __pyx_L1_error) /* "petsc4py/PETSc/Partitioner.pyx":111 * return bytes2str(cval) * * def setFromOptions(self) -> None: # <<<<<<<<<<<<<< * """Set parameters in the partitioner from the options database. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Partitioner.setFromOptions", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Partitioner.pyx":123 * CHKERR( PetscPartitionerSetFromOptions(self.part) ) * * def setUp(self) -> None: # <<<<<<<<<<<<<< * """Construct data structures for the partitioner. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_11Partitioner_15setUp(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_11Partitioner_14setUp, "Partitioner.setUp(self) -> None\nConstruct data structures for the partitioner.\n\n Collective.\n\n See Also\n --------\n petsc.PetscPartitionerSetUp\n\n \nSource code at petsc4py/PETSc/Partitioner.pyx:123"); static PyObject *__pyx_pw_8petsc4py_5PETSc_11Partitioner_15setUp(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setUp (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("setUp", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setUp", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_11Partitioner_14setUp(((struct PyPetscPartitionerObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_11Partitioner_14setUp(struct PyPetscPartitionerObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setUp", 1); /* "petsc4py/PETSc/Partitioner.pyx":133 * * """ * CHKERR( PetscPartitionerSetUp(self.part) ) # <<<<<<<<<<<<<< * * def reset(self) -> None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscPartitionerSetUp(__pyx_v_self->part)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(63, 133, __pyx_L1_error) /* "petsc4py/PETSc/Partitioner.pyx":123 * CHKERR( PetscPartitionerSetFromOptions(self.part) ) * * def setUp(self) -> None: # <<<<<<<<<<<<<< * """Construct data structures for the partitioner. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Partitioner.setUp", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Partitioner.pyx":135 * CHKERR( PetscPartitionerSetUp(self.part) ) * * def reset(self) -> None: # <<<<<<<<<<<<<< * """Reset data structures of the partitioner. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_11Partitioner_17reset(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_11Partitioner_16reset, "Partitioner.reset(self) -> None\nReset data structures of the partitioner.\n\n Collective.\n\n See Also\n --------\n petsc.PetscPartitionerReset\n\n \nSource code at petsc4py/PETSc/Partitioner.pyx:135"); static PyObject *__pyx_pw_8petsc4py_5PETSc_11Partitioner_17reset(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("reset (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("reset", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "reset", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_11Partitioner_16reset(((struct PyPetscPartitionerObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_11Partitioner_16reset(struct PyPetscPartitionerObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("reset", 1); /* "petsc4py/PETSc/Partitioner.pyx":145 * * """ * CHKERR( PetscPartitionerReset(self.part) ) # <<<<<<<<<<<<<< * * def setShellPartition( */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscPartitionerReset(__pyx_v_self->part)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(63, 145, __pyx_L1_error) /* "petsc4py/PETSc/Partitioner.pyx":135 * CHKERR( PetscPartitionerSetUp(self.part) ) * * def reset(self) -> None: # <<<<<<<<<<<<<< * """Reset data structures of the partitioner. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Partitioner.reset", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Partitioner.pyx":147 * CHKERR( PetscPartitionerReset(self.part) ) * * def setShellPartition( # <<<<<<<<<<<<<< * self, * numProcs: int, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_11Partitioner_19setShellPartition(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_11Partitioner_18setShellPartition, "Partitioner.setShellPartition(self, numProcs: int, sizes: Sequence[int] | None = None, points: Sequence[int] | None = None) -> None\nSet a custom partition for a mesh.\n\n Collective.\n\n Parameters\n ----------\n sizes\n The number of points in each partition.\n points\n A permutation of the points that groups those assigned to each\n partition in order (i.e., partition 0 first, partition 1 next,\n etc.).\n\n See Also\n --------\n petsc.PetscPartitionerShellSetPartition\n\n \nSource code at petsc4py/PETSc/Partitioner.pyx:147"); static PyObject *__pyx_pw_8petsc4py_5PETSc_11Partitioner_19setShellPartition(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_numProcs = 0; PyObject *__pyx_v_sizes = 0; PyObject *__pyx_v_points = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setShellPartition (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_numProcs,&__pyx_n_s_sizes,&__pyx_n_s_points,0}; /* "petsc4py/PETSc/Partitioner.pyx":150 * self, * numProcs: int, * sizes: Sequence[int] | None = None, # <<<<<<<<<<<<<< * points: Sequence[int] | None = None, * ) -> None: */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); /* "petsc4py/PETSc/Partitioner.pyx":151 * numProcs: int, * sizes: Sequence[int] | None = None, * points: Sequence[int] | None = None, # <<<<<<<<<<<<<< * ) -> None: * """Set a custom partition for a mesh. */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_numProcs)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(63, 147, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sizes); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(63, 147, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_points); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(63, 147, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setShellPartition") < 0)) __PYX_ERR(63, 147, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_numProcs = values[0]; __pyx_v_sizes = values[1]; __pyx_v_points = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setShellPartition", 0, 1, 3, __pyx_nargs); __PYX_ERR(63, 147, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Partitioner.setShellPartition", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_11Partitioner_18setShellPartition(((struct PyPetscPartitionerObject *)__pyx_v_self), __pyx_v_numProcs, __pyx_v_sizes, __pyx_v_points); /* "petsc4py/PETSc/Partitioner.pyx":147 * CHKERR( PetscPartitionerReset(self.part) ) * * def setShellPartition( # <<<<<<<<<<<<<< * self, * numProcs: int, */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_11Partitioner_18setShellPartition(struct PyPetscPartitionerObject *__pyx_v_self, PyObject *__pyx_v_numProcs, PyObject *__pyx_v_sizes, PyObject *__pyx_v_points) { PetscInt __pyx_v_cnumProcs; PetscInt *__pyx_v_csizes; PetscInt *__pyx_v_cpoints; PetscInt __pyx_v_nsize; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PetscErrorCode __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setShellPartition", 0); __Pyx_INCREF(__pyx_v_sizes); __Pyx_INCREF(__pyx_v_points); /* "petsc4py/PETSc/Partitioner.pyx":171 * * """ * cdef PetscInt cnumProcs = asInt(numProcs) # <<<<<<<<<<<<<< * cdef PetscInt *csizes = NULL * cdef PetscInt *cpoints = NULL */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_numProcs); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(63, 171, __pyx_L1_error) __pyx_v_cnumProcs = __pyx_t_1; /* "petsc4py/PETSc/Partitioner.pyx":172 * """ * cdef PetscInt cnumProcs = asInt(numProcs) * cdef PetscInt *csizes = NULL # <<<<<<<<<<<<<< * cdef PetscInt *cpoints = NULL * cdef PetscInt nsize = 0 */ __pyx_v_csizes = NULL; /* "petsc4py/PETSc/Partitioner.pyx":173 * cdef PetscInt cnumProcs = asInt(numProcs) * cdef PetscInt *csizes = NULL * cdef PetscInt *cpoints = NULL # <<<<<<<<<<<<<< * cdef PetscInt nsize = 0 * if sizes is not None: */ __pyx_v_cpoints = NULL; /* "petsc4py/PETSc/Partitioner.pyx":174 * cdef PetscInt *csizes = NULL * cdef PetscInt *cpoints = NULL * cdef PetscInt nsize = 0 # <<<<<<<<<<<<<< * if sizes is not None: * sizes = iarray_i(sizes, &nsize, &csizes) */ __pyx_v_nsize = 0; /* "petsc4py/PETSc/Partitioner.pyx":175 * cdef PetscInt *cpoints = NULL * cdef PetscInt nsize = 0 * if sizes is not None: # <<<<<<<<<<<<<< * sizes = iarray_i(sizes, &nsize, &csizes) * if nsize != cnumProcs: */ __pyx_t_2 = (__pyx_v_sizes != Py_None); if (__pyx_t_2) { /* "petsc4py/PETSc/Partitioner.pyx":176 * cdef PetscInt nsize = 0 * if sizes is not None: * sizes = iarray_i(sizes, &nsize, &csizes) # <<<<<<<<<<<<<< * if nsize != cnumProcs: * raise ValueError("sizes array should have %d entries (has %d)" % */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_sizes, (&__pyx_v_nsize), (&__pyx_v_csizes))); if (unlikely(!__pyx_t_3)) __PYX_ERR(63, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_sizes, __pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/Partitioner.pyx":177 * if sizes is not None: * sizes = iarray_i(sizes, &nsize, &csizes) * if nsize != cnumProcs: # <<<<<<<<<<<<<< * raise ValueError("sizes array should have %d entries (has %d)" % * numProcs, toInt(nsize)) */ __pyx_t_2 = (__pyx_v_nsize != __pyx_v_cnumProcs); if (unlikely(__pyx_t_2)) { /* "petsc4py/PETSc/Partitioner.pyx":178 * sizes = iarray_i(sizes, &nsize, &csizes) * if nsize != cnumProcs: * raise ValueError("sizes array should have %d entries (has %d)" % # <<<<<<<<<<<<<< * numProcs, toInt(nsize)) * if points is None: */ __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_sizes_array_should_have_d_entrie, __pyx_v_numProcs); if (unlikely(!__pyx_t_3)) __PYX_ERR(63, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "petsc4py/PETSc/Partitioner.pyx":179 * if nsize != cnumProcs: * raise ValueError("sizes array should have %d entries (has %d)" % * numProcs, toInt(nsize)) # <<<<<<<<<<<<<< * if points is None: * raise ValueError("Must provide both sizes and points arrays") */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(63, 179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); /* "petsc4py/PETSc/Partitioner.pyx":178 * sizes = iarray_i(sizes, &nsize, &csizes) * if nsize != cnumProcs: * raise ValueError("sizes array should have %d entries (has %d)" % # <<<<<<<<<<<<<< * numProcs, toInt(nsize)) * if points is None: */ __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(63, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3)) __PYX_ERR(63, 178, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4)) __PYX_ERR(63, 178, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(63, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(63, 178, __pyx_L1_error) /* "petsc4py/PETSc/Partitioner.pyx":177 * if sizes is not None: * sizes = iarray_i(sizes, &nsize, &csizes) * if nsize != cnumProcs: # <<<<<<<<<<<<<< * raise ValueError("sizes array should have %d entries (has %d)" % * numProcs, toInt(nsize)) */ } /* "petsc4py/PETSc/Partitioner.pyx":180 * raise ValueError("sizes array should have %d entries (has %d)" % * numProcs, toInt(nsize)) * if points is None: # <<<<<<<<<<<<<< * raise ValueError("Must provide both sizes and points arrays") * if points is not None: */ __pyx_t_2 = (__pyx_v_points == Py_None); if (unlikely(__pyx_t_2)) { /* "petsc4py/PETSc/Partitioner.pyx":181 * numProcs, toInt(nsize)) * if points is None: * raise ValueError("Must provide both sizes and points arrays") # <<<<<<<<<<<<<< * if points is not None: * points = iarray_i(points, NULL, &cpoints) */ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__64, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(63, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(63, 181, __pyx_L1_error) /* "petsc4py/PETSc/Partitioner.pyx":180 * raise ValueError("sizes array should have %d entries (has %d)" % * numProcs, toInt(nsize)) * if points is None: # <<<<<<<<<<<<<< * raise ValueError("Must provide both sizes and points arrays") * if points is not None: */ } /* "petsc4py/PETSc/Partitioner.pyx":175 * cdef PetscInt *cpoints = NULL * cdef PetscInt nsize = 0 * if sizes is not None: # <<<<<<<<<<<<<< * sizes = iarray_i(sizes, &nsize, &csizes) * if nsize != cnumProcs: */ } /* "petsc4py/PETSc/Partitioner.pyx":182 * if points is None: * raise ValueError("Must provide both sizes and points arrays") * if points is not None: # <<<<<<<<<<<<<< * points = iarray_i(points, NULL, &cpoints) * CHKERR( PetscPartitionerShellSetPartition(self.part, cnumProcs, */ __pyx_t_2 = (__pyx_v_points != Py_None); if (__pyx_t_2) { /* "petsc4py/PETSc/Partitioner.pyx":183 * raise ValueError("Must provide both sizes and points arrays") * if points is not None: * points = iarray_i(points, NULL, &cpoints) # <<<<<<<<<<<<<< * CHKERR( PetscPartitionerShellSetPartition(self.part, cnumProcs, * csizes, cpoints) ) */ __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_points, NULL, (&__pyx_v_cpoints))); if (unlikely(!__pyx_t_4)) __PYX_ERR(63, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_points, __pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/Partitioner.pyx":182 * if points is None: * raise ValueError("Must provide both sizes and points arrays") * if points is not None: # <<<<<<<<<<<<<< * points = iarray_i(points, NULL, &cpoints) * CHKERR( PetscPartitionerShellSetPartition(self.part, cnumProcs, */ } /* "petsc4py/PETSc/Partitioner.pyx":184 * if points is not None: * points = iarray_i(points, NULL, &cpoints) * CHKERR( PetscPartitionerShellSetPartition(self.part, cnumProcs, # <<<<<<<<<<<<<< * csizes, cpoints) ) * */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscPartitionerShellSetPartition(__pyx_v_self->part, __pyx_v_cnumProcs, __pyx_v_csizes, __pyx_v_cpoints)); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(63, 184, __pyx_L1_error) /* "petsc4py/PETSc/Partitioner.pyx":147 * CHKERR( PetscPartitionerReset(self.part) ) * * def setShellPartition( # <<<<<<<<<<<<<< * self, * numProcs: int, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.Partitioner.setShellPartition", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_sizes); __Pyx_XDECREF(__pyx_v_points); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Space.pyx":18 * Type = SpaceType * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.space * self.space = NULL */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_5Space_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_5Space_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_8petsc4py_5PETSc_5Space___cinit__(((struct PyPetscSpaceObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_5Space___cinit__(struct PyPetscSpaceObject *__pyx_v_self) { int __pyx_r; /* "petsc4py/PETSc/Space.pyx":19 * * def __cinit__(self): * self.obj = &self.space # <<<<<<<<<<<<<< * self.space = NULL * */ __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->space)); /* "petsc4py/PETSc/Space.pyx":20 * def __cinit__(self): * self.obj = &self.space * self.space = NULL # <<<<<<<<<<<<<< * * def setUp(self) -> None: */ __pyx_v_self->space = NULL; /* "petsc4py/PETSc/Space.pyx":18 * Type = SpaceType * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.space * self.space = NULL */ /* function exit code */ __pyx_r = 0; return __pyx_r; } /* "petsc4py/PETSc/Space.pyx":22 * self.space = NULL * * def setUp(self) -> None: # <<<<<<<<<<<<<< * """Construct data structures for the `Space`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5Space_3setUp(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_5Space_2setUp, "Space.setUp(self) -> None\nConstruct data structures for the `Space`.\n\n Collective.\n\n See Also\n --------\n petsc.PetscSpaceSetUp\n\n \nSource code at petsc4py/PETSc/Space.pyx:22"); static PyObject *__pyx_pw_8petsc4py_5PETSc_5Space_3setUp(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setUp (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("setUp", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setUp", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_5Space_2setUp(((struct PyPetscSpaceObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_2setUp(struct PyPetscSpaceObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setUp", 1); /* "petsc4py/PETSc/Space.pyx":32 * * """ * CHKERR( PetscSpaceSetUp(self.space) ) # <<<<<<<<<<<<<< * * def create(self, comm: Comm | None = None) -> Self: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSpaceSetUp(__pyx_v_self->space)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(64, 32, __pyx_L1_error) /* "petsc4py/PETSc/Space.pyx":22 * self.space = NULL * * def setUp(self) -> None: # <<<<<<<<<<<<<< * """Construct data structures for the `Space`. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Space.setUp", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Space.pyx":34 * CHKERR( PetscSpaceSetUp(self.space) ) * * def create(self, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Create an empty `Space` object. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5Space_5create(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_5Space_4create, "Space.create(self, comm: Comm | None = None) -> Self\nCreate an empty `Space` object.\n\n Collective.\n\n The type can then be set with `setType`.\n\n Parameters\n ----------\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n petsc.PetscSpaceCreate\n\n \nSource code at petsc4py/PETSc/Space.pyx:34"); static PyObject *__pyx_pw_8petsc4py_5PETSc_5Space_5create(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(64, 34, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "create") < 0)) __PYX_ERR(64, 34, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_comm = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, __pyx_nargs); __PYX_ERR(64, 34, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Space.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_5Space_4create(((struct PyPetscSpaceObject *)__pyx_v_self), __pyx_v_comm); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_4create(struct PyPetscSpaceObject *__pyx_v_self, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PetscSpace __pyx_v_newsp; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create", 1); /* "petsc4py/PETSc/Space.pyx":51 * * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscSpace newsp = NULL * CHKERR( PetscSpaceCreate(ccomm, &newsp) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(64, 51, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/Space.pyx":52 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscSpace newsp = NULL # <<<<<<<<<<<<<< * CHKERR( PetscSpaceCreate(ccomm, &newsp) ) * CHKERR( PetscCLEAR(self.obj) ); self.space = newsp */ __pyx_v_newsp = NULL; /* "petsc4py/PETSc/Space.pyx":53 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscSpace newsp = NULL * CHKERR( PetscSpaceCreate(ccomm, &newsp) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.space = newsp * return self */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSpaceCreate(__pyx_v_ccomm, (&__pyx_v_newsp))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(64, 53, __pyx_L1_error) /* "petsc4py/PETSc/Space.pyx":54 * cdef PetscSpace newsp = NULL * CHKERR( PetscSpaceCreate(ccomm, &newsp) ) * CHKERR( PetscCLEAR(self.obj) ); self.space = newsp # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(64, 54, __pyx_L1_error) __pyx_v_self->space = __pyx_v_newsp; /* "petsc4py/PETSc/Space.pyx":55 * CHKERR( PetscSpaceCreate(ccomm, &newsp) ) * CHKERR( PetscCLEAR(self.obj) ); self.space = newsp * return self # <<<<<<<<<<<<<< * * def destroy(self) -> Self: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Space.pyx":34 * CHKERR( PetscSpaceSetUp(self.space) ) * * def create(self, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Create an empty `Space` object. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Space.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Space.pyx":57 * return self * * def destroy(self) -> Self: # <<<<<<<<<<<<<< * """Destroy the `Space` object. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5Space_7destroy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_5Space_6destroy, "Space.destroy(self) -> Self\nDestroy the `Space` object.\n\n Collective.\n\n See Also\n --------\n petsc.PetscSpaceDestroy\n\n \nSource code at petsc4py/PETSc/Space.pyx:57"); static PyObject *__pyx_pw_8petsc4py_5PETSc_5Space_7destroy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("destroy (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_5Space_6destroy(((struct PyPetscSpaceObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_6destroy(struct PyPetscSpaceObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("destroy", 1); /* "petsc4py/PETSc/Space.pyx":67 * * """ * CHKERR( PetscSpaceDestroy(&self.space) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSpaceDestroy((&__pyx_v_self->space))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(64, 67, __pyx_L1_error) /* "petsc4py/PETSc/Space.pyx":68 * """ * CHKERR( PetscSpaceDestroy(&self.space) ) * return self # <<<<<<<<<<<<<< * * def view(self, Viewer viewer=None) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Space.pyx":57 * return self * * def destroy(self) -> Self: # <<<<<<<<<<<<<< * """Destroy the `Space` object. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Space.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Space.pyx":70 * return self * * def view(self, Viewer viewer=None) -> None: # <<<<<<<<<<<<<< * """View a `Space`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5Space_9view(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_5Space_8view, "Space.view(self, viewer: Viewer | None = None) -> None\nView a `Space`.\n\n Collective.\n\n Parameters\n ----------\n viewer\n A `Viewer` to display the `Space`.\n\n See Also\n --------\n petsc.PetscSpaceView\n\n \nSource code at petsc4py/PETSc/Space.pyx:70"); static PyObject *__pyx_pw_8petsc4py_5PETSc_5Space_9view(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscViewerObject *__pyx_v_viewer = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("view (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscViewerObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_viewer); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(64, 70, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "view") < 0)) __PYX_ERR(64, 70, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, __pyx_nargs); __PYX_ERR(64, 70, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Space.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(64, 70, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_5Space_8view(((struct PyPetscSpaceObject *)__pyx_v_self), __pyx_v_viewer); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_8view(struct PyPetscSpaceObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer) { PetscViewer __pyx_v_vwr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscViewer __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("view", 1); /* "petsc4py/PETSc/Space.pyx":85 * * """ * cdef PetscViewer vwr = NULL # <<<<<<<<<<<<<< * if viewer is not None: vwr = viewer.vwr * CHKERR( PetscSpaceView(self.space, vwr) ) */ __pyx_v_vwr = NULL; /* "petsc4py/PETSc/Space.pyx":86 * """ * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr # <<<<<<<<<<<<<< * CHKERR( PetscSpaceView(self.space, vwr) ) * */ __pyx_t_1 = (((PyObject *)__pyx_v_viewer) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_viewer->vwr; __pyx_v_vwr = __pyx_t_2; } /* "petsc4py/PETSc/Space.pyx":87 * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr * CHKERR( PetscSpaceView(self.space, vwr) ) # <<<<<<<<<<<<<< * * def setFromOptions(self) -> None: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSpaceView(__pyx_v_self->space, __pyx_v_vwr)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(64, 87, __pyx_L1_error) /* "petsc4py/PETSc/Space.pyx":70 * return self * * def view(self, Viewer viewer=None) -> None: # <<<<<<<<<<<<<< * """View a `Space`. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Space.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Space.pyx":89 * CHKERR( PetscSpaceView(self.space, vwr) ) * * def setFromOptions(self) -> None: # <<<<<<<<<<<<<< * """Set parameters in `Space` from the options database. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5Space_11setFromOptions(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_5Space_10setFromOptions, "Space.setFromOptions(self) -> None\nSet parameters in `Space` from the options database.\n\n Collective.\n\n See Also\n --------\n petsc_options, petsc.PetscSpaceSetFromOptions\n\n \nSource code at petsc4py/PETSc/Space.pyx:89"); static PyObject *__pyx_pw_8petsc4py_5PETSc_5Space_11setFromOptions(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFromOptions (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("setFromOptions", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setFromOptions", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_5Space_10setFromOptions(((struct PyPetscSpaceObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_10setFromOptions(struct PyPetscSpaceObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFromOptions", 1); /* "petsc4py/PETSc/Space.pyx":99 * * """ * CHKERR( PetscSpaceSetFromOptions(self.space) ) # <<<<<<<<<<<<<< * * def getDimension(self) -> int: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSpaceSetFromOptions(__pyx_v_self->space)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(64, 99, __pyx_L1_error) /* "petsc4py/PETSc/Space.pyx":89 * CHKERR( PetscSpaceView(self.space, vwr) ) * * def setFromOptions(self) -> None: # <<<<<<<<<<<<<< * """Set parameters in `Space` from the options database. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Space.setFromOptions", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Space.pyx":101 * CHKERR( PetscSpaceSetFromOptions(self.space) ) * * def getDimension(self) -> int: # <<<<<<<<<<<<<< * """Return the number of basis vectors. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5Space_13getDimension(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_5Space_12getDimension, "Space.getDimension(self) -> int\nReturn the number of basis vectors.\n\n See Also\n --------\n petsc.PetscSpaceGetDimension\n\n \nSource code at petsc4py/PETSc/Space.pyx:101"); static PyObject *__pyx_pw_8petsc4py_5PETSc_5Space_13getDimension(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getDimension (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getDimension", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getDimension", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_5Space_12getDimension(((struct PyPetscSpaceObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_12getDimension(struct PyPetscSpaceObject *__pyx_v_self) { PetscInt __pyx_v_cdim; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getDimension", 1); /* "petsc4py/PETSc/Space.pyx":110 * """ * cdef PetscInt cdim * CHKERR( PetscSpaceGetDimension(self.space, &cdim)) # <<<<<<<<<<<<<< * return toInt(cdim) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSpaceGetDimension(__pyx_v_self->space, (&__pyx_v_cdim))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(64, 110, __pyx_L1_error) /* "petsc4py/PETSc/Space.pyx":111 * cdef PetscInt cdim * CHKERR( PetscSpaceGetDimension(self.space, &cdim)) * return toInt(cdim) # <<<<<<<<<<<<<< * * def getDegree(self) -> tuple[int, int]: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_cdim); if (unlikely(!__pyx_t_2)) __PYX_ERR(64, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Space.pyx":101 * CHKERR( PetscSpaceSetFromOptions(self.space) ) * * def getDimension(self) -> int: # <<<<<<<<<<<<<< * """Return the number of basis vectors. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Space.getDimension", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Space.pyx":113 * return toInt(cdim) * * def getDegree(self) -> tuple[int, int]: # <<<<<<<<<<<<<< * """Return the polynomial degrees that characterize this space. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5Space_15getDegree(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_5Space_14getDegree, "Space.getDegree(self) -> tuple[int, int]\nReturn the polynomial degrees that characterize this space.\n\n Returns\n -------\n minDegree : int\n The degree of the largest polynomial space contained in the space.\n maxDegree : int\n The degree of the smallest polynomial space containing the space.\n\n See Also\n --------\n setDegree, petsc.PetscSpaceGetDegree\n\n \nSource code at petsc4py/PETSc/Space.pyx:113"); static PyObject *__pyx_pw_8petsc4py_5PETSc_5Space_15getDegree(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getDegree (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getDegree", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getDegree", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_5Space_14getDegree(((struct PyPetscSpaceObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_14getDegree(struct PyPetscSpaceObject *__pyx_v_self) { PetscInt __pyx_v_cdegmax; PetscInt __pyx_v_cdegmin; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getDegree", 1); /* "petsc4py/PETSc/Space.pyx":129 * """ * cdef PetscInt cdegmax, cdegmin * CHKERR( PetscSpaceGetDegree(self.space, &cdegmin, &cdegmax)) # <<<<<<<<<<<<<< * return toInt(cdegmin), toInt(cdegmax) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSpaceGetDegree(__pyx_v_self->space, (&__pyx_v_cdegmin), (&__pyx_v_cdegmax))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(64, 129, __pyx_L1_error) /* "petsc4py/PETSc/Space.pyx":130 * cdef PetscInt cdegmax, cdegmin * CHKERR( PetscSpaceGetDegree(self.space, &cdegmin, &cdegmax)) * return toInt(cdegmin), toInt(cdegmax) # <<<<<<<<<<<<<< * * def setDegree(self, degree: int | None, maxDegree: int | None) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_cdegmin); if (unlikely(!__pyx_t_2)) __PYX_ERR(64, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_cdegmax); if (unlikely(!__pyx_t_3)) __PYX_ERR(64, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(64, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(64, 130, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(64, 130, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Space.pyx":113 * return toInt(cdim) * * def getDegree(self) -> tuple[int, int]: # <<<<<<<<<<<<<< * """Return the polynomial degrees that characterize this space. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.Space.getDegree", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Space.pyx":132 * return toInt(cdegmin), toInt(cdegmax) * * def setDegree(self, degree: int | None, maxDegree: int | None) -> None: # <<<<<<<<<<<<<< * """Set the degree of approximation for this space. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5Space_17setDegree(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_5Space_16setDegree, "Space.setDegree(self, degree: int | None, maxDegree: int | None) -> None\nSet the degree of approximation for this space.\n\n One of ``degree`` and ``maxDegree`` can be `None`.\n\n Parameters\n ----------\n degree\n The degree of the largest polynomial space contained in the space.\n maxDegree\n The degree of the largest polynomial space containing the space.\n\n See Also\n --------\n getDegree, petsc.PetscSpaceSetDegree\n\n \nSource code at petsc4py/PETSc/Space.pyx:132"); static PyObject *__pyx_pw_8petsc4py_5PETSc_5Space_17setDegree(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_degree = 0; PyObject *__pyx_v_maxDegree = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setDegree (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_degree,&__pyx_n_s_maxDegree,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_degree)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(64, 132, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_maxDegree)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(64, 132, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setDegree", 1, 2, 2, 1); __PYX_ERR(64, 132, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setDegree") < 0)) __PYX_ERR(64, 132, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_degree = values[0]; __pyx_v_maxDegree = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setDegree", 1, 2, 2, __pyx_nargs); __PYX_ERR(64, 132, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Space.setDegree", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_5Space_16setDegree(((struct PyPetscSpaceObject *)__pyx_v_self), __pyx_v_degree, __pyx_v_maxDegree); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_16setDegree(struct PyPetscSpaceObject *__pyx_v_self, PyObject *__pyx_v_degree, PyObject *__pyx_v_maxDegree) { PetscInt __pyx_v_cdegree; PetscInt __pyx_v_cmaxdegree; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PetscInt __pyx_t_5; PetscErrorCode __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setDegree", 1); /* "petsc4py/PETSc/Space.pyx":149 * * """ * assert( (degree != None) & (maxDegree != None)) # <<<<<<<<<<<<<< * cdef PetscInt cdegree = PETSC_DETERMINE * if degree is not None: cdegree = asInt(degree) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_1 = PyObject_RichCompare(__pyx_v_degree, Py_None, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(64, 149, __pyx_L1_error) __pyx_t_2 = PyObject_RichCompare(__pyx_v_maxDegree, Py_None, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(64, 149, __pyx_L1_error) __pyx_t_3 = PyNumber_And(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(64, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(64, 149, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_4)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(64, 149, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(64, 149, __pyx_L1_error) #endif /* "petsc4py/PETSc/Space.pyx":150 * """ * assert( (degree != None) & (maxDegree != None)) * cdef PetscInt cdegree = PETSC_DETERMINE # <<<<<<<<<<<<<< * if degree is not None: cdegree = asInt(degree) * cdef PetscInt cmaxdegree = PETSC_DETERMINE */ __pyx_v_cdegree = PETSC_DETERMINE; /* "petsc4py/PETSc/Space.pyx":151 * assert( (degree != None) & (maxDegree != None)) * cdef PetscInt cdegree = PETSC_DETERMINE * if degree is not None: cdegree = asInt(degree) # <<<<<<<<<<<<<< * cdef PetscInt cmaxdegree = PETSC_DETERMINE * if maxDegree is not None: cmaxdegree = asInt(maxDegree) */ __pyx_t_4 = (__pyx_v_degree != Py_None); if (__pyx_t_4) { __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_degree); if (unlikely(__pyx_t_5 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(64, 151, __pyx_L1_error) __pyx_v_cdegree = __pyx_t_5; } /* "petsc4py/PETSc/Space.pyx":152 * cdef PetscInt cdegree = PETSC_DETERMINE * if degree is not None: cdegree = asInt(degree) * cdef PetscInt cmaxdegree = PETSC_DETERMINE # <<<<<<<<<<<<<< * if maxDegree is not None: cmaxdegree = asInt(maxDegree) * CHKERR( PetscSpaceSetDegree(self.space, cdegree, cmaxdegree) ) */ __pyx_v_cmaxdegree = PETSC_DETERMINE; /* "petsc4py/PETSc/Space.pyx":153 * if degree is not None: cdegree = asInt(degree) * cdef PetscInt cmaxdegree = PETSC_DETERMINE * if maxDegree is not None: cmaxdegree = asInt(maxDegree) # <<<<<<<<<<<<<< * CHKERR( PetscSpaceSetDegree(self.space, cdegree, cmaxdegree) ) * */ __pyx_t_4 = (__pyx_v_maxDegree != Py_None); if (__pyx_t_4) { __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_maxDegree); if (unlikely(__pyx_t_5 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(64, 153, __pyx_L1_error) __pyx_v_cmaxdegree = __pyx_t_5; } /* "petsc4py/PETSc/Space.pyx":154 * cdef PetscInt cmaxdegree = PETSC_DETERMINE * if maxDegree is not None: cmaxdegree = asInt(maxDegree) * CHKERR( PetscSpaceSetDegree(self.space, cdegree, cmaxdegree) ) # <<<<<<<<<<<<<< * * def getNumVariables(self) -> int: */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSpaceSetDegree(__pyx_v_self->space, __pyx_v_cdegree, __pyx_v_cmaxdegree)); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(64, 154, __pyx_L1_error) /* "petsc4py/PETSc/Space.pyx":132 * return toInt(cdegmin), toInt(cdegmax) * * def setDegree(self, degree: int | None, maxDegree: int | None) -> None: # <<<<<<<<<<<<<< * """Set the degree of approximation for this space. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Space.setDegree", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Space.pyx":156 * CHKERR( PetscSpaceSetDegree(self.space, cdegree, cmaxdegree) ) * * def getNumVariables(self) -> int: # <<<<<<<<<<<<<< * """Return the number of variables for this space. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5Space_19getNumVariables(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_5Space_18getNumVariables, "Space.getNumVariables(self) -> int\nReturn the number of variables for this space.\n\n See Also\n --------\n setNumVariables, petsc.PetscSpaceGetNumVariables\n\n \nSource code at petsc4py/PETSc/Space.pyx:156"); static PyObject *__pyx_pw_8petsc4py_5PETSc_5Space_19getNumVariables(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getNumVariables (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getNumVariables", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getNumVariables", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_5Space_18getNumVariables(((struct PyPetscSpaceObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_18getNumVariables(struct PyPetscSpaceObject *__pyx_v_self) { PetscInt __pyx_v_cnvars; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getNumVariables", 1); /* "petsc4py/PETSc/Space.pyx":165 * """ * cdef PetscInt cnvars * CHKERR( PetscSpaceGetNumVariables(self.space, &cnvars)) # <<<<<<<<<<<<<< * return toInt(cnvars) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSpaceGetNumVariables(__pyx_v_self->space, (&__pyx_v_cnvars))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(64, 165, __pyx_L1_error) /* "petsc4py/PETSc/Space.pyx":166 * cdef PetscInt cnvars * CHKERR( PetscSpaceGetNumVariables(self.space, &cnvars)) * return toInt(cnvars) # <<<<<<<<<<<<<< * * def setNumVariables(self, n: int) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_cnvars); if (unlikely(!__pyx_t_2)) __PYX_ERR(64, 166, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Space.pyx":156 * CHKERR( PetscSpaceSetDegree(self.space, cdegree, cmaxdegree) ) * * def getNumVariables(self) -> int: # <<<<<<<<<<<<<< * """Return the number of variables for this space. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Space.getNumVariables", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Space.pyx":168 * return toInt(cnvars) * * def setNumVariables(self, n: int) -> None: # <<<<<<<<<<<<<< * """Set the number of variables for this space. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5Space_21setNumVariables(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_5Space_20setNumVariables, "Space.setNumVariables(self, n: int) -> None\nSet the number of variables for this space.\n\n Parameters\n ----------\n n\n The number of variables (``x``, ``y``, ``z`` etc.).\n\n See Also\n --------\n getNumVariables, petsc.PetscSpaceSetNumVariables\n\n \nSource code at petsc4py/PETSc/Space.pyx:168"); static PyObject *__pyx_pw_8petsc4py_5PETSc_5Space_21setNumVariables(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_n = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setNumVariables (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(64, 168, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setNumVariables") < 0)) __PYX_ERR(64, 168, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_n = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setNumVariables", 1, 1, 1, __pyx_nargs); __PYX_ERR(64, 168, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Space.setNumVariables", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_5Space_20setNumVariables(((struct PyPetscSpaceObject *)__pyx_v_self), __pyx_v_n); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_20setNumVariables(struct PyPetscSpaceObject *__pyx_v_self, PyObject *__pyx_v_n) { PetscInt __pyx_v_cn; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setNumVariables", 1); /* "petsc4py/PETSc/Space.pyx":181 * * """ * cdef PetscInt cn = asInt(n) # <<<<<<<<<<<<<< * CHKERR( PetscSpaceSetNumVariables(self.space, cn) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_n); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(64, 181, __pyx_L1_error) __pyx_v_cn = __pyx_t_1; /* "petsc4py/PETSc/Space.pyx":182 * """ * cdef PetscInt cn = asInt(n) * CHKERR( PetscSpaceSetNumVariables(self.space, cn) ) # <<<<<<<<<<<<<< * * def getNumComponents(self) -> int: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSpaceSetNumVariables(__pyx_v_self->space, __pyx_v_cn)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(64, 182, __pyx_L1_error) /* "petsc4py/PETSc/Space.pyx":168 * return toInt(cnvars) * * def setNumVariables(self, n: int) -> None: # <<<<<<<<<<<<<< * """Set the number of variables for this space. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Space.setNumVariables", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Space.pyx":184 * CHKERR( PetscSpaceSetNumVariables(self.space, cn) ) * * def getNumComponents(self) -> int: # <<<<<<<<<<<<<< * """Return the number of components for this space. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5Space_23getNumComponents(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_5Space_22getNumComponents, "Space.getNumComponents(self) -> int\nReturn the number of components for this space.\n\n See Also\n --------\n setNumComponents, petsc.PetscSpaceGetNumComponents\n\n \nSource code at petsc4py/PETSc/Space.pyx:184"); static PyObject *__pyx_pw_8petsc4py_5PETSc_5Space_23getNumComponents(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getNumComponents (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getNumComponents", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getNumComponents", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_5Space_22getNumComponents(((struct PyPetscSpaceObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_22getNumComponents(struct PyPetscSpaceObject *__pyx_v_self) { PetscInt __pyx_v_cncomps; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getNumComponents", 1); /* "petsc4py/PETSc/Space.pyx":193 * """ * cdef PetscInt cncomps * CHKERR( PetscSpaceGetNumComponents(self.space, &cncomps)) # <<<<<<<<<<<<<< * return toInt(cncomps) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSpaceGetNumComponents(__pyx_v_self->space, (&__pyx_v_cncomps))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(64, 193, __pyx_L1_error) /* "petsc4py/PETSc/Space.pyx":194 * cdef PetscInt cncomps * CHKERR( PetscSpaceGetNumComponents(self.space, &cncomps)) * return toInt(cncomps) # <<<<<<<<<<<<<< * * def setNumComponents(self, nc: int) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_cncomps); if (unlikely(!__pyx_t_2)) __PYX_ERR(64, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Space.pyx":184 * CHKERR( PetscSpaceSetNumVariables(self.space, cn) ) * * def getNumComponents(self) -> int: # <<<<<<<<<<<<<< * """Return the number of components for this space. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Space.getNumComponents", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Space.pyx":196 * return toInt(cncomps) * * def setNumComponents(self, nc: int) -> None: # <<<<<<<<<<<<<< * """Set the number of components for this space. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5Space_25setNumComponents(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_5Space_24setNumComponents, "Space.setNumComponents(self, nc: int) -> None\nSet the number of components for this space.\n\n Parameters\n ----------\n nc\n The number of components.\n\n See Also\n --------\n getNumComponents, petsc.PetscSpaceSetNumComponents\n\n \nSource code at petsc4py/PETSc/Space.pyx:196"); static PyObject *__pyx_pw_8petsc4py_5PETSc_5Space_25setNumComponents(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_nc = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setNumComponents (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nc,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_nc)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(64, 196, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setNumComponents") < 0)) __PYX_ERR(64, 196, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_nc = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setNumComponents", 1, 1, 1, __pyx_nargs); __PYX_ERR(64, 196, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Space.setNumComponents", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_5Space_24setNumComponents(((struct PyPetscSpaceObject *)__pyx_v_self), __pyx_v_nc); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_24setNumComponents(struct PyPetscSpaceObject *__pyx_v_self, PyObject *__pyx_v_nc) { PetscInt __pyx_v_cnc; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setNumComponents", 1); /* "petsc4py/PETSc/Space.pyx":209 * * """ * cdef PetscInt cnc = asInt(nc) # <<<<<<<<<<<<<< * CHKERR( PetscSpaceSetNumComponents(self.space, cnc) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_nc); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(64, 209, __pyx_L1_error) __pyx_v_cnc = __pyx_t_1; /* "petsc4py/PETSc/Space.pyx":210 * """ * cdef PetscInt cnc = asInt(nc) * CHKERR( PetscSpaceSetNumComponents(self.space, cnc) ) # <<<<<<<<<<<<<< * * #def evaluate(self, points): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSpaceSetNumComponents(__pyx_v_self->space, __pyx_v_cnc)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(64, 210, __pyx_L1_error) /* "petsc4py/PETSc/Space.pyx":196 * return toInt(cncomps) * * def setNumComponents(self, nc: int) -> None: # <<<<<<<<<<<<<< * """Set the number of components for this space. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Space.setNumComponents", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Space.pyx":223 * # return array_r(cnpoints*cdim, B), array_r(cnpoints*cnc, D), array_r(, H) * * def getType(self) -> str: # <<<<<<<<<<<<<< * """Return the type of the space object. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5Space_27getType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_5Space_26getType, "Space.getType(self) -> str\nReturn the type of the space object.\n\n Not collective.\n\n See Also\n --------\n setType, petsc.PetscSpaceGetType\n\n \nSource code at petsc4py/PETSc/Space.pyx:223"); static PyObject *__pyx_pw_8petsc4py_5PETSc_5Space_27getType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getType", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_5Space_26getType(((struct PyPetscSpaceObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_26getType(struct PyPetscSpaceObject *__pyx_v_self) { PetscSpaceType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getType", 1); /* "petsc4py/PETSc/Space.pyx":233 * * """ * cdef PetscSpaceType cval = NULL # <<<<<<<<<<<<<< * CHKERR( PetscSpaceGetType(self.space, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/Space.pyx":234 * """ * cdef PetscSpaceType cval = NULL * CHKERR( PetscSpaceGetType(self.space, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSpaceGetType(__pyx_v_self->space, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(64, 234, __pyx_L1_error) /* "petsc4py/PETSc/Space.pyx":235 * cdef PetscSpaceType cval = NULL * CHKERR( PetscSpaceGetType(self.space, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * def setType(self, space_type: Type | str) -> Self: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(64, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Space.pyx":223 * # return array_r(cnpoints*cdim, B), array_r(cnpoints*cnc, D), array_r(, H) * * def getType(self) -> str: # <<<<<<<<<<<<<< * """Return the type of the space object. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Space.getType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Space.pyx":237 * return bytes2str(cval) * * def setType(self, space_type: Type | str) -> Self: # <<<<<<<<<<<<<< * """Build a particular type of space. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5Space_29setType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_5Space_28setType, "Space.setType(self, space_type: Type | str) -> Self\nBuild a particular type of space.\n\n Collective.\n\n Parameters\n ----------\n space_type\n The kind of space.\n\n See Also\n --------\n getType, petsc.PetscSpaceSetType\n\n \nSource code at petsc4py/PETSc/Space.pyx:237"); static PyObject *__pyx_pw_8petsc4py_5PETSc_5Space_29setType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_space_type = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_space_type,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_space_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(64, 237, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setType") < 0)) __PYX_ERR(64, 237, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_space_type = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, __pyx_nargs); __PYX_ERR(64, 237, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Space.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_5Space_28setType(((struct PyPetscSpaceObject *)__pyx_v_self), __pyx_v_space_type); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_28setType(struct PyPetscSpaceObject *__pyx_v_self, PyObject *__pyx_v_space_type) { PetscSpaceType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setType", 0); __Pyx_INCREF(__pyx_v_space_type); /* "petsc4py/PETSc/Space.pyx":252 * * """ * cdef PetscSpaceType cval = NULL # <<<<<<<<<<<<<< * space_type = str2bytes(space_type, &cval) * CHKERR( PetscSpaceSetType(self.space, cval) ) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/Space.pyx":253 * """ * cdef PetscSpaceType cval = NULL * space_type = str2bytes(space_type, &cval) # <<<<<<<<<<<<<< * CHKERR( PetscSpaceSetType(self.space, cval) ) * return self */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_space_type, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(64, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_space_type, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Space.pyx":254 * cdef PetscSpaceType cval = NULL * space_type = str2bytes(space_type, &cval) * CHKERR( PetscSpaceSetType(self.space, cval) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSpaceSetType(__pyx_v_self->space, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(64, 254, __pyx_L1_error) /* "petsc4py/PETSc/Space.pyx":255 * space_type = str2bytes(space_type, &cval) * CHKERR( PetscSpaceSetType(self.space, cval) ) * return self # <<<<<<<<<<<<<< * * def getSumConcatenate(self) -> bool: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Space.pyx":237 * return bytes2str(cval) * * def setType(self, space_type: Type | str) -> Self: # <<<<<<<<<<<<<< * """Build a particular type of space. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Space.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_space_type); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Space.pyx":257 * return self * * def getSumConcatenate(self) -> bool: # <<<<<<<<<<<<<< * """Return the concatenate flag for this space. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5Space_31getSumConcatenate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_5Space_30getSumConcatenate, "Space.getSumConcatenate(self) -> bool\nReturn the concatenate flag for this space.\n\n A concatenated sum space will have the number of components equal to\n the sum of the number of components of all subspaces.\n A non-concatenated, or direct sum space will have the same number of\n components as its subspaces.\n\n See Also\n --------\n setSumConcatenate, petsc.PetscSpaceSumGetConcatenate\n\n \nSource code at petsc4py/PETSc/Space.pyx:257"); static PyObject *__pyx_pw_8petsc4py_5PETSc_5Space_31getSumConcatenate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSumConcatenate (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getSumConcatenate", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getSumConcatenate", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_5Space_30getSumConcatenate(((struct PyPetscSpaceObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_30getSumConcatenate(struct PyPetscSpaceObject *__pyx_v_self) { PetscBool __pyx_v_concatenate; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSumConcatenate", 1); /* "petsc4py/PETSc/Space.pyx":271 * """ * cdef PetscBool concatenate * CHKERR( PetscSpaceSumGetConcatenate(self.space, &concatenate)) # <<<<<<<<<<<<<< * return toBool(concatenate) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSpaceSumGetConcatenate(__pyx_v_self->space, (&__pyx_v_concatenate))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(64, 271, __pyx_L1_error) /* "petsc4py/PETSc/Space.pyx":272 * cdef PetscBool concatenate * CHKERR( PetscSpaceSumGetConcatenate(self.space, &concatenate)) * return toBool(concatenate) # <<<<<<<<<<<<<< * * def setSumConcatenate(self, concatenate: bool) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_concatenate); if (unlikely(!__pyx_t_2)) __PYX_ERR(64, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Space.pyx":257 * return self * * def getSumConcatenate(self) -> bool: # <<<<<<<<<<<<<< * """Return the concatenate flag for this space. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Space.getSumConcatenate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Space.pyx":274 * return toBool(concatenate) * * def setSumConcatenate(self, concatenate: bool) -> None: # <<<<<<<<<<<<<< * """Set the concatenate flag for this space. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5Space_33setSumConcatenate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_5Space_32setSumConcatenate, "Space.setSumConcatenate(self, concatenate: bool) -> None\nSet the concatenate flag for this space.\n\n A concatenated sum space will have the number of components equal to\n the sum of the number of components of all subspaces.\n A non-concatenated, or direct sum space will have the same number of\n components as its subspaces.\n\n Parameters\n ----------\n concatenate\n `True` if subspaces are concatenated components,\n `False` if direct summands.\n\n See Also\n --------\n getSumConcatenate, petsc.PetscSpaceSumSetConcatenate\n\n \nSource code at petsc4py/PETSc/Space.pyx:274"); static PyObject *__pyx_pw_8petsc4py_5PETSc_5Space_33setSumConcatenate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_concatenate = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setSumConcatenate (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_concatenate,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_concatenate)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(64, 274, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setSumConcatenate") < 0)) __PYX_ERR(64, 274, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_concatenate = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setSumConcatenate", 1, 1, 1, __pyx_nargs); __PYX_ERR(64, 274, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Space.setSumConcatenate", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_5Space_32setSumConcatenate(((struct PyPetscSpaceObject *)__pyx_v_self), __pyx_v_concatenate); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_32setSumConcatenate(struct PyPetscSpaceObject *__pyx_v_self, PyObject *__pyx_v_concatenate) { CYTHON_UNUSED PetscBool __pyx_v_cconcatenate; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setSumConcatenate", 1); /* "petsc4py/PETSc/Space.pyx":293 * * """ * cdef PetscBool cconcatenate = asBool(concatenate) # <<<<<<<<<<<<<< * CHKERR( PetscSpaceSumSetConcatenate(self.space, concatenate)) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asBool(__pyx_v_concatenate); if (unlikely(__pyx_t_1 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(64, 293, __pyx_L1_error) __pyx_v_cconcatenate = __pyx_t_1; /* "petsc4py/PETSc/Space.pyx":294 * """ * cdef PetscBool cconcatenate = asBool(concatenate) * CHKERR( PetscSpaceSumSetConcatenate(self.space, concatenate)) # <<<<<<<<<<<<<< * * def getSumNumSubspaces(self) -> int: */ __pyx_t_1 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_concatenate)); if (unlikely(PyErr_Occurred())) __PYX_ERR(64, 294, __pyx_L1_error) __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSpaceSumSetConcatenate(__pyx_v_self->space, __pyx_t_1)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(64, 294, __pyx_L1_error) /* "petsc4py/PETSc/Space.pyx":274 * return toBool(concatenate) * * def setSumConcatenate(self, concatenate: bool) -> None: # <<<<<<<<<<<<<< * """Set the concatenate flag for this space. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Space.setSumConcatenate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Space.pyx":296 * CHKERR( PetscSpaceSumSetConcatenate(self.space, concatenate)) * * def getSumNumSubspaces(self) -> int: # <<<<<<<<<<<<<< * """Return the number of spaces in the sum. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5Space_35getSumNumSubspaces(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_5Space_34getSumNumSubspaces, "Space.getSumNumSubspaces(self) -> int\nReturn the number of spaces in the sum.\n\n See Also\n --------\n setSumNumSubspaces, petsc.PetscSpaceSumGetNumSubspaces\n\n \nSource code at petsc4py/PETSc/Space.pyx:296"); static PyObject *__pyx_pw_8petsc4py_5PETSc_5Space_35getSumNumSubspaces(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSumNumSubspaces (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getSumNumSubspaces", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getSumNumSubspaces", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_5Space_34getSumNumSubspaces(((struct PyPetscSpaceObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_34getSumNumSubspaces(struct PyPetscSpaceObject *__pyx_v_self) { PetscInt __pyx_v_numSumSpaces; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSumNumSubspaces", 1); /* "petsc4py/PETSc/Space.pyx":305 * """ * cdef PetscInt numSumSpaces * CHKERR( PetscSpaceSumGetNumSubspaces(self.space, &numSumSpaces)) # <<<<<<<<<<<<<< * return toInt(numSumSpaces) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSpaceSumGetNumSubspaces(__pyx_v_self->space, (&__pyx_v_numSumSpaces))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(64, 305, __pyx_L1_error) /* "petsc4py/PETSc/Space.pyx":306 * cdef PetscInt numSumSpaces * CHKERR( PetscSpaceSumGetNumSubspaces(self.space, &numSumSpaces)) * return toInt(numSumSpaces) # <<<<<<<<<<<<<< * * def getSumSubspace(self, s: int) -> Space: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_numSumSpaces); if (unlikely(!__pyx_t_2)) __PYX_ERR(64, 306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Space.pyx":296 * CHKERR( PetscSpaceSumSetConcatenate(self.space, concatenate)) * * def getSumNumSubspaces(self) -> int: # <<<<<<<<<<<<<< * """Return the number of spaces in the sum. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Space.getSumNumSubspaces", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Space.pyx":308 * return toInt(numSumSpaces) * * def getSumSubspace(self, s: int) -> Space: # <<<<<<<<<<<<<< * """Return a space in the sum. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5Space_37getSumSubspace(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_5Space_36getSumSubspace, "Space.getSumSubspace(self, s: int) -> Space\nReturn a space in the sum.\n\n Parameters\n ----------\n s\n The space number.\n\n See Also\n --------\n setSumSubspace, petsc.PetscSpaceSumGetSubspace\n\n \nSource code at petsc4py/PETSc/Space.pyx:308"); static PyObject *__pyx_pw_8petsc4py_5PETSc_5Space_37getSumSubspace(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_s = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSumSubspace (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_s_2,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_s_2)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(64, 308, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getSumSubspace") < 0)) __PYX_ERR(64, 308, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_s = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getSumSubspace", 1, 1, 1, __pyx_nargs); __PYX_ERR(64, 308, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Space.getSumSubspace", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_5Space_36getSumSubspace(((struct PyPetscSpaceObject *)__pyx_v_self), __pyx_v_s); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_36getSumSubspace(struct PyPetscSpaceObject *__pyx_v_self, PyObject *__pyx_v_s) { struct PyPetscSpaceObject *__pyx_v_subsp = 0; CYTHON_UNUSED PetscInt __pyx_v_cs; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscInt __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSumSubspace", 1); /* "petsc4py/PETSc/Space.pyx":321 * * """ * cdef Space subsp = Space() # <<<<<<<<<<<<<< * cdef PetscInt cs = asInt(s) * CHKERR( PetscSpaceSumGetSubspace(self.space, s, &subsp.space) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Space)); if (unlikely(!__pyx_t_1)) __PYX_ERR(64, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_subsp = ((struct PyPetscSpaceObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Space.pyx":322 * """ * cdef Space subsp = Space() * cdef PetscInt cs = asInt(s) # <<<<<<<<<<<<<< * CHKERR( PetscSpaceSumGetSubspace(self.space, s, &subsp.space) ) * return subsp */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_s); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(64, 322, __pyx_L1_error) __pyx_v_cs = __pyx_t_2; /* "petsc4py/PETSc/Space.pyx":323 * cdef Space subsp = Space() * cdef PetscInt cs = asInt(s) * CHKERR( PetscSpaceSumGetSubspace(self.space, s, &subsp.space) ) # <<<<<<<<<<<<<< * return subsp * */ __pyx_t_2 = __Pyx_PyInt_As_PetscInt(__pyx_v_s); if (unlikely((__pyx_t_2 == ((PetscInt)-1)) && PyErr_Occurred())) __PYX_ERR(64, 323, __pyx_L1_error) __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSpaceSumGetSubspace(__pyx_v_self->space, __pyx_t_2, (&__pyx_v_subsp->space))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(64, 323, __pyx_L1_error) /* "petsc4py/PETSc/Space.pyx":324 * cdef PetscInt cs = asInt(s) * CHKERR( PetscSpaceSumGetSubspace(self.space, s, &subsp.space) ) * return subsp # <<<<<<<<<<<<<< * * def setSumSubspace(self, s: int, Space subsp) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_subsp); __pyx_r = ((PyObject *)__pyx_v_subsp); goto __pyx_L0; /* "petsc4py/PETSc/Space.pyx":308 * return toInt(numSumSpaces) * * def getSumSubspace(self, s: int) -> Space: # <<<<<<<<<<<<<< * """Return a space in the sum. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Space.getSumSubspace", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_subsp); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Space.pyx":326 * return subsp * * def setSumSubspace(self, s: int, Space subsp) -> None: # <<<<<<<<<<<<<< * """Set a space in the sum. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5Space_39setSumSubspace(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_5Space_38setSumSubspace, "Space.setSumSubspace(self, s: int, subsp: Space) -> None\nSet a space in the sum.\n\n Parameters\n ----------\n s\n The space number.\n subsp\n The number of spaces.\n\n See Also\n --------\n getSumSubspace, petsc.PetscSpaceSumSetSubspace\n\n \nSource code at petsc4py/PETSc/Space.pyx:326"); static PyObject *__pyx_pw_8petsc4py_5PETSc_5Space_39setSumSubspace(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_s = 0; struct PyPetscSpaceObject *__pyx_v_subsp = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setSumSubspace (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_s_2,&__pyx_n_s_subsp,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_s_2)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(64, 326, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_subsp)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(64, 326, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setSumSubspace", 1, 2, 2, 1); __PYX_ERR(64, 326, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setSumSubspace") < 0)) __PYX_ERR(64, 326, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_s = values[0]; __pyx_v_subsp = ((struct PyPetscSpaceObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setSumSubspace", 1, 2, 2, __pyx_nargs); __PYX_ERR(64, 326, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Space.setSumSubspace", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subsp), __pyx_ptype_8petsc4py_5PETSc_Space, 0, "subsp", 0))) __PYX_ERR(64, 326, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_5Space_38setSumSubspace(((struct PyPetscSpaceObject *)__pyx_v_self), __pyx_v_s, __pyx_v_subsp); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_38setSumSubspace(struct PyPetscSpaceObject *__pyx_v_self, PyObject *__pyx_v_s, struct PyPetscSpaceObject *__pyx_v_subsp) { PetscInt __pyx_v_cs; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setSumSubspace", 1); /* "petsc4py/PETSc/Space.pyx":341 * * """ * cdef PetscInt cs = asInt(s) # <<<<<<<<<<<<<< * CHKERR( PetscSpaceSumSetSubspace(self.space, cs, subsp.space) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_s); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(64, 341, __pyx_L1_error) __pyx_v_cs = __pyx_t_1; /* "petsc4py/PETSc/Space.pyx":342 * """ * cdef PetscInt cs = asInt(s) * CHKERR( PetscSpaceSumSetSubspace(self.space, cs, subsp.space) ) # <<<<<<<<<<<<<< * * def setSumNumSubspaces(self, numSumSpaces: int) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSpaceSumSetSubspace(__pyx_v_self->space, __pyx_v_cs, __pyx_v_subsp->space)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(64, 342, __pyx_L1_error) /* "petsc4py/PETSc/Space.pyx":326 * return subsp * * def setSumSubspace(self, s: int, Space subsp) -> None: # <<<<<<<<<<<<<< * """Set a space in the sum. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Space.setSumSubspace", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Space.pyx":344 * CHKERR( PetscSpaceSumSetSubspace(self.space, cs, subsp.space) ) * * def setSumNumSubspaces(self, numSumSpaces: int) -> None: # <<<<<<<<<<<<<< * """Set the number of spaces in the sum. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5Space_41setSumNumSubspaces(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_5Space_40setSumNumSubspaces, "Space.setSumNumSubspaces(self, numSumSpaces: int) -> None\nSet the number of spaces in the sum.\n\n Parameters\n ----------\n numSumSpaces\n The number of spaces.\n\n See Also\n --------\n getSumNumSubspaces, petsc.PetscSpaceSumSetNumSubspaces\n\n \nSource code at petsc4py/PETSc/Space.pyx:344"); static PyObject *__pyx_pw_8petsc4py_5PETSc_5Space_41setSumNumSubspaces(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_numSumSpaces = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setSumNumSubspaces (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_numSumSpaces,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_numSumSpaces)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(64, 344, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setSumNumSubspaces") < 0)) __PYX_ERR(64, 344, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_numSumSpaces = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setSumNumSubspaces", 1, 1, 1, __pyx_nargs); __PYX_ERR(64, 344, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Space.setSumNumSubspaces", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_5Space_40setSumNumSubspaces(((struct PyPetscSpaceObject *)__pyx_v_self), __pyx_v_numSumSpaces); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_40setSumNumSubspaces(struct PyPetscSpaceObject *__pyx_v_self, PyObject *__pyx_v_numSumSpaces) { PetscInt __pyx_v_cnumSumSpaces; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setSumNumSubspaces", 1); /* "petsc4py/PETSc/Space.pyx":357 * * """ * cdef PetscInt cnumSumSpaces = asInt(numSumSpaces) # <<<<<<<<<<<<<< * CHKERR( PetscSpaceSumSetNumSubspaces(self.space, cnumSumSpaces) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_numSumSpaces); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(64, 357, __pyx_L1_error) __pyx_v_cnumSumSpaces = __pyx_t_1; /* "petsc4py/PETSc/Space.pyx":358 * """ * cdef PetscInt cnumSumSpaces = asInt(numSumSpaces) * CHKERR( PetscSpaceSumSetNumSubspaces(self.space, cnumSumSpaces) ) # <<<<<<<<<<<<<< * * def getTensorNumSubspaces(self) -> int: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSpaceSumSetNumSubspaces(__pyx_v_self->space, __pyx_v_cnumSumSpaces)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(64, 358, __pyx_L1_error) /* "petsc4py/PETSc/Space.pyx":344 * CHKERR( PetscSpaceSumSetSubspace(self.space, cs, subsp.space) ) * * def setSumNumSubspaces(self, numSumSpaces: int) -> None: # <<<<<<<<<<<<<< * """Set the number of spaces in the sum. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Space.setSumNumSubspaces", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Space.pyx":360 * CHKERR( PetscSpaceSumSetNumSubspaces(self.space, cnumSumSpaces) ) * * def getTensorNumSubspaces(self) -> int: # <<<<<<<<<<<<<< * """Return the number of spaces in the tensor product. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5Space_43getTensorNumSubspaces(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_5Space_42getTensorNumSubspaces, "Space.getTensorNumSubspaces(self) -> int\nReturn the number of spaces in the tensor product.\n\n See Also\n --------\n setTensorNumSubspaces, petsc.PetscSpaceTensorGetNumSubspaces\n\n \nSource code at petsc4py/PETSc/Space.pyx:360"); static PyObject *__pyx_pw_8petsc4py_5PETSc_5Space_43getTensorNumSubspaces(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getTensorNumSubspaces (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getTensorNumSubspaces", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getTensorNumSubspaces", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_5Space_42getTensorNumSubspaces(((struct PyPetscSpaceObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_42getTensorNumSubspaces(struct PyPetscSpaceObject *__pyx_v_self) { PetscInt __pyx_v_cnumTensSpaces; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getTensorNumSubspaces", 1); /* "petsc4py/PETSc/Space.pyx":368 * * """ * cdef PetscInt cnumTensSpaces = 0 # <<<<<<<<<<<<<< * CHKERR( PetscSpaceTensorGetNumSubspaces(self.space, &cnumTensSpaces) ) * return toInt(cnumTensSpaces) */ __pyx_v_cnumTensSpaces = 0; /* "petsc4py/PETSc/Space.pyx":369 * """ * cdef PetscInt cnumTensSpaces = 0 * CHKERR( PetscSpaceTensorGetNumSubspaces(self.space, &cnumTensSpaces) ) # <<<<<<<<<<<<<< * return toInt(cnumTensSpaces) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSpaceTensorGetNumSubspaces(__pyx_v_self->space, (&__pyx_v_cnumTensSpaces))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(64, 369, __pyx_L1_error) /* "petsc4py/PETSc/Space.pyx":370 * cdef PetscInt cnumTensSpaces = 0 * CHKERR( PetscSpaceTensorGetNumSubspaces(self.space, &cnumTensSpaces) ) * return toInt(cnumTensSpaces) # <<<<<<<<<<<<<< * * def setTensorSubspace(self, s: int, Space subsp) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_cnumTensSpaces); if (unlikely(!__pyx_t_2)) __PYX_ERR(64, 370, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Space.pyx":360 * CHKERR( PetscSpaceSumSetNumSubspaces(self.space, cnumSumSpaces) ) * * def getTensorNumSubspaces(self) -> int: # <<<<<<<<<<<<<< * """Return the number of spaces in the tensor product. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Space.getTensorNumSubspaces", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Space.pyx":372 * return toInt(cnumTensSpaces) * * def setTensorSubspace(self, s: int, Space subsp) -> None: # <<<<<<<<<<<<<< * """Set a space in the tensor product. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5Space_45setTensorSubspace(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_5Space_44setTensorSubspace, "Space.setTensorSubspace(self, s: int, subsp: Space) -> None\nSet a space in the tensor product.\n\n Parameters\n ----------\n s\n The space number.\n subsp\n The number of spaces.\n\n See Also\n --------\n getTensorSubspace, petsc.PetscSpaceTensorSetSubspace\n\n \nSource code at petsc4py/PETSc/Space.pyx:372"); static PyObject *__pyx_pw_8petsc4py_5PETSc_5Space_45setTensorSubspace(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_s = 0; struct PyPetscSpaceObject *__pyx_v_subsp = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setTensorSubspace (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_s_2,&__pyx_n_s_subsp,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_s_2)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(64, 372, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_subsp)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(64, 372, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setTensorSubspace", 1, 2, 2, 1); __PYX_ERR(64, 372, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setTensorSubspace") < 0)) __PYX_ERR(64, 372, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_s = values[0]; __pyx_v_subsp = ((struct PyPetscSpaceObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setTensorSubspace", 1, 2, 2, __pyx_nargs); __PYX_ERR(64, 372, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Space.setTensorSubspace", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subsp), __pyx_ptype_8petsc4py_5PETSc_Space, 0, "subsp", 0))) __PYX_ERR(64, 372, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_5Space_44setTensorSubspace(((struct PyPetscSpaceObject *)__pyx_v_self), __pyx_v_s, __pyx_v_subsp); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_44setTensorSubspace(struct PyPetscSpaceObject *__pyx_v_self, PyObject *__pyx_v_s, struct PyPetscSpaceObject *__pyx_v_subsp) { PetscInt __pyx_v_cs; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setTensorSubspace", 1); /* "petsc4py/PETSc/Space.pyx":387 * * """ * cdef PetscInt cs = asInt(s) # <<<<<<<<<<<<<< * CHKERR( PetscSpaceTensorSetSubspace(self.space, cs, subsp.space) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_s); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(64, 387, __pyx_L1_error) __pyx_v_cs = __pyx_t_1; /* "petsc4py/PETSc/Space.pyx":388 * """ * cdef PetscInt cs = asInt(s) * CHKERR( PetscSpaceTensorSetSubspace(self.space, cs, subsp.space) ) # <<<<<<<<<<<<<< * * def getTensorSubspace(self, s: int) -> Space: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSpaceTensorSetSubspace(__pyx_v_self->space, __pyx_v_cs, __pyx_v_subsp->space)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(64, 388, __pyx_L1_error) /* "petsc4py/PETSc/Space.pyx":372 * return toInt(cnumTensSpaces) * * def setTensorSubspace(self, s: int, Space subsp) -> None: # <<<<<<<<<<<<<< * """Set a space in the tensor product. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Space.setTensorSubspace", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Space.pyx":390 * CHKERR( PetscSpaceTensorSetSubspace(self.space, cs, subsp.space) ) * * def getTensorSubspace(self, s: int) -> Space: # <<<<<<<<<<<<<< * """Return a space in the tensor product. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5Space_47getTensorSubspace(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_5Space_46getTensorSubspace, "Space.getTensorSubspace(self, s: int) -> Space\nReturn a space in the tensor product.\n\n Parameters\n ----------\n s\n The space number.\n\n See Also\n --------\n setTensorSubspace, petsc.PetscSpaceTensorGetSubspace\n\n \nSource code at petsc4py/PETSc/Space.pyx:390"); static PyObject *__pyx_pw_8petsc4py_5PETSc_5Space_47getTensorSubspace(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_s = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getTensorSubspace (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_s_2,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_s_2)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(64, 390, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getTensorSubspace") < 0)) __PYX_ERR(64, 390, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_s = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getTensorSubspace", 1, 1, 1, __pyx_nargs); __PYX_ERR(64, 390, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Space.getTensorSubspace", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_5Space_46getTensorSubspace(((struct PyPetscSpaceObject *)__pyx_v_self), __pyx_v_s); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_46getTensorSubspace(struct PyPetscSpaceObject *__pyx_v_self, PyObject *__pyx_v_s) { PetscInt __pyx_v_cs; struct PyPetscSpaceObject *__pyx_v_subsp = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getTensorSubspace", 1); /* "petsc4py/PETSc/Space.pyx":403 * * """ * cdef PetscInt cs = asInt(s) # <<<<<<<<<<<<<< * cdef Space subsp = Space() * CHKERR( PetscSpaceTensorGetSubspace(self.space, cs, &subsp.space) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_s); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(64, 403, __pyx_L1_error) __pyx_v_cs = __pyx_t_1; /* "petsc4py/PETSc/Space.pyx":404 * """ * cdef PetscInt cs = asInt(s) * cdef Space subsp = Space() # <<<<<<<<<<<<<< * CHKERR( PetscSpaceTensorGetSubspace(self.space, cs, &subsp.space) ) * return subsp */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Space)); if (unlikely(!__pyx_t_2)) __PYX_ERR(64, 404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_subsp = ((struct PyPetscSpaceObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/Space.pyx":405 * cdef PetscInt cs = asInt(s) * cdef Space subsp = Space() * CHKERR( PetscSpaceTensorGetSubspace(self.space, cs, &subsp.space) ) # <<<<<<<<<<<<<< * return subsp * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSpaceTensorGetSubspace(__pyx_v_self->space, __pyx_v_cs, (&__pyx_v_subsp->space))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(64, 405, __pyx_L1_error) /* "petsc4py/PETSc/Space.pyx":406 * cdef Space subsp = Space() * CHKERR( PetscSpaceTensorGetSubspace(self.space, cs, &subsp.space) ) * return subsp # <<<<<<<<<<<<<< * * def setTensorNumSubspaces(self, numTensSpaces: int) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_subsp); __pyx_r = ((PyObject *)__pyx_v_subsp); goto __pyx_L0; /* "petsc4py/PETSc/Space.pyx":390 * CHKERR( PetscSpaceTensorSetSubspace(self.space, cs, subsp.space) ) * * def getTensorSubspace(self, s: int) -> Space: # <<<<<<<<<<<<<< * """Return a space in the tensor product. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Space.getTensorSubspace", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_subsp); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Space.pyx":408 * return subsp * * def setTensorNumSubspaces(self, numTensSpaces: int) -> None: # <<<<<<<<<<<<<< * """Set the number of spaces in the tensor product. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5Space_49setTensorNumSubspaces(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_5Space_48setTensorNumSubspaces, "Space.setTensorNumSubspaces(self, numTensSpaces: int) -> None\nSet the number of spaces in the tensor product.\n\n Parameters\n ----------\n numTensSpaces\n The number of spaces.\n\n See Also\n --------\n getTensorNumSubspaces, petsc.PetscSpaceTensorSetNumSubspaces\n\n \nSource code at petsc4py/PETSc/Space.pyx:408"); static PyObject *__pyx_pw_8petsc4py_5PETSc_5Space_49setTensorNumSubspaces(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_numTensSpaces = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setTensorNumSubspaces (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_numTensSpaces,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_numTensSpaces)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(64, 408, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setTensorNumSubspaces") < 0)) __PYX_ERR(64, 408, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_numTensSpaces = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setTensorNumSubspaces", 1, 1, 1, __pyx_nargs); __PYX_ERR(64, 408, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Space.setTensorNumSubspaces", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_5Space_48setTensorNumSubspaces(((struct PyPetscSpaceObject *)__pyx_v_self), __pyx_v_numTensSpaces); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_48setTensorNumSubspaces(struct PyPetscSpaceObject *__pyx_v_self, PyObject *__pyx_v_numTensSpaces) { PetscInt __pyx_v_cnumTensSpaces; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setTensorNumSubspaces", 1); /* "petsc4py/PETSc/Space.pyx":421 * * """ * cdef PetscInt cnumTensSpaces = asInt(numTensSpaces) # <<<<<<<<<<<<<< * CHKERR( PetscSpaceTensorSetNumSubspaces(self.space, cnumTensSpaces) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_numTensSpaces); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(64, 421, __pyx_L1_error) __pyx_v_cnumTensSpaces = __pyx_t_1; /* "petsc4py/PETSc/Space.pyx":422 * """ * cdef PetscInt cnumTensSpaces = asInt(numTensSpaces) * CHKERR( PetscSpaceTensorSetNumSubspaces(self.space, cnumTensSpaces) ) # <<<<<<<<<<<<<< * * def getPolynomialTensor(self) -> bool: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSpaceTensorSetNumSubspaces(__pyx_v_self->space, __pyx_v_cnumTensSpaces)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(64, 422, __pyx_L1_error) /* "petsc4py/PETSc/Space.pyx":408 * return subsp * * def setTensorNumSubspaces(self, numTensSpaces: int) -> None: # <<<<<<<<<<<<<< * """Set the number of spaces in the tensor product. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Space.setTensorNumSubspaces", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Space.pyx":424 * CHKERR( PetscSpaceTensorSetNumSubspaces(self.space, cnumTensSpaces) ) * * def getPolynomialTensor(self) -> bool: # <<<<<<<<<<<<<< * """Return whether a function space is a space of tensor polynomials. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5Space_51getPolynomialTensor(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_5Space_50getPolynomialTensor, "Space.getPolynomialTensor(self) -> bool\nReturn whether a function space is a space of tensor polynomials.\n\n Return `True` if a function space is a space of tensor polynomials\n (the space is spanned by polynomials whose degree in each variable is\n bounded by the given order), as opposed to polynomials (the space is\n spanned by polynomials whose total degree\342\200\224summing over all variables\n is bounded by the given order).\n\n See Also\n --------\n setPolynomialTensor, petsc.PetscSpacePolynomialGetTensor\n\n \nSource code at petsc4py/PETSc/Space.pyx:424"); static PyObject *__pyx_pw_8petsc4py_5PETSc_5Space_51getPolynomialTensor(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getPolynomialTensor (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getPolynomialTensor", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getPolynomialTensor", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_5Space_50getPolynomialTensor(((struct PyPetscSpaceObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_50getPolynomialTensor(struct PyPetscSpaceObject *__pyx_v_self) { PetscBool __pyx_v_ctensor; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getPolynomialTensor", 1); /* "petsc4py/PETSc/Space.pyx":439 * """ * cdef PetscBool ctensor * CHKERR( PetscSpacePolynomialGetTensor(self.space, &ctensor) ) # <<<<<<<<<<<<<< * return toBool(ctensor) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSpacePolynomialGetTensor(__pyx_v_self->space, (&__pyx_v_ctensor))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(64, 439, __pyx_L1_error) /* "petsc4py/PETSc/Space.pyx":440 * cdef PetscBool ctensor * CHKERR( PetscSpacePolynomialGetTensor(self.space, &ctensor) ) * return toBool(ctensor) # <<<<<<<<<<<<<< * * def setPolynomialTensor(self, tensor: bool) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_ctensor); if (unlikely(!__pyx_t_2)) __PYX_ERR(64, 440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Space.pyx":424 * CHKERR( PetscSpaceTensorSetNumSubspaces(self.space, cnumTensSpaces) ) * * def getPolynomialTensor(self) -> bool: # <<<<<<<<<<<<<< * """Return whether a function space is a space of tensor polynomials. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Space.getPolynomialTensor", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Space.pyx":442 * return toBool(ctensor) * * def setPolynomialTensor(self, tensor: bool) -> None: # <<<<<<<<<<<<<< * """Set whether a function space is a space of tensor polynomials. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5Space_53setPolynomialTensor(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_5Space_52setPolynomialTensor, "Space.setPolynomialTensor(self, tensor: bool) -> None\nSet whether a function space is a space of tensor polynomials.\n\n Set to `True` for a function space which is a space of tensor\n polynomials (the space is spanned by polynomials whose degree in each\n variable is bounded by the given order), as opposed to polynomials\n (the space is spanned by polynomials whose total degree\342\200\224summing over\n all variables is bounded by the given order).\n\n Parameters\n ----------\n tensor\n `True` for a tensor polynomial space, `False` for a polynomial\n space.\n\n See Also\n --------\n getPolynomialTensor, petsc.PetscSpacePolynomialSetTensor\n\n \nSource code at petsc4py/PETSc/Space.pyx:442"); static PyObject *__pyx_pw_8petsc4py_5PETSc_5Space_53setPolynomialTensor(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_tensor = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPolynomialTensor (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tensor,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_tensor)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(64, 442, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setPolynomialTensor") < 0)) __PYX_ERR(64, 442, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_tensor = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPolynomialTensor", 1, 1, 1, __pyx_nargs); __PYX_ERR(64, 442, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Space.setPolynomialTensor", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_5Space_52setPolynomialTensor(((struct PyPetscSpaceObject *)__pyx_v_self), __pyx_v_tensor); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_52setPolynomialTensor(struct PyPetscSpaceObject *__pyx_v_self, PyObject *__pyx_v_tensor) { PetscBool __pyx_v_ctensor; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPolynomialTensor", 1); /* "petsc4py/PETSc/Space.pyx":462 * * """ * cdef PetscBool ctensor = asBool(tensor) # <<<<<<<<<<<<<< * CHKERR( PetscSpacePolynomialSetTensor(self.space, ctensor) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asBool(__pyx_v_tensor); if (unlikely(__pyx_t_1 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(64, 462, __pyx_L1_error) __pyx_v_ctensor = __pyx_t_1; /* "petsc4py/PETSc/Space.pyx":463 * """ * cdef PetscBool ctensor = asBool(tensor) * CHKERR( PetscSpacePolynomialSetTensor(self.space, ctensor) ) # <<<<<<<<<<<<<< * * def setPointPoints(self, Quad quad) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSpacePolynomialSetTensor(__pyx_v_self->space, __pyx_v_ctensor)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(64, 463, __pyx_L1_error) /* "petsc4py/PETSc/Space.pyx":442 * return toBool(ctensor) * * def setPolynomialTensor(self, tensor: bool) -> None: # <<<<<<<<<<<<<< * """Set whether a function space is a space of tensor polynomials. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Space.setPolynomialTensor", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Space.pyx":465 * CHKERR( PetscSpacePolynomialSetTensor(self.space, ctensor) ) * * def setPointPoints(self, Quad quad) -> None: # <<<<<<<<<<<<<< * """Set the evaluation points for the space to be based on a quad. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5Space_55setPointPoints(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_5Space_54setPointPoints, "Space.setPointPoints(self, quad: Quad) -> None\nSet the evaluation points for the space to be based on a quad.\n\n Logically collective.\n\n Sets the evaluation points for the space to coincide with the points\n of a quadrature rule.\n\n Parameters\n ----------\n quad\n The `Quad` defining the points.\n\n See Also\n --------\n getPointPoints, petsc.PetscSpacePointSetPoints\n\n \nSource code at petsc4py/PETSc/Space.pyx:465"); static PyObject *__pyx_pw_8petsc4py_5PETSc_5Space_55setPointPoints(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscQuadObject *__pyx_v_quad = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPointPoints (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_quad,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_quad)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(64, 465, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setPointPoints") < 0)) __PYX_ERR(64, 465, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_quad = ((struct PyPetscQuadObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPointPoints", 1, 1, 1, __pyx_nargs); __PYX_ERR(64, 465, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Space.setPointPoints", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quad), __pyx_ptype_8petsc4py_5PETSc_Quad, 0, "quad", 0))) __PYX_ERR(64, 465, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_5Space_54setPointPoints(((struct PyPetscSpaceObject *)__pyx_v_self), __pyx_v_quad); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_54setPointPoints(struct PyPetscSpaceObject *__pyx_v_self, struct PyPetscQuadObject *__pyx_v_quad) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPointPoints", 1); /* "petsc4py/PETSc/Space.pyx":483 * * """ * CHKERR( PetscSpacePointSetPoints(self.space, quad.quad)) # <<<<<<<<<<<<<< * * def getPointPoints(self) -> Quad: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSpacePointSetPoints(__pyx_v_self->space, __pyx_v_quad->quad)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(64, 483, __pyx_L1_error) /* "petsc4py/PETSc/Space.pyx":465 * CHKERR( PetscSpacePolynomialSetTensor(self.space, ctensor) ) * * def setPointPoints(self, Quad quad) -> None: # <<<<<<<<<<<<<< * """Set the evaluation points for the space to be based on a quad. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Space.setPointPoints", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Space.pyx":485 * CHKERR( PetscSpacePointSetPoints(self.space, quad.quad)) * * def getPointPoints(self) -> Quad: # <<<<<<<<<<<<<< * """Return the evaluation points for the space as the points of a quad. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5Space_57getPointPoints(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_5Space_56getPointPoints, "Space.getPointPoints(self) -> Quad\nReturn the evaluation points for the space as the points of a quad.\n\n Logically collective.\n\n See Also\n --------\n setPointPoints, petsc.PetscSpacePointGetPoints\n\n \nSource code at petsc4py/PETSc/Space.pyx:485"); static PyObject *__pyx_pw_8petsc4py_5PETSc_5Space_57getPointPoints(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getPointPoints (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getPointPoints", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getPointPoints", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_5Space_56getPointPoints(((struct PyPetscSpaceObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_56getPointPoints(struct PyPetscSpaceObject *__pyx_v_self) { struct PyPetscQuadObject *__pyx_v_quad = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getPointPoints", 1); /* "petsc4py/PETSc/Space.pyx":495 * * """ * cdef Quad quad = Quad() # <<<<<<<<<<<<<< * CHKERR( PetscSpacePointGetPoints(self.space, &quad.quad)) * return quad */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Quad)); if (unlikely(!__pyx_t_1)) __PYX_ERR(64, 495, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_quad = ((struct PyPetscQuadObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Space.pyx":496 * """ * cdef Quad quad = Quad() * CHKERR( PetscSpacePointGetPoints(self.space, &quad.quad)) # <<<<<<<<<<<<<< * return quad * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSpacePointGetPoints(__pyx_v_self->space, (&__pyx_v_quad->quad))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(64, 496, __pyx_L1_error) /* "petsc4py/PETSc/Space.pyx":497 * cdef Quad quad = Quad() * CHKERR( PetscSpacePointGetPoints(self.space, &quad.quad)) * return quad # <<<<<<<<<<<<<< * * def setPTrimmedFormDegree(self, formDegree: int) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_quad); __pyx_r = ((PyObject *)__pyx_v_quad); goto __pyx_L0; /* "petsc4py/PETSc/Space.pyx":485 * CHKERR( PetscSpacePointSetPoints(self.space, quad.quad)) * * def getPointPoints(self) -> Quad: # <<<<<<<<<<<<<< * """Return the evaluation points for the space as the points of a quad. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Space.getPointPoints", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_quad); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Space.pyx":499 * return quad * * def setPTrimmedFormDegree(self, formDegree: int) -> None: # <<<<<<<<<<<<<< * """Set the form degree of the trimmed polynomials. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5Space_59setPTrimmedFormDegree(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_5Space_58setPTrimmedFormDegree, "Space.setPTrimmedFormDegree(self, formDegree: int) -> None\nSet the form degree of the trimmed polynomials.\n\n Parameters\n ----------\n formDegree\n The form degree.\n\n See Also\n --------\n getPTrimmedFormDegree, petsc.PetscSpacePTrimmedSetFormDegree\n\n \nSource code at petsc4py/PETSc/Space.pyx:499"); static PyObject *__pyx_pw_8petsc4py_5PETSc_5Space_59setPTrimmedFormDegree(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_formDegree = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPTrimmedFormDegree (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_formDegree,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_formDegree)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(64, 499, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setPTrimmedFormDegree") < 0)) __PYX_ERR(64, 499, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_formDegree = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPTrimmedFormDegree", 1, 1, 1, __pyx_nargs); __PYX_ERR(64, 499, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Space.setPTrimmedFormDegree", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_5Space_58setPTrimmedFormDegree(((struct PyPetscSpaceObject *)__pyx_v_self), __pyx_v_formDegree); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_58setPTrimmedFormDegree(struct PyPetscSpaceObject *__pyx_v_self, PyObject *__pyx_v_formDegree) { PetscInt __pyx_v_cformDegree; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPTrimmedFormDegree", 1); /* "petsc4py/PETSc/Space.pyx":512 * * """ * cdef PetscInt cformDegree = asInt(formDegree) # <<<<<<<<<<<<<< * CHKERR( PetscSpacePTrimmedSetFormDegree(self.space, cformDegree) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_formDegree); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(64, 512, __pyx_L1_error) __pyx_v_cformDegree = __pyx_t_1; /* "petsc4py/PETSc/Space.pyx":513 * """ * cdef PetscInt cformDegree = asInt(formDegree) * CHKERR( PetscSpacePTrimmedSetFormDegree(self.space, cformDegree) ) # <<<<<<<<<<<<<< * * def getPTrimmedFormDegree(self) -> int: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSpacePTrimmedSetFormDegree(__pyx_v_self->space, __pyx_v_cformDegree)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(64, 513, __pyx_L1_error) /* "petsc4py/PETSc/Space.pyx":499 * return quad * * def setPTrimmedFormDegree(self, formDegree: int) -> None: # <<<<<<<<<<<<<< * """Set the form degree of the trimmed polynomials. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Space.setPTrimmedFormDegree", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Space.pyx":515 * CHKERR( PetscSpacePTrimmedSetFormDegree(self.space, cformDegree) ) * * def getPTrimmedFormDegree(self) -> int: # <<<<<<<<<<<<<< * """Return the form degree of the trimmed polynomials. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5Space_61getPTrimmedFormDegree(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_5Space_60getPTrimmedFormDegree, "Space.getPTrimmedFormDegree(self) -> int\nReturn the form degree of the trimmed polynomials.\n\n See Also\n --------\n setPTrimmedFormDegree, petsc.PetscSpacePTrimmedGetFormDegree\n\n \nSource code at petsc4py/PETSc/Space.pyx:515"); static PyObject *__pyx_pw_8petsc4py_5PETSc_5Space_61getPTrimmedFormDegree(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getPTrimmedFormDegree (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getPTrimmedFormDegree", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getPTrimmedFormDegree", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_5Space_60getPTrimmedFormDegree(((struct PyPetscSpaceObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_60getPTrimmedFormDegree(struct PyPetscSpaceObject *__pyx_v_self) { PetscInt __pyx_v_cformDegree; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getPTrimmedFormDegree", 1); /* "petsc4py/PETSc/Space.pyx":523 * * """ * cdef PetscInt cformDegree = 0 # <<<<<<<<<<<<<< * CHKERR( PetscSpacePTrimmedGetFormDegree(self.space, &cformDegree) ) * return toInt(cformDegree) */ __pyx_v_cformDegree = 0; /* "petsc4py/PETSc/Space.pyx":524 * """ * cdef PetscInt cformDegree = 0 * CHKERR( PetscSpacePTrimmedGetFormDegree(self.space, &cformDegree) ) # <<<<<<<<<<<<<< * return toInt(cformDegree) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSpacePTrimmedGetFormDegree(__pyx_v_self->space, (&__pyx_v_cformDegree))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(64, 524, __pyx_L1_error) /* "petsc4py/PETSc/Space.pyx":525 * cdef PetscInt cformDegree = 0 * CHKERR( PetscSpacePTrimmedGetFormDegree(self.space, &cformDegree) ) * return toInt(cformDegree) # <<<<<<<<<<<<<< * * def viewFromOptions(self, name: str, Object obj=None) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_cformDegree); if (unlikely(!__pyx_t_2)) __PYX_ERR(64, 525, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Space.pyx":515 * CHKERR( PetscSpacePTrimmedSetFormDegree(self.space, cformDegree) ) * * def getPTrimmedFormDegree(self) -> int: # <<<<<<<<<<<<<< * """Return the form degree of the trimmed polynomials. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Space.getPTrimmedFormDegree", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Space.pyx":527 * return toInt(cformDegree) * * def viewFromOptions(self, name: str, Object obj=None) -> None: # <<<<<<<<<<<<<< * """View a `Space` based on values in the options database. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5Space_63viewFromOptions(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_5Space_62viewFromOptions, "Space.viewFromOptions(self, name: str, obj: Object | None = None) -> None\nView a `Space` based on values in the options database.\n\n Collective.\n\n Parameters\n ----------\n name\n Command line option name.\n obj\n Optional object that provides the options prefix.\n\n See Also\n --------\n petsc_options, petsc.PetscSpaceViewFromOptions\n\n \nSource code at petsc4py/PETSc/Space.pyx:527"); static PyObject *__pyx_pw_8petsc4py_5PETSc_5Space_63viewFromOptions(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_name = 0; struct PyPetscObjectObject *__pyx_v_obj = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("viewFromOptions (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_obj,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscObjectObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(64, 527, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_obj); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(64, 527, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "viewFromOptions") < 0)) __PYX_ERR(64, 527, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_name = values[0]; __pyx_v_obj = ((struct PyPetscObjectObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("viewFromOptions", 0, 1, 2, __pyx_nargs); __PYX_ERR(64, 527, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.Space.viewFromOptions", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_obj), __pyx_ptype_8petsc4py_5PETSc_Object, 1, "obj", 0))) __PYX_ERR(64, 527, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_5Space_62viewFromOptions(((struct PyPetscSpaceObject *)__pyx_v_self), __pyx_v_name, __pyx_v_obj); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_62viewFromOptions(struct PyPetscSpaceObject *__pyx_v_self, PyObject *__pyx_v_name, struct PyPetscObjectObject *__pyx_v_obj) { char const *__pyx_v_cname; CYTHON_UNUSED PyObject *__pyx_v__ = NULL; PetscObject __pyx_v_cobj; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("viewFromOptions", 1); /* "petsc4py/PETSc/Space.pyx":544 * * """ * cdef const char *cname = NULL # <<<<<<<<<<<<<< * _ = str2bytes(name, &cname) * cdef PetscObject cobj = NULL */ __pyx_v_cname = NULL; /* "petsc4py/PETSc/Space.pyx":545 * """ * cdef const char *cname = NULL * _ = str2bytes(name, &cname) # <<<<<<<<<<<<<< * cdef PetscObject cobj = NULL * if obj is not None: cobj = obj.obj[0] */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cname)); if (unlikely(!__pyx_t_1)) __PYX_ERR(64, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v__ = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/Space.pyx":546 * cdef const char *cname = NULL * _ = str2bytes(name, &cname) * cdef PetscObject cobj = NULL # <<<<<<<<<<<<<< * if obj is not None: cobj = obj.obj[0] * CHKERR( PetscSpaceViewFromOptions(self.space, cobj, cname) ) */ __pyx_v_cobj = NULL; /* "petsc4py/PETSc/Space.pyx":547 * _ = str2bytes(name, &cname) * cdef PetscObject cobj = NULL * if obj is not None: cobj = obj.obj[0] # <<<<<<<<<<<<<< * CHKERR( PetscSpaceViewFromOptions(self.space, cobj, cname) ) * */ __pyx_t_2 = (((PyObject *)__pyx_v_obj) != Py_None); if (__pyx_t_2) { __pyx_v_cobj = (__pyx_v_obj->obj[0]); } /* "petsc4py/PETSc/Space.pyx":548 * cdef PetscObject cobj = NULL * if obj is not None: cobj = obj.obj[0] * CHKERR( PetscSpaceViewFromOptions(self.space, cobj, cname) ) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSpaceViewFromOptions(__pyx_v_self->space, __pyx_v_cobj, __pyx_v_cname)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(64, 548, __pyx_L1_error) /* "petsc4py/PETSc/Space.pyx":527 * return toInt(cformDegree) * * def viewFromOptions(self, name: str, Object obj=None) -> None: # <<<<<<<<<<<<<< * """View a `Space` based on values in the options database. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Space.viewFromOptions", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v__); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Space.pyx":565 * Type = DualSpaceType * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.dualspace * self.dualspace = NULL */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_9DualSpace_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_9DualSpace_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_8petsc4py_5PETSc_9DualSpace___cinit__(((struct PyPetscDualSpaceObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_9DualSpace___cinit__(struct PyPetscDualSpaceObject *__pyx_v_self) { int __pyx_r; /* "petsc4py/PETSc/Space.pyx":566 * * def __cinit__(self): * self.obj = &self.dualspace # <<<<<<<<<<<<<< * self.dualspace = NULL * */ __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->dualspace)); /* "petsc4py/PETSc/Space.pyx":567 * def __cinit__(self): * self.obj = &self.dualspace * self.dualspace = NULL # <<<<<<<<<<<<<< * * def setUp(self) -> None: */ __pyx_v_self->dualspace = NULL; /* "petsc4py/PETSc/Space.pyx":565 * Type = DualSpaceType * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.dualspace * self.dualspace = NULL */ /* function exit code */ __pyx_r = 0; return __pyx_r; } /* "petsc4py/PETSc/Space.pyx":569 * self.dualspace = NULL * * def setUp(self) -> None: # <<<<<<<<<<<<<< * """Construct a basis for a `DualSpace`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_9DualSpace_3setUp(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_9DualSpace_2setUp, "DualSpace.setUp(self) -> None\nConstruct a basis for a `DualSpace`.\n\n Collective.\n\n See Also\n --------\n petsc.PetscDualSpaceSetUp\n\n \nSource code at petsc4py/PETSc/Space.pyx:569"); static PyObject *__pyx_pw_8petsc4py_5PETSc_9DualSpace_3setUp(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setUp (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("setUp", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setUp", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_9DualSpace_2setUp(((struct PyPetscDualSpaceObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_2setUp(struct PyPetscDualSpaceObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setUp", 1); /* "petsc4py/PETSc/Space.pyx":579 * * """ * CHKERR( PetscDualSpaceSetUp(self.dualspace) ) # <<<<<<<<<<<<<< * * def create(self, comm: Comm | None = None) -> Self: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDualSpaceSetUp(__pyx_v_self->dualspace)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(64, 579, __pyx_L1_error) /* "petsc4py/PETSc/Space.pyx":569 * self.dualspace = NULL * * def setUp(self) -> None: # <<<<<<<<<<<<<< * """Construct a basis for a `DualSpace`. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DualSpace.setUp", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Space.pyx":581 * CHKERR( PetscDualSpaceSetUp(self.dualspace) ) * * def create(self, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Create an empty `DualSpace` object. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_9DualSpace_5create(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_9DualSpace_4create, "DualSpace.create(self, comm: Comm | None = None) -> Self\nCreate an empty `DualSpace` object.\n\n Collective.\n\n The type can then be set with `setType`.\n\n Parameters\n ----------\n comm\n MPI communicator, defaults to `Sys.getDefaultComm`.\n\n See Also\n --------\n petsc.PetscDualSpaceCreate\n\n \nSource code at petsc4py/PETSc/Space.pyx:581"); static PyObject *__pyx_pw_8petsc4py_5PETSc_9DualSpace_5create(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(64, 581, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "create") < 0)) __PYX_ERR(64, 581, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_comm = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, __pyx_nargs); __PYX_ERR(64, 581, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DualSpace.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_9DualSpace_4create(((struct PyPetscDualSpaceObject *)__pyx_v_self), __pyx_v_comm); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_4create(struct PyPetscDualSpaceObject *__pyx_v_self, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PetscDualSpace __pyx_v_newdsp; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create", 1); /* "petsc4py/PETSc/Space.pyx":598 * * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscDualSpace newdsp = NULL * CHKERR( PetscDualSpaceCreate(ccomm, &newdsp) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(64, 598, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/Space.pyx":599 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscDualSpace newdsp = NULL # <<<<<<<<<<<<<< * CHKERR( PetscDualSpaceCreate(ccomm, &newdsp) ) * CHKERR( PetscCLEAR(self.obj) ); self.dualspace = newdsp */ __pyx_v_newdsp = NULL; /* "petsc4py/PETSc/Space.pyx":600 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscDualSpace newdsp = NULL * CHKERR( PetscDualSpaceCreate(ccomm, &newdsp) ) # <<<<<<<<<<<<<< * CHKERR( PetscCLEAR(self.obj) ); self.dualspace = newdsp * return self */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDualSpaceCreate(__pyx_v_ccomm, (&__pyx_v_newdsp))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(64, 600, __pyx_L1_error) /* "petsc4py/PETSc/Space.pyx":601 * cdef PetscDualSpace newdsp = NULL * CHKERR( PetscDualSpaceCreate(ccomm, &newdsp) ) * CHKERR( PetscCLEAR(self.obj) ); self.dualspace = newdsp # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(64, 601, __pyx_L1_error) __pyx_v_self->dualspace = __pyx_v_newdsp; /* "petsc4py/PETSc/Space.pyx":602 * CHKERR( PetscDualSpaceCreate(ccomm, &newdsp) ) * CHKERR( PetscCLEAR(self.obj) ); self.dualspace = newdsp * return self # <<<<<<<<<<<<<< * * def view(self, Viewer viewer=None) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Space.pyx":581 * CHKERR( PetscDualSpaceSetUp(self.dualspace) ) * * def create(self, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Create an empty `DualSpace` object. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DualSpace.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Space.pyx":604 * return self * * def view(self, Viewer viewer=None) -> None: # <<<<<<<<<<<<<< * """View a `DualSpace`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_9DualSpace_7view(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_9DualSpace_6view, "DualSpace.view(self, viewer: Viewer | None = None) -> None\nView a `DualSpace`.\n\n Collective.\n\n Parameters\n ----------\n viewer\n A `Viewer` to display the `DualSpace`.\n\n See Also\n --------\n petsc.PetscDualSpaceView\n\n \nSource code at petsc4py/PETSc/Space.pyx:604"); static PyObject *__pyx_pw_8petsc4py_5PETSc_9DualSpace_7view(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscViewerObject *__pyx_v_viewer = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("view (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscViewerObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_viewer); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(64, 604, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "view") < 0)) __PYX_ERR(64, 604, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, __pyx_nargs); __PYX_ERR(64, 604, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DualSpace.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(64, 604, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_9DualSpace_6view(((struct PyPetscDualSpaceObject *)__pyx_v_self), __pyx_v_viewer); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_6view(struct PyPetscDualSpaceObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer) { PetscViewer __pyx_v_vwr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscViewer __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("view", 1); /* "petsc4py/PETSc/Space.pyx":619 * * """ * cdef PetscViewer vwr = NULL # <<<<<<<<<<<<<< * if viewer is not None: vwr = viewer.vwr * CHKERR( PetscDualSpaceView(self.dualspace, vwr) ) */ __pyx_v_vwr = NULL; /* "petsc4py/PETSc/Space.pyx":620 * """ * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr # <<<<<<<<<<<<<< * CHKERR( PetscDualSpaceView(self.dualspace, vwr) ) * */ __pyx_t_1 = (((PyObject *)__pyx_v_viewer) != Py_None); if (__pyx_t_1) { __pyx_t_2 = __pyx_v_viewer->vwr; __pyx_v_vwr = __pyx_t_2; } /* "petsc4py/PETSc/Space.pyx":621 * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr * CHKERR( PetscDualSpaceView(self.dualspace, vwr) ) # <<<<<<<<<<<<<< * * def destroy(self) -> Self: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDualSpaceView(__pyx_v_self->dualspace, __pyx_v_vwr)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(64, 621, __pyx_L1_error) /* "petsc4py/PETSc/Space.pyx":604 * return self * * def view(self, Viewer viewer=None) -> None: # <<<<<<<<<<<<<< * """View a `DualSpace`. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DualSpace.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Space.pyx":623 * CHKERR( PetscDualSpaceView(self.dualspace, vwr) ) * * def destroy(self) -> Self: # <<<<<<<<<<<<<< * """Destroy the `DualSpace` object. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_9DualSpace_9destroy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_9DualSpace_8destroy, "DualSpace.destroy(self) -> Self\nDestroy the `DualSpace` object.\n\n Collective.\n\n See Also\n --------\n petsc.PetscDualSpaceDestroy\n\n \nSource code at petsc4py/PETSc/Space.pyx:623"); static PyObject *__pyx_pw_8petsc4py_5PETSc_9DualSpace_9destroy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("destroy (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_9DualSpace_8destroy(((struct PyPetscDualSpaceObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_8destroy(struct PyPetscDualSpaceObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("destroy", 1); /* "petsc4py/PETSc/Space.pyx":633 * * """ * CHKERR( PetscDualSpaceDestroy(&self.dualspace) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDualSpaceDestroy((&__pyx_v_self->dualspace))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(64, 633, __pyx_L1_error) /* "petsc4py/PETSc/Space.pyx":634 * """ * CHKERR( PetscDualSpaceDestroy(&self.dualspace) ) * return self # <<<<<<<<<<<<<< * * def duplicate(self) -> DualSpace: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Space.pyx":623 * CHKERR( PetscDualSpaceView(self.dualspace, vwr) ) * * def destroy(self) -> Self: # <<<<<<<<<<<<<< * """Destroy the `DualSpace` object. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DualSpace.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Space.pyx":636 * return self * * def duplicate(self) -> DualSpace: # <<<<<<<<<<<<<< * """Create a duplicate `DualSpace` object that is not set up. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_9DualSpace_11duplicate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_9DualSpace_10duplicate, "DualSpace.duplicate(self) -> DualSpace\nCreate a duplicate `DualSpace` object that is not set up.\n\n Collective.\n\n See Also\n --------\n petsc.PetscDualSpaceDuplicate\n\n \nSource code at petsc4py/PETSc/Space.pyx:636"); static PyObject *__pyx_pw_8petsc4py_5PETSc_9DualSpace_11duplicate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("duplicate (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("duplicate", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "duplicate", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_9DualSpace_10duplicate(((struct PyPetscDualSpaceObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_10duplicate(struct PyPetscDualSpaceObject *__pyx_v_self) { struct PyPetscDualSpaceObject *__pyx_v_spNew = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("duplicate", 1); /* "petsc4py/PETSc/Space.pyx":646 * * """ * cdef DualSpace spNew = DualSpace() # <<<<<<<<<<<<<< * CHKERR( PetscDualSpaceDuplicate(self.dualspace, &spNew.dualspace) ) * */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DualSpace)); if (unlikely(!__pyx_t_1)) __PYX_ERR(64, 646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_spNew = ((struct PyPetscDualSpaceObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Space.pyx":647 * """ * cdef DualSpace spNew = DualSpace() * CHKERR( PetscDualSpaceDuplicate(self.dualspace, &spNew.dualspace) ) # <<<<<<<<<<<<<< * * def getDM(self) -> DM: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDualSpaceDuplicate(__pyx_v_self->dualspace, (&__pyx_v_spNew->dualspace))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(64, 647, __pyx_L1_error) /* "petsc4py/PETSc/Space.pyx":636 * return self * * def duplicate(self) -> DualSpace: # <<<<<<<<<<<<<< * """Create a duplicate `DualSpace` object that is not set up. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DualSpace.duplicate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_spNew); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Space.pyx":649 * CHKERR( PetscDualSpaceDuplicate(self.dualspace, &spNew.dualspace) ) * * def getDM(self) -> DM: # <<<<<<<<<<<<<< * """Return the `DM` representing the reference cell of a `DualSpace`. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_9DualSpace_13getDM(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_9DualSpace_12getDM, "DualSpace.getDM(self) -> DM\nReturn the `DM` representing the reference cell of a `DualSpace`.\n\n Not collective.\n\n See Also\n --------\n setDM, petsc.PetscDualSpaceGetDM\n\n \nSource code at petsc4py/PETSc/Space.pyx:649"); static PyObject *__pyx_pw_8petsc4py_5PETSc_9DualSpace_13getDM(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getDM (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getDM", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getDM", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_9DualSpace_12getDM(((struct PyPetscDualSpaceObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_12getDM(struct PyPetscDualSpaceObject *__pyx_v_self) { struct PyPetscDMObject *__pyx_v_dm = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getDM", 1); /* "petsc4py/PETSc/Space.pyx":659 * * """ * cdef DM dm = DM() # <<<<<<<<<<<<<< * CHKERR( PetscDualSpaceGetDM(self.dualspace, &dm.dm) ) * return dm */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM)); if (unlikely(!__pyx_t_1)) __PYX_ERR(64, 659, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_dm = ((struct PyPetscDMObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/Space.pyx":660 * """ * cdef DM dm = DM() * CHKERR( PetscDualSpaceGetDM(self.dualspace, &dm.dm) ) # <<<<<<<<<<<<<< * return dm * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDualSpaceGetDM(__pyx_v_self->dualspace, (&__pyx_v_dm->dm))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(64, 660, __pyx_L1_error) /* "petsc4py/PETSc/Space.pyx":661 * cdef DM dm = DM() * CHKERR( PetscDualSpaceGetDM(self.dualspace, &dm.dm) ) * return dm # <<<<<<<<<<<<<< * * def setDM(self, DM dm) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_dm); __pyx_r = ((PyObject *)__pyx_v_dm); goto __pyx_L0; /* "petsc4py/PETSc/Space.pyx":649 * CHKERR( PetscDualSpaceDuplicate(self.dualspace, &spNew.dualspace) ) * * def getDM(self) -> DM: # <<<<<<<<<<<<<< * """Return the `DM` representing the reference cell of a `DualSpace`. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DualSpace.getDM", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_dm); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Space.pyx":663 * return dm * * def setDM(self, DM dm) -> None: # <<<<<<<<<<<<<< * """Set the `DM` representing the reference cell. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_9DualSpace_15setDM(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_9DualSpace_14setDM, "DualSpace.setDM(self, dm: DM) -> None\nSet the `DM` representing the reference cell.\n\n Not collective.\n\n Parameters\n ----------\n dm\n The reference cell.\n\n See Also\n --------\n getDM, petsc.PetscDualSpaceSetDM\n\n \nSource code at petsc4py/PETSc/Space.pyx:663"); static PyObject *__pyx_pw_8petsc4py_5PETSc_9DualSpace_15setDM(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscDMObject *__pyx_v_dm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setDM (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dm,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dm)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(64, 663, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setDM") < 0)) __PYX_ERR(64, 663, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_dm = ((struct PyPetscDMObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setDM", 1, 1, 1, __pyx_nargs); __PYX_ERR(64, 663, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DualSpace.setDM", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_ptype_8petsc4py_5PETSc_DM, 0, "dm", 0))) __PYX_ERR(64, 663, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_9DualSpace_14setDM(((struct PyPetscDualSpaceObject *)__pyx_v_self), __pyx_v_dm); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_14setDM(struct PyPetscDualSpaceObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setDM", 1); /* "petsc4py/PETSc/Space.pyx":678 * * """ * CHKERR( PetscDualSpaceSetDM(self.dualspace, dm.dm) ) # <<<<<<<<<<<<<< * * def getDimension(self) -> int: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDualSpaceSetDM(__pyx_v_self->dualspace, __pyx_v_dm->dm)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(64, 678, __pyx_L1_error) /* "petsc4py/PETSc/Space.pyx":663 * return dm * * def setDM(self, DM dm) -> None: # <<<<<<<<<<<<<< * """Set the `DM` representing the reference cell. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DualSpace.setDM", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Space.pyx":680 * CHKERR( PetscDualSpaceSetDM(self.dualspace, dm.dm) ) * * def getDimension(self) -> int: # <<<<<<<<<<<<<< * """Return the dimension of the dual space. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_9DualSpace_17getDimension(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_9DualSpace_16getDimension, "DualSpace.getDimension(self) -> int\nReturn the dimension of the dual space.\n\n Not collective.\n\n The dimension of the dual space, i.e. the number of basis functionals.\n\n See Also\n --------\n petsc.PetscDualSpaceGetDimension\n\n \nSource code at petsc4py/PETSc/Space.pyx:680"); static PyObject *__pyx_pw_8petsc4py_5PETSc_9DualSpace_17getDimension(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getDimension (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getDimension", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getDimension", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_9DualSpace_16getDimension(((struct PyPetscDualSpaceObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_16getDimension(struct PyPetscDualSpaceObject *__pyx_v_self) { PetscInt __pyx_v_cdim; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getDimension", 1); /* "petsc4py/PETSc/Space.pyx":693 * """ * cdef PetscInt cdim * CHKERR( PetscDualSpaceGetDimension(self.dualspace, &cdim)) # <<<<<<<<<<<<<< * return toInt(cdim) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDualSpaceGetDimension(__pyx_v_self->dualspace, (&__pyx_v_cdim))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(64, 693, __pyx_L1_error) /* "petsc4py/PETSc/Space.pyx":694 * cdef PetscInt cdim * CHKERR( PetscDualSpaceGetDimension(self.dualspace, &cdim)) * return toInt(cdim) # <<<<<<<<<<<<<< * * def getNumComponents(self) -> int: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_cdim); if (unlikely(!__pyx_t_2)) __PYX_ERR(64, 694, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Space.pyx":680 * CHKERR( PetscDualSpaceSetDM(self.dualspace, dm.dm) ) * * def getDimension(self) -> int: # <<<<<<<<<<<<<< * """Return the dimension of the dual space. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DualSpace.getDimension", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Space.pyx":696 * return toInt(cdim) * * def getNumComponents(self) -> int: # <<<<<<<<<<<<<< * """Return the number of components for this space. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_9DualSpace_19getNumComponents(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_9DualSpace_18getNumComponents, "DualSpace.getNumComponents(self) -> int\nReturn the number of components for this space.\n\n See Also\n --------\n setNumComponents, petsc.PetscDualSpaceGetNumComponents\n\n \nSource code at petsc4py/PETSc/Space.pyx:696"); static PyObject *__pyx_pw_8petsc4py_5PETSc_9DualSpace_19getNumComponents(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getNumComponents (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getNumComponents", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getNumComponents", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_9DualSpace_18getNumComponents(((struct PyPetscDualSpaceObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_18getNumComponents(struct PyPetscDualSpaceObject *__pyx_v_self) { PetscInt __pyx_v_cncomps; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getNumComponents", 1); /* "petsc4py/PETSc/Space.pyx":705 * """ * cdef PetscInt cncomps * CHKERR( PetscDualSpaceGetNumComponents(self.dualspace, &cncomps)) # <<<<<<<<<<<<<< * return toInt(cncomps) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDualSpaceGetNumComponents(__pyx_v_self->dualspace, (&__pyx_v_cncomps))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(64, 705, __pyx_L1_error) /* "petsc4py/PETSc/Space.pyx":706 * cdef PetscInt cncomps * CHKERR( PetscDualSpaceGetNumComponents(self.dualspace, &cncomps)) * return toInt(cncomps) # <<<<<<<<<<<<<< * * def setNumComponents(self, nc: int) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_cncomps); if (unlikely(!__pyx_t_2)) __PYX_ERR(64, 706, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Space.pyx":696 * return toInt(cdim) * * def getNumComponents(self) -> int: # <<<<<<<<<<<<<< * """Return the number of components for this space. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DualSpace.getNumComponents", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Space.pyx":708 * return toInt(cncomps) * * def setNumComponents(self, nc: int) -> None: # <<<<<<<<<<<<<< * """Set the number of components for this space. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_9DualSpace_21setNumComponents(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_9DualSpace_20setNumComponents, "DualSpace.setNumComponents(self, nc: int) -> None\nSet the number of components for this space.\n\n Parameters\n ----------\n nc\n The number of components\n\n See Also\n --------\n getNumComponents, petsc.PetscDualSpaceSetNumComponents\n\n \nSource code at petsc4py/PETSc/Space.pyx:708"); static PyObject *__pyx_pw_8petsc4py_5PETSc_9DualSpace_21setNumComponents(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_nc = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setNumComponents (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nc,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_nc)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(64, 708, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setNumComponents") < 0)) __PYX_ERR(64, 708, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_nc = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setNumComponents", 1, 1, 1, __pyx_nargs); __PYX_ERR(64, 708, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DualSpace.setNumComponents", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_9DualSpace_20setNumComponents(((struct PyPetscDualSpaceObject *)__pyx_v_self), __pyx_v_nc); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_20setNumComponents(struct PyPetscDualSpaceObject *__pyx_v_self, PyObject *__pyx_v_nc) { PetscInt __pyx_v_cnc; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setNumComponents", 1); /* "petsc4py/PETSc/Space.pyx":721 * * """ * cdef PetscInt cnc = asInt(nc) # <<<<<<<<<<<<<< * CHKERR( PetscDualSpaceSetNumComponents(self.dualspace, cnc) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_nc); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(64, 721, __pyx_L1_error) __pyx_v_cnc = __pyx_t_1; /* "petsc4py/PETSc/Space.pyx":722 * """ * cdef PetscInt cnc = asInt(nc) * CHKERR( PetscDualSpaceSetNumComponents(self.dualspace, cnc) ) # <<<<<<<<<<<<<< * * def getType(self) -> str: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDualSpaceSetNumComponents(__pyx_v_self->dualspace, __pyx_v_cnc)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(64, 722, __pyx_L1_error) /* "petsc4py/PETSc/Space.pyx":708 * return toInt(cncomps) * * def setNumComponents(self, nc: int) -> None: # <<<<<<<<<<<<<< * """Set the number of components for this space. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DualSpace.setNumComponents", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Space.pyx":724 * CHKERR( PetscDualSpaceSetNumComponents(self.dualspace, cnc) ) * * def getType(self) -> str: # <<<<<<<<<<<<<< * """Return the type of the dual space object. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_9DualSpace_23getType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_9DualSpace_22getType, "DualSpace.getType(self) -> str\nReturn the type of the dual space object.\n\n Not collective.\n\n See Also\n --------\n setType, petsc.PetscDualSpaceGetType\n\n \nSource code at petsc4py/PETSc/Space.pyx:724"); static PyObject *__pyx_pw_8petsc4py_5PETSc_9DualSpace_23getType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getType", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_9DualSpace_22getType(((struct PyPetscDualSpaceObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_22getType(struct PyPetscDualSpaceObject *__pyx_v_self) { PetscDualSpaceType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getType", 1); /* "petsc4py/PETSc/Space.pyx":734 * * """ * cdef PetscDualSpaceType cval = NULL # <<<<<<<<<<<<<< * CHKERR( PetscDualSpaceGetType(self.dualspace, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/Space.pyx":735 * """ * cdef PetscDualSpaceType cval = NULL * CHKERR( PetscDualSpaceGetType(self.dualspace, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDualSpaceGetType(__pyx_v_self->dualspace, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(64, 735, __pyx_L1_error) /* "petsc4py/PETSc/Space.pyx":736 * cdef PetscDualSpaceType cval = NULL * CHKERR( PetscDualSpaceGetType(self.dualspace, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * def setType(self, dualspace_type: Type | str) -> Self: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(64, 736, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Space.pyx":724 * CHKERR( PetscDualSpaceSetNumComponents(self.dualspace, cnc) ) * * def getType(self) -> str: # <<<<<<<<<<<<<< * """Return the type of the dual space object. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DualSpace.getType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Space.pyx":738 * return bytes2str(cval) * * def setType(self, dualspace_type: Type | str) -> Self: # <<<<<<<<<<<<<< * """Build a particular type of dual space. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_9DualSpace_25setType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_9DualSpace_24setType, "DualSpace.setType(self, dualspace_type: Type | str) -> Self\nBuild a particular type of dual space.\n\n Collective.\n\n Parameters\n ----------\n dualspace_type\n The kind of space.\n\n See Also\n --------\n getType, petsc.PetscDualSpaceSetType\n\n \nSource code at petsc4py/PETSc/Space.pyx:738"); static PyObject *__pyx_pw_8petsc4py_5PETSc_9DualSpace_25setType(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_dualspace_type = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setType (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dualspace_type,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dualspace_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(64, 738, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setType") < 0)) __PYX_ERR(64, 738, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_dualspace_type = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, __pyx_nargs); __PYX_ERR(64, 738, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DualSpace.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_9DualSpace_24setType(((struct PyPetscDualSpaceObject *)__pyx_v_self), __pyx_v_dualspace_type); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_24setType(struct PyPetscDualSpaceObject *__pyx_v_self, PyObject *__pyx_v_dualspace_type) { PetscDualSpaceType __pyx_v_cval; CYTHON_UNUSED PyObject *__pyx_v_space_type = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setType", 1); /* "petsc4py/PETSc/Space.pyx":753 * * """ * cdef PetscDualSpaceType cval = NULL # <<<<<<<<<<<<<< * space_type = str2bytes(dualspace_type, &cval) * CHKERR( PetscDualSpaceSetType(self.dualspace, cval) ) */ __pyx_v_cval = NULL; /* "petsc4py/PETSc/Space.pyx":754 * """ * cdef PetscDualSpaceType cval = NULL * space_type = str2bytes(dualspace_type, &cval) # <<<<<<<<<<<<<< * CHKERR( PetscDualSpaceSetType(self.dualspace, cval) ) * return self */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_dualspace_type, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(64, 754, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_space_type = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/Space.pyx":755 * cdef PetscDualSpaceType cval = NULL * space_type = str2bytes(dualspace_type, &cval) * CHKERR( PetscDualSpaceSetType(self.dualspace, cval) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDualSpaceSetType(__pyx_v_self->dualspace, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(64, 755, __pyx_L1_error) /* "petsc4py/PETSc/Space.pyx":756 * space_type = str2bytes(dualspace_type, &cval) * CHKERR( PetscDualSpaceSetType(self.dualspace, cval) ) * return self # <<<<<<<<<<<<<< * * def getOrder(self) -> int: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/Space.pyx":738 * return bytes2str(cval) * * def setType(self, dualspace_type: Type | str) -> Self: # <<<<<<<<<<<<<< * """Build a particular type of dual space. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DualSpace.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_space_type); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Space.pyx":758 * return self * * def getOrder(self) -> int: # <<<<<<<<<<<<<< * """Return the order of the dual space. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_9DualSpace_27getOrder(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_9DualSpace_26getOrder, "DualSpace.getOrder(self) -> int\nReturn the order of the dual space.\n\n Not collective.\n\n See Also\n --------\n setOrder, petsc.PetscDualSpaceGetOrder\n\n \nSource code at petsc4py/PETSc/Space.pyx:758"); static PyObject *__pyx_pw_8petsc4py_5PETSc_9DualSpace_27getOrder(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getOrder (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getOrder", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getOrder", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_9DualSpace_26getOrder(((struct PyPetscDualSpaceObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_26getOrder(struct PyPetscDualSpaceObject *__pyx_v_self) { PetscInt __pyx_v_corder; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getOrder", 1); /* "petsc4py/PETSc/Space.pyx":769 * """ * cdef PetscInt corder * CHKERR( PetscDualSpaceGetOrder(self.dualspace, &corder)) # <<<<<<<<<<<<<< * return toInt(corder) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDualSpaceGetOrder(__pyx_v_self->dualspace, (&__pyx_v_corder))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(64, 769, __pyx_L1_error) /* "petsc4py/PETSc/Space.pyx":770 * cdef PetscInt corder * CHKERR( PetscDualSpaceGetOrder(self.dualspace, &corder)) * return toInt(corder) # <<<<<<<<<<<<<< * * def setOrder(self, order: int) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_corder); if (unlikely(!__pyx_t_2)) __PYX_ERR(64, 770, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Space.pyx":758 * return self * * def getOrder(self) -> int: # <<<<<<<<<<<<<< * """Return the order of the dual space. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DualSpace.getOrder", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Space.pyx":772 * return toInt(corder) * * def setOrder(self, order: int) -> None: # <<<<<<<<<<<<<< * """Set the order of the dual space. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_9DualSpace_29setOrder(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_9DualSpace_28setOrder, "DualSpace.setOrder(self, order: int) -> None\nSet the order of the dual space.\n\n Not collective.\n\n Parameters\n ----------\n order\n The order.\n\n See Also\n --------\n getOrder, petsc.PetscDualSpaceSetOrder\n\n \nSource code at petsc4py/PETSc/Space.pyx:772"); static PyObject *__pyx_pw_8petsc4py_5PETSc_9DualSpace_29setOrder(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_order = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setOrder (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_order,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_order)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(64, 772, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setOrder") < 0)) __PYX_ERR(64, 772, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_order = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setOrder", 1, 1, 1, __pyx_nargs); __PYX_ERR(64, 772, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DualSpace.setOrder", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_9DualSpace_28setOrder(((struct PyPetscDualSpaceObject *)__pyx_v_self), __pyx_v_order); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_28setOrder(struct PyPetscDualSpaceObject *__pyx_v_self, PyObject *__pyx_v_order) { PetscInt __pyx_v_corder; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setOrder", 1); /* "petsc4py/PETSc/Space.pyx":787 * * """ * cdef PetscInt corder = asInt(order) # <<<<<<<<<<<<<< * CHKERR( PetscDualSpaceSetOrder(self.dualspace, corder) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_order); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(64, 787, __pyx_L1_error) __pyx_v_corder = __pyx_t_1; /* "petsc4py/PETSc/Space.pyx":788 * """ * cdef PetscInt corder = asInt(order) * CHKERR( PetscDualSpaceSetOrder(self.dualspace, corder) ) # <<<<<<<<<<<<<< * * def getNumDof(self) -> ArrayInt: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDualSpaceSetOrder(__pyx_v_self->dualspace, __pyx_v_corder)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(64, 788, __pyx_L1_error) /* "petsc4py/PETSc/Space.pyx":772 * return toInt(corder) * * def setOrder(self, order: int) -> None: # <<<<<<<<<<<<<< * """Set the order of the dual space. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DualSpace.setOrder", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Space.pyx":790 * CHKERR( PetscDualSpaceSetOrder(self.dualspace, corder) ) * * def getNumDof(self) -> ArrayInt: # <<<<<<<<<<<<<< * """Return the number of degrees of freedom for each spatial dimension. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_9DualSpace_31getNumDof(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_9DualSpace_30getNumDof, "DualSpace.getNumDof(self) -> ArrayInt\nReturn the number of degrees of freedom for each spatial dimension.\n\n Not collective.\n\n See Also\n --------\n petsc.PetscDualSpaceGetNumDof\n\n \nSource code at petsc4py/PETSc/Space.pyx:790"); static PyObject *__pyx_pw_8petsc4py_5PETSc_9DualSpace_31getNumDof(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getNumDof (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getNumDof", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getNumDof", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_9DualSpace_30getNumDof(((struct PyPetscDualSpaceObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_30getNumDof(struct PyPetscDualSpaceObject *__pyx_v_self) { PetscInt const *__pyx_v_cndof; PetscInt __pyx_v_cdim; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getNumDof", 1); /* "petsc4py/PETSc/Space.pyx":800 * * """ * cdef const PetscInt *cndof = NULL # <<<<<<<<<<<<<< * cdef PetscInt cdim = 0 * CHKERR( PetscDualSpaceGetDimension(self.dualspace, &cdim) ) */ __pyx_v_cndof = NULL; /* "petsc4py/PETSc/Space.pyx":801 * """ * cdef const PetscInt *cndof = NULL * cdef PetscInt cdim = 0 # <<<<<<<<<<<<<< * CHKERR( PetscDualSpaceGetDimension(self.dualspace, &cdim) ) * CHKERR( PetscDualSpaceGetNumDof(self.dualspace, &cndof) ) */ __pyx_v_cdim = 0; /* "petsc4py/PETSc/Space.pyx":802 * cdef const PetscInt *cndof = NULL * cdef PetscInt cdim = 0 * CHKERR( PetscDualSpaceGetDimension(self.dualspace, &cdim) ) # <<<<<<<<<<<<<< * CHKERR( PetscDualSpaceGetNumDof(self.dualspace, &cndof) ) * return array_i(cdim + 1, cndof) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDualSpaceGetDimension(__pyx_v_self->dualspace, (&__pyx_v_cdim))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(64, 802, __pyx_L1_error) /* "petsc4py/PETSc/Space.pyx":803 * cdef PetscInt cdim = 0 * CHKERR( PetscDualSpaceGetDimension(self.dualspace, &cdim) ) * CHKERR( PetscDualSpaceGetNumDof(self.dualspace, &cndof) ) # <<<<<<<<<<<<<< * return array_i(cdim + 1, cndof) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDualSpaceGetNumDof(__pyx_v_self->dualspace, (&__pyx_v_cndof))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(64, 803, __pyx_L1_error) /* "petsc4py/PETSc/Space.pyx":804 * CHKERR( PetscDualSpaceGetDimension(self.dualspace, &cdim) ) * CHKERR( PetscDualSpaceGetNumDof(self.dualspace, &cndof) ) * return array_i(cdim + 1, cndof) # <<<<<<<<<<<<<< * * def getFunctional(self, i: int) -> Quad: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i((__pyx_v_cdim + 1), __pyx_v_cndof)); if (unlikely(!__pyx_t_2)) __PYX_ERR(64, 804, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Space.pyx":790 * CHKERR( PetscDualSpaceSetOrder(self.dualspace, corder) ) * * def getNumDof(self) -> ArrayInt: # <<<<<<<<<<<<<< * """Return the number of degrees of freedom for each spatial dimension. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DualSpace.getNumDof", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Space.pyx":806 * return array_i(cdim + 1, cndof) * * def getFunctional(self, i: int) -> Quad: # <<<<<<<<<<<<<< * """Return the i-th basis functional in the dual space. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_9DualSpace_33getFunctional(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_9DualSpace_32getFunctional, "DualSpace.getFunctional(self, i: int) -> Quad\nReturn the i-th basis functional in the dual space.\n\n Not collective.\n\n Parameters\n ----------\n i\n The basis number.\n\n See Also\n --------\n petsc.PetscDualSpaceGetFunctional\n\n \nSource code at petsc4py/PETSc/Space.pyx:806"); static PyObject *__pyx_pw_8petsc4py_5PETSc_9DualSpace_33getFunctional(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_i = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getFunctional (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_i,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_i)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(64, 806, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getFunctional") < 0)) __PYX_ERR(64, 806, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_i = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getFunctional", 1, 1, 1, __pyx_nargs); __PYX_ERR(64, 806, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DualSpace.getFunctional", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_9DualSpace_32getFunctional(((struct PyPetscDualSpaceObject *)__pyx_v_self), __pyx_v_i); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_32getFunctional(struct PyPetscDualSpaceObject *__pyx_v_self, PyObject *__pyx_v_i) { PetscInt __pyx_v_ci; struct PyPetscQuadObject *__pyx_v_functional = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getFunctional", 1); /* "petsc4py/PETSc/Space.pyx":821 * * """ * cdef PetscInt ci = asInt(i) # <<<<<<<<<<<<<< * cdef Quad functional = Quad() * CHKERR( PetscDualSpaceGetFunctional( self.dualspace, ci, &functional.quad) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_i); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(64, 821, __pyx_L1_error) __pyx_v_ci = __pyx_t_1; /* "petsc4py/PETSc/Space.pyx":822 * """ * cdef PetscInt ci = asInt(i) * cdef Quad functional = Quad() # <<<<<<<<<<<<<< * CHKERR( PetscDualSpaceGetFunctional( self.dualspace, ci, &functional.quad) ) * return functional */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Quad)); if (unlikely(!__pyx_t_2)) __PYX_ERR(64, 822, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_functional = ((struct PyPetscQuadObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/Space.pyx":823 * cdef PetscInt ci = asInt(i) * cdef Quad functional = Quad() * CHKERR( PetscDualSpaceGetFunctional( self.dualspace, ci, &functional.quad) ) # <<<<<<<<<<<<<< * return functional * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDualSpaceGetFunctional(__pyx_v_self->dualspace, __pyx_v_ci, (&__pyx_v_functional->quad))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(64, 823, __pyx_L1_error) /* "petsc4py/PETSc/Space.pyx":824 * cdef Quad functional = Quad() * CHKERR( PetscDualSpaceGetFunctional( self.dualspace, ci, &functional.quad) ) * return functional # <<<<<<<<<<<<<< * * def getInteriorDimension(self) -> int: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_functional); __pyx_r = ((PyObject *)__pyx_v_functional); goto __pyx_L0; /* "petsc4py/PETSc/Space.pyx":806 * return array_i(cdim + 1, cndof) * * def getFunctional(self, i: int) -> Quad: # <<<<<<<<<<<<<< * """Return the i-th basis functional in the dual space. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DualSpace.getFunctional", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_functional); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Space.pyx":826 * return functional * * def getInteriorDimension(self) -> int: # <<<<<<<<<<<<<< * """Return the interior dimension of the dual space. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_9DualSpace_35getInteriorDimension(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_9DualSpace_34getInteriorDimension, "DualSpace.getInteriorDimension(self) -> int\nReturn the interior dimension of the dual space.\n\n Not collective.\n\n The interior dimension of the dual space, i.e. the number of basis\n functionals assigned to the interior of the reference domain.\n\n See Also\n --------\n petsc.PetscDualSpaceGetInteriorDimension\n\n \nSource code at petsc4py/PETSc/Space.pyx:826"); static PyObject *__pyx_pw_8petsc4py_5PETSc_9DualSpace_35getInteriorDimension(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getInteriorDimension (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getInteriorDimension", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getInteriorDimension", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_9DualSpace_34getInteriorDimension(((struct PyPetscDualSpaceObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_34getInteriorDimension(struct PyPetscDualSpaceObject *__pyx_v_self) { PetscInt __pyx_v_cintdim; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getInteriorDimension", 1); /* "petsc4py/PETSc/Space.pyx":839 * * """ * cdef PetscInt cintdim = 0 # <<<<<<<<<<<<<< * CHKERR( PetscDualSpaceGetInteriorDimension(self.dualspace, &cintdim) ) * return toInt(cintdim) */ __pyx_v_cintdim = 0; /* "petsc4py/PETSc/Space.pyx":840 * """ * cdef PetscInt cintdim = 0 * CHKERR( PetscDualSpaceGetInteriorDimension(self.dualspace, &cintdim) ) # <<<<<<<<<<<<<< * return toInt(cintdim) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDualSpaceGetInteriorDimension(__pyx_v_self->dualspace, (&__pyx_v_cintdim))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(64, 840, __pyx_L1_error) /* "petsc4py/PETSc/Space.pyx":841 * cdef PetscInt cintdim = 0 * CHKERR( PetscDualSpaceGetInteriorDimension(self.dualspace, &cintdim) ) * return toInt(cintdim) # <<<<<<<<<<<<<< * * def getLagrangeContinuity(self) -> bool: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_cintdim); if (unlikely(!__pyx_t_2)) __PYX_ERR(64, 841, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Space.pyx":826 * return functional * * def getInteriorDimension(self) -> int: # <<<<<<<<<<<<<< * """Return the interior dimension of the dual space. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DualSpace.getInteriorDimension", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Space.pyx":843 * return toInt(cintdim) * * def getLagrangeContinuity(self) -> bool: # <<<<<<<<<<<<<< * """Return whether the element is continuous. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_9DualSpace_37getLagrangeContinuity(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_9DualSpace_36getLagrangeContinuity, "DualSpace.getLagrangeContinuity(self) -> bool\nReturn whether the element is continuous.\n\n Not collective.\n\n See Also\n --------\n setLagrangeContinuity, petsc.PetscDualSpaceLagrangeGetContinuity\n\n \nSource code at petsc4py/PETSc/Space.pyx:843"); static PyObject *__pyx_pw_8petsc4py_5PETSc_9DualSpace_37getLagrangeContinuity(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getLagrangeContinuity (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getLagrangeContinuity", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getLagrangeContinuity", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_9DualSpace_36getLagrangeContinuity(((struct PyPetscDualSpaceObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_36getLagrangeContinuity(struct PyPetscDualSpaceObject *__pyx_v_self) { PetscBool __pyx_v_ccontinuous; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getLagrangeContinuity", 1); /* "petsc4py/PETSc/Space.pyx":853 * * """ * cdef PetscBool ccontinuous = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( PetscDualSpaceLagrangeGetContinuity(self.dualspace, &ccontinuous)) * return toBool(ccontinuous) */ __pyx_v_ccontinuous = PETSC_FALSE; /* "petsc4py/PETSc/Space.pyx":854 * """ * cdef PetscBool ccontinuous = PETSC_FALSE * CHKERR( PetscDualSpaceLagrangeGetContinuity(self.dualspace, &ccontinuous)) # <<<<<<<<<<<<<< * return toBool(ccontinuous) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDualSpaceLagrangeGetContinuity(__pyx_v_self->dualspace, (&__pyx_v_ccontinuous))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(64, 854, __pyx_L1_error) /* "petsc4py/PETSc/Space.pyx":855 * cdef PetscBool ccontinuous = PETSC_FALSE * CHKERR( PetscDualSpaceLagrangeGetContinuity(self.dualspace, &ccontinuous)) * return toBool(ccontinuous) # <<<<<<<<<<<<<< * * def setLagrangeContinuity(self, continuous: bool) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_ccontinuous); if (unlikely(!__pyx_t_2)) __PYX_ERR(64, 855, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Space.pyx":843 * return toInt(cintdim) * * def getLagrangeContinuity(self) -> bool: # <<<<<<<<<<<<<< * """Return whether the element is continuous. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DualSpace.getLagrangeContinuity", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Space.pyx":857 * return toBool(ccontinuous) * * def setLagrangeContinuity(self, continuous: bool) -> None: # <<<<<<<<<<<<<< * """Indicate whether the element is continuous. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_9DualSpace_39setLagrangeContinuity(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_9DualSpace_38setLagrangeContinuity, "DualSpace.setLagrangeContinuity(self, continuous: bool) -> None\nIndicate whether the element is continuous.\n\n Not collective.\n\n Parameters\n ----------\n continuous\n The flag for element continuity.\n\n See Also\n --------\n getLagrangeContinuity, petsc.PetscDualSpaceLagrangeSetContinuity\n\n \nSource code at petsc4py/PETSc/Space.pyx:857"); static PyObject *__pyx_pw_8petsc4py_5PETSc_9DualSpace_39setLagrangeContinuity(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_continuous = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setLagrangeContinuity (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_continuous,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_continuous)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(64, 857, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setLagrangeContinuity") < 0)) __PYX_ERR(64, 857, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_continuous = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setLagrangeContinuity", 1, 1, 1, __pyx_nargs); __PYX_ERR(64, 857, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DualSpace.setLagrangeContinuity", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_9DualSpace_38setLagrangeContinuity(((struct PyPetscDualSpaceObject *)__pyx_v_self), __pyx_v_continuous); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_38setLagrangeContinuity(struct PyPetscDualSpaceObject *__pyx_v_self, PyObject *__pyx_v_continuous) { PetscBool __pyx_v_ccontinuous; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setLagrangeContinuity", 1); /* "petsc4py/PETSc/Space.pyx":872 * * """ * cdef PetscBool ccontinuous = asBool(continuous) # <<<<<<<<<<<<<< * CHKERR( PetscDualSpaceLagrangeSetContinuity(self.dualspace, ccontinuous)) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asBool(__pyx_v_continuous); if (unlikely(__pyx_t_1 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(64, 872, __pyx_L1_error) __pyx_v_ccontinuous = __pyx_t_1; /* "petsc4py/PETSc/Space.pyx":873 * """ * cdef PetscBool ccontinuous = asBool(continuous) * CHKERR( PetscDualSpaceLagrangeSetContinuity(self.dualspace, ccontinuous)) # <<<<<<<<<<<<<< * * def getLagrangeTensor(self) -> bool: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDualSpaceLagrangeSetContinuity(__pyx_v_self->dualspace, __pyx_v_ccontinuous)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(64, 873, __pyx_L1_error) /* "petsc4py/PETSc/Space.pyx":857 * return toBool(ccontinuous) * * def setLagrangeContinuity(self, continuous: bool) -> None: # <<<<<<<<<<<<<< * """Indicate whether the element is continuous. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DualSpace.setLagrangeContinuity", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Space.pyx":875 * CHKERR( PetscDualSpaceLagrangeSetContinuity(self.dualspace, ccontinuous)) * * def getLagrangeTensor(self) -> bool: # <<<<<<<<<<<<<< * """Return the tensor nature of the dual space. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_9DualSpace_41getLagrangeTensor(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_9DualSpace_40getLagrangeTensor, "DualSpace.getLagrangeTensor(self) -> bool\nReturn the tensor nature of the dual space.\n\n Not collective.\n\n See Also\n --------\n setLagrangeTensor, petsc.PetscDualSpaceLagrangeGetTensor\n\n \nSource code at petsc4py/PETSc/Space.pyx:875"); static PyObject *__pyx_pw_8petsc4py_5PETSc_9DualSpace_41getLagrangeTensor(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getLagrangeTensor (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getLagrangeTensor", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getLagrangeTensor", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_9DualSpace_40getLagrangeTensor(((struct PyPetscDualSpaceObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_40getLagrangeTensor(struct PyPetscDualSpaceObject *__pyx_v_self) { PetscBool __pyx_v_ctensor; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getLagrangeTensor", 1); /* "petsc4py/PETSc/Space.pyx":885 * * """ * cdef PetscBool ctensor = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( PetscDualSpaceLagrangeGetTensor(self.dualspace, &ctensor)) * return toBool(ctensor) */ __pyx_v_ctensor = PETSC_FALSE; /* "petsc4py/PETSc/Space.pyx":886 * """ * cdef PetscBool ctensor = PETSC_FALSE * CHKERR( PetscDualSpaceLagrangeGetTensor(self.dualspace, &ctensor)) # <<<<<<<<<<<<<< * return toBool(ctensor) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDualSpaceLagrangeGetTensor(__pyx_v_self->dualspace, (&__pyx_v_ctensor))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(64, 886, __pyx_L1_error) /* "petsc4py/PETSc/Space.pyx":887 * cdef PetscBool ctensor = PETSC_FALSE * CHKERR( PetscDualSpaceLagrangeGetTensor(self.dualspace, &ctensor)) * return toBool(ctensor) # <<<<<<<<<<<<<< * * def setLagrangeTensor(self, tensor: bool) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_ctensor); if (unlikely(!__pyx_t_2)) __PYX_ERR(64, 887, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Space.pyx":875 * CHKERR( PetscDualSpaceLagrangeSetContinuity(self.dualspace, ccontinuous)) * * def getLagrangeTensor(self) -> bool: # <<<<<<<<<<<<<< * """Return the tensor nature of the dual space. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DualSpace.getLagrangeTensor", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Space.pyx":889 * return toBool(ctensor) * * def setLagrangeTensor(self, tensor: bool) -> None: # <<<<<<<<<<<<<< * """Set the tensor nature of the dual space. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_9DualSpace_43setLagrangeTensor(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_9DualSpace_42setLagrangeTensor, "DualSpace.setLagrangeTensor(self, tensor: bool) -> None\nSet the tensor nature of the dual space.\n\n Not collective.\n\n Parameters\n ----------\n tensor\n Whether the dual space has tensor layout (vs. simplicial).\n\n See Also\n --------\n getLagrangeTensor, petsc.PetscDualSpaceLagrangeSetTensor\n\n \nSource code at petsc4py/PETSc/Space.pyx:889"); static PyObject *__pyx_pw_8petsc4py_5PETSc_9DualSpace_43setLagrangeTensor(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_tensor = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setLagrangeTensor (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tensor,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_tensor)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(64, 889, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setLagrangeTensor") < 0)) __PYX_ERR(64, 889, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_tensor = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setLagrangeTensor", 1, 1, 1, __pyx_nargs); __PYX_ERR(64, 889, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DualSpace.setLagrangeTensor", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_9DualSpace_42setLagrangeTensor(((struct PyPetscDualSpaceObject *)__pyx_v_self), __pyx_v_tensor); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_42setLagrangeTensor(struct PyPetscDualSpaceObject *__pyx_v_self, PyObject *__pyx_v_tensor) { PetscBool __pyx_v_ctensor; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setLagrangeTensor", 1); /* "petsc4py/PETSc/Space.pyx":904 * * """ * cdef PetscBool ctensor = asBool(tensor) # <<<<<<<<<<<<<< * CHKERR( PetscDualSpaceLagrangeSetTensor(self.dualspace, ctensor)) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asBool(__pyx_v_tensor); if (unlikely(__pyx_t_1 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(64, 904, __pyx_L1_error) __pyx_v_ctensor = __pyx_t_1; /* "petsc4py/PETSc/Space.pyx":905 * """ * cdef PetscBool ctensor = asBool(tensor) * CHKERR( PetscDualSpaceLagrangeSetTensor(self.dualspace, ctensor)) # <<<<<<<<<<<<<< * * def getLagrangeTrimmed(self) -> bool: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDualSpaceLagrangeSetTensor(__pyx_v_self->dualspace, __pyx_v_ctensor)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(64, 905, __pyx_L1_error) /* "petsc4py/PETSc/Space.pyx":889 * return toBool(ctensor) * * def setLagrangeTensor(self, tensor: bool) -> None: # <<<<<<<<<<<<<< * """Set the tensor nature of the dual space. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DualSpace.setLagrangeTensor", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Space.pyx":907 * CHKERR( PetscDualSpaceLagrangeSetTensor(self.dualspace, ctensor)) * * def getLagrangeTrimmed(self) -> bool: # <<<<<<<<<<<<<< * """Return the trimmed nature of the dual space. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_9DualSpace_45getLagrangeTrimmed(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_9DualSpace_44getLagrangeTrimmed, "DualSpace.getLagrangeTrimmed(self) -> bool\nReturn the trimmed nature of the dual space.\n\n Not collective.\n\n See Also\n --------\n setLagrangeTrimmed, petsc.PetscDualSpaceLagrangeGetTrimmed\n\n \nSource code at petsc4py/PETSc/Space.pyx:907"); static PyObject *__pyx_pw_8petsc4py_5PETSc_9DualSpace_45getLagrangeTrimmed(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getLagrangeTrimmed (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getLagrangeTrimmed", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getLagrangeTrimmed", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_9DualSpace_44getLagrangeTrimmed(((struct PyPetscDualSpaceObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_44getLagrangeTrimmed(struct PyPetscDualSpaceObject *__pyx_v_self) { PetscBool __pyx_v_ctrimmed; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getLagrangeTrimmed", 1); /* "petsc4py/PETSc/Space.pyx":917 * * """ * cdef PetscBool ctrimmed = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( PetscDualSpaceLagrangeGetTrimmed(self.dualspace, &ctrimmed)) * return toBool(ctrimmed) */ __pyx_v_ctrimmed = PETSC_FALSE; /* "petsc4py/PETSc/Space.pyx":918 * """ * cdef PetscBool ctrimmed = PETSC_FALSE * CHKERR( PetscDualSpaceLagrangeGetTrimmed(self.dualspace, &ctrimmed)) # <<<<<<<<<<<<<< * return toBool(ctrimmed) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDualSpaceLagrangeGetTrimmed(__pyx_v_self->dualspace, (&__pyx_v_ctrimmed))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(64, 918, __pyx_L1_error) /* "petsc4py/PETSc/Space.pyx":919 * cdef PetscBool ctrimmed = PETSC_FALSE * CHKERR( PetscDualSpaceLagrangeGetTrimmed(self.dualspace, &ctrimmed)) * return toBool(ctrimmed) # <<<<<<<<<<<<<< * * def setLagrangeTrimmed(self, trimmed: bool) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_ctrimmed); if (unlikely(!__pyx_t_2)) __PYX_ERR(64, 919, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/Space.pyx":907 * CHKERR( PetscDualSpaceLagrangeSetTensor(self.dualspace, ctensor)) * * def getLagrangeTrimmed(self) -> bool: # <<<<<<<<<<<<<< * """Return the trimmed nature of the dual space. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DualSpace.getLagrangeTrimmed", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Space.pyx":921 * return toBool(ctrimmed) * * def setLagrangeTrimmed(self, trimmed: bool) -> None: # <<<<<<<<<<<<<< * """Set the trimmed nature of the dual space. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_9DualSpace_47setLagrangeTrimmed(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_9DualSpace_46setLagrangeTrimmed, "DualSpace.setLagrangeTrimmed(self, trimmed: bool) -> None\nSet the trimmed nature of the dual space.\n\n Not collective.\n\n Parameters\n ----------\n trimmed\n Whether the dual space represents to dual basis of a trimmed\n polynomial space (e.g. Raviart-Thomas and higher order /\n other form degree variants).\n\n See Also\n --------\n getLagrangeTrimmed, petsc.PetscDualSpaceLagrangeSetTrimmed\n\n \nSource code at petsc4py/PETSc/Space.pyx:921"); static PyObject *__pyx_pw_8petsc4py_5PETSc_9DualSpace_47setLagrangeTrimmed(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_trimmed = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setLagrangeTrimmed (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_trimmed,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_trimmed)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(64, 921, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setLagrangeTrimmed") < 0)) __PYX_ERR(64, 921, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_trimmed = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setLagrangeTrimmed", 1, 1, 1, __pyx_nargs); __PYX_ERR(64, 921, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DualSpace.setLagrangeTrimmed", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_9DualSpace_46setLagrangeTrimmed(((struct PyPetscDualSpaceObject *)__pyx_v_self), __pyx_v_trimmed); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_46setLagrangeTrimmed(struct PyPetscDualSpaceObject *__pyx_v_self, PyObject *__pyx_v_trimmed) { PetscBool __pyx_v_ctrimmed; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setLagrangeTrimmed", 1); /* "petsc4py/PETSc/Space.pyx":938 * * """ * cdef PetscBool ctrimmed = asBool(trimmed) # <<<<<<<<<<<<<< * CHKERR( PetscDualSpaceLagrangeSetTrimmed(self.dualspace, ctrimmed)) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asBool(__pyx_v_trimmed); if (unlikely(__pyx_t_1 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(64, 938, __pyx_L1_error) __pyx_v_ctrimmed = __pyx_t_1; /* "petsc4py/PETSc/Space.pyx":939 * """ * cdef PetscBool ctrimmed = asBool(trimmed) * CHKERR( PetscDualSpaceLagrangeSetTrimmed(self.dualspace, ctrimmed)) # <<<<<<<<<<<<<< * * def viewFromOptions(self, name: str, Object obj=None) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDualSpaceLagrangeSetTrimmed(__pyx_v_self->dualspace, __pyx_v_ctrimmed)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(64, 939, __pyx_L1_error) /* "petsc4py/PETSc/Space.pyx":921 * return toBool(ctrimmed) * * def setLagrangeTrimmed(self, trimmed: bool) -> None: # <<<<<<<<<<<<<< * """Set the trimmed nature of the dual space. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DualSpace.setLagrangeTrimmed", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Space.pyx":941 * CHKERR( PetscDualSpaceLagrangeSetTrimmed(self.dualspace, ctrimmed)) * * def viewFromOptions(self, name: str, Object obj=None) -> None: # <<<<<<<<<<<<<< * """View a `DualSpace` based on values in the options database. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_9DualSpace_49viewFromOptions(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_9DualSpace_48viewFromOptions, "DualSpace.viewFromOptions(self, name: str, obj: Object | None = None) -> None\nView a `DualSpace` based on values in the options database.\n\n Collective.\n\n Parameters\n ----------\n name\n Command line option name.\n obj\n Optional object that provides the options prefix.\n\n See Also\n --------\n petsc_options, petsc.PetscSpaceViewFromOptions\n\n \nSource code at petsc4py/PETSc/Space.pyx:941"); static PyObject *__pyx_pw_8petsc4py_5PETSc_9DualSpace_49viewFromOptions(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_name = 0; struct PyPetscObjectObject *__pyx_v_obj = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("viewFromOptions (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_obj,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscObjectObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(64, 941, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_obj); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(64, 941, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "viewFromOptions") < 0)) __PYX_ERR(64, 941, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_name = values[0]; __pyx_v_obj = ((struct PyPetscObjectObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("viewFromOptions", 0, 1, 2, __pyx_nargs); __PYX_ERR(64, 941, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DualSpace.viewFromOptions", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_obj), __pyx_ptype_8petsc4py_5PETSc_Object, 1, "obj", 0))) __PYX_ERR(64, 941, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_9DualSpace_48viewFromOptions(((struct PyPetscDualSpaceObject *)__pyx_v_self), __pyx_v_name, __pyx_v_obj); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_48viewFromOptions(struct PyPetscDualSpaceObject *__pyx_v_self, PyObject *__pyx_v_name, struct PyPetscObjectObject *__pyx_v_obj) { char const *__pyx_v_cname; CYTHON_UNUSED PyObject *__pyx_v__ = NULL; PetscObject __pyx_v_cobj; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("viewFromOptions", 1); /* "petsc4py/PETSc/Space.pyx":958 * * """ * cdef const char *cname = NULL # <<<<<<<<<<<<<< * _ = str2bytes(name, &cname) * cdef PetscObject cobj = NULL */ __pyx_v_cname = NULL; /* "petsc4py/PETSc/Space.pyx":959 * """ * cdef const char *cname = NULL * _ = str2bytes(name, &cname) # <<<<<<<<<<<<<< * cdef PetscObject cobj = NULL * if obj is not None: cobj = obj.obj[0] */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cname)); if (unlikely(!__pyx_t_1)) __PYX_ERR(64, 959, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v__ = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/Space.pyx":960 * cdef const char *cname = NULL * _ = str2bytes(name, &cname) * cdef PetscObject cobj = NULL # <<<<<<<<<<<<<< * if obj is not None: cobj = obj.obj[0] * CHKERR( PetscDualSpaceViewFromOptions(self.dualspace, cobj, cname) ) */ __pyx_v_cobj = NULL; /* "petsc4py/PETSc/Space.pyx":961 * _ = str2bytes(name, &cname) * cdef PetscObject cobj = NULL * if obj is not None: cobj = obj.obj[0] # <<<<<<<<<<<<<< * CHKERR( PetscDualSpaceViewFromOptions(self.dualspace, cobj, cname) ) * */ __pyx_t_2 = (((PyObject *)__pyx_v_obj) != Py_None); if (__pyx_t_2) { __pyx_v_cobj = (__pyx_v_obj->obj[0]); } /* "petsc4py/PETSc/Space.pyx":962 * cdef PetscObject cobj = NULL * if obj is not None: cobj = obj.obj[0] * CHKERR( PetscDualSpaceViewFromOptions(self.dualspace, cobj, cname) ) # <<<<<<<<<<<<<< * * def setSimpleDimension(self, dim: int) -> None: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDualSpaceViewFromOptions(__pyx_v_self->dualspace, __pyx_v_cobj, __pyx_v_cname)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(64, 962, __pyx_L1_error) /* "petsc4py/PETSc/Space.pyx":941 * CHKERR( PetscDualSpaceLagrangeSetTrimmed(self.dualspace, ctrimmed)) * * def viewFromOptions(self, name: str, Object obj=None) -> None: # <<<<<<<<<<<<<< * """View a `DualSpace` based on values in the options database. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DualSpace.viewFromOptions", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v__); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Space.pyx":964 * CHKERR( PetscDualSpaceViewFromOptions(self.dualspace, cobj, cname) ) * * def setSimpleDimension(self, dim: int) -> None: # <<<<<<<<<<<<<< * """Set the number of functionals in the dual space basis. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_9DualSpace_51setSimpleDimension(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_9DualSpace_50setSimpleDimension, "DualSpace.setSimpleDimension(self, dim: int) -> None\nSet the number of functionals in the dual space basis.\n\n Logically collective.\n\n Parameters\n ----------\n dim\n The basis dimension.\n\n See Also\n --------\n petsc.PetscDualSpaceSimpleSetDimension\n\n \nSource code at petsc4py/PETSc/Space.pyx:964"); static PyObject *__pyx_pw_8petsc4py_5PETSc_9DualSpace_51setSimpleDimension(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_dim = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setSimpleDimension (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dim,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dim)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(64, 964, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setSimpleDimension") < 0)) __PYX_ERR(64, 964, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_dim = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setSimpleDimension", 1, 1, 1, __pyx_nargs); __PYX_ERR(64, 964, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DualSpace.setSimpleDimension", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_9DualSpace_50setSimpleDimension(((struct PyPetscDualSpaceObject *)__pyx_v_self), __pyx_v_dim); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_50setSimpleDimension(struct PyPetscDualSpaceObject *__pyx_v_self, PyObject *__pyx_v_dim) { PetscInt __pyx_v_cdim; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setSimpleDimension", 1); /* "petsc4py/PETSc/Space.pyx":979 * * """ * cdef PetscInt cdim = asInt(dim) # <<<<<<<<<<<<<< * CHKERR( PetscDualSpaceSimpleSetDimension(self.dualspace, cdim) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_dim); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(64, 979, __pyx_L1_error) __pyx_v_cdim = __pyx_t_1; /* "petsc4py/PETSc/Space.pyx":980 * """ * cdef PetscInt cdim = asInt(dim) * CHKERR( PetscDualSpaceSimpleSetDimension(self.dualspace, cdim) ) # <<<<<<<<<<<<<< * * def setSimpleFunctional(self, func: int, Quad functional) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDualSpaceSimpleSetDimension(__pyx_v_self->dualspace, __pyx_v_cdim)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(64, 980, __pyx_L1_error) /* "petsc4py/PETSc/Space.pyx":964 * CHKERR( PetscDualSpaceViewFromOptions(self.dualspace, cobj, cname) ) * * def setSimpleDimension(self, dim: int) -> None: # <<<<<<<<<<<<<< * """Set the number of functionals in the dual space basis. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DualSpace.setSimpleDimension", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/Space.pyx":982 * CHKERR( PetscDualSpaceSimpleSetDimension(self.dualspace, cdim) ) * * def setSimpleFunctional(self, func: int, Quad functional) -> None: # <<<<<<<<<<<<<< * """Set the given basis element for this dual space. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_9DualSpace_53setSimpleFunctional(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_9DualSpace_52setSimpleFunctional, "DualSpace.setSimpleFunctional(self, func: int, functional: Quad) -> None\nSet the given basis element for this dual space.\n\n Not collective.\n\n Parameters\n ----------\n func\n The basis index.\n functional\n The basis functional.\n\n See Also\n --------\n petsc.PetscDualSpaceSimpleSetFunctional\n\n \nSource code at petsc4py/PETSc/Space.pyx:982"); static PyObject *__pyx_pw_8petsc4py_5PETSc_9DualSpace_53setSimpleFunctional(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_func = 0; struct PyPetscQuadObject *__pyx_v_functional = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setSimpleFunctional (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,&__pyx_n_s_functional,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_func)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(64, 982, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_functional)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(64, 982, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setSimpleFunctional", 1, 2, 2, 1); __PYX_ERR(64, 982, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setSimpleFunctional") < 0)) __PYX_ERR(64, 982, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_func = values[0]; __pyx_v_functional = ((struct PyPetscQuadObject *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setSimpleFunctional", 1, 2, 2, __pyx_nargs); __PYX_ERR(64, 982, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DualSpace.setSimpleFunctional", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_functional), __pyx_ptype_8petsc4py_5PETSc_Quad, 0, "functional", 0))) __PYX_ERR(64, 982, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_9DualSpace_52setSimpleFunctional(((struct PyPetscDualSpaceObject *)__pyx_v_self), __pyx_v_func, __pyx_v_functional); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_52setSimpleFunctional(struct PyPetscDualSpaceObject *__pyx_v_self, PyObject *__pyx_v_func, struct PyPetscQuadObject *__pyx_v_functional) { PetscInt __pyx_v_cfunc; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setSimpleFunctional", 1); /* "petsc4py/PETSc/Space.pyx":999 * * """ * cdef PetscInt cfunc = asInt(func) # <<<<<<<<<<<<<< * CHKERR( PetscDualSpaceSimpleSetFunctional(self.dualspace, cfunc, functional.quad) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_func); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(64, 999, __pyx_L1_error) __pyx_v_cfunc = __pyx_t_1; /* "petsc4py/PETSc/Space.pyx":1000 * """ * cdef PetscInt cfunc = asInt(func) * CHKERR( PetscDualSpaceSimpleSetFunctional(self.dualspace, cfunc, functional.quad) ) # <<<<<<<<<<<<<< * * del SpaceType */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDualSpaceSimpleSetFunctional(__pyx_v_self->dualspace, __pyx_v_cfunc, __pyx_v_functional->quad)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(64, 1000, __pyx_L1_error) /* "petsc4py/PETSc/Space.pyx":982 * CHKERR( PetscDualSpaceSimpleSetDimension(self.dualspace, cdim) ) * * def setSimpleFunctional(self, func: int, Quad functional) -> None: # <<<<<<<<<<<<<< * """Set the given basis element for this dual space. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DualSpace.setSimpleFunctional", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMUtils.pyx":7 * cdef PetscDMInterpolation dminterp * * def __cinit__(self): # <<<<<<<<<<<<<< * self.dminterp = NULL * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_15DMInterpolation_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_15DMInterpolation_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_8petsc4py_5PETSc_15DMInterpolation___cinit__(((struct __pyx_obj_8petsc4py_5PETSc_DMInterpolation *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_15DMInterpolation___cinit__(struct __pyx_obj_8petsc4py_5PETSc_DMInterpolation *__pyx_v_self) { int __pyx_r; /* "petsc4py/PETSc/DMUtils.pyx":8 * * def __cinit__(self): * self.dminterp = NULL # <<<<<<<<<<<<<< * * def __dealloc__(self): */ __pyx_v_self->dminterp = NULL; /* "petsc4py/PETSc/DMUtils.pyx":7 * cdef PetscDMInterpolation dminterp * * def __cinit__(self): # <<<<<<<<<<<<<< * self.dminterp = NULL * */ /* function exit code */ __pyx_r = 0; return __pyx_r; } /* "petsc4py/PETSc/DMUtils.pyx":10 * self.dminterp = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< * self.destroy() * */ /* Python wrapper */ static void __pyx_pw_8petsc4py_5PETSc_15DMInterpolation_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_8petsc4py_5PETSc_15DMInterpolation_3__dealloc__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_pf_8petsc4py_5PETSc_15DMInterpolation_2__dealloc__(((struct __pyx_obj_8petsc4py_5PETSc_DMInterpolation *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_8petsc4py_5PETSc_15DMInterpolation_2__dealloc__(struct __pyx_obj_8petsc4py_5PETSc_DMInterpolation *__pyx_v_self) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__dealloc__", 1); /* "petsc4py/PETSc/DMUtils.pyx":11 * * def __dealloc__(self): * self.destroy() # <<<<<<<<<<<<<< * * def create(self, comm: Comm | None = None) -> Self: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_destroy); if (unlikely(!__pyx_t_2)) __PYX_ERR(65, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(65, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DMUtils.pyx":10 * self.dminterp = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< * self.destroy() * */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_WriteUnraisable("petsc4py.PETSc.DMInterpolation.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_L0:; __Pyx_RefNannyFinishContext(); } /* "petsc4py/PETSc/DMUtils.pyx":13 * self.destroy() * * def create(self, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Create a `DMInterpolation` context. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_15DMInterpolation_5create(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_15DMInterpolation_4create, "DMInterpolation.create(self, comm: Comm | None = None) -> Self\nCreate a `DMInterpolation` context.\n\n Collective.\n\n Parameters\n ----------\n comm\n MPI communicator, defaults to `COMM_SELF`.\n\n See Also\n --------\n destroy, petsc.DMInterpolationCreate\n\n \nSource code at petsc4py/PETSc/DMUtils.pyx:13"); static PyObject *__pyx_pw_8petsc4py_5PETSc_15DMInterpolation_5create(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(65, 13, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "create") < 0)) __PYX_ERR(65, 13, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_comm = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, __pyx_nargs); __PYX_ERR(65, 13, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMInterpolation.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_15DMInterpolation_4create(((struct __pyx_obj_8petsc4py_5PETSc_DMInterpolation *)__pyx_v_self), __pyx_v_comm); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_15DMInterpolation_4create(struct __pyx_obj_8petsc4py_5PETSc_DMInterpolation *__pyx_v_self, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; DMInterpolationInfo __pyx_v_newdminterp; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create", 1); /* "petsc4py/PETSc/DMUtils.pyx":28 * * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_SELF) # <<<<<<<<<<<<<< * cdef PetscDMInterpolation newdminterp = NULL * CHKERR( DMInterpolationCreate(ccomm, &newdminterp) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, PETSC_COMM_SELF); if (unlikely(__pyx_t_1 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(65, 28, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "petsc4py/PETSc/DMUtils.pyx":29 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_SELF) * cdef PetscDMInterpolation newdminterp = NULL # <<<<<<<<<<<<<< * CHKERR( DMInterpolationCreate(ccomm, &newdminterp) ) * CHKERR( DMInterpolationDestroy(&self.dminterp)) */ __pyx_v_newdminterp = NULL; /* "petsc4py/PETSc/DMUtils.pyx":30 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_SELF) * cdef PetscDMInterpolation newdminterp = NULL * CHKERR( DMInterpolationCreate(ccomm, &newdminterp) ) # <<<<<<<<<<<<<< * CHKERR( DMInterpolationDestroy(&self.dminterp)) * self.dminterp = newdminterp */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMInterpolationCreate(__pyx_v_ccomm, (&__pyx_v_newdminterp))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(65, 30, __pyx_L1_error) /* "petsc4py/PETSc/DMUtils.pyx":31 * cdef PetscDMInterpolation newdminterp = NULL * CHKERR( DMInterpolationCreate(ccomm, &newdminterp) ) * CHKERR( DMInterpolationDestroy(&self.dminterp)) # <<<<<<<<<<<<<< * self.dminterp = newdminterp * return self */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMInterpolationDestroy((&__pyx_v_self->dminterp))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(65, 31, __pyx_L1_error) /* "petsc4py/PETSc/DMUtils.pyx":32 * CHKERR( DMInterpolationCreate(ccomm, &newdminterp) ) * CHKERR( DMInterpolationDestroy(&self.dminterp)) * self.dminterp = newdminterp # <<<<<<<<<<<<<< * return self * */ __pyx_v_self->dminterp = __pyx_v_newdminterp; /* "petsc4py/PETSc/DMUtils.pyx":33 * CHKERR( DMInterpolationDestroy(&self.dminterp)) * self.dminterp = newdminterp * return self # <<<<<<<<<<<<<< * * def destroy(self) -> Self: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/DMUtils.pyx":13 * self.destroy() * * def create(self, comm: Comm | None = None) -> Self: # <<<<<<<<<<<<<< * """Create a `DMInterpolation` context. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMInterpolation.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMUtils.pyx":35 * return self * * def destroy(self) -> Self: # <<<<<<<<<<<<<< * """Destroy the `DMInterpolation` context. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_15DMInterpolation_7destroy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_15DMInterpolation_6destroy, "DMInterpolation.destroy(self) -> Self\nDestroy the `DMInterpolation` context.\n\n Collective.\n\n See Also\n --------\n create, petsc.DMInterpolationDestroy\n\n \nSource code at petsc4py/PETSc/DMUtils.pyx:35"); static PyObject *__pyx_pw_8petsc4py_5PETSc_15DMInterpolation_7destroy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("destroy (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_15DMInterpolation_6destroy(((struct __pyx_obj_8petsc4py_5PETSc_DMInterpolation *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_15DMInterpolation_6destroy(struct __pyx_obj_8petsc4py_5PETSc_DMInterpolation *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("destroy", 1); /* "petsc4py/PETSc/DMUtils.pyx":45 * * """ * CHKERR( DMInterpolationDestroy(&self.dminterp)) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMInterpolationDestroy((&__pyx_v_self->dminterp))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(65, 45, __pyx_L1_error) /* "petsc4py/PETSc/DMUtils.pyx":46 * """ * CHKERR( DMInterpolationDestroy(&self.dminterp)) * return self # <<<<<<<<<<<<<< * * def evaluate(self, DM dm, Vec x, Vec v=None) -> Vec: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "petsc4py/PETSc/DMUtils.pyx":35 * return self * * def destroy(self) -> Self: # <<<<<<<<<<<<<< * """Destroy the `DMInterpolation` context. * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMInterpolation.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMUtils.pyx":48 * return self * * def evaluate(self, DM dm, Vec x, Vec v=None) -> Vec: # <<<<<<<<<<<<<< * """Calculate interpolated field values at the interpolation points. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_15DMInterpolation_9evaluate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_15DMInterpolation_8evaluate, "DMInterpolation.evaluate(self, dm: DM, x: Vec, v: Vec | None = None) -> Vec\nCalculate interpolated field values at the interpolation points.\n\n Collective.\n\n Parameters\n ----------\n dm\n The `DM`.\n x\n The local vector containing the field to be interpolated.\n v\n A vector capable of holding the interpolated field values.\n\n See Also\n --------\n petsc.DMInterpolationEvaluate\n\n \nSource code at petsc4py/PETSc/DMUtils.pyx:48"); static PyObject *__pyx_pw_8petsc4py_5PETSc_15DMInterpolation_9evaluate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscDMObject *__pyx_v_dm = 0; struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_v = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("evaluate (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dm,&__pyx_n_s_x,&__pyx_n_s_v,0}; values[2] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct PyPetscVecObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dm)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(65, 48, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(65, 48, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("evaluate", 0, 2, 3, 1); __PYX_ERR(65, 48, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_v); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(65, 48, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "evaluate") < 0)) __PYX_ERR(65, 48, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_dm = ((struct PyPetscDMObject *)values[0]); __pyx_v_x = ((struct PyPetscVecObject *)values[1]); __pyx_v_v = ((struct PyPetscVecObject *)values[2]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("evaluate", 0, 2, 3, __pyx_nargs); __PYX_ERR(65, 48, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMInterpolation.evaluate", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_ptype_8petsc4py_5PETSc_DM, 0, "dm", 0))) __PYX_ERR(65, 48, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(65, 48, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "v", 0))) __PYX_ERR(65, 48, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_15DMInterpolation_8evaluate(((struct __pyx_obj_8petsc4py_5PETSc_DMInterpolation *)__pyx_v_self), __pyx_v_dm, __pyx_v_x, __pyx_v_v); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_15DMInterpolation_8evaluate(struct __pyx_obj_8petsc4py_5PETSc_DMInterpolation *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_v) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("evaluate", 0); __Pyx_INCREF((PyObject *)__pyx_v_v); /* "petsc4py/PETSc/DMUtils.pyx":67 * * """ * if v is None: # <<<<<<<<<<<<<< * v = Vec() * if v.vec == NULL: */ __pyx_t_1 = (((PyObject *)__pyx_v_v) == Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/DMUtils.pyx":68 * """ * if v is None: * v = Vec() # <<<<<<<<<<<<<< * if v.vec == NULL: * CHKERR( DMInterpolationGetVector(self.dminterp, &v.vec ) ) */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_2)) __PYX_ERR(65, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_v, ((struct PyPetscVecObject *)__pyx_t_2)); __pyx_t_2 = 0; /* "petsc4py/PETSc/DMUtils.pyx":67 * * """ * if v is None: # <<<<<<<<<<<<<< * v = Vec() * if v.vec == NULL: */ } /* "petsc4py/PETSc/DMUtils.pyx":69 * if v is None: * v = Vec() * if v.vec == NULL: # <<<<<<<<<<<<<< * CHKERR( DMInterpolationGetVector(self.dminterp, &v.vec ) ) * CHKERR( DMInterpolationEvaluate(self.dminterp, dm.dm, x.vec, v.vec ) ) */ __pyx_t_1 = (__pyx_v_v->vec == NULL); if (__pyx_t_1) { /* "petsc4py/PETSc/DMUtils.pyx":70 * v = Vec() * if v.vec == NULL: * CHKERR( DMInterpolationGetVector(self.dminterp, &v.vec ) ) # <<<<<<<<<<<<<< * CHKERR( DMInterpolationEvaluate(self.dminterp, dm.dm, x.vec, v.vec ) ) * return v */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMInterpolationGetVector(__pyx_v_self->dminterp, (&__pyx_v_v->vec))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(65, 70, __pyx_L1_error) /* "petsc4py/PETSc/DMUtils.pyx":69 * if v is None: * v = Vec() * if v.vec == NULL: # <<<<<<<<<<<<<< * CHKERR( DMInterpolationGetVector(self.dminterp, &v.vec ) ) * CHKERR( DMInterpolationEvaluate(self.dminterp, dm.dm, x.vec, v.vec ) ) */ } /* "petsc4py/PETSc/DMUtils.pyx":71 * if v.vec == NULL: * CHKERR( DMInterpolationGetVector(self.dminterp, &v.vec ) ) * CHKERR( DMInterpolationEvaluate(self.dminterp, dm.dm, x.vec, v.vec ) ) # <<<<<<<<<<<<<< * return v * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMInterpolationEvaluate(__pyx_v_self->dminterp, __pyx_v_dm->dm, __pyx_v_x->vec, __pyx_v_v->vec)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(65, 71, __pyx_L1_error) /* "petsc4py/PETSc/DMUtils.pyx":72 * CHKERR( DMInterpolationGetVector(self.dminterp, &v.vec ) ) * CHKERR( DMInterpolationEvaluate(self.dminterp, dm.dm, x.vec, v.vec ) ) * return v # <<<<<<<<<<<<<< * * def getCoordinates(self) -> Vec: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_v); __pyx_r = ((PyObject *)__pyx_v_v); goto __pyx_L0; /* "petsc4py/PETSc/DMUtils.pyx":48 * return self * * def evaluate(self, DM dm, Vec x, Vec v=None) -> Vec: # <<<<<<<<<<<<<< * """Calculate interpolated field values at the interpolation points. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMInterpolation.evaluate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_v); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMUtils.pyx":74 * return v * * def getCoordinates(self) -> Vec: # <<<<<<<<<<<<<< * """Return the coordinates of each interpolation point. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_15DMInterpolation_11getCoordinates(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_15DMInterpolation_10getCoordinates, "DMInterpolation.getCoordinates(self) -> Vec\nReturn the coordinates of each interpolation point.\n\n Collective.\n\n The local vector entries correspond to interpolation points lying on\n this process, according to the associated DM.\n\n See Also\n --------\n petsc.DMInterpolationGetCoordinates\n\n \nSource code at petsc4py/PETSc/DMUtils.pyx:74"); static PyObject *__pyx_pw_8petsc4py_5PETSc_15DMInterpolation_11getCoordinates(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getCoordinates (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getCoordinates", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getCoordinates", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_15DMInterpolation_10getCoordinates(((struct __pyx_obj_8petsc4py_5PETSc_DMInterpolation *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_15DMInterpolation_10getCoordinates(struct __pyx_obj_8petsc4py_5PETSc_DMInterpolation *__pyx_v_self) { struct PyPetscVecObject *__pyx_v_coords = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getCoordinates", 1); /* "petsc4py/PETSc/DMUtils.pyx":87 * * """ * cdef Vec coords = Vec() # <<<<<<<<<<<<<< * CHKERR( DMInterpolationGetCoordinates(self.dminterp, &coords.vec) ) * CHKERR( PetscINCREF(coords.obj) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(65, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_coords = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DMUtils.pyx":88 * """ * cdef Vec coords = Vec() * CHKERR( DMInterpolationGetCoordinates(self.dminterp, &coords.vec) ) # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(coords.obj) ) * return coords */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMInterpolationGetCoordinates(__pyx_v_self->dminterp, (&__pyx_v_coords->vec))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(65, 88, __pyx_L1_error) /* "petsc4py/PETSc/DMUtils.pyx":89 * cdef Vec coords = Vec() * CHKERR( DMInterpolationGetCoordinates(self.dminterp, &coords.vec) ) * CHKERR( PetscINCREF(coords.obj) ) # <<<<<<<<<<<<<< * return coords * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_coords->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(65, 89, __pyx_L1_error) /* "petsc4py/PETSc/DMUtils.pyx":90 * CHKERR( DMInterpolationGetCoordinates(self.dminterp, &coords.vec) ) * CHKERR( PetscINCREF(coords.obj) ) * return coords # <<<<<<<<<<<<<< * * def getDim(self) -> int: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_coords); __pyx_r = ((PyObject *)__pyx_v_coords); goto __pyx_L0; /* "petsc4py/PETSc/DMUtils.pyx":74 * return v * * def getCoordinates(self) -> Vec: # <<<<<<<<<<<<<< * """Return the coordinates of each interpolation point. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMInterpolation.getCoordinates", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_coords); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMUtils.pyx":92 * return coords * * def getDim(self) -> int: # <<<<<<<<<<<<<< * """Return the spatial dimension of the interpolation context. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_15DMInterpolation_13getDim(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_15DMInterpolation_12getDim, "DMInterpolation.getDim(self) -> int\nReturn the spatial dimension of the interpolation context.\n\n Not collective.\n\n See Also\n --------\n setDim, petsc.DMInterpolationGetDim\n\n \nSource code at petsc4py/PETSc/DMUtils.pyx:92"); static PyObject *__pyx_pw_8petsc4py_5PETSc_15DMInterpolation_13getDim(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getDim (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getDim", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getDim", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_15DMInterpolation_12getDim(((struct __pyx_obj_8petsc4py_5PETSc_DMInterpolation *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_15DMInterpolation_12getDim(struct __pyx_obj_8petsc4py_5PETSc_DMInterpolation *__pyx_v_self) { PetscInt __pyx_v_cdim; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getDim", 1); /* "petsc4py/PETSc/DMUtils.pyx":102 * * """ * cdef PetscInt cdim = 0 # <<<<<<<<<<<<<< * CHKERR( DMInterpolationGetDim(self.dminterp, &cdim) ) * return toInt(cdim) */ __pyx_v_cdim = 0; /* "petsc4py/PETSc/DMUtils.pyx":103 * """ * cdef PetscInt cdim = 0 * CHKERR( DMInterpolationGetDim(self.dminterp, &cdim) ) # <<<<<<<<<<<<<< * return toInt(cdim) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMInterpolationGetDim(__pyx_v_self->dminterp, (&__pyx_v_cdim))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(65, 103, __pyx_L1_error) /* "petsc4py/PETSc/DMUtils.pyx":104 * cdef PetscInt cdim = 0 * CHKERR( DMInterpolationGetDim(self.dminterp, &cdim) ) * return toInt(cdim) # <<<<<<<<<<<<<< * * def getDof(self) -> int: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_cdim); if (unlikely(!__pyx_t_2)) __PYX_ERR(65, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMUtils.pyx":92 * return coords * * def getDim(self) -> int: # <<<<<<<<<<<<<< * """Return the spatial dimension of the interpolation context. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMInterpolation.getDim", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMUtils.pyx":106 * return toInt(cdim) * * def getDof(self) -> int: # <<<<<<<<<<<<<< * """Return the number of fields interpolated at a point. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_15DMInterpolation_15getDof(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_15DMInterpolation_14getDof, "DMInterpolation.getDof(self) -> int\nReturn the number of fields interpolated at a point.\n\n Not collective.\n\n See Also\n --------\n setDof, petsc.DMInterpolationGetDof\n\n \nSource code at petsc4py/PETSc/DMUtils.pyx:106"); static PyObject *__pyx_pw_8petsc4py_5PETSc_15DMInterpolation_15getDof(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getDof (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getDof", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getDof", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_15DMInterpolation_14getDof(((struct __pyx_obj_8petsc4py_5PETSc_DMInterpolation *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_15DMInterpolation_14getDof(struct __pyx_obj_8petsc4py_5PETSc_DMInterpolation *__pyx_v_self) { PetscInt __pyx_v_cdof; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getDof", 1); /* "petsc4py/PETSc/DMUtils.pyx":116 * * """ * cdef PetscInt cdof = 0 # <<<<<<<<<<<<<< * CHKERR( DMInterpolationGetDof(self.dminterp, &cdof) ) * return toInt(cdof) */ __pyx_v_cdof = 0; /* "petsc4py/PETSc/DMUtils.pyx":117 * """ * cdef PetscInt cdof = 0 * CHKERR( DMInterpolationGetDof(self.dminterp, &cdof) ) # <<<<<<<<<<<<<< * return toInt(cdof) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMInterpolationGetDof(__pyx_v_self->dminterp, (&__pyx_v_cdof))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(65, 117, __pyx_L1_error) /* "petsc4py/PETSc/DMUtils.pyx":118 * cdef PetscInt cdof = 0 * CHKERR( DMInterpolationGetDof(self.dminterp, &cdof) ) * return toInt(cdof) # <<<<<<<<<<<<<< * * def setDim(self, dim: int) -> None: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_cdof); if (unlikely(!__pyx_t_2)) __PYX_ERR(65, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/DMUtils.pyx":106 * return toInt(cdim) * * def getDof(self) -> int: # <<<<<<<<<<<<<< * """Return the number of fields interpolated at a point. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMInterpolation.getDof", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMUtils.pyx":120 * return toInt(cdof) * * def setDim(self, dim: int) -> None: # <<<<<<<<<<<<<< * """Set the spatial dimension for the interpolation context. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_15DMInterpolation_17setDim(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_15DMInterpolation_16setDim, "DMInterpolation.setDim(self, dim: int) -> None\nSet the spatial dimension for the interpolation context.\n\n Not collective.\n\n Parameters\n ----------\n dim\n The spatial dimension.\n\n See Also\n --------\n getDim, petsc.DMInterpolationSetDim\n\n \nSource code at petsc4py/PETSc/DMUtils.pyx:120"); static PyObject *__pyx_pw_8petsc4py_5PETSc_15DMInterpolation_17setDim(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_dim = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setDim (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dim,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dim)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(65, 120, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setDim") < 0)) __PYX_ERR(65, 120, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_dim = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setDim", 1, 1, 1, __pyx_nargs); __PYX_ERR(65, 120, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMInterpolation.setDim", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_15DMInterpolation_16setDim(((struct __pyx_obj_8petsc4py_5PETSc_DMInterpolation *)__pyx_v_self), __pyx_v_dim); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_15DMInterpolation_16setDim(struct __pyx_obj_8petsc4py_5PETSc_DMInterpolation *__pyx_v_self, PyObject *__pyx_v_dim) { PetscInt __pyx_v_cdim; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setDim", 1); /* "petsc4py/PETSc/DMUtils.pyx":135 * * """ * cdef PetscInt cdim = asInt(dim) # <<<<<<<<<<<<<< * CHKERR( DMInterpolationSetDim(self.dminterp, cdim) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_dim); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(65, 135, __pyx_L1_error) __pyx_v_cdim = __pyx_t_1; /* "petsc4py/PETSc/DMUtils.pyx":136 * """ * cdef PetscInt cdim = asInt(dim) * CHKERR( DMInterpolationSetDim(self.dminterp, cdim) ) # <<<<<<<<<<<<<< * * def setDof(self, dof: int) -> None: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMInterpolationSetDim(__pyx_v_self->dminterp, __pyx_v_cdim)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(65, 136, __pyx_L1_error) /* "petsc4py/PETSc/DMUtils.pyx":120 * return toInt(cdof) * * def setDim(self, dim: int) -> None: # <<<<<<<<<<<<<< * """Set the spatial dimension for the interpolation context. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMInterpolation.setDim", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMUtils.pyx":138 * CHKERR( DMInterpolationSetDim(self.dminterp, cdim) ) * * def setDof(self, dof: int) -> None: # <<<<<<<<<<<<<< * """Set the number of fields interpolated at a point. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_15DMInterpolation_19setDof(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_15DMInterpolation_18setDof, "DMInterpolation.setDof(self, dof: int) -> None\nSet the number of fields interpolated at a point.\n\n Not collective.\n\n Parameters\n ----------\n dof\n The number of fields.\n\n See Also\n --------\n getDof, petsc.DMInterpolationSetDof\n\n \nSource code at petsc4py/PETSc/DMUtils.pyx:138"); static PyObject *__pyx_pw_8petsc4py_5PETSc_15DMInterpolation_19setDof(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_dof = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setDof (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dof,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dof)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(65, 138, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setDof") < 0)) __PYX_ERR(65, 138, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_dof = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setDof", 1, 1, 1, __pyx_nargs); __PYX_ERR(65, 138, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMInterpolation.setDof", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_15DMInterpolation_18setDof(((struct __pyx_obj_8petsc4py_5PETSc_DMInterpolation *)__pyx_v_self), __pyx_v_dof); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_15DMInterpolation_18setDof(struct __pyx_obj_8petsc4py_5PETSc_DMInterpolation *__pyx_v_self, PyObject *__pyx_v_dof) { PetscInt __pyx_v_cdof; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setDof", 1); /* "petsc4py/PETSc/DMUtils.pyx":153 * * """ * cdef PetscInt cdof = asInt(dof) # <<<<<<<<<<<<<< * CHKERR( DMInterpolationSetDof(self.dminterp, cdof) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_dof); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(65, 153, __pyx_L1_error) __pyx_v_cdof = __pyx_t_1; /* "petsc4py/PETSc/DMUtils.pyx":154 * """ * cdef PetscInt cdof = asInt(dof) * CHKERR( DMInterpolationSetDof(self.dminterp, cdof) ) # <<<<<<<<<<<<<< * * def setUp( */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMInterpolationSetDof(__pyx_v_self->dminterp, __pyx_v_cdof)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(65, 154, __pyx_L1_error) /* "petsc4py/PETSc/DMUtils.pyx":138 * CHKERR( DMInterpolationSetDim(self.dminterp, cdim) ) * * def setDof(self, dof: int) -> None: # <<<<<<<<<<<<<< * """Set the number of fields interpolated at a point. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMInterpolation.setDof", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMUtils.pyx":156 * CHKERR( DMInterpolationSetDof(self.dminterp, cdof) ) * * def setUp( # <<<<<<<<<<<<<< * self, * DM dm, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_15DMInterpolation_21setUp(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_15DMInterpolation_20setUp, "DMInterpolation.setUp(self, dm: DM, redundantPoints: bool = False, ignoreOutsideDomain: bool = False) -> None\nCompute spatial indices for point location during interpolation.\n\n Collective.\n\n Parameters\n ----------\n dm\n The DM for the function space used for interpolation.\n redundantPoints\n If `True`, all processes are passing in the same array of points.\n Otherwise, points need to be communicated among processes.\n ignoreOutsideDomain\n Ignore points outside of the domain if `True`; otherwise, return an\n error.\n\n See Also\n --------\n petsc.DMInterpolationSetUp\n\n \nSource code at petsc4py/PETSc/DMUtils.pyx:156"); static PyObject *__pyx_pw_8petsc4py_5PETSc_15DMInterpolation_21setUp(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscDMObject *__pyx_v_dm = 0; PyObject *__pyx_v_redundantPoints = 0; PyObject *__pyx_v_ignoreOutsideDomain = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setUp (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dm,&__pyx_n_s_redundantPoints,&__pyx_n_s_ignoreOutsideDomain,0}; /* "petsc4py/PETSc/DMUtils.pyx":159 * self, * DM dm, * redundantPoints: bool = False, # <<<<<<<<<<<<<< * ignoreOutsideDomain: bool = False, * ) -> None: */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False)); /* "petsc4py/PETSc/DMUtils.pyx":160 * DM dm, * redundantPoints: bool = False, * ignoreOutsideDomain: bool = False, # <<<<<<<<<<<<<< * ) -> None: * """Compute spatial indices for point location during interpolation. */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dm)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(65, 156, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_redundantPoints); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(65, 156, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ignoreOutsideDomain); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(65, 156, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setUp") < 0)) __PYX_ERR(65, 156, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_dm = ((struct PyPetscDMObject *)values[0]); __pyx_v_redundantPoints = values[1]; __pyx_v_ignoreOutsideDomain = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setUp", 0, 1, 3, __pyx_nargs); __PYX_ERR(65, 156, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMInterpolation.setUp", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_ptype_8petsc4py_5PETSc_DM, 0, "dm", 0))) __PYX_ERR(65, 158, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_15DMInterpolation_20setUp(((struct __pyx_obj_8petsc4py_5PETSc_DMInterpolation *)__pyx_v_self), __pyx_v_dm, __pyx_v_redundantPoints, __pyx_v_ignoreOutsideDomain); /* "petsc4py/PETSc/DMUtils.pyx":156 * CHKERR( DMInterpolationSetDof(self.dminterp, cdof) ) * * def setUp( # <<<<<<<<<<<<<< * self, * DM dm, */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_15DMInterpolation_20setUp(struct __pyx_obj_8petsc4py_5PETSc_DMInterpolation *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm, PyObject *__pyx_v_redundantPoints, PyObject *__pyx_v_ignoreOutsideDomain) { PetscBool __pyx_v_credundantPoints; PetscBool __pyx_v_cignoreOutsideDomain; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setUp", 1); /* "petsc4py/PETSc/DMUtils.pyx":182 * * """ * cdef PetscBool credundantPoints = asBool(redundantPoints) # <<<<<<<<<<<<<< * cdef PetscBool cignoreOutsideDomain = asBool(ignoreOutsideDomain) * CHKERR( DMInterpolationSetUp(self.dminterp, dm.dm, credundantPoints, cignoreOutsideDomain) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asBool(__pyx_v_redundantPoints); if (unlikely(__pyx_t_1 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(65, 182, __pyx_L1_error) __pyx_v_credundantPoints = __pyx_t_1; /* "petsc4py/PETSc/DMUtils.pyx":183 * """ * cdef PetscBool credundantPoints = asBool(redundantPoints) * cdef PetscBool cignoreOutsideDomain = asBool(ignoreOutsideDomain) # <<<<<<<<<<<<<< * CHKERR( DMInterpolationSetUp(self.dminterp, dm.dm, credundantPoints, cignoreOutsideDomain) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asBool(__pyx_v_ignoreOutsideDomain); if (unlikely(__pyx_t_1 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(65, 183, __pyx_L1_error) __pyx_v_cignoreOutsideDomain = __pyx_t_1; /* "petsc4py/PETSc/DMUtils.pyx":184 * cdef PetscBool credundantPoints = asBool(redundantPoints) * cdef PetscBool cignoreOutsideDomain = asBool(ignoreOutsideDomain) * CHKERR( DMInterpolationSetUp(self.dminterp, dm.dm, credundantPoints, cignoreOutsideDomain) ) # <<<<<<<<<<<<<< * * def getVector(self) -> Vec: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMInterpolationSetUp(__pyx_v_self->dminterp, __pyx_v_dm->dm, __pyx_v_credundantPoints, __pyx_v_cignoreOutsideDomain)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(65, 184, __pyx_L1_error) /* "petsc4py/PETSc/DMUtils.pyx":156 * CHKERR( DMInterpolationSetDof(self.dminterp, cdof) ) * * def setUp( # <<<<<<<<<<<<<< * self, * DM dm, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMInterpolation.setUp", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMUtils.pyx":186 * CHKERR( DMInterpolationSetUp(self.dminterp, dm.dm, credundantPoints, cignoreOutsideDomain) ) * * def getVector(self) -> Vec: # <<<<<<<<<<<<<< * """Return a `Vec` which can hold all the interpolated field values. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_15DMInterpolation_23getVector(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_15DMInterpolation_22getVector, "DMInterpolation.getVector(self) -> Vec\nReturn a `Vec` which can hold all the interpolated field values.\n\n Collective.\n\n This vector should be returned using `restoreVector`.\n\n See Also\n --------\n restoreVector, petsc.DMInterpolationGetVector\n\n \nSource code at petsc4py/PETSc/DMUtils.pyx:186"); static PyObject *__pyx_pw_8petsc4py_5PETSc_15DMInterpolation_23getVector(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getVector (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getVector", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getVector", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_15DMInterpolation_22getVector(((struct __pyx_obj_8petsc4py_5PETSc_DMInterpolation *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_15DMInterpolation_22getVector(struct __pyx_obj_8petsc4py_5PETSc_DMInterpolation *__pyx_v_self) { struct PyPetscVecObject *__pyx_v_vec = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getVector", 1); /* "petsc4py/PETSc/DMUtils.pyx":198 * * """ * cdef Vec vec = Vec() # <<<<<<<<<<<<<< * CHKERR( DMInterpolationGetVector(self.dminterp, &vec.vec)) * return vec */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(65, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/DMUtils.pyx":199 * """ * cdef Vec vec = Vec() * CHKERR( DMInterpolationGetVector(self.dminterp, &vec.vec)) # <<<<<<<<<<<<<< * return vec * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMInterpolationGetVector(__pyx_v_self->dminterp, (&__pyx_v_vec->vec))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(65, 199, __pyx_L1_error) /* "petsc4py/PETSc/DMUtils.pyx":200 * cdef Vec vec = Vec() * CHKERR( DMInterpolationGetVector(self.dminterp, &vec.vec)) * return vec # <<<<<<<<<<<<<< * * def restoreVector(self, Vec vec) -> None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_vec); __pyx_r = ((PyObject *)__pyx_v_vec); goto __pyx_L0; /* "petsc4py/PETSc/DMUtils.pyx":186 * CHKERR( DMInterpolationSetUp(self.dminterp, dm.dm, credundantPoints, cignoreOutsideDomain) ) * * def getVector(self) -> Vec: # <<<<<<<<<<<<<< * """Return a `Vec` which can hold all the interpolated field values. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMInterpolation.getVector", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_vec); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/DMUtils.pyx":202 * return vec * * def restoreVector(self, Vec vec) -> None: # <<<<<<<<<<<<<< * """Restore a Vec which can hold all the interpolated field values. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_15DMInterpolation_25restoreVector(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_15DMInterpolation_24restoreVector, "DMInterpolation.restoreVector(self, vec: Vec) -> None\nRestore a Vec which can hold all the interpolated field values.\n\n Collective.\n\n Parameters\n ----------\n vec\n A vector capable of holding the interpolated field values.\n\n See Also\n --------\n getVector, petsc.DMInterpolationRestoreVector\n\n \nSource code at petsc4py/PETSc/DMUtils.pyx:202"); static PyObject *__pyx_pw_8petsc4py_5PETSc_15DMInterpolation_25restoreVector(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct PyPetscVecObject *__pyx_v_vec = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("restoreVector (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vec)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(65, 202, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "restoreVector") < 0)) __PYX_ERR(65, 202, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_vec = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("restoreVector", 1, 1, 1, __pyx_nargs); __PYX_ERR(65, 202, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc.DMInterpolation.restoreVector", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(65, 202, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_15DMInterpolation_24restoreVector(((struct __pyx_obj_8petsc4py_5PETSc_DMInterpolation *)__pyx_v_self), __pyx_v_vec); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_15DMInterpolation_24restoreVector(struct __pyx_obj_8petsc4py_5PETSc_DMInterpolation *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("restoreVector", 1); /* "petsc4py/PETSc/DMUtils.pyx":217 * * """ * CHKERR( DMInterpolationRestoreVector(self.dminterp, &vec.vec) ) # <<<<<<<<<<<<<< */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMInterpolationRestoreVector(__pyx_v_self->dminterp, (&__pyx_v_vec->vec))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(65, 217, __pyx_L1_error) /* "petsc4py/PETSc/DMUtils.pyx":202 * return vec * * def restoreVector(self, Vec vec) -> None: # <<<<<<<<<<<<<< * """Restore a Vec which can hold all the interpolated field values. * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMInterpolation.restoreVector", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/CAPI.pyx":3 * #--------------------------------------------------------------------- * * cdef inline int setref(void *d, void *s) except -1: # <<<<<<<<<<<<<< * cdef PetscObject *dest = d * cdef PetscObject source = s */ static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_setref(void *__pyx_v_d, void *__pyx_v_s) { PetscObject *__pyx_v_dest; PetscObject __pyx_v_source; int __pyx_r; PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "petsc4py/PETSc/CAPI.pyx":4 * * cdef inline int setref(void *d, void *s) except -1: * cdef PetscObject *dest = d # <<<<<<<<<<<<<< * cdef PetscObject source = s * CHKERR( PetscINCREF(&source) ) */ __pyx_v_dest = ((PetscObject *)__pyx_v_d); /* "petsc4py/PETSc/CAPI.pyx":5 * cdef inline int setref(void *d, void *s) except -1: * cdef PetscObject *dest = d * cdef PetscObject source = s # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(&source) ) * dest[0] = source */ __pyx_v_source = ((PetscObject)__pyx_v_s); /* "petsc4py/PETSc/CAPI.pyx":6 * cdef PetscObject *dest = d * cdef PetscObject source = s * CHKERR( PetscINCREF(&source) ) # <<<<<<<<<<<<<< * dest[0] = source * return 0 */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF((&__pyx_v_source))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(66, 6, __pyx_L1_error) /* "petsc4py/PETSc/CAPI.pyx":7 * cdef PetscObject source = s * CHKERR( PetscINCREF(&source) ) * dest[0] = source # <<<<<<<<<<<<<< * return 0 * */ (__pyx_v_dest[0]) = __pyx_v_source; /* "petsc4py/PETSc/CAPI.pyx":8 * CHKERR( PetscINCREF(&source) ) * dest[0] = source * return 0 # <<<<<<<<<<<<<< * * #--------------------------------------------------------------------- */ __pyx_r = 0; goto __pyx_L0; /* "petsc4py/PETSc/CAPI.pyx":3 * #--------------------------------------------------------------------- * * cdef inline int setref(void *d, void *s) except -1: # <<<<<<<<<<<<<< * cdef PetscObject *dest = d * cdef PetscObject source = s */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.setref", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/CAPI.pyx":14 * # -- Error -- * * cdef api int PyPetscError_Set(PetscErrorCode ierr): # <<<<<<<<<<<<<< * return SETERR(ierr) * */ static int __pyx_f_8petsc4py_5PETSc_PyPetscError_Set(PetscErrorCode __pyx_v_ierr) { int __pyx_r; int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "petsc4py/PETSc/CAPI.pyx":15 * * cdef api int PyPetscError_Set(PetscErrorCode ierr): * return SETERR(ierr) # <<<<<<<<<<<<<< * * # -- Comm -- */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_SETERR(__pyx_v_ierr); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(66, 15, __pyx_L1_error) __pyx_r = __pyx_t_1; goto __pyx_L0; /* "petsc4py/PETSc/CAPI.pyx":14 * # -- Error -- * * cdef api int PyPetscError_Set(PetscErrorCode ierr): # <<<<<<<<<<<<<< * return SETERR(ierr) * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PyPetscError_Set", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/CAPI.pyx":19 * # -- Comm -- * * cdef api object PyPetscComm_New(MPI_Comm arg): # <<<<<<<<<<<<<< * cdef Comm retv = Comm() * retv.comm = arg */ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscComm_New(MPI_Comm __pyx_v_arg) { struct PyPetscCommObject *__pyx_v_retv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscComm_New", 1); /* "petsc4py/PETSc/CAPI.pyx":20 * * cdef api object PyPetscComm_New(MPI_Comm arg): * cdef Comm retv = Comm() # <<<<<<<<<<<<<< * retv.comm = arg * return retv */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Comm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(66, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_retv = ((struct PyPetscCommObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/CAPI.pyx":21 * cdef api object PyPetscComm_New(MPI_Comm arg): * cdef Comm retv = Comm() * retv.comm = arg # <<<<<<<<<<<<<< * return retv * */ __pyx_v_retv->comm = __pyx_v_arg; /* "petsc4py/PETSc/CAPI.pyx":22 * cdef Comm retv = Comm() * retv.comm = arg * return retv # <<<<<<<<<<<<<< * * cdef api MPI_Comm PyPetscComm_Get(object arg) except? MPI_COMM_NULL: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_retv); __pyx_r = ((PyObject *)__pyx_v_retv); goto __pyx_L0; /* "petsc4py/PETSc/CAPI.pyx":19 * # -- Comm -- * * cdef api object PyPetscComm_New(MPI_Comm arg): # <<<<<<<<<<<<<< * cdef Comm retv = Comm() * retv.comm = arg */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscComm_New", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_retv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/CAPI.pyx":24 * return retv * * cdef api MPI_Comm PyPetscComm_Get(object arg) except? MPI_COMM_NULL: # <<<<<<<<<<<<<< * cdef MPI_Comm retv = MPI_COMM_NULL * cdef Comm ob = arg */ static MPI_Comm __pyx_f_8petsc4py_5PETSc_PyPetscComm_Get(PyObject *__pyx_v_arg) { MPI_Comm __pyx_v_retv; struct PyPetscCommObject *__pyx_v_ob = 0; MPI_Comm __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; MPI_Comm __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscComm_Get", 1); /* "petsc4py/PETSc/CAPI.pyx":25 * * cdef api MPI_Comm PyPetscComm_Get(object arg) except? MPI_COMM_NULL: * cdef MPI_Comm retv = MPI_COMM_NULL # <<<<<<<<<<<<<< * cdef Comm ob = arg * retv = ob.comm */ __pyx_v_retv = MPI_COMM_NULL; /* "petsc4py/PETSc/CAPI.pyx":26 * cdef api MPI_Comm PyPetscComm_Get(object arg) except? MPI_COMM_NULL: * cdef MPI_Comm retv = MPI_COMM_NULL * cdef Comm ob = arg # <<<<<<<<<<<<<< * retv = ob.comm * return retv */ if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_ptype_8petsc4py_5PETSc_Comm)))) __PYX_ERR(66, 26, __pyx_L1_error) __pyx_t_1 = __pyx_v_arg; __Pyx_INCREF(__pyx_t_1); __pyx_v_ob = ((struct PyPetscCommObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/CAPI.pyx":27 * cdef MPI_Comm retv = MPI_COMM_NULL * cdef Comm ob = arg * retv = ob.comm # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_v_ob->comm; __pyx_v_retv = __pyx_t_2; /* "petsc4py/PETSc/CAPI.pyx":28 * cdef Comm ob = arg * retv = ob.comm * return retv # <<<<<<<<<<<<<< * * cdef api MPI_Comm* PyPetscComm_GetPtr(object arg) except NULL: */ __pyx_r = __pyx_v_retv; goto __pyx_L0; /* "petsc4py/PETSc/CAPI.pyx":24 * return retv * * cdef api MPI_Comm PyPetscComm_Get(object arg) except? MPI_COMM_NULL: # <<<<<<<<<<<<<< * cdef MPI_Comm retv = MPI_COMM_NULL * cdef Comm ob = arg */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscComm_Get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = MPI_COMM_NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/CAPI.pyx":30 * return retv * * cdef api MPI_Comm* PyPetscComm_GetPtr(object arg) except NULL: # <<<<<<<<<<<<<< * cdef MPI_Comm *retv = NULL * cdef Comm ob = arg */ static MPI_Comm *__pyx_f_8petsc4py_5PETSc_PyPetscComm_GetPtr(PyObject *__pyx_v_arg) { MPI_Comm *__pyx_v_retv; struct PyPetscCommObject *__pyx_v_ob = 0; MPI_Comm *__pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscComm_GetPtr", 1); /* "petsc4py/PETSc/CAPI.pyx":31 * * cdef api MPI_Comm* PyPetscComm_GetPtr(object arg) except NULL: * cdef MPI_Comm *retv = NULL # <<<<<<<<<<<<<< * cdef Comm ob = arg * retv = &ob.comm */ __pyx_v_retv = NULL; /* "petsc4py/PETSc/CAPI.pyx":32 * cdef api MPI_Comm* PyPetscComm_GetPtr(object arg) except NULL: * cdef MPI_Comm *retv = NULL * cdef Comm ob = arg # <<<<<<<<<<<<<< * retv = &ob.comm * return retv */ if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_ptype_8petsc4py_5PETSc_Comm)))) __PYX_ERR(66, 32, __pyx_L1_error) __pyx_t_1 = __pyx_v_arg; __Pyx_INCREF(__pyx_t_1); __pyx_v_ob = ((struct PyPetscCommObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/CAPI.pyx":33 * cdef MPI_Comm *retv = NULL * cdef Comm ob = arg * retv = &ob.comm # <<<<<<<<<<<<<< * return retv * */ __pyx_v_retv = (&__pyx_v_ob->comm); /* "petsc4py/PETSc/CAPI.pyx":34 * cdef Comm ob = arg * retv = &ob.comm * return retv # <<<<<<<<<<<<<< * * # -- Object -- */ __pyx_r = __pyx_v_retv; goto __pyx_L0; /* "petsc4py/PETSc/CAPI.pyx":30 * return retv * * cdef api MPI_Comm* PyPetscComm_GetPtr(object arg) except NULL: # <<<<<<<<<<<<<< * cdef MPI_Comm *retv = NULL * cdef Comm ob = arg */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscComm_GetPtr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/CAPI.pyx":38 * # -- Object -- * * cdef api object PyPetscObject_New(PetscObject arg): # <<<<<<<<<<<<<< * cdef Object retv = subtype_Object(arg)() * setref(&retv.obj[0], arg) */ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscObject_New(PetscObject __pyx_v_arg) { struct PyPetscObjectObject *__pyx_v_retv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscObject_New", 1); /* "petsc4py/PETSc/CAPI.pyx":39 * * cdef api object PyPetscObject_New(PetscObject arg): * cdef Object retv = subtype_Object(arg)() # <<<<<<<<<<<<<< * setref(&retv.obj[0], arg) * return retv */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_Object(__pyx_v_arg)); if (unlikely(!__pyx_t_1)) __PYX_ERR(66, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(66, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_Object))))) __PYX_ERR(66, 39, __pyx_L1_error) __pyx_v_retv = ((struct PyPetscObjectObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/CAPI.pyx":40 * cdef api object PyPetscObject_New(PetscObject arg): * cdef Object retv = subtype_Object(arg)() * setref(&retv.obj[0], arg) # <<<<<<<<<<<<<< * return retv * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_setref((&(__pyx_v_retv->obj[0])), __pyx_v_arg); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(66, 40, __pyx_L1_error) /* "petsc4py/PETSc/CAPI.pyx":41 * cdef Object retv = subtype_Object(arg)() * setref(&retv.obj[0], arg) * return retv # <<<<<<<<<<<<<< * * cdef api PetscObject PyPetscObject_Get(object arg) except ? NULL: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_retv); __pyx_r = ((PyObject *)__pyx_v_retv); goto __pyx_L0; /* "petsc4py/PETSc/CAPI.pyx":38 * # -- Object -- * * cdef api object PyPetscObject_New(PetscObject arg): # <<<<<<<<<<<<<< * cdef Object retv = subtype_Object(arg)() * setref(&retv.obj[0], arg) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscObject_New", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_retv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/CAPI.pyx":43 * return retv * * cdef api PetscObject PyPetscObject_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscObject retv = NULL * cdef Object ob = arg */ static PetscObject __pyx_f_8petsc4py_5PETSc_PyPetscObject_Get(PyObject *__pyx_v_arg) { PetscObject __pyx_v_retv; struct PyPetscObjectObject *__pyx_v_ob = 0; PetscObject __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscObject_Get", 1); /* "petsc4py/PETSc/CAPI.pyx":44 * * cdef api PetscObject PyPetscObject_Get(object arg) except ? NULL: * cdef PetscObject retv = NULL # <<<<<<<<<<<<<< * cdef Object ob = arg * retv = ob.obj[0] */ __pyx_v_retv = NULL; /* "petsc4py/PETSc/CAPI.pyx":45 * cdef api PetscObject PyPetscObject_Get(object arg) except ? NULL: * cdef PetscObject retv = NULL * cdef Object ob = arg # <<<<<<<<<<<<<< * retv = ob.obj[0] * return retv */ if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_ptype_8petsc4py_5PETSc_Object)))) __PYX_ERR(66, 45, __pyx_L1_error) __pyx_t_1 = __pyx_v_arg; __Pyx_INCREF(__pyx_t_1); __pyx_v_ob = ((struct PyPetscObjectObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/CAPI.pyx":46 * cdef PetscObject retv = NULL * cdef Object ob = arg * retv = ob.obj[0] # <<<<<<<<<<<<<< * return retv * */ __pyx_v_retv = (__pyx_v_ob->obj[0]); /* "petsc4py/PETSc/CAPI.pyx":47 * cdef Object ob = arg * retv = ob.obj[0] * return retv # <<<<<<<<<<<<<< * * cdef api PetscObject* PyPetscObject_GetPtr(object arg) except NULL: */ __pyx_r = __pyx_v_retv; goto __pyx_L0; /* "petsc4py/PETSc/CAPI.pyx":43 * return retv * * cdef api PetscObject PyPetscObject_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscObject retv = NULL * cdef Object ob = arg */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscObject_Get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/CAPI.pyx":49 * return retv * * cdef api PetscObject* PyPetscObject_GetPtr(object arg) except NULL: # <<<<<<<<<<<<<< * cdef PetscObject *retv = NULL * cdef Object ob = arg */ static PetscObject *__pyx_f_8petsc4py_5PETSc_PyPetscObject_GetPtr(PyObject *__pyx_v_arg) { PetscObject *__pyx_v_retv; struct PyPetscObjectObject *__pyx_v_ob = 0; PetscObject *__pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscObject *__pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscObject_GetPtr", 1); /* "petsc4py/PETSc/CAPI.pyx":50 * * cdef api PetscObject* PyPetscObject_GetPtr(object arg) except NULL: * cdef PetscObject *retv = NULL # <<<<<<<<<<<<<< * cdef Object ob = arg * retv = ob.obj */ __pyx_v_retv = NULL; /* "petsc4py/PETSc/CAPI.pyx":51 * cdef api PetscObject* PyPetscObject_GetPtr(object arg) except NULL: * cdef PetscObject *retv = NULL * cdef Object ob = arg # <<<<<<<<<<<<<< * retv = ob.obj * return retv */ if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_ptype_8petsc4py_5PETSc_Object)))) __PYX_ERR(66, 51, __pyx_L1_error) __pyx_t_1 = __pyx_v_arg; __Pyx_INCREF(__pyx_t_1); __pyx_v_ob = ((struct PyPetscObjectObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/CAPI.pyx":52 * cdef PetscObject *retv = NULL * cdef Object ob = arg * retv = ob.obj # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_v_ob->obj; __pyx_v_retv = __pyx_t_2; /* "petsc4py/PETSc/CAPI.pyx":53 * cdef Object ob = arg * retv = ob.obj * return retv # <<<<<<<<<<<<<< * * # -- Viewer -- */ __pyx_r = __pyx_v_retv; goto __pyx_L0; /* "petsc4py/PETSc/CAPI.pyx":49 * return retv * * cdef api PetscObject* PyPetscObject_GetPtr(object arg) except NULL: # <<<<<<<<<<<<<< * cdef PetscObject *retv = NULL * cdef Object ob = arg */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscObject_GetPtr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/CAPI.pyx":57 * # -- Viewer -- * * cdef api object PyPetscViewer_New(PetscViewer arg): # <<<<<<<<<<<<<< * cdef Viewer retv = Viewer() * setref(&retv.vwr, arg) */ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscViewer_New(PetscViewer __pyx_v_arg) { struct PyPetscViewerObject *__pyx_v_retv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscViewer_New", 1); /* "petsc4py/PETSc/CAPI.pyx":58 * * cdef api object PyPetscViewer_New(PetscViewer arg): * cdef Viewer retv = Viewer() # <<<<<<<<<<<<<< * setref(&retv.vwr, arg) * return retv */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Viewer)); if (unlikely(!__pyx_t_1)) __PYX_ERR(66, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_retv = ((struct PyPetscViewerObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/CAPI.pyx":59 * cdef api object PyPetscViewer_New(PetscViewer arg): * cdef Viewer retv = Viewer() * setref(&retv.vwr, arg) # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->vwr), __pyx_v_arg); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(66, 59, __pyx_L1_error) /* "petsc4py/PETSc/CAPI.pyx":60 * cdef Viewer retv = Viewer() * setref(&retv.vwr, arg) * return retv # <<<<<<<<<<<<<< * * cdef api PetscViewer PyPetscViewer_Get(object arg) except ? NULL: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_retv); __pyx_r = ((PyObject *)__pyx_v_retv); goto __pyx_L0; /* "petsc4py/PETSc/CAPI.pyx":57 * # -- Viewer -- * * cdef api object PyPetscViewer_New(PetscViewer arg): # <<<<<<<<<<<<<< * cdef Viewer retv = Viewer() * setref(&retv.vwr, arg) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscViewer_New", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_retv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/CAPI.pyx":62 * return retv * * cdef api PetscViewer PyPetscViewer_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscViewer retv = NULL * cdef Viewer ob = arg */ static PetscViewer __pyx_f_8petsc4py_5PETSc_PyPetscViewer_Get(PyObject *__pyx_v_arg) { PetscViewer __pyx_v_retv; struct PyPetscViewerObject *__pyx_v_ob = 0; PetscViewer __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscViewer __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscViewer_Get", 1); /* "petsc4py/PETSc/CAPI.pyx":63 * * cdef api PetscViewer PyPetscViewer_Get(object arg) except ? NULL: * cdef PetscViewer retv = NULL # <<<<<<<<<<<<<< * cdef Viewer ob = arg * retv = ob.vwr */ __pyx_v_retv = NULL; /* "petsc4py/PETSc/CAPI.pyx":64 * cdef api PetscViewer PyPetscViewer_Get(object arg) except ? NULL: * cdef PetscViewer retv = NULL * cdef Viewer ob = arg # <<<<<<<<<<<<<< * retv = ob.vwr * return retv */ if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_ptype_8petsc4py_5PETSc_Viewer)))) __PYX_ERR(66, 64, __pyx_L1_error) __pyx_t_1 = __pyx_v_arg; __Pyx_INCREF(__pyx_t_1); __pyx_v_ob = ((struct PyPetscViewerObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/CAPI.pyx":65 * cdef PetscViewer retv = NULL * cdef Viewer ob = arg * retv = ob.vwr # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_v_ob->vwr; __pyx_v_retv = __pyx_t_2; /* "petsc4py/PETSc/CAPI.pyx":66 * cdef Viewer ob = arg * retv = ob.vwr * return retv # <<<<<<<<<<<<<< * * # -- Random -- */ __pyx_r = __pyx_v_retv; goto __pyx_L0; /* "petsc4py/PETSc/CAPI.pyx":62 * return retv * * cdef api PetscViewer PyPetscViewer_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscViewer retv = NULL * cdef Viewer ob = arg */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscViewer_Get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/CAPI.pyx":70 * # -- Random -- * * cdef api object PyPetscRandom_New(PetscRandom arg): # <<<<<<<<<<<<<< * cdef Random retv = Random() * setref(&retv.rnd, arg) */ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscRandom_New(PetscRandom __pyx_v_arg) { struct PyPetscRandomObject *__pyx_v_retv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscRandom_New", 1); /* "petsc4py/PETSc/CAPI.pyx":71 * * cdef api object PyPetscRandom_New(PetscRandom arg): * cdef Random retv = Random() # <<<<<<<<<<<<<< * setref(&retv.rnd, arg) * return retv */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Random)); if (unlikely(!__pyx_t_1)) __PYX_ERR(66, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_retv = ((struct PyPetscRandomObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/CAPI.pyx":72 * cdef api object PyPetscRandom_New(PetscRandom arg): * cdef Random retv = Random() * setref(&retv.rnd, arg) # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->rnd), __pyx_v_arg); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(66, 72, __pyx_L1_error) /* "petsc4py/PETSc/CAPI.pyx":73 * cdef Random retv = Random() * setref(&retv.rnd, arg) * return retv # <<<<<<<<<<<<<< * * cdef api PetscRandom PyPetscRandom_Get(object arg) except ? NULL: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_retv); __pyx_r = ((PyObject *)__pyx_v_retv); goto __pyx_L0; /* "petsc4py/PETSc/CAPI.pyx":70 * # -- Random -- * * cdef api object PyPetscRandom_New(PetscRandom arg): # <<<<<<<<<<<<<< * cdef Random retv = Random() * setref(&retv.rnd, arg) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscRandom_New", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_retv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/CAPI.pyx":75 * return retv * * cdef api PetscRandom PyPetscRandom_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscRandom retv = NULL * cdef Random ob = arg */ static PetscRandom __pyx_f_8petsc4py_5PETSc_PyPetscRandom_Get(PyObject *__pyx_v_arg) { PetscRandom __pyx_v_retv; struct PyPetscRandomObject *__pyx_v_ob = 0; PetscRandom __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscRandom __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscRandom_Get", 1); /* "petsc4py/PETSc/CAPI.pyx":76 * * cdef api PetscRandom PyPetscRandom_Get(object arg) except ? NULL: * cdef PetscRandom retv = NULL # <<<<<<<<<<<<<< * cdef Random ob = arg * retv = ob.rnd */ __pyx_v_retv = NULL; /* "petsc4py/PETSc/CAPI.pyx":77 * cdef api PetscRandom PyPetscRandom_Get(object arg) except ? NULL: * cdef PetscRandom retv = NULL * cdef Random ob = arg # <<<<<<<<<<<<<< * retv = ob.rnd * return retv */ if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_ptype_8petsc4py_5PETSc_Random)))) __PYX_ERR(66, 77, __pyx_L1_error) __pyx_t_1 = __pyx_v_arg; __Pyx_INCREF(__pyx_t_1); __pyx_v_ob = ((struct PyPetscRandomObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/CAPI.pyx":78 * cdef PetscRandom retv = NULL * cdef Random ob = arg * retv = ob.rnd # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_v_ob->rnd; __pyx_v_retv = __pyx_t_2; /* "petsc4py/PETSc/CAPI.pyx":79 * cdef Random ob = arg * retv = ob.rnd * return retv # <<<<<<<<<<<<<< * * # -- Device -- */ __pyx_r = __pyx_v_retv; goto __pyx_L0; /* "petsc4py/PETSc/CAPI.pyx":75 * return retv * * cdef api PetscRandom PyPetscRandom_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscRandom retv = NULL * cdef Random ob = arg */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscRandom_Get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/CAPI.pyx":83 * # -- Device -- * * cdef api Device PyPetscDevice_New(PetscDevice arg): # <<<<<<<<<<<<<< * cdef Device ret = Device() * ret.device = arg */ static struct PyPetscDeviceObject *__pyx_f_8petsc4py_5PETSc_PyPetscDevice_New(PetscDevice __pyx_v_arg) { struct PyPetscDeviceObject *__pyx_v_ret = 0; struct PyPetscDeviceObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscDevice_New", 1); /* "petsc4py/PETSc/CAPI.pyx":84 * * cdef api Device PyPetscDevice_New(PetscDevice arg): * cdef Device ret = Device() # <<<<<<<<<<<<<< * ret.device = arg * return ret */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Device)); if (unlikely(!__pyx_t_1)) __PYX_ERR(66, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ret = ((struct PyPetscDeviceObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/CAPI.pyx":85 * cdef api Device PyPetscDevice_New(PetscDevice arg): * cdef Device ret = Device() * ret.device = arg # <<<<<<<<<<<<<< * return ret * */ __pyx_v_ret->device = __pyx_v_arg; /* "petsc4py/PETSc/CAPI.pyx":86 * cdef Device ret = Device() * ret.device = arg * return ret # <<<<<<<<<<<<<< * * cdef api PetscDevice PyPetscDevice_Get(object arg) except ? NULL: */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_ret); __pyx_r = __pyx_v_ret; goto __pyx_L0; /* "petsc4py/PETSc/CAPI.pyx":83 * # -- Device -- * * cdef api Device PyPetscDevice_New(PetscDevice arg): # <<<<<<<<<<<<<< * cdef Device ret = Device() * ret.device = arg */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscDevice_New", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ret); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/CAPI.pyx":88 * return ret * * cdef api PetscDevice PyPetscDevice_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef Device obj = arg * cdef PetscDevice ret = obj.device */ static PetscDevice __pyx_f_8petsc4py_5PETSc_PyPetscDevice_Get(PyObject *__pyx_v_arg) { struct PyPetscDeviceObject *__pyx_v_obj = 0; PetscDevice __pyx_v_ret; PetscDevice __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscDevice __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscDevice_Get", 1); /* "petsc4py/PETSc/CAPI.pyx":89 * * cdef api PetscDevice PyPetscDevice_Get(object arg) except ? NULL: * cdef Device obj = arg # <<<<<<<<<<<<<< * cdef PetscDevice ret = obj.device * return ret */ if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_ptype_8petsc4py_5PETSc_Device)))) __PYX_ERR(66, 89, __pyx_L1_error) __pyx_t_1 = __pyx_v_arg; __Pyx_INCREF(__pyx_t_1); __pyx_v_obj = ((struct PyPetscDeviceObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/CAPI.pyx":90 * cdef api PetscDevice PyPetscDevice_Get(object arg) except ? NULL: * cdef Device obj = arg * cdef PetscDevice ret = obj.device # <<<<<<<<<<<<<< * return ret * */ __pyx_t_2 = __pyx_v_obj->device; __pyx_v_ret = __pyx_t_2; /* "petsc4py/PETSc/CAPI.pyx":91 * cdef Device obj = arg * cdef PetscDevice ret = obj.device * return ret # <<<<<<<<<<<<<< * * # -- DeviceContext -- */ __pyx_r = __pyx_v_ret; goto __pyx_L0; /* "petsc4py/PETSc/CAPI.pyx":88 * return ret * * cdef api PetscDevice PyPetscDevice_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef Device obj = arg * cdef PetscDevice ret = obj.device */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscDevice_Get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_obj); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/CAPI.pyx":95 * # -- DeviceContext -- * * cdef api DeviceContext PyPetscDeviceContext_New(PetscDeviceContext arg): # <<<<<<<<<<<<<< * cdef DeviceContext retv = DeviceContext() * setref(&retv.dctx, arg) */ static struct PyPetscDeviceContextObject *__pyx_f_8petsc4py_5PETSc_PyPetscDeviceContext_New(PetscDeviceContext __pyx_v_arg) { struct PyPetscDeviceContextObject *__pyx_v_retv = 0; struct PyPetscDeviceContextObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscDeviceContext_New", 1); /* "petsc4py/PETSc/CAPI.pyx":96 * * cdef api DeviceContext PyPetscDeviceContext_New(PetscDeviceContext arg): * cdef DeviceContext retv = DeviceContext() # <<<<<<<<<<<<<< * setref(&retv.dctx, arg) * return retv */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DeviceContext)); if (unlikely(!__pyx_t_1)) __PYX_ERR(66, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_retv = ((struct PyPetscDeviceContextObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/CAPI.pyx":97 * cdef api DeviceContext PyPetscDeviceContext_New(PetscDeviceContext arg): * cdef DeviceContext retv = DeviceContext() * setref(&retv.dctx, arg) # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->dctx), __pyx_v_arg); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(66, 97, __pyx_L1_error) /* "petsc4py/PETSc/CAPI.pyx":98 * cdef DeviceContext retv = DeviceContext() * setref(&retv.dctx, arg) * return retv # <<<<<<<<<<<<<< * * cdef api PetscDeviceContext PyPetscDeviceContext_Get(object arg) except ? NULL: */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_retv); __pyx_r = __pyx_v_retv; goto __pyx_L0; /* "petsc4py/PETSc/CAPI.pyx":95 * # -- DeviceContext -- * * cdef api DeviceContext PyPetscDeviceContext_New(PetscDeviceContext arg): # <<<<<<<<<<<<<< * cdef DeviceContext retv = DeviceContext() * setref(&retv.dctx, arg) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscDeviceContext_New", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_retv); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/CAPI.pyx":100 * return retv * * cdef api PetscDeviceContext PyPetscDeviceContext_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef DeviceContext obj = arg * cdef PetscDeviceContext ret = obj.dctx */ static PetscDeviceContext __pyx_f_8petsc4py_5PETSc_PyPetscDeviceContext_Get(PyObject *__pyx_v_arg) { struct PyPetscDeviceContextObject *__pyx_v_obj = 0; PetscDeviceContext __pyx_v_ret; PetscDeviceContext __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscDeviceContext __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscDeviceContext_Get", 1); /* "petsc4py/PETSc/CAPI.pyx":101 * * cdef api PetscDeviceContext PyPetscDeviceContext_Get(object arg) except ? NULL: * cdef DeviceContext obj = arg # <<<<<<<<<<<<<< * cdef PetscDeviceContext ret = obj.dctx * return ret */ if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_ptype_8petsc4py_5PETSc_DeviceContext)))) __PYX_ERR(66, 101, __pyx_L1_error) __pyx_t_1 = __pyx_v_arg; __Pyx_INCREF(__pyx_t_1); __pyx_v_obj = ((struct PyPetscDeviceContextObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/CAPI.pyx":102 * cdef api PetscDeviceContext PyPetscDeviceContext_Get(object arg) except ? NULL: * cdef DeviceContext obj = arg * cdef PetscDeviceContext ret = obj.dctx # <<<<<<<<<<<<<< * return ret * */ __pyx_t_2 = __pyx_v_obj->dctx; __pyx_v_ret = __pyx_t_2; /* "petsc4py/PETSc/CAPI.pyx":103 * cdef DeviceContext obj = arg * cdef PetscDeviceContext ret = obj.dctx * return ret # <<<<<<<<<<<<<< * * # -- IS -- */ __pyx_r = __pyx_v_ret; goto __pyx_L0; /* "petsc4py/PETSc/CAPI.pyx":100 * return retv * * cdef api PetscDeviceContext PyPetscDeviceContext_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef DeviceContext obj = arg * cdef PetscDeviceContext ret = obj.dctx */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscDeviceContext_Get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_obj); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/CAPI.pyx":107 * # -- IS -- * * cdef api object PyPetscIS_New(PetscIS arg): # <<<<<<<<<<<<<< * cdef IS retv = IS() * setref(&retv.iset, arg) */ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscIS_New(IS __pyx_v_arg) { struct PyPetscISObject *__pyx_v_retv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscIS_New", 1); /* "petsc4py/PETSc/CAPI.pyx":108 * * cdef api object PyPetscIS_New(PetscIS arg): * cdef IS retv = IS() # <<<<<<<<<<<<<< * setref(&retv.iset, arg) * return retv */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_1)) __PYX_ERR(66, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_retv = ((struct PyPetscISObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/CAPI.pyx":109 * cdef api object PyPetscIS_New(PetscIS arg): * cdef IS retv = IS() * setref(&retv.iset, arg) # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->iset), __pyx_v_arg); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(66, 109, __pyx_L1_error) /* "petsc4py/PETSc/CAPI.pyx":110 * cdef IS retv = IS() * setref(&retv.iset, arg) * return retv # <<<<<<<<<<<<<< * * cdef api PetscIS PyPetscIS_Get(object arg) except? NULL: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_retv); __pyx_r = ((PyObject *)__pyx_v_retv); goto __pyx_L0; /* "petsc4py/PETSc/CAPI.pyx":107 * # -- IS -- * * cdef api object PyPetscIS_New(PetscIS arg): # <<<<<<<<<<<<<< * cdef IS retv = IS() * setref(&retv.iset, arg) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscIS_New", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_retv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/CAPI.pyx":112 * return retv * * cdef api PetscIS PyPetscIS_Get(object arg) except? NULL: # <<<<<<<<<<<<<< * cdef PetscIS retv = NULL * cdef IS ob = arg */ static IS __pyx_f_8petsc4py_5PETSc_PyPetscIS_Get(PyObject *__pyx_v_arg) { IS __pyx_v_retv; struct PyPetscISObject *__pyx_v_ob = 0; IS __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; IS __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscIS_Get", 1); /* "petsc4py/PETSc/CAPI.pyx":113 * * cdef api PetscIS PyPetscIS_Get(object arg) except? NULL: * cdef PetscIS retv = NULL # <<<<<<<<<<<<<< * cdef IS ob = arg * retv = ob.iset */ __pyx_v_retv = NULL; /* "petsc4py/PETSc/CAPI.pyx":114 * cdef api PetscIS PyPetscIS_Get(object arg) except? NULL: * cdef PetscIS retv = NULL * cdef IS ob = arg # <<<<<<<<<<<<<< * retv = ob.iset * return retv */ if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(66, 114, __pyx_L1_error) __pyx_t_1 = __pyx_v_arg; __Pyx_INCREF(__pyx_t_1); __pyx_v_ob = ((struct PyPetscISObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/CAPI.pyx":115 * cdef PetscIS retv = NULL * cdef IS ob = arg * retv = ob.iset # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_v_ob->iset; __pyx_v_retv = __pyx_t_2; /* "petsc4py/PETSc/CAPI.pyx":116 * cdef IS ob = arg * retv = ob.iset * return retv # <<<<<<<<<<<<<< * * # -- LGMap -- */ __pyx_r = __pyx_v_retv; goto __pyx_L0; /* "petsc4py/PETSc/CAPI.pyx":112 * return retv * * cdef api PetscIS PyPetscIS_Get(object arg) except? NULL: # <<<<<<<<<<<<<< * cdef PetscIS retv = NULL * cdef IS ob = arg */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscIS_Get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/CAPI.pyx":120 * # -- LGMap -- * * cdef api object PyPetscLGMap_New(PetscLGMap arg): # <<<<<<<<<<<<<< * cdef LGMap retv = LGMap() * setref(&retv.lgm, arg) */ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscLGMap_New(ISLocalToGlobalMapping __pyx_v_arg) { struct PyPetscLGMapObject *__pyx_v_retv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscLGMap_New", 1); /* "petsc4py/PETSc/CAPI.pyx":121 * * cdef api object PyPetscLGMap_New(PetscLGMap arg): * cdef LGMap retv = LGMap() # <<<<<<<<<<<<<< * setref(&retv.lgm, arg) * return retv */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_LGMap)); if (unlikely(!__pyx_t_1)) __PYX_ERR(66, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_retv = ((struct PyPetscLGMapObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/CAPI.pyx":122 * cdef api object PyPetscLGMap_New(PetscLGMap arg): * cdef LGMap retv = LGMap() * setref(&retv.lgm, arg) # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->lgm), __pyx_v_arg); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(66, 122, __pyx_L1_error) /* "petsc4py/PETSc/CAPI.pyx":123 * cdef LGMap retv = LGMap() * setref(&retv.lgm, arg) * return retv # <<<<<<<<<<<<<< * * cdef api PetscLGMap PyPetscLGMap_Get(object arg) except ? NULL: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_retv); __pyx_r = ((PyObject *)__pyx_v_retv); goto __pyx_L0; /* "petsc4py/PETSc/CAPI.pyx":120 * # -- LGMap -- * * cdef api object PyPetscLGMap_New(PetscLGMap arg): # <<<<<<<<<<<<<< * cdef LGMap retv = LGMap() * setref(&retv.lgm, arg) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscLGMap_New", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_retv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/CAPI.pyx":125 * return retv * * cdef api PetscLGMap PyPetscLGMap_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscLGMap retv = NULL * cdef LGMap ob = arg */ static ISLocalToGlobalMapping __pyx_f_8petsc4py_5PETSc_PyPetscLGMap_Get(PyObject *__pyx_v_arg) { ISLocalToGlobalMapping __pyx_v_retv; struct PyPetscLGMapObject *__pyx_v_ob = 0; ISLocalToGlobalMapping __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; ISLocalToGlobalMapping __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscLGMap_Get", 1); /* "petsc4py/PETSc/CAPI.pyx":126 * * cdef api PetscLGMap PyPetscLGMap_Get(object arg) except ? NULL: * cdef PetscLGMap retv = NULL # <<<<<<<<<<<<<< * cdef LGMap ob = arg * retv = ob.lgm */ __pyx_v_retv = NULL; /* "petsc4py/PETSc/CAPI.pyx":127 * cdef api PetscLGMap PyPetscLGMap_Get(object arg) except ? NULL: * cdef PetscLGMap retv = NULL * cdef LGMap ob = arg # <<<<<<<<<<<<<< * retv = ob.lgm * return retv */ if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_ptype_8petsc4py_5PETSc_LGMap)))) __PYX_ERR(66, 127, __pyx_L1_error) __pyx_t_1 = __pyx_v_arg; __Pyx_INCREF(__pyx_t_1); __pyx_v_ob = ((struct PyPetscLGMapObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/CAPI.pyx":128 * cdef PetscLGMap retv = NULL * cdef LGMap ob = arg * retv = ob.lgm # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_v_ob->lgm; __pyx_v_retv = __pyx_t_2; /* "petsc4py/PETSc/CAPI.pyx":129 * cdef LGMap ob = arg * retv = ob.lgm * return retv # <<<<<<<<<<<<<< * * # -- SF -- */ __pyx_r = __pyx_v_retv; goto __pyx_L0; /* "petsc4py/PETSc/CAPI.pyx":125 * return retv * * cdef api PetscLGMap PyPetscLGMap_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscLGMap retv = NULL * cdef LGMap ob = arg */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscLGMap_Get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/CAPI.pyx":133 * # -- SF -- * * cdef api object PyPetscSF_New(PetscSF arg): # <<<<<<<<<<<<<< * cdef SF retv = SF() * setref(&retv.sf, arg) */ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscSF_New(PetscSF __pyx_v_arg) { struct PyPetscSFObject *__pyx_v_retv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscSF_New", 1); /* "petsc4py/PETSc/CAPI.pyx":134 * * cdef api object PyPetscSF_New(PetscSF arg): * cdef SF retv = SF() # <<<<<<<<<<<<<< * setref(&retv.sf, arg) * return retv */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SF)); if (unlikely(!__pyx_t_1)) __PYX_ERR(66, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_retv = ((struct PyPetscSFObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/CAPI.pyx":135 * cdef api object PyPetscSF_New(PetscSF arg): * cdef SF retv = SF() * setref(&retv.sf, arg) # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->sf), __pyx_v_arg); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(66, 135, __pyx_L1_error) /* "petsc4py/PETSc/CAPI.pyx":136 * cdef SF retv = SF() * setref(&retv.sf, arg) * return retv # <<<<<<<<<<<<<< * * cdef api PetscSF PyPetscSF_Get(object arg) except? NULL: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_retv); __pyx_r = ((PyObject *)__pyx_v_retv); goto __pyx_L0; /* "petsc4py/PETSc/CAPI.pyx":133 * # -- SF -- * * cdef api object PyPetscSF_New(PetscSF arg): # <<<<<<<<<<<<<< * cdef SF retv = SF() * setref(&retv.sf, arg) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscSF_New", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_retv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/CAPI.pyx":138 * return retv * * cdef api PetscSF PyPetscSF_Get(object arg) except? NULL: # <<<<<<<<<<<<<< * cdef PetscSF retv = NULL * cdef SF ob = arg */ static PetscSF __pyx_f_8petsc4py_5PETSc_PyPetscSF_Get(PyObject *__pyx_v_arg) { PetscSF __pyx_v_retv; struct PyPetscSFObject *__pyx_v_ob = 0; PetscSF __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscSF __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscSF_Get", 1); /* "petsc4py/PETSc/CAPI.pyx":139 * * cdef api PetscSF PyPetscSF_Get(object arg) except? NULL: * cdef PetscSF retv = NULL # <<<<<<<<<<<<<< * cdef SF ob = arg * retv = ob.sf */ __pyx_v_retv = NULL; /* "petsc4py/PETSc/CAPI.pyx":140 * cdef api PetscSF PyPetscSF_Get(object arg) except? NULL: * cdef PetscSF retv = NULL * cdef SF ob = arg # <<<<<<<<<<<<<< * retv = ob.sf * return retv */ if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_ptype_8petsc4py_5PETSc_SF)))) __PYX_ERR(66, 140, __pyx_L1_error) __pyx_t_1 = __pyx_v_arg; __Pyx_INCREF(__pyx_t_1); __pyx_v_ob = ((struct PyPetscSFObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/CAPI.pyx":141 * cdef PetscSF retv = NULL * cdef SF ob = arg * retv = ob.sf # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_v_ob->sf; __pyx_v_retv = __pyx_t_2; /* "petsc4py/PETSc/CAPI.pyx":142 * cdef SF ob = arg * retv = ob.sf * return retv # <<<<<<<<<<<<<< * * # -- Vec -- */ __pyx_r = __pyx_v_retv; goto __pyx_L0; /* "petsc4py/PETSc/CAPI.pyx":138 * return retv * * cdef api PetscSF PyPetscSF_Get(object arg) except? NULL: # <<<<<<<<<<<<<< * cdef PetscSF retv = NULL * cdef SF ob = arg */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscSF_Get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/CAPI.pyx":146 * # -- Vec -- * * cdef api object PyPetscVec_New(PetscVec arg): # <<<<<<<<<<<<<< * cdef Vec retv = Vec() * setref(&retv.vec, arg) */ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscVec_New(Vec __pyx_v_arg) { struct PyPetscVecObject *__pyx_v_retv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscVec_New", 1); /* "petsc4py/PETSc/CAPI.pyx":147 * * cdef api object PyPetscVec_New(PetscVec arg): * cdef Vec retv = Vec() # <<<<<<<<<<<<<< * setref(&retv.vec, arg) * return retv */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(66, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_retv = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/CAPI.pyx":148 * cdef api object PyPetscVec_New(PetscVec arg): * cdef Vec retv = Vec() * setref(&retv.vec, arg) # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->vec), __pyx_v_arg); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(66, 148, __pyx_L1_error) /* "petsc4py/PETSc/CAPI.pyx":149 * cdef Vec retv = Vec() * setref(&retv.vec, arg) * return retv # <<<<<<<<<<<<<< * * cdef api PetscVec PyPetscVec_Get(object arg) except ? NULL: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_retv); __pyx_r = ((PyObject *)__pyx_v_retv); goto __pyx_L0; /* "petsc4py/PETSc/CAPI.pyx":146 * # -- Vec -- * * cdef api object PyPetscVec_New(PetscVec arg): # <<<<<<<<<<<<<< * cdef Vec retv = Vec() * setref(&retv.vec, arg) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscVec_New", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_retv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/CAPI.pyx":151 * return retv * * cdef api PetscVec PyPetscVec_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscVec retv = NULL * cdef Vec ob = arg */ static Vec __pyx_f_8petsc4py_5PETSc_PyPetscVec_Get(PyObject *__pyx_v_arg) { Vec __pyx_v_retv; struct PyPetscVecObject *__pyx_v_ob = 0; Vec __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Vec __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscVec_Get", 1); /* "petsc4py/PETSc/CAPI.pyx":152 * * cdef api PetscVec PyPetscVec_Get(object arg) except ? NULL: * cdef PetscVec retv = NULL # <<<<<<<<<<<<<< * cdef Vec ob = arg * retv = ob.vec */ __pyx_v_retv = NULL; /* "petsc4py/PETSc/CAPI.pyx":153 * cdef api PetscVec PyPetscVec_Get(object arg) except ? NULL: * cdef PetscVec retv = NULL * cdef Vec ob = arg # <<<<<<<<<<<<<< * retv = ob.vec * return retv */ if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_ptype_8petsc4py_5PETSc_Vec)))) __PYX_ERR(66, 153, __pyx_L1_error) __pyx_t_1 = __pyx_v_arg; __Pyx_INCREF(__pyx_t_1); __pyx_v_ob = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/CAPI.pyx":154 * cdef PetscVec retv = NULL * cdef Vec ob = arg * retv = ob.vec # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_v_ob->vec; __pyx_v_retv = __pyx_t_2; /* "petsc4py/PETSc/CAPI.pyx":155 * cdef Vec ob = arg * retv = ob.vec * return retv # <<<<<<<<<<<<<< * * # -- Scatter -- */ __pyx_r = __pyx_v_retv; goto __pyx_L0; /* "petsc4py/PETSc/CAPI.pyx":151 * return retv * * cdef api PetscVec PyPetscVec_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscVec retv = NULL * cdef Vec ob = arg */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscVec_Get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/CAPI.pyx":159 * # -- Scatter -- * * cdef api object PyPetscScatter_New(PetscScatter arg): # <<<<<<<<<<<<<< * cdef Scatter retv = Scatter() * setref(&retv.sct, arg) */ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscScatter_New(VecScatter __pyx_v_arg) { struct PyPetscScatterObject *__pyx_v_retv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscScatter_New", 1); /* "petsc4py/PETSc/CAPI.pyx":160 * * cdef api object PyPetscScatter_New(PetscScatter arg): * cdef Scatter retv = Scatter() # <<<<<<<<<<<<<< * setref(&retv.sct, arg) * return retv */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Scatter)); if (unlikely(!__pyx_t_1)) __PYX_ERR(66, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_retv = ((struct PyPetscScatterObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/CAPI.pyx":161 * cdef api object PyPetscScatter_New(PetscScatter arg): * cdef Scatter retv = Scatter() * setref(&retv.sct, arg) # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->sct), __pyx_v_arg); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(66, 161, __pyx_L1_error) /* "petsc4py/PETSc/CAPI.pyx":162 * cdef Scatter retv = Scatter() * setref(&retv.sct, arg) * return retv # <<<<<<<<<<<<<< * * cdef api PetscScatter PyPetscScatter_Get(object arg) except ? NULL: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_retv); __pyx_r = ((PyObject *)__pyx_v_retv); goto __pyx_L0; /* "petsc4py/PETSc/CAPI.pyx":159 * # -- Scatter -- * * cdef api object PyPetscScatter_New(PetscScatter arg): # <<<<<<<<<<<<<< * cdef Scatter retv = Scatter() * setref(&retv.sct, arg) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscScatter_New", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_retv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/CAPI.pyx":164 * return retv * * cdef api PetscScatter PyPetscScatter_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscScatter retv = NULL * cdef Scatter ob = arg */ static VecScatter __pyx_f_8petsc4py_5PETSc_PyPetscScatter_Get(PyObject *__pyx_v_arg) { VecScatter __pyx_v_retv; struct PyPetscScatterObject *__pyx_v_ob = 0; VecScatter __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; VecScatter __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscScatter_Get", 1); /* "petsc4py/PETSc/CAPI.pyx":165 * * cdef api PetscScatter PyPetscScatter_Get(object arg) except ? NULL: * cdef PetscScatter retv = NULL # <<<<<<<<<<<<<< * cdef Scatter ob = arg * retv = ob.sct */ __pyx_v_retv = NULL; /* "petsc4py/PETSc/CAPI.pyx":166 * cdef api PetscScatter PyPetscScatter_Get(object arg) except ? NULL: * cdef PetscScatter retv = NULL * cdef Scatter ob = arg # <<<<<<<<<<<<<< * retv = ob.sct * return retv */ if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_ptype_8petsc4py_5PETSc_Scatter)))) __PYX_ERR(66, 166, __pyx_L1_error) __pyx_t_1 = __pyx_v_arg; __Pyx_INCREF(__pyx_t_1); __pyx_v_ob = ((struct PyPetscScatterObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/CAPI.pyx":167 * cdef PetscScatter retv = NULL * cdef Scatter ob = arg * retv = ob.sct # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_v_ob->sct; __pyx_v_retv = __pyx_t_2; /* "petsc4py/PETSc/CAPI.pyx":168 * cdef Scatter ob = arg * retv = ob.sct * return retv # <<<<<<<<<<<<<< * * # -- Section -- */ __pyx_r = __pyx_v_retv; goto __pyx_L0; /* "petsc4py/PETSc/CAPI.pyx":164 * return retv * * cdef api PetscScatter PyPetscScatter_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscScatter retv = NULL * cdef Scatter ob = arg */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscScatter_Get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/CAPI.pyx":172 * # -- Section -- * * cdef api object PyPetscSection_New(PetscSection arg): # <<<<<<<<<<<<<< * cdef Section retv = Section() * setref(&retv.sec, arg) */ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscSection_New(PetscSection __pyx_v_arg) { struct PyPetscSectionObject *__pyx_v_retv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscSection_New", 1); /* "petsc4py/PETSc/CAPI.pyx":173 * * cdef api object PyPetscSection_New(PetscSection arg): * cdef Section retv = Section() # <<<<<<<<<<<<<< * setref(&retv.sec, arg) * return retv */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Section)); if (unlikely(!__pyx_t_1)) __PYX_ERR(66, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_retv = ((struct PyPetscSectionObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/CAPI.pyx":174 * cdef api object PyPetscSection_New(PetscSection arg): * cdef Section retv = Section() * setref(&retv.sec, arg) # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->sec), __pyx_v_arg); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(66, 174, __pyx_L1_error) /* "petsc4py/PETSc/CAPI.pyx":175 * cdef Section retv = Section() * setref(&retv.sec, arg) * return retv # <<<<<<<<<<<<<< * * cdef api PetscSection PyPetscSection_Get(object arg) except ? NULL: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_retv); __pyx_r = ((PyObject *)__pyx_v_retv); goto __pyx_L0; /* "petsc4py/PETSc/CAPI.pyx":172 * # -- Section -- * * cdef api object PyPetscSection_New(PetscSection arg): # <<<<<<<<<<<<<< * cdef Section retv = Section() * setref(&retv.sec, arg) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscSection_New", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_retv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/CAPI.pyx":177 * return retv * * cdef api PetscSection PyPetscSection_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscSection retv = NULL * cdef Section ob = arg */ static PetscSection __pyx_f_8petsc4py_5PETSc_PyPetscSection_Get(PyObject *__pyx_v_arg) { PetscSection __pyx_v_retv; struct PyPetscSectionObject *__pyx_v_ob = 0; PetscSection __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscSection __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscSection_Get", 1); /* "petsc4py/PETSc/CAPI.pyx":178 * * cdef api PetscSection PyPetscSection_Get(object arg) except ? NULL: * cdef PetscSection retv = NULL # <<<<<<<<<<<<<< * cdef Section ob = arg * retv = ob.sec */ __pyx_v_retv = NULL; /* "petsc4py/PETSc/CAPI.pyx":179 * cdef api PetscSection PyPetscSection_Get(object arg) except ? NULL: * cdef PetscSection retv = NULL * cdef Section ob = arg # <<<<<<<<<<<<<< * retv = ob.sec * return retv */ if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_ptype_8petsc4py_5PETSc_Section)))) __PYX_ERR(66, 179, __pyx_L1_error) __pyx_t_1 = __pyx_v_arg; __Pyx_INCREF(__pyx_t_1); __pyx_v_ob = ((struct PyPetscSectionObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/CAPI.pyx":180 * cdef PetscSection retv = NULL * cdef Section ob = arg * retv = ob.sec # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_v_ob->sec; __pyx_v_retv = __pyx_t_2; /* "petsc4py/PETSc/CAPI.pyx":181 * cdef Section ob = arg * retv = ob.sec * return retv # <<<<<<<<<<<<<< * * # -- Mat -- */ __pyx_r = __pyx_v_retv; goto __pyx_L0; /* "petsc4py/PETSc/CAPI.pyx":177 * return retv * * cdef api PetscSection PyPetscSection_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscSection retv = NULL * cdef Section ob = arg */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscSection_Get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/CAPI.pyx":185 * # -- Mat -- * * cdef api object PyPetscMat_New(PetscMat arg): # <<<<<<<<<<<<<< * cdef Mat retv = Mat() * setref(&retv.mat, arg) */ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscMat_New(Mat __pyx_v_arg) { struct PyPetscMatObject *__pyx_v_retv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscMat_New", 1); /* "petsc4py/PETSc/CAPI.pyx":186 * * cdef api object PyPetscMat_New(PetscMat arg): * cdef Mat retv = Mat() # <<<<<<<<<<<<<< * setref(&retv.mat, arg) * return retv */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(66, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_retv = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/CAPI.pyx":187 * cdef api object PyPetscMat_New(PetscMat arg): * cdef Mat retv = Mat() * setref(&retv.mat, arg) # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->mat), __pyx_v_arg); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(66, 187, __pyx_L1_error) /* "petsc4py/PETSc/CAPI.pyx":188 * cdef Mat retv = Mat() * setref(&retv.mat, arg) * return retv # <<<<<<<<<<<<<< * * cdef api PetscMat PyPetscMat_Get(object arg) except ? NULL: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_retv); __pyx_r = ((PyObject *)__pyx_v_retv); goto __pyx_L0; /* "petsc4py/PETSc/CAPI.pyx":185 * # -- Mat -- * * cdef api object PyPetscMat_New(PetscMat arg): # <<<<<<<<<<<<<< * cdef Mat retv = Mat() * setref(&retv.mat, arg) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscMat_New", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_retv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/CAPI.pyx":190 * return retv * * cdef api PetscMat PyPetscMat_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscMat retv = NULL * cdef Mat ob = arg */ static Mat __pyx_f_8petsc4py_5PETSc_PyPetscMat_Get(PyObject *__pyx_v_arg) { Mat __pyx_v_retv; struct PyPetscMatObject *__pyx_v_ob = 0; Mat __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Mat __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscMat_Get", 1); /* "petsc4py/PETSc/CAPI.pyx":191 * * cdef api PetscMat PyPetscMat_Get(object arg) except ? NULL: * cdef PetscMat retv = NULL # <<<<<<<<<<<<<< * cdef Mat ob = arg * retv = ob.mat */ __pyx_v_retv = NULL; /* "petsc4py/PETSc/CAPI.pyx":192 * cdef api PetscMat PyPetscMat_Get(object arg) except ? NULL: * cdef PetscMat retv = NULL * cdef Mat ob = arg # <<<<<<<<<<<<<< * retv = ob.mat * return retv */ if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_ptype_8petsc4py_5PETSc_Mat)))) __PYX_ERR(66, 192, __pyx_L1_error) __pyx_t_1 = __pyx_v_arg; __Pyx_INCREF(__pyx_t_1); __pyx_v_ob = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/CAPI.pyx":193 * cdef PetscMat retv = NULL * cdef Mat ob = arg * retv = ob.mat # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_v_ob->mat; __pyx_v_retv = __pyx_t_2; /* "petsc4py/PETSc/CAPI.pyx":194 * cdef Mat ob = arg * retv = ob.mat * return retv # <<<<<<<<<<<<<< * * # -- MatPartitioning -- */ __pyx_r = __pyx_v_retv; goto __pyx_L0; /* "petsc4py/PETSc/CAPI.pyx":190 * return retv * * cdef api PetscMat PyPetscMat_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscMat retv = NULL * cdef Mat ob = arg */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscMat_Get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/CAPI.pyx":198 * # -- MatPartitioning -- * * cdef api object PyPetscMatPartitioning_New(PetscMatPartitioning arg): # <<<<<<<<<<<<<< * cdef MatPartitioning retv = MatPartitioning() * setref(&retv.part, arg) */ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscMatPartitioning_New(MatPartitioning __pyx_v_arg) { struct PyPetscMatPartitioningObject *__pyx_v_retv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscMatPartitioning_New", 1); /* "petsc4py/PETSc/CAPI.pyx":199 * * cdef api object PyPetscMatPartitioning_New(PetscMatPartitioning arg): * cdef MatPartitioning retv = MatPartitioning() # <<<<<<<<<<<<<< * setref(&retv.part, arg) * return retv */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_MatPartitioning)); if (unlikely(!__pyx_t_1)) __PYX_ERR(66, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_retv = ((struct PyPetscMatPartitioningObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/CAPI.pyx":200 * cdef api object PyPetscMatPartitioning_New(PetscMatPartitioning arg): * cdef MatPartitioning retv = MatPartitioning() * setref(&retv.part, arg) # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->part), __pyx_v_arg); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(66, 200, __pyx_L1_error) /* "petsc4py/PETSc/CAPI.pyx":201 * cdef MatPartitioning retv = MatPartitioning() * setref(&retv.part, arg) * return retv # <<<<<<<<<<<<<< * * cdef api PetscMatPartitioning PyPetscMatPartitioning_Get(object arg) except ? NULL: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_retv); __pyx_r = ((PyObject *)__pyx_v_retv); goto __pyx_L0; /* "petsc4py/PETSc/CAPI.pyx":198 * # -- MatPartitioning -- * * cdef api object PyPetscMatPartitioning_New(PetscMatPartitioning arg): # <<<<<<<<<<<<<< * cdef MatPartitioning retv = MatPartitioning() * setref(&retv.part, arg) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscMatPartitioning_New", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_retv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/CAPI.pyx":203 * return retv * * cdef api PetscMatPartitioning PyPetscMatPartitioning_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscMatPartitioning retv = NULL * cdef MatPartitioning ob = arg */ static MatPartitioning __pyx_f_8petsc4py_5PETSc_PyPetscMatPartitioning_Get(PyObject *__pyx_v_arg) { MatPartitioning __pyx_v_retv; struct PyPetscMatPartitioningObject *__pyx_v_ob = 0; MatPartitioning __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; MatPartitioning __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscMatPartitioning_Get", 1); /* "petsc4py/PETSc/CAPI.pyx":204 * * cdef api PetscMatPartitioning PyPetscMatPartitioning_Get(object arg) except ? NULL: * cdef PetscMatPartitioning retv = NULL # <<<<<<<<<<<<<< * cdef MatPartitioning ob = arg * retv = ob.part */ __pyx_v_retv = NULL; /* "petsc4py/PETSc/CAPI.pyx":205 * cdef api PetscMatPartitioning PyPetscMatPartitioning_Get(object arg) except ? NULL: * cdef PetscMatPartitioning retv = NULL * cdef MatPartitioning ob = arg # <<<<<<<<<<<<<< * retv = ob.part * return retv */ if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_ptype_8petsc4py_5PETSc_MatPartitioning)))) __PYX_ERR(66, 205, __pyx_L1_error) __pyx_t_1 = __pyx_v_arg; __Pyx_INCREF(__pyx_t_1); __pyx_v_ob = ((struct PyPetscMatPartitioningObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/CAPI.pyx":206 * cdef PetscMatPartitioning retv = NULL * cdef MatPartitioning ob = arg * retv = ob.part # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_v_ob->part; __pyx_v_retv = __pyx_t_2; /* "petsc4py/PETSc/CAPI.pyx":207 * cdef MatPartitioning ob = arg * retv = ob.part * return retv # <<<<<<<<<<<<<< * * # -- PC -- */ __pyx_r = __pyx_v_retv; goto __pyx_L0; /* "petsc4py/PETSc/CAPI.pyx":203 * return retv * * cdef api PetscMatPartitioning PyPetscMatPartitioning_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscMatPartitioning retv = NULL * cdef MatPartitioning ob = arg */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscMatPartitioning_Get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/CAPI.pyx":211 * # -- PC -- * * cdef api object PyPetscPC_New(PetscPC arg): # <<<<<<<<<<<<<< * cdef PC retv = PC() * setref(&retv.pc, arg) */ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscPC_New(PC __pyx_v_arg) { struct PyPetscPCObject *__pyx_v_retv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscPC_New", 1); /* "petsc4py/PETSc/CAPI.pyx":212 * * cdef api object PyPetscPC_New(PetscPC arg): * cdef PC retv = PC() # <<<<<<<<<<<<<< * setref(&retv.pc, arg) * return retv */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_PC)); if (unlikely(!__pyx_t_1)) __PYX_ERR(66, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_retv = ((struct PyPetscPCObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/CAPI.pyx":213 * cdef api object PyPetscPC_New(PetscPC arg): * cdef PC retv = PC() * setref(&retv.pc, arg) # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->pc), __pyx_v_arg); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(66, 213, __pyx_L1_error) /* "petsc4py/PETSc/CAPI.pyx":214 * cdef PC retv = PC() * setref(&retv.pc, arg) * return retv # <<<<<<<<<<<<<< * * cdef api PetscPC PyPetscPC_Get(object arg) except ? NULL: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_retv); __pyx_r = ((PyObject *)__pyx_v_retv); goto __pyx_L0; /* "petsc4py/PETSc/CAPI.pyx":211 * # -- PC -- * * cdef api object PyPetscPC_New(PetscPC arg): # <<<<<<<<<<<<<< * cdef PC retv = PC() * setref(&retv.pc, arg) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscPC_New", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_retv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/CAPI.pyx":216 * return retv * * cdef api PetscPC PyPetscPC_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscPC retv = NULL * cdef PC ob = arg */ static PC __pyx_f_8petsc4py_5PETSc_PyPetscPC_Get(PyObject *__pyx_v_arg) { PC __pyx_v_retv; struct PyPetscPCObject *__pyx_v_ob = 0; PC __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PC __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscPC_Get", 1); /* "petsc4py/PETSc/CAPI.pyx":217 * * cdef api PetscPC PyPetscPC_Get(object arg) except ? NULL: * cdef PetscPC retv = NULL # <<<<<<<<<<<<<< * cdef PC ob = arg * retv = ob.pc */ __pyx_v_retv = NULL; /* "petsc4py/PETSc/CAPI.pyx":218 * cdef api PetscPC PyPetscPC_Get(object arg) except ? NULL: * cdef PetscPC retv = NULL * cdef PC ob = arg # <<<<<<<<<<<<<< * retv = ob.pc * return retv */ if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_ptype_8petsc4py_5PETSc_PC)))) __PYX_ERR(66, 218, __pyx_L1_error) __pyx_t_1 = __pyx_v_arg; __Pyx_INCREF(__pyx_t_1); __pyx_v_ob = ((struct PyPetscPCObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/CAPI.pyx":219 * cdef PetscPC retv = NULL * cdef PC ob = arg * retv = ob.pc # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_v_ob->pc; __pyx_v_retv = __pyx_t_2; /* "petsc4py/PETSc/CAPI.pyx":220 * cdef PC ob = arg * retv = ob.pc * return retv # <<<<<<<<<<<<<< * * # -- KSP -- */ __pyx_r = __pyx_v_retv; goto __pyx_L0; /* "petsc4py/PETSc/CAPI.pyx":216 * return retv * * cdef api PetscPC PyPetscPC_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscPC retv = NULL * cdef PC ob = arg */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscPC_Get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/CAPI.pyx":224 * # -- KSP -- * * cdef api object PyPetscKSP_New(PetscKSP arg): # <<<<<<<<<<<<<< * cdef KSP retv = KSP() * setref(&retv.ksp, arg) */ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscKSP_New(KSP __pyx_v_arg) { struct PyPetscKSPObject *__pyx_v_retv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscKSP_New", 1); /* "petsc4py/PETSc/CAPI.pyx":225 * * cdef api object PyPetscKSP_New(PetscKSP arg): * cdef KSP retv = KSP() # <<<<<<<<<<<<<< * setref(&retv.ksp, arg) * return retv */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_KSP)); if (unlikely(!__pyx_t_1)) __PYX_ERR(66, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_retv = ((struct PyPetscKSPObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/CAPI.pyx":226 * cdef api object PyPetscKSP_New(PetscKSP arg): * cdef KSP retv = KSP() * setref(&retv.ksp, arg) # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->ksp), __pyx_v_arg); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(66, 226, __pyx_L1_error) /* "petsc4py/PETSc/CAPI.pyx":227 * cdef KSP retv = KSP() * setref(&retv.ksp, arg) * return retv # <<<<<<<<<<<<<< * * cdef api PetscKSP PyPetscKSP_Get(object arg) except ? NULL: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_retv); __pyx_r = ((PyObject *)__pyx_v_retv); goto __pyx_L0; /* "petsc4py/PETSc/CAPI.pyx":224 * # -- KSP -- * * cdef api object PyPetscKSP_New(PetscKSP arg): # <<<<<<<<<<<<<< * cdef KSP retv = KSP() * setref(&retv.ksp, arg) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscKSP_New", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_retv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/CAPI.pyx":229 * return retv * * cdef api PetscKSP PyPetscKSP_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscKSP retv = NULL * cdef KSP ob = arg */ static KSP __pyx_f_8petsc4py_5PETSc_PyPetscKSP_Get(PyObject *__pyx_v_arg) { KSP __pyx_v_retv; struct PyPetscKSPObject *__pyx_v_ob = 0; KSP __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; KSP __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscKSP_Get", 1); /* "petsc4py/PETSc/CAPI.pyx":230 * * cdef api PetscKSP PyPetscKSP_Get(object arg) except ? NULL: * cdef PetscKSP retv = NULL # <<<<<<<<<<<<<< * cdef KSP ob = arg * retv = ob.ksp */ __pyx_v_retv = NULL; /* "petsc4py/PETSc/CAPI.pyx":231 * cdef api PetscKSP PyPetscKSP_Get(object arg) except ? NULL: * cdef PetscKSP retv = NULL * cdef KSP ob = arg # <<<<<<<<<<<<<< * retv = ob.ksp * return retv */ if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_ptype_8petsc4py_5PETSc_KSP)))) __PYX_ERR(66, 231, __pyx_L1_error) __pyx_t_1 = __pyx_v_arg; __Pyx_INCREF(__pyx_t_1); __pyx_v_ob = ((struct PyPetscKSPObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/CAPI.pyx":232 * cdef PetscKSP retv = NULL * cdef KSP ob = arg * retv = ob.ksp # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_v_ob->ksp; __pyx_v_retv = __pyx_t_2; /* "petsc4py/PETSc/CAPI.pyx":233 * cdef KSP ob = arg * retv = ob.ksp * return retv # <<<<<<<<<<<<<< * * # -- SNES -- */ __pyx_r = __pyx_v_retv; goto __pyx_L0; /* "petsc4py/PETSc/CAPI.pyx":229 * return retv * * cdef api PetscKSP PyPetscKSP_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscKSP retv = NULL * cdef KSP ob = arg */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscKSP_Get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/CAPI.pyx":237 * # -- SNES -- * * cdef api object PyPetscSNES_New(PetscSNES arg): # <<<<<<<<<<<<<< * cdef SNES retv = SNES() * setref(&retv.snes, arg) */ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscSNES_New(SNES __pyx_v_arg) { struct PyPetscSNESObject *__pyx_v_retv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscSNES_New", 1); /* "petsc4py/PETSc/CAPI.pyx":238 * * cdef api object PyPetscSNES_New(PetscSNES arg): * cdef SNES retv = SNES() # <<<<<<<<<<<<<< * setref(&retv.snes, arg) * return retv */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SNES)); if (unlikely(!__pyx_t_1)) __PYX_ERR(66, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_retv = ((struct PyPetscSNESObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/CAPI.pyx":239 * cdef api object PyPetscSNES_New(PetscSNES arg): * cdef SNES retv = SNES() * setref(&retv.snes, arg) # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->snes), __pyx_v_arg); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(66, 239, __pyx_L1_error) /* "petsc4py/PETSc/CAPI.pyx":240 * cdef SNES retv = SNES() * setref(&retv.snes, arg) * return retv # <<<<<<<<<<<<<< * * cdef api PetscSNES PyPetscSNES_Get(object arg) except ? NULL: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_retv); __pyx_r = ((PyObject *)__pyx_v_retv); goto __pyx_L0; /* "petsc4py/PETSc/CAPI.pyx":237 * # -- SNES -- * * cdef api object PyPetscSNES_New(PetscSNES arg): # <<<<<<<<<<<<<< * cdef SNES retv = SNES() * setref(&retv.snes, arg) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscSNES_New", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_retv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/CAPI.pyx":242 * return retv * * cdef api PetscSNES PyPetscSNES_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscSNES retv = NULL * cdef SNES ob = arg */ static SNES __pyx_f_8petsc4py_5PETSc_PyPetscSNES_Get(PyObject *__pyx_v_arg) { SNES __pyx_v_retv; struct PyPetscSNESObject *__pyx_v_ob = 0; SNES __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; SNES __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscSNES_Get", 1); /* "petsc4py/PETSc/CAPI.pyx":243 * * cdef api PetscSNES PyPetscSNES_Get(object arg) except ? NULL: * cdef PetscSNES retv = NULL # <<<<<<<<<<<<<< * cdef SNES ob = arg * retv = ob.snes */ __pyx_v_retv = NULL; /* "petsc4py/PETSc/CAPI.pyx":244 * cdef api PetscSNES PyPetscSNES_Get(object arg) except ? NULL: * cdef PetscSNES retv = NULL * cdef SNES ob = arg # <<<<<<<<<<<<<< * retv = ob.snes * return retv */ if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_ptype_8petsc4py_5PETSc_SNES)))) __PYX_ERR(66, 244, __pyx_L1_error) __pyx_t_1 = __pyx_v_arg; __Pyx_INCREF(__pyx_t_1); __pyx_v_ob = ((struct PyPetscSNESObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/CAPI.pyx":245 * cdef PetscSNES retv = NULL * cdef SNES ob = arg * retv = ob.snes # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_v_ob->snes; __pyx_v_retv = __pyx_t_2; /* "petsc4py/PETSc/CAPI.pyx":246 * cdef SNES ob = arg * retv = ob.snes * return retv # <<<<<<<<<<<<<< * * # -- TS -- */ __pyx_r = __pyx_v_retv; goto __pyx_L0; /* "petsc4py/PETSc/CAPI.pyx":242 * return retv * * cdef api PetscSNES PyPetscSNES_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscSNES retv = NULL * cdef SNES ob = arg */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscSNES_Get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/CAPI.pyx":250 * # -- TS -- * * cdef api object PyPetscTS_New(PetscTS arg): # <<<<<<<<<<<<<< * cdef TS retv = TS() * setref(&retv.ts, arg) */ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscTS_New(TS __pyx_v_arg) { struct PyPetscTSObject *__pyx_v_retv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscTS_New", 1); /* "petsc4py/PETSc/CAPI.pyx":251 * * cdef api object PyPetscTS_New(PetscTS arg): * cdef TS retv = TS() # <<<<<<<<<<<<<< * setref(&retv.ts, arg) * return retv */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_TS)); if (unlikely(!__pyx_t_1)) __PYX_ERR(66, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_retv = ((struct PyPetscTSObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/CAPI.pyx":252 * cdef api object PyPetscTS_New(PetscTS arg): * cdef TS retv = TS() * setref(&retv.ts, arg) # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->ts), __pyx_v_arg); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(66, 252, __pyx_L1_error) /* "petsc4py/PETSc/CAPI.pyx":253 * cdef TS retv = TS() * setref(&retv.ts, arg) * return retv # <<<<<<<<<<<<<< * * cdef api PetscTS PyPetscTS_Get(object arg) except ? NULL: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_retv); __pyx_r = ((PyObject *)__pyx_v_retv); goto __pyx_L0; /* "petsc4py/PETSc/CAPI.pyx":250 * # -- TS -- * * cdef api object PyPetscTS_New(PetscTS arg): # <<<<<<<<<<<<<< * cdef TS retv = TS() * setref(&retv.ts, arg) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscTS_New", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_retv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/CAPI.pyx":255 * return retv * * cdef api PetscTS PyPetscTS_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscTS retv = NULL * cdef TS ob = arg */ static TS __pyx_f_8petsc4py_5PETSc_PyPetscTS_Get(PyObject *__pyx_v_arg) { TS __pyx_v_retv; struct PyPetscTSObject *__pyx_v_ob = 0; TS __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; TS __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscTS_Get", 1); /* "petsc4py/PETSc/CAPI.pyx":256 * * cdef api PetscTS PyPetscTS_Get(object arg) except ? NULL: * cdef PetscTS retv = NULL # <<<<<<<<<<<<<< * cdef TS ob = arg * retv = ob.ts */ __pyx_v_retv = NULL; /* "petsc4py/PETSc/CAPI.pyx":257 * cdef api PetscTS PyPetscTS_Get(object arg) except ? NULL: * cdef PetscTS retv = NULL * cdef TS ob = arg # <<<<<<<<<<<<<< * retv = ob.ts * return retv */ if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_ptype_8petsc4py_5PETSc_TS)))) __PYX_ERR(66, 257, __pyx_L1_error) __pyx_t_1 = __pyx_v_arg; __Pyx_INCREF(__pyx_t_1); __pyx_v_ob = ((struct PyPetscTSObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/CAPI.pyx":258 * cdef PetscTS retv = NULL * cdef TS ob = arg * retv = ob.ts # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_v_ob->ts; __pyx_v_retv = __pyx_t_2; /* "petsc4py/PETSc/CAPI.pyx":259 * cdef TS ob = arg * retv = ob.ts * return retv # <<<<<<<<<<<<<< * * # -- TAO -- */ __pyx_r = __pyx_v_retv; goto __pyx_L0; /* "petsc4py/PETSc/CAPI.pyx":255 * return retv * * cdef api PetscTS PyPetscTS_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscTS retv = NULL * cdef TS ob = arg */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscTS_Get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/CAPI.pyx":263 * # -- TAO -- * * cdef api object PyPetscTAO_New(PetscTAO arg): # <<<<<<<<<<<<<< * cdef TAO retv = TAO() * setref(&retv.tao, arg) */ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscTAO_New(Tao __pyx_v_arg) { struct PyPetscTAOObject *__pyx_v_retv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscTAO_New", 1); /* "petsc4py/PETSc/CAPI.pyx":264 * * cdef api object PyPetscTAO_New(PetscTAO arg): * cdef TAO retv = TAO() # <<<<<<<<<<<<<< * setref(&retv.tao, arg) * return retv */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_TAO)); if (unlikely(!__pyx_t_1)) __PYX_ERR(66, 264, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_retv = ((struct PyPetscTAOObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/CAPI.pyx":265 * cdef api object PyPetscTAO_New(PetscTAO arg): * cdef TAO retv = TAO() * setref(&retv.tao, arg) # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->tao), __pyx_v_arg); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(66, 265, __pyx_L1_error) /* "petsc4py/PETSc/CAPI.pyx":266 * cdef TAO retv = TAO() * setref(&retv.tao, arg) * return retv # <<<<<<<<<<<<<< * * cdef api PetscTAO PyPetscTAO_Get(object arg) except ? NULL: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_retv); __pyx_r = ((PyObject *)__pyx_v_retv); goto __pyx_L0; /* "petsc4py/PETSc/CAPI.pyx":263 * # -- TAO -- * * cdef api object PyPetscTAO_New(PetscTAO arg): # <<<<<<<<<<<<<< * cdef TAO retv = TAO() * setref(&retv.tao, arg) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscTAO_New", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_retv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/CAPI.pyx":268 * return retv * * cdef api PetscTAO PyPetscTAO_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscTAO retv = NULL * cdef TAO ob = arg */ static Tao __pyx_f_8petsc4py_5PETSc_PyPetscTAO_Get(PyObject *__pyx_v_arg) { Tao __pyx_v_retv; struct PyPetscTAOObject *__pyx_v_ob = 0; Tao __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Tao __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscTAO_Get", 1); /* "petsc4py/PETSc/CAPI.pyx":269 * * cdef api PetscTAO PyPetscTAO_Get(object arg) except ? NULL: * cdef PetscTAO retv = NULL # <<<<<<<<<<<<<< * cdef TAO ob = arg * retv = ob.tao */ __pyx_v_retv = NULL; /* "petsc4py/PETSc/CAPI.pyx":270 * cdef api PetscTAO PyPetscTAO_Get(object arg) except ? NULL: * cdef PetscTAO retv = NULL * cdef TAO ob = arg # <<<<<<<<<<<<<< * retv = ob.tao * return retv */ if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_ptype_8petsc4py_5PETSc_TAO)))) __PYX_ERR(66, 270, __pyx_L1_error) __pyx_t_1 = __pyx_v_arg; __Pyx_INCREF(__pyx_t_1); __pyx_v_ob = ((struct PyPetscTAOObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/CAPI.pyx":271 * cdef PetscTAO retv = NULL * cdef TAO ob = arg * retv = ob.tao # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_v_ob->tao; __pyx_v_retv = __pyx_t_2; /* "petsc4py/PETSc/CAPI.pyx":272 * cdef TAO ob = arg * retv = ob.tao * return retv # <<<<<<<<<<<<<< * * cdef api object PyPetscTAOLineSearch_New(PetscTAOLineSearch arg): */ __pyx_r = __pyx_v_retv; goto __pyx_L0; /* "petsc4py/PETSc/CAPI.pyx":268 * return retv * * cdef api PetscTAO PyPetscTAO_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscTAO retv = NULL * cdef TAO ob = arg */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscTAO_Get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/CAPI.pyx":274 * return retv * * cdef api object PyPetscTAOLineSearch_New(PetscTAOLineSearch arg): # <<<<<<<<<<<<<< * cdef TAOLineSearch retv = TAOLineSearch() * setref(&retv.taols, arg) */ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscTAOLineSearch_New(TaoLineSearch __pyx_v_arg) { struct PyPetscTAOLineSearchObject *__pyx_v_retv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscTAOLineSearch_New", 1); /* "petsc4py/PETSc/CAPI.pyx":275 * * cdef api object PyPetscTAOLineSearch_New(PetscTAOLineSearch arg): * cdef TAOLineSearch retv = TAOLineSearch() # <<<<<<<<<<<<<< * setref(&retv.taols, arg) * return retv */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_TAOLineSearch)); if (unlikely(!__pyx_t_1)) __PYX_ERR(66, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_retv = ((struct PyPetscTAOLineSearchObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/CAPI.pyx":276 * cdef api object PyPetscTAOLineSearch_New(PetscTAOLineSearch arg): * cdef TAOLineSearch retv = TAOLineSearch() * setref(&retv.taols, arg) # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->taols), __pyx_v_arg); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(66, 276, __pyx_L1_error) /* "petsc4py/PETSc/CAPI.pyx":277 * cdef TAOLineSearch retv = TAOLineSearch() * setref(&retv.taols, arg) * return retv # <<<<<<<<<<<<<< * * cdef api PetscTAOLineSearch PyPetscTAOLineSearch_Get(object arg) except ? NULL: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_retv); __pyx_r = ((PyObject *)__pyx_v_retv); goto __pyx_L0; /* "petsc4py/PETSc/CAPI.pyx":274 * return retv * * cdef api object PyPetscTAOLineSearch_New(PetscTAOLineSearch arg): # <<<<<<<<<<<<<< * cdef TAOLineSearch retv = TAOLineSearch() * setref(&retv.taols, arg) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscTAOLineSearch_New", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_retv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/CAPI.pyx":279 * return retv * * cdef api PetscTAOLineSearch PyPetscTAOLineSearch_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscTAOLineSearch retv = NULL * cdef TAOLineSearch ob = arg */ static TaoLineSearch __pyx_f_8petsc4py_5PETSc_PyPetscTAOLineSearch_Get(PyObject *__pyx_v_arg) { TaoLineSearch __pyx_v_retv; struct PyPetscTAOLineSearchObject *__pyx_v_ob = 0; TaoLineSearch __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; TaoLineSearch __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscTAOLineSearch_Get", 1); /* "petsc4py/PETSc/CAPI.pyx":280 * * cdef api PetscTAOLineSearch PyPetscTAOLineSearch_Get(object arg) except ? NULL: * cdef PetscTAOLineSearch retv = NULL # <<<<<<<<<<<<<< * cdef TAOLineSearch ob = arg * retv = ob.taols */ __pyx_v_retv = NULL; /* "petsc4py/PETSc/CAPI.pyx":281 * cdef api PetscTAOLineSearch PyPetscTAOLineSearch_Get(object arg) except ? NULL: * cdef PetscTAOLineSearch retv = NULL * cdef TAOLineSearch ob = arg # <<<<<<<<<<<<<< * retv = ob.taols * return retv */ if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_ptype_8petsc4py_5PETSc_TAOLineSearch)))) __PYX_ERR(66, 281, __pyx_L1_error) __pyx_t_1 = __pyx_v_arg; __Pyx_INCREF(__pyx_t_1); __pyx_v_ob = ((struct PyPetscTAOLineSearchObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/CAPI.pyx":282 * cdef PetscTAOLineSearch retv = NULL * cdef TAOLineSearch ob = arg * retv = ob.taols # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_v_ob->taols; __pyx_v_retv = __pyx_t_2; /* "petsc4py/PETSc/CAPI.pyx":283 * cdef TAOLineSearch ob = arg * retv = ob.taols * return retv # <<<<<<<<<<<<<< * * */ __pyx_r = __pyx_v_retv; goto __pyx_L0; /* "petsc4py/PETSc/CAPI.pyx":279 * return retv * * cdef api PetscTAOLineSearch PyPetscTAOLineSearch_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscTAOLineSearch retv = NULL * cdef TAOLineSearch ob = arg */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscTAOLineSearch_Get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/CAPI.pyx":288 * # -- AO -- * * cdef api object PyPetscAO_New(PetscAO arg): # <<<<<<<<<<<<<< * cdef AO retv = AO() * setref(&retv.ao, arg) */ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscAO_New(AO __pyx_v_arg) { struct PyPetscAOObject *__pyx_v_retv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscAO_New", 1); /* "petsc4py/PETSc/CAPI.pyx":289 * * cdef api object PyPetscAO_New(PetscAO arg): * cdef AO retv = AO() # <<<<<<<<<<<<<< * setref(&retv.ao, arg) * return retv */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_AO)); if (unlikely(!__pyx_t_1)) __PYX_ERR(66, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_retv = ((struct PyPetscAOObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/CAPI.pyx":290 * cdef api object PyPetscAO_New(PetscAO arg): * cdef AO retv = AO() * setref(&retv.ao, arg) # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->ao), __pyx_v_arg); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(66, 290, __pyx_L1_error) /* "petsc4py/PETSc/CAPI.pyx":291 * cdef AO retv = AO() * setref(&retv.ao, arg) * return retv # <<<<<<<<<<<<<< * * cdef api PetscAO PyPetscAO_Get(object arg) except ? NULL: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_retv); __pyx_r = ((PyObject *)__pyx_v_retv); goto __pyx_L0; /* "petsc4py/PETSc/CAPI.pyx":288 * # -- AO -- * * cdef api object PyPetscAO_New(PetscAO arg): # <<<<<<<<<<<<<< * cdef AO retv = AO() * setref(&retv.ao, arg) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscAO_New", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_retv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/CAPI.pyx":293 * return retv * * cdef api PetscAO PyPetscAO_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscAO retv = NULL * cdef AO ob = arg */ static AO __pyx_f_8petsc4py_5PETSc_PyPetscAO_Get(PyObject *__pyx_v_arg) { AO __pyx_v_retv; struct PyPetscAOObject *__pyx_v_ob = 0; AO __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; AO __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscAO_Get", 1); /* "petsc4py/PETSc/CAPI.pyx":294 * * cdef api PetscAO PyPetscAO_Get(object arg) except ? NULL: * cdef PetscAO retv = NULL # <<<<<<<<<<<<<< * cdef AO ob = arg * retv = ob.ao */ __pyx_v_retv = NULL; /* "petsc4py/PETSc/CAPI.pyx":295 * cdef api PetscAO PyPetscAO_Get(object arg) except ? NULL: * cdef PetscAO retv = NULL * cdef AO ob = arg # <<<<<<<<<<<<<< * retv = ob.ao * return retv */ if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_ptype_8petsc4py_5PETSc_AO)))) __PYX_ERR(66, 295, __pyx_L1_error) __pyx_t_1 = __pyx_v_arg; __Pyx_INCREF(__pyx_t_1); __pyx_v_ob = ((struct PyPetscAOObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/CAPI.pyx":296 * cdef PetscAO retv = NULL * cdef AO ob = arg * retv = ob.ao # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_v_ob->ao; __pyx_v_retv = __pyx_t_2; /* "petsc4py/PETSc/CAPI.pyx":297 * cdef AO ob = arg * retv = ob.ao * return retv # <<<<<<<<<<<<<< * * # -- DM -- */ __pyx_r = __pyx_v_retv; goto __pyx_L0; /* "petsc4py/PETSc/CAPI.pyx":293 * return retv * * cdef api PetscAO PyPetscAO_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscAO retv = NULL * cdef AO ob = arg */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscAO_Get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/CAPI.pyx":301 * # -- DM -- * * cdef api object PyPetscDM_New(PetscDM arg): # <<<<<<<<<<<<<< * cdef DM retv = subtype_DM(arg)() * setref(&retv.dm, arg) */ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscDM_New(DM __pyx_v_arg) { struct PyPetscDMObject *__pyx_v_retv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscDM_New", 1); /* "petsc4py/PETSc/CAPI.pyx":302 * * cdef api object PyPetscDM_New(PetscDM arg): * cdef DM retv = subtype_DM(arg)() # <<<<<<<<<<<<<< * setref(&retv.dm, arg) * return retv */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_arg)); if (unlikely(!__pyx_t_1)) __PYX_ERR(66, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(66, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(66, 302, __pyx_L1_error) __pyx_v_retv = ((struct PyPetscDMObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/CAPI.pyx":303 * cdef api object PyPetscDM_New(PetscDM arg): * cdef DM retv = subtype_DM(arg)() * setref(&retv.dm, arg) # <<<<<<<<<<<<<< * return retv * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->dm), __pyx_v_arg); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(66, 303, __pyx_L1_error) /* "petsc4py/PETSc/CAPI.pyx":304 * cdef DM retv = subtype_DM(arg)() * setref(&retv.dm, arg) * return retv # <<<<<<<<<<<<<< * * cdef api PetscDM PyPetscDM_Get(object arg) except ? NULL: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_retv); __pyx_r = ((PyObject *)__pyx_v_retv); goto __pyx_L0; /* "petsc4py/PETSc/CAPI.pyx":301 * # -- DM -- * * cdef api object PyPetscDM_New(PetscDM arg): # <<<<<<<<<<<<<< * cdef DM retv = subtype_DM(arg)() * setref(&retv.dm, arg) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscDM_New", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_retv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/CAPI.pyx":306 * return retv * * cdef api PetscDM PyPetscDM_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscDM retv = NULL * cdef DM ob = arg */ static DM __pyx_f_8petsc4py_5PETSc_PyPetscDM_Get(PyObject *__pyx_v_arg) { DM __pyx_v_retv; struct PyPetscDMObject *__pyx_v_ob = 0; DM __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; DM __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscDM_Get", 1); /* "petsc4py/PETSc/CAPI.pyx":307 * * cdef api PetscDM PyPetscDM_Get(object arg) except ? NULL: * cdef PetscDM retv = NULL # <<<<<<<<<<<<<< * cdef DM ob = arg * retv = ob.dm */ __pyx_v_retv = NULL; /* "petsc4py/PETSc/CAPI.pyx":308 * cdef api PetscDM PyPetscDM_Get(object arg) except ? NULL: * cdef PetscDM retv = NULL * cdef DM ob = arg # <<<<<<<<<<<<<< * retv = ob.dm * return retv */ if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_ptype_8petsc4py_5PETSc_DM)))) __PYX_ERR(66, 308, __pyx_L1_error) __pyx_t_1 = __pyx_v_arg; __Pyx_INCREF(__pyx_t_1); __pyx_v_ob = ((struct PyPetscDMObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/CAPI.pyx":309 * cdef PetscDM retv = NULL * cdef DM ob = arg * retv = ob.dm # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_v_ob->dm; __pyx_v_retv = __pyx_t_2; /* "petsc4py/PETSc/CAPI.pyx":310 * cdef DM ob = arg * retv = ob.dm * return retv # <<<<<<<<<<<<<< * * # -- DS -- */ __pyx_r = __pyx_v_retv; goto __pyx_L0; /* "petsc4py/PETSc/CAPI.pyx":306 * return retv * * cdef api PetscDM PyPetscDM_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscDM retv = NULL * cdef DM ob = arg */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscDM_Get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/CAPI.pyx":314 * # -- DS -- * * cdef api object PyPetscDS_New(PetscDS arg): # <<<<<<<<<<<<<< * cdef DS retv = DS() * setref(&retv.ds, arg) */ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscDS_New(PetscDS __pyx_v_arg) { struct PyPetscDSObject *__pyx_v_retv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscDS_New", 1); /* "petsc4py/PETSc/CAPI.pyx":315 * * cdef api object PyPetscDS_New(PetscDS arg): * cdef DS retv = DS() # <<<<<<<<<<<<<< * setref(&retv.ds, arg) * return retv */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DS)); if (unlikely(!__pyx_t_1)) __PYX_ERR(66, 315, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_retv = ((struct PyPetscDSObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/CAPI.pyx":316 * cdef api object PyPetscDS_New(PetscDS arg): * cdef DS retv = DS() * setref(&retv.ds, arg) # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->ds), __pyx_v_arg); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(66, 316, __pyx_L1_error) /* "petsc4py/PETSc/CAPI.pyx":317 * cdef DS retv = DS() * setref(&retv.ds, arg) * return retv # <<<<<<<<<<<<<< * * cdef api PetscDS PyPetscDS_Get(object arg) except ? NULL: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_retv); __pyx_r = ((PyObject *)__pyx_v_retv); goto __pyx_L0; /* "petsc4py/PETSc/CAPI.pyx":314 * # -- DS -- * * cdef api object PyPetscDS_New(PetscDS arg): # <<<<<<<<<<<<<< * cdef DS retv = DS() * setref(&retv.ds, arg) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscDS_New", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_retv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/CAPI.pyx":319 * return retv * * cdef api PetscDS PyPetscDS_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscDS retv = NULL * cdef DS ob = arg */ static PetscDS __pyx_f_8petsc4py_5PETSc_PyPetscDS_Get(PyObject *__pyx_v_arg) { PetscDS __pyx_v_retv; struct PyPetscDSObject *__pyx_v_ob = 0; PetscDS __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscDS __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscDS_Get", 1); /* "petsc4py/PETSc/CAPI.pyx":320 * * cdef api PetscDS PyPetscDS_Get(object arg) except ? NULL: * cdef PetscDS retv = NULL # <<<<<<<<<<<<<< * cdef DS ob = arg * retv = ob.ds */ __pyx_v_retv = NULL; /* "petsc4py/PETSc/CAPI.pyx":321 * cdef api PetscDS PyPetscDS_Get(object arg) except ? NULL: * cdef PetscDS retv = NULL * cdef DS ob = arg # <<<<<<<<<<<<<< * retv = ob.ds * return retv */ if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_ptype_8petsc4py_5PETSc_DS)))) __PYX_ERR(66, 321, __pyx_L1_error) __pyx_t_1 = __pyx_v_arg; __Pyx_INCREF(__pyx_t_1); __pyx_v_ob = ((struct PyPetscDSObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/CAPI.pyx":322 * cdef PetscDS retv = NULL * cdef DS ob = arg * retv = ob.ds # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_v_ob->ds; __pyx_v_retv = __pyx_t_2; /* "petsc4py/PETSc/CAPI.pyx":323 * cdef DS ob = arg * retv = ob.ds * return retv # <<<<<<<<<<<<<< * * # -- Partitioner -- */ __pyx_r = __pyx_v_retv; goto __pyx_L0; /* "petsc4py/PETSc/CAPI.pyx":319 * return retv * * cdef api PetscDS PyPetscDS_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscDS retv = NULL * cdef DS ob = arg */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscDS_Get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/CAPI.pyx":327 * # -- Partitioner -- * * cdef api object PyPetscPartitioner_New(PetscPartitioner arg): # <<<<<<<<<<<<<< * cdef Partitioner retv = Partitioner() * setref(&retv.part, arg) */ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscPartitioner_New(PetscPartitioner __pyx_v_arg) { struct PyPetscPartitionerObject *__pyx_v_retv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscPartitioner_New", 1); /* "petsc4py/PETSc/CAPI.pyx":328 * * cdef api object PyPetscPartitioner_New(PetscPartitioner arg): * cdef Partitioner retv = Partitioner() # <<<<<<<<<<<<<< * setref(&retv.part, arg) * return retv */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Partitioner)); if (unlikely(!__pyx_t_1)) __PYX_ERR(66, 328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_retv = ((struct PyPetscPartitionerObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/CAPI.pyx":329 * cdef api object PyPetscPartitioner_New(PetscPartitioner arg): * cdef Partitioner retv = Partitioner() * setref(&retv.part, arg) # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->part), __pyx_v_arg); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(66, 329, __pyx_L1_error) /* "petsc4py/PETSc/CAPI.pyx":330 * cdef Partitioner retv = Partitioner() * setref(&retv.part, arg) * return retv # <<<<<<<<<<<<<< * * cdef api PetscPartitioner PyPetscPartitioner_Get(object arg) except ? NULL: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_retv); __pyx_r = ((PyObject *)__pyx_v_retv); goto __pyx_L0; /* "petsc4py/PETSc/CAPI.pyx":327 * # -- Partitioner -- * * cdef api object PyPetscPartitioner_New(PetscPartitioner arg): # <<<<<<<<<<<<<< * cdef Partitioner retv = Partitioner() * setref(&retv.part, arg) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscPartitioner_New", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_retv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/CAPI.pyx":332 * return retv * * cdef api PetscPartitioner PyPetscPartitioner_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscPartitioner retv = NULL * cdef Partitioner ob = arg */ static PetscPartitioner __pyx_f_8petsc4py_5PETSc_PyPetscPartitioner_Get(PyObject *__pyx_v_arg) { PetscPartitioner __pyx_v_retv; struct PyPetscPartitionerObject *__pyx_v_ob = 0; PetscPartitioner __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscPartitioner __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscPartitioner_Get", 1); /* "petsc4py/PETSc/CAPI.pyx":333 * * cdef api PetscPartitioner PyPetscPartitioner_Get(object arg) except ? NULL: * cdef PetscPartitioner retv = NULL # <<<<<<<<<<<<<< * cdef Partitioner ob = arg * retv = ob.part */ __pyx_v_retv = NULL; /* "petsc4py/PETSc/CAPI.pyx":334 * cdef api PetscPartitioner PyPetscPartitioner_Get(object arg) except ? NULL: * cdef PetscPartitioner retv = NULL * cdef Partitioner ob = arg # <<<<<<<<<<<<<< * retv = ob.part * return retv */ if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_ptype_8petsc4py_5PETSc_Partitioner)))) __PYX_ERR(66, 334, __pyx_L1_error) __pyx_t_1 = __pyx_v_arg; __Pyx_INCREF(__pyx_t_1); __pyx_v_ob = ((struct PyPetscPartitionerObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/CAPI.pyx":335 * cdef PetscPartitioner retv = NULL * cdef Partitioner ob = arg * retv = ob.part # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_v_ob->part; __pyx_v_retv = __pyx_t_2; /* "petsc4py/PETSc/CAPI.pyx":336 * cdef Partitioner ob = arg * retv = ob.part * return retv # <<<<<<<<<<<<<< * * # -- FE -- */ __pyx_r = __pyx_v_retv; goto __pyx_L0; /* "petsc4py/PETSc/CAPI.pyx":332 * return retv * * cdef api PetscPartitioner PyPetscPartitioner_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscPartitioner retv = NULL * cdef Partitioner ob = arg */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscPartitioner_Get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/CAPI.pyx":340 * # -- FE -- * * cdef api object PyPetscFE_New(PetscFE arg): # <<<<<<<<<<<<<< * cdef FE retv = FE() * setref(&retv.fe, arg) */ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscFE_New(PetscFE __pyx_v_arg) { struct PyPetscFEObject *__pyx_v_retv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscFE_New", 1); /* "petsc4py/PETSc/CAPI.pyx":341 * * cdef api object PyPetscFE_New(PetscFE arg): * cdef FE retv = FE() # <<<<<<<<<<<<<< * setref(&retv.fe, arg) * return retv */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_FE)); if (unlikely(!__pyx_t_1)) __PYX_ERR(66, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_retv = ((struct PyPetscFEObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/CAPI.pyx":342 * cdef api object PyPetscFE_New(PetscFE arg): * cdef FE retv = FE() * setref(&retv.fe, arg) # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->fe), __pyx_v_arg); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(66, 342, __pyx_L1_error) /* "petsc4py/PETSc/CAPI.pyx":343 * cdef FE retv = FE() * setref(&retv.fe, arg) * return retv # <<<<<<<<<<<<<< * * cdef api PetscFE PyPetscFE_Get(object arg) except ? NULL: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_retv); __pyx_r = ((PyObject *)__pyx_v_retv); goto __pyx_L0; /* "petsc4py/PETSc/CAPI.pyx":340 * # -- FE -- * * cdef api object PyPetscFE_New(PetscFE arg): # <<<<<<<<<<<<<< * cdef FE retv = FE() * setref(&retv.fe, arg) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscFE_New", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_retv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/CAPI.pyx":345 * return retv * * cdef api PetscFE PyPetscFE_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscFE retv = NULL * cdef FE ob = arg */ static PetscFE __pyx_f_8petsc4py_5PETSc_PyPetscFE_Get(PyObject *__pyx_v_arg) { PetscFE __pyx_v_retv; struct PyPetscFEObject *__pyx_v_ob = 0; PetscFE __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscFE __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscFE_Get", 1); /* "petsc4py/PETSc/CAPI.pyx":346 * * cdef api PetscFE PyPetscFE_Get(object arg) except ? NULL: * cdef PetscFE retv = NULL # <<<<<<<<<<<<<< * cdef FE ob = arg * retv = ob.fe */ __pyx_v_retv = NULL; /* "petsc4py/PETSc/CAPI.pyx":347 * cdef api PetscFE PyPetscFE_Get(object arg) except ? NULL: * cdef PetscFE retv = NULL * cdef FE ob = arg # <<<<<<<<<<<<<< * retv = ob.fe * return retv */ if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_ptype_8petsc4py_5PETSc_FE)))) __PYX_ERR(66, 347, __pyx_L1_error) __pyx_t_1 = __pyx_v_arg; __Pyx_INCREF(__pyx_t_1); __pyx_v_ob = ((struct PyPetscFEObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/CAPI.pyx":348 * cdef PetscFE retv = NULL * cdef FE ob = arg * retv = ob.fe # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_v_ob->fe; __pyx_v_retv = __pyx_t_2; /* "petsc4py/PETSc/CAPI.pyx":349 * cdef FE ob = arg * retv = ob.fe * return retv # <<<<<<<<<<<<<< * * # -- QUAD -- */ __pyx_r = __pyx_v_retv; goto __pyx_L0; /* "petsc4py/PETSc/CAPI.pyx":345 * return retv * * cdef api PetscFE PyPetscFE_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscFE retv = NULL * cdef FE ob = arg */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscFE_Get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/CAPI.pyx":353 * # -- QUAD -- * * cdef api object PyPetscQuad_New(PetscQuadrature arg): # <<<<<<<<<<<<<< * cdef Quad retv = Quad() * setref(&retv.quad, arg) */ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscQuad_New(PetscQuadrature __pyx_v_arg) { struct PyPetscQuadObject *__pyx_v_retv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscQuad_New", 1); /* "petsc4py/PETSc/CAPI.pyx":354 * * cdef api object PyPetscQuad_New(PetscQuadrature arg): * cdef Quad retv = Quad() # <<<<<<<<<<<<<< * setref(&retv.quad, arg) * return retv */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Quad)); if (unlikely(!__pyx_t_1)) __PYX_ERR(66, 354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_retv = ((struct PyPetscQuadObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/CAPI.pyx":355 * cdef api object PyPetscQuad_New(PetscQuadrature arg): * cdef Quad retv = Quad() * setref(&retv.quad, arg) # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->quad), __pyx_v_arg); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(66, 355, __pyx_L1_error) /* "petsc4py/PETSc/CAPI.pyx":356 * cdef Quad retv = Quad() * setref(&retv.quad, arg) * return retv # <<<<<<<<<<<<<< * * cdef api PetscQuadrature PyPetscQuad_Get(object arg) except ? NULL: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_retv); __pyx_r = ((PyObject *)__pyx_v_retv); goto __pyx_L0; /* "petsc4py/PETSc/CAPI.pyx":353 * # -- QUAD -- * * cdef api object PyPetscQuad_New(PetscQuadrature arg): # <<<<<<<<<<<<<< * cdef Quad retv = Quad() * setref(&retv.quad, arg) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscQuad_New", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_retv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/CAPI.pyx":358 * return retv * * cdef api PetscQuadrature PyPetscQuad_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscQuadrature retv = NULL * cdef Quad ob = arg */ static PetscQuadrature __pyx_f_8petsc4py_5PETSc_PyPetscQuad_Get(PyObject *__pyx_v_arg) { PetscQuadrature __pyx_v_retv; struct PyPetscQuadObject *__pyx_v_ob = 0; PetscQuadrature __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscQuadrature __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscQuad_Get", 1); /* "petsc4py/PETSc/CAPI.pyx":359 * * cdef api PetscQuadrature PyPetscQuad_Get(object arg) except ? NULL: * cdef PetscQuadrature retv = NULL # <<<<<<<<<<<<<< * cdef Quad ob = arg * retv = ob.quad */ __pyx_v_retv = NULL; /* "petsc4py/PETSc/CAPI.pyx":360 * cdef api PetscQuadrature PyPetscQuad_Get(object arg) except ? NULL: * cdef PetscQuadrature retv = NULL * cdef Quad ob = arg # <<<<<<<<<<<<<< * retv = ob.quad * return retv */ if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_ptype_8petsc4py_5PETSc_Quad)))) __PYX_ERR(66, 360, __pyx_L1_error) __pyx_t_1 = __pyx_v_arg; __Pyx_INCREF(__pyx_t_1); __pyx_v_ob = ((struct PyPetscQuadObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/CAPI.pyx":361 * cdef PetscQuadrature retv = NULL * cdef Quad ob = arg * retv = ob.quad # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_v_ob->quad; __pyx_v_retv = __pyx_t_2; /* "petsc4py/PETSc/CAPI.pyx":362 * cdef Quad ob = arg * retv = ob.quad * return retv # <<<<<<<<<<<<<< * * # -- DMLabel -- */ __pyx_r = __pyx_v_retv; goto __pyx_L0; /* "petsc4py/PETSc/CAPI.pyx":358 * return retv * * cdef api PetscQuadrature PyPetscQuad_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscQuadrature retv = NULL * cdef Quad ob = arg */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscQuad_Get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/CAPI.pyx":366 * # -- DMLabel -- * * cdef api object PyPetscDMLabel_New(PetscDMLabel arg): # <<<<<<<<<<<<<< * cdef DMLabel retv = DMLabel() * setref(&retv.dmlabel, arg) */ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscDMLabel_New(DMLabel __pyx_v_arg) { struct PyPetscDMLabelObject *__pyx_v_retv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscDMLabel_New", 1); /* "petsc4py/PETSc/CAPI.pyx":367 * * cdef api object PyPetscDMLabel_New(PetscDMLabel arg): * cdef DMLabel retv = DMLabel() # <<<<<<<<<<<<<< * setref(&retv.dmlabel, arg) * return retv */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DMLabel)); if (unlikely(!__pyx_t_1)) __PYX_ERR(66, 367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_retv = ((struct PyPetscDMLabelObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/CAPI.pyx":368 * cdef api object PyPetscDMLabel_New(PetscDMLabel arg): * cdef DMLabel retv = DMLabel() * setref(&retv.dmlabel, arg) # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->dmlabel), __pyx_v_arg); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(66, 368, __pyx_L1_error) /* "petsc4py/PETSc/CAPI.pyx":369 * cdef DMLabel retv = DMLabel() * setref(&retv.dmlabel, arg) * return retv # <<<<<<<<<<<<<< * * cdef api PetscDMLabel PyPetscDMLabel_Get(object arg) except ? NULL: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_retv); __pyx_r = ((PyObject *)__pyx_v_retv); goto __pyx_L0; /* "petsc4py/PETSc/CAPI.pyx":366 * # -- DMLabel -- * * cdef api object PyPetscDMLabel_New(PetscDMLabel arg): # <<<<<<<<<<<<<< * cdef DMLabel retv = DMLabel() * setref(&retv.dmlabel, arg) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscDMLabel_New", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_retv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/CAPI.pyx":371 * return retv * * cdef api PetscDMLabel PyPetscDMLabel_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscDMLabel retv = NULL * cdef DMLabel ob = arg */ static DMLabel __pyx_f_8petsc4py_5PETSc_PyPetscDMLabel_Get(PyObject *__pyx_v_arg) { DMLabel __pyx_v_retv; struct PyPetscDMLabelObject *__pyx_v_ob = 0; DMLabel __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; DMLabel __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscDMLabel_Get", 1); /* "petsc4py/PETSc/CAPI.pyx":372 * * cdef api PetscDMLabel PyPetscDMLabel_Get(object arg) except ? NULL: * cdef PetscDMLabel retv = NULL # <<<<<<<<<<<<<< * cdef DMLabel ob = arg * retv = ob.dmlabel */ __pyx_v_retv = NULL; /* "petsc4py/PETSc/CAPI.pyx":373 * cdef api PetscDMLabel PyPetscDMLabel_Get(object arg) except ? NULL: * cdef PetscDMLabel retv = NULL * cdef DMLabel ob = arg # <<<<<<<<<<<<<< * retv = ob.dmlabel * return retv */ if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_ptype_8petsc4py_5PETSc_DMLabel)))) __PYX_ERR(66, 373, __pyx_L1_error) __pyx_t_1 = __pyx_v_arg; __Pyx_INCREF(__pyx_t_1); __pyx_v_ob = ((struct PyPetscDMLabelObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/CAPI.pyx":374 * cdef PetscDMLabel retv = NULL * cdef DMLabel ob = arg * retv = ob.dmlabel # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_v_ob->dmlabel; __pyx_v_retv = __pyx_t_2; /* "petsc4py/PETSc/CAPI.pyx":375 * cdef DMLabel ob = arg * retv = ob.dmlabel * return retv # <<<<<<<<<<<<<< * * */ __pyx_r = __pyx_v_retv; goto __pyx_L0; /* "petsc4py/PETSc/CAPI.pyx":371 * return retv * * cdef api PetscDMLabel PyPetscDMLabel_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscDMLabel retv = NULL * cdef DMLabel ob = arg */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscDMLabel_Get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/CAPI.pyx":380 * # -- SPACE -- * * cdef api object PyPetscSpace_New(PetscSpace arg): # <<<<<<<<<<<<<< * cdef Space retv = Space() * setref(&retv.space, arg) */ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscSpace_New(PetscSpace __pyx_v_arg) { struct PyPetscSpaceObject *__pyx_v_retv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscSpace_New", 1); /* "petsc4py/PETSc/CAPI.pyx":381 * * cdef api object PyPetscSpace_New(PetscSpace arg): * cdef Space retv = Space() # <<<<<<<<<<<<<< * setref(&retv.space, arg) * return retv */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Space)); if (unlikely(!__pyx_t_1)) __PYX_ERR(66, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_retv = ((struct PyPetscSpaceObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/CAPI.pyx":382 * cdef api object PyPetscSpace_New(PetscSpace arg): * cdef Space retv = Space() * setref(&retv.space, arg) # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->space), __pyx_v_arg); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(66, 382, __pyx_L1_error) /* "petsc4py/PETSc/CAPI.pyx":383 * cdef Space retv = Space() * setref(&retv.space, arg) * return retv # <<<<<<<<<<<<<< * * cdef api PetscSpace PyPetscSpace_Get(object arg) except ? NULL: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_retv); __pyx_r = ((PyObject *)__pyx_v_retv); goto __pyx_L0; /* "petsc4py/PETSc/CAPI.pyx":380 * # -- SPACE -- * * cdef api object PyPetscSpace_New(PetscSpace arg): # <<<<<<<<<<<<<< * cdef Space retv = Space() * setref(&retv.space, arg) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscSpace_New", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_retv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/CAPI.pyx":385 * return retv * * cdef api PetscSpace PyPetscSpace_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscSpace retv = NULL * cdef Space ob = arg */ static PetscSpace __pyx_f_8petsc4py_5PETSc_PyPetscSpace_Get(PyObject *__pyx_v_arg) { PetscSpace __pyx_v_retv; struct PyPetscSpaceObject *__pyx_v_ob = 0; PetscSpace __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscSpace __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscSpace_Get", 1); /* "petsc4py/PETSc/CAPI.pyx":386 * * cdef api PetscSpace PyPetscSpace_Get(object arg) except ? NULL: * cdef PetscSpace retv = NULL # <<<<<<<<<<<<<< * cdef Space ob = arg * retv = ob.space */ __pyx_v_retv = NULL; /* "petsc4py/PETSc/CAPI.pyx":387 * cdef api PetscSpace PyPetscSpace_Get(object arg) except ? NULL: * cdef PetscSpace retv = NULL * cdef Space ob = arg # <<<<<<<<<<<<<< * retv = ob.space * return retv */ if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_ptype_8petsc4py_5PETSc_Space)))) __PYX_ERR(66, 387, __pyx_L1_error) __pyx_t_1 = __pyx_v_arg; __Pyx_INCREF(__pyx_t_1); __pyx_v_ob = ((struct PyPetscSpaceObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/CAPI.pyx":388 * cdef PetscSpace retv = NULL * cdef Space ob = arg * retv = ob.space # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_v_ob->space; __pyx_v_retv = __pyx_t_2; /* "petsc4py/PETSc/CAPI.pyx":389 * cdef Space ob = arg * retv = ob.space * return retv # <<<<<<<<<<<<<< * * # -- DUALSPACE -- */ __pyx_r = __pyx_v_retv; goto __pyx_L0; /* "petsc4py/PETSc/CAPI.pyx":385 * return retv * * cdef api PetscSpace PyPetscSpace_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscSpace retv = NULL * cdef Space ob = arg */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscSpace_Get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/CAPI.pyx":393 * # -- DUALSPACE -- * * cdef api object PyPetscDualSpace_New(PetscDualSpace arg): # <<<<<<<<<<<<<< * cdef DualSpace retv = DualSpace() * setref(&retv.dualspace, arg) */ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscDualSpace_New(PetscDualSpace __pyx_v_arg) { struct PyPetscDualSpaceObject *__pyx_v_retv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscDualSpace_New", 1); /* "petsc4py/PETSc/CAPI.pyx":394 * * cdef api object PyPetscDualSpace_New(PetscDualSpace arg): * cdef DualSpace retv = DualSpace() # <<<<<<<<<<<<<< * setref(&retv.dualspace, arg) * return retv */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DualSpace)); if (unlikely(!__pyx_t_1)) __PYX_ERR(66, 394, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_retv = ((struct PyPetscDualSpaceObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/CAPI.pyx":395 * cdef api object PyPetscDualSpace_New(PetscDualSpace arg): * cdef DualSpace retv = DualSpace() * setref(&retv.dualspace, arg) # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->dualspace), __pyx_v_arg); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(66, 395, __pyx_L1_error) /* "petsc4py/PETSc/CAPI.pyx":396 * cdef DualSpace retv = DualSpace() * setref(&retv.dualspace, arg) * return retv # <<<<<<<<<<<<<< * * cdef api PetscDualSpace PyPetscDualSpace_Get(object arg) except ? NULL: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_retv); __pyx_r = ((PyObject *)__pyx_v_retv); goto __pyx_L0; /* "petsc4py/PETSc/CAPI.pyx":393 * # -- DUALSPACE -- * * cdef api object PyPetscDualSpace_New(PetscDualSpace arg): # <<<<<<<<<<<<<< * cdef DualSpace retv = DualSpace() * setref(&retv.dualspace, arg) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscDualSpace_New", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_retv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/CAPI.pyx":398 * return retv * * cdef api PetscDualSpace PyPetscDualSpace_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscDualSpace retv = NULL * cdef DualSpace ob = arg */ static PetscDualSpace __pyx_f_8petsc4py_5PETSc_PyPetscDualSpace_Get(PyObject *__pyx_v_arg) { PetscDualSpace __pyx_v_retv; struct PyPetscDualSpaceObject *__pyx_v_ob = 0; PetscDualSpace __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscDualSpace __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscDualSpace_Get", 1); /* "petsc4py/PETSc/CAPI.pyx":399 * * cdef api PetscDualSpace PyPetscDualSpace_Get(object arg) except ? NULL: * cdef PetscDualSpace retv = NULL # <<<<<<<<<<<<<< * cdef DualSpace ob = arg * retv = ob.dualspace */ __pyx_v_retv = NULL; /* "petsc4py/PETSc/CAPI.pyx":400 * cdef api PetscDualSpace PyPetscDualSpace_Get(object arg) except ? NULL: * cdef PetscDualSpace retv = NULL * cdef DualSpace ob = arg # <<<<<<<<<<<<<< * retv = ob.dualspace * return retv */ if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_ptype_8petsc4py_5PETSc_DualSpace)))) __PYX_ERR(66, 400, __pyx_L1_error) __pyx_t_1 = __pyx_v_arg; __Pyx_INCREF(__pyx_t_1); __pyx_v_ob = ((struct PyPetscDualSpaceObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/CAPI.pyx":401 * cdef PetscDualSpace retv = NULL * cdef DualSpace ob = arg * retv = ob.dualspace # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_v_ob->dualspace; __pyx_v_retv = __pyx_t_2; /* "petsc4py/PETSc/CAPI.pyx":402 * cdef DualSpace ob = arg * retv = ob.dualspace * return retv # <<<<<<<<<<<<<< * * */ __pyx_r = __pyx_v_retv; goto __pyx_L0; /* "petsc4py/PETSc/CAPI.pyx":398 * return retv * * cdef api PetscDualSpace PyPetscDualSpace_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscDualSpace retv = NULL * cdef DualSpace ob = arg */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscDualSpace_Get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":36 * cdef int istack = 0 * * cdef inline void FunctionBegin(char name[]) noexcept nogil: # <<<<<<<<<<<<<< * global istack, fstack, FUNCT * FUNCT = name */ static CYTHON_INLINE void __pyx_f_8petsc4py_5PETSc_FunctionBegin(char *__pyx_v_name) { int __pyx_t_1; /* "petsc4py/PETSc/libpetsc4py.pyx":38 * cdef inline void FunctionBegin(char name[]) noexcept nogil: * global istack, fstack, FUNCT * FUNCT = name # <<<<<<<<<<<<<< * fstack[istack] = FUNCT * istack += 1 */ __pyx_v_8petsc4py_5PETSc_FUNCT = __pyx_v_name; /* "petsc4py/PETSc/libpetsc4py.pyx":39 * global istack, fstack, FUNCT * FUNCT = name * fstack[istack] = FUNCT # <<<<<<<<<<<<<< * istack += 1 * if istack >= 1024: */ (__pyx_v_8petsc4py_5PETSc_fstack[__pyx_v_8petsc4py_5PETSc_istack]) = __pyx_v_8petsc4py_5PETSc_FUNCT; /* "petsc4py/PETSc/libpetsc4py.pyx":40 * FUNCT = name * fstack[istack] = FUNCT * istack += 1 # <<<<<<<<<<<<<< * if istack >= 1024: * istack = 0 */ __pyx_v_8petsc4py_5PETSc_istack = (__pyx_v_8petsc4py_5PETSc_istack + 1); /* "petsc4py/PETSc/libpetsc4py.pyx":41 * fstack[istack] = FUNCT * istack += 1 * if istack >= 1024: # <<<<<<<<<<<<<< * istack = 0 * return */ __pyx_t_1 = (__pyx_v_8petsc4py_5PETSc_istack >= 0x400); if (__pyx_t_1) { /* "petsc4py/PETSc/libpetsc4py.pyx":42 * istack += 1 * if istack >= 1024: * istack = 0 # <<<<<<<<<<<<<< * return * */ __pyx_v_8petsc4py_5PETSc_istack = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":41 * fstack[istack] = FUNCT * istack += 1 * if istack >= 1024: # <<<<<<<<<<<<<< * istack = 0 * return */ } /* "petsc4py/PETSc/libpetsc4py.pyx":43 * if istack >= 1024: * istack = 0 * return # <<<<<<<<<<<<<< * * cdef inline PetscErrorCode FunctionEnd() noexcept nogil: */ goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":36 * cdef int istack = 0 * * cdef inline void FunctionBegin(char name[]) noexcept nogil: # <<<<<<<<<<<<<< * global istack, fstack, FUNCT * FUNCT = name */ /* function exit code */ __pyx_L0:; } /* "petsc4py/PETSc/libpetsc4py.pyx":45 * return * * cdef inline PetscErrorCode FunctionEnd() noexcept nogil: # <<<<<<<<<<<<<< * global istack, fstack, FUNCT * FUNCT = NULL */ static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_FunctionEnd(void) { PetscErrorCode __pyx_r; int __pyx_t_1; /* "petsc4py/PETSc/libpetsc4py.pyx":47 * cdef inline PetscErrorCode FunctionEnd() noexcept nogil: * global istack, fstack, FUNCT * FUNCT = NULL # <<<<<<<<<<<<<< * istack -= 1 * if istack < 0: */ __pyx_v_8petsc4py_5PETSc_FUNCT = NULL; /* "petsc4py/PETSc/libpetsc4py.pyx":48 * global istack, fstack, FUNCT * FUNCT = NULL * istack -= 1 # <<<<<<<<<<<<<< * if istack < 0: * istack = 1024 */ __pyx_v_8petsc4py_5PETSc_istack = (__pyx_v_8petsc4py_5PETSc_istack - 1); /* "petsc4py/PETSc/libpetsc4py.pyx":49 * FUNCT = NULL * istack -= 1 * if istack < 0: # <<<<<<<<<<<<<< * istack = 1024 * FUNCT = fstack[istack] */ __pyx_t_1 = (__pyx_v_8petsc4py_5PETSc_istack < 0); if (__pyx_t_1) { /* "petsc4py/PETSc/libpetsc4py.pyx":50 * istack -= 1 * if istack < 0: * istack = 1024 # <<<<<<<<<<<<<< * FUNCT = fstack[istack] * return PETSC_SUCCESS */ __pyx_v_8petsc4py_5PETSc_istack = 0x400; /* "petsc4py/PETSc/libpetsc4py.pyx":49 * FUNCT = NULL * istack -= 1 * if istack < 0: # <<<<<<<<<<<<<< * istack = 1024 * FUNCT = fstack[istack] */ } /* "petsc4py/PETSc/libpetsc4py.pyx":51 * if istack < 0: * istack = 1024 * FUNCT = fstack[istack] # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_v_8petsc4py_5PETSc_FUNCT = (__pyx_v_8petsc4py_5PETSc_fstack[__pyx_v_8petsc4py_5PETSc_istack]); /* "petsc4py/PETSc/libpetsc4py.pyx":52 * istack = 1024 * FUNCT = fstack[istack] * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * cdef PetscErrorCode PetscSETERR(PetscErrorCode ierr,char msg[]) noexcept nogil: */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":45 * return * * cdef inline PetscErrorCode FunctionEnd() noexcept nogil: # <<<<<<<<<<<<<< * global istack, fstack, FUNCT * FUNCT = NULL */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":54 * return PETSC_SUCCESS * * cdef PetscErrorCode PetscSETERR(PetscErrorCode ierr,char msg[]) noexcept nogil: # <<<<<<<<<<<<<< * global istack, fstack * istack = 0 */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PetscSETERR(PetscErrorCode __pyx_v_ierr, char *__pyx_v_msg) { PetscErrorCode __pyx_r; /* "petsc4py/PETSc/libpetsc4py.pyx":56 * cdef PetscErrorCode PetscSETERR(PetscErrorCode ierr,char msg[]) noexcept nogil: * global istack, fstack * istack = 0 # <<<<<<<<<<<<<< * fstack[istack] = NULL; * return PetscERROR(PETSC_COMM_SELF,FUNCT,ierr, */ __pyx_v_8petsc4py_5PETSc_istack = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":57 * global istack, fstack * istack = 0 * fstack[istack] = NULL; # <<<<<<<<<<<<<< * return PetscERROR(PETSC_COMM_SELF,FUNCT,ierr, * PETSC_ERROR_INITIAL, msg, NULL) */ (__pyx_v_8petsc4py_5PETSc_fstack[__pyx_v_8petsc4py_5PETSc_istack]) = NULL; /* "petsc4py/PETSc/libpetsc4py.pyx":58 * istack = 0 * fstack[istack] = NULL; * return PetscERROR(PETSC_COMM_SELF,FUNCT,ierr, # <<<<<<<<<<<<<< * PETSC_ERROR_INITIAL, msg, NULL) * */ __pyx_r = PetscERROR(PETSC_COMM_SELF, __pyx_v_8petsc4py_5PETSc_FUNCT, __pyx_v_ierr, PETSC_ERROR_INITIAL, __pyx_v_msg, NULL); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":54 * return PETSC_SUCCESS * * cdef PetscErrorCode PetscSETERR(PetscErrorCode ierr,char msg[]) noexcept nogil: # <<<<<<<<<<<<<< * global istack, fstack * istack = 0 */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":61 * PETSC_ERROR_INITIAL, msg, NULL) * * cdef PetscErrorCode UNSUPPORTED(char msg[]) noexcept nogil: # <<<<<<<<<<<<<< * return PetscERROR(PETSC_COMM_SELF,FUNCT,PETSC_ERR_USER, * PETSC_ERROR_INITIAL,b"method %s()",msg) */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_UNSUPPORTED(char *__pyx_v_msg) { PetscErrorCode __pyx_r; /* "petsc4py/PETSc/libpetsc4py.pyx":62 * * cdef PetscErrorCode UNSUPPORTED(char msg[]) noexcept nogil: * return PetscERROR(PETSC_COMM_SELF,FUNCT,PETSC_ERR_USER, # <<<<<<<<<<<<<< * PETSC_ERROR_INITIAL,b"method %s()",msg) * */ __pyx_r = PetscERROR(PETSC_COMM_SELF, __pyx_v_8petsc4py_5PETSc_FUNCT, PETSC_ERR_USER, PETSC_ERROR_INITIAL, ((char *)"method %s()"), __pyx_v_msg); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":61 * PETSC_ERROR_INITIAL, msg, NULL) * * cdef PetscErrorCode UNSUPPORTED(char msg[]) noexcept nogil: # <<<<<<<<<<<<<< * return PetscERROR(PETSC_COMM_SELF,FUNCT,PETSC_ERR_USER, * PETSC_ERROR_INITIAL,b"method %s()",msg) */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":67 * # -------------------------------------------------------------------- * * cdef inline PetscInt getRef(void *pobj) noexcept nogil: # <<<<<<<<<<<<<< * cdef PetscObject obj = pobj * if obj == NULL: return 0 */ static CYTHON_INLINE PetscInt __pyx_f_8petsc4py_5PETSc_getRef(void *__pyx_v_pobj) { PetscObject __pyx_v_obj; PetscInt __pyx_r; int __pyx_t_1; /* "petsc4py/PETSc/libpetsc4py.pyx":68 * * cdef inline PetscInt getRef(void *pobj) noexcept nogil: * cdef PetscObject obj = pobj # <<<<<<<<<<<<<< * if obj == NULL: return 0 * else: return obj.refct */ __pyx_v_obj = ((PetscObject)__pyx_v_pobj); /* "petsc4py/PETSc/libpetsc4py.pyx":69 * cdef inline PetscInt getRef(void *pobj) noexcept nogil: * cdef PetscObject obj = pobj * if obj == NULL: return 0 # <<<<<<<<<<<<<< * else: return obj.refct * */ __pyx_t_1 = (__pyx_v_obj == NULL); if (__pyx_t_1) { __pyx_r = 0; goto __pyx_L0; } /* "petsc4py/PETSc/libpetsc4py.pyx":70 * cdef PetscObject obj = pobj * if obj == NULL: return 0 * else: return obj.refct # <<<<<<<<<<<<<< * * cdef inline void addRef(void *pobj) noexcept nogil: */ /*else*/ { __pyx_r = __pyx_v_obj->refct; goto __pyx_L0; } /* "petsc4py/PETSc/libpetsc4py.pyx":67 * # -------------------------------------------------------------------- * * cdef inline PetscInt getRef(void *pobj) noexcept nogil: # <<<<<<<<<<<<<< * cdef PetscObject obj = pobj * if obj == NULL: return 0 */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":72 * else: return obj.refct * * cdef inline void addRef(void *pobj) noexcept nogil: # <<<<<<<<<<<<<< * cdef PetscObject obj = pobj * if obj != NULL: obj.refct += 1 */ static CYTHON_INLINE void __pyx_f_8petsc4py_5PETSc_addRef(void *__pyx_v_pobj) { PetscObject __pyx_v_obj; int __pyx_t_1; /* "petsc4py/PETSc/libpetsc4py.pyx":73 * * cdef inline void addRef(void *pobj) noexcept nogil: * cdef PetscObject obj = pobj # <<<<<<<<<<<<<< * if obj != NULL: obj.refct += 1 * */ __pyx_v_obj = ((PetscObject)__pyx_v_pobj); /* "petsc4py/PETSc/libpetsc4py.pyx":74 * cdef inline void addRef(void *pobj) noexcept nogil: * cdef PetscObject obj = pobj * if obj != NULL: obj.refct += 1 # <<<<<<<<<<<<<< * * cdef inline void delRef(void *pobj) noexcept nogil: */ __pyx_t_1 = (__pyx_v_obj != NULL); if (__pyx_t_1) { __pyx_v_obj->refct = (__pyx_v_obj->refct + 1); } /* "petsc4py/PETSc/libpetsc4py.pyx":72 * else: return obj.refct * * cdef inline void addRef(void *pobj) noexcept nogil: # <<<<<<<<<<<<<< * cdef PetscObject obj = pobj * if obj != NULL: obj.refct += 1 */ /* function exit code */ } /* "petsc4py/PETSc/libpetsc4py.pyx":76 * if obj != NULL: obj.refct += 1 * * cdef inline void delRef(void *pobj) noexcept nogil: # <<<<<<<<<<<<<< * cdef PetscObject obj = pobj * if obj != NULL: obj.refct -= 1 */ static CYTHON_INLINE void __pyx_f_8petsc4py_5PETSc_delRef(void *__pyx_v_pobj) { PetscObject __pyx_v_obj; int __pyx_t_1; /* "petsc4py/PETSc/libpetsc4py.pyx":77 * * cdef inline void delRef(void *pobj) noexcept nogil: * cdef PetscObject obj = pobj # <<<<<<<<<<<<<< * if obj != NULL: obj.refct -= 1 * */ __pyx_v_obj = ((PetscObject)__pyx_v_pobj); /* "petsc4py/PETSc/libpetsc4py.pyx":78 * cdef inline void delRef(void *pobj) noexcept nogil: * cdef PetscObject obj = pobj * if obj != NULL: obj.refct -= 1 # <<<<<<<<<<<<<< * * cdef inline PetscObject newRef(void *pobj) noexcept nogil: */ __pyx_t_1 = (__pyx_v_obj != NULL); if (__pyx_t_1) { __pyx_v_obj->refct = (__pyx_v_obj->refct - 1); } /* "petsc4py/PETSc/libpetsc4py.pyx":76 * if obj != NULL: obj.refct += 1 * * cdef inline void delRef(void *pobj) noexcept nogil: # <<<<<<<<<<<<<< * cdef PetscObject obj = pobj * if obj != NULL: obj.refct -= 1 */ /* function exit code */ } /* "petsc4py/PETSc/libpetsc4py.pyx":80 * if obj != NULL: obj.refct -= 1 * * cdef inline PetscObject newRef(void *pobj) noexcept nogil: # <<<<<<<<<<<<<< * cdef PetscObject obj = pobj * cdef int ierr = 0 */ static CYTHON_INLINE PetscObject __pyx_f_8petsc4py_5PETSc_newRef(void *__pyx_v_pobj) { PetscObject __pyx_v_obj; int __pyx_v_ierr; PetscObject __pyx_r; int __pyx_t_1; /* "petsc4py/PETSc/libpetsc4py.pyx":81 * * cdef inline PetscObject newRef(void *pobj) noexcept nogil: * cdef PetscObject obj = pobj # <<<<<<<<<<<<<< * cdef int ierr = 0 * if obj != NULL: */ __pyx_v_obj = ((PetscObject)__pyx_v_pobj); /* "petsc4py/PETSc/libpetsc4py.pyx":82 * cdef inline PetscObject newRef(void *pobj) noexcept nogil: * cdef PetscObject obj = pobj * cdef int ierr = 0 # <<<<<<<<<<<<<< * if obj != NULL: * ierr = PetscObjectReference(obj) */ __pyx_v_ierr = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":83 * cdef PetscObject obj = pobj * cdef int ierr = 0 * if obj != NULL: # <<<<<<<<<<<<<< * ierr = PetscObjectReference(obj) * if ierr: return NULL # XXX warning! */ __pyx_t_1 = (__pyx_v_obj != NULL); if (__pyx_t_1) { /* "petsc4py/PETSc/libpetsc4py.pyx":84 * cdef int ierr = 0 * if obj != NULL: * ierr = PetscObjectReference(obj) # <<<<<<<<<<<<<< * if ierr: return NULL # XXX warning! * return obj */ __pyx_v_ierr = PetscObjectReference(__pyx_v_obj); /* "petsc4py/PETSc/libpetsc4py.pyx":85 * if obj != NULL: * ierr = PetscObjectReference(obj) * if ierr: return NULL # XXX warning! # <<<<<<<<<<<<<< * return obj * */ __pyx_t_1 = (__pyx_v_ierr != 0); if (__pyx_t_1) { __pyx_r = NULL; goto __pyx_L0; } /* "petsc4py/PETSc/libpetsc4py.pyx":83 * cdef PetscObject obj = pobj * cdef int ierr = 0 * if obj != NULL: # <<<<<<<<<<<<<< * ierr = PetscObjectReference(obj) * if ierr: return NULL # XXX warning! */ } /* "petsc4py/PETSc/libpetsc4py.pyx":86 * ierr = PetscObjectReference(obj) * if ierr: return NULL # XXX warning! * return obj # <<<<<<<<<<<<<< * * cdef inline const char* getPrefix(void *pobj) noexcept nogil: */ __pyx_r = __pyx_v_obj; goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":80 * if obj != NULL: obj.refct -= 1 * * cdef inline PetscObject newRef(void *pobj) noexcept nogil: # <<<<<<<<<<<<<< * cdef PetscObject obj = pobj * cdef int ierr = 0 */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":88 * return obj * * cdef inline const char* getPrefix(void *pobj) noexcept nogil: # <<<<<<<<<<<<<< * cdef PetscObject obj = pobj * if obj == NULL: return NULL */ static CYTHON_INLINE char const *__pyx_f_8petsc4py_5PETSc_getPrefix(void *__pyx_v_pobj) { PetscObject __pyx_v_obj; char const *__pyx_r; int __pyx_t_1; /* "petsc4py/PETSc/libpetsc4py.pyx":89 * * cdef inline const char* getPrefix(void *pobj) noexcept nogil: * cdef PetscObject obj = pobj # <<<<<<<<<<<<<< * if obj == NULL: return NULL * return obj.prefix */ __pyx_v_obj = ((PetscObject)__pyx_v_pobj); /* "petsc4py/PETSc/libpetsc4py.pyx":90 * cdef inline const char* getPrefix(void *pobj) noexcept nogil: * cdef PetscObject obj = pobj * if obj == NULL: return NULL # <<<<<<<<<<<<<< * return obj.prefix * */ __pyx_t_1 = (__pyx_v_obj == NULL); if (__pyx_t_1) { __pyx_r = NULL; goto __pyx_L0; } /* "petsc4py/PETSc/libpetsc4py.pyx":91 * cdef PetscObject obj = pobj * if obj == NULL: return NULL * return obj.prefix # <<<<<<<<<<<<<< * * cdef inline int getCommSize(void *pobj) noexcept nogil: */ __pyx_r = __pyx_v_obj->prefix; goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":88 * return obj * * cdef inline const char* getPrefix(void *pobj) noexcept nogil: # <<<<<<<<<<<<<< * cdef PetscObject obj = pobj * if obj == NULL: return NULL */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":93 * return obj.prefix * * cdef inline int getCommSize(void *pobj) noexcept nogil: # <<<<<<<<<<<<<< * cdef PetscObject obj = pobj * if obj == NULL: return 0 */ static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_getCommSize(void *__pyx_v_pobj) { PetscObject __pyx_v_obj; int __pyx_v_size; int __pyx_r; int __pyx_t_1; /* "petsc4py/PETSc/libpetsc4py.pyx":94 * * cdef inline int getCommSize(void *pobj) noexcept nogil: * cdef PetscObject obj = pobj # <<<<<<<<<<<<<< * if obj == NULL: return 0 * cdef int size = 0 */ __pyx_v_obj = ((PetscObject)__pyx_v_pobj); /* "petsc4py/PETSc/libpetsc4py.pyx":95 * cdef inline int getCommSize(void *pobj) noexcept nogil: * cdef PetscObject obj = pobj * if obj == NULL: return 0 # <<<<<<<<<<<<<< * cdef int size = 0 * MPI_Comm_size(obj.comm, &size) */ __pyx_t_1 = (__pyx_v_obj == NULL); if (__pyx_t_1) { __pyx_r = 0; goto __pyx_L0; } /* "petsc4py/PETSc/libpetsc4py.pyx":96 * cdef PetscObject obj = pobj * if obj == NULL: return 0 * cdef int size = 0 # <<<<<<<<<<<<<< * MPI_Comm_size(obj.comm, &size) * return size */ __pyx_v_size = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":97 * if obj == NULL: return 0 * cdef int size = 0 * MPI_Comm_size(obj.comm, &size) # <<<<<<<<<<<<<< * return size * */ (void)(MPI_Comm_size(__pyx_v_obj->comm, (&__pyx_v_size))); /* "petsc4py/PETSc/libpetsc4py.pyx":98 * cdef int size = 0 * MPI_Comm_size(obj.comm, &size) * return size # <<<<<<<<<<<<<< * * cdef inline Viewer Viewer_(PetscViewer p): */ __pyx_r = __pyx_v_size; goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":93 * return obj.prefix * * cdef inline int getCommSize(void *pobj) noexcept nogil: # <<<<<<<<<<<<<< * cdef PetscObject obj = pobj * if obj == NULL: return 0 */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":100 * return size * * cdef inline Viewer Viewer_(PetscViewer p): # <<<<<<<<<<<<<< * cdef Viewer ob = Viewer.__new__(Viewer) * ob.obj[0] = newRef(p) */ static CYTHON_INLINE struct PyPetscViewerObject *__pyx_f_8petsc4py_5PETSc_Viewer_(PetscViewer __pyx_v_p) { struct PyPetscViewerObject *__pyx_v_ob = 0; struct PyPetscViewerObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("Viewer_", 1); /* "petsc4py/PETSc/libpetsc4py.pyx":101 * * cdef inline Viewer Viewer_(PetscViewer p): * cdef Viewer ob = Viewer.__new__(Viewer) # <<<<<<<<<<<<<< * ob.obj[0] = newRef(p) * return ob */ __pyx_t_1 = ((PyObject *)__pyx_tp_new_8petsc4py_5PETSc_Viewer(((PyTypeObject *)__pyx_ptype_8petsc4py_5PETSc_Viewer), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 101, __pyx_L1_error) __Pyx_GOTREF((PyObject *)__pyx_t_1); __pyx_v_ob = ((struct PyPetscViewerObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":102 * cdef inline Viewer Viewer_(PetscViewer p): * cdef Viewer ob = Viewer.__new__(Viewer) * ob.obj[0] = newRef(p) # <<<<<<<<<<<<<< * return ob * */ (__pyx_v_ob->__pyx_base.obj[0]) = __pyx_f_8petsc4py_5PETSc_newRef(__pyx_v_p); /* "petsc4py/PETSc/libpetsc4py.pyx":103 * cdef Viewer ob = Viewer.__new__(Viewer) * ob.obj[0] = newRef(p) * return ob # <<<<<<<<<<<<<< * * cdef inline IS IS_(PetscIS p): */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_ob); __pyx_r = __pyx_v_ob; goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":100 * return size * * cdef inline Viewer Viewer_(PetscViewer p): # <<<<<<<<<<<<<< * cdef Viewer ob = Viewer.__new__(Viewer) * ob.obj[0] = newRef(p) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Viewer_", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":105 * return ob * * cdef inline IS IS_(PetscIS p): # <<<<<<<<<<<<<< * cdef IS ob = IS.__new__(IS) * ob.obj[0] = newRef(p) */ static CYTHON_INLINE struct PyPetscISObject *__pyx_f_8petsc4py_5PETSc_IS_(IS __pyx_v_p) { struct PyPetscISObject *__pyx_v_ob = 0; struct PyPetscISObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("IS_", 1); /* "petsc4py/PETSc/libpetsc4py.pyx":106 * * cdef inline IS IS_(PetscIS p): * cdef IS ob = IS.__new__(IS) # <<<<<<<<<<<<<< * ob.obj[0] = newRef(p) * return ob */ __pyx_t_1 = ((PyObject *)__pyx_tp_new_8petsc4py_5PETSc_IS(((PyTypeObject *)__pyx_ptype_8petsc4py_5PETSc_IS), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 106, __pyx_L1_error) __Pyx_GOTREF((PyObject *)__pyx_t_1); __pyx_v_ob = ((struct PyPetscISObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":107 * cdef inline IS IS_(PetscIS p): * cdef IS ob = IS.__new__(IS) * ob.obj[0] = newRef(p) # <<<<<<<<<<<<<< * return ob * */ (__pyx_v_ob->__pyx_base.obj[0]) = __pyx_f_8petsc4py_5PETSc_newRef(__pyx_v_p); /* "petsc4py/PETSc/libpetsc4py.pyx":108 * cdef IS ob = IS.__new__(IS) * ob.obj[0] = newRef(p) * return ob # <<<<<<<<<<<<<< * * cdef inline Vec Vec_(PetscVec p): */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_ob); __pyx_r = __pyx_v_ob; goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":105 * return ob * * cdef inline IS IS_(PetscIS p): # <<<<<<<<<<<<<< * cdef IS ob = IS.__new__(IS) * ob.obj[0] = newRef(p) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.IS_", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":110 * return ob * * cdef inline Vec Vec_(PetscVec p): # <<<<<<<<<<<<<< * cdef Vec ob = Vec.__new__(Vec) * ob.obj[0] = newRef(p) */ static CYTHON_INLINE struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_Vec_(Vec __pyx_v_p) { struct PyPetscVecObject *__pyx_v_ob = 0; struct PyPetscVecObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("Vec_", 1); /* "petsc4py/PETSc/libpetsc4py.pyx":111 * * cdef inline Vec Vec_(PetscVec p): * cdef Vec ob = Vec.__new__(Vec) # <<<<<<<<<<<<<< * ob.obj[0] = newRef(p) * return ob */ __pyx_t_1 = ((PyObject *)__pyx_tp_new_8petsc4py_5PETSc_Vec(((PyTypeObject *)__pyx_ptype_8petsc4py_5PETSc_Vec), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 111, __pyx_L1_error) __Pyx_GOTREF((PyObject *)__pyx_t_1); __pyx_v_ob = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":112 * cdef inline Vec Vec_(PetscVec p): * cdef Vec ob = Vec.__new__(Vec) * ob.obj[0] = newRef(p) # <<<<<<<<<<<<<< * return ob * */ (__pyx_v_ob->__pyx_base.obj[0]) = __pyx_f_8petsc4py_5PETSc_newRef(__pyx_v_p); /* "petsc4py/PETSc/libpetsc4py.pyx":113 * cdef Vec ob = Vec.__new__(Vec) * ob.obj[0] = newRef(p) * return ob # <<<<<<<<<<<<<< * * cdef inline Mat Mat_(PetscMat p): */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_ob); __pyx_r = __pyx_v_ob; goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":110 * return ob * * cdef inline Vec Vec_(PetscVec p): # <<<<<<<<<<<<<< * cdef Vec ob = Vec.__new__(Vec) * ob.obj[0] = newRef(p) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Vec_", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":115 * return ob * * cdef inline Mat Mat_(PetscMat p): # <<<<<<<<<<<<<< * cdef Mat ob = Mat.__new__(Mat) * ob.obj[0] = newRef(p) */ static CYTHON_INLINE struct PyPetscMatObject *__pyx_f_8petsc4py_5PETSc_Mat_(Mat __pyx_v_p) { struct PyPetscMatObject *__pyx_v_ob = 0; struct PyPetscMatObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("Mat_", 1); /* "petsc4py/PETSc/libpetsc4py.pyx":116 * * cdef inline Mat Mat_(PetscMat p): * cdef Mat ob = Mat.__new__(Mat) # <<<<<<<<<<<<<< * ob.obj[0] = newRef(p) * return ob */ __pyx_t_1 = ((PyObject *)__pyx_tp_new_8petsc4py_5PETSc_Mat(((PyTypeObject *)__pyx_ptype_8petsc4py_5PETSc_Mat), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 116, __pyx_L1_error) __Pyx_GOTREF((PyObject *)__pyx_t_1); __pyx_v_ob = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":117 * cdef inline Mat Mat_(PetscMat p): * cdef Mat ob = Mat.__new__(Mat) * ob.obj[0] = newRef(p) # <<<<<<<<<<<<<< * return ob * */ (__pyx_v_ob->__pyx_base.obj[0]) = __pyx_f_8petsc4py_5PETSc_newRef(__pyx_v_p); /* "petsc4py/PETSc/libpetsc4py.pyx":118 * cdef Mat ob = Mat.__new__(Mat) * ob.obj[0] = newRef(p) * return ob # <<<<<<<<<<<<<< * * cdef inline PC PC_(PetscPC p): */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_ob); __pyx_r = __pyx_v_ob; goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":115 * return ob * * cdef inline Mat Mat_(PetscMat p): # <<<<<<<<<<<<<< * cdef Mat ob = Mat.__new__(Mat) * ob.obj[0] = newRef(p) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat_", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":120 * return ob * * cdef inline PC PC_(PetscPC p): # <<<<<<<<<<<<<< * cdef PC ob = PC.__new__(PC) * ob.obj[0] = newRef(p) */ static CYTHON_INLINE struct PyPetscPCObject *__pyx_f_8petsc4py_5PETSc_PC_(PC __pyx_v_p) { struct PyPetscPCObject *__pyx_v_ob = 0; struct PyPetscPCObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PC_", 1); /* "petsc4py/PETSc/libpetsc4py.pyx":121 * * cdef inline PC PC_(PetscPC p): * cdef PC ob = PC.__new__(PC) # <<<<<<<<<<<<<< * ob.obj[0] = newRef(p) * return ob */ __pyx_t_1 = ((PyObject *)__pyx_tp_new_8petsc4py_5PETSc_PC(((PyTypeObject *)__pyx_ptype_8petsc4py_5PETSc_PC), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 121, __pyx_L1_error) __Pyx_GOTREF((PyObject *)__pyx_t_1); __pyx_v_ob = ((struct PyPetscPCObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":122 * cdef inline PC PC_(PetscPC p): * cdef PC ob = PC.__new__(PC) * ob.obj[0] = newRef(p) # <<<<<<<<<<<<<< * return ob * */ (__pyx_v_ob->__pyx_base.obj[0]) = __pyx_f_8petsc4py_5PETSc_newRef(__pyx_v_p); /* "petsc4py/PETSc/libpetsc4py.pyx":123 * cdef PC ob = PC.__new__(PC) * ob.obj[0] = newRef(p) * return ob # <<<<<<<<<<<<<< * * cdef inline KSP KSP_(PetscKSP p): */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_ob); __pyx_r = __pyx_v_ob; goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":120 * return ob * * cdef inline PC PC_(PetscPC p): # <<<<<<<<<<<<<< * cdef PC ob = PC.__new__(PC) * ob.obj[0] = newRef(p) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PC_", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":125 * return ob * * cdef inline KSP KSP_(PetscKSP p): # <<<<<<<<<<<<<< * cdef KSP ob = KSP.__new__(KSP) * ob.obj[0] = newRef(p) */ static CYTHON_INLINE struct PyPetscKSPObject *__pyx_f_8petsc4py_5PETSc_KSP_(KSP __pyx_v_p) { struct PyPetscKSPObject *__pyx_v_ob = 0; struct PyPetscKSPObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("KSP_", 1); /* "petsc4py/PETSc/libpetsc4py.pyx":126 * * cdef inline KSP KSP_(PetscKSP p): * cdef KSP ob = KSP.__new__(KSP) # <<<<<<<<<<<<<< * ob.obj[0] = newRef(p) * return ob */ __pyx_t_1 = ((PyObject *)__pyx_tp_new_8petsc4py_5PETSc_KSP(((PyTypeObject *)__pyx_ptype_8petsc4py_5PETSc_KSP), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 126, __pyx_L1_error) __Pyx_GOTREF((PyObject *)__pyx_t_1); __pyx_v_ob = ((struct PyPetscKSPObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":127 * cdef inline KSP KSP_(PetscKSP p): * cdef KSP ob = KSP.__new__(KSP) * ob.obj[0] = newRef(p) # <<<<<<<<<<<<<< * return ob * */ (__pyx_v_ob->__pyx_base.obj[0]) = __pyx_f_8petsc4py_5PETSc_newRef(__pyx_v_p); /* "petsc4py/PETSc/libpetsc4py.pyx":128 * cdef KSP ob = KSP.__new__(KSP) * ob.obj[0] = newRef(p) * return ob # <<<<<<<<<<<<<< * * cdef inline SNES SNES_(PetscSNES p): */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_ob); __pyx_r = __pyx_v_ob; goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":125 * return ob * * cdef inline KSP KSP_(PetscKSP p): # <<<<<<<<<<<<<< * cdef KSP ob = KSP.__new__(KSP) * ob.obj[0] = newRef(p) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.KSP_", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":130 * return ob * * cdef inline SNES SNES_(PetscSNES p): # <<<<<<<<<<<<<< * cdef SNES ob = SNES.__new__(SNES) * ob.obj[0] = newRef(p) */ static CYTHON_INLINE struct PyPetscSNESObject *__pyx_f_8petsc4py_5PETSc_SNES_(SNES __pyx_v_p) { struct PyPetscSNESObject *__pyx_v_ob = 0; struct PyPetscSNESObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("SNES_", 1); /* "petsc4py/PETSc/libpetsc4py.pyx":131 * * cdef inline SNES SNES_(PetscSNES p): * cdef SNES ob = SNES.__new__(SNES) # <<<<<<<<<<<<<< * ob.obj[0] = newRef(p) * return ob */ __pyx_t_1 = ((PyObject *)__pyx_tp_new_8petsc4py_5PETSc_SNES(((PyTypeObject *)__pyx_ptype_8petsc4py_5PETSc_SNES), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 131, __pyx_L1_error) __Pyx_GOTREF((PyObject *)__pyx_t_1); __pyx_v_ob = ((struct PyPetscSNESObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":132 * cdef inline SNES SNES_(PetscSNES p): * cdef SNES ob = SNES.__new__(SNES) * ob.obj[0] = newRef(p) # <<<<<<<<<<<<<< * return ob * */ (__pyx_v_ob->__pyx_base.obj[0]) = __pyx_f_8petsc4py_5PETSc_newRef(__pyx_v_p); /* "petsc4py/PETSc/libpetsc4py.pyx":133 * cdef SNES ob = SNES.__new__(SNES) * ob.obj[0] = newRef(p) * return ob # <<<<<<<<<<<<<< * * cdef inline TS TS_(PetscTS p): */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_ob); __pyx_r = __pyx_v_ob; goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":130 * return ob * * cdef inline SNES SNES_(PetscSNES p): # <<<<<<<<<<<<<< * cdef SNES ob = SNES.__new__(SNES) * ob.obj[0] = newRef(p) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.SNES_", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":135 * return ob * * cdef inline TS TS_(PetscTS p): # <<<<<<<<<<<<<< * cdef TS ob = TS.__new__(TS) * ob.obj[0] = newRef(p) */ static CYTHON_INLINE struct PyPetscTSObject *__pyx_f_8petsc4py_5PETSc_TS_(TS __pyx_v_p) { struct PyPetscTSObject *__pyx_v_ob = 0; struct PyPetscTSObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("TS_", 1); /* "petsc4py/PETSc/libpetsc4py.pyx":136 * * cdef inline TS TS_(PetscTS p): * cdef TS ob = TS.__new__(TS) # <<<<<<<<<<<<<< * ob.obj[0] = newRef(p) * return ob */ __pyx_t_1 = ((PyObject *)__pyx_tp_new_8petsc4py_5PETSc_TS(((PyTypeObject *)__pyx_ptype_8petsc4py_5PETSc_TS), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 136, __pyx_L1_error) __Pyx_GOTREF((PyObject *)__pyx_t_1); __pyx_v_ob = ((struct PyPetscTSObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":137 * cdef inline TS TS_(PetscTS p): * cdef TS ob = TS.__new__(TS) * ob.obj[0] = newRef(p) # <<<<<<<<<<<<<< * return ob * */ (__pyx_v_ob->__pyx_base.obj[0]) = __pyx_f_8petsc4py_5PETSc_newRef(__pyx_v_p); /* "petsc4py/PETSc/libpetsc4py.pyx":138 * cdef TS ob = TS.__new__(TS) * ob.obj[0] = newRef(p) * return ob # <<<<<<<<<<<<<< * * cdef inline TAO TAO_(PetscTAO p): */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_ob); __pyx_r = __pyx_v_ob; goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":135 * return ob * * cdef inline TS TS_(PetscTS p): # <<<<<<<<<<<<<< * cdef TS ob = TS.__new__(TS) * ob.obj[0] = newRef(p) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TS_", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":140 * return ob * * cdef inline TAO TAO_(PetscTAO p): # <<<<<<<<<<<<<< * cdef TAO ob = TAO.__new__(TAO) * ob.obj[0] = newRef(p) */ static CYTHON_INLINE struct PyPetscTAOObject *__pyx_f_8petsc4py_5PETSc_TAO_(Tao __pyx_v_p) { struct PyPetscTAOObject *__pyx_v_ob = 0; struct PyPetscTAOObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("TAO_", 1); /* "petsc4py/PETSc/libpetsc4py.pyx":141 * * cdef inline TAO TAO_(PetscTAO p): * cdef TAO ob = TAO.__new__(TAO) # <<<<<<<<<<<<<< * ob.obj[0] = newRef(p) * return ob */ __pyx_t_1 = ((PyObject *)__pyx_tp_new_8petsc4py_5PETSc_TAO(((PyTypeObject *)__pyx_ptype_8petsc4py_5PETSc_TAO), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 141, __pyx_L1_error) __Pyx_GOTREF((PyObject *)__pyx_t_1); __pyx_v_ob = ((struct PyPetscTAOObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":142 * cdef inline TAO TAO_(PetscTAO p): * cdef TAO ob = TAO.__new__(TAO) * ob.obj[0] = newRef(p) # <<<<<<<<<<<<<< * return ob * */ (__pyx_v_ob->__pyx_base.obj[0]) = __pyx_f_8petsc4py_5PETSc_newRef(__pyx_v_p); /* "petsc4py/PETSc/libpetsc4py.pyx":143 * cdef TAO ob = TAO.__new__(TAO) * ob.obj[0] = newRef(p) * return ob # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_ob); __pyx_r = __pyx_v_ob; goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":140 * return ob * * cdef inline TAO TAO_(PetscTAO p): # <<<<<<<<<<<<<< * cdef TAO ob = TAO.__new__(TAO) * ob.obj[0] = newRef(p) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TAO_", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":147 * # -------------------------------------------------------------------- * * cdef object parse_url(object url): # <<<<<<<<<<<<<< * path, name = url.rsplit(":", 1) * return (path, name) */ static PyObject *__pyx_f_8petsc4py_5PETSc_parse_url(PyObject *__pyx_v_url) { PyObject *__pyx_v_path = NULL; PyObject *__pyx_v_name = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *(*__pyx_t_5)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("parse_url", 1); /* "petsc4py/PETSc/libpetsc4py.pyx":148 * * cdef object parse_url(object url): * path, name = url.rsplit(":", 1) # <<<<<<<<<<<<<< * return (path, name) * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_rsplit); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__65, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { PyObject* sequence = __pyx_t_2; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(11, 148, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); index = 0; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(11, 148, __pyx_L1_error) __pyx_t_5 = NULL; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(11, 148, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_path = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_name = __pyx_t_3; __pyx_t_3 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":149 * cdef object parse_url(object url): * path, name = url.rsplit(":", 1) * return (path, name) # <<<<<<<<<<<<<< * * cdef dict module_cache = {} */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_path); __Pyx_GIVEREF(__pyx_v_path); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_path)) __PYX_ERR(11, 149, __pyx_L1_error); __Pyx_INCREF(__pyx_v_name); __Pyx_GIVEREF(__pyx_v_name); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_name)) __PYX_ERR(11, 149, __pyx_L1_error); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":147 * # -------------------------------------------------------------------- * * cdef object parse_url(object url): # <<<<<<<<<<<<<< * path, name = url.rsplit(":", 1) * return (path, name) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.parse_url", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_path); __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":153 * cdef dict module_cache = {} * * cdef object load_module(object path): # <<<<<<<<<<<<<< * if path in module_cache: * return module_cache[path] */ static PyObject *__pyx_f_8petsc4py_5PETSc_load_module(PyObject *__pyx_v_path) { PyObject *__pyx_v_module = NULL; PyObject *__pyx_v_source = NULL; PyObject *__pyx_v_code = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; int __pyx_t_15; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("load_module", 1); /* "petsc4py/PETSc/libpetsc4py.pyx":154 * * cdef object load_module(object path): * if path in module_cache: # <<<<<<<<<<<<<< * return module_cache[path] * module = PyModule_New("__petsc__") */ if (unlikely(__pyx_v_8petsc4py_5PETSc_module_cache == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(11, 154, __pyx_L1_error) } __pyx_t_1 = (__Pyx_PyDict_ContainsTF(__pyx_v_path, __pyx_v_8petsc4py_5PETSc_module_cache, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(11, 154, __pyx_L1_error) if (__pyx_t_1) { /* "petsc4py/PETSc/libpetsc4py.pyx":155 * cdef object load_module(object path): * if path in module_cache: * return module_cache[path] # <<<<<<<<<<<<<< * module = PyModule_New("__petsc__") * module.__file__ = path */ __Pyx_XDECREF(__pyx_r); if (unlikely(__pyx_v_8petsc4py_5PETSc_module_cache == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(11, 155, __pyx_L1_error) } __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_8petsc4py_5PETSc_module_cache, __pyx_v_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":154 * * cdef object load_module(object path): * if path in module_cache: # <<<<<<<<<<<<<< * return module_cache[path] * module = PyModule_New("__petsc__") */ } /* "petsc4py/PETSc/libpetsc4py.pyx":156 * if path in module_cache: * return module_cache[path] * module = PyModule_New("__petsc__") # <<<<<<<<<<<<<< * module.__file__ = path * module.__package__ = None */ __pyx_t_2 = PyModule_New(((char *)"__petsc__")); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_module = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":157 * return module_cache[path] * module = PyModule_New("__petsc__") * module.__file__ = path # <<<<<<<<<<<<<< * module.__package__ = None * module_cache[path] = module */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_module, __pyx_n_s_file, __pyx_v_path) < 0) __PYX_ERR(11, 157, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":158 * module = PyModule_New("__petsc__") * module.__file__ = path * module.__package__ = None # <<<<<<<<<<<<<< * module_cache[path] = module * try: */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_module, __pyx_n_s_package_2, Py_None) < 0) __PYX_ERR(11, 158, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":159 * module.__file__ = path * module.__package__ = None * module_cache[path] = module # <<<<<<<<<<<<<< * try: * with open(path, 'r') as source: */ if (unlikely(__pyx_v_8petsc4py_5PETSc_module_cache == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(11, 159, __pyx_L1_error) } if (unlikely((PyDict_SetItem(__pyx_v_8petsc4py_5PETSc_module_cache, __pyx_v_path, __pyx_v_module) < 0))) __PYX_ERR(11, 159, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":160 * module.__package__ = None * module_cache[path] = module * try: # <<<<<<<<<<<<<< * with open(path, 'r') as source: * code = compile(source.read(), path, 'exec') */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_5); /*try:*/ { /* "petsc4py/PETSc/libpetsc4py.pyx":161 * module_cache[path] = module * try: * with open(path, 'r') as source: # <<<<<<<<<<<<<< * code = compile(source.read(), path, 'exec') * exec(code, module.__dict__) */ /*with:*/ { __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 161, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_path); __Pyx_GIVEREF(__pyx_v_path); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_path)) __PYX_ERR(11, 161, __pyx_L4_error); __Pyx_INCREF(__pyx_n_s_r); __Pyx_GIVEREF(__pyx_n_s_r); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_r)) __PYX_ERR(11, 161, __pyx_L4_error); __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(11, 161, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_7 = __Pyx_PyObject_LookupSpecial(__pyx_t_6, __pyx_n_s_exit); if (unlikely(!__pyx_t_7)) __PYX_ERR(11, 161, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyObject_LookupSpecial(__pyx_t_6, __pyx_n_s_enter); if (unlikely(!__pyx_t_8)) __PYX_ERR(11, 161, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_8))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_9, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_10, 0+__pyx_t_10); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 161, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __pyx_t_8 = __pyx_t_2; __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /*try:*/ { { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); /*try:*/ { __pyx_v_source = __pyx_t_8; __pyx_t_8 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":162 * try: * with open(path, 'r') as source: * code = compile(source.read(), path, 'exec') # <<<<<<<<<<<<<< * exec(code, module.__dict__) * except: */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_read); if (unlikely(!__pyx_t_6)) __PYX_ERR(11, 162, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_10, 0+__pyx_t_10); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(11, 162, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(11, 162, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_8); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_8)) __PYX_ERR(11, 162, __pyx_L14_error); __Pyx_INCREF(__pyx_v_path); __Pyx_GIVEREF(__pyx_v_path); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_path)) __PYX_ERR(11, 162, __pyx_L14_error); __Pyx_INCREF(__pyx_n_s_exec); __Pyx_GIVEREF(__pyx_n_s_exec); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_n_s_exec)) __PYX_ERR(11, 162, __pyx_L14_error); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_compile, __pyx_t_6, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(11, 162, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_code = __pyx_t_8; __pyx_t_8 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":161 * module_cache[path] = module * try: * with open(path, 'r') as source: # <<<<<<<<<<<<<< * code = compile(source.read(), path, 'exec') * exec(code, module.__dict__) */ } __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; goto __pyx_L19_try_end; __pyx_L14_error:; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; /*except:*/ { __Pyx_AddTraceback("petsc4py.PETSc.load_module", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_6, &__pyx_t_2) < 0) __PYX_ERR(11, 161, __pyx_L16_except_error) __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_2); __pyx_t_9 = PyTuple_Pack(3, __pyx_t_8, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(11, 161, __pyx_L16_except_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_14)) __PYX_ERR(11, 161, __pyx_L16_except_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_14); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; if (__pyx_t_1 < 0) __PYX_ERR(11, 161, __pyx_L16_except_error) __pyx_t_15 = (!__pyx_t_1); if (unlikely(__pyx_t_15)) { __Pyx_GIVEREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_ErrRestoreWithState(__pyx_t_8, __pyx_t_6, __pyx_t_2); __pyx_t_8 = 0; __pyx_t_6 = 0; __pyx_t_2 = 0; __PYX_ERR(11, 161, __pyx_L16_except_error) } __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L15_exception_handled; } __pyx_L16_except_error:; __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); goto __pyx_L4_error; __pyx_L15_exception_handled:; __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); __pyx_L19_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_7) { __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__32, NULL); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_13)) __PYX_ERR(11, 161, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } goto __pyx_L13; } __pyx_L13:; } goto __pyx_L23; __pyx_L10_error:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L4_error; __pyx_L23:; } /* "petsc4py/PETSc/libpetsc4py.pyx":163 * with open(path, 'r') as source: * code = compile(source.read(), path, 'exec') * exec(code, module.__dict__) # <<<<<<<<<<<<<< * except: * del module_cache[path] */ if (unlikely(!__pyx_v_code)) { __Pyx_RaiseUnboundLocalError("code"); __PYX_ERR(11, 163, __pyx_L4_error) } __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_module, __pyx_n_s_dict); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 163, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = __Pyx_PyExec2(__pyx_v_code, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(11, 163, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":160 * module.__package__ = None * module_cache[path] = module * try: # <<<<<<<<<<<<<< * with open(path, 'r') as source: * code = compile(source.read(), path, 'exec') */ } __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L9_try_end; __pyx_L4_error:; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":164 * code = compile(source.read(), path, 'exec') * exec(code, module.__dict__) * except: # <<<<<<<<<<<<<< * del module_cache[path] * raise */ /*except:*/ { __Pyx_AddTraceback("petsc4py.PETSc.load_module", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_2, &__pyx_t_8) < 0) __PYX_ERR(11, 164, __pyx_L6_except_error) __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_8); /* "petsc4py/PETSc/libpetsc4py.pyx":165 * exec(code, module.__dict__) * except: * del module_cache[path] # <<<<<<<<<<<<<< * raise * return module */ if (unlikely(__pyx_v_8petsc4py_5PETSc_module_cache == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(11, 165, __pyx_L6_except_error) } if (unlikely((PyDict_DelItem(__pyx_v_8petsc4py_5PETSc_module_cache, __pyx_v_path) < 0))) __PYX_ERR(11, 165, __pyx_L6_except_error) /* "petsc4py/PETSc/libpetsc4py.pyx":166 * except: * del module_cache[path] * raise # <<<<<<<<<<<<<< * return module * */ __Pyx_GIVEREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ErrRestoreWithState(__pyx_t_6, __pyx_t_2, __pyx_t_8); __pyx_t_6 = 0; __pyx_t_2 = 0; __pyx_t_8 = 0; __PYX_ERR(11, 166, __pyx_L6_except_error) } /* "petsc4py/PETSc/libpetsc4py.pyx":160 * module.__package__ = None * module_cache[path] = module * try: # <<<<<<<<<<<<<< * with open(path, 'r') as source: * code = compile(source.read(), path, 'exec') */ __pyx_L6_except_error:; __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); goto __pyx_L1_error; __pyx_L9_try_end:; } /* "petsc4py/PETSc/libpetsc4py.pyx":167 * del module_cache[path] * raise * return module # <<<<<<<<<<<<<< * * # ----------------------------------------------------------------------------- */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_module); __pyx_r = __pyx_v_module; goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":153 * cdef dict module_cache = {} * * cdef object load_module(object path): # <<<<<<<<<<<<<< * if path in module_cache: * return module_cache[path] */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("petsc4py.PETSc.load_module", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_module); __Pyx_XDECREF(__pyx_v_source); __Pyx_XDECREF(__pyx_v_code); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":177 * cdef bytes name * * def __getattr__(self, attr): # <<<<<<<<<<<<<< * return getattr(self.self, attr, None) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6_PyObj_1__getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_6_PyObj_1__getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_6_PyObj___getattr__(((struct __pyx_obj_8petsc4py_5PETSc__PyObj *)__pyx_v_self), ((PyObject *)__pyx_v_attr)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6_PyObj___getattr__(struct __pyx_obj_8petsc4py_5PETSc__PyObj *__pyx_v_self, PyObject *__pyx_v_attr) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getattr__", 1); /* "petsc4py/PETSc/libpetsc4py.pyx":178 * * def __getattr__(self, attr): * return getattr(self.self, attr, None) # <<<<<<<<<<<<<< * * cdef int setcontext(self, void *ctx, Object base) except -1: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_v_self->self; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = __Pyx_GetAttr3(__pyx_t_1, __pyx_v_attr, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":177 * cdef bytes name * * def __getattr__(self, attr): # <<<<<<<<<<<<<< * return getattr(self.self, attr, None) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc._PyObj.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":180 * return getattr(self.self, attr, None) * * cdef int setcontext(self, void *ctx, Object base) except -1: # <<<<<<<<<<<<<< * # * if ctx == self.self: */ static int __pyx_f_8petsc4py_5PETSc_6_PyObj_setcontext(struct __pyx_obj_8petsc4py_5PETSc__PyObj *__pyx_v_self, void *__pyx_v_ctx, struct PyPetscObjectObject *__pyx_v_base) { PyObject *__pyx_v_destroy = 0; PyObject *__pyx_v_create = 0; int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setcontext", 1); /* "petsc4py/PETSc/libpetsc4py.pyx":182 * cdef int setcontext(self, void *ctx, Object base) except -1: * # * if ctx == self.self: # <<<<<<<<<<<<<< * return 0 * # */ __pyx_t_1 = (__pyx_v_ctx == ((void *)__pyx_v_self->self)); if (__pyx_t_1) { /* "petsc4py/PETSc/libpetsc4py.pyx":183 * # * if ctx == self.self: * return 0 # <<<<<<<<<<<<<< * # * cdef object destroy = self.destroy */ __pyx_r = 0; goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":182 * cdef int setcontext(self, void *ctx, Object base) except -1: * # * if ctx == self.self: # <<<<<<<<<<<<<< * return 0 * # */ } /* "petsc4py/PETSc/libpetsc4py.pyx":185 * return 0 * # * cdef object destroy = self.destroy # <<<<<<<<<<<<<< * if destroy is not None: * destroy(base) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_destroy); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_destroy = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":186 * # * cdef object destroy = self.destroy * if destroy is not None: # <<<<<<<<<<<<<< * destroy(base) * destroy = None */ __pyx_t_1 = (__pyx_v_destroy != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/libpetsc4py.pyx":187 * cdef object destroy = self.destroy * if destroy is not None: * destroy(base) # <<<<<<<<<<<<<< * destroy = None * # */ __Pyx_INCREF(__pyx_v_destroy); __pyx_t_3 = __pyx_v_destroy; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, ((PyObject *)__pyx_v_base)}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":188 * if destroy is not None: * destroy(base) * destroy = None # <<<<<<<<<<<<<< * # * if ctx == NULL: */ __Pyx_INCREF(Py_None); __Pyx_DECREF_SET(__pyx_v_destroy, Py_None); /* "petsc4py/PETSc/libpetsc4py.pyx":186 * # * cdef object destroy = self.destroy * if destroy is not None: # <<<<<<<<<<<<<< * destroy(base) * destroy = None */ } /* "petsc4py/PETSc/libpetsc4py.pyx":190 * destroy = None * # * if ctx == NULL: # <<<<<<<<<<<<<< * self.self = None * self.name = None */ __pyx_t_1 = (__pyx_v_ctx == NULL); if (__pyx_t_1) { /* "petsc4py/PETSc/libpetsc4py.pyx":191 * # * if ctx == NULL: * self.self = None # <<<<<<<<<<<<<< * self.name = None * return 0 */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->self); __Pyx_DECREF(__pyx_v_self->self); __pyx_v_self->self = Py_None; /* "petsc4py/PETSc/libpetsc4py.pyx":192 * if ctx == NULL: * self.self = None * self.name = None # <<<<<<<<<<<<<< * return 0 * # */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->name); __Pyx_DECREF(__pyx_v_self->name); __pyx_v_self->name = ((PyObject*)Py_None); /* "petsc4py/PETSc/libpetsc4py.pyx":193 * self.self = None * self.name = None * return 0 # <<<<<<<<<<<<<< * # * self.self = ctx */ __pyx_r = 0; goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":190 * destroy = None * # * if ctx == NULL: # <<<<<<<<<<<<<< * self.self = None * self.name = None */ } /* "petsc4py/PETSc/libpetsc4py.pyx":195 * return 0 * # * self.self = ctx # <<<<<<<<<<<<<< * self.name = None * cdef object create = self.create */ __pyx_t_2 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_self->self); __Pyx_DECREF(__pyx_v_self->self); __pyx_v_self->self = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":196 * # * self.self = ctx * self.name = None # <<<<<<<<<<<<<< * cdef object create = self.create * if create is not None: */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->name); __Pyx_DECREF(__pyx_v_self->name); __pyx_v_self->name = ((PyObject*)Py_None); /* "petsc4py/PETSc/libpetsc4py.pyx":197 * self.self = ctx * self.name = None * cdef object create = self.create # <<<<<<<<<<<<<< * if create is not None: * create(base) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_create); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_create = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":198 * self.name = None * cdef object create = self.create * if create is not None: # <<<<<<<<<<<<<< * create(base) * create = None */ __pyx_t_1 = (__pyx_v_create != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/libpetsc4py.pyx":199 * cdef object create = self.create * if create is not None: * create(base) # <<<<<<<<<<<<<< * create = None * return 0 */ __Pyx_INCREF(__pyx_v_create); __pyx_t_3 = __pyx_v_create; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, ((PyObject *)__pyx_v_base)}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":200 * if create is not None: * create(base) * create = None # <<<<<<<<<<<<<< * return 0 * */ __Pyx_INCREF(Py_None); __Pyx_DECREF_SET(__pyx_v_create, Py_None); /* "petsc4py/PETSc/libpetsc4py.pyx":198 * self.name = None * cdef object create = self.create * if create is not None: # <<<<<<<<<<<<<< * create(base) * create = None */ } /* "petsc4py/PETSc/libpetsc4py.pyx":201 * create(base) * create = None * return 0 # <<<<<<<<<<<<<< * * cdef int getcontext(self, void **ctx) except -1: */ __pyx_r = 0; goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":180 * return getattr(self.self, attr, None) * * cdef int setcontext(self, void *ctx, Object base) except -1: # <<<<<<<<<<<<<< * # * if ctx == self.self: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc._PyObj.setcontext", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_destroy); __Pyx_XDECREF(__pyx_v_create); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":203 * return 0 * * cdef int getcontext(self, void **ctx) except -1: # <<<<<<<<<<<<<< * if ctx == NULL: return 0 * if self.self is not None: */ static int __pyx_f_8petsc4py_5PETSc_6_PyObj_getcontext(struct __pyx_obj_8petsc4py_5PETSc__PyObj *__pyx_v_self, void **__pyx_v_ctx) { int __pyx_r; int __pyx_t_1; /* "petsc4py/PETSc/libpetsc4py.pyx":204 * * cdef int getcontext(self, void **ctx) except -1: * if ctx == NULL: return 0 # <<<<<<<<<<<<<< * if self.self is not None: * ctx[0] = self.self */ __pyx_t_1 = (__pyx_v_ctx == NULL); if (__pyx_t_1) { __pyx_r = 0; goto __pyx_L0; } /* "petsc4py/PETSc/libpetsc4py.pyx":205 * cdef int getcontext(self, void **ctx) except -1: * if ctx == NULL: return 0 * if self.self is not None: # <<<<<<<<<<<<<< * ctx[0] = self.self * else: */ __pyx_t_1 = (__pyx_v_self->self != Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/libpetsc4py.pyx":206 * if ctx == NULL: return 0 * if self.self is not None: * ctx[0] = self.self # <<<<<<<<<<<<<< * else: * ctx[0] = NULL */ (__pyx_v_ctx[0]) = ((void *)__pyx_v_self->self); /* "petsc4py/PETSc/libpetsc4py.pyx":205 * cdef int getcontext(self, void **ctx) except -1: * if ctx == NULL: return 0 * if self.self is not None: # <<<<<<<<<<<<<< * ctx[0] = self.self * else: */ goto __pyx_L4; } /* "petsc4py/PETSc/libpetsc4py.pyx":208 * ctx[0] = self.self * else: * ctx[0] = NULL # <<<<<<<<<<<<<< * return 0 * */ /*else*/ { (__pyx_v_ctx[0]) = NULL; } __pyx_L4:; /* "petsc4py/PETSc/libpetsc4py.pyx":209 * else: * ctx[0] = NULL * return 0 # <<<<<<<<<<<<<< * * cdef int setname(self, char name[]) except -1: */ __pyx_r = 0; goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":203 * return 0 * * cdef int getcontext(self, void **ctx) except -1: # <<<<<<<<<<<<<< * if ctx == NULL: return 0 * if self.self is not None: */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":211 * return 0 * * cdef int setname(self, char name[]) except -1: # <<<<<<<<<<<<<< * if name != NULL and name[0] != 0: * self.name = name */ static int __pyx_f_8petsc4py_5PETSc_6_PyObj_setname(struct __pyx_obj_8petsc4py_5PETSc__PyObj *__pyx_v_self, char *__pyx_v_name) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setname", 1); /* "petsc4py/PETSc/libpetsc4py.pyx":212 * * cdef int setname(self, char name[]) except -1: * if name != NULL and name[0] != 0: # <<<<<<<<<<<<<< * self.name = name * else: */ __pyx_t_2 = (__pyx_v_name != NULL); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = ((__pyx_v_name[0]) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "petsc4py/PETSc/libpetsc4py.pyx":213 * cdef int setname(self, char name[]) except -1: * if name != NULL and name[0] != 0: * self.name = name # <<<<<<<<<<<<<< * else: * self.name = None */ __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->name); __Pyx_DECREF(__pyx_v_self->name); __pyx_v_self->name = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":212 * * cdef int setname(self, char name[]) except -1: * if name != NULL and name[0] != 0: # <<<<<<<<<<<<<< * self.name = name * else: */ goto __pyx_L3; } /* "petsc4py/PETSc/libpetsc4py.pyx":215 * self.name = name * else: * self.name = None # <<<<<<<<<<<<<< * return 0 * */ /*else*/ { __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->name); __Pyx_DECREF(__pyx_v_self->name); __pyx_v_self->name = ((PyObject*)Py_None); } __pyx_L3:; /* "petsc4py/PETSc/libpetsc4py.pyx":216 * else: * self.name = None * return 0 # <<<<<<<<<<<<<< * * cdef char* getname(self) except? NULL: */ __pyx_r = 0; goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":211 * return 0 * * cdef int setname(self, char name[]) except -1: # <<<<<<<<<<<<<< * if name != NULL and name[0] != 0: * self.name = name */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc._PyObj.setname", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":218 * return 0 * * cdef char* getname(self) except? NULL: # <<<<<<<<<<<<<< * if self.self is None: * return NULL */ static char *__pyx_f_8petsc4py_5PETSc_6_PyObj_getname(struct __pyx_obj_8petsc4py_5PETSc__PyObj *__pyx_v_self) { PyObject *__pyx_v_ctx = 0; PyObject *__pyx_v_name = 0; PyObject *__pyx_v_modname = NULL; PyObject *__pyx_v_clsname = NULL; PyObject *__pyx_v_cls = NULL; char *__pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; char *__pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getname", 1); /* "petsc4py/PETSc/libpetsc4py.pyx":219 * * cdef char* getname(self) except? NULL: * if self.self is None: # <<<<<<<<<<<<<< * return NULL * if self.name is not None: */ __pyx_t_1 = (__pyx_v_self->self == Py_None); if (__pyx_t_1) { /* "petsc4py/PETSc/libpetsc4py.pyx":220 * cdef char* getname(self) except? NULL: * if self.self is None: * return NULL # <<<<<<<<<<<<<< * if self.name is not None: * return self.name */ __pyx_r = NULL; goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":219 * * cdef char* getname(self) except? NULL: * if self.self is None: # <<<<<<<<<<<<<< * return NULL * if self.name is not None: */ } /* "petsc4py/PETSc/libpetsc4py.pyx":221 * if self.self is None: * return NULL * if self.name is not None: # <<<<<<<<<<<<<< * return self.name * cdef ctx = self.self */ __pyx_t_1 = (__pyx_v_self->name != ((PyObject*)Py_None)); if (__pyx_t_1) { /* "petsc4py/PETSc/libpetsc4py.pyx":222 * return NULL * if self.name is not None: * return self.name # <<<<<<<<<<<<<< * cdef ctx = self.self * cdef name = None */ if (unlikely(__pyx_v_self->name == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); __PYX_ERR(11, 222, __pyx_L1_error) } __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->name); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(11, 222, __pyx_L1_error) __pyx_r = __pyx_t_2; goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":221 * if self.self is None: * return NULL * if self.name is not None: # <<<<<<<<<<<<<< * return self.name * cdef ctx = self.self */ } /* "petsc4py/PETSc/libpetsc4py.pyx":223 * if self.name is not None: * return self.name * cdef ctx = self.self # <<<<<<<<<<<<<< * cdef name = None * if PyModule_Check(ctx): */ __pyx_t_3 = __pyx_v_self->self; __Pyx_INCREF(__pyx_t_3); __pyx_v_ctx = __pyx_t_3; __pyx_t_3 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":224 * return self.name * cdef ctx = self.self * cdef name = None # <<<<<<<<<<<<<< * if PyModule_Check(ctx): * name = getattr(ctx, '__name__', None) */ __Pyx_INCREF(Py_None); __pyx_v_name = Py_None; /* "petsc4py/PETSc/libpetsc4py.pyx":225 * cdef ctx = self.self * cdef name = None * if PyModule_Check(ctx): # <<<<<<<<<<<<<< * name = getattr(ctx, '__name__', None) * else: */ __pyx_t_1 = PyModule_Check(__pyx_v_ctx); if (__pyx_t_1) { /* "petsc4py/PETSc/libpetsc4py.pyx":226 * cdef name = None * if PyModule_Check(ctx): * name = getattr(ctx, '__name__', None) # <<<<<<<<<<<<<< * else: * modname = getattr(ctx, '__module__', None) */ __pyx_t_3 = __Pyx_GetAttr3(__pyx_v_ctx, __pyx_n_s_name_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":225 * cdef ctx = self.self * cdef name = None * if PyModule_Check(ctx): # <<<<<<<<<<<<<< * name = getattr(ctx, '__name__', None) * else: */ goto __pyx_L5; } /* "petsc4py/PETSc/libpetsc4py.pyx":228 * name = getattr(ctx, '__name__', None) * else: * modname = getattr(ctx, '__module__', None) # <<<<<<<<<<<<<< * clsname = None * cls = getattr(ctx, '__class__', None) */ /*else*/ { __pyx_t_3 = __Pyx_GetAttr3(__pyx_v_ctx, __pyx_n_s_module, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_modname = __pyx_t_3; __pyx_t_3 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":229 * else: * modname = getattr(ctx, '__module__', None) * clsname = None # <<<<<<<<<<<<<< * cls = getattr(ctx, '__class__', None) * if cls: */ __Pyx_INCREF(Py_None); __pyx_v_clsname = Py_None; /* "petsc4py/PETSc/libpetsc4py.pyx":230 * modname = getattr(ctx, '__module__', None) * clsname = None * cls = getattr(ctx, '__class__', None) # <<<<<<<<<<<<<< * if cls: * clsname = getattr(cls, '__name__', None) */ __pyx_t_3 = __Pyx_GetAttr3(__pyx_v_ctx, __pyx_n_s_class, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_cls = __pyx_t_3; __pyx_t_3 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":231 * clsname = None * cls = getattr(ctx, '__class__', None) * if cls: # <<<<<<<<<<<<<< * clsname = getattr(cls, '__name__', None) * if not modname: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_cls); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(11, 231, __pyx_L1_error) if (__pyx_t_1) { /* "petsc4py/PETSc/libpetsc4py.pyx":232 * cls = getattr(ctx, '__class__', None) * if cls: * clsname = getattr(cls, '__name__', None) # <<<<<<<<<<<<<< * if not modname: * modname = getattr(cls, '__module__', None) */ __pyx_t_3 = __Pyx_GetAttr3(__pyx_v_cls, __pyx_n_s_name_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_clsname, __pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":233 * if cls: * clsname = getattr(cls, '__name__', None) * if not modname: # <<<<<<<<<<<<<< * modname = getattr(cls, '__module__', None) * if modname and clsname: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_modname); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(11, 233, __pyx_L1_error) __pyx_t_4 = (!__pyx_t_1); if (__pyx_t_4) { /* "petsc4py/PETSc/libpetsc4py.pyx":234 * clsname = getattr(cls, '__name__', None) * if not modname: * modname = getattr(cls, '__module__', None) # <<<<<<<<<<<<<< * if modname and clsname: * name = modname + '.' + clsname */ __pyx_t_3 = __Pyx_GetAttr3(__pyx_v_cls, __pyx_n_s_module, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_modname, __pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":233 * if cls: * clsname = getattr(cls, '__name__', None) * if not modname: # <<<<<<<<<<<<<< * modname = getattr(cls, '__module__', None) * if modname and clsname: */ } /* "petsc4py/PETSc/libpetsc4py.pyx":231 * clsname = None * cls = getattr(ctx, '__class__', None) * if cls: # <<<<<<<<<<<<<< * clsname = getattr(cls, '__name__', None) * if not modname: */ } /* "petsc4py/PETSc/libpetsc4py.pyx":235 * if not modname: * modname = getattr(cls, '__module__', None) * if modname and clsname: # <<<<<<<<<<<<<< * name = modname + '.' + clsname * elif clsname: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_modname); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(11, 235, __pyx_L1_error) if (__pyx_t_1) { } else { __pyx_t_4 = __pyx_t_1; goto __pyx_L9_bool_binop_done; } __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_clsname); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(11, 235, __pyx_L1_error) __pyx_t_4 = __pyx_t_1; __pyx_L9_bool_binop_done:; if (__pyx_t_4) { /* "petsc4py/PETSc/libpetsc4py.pyx":236 * modname = getattr(cls, '__module__', None) * if modname and clsname: * name = modname + '.' + clsname # <<<<<<<<<<<<<< * elif clsname: * name = clsname */ __pyx_t_3 = PyNumber_Add(__pyx_v_modname, __pyx_kp_s__2); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyNumber_Add(__pyx_t_3, __pyx_v_clsname); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":235 * if not modname: * modname = getattr(cls, '__module__', None) * if modname and clsname: # <<<<<<<<<<<<<< * name = modname + '.' + clsname * elif clsname: */ goto __pyx_L8; } /* "petsc4py/PETSc/libpetsc4py.pyx":237 * if modname and clsname: * name = modname + '.' + clsname * elif clsname: # <<<<<<<<<<<<<< * name = clsname * elif modname: */ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_clsname); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(11, 237, __pyx_L1_error) if (__pyx_t_4) { /* "petsc4py/PETSc/libpetsc4py.pyx":238 * name = modname + '.' + clsname * elif clsname: * name = clsname # <<<<<<<<<<<<<< * elif modname: * name = modname */ __Pyx_INCREF(__pyx_v_clsname); __Pyx_DECREF_SET(__pyx_v_name, __pyx_v_clsname); /* "petsc4py/PETSc/libpetsc4py.pyx":237 * if modname and clsname: * name = modname + '.' + clsname * elif clsname: # <<<<<<<<<<<<<< * name = clsname * elif modname: */ goto __pyx_L8; } /* "petsc4py/PETSc/libpetsc4py.pyx":239 * elif clsname: * name = clsname * elif modname: # <<<<<<<<<<<<<< * name = modname * if name is not None: */ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_modname); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(11, 239, __pyx_L1_error) if (__pyx_t_4) { /* "petsc4py/PETSc/libpetsc4py.pyx":240 * name = clsname * elif modname: * name = modname # <<<<<<<<<<<<<< * if name is not None: * self.name = name.encode() */ __Pyx_INCREF(__pyx_v_modname); __Pyx_DECREF_SET(__pyx_v_name, __pyx_v_modname); /* "petsc4py/PETSc/libpetsc4py.pyx":239 * elif clsname: * name = clsname * elif modname: # <<<<<<<<<<<<<< * name = modname * if name is not None: */ } __pyx_L8:; } __pyx_L5:; /* "petsc4py/PETSc/libpetsc4py.pyx":241 * elif modname: * name = modname * if name is not None: # <<<<<<<<<<<<<< * self.name = name.encode() * if self.name is not None: */ __pyx_t_4 = (__pyx_v_name != Py_None); if (__pyx_t_4) { /* "petsc4py/PETSc/libpetsc4py.pyx":242 * name = modname * if name is not None: * self.name = name.encode() # <<<<<<<<<<<<<< * if self.name is not None: * return self.name */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } if (!(likely(PyBytes_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_5))) __PYX_ERR(11, 242, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_5); __Pyx_GOTREF(__pyx_v_self->name); __Pyx_DECREF(__pyx_v_self->name); __pyx_v_self->name = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":241 * elif modname: * name = modname * if name is not None: # <<<<<<<<<<<<<< * self.name = name.encode() * if self.name is not None: */ } /* "petsc4py/PETSc/libpetsc4py.pyx":243 * if name is not None: * self.name = name.encode() * if self.name is not None: # <<<<<<<<<<<<<< * return self.name * return NULL */ __pyx_t_4 = (__pyx_v_self->name != ((PyObject*)Py_None)); if (__pyx_t_4) { /* "petsc4py/PETSc/libpetsc4py.pyx":244 * self.name = name.encode() * if self.name is not None: * return self.name # <<<<<<<<<<<<<< * return NULL * */ if (unlikely(__pyx_v_self->name == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); __PYX_ERR(11, 244, __pyx_L1_error) } __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->name); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(11, 244, __pyx_L1_error) __pyx_r = __pyx_t_2; goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":243 * if name is not None: * self.name = name.encode() * if self.name is not None: # <<<<<<<<<<<<<< * return self.name * return NULL */ } /* "petsc4py/PETSc/libpetsc4py.pyx":245 * if self.name is not None: * return self.name * return NULL # <<<<<<<<<<<<<< * * cdef createcontext(char name_p[]): */ __pyx_r = NULL; goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":218 * return 0 * * cdef char* getname(self) except? NULL: # <<<<<<<<<<<<<< * if self.self is None: * return NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc._PyObj.getname", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ctx); __Pyx_XDECREF(__pyx_v_name); __Pyx_XDECREF(__pyx_v_modname); __Pyx_XDECREF(__pyx_v_clsname); __Pyx_XDECREF(__pyx_v_cls); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":247 * return NULL * * cdef createcontext(char name_p[]): # <<<<<<<<<<<<<< * if name_p == NULL: return None * cdef name = bytes2str(name_p) */ static PyObject *__pyx_f_8petsc4py_5PETSc_createcontext(char *__pyx_v_name_p) { PyObject *__pyx_v_name = 0; PyObject *__pyx_v_mod = 0; PyObject *__pyx_v_path = 0; PyObject *__pyx_v_modname = 0; PyObject *__pyx_v_cls = 0; PyObject *__pyx_v_attr = 0; PyObject *__pyx_v_clsname = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *(*__pyx_t_6)(PyObject *); int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createcontext", 1); /* "petsc4py/PETSc/libpetsc4py.pyx":248 * * cdef createcontext(char name_p[]): * if name_p == NULL: return None # <<<<<<<<<<<<<< * cdef name = bytes2str(name_p) * cdef mod, path, modname=None */ __pyx_t_1 = (__pyx_v_name_p == NULL); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } /* "petsc4py/PETSc/libpetsc4py.pyx":249 * cdef createcontext(char name_p[]): * if name_p == NULL: return None * cdef name = bytes2str(name_p) # <<<<<<<<<<<<<< * cdef mod, path, modname=None * cdef cls, attr, clsname=None */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_name_p); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_name = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":250 * if name_p == NULL: return None * cdef name = bytes2str(name_p) * cdef mod, path, modname=None # <<<<<<<<<<<<<< * cdef cls, attr, clsname=None * # path/to/filename.py:{function|class} */ __Pyx_INCREF(Py_None); __pyx_v_modname = Py_None; /* "petsc4py/PETSc/libpetsc4py.pyx":251 * cdef name = bytes2str(name_p) * cdef mod, path, modname=None * cdef cls, attr, clsname=None # <<<<<<<<<<<<<< * # path/to/filename.py:{function|class} * if ':' in name: */ __Pyx_INCREF(Py_None); __pyx_v_clsname = Py_None; /* "petsc4py/PETSc/libpetsc4py.pyx":253 * cdef cls, attr, clsname=None * # path/to/filename.py:{function|class} * if ':' in name: # <<<<<<<<<<<<<< * path, attr = parse_url(name) * mod = load_module(path) */ __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_kp_s__11, __pyx_v_name, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(11, 253, __pyx_L1_error) if (__pyx_t_1) { /* "petsc4py/PETSc/libpetsc4py.pyx":254 * # path/to/filename.py:{function|class} * if ':' in name: * path, attr = parse_url(name) # <<<<<<<<<<<<<< * mod = load_module(path) * if attr: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_parse_url(__pyx_v_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { PyObject* sequence = __pyx_t_2; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(11, 254, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_3 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); #else __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); index = 0; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 1; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(11, 254, __pyx_L1_error) __pyx_t_6 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(11, 254, __pyx_L1_error) __pyx_L6_unpacking_done:; } __pyx_v_path = __pyx_t_3; __pyx_t_3 = 0; __pyx_v_attr = __pyx_t_4; __pyx_t_4 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":255 * if ':' in name: * path, attr = parse_url(name) * mod = load_module(path) # <<<<<<<<<<<<<< * if attr: * cls = getattr(mod, attr) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_load_module(__pyx_v_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_mod = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":256 * path, attr = parse_url(name) * mod = load_module(path) * if attr: # <<<<<<<<<<<<<< * cls = getattr(mod, attr) * return cls() */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_attr); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(11, 256, __pyx_L1_error) if (__pyx_t_1) { /* "petsc4py/PETSc/libpetsc4py.pyx":257 * mod = load_module(path) * if attr: * cls = getattr(mod, attr) # <<<<<<<<<<<<<< * return cls() * else: */ __pyx_t_2 = __Pyx_GetAttr(__pyx_v_mod, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_cls = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":258 * if attr: * cls = getattr(mod, attr) * return cls() # <<<<<<<<<<<<<< * else: * return mod */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_cls); __pyx_t_4 = __pyx_v_cls; __pyx_t_3 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":256 * path, attr = parse_url(name) * mod = load_module(path) * if attr: # <<<<<<<<<<<<<< * cls = getattr(mod, attr) * return cls() */ } /* "petsc4py/PETSc/libpetsc4py.pyx":260 * return cls() * else: * return mod # <<<<<<<<<<<<<< * # package.module[.{function|class}] * if '.' in name: */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_mod); __pyx_r = __pyx_v_mod; goto __pyx_L0; } /* "petsc4py/PETSc/libpetsc4py.pyx":253 * cdef cls, attr, clsname=None * # path/to/filename.py:{function|class} * if ':' in name: # <<<<<<<<<<<<<< * path, attr = parse_url(name) * mod = load_module(path) */ } /* "petsc4py/PETSc/libpetsc4py.pyx":262 * return mod * # package.module[.{function|class}] * if '.' in name: # <<<<<<<<<<<<<< * modname, clsname = name.rsplit('.', 1) * mod = PyImport_Import(modname) */ __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_kp_s__2, __pyx_v_name, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(11, 262, __pyx_L1_error) if (__pyx_t_1) { /* "petsc4py/PETSc/libpetsc4py.pyx":263 * # package.module[.{function|class}] * if '.' in name: * modname, clsname = name.rsplit('.', 1) # <<<<<<<<<<<<<< * mod = PyImport_Import(modname) * if hasattr(mod, clsname): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_rsplit); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__66, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { PyObject* sequence = __pyx_t_4; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(11, 263, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { Py_ssize_t index = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L9_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L9_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(11, 263, __pyx_L1_error) __pyx_t_6 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L10_unpacking_done; __pyx_L9_unpacking_failed:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(11, 263, __pyx_L1_error) __pyx_L10_unpacking_done:; } __Pyx_DECREF_SET(__pyx_v_modname, __pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_clsname, __pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":264 * if '.' in name: * modname, clsname = name.rsplit('.', 1) * mod = PyImport_Import(modname) # <<<<<<<<<<<<<< * if hasattr(mod, clsname): * cls = getattr(mod, clsname) */ __pyx_t_4 = PyImport_Import(__pyx_v_modname); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 264, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_mod = __pyx_t_4; __pyx_t_4 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":265 * modname, clsname = name.rsplit('.', 1) * mod = PyImport_Import(modname) * if hasattr(mod, clsname): # <<<<<<<<<<<<<< * cls = getattr(mod, clsname) * if not PyModule_Check(cls): */ __pyx_t_1 = __Pyx_HasAttr(__pyx_v_mod, __pyx_v_clsname); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(11, 265, __pyx_L1_error) if (__pyx_t_1) { /* "petsc4py/PETSc/libpetsc4py.pyx":266 * mod = PyImport_Import(modname) * if hasattr(mod, clsname): * cls = getattr(mod, clsname) # <<<<<<<<<<<<<< * if not PyModule_Check(cls): * return cls() */ __pyx_t_4 = __Pyx_GetAttr(__pyx_v_mod, __pyx_v_clsname); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_cls = __pyx_t_4; __pyx_t_4 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":267 * if hasattr(mod, clsname): * cls = getattr(mod, clsname) * if not PyModule_Check(cls): # <<<<<<<<<<<<<< * return cls() * # package[.module] */ __pyx_t_1 = (!PyModule_Check(__pyx_v_cls)); if (__pyx_t_1) { /* "petsc4py/PETSc/libpetsc4py.pyx":268 * cls = getattr(mod, clsname) * if not PyModule_Check(cls): * return cls() # <<<<<<<<<<<<<< * # package[.module] * mod = PyImport_Import(name) */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_cls); __pyx_t_3 = __pyx_v_cls; __pyx_t_2 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":267 * if hasattr(mod, clsname): * cls = getattr(mod, clsname) * if not PyModule_Check(cls): # <<<<<<<<<<<<<< * return cls() * # package[.module] */ } /* "petsc4py/PETSc/libpetsc4py.pyx":265 * modname, clsname = name.rsplit('.', 1) * mod = PyImport_Import(modname) * if hasattr(mod, clsname): # <<<<<<<<<<<<<< * cls = getattr(mod, clsname) * if not PyModule_Check(cls): */ } /* "petsc4py/PETSc/libpetsc4py.pyx":262 * return mod * # package.module[.{function|class}] * if '.' in name: # <<<<<<<<<<<<<< * modname, clsname = name.rsplit('.', 1) * mod = PyImport_Import(modname) */ } /* "petsc4py/PETSc/libpetsc4py.pyx":270 * return cls() * # package[.module] * mod = PyImport_Import(name) # <<<<<<<<<<<<<< * return mod * */ __pyx_t_4 = PyImport_Import(__pyx_v_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_mod, __pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":271 * # package[.module] * mod = PyImport_Import(name) * return mod # <<<<<<<<<<<<<< * * cdef int viewcontext(_PyObj ctx, PetscViewer viewer) except -1: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_mod); __pyx_r = __pyx_v_mod; goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":247 * return NULL * * cdef createcontext(char name_p[]): # <<<<<<<<<<<<<< * if name_p == NULL: return None * cdef name = bytes2str(name_p) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.createcontext", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XDECREF(__pyx_v_mod); __Pyx_XDECREF(__pyx_v_path); __Pyx_XDECREF(__pyx_v_modname); __Pyx_XDECREF(__pyx_v_cls); __Pyx_XDECREF(__pyx_v_attr); __Pyx_XDECREF(__pyx_v_clsname); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":273 * return mod * * cdef int viewcontext(_PyObj ctx, PetscViewer viewer) except -1: # <<<<<<<<<<<<<< * cdef PetscBool isascii = PETSC_FALSE, isstring = PETSC_FALSE * CHKERR( PetscObjectTypeCompare(viewer, PETSCVIEWERASCII, &isascii) ) */ static int __pyx_f_8petsc4py_5PETSc_viewcontext(struct __pyx_obj_8petsc4py_5PETSc__PyObj *__pyx_v_ctx, PetscViewer __pyx_v_viewer) { PetscBool __pyx_v_isascii; PetscBool __pyx_v_isstring; char *__pyx_v_name; int __pyx_r; PetscErrorCode __pyx_t_1; char *__pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":274 * * cdef int viewcontext(_PyObj ctx, PetscViewer viewer) except -1: * cdef PetscBool isascii = PETSC_FALSE, isstring = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( PetscObjectTypeCompare(viewer, PETSCVIEWERASCII, &isascii) ) * CHKERR( PetscObjectTypeCompare(viewer, PETSCVIEWERSTRING, &isstring) ) */ __pyx_v_isascii = PETSC_FALSE; __pyx_v_isstring = PETSC_FALSE; /* "petsc4py/PETSc/libpetsc4py.pyx":275 * cdef int viewcontext(_PyObj ctx, PetscViewer viewer) except -1: * cdef PetscBool isascii = PETSC_FALSE, isstring = PETSC_FALSE * CHKERR( PetscObjectTypeCompare(viewer, PETSCVIEWERASCII, &isascii) ) # <<<<<<<<<<<<<< * CHKERR( PetscObjectTypeCompare(viewer, PETSCVIEWERSTRING, &isstring) ) * cdef char *name = ctx.getname() */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectTypeCompare(((PetscObject)__pyx_v_viewer), PETSCVIEWERASCII, (&__pyx_v_isascii))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 275, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":276 * cdef PetscBool isascii = PETSC_FALSE, isstring = PETSC_FALSE * CHKERR( PetscObjectTypeCompare(viewer, PETSCVIEWERASCII, &isascii) ) * CHKERR( PetscObjectTypeCompare(viewer, PETSCVIEWERSTRING, &isstring) ) # <<<<<<<<<<<<<< * cdef char *name = ctx.getname() * if isascii: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectTypeCompare(((PetscObject)__pyx_v_viewer), PETSCVIEWERSTRING, (&__pyx_v_isstring))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 276, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":277 * CHKERR( PetscObjectTypeCompare(viewer, PETSCVIEWERASCII, &isascii) ) * CHKERR( PetscObjectTypeCompare(viewer, PETSCVIEWERSTRING, &isstring) ) * cdef char *name = ctx.getname() # <<<<<<<<<<<<<< * if isascii: * if name == NULL: name = b"unknown/no yet set" */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__PyObj *)__pyx_v_ctx->__pyx_vtab)->getname(__pyx_v_ctx); if (unlikely(__pyx_t_2 == ((char *)NULL) && PyErr_Occurred())) __PYX_ERR(11, 277, __pyx_L1_error) __pyx_v_name = __pyx_t_2; /* "petsc4py/PETSc/libpetsc4py.pyx":278 * CHKERR( PetscObjectTypeCompare(viewer, PETSCVIEWERSTRING, &isstring) ) * cdef char *name = ctx.getname() * if isascii: # <<<<<<<<<<<<<< * if name == NULL: name = b"unknown/no yet set" * CHKERR( PetscViewerASCIIPrintf(viewer, b" Python: %s\n", name) ) */ if (__pyx_v_isascii) { /* "petsc4py/PETSc/libpetsc4py.pyx":279 * cdef char *name = ctx.getname() * if isascii: * if name == NULL: name = b"unknown/no yet set" # <<<<<<<<<<<<<< * CHKERR( PetscViewerASCIIPrintf(viewer, b" Python: %s\n", name) ) * if isstring: */ __pyx_t_3 = (__pyx_v_name == NULL); if (__pyx_t_3) { __pyx_v_name = ((char *)"unknown/no yet set"); } /* "petsc4py/PETSc/libpetsc4py.pyx":280 * if isascii: * if name == NULL: name = b"unknown/no yet set" * CHKERR( PetscViewerASCIIPrintf(viewer, b" Python: %s\n", name) ) # <<<<<<<<<<<<<< * if isstring: * if name == NULL: name = b"" */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerASCIIPrintf(__pyx_v_viewer, ((char *)" Python: %s\n"), __pyx_v_name)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 280, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":278 * CHKERR( PetscObjectTypeCompare(viewer, PETSCVIEWERSTRING, &isstring) ) * cdef char *name = ctx.getname() * if isascii: # <<<<<<<<<<<<<< * if name == NULL: name = b"unknown/no yet set" * CHKERR( PetscViewerASCIIPrintf(viewer, b" Python: %s\n", name) ) */ } /* "petsc4py/PETSc/libpetsc4py.pyx":281 * if name == NULL: name = b"unknown/no yet set" * CHKERR( PetscViewerASCIIPrintf(viewer, b" Python: %s\n", name) ) * if isstring: # <<<<<<<<<<<<<< * if name == NULL: name = b"" * CHKERR( PetscViewerStringSPrintf(viewer, "%s", name) ) */ if (__pyx_v_isstring) { /* "petsc4py/PETSc/libpetsc4py.pyx":282 * CHKERR( PetscViewerASCIIPrintf(viewer, b" Python: %s\n", name) ) * if isstring: * if name == NULL: name = b"" # <<<<<<<<<<<<<< * CHKERR( PetscViewerStringSPrintf(viewer, "%s", name) ) * return 0 */ __pyx_t_3 = (__pyx_v_name == NULL); if (__pyx_t_3) { __pyx_v_name = ((char *)""); } /* "petsc4py/PETSc/libpetsc4py.pyx":283 * if isstring: * if name == NULL: name = b"" * CHKERR( PetscViewerStringSPrintf(viewer, "%s", name) ) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerStringSPrintf(__pyx_v_viewer, ((char *)"%s"), __pyx_v_name)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 283, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":281 * if name == NULL: name = b"unknown/no yet set" * CHKERR( PetscViewerASCIIPrintf(viewer, b" Python: %s\n", name) ) * if isstring: # <<<<<<<<<<<<<< * if name == NULL: name = b"" * CHKERR( PetscViewerStringSPrintf(viewer, "%s", name) ) */ } /* "petsc4py/PETSc/libpetsc4py.pyx":284 * if name == NULL: name = b"" * CHKERR( PetscViewerStringSPrintf(viewer, "%s", name) ) * return 0 # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_r = 0; goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":273 * return mod * * cdef int viewcontext(_PyObj ctx, PetscViewer viewer) except -1: # <<<<<<<<<<<<<< * cdef PetscBool isascii = PETSC_FALSE, isstring = PETSC_FALSE * CHKERR( PetscObjectTypeCompare(viewer, PETSCVIEWERASCII, &isascii) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.viewcontext", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":344 * @cython.internal * cdef class _PyMat(_PyObj): pass * cdef inline _PyMat PyMat(PetscMat mat): # <<<<<<<<<<<<<< * if mat != NULL and mat.data != NULL: * return <_PyMat>mat.data */ static CYTHON_INLINE struct __pyx_obj_8petsc4py_5PETSc__PyMat *__pyx_f_8petsc4py_5PETSc_PyMat(Mat __pyx_v_mat) { struct __pyx_obj_8petsc4py_5PETSc__PyMat *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyMat", 1); /* "petsc4py/PETSc/libpetsc4py.pyx":345 * cdef class _PyMat(_PyObj): pass * cdef inline _PyMat PyMat(PetscMat mat): * if mat != NULL and mat.data != NULL: # <<<<<<<<<<<<<< * return <_PyMat>mat.data * else: */ __pyx_t_2 = (__pyx_v_mat != NULL); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = (__pyx_v_mat->data != NULL); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "petsc4py/PETSc/libpetsc4py.pyx":346 * cdef inline _PyMat PyMat(PetscMat mat): * if mat != NULL and mat.data != NULL: * return <_PyMat>mat.data # <<<<<<<<<<<<<< * else: * return _PyMat.__new__(_PyMat) */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)((struct __pyx_obj_8petsc4py_5PETSc__PyMat *)__pyx_v_mat->data)); __pyx_r = ((struct __pyx_obj_8petsc4py_5PETSc__PyMat *)__pyx_v_mat->data); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":345 * cdef class _PyMat(_PyObj): pass * cdef inline _PyMat PyMat(PetscMat mat): * if mat != NULL and mat.data != NULL: # <<<<<<<<<<<<<< * return <_PyMat>mat.data * else: */ } /* "petsc4py/PETSc/libpetsc4py.pyx":348 * return <_PyMat>mat.data * else: * return _PyMat.__new__(_PyMat) # <<<<<<<<<<<<<< * * cdef public PetscErrorCode MatPythonGetContext(PetscMat mat, void **ctx) \ */ /*else*/ { __Pyx_XDECREF((PyObject *)__pyx_r); __pyx_t_3 = ((PyObject *)__pyx_tp_new_8petsc4py_5PETSc__PyMat(((PyTypeObject *)__pyx_ptype_8petsc4py_5PETSc__PyMat), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 348, __pyx_L1_error) __Pyx_GOTREF((PyObject *)__pyx_t_3); __pyx_r = ((struct __pyx_obj_8petsc4py_5PETSc__PyMat *)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; } /* "petsc4py/PETSc/libpetsc4py.pyx":344 * @cython.internal * cdef class _PyMat(_PyObj): pass * cdef inline _PyMat PyMat(PetscMat mat): # <<<<<<<<<<<<<< * if mat != NULL and mat.data != NULL: * return <_PyMat>mat.data */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.PyMat", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":350 * return _PyMat.__new__(_PyMat) * * cdef public PetscErrorCode MatPythonGetContext(PetscMat mat, void **ctx) \ # <<<<<<<<<<<<<< * except PETSC_ERR_PYTHON: * FunctionBegin(b"MatPythonGetContext") */ PetscErrorCode MatPythonGetContext(Mat __pyx_v_mat, void **__pyx_v_ctx) { PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("MatPythonGetContext", 1); /* "petsc4py/PETSc/libpetsc4py.pyx":352 * cdef public PetscErrorCode MatPythonGetContext(PetscMat mat, void **ctx) \ * except PETSC_ERR_PYTHON: * FunctionBegin(b"MatPythonGetContext") # <<<<<<<<<<<<<< * PyMat(mat).getcontext(ctx) * return FunctionEnd() */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"MatPythonGetContext")); /* "petsc4py/PETSc/libpetsc4py.pyx":353 * except PETSC_ERR_PYTHON: * FunctionBegin(b"MatPythonGetContext") * PyMat(mat).getcontext(ctx) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__PyMat *)((struct __pyx_obj_8petsc4py_5PETSc__PyMat *)__pyx_t_1)->__pyx_base.__pyx_vtab)->__pyx_base.getcontext(((struct __pyx_obj_8petsc4py_5PETSc__PyObj *)__pyx_t_1), __pyx_v_ctx); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(11, 353, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":354 * FunctionBegin(b"MatPythonGetContext") * PyMat(mat).getcontext(ctx) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef public PetscErrorCode MatPythonSetContext(PetscMat mat, void *ctx) \ */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":350 * return _PyMat.__new__(_PyMat) * * cdef public PetscErrorCode MatPythonGetContext(PetscMat mat, void **ctx) \ # <<<<<<<<<<<<<< * except PETSC_ERR_PYTHON: * FunctionBegin(b"MatPythonGetContext") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.MatPythonGetContext", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":356 * return FunctionEnd() * * cdef public PetscErrorCode MatPythonSetContext(PetscMat mat, void *ctx) \ # <<<<<<<<<<<<<< * except PETSC_ERR_PYTHON: * FunctionBegin(b"MatPythonSetContext") */ PetscErrorCode MatPythonSetContext(Mat __pyx_v_mat, void *__pyx_v_ctx) { PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("MatPythonSetContext", 1); /* "petsc4py/PETSc/libpetsc4py.pyx":358 * cdef public PetscErrorCode MatPythonSetContext(PetscMat mat, void *ctx) \ * except PETSC_ERR_PYTHON: * FunctionBegin(b"MatPythonSetContext") # <<<<<<<<<<<<<< * PyMat(mat).setcontext(ctx, Mat_(mat)) * return FunctionEnd() */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"MatPythonSetContext")); /* "petsc4py/PETSc/libpetsc4py.pyx":359 * except PETSC_ERR_PYTHON: * FunctionBegin(b"MatPythonSetContext") * PyMat(mat).setcontext(ctx, Mat_(mat)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__PyMat *)((struct __pyx_obj_8petsc4py_5PETSc__PyMat *)__pyx_t_1)->__pyx_base.__pyx_vtab)->__pyx_base.setcontext(((struct __pyx_obj_8petsc4py_5PETSc__PyObj *)__pyx_t_1), __pyx_v_ctx, ((struct PyPetscObjectObject *)__pyx_t_2)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(11, 359, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":360 * FunctionBegin(b"MatPythonSetContext") * PyMat(mat).setcontext(ctx, Mat_(mat)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatPythonSetType_PYTHON(PetscMat mat, char name[]) \ */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":356 * return FunctionEnd() * * cdef public PetscErrorCode MatPythonSetContext(PetscMat mat, void *ctx) \ # <<<<<<<<<<<<<< * except PETSC_ERR_PYTHON: * FunctionBegin(b"MatPythonSetContext") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.MatPythonSetContext", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":362 * return FunctionEnd() * * cdef PetscErrorCode MatPythonSetType_PYTHON(PetscMat mat, char name[]) \ # <<<<<<<<<<<<<< * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatPythonSetType_PYTHON") */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatPythonSetType_PYTHON(Mat __pyx_v_mat, char *__pyx_v_name) { PyObject *__pyx_v_ctx = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatPythonSetType_PYTHON", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":364 * cdef PetscErrorCode MatPythonSetType_PYTHON(PetscMat mat, char name[]) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatPythonSetType_PYTHON") # <<<<<<<<<<<<<< * if name == NULL: return FunctionEnd() # XXX * cdef object ctx = createcontext(name) */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"MatPythonSetType_PYTHON")); /* "petsc4py/PETSc/libpetsc4py.pyx":365 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatPythonSetType_PYTHON") * if name == NULL: return FunctionEnd() # XXX # <<<<<<<<<<<<<< * cdef object ctx = createcontext(name) * MatPythonSetContext(mat, ctx) */ __pyx_t_1 = (__pyx_v_name == NULL); if (__pyx_t_1) { __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; } /* "petsc4py/PETSc/libpetsc4py.pyx":366 * FunctionBegin(b"MatPythonSetType_PYTHON") * if name == NULL: return FunctionEnd() # XXX * cdef object ctx = createcontext(name) # <<<<<<<<<<<<<< * MatPythonSetContext(mat, ctx) * PyMat(mat).setname(name) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_createcontext(__pyx_v_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_ctx = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":367 * if name == NULL: return FunctionEnd() # XXX * cdef object ctx = createcontext(name) * MatPythonSetContext(mat, ctx) # <<<<<<<<<<<<<< * PyMat(mat).setname(name) * return FunctionEnd() */ __pyx_t_3 = MatPythonSetContext(__pyx_v_mat, ((void *)__pyx_v_ctx)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 367, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":368 * cdef object ctx = createcontext(name) * MatPythonSetContext(mat, ctx) * PyMat(mat).setname(name) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__PyMat *)((struct __pyx_obj_8petsc4py_5PETSc__PyMat *)__pyx_t_2)->__pyx_base.__pyx_vtab)->__pyx_base.setname(((struct __pyx_obj_8petsc4py_5PETSc__PyObj *)__pyx_t_2), __pyx_v_name); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(11, 368, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":369 * MatPythonSetContext(mat, ctx) * PyMat(mat).setname(name) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatPythonGetType_PYTHON(PetscMat mat, const char *name[]) \ */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":362 * return FunctionEnd() * * cdef PetscErrorCode MatPythonSetType_PYTHON(PetscMat mat, char name[]) \ # <<<<<<<<<<<<<< * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatPythonSetType_PYTHON") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.MatPythonSetType_PYTHON", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ctx); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":371 * return FunctionEnd() * * cdef PetscErrorCode MatPythonGetType_PYTHON(PetscMat mat, const char *name[]) \ # <<<<<<<<<<<<<< * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatPythonGetType_PYTHON") */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatPythonGetType_PYTHON(Mat __pyx_v_mat, char const **__pyx_v_name) { PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; char *__pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatPythonGetType_PYTHON", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":373 * cdef PetscErrorCode MatPythonGetType_PYTHON(PetscMat mat, const char *name[]) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatPythonGetType_PYTHON") # <<<<<<<<<<<<<< * name[0] = PyMat(mat).getname() * return FunctionEnd() */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"MatPythonGetType_PYTHON")); /* "petsc4py/PETSc/libpetsc4py.pyx":374 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatPythonGetType_PYTHON") * name[0] = PyMat(mat).getname() # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__PyMat *)((struct __pyx_obj_8petsc4py_5PETSc__PyMat *)__pyx_t_1)->__pyx_base.__pyx_vtab)->__pyx_base.getname(((struct __pyx_obj_8petsc4py_5PETSc__PyObj *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((char *)NULL) && PyErr_Occurred())) __PYX_ERR(11, 374, __pyx_L1_error) (__pyx_v_name[0]) = __pyx_t_2; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":375 * FunctionBegin(b"MatPythonGetType_PYTHON") * name[0] = PyMat(mat).getname() * return FunctionEnd() # <<<<<<<<<<<<<< * * #FIXME: view and setFromOptions? */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":371 * return FunctionEnd() * * cdef PetscErrorCode MatPythonGetType_PYTHON(PetscMat mat, const char *name[]) \ # <<<<<<<<<<<<<< * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatPythonGetType_PYTHON") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.MatPythonGetType_PYTHON", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":409 * } * * cdef PetscErrorCode MatCreate_Python( # <<<<<<<<<<<<<< * PetscMat mat, * ) \ */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatCreate_Python(Mat __pyx_v_mat) { MatOps __pyx_v_ops; PyObject *__pyx_v_ctx = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations MatOps __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatCreate_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":413 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatCreate_Python") # <<<<<<<<<<<<<< * # * cdef MatOps ops = mat.ops */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"MatCreate_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":415 * FunctionBegin(b"MatCreate_Python") * # * cdef MatOps ops = mat.ops # <<<<<<<<<<<<<< * ops.destroy = MatDestroy_Python * ops.setfromoptions = MatSetFromOptions_Python */ __pyx_t_1 = __pyx_v_mat->ops; __pyx_v_ops = __pyx_t_1; /* "petsc4py/PETSc/libpetsc4py.pyx":416 * # * cdef MatOps ops = mat.ops * ops.destroy = MatDestroy_Python # <<<<<<<<<<<<<< * ops.setfromoptions = MatSetFromOptions_Python * ops.view = MatView_Python */ __pyx_v_ops->destroy = __pyx_f_8petsc4py_5PETSc_MatDestroy_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":417 * cdef MatOps ops = mat.ops * ops.destroy = MatDestroy_Python * ops.setfromoptions = MatSetFromOptions_Python # <<<<<<<<<<<<<< * ops.view = MatView_Python * ops.duplicate = MatDuplicate_Python */ __pyx_v_ops->setfromoptions = __pyx_f_8petsc4py_5PETSc_MatSetFromOptions_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":418 * ops.destroy = MatDestroy_Python * ops.setfromoptions = MatSetFromOptions_Python * ops.view = MatView_Python # <<<<<<<<<<<<<< * ops.duplicate = MatDuplicate_Python * ops.copy = MatCopy_Python */ __pyx_v_ops->view = __pyx_f_8petsc4py_5PETSc_MatView_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":419 * ops.setfromoptions = MatSetFromOptions_Python * ops.view = MatView_Python * ops.duplicate = MatDuplicate_Python # <<<<<<<<<<<<<< * ops.copy = MatCopy_Python * ops.createsubmatrix = MatCreateSubMatrix_Python */ __pyx_v_ops->duplicate = __pyx_f_8petsc4py_5PETSc_MatDuplicate_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":420 * ops.view = MatView_Python * ops.duplicate = MatDuplicate_Python * ops.copy = MatCopy_Python # <<<<<<<<<<<<<< * ops.createsubmatrix = MatCreateSubMatrix_Python * ops.setoption = MatSetOption_Python */ __pyx_v_ops->copy = __pyx_f_8petsc4py_5PETSc_MatCopy_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":421 * ops.duplicate = MatDuplicate_Python * ops.copy = MatCopy_Python * ops.createsubmatrix = MatCreateSubMatrix_Python # <<<<<<<<<<<<<< * ops.setoption = MatSetOption_Python * ops.setup = MatSetUp_Python */ __pyx_v_ops->createsubmatrix = __pyx_f_8petsc4py_5PETSc_MatCreateSubMatrix_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":422 * ops.copy = MatCopy_Python * ops.createsubmatrix = MatCreateSubMatrix_Python * ops.setoption = MatSetOption_Python # <<<<<<<<<<<<<< * ops.setup = MatSetUp_Python * ops.assemblybegin = MatAssemblyBegin_Python */ __pyx_v_ops->setoption = __pyx_f_8petsc4py_5PETSc_MatSetOption_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":423 * ops.createsubmatrix = MatCreateSubMatrix_Python * ops.setoption = MatSetOption_Python * ops.setup = MatSetUp_Python # <<<<<<<<<<<<<< * ops.assemblybegin = MatAssemblyBegin_Python * ops.assemblyend = MatAssemblyEnd_Python */ __pyx_v_ops->setup = __pyx_f_8petsc4py_5PETSc_MatSetUp_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":424 * ops.setoption = MatSetOption_Python * ops.setup = MatSetUp_Python * ops.assemblybegin = MatAssemblyBegin_Python # <<<<<<<<<<<<<< * ops.assemblyend = MatAssemblyEnd_Python * ops.zeroentries = MatZeroEntries_Python */ __pyx_v_ops->assemblybegin = __pyx_f_8petsc4py_5PETSc_MatAssemblyBegin_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":425 * ops.setup = MatSetUp_Python * ops.assemblybegin = MatAssemblyBegin_Python * ops.assemblyend = MatAssemblyEnd_Python # <<<<<<<<<<<<<< * ops.zeroentries = MatZeroEntries_Python * ops.zerorowscolumns = MatZeroRowsColumns_Python */ __pyx_v_ops->assemblyend = __pyx_f_8petsc4py_5PETSc_MatAssemblyEnd_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":426 * ops.assemblybegin = MatAssemblyBegin_Python * ops.assemblyend = MatAssemblyEnd_Python * ops.zeroentries = MatZeroEntries_Python # <<<<<<<<<<<<<< * ops.zerorowscolumns = MatZeroRowsColumns_Python * ops.scale = MatScale_Python */ __pyx_v_ops->zeroentries = __pyx_f_8petsc4py_5PETSc_MatZeroEntries_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":427 * ops.assemblyend = MatAssemblyEnd_Python * ops.zeroentries = MatZeroEntries_Python * ops.zerorowscolumns = MatZeroRowsColumns_Python # <<<<<<<<<<<<<< * ops.scale = MatScale_Python * ops.shift = MatShift_Python */ __pyx_v_ops->zerorowscolumns = __pyx_f_8petsc4py_5PETSc_MatZeroRowsColumns_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":428 * ops.zeroentries = MatZeroEntries_Python * ops.zerorowscolumns = MatZeroRowsColumns_Python * ops.scale = MatScale_Python # <<<<<<<<<<<<<< * ops.shift = MatShift_Python * ops.getvecs = MatCreateVecs_Python */ __pyx_v_ops->scale = __pyx_f_8petsc4py_5PETSc_MatScale_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":429 * ops.zerorowscolumns = MatZeroRowsColumns_Python * ops.scale = MatScale_Python * ops.shift = MatShift_Python # <<<<<<<<<<<<<< * ops.getvecs = MatCreateVecs_Python * ops.mult = MatMult_Python */ __pyx_v_ops->shift = __pyx_f_8petsc4py_5PETSc_MatShift_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":430 * ops.scale = MatScale_Python * ops.shift = MatShift_Python * ops.getvecs = MatCreateVecs_Python # <<<<<<<<<<<<<< * ops.mult = MatMult_Python * ops.sor = MatSOR_Python */ __pyx_v_ops->getvecs = __pyx_f_8petsc4py_5PETSc_MatCreateVecs_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":431 * ops.shift = MatShift_Python * ops.getvecs = MatCreateVecs_Python * ops.mult = MatMult_Python # <<<<<<<<<<<<<< * ops.sor = MatSOR_Python * ops.multtranspose = MatMultTranspose_Python */ __pyx_v_ops->mult = __pyx_f_8petsc4py_5PETSc_MatMult_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":432 * ops.getvecs = MatCreateVecs_Python * ops.mult = MatMult_Python * ops.sor = MatSOR_Python # <<<<<<<<<<<<<< * ops.multtranspose = MatMultTranspose_Python * ops.multhermitian = MatMultHermitian_Python */ __pyx_v_ops->sor = __pyx_f_8petsc4py_5PETSc_MatSOR_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":433 * ops.mult = MatMult_Python * ops.sor = MatSOR_Python * ops.multtranspose = MatMultTranspose_Python # <<<<<<<<<<<<<< * ops.multhermitian = MatMultHermitian_Python * ops.multadd = MatMultAdd_Python */ __pyx_v_ops->multtranspose = __pyx_f_8petsc4py_5PETSc_MatMultTranspose_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":434 * ops.sor = MatSOR_Python * ops.multtranspose = MatMultTranspose_Python * ops.multhermitian = MatMultHermitian_Python # <<<<<<<<<<<<<< * ops.multadd = MatMultAdd_Python * ops.multtransposeadd = MatMultTransposeAdd_Python */ __pyx_v_ops->multhermitiantranspose = __pyx_f_8petsc4py_5PETSc_MatMultHermitian_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":435 * ops.multtranspose = MatMultTranspose_Python * ops.multhermitian = MatMultHermitian_Python * ops.multadd = MatMultAdd_Python # <<<<<<<<<<<<<< * ops.multtransposeadd = MatMultTransposeAdd_Python * ops.multhermitianadd = MatMultHermitianAdd_Python */ __pyx_v_ops->multadd = __pyx_f_8petsc4py_5PETSc_MatMultAdd_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":436 * ops.multhermitian = MatMultHermitian_Python * ops.multadd = MatMultAdd_Python * ops.multtransposeadd = MatMultTransposeAdd_Python # <<<<<<<<<<<<<< * ops.multhermitianadd = MatMultHermitianAdd_Python * ops.multdiagonalblock = MatMultDiagonalBlock_Python */ __pyx_v_ops->multtransposeadd = __pyx_f_8petsc4py_5PETSc_MatMultTransposeAdd_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":437 * ops.multadd = MatMultAdd_Python * ops.multtransposeadd = MatMultTransposeAdd_Python * ops.multhermitianadd = MatMultHermitianAdd_Python # <<<<<<<<<<<<<< * ops.multdiagonalblock = MatMultDiagonalBlock_Python * ops.solve = MatSolve_Python */ __pyx_v_ops->multhermitiantransposeadd = __pyx_f_8petsc4py_5PETSc_MatMultHermitianAdd_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":438 * ops.multtransposeadd = MatMultTransposeAdd_Python * ops.multhermitianadd = MatMultHermitianAdd_Python * ops.multdiagonalblock = MatMultDiagonalBlock_Python # <<<<<<<<<<<<<< * ops.solve = MatSolve_Python * ops.solvetranspose = MatSolveTranspose_Python */ __pyx_v_ops->multdiagonalblock = __pyx_f_8petsc4py_5PETSc_MatMultDiagonalBlock_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":439 * ops.multhermitianadd = MatMultHermitianAdd_Python * ops.multdiagonalblock = MatMultDiagonalBlock_Python * ops.solve = MatSolve_Python # <<<<<<<<<<<<<< * ops.solvetranspose = MatSolveTranspose_Python * ops.solveadd = MatSolveAdd_Python */ __pyx_v_ops->solve = __pyx_f_8petsc4py_5PETSc_MatSolve_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":440 * ops.multdiagonalblock = MatMultDiagonalBlock_Python * ops.solve = MatSolve_Python * ops.solvetranspose = MatSolveTranspose_Python # <<<<<<<<<<<<<< * ops.solveadd = MatSolveAdd_Python * ops.solvetransposeadd = MatSolveTransposeAdd_Python */ __pyx_v_ops->solvetranspose = __pyx_f_8petsc4py_5PETSc_MatSolveTranspose_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":441 * ops.solve = MatSolve_Python * ops.solvetranspose = MatSolveTranspose_Python * ops.solveadd = MatSolveAdd_Python # <<<<<<<<<<<<<< * ops.solvetransposeadd = MatSolveTransposeAdd_Python * ops.getdiagonal = MatGetDiagonal_Python */ __pyx_v_ops->solveadd = __pyx_f_8petsc4py_5PETSc_MatSolveAdd_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":442 * ops.solvetranspose = MatSolveTranspose_Python * ops.solveadd = MatSolveAdd_Python * ops.solvetransposeadd = MatSolveTransposeAdd_Python # <<<<<<<<<<<<<< * ops.getdiagonal = MatGetDiagonal_Python * ops.setdiagonal = MatSetDiagonal_Python */ __pyx_v_ops->solvetransposeadd = __pyx_f_8petsc4py_5PETSc_MatSolveTransposeAdd_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":443 * ops.solveadd = MatSolveAdd_Python * ops.solvetransposeadd = MatSolveTransposeAdd_Python * ops.getdiagonal = MatGetDiagonal_Python # <<<<<<<<<<<<<< * ops.setdiagonal = MatSetDiagonal_Python * ops.diagonalscale = MatDiagonalScale_Python */ __pyx_v_ops->getdiagonal = __pyx_f_8petsc4py_5PETSc_MatGetDiagonal_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":444 * ops.solvetransposeadd = MatSolveTransposeAdd_Python * ops.getdiagonal = MatGetDiagonal_Python * ops.setdiagonal = MatSetDiagonal_Python # <<<<<<<<<<<<<< * ops.diagonalscale = MatDiagonalScale_Python * ops.missingdiagonal = MatMissingDiagonal_Python */ __pyx_v_ops->diagonalset = __pyx_f_8petsc4py_5PETSc_MatSetDiagonal_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":445 * ops.getdiagonal = MatGetDiagonal_Python * ops.setdiagonal = MatSetDiagonal_Python * ops.diagonalscale = MatDiagonalScale_Python # <<<<<<<<<<<<<< * ops.missingdiagonal = MatMissingDiagonal_Python * ops.norm = MatNorm_Python */ __pyx_v_ops->diagonalscale = __pyx_f_8petsc4py_5PETSc_MatDiagonalScale_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":446 * ops.setdiagonal = MatSetDiagonal_Python * ops.diagonalscale = MatDiagonalScale_Python * ops.missingdiagonal = MatMissingDiagonal_Python # <<<<<<<<<<<<<< * ops.norm = MatNorm_Python * ops.realpart = MatRealPart_Python */ __pyx_v_ops->missingdiagonal = __pyx_f_8petsc4py_5PETSc_MatMissingDiagonal_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":447 * ops.diagonalscale = MatDiagonalScale_Python * ops.missingdiagonal = MatMissingDiagonal_Python * ops.norm = MatNorm_Python # <<<<<<<<<<<<<< * ops.realpart = MatRealPart_Python * ops.imagpart = MatImagPart_Python */ __pyx_v_ops->norm = __pyx_f_8petsc4py_5PETSc_MatNorm_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":448 * ops.missingdiagonal = MatMissingDiagonal_Python * ops.norm = MatNorm_Python * ops.realpart = MatRealPart_Python # <<<<<<<<<<<<<< * ops.imagpart = MatImagPart_Python * ops.conjugate = MatConjugate_Python */ __pyx_v_ops->realpart = __pyx_f_8petsc4py_5PETSc_MatRealPart_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":449 * ops.norm = MatNorm_Python * ops.realpart = MatRealPart_Python * ops.imagpart = MatImagPart_Python # <<<<<<<<<<<<<< * ops.conjugate = MatConjugate_Python * ops.hasoperation = MatHasOperation_Python */ __pyx_v_ops->imaginarypart = __pyx_f_8petsc4py_5PETSc_MatImagPart_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":450 * ops.realpart = MatRealPart_Python * ops.imagpart = MatImagPart_Python * ops.conjugate = MatConjugate_Python # <<<<<<<<<<<<<< * ops.hasoperation = MatHasOperation_Python * ops.getdiagonalblock = MatGetDiagonalBlock_Python */ __pyx_v_ops->conjugate = __pyx_f_8petsc4py_5PETSc_MatConjugate_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":451 * ops.imagpart = MatImagPart_Python * ops.conjugate = MatConjugate_Python * ops.hasoperation = MatHasOperation_Python # <<<<<<<<<<<<<< * ops.getdiagonalblock = MatGetDiagonalBlock_Python * */ __pyx_v_ops->hasoperation = __pyx_f_8petsc4py_5PETSc_MatHasOperation_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":452 * ops.conjugate = MatConjugate_Python * ops.hasoperation = MatHasOperation_Python * ops.getdiagonalblock = MatGetDiagonalBlock_Python # <<<<<<<<<<<<<< * * ops.productsetfromoptions = MatProductSetFromOptions_Python */ __pyx_v_ops->getdiagonalblock = __pyx_f_8petsc4py_5PETSc_MatGetDiagonalBlock_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":454 * ops.getdiagonalblock = MatGetDiagonalBlock_Python * * ops.productsetfromoptions = MatProductSetFromOptions_Python # <<<<<<<<<<<<<< * * # */ __pyx_v_ops->productsetfromoptions = __pyx_f_8petsc4py_5PETSc_MatProductSetFromOptions_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":457 * * # * mat.assembled = PETSC_TRUE # XXX # <<<<<<<<<<<<<< * mat.preallocated = PETSC_FALSE # XXX * # */ __pyx_v_mat->assembled = PETSC_TRUE; /* "petsc4py/PETSc/libpetsc4py.pyx":458 * # * mat.assembled = PETSC_TRUE # XXX * mat.preallocated = PETSC_FALSE # XXX # <<<<<<<<<<<<<< * # * CHKERR( PetscObjectComposeFunction( */ __pyx_v_mat->preallocated = PETSC_FALSE; /* "petsc4py/PETSc/libpetsc4py.pyx":460 * mat.preallocated = PETSC_FALSE # XXX * # * CHKERR( PetscObjectComposeFunction( # <<<<<<<<<<<<<< * mat, b"MatPythonSetType_C", * MatPythonSetType_PYTHON) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectComposeFunction(((PetscObject)__pyx_v_mat), ((char *)"MatPythonSetType_C"), ((PetscVoidFunction)__pyx_f_8petsc4py_5PETSc_MatPythonSetType_PYTHON))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 460, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":463 * mat, b"MatPythonSetType_C", * MatPythonSetType_PYTHON) ) * CHKERR( PetscObjectComposeFunction( # <<<<<<<<<<<<<< * mat, b"MatPythonGetType_C", * MatPythonGetType_PYTHON) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectComposeFunction(((PetscObject)__pyx_v_mat), ((char *)"MatPythonGetType_C"), ((PetscVoidFunction)__pyx_f_8petsc4py_5PETSc_MatPythonGetType_PYTHON))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 463, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":466 * mat, b"MatPythonGetType_C", * MatPythonGetType_PYTHON) ) * CHKERR( PetscObjectComposeFunction( # <<<<<<<<<<<<<< * mat, b"MatProductSetFromOptions_anytype_C", * MatProductSetFromOptions_Python) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectComposeFunction(((PetscObject)__pyx_v_mat), ((char *)"MatProductSetFromOptions_anytype_C"), ((PetscVoidFunction)__pyx_f_8petsc4py_5PETSc_MatProductSetFromOptions_Python))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 466, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":469 * mat, b"MatProductSetFromOptions_anytype_C", * MatProductSetFromOptions_Python) ) * CHKERR( PetscObjectChangeTypeName( # <<<<<<<<<<<<<< * mat, MATPYTHON) ) * # */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectChangeTypeName(((PetscObject)__pyx_v_mat), MATPYTHON)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 469, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":472 * mat, MATPYTHON) ) * # * cdef ctx = PyMat(NULL) # <<<<<<<<<<<<<< * mat.data = ctx * Py_INCREF(mat.data) */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyMat(NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 472, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_ctx = __pyx_t_3; __pyx_t_3 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":473 * # * cdef ctx = PyMat(NULL) * mat.data = ctx # <<<<<<<<<<<<<< * Py_INCREF(mat.data) * return FunctionEnd() */ __pyx_v_mat->data = ((void *)__pyx_v_ctx); /* "petsc4py/PETSc/libpetsc4py.pyx":474 * cdef ctx = PyMat(NULL) * mat.data = ctx * Py_INCREF(mat.data) # <<<<<<<<<<<<<< * return FunctionEnd() * */ Py_INCREF(((PyObject *)__pyx_v_mat->data)); /* "petsc4py/PETSc/libpetsc4py.pyx":475 * mat.data = ctx * Py_INCREF(mat.data) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef inline PetscErrorCode MatDestroy_Python_inner( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":409 * } * * cdef PetscErrorCode MatCreate_Python( # <<<<<<<<<<<<<< * PetscMat mat, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.MatCreate_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ctx); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":477 * return FunctionEnd() * * cdef inline PetscErrorCode MatDestroy_Python_inner( # <<<<<<<<<<<<<< * PetscMat mat, * ) \ */ static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatDestroy_Python_inner(Mat __pyx_v_mat) { PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_t_2; int __pyx_t_3; char const *__pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatDestroy_Python_inner", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":481 * ) \ * except PETSC_ERR_PYTHON with gil: * try: # <<<<<<<<<<<<<< * addRef(mat) * MatPythonSetContext(mat, NULL) */ /*try:*/ { /* "petsc4py/PETSc/libpetsc4py.pyx":482 * except PETSC_ERR_PYTHON with gil: * try: * addRef(mat) # <<<<<<<<<<<<<< * MatPythonSetContext(mat, NULL) * finally: */ __pyx_f_8petsc4py_5PETSc_addRef(__pyx_v_mat); /* "petsc4py/PETSc/libpetsc4py.pyx":483 * try: * addRef(mat) * MatPythonSetContext(mat, NULL) # <<<<<<<<<<<<<< * finally: * delRef(mat) */ __pyx_t_1 = MatPythonSetContext(__pyx_v_mat, NULL); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 483, __pyx_L4_error) } /* "petsc4py/PETSc/libpetsc4py.pyx":485 * MatPythonSetContext(mat, NULL) * finally: * delRef(mat) # <<<<<<<<<<<<<< * Py_DECREF(mat.data) * mat.data = NULL */ /*finally:*/ { /*normal exit:*/{ __pyx_f_8petsc4py_5PETSc_delRef(__pyx_v_mat); /* "petsc4py/PETSc/libpetsc4py.pyx":486 * finally: * delRef(mat) * Py_DECREF(mat.data) # <<<<<<<<<<<<<< * mat.data = NULL * return PETSC_SUCCESS */ Py_DECREF(((PyObject *)__pyx_v_mat->data)); /* "petsc4py/PETSc/libpetsc4py.pyx":487 * delRef(mat) * Py_DECREF(mat.data) * mat.data = NULL # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_v_mat->data = NULL; goto __pyx_L5; } __pyx_L4_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0)) __Pyx_ErrFetch(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __pyx_t_2 = __pyx_lineno; __pyx_t_3 = __pyx_clineno; __pyx_t_4 = __pyx_filename; { /* "petsc4py/PETSc/libpetsc4py.pyx":485 * MatPythonSetContext(mat, NULL) * finally: * delRef(mat) # <<<<<<<<<<<<<< * Py_DECREF(mat.data) * mat.data = NULL */ __pyx_f_8petsc4py_5PETSc_delRef(__pyx_v_mat); /* "petsc4py/PETSc/libpetsc4py.pyx":486 * finally: * delRef(mat) * Py_DECREF(mat.data) # <<<<<<<<<<<<<< * mat.data = NULL * return PETSC_SUCCESS */ Py_DECREF(((PyObject *)__pyx_v_mat->data)); /* "petsc4py/PETSc/libpetsc4py.pyx":487 * delRef(mat) * Py_DECREF(mat.data) * mat.data = NULL # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_v_mat->data = NULL; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); } __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_ErrRestore(__pyx_t_5, __pyx_t_6, __pyx_t_7); __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_lineno = __pyx_t_2; __pyx_clineno = __pyx_t_3; __pyx_filename = __pyx_t_4; goto __pyx_L1_error; } __pyx_L5:; } /* "petsc4py/PETSc/libpetsc4py.pyx":488 * Py_DECREF(mat.data) * mat.data = NULL * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatDestroy_Python( */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":477 * return FunctionEnd() * * cdef inline PetscErrorCode MatDestroy_Python_inner( # <<<<<<<<<<<<<< * PetscMat mat, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.MatDestroy_Python_inner", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":490 * return PETSC_SUCCESS * * cdef PetscErrorCode MatDestroy_Python( # <<<<<<<<<<<<<< * PetscMat mat, * ) \ */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatDestroy_Python(Mat __pyx_v_mat) { PetscErrorCode __pyx_r; PetscErrorCode __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save; #endif /* "petsc4py/PETSc/libpetsc4py.pyx":495 * except PETSC_ERR_PYTHON nogil: * * FunctionBegin(b"MatDestroy_Python") # <<<<<<<<<<<<<< * CHKERR( PetscObjectComposeFunction( * mat, b"MatPythonSetType_C", */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"MatDestroy_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":496 * * FunctionBegin(b"MatDestroy_Python") * CHKERR( PetscObjectComposeFunction( # <<<<<<<<<<<<<< * mat, b"MatPythonSetType_C", * NULL) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectComposeFunction(((PetscObject)__pyx_v_mat), ((char *)"MatPythonSetType_C"), ((PetscVoidFunction)NULL))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 496, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":499 * mat, b"MatPythonSetType_C", * NULL) ) * CHKERR( PetscObjectComposeFunction( # <<<<<<<<<<<<<< * mat, b"MatPythonGetType_C", * NULL) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectComposeFunction(((PetscObject)__pyx_v_mat), ((char *)"MatPythonGetType_C"), ((PetscVoidFunction)NULL))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 499, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":502 * mat, b"MatPythonGetType_C", * NULL) ) * CHKERR( PetscObjectComposeFunction( # <<<<<<<<<<<<<< * mat, b"MatProductSetFromOptions_anytype_C", * NULL) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectComposeFunction(((PetscObject)__pyx_v_mat), ((char *)"MatProductSetFromOptions_anytype_C"), ((PetscVoidFunction)NULL))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 502, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":505 * mat, b"MatProductSetFromOptions_anytype_C", * NULL) ) * CHKERR( PetscObjectChangeTypeName( # <<<<<<<<<<<<<< * mat, NULL) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectChangeTypeName(((PetscObject)__pyx_v_mat), NULL)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 505, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":508 * mat, NULL) ) * * if Py_IsInitialized(): MatDestroy_Python_inner(mat) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_2 = (Py_IsInitialized() != 0); if (__pyx_t_2) { __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_MatDestroy_Python_inner(__pyx_v_mat); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 508, __pyx_L1_error) } /* "petsc4py/PETSc/libpetsc4py.pyx":509 * * if Py_IsInitialized(): MatDestroy_Python_inner(mat) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatSetFromOptions_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":490 * return PETSC_SUCCESS * * cdef PetscErrorCode MatDestroy_Python( # <<<<<<<<<<<<<< * PetscMat mat, * ) \ */ /* function exit code */ __pyx_L1_error:; #ifdef WITH_THREAD __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_AddTraceback("petsc4py.PETSc.MatDestroy_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":511 * return FunctionEnd() * * cdef PetscErrorCode MatSetFromOptions_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscOptionItems *PetscOptionsObject, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatSetFromOptions_Python(Mat __pyx_v_mat, PetscOptionItems *__pyx_v_PetscOptionsObject) { char __pyx_v_name[0x800]; char *__pyx_v_defval; PetscBool __pyx_v_found; PetscOptionItems *PetscOptionsObject; PyObject *__pyx_v_setFromOptions = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; char *__pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_t_4; int __pyx_t_5; PetscErrorCode __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatSetFromOptions_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":516 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatSetFromOptions_Python") # <<<<<<<<<<<<<< * # * cdef char name[2048], *defval = PyMat(mat).getname() */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"MatSetFromOptions_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":518 * FunctionBegin(b"MatSetFromOptions_Python") * # * cdef char name[2048], *defval = PyMat(mat).getname() # <<<<<<<<<<<<<< * cdef PetscBool found = PETSC_FALSE * cdef PetscOptionItems *opts "PetscOptionsObject" = PetscOptionsObject */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__PyMat *)((struct __pyx_obj_8petsc4py_5PETSc__PyMat *)__pyx_t_1)->__pyx_base.__pyx_vtab)->__pyx_base.getname(((struct __pyx_obj_8petsc4py_5PETSc__PyObj *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((char *)NULL) && PyErr_Occurred())) __PYX_ERR(11, 518, __pyx_L1_error) __pyx_v_defval = __pyx_t_2; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":519 * # * cdef char name[2048], *defval = PyMat(mat).getname() * cdef PetscBool found = PETSC_FALSE # <<<<<<<<<<<<<< * cdef PetscOptionItems *opts "PetscOptionsObject" = PetscOptionsObject * CHKERR( PetscOptionsString( */ __pyx_v_found = PETSC_FALSE; /* "petsc4py/PETSc/libpetsc4py.pyx":520 * cdef char name[2048], *defval = PyMat(mat).getname() * cdef PetscBool found = PETSC_FALSE * cdef PetscOptionItems *opts "PetscOptionsObject" = PetscOptionsObject # <<<<<<<<<<<<<< * CHKERR( PetscOptionsString( * b"-mat_python_type", b"Python [package.]module[.{class|function}]", */ PetscOptionsObject = __pyx_v_PetscOptionsObject; /* "petsc4py/PETSc/libpetsc4py.pyx":521 * cdef PetscBool found = PETSC_FALSE * cdef PetscOptionItems *opts "PetscOptionsObject" = PetscOptionsObject * CHKERR( PetscOptionsString( # <<<<<<<<<<<<<< * b"-mat_python_type", b"Python [package.]module[.{class|function}]", * b"MatPythonSetType", defval, name, sizeof(name), &found) ); opts; */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsString(((char *)"-mat_python_type"), ((char *)"Python [package.]module[.{class|function}]"), ((char *)"MatPythonSetType"), __pyx_v_defval, __pyx_v_name, (sizeof(__pyx_v_name)), (&__pyx_v_found))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 521, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":523 * CHKERR( PetscOptionsString( * b"-mat_python_type", b"Python [package.]module[.{class|function}]", * b"MatPythonSetType", defval, name, sizeof(name), &found) ); opts; # <<<<<<<<<<<<<< * if found and name[0]: * CHKERR( MatPythonSetType_PYTHON(mat, name) ) */ ((void)PetscOptionsObject); /* "petsc4py/PETSc/libpetsc4py.pyx":524 * b"-mat_python_type", b"Python [package.]module[.{class|function}]", * b"MatPythonSetType", defval, name, sizeof(name), &found) ); opts; * if found and name[0]: # <<<<<<<<<<<<<< * CHKERR( MatPythonSetType_PYTHON(mat, name) ) * # */ if (__pyx_v_found) { } else { __pyx_t_4 = __pyx_v_found; goto __pyx_L4_bool_binop_done; } __pyx_t_5 = ((__pyx_v_name[0]) != 0); __pyx_t_4 = __pyx_t_5; __pyx_L4_bool_binop_done:; if (__pyx_t_4) { /* "petsc4py/PETSc/libpetsc4py.pyx":525 * b"MatPythonSetType", defval, name, sizeof(name), &found) ); opts; * if found and name[0]: * CHKERR( MatPythonSetType_PYTHON(mat, name) ) # <<<<<<<<<<<<<< * # * cdef setFromOptions = PyMat(mat).setFromOptions */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_MatPythonSetType_PYTHON(__pyx_v_mat, __pyx_v_name); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 525, __pyx_L1_error) __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_t_3); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 525, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":524 * b"-mat_python_type", b"Python [package.]module[.{class|function}]", * b"MatPythonSetType", defval, name, sizeof(name), &found) ); opts; * if found and name[0]: # <<<<<<<<<<<<<< * CHKERR( MatPythonSetType_PYTHON(mat, name) ) * # */ } /* "petsc4py/PETSc/libpetsc4py.pyx":527 * CHKERR( MatPythonSetType_PYTHON(mat, name) ) * # * cdef setFromOptions = PyMat(mat).setFromOptions # <<<<<<<<<<<<<< * if setFromOptions is not None: * setFromOptions(Mat_(mat)) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_setFromOptions); if (unlikely(!__pyx_t_7)) __PYX_ERR(11, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_setFromOptions = __pyx_t_7; __pyx_t_7 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":528 * # * cdef setFromOptions = PyMat(mat).setFromOptions * if setFromOptions is not None: # <<<<<<<<<<<<<< * setFromOptions(Mat_(mat)) * return FunctionEnd() */ __pyx_t_4 = (__pyx_v_setFromOptions != Py_None); if (__pyx_t_4) { /* "petsc4py/PETSc/libpetsc4py.pyx":529 * cdef setFromOptions = PyMat(mat).setFromOptions * if setFromOptions is not None: * setFromOptions(Mat_(mat)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 529, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_setFromOptions); __pyx_t_8 = __pyx_v_setFromOptions; __pyx_t_9 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_8))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_1}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(11, 529, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":528 * # * cdef setFromOptions = PyMat(mat).setFromOptions * if setFromOptions is not None: # <<<<<<<<<<<<<< * setFromOptions(Mat_(mat)) * return FunctionEnd() */ } /* "petsc4py/PETSc/libpetsc4py.pyx":530 * if setFromOptions is not None: * setFromOptions(Mat_(mat)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatView_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":511 * return FunctionEnd() * * cdef PetscErrorCode MatSetFromOptions_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscOptionItems *PetscOptionsObject, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("petsc4py.PETSc.MatSetFromOptions_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_setFromOptions); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":532 * return FunctionEnd() * * cdef PetscErrorCode MatView_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscViewer vwr, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatView_Python(Mat __pyx_v_mat, PetscViewer __pyx_v_vwr) { PyObject *__pyx_v_view = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatView_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":537 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatView_Python") # <<<<<<<<<<<<<< * viewcontext(PyMat(mat), vwr) * cdef view = PyMat(mat).view */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"MatView_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":538 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatView_Python") * viewcontext(PyMat(mat), vwr) # <<<<<<<<<<<<<< * cdef view = PyMat(mat).view * if view is not None: */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_viewcontext(((struct __pyx_obj_8petsc4py_5PETSc__PyObj *)__pyx_t_1), __pyx_v_vwr); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(11, 538, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":539 * FunctionBegin(b"MatView_Python") * viewcontext(PyMat(mat), vwr) * cdef view = PyMat(mat).view # <<<<<<<<<<<<<< * if view is not None: * view(Mat_(mat), Viewer_(vwr)) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_view); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_view = __pyx_t_3; __pyx_t_3 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":540 * viewcontext(PyMat(mat), vwr) * cdef view = PyMat(mat).view * if view is not None: # <<<<<<<<<<<<<< * view(Mat_(mat), Viewer_(vwr)) * return FunctionEnd() */ __pyx_t_4 = (__pyx_v_view != Py_None); if (__pyx_t_4) { /* "petsc4py/PETSc/libpetsc4py.pyx":541 * cdef view = PyMat(mat).view * if view is not None: * view(Mat_(mat), Viewer_(vwr)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 541, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Viewer_(__pyx_v_vwr)); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 541, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_view); __pyx_t_6 = __pyx_v_view; __pyx_t_7 = NULL; __pyx_t_2 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_2 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_1, __pyx_t_5}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_2, 2+__pyx_t_2); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 541, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":540 * viewcontext(PyMat(mat), vwr) * cdef view = PyMat(mat).view * if view is not None: # <<<<<<<<<<<<<< * view(Mat_(mat), Viewer_(vwr)) * return FunctionEnd() */ } /* "petsc4py/PETSc/libpetsc4py.pyx":542 * if view is not None: * view(Mat_(mat), Viewer_(vwr)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatDuplicate_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":532 * return FunctionEnd() * * cdef PetscErrorCode MatView_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscViewer vwr, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.MatView_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_view); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":544 * return FunctionEnd() * * cdef PetscErrorCode MatDuplicate_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscMatDuplicateOption op, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatDuplicate_Python(Mat __pyx_v_mat, MatDuplicateOption __pyx_v_op, Mat *__pyx_v_out) { PyObject *__pyx_v_duplicate = 0; struct PyPetscMatObject *__pyx_v_m = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; Mat __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatDuplicate_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":550 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatDuplicate_Python") # <<<<<<<<<<<<<< * cdef duplicate = PyMat(mat).duplicate * if duplicate is None: return UNSUPPORTED(b"duplicate") */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"MatDuplicate_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":551 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatDuplicate_Python") * cdef duplicate = PyMat(mat).duplicate # <<<<<<<<<<<<<< * if duplicate is None: return UNSUPPORTED(b"duplicate") * cdef Mat m = duplicate(Mat_(mat), op) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_duplicate); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_duplicate = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":552 * FunctionBegin(b"MatDuplicate_Python") * cdef duplicate = PyMat(mat).duplicate * if duplicate is None: return UNSUPPORTED(b"duplicate") # <<<<<<<<<<<<<< * cdef Mat m = duplicate(Mat_(mat), op) * out[0] = m.mat; m.mat = NULL */ __pyx_t_3 = (__pyx_v_duplicate == Py_None); if (__pyx_t_3) { __pyx_r = __pyx_f_8petsc4py_5PETSc_UNSUPPORTED(((char *)"duplicate")); goto __pyx_L0; } /* "petsc4py/PETSc/libpetsc4py.pyx":553 * cdef duplicate = PyMat(mat).duplicate * if duplicate is None: return UNSUPPORTED(b"duplicate") * cdef Mat m = duplicate(Mat_(mat), op) # <<<<<<<<<<<<<< * out[0] = m.mat; m.mat = NULL * return FunctionEnd() */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyInt_From_long(((long)__pyx_v_op)); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_duplicate); __pyx_t_5 = __pyx_v_duplicate; __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_1, __pyx_t_4}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(11, 553, __pyx_L1_error) __pyx_v_m = ((struct PyPetscMatObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":554 * if duplicate is None: return UNSUPPORTED(b"duplicate") * cdef Mat m = duplicate(Mat_(mat), op) * out[0] = m.mat; m.mat = NULL # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_8 = __pyx_v_m->mat; (__pyx_v_out[0]) = __pyx_t_8; __pyx_v_m->mat = NULL; /* "petsc4py/PETSc/libpetsc4py.pyx":555 * cdef Mat m = duplicate(Mat_(mat), op) * out[0] = m.mat; m.mat = NULL * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatCopy_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":544 * return FunctionEnd() * * cdef PetscErrorCode MatDuplicate_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscMatDuplicateOption op, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.MatDuplicate_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_duplicate); __Pyx_XDECREF((PyObject *)__pyx_v_m); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":557 * return FunctionEnd() * * cdef PetscErrorCode MatCopy_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscMat out, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatCopy_Python(Mat __pyx_v_mat, Mat __pyx_v_out, MatStructure __pyx_v_op) { PyObject *__pyx_v_copy = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatCopy_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":563 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatCopy_Python") # <<<<<<<<<<<<<< * cdef copy = PyMat(mat).copy * if copy is None: return UNSUPPORTED(b"copy") */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"MatCopy_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":564 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatCopy_Python") * cdef copy = PyMat(mat).copy # <<<<<<<<<<<<<< * if copy is None: return UNSUPPORTED(b"copy") * copy(Mat_(mat), Mat_(out), op) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_copy = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":565 * FunctionBegin(b"MatCopy_Python") * cdef copy = PyMat(mat).copy * if copy is None: return UNSUPPORTED(b"copy") # <<<<<<<<<<<<<< * copy(Mat_(mat), Mat_(out), op) * return FunctionEnd() */ __pyx_t_3 = (__pyx_v_copy == Py_None); if (__pyx_t_3) { __pyx_r = __pyx_f_8petsc4py_5PETSc_UNSUPPORTED(((char *)"copy")); goto __pyx_L0; } /* "petsc4py/PETSc/libpetsc4py.pyx":566 * cdef copy = PyMat(mat).copy * if copy is None: return UNSUPPORTED(b"copy") * copy(Mat_(mat), Mat_(out), op) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_out)); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_long(((long)__pyx_v_op)); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_copy); __pyx_t_6 = __pyx_v_copy; __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_7, __pyx_t_1, __pyx_t_4, __pyx_t_5}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 3+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":567 * if copy is None: return UNSUPPORTED(b"copy") * copy(Mat_(mat), Mat_(out), op) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatGetDiagonalBlock_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":557 * return FunctionEnd() * * cdef PetscErrorCode MatCopy_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscMat out, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.MatCopy_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_copy); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":569 * return FunctionEnd() * * cdef PetscErrorCode MatGetDiagonalBlock_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscMat *out */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatGetDiagonalBlock_Python(Mat __pyx_v_mat, Mat *__pyx_v_out) { PyObject *__pyx_v_getDiagonalBlock = 0; struct PyPetscMatObject *__pyx_v_sub = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PetscErrorCode __pyx_t_4; int __pyx_t_5; int __pyx_t_6; char const *__pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; Mat __pyx_t_16; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatGetDiagonalBlock_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":574 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatGetDiagonalBlock_Python") # <<<<<<<<<<<<<< * cdef getDiagonalBlock = PyMat(mat).getDiagonalBlock * if getDiagonalBlock is None: */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"MatGetDiagonalBlock_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":575 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatGetDiagonalBlock_Python") * cdef getDiagonalBlock = PyMat(mat).getDiagonalBlock # <<<<<<<<<<<<<< * if getDiagonalBlock is None: * try: */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 575, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_getDiagonalBlock); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 575, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_getDiagonalBlock = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":576 * FunctionBegin(b"MatGetDiagonalBlock_Python") * cdef getDiagonalBlock = PyMat(mat).getDiagonalBlock * if getDiagonalBlock is None: # <<<<<<<<<<<<<< * try: * mat.ops.getdiagonalblock = NULL */ __pyx_t_3 = (__pyx_v_getDiagonalBlock == Py_None); if (__pyx_t_3) { /* "petsc4py/PETSc/libpetsc4py.pyx":577 * cdef getDiagonalBlock = PyMat(mat).getDiagonalBlock * if getDiagonalBlock is None: * try: # <<<<<<<<<<<<<< * mat.ops.getdiagonalblock = NULL * CHKERR( MatGetDiagonalBlock(mat, out) ) */ /*try:*/ { /* "petsc4py/PETSc/libpetsc4py.pyx":578 * if getDiagonalBlock is None: * try: * mat.ops.getdiagonalblock = NULL # <<<<<<<<<<<<<< * CHKERR( MatGetDiagonalBlock(mat, out) ) * finally: */ __pyx_v_mat->ops->getdiagonalblock = NULL; /* "petsc4py/PETSc/libpetsc4py.pyx":579 * try: * mat.ops.getdiagonalblock = NULL * CHKERR( MatGetDiagonalBlock(mat, out) ) # <<<<<<<<<<<<<< * finally: * mat.ops.getdiagonalblock = MatGetDiagonalBlock_Python */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetDiagonalBlock(__pyx_v_mat, __pyx_v_out)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 579, __pyx_L5_error) } /* "petsc4py/PETSc/libpetsc4py.pyx":581 * CHKERR( MatGetDiagonalBlock(mat, out) ) * finally: * mat.ops.getdiagonalblock = MatGetDiagonalBlock_Python # <<<<<<<<<<<<<< * return FunctionEnd() * cdef Mat sub = getDiagonalBlock(Mat_(mat)) */ /*finally:*/ { /*normal exit:*/{ __pyx_v_mat->ops->getdiagonalblock = __pyx_f_8petsc4py_5PETSc_MatGetDiagonalBlock_Python; goto __pyx_L6; } __pyx_L5_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10) < 0)) __Pyx_ErrFetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); __pyx_t_5 = __pyx_lineno; __pyx_t_6 = __pyx_clineno; __pyx_t_7 = __pyx_filename; { __pyx_v_mat->ops->getdiagonalblock = __pyx_f_8petsc4py_5PETSc_MatGetDiagonalBlock_Python; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); } __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ErrRestore(__pyx_t_8, __pyx_t_9, __pyx_t_10); __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_lineno = __pyx_t_5; __pyx_clineno = __pyx_t_6; __pyx_filename = __pyx_t_7; goto __pyx_L1_error; } __pyx_L6:; } /* "petsc4py/PETSc/libpetsc4py.pyx":582 * finally: * mat.ops.getdiagonalblock = MatGetDiagonalBlock_Python * return FunctionEnd() # <<<<<<<<<<<<<< * cdef Mat sub = getDiagonalBlock(Mat_(mat)) * if sub is not None: out[0] = sub.mat */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":576 * FunctionBegin(b"MatGetDiagonalBlock_Python") * cdef getDiagonalBlock = PyMat(mat).getDiagonalBlock * if getDiagonalBlock is None: # <<<<<<<<<<<<<< * try: * mat.ops.getdiagonalblock = NULL */ } /* "petsc4py/PETSc/libpetsc4py.pyx":583 * mat.ops.getdiagonalblock = MatGetDiagonalBlock_Python * return FunctionEnd() * cdef Mat sub = getDiagonalBlock(Mat_(mat)) # <<<<<<<<<<<<<< * if sub is not None: out[0] = sub.mat * return FunctionEnd() */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_getDiagonalBlock); __pyx_t_14 = __pyx_v_getDiagonalBlock; __pyx_t_15 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_14))) { __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_14); if (likely(__pyx_t_15)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14); __Pyx_INCREF(__pyx_t_15); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_14, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_t_1}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_14, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(11, 583, __pyx_L1_error) __pyx_v_sub = ((struct PyPetscMatObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":584 * return FunctionEnd() * cdef Mat sub = getDiagonalBlock(Mat_(mat)) * if sub is not None: out[0] = sub.mat # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_3 = (((PyObject *)__pyx_v_sub) != Py_None); if (__pyx_t_3) { __pyx_t_16 = __pyx_v_sub->mat; (__pyx_v_out[0]) = __pyx_t_16; } /* "petsc4py/PETSc/libpetsc4py.pyx":585 * cdef Mat sub = getDiagonalBlock(Mat_(mat)) * if sub is not None: out[0] = sub.mat * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatCreateSubMatrix_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":569 * return FunctionEnd() * * cdef PetscErrorCode MatGetDiagonalBlock_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscMat *out */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_14); __Pyx_XDECREF(__pyx_t_15); __Pyx_AddTraceback("petsc4py.PETSc.MatGetDiagonalBlock_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_getDiagonalBlock); __Pyx_XDECREF((PyObject *)__pyx_v_sub); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":587 * return FunctionEnd() * * cdef PetscErrorCode MatCreateSubMatrix_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscIS row, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatCreateSubMatrix_Python(Mat __pyx_v_mat, IS __pyx_v_row, IS __pyx_v_col, MatReuse __pyx_v_op, Mat *__pyx_v_out) { PyObject *__pyx_v_createSubMatrix = 0; struct PyPetscMatObject *__pyx_v_sub = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PetscErrorCode __pyx_t_4; int __pyx_t_5; int __pyx_t_6; char const *__pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; Mat __pyx_t_19; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatCreateSubMatrix_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":595 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatCreateSubMatrix_Python") # <<<<<<<<<<<<<< * cdef createSubMatrix = PyMat(mat).createSubMatrix * if createSubMatrix is None: */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"MatCreateSubMatrix_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":596 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatCreateSubMatrix_Python") * cdef createSubMatrix = PyMat(mat).createSubMatrix # <<<<<<<<<<<<<< * if createSubMatrix is None: * try: */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 596, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_createSubMatrix); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 596, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_createSubMatrix = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":597 * FunctionBegin(b"MatCreateSubMatrix_Python") * cdef createSubMatrix = PyMat(mat).createSubMatrix * if createSubMatrix is None: # <<<<<<<<<<<<<< * try: * mat.ops.createsubmatrix = NULL */ __pyx_t_3 = (__pyx_v_createSubMatrix == Py_None); if (__pyx_t_3) { /* "petsc4py/PETSc/libpetsc4py.pyx":598 * cdef createSubMatrix = PyMat(mat).createSubMatrix * if createSubMatrix is None: * try: # <<<<<<<<<<<<<< * mat.ops.createsubmatrix = NULL * CHKERR( MatCreateSubMatrix(mat, row, col, op, out) ) */ /*try:*/ { /* "petsc4py/PETSc/libpetsc4py.pyx":599 * if createSubMatrix is None: * try: * mat.ops.createsubmatrix = NULL # <<<<<<<<<<<<<< * CHKERR( MatCreateSubMatrix(mat, row, col, op, out) ) * finally: */ __pyx_v_mat->ops->createsubmatrix = NULL; /* "petsc4py/PETSc/libpetsc4py.pyx":600 * try: * mat.ops.createsubmatrix = NULL * CHKERR( MatCreateSubMatrix(mat, row, col, op, out) ) # <<<<<<<<<<<<<< * finally: * mat.ops.createsubmatrix = MatCreateSubMatrix_Python */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreateSubMatrix(__pyx_v_mat, __pyx_v_row, __pyx_v_col, __pyx_v_op, __pyx_v_out)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 600, __pyx_L5_error) } /* "petsc4py/PETSc/libpetsc4py.pyx":602 * CHKERR( MatCreateSubMatrix(mat, row, col, op, out) ) * finally: * mat.ops.createsubmatrix = MatCreateSubMatrix_Python # <<<<<<<<<<<<<< * return FunctionEnd() * cdef Mat sub = None */ /*finally:*/ { /*normal exit:*/{ __pyx_v_mat->ops->createsubmatrix = __pyx_f_8petsc4py_5PETSc_MatCreateSubMatrix_Python; goto __pyx_L6; } __pyx_L5_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10) < 0)) __Pyx_ErrFetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); __pyx_t_5 = __pyx_lineno; __pyx_t_6 = __pyx_clineno; __pyx_t_7 = __pyx_filename; { __pyx_v_mat->ops->createsubmatrix = __pyx_f_8petsc4py_5PETSc_MatCreateSubMatrix_Python; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); } __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ErrRestore(__pyx_t_8, __pyx_t_9, __pyx_t_10); __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_lineno = __pyx_t_5; __pyx_clineno = __pyx_t_6; __pyx_filename = __pyx_t_7; goto __pyx_L1_error; } __pyx_L6:; } /* "petsc4py/PETSc/libpetsc4py.pyx":603 * finally: * mat.ops.createsubmatrix = MatCreateSubMatrix_Python * return FunctionEnd() # <<<<<<<<<<<<<< * cdef Mat sub = None * if op == MAT_IGNORE_MATRIX: */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":597 * FunctionBegin(b"MatCreateSubMatrix_Python") * cdef createSubMatrix = PyMat(mat).createSubMatrix * if createSubMatrix is None: # <<<<<<<<<<<<<< * try: * mat.ops.createsubmatrix = NULL */ } /* "petsc4py/PETSc/libpetsc4py.pyx":604 * mat.ops.createsubmatrix = MatCreateSubMatrix_Python * return FunctionEnd() * cdef Mat sub = None # <<<<<<<<<<<<<< * if op == MAT_IGNORE_MATRIX: * sub = None */ __Pyx_INCREF(Py_None); __pyx_v_sub = ((struct PyPetscMatObject *)Py_None); /* "petsc4py/PETSc/libpetsc4py.pyx":605 * return FunctionEnd() * cdef Mat sub = None * if op == MAT_IGNORE_MATRIX: # <<<<<<<<<<<<<< * sub = None * elif op == MAT_INITIAL_MATRIX: */ __pyx_t_3 = (__pyx_v_op == MAT_IGNORE_MATRIX); if (__pyx_t_3) { /* "petsc4py/PETSc/libpetsc4py.pyx":606 * cdef Mat sub = None * if op == MAT_IGNORE_MATRIX: * sub = None # <<<<<<<<<<<<<< * elif op == MAT_INITIAL_MATRIX: * sub = createSubMatrix(Mat_(mat), IS_(row), IS_(col), None) */ __Pyx_INCREF(Py_None); __Pyx_DECREF_SET(__pyx_v_sub, ((struct PyPetscMatObject *)Py_None)); /* "petsc4py/PETSc/libpetsc4py.pyx":605 * return FunctionEnd() * cdef Mat sub = None * if op == MAT_IGNORE_MATRIX: # <<<<<<<<<<<<<< * sub = None * elif op == MAT_INITIAL_MATRIX: */ goto __pyx_L9; } /* "petsc4py/PETSc/libpetsc4py.pyx":607 * if op == MAT_IGNORE_MATRIX: * sub = None * elif op == MAT_INITIAL_MATRIX: # <<<<<<<<<<<<<< * sub = createSubMatrix(Mat_(mat), IS_(row), IS_(col), None) * if sub is not None: */ __pyx_t_3 = (__pyx_v_op == MAT_INITIAL_MATRIX); if (__pyx_t_3) { /* "petsc4py/PETSc/libpetsc4py.pyx":608 * sub = None * elif op == MAT_INITIAL_MATRIX: * sub = createSubMatrix(Mat_(mat), IS_(row), IS_(col), None) # <<<<<<<<<<<<<< * if sub is not None: * addRef(sub.mat) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 608, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_14 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_IS_(__pyx_v_row)); if (unlikely(!__pyx_t_14)) __PYX_ERR(11, 608, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_15 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_IS_(__pyx_v_col)); if (unlikely(!__pyx_t_15)) __PYX_ERR(11, 608, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_INCREF(__pyx_v_createSubMatrix); __pyx_t_16 = __pyx_v_createSubMatrix; __pyx_t_17 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_16))) { __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_16); if (likely(__pyx_t_17)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16); __Pyx_INCREF(__pyx_t_17); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_16, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_17, __pyx_t_1, __pyx_t_14, __pyx_t_15, Py_None}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_16, __pyx_callargs+1-__pyx_t_6, 4+__pyx_t_6); __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 608, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(11, 608, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_sub, ((struct PyPetscMatObject *)__pyx_t_2)); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":609 * elif op == MAT_INITIAL_MATRIX: * sub = createSubMatrix(Mat_(mat), IS_(row), IS_(col), None) * if sub is not None: # <<<<<<<<<<<<<< * addRef(sub.mat) * elif op == MAT_REUSE_MATRIX: */ __pyx_t_3 = (((PyObject *)__pyx_v_sub) != Py_None); if (__pyx_t_3) { /* "petsc4py/PETSc/libpetsc4py.pyx":610 * sub = createSubMatrix(Mat_(mat), IS_(row), IS_(col), None) * if sub is not None: * addRef(sub.mat) # <<<<<<<<<<<<<< * elif op == MAT_REUSE_MATRIX: * sub = createSubMatrix(Mat_(mat), IS_(row), IS_(col), Mat_(out[0])) */ __pyx_f_8petsc4py_5PETSc_addRef(__pyx_v_sub->mat); /* "petsc4py/PETSc/libpetsc4py.pyx":609 * elif op == MAT_INITIAL_MATRIX: * sub = createSubMatrix(Mat_(mat), IS_(row), IS_(col), None) * if sub is not None: # <<<<<<<<<<<<<< * addRef(sub.mat) * elif op == MAT_REUSE_MATRIX: */ } /* "petsc4py/PETSc/libpetsc4py.pyx":607 * if op == MAT_IGNORE_MATRIX: * sub = None * elif op == MAT_INITIAL_MATRIX: # <<<<<<<<<<<<<< * sub = createSubMatrix(Mat_(mat), IS_(row), IS_(col), None) * if sub is not None: */ goto __pyx_L9; } /* "petsc4py/PETSc/libpetsc4py.pyx":611 * if sub is not None: * addRef(sub.mat) * elif op == MAT_REUSE_MATRIX: # <<<<<<<<<<<<<< * sub = createSubMatrix(Mat_(mat), IS_(row), IS_(col), Mat_(out[0])) * if sub is not None: */ __pyx_t_3 = (__pyx_v_op == MAT_REUSE_MATRIX); if (__pyx_t_3) { /* "petsc4py/PETSc/libpetsc4py.pyx":612 * addRef(sub.mat) * elif op == MAT_REUSE_MATRIX: * sub = createSubMatrix(Mat_(mat), IS_(row), IS_(col), Mat_(out[0])) # <<<<<<<<<<<<<< * if sub is not None: * out[0] = sub.mat */ __pyx_t_16 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_16)) __PYX_ERR(11, 612, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_15 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_IS_(__pyx_v_row)); if (unlikely(!__pyx_t_15)) __PYX_ERR(11, 612, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_14 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_IS_(__pyx_v_col)); if (unlikely(!__pyx_t_14)) __PYX_ERR(11, 612, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_((__pyx_v_out[0]))); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 612, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_createSubMatrix); __pyx_t_17 = __pyx_v_createSubMatrix; __pyx_t_18 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_17))) { __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_17); if (likely(__pyx_t_18)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17); __Pyx_INCREF(__pyx_t_18); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_17, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_18, __pyx_t_16, __pyx_t_15, __pyx_t_14, __pyx_t_1}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_17, __pyx_callargs+1-__pyx_t_6, 4+__pyx_t_6); __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 612, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; } if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(11, 612, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_sub, ((struct PyPetscMatObject *)__pyx_t_2)); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":611 * if sub is not None: * addRef(sub.mat) * elif op == MAT_REUSE_MATRIX: # <<<<<<<<<<<<<< * sub = createSubMatrix(Mat_(mat), IS_(row), IS_(col), Mat_(out[0])) * if sub is not None: */ } __pyx_L9:; /* "petsc4py/PETSc/libpetsc4py.pyx":613 * elif op == MAT_REUSE_MATRIX: * sub = createSubMatrix(Mat_(mat), IS_(row), IS_(col), Mat_(out[0])) * if sub is not None: # <<<<<<<<<<<<<< * out[0] = sub.mat * return FunctionEnd() */ __pyx_t_3 = (((PyObject *)__pyx_v_sub) != Py_None); if (__pyx_t_3) { /* "petsc4py/PETSc/libpetsc4py.pyx":614 * sub = createSubMatrix(Mat_(mat), IS_(row), IS_(col), Mat_(out[0])) * if sub is not None: * out[0] = sub.mat # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_19 = __pyx_v_sub->mat; (__pyx_v_out[0]) = __pyx_t_19; /* "petsc4py/PETSc/libpetsc4py.pyx":613 * elif op == MAT_REUSE_MATRIX: * sub = createSubMatrix(Mat_(mat), IS_(row), IS_(col), Mat_(out[0])) * if sub is not None: # <<<<<<<<<<<<<< * out[0] = sub.mat * return FunctionEnd() */ } /* "petsc4py/PETSc/libpetsc4py.pyx":615 * if sub is not None: * out[0] = sub.mat * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatSetOption_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":587 * return FunctionEnd() * * cdef PetscErrorCode MatCreateSubMatrix_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscIS row, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_14); __Pyx_XDECREF(__pyx_t_15); __Pyx_XDECREF(__pyx_t_16); __Pyx_XDECREF(__pyx_t_17); __Pyx_XDECREF(__pyx_t_18); __Pyx_AddTraceback("petsc4py.PETSc.MatCreateSubMatrix_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_createSubMatrix); __Pyx_XDECREF((PyObject *)__pyx_v_sub); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":617 * return FunctionEnd() * * cdef PetscErrorCode MatSetOption_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscMatOption op, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatSetOption_Python(Mat __pyx_v_mat, MatOption __pyx_v_op, PetscBool __pyx_v_flag) { PyObject *__pyx_v_setOption = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatSetOption_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":623 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatSetOption_Python") # <<<<<<<<<<<<<< * cdef setOption = PyMat(mat).setOption * if setOption is not None: */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"MatSetOption_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":624 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatSetOption_Python") * cdef setOption = PyMat(mat).setOption # <<<<<<<<<<<<<< * if setOption is not None: * setOption(Mat_(mat), op, (flag)) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 624, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_setOption); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 624, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_setOption = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":625 * FunctionBegin(b"MatSetOption_Python") * cdef setOption = PyMat(mat).setOption * if setOption is not None: # <<<<<<<<<<<<<< * setOption(Mat_(mat), op, (flag)) * return FunctionEnd() */ __pyx_t_3 = (__pyx_v_setOption != Py_None); if (__pyx_t_3) { /* "petsc4py/PETSc/libpetsc4py.pyx":626 * cdef setOption = PyMat(mat).setOption * if setOption is not None: * setOption(Mat_(mat), op, (flag)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 626, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyInt_From_long(((long)__pyx_v_op)); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 626, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyBool_FromLong((((int)__pyx_v_flag) != 0)); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 626, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_setOption); __pyx_t_6 = __pyx_v_setOption; __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_7, __pyx_t_1, __pyx_t_4, __pyx_t_5}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 3+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 626, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":625 * FunctionBegin(b"MatSetOption_Python") * cdef setOption = PyMat(mat).setOption * if setOption is not None: # <<<<<<<<<<<<<< * setOption(Mat_(mat), op, (flag)) * return FunctionEnd() */ } /* "petsc4py/PETSc/libpetsc4py.pyx":627 * if setOption is not None: * setOption(Mat_(mat), op, (flag)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatSetUp_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":617 * return FunctionEnd() * * cdef PetscErrorCode MatSetOption_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscMatOption op, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.MatSetOption_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_setOption); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":629 * return FunctionEnd() * * cdef PetscErrorCode MatSetUp_Python( # <<<<<<<<<<<<<< * PetscMat mat, * ) \ */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatSetUp_Python(Mat __pyx_v_mat) { PetscInt __pyx_v_rbs; PetscInt __pyx_v_cbs; char __pyx_v_name[0x800]; PetscBool __pyx_v_found; PyObject *__pyx_v_setUp = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PetscErrorCode __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatSetUp_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":633 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatSetUp_Python") # <<<<<<<<<<<<<< * cdef PetscInt rbs = -1, cbs = -1 * CHKERR( PetscLayoutGetBlockSize(mat.rmap, &rbs) ) */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"MatSetUp_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":634 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatSetUp_Python") * cdef PetscInt rbs = -1, cbs = -1 # <<<<<<<<<<<<<< * CHKERR( PetscLayoutGetBlockSize(mat.rmap, &rbs) ) * CHKERR( PetscLayoutGetBlockSize(mat.cmap, &cbs) ) */ __pyx_v_rbs = -1L; __pyx_v_cbs = -1L; /* "petsc4py/PETSc/libpetsc4py.pyx":635 * FunctionBegin(b"MatSetUp_Python") * cdef PetscInt rbs = -1, cbs = -1 * CHKERR( PetscLayoutGetBlockSize(mat.rmap, &rbs) ) # <<<<<<<<<<<<<< * CHKERR( PetscLayoutGetBlockSize(mat.cmap, &cbs) ) * if rbs == -1: rbs = 1 */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLayoutGetBlockSize(__pyx_v_mat->rmap, (&__pyx_v_rbs))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 635, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":636 * cdef PetscInt rbs = -1, cbs = -1 * CHKERR( PetscLayoutGetBlockSize(mat.rmap, &rbs) ) * CHKERR( PetscLayoutGetBlockSize(mat.cmap, &cbs) ) # <<<<<<<<<<<<<< * if rbs == -1: rbs = 1 * if cbs == -1: cbs = rbs */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLayoutGetBlockSize(__pyx_v_mat->cmap, (&__pyx_v_cbs))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 636, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":637 * CHKERR( PetscLayoutGetBlockSize(mat.rmap, &rbs) ) * CHKERR( PetscLayoutGetBlockSize(mat.cmap, &cbs) ) * if rbs == -1: rbs = 1 # <<<<<<<<<<<<<< * if cbs == -1: cbs = rbs * CHKERR( PetscLayoutSetBlockSize(mat.rmap, rbs) ) */ __pyx_t_2 = (__pyx_v_rbs == -1L); if (__pyx_t_2) { __pyx_v_rbs = 1; } /* "petsc4py/PETSc/libpetsc4py.pyx":638 * CHKERR( PetscLayoutGetBlockSize(mat.cmap, &cbs) ) * if rbs == -1: rbs = 1 * if cbs == -1: cbs = rbs # <<<<<<<<<<<<<< * CHKERR( PetscLayoutSetBlockSize(mat.rmap, rbs) ) * CHKERR( PetscLayoutSetBlockSize(mat.cmap, cbs) ) */ __pyx_t_2 = (__pyx_v_cbs == -1L); if (__pyx_t_2) { __pyx_v_cbs = __pyx_v_rbs; } /* "petsc4py/PETSc/libpetsc4py.pyx":639 * if rbs == -1: rbs = 1 * if cbs == -1: cbs = rbs * CHKERR( PetscLayoutSetBlockSize(mat.rmap, rbs) ) # <<<<<<<<<<<<<< * CHKERR( PetscLayoutSetBlockSize(mat.cmap, cbs) ) * CHKERR( PetscLayoutSetUp(mat.rmap) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLayoutSetBlockSize(__pyx_v_mat->rmap, __pyx_v_rbs)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 639, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":640 * if cbs == -1: cbs = rbs * CHKERR( PetscLayoutSetBlockSize(mat.rmap, rbs) ) * CHKERR( PetscLayoutSetBlockSize(mat.cmap, cbs) ) # <<<<<<<<<<<<<< * CHKERR( PetscLayoutSetUp(mat.rmap) ) * CHKERR( PetscLayoutSetUp(mat.cmap) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLayoutSetBlockSize(__pyx_v_mat->cmap, __pyx_v_cbs)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 640, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":641 * CHKERR( PetscLayoutSetBlockSize(mat.rmap, rbs) ) * CHKERR( PetscLayoutSetBlockSize(mat.cmap, cbs) ) * CHKERR( PetscLayoutSetUp(mat.rmap) ) # <<<<<<<<<<<<<< * CHKERR( PetscLayoutSetUp(mat.cmap) ) * mat.preallocated = PETSC_TRUE */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLayoutSetUp(__pyx_v_mat->rmap)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 641, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":642 * CHKERR( PetscLayoutSetBlockSize(mat.cmap, cbs) ) * CHKERR( PetscLayoutSetUp(mat.rmap) ) * CHKERR( PetscLayoutSetUp(mat.cmap) ) # <<<<<<<<<<<<<< * mat.preallocated = PETSC_TRUE * # */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLayoutSetUp(__pyx_v_mat->cmap)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 642, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":643 * CHKERR( PetscLayoutSetUp(mat.rmap) ) * CHKERR( PetscLayoutSetUp(mat.cmap) ) * mat.preallocated = PETSC_TRUE # <<<<<<<<<<<<<< * # * cdef char name[2048] */ __pyx_v_mat->preallocated = PETSC_TRUE; /* "petsc4py/PETSc/libpetsc4py.pyx":646 * # * cdef char name[2048] * cdef PetscBool found = PETSC_FALSE # <<<<<<<<<<<<<< * if PyMat(mat).self is None: * CHKERR( PetscOptionsGetString(NULL, */ __pyx_v_found = PETSC_FALSE; /* "petsc4py/PETSc/libpetsc4py.pyx":647 * cdef char name[2048] * cdef PetscBool found = PETSC_FALSE * if PyMat(mat).self is None: # <<<<<<<<<<<<<< * CHKERR( PetscOptionsGetString(NULL, * getPrefix(mat), b"-mat_python_type", */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 647, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = (((struct __pyx_obj_8petsc4py_5PETSc__PyMat *)__pyx_t_3)->__pyx_base.self == Py_None); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { /* "petsc4py/PETSc/libpetsc4py.pyx":648 * cdef PetscBool found = PETSC_FALSE * if PyMat(mat).self is None: * CHKERR( PetscOptionsGetString(NULL, # <<<<<<<<<<<<<< * getPrefix(mat), b"-mat_python_type", * name, sizeof(name), &found) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsGetString(NULL, __pyx_f_8petsc4py_5PETSc_getPrefix(__pyx_v_mat), ((char *)"-mat_python_type"), __pyx_v_name, (sizeof(__pyx_v_name)), (&__pyx_v_found))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 648, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":651 * getPrefix(mat), b"-mat_python_type", * name, sizeof(name), &found) ) * if found and name[0]: # <<<<<<<<<<<<<< * CHKERR( MatPythonSetType_PYTHON(mat, name) ) * if PyMat(mat).self is None: */ if (__pyx_v_found) { } else { __pyx_t_2 = __pyx_v_found; goto __pyx_L7_bool_binop_done; } __pyx_t_4 = ((__pyx_v_name[0]) != 0); __pyx_t_2 = __pyx_t_4; __pyx_L7_bool_binop_done:; if (__pyx_t_2) { /* "petsc4py/PETSc/libpetsc4py.pyx":652 * name, sizeof(name), &found) ) * if found and name[0]: * CHKERR( MatPythonSetType_PYTHON(mat, name) ) # <<<<<<<<<<<<<< * if PyMat(mat).self is None: * return PetscSETERR(PETSC_ERR_USER, */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_MatPythonSetType_PYTHON(__pyx_v_mat, __pyx_v_name); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 652, __pyx_L1_error) __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_t_1); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 652, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":651 * getPrefix(mat), b"-mat_python_type", * name, sizeof(name), &found) ) * if found and name[0]: # <<<<<<<<<<<<<< * CHKERR( MatPythonSetType_PYTHON(mat, name) ) * if PyMat(mat).self is None: */ } /* "petsc4py/PETSc/libpetsc4py.pyx":647 * cdef char name[2048] * cdef PetscBool found = PETSC_FALSE * if PyMat(mat).self is None: # <<<<<<<<<<<<<< * CHKERR( PetscOptionsGetString(NULL, * getPrefix(mat), b"-mat_python_type", */ } /* "petsc4py/PETSc/libpetsc4py.pyx":653 * if found and name[0]: * CHKERR( MatPythonSetType_PYTHON(mat, name) ) * if PyMat(mat).self is None: # <<<<<<<<<<<<<< * return PetscSETERR(PETSC_ERR_USER, * "Python context not set, call one of \n" */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = (((struct __pyx_obj_8petsc4py_5PETSc__PyMat *)__pyx_t_3)->__pyx_base.self == Py_None); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { /* "petsc4py/PETSc/libpetsc4py.pyx":654 * CHKERR( MatPythonSetType_PYTHON(mat, name) ) * if PyMat(mat).self is None: * return PetscSETERR(PETSC_ERR_USER, # <<<<<<<<<<<<<< * "Python context not set, call one of \n" * " * MatPythonSetType(mat, \"[package.]module.class\")\n" */ __pyx_r = __pyx_f_8petsc4py_5PETSc_PetscSETERR(PETSC_ERR_USER, ((char *)"Python context not set, call one of \n * MatPythonSetType(mat, \"[package.]module.class\")\n * MatSetFromOptions(mat) and pass option -mat_python_type [package.]module.class")); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":653 * if found and name[0]: * CHKERR( MatPythonSetType_PYTHON(mat, name) ) * if PyMat(mat).self is None: # <<<<<<<<<<<<<< * return PetscSETERR(PETSC_ERR_USER, * "Python context not set, call one of \n" */ } /* "petsc4py/PETSc/libpetsc4py.pyx":660 * "-mat_python_type [package.]module.class") * # * cdef setUp = PyMat(mat).setUp # <<<<<<<<<<<<<< * if setUp is not None: * setUp(Mat_(mat)) */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 660, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_setUp); if (unlikely(!__pyx_t_6)) __PYX_ERR(11, 660, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_setUp = __pyx_t_6; __pyx_t_6 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":661 * # * cdef setUp = PyMat(mat).setUp * if setUp is not None: # <<<<<<<<<<<<<< * setUp(Mat_(mat)) * return FunctionEnd() */ __pyx_t_2 = (__pyx_v_setUp != Py_None); if (__pyx_t_2) { /* "petsc4py/PETSc/libpetsc4py.pyx":662 * cdef setUp = PyMat(mat).setUp * if setUp is not None: * setUp(Mat_(mat)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 662, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_setUp); __pyx_t_7 = __pyx_v_setUp; __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_3}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(11, 662, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":661 * # * cdef setUp = PyMat(mat).setUp * if setUp is not None: # <<<<<<<<<<<<<< * setUp(Mat_(mat)) * return FunctionEnd() */ } /* "petsc4py/PETSc/libpetsc4py.pyx":663 * if setUp is not None: * setUp(Mat_(mat)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatAssemblyBegin_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":629 * return FunctionEnd() * * cdef PetscErrorCode MatSetUp_Python( # <<<<<<<<<<<<<< * PetscMat mat, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("petsc4py.PETSc.MatSetUp_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_setUp); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":665 * return FunctionEnd() * * cdef PetscErrorCode MatAssemblyBegin_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscMatAssemblyType at, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatAssemblyBegin_Python(Mat __pyx_v_mat, MatAssemblyType __pyx_v_at) { PyObject *__pyx_v_assembly = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatAssemblyBegin_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":670 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatAssemblyBegin_Python") # <<<<<<<<<<<<<< * cdef assembly = PyMat(mat).assemblyBegin * if assembly is not None: */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"MatAssemblyBegin_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":671 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatAssemblyBegin_Python") * cdef assembly = PyMat(mat).assemblyBegin # <<<<<<<<<<<<<< * if assembly is not None: * assembly(Mat_(mat), at) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 671, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_assemblyBegin); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 671, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_assembly = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":672 * FunctionBegin(b"MatAssemblyBegin_Python") * cdef assembly = PyMat(mat).assemblyBegin * if assembly is not None: # <<<<<<<<<<<<<< * assembly(Mat_(mat), at) * return FunctionEnd() */ __pyx_t_3 = (__pyx_v_assembly != Py_None); if (__pyx_t_3) { /* "petsc4py/PETSc/libpetsc4py.pyx":673 * cdef assembly = PyMat(mat).assemblyBegin * if assembly is not None: * assembly(Mat_(mat), at) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 673, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyInt_From_long(((long)__pyx_v_at)); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 673, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_assembly); __pyx_t_5 = __pyx_v_assembly; __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_1, __pyx_t_4}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 673, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":672 * FunctionBegin(b"MatAssemblyBegin_Python") * cdef assembly = PyMat(mat).assemblyBegin * if assembly is not None: # <<<<<<<<<<<<<< * assembly(Mat_(mat), at) * return FunctionEnd() */ } /* "petsc4py/PETSc/libpetsc4py.pyx":674 * if assembly is not None: * assembly(Mat_(mat), at) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatAssemblyEnd_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":665 * return FunctionEnd() * * cdef PetscErrorCode MatAssemblyBegin_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscMatAssemblyType at, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.MatAssemblyBegin_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_assembly); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":676 * return FunctionEnd() * * cdef PetscErrorCode MatAssemblyEnd_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscMatAssemblyType at, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatAssemblyEnd_Python(Mat __pyx_v_mat, MatAssemblyType __pyx_v_at) { PyObject *__pyx_v_assembly = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatAssemblyEnd_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":681 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatAssemblyEnd_Python") # <<<<<<<<<<<<<< * cdef assembly = PyMat(mat).assemblyEnd * if assembly is None: */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"MatAssemblyEnd_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":682 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatAssemblyEnd_Python") * cdef assembly = PyMat(mat).assemblyEnd # <<<<<<<<<<<<<< * if assembly is None: * assembly = PyMat(mat).assembly */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_assemblyEnd); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_assembly = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":683 * FunctionBegin(b"MatAssemblyEnd_Python") * cdef assembly = PyMat(mat).assemblyEnd * if assembly is None: # <<<<<<<<<<<<<< * assembly = PyMat(mat).assembly * if assembly is not None: */ __pyx_t_3 = (__pyx_v_assembly == Py_None); if (__pyx_t_3) { /* "petsc4py/PETSc/libpetsc4py.pyx":684 * cdef assembly = PyMat(mat).assemblyEnd * if assembly is None: * assembly = PyMat(mat).assembly # <<<<<<<<<<<<<< * if assembly is not None: * assembly(Mat_(mat), at) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_assembly); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_assembly, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":683 * FunctionBegin(b"MatAssemblyEnd_Python") * cdef assembly = PyMat(mat).assemblyEnd * if assembly is None: # <<<<<<<<<<<<<< * assembly = PyMat(mat).assembly * if assembly is not None: */ } /* "petsc4py/PETSc/libpetsc4py.pyx":685 * if assembly is None: * assembly = PyMat(mat).assembly * if assembly is not None: # <<<<<<<<<<<<<< * assembly(Mat_(mat), at) * return FunctionEnd() */ __pyx_t_3 = (__pyx_v_assembly != Py_None); if (__pyx_t_3) { /* "petsc4py/PETSc/libpetsc4py.pyx":686 * assembly = PyMat(mat).assembly * if assembly is not None: * assembly(Mat_(mat), at) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 686, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyInt_From_long(((long)__pyx_v_at)); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 686, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_assembly); __pyx_t_5 = __pyx_v_assembly; __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_2, __pyx_t_4}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 686, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":685 * if assembly is None: * assembly = PyMat(mat).assembly * if assembly is not None: # <<<<<<<<<<<<<< * assembly(Mat_(mat), at) * return FunctionEnd() */ } /* "petsc4py/PETSc/libpetsc4py.pyx":687 * if assembly is not None: * assembly(Mat_(mat), at) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatZeroEntries_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":676 * return FunctionEnd() * * cdef PetscErrorCode MatAssemblyEnd_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscMatAssemblyType at, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.MatAssemblyEnd_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_assembly); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":689 * return FunctionEnd() * * cdef PetscErrorCode MatZeroEntries_Python( # <<<<<<<<<<<<<< * PetscMat mat, * ) \ */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatZeroEntries_Python(Mat __pyx_v_mat) { PyObject *__pyx_v_zeroEntries = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatZeroEntries_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":693 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatZeroEntries_Python") # <<<<<<<<<<<<<< * cdef zeroEntries = PyMat(mat).zeroEntries * if zeroEntries is None: return UNSUPPORTED(b"zeroEntries") */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"MatZeroEntries_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":694 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatZeroEntries_Python") * cdef zeroEntries = PyMat(mat).zeroEntries # <<<<<<<<<<<<<< * if zeroEntries is None: return UNSUPPORTED(b"zeroEntries") * zeroEntries(Mat_(mat)) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 694, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeroEntries); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 694, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_zeroEntries = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":695 * FunctionBegin(b"MatZeroEntries_Python") * cdef zeroEntries = PyMat(mat).zeroEntries * if zeroEntries is None: return UNSUPPORTED(b"zeroEntries") # <<<<<<<<<<<<<< * zeroEntries(Mat_(mat)) * return FunctionEnd() */ __pyx_t_3 = (__pyx_v_zeroEntries == Py_None); if (__pyx_t_3) { __pyx_r = __pyx_f_8petsc4py_5PETSc_UNSUPPORTED(((char *)"zeroEntries")); goto __pyx_L0; } /* "petsc4py/PETSc/libpetsc4py.pyx":696 * cdef zeroEntries = PyMat(mat).zeroEntries * if zeroEntries is None: return UNSUPPORTED(b"zeroEntries") * zeroEntries(Mat_(mat)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 696, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_zeroEntries); __pyx_t_4 = __pyx_v_zeroEntries; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_1}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 696, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":697 * if zeroEntries is None: return UNSUPPORTED(b"zeroEntries") * zeroEntries(Mat_(mat)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatZeroRowsColumns_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":689 * return FunctionEnd() * * cdef PetscErrorCode MatZeroEntries_Python( # <<<<<<<<<<<<<< * PetscMat mat, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.MatZeroEntries_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_zeroEntries); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":699 * return FunctionEnd() * * cdef PetscErrorCode MatZeroRowsColumns_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscInt numRows, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatZeroRowsColumns_Python(Mat __pyx_v_mat, PetscInt __pyx_v_numRows, PetscInt const *__pyx_v_rows, PetscScalar __pyx_v_diag, Vec __pyx_v_x, Vec __pyx_v_b) { PyObject *__pyx_v_zeroRowsColumns = 0; PyArrayObject *__pyx_v_pyrows = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatZeroRowsColumns_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":708 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatZeroRowsColumns_Python") # <<<<<<<<<<<<<< * cdef zeroRowsColumns = PyMat(mat).zeroRowsColumns * if zeroRowsColumns is None: return UNSUPPORTED(b"zeroRowsColumns") */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"MatZeroRowsColumns_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":709 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatZeroRowsColumns_Python") * cdef zeroRowsColumns = PyMat(mat).zeroRowsColumns # <<<<<<<<<<<<<< * if zeroRowsColumns is None: return UNSUPPORTED(b"zeroRowsColumns") * cdef ndarray pyrows = array_i(numRows, rows) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 709, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeroRowsColumns); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 709, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_zeroRowsColumns = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":710 * FunctionBegin(b"MatZeroRowsColumns_Python") * cdef zeroRowsColumns = PyMat(mat).zeroRowsColumns * if zeroRowsColumns is None: return UNSUPPORTED(b"zeroRowsColumns") # <<<<<<<<<<<<<< * cdef ndarray pyrows = array_i(numRows, rows) * zeroRowsColumns(Mat_(mat), pyrows, toScalar(diag), Vec_(x), Vec_(b)) */ __pyx_t_3 = (__pyx_v_zeroRowsColumns == Py_None); if (__pyx_t_3) { __pyx_r = __pyx_f_8petsc4py_5PETSc_UNSUPPORTED(((char *)"zeroRowsColumns")); goto __pyx_L0; } /* "petsc4py/PETSc/libpetsc4py.pyx":711 * cdef zeroRowsColumns = PyMat(mat).zeroRowsColumns * if zeroRowsColumns is None: return UNSUPPORTED(b"zeroRowsColumns") * cdef ndarray pyrows = array_i(numRows, rows) # <<<<<<<<<<<<<< * zeroRowsColumns(Mat_(mat), pyrows, toScalar(diag), Vec_(x), Vec_(b)) * return FunctionEnd() */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i(__pyx_v_numRows, __pyx_v_rows)); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 711, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_pyrows = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":712 * if zeroRowsColumns is None: return UNSUPPORTED(b"zeroRowsColumns") * cdef ndarray pyrows = array_i(numRows, rows) * zeroRowsColumns(Mat_(mat), pyrows, toScalar(diag), Vec_(x), Vec_(b)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 712, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toScalar(__pyx_v_diag); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 712, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_x)); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 712, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_b)); if (unlikely(!__pyx_t_6)) __PYX_ERR(11, 712, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_zeroRowsColumns); __pyx_t_7 = __pyx_v_zeroRowsColumns; __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[6] = {__pyx_t_8, __pyx_t_1, ((PyObject *)__pyx_v_pyrows), __pyx_t_4, __pyx_t_5, __pyx_t_6}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 5+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 712, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":713 * cdef ndarray pyrows = array_i(numRows, rows) * zeroRowsColumns(Mat_(mat), pyrows, toScalar(diag), Vec_(x), Vec_(b)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatScale_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":699 * return FunctionEnd() * * cdef PetscErrorCode MatZeroRowsColumns_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscInt numRows, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("petsc4py.PETSc.MatZeroRowsColumns_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_zeroRowsColumns); __Pyx_XDECREF((PyObject *)__pyx_v_pyrows); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":715 * return FunctionEnd() * * cdef PetscErrorCode MatScale_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscScalar s, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatScale_Python(Mat __pyx_v_mat, PetscScalar __pyx_v_s) { PyObject *__pyx_v_scale = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatScale_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":720 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatScale_Python") # <<<<<<<<<<<<<< * cdef scale = PyMat(mat).scale * if scale is None: return UNSUPPORTED(b"scale") */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"MatScale_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":721 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatScale_Python") * cdef scale = PyMat(mat).scale # <<<<<<<<<<<<<< * if scale is None: return UNSUPPORTED(b"scale") * scale(Mat_(mat), toScalar(s)) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 721, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_scale); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 721, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_scale = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":722 * FunctionBegin(b"MatScale_Python") * cdef scale = PyMat(mat).scale * if scale is None: return UNSUPPORTED(b"scale") # <<<<<<<<<<<<<< * scale(Mat_(mat), toScalar(s)) * return FunctionEnd() */ __pyx_t_3 = (__pyx_v_scale == Py_None); if (__pyx_t_3) { __pyx_r = __pyx_f_8petsc4py_5PETSc_UNSUPPORTED(((char *)"scale")); goto __pyx_L0; } /* "petsc4py/PETSc/libpetsc4py.pyx":723 * cdef scale = PyMat(mat).scale * if scale is None: return UNSUPPORTED(b"scale") * scale(Mat_(mat), toScalar(s)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 723, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toScalar(__pyx_v_s); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 723, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_scale); __pyx_t_5 = __pyx_v_scale; __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_1, __pyx_t_4}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 723, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":724 * if scale is None: return UNSUPPORTED(b"scale") * scale(Mat_(mat), toScalar(s)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatShift_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":715 * return FunctionEnd() * * cdef PetscErrorCode MatScale_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscScalar s, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.MatScale_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_scale); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":726 * return FunctionEnd() * * cdef PetscErrorCode MatShift_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscScalar s, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatShift_Python(Mat __pyx_v_mat, PetscScalar __pyx_v_s) { PyObject *__pyx_v_shift = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatShift_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":731 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatShift_Python") # <<<<<<<<<<<<<< * cdef shift = PyMat(mat).shift * if shift is None: return UNSUPPORTED(b"shift") */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"MatShift_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":732 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatShift_Python") * cdef shift = PyMat(mat).shift # <<<<<<<<<<<<<< * if shift is None: return UNSUPPORTED(b"shift") * shift(Mat_(mat), toScalar(s)) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_shift); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_shift = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":733 * FunctionBegin(b"MatShift_Python") * cdef shift = PyMat(mat).shift * if shift is None: return UNSUPPORTED(b"shift") # <<<<<<<<<<<<<< * shift(Mat_(mat), toScalar(s)) * return FunctionEnd() */ __pyx_t_3 = (__pyx_v_shift == Py_None); if (__pyx_t_3) { __pyx_r = __pyx_f_8petsc4py_5PETSc_UNSUPPORTED(((char *)"shift")); goto __pyx_L0; } /* "petsc4py/PETSc/libpetsc4py.pyx":734 * cdef shift = PyMat(mat).shift * if shift is None: return UNSUPPORTED(b"shift") * shift(Mat_(mat), toScalar(s)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 734, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toScalar(__pyx_v_s); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 734, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_shift); __pyx_t_5 = __pyx_v_shift; __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_1, __pyx_t_4}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 734, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":735 * if shift is None: return UNSUPPORTED(b"shift") * shift(Mat_(mat), toScalar(s)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatCreateVecs_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":726 * return FunctionEnd() * * cdef PetscErrorCode MatShift_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscScalar s, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.MatShift_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_shift); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":737 * return FunctionEnd() * * cdef PetscErrorCode MatCreateVecs_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscVec *x, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatCreateVecs_Python(Mat __pyx_v_mat, Vec *__pyx_v_x, Vec *__pyx_v_y) { PyObject *__pyx_v_createVecs = 0; struct PyPetscVecObject *__pyx_v_u = 0; struct PyPetscVecObject *__pyx_v_v = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PetscErrorCode __pyx_t_4; int __pyx_t_5; int __pyx_t_6; char const *__pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *(*__pyx_t_16)(PyObject *); Vec __pyx_t_17; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatCreateVecs_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":743 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatCreateVecs_Python") # <<<<<<<<<<<<<< * cdef createVecs = PyMat(mat).createVecs * if createVecs is None: */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"MatCreateVecs_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":744 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatCreateVecs_Python") * cdef createVecs = PyMat(mat).createVecs # <<<<<<<<<<<<<< * if createVecs is None: * try: */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 744, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_createVecs); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 744, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_createVecs = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":745 * FunctionBegin(b"MatCreateVecs_Python") * cdef createVecs = PyMat(mat).createVecs * if createVecs is None: # <<<<<<<<<<<<<< * try: * mat.ops.getvecs = NULL */ __pyx_t_3 = (__pyx_v_createVecs == Py_None); if (__pyx_t_3) { /* "petsc4py/PETSc/libpetsc4py.pyx":746 * cdef createVecs = PyMat(mat).createVecs * if createVecs is None: * try: # <<<<<<<<<<<<<< * mat.ops.getvecs = NULL * CHKERR( MatCreateVecs(mat, x, y) ) */ /*try:*/ { /* "petsc4py/PETSc/libpetsc4py.pyx":747 * if createVecs is None: * try: * mat.ops.getvecs = NULL # <<<<<<<<<<<<<< * CHKERR( MatCreateVecs(mat, x, y) ) * finally: */ __pyx_v_mat->ops->getvecs = NULL; /* "petsc4py/PETSc/libpetsc4py.pyx":748 * try: * mat.ops.getvecs = NULL * CHKERR( MatCreateVecs(mat, x, y) ) # <<<<<<<<<<<<<< * finally: * mat.ops.getvecs = MatCreateVecs_Python */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreateVecs(__pyx_v_mat, __pyx_v_x, __pyx_v_y)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 748, __pyx_L5_error) } /* "petsc4py/PETSc/libpetsc4py.pyx":750 * CHKERR( MatCreateVecs(mat, x, y) ) * finally: * mat.ops.getvecs = MatCreateVecs_Python # <<<<<<<<<<<<<< * return FunctionEnd() * cdef Vec u, v */ /*finally:*/ { /*normal exit:*/{ __pyx_v_mat->ops->getvecs = __pyx_f_8petsc4py_5PETSc_MatCreateVecs_Python; goto __pyx_L6; } __pyx_L5_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10) < 0)) __Pyx_ErrFetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); __pyx_t_5 = __pyx_lineno; __pyx_t_6 = __pyx_clineno; __pyx_t_7 = __pyx_filename; { __pyx_v_mat->ops->getvecs = __pyx_f_8petsc4py_5PETSc_MatCreateVecs_Python; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); } __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ErrRestore(__pyx_t_8, __pyx_t_9, __pyx_t_10); __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_lineno = __pyx_t_5; __pyx_clineno = __pyx_t_6; __pyx_filename = __pyx_t_7; goto __pyx_L1_error; } __pyx_L6:; } /* "petsc4py/PETSc/libpetsc4py.pyx":751 * finally: * mat.ops.getvecs = MatCreateVecs_Python * return FunctionEnd() # <<<<<<<<<<<<<< * cdef Vec u, v * u, v = createVecs(Mat_(mat)) */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":745 * FunctionBegin(b"MatCreateVecs_Python") * cdef createVecs = PyMat(mat).createVecs * if createVecs is None: # <<<<<<<<<<<<<< * try: * mat.ops.getvecs = NULL */ } /* "petsc4py/PETSc/libpetsc4py.pyx":753 * return FunctionEnd() * cdef Vec u, v * u, v = createVecs(Mat_(mat)) # <<<<<<<<<<<<<< * if x != NULL: * x[0] = u.vec */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 753, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_createVecs); __pyx_t_14 = __pyx_v_createVecs; __pyx_t_15 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_14))) { __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_14); if (likely(__pyx_t_15)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14); __Pyx_INCREF(__pyx_t_15); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_14, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_t_1}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_14, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 753, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { PyObject* sequence = __pyx_t_2; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(11, 753, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_14 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_14 = PyList_GET_ITEM(sequence, 0); __pyx_t_1 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(__pyx_t_1); #else __pyx_t_14 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(11, 753, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 753, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; __pyx_t_15 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_15)) __PYX_ERR(11, 753, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_16 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_15); index = 0; __pyx_t_14 = __pyx_t_16(__pyx_t_15); if (unlikely(!__pyx_t_14)) goto __pyx_L9_unpacking_failed; __Pyx_GOTREF(__pyx_t_14); index = 1; __pyx_t_1 = __pyx_t_16(__pyx_t_15); if (unlikely(!__pyx_t_1)) goto __pyx_L9_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); if (__Pyx_IternextUnpackEndCheck(__pyx_t_16(__pyx_t_15), 2) < 0) __PYX_ERR(11, 753, __pyx_L1_error) __pyx_t_16 = NULL; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; goto __pyx_L10_unpacking_done; __pyx_L9_unpacking_failed:; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __pyx_t_16 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(11, 753, __pyx_L1_error) __pyx_L10_unpacking_done:; } if (!(likely(((__pyx_t_14) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_14, __pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(11, 753, __pyx_L1_error) if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(11, 753, __pyx_L1_error) __pyx_v_u = ((struct PyPetscVecObject *)__pyx_t_14); __pyx_t_14 = 0; __pyx_v_v = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":754 * cdef Vec u, v * u, v = createVecs(Mat_(mat)) * if x != NULL: # <<<<<<<<<<<<<< * x[0] = u.vec * u.vec = NULL */ __pyx_t_3 = (__pyx_v_x != NULL); if (__pyx_t_3) { /* "petsc4py/PETSc/libpetsc4py.pyx":755 * u, v = createVecs(Mat_(mat)) * if x != NULL: * x[0] = u.vec # <<<<<<<<<<<<<< * u.vec = NULL * if y != NULL: */ __pyx_t_17 = __pyx_v_u->vec; (__pyx_v_x[0]) = __pyx_t_17; /* "petsc4py/PETSc/libpetsc4py.pyx":756 * if x != NULL: * x[0] = u.vec * u.vec = NULL # <<<<<<<<<<<<<< * if y != NULL: * y[0] = v.vec */ __pyx_v_u->vec = NULL; /* "petsc4py/PETSc/libpetsc4py.pyx":754 * cdef Vec u, v * u, v = createVecs(Mat_(mat)) * if x != NULL: # <<<<<<<<<<<<<< * x[0] = u.vec * u.vec = NULL */ } /* "petsc4py/PETSc/libpetsc4py.pyx":757 * x[0] = u.vec * u.vec = NULL * if y != NULL: # <<<<<<<<<<<<<< * y[0] = v.vec * v.vec = NULL */ __pyx_t_3 = (__pyx_v_y != NULL); if (__pyx_t_3) { /* "petsc4py/PETSc/libpetsc4py.pyx":758 * u.vec = NULL * if y != NULL: * y[0] = v.vec # <<<<<<<<<<<<<< * v.vec = NULL * return FunctionEnd() */ __pyx_t_17 = __pyx_v_v->vec; (__pyx_v_y[0]) = __pyx_t_17; /* "petsc4py/PETSc/libpetsc4py.pyx":759 * if y != NULL: * y[0] = v.vec * v.vec = NULL # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_v_v->vec = NULL; /* "petsc4py/PETSc/libpetsc4py.pyx":757 * x[0] = u.vec * u.vec = NULL * if y != NULL: # <<<<<<<<<<<<<< * y[0] = v.vec * v.vec = NULL */ } /* "petsc4py/PETSc/libpetsc4py.pyx":760 * y[0] = v.vec * v.vec = NULL * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatMult_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":737 * return FunctionEnd() * * cdef PetscErrorCode MatCreateVecs_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscVec *x, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_14); __Pyx_XDECREF(__pyx_t_15); __Pyx_AddTraceback("petsc4py.PETSc.MatCreateVecs_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_createVecs); __Pyx_XDECREF((PyObject *)__pyx_v_u); __Pyx_XDECREF((PyObject *)__pyx_v_v); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":762 * return FunctionEnd() * * cdef PetscErrorCode MatMult_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscVec x, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatMult_Python(Mat __pyx_v_mat, Vec __pyx_v_x, Vec __pyx_v_y) { PyObject *__pyx_v_mult = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatMult_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":768 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatMult_Python") # <<<<<<<<<<<<<< * cdef mult = PyMat(mat).mult * if mult is None: return UNSUPPORTED(b"mult") */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"MatMult_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":769 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatMult_Python") * cdef mult = PyMat(mat).mult # <<<<<<<<<<<<<< * if mult is None: return UNSUPPORTED(b"mult") * mult(Mat_(mat), Vec_(x), Vec_(y)) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 769, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_mult); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 769, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_mult = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":770 * FunctionBegin(b"MatMult_Python") * cdef mult = PyMat(mat).mult * if mult is None: return UNSUPPORTED(b"mult") # <<<<<<<<<<<<<< * mult(Mat_(mat), Vec_(x), Vec_(y)) * return FunctionEnd() */ __pyx_t_3 = (__pyx_v_mult == Py_None); if (__pyx_t_3) { __pyx_r = __pyx_f_8petsc4py_5PETSc_UNSUPPORTED(((char *)"mult")); goto __pyx_L0; } /* "petsc4py/PETSc/libpetsc4py.pyx":771 * cdef mult = PyMat(mat).mult * if mult is None: return UNSUPPORTED(b"mult") * mult(Mat_(mat), Vec_(x), Vec_(y)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 771, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_x)); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 771, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_y)); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 771, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_mult); __pyx_t_6 = __pyx_v_mult; __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_7, __pyx_t_1, __pyx_t_4, __pyx_t_5}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 3+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 771, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":772 * if mult is None: return UNSUPPORTED(b"mult") * mult(Mat_(mat), Vec_(x), Vec_(y)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatMultTranspose_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":762 * return FunctionEnd() * * cdef PetscErrorCode MatMult_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscVec x, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.MatMult_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_mult); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":774 * return FunctionEnd() * * cdef PetscErrorCode MatMultTranspose_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscVec x, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatMultTranspose_Python(Mat __pyx_v_mat, Vec __pyx_v_x, Vec __pyx_v_y) { PyObject *__pyx_v_multTranspose = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PetscErrorCode __pyx_t_4; int __pyx_t_5; int __pyx_t_6; char const *__pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatMultTranspose_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":780 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatMultTranspose_Python") # <<<<<<<<<<<<<< * cdef multTranspose = PyMat(mat).multTranspose * if multTranspose is None: */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"MatMultTranspose_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":781 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatMultTranspose_Python") * cdef multTranspose = PyMat(mat).multTranspose # <<<<<<<<<<<<<< * if multTranspose is None: * try: */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 781, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_multTranspose); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 781, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_multTranspose = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":782 * FunctionBegin(b"MatMultTranspose_Python") * cdef multTranspose = PyMat(mat).multTranspose * if multTranspose is None: # <<<<<<<<<<<<<< * try: * mat.ops.multtranspose = NULL */ __pyx_t_3 = (__pyx_v_multTranspose == Py_None); if (__pyx_t_3) { /* "petsc4py/PETSc/libpetsc4py.pyx":783 * cdef multTranspose = PyMat(mat).multTranspose * if multTranspose is None: * try: # <<<<<<<<<<<<<< * mat.ops.multtranspose = NULL * CHKERR( MatMultTranspose(mat, x, y) ) */ /*try:*/ { /* "petsc4py/PETSc/libpetsc4py.pyx":784 * if multTranspose is None: * try: * mat.ops.multtranspose = NULL # <<<<<<<<<<<<<< * CHKERR( MatMultTranspose(mat, x, y) ) * finally: */ __pyx_v_mat->ops->multtranspose = NULL; /* "petsc4py/PETSc/libpetsc4py.pyx":785 * try: * mat.ops.multtranspose = NULL * CHKERR( MatMultTranspose(mat, x, y) ) # <<<<<<<<<<<<<< * finally: * mat.ops.multtranspose = MatMultTranspose_Python */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatMultTranspose(__pyx_v_mat, __pyx_v_x, __pyx_v_y)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 785, __pyx_L5_error) } /* "petsc4py/PETSc/libpetsc4py.pyx":787 * CHKERR( MatMultTranspose(mat, x, y) ) * finally: * mat.ops.multtranspose = MatMultTranspose_Python # <<<<<<<<<<<<<< * return FunctionEnd() * multTranspose(Mat_(mat), Vec_(x), Vec_(y)) */ /*finally:*/ { /*normal exit:*/{ __pyx_v_mat->ops->multtranspose = __pyx_f_8petsc4py_5PETSc_MatMultTranspose_Python; goto __pyx_L6; } __pyx_L5_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10) < 0)) __Pyx_ErrFetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); __pyx_t_5 = __pyx_lineno; __pyx_t_6 = __pyx_clineno; __pyx_t_7 = __pyx_filename; { __pyx_v_mat->ops->multtranspose = __pyx_f_8petsc4py_5PETSc_MatMultTranspose_Python; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); } __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ErrRestore(__pyx_t_8, __pyx_t_9, __pyx_t_10); __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_lineno = __pyx_t_5; __pyx_clineno = __pyx_t_6; __pyx_filename = __pyx_t_7; goto __pyx_L1_error; } __pyx_L6:; } /* "petsc4py/PETSc/libpetsc4py.pyx":788 * finally: * mat.ops.multtranspose = MatMultTranspose_Python * return FunctionEnd() # <<<<<<<<<<<<<< * multTranspose(Mat_(mat), Vec_(x), Vec_(y)) * return FunctionEnd() */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":782 * FunctionBegin(b"MatMultTranspose_Python") * cdef multTranspose = PyMat(mat).multTranspose * if multTranspose is None: # <<<<<<<<<<<<<< * try: * mat.ops.multtranspose = NULL */ } /* "petsc4py/PETSc/libpetsc4py.pyx":789 * mat.ops.multtranspose = MatMultTranspose_Python * return FunctionEnd() * multTranspose(Mat_(mat), Vec_(x), Vec_(y)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 789, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_14 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_x)); if (unlikely(!__pyx_t_14)) __PYX_ERR(11, 789, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_15 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_y)); if (unlikely(!__pyx_t_15)) __PYX_ERR(11, 789, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_INCREF(__pyx_v_multTranspose); __pyx_t_16 = __pyx_v_multTranspose; __pyx_t_17 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_16))) { __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_16); if (likely(__pyx_t_17)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16); __Pyx_INCREF(__pyx_t_17); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_16, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_17, __pyx_t_1, __pyx_t_14, __pyx_t_15}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_16, __pyx_callargs+1-__pyx_t_6, 3+__pyx_t_6); __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 789, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":790 * return FunctionEnd() * multTranspose(Mat_(mat), Vec_(x), Vec_(y)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatMultHermitian_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":774 * return FunctionEnd() * * cdef PetscErrorCode MatMultTranspose_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscVec x, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_14); __Pyx_XDECREF(__pyx_t_15); __Pyx_XDECREF(__pyx_t_16); __Pyx_XDECREF(__pyx_t_17); __Pyx_AddTraceback("petsc4py.PETSc.MatMultTranspose_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_multTranspose); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":792 * return FunctionEnd() * * cdef PetscErrorCode MatMultHermitian_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscVec x, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatMultHermitian_Python(Mat __pyx_v_mat, Vec __pyx_v_x, Vec __pyx_v_y) { PyObject *__pyx_v_multHermitian = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PetscErrorCode __pyx_t_4; int __pyx_t_5; int __pyx_t_6; char const *__pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatMultHermitian_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":798 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatMultHermitian_Python") # <<<<<<<<<<<<<< * cdef multHermitian = PyMat(mat).multHermitian * if multHermitian is None: */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"MatMultHermitian_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":799 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatMultHermitian_Python") * cdef multHermitian = PyMat(mat).multHermitian # <<<<<<<<<<<<<< * if multHermitian is None: * try: */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 799, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_multHermitian); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 799, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_multHermitian = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":800 * FunctionBegin(b"MatMultHermitian_Python") * cdef multHermitian = PyMat(mat).multHermitian * if multHermitian is None: # <<<<<<<<<<<<<< * try: * mat.ops.multhermitian = NULL */ __pyx_t_3 = (__pyx_v_multHermitian == Py_None); if (__pyx_t_3) { /* "petsc4py/PETSc/libpetsc4py.pyx":801 * cdef multHermitian = PyMat(mat).multHermitian * if multHermitian is None: * try: # <<<<<<<<<<<<<< * mat.ops.multhermitian = NULL * CHKERR( MatMultHermitian(mat, x, y) ) */ /*try:*/ { /* "petsc4py/PETSc/libpetsc4py.pyx":802 * if multHermitian is None: * try: * mat.ops.multhermitian = NULL # <<<<<<<<<<<<<< * CHKERR( MatMultHermitian(mat, x, y) ) * finally: */ __pyx_v_mat->ops->multhermitiantranspose = NULL; /* "petsc4py/PETSc/libpetsc4py.pyx":803 * try: * mat.ops.multhermitian = NULL * CHKERR( MatMultHermitian(mat, x, y) ) # <<<<<<<<<<<<<< * finally: * mat.ops.multhermitian = MatMultHermitian_Python */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatMultHermitianTranspose(__pyx_v_mat, __pyx_v_x, __pyx_v_y)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 803, __pyx_L5_error) } /* "petsc4py/PETSc/libpetsc4py.pyx":805 * CHKERR( MatMultHermitian(mat, x, y) ) * finally: * mat.ops.multhermitian = MatMultHermitian_Python # <<<<<<<<<<<<<< * return FunctionEnd() * multHermitian(Mat_(mat), Vec_(x), Vec_(y)) */ /*finally:*/ { /*normal exit:*/{ __pyx_v_mat->ops->multhermitiantranspose = __pyx_f_8petsc4py_5PETSc_MatMultHermitian_Python; goto __pyx_L6; } __pyx_L5_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10) < 0)) __Pyx_ErrFetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); __pyx_t_5 = __pyx_lineno; __pyx_t_6 = __pyx_clineno; __pyx_t_7 = __pyx_filename; { __pyx_v_mat->ops->multhermitiantranspose = __pyx_f_8petsc4py_5PETSc_MatMultHermitian_Python; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); } __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ErrRestore(__pyx_t_8, __pyx_t_9, __pyx_t_10); __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_lineno = __pyx_t_5; __pyx_clineno = __pyx_t_6; __pyx_filename = __pyx_t_7; goto __pyx_L1_error; } __pyx_L6:; } /* "petsc4py/PETSc/libpetsc4py.pyx":806 * finally: * mat.ops.multhermitian = MatMultHermitian_Python * return FunctionEnd() # <<<<<<<<<<<<<< * multHermitian(Mat_(mat), Vec_(x), Vec_(y)) * return FunctionEnd() */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":800 * FunctionBegin(b"MatMultHermitian_Python") * cdef multHermitian = PyMat(mat).multHermitian * if multHermitian is None: # <<<<<<<<<<<<<< * try: * mat.ops.multhermitian = NULL */ } /* "petsc4py/PETSc/libpetsc4py.pyx":807 * mat.ops.multhermitian = MatMultHermitian_Python * return FunctionEnd() * multHermitian(Mat_(mat), Vec_(x), Vec_(y)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 807, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_14 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_x)); if (unlikely(!__pyx_t_14)) __PYX_ERR(11, 807, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_15 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_y)); if (unlikely(!__pyx_t_15)) __PYX_ERR(11, 807, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_INCREF(__pyx_v_multHermitian); __pyx_t_16 = __pyx_v_multHermitian; __pyx_t_17 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_16))) { __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_16); if (likely(__pyx_t_17)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16); __Pyx_INCREF(__pyx_t_17); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_16, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_17, __pyx_t_1, __pyx_t_14, __pyx_t_15}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_16, __pyx_callargs+1-__pyx_t_6, 3+__pyx_t_6); __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 807, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":808 * return FunctionEnd() * multHermitian(Mat_(mat), Vec_(x), Vec_(y)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatMultAdd_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":792 * return FunctionEnd() * * cdef PetscErrorCode MatMultHermitian_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscVec x, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_14); __Pyx_XDECREF(__pyx_t_15); __Pyx_XDECREF(__pyx_t_16); __Pyx_XDECREF(__pyx_t_17); __Pyx_AddTraceback("petsc4py.PETSc.MatMultHermitian_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_multHermitian); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":810 * return FunctionEnd() * * cdef PetscErrorCode MatMultAdd_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscVec x, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatMultAdd_Python(Mat __pyx_v_mat, Vec __pyx_v_x, Vec __pyx_v_v, Vec __pyx_v_y) { PyObject *__pyx_v_multAdd = 0; Vec __pyx_v_t; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PetscErrorCode __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatMultAdd_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":817 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatMultAdd_Python") # <<<<<<<<<<<<<< * cdef multAdd = PyMat(mat).multAdd * cdef PetscVec t = NULL */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"MatMultAdd_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":818 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatMultAdd_Python") * cdef multAdd = PyMat(mat).multAdd # <<<<<<<<<<<<<< * cdef PetscVec t = NULL * if multAdd is None: */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_multAdd); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_multAdd = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":819 * FunctionBegin(b"MatMultAdd_Python") * cdef multAdd = PyMat(mat).multAdd * cdef PetscVec t = NULL # <<<<<<<<<<<<<< * if multAdd is None: * if v == y: */ __pyx_v_t = NULL; /* "petsc4py/PETSc/libpetsc4py.pyx":820 * cdef multAdd = PyMat(mat).multAdd * cdef PetscVec t = NULL * if multAdd is None: # <<<<<<<<<<<<<< * if v == y: * CHKERR( VecDuplicate(y, &t) ) */ __pyx_t_3 = (__pyx_v_multAdd == Py_None); if (__pyx_t_3) { /* "petsc4py/PETSc/libpetsc4py.pyx":821 * cdef PetscVec t = NULL * if multAdd is None: * if v == y: # <<<<<<<<<<<<<< * CHKERR( VecDuplicate(y, &t) ) * CHKERR( MatMult(mat, x, t) ) */ __pyx_t_3 = (__pyx_v_v == __pyx_v_y); if (__pyx_t_3) { /* "petsc4py/PETSc/libpetsc4py.pyx":822 * if multAdd is None: * if v == y: * CHKERR( VecDuplicate(y, &t) ) # <<<<<<<<<<<<<< * CHKERR( MatMult(mat, x, t) ) * CHKERR( VecAXPY(y, 1.0, t) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecDuplicate(__pyx_v_y, (&__pyx_v_t))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 822, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":823 * if v == y: * CHKERR( VecDuplicate(y, &t) ) * CHKERR( MatMult(mat, x, t) ) # <<<<<<<<<<<<<< * CHKERR( VecAXPY(y, 1.0, t) ) * CHKERR( VecDestroy(&t) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatMult(__pyx_v_mat, __pyx_v_x, __pyx_v_t)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 823, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":824 * CHKERR( VecDuplicate(y, &t) ) * CHKERR( MatMult(mat, x, t) ) * CHKERR( VecAXPY(y, 1.0, t) ) # <<<<<<<<<<<<<< * CHKERR( VecDestroy(&t) ) * else: */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecAXPY(__pyx_v_y, 1.0, __pyx_v_t)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 824, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":825 * CHKERR( MatMult(mat, x, t) ) * CHKERR( VecAXPY(y, 1.0, t) ) * CHKERR( VecDestroy(&t) ) # <<<<<<<<<<<<<< * else: * CHKERR( MatMult(mat, x, y) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecDestroy((&__pyx_v_t))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 825, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":821 * cdef PetscVec t = NULL * if multAdd is None: * if v == y: # <<<<<<<<<<<<<< * CHKERR( VecDuplicate(y, &t) ) * CHKERR( MatMult(mat, x, t) ) */ goto __pyx_L4; } /* "petsc4py/PETSc/libpetsc4py.pyx":827 * CHKERR( VecDestroy(&t) ) * else: * CHKERR( MatMult(mat, x, y) ) # <<<<<<<<<<<<<< * CHKERR( VecAXPY(y, 1.0, v) ) * return FunctionEnd() */ /*else*/ { __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatMult(__pyx_v_mat, __pyx_v_x, __pyx_v_y)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 827, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":828 * else: * CHKERR( MatMult(mat, x, y) ) * CHKERR( VecAXPY(y, 1.0, v) ) # <<<<<<<<<<<<<< * return FunctionEnd() * if multAdd is None: return UNSUPPORTED(b"multAdd") */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecAXPY(__pyx_v_y, 1.0, __pyx_v_v)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 828, __pyx_L1_error) } __pyx_L4:; /* "petsc4py/PETSc/libpetsc4py.pyx":829 * CHKERR( MatMult(mat, x, y) ) * CHKERR( VecAXPY(y, 1.0, v) ) * return FunctionEnd() # <<<<<<<<<<<<<< * if multAdd is None: return UNSUPPORTED(b"multAdd") * multAdd(Mat_(mat), Vec_(x), Vec_(v), Vec_(y)) */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":820 * cdef multAdd = PyMat(mat).multAdd * cdef PetscVec t = NULL * if multAdd is None: # <<<<<<<<<<<<<< * if v == y: * CHKERR( VecDuplicate(y, &t) ) */ } /* "petsc4py/PETSc/libpetsc4py.pyx":830 * CHKERR( VecAXPY(y, 1.0, v) ) * return FunctionEnd() * if multAdd is None: return UNSUPPORTED(b"multAdd") # <<<<<<<<<<<<<< * multAdd(Mat_(mat), Vec_(x), Vec_(v), Vec_(y)) * return FunctionEnd() */ __pyx_t_3 = (__pyx_v_multAdd == Py_None); if (__pyx_t_3) { __pyx_r = __pyx_f_8petsc4py_5PETSc_UNSUPPORTED(((char *)"multAdd")); goto __pyx_L0; } /* "petsc4py/PETSc/libpetsc4py.pyx":831 * return FunctionEnd() * if multAdd is None: return UNSUPPORTED(b"multAdd") * multAdd(Mat_(mat), Vec_(x), Vec_(v), Vec_(y)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 831, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_x)); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 831, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_v)); if (unlikely(!__pyx_t_6)) __PYX_ERR(11, 831, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_y)); if (unlikely(!__pyx_t_7)) __PYX_ERR(11, 831, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_v_multAdd); __pyx_t_8 = __pyx_v_multAdd; __pyx_t_9 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_8))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_9, __pyx_t_1, __pyx_t_5, __pyx_t_6, __pyx_t_7}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_10, 4+__pyx_t_10); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 831, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":832 * if multAdd is None: return UNSUPPORTED(b"multAdd") * multAdd(Mat_(mat), Vec_(x), Vec_(v), Vec_(y)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatMultTransposeAdd_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":810 * return FunctionEnd() * * cdef PetscErrorCode MatMultAdd_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscVec x, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("petsc4py.PETSc.MatMultAdd_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_multAdd); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":834 * return FunctionEnd() * * cdef PetscErrorCode MatMultTransposeAdd_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscVec x, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatMultTransposeAdd_Python(Mat __pyx_v_mat, Vec __pyx_v_x, Vec __pyx_v_v, Vec __pyx_v_y) { PyObject *__pyx_v_multTransposeAdd = 0; Vec __pyx_v_t; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PetscErrorCode __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatMultTransposeAdd_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":841 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatMultTransposeAdd_Python") # <<<<<<<<<<<<<< * cdef multTransposeAdd = PyMat(mat).multTransposeAdd * cdef PetscVec t = NULL */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"MatMultTransposeAdd_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":842 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatMultTransposeAdd_Python") * cdef multTransposeAdd = PyMat(mat).multTransposeAdd # <<<<<<<<<<<<<< * cdef PetscVec t = NULL * if multTransposeAdd is None: */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 842, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_multTransposeAdd); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 842, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_multTransposeAdd = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":843 * FunctionBegin(b"MatMultTransposeAdd_Python") * cdef multTransposeAdd = PyMat(mat).multTransposeAdd * cdef PetscVec t = NULL # <<<<<<<<<<<<<< * if multTransposeAdd is None: * if v == y: */ __pyx_v_t = NULL; /* "petsc4py/PETSc/libpetsc4py.pyx":844 * cdef multTransposeAdd = PyMat(mat).multTransposeAdd * cdef PetscVec t = NULL * if multTransposeAdd is None: # <<<<<<<<<<<<<< * if v == y: * CHKERR( VecDuplicate(y, &t) ) */ __pyx_t_3 = (__pyx_v_multTransposeAdd == Py_None); if (__pyx_t_3) { /* "petsc4py/PETSc/libpetsc4py.pyx":845 * cdef PetscVec t = NULL * if multTransposeAdd is None: * if v == y: # <<<<<<<<<<<<<< * CHKERR( VecDuplicate(y, &t) ) * CHKERR( MatMultTranspose(mat, x, t) ) */ __pyx_t_3 = (__pyx_v_v == __pyx_v_y); if (__pyx_t_3) { /* "petsc4py/PETSc/libpetsc4py.pyx":846 * if multTransposeAdd is None: * if v == y: * CHKERR( VecDuplicate(y, &t) ) # <<<<<<<<<<<<<< * CHKERR( MatMultTranspose(mat, x, t) ) * CHKERR( VecAXPY(y, 1.0, t) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecDuplicate(__pyx_v_y, (&__pyx_v_t))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 846, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":847 * if v == y: * CHKERR( VecDuplicate(y, &t) ) * CHKERR( MatMultTranspose(mat, x, t) ) # <<<<<<<<<<<<<< * CHKERR( VecAXPY(y, 1.0, t) ) * CHKERR( VecDestroy(&t) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatMultTranspose(__pyx_v_mat, __pyx_v_x, __pyx_v_t)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 847, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":848 * CHKERR( VecDuplicate(y, &t) ) * CHKERR( MatMultTranspose(mat, x, t) ) * CHKERR( VecAXPY(y, 1.0, t) ) # <<<<<<<<<<<<<< * CHKERR( VecDestroy(&t) ) * else: */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecAXPY(__pyx_v_y, 1.0, __pyx_v_t)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 848, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":849 * CHKERR( MatMultTranspose(mat, x, t) ) * CHKERR( VecAXPY(y, 1.0, t) ) * CHKERR( VecDestroy(&t) ) # <<<<<<<<<<<<<< * else: * CHKERR( MatMultTranspose(mat, x, y) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecDestroy((&__pyx_v_t))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 849, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":845 * cdef PetscVec t = NULL * if multTransposeAdd is None: * if v == y: # <<<<<<<<<<<<<< * CHKERR( VecDuplicate(y, &t) ) * CHKERR( MatMultTranspose(mat, x, t) ) */ goto __pyx_L4; } /* "petsc4py/PETSc/libpetsc4py.pyx":851 * CHKERR( VecDestroy(&t) ) * else: * CHKERR( MatMultTranspose(mat, x, y) ) # <<<<<<<<<<<<<< * CHKERR( VecAXPY(y, 1.0, v) ) * return FunctionEnd() */ /*else*/ { __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatMultTranspose(__pyx_v_mat, __pyx_v_x, __pyx_v_y)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 851, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":852 * else: * CHKERR( MatMultTranspose(mat, x, y) ) * CHKERR( VecAXPY(y, 1.0, v) ) # <<<<<<<<<<<<<< * return FunctionEnd() * if multTransposeAdd is None: return UNSUPPORTED(b"multTransposeAdd") */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecAXPY(__pyx_v_y, 1.0, __pyx_v_v)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 852, __pyx_L1_error) } __pyx_L4:; /* "petsc4py/PETSc/libpetsc4py.pyx":853 * CHKERR( MatMultTranspose(mat, x, y) ) * CHKERR( VecAXPY(y, 1.0, v) ) * return FunctionEnd() # <<<<<<<<<<<<<< * if multTransposeAdd is None: return UNSUPPORTED(b"multTransposeAdd") * multTransposeAdd(Mat_(mat), Vec_(x), Vec_(v), Vec_(y)) */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":844 * cdef multTransposeAdd = PyMat(mat).multTransposeAdd * cdef PetscVec t = NULL * if multTransposeAdd is None: # <<<<<<<<<<<<<< * if v == y: * CHKERR( VecDuplicate(y, &t) ) */ } /* "petsc4py/PETSc/libpetsc4py.pyx":854 * CHKERR( VecAXPY(y, 1.0, v) ) * return FunctionEnd() * if multTransposeAdd is None: return UNSUPPORTED(b"multTransposeAdd") # <<<<<<<<<<<<<< * multTransposeAdd(Mat_(mat), Vec_(x), Vec_(v), Vec_(y)) * return FunctionEnd() */ __pyx_t_3 = (__pyx_v_multTransposeAdd == Py_None); if (__pyx_t_3) { __pyx_r = __pyx_f_8petsc4py_5PETSc_UNSUPPORTED(((char *)"multTransposeAdd")); goto __pyx_L0; } /* "petsc4py/PETSc/libpetsc4py.pyx":855 * return FunctionEnd() * if multTransposeAdd is None: return UNSUPPORTED(b"multTransposeAdd") * multTransposeAdd(Mat_(mat), Vec_(x), Vec_(v), Vec_(y)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 855, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_x)); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 855, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_v)); if (unlikely(!__pyx_t_6)) __PYX_ERR(11, 855, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_y)); if (unlikely(!__pyx_t_7)) __PYX_ERR(11, 855, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_v_multTransposeAdd); __pyx_t_8 = __pyx_v_multTransposeAdd; __pyx_t_9 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_8))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_9, __pyx_t_1, __pyx_t_5, __pyx_t_6, __pyx_t_7}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_10, 4+__pyx_t_10); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 855, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":856 * if multTransposeAdd is None: return UNSUPPORTED(b"multTransposeAdd") * multTransposeAdd(Mat_(mat), Vec_(x), Vec_(v), Vec_(y)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatMultHermitianAdd_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":834 * return FunctionEnd() * * cdef PetscErrorCode MatMultTransposeAdd_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscVec x, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("petsc4py.PETSc.MatMultTransposeAdd_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_multTransposeAdd); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":858 * return FunctionEnd() * * cdef PetscErrorCode MatMultHermitianAdd_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscVec x, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatMultHermitianAdd_Python(Mat __pyx_v_mat, Vec __pyx_v_x, Vec __pyx_v_v, Vec __pyx_v_y) { PyObject *__pyx_v_multHermitianAdd = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PetscErrorCode __pyx_t_4; int __pyx_t_5; int __pyx_t_6; char const *__pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatMultHermitianAdd_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":865 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatMultHermitianAdd_Python") # <<<<<<<<<<<<<< * cdef multHermitianAdd = PyMat(mat).multHermitianAdd * if multHermitianAdd is None: */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"MatMultHermitianAdd_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":866 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatMultHermitianAdd_Python") * cdef multHermitianAdd = PyMat(mat).multHermitianAdd # <<<<<<<<<<<<<< * if multHermitianAdd is None: * try: */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 866, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_multHermitianAdd); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 866, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_multHermitianAdd = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":867 * FunctionBegin(b"MatMultHermitianAdd_Python") * cdef multHermitianAdd = PyMat(mat).multHermitianAdd * if multHermitianAdd is None: # <<<<<<<<<<<<<< * try: * mat.ops.multhermitianadd = NULL */ __pyx_t_3 = (__pyx_v_multHermitianAdd == Py_None); if (__pyx_t_3) { /* "petsc4py/PETSc/libpetsc4py.pyx":868 * cdef multHermitianAdd = PyMat(mat).multHermitianAdd * if multHermitianAdd is None: * try: # <<<<<<<<<<<<<< * mat.ops.multhermitianadd = NULL * CHKERR( MatMultHermitianAdd(mat, x, v, y) ) */ /*try:*/ { /* "petsc4py/PETSc/libpetsc4py.pyx":869 * if multHermitianAdd is None: * try: * mat.ops.multhermitianadd = NULL # <<<<<<<<<<<<<< * CHKERR( MatMultHermitianAdd(mat, x, v, y) ) * finally: */ __pyx_v_mat->ops->multhermitiantransposeadd = NULL; /* "petsc4py/PETSc/libpetsc4py.pyx":870 * try: * mat.ops.multhermitianadd = NULL * CHKERR( MatMultHermitianAdd(mat, x, v, y) ) # <<<<<<<<<<<<<< * finally: * mat.ops.multhermitianadd = MatMultHermitianAdd_Python */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatMultHermitianTransposeAdd(__pyx_v_mat, __pyx_v_x, __pyx_v_v, __pyx_v_y)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 870, __pyx_L5_error) } /* "petsc4py/PETSc/libpetsc4py.pyx":872 * CHKERR( MatMultHermitianAdd(mat, x, v, y) ) * finally: * mat.ops.multhermitianadd = MatMultHermitianAdd_Python # <<<<<<<<<<<<<< * return FunctionEnd() * multHermitianAdd(Mat_(mat), Vec_(x), Vec_(v), Vec_(y)) */ /*finally:*/ { /*normal exit:*/{ __pyx_v_mat->ops->multhermitiantransposeadd = __pyx_f_8petsc4py_5PETSc_MatMultHermitianAdd_Python; goto __pyx_L6; } __pyx_L5_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10) < 0)) __Pyx_ErrFetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); __pyx_t_5 = __pyx_lineno; __pyx_t_6 = __pyx_clineno; __pyx_t_7 = __pyx_filename; { __pyx_v_mat->ops->multhermitiantransposeadd = __pyx_f_8petsc4py_5PETSc_MatMultHermitianAdd_Python; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); } __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ErrRestore(__pyx_t_8, __pyx_t_9, __pyx_t_10); __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_lineno = __pyx_t_5; __pyx_clineno = __pyx_t_6; __pyx_filename = __pyx_t_7; goto __pyx_L1_error; } __pyx_L6:; } /* "petsc4py/PETSc/libpetsc4py.pyx":873 * finally: * mat.ops.multhermitianadd = MatMultHermitianAdd_Python * return FunctionEnd() # <<<<<<<<<<<<<< * multHermitianAdd(Mat_(mat), Vec_(x), Vec_(v), Vec_(y)) * return FunctionEnd() */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":867 * FunctionBegin(b"MatMultHermitianAdd_Python") * cdef multHermitianAdd = PyMat(mat).multHermitianAdd * if multHermitianAdd is None: # <<<<<<<<<<<<<< * try: * mat.ops.multhermitianadd = NULL */ } /* "petsc4py/PETSc/libpetsc4py.pyx":874 * mat.ops.multhermitianadd = MatMultHermitianAdd_Python * return FunctionEnd() * multHermitianAdd(Mat_(mat), Vec_(x), Vec_(v), Vec_(y)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_14 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_x)); if (unlikely(!__pyx_t_14)) __PYX_ERR(11, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_15 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_v)); if (unlikely(!__pyx_t_15)) __PYX_ERR(11, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_16 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_y)); if (unlikely(!__pyx_t_16)) __PYX_ERR(11, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_INCREF(__pyx_v_multHermitianAdd); __pyx_t_17 = __pyx_v_multHermitianAdd; __pyx_t_18 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_17))) { __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_17); if (likely(__pyx_t_18)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17); __Pyx_INCREF(__pyx_t_18); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_17, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_18, __pyx_t_1, __pyx_t_14, __pyx_t_15, __pyx_t_16}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_17, __pyx_callargs+1-__pyx_t_6, 4+__pyx_t_6); __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":875 * return FunctionEnd() * multHermitianAdd(Mat_(mat), Vec_(x), Vec_(v), Vec_(y)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatMultDiagonalBlock_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":858 * return FunctionEnd() * * cdef PetscErrorCode MatMultHermitianAdd_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscVec x, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_14); __Pyx_XDECREF(__pyx_t_15); __Pyx_XDECREF(__pyx_t_16); __Pyx_XDECREF(__pyx_t_17); __Pyx_XDECREF(__pyx_t_18); __Pyx_AddTraceback("petsc4py.PETSc.MatMultHermitianAdd_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_multHermitianAdd); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":877 * return FunctionEnd() * * cdef PetscErrorCode MatMultDiagonalBlock_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscVec x, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatMultDiagonalBlock_Python(Mat __pyx_v_mat, Vec __pyx_v_x, Vec __pyx_v_y) { PyObject *__pyx_v_multDiagonalBlock = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatMultDiagonalBlock_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":883 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatMultDiagonalBlock_Python") # <<<<<<<<<<<<<< * cdef multDiagonalBlock = PyMat(mat).multDiagonalBlock * if multDiagonalBlock is None: return UNSUPPORTED(b"multDiagonalBlock") */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"MatMultDiagonalBlock_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":884 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatMultDiagonalBlock_Python") * cdef multDiagonalBlock = PyMat(mat).multDiagonalBlock # <<<<<<<<<<<<<< * if multDiagonalBlock is None: return UNSUPPORTED(b"multDiagonalBlock") * multDiagonalBlock(Mat_(mat), Vec_(x), Vec_(y)) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 884, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_multDiagonalBlock); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 884, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_multDiagonalBlock = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":885 * FunctionBegin(b"MatMultDiagonalBlock_Python") * cdef multDiagonalBlock = PyMat(mat).multDiagonalBlock * if multDiagonalBlock is None: return UNSUPPORTED(b"multDiagonalBlock") # <<<<<<<<<<<<<< * multDiagonalBlock(Mat_(mat), Vec_(x), Vec_(y)) * return FunctionEnd() */ __pyx_t_3 = (__pyx_v_multDiagonalBlock == Py_None); if (__pyx_t_3) { __pyx_r = __pyx_f_8petsc4py_5PETSc_UNSUPPORTED(((char *)"multDiagonalBlock")); goto __pyx_L0; } /* "petsc4py/PETSc/libpetsc4py.pyx":886 * cdef multDiagonalBlock = PyMat(mat).multDiagonalBlock * if multDiagonalBlock is None: return UNSUPPORTED(b"multDiagonalBlock") * multDiagonalBlock(Mat_(mat), Vec_(x), Vec_(y)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 886, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_x)); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 886, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_y)); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 886, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_multDiagonalBlock); __pyx_t_6 = __pyx_v_multDiagonalBlock; __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_7, __pyx_t_1, __pyx_t_4, __pyx_t_5}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 3+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 886, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":887 * if multDiagonalBlock is None: return UNSUPPORTED(b"multDiagonalBlock") * multDiagonalBlock(Mat_(mat), Vec_(x), Vec_(y)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatSolve_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":877 * return FunctionEnd() * * cdef PetscErrorCode MatMultDiagonalBlock_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscVec x, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.MatMultDiagonalBlock_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_multDiagonalBlock); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":889 * return FunctionEnd() * * cdef PetscErrorCode MatSolve_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscVec b, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatSolve_Python(Mat __pyx_v_mat, Vec __pyx_v_b, Vec __pyx_v_x) { PyObject *__pyx_v_solve = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatSolve_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":895 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatSolve_Python") # <<<<<<<<<<<<<< * cdef solve = PyMat(mat).solve * if solve is None: return UNSUPPORTED(b"solve") */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"MatSolve_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":896 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatSolve_Python") * cdef solve = PyMat(mat).solve # <<<<<<<<<<<<<< * if solve is None: return UNSUPPORTED(b"solve") * solve(Mat_(mat), Vec_(b), Vec_(x)) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 896, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_solve); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 896, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_solve = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":897 * FunctionBegin(b"MatSolve_Python") * cdef solve = PyMat(mat).solve * if solve is None: return UNSUPPORTED(b"solve") # <<<<<<<<<<<<<< * solve(Mat_(mat), Vec_(b), Vec_(x)) * return FunctionEnd() */ __pyx_t_3 = (__pyx_v_solve == Py_None); if (__pyx_t_3) { __pyx_r = __pyx_f_8petsc4py_5PETSc_UNSUPPORTED(((char *)"solve")); goto __pyx_L0; } /* "petsc4py/PETSc/libpetsc4py.pyx":898 * cdef solve = PyMat(mat).solve * if solve is None: return UNSUPPORTED(b"solve") * solve(Mat_(mat), Vec_(b), Vec_(x)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 898, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_b)); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 898, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_x)); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 898, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_solve); __pyx_t_6 = __pyx_v_solve; __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_7, __pyx_t_1, __pyx_t_4, __pyx_t_5}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 3+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 898, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":899 * if solve is None: return UNSUPPORTED(b"solve") * solve(Mat_(mat), Vec_(b), Vec_(x)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatSolveTranspose_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":889 * return FunctionEnd() * * cdef PetscErrorCode MatSolve_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscVec b, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.MatSolve_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_solve); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":901 * return FunctionEnd() * * cdef PetscErrorCode MatSolveTranspose_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscVec b, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatSolveTranspose_Python(Mat __pyx_v_mat, Vec __pyx_v_b, Vec __pyx_v_x) { PyObject *__pyx_v_solveTranspose = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PetscErrorCode __pyx_t_4; int __pyx_t_5; int __pyx_t_6; char const *__pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatSolveTranspose_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":907 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatSolveTranspose_Python") # <<<<<<<<<<<<<< * cdef solveTranspose = PyMat(mat).solveTranspose * if solveTranspose is None: */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"MatSolveTranspose_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":908 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatSolveTranspose_Python") * cdef solveTranspose = PyMat(mat).solveTranspose # <<<<<<<<<<<<<< * if solveTranspose is None: * try: */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_solveTranspose); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_solveTranspose = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":909 * FunctionBegin(b"MatSolveTranspose_Python") * cdef solveTranspose = PyMat(mat).solveTranspose * if solveTranspose is None: # <<<<<<<<<<<<<< * try: * mat.ops.solvetranspose = NULL */ __pyx_t_3 = (__pyx_v_solveTranspose == Py_None); if (__pyx_t_3) { /* "petsc4py/PETSc/libpetsc4py.pyx":910 * cdef solveTranspose = PyMat(mat).solveTranspose * if solveTranspose is None: * try: # <<<<<<<<<<<<<< * mat.ops.solvetranspose = NULL * CHKERR( MatSolveTranspose(mat, b, x) ) */ /*try:*/ { /* "petsc4py/PETSc/libpetsc4py.pyx":911 * if solveTranspose is None: * try: * mat.ops.solvetranspose = NULL # <<<<<<<<<<<<<< * CHKERR( MatSolveTranspose(mat, b, x) ) * finally: */ __pyx_v_mat->ops->solvetranspose = NULL; /* "petsc4py/PETSc/libpetsc4py.pyx":912 * try: * mat.ops.solvetranspose = NULL * CHKERR( MatSolveTranspose(mat, b, x) ) # <<<<<<<<<<<<<< * finally: * mat.ops.solvetranspose = MatSolveTranspose_Python */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSolveTranspose(__pyx_v_mat, __pyx_v_b, __pyx_v_x)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 912, __pyx_L5_error) } /* "petsc4py/PETSc/libpetsc4py.pyx":914 * CHKERR( MatSolveTranspose(mat, b, x) ) * finally: * mat.ops.solvetranspose = MatSolveTranspose_Python # <<<<<<<<<<<<<< * solveTranspose(Mat_(mat), Vec_(b), Vec_(x)) * return FunctionEnd() */ /*finally:*/ { /*normal exit:*/{ __pyx_v_mat->ops->solvetranspose = __pyx_f_8petsc4py_5PETSc_MatSolveTranspose_Python; goto __pyx_L6; } __pyx_L5_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10) < 0)) __Pyx_ErrFetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); __pyx_t_5 = __pyx_lineno; __pyx_t_6 = __pyx_clineno; __pyx_t_7 = __pyx_filename; { __pyx_v_mat->ops->solvetranspose = __pyx_f_8petsc4py_5PETSc_MatSolveTranspose_Python; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); } __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ErrRestore(__pyx_t_8, __pyx_t_9, __pyx_t_10); __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_lineno = __pyx_t_5; __pyx_clineno = __pyx_t_6; __pyx_filename = __pyx_t_7; goto __pyx_L1_error; } __pyx_L6:; } /* "petsc4py/PETSc/libpetsc4py.pyx":909 * FunctionBegin(b"MatSolveTranspose_Python") * cdef solveTranspose = PyMat(mat).solveTranspose * if solveTranspose is None: # <<<<<<<<<<<<<< * try: * mat.ops.solvetranspose = NULL */ } /* "petsc4py/PETSc/libpetsc4py.pyx":915 * finally: * mat.ops.solvetranspose = MatSolveTranspose_Python * solveTranspose(Mat_(mat), Vec_(b), Vec_(x)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 915, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_14 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_b)); if (unlikely(!__pyx_t_14)) __PYX_ERR(11, 915, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_15 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_x)); if (unlikely(!__pyx_t_15)) __PYX_ERR(11, 915, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_INCREF(__pyx_v_solveTranspose); __pyx_t_16 = __pyx_v_solveTranspose; __pyx_t_17 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_16))) { __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_16); if (likely(__pyx_t_17)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16); __Pyx_INCREF(__pyx_t_17); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_16, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_17, __pyx_t_1, __pyx_t_14, __pyx_t_15}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_16, __pyx_callargs+1-__pyx_t_6, 3+__pyx_t_6); __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 915, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":916 * mat.ops.solvetranspose = MatSolveTranspose_Python * solveTranspose(Mat_(mat), Vec_(b), Vec_(x)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatSolveAdd_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":901 * return FunctionEnd() * * cdef PetscErrorCode MatSolveTranspose_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscVec b, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_14); __Pyx_XDECREF(__pyx_t_15); __Pyx_XDECREF(__pyx_t_16); __Pyx_XDECREF(__pyx_t_17); __Pyx_AddTraceback("petsc4py.PETSc.MatSolveTranspose_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_solveTranspose); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":918 * return FunctionEnd() * * cdef PetscErrorCode MatSolveAdd_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscVec b, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatSolveAdd_Python(Mat __pyx_v_mat, Vec __pyx_v_b, Vec __pyx_v_y, Vec __pyx_v_x) { PyObject *__pyx_v_solveAdd = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PetscErrorCode __pyx_t_4; int __pyx_t_5; int __pyx_t_6; char const *__pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatSolveAdd_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":925 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatSolveAdd_Python") # <<<<<<<<<<<<<< * cdef solveAdd = PyMat(mat).solveAdd * if solveAdd is None: */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"MatSolveAdd_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":926 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatSolveAdd_Python") * cdef solveAdd = PyMat(mat).solveAdd # <<<<<<<<<<<<<< * if solveAdd is None: * try: */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 926, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_solveAdd); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 926, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_solveAdd = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":927 * FunctionBegin(b"MatSolveAdd_Python") * cdef solveAdd = PyMat(mat).solveAdd * if solveAdd is None: # <<<<<<<<<<<<<< * try: * mat.ops.solveadd = NULL */ __pyx_t_3 = (__pyx_v_solveAdd == Py_None); if (__pyx_t_3) { /* "petsc4py/PETSc/libpetsc4py.pyx":928 * cdef solveAdd = PyMat(mat).solveAdd * if solveAdd is None: * try: # <<<<<<<<<<<<<< * mat.ops.solveadd = NULL * CHKERR( MatSolveAdd(mat, b, y, x) ) */ /*try:*/ { /* "petsc4py/PETSc/libpetsc4py.pyx":929 * if solveAdd is None: * try: * mat.ops.solveadd = NULL # <<<<<<<<<<<<<< * CHKERR( MatSolveAdd(mat, b, y, x) ) * finally: */ __pyx_v_mat->ops->solveadd = NULL; /* "petsc4py/PETSc/libpetsc4py.pyx":930 * try: * mat.ops.solveadd = NULL * CHKERR( MatSolveAdd(mat, b, y, x) ) # <<<<<<<<<<<<<< * finally: * mat.ops.solveadd = MatSolveAdd_Python */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSolveAdd(__pyx_v_mat, __pyx_v_b, __pyx_v_y, __pyx_v_x)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 930, __pyx_L5_error) } /* "petsc4py/PETSc/libpetsc4py.pyx":932 * CHKERR( MatSolveAdd(mat, b, y, x) ) * finally: * mat.ops.solveadd = MatSolveAdd_Python # <<<<<<<<<<<<<< * return FunctionEnd() * solveAdd(Mat_(mat), Vec_(b), Vec_(y), Vec_(x)) */ /*finally:*/ { /*normal exit:*/{ __pyx_v_mat->ops->solveadd = __pyx_f_8petsc4py_5PETSc_MatSolveAdd_Python; goto __pyx_L6; } __pyx_L5_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10) < 0)) __Pyx_ErrFetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); __pyx_t_5 = __pyx_lineno; __pyx_t_6 = __pyx_clineno; __pyx_t_7 = __pyx_filename; { __pyx_v_mat->ops->solveadd = __pyx_f_8petsc4py_5PETSc_MatSolveAdd_Python; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); } __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ErrRestore(__pyx_t_8, __pyx_t_9, __pyx_t_10); __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_lineno = __pyx_t_5; __pyx_clineno = __pyx_t_6; __pyx_filename = __pyx_t_7; goto __pyx_L1_error; } __pyx_L6:; } /* "petsc4py/PETSc/libpetsc4py.pyx":933 * finally: * mat.ops.solveadd = MatSolveAdd_Python * return FunctionEnd() # <<<<<<<<<<<<<< * solveAdd(Mat_(mat), Vec_(b), Vec_(y), Vec_(x)) * return FunctionEnd() */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":927 * FunctionBegin(b"MatSolveAdd_Python") * cdef solveAdd = PyMat(mat).solveAdd * if solveAdd is None: # <<<<<<<<<<<<<< * try: * mat.ops.solveadd = NULL */ } /* "petsc4py/PETSc/libpetsc4py.pyx":934 * mat.ops.solveadd = MatSolveAdd_Python * return FunctionEnd() * solveAdd(Mat_(mat), Vec_(b), Vec_(y), Vec_(x)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 934, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_14 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_b)); if (unlikely(!__pyx_t_14)) __PYX_ERR(11, 934, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_15 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_y)); if (unlikely(!__pyx_t_15)) __PYX_ERR(11, 934, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_16 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_x)); if (unlikely(!__pyx_t_16)) __PYX_ERR(11, 934, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_INCREF(__pyx_v_solveAdd); __pyx_t_17 = __pyx_v_solveAdd; __pyx_t_18 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_17))) { __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_17); if (likely(__pyx_t_18)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17); __Pyx_INCREF(__pyx_t_18); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_17, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_18, __pyx_t_1, __pyx_t_14, __pyx_t_15, __pyx_t_16}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_17, __pyx_callargs+1-__pyx_t_6, 4+__pyx_t_6); __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 934, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":935 * return FunctionEnd() * solveAdd(Mat_(mat), Vec_(b), Vec_(y), Vec_(x)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatSolveTransposeAdd_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":918 * return FunctionEnd() * * cdef PetscErrorCode MatSolveAdd_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscVec b, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_14); __Pyx_XDECREF(__pyx_t_15); __Pyx_XDECREF(__pyx_t_16); __Pyx_XDECREF(__pyx_t_17); __Pyx_XDECREF(__pyx_t_18); __Pyx_AddTraceback("petsc4py.PETSc.MatSolveAdd_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_solveAdd); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":937 * return FunctionEnd() * * cdef PetscErrorCode MatSolveTransposeAdd_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscVec b, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatSolveTransposeAdd_Python(Mat __pyx_v_mat, Vec __pyx_v_b, Vec __pyx_v_y, Vec __pyx_v_x) { PyObject *__pyx_v_solveTransposeAdd = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PetscErrorCode __pyx_t_4; int __pyx_t_5; int __pyx_t_6; char const *__pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatSolveTransposeAdd_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":944 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatSolveTransposeAdd_Python") # <<<<<<<<<<<<<< * cdef solveTransposeAdd = PyMat(mat).solveTransposeAdd * if solveTransposeAdd is None: */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"MatSolveTransposeAdd_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":945 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatSolveTransposeAdd_Python") * cdef solveTransposeAdd = PyMat(mat).solveTransposeAdd # <<<<<<<<<<<<<< * if solveTransposeAdd is None: * try: */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 945, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_solveTransposeAdd); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 945, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_solveTransposeAdd = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":946 * FunctionBegin(b"MatSolveTransposeAdd_Python") * cdef solveTransposeAdd = PyMat(mat).solveTransposeAdd * if solveTransposeAdd is None: # <<<<<<<<<<<<<< * try: * mat.ops.solvetransposeadd = NULL */ __pyx_t_3 = (__pyx_v_solveTransposeAdd == Py_None); if (__pyx_t_3) { /* "petsc4py/PETSc/libpetsc4py.pyx":947 * cdef solveTransposeAdd = PyMat(mat).solveTransposeAdd * if solveTransposeAdd is None: * try: # <<<<<<<<<<<<<< * mat.ops.solvetransposeadd = NULL * CHKERR( MatSolveTransposeAdd(mat, b, y, x) ) */ /*try:*/ { /* "petsc4py/PETSc/libpetsc4py.pyx":948 * if solveTransposeAdd is None: * try: * mat.ops.solvetransposeadd = NULL # <<<<<<<<<<<<<< * CHKERR( MatSolveTransposeAdd(mat, b, y, x) ) * finally: */ __pyx_v_mat->ops->solvetransposeadd = NULL; /* "petsc4py/PETSc/libpetsc4py.pyx":949 * try: * mat.ops.solvetransposeadd = NULL * CHKERR( MatSolveTransposeAdd(mat, b, y, x) ) # <<<<<<<<<<<<<< * finally: * mat.ops.solvetransposeadd = MatSolveTransposeAdd_Python */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSolveTransposeAdd(__pyx_v_mat, __pyx_v_b, __pyx_v_y, __pyx_v_x)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 949, __pyx_L5_error) } /* "petsc4py/PETSc/libpetsc4py.pyx":951 * CHKERR( MatSolveTransposeAdd(mat, b, y, x) ) * finally: * mat.ops.solvetransposeadd = MatSolveTransposeAdd_Python # <<<<<<<<<<<<<< * return FunctionEnd() * solveTransposeAdd(Mat_(mat), Vec_(b), Vec_(y), Vec_(x)) */ /*finally:*/ { /*normal exit:*/{ __pyx_v_mat->ops->solvetransposeadd = __pyx_f_8petsc4py_5PETSc_MatSolveTransposeAdd_Python; goto __pyx_L6; } __pyx_L5_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10) < 0)) __Pyx_ErrFetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); __pyx_t_5 = __pyx_lineno; __pyx_t_6 = __pyx_clineno; __pyx_t_7 = __pyx_filename; { __pyx_v_mat->ops->solvetransposeadd = __pyx_f_8petsc4py_5PETSc_MatSolveTransposeAdd_Python; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); } __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ErrRestore(__pyx_t_8, __pyx_t_9, __pyx_t_10); __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_lineno = __pyx_t_5; __pyx_clineno = __pyx_t_6; __pyx_filename = __pyx_t_7; goto __pyx_L1_error; } __pyx_L6:; } /* "petsc4py/PETSc/libpetsc4py.pyx":952 * finally: * mat.ops.solvetransposeadd = MatSolveTransposeAdd_Python * return FunctionEnd() # <<<<<<<<<<<<<< * solveTransposeAdd(Mat_(mat), Vec_(b), Vec_(y), Vec_(x)) * return FunctionEnd() */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":946 * FunctionBegin(b"MatSolveTransposeAdd_Python") * cdef solveTransposeAdd = PyMat(mat).solveTransposeAdd * if solveTransposeAdd is None: # <<<<<<<<<<<<<< * try: * mat.ops.solvetransposeadd = NULL */ } /* "petsc4py/PETSc/libpetsc4py.pyx":953 * mat.ops.solvetransposeadd = MatSolveTransposeAdd_Python * return FunctionEnd() * solveTransposeAdd(Mat_(mat), Vec_(b), Vec_(y), Vec_(x)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 953, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_14 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_b)); if (unlikely(!__pyx_t_14)) __PYX_ERR(11, 953, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_15 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_y)); if (unlikely(!__pyx_t_15)) __PYX_ERR(11, 953, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_16 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_x)); if (unlikely(!__pyx_t_16)) __PYX_ERR(11, 953, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_INCREF(__pyx_v_solveTransposeAdd); __pyx_t_17 = __pyx_v_solveTransposeAdd; __pyx_t_18 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_17))) { __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_17); if (likely(__pyx_t_18)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17); __Pyx_INCREF(__pyx_t_18); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_17, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_18, __pyx_t_1, __pyx_t_14, __pyx_t_15, __pyx_t_16}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_17, __pyx_callargs+1-__pyx_t_6, 4+__pyx_t_6); __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 953, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":954 * return FunctionEnd() * solveTransposeAdd(Mat_(mat), Vec_(b), Vec_(y), Vec_(x)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatSOR_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":937 * return FunctionEnd() * * cdef PetscErrorCode MatSolveTransposeAdd_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscVec b, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_14); __Pyx_XDECREF(__pyx_t_15); __Pyx_XDECREF(__pyx_t_16); __Pyx_XDECREF(__pyx_t_17); __Pyx_XDECREF(__pyx_t_18); __Pyx_AddTraceback("petsc4py.PETSc.MatSolveTransposeAdd_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_solveTransposeAdd); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":956 * return FunctionEnd() * * cdef PetscErrorCode MatSOR_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscVec b, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatSOR_Python(Mat __pyx_v_mat, Vec __pyx_v_b, PetscReal __pyx_v_omega, MatSORType __pyx_v_sortype, PetscReal __pyx_v_shift, PetscInt __pyx_v_its, PetscInt __pyx_v_lits, Vec __pyx_v_x) { PyObject *__pyx_v_SOR = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PetscReal __pyx_t_6; PyObject *__pyx_t_7 = NULL; PetscInt __pyx_t_8; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; int __pyx_t_15; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatSOR_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":967 * )\ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatSOR_Python") # <<<<<<<<<<<<<< * cdef SOR = PyMat(mat).SOR * if SOR is None: return UNSUPPORTED(b"SOR") */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"MatSOR_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":968 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatSOR_Python") * cdef SOR = PyMat(mat).SOR # <<<<<<<<<<<<<< * if SOR is None: return UNSUPPORTED(b"SOR") * SOR(Mat_(mat), Vec_(b), asReal(omega), asInt(sortype), asReal(shift), asInt(its), asInt(lits), Vec_(x)) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 968, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_SOR); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 968, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_SOR = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":969 * FunctionBegin(b"MatSOR_Python") * cdef SOR = PyMat(mat).SOR * if SOR is None: return UNSUPPORTED(b"SOR") # <<<<<<<<<<<<<< * SOR(Mat_(mat), Vec_(b), asReal(omega), asInt(sortype), asReal(shift), asInt(its), asInt(lits), Vec_(x)) * return FunctionEnd() */ __pyx_t_3 = (__pyx_v_SOR == Py_None); if (__pyx_t_3) { __pyx_r = __pyx_f_8petsc4py_5PETSc_UNSUPPORTED(((char *)"SOR")); goto __pyx_L0; } /* "petsc4py/PETSc/libpetsc4py.pyx":970 * cdef SOR = PyMat(mat).SOR * if SOR is None: return UNSUPPORTED(b"SOR") * SOR(Mat_(mat), Vec_(b), asReal(omega), asInt(sortype), asReal(shift), asInt(its), asInt(lits), Vec_(x)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 970, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_b)); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 970, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyFloat_FromDouble(__pyx_v_omega); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 970, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_t_5); if (unlikely(__pyx_t_6 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(11, 970, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyFloat_FromDouble(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 970, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = __Pyx_PyInt_From_MatSORType(__pyx_v_sortype); if (unlikely(!__pyx_t_7)) __PYX_ERR(11, 970, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_t_7); if (unlikely(__pyx_t_8 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(11, 970, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyInt_From_PetscInt(__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(11, 970, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_9 = PyFloat_FromDouble(__pyx_v_shift); if (unlikely(!__pyx_t_9)) __PYX_ERR(11, 970, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_t_9); if (unlikely(__pyx_t_6 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(11, 970, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = PyFloat_FromDouble(__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(11, 970, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyInt_From_PetscInt(__pyx_v_its); if (unlikely(!__pyx_t_10)) __PYX_ERR(11, 970, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_t_10); if (unlikely(__pyx_t_8 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(11, 970, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = __Pyx_PyInt_From_PetscInt(__pyx_t_8); if (unlikely(!__pyx_t_10)) __PYX_ERR(11, 970, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = __Pyx_PyInt_From_PetscInt(__pyx_v_lits); if (unlikely(!__pyx_t_11)) __PYX_ERR(11, 970, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_t_11); if (unlikely(__pyx_t_8 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(11, 970, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = __Pyx_PyInt_From_PetscInt(__pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(11, 970, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_12 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_x)); if (unlikely(!__pyx_t_12)) __PYX_ERR(11, 970, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_INCREF(__pyx_v_SOR); __pyx_t_13 = __pyx_v_SOR; __pyx_t_14 = NULL; __pyx_t_15 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_13))) { __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13); if (likely(__pyx_t_14)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_13, function); __pyx_t_15 = 1; } } #endif { PyObject *__pyx_callargs[9] = {__pyx_t_14, __pyx_t_1, __pyx_t_4, __pyx_t_5, __pyx_t_7, __pyx_t_9, __pyx_t_10, __pyx_t_11, __pyx_t_12}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+1-__pyx_t_15, 8+__pyx_t_15); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 970, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":971 * if SOR is None: return UNSUPPORTED(b"SOR") * SOR(Mat_(mat), Vec_(b), asReal(omega), asInt(sortype), asReal(shift), asInt(its), asInt(lits), Vec_(x)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatGetDiagonal_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":956 * return FunctionEnd() * * cdef PetscErrorCode MatSOR_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscVec b, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_XDECREF(__pyx_t_14); __Pyx_AddTraceback("petsc4py.PETSc.MatSOR_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_SOR); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":973 * return FunctionEnd() * * cdef PetscErrorCode MatGetDiagonal_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscVec v, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatGetDiagonal_Python(Mat __pyx_v_mat, Vec __pyx_v_v) { PyObject *__pyx_v_getDiagonal = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatGetDiagonal_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":978 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatGetDiagonal_Python") # <<<<<<<<<<<<<< * cdef getDiagonal = PyMat(mat).getDiagonal * if getDiagonal is None: return UNSUPPORTED(b"getDiagonal") */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"MatGetDiagonal_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":979 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatGetDiagonal_Python") * cdef getDiagonal = PyMat(mat).getDiagonal # <<<<<<<<<<<<<< * if getDiagonal is None: return UNSUPPORTED(b"getDiagonal") * getDiagonal(Mat_(mat), Vec_(v)) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 979, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_getDiagonal); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 979, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_getDiagonal = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":980 * FunctionBegin(b"MatGetDiagonal_Python") * cdef getDiagonal = PyMat(mat).getDiagonal * if getDiagonal is None: return UNSUPPORTED(b"getDiagonal") # <<<<<<<<<<<<<< * getDiagonal(Mat_(mat), Vec_(v)) * return FunctionEnd() */ __pyx_t_3 = (__pyx_v_getDiagonal == Py_None); if (__pyx_t_3) { __pyx_r = __pyx_f_8petsc4py_5PETSc_UNSUPPORTED(((char *)"getDiagonal")); goto __pyx_L0; } /* "petsc4py/PETSc/libpetsc4py.pyx":981 * cdef getDiagonal = PyMat(mat).getDiagonal * if getDiagonal is None: return UNSUPPORTED(b"getDiagonal") * getDiagonal(Mat_(mat), Vec_(v)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 981, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_v)); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 981, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_getDiagonal); __pyx_t_5 = __pyx_v_getDiagonal; __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_1, __pyx_t_4}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 981, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":982 * if getDiagonal is None: return UNSUPPORTED(b"getDiagonal") * getDiagonal(Mat_(mat), Vec_(v)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatSetDiagonal_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":973 * return FunctionEnd() * * cdef PetscErrorCode MatGetDiagonal_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscVec v, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.MatGetDiagonal_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_getDiagonal); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":984 * return FunctionEnd() * * cdef PetscErrorCode MatSetDiagonal_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscVec v, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatSetDiagonal_Python(Mat __pyx_v_mat, Vec __pyx_v_v, InsertMode __pyx_v_im) { PyObject *__pyx_v_setDiagonal = 0; int __pyx_v_addv; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatSetDiagonal_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":990 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatSetDiagonal_Python") # <<<<<<<<<<<<<< * cdef setDiagonal = PyMat(mat).setDiagonal * cdef bint addv = True if im == PETSC_ADD_VALUES else False */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"MatSetDiagonal_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":991 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatSetDiagonal_Python") * cdef setDiagonal = PyMat(mat).setDiagonal # <<<<<<<<<<<<<< * cdef bint addv = True if im == PETSC_ADD_VALUES else False * if setDiagonal is None: return UNSUPPORTED(b"setDiagonal") */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 991, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_setDiagonal); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 991, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_setDiagonal = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":992 * FunctionBegin(b"MatSetDiagonal_Python") * cdef setDiagonal = PyMat(mat).setDiagonal * cdef bint addv = True if im == PETSC_ADD_VALUES else False # <<<<<<<<<<<<<< * if setDiagonal is None: return UNSUPPORTED(b"setDiagonal") * setDiagonal(Mat_(mat), Vec_(v), addv) */ __pyx_t_4 = (__pyx_v_im == ADD_VALUES); if (__pyx_t_4) { __pyx_t_3 = 1; } else { __pyx_t_3 = 0; } __pyx_v_addv = __pyx_t_3; /* "petsc4py/PETSc/libpetsc4py.pyx":993 * cdef setDiagonal = PyMat(mat).setDiagonal * cdef bint addv = True if im == PETSC_ADD_VALUES else False * if setDiagonal is None: return UNSUPPORTED(b"setDiagonal") # <<<<<<<<<<<<<< * setDiagonal(Mat_(mat), Vec_(v), addv) * return FunctionEnd() */ __pyx_t_3 = (__pyx_v_setDiagonal == Py_None); if (__pyx_t_3) { __pyx_r = __pyx_f_8petsc4py_5PETSc_UNSUPPORTED(((char *)"setDiagonal")); goto __pyx_L0; } /* "petsc4py/PETSc/libpetsc4py.pyx":994 * cdef bint addv = True if im == PETSC_ADD_VALUES else False * if setDiagonal is None: return UNSUPPORTED(b"setDiagonal") * setDiagonal(Mat_(mat), Vec_(v), addv) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 994, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_v)); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 994, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_addv); if (unlikely(!__pyx_t_6)) __PYX_ERR(11, 994, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_setDiagonal); __pyx_t_7 = __pyx_v_setDiagonal; __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_8, __pyx_t_1, __pyx_t_5, __pyx_t_6}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 3+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 994, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":995 * if setDiagonal is None: return UNSUPPORTED(b"setDiagonal") * setDiagonal(Mat_(mat), Vec_(v), addv) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatDiagonalScale_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":984 * return FunctionEnd() * * cdef PetscErrorCode MatSetDiagonal_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscVec v, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("petsc4py.PETSc.MatSetDiagonal_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_setDiagonal); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":997 * return FunctionEnd() * * cdef PetscErrorCode MatDiagonalScale_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscVec l, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatDiagonalScale_Python(Mat __pyx_v_mat, Vec __pyx_v_l, Vec __pyx_v_r) { PyObject *__pyx_v_diagonalScale = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatDiagonalScale_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":1003 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatDiagonalScale_Python") # <<<<<<<<<<<<<< * cdef diagonalScale = PyMat(mat).diagonalScale * if diagonalScale is None: return UNSUPPORTED(b"diagonalScale") */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"MatDiagonalScale_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":1004 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatDiagonalScale_Python") * cdef diagonalScale = PyMat(mat).diagonalScale # <<<<<<<<<<<<<< * if diagonalScale is None: return UNSUPPORTED(b"diagonalScale") * diagonalScale(Mat_(mat), Vec_(l), Vec_(r)) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1004, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_diagonalScale); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1004, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_diagonalScale = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1005 * FunctionBegin(b"MatDiagonalScale_Python") * cdef diagonalScale = PyMat(mat).diagonalScale * if diagonalScale is None: return UNSUPPORTED(b"diagonalScale") # <<<<<<<<<<<<<< * diagonalScale(Mat_(mat), Vec_(l), Vec_(r)) * return FunctionEnd() */ __pyx_t_3 = (__pyx_v_diagonalScale == Py_None); if (__pyx_t_3) { __pyx_r = __pyx_f_8petsc4py_5PETSc_UNSUPPORTED(((char *)"diagonalScale")); goto __pyx_L0; } /* "petsc4py/PETSc/libpetsc4py.pyx":1006 * cdef diagonalScale = PyMat(mat).diagonalScale * if diagonalScale is None: return UNSUPPORTED(b"diagonalScale") * diagonalScale(Mat_(mat), Vec_(l), Vec_(r)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1006, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_l)); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 1006, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_r)); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 1006, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_diagonalScale); __pyx_t_6 = __pyx_v_diagonalScale; __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_7, __pyx_t_1, __pyx_t_4, __pyx_t_5}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 3+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1006, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1007 * if diagonalScale is None: return UNSUPPORTED(b"diagonalScale") * diagonalScale(Mat_(mat), Vec_(l), Vec_(r)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatMissingDiagonal_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":997 * return FunctionEnd() * * cdef PetscErrorCode MatDiagonalScale_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscVec l, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.MatDiagonalScale_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_diagonalScale); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":1009 * return FunctionEnd() * * cdef PetscErrorCode MatMissingDiagonal_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscBool *missing, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatMissingDiagonal_Python(Mat __pyx_v_mat, PetscBool *__pyx_v_missing, PetscInt *__pyx_v_loc) { PyObject *__pyx_v_missingDiagonal = 0; PyObject *__pyx_v_pymissing = NULL; PyObject *__pyx_v_pyloc = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; PyObject *(*__pyx_t_7)(PyObject *); PetscBool __pyx_t_8; PetscInt __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatMissingDiagonal_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":1015 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatMissingDiagonal_Python") # <<<<<<<<<<<<<< * cdef missingDiagonal = PyMat(mat).missingDiagonal * if missingDiagonal is None: return UNSUPPORTED(b"missingDiagonal") */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"MatMissingDiagonal_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":1016 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatMissingDiagonal_Python") * cdef missingDiagonal = PyMat(mat).missingDiagonal # <<<<<<<<<<<<<< * if missingDiagonal is None: return UNSUPPORTED(b"missingDiagonal") * pymissing, pyloc = missingDiagonal(Mat_(mat)) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1016, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_missingDiagonal); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1016, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_missingDiagonal = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1017 * FunctionBegin(b"MatMissingDiagonal_Python") * cdef missingDiagonal = PyMat(mat).missingDiagonal * if missingDiagonal is None: return UNSUPPORTED(b"missingDiagonal") # <<<<<<<<<<<<<< * pymissing, pyloc = missingDiagonal(Mat_(mat)) * missing[0] = pymissing */ __pyx_t_3 = (__pyx_v_missingDiagonal == Py_None); if (__pyx_t_3) { __pyx_r = __pyx_f_8petsc4py_5PETSc_UNSUPPORTED(((char *)"missingDiagonal")); goto __pyx_L0; } /* "petsc4py/PETSc/libpetsc4py.pyx":1018 * cdef missingDiagonal = PyMat(mat).missingDiagonal * if missingDiagonal is None: return UNSUPPORTED(b"missingDiagonal") * pymissing, pyloc = missingDiagonal(Mat_(mat)) # <<<<<<<<<<<<<< * missing[0] = pymissing * if loc: */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1018, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_missingDiagonal); __pyx_t_4 = __pyx_v_missingDiagonal; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_1}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1018, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { PyObject* sequence = __pyx_t_2; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(11, 1018, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_4 = PyList_GET_ITEM(sequence, 0); __pyx_t_1 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_1); #else __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 1018, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1018, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 1018, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); index = 0; __pyx_t_4 = __pyx_t_7(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 1; __pyx_t_1 = __pyx_t_7(__pyx_t_5); if (unlikely(!__pyx_t_1)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_5), 2) < 0) __PYX_ERR(11, 1018, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L5_unpacking_done; __pyx_L4_unpacking_failed:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(11, 1018, __pyx_L1_error) __pyx_L5_unpacking_done:; } __pyx_v_pymissing = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_pyloc = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1019 * if missingDiagonal is None: return UNSUPPORTED(b"missingDiagonal") * pymissing, pyloc = missingDiagonal(Mat_(mat)) * missing[0] = pymissing # <<<<<<<<<<<<<< * if loc: * loc[0] = asInt(pyloc) */ __pyx_t_8 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_pymissing)); if (unlikely(PyErr_Occurred())) __PYX_ERR(11, 1019, __pyx_L1_error) (__pyx_v_missing[0]) = ((PetscBool)__pyx_t_8); /* "petsc4py/PETSc/libpetsc4py.pyx":1020 * pymissing, pyloc = missingDiagonal(Mat_(mat)) * missing[0] = pymissing * if loc: # <<<<<<<<<<<<<< * loc[0] = asInt(pyloc) * return FunctionEnd() */ __pyx_t_3 = (__pyx_v_loc != 0); if (__pyx_t_3) { /* "petsc4py/PETSc/libpetsc4py.pyx":1021 * missing[0] = pymissing * if loc: * loc[0] = asInt(pyloc) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_pyloc); if (unlikely(__pyx_t_9 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(11, 1021, __pyx_L1_error) (__pyx_v_loc[0]) = __pyx_t_9; /* "petsc4py/PETSc/libpetsc4py.pyx":1020 * pymissing, pyloc = missingDiagonal(Mat_(mat)) * missing[0] = pymissing * if loc: # <<<<<<<<<<<<<< * loc[0] = asInt(pyloc) * return FunctionEnd() */ } /* "petsc4py/PETSc/libpetsc4py.pyx":1022 * if loc: * loc[0] = asInt(pyloc) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatNorm_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":1009 * return FunctionEnd() * * cdef PetscErrorCode MatMissingDiagonal_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscBool *missing, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.MatMissingDiagonal_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_missingDiagonal); __Pyx_XDECREF(__pyx_v_pymissing); __Pyx_XDECREF(__pyx_v_pyloc); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":1024 * return FunctionEnd() * * cdef PetscErrorCode MatNorm_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscNormType ntype, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatNorm_Python(Mat __pyx_v_mat, NormType __pyx_v_ntype, PetscReal *__pyx_v_nrm) { PyObject *__pyx_v_norm = 0; PyObject *__pyx_v_retval = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; PetscReal __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatNorm_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":1030 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatNorm_Python") # <<<<<<<<<<<<<< * cdef norm = PyMat(mat).norm * if norm is None: return UNSUPPORTED(b"norm") */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"MatNorm_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":1031 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatNorm_Python") * cdef norm = PyMat(mat).norm # <<<<<<<<<<<<<< * if norm is None: return UNSUPPORTED(b"norm") * retval = norm(Mat_(mat), ntype) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1031, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_norm); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1031, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_norm = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1032 * FunctionBegin(b"MatNorm_Python") * cdef norm = PyMat(mat).norm * if norm is None: return UNSUPPORTED(b"norm") # <<<<<<<<<<<<<< * retval = norm(Mat_(mat), ntype) * nrm[0] = retval */ __pyx_t_3 = (__pyx_v_norm == Py_None); if (__pyx_t_3) { __pyx_r = __pyx_f_8petsc4py_5PETSc_UNSUPPORTED(((char *)"norm")); goto __pyx_L0; } /* "petsc4py/PETSc/libpetsc4py.pyx":1033 * cdef norm = PyMat(mat).norm * if norm is None: return UNSUPPORTED(b"norm") * retval = norm(Mat_(mat), ntype) # <<<<<<<<<<<<<< * nrm[0] = retval * return FunctionEnd() */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1033, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyInt_From_NormType(__pyx_v_ntype); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 1033, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_norm); __pyx_t_5 = __pyx_v_norm; __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_1, __pyx_t_4}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1033, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_v_retval = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1034 * if norm is None: return UNSUPPORTED(b"norm") * retval = norm(Mat_(mat), ntype) * nrm[0] = retval # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_v_retval); if (unlikely((__pyx_t_8 == ((PetscReal)-1)) && PyErr_Occurred())) __PYX_ERR(11, 1034, __pyx_L1_error) (__pyx_v_nrm[0]) = ((PetscReal)__pyx_t_8); /* "petsc4py/PETSc/libpetsc4py.pyx":1035 * retval = norm(Mat_(mat), ntype) * nrm[0] = retval * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatRealPart_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":1024 * return FunctionEnd() * * cdef PetscErrorCode MatNorm_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscNormType ntype, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.MatNorm_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_norm); __Pyx_XDECREF(__pyx_v_retval); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":1037 * return FunctionEnd() * * cdef PetscErrorCode MatRealPart_Python( # <<<<<<<<<<<<<< * PetscMat mat, * ) \ */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatRealPart_Python(Mat __pyx_v_mat) { PyObject *__pyx_v_realPart = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatRealPart_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":1041 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatRealPart_Python") # <<<<<<<<<<<<<< * cdef realPart = PyMat(mat).realPart * if realPart is None: return UNSUPPORTED(b"realPart") */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"MatRealPart_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":1042 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatRealPart_Python") * cdef realPart = PyMat(mat).realPart # <<<<<<<<<<<<<< * if realPart is None: return UNSUPPORTED(b"realPart") * realPart(Mat_(mat)) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1042, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_realPart); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1042, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_realPart = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1043 * FunctionBegin(b"MatRealPart_Python") * cdef realPart = PyMat(mat).realPart * if realPart is None: return UNSUPPORTED(b"realPart") # <<<<<<<<<<<<<< * realPart(Mat_(mat)) * return FunctionEnd() */ __pyx_t_3 = (__pyx_v_realPart == Py_None); if (__pyx_t_3) { __pyx_r = __pyx_f_8petsc4py_5PETSc_UNSUPPORTED(((char *)"realPart")); goto __pyx_L0; } /* "petsc4py/PETSc/libpetsc4py.pyx":1044 * cdef realPart = PyMat(mat).realPart * if realPart is None: return UNSUPPORTED(b"realPart") * realPart(Mat_(mat)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1044, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_realPart); __pyx_t_4 = __pyx_v_realPart; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_1}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1044, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1045 * if realPart is None: return UNSUPPORTED(b"realPart") * realPart(Mat_(mat)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatImagPart_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":1037 * return FunctionEnd() * * cdef PetscErrorCode MatRealPart_Python( # <<<<<<<<<<<<<< * PetscMat mat, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.MatRealPart_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_realPart); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":1047 * return FunctionEnd() * * cdef PetscErrorCode MatImagPart_Python( # <<<<<<<<<<<<<< * PetscMat mat, * ) \ */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatImagPart_Python(Mat __pyx_v_mat) { PyObject *__pyx_v_imagPart = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatImagPart_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":1051 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatImagPart_Python") # <<<<<<<<<<<<<< * cdef imagPart = PyMat(mat).imagPart * if imagPart is None: return UNSUPPORTED(b"imagPart") */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"MatImagPart_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":1052 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatImagPart_Python") * cdef imagPart = PyMat(mat).imagPart # <<<<<<<<<<<<<< * if imagPart is None: return UNSUPPORTED(b"imagPart") * imagPart(Mat_(mat)) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1052, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_imagPart); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1052, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_imagPart = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1053 * FunctionBegin(b"MatImagPart_Python") * cdef imagPart = PyMat(mat).imagPart * if imagPart is None: return UNSUPPORTED(b"imagPart") # <<<<<<<<<<<<<< * imagPart(Mat_(mat)) * return FunctionEnd() */ __pyx_t_3 = (__pyx_v_imagPart == Py_None); if (__pyx_t_3) { __pyx_r = __pyx_f_8petsc4py_5PETSc_UNSUPPORTED(((char *)"imagPart")); goto __pyx_L0; } /* "petsc4py/PETSc/libpetsc4py.pyx":1054 * cdef imagPart = PyMat(mat).imagPart * if imagPart is None: return UNSUPPORTED(b"imagPart") * imagPart(Mat_(mat)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1054, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_imagPart); __pyx_t_4 = __pyx_v_imagPart; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_1}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1054, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1055 * if imagPart is None: return UNSUPPORTED(b"imagPart") * imagPart(Mat_(mat)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatConjugate_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":1047 * return FunctionEnd() * * cdef PetscErrorCode MatImagPart_Python( # <<<<<<<<<<<<<< * PetscMat mat, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.MatImagPart_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_imagPart); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":1057 * return FunctionEnd() * * cdef PetscErrorCode MatConjugate_Python( # <<<<<<<<<<<<<< * PetscMat mat, * ) \ */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatConjugate_Python(Mat __pyx_v_mat) { PyObject *__pyx_v_conjugate = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatConjugate_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":1061 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatConjugate_Python") # <<<<<<<<<<<<<< * cdef conjugate = PyMat(mat).conjugate * if conjugate is None: return UNSUPPORTED(b"conjugate") */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"MatConjugate_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":1062 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatConjugate_Python") * cdef conjugate = PyMat(mat).conjugate # <<<<<<<<<<<<<< * if conjugate is None: return UNSUPPORTED(b"conjugate") * conjugate(Mat_(mat)) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1062, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_conjugate); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1062, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_conjugate = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1063 * FunctionBegin(b"MatConjugate_Python") * cdef conjugate = PyMat(mat).conjugate * if conjugate is None: return UNSUPPORTED(b"conjugate") # <<<<<<<<<<<<<< * conjugate(Mat_(mat)) * return FunctionEnd() */ __pyx_t_3 = (__pyx_v_conjugate == Py_None); if (__pyx_t_3) { __pyx_r = __pyx_f_8petsc4py_5PETSc_UNSUPPORTED(((char *)"conjugate")); goto __pyx_L0; } /* "petsc4py/PETSc/libpetsc4py.pyx":1064 * cdef conjugate = PyMat(mat).conjugate * if conjugate is None: return UNSUPPORTED(b"conjugate") * conjugate(Mat_(mat)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1064, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_conjugate); __pyx_t_4 = __pyx_v_conjugate; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_1}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1064, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1065 * if conjugate is None: return UNSUPPORTED(b"conjugate") * conjugate(Mat_(mat)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatHasOperation_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":1057 * return FunctionEnd() * * cdef PetscErrorCode MatConjugate_Python( # <<<<<<<<<<<<<< * PetscMat mat, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.MatConjugate_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_conjugate); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":1067 * return FunctionEnd() * * cdef PetscErrorCode MatHasOperation_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscMatOperation op, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatHasOperation_Python(Mat __pyx_v_mat, MatOperation __pyx_v_op, PetscBool *__pyx_v_flag) { long __pyx_v_i; PyObject *__pyx_v_name = NULL; void **__pyx_v_ops; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; PetscBool __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatHasOperation_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":1073 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatHasOperation_Python") # <<<<<<<<<<<<<< * flag[0] = PETSC_FALSE * cdef long i = op */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"MatHasOperation_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":1074 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatHasOperation_Python") * flag[0] = PETSC_FALSE # <<<<<<<<<<<<<< * cdef long i = op * global dMatOps */ (__pyx_v_flag[0]) = PETSC_FALSE; /* "petsc4py/PETSc/libpetsc4py.pyx":1075 * FunctionBegin(b"MatHasOperation_Python") * flag[0] = PETSC_FALSE * cdef long i = op # <<<<<<<<<<<<<< * global dMatOps * name = dMatOps.get(i, None) */ __pyx_v_i = ((long)__pyx_v_op); /* "petsc4py/PETSc/libpetsc4py.pyx":1077 * cdef long i = op * global dMatOps * name = dMatOps.get(i, None) # <<<<<<<<<<<<<< * cdef void** ops = NULL * if name is None: */ if (unlikely(__pyx_v_8petsc4py_5PETSc_dMatOps == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(11, 1077, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1077, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyDict_GetItemDefault(__pyx_v_8petsc4py_5PETSc_dMatOps, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1077, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_name = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1078 * global dMatOps * name = dMatOps.get(i, None) * cdef void** ops = NULL # <<<<<<<<<<<<<< * if name is None: * ops = mat.ops */ __pyx_v_ops = NULL; /* "petsc4py/PETSc/libpetsc4py.pyx":1079 * name = dMatOps.get(i, None) * cdef void** ops = NULL * if name is None: # <<<<<<<<<<<<<< * ops = mat.ops * if ops and ops[i]: flag[0] = PETSC_TRUE */ __pyx_t_3 = (__pyx_v_name == Py_None); if (__pyx_t_3) { /* "petsc4py/PETSc/libpetsc4py.pyx":1080 * cdef void** ops = NULL * if name is None: * ops = mat.ops # <<<<<<<<<<<<<< * if ops and ops[i]: flag[0] = PETSC_TRUE * else: */ __pyx_v_ops = ((void **)__pyx_v_mat->ops); /* "petsc4py/PETSc/libpetsc4py.pyx":1081 * if name is None: * ops = mat.ops * if ops and ops[i]: flag[0] = PETSC_TRUE # <<<<<<<<<<<<<< * else: * flag[0] = PETSC_TRUE if getattr(PyMat(mat), name) is not None else PETSC_FALSE */ __pyx_t_4 = (__pyx_v_ops != 0); if (__pyx_t_4) { } else { __pyx_t_3 = __pyx_t_4; goto __pyx_L5_bool_binop_done; } __pyx_t_4 = ((__pyx_v_ops[__pyx_v_i]) != 0); __pyx_t_3 = __pyx_t_4; __pyx_L5_bool_binop_done:; if (__pyx_t_3) { (__pyx_v_flag[0]) = PETSC_TRUE; } /* "petsc4py/PETSc/libpetsc4py.pyx":1079 * name = dMatOps.get(i, None) * cdef void** ops = NULL * if name is None: # <<<<<<<<<<<<<< * ops = mat.ops * if ops and ops[i]: flag[0] = PETSC_TRUE */ goto __pyx_L3; } /* "petsc4py/PETSc/libpetsc4py.pyx":1083 * if ops and ops[i]: flag[0] = PETSC_TRUE * else: * flag[0] = PETSC_TRUE if getattr(PyMat(mat), name) is not None else PETSC_FALSE # <<<<<<<<<<<<<< * return FunctionEnd() * */ /*else*/ { __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1083, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_GetAttr(__pyx_t_2, __pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1083, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = (__pyx_t_1 != Py_None); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { __pyx_t_5 = PETSC_TRUE; } else { __pyx_t_5 = PETSC_FALSE; } (__pyx_v_flag[0]) = __pyx_t_5; } __pyx_L3:; /* "petsc4py/PETSc/libpetsc4py.pyx":1084 * else: * flag[0] = PETSC_TRUE if getattr(PyMat(mat), name) is not None else PETSC_FALSE * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatProductNumeric_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":1067 * return FunctionEnd() * * cdef PetscErrorCode MatHasOperation_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscMatOperation op, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.MatHasOperation_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":1086 * return FunctionEnd() * * cdef PetscErrorCode MatProductNumeric_Python( # <<<<<<<<<<<<<< * PetscMat mat * ) \ */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatProductNumeric_Python(Mat __pyx_v_mat) { Mat __pyx_v_A; Mat __pyx_v_B; Mat __pyx_v_C; MatProductType __pyx_v_mtype; PyObject *__pyx_v_mtypes = NULL; Mat_Product *__pyx_v_product; PetscInt __pyx_v_i; Mat __pyx_v_pM; struct PyPetscMatObject *__pyx_v_PyA = 0; struct PyPetscMatObject *__pyx_v_PyB = 0; struct PyPetscMatObject *__pyx_v_PyC = 0; PyObject *__pyx_v_mats = NULL; PyObject *__pyx_v_productNumeric = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; Mat_Product *__pyx_t_4; int __pyx_t_5; int __pyx_t_6; Mat __pyx_t_7; Mat __pyx_t_8; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatProductNumeric_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":1090 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatProductNumeric_Python") # <<<<<<<<<<<<<< * cdef PetscMat A = NULL * cdef PetscMat B = NULL */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"MatProductNumeric_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":1091 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatProductNumeric_Python") * cdef PetscMat A = NULL # <<<<<<<<<<<<<< * cdef PetscMat B = NULL * cdef PetscMat C = NULL */ __pyx_v_A = NULL; /* "petsc4py/PETSc/libpetsc4py.pyx":1092 * FunctionBegin(b"MatProductNumeric_Python") * cdef PetscMat A = NULL * cdef PetscMat B = NULL # <<<<<<<<<<<<<< * cdef PetscMat C = NULL * cdef PetscMatProductType mtype = MATPRODUCT_UNSPECIFIED */ __pyx_v_B = NULL; /* "petsc4py/PETSc/libpetsc4py.pyx":1093 * cdef PetscMat A = NULL * cdef PetscMat B = NULL * cdef PetscMat C = NULL # <<<<<<<<<<<<<< * cdef PetscMatProductType mtype = MATPRODUCT_UNSPECIFIED * CHKERR( MatProductGetMats(mat, &A, &B, &C) ) */ __pyx_v_C = NULL; /* "petsc4py/PETSc/libpetsc4py.pyx":1094 * cdef PetscMat B = NULL * cdef PetscMat C = NULL * cdef PetscMatProductType mtype = MATPRODUCT_UNSPECIFIED # <<<<<<<<<<<<<< * CHKERR( MatProductGetMats(mat, &A, &B, &C) ) * CHKERR( MatProductGetType(mat, &mtype) ) */ __pyx_v_mtype = MATPRODUCT_UNSPECIFIED; /* "petsc4py/PETSc/libpetsc4py.pyx":1095 * cdef PetscMat C = NULL * cdef PetscMatProductType mtype = MATPRODUCT_UNSPECIFIED * CHKERR( MatProductGetMats(mat, &A, &B, &C) ) # <<<<<<<<<<<<<< * CHKERR( MatProductGetType(mat, &mtype) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatProductGetMats(__pyx_v_mat, (&__pyx_v_A), (&__pyx_v_B), (&__pyx_v_C))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1095, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":1096 * cdef PetscMatProductType mtype = MATPRODUCT_UNSPECIFIED * CHKERR( MatProductGetMats(mat, &A, &B, &C) ) * CHKERR( MatProductGetType(mat, &mtype) ) # <<<<<<<<<<<<<< * * mtypes = {MATPRODUCT_AB : 'AB', MATPRODUCT_ABt : 'ABt', MATPRODUCT_AtB : 'AtB', MATPRODUCT_PtAP : 'PtAP', MATPRODUCT_RARt: 'RARt', MATPRODUCT_ABC: 'ABC'} */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatProductGetType(__pyx_v_mat, (&__pyx_v_mtype))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1096, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":1098 * CHKERR( MatProductGetType(mat, &mtype) ) * * mtypes = {MATPRODUCT_AB : 'AB', MATPRODUCT_ABt : 'ABt', MATPRODUCT_AtB : 'AtB', MATPRODUCT_PtAP : 'PtAP', MATPRODUCT_RARt: 'RARt', MATPRODUCT_ABC: 'ABC'} # <<<<<<<<<<<<<< * * cdef Mat_Product *product = mat.product */ __pyx_t_2 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1098, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_MatProductType(MATPRODUCT_AB); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 1098, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_2, __pyx_t_3, __pyx_n_s_AB) < 0) __PYX_ERR(11, 1098, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_MatProductType(MATPRODUCT_ABt); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 1098, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_2, __pyx_t_3, __pyx_n_s_ABt) < 0) __PYX_ERR(11, 1098, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_MatProductType(MATPRODUCT_AtB); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 1098, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_2, __pyx_t_3, __pyx_n_s_AtB) < 0) __PYX_ERR(11, 1098, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_MatProductType(MATPRODUCT_PtAP); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 1098, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_2, __pyx_t_3, __pyx_n_s_PtAP) < 0) __PYX_ERR(11, 1098, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_MatProductType(MATPRODUCT_RARt); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 1098, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_2, __pyx_t_3, __pyx_n_s_RARt) < 0) __PYX_ERR(11, 1098, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_MatProductType(MATPRODUCT_ABC); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 1098, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_2, __pyx_t_3, __pyx_n_s_ABC) < 0) __PYX_ERR(11, 1098, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_mtypes = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1100 * mtypes = {MATPRODUCT_AB : 'AB', MATPRODUCT_ABt : 'ABt', MATPRODUCT_AtB : 'AtB', MATPRODUCT_PtAP : 'PtAP', MATPRODUCT_RARt: 'RARt', MATPRODUCT_ABC: 'ABC'} * * cdef Mat_Product *product = mat.product # <<<<<<<<<<<<<< * cdef PetscInt i = product.data * if i < 0 or i > 2: */ __pyx_t_4 = __pyx_v_mat->product; __pyx_v_product = __pyx_t_4; /* "petsc4py/PETSc/libpetsc4py.pyx":1101 * * cdef Mat_Product *product = mat.product * cdef PetscInt i = product.data # <<<<<<<<<<<<<< * if i < 0 or i > 2: * return PetscSETERR(PETSC_ERR_PLIB, */ __pyx_v_i = ((PetscInt)((Py_uintptr_t)__pyx_v_product->data)); /* "petsc4py/PETSc/libpetsc4py.pyx":1102 * cdef Mat_Product *product = mat.product * cdef PetscInt i = product.data * if i < 0 or i > 2: # <<<<<<<<<<<<<< * return PetscSETERR(PETSC_ERR_PLIB, * "Corrupted composed id") */ __pyx_t_6 = (__pyx_v_i < 0); if (!__pyx_t_6) { } else { __pyx_t_5 = __pyx_t_6; goto __pyx_L4_bool_binop_done; } __pyx_t_6 = (__pyx_v_i > 2); __pyx_t_5 = __pyx_t_6; __pyx_L4_bool_binop_done:; if (__pyx_t_5) { /* "petsc4py/PETSc/libpetsc4py.pyx":1103 * cdef PetscInt i = product.data * if i < 0 or i > 2: * return PetscSETERR(PETSC_ERR_PLIB, # <<<<<<<<<<<<<< * "Corrupted composed id") * cdef PetscMat pM = C if i == 2 else B if i == 1 else A */ __pyx_r = __pyx_f_8petsc4py_5PETSc_PetscSETERR(PETSC_ERR_PLIB, ((char *)"Corrupted composed id")); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":1102 * cdef Mat_Product *product = mat.product * cdef PetscInt i = product.data * if i < 0 or i > 2: # <<<<<<<<<<<<<< * return PetscSETERR(PETSC_ERR_PLIB, * "Corrupted composed id") */ } /* "petsc4py/PETSc/libpetsc4py.pyx":1105 * return PetscSETERR(PETSC_ERR_PLIB, * "Corrupted composed id") * cdef PetscMat pM = C if i == 2 else B if i == 1 else A # <<<<<<<<<<<<<< * * cdef Mat PyA = Mat_(A) */ __pyx_t_5 = (__pyx_v_i == 2); if (__pyx_t_5) { __pyx_t_7 = __pyx_v_C; } else { __pyx_t_6 = (__pyx_v_i == 1); if (__pyx_t_6) { __pyx_t_8 = __pyx_v_B; } else { __pyx_t_8 = __pyx_v_A; } __pyx_t_7 = __pyx_t_8; } __pyx_v_pM = __pyx_t_7; /* "petsc4py/PETSc/libpetsc4py.pyx":1107 * cdef PetscMat pM = C if i == 2 else B if i == 1 else A * * cdef Mat PyA = Mat_(A) # <<<<<<<<<<<<<< * cdef Mat PyB = Mat_(B) * cdef Mat PyC = Mat_(C) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_A)); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_PyA = ((struct PyPetscMatObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1108 * * cdef Mat PyA = Mat_(A) * cdef Mat PyB = Mat_(B) # <<<<<<<<<<<<<< * cdef Mat PyC = Mat_(C) * if mtype == MATPRODUCT_ABC: */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_B)); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_PyB = ((struct PyPetscMatObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1109 * cdef Mat PyA = Mat_(A) * cdef Mat PyB = Mat_(B) * cdef Mat PyC = Mat_(C) # <<<<<<<<<<<<<< * if mtype == MATPRODUCT_ABC: * mats = (PyA, PyB, PyC) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_C)); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_PyC = ((struct PyPetscMatObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1110 * cdef Mat PyB = Mat_(B) * cdef Mat PyC = Mat_(C) * if mtype == MATPRODUCT_ABC: # <<<<<<<<<<<<<< * mats = (PyA, PyB, PyC) * else: */ __pyx_t_5 = (__pyx_v_mtype == MATPRODUCT_ABC); if (__pyx_t_5) { /* "petsc4py/PETSc/libpetsc4py.pyx":1111 * cdef Mat PyC = Mat_(C) * if mtype == MATPRODUCT_ABC: * mats = (PyA, PyB, PyC) # <<<<<<<<<<<<<< * else: * mats = (PyA, PyB, None) */ __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF((PyObject *)__pyx_v_PyA); __Pyx_GIVEREF((PyObject *)__pyx_v_PyA); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_PyA))) __PYX_ERR(11, 1111, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_PyB); __Pyx_GIVEREF((PyObject *)__pyx_v_PyB); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_PyB))) __PYX_ERR(11, 1111, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_PyC); __Pyx_GIVEREF((PyObject *)__pyx_v_PyC); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_PyC))) __PYX_ERR(11, 1111, __pyx_L1_error); __pyx_v_mats = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1110 * cdef Mat PyB = Mat_(B) * cdef Mat PyC = Mat_(C) * if mtype == MATPRODUCT_ABC: # <<<<<<<<<<<<<< * mats = (PyA, PyB, PyC) * else: */ goto __pyx_L6; } /* "petsc4py/PETSc/libpetsc4py.pyx":1113 * mats = (PyA, PyB, PyC) * else: * mats = (PyA, PyB, None) # <<<<<<<<<<<<<< * * cdef productNumeric = PyMat(pM).productNumeric */ /*else*/ { __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF((PyObject *)__pyx_v_PyA); __Pyx_GIVEREF((PyObject *)__pyx_v_PyA); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_PyA))) __PYX_ERR(11, 1113, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_PyB); __Pyx_GIVEREF((PyObject *)__pyx_v_PyB); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_PyB))) __PYX_ERR(11, 1113, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, Py_None)) __PYX_ERR(11, 1113, __pyx_L1_error); __pyx_v_mats = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; } __pyx_L6:; /* "petsc4py/PETSc/libpetsc4py.pyx":1115 * mats = (PyA, PyB, None) * * cdef productNumeric = PyMat(pM).productNumeric # <<<<<<<<<<<<<< * if productNumeric is None: return UNSUPPORTED(b"productNumeric") * productNumeric(PyC if C == pM else PyB if B == pM else PyA, Mat_(mat), mtypes[mtype], *mats) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyMat(__pyx_v_pM)); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_productNumeric); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 1115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_productNumeric = __pyx_t_3; __pyx_t_3 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1116 * * cdef productNumeric = PyMat(pM).productNumeric * if productNumeric is None: return UNSUPPORTED(b"productNumeric") # <<<<<<<<<<<<<< * productNumeric(PyC if C == pM else PyB if B == pM else PyA, Mat_(mat), mtypes[mtype], *mats) * */ __pyx_t_5 = (__pyx_v_productNumeric == Py_None); if (__pyx_t_5) { __pyx_r = __pyx_f_8petsc4py_5PETSc_UNSUPPORTED(((char *)"productNumeric")); goto __pyx_L0; } /* "petsc4py/PETSc/libpetsc4py.pyx":1117 * cdef productNumeric = PyMat(pM).productNumeric * if productNumeric is None: return UNSUPPORTED(b"productNumeric") * productNumeric(PyC if C == pM else PyB if B == pM else PyA, Mat_(mat), mtypes[mtype], *mats) # <<<<<<<<<<<<<< * * return FunctionEnd() */ __pyx_t_5 = (__pyx_v_C == __pyx_v_pM); if (__pyx_t_5) { __Pyx_INCREF((PyObject *)__pyx_v_PyC); __pyx_t_3 = ((PyObject *)__pyx_v_PyC); } else { __pyx_t_6 = (__pyx_v_B == __pyx_v_pM); if (__pyx_t_6) { __Pyx_INCREF((PyObject *)__pyx_v_PyB); __pyx_t_2 = ((PyObject *)__pyx_v_PyB); } else { __Pyx_INCREF((PyObject *)__pyx_v_PyA); __pyx_t_2 = ((PyObject *)__pyx_v_PyA); } __pyx_t_3 = __pyx_t_2; __pyx_t_2 = 0; } __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = __Pyx_PyInt_From_MatProductType(__pyx_v_mtype); if (unlikely(!__pyx_t_9)) __PYX_ERR(11, 1117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyDict_GetItem(__pyx_v_mtypes, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(11, 1117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(11, 1117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_3)) __PYX_ERR(11, 1117, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_2)) __PYX_ERR(11, 1117, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_10); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_10)) __PYX_ERR(11, 1117, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_10 = 0; __pyx_t_10 = PyNumber_Add(__pyx_t_9, __pyx_v_mats); if (unlikely(!__pyx_t_10)) __PYX_ERR(11, 1117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = __Pyx_PyObject_Call(__pyx_v_productNumeric, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(11, 1117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1119 * productNumeric(PyC if C == pM else PyB if B == pM else PyA, Mat_(mat), mtypes[mtype], *mats) * * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscInt matmatid = -1 */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":1086 * return FunctionEnd() * * cdef PetscErrorCode MatProductNumeric_Python( # <<<<<<<<<<<<<< * PetscMat mat * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("petsc4py.PETSc.MatProductNumeric_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_mtypes); __Pyx_XDECREF((PyObject *)__pyx_v_PyA); __Pyx_XDECREF((PyObject *)__pyx_v_PyB); __Pyx_XDECREF((PyObject *)__pyx_v_PyC); __Pyx_XDECREF(__pyx_v_mats); __Pyx_XDECREF(__pyx_v_productNumeric); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":1123 * cdef PetscInt matmatid = -1 * * cdef PetscErrorCode MatProductSymbolic_Python( # <<<<<<<<<<<<<< * PetscMat mat * ) \ */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatProductSymbolic_Python(Mat __pyx_v_mat) { Mat __pyx_v_A; Mat __pyx_v_B; Mat __pyx_v_C; MatProductType __pyx_v_mtype; PyObject *__pyx_v_mtypes = NULL; PetscInt __pyx_v_i; PetscBool __pyx_v_flg; Mat __pyx_v_pM; struct PyPetscMatObject *__pyx_v_PyA = 0; struct PyPetscMatObject *__pyx_v_PyB = 0; struct PyPetscMatObject *__pyx_v_PyC = 0; PyObject *__pyx_v_mats = NULL; PyObject *__pyx_v_productSymbolic = 0; Mat_Product *__pyx_v_product; MatOps __pyx_v_ops; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; Mat __pyx_t_6; Mat __pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; Mat_Product *__pyx_t_10; MatOps __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatProductSymbolic_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":1127 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatProductSymbolic_Python") # <<<<<<<<<<<<<< * cdef PetscMat A = NULL * cdef PetscMat B = NULL */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"MatProductSymbolic_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":1128 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatProductSymbolic_Python") * cdef PetscMat A = NULL # <<<<<<<<<<<<<< * cdef PetscMat B = NULL * cdef PetscMat C = NULL */ __pyx_v_A = NULL; /* "petsc4py/PETSc/libpetsc4py.pyx":1129 * FunctionBegin(b"MatProductSymbolic_Python") * cdef PetscMat A = NULL * cdef PetscMat B = NULL # <<<<<<<<<<<<<< * cdef PetscMat C = NULL * cdef PetscMatProductType mtype = MATPRODUCT_UNSPECIFIED */ __pyx_v_B = NULL; /* "petsc4py/PETSc/libpetsc4py.pyx":1130 * cdef PetscMat A = NULL * cdef PetscMat B = NULL * cdef PetscMat C = NULL # <<<<<<<<<<<<<< * cdef PetscMatProductType mtype = MATPRODUCT_UNSPECIFIED * CHKERR( MatProductGetMats(mat, &A, &B, &C) ) */ __pyx_v_C = NULL; /* "petsc4py/PETSc/libpetsc4py.pyx":1131 * cdef PetscMat B = NULL * cdef PetscMat C = NULL * cdef PetscMatProductType mtype = MATPRODUCT_UNSPECIFIED # <<<<<<<<<<<<<< * CHKERR( MatProductGetMats(mat, &A, &B, &C) ) * CHKERR( MatProductGetType(mat, &mtype) ) */ __pyx_v_mtype = MATPRODUCT_UNSPECIFIED; /* "petsc4py/PETSc/libpetsc4py.pyx":1132 * cdef PetscMat C = NULL * cdef PetscMatProductType mtype = MATPRODUCT_UNSPECIFIED * CHKERR( MatProductGetMats(mat, &A, &B, &C) ) # <<<<<<<<<<<<<< * CHKERR( MatProductGetType(mat, &mtype) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatProductGetMats(__pyx_v_mat, (&__pyx_v_A), (&__pyx_v_B), (&__pyx_v_C))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1132, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":1133 * cdef PetscMatProductType mtype = MATPRODUCT_UNSPECIFIED * CHKERR( MatProductGetMats(mat, &A, &B, &C) ) * CHKERR( MatProductGetType(mat, &mtype) ) # <<<<<<<<<<<<<< * * mtypes = {MATPRODUCT_AB : 'AB', MATPRODUCT_ABt : 'ABt', MATPRODUCT_AtB : 'AtB', MATPRODUCT_PtAP : 'PtAP', MATPRODUCT_RARt: 'RARt', MATPRODUCT_ABC: 'ABC'} */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatProductGetType(__pyx_v_mat, (&__pyx_v_mtype))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1133, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":1135 * CHKERR( MatProductGetType(mat, &mtype) ) * * mtypes = {MATPRODUCT_AB : 'AB', MATPRODUCT_ABt : 'ABt', MATPRODUCT_AtB : 'AtB', MATPRODUCT_PtAP : 'PtAP', MATPRODUCT_RARt: 'RARt', MATPRODUCT_ABC: 'ABC'} # <<<<<<<<<<<<<< * * global matmatid */ __pyx_t_2 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_MatProductType(MATPRODUCT_AB); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 1135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_2, __pyx_t_3, __pyx_n_s_AB) < 0) __PYX_ERR(11, 1135, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_MatProductType(MATPRODUCT_ABt); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 1135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_2, __pyx_t_3, __pyx_n_s_ABt) < 0) __PYX_ERR(11, 1135, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_MatProductType(MATPRODUCT_AtB); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 1135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_2, __pyx_t_3, __pyx_n_s_AtB) < 0) __PYX_ERR(11, 1135, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_MatProductType(MATPRODUCT_PtAP); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 1135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_2, __pyx_t_3, __pyx_n_s_PtAP) < 0) __PYX_ERR(11, 1135, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_MatProductType(MATPRODUCT_RARt); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 1135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_2, __pyx_t_3, __pyx_n_s_RARt) < 0) __PYX_ERR(11, 1135, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_MatProductType(MATPRODUCT_ABC); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 1135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_2, __pyx_t_3, __pyx_n_s_ABC) < 0) __PYX_ERR(11, 1135, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_mtypes = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1138 * * global matmatid * cdef PetscInt i = -1 # <<<<<<<<<<<<<< * cdef PetscBool flg = PETSC_FALSE * CHKERR( PetscObjectComposedDataGetIntPy(mat, matmatid, &i, &flg) ) */ __pyx_v_i = -1L; /* "petsc4py/PETSc/libpetsc4py.pyx":1139 * global matmatid * cdef PetscInt i = -1 * cdef PetscBool flg = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( PetscObjectComposedDataGetIntPy(mat, matmatid, &i, &flg) ) * if flg is not PETSC_TRUE: */ __pyx_v_flg = PETSC_FALSE; /* "petsc4py/PETSc/libpetsc4py.pyx":1140 * cdef PetscInt i = -1 * cdef PetscBool flg = PETSC_FALSE * CHKERR( PetscObjectComposedDataGetIntPy(mat, matmatid, &i, &flg) ) # <<<<<<<<<<<<<< * if flg is not PETSC_TRUE: * return PetscSETERR(PETSC_ERR_PLIB, */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectComposedDataGetIntPy(((PetscObject)__pyx_v_mat), __pyx_v_8petsc4py_5PETSc_matmatid, (&__pyx_v_i), (&__pyx_v_flg))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1140, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":1141 * cdef PetscBool flg = PETSC_FALSE * CHKERR( PetscObjectComposedDataGetIntPy(mat, matmatid, &i, &flg) ) * if flg is not PETSC_TRUE: # <<<<<<<<<<<<<< * return PetscSETERR(PETSC_ERR_PLIB, * "Missing composed id") */ __pyx_t_4 = (__pyx_v_flg != PETSC_TRUE); if (__pyx_t_4) { /* "petsc4py/PETSc/libpetsc4py.pyx":1142 * CHKERR( PetscObjectComposedDataGetIntPy(mat, matmatid, &i, &flg) ) * if flg is not PETSC_TRUE: * return PetscSETERR(PETSC_ERR_PLIB, # <<<<<<<<<<<<<< * "Missing composed id") * if i < 0 or i > 2: */ __pyx_r = __pyx_f_8petsc4py_5PETSc_PetscSETERR(PETSC_ERR_PLIB, ((char *)"Missing composed id")); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":1141 * cdef PetscBool flg = PETSC_FALSE * CHKERR( PetscObjectComposedDataGetIntPy(mat, matmatid, &i, &flg) ) * if flg is not PETSC_TRUE: # <<<<<<<<<<<<<< * return PetscSETERR(PETSC_ERR_PLIB, * "Missing composed id") */ } /* "petsc4py/PETSc/libpetsc4py.pyx":1144 * return PetscSETERR(PETSC_ERR_PLIB, * "Missing composed id") * if i < 0 or i > 2: # <<<<<<<<<<<<<< * return PetscSETERR(PETSC_ERR_PLIB, * "Corrupted composed id") */ __pyx_t_5 = (__pyx_v_i < 0); if (!__pyx_t_5) { } else { __pyx_t_4 = __pyx_t_5; goto __pyx_L5_bool_binop_done; } __pyx_t_5 = (__pyx_v_i > 2); __pyx_t_4 = __pyx_t_5; __pyx_L5_bool_binop_done:; if (__pyx_t_4) { /* "petsc4py/PETSc/libpetsc4py.pyx":1145 * "Missing composed id") * if i < 0 or i > 2: * return PetscSETERR(PETSC_ERR_PLIB, # <<<<<<<<<<<<<< * "Corrupted composed id") * cdef PetscMat pM = C if i == 2 else B if i == 1 else A */ __pyx_r = __pyx_f_8petsc4py_5PETSc_PetscSETERR(PETSC_ERR_PLIB, ((char *)"Corrupted composed id")); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":1144 * return PetscSETERR(PETSC_ERR_PLIB, * "Missing composed id") * if i < 0 or i > 2: # <<<<<<<<<<<<<< * return PetscSETERR(PETSC_ERR_PLIB, * "Corrupted composed id") */ } /* "petsc4py/PETSc/libpetsc4py.pyx":1147 * return PetscSETERR(PETSC_ERR_PLIB, * "Corrupted composed id") * cdef PetscMat pM = C if i == 2 else B if i == 1 else A # <<<<<<<<<<<<<< * * cdef Mat PyA = Mat_(A) */ __pyx_t_4 = (__pyx_v_i == 2); if (__pyx_t_4) { __pyx_t_6 = __pyx_v_C; } else { __pyx_t_5 = (__pyx_v_i == 1); if (__pyx_t_5) { __pyx_t_7 = __pyx_v_B; } else { __pyx_t_7 = __pyx_v_A; } __pyx_t_6 = __pyx_t_7; } __pyx_v_pM = __pyx_t_6; /* "petsc4py/PETSc/libpetsc4py.pyx":1149 * cdef PetscMat pM = C if i == 2 else B if i == 1 else A * * cdef Mat PyA = Mat_(A) # <<<<<<<<<<<<<< * cdef Mat PyB = Mat_(B) * cdef Mat PyC = Mat_(C) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_A)); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_PyA = ((struct PyPetscMatObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1150 * * cdef Mat PyA = Mat_(A) * cdef Mat PyB = Mat_(B) # <<<<<<<<<<<<<< * cdef Mat PyC = Mat_(C) * if mtype == MATPRODUCT_ABC: */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_B)); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_PyB = ((struct PyPetscMatObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1151 * cdef Mat PyA = Mat_(A) * cdef Mat PyB = Mat_(B) * cdef Mat PyC = Mat_(C) # <<<<<<<<<<<<<< * if mtype == MATPRODUCT_ABC: * mats = (PyA, PyB, PyC) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_C)); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_PyC = ((struct PyPetscMatObject *)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1152 * cdef Mat PyB = Mat_(B) * cdef Mat PyC = Mat_(C) * if mtype == MATPRODUCT_ABC: # <<<<<<<<<<<<<< * mats = (PyA, PyB, PyC) * else: */ __pyx_t_4 = (__pyx_v_mtype == MATPRODUCT_ABC); if (__pyx_t_4) { /* "petsc4py/PETSc/libpetsc4py.pyx":1153 * cdef Mat PyC = Mat_(C) * if mtype == MATPRODUCT_ABC: * mats = (PyA, PyB, PyC) # <<<<<<<<<<<<<< * else: * mats = (PyA, PyB, None) */ __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF((PyObject *)__pyx_v_PyA); __Pyx_GIVEREF((PyObject *)__pyx_v_PyA); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_PyA))) __PYX_ERR(11, 1153, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_PyB); __Pyx_GIVEREF((PyObject *)__pyx_v_PyB); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_PyB))) __PYX_ERR(11, 1153, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_PyC); __Pyx_GIVEREF((PyObject *)__pyx_v_PyC); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_PyC))) __PYX_ERR(11, 1153, __pyx_L1_error); __pyx_v_mats = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1152 * cdef Mat PyB = Mat_(B) * cdef Mat PyC = Mat_(C) * if mtype == MATPRODUCT_ABC: # <<<<<<<<<<<<<< * mats = (PyA, PyB, PyC) * else: */ goto __pyx_L7; } /* "petsc4py/PETSc/libpetsc4py.pyx":1155 * mats = (PyA, PyB, PyC) * else: * mats = (PyA, PyB, None) # <<<<<<<<<<<<<< * * cdef productSymbolic = PyMat(pM).productSymbolic */ /*else*/ { __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF((PyObject *)__pyx_v_PyA); __Pyx_GIVEREF((PyObject *)__pyx_v_PyA); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_PyA))) __PYX_ERR(11, 1155, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_PyB); __Pyx_GIVEREF((PyObject *)__pyx_v_PyB); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_PyB))) __PYX_ERR(11, 1155, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, Py_None)) __PYX_ERR(11, 1155, __pyx_L1_error); __pyx_v_mats = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; } __pyx_L7:; /* "petsc4py/PETSc/libpetsc4py.pyx":1157 * mats = (PyA, PyB, None) * * cdef productSymbolic = PyMat(pM).productSymbolic # <<<<<<<<<<<<<< * if productSymbolic is None: return UNSUPPORTED(b"productSymbolic") * productSymbolic(PyC if C == pM else PyB if B == pM else PyA, Mat_(mat), mtypes[mtype], *mats) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyMat(__pyx_v_pM)); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_productSymbolic); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 1157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_productSymbolic = __pyx_t_3; __pyx_t_3 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1158 * * cdef productSymbolic = PyMat(pM).productSymbolic * if productSymbolic is None: return UNSUPPORTED(b"productSymbolic") # <<<<<<<<<<<<<< * productSymbolic(PyC if C == pM else PyB if B == pM else PyA, Mat_(mat), mtypes[mtype], *mats) * */ __pyx_t_4 = (__pyx_v_productSymbolic == Py_None); if (__pyx_t_4) { __pyx_r = __pyx_f_8petsc4py_5PETSc_UNSUPPORTED(((char *)"productSymbolic")); goto __pyx_L0; } /* "petsc4py/PETSc/libpetsc4py.pyx":1159 * cdef productSymbolic = PyMat(pM).productSymbolic * if productSymbolic is None: return UNSUPPORTED(b"productSymbolic") * productSymbolic(PyC if C == pM else PyB if B == pM else PyA, Mat_(mat), mtypes[mtype], *mats) # <<<<<<<<<<<<<< * * # Store id in matrix product */ __pyx_t_4 = (__pyx_v_C == __pyx_v_pM); if (__pyx_t_4) { __Pyx_INCREF((PyObject *)__pyx_v_PyC); __pyx_t_3 = ((PyObject *)__pyx_v_PyC); } else { __pyx_t_5 = (__pyx_v_B == __pyx_v_pM); if (__pyx_t_5) { __Pyx_INCREF((PyObject *)__pyx_v_PyB); __pyx_t_2 = ((PyObject *)__pyx_v_PyB); } else { __Pyx_INCREF((PyObject *)__pyx_v_PyA); __pyx_t_2 = ((PyObject *)__pyx_v_PyA); } __pyx_t_3 = __pyx_t_2; __pyx_t_2 = 0; } __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_8 = __Pyx_PyInt_From_MatProductType(__pyx_v_mtype); if (unlikely(!__pyx_t_8)) __PYX_ERR(11, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_mtypes, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(11, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(11, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3)) __PYX_ERR(11, 1159, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_2)) __PYX_ERR(11, 1159, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_9); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_9)) __PYX_ERR(11, 1159, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_9 = 0; __pyx_t_9 = PyNumber_Add(__pyx_t_8, __pyx_v_mats); if (unlikely(!__pyx_t_9)) __PYX_ERR(11, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyObject_Call(__pyx_v_productSymbolic, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(11, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1162 * * # Store id in matrix product * cdef Mat_Product *product = mat.product # <<<<<<<<<<<<<< * product.data = i * */ __pyx_t_10 = __pyx_v_mat->product; __pyx_v_product = __pyx_t_10; /* "petsc4py/PETSc/libpetsc4py.pyx":1163 * # Store id in matrix product * cdef Mat_Product *product = mat.product * product.data = i # <<<<<<<<<<<<<< * * cdef MatOps ops = mat.ops */ __pyx_v_product->data = ((void *)((Py_uintptr_t)__pyx_v_i)); /* "petsc4py/PETSc/libpetsc4py.pyx":1165 * product.data = i * * cdef MatOps ops = mat.ops # <<<<<<<<<<<<<< * ops.productnumeric = MatProductNumeric_Python * return FunctionEnd() */ __pyx_t_11 = __pyx_v_mat->ops; __pyx_v_ops = __pyx_t_11; /* "petsc4py/PETSc/libpetsc4py.pyx":1166 * * cdef MatOps ops = mat.ops * ops.productnumeric = MatProductNumeric_Python # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_v_ops->productnumeric = __pyx_f_8petsc4py_5PETSc_MatProductNumeric_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":1167 * cdef MatOps ops = mat.ops * ops.productnumeric = MatProductNumeric_Python * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatProductSetFromOptions_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":1123 * cdef PetscInt matmatid = -1 * * cdef PetscErrorCode MatProductSymbolic_Python( # <<<<<<<<<<<<<< * PetscMat mat * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("petsc4py.PETSc.MatProductSymbolic_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_mtypes); __Pyx_XDECREF((PyObject *)__pyx_v_PyA); __Pyx_XDECREF((PyObject *)__pyx_v_PyB); __Pyx_XDECREF((PyObject *)__pyx_v_PyC); __Pyx_XDECREF(__pyx_v_mats); __Pyx_XDECREF(__pyx_v_productSymbolic); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":1169 * return FunctionEnd() * * cdef PetscErrorCode MatProductSetFromOptions_Python( # <<<<<<<<<<<<<< * PetscMat mat * ) \ */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatProductSetFromOptions_Python(Mat __pyx_v_mat) { Mat __pyx_v_A; Mat __pyx_v_B; Mat __pyx_v_C; MatProductType __pyx_v_mtype; PyObject *__pyx_v_mtypes = NULL; struct PyPetscMatObject *__pyx_v_PyA = 0; struct PyPetscMatObject *__pyx_v_PyB = 0; struct PyPetscMatObject *__pyx_v_PyC = 0; PyObject *__pyx_v_mats = NULL; PyObject *__pyx_v_found = NULL; PetscBool __pyx_v_mispy; Mat __pyx_v_pM; struct PyPetscMatObject *__pyx_v_mm = 0; PetscInt __pyx_v_i; MatOps __pyx_v_ops; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; Py_ssize_t __pyx_t_6; Py_ssize_t __pyx_t_7; PetscInt __pyx_t_8; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; MatOps __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatProductSetFromOptions_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":1173 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatProductSetFromOptions_Python") # <<<<<<<<<<<<<< * cdef PetscMat A = NULL * cdef PetscMat B = NULL */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"MatProductSetFromOptions_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":1174 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"MatProductSetFromOptions_Python") * cdef PetscMat A = NULL # <<<<<<<<<<<<<< * cdef PetscMat B = NULL * cdef PetscMat C = NULL */ __pyx_v_A = NULL; /* "petsc4py/PETSc/libpetsc4py.pyx":1175 * FunctionBegin(b"MatProductSetFromOptions_Python") * cdef PetscMat A = NULL * cdef PetscMat B = NULL # <<<<<<<<<<<<<< * cdef PetscMat C = NULL * CHKERR( MatProductGetMats(mat, &A, &B, &C) ) */ __pyx_v_B = NULL; /* "petsc4py/PETSc/libpetsc4py.pyx":1176 * cdef PetscMat A = NULL * cdef PetscMat B = NULL * cdef PetscMat C = NULL # <<<<<<<<<<<<<< * CHKERR( MatProductGetMats(mat, &A, &B, &C) ) * if A == NULL or B == NULL: */ __pyx_v_C = NULL; /* "petsc4py/PETSc/libpetsc4py.pyx":1177 * cdef PetscMat B = NULL * cdef PetscMat C = NULL * CHKERR( MatProductGetMats(mat, &A, &B, &C) ) # <<<<<<<<<<<<<< * if A == NULL or B == NULL: * return PetscSETERR(PETSC_ERR_PLIB, */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatProductGetMats(__pyx_v_mat, (&__pyx_v_A), (&__pyx_v_B), (&__pyx_v_C))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1177, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":1178 * cdef PetscMat C = NULL * CHKERR( MatProductGetMats(mat, &A, &B, &C) ) * if A == NULL or B == NULL: # <<<<<<<<<<<<<< * return PetscSETERR(PETSC_ERR_PLIB, * "Missing matrices") */ __pyx_t_3 = (__pyx_v_A == NULL); if (!__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = (__pyx_v_B == NULL); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { /* "petsc4py/PETSc/libpetsc4py.pyx":1179 * CHKERR( MatProductGetMats(mat, &A, &B, &C) ) * if A == NULL or B == NULL: * return PetscSETERR(PETSC_ERR_PLIB, # <<<<<<<<<<<<<< * "Missing matrices") * */ __pyx_r = __pyx_f_8petsc4py_5PETSc_PetscSETERR(PETSC_ERR_PLIB, ((char *)"Missing matrices")); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":1178 * cdef PetscMat C = NULL * CHKERR( MatProductGetMats(mat, &A, &B, &C) ) * if A == NULL or B == NULL: # <<<<<<<<<<<<<< * return PetscSETERR(PETSC_ERR_PLIB, * "Missing matrices") */ } /* "petsc4py/PETSc/libpetsc4py.pyx":1182 * "Missing matrices") * * cdef PetscMatProductType mtype = MATPRODUCT_UNSPECIFIED # <<<<<<<<<<<<<< * CHKERR( MatProductGetType(mat, &mtype) ) * if mtype == MATPRODUCT_UNSPECIFIED: */ __pyx_v_mtype = MATPRODUCT_UNSPECIFIED; /* "petsc4py/PETSc/libpetsc4py.pyx":1183 * * cdef PetscMatProductType mtype = MATPRODUCT_UNSPECIFIED * CHKERR( MatProductGetType(mat, &mtype) ) # <<<<<<<<<<<<<< * if mtype == MATPRODUCT_UNSPECIFIED: * return PetscSETERR(PETSC_ERR_PLIB, */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatProductGetType(__pyx_v_mat, (&__pyx_v_mtype))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1183, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":1184 * cdef PetscMatProductType mtype = MATPRODUCT_UNSPECIFIED * CHKERR( MatProductGetType(mat, &mtype) ) * if mtype == MATPRODUCT_UNSPECIFIED: # <<<<<<<<<<<<<< * return PetscSETERR(PETSC_ERR_PLIB, * "Unknown product type") */ __pyx_t_2 = (__pyx_v_mtype == MATPRODUCT_UNSPECIFIED); if (__pyx_t_2) { /* "petsc4py/PETSc/libpetsc4py.pyx":1185 * CHKERR( MatProductGetType(mat, &mtype) ) * if mtype == MATPRODUCT_UNSPECIFIED: * return PetscSETERR(PETSC_ERR_PLIB, # <<<<<<<<<<<<<< * "Unknown product type") * */ __pyx_r = __pyx_f_8petsc4py_5PETSc_PetscSETERR(PETSC_ERR_PLIB, ((char *)"Unknown product type")); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":1184 * cdef PetscMatProductType mtype = MATPRODUCT_UNSPECIFIED * CHKERR( MatProductGetType(mat, &mtype) ) * if mtype == MATPRODUCT_UNSPECIFIED: # <<<<<<<<<<<<<< * return PetscSETERR(PETSC_ERR_PLIB, * "Unknown product type") */ } /* "petsc4py/PETSc/libpetsc4py.pyx":1188 * "Unknown product type") * * mtypes = {MATPRODUCT_AB : 'AB', MATPRODUCT_ABt : 'ABt', MATPRODUCT_AtB : 'AtB', MATPRODUCT_PtAP : 'PtAP', MATPRODUCT_RARt: 'RARt', MATPRODUCT_ABC: 'ABC'} # <<<<<<<<<<<<<< * * cdef Mat PyA = Mat_(A) */ __pyx_t_4 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 1188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_MatProductType(MATPRODUCT_AB); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 1188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_4, __pyx_t_5, __pyx_n_s_AB) < 0) __PYX_ERR(11, 1188, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyInt_From_MatProductType(MATPRODUCT_ABt); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 1188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_4, __pyx_t_5, __pyx_n_s_ABt) < 0) __PYX_ERR(11, 1188, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyInt_From_MatProductType(MATPRODUCT_AtB); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 1188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_4, __pyx_t_5, __pyx_n_s_AtB) < 0) __PYX_ERR(11, 1188, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyInt_From_MatProductType(MATPRODUCT_PtAP); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 1188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_4, __pyx_t_5, __pyx_n_s_PtAP) < 0) __PYX_ERR(11, 1188, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyInt_From_MatProductType(MATPRODUCT_RARt); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 1188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_4, __pyx_t_5, __pyx_n_s_RARt) < 0) __PYX_ERR(11, 1188, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyInt_From_MatProductType(MATPRODUCT_ABC); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 1188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_4, __pyx_t_5, __pyx_n_s_ABC) < 0) __PYX_ERR(11, 1188, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_mtypes = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1190 * mtypes = {MATPRODUCT_AB : 'AB', MATPRODUCT_ABt : 'ABt', MATPRODUCT_AtB : 'AtB', MATPRODUCT_PtAP : 'PtAP', MATPRODUCT_RARt: 'RARt', MATPRODUCT_ABC: 'ABC'} * * cdef Mat PyA = Mat_(A) # <<<<<<<<<<<<<< * cdef Mat PyB = Mat_(B) * cdef Mat PyC = Mat_(C) */ __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_A)); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 1190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_PyA = ((struct PyPetscMatObject *)__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1191 * * cdef Mat PyA = Mat_(A) * cdef Mat PyB = Mat_(B) # <<<<<<<<<<<<<< * cdef Mat PyC = Mat_(C) * if mtype == MATPRODUCT_ABC: */ __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_B)); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 1191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_PyB = ((struct PyPetscMatObject *)__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1192 * cdef Mat PyA = Mat_(A) * cdef Mat PyB = Mat_(B) * cdef Mat PyC = Mat_(C) # <<<<<<<<<<<<<< * if mtype == MATPRODUCT_ABC: * mats = (PyA, PyB, PyC) */ __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_C)); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 1192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_PyC = ((struct PyPetscMatObject *)__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1193 * cdef Mat PyB = Mat_(B) * cdef Mat PyC = Mat_(C) * if mtype == MATPRODUCT_ABC: # <<<<<<<<<<<<<< * mats = (PyA, PyB, PyC) * else: */ __pyx_t_2 = (__pyx_v_mtype == MATPRODUCT_ABC); if (__pyx_t_2) { /* "petsc4py/PETSc/libpetsc4py.pyx":1194 * cdef Mat PyC = Mat_(C) * if mtype == MATPRODUCT_ABC: * mats = (PyA, PyB, PyC) # <<<<<<<<<<<<<< * else: * mats = (PyA, PyB, None) */ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 1194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF((PyObject *)__pyx_v_PyA); __Pyx_GIVEREF((PyObject *)__pyx_v_PyA); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_PyA))) __PYX_ERR(11, 1194, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_PyB); __Pyx_GIVEREF((PyObject *)__pyx_v_PyB); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_PyB))) __PYX_ERR(11, 1194, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_PyC); __Pyx_GIVEREF((PyObject *)__pyx_v_PyC); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, ((PyObject *)__pyx_v_PyC))) __PYX_ERR(11, 1194, __pyx_L1_error); __pyx_v_mats = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1193 * cdef Mat PyB = Mat_(B) * cdef Mat PyC = Mat_(C) * if mtype == MATPRODUCT_ABC: # <<<<<<<<<<<<<< * mats = (PyA, PyB, PyC) * else: */ goto __pyx_L7; } /* "petsc4py/PETSc/libpetsc4py.pyx":1196 * mats = (PyA, PyB, PyC) * else: * mats = (PyA, PyB, None) # <<<<<<<<<<<<<< * * # Find Python matrix in mats able to perform the product */ /*else*/ { __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 1196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF((PyObject *)__pyx_v_PyA); __Pyx_GIVEREF((PyObject *)__pyx_v_PyA); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_PyA))) __PYX_ERR(11, 1196, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_PyB); __Pyx_GIVEREF((PyObject *)__pyx_v_PyB); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_PyB))) __PYX_ERR(11, 1196, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, Py_None)) __PYX_ERR(11, 1196, __pyx_L1_error); __pyx_v_mats = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; } __pyx_L7:; /* "petsc4py/PETSc/libpetsc4py.pyx":1199 * * # Find Python matrix in mats able to perform the product * found = False # <<<<<<<<<<<<<< * cdef PetscBool mispy = PETSC_FALSE * cdef PetscMat pM = NULL */ __Pyx_INCREF(Py_False); __pyx_v_found = Py_False; /* "petsc4py/PETSc/libpetsc4py.pyx":1200 * # Find Python matrix in mats able to perform the product * found = False * cdef PetscBool mispy = PETSC_FALSE # <<<<<<<<<<<<<< * cdef PetscMat pM = NULL * cdef Mat mm */ __pyx_v_mispy = PETSC_FALSE; /* "petsc4py/PETSc/libpetsc4py.pyx":1201 * found = False * cdef PetscBool mispy = PETSC_FALSE * cdef PetscMat pM = NULL # <<<<<<<<<<<<<< * cdef Mat mm * cdef PetscInt i = -1 */ __pyx_v_pM = NULL; /* "petsc4py/PETSc/libpetsc4py.pyx":1203 * cdef PetscMat pM = NULL * cdef Mat mm * cdef PetscInt i = -1 # <<<<<<<<<<<<<< * for i in range(len(mats)): * if mats[i] is None: continue */ __pyx_v_i = -1L; /* "petsc4py/PETSc/libpetsc4py.pyx":1204 * cdef Mat mm * cdef PetscInt i = -1 * for i in range(len(mats)): # <<<<<<<<<<<<<< * if mats[i] is None: continue * mm = mats[i] */ __pyx_t_6 = __Pyx_PyTuple_GET_SIZE(__pyx_v_mats); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(11, 1204, __pyx_L1_error) __pyx_t_7 = __pyx_t_6; for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { __pyx_v_i = __pyx_t_8; /* "petsc4py/PETSc/libpetsc4py.pyx":1205 * cdef PetscInt i = -1 * for i in range(len(mats)): * if mats[i] is None: continue # <<<<<<<<<<<<<< * mm = mats[i] * pM = mm.mat */ __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_mats, __pyx_v_i, PetscInt, 1, __Pyx_PyInt_From_PetscInt, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 1205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = (__pyx_t_4 == Py_None); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_2) { goto __pyx_L8_continue; } /* "petsc4py/PETSc/libpetsc4py.pyx":1206 * for i in range(len(mats)): * if mats[i] is None: continue * mm = mats[i] # <<<<<<<<<<<<<< * pM = mm.mat * CHKERR( PetscObjectTypeCompare(pM, MATPYTHON, &mispy) ) */ __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_mats, __pyx_v_i, PetscInt, 1, __Pyx_PyInt_From_PetscInt, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 1206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(11, 1206, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_mm, ((struct PyPetscMatObject *)__pyx_t_4)); __pyx_t_4 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1207 * if mats[i] is None: continue * mm = mats[i] * pM = mm.mat # <<<<<<<<<<<<<< * CHKERR( PetscObjectTypeCompare(pM, MATPYTHON, &mispy) ) * if mispy: */ __pyx_v_pM = ((Mat)__pyx_v_mm->mat); /* "petsc4py/PETSc/libpetsc4py.pyx":1208 * mm = mats[i] * pM = mm.mat * CHKERR( PetscObjectTypeCompare(pM, MATPYTHON, &mispy) ) # <<<<<<<<<<<<<< * if mispy: * if PyMat(pM).productSetFromOptions is not None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectTypeCompare(((PetscObject)__pyx_v_pM), MATPYTHON, (&__pyx_v_mispy))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1208, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":1209 * pM = mm.mat * CHKERR( PetscObjectTypeCompare(pM, MATPYTHON, &mispy) ) * if mispy: # <<<<<<<<<<<<<< * if PyMat(pM).productSetFromOptions is not None: * found = PyMat(pM).productSetFromOptions(PyC if C == pM else PyB if B == pM else PyA, mtypes[mtype], *mats) */ if (__pyx_v_mispy) { /* "petsc4py/PETSc/libpetsc4py.pyx":1210 * CHKERR( PetscObjectTypeCompare(pM, MATPYTHON, &mispy) ) * if mispy: * if PyMat(pM).productSetFromOptions is not None: # <<<<<<<<<<<<<< * found = PyMat(pM).productSetFromOptions(PyC if C == pM else PyB if B == pM else PyA, mtypes[mtype], *mats) * if found: break */ __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyMat(__pyx_v_pM)); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 1210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_productSetFromOptions); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 1210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = (__pyx_t_5 != Py_None); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_2) { /* "petsc4py/PETSc/libpetsc4py.pyx":1211 * if mispy: * if PyMat(pM).productSetFromOptions is not None: * found = PyMat(pM).productSetFromOptions(PyC if C == pM else PyB if B == pM else PyA, mtypes[mtype], *mats) # <<<<<<<<<<<<<< * if found: break * if not found: */ __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyMat(__pyx_v_pM)); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 1211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_productSetFromOptions); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 1211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = (__pyx_v_C == __pyx_v_pM); if (__pyx_t_2) { __Pyx_INCREF((PyObject *)__pyx_v_PyC); __pyx_t_5 = ((PyObject *)__pyx_v_PyC); } else { __pyx_t_3 = (__pyx_v_B == __pyx_v_pM); if (__pyx_t_3) { __Pyx_INCREF((PyObject *)__pyx_v_PyB); __pyx_t_9 = ((PyObject *)__pyx_v_PyB); } else { __Pyx_INCREF((PyObject *)__pyx_v_PyA); __pyx_t_9 = ((PyObject *)__pyx_v_PyA); } __pyx_t_5 = __pyx_t_9; __pyx_t_9 = 0; } __pyx_t_9 = __Pyx_PyInt_From_MatProductType(__pyx_v_mtype); if (unlikely(!__pyx_t_9)) __PYX_ERR(11, 1211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyDict_GetItem(__pyx_v_mtypes, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(11, 1211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(11, 1211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5)) __PYX_ERR(11, 1211, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_10); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_10)) __PYX_ERR(11, 1211, __pyx_L1_error); __pyx_t_5 = 0; __pyx_t_10 = 0; __pyx_t_10 = PyNumber_Add(__pyx_t_9, __pyx_v_mats); if (unlikely(!__pyx_t_10)) __PYX_ERR(11, 1211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(11, 1211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF_SET(__pyx_v_found, __pyx_t_9); __pyx_t_9 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1212 * if PyMat(pM).productSetFromOptions is not None: * found = PyMat(pM).productSetFromOptions(PyC if C == pM else PyB if B == pM else PyA, mtypes[mtype], *mats) * if found: break # <<<<<<<<<<<<<< * if not found: * return FunctionEnd() */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_found); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(11, 1212, __pyx_L1_error) if (__pyx_t_2) { goto __pyx_L9_break; } /* "petsc4py/PETSc/libpetsc4py.pyx":1210 * CHKERR( PetscObjectTypeCompare(pM, MATPYTHON, &mispy) ) * if mispy: * if PyMat(pM).productSetFromOptions is not None: # <<<<<<<<<<<<<< * found = PyMat(pM).productSetFromOptions(PyC if C == pM else PyB if B == pM else PyA, mtypes[mtype], *mats) * if found: break */ } /* "petsc4py/PETSc/libpetsc4py.pyx":1209 * pM = mm.mat * CHKERR( PetscObjectTypeCompare(pM, MATPYTHON, &mispy) ) * if mispy: # <<<<<<<<<<<<<< * if PyMat(pM).productSetFromOptions is not None: * found = PyMat(pM).productSetFromOptions(PyC if C == pM else PyB if B == pM else PyA, mtypes[mtype], *mats) */ } __pyx_L8_continue:; } __pyx_L9_break:; /* "petsc4py/PETSc/libpetsc4py.pyx":1213 * found = PyMat(pM).productSetFromOptions(PyC if C == pM else PyB if B == pM else PyA, mtypes[mtype], *mats) * if found: break * if not found: # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_found); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(11, 1213, __pyx_L1_error) __pyx_t_3 = (!__pyx_t_2); if (__pyx_t_3) { /* "petsc4py/PETSc/libpetsc4py.pyx":1214 * if found: break * if not found: * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef MatOps ops = mat.ops */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":1213 * found = PyMat(pM).productSetFromOptions(PyC if C == pM else PyB if B == pM else PyA, mtypes[mtype], *mats) * if found: break * if not found: # <<<<<<<<<<<<<< * return FunctionEnd() * */ } /* "petsc4py/PETSc/libpetsc4py.pyx":1216 * return FunctionEnd() * * cdef MatOps ops = mat.ops # <<<<<<<<<<<<<< * ops.productsymbolic = MatProductSymbolic_Python * */ __pyx_t_11 = __pyx_v_mat->ops; __pyx_v_ops = __pyx_t_11; /* "petsc4py/PETSc/libpetsc4py.pyx":1217 * * cdef MatOps ops = mat.ops * ops.productsymbolic = MatProductSymbolic_Python # <<<<<<<<<<<<<< * * # Store index (within the product) of the Python matrix which is capable of performing the operation */ __pyx_v_ops->productsymbolic = __pyx_f_8petsc4py_5PETSc_MatProductSymbolic_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":1223 * # Symbolic operation will get this index and store it in the product data * global matmatid * if matmatid < 0: # <<<<<<<<<<<<<< * CHKERR( PetscObjectComposedDataRegisterPy(&matmatid) ) * CHKERR( PetscObjectComposedDataSetIntPy(mat, matmatid, i) ) */ __pyx_t_3 = (__pyx_v_8petsc4py_5PETSc_matmatid < 0); if (__pyx_t_3) { /* "petsc4py/PETSc/libpetsc4py.pyx":1224 * global matmatid * if matmatid < 0: * CHKERR( PetscObjectComposedDataRegisterPy(&matmatid) ) # <<<<<<<<<<<<<< * CHKERR( PetscObjectComposedDataSetIntPy(mat, matmatid, i) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectComposedDataRegisterPy((&__pyx_v_8petsc4py_5PETSc_matmatid))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1224, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":1223 * # Symbolic operation will get this index and store it in the product data * global matmatid * if matmatid < 0: # <<<<<<<<<<<<<< * CHKERR( PetscObjectComposedDataRegisterPy(&matmatid) ) * CHKERR( PetscObjectComposedDataSetIntPy(mat, matmatid, i) ) */ } /* "petsc4py/PETSc/libpetsc4py.pyx":1225 * if matmatid < 0: * CHKERR( PetscObjectComposedDataRegisterPy(&matmatid) ) * CHKERR( PetscObjectComposedDataSetIntPy(mat, matmatid, i) ) # <<<<<<<<<<<<<< * * return FunctionEnd() */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectComposedDataSetIntPy(((PetscObject)__pyx_v_mat), __pyx_v_8petsc4py_5PETSc_matmatid, __pyx_v_i)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1225, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":1227 * CHKERR( PetscObjectComposedDataSetIntPy(mat, matmatid, i) ) * * return FunctionEnd() # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":1169 * return FunctionEnd() * * cdef PetscErrorCode MatProductSetFromOptions_Python( # <<<<<<<<<<<<<< * PetscMat mat * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("petsc4py.PETSc.MatProductSetFromOptions_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_mtypes); __Pyx_XDECREF((PyObject *)__pyx_v_PyA); __Pyx_XDECREF((PyObject *)__pyx_v_PyB); __Pyx_XDECREF((PyObject *)__pyx_v_PyC); __Pyx_XDECREF(__pyx_v_mats); __Pyx_XDECREF(__pyx_v_found); __Pyx_XDECREF((PyObject *)__pyx_v_mm); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":1253 * @cython.internal * cdef class _PyPC(_PyObj): pass * cdef inline _PyPC PyPC(PetscPC pc): # <<<<<<<<<<<<<< * if pc != NULL and pc.data != NULL: * return <_PyPC>pc.data */ static CYTHON_INLINE struct __pyx_obj_8petsc4py_5PETSc__PyPC *__pyx_f_8petsc4py_5PETSc_PyPC(PC __pyx_v_pc) { struct __pyx_obj_8petsc4py_5PETSc__PyPC *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPC", 1); /* "petsc4py/PETSc/libpetsc4py.pyx":1254 * cdef class _PyPC(_PyObj): pass * cdef inline _PyPC PyPC(PetscPC pc): * if pc != NULL and pc.data != NULL: # <<<<<<<<<<<<<< * return <_PyPC>pc.data * else: */ __pyx_t_2 = (__pyx_v_pc != NULL); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = (__pyx_v_pc->data != NULL); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "petsc4py/PETSc/libpetsc4py.pyx":1255 * cdef inline _PyPC PyPC(PetscPC pc): * if pc != NULL and pc.data != NULL: * return <_PyPC>pc.data # <<<<<<<<<<<<<< * else: * return _PyPC.__new__(_PyPC) */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)((struct __pyx_obj_8petsc4py_5PETSc__PyPC *)__pyx_v_pc->data)); __pyx_r = ((struct __pyx_obj_8petsc4py_5PETSc__PyPC *)__pyx_v_pc->data); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":1254 * cdef class _PyPC(_PyObj): pass * cdef inline _PyPC PyPC(PetscPC pc): * if pc != NULL and pc.data != NULL: # <<<<<<<<<<<<<< * return <_PyPC>pc.data * else: */ } /* "petsc4py/PETSc/libpetsc4py.pyx":1257 * return <_PyPC>pc.data * else: * return _PyPC.__new__(_PyPC) # <<<<<<<<<<<<<< * * cdef public PetscErrorCode PCPythonGetContext(PetscPC pc, void **ctx) \ */ /*else*/ { __Pyx_XDECREF((PyObject *)__pyx_r); __pyx_t_3 = ((PyObject *)__pyx_tp_new_8petsc4py_5PETSc__PyPC(((PyTypeObject *)__pyx_ptype_8petsc4py_5PETSc__PyPC), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 1257, __pyx_L1_error) __Pyx_GOTREF((PyObject *)__pyx_t_3); __pyx_r = ((struct __pyx_obj_8petsc4py_5PETSc__PyPC *)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; } /* "petsc4py/PETSc/libpetsc4py.pyx":1253 * @cython.internal * cdef class _PyPC(_PyObj): pass * cdef inline _PyPC PyPC(PetscPC pc): # <<<<<<<<<<<<<< * if pc != NULL and pc.data != NULL: * return <_PyPC>pc.data */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.PyPC", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":1259 * return _PyPC.__new__(_PyPC) * * cdef public PetscErrorCode PCPythonGetContext(PetscPC pc, void **ctx) \ # <<<<<<<<<<<<<< * except PETSC_ERR_PYTHON: * FunctionBegin(b"PCPythonGetContext") */ PetscErrorCode PCPythonGetContext(PC __pyx_v_pc, void **__pyx_v_ctx) { PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PCPythonGetContext", 1); /* "petsc4py/PETSc/libpetsc4py.pyx":1261 * cdef public PetscErrorCode PCPythonGetContext(PetscPC pc, void **ctx) \ * except PETSC_ERR_PYTHON: * FunctionBegin(b"PCPythonGetContext") # <<<<<<<<<<<<<< * PyPC(pc).getcontext(ctx) * return FunctionEnd() */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"PCPythonGetContext")); /* "petsc4py/PETSc/libpetsc4py.pyx":1262 * except PETSC_ERR_PYTHON: * FunctionBegin(b"PCPythonGetContext") * PyPC(pc).getcontext(ctx) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyPC(__pyx_v_pc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__PyPC *)((struct __pyx_obj_8petsc4py_5PETSc__PyPC *)__pyx_t_1)->__pyx_base.__pyx_vtab)->__pyx_base.getcontext(((struct __pyx_obj_8petsc4py_5PETSc__PyObj *)__pyx_t_1), __pyx_v_ctx); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(11, 1262, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1263 * FunctionBegin(b"PCPythonGetContext") * PyPC(pc).getcontext(ctx) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef public PetscErrorCode PCPythonSetContext(PetscPC pc, void *ctx) \ */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":1259 * return _PyPC.__new__(_PyPC) * * cdef public PetscErrorCode PCPythonGetContext(PetscPC pc, void **ctx) \ # <<<<<<<<<<<<<< * except PETSC_ERR_PYTHON: * FunctionBegin(b"PCPythonGetContext") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PCPythonGetContext", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":1265 * return FunctionEnd() * * cdef public PetscErrorCode PCPythonSetContext(PetscPC pc, void *ctx) \ # <<<<<<<<<<<<<< * except PETSC_ERR_PYTHON: * FunctionBegin(b"PCPythonSetContext") */ PetscErrorCode PCPythonSetContext(PC __pyx_v_pc, void *__pyx_v_ctx) { PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PCPythonSetContext", 1); /* "petsc4py/PETSc/libpetsc4py.pyx":1267 * cdef public PetscErrorCode PCPythonSetContext(PetscPC pc, void *ctx) \ * except PETSC_ERR_PYTHON: * FunctionBegin(b"PCPythonSetContext") # <<<<<<<<<<<<<< * PyPC(pc).setcontext(ctx, PC_(pc)) * return FunctionEnd() */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"PCPythonSetContext")); /* "petsc4py/PETSc/libpetsc4py.pyx":1268 * except PETSC_ERR_PYTHON: * FunctionBegin(b"PCPythonSetContext") * PyPC(pc).setcontext(ctx, PC_(pc)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyPC(__pyx_v_pc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PC_(__pyx_v_pc)); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__PyPC *)((struct __pyx_obj_8petsc4py_5PETSc__PyPC *)__pyx_t_1)->__pyx_base.__pyx_vtab)->__pyx_base.setcontext(((struct __pyx_obj_8petsc4py_5PETSc__PyObj *)__pyx_t_1), __pyx_v_ctx, ((struct PyPetscObjectObject *)__pyx_t_2)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(11, 1268, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1269 * FunctionBegin(b"PCPythonSetContext") * PyPC(pc).setcontext(ctx, PC_(pc)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode PCPythonSetType_PYTHON(PetscPC pc, char name[]) \ */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":1265 * return FunctionEnd() * * cdef public PetscErrorCode PCPythonSetContext(PetscPC pc, void *ctx) \ # <<<<<<<<<<<<<< * except PETSC_ERR_PYTHON: * FunctionBegin(b"PCPythonSetContext") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.PCPythonSetContext", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":1271 * return FunctionEnd() * * cdef PetscErrorCode PCPythonSetType_PYTHON(PetscPC pc, char name[]) \ # <<<<<<<<<<<<<< * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"PCPythonSetType_PYTHON") */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCPythonSetType_PYTHON(PC __pyx_v_pc, char *__pyx_v_name) { PyObject *__pyx_v_ctx = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("PCPythonSetType_PYTHON", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":1273 * cdef PetscErrorCode PCPythonSetType_PYTHON(PetscPC pc, char name[]) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"PCPythonSetType_PYTHON") # <<<<<<<<<<<<<< * if name == NULL: return FunctionEnd() # XXX * cdef object ctx = createcontext(name) */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"PCPythonSetType_PYTHON")); /* "petsc4py/PETSc/libpetsc4py.pyx":1274 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"PCPythonSetType_PYTHON") * if name == NULL: return FunctionEnd() # XXX # <<<<<<<<<<<<<< * cdef object ctx = createcontext(name) * PCPythonSetContext(pc, ctx) */ __pyx_t_1 = (__pyx_v_name == NULL); if (__pyx_t_1) { __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; } /* "petsc4py/PETSc/libpetsc4py.pyx":1275 * FunctionBegin(b"PCPythonSetType_PYTHON") * if name == NULL: return FunctionEnd() # XXX * cdef object ctx = createcontext(name) # <<<<<<<<<<<<<< * PCPythonSetContext(pc, ctx) * PyPC(pc).setname(name) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_createcontext(__pyx_v_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_ctx = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1276 * if name == NULL: return FunctionEnd() # XXX * cdef object ctx = createcontext(name) * PCPythonSetContext(pc, ctx) # <<<<<<<<<<<<<< * PyPC(pc).setname(name) * return FunctionEnd() */ __pyx_t_3 = PCPythonSetContext(__pyx_v_pc, ((void *)__pyx_v_ctx)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1276, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":1277 * cdef object ctx = createcontext(name) * PCPythonSetContext(pc, ctx) * PyPC(pc).setname(name) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyPC(__pyx_v_pc)); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__PyPC *)((struct __pyx_obj_8petsc4py_5PETSc__PyPC *)__pyx_t_2)->__pyx_base.__pyx_vtab)->__pyx_base.setname(((struct __pyx_obj_8petsc4py_5PETSc__PyObj *)__pyx_t_2), __pyx_v_name); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(11, 1277, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1278 * PCPythonSetContext(pc, ctx) * PyPC(pc).setname(name) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode PCPythonGetType_PYTHON(PetscPC pc, const char *name[]) \ */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":1271 * return FunctionEnd() * * cdef PetscErrorCode PCPythonSetType_PYTHON(PetscPC pc, char name[]) \ # <<<<<<<<<<<<<< * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"PCPythonSetType_PYTHON") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.PCPythonSetType_PYTHON", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ctx); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":1280 * return FunctionEnd() * * cdef PetscErrorCode PCPythonGetType_PYTHON(PetscPC pc, const char *name[]) \ # <<<<<<<<<<<<<< * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"PCPythonGetType_PYTHON") */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCPythonGetType_PYTHON(PC __pyx_v_pc, char const **__pyx_v_name) { PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; char *__pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("PCPythonGetType_PYTHON", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":1282 * cdef PetscErrorCode PCPythonGetType_PYTHON(PetscPC pc, const char *name[]) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"PCPythonGetType_PYTHON") # <<<<<<<<<<<<<< * name[0] = PyPC(pc).getname() * return FunctionEnd() */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"PCPythonGetType_PYTHON")); /* "petsc4py/PETSc/libpetsc4py.pyx":1283 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"PCPythonGetType_PYTHON") * name[0] = PyPC(pc).getname() # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyPC(__pyx_v_pc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__PyPC *)((struct __pyx_obj_8petsc4py_5PETSc__PyPC *)__pyx_t_1)->__pyx_base.__pyx_vtab)->__pyx_base.getname(((struct __pyx_obj_8petsc4py_5PETSc__PyObj *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((char *)NULL) && PyErr_Occurred())) __PYX_ERR(11, 1283, __pyx_L1_error) (__pyx_v_name[0]) = __pyx_t_2; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1284 * FunctionBegin(b"PCPythonGetType_PYTHON") * name[0] = PyPC(pc).getname() * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode PCCreate_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":1280 * return FunctionEnd() * * cdef PetscErrorCode PCPythonGetType_PYTHON(PetscPC pc, const char *name[]) \ # <<<<<<<<<<<<<< * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"PCPythonGetType_PYTHON") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PCPythonGetType_PYTHON", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":1286 * return FunctionEnd() * * cdef PetscErrorCode PCCreate_Python( # <<<<<<<<<<<<<< * PetscPC pc, * ) \ */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCCreate_Python(PC __pyx_v_pc) { PCOps __pyx_v_ops; PyObject *__pyx_v_ctx = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PCOps __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("PCCreate_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":1290 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"PCCreate_Python") # <<<<<<<<<<<<<< * # * cdef PCOps ops = pc.ops */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"PCCreate_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":1292 * FunctionBegin(b"PCCreate_Python") * # * cdef PCOps ops = pc.ops # <<<<<<<<<<<<<< * ops.reset = PCReset_Python * ops.destroy = PCDestroy_Python */ __pyx_t_1 = __pyx_v_pc->ops; __pyx_v_ops = __pyx_t_1; /* "petsc4py/PETSc/libpetsc4py.pyx":1293 * # * cdef PCOps ops = pc.ops * ops.reset = PCReset_Python # <<<<<<<<<<<<<< * ops.destroy = PCDestroy_Python * ops.setup = PCSetUp_Python */ __pyx_v_ops->reset = __pyx_f_8petsc4py_5PETSc_PCReset_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":1294 * cdef PCOps ops = pc.ops * ops.reset = PCReset_Python * ops.destroy = PCDestroy_Python # <<<<<<<<<<<<<< * ops.setup = PCSetUp_Python * ops.setfromoptions = PCSetFromOptions_Python */ __pyx_v_ops->destroy = __pyx_f_8petsc4py_5PETSc_PCDestroy_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":1295 * ops.reset = PCReset_Python * ops.destroy = PCDestroy_Python * ops.setup = PCSetUp_Python # <<<<<<<<<<<<<< * ops.setfromoptions = PCSetFromOptions_Python * ops.view = PCView_Python */ __pyx_v_ops->setup = __pyx_f_8petsc4py_5PETSc_PCSetUp_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":1296 * ops.destroy = PCDestroy_Python * ops.setup = PCSetUp_Python * ops.setfromoptions = PCSetFromOptions_Python # <<<<<<<<<<<<<< * ops.view = PCView_Python * ops.presolve = PCPreSolve_Python */ __pyx_v_ops->setfromoptions = __pyx_f_8petsc4py_5PETSc_PCSetFromOptions_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":1297 * ops.setup = PCSetUp_Python * ops.setfromoptions = PCSetFromOptions_Python * ops.view = PCView_Python # <<<<<<<<<<<<<< * ops.presolve = PCPreSolve_Python * ops.postsolve = PCPostSolve_Python */ __pyx_v_ops->view = __pyx_f_8petsc4py_5PETSc_PCView_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":1298 * ops.setfromoptions = PCSetFromOptions_Python * ops.view = PCView_Python * ops.presolve = PCPreSolve_Python # <<<<<<<<<<<<<< * ops.postsolve = PCPostSolve_Python * ops.apply = PCApply_Python */ __pyx_v_ops->presolve = __pyx_f_8petsc4py_5PETSc_PCPreSolve_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":1299 * ops.view = PCView_Python * ops.presolve = PCPreSolve_Python * ops.postsolve = PCPostSolve_Python # <<<<<<<<<<<<<< * ops.apply = PCApply_Python * ops.matapply = PCMatApply_Python */ __pyx_v_ops->postsolve = __pyx_f_8petsc4py_5PETSc_PCPostSolve_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":1300 * ops.presolve = PCPreSolve_Python * ops.postsolve = PCPostSolve_Python * ops.apply = PCApply_Python # <<<<<<<<<<<<<< * ops.matapply = PCMatApply_Python * ops.applytranspose = PCApplyTranspose_Python */ __pyx_v_ops->apply = __pyx_f_8petsc4py_5PETSc_PCApply_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":1301 * ops.postsolve = PCPostSolve_Python * ops.apply = PCApply_Python * ops.matapply = PCMatApply_Python # <<<<<<<<<<<<<< * ops.applytranspose = PCApplyTranspose_Python * ops.applysymmetricleft = PCApplySymmetricLeft_Python */ __pyx_v_ops->matapply = __pyx_f_8petsc4py_5PETSc_PCMatApply_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":1302 * ops.apply = PCApply_Python * ops.matapply = PCMatApply_Python * ops.applytranspose = PCApplyTranspose_Python # <<<<<<<<<<<<<< * ops.applysymmetricleft = PCApplySymmetricLeft_Python * ops.applysymmetricright = PCApplySymmetricRight_Python */ __pyx_v_ops->applytranspose = __pyx_f_8petsc4py_5PETSc_PCApplyTranspose_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":1303 * ops.matapply = PCMatApply_Python * ops.applytranspose = PCApplyTranspose_Python * ops.applysymmetricleft = PCApplySymmetricLeft_Python # <<<<<<<<<<<<<< * ops.applysymmetricright = PCApplySymmetricRight_Python * # */ __pyx_v_ops->applysymmetricleft = __pyx_f_8petsc4py_5PETSc_PCApplySymmetricLeft_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":1304 * ops.applytranspose = PCApplyTranspose_Python * ops.applysymmetricleft = PCApplySymmetricLeft_Python * ops.applysymmetricright = PCApplySymmetricRight_Python # <<<<<<<<<<<<<< * # * CHKERR( PetscObjectComposeFunction( */ __pyx_v_ops->applysymmetricright = __pyx_f_8petsc4py_5PETSc_PCApplySymmetricRight_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":1306 * ops.applysymmetricright = PCApplySymmetricRight_Python * # * CHKERR( PetscObjectComposeFunction( # <<<<<<<<<<<<<< * pc, b"PCPythonSetType_C", * PCPythonSetType_PYTHON) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectComposeFunction(((PetscObject)__pyx_v_pc), ((char *)"PCPythonSetType_C"), ((PetscVoidFunction)__pyx_f_8petsc4py_5PETSc_PCPythonSetType_PYTHON))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1306, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":1309 * pc, b"PCPythonSetType_C", * PCPythonSetType_PYTHON) ) * CHKERR( PetscObjectComposeFunction( # <<<<<<<<<<<<<< * pc, b"PCPythonGetType_C", * PCPythonGetType_PYTHON) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectComposeFunction(((PetscObject)__pyx_v_pc), ((char *)"PCPythonGetType_C"), ((PetscVoidFunction)__pyx_f_8petsc4py_5PETSc_PCPythonGetType_PYTHON))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1309, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":1313 * PCPythonGetType_PYTHON) ) * # * cdef ctx = PyPC(NULL) # <<<<<<<<<<<<<< * pc.data = ctx * Py_INCREF(pc.data) */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyPC(NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 1313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_ctx = __pyx_t_3; __pyx_t_3 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1314 * # * cdef ctx = PyPC(NULL) * pc.data = ctx # <<<<<<<<<<<<<< * Py_INCREF(pc.data) * return FunctionEnd() */ __pyx_v_pc->data = ((void *)__pyx_v_ctx); /* "petsc4py/PETSc/libpetsc4py.pyx":1315 * cdef ctx = PyPC(NULL) * pc.data = ctx * Py_INCREF(pc.data) # <<<<<<<<<<<<<< * return FunctionEnd() * */ Py_INCREF(((PyObject *)__pyx_v_pc->data)); /* "petsc4py/PETSc/libpetsc4py.pyx":1316 * pc.data = ctx * Py_INCREF(pc.data) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef inline PetscErrorCode PCDestroy_Python_inner( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":1286 * return FunctionEnd() * * cdef PetscErrorCode PCCreate_Python( # <<<<<<<<<<<<<< * PetscPC pc, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.PCCreate_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ctx); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":1318 * return FunctionEnd() * * cdef inline PetscErrorCode PCDestroy_Python_inner( # <<<<<<<<<<<<<< * PetscPC pc, * ) \ */ static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCDestroy_Python_inner(PC __pyx_v_pc) { PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_t_2; int __pyx_t_3; char const *__pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("PCDestroy_Python_inner", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":1322 * ) \ * except PETSC_ERR_PYTHON with gil: * try: # <<<<<<<<<<<<<< * addRef(pc) * PCPythonSetContext(pc, NULL) */ /*try:*/ { /* "petsc4py/PETSc/libpetsc4py.pyx":1323 * except PETSC_ERR_PYTHON with gil: * try: * addRef(pc) # <<<<<<<<<<<<<< * PCPythonSetContext(pc, NULL) * finally: */ __pyx_f_8petsc4py_5PETSc_addRef(__pyx_v_pc); /* "petsc4py/PETSc/libpetsc4py.pyx":1324 * try: * addRef(pc) * PCPythonSetContext(pc, NULL) # <<<<<<<<<<<<<< * finally: * delRef(pc) */ __pyx_t_1 = PCPythonSetContext(__pyx_v_pc, NULL); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1324, __pyx_L4_error) } /* "petsc4py/PETSc/libpetsc4py.pyx":1326 * PCPythonSetContext(pc, NULL) * finally: * delRef(pc) # <<<<<<<<<<<<<< * Py_DECREF(pc.data) * pc.data = NULL */ /*finally:*/ { /*normal exit:*/{ __pyx_f_8petsc4py_5PETSc_delRef(__pyx_v_pc); /* "petsc4py/PETSc/libpetsc4py.pyx":1327 * finally: * delRef(pc) * Py_DECREF(pc.data) # <<<<<<<<<<<<<< * pc.data = NULL * return PETSC_SUCCESS */ Py_DECREF(((PyObject *)__pyx_v_pc->data)); /* "petsc4py/PETSc/libpetsc4py.pyx":1328 * delRef(pc) * Py_DECREF(pc.data) * pc.data = NULL # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_v_pc->data = NULL; goto __pyx_L5; } __pyx_L4_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0)) __Pyx_ErrFetch(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __pyx_t_2 = __pyx_lineno; __pyx_t_3 = __pyx_clineno; __pyx_t_4 = __pyx_filename; { /* "petsc4py/PETSc/libpetsc4py.pyx":1326 * PCPythonSetContext(pc, NULL) * finally: * delRef(pc) # <<<<<<<<<<<<<< * Py_DECREF(pc.data) * pc.data = NULL */ __pyx_f_8petsc4py_5PETSc_delRef(__pyx_v_pc); /* "petsc4py/PETSc/libpetsc4py.pyx":1327 * finally: * delRef(pc) * Py_DECREF(pc.data) # <<<<<<<<<<<<<< * pc.data = NULL * return PETSC_SUCCESS */ Py_DECREF(((PyObject *)__pyx_v_pc->data)); /* "petsc4py/PETSc/libpetsc4py.pyx":1328 * delRef(pc) * Py_DECREF(pc.data) * pc.data = NULL # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_v_pc->data = NULL; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); } __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_ErrRestore(__pyx_t_5, __pyx_t_6, __pyx_t_7); __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_lineno = __pyx_t_2; __pyx_clineno = __pyx_t_3; __pyx_filename = __pyx_t_4; goto __pyx_L1_error; } __pyx_L5:; } /* "petsc4py/PETSc/libpetsc4py.pyx":1329 * Py_DECREF(pc.data) * pc.data = NULL * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * cdef PetscErrorCode PCDestroy_Python( */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":1318 * return FunctionEnd() * * cdef inline PetscErrorCode PCDestroy_Python_inner( # <<<<<<<<<<<<<< * PetscPC pc, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PCDestroy_Python_inner", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":1331 * return PETSC_SUCCESS * * cdef PetscErrorCode PCDestroy_Python( # <<<<<<<<<<<<<< * PetscPC pc, * ) \ */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCDestroy_Python(PC __pyx_v_pc) { PetscErrorCode __pyx_r; PetscErrorCode __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save; #endif /* "petsc4py/PETSc/libpetsc4py.pyx":1335 * ) \ * except PETSC_ERR_PYTHON nogil: * FunctionBegin(b"PCDestroy_Python") # <<<<<<<<<<<<<< * CHKERR( PetscObjectComposeFunction( * pc, b"PCPythonSetType_C", */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"PCDestroy_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":1336 * except PETSC_ERR_PYTHON nogil: * FunctionBegin(b"PCDestroy_Python") * CHKERR( PetscObjectComposeFunction( # <<<<<<<<<<<<<< * pc, b"PCPythonSetType_C", * NULL) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectComposeFunction(((PetscObject)__pyx_v_pc), ((char *)"PCPythonSetType_C"), ((PetscVoidFunction)NULL))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1336, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":1339 * pc, b"PCPythonSetType_C", * NULL) ) * CHKERR( PetscObjectComposeFunction( # <<<<<<<<<<<<<< * pc, b"PCPythonGetType_C", * NULL) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectComposeFunction(((PetscObject)__pyx_v_pc), ((char *)"PCPythonGetType_C"), ((PetscVoidFunction)NULL))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1339, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":1343 * NULL) ) * # * if Py_IsInitialized(): PCDestroy_Python_inner(pc) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_2 = (Py_IsInitialized() != 0); if (__pyx_t_2) { __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_PCDestroy_Python_inner(__pyx_v_pc); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1343, __pyx_L1_error) } /* "petsc4py/PETSc/libpetsc4py.pyx":1344 * # * if Py_IsInitialized(): PCDestroy_Python_inner(pc) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode PCSetUp_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":1331 * return PETSC_SUCCESS * * cdef PetscErrorCode PCDestroy_Python( # <<<<<<<<<<<<<< * PetscPC pc, * ) \ */ /* function exit code */ __pyx_L1_error:; #ifdef WITH_THREAD __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_AddTraceback("petsc4py.PETSc.PCDestroy_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":1346 * return FunctionEnd() * * cdef PetscErrorCode PCSetUp_Python( # <<<<<<<<<<<<<< * PetscPC pc, * ) \ */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCSetUp_Python(PC __pyx_v_pc) { char __pyx_v_name[0x800]; PetscBool __pyx_v_found; PyObject *__pyx_v_setUp = 0; PyObject *__pyx_v_o = 0; PCOps __pyx_v_ops; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_t_4; PetscErrorCode __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; PCOps __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("PCSetUp_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":1350 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"PCSetUp_Python") # <<<<<<<<<<<<<< * # * cdef char name[2048] */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"PCSetUp_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":1353 * # * cdef char name[2048] * cdef PetscBool found = PETSC_FALSE # <<<<<<<<<<<<<< * if PyPC(pc).self is None: * CHKERR( PetscOptionsGetString(NULL, */ __pyx_v_found = PETSC_FALSE; /* "petsc4py/PETSc/libpetsc4py.pyx":1354 * cdef char name[2048] * cdef PetscBool found = PETSC_FALSE * if PyPC(pc).self is None: # <<<<<<<<<<<<<< * CHKERR( PetscOptionsGetString(NULL, * getPrefix(pc), b"-pc_python_type", */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyPC(__pyx_v_pc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (((struct __pyx_obj_8petsc4py_5PETSc__PyPC *)__pyx_t_1)->__pyx_base.self == Py_None); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "petsc4py/PETSc/libpetsc4py.pyx":1355 * cdef PetscBool found = PETSC_FALSE * if PyPC(pc).self is None: * CHKERR( PetscOptionsGetString(NULL, # <<<<<<<<<<<<<< * getPrefix(pc), b"-pc_python_type", * name, sizeof(name), &found) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsGetString(NULL, __pyx_f_8petsc4py_5PETSc_getPrefix(__pyx_v_pc), ((char *)"-pc_python_type"), __pyx_v_name, (sizeof(__pyx_v_name)), (&__pyx_v_found))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1355, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":1358 * getPrefix(pc), b"-pc_python_type", * name, sizeof(name), &found) ) * if found and name[0]: # <<<<<<<<<<<<<< * CHKERR( PCPythonSetType_PYTHON(pc, name) ) * if PyPC(pc).self is None: */ if (__pyx_v_found) { } else { __pyx_t_2 = __pyx_v_found; goto __pyx_L5_bool_binop_done; } __pyx_t_4 = ((__pyx_v_name[0]) != 0); __pyx_t_2 = __pyx_t_4; __pyx_L5_bool_binop_done:; if (__pyx_t_2) { /* "petsc4py/PETSc/libpetsc4py.pyx":1359 * name, sizeof(name), &found) ) * if found and name[0]: * CHKERR( PCPythonSetType_PYTHON(pc, name) ) # <<<<<<<<<<<<<< * if PyPC(pc).self is None: * return PetscSETERR(PETSC_ERR_USER, */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_PCPythonSetType_PYTHON(__pyx_v_pc, __pyx_v_name); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1359, __pyx_L1_error) __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_t_3); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1359, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":1358 * getPrefix(pc), b"-pc_python_type", * name, sizeof(name), &found) ) * if found and name[0]: # <<<<<<<<<<<<<< * CHKERR( PCPythonSetType_PYTHON(pc, name) ) * if PyPC(pc).self is None: */ } /* "petsc4py/PETSc/libpetsc4py.pyx":1354 * cdef char name[2048] * cdef PetscBool found = PETSC_FALSE * if PyPC(pc).self is None: # <<<<<<<<<<<<<< * CHKERR( PetscOptionsGetString(NULL, * getPrefix(pc), b"-pc_python_type", */ } /* "petsc4py/PETSc/libpetsc4py.pyx":1360 * if found and name[0]: * CHKERR( PCPythonSetType_PYTHON(pc, name) ) * if PyPC(pc).self is None: # <<<<<<<<<<<<<< * return PetscSETERR(PETSC_ERR_USER, * "Python context not set, call one of \n" */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyPC(__pyx_v_pc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (((struct __pyx_obj_8petsc4py_5PETSc__PyPC *)__pyx_t_1)->__pyx_base.self == Py_None); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "petsc4py/PETSc/libpetsc4py.pyx":1361 * CHKERR( PCPythonSetType_PYTHON(pc, name) ) * if PyPC(pc).self is None: * return PetscSETERR(PETSC_ERR_USER, # <<<<<<<<<<<<<< * "Python context not set, call one of \n" * " * PCPythonSetType(pc, \"[package.]module.class\")\n" */ __pyx_r = __pyx_f_8petsc4py_5PETSc_PetscSETERR(PETSC_ERR_USER, ((char *)"Python context not set, call one of \n * PCPythonSetType(pc, \"[package.]module.class\")\n * PCSetFromOptions(pc) and pass option -pc_python_type [package.]module.class")); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":1360 * if found and name[0]: * CHKERR( PCPythonSetType_PYTHON(pc, name) ) * if PyPC(pc).self is None: # <<<<<<<<<<<<<< * return PetscSETERR(PETSC_ERR_USER, * "Python context not set, call one of \n" */ } /* "petsc4py/PETSc/libpetsc4py.pyx":1367 * "-pc_python_type [package.]module.class") * # * cdef setUp = PyPC(pc).setUp # <<<<<<<<<<<<<< * if setUp is not None: * setUp(PC_(pc)) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyPC(__pyx_v_pc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_setUp); if (unlikely(!__pyx_t_6)) __PYX_ERR(11, 1367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_setUp = __pyx_t_6; __pyx_t_6 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1368 * # * cdef setUp = PyPC(pc).setUp * if setUp is not None: # <<<<<<<<<<<<<< * setUp(PC_(pc)) * # */ __pyx_t_2 = (__pyx_v_setUp != Py_None); if (__pyx_t_2) { /* "petsc4py/PETSc/libpetsc4py.pyx":1369 * cdef setUp = PyPC(pc).setUp * if setUp is not None: * setUp(PC_(pc)) # <<<<<<<<<<<<<< * # * cdef o = PyPC(pc) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PC_(__pyx_v_pc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1369, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_setUp); __pyx_t_7 = __pyx_v_setUp; __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_1}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(11, 1369, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1368 * # * cdef setUp = PyPC(pc).setUp * if setUp is not None: # <<<<<<<<<<<<<< * setUp(PC_(pc)) * # */ } /* "petsc4py/PETSc/libpetsc4py.pyx":1371 * setUp(PC_(pc)) * # * cdef o = PyPC(pc) # <<<<<<<<<<<<<< * cdef PCOps ops = pc.ops * if o.applyTranspose is None: */ __pyx_t_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyPC(__pyx_v_pc)); if (unlikely(!__pyx_t_6)) __PYX_ERR(11, 1371, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_o = __pyx_t_6; __pyx_t_6 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1372 * # * cdef o = PyPC(pc) * cdef PCOps ops = pc.ops # <<<<<<<<<<<<<< * if o.applyTranspose is None: * ops.applytranspose = NULL */ __pyx_t_10 = __pyx_v_pc->ops; __pyx_v_ops = __pyx_t_10; /* "petsc4py/PETSc/libpetsc4py.pyx":1373 * cdef o = PyPC(pc) * cdef PCOps ops = pc.ops * if o.applyTranspose is None: # <<<<<<<<<<<<<< * ops.applytranspose = NULL * if o.applySymmetricLeft is None: */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_o, __pyx_n_s_applyTranspose); if (unlikely(!__pyx_t_6)) __PYX_ERR(11, 1373, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = (__pyx_t_6 == Py_None); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_2) { /* "petsc4py/PETSc/libpetsc4py.pyx":1374 * cdef PCOps ops = pc.ops * if o.applyTranspose is None: * ops.applytranspose = NULL # <<<<<<<<<<<<<< * if o.applySymmetricLeft is None: * ops.applysymmetricleft = NULL */ __pyx_v_ops->applytranspose = NULL; /* "petsc4py/PETSc/libpetsc4py.pyx":1373 * cdef o = PyPC(pc) * cdef PCOps ops = pc.ops * if o.applyTranspose is None: # <<<<<<<<<<<<<< * ops.applytranspose = NULL * if o.applySymmetricLeft is None: */ } /* "petsc4py/PETSc/libpetsc4py.pyx":1375 * if o.applyTranspose is None: * ops.applytranspose = NULL * if o.applySymmetricLeft is None: # <<<<<<<<<<<<<< * ops.applysymmetricleft = NULL * if o.applySymmetricRight is None: */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_o, __pyx_n_s_applySymmetricLeft); if (unlikely(!__pyx_t_6)) __PYX_ERR(11, 1375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = (__pyx_t_6 == Py_None); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_2) { /* "petsc4py/PETSc/libpetsc4py.pyx":1376 * ops.applytranspose = NULL * if o.applySymmetricLeft is None: * ops.applysymmetricleft = NULL # <<<<<<<<<<<<<< * if o.applySymmetricRight is None: * ops.applysymmetricright = NULL */ __pyx_v_ops->applysymmetricleft = NULL; /* "petsc4py/PETSc/libpetsc4py.pyx":1375 * if o.applyTranspose is None: * ops.applytranspose = NULL * if o.applySymmetricLeft is None: # <<<<<<<<<<<<<< * ops.applysymmetricleft = NULL * if o.applySymmetricRight is None: */ } /* "petsc4py/PETSc/libpetsc4py.pyx":1377 * if o.applySymmetricLeft is None: * ops.applysymmetricleft = NULL * if o.applySymmetricRight is None: # <<<<<<<<<<<<<< * ops.applysymmetricright = NULL * # */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_o, __pyx_n_s_applySymmetricRight); if (unlikely(!__pyx_t_6)) __PYX_ERR(11, 1377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = (__pyx_t_6 == Py_None); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_2) { /* "petsc4py/PETSc/libpetsc4py.pyx":1378 * ops.applysymmetricleft = NULL * if o.applySymmetricRight is None: * ops.applysymmetricright = NULL # <<<<<<<<<<<<<< * # * return FunctionEnd() */ __pyx_v_ops->applysymmetricright = NULL; /* "petsc4py/PETSc/libpetsc4py.pyx":1377 * if o.applySymmetricLeft is None: * ops.applysymmetricleft = NULL * if o.applySymmetricRight is None: # <<<<<<<<<<<<<< * ops.applysymmetricright = NULL * # */ } /* "petsc4py/PETSc/libpetsc4py.pyx":1380 * ops.applysymmetricright = NULL * # * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef inline PetscErrorCode PCReset_Python_inner( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":1346 * return FunctionEnd() * * cdef PetscErrorCode PCSetUp_Python( # <<<<<<<<<<<<<< * PetscPC pc, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("petsc4py.PETSc.PCSetUp_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_setUp); __Pyx_XDECREF(__pyx_v_o); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":1382 * return FunctionEnd() * * cdef inline PetscErrorCode PCReset_Python_inner( # <<<<<<<<<<<<<< * PetscPC pc, * ) \ */ static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCReset_Python_inner(PC __pyx_v_pc) { PyObject *__pyx_v_reset = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("PCReset_Python_inner", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":1386 * ) \ * except PETSC_ERR_PYTHON with gil: * cdef reset = PyPC(pc).reset # <<<<<<<<<<<<<< * if reset is not None: * reset(PC_(pc)) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyPC(__pyx_v_pc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_reset); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_reset = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1387 * except PETSC_ERR_PYTHON with gil: * cdef reset = PyPC(pc).reset * if reset is not None: # <<<<<<<<<<<<<< * reset(PC_(pc)) * return PETSC_SUCCESS */ __pyx_t_3 = (__pyx_v_reset != Py_None); if (__pyx_t_3) { /* "petsc4py/PETSc/libpetsc4py.pyx":1388 * cdef reset = PyPC(pc).reset * if reset is not None: * reset(PC_(pc)) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PC_(__pyx_v_pc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1388, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_reset); __pyx_t_4 = __pyx_v_reset; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_1}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1388, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1387 * except PETSC_ERR_PYTHON with gil: * cdef reset = PyPC(pc).reset * if reset is not None: # <<<<<<<<<<<<<< * reset(PC_(pc)) * return PETSC_SUCCESS */ } /* "petsc4py/PETSc/libpetsc4py.pyx":1389 * if reset is not None: * reset(PC_(pc)) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * cdef PetscErrorCode PCReset_Python( */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":1382 * return FunctionEnd() * * cdef inline PetscErrorCode PCReset_Python_inner( # <<<<<<<<<<<<<< * PetscPC pc, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.PCReset_Python_inner", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_reset); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":1391 * return PETSC_SUCCESS * * cdef PetscErrorCode PCReset_Python( # <<<<<<<<<<<<<< * PetscPC pc, * ) \ */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCReset_Python(PC __pyx_v_pc) { PetscErrorCode __pyx_r; int __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save; #endif /* "petsc4py/PETSc/libpetsc4py.pyx":1395 * ) \ * except PETSC_ERR_PYTHON nogil: * if getRef(pc) == 0: return PETSC_SUCCESS # <<<<<<<<<<<<<< * FunctionBegin(b"PCReset_Python") * if Py_IsInitialized(): PCReset_Python_inner(pc) */ __pyx_t_1 = (__pyx_f_8petsc4py_5PETSc_getRef(__pyx_v_pc) == 0); if (__pyx_t_1) { __pyx_r = PETSC_SUCCESS; goto __pyx_L0; } /* "petsc4py/PETSc/libpetsc4py.pyx":1396 * except PETSC_ERR_PYTHON nogil: * if getRef(pc) == 0: return PETSC_SUCCESS * FunctionBegin(b"PCReset_Python") # <<<<<<<<<<<<<< * if Py_IsInitialized(): PCReset_Python_inner(pc) * return FunctionEnd() */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"PCReset_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":1397 * if getRef(pc) == 0: return PETSC_SUCCESS * FunctionBegin(b"PCReset_Python") * if Py_IsInitialized(): PCReset_Python_inner(pc) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = (Py_IsInitialized() != 0); if (__pyx_t_1) { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_PCReset_Python_inner(__pyx_v_pc); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1397, __pyx_L1_error) } /* "petsc4py/PETSc/libpetsc4py.pyx":1398 * FunctionBegin(b"PCReset_Python") * if Py_IsInitialized(): PCReset_Python_inner(pc) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode PCSetFromOptions_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":1391 * return PETSC_SUCCESS * * cdef PetscErrorCode PCReset_Python( # <<<<<<<<<<<<<< * PetscPC pc, * ) \ */ /* function exit code */ __pyx_L1_error:; #ifdef WITH_THREAD __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_AddTraceback("petsc4py.PETSc.PCReset_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":1400 * return FunctionEnd() * * cdef PetscErrorCode PCSetFromOptions_Python( # <<<<<<<<<<<<<< * PetscPC pc, * PetscOptionItems *PetscOptionsObject, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCSetFromOptions_Python(PC __pyx_v_pc, PetscOptionItems *__pyx_v_PetscOptionsObject) { char __pyx_v_name[0x800]; char *__pyx_v_defval; PetscBool __pyx_v_found; PetscOptionItems *PetscOptionsObject; PyObject *__pyx_v_setFromOptions = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; char *__pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_t_4; int __pyx_t_5; PetscErrorCode __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("PCSetFromOptions_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":1405 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"PCSetFromOptions_Python") # <<<<<<<<<<<<<< * # * cdef char name[2048], *defval = PyPC(pc).getname() */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"PCSetFromOptions_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":1407 * FunctionBegin(b"PCSetFromOptions_Python") * # * cdef char name[2048], *defval = PyPC(pc).getname() # <<<<<<<<<<<<<< * cdef PetscBool found = PETSC_FALSE * cdef PetscOptionItems *opts "PetscOptionsObject" = PetscOptionsObject */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyPC(__pyx_v_pc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1407, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__PyPC *)((struct __pyx_obj_8petsc4py_5PETSc__PyPC *)__pyx_t_1)->__pyx_base.__pyx_vtab)->__pyx_base.getname(((struct __pyx_obj_8petsc4py_5PETSc__PyObj *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((char *)NULL) && PyErr_Occurred())) __PYX_ERR(11, 1407, __pyx_L1_error) __pyx_v_defval = __pyx_t_2; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1408 * # * cdef char name[2048], *defval = PyPC(pc).getname() * cdef PetscBool found = PETSC_FALSE # <<<<<<<<<<<<<< * cdef PetscOptionItems *opts "PetscOptionsObject" = PetscOptionsObject * CHKERR( PetscOptionsString( */ __pyx_v_found = PETSC_FALSE; /* "petsc4py/PETSc/libpetsc4py.pyx":1409 * cdef char name[2048], *defval = PyPC(pc).getname() * cdef PetscBool found = PETSC_FALSE * cdef PetscOptionItems *opts "PetscOptionsObject" = PetscOptionsObject # <<<<<<<<<<<<<< * CHKERR( PetscOptionsString( * b"-pc_python_type", b"Python [package.]module[.{class|function}]", */ PetscOptionsObject = __pyx_v_PetscOptionsObject; /* "petsc4py/PETSc/libpetsc4py.pyx":1410 * cdef PetscBool found = PETSC_FALSE * cdef PetscOptionItems *opts "PetscOptionsObject" = PetscOptionsObject * CHKERR( PetscOptionsString( # <<<<<<<<<<<<<< * b"-pc_python_type", b"Python [package.]module[.{class|function}]", * b"PCPythonSetType", defval, name, sizeof(name), &found) ); opts; */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsString(((char *)"-pc_python_type"), ((char *)"Python [package.]module[.{class|function}]"), ((char *)"PCPythonSetType"), __pyx_v_defval, __pyx_v_name, (sizeof(__pyx_v_name)), (&__pyx_v_found))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1410, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":1412 * CHKERR( PetscOptionsString( * b"-pc_python_type", b"Python [package.]module[.{class|function}]", * b"PCPythonSetType", defval, name, sizeof(name), &found) ); opts; # <<<<<<<<<<<<<< * if found and name[0]: * CHKERR( PCPythonSetType_PYTHON(pc, name) ) */ ((void)PetscOptionsObject); /* "petsc4py/PETSc/libpetsc4py.pyx":1413 * b"-pc_python_type", b"Python [package.]module[.{class|function}]", * b"PCPythonSetType", defval, name, sizeof(name), &found) ); opts; * if found and name[0]: # <<<<<<<<<<<<<< * CHKERR( PCPythonSetType_PYTHON(pc, name) ) * # */ if (__pyx_v_found) { } else { __pyx_t_4 = __pyx_v_found; goto __pyx_L4_bool_binop_done; } __pyx_t_5 = ((__pyx_v_name[0]) != 0); __pyx_t_4 = __pyx_t_5; __pyx_L4_bool_binop_done:; if (__pyx_t_4) { /* "petsc4py/PETSc/libpetsc4py.pyx":1414 * b"PCPythonSetType", defval, name, sizeof(name), &found) ); opts; * if found and name[0]: * CHKERR( PCPythonSetType_PYTHON(pc, name) ) # <<<<<<<<<<<<<< * # * cdef setFromOptions = PyPC(pc).setFromOptions */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_PCPythonSetType_PYTHON(__pyx_v_pc, __pyx_v_name); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1414, __pyx_L1_error) __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_t_3); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1414, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":1413 * b"-pc_python_type", b"Python [package.]module[.{class|function}]", * b"PCPythonSetType", defval, name, sizeof(name), &found) ); opts; * if found and name[0]: # <<<<<<<<<<<<<< * CHKERR( PCPythonSetType_PYTHON(pc, name) ) * # */ } /* "petsc4py/PETSc/libpetsc4py.pyx":1416 * CHKERR( PCPythonSetType_PYTHON(pc, name) ) * # * cdef setFromOptions = PyPC(pc).setFromOptions # <<<<<<<<<<<<<< * if setFromOptions is not None: * setFromOptions(PC_(pc)) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyPC(__pyx_v_pc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_setFromOptions); if (unlikely(!__pyx_t_7)) __PYX_ERR(11, 1416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_setFromOptions = __pyx_t_7; __pyx_t_7 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1417 * # * cdef setFromOptions = PyPC(pc).setFromOptions * if setFromOptions is not None: # <<<<<<<<<<<<<< * setFromOptions(PC_(pc)) * return FunctionEnd() */ __pyx_t_4 = (__pyx_v_setFromOptions != Py_None); if (__pyx_t_4) { /* "petsc4py/PETSc/libpetsc4py.pyx":1418 * cdef setFromOptions = PyPC(pc).setFromOptions * if setFromOptions is not None: * setFromOptions(PC_(pc)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PC_(__pyx_v_pc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1418, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_setFromOptions); __pyx_t_8 = __pyx_v_setFromOptions; __pyx_t_9 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_8))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_1}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(11, 1418, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1417 * # * cdef setFromOptions = PyPC(pc).setFromOptions * if setFromOptions is not None: # <<<<<<<<<<<<<< * setFromOptions(PC_(pc)) * return FunctionEnd() */ } /* "petsc4py/PETSc/libpetsc4py.pyx":1419 * if setFromOptions is not None: * setFromOptions(PC_(pc)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode PCView_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":1400 * return FunctionEnd() * * cdef PetscErrorCode PCSetFromOptions_Python( # <<<<<<<<<<<<<< * PetscPC pc, * PetscOptionItems *PetscOptionsObject, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("petsc4py.PETSc.PCSetFromOptions_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_setFromOptions); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":1421 * return FunctionEnd() * * cdef PetscErrorCode PCView_Python( # <<<<<<<<<<<<<< * PetscPC pc, * PetscViewer vwr, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCView_Python(PC __pyx_v_pc, PetscViewer __pyx_v_vwr) { PyObject *__pyx_v_view = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("PCView_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":1426 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"PCView_Python") # <<<<<<<<<<<<<< * viewcontext(PyPC(pc), vwr) * cdef view = PyPC(pc).view */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"PCView_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":1427 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"PCView_Python") * viewcontext(PyPC(pc), vwr) # <<<<<<<<<<<<<< * cdef view = PyPC(pc).view * if view is not None: */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyPC(__pyx_v_pc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_viewcontext(((struct __pyx_obj_8petsc4py_5PETSc__PyObj *)__pyx_t_1), __pyx_v_vwr); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(11, 1427, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1428 * FunctionBegin(b"PCView_Python") * viewcontext(PyPC(pc), vwr) * cdef view = PyPC(pc).view # <<<<<<<<<<<<<< * if view is not None: * view(PC_(pc), Viewer_(vwr)) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyPC(__pyx_v_pc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_view); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 1428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_view = __pyx_t_3; __pyx_t_3 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1429 * viewcontext(PyPC(pc), vwr) * cdef view = PyPC(pc).view * if view is not None: # <<<<<<<<<<<<<< * view(PC_(pc), Viewer_(vwr)) * return FunctionEnd() */ __pyx_t_4 = (__pyx_v_view != Py_None); if (__pyx_t_4) { /* "petsc4py/PETSc/libpetsc4py.pyx":1430 * cdef view = PyPC(pc).view * if view is not None: * view(PC_(pc), Viewer_(vwr)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PC_(__pyx_v_pc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Viewer_(__pyx_v_vwr)); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 1430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_view); __pyx_t_6 = __pyx_v_view; __pyx_t_7 = NULL; __pyx_t_2 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_2 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_1, __pyx_t_5}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_2, 2+__pyx_t_2); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 1430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1429 * viewcontext(PyPC(pc), vwr) * cdef view = PyPC(pc).view * if view is not None: # <<<<<<<<<<<<<< * view(PC_(pc), Viewer_(vwr)) * return FunctionEnd() */ } /* "petsc4py/PETSc/libpetsc4py.pyx":1431 * if view is not None: * view(PC_(pc), Viewer_(vwr)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode PCPreSolve_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":1421 * return FunctionEnd() * * cdef PetscErrorCode PCView_Python( # <<<<<<<<<<<<<< * PetscPC pc, * PetscViewer vwr, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.PCView_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_view); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":1433 * return FunctionEnd() * * cdef PetscErrorCode PCPreSolve_Python( # <<<<<<<<<<<<<< * PetscPC pc, * PetscKSP ksp, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCPreSolve_Python(PC __pyx_v_pc, KSP __pyx_v_ksp, Vec __pyx_v_b, Vec __pyx_v_x) { PyObject *__pyx_v_preSolve = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("PCPreSolve_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":1440 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"PCPreSolve_Python") # <<<<<<<<<<<<<< * cdef preSolve = PyPC(pc).preSolve * if preSolve is not None: */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"PCPreSolve_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":1441 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"PCPreSolve_Python") * cdef preSolve = PyPC(pc).preSolve # <<<<<<<<<<<<<< * if preSolve is not None: * preSolve(PC_(pc), KSP_(ksp), Vec_(b), Vec_(x)) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyPC(__pyx_v_pc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1441, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_preSolve); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1441, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_preSolve = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1442 * FunctionBegin(b"PCPreSolve_Python") * cdef preSolve = PyPC(pc).preSolve * if preSolve is not None: # <<<<<<<<<<<<<< * preSolve(PC_(pc), KSP_(ksp), Vec_(b), Vec_(x)) * return FunctionEnd() */ __pyx_t_3 = (__pyx_v_preSolve != Py_None); if (__pyx_t_3) { /* "petsc4py/PETSc/libpetsc4py.pyx":1443 * cdef preSolve = PyPC(pc).preSolve * if preSolve is not None: * preSolve(PC_(pc), KSP_(ksp), Vec_(b), Vec_(x)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PC_(__pyx_v_pc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1443, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_KSP_(__pyx_v_ksp)); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 1443, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_b)); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 1443, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_x)); if (unlikely(!__pyx_t_6)) __PYX_ERR(11, 1443, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_preSolve); __pyx_t_7 = __pyx_v_preSolve; __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_8, __pyx_t_1, __pyx_t_4, __pyx_t_5, __pyx_t_6}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 4+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1443, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1442 * FunctionBegin(b"PCPreSolve_Python") * cdef preSolve = PyPC(pc).preSolve * if preSolve is not None: # <<<<<<<<<<<<<< * preSolve(PC_(pc), KSP_(ksp), Vec_(b), Vec_(x)) * return FunctionEnd() */ } /* "petsc4py/PETSc/libpetsc4py.pyx":1444 * if preSolve is not None: * preSolve(PC_(pc), KSP_(ksp), Vec_(b), Vec_(x)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode PCPostSolve_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":1433 * return FunctionEnd() * * cdef PetscErrorCode PCPreSolve_Python( # <<<<<<<<<<<<<< * PetscPC pc, * PetscKSP ksp, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("petsc4py.PETSc.PCPreSolve_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_preSolve); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":1446 * return FunctionEnd() * * cdef PetscErrorCode PCPostSolve_Python( # <<<<<<<<<<<<<< * PetscPC pc, * PetscKSP ksp, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCPostSolve_Python(PC __pyx_v_pc, KSP __pyx_v_ksp, Vec __pyx_v_b, Vec __pyx_v_x) { PyObject *__pyx_v_postSolve = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("PCPostSolve_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":1453 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"PCPostSolve_Python") # <<<<<<<<<<<<<< * cdef postSolve = PyPC(pc).postSolve * if postSolve is not None: */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"PCPostSolve_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":1454 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"PCPostSolve_Python") * cdef postSolve = PyPC(pc).postSolve # <<<<<<<<<<<<<< * if postSolve is not None: * postSolve(PC_(pc), KSP_(ksp), Vec_(b), Vec_(x)) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyPC(__pyx_v_pc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1454, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_postSolve); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1454, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_postSolve = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1455 * FunctionBegin(b"PCPostSolve_Python") * cdef postSolve = PyPC(pc).postSolve * if postSolve is not None: # <<<<<<<<<<<<<< * postSolve(PC_(pc), KSP_(ksp), Vec_(b), Vec_(x)) * return FunctionEnd() */ __pyx_t_3 = (__pyx_v_postSolve != Py_None); if (__pyx_t_3) { /* "petsc4py/PETSc/libpetsc4py.pyx":1456 * cdef postSolve = PyPC(pc).postSolve * if postSolve is not None: * postSolve(PC_(pc), KSP_(ksp), Vec_(b), Vec_(x)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PC_(__pyx_v_pc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1456, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_KSP_(__pyx_v_ksp)); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 1456, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_b)); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 1456, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_x)); if (unlikely(!__pyx_t_6)) __PYX_ERR(11, 1456, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_postSolve); __pyx_t_7 = __pyx_v_postSolve; __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_8, __pyx_t_1, __pyx_t_4, __pyx_t_5, __pyx_t_6}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 4+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1456, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1455 * FunctionBegin(b"PCPostSolve_Python") * cdef postSolve = PyPC(pc).postSolve * if postSolve is not None: # <<<<<<<<<<<<<< * postSolve(PC_(pc), KSP_(ksp), Vec_(b), Vec_(x)) * return FunctionEnd() */ } /* "petsc4py/PETSc/libpetsc4py.pyx":1457 * if postSolve is not None: * postSolve(PC_(pc), KSP_(ksp), Vec_(b), Vec_(x)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode PCApply_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":1446 * return FunctionEnd() * * cdef PetscErrorCode PCPostSolve_Python( # <<<<<<<<<<<<<< * PetscPC pc, * PetscKSP ksp, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("petsc4py.PETSc.PCPostSolve_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_postSolve); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":1459 * return FunctionEnd() * * cdef PetscErrorCode PCApply_Python( # <<<<<<<<<<<<<< * PetscPC pc, * PetscVec x, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCApply_Python(PC __pyx_v_pc, Vec __pyx_v_x, Vec __pyx_v_y) { PyObject *__pyx_v_apply = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("PCApply_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":1465 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"PCApply_Python") # <<<<<<<<<<<<<< * cdef apply = PyPC(pc).apply * apply(PC_(pc), Vec_(x), Vec_(y)) */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"PCApply_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":1466 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"PCApply_Python") * cdef apply = PyPC(pc).apply # <<<<<<<<<<<<<< * apply(PC_(pc), Vec_(x), Vec_(y)) * return FunctionEnd() */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyPC(__pyx_v_pc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_apply); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_apply = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1467 * FunctionBegin(b"PCApply_Python") * cdef apply = PyPC(pc).apply * apply(PC_(pc), Vec_(x), Vec_(y)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PC_(__pyx_v_pc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_x)); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 1467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_y)); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 1467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_apply); __pyx_t_5 = __pyx_v_apply; __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_6, __pyx_t_1, __pyx_t_3, __pyx_t_4}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 3+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1468 * cdef apply = PyPC(pc).apply * apply(PC_(pc), Vec_(x), Vec_(y)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode PCApplyTranspose_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":1459 * return FunctionEnd() * * cdef PetscErrorCode PCApply_Python( # <<<<<<<<<<<<<< * PetscPC pc, * PetscVec x, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.PCApply_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_apply); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":1470 * return FunctionEnd() * * cdef PetscErrorCode PCApplyTranspose_Python( # <<<<<<<<<<<<<< * PetscPC pc, * PetscVec x, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCApplyTranspose_Python(PC __pyx_v_pc, Vec __pyx_v_x, Vec __pyx_v_y) { PyObject *__pyx_v_applyTranspose = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("PCApplyTranspose_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":1476 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"PCApplyTranspose_Python") # <<<<<<<<<<<<<< * cdef applyTranspose = PyPC(pc).applyTranspose * applyTranspose(PC_(pc), Vec_(x), Vec_(y)) */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"PCApplyTranspose_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":1477 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"PCApplyTranspose_Python") * cdef applyTranspose = PyPC(pc).applyTranspose # <<<<<<<<<<<<<< * applyTranspose(PC_(pc), Vec_(x), Vec_(y)) * return FunctionEnd() */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyPC(__pyx_v_pc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1477, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_applyTranspose); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1477, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_applyTranspose = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1478 * FunctionBegin(b"PCApplyTranspose_Python") * cdef applyTranspose = PyPC(pc).applyTranspose * applyTranspose(PC_(pc), Vec_(x), Vec_(y)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PC_(__pyx_v_pc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_x)); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 1478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_y)); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 1478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_applyTranspose); __pyx_t_5 = __pyx_v_applyTranspose; __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_6, __pyx_t_1, __pyx_t_3, __pyx_t_4}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 3+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1479 * cdef applyTranspose = PyPC(pc).applyTranspose * applyTranspose(PC_(pc), Vec_(x), Vec_(y)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode PCApplySymmetricLeft_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":1470 * return FunctionEnd() * * cdef PetscErrorCode PCApplyTranspose_Python( # <<<<<<<<<<<<<< * PetscPC pc, * PetscVec x, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.PCApplyTranspose_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_applyTranspose); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":1481 * return FunctionEnd() * * cdef PetscErrorCode PCApplySymmetricLeft_Python( # <<<<<<<<<<<<<< * PetscPC pc, * PetscVec x, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCApplySymmetricLeft_Python(PC __pyx_v_pc, Vec __pyx_v_x, Vec __pyx_v_y) { PyObject *__pyx_v_applySymmetricLeft = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("PCApplySymmetricLeft_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":1487 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"PCApplySymmetricLeft_Python") # <<<<<<<<<<<<<< * cdef applySymmetricLeft = PyPC(pc).applySymmetricLeft * applySymmetricLeft(PC_(pc), Vec_(x), Vec_(y)) */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"PCApplySymmetricLeft_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":1488 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"PCApplySymmetricLeft_Python") * cdef applySymmetricLeft = PyPC(pc).applySymmetricLeft # <<<<<<<<<<<<<< * applySymmetricLeft(PC_(pc), Vec_(x), Vec_(y)) * return FunctionEnd() */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyPC(__pyx_v_pc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1488, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_applySymmetricLeft); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1488, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_applySymmetricLeft = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1489 * FunctionBegin(b"PCApplySymmetricLeft_Python") * cdef applySymmetricLeft = PyPC(pc).applySymmetricLeft * applySymmetricLeft(PC_(pc), Vec_(x), Vec_(y)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PC_(__pyx_v_pc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1489, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_x)); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 1489, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_y)); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 1489, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_applySymmetricLeft); __pyx_t_5 = __pyx_v_applySymmetricLeft; __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_6, __pyx_t_1, __pyx_t_3, __pyx_t_4}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 3+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1489, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1490 * cdef applySymmetricLeft = PyPC(pc).applySymmetricLeft * applySymmetricLeft(PC_(pc), Vec_(x), Vec_(y)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode PCApplySymmetricRight_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":1481 * return FunctionEnd() * * cdef PetscErrorCode PCApplySymmetricLeft_Python( # <<<<<<<<<<<<<< * PetscPC pc, * PetscVec x, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.PCApplySymmetricLeft_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_applySymmetricLeft); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":1492 * return FunctionEnd() * * cdef PetscErrorCode PCApplySymmetricRight_Python( # <<<<<<<<<<<<<< * PetscPC pc, * PetscVec x, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCApplySymmetricRight_Python(PC __pyx_v_pc, Vec __pyx_v_x, Vec __pyx_v_y) { PyObject *__pyx_v_applySymmetricRight = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("PCApplySymmetricRight_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":1498 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"PCApplySymmetricRight_Python") # <<<<<<<<<<<<<< * cdef applySymmetricRight = PyPC(pc).applySymmetricRight * applySymmetricRight(PC_(pc), Vec_(x), Vec_(y)) */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"PCApplySymmetricRight_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":1499 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"PCApplySymmetricRight_Python") * cdef applySymmetricRight = PyPC(pc).applySymmetricRight # <<<<<<<<<<<<<< * applySymmetricRight(PC_(pc), Vec_(x), Vec_(y)) * return FunctionEnd() */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyPC(__pyx_v_pc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_applySymmetricRight); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_applySymmetricRight = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1500 * FunctionBegin(b"PCApplySymmetricRight_Python") * cdef applySymmetricRight = PyPC(pc).applySymmetricRight * applySymmetricRight(PC_(pc), Vec_(x), Vec_(y)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PC_(__pyx_v_pc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1500, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_x)); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 1500, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_y)); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 1500, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_applySymmetricRight); __pyx_t_5 = __pyx_v_applySymmetricRight; __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_6, __pyx_t_1, __pyx_t_3, __pyx_t_4}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 3+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1500, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1501 * cdef applySymmetricRight = PyPC(pc).applySymmetricRight * applySymmetricRight(PC_(pc), Vec_(x), Vec_(y)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode PCMatApply_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":1492 * return FunctionEnd() * * cdef PetscErrorCode PCApplySymmetricRight_Python( # <<<<<<<<<<<<<< * PetscPC pc, * PetscVec x, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.PCApplySymmetricRight_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_applySymmetricRight); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":1503 * return FunctionEnd() * * cdef PetscErrorCode PCMatApply_Python( # <<<<<<<<<<<<<< * PetscPC pc, * PetscMat X, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCMatApply_Python(PC __pyx_v_pc, Mat __pyx_v_X, Mat __pyx_v_Y) { PyObject *__pyx_v_matApply = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PetscErrorCode __pyx_t_4; int __pyx_t_5; int __pyx_t_6; char const *__pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("PCMatApply_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":1509 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"PCMatApply_Python") # <<<<<<<<<<<<<< * cdef matApply = PyPC(pc).matApply * if matApply is None: */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"PCMatApply_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":1510 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"PCMatApply_Python") * cdef matApply = PyPC(pc).matApply # <<<<<<<<<<<<<< * if matApply is None: * try: */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyPC(__pyx_v_pc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1510, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_matApply); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1510, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_matApply = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1511 * FunctionBegin(b"PCMatApply_Python") * cdef matApply = PyPC(pc).matApply * if matApply is None: # <<<<<<<<<<<<<< * try: * pc.ops.matapply = NULL */ __pyx_t_3 = (__pyx_v_matApply == Py_None); if (__pyx_t_3) { /* "petsc4py/PETSc/libpetsc4py.pyx":1512 * cdef matApply = PyPC(pc).matApply * if matApply is None: * try: # <<<<<<<<<<<<<< * pc.ops.matapply = NULL * CHKERR( PCMatApply(pc, X, Y) ) */ /*try:*/ { /* "petsc4py/PETSc/libpetsc4py.pyx":1513 * if matApply is None: * try: * pc.ops.matapply = NULL # <<<<<<<<<<<<<< * CHKERR( PCMatApply(pc, X, Y) ) * finally: */ __pyx_v_pc->ops->matapply = NULL; /* "petsc4py/PETSc/libpetsc4py.pyx":1514 * try: * pc.ops.matapply = NULL * CHKERR( PCMatApply(pc, X, Y) ) # <<<<<<<<<<<<<< * finally: * pc.ops.matapply = PCMatApply_Python */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCMatApply(__pyx_v_pc, __pyx_v_X, __pyx_v_Y)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1514, __pyx_L5_error) } /* "petsc4py/PETSc/libpetsc4py.pyx":1516 * CHKERR( PCMatApply(pc, X, Y) ) * finally: * pc.ops.matapply = PCMatApply_Python # <<<<<<<<<<<<<< * return FunctionEnd() * matApply(PC_(pc), Mat_(X), Mat_(Y)) */ /*finally:*/ { /*normal exit:*/{ __pyx_v_pc->ops->matapply = __pyx_f_8petsc4py_5PETSc_PCMatApply_Python; goto __pyx_L6; } __pyx_L5_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10) < 0)) __Pyx_ErrFetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); __pyx_t_5 = __pyx_lineno; __pyx_t_6 = __pyx_clineno; __pyx_t_7 = __pyx_filename; { __pyx_v_pc->ops->matapply = __pyx_f_8petsc4py_5PETSc_PCMatApply_Python; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); } __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ErrRestore(__pyx_t_8, __pyx_t_9, __pyx_t_10); __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_lineno = __pyx_t_5; __pyx_clineno = __pyx_t_6; __pyx_filename = __pyx_t_7; goto __pyx_L1_error; } __pyx_L6:; } /* "petsc4py/PETSc/libpetsc4py.pyx":1517 * finally: * pc.ops.matapply = PCMatApply_Python * return FunctionEnd() # <<<<<<<<<<<<<< * matApply(PC_(pc), Mat_(X), Mat_(Y)) * return FunctionEnd() */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":1511 * FunctionBegin(b"PCMatApply_Python") * cdef matApply = PyPC(pc).matApply * if matApply is None: # <<<<<<<<<<<<<< * try: * pc.ops.matapply = NULL */ } /* "petsc4py/PETSc/libpetsc4py.pyx":1518 * pc.ops.matapply = PCMatApply_Python * return FunctionEnd() * matApply(PC_(pc), Mat_(X), Mat_(Y)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PC_(__pyx_v_pc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_14 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_X)); if (unlikely(!__pyx_t_14)) __PYX_ERR(11, 1518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_15 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_Y)); if (unlikely(!__pyx_t_15)) __PYX_ERR(11, 1518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_INCREF(__pyx_v_matApply); __pyx_t_16 = __pyx_v_matApply; __pyx_t_17 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_16))) { __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_16); if (likely(__pyx_t_17)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16); __Pyx_INCREF(__pyx_t_17); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_16, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_17, __pyx_t_1, __pyx_t_14, __pyx_t_15}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_16, __pyx_callargs+1-__pyx_t_6, 3+__pyx_t_6); __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1519 * return FunctionEnd() * matApply(PC_(pc), Mat_(X), Mat_(Y)) * return FunctionEnd() # <<<<<<<<<<<<<< * * */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":1503 * return FunctionEnd() * * cdef PetscErrorCode PCMatApply_Python( # <<<<<<<<<<<<<< * PetscPC pc, * PetscMat X, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_14); __Pyx_XDECREF(__pyx_t_15); __Pyx_XDECREF(__pyx_t_16); __Pyx_XDECREF(__pyx_t_17); __Pyx_AddTraceback("petsc4py.PETSc.PCMatApply_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_matApply); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":1550 * @cython.internal * cdef class _PyKSP(_PyObj): pass * cdef inline _PyKSP PyKSP(PetscKSP ksp): # <<<<<<<<<<<<<< * if ksp != NULL and ksp.data != NULL: * return <_PyKSP>ksp.data */ static CYTHON_INLINE struct __pyx_obj_8petsc4py_5PETSc__PyKSP *__pyx_f_8petsc4py_5PETSc_PyKSP(KSP __pyx_v_ksp) { struct __pyx_obj_8petsc4py_5PETSc__PyKSP *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyKSP", 1); /* "petsc4py/PETSc/libpetsc4py.pyx":1551 * cdef class _PyKSP(_PyObj): pass * cdef inline _PyKSP PyKSP(PetscKSP ksp): * if ksp != NULL and ksp.data != NULL: # <<<<<<<<<<<<<< * return <_PyKSP>ksp.data * else: */ __pyx_t_2 = (__pyx_v_ksp != NULL); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = (__pyx_v_ksp->data != NULL); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "petsc4py/PETSc/libpetsc4py.pyx":1552 * cdef inline _PyKSP PyKSP(PetscKSP ksp): * if ksp != NULL and ksp.data != NULL: * return <_PyKSP>ksp.data # <<<<<<<<<<<<<< * else: * return _PyKSP.__new__(_PyKSP) */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)((struct __pyx_obj_8petsc4py_5PETSc__PyKSP *)__pyx_v_ksp->data)); __pyx_r = ((struct __pyx_obj_8petsc4py_5PETSc__PyKSP *)__pyx_v_ksp->data); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":1551 * cdef class _PyKSP(_PyObj): pass * cdef inline _PyKSP PyKSP(PetscKSP ksp): * if ksp != NULL and ksp.data != NULL: # <<<<<<<<<<<<<< * return <_PyKSP>ksp.data * else: */ } /* "petsc4py/PETSc/libpetsc4py.pyx":1554 * return <_PyKSP>ksp.data * else: * return _PyKSP.__new__(_PyKSP) # <<<<<<<<<<<<<< * * cdef public PetscErrorCode KSPPythonGetContext(PetscKSP ksp, void **ctx) \ */ /*else*/ { __Pyx_XDECREF((PyObject *)__pyx_r); __pyx_t_3 = ((PyObject *)__pyx_tp_new_8petsc4py_5PETSc__PyKSP(((PyTypeObject *)__pyx_ptype_8petsc4py_5PETSc__PyKSP), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 1554, __pyx_L1_error) __Pyx_GOTREF((PyObject *)__pyx_t_3); __pyx_r = ((struct __pyx_obj_8petsc4py_5PETSc__PyKSP *)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; } /* "petsc4py/PETSc/libpetsc4py.pyx":1550 * @cython.internal * cdef class _PyKSP(_PyObj): pass * cdef inline _PyKSP PyKSP(PetscKSP ksp): # <<<<<<<<<<<<<< * if ksp != NULL and ksp.data != NULL: * return <_PyKSP>ksp.data */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.PyKSP", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":1556 * return _PyKSP.__new__(_PyKSP) * * cdef public PetscErrorCode KSPPythonGetContext(PetscKSP ksp, void **ctx) \ # <<<<<<<<<<<<<< * except PETSC_ERR_PYTHON: * FunctionBegin(b"KSPPythonGetContext") */ PetscErrorCode KSPPythonGetContext(KSP __pyx_v_ksp, void **__pyx_v_ctx) { PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("KSPPythonGetContext", 1); /* "petsc4py/PETSc/libpetsc4py.pyx":1558 * cdef public PetscErrorCode KSPPythonGetContext(PetscKSP ksp, void **ctx) \ * except PETSC_ERR_PYTHON: * FunctionBegin(b"KSPPythonGetContext") # <<<<<<<<<<<<<< * PyKSP(ksp).getcontext(ctx) * return FunctionEnd() */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"KSPPythonGetContext")); /* "petsc4py/PETSc/libpetsc4py.pyx":1559 * except PETSC_ERR_PYTHON: * FunctionBegin(b"KSPPythonGetContext") * PyKSP(ksp).getcontext(ctx) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyKSP(__pyx_v_ksp)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1559, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__PyKSP *)((struct __pyx_obj_8petsc4py_5PETSc__PyKSP *)__pyx_t_1)->__pyx_base.__pyx_vtab)->__pyx_base.getcontext(((struct __pyx_obj_8petsc4py_5PETSc__PyObj *)__pyx_t_1), __pyx_v_ctx); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(11, 1559, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1560 * FunctionBegin(b"KSPPythonGetContext") * PyKSP(ksp).getcontext(ctx) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef public PetscErrorCode KSPPythonSetContext(PetscKSP ksp, void *ctx) \ */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":1556 * return _PyKSP.__new__(_PyKSP) * * cdef public PetscErrorCode KSPPythonGetContext(PetscKSP ksp, void **ctx) \ # <<<<<<<<<<<<<< * except PETSC_ERR_PYTHON: * FunctionBegin(b"KSPPythonGetContext") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.KSPPythonGetContext", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":1562 * return FunctionEnd() * * cdef public PetscErrorCode KSPPythonSetContext(PetscKSP ksp, void *ctx) \ # <<<<<<<<<<<<<< * except PETSC_ERR_PYTHON: * FunctionBegin(b"KSPPythonSetContext") */ PetscErrorCode KSPPythonSetContext(KSP __pyx_v_ksp, void *__pyx_v_ctx) { PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("KSPPythonSetContext", 1); /* "petsc4py/PETSc/libpetsc4py.pyx":1564 * cdef public PetscErrorCode KSPPythonSetContext(PetscKSP ksp, void *ctx) \ * except PETSC_ERR_PYTHON: * FunctionBegin(b"KSPPythonSetContext") # <<<<<<<<<<<<<< * PyKSP(ksp).setcontext(ctx, KSP_(ksp)) * return FunctionEnd() */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"KSPPythonSetContext")); /* "petsc4py/PETSc/libpetsc4py.pyx":1565 * except PETSC_ERR_PYTHON: * FunctionBegin(b"KSPPythonSetContext") * PyKSP(ksp).setcontext(ctx, KSP_(ksp)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyKSP(__pyx_v_ksp)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_KSP_(__pyx_v_ksp)); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__PyKSP *)((struct __pyx_obj_8petsc4py_5PETSc__PyKSP *)__pyx_t_1)->__pyx_base.__pyx_vtab)->__pyx_base.setcontext(((struct __pyx_obj_8petsc4py_5PETSc__PyObj *)__pyx_t_1), __pyx_v_ctx, ((struct PyPetscObjectObject *)__pyx_t_2)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(11, 1565, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1566 * FunctionBegin(b"KSPPythonSetContext") * PyKSP(ksp).setcontext(ctx, KSP_(ksp)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode KSPPythonSetType_PYTHON(PetscKSP ksp, char name[]) \ */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":1562 * return FunctionEnd() * * cdef public PetscErrorCode KSPPythonSetContext(PetscKSP ksp, void *ctx) \ # <<<<<<<<<<<<<< * except PETSC_ERR_PYTHON: * FunctionBegin(b"KSPPythonSetContext") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.KSPPythonSetContext", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":1568 * return FunctionEnd() * * cdef PetscErrorCode KSPPythonSetType_PYTHON(PetscKSP ksp, char name[]) \ # <<<<<<<<<<<<<< * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"KSPPythonSetType_PYTHON") */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_KSPPythonSetType_PYTHON(KSP __pyx_v_ksp, char *__pyx_v_name) { PyObject *__pyx_v_ctx = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("KSPPythonSetType_PYTHON", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":1570 * cdef PetscErrorCode KSPPythonSetType_PYTHON(PetscKSP ksp, char name[]) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"KSPPythonSetType_PYTHON") # <<<<<<<<<<<<<< * if name == NULL: return FunctionEnd() # XXX * cdef object ctx = createcontext(name) */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"KSPPythonSetType_PYTHON")); /* "petsc4py/PETSc/libpetsc4py.pyx":1571 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"KSPPythonSetType_PYTHON") * if name == NULL: return FunctionEnd() # XXX # <<<<<<<<<<<<<< * cdef object ctx = createcontext(name) * KSPPythonSetContext(ksp, ctx) */ __pyx_t_1 = (__pyx_v_name == NULL); if (__pyx_t_1) { __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; } /* "petsc4py/PETSc/libpetsc4py.pyx":1572 * FunctionBegin(b"KSPPythonSetType_PYTHON") * if name == NULL: return FunctionEnd() # XXX * cdef object ctx = createcontext(name) # <<<<<<<<<<<<<< * KSPPythonSetContext(ksp, ctx) * PyKSP(ksp).setname(name) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_createcontext(__pyx_v_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_ctx = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1573 * if name == NULL: return FunctionEnd() # XXX * cdef object ctx = createcontext(name) * KSPPythonSetContext(ksp, ctx) # <<<<<<<<<<<<<< * PyKSP(ksp).setname(name) * return FunctionEnd() */ __pyx_t_3 = KSPPythonSetContext(__pyx_v_ksp, ((void *)__pyx_v_ctx)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1573, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":1574 * cdef object ctx = createcontext(name) * KSPPythonSetContext(ksp, ctx) * PyKSP(ksp).setname(name) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyKSP(__pyx_v_ksp)); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1574, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__PyKSP *)((struct __pyx_obj_8petsc4py_5PETSc__PyKSP *)__pyx_t_2)->__pyx_base.__pyx_vtab)->__pyx_base.setname(((struct __pyx_obj_8petsc4py_5PETSc__PyObj *)__pyx_t_2), __pyx_v_name); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(11, 1574, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1575 * KSPPythonSetContext(ksp, ctx) * PyKSP(ksp).setname(name) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode KSPPythonGetType_PYTHON(PetscKSP ksp, const char *name[]) \ */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":1568 * return FunctionEnd() * * cdef PetscErrorCode KSPPythonSetType_PYTHON(PetscKSP ksp, char name[]) \ # <<<<<<<<<<<<<< * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"KSPPythonSetType_PYTHON") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.KSPPythonSetType_PYTHON", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ctx); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":1577 * return FunctionEnd() * * cdef PetscErrorCode KSPPythonGetType_PYTHON(PetscKSP ksp, const char *name[]) \ # <<<<<<<<<<<<<< * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"KSPPythonGetType_PYTHON") */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_KSPPythonGetType_PYTHON(KSP __pyx_v_ksp, char const **__pyx_v_name) { PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; char *__pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("KSPPythonGetType_PYTHON", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":1579 * cdef PetscErrorCode KSPPythonGetType_PYTHON(PetscKSP ksp, const char *name[]) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"KSPPythonGetType_PYTHON") # <<<<<<<<<<<<<< * name[0] = PyKSP(ksp).getname() * return FunctionEnd() */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"KSPPythonGetType_PYTHON")); /* "petsc4py/PETSc/libpetsc4py.pyx":1580 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"KSPPythonGetType_PYTHON") * name[0] = PyKSP(ksp).getname() # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyKSP(__pyx_v_ksp)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1580, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__PyKSP *)((struct __pyx_obj_8petsc4py_5PETSc__PyKSP *)__pyx_t_1)->__pyx_base.__pyx_vtab)->__pyx_base.getname(((struct __pyx_obj_8petsc4py_5PETSc__PyObj *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((char *)NULL) && PyErr_Occurred())) __PYX_ERR(11, 1580, __pyx_L1_error) (__pyx_v_name[0]) = __pyx_t_2; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1581 * FunctionBegin(b"KSPPythonGetType_PYTHON") * name[0] = PyKSP(ksp).getname() * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode KSPCreate_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":1577 * return FunctionEnd() * * cdef PetscErrorCode KSPPythonGetType_PYTHON(PetscKSP ksp, const char *name[]) \ # <<<<<<<<<<<<<< * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"KSPPythonGetType_PYTHON") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.KSPPythonGetType_PYTHON", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":1583 * return FunctionEnd() * * cdef PetscErrorCode KSPCreate_Python( # <<<<<<<<<<<<<< * PetscKSP ksp, * ) \ */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_KSPCreate_Python(KSP __pyx_v_ksp) { KSPOps __pyx_v_ops; PyObject *__pyx_v_ctx = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations KSPOps __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("KSPCreate_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":1587 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"KSPCreate_Python") # <<<<<<<<<<<<<< * # * cdef KSPOps ops = ksp.ops */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"KSPCreate_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":1589 * FunctionBegin(b"KSPCreate_Python") * # * cdef KSPOps ops = ksp.ops # <<<<<<<<<<<<<< * ops.reset = KSPReset_Python * ops.destroy = KSPDestroy_Python */ __pyx_t_1 = __pyx_v_ksp->ops; __pyx_v_ops = __pyx_t_1; /* "petsc4py/PETSc/libpetsc4py.pyx":1590 * # * cdef KSPOps ops = ksp.ops * ops.reset = KSPReset_Python # <<<<<<<<<<<<<< * ops.destroy = KSPDestroy_Python * ops.setup = KSPSetUp_Python */ __pyx_v_ops->reset = __pyx_f_8petsc4py_5PETSc_KSPReset_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":1591 * cdef KSPOps ops = ksp.ops * ops.reset = KSPReset_Python * ops.destroy = KSPDestroy_Python # <<<<<<<<<<<<<< * ops.setup = KSPSetUp_Python * ops.setfromoptions = KSPSetFromOptions_Python */ __pyx_v_ops->destroy = __pyx_f_8petsc4py_5PETSc_KSPDestroy_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":1592 * ops.reset = KSPReset_Python * ops.destroy = KSPDestroy_Python * ops.setup = KSPSetUp_Python # <<<<<<<<<<<<<< * ops.setfromoptions = KSPSetFromOptions_Python * ops.view = KSPView_Python */ __pyx_v_ops->setup = __pyx_f_8petsc4py_5PETSc_KSPSetUp_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":1593 * ops.destroy = KSPDestroy_Python * ops.setup = KSPSetUp_Python * ops.setfromoptions = KSPSetFromOptions_Python # <<<<<<<<<<<<<< * ops.view = KSPView_Python * ops.solve = KSPSolve_Python */ __pyx_v_ops->setfromoptions = __pyx_f_8petsc4py_5PETSc_KSPSetFromOptions_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":1594 * ops.setup = KSPSetUp_Python * ops.setfromoptions = KSPSetFromOptions_Python * ops.view = KSPView_Python # <<<<<<<<<<<<<< * ops.solve = KSPSolve_Python * ops.buildsolution = KSPBuildSolution_Python */ __pyx_v_ops->view = __pyx_f_8petsc4py_5PETSc_KSPView_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":1595 * ops.setfromoptions = KSPSetFromOptions_Python * ops.view = KSPView_Python * ops.solve = KSPSolve_Python # <<<<<<<<<<<<<< * ops.buildsolution = KSPBuildSolution_Python * ops.buildresidual = KSPBuildResidual_Python */ __pyx_v_ops->solve = __pyx_f_8petsc4py_5PETSc_KSPSolve_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":1596 * ops.view = KSPView_Python * ops.solve = KSPSolve_Python * ops.buildsolution = KSPBuildSolution_Python # <<<<<<<<<<<<<< * ops.buildresidual = KSPBuildResidual_Python * # */ __pyx_v_ops->buildsolution = __pyx_f_8petsc4py_5PETSc_KSPBuildSolution_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":1597 * ops.solve = KSPSolve_Python * ops.buildsolution = KSPBuildSolution_Python * ops.buildresidual = KSPBuildResidual_Python # <<<<<<<<<<<<<< * # * CHKERR( PetscObjectComposeFunction( */ __pyx_v_ops->buildresidual = __pyx_f_8petsc4py_5PETSc_KSPBuildResidual_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":1599 * ops.buildresidual = KSPBuildResidual_Python * # * CHKERR( PetscObjectComposeFunction( # <<<<<<<<<<<<<< * ksp, b"KSPPythonSetType_C", * KSPPythonSetType_PYTHON) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectComposeFunction(((PetscObject)__pyx_v_ksp), ((char *)"KSPPythonSetType_C"), ((PetscVoidFunction)__pyx_f_8petsc4py_5PETSc_KSPPythonSetType_PYTHON))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1599, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":1602 * ksp, b"KSPPythonSetType_C", * KSPPythonSetType_PYTHON) ) * CHKERR( PetscObjectComposeFunction( # <<<<<<<<<<<<<< * ksp, b"KSPPythonGetType_C", * KSPPythonGetType_PYTHON) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectComposeFunction(((PetscObject)__pyx_v_ksp), ((char *)"KSPPythonGetType_C"), ((PetscVoidFunction)__pyx_f_8petsc4py_5PETSc_KSPPythonGetType_PYTHON))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1602, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":1606 * KSPPythonGetType_PYTHON) ) * # * cdef ctx = PyKSP(NULL) # <<<<<<<<<<<<<< * ksp.data = ctx * Py_INCREF(ksp.data) */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyKSP(NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 1606, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_ctx = __pyx_t_3; __pyx_t_3 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1607 * # * cdef ctx = PyKSP(NULL) * ksp.data = ctx # <<<<<<<<<<<<<< * Py_INCREF(ksp.data) * # */ __pyx_v_ksp->data = ((void *)__pyx_v_ctx); /* "petsc4py/PETSc/libpetsc4py.pyx":1608 * cdef ctx = PyKSP(NULL) * ksp.data = ctx * Py_INCREF(ksp.data) # <<<<<<<<<<<<<< * # * CHKERR( KSPSetSupportedNorm( */ Py_INCREF(((PyObject *)__pyx_v_ksp->data)); /* "petsc4py/PETSc/libpetsc4py.pyx":1610 * Py_INCREF(ksp.data) * # * CHKERR( KSPSetSupportedNorm( # <<<<<<<<<<<<<< * ksp, KSP_NORM_PRECONDITIONED, PC_LEFT, 3) ) * CHKERR( KSPSetSupportedNorm( */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetSupportedNorm(__pyx_v_ksp, KSP_NORM_PRECONDITIONED, PC_LEFT, 3)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1610, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":1612 * CHKERR( KSPSetSupportedNorm( * ksp, KSP_NORM_PRECONDITIONED, PC_LEFT, 3) ) * CHKERR( KSPSetSupportedNorm( # <<<<<<<<<<<<<< * ksp, KSP_NORM_UNPRECONDITIONED, PC_RIGHT, 3) ) * CHKERR( KSPSetSupportedNorm( */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetSupportedNorm(__pyx_v_ksp, KSP_NORM_UNPRECONDITIONED, PC_RIGHT, 3)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1612, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":1614 * CHKERR( KSPSetSupportedNorm( * ksp, KSP_NORM_UNPRECONDITIONED, PC_RIGHT, 3) ) * CHKERR( KSPSetSupportedNorm( # <<<<<<<<<<<<<< * ksp, KSP_NORM_UNPRECONDITIONED, PC_LEFT, 2) ) * CHKERR( KSPSetSupportedNorm( */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetSupportedNorm(__pyx_v_ksp, KSP_NORM_UNPRECONDITIONED, PC_LEFT, 2)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1614, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":1616 * CHKERR( KSPSetSupportedNorm( * ksp, KSP_NORM_UNPRECONDITIONED, PC_LEFT, 2) ) * CHKERR( KSPSetSupportedNorm( # <<<<<<<<<<<<<< * ksp, KSP_NORM_PRECONDITIONED, PC_RIGHT, 2) ) * CHKERR( KSPSetSupportedNorm( */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetSupportedNorm(__pyx_v_ksp, KSP_NORM_PRECONDITIONED, PC_RIGHT, 2)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1616, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":1618 * CHKERR( KSPSetSupportedNorm( * ksp, KSP_NORM_PRECONDITIONED, PC_RIGHT, 2) ) * CHKERR( KSPSetSupportedNorm( # <<<<<<<<<<<<<< * ksp, KSP_NORM_PRECONDITIONED, PC_SYMMETRIC, 1) ) * CHKERR( KSPSetSupportedNorm( */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetSupportedNorm(__pyx_v_ksp, KSP_NORM_PRECONDITIONED, PC_SYMMETRIC, 1)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1618, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":1620 * CHKERR( KSPSetSupportedNorm( * ksp, KSP_NORM_PRECONDITIONED, PC_SYMMETRIC, 1) ) * CHKERR( KSPSetSupportedNorm( # <<<<<<<<<<<<<< * ksp, KSP_NORM_UNPRECONDITIONED, PC_SYMMETRIC, 1) ) * return FunctionEnd() */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetSupportedNorm(__pyx_v_ksp, KSP_NORM_UNPRECONDITIONED, PC_SYMMETRIC, 1)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1620, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":1622 * CHKERR( KSPSetSupportedNorm( * ksp, KSP_NORM_UNPRECONDITIONED, PC_SYMMETRIC, 1) ) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef inline PetscErrorCode KSPDestroy_Python_inner( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":1583 * return FunctionEnd() * * cdef PetscErrorCode KSPCreate_Python( # <<<<<<<<<<<<<< * PetscKSP ksp, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSPCreate_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ctx); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":1624 * return FunctionEnd() * * cdef inline PetscErrorCode KSPDestroy_Python_inner( # <<<<<<<<<<<<<< * PetscKSP ksp, * ) \ */ static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_KSPDestroy_Python_inner(KSP __pyx_v_ksp) { PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_t_2; int __pyx_t_3; char const *__pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("KSPDestroy_Python_inner", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":1628 * ) \ * except PETSC_ERR_PYTHON with gil: * try: # <<<<<<<<<<<<<< * addRef(ksp) * KSPPythonSetContext(ksp, NULL) */ /*try:*/ { /* "petsc4py/PETSc/libpetsc4py.pyx":1629 * except PETSC_ERR_PYTHON with gil: * try: * addRef(ksp) # <<<<<<<<<<<<<< * KSPPythonSetContext(ksp, NULL) * finally: */ __pyx_f_8petsc4py_5PETSc_addRef(__pyx_v_ksp); /* "petsc4py/PETSc/libpetsc4py.pyx":1630 * try: * addRef(ksp) * KSPPythonSetContext(ksp, NULL) # <<<<<<<<<<<<<< * finally: * delRef(ksp) */ __pyx_t_1 = KSPPythonSetContext(__pyx_v_ksp, NULL); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1630, __pyx_L4_error) } /* "petsc4py/PETSc/libpetsc4py.pyx":1632 * KSPPythonSetContext(ksp, NULL) * finally: * delRef(ksp) # <<<<<<<<<<<<<< * Py_DECREF(ksp.data) * ksp.data = NULL */ /*finally:*/ { /*normal exit:*/{ __pyx_f_8petsc4py_5PETSc_delRef(__pyx_v_ksp); /* "petsc4py/PETSc/libpetsc4py.pyx":1633 * finally: * delRef(ksp) * Py_DECREF(ksp.data) # <<<<<<<<<<<<<< * ksp.data = NULL * return PETSC_SUCCESS */ Py_DECREF(((PyObject *)__pyx_v_ksp->data)); /* "petsc4py/PETSc/libpetsc4py.pyx":1634 * delRef(ksp) * Py_DECREF(ksp.data) * ksp.data = NULL # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_v_ksp->data = NULL; goto __pyx_L5; } __pyx_L4_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0)) __Pyx_ErrFetch(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __pyx_t_2 = __pyx_lineno; __pyx_t_3 = __pyx_clineno; __pyx_t_4 = __pyx_filename; { /* "petsc4py/PETSc/libpetsc4py.pyx":1632 * KSPPythonSetContext(ksp, NULL) * finally: * delRef(ksp) # <<<<<<<<<<<<<< * Py_DECREF(ksp.data) * ksp.data = NULL */ __pyx_f_8petsc4py_5PETSc_delRef(__pyx_v_ksp); /* "petsc4py/PETSc/libpetsc4py.pyx":1633 * finally: * delRef(ksp) * Py_DECREF(ksp.data) # <<<<<<<<<<<<<< * ksp.data = NULL * return PETSC_SUCCESS */ Py_DECREF(((PyObject *)__pyx_v_ksp->data)); /* "petsc4py/PETSc/libpetsc4py.pyx":1634 * delRef(ksp) * Py_DECREF(ksp.data) * ksp.data = NULL # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_v_ksp->data = NULL; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); } __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_ErrRestore(__pyx_t_5, __pyx_t_6, __pyx_t_7); __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_lineno = __pyx_t_2; __pyx_clineno = __pyx_t_3; __pyx_filename = __pyx_t_4; goto __pyx_L1_error; } __pyx_L5:; } /* "petsc4py/PETSc/libpetsc4py.pyx":1635 * Py_DECREF(ksp.data) * ksp.data = NULL * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * cdef PetscErrorCode KSPDestroy_Python( */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":1624 * return FunctionEnd() * * cdef inline PetscErrorCode KSPDestroy_Python_inner( # <<<<<<<<<<<<<< * PetscKSP ksp, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSPDestroy_Python_inner", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":1637 * return PETSC_SUCCESS * * cdef PetscErrorCode KSPDestroy_Python( # <<<<<<<<<<<<<< * PetscKSP ksp, * ) \ */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_KSPDestroy_Python(KSP __pyx_v_ksp) { PetscErrorCode __pyx_r; PetscErrorCode __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save; #endif /* "petsc4py/PETSc/libpetsc4py.pyx":1641 * ) \ * except PETSC_ERR_PYTHON nogil: * FunctionBegin(b"KSPDestroy_Python") # <<<<<<<<<<<<<< * CHKERR( PetscObjectComposeFunction( * ksp, b"KSPPythonSetType_C", */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"KSPDestroy_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":1642 * except PETSC_ERR_PYTHON nogil: * FunctionBegin(b"KSPDestroy_Python") * CHKERR( PetscObjectComposeFunction( # <<<<<<<<<<<<<< * ksp, b"KSPPythonSetType_C", * NULL)) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectComposeFunction(((PetscObject)__pyx_v_ksp), ((char *)"KSPPythonSetType_C"), ((PetscVoidFunction)NULL))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1642, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":1645 * ksp, b"KSPPythonSetType_C", * NULL)) * CHKERR( PetscObjectComposeFunction( # <<<<<<<<<<<<<< * ksp, b"KSPPythonGetType_C", * NULL)) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectComposeFunction(((PetscObject)__pyx_v_ksp), ((char *)"KSPPythonGetType_C"), ((PetscVoidFunction)NULL))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1645, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":1649 * NULL)) * # * if Py_IsInitialized(): KSPDestroy_Python_inner(ksp) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_2 = (Py_IsInitialized() != 0); if (__pyx_t_2) { __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_KSPDestroy_Python_inner(__pyx_v_ksp); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1649, __pyx_L1_error) } /* "petsc4py/PETSc/libpetsc4py.pyx":1650 * # * if Py_IsInitialized(): KSPDestroy_Python_inner(ksp) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode KSPSetUp_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":1637 * return PETSC_SUCCESS * * cdef PetscErrorCode KSPDestroy_Python( # <<<<<<<<<<<<<< * PetscKSP ksp, * ) \ */ /* function exit code */ __pyx_L1_error:; #ifdef WITH_THREAD __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_AddTraceback("petsc4py.PETSc.KSPDestroy_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":1652 * return FunctionEnd() * * cdef PetscErrorCode KSPSetUp_Python( # <<<<<<<<<<<<<< * PetscKSP ksp, * ) \ */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_KSPSetUp_Python(KSP __pyx_v_ksp) { char __pyx_v_name[0x800]; PetscBool __pyx_v_found; PyObject *__pyx_v_setUp = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_t_4; PetscErrorCode __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("KSPSetUp_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":1656 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"KSPSetUp_Python") # <<<<<<<<<<<<<< * # * cdef char name[2048] */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"KSPSetUp_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":1659 * # * cdef char name[2048] * cdef PetscBool found = PETSC_FALSE # <<<<<<<<<<<<<< * if PyKSP(ksp).self is None: * CHKERR( PetscOptionsGetString(NULL, */ __pyx_v_found = PETSC_FALSE; /* "petsc4py/PETSc/libpetsc4py.pyx":1660 * cdef char name[2048] * cdef PetscBool found = PETSC_FALSE * if PyKSP(ksp).self is None: # <<<<<<<<<<<<<< * CHKERR( PetscOptionsGetString(NULL, * getPrefix(ksp), b"-ksp_python_type", */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyKSP(__pyx_v_ksp)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1660, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (((struct __pyx_obj_8petsc4py_5PETSc__PyKSP *)__pyx_t_1)->__pyx_base.self == Py_None); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "petsc4py/PETSc/libpetsc4py.pyx":1661 * cdef PetscBool found = PETSC_FALSE * if PyKSP(ksp).self is None: * CHKERR( PetscOptionsGetString(NULL, # <<<<<<<<<<<<<< * getPrefix(ksp), b"-ksp_python_type", * name, sizeof(name), &found) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsGetString(NULL, __pyx_f_8petsc4py_5PETSc_getPrefix(__pyx_v_ksp), ((char *)"-ksp_python_type"), __pyx_v_name, (sizeof(__pyx_v_name)), (&__pyx_v_found))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1661, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":1664 * getPrefix(ksp), b"-ksp_python_type", * name, sizeof(name), &found) ) * if found and name[0]: # <<<<<<<<<<<<<< * CHKERR( KSPPythonSetType_PYTHON(ksp, name) ) * if PyKSP(ksp).self is None: */ if (__pyx_v_found) { } else { __pyx_t_2 = __pyx_v_found; goto __pyx_L5_bool_binop_done; } __pyx_t_4 = ((__pyx_v_name[0]) != 0); __pyx_t_2 = __pyx_t_4; __pyx_L5_bool_binop_done:; if (__pyx_t_2) { /* "petsc4py/PETSc/libpetsc4py.pyx":1665 * name, sizeof(name), &found) ) * if found and name[0]: * CHKERR( KSPPythonSetType_PYTHON(ksp, name) ) # <<<<<<<<<<<<<< * if PyKSP(ksp).self is None: * return PetscSETERR(PETSC_ERR_USER, */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_KSPPythonSetType_PYTHON(__pyx_v_ksp, __pyx_v_name); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1665, __pyx_L1_error) __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_t_3); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1665, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":1664 * getPrefix(ksp), b"-ksp_python_type", * name, sizeof(name), &found) ) * if found and name[0]: # <<<<<<<<<<<<<< * CHKERR( KSPPythonSetType_PYTHON(ksp, name) ) * if PyKSP(ksp).self is None: */ } /* "petsc4py/PETSc/libpetsc4py.pyx":1660 * cdef char name[2048] * cdef PetscBool found = PETSC_FALSE * if PyKSP(ksp).self is None: # <<<<<<<<<<<<<< * CHKERR( PetscOptionsGetString(NULL, * getPrefix(ksp), b"-ksp_python_type", */ } /* "petsc4py/PETSc/libpetsc4py.pyx":1666 * if found and name[0]: * CHKERR( KSPPythonSetType_PYTHON(ksp, name) ) * if PyKSP(ksp).self is None: # <<<<<<<<<<<<<< * return PetscSETERR(PETSC_ERR_USER, * "Python context not set, call one of \n" */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyKSP(__pyx_v_ksp)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1666, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (((struct __pyx_obj_8petsc4py_5PETSc__PyKSP *)__pyx_t_1)->__pyx_base.self == Py_None); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "petsc4py/PETSc/libpetsc4py.pyx":1667 * CHKERR( KSPPythonSetType_PYTHON(ksp, name) ) * if PyKSP(ksp).self is None: * return PetscSETERR(PETSC_ERR_USER, # <<<<<<<<<<<<<< * "Python context not set, call one of \n" * " * KSPPythonSetType(ksp, \"[package.]module.class\")\n" */ __pyx_r = __pyx_f_8petsc4py_5PETSc_PetscSETERR(PETSC_ERR_USER, ((char *)"Python context not set, call one of \n * KSPPythonSetType(ksp, \"[package.]module.class\")\n * KSPSetFromOptions(ksp) and pass option -ksp_python_type [package.]module.class")); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":1666 * if found and name[0]: * CHKERR( KSPPythonSetType_PYTHON(ksp, name) ) * if PyKSP(ksp).self is None: # <<<<<<<<<<<<<< * return PetscSETERR(PETSC_ERR_USER, * "Python context not set, call one of \n" */ } /* "petsc4py/PETSc/libpetsc4py.pyx":1673 * "-ksp_python_type [package.]module.class") * # * cdef setUp = PyKSP(ksp).setUp # <<<<<<<<<<<<<< * if setUp is not None: * setUp(KSP_(ksp)) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyKSP(__pyx_v_ksp)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1673, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_setUp); if (unlikely(!__pyx_t_6)) __PYX_ERR(11, 1673, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_setUp = __pyx_t_6; __pyx_t_6 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1674 * # * cdef setUp = PyKSP(ksp).setUp * if setUp is not None: # <<<<<<<<<<<<<< * setUp(KSP_(ksp)) * return FunctionEnd() */ __pyx_t_2 = (__pyx_v_setUp != Py_None); if (__pyx_t_2) { /* "petsc4py/PETSc/libpetsc4py.pyx":1675 * cdef setUp = PyKSP(ksp).setUp * if setUp is not None: * setUp(KSP_(ksp)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_KSP_(__pyx_v_ksp)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_setUp); __pyx_t_7 = __pyx_v_setUp; __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_1}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(11, 1675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1674 * # * cdef setUp = PyKSP(ksp).setUp * if setUp is not None: # <<<<<<<<<<<<<< * setUp(KSP_(ksp)) * return FunctionEnd() */ } /* "petsc4py/PETSc/libpetsc4py.pyx":1676 * if setUp is not None: * setUp(KSP_(ksp)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef inline PetscErrorCode KSPReset_Python_inner( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":1652 * return FunctionEnd() * * cdef PetscErrorCode KSPSetUp_Python( # <<<<<<<<<<<<<< * PetscKSP ksp, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("petsc4py.PETSc.KSPSetUp_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_setUp); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":1678 * return FunctionEnd() * * cdef inline PetscErrorCode KSPReset_Python_inner( # <<<<<<<<<<<<<< * PetscKSP ksp, * ) \ */ static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_KSPReset_Python_inner(KSP __pyx_v_ksp) { PyObject *__pyx_v_reset = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("KSPReset_Python_inner", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":1682 * ) \ * except PETSC_ERR_PYTHON with gil: * cdef reset = PyKSP(ksp).reset # <<<<<<<<<<<<<< * if reset is not None: * reset(KSP_(ksp)) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyKSP(__pyx_v_ksp)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_reset); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_reset = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1683 * except PETSC_ERR_PYTHON with gil: * cdef reset = PyKSP(ksp).reset * if reset is not None: # <<<<<<<<<<<<<< * reset(KSP_(ksp)) * return PETSC_SUCCESS */ __pyx_t_3 = (__pyx_v_reset != Py_None); if (__pyx_t_3) { /* "petsc4py/PETSc/libpetsc4py.pyx":1684 * cdef reset = PyKSP(ksp).reset * if reset is not None: * reset(KSP_(ksp)) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_KSP_(__pyx_v_ksp)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_reset); __pyx_t_4 = __pyx_v_reset; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_1}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1683 * except PETSC_ERR_PYTHON with gil: * cdef reset = PyKSP(ksp).reset * if reset is not None: # <<<<<<<<<<<<<< * reset(KSP_(ksp)) * return PETSC_SUCCESS */ } /* "petsc4py/PETSc/libpetsc4py.pyx":1685 * if reset is not None: * reset(KSP_(ksp)) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * cdef PetscErrorCode KSPReset_Python( */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":1678 * return FunctionEnd() * * cdef inline PetscErrorCode KSPReset_Python_inner( # <<<<<<<<<<<<<< * PetscKSP ksp, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.KSPReset_Python_inner", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_reset); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":1687 * return PETSC_SUCCESS * * cdef PetscErrorCode KSPReset_Python( # <<<<<<<<<<<<<< * PetscKSP ksp, * ) \ */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_KSPReset_Python(KSP __pyx_v_ksp) { PetscErrorCode __pyx_r; int __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save; #endif /* "petsc4py/PETSc/libpetsc4py.pyx":1691 * ) \ * except PETSC_ERR_PYTHON nogil: * if getRef(ksp) == 0: return PETSC_SUCCESS # <<<<<<<<<<<<<< * FunctionBegin(b"KSPReset_Python") * CHKERR( PetscObjectCompose(ksp, b"@ksp.vec_work_sol", NULL) ) */ __pyx_t_1 = (__pyx_f_8petsc4py_5PETSc_getRef(__pyx_v_ksp) == 0); if (__pyx_t_1) { __pyx_r = PETSC_SUCCESS; goto __pyx_L0; } /* "petsc4py/PETSc/libpetsc4py.pyx":1692 * except PETSC_ERR_PYTHON nogil: * if getRef(ksp) == 0: return PETSC_SUCCESS * FunctionBegin(b"KSPReset_Python") # <<<<<<<<<<<<<< * CHKERR( PetscObjectCompose(ksp, b"@ksp.vec_work_sol", NULL) ) * CHKERR( PetscObjectCompose(ksp, b"@ksp.vec_work_res", NULL) ) */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"KSPReset_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":1693 * if getRef(ksp) == 0: return PETSC_SUCCESS * FunctionBegin(b"KSPReset_Python") * CHKERR( PetscObjectCompose(ksp, b"@ksp.vec_work_sol", NULL) ) # <<<<<<<<<<<<<< * CHKERR( PetscObjectCompose(ksp, b"@ksp.vec_work_res", NULL) ) * if Py_IsInitialized(): KSPReset_Python_inner(ksp) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectCompose(((PetscObject)__pyx_v_ksp), ((char *)"@ksp.vec_work_sol"), NULL)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1693, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":1694 * FunctionBegin(b"KSPReset_Python") * CHKERR( PetscObjectCompose(ksp, b"@ksp.vec_work_sol", NULL) ) * CHKERR( PetscObjectCompose(ksp, b"@ksp.vec_work_res", NULL) ) # <<<<<<<<<<<<<< * if Py_IsInitialized(): KSPReset_Python_inner(ksp) * return FunctionEnd() */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectCompose(((PetscObject)__pyx_v_ksp), ((char *)"@ksp.vec_work_res"), NULL)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1694, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":1695 * CHKERR( PetscObjectCompose(ksp, b"@ksp.vec_work_sol", NULL) ) * CHKERR( PetscObjectCompose(ksp, b"@ksp.vec_work_res", NULL) ) * if Py_IsInitialized(): KSPReset_Python_inner(ksp) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = (Py_IsInitialized() != 0); if (__pyx_t_1) { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_KSPReset_Python_inner(__pyx_v_ksp); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1695, __pyx_L1_error) } /* "petsc4py/PETSc/libpetsc4py.pyx":1696 * CHKERR( PetscObjectCompose(ksp, b"@ksp.vec_work_res", NULL) ) * if Py_IsInitialized(): KSPReset_Python_inner(ksp) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode KSPSetFromOptions_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":1687 * return PETSC_SUCCESS * * cdef PetscErrorCode KSPReset_Python( # <<<<<<<<<<<<<< * PetscKSP ksp, * ) \ */ /* function exit code */ __pyx_L1_error:; #ifdef WITH_THREAD __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_AddTraceback("petsc4py.PETSc.KSPReset_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":1698 * return FunctionEnd() * * cdef PetscErrorCode KSPSetFromOptions_Python( # <<<<<<<<<<<<<< * PetscKSP ksp, * PetscOptionItems *PetscOptionsObject */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_KSPSetFromOptions_Python(KSP __pyx_v_ksp, PetscOptionItems *__pyx_v_PetscOptionsObject) { char __pyx_v_name[0x800]; char *__pyx_v_defval; PetscBool __pyx_v_found; PetscOptionItems *PetscOptionsObject; PyObject *__pyx_v_setFromOptions = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; char *__pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_t_4; int __pyx_t_5; PetscErrorCode __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("KSPSetFromOptions_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":1703 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"KSPSetFromOptions_Python") # <<<<<<<<<<<<<< * # * cdef char name[2048], *defval = PyKSP(ksp).getname() */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"KSPSetFromOptions_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":1705 * FunctionBegin(b"KSPSetFromOptions_Python") * # * cdef char name[2048], *defval = PyKSP(ksp).getname() # <<<<<<<<<<<<<< * cdef PetscBool found = PETSC_FALSE * cdef PetscOptionItems *opts "PetscOptionsObject" = PetscOptionsObject */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyKSP(__pyx_v_ksp)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1705, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__PyKSP *)((struct __pyx_obj_8petsc4py_5PETSc__PyKSP *)__pyx_t_1)->__pyx_base.__pyx_vtab)->__pyx_base.getname(((struct __pyx_obj_8petsc4py_5PETSc__PyObj *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((char *)NULL) && PyErr_Occurred())) __PYX_ERR(11, 1705, __pyx_L1_error) __pyx_v_defval = __pyx_t_2; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1706 * # * cdef char name[2048], *defval = PyKSP(ksp).getname() * cdef PetscBool found = PETSC_FALSE # <<<<<<<<<<<<<< * cdef PetscOptionItems *opts "PetscOptionsObject" = PetscOptionsObject * CHKERR( PetscOptionsString( */ __pyx_v_found = PETSC_FALSE; /* "petsc4py/PETSc/libpetsc4py.pyx":1707 * cdef char name[2048], *defval = PyKSP(ksp).getname() * cdef PetscBool found = PETSC_FALSE * cdef PetscOptionItems *opts "PetscOptionsObject" = PetscOptionsObject # <<<<<<<<<<<<<< * CHKERR( PetscOptionsString( * b"-ksp_python_type", b"Python [package.]module[.{class|function}]", */ PetscOptionsObject = __pyx_v_PetscOptionsObject; /* "petsc4py/PETSc/libpetsc4py.pyx":1708 * cdef PetscBool found = PETSC_FALSE * cdef PetscOptionItems *opts "PetscOptionsObject" = PetscOptionsObject * CHKERR( PetscOptionsString( # <<<<<<<<<<<<<< * b"-ksp_python_type", b"Python [package.]module[.{class|function}]", * b"KSPPythonSetType", defval, name, sizeof(name), &found) ); opts; */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsString(((char *)"-ksp_python_type"), ((char *)"Python [package.]module[.{class|function}]"), ((char *)"KSPPythonSetType"), __pyx_v_defval, __pyx_v_name, (sizeof(__pyx_v_name)), (&__pyx_v_found))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1708, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":1710 * CHKERR( PetscOptionsString( * b"-ksp_python_type", b"Python [package.]module[.{class|function}]", * b"KSPPythonSetType", defval, name, sizeof(name), &found) ); opts; # <<<<<<<<<<<<<< * if found and name[0]: * CHKERR( KSPPythonSetType_PYTHON(ksp, name) ) */ ((void)PetscOptionsObject); /* "petsc4py/PETSc/libpetsc4py.pyx":1711 * b"-ksp_python_type", b"Python [package.]module[.{class|function}]", * b"KSPPythonSetType", defval, name, sizeof(name), &found) ); opts; * if found and name[0]: # <<<<<<<<<<<<<< * CHKERR( KSPPythonSetType_PYTHON(ksp, name) ) * # */ if (__pyx_v_found) { } else { __pyx_t_4 = __pyx_v_found; goto __pyx_L4_bool_binop_done; } __pyx_t_5 = ((__pyx_v_name[0]) != 0); __pyx_t_4 = __pyx_t_5; __pyx_L4_bool_binop_done:; if (__pyx_t_4) { /* "petsc4py/PETSc/libpetsc4py.pyx":1712 * b"KSPPythonSetType", defval, name, sizeof(name), &found) ); opts; * if found and name[0]: * CHKERR( KSPPythonSetType_PYTHON(ksp, name) ) # <<<<<<<<<<<<<< * # * cdef setFromOptions = PyKSP(ksp).setFromOptions */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_KSPPythonSetType_PYTHON(__pyx_v_ksp, __pyx_v_name); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1712, __pyx_L1_error) __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_t_3); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1712, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":1711 * b"-ksp_python_type", b"Python [package.]module[.{class|function}]", * b"KSPPythonSetType", defval, name, sizeof(name), &found) ); opts; * if found and name[0]: # <<<<<<<<<<<<<< * CHKERR( KSPPythonSetType_PYTHON(ksp, name) ) * # */ } /* "petsc4py/PETSc/libpetsc4py.pyx":1714 * CHKERR( KSPPythonSetType_PYTHON(ksp, name) ) * # * cdef setFromOptions = PyKSP(ksp).setFromOptions # <<<<<<<<<<<<<< * if setFromOptions is not None: * setFromOptions(KSP_(ksp)) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyKSP(__pyx_v_ksp)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1714, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_setFromOptions); if (unlikely(!__pyx_t_7)) __PYX_ERR(11, 1714, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_setFromOptions = __pyx_t_7; __pyx_t_7 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1715 * # * cdef setFromOptions = PyKSP(ksp).setFromOptions * if setFromOptions is not None: # <<<<<<<<<<<<<< * setFromOptions(KSP_(ksp)) * return FunctionEnd() */ __pyx_t_4 = (__pyx_v_setFromOptions != Py_None); if (__pyx_t_4) { /* "petsc4py/PETSc/libpetsc4py.pyx":1716 * cdef setFromOptions = PyKSP(ksp).setFromOptions * if setFromOptions is not None: * setFromOptions(KSP_(ksp)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_KSP_(__pyx_v_ksp)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1716, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_setFromOptions); __pyx_t_8 = __pyx_v_setFromOptions; __pyx_t_9 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_8))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_1}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(11, 1716, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1715 * # * cdef setFromOptions = PyKSP(ksp).setFromOptions * if setFromOptions is not None: # <<<<<<<<<<<<<< * setFromOptions(KSP_(ksp)) * return FunctionEnd() */ } /* "petsc4py/PETSc/libpetsc4py.pyx":1717 * if setFromOptions is not None: * setFromOptions(KSP_(ksp)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode KSPView_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":1698 * return FunctionEnd() * * cdef PetscErrorCode KSPSetFromOptions_Python( # <<<<<<<<<<<<<< * PetscKSP ksp, * PetscOptionItems *PetscOptionsObject */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("petsc4py.PETSc.KSPSetFromOptions_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_setFromOptions); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":1719 * return FunctionEnd() * * cdef PetscErrorCode KSPView_Python( # <<<<<<<<<<<<<< * PetscKSP ksp, * PetscViewer vwr, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_KSPView_Python(KSP __pyx_v_ksp, PetscViewer __pyx_v_vwr) { PyObject *__pyx_v_view = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("KSPView_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":1724 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"KSPView_Python") # <<<<<<<<<<<<<< * viewcontext(PyKSP(ksp), vwr) * cdef view = PyKSP(ksp).view */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"KSPView_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":1725 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"KSPView_Python") * viewcontext(PyKSP(ksp), vwr) # <<<<<<<<<<<<<< * cdef view = PyKSP(ksp).view * if view is not None: */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyKSP(__pyx_v_ksp)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1725, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_viewcontext(((struct __pyx_obj_8petsc4py_5PETSc__PyObj *)__pyx_t_1), __pyx_v_vwr); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(11, 1725, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1726 * FunctionBegin(b"KSPView_Python") * viewcontext(PyKSP(ksp), vwr) * cdef view = PyKSP(ksp).view # <<<<<<<<<<<<<< * if view is not None: * view(KSP_(ksp), Viewer_(vwr)) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyKSP(__pyx_v_ksp)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1726, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_view); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 1726, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_view = __pyx_t_3; __pyx_t_3 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1727 * viewcontext(PyKSP(ksp), vwr) * cdef view = PyKSP(ksp).view * if view is not None: # <<<<<<<<<<<<<< * view(KSP_(ksp), Viewer_(vwr)) * return FunctionEnd() */ __pyx_t_4 = (__pyx_v_view != Py_None); if (__pyx_t_4) { /* "petsc4py/PETSc/libpetsc4py.pyx":1728 * cdef view = PyKSP(ksp).view * if view is not None: * view(KSP_(ksp), Viewer_(vwr)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_KSP_(__pyx_v_ksp)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1728, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Viewer_(__pyx_v_vwr)); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 1728, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_view); __pyx_t_6 = __pyx_v_view; __pyx_t_7 = NULL; __pyx_t_2 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_2 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_1, __pyx_t_5}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_2, 2+__pyx_t_2); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 1728, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1727 * viewcontext(PyKSP(ksp), vwr) * cdef view = PyKSP(ksp).view * if view is not None: # <<<<<<<<<<<<<< * view(KSP_(ksp), Viewer_(vwr)) * return FunctionEnd() */ } /* "petsc4py/PETSc/libpetsc4py.pyx":1729 * if view is not None: * view(KSP_(ksp), Viewer_(vwr)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode KSPBuildSolution_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":1719 * return FunctionEnd() * * cdef PetscErrorCode KSPView_Python( # <<<<<<<<<<<<<< * PetscKSP ksp, * PetscViewer vwr, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.KSPView_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_view); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":1731 * return FunctionEnd() * * cdef PetscErrorCode KSPBuildSolution_Python( # <<<<<<<<<<<<<< * PetscKSP ksp, * PetscVec v, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_KSPBuildSolution_Python(KSP __pyx_v_ksp, Vec __pyx_v_v, Vec *__pyx_v_V) { Vec __pyx_v_x; PyObject *__pyx_v_buildSolution = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; PetscErrorCode __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("KSPBuildSolution_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":1737 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"KSPBuildSolution_Python") # <<<<<<<<<<<<<< * cdef PetscVec x = v * cdef buildSolution = PyKSP(ksp).buildSolution */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"KSPBuildSolution_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":1738 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"KSPBuildSolution_Python") * cdef PetscVec x = v # <<<<<<<<<<<<<< * cdef buildSolution = PyKSP(ksp).buildSolution * if buildSolution is not None: */ __pyx_v_x = __pyx_v_v; /* "petsc4py/PETSc/libpetsc4py.pyx":1739 * FunctionBegin(b"KSPBuildSolution_Python") * cdef PetscVec x = v * cdef buildSolution = PyKSP(ksp).buildSolution # <<<<<<<<<<<<<< * if buildSolution is not None: * if x == NULL: pass # XXX */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyKSP(__pyx_v_ksp)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1739, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_buildSolution); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1739, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_buildSolution = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1740 * cdef PetscVec x = v * cdef buildSolution = PyKSP(ksp).buildSolution * if buildSolution is not None: # <<<<<<<<<<<<<< * if x == NULL: pass # XXX * buildSolution(KSP_(ksp), Vec_(x)) */ __pyx_t_3 = (__pyx_v_buildSolution != Py_None); if (__pyx_t_3) { /* "petsc4py/PETSc/libpetsc4py.pyx":1741 * cdef buildSolution = PyKSP(ksp).buildSolution * if buildSolution is not None: * if x == NULL: pass # XXX # <<<<<<<<<<<<<< * buildSolution(KSP_(ksp), Vec_(x)) * if V != NULL: V[0] = x */ __pyx_t_3 = (__pyx_v_x == NULL); if (__pyx_t_3) { } /* "petsc4py/PETSc/libpetsc4py.pyx":1742 * if buildSolution is not None: * if x == NULL: pass # XXX * buildSolution(KSP_(ksp), Vec_(x)) # <<<<<<<<<<<<<< * if V != NULL: V[0] = x * else: */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_KSP_(__pyx_v_ksp)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1742, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_x)); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 1742, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_buildSolution); __pyx_t_5 = __pyx_v_buildSolution; __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_1, __pyx_t_4}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1742, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1743 * if x == NULL: pass # XXX * buildSolution(KSP_(ksp), Vec_(x)) * if V != NULL: V[0] = x # <<<<<<<<<<<<<< * else: * CHKERR( KSPBuildSolutionDefault(ksp, v, V) ) */ __pyx_t_3 = (__pyx_v_V != NULL); if (__pyx_t_3) { (__pyx_v_V[0]) = __pyx_v_x; } /* "petsc4py/PETSc/libpetsc4py.pyx":1740 * cdef PetscVec x = v * cdef buildSolution = PyKSP(ksp).buildSolution * if buildSolution is not None: # <<<<<<<<<<<<<< * if x == NULL: pass # XXX * buildSolution(KSP_(ksp), Vec_(x)) */ goto __pyx_L3; } /* "petsc4py/PETSc/libpetsc4py.pyx":1745 * if V != NULL: V[0] = x * else: * CHKERR( KSPBuildSolutionDefault(ksp, v, V) ) # <<<<<<<<<<<<<< * return FunctionEnd() * */ /*else*/ { __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPBuildSolutionDefault(__pyx_v_ksp, __pyx_v_v, __pyx_v_V)); if (unlikely(__pyx_t_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1745, __pyx_L1_error) } __pyx_L3:; /* "petsc4py/PETSc/libpetsc4py.pyx":1746 * else: * CHKERR( KSPBuildSolutionDefault(ksp, v, V) ) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode KSPBuildResidual_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":1731 * return FunctionEnd() * * cdef PetscErrorCode KSPBuildSolution_Python( # <<<<<<<<<<<<<< * PetscKSP ksp, * PetscVec v, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.KSPBuildSolution_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_buildSolution); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":1748 * return FunctionEnd() * * cdef PetscErrorCode KSPBuildResidual_Python( # <<<<<<<<<<<<<< * PetscKSP ksp, * PetscVec t, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_KSPBuildResidual_Python(KSP __pyx_v_ksp, Vec __pyx_v_t, Vec __pyx_v_v, Vec *__pyx_v_V) { PyObject *__pyx_v_buildResidual = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; PetscErrorCode __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("KSPBuildResidual_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":1755 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"KSPBuildResidual_Python") # <<<<<<<<<<<<<< * cdef buildResidual = PyKSP(ksp).buildResidual * if buildResidual is not None: */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"KSPBuildResidual_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":1756 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"KSPBuildResidual_Python") * cdef buildResidual = PyKSP(ksp).buildResidual # <<<<<<<<<<<<<< * if buildResidual is not None: * buildResidual(KSP_(ksp), Vec_(t), Vec_(v)) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyKSP(__pyx_v_ksp)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1756, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_buildResidual); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1756, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_buildResidual = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1757 * FunctionBegin(b"KSPBuildResidual_Python") * cdef buildResidual = PyKSP(ksp).buildResidual * if buildResidual is not None: # <<<<<<<<<<<<<< * buildResidual(KSP_(ksp), Vec_(t), Vec_(v)) * if V != NULL: V[0] = v */ __pyx_t_3 = (__pyx_v_buildResidual != Py_None); if (__pyx_t_3) { /* "petsc4py/PETSc/libpetsc4py.pyx":1758 * cdef buildResidual = PyKSP(ksp).buildResidual * if buildResidual is not None: * buildResidual(KSP_(ksp), Vec_(t), Vec_(v)) # <<<<<<<<<<<<<< * if V != NULL: V[0] = v * else: */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_KSP_(__pyx_v_ksp)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1758, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_t)); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 1758, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_v)); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 1758, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_buildResidual); __pyx_t_6 = __pyx_v_buildResidual; __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_7, __pyx_t_1, __pyx_t_4, __pyx_t_5}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 3+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1758, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1759 * if buildResidual is not None: * buildResidual(KSP_(ksp), Vec_(t), Vec_(v)) * if V != NULL: V[0] = v # <<<<<<<<<<<<<< * else: * CHKERR( KSPBuildResidualDefault(ksp, t, v, V) ) */ __pyx_t_3 = (__pyx_v_V != NULL); if (__pyx_t_3) { (__pyx_v_V[0]) = __pyx_v_v; } /* "petsc4py/PETSc/libpetsc4py.pyx":1757 * FunctionBegin(b"KSPBuildResidual_Python") * cdef buildResidual = PyKSP(ksp).buildResidual * if buildResidual is not None: # <<<<<<<<<<<<<< * buildResidual(KSP_(ksp), Vec_(t), Vec_(v)) * if V != NULL: V[0] = v */ goto __pyx_L3; } /* "petsc4py/PETSc/libpetsc4py.pyx":1761 * if V != NULL: V[0] = v * else: * CHKERR( KSPBuildResidualDefault(ksp, t, v, V) ) # <<<<<<<<<<<<<< * return FunctionEnd() * */ /*else*/ { __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPBuildResidualDefault(__pyx_v_ksp, __pyx_v_t, __pyx_v_v, __pyx_v_V)); if (unlikely(__pyx_t_9 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1761, __pyx_L1_error) } __pyx_L3:; /* "petsc4py/PETSc/libpetsc4py.pyx":1762 * else: * CHKERR( KSPBuildResidualDefault(ksp, t, v, V) ) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode KSPSolve_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":1748 * return FunctionEnd() * * cdef PetscErrorCode KSPBuildResidual_Python( # <<<<<<<<<<<<<< * PetscKSP ksp, * PetscVec t, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.KSPBuildResidual_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_buildResidual); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":1764 * return FunctionEnd() * * cdef PetscErrorCode KSPSolve_Python( # <<<<<<<<<<<<<< * PetscKSP ksp, * ) \ */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_KSPSolve_Python(KSP __pyx_v_ksp) { Vec __pyx_v_B; Vec __pyx_v_X; PyObject *__pyx_v_solve = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("KSPSolve_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":1768 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"KSPSolve_Python") # <<<<<<<<<<<<<< * cdef PetscVec B = NULL, X = NULL * CHKERR( KSPGetRhs(ksp, &B) ) */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"KSPSolve_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":1769 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"KSPSolve_Python") * cdef PetscVec B = NULL, X = NULL # <<<<<<<<<<<<<< * CHKERR( KSPGetRhs(ksp, &B) ) * CHKERR( KSPGetSolution(ksp, &X) ) */ __pyx_v_B = NULL; __pyx_v_X = NULL; /* "petsc4py/PETSc/libpetsc4py.pyx":1770 * FunctionBegin(b"KSPSolve_Python") * cdef PetscVec B = NULL, X = NULL * CHKERR( KSPGetRhs(ksp, &B) ) # <<<<<<<<<<<<<< * CHKERR( KSPGetSolution(ksp, &X) ) * # */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPGetRhs(__pyx_v_ksp, (&__pyx_v_B))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1770, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":1771 * cdef PetscVec B = NULL, X = NULL * CHKERR( KSPGetRhs(ksp, &B) ) * CHKERR( KSPGetSolution(ksp, &X) ) # <<<<<<<<<<<<<< * # * ksp.iter = 0 */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPGetSolution(__pyx_v_ksp, (&__pyx_v_X))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1771, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":1773 * CHKERR( KSPGetSolution(ksp, &X) ) * # * ksp.iter = 0 # <<<<<<<<<<<<<< * ksp.reason = KSP_CONVERGED_ITERATING * # */ __pyx_v_ksp->its = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1774 * # * ksp.iter = 0 * ksp.reason = KSP_CONVERGED_ITERATING # <<<<<<<<<<<<<< * # * cdef solve = None */ __pyx_v_ksp->reason = KSP_CONVERGED_ITERATING; /* "petsc4py/PETSc/libpetsc4py.pyx":1776 * ksp.reason = KSP_CONVERGED_ITERATING * # * cdef solve = None # <<<<<<<<<<<<<< * if ksp.transpose_solve: * solve = PyKSP(ksp).solveTranspose */ __Pyx_INCREF(Py_None); __pyx_v_solve = Py_None; /* "petsc4py/PETSc/libpetsc4py.pyx":1777 * # * cdef solve = None * if ksp.transpose_solve: # <<<<<<<<<<<<<< * solve = PyKSP(ksp).solveTranspose * else: */ if (__pyx_v_ksp->transpose_solve) { /* "petsc4py/PETSc/libpetsc4py.pyx":1778 * cdef solve = None * if ksp.transpose_solve: * solve = PyKSP(ksp).solveTranspose # <<<<<<<<<<<<<< * else: * solve = PyKSP(ksp).solve */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyKSP(__pyx_v_ksp)); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1778, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_solveTranspose); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 1778, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_solve, __pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1777 * # * cdef solve = None * if ksp.transpose_solve: # <<<<<<<<<<<<<< * solve = PyKSP(ksp).solveTranspose * else: */ goto __pyx_L3; } /* "petsc4py/PETSc/libpetsc4py.pyx":1780 * solve = PyKSP(ksp).solveTranspose * else: * solve = PyKSP(ksp).solve # <<<<<<<<<<<<<< * if solve is not None: * solve(KSP_(ksp), Vec_(B), Vec_(X)) */ /*else*/ { __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyKSP(__pyx_v_ksp)); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 1780, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_solve); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1780, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_solve, __pyx_t_2); __pyx_t_2 = 0; } __pyx_L3:; /* "petsc4py/PETSc/libpetsc4py.pyx":1781 * else: * solve = PyKSP(ksp).solve * if solve is not None: # <<<<<<<<<<<<<< * solve(KSP_(ksp), Vec_(B), Vec_(X)) * else: */ __pyx_t_4 = (__pyx_v_solve != Py_None); if (__pyx_t_4) { /* "petsc4py/PETSc/libpetsc4py.pyx":1782 * solve = PyKSP(ksp).solve * if solve is not None: * solve(KSP_(ksp), Vec_(B), Vec_(X)) # <<<<<<<<<<<<<< * else: * KSPSolve_Python_default(ksp, B, X) */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_KSP_(__pyx_v_ksp)); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 1782, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_B)); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 1782, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_X)); if (unlikely(!__pyx_t_6)) __PYX_ERR(11, 1782, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_solve); __pyx_t_7 = __pyx_v_solve; __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_8, __pyx_t_3, __pyx_t_5, __pyx_t_6}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 3+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1782, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1781 * else: * solve = PyKSP(ksp).solve * if solve is not None: # <<<<<<<<<<<<<< * solve(KSP_(ksp), Vec_(B), Vec_(X)) * else: */ goto __pyx_L4; } /* "petsc4py/PETSc/libpetsc4py.pyx":1784 * solve(KSP_(ksp), Vec_(B), Vec_(X)) * else: * KSPSolve_Python_default(ksp, B, X) # <<<<<<<<<<<<<< * return FunctionEnd() * */ /*else*/ { __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_KSPSolve_Python_default(__pyx_v_ksp, __pyx_v_B, __pyx_v_X); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1784, __pyx_L1_error) } __pyx_L4:; /* "petsc4py/PETSc/libpetsc4py.pyx":1785 * else: * KSPSolve_Python_default(ksp, B, X) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode KSPSolve_Python_default( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":1764 * return FunctionEnd() * * cdef PetscErrorCode KSPSolve_Python( # <<<<<<<<<<<<<< * PetscKSP ksp, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("petsc4py.PETSc.KSPSolve_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_solve); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":1787 * return FunctionEnd() * * cdef PetscErrorCode KSPSolve_Python_default( # <<<<<<<<<<<<<< * PetscKSP ksp, * PetscVec B, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_KSPSolve_Python_default(KSP __pyx_v_ksp, Vec __pyx_v_B, Vec __pyx_v_X) { Vec __pyx_v_t; Vec __pyx_v_v; CYTHON_UNUSED PetscInt __pyx_v_its; Vec __pyx_v_R; PetscReal __pyx_v_rnorm; PetscErrorCode __pyx_r; PetscErrorCode __pyx_t_1; int __pyx_t_2; PetscInt __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif /* "petsc4py/PETSc/libpetsc4py.pyx":1793 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"KSPSolve_Python_default") # <<<<<<<<<<<<<< * # * cdef PetscVec t = NULL */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"KSPSolve_Python_default")); /* "petsc4py/PETSc/libpetsc4py.pyx":1795 * FunctionBegin(b"KSPSolve_Python_default") * # * cdef PetscVec t = NULL # <<<<<<<<<<<<<< * CHKERR( PetscObjectQuery( * ksp, */ __pyx_v_t = NULL; /* "petsc4py/PETSc/libpetsc4py.pyx":1796 * # * cdef PetscVec t = NULL * CHKERR( PetscObjectQuery( # <<<<<<<<<<<<<< * ksp, * b"@ksp.vec_work_sol", */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectQuery(((PetscObject)__pyx_v_ksp), ((char *)"@ksp.vec_work_sol"), ((PetscObject *)(&__pyx_v_t)))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1796, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":1800 * b"@ksp.vec_work_sol", * &t) ) * if t == NULL: # <<<<<<<<<<<<<< * CHKERR( VecDuplicate(X, &t) ) * CHKERR( PetscObjectCompose( */ __pyx_t_2 = (__pyx_v_t == NULL); if (__pyx_t_2) { /* "petsc4py/PETSc/libpetsc4py.pyx":1801 * &t) ) * if t == NULL: * CHKERR( VecDuplicate(X, &t) ) # <<<<<<<<<<<<<< * CHKERR( PetscObjectCompose( * ksp, */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecDuplicate(__pyx_v_X, (&__pyx_v_t))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1801, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":1802 * if t == NULL: * CHKERR( VecDuplicate(X, &t) ) * CHKERR( PetscObjectCompose( # <<<<<<<<<<<<<< * ksp, * b"@ksp.vec_work_sol", */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectCompose(((PetscObject)__pyx_v_ksp), ((char *)"@ksp.vec_work_sol"), ((PetscObject)__pyx_v_t))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1802, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":1800 * b"@ksp.vec_work_sol", * &t) ) * if t == NULL: # <<<<<<<<<<<<<< * CHKERR( VecDuplicate(X, &t) ) * CHKERR( PetscObjectCompose( */ } /* "petsc4py/PETSc/libpetsc4py.pyx":1806 * b"@ksp.vec_work_sol", * t) ) * cdef PetscVec v = NULL # <<<<<<<<<<<<<< * CHKERR( PetscObjectQuery( * ksp, */ __pyx_v_v = NULL; /* "petsc4py/PETSc/libpetsc4py.pyx":1807 * t) ) * cdef PetscVec v = NULL * CHKERR( PetscObjectQuery( # <<<<<<<<<<<<<< * ksp, * b"@ksp.vec_work_res", */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectQuery(((PetscObject)__pyx_v_ksp), ((char *)"@ksp.vec_work_res"), ((PetscObject *)(&__pyx_v_v)))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1807, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":1811 * b"@ksp.vec_work_res", * &v) ) * if v == NULL: # <<<<<<<<<<<<<< * CHKERR( VecDuplicate(B, &v) ) * CHKERR( PetscObjectCompose( */ __pyx_t_2 = (__pyx_v_v == NULL); if (__pyx_t_2) { /* "petsc4py/PETSc/libpetsc4py.pyx":1812 * &v) ) * if v == NULL: * CHKERR( VecDuplicate(B, &v) ) # <<<<<<<<<<<<<< * CHKERR( PetscObjectCompose( * ksp, */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecDuplicate(__pyx_v_B, (&__pyx_v_v))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1812, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":1813 * if v == NULL: * CHKERR( VecDuplicate(B, &v) ) * CHKERR( PetscObjectCompose( # <<<<<<<<<<<<<< * ksp, * b"@ksp.vec_work_res", */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectCompose(((PetscObject)__pyx_v_ksp), ((char *)"@ksp.vec_work_res"), ((PetscObject)__pyx_v_v))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1813, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":1811 * b"@ksp.vec_work_res", * &v) ) * if v == NULL: # <<<<<<<<<<<<<< * CHKERR( VecDuplicate(B, &v) ) * CHKERR( PetscObjectCompose( */ } /* "petsc4py/PETSc/libpetsc4py.pyx":1818 * v) ) * # * cdef PetscInt its = 0 # <<<<<<<<<<<<<< * cdef PetscVec R = NULL * cdef PetscReal rnorm = 0 */ __pyx_v_its = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1819 * # * cdef PetscInt its = 0 * cdef PetscVec R = NULL # <<<<<<<<<<<<<< * cdef PetscReal rnorm = 0 * # */ __pyx_v_R = NULL; /* "petsc4py/PETSc/libpetsc4py.pyx":1820 * cdef PetscInt its = 0 * cdef PetscVec R = NULL * cdef PetscReal rnorm = 0 # <<<<<<<<<<<<<< * # * CHKERR( KSPBuildResidual(ksp, t, v, &R) ) */ __pyx_v_rnorm = 0.0; /* "petsc4py/PETSc/libpetsc4py.pyx":1822 * cdef PetscReal rnorm = 0 * # * CHKERR( KSPBuildResidual(ksp, t, v, &R) ) # <<<<<<<<<<<<<< * CHKERR( VecNorm(R, PETSC_NORM_2, &rnorm) ) * # */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPBuildResidual(__pyx_v_ksp, __pyx_v_t, __pyx_v_v, (&__pyx_v_R))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1822, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":1823 * # * CHKERR( KSPBuildResidual(ksp, t, v, &R) ) * CHKERR( VecNorm(R, PETSC_NORM_2, &rnorm) ) # <<<<<<<<<<<<<< * # * CHKERR( KSPConverged(ksp, ksp.iter, rnorm, &ksp.reason) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecNorm(__pyx_v_R, NORM_2, (&__pyx_v_rnorm))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1823, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":1825 * CHKERR( VecNorm(R, PETSC_NORM_2, &rnorm) ) * # * CHKERR( KSPConverged(ksp, ksp.iter, rnorm, &ksp.reason) ) # <<<<<<<<<<<<<< * CHKERR( KSPLogHistory(ksp, ksp.norm) ) * CHKERR( KSPMonitor(ksp, ksp.iter, ksp.norm) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPConverged(__pyx_v_ksp, __pyx_v_ksp->its, __pyx_v_rnorm, (&__pyx_v_ksp->reason))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1825, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":1826 * # * CHKERR( KSPConverged(ksp, ksp.iter, rnorm, &ksp.reason) ) * CHKERR( KSPLogHistory(ksp, ksp.norm) ) # <<<<<<<<<<<<<< * CHKERR( KSPMonitor(ksp, ksp.iter, ksp.norm) ) * for its from 0 <= its < ksp.max_its: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPLogHistory(__pyx_v_ksp, __pyx_v_ksp->rnorm)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1826, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":1827 * CHKERR( KSPConverged(ksp, ksp.iter, rnorm, &ksp.reason) ) * CHKERR( KSPLogHistory(ksp, ksp.norm) ) * CHKERR( KSPMonitor(ksp, ksp.iter, ksp.norm) ) # <<<<<<<<<<<<<< * for its from 0 <= its < ksp.max_its: * if ksp.reason: break */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPMonitor(__pyx_v_ksp, __pyx_v_ksp->its, __pyx_v_ksp->rnorm)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1827, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":1828 * CHKERR( KSPLogHistory(ksp, ksp.norm) ) * CHKERR( KSPMonitor(ksp, ksp.iter, ksp.norm) ) * for its from 0 <= its < ksp.max_its: # <<<<<<<<<<<<<< * if ksp.reason: break * KSPPreStep_Python(ksp) */ __pyx_t_3 = __pyx_v_ksp->max_it; for (__pyx_v_its = 0; __pyx_v_its < __pyx_t_3; __pyx_v_its++) { /* "petsc4py/PETSc/libpetsc4py.pyx":1829 * CHKERR( KSPMonitor(ksp, ksp.iter, ksp.norm) ) * for its from 0 <= its < ksp.max_its: * if ksp.reason: break # <<<<<<<<<<<<<< * KSPPreStep_Python(ksp) * # */ if (__pyx_v_ksp->reason) { goto __pyx_L6_break; } /* "petsc4py/PETSc/libpetsc4py.pyx":1830 * for its from 0 <= its < ksp.max_its: * if ksp.reason: break * KSPPreStep_Python(ksp) # <<<<<<<<<<<<<< * # * KSPStep_Python(ksp, B, X) # FIXME? B? */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_KSPPreStep_Python(__pyx_v_ksp); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1830, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":1832 * KSPPreStep_Python(ksp) * # * KSPStep_Python(ksp, B, X) # FIXME? B? # <<<<<<<<<<<<<< * CHKERR( KSPBuildResidual(ksp, t, v, &R) ) * CHKERR( VecNorm(R, PETSC_NORM_2, &rnorm) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_KSPStep_Python(__pyx_v_ksp, __pyx_v_B, __pyx_v_X); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1832, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":1833 * # * KSPStep_Python(ksp, B, X) # FIXME? B? * CHKERR( KSPBuildResidual(ksp, t, v, &R) ) # <<<<<<<<<<<<<< * CHKERR( VecNorm(R, PETSC_NORM_2, &rnorm) ) * ksp.iter += 1 */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPBuildResidual(__pyx_v_ksp, __pyx_v_t, __pyx_v_v, (&__pyx_v_R))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1833, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":1834 * KSPStep_Python(ksp, B, X) # FIXME? B? * CHKERR( KSPBuildResidual(ksp, t, v, &R) ) * CHKERR( VecNorm(R, PETSC_NORM_2, &rnorm) ) # <<<<<<<<<<<<<< * ksp.iter += 1 * # */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecNorm(__pyx_v_R, NORM_2, (&__pyx_v_rnorm))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1834, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":1835 * CHKERR( KSPBuildResidual(ksp, t, v, &R) ) * CHKERR( VecNorm(R, PETSC_NORM_2, &rnorm) ) * ksp.iter += 1 # <<<<<<<<<<<<<< * # * KSPPostStep_Python(ksp) */ __pyx_v_ksp->its = (__pyx_v_ksp->its + 1); /* "petsc4py/PETSc/libpetsc4py.pyx":1837 * ksp.iter += 1 * # * KSPPostStep_Python(ksp) # <<<<<<<<<<<<<< * CHKERR( KSPConverged(ksp, ksp.iter, rnorm, &ksp.reason) ) * CHKERR( KSPLogHistory(ksp, ksp.norm) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_KSPPostStep_Python(__pyx_v_ksp); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1837, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":1838 * # * KSPPostStep_Python(ksp) * CHKERR( KSPConverged(ksp, ksp.iter, rnorm, &ksp.reason) ) # <<<<<<<<<<<<<< * CHKERR( KSPLogHistory(ksp, ksp.norm) ) * CHKERR( KSPMonitor(ksp, ksp.iter, ksp.norm) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPConverged(__pyx_v_ksp, __pyx_v_ksp->its, __pyx_v_rnorm, (&__pyx_v_ksp->reason))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1838, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":1839 * KSPPostStep_Python(ksp) * CHKERR( KSPConverged(ksp, ksp.iter, rnorm, &ksp.reason) ) * CHKERR( KSPLogHistory(ksp, ksp.norm) ) # <<<<<<<<<<<<<< * CHKERR( KSPMonitor(ksp, ksp.iter, ksp.norm) ) * if ksp.iter == ksp.max_its: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPLogHistory(__pyx_v_ksp, __pyx_v_ksp->rnorm)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1839, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":1840 * CHKERR( KSPConverged(ksp, ksp.iter, rnorm, &ksp.reason) ) * CHKERR( KSPLogHistory(ksp, ksp.norm) ) * CHKERR( KSPMonitor(ksp, ksp.iter, ksp.norm) ) # <<<<<<<<<<<<<< * if ksp.iter == ksp.max_its: * if ksp.reason == KSP_CONVERGED_ITERATING: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPMonitor(__pyx_v_ksp, __pyx_v_ksp->its, __pyx_v_ksp->rnorm)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1840, __pyx_L1_error) } __pyx_L6_break:; /* "petsc4py/PETSc/libpetsc4py.pyx":1841 * CHKERR( KSPLogHistory(ksp, ksp.norm) ) * CHKERR( KSPMonitor(ksp, ksp.iter, ksp.norm) ) * if ksp.iter == ksp.max_its: # <<<<<<<<<<<<<< * if ksp.reason == KSP_CONVERGED_ITERATING: * ksp.reason = KSP_DIVERGED_MAX_IT */ __pyx_t_2 = (__pyx_v_ksp->its == __pyx_v_ksp->max_it); if (__pyx_t_2) { /* "petsc4py/PETSc/libpetsc4py.pyx":1842 * CHKERR( KSPMonitor(ksp, ksp.iter, ksp.norm) ) * if ksp.iter == ksp.max_its: * if ksp.reason == KSP_CONVERGED_ITERATING: # <<<<<<<<<<<<<< * ksp.reason = KSP_DIVERGED_MAX_IT * # */ __pyx_t_2 = (__pyx_v_ksp->reason == KSP_CONVERGED_ITERATING); if (__pyx_t_2) { /* "petsc4py/PETSc/libpetsc4py.pyx":1843 * if ksp.iter == ksp.max_its: * if ksp.reason == KSP_CONVERGED_ITERATING: * ksp.reason = KSP_DIVERGED_MAX_IT # <<<<<<<<<<<<<< * # * return FunctionEnd() */ __pyx_v_ksp->reason = KSP_DIVERGED_ITS; /* "petsc4py/PETSc/libpetsc4py.pyx":1842 * CHKERR( KSPMonitor(ksp, ksp.iter, ksp.norm) ) * if ksp.iter == ksp.max_its: * if ksp.reason == KSP_CONVERGED_ITERATING: # <<<<<<<<<<<<<< * ksp.reason = KSP_DIVERGED_MAX_IT * # */ } /* "petsc4py/PETSc/libpetsc4py.pyx":1841 * CHKERR( KSPLogHistory(ksp, ksp.norm) ) * CHKERR( KSPMonitor(ksp, ksp.iter, ksp.norm) ) * if ksp.iter == ksp.max_its: # <<<<<<<<<<<<<< * if ksp.reason == KSP_CONVERGED_ITERATING: * ksp.reason = KSP_DIVERGED_MAX_IT */ } /* "petsc4py/PETSc/libpetsc4py.pyx":1845 * ksp.reason = KSP_DIVERGED_MAX_IT * # * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode KSPPreStep_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":1787 * return FunctionEnd() * * cdef PetscErrorCode KSPSolve_Python_default( # <<<<<<<<<<<<<< * PetscKSP ksp, * PetscVec B, */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSPSolve_Python_default", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":1847 * return FunctionEnd() * * cdef PetscErrorCode KSPPreStep_Python( # <<<<<<<<<<<<<< * PetscKSP ksp, * ) \ */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_KSPPreStep_Python(KSP __pyx_v_ksp) { PyObject *__pyx_v_preStep = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("KSPPreStep_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":1851 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"KSPPreStep_Python") # <<<<<<<<<<<<<< * cdef preStep = PyKSP(ksp).preStep * if preStep is not None: */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"KSPPreStep_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":1852 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"KSPPreStep_Python") * cdef preStep = PyKSP(ksp).preStep # <<<<<<<<<<<<<< * if preStep is not None: * preStep(KSP_(ksp)) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyKSP(__pyx_v_ksp)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1852, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_preStep); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1852, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_preStep = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1853 * FunctionBegin(b"KSPPreStep_Python") * cdef preStep = PyKSP(ksp).preStep * if preStep is not None: # <<<<<<<<<<<<<< * preStep(KSP_(ksp)) * return FunctionEnd() */ __pyx_t_3 = (__pyx_v_preStep != Py_None); if (__pyx_t_3) { /* "petsc4py/PETSc/libpetsc4py.pyx":1854 * cdef preStep = PyKSP(ksp).preStep * if preStep is not None: * preStep(KSP_(ksp)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_KSP_(__pyx_v_ksp)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1854, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_preStep); __pyx_t_4 = __pyx_v_preStep; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_1}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1854, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1853 * FunctionBegin(b"KSPPreStep_Python") * cdef preStep = PyKSP(ksp).preStep * if preStep is not None: # <<<<<<<<<<<<<< * preStep(KSP_(ksp)) * return FunctionEnd() */ } /* "petsc4py/PETSc/libpetsc4py.pyx":1855 * if preStep is not None: * preStep(KSP_(ksp)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode KSPPostStep_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":1847 * return FunctionEnd() * * cdef PetscErrorCode KSPPreStep_Python( # <<<<<<<<<<<<<< * PetscKSP ksp, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.KSPPreStep_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_preStep); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":1857 * return FunctionEnd() * * cdef PetscErrorCode KSPPostStep_Python( # <<<<<<<<<<<<<< * PetscKSP ksp, * ) \ */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_KSPPostStep_Python(KSP __pyx_v_ksp) { PyObject *__pyx_v_postStep = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("KSPPostStep_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":1861 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"KSPPostStep_Python") # <<<<<<<<<<<<<< * cdef postStep = PyKSP(ksp).postStep * if postStep is not None: */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"KSPPostStep_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":1862 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"KSPPostStep_Python") * cdef postStep = PyKSP(ksp).postStep # <<<<<<<<<<<<<< * if postStep is not None: * postStep(KSP_(ksp)) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyKSP(__pyx_v_ksp)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1862, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_postStep); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1862, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_postStep = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1863 * FunctionBegin(b"KSPPostStep_Python") * cdef postStep = PyKSP(ksp).postStep * if postStep is not None: # <<<<<<<<<<<<<< * postStep(KSP_(ksp)) * return FunctionEnd() */ __pyx_t_3 = (__pyx_v_postStep != Py_None); if (__pyx_t_3) { /* "petsc4py/PETSc/libpetsc4py.pyx":1864 * cdef postStep = PyKSP(ksp).postStep * if postStep is not None: * postStep(KSP_(ksp)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_KSP_(__pyx_v_ksp)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1864, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_postStep); __pyx_t_4 = __pyx_v_postStep; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_1}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1864, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1863 * FunctionBegin(b"KSPPostStep_Python") * cdef postStep = PyKSP(ksp).postStep * if postStep is not None: # <<<<<<<<<<<<<< * postStep(KSP_(ksp)) * return FunctionEnd() */ } /* "petsc4py/PETSc/libpetsc4py.pyx":1865 * if postStep is not None: * postStep(KSP_(ksp)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode KSPStep_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":1857 * return FunctionEnd() * * cdef PetscErrorCode KSPPostStep_Python( # <<<<<<<<<<<<<< * PetscKSP ksp, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.KSPPostStep_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_postStep); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":1867 * return FunctionEnd() * * cdef PetscErrorCode KSPStep_Python( # <<<<<<<<<<<<<< * PetscKSP ksp, * PetscVec B, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_KSPStep_Python(KSP __pyx_v_ksp, Vec __pyx_v_B, Vec __pyx_v_X) { PyObject *__pyx_v_step = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("KSPStep_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":1873 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"KSPStep_Python") # <<<<<<<<<<<<<< * cdef step = None * if ksp.transpose_solve: */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"KSPStep_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":1874 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"KSPStep_Python") * cdef step = None # <<<<<<<<<<<<<< * if ksp.transpose_solve: * step = PyKSP(ksp).stepTranspose */ __Pyx_INCREF(Py_None); __pyx_v_step = Py_None; /* "petsc4py/PETSc/libpetsc4py.pyx":1875 * FunctionBegin(b"KSPStep_Python") * cdef step = None * if ksp.transpose_solve: # <<<<<<<<<<<<<< * step = PyKSP(ksp).stepTranspose * if step is None: return UNSUPPORTED(b"stepTranspose") */ if (__pyx_v_ksp->transpose_solve) { /* "petsc4py/PETSc/libpetsc4py.pyx":1876 * cdef step = None * if ksp.transpose_solve: * step = PyKSP(ksp).stepTranspose # <<<<<<<<<<<<<< * if step is None: return UNSUPPORTED(b"stepTranspose") * else: */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyKSP(__pyx_v_ksp)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1876, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_stepTranspose); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1876, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_step, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1877 * if ksp.transpose_solve: * step = PyKSP(ksp).stepTranspose * if step is None: return UNSUPPORTED(b"stepTranspose") # <<<<<<<<<<<<<< * else: * step = PyKSP(ksp).step */ __pyx_t_3 = (__pyx_v_step == Py_None); if (__pyx_t_3) { __pyx_r = __pyx_f_8petsc4py_5PETSc_UNSUPPORTED(((char *)"stepTranspose")); goto __pyx_L0; } /* "petsc4py/PETSc/libpetsc4py.pyx":1875 * FunctionBegin(b"KSPStep_Python") * cdef step = None * if ksp.transpose_solve: # <<<<<<<<<<<<<< * step = PyKSP(ksp).stepTranspose * if step is None: return UNSUPPORTED(b"stepTranspose") */ goto __pyx_L3; } /* "petsc4py/PETSc/libpetsc4py.pyx":1879 * if step is None: return UNSUPPORTED(b"stepTranspose") * else: * step = PyKSP(ksp).step # <<<<<<<<<<<<<< * if step is None: return UNSUPPORTED(b"step") * step(KSP_(ksp), Vec_(B), Vec_(X)) */ /*else*/ { __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyKSP(__pyx_v_ksp)); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1879, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_step); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1879, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_step, __pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1880 * else: * step = PyKSP(ksp).step * if step is None: return UNSUPPORTED(b"step") # <<<<<<<<<<<<<< * step(KSP_(ksp), Vec_(B), Vec_(X)) * return FunctionEnd() */ __pyx_t_3 = (__pyx_v_step == Py_None); if (__pyx_t_3) { __pyx_r = __pyx_f_8petsc4py_5PETSc_UNSUPPORTED(((char *)"step")); goto __pyx_L0; } } __pyx_L3:; /* "petsc4py/PETSc/libpetsc4py.pyx":1881 * step = PyKSP(ksp).step * if step is None: return UNSUPPORTED(b"step") * step(KSP_(ksp), Vec_(B), Vec_(X)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_KSP_(__pyx_v_ksp)); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1881, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_B)); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 1881, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_X)); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 1881, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_step); __pyx_t_6 = __pyx_v_step; __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_7, __pyx_t_2, __pyx_t_4, __pyx_t_5}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 3+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1881, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1882 * if step is None: return UNSUPPORTED(b"step") * step(KSP_(ksp), Vec_(B), Vec_(X)) * return FunctionEnd() # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":1867 * return FunctionEnd() * * cdef PetscErrorCode KSPStep_Python( # <<<<<<<<<<<<<< * PetscKSP ksp, * PetscVec B, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.KSPStep_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_step); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":1911 * @cython.internal * cdef class _PySNES(_PyObj): pass * cdef inline _PySNES PySNES(PetscSNES snes): # <<<<<<<<<<<<<< * if snes != NULL and snes.data != NULL: * return <_PySNES>snes.data */ static CYTHON_INLINE struct __pyx_obj_8petsc4py_5PETSc__PySNES *__pyx_f_8petsc4py_5PETSc_PySNES(SNES __pyx_v_snes) { struct __pyx_obj_8petsc4py_5PETSc__PySNES *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PySNES", 1); /* "petsc4py/PETSc/libpetsc4py.pyx":1912 * cdef class _PySNES(_PyObj): pass * cdef inline _PySNES PySNES(PetscSNES snes): * if snes != NULL and snes.data != NULL: # <<<<<<<<<<<<<< * return <_PySNES>snes.data * else: */ __pyx_t_2 = (__pyx_v_snes != NULL); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = (__pyx_v_snes->data != NULL); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "petsc4py/PETSc/libpetsc4py.pyx":1913 * cdef inline _PySNES PySNES(PetscSNES snes): * if snes != NULL and snes.data != NULL: * return <_PySNES>snes.data # <<<<<<<<<<<<<< * else: * return _PySNES.__new__(_PySNES) */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)((struct __pyx_obj_8petsc4py_5PETSc__PySNES *)__pyx_v_snes->data)); __pyx_r = ((struct __pyx_obj_8petsc4py_5PETSc__PySNES *)__pyx_v_snes->data); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":1912 * cdef class _PySNES(_PyObj): pass * cdef inline _PySNES PySNES(PetscSNES snes): * if snes != NULL and snes.data != NULL: # <<<<<<<<<<<<<< * return <_PySNES>snes.data * else: */ } /* "petsc4py/PETSc/libpetsc4py.pyx":1915 * return <_PySNES>snes.data * else: * return _PySNES.__new__(_PySNES) # <<<<<<<<<<<<<< * * cdef public PetscErrorCode SNESPythonGetContext(PetscSNES snes, void **ctx) \ */ /*else*/ { __Pyx_XDECREF((PyObject *)__pyx_r); __pyx_t_3 = ((PyObject *)__pyx_tp_new_8petsc4py_5PETSc__PySNES(((PyTypeObject *)__pyx_ptype_8petsc4py_5PETSc__PySNES), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 1915, __pyx_L1_error) __Pyx_GOTREF((PyObject *)__pyx_t_3); __pyx_r = ((struct __pyx_obj_8petsc4py_5PETSc__PySNES *)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; } /* "petsc4py/PETSc/libpetsc4py.pyx":1911 * @cython.internal * cdef class _PySNES(_PyObj): pass * cdef inline _PySNES PySNES(PetscSNES snes): # <<<<<<<<<<<<<< * if snes != NULL and snes.data != NULL: * return <_PySNES>snes.data */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.PySNES", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":1917 * return _PySNES.__new__(_PySNES) * * cdef public PetscErrorCode SNESPythonGetContext(PetscSNES snes, void **ctx) \ # <<<<<<<<<<<<<< * except PETSC_ERR_PYTHON: * FunctionBegin(b"SNESPythonGetContext ") */ PetscErrorCode SNESPythonGetContext(SNES __pyx_v_snes, void **__pyx_v_ctx) { PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("SNESPythonGetContext", 1); /* "petsc4py/PETSc/libpetsc4py.pyx":1919 * cdef public PetscErrorCode SNESPythonGetContext(PetscSNES snes, void **ctx) \ * except PETSC_ERR_PYTHON: * FunctionBegin(b"SNESPythonGetContext ") # <<<<<<<<<<<<<< * PySNES(snes).getcontext(ctx) * return FunctionEnd() */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"SNESPythonGetContext ")); /* "petsc4py/PETSc/libpetsc4py.pyx":1920 * except PETSC_ERR_PYTHON: * FunctionBegin(b"SNESPythonGetContext ") * PySNES(snes).getcontext(ctx) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PySNES(__pyx_v_snes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1920, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__PySNES *)((struct __pyx_obj_8petsc4py_5PETSc__PySNES *)__pyx_t_1)->__pyx_base.__pyx_vtab)->__pyx_base.getcontext(((struct __pyx_obj_8petsc4py_5PETSc__PyObj *)__pyx_t_1), __pyx_v_ctx); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(11, 1920, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1921 * FunctionBegin(b"SNESPythonGetContext ") * PySNES(snes).getcontext(ctx) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef public PetscErrorCode SNESPythonSetContext(PetscSNES snes, void *ctx) \ */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":1917 * return _PySNES.__new__(_PySNES) * * cdef public PetscErrorCode SNESPythonGetContext(PetscSNES snes, void **ctx) \ # <<<<<<<<<<<<<< * except PETSC_ERR_PYTHON: * FunctionBegin(b"SNESPythonGetContext ") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.SNESPythonGetContext", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":1923 * return FunctionEnd() * * cdef public PetscErrorCode SNESPythonSetContext(PetscSNES snes, void *ctx) \ # <<<<<<<<<<<<<< * except PETSC_ERR_PYTHON: * FunctionBegin(b"SNESPythonSetContext ") */ PetscErrorCode SNESPythonSetContext(SNES __pyx_v_snes, void *__pyx_v_ctx) { PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("SNESPythonSetContext", 1); /* "petsc4py/PETSc/libpetsc4py.pyx":1925 * cdef public PetscErrorCode SNESPythonSetContext(PetscSNES snes, void *ctx) \ * except PETSC_ERR_PYTHON: * FunctionBegin(b"SNESPythonSetContext ") # <<<<<<<<<<<<<< * PySNES(snes).setcontext(ctx, SNES_(snes)) * return FunctionEnd() */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"SNESPythonSetContext ")); /* "petsc4py/PETSc/libpetsc4py.pyx":1926 * except PETSC_ERR_PYTHON: * FunctionBegin(b"SNESPythonSetContext ") * PySNES(snes).setcontext(ctx, SNES_(snes)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PySNES(__pyx_v_snes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1926, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_SNES_(__pyx_v_snes)); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1926, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__PySNES *)((struct __pyx_obj_8petsc4py_5PETSc__PySNES *)__pyx_t_1)->__pyx_base.__pyx_vtab)->__pyx_base.setcontext(((struct __pyx_obj_8petsc4py_5PETSc__PyObj *)__pyx_t_1), __pyx_v_ctx, ((struct PyPetscObjectObject *)__pyx_t_2)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(11, 1926, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1927 * FunctionBegin(b"SNESPythonSetContext ") * PySNES(snes).setcontext(ctx, SNES_(snes)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode SNESPythonSetType_PYTHON(PetscSNES snes, char name[]) \ */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":1923 * return FunctionEnd() * * cdef public PetscErrorCode SNESPythonSetContext(PetscSNES snes, void *ctx) \ # <<<<<<<<<<<<<< * except PETSC_ERR_PYTHON: * FunctionBegin(b"SNESPythonSetContext ") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNESPythonSetContext", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":1929 * return FunctionEnd() * * cdef PetscErrorCode SNESPythonSetType_PYTHON(PetscSNES snes, char name[]) \ # <<<<<<<<<<<<<< * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"SNESPythonSetType_PYTHON") */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNESPythonSetType_PYTHON(SNES __pyx_v_snes, char *__pyx_v_name) { PyObject *__pyx_v_ctx = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("SNESPythonSetType_PYTHON", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":1931 * cdef PetscErrorCode SNESPythonSetType_PYTHON(PetscSNES snes, char name[]) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"SNESPythonSetType_PYTHON") # <<<<<<<<<<<<<< * if name == NULL: return FunctionEnd() # XXX * cdef object ctx = createcontext(name) */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"SNESPythonSetType_PYTHON")); /* "petsc4py/PETSc/libpetsc4py.pyx":1932 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"SNESPythonSetType_PYTHON") * if name == NULL: return FunctionEnd() # XXX # <<<<<<<<<<<<<< * cdef object ctx = createcontext(name) * SNESPythonSetContext(snes, ctx) */ __pyx_t_1 = (__pyx_v_name == NULL); if (__pyx_t_1) { __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; } /* "petsc4py/PETSc/libpetsc4py.pyx":1933 * FunctionBegin(b"SNESPythonSetType_PYTHON") * if name == NULL: return FunctionEnd() # XXX * cdef object ctx = createcontext(name) # <<<<<<<<<<<<<< * SNESPythonSetContext(snes, ctx) * PySNES(snes).setname(name) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_createcontext(__pyx_v_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1933, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_ctx = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1934 * if name == NULL: return FunctionEnd() # XXX * cdef object ctx = createcontext(name) * SNESPythonSetContext(snes, ctx) # <<<<<<<<<<<<<< * PySNES(snes).setname(name) * return FunctionEnd() */ __pyx_t_3 = SNESPythonSetContext(__pyx_v_snes, ((void *)__pyx_v_ctx)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1934, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":1935 * cdef object ctx = createcontext(name) * SNESPythonSetContext(snes, ctx) * PySNES(snes).setname(name) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PySNES(__pyx_v_snes)); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1935, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__PySNES *)((struct __pyx_obj_8petsc4py_5PETSc__PySNES *)__pyx_t_2)->__pyx_base.__pyx_vtab)->__pyx_base.setname(((struct __pyx_obj_8petsc4py_5PETSc__PyObj *)__pyx_t_2), __pyx_v_name); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(11, 1935, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1936 * SNESPythonSetContext(snes, ctx) * PySNES(snes).setname(name) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode SNESPythonGetType_PYTHON(PetscSNES snes, const char *name[]) \ */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":1929 * return FunctionEnd() * * cdef PetscErrorCode SNESPythonSetType_PYTHON(PetscSNES snes, char name[]) \ # <<<<<<<<<<<<<< * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"SNESPythonSetType_PYTHON") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNESPythonSetType_PYTHON", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ctx); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":1938 * return FunctionEnd() * * cdef PetscErrorCode SNESPythonGetType_PYTHON(PetscSNES snes, const char *name[]) \ # <<<<<<<<<<<<<< * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"SNESPythonGetType_PYTHON") */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNESPythonGetType_PYTHON(SNES __pyx_v_snes, char const **__pyx_v_name) { PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; char *__pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("SNESPythonGetType_PYTHON", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":1940 * cdef PetscErrorCode SNESPythonGetType_PYTHON(PetscSNES snes, const char *name[]) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"SNESPythonGetType_PYTHON") # <<<<<<<<<<<<<< * name[0] = PySNES(snes).getname() * return FunctionEnd() */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"SNESPythonGetType_PYTHON")); /* "petsc4py/PETSc/libpetsc4py.pyx":1941 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"SNESPythonGetType_PYTHON") * name[0] = PySNES(snes).getname() # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PySNES(__pyx_v_snes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 1941, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__PySNES *)((struct __pyx_obj_8petsc4py_5PETSc__PySNES *)__pyx_t_1)->__pyx_base.__pyx_vtab)->__pyx_base.getname(((struct __pyx_obj_8petsc4py_5PETSc__PyObj *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((char *)NULL) && PyErr_Occurred())) __PYX_ERR(11, 1941, __pyx_L1_error) (__pyx_v_name[0]) = __pyx_t_2; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1942 * FunctionBegin(b"SNESPythonGetType_PYTHON") * name[0] = PySNES(snes).getname() * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode SNESCreate_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":1938 * return FunctionEnd() * * cdef PetscErrorCode SNESPythonGetType_PYTHON(PetscSNES snes, const char *name[]) \ # <<<<<<<<<<<<<< * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"SNESPythonGetType_PYTHON") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.SNESPythonGetType_PYTHON", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":1944 * return FunctionEnd() * * cdef PetscErrorCode SNESCreate_Python( # <<<<<<<<<<<<<< * PetscSNES snes, * ) \ */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNESCreate_Python(SNES __pyx_v_snes) { SNESOps __pyx_v_ops; SNESLineSearch __pyx_v_ls; PyObject *__pyx_v_ctx = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations SNESOps __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("SNESCreate_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":1948 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"SNESCreate_Python") # <<<<<<<<<<<<<< * # * cdef SNESOps ops = snes.ops */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"SNESCreate_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":1950 * FunctionBegin(b"SNESCreate_Python") * # * cdef SNESOps ops = snes.ops # <<<<<<<<<<<<<< * cdef PetscSNESLineSearch ls = NULL * ops.reset = SNESReset_Python */ __pyx_t_1 = __pyx_v_snes->ops; __pyx_v_ops = __pyx_t_1; /* "petsc4py/PETSc/libpetsc4py.pyx":1951 * # * cdef SNESOps ops = snes.ops * cdef PetscSNESLineSearch ls = NULL # <<<<<<<<<<<<<< * ops.reset = SNESReset_Python * ops.destroy = SNESDestroy_Python */ __pyx_v_ls = NULL; /* "petsc4py/PETSc/libpetsc4py.pyx":1952 * cdef SNESOps ops = snes.ops * cdef PetscSNESLineSearch ls = NULL * ops.reset = SNESReset_Python # <<<<<<<<<<<<<< * ops.destroy = SNESDestroy_Python * ops.setup = SNESSetUp_Python */ __pyx_v_ops->reset = __pyx_f_8petsc4py_5PETSc_SNESReset_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":1953 * cdef PetscSNESLineSearch ls = NULL * ops.reset = SNESReset_Python * ops.destroy = SNESDestroy_Python # <<<<<<<<<<<<<< * ops.setup = SNESSetUp_Python * ops.setfromoptions = SNESSetFromOptions_Python */ __pyx_v_ops->destroy = __pyx_f_8petsc4py_5PETSc_SNESDestroy_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":1954 * ops.reset = SNESReset_Python * ops.destroy = SNESDestroy_Python * ops.setup = SNESSetUp_Python # <<<<<<<<<<<<<< * ops.setfromoptions = SNESSetFromOptions_Python * ops.view = SNESView_Python */ __pyx_v_ops->setup = __pyx_f_8petsc4py_5PETSc_SNESSetUp_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":1955 * ops.destroy = SNESDestroy_Python * ops.setup = SNESSetUp_Python * ops.setfromoptions = SNESSetFromOptions_Python # <<<<<<<<<<<<<< * ops.view = SNESView_Python * ops.solve = SNESSolve_Python */ __pyx_v_ops->setfromoptions = __pyx_f_8petsc4py_5PETSc_SNESSetFromOptions_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":1956 * ops.setup = SNESSetUp_Python * ops.setfromoptions = SNESSetFromOptions_Python * ops.view = SNESView_Python # <<<<<<<<<<<<<< * ops.solve = SNESSolve_Python * # */ __pyx_v_ops->view = __pyx_f_8petsc4py_5PETSc_SNESView_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":1957 * ops.setfromoptions = SNESSetFromOptions_Python * ops.view = SNESView_Python * ops.solve = SNESSolve_Python # <<<<<<<<<<<<<< * # * CHKERR( PetscObjectComposeFunction( */ __pyx_v_ops->solve = __pyx_f_8petsc4py_5PETSc_SNESSolve_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":1959 * ops.solve = SNESSolve_Python * # * CHKERR( PetscObjectComposeFunction( # <<<<<<<<<<<<<< * snes, b"SNESPythonSetType_C", * SNESPythonSetType_PYTHON) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectComposeFunction(((PetscObject)__pyx_v_snes), ((char *)"SNESPythonSetType_C"), ((PetscVoidFunction)__pyx_f_8petsc4py_5PETSc_SNESPythonSetType_PYTHON))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1959, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":1962 * snes, b"SNESPythonSetType_C", * SNESPythonSetType_PYTHON) ) * CHKERR( PetscObjectComposeFunction( # <<<<<<<<<<<<<< * snes, b"SNESPythonGetType_C", * SNESPythonGetType_PYTHON) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectComposeFunction(((PetscObject)__pyx_v_snes), ((char *)"SNESPythonGetType_C"), ((PetscVoidFunction)__pyx_f_8petsc4py_5PETSc_SNESPythonGetType_PYTHON))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1962, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":1966 * SNESPythonGetType_PYTHON) ) * # * cdef ctx = PySNES(NULL) # <<<<<<<<<<<<<< * snes.data = ctx * */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PySNES(NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 1966, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_ctx = __pyx_t_3; __pyx_t_3 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1967 * # * cdef ctx = PySNES(NULL) * snes.data = ctx # <<<<<<<<<<<<<< * * # Ensure that the SNES has a linesearch object early enough that */ __pyx_v_snes->data = ((void *)__pyx_v_ctx); /* "petsc4py/PETSc/libpetsc4py.pyx":1971 * # Ensure that the SNES has a linesearch object early enough that * # it gets setFromOptions. * CHKERR( SNESGetLineSearch(snes, &ls) ) # <<<<<<<<<<<<<< * Py_INCREF(snes.data) * return FunctionEnd() */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetLineSearch(__pyx_v_snes, (&__pyx_v_ls))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1971, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":1972 * # it gets setFromOptions. * CHKERR( SNESGetLineSearch(snes, &ls) ) * Py_INCREF(snes.data) # <<<<<<<<<<<<<< * return FunctionEnd() * */ Py_INCREF(((PyObject *)__pyx_v_snes->data)); /* "petsc4py/PETSc/libpetsc4py.pyx":1973 * CHKERR( SNESGetLineSearch(snes, &ls) ) * Py_INCREF(snes.data) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef inline PetscErrorCode SNESDestroy_Python_inner( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":1944 * return FunctionEnd() * * cdef PetscErrorCode SNESCreate_Python( # <<<<<<<<<<<<<< * PetscSNES snes, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNESCreate_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ctx); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":1975 * return FunctionEnd() * * cdef inline PetscErrorCode SNESDestroy_Python_inner( # <<<<<<<<<<<<<< * PetscSNES snes, * ) \ */ static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNESDestroy_Python_inner(SNES __pyx_v_snes) { PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_t_2; int __pyx_t_3; char const *__pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("SNESDestroy_Python_inner", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":1979 * ) \ * except PETSC_ERR_PYTHON with gil: * try: # <<<<<<<<<<<<<< * addRef(snes) * SNESPythonSetContext(snes, NULL) */ /*try:*/ { /* "petsc4py/PETSc/libpetsc4py.pyx":1980 * except PETSC_ERR_PYTHON with gil: * try: * addRef(snes) # <<<<<<<<<<<<<< * SNESPythonSetContext(snes, NULL) * finally: */ __pyx_f_8petsc4py_5PETSc_addRef(__pyx_v_snes); /* "petsc4py/PETSc/libpetsc4py.pyx":1981 * try: * addRef(snes) * SNESPythonSetContext(snes, NULL) # <<<<<<<<<<<<<< * finally: * delRef(snes) */ __pyx_t_1 = SNESPythonSetContext(__pyx_v_snes, NULL); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1981, __pyx_L4_error) } /* "petsc4py/PETSc/libpetsc4py.pyx":1983 * SNESPythonSetContext(snes, NULL) * finally: * delRef(snes) # <<<<<<<<<<<<<< * Py_DECREF(snes.data) * snes.data = NULL */ /*finally:*/ { /*normal exit:*/{ __pyx_f_8petsc4py_5PETSc_delRef(__pyx_v_snes); /* "petsc4py/PETSc/libpetsc4py.pyx":1984 * finally: * delRef(snes) * Py_DECREF(snes.data) # <<<<<<<<<<<<<< * snes.data = NULL * return PETSC_SUCCESS */ Py_DECREF(((PyObject *)__pyx_v_snes->data)); /* "petsc4py/PETSc/libpetsc4py.pyx":1985 * delRef(snes) * Py_DECREF(snes.data) * snes.data = NULL # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_v_snes->data = NULL; goto __pyx_L5; } __pyx_L4_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0)) __Pyx_ErrFetch(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __pyx_t_2 = __pyx_lineno; __pyx_t_3 = __pyx_clineno; __pyx_t_4 = __pyx_filename; { /* "petsc4py/PETSc/libpetsc4py.pyx":1983 * SNESPythonSetContext(snes, NULL) * finally: * delRef(snes) # <<<<<<<<<<<<<< * Py_DECREF(snes.data) * snes.data = NULL */ __pyx_f_8petsc4py_5PETSc_delRef(__pyx_v_snes); /* "petsc4py/PETSc/libpetsc4py.pyx":1984 * finally: * delRef(snes) * Py_DECREF(snes.data) # <<<<<<<<<<<<<< * snes.data = NULL * return PETSC_SUCCESS */ Py_DECREF(((PyObject *)__pyx_v_snes->data)); /* "petsc4py/PETSc/libpetsc4py.pyx":1985 * delRef(snes) * Py_DECREF(snes.data) * snes.data = NULL # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_v_snes->data = NULL; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); } __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_ErrRestore(__pyx_t_5, __pyx_t_6, __pyx_t_7); __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_lineno = __pyx_t_2; __pyx_clineno = __pyx_t_3; __pyx_filename = __pyx_t_4; goto __pyx_L1_error; } __pyx_L5:; } /* "petsc4py/PETSc/libpetsc4py.pyx":1986 * Py_DECREF(snes.data) * snes.data = NULL * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * cdef PetscErrorCode SNESDestroy_Python( */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":1975 * return FunctionEnd() * * cdef inline PetscErrorCode SNESDestroy_Python_inner( # <<<<<<<<<<<<<< * PetscSNES snes, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNESDestroy_Python_inner", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":1988 * return PETSC_SUCCESS * * cdef PetscErrorCode SNESDestroy_Python( # <<<<<<<<<<<<<< * PetscSNES snes, * ) \ */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNESDestroy_Python(SNES __pyx_v_snes) { PetscErrorCode __pyx_r; PetscErrorCode __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save; #endif /* "petsc4py/PETSc/libpetsc4py.pyx":1992 * ) \ * except PETSC_ERR_PYTHON nogil: * FunctionBegin(b"SNESDestroy_Python") # <<<<<<<<<<<<<< * CHKERR( PetscObjectComposeFunction( * snes, b"SNESPythonSetType_C", */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"SNESDestroy_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":1993 * except PETSC_ERR_PYTHON nogil: * FunctionBegin(b"SNESDestroy_Python") * CHKERR( PetscObjectComposeFunction( # <<<<<<<<<<<<<< * snes, b"SNESPythonSetType_C", * NULL) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectComposeFunction(((PetscObject)__pyx_v_snes), ((char *)"SNESPythonSetType_C"), ((PetscVoidFunction)NULL))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1993, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":1996 * snes, b"SNESPythonSetType_C", * NULL) ) * CHKERR( PetscObjectComposeFunction( # <<<<<<<<<<<<<< * snes, b"SNESPythonGetType_C", * NULL) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectComposeFunction(((PetscObject)__pyx_v_snes), ((char *)"SNESPythonGetType_C"), ((PetscVoidFunction)NULL))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 1996, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2000 * NULL) ) * # * if Py_IsInitialized(): SNESDestroy_Python_inner(snes) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_2 = (Py_IsInitialized() != 0); if (__pyx_t_2) { __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_SNESDestroy_Python_inner(__pyx_v_snes); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2000, __pyx_L1_error) } /* "petsc4py/PETSc/libpetsc4py.pyx":2001 * # * if Py_IsInitialized(): SNESDestroy_Python_inner(snes) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode SNESSetUp_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":1988 * return PETSC_SUCCESS * * cdef PetscErrorCode SNESDestroy_Python( # <<<<<<<<<<<<<< * PetscSNES snes, * ) \ */ /* function exit code */ __pyx_L1_error:; #ifdef WITH_THREAD __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_AddTraceback("petsc4py.PETSc.SNESDestroy_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":2003 * return FunctionEnd() * * cdef PetscErrorCode SNESSetUp_Python( # <<<<<<<<<<<<<< * PetscSNES snes, * ) \ */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNESSetUp_Python(SNES __pyx_v_snes) { char __pyx_v_name[0x800]; PetscBool __pyx_v_found; PyObject *__pyx_v_setUp = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_t_4; PetscErrorCode __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("SNESSetUp_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":2007 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"SNESSetUp_Python") # <<<<<<<<<<<<<< * # * #SNESGetKSP(snes,&snes.ksp) */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"SNESSetUp_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":2012 * # * cdef char name[2048] * cdef PetscBool found = PETSC_FALSE # <<<<<<<<<<<<<< * if PySNES(snes).self is None: * CHKERR( PetscOptionsGetString(NULL, */ __pyx_v_found = PETSC_FALSE; /* "petsc4py/PETSc/libpetsc4py.pyx":2013 * cdef char name[2048] * cdef PetscBool found = PETSC_FALSE * if PySNES(snes).self is None: # <<<<<<<<<<<<<< * CHKERR( PetscOptionsGetString(NULL, * getPrefix(snes), b"-snes_python_type", */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PySNES(__pyx_v_snes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 2013, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (((struct __pyx_obj_8petsc4py_5PETSc__PySNES *)__pyx_t_1)->__pyx_base.self == Py_None); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "petsc4py/PETSc/libpetsc4py.pyx":2014 * cdef PetscBool found = PETSC_FALSE * if PySNES(snes).self is None: * CHKERR( PetscOptionsGetString(NULL, # <<<<<<<<<<<<<< * getPrefix(snes), b"-snes_python_type", * name, sizeof(name), &found) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsGetString(NULL, __pyx_f_8petsc4py_5PETSc_getPrefix(__pyx_v_snes), ((char *)"-snes_python_type"), __pyx_v_name, (sizeof(__pyx_v_name)), (&__pyx_v_found))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2014, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2017 * getPrefix(snes), b"-snes_python_type", * name, sizeof(name), &found) ) * if found and name[0]: # <<<<<<<<<<<<<< * CHKERR( SNESPythonSetType_PYTHON(snes, name) ) * if PySNES(snes).self is None: */ if (__pyx_v_found) { } else { __pyx_t_2 = __pyx_v_found; goto __pyx_L5_bool_binop_done; } __pyx_t_4 = ((__pyx_v_name[0]) != 0); __pyx_t_2 = __pyx_t_4; __pyx_L5_bool_binop_done:; if (__pyx_t_2) { /* "petsc4py/PETSc/libpetsc4py.pyx":2018 * name, sizeof(name), &found) ) * if found and name[0]: * CHKERR( SNESPythonSetType_PYTHON(snes, name) ) # <<<<<<<<<<<<<< * if PySNES(snes).self is None: * return PetscSETERR(PETSC_ERR_USER, */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_SNESPythonSetType_PYTHON(__pyx_v_snes, __pyx_v_name); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2018, __pyx_L1_error) __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_t_3); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2018, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2017 * getPrefix(snes), b"-snes_python_type", * name, sizeof(name), &found) ) * if found and name[0]: # <<<<<<<<<<<<<< * CHKERR( SNESPythonSetType_PYTHON(snes, name) ) * if PySNES(snes).self is None: */ } /* "petsc4py/PETSc/libpetsc4py.pyx":2013 * cdef char name[2048] * cdef PetscBool found = PETSC_FALSE * if PySNES(snes).self is None: # <<<<<<<<<<<<<< * CHKERR( PetscOptionsGetString(NULL, * getPrefix(snes), b"-snes_python_type", */ } /* "petsc4py/PETSc/libpetsc4py.pyx":2019 * if found and name[0]: * CHKERR( SNESPythonSetType_PYTHON(snes, name) ) * if PySNES(snes).self is None: # <<<<<<<<<<<<<< * return PetscSETERR(PETSC_ERR_USER, * "Python context not set, call one of \n" */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PySNES(__pyx_v_snes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 2019, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (((struct __pyx_obj_8petsc4py_5PETSc__PySNES *)__pyx_t_1)->__pyx_base.self == Py_None); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "petsc4py/PETSc/libpetsc4py.pyx":2020 * CHKERR( SNESPythonSetType_PYTHON(snes, name) ) * if PySNES(snes).self is None: * return PetscSETERR(PETSC_ERR_USER, # <<<<<<<<<<<<<< * "Python context not set, call one of \n" * " * SNESPythonSetType(snes, \"[package.]module.class\")\n" */ __pyx_r = __pyx_f_8petsc4py_5PETSc_PetscSETERR(PETSC_ERR_USER, ((char *)"Python context not set, call one of \n * SNESPythonSetType(snes, \"[package.]module.class\")\n * SNESSetFromOptions(snes) and pass option -snes_python_type [package.]module.class")); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":2019 * if found and name[0]: * CHKERR( SNESPythonSetType_PYTHON(snes, name) ) * if PySNES(snes).self is None: # <<<<<<<<<<<<<< * return PetscSETERR(PETSC_ERR_USER, * "Python context not set, call one of \n" */ } /* "petsc4py/PETSc/libpetsc4py.pyx":2026 * "-snes_python_type [package.]module.class") * # * cdef setUp = PySNES(snes).setUp # <<<<<<<<<<<<<< * if setUp is not None: * setUp(SNES_(snes)) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PySNES(__pyx_v_snes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 2026, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_setUp); if (unlikely(!__pyx_t_6)) __PYX_ERR(11, 2026, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_setUp = __pyx_t_6; __pyx_t_6 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2027 * # * cdef setUp = PySNES(snes).setUp * if setUp is not None: # <<<<<<<<<<<<<< * setUp(SNES_(snes)) * return FunctionEnd() */ __pyx_t_2 = (__pyx_v_setUp != Py_None); if (__pyx_t_2) { /* "petsc4py/PETSc/libpetsc4py.pyx":2028 * cdef setUp = PySNES(snes).setUp * if setUp is not None: * setUp(SNES_(snes)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_SNES_(__pyx_v_snes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 2028, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_setUp); __pyx_t_7 = __pyx_v_setUp; __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_1}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(11, 2028, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2027 * # * cdef setUp = PySNES(snes).setUp * if setUp is not None: # <<<<<<<<<<<<<< * setUp(SNES_(snes)) * return FunctionEnd() */ } /* "petsc4py/PETSc/libpetsc4py.pyx":2029 * if setUp is not None: * setUp(SNES_(snes)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef inline PetscErrorCode SNESReset_Python_inner( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":2003 * return FunctionEnd() * * cdef PetscErrorCode SNESSetUp_Python( # <<<<<<<<<<<<<< * PetscSNES snes, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("petsc4py.PETSc.SNESSetUp_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_setUp); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":2031 * return FunctionEnd() * * cdef inline PetscErrorCode SNESReset_Python_inner( # <<<<<<<<<<<<<< * PetscSNES snes, * ) \ */ static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNESReset_Python_inner(SNES __pyx_v_snes) { PyObject *__pyx_v_reset = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("SNESReset_Python_inner", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":2035 * ) \ * except PETSC_ERR_PYTHON with gil: * cdef reset = PySNES(snes).reset # <<<<<<<<<<<<<< * if reset is not None: * reset(SNES_(snes)) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PySNES(__pyx_v_snes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 2035, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_reset); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 2035, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_reset = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2036 * except PETSC_ERR_PYTHON with gil: * cdef reset = PySNES(snes).reset * if reset is not None: # <<<<<<<<<<<<<< * reset(SNES_(snes)) * return PETSC_SUCCESS */ __pyx_t_3 = (__pyx_v_reset != Py_None); if (__pyx_t_3) { /* "petsc4py/PETSc/libpetsc4py.pyx":2037 * cdef reset = PySNES(snes).reset * if reset is not None: * reset(SNES_(snes)) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_SNES_(__pyx_v_snes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 2037, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_reset); __pyx_t_4 = __pyx_v_reset; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_1}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 2037, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2036 * except PETSC_ERR_PYTHON with gil: * cdef reset = PySNES(snes).reset * if reset is not None: # <<<<<<<<<<<<<< * reset(SNES_(snes)) * return PETSC_SUCCESS */ } /* "petsc4py/PETSc/libpetsc4py.pyx":2038 * if reset is not None: * reset(SNES_(snes)) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * cdef PetscErrorCode SNESReset_Python( */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":2031 * return FunctionEnd() * * cdef inline PetscErrorCode SNESReset_Python_inner( # <<<<<<<<<<<<<< * PetscSNES snes, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.SNESReset_Python_inner", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_reset); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":2040 * return PETSC_SUCCESS * * cdef PetscErrorCode SNESReset_Python( # <<<<<<<<<<<<<< * PetscSNES snes, * ) \ */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNESReset_Python(SNES __pyx_v_snes) { PetscErrorCode __pyx_r; int __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save; #endif /* "petsc4py/PETSc/libpetsc4py.pyx":2044 * ) \ * except PETSC_ERR_PYTHON nogil: * if getRef(snes) == 0: return PETSC_SUCCESS # <<<<<<<<<<<<<< * FunctionBegin(b"SNESReset_Python") * if Py_IsInitialized(): SNESReset_Python_inner(snes) */ __pyx_t_1 = (__pyx_f_8petsc4py_5PETSc_getRef(__pyx_v_snes) == 0); if (__pyx_t_1) { __pyx_r = PETSC_SUCCESS; goto __pyx_L0; } /* "petsc4py/PETSc/libpetsc4py.pyx":2045 * except PETSC_ERR_PYTHON nogil: * if getRef(snes) == 0: return PETSC_SUCCESS * FunctionBegin(b"SNESReset_Python") # <<<<<<<<<<<<<< * if Py_IsInitialized(): SNESReset_Python_inner(snes) * return FunctionEnd() */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"SNESReset_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":2046 * if getRef(snes) == 0: return PETSC_SUCCESS * FunctionBegin(b"SNESReset_Python") * if Py_IsInitialized(): SNESReset_Python_inner(snes) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = (Py_IsInitialized() != 0); if (__pyx_t_1) { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_SNESReset_Python_inner(__pyx_v_snes); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2046, __pyx_L1_error) } /* "petsc4py/PETSc/libpetsc4py.pyx":2047 * FunctionBegin(b"SNESReset_Python") * if Py_IsInitialized(): SNESReset_Python_inner(snes) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode SNESSetFromOptions_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":2040 * return PETSC_SUCCESS * * cdef PetscErrorCode SNESReset_Python( # <<<<<<<<<<<<<< * PetscSNES snes, * ) \ */ /* function exit code */ __pyx_L1_error:; #ifdef WITH_THREAD __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_AddTraceback("petsc4py.PETSc.SNESReset_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":2049 * return FunctionEnd() * * cdef PetscErrorCode SNESSetFromOptions_Python( # <<<<<<<<<<<<<< * PetscSNES snes, * PetscOptionItems *PetscOptionsObject, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNESSetFromOptions_Python(SNES __pyx_v_snes, PetscOptionItems *__pyx_v_PetscOptionsObject) { char __pyx_v_name[0x800]; char *__pyx_v_defval; PetscBool __pyx_v_found; PetscOptionItems *PetscOptionsObject; PyObject *__pyx_v_setFromOptions = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; char *__pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_t_4; int __pyx_t_5; PetscErrorCode __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("SNESSetFromOptions_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":2054 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"SNESSetFromOptions_Python") # <<<<<<<<<<<<<< * # * cdef char name[2048], *defval = PySNES(snes).getname() */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"SNESSetFromOptions_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":2056 * FunctionBegin(b"SNESSetFromOptions_Python") * # * cdef char name[2048], *defval = PySNES(snes).getname() # <<<<<<<<<<<<<< * cdef PetscBool found = PETSC_FALSE * cdef PetscOptionItems *opts "PetscOptionsObject" = PetscOptionsObject */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PySNES(__pyx_v_snes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 2056, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__PySNES *)((struct __pyx_obj_8petsc4py_5PETSc__PySNES *)__pyx_t_1)->__pyx_base.__pyx_vtab)->__pyx_base.getname(((struct __pyx_obj_8petsc4py_5PETSc__PyObj *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((char *)NULL) && PyErr_Occurred())) __PYX_ERR(11, 2056, __pyx_L1_error) __pyx_v_defval = __pyx_t_2; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2057 * # * cdef char name[2048], *defval = PySNES(snes).getname() * cdef PetscBool found = PETSC_FALSE # <<<<<<<<<<<<<< * cdef PetscOptionItems *opts "PetscOptionsObject" = PetscOptionsObject * CHKERR( PetscOptionsString( */ __pyx_v_found = PETSC_FALSE; /* "petsc4py/PETSc/libpetsc4py.pyx":2058 * cdef char name[2048], *defval = PySNES(snes).getname() * cdef PetscBool found = PETSC_FALSE * cdef PetscOptionItems *opts "PetscOptionsObject" = PetscOptionsObject # <<<<<<<<<<<<<< * CHKERR( PetscOptionsString( * b"-snes_python_type", b"Python [package.]module[.{class|function}]", */ PetscOptionsObject = __pyx_v_PetscOptionsObject; /* "petsc4py/PETSc/libpetsc4py.pyx":2059 * cdef PetscBool found = PETSC_FALSE * cdef PetscOptionItems *opts "PetscOptionsObject" = PetscOptionsObject * CHKERR( PetscOptionsString( # <<<<<<<<<<<<<< * b"-snes_python_type", b"Python [package.]module[.{class|function}]", * b"SNESPythonSetType", defval, name, sizeof(name), &found) ); opts; */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsString(((char *)"-snes_python_type"), ((char *)"Python [package.]module[.{class|function}]"), ((char *)"SNESPythonSetType"), __pyx_v_defval, __pyx_v_name, (sizeof(__pyx_v_name)), (&__pyx_v_found))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2059, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2061 * CHKERR( PetscOptionsString( * b"-snes_python_type", b"Python [package.]module[.{class|function}]", * b"SNESPythonSetType", defval, name, sizeof(name), &found) ); opts; # <<<<<<<<<<<<<< * if found and name[0]: * CHKERR( SNESPythonSetType_PYTHON(snes, name) ) */ ((void)PetscOptionsObject); /* "petsc4py/PETSc/libpetsc4py.pyx":2062 * b"-snes_python_type", b"Python [package.]module[.{class|function}]", * b"SNESPythonSetType", defval, name, sizeof(name), &found) ); opts; * if found and name[0]: # <<<<<<<<<<<<<< * CHKERR( SNESPythonSetType_PYTHON(snes, name) ) * # */ if (__pyx_v_found) { } else { __pyx_t_4 = __pyx_v_found; goto __pyx_L4_bool_binop_done; } __pyx_t_5 = ((__pyx_v_name[0]) != 0); __pyx_t_4 = __pyx_t_5; __pyx_L4_bool_binop_done:; if (__pyx_t_4) { /* "petsc4py/PETSc/libpetsc4py.pyx":2063 * b"SNESPythonSetType", defval, name, sizeof(name), &found) ); opts; * if found and name[0]: * CHKERR( SNESPythonSetType_PYTHON(snes, name) ) # <<<<<<<<<<<<<< * # * cdef setFromOptions = PySNES(snes).setFromOptions */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_SNESPythonSetType_PYTHON(__pyx_v_snes, __pyx_v_name); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2063, __pyx_L1_error) __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_t_3); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2063, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2062 * b"-snes_python_type", b"Python [package.]module[.{class|function}]", * b"SNESPythonSetType", defval, name, sizeof(name), &found) ); opts; * if found and name[0]: # <<<<<<<<<<<<<< * CHKERR( SNESPythonSetType_PYTHON(snes, name) ) * # */ } /* "petsc4py/PETSc/libpetsc4py.pyx":2065 * CHKERR( SNESPythonSetType_PYTHON(snes, name) ) * # * cdef setFromOptions = PySNES(snes).setFromOptions # <<<<<<<<<<<<<< * if setFromOptions is not None: * setFromOptions(SNES_(snes)) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PySNES(__pyx_v_snes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 2065, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_setFromOptions); if (unlikely(!__pyx_t_7)) __PYX_ERR(11, 2065, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_setFromOptions = __pyx_t_7; __pyx_t_7 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2066 * # * cdef setFromOptions = PySNES(snes).setFromOptions * if setFromOptions is not None: # <<<<<<<<<<<<<< * setFromOptions(SNES_(snes)) * return FunctionEnd() */ __pyx_t_4 = (__pyx_v_setFromOptions != Py_None); if (__pyx_t_4) { /* "petsc4py/PETSc/libpetsc4py.pyx":2067 * cdef setFromOptions = PySNES(snes).setFromOptions * if setFromOptions is not None: * setFromOptions(SNES_(snes)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_SNES_(__pyx_v_snes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 2067, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_setFromOptions); __pyx_t_8 = __pyx_v_setFromOptions; __pyx_t_9 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_8))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_1}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(11, 2067, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2066 * # * cdef setFromOptions = PySNES(snes).setFromOptions * if setFromOptions is not None: # <<<<<<<<<<<<<< * setFromOptions(SNES_(snes)) * return FunctionEnd() */ } /* "petsc4py/PETSc/libpetsc4py.pyx":2068 * if setFromOptions is not None: * setFromOptions(SNES_(snes)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode SNESView_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":2049 * return FunctionEnd() * * cdef PetscErrorCode SNESSetFromOptions_Python( # <<<<<<<<<<<<<< * PetscSNES snes, * PetscOptionItems *PetscOptionsObject, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("petsc4py.PETSc.SNESSetFromOptions_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_setFromOptions); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":2070 * return FunctionEnd() * * cdef PetscErrorCode SNESView_Python( # <<<<<<<<<<<<<< * PetscSNES snes, * PetscViewer vwr, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNESView_Python(SNES __pyx_v_snes, PetscViewer __pyx_v_vwr) { PyObject *__pyx_v_view = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("SNESView_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":2075 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"SNESView_Python") # <<<<<<<<<<<<<< * viewcontext(PySNES(snes), vwr) * cdef view = PySNES(snes).view */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"SNESView_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":2076 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"SNESView_Python") * viewcontext(PySNES(snes), vwr) # <<<<<<<<<<<<<< * cdef view = PySNES(snes).view * if view is not None: */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PySNES(__pyx_v_snes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 2076, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_viewcontext(((struct __pyx_obj_8petsc4py_5PETSc__PyObj *)__pyx_t_1), __pyx_v_vwr); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(11, 2076, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2077 * FunctionBegin(b"SNESView_Python") * viewcontext(PySNES(snes), vwr) * cdef view = PySNES(snes).view # <<<<<<<<<<<<<< * if view is not None: * view(SNES_(snes), Viewer_(vwr)) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PySNES(__pyx_v_snes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 2077, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_view); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 2077, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_view = __pyx_t_3; __pyx_t_3 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2078 * viewcontext(PySNES(snes), vwr) * cdef view = PySNES(snes).view * if view is not None: # <<<<<<<<<<<<<< * view(SNES_(snes), Viewer_(vwr)) * return FunctionEnd() */ __pyx_t_4 = (__pyx_v_view != Py_None); if (__pyx_t_4) { /* "petsc4py/PETSc/libpetsc4py.pyx":2079 * cdef view = PySNES(snes).view * if view is not None: * view(SNES_(snes), Viewer_(vwr)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_SNES_(__pyx_v_snes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 2079, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Viewer_(__pyx_v_vwr)); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 2079, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_view); __pyx_t_6 = __pyx_v_view; __pyx_t_7 = NULL; __pyx_t_2 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_2 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_1, __pyx_t_5}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_2, 2+__pyx_t_2); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 2079, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2078 * viewcontext(PySNES(snes), vwr) * cdef view = PySNES(snes).view * if view is not None: # <<<<<<<<<<<<<< * view(SNES_(snes), Viewer_(vwr)) * return FunctionEnd() */ } /* "petsc4py/PETSc/libpetsc4py.pyx":2080 * if view is not None: * view(SNES_(snes), Viewer_(vwr)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode SNESSolve_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":2070 * return FunctionEnd() * * cdef PetscErrorCode SNESView_Python( # <<<<<<<<<<<<<< * PetscSNES snes, * PetscViewer vwr, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.SNESView_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_view); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":2082 * return FunctionEnd() * * cdef PetscErrorCode SNESSolve_Python( # <<<<<<<<<<<<<< * PetscSNES snes, * ) \ */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNESSolve_Python(SNES __pyx_v_snes) { Vec __pyx_v_b; Vec __pyx_v_x; PyObject *__pyx_v_solve = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("SNESSolve_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":2086 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"SNESSolve_Python") # <<<<<<<<<<<<<< * cdef PetscVec b = NULL, x = NULL * CHKERR( SNESGetRhs(snes, &b) ) */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"SNESSolve_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":2087 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"SNESSolve_Python") * cdef PetscVec b = NULL, x = NULL # <<<<<<<<<<<<<< * CHKERR( SNESGetRhs(snes, &b) ) * CHKERR( SNESGetSolution(snes, &x) ) */ __pyx_v_b = NULL; __pyx_v_x = NULL; /* "petsc4py/PETSc/libpetsc4py.pyx":2088 * FunctionBegin(b"SNESSolve_Python") * cdef PetscVec b = NULL, x = NULL * CHKERR( SNESGetRhs(snes, &b) ) # <<<<<<<<<<<<<< * CHKERR( SNESGetSolution(snes, &x) ) * # */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetRhs(__pyx_v_snes, (&__pyx_v_b))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2088, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2089 * cdef PetscVec b = NULL, x = NULL * CHKERR( SNESGetRhs(snes, &b) ) * CHKERR( SNESGetSolution(snes, &x) ) # <<<<<<<<<<<<<< * # * snes.iter = 0 */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetSolution(__pyx_v_snes, (&__pyx_v_x))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2089, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2091 * CHKERR( SNESGetSolution(snes, &x) ) * # * snes.iter = 0 # <<<<<<<<<<<<<< * # * cdef solve = PySNES(snes).solve */ __pyx_v_snes->iter = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2093 * snes.iter = 0 * # * cdef solve = PySNES(snes).solve # <<<<<<<<<<<<<< * if solve is not None: * solve(SNES_(snes), Vec_(b) if b != NULL else None, Vec_(x)) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PySNES(__pyx_v_snes)); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 2093, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_solve); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 2093, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_solve = __pyx_t_3; __pyx_t_3 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2094 * # * cdef solve = PySNES(snes).solve * if solve is not None: # <<<<<<<<<<<<<< * solve(SNES_(snes), Vec_(b) if b != NULL else None, Vec_(x)) * else: */ __pyx_t_4 = (__pyx_v_solve != Py_None); if (__pyx_t_4) { /* "petsc4py/PETSc/libpetsc4py.pyx":2095 * cdef solve = PySNES(snes).solve * if solve is not None: * solve(SNES_(snes), Vec_(b) if b != NULL else None, Vec_(x)) # <<<<<<<<<<<<<< * else: * SNESSolve_Python_default(snes) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_SNES_(__pyx_v_snes)); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 2095, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = (__pyx_v_b != NULL); if (__pyx_t_4) { __pyx_t_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_b)); if (unlikely(!__pyx_t_6)) __PYX_ERR(11, 2095, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __pyx_t_6; __pyx_t_6 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_5 = Py_None; } __pyx_t_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_x)); if (unlikely(!__pyx_t_6)) __PYX_ERR(11, 2095, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_solve); __pyx_t_7 = __pyx_v_solve; __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_8, __pyx_t_2, __pyx_t_5, __pyx_t_6}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 3+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 2095, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2094 * # * cdef solve = PySNES(snes).solve * if solve is not None: # <<<<<<<<<<<<<< * solve(SNES_(snes), Vec_(b) if b != NULL else None, Vec_(x)) * else: */ goto __pyx_L3; } /* "petsc4py/PETSc/libpetsc4py.pyx":2097 * solve(SNES_(snes), Vec_(b) if b != NULL else None, Vec_(x)) * else: * SNESSolve_Python_default(snes) # <<<<<<<<<<<<<< * # * return FunctionEnd() */ /*else*/ { __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_SNESSolve_Python_default(__pyx_v_snes); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2097, __pyx_L1_error) } __pyx_L3:; /* "petsc4py/PETSc/libpetsc4py.pyx":2099 * SNESSolve_Python_default(snes) * # * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode SNESSolve_Python_default( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":2082 * return FunctionEnd() * * cdef PetscErrorCode SNESSolve_Python( # <<<<<<<<<<<<<< * PetscSNES snes, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("petsc4py.PETSc.SNESSolve_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_solve); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":2101 * return FunctionEnd() * * cdef PetscErrorCode SNESSolve_Python_default( # <<<<<<<<<<<<<< * PetscSNES snes, * ) \ */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNESSolve_Python_default(SNES __pyx_v_snes) { Vec __pyx_v_X; Vec __pyx_v_F; Vec __pyx_v_Y; SNESLineSearch __pyx_v_ls; CYTHON_UNUSED PetscInt __pyx_v_its; PetscInt __pyx_v_lits; PetscReal __pyx_v_xnorm; PetscReal __pyx_v_fnorm; PetscReal __pyx_v_ynorm; PetscObjectState __pyx_v_ostate; PetscObjectState __pyx_v_nstate; PetscErrorCode __pyx_r; PetscErrorCode __pyx_t_1; PetscInt __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif /* "petsc4py/PETSc/libpetsc4py.pyx":2105 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"SNESSolve_Python_default") # <<<<<<<<<<<<<< * # * cdef PetscVec X=NULL, F=NULL, Y=NULL */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"SNESSolve_Python_default")); /* "petsc4py/PETSc/libpetsc4py.pyx":2107 * FunctionBegin(b"SNESSolve_Python_default") * # * cdef PetscVec X=NULL, F=NULL, Y=NULL # <<<<<<<<<<<<<< * cdef PetscSNESLineSearch ls * CHKERR( SNESGetSolution(snes, &X) ) */ __pyx_v_X = NULL; __pyx_v_F = NULL; __pyx_v_Y = NULL; /* "petsc4py/PETSc/libpetsc4py.pyx":2109 * cdef PetscVec X=NULL, F=NULL, Y=NULL * cdef PetscSNESLineSearch ls * CHKERR( SNESGetSolution(snes, &X) ) # <<<<<<<<<<<<<< * CHKERR( SNESGetFunction(snes, &F, NULL, NULL) ) * CHKERR( SNESGetSolutionUpdate(snes, &Y) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetSolution(__pyx_v_snes, (&__pyx_v_X))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2109, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2110 * cdef PetscSNESLineSearch ls * CHKERR( SNESGetSolution(snes, &X) ) * CHKERR( SNESGetFunction(snes, &F, NULL, NULL) ) # <<<<<<<<<<<<<< * CHKERR( SNESGetSolutionUpdate(snes, &Y) ) * CHKERR( SNESGetLineSearch(snes, &ls) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetFunction(__pyx_v_snes, (&__pyx_v_F), NULL, NULL)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2110, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2111 * CHKERR( SNESGetSolution(snes, &X) ) * CHKERR( SNESGetFunction(snes, &F, NULL, NULL) ) * CHKERR( SNESGetSolutionUpdate(snes, &Y) ) # <<<<<<<<<<<<<< * CHKERR( SNESGetLineSearch(snes, &ls) ) * cdef PetscInt its=0, lits=0 */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetSolutionUpdate(__pyx_v_snes, (&__pyx_v_Y))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2111, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2112 * CHKERR( SNESGetFunction(snes, &F, NULL, NULL) ) * CHKERR( SNESGetSolutionUpdate(snes, &Y) ) * CHKERR( SNESGetLineSearch(snes, &ls) ) # <<<<<<<<<<<<<< * cdef PetscInt its=0, lits=0 * cdef PetscReal xnorm = 0.0 */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetLineSearch(__pyx_v_snes, (&__pyx_v_ls))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2112, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2113 * CHKERR( SNESGetSolutionUpdate(snes, &Y) ) * CHKERR( SNESGetLineSearch(snes, &ls) ) * cdef PetscInt its=0, lits=0 # <<<<<<<<<<<<<< * cdef PetscReal xnorm = 0.0 * cdef PetscReal fnorm = 0.0 */ __pyx_v_its = 0; __pyx_v_lits = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2114 * CHKERR( SNESGetLineSearch(snes, &ls) ) * cdef PetscInt its=0, lits=0 * cdef PetscReal xnorm = 0.0 # <<<<<<<<<<<<<< * cdef PetscReal fnorm = 0.0 * cdef PetscReal ynorm = 0.0 */ __pyx_v_xnorm = 0.0; /* "petsc4py/PETSc/libpetsc4py.pyx":2115 * cdef PetscInt its=0, lits=0 * cdef PetscReal xnorm = 0.0 * cdef PetscReal fnorm = 0.0 # <<<<<<<<<<<<<< * cdef PetscReal ynorm = 0.0 * # */ __pyx_v_fnorm = 0.0; /* "petsc4py/PETSc/libpetsc4py.pyx":2116 * cdef PetscReal xnorm = 0.0 * cdef PetscReal fnorm = 0.0 * cdef PetscReal ynorm = 0.0 # <<<<<<<<<<<<<< * # * CHKERR( VecSet(Y, 0.0) ) */ __pyx_v_ynorm = 0.0; /* "petsc4py/PETSc/libpetsc4py.pyx":2118 * cdef PetscReal ynorm = 0.0 * # * CHKERR( VecSet(Y, 0.0) ) # <<<<<<<<<<<<<< * CHKERR( SNESComputeFunction(snes, X, F) ) * CHKERR( VecNorm(X, PETSC_NORM_2, &xnorm) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecSet(__pyx_v_Y, 0.0)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2118, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2119 * # * CHKERR( VecSet(Y, 0.0) ) * CHKERR( SNESComputeFunction(snes, X, F) ) # <<<<<<<<<<<<<< * CHKERR( VecNorm(X, PETSC_NORM_2, &xnorm) ) * CHKERR( VecNorm(F, PETSC_NORM_2, &fnorm) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESComputeFunction(__pyx_v_snes, __pyx_v_X, __pyx_v_F)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2119, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2120 * CHKERR( VecSet(Y, 0.0) ) * CHKERR( SNESComputeFunction(snes, X, F) ) * CHKERR( VecNorm(X, PETSC_NORM_2, &xnorm) ) # <<<<<<<<<<<<<< * CHKERR( VecNorm(F, PETSC_NORM_2, &fnorm) ) * # */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecNorm(__pyx_v_X, NORM_2, (&__pyx_v_xnorm))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2120, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2121 * CHKERR( SNESComputeFunction(snes, X, F) ) * CHKERR( VecNorm(X, PETSC_NORM_2, &xnorm) ) * CHKERR( VecNorm(F, PETSC_NORM_2, &fnorm) ) # <<<<<<<<<<<<<< * # * CHKERR( SNESLogHistory(snes, snes.norm, lits) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecNorm(__pyx_v_F, NORM_2, (&__pyx_v_fnorm))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2121, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2123 * CHKERR( VecNorm(F, PETSC_NORM_2, &fnorm) ) * # * CHKERR( SNESLogHistory(snes, snes.norm, lits) ) # <<<<<<<<<<<<<< * CHKERR( SNESConverged(snes, snes.iter, xnorm, ynorm, fnorm) ) * CHKERR( SNESMonitor(snes, snes.iter, snes.norm) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESLogHistory(__pyx_v_snes, __pyx_v_snes->norm, __pyx_v_lits)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2123, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2124 * # * CHKERR( SNESLogHistory(snes, snes.norm, lits) ) * CHKERR( SNESConverged(snes, snes.iter, xnorm, ynorm, fnorm) ) # <<<<<<<<<<<<<< * CHKERR( SNESMonitor(snes, snes.iter, snes.norm) ) * if snes.reason: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESConverged(__pyx_v_snes, __pyx_v_snes->iter, __pyx_v_xnorm, __pyx_v_ynorm, __pyx_v_fnorm)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2124, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2125 * CHKERR( SNESLogHistory(snes, snes.norm, lits) ) * CHKERR( SNESConverged(snes, snes.iter, xnorm, ynorm, fnorm) ) * CHKERR( SNESMonitor(snes, snes.iter, snes.norm) ) # <<<<<<<<<<<<<< * if snes.reason: * return FunctionEnd() */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESMonitor(__pyx_v_snes, __pyx_v_snes->iter, __pyx_v_snes->norm)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2125, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2126 * CHKERR( SNESConverged(snes, snes.iter, xnorm, ynorm, fnorm) ) * CHKERR( SNESMonitor(snes, snes.iter, snes.norm) ) * if snes.reason: # <<<<<<<<<<<<<< * return FunctionEnd() * */ if (__pyx_v_snes->reason) { /* "petsc4py/PETSc/libpetsc4py.pyx":2127 * CHKERR( SNESMonitor(snes, snes.iter, snes.norm) ) * if snes.reason: * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscObjectState ostate = -1 */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":2126 * CHKERR( SNESConverged(snes, snes.iter, xnorm, ynorm, fnorm) ) * CHKERR( SNESMonitor(snes, snes.iter, snes.norm) ) * if snes.reason: # <<<<<<<<<<<<<< * return FunctionEnd() * */ } /* "petsc4py/PETSc/libpetsc4py.pyx":2129 * return FunctionEnd() * * cdef PetscObjectState ostate = -1 # <<<<<<<<<<<<<< * cdef PetscObjectState nstate = -1 * for its from 0 <= its < snes.max_its: */ __pyx_v_ostate = -1; /* "petsc4py/PETSc/libpetsc4py.pyx":2130 * * cdef PetscObjectState ostate = -1 * cdef PetscObjectState nstate = -1 # <<<<<<<<<<<<<< * for its from 0 <= its < snes.max_its: * CHKERR( PetscObjectStateGet(X, &ostate) ) */ __pyx_v_nstate = -1; /* "petsc4py/PETSc/libpetsc4py.pyx":2131 * cdef PetscObjectState ostate = -1 * cdef PetscObjectState nstate = -1 * for its from 0 <= its < snes.max_its: # <<<<<<<<<<<<<< * CHKERR( PetscObjectStateGet(X, &ostate) ) * SNESPreStep_Python(snes) */ __pyx_t_2 = __pyx_v_snes->max_its; for (__pyx_v_its = 0; __pyx_v_its < __pyx_t_2; __pyx_v_its++) { /* "petsc4py/PETSc/libpetsc4py.pyx":2132 * cdef PetscObjectState nstate = -1 * for its from 0 <= its < snes.max_its: * CHKERR( PetscObjectStateGet(X, &ostate) ) # <<<<<<<<<<<<<< * SNESPreStep_Python(snes) * CHKERR( PetscObjectStateGet(X, &nstate) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectStateGet(((PetscObject)__pyx_v_X), (&__pyx_v_ostate))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2132, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2133 * for its from 0 <= its < snes.max_its: * CHKERR( PetscObjectStateGet(X, &ostate) ) * SNESPreStep_Python(snes) # <<<<<<<<<<<<<< * CHKERR( PetscObjectStateGet(X, &nstate) ) * if ostate != nstate: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_SNESPreStep_Python(__pyx_v_snes); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2133, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2134 * CHKERR( PetscObjectStateGet(X, &ostate) ) * SNESPreStep_Python(snes) * CHKERR( PetscObjectStateGet(X, &nstate) ) # <<<<<<<<<<<<<< * if ostate != nstate: * CHKERR( SNESComputeFunction(snes, X, F) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectStateGet(((PetscObject)__pyx_v_X), (&__pyx_v_nstate))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2134, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2135 * SNESPreStep_Python(snes) * CHKERR( PetscObjectStateGet(X, &nstate) ) * if ostate != nstate: # <<<<<<<<<<<<<< * CHKERR( SNESComputeFunction(snes, X, F) ) * CHKERR( VecNorm(F, PETSC_NORM_2, &fnorm) ) */ __pyx_t_3 = (__pyx_v_ostate != __pyx_v_nstate); if (__pyx_t_3) { /* "petsc4py/PETSc/libpetsc4py.pyx":2136 * CHKERR( PetscObjectStateGet(X, &nstate) ) * if ostate != nstate: * CHKERR( SNESComputeFunction(snes, X, F) ) # <<<<<<<<<<<<<< * CHKERR( VecNorm(F, PETSC_NORM_2, &fnorm) ) * # */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESComputeFunction(__pyx_v_snes, __pyx_v_X, __pyx_v_F)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2136, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2137 * if ostate != nstate: * CHKERR( SNESComputeFunction(snes, X, F) ) * CHKERR( VecNorm(F, PETSC_NORM_2, &fnorm) ) # <<<<<<<<<<<<<< * # * lits = -snes.linear_its */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecNorm(__pyx_v_F, NORM_2, (&__pyx_v_fnorm))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2137, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2135 * SNESPreStep_Python(snes) * CHKERR( PetscObjectStateGet(X, &nstate) ) * if ostate != nstate: # <<<<<<<<<<<<<< * CHKERR( SNESComputeFunction(snes, X, F) ) * CHKERR( VecNorm(F, PETSC_NORM_2, &fnorm) ) */ } /* "petsc4py/PETSc/libpetsc4py.pyx":2139 * CHKERR( VecNorm(F, PETSC_NORM_2, &fnorm) ) * # * lits = -snes.linear_its # <<<<<<<<<<<<<< * SNESStep_Python(snes, X, F, Y) * lits += snes.linear_its */ __pyx_v_lits = (-__pyx_v_snes->linear_its); /* "petsc4py/PETSc/libpetsc4py.pyx":2140 * # * lits = -snes.linear_its * SNESStep_Python(snes, X, F, Y) # <<<<<<<<<<<<<< * lits += snes.linear_its * # */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_SNESStep_Python(__pyx_v_snes, __pyx_v_X, __pyx_v_F, __pyx_v_Y); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2140, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2141 * lits = -snes.linear_its * SNESStep_Python(snes, X, F, Y) * lits += snes.linear_its # <<<<<<<<<<<<<< * # * CHKERR( SNESLineSearchApply(ls, X, F, NULL, Y) ) */ __pyx_v_lits = (__pyx_v_lits + __pyx_v_snes->linear_its); /* "petsc4py/PETSc/libpetsc4py.pyx":2143 * lits += snes.linear_its * # * CHKERR( SNESLineSearchApply(ls, X, F, NULL, Y) ) # <<<<<<<<<<<<<< * CHKERR( SNESLineSearchGetNorms(ls, &xnorm, &fnorm, &ynorm) ) * snes.iter += 1 */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESLineSearchApply(__pyx_v_ls, __pyx_v_X, __pyx_v_F, NULL, __pyx_v_Y)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2143, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2144 * # * CHKERR( SNESLineSearchApply(ls, X, F, NULL, Y) ) * CHKERR( SNESLineSearchGetNorms(ls, &xnorm, &fnorm, &ynorm) ) # <<<<<<<<<<<<<< * snes.iter += 1 * # */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESLineSearchGetNorms(__pyx_v_ls, (&__pyx_v_xnorm), (&__pyx_v_fnorm), (&__pyx_v_ynorm))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2144, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2145 * CHKERR( SNESLineSearchApply(ls, X, F, NULL, Y) ) * CHKERR( SNESLineSearchGetNorms(ls, &xnorm, &fnorm, &ynorm) ) * snes.iter += 1 # <<<<<<<<<<<<<< * # * SNESPostStep_Python(snes) */ __pyx_v_snes->iter = (__pyx_v_snes->iter + 1); /* "petsc4py/PETSc/libpetsc4py.pyx":2147 * snes.iter += 1 * # * SNESPostStep_Python(snes) # <<<<<<<<<<<<<< * CHKERR( SNESLogHistory(snes, snes.norm, lits) ) * CHKERR( SNESConverged(snes, snes.iter, xnorm, ynorm, fnorm) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_SNESPostStep_Python(__pyx_v_snes); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2147, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2148 * # * SNESPostStep_Python(snes) * CHKERR( SNESLogHistory(snes, snes.norm, lits) ) # <<<<<<<<<<<<<< * CHKERR( SNESConverged(snes, snes.iter, xnorm, ynorm, fnorm) ) * CHKERR( SNESMonitor(snes, snes.iter, snes.norm) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESLogHistory(__pyx_v_snes, __pyx_v_snes->norm, __pyx_v_lits)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2148, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2149 * SNESPostStep_Python(snes) * CHKERR( SNESLogHistory(snes, snes.norm, lits) ) * CHKERR( SNESConverged(snes, snes.iter, xnorm, ynorm, fnorm) ) # <<<<<<<<<<<<<< * CHKERR( SNESMonitor(snes, snes.iter, snes.norm) ) * if snes.reason: break */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESConverged(__pyx_v_snes, __pyx_v_snes->iter, __pyx_v_xnorm, __pyx_v_ynorm, __pyx_v_fnorm)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2149, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2150 * CHKERR( SNESLogHistory(snes, snes.norm, lits) ) * CHKERR( SNESConverged(snes, snes.iter, xnorm, ynorm, fnorm) ) * CHKERR( SNESMonitor(snes, snes.iter, snes.norm) ) # <<<<<<<<<<<<<< * if snes.reason: break * # */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESMonitor(__pyx_v_snes, __pyx_v_snes->iter, __pyx_v_snes->norm)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2150, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2151 * CHKERR( SNESConverged(snes, snes.iter, xnorm, ynorm, fnorm) ) * CHKERR( SNESMonitor(snes, snes.iter, snes.norm) ) * if snes.reason: break # <<<<<<<<<<<<<< * # * return FunctionEnd() */ if (__pyx_v_snes->reason) { goto __pyx_L5_break; } } __pyx_L5_break:; /* "petsc4py/PETSc/libpetsc4py.pyx":2153 * if snes.reason: break * # * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode SNESPreStep_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":2101 * return FunctionEnd() * * cdef PetscErrorCode SNESSolve_Python_default( # <<<<<<<<<<<<<< * PetscSNES snes, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNESSolve_Python_default", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":2155 * return FunctionEnd() * * cdef PetscErrorCode SNESPreStep_Python( # <<<<<<<<<<<<<< * PetscSNES snes, * ) \ */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNESPreStep_Python(SNES __pyx_v_snes) { PyObject *__pyx_v_preStep = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("SNESPreStep_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":2159 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"SNESPreStep_Python") # <<<<<<<<<<<<<< * cdef preStep = PySNES(snes).preStep * if preStep is not None: */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"SNESPreStep_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":2160 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"SNESPreStep_Python") * cdef preStep = PySNES(snes).preStep # <<<<<<<<<<<<<< * if preStep is not None: * preStep(SNES_(snes)) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PySNES(__pyx_v_snes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 2160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_preStep); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 2160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_preStep = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2161 * FunctionBegin(b"SNESPreStep_Python") * cdef preStep = PySNES(snes).preStep * if preStep is not None: # <<<<<<<<<<<<<< * preStep(SNES_(snes)) * return FunctionEnd() */ __pyx_t_3 = (__pyx_v_preStep != Py_None); if (__pyx_t_3) { /* "petsc4py/PETSc/libpetsc4py.pyx":2162 * cdef preStep = PySNES(snes).preStep * if preStep is not None: * preStep(SNES_(snes)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_SNES_(__pyx_v_snes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 2162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_preStep); __pyx_t_4 = __pyx_v_preStep; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_1}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 2162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2161 * FunctionBegin(b"SNESPreStep_Python") * cdef preStep = PySNES(snes).preStep * if preStep is not None: # <<<<<<<<<<<<<< * preStep(SNES_(snes)) * return FunctionEnd() */ } /* "petsc4py/PETSc/libpetsc4py.pyx":2163 * if preStep is not None: * preStep(SNES_(snes)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode SNESPostStep_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":2155 * return FunctionEnd() * * cdef PetscErrorCode SNESPreStep_Python( # <<<<<<<<<<<<<< * PetscSNES snes, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.SNESPreStep_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_preStep); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":2165 * return FunctionEnd() * * cdef PetscErrorCode SNESPostStep_Python( # <<<<<<<<<<<<<< * PetscSNES snes, * ) \ */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNESPostStep_Python(SNES __pyx_v_snes) { PyObject *__pyx_v_postStep = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("SNESPostStep_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":2169 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"SNESPostStep_Python") # <<<<<<<<<<<<<< * cdef postStep = PySNES(snes).postStep * if postStep is not None: */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"SNESPostStep_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":2170 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"SNESPostStep_Python") * cdef postStep = PySNES(snes).postStep # <<<<<<<<<<<<<< * if postStep is not None: * postStep(SNES_(snes)) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PySNES(__pyx_v_snes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 2170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_postStep); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 2170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_postStep = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2171 * FunctionBegin(b"SNESPostStep_Python") * cdef postStep = PySNES(snes).postStep * if postStep is not None: # <<<<<<<<<<<<<< * postStep(SNES_(snes)) * return FunctionEnd() */ __pyx_t_3 = (__pyx_v_postStep != Py_None); if (__pyx_t_3) { /* "petsc4py/PETSc/libpetsc4py.pyx":2172 * cdef postStep = PySNES(snes).postStep * if postStep is not None: * postStep(SNES_(snes)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_SNES_(__pyx_v_snes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 2172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_postStep); __pyx_t_4 = __pyx_v_postStep; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_1}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 2172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2171 * FunctionBegin(b"SNESPostStep_Python") * cdef postStep = PySNES(snes).postStep * if postStep is not None: # <<<<<<<<<<<<<< * postStep(SNES_(snes)) * return FunctionEnd() */ } /* "petsc4py/PETSc/libpetsc4py.pyx":2173 * if postStep is not None: * postStep(SNES_(snes)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode SNESStep_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":2165 * return FunctionEnd() * * cdef PetscErrorCode SNESPostStep_Python( # <<<<<<<<<<<<<< * PetscSNES snes, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.SNESPostStep_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_postStep); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":2175 * return FunctionEnd() * * cdef PetscErrorCode SNESStep_Python( # <<<<<<<<<<<<<< * PetscSNES snes, * PetscVec X, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNESStep_Python(SNES __pyx_v_snes, Vec __pyx_v_X, Vec __pyx_v_F, Vec __pyx_v_Y) { PyObject *__pyx_v_step = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; PetscErrorCode __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("SNESStep_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":2182 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"SNESStep_Python") # <<<<<<<<<<<<<< * cdef step = PySNES(snes).step * if step is not None: */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"SNESStep_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":2183 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"SNESStep_Python") * cdef step = PySNES(snes).step # <<<<<<<<<<<<<< * if step is not None: * step(SNES_(snes), Vec_(X), Vec_(F), Vec_(Y)) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PySNES(__pyx_v_snes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 2183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_step); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 2183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_step = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2184 * FunctionBegin(b"SNESStep_Python") * cdef step = PySNES(snes).step * if step is not None: # <<<<<<<<<<<<<< * step(SNES_(snes), Vec_(X), Vec_(F), Vec_(Y)) * else: */ __pyx_t_3 = (__pyx_v_step != Py_None); if (__pyx_t_3) { /* "petsc4py/PETSc/libpetsc4py.pyx":2185 * cdef step = PySNES(snes).step * if step is not None: * step(SNES_(snes), Vec_(X), Vec_(F), Vec_(Y)) # <<<<<<<<<<<<<< * else: * SNESStep_Python_default(snes, X, F, Y) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_SNES_(__pyx_v_snes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 2185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_X)); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 2185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_F)); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 2185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_Y)); if (unlikely(!__pyx_t_6)) __PYX_ERR(11, 2185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_step); __pyx_t_7 = __pyx_v_step; __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_8, __pyx_t_1, __pyx_t_4, __pyx_t_5, __pyx_t_6}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 4+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 2185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2184 * FunctionBegin(b"SNESStep_Python") * cdef step = PySNES(snes).step * if step is not None: # <<<<<<<<<<<<<< * step(SNES_(snes), Vec_(X), Vec_(F), Vec_(Y)) * else: */ goto __pyx_L3; } /* "petsc4py/PETSc/libpetsc4py.pyx":2187 * step(SNES_(snes), Vec_(X), Vec_(F), Vec_(Y)) * else: * SNESStep_Python_default(snes, X, F, Y) # <<<<<<<<<<<<<< * return FunctionEnd() * */ /*else*/ { __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_SNESStep_Python_default(__pyx_v_snes, __pyx_v_X, __pyx_v_F, __pyx_v_Y); if (unlikely(__pyx_t_10 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2187, __pyx_L1_error) } __pyx_L3:; /* "petsc4py/PETSc/libpetsc4py.pyx":2188 * else: * SNESStep_Python_default(snes, X, F, Y) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode SNESStep_Python_default( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":2175 * return FunctionEnd() * * cdef PetscErrorCode SNESStep_Python( # <<<<<<<<<<<<<< * PetscSNES snes, * PetscVec X, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("petsc4py.PETSc.SNESStep_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_step); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":2190 * return FunctionEnd() * * cdef PetscErrorCode SNESStep_Python_default( # <<<<<<<<<<<<<< * PetscSNES snes, * PetscVec X, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNESStep_Python_default(SNES __pyx_v_snes, Vec __pyx_v_X, Vec __pyx_v_F, Vec __pyx_v_Y) { Mat __pyx_v_J; Mat __pyx_v_P; PetscInt __pyx_v_lits; PetscErrorCode __pyx_r; PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif /* "petsc4py/PETSc/libpetsc4py.pyx":2197 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"SNESStep_Python_default") # <<<<<<<<<<<<<< * cdef PetscMat J = NULL, P = NULL * cdef PetscInt lits = 0 */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"SNESStep_Python_default")); /* "petsc4py/PETSc/libpetsc4py.pyx":2198 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"SNESStep_Python_default") * cdef PetscMat J = NULL, P = NULL # <<<<<<<<<<<<<< * cdef PetscInt lits = 0 * CHKERR( SNESGetJacobian(snes, &J, &P, NULL, NULL) ) */ __pyx_v_J = NULL; __pyx_v_P = NULL; /* "petsc4py/PETSc/libpetsc4py.pyx":2199 * FunctionBegin(b"SNESStep_Python_default") * cdef PetscMat J = NULL, P = NULL * cdef PetscInt lits = 0 # <<<<<<<<<<<<<< * CHKERR( SNESGetJacobian(snes, &J, &P, NULL, NULL) ) * CHKERR( SNESComputeJacobian(snes, X, J, P) ) */ __pyx_v_lits = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2200 * cdef PetscMat J = NULL, P = NULL * cdef PetscInt lits = 0 * CHKERR( SNESGetJacobian(snes, &J, &P, NULL, NULL) ) # <<<<<<<<<<<<<< * CHKERR( SNESComputeJacobian(snes, X, J, P) ) * CHKERR( KSPSetOperators(snes.ksp, J, P) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetJacobian(__pyx_v_snes, (&__pyx_v_J), (&__pyx_v_P), NULL, NULL)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2200, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2201 * cdef PetscInt lits = 0 * CHKERR( SNESGetJacobian(snes, &J, &P, NULL, NULL) ) * CHKERR( SNESComputeJacobian(snes, X, J, P) ) # <<<<<<<<<<<<<< * CHKERR( KSPSetOperators(snes.ksp, J, P) ) * CHKERR( KSPSolve(snes.ksp, F, Y) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESComputeJacobian(__pyx_v_snes, __pyx_v_X, __pyx_v_J, __pyx_v_P)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2201, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2202 * CHKERR( SNESGetJacobian(snes, &J, &P, NULL, NULL) ) * CHKERR( SNESComputeJacobian(snes, X, J, P) ) * CHKERR( KSPSetOperators(snes.ksp, J, P) ) # <<<<<<<<<<<<<< * CHKERR( KSPSolve(snes.ksp, F, Y) ) * CHKERR( KSPGetIterationNumber(snes.ksp, &lits) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetOperators(__pyx_v_snes->ksp, __pyx_v_J, __pyx_v_P)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2202, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2203 * CHKERR( SNESComputeJacobian(snes, X, J, P) ) * CHKERR( KSPSetOperators(snes.ksp, J, P) ) * CHKERR( KSPSolve(snes.ksp, F, Y) ) # <<<<<<<<<<<<<< * CHKERR( KSPGetIterationNumber(snes.ksp, &lits) ) * snes.linear_its += lits */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSolve(__pyx_v_snes->ksp, __pyx_v_F, __pyx_v_Y)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2203, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2204 * CHKERR( KSPSetOperators(snes.ksp, J, P) ) * CHKERR( KSPSolve(snes.ksp, F, Y) ) * CHKERR( KSPGetIterationNumber(snes.ksp, &lits) ) # <<<<<<<<<<<<<< * snes.linear_its += lits * return FunctionEnd() */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPGetIterationNumber(__pyx_v_snes->ksp, (&__pyx_v_lits))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2204, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2205 * CHKERR( KSPSolve(snes.ksp, F, Y) ) * CHKERR( KSPGetIterationNumber(snes.ksp, &lits) ) * snes.linear_its += lits # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_v_snes->linear_its = (__pyx_v_snes->linear_its + __pyx_v_lits); /* "petsc4py/PETSc/libpetsc4py.pyx":2206 * CHKERR( KSPGetIterationNumber(snes.ksp, &lits) ) * snes.linear_its += lits * return FunctionEnd() # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":2190 * return FunctionEnd() * * cdef PetscErrorCode SNESStep_Python_default( # <<<<<<<<<<<<<< * PetscSNES snes, * PetscVec X, */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNESStep_Python_default", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":2260 * @cython.internal * cdef class _PyTS(_PyObj): pass * cdef inline _PyTS PyTS(PetscTS ts): # <<<<<<<<<<<<<< * if ts != NULL and ts.data != NULL: * return <_PyTS>ts.data */ static CYTHON_INLINE struct __pyx_obj_8petsc4py_5PETSc__PyTS *__pyx_f_8petsc4py_5PETSc_PyTS(TS __pyx_v_ts) { struct __pyx_obj_8petsc4py_5PETSc__PyTS *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyTS", 1); /* "petsc4py/PETSc/libpetsc4py.pyx":2261 * cdef class _PyTS(_PyObj): pass * cdef inline _PyTS PyTS(PetscTS ts): * if ts != NULL and ts.data != NULL: # <<<<<<<<<<<<<< * return <_PyTS>ts.data * else: */ __pyx_t_2 = (__pyx_v_ts != NULL); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = (__pyx_v_ts->data != NULL); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "petsc4py/PETSc/libpetsc4py.pyx":2262 * cdef inline _PyTS PyTS(PetscTS ts): * if ts != NULL and ts.data != NULL: * return <_PyTS>ts.data # <<<<<<<<<<<<<< * else: * return _PyTS.__new__(_PyTS) */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)((struct __pyx_obj_8petsc4py_5PETSc__PyTS *)__pyx_v_ts->data)); __pyx_r = ((struct __pyx_obj_8petsc4py_5PETSc__PyTS *)__pyx_v_ts->data); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":2261 * cdef class _PyTS(_PyObj): pass * cdef inline _PyTS PyTS(PetscTS ts): * if ts != NULL and ts.data != NULL: # <<<<<<<<<<<<<< * return <_PyTS>ts.data * else: */ } /* "petsc4py/PETSc/libpetsc4py.pyx":2264 * return <_PyTS>ts.data * else: * return _PyTS.__new__(_PyTS) # <<<<<<<<<<<<<< * * cdef public PetscErrorCode TSPythonGetContext(PetscTS ts, void **ctx) \ */ /*else*/ { __Pyx_XDECREF((PyObject *)__pyx_r); __pyx_t_3 = ((PyObject *)__pyx_tp_new_8petsc4py_5PETSc__PyTS(((PyTypeObject *)__pyx_ptype_8petsc4py_5PETSc__PyTS), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 2264, __pyx_L1_error) __Pyx_GOTREF((PyObject *)__pyx_t_3); __pyx_r = ((struct __pyx_obj_8petsc4py_5PETSc__PyTS *)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; } /* "petsc4py/PETSc/libpetsc4py.pyx":2260 * @cython.internal * cdef class _PyTS(_PyObj): pass * cdef inline _PyTS PyTS(PetscTS ts): # <<<<<<<<<<<<<< * if ts != NULL and ts.data != NULL: * return <_PyTS>ts.data */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.PyTS", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":2266 * return _PyTS.__new__(_PyTS) * * cdef public PetscErrorCode TSPythonGetContext(PetscTS ts, void **ctx) \ # <<<<<<<<<<<<<< * except PETSC_ERR_PYTHON: * FunctionBegin(b"TSPythonGetContext") */ PetscErrorCode TSPythonGetContext(TS __pyx_v_ts, void **__pyx_v_ctx) { PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("TSPythonGetContext", 1); /* "petsc4py/PETSc/libpetsc4py.pyx":2268 * cdef public PetscErrorCode TSPythonGetContext(PetscTS ts, void **ctx) \ * except PETSC_ERR_PYTHON: * FunctionBegin(b"TSPythonGetContext") # <<<<<<<<<<<<<< * PyTS(ts).getcontext(ctx) * return FunctionEnd() */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"TSPythonGetContext")); /* "petsc4py/PETSc/libpetsc4py.pyx":2269 * except PETSC_ERR_PYTHON: * FunctionBegin(b"TSPythonGetContext") * PyTS(ts).getcontext(ctx) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyTS(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 2269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__PyTS *)((struct __pyx_obj_8petsc4py_5PETSc__PyTS *)__pyx_t_1)->__pyx_base.__pyx_vtab)->__pyx_base.getcontext(((struct __pyx_obj_8petsc4py_5PETSc__PyObj *)__pyx_t_1), __pyx_v_ctx); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(11, 2269, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2270 * FunctionBegin(b"TSPythonGetContext") * PyTS(ts).getcontext(ctx) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef public PetscErrorCode TSPythonSetContext(PetscTS ts, void *ctx) \ */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":2266 * return _PyTS.__new__(_PyTS) * * cdef public PetscErrorCode TSPythonGetContext(PetscTS ts, void **ctx) \ # <<<<<<<<<<<<<< * except PETSC_ERR_PYTHON: * FunctionBegin(b"TSPythonGetContext") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TSPythonGetContext", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":2272 * return FunctionEnd() * * cdef public PetscErrorCode TSPythonSetContext(PetscTS ts, void *ctx) \ # <<<<<<<<<<<<<< * except PETSC_ERR_PYTHON: * FunctionBegin(b"TSPythonSetContext") */ PetscErrorCode TSPythonSetContext(TS __pyx_v_ts, void *__pyx_v_ctx) { PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("TSPythonSetContext", 1); /* "petsc4py/PETSc/libpetsc4py.pyx":2274 * cdef public PetscErrorCode TSPythonSetContext(PetscTS ts, void *ctx) \ * except PETSC_ERR_PYTHON: * FunctionBegin(b"TSPythonSetContext") # <<<<<<<<<<<<<< * PyTS(ts).setcontext(ctx, TS_(ts)) * return FunctionEnd() */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"TSPythonSetContext")); /* "petsc4py/PETSc/libpetsc4py.pyx":2275 * except PETSC_ERR_PYTHON: * FunctionBegin(b"TSPythonSetContext") * PyTS(ts).setcontext(ctx, TS_(ts)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyTS(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 2275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_TS_(__pyx_v_ts)); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 2275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__PyTS *)((struct __pyx_obj_8petsc4py_5PETSc__PyTS *)__pyx_t_1)->__pyx_base.__pyx_vtab)->__pyx_base.setcontext(((struct __pyx_obj_8petsc4py_5PETSc__PyObj *)__pyx_t_1), __pyx_v_ctx, ((struct PyPetscObjectObject *)__pyx_t_2)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(11, 2275, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2276 * FunctionBegin(b"TSPythonSetContext") * PyTS(ts).setcontext(ctx, TS_(ts)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode TSPythonSetType_PYTHON(PetscTS ts, char name[]) \ */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":2272 * return FunctionEnd() * * cdef public PetscErrorCode TSPythonSetContext(PetscTS ts, void *ctx) \ # <<<<<<<<<<<<<< * except PETSC_ERR_PYTHON: * FunctionBegin(b"TSPythonSetContext") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TSPythonSetContext", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":2278 * return FunctionEnd() * * cdef PetscErrorCode TSPythonSetType_PYTHON(PetscTS ts, char name[]) \ # <<<<<<<<<<<<<< * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"TSPythonSetType_PYTHON") */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TSPythonSetType_PYTHON(TS __pyx_v_ts, char *__pyx_v_name) { PyObject *__pyx_v_ctx = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TSPythonSetType_PYTHON", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":2280 * cdef PetscErrorCode TSPythonSetType_PYTHON(PetscTS ts, char name[]) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"TSPythonSetType_PYTHON") # <<<<<<<<<<<<<< * if name == NULL: return FunctionEnd() # XXX * cdef object ctx = createcontext(name) */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"TSPythonSetType_PYTHON")); /* "petsc4py/PETSc/libpetsc4py.pyx":2281 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"TSPythonSetType_PYTHON") * if name == NULL: return FunctionEnd() # XXX # <<<<<<<<<<<<<< * cdef object ctx = createcontext(name) * TSPythonSetContext(ts, ctx) */ __pyx_t_1 = (__pyx_v_name == NULL); if (__pyx_t_1) { __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; } /* "petsc4py/PETSc/libpetsc4py.pyx":2282 * FunctionBegin(b"TSPythonSetType_PYTHON") * if name == NULL: return FunctionEnd() # XXX * cdef object ctx = createcontext(name) # <<<<<<<<<<<<<< * TSPythonSetContext(ts, ctx) * PyTS(ts).setname(name) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_createcontext(__pyx_v_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 2282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_ctx = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2283 * if name == NULL: return FunctionEnd() # XXX * cdef object ctx = createcontext(name) * TSPythonSetContext(ts, ctx) # <<<<<<<<<<<<<< * PyTS(ts).setname(name) * return FunctionEnd() */ __pyx_t_3 = TSPythonSetContext(__pyx_v_ts, ((void *)__pyx_v_ctx)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2283, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2284 * cdef object ctx = createcontext(name) * TSPythonSetContext(ts, ctx) * PyTS(ts).setname(name) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyTS(__pyx_v_ts)); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 2284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__PyTS *)((struct __pyx_obj_8petsc4py_5PETSc__PyTS *)__pyx_t_2)->__pyx_base.__pyx_vtab)->__pyx_base.setname(((struct __pyx_obj_8petsc4py_5PETSc__PyObj *)__pyx_t_2), __pyx_v_name); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(11, 2284, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2285 * TSPythonSetContext(ts, ctx) * PyTS(ts).setname(name) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode TSPythonGetType_PYTHON(PetscTS ts, const char *name[]) \ */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":2278 * return FunctionEnd() * * cdef PetscErrorCode TSPythonSetType_PYTHON(PetscTS ts, char name[]) \ # <<<<<<<<<<<<<< * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"TSPythonSetType_PYTHON") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TSPythonSetType_PYTHON", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ctx); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":2287 * return FunctionEnd() * * cdef PetscErrorCode TSPythonGetType_PYTHON(PetscTS ts, const char *name[]) \ # <<<<<<<<<<<<<< * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"TSPythonGetType_PYTHON") */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TSPythonGetType_PYTHON(TS __pyx_v_ts, char const **__pyx_v_name) { PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; char *__pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TSPythonGetType_PYTHON", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":2289 * cdef PetscErrorCode TSPythonGetType_PYTHON(PetscTS ts, const char *name[]) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"TSPythonGetType_PYTHON") # <<<<<<<<<<<<<< * name[0] = PyTS(ts).getname() * return FunctionEnd() */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"TSPythonGetType_PYTHON")); /* "petsc4py/PETSc/libpetsc4py.pyx":2290 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"TSPythonGetType_PYTHON") * name[0] = PyTS(ts).getname() # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyTS(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 2290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__PyTS *)((struct __pyx_obj_8petsc4py_5PETSc__PyTS *)__pyx_t_1)->__pyx_base.__pyx_vtab)->__pyx_base.getname(((struct __pyx_obj_8petsc4py_5PETSc__PyObj *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((char *)NULL) && PyErr_Occurred())) __PYX_ERR(11, 2290, __pyx_L1_error) (__pyx_v_name[0]) = __pyx_t_2; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2291 * FunctionBegin(b"TSPythonGetType_PYTHON") * name[0] = PyTS(ts).getname() * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode TSCreate_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":2287 * return FunctionEnd() * * cdef PetscErrorCode TSPythonGetType_PYTHON(PetscTS ts, const char *name[]) \ # <<<<<<<<<<<<<< * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"TSPythonGetType_PYTHON") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TSPythonGetType_PYTHON", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":2293 * return FunctionEnd() * * cdef PetscErrorCode TSCreate_Python( # <<<<<<<<<<<<<< * PetscTS ts, * ) \ */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TSCreate_Python(TS __pyx_v_ts) { TSOps __pyx_v_ops; PyObject *__pyx_v_ctx = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations TSOps __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TSCreate_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":2297 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"TSCreate_Python") # <<<<<<<<<<<<<< * # * cdef TSOps ops = ts.ops */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"TSCreate_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":2299 * FunctionBegin(b"TSCreate_Python") * # * cdef TSOps ops = ts.ops # <<<<<<<<<<<<<< * ops.reset = TSReset_Python * ops.destroy = TSDestroy_Python */ __pyx_t_1 = __pyx_v_ts->ops; __pyx_v_ops = __pyx_t_1; /* "petsc4py/PETSc/libpetsc4py.pyx":2300 * # * cdef TSOps ops = ts.ops * ops.reset = TSReset_Python # <<<<<<<<<<<<<< * ops.destroy = TSDestroy_Python * ops.setup = TSSetUp_Python */ __pyx_v_ops->reset = __pyx_f_8petsc4py_5PETSc_TSReset_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":2301 * cdef TSOps ops = ts.ops * ops.reset = TSReset_Python * ops.destroy = TSDestroy_Python # <<<<<<<<<<<<<< * ops.setup = TSSetUp_Python * ops.setfromoptions = TSSetFromOptions_Python */ __pyx_v_ops->destroy = __pyx_f_8petsc4py_5PETSc_TSDestroy_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":2302 * ops.reset = TSReset_Python * ops.destroy = TSDestroy_Python * ops.setup = TSSetUp_Python # <<<<<<<<<<<<<< * ops.setfromoptions = TSSetFromOptions_Python * ops.view = TSView_Python */ __pyx_v_ops->setup = __pyx_f_8petsc4py_5PETSc_TSSetUp_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":2303 * ops.destroy = TSDestroy_Python * ops.setup = TSSetUp_Python * ops.setfromoptions = TSSetFromOptions_Python # <<<<<<<<<<<<<< * ops.view = TSView_Python * ops.step = TSStep_Python */ __pyx_v_ops->setfromoptions = __pyx_f_8petsc4py_5PETSc_TSSetFromOptions_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":2304 * ops.setup = TSSetUp_Python * ops.setfromoptions = TSSetFromOptions_Python * ops.view = TSView_Python # <<<<<<<<<<<<<< * ops.step = TSStep_Python * ops.rollback = TSRollBack_Python */ __pyx_v_ops->view = __pyx_f_8petsc4py_5PETSc_TSView_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":2305 * ops.setfromoptions = TSSetFromOptions_Python * ops.view = TSView_Python * ops.step = TSStep_Python # <<<<<<<<<<<<<< * ops.rollback = TSRollBack_Python * ops.interpolate = TSInterpolate_Python */ __pyx_v_ops->step = __pyx_f_8petsc4py_5PETSc_TSStep_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":2306 * ops.view = TSView_Python * ops.step = TSStep_Python * ops.rollback = TSRollBack_Python # <<<<<<<<<<<<<< * ops.interpolate = TSInterpolate_Python * ops.evaluatestep = TSEvaluateStep_Python */ __pyx_v_ops->rollback = __pyx_f_8petsc4py_5PETSc_TSRollBack_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":2307 * ops.step = TSStep_Python * ops.rollback = TSRollBack_Python * ops.interpolate = TSInterpolate_Python # <<<<<<<<<<<<<< * ops.evaluatestep = TSEvaluateStep_Python * ops.snesfunction = SNESTSFormFunction_Python */ __pyx_v_ops->interpolate = __pyx_f_8petsc4py_5PETSc_TSInterpolate_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":2308 * ops.rollback = TSRollBack_Python * ops.interpolate = TSInterpolate_Python * ops.evaluatestep = TSEvaluateStep_Python # <<<<<<<<<<<<<< * ops.snesfunction = SNESTSFormFunction_Python * ops.snesjacobian = SNESTSFormJacobian_Python */ __pyx_v_ops->evaluatestep = __pyx_f_8petsc4py_5PETSc_TSEvaluateStep_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":2309 * ops.interpolate = TSInterpolate_Python * ops.evaluatestep = TSEvaluateStep_Python * ops.snesfunction = SNESTSFormFunction_Python # <<<<<<<<<<<<<< * ops.snesjacobian = SNESTSFormJacobian_Python * # */ __pyx_v_ops->snesfunction = __pyx_f_8petsc4py_5PETSc_SNESTSFormFunction_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":2310 * ops.evaluatestep = TSEvaluateStep_Python * ops.snesfunction = SNESTSFormFunction_Python * ops.snesjacobian = SNESTSFormJacobian_Python # <<<<<<<<<<<<<< * # * CHKERR( PetscObjectComposeFunction( */ __pyx_v_ops->snesjacobian = __pyx_f_8petsc4py_5PETSc_SNESTSFormJacobian_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":2312 * ops.snesjacobian = SNESTSFormJacobian_Python * # * CHKERR( PetscObjectComposeFunction( # <<<<<<<<<<<<<< * ts, b"TSPythonSetType_C", * TSPythonSetType_PYTHON) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectComposeFunction(((PetscObject)__pyx_v_ts), ((char *)"TSPythonSetType_C"), ((PetscVoidFunction)__pyx_f_8petsc4py_5PETSc_TSPythonSetType_PYTHON))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2312, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2315 * ts, b"TSPythonSetType_C", * TSPythonSetType_PYTHON) ) * CHKERR( PetscObjectComposeFunction( # <<<<<<<<<<<<<< * ts, b"TSPythonGetType_C", * TSPythonGetType_PYTHON) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectComposeFunction(((PetscObject)__pyx_v_ts), ((char *)"TSPythonGetType_C"), ((PetscVoidFunction)__pyx_f_8petsc4py_5PETSc_TSPythonGetType_PYTHON))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2315, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2319 * TSPythonGetType_PYTHON) ) * # * ts.usessnes = PETSC_TRUE # <<<<<<<<<<<<<< * # * cdef ctx = PyTS(NULL) */ __pyx_v_ts->usessnes = PETSC_TRUE; /* "petsc4py/PETSc/libpetsc4py.pyx":2321 * ts.usessnes = PETSC_TRUE * # * cdef ctx = PyTS(NULL) # <<<<<<<<<<<<<< * ts.data = ctx * Py_INCREF(ts.data) */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyTS(NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 2321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_ctx = __pyx_t_3; __pyx_t_3 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2322 * # * cdef ctx = PyTS(NULL) * ts.data = ctx # <<<<<<<<<<<<<< * Py_INCREF(ts.data) * return FunctionEnd() */ __pyx_v_ts->data = ((void *)__pyx_v_ctx); /* "petsc4py/PETSc/libpetsc4py.pyx":2323 * cdef ctx = PyTS(NULL) * ts.data = ctx * Py_INCREF(ts.data) # <<<<<<<<<<<<<< * return FunctionEnd() * */ Py_INCREF(((PyObject *)__pyx_v_ts->data)); /* "petsc4py/PETSc/libpetsc4py.pyx":2324 * ts.data = ctx * Py_INCREF(ts.data) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef inline PetscErrorCode TSDestroy_Python_inner( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":2293 * return FunctionEnd() * * cdef PetscErrorCode TSCreate_Python( # <<<<<<<<<<<<<< * PetscTS ts, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TSCreate_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ctx); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":2326 * return FunctionEnd() * * cdef inline PetscErrorCode TSDestroy_Python_inner( # <<<<<<<<<<<<<< * PetscTS ts, * ) \ */ static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_TSDestroy_Python_inner(TS __pyx_v_ts) { PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_t_2; int __pyx_t_3; char const *__pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TSDestroy_Python_inner", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":2330 * ) \ * except PETSC_ERR_PYTHON with gil: * try: # <<<<<<<<<<<<<< * addRef(ts) * TSPythonSetContext(ts, NULL) */ /*try:*/ { /* "petsc4py/PETSc/libpetsc4py.pyx":2331 * except PETSC_ERR_PYTHON with gil: * try: * addRef(ts) # <<<<<<<<<<<<<< * TSPythonSetContext(ts, NULL) * finally: */ __pyx_f_8petsc4py_5PETSc_addRef(__pyx_v_ts); /* "petsc4py/PETSc/libpetsc4py.pyx":2332 * try: * addRef(ts) * TSPythonSetContext(ts, NULL) # <<<<<<<<<<<<<< * finally: * delRef(ts) */ __pyx_t_1 = TSPythonSetContext(__pyx_v_ts, NULL); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2332, __pyx_L4_error) } /* "petsc4py/PETSc/libpetsc4py.pyx":2334 * TSPythonSetContext(ts, NULL) * finally: * delRef(ts) # <<<<<<<<<<<<<< * Py_DECREF(ts.data) * ts.data = NULL */ /*finally:*/ { /*normal exit:*/{ __pyx_f_8petsc4py_5PETSc_delRef(__pyx_v_ts); /* "petsc4py/PETSc/libpetsc4py.pyx":2335 * finally: * delRef(ts) * Py_DECREF(ts.data) # <<<<<<<<<<<<<< * ts.data = NULL * return PETSC_SUCCESS */ Py_DECREF(((PyObject *)__pyx_v_ts->data)); /* "petsc4py/PETSc/libpetsc4py.pyx":2336 * delRef(ts) * Py_DECREF(ts.data) * ts.data = NULL # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_v_ts->data = NULL; goto __pyx_L5; } __pyx_L4_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0)) __Pyx_ErrFetch(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __pyx_t_2 = __pyx_lineno; __pyx_t_3 = __pyx_clineno; __pyx_t_4 = __pyx_filename; { /* "petsc4py/PETSc/libpetsc4py.pyx":2334 * TSPythonSetContext(ts, NULL) * finally: * delRef(ts) # <<<<<<<<<<<<<< * Py_DECREF(ts.data) * ts.data = NULL */ __pyx_f_8petsc4py_5PETSc_delRef(__pyx_v_ts); /* "petsc4py/PETSc/libpetsc4py.pyx":2335 * finally: * delRef(ts) * Py_DECREF(ts.data) # <<<<<<<<<<<<<< * ts.data = NULL * return PETSC_SUCCESS */ Py_DECREF(((PyObject *)__pyx_v_ts->data)); /* "petsc4py/PETSc/libpetsc4py.pyx":2336 * delRef(ts) * Py_DECREF(ts.data) * ts.data = NULL # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_v_ts->data = NULL; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); } __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_ErrRestore(__pyx_t_5, __pyx_t_6, __pyx_t_7); __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_lineno = __pyx_t_2; __pyx_clineno = __pyx_t_3; __pyx_filename = __pyx_t_4; goto __pyx_L1_error; } __pyx_L5:; } /* "petsc4py/PETSc/libpetsc4py.pyx":2337 * Py_DECREF(ts.data) * ts.data = NULL * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * cdef PetscErrorCode TSDestroy_Python( */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":2326 * return FunctionEnd() * * cdef inline PetscErrorCode TSDestroy_Python_inner( # <<<<<<<<<<<<<< * PetscTS ts, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TSDestroy_Python_inner", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":2339 * return PETSC_SUCCESS * * cdef PetscErrorCode TSDestroy_Python( # <<<<<<<<<<<<<< * PetscTS ts, * ) \ */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TSDestroy_Python(TS __pyx_v_ts) { PetscErrorCode __pyx_r; PetscErrorCode __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save; #endif /* "petsc4py/PETSc/libpetsc4py.pyx":2343 * ) \ * except PETSC_ERR_PYTHON nogil: * FunctionBegin(b"TSDestroy_Python") # <<<<<<<<<<<<<< * CHKERR( PetscObjectComposeFunction( * ts, b"TSPythonSetType_C", */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"TSDestroy_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":2344 * except PETSC_ERR_PYTHON nogil: * FunctionBegin(b"TSDestroy_Python") * CHKERR( PetscObjectComposeFunction( # <<<<<<<<<<<<<< * ts, b"TSPythonSetType_C", * NULL) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectComposeFunction(((PetscObject)__pyx_v_ts), ((char *)"TSPythonSetType_C"), ((PetscVoidFunction)NULL))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2344, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2347 * ts, b"TSPythonSetType_C", * NULL) ) * CHKERR( PetscObjectComposeFunction( # <<<<<<<<<<<<<< * ts, b"TSPythonGetType_C", * NULL) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectComposeFunction(((PetscObject)__pyx_v_ts), ((char *)"TSPythonGetType_C"), ((PetscVoidFunction)NULL))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2347, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2351 * NULL) ) * # * if Py_IsInitialized(): TSDestroy_Python_inner(ts) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_2 = (Py_IsInitialized() != 0); if (__pyx_t_2) { __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_TSDestroy_Python_inner(__pyx_v_ts); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2351, __pyx_L1_error) } /* "petsc4py/PETSc/libpetsc4py.pyx":2352 * # * if Py_IsInitialized(): TSDestroy_Python_inner(ts) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode TSSetUp_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":2339 * return PETSC_SUCCESS * * cdef PetscErrorCode TSDestroy_Python( # <<<<<<<<<<<<<< * PetscTS ts, * ) \ */ /* function exit code */ __pyx_L1_error:; #ifdef WITH_THREAD __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_AddTraceback("petsc4py.PETSc.TSDestroy_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":2354 * return FunctionEnd() * * cdef PetscErrorCode TSSetUp_Python( # <<<<<<<<<<<<<< * PetscTS ts, * ) \ */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TSSetUp_Python(TS __pyx_v_ts) { Vec __pyx_v_vec_update; Vec __pyx_v_vec_dot; char __pyx_v_name[0x800]; PetscBool __pyx_v_found; PyObject *__pyx_v_setUp = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; PetscErrorCode __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TSSetUp_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":2358 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"TSSetUp_Python") # <<<<<<<<<<<<<< * # * cdef PetscVec vec_update = NULL */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"TSSetUp_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":2360 * FunctionBegin(b"TSSetUp_Python") * # * cdef PetscVec vec_update = NULL # <<<<<<<<<<<<<< * CHKERR( VecDuplicate(ts.vec_sol, &vec_update) ) * CHKERR( PetscObjectCompose(ts, */ __pyx_v_vec_update = NULL; /* "petsc4py/PETSc/libpetsc4py.pyx":2361 * # * cdef PetscVec vec_update = NULL * CHKERR( VecDuplicate(ts.vec_sol, &vec_update) ) # <<<<<<<<<<<<<< * CHKERR( PetscObjectCompose(ts, * b"@ts.vec_update", */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecDuplicate(__pyx_v_ts->vec_sol, (&__pyx_v_vec_update))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2361, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2362 * cdef PetscVec vec_update = NULL * CHKERR( VecDuplicate(ts.vec_sol, &vec_update) ) * CHKERR( PetscObjectCompose(ts, # <<<<<<<<<<<<<< * b"@ts.vec_update", * vec_update) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectCompose(((PetscObject)__pyx_v_ts), ((char *)"@ts.vec_update"), ((PetscObject)__pyx_v_vec_update))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2362, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2365 * b"@ts.vec_update", * vec_update) ) * CHKERR( VecDestroy(&vec_update) ) # <<<<<<<<<<<<<< * cdef PetscVec vec_dot = NULL * CHKERR( VecDuplicate(ts.vec_sol, &vec_dot) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecDestroy((&__pyx_v_vec_update))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2365, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2366 * vec_update) ) * CHKERR( VecDestroy(&vec_update) ) * cdef PetscVec vec_dot = NULL # <<<<<<<<<<<<<< * CHKERR( VecDuplicate(ts.vec_sol, &vec_dot) ) * CHKERR( PetscObjectCompose(ts, */ __pyx_v_vec_dot = NULL; /* "petsc4py/PETSc/libpetsc4py.pyx":2367 * CHKERR( VecDestroy(&vec_update) ) * cdef PetscVec vec_dot = NULL * CHKERR( VecDuplicate(ts.vec_sol, &vec_dot) ) # <<<<<<<<<<<<<< * CHKERR( PetscObjectCompose(ts, * b"@ts.vec_dot", */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecDuplicate(__pyx_v_ts->vec_sol, (&__pyx_v_vec_dot))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2367, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2368 * cdef PetscVec vec_dot = NULL * CHKERR( VecDuplicate(ts.vec_sol, &vec_dot) ) * CHKERR( PetscObjectCompose(ts, # <<<<<<<<<<<<<< * b"@ts.vec_dot", * vec_dot) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectCompose(((PetscObject)__pyx_v_ts), ((char *)"@ts.vec_dot"), ((PetscObject)__pyx_v_vec_dot))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2368, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2371 * b"@ts.vec_dot", * vec_dot) ) * CHKERR( VecDestroy(&vec_dot) ) # <<<<<<<<<<<<<< * # * cdef char name[2048] */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecDestroy((&__pyx_v_vec_dot))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2371, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2374 * # * cdef char name[2048] * cdef PetscBool found = PETSC_FALSE # <<<<<<<<<<<<<< * if PyTS(ts).self is None: * CHKERR( PetscOptionsGetString(NULL, */ __pyx_v_found = PETSC_FALSE; /* "petsc4py/PETSc/libpetsc4py.pyx":2375 * cdef char name[2048] * cdef PetscBool found = PETSC_FALSE * if PyTS(ts).self is None: # <<<<<<<<<<<<<< * CHKERR( PetscOptionsGetString(NULL, * getPrefix(ts), b"-ts_python_type", */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyTS(__pyx_v_ts)); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 2375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = (((struct __pyx_obj_8petsc4py_5PETSc__PyTS *)__pyx_t_2)->__pyx_base.self == Py_None); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { /* "petsc4py/PETSc/libpetsc4py.pyx":2376 * cdef PetscBool found = PETSC_FALSE * if PyTS(ts).self is None: * CHKERR( PetscOptionsGetString(NULL, # <<<<<<<<<<<<<< * getPrefix(ts), b"-ts_python_type", * name, sizeof(name), &found) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsGetString(NULL, __pyx_f_8petsc4py_5PETSc_getPrefix(__pyx_v_ts), ((char *)"-ts_python_type"), __pyx_v_name, (sizeof(__pyx_v_name)), (&__pyx_v_found))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2376, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2379 * getPrefix(ts), b"-ts_python_type", * name, sizeof(name), &found) ) * if found and name[0]: # <<<<<<<<<<<<<< * CHKERR( TSPythonSetType_PYTHON(ts, name) ) * if PyTS(ts).self is None: */ if (__pyx_v_found) { } else { __pyx_t_3 = __pyx_v_found; goto __pyx_L5_bool_binop_done; } __pyx_t_4 = ((__pyx_v_name[0]) != 0); __pyx_t_3 = __pyx_t_4; __pyx_L5_bool_binop_done:; if (__pyx_t_3) { /* "petsc4py/PETSc/libpetsc4py.pyx":2380 * name, sizeof(name), &found) ) * if found and name[0]: * CHKERR( TSPythonSetType_PYTHON(ts, name) ) # <<<<<<<<<<<<<< * if PyTS(ts).self is None: * return PetscSETERR(PETSC_ERR_USER, */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_TSPythonSetType_PYTHON(__pyx_v_ts, __pyx_v_name); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2380, __pyx_L1_error) __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_t_1); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2380, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2379 * getPrefix(ts), b"-ts_python_type", * name, sizeof(name), &found) ) * if found and name[0]: # <<<<<<<<<<<<<< * CHKERR( TSPythonSetType_PYTHON(ts, name) ) * if PyTS(ts).self is None: */ } /* "petsc4py/PETSc/libpetsc4py.pyx":2375 * cdef char name[2048] * cdef PetscBool found = PETSC_FALSE * if PyTS(ts).self is None: # <<<<<<<<<<<<<< * CHKERR( PetscOptionsGetString(NULL, * getPrefix(ts), b"-ts_python_type", */ } /* "petsc4py/PETSc/libpetsc4py.pyx":2381 * if found and name[0]: * CHKERR( TSPythonSetType_PYTHON(ts, name) ) * if PyTS(ts).self is None: # <<<<<<<<<<<<<< * return PetscSETERR(PETSC_ERR_USER, * "Python context not set, call one of \n" */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyTS(__pyx_v_ts)); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 2381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = (((struct __pyx_obj_8petsc4py_5PETSc__PyTS *)__pyx_t_2)->__pyx_base.self == Py_None); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { /* "petsc4py/PETSc/libpetsc4py.pyx":2382 * CHKERR( TSPythonSetType_PYTHON(ts, name) ) * if PyTS(ts).self is None: * return PetscSETERR(PETSC_ERR_USER, # <<<<<<<<<<<<<< * "Python context not set, call one of \n" * " * TSPythonSetType(ts, \"[package.]module.class\")\n" */ __pyx_r = __pyx_f_8petsc4py_5PETSc_PetscSETERR(PETSC_ERR_USER, ((char *)"Python context not set, call one of \n * TSPythonSetType(ts, \"[package.]module.class\")\n * TSSetFromOptions(ts) and pass option -ts_python_type [package.]module.class")); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":2381 * if found and name[0]: * CHKERR( TSPythonSetType_PYTHON(ts, name) ) * if PyTS(ts).self is None: # <<<<<<<<<<<<<< * return PetscSETERR(PETSC_ERR_USER, * "Python context not set, call one of \n" */ } /* "petsc4py/PETSc/libpetsc4py.pyx":2388 * "-ts_python_type [package.]module.class") * # * cdef setUp = PyTS(ts).setUp # <<<<<<<<<<<<<< * if setUp is not None: * setUp(TS_(ts)) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyTS(__pyx_v_ts)); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 2388, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_setUp); if (unlikely(!__pyx_t_6)) __PYX_ERR(11, 2388, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_setUp = __pyx_t_6; __pyx_t_6 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2389 * # * cdef setUp = PyTS(ts).setUp * if setUp is not None: # <<<<<<<<<<<<<< * setUp(TS_(ts)) * return FunctionEnd() */ __pyx_t_3 = (__pyx_v_setUp != Py_None); if (__pyx_t_3) { /* "petsc4py/PETSc/libpetsc4py.pyx":2390 * cdef setUp = PyTS(ts).setUp * if setUp is not None: * setUp(TS_(ts)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_TS_(__pyx_v_ts)); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 2390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_setUp); __pyx_t_7 = __pyx_v_setUp; __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_2}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(11, 2390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2389 * # * cdef setUp = PyTS(ts).setUp * if setUp is not None: # <<<<<<<<<<<<<< * setUp(TS_(ts)) * return FunctionEnd() */ } /* "petsc4py/PETSc/libpetsc4py.pyx":2391 * if setUp is not None: * setUp(TS_(ts)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef inline PetscErrorCode TSReset_Python_inner( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":2354 * return FunctionEnd() * * cdef PetscErrorCode TSSetUp_Python( # <<<<<<<<<<<<<< * PetscTS ts, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("petsc4py.PETSc.TSSetUp_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_setUp); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":2393 * return FunctionEnd() * * cdef inline PetscErrorCode TSReset_Python_inner( # <<<<<<<<<<<<<< * PetscTS ts, * ) \ */ static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_TSReset_Python_inner(TS __pyx_v_ts) { PyObject *__pyx_v_reset = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TSReset_Python_inner", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":2397 * ) \ * except PETSC_ERR_PYTHON with gil: * cdef reset = PyTS(ts).reset # <<<<<<<<<<<<<< * if reset is not None: * reset(TS_(ts)) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyTS(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 2397, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_reset); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 2397, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_reset = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2398 * except PETSC_ERR_PYTHON with gil: * cdef reset = PyTS(ts).reset * if reset is not None: # <<<<<<<<<<<<<< * reset(TS_(ts)) * return PETSC_SUCCESS */ __pyx_t_3 = (__pyx_v_reset != Py_None); if (__pyx_t_3) { /* "petsc4py/PETSc/libpetsc4py.pyx":2399 * cdef reset = PyTS(ts).reset * if reset is not None: * reset(TS_(ts)) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_TS_(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 2399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_reset); __pyx_t_4 = __pyx_v_reset; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_1}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 2399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2398 * except PETSC_ERR_PYTHON with gil: * cdef reset = PyTS(ts).reset * if reset is not None: # <<<<<<<<<<<<<< * reset(TS_(ts)) * return PETSC_SUCCESS */ } /* "petsc4py/PETSc/libpetsc4py.pyx":2400 * if reset is not None: * reset(TS_(ts)) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * cdef PetscErrorCode TSReset_Python( */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":2393 * return FunctionEnd() * * cdef inline PetscErrorCode TSReset_Python_inner( # <<<<<<<<<<<<<< * PetscTS ts, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.TSReset_Python_inner", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_reset); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":2402 * return PETSC_SUCCESS * * cdef PetscErrorCode TSReset_Python( # <<<<<<<<<<<<<< * PetscTS ts, * ) \ */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TSReset_Python(TS __pyx_v_ts) { PetscErrorCode __pyx_r; int __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save; #endif /* "petsc4py/PETSc/libpetsc4py.pyx":2406 * ) \ * except PETSC_ERR_PYTHON nogil: * if getRef(ts) == 0: return PETSC_SUCCESS # <<<<<<<<<<<<<< * FunctionBegin(b"TSReset_Python") * CHKERR( PetscObjectCompose(ts, b"@ts.vec_update", NULL) ) */ __pyx_t_1 = (__pyx_f_8petsc4py_5PETSc_getRef(__pyx_v_ts) == 0); if (__pyx_t_1) { __pyx_r = PETSC_SUCCESS; goto __pyx_L0; } /* "petsc4py/PETSc/libpetsc4py.pyx":2407 * except PETSC_ERR_PYTHON nogil: * if getRef(ts) == 0: return PETSC_SUCCESS * FunctionBegin(b"TSReset_Python") # <<<<<<<<<<<<<< * CHKERR( PetscObjectCompose(ts, b"@ts.vec_update", NULL) ) * CHKERR( PetscObjectCompose(ts, b"@ts.vec_dot", NULL) ) */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"TSReset_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":2408 * if getRef(ts) == 0: return PETSC_SUCCESS * FunctionBegin(b"TSReset_Python") * CHKERR( PetscObjectCompose(ts, b"@ts.vec_update", NULL) ) # <<<<<<<<<<<<<< * CHKERR( PetscObjectCompose(ts, b"@ts.vec_dot", NULL) ) * if Py_IsInitialized(): TSReset_Python_inner(ts) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectCompose(((PetscObject)__pyx_v_ts), ((char *)"@ts.vec_update"), NULL)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2408, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2409 * FunctionBegin(b"TSReset_Python") * CHKERR( PetscObjectCompose(ts, b"@ts.vec_update", NULL) ) * CHKERR( PetscObjectCompose(ts, b"@ts.vec_dot", NULL) ) # <<<<<<<<<<<<<< * if Py_IsInitialized(): TSReset_Python_inner(ts) * return FunctionEnd() */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectCompose(((PetscObject)__pyx_v_ts), ((char *)"@ts.vec_dot"), NULL)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2409, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2410 * CHKERR( PetscObjectCompose(ts, b"@ts.vec_update", NULL) ) * CHKERR( PetscObjectCompose(ts, b"@ts.vec_dot", NULL) ) * if Py_IsInitialized(): TSReset_Python_inner(ts) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = (Py_IsInitialized() != 0); if (__pyx_t_1) { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_TSReset_Python_inner(__pyx_v_ts); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2410, __pyx_L1_error) } /* "petsc4py/PETSc/libpetsc4py.pyx":2411 * CHKERR( PetscObjectCompose(ts, b"@ts.vec_dot", NULL) ) * if Py_IsInitialized(): TSReset_Python_inner(ts) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode TSSetFromOptions_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":2402 * return PETSC_SUCCESS * * cdef PetscErrorCode TSReset_Python( # <<<<<<<<<<<<<< * PetscTS ts, * ) \ */ /* function exit code */ __pyx_L1_error:; #ifdef WITH_THREAD __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_AddTraceback("petsc4py.PETSc.TSReset_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":2413 * return FunctionEnd() * * cdef PetscErrorCode TSSetFromOptions_Python( # <<<<<<<<<<<<<< * PetscTS ts, * PetscOptionItems *PetscOptionsObject, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TSSetFromOptions_Python(TS __pyx_v_ts, PetscOptionItems *__pyx_v_PetscOptionsObject) { char __pyx_v_name[0x800]; char *__pyx_v_defval; PetscBool __pyx_v_found; PetscOptionItems *PetscOptionsObject; PyObject *__pyx_v_setFromOptions = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; char *__pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_t_4; int __pyx_t_5; PetscErrorCode __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TSSetFromOptions_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":2418 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"TSSetFromOptions_Python") # <<<<<<<<<<<<<< * cdef char name[2048], *defval = PyTS(ts).getname() * cdef PetscBool found = PETSC_FALSE */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"TSSetFromOptions_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":2419 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"TSSetFromOptions_Python") * cdef char name[2048], *defval = PyTS(ts).getname() # <<<<<<<<<<<<<< * cdef PetscBool found = PETSC_FALSE * cdef PetscOptionItems *opts "PetscOptionsObject" = PetscOptionsObject */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyTS(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 2419, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__PyTS *)((struct __pyx_obj_8petsc4py_5PETSc__PyTS *)__pyx_t_1)->__pyx_base.__pyx_vtab)->__pyx_base.getname(((struct __pyx_obj_8petsc4py_5PETSc__PyObj *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((char *)NULL) && PyErr_Occurred())) __PYX_ERR(11, 2419, __pyx_L1_error) __pyx_v_defval = __pyx_t_2; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2420 * FunctionBegin(b"TSSetFromOptions_Python") * cdef char name[2048], *defval = PyTS(ts).getname() * cdef PetscBool found = PETSC_FALSE # <<<<<<<<<<<<<< * cdef PetscOptionItems *opts "PetscOptionsObject" = PetscOptionsObject * CHKERR( PetscOptionsString( */ __pyx_v_found = PETSC_FALSE; /* "petsc4py/PETSc/libpetsc4py.pyx":2421 * cdef char name[2048], *defval = PyTS(ts).getname() * cdef PetscBool found = PETSC_FALSE * cdef PetscOptionItems *opts "PetscOptionsObject" = PetscOptionsObject # <<<<<<<<<<<<<< * CHKERR( PetscOptionsString( * b"-ts_python_type", b"Python [package.]module[.{class|function}]", */ PetscOptionsObject = __pyx_v_PetscOptionsObject; /* "petsc4py/PETSc/libpetsc4py.pyx":2422 * cdef PetscBool found = PETSC_FALSE * cdef PetscOptionItems *opts "PetscOptionsObject" = PetscOptionsObject * CHKERR( PetscOptionsString( # <<<<<<<<<<<<<< * b"-ts_python_type", b"Python [package.]module[.{class|function}]", * b"TSPythonSetType", defval, name, sizeof(name), &found) ); opts; */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsString(((char *)"-ts_python_type"), ((char *)"Python [package.]module[.{class|function}]"), ((char *)"TSPythonSetType"), __pyx_v_defval, __pyx_v_name, (sizeof(__pyx_v_name)), (&__pyx_v_found))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2422, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2424 * CHKERR( PetscOptionsString( * b"-ts_python_type", b"Python [package.]module[.{class|function}]", * b"TSPythonSetType", defval, name, sizeof(name), &found) ); opts; # <<<<<<<<<<<<<< * if found and name[0]: * CHKERR( TSPythonSetType_PYTHON(ts, name) ) */ ((void)PetscOptionsObject); /* "petsc4py/PETSc/libpetsc4py.pyx":2425 * b"-ts_python_type", b"Python [package.]module[.{class|function}]", * b"TSPythonSetType", defval, name, sizeof(name), &found) ); opts; * if found and name[0]: # <<<<<<<<<<<<<< * CHKERR( TSPythonSetType_PYTHON(ts, name) ) * # */ if (__pyx_v_found) { } else { __pyx_t_4 = __pyx_v_found; goto __pyx_L4_bool_binop_done; } __pyx_t_5 = ((__pyx_v_name[0]) != 0); __pyx_t_4 = __pyx_t_5; __pyx_L4_bool_binop_done:; if (__pyx_t_4) { /* "petsc4py/PETSc/libpetsc4py.pyx":2426 * b"TSPythonSetType", defval, name, sizeof(name), &found) ); opts; * if found and name[0]: * CHKERR( TSPythonSetType_PYTHON(ts, name) ) # <<<<<<<<<<<<<< * # * cdef setFromOptions = PyTS(ts).setFromOptions */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_TSPythonSetType_PYTHON(__pyx_v_ts, __pyx_v_name); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2426, __pyx_L1_error) __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_t_3); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2426, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2425 * b"-ts_python_type", b"Python [package.]module[.{class|function}]", * b"TSPythonSetType", defval, name, sizeof(name), &found) ); opts; * if found and name[0]: # <<<<<<<<<<<<<< * CHKERR( TSPythonSetType_PYTHON(ts, name) ) * # */ } /* "petsc4py/PETSc/libpetsc4py.pyx":2428 * CHKERR( TSPythonSetType_PYTHON(ts, name) ) * # * cdef setFromOptions = PyTS(ts).setFromOptions # <<<<<<<<<<<<<< * if setFromOptions is not None: * setFromOptions(TS_(ts)) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyTS(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 2428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_setFromOptions); if (unlikely(!__pyx_t_7)) __PYX_ERR(11, 2428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_setFromOptions = __pyx_t_7; __pyx_t_7 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2429 * # * cdef setFromOptions = PyTS(ts).setFromOptions * if setFromOptions is not None: # <<<<<<<<<<<<<< * setFromOptions(TS_(ts)) * CHKERR( SNESSetFromOptions(ts.snes) ) */ __pyx_t_4 = (__pyx_v_setFromOptions != Py_None); if (__pyx_t_4) { /* "petsc4py/PETSc/libpetsc4py.pyx":2430 * cdef setFromOptions = PyTS(ts).setFromOptions * if setFromOptions is not None: * setFromOptions(TS_(ts)) # <<<<<<<<<<<<<< * CHKERR( SNESSetFromOptions(ts.snes) ) * return FunctionEnd() */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_TS_(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 2430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_setFromOptions); __pyx_t_8 = __pyx_v_setFromOptions; __pyx_t_9 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_8))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_1}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(11, 2430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2429 * # * cdef setFromOptions = PyTS(ts).setFromOptions * if setFromOptions is not None: # <<<<<<<<<<<<<< * setFromOptions(TS_(ts)) * CHKERR( SNESSetFromOptions(ts.snes) ) */ } /* "petsc4py/PETSc/libpetsc4py.pyx":2431 * if setFromOptions is not None: * setFromOptions(TS_(ts)) * CHKERR( SNESSetFromOptions(ts.snes) ) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetFromOptions(__pyx_v_ts->snes)); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2431, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2432 * setFromOptions(TS_(ts)) * CHKERR( SNESSetFromOptions(ts.snes) ) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode TSView_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":2413 * return FunctionEnd() * * cdef PetscErrorCode TSSetFromOptions_Python( # <<<<<<<<<<<<<< * PetscTS ts, * PetscOptionItems *PetscOptionsObject, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("petsc4py.PETSc.TSSetFromOptions_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_setFromOptions); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":2434 * return FunctionEnd() * * cdef PetscErrorCode TSView_Python( # <<<<<<<<<<<<<< * PetscTS ts, * PetscViewer vwr, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TSView_Python(TS __pyx_v_ts, PetscViewer __pyx_v_vwr) { PyObject *__pyx_v_view = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TSView_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":2439 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"TSView_Python") # <<<<<<<<<<<<<< * viewcontext(PyTS(ts), vwr) * cdef view = PyTS(ts).view */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"TSView_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":2440 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"TSView_Python") * viewcontext(PyTS(ts), vwr) # <<<<<<<<<<<<<< * cdef view = PyTS(ts).view * if view is not None: */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyTS(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 2440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_viewcontext(((struct __pyx_obj_8petsc4py_5PETSc__PyObj *)__pyx_t_1), __pyx_v_vwr); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(11, 2440, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2441 * FunctionBegin(b"TSView_Python") * viewcontext(PyTS(ts), vwr) * cdef view = PyTS(ts).view # <<<<<<<<<<<<<< * if view is not None: * view(TS_(ts), Viewer_(vwr)) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyTS(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 2441, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_view); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 2441, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_view = __pyx_t_3; __pyx_t_3 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2442 * viewcontext(PyTS(ts), vwr) * cdef view = PyTS(ts).view * if view is not None: # <<<<<<<<<<<<<< * view(TS_(ts), Viewer_(vwr)) * return FunctionEnd() */ __pyx_t_4 = (__pyx_v_view != Py_None); if (__pyx_t_4) { /* "petsc4py/PETSc/libpetsc4py.pyx":2443 * cdef view = PyTS(ts).view * if view is not None: * view(TS_(ts), Viewer_(vwr)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_TS_(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 2443, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Viewer_(__pyx_v_vwr)); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 2443, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_view); __pyx_t_6 = __pyx_v_view; __pyx_t_7 = NULL; __pyx_t_2 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_2 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_1, __pyx_t_5}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_2, 2+__pyx_t_2); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 2443, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2442 * viewcontext(PyTS(ts), vwr) * cdef view = PyTS(ts).view * if view is not None: # <<<<<<<<<<<<<< * view(TS_(ts), Viewer_(vwr)) * return FunctionEnd() */ } /* "petsc4py/PETSc/libpetsc4py.pyx":2444 * if view is not None: * view(TS_(ts), Viewer_(vwr)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode TSStep_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":2434 * return FunctionEnd() * * cdef PetscErrorCode TSView_Python( # <<<<<<<<<<<<<< * PetscTS ts, * PetscViewer vwr, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.TSView_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_view); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":2446 * return FunctionEnd() * * cdef PetscErrorCode TSStep_Python( # <<<<<<<<<<<<<< * PetscTS ts, * ) \ */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TSStep_Python(TS __pyx_v_ts) { PyObject *__pyx_v_step = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; PetscErrorCode __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TSStep_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":2450 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"TSStep_Python") # <<<<<<<<<<<<<< * cdef step = PyTS(ts).step * if step is not None: */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"TSStep_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":2451 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"TSStep_Python") * cdef step = PyTS(ts).step # <<<<<<<<<<<<<< * if step is not None: * step(TS_(ts)) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyTS(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 2451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_step); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 2451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_step = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2452 * FunctionBegin(b"TSStep_Python") * cdef step = PyTS(ts).step * if step is not None: # <<<<<<<<<<<<<< * step(TS_(ts)) * else: */ __pyx_t_3 = (__pyx_v_step != Py_None); if (__pyx_t_3) { /* "petsc4py/PETSc/libpetsc4py.pyx":2453 * cdef step = PyTS(ts).step * if step is not None: * step(TS_(ts)) # <<<<<<<<<<<<<< * else: * TSStep_Python_default(ts) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_TS_(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 2453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_step); __pyx_t_4 = __pyx_v_step; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_1}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 2453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2452 * FunctionBegin(b"TSStep_Python") * cdef step = PyTS(ts).step * if step is not None: # <<<<<<<<<<<<<< * step(TS_(ts)) * else: */ goto __pyx_L3; } /* "petsc4py/PETSc/libpetsc4py.pyx":2455 * step(TS_(ts)) * else: * TSStep_Python_default(ts) # <<<<<<<<<<<<<< * return FunctionEnd() * */ /*else*/ { __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_TSStep_Python_default(__pyx_v_ts); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2455, __pyx_L1_error) } __pyx_L3:; /* "petsc4py/PETSc/libpetsc4py.pyx":2456 * else: * TSStep_Python_default(ts) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode TSRollBack_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":2446 * return FunctionEnd() * * cdef PetscErrorCode TSStep_Python( # <<<<<<<<<<<<<< * PetscTS ts, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.TSStep_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_step); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":2458 * return FunctionEnd() * * cdef PetscErrorCode TSRollBack_Python( # <<<<<<<<<<<<<< * PetscTS ts, * ) \ */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TSRollBack_Python(TS __pyx_v_ts) { PyObject *__pyx_v_rollback = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TSRollBack_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":2462 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"TSRollBack_Python") # <<<<<<<<<<<<<< * cdef rollback = PyTS(ts).rollback * if rollback is None: return UNSUPPORTED(b"rollback") */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"TSRollBack_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":2463 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"TSRollBack_Python") * cdef rollback = PyTS(ts).rollback # <<<<<<<<<<<<<< * if rollback is None: return UNSUPPORTED(b"rollback") * rollback(TS_(ts)) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyTS(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 2463, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_rollback); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 2463, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_rollback = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2464 * FunctionBegin(b"TSRollBack_Python") * cdef rollback = PyTS(ts).rollback * if rollback is None: return UNSUPPORTED(b"rollback") # <<<<<<<<<<<<<< * rollback(TS_(ts)) * return FunctionEnd() */ __pyx_t_3 = (__pyx_v_rollback == Py_None); if (__pyx_t_3) { __pyx_r = __pyx_f_8petsc4py_5PETSc_UNSUPPORTED(((char *)"rollback")); goto __pyx_L0; } /* "petsc4py/PETSc/libpetsc4py.pyx":2465 * cdef rollback = PyTS(ts).rollback * if rollback is None: return UNSUPPORTED(b"rollback") * rollback(TS_(ts)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_TS_(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 2465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_rollback); __pyx_t_4 = __pyx_v_rollback; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_1}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 2465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2466 * if rollback is None: return UNSUPPORTED(b"rollback") * rollback(TS_(ts)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode TSInterpolate_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":2458 * return FunctionEnd() * * cdef PetscErrorCode TSRollBack_Python( # <<<<<<<<<<<<<< * PetscTS ts, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.TSRollBack_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rollback); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":2468 * return FunctionEnd() * * cdef PetscErrorCode TSInterpolate_Python( # <<<<<<<<<<<<<< * PetscTS ts, * PetscReal t, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TSInterpolate_Python(TS __pyx_v_ts, PetscReal __pyx_v_t, Vec __pyx_v_x) { PyObject *__pyx_v_interpolate = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TSInterpolate_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":2474 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"TSInterpolate _Python") # <<<<<<<<<<<<<< * cdef interpolate = PyTS(ts).interpolate * if interpolate is None: return UNSUPPORTED(b"interpolate") */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"TSInterpolate _Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":2475 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"TSInterpolate _Python") * cdef interpolate = PyTS(ts).interpolate # <<<<<<<<<<<<<< * if interpolate is None: return UNSUPPORTED(b"interpolate") * interpolate(TS_(ts), toReal(t), Vec_(x)) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyTS(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 2475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_interpolate); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 2475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_interpolate = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2476 * FunctionBegin(b"TSInterpolate _Python") * cdef interpolate = PyTS(ts).interpolate * if interpolate is None: return UNSUPPORTED(b"interpolate") # <<<<<<<<<<<<<< * interpolate(TS_(ts), toReal(t), Vec_(x)) * return FunctionEnd() */ __pyx_t_3 = (__pyx_v_interpolate == Py_None); if (__pyx_t_3) { __pyx_r = __pyx_f_8petsc4py_5PETSc_UNSUPPORTED(((char *)"interpolate")); goto __pyx_L0; } /* "petsc4py/PETSc/libpetsc4py.pyx":2477 * cdef interpolate = PyTS(ts).interpolate * if interpolate is None: return UNSUPPORTED(b"interpolate") * interpolate(TS_(ts), toReal(t), Vec_(x)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_TS_(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 2477, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_t); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 2477, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_x)); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 2477, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_interpolate); __pyx_t_6 = __pyx_v_interpolate; __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_7, __pyx_t_1, __pyx_t_4, __pyx_t_5}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 3+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 2477, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2478 * if interpolate is None: return UNSUPPORTED(b"interpolate") * interpolate(TS_(ts), toReal(t), Vec_(x)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode TSEvaluateStep_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":2468 * return FunctionEnd() * * cdef PetscErrorCode TSInterpolate_Python( # <<<<<<<<<<<<<< * PetscTS ts, * PetscReal t, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.TSInterpolate_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_interpolate); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":2480 * return FunctionEnd() * * cdef PetscErrorCode TSEvaluateStep_Python( # <<<<<<<<<<<<<< * PetscTS ts, * PetscInt o, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TSEvaluateStep_Python(TS __pyx_v_ts, PetscInt __pyx_v_o, Vec __pyx_v_x, PetscBool *__pyx_v_flag) { PyObject *__pyx_v_evaluatestep = 0; PyObject *__pyx_v_done = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; PetscBool __pyx_t_9; int __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TSEvaluateStep_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":2487 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"TSEvaluateStep _Python") # <<<<<<<<<<<<<< * cdef evaluatestep = PyTS(ts).evaluatestep * if evaluatestep is None: return UNSUPPORTED(b"evaluatestep") */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"TSEvaluateStep _Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":2488 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"TSEvaluateStep _Python") * cdef evaluatestep = PyTS(ts).evaluatestep # <<<<<<<<<<<<<< * if evaluatestep is None: return UNSUPPORTED(b"evaluatestep") * cdef done = evaluatestep(TS_(ts), toInt(o), Vec_(x)) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyTS(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 2488, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_evaluatestep); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 2488, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_evaluatestep = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2489 * FunctionBegin(b"TSEvaluateStep _Python") * cdef evaluatestep = PyTS(ts).evaluatestep * if evaluatestep is None: return UNSUPPORTED(b"evaluatestep") # <<<<<<<<<<<<<< * cdef done = evaluatestep(TS_(ts), toInt(o), Vec_(x)) * if flag != NULL: */ __pyx_t_3 = (__pyx_v_evaluatestep == Py_None); if (__pyx_t_3) { __pyx_r = __pyx_f_8petsc4py_5PETSc_UNSUPPORTED(((char *)"evaluatestep")); goto __pyx_L0; } /* "petsc4py/PETSc/libpetsc4py.pyx":2490 * cdef evaluatestep = PyTS(ts).evaluatestep * if evaluatestep is None: return UNSUPPORTED(b"evaluatestep") * cdef done = evaluatestep(TS_(ts), toInt(o), Vec_(x)) # <<<<<<<<<<<<<< * if flag != NULL: * flag[0] = PETSC_TRUE if done else PETSC_FALSE */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_TS_(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 2490, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_o); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 2490, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_x)); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 2490, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_evaluatestep); __pyx_t_6 = __pyx_v_evaluatestep; __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_7, __pyx_t_1, __pyx_t_4, __pyx_t_5}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 3+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 2490, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_v_done = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2491 * if evaluatestep is None: return UNSUPPORTED(b"evaluatestep") * cdef done = evaluatestep(TS_(ts), toInt(o), Vec_(x)) * if flag != NULL: # <<<<<<<<<<<<<< * flag[0] = PETSC_TRUE if done else PETSC_FALSE * elif not done: */ __pyx_t_3 = (__pyx_v_flag != NULL); if (__pyx_t_3) { /* "petsc4py/PETSc/libpetsc4py.pyx":2492 * cdef done = evaluatestep(TS_(ts), toInt(o), Vec_(x)) * if flag != NULL: * flag[0] = PETSC_TRUE if done else PETSC_FALSE # <<<<<<<<<<<<<< * elif not done: * return PetscSETERR(PETSC_ERR_USER, "Cannot evaluate step") */ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_done); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(11, 2492, __pyx_L1_error) if (__pyx_t_3) { __pyx_t_9 = PETSC_TRUE; } else { __pyx_t_9 = PETSC_FALSE; } (__pyx_v_flag[0]) = __pyx_t_9; /* "petsc4py/PETSc/libpetsc4py.pyx":2491 * if evaluatestep is None: return UNSUPPORTED(b"evaluatestep") * cdef done = evaluatestep(TS_(ts), toInt(o), Vec_(x)) * if flag != NULL: # <<<<<<<<<<<<<< * flag[0] = PETSC_TRUE if done else PETSC_FALSE * elif not done: */ goto __pyx_L4; } /* "petsc4py/PETSc/libpetsc4py.pyx":2493 * if flag != NULL: * flag[0] = PETSC_TRUE if done else PETSC_FALSE * elif not done: # <<<<<<<<<<<<<< * return PetscSETERR(PETSC_ERR_USER, "Cannot evaluate step") * return FunctionEnd() */ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_done); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(11, 2493, __pyx_L1_error) __pyx_t_10 = (!__pyx_t_3); if (__pyx_t_10) { /* "petsc4py/PETSc/libpetsc4py.pyx":2494 * flag[0] = PETSC_TRUE if done else PETSC_FALSE * elif not done: * return PetscSETERR(PETSC_ERR_USER, "Cannot evaluate step") # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_r = __pyx_f_8petsc4py_5PETSc_PetscSETERR(PETSC_ERR_USER, ((char *)"Cannot evaluate step")); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":2493 * if flag != NULL: * flag[0] = PETSC_TRUE if done else PETSC_FALSE * elif not done: # <<<<<<<<<<<<<< * return PetscSETERR(PETSC_ERR_USER, "Cannot evaluate step") * return FunctionEnd() */ } __pyx_L4:; /* "petsc4py/PETSc/libpetsc4py.pyx":2495 * elif not done: * return PetscSETERR(PETSC_ERR_USER, "Cannot evaluate step") * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode SNESTSFormFunction_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":2480 * return FunctionEnd() * * cdef PetscErrorCode TSEvaluateStep_Python( # <<<<<<<<<<<<<< * PetscTS ts, * PetscInt o, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.TSEvaluateStep_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_evaluatestep); __Pyx_XDECREF(__pyx_v_done); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":2497 * return FunctionEnd() * * cdef PetscErrorCode SNESTSFormFunction_Python( # <<<<<<<<<<<<<< * PetscSNES snes, * PetscVec x, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNESTSFormFunction_Python(SNES __pyx_v_snes, Vec __pyx_v_x, Vec __pyx_v_f, TS __pyx_v_ts) { PyObject *__pyx_v_formSNESFunction = 0; PyObject *__pyx_v_args = NULL; Vec __pyx_v_dx; PetscReal __pyx_v_t; PetscReal __pyx_v_a; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; PetscErrorCode __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("SNESTSFormFunction_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":2505 * except PETSC_ERR_PYTHON with gil: * # * cdef formSNESFunction = PyTS(ts).formSNESFunction # <<<<<<<<<<<<<< * if formSNESFunction is not None: * args = (SNES_(snes), Vec_(x), Vec_(f), TS_(ts)) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyTS(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 2505, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_formSNESFunction); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 2505, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_formSNESFunction = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2506 * # * cdef formSNESFunction = PyTS(ts).formSNESFunction * if formSNESFunction is not None: # <<<<<<<<<<<<<< * args = (SNES_(snes), Vec_(x), Vec_(f), TS_(ts)) * formSNESFunction(args) */ __pyx_t_3 = (__pyx_v_formSNESFunction != Py_None); if (__pyx_t_3) { /* "petsc4py/PETSc/libpetsc4py.pyx":2507 * cdef formSNESFunction = PyTS(ts).formSNESFunction * if formSNESFunction is not None: * args = (SNES_(snes), Vec_(x), Vec_(f), TS_(ts)) # <<<<<<<<<<<<<< * formSNESFunction(args) * return FunctionEnd() */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_SNES_(__pyx_v_snes)); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 2507, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 2507, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_f)); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 2507, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_TS_(__pyx_v_ts)); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 2507, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(11, 2507, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2)) __PYX_ERR(11, 2507, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1)) __PYX_ERR(11, 2507, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_4)) __PYX_ERR(11, 2507, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_5)) __PYX_ERR(11, 2507, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_v_args = ((PyObject*)__pyx_t_6); __pyx_t_6 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2508 * if formSNESFunction is not None: * args = (SNES_(snes), Vec_(x), Vec_(f), TS_(ts)) * formSNESFunction(args) # <<<<<<<<<<<<<< * return FunctionEnd() * # */ __Pyx_INCREF(__pyx_v_formSNESFunction); __pyx_t_5 = __pyx_v_formSNESFunction; __pyx_t_4 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_args}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(11, 2508, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2509 * args = (SNES_(snes), Vec_(x), Vec_(f), TS_(ts)) * formSNESFunction(args) * return FunctionEnd() # <<<<<<<<<<<<<< * # * cdef PetscVec dx = NULL */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":2506 * # * cdef formSNESFunction = PyTS(ts).formSNESFunction * if formSNESFunction is not None: # <<<<<<<<<<<<<< * args = (SNES_(snes), Vec_(x), Vec_(f), TS_(ts)) * formSNESFunction(args) */ } /* "petsc4py/PETSc/libpetsc4py.pyx":2511 * return FunctionEnd() * # * cdef PetscVec dx = NULL # <<<<<<<<<<<<<< * CHKERR( PetscObjectQuery( * ts, */ __pyx_v_dx = NULL; /* "petsc4py/PETSc/libpetsc4py.pyx":2512 * # * cdef PetscVec dx = NULL * CHKERR( PetscObjectQuery( # <<<<<<<<<<<<<< * ts, * b"@ts.vec_dot", */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectQuery(((PetscObject)__pyx_v_ts), ((char *)"@ts.vec_dot"), ((PetscObject *)(&__pyx_v_dx)))); if (unlikely(__pyx_t_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2512, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2517 * &dx) ) * # * cdef PetscReal t = ts.ptime + ts.time_step # <<<<<<<<<<<<<< * cdef PetscReal a = 1.0/ts.time_step * CHKERR( VecCopy(ts.vec_sol, dx) ) */ __pyx_v_t = (__pyx_v_ts->ptime + __pyx_v_ts->time_step); /* "petsc4py/PETSc/libpetsc4py.pyx":2518 * # * cdef PetscReal t = ts.ptime + ts.time_step * cdef PetscReal a = 1.0/ts.time_step # <<<<<<<<<<<<<< * CHKERR( VecCopy(ts.vec_sol, dx) ) * CHKERR( VecAXPBY(dx, +a, -a, x) ) */ __pyx_v_a = (((PetscReal)1.0) / __pyx_v_ts->time_step); /* "petsc4py/PETSc/libpetsc4py.pyx":2519 * cdef PetscReal t = ts.ptime + ts.time_step * cdef PetscReal a = 1.0/ts.time_step * CHKERR( VecCopy(ts.vec_sol, dx) ) # <<<<<<<<<<<<<< * CHKERR( VecAXPBY(dx, +a, -a, x) ) * CHKERR( TSComputeIFunction(ts, t, x, dx, f, PETSC_FALSE) ) */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCopy(__pyx_v_ts->vec_sol, __pyx_v_dx)); if (unlikely(__pyx_t_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2519, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2520 * cdef PetscReal a = 1.0/ts.time_step * CHKERR( VecCopy(ts.vec_sol, dx) ) * CHKERR( VecAXPBY(dx, +a, -a, x) ) # <<<<<<<<<<<<<< * CHKERR( TSComputeIFunction(ts, t, x, dx, f, PETSC_FALSE) ) * return FunctionEnd() */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecAXPBY(__pyx_v_dx, __pyx_v_a, (-__pyx_v_a), __pyx_v_x)); if (unlikely(__pyx_t_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2520, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2521 * CHKERR( VecCopy(ts.vec_sol, dx) ) * CHKERR( VecAXPBY(dx, +a, -a, x) ) * CHKERR( TSComputeIFunction(ts, t, x, dx, f, PETSC_FALSE) ) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSComputeIFunction(__pyx_v_ts, __pyx_v_t, __pyx_v_x, __pyx_v_dx, __pyx_v_f, PETSC_FALSE)); if (unlikely(__pyx_t_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2521, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2522 * CHKERR( VecAXPBY(dx, +a, -a, x) ) * CHKERR( TSComputeIFunction(ts, t, x, dx, f, PETSC_FALSE) ) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode SNESTSFormJacobian_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":2497 * return FunctionEnd() * * cdef PetscErrorCode SNESTSFormFunction_Python( # <<<<<<<<<<<<<< * PetscSNES snes, * PetscVec x, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.SNESTSFormFunction_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_formSNESFunction); __Pyx_XDECREF(__pyx_v_args); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":2524 * return FunctionEnd() * * cdef PetscErrorCode SNESTSFormJacobian_Python( # <<<<<<<<<<<<<< * PetscSNES snes, * PetscVec x, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNESTSFormJacobian_Python(SNES __pyx_v_snes, Vec __pyx_v_x, Mat __pyx_v_A, Mat __pyx_v_B, TS __pyx_v_ts) { PyObject *__pyx_v_formSNESJacobian = 0; PyObject *__pyx_v_args = NULL; Vec __pyx_v_dx; PetscReal __pyx_v_t; PetscReal __pyx_v_a; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PetscErrorCode __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("SNESTSFormJacobian_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":2533 * except PETSC_ERR_PYTHON with gil: * # * cdef formSNESJacobian = PyTS(ts).formSNESJacobian # <<<<<<<<<<<<<< * if formSNESJacobian is not None: * args = (SNES_(snes), Vec_(x), Mat_(A), Mat_(B), TS_(ts)) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyTS(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 2533, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_formSNESJacobian); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 2533, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_formSNESJacobian = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2534 * # * cdef formSNESJacobian = PyTS(ts).formSNESJacobian * if formSNESJacobian is not None: # <<<<<<<<<<<<<< * args = (SNES_(snes), Vec_(x), Mat_(A), Mat_(B), TS_(ts)) * formSNESJacobian(*args) */ __pyx_t_3 = (__pyx_v_formSNESJacobian != Py_None); if (__pyx_t_3) { /* "petsc4py/PETSc/libpetsc4py.pyx":2535 * cdef formSNESJacobian = PyTS(ts).formSNESJacobian * if formSNESJacobian is not None: * args = (SNES_(snes), Vec_(x), Mat_(A), Mat_(B), TS_(ts)) # <<<<<<<<<<<<<< * formSNESJacobian(*args) * return FunctionEnd() */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_SNES_(__pyx_v_snes)); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 2535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 2535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_A)); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 2535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_B)); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 2535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_TS_(__pyx_v_ts)); if (unlikely(!__pyx_t_6)) __PYX_ERR(11, 2535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PyTuple_New(5); if (unlikely(!__pyx_t_7)) __PYX_ERR(11, 2535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2)) __PYX_ERR(11, 2535, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_1)) __PYX_ERR(11, 2535, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_4)) __PYX_ERR(11, 2535, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_5)) __PYX_ERR(11, 2535, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 4, __pyx_t_6)) __PYX_ERR(11, 2535, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_v_args = ((PyObject*)__pyx_t_7); __pyx_t_7 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2536 * if formSNESJacobian is not None: * args = (SNES_(snes), Vec_(x), Mat_(A), Mat_(B), TS_(ts)) * formSNESJacobian(*args) # <<<<<<<<<<<<<< * return FunctionEnd() * # */ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_v_formSNESJacobian, __pyx_v_args, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(11, 2536, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2537 * args = (SNES_(snes), Vec_(x), Mat_(A), Mat_(B), TS_(ts)) * formSNESJacobian(*args) * return FunctionEnd() # <<<<<<<<<<<<<< * # * cdef PetscVec dx = NULL */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":2534 * # * cdef formSNESJacobian = PyTS(ts).formSNESJacobian * if formSNESJacobian is not None: # <<<<<<<<<<<<<< * args = (SNES_(snes), Vec_(x), Mat_(A), Mat_(B), TS_(ts)) * formSNESJacobian(*args) */ } /* "petsc4py/PETSc/libpetsc4py.pyx":2539 * return FunctionEnd() * # * cdef PetscVec dx = NULL # <<<<<<<<<<<<<< * CHKERR( PetscObjectQuery( * ts, */ __pyx_v_dx = NULL; /* "petsc4py/PETSc/libpetsc4py.pyx":2540 * # * cdef PetscVec dx = NULL * CHKERR( PetscObjectQuery( # <<<<<<<<<<<<<< * ts, * b"@ts.vec_dot", */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectQuery(((PetscObject)__pyx_v_ts), ((char *)"@ts.vec_dot"), ((PetscObject *)(&__pyx_v_dx)))); if (unlikely(__pyx_t_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2540, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2545 * &dx) ) * # * cdef PetscReal t = ts.ptime + ts.time_step # <<<<<<<<<<<<<< * cdef PetscReal a = 1.0/ts.time_step * CHKERR( VecCopy(ts.vec_sol, dx) ) */ __pyx_v_t = (__pyx_v_ts->ptime + __pyx_v_ts->time_step); /* "petsc4py/PETSc/libpetsc4py.pyx":2546 * # * cdef PetscReal t = ts.ptime + ts.time_step * cdef PetscReal a = 1.0/ts.time_step # <<<<<<<<<<<<<< * CHKERR( VecCopy(ts.vec_sol, dx) ) * CHKERR( VecAXPBY(dx, +a, -a, x) ) */ __pyx_v_a = (((PetscReal)1.0) / __pyx_v_ts->time_step); /* "petsc4py/PETSc/libpetsc4py.pyx":2547 * cdef PetscReal t = ts.ptime + ts.time_step * cdef PetscReal a = 1.0/ts.time_step * CHKERR( VecCopy(ts.vec_sol, dx) ) # <<<<<<<<<<<<<< * CHKERR( VecAXPBY(dx, +a, -a, x) ) * CHKERR( TSComputeIJacobian(ts, t, x, dx, a, A, B, PETSC_FALSE) ) */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCopy(__pyx_v_ts->vec_sol, __pyx_v_dx)); if (unlikely(__pyx_t_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2547, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2548 * cdef PetscReal a = 1.0/ts.time_step * CHKERR( VecCopy(ts.vec_sol, dx) ) * CHKERR( VecAXPBY(dx, +a, -a, x) ) # <<<<<<<<<<<<<< * CHKERR( TSComputeIJacobian(ts, t, x, dx, a, A, B, PETSC_FALSE) ) * return FunctionEnd() */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecAXPBY(__pyx_v_dx, __pyx_v_a, (-__pyx_v_a), __pyx_v_x)); if (unlikely(__pyx_t_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2548, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2549 * CHKERR( VecCopy(ts.vec_sol, dx) ) * CHKERR( VecAXPBY(dx, +a, -a, x) ) * CHKERR( TSComputeIJacobian(ts, t, x, dx, a, A, B, PETSC_FALSE) ) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSComputeIJacobian(__pyx_v_ts, __pyx_v_t, __pyx_v_x, __pyx_v_dx, __pyx_v_a, __pyx_v_A, __pyx_v_B, PETSC_FALSE)); if (unlikely(__pyx_t_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2549, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2550 * CHKERR( VecAXPBY(dx, +a, -a, x) ) * CHKERR( TSComputeIJacobian(ts, t, x, dx, a, A, B, PETSC_FALSE) ) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode TSSolveStep_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":2524 * return FunctionEnd() * * cdef PetscErrorCode SNESTSFormJacobian_Python( # <<<<<<<<<<<<<< * PetscSNES snes, * PetscVec x, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.SNESTSFormJacobian_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_formSNESJacobian); __Pyx_XDECREF(__pyx_v_args); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":2552 * return FunctionEnd() * * cdef PetscErrorCode TSSolveStep_Python( # <<<<<<<<<<<<<< * PetscTS ts, * PetscReal t, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TSSolveStep_Python(TS __pyx_v_ts, PetscReal __pyx_v_t, Vec __pyx_v_x) { PyObject *__pyx_v_solveStep = 0; PetscInt __pyx_v_nits; PetscInt __pyx_v_lits; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; PetscErrorCode __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TSSolveStep_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":2558 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"TSSolveStep_Python") # <<<<<<<<<<<<<< * # * cdef solveStep = PyTS(ts).solveStep */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"TSSolveStep_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":2560 * FunctionBegin(b"TSSolveStep_Python") * # * cdef solveStep = PyTS(ts).solveStep # <<<<<<<<<<<<<< * if solveStep is not None: * solveStep(TS_(ts), t, Vec_(x)) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyTS(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 2560, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_solveStep); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 2560, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_solveStep = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2561 * # * cdef solveStep = PyTS(ts).solveStep * if solveStep is not None: # <<<<<<<<<<<<<< * solveStep(TS_(ts), t, Vec_(x)) * return FunctionEnd() */ __pyx_t_3 = (__pyx_v_solveStep != Py_None); if (__pyx_t_3) { /* "petsc4py/PETSc/libpetsc4py.pyx":2562 * cdef solveStep = PyTS(ts).solveStep * if solveStep is not None: * solveStep(TS_(ts), t, Vec_(x)) # <<<<<<<<<<<<<< * return FunctionEnd() * # */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_TS_(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 2562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyFloat_FromDouble(((double)__pyx_v_t)); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 2562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_x)); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 2562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_solveStep); __pyx_t_6 = __pyx_v_solveStep; __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_7, __pyx_t_1, __pyx_t_4, __pyx_t_5}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 3+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 2562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2563 * if solveStep is not None: * solveStep(TS_(ts), t, Vec_(x)) * return FunctionEnd() # <<<<<<<<<<<<<< * # * cdef PetscInt nits = 0, lits = 0 */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":2561 * # * cdef solveStep = PyTS(ts).solveStep * if solveStep is not None: # <<<<<<<<<<<<<< * solveStep(TS_(ts), t, Vec_(x)) * return FunctionEnd() */ } /* "petsc4py/PETSc/libpetsc4py.pyx":2565 * return FunctionEnd() * # * cdef PetscInt nits = 0, lits = 0 # <<<<<<<<<<<<<< * CHKERR( SNESSolve(ts.snes, NULL, x) ) * CHKERR( SNESGetIterationNumber(ts.snes, &nits) ) */ __pyx_v_nits = 0; __pyx_v_lits = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2566 * # * cdef PetscInt nits = 0, lits = 0 * CHKERR( SNESSolve(ts.snes, NULL, x) ) # <<<<<<<<<<<<<< * CHKERR( SNESGetIterationNumber(ts.snes, &nits) ) * CHKERR( SNESGetLinearSolveIterations(ts.snes, &lits) ) */ __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSolve(__pyx_v_ts->snes, NULL, __pyx_v_x)); if (unlikely(__pyx_t_9 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2566, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2567 * cdef PetscInt nits = 0, lits = 0 * CHKERR( SNESSolve(ts.snes, NULL, x) ) * CHKERR( SNESGetIterationNumber(ts.snes, &nits) ) # <<<<<<<<<<<<<< * CHKERR( SNESGetLinearSolveIterations(ts.snes, &lits) ) * ts.snes_its += nits */ __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetIterationNumber(__pyx_v_ts->snes, (&__pyx_v_nits))); if (unlikely(__pyx_t_9 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2567, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2568 * CHKERR( SNESSolve(ts.snes, NULL, x) ) * CHKERR( SNESGetIterationNumber(ts.snes, &nits) ) * CHKERR( SNESGetLinearSolveIterations(ts.snes, &lits) ) # <<<<<<<<<<<<<< * ts.snes_its += nits * ts.ksp_its += lits */ __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetLinearSolveIterations(__pyx_v_ts->snes, (&__pyx_v_lits))); if (unlikely(__pyx_t_9 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2568, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2569 * CHKERR( SNESGetIterationNumber(ts.snes, &nits) ) * CHKERR( SNESGetLinearSolveIterations(ts.snes, &lits) ) * ts.snes_its += nits # <<<<<<<<<<<<<< * ts.ksp_its += lits * return FunctionEnd() */ __pyx_v_ts->snes_its = (__pyx_v_ts->snes_its + __pyx_v_nits); /* "petsc4py/PETSc/libpetsc4py.pyx":2570 * CHKERR( SNESGetLinearSolveIterations(ts.snes, &lits) ) * ts.snes_its += nits * ts.ksp_its += lits # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_v_ts->ksp_its = (__pyx_v_ts->ksp_its + __pyx_v_lits); /* "petsc4py/PETSc/libpetsc4py.pyx":2571 * ts.snes_its += nits * ts.ksp_its += lits * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode TSAdaptStep_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":2552 * return FunctionEnd() * * cdef PetscErrorCode TSSolveStep_Python( # <<<<<<<<<<<<<< * PetscTS ts, * PetscReal t, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.TSSolveStep_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_solveStep); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":2573 * return FunctionEnd() * * cdef PetscErrorCode TSAdaptStep_Python( # <<<<<<<<<<<<<< * PetscTS ts, * PetscReal t, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TSAdaptStep_Python(TS __pyx_v_ts, PetscReal __pyx_v_t, Vec __pyx_v_x, PetscReal *__pyx_v_nextdt, PetscBool *__pyx_v_stepok) { PyObject *__pyx_v_adaptStep = 0; PyObject *__pyx_v_retval = 0; double __pyx_v_dt; int __pyx_v_ok; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; double __pyx_t_10; PetscBool __pyx_t_11; PyObject *(*__pyx_t_12)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TSAdaptStep_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":2581 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"TSAdaptStep_Python") # <<<<<<<<<<<<<< * nextdt[0] = ts.time_step * stepok[0] = PETSC_TRUE */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"TSAdaptStep_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":2582 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"TSAdaptStep_Python") * nextdt[0] = ts.time_step # <<<<<<<<<<<<<< * stepok[0] = PETSC_TRUE * # */ __pyx_t_1 = __pyx_v_ts->time_step; (__pyx_v_nextdt[0]) = __pyx_t_1; /* "petsc4py/PETSc/libpetsc4py.pyx":2583 * FunctionBegin(b"TSAdaptStep_Python") * nextdt[0] = ts.time_step * stepok[0] = PETSC_TRUE # <<<<<<<<<<<<<< * # * cdef adaptStep = PyTS(ts).adaptStep */ (__pyx_v_stepok[0]) = PETSC_TRUE; /* "petsc4py/PETSc/libpetsc4py.pyx":2585 * stepok[0] = PETSC_TRUE * # * cdef adaptStep = PyTS(ts).adaptStep # <<<<<<<<<<<<<< * if adaptStep is None: return FunctionEnd() * cdef object retval */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyTS(__pyx_v_ts)); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 2585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_adaptStep); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 2585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_adaptStep = __pyx_t_3; __pyx_t_3 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2586 * # * cdef adaptStep = PyTS(ts).adaptStep * if adaptStep is None: return FunctionEnd() # <<<<<<<<<<<<<< * cdef object retval * cdef double dt */ __pyx_t_4 = (__pyx_v_adaptStep == Py_None); if (__pyx_t_4) { __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; } /* "petsc4py/PETSc/libpetsc4py.pyx":2590 * cdef double dt * cdef bint ok * retval = adaptStep(TS_(ts), t, Vec_(x)) # <<<<<<<<<<<<<< * if retval is None: pass * elif isinstance(retval, float): */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_TS_(__pyx_v_ts)); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 2590, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = PyFloat_FromDouble(((double)__pyx_v_t)); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 2590, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_x)); if (unlikely(!__pyx_t_6)) __PYX_ERR(11, 2590, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_adaptStep); __pyx_t_7 = __pyx_v_adaptStep; __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_8, __pyx_t_2, __pyx_t_5, __pyx_t_6}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 3+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 2590, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_v_retval = __pyx_t_3; __pyx_t_3 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2591 * cdef bint ok * retval = adaptStep(TS_(ts), t, Vec_(x)) * if retval is None: pass # <<<<<<<<<<<<<< * elif isinstance(retval, float): * dt = retval */ __pyx_t_4 = (__pyx_v_retval == Py_None); if (__pyx_t_4) { goto __pyx_L4; } /* "petsc4py/PETSc/libpetsc4py.pyx":2592 * retval = adaptStep(TS_(ts), t, Vec_(x)) * if retval is None: pass * elif isinstance(retval, float): # <<<<<<<<<<<<<< * dt = retval * nextdt[0] = dt */ __pyx_t_4 = PyFloat_Check(__pyx_v_retval); if (__pyx_t_4) { /* "petsc4py/PETSc/libpetsc4py.pyx":2593 * if retval is None: pass * elif isinstance(retval, float): * dt = retval # <<<<<<<<<<<<<< * nextdt[0] = dt * stepok[0] = PETSC_TRUE */ __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_retval); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(11, 2593, __pyx_L1_error) __pyx_v_dt = __pyx_t_10; /* "petsc4py/PETSc/libpetsc4py.pyx":2594 * elif isinstance(retval, float): * dt = retval * nextdt[0] = dt # <<<<<<<<<<<<<< * stepok[0] = PETSC_TRUE * elif isinstance(retval, bool): */ (__pyx_v_nextdt[0]) = ((PetscReal)__pyx_v_dt); /* "petsc4py/PETSc/libpetsc4py.pyx":2595 * dt = retval * nextdt[0] = dt * stepok[0] = PETSC_TRUE # <<<<<<<<<<<<<< * elif isinstance(retval, bool): * ok = retval */ (__pyx_v_stepok[0]) = PETSC_TRUE; /* "petsc4py/PETSc/libpetsc4py.pyx":2592 * retval = adaptStep(TS_(ts), t, Vec_(x)) * if retval is None: pass * elif isinstance(retval, float): # <<<<<<<<<<<<<< * dt = retval * nextdt[0] = dt */ goto __pyx_L4; } /* "petsc4py/PETSc/libpetsc4py.pyx":2596 * nextdt[0] = dt * stepok[0] = PETSC_TRUE * elif isinstance(retval, bool): # <<<<<<<<<<<<<< * ok = retval * nextdt[0] = ts.time_step */ __pyx_t_3 = ((PyObject*)&PyBool_Type); __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = PyObject_IsInstance(__pyx_v_retval, __pyx_t_3); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(11, 2596, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { /* "petsc4py/PETSc/libpetsc4py.pyx":2597 * stepok[0] = PETSC_TRUE * elif isinstance(retval, bool): * ok = retval # <<<<<<<<<<<<<< * nextdt[0] = ts.time_step * stepok[0] = PETSC_TRUE if ok else PETSC_FALSE */ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_retval); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(11, 2597, __pyx_L1_error) __pyx_v_ok = __pyx_t_4; /* "petsc4py/PETSc/libpetsc4py.pyx":2598 * elif isinstance(retval, bool): * ok = retval * nextdt[0] = ts.time_step # <<<<<<<<<<<<<< * stepok[0] = PETSC_TRUE if ok else PETSC_FALSE * else: */ __pyx_t_1 = __pyx_v_ts->time_step; (__pyx_v_nextdt[0]) = __pyx_t_1; /* "petsc4py/PETSc/libpetsc4py.pyx":2599 * ok = retval * nextdt[0] = ts.time_step * stepok[0] = PETSC_TRUE if ok else PETSC_FALSE # <<<<<<<<<<<<<< * else: * dt, ok = retval */ if (__pyx_v_ok) { __pyx_t_11 = PETSC_TRUE; } else { __pyx_t_11 = PETSC_FALSE; } (__pyx_v_stepok[0]) = __pyx_t_11; /* "petsc4py/PETSc/libpetsc4py.pyx":2596 * nextdt[0] = dt * stepok[0] = PETSC_TRUE * elif isinstance(retval, bool): # <<<<<<<<<<<<<< * ok = retval * nextdt[0] = ts.time_step */ goto __pyx_L4; } /* "petsc4py/PETSc/libpetsc4py.pyx":2601 * stepok[0] = PETSC_TRUE if ok else PETSC_FALSE * else: * dt, ok = retval # <<<<<<<<<<<<<< * nextdt[0] = dt * stepok[0] = PETSC_TRUE if ok else PETSC_FALSE */ /*else*/ { if ((likely(PyTuple_CheckExact(__pyx_v_retval))) || (PyList_CheckExact(__pyx_v_retval))) { PyObject* sequence = __pyx_v_retval; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(11, 2601, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_3 = PyList_GET_ITEM(sequence, 0); __pyx_t_7 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_7); #else __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 2601, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(11, 2601, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_retval); if (unlikely(!__pyx_t_6)) __PYX_ERR(11, 2601, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); index = 0; __pyx_t_3 = __pyx_t_12(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 1; __pyx_t_7 = __pyx_t_12(__pyx_t_6); if (unlikely(!__pyx_t_7)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_7); if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_6), 2) < 0) __PYX_ERR(11, 2601, __pyx_L1_error) __pyx_t_12 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_12 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(11, 2601, __pyx_L1_error) __pyx_L6_unpacking_done:; } __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(11, 2601, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(11, 2601, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_v_dt = __pyx_t_10; __pyx_v_ok = __pyx_t_4; /* "petsc4py/PETSc/libpetsc4py.pyx":2602 * else: * dt, ok = retval * nextdt[0] = dt # <<<<<<<<<<<<<< * stepok[0] = PETSC_TRUE if ok else PETSC_FALSE * return FunctionEnd() */ (__pyx_v_nextdt[0]) = ((PetscReal)__pyx_v_dt); /* "petsc4py/PETSc/libpetsc4py.pyx":2603 * dt, ok = retval * nextdt[0] = dt * stepok[0] = PETSC_TRUE if ok else PETSC_FALSE # <<<<<<<<<<<<<< * return FunctionEnd() * */ if (__pyx_v_ok) { __pyx_t_11 = PETSC_TRUE; } else { __pyx_t_11 = PETSC_FALSE; } (__pyx_v_stepok[0]) = __pyx_t_11; } __pyx_L4:; /* "petsc4py/PETSc/libpetsc4py.pyx":2604 * nextdt[0] = dt * stepok[0] = PETSC_TRUE if ok else PETSC_FALSE * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode TSStep_Python_default( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":2573 * return FunctionEnd() * * cdef PetscErrorCode TSAdaptStep_Python( # <<<<<<<<<<<<<< * PetscTS ts, * PetscReal t, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("petsc4py.PETSc.TSAdaptStep_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_adaptStep); __Pyx_XDECREF(__pyx_v_retval); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":2606 * return FunctionEnd() * * cdef PetscErrorCode TSStep_Python_default( # <<<<<<<<<<<<<< * PetscTS ts, * ) \ */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TSStep_Python_default(TS __pyx_v_ts) { Vec __pyx_v_vec_update; CYTHON_UNUSED PetscInt __pyx_v_r; PetscReal __pyx_v_tt; PetscReal __pyx_v_dt; PetscBool __pyx_v_accept; PetscBool __pyx_v_stageok; PetscErrorCode __pyx_r; PetscErrorCode __pyx_t_1; PetscReal __pyx_t_2; PetscInt __pyx_t_3; int __pyx_t_4; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif /* "petsc4py/PETSc/libpetsc4py.pyx":2610 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"TSStep_Python_default") # <<<<<<<<<<<<<< * cdef PetscVec vec_update = NULL * CHKERR( PetscObjectQuery( */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"TSStep_Python_default")); /* "petsc4py/PETSc/libpetsc4py.pyx":2611 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"TSStep_Python_default") * cdef PetscVec vec_update = NULL # <<<<<<<<<<<<<< * CHKERR( PetscObjectQuery( * ts, */ __pyx_v_vec_update = NULL; /* "petsc4py/PETSc/libpetsc4py.pyx":2612 * FunctionBegin(b"TSStep_Python_default") * cdef PetscVec vec_update = NULL * CHKERR( PetscObjectQuery( # <<<<<<<<<<<<<< * ts, * b"@ts.vec_update", */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectQuery(((PetscObject)__pyx_v_ts), ((char *)"@ts.vec_update"), ((PetscObject *)(&__pyx_v_vec_update)))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2612, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2617 * &vec_update) ) * # * cdef PetscInt r = 0 # <<<<<<<<<<<<<< * cdef PetscReal tt = ts.ptime * cdef PetscReal dt = ts.time_step */ __pyx_v_r = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2618 * # * cdef PetscInt r = 0 * cdef PetscReal tt = ts.ptime # <<<<<<<<<<<<<< * cdef PetscReal dt = ts.time_step * cdef PetscBool accept = PETSC_TRUE */ __pyx_t_2 = __pyx_v_ts->ptime; __pyx_v_tt = __pyx_t_2; /* "petsc4py/PETSc/libpetsc4py.pyx":2619 * cdef PetscInt r = 0 * cdef PetscReal tt = ts.ptime * cdef PetscReal dt = ts.time_step # <<<<<<<<<<<<<< * cdef PetscBool accept = PETSC_TRUE * cdef PetscBool stageok = PETSC_TRUE */ __pyx_t_2 = __pyx_v_ts->time_step; __pyx_v_dt = __pyx_t_2; /* "petsc4py/PETSc/libpetsc4py.pyx":2620 * cdef PetscReal tt = ts.ptime * cdef PetscReal dt = ts.time_step * cdef PetscBool accept = PETSC_TRUE # <<<<<<<<<<<<<< * cdef PetscBool stageok = PETSC_TRUE * for r from 0 <= r < ts.max_reject: */ __pyx_v_accept = PETSC_TRUE; /* "petsc4py/PETSc/libpetsc4py.pyx":2621 * cdef PetscReal dt = ts.time_step * cdef PetscBool accept = PETSC_TRUE * cdef PetscBool stageok = PETSC_TRUE # <<<<<<<<<<<<<< * for r from 0 <= r < ts.max_reject: * tt = ts.ptime + ts.time_step */ __pyx_v_stageok = PETSC_TRUE; /* "petsc4py/PETSc/libpetsc4py.pyx":2622 * cdef PetscBool accept = PETSC_TRUE * cdef PetscBool stageok = PETSC_TRUE * for r from 0 <= r < ts.max_reject: # <<<<<<<<<<<<<< * tt = ts.ptime + ts.time_step * CHKERR( VecCopy(ts.vec_sol, vec_update) ) */ __pyx_t_3 = __pyx_v_ts->max_reject; for (__pyx_v_r = 0; __pyx_v_r < __pyx_t_3; __pyx_v_r++) { /* "petsc4py/PETSc/libpetsc4py.pyx":2623 * cdef PetscBool stageok = PETSC_TRUE * for r from 0 <= r < ts.max_reject: * tt = ts.ptime + ts.time_step # <<<<<<<<<<<<<< * CHKERR( VecCopy(ts.vec_sol, vec_update) ) * CHKERR( TSPreStage(ts, tt+dt) ) */ __pyx_v_tt = (__pyx_v_ts->ptime + __pyx_v_ts->time_step); /* "petsc4py/PETSc/libpetsc4py.pyx":2624 * for r from 0 <= r < ts.max_reject: * tt = ts.ptime + ts.time_step * CHKERR( VecCopy(ts.vec_sol, vec_update) ) # <<<<<<<<<<<<<< * CHKERR( TSPreStage(ts, tt+dt) ) * TSSolveStep_Python(ts, tt, vec_update) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCopy(__pyx_v_ts->vec_sol, __pyx_v_vec_update)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2624, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2625 * tt = ts.ptime + ts.time_step * CHKERR( VecCopy(ts.vec_sol, vec_update) ) * CHKERR( TSPreStage(ts, tt+dt) ) # <<<<<<<<<<<<<< * TSSolveStep_Python(ts, tt, vec_update) * CHKERR( TSPostStage(ts, tt+dt, 0, &vec_update) ); */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSPreStage(__pyx_v_ts, (__pyx_v_tt + __pyx_v_dt))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2625, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2626 * CHKERR( VecCopy(ts.vec_sol, vec_update) ) * CHKERR( TSPreStage(ts, tt+dt) ) * TSSolveStep_Python(ts, tt, vec_update) # <<<<<<<<<<<<<< * CHKERR( TSPostStage(ts, tt+dt, 0, &vec_update) ); * CHKERR( TSAdaptCheckStage(ts.adapt, ts, tt+dt, vec_update, &stageok) ); */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_TSSolveStep_Python(__pyx_v_ts, __pyx_v_tt, __pyx_v_vec_update); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2626, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2627 * CHKERR( TSPreStage(ts, tt+dt) ) * TSSolveStep_Python(ts, tt, vec_update) * CHKERR( TSPostStage(ts, tt+dt, 0, &vec_update) ); # <<<<<<<<<<<<<< * CHKERR( TSAdaptCheckStage(ts.adapt, ts, tt+dt, vec_update, &stageok) ); * if not stageok: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSPostStage(__pyx_v_ts, (__pyx_v_tt + __pyx_v_dt), 0, (&__pyx_v_vec_update))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2627, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2628 * TSSolveStep_Python(ts, tt, vec_update) * CHKERR( TSPostStage(ts, tt+dt, 0, &vec_update) ); * CHKERR( TSAdaptCheckStage(ts.adapt, ts, tt+dt, vec_update, &stageok) ); # <<<<<<<<<<<<<< * if not stageok: * ts.reject += 1 */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSAdaptCheckStage(__pyx_v_ts->adapt, __pyx_v_ts, (__pyx_v_tt + __pyx_v_dt), __pyx_v_vec_update, (&__pyx_v_stageok))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2628, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2629 * CHKERR( TSPostStage(ts, tt+dt, 0, &vec_update) ); * CHKERR( TSAdaptCheckStage(ts.adapt, ts, tt+dt, vec_update, &stageok) ); * if not stageok: # <<<<<<<<<<<<<< * ts.reject += 1 * continue */ __pyx_t_4 = (!__pyx_v_stageok); if (__pyx_t_4) { /* "petsc4py/PETSc/libpetsc4py.pyx":2630 * CHKERR( TSAdaptCheckStage(ts.adapt, ts, tt+dt, vec_update, &stageok) ); * if not stageok: * ts.reject += 1 # <<<<<<<<<<<<<< * continue * TSAdaptStep_Python(ts, tt, vec_update, &dt, &accept) */ __pyx_v_ts->reject = (__pyx_v_ts->reject + 1); /* "petsc4py/PETSc/libpetsc4py.pyx":2631 * if not stageok: * ts.reject += 1 * continue # <<<<<<<<<<<<<< * TSAdaptStep_Python(ts, tt, vec_update, &dt, &accept) * if not accept: */ goto __pyx_L3_continue; /* "petsc4py/PETSc/libpetsc4py.pyx":2629 * CHKERR( TSPostStage(ts, tt+dt, 0, &vec_update) ); * CHKERR( TSAdaptCheckStage(ts.adapt, ts, tt+dt, vec_update, &stageok) ); * if not stageok: # <<<<<<<<<<<<<< * ts.reject += 1 * continue */ } /* "petsc4py/PETSc/libpetsc4py.pyx":2632 * ts.reject += 1 * continue * TSAdaptStep_Python(ts, tt, vec_update, &dt, &accept) # <<<<<<<<<<<<<< * if not accept: * ts.time_step = dt */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_TSAdaptStep_Python(__pyx_v_ts, __pyx_v_tt, __pyx_v_vec_update, (&__pyx_v_dt), (&__pyx_v_accept)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2632, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2633 * continue * TSAdaptStep_Python(ts, tt, vec_update, &dt, &accept) * if not accept: # <<<<<<<<<<<<<< * ts.time_step = dt * ts.reject += 1 */ __pyx_t_4 = (!__pyx_v_accept); if (__pyx_t_4) { /* "petsc4py/PETSc/libpetsc4py.pyx":2634 * TSAdaptStep_Python(ts, tt, vec_update, &dt, &accept) * if not accept: * ts.time_step = dt # <<<<<<<<<<<<<< * ts.reject += 1 * continue */ __pyx_v_ts->time_step = __pyx_v_dt; /* "petsc4py/PETSc/libpetsc4py.pyx":2635 * if not accept: * ts.time_step = dt * ts.reject += 1 # <<<<<<<<<<<<<< * continue * CHKERR( VecCopy(vec_update, ts.vec_sol) ) */ __pyx_v_ts->reject = (__pyx_v_ts->reject + 1); /* "petsc4py/PETSc/libpetsc4py.pyx":2636 * ts.time_step = dt * ts.reject += 1 * continue # <<<<<<<<<<<<<< * CHKERR( VecCopy(vec_update, ts.vec_sol) ) * ts.ptime += ts.time_step */ goto __pyx_L3_continue; /* "petsc4py/PETSc/libpetsc4py.pyx":2633 * continue * TSAdaptStep_Python(ts, tt, vec_update, &dt, &accept) * if not accept: # <<<<<<<<<<<<<< * ts.time_step = dt * ts.reject += 1 */ } /* "petsc4py/PETSc/libpetsc4py.pyx":2637 * ts.reject += 1 * continue * CHKERR( VecCopy(vec_update, ts.vec_sol) ) # <<<<<<<<<<<<<< * ts.ptime += ts.time_step * ts.time_step = dt */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCopy(__pyx_v_vec_update, __pyx_v_ts->vec_sol)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2637, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2638 * continue * CHKERR( VecCopy(vec_update, ts.vec_sol) ) * ts.ptime += ts.time_step # <<<<<<<<<<<<<< * ts.time_step = dt * break */ __pyx_v_ts->ptime = (__pyx_v_ts->ptime + __pyx_v_ts->time_step); /* "petsc4py/PETSc/libpetsc4py.pyx":2639 * CHKERR( VecCopy(vec_update, ts.vec_sol) ) * ts.ptime += ts.time_step * ts.time_step = dt # <<<<<<<<<<<<<< * break * if (not stageok or not accept) and ts.reason == 0: */ __pyx_v_ts->time_step = __pyx_v_dt; /* "petsc4py/PETSc/libpetsc4py.pyx":2640 * ts.ptime += ts.time_step * ts.time_step = dt * break # <<<<<<<<<<<<<< * if (not stageok or not accept) and ts.reason == 0: * ts.reason = TS_DIVERGED_STEP_REJECTED */ goto __pyx_L4_break; __pyx_L3_continue:; } __pyx_L4_break:; /* "petsc4py/PETSc/libpetsc4py.pyx":2641 * ts.time_step = dt * break * if (not stageok or not accept) and ts.reason == 0: # <<<<<<<<<<<<<< * ts.reason = TS_DIVERGED_STEP_REJECTED * return FunctionEnd() */ __pyx_t_5 = (!__pyx_v_stageok); if (!__pyx_t_5) { } else { goto __pyx_L9_next_and; } __pyx_t_5 = (!__pyx_v_accept); if (__pyx_t_5) { } else { __pyx_t_4 = __pyx_t_5; goto __pyx_L8_bool_binop_done; } __pyx_L9_next_and:; __pyx_t_5 = (__pyx_v_ts->reason == 0); __pyx_t_4 = __pyx_t_5; __pyx_L8_bool_binop_done:; if (__pyx_t_4) { /* "petsc4py/PETSc/libpetsc4py.pyx":2642 * break * if (not stageok or not accept) and ts.reason == 0: * ts.reason = TS_DIVERGED_STEP_REJECTED # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_v_ts->reason = TS_DIVERGED_STEP_REJECTED; /* "petsc4py/PETSc/libpetsc4py.pyx":2641 * ts.time_step = dt * break * if (not stageok or not accept) and ts.reason == 0: # <<<<<<<<<<<<<< * ts.reason = TS_DIVERGED_STEP_REJECTED * return FunctionEnd() */ } /* "petsc4py/PETSc/libpetsc4py.pyx":2643 * if (not stageok or not accept) and ts.reason == 0: * ts.reason = TS_DIVERGED_STEP_REJECTED * return FunctionEnd() # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":2606 * return FunctionEnd() * * cdef PetscErrorCode TSStep_Python_default( # <<<<<<<<<<<<<< * PetscTS ts, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TSStep_Python_default", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":2681 * @cython.internal * cdef class _PyTao(_PyObj): pass * cdef inline _PyTao PyTao(PetscTAO tao): # <<<<<<<<<<<<<< * if tao != NULL and tao.data != NULL: * return <_PyTao>tao.data */ static CYTHON_INLINE struct __pyx_obj_8petsc4py_5PETSc__PyTao *__pyx_f_8petsc4py_5PETSc_PyTao(Tao __pyx_v_tao) { struct __pyx_obj_8petsc4py_5PETSc__PyTao *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyTao", 1); /* "petsc4py/PETSc/libpetsc4py.pyx":2682 * cdef class _PyTao(_PyObj): pass * cdef inline _PyTao PyTao(PetscTAO tao): * if tao != NULL and tao.data != NULL: # <<<<<<<<<<<<<< * return <_PyTao>tao.data * else: */ __pyx_t_2 = (__pyx_v_tao != NULL); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = (__pyx_v_tao->data != NULL); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "petsc4py/PETSc/libpetsc4py.pyx":2683 * cdef inline _PyTao PyTao(PetscTAO tao): * if tao != NULL and tao.data != NULL: * return <_PyTao>tao.data # <<<<<<<<<<<<<< * else: * return _PyTao.__new__(_PyTao) */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)((struct __pyx_obj_8petsc4py_5PETSc__PyTao *)__pyx_v_tao->data)); __pyx_r = ((struct __pyx_obj_8petsc4py_5PETSc__PyTao *)__pyx_v_tao->data); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":2682 * cdef class _PyTao(_PyObj): pass * cdef inline _PyTao PyTao(PetscTAO tao): * if tao != NULL and tao.data != NULL: # <<<<<<<<<<<<<< * return <_PyTao>tao.data * else: */ } /* "petsc4py/PETSc/libpetsc4py.pyx":2685 * return <_PyTao>tao.data * else: * return _PyTao.__new__(_PyTao) # <<<<<<<<<<<<<< * * cdef public PetscErrorCode TaoPythonGetContext(PetscTAO tao, void **ctx) \ */ /*else*/ { __Pyx_XDECREF((PyObject *)__pyx_r); __pyx_t_3 = ((PyObject *)__pyx_tp_new_8petsc4py_5PETSc__PyTao(((PyTypeObject *)__pyx_ptype_8petsc4py_5PETSc__PyTao), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 2685, __pyx_L1_error) __Pyx_GOTREF((PyObject *)__pyx_t_3); __pyx_r = ((struct __pyx_obj_8petsc4py_5PETSc__PyTao *)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; } /* "petsc4py/PETSc/libpetsc4py.pyx":2681 * @cython.internal * cdef class _PyTao(_PyObj): pass * cdef inline _PyTao PyTao(PetscTAO tao): # <<<<<<<<<<<<<< * if tao != NULL and tao.data != NULL: * return <_PyTao>tao.data */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.PyTao", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":2687 * return _PyTao.__new__(_PyTao) * * cdef public PetscErrorCode TaoPythonGetContext(PetscTAO tao, void **ctx) \ # <<<<<<<<<<<<<< * except PETSC_ERR_PYTHON: * FunctionBegin(b"TaoPythonGetContext") */ PetscErrorCode TaoPythonGetContext(Tao __pyx_v_tao, void **__pyx_v_ctx) { PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("TaoPythonGetContext", 1); /* "petsc4py/PETSc/libpetsc4py.pyx":2689 * cdef public PetscErrorCode TaoPythonGetContext(PetscTAO tao, void **ctx) \ * except PETSC_ERR_PYTHON: * FunctionBegin(b"TaoPythonGetContext") # <<<<<<<<<<<<<< * PyTao(tao).getcontext(ctx) * return FunctionEnd() */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"TaoPythonGetContext")); /* "petsc4py/PETSc/libpetsc4py.pyx":2690 * except PETSC_ERR_PYTHON: * FunctionBegin(b"TaoPythonGetContext") * PyTao(tao).getcontext(ctx) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyTao(__pyx_v_tao)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 2690, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__PyTao *)((struct __pyx_obj_8petsc4py_5PETSc__PyTao *)__pyx_t_1)->__pyx_base.__pyx_vtab)->__pyx_base.getcontext(((struct __pyx_obj_8petsc4py_5PETSc__PyObj *)__pyx_t_1), __pyx_v_ctx); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(11, 2690, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2691 * FunctionBegin(b"TaoPythonGetContext") * PyTao(tao).getcontext(ctx) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef public PetscErrorCode TaoPythonSetContext(PetscTAO tao, void *ctx) \ */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":2687 * return _PyTao.__new__(_PyTao) * * cdef public PetscErrorCode TaoPythonGetContext(PetscTAO tao, void **ctx) \ # <<<<<<<<<<<<<< * except PETSC_ERR_PYTHON: * FunctionBegin(b"TaoPythonGetContext") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TaoPythonGetContext", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":2693 * return FunctionEnd() * * cdef public PetscErrorCode TaoPythonSetContext(PetscTAO tao, void *ctx) \ # <<<<<<<<<<<<<< * except PETSC_ERR_PYTHON: * FunctionBegin(b"TaoPythonSetContext") */ PetscErrorCode TaoPythonSetContext(Tao __pyx_v_tao, void *__pyx_v_ctx) { PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("TaoPythonSetContext", 1); /* "petsc4py/PETSc/libpetsc4py.pyx":2695 * cdef public PetscErrorCode TaoPythonSetContext(PetscTAO tao, void *ctx) \ * except PETSC_ERR_PYTHON: * FunctionBegin(b"TaoPythonSetContext") # <<<<<<<<<<<<<< * PyTao(tao).setcontext(ctx, TAO_(tao)) * return FunctionEnd() */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"TaoPythonSetContext")); /* "petsc4py/PETSc/libpetsc4py.pyx":2696 * except PETSC_ERR_PYTHON: * FunctionBegin(b"TaoPythonSetContext") * PyTao(tao).setcontext(ctx, TAO_(tao)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyTao(__pyx_v_tao)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 2696, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_TAO_(__pyx_v_tao)); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 2696, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__PyTao *)((struct __pyx_obj_8petsc4py_5PETSc__PyTao *)__pyx_t_1)->__pyx_base.__pyx_vtab)->__pyx_base.setcontext(((struct __pyx_obj_8petsc4py_5PETSc__PyObj *)__pyx_t_1), __pyx_v_ctx, ((struct PyPetscObjectObject *)__pyx_t_2)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(11, 2696, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2697 * FunctionBegin(b"TaoPythonSetContext") * PyTao(tao).setcontext(ctx, TAO_(tao)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode TaoPythonSetType_PYTHON(PetscTAO tao, char name[]) \ */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":2693 * return FunctionEnd() * * cdef public PetscErrorCode TaoPythonSetContext(PetscTAO tao, void *ctx) \ # <<<<<<<<<<<<<< * except PETSC_ERR_PYTHON: * FunctionBegin(b"TaoPythonSetContext") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TaoPythonSetContext", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":2699 * return FunctionEnd() * * cdef PetscErrorCode TaoPythonSetType_PYTHON(PetscTAO tao, char name[]) \ # <<<<<<<<<<<<<< * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"TaoPythonSetType_PYTHON") */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TaoPythonSetType_PYTHON(Tao __pyx_v_tao, char *__pyx_v_name) { PyObject *__pyx_v_ctx = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TaoPythonSetType_PYTHON", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":2701 * cdef PetscErrorCode TaoPythonSetType_PYTHON(PetscTAO tao, char name[]) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"TaoPythonSetType_PYTHON") # <<<<<<<<<<<<<< * if name == NULL: return FunctionEnd() # XXX * cdef object ctx = createcontext(name) */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"TaoPythonSetType_PYTHON")); /* "petsc4py/PETSc/libpetsc4py.pyx":2702 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"TaoPythonSetType_PYTHON") * if name == NULL: return FunctionEnd() # XXX # <<<<<<<<<<<<<< * cdef object ctx = createcontext(name) * TaoPythonSetContext(tao, ctx) */ __pyx_t_1 = (__pyx_v_name == NULL); if (__pyx_t_1) { __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; } /* "petsc4py/PETSc/libpetsc4py.pyx":2703 * FunctionBegin(b"TaoPythonSetType_PYTHON") * if name == NULL: return FunctionEnd() # XXX * cdef object ctx = createcontext(name) # <<<<<<<<<<<<<< * TaoPythonSetContext(tao, ctx) * PyTao(tao).setname(name) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_createcontext(__pyx_v_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 2703, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_ctx = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2704 * if name == NULL: return FunctionEnd() # XXX * cdef object ctx = createcontext(name) * TaoPythonSetContext(tao, ctx) # <<<<<<<<<<<<<< * PyTao(tao).setname(name) * return FunctionEnd() */ __pyx_t_3 = TaoPythonSetContext(__pyx_v_tao, ((void *)__pyx_v_ctx)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2704, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2705 * cdef object ctx = createcontext(name) * TaoPythonSetContext(tao, ctx) * PyTao(tao).setname(name) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyTao(__pyx_v_tao)); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 2705, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__PyTao *)((struct __pyx_obj_8petsc4py_5PETSc__PyTao *)__pyx_t_2)->__pyx_base.__pyx_vtab)->__pyx_base.setname(((struct __pyx_obj_8petsc4py_5PETSc__PyObj *)__pyx_t_2), __pyx_v_name); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(11, 2705, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2706 * TaoPythonSetContext(tao, ctx) * PyTao(tao).setname(name) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode TaoPythonGetType_PYTHON(PetscTAO tao, const char *name[]) \ */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":2699 * return FunctionEnd() * * cdef PetscErrorCode TaoPythonSetType_PYTHON(PetscTAO tao, char name[]) \ # <<<<<<<<<<<<<< * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"TaoPythonSetType_PYTHON") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TaoPythonSetType_PYTHON", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ctx); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":2708 * return FunctionEnd() * * cdef PetscErrorCode TaoPythonGetType_PYTHON(PetscTAO tao, const char *name[]) \ # <<<<<<<<<<<<<< * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"TaoPythonGetType_PYTHON") */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TaoPythonGetType_PYTHON(Tao __pyx_v_tao, char const **__pyx_v_name) { PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; char *__pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TaoPythonGetType_PYTHON", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":2710 * cdef PetscErrorCode TaoPythonGetType_PYTHON(PetscTAO tao, const char *name[]) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"TaoPythonGetType_PYTHON") # <<<<<<<<<<<<<< * name[0] = PyTao(tao).getname() * return FunctionEnd() */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"TaoPythonGetType_PYTHON")); /* "petsc4py/PETSc/libpetsc4py.pyx":2711 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"TaoPythonGetType_PYTHON") * name[0] = PyTao(tao).getname() # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyTao(__pyx_v_tao)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 2711, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__PyTao *)((struct __pyx_obj_8petsc4py_5PETSc__PyTao *)__pyx_t_1)->__pyx_base.__pyx_vtab)->__pyx_base.getname(((struct __pyx_obj_8petsc4py_5PETSc__PyObj *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((char *)NULL) && PyErr_Occurred())) __PYX_ERR(11, 2711, __pyx_L1_error) (__pyx_v_name[0]) = __pyx_t_2; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2712 * FunctionBegin(b"TaoPythonGetType_PYTHON") * name[0] = PyTao(tao).getname() * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode TaoCreate_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":2708 * return FunctionEnd() * * cdef PetscErrorCode TaoPythonGetType_PYTHON(PetscTAO tao, const char *name[]) \ # <<<<<<<<<<<<<< * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"TaoPythonGetType_PYTHON") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TaoPythonGetType_PYTHON", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":2714 * return FunctionEnd() * * cdef PetscErrorCode TaoCreate_Python( # <<<<<<<<<<<<<< * PetscTAO tao, * ) \ */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TaoCreate_Python(Tao __pyx_v_tao) { TaoOps __pyx_v_ops; PyObject *__pyx_v_ctx = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations TaoOps __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TaoCreate_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":2718 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"TaoCreate_Python") # <<<<<<<<<<<<<< * # * cdef TaoOps ops = tao.ops */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"TaoCreate_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":2720 * FunctionBegin(b"TaoCreate_Python") * # * cdef TaoOps ops = tao.ops # <<<<<<<<<<<<<< * ops.destroy = TaoDestroy_Python * ops.view = TaoView_Python */ __pyx_t_1 = __pyx_v_tao->ops; __pyx_v_ops = __pyx_t_1; /* "petsc4py/PETSc/libpetsc4py.pyx":2721 * # * cdef TaoOps ops = tao.ops * ops.destroy = TaoDestroy_Python # <<<<<<<<<<<<<< * ops.view = TaoView_Python * ops.solve = TaoSolve_Python */ __pyx_v_ops->destroy = __pyx_f_8petsc4py_5PETSc_TaoDestroy_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":2722 * cdef TaoOps ops = tao.ops * ops.destroy = TaoDestroy_Python * ops.view = TaoView_Python # <<<<<<<<<<<<<< * ops.solve = TaoSolve_Python * ops.setup = TaoSetUp_Python */ __pyx_v_ops->view = __pyx_f_8petsc4py_5PETSc_TaoView_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":2723 * ops.destroy = TaoDestroy_Python * ops.view = TaoView_Python * ops.solve = TaoSolve_Python # <<<<<<<<<<<<<< * ops.setup = TaoSetUp_Python * ops.setfromoptions = TaoSetFromOptions_Python */ __pyx_v_ops->solve = __pyx_f_8petsc4py_5PETSc_TaoSolve_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":2724 * ops.view = TaoView_Python * ops.solve = TaoSolve_Python * ops.setup = TaoSetUp_Python # <<<<<<<<<<<<<< * ops.setfromoptions = TaoSetFromOptions_Python * # */ __pyx_v_ops->setup = __pyx_f_8petsc4py_5PETSc_TaoSetUp_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":2725 * ops.solve = TaoSolve_Python * ops.setup = TaoSetUp_Python * ops.setfromoptions = TaoSetFromOptions_Python # <<<<<<<<<<<<<< * # * CHKERR( PetscObjectComposeFunction( */ __pyx_v_ops->setfromoptions = __pyx_f_8petsc4py_5PETSc_TaoSetFromOptions_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":2727 * ops.setfromoptions = TaoSetFromOptions_Python * # * CHKERR( PetscObjectComposeFunction( # <<<<<<<<<<<<<< * tao, b"TaoPythonSetType_C", * TaoPythonSetType_PYTHON) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectComposeFunction(((PetscObject)__pyx_v_tao), ((char *)"TaoPythonSetType_C"), ((PetscVoidFunction)__pyx_f_8petsc4py_5PETSc_TaoPythonSetType_PYTHON))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2727, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2730 * tao, b"TaoPythonSetType_C", * TaoPythonSetType_PYTHON) ) * CHKERR( PetscObjectComposeFunction( # <<<<<<<<<<<<<< * tao, b"TaoPythonGetType_C", * TaoPythonGetType_PYTHON) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectComposeFunction(((PetscObject)__pyx_v_tao), ((char *)"TaoPythonGetType_C"), ((PetscVoidFunction)__pyx_f_8petsc4py_5PETSc_TaoPythonGetType_PYTHON))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2730, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2734 * TaoPythonGetType_PYTHON) ) * # * CHKERR( TaoCreateDefaultLineSearch(tao) ) # <<<<<<<<<<<<<< * CHKERR( TaoCreateDefaultKSP(tao) ) * # */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoCreateDefaultLineSearch(__pyx_v_tao)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2734, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2735 * # * CHKERR( TaoCreateDefaultLineSearch(tao) ) * CHKERR( TaoCreateDefaultKSP(tao) ) # <<<<<<<<<<<<<< * # * cdef ctx = PyTao(NULL) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoCreateDefaultKSP(__pyx_v_tao)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2735, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2737 * CHKERR( TaoCreateDefaultKSP(tao) ) * # * cdef ctx = PyTao(NULL) # <<<<<<<<<<<<<< * tao.data = ctx * Py_INCREF(tao.data) */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyTao(NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 2737, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_ctx = __pyx_t_3; __pyx_t_3 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2738 * # * cdef ctx = PyTao(NULL) * tao.data = ctx # <<<<<<<<<<<<<< * Py_INCREF(tao.data) * return FunctionEnd() */ __pyx_v_tao->data = ((void *)__pyx_v_ctx); /* "petsc4py/PETSc/libpetsc4py.pyx":2739 * cdef ctx = PyTao(NULL) * tao.data = ctx * Py_INCREF(tao.data) # <<<<<<<<<<<<<< * return FunctionEnd() * */ Py_INCREF(((PyObject *)__pyx_v_tao->data)); /* "petsc4py/PETSc/libpetsc4py.pyx":2740 * tao.data = ctx * Py_INCREF(tao.data) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef inline PetscErrorCode TaoDestroy_Python_inner( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":2714 * return FunctionEnd() * * cdef PetscErrorCode TaoCreate_Python( # <<<<<<<<<<<<<< * PetscTAO tao, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TaoCreate_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ctx); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":2742 * return FunctionEnd() * * cdef inline PetscErrorCode TaoDestroy_Python_inner( # <<<<<<<<<<<<<< * PetscTAO tao, * ) \ */ static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_TaoDestroy_Python_inner(Tao __pyx_v_tao) { PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PetscErrorCode __pyx_t_1; int __pyx_t_2; int __pyx_t_3; char const *__pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TaoDestroy_Python_inner", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":2746 * ) \ * except PETSC_ERR_PYTHON with gil: * try: # <<<<<<<<<<<<<< * addRef(tao) * TaoPythonSetContext(tao, NULL) */ /*try:*/ { /* "petsc4py/PETSc/libpetsc4py.pyx":2747 * except PETSC_ERR_PYTHON with gil: * try: * addRef(tao) # <<<<<<<<<<<<<< * TaoPythonSetContext(tao, NULL) * finally: */ __pyx_f_8petsc4py_5PETSc_addRef(__pyx_v_tao); /* "petsc4py/PETSc/libpetsc4py.pyx":2748 * try: * addRef(tao) * TaoPythonSetContext(tao, NULL) # <<<<<<<<<<<<<< * finally: * delRef(tao) */ __pyx_t_1 = TaoPythonSetContext(__pyx_v_tao, NULL); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2748, __pyx_L4_error) } /* "petsc4py/PETSc/libpetsc4py.pyx":2750 * TaoPythonSetContext(tao, NULL) * finally: * delRef(tao) # <<<<<<<<<<<<<< * Py_DECREF(tao.data) * tao.data = NULL */ /*finally:*/ { /*normal exit:*/{ __pyx_f_8petsc4py_5PETSc_delRef(__pyx_v_tao); /* "petsc4py/PETSc/libpetsc4py.pyx":2751 * finally: * delRef(tao) * Py_DECREF(tao.data) # <<<<<<<<<<<<<< * tao.data = NULL * return PETSC_SUCCESS */ Py_DECREF(((PyObject *)__pyx_v_tao->data)); /* "petsc4py/PETSc/libpetsc4py.pyx":2752 * delRef(tao) * Py_DECREF(tao.data) * tao.data = NULL # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_v_tao->data = NULL; goto __pyx_L5; } __pyx_L4_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0)) __Pyx_ErrFetch(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __pyx_t_2 = __pyx_lineno; __pyx_t_3 = __pyx_clineno; __pyx_t_4 = __pyx_filename; { /* "petsc4py/PETSc/libpetsc4py.pyx":2750 * TaoPythonSetContext(tao, NULL) * finally: * delRef(tao) # <<<<<<<<<<<<<< * Py_DECREF(tao.data) * tao.data = NULL */ __pyx_f_8petsc4py_5PETSc_delRef(__pyx_v_tao); /* "petsc4py/PETSc/libpetsc4py.pyx":2751 * finally: * delRef(tao) * Py_DECREF(tao.data) # <<<<<<<<<<<<<< * tao.data = NULL * return PETSC_SUCCESS */ Py_DECREF(((PyObject *)__pyx_v_tao->data)); /* "petsc4py/PETSc/libpetsc4py.pyx":2752 * delRef(tao) * Py_DECREF(tao.data) * tao.data = NULL # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ __pyx_v_tao->data = NULL; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); } __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_ErrRestore(__pyx_t_5, __pyx_t_6, __pyx_t_7); __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_lineno = __pyx_t_2; __pyx_clineno = __pyx_t_3; __pyx_filename = __pyx_t_4; goto __pyx_L1_error; } __pyx_L5:; } /* "petsc4py/PETSc/libpetsc4py.pyx":2753 * Py_DECREF(tao.data) * tao.data = NULL * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * cdef PetscErrorCode TaoDestroy_Python( */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":2742 * return FunctionEnd() * * cdef inline PetscErrorCode TaoDestroy_Python_inner( # <<<<<<<<<<<<<< * PetscTAO tao, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TaoDestroy_Python_inner", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":2755 * return PETSC_SUCCESS * * cdef PetscErrorCode TaoDestroy_Python( # <<<<<<<<<<<<<< * PetscTAO tao, * ) \ */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TaoDestroy_Python(Tao __pyx_v_tao) { PetscErrorCode __pyx_r; PetscErrorCode __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save; #endif /* "petsc4py/PETSc/libpetsc4py.pyx":2759 * ) \ * except PETSC_ERR_PYTHON nogil: * FunctionBegin(b"TaoDestroy_Python") # <<<<<<<<<<<<<< * CHKERR( PetscObjectComposeFunction( * tao, b"TaoPythonSetType_C", */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"TaoDestroy_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":2760 * except PETSC_ERR_PYTHON nogil: * FunctionBegin(b"TaoDestroy_Python") * CHKERR( PetscObjectComposeFunction( # <<<<<<<<<<<<<< * tao, b"TaoPythonSetType_C", * NULL) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectComposeFunction(((PetscObject)__pyx_v_tao), ((char *)"TaoPythonSetType_C"), ((PetscVoidFunction)NULL))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2760, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2763 * tao, b"TaoPythonSetType_C", * NULL) ) * CHKERR( PetscObjectComposeFunction( # <<<<<<<<<<<<<< * tao, b"TaoPythonGetType_C", * NULL) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectComposeFunction(((PetscObject)__pyx_v_tao), ((char *)"TaoPythonGetType_C"), ((PetscVoidFunction)NULL))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2763, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2767 * NULL) ) * # * if Py_IsInitialized(): TaoDestroy_Python_inner(tao) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_2 = (Py_IsInitialized() != 0); if (__pyx_t_2) { __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_TaoDestroy_Python_inner(__pyx_v_tao); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2767, __pyx_L1_error) } /* "petsc4py/PETSc/libpetsc4py.pyx":2768 * # * if Py_IsInitialized(): TaoDestroy_Python_inner(tao) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode TaoSetUp_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":2755 * return PETSC_SUCCESS * * cdef PetscErrorCode TaoDestroy_Python( # <<<<<<<<<<<<<< * PetscTAO tao, * ) \ */ /* function exit code */ __pyx_L1_error:; #ifdef WITH_THREAD __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_AddTraceback("petsc4py.PETSc.TaoDestroy_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":2770 * return FunctionEnd() * * cdef PetscErrorCode TaoSetUp_Python( # <<<<<<<<<<<<<< * PetscTAO tao, * ) \ */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TaoSetUp_Python(Tao __pyx_v_tao) { char __pyx_v_name[0x800]; PetscBool __pyx_v_found; PyObject *__pyx_v_setUp = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_t_4; PetscErrorCode __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TaoSetUp_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":2774 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"TaoSetUp_Python") # <<<<<<<<<<<<<< * cdef char name[2048] * cdef PetscBool found = PETSC_FALSE */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"TaoSetUp_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":2776 * FunctionBegin(b"TaoSetUp_Python") * cdef char name[2048] * cdef PetscBool found = PETSC_FALSE # <<<<<<<<<<<<<< * if PyTao(tao).self is None: * CHKERR( PetscOptionsGetString(NULL, */ __pyx_v_found = PETSC_FALSE; /* "petsc4py/PETSc/libpetsc4py.pyx":2777 * cdef char name[2048] * cdef PetscBool found = PETSC_FALSE * if PyTao(tao).self is None: # <<<<<<<<<<<<<< * CHKERR( PetscOptionsGetString(NULL, * getPrefix(tao), b"-tao_python_type", */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyTao(__pyx_v_tao)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 2777, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (((struct __pyx_obj_8petsc4py_5PETSc__PyTao *)__pyx_t_1)->__pyx_base.self == Py_None); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "petsc4py/PETSc/libpetsc4py.pyx":2778 * cdef PetscBool found = PETSC_FALSE * if PyTao(tao).self is None: * CHKERR( PetscOptionsGetString(NULL, # <<<<<<<<<<<<<< * getPrefix(tao), b"-tao_python_type", * name, sizeof(name), &found) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsGetString(NULL, __pyx_f_8petsc4py_5PETSc_getPrefix(__pyx_v_tao), ((char *)"-tao_python_type"), __pyx_v_name, (sizeof(__pyx_v_name)), (&__pyx_v_found))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2778, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2781 * getPrefix(tao), b"-tao_python_type", * name, sizeof(name), &found) ) * if found and name[0]: # <<<<<<<<<<<<<< * CHKERR( TaoPythonSetType_PYTHON(tao, name) ) * if PyTao(tao).self is None: */ if (__pyx_v_found) { } else { __pyx_t_2 = __pyx_v_found; goto __pyx_L5_bool_binop_done; } __pyx_t_4 = ((__pyx_v_name[0]) != 0); __pyx_t_2 = __pyx_t_4; __pyx_L5_bool_binop_done:; if (__pyx_t_2) { /* "petsc4py/PETSc/libpetsc4py.pyx":2782 * name, sizeof(name), &found) ) * if found and name[0]: * CHKERR( TaoPythonSetType_PYTHON(tao, name) ) # <<<<<<<<<<<<<< * if PyTao(tao).self is None: * return PetscSETERR(PETSC_ERR_USER, */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_TaoPythonSetType_PYTHON(__pyx_v_tao, __pyx_v_name); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2782, __pyx_L1_error) __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_t_3); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2782, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2781 * getPrefix(tao), b"-tao_python_type", * name, sizeof(name), &found) ) * if found and name[0]: # <<<<<<<<<<<<<< * CHKERR( TaoPythonSetType_PYTHON(tao, name) ) * if PyTao(tao).self is None: */ } /* "petsc4py/PETSc/libpetsc4py.pyx":2777 * cdef char name[2048] * cdef PetscBool found = PETSC_FALSE * if PyTao(tao).self is None: # <<<<<<<<<<<<<< * CHKERR( PetscOptionsGetString(NULL, * getPrefix(tao), b"-tao_python_type", */ } /* "petsc4py/PETSc/libpetsc4py.pyx":2783 * if found and name[0]: * CHKERR( TaoPythonSetType_PYTHON(tao, name) ) * if PyTao(tao).self is None: # <<<<<<<<<<<<<< * return PetscSETERR(PETSC_ERR_USER, * "Python context not set, call one of \n" */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyTao(__pyx_v_tao)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 2783, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (((struct __pyx_obj_8petsc4py_5PETSc__PyTao *)__pyx_t_1)->__pyx_base.self == Py_None); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "petsc4py/PETSc/libpetsc4py.pyx":2784 * CHKERR( TaoPythonSetType_PYTHON(tao, name) ) * if PyTao(tao).self is None: * return PetscSETERR(PETSC_ERR_USER, # <<<<<<<<<<<<<< * "Python context not set, call one of \n" * " * TaoPythonSetType(tao, \"[package.]module.class\")\n" */ __pyx_r = __pyx_f_8petsc4py_5PETSc_PetscSETERR(PETSC_ERR_USER, ((char *)"Python context not set, call one of \n * TaoPythonSetType(tao, \"[package.]module.class\")\n * TaoSetFromOptions(tao) and pass option -tao_python_type [package.]module.class")); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":2783 * if found and name[0]: * CHKERR( TaoPythonSetType_PYTHON(tao, name) ) * if PyTao(tao).self is None: # <<<<<<<<<<<<<< * return PetscSETERR(PETSC_ERR_USER, * "Python context not set, call one of \n" */ } /* "petsc4py/PETSc/libpetsc4py.pyx":2790 * "-tao_python_type [package.]module.class") * # * cdef setUp = PyTao(tao).setUp # <<<<<<<<<<<<<< * if setUp is not None: * setUp(TAO_(tao)) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyTao(__pyx_v_tao)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 2790, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_setUp); if (unlikely(!__pyx_t_6)) __PYX_ERR(11, 2790, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_setUp = __pyx_t_6; __pyx_t_6 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2791 * # * cdef setUp = PyTao(tao).setUp * if setUp is not None: # <<<<<<<<<<<<<< * setUp(TAO_(tao)) * return FunctionEnd() */ __pyx_t_2 = (__pyx_v_setUp != Py_None); if (__pyx_t_2) { /* "petsc4py/PETSc/libpetsc4py.pyx":2792 * cdef setUp = PyTao(tao).setUp * if setUp is not None: * setUp(TAO_(tao)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_TAO_(__pyx_v_tao)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 2792, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_setUp); __pyx_t_7 = __pyx_v_setUp; __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_1}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(11, 2792, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2791 * # * cdef setUp = PyTao(tao).setUp * if setUp is not None: # <<<<<<<<<<<<<< * setUp(TAO_(tao)) * return FunctionEnd() */ } /* "petsc4py/PETSc/libpetsc4py.pyx":2793 * if setUp is not None: * setUp(TAO_(tao)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode TaoSetFromOptions_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":2770 * return FunctionEnd() * * cdef PetscErrorCode TaoSetUp_Python( # <<<<<<<<<<<<<< * PetscTAO tao, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("petsc4py.PETSc.TaoSetUp_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_setUp); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":2795 * return FunctionEnd() * * cdef PetscErrorCode TaoSetFromOptions_Python( # <<<<<<<<<<<<<< * PetscTAO tao, * PetscOptionItems *PetscOptionsObject, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TaoSetFromOptions_Python(Tao __pyx_v_tao, PetscOptionItems *__pyx_v_PetscOptionsObject) { char __pyx_v_name[0x800]; char *__pyx_v_defval; PetscBool __pyx_v_found; PetscOptionItems *PetscOptionsObject; PyObject *__pyx_v_setFromOptions = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; char *__pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_t_4; int __pyx_t_5; PetscErrorCode __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TaoSetFromOptions_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":2800 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"TaoSetFromOptions_Python") # <<<<<<<<<<<<<< * # * cdef char name[2048], *defval = PyTao(tao).getname() */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"TaoSetFromOptions_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":2802 * FunctionBegin(b"TaoSetFromOptions_Python") * # * cdef char name[2048], *defval = PyTao(tao).getname() # <<<<<<<<<<<<<< * cdef PetscBool found = PETSC_FALSE * cdef PetscOptionItems *opts "PetscOptionsObject" = PetscOptionsObject */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyTao(__pyx_v_tao)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 2802, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__PyTao *)((struct __pyx_obj_8petsc4py_5PETSc__PyTao *)__pyx_t_1)->__pyx_base.__pyx_vtab)->__pyx_base.getname(((struct __pyx_obj_8petsc4py_5PETSc__PyObj *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((char *)NULL) && PyErr_Occurred())) __PYX_ERR(11, 2802, __pyx_L1_error) __pyx_v_defval = __pyx_t_2; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2803 * # * cdef char name[2048], *defval = PyTao(tao).getname() * cdef PetscBool found = PETSC_FALSE # <<<<<<<<<<<<<< * cdef PetscOptionItems *opts "PetscOptionsObject" = PetscOptionsObject * CHKERR( PetscOptionsString( */ __pyx_v_found = PETSC_FALSE; /* "petsc4py/PETSc/libpetsc4py.pyx":2804 * cdef char name[2048], *defval = PyTao(tao).getname() * cdef PetscBool found = PETSC_FALSE * cdef PetscOptionItems *opts "PetscOptionsObject" = PetscOptionsObject # <<<<<<<<<<<<<< * CHKERR( PetscOptionsString( * b"-tao_python_type", b"Python [package.]module[.{class|function}]", */ PetscOptionsObject = __pyx_v_PetscOptionsObject; /* "petsc4py/PETSc/libpetsc4py.pyx":2805 * cdef PetscBool found = PETSC_FALSE * cdef PetscOptionItems *opts "PetscOptionsObject" = PetscOptionsObject * CHKERR( PetscOptionsString( # <<<<<<<<<<<<<< * b"-tao_python_type", b"Python [package.]module[.{class|function}]", * b"TaoPythonSetType", defval, name, sizeof(name), &found) ); opts; */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsString(((char *)"-tao_python_type"), ((char *)"Python [package.]module[.{class|function}]"), ((char *)"TaoPythonSetType"), __pyx_v_defval, __pyx_v_name, (sizeof(__pyx_v_name)), (&__pyx_v_found))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2805, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2807 * CHKERR( PetscOptionsString( * b"-tao_python_type", b"Python [package.]module[.{class|function}]", * b"TaoPythonSetType", defval, name, sizeof(name), &found) ); opts; # <<<<<<<<<<<<<< * if found and name[0]: * CHKERR( TaoPythonSetType_PYTHON(tao, name) ) */ ((void)PetscOptionsObject); /* "petsc4py/PETSc/libpetsc4py.pyx":2808 * b"-tao_python_type", b"Python [package.]module[.{class|function}]", * b"TaoPythonSetType", defval, name, sizeof(name), &found) ); opts; * if found and name[0]: # <<<<<<<<<<<<<< * CHKERR( TaoPythonSetType_PYTHON(tao, name) ) * # */ if (__pyx_v_found) { } else { __pyx_t_4 = __pyx_v_found; goto __pyx_L4_bool_binop_done; } __pyx_t_5 = ((__pyx_v_name[0]) != 0); __pyx_t_4 = __pyx_t_5; __pyx_L4_bool_binop_done:; if (__pyx_t_4) { /* "petsc4py/PETSc/libpetsc4py.pyx":2809 * b"TaoPythonSetType", defval, name, sizeof(name), &found) ); opts; * if found and name[0]: * CHKERR( TaoPythonSetType_PYTHON(tao, name) ) # <<<<<<<<<<<<<< * # * cdef setFromOptions = PyTao(tao).setFromOptions */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_TaoPythonSetType_PYTHON(__pyx_v_tao, __pyx_v_name); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2809, __pyx_L1_error) __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_t_3); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2809, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2808 * b"-tao_python_type", b"Python [package.]module[.{class|function}]", * b"TaoPythonSetType", defval, name, sizeof(name), &found) ); opts; * if found and name[0]: # <<<<<<<<<<<<<< * CHKERR( TaoPythonSetType_PYTHON(tao, name) ) * # */ } /* "petsc4py/PETSc/libpetsc4py.pyx":2811 * CHKERR( TaoPythonSetType_PYTHON(tao, name) ) * # * cdef setFromOptions = PyTao(tao).setFromOptions # <<<<<<<<<<<<<< * if setFromOptions is not None: * setFromOptions(TAO_(tao)) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyTao(__pyx_v_tao)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 2811, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_setFromOptions); if (unlikely(!__pyx_t_7)) __PYX_ERR(11, 2811, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_setFromOptions = __pyx_t_7; __pyx_t_7 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2812 * # * cdef setFromOptions = PyTao(tao).setFromOptions * if setFromOptions is not None: # <<<<<<<<<<<<<< * setFromOptions(TAO_(tao)) * CHKERR( KSPSetFromOptions(tao.ksp) ) */ __pyx_t_4 = (__pyx_v_setFromOptions != Py_None); if (__pyx_t_4) { /* "petsc4py/PETSc/libpetsc4py.pyx":2813 * cdef setFromOptions = PyTao(tao).setFromOptions * if setFromOptions is not None: * setFromOptions(TAO_(tao)) # <<<<<<<<<<<<<< * CHKERR( KSPSetFromOptions(tao.ksp) ) * return FunctionEnd() */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_TAO_(__pyx_v_tao)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 2813, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_setFromOptions); __pyx_t_8 = __pyx_v_setFromOptions; __pyx_t_9 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_8))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_1}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(11, 2813, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2812 * # * cdef setFromOptions = PyTao(tao).setFromOptions * if setFromOptions is not None: # <<<<<<<<<<<<<< * setFromOptions(TAO_(tao)) * CHKERR( KSPSetFromOptions(tao.ksp) ) */ } /* "petsc4py/PETSc/libpetsc4py.pyx":2814 * if setFromOptions is not None: * setFromOptions(TAO_(tao)) * CHKERR( KSPSetFromOptions(tao.ksp) ) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetFromOptions(__pyx_v_tao->ksp)); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2814, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2815 * setFromOptions(TAO_(tao)) * CHKERR( KSPSetFromOptions(tao.ksp) ) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode TaoView_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":2795 * return FunctionEnd() * * cdef PetscErrorCode TaoSetFromOptions_Python( # <<<<<<<<<<<<<< * PetscTAO tao, * PetscOptionItems *PetscOptionsObject, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("petsc4py.PETSc.TaoSetFromOptions_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_setFromOptions); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":2817 * return FunctionEnd() * * cdef PetscErrorCode TaoView_Python( # <<<<<<<<<<<<<< * PetscTAO tao, * PetscViewer vwr, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TaoView_Python(Tao __pyx_v_tao, PetscViewer __pyx_v_vwr) { PyObject *__pyx_v_view = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TaoView_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":2822 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"TaoView_Python") # <<<<<<<<<<<<<< * viewcontext(PyTao(tao), vwr) * cdef view = PyTao(tao).view */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"TaoView_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":2823 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"TaoView_Python") * viewcontext(PyTao(tao), vwr) # <<<<<<<<<<<<<< * cdef view = PyTao(tao).view * if view is not None: */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyTao(__pyx_v_tao)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 2823, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_viewcontext(((struct __pyx_obj_8petsc4py_5PETSc__PyObj *)__pyx_t_1), __pyx_v_vwr); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(11, 2823, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2824 * FunctionBegin(b"TaoView_Python") * viewcontext(PyTao(tao), vwr) * cdef view = PyTao(tao).view # <<<<<<<<<<<<<< * if view is not None: * view(TAO_(tao), Viewer_(vwr)) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyTao(__pyx_v_tao)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 2824, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_view); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 2824, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_view = __pyx_t_3; __pyx_t_3 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2825 * viewcontext(PyTao(tao), vwr) * cdef view = PyTao(tao).view * if view is not None: # <<<<<<<<<<<<<< * view(TAO_(tao), Viewer_(vwr)) * return FunctionEnd() */ __pyx_t_4 = (__pyx_v_view != Py_None); if (__pyx_t_4) { /* "petsc4py/PETSc/libpetsc4py.pyx":2826 * cdef view = PyTao(tao).view * if view is not None: * view(TAO_(tao), Viewer_(vwr)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_TAO_(__pyx_v_tao)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 2826, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Viewer_(__pyx_v_vwr)); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 2826, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_view); __pyx_t_6 = __pyx_v_view; __pyx_t_7 = NULL; __pyx_t_2 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_2 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_1, __pyx_t_5}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_2, 2+__pyx_t_2); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 2826, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2825 * viewcontext(PyTao(tao), vwr) * cdef view = PyTao(tao).view * if view is not None: # <<<<<<<<<<<<<< * view(TAO_(tao), Viewer_(vwr)) * return FunctionEnd() */ } /* "petsc4py/PETSc/libpetsc4py.pyx":2827 * if view is not None: * view(TAO_(tao), Viewer_(vwr)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode TaoSolve_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":2817 * return FunctionEnd() * * cdef PetscErrorCode TaoView_Python( # <<<<<<<<<<<<<< * PetscTAO tao, * PetscViewer vwr, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.TaoView_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_view); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":2829 * return FunctionEnd() * * cdef PetscErrorCode TaoSolve_Python( # <<<<<<<<<<<<<< * PetscTAO tao, * ) \ */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TaoSolve_Python(Tao __pyx_v_tao) { PyObject *__pyx_v_solve = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; PetscErrorCode __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TaoSolve_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":2833 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"TaoSolve_Python") # <<<<<<<<<<<<<< * # * tao.niter = 0 */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"TaoSolve_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":2835 * FunctionBegin(b"TaoSolve_Python") * # * tao.niter = 0 # <<<<<<<<<<<<<< * tao.ksp_its = 0 * tao.reason = TAO_CONTINUE_ITERATING */ __pyx_v_tao->niter = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2836 * # * tao.niter = 0 * tao.ksp_its = 0 # <<<<<<<<<<<<<< * tao.reason = TAO_CONTINUE_ITERATING * # */ __pyx_v_tao->ksp_its = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2837 * tao.niter = 0 * tao.ksp_its = 0 * tao.reason = TAO_CONTINUE_ITERATING # <<<<<<<<<<<<<< * # * cdef solve = PyTao(tao).solve */ __pyx_v_tao->reason = TAO_CONTINUE_ITERATING; /* "petsc4py/PETSc/libpetsc4py.pyx":2839 * tao.reason = TAO_CONTINUE_ITERATING * # * cdef solve = PyTao(tao).solve # <<<<<<<<<<<<<< * if solve is not None: * solve(TAO_(tao)) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyTao(__pyx_v_tao)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 2839, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_solve); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 2839, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_solve = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2840 * # * cdef solve = PyTao(tao).solve * if solve is not None: # <<<<<<<<<<<<<< * solve(TAO_(tao)) * else: */ __pyx_t_3 = (__pyx_v_solve != Py_None); if (__pyx_t_3) { /* "petsc4py/PETSc/libpetsc4py.pyx":2841 * cdef solve = PyTao(tao).solve * if solve is not None: * solve(TAO_(tao)) # <<<<<<<<<<<<<< * else: * TaoSolve_Python_default(tao) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_TAO_(__pyx_v_tao)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 2841, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_solve); __pyx_t_4 = __pyx_v_solve; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_1}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 2841, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2840 * # * cdef solve = PyTao(tao).solve * if solve is not None: # <<<<<<<<<<<<<< * solve(TAO_(tao)) * else: */ goto __pyx_L3; } /* "petsc4py/PETSc/libpetsc4py.pyx":2843 * solve(TAO_(tao)) * else: * TaoSolve_Python_default(tao) # <<<<<<<<<<<<<< * # * return FunctionEnd() */ /*else*/ { __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_TaoSolve_Python_default(__pyx_v_tao); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2843, __pyx_L1_error) } __pyx_L3:; /* "petsc4py/PETSc/libpetsc4py.pyx":2845 * TaoSolve_Python_default(tao) * # * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode TaoSolve_Python_default( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":2829 * return FunctionEnd() * * cdef PetscErrorCode TaoSolve_Python( # <<<<<<<<<<<<<< * PetscTAO tao, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.TaoSolve_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_solve); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":2847 * return FunctionEnd() * * cdef PetscErrorCode TaoSolve_Python_default( # <<<<<<<<<<<<<< * PetscTAO tao, * ) \ */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TaoSolve_Python_default(Tao __pyx_v_tao) { Vec __pyx_v_X; Vec __pyx_v_G; Vec __pyx_v_S; PetscReal __pyx_v_f; PetscReal __pyx_v_gnorm; PetscReal __pyx_v_step; PetscObjectState __pyx_v_ostate; PetscObjectState __pyx_v_nstate; CYTHON_UNUSED PetscInt __pyx_v_its; TaoLineSearchConvergedReason __pyx_v_lsr; PetscErrorCode __pyx_r; PetscErrorCode __pyx_t_1; int __pyx_t_2; PetscInt __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif /* "petsc4py/PETSc/libpetsc4py.pyx":2851 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"TaoSolve_Python_default") # <<<<<<<<<<<<<< * # * cdef PetscVec X = NULL, G = NULL, S = NULL */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"TaoSolve_Python_default")); /* "petsc4py/PETSc/libpetsc4py.pyx":2853 * FunctionBegin(b"TaoSolve_Python_default") * # * cdef PetscVec X = NULL, G = NULL, S = NULL # <<<<<<<<<<<<<< * CHKERR( TaoGetVecs(tao, &X, &G, &S) ) * # */ __pyx_v_X = NULL; __pyx_v_G = NULL; __pyx_v_S = NULL; /* "petsc4py/PETSc/libpetsc4py.pyx":2854 * # * cdef PetscVec X = NULL, G = NULL, S = NULL * CHKERR( TaoGetVecs(tao, &X, &G, &S) ) # <<<<<<<<<<<<<< * # * cdef PetscReal f = 0.0 */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoGetVecs(__pyx_v_tao, (&__pyx_v_X), (&__pyx_v_G), (&__pyx_v_S))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2854, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2856 * CHKERR( TaoGetVecs(tao, &X, &G, &S) ) * # * cdef PetscReal f = 0.0 # <<<<<<<<<<<<<< * cdef PetscReal gnorm = 0.0 * cdef PetscReal step = 1.0 */ __pyx_v_f = 0.0; /* "petsc4py/PETSc/libpetsc4py.pyx":2857 * # * cdef PetscReal f = 0.0 * cdef PetscReal gnorm = 0.0 # <<<<<<<<<<<<<< * cdef PetscReal step = 1.0 * # */ __pyx_v_gnorm = 0.0; /* "petsc4py/PETSc/libpetsc4py.pyx":2858 * cdef PetscReal f = 0.0 * cdef PetscReal gnorm = 0.0 * cdef PetscReal step = 1.0 # <<<<<<<<<<<<<< * # * if G != NULL: */ __pyx_v_step = 1.0; /* "petsc4py/PETSc/libpetsc4py.pyx":2860 * cdef PetscReal step = 1.0 * # * if G != NULL: # <<<<<<<<<<<<<< * CHKERR( TaoComputeObjectiveAndGradient(tao, X, &f, G) ) * CHKERR( VecNorm(G, PETSC_NORM_2, &gnorm) ) */ __pyx_t_2 = (__pyx_v_G != NULL); if (__pyx_t_2) { /* "petsc4py/PETSc/libpetsc4py.pyx":2861 * # * if G != NULL: * CHKERR( TaoComputeObjectiveAndGradient(tao, X, &f, G) ) # <<<<<<<<<<<<<< * CHKERR( VecNorm(G, PETSC_NORM_2, &gnorm) ) * else: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoComputeObjectiveAndGradient(__pyx_v_tao, __pyx_v_X, (&__pyx_v_f), __pyx_v_G)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2861, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2862 * if G != NULL: * CHKERR( TaoComputeObjectiveAndGradient(tao, X, &f, G) ) * CHKERR( VecNorm(G, PETSC_NORM_2, &gnorm) ) # <<<<<<<<<<<<<< * else: * CHKERR( TaoComputeObjective(tao, X, &f) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecNorm(__pyx_v_G, NORM_2, (&__pyx_v_gnorm))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2862, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2860 * cdef PetscReal step = 1.0 * # * if G != NULL: # <<<<<<<<<<<<<< * CHKERR( TaoComputeObjectiveAndGradient(tao, X, &f, G) ) * CHKERR( VecNorm(G, PETSC_NORM_2, &gnorm) ) */ goto __pyx_L3; } /* "petsc4py/PETSc/libpetsc4py.pyx":2864 * CHKERR( VecNorm(G, PETSC_NORM_2, &gnorm) ) * else: * CHKERR( TaoComputeObjective(tao, X, &f) ) # <<<<<<<<<<<<<< * CHKERR( TaoCheckReals(tao, f, gnorm) ) * */ /*else*/ { __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoComputeObjective(__pyx_v_tao, __pyx_v_X, (&__pyx_v_f))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2864, __pyx_L1_error) } __pyx_L3:; /* "petsc4py/PETSc/libpetsc4py.pyx":2865 * else: * CHKERR( TaoComputeObjective(tao, X, &f) ) * CHKERR( TaoCheckReals(tao, f, gnorm) ) # <<<<<<<<<<<<<< * * CHKERR( TaoLogConvergenceHistory(tao, f, gnorm, 0.0, tao.ksp_its) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoCheckReals(__pyx_v_tao, __pyx_v_f, __pyx_v_gnorm)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2865, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2867 * CHKERR( TaoCheckReals(tao, f, gnorm) ) * * CHKERR( TaoLogConvergenceHistory(tao, f, gnorm, 0.0, tao.ksp_its) ) # <<<<<<<<<<<<<< * CHKERR( TaoMonitor(tao, tao.niter, f, gnorm, 0.0, step) ) * CHKERR( TaoConverged(tao, &tao.reason) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoLogConvergenceHistory(__pyx_v_tao, __pyx_v_f, __pyx_v_gnorm, 0.0, __pyx_v_tao->ksp_its)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2867, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2868 * * CHKERR( TaoLogConvergenceHistory(tao, f, gnorm, 0.0, tao.ksp_its) ) * CHKERR( TaoMonitor(tao, tao.niter, f, gnorm, 0.0, step) ) # <<<<<<<<<<<<<< * CHKERR( TaoConverged(tao, &tao.reason) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoMonitor(__pyx_v_tao, __pyx_v_tao->niter, __pyx_v_f, __pyx_v_gnorm, 0.0, __pyx_v_step)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2868, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2869 * CHKERR( TaoLogConvergenceHistory(tao, f, gnorm, 0.0, tao.ksp_its) ) * CHKERR( TaoMonitor(tao, tao.niter, f, gnorm, 0.0, step) ) * CHKERR( TaoConverged(tao, &tao.reason) ) # <<<<<<<<<<<<<< * * cdef PetscObjectState ostate = -1 */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoConverged(__pyx_v_tao, (&__pyx_v_tao->reason))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2869, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2871 * CHKERR( TaoConverged(tao, &tao.reason) ) * * cdef PetscObjectState ostate = -1 # <<<<<<<<<<<<<< * cdef PetscObjectState nstate = -1 * cdef PetscInt its = 0 */ __pyx_v_ostate = -1; /* "petsc4py/PETSc/libpetsc4py.pyx":2872 * * cdef PetscObjectState ostate = -1 * cdef PetscObjectState nstate = -1 # <<<<<<<<<<<<<< * cdef PetscInt its = 0 * cdef PetscTAOLineSearchConvergedReason lsr = TAOLINESEARCH_SUCCESS */ __pyx_v_nstate = -1; /* "petsc4py/PETSc/libpetsc4py.pyx":2873 * cdef PetscObjectState ostate = -1 * cdef PetscObjectState nstate = -1 * cdef PetscInt its = 0 # <<<<<<<<<<<<<< * cdef PetscTAOLineSearchConvergedReason lsr = TAOLINESEARCH_SUCCESS * for its from 0 <= its < tao.max_it: */ __pyx_v_its = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2874 * cdef PetscObjectState nstate = -1 * cdef PetscInt its = 0 * cdef PetscTAOLineSearchConvergedReason lsr = TAOLINESEARCH_SUCCESS # <<<<<<<<<<<<<< * for its from 0 <= its < tao.max_it: * if tao.reason: break */ __pyx_v_lsr = TAOLINESEARCH_SUCCESS; /* "petsc4py/PETSc/libpetsc4py.pyx":2875 * cdef PetscInt its = 0 * cdef PetscTAOLineSearchConvergedReason lsr = TAOLINESEARCH_SUCCESS * for its from 0 <= its < tao.max_it: # <<<<<<<<<<<<<< * if tao.reason: break * CHKERR( PetscObjectStateGet(X, &ostate) ) */ __pyx_t_3 = __pyx_v_tao->max_it; for (__pyx_v_its = 0; __pyx_v_its < __pyx_t_3; __pyx_v_its++) { /* "petsc4py/PETSc/libpetsc4py.pyx":2876 * cdef PetscTAOLineSearchConvergedReason lsr = TAOLINESEARCH_SUCCESS * for its from 0 <= its < tao.max_it: * if tao.reason: break # <<<<<<<<<<<<<< * CHKERR( PetscObjectStateGet(X, &ostate) ) * CHKERR( TaoComputeUpdate(tao) ) */ if (__pyx_v_tao->reason) { goto __pyx_L5_break; } /* "petsc4py/PETSc/libpetsc4py.pyx":2877 * for its from 0 <= its < tao.max_it: * if tao.reason: break * CHKERR( PetscObjectStateGet(X, &ostate) ) # <<<<<<<<<<<<<< * CHKERR( TaoComputeUpdate(tao) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectStateGet(((PetscObject)__pyx_v_X), (&__pyx_v_ostate))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2877, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2878 * if tao.reason: break * CHKERR( PetscObjectStateGet(X, &ostate) ) * CHKERR( TaoComputeUpdate(tao) ) # <<<<<<<<<<<<<< * * TaoPreStep_Python(tao) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoComputeUpdate(__pyx_v_tao)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2878, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2880 * CHKERR( TaoComputeUpdate(tao) ) * * TaoPreStep_Python(tao) # <<<<<<<<<<<<<< * CHKERR( PetscObjectStateGet(X, &nstate) ) * if ostate != nstate: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_TaoPreStep_Python(__pyx_v_tao); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2880, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2881 * * TaoPreStep_Python(tao) * CHKERR( PetscObjectStateGet(X, &nstate) ) # <<<<<<<<<<<<<< * if ostate != nstate: * if G != NULL: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectStateGet(((PetscObject)__pyx_v_X), (&__pyx_v_nstate))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2881, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2882 * TaoPreStep_Python(tao) * CHKERR( PetscObjectStateGet(X, &nstate) ) * if ostate != nstate: # <<<<<<<<<<<<<< * if G != NULL: * CHKERR( TaoComputeObjectiveAndGradient(tao, X, &f, G) ) */ __pyx_t_2 = (__pyx_v_ostate != __pyx_v_nstate); if (__pyx_t_2) { /* "petsc4py/PETSc/libpetsc4py.pyx":2883 * CHKERR( PetscObjectStateGet(X, &nstate) ) * if ostate != nstate: * if G != NULL: # <<<<<<<<<<<<<< * CHKERR( TaoComputeObjectiveAndGradient(tao, X, &f, G) ) * CHKERR( VecNorm(G, PETSC_NORM_2, &gnorm) ) */ __pyx_t_2 = (__pyx_v_G != NULL); if (__pyx_t_2) { /* "petsc4py/PETSc/libpetsc4py.pyx":2884 * if ostate != nstate: * if G != NULL: * CHKERR( TaoComputeObjectiveAndGradient(tao, X, &f, G) ) # <<<<<<<<<<<<<< * CHKERR( VecNorm(G, PETSC_NORM_2, &gnorm) ) * else: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoComputeObjectiveAndGradient(__pyx_v_tao, __pyx_v_X, (&__pyx_v_f), __pyx_v_G)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2884, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2885 * if G != NULL: * CHKERR( TaoComputeObjectiveAndGradient(tao, X, &f, G) ) * CHKERR( VecNorm(G, PETSC_NORM_2, &gnorm) ) # <<<<<<<<<<<<<< * else: * CHKERR( TaoComputeObjective(tao, X, &f) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecNorm(__pyx_v_G, NORM_2, (&__pyx_v_gnorm))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2885, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2883 * CHKERR( PetscObjectStateGet(X, &nstate) ) * if ostate != nstate: * if G != NULL: # <<<<<<<<<<<<<< * CHKERR( TaoComputeObjectiveAndGradient(tao, X, &f, G) ) * CHKERR( VecNorm(G, PETSC_NORM_2, &gnorm) ) */ goto __pyx_L8; } /* "petsc4py/PETSc/libpetsc4py.pyx":2887 * CHKERR( VecNorm(G, PETSC_NORM_2, &gnorm) ) * else: * CHKERR( TaoComputeObjective(tao, X, &f) ) # <<<<<<<<<<<<<< * # * tao.ksp_its = 0 */ /*else*/ { __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoComputeObjective(__pyx_v_tao, __pyx_v_X, (&__pyx_v_f))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2887, __pyx_L1_error) } __pyx_L8:; /* "petsc4py/PETSc/libpetsc4py.pyx":2882 * TaoPreStep_Python(tao) * CHKERR( PetscObjectStateGet(X, &nstate) ) * if ostate != nstate: # <<<<<<<<<<<<<< * if G != NULL: * CHKERR( TaoComputeObjectiveAndGradient(tao, X, &f, G) ) */ } /* "petsc4py/PETSc/libpetsc4py.pyx":2889 * CHKERR( TaoComputeObjective(tao, X, &f) ) * # * tao.ksp_its = 0 # <<<<<<<<<<<<<< * TaoStep_Python(tao, X, G, S) * CHKERR( KSPGetIterationNumber(tao.ksp, &tao.ksp_its) ) */ __pyx_v_tao->ksp_its = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2890 * # * tao.ksp_its = 0 * TaoStep_Python(tao, X, G, S) # <<<<<<<<<<<<<< * CHKERR( KSPGetIterationNumber(tao.ksp, &tao.ksp_its) ) * tao.ksp_tot_its += tao.ksp_its */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_TaoStep_Python(__pyx_v_tao, __pyx_v_X, __pyx_v_G, __pyx_v_S); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2890, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2891 * tao.ksp_its = 0 * TaoStep_Python(tao, X, G, S) * CHKERR( KSPGetIterationNumber(tao.ksp, &tao.ksp_its) ) # <<<<<<<<<<<<<< * tao.ksp_tot_its += tao.ksp_its * # */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPGetIterationNumber(__pyx_v_tao->ksp, (&__pyx_v_tao->ksp_its))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2891, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2892 * TaoStep_Python(tao, X, G, S) * CHKERR( KSPGetIterationNumber(tao.ksp, &tao.ksp_its) ) * tao.ksp_tot_its += tao.ksp_its # <<<<<<<<<<<<<< * # * if G != NULL: */ __pyx_v_tao->ksp_tot_its = (__pyx_v_tao->ksp_tot_its + __pyx_v_tao->ksp_its); /* "petsc4py/PETSc/libpetsc4py.pyx":2894 * tao.ksp_tot_its += tao.ksp_its * # * if G != NULL: # <<<<<<<<<<<<<< * CHKERR( TaoApplyLineSearch(tao, &f, &step, &lsr) ) * CHKERR( VecNorm(G, PETSC_NORM_2, &gnorm) ) */ __pyx_t_2 = (__pyx_v_G != NULL); if (__pyx_t_2) { /* "petsc4py/PETSc/libpetsc4py.pyx":2895 * # * if G != NULL: * CHKERR( TaoApplyLineSearch(tao, &f, &step, &lsr) ) # <<<<<<<<<<<<<< * CHKERR( VecNorm(G, PETSC_NORM_2, &gnorm) ) * if lsr < TAOLINESEARCH_CONTINUE_ITERATING: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoApplyLineSearch(__pyx_v_tao, (&__pyx_v_f), (&__pyx_v_step), (&__pyx_v_lsr))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2895, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2896 * if G != NULL: * CHKERR( TaoApplyLineSearch(tao, &f, &step, &lsr) ) * CHKERR( VecNorm(G, PETSC_NORM_2, &gnorm) ) # <<<<<<<<<<<<<< * if lsr < TAOLINESEARCH_CONTINUE_ITERATING: * tao.reason = TAO_DIVERGED_LS_FAILURE */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecNorm(__pyx_v_G, NORM_2, (&__pyx_v_gnorm))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2896, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2897 * CHKERR( TaoApplyLineSearch(tao, &f, &step, &lsr) ) * CHKERR( VecNorm(G, PETSC_NORM_2, &gnorm) ) * if lsr < TAOLINESEARCH_CONTINUE_ITERATING: # <<<<<<<<<<<<<< * tao.reason = TAO_DIVERGED_LS_FAILURE * else: */ __pyx_t_2 = (__pyx_v_lsr < TAOLINESEARCH_CONTINUE_ITERATING); if (__pyx_t_2) { /* "petsc4py/PETSc/libpetsc4py.pyx":2898 * CHKERR( VecNorm(G, PETSC_NORM_2, &gnorm) ) * if lsr < TAOLINESEARCH_CONTINUE_ITERATING: * tao.reason = TAO_DIVERGED_LS_FAILURE # <<<<<<<<<<<<<< * else: * CHKERR( TaoComputeObjective(tao, X, &f) ) */ __pyx_v_tao->reason = TAO_DIVERGED_LS_FAILURE; /* "petsc4py/PETSc/libpetsc4py.pyx":2897 * CHKERR( TaoApplyLineSearch(tao, &f, &step, &lsr) ) * CHKERR( VecNorm(G, PETSC_NORM_2, &gnorm) ) * if lsr < TAOLINESEARCH_CONTINUE_ITERATING: # <<<<<<<<<<<<<< * tao.reason = TAO_DIVERGED_LS_FAILURE * else: */ } /* "petsc4py/PETSc/libpetsc4py.pyx":2894 * tao.ksp_tot_its += tao.ksp_its * # * if G != NULL: # <<<<<<<<<<<<<< * CHKERR( TaoApplyLineSearch(tao, &f, &step, &lsr) ) * CHKERR( VecNorm(G, PETSC_NORM_2, &gnorm) ) */ goto __pyx_L9; } /* "petsc4py/PETSc/libpetsc4py.pyx":2900 * tao.reason = TAO_DIVERGED_LS_FAILURE * else: * CHKERR( TaoComputeObjective(tao, X, &f) ) # <<<<<<<<<<<<<< * CHKERR( TaoCheckReals(tao, f, gnorm) ) * */ /*else*/ { __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoComputeObjective(__pyx_v_tao, __pyx_v_X, (&__pyx_v_f))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2900, __pyx_L1_error) } __pyx_L9:; /* "petsc4py/PETSc/libpetsc4py.pyx":2901 * else: * CHKERR( TaoComputeObjective(tao, X, &f) ) * CHKERR( TaoCheckReals(tao, f, gnorm) ) # <<<<<<<<<<<<<< * * tao.niter += 1 */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoCheckReals(__pyx_v_tao, __pyx_v_f, __pyx_v_gnorm)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2901, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2903 * CHKERR( TaoCheckReals(tao, f, gnorm) ) * * tao.niter += 1 # <<<<<<<<<<<<<< * # * TaoPostStep_Python(tao) */ __pyx_v_tao->niter = (__pyx_v_tao->niter + 1); /* "petsc4py/PETSc/libpetsc4py.pyx":2905 * tao.niter += 1 * # * TaoPostStep_Python(tao) # <<<<<<<<<<<<<< * CHKERR( TaoLogConvergenceHistory(tao, f, gnorm, 0.0, tao.ksp_its) ) * CHKERR( TaoMonitor(tao, tao.niter, f, gnorm, 0.0, step) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_TaoPostStep_Python(__pyx_v_tao); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2905, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2906 * # * TaoPostStep_Python(tao) * CHKERR( TaoLogConvergenceHistory(tao, f, gnorm, 0.0, tao.ksp_its) ) # <<<<<<<<<<<<<< * CHKERR( TaoMonitor(tao, tao.niter, f, gnorm, 0.0, step) ) * CHKERR( TaoConverged(tao, &tao.reason) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoLogConvergenceHistory(__pyx_v_tao, __pyx_v_f, __pyx_v_gnorm, 0.0, __pyx_v_tao->ksp_its)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2906, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2907 * TaoPostStep_Python(tao) * CHKERR( TaoLogConvergenceHistory(tao, f, gnorm, 0.0, tao.ksp_its) ) * CHKERR( TaoMonitor(tao, tao.niter, f, gnorm, 0.0, step) ) # <<<<<<<<<<<<<< * CHKERR( TaoConverged(tao, &tao.reason) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoMonitor(__pyx_v_tao, __pyx_v_tao->niter, __pyx_v_f, __pyx_v_gnorm, 0.0, __pyx_v_step)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2907, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2908 * CHKERR( TaoLogConvergenceHistory(tao, f, gnorm, 0.0, tao.ksp_its) ) * CHKERR( TaoMonitor(tao, tao.niter, f, gnorm, 0.0, step) ) * CHKERR( TaoConverged(tao, &tao.reason) ) # <<<<<<<<<<<<<< * * if tao.niter == tao.max_it: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoConverged(__pyx_v_tao, (&__pyx_v_tao->reason))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2908, __pyx_L1_error) } __pyx_L5_break:; /* "petsc4py/PETSc/libpetsc4py.pyx":2910 * CHKERR( TaoConverged(tao, &tao.reason) ) * * if tao.niter == tao.max_it: # <<<<<<<<<<<<<< * if tao.reason <= 0: * tao.reason = TAO_DIVERGED_MAXITS */ __pyx_t_2 = (__pyx_v_tao->niter == __pyx_v_tao->max_it); if (__pyx_t_2) { /* "petsc4py/PETSc/libpetsc4py.pyx":2911 * * if tao.niter == tao.max_it: * if tao.reason <= 0: # <<<<<<<<<<<<<< * tao.reason = TAO_DIVERGED_MAXITS * # */ __pyx_t_2 = (__pyx_v_tao->reason <= 0); if (__pyx_t_2) { /* "petsc4py/PETSc/libpetsc4py.pyx":2912 * if tao.niter == tao.max_it: * if tao.reason <= 0: * tao.reason = TAO_DIVERGED_MAXITS # <<<<<<<<<<<<<< * # * return FunctionEnd() */ __pyx_v_tao->reason = TAO_DIVERGED_MAXITS; /* "petsc4py/PETSc/libpetsc4py.pyx":2911 * * if tao.niter == tao.max_it: * if tao.reason <= 0: # <<<<<<<<<<<<<< * tao.reason = TAO_DIVERGED_MAXITS * # */ } /* "petsc4py/PETSc/libpetsc4py.pyx":2910 * CHKERR( TaoConverged(tao, &tao.reason) ) * * if tao.niter == tao.max_it: # <<<<<<<<<<<<<< * if tao.reason <= 0: * tao.reason = TAO_DIVERGED_MAXITS */ } /* "petsc4py/PETSc/libpetsc4py.pyx":2914 * tao.reason = TAO_DIVERGED_MAXITS * # * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode TaoStep_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":2847 * return FunctionEnd() * * cdef PetscErrorCode TaoSolve_Python_default( # <<<<<<<<<<<<<< * PetscTAO tao, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TaoSolve_Python_default", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":2916 * return FunctionEnd() * * cdef PetscErrorCode TaoStep_Python( # <<<<<<<<<<<<<< * PetscTAO tao, * PetscVec X, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TaoStep_Python(Tao __pyx_v_tao, Vec __pyx_v_X, Vec __pyx_v_G, Vec __pyx_v_S) { PyObject *__pyx_v_step = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; PetscErrorCode __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TaoStep_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":2923 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"TaoStep_Python") # <<<<<<<<<<<<<< * cdef step = PyTao(tao).step * if step is not None: */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"TaoStep_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":2924 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"TaoStep_Python") * cdef step = PyTao(tao).step # <<<<<<<<<<<<<< * if step is not None: * step(TAO_(tao), Vec_(X), Vec_(G) if G != NULL else None, Vec_(S) if S != NULL else None) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyTao(__pyx_v_tao)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 2924, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_step); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 2924, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_step = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2925 * FunctionBegin(b"TaoStep_Python") * cdef step = PyTao(tao).step * if step is not None: # <<<<<<<<<<<<<< * step(TAO_(tao), Vec_(X), Vec_(G) if G != NULL else None, Vec_(S) if S != NULL else None) * else: */ __pyx_t_3 = (__pyx_v_step != Py_None); if (__pyx_t_3) { /* "petsc4py/PETSc/libpetsc4py.pyx":2926 * cdef step = PyTao(tao).step * if step is not None: * step(TAO_(tao), Vec_(X), Vec_(G) if G != NULL else None, Vec_(S) if S != NULL else None) # <<<<<<<<<<<<<< * else: * # TaoStep_Python_default(tao,X,G,S) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_TAO_(__pyx_v_tao)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 2926, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_X)); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 2926, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = (__pyx_v_G != NULL); if (__pyx_t_3) { __pyx_t_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_G)); if (unlikely(!__pyx_t_6)) __PYX_ERR(11, 2926, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __pyx_t_6; __pyx_t_6 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_5 = Py_None; } __pyx_t_3 = (__pyx_v_S != NULL); if (__pyx_t_3) { __pyx_t_7 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_S)); if (unlikely(!__pyx_t_7)) __PYX_ERR(11, 2926, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = __pyx_t_7; __pyx_t_7 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_6 = Py_None; } __Pyx_INCREF(__pyx_v_step); __pyx_t_7 = __pyx_v_step; __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_8, __pyx_t_1, __pyx_t_4, __pyx_t_5, __pyx_t_6}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 4+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 2926, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2925 * FunctionBegin(b"TaoStep_Python") * cdef step = PyTao(tao).step * if step is not None: # <<<<<<<<<<<<<< * step(TAO_(tao), Vec_(X), Vec_(G) if G != NULL else None, Vec_(S) if S != NULL else None) * else: */ goto __pyx_L3; } /* "petsc4py/PETSc/libpetsc4py.pyx":2929 * else: * # TaoStep_Python_default(tao,X,G,S) * CHKERR( TaoComputeGradient(tao, X, S) ) # <<<<<<<<<<<<<< * CHKERR( VecCopy(G, S) ) * CHKERR( VecScale(S, -1.0) ) */ /*else*/ { __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoComputeGradient(__pyx_v_tao, __pyx_v_X, __pyx_v_S)); if (unlikely(__pyx_t_10 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2929, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2930 * # TaoStep_Python_default(tao,X,G,S) * CHKERR( TaoComputeGradient(tao, X, S) ) * CHKERR( VecCopy(G, S) ) # <<<<<<<<<<<<<< * CHKERR( VecScale(S, -1.0) ) * return FunctionEnd() */ __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCopy(__pyx_v_G, __pyx_v_S)); if (unlikely(__pyx_t_10 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2930, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2931 * CHKERR( TaoComputeGradient(tao, X, S) ) * CHKERR( VecCopy(G, S) ) * CHKERR( VecScale(S, -1.0) ) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecScale(__pyx_v_S, -1.0)); if (unlikely(__pyx_t_10 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2931, __pyx_L1_error) } __pyx_L3:; /* "petsc4py/PETSc/libpetsc4py.pyx":2932 * CHKERR( VecCopy(G, S) ) * CHKERR( VecScale(S, -1.0) ) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode TaoPreStep_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":2916 * return FunctionEnd() * * cdef PetscErrorCode TaoStep_Python( # <<<<<<<<<<<<<< * PetscTAO tao, * PetscVec X, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("petsc4py.PETSc.TaoStep_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_step); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":2934 * return FunctionEnd() * * cdef PetscErrorCode TaoPreStep_Python( # <<<<<<<<<<<<<< * PetscTAO tao, * ) \ */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TaoPreStep_Python(Tao __pyx_v_tao) { PyObject *__pyx_v_preStep = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TaoPreStep_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":2938 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"TaoPreStep_Python") # <<<<<<<<<<<<<< * cdef preStep = PyTao(tao).preStep * if preStep is not None: */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"TaoPreStep_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":2939 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"TaoPreStep_Python") * cdef preStep = PyTao(tao).preStep # <<<<<<<<<<<<<< * if preStep is not None: * preStep(TAO_(tao)) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyTao(__pyx_v_tao)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 2939, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_preStep); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 2939, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_preStep = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2940 * FunctionBegin(b"TaoPreStep_Python") * cdef preStep = PyTao(tao).preStep * if preStep is not None: # <<<<<<<<<<<<<< * preStep(TAO_(tao)) * return FunctionEnd() */ __pyx_t_3 = (__pyx_v_preStep != Py_None); if (__pyx_t_3) { /* "petsc4py/PETSc/libpetsc4py.pyx":2941 * cdef preStep = PyTao(tao).preStep * if preStep is not None: * preStep(TAO_(tao)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_TAO_(__pyx_v_tao)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 2941, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_preStep); __pyx_t_4 = __pyx_v_preStep; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_1}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 2941, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2940 * FunctionBegin(b"TaoPreStep_Python") * cdef preStep = PyTao(tao).preStep * if preStep is not None: # <<<<<<<<<<<<<< * preStep(TAO_(tao)) * return FunctionEnd() */ } /* "petsc4py/PETSc/libpetsc4py.pyx":2942 * if preStep is not None: * preStep(TAO_(tao)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode TaoPostStep_Python( */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":2934 * return FunctionEnd() * * cdef PetscErrorCode TaoPreStep_Python( # <<<<<<<<<<<<<< * PetscTAO tao, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.TaoPreStep_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_preStep); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":2944 * return FunctionEnd() * * cdef PetscErrorCode TaoPostStep_Python( # <<<<<<<<<<<<<< * PetscTAO tao, * ) \ */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TaoPostStep_Python(Tao __pyx_v_tao) { PyObject *__pyx_v_postStep = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TaoPostStep_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":2948 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"TaoPostStep_Python") # <<<<<<<<<<<<<< * cdef postStep = PyTao(tao).postStep * if postStep is not None: */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"TaoPostStep_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":2949 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"TaoPostStep_Python") * cdef postStep = PyTao(tao).postStep # <<<<<<<<<<<<<< * if postStep is not None: * postStep(TAO_(tao)) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyTao(__pyx_v_tao)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 2949, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_postStep); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 2949, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_postStep = __pyx_t_2; __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2950 * FunctionBegin(b"TaoPostStep_Python") * cdef postStep = PyTao(tao).postStep * if postStep is not None: # <<<<<<<<<<<<<< * postStep(TAO_(tao)) * return FunctionEnd() */ __pyx_t_3 = (__pyx_v_postStep != Py_None); if (__pyx_t_3) { /* "petsc4py/PETSc/libpetsc4py.pyx":2951 * cdef postStep = PyTao(tao).postStep * if postStep is not None: * postStep(TAO_(tao)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_TAO_(__pyx_v_tao)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 2951, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_postStep); __pyx_t_4 = __pyx_v_postStep; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_1}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 2951, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2950 * FunctionBegin(b"TaoPostStep_Python") * cdef postStep = PyTao(tao).postStep * if postStep is not None: # <<<<<<<<<<<<<< * postStep(TAO_(tao)) * return FunctionEnd() */ } /* "petsc4py/PETSc/libpetsc4py.pyx":2952 * if postStep is not None: * postStep(TAO_(tao)) * return FunctionEnd() # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":2944 * return FunctionEnd() * * cdef PetscErrorCode TaoPostStep_Python( # <<<<<<<<<<<<<< * PetscTAO tao, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.TaoPostStep_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_postStep); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":2956 * # -------------------------------------------------------------------- * * cdef PetscErrorCode PetscPythonMonitorSet_Python( # <<<<<<<<<<<<<< * PetscObject obj_p, * const char *url_p, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PetscPythonMonitorSet_Python(PetscObject __pyx_v_obj_p, char const *__pyx_v_url_p) { PetscClassId __pyx_v_classid; PyTypeObject *__pyx_v_klass = 0; struct PyPetscObjectObject *__pyx_v_ob = 0; PyObject *__pyx_v_url = 0; PyObject *__pyx_v_path = NULL; PyObject *__pyx_v_names = NULL; PyObject *__pyx_v_module = NULL; PyObject *__pyx_v_attr = NULL; PyObject *__pyx_v_monitor = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscErrorCode __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); int __pyx_t_8; Py_ssize_t __pyx_t_9; PyObject *(*__pyx_t_10)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("PetscPythonMonitorSet_Python", 0); /* "petsc4py/PETSc/libpetsc4py.pyx":2961 * ) \ * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"PetscPythonMonitorSet_Python") # <<<<<<<<<<<<<< * assert obj_p != NULL * assert url_p != NULL */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"PetscPythonMonitorSet_Python")); /* "petsc4py/PETSc/libpetsc4py.pyx":2962 * except PETSC_ERR_PYTHON with gil: * FunctionBegin(b"PetscPythonMonitorSet_Python") * assert obj_p != NULL # <<<<<<<<<<<<<< * assert url_p != NULL * assert url_p[0] != 0 */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_1 = (__pyx_v_obj_p != NULL); if (unlikely(!__pyx_t_1)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(11, 2962, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(11, 2962, __pyx_L1_error) #endif /* "petsc4py/PETSc/libpetsc4py.pyx":2963 * FunctionBegin(b"PetscPythonMonitorSet_Python") * assert obj_p != NULL * assert url_p != NULL # <<<<<<<<<<<<<< * assert url_p[0] != 0 * # */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_1 = (__pyx_v_url_p != NULL); if (unlikely(!__pyx_t_1)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(11, 2963, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(11, 2963, __pyx_L1_error) #endif /* "petsc4py/PETSc/libpetsc4py.pyx":2964 * assert obj_p != NULL * assert url_p != NULL * assert url_p[0] != 0 # <<<<<<<<<<<<<< * # * cdef PetscClassId classid = 0 */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_1 = ((__pyx_v_url_p[0]) != 0); if (unlikely(!__pyx_t_1)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(11, 2964, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(11, 2964, __pyx_L1_error) #endif /* "petsc4py/PETSc/libpetsc4py.pyx":2966 * assert url_p[0] != 0 * # * cdef PetscClassId classid = 0 # <<<<<<<<<<<<<< * CHKERR( PetscObjectGetClassId(obj_p, &classid) ) * cdef type klass = PyPetscType_Lookup(classid) */ __pyx_v_classid = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2967 * # * cdef PetscClassId classid = 0 * CHKERR( PetscObjectGetClassId(obj_p, &classid) ) # <<<<<<<<<<<<<< * cdef type klass = PyPetscType_Lookup(classid) * cdef Object ob = klass() */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectGetClassId(__pyx_v_obj_p, (&__pyx_v_classid))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 2967, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":2968 * cdef PetscClassId classid = 0 * CHKERR( PetscObjectGetClassId(obj_p, &classid) ) * cdef type klass = PyPetscType_Lookup(classid) # <<<<<<<<<<<<<< * cdef Object ob = klass() * ob.obj[0] = newRef(obj_p) */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyPetscType_Lookup(__pyx_v_classid)); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 2968, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_klass = ((PyTypeObject*)__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2969 * CHKERR( PetscObjectGetClassId(obj_p, &classid) ) * cdef type klass = PyPetscType_Lookup(classid) * cdef Object ob = klass() # <<<<<<<<<<<<<< * ob.obj[0] = newRef(obj_p) * # */ __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_v_klass)); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 2969, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_8petsc4py_5PETSc_Object))))) __PYX_ERR(11, 2969, __pyx_L1_error) __pyx_v_ob = ((struct PyPetscObjectObject *)__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2970 * cdef type klass = PyPetscType_Lookup(classid) * cdef Object ob = klass() * ob.obj[0] = newRef(obj_p) # <<<<<<<<<<<<<< * # * cdef url = bytes2str(url_p) */ (__pyx_v_ob->obj[0]) = __pyx_f_8petsc4py_5PETSc_newRef(__pyx_v_obj_p); /* "petsc4py/PETSc/libpetsc4py.pyx":2972 * ob.obj[0] = newRef(obj_p) * # * cdef url = bytes2str(url_p) # <<<<<<<<<<<<<< * if ':' in url: * path, names = parse_url(url) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_url_p); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 2972, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_url = __pyx_t_3; __pyx_t_3 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2973 * # * cdef url = bytes2str(url_p) * if ':' in url: # <<<<<<<<<<<<<< * path, names = parse_url(url) * else: */ __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_kp_s__11, __pyx_v_url, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(11, 2973, __pyx_L1_error) if (__pyx_t_1) { /* "petsc4py/PETSc/libpetsc4py.pyx":2974 * cdef url = bytes2str(url_p) * if ':' in url: * path, names = parse_url(url) # <<<<<<<<<<<<<< * else: * path, names = url, 'monitor' */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_parse_url(__pyx_v_url); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 2974, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { PyObject* sequence = __pyx_t_3; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(11, 2974, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_4 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 2974, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 2974, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(11, 2974, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); index = 0; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(11, 2974, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L5_unpacking_done; __pyx_L4_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(11, 2974, __pyx_L1_error) __pyx_L5_unpacking_done:; } __pyx_v_path = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_names = __pyx_t_5; __pyx_t_5 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2973 * # * cdef url = bytes2str(url_p) * if ':' in url: # <<<<<<<<<<<<<< * path, names = parse_url(url) * else: */ goto __pyx_L3; } /* "petsc4py/PETSc/libpetsc4py.pyx":2976 * path, names = parse_url(url) * else: * path, names = url, 'monitor' # <<<<<<<<<<<<<< * module = load_module(path) * for attr in names.split(','): */ /*else*/ { __pyx_t_3 = __pyx_v_url; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = __pyx_n_s_monitor; __Pyx_INCREF(__pyx_t_5); __pyx_v_path = __pyx_t_3; __pyx_t_3 = 0; __pyx_v_names = __pyx_t_5; __pyx_t_5 = 0; } __pyx_L3:; /* "petsc4py/PETSc/libpetsc4py.pyx":2977 * else: * path, names = url, 'monitor' * module = load_module(path) # <<<<<<<<<<<<<< * for attr in names.split(','): * monitor = getattr(module, attr) */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_load_module(__pyx_v_path); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 2977, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_v_module = __pyx_t_5; __pyx_t_5 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2978 * path, names = url, 'monitor' * module = load_module(path) * for attr in names.split(','): # <<<<<<<<<<<<<< * monitor = getattr(module, attr) * if isinstance(monitor, type): */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_names, __pyx_n_s_split); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 2978, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_s__14}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 2978, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) { __pyx_t_3 = __pyx_t_5; __Pyx_INCREF(__pyx_t_3); __pyx_t_9 = 0; __pyx_t_10 = NULL; } else { __pyx_t_9 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 2978, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_10 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(11, 2978, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; for (;;) { if (likely(!__pyx_t_10)) { if (likely(PyList_CheckExact(__pyx_t_3))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(11, 2978, __pyx_L1_error) #endif if (__pyx_t_9 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_9); __Pyx_INCREF(__pyx_t_5); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(11, 2978, __pyx_L1_error) #else __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 2978, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(11, 2978, __pyx_L1_error) #endif if (__pyx_t_9 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_9); __Pyx_INCREF(__pyx_t_5); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(11, 2978, __pyx_L1_error) #else __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 2978, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } } else { __pyx_t_5 = __pyx_t_10(__pyx_t_3); if (unlikely(!__pyx_t_5)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(11, 2978, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_5); } __Pyx_XDECREF_SET(__pyx_v_attr, __pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2979 * module = load_module(path) * for attr in names.split(','): * monitor = getattr(module, attr) # <<<<<<<<<<<<<< * if isinstance(monitor, type): * monitor = monitor(ob) */ __pyx_t_5 = __Pyx_GetAttr(__pyx_v_module, __pyx_v_attr); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 2979, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_monitor, __pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2980 * for attr in names.split(','): * monitor = getattr(module, attr) * if isinstance(monitor, type): # <<<<<<<<<<<<<< * monitor = monitor(ob) * ob.setMonitor(monitor) */ __pyx_t_1 = PyType_Check(__pyx_v_monitor); if (__pyx_t_1) { /* "petsc4py/PETSc/libpetsc4py.pyx":2981 * monitor = getattr(module, attr) * if isinstance(monitor, type): * monitor = monitor(ob) # <<<<<<<<<<<<<< * ob.setMonitor(monitor) * # */ __Pyx_INCREF(__pyx_v_monitor); __pyx_t_4 = __pyx_v_monitor; __pyx_t_6 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, ((PyObject *)__pyx_v_ob)}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 2981, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF_SET(__pyx_v_monitor, __pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2980 * for attr in names.split(','): * monitor = getattr(module, attr) * if isinstance(monitor, type): # <<<<<<<<<<<<<< * monitor = monitor(ob) * ob.setMonitor(monitor) */ } /* "petsc4py/PETSc/libpetsc4py.pyx":2982 * if isinstance(monitor, type): * monitor = monitor(ob) * ob.setMonitor(monitor) # <<<<<<<<<<<<<< * # * return FunctionEnd() */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ob), __pyx_n_s_setMonitor); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 2982, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_monitor}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 2982, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2978 * path, names = url, 'monitor' * module = load_module(path) * for attr in names.split(','): # <<<<<<<<<<<<<< * monitor = getattr(module, attr) * if isinstance(monitor, type): */ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":2984 * ob.setMonitor(monitor) * # * return FunctionEnd() # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":2956 * # -------------------------------------------------------------------- * * cdef PetscErrorCode PetscPythonMonitorSet_Python( # <<<<<<<<<<<<<< * PetscObject obj_p, * const char *url_p, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.PetscPythonMonitorSet_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_klass); __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_XDECREF(__pyx_v_url); __Pyx_XDECREF(__pyx_v_path); __Pyx_XDECREF(__pyx_v_names); __Pyx_XDECREF(__pyx_v_module); __Pyx_XDECREF(__pyx_v_attr); __Pyx_XDECREF(__pyx_v_monitor); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/libpetsc4py.pyx":3008 * * * cdef public PetscErrorCode PetscPythonRegisterAll() except PETSC_ERR_PYTHON: # <<<<<<<<<<<<<< * FunctionBegin(b"PetscPythonRegisterAll") * */ PetscErrorCode PetscPythonRegisterAll(void) { PetscErrorCode __pyx_r; PetscErrorCode __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":3009 * * cdef public PetscErrorCode PetscPythonRegisterAll() except PETSC_ERR_PYTHON: * FunctionBegin(b"PetscPythonRegisterAll") # <<<<<<<<<<<<<< * * # Python subtypes */ __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"PetscPythonRegisterAll")); /* "petsc4py/PETSc/libpetsc4py.pyx":3012 * * # Python subtypes * CHKERR( MatRegister ( MATPYTHON, MatCreate_Python ) ) # <<<<<<<<<<<<<< * CHKERR( PCRegister ( PCPYTHON, PCCreate_Python ) ) * CHKERR( KSPRegister ( KSPPYTHON, KSPCreate_Python ) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatRegister(MATPYTHON, __pyx_f_8petsc4py_5PETSc_MatCreate_Python)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 3012, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":3013 * # Python subtypes * CHKERR( MatRegister ( MATPYTHON, MatCreate_Python ) ) * CHKERR( PCRegister ( PCPYTHON, PCCreate_Python ) ) # <<<<<<<<<<<<<< * CHKERR( KSPRegister ( KSPPYTHON, KSPCreate_Python ) ) * CHKERR( SNESRegister( SNESPYTHON, SNESCreate_Python ) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCRegister(PCPYTHON, __pyx_f_8petsc4py_5PETSc_PCCreate_Python)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 3013, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":3014 * CHKERR( MatRegister ( MATPYTHON, MatCreate_Python ) ) * CHKERR( PCRegister ( PCPYTHON, PCCreate_Python ) ) * CHKERR( KSPRegister ( KSPPYTHON, KSPCreate_Python ) ) # <<<<<<<<<<<<<< * CHKERR( SNESRegister( SNESPYTHON, SNESCreate_Python ) ) * CHKERR( TSRegister ( TSPYTHON, TSCreate_Python ) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPRegister(KSPPYTHON, __pyx_f_8petsc4py_5PETSc_KSPCreate_Python)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 3014, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":3015 * CHKERR( PCRegister ( PCPYTHON, PCCreate_Python ) ) * CHKERR( KSPRegister ( KSPPYTHON, KSPCreate_Python ) ) * CHKERR( SNESRegister( SNESPYTHON, SNESCreate_Python ) ) # <<<<<<<<<<<<<< * CHKERR( TSRegister ( TSPYTHON, TSCreate_Python ) ) * CHKERR( TaoRegister ( TAOPYTHON, TaoCreate_Python ) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESRegister(SNESPYTHON, __pyx_f_8petsc4py_5PETSc_SNESCreate_Python)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 3015, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":3016 * CHKERR( KSPRegister ( KSPPYTHON, KSPCreate_Python ) ) * CHKERR( SNESRegister( SNESPYTHON, SNESCreate_Python ) ) * CHKERR( TSRegister ( TSPYTHON, TSCreate_Python ) ) # <<<<<<<<<<<<<< * CHKERR( TaoRegister ( TAOPYTHON, TaoCreate_Python ) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSRegister(TSPYTHON, __pyx_f_8petsc4py_5PETSc_TSCreate_Python)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 3016, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":3017 * CHKERR( SNESRegister( SNESPYTHON, SNESCreate_Python ) ) * CHKERR( TSRegister ( TSPYTHON, TSCreate_Python ) ) * CHKERR( TaoRegister ( TAOPYTHON, TaoCreate_Python ) ) # <<<<<<<<<<<<<< * * # Python monitors */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoRegister(TAOPYTHON, __pyx_f_8petsc4py_5PETSc_TaoCreate_Python)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 3017, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":3021 * # Python monitors * global PetscPythonMonitorSet_C * PetscPythonMonitorSet_C = PetscPythonMonitorSet_Python # <<<<<<<<<<<<<< * * return FunctionEnd() */ PetscPythonMonitorSet_C = __pyx_f_8petsc4py_5PETSc_PetscPythonMonitorSet_Python; /* "petsc4py/PETSc/libpetsc4py.pyx":3023 * PetscPythonMonitorSet_C = PetscPythonMonitorSet_Python * * return FunctionEnd() # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd(); goto __pyx_L0; /* "petsc4py/PETSc/libpetsc4py.pyx":3008 * * * cdef public PetscErrorCode PetscPythonRegisterAll() except PETSC_ERR_PYTHON: # <<<<<<<<<<<<<< * FunctionBegin(b"PetscPythonRegisterAll") * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PetscPythonRegisterAll", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/PETSc.pyx":271 * cdef object tracebacklist = [] * * cdef PetscErrorCode traceback( # <<<<<<<<<<<<<< * MPI_Comm comm, * int line, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_traceback(MPI_Comm __pyx_v_comm, int __pyx_v_line, char const *__pyx_v_cfunc, char const *__pyx_v_cfile, PetscErrorCode __pyx_v_n, PetscErrorType __pyx_v_p, char const *__pyx_v_mess, void *__pyx_v_ctx) { PetscLogDouble __pyx_v_mem; PetscLogDouble __pyx_v_rss; char const *__pyx_v_text; PyObject *__pyx_v_tbl = 0; PyObject *__pyx_v_fun = 0; PyObject *__pyx_v_fnm = 0; PyObject *__pyx_v_m = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("traceback", 0); /* "petsc4py/PETSc/PETSc.pyx":281 * void *ctx, * ) except (-1) with gil: * cdef PetscLogDouble mem=0 # <<<<<<<<<<<<<< * cdef PetscLogDouble rss=0 * cdef const char *text=NULL */ __pyx_v_mem = 0.0; /* "petsc4py/PETSc/PETSc.pyx":282 * ) except (-1) with gil: * cdef PetscLogDouble mem=0 * cdef PetscLogDouble rss=0 # <<<<<<<<<<<<<< * cdef const char *text=NULL * global tracebacklist */ __pyx_v_rss = 0.0; /* "petsc4py/PETSc/PETSc.pyx":283 * cdef PetscLogDouble mem=0 * cdef PetscLogDouble rss=0 * cdef const char *text=NULL # <<<<<<<<<<<<<< * global tracebacklist * cdef object tbl = tracebacklist */ __pyx_v_text = NULL; /* "petsc4py/PETSc/PETSc.pyx":285 * cdef const char *text=NULL * global tracebacklist * cdef object tbl = tracebacklist # <<<<<<<<<<<<<< * cdef object fun = bytes2str(cfunc) * cdef object fnm = bytes2str(cfile) */ __Pyx_INCREF(__pyx_v_8petsc4py_5PETSc_tracebacklist); __pyx_v_tbl = __pyx_v_8petsc4py_5PETSc_tracebacklist; /* "petsc4py/PETSc/PETSc.pyx":286 * global tracebacklist * cdef object tbl = tracebacklist * cdef object fun = bytes2str(cfunc) # <<<<<<<<<<<<<< * cdef object fnm = bytes2str(cfile) * cdef object m = "%s() at %s:%d" % (fun, fnm, line) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cfunc); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_fun = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/PETSc.pyx":287 * cdef object tbl = tracebacklist * cdef object fun = bytes2str(cfunc) * cdef object fnm = bytes2str(cfile) # <<<<<<<<<<<<<< * cdef object m = "%s() at %s:%d" % (fun, fnm, line) * PyList_Insert(tbl, 0, m) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cfile); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_fnm = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/PETSc.pyx":288 * cdef object fun = bytes2str(cfunc) * cdef object fnm = bytes2str(cfile) * cdef object m = "%s() at %s:%d" % (fun, fnm, line) # <<<<<<<<<<<<<< * PyList_Insert(tbl, 0, m) * if p != PETSC_ERROR_INITIAL: */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_line); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_fun); __Pyx_GIVEREF(__pyx_v_fun); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_fun)) __PYX_ERR(12, 288, __pyx_L1_error); __Pyx_INCREF(__pyx_v_fnm); __Pyx_GIVEREF(__pyx_v_fnm); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_fnm)) __PYX_ERR(12, 288, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1)) __PYX_ERR(12, 288, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_s_at_s_d, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_m = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/PETSc.pyx":289 * cdef object fnm = bytes2str(cfile) * cdef object m = "%s() at %s:%d" % (fun, fnm, line) * PyList_Insert(tbl, 0, m) # <<<<<<<<<<<<<< * if p != PETSC_ERROR_INITIAL: * return n */ __pyx_t_3 = PyList_Insert(__pyx_v_tbl, 0, __pyx_v_m); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(12, 289, __pyx_L1_error) /* "petsc4py/PETSc/PETSc.pyx":290 * cdef object m = "%s() at %s:%d" % (fun, fnm, line) * PyList_Insert(tbl, 0, m) * if p != PETSC_ERROR_INITIAL: # <<<<<<<<<<<<<< * return n * # */ __pyx_t_4 = (__pyx_v_p != PETSC_ERROR_INITIAL); if (__pyx_t_4) { /* "petsc4py/PETSc/PETSc.pyx":291 * PyList_Insert(tbl, 0, m) * if p != PETSC_ERROR_INITIAL: * return n # <<<<<<<<<<<<<< * # * del tbl[1:] # clear any previous stuff */ __pyx_r = __pyx_v_n; goto __pyx_L0; /* "petsc4py/PETSc/PETSc.pyx":290 * cdef object m = "%s() at %s:%d" % (fun, fnm, line) * PyList_Insert(tbl, 0, m) * if p != PETSC_ERROR_INITIAL: # <<<<<<<<<<<<<< * return n * # */ } /* "petsc4py/PETSc/PETSc.pyx":293 * return n * # * del tbl[1:] # clear any previous stuff # <<<<<<<<<<<<<< * if n == PETSC_ERR_MEM: # special case * PetscMallocGetCurrentUsage(&mem) */ if (__Pyx_PyObject_DelSlice(__pyx_v_tbl, 1, 0, NULL, NULL, &__pyx_slice__20, 1, 0, 1) < 0) __PYX_ERR(12, 293, __pyx_L1_error) /* "petsc4py/PETSc/PETSc.pyx":294 * # * del tbl[1:] # clear any previous stuff * if n == PETSC_ERR_MEM: # special case # <<<<<<<<<<<<<< * PetscMallocGetCurrentUsage(&mem) * PetscMemoryGetCurrentUsage(&rss) */ __pyx_t_4 = (__pyx_v_n == PETSC_ERR_MEM); if (__pyx_t_4) { /* "petsc4py/PETSc/PETSc.pyx":295 * del tbl[1:] # clear any previous stuff * if n == PETSC_ERR_MEM: # special case * PetscMallocGetCurrentUsage(&mem) # <<<<<<<<<<<<<< * PetscMemoryGetCurrentUsage(&rss) * m = ( */ (void)(PetscMallocGetCurrentUsage((&__pyx_v_mem))); /* "petsc4py/PETSc/PETSc.pyx":296 * if n == PETSC_ERR_MEM: # special case * PetscMallocGetCurrentUsage(&mem) * PetscMemoryGetCurrentUsage(&rss) # <<<<<<<<<<<<<< * m = ( * "Out of memory. " */ (void)(PetscMemoryGetCurrentUsage((&__pyx_v_rss))); /* "petsc4py/PETSc/PETSc.pyx":301 * "Allocated: %d, " * "Used by process: %d" * ) % (mem, rss) # <<<<<<<<<<<<<< * PyList_Append(tbl, m) * else: */ __pyx_t_1 = PyFloat_FromDouble(__pyx_v_mem); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyFloat_FromDouble(__pyx_v_rss); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1)) __PYX_ERR(12, 301, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2)) __PYX_ERR(12, 301, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_memory_Allocated_d_Used_b, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_m, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/PETSc.pyx":302 * "Used by process: %d" * ) % (mem, rss) * PyList_Append(tbl, m) # <<<<<<<<<<<<<< * else: * PetscErrorMessage(n, &text, NULL) */ __pyx_t_3 = PyList_Append(__pyx_v_tbl, __pyx_v_m); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(12, 302, __pyx_L1_error) /* "petsc4py/PETSc/PETSc.pyx":294 * # * del tbl[1:] # clear any previous stuff * if n == PETSC_ERR_MEM: # special case # <<<<<<<<<<<<<< * PetscMallocGetCurrentUsage(&mem) * PetscMemoryGetCurrentUsage(&rss) */ goto __pyx_L4; } /* "petsc4py/PETSc/PETSc.pyx":304 * PyList_Append(tbl, m) * else: * PetscErrorMessage(n, &text, NULL) # <<<<<<<<<<<<<< * if text != NULL: PyList_Append(tbl, bytes2str(text)) * if mess != NULL: PyList_Append(tbl, bytes2str(mess)) */ /*else*/ { (void)(PetscErrorMessage(__pyx_v_n, (&__pyx_v_text), NULL)); } __pyx_L4:; /* "petsc4py/PETSc/PETSc.pyx":305 * else: * PetscErrorMessage(n, &text, NULL) * if text != NULL: PyList_Append(tbl, bytes2str(text)) # <<<<<<<<<<<<<< * if mess != NULL: PyList_Append(tbl, bytes2str(mess)) * comm # unused */ __pyx_t_4 = (__pyx_v_text != NULL); if (__pyx_t_4) { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_text); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyList_Append(__pyx_v_tbl, __pyx_t_2); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(12, 305, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } /* "petsc4py/PETSc/PETSc.pyx":306 * PetscErrorMessage(n, &text, NULL) * if text != NULL: PyList_Append(tbl, bytes2str(text)) * if mess != NULL: PyList_Append(tbl, bytes2str(mess)) # <<<<<<<<<<<<<< * comm # unused * ctx # unused */ __pyx_t_4 = (__pyx_v_mess != NULL); if (__pyx_t_4) { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_mess); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyList_Append(__pyx_v_tbl, __pyx_t_2); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(12, 306, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } /* "petsc4py/PETSc/PETSc.pyx":307 * if text != NULL: PyList_Append(tbl, bytes2str(text)) * if mess != NULL: PyList_Append(tbl, bytes2str(mess)) * comm # unused # <<<<<<<<<<<<<< * ctx # unused * return n */ ((void)__pyx_v_comm); /* "petsc4py/PETSc/PETSc.pyx":308 * if mess != NULL: PyList_Append(tbl, bytes2str(mess)) * comm # unused * ctx # unused # <<<<<<<<<<<<<< * return n * */ ((void)__pyx_v_ctx); /* "petsc4py/PETSc/PETSc.pyx":309 * comm # unused * ctx # unused * return n # <<<<<<<<<<<<<< * * cdef PetscErrorCode PetscPythonErrorHandler( */ __pyx_r = __pyx_v_n; goto __pyx_L0; /* "petsc4py/PETSc/PETSc.pyx":271 * cdef object tracebacklist = [] * * cdef PetscErrorCode traceback( # <<<<<<<<<<<<<< * MPI_Comm comm, * int line, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.traceback", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = ((PetscErrorCode)-1L); __pyx_L0:; __Pyx_XDECREF(__pyx_v_tbl); __Pyx_XDECREF(__pyx_v_fun); __Pyx_XDECREF(__pyx_v_fnm); __Pyx_XDECREF(__pyx_v_m); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/PETSc.pyx":311 * return n * * cdef PetscErrorCode PetscPythonErrorHandler( # <<<<<<<<<<<<<< * MPI_Comm comm, * int line, */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PetscPythonErrorHandler(MPI_Comm __pyx_v_comm, int __pyx_v_line, char const *__pyx_v_cfunc, char const *__pyx_v_cfile, PetscErrorCode __pyx_v_n, PetscErrorType __pyx_v_p, char const *__pyx_v_mess, void *__pyx_v_ctx) { PetscErrorCode __pyx_r; int __pyx_t_1; int __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save; #endif /* "petsc4py/PETSc/PETSc.pyx":322 * ) except (-1) nogil: * global tracebacklist * if (tracebacklist) != NULL and Py_IsInitialized(): # <<<<<<<<<<<<<< * return traceback(comm, line, cfunc, cfile, n, p, mess, ctx) * else: */ __pyx_t_2 = (((void *)__pyx_v_8petsc4py_5PETSc_tracebacklist) != NULL); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = (Py_IsInitialized() != 0); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "petsc4py/PETSc/PETSc.pyx":323 * global tracebacklist * if (tracebacklist) != NULL and Py_IsInitialized(): * return traceback(comm, line, cfunc, cfile, n, p, mess, ctx) # <<<<<<<<<<<<<< * else: * return PetscTBEH(comm, line, cfunc, cfile, n, p, mess, ctx) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_traceback(__pyx_v_comm, __pyx_v_line, __pyx_v_cfunc, __pyx_v_cfile, __pyx_v_n, __pyx_v_p, __pyx_v_mess, __pyx_v_ctx); if (unlikely(__pyx_t_3 == ((PetscErrorCode)((PetscErrorCode)-1L)))) __PYX_ERR(12, 323, __pyx_L1_error) __pyx_r = __pyx_t_3; goto __pyx_L0; /* "petsc4py/PETSc/PETSc.pyx":322 * ) except (-1) nogil: * global tracebacklist * if (tracebacklist) != NULL and Py_IsInitialized(): # <<<<<<<<<<<<<< * return traceback(comm, line, cfunc, cfile, n, p, mess, ctx) * else: */ } /* "petsc4py/PETSc/PETSc.pyx":325 * return traceback(comm, line, cfunc, cfile, n, p, mess, ctx) * else: * return PetscTBEH(comm, line, cfunc, cfile, n, p, mess, ctx) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ /*else*/ { __pyx_r = PetscTBEH(__pyx_v_comm, __pyx_v_line, __pyx_v_cfunc, __pyx_v_cfile, __pyx_v_n, __pyx_v_p, __pyx_v_mess, __pyx_v_ctx); goto __pyx_L0; } /* "petsc4py/PETSc/PETSc.pyx":311 * return n * * cdef PetscErrorCode PetscPythonErrorHandler( # <<<<<<<<<<<<<< * MPI_Comm comm, * int line, */ /* function exit code */ __pyx_L1_error:; #ifdef WITH_THREAD __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_AddTraceback("petsc4py.PETSc.PetscPythonErrorHandler", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = ((PetscErrorCode)-1L); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/PETSc.pyx":361 * cdef char** PyPetsc_Argv = NULL * * cdef int getinitargs(object args, int *argc, char **argv[]) except -1: # <<<<<<<<<<<<<< * # allocate command line arguments * cdef int i, c = 0 */ static int __pyx_f_8petsc4py_5PETSc_getinitargs(PyObject *__pyx_v_args, int *__pyx_v_argc, char ***__pyx_v_argv) { int __pyx_v_i; int __pyx_v_c; char **__pyx_v_v; PyObject *__pyx_9genexpr21__pyx_v_a = NULL; PyObject *__pyx_9genexpr22__pyx_v_a = NULL; int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; PyObject *(*__pyx_t_5)(PyObject *); PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; char *__pyx_t_13; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getinitargs", 0); __Pyx_INCREF(__pyx_v_args); /* "petsc4py/PETSc/PETSc.pyx":363 * cdef int getinitargs(object args, int *argc, char **argv[]) except -1: * # allocate command line arguments * cdef int i, c = 0 # <<<<<<<<<<<<<< * cdef char **v = NULL * if args is None: args = [] */ __pyx_v_c = 0; /* "petsc4py/PETSc/PETSc.pyx":364 * # allocate command line arguments * cdef int i, c = 0 * cdef char **v = NULL # <<<<<<<<<<<<<< * if args is None: args = [] * args = [str(a).encode() for a in args] */ __pyx_v_v = NULL; /* "petsc4py/PETSc/PETSc.pyx":365 * cdef int i, c = 0 * cdef char **v = NULL * if args is None: args = [] # <<<<<<<<<<<<<< * args = [str(a).encode() for a in args] * args = [a for a in args if a] */ __pyx_t_1 = (__pyx_v_args == Py_None); if (__pyx_t_1) { __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 365, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_args, __pyx_t_2); __pyx_t_2 = 0; } /* "petsc4py/PETSc/PETSc.pyx":366 * cdef char **v = NULL * if args is None: args = [] * args = [str(a).encode() for a in args] # <<<<<<<<<<<<<< * args = [a for a in args if a] * c = len(args) */ { /* enter inner scope */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 366, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_2); if (likely(PyList_CheckExact(__pyx_v_args)) || PyTuple_CheckExact(__pyx_v_args)) { __pyx_t_3 = __pyx_v_args; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 366, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 366, __pyx_L6_error) } for (;;) { if (likely(!__pyx_t_5)) { if (likely(PyList_CheckExact(__pyx_t_3))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(12, 366, __pyx_L6_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(12, 366, __pyx_L6_error) #else __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 366, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(12, 366, __pyx_L6_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(12, 366, __pyx_L6_error) #else __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 366, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_6); #endif } } else { __pyx_t_6 = __pyx_t_5(__pyx_t_3); if (unlikely(!__pyx_t_6)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(12, 366, __pyx_L6_error) } break; } __Pyx_GOTREF(__pyx_t_6); } __Pyx_XDECREF_SET(__pyx_9genexpr21__pyx_v_a, __pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = __Pyx_PyObject_Str(__pyx_9genexpr21__pyx_v_a); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 366, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_encode); if (unlikely(!__pyx_t_8)) __PYX_ERR(12, 366, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_8))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_9, 0+__pyx_t_9); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 366, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(12, 366, __pyx_L6_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_9genexpr21__pyx_v_a); __pyx_9genexpr21__pyx_v_a = 0; goto __pyx_L10_exit_scope; __pyx_L6_error:; __Pyx_XDECREF(__pyx_9genexpr21__pyx_v_a); __pyx_9genexpr21__pyx_v_a = 0; goto __pyx_L1_error; __pyx_L10_exit_scope:; } /* exit inner scope */ __Pyx_DECREF_SET(__pyx_v_args, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/PETSc.pyx":367 * if args is None: args = [] * args = [str(a).encode() for a in args] * args = [a for a in args if a] # <<<<<<<<<<<<<< * c = len(args) * v = malloc((c+1)*sizeof(char*)) */ { /* enter inner scope */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 367, __pyx_L13_error) __Pyx_GOTREF(__pyx_t_2); if (likely(PyList_CheckExact(__pyx_v_args)) || PyTuple_CheckExact(__pyx_v_args)) { __pyx_t_3 = __pyx_v_args; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 367, __pyx_L13_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 367, __pyx_L13_error) } for (;;) { if (likely(!__pyx_t_5)) { if (likely(PyList_CheckExact(__pyx_t_3))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(12, 367, __pyx_L13_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(12, 367, __pyx_L13_error) #else __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 367, __pyx_L13_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(12, 367, __pyx_L13_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(12, 367, __pyx_L13_error) #else __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 367, __pyx_L13_error) __Pyx_GOTREF(__pyx_t_6); #endif } } else { __pyx_t_6 = __pyx_t_5(__pyx_t_3); if (unlikely(!__pyx_t_6)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(12, 367, __pyx_L13_error) } break; } __Pyx_GOTREF(__pyx_t_6); } __Pyx_XDECREF_SET(__pyx_9genexpr22__pyx_v_a, __pyx_t_6); __pyx_t_6 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_9genexpr22__pyx_v_a); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(12, 367, __pyx_L13_error) if (__pyx_t_1) { if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_9genexpr22__pyx_v_a))) __PYX_ERR(12, 367, __pyx_L13_error) } } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_9genexpr22__pyx_v_a); __pyx_9genexpr22__pyx_v_a = 0; goto __pyx_L18_exit_scope; __pyx_L13_error:; __Pyx_XDECREF(__pyx_9genexpr22__pyx_v_a); __pyx_9genexpr22__pyx_v_a = 0; goto __pyx_L1_error; __pyx_L18_exit_scope:; } /* exit inner scope */ __Pyx_DECREF_SET(__pyx_v_args, __pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/PETSc.pyx":368 * args = [str(a).encode() for a in args] * args = [a for a in args if a] * c = len(args) # <<<<<<<<<<<<<< * v = malloc((c+1)*sizeof(char*)) * if v == NULL: raise MemoryError */ __pyx_t_4 = PyObject_Length(__pyx_v_args); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(12, 368, __pyx_L1_error) __pyx_v_c = ((int)__pyx_t_4); /* "petsc4py/PETSc/PETSc.pyx":369 * args = [a for a in args if a] * c = len(args) * v = malloc((c+1)*sizeof(char*)) # <<<<<<<<<<<<<< * if v == NULL: raise MemoryError * memset(v, 0, (c+1)*sizeof(char*)) */ __pyx_v_v = ((char **)malloc((((size_t)(__pyx_v_c + 1)) * (sizeof(char *))))); /* "petsc4py/PETSc/PETSc.pyx":370 * c = len(args) * v = malloc((c+1)*sizeof(char*)) * if v == NULL: raise MemoryError # <<<<<<<<<<<<<< * memset(v, 0, (c+1)*sizeof(char*)) * try: */ __pyx_t_1 = (__pyx_v_v == NULL); if (unlikely(__pyx_t_1)) { PyErr_NoMemory(); __PYX_ERR(12, 370, __pyx_L1_error) } /* "petsc4py/PETSc/PETSc.pyx":371 * v = malloc((c+1)*sizeof(char*)) * if v == NULL: raise MemoryError * memset(v, 0, (c+1)*sizeof(char*)) # <<<<<<<<<<<<<< * try: * for 0 <= i < c: */ (void)(memset(__pyx_v_v, 0, (((size_t)(__pyx_v_c + 1)) * (sizeof(char *))))); /* "petsc4py/PETSc/PETSc.pyx":372 * if v == NULL: raise MemoryError * memset(v, 0, (c+1)*sizeof(char*)) * try: # <<<<<<<<<<<<<< * for 0 <= i < c: * v[i] = strdup(args[i]) */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); /*try:*/ { /* "petsc4py/PETSc/PETSc.pyx":373 * memset(v, 0, (c+1)*sizeof(char*)) * try: * for 0 <= i < c: # <<<<<<<<<<<<<< * v[i] = strdup(args[i]) * if v[i] == NULL: */ __pyx_t_9 = __pyx_v_c; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_9; __pyx_v_i++) { /* "petsc4py/PETSc/PETSc.pyx":374 * try: * for 0 <= i < c: * v[i] = strdup(args[i]) # <<<<<<<<<<<<<< * if v[i] == NULL: * raise MemoryError */ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_args, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 374, __pyx_L20_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_13 = __Pyx_PyObject_AsWritableString(__pyx_t_2); if (unlikely((!__pyx_t_13) && PyErr_Occurred())) __PYX_ERR(12, 374, __pyx_L20_error) (__pyx_v_v[__pyx_v_i]) = strdup(__pyx_t_13); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "petsc4py/PETSc/PETSc.pyx":375 * for 0 <= i < c: * v[i] = strdup(args[i]) * if v[i] == NULL: # <<<<<<<<<<<<<< * raise MemoryError * except: */ __pyx_t_1 = ((__pyx_v_v[__pyx_v_i]) == NULL); if (unlikely(__pyx_t_1)) { /* "petsc4py/PETSc/PETSc.pyx":376 * v[i] = strdup(args[i]) * if v[i] == NULL: * raise MemoryError # <<<<<<<<<<<<<< * except: * delinitargs(&c, &v); raise */ PyErr_NoMemory(); __PYX_ERR(12, 376, __pyx_L20_error) /* "petsc4py/PETSc/PETSc.pyx":375 * for 0 <= i < c: * v[i] = strdup(args[i]) * if v[i] == NULL: # <<<<<<<<<<<<<< * raise MemoryError * except: */ } } /* "petsc4py/PETSc/PETSc.pyx":372 * if v == NULL: raise MemoryError * memset(v, 0, (c+1)*sizeof(char*)) * try: # <<<<<<<<<<<<<< * for 0 <= i < c: * v[i] = strdup(args[i]) */ } __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; goto __pyx_L25_try_end; __pyx_L20_error:; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; /* "petsc4py/PETSc/PETSc.pyx":377 * if v[i] == NULL: * raise MemoryError * except: # <<<<<<<<<<<<<< * delinitargs(&c, &v); raise * argc[0] = c; argv[0] = v */ /*except:*/ { __Pyx_AddTraceback("petsc4py.PETSc.getinitargs", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_6) < 0) __PYX_ERR(12, 377, __pyx_L22_except_error) __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_6); /* "petsc4py/PETSc/PETSc.pyx":378 * raise MemoryError * except: * delinitargs(&c, &v); raise # <<<<<<<<<<<<<< * argc[0] = c; argv[0] = v * return 0 */ __pyx_f_8petsc4py_5PETSc_delinitargs((&__pyx_v_c), (&__pyx_v_v)); __Pyx_GIVEREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_ErrRestoreWithState(__pyx_t_2, __pyx_t_3, __pyx_t_6); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_6 = 0; __PYX_ERR(12, 378, __pyx_L22_except_error) } /* "petsc4py/PETSc/PETSc.pyx":372 * if v == NULL: raise MemoryError * memset(v, 0, (c+1)*sizeof(char*)) * try: # <<<<<<<<<<<<<< * for 0 <= i < c: * v[i] = strdup(args[i]) */ __pyx_L22_except_error:; __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); goto __pyx_L1_error; __pyx_L25_try_end:; } /* "petsc4py/PETSc/PETSc.pyx":379 * except: * delinitargs(&c, &v); raise * argc[0] = c; argv[0] = v # <<<<<<<<<<<<<< * return 0 * */ (__pyx_v_argc[0]) = __pyx_v_c; (__pyx_v_argv[0]) = __pyx_v_v; /* "petsc4py/PETSc/PETSc.pyx":380 * delinitargs(&c, &v); raise * argc[0] = c; argv[0] = v * return 0 # <<<<<<<<<<<<<< * * cdef void delinitargs(int *argc, char **argv[]) noexcept nogil: */ __pyx_r = 0; goto __pyx_L0; /* "petsc4py/PETSc/PETSc.pyx":361 * cdef char** PyPetsc_Argv = NULL * * cdef int getinitargs(object args, int *argc, char **argv[]) except -1: # <<<<<<<<<<<<<< * # allocate command line arguments * cdef int i, c = 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("petsc4py.PETSc.getinitargs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_9genexpr21__pyx_v_a); __Pyx_XDECREF(__pyx_9genexpr22__pyx_v_a); __Pyx_XDECREF(__pyx_v_args); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PETSc.pyx":382 * return 0 * * cdef void delinitargs(int *argc, char **argv[]) noexcept nogil: # <<<<<<<<<<<<<< * # dallocate command line arguments * cdef int i, c = argc[0] */ static void __pyx_f_8petsc4py_5PETSc_delinitargs(int *__pyx_v_argc, char ***__pyx_v_argv) { int __pyx_v_i; int __pyx_v_c; char **__pyx_v_v; int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; /* "petsc4py/PETSc/PETSc.pyx":384 * cdef void delinitargs(int *argc, char **argv[]) noexcept nogil: * # dallocate command line arguments * cdef int i, c = argc[0] # <<<<<<<<<<<<<< * cdef char** v = argv[0] * argc[0] = 0; argv[0] = NULL; */ __pyx_v_c = (__pyx_v_argc[0]); /* "petsc4py/PETSc/PETSc.pyx":385 * # dallocate command line arguments * cdef int i, c = argc[0] * cdef char** v = argv[0] # <<<<<<<<<<<<<< * argc[0] = 0; argv[0] = NULL; * if c >= 0 and v != NULL: */ __pyx_v_v = (__pyx_v_argv[0]); /* "petsc4py/PETSc/PETSc.pyx":386 * cdef int i, c = argc[0] * cdef char** v = argv[0] * argc[0] = 0; argv[0] = NULL; # <<<<<<<<<<<<<< * if c >= 0 and v != NULL: * for 0 <= i < c: */ (__pyx_v_argc[0]) = 0; (__pyx_v_argv[0]) = NULL; /* "petsc4py/PETSc/PETSc.pyx":387 * cdef char** v = argv[0] * argc[0] = 0; argv[0] = NULL; * if c >= 0 and v != NULL: # <<<<<<<<<<<<<< * for 0 <= i < c: * if v[i] != NULL: free(v[i]) */ __pyx_t_2 = (__pyx_v_c >= 0); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = (__pyx_v_v != NULL); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "petsc4py/PETSc/PETSc.pyx":388 * argc[0] = 0; argv[0] = NULL; * if c >= 0 and v != NULL: * for 0 <= i < c: # <<<<<<<<<<<<<< * if v[i] != NULL: free(v[i]) * free(v) */ __pyx_t_3 = __pyx_v_c; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { /* "petsc4py/PETSc/PETSc.pyx":389 * if c >= 0 and v != NULL: * for 0 <= i < c: * if v[i] != NULL: free(v[i]) # <<<<<<<<<<<<<< * free(v) * */ __pyx_t_1 = ((__pyx_v_v[__pyx_v_i]) != NULL); if (__pyx_t_1) { free((__pyx_v_v[__pyx_v_i])); } } /* "petsc4py/PETSc/PETSc.pyx":390 * for 0 <= i < c: * if v[i] != NULL: free(v[i]) * free(v) # <<<<<<<<<<<<<< * * cdef void finalize() noexcept nogil: */ free(__pyx_v_v); /* "petsc4py/PETSc/PETSc.pyx":387 * cdef char** v = argv[0] * argc[0] = 0; argv[0] = NULL; * if c >= 0 and v != NULL: # <<<<<<<<<<<<<< * for 0 <= i < c: * if v[i] != NULL: free(v[i]) */ } /* "petsc4py/PETSc/PETSc.pyx":382 * return 0 * * cdef void delinitargs(int *argc, char **argv[]) noexcept nogil: # <<<<<<<<<<<<<< * # dallocate command line arguments * cdef int i, c = argc[0] */ /* function exit code */ } /* "petsc4py/PETSc/PETSc.pyx":392 * free(v) * * cdef void finalize() noexcept nogil: # <<<<<<<<<<<<<< * cdef int ierr = 0 * # deallocate command line arguments */ static void __pyx_f_8petsc4py_5PETSc_finalize(void) { int __pyx_v_ierr; int __pyx_t_1; /* "petsc4py/PETSc/PETSc.pyx":393 * * cdef void finalize() noexcept nogil: * cdef int ierr = 0 # <<<<<<<<<<<<<< * # deallocate command line arguments * global PyPetsc_Argc, PyPetsc_Argv */ __pyx_v_ierr = 0; /* "petsc4py/PETSc/PETSc.pyx":397 * global PyPetsc_Argc, PyPetsc_Argv * global PetscVFPrintf, prevfprintf * delinitargs(&PyPetsc_Argc, &PyPetsc_Argv) # <<<<<<<<<<<<<< * # manage PETSc finalization * if not (PetscInitializeCalled): return */ __pyx_f_8petsc4py_5PETSc_delinitargs((&__pyx_v_8petsc4py_5PETSc_PyPetsc_Argc), (&__pyx_v_8petsc4py_5PETSc_PyPetsc_Argv)); /* "petsc4py/PETSc/PETSc.pyx":399 * delinitargs(&PyPetsc_Argc, &PyPetsc_Argv) * # manage PETSc finalization * if not (PetscInitializeCalled): return # <<<<<<<<<<<<<< * if (PetscFinalizeCalled): return * # stop stdout/stderr redirect */ __pyx_t_1 = (!(((int)PetscInitializeCalled) != 0)); if (__pyx_t_1) { goto __pyx_L0; } /* "petsc4py/PETSc/PETSc.pyx":400 * # manage PETSc finalization * if not (PetscInitializeCalled): return * if (PetscFinalizeCalled): return # <<<<<<<<<<<<<< * # stop stdout/stderr redirect * if (prevfprintf != NULL): */ __pyx_t_1 = (((int)PetscFinalizeCalled) != 0); if (__pyx_t_1) { goto __pyx_L0; } /* "petsc4py/PETSc/PETSc.pyx":402 * if (PetscFinalizeCalled): return * # stop stdout/stderr redirect * if (prevfprintf != NULL): # <<<<<<<<<<<<<< * PetscVFPrintf = prevfprintf * prevfprintf = NULL */ __pyx_t_1 = (__pyx_v_8petsc4py_5PETSc_prevfprintf != NULL); if (__pyx_t_1) { /* "petsc4py/PETSc/PETSc.pyx":403 * # stop stdout/stderr redirect * if (prevfprintf != NULL): * PetscVFPrintf = prevfprintf # <<<<<<<<<<<<<< * prevfprintf = NULL * # deinstall Python error handler */ PetscVFPrintf = __pyx_v_8petsc4py_5PETSc_prevfprintf; /* "petsc4py/PETSc/PETSc.pyx":404 * if (prevfprintf != NULL): * PetscVFPrintf = prevfprintf * prevfprintf = NULL # <<<<<<<<<<<<<< * # deinstall Python error handler * ierr = PetscPopErrorHandler() */ __pyx_v_8petsc4py_5PETSc_prevfprintf = NULL; /* "petsc4py/PETSc/PETSc.pyx":402 * if (PetscFinalizeCalled): return * # stop stdout/stderr redirect * if (prevfprintf != NULL): # <<<<<<<<<<<<<< * PetscVFPrintf = prevfprintf * prevfprintf = NULL */ } /* "petsc4py/PETSc/PETSc.pyx":406 * prevfprintf = NULL * # deinstall Python error handler * ierr = PetscPopErrorHandler() # <<<<<<<<<<<<<< * if ierr != 0: * fprintf(stderr, */ __pyx_v_ierr = PetscPopErrorHandler(); /* "petsc4py/PETSc/PETSc.pyx":407 * # deinstall Python error handler * ierr = PetscPopErrorHandler() * if ierr != 0: # <<<<<<<<<<<<<< * fprintf(stderr, * "PetscPopErrorHandler() failed " */ __pyx_t_1 = (__pyx_v_ierr != 0); if (__pyx_t_1) { /* "petsc4py/PETSc/PETSc.pyx":408 * ierr = PetscPopErrorHandler() * if ierr != 0: * fprintf(stderr, # <<<<<<<<<<<<<< * "PetscPopErrorHandler() failed " * "[error code: %d]\n", ierr) */ (void)(fprintf(stderr, ((char *)"PetscPopErrorHandler() failed [error code: %d]\n"), __pyx_v_ierr)); /* "petsc4py/PETSc/PETSc.pyx":407 * # deinstall Python error handler * ierr = PetscPopErrorHandler() * if ierr != 0: # <<<<<<<<<<<<<< * fprintf(stderr, * "PetscPopErrorHandler() failed " */ } /* "petsc4py/PETSc/PETSc.pyx":412 * "[error code: %d]\n", ierr) * # finalize PETSc * ierr = PetscFinalize() # <<<<<<<<<<<<<< * if ierr != 0: * fprintf(stderr, */ __pyx_v_ierr = PetscFinalize(); /* "petsc4py/PETSc/PETSc.pyx":413 * # finalize PETSc * ierr = PetscFinalize() * if ierr != 0: # <<<<<<<<<<<<<< * fprintf(stderr, * "PetscFinalize() failed " */ __pyx_t_1 = (__pyx_v_ierr != 0); if (__pyx_t_1) { /* "petsc4py/PETSc/PETSc.pyx":414 * ierr = PetscFinalize() * if ierr != 0: * fprintf(stderr, # <<<<<<<<<<<<<< * "PetscFinalize() failed " * "[error code: %d]\n", ierr) */ (void)(fprintf(stderr, ((char *)"PetscFinalize() failed [error code: %d]\n"), __pyx_v_ierr)); /* "petsc4py/PETSc/PETSc.pyx":413 * # finalize PETSc * ierr = PetscFinalize() * if ierr != 0: # <<<<<<<<<<<<<< * fprintf(stderr, * "PetscFinalize() failed " */ } /* "petsc4py/PETSc/PETSc.pyx":392 * free(v) * * cdef void finalize() noexcept nogil: # <<<<<<<<<<<<<< * cdef int ierr = 0 * # deallocate command line arguments */ /* function exit code */ __pyx_L0:; } /* "petsc4py/PETSc/PETSc.pyx":427 * prevfprintf = NULL * * cdef PetscErrorCode PetscVFPrintf_PythonStdStream( # <<<<<<<<<<<<<< * FILE *fd, const char fmt[], va_list ap, * ) except PETSC_ERR_PYTHON with gil: */ static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PetscVFPrintf_PythonStdStream(FILE *__pyx_v_fd, char const *__pyx_v_fmt, va_list __pyx_v_ap) { PyObject *__pyx_v_sys = NULL; char __pyx_v_cstring[0x2000]; size_t __pyx_v_stringlen; size_t __pyx_v_final_pos; PyObject *__pyx_v_ustring = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; PetscErrorCode __pyx_t_7; int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("PetscVFPrintf_PythonStdStream", 0); /* "petsc4py/PETSc/PETSc.pyx":430 * FILE *fd, const char fmt[], va_list ap, * ) except PETSC_ERR_PYTHON with gil: * import sys # <<<<<<<<<<<<<< * cdef char cstring[8192] * cdef size_t stringlen = sizeof(cstring) */ __pyx_t_1 = __Pyx_ImportDottedModule(__pyx_n_s_sys, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_sys = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/PETSc.pyx":432 * import sys * cdef char cstring[8192] * cdef size_t stringlen = sizeof(cstring) # <<<<<<<<<<<<<< * cdef size_t final_pos * if (fd == PETSC_STDOUT) and not (sys.stdout == sys.__stdout__): */ __pyx_v_stringlen = (sizeof(__pyx_v_cstring)); /* "petsc4py/PETSc/PETSc.pyx":434 * cdef size_t stringlen = sizeof(cstring) * cdef size_t final_pos * if (fd == PETSC_STDOUT) and not (sys.stdout == sys.__stdout__): # <<<<<<<<<<<<<< * CHKERR( PetscVSNPrintf(&cstring[0], stringlen, fmt, &final_pos,ap)) * if final_pos > 0 and cstring[final_pos-1] == '\x00': */ __pyx_t_3 = (__pyx_v_fd == PETSC_STDOUT); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_sys, __pyx_n_s_stdout); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 434, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_sys, __pyx_n_s_stdout_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 434, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 434, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(12, 434, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = (!__pyx_t_3); __pyx_t_2 = __pyx_t_6; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { /* "petsc4py/PETSc/PETSc.pyx":435 * cdef size_t final_pos * if (fd == PETSC_STDOUT) and not (sys.stdout == sys.__stdout__): * CHKERR( PetscVSNPrintf(&cstring[0], stringlen, fmt, &final_pos,ap)) # <<<<<<<<<<<<<< * if final_pos > 0 and cstring[final_pos-1] == '\x00': * final_pos -= 1 */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscVSNPrintf((&(__pyx_v_cstring[0])), __pyx_v_stringlen, __pyx_v_fmt, (&__pyx_v_final_pos), __pyx_v_ap)); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(12, 435, __pyx_L1_error) /* "petsc4py/PETSc/PETSc.pyx":436 * if (fd == PETSC_STDOUT) and not (sys.stdout == sys.__stdout__): * CHKERR( PetscVSNPrintf(&cstring[0], stringlen, fmt, &final_pos,ap)) * if final_pos > 0 and cstring[final_pos-1] == '\x00': # <<<<<<<<<<<<<< * final_pos -= 1 * ustring = cstring[:final_pos].decode('UTF-8') */ __pyx_t_6 = (__pyx_v_final_pos > 0); if (__pyx_t_6) { } else { __pyx_t_2 = __pyx_t_6; goto __pyx_L7_bool_binop_done; } __pyx_t_6 = ((__pyx_v_cstring[(__pyx_v_final_pos - 1)]) == '\x00'); __pyx_t_2 = __pyx_t_6; __pyx_L7_bool_binop_done:; if (__pyx_t_2) { /* "petsc4py/PETSc/PETSc.pyx":437 * CHKERR( PetscVSNPrintf(&cstring[0], stringlen, fmt, &final_pos,ap)) * if final_pos > 0 and cstring[final_pos-1] == '\x00': * final_pos -= 1 # <<<<<<<<<<<<<< * ustring = cstring[:final_pos].decode('UTF-8') * sys.stdout.write(ustring) */ __pyx_v_final_pos = (__pyx_v_final_pos - 1); /* "petsc4py/PETSc/PETSc.pyx":436 * if (fd == PETSC_STDOUT) and not (sys.stdout == sys.__stdout__): * CHKERR( PetscVSNPrintf(&cstring[0], stringlen, fmt, &final_pos,ap)) * if final_pos > 0 and cstring[final_pos-1] == '\x00': # <<<<<<<<<<<<<< * final_pos -= 1 * ustring = cstring[:final_pos].decode('UTF-8') */ } /* "petsc4py/PETSc/PETSc.pyx":438 * if final_pos > 0 and cstring[final_pos-1] == '\x00': * final_pos -= 1 * ustring = cstring[:final_pos].decode('UTF-8') # <<<<<<<<<<<<<< * sys.stdout.write(ustring) * elif (fd == PETSC_STDERR) and not (sys.stderr == sys.__stderr__): */ __pyx_t_5 = __Pyx_decode_c_string(__pyx_v_cstring, 0, __pyx_v_final_pos, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_v_ustring = __pyx_t_5; __pyx_t_5 = 0; /* "petsc4py/PETSc/PETSc.pyx":439 * final_pos -= 1 * ustring = cstring[:final_pos].decode('UTF-8') * sys.stdout.write(ustring) # <<<<<<<<<<<<<< * elif (fd == PETSC_STDERR) and not (sys.stderr == sys.__stderr__): * CHKERR( PetscVSNPrintf(&cstring[0], stringlen, fmt, &final_pos,ap)) */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_sys, __pyx_n_s_stdout); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 439, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_write); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 439, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_ustring}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 439, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "petsc4py/PETSc/PETSc.pyx":434 * cdef size_t stringlen = sizeof(cstring) * cdef size_t final_pos * if (fd == PETSC_STDOUT) and not (sys.stdout == sys.__stdout__): # <<<<<<<<<<<<<< * CHKERR( PetscVSNPrintf(&cstring[0], stringlen, fmt, &final_pos,ap)) * if final_pos > 0 and cstring[final_pos-1] == '\x00': */ goto __pyx_L3; } /* "petsc4py/PETSc/PETSc.pyx":440 * ustring = cstring[:final_pos].decode('UTF-8') * sys.stdout.write(ustring) * elif (fd == PETSC_STDERR) and not (sys.stderr == sys.__stderr__): # <<<<<<<<<<<<<< * CHKERR( PetscVSNPrintf(&cstring[0], stringlen, fmt, &final_pos,ap)) * if final_pos > 0 and cstring[final_pos-1] == '\x00': */ __pyx_t_6 = (__pyx_v_fd == PETSC_STDERR); if (__pyx_t_6) { } else { __pyx_t_2 = __pyx_t_6; goto __pyx_L9_bool_binop_done; } __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_sys, __pyx_n_s_stderr); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_sys, __pyx_n_s_stderr_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 440, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(12, 440, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = (!__pyx_t_6); __pyx_t_2 = __pyx_t_3; __pyx_L9_bool_binop_done:; if (__pyx_t_2) { /* "petsc4py/PETSc/PETSc.pyx":441 * sys.stdout.write(ustring) * elif (fd == PETSC_STDERR) and not (sys.stderr == sys.__stderr__): * CHKERR( PetscVSNPrintf(&cstring[0], stringlen, fmt, &final_pos,ap)) # <<<<<<<<<<<<<< * if final_pos > 0 and cstring[final_pos-1] == '\x00': * final_pos -= 1 */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscVSNPrintf((&(__pyx_v_cstring[0])), __pyx_v_stringlen, __pyx_v_fmt, (&__pyx_v_final_pos), __pyx_v_ap)); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(12, 441, __pyx_L1_error) /* "petsc4py/PETSc/PETSc.pyx":442 * elif (fd == PETSC_STDERR) and not (sys.stderr == sys.__stderr__): * CHKERR( PetscVSNPrintf(&cstring[0], stringlen, fmt, &final_pos,ap)) * if final_pos > 0 and cstring[final_pos-1] == '\x00': # <<<<<<<<<<<<<< * final_pos -= 1 * ustring = cstring[:final_pos].decode('UTF-8') */ __pyx_t_3 = (__pyx_v_final_pos > 0); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L12_bool_binop_done; } __pyx_t_3 = ((__pyx_v_cstring[(__pyx_v_final_pos - 1)]) == '\x00'); __pyx_t_2 = __pyx_t_3; __pyx_L12_bool_binop_done:; if (__pyx_t_2) { /* "petsc4py/PETSc/PETSc.pyx":443 * CHKERR( PetscVSNPrintf(&cstring[0], stringlen, fmt, &final_pos,ap)) * if final_pos > 0 and cstring[final_pos-1] == '\x00': * final_pos -= 1 # <<<<<<<<<<<<<< * ustring = cstring[:final_pos].decode('UTF-8') * sys.stderr.write(ustring) */ __pyx_v_final_pos = (__pyx_v_final_pos - 1); /* "petsc4py/PETSc/PETSc.pyx":442 * elif (fd == PETSC_STDERR) and not (sys.stderr == sys.__stderr__): * CHKERR( PetscVSNPrintf(&cstring[0], stringlen, fmt, &final_pos,ap)) * if final_pos > 0 and cstring[final_pos-1] == '\x00': # <<<<<<<<<<<<<< * final_pos -= 1 * ustring = cstring[:final_pos].decode('UTF-8') */ } /* "petsc4py/PETSc/PETSc.pyx":444 * if final_pos > 0 and cstring[final_pos-1] == '\x00': * final_pos -= 1 * ustring = cstring[:final_pos].decode('UTF-8') # <<<<<<<<<<<<<< * sys.stderr.write(ustring) * else: */ __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_cstring, 0, __pyx_v_final_pos, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_ustring = __pyx_t_4; __pyx_t_4 = 0; /* "petsc4py/PETSc/PETSc.pyx":445 * final_pos -= 1 * ustring = cstring[:final_pos].decode('UTF-8') * sys.stderr.write(ustring) # <<<<<<<<<<<<<< * else: * CHKERR( PetscVFPrintfDefault(fd, fmt, ap) ) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_sys, __pyx_n_s_stderr); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_write); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_ustring}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/PETSc.pyx":440 * ustring = cstring[:final_pos].decode('UTF-8') * sys.stdout.write(ustring) * elif (fd == PETSC_STDERR) and not (sys.stderr == sys.__stderr__): # <<<<<<<<<<<<<< * CHKERR( PetscVSNPrintf(&cstring[0], stringlen, fmt, &final_pos,ap)) * if final_pos > 0 and cstring[final_pos-1] == '\x00': */ goto __pyx_L3; } /* "petsc4py/PETSc/PETSc.pyx":447 * sys.stderr.write(ustring) * else: * CHKERR( PetscVFPrintfDefault(fd, fmt, ap) ) # <<<<<<<<<<<<<< * return PETSC_SUCCESS * */ /*else*/ { __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscVFPrintfDefault(__pyx_v_fd, __pyx_v_fmt, __pyx_v_ap)); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(12, 447, __pyx_L1_error) } __pyx_L3:; /* "petsc4py/PETSc/PETSc.pyx":448 * else: * CHKERR( PetscVFPrintfDefault(fd, fmt, ap) ) * return PETSC_SUCCESS # <<<<<<<<<<<<<< * * cdef int _push_vfprintf( */ __pyx_r = PETSC_SUCCESS; goto __pyx_L0; /* "petsc4py/PETSc/PETSc.pyx":427 * prevfprintf = NULL * * cdef PetscErrorCode PetscVFPrintf_PythonStdStream( # <<<<<<<<<<<<<< * FILE *fd, const char fmt[], va_list ap, * ) except PETSC_ERR_PYTHON with gil: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.PetscVFPrintf_PythonStdStream", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_sys); __Pyx_XDECREF(__pyx_v_ustring); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "petsc4py/PETSc/PETSc.pyx":450 * return PETSC_SUCCESS * * cdef int _push_vfprintf( # <<<<<<<<<<<<<< * PetscErrorCode (*vfprintf)(FILE*, const char*, va_list) except PETSC_ERR_PYTHON nogil, * ) except -1: */ static int __pyx_f_8petsc4py_5PETSc__push_vfprintf(PetscErrorCode (*__pyx_v_vfprintf)(FILE *, char const *, va_list)) { int __pyx_r; int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "petsc4py/PETSc/PETSc.pyx":454 * ) except -1: * global PetscVFPrintf, prevfprintf * assert prevfprintf == NULL # <<<<<<<<<<<<<< * prevfprintf = PetscVFPrintf * PetscVFPrintf = vfprintf */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_1 = (__pyx_v_8petsc4py_5PETSc_prevfprintf == NULL); if (unlikely(!__pyx_t_1)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(12, 454, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(12, 454, __pyx_L1_error) #endif /* "petsc4py/PETSc/PETSc.pyx":455 * global PetscVFPrintf, prevfprintf * assert prevfprintf == NULL * prevfprintf = PetscVFPrintf # <<<<<<<<<<<<<< * PetscVFPrintf = vfprintf * */ __pyx_v_8petsc4py_5PETSc_prevfprintf = PetscVFPrintf; /* "petsc4py/PETSc/PETSc.pyx":456 * assert prevfprintf == NULL * prevfprintf = PetscVFPrintf * PetscVFPrintf = vfprintf # <<<<<<<<<<<<<< * * cdef int _pop_vfprintf() except -1: */ PetscVFPrintf = __pyx_v_vfprintf; /* "petsc4py/PETSc/PETSc.pyx":450 * return PETSC_SUCCESS * * cdef int _push_vfprintf( # <<<<<<<<<<<<<< * PetscErrorCode (*vfprintf)(FILE*, const char*, va_list) except PETSC_ERR_PYTHON nogil, * ) except -1: */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc._push_vfprintf", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/PETSc.pyx":458 * PetscVFPrintf = vfprintf * * cdef int _pop_vfprintf() except -1: # <<<<<<<<<<<<<< * global PetscVFPrintf, prevfprintf * assert prevfprintf != NULL */ static int __pyx_f_8petsc4py_5PETSc__pop_vfprintf(void) { int __pyx_r; int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "petsc4py/PETSc/PETSc.pyx":460 * cdef int _pop_vfprintf() except -1: * global PetscVFPrintf, prevfprintf * assert prevfprintf != NULL # <<<<<<<<<<<<<< * PetscVFPrintf = prevfprintf * prevfprintf == NULL */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_1 = (__pyx_v_8petsc4py_5PETSc_prevfprintf != NULL); if (unlikely(!__pyx_t_1)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(12, 460, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(12, 460, __pyx_L1_error) #endif /* "petsc4py/PETSc/PETSc.pyx":461 * global PetscVFPrintf, prevfprintf * assert prevfprintf != NULL * PetscVFPrintf = prevfprintf # <<<<<<<<<<<<<< * prevfprintf == NULL * */ PetscVFPrintf = __pyx_v_8petsc4py_5PETSc_prevfprintf; /* "petsc4py/PETSc/PETSc.pyx":462 * assert prevfprintf != NULL * PetscVFPrintf = prevfprintf * prevfprintf == NULL # <<<<<<<<<<<<<< * * cdef int initialize(object args, object comm) except -1: */ (void)((__pyx_v_8petsc4py_5PETSc_prevfprintf == NULL)); /* "petsc4py/PETSc/PETSc.pyx":458 * PetscVFPrintf = vfprintf * * cdef int _pop_vfprintf() except -1: # <<<<<<<<<<<<<< * global PetscVFPrintf, prevfprintf * assert prevfprintf != NULL */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc._pop_vfprintf", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/PETSc.pyx":464 * prevfprintf == NULL * * cdef int initialize(object args, object comm) except -1: # <<<<<<<<<<<<<< * if (PetscInitializeCalled): return 1 * if (PetscFinalizeCalled): return 0 */ static int __pyx_f_8petsc4py_5PETSc_initialize(PyObject *__pyx_v_args, PyObject *__pyx_v_comm) { PetscErrorHandlerFunction __pyx_v_handler; PyObject *__pyx_v_sys = NULL; int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; MPI_Comm __pyx_t_3; PetscErrorCode __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("initialize", 1); /* "petsc4py/PETSc/PETSc.pyx":465 * * cdef int initialize(object args, object comm) except -1: * if (PetscInitializeCalled): return 1 # <<<<<<<<<<<<<< * if (PetscFinalizeCalled): return 0 * # allocate command line arguments */ __pyx_t_1 = (((int)PetscInitializeCalled) != 0); if (__pyx_t_1) { __pyx_r = 1; goto __pyx_L0; } /* "petsc4py/PETSc/PETSc.pyx":466 * cdef int initialize(object args, object comm) except -1: * if (PetscInitializeCalled): return 1 * if (PetscFinalizeCalled): return 0 # <<<<<<<<<<<<<< * # allocate command line arguments * global PyPetsc_Argc, PyPetsc_Argv */ __pyx_t_1 = (((int)PetscFinalizeCalled) != 0); if (__pyx_t_1) { __pyx_r = 0; goto __pyx_L0; } /* "petsc4py/PETSc/PETSc.pyx":469 * # allocate command line arguments * global PyPetsc_Argc, PyPetsc_Argv * getinitargs(args, &PyPetsc_Argc, &PyPetsc_Argv) # <<<<<<<<<<<<<< * # communicator * global PETSC_COMM_WORLD */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_getinitargs(__pyx_v_args, (&__pyx_v_8petsc4py_5PETSc_PyPetsc_Argc), (&__pyx_v_8petsc4py_5PETSc_PyPetsc_Argv)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(12, 469, __pyx_L1_error) /* "petsc4py/PETSc/PETSc.pyx":472 * # communicator * global PETSC_COMM_WORLD * PETSC_COMM_WORLD = def_Comm(comm, PETSC_COMM_WORLD) # <<<<<<<<<<<<<< * # initialize PETSc * CHKERR( PetscInitialize(&PyPetsc_Argc, &PyPetsc_Argv, NULL, NULL) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, PETSC_COMM_WORLD); if (unlikely(__pyx_t_3 == ((MPI_Comm)MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(12, 472, __pyx_L1_error) PETSC_COMM_WORLD = __pyx_t_3; /* "petsc4py/PETSc/PETSc.pyx":474 * PETSC_COMM_WORLD = def_Comm(comm, PETSC_COMM_WORLD) * # initialize PETSc * CHKERR( PetscInitialize(&PyPetsc_Argc, &PyPetsc_Argv, NULL, NULL) ) # <<<<<<<<<<<<<< * # install Python error handler * cdef PetscErrorHandlerFunction handler = NULL */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscInitialize((&__pyx_v_8petsc4py_5PETSc_PyPetsc_Argc), (&__pyx_v_8petsc4py_5PETSc_PyPetsc_Argv), NULL, NULL)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(12, 474, __pyx_L1_error) /* "petsc4py/PETSc/PETSc.pyx":476 * CHKERR( PetscInitialize(&PyPetsc_Argc, &PyPetsc_Argv, NULL, NULL) ) * # install Python error handler * cdef PetscErrorHandlerFunction handler = NULL # <<<<<<<<<<<<<< * handler = PetscPythonErrorHandler * CHKERR( PetscPushErrorHandler(handler, NULL) ) */ __pyx_v_handler = NULL; /* "petsc4py/PETSc/PETSc.pyx":477 * # install Python error handler * cdef PetscErrorHandlerFunction handler = NULL * handler = PetscPythonErrorHandler # <<<<<<<<<<<<<< * CHKERR( PetscPushErrorHandler(handler, NULL) ) * # redirect PETSc std streams */ __pyx_v_handler = ((PetscErrorHandlerFunction)__pyx_f_8petsc4py_5PETSc_PetscPythonErrorHandler); /* "petsc4py/PETSc/PETSc.pyx":478 * cdef PetscErrorHandlerFunction handler = NULL * handler = PetscPythonErrorHandler * CHKERR( PetscPushErrorHandler(handler, NULL) ) # <<<<<<<<<<<<<< * # redirect PETSc std streams * import sys */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscPushErrorHandler(__pyx_v_handler, NULL)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(12, 478, __pyx_L1_error) /* "petsc4py/PETSc/PETSc.pyx":480 * CHKERR( PetscPushErrorHandler(handler, NULL) ) * # redirect PETSc std streams * import sys # <<<<<<<<<<<<<< * if (sys.stdout != sys.__stdout__) or (sys.stderr != sys.__stderr__): * _push_vfprintf(&PetscVFPrintf_PythonStdStream) */ __pyx_t_5 = __Pyx_ImportDottedModule(__pyx_n_s_sys, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_v_sys = __pyx_t_5; __pyx_t_5 = 0; /* "petsc4py/PETSc/PETSc.pyx":481 * # redirect PETSc std streams * import sys * if (sys.stdout != sys.__stdout__) or (sys.stderr != sys.__stderr__): # <<<<<<<<<<<<<< * _push_vfprintf(&PetscVFPrintf_PythonStdStream) * # register finalization function */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_sys, __pyx_n_s_stdout); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 481, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_sys, __pyx_n_s_stdout_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 481, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PyObject_RichCompare(__pyx_t_5, __pyx_t_6, Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 481, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(12, 481, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (!__pyx_t_8) { } else { __pyx_t_1 = __pyx_t_8; goto __pyx_L6_bool_binop_done; } __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_sys, __pyx_n_s_stderr); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 481, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_sys, __pyx_n_s_stderr_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 481, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = PyObject_RichCompare(__pyx_t_7, __pyx_t_6, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 481, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(12, 481, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_1 = __pyx_t_8; __pyx_L6_bool_binop_done:; if (__pyx_t_1) { /* "petsc4py/PETSc/PETSc.pyx":482 * import sys * if (sys.stdout != sys.__stdout__) or (sys.stderr != sys.__stderr__): * _push_vfprintf(&PetscVFPrintf_PythonStdStream) # <<<<<<<<<<<<<< * # register finalization function * if Py_AtExit(finalize) < 0: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc__push_vfprintf((&__pyx_f_8petsc4py_5PETSc_PetscVFPrintf_PythonStdStream)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(12, 482, __pyx_L1_error) /* "petsc4py/PETSc/PETSc.pyx":481 * # redirect PETSc std streams * import sys * if (sys.stdout != sys.__stdout__) or (sys.stderr != sys.__stderr__): # <<<<<<<<<<<<<< * _push_vfprintf(&PetscVFPrintf_PythonStdStream) * # register finalization function */ } /* "petsc4py/PETSc/PETSc.pyx":484 * _push_vfprintf(&PetscVFPrintf_PythonStdStream) * # register finalization function * if Py_AtExit(finalize) < 0: # <<<<<<<<<<<<<< * PySys_WriteStderr(b"warning: could not register %s with Py_AtExit()", * b"PetscFinalize()") */ __pyx_t_1 = (Py_AtExit(__pyx_f_8petsc4py_5PETSc_finalize) < 0); if (__pyx_t_1) { /* "petsc4py/PETSc/PETSc.pyx":485 * # register finalization function * if Py_AtExit(finalize) < 0: * PySys_WriteStderr(b"warning: could not register %s with Py_AtExit()", # <<<<<<<<<<<<<< * b"PetscFinalize()") * return 1 # and we are done, enjoy !! */ PySys_WriteStderr(((char *)"warning: could not register %s with Py_AtExit()"), ((char *)"PetscFinalize()")); /* "petsc4py/PETSc/PETSc.pyx":484 * _push_vfprintf(&PetscVFPrintf_PythonStdStream) * # register finalization function * if Py_AtExit(finalize) < 0: # <<<<<<<<<<<<<< * PySys_WriteStderr(b"warning: could not register %s with Py_AtExit()", * b"PetscFinalize()") */ } /* "petsc4py/PETSc/PETSc.pyx":487 * PySys_WriteStderr(b"warning: could not register %s with Py_AtExit()", * b"PetscFinalize()") * return 1 # and we are done, enjoy !! # <<<<<<<<<<<<<< * * cdef extern from * nogil: */ __pyx_r = 1; goto __pyx_L0; /* "petsc4py/PETSc/PETSc.pyx":464 * prevfprintf == NULL * * cdef int initialize(object args, object comm) except -1: # <<<<<<<<<<<<<< * if (PetscInitializeCalled): return 1 * if (PetscFinalizeCalled): return 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.initialize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_sys); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PETSc.pyx":533 * """ * * cdef int register() except -1: # <<<<<<<<<<<<<< * global registercalled * if registercalled: return 0 */ static int __pyx_f_8petsc4py_5PETSc_register(void) { int __pyx_r; PetscErrorCode __pyx_t_1; PetscErrorCode __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "petsc4py/PETSc/PETSc.pyx":535 * cdef int register() except -1: * global registercalled * if registercalled: return 0 # <<<<<<<<<<<<<< * registercalled = True * # register citation */ if (__pyx_v_8petsc4py_5PETSc_registercalled) { __pyx_r = 0; goto __pyx_L0; } /* "petsc4py/PETSc/PETSc.pyx":536 * global registercalled * if registercalled: return 0 * registercalled = True # <<<<<<<<<<<<<< * # register citation * CHKERR( PetscCitationsRegister(citation, NULL) ) */ __pyx_v_8petsc4py_5PETSc_registercalled = 1; /* "petsc4py/PETSc/PETSc.pyx":538 * registercalled = True * # register citation * CHKERR( PetscCitationsRegister(citation, NULL) ) # <<<<<<<<<<<<<< * # make sure all PETSc packages are initialized * CHKERR( PetscInitializePackageAll() ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscCitationsRegister(__pyx_v_8petsc4py_5PETSc_citation, NULL)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(12, 538, __pyx_L1_error) /* "petsc4py/PETSc/PETSc.pyx":540 * CHKERR( PetscCitationsRegister(citation, NULL) ) * # make sure all PETSc packages are initialized * CHKERR( PetscInitializePackageAll() ) # <<<<<<<<<<<<<< * # register custom implementations * CHKERR( PetscPythonRegisterAll() ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscInitializePackageAll()); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(12, 540, __pyx_L1_error) /* "petsc4py/PETSc/PETSc.pyx":542 * CHKERR( PetscInitializePackageAll() ) * # register custom implementations * CHKERR( PetscPythonRegisterAll() ) # <<<<<<<<<<<<<< * # register Python types * PyPetscType_Register(PETSC_OBJECT_CLASSID, Object) */ __pyx_t_1 = PetscPythonRegisterAll(); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(12, 542, __pyx_L1_error) __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_t_1); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(12, 542, __pyx_L1_error) /* "petsc4py/PETSc/PETSc.pyx":544 * CHKERR( PetscPythonRegisterAll() ) * # register Python types * PyPetscType_Register(PETSC_OBJECT_CLASSID, Object) # <<<<<<<<<<<<<< * PyPetscType_Register(PETSC_VIEWER_CLASSID, Viewer) * PyPetscType_Register(PETSC_RANDOM_CLASSID, Random) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_PyPetscType_Register(PETSC_OBJECT_CLASSID, __pyx_ptype_8petsc4py_5PETSc_Object); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(12, 544, __pyx_L1_error) /* "petsc4py/PETSc/PETSc.pyx":545 * # register Python types * PyPetscType_Register(PETSC_OBJECT_CLASSID, Object) * PyPetscType_Register(PETSC_VIEWER_CLASSID, Viewer) # <<<<<<<<<<<<<< * PyPetscType_Register(PETSC_RANDOM_CLASSID, Random) * PyPetscType_Register(PETSC_DEVICE_CLASSID, Device) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_PyPetscType_Register(PETSC_VIEWER_CLASSID, __pyx_ptype_8petsc4py_5PETSc_Viewer); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(12, 545, __pyx_L1_error) /* "petsc4py/PETSc/PETSc.pyx":546 * PyPetscType_Register(PETSC_OBJECT_CLASSID, Object) * PyPetscType_Register(PETSC_VIEWER_CLASSID, Viewer) * PyPetscType_Register(PETSC_RANDOM_CLASSID, Random) # <<<<<<<<<<<<<< * PyPetscType_Register(PETSC_DEVICE_CLASSID, Device) * PyPetscType_Register(PETSC_DEVICE_CONTEXT_CLASSID, DeviceContext) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_PyPetscType_Register(PETSC_RANDOM_CLASSID, __pyx_ptype_8petsc4py_5PETSc_Random); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(12, 546, __pyx_L1_error) /* "petsc4py/PETSc/PETSc.pyx":547 * PyPetscType_Register(PETSC_VIEWER_CLASSID, Viewer) * PyPetscType_Register(PETSC_RANDOM_CLASSID, Random) * PyPetscType_Register(PETSC_DEVICE_CLASSID, Device) # <<<<<<<<<<<<<< * PyPetscType_Register(PETSC_DEVICE_CONTEXT_CLASSID, DeviceContext) * PyPetscType_Register(PETSC_IS_CLASSID, IS) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_PyPetscType_Register(PETSC_DEVICE_CLASSID, __pyx_ptype_8petsc4py_5PETSc_Device); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(12, 547, __pyx_L1_error) /* "petsc4py/PETSc/PETSc.pyx":548 * PyPetscType_Register(PETSC_RANDOM_CLASSID, Random) * PyPetscType_Register(PETSC_DEVICE_CLASSID, Device) * PyPetscType_Register(PETSC_DEVICE_CONTEXT_CLASSID, DeviceContext) # <<<<<<<<<<<<<< * PyPetscType_Register(PETSC_IS_CLASSID, IS) * PyPetscType_Register(PETSC_LGMAP_CLASSID, LGMap) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_PyPetscType_Register(PETSC_DEVICE_CONTEXT_CLASSID, __pyx_ptype_8petsc4py_5PETSc_DeviceContext); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(12, 548, __pyx_L1_error) /* "petsc4py/PETSc/PETSc.pyx":549 * PyPetscType_Register(PETSC_DEVICE_CLASSID, Device) * PyPetscType_Register(PETSC_DEVICE_CONTEXT_CLASSID, DeviceContext) * PyPetscType_Register(PETSC_IS_CLASSID, IS) # <<<<<<<<<<<<<< * PyPetscType_Register(PETSC_LGMAP_CLASSID, LGMap) * PyPetscType_Register(PETSC_SF_CLASSID, SF) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_PyPetscType_Register(IS_CLASSID, __pyx_ptype_8petsc4py_5PETSc_IS); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(12, 549, __pyx_L1_error) /* "petsc4py/PETSc/PETSc.pyx":550 * PyPetscType_Register(PETSC_DEVICE_CONTEXT_CLASSID, DeviceContext) * PyPetscType_Register(PETSC_IS_CLASSID, IS) * PyPetscType_Register(PETSC_LGMAP_CLASSID, LGMap) # <<<<<<<<<<<<<< * PyPetscType_Register(PETSC_SF_CLASSID, SF) * PyPetscType_Register(PETSC_VEC_CLASSID, Vec) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_PyPetscType_Register(IS_LTOGM_CLASSID, __pyx_ptype_8petsc4py_5PETSc_LGMap); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(12, 550, __pyx_L1_error) /* "petsc4py/PETSc/PETSc.pyx":551 * PyPetscType_Register(PETSC_IS_CLASSID, IS) * PyPetscType_Register(PETSC_LGMAP_CLASSID, LGMap) * PyPetscType_Register(PETSC_SF_CLASSID, SF) # <<<<<<<<<<<<<< * PyPetscType_Register(PETSC_VEC_CLASSID, Vec) * PyPetscType_Register(PETSC_SECTION_CLASSID, Section) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_PyPetscType_Register(PETSCSF_CLASSID, __pyx_ptype_8petsc4py_5PETSc_SF); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(12, 551, __pyx_L1_error) /* "petsc4py/PETSc/PETSc.pyx":552 * PyPetscType_Register(PETSC_LGMAP_CLASSID, LGMap) * PyPetscType_Register(PETSC_SF_CLASSID, SF) * PyPetscType_Register(PETSC_VEC_CLASSID, Vec) # <<<<<<<<<<<<<< * PyPetscType_Register(PETSC_SECTION_CLASSID, Section) * PyPetscType_Register(PETSC_MAT_CLASSID, Mat) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_PyPetscType_Register(VEC_CLASSID, __pyx_ptype_8petsc4py_5PETSc_Vec); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(12, 552, __pyx_L1_error) /* "petsc4py/PETSc/PETSc.pyx":553 * PyPetscType_Register(PETSC_SF_CLASSID, SF) * PyPetscType_Register(PETSC_VEC_CLASSID, Vec) * PyPetscType_Register(PETSC_SECTION_CLASSID, Section) # <<<<<<<<<<<<<< * PyPetscType_Register(PETSC_MAT_CLASSID, Mat) * PyPetscType_Register(PETSC_MAT_PARTITIONING_CLASSID, MatPartitioning) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_PyPetscType_Register(PETSC_SECTION_CLASSID, __pyx_ptype_8petsc4py_5PETSc_Section); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(12, 553, __pyx_L1_error) /* "petsc4py/PETSc/PETSc.pyx":554 * PyPetscType_Register(PETSC_VEC_CLASSID, Vec) * PyPetscType_Register(PETSC_SECTION_CLASSID, Section) * PyPetscType_Register(PETSC_MAT_CLASSID, Mat) # <<<<<<<<<<<<<< * PyPetscType_Register(PETSC_MAT_PARTITIONING_CLASSID, MatPartitioning) * PyPetscType_Register(PETSC_NULLSPACE_CLASSID, NullSpace) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_PyPetscType_Register(MAT_CLASSID, __pyx_ptype_8petsc4py_5PETSc_Mat); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(12, 554, __pyx_L1_error) /* "petsc4py/PETSc/PETSc.pyx":555 * PyPetscType_Register(PETSC_SECTION_CLASSID, Section) * PyPetscType_Register(PETSC_MAT_CLASSID, Mat) * PyPetscType_Register(PETSC_MAT_PARTITIONING_CLASSID, MatPartitioning) # <<<<<<<<<<<<<< * PyPetscType_Register(PETSC_NULLSPACE_CLASSID, NullSpace) * PyPetscType_Register(PETSC_PC_CLASSID, PC) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_PyPetscType_Register(MAT_PARTITIONING_CLASSID, __pyx_ptype_8petsc4py_5PETSc_MatPartitioning); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(12, 555, __pyx_L1_error) /* "petsc4py/PETSc/PETSc.pyx":556 * PyPetscType_Register(PETSC_MAT_CLASSID, Mat) * PyPetscType_Register(PETSC_MAT_PARTITIONING_CLASSID, MatPartitioning) * PyPetscType_Register(PETSC_NULLSPACE_CLASSID, NullSpace) # <<<<<<<<<<<<<< * PyPetscType_Register(PETSC_PC_CLASSID, PC) * PyPetscType_Register(PETSC_KSP_CLASSID, KSP) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_PyPetscType_Register(MAT_NULLSPACE_CLASSID, __pyx_ptype_8petsc4py_5PETSc_NullSpace); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(12, 556, __pyx_L1_error) /* "petsc4py/PETSc/PETSc.pyx":557 * PyPetscType_Register(PETSC_MAT_PARTITIONING_CLASSID, MatPartitioning) * PyPetscType_Register(PETSC_NULLSPACE_CLASSID, NullSpace) * PyPetscType_Register(PETSC_PC_CLASSID, PC) # <<<<<<<<<<<<<< * PyPetscType_Register(PETSC_KSP_CLASSID, KSP) * PyPetscType_Register(PETSC_SNES_CLASSID, SNES) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_PyPetscType_Register(PC_CLASSID, __pyx_ptype_8petsc4py_5PETSc_PC); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(12, 557, __pyx_L1_error) /* "petsc4py/PETSc/PETSc.pyx":558 * PyPetscType_Register(PETSC_NULLSPACE_CLASSID, NullSpace) * PyPetscType_Register(PETSC_PC_CLASSID, PC) * PyPetscType_Register(PETSC_KSP_CLASSID, KSP) # <<<<<<<<<<<<<< * PyPetscType_Register(PETSC_SNES_CLASSID, SNES) * PyPetscType_Register(PETSC_TS_CLASSID, TS) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_PyPetscType_Register(KSP_CLASSID, __pyx_ptype_8petsc4py_5PETSc_KSP); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(12, 558, __pyx_L1_error) /* "petsc4py/PETSc/PETSc.pyx":559 * PyPetscType_Register(PETSC_PC_CLASSID, PC) * PyPetscType_Register(PETSC_KSP_CLASSID, KSP) * PyPetscType_Register(PETSC_SNES_CLASSID, SNES) # <<<<<<<<<<<<<< * PyPetscType_Register(PETSC_TS_CLASSID, TS) * PyPetscType_Register(PETSC_TAO_CLASSID, TAO) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_PyPetscType_Register(SNES_CLASSID, __pyx_ptype_8petsc4py_5PETSc_SNES); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(12, 559, __pyx_L1_error) /* "petsc4py/PETSc/PETSc.pyx":560 * PyPetscType_Register(PETSC_KSP_CLASSID, KSP) * PyPetscType_Register(PETSC_SNES_CLASSID, SNES) * PyPetscType_Register(PETSC_TS_CLASSID, TS) # <<<<<<<<<<<<<< * PyPetscType_Register(PETSC_TAO_CLASSID, TAO) * PyPetscType_Register(PETSC_PARTITIONER_CLASSID, Partitioner) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_PyPetscType_Register(TS_CLASSID, __pyx_ptype_8petsc4py_5PETSc_TS); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(12, 560, __pyx_L1_error) /* "petsc4py/PETSc/PETSc.pyx":561 * PyPetscType_Register(PETSC_SNES_CLASSID, SNES) * PyPetscType_Register(PETSC_TS_CLASSID, TS) * PyPetscType_Register(PETSC_TAO_CLASSID, TAO) # <<<<<<<<<<<<<< * PyPetscType_Register(PETSC_PARTITIONER_CLASSID, Partitioner) * PyPetscType_Register(PETSC_AO_CLASSID, AO) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_PyPetscType_Register(TAO_CLASSID, __pyx_ptype_8petsc4py_5PETSc_TAO); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(12, 561, __pyx_L1_error) /* "petsc4py/PETSc/PETSc.pyx":562 * PyPetscType_Register(PETSC_TS_CLASSID, TS) * PyPetscType_Register(PETSC_TAO_CLASSID, TAO) * PyPetscType_Register(PETSC_PARTITIONER_CLASSID, Partitioner) # <<<<<<<<<<<<<< * PyPetscType_Register(PETSC_AO_CLASSID, AO) * PyPetscType_Register(PETSC_DM_CLASSID, DM) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_PyPetscType_Register(PETSCPARTITIONER_CLASSID, __pyx_ptype_8petsc4py_5PETSc_Partitioner); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(12, 562, __pyx_L1_error) /* "petsc4py/PETSc/PETSc.pyx":563 * PyPetscType_Register(PETSC_TAO_CLASSID, TAO) * PyPetscType_Register(PETSC_PARTITIONER_CLASSID, Partitioner) * PyPetscType_Register(PETSC_AO_CLASSID, AO) # <<<<<<<<<<<<<< * PyPetscType_Register(PETSC_DM_CLASSID, DM) * PyPetscType_Register(PETSC_DS_CLASSID, DS) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_PyPetscType_Register(AO_CLASSID, __pyx_ptype_8petsc4py_5PETSc_AO); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(12, 563, __pyx_L1_error) /* "petsc4py/PETSc/PETSc.pyx":564 * PyPetscType_Register(PETSC_PARTITIONER_CLASSID, Partitioner) * PyPetscType_Register(PETSC_AO_CLASSID, AO) * PyPetscType_Register(PETSC_DM_CLASSID, DM) # <<<<<<<<<<<<<< * PyPetscType_Register(PETSC_DS_CLASSID, DS) * PyPetscType_Register(PETSC_FE_CLASSID, FE) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_PyPetscType_Register(DM_CLASSID, __pyx_ptype_8petsc4py_5PETSc_DM); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(12, 564, __pyx_L1_error) /* "petsc4py/PETSc/PETSc.pyx":565 * PyPetscType_Register(PETSC_AO_CLASSID, AO) * PyPetscType_Register(PETSC_DM_CLASSID, DM) * PyPetscType_Register(PETSC_DS_CLASSID, DS) # <<<<<<<<<<<<<< * PyPetscType_Register(PETSC_FE_CLASSID, FE) * PyPetscType_Register(PETSC_DMLABEL_CLASSID, DMLabel) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_PyPetscType_Register(PETSCDS_CLASSID, __pyx_ptype_8petsc4py_5PETSc_DS); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(12, 565, __pyx_L1_error) /* "petsc4py/PETSc/PETSc.pyx":566 * PyPetscType_Register(PETSC_DM_CLASSID, DM) * PyPetscType_Register(PETSC_DS_CLASSID, DS) * PyPetscType_Register(PETSC_FE_CLASSID, FE) # <<<<<<<<<<<<<< * PyPetscType_Register(PETSC_DMLABEL_CLASSID, DMLabel) * PyPetscType_Register(PETSC_SPACE_CLASSID, Space) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_PyPetscType_Register(PETSCFE_CLASSID, __pyx_ptype_8petsc4py_5PETSc_FE); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(12, 566, __pyx_L1_error) /* "petsc4py/PETSc/PETSc.pyx":567 * PyPetscType_Register(PETSC_DS_CLASSID, DS) * PyPetscType_Register(PETSC_FE_CLASSID, FE) * PyPetscType_Register(PETSC_DMLABEL_CLASSID, DMLabel) # <<<<<<<<<<<<<< * PyPetscType_Register(PETSC_SPACE_CLASSID, Space) * PyPetscType_Register(PETSC_DUALSPACE_CLASSID, DualSpace) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_PyPetscType_Register(DMLABEL_CLASSID, __pyx_ptype_8petsc4py_5PETSc_DMLabel); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(12, 567, __pyx_L1_error) /* "petsc4py/PETSc/PETSc.pyx":568 * PyPetscType_Register(PETSC_FE_CLASSID, FE) * PyPetscType_Register(PETSC_DMLABEL_CLASSID, DMLabel) * PyPetscType_Register(PETSC_SPACE_CLASSID, Space) # <<<<<<<<<<<<<< * PyPetscType_Register(PETSC_DUALSPACE_CLASSID, DualSpace) * return 0 # and we are done, enjoy !! */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_PyPetscType_Register(PETSCSPACE_CLASSID, __pyx_ptype_8petsc4py_5PETSc_Space); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(12, 568, __pyx_L1_error) /* "petsc4py/PETSc/PETSc.pyx":569 * PyPetscType_Register(PETSC_DMLABEL_CLASSID, DMLabel) * PyPetscType_Register(PETSC_SPACE_CLASSID, Space) * PyPetscType_Register(PETSC_DUALSPACE_CLASSID, DualSpace) # <<<<<<<<<<<<<< * return 0 # and we are done, enjoy !! * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_PyPetscType_Register(PETSCDUALSPACE_CLASSID, __pyx_ptype_8petsc4py_5PETSc_DualSpace); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(12, 569, __pyx_L1_error) /* "petsc4py/PETSc/PETSc.pyx":570 * PyPetscType_Register(PETSC_SPACE_CLASSID, Space) * PyPetscType_Register(PETSC_DUALSPACE_CLASSID, DualSpace) * return 0 # and we are done, enjoy !! # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_r = 0; goto __pyx_L0; /* "petsc4py/PETSc/PETSc.pyx":533 * """ * * cdef int register() except -1: # <<<<<<<<<<<<<< * global registercalled * if registercalled: return 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.register", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "petsc4py/PETSc/PETSc.pyx":574 * # -------------------------------------------------------------------- * * def _initialize(args=None, comm=None): # <<<<<<<<<<<<<< * import atexit * global tracebacklist */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5_initialize(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_4_initialize, "_initialize(args=None, comm=None)\nSource code at petsc4py/PETSc/PETSc.pyx:574"); static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_5_initialize = {"_initialize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5_initialize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4_initialize}; static PyObject *__pyx_pw_8petsc4py_5PETSc_5_initialize(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_args = 0; PyObject *__pyx_v_comm = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_initialize (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_args,&__pyx_n_s_comm,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(12, 574, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comm); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(12, 574, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_initialize") < 0)) __PYX_ERR(12, 574, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_args = values[0]; __pyx_v_comm = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("_initialize", 0, 0, 2, __pyx_nargs); __PYX_ERR(12, 574, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("petsc4py.PETSc._initialize", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4_initialize(__pyx_self, __pyx_v_args, __pyx_v_comm); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4_initialize(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_comm) { PyObject *__pyx_v_atexit = NULL; int __pyx_v_ready; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_initialize", 1); /* "petsc4py/PETSc/PETSc.pyx":575 * * def _initialize(args=None, comm=None): * import atexit # <<<<<<<<<<<<<< * global tracebacklist * Error._traceback_ = tracebacklist */ __pyx_t_1 = __Pyx_ImportDottedModule(__pyx_n_s_atexit, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 575, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_atexit = __pyx_t_1; __pyx_t_1 = 0; /* "petsc4py/PETSc/PETSc.pyx":577 * import atexit * global tracebacklist * Error._traceback_ = tracebacklist # <<<<<<<<<<<<<< * global PetscError * PetscError = Error */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Error); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_PyObject_SetAttrStr(__pyx_t_1, __pyx_n_s_traceback, __pyx_v_8petsc4py_5PETSc_tracebacklist) < 0) __PYX_ERR(12, 577, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/PETSc.pyx":579 * Error._traceback_ = tracebacklist * global PetscError * PetscError = Error # <<<<<<<<<<<<<< * # * cdef int ready = initialize(args, comm) */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Error); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_v_8petsc4py_5PETSc_PetscError); __Pyx_DECREF_SET(__pyx_v_8petsc4py_5PETSc_PetscError, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/PETSc.pyx":581 * PetscError = Error * # * cdef int ready = initialize(args, comm) # <<<<<<<<<<<<<< * if ready: register() * # */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_initialize(__pyx_v_args, __pyx_v_comm); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(12, 581, __pyx_L1_error) __pyx_v_ready = __pyx_t_2; /* "petsc4py/PETSc/PETSc.pyx":582 * # * cdef int ready = initialize(args, comm) * if ready: register() # <<<<<<<<<<<<<< * # * global __COMM_SELF__, __COMM_WORLD__ */ __pyx_t_3 = (__pyx_v_ready != 0); if (__pyx_t_3) { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_register(); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(12, 582, __pyx_L1_error) } /* "petsc4py/PETSc/PETSc.pyx":585 * # * global __COMM_SELF__, __COMM_WORLD__ * __COMM_SELF__.comm = PETSC_COMM_SELF # <<<<<<<<<<<<<< * __COMM_WORLD__.comm = PETSC_COMM_WORLD * # */ __pyx_v_8petsc4py_5PETSc___COMM_SELF__->comm = PETSC_COMM_SELF; /* "petsc4py/PETSc/PETSc.pyx":586 * global __COMM_SELF__, __COMM_WORLD__ * __COMM_SELF__.comm = PETSC_COMM_SELF * __COMM_WORLD__.comm = PETSC_COMM_WORLD # <<<<<<<<<<<<<< * # * global PETSC_COMM_DEFAULT */ __pyx_v_8petsc4py_5PETSc___COMM_WORLD__->comm = PETSC_COMM_WORLD; /* "petsc4py/PETSc/PETSc.pyx":589 * # * global PETSC_COMM_DEFAULT * PETSC_COMM_DEFAULT = PETSC_COMM_WORLD # <<<<<<<<<<<<<< * # Register finalizer * atexit.register(_pre_finalize) */ __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT = PETSC_COMM_WORLD; /* "petsc4py/PETSc/PETSc.pyx":591 * PETSC_COMM_DEFAULT = PETSC_COMM_WORLD * # Register finalizer * atexit.register(_pre_finalize) # <<<<<<<<<<<<<< * * def _pre_finalize(): */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_atexit, __pyx_n_s_register); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 591, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pre_finalize); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 591, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_2 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_2 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_5}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_2, 1+__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 591, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/PETSc.pyx":574 * # -------------------------------------------------------------------- * * def _initialize(args=None, comm=None): # <<<<<<<<<<<<<< * import atexit * global tracebacklist */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc._initialize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_atexit); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PETSc.pyx":593 * atexit.register(_pre_finalize) * * def _pre_finalize(): # <<<<<<<<<<<<<< * # Called while the Python interpreter is still running * garbage_cleanup() */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7_pre_finalize(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6_pre_finalize, "_pre_finalize()\nSource code at petsc4py/PETSc/PETSc.pyx:593"); static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7_pre_finalize = {"_pre_finalize", (PyCFunction)__pyx_pw_8petsc4py_5PETSc_7_pre_finalize, METH_NOARGS, __pyx_doc_8petsc4py_5PETSc_6_pre_finalize}; static PyObject *__pyx_pw_8petsc4py_5PETSc_7_pre_finalize(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_pre_finalize (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_6_pre_finalize(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6_pre_finalize(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_pre_finalize", 1); /* "petsc4py/PETSc/PETSc.pyx":595 * def _pre_finalize(): * # Called while the Python interpreter is still running * garbage_cleanup() # <<<<<<<<<<<<<< * * def _finalize(): */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_garbage_cleanup); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 595, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 595, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "petsc4py/PETSc/PETSc.pyx":593 * atexit.register(_pre_finalize) * * def _pre_finalize(): # <<<<<<<<<<<<<< * # Called while the Python interpreter is still running * garbage_cleanup() */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc._pre_finalize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PETSc.pyx":597 * garbage_cleanup() * * def _finalize(): # <<<<<<<<<<<<<< * finalize() * # */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_9_finalize(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_8_finalize, "_finalize()\nSource code at petsc4py/PETSc/PETSc.pyx:597"); static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_9_finalize = {"_finalize", (PyCFunction)__pyx_pw_8petsc4py_5PETSc_9_finalize, METH_NOARGS, __pyx_doc_8petsc4py_5PETSc_8_finalize}; static PyObject *__pyx_pw_8petsc4py_5PETSc_9_finalize(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_finalize (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_8_finalize(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8_finalize(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_finalize", 1); /* "petsc4py/PETSc/PETSc.pyx":598 * * def _finalize(): * finalize() # <<<<<<<<<<<<<< * # * global __COMM_SELF__ */ __pyx_f_8petsc4py_5PETSc_finalize(); /* "petsc4py/PETSc/PETSc.pyx":601 * # * global __COMM_SELF__ * __COMM_SELF__.comm = MPI_COMM_NULL # <<<<<<<<<<<<<< * global __COMM_WORLD__ * __COMM_WORLD__.comm = MPI_COMM_NULL */ __pyx_v_8petsc4py_5PETSc___COMM_SELF__->comm = MPI_COMM_NULL; /* "petsc4py/PETSc/PETSc.pyx":603 * __COMM_SELF__.comm = MPI_COMM_NULL * global __COMM_WORLD__ * __COMM_WORLD__.comm = MPI_COMM_NULL # <<<<<<<<<<<<<< * # * global PETSC_COMM_DEFAULT */ __pyx_v_8petsc4py_5PETSc___COMM_WORLD__->comm = MPI_COMM_NULL; /* "petsc4py/PETSc/PETSc.pyx":606 * # * global PETSC_COMM_DEFAULT * PETSC_COMM_DEFAULT = MPI_COMM_NULL # <<<<<<<<<<<<<< * # * global type_registry */ __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT = MPI_COMM_NULL; /* "petsc4py/PETSc/PETSc.pyx":609 * # * global type_registry * type_registry.clear() # <<<<<<<<<<<<<< * global stage_registry * stage_registry.clear() */ if (unlikely(__pyx_v_8petsc4py_5PETSc_type_registry == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "clear"); __PYX_ERR(12, 609, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyDict_Clear(__pyx_v_8petsc4py_5PETSc_type_registry); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(12, 609, __pyx_L1_error) /* "petsc4py/PETSc/PETSc.pyx":611 * type_registry.clear() * global stage_registry * stage_registry.clear() # <<<<<<<<<<<<<< * global class_registry * class_registry.clear() */ if (unlikely(__pyx_v_8petsc4py_5PETSc_stage_registry == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "clear"); __PYX_ERR(12, 611, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyDict_Clear(__pyx_v_8petsc4py_5PETSc_stage_registry); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(12, 611, __pyx_L1_error) /* "petsc4py/PETSc/PETSc.pyx":613 * stage_registry.clear() * global class_registry * class_registry.clear() # <<<<<<<<<<<<<< * global event_registry * event_registry.clear() */ if (unlikely(__pyx_v_8petsc4py_5PETSc_class_registry == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "clear"); __PYX_ERR(12, 613, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyDict_Clear(__pyx_v_8petsc4py_5PETSc_class_registry); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(12, 613, __pyx_L1_error) /* "petsc4py/PETSc/PETSc.pyx":615 * class_registry.clear() * global event_registry * event_registry.clear() # <<<<<<<<<<<<<< * global citations_registry * citations_registry.clear() */ if (unlikely(__pyx_v_8petsc4py_5PETSc_event_registry == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "clear"); __PYX_ERR(12, 615, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyDict_Clear(__pyx_v_8petsc4py_5PETSc_event_registry); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(12, 615, __pyx_L1_error) /* "petsc4py/PETSc/PETSc.pyx":617 * event_registry.clear() * global citations_registry * citations_registry.clear() # <<<<<<<<<<<<<< * * def _push_python_vfprintf(): */ if (unlikely(__pyx_v_8petsc4py_5PETSc_citations_registry == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "clear"); __PYX_ERR(12, 617, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyDict_Clear(__pyx_v_8petsc4py_5PETSc_citations_registry); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(12, 617, __pyx_L1_error) /* "petsc4py/PETSc/PETSc.pyx":597 * garbage_cleanup() * * def _finalize(): # <<<<<<<<<<<<<< * finalize() * # */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc._finalize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PETSc.pyx":619 * citations_registry.clear() * * def _push_python_vfprintf(): # <<<<<<<<<<<<<< * _push_vfprintf(&PetscVFPrintf_PythonStdStream) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_11_push_python_vfprintf(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_10_push_python_vfprintf, "_push_python_vfprintf()\nSource code at petsc4py/PETSc/PETSc.pyx:619"); static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_11_push_python_vfprintf = {"_push_python_vfprintf", (PyCFunction)__pyx_pw_8petsc4py_5PETSc_11_push_python_vfprintf, METH_NOARGS, __pyx_doc_8petsc4py_5PETSc_10_push_python_vfprintf}; static PyObject *__pyx_pw_8petsc4py_5PETSc_11_push_python_vfprintf(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_push_python_vfprintf (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_10_push_python_vfprintf(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_10_push_python_vfprintf(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_push_python_vfprintf", 1); /* "petsc4py/PETSc/PETSc.pyx":620 * * def _push_python_vfprintf(): * _push_vfprintf(&PetscVFPrintf_PythonStdStream) # <<<<<<<<<<<<<< * * def _pop_python_vfprintf(): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc__push_vfprintf((&__pyx_f_8petsc4py_5PETSc_PetscVFPrintf_PythonStdStream)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(12, 620, __pyx_L1_error) /* "petsc4py/PETSc/PETSc.pyx":619 * citations_registry.clear() * * def _push_python_vfprintf(): # <<<<<<<<<<<<<< * _push_vfprintf(&PetscVFPrintf_PythonStdStream) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc._push_python_vfprintf", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PETSc.pyx":622 * _push_vfprintf(&PetscVFPrintf_PythonStdStream) * * def _pop_python_vfprintf(): # <<<<<<<<<<<<<< * _pop_vfprintf() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_13_pop_python_vfprintf(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_12_pop_python_vfprintf, "_pop_python_vfprintf()\nSource code at petsc4py/PETSc/PETSc.pyx:622"); static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_13_pop_python_vfprintf = {"_pop_python_vfprintf", (PyCFunction)__pyx_pw_8petsc4py_5PETSc_13_pop_python_vfprintf, METH_NOARGS, __pyx_doc_8petsc4py_5PETSc_12_pop_python_vfprintf}; static PyObject *__pyx_pw_8petsc4py_5PETSc_13_pop_python_vfprintf(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_pop_python_vfprintf (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_12_pop_python_vfprintf(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_12_pop_python_vfprintf(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_pop_python_vfprintf", 1); /* "petsc4py/PETSc/PETSc.pyx":623 * * def _pop_python_vfprintf(): * _pop_vfprintf() # <<<<<<<<<<<<<< * * def _stdout_is_stderr(): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc__pop_vfprintf(); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(12, 623, __pyx_L1_error) /* "petsc4py/PETSc/PETSc.pyx":622 * _push_vfprintf(&PetscVFPrintf_PythonStdStream) * * def _pop_python_vfprintf(): # <<<<<<<<<<<<<< * _pop_vfprintf() * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc._pop_python_vfprintf", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "petsc4py/PETSc/PETSc.pyx":625 * _pop_vfprintf() * * def _stdout_is_stderr(): # <<<<<<<<<<<<<< * global PETSC_STDOUT, PETSC_STDERR * return PETSC_STDOUT == PETSC_STDERR */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_15_stdout_is_stderr(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_14_stdout_is_stderr, "_stdout_is_stderr()\nSource code at petsc4py/PETSc/PETSc.pyx:625"); static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_15_stdout_is_stderr = {"_stdout_is_stderr", (PyCFunction)__pyx_pw_8petsc4py_5PETSc_15_stdout_is_stderr, METH_NOARGS, __pyx_doc_8petsc4py_5PETSc_14_stdout_is_stderr}; static PyObject *__pyx_pw_8petsc4py_5PETSc_15_stdout_is_stderr(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_stdout_is_stderr (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_8petsc4py_5PETSc_14_stdout_is_stderr(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_14_stdout_is_stderr(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_stdout_is_stderr", 1); /* "petsc4py/PETSc/PETSc.pyx":627 * def _stdout_is_stderr(): * global PETSC_STDOUT, PETSC_STDERR * return PETSC_STDOUT == PETSC_STDERR # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyBool_FromLong((PETSC_STDOUT == PETSC_STDERR)); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 627, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "petsc4py/PETSc/PETSc.pyx":625 * _pop_vfprintf() * * def _stdout_is_stderr(): # <<<<<<<<<<<<<< * global PETSC_STDOUT, PETSC_STDERR * return PETSC_STDOUT == PETSC_STDERR */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc._stdout_is_stderr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_tp_new_8petsc4py_5PETSc_Comm(PyTypeObject *t, PyObject *a, PyObject *k) { struct PyPetscCommObject *p; PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; #endif p = ((struct PyPetscCommObject *)o); p->base = Py_None; Py_INCREF(Py_None); if (unlikely(__pyx_pw_8petsc4py_5PETSc_4Comm_1__cinit__(o, a, k) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_8petsc4py_5PETSc_Comm(PyObject *o) { struct PyPetscCommObject *p = (struct PyPetscCommObject *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_8petsc4py_5PETSc_Comm) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); __pyx_pw_8petsc4py_5PETSc_4Comm_3__dealloc__(o); __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); PyErr_Restore(etype, eval, etb); } Py_CLEAR(p->base); #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static int __pyx_tp_traverse_8petsc4py_5PETSc_Comm(PyObject *o, visitproc v, void *a) { int e; struct PyPetscCommObject *p = (struct PyPetscCommObject *)o; if (p->base) { e = (*v)(p->base, a); if (e) return e; } return 0; } static int __pyx_tp_clear_8petsc4py_5PETSc_Comm(PyObject *o) { PyObject* tmp; struct PyPetscCommObject *p = (struct PyPetscCommObject *)o; tmp = ((PyObject*)p->base); p->base = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4Comm_size(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4Comm_4size_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4Comm_rank(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4Comm_4rank_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4Comm_fortran(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4Comm_7fortran_1__get__(o); } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_Comm[] = { {"destroy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4Comm_9destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4Comm_8destroy}, {"duplicate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4Comm_11duplicate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4Comm_10duplicate}, {"getSize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4Comm_13getSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4Comm_12getSize}, {"getRank", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4Comm_15getRank, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4Comm_14getRank}, {"barrier", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4Comm_17barrier, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4Comm_16barrier}, {"tompi4py", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4Comm_19tompi4py, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4Comm_18tompi4py}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_8petsc4py_5PETSc_Comm[] = { {(char *)"size", __pyx_getprop_8petsc4py_5PETSc_4Comm_size, 0, (char *)PyDoc_STR("Comm.size: int\nCommunicator size.\nSource code at petsc4py/PETSc/Comm.pyx:135"), 0}, {(char *)"rank", __pyx_getprop_8petsc4py_5PETSc_4Comm_rank, 0, (char *)PyDoc_STR("Comm.rank: int\nCommunicator rank.\nSource code at petsc4py/PETSc/Comm.pyx:140"), 0}, {(char *)"fortran", __pyx_getprop_8petsc4py_5PETSc_4Comm_fortran, 0, (char *)PyDoc_STR("Comm.fortran: int\nFortran handle.\nSource code at petsc4py/PETSc/Comm.pyx:147"), 0}, {0, 0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot PyPetscComm_Type_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8petsc4py_5PETSc_Comm}, {Py_nb_bool, (void *)__pyx_pw_8petsc4py_5PETSc_4Comm_7__bool__}, {Py_tp_doc, (void *)PyDoc_STR("Communicator object.\n\n Predefined instances:\n\n `COMM_NULL`\n The *null* (or invalid) communicator.\n `COMM_SELF`\n The *self* communicator.\n `COMM_WORLD`\n The *world* communicator.\n\n See Also\n --------\n Sys.setDefaultComm, Sys.getDefaultComm\n\n ")}, {Py_tp_traverse, (void *)__pyx_tp_traverse_8petsc4py_5PETSc_Comm}, {Py_tp_clear, (void *)__pyx_tp_clear_8petsc4py_5PETSc_Comm}, {Py_tp_richcompare, (void *)__pyx_pw_8petsc4py_5PETSc_4Comm_5__richcmp__}, {Py_tp_methods, (void *)__pyx_methods_8petsc4py_5PETSc_Comm}, {Py_tp_getset, (void *)__pyx_getsets_8petsc4py_5PETSc_Comm}, {Py_tp_new, (void *)__pyx_tp_new_8petsc4py_5PETSc_Comm}, {0, 0}, }; static PyType_Spec PyPetscComm_Type_spec = { "petsc4py.PETSc.Comm", sizeof(struct PyPetscCommObject), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, PyPetscComm_Type_slots, }; #else static PyNumberMethods __pyx_tp_as_number_Comm = { 0, /*nb_add*/ 0, /*nb_subtract*/ 0, /*nb_multiply*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_divide*/ #endif 0, /*nb_remainder*/ 0, /*nb_divmod*/ 0, /*nb_power*/ 0, /*nb_negative*/ 0, /*nb_positive*/ 0, /*nb_absolute*/ __pyx_pw_8petsc4py_5PETSc_4Comm_7__bool__, /*nb_bool*/ 0, /*nb_invert*/ 0, /*nb_lshift*/ 0, /*nb_rshift*/ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_coerce*/ #endif 0, /*nb_int*/ #if PY_MAJOR_VERSION < 3 0, /*nb_long*/ #else 0, /*reserved*/ #endif 0, /*nb_float*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_oct*/ #endif #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_hex*/ #endif 0, /*nb_inplace_add*/ 0, /*nb_inplace_subtract*/ 0, /*nb_inplace_multiply*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_inplace_divide*/ #endif 0, /*nb_inplace_remainder*/ 0, /*nb_inplace_power*/ 0, /*nb_inplace_lshift*/ 0, /*nb_inplace_rshift*/ 0, /*nb_inplace_and*/ 0, /*nb_inplace_xor*/ 0, /*nb_inplace_or*/ 0, /*nb_floor_divide*/ 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ 0, /*nb_index*/ #if PY_VERSION_HEX >= 0x03050000 0, /*nb_matrix_multiply*/ #endif #if PY_VERSION_HEX >= 0x03050000 0, /*nb_inplace_matrix_multiply*/ #endif }; DL_EXPORT(PyTypeObject) PyPetscComm_Type = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.""Comm", /*tp_name*/ sizeof(struct PyPetscCommObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Comm, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ &__pyx_tp_as_number_Comm, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ PyDoc_STR("Communicator object.\n\n Predefined instances:\n\n `COMM_NULL`\n The *null* (or invalid) communicator.\n `COMM_SELF`\n The *self* communicator.\n `COMM_WORLD`\n The *world* communicator.\n\n See Also\n --------\n Sys.setDefaultComm, Sys.getDefaultComm\n\n "), /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc_Comm, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc_Comm, /*tp_clear*/ __pyx_pw_8petsc4py_5PETSc_4Comm_5__richcmp__, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_Comm, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_8petsc4py_5PETSc_Comm, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_Comm, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_vtable_8petsc4py_5PETSc_Object; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_Object(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct PyPetscObjectObject *p; PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; #endif p = ((struct PyPetscObjectObject *)o); p->__pyx_vtab = __pyx_vtabptr_8petsc4py_5PETSc_Object; p->__pyx___dummy__ = Py_None; Py_INCREF(Py_None); if (unlikely(__pyx_pw_8petsc4py_5PETSc_6Object_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_8petsc4py_5PETSc_Object(PyObject *o) { struct PyPetscObjectObject *p = (struct PyPetscObjectObject *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_8petsc4py_5PETSc_Object) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); if (p->__weakref__) PyObject_ClearWeakRefs(o); { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); __pyx_pw_8petsc4py_5PETSc_6Object_3__dealloc__(o); __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); PyErr_Restore(etype, eval, etb); } Py_CLEAR(p->__pyx___dummy__); #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static int __pyx_tp_traverse_8petsc4py_5PETSc_Object(PyObject *o, visitproc v, void *a) { int e; struct PyPetscObjectObject *p = (struct PyPetscObjectObject *)o; if (p->__pyx___dummy__) { e = (*v)(p->__pyx___dummy__, a); if (e) return e; } return 0; } static int __pyx_tp_clear_8petsc4py_5PETSc_Object(PyObject *o) { PyObject* tmp; struct PyPetscObjectObject *p = (struct PyPetscObjectObject *)o; tmp = ((PyObject*)p->__pyx___dummy__); p->__pyx___dummy__ = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_getprop_8petsc4py_5PETSc_6Object_type(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_6Object_4type_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_6Object_type(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_6Object_4type_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_6Object_prefix(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_6Object_6prefix_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_6Object_prefix(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_6Object_6prefix_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_6Object_comm(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_6Object_4comm_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_6Object_name(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_6Object_4name_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_6Object_name(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_6Object_4name_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_6Object_classid(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_6Object_7classid_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_6Object_klass(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_6Object_5klass_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_6Object_refcount(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_6Object_8refcount_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_6Object_handle(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_6Object_6handle_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_6Object_fortran(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_6Object_7fortran_1__get__(o); } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_Object[] = { {"__copy__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_9__copy__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_8__copy__}, {"__deepcopy__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_11__deepcopy__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_10__deepcopy__}, {"view", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_13view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_12view}, {"destroy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_15destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_14destroy}, {"getType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_17getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_16getType}, {"setOptionsPrefix", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_19setOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_18setOptionsPrefix}, {"getOptionsPrefix", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_21getOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_20getOptionsPrefix}, {"appendOptionsPrefix", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_23appendOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_22appendOptionsPrefix}, {"setFromOptions", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_25setFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_24setFromOptions}, {"viewFromOptions", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_27viewFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_26viewFromOptions}, {"getComm", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_29getComm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_28getComm}, {"getName", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_31getName, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_30getName}, {"setName", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_33setName, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_32setName}, {"getClassId", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_35getClassId, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_34getClassId}, {"getClassName", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_37getClassName, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_36getClassName}, {"getRefCount", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_39getRefCount, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_38getRefCount}, {"compose", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_41compose, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_40compose}, {"query", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_43query, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_42query}, {"incRef", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_45incRef, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_44incRef}, {"decRef", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_47decRef, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_46decRef}, {"getAttr", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_49getAttr, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_48getAttr}, {"setAttr", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_51setAttr, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_50setAttr}, {"getDict", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_53getDict, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_52getDict}, {"stateIncrease", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_55stateIncrease, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_54stateIncrease}, {"stateGet", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_57stateGet, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_56stateGet}, {"stateSet", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_59stateSet, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_58stateSet}, {"incrementTabLevel", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_61incrementTabLevel, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_60incrementTabLevel}, {"setTabLevel", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_63setTabLevel, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_62setTabLevel}, {"getTabLevel", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_65getTabLevel, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_64getTabLevel}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_8petsc4py_5PETSc_Object[] = { {(char *)"type", __pyx_getprop_8petsc4py_5PETSc_6Object_type, __pyx_setprop_8petsc4py_5PETSc_6Object_type, (char *)0, 0}, {(char *)"prefix", __pyx_getprop_8petsc4py_5PETSc_6Object_prefix, __pyx_setprop_8petsc4py_5PETSc_6Object_prefix, (char *)0, 0}, {(char *)"comm", __pyx_getprop_8petsc4py_5PETSc_6Object_comm, 0, (char *)0, 0}, {(char *)"name", __pyx_getprop_8petsc4py_5PETSc_6Object_name, __pyx_setprop_8petsc4py_5PETSc_6Object_name, (char *)0, 0}, {(char *)"classid", __pyx_getprop_8petsc4py_5PETSc_6Object_classid, 0, (char *)0, 0}, {(char *)"klass", __pyx_getprop_8petsc4py_5PETSc_6Object_klass, 0, (char *)0, 0}, {(char *)"refcount", __pyx_getprop_8petsc4py_5PETSc_6Object_refcount, 0, (char *)0, 0}, {(char *)"handle", __pyx_getprop_8petsc4py_5PETSc_6Object_handle, 0, (char *)0, 0}, {(char *)"fortran", __pyx_getprop_8petsc4py_5PETSc_6Object_fortran, 0, (char *)0, 0}, {0, 0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot PyPetscObject_Type_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8petsc4py_5PETSc_Object}, {Py_nb_bool, (void *)__pyx_pw_8petsc4py_5PETSc_6Object_7__bool__}, {Py_tp_traverse, (void *)__pyx_tp_traverse_8petsc4py_5PETSc_Object}, {Py_tp_clear, (void *)__pyx_tp_clear_8petsc4py_5PETSc_Object}, {Py_tp_richcompare, (void *)__pyx_pw_8petsc4py_5PETSc_6Object_5__richcmp__}, {Py_tp_methods, (void *)__pyx_methods_8petsc4py_5PETSc_Object}, {Py_tp_getset, (void *)__pyx_getsets_8petsc4py_5PETSc_Object}, {Py_tp_new, (void *)__pyx_tp_new_8petsc4py_5PETSc_Object}, {0, 0}, }; static PyType_Spec PyPetscObject_Type_spec = { "petsc4py.PETSc.Object", sizeof(struct PyPetscObjectObject), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, PyPetscObject_Type_slots, }; #else static PyNumberMethods __pyx_tp_as_number_Object = { 0, /*nb_add*/ 0, /*nb_subtract*/ 0, /*nb_multiply*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_divide*/ #endif 0, /*nb_remainder*/ 0, /*nb_divmod*/ 0, /*nb_power*/ 0, /*nb_negative*/ 0, /*nb_positive*/ 0, /*nb_absolute*/ __pyx_pw_8petsc4py_5PETSc_6Object_7__bool__, /*nb_bool*/ 0, /*nb_invert*/ 0, /*nb_lshift*/ 0, /*nb_rshift*/ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_coerce*/ #endif 0, /*nb_int*/ #if PY_MAJOR_VERSION < 3 0, /*nb_long*/ #else 0, /*reserved*/ #endif 0, /*nb_float*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_oct*/ #endif #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_hex*/ #endif 0, /*nb_inplace_add*/ 0, /*nb_inplace_subtract*/ 0, /*nb_inplace_multiply*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_inplace_divide*/ #endif 0, /*nb_inplace_remainder*/ 0, /*nb_inplace_power*/ 0, /*nb_inplace_lshift*/ 0, /*nb_inplace_rshift*/ 0, /*nb_inplace_and*/ 0, /*nb_inplace_xor*/ 0, /*nb_inplace_or*/ 0, /*nb_floor_divide*/ 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ 0, /*nb_index*/ #if PY_VERSION_HEX >= 0x03050000 0, /*nb_matrix_multiply*/ #endif #if PY_VERSION_HEX >= 0x03050000 0, /*nb_inplace_matrix_multiply*/ #endif }; DL_EXPORT(PyTypeObject) PyPetscObject_Type = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.""Object", /*tp_name*/ sizeof(struct PyPetscObjectObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Object, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ &__pyx_tp_as_number_Object, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc_Object, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc_Object, /*tp_clear*/ __pyx_pw_8petsc4py_5PETSc_6Object_5__richcmp__, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_Object, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_8petsc4py_5PETSc_Object, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_Object, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static struct __pyx_vtabstruct_8petsc4py_5PETSc_Viewer __pyx_vtable_8petsc4py_5PETSc_Viewer; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_Viewer(PyTypeObject *t, PyObject *a, PyObject *k) { struct PyPetscViewerObject *p; PyObject *o = __pyx_tp_new_8petsc4py_5PETSc_Object(t, a, k); if (unlikely(!o)) return 0; p = ((struct PyPetscViewerObject *)o); p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Object*)__pyx_vtabptr_8petsc4py_5PETSc_Viewer; if (unlikely(__pyx_pw_8petsc4py_5PETSc_6Viewer_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_Viewer[] = { {"view", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_5view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_4view}, {"destroy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_7destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_6destroy}, {"create", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_9create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_8create}, {"createASCII", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_11createASCII, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_10createASCII}, {"createBinary", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_13createBinary, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_12createBinary}, {"createMPIIO", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_15createMPIIO, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_14createMPIIO}, {"createVTK", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_17createVTK, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_16createVTK}, {"createHDF5", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_19createHDF5, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_18createHDF5}, {"createDraw", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_21createDraw, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_20createDraw}, {"setType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_23setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_22setType}, {"getType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_25getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_24getType}, {"getFormat", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_27getFormat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_26getFormat}, {"pushFormat", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_29pushFormat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_28pushFormat}, {"popFormat", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_31popFormat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_30popFormat}, {"getSubViewer", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_33getSubViewer, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_32getSubViewer}, {"restoreSubViewer", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_35restoreSubViewer, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_34restoreSubViewer}, {"STDOUT", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_37STDOUT, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_36STDOUT}, {"STDERR", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_39STDERR, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_38STDERR}, {"ASCII", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_41ASCII, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_40ASCII}, {"BINARY", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_43BINARY, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_42BINARY}, {"DRAW", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_45DRAW, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_44DRAW}, {"setASCIITab", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_47setASCIITab, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_46setASCIITab}, {"getASCIITab", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_49getASCIITab, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_48getASCIITab}, {"addASCIITab", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_51addASCIITab, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_50addASCIITab}, {"subtractASCIITab", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_53subtractASCIITab, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_52subtractASCIITab}, {"pushASCIISynchronized", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_55pushASCIISynchronized, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_54pushASCIISynchronized}, {"popASCIISynchronized", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_57popASCIISynchronized, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_56popASCIISynchronized}, {"pushASCIITab", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_59pushASCIITab, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_58pushASCIITab}, {"popASCIITab", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_61popASCIITab, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_60popASCIITab}, {"useASCIITabs", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_63useASCIITabs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_62useASCIITabs}, {"printfASCII", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_65printfASCII, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_64printfASCII}, {"printfASCIISynchronized", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_67printfASCIISynchronized, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_66printfASCIISynchronized}, {"flush", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_69flush, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_68flush}, {"setFileMode", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_71setFileMode, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_70setFileMode}, {"getFileMode", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_73getFileMode, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_72getFileMode}, {"setFileName", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_75setFileName, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_74setFileName}, {"getFileName", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_77getFileName, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_76getFileName}, {"setDrawInfo", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_79setDrawInfo, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_78setDrawInfo}, {"clearDraw", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_81clearDraw, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_80clearDraw}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot PyPetscViewer_Type_slots[] = { {Py_tp_call, (void *)__pyx_pw_8petsc4py_5PETSc_6Viewer_3__call__}, {Py_tp_doc, (void *)PyDoc_STR("Viewer object.\n\n Viewer is described in the `PETSc manual `.\n\n Viewers can be called as functions where the argument specified is the PETSc object to be viewed. See the example below.\n\n Examples\n --------\n >>> from petsc4py import PETSc\n >>> u = PETSc.Vec().createWithArray([1,2])\n >>> v = PETSc.Viewer()\n >>> v(u)\n Vec Object: 1 MPI process\n type: seq\n 1.\n 2.\n\n See Also\n --------\n petsc.PetscViewer\n\n ")}, {Py_tp_traverse, (void *)__pyx_tp_traverse_8petsc4py_5PETSc_Object}, {Py_tp_clear, (void *)__pyx_tp_clear_8petsc4py_5PETSc_Object}, {Py_tp_methods, (void *)__pyx_methods_8petsc4py_5PETSc_Viewer}, {Py_tp_new, (void *)__pyx_tp_new_8petsc4py_5PETSc_Viewer}, {0, 0}, }; static PyType_Spec PyPetscViewer_Type_spec = { "petsc4py.PETSc.Viewer", sizeof(struct PyPetscViewerObject), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, PyPetscViewer_Type_slots, }; #else DL_EXPORT(PyTypeObject) PyPetscViewer_Type = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.""Viewer", /*tp_name*/ sizeof(struct PyPetscViewerObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Object, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ __pyx_pw_8petsc4py_5PETSc_6Viewer_3__call__, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ PyDoc_STR("Viewer object.\n\n Viewer is described in the `PETSc manual `.\n\n Viewers can be called as functions where the argument specified is the PETSc object to be viewed. See the example below.\n\n Examples\n --------\n >>> from petsc4py import PETSc\n >>> u = PETSc.Vec().createWithArray([1,2])\n >>> v = PETSc.Viewer()\n >>> v(u)\n Vec Object: 1 MPI process\n type: seq\n 1.\n 2.\n\n See Also\n --------\n petsc.PetscViewer\n\n "), /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc_Object, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc_Object, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_Viewer, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_Viewer, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static struct __pyx_vtabstruct_8petsc4py_5PETSc_Random __pyx_vtable_8petsc4py_5PETSc_Random; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_Random(PyTypeObject *t, PyObject *a, PyObject *k) { struct PyPetscRandomObject *p; PyObject *o = __pyx_tp_new_8petsc4py_5PETSc_Object(t, a, k); if (unlikely(!o)) return 0; p = ((struct PyPetscRandomObject *)o); p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Object*)__pyx_vtabptr_8petsc4py_5PETSc_Random; if (unlikely(__pyx_pw_8petsc4py_5PETSc_6Random_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static PyObject *__pyx_getprop_8petsc4py_5PETSc_6Random_seed(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_6Random_4seed_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_6Random_seed(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_6Random_4seed_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_6Random_interval(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_6Random_8interval_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_6Random_interval(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_6Random_8interval_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_Random[] = { {"view", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Random_5view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Random_4view}, {"destroy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Random_7destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Random_6destroy}, {"create", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Random_9create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Random_8create}, {"setType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Random_11setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Random_10setType}, {"getType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Random_13getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Random_12getType}, {"setFromOptions", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Random_15setFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Random_14setFromOptions}, {"getValue", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Random_17getValue, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Random_16getValue}, {"getValueReal", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Random_19getValueReal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Random_18getValueReal}, {"getSeed", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Random_21getSeed, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Random_20getSeed}, {"setSeed", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Random_23setSeed, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Random_22setSeed}, {"getInterval", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Random_25getInterval, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Random_24getInterval}, {"setInterval", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Random_27setInterval, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Random_26setInterval}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_8petsc4py_5PETSc_Random[] = { {(char *)"seed", __pyx_getprop_8petsc4py_5PETSc_6Random_seed, __pyx_setprop_8petsc4py_5PETSc_6Random_seed, (char *)PyDoc_STR("Random.seed: int\nThe seed of the random number generator.\nSource code at petsc4py/PETSc/Random.pyx:232"), 0}, {(char *)"interval", __pyx_getprop_8petsc4py_5PETSc_6Random_interval, __pyx_setprop_8petsc4py_5PETSc_6Random_interval, (char *)PyDoc_STR("Random.interval: tuple[Scalar, Scalar]\nThe interval of the generated random numbers.\nSource code at petsc4py/PETSc/Random.pyx:239"), 0}, {0, 0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot PyPetscRandom_Type_slots[] = { {Py_tp_call, (void *)__pyx_pw_8petsc4py_5PETSc_6Random_3__call__}, {Py_tp_doc, (void *)PyDoc_STR("The random number generator object.\n\n See Also\n --------\n petsc.PetscRandom\n\n ")}, {Py_tp_traverse, (void *)__pyx_tp_traverse_8petsc4py_5PETSc_Object}, {Py_tp_clear, (void *)__pyx_tp_clear_8petsc4py_5PETSc_Object}, {Py_tp_methods, (void *)__pyx_methods_8petsc4py_5PETSc_Random}, {Py_tp_getset, (void *)__pyx_getsets_8petsc4py_5PETSc_Random}, {Py_tp_new, (void *)__pyx_tp_new_8petsc4py_5PETSc_Random}, {0, 0}, }; static PyType_Spec PyPetscRandom_Type_spec = { "petsc4py.PETSc.Random", sizeof(struct PyPetscRandomObject), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, PyPetscRandom_Type_slots, }; #else DL_EXPORT(PyTypeObject) PyPetscRandom_Type = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.""Random", /*tp_name*/ sizeof(struct PyPetscRandomObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Object, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ __pyx_pw_8petsc4py_5PETSc_6Random_3__call__, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ PyDoc_STR("The random number generator object.\n\n See Also\n --------\n petsc.PetscRandom\n\n "), /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc_Object, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc_Object, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_Random, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_8petsc4py_5PETSc_Random, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_Random, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static PyObject *__pyx_tp_new_8petsc4py_5PETSc_Device(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; #endif if (unlikely(__pyx_pw_8petsc4py_5PETSc_6Device_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_8petsc4py_5PETSc_Device(PyObject *o) { struct PyPetscDeviceObject *p = (struct PyPetscDeviceObject *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_8petsc4py_5PETSc_Device) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif if (p->__weakref__) PyObject_ClearWeakRefs(o); { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); __pyx_pw_8petsc4py_5PETSc_6Device_3__dealloc__(o); __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); PyErr_Restore(etype, eval, etb); } #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static PyObject *__pyx_getprop_8petsc4py_5PETSc_6Device_type(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_6Device_4type_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_6Device_device_id(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_6Device_9device_id_1__get__(o); } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_Device[] = { {"create", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Device_5create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Device_4create}, {"destroy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Device_7destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Device_6destroy}, {"configure", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Device_9configure, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Device_8configure}, {"view", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Device_11view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Device_10view}, {"getDeviceType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Device_13getDeviceType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Device_12getDeviceType}, {"getDeviceId", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Device_15getDeviceId, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Device_14getDeviceId}, {"setDefaultType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Device_17setDefaultType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Device_16setDefaultType}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_8petsc4py_5PETSc_Device[] = { {(char *)"type", __pyx_getprop_8petsc4py_5PETSc_6Device_type, 0, (char *)PyDoc_STR("Device.type: str\nThe device type.\nSource code at petsc4py/PETSc/Device.pyx:206"), 0}, {(char *)"device_id", __pyx_getprop_8petsc4py_5PETSc_6Device_device_id, 0, (char *)PyDoc_STR("Device.device_id: int\nThe device id.\nSource code at petsc4py/PETSc/Device.pyx:211"), 0}, {0, 0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot PyPetscDevice_Type_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8petsc4py_5PETSc_Device}, {Py_tp_doc, (void *)PyDoc_STR("The device object.\n\n Represents a handle to an accelerator (which may be the host).\n\n See Also\n --------\n DeviceContext, petsc.PetscDevice\n\n ")}, {Py_tp_methods, (void *)__pyx_methods_8petsc4py_5PETSc_Device}, {Py_tp_getset, (void *)__pyx_getsets_8petsc4py_5PETSc_Device}, {Py_tp_new, (void *)__pyx_tp_new_8petsc4py_5PETSc_Device}, {0, 0}, }; static PyType_Spec PyPetscDevice_Type_spec = { "petsc4py.PETSc.Device", sizeof(struct PyPetscDeviceObject), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, PyPetscDevice_Type_slots, }; #else DL_EXPORT(PyTypeObject) PyPetscDevice_Type = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.""Device", /*tp_name*/ sizeof(struct PyPetscDeviceObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Device, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ PyDoc_STR("The device object.\n\n Represents a handle to an accelerator (which may be the host).\n\n See Also\n --------\n DeviceContext, petsc.PetscDevice\n\n "), /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_Device, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_8petsc4py_5PETSc_Device, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_Device, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static struct __pyx_vtabstruct_8petsc4py_5PETSc_DeviceContext __pyx_vtable_8petsc4py_5PETSc_DeviceContext; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_DeviceContext(PyTypeObject *t, PyObject *a, PyObject *k) { struct PyPetscDeviceContextObject *p; PyObject *o = __pyx_tp_new_8petsc4py_5PETSc_Object(t, a, k); if (unlikely(!o)) return 0; p = ((struct PyPetscDeviceContextObject *)o); p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Object*)__pyx_vtabptr_8petsc4py_5PETSc_DeviceContext; if (unlikely(__pyx_pw_8petsc4py_5PETSc_13DeviceContext_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_8petsc4py_5PETSc_DeviceContext(PyObject *o) { #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_8petsc4py_5PETSc_DeviceContext) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); __pyx_pw_8petsc4py_5PETSc_13DeviceContext_3__dealloc__(o); __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); PyErr_Restore(etype, eval, etb); } PyObject_GC_Track(o); __pyx_tp_dealloc_8petsc4py_5PETSc_Object(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_13DeviceContext_stream_type(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_13DeviceContext_11stream_type_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_13DeviceContext_stream_type(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_13DeviceContext_11stream_type_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_13DeviceContext_device(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_13DeviceContext_6device_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_13DeviceContext_device(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_13DeviceContext_6device_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_13DeviceContext_current(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_13DeviceContext_7current_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_13DeviceContext_current(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_13DeviceContext_7current_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_DeviceContext[] = { {"create", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13DeviceContext_5create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13DeviceContext_4create}, {"getStreamType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13DeviceContext_7getStreamType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13DeviceContext_6getStreamType}, {"setStreamType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13DeviceContext_9setStreamType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13DeviceContext_8setStreamType}, {"getDevice", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13DeviceContext_11getDevice, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13DeviceContext_10getDevice}, {"setDevice", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13DeviceContext_13setDevice, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13DeviceContext_12setDevice}, {"setUp", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13DeviceContext_15setUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13DeviceContext_14setUp}, {"duplicate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13DeviceContext_17duplicate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13DeviceContext_16duplicate}, {"idle", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13DeviceContext_19idle, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13DeviceContext_18idle}, {"waitFor", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13DeviceContext_21waitFor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13DeviceContext_20waitFor}, {"fork", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13DeviceContext_23fork, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13DeviceContext_22fork}, {"join", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13DeviceContext_25join, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13DeviceContext_24join}, {"synchronize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13DeviceContext_27synchronize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13DeviceContext_26synchronize}, {"setFromOptions", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13DeviceContext_29setFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13DeviceContext_28setFromOptions}, {"getCurrent", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13DeviceContext_31getCurrent, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13DeviceContext_30getCurrent}, {"setCurrent", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13DeviceContext_33setCurrent, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13DeviceContext_32setCurrent}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_8petsc4py_5PETSc_DeviceContext[] = { {(char *)"stream_type", __pyx_getprop_8petsc4py_5PETSc_13DeviceContext_stream_type, __pyx_setprop_8petsc4py_5PETSc_13DeviceContext_stream_type, (char *)PyDoc_STR("DeviceContext.stream_type: str\nThe stream type.\nSource code at petsc4py/PETSc/Device.pyx:526"), 0}, {(char *)"device", __pyx_getprop_8petsc4py_5PETSc_13DeviceContext_device, __pyx_setprop_8petsc4py_5PETSc_13DeviceContext_device, (char *)PyDoc_STR("DeviceContext.device: Device\nThe device associated to the device context.\nSource code at petsc4py/PETSc/Device.pyx:533"), 0}, {(char *)"current", __pyx_getprop_8petsc4py_5PETSc_13DeviceContext_current, __pyx_setprop_8petsc4py_5PETSc_13DeviceContext_current, (char *)PyDoc_STR("DeviceContext.current: DeviceContext\nThe current global device context.\nSource code at petsc4py/PETSc/Device.pyx:540"), 0}, {0, 0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot PyPetscDeviceContext_Type_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8petsc4py_5PETSc_DeviceContext}, {Py_tp_doc, (void *)PyDoc_STR("DeviceContext object.\n\n Represents an abstract handle to a device context.\n\n See Also\n --------\n Device, petsc.PetscDeviceContext\n\n ")}, {Py_tp_traverse, (void *)__pyx_tp_traverse_8petsc4py_5PETSc_Object}, {Py_tp_clear, (void *)__pyx_tp_clear_8petsc4py_5PETSc_Object}, {Py_tp_methods, (void *)__pyx_methods_8petsc4py_5PETSc_DeviceContext}, {Py_tp_getset, (void *)__pyx_getsets_8petsc4py_5PETSc_DeviceContext}, {Py_tp_new, (void *)__pyx_tp_new_8petsc4py_5PETSc_DeviceContext}, {0, 0}, }; static PyType_Spec PyPetscDeviceContext_Type_spec = { "petsc4py.PETSc.DeviceContext", sizeof(struct PyPetscDeviceContextObject), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, PyPetscDeviceContext_Type_slots, }; #else DL_EXPORT(PyTypeObject) PyPetscDeviceContext_Type = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.""DeviceContext", /*tp_name*/ sizeof(struct PyPetscDeviceContextObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_DeviceContext, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ PyDoc_STR("DeviceContext object.\n\n Represents an abstract handle to a device context.\n\n See Also\n --------\n Device, petsc.PetscDeviceContext\n\n "), /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc_Object, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc_Object, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_DeviceContext, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_8petsc4py_5PETSc_DeviceContext, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_DeviceContext, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static struct __pyx_vtabstruct_8petsc4py_5PETSc_IS __pyx_vtable_8petsc4py_5PETSc_IS; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_IS(PyTypeObject *t, PyObject *a, PyObject *k) { struct PyPetscISObject *p; PyObject *o = __pyx_tp_new_8petsc4py_5PETSc_Object(t, a, k); if (unlikely(!o)) return 0; p = ((struct PyPetscISObject *)o); p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Object*)__pyx_vtabptr_8petsc4py_5PETSc_IS; if (unlikely(__pyx_pw_8petsc4py_5PETSc_2IS_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static PyObject *__pyx_getprop_8petsc4py_5PETSc_2IS_permutation(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_2IS_11permutation_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_2IS_identity(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_2IS_8identity_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_2IS_sorted(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_2IS_6sorted_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_2IS_sizes(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_2IS_5sizes_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_2IS_size(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_2IS_4size_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_2IS_local_size(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_2IS_10local_size_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_2IS_block_size(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_2IS_10block_size_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_2IS_indices(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_2IS_7indices_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_2IS_array(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_2IS_5array_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_2IS___array_interface__(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_2IS_19__array_interface___1__get__(o); } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_IS[] = { {"__enter__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_7__enter__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_6__enter__}, {"__exit__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_9__exit__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_8__exit__}, {"view", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_11view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_10view}, {"destroy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_13destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_12destroy}, {"create", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_15create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_14create}, {"setType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_17setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_16setType}, {"getType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_19getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_18getType}, {"createGeneral", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_21createGeneral, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_20createGeneral}, {"createBlock", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_23createBlock, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_22createBlock}, {"createStride", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_25createStride, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_24createStride}, {"duplicate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_27duplicate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_26duplicate}, {"copy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_29copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_28copy}, {"load", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_31load, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_30load}, {"allGather", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_33allGather, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_32allGather}, {"toGeneral", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_35toGeneral, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_34toGeneral}, {"buildTwoSided", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_37buildTwoSided, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_36buildTwoSided}, {"invertPermutation", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_39invertPermutation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_38invertPermutation}, {"getSize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_41getSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_40getSize}, {"getLocalSize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_43getLocalSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_42getLocalSize}, {"getSizes", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_45getSizes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_44getSizes}, {"getBlockSize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_47getBlockSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_46getBlockSize}, {"setBlockSize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_49setBlockSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_48setBlockSize}, {"sort", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_51sort, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_50sort}, {"isSorted", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_53isSorted, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_52isSorted}, {"setPermutation", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_55setPermutation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_54setPermutation}, {"isPermutation", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_57isPermutation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_56isPermutation}, {"setIdentity", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_59setIdentity, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_58setIdentity}, {"isIdentity", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_61isIdentity, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_60isIdentity}, {"equal", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_63equal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_62equal}, {"sum", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_65sum, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_64sum}, {"expand", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_67expand, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_66expand}, {"union", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_69union, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_68union}, {"difference", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_71difference, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_70difference}, {"complement", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_73complement, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_72complement}, {"embed", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_75embed, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_74embed}, {"renumber", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_77renumber, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_76renumber}, {"setIndices", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_79setIndices, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_78setIndices}, {"getIndices", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_81getIndices, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_80getIndices}, {"setBlockIndices", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_83setBlockIndices, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_82setBlockIndices}, {"getBlockIndices", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_85getBlockIndices, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_84getBlockIndices}, {"setStride", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_87setStride, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_86setStride}, {"getStride", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_89getStride, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_88getStride}, {"getInfo", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_91getInfo, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_90getInfo}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_8petsc4py_5PETSc_IS[] = { {(char *)"permutation", __pyx_getprop_8petsc4py_5PETSc_2IS_permutation, 0, (char *)PyDoc_STR("IS.permutation: bool\n`True` if index set is a permutation, `False` otherwise.\n\n Logically collective.\n\n See Also\n --------\n IS.isPermutation\n\n \nSource code at petsc4py/PETSc/IS.pyx:928"), 0}, {(char *)"identity", __pyx_getprop_8petsc4py_5PETSc_2IS_identity, 0, (char *)PyDoc_STR("IS.identity: bool\n`True` if index set is an identity, `False` otherwise.\n\n Collective.\n\n See Also\n --------\n IS.isIdentity\n\n \nSource code at petsc4py/PETSc/IS.pyx:941"), 0}, {(char *)"sorted", __pyx_getprop_8petsc4py_5PETSc_2IS_sorted, 0, (char *)PyDoc_STR("IS.sorted: bool\n`True` if index set is sorted, `False` otherwise.\n\n Collective.\n\n See Also\n --------\n IS.isSorted\n\n \nSource code at petsc4py/PETSc/IS.pyx:954"), 0}, {(char *)"sizes", __pyx_getprop_8petsc4py_5PETSc_2IS_sizes, 0, (char *)PyDoc_STR("IS.sizes: tuple[int, int]\nThe local and global sizes of the index set.\n\n Not collective.\n\n See Also\n --------\n IS.getSizes\n\n \nSource code at petsc4py/PETSc/IS.pyx:969"), 0}, {(char *)"size", __pyx_getprop_8petsc4py_5PETSc_2IS_size, 0, (char *)PyDoc_STR("IS.size: int\nThe global size of the index set.\n\n Not collective.\n\n See Also\n --------\n IS.getSize\n\n \nSource code at petsc4py/PETSc/IS.pyx:982"), 0}, {(char *)"local_size", __pyx_getprop_8petsc4py_5PETSc_2IS_local_size, 0, (char *)PyDoc_STR("IS.local_size: int\nThe local size of the index set.\n\n Not collective.\n\n See Also\n --------\n IS.getLocalSize\n\n \nSource code at petsc4py/PETSc/IS.pyx:995"), 0}, {(char *)"block_size", __pyx_getprop_8petsc4py_5PETSc_2IS_block_size, 0, (char *)PyDoc_STR("IS.block_size: int\nThe number of elements in a block.\n\n Not collective.\n\n See Also\n --------\n IS.getBlockSize\n\n \nSource code at petsc4py/PETSc/IS.pyx:1008"), 0}, {(char *)"indices", __pyx_getprop_8petsc4py_5PETSc_2IS_indices, 0, (char *)PyDoc_STR("IS.indices: ArrayInt\nThe indices of the index set.\n\n Not collective.\n\n See Also\n --------\n IS.getIndices\n\n \nSource code at petsc4py/PETSc/IS.pyx:1021"), 0}, {(char *)"array", __pyx_getprop_8petsc4py_5PETSc_2IS_array, 0, (char *)PyDoc_STR("IS.array: ArrayInt\nView of the index set as an array of integers.\n\n Not collective.\n\n \nSource code at petsc4py/PETSc/IS.pyx:1034"), 0}, {(char *)"__array_interface__", __pyx_getprop_8petsc4py_5PETSc_2IS___array_interface__, 0, (char *)0, 0}, {0, 0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS #if !CYTHON_COMPILING_IN_LIMITED_API static PyBufferProcs __pyx_tp_as_buffer_IS = { #if PY_MAJOR_VERSION < 3 0, /*bf_getreadbuffer*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getwritebuffer*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getsegcount*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getcharbuffer*/ #endif __pyx_pw_8petsc4py_5PETSc_2IS_3__getbuffer__, /*bf_getbuffer*/ __pyx_pw_8petsc4py_5PETSc_2IS_5__releasebuffer__, /*bf_releasebuffer*/ }; #endif static PyType_Slot PyPetscIS_Type_slots[] = { #if defined(Py_bf_getbuffer) {Py_bf_getbuffer, (void *)__pyx_pw_8petsc4py_5PETSc_2IS_3__getbuffer__}, #endif #if defined(Py_bf_releasebuffer) {Py_bf_releasebuffer, (void *)__pyx_pw_8petsc4py_5PETSc_2IS_5__releasebuffer__}, #endif {Py_tp_doc, (void *)PyDoc_STR("A collection of indices.\n\n IS objects are used to index into vectors and matrices and to set up vector\n scatters.\n\n See Also\n --------\n petsc.IS\n\n ")}, {Py_tp_traverse, (void *)__pyx_tp_traverse_8petsc4py_5PETSc_Object}, {Py_tp_clear, (void *)__pyx_tp_clear_8petsc4py_5PETSc_Object}, {Py_tp_methods, (void *)__pyx_methods_8petsc4py_5PETSc_IS}, {Py_tp_getset, (void *)__pyx_getsets_8petsc4py_5PETSc_IS}, {Py_tp_new, (void *)__pyx_tp_new_8petsc4py_5PETSc_IS}, {0, 0}, }; static PyType_Spec PyPetscIS_Type_spec = { "petsc4py.PETSc.IS", sizeof(struct PyPetscISObject), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, PyPetscIS_Type_slots, }; #else static PyBufferProcs __pyx_tp_as_buffer_IS = { #if PY_MAJOR_VERSION < 3 0, /*bf_getreadbuffer*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getwritebuffer*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getsegcount*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getcharbuffer*/ #endif __pyx_pw_8petsc4py_5PETSc_2IS_3__getbuffer__, /*bf_getbuffer*/ __pyx_pw_8petsc4py_5PETSc_2IS_5__releasebuffer__, /*bf_releasebuffer*/ }; DL_EXPORT(PyTypeObject) PyPetscIS_Type = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.""IS", /*tp_name*/ sizeof(struct PyPetscISObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Object, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer_IS, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ PyDoc_STR("A collection of indices.\n\n IS objects are used to index into vectors and matrices and to set up vector\n scatters.\n\n See Also\n --------\n petsc.IS\n\n "), /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc_Object, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc_Object, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_IS, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_8petsc4py_5PETSc_IS, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_IS, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static struct __pyx_vtabstruct_8petsc4py_5PETSc_LGMap __pyx_vtable_8petsc4py_5PETSc_LGMap; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_LGMap(PyTypeObject *t, PyObject *a, PyObject *k) { struct PyPetscLGMapObject *p; PyObject *o = __pyx_tp_new_8petsc4py_5PETSc_Object(t, a, k); if (unlikely(!o)) return 0; p = ((struct PyPetscLGMapObject *)o); p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Object*)__pyx_vtabptr_8petsc4py_5PETSc_LGMap; if (unlikely(__pyx_pw_8petsc4py_5PETSc_5LGMap_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static PyObject *__pyx_getprop_8petsc4py_5PETSc_5LGMap_size(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_5LGMap_4size_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_5LGMap_block_size(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_5LGMap_10block_size_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_5LGMap_indices(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_5LGMap_7indices_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_5LGMap_block_indices(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_5LGMap_13block_indices_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_5LGMap_info(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_5LGMap_4info_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_5LGMap_block_info(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_5LGMap_10block_info_1__get__(o); } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_LGMap[] = { {"setType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_5setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_4setType}, {"setFromOptions", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_7setFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_6setFromOptions}, {"view", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_9view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_8view}, {"destroy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_11destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_10destroy}, {"create", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_13create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_12create}, {"createIS", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_15createIS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_14createIS}, {"createSF", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_17createSF, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_16createSF}, {"getSize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_19getSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_18getSize}, {"getBlockSize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_21getBlockSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_20getBlockSize}, {"getIndices", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_23getIndices, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_22getIndices}, {"getBlockIndices", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_25getBlockIndices, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_24getBlockIndices}, {"getInfo", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_27getInfo, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_26getInfo}, {"getBlockInfo", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_29getBlockInfo, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_28getBlockInfo}, {"apply", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_31apply, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_30apply}, {"applyBlock", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_33applyBlock, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_32applyBlock}, {"applyIS", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_35applyIS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_34applyIS}, {"applyInverse", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_37applyInverse, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_36applyInverse}, {"applyBlockInverse", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_39applyBlockInverse, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_38applyBlockInverse}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_8petsc4py_5PETSc_LGMap[] = { {(char *)"size", __pyx_getprop_8petsc4py_5PETSc_5LGMap_size, 0, (char *)PyDoc_STR("LGMap.size: int\nThe local size.\n\n Not collective.\n\n See Also\n --------\n LGMap.getSize\n\n \nSource code at petsc4py/PETSc/IS.pyx:1589"), 0}, {(char *)"block_size", __pyx_getprop_8petsc4py_5PETSc_5LGMap_block_size, 0, (char *)PyDoc_STR("LGMap.block_size: int\nThe block size.\n\n Not collective.\n\n See Also\n --------\n LGMap.getBlockSize\n\n \nSource code at petsc4py/PETSc/IS.pyx:1602"), 0}, {(char *)"indices", __pyx_getprop_8petsc4py_5PETSc_5LGMap_indices, 0, (char *)PyDoc_STR("LGMap.indices: ArrayInt\nThe global indices for each local point in the mapping.\n\n Not collective.\n\n See Also\n --------\n LGMap.getIndices, petsc.ISLocalToGlobalMappingGetIndices\n\n \nSource code at petsc4py/PETSc/IS.pyx:1615"), 0}, {(char *)"block_indices", __pyx_getprop_8petsc4py_5PETSc_5LGMap_block_indices, 0, (char *)PyDoc_STR("LGMap.block_indices: ArrayInt\nThe global indices for each local block in the mapping.\n\n Not collective.\n\n See Also\n --------\n LGMap.getBlockIndices, petsc.ISLocalToGlobalMappingGetBlockIndices\n\n \nSource code at petsc4py/PETSc/IS.pyx:1628"), 0}, {(char *)"info", __pyx_getprop_8petsc4py_5PETSc_5LGMap_info, 0, (char *)PyDoc_STR("LGMap.info: dict[int, ArrayInt]\nMapping describing indices shared with neighboring processes.\n\n Collective.\n\n See Also\n --------\n LGMap.getInfo, petsc.ISLocalToGlobalMappingGetInfo\n\n \nSource code at petsc4py/PETSc/IS.pyx:1641"), 0}, {(char *)"block_info", __pyx_getprop_8petsc4py_5PETSc_5LGMap_block_info, 0, (char *)PyDoc_STR("LGMap.block_info: dict[int, ArrayInt]\nMapping describing block indices shared with neighboring processes.\n\n Collective.\n\n See Also\n --------\n LGMap.getBlockInfo, petsc.ISLocalToGlobalMappingGetBlockInfo\n\n \nSource code at petsc4py/PETSc/IS.pyx:1654"), 0}, {0, 0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot PyPetscLGMap_Type_slots[] = { {Py_tp_call, (void *)__pyx_pw_8petsc4py_5PETSc_5LGMap_3__call__}, {Py_tp_doc, (void *)PyDoc_STR("Mapping from an arbitrary local ordering from ``0`` to ``n-1`` to a global PETSc ordering used by a vector or matrix.\n\n See Also\n --------\n petsc.ISLocalToGlobalMapping\n\n ")}, {Py_tp_traverse, (void *)__pyx_tp_traverse_8petsc4py_5PETSc_Object}, {Py_tp_clear, (void *)__pyx_tp_clear_8petsc4py_5PETSc_Object}, {Py_tp_methods, (void *)__pyx_methods_8petsc4py_5PETSc_LGMap}, {Py_tp_getset, (void *)__pyx_getsets_8petsc4py_5PETSc_LGMap}, {Py_tp_new, (void *)__pyx_tp_new_8petsc4py_5PETSc_LGMap}, {0, 0}, }; static PyType_Spec PyPetscLGMap_Type_spec = { "petsc4py.PETSc.LGMap", sizeof(struct PyPetscLGMapObject), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, PyPetscLGMap_Type_slots, }; #else DL_EXPORT(PyTypeObject) PyPetscLGMap_Type = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.""LGMap", /*tp_name*/ sizeof(struct PyPetscLGMapObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Object, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ __pyx_pw_8petsc4py_5PETSc_5LGMap_3__call__, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ PyDoc_STR("Mapping from an arbitrary local ordering from ``0`` to ``n-1`` to a global PETSc ordering used by a vector or matrix.\n\n See Also\n --------\n petsc.ISLocalToGlobalMapping\n\n "), /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc_Object, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc_Object, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_LGMap, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_8petsc4py_5PETSc_LGMap, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_LGMap, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static struct __pyx_vtabstruct_8petsc4py_5PETSc_SF __pyx_vtable_8petsc4py_5PETSc_SF; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_SF(PyTypeObject *t, PyObject *a, PyObject *k) { struct PyPetscSFObject *p; PyObject *o = __pyx_tp_new_8petsc4py_5PETSc_Object(t, a, k); if (unlikely(!o)) return 0; p = ((struct PyPetscSFObject *)o); p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Object*)__pyx_vtabptr_8petsc4py_5PETSc_SF; if (unlikely(__pyx_pw_8petsc4py_5PETSc_2SF_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_8petsc4py_5PETSc_SF(PyObject *o) { #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_8petsc4py_5PETSc_SF) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); __pyx_pw_8petsc4py_5PETSc_2SF_3__dealloc__(o); __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); PyErr_Restore(etype, eval, etb); } PyObject_GC_Track(o); __pyx_tp_dealloc_8petsc4py_5PETSc_Object(o); } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_SF[] = { {"view", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_5view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_4view}, {"destroy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_7destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_6destroy}, {"create", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_9create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_8create}, {"setType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_11setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_10setType}, {"getType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_13getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_12getType}, {"setFromOptions", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_15setFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_14setFromOptions}, {"setUp", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_17setUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_16setUp}, {"reset", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_19reset, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_18reset}, {"getGraph", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_21getGraph, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_20getGraph}, {"setGraph", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_23setGraph, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_22setGraph}, {"setRankOrder", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_25setRankOrder, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_24setRankOrder}, {"getMulti", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_27getMulti, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_26getMulti}, {"createInverse", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_29createInverse, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_28createInverse}, {"computeDegree", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_31computeDegree, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_30computeDegree}, {"createEmbeddedRootSF", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_33createEmbeddedRootSF, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_32createEmbeddedRootSF}, {"createEmbeddedLeafSF", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_35createEmbeddedLeafSF, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_34createEmbeddedLeafSF}, {"createSectionSF", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_37createSectionSF, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_36createSectionSF}, {"distributeSection", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_39distributeSection, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_38distributeSection}, {"compose", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_41compose, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_40compose}, {"bcastBegin", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_43bcastBegin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_42bcastBegin}, {"bcastEnd", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_45bcastEnd, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_44bcastEnd}, {"reduceBegin", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_47reduceBegin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_46reduceBegin}, {"reduceEnd", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_49reduceEnd, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_48reduceEnd}, {"scatterBegin", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_51scatterBegin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_50scatterBegin}, {"scatterEnd", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_53scatterEnd, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_52scatterEnd}, {"gatherBegin", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_55gatherBegin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_54gatherBegin}, {"gatherEnd", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_57gatherEnd, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_56gatherEnd}, {"fetchAndOpBegin", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_59fetchAndOpBegin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_58fetchAndOpBegin}, {"fetchAndOpEnd", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_61fetchAndOpEnd, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_60fetchAndOpEnd}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot PyPetscSF_Type_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8petsc4py_5PETSc_SF}, {Py_tp_doc, (void *)PyDoc_STR("Star Forest object for communication.\n\n SF is used for setting up and managing the communication of certain\n entries of arrays and `Vec` between MPI processes.\n\n ")}, {Py_tp_traverse, (void *)__pyx_tp_traverse_8petsc4py_5PETSc_Object}, {Py_tp_clear, (void *)__pyx_tp_clear_8petsc4py_5PETSc_Object}, {Py_tp_methods, (void *)__pyx_methods_8petsc4py_5PETSc_SF}, {Py_tp_new, (void *)__pyx_tp_new_8petsc4py_5PETSc_SF}, {0, 0}, }; static PyType_Spec PyPetscSF_Type_spec = { "petsc4py.PETSc.SF", sizeof(struct PyPetscSFObject), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, PyPetscSF_Type_slots, }; #else DL_EXPORT(PyTypeObject) PyPetscSF_Type = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.""SF", /*tp_name*/ sizeof(struct PyPetscSFObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_SF, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ PyDoc_STR("Star Forest object for communication.\n\n SF is used for setting up and managing the communication of certain\n entries of arrays and `Vec` between MPI processes.\n\n "), /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc_Object, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc_Object, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_SF, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_SF, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static struct __pyx_vtabstruct_8petsc4py_5PETSc_Vec __pyx_vtable_8petsc4py_5PETSc_Vec; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_Vec(PyTypeObject *t, PyObject *a, PyObject *k) { struct PyPetscVecObject *p; PyObject *o = __pyx_tp_new_8petsc4py_5PETSc_Object(t, a, k); if (unlikely(!o)) return 0; p = ((struct PyPetscVecObject *)o); p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Object*)__pyx_vtabptr_8petsc4py_5PETSc_Vec; if (unlikely(__pyx_pw_8petsc4py_5PETSc_3Vec_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static PyObject *__pyx_sq_item_8petsc4py_5PETSc_Vec(PyObject *o, Py_ssize_t i) { PyObject *r; PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); Py_DECREF(x); return r; } static int __pyx_mp_ass_subscript_8petsc4py_5PETSc_Vec(PyObject *o, PyObject *i, PyObject *v) { if (v) { return __pyx_pw_8petsc4py_5PETSc_3Vec_43__setitem__(o, i, v); } else { __Pyx_TypeName o_type_name; if (__pyx_ptype_8petsc4py_5PETSc_Object->tp_as_mapping && __pyx_ptype_8petsc4py_5PETSc_Object->tp_as_mapping->mp_ass_subscript) return __pyx_ptype_8petsc4py_5PETSc_Object->tp_as_mapping->mp_ass_subscript(o, i, v); o_type_name = __Pyx_PyType_GetName(Py_TYPE(o)); PyErr_Format(PyExc_NotImplementedError, "Subscript deletion not supported by " __Pyx_FMT_TYPENAME, o_type_name); __Pyx_DECREF_TypeName(o_type_name); return -1; } } static CYTHON_INLINE PyObject *__pyx_nb_add_8petsc4py_5PETSc_Vec_maybe_call_slot(PyTypeObject* type, PyObject *left, PyObject *right ) { binaryfunc slot; #if CYTHON_USE_TYPE_SLOTS || PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY slot = type->tp_as_number ? type->tp_as_number->nb_add : NULL; #else slot = (binaryfunc) PyType_GetSlot(type, Py_nb_add); #endif return slot ? slot(left, right ) : __Pyx_NewRef(Py_NotImplemented); } static PyObject *__pyx_nb_add_8petsc4py_5PETSc_Vec(PyObject *left, PyObject *right ) { int maybe_self_is_left, maybe_self_is_right = 0; maybe_self_is_left = Py_TYPE(left) == Py_TYPE(right) #if CYTHON_USE_TYPE_SLOTS || (Py_TYPE(left)->tp_as_number && Py_TYPE(left)->tp_as_number->nb_add == &__pyx_nb_add_8petsc4py_5PETSc_Vec) #endif || __Pyx_TypeCheck(left, __pyx_ptype_8petsc4py_5PETSc_Vec); if (maybe_self_is_left) { PyObject *res; res = __pyx_pw_8petsc4py_5PETSc_3Vec_19__add__(left, right); if (res != Py_NotImplemented) return res; Py_DECREF(res); } maybe_self_is_right = Py_TYPE(left) == Py_TYPE(right) #if CYTHON_USE_TYPE_SLOTS || (Py_TYPE(right)->tp_as_number && Py_TYPE(right)->tp_as_number->nb_add == &__pyx_nb_add_8petsc4py_5PETSc_Vec) #endif || PyType_IsSubtype(Py_TYPE(right), __pyx_ptype_8petsc4py_5PETSc_Vec); if (maybe_self_is_right) { return __pyx_pw_8petsc4py_5PETSc_3Vec_21__radd__(right, left); } return __Pyx_NewRef(Py_NotImplemented); } static CYTHON_INLINE PyObject *__pyx_nb_subtract_8petsc4py_5PETSc_Vec_maybe_call_slot(PyTypeObject* type, PyObject *left, PyObject *right ) { binaryfunc slot; #if CYTHON_USE_TYPE_SLOTS || PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY slot = type->tp_as_number ? type->tp_as_number->nb_subtract : NULL; #else slot = (binaryfunc) PyType_GetSlot(type, Py_nb_subtract); #endif return slot ? slot(left, right ) : __Pyx_NewRef(Py_NotImplemented); } static PyObject *__pyx_nb_subtract_8petsc4py_5PETSc_Vec(PyObject *left, PyObject *right ) { int maybe_self_is_left, maybe_self_is_right = 0; maybe_self_is_left = Py_TYPE(left) == Py_TYPE(right) #if CYTHON_USE_TYPE_SLOTS || (Py_TYPE(left)->tp_as_number && Py_TYPE(left)->tp_as_number->nb_subtract == &__pyx_nb_subtract_8petsc4py_5PETSc_Vec) #endif || __Pyx_TypeCheck(left, __pyx_ptype_8petsc4py_5PETSc_Vec); if (maybe_self_is_left) { PyObject *res; res = __pyx_pw_8petsc4py_5PETSc_3Vec_23__sub__(left, right); if (res != Py_NotImplemented) return res; Py_DECREF(res); } maybe_self_is_right = Py_TYPE(left) == Py_TYPE(right) #if CYTHON_USE_TYPE_SLOTS || (Py_TYPE(right)->tp_as_number && Py_TYPE(right)->tp_as_number->nb_subtract == &__pyx_nb_subtract_8petsc4py_5PETSc_Vec) #endif || PyType_IsSubtype(Py_TYPE(right), __pyx_ptype_8petsc4py_5PETSc_Vec); if (maybe_self_is_right) { return __pyx_pw_8petsc4py_5PETSc_3Vec_25__rsub__(right, left); } return __Pyx_NewRef(Py_NotImplemented); } static CYTHON_INLINE PyObject *__pyx_nb_multiply_8petsc4py_5PETSc_Vec_maybe_call_slot(PyTypeObject* type, PyObject *left, PyObject *right ) { binaryfunc slot; #if CYTHON_USE_TYPE_SLOTS || PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY slot = type->tp_as_number ? type->tp_as_number->nb_multiply : NULL; #else slot = (binaryfunc) PyType_GetSlot(type, Py_nb_multiply); #endif return slot ? slot(left, right ) : __Pyx_NewRef(Py_NotImplemented); } static PyObject *__pyx_nb_multiply_8petsc4py_5PETSc_Vec(PyObject *left, PyObject *right ) { int maybe_self_is_left, maybe_self_is_right = 0; maybe_self_is_left = Py_TYPE(left) == Py_TYPE(right) #if CYTHON_USE_TYPE_SLOTS || (Py_TYPE(left)->tp_as_number && Py_TYPE(left)->tp_as_number->nb_multiply == &__pyx_nb_multiply_8petsc4py_5PETSc_Vec) #endif || __Pyx_TypeCheck(left, __pyx_ptype_8petsc4py_5PETSc_Vec); if (maybe_self_is_left) { PyObject *res; res = __pyx_pw_8petsc4py_5PETSc_3Vec_27__mul__(left, right); if (res != Py_NotImplemented) return res; Py_DECREF(res); } maybe_self_is_right = Py_TYPE(left) == Py_TYPE(right) #if CYTHON_USE_TYPE_SLOTS || (Py_TYPE(right)->tp_as_number && Py_TYPE(right)->tp_as_number->nb_multiply == &__pyx_nb_multiply_8petsc4py_5PETSc_Vec) #endif || PyType_IsSubtype(Py_TYPE(right), __pyx_ptype_8petsc4py_5PETSc_Vec); if (maybe_self_is_right) { return __pyx_pw_8petsc4py_5PETSc_3Vec_29__rmul__(right, left); } return __Pyx_NewRef(Py_NotImplemented); } #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) static CYTHON_INLINE PyObject *__pyx_nb_divide_8petsc4py_5PETSc_Vec_maybe_call_slot(PyTypeObject* type, PyObject *left, PyObject *right ) { binaryfunc slot; #if CYTHON_USE_TYPE_SLOTS || PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY slot = type->tp_as_number ? type->tp_as_number->nb_divide : NULL; #else slot = (binaryfunc) PyType_GetSlot(type, Py_nb_divide); #endif return slot ? slot(left, right ) : __Pyx_NewRef(Py_NotImplemented); } static PyObject *__pyx_nb_divide_8petsc4py_5PETSc_Vec(PyObject *left, PyObject *right ) { int maybe_self_is_left, maybe_self_is_right = 0; maybe_self_is_left = Py_TYPE(left) == Py_TYPE(right) #if CYTHON_USE_TYPE_SLOTS || (Py_TYPE(left)->tp_as_number && Py_TYPE(left)->tp_as_number->nb_divide == &__pyx_nb_divide_8petsc4py_5PETSc_Vec) #endif || __Pyx_TypeCheck(left, __pyx_ptype_8petsc4py_5PETSc_Vec); if (maybe_self_is_left) { PyObject *res; res = __pyx_pw_8petsc4py_5PETSc_3Vec_31__div__(left, right); if (res != Py_NotImplemented) return res; Py_DECREF(res); } maybe_self_is_right = Py_TYPE(left) == Py_TYPE(right) #if CYTHON_USE_TYPE_SLOTS || (Py_TYPE(right)->tp_as_number && Py_TYPE(right)->tp_as_number->nb_divide == &__pyx_nb_divide_8petsc4py_5PETSc_Vec) #endif || PyType_IsSubtype(Py_TYPE(right), __pyx_ptype_8petsc4py_5PETSc_Vec); if (maybe_self_is_right) { return __pyx_pw_8petsc4py_5PETSc_3Vec_33__rdiv__(right, left); } return __Pyx_NewRef(Py_NotImplemented); } #endif static CYTHON_INLINE PyObject *__pyx_nb_true_divide_8petsc4py_5PETSc_Vec_maybe_call_slot(PyTypeObject* type, PyObject *left, PyObject *right ) { binaryfunc slot; #if CYTHON_USE_TYPE_SLOTS || PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY slot = type->tp_as_number ? type->tp_as_number->nb_true_divide : NULL; #else slot = (binaryfunc) PyType_GetSlot(type, Py_nb_true_divide); #endif return slot ? slot(left, right ) : __Pyx_NewRef(Py_NotImplemented); } static PyObject *__pyx_nb_true_divide_8petsc4py_5PETSc_Vec(PyObject *left, PyObject *right ) { int maybe_self_is_left, maybe_self_is_right = 0; maybe_self_is_left = Py_TYPE(left) == Py_TYPE(right) #if CYTHON_USE_TYPE_SLOTS || (Py_TYPE(left)->tp_as_number && Py_TYPE(left)->tp_as_number->nb_true_divide == &__pyx_nb_true_divide_8petsc4py_5PETSc_Vec) #endif || __Pyx_TypeCheck(left, __pyx_ptype_8petsc4py_5PETSc_Vec); if (maybe_self_is_left) { PyObject *res; res = __pyx_pw_8petsc4py_5PETSc_3Vec_35__truediv__(left, right); if (res != Py_NotImplemented) return res; Py_DECREF(res); } maybe_self_is_right = Py_TYPE(left) == Py_TYPE(right) #if CYTHON_USE_TYPE_SLOTS || (Py_TYPE(right)->tp_as_number && Py_TYPE(right)->tp_as_number->nb_true_divide == &__pyx_nb_true_divide_8petsc4py_5PETSc_Vec) #endif || PyType_IsSubtype(Py_TYPE(right), __pyx_ptype_8petsc4py_5PETSc_Vec); if (maybe_self_is_right) { return __pyx_pw_8petsc4py_5PETSc_3Vec_37__rtruediv__(right, left); } return __Pyx_NewRef(Py_NotImplemented); } #if PY_VERSION_HEX >= 0x03050000 static CYTHON_INLINE PyObject *__pyx_nb_matrix_multiply_8petsc4py_5PETSc_Vec_maybe_call_slot(PyTypeObject* type, PyObject *left, PyObject *right ) { binaryfunc slot; #if CYTHON_USE_TYPE_SLOTS || PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY slot = type->tp_as_number ? type->tp_as_number->nb_matrix_multiply : NULL; #else slot = (binaryfunc) PyType_GetSlot(type, Py_nb_matrix_multiply); #endif return slot ? slot(left, right ) : __Pyx_NewRef(Py_NotImplemented); } static PyObject *__pyx_nb_matrix_multiply_8petsc4py_5PETSc_Vec(PyObject *left, PyObject *right ) { int maybe_self_is_left, maybe_self_is_right = 0; maybe_self_is_left = Py_TYPE(left) == Py_TYPE(right) #if CYTHON_USE_TYPE_SLOTS || (Py_TYPE(left)->tp_as_number && Py_TYPE(left)->tp_as_number->nb_matrix_multiply == &__pyx_nb_matrix_multiply_8petsc4py_5PETSc_Vec) #endif || __Pyx_TypeCheck(left, __pyx_ptype_8petsc4py_5PETSc_Vec); if (maybe_self_is_left) { PyObject *res; res = __pyx_pw_8petsc4py_5PETSc_3Vec_39__matmul__(left, right); if (res != Py_NotImplemented) return res; Py_DECREF(res); } maybe_self_is_right = Py_TYPE(left) == Py_TYPE(right) #if CYTHON_USE_TYPE_SLOTS || (Py_TYPE(right)->tp_as_number && Py_TYPE(right)->tp_as_number->nb_matrix_multiply == &__pyx_nb_matrix_multiply_8petsc4py_5PETSc_Vec) #endif || PyType_IsSubtype(Py_TYPE(right), __pyx_ptype_8petsc4py_5PETSc_Vec); if (maybe_self_is_right) { return __pyx_nb_matrix_multiply_8petsc4py_5PETSc_Vec_maybe_call_slot(__Pyx_PyType_GetSlot(__pyx_ptype_8petsc4py_5PETSc_Vec, tp_base, PyTypeObject*), left, right ); } return __Pyx_NewRef(Py_NotImplemented); } #endif static PyObject *__pyx_getprop_8petsc4py_5PETSc_3Vec_sizes(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3Vec_5sizes_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_3Vec_sizes(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_3Vec_5sizes_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3Vec_size(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3Vec_4size_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3Vec_local_size(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3Vec_10local_size_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3Vec_block_size(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3Vec_10block_size_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3Vec_owner_range(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3Vec_11owner_range_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3Vec_owner_ranges(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3Vec_12owner_ranges_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3Vec_buffer_w(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3Vec_8buffer_w_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3Vec_buffer_r(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3Vec_8buffer_r_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3Vec_array_w(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3Vec_7array_w_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_3Vec_array_w(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_3Vec_7array_w_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3Vec_array_r(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3Vec_7array_r_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3Vec_buffer(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3Vec_6buffer_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3Vec_array(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3Vec_5array_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_3Vec_array(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_3Vec_5array_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3Vec___array_interface__(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3Vec_19__array_interface___1__get__(o); } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_Vec[] = { {"__radd__", (PyCFunction)__pyx_pw_8petsc4py_5PETSc_3Vec_21__radd__, METH_O|METH_COEXIST, 0}, {"__rsub__", (PyCFunction)__pyx_pw_8petsc4py_5PETSc_3Vec_25__rsub__, METH_O|METH_COEXIST, 0}, {"__rmul__", (PyCFunction)__pyx_pw_8petsc4py_5PETSc_3Vec_29__rmul__, METH_O|METH_COEXIST, 0}, #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) {"__rdiv__", (PyCFunction)__pyx_pw_8petsc4py_5PETSc_3Vec_33__rdiv__, METH_O|METH_COEXIST, 0}, #endif {"__rtruediv__", (PyCFunction)__pyx_pw_8petsc4py_5PETSc_3Vec_37__rtruediv__, METH_O|METH_COEXIST, 0}, {"__enter__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_49__enter__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_48__enter__}, {"__exit__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_51__exit__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_50__exit__}, {"view", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_53view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_52view}, {"destroy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_55destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_54destroy}, {"create", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_57create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_56create}, {"setType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_59setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_58setType}, {"setSizes", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_61setSizes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_60setSizes}, {"createSeq", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_63createSeq, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_62createSeq}, {"createMPI", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_65createMPI, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_64createMPI}, {"createWithArray", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_67createWithArray, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_66createWithArray}, {"createCUDAWithArrays", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_69createCUDAWithArrays, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_68createCUDAWithArrays}, {"createHIPWithArrays", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_71createHIPWithArrays, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_70createHIPWithArrays}, {"createViennaCLWithArrays", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_73createViennaCLWithArrays, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_72createViennaCLWithArrays}, {"createWithDLPack", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_75createWithDLPack, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_74createWithDLPack}, {"attachDLPackInfo", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_77attachDLPackInfo, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_76attachDLPackInfo}, {"clearDLPackInfo", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_79clearDLPackInfo, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_78clearDLPackInfo}, {"__dlpack__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_81__dlpack__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_80__dlpack__}, {"__dlpack_device__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_83__dlpack_device__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_82__dlpack_device__}, {"toDLPack", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_85toDLPack, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_84toDLPack}, {"createGhost", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_87createGhost, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_86createGhost}, {"createGhostWithArray", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_89createGhostWithArray, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_88createGhostWithArray}, {"createShared", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_91createShared, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_90createShared}, {"createNest", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_93createNest, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_92createNest}, {"setOptionsPrefix", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_95setOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_94setOptionsPrefix}, {"getOptionsPrefix", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_97getOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_96getOptionsPrefix}, {"appendOptionsPrefix", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_99appendOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_98appendOptionsPrefix}, {"setFromOptions", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_101setFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_100setFromOptions}, {"setUp", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_103setUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_102setUp}, {"setOption", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_105setOption, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_104setOption}, {"getType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_107getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_106getType}, {"getSize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_109getSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_108getSize}, {"getLocalSize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_111getLocalSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_110getLocalSize}, {"getSizes", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_113getSizes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_112getSizes}, {"setBlockSize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_115setBlockSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_114setBlockSize}, {"getBlockSize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_117getBlockSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_116getBlockSize}, {"getOwnershipRange", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_119getOwnershipRange, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_118getOwnershipRange}, {"getOwnershipRanges", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_121getOwnershipRanges, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_120getOwnershipRanges}, {"createLocalVector", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_123createLocalVector, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_122createLocalVector}, {"getLocalVector", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_125getLocalVector, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_124getLocalVector}, {"restoreLocalVector", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_127restoreLocalVector, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_126restoreLocalVector}, {"getBuffer", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_129getBuffer, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_128getBuffer}, {"getArray", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_131getArray, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_130getArray}, {"setArray", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_133setArray, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_132setArray}, {"placeArray", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_135placeArray, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_134placeArray}, {"resetArray", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_137resetArray, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_136resetArray}, {"bindToCPU", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_139bindToCPU, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_138bindToCPU}, {"boundToCPU", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_141boundToCPU, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_140boundToCPU}, {"getCUDAHandle", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_143getCUDAHandle, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_142getCUDAHandle}, {"restoreCUDAHandle", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_145restoreCUDAHandle, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_144restoreCUDAHandle}, {"getHIPHandle", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_147getHIPHandle, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_146getHIPHandle}, {"restoreHIPHandle", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_149restoreHIPHandle, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_148restoreHIPHandle}, {"getOffloadMask", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_151getOffloadMask, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_150getOffloadMask}, {"getCLContextHandle", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_153getCLContextHandle, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_152getCLContextHandle}, {"getCLQueueHandle", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_155getCLQueueHandle, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_154getCLQueueHandle}, {"getCLMemHandle", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_157getCLMemHandle, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_156getCLMemHandle}, {"restoreCLMemHandle", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_159restoreCLMemHandle, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_158restoreCLMemHandle}, {"duplicate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_161duplicate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_160duplicate}, {"copy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_163copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_162copy}, {"chop", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_165chop, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_164chop}, {"load", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_167load, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_166load}, {"equal", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_169equal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_168equal}, {"dot", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_171dot, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_170dot}, {"dotBegin", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_173dotBegin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_172dotBegin}, {"dotEnd", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_175dotEnd, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_174dotEnd}, {"tDot", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_177tDot, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_176tDot}, {"tDotBegin", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_179tDotBegin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_178tDotBegin}, {"tDotEnd", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_181tDotEnd, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_180tDotEnd}, {"mDot", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_183mDot, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_182mDot}, {"mDotBegin", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_185mDotBegin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_184mDotBegin}, {"mDotEnd", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_187mDotEnd, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_186mDotEnd}, {"mtDot", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_189mtDot, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_188mtDot}, {"mtDotBegin", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_191mtDotBegin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_190mtDotBegin}, {"mtDotEnd", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_193mtDotEnd, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_192mtDotEnd}, {"norm", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_195norm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_194norm}, {"normBegin", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_197normBegin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_196normBegin}, {"normEnd", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_199normEnd, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_198normEnd}, {"dotNorm2", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_201dotNorm2, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_200dotNorm2}, {"sum", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_203sum, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_202sum}, {"min", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_205min, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_204min}, {"max", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_207max, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_206max}, {"normalize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_209normalize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_208normalize}, {"reciprocal", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_211reciprocal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_210reciprocal}, {"exp", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_213exp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_212exp}, {"log", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_215log, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_214log}, {"sqrtabs", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_217sqrtabs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_216sqrtabs}, {"abs", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_219abs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_218abs}, {"conjugate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_221conjugate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_220conjugate}, {"setRandom", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_223setRandom, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_222setRandom}, {"permute", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_225permute, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_224permute}, {"zeroEntries", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_227zeroEntries, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_226zeroEntries}, {"set", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_229set, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_228set}, {"isset", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_231isset, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_230isset}, {"scale", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_233scale, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_232scale}, {"shift", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_235shift, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_234shift}, {"swap", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_237swap, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_236swap}, {"axpy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_239axpy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_238axpy}, {"isaxpy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_241isaxpy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_240isaxpy}, {"aypx", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_243aypx, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_242aypx}, {"axpby", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_245axpby, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_244axpby}, {"waxpy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_247waxpy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_246waxpy}, {"maxpy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_249maxpy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_248maxpy}, {"pointwiseMult", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_251pointwiseMult, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_250pointwiseMult}, {"pointwiseDivide", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_253pointwiseDivide, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_252pointwiseDivide}, {"pointwiseMin", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_255pointwiseMin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_254pointwiseMin}, {"pointwiseMax", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_257pointwiseMax, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_256pointwiseMax}, {"pointwiseMaxAbs", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_259pointwiseMaxAbs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_258pointwiseMaxAbs}, {"maxPointwiseDivide", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_261maxPointwiseDivide, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_260maxPointwiseDivide}, {"getValue", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_263getValue, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_262getValue}, {"getValues", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_265getValues, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_264getValues}, {"getValuesStagStencil", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_267getValuesStagStencil, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_266getValuesStagStencil}, {"setValue", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_269setValue, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_268setValue}, {"setValues", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_271setValues, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_270setValues}, {"setValuesBlocked", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_273setValuesBlocked, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_272setValuesBlocked}, {"setValuesStagStencil", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_275setValuesStagStencil, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_274setValuesStagStencil}, {"setLGMap", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_277setLGMap, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_276setLGMap}, {"getLGMap", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_279getLGMap, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_278getLGMap}, {"setValueLocal", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_281setValueLocal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_280setValueLocal}, {"setValuesLocal", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_283setValuesLocal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_282setValuesLocal}, {"setValuesBlockedLocal", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_285setValuesBlockedLocal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_284setValuesBlockedLocal}, {"assemblyBegin", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_287assemblyBegin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_286assemblyBegin}, {"assemblyEnd", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_289assemblyEnd, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_288assemblyEnd}, {"assemble", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_291assemble, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_290assemble}, {"strideScale", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_293strideScale, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_292strideScale}, {"strideSum", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_295strideSum, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_294strideSum}, {"strideMin", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_297strideMin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_296strideMin}, {"strideMax", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_299strideMax, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_298strideMax}, {"strideNorm", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_301strideNorm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_300strideNorm}, {"strideScatter", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_303strideScatter, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_302strideScatter}, {"strideGather", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_305strideGather, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_304strideGather}, {"localForm", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_307localForm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_306localForm}, {"ghostUpdateBegin", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_309ghostUpdateBegin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_308ghostUpdateBegin}, {"ghostUpdateEnd", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_311ghostUpdateEnd, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_310ghostUpdateEnd}, {"ghostUpdate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_313ghostUpdate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_312ghostUpdate}, {"setMPIGhost", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_315setMPIGhost, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_314setMPIGhost}, {"getSubVector", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_317getSubVector, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_316getSubVector}, {"restoreSubVector", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_319restoreSubVector, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_318restoreSubVector}, {"getNestSubVecs", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_321getNestSubVecs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_320getNestSubVecs}, {"setNestSubVecs", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_323setNestSubVecs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_322setNestSubVecs}, {"setDM", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_325setDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_324setDM}, {"getDM", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_327getDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_326getDM}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_8petsc4py_5PETSc_Vec[] = { {(char *)"sizes", __pyx_getprop_8petsc4py_5PETSc_3Vec_sizes, __pyx_setprop_8petsc4py_5PETSc_3Vec_sizes, (char *)PyDoc_STR("Vec.sizes: LayoutSizeSpec\nThe local and global vector sizes.\nSource code at petsc4py/PETSc/Vec.pyx:3391"), 0}, {(char *)"size", __pyx_getprop_8petsc4py_5PETSc_3Vec_size, 0, (char *)PyDoc_STR("Vec.size: int\nThe global vector size.\nSource code at petsc4py/PETSc/Vec.pyx:3398"), 0}, {(char *)"local_size", __pyx_getprop_8petsc4py_5PETSc_3Vec_local_size, 0, (char *)PyDoc_STR("Vec.local_size: int\nThe local vector size.\nSource code at petsc4py/PETSc/Vec.pyx:3403"), 0}, {(char *)"block_size", __pyx_getprop_8petsc4py_5PETSc_3Vec_block_size, 0, (char *)PyDoc_STR("Vec.block_size: int\nThe block size.\nSource code at petsc4py/PETSc/Vec.pyx:3408"), 0}, {(char *)"owner_range", __pyx_getprop_8petsc4py_5PETSc_3Vec_owner_range, 0, (char *)PyDoc_STR("Vec.owner_range: tuple[int, int]\nThe locally owned range of indices in the form ``[low, high)``.\nSource code at petsc4py/PETSc/Vec.pyx:3413"), 0}, {(char *)"owner_ranges", __pyx_getprop_8petsc4py_5PETSc_3Vec_owner_ranges, 0, (char *)PyDoc_STR("Vec.owner_ranges: ArrayInt\nThe range of indices owned by each process.\nSource code at petsc4py/PETSc/Vec.pyx:3418"), 0}, {(char *)"buffer_w", __pyx_getprop_8petsc4py_5PETSc_3Vec_buffer_w, 0, (char *)PyDoc_STR("Vec.buffer_w: Any\nWriteable buffered view of the local portion of the vector.\nSource code at petsc4py/PETSc/Vec.pyx:3423"), 0}, {(char *)"buffer_r", __pyx_getprop_8petsc4py_5PETSc_3Vec_buffer_r, 0, (char *)PyDoc_STR("Vec.buffer_r: Any\nRead-only buffered view of the local portion of the vector.\nSource code at petsc4py/PETSc/Vec.pyx:3428"), 0}, {(char *)"array_w", __pyx_getprop_8petsc4py_5PETSc_3Vec_array_w, __pyx_setprop_8petsc4py_5PETSc_3Vec_array_w, (char *)PyDoc_STR("Vec.array_w: ArrayScalar\nWriteable `ndarray` containing the local portion of the vector.\nSource code at petsc4py/PETSc/Vec.pyx:3433"), 0}, {(char *)"array_r", __pyx_getprop_8petsc4py_5PETSc_3Vec_array_r, 0, (char *)PyDoc_STR("Vec.array_r: ArrayScalar\nRead-only `ndarray` containing the local portion of the vector.\nSource code at petsc4py/PETSc/Vec.pyx:3441"), 0}, {(char *)"buffer", __pyx_getprop_8petsc4py_5PETSc_3Vec_buffer, 0, (char *)PyDoc_STR("Vec.buffer: Any\nAlias for `buffer_w`.\nSource code at petsc4py/PETSc/Vec.pyx:3446"), 0}, {(char *)"array", __pyx_getprop_8petsc4py_5PETSc_3Vec_array, __pyx_setprop_8petsc4py_5PETSc_3Vec_array, (char *)PyDoc_STR("Vec.array: ArrayScalar\nAlias for `array_w`.\nSource code at petsc4py/PETSc/Vec.pyx:3451"), 0}, {(char *)"__array_interface__", __pyx_getprop_8petsc4py_5PETSc_3Vec___array_interface__, 0, (char *)0, 0}, {0, 0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS #if !CYTHON_COMPILING_IN_LIMITED_API static PyBufferProcs __pyx_tp_as_buffer_Vec = { #if PY_MAJOR_VERSION < 3 0, /*bf_getreadbuffer*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getwritebuffer*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getsegcount*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getcharbuffer*/ #endif __pyx_pw_8petsc4py_5PETSc_3Vec_45__getbuffer__, /*bf_getbuffer*/ __pyx_pw_8petsc4py_5PETSc_3Vec_47__releasebuffer__, /*bf_releasebuffer*/ }; #endif static PyType_Slot PyPetscVec_Type_slots[] = { {Py_nb_add, (void *)__pyx_nb_add_8petsc4py_5PETSc_Vec}, {Py_nb_subtract, (void *)__pyx_nb_subtract_8petsc4py_5PETSc_Vec}, {Py_nb_multiply, (void *)__pyx_nb_multiply_8petsc4py_5PETSc_Vec}, #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) {Py_nb_divide, (void *)__pyx_nb_divide_8petsc4py_5PETSc_Vec}, #endif {Py_nb_negative, (void *)__pyx_pw_8petsc4py_5PETSc_3Vec_5__neg__}, {Py_nb_positive, (void *)__pyx_pw_8petsc4py_5PETSc_3Vec_3__pos__}, {Py_nb_absolute, (void *)__pyx_pw_8petsc4py_5PETSc_3Vec_7__abs__}, {Py_nb_inplace_add, (void *)__pyx_pw_8petsc4py_5PETSc_3Vec_9__iadd__}, {Py_nb_inplace_subtract, (void *)__pyx_pw_8petsc4py_5PETSc_3Vec_11__isub__}, {Py_nb_inplace_multiply, (void *)__pyx_pw_8petsc4py_5PETSc_3Vec_13__imul__}, #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) {Py_nb_inplace_divide, (void *)__pyx_pw_8petsc4py_5PETSc_3Vec_15__idiv__}, #endif {Py_nb_true_divide, (void *)__pyx_nb_true_divide_8petsc4py_5PETSc_Vec}, {Py_nb_inplace_true_divide, (void *)__pyx_pw_8petsc4py_5PETSc_3Vec_17__itruediv__}, #if PY_VERSION_HEX >= 0x03050000 {Py_nb_matrix_multiply, (void *)__pyx_nb_matrix_multiply_8petsc4py_5PETSc_Vec}, #endif {Py_sq_item, (void *)__pyx_sq_item_8petsc4py_5PETSc_Vec}, {Py_mp_subscript, (void *)__pyx_pw_8petsc4py_5PETSc_3Vec_41__getitem__}, {Py_mp_ass_subscript, (void *)__pyx_mp_ass_subscript_8petsc4py_5PETSc_Vec}, #if defined(Py_bf_getbuffer) {Py_bf_getbuffer, (void *)__pyx_pw_8petsc4py_5PETSc_3Vec_45__getbuffer__}, #endif #if defined(Py_bf_releasebuffer) {Py_bf_releasebuffer, (void *)__pyx_pw_8petsc4py_5PETSc_3Vec_47__releasebuffer__}, #endif {Py_tp_doc, (void *)PyDoc_STR("A vector object.\n\n See Also\n --------\n petsc.Vec\n\n ")}, {Py_tp_traverse, (void *)__pyx_tp_traverse_8petsc4py_5PETSc_Object}, {Py_tp_clear, (void *)__pyx_tp_clear_8petsc4py_5PETSc_Object}, {Py_tp_methods, (void *)__pyx_methods_8petsc4py_5PETSc_Vec}, {Py_tp_getset, (void *)__pyx_getsets_8petsc4py_5PETSc_Vec}, {Py_tp_new, (void *)__pyx_tp_new_8petsc4py_5PETSc_Vec}, {0, 0}, }; static PyType_Spec PyPetscVec_Type_spec = { "petsc4py.PETSc.Vec", sizeof(struct PyPetscVecObject), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, PyPetscVec_Type_slots, }; #else static PyNumberMethods __pyx_tp_as_number_Vec = { __pyx_nb_add_8petsc4py_5PETSc_Vec, /*nb_add*/ __pyx_nb_subtract_8petsc4py_5PETSc_Vec, /*nb_subtract*/ __pyx_nb_multiply_8petsc4py_5PETSc_Vec, /*nb_multiply*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) __pyx_nb_divide_8petsc4py_5PETSc_Vec, /*nb_divide*/ #endif 0, /*nb_remainder*/ 0, /*nb_divmod*/ 0, /*nb_power*/ __pyx_pw_8petsc4py_5PETSc_3Vec_5__neg__, /*nb_negative*/ __pyx_pw_8petsc4py_5PETSc_3Vec_3__pos__, /*nb_positive*/ __pyx_pw_8petsc4py_5PETSc_3Vec_7__abs__, /*nb_absolute*/ #if CYTHON_COMPILING_IN_PYPY || 0 __pyx_pw_8petsc4py_5PETSc_6Object_7__bool__, /*nb_bool*/ #else 0, /*nb_bool*/ #endif 0, /*nb_invert*/ 0, /*nb_lshift*/ 0, /*nb_rshift*/ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_coerce*/ #endif 0, /*nb_int*/ #if PY_MAJOR_VERSION < 3 0, /*nb_long*/ #else 0, /*reserved*/ #endif 0, /*nb_float*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_oct*/ #endif #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_hex*/ #endif __pyx_pw_8petsc4py_5PETSc_3Vec_9__iadd__, /*nb_inplace_add*/ __pyx_pw_8petsc4py_5PETSc_3Vec_11__isub__, /*nb_inplace_subtract*/ __pyx_pw_8petsc4py_5PETSc_3Vec_13__imul__, /*nb_inplace_multiply*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) __pyx_pw_8petsc4py_5PETSc_3Vec_15__idiv__, /*nb_inplace_divide*/ #endif 0, /*nb_inplace_remainder*/ 0, /*nb_inplace_power*/ 0, /*nb_inplace_lshift*/ 0, /*nb_inplace_rshift*/ 0, /*nb_inplace_and*/ 0, /*nb_inplace_xor*/ 0, /*nb_inplace_or*/ 0, /*nb_floor_divide*/ __pyx_nb_true_divide_8petsc4py_5PETSc_Vec, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ __pyx_pw_8petsc4py_5PETSc_3Vec_17__itruediv__, /*nb_inplace_true_divide*/ 0, /*nb_index*/ #if PY_VERSION_HEX >= 0x03050000 __pyx_nb_matrix_multiply_8petsc4py_5PETSc_Vec, /*nb_matrix_multiply*/ #endif #if PY_VERSION_HEX >= 0x03050000 0, /*nb_inplace_matrix_multiply*/ #endif }; static PySequenceMethods __pyx_tp_as_sequence_Vec = { 0, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ __pyx_sq_item_8petsc4py_5PETSc_Vec, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ 0, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; static PyMappingMethods __pyx_tp_as_mapping_Vec = { 0, /*mp_length*/ __pyx_pw_8petsc4py_5PETSc_3Vec_41__getitem__, /*mp_subscript*/ __pyx_mp_ass_subscript_8petsc4py_5PETSc_Vec, /*mp_ass_subscript*/ }; static PyBufferProcs __pyx_tp_as_buffer_Vec = { #if PY_MAJOR_VERSION < 3 0, /*bf_getreadbuffer*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getwritebuffer*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getsegcount*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getcharbuffer*/ #endif __pyx_pw_8petsc4py_5PETSc_3Vec_45__getbuffer__, /*bf_getbuffer*/ __pyx_pw_8petsc4py_5PETSc_3Vec_47__releasebuffer__, /*bf_releasebuffer*/ }; DL_EXPORT(PyTypeObject) PyPetscVec_Type = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.""Vec", /*tp_name*/ sizeof(struct PyPetscVecObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Object, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ &__pyx_tp_as_number_Vec, /*tp_as_number*/ &__pyx_tp_as_sequence_Vec, /*tp_as_sequence*/ &__pyx_tp_as_mapping_Vec, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer_Vec, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ PyDoc_STR("A vector object.\n\n See Also\n --------\n petsc.Vec\n\n "), /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc_Object, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc_Object, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_Vec, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_8petsc4py_5PETSc_Vec, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_Vec, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static struct __pyx_vtabstruct_8petsc4py_5PETSc_Space __pyx_vtable_8petsc4py_5PETSc_Space; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_Space(PyTypeObject *t, PyObject *a, PyObject *k) { struct PyPetscSpaceObject *p; PyObject *o = __pyx_tp_new_8petsc4py_5PETSc_Object(t, a, k); if (unlikely(!o)) return 0; p = ((struct PyPetscSpaceObject *)o); p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Object*)__pyx_vtabptr_8petsc4py_5PETSc_Space; if (unlikely(__pyx_pw_8petsc4py_5PETSc_5Space_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_Space[] = { {"setUp", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_3setUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_2setUp}, {"create", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_5create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_4create}, {"destroy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_7destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_6destroy}, {"view", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_9view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_8view}, {"setFromOptions", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_11setFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_10setFromOptions}, {"getDimension", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_13getDimension, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_12getDimension}, {"getDegree", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_15getDegree, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_14getDegree}, {"setDegree", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_17setDegree, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_16setDegree}, {"getNumVariables", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_19getNumVariables, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_18getNumVariables}, {"setNumVariables", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_21setNumVariables, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_20setNumVariables}, {"getNumComponents", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_23getNumComponents, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_22getNumComponents}, {"setNumComponents", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_25setNumComponents, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_24setNumComponents}, {"getType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_27getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_26getType}, {"setType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_29setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_28setType}, {"getSumConcatenate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_31getSumConcatenate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_30getSumConcatenate}, {"setSumConcatenate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_33setSumConcatenate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_32setSumConcatenate}, {"getSumNumSubspaces", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_35getSumNumSubspaces, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_34getSumNumSubspaces}, {"getSumSubspace", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_37getSumSubspace, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_36getSumSubspace}, {"setSumSubspace", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_39setSumSubspace, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_38setSumSubspace}, {"setSumNumSubspaces", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_41setSumNumSubspaces, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_40setSumNumSubspaces}, {"getTensorNumSubspaces", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_43getTensorNumSubspaces, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_42getTensorNumSubspaces}, {"setTensorSubspace", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_45setTensorSubspace, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_44setTensorSubspace}, {"getTensorSubspace", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_47getTensorSubspace, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_46getTensorSubspace}, {"setTensorNumSubspaces", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_49setTensorNumSubspaces, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_48setTensorNumSubspaces}, {"getPolynomialTensor", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_51getPolynomialTensor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_50getPolynomialTensor}, {"setPolynomialTensor", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_53setPolynomialTensor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_52setPolynomialTensor}, {"setPointPoints", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_55setPointPoints, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_54setPointPoints}, {"getPointPoints", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_57getPointPoints, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_56getPointPoints}, {"setPTrimmedFormDegree", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_59setPTrimmedFormDegree, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_58setPTrimmedFormDegree}, {"getPTrimmedFormDegree", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_61getPTrimmedFormDegree, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_60getPTrimmedFormDegree}, {"viewFromOptions", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_63viewFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_62viewFromOptions}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot PyPetscSpace_Type_slots[] = { {Py_tp_doc, (void *)PyDoc_STR("Linear space object.")}, {Py_tp_traverse, (void *)__pyx_tp_traverse_8petsc4py_5PETSc_Object}, {Py_tp_clear, (void *)__pyx_tp_clear_8petsc4py_5PETSc_Object}, {Py_tp_methods, (void *)__pyx_methods_8petsc4py_5PETSc_Space}, {Py_tp_new, (void *)__pyx_tp_new_8petsc4py_5PETSc_Space}, {0, 0}, }; static PyType_Spec PyPetscSpace_Type_spec = { "petsc4py.PETSc.Space", sizeof(struct PyPetscSpaceObject), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, PyPetscSpace_Type_slots, }; #else DL_EXPORT(PyTypeObject) PyPetscSpace_Type = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.""Space", /*tp_name*/ sizeof(struct PyPetscSpaceObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Object, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ PyDoc_STR("Linear space object."), /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc_Object, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc_Object, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_Space, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_Space, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static struct __pyx_vtabstruct_8petsc4py_5PETSc_DualSpace __pyx_vtable_8petsc4py_5PETSc_DualSpace; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_DualSpace(PyTypeObject *t, PyObject *a, PyObject *k) { struct PyPetscDualSpaceObject *p; PyObject *o = __pyx_tp_new_8petsc4py_5PETSc_Object(t, a, k); if (unlikely(!o)) return 0; p = ((struct PyPetscDualSpaceObject *)o); p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Object*)__pyx_vtabptr_8petsc4py_5PETSc_DualSpace; if (unlikely(__pyx_pw_8petsc4py_5PETSc_9DualSpace_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_DualSpace[] = { {"setUp", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_3setUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_2setUp}, {"create", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_5create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_4create}, {"view", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_7view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_6view}, {"destroy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_9destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_8destroy}, {"duplicate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_11duplicate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_10duplicate}, {"getDM", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_13getDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_12getDM}, {"setDM", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_15setDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_14setDM}, {"getDimension", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_17getDimension, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_16getDimension}, {"getNumComponents", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_19getNumComponents, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_18getNumComponents}, {"setNumComponents", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_21setNumComponents, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_20setNumComponents}, {"getType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_23getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_22getType}, {"setType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_25setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_24setType}, {"getOrder", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_27getOrder, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_26getOrder}, {"setOrder", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_29setOrder, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_28setOrder}, {"getNumDof", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_31getNumDof, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_30getNumDof}, {"getFunctional", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_33getFunctional, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_32getFunctional}, {"getInteriorDimension", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_35getInteriorDimension, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_34getInteriorDimension}, {"getLagrangeContinuity", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_37getLagrangeContinuity, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_36getLagrangeContinuity}, {"setLagrangeContinuity", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_39setLagrangeContinuity, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_38setLagrangeContinuity}, {"getLagrangeTensor", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_41getLagrangeTensor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_40getLagrangeTensor}, {"setLagrangeTensor", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_43setLagrangeTensor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_42setLagrangeTensor}, {"getLagrangeTrimmed", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_45getLagrangeTrimmed, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_44getLagrangeTrimmed}, {"setLagrangeTrimmed", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_47setLagrangeTrimmed, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_46setLagrangeTrimmed}, {"viewFromOptions", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_49viewFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_48viewFromOptions}, {"setSimpleDimension", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_51setSimpleDimension, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_50setSimpleDimension}, {"setSimpleFunctional", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_53setSimpleFunctional, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_52setSimpleFunctional}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot PyPetscDualSpace_Type_slots[] = { {Py_tp_doc, (void *)PyDoc_STR("Dual space to a linear space.")}, {Py_tp_traverse, (void *)__pyx_tp_traverse_8petsc4py_5PETSc_Object}, {Py_tp_clear, (void *)__pyx_tp_clear_8petsc4py_5PETSc_Object}, {Py_tp_methods, (void *)__pyx_methods_8petsc4py_5PETSc_DualSpace}, {Py_tp_new, (void *)__pyx_tp_new_8petsc4py_5PETSc_DualSpace}, {0, 0}, }; static PyType_Spec PyPetscDualSpace_Type_spec = { "petsc4py.PETSc.DualSpace", sizeof(struct PyPetscDualSpaceObject), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, PyPetscDualSpace_Type_slots, }; #else DL_EXPORT(PyTypeObject) PyPetscDualSpace_Type = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.""DualSpace", /*tp_name*/ sizeof(struct PyPetscDualSpaceObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Object, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ PyDoc_STR("Dual space to a linear space."), /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc_Object, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc_Object, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_DualSpace, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_DualSpace, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static struct __pyx_vtabstruct_8petsc4py_5PETSc_FE __pyx_vtable_8petsc4py_5PETSc_FE; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_FE(PyTypeObject *t, PyObject *a, PyObject *k) { struct PyPetscFEObject *p; PyObject *o = __pyx_tp_new_8petsc4py_5PETSc_Object(t, a, k); if (unlikely(!o)) return 0; p = ((struct PyPetscFEObject *)o); p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Object*)__pyx_vtabptr_8petsc4py_5PETSc_FE; if (unlikely(__pyx_pw_8petsc4py_5PETSc_2FE_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_FE[] = { {"view", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_3view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_2view}, {"destroy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_5destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_4destroy}, {"create", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_7create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_6create}, {"createDefault", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_9createDefault, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_8createDefault}, {"createLagrange", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_11createLagrange, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_10createLagrange}, {"getQuadrature", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_13getQuadrature, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_12getQuadrature}, {"getDimension", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_15getDimension, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_14getDimension}, {"getSpatialDimension", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_17getSpatialDimension, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_16getSpatialDimension}, {"getNumComponents", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_19getNumComponents, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_18getNumComponents}, {"setNumComponents", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_21setNumComponents, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_20setNumComponents}, {"getNumDof", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_23getNumDof, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_22getNumDof}, {"getTileSizes", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_25getTileSizes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_24getTileSizes}, {"setTileSizes", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_27setTileSizes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_26setTileSizes}, {"getFaceQuadrature", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_29getFaceQuadrature, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_28getFaceQuadrature}, {"setQuadrature", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_31setQuadrature, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_30setQuadrature}, {"setFaceQuadrature", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_33setFaceQuadrature, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_32setFaceQuadrature}, {"setType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_35setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_34setType}, {"getBasisSpace", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_37getBasisSpace, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_36getBasisSpace}, {"setBasisSpace", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_39setBasisSpace, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_38setBasisSpace}, {"setFromOptions", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_41setFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_40setFromOptions}, {"setUp", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_43setUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_42setUp}, {"getDualSpace", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_45getDualSpace, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_44getDualSpace}, {"setDualSpace", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_47setDualSpace, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_46setDualSpace}, {"viewFromOptions", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_49viewFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_48viewFromOptions}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot PyPetscFE_Type_slots[] = { {Py_tp_doc, (void *)PyDoc_STR("A PETSc object that manages a finite element space.")}, {Py_tp_traverse, (void *)__pyx_tp_traverse_8petsc4py_5PETSc_Object}, {Py_tp_clear, (void *)__pyx_tp_clear_8petsc4py_5PETSc_Object}, {Py_tp_methods, (void *)__pyx_methods_8petsc4py_5PETSc_FE}, {Py_tp_new, (void *)__pyx_tp_new_8petsc4py_5PETSc_FE}, {0, 0}, }; static PyType_Spec PyPetscFE_Type_spec = { "petsc4py.PETSc.FE", sizeof(struct PyPetscFEObject), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, PyPetscFE_Type_slots, }; #else DL_EXPORT(PyTypeObject) PyPetscFE_Type = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.""FE", /*tp_name*/ sizeof(struct PyPetscFEObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Object, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ PyDoc_STR("A PETSc object that manages a finite element space."), /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc_Object, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc_Object, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_FE, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_FE, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static struct __pyx_vtabstruct_8petsc4py_5PETSc_Quad __pyx_vtable_8petsc4py_5PETSc_Quad; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_Quad(PyTypeObject *t, PyObject *a, PyObject *k) { struct PyPetscQuadObject *p; PyObject *o = __pyx_tp_new_8petsc4py_5PETSc_Object(t, a, k); if (unlikely(!o)) return 0; p = ((struct PyPetscQuadObject *)o); p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Object*)__pyx_vtabptr_8petsc4py_5PETSc_Quad; if (unlikely(__pyx_pw_8petsc4py_5PETSc_4Quad_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_Quad[] = { {"view", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4Quad_3view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4Quad_2view}, {"create", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4Quad_5create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4Quad_4create}, {"duplicate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4Quad_7duplicate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4Quad_6duplicate}, {"destroy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4Quad_9destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4Quad_8destroy}, {"getData", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4Quad_11getData, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4Quad_10getData}, {"getNumComponents", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4Quad_13getNumComponents, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4Quad_12getNumComponents}, {"setNumComponents", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4Quad_15setNumComponents, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4Quad_14setNumComponents}, {"getOrder", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4Quad_17getOrder, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4Quad_16getOrder}, {"setOrder", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4Quad_19setOrder, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4Quad_18setOrder}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot PyPetscQuad_Type_slots[] = { {Py_tp_doc, (void *)PyDoc_STR("Quadrature rule for integration.")}, {Py_tp_traverse, (void *)__pyx_tp_traverse_8petsc4py_5PETSc_Object}, {Py_tp_clear, (void *)__pyx_tp_clear_8petsc4py_5PETSc_Object}, {Py_tp_methods, (void *)__pyx_methods_8petsc4py_5PETSc_Quad}, {Py_tp_new, (void *)__pyx_tp_new_8petsc4py_5PETSc_Quad}, {0, 0}, }; static PyType_Spec PyPetscQuad_Type_spec = { "petsc4py.PETSc.Quad", sizeof(struct PyPetscQuadObject), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, PyPetscQuad_Type_slots, }; #else DL_EXPORT(PyTypeObject) PyPetscQuad_Type = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.""Quad", /*tp_name*/ sizeof(struct PyPetscQuadObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Object, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ PyDoc_STR("Quadrature rule for integration."), /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc_Object, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc_Object, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_Quad, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_Quad, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static struct __pyx_vtabstruct_8petsc4py_5PETSc_Scatter __pyx_vtable_8petsc4py_5PETSc_Scatter; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_Scatter(PyTypeObject *t, PyObject *a, PyObject *k) { struct PyPetscScatterObject *p; PyObject *o = __pyx_tp_new_8petsc4py_5PETSc_Object(t, a, k); if (unlikely(!o)) return 0; p = ((struct PyPetscScatterObject *)o); p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Object*)__pyx_vtabptr_8petsc4py_5PETSc_Scatter; if (unlikely(__pyx_pw_8petsc4py_5PETSc_7Scatter_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_Scatter[] = { {"view", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Scatter_5view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Scatter_4view}, {"destroy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Scatter_7destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Scatter_6destroy}, {"create", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Scatter_9create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Scatter_8create}, {"setType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Scatter_11setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Scatter_10setType}, {"getType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Scatter_13getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Scatter_12getType}, {"setFromOptions", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Scatter_15setFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Scatter_14setFromOptions}, {"setUp", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Scatter_17setUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Scatter_16setUp}, {"copy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Scatter_19copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Scatter_18copy}, {"toAll", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Scatter_21toAll, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Scatter_20toAll}, {"toZero", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Scatter_23toZero, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Scatter_22toZero}, {"begin", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Scatter_25begin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Scatter_24begin}, {"end", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Scatter_27end, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Scatter_26end}, {"scatter", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Scatter_29scatter, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Scatter_28scatter}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot PyPetscScatter_Type_slots[] = { {Py_tp_call, (void *)__pyx_pw_8petsc4py_5PETSc_7Scatter_3__call__}, {Py_tp_doc, (void *)PyDoc_STR("Scatter object.\n\n The object used to perform data movement between vectors.\n Scatter is described in the `PETSc manual `.\n\n See Also\n --------\n Vec, SF, petsc.VecScatter\n\n ")}, {Py_tp_traverse, (void *)__pyx_tp_traverse_8petsc4py_5PETSc_Object}, {Py_tp_clear, (void *)__pyx_tp_clear_8petsc4py_5PETSc_Object}, {Py_tp_methods, (void *)__pyx_methods_8petsc4py_5PETSc_Scatter}, {Py_tp_new, (void *)__pyx_tp_new_8petsc4py_5PETSc_Scatter}, {0, 0}, }; static PyType_Spec PyPetscScatter_Type_spec = { "petsc4py.PETSc.Scatter", sizeof(struct PyPetscScatterObject), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, PyPetscScatter_Type_slots, }; #else DL_EXPORT(PyTypeObject) PyPetscScatter_Type = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.""Scatter", /*tp_name*/ sizeof(struct PyPetscScatterObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Object, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ __pyx_pw_8petsc4py_5PETSc_7Scatter_3__call__, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ PyDoc_STR("Scatter object.\n\n The object used to perform data movement between vectors.\n Scatter is described in the `PETSc manual `.\n\n See Also\n --------\n Vec, SF, petsc.VecScatter\n\n "), /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc_Object, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc_Object, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_Scatter, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_Scatter, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static struct __pyx_vtabstruct_8petsc4py_5PETSc_Section __pyx_vtable_8petsc4py_5PETSc_Section; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_Section(PyTypeObject *t, PyObject *a, PyObject *k) { struct PyPetscSectionObject *p; PyObject *o = __pyx_tp_new_8petsc4py_5PETSc_Object(t, a, k); if (unlikely(!o)) return 0; p = ((struct PyPetscSectionObject *)o); p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Object*)__pyx_vtabptr_8petsc4py_5PETSc_Section; if (unlikely(__pyx_pw_8petsc4py_5PETSc_7Section_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_8petsc4py_5PETSc_Section(PyObject *o) { #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_8petsc4py_5PETSc_Section) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); __pyx_pw_8petsc4py_5PETSc_7Section_3__dealloc__(o); __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); PyErr_Restore(etype, eval, etb); } PyObject_GC_Track(o); __pyx_tp_dealloc_8petsc4py_5PETSc_Object(o); } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_Section[] = { {"view", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_5view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_4view}, {"destroy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_7destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_6destroy}, {"create", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_9create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_8create}, {"clone", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_11clone, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_10clone}, {"setUp", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_13setUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_12setUp}, {"reset", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_15reset, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_14reset}, {"getNumFields", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_17getNumFields, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_16getNumFields}, {"setNumFields", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_19setNumFields, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_18setNumFields}, {"getFieldName", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_21getFieldName, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_20getFieldName}, {"setFieldName", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_23setFieldName, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_22setFieldName}, {"getFieldComponents", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_25getFieldComponents, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_24getFieldComponents}, {"setFieldComponents", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_27setFieldComponents, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_26setFieldComponents}, {"getChart", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_29getChart, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_28getChart}, {"setChart", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_31setChart, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_30setChart}, {"getPermutation", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_33getPermutation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_32getPermutation}, {"setPermutation", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_35setPermutation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_34setPermutation}, {"getDof", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_37getDof, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_36getDof}, {"setDof", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_39setDof, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_38setDof}, {"addDof", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_41addDof, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_40addDof}, {"getFieldDof", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_43getFieldDof, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_42getFieldDof}, {"setFieldDof", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_45setFieldDof, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_44setFieldDof}, {"addFieldDof", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_47addFieldDof, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_46addFieldDof}, {"getConstraintDof", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_49getConstraintDof, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_48getConstraintDof}, {"setConstraintDof", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_51setConstraintDof, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_50setConstraintDof}, {"addConstraintDof", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_53addConstraintDof, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_52addConstraintDof}, {"getFieldConstraintDof", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_55getFieldConstraintDof, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_54getFieldConstraintDof}, {"setFieldConstraintDof", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_57setFieldConstraintDof, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_56setFieldConstraintDof}, {"addFieldConstraintDof", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_59addFieldConstraintDof, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_58addFieldConstraintDof}, {"getConstraintIndices", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_61getConstraintIndices, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_60getConstraintIndices}, {"setConstraintIndices", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_63setConstraintIndices, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_62setConstraintIndices}, {"getFieldConstraintIndices", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_65getFieldConstraintIndices, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_64getFieldConstraintIndices}, {"setFieldConstraintIndices", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_67setFieldConstraintIndices, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_66setFieldConstraintIndices}, {"getMaxDof", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_69getMaxDof, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_68getMaxDof}, {"getStorageSize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_71getStorageSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_70getStorageSize}, {"getConstrainedStorageSize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_73getConstrainedStorageSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_72getConstrainedStorageSize}, {"getOffset", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_75getOffset, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_74getOffset}, {"setOffset", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_77setOffset, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_76setOffset}, {"getFieldOffset", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_79getFieldOffset, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_78getFieldOffset}, {"setFieldOffset", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_81setFieldOffset, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_80setFieldOffset}, {"getOffsetRange", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_83getOffsetRange, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_82getOffsetRange}, {"createGlobalSection", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_85createGlobalSection, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_84createGlobalSection}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot PyPetscSection_Type_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8petsc4py_5PETSc_Section}, {Py_tp_doc, (void *)PyDoc_STR("Mapping from integers in a range to unstructured set of integers.")}, {Py_tp_traverse, (void *)__pyx_tp_traverse_8petsc4py_5PETSc_Object}, {Py_tp_clear, (void *)__pyx_tp_clear_8petsc4py_5PETSc_Object}, {Py_tp_methods, (void *)__pyx_methods_8petsc4py_5PETSc_Section}, {Py_tp_new, (void *)__pyx_tp_new_8petsc4py_5PETSc_Section}, {0, 0}, }; static PyType_Spec PyPetscSection_Type_spec = { "petsc4py.PETSc.Section", sizeof(struct PyPetscSectionObject), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, PyPetscSection_Type_slots, }; #else DL_EXPORT(PyTypeObject) PyPetscSection_Type = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.""Section", /*tp_name*/ sizeof(struct PyPetscSectionObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Section, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ PyDoc_STR("Mapping from integers in a range to unstructured set of integers."), /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc_Object, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc_Object, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_Section, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_Section, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static struct __pyx_vtabstruct_8petsc4py_5PETSc_Mat __pyx_vtable_8petsc4py_5PETSc_Mat; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_Mat(PyTypeObject *t, PyObject *a, PyObject *k) { struct PyPetscMatObject *p; PyObject *o = __pyx_tp_new_8petsc4py_5PETSc_Object(t, a, k); if (unlikely(!o)) return 0; p = ((struct PyPetscMatObject *)o); p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Object*)__pyx_vtabptr_8petsc4py_5PETSc_Mat; if (unlikely(__pyx_pw_8petsc4py_5PETSc_3Mat_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static PyObject *__pyx_sq_item_8petsc4py_5PETSc_Mat(PyObject *o, Py_ssize_t i) { PyObject *r; PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); Py_DECREF(x); return r; } static int __pyx_mp_ass_subscript_8petsc4py_5PETSc_Mat(PyObject *o, PyObject *i, PyObject *v) { if (v) { return __pyx_pw_8petsc4py_5PETSc_3Mat_41__setitem__(o, i, v); } else { __Pyx_TypeName o_type_name; if (__pyx_ptype_8petsc4py_5PETSc_Object->tp_as_mapping && __pyx_ptype_8petsc4py_5PETSc_Object->tp_as_mapping->mp_ass_subscript) return __pyx_ptype_8petsc4py_5PETSc_Object->tp_as_mapping->mp_ass_subscript(o, i, v); o_type_name = __Pyx_PyType_GetName(Py_TYPE(o)); PyErr_Format(PyExc_NotImplementedError, "Subscript deletion not supported by " __Pyx_FMT_TYPENAME, o_type_name); __Pyx_DECREF_TypeName(o_type_name); return -1; } } static CYTHON_INLINE PyObject *__pyx_nb_add_8petsc4py_5PETSc_Mat_maybe_call_slot(PyTypeObject* type, PyObject *left, PyObject *right ) { binaryfunc slot; #if CYTHON_USE_TYPE_SLOTS || PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY slot = type->tp_as_number ? type->tp_as_number->nb_add : NULL; #else slot = (binaryfunc) PyType_GetSlot(type, Py_nb_add); #endif return slot ? slot(left, right ) : __Pyx_NewRef(Py_NotImplemented); } static PyObject *__pyx_nb_add_8petsc4py_5PETSc_Mat(PyObject *left, PyObject *right ) { int maybe_self_is_left, maybe_self_is_right = 0; maybe_self_is_left = Py_TYPE(left) == Py_TYPE(right) #if CYTHON_USE_TYPE_SLOTS || (Py_TYPE(left)->tp_as_number && Py_TYPE(left)->tp_as_number->nb_add == &__pyx_nb_add_8petsc4py_5PETSc_Mat) #endif || __Pyx_TypeCheck(left, __pyx_ptype_8petsc4py_5PETSc_Mat); if (maybe_self_is_left) { PyObject *res; res = __pyx_pw_8petsc4py_5PETSc_3Mat_17__add__(left, right); if (res != Py_NotImplemented) return res; Py_DECREF(res); } maybe_self_is_right = Py_TYPE(left) == Py_TYPE(right) #if CYTHON_USE_TYPE_SLOTS || (Py_TYPE(right)->tp_as_number && Py_TYPE(right)->tp_as_number->nb_add == &__pyx_nb_add_8petsc4py_5PETSc_Mat) #endif || PyType_IsSubtype(Py_TYPE(right), __pyx_ptype_8petsc4py_5PETSc_Mat); if (maybe_self_is_right) { return __pyx_pw_8petsc4py_5PETSc_3Mat_19__radd__(right, left); } return __Pyx_NewRef(Py_NotImplemented); } static CYTHON_INLINE PyObject *__pyx_nb_subtract_8petsc4py_5PETSc_Mat_maybe_call_slot(PyTypeObject* type, PyObject *left, PyObject *right ) { binaryfunc slot; #if CYTHON_USE_TYPE_SLOTS || PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY slot = type->tp_as_number ? type->tp_as_number->nb_subtract : NULL; #else slot = (binaryfunc) PyType_GetSlot(type, Py_nb_subtract); #endif return slot ? slot(left, right ) : __Pyx_NewRef(Py_NotImplemented); } static PyObject *__pyx_nb_subtract_8petsc4py_5PETSc_Mat(PyObject *left, PyObject *right ) { int maybe_self_is_left, maybe_self_is_right = 0; maybe_self_is_left = Py_TYPE(left) == Py_TYPE(right) #if CYTHON_USE_TYPE_SLOTS || (Py_TYPE(left)->tp_as_number && Py_TYPE(left)->tp_as_number->nb_subtract == &__pyx_nb_subtract_8petsc4py_5PETSc_Mat) #endif || __Pyx_TypeCheck(left, __pyx_ptype_8petsc4py_5PETSc_Mat); if (maybe_self_is_left) { PyObject *res; res = __pyx_pw_8petsc4py_5PETSc_3Mat_21__sub__(left, right); if (res != Py_NotImplemented) return res; Py_DECREF(res); } maybe_self_is_right = Py_TYPE(left) == Py_TYPE(right) #if CYTHON_USE_TYPE_SLOTS || (Py_TYPE(right)->tp_as_number && Py_TYPE(right)->tp_as_number->nb_subtract == &__pyx_nb_subtract_8petsc4py_5PETSc_Mat) #endif || PyType_IsSubtype(Py_TYPE(right), __pyx_ptype_8petsc4py_5PETSc_Mat); if (maybe_self_is_right) { return __pyx_pw_8petsc4py_5PETSc_3Mat_23__rsub__(right, left); } return __Pyx_NewRef(Py_NotImplemented); } static CYTHON_INLINE PyObject *__pyx_nb_multiply_8petsc4py_5PETSc_Mat_maybe_call_slot(PyTypeObject* type, PyObject *left, PyObject *right ) { binaryfunc slot; #if CYTHON_USE_TYPE_SLOTS || PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY slot = type->tp_as_number ? type->tp_as_number->nb_multiply : NULL; #else slot = (binaryfunc) PyType_GetSlot(type, Py_nb_multiply); #endif return slot ? slot(left, right ) : __Pyx_NewRef(Py_NotImplemented); } static PyObject *__pyx_nb_multiply_8petsc4py_5PETSc_Mat(PyObject *left, PyObject *right ) { int maybe_self_is_left, maybe_self_is_right = 0; maybe_self_is_left = Py_TYPE(left) == Py_TYPE(right) #if CYTHON_USE_TYPE_SLOTS || (Py_TYPE(left)->tp_as_number && Py_TYPE(left)->tp_as_number->nb_multiply == &__pyx_nb_multiply_8petsc4py_5PETSc_Mat) #endif || __Pyx_TypeCheck(left, __pyx_ptype_8petsc4py_5PETSc_Mat); if (maybe_self_is_left) { PyObject *res; res = __pyx_pw_8petsc4py_5PETSc_3Mat_25__mul__(left, right); if (res != Py_NotImplemented) return res; Py_DECREF(res); } maybe_self_is_right = Py_TYPE(left) == Py_TYPE(right) #if CYTHON_USE_TYPE_SLOTS || (Py_TYPE(right)->tp_as_number && Py_TYPE(right)->tp_as_number->nb_multiply == &__pyx_nb_multiply_8petsc4py_5PETSc_Mat) #endif || PyType_IsSubtype(Py_TYPE(right), __pyx_ptype_8petsc4py_5PETSc_Mat); if (maybe_self_is_right) { return __pyx_pw_8petsc4py_5PETSc_3Mat_27__rmul__(right, left); } return __Pyx_NewRef(Py_NotImplemented); } #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) static CYTHON_INLINE PyObject *__pyx_nb_divide_8petsc4py_5PETSc_Mat_maybe_call_slot(PyTypeObject* type, PyObject *left, PyObject *right ) { binaryfunc slot; #if CYTHON_USE_TYPE_SLOTS || PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY slot = type->tp_as_number ? type->tp_as_number->nb_divide : NULL; #else slot = (binaryfunc) PyType_GetSlot(type, Py_nb_divide); #endif return slot ? slot(left, right ) : __Pyx_NewRef(Py_NotImplemented); } static PyObject *__pyx_nb_divide_8petsc4py_5PETSc_Mat(PyObject *left, PyObject *right ) { int maybe_self_is_left, maybe_self_is_right = 0; maybe_self_is_left = Py_TYPE(left) == Py_TYPE(right) #if CYTHON_USE_TYPE_SLOTS || (Py_TYPE(left)->tp_as_number && Py_TYPE(left)->tp_as_number->nb_divide == &__pyx_nb_divide_8petsc4py_5PETSc_Mat) #endif || __Pyx_TypeCheck(left, __pyx_ptype_8petsc4py_5PETSc_Mat); if (maybe_self_is_left) { PyObject *res; res = __pyx_pw_8petsc4py_5PETSc_3Mat_29__div__(left, right); if (res != Py_NotImplemented) return res; Py_DECREF(res); } maybe_self_is_right = Py_TYPE(left) == Py_TYPE(right) #if CYTHON_USE_TYPE_SLOTS || (Py_TYPE(right)->tp_as_number && Py_TYPE(right)->tp_as_number->nb_divide == &__pyx_nb_divide_8petsc4py_5PETSc_Mat) #endif || PyType_IsSubtype(Py_TYPE(right), __pyx_ptype_8petsc4py_5PETSc_Mat); if (maybe_self_is_right) { return __pyx_pw_8petsc4py_5PETSc_3Mat_31__rdiv__(right, left); } return __Pyx_NewRef(Py_NotImplemented); } #endif static CYTHON_INLINE PyObject *__pyx_nb_true_divide_8petsc4py_5PETSc_Mat_maybe_call_slot(PyTypeObject* type, PyObject *left, PyObject *right ) { binaryfunc slot; #if CYTHON_USE_TYPE_SLOTS || PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY slot = type->tp_as_number ? type->tp_as_number->nb_true_divide : NULL; #else slot = (binaryfunc) PyType_GetSlot(type, Py_nb_true_divide); #endif return slot ? slot(left, right ) : __Pyx_NewRef(Py_NotImplemented); } static PyObject *__pyx_nb_true_divide_8petsc4py_5PETSc_Mat(PyObject *left, PyObject *right ) { int maybe_self_is_left, maybe_self_is_right = 0; maybe_self_is_left = Py_TYPE(left) == Py_TYPE(right) #if CYTHON_USE_TYPE_SLOTS || (Py_TYPE(left)->tp_as_number && Py_TYPE(left)->tp_as_number->nb_true_divide == &__pyx_nb_true_divide_8petsc4py_5PETSc_Mat) #endif || __Pyx_TypeCheck(left, __pyx_ptype_8petsc4py_5PETSc_Mat); if (maybe_self_is_left) { PyObject *res; res = __pyx_pw_8petsc4py_5PETSc_3Mat_33__truediv__(left, right); if (res != Py_NotImplemented) return res; Py_DECREF(res); } maybe_self_is_right = Py_TYPE(left) == Py_TYPE(right) #if CYTHON_USE_TYPE_SLOTS || (Py_TYPE(right)->tp_as_number && Py_TYPE(right)->tp_as_number->nb_true_divide == &__pyx_nb_true_divide_8petsc4py_5PETSc_Mat) #endif || PyType_IsSubtype(Py_TYPE(right), __pyx_ptype_8petsc4py_5PETSc_Mat); if (maybe_self_is_right) { return __pyx_pw_8petsc4py_5PETSc_3Mat_35__rtruediv__(right, left); } return __Pyx_NewRef(Py_NotImplemented); } #if PY_VERSION_HEX >= 0x03050000 static CYTHON_INLINE PyObject *__pyx_nb_matrix_multiply_8petsc4py_5PETSc_Mat_maybe_call_slot(PyTypeObject* type, PyObject *left, PyObject *right ) { binaryfunc slot; #if CYTHON_USE_TYPE_SLOTS || PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY slot = type->tp_as_number ? type->tp_as_number->nb_matrix_multiply : NULL; #else slot = (binaryfunc) PyType_GetSlot(type, Py_nb_matrix_multiply); #endif return slot ? slot(left, right ) : __Pyx_NewRef(Py_NotImplemented); } static PyObject *__pyx_nb_matrix_multiply_8petsc4py_5PETSc_Mat(PyObject *left, PyObject *right ) { int maybe_self_is_left, maybe_self_is_right = 0; maybe_self_is_left = Py_TYPE(left) == Py_TYPE(right) #if CYTHON_USE_TYPE_SLOTS || (Py_TYPE(left)->tp_as_number && Py_TYPE(left)->tp_as_number->nb_matrix_multiply == &__pyx_nb_matrix_multiply_8petsc4py_5PETSc_Mat) #endif || __Pyx_TypeCheck(left, __pyx_ptype_8petsc4py_5PETSc_Mat); if (maybe_self_is_left) { PyObject *res; res = __pyx_pw_8petsc4py_5PETSc_3Mat_37__matmul__(left, right); if (res != Py_NotImplemented) return res; Py_DECREF(res); } maybe_self_is_right = Py_TYPE(left) == Py_TYPE(right) #if CYTHON_USE_TYPE_SLOTS || (Py_TYPE(right)->tp_as_number && Py_TYPE(right)->tp_as_number->nb_matrix_multiply == &__pyx_nb_matrix_multiply_8petsc4py_5PETSc_Mat) #endif || PyType_IsSubtype(Py_TYPE(right), __pyx_ptype_8petsc4py_5PETSc_Mat); if (maybe_self_is_right) { return __pyx_nb_matrix_multiply_8petsc4py_5PETSc_Mat_maybe_call_slot(__Pyx_PyType_GetSlot(__pyx_ptype_8petsc4py_5PETSc_Mat, tp_base, PyTypeObject*), left, right ); } return __Pyx_NewRef(Py_NotImplemented); } #endif static PyObject *__pyx_getprop_8petsc4py_5PETSc_3Mat_sizes(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3Mat_5sizes_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_3Mat_sizes(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_3Mat_5sizes_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3Mat_size(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3Mat_4size_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3Mat_local_size(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3Mat_10local_size_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3Mat_block_size(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3Mat_10block_size_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3Mat_block_sizes(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3Mat_11block_sizes_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3Mat_owner_range(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3Mat_11owner_range_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3Mat_owner_ranges(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3Mat_12owner_ranges_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3Mat_assembled(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3Mat_9assembled_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3Mat_symmetric(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3Mat_9symmetric_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3Mat_hermitian(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3Mat_9hermitian_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3Mat_structsymm(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3Mat_10structsymm_1__get__(o); } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_Mat[] = { {"__radd__", (PyCFunction)__pyx_pw_8petsc4py_5PETSc_3Mat_19__radd__, METH_O|METH_COEXIST, 0}, {"__rsub__", (PyCFunction)__pyx_pw_8petsc4py_5PETSc_3Mat_23__rsub__, METH_O|METH_COEXIST, 0}, {"__rmul__", (PyCFunction)__pyx_pw_8petsc4py_5PETSc_3Mat_27__rmul__, METH_O|METH_COEXIST, 0}, #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) {"__rdiv__", (PyCFunction)__pyx_pw_8petsc4py_5PETSc_3Mat_31__rdiv__, METH_O|METH_COEXIST, 0}, #endif {"__rtruediv__", (PyCFunction)__pyx_pw_8petsc4py_5PETSc_3Mat_35__rtruediv__, METH_O|METH_COEXIST, 0}, {"view", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_45view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_44view}, {"destroy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_47destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_46destroy}, {"create", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_49create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_48create}, {"setType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_51setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_50setType}, {"setSizes", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_53setSizes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_52setSizes}, {"setBlockSize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_55setBlockSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_54setBlockSize}, {"setBlockSizes", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_57setBlockSizes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_56setBlockSizes}, {"setVecType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_59setVecType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_58setVecType}, {"getVecType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_61getVecType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_60getVecType}, {"setNestVecType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_63setNestVecType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_62setNestVecType}, {"createAIJ", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_65createAIJ, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_64createAIJ}, {"createBAIJ", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_67createBAIJ, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_66createBAIJ}, {"createSBAIJ", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_69createSBAIJ, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_68createSBAIJ}, {"createAIJCRL", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_71createAIJCRL, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_70createAIJCRL}, {"setPreallocationNNZ", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_73setPreallocationNNZ, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_72setPreallocationNNZ}, {"setPreallocationCSR", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_75setPreallocationCSR, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_74setPreallocationCSR}, {"createAIJWithArrays", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_77createAIJWithArrays, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_76createAIJWithArrays}, {"createDense", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_79createDense, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_78createDense}, {"createDenseCUDA", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_81createDenseCUDA, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_80createDenseCUDA}, {"setPreallocationDense", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_83setPreallocationDense, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_82setPreallocationDense}, {"createScatter", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_85createScatter, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_84createScatter}, {"createNormal", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_87createNormal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_86createNormal}, {"createTranspose", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_89createTranspose, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_88createTranspose}, {"createNormalHermitian", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_91createNormalHermitian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_90createNormalHermitian}, {"createHermitianTranspose", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_93createHermitianTranspose, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_92createHermitianTranspose}, {"createLRC", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_95createLRC, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_94createLRC}, {"createSubMatrixVirtual", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_97createSubMatrixVirtual, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_96createSubMatrixVirtual}, {"createNest", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_99createNest, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_98createNest}, {"createH2OpusFromMat", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_101createH2OpusFromMat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_100createH2OpusFromMat}, {"createIS", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_103createIS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_102createIS}, {"createConstantDiagonal", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_105createConstantDiagonal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_104createConstantDiagonal}, {"createDiagonal", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_107createDiagonal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_106createDiagonal}, {"createPython", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_109createPython, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_108createPython}, {"setPythonContext", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_111setPythonContext, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_110setPythonContext}, {"getPythonContext", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_113getPythonContext, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_112getPythonContext}, {"setPythonType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_115setPythonType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_114setPythonType}, {"getPythonType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_117getPythonType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_116getPythonType}, {"setOptionsPrefix", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_119setOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_118setOptionsPrefix}, {"getOptionsPrefix", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_121getOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_120getOptionsPrefix}, {"appendOptionsPrefix", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_123appendOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_122appendOptionsPrefix}, {"setFromOptions", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_125setFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_124setFromOptions}, {"setUp", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_127setUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_126setUp}, {"setOption", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_129setOption, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_128setOption}, {"getOption", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_131getOption, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_130getOption}, {"getType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_133getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_132getType}, {"getSize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_135getSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_134getSize}, {"getLocalSize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_137getLocalSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_136getLocalSize}, {"getSizes", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_139getSizes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_138getSizes}, {"getBlockSize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_141getBlockSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_140getBlockSize}, {"getBlockSizes", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_143getBlockSizes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_142getBlockSizes}, {"getOwnershipRange", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_145getOwnershipRange, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_144getOwnershipRange}, {"getOwnershipRanges", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_147getOwnershipRanges, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_146getOwnershipRanges}, {"getOwnershipRangeColumn", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_149getOwnershipRangeColumn, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_148getOwnershipRangeColumn}, {"getOwnershipRangesColumn", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_151getOwnershipRangesColumn, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_150getOwnershipRangesColumn}, {"getOwnershipIS", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_153getOwnershipIS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_152getOwnershipIS}, {"getInfo", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_155getInfo, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_154getInfo}, {"duplicate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_157duplicate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_156duplicate}, {"copy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_159copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_158copy}, {"load", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_161load, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_160load}, {"convert", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_163convert, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_162convert}, {"transpose", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_165transpose, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_164transpose}, {"setTransposePrecursor", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_167setTransposePrecursor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_166setTransposePrecursor}, {"hermitianTranspose", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_169hermitianTranspose, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_168hermitianTranspose}, {"realPart", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_171realPart, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_170realPart}, {"imagPart", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_173imagPart, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_172imagPart}, {"conjugate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_175conjugate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_174conjugate}, {"permute", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_177permute, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_176permute}, {"equal", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_179equal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_178equal}, {"isTranspose", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_181isTranspose, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_180isTranspose}, {"isSymmetric", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_183isSymmetric, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_182isSymmetric}, {"isSymmetricKnown", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_185isSymmetricKnown, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_184isSymmetricKnown}, {"isHermitian", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_187isHermitian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_186isHermitian}, {"isHermitianKnown", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_189isHermitianKnown, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_188isHermitianKnown}, {"isStructurallySymmetric", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_191isStructurallySymmetric, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_190isStructurallySymmetric}, {"zeroEntries", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_193zeroEntries, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_192zeroEntries}, {"getValue", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_195getValue, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_194getValue}, {"getValues", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_197getValues, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_196getValues}, {"getValuesCSR", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_199getValuesCSR, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_198getValuesCSR}, {"getRow", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_201getRow, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_200getRow}, {"getRowIJ", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_203getRowIJ, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_202getRowIJ}, {"getColumnIJ", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_205getColumnIJ, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_204getColumnIJ}, {"setValue", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_207setValue, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_206setValue}, {"setValues", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_209setValues, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_208setValues}, {"setValuesRCV", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_211setValuesRCV, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_210setValuesRCV}, {"setValuesIJV", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_213setValuesIJV, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_212setValuesIJV}, {"setValuesCSR", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_215setValuesCSR, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_214setValuesCSR}, {"setValuesBlocked", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_217setValuesBlocked, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_216setValuesBlocked}, {"setValuesBlockedRCV", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_219setValuesBlockedRCV, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_218setValuesBlockedRCV}, {"setValuesBlockedIJV", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_221setValuesBlockedIJV, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_220setValuesBlockedIJV}, {"setValuesBlockedCSR", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_223setValuesBlockedCSR, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_222setValuesBlockedCSR}, {"setLGMap", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_225setLGMap, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_224setLGMap}, {"getLGMap", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_227getLGMap, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_226getLGMap}, {"setValueLocal", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_229setValueLocal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_228setValueLocal}, {"setValuesLocal", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_231setValuesLocal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_230setValuesLocal}, {"setValuesLocalRCV", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_233setValuesLocalRCV, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_232setValuesLocalRCV}, {"setValuesLocalIJV", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_235setValuesLocalIJV, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_234setValuesLocalIJV}, {"setValuesLocalCSR", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_237setValuesLocalCSR, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_236setValuesLocalCSR}, {"setValuesBlockedLocal", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_239setValuesBlockedLocal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_238setValuesBlockedLocal}, {"setValuesBlockedLocalRCV", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_241setValuesBlockedLocalRCV, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_240setValuesBlockedLocalRCV}, {"setValuesBlockedLocalIJV", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_243setValuesBlockedLocalIJV, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_242setValuesBlockedLocalIJV}, {"setValuesBlockedLocalCSR", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_245setValuesBlockedLocalCSR, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_244setValuesBlockedLocalCSR}, {"setStencil", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_247setStencil, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_246setStencil}, {"setValueStencil", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_249setValueStencil, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_248setValueStencil}, {"setValueStagStencil", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_251setValueStagStencil, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_250setValueStagStencil}, {"setValueBlockedStencil", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_253setValueBlockedStencil, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_252setValueBlockedStencil}, {"setValueBlockedStagStencil", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_255setValueBlockedStagStencil, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_254setValueBlockedStagStencil}, {"zeroRows", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_257zeroRows, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_256zeroRows}, {"zeroRowsLocal", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_259zeroRowsLocal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_258zeroRowsLocal}, {"zeroRowsColumns", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_261zeroRowsColumns, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_260zeroRowsColumns}, {"zeroRowsColumnsLocal", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_263zeroRowsColumnsLocal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_262zeroRowsColumnsLocal}, {"zeroRowsColumnsStencil", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_265zeroRowsColumnsStencil, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_264zeroRowsColumnsStencil}, {"storeValues", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_267storeValues, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_266storeValues}, {"retrieveValues", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_269retrieveValues, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_268retrieveValues}, {"assemblyBegin", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_271assemblyBegin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_270assemblyBegin}, {"assemblyEnd", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_273assemblyEnd, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_272assemblyEnd}, {"assemble", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_275assemble, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_274assemble}, {"isAssembled", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_277isAssembled, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_276isAssembled}, {"findZeroRows", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_279findZeroRows, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_278findZeroRows}, {"createVecs", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_281createVecs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_280createVecs}, {"createVecRight", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_283createVecRight, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_282createVecRight}, {"createVecLeft", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_285createVecLeft, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_284createVecLeft}, {"getColumnVector", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_287getColumnVector, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_286getColumnVector}, {"getRedundantMatrix", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_289getRedundantMatrix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_288getRedundantMatrix}, {"getDiagonal", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_291getDiagonal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_290getDiagonal}, {"getRowSum", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_293getRowSum, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_292getRowSum}, {"setDiagonal", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_295setDiagonal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_294setDiagonal}, {"diagonalScale", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_297diagonalScale, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_296diagonalScale}, {"invertBlockDiagonal", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_299invertBlockDiagonal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_298invertBlockDiagonal}, {"setNullSpace", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_301setNullSpace, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_300setNullSpace}, {"getNullSpace", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_303getNullSpace, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_302getNullSpace}, {"setTransposeNullSpace", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_305setTransposeNullSpace, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_304setTransposeNullSpace}, {"getTransposeNullSpace", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_307getTransposeNullSpace, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_306getTransposeNullSpace}, {"setNearNullSpace", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_309setNearNullSpace, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_308setNearNullSpace}, {"getNearNullSpace", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_311getNearNullSpace, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_310getNearNullSpace}, {"mult", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_313mult, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_312mult}, {"multAdd", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_315multAdd, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_314multAdd}, {"multTranspose", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_317multTranspose, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_316multTranspose}, {"multTransposeAdd", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_319multTransposeAdd, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_318multTransposeAdd}, {"multHermitian", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_321multHermitian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_320multHermitian}, {"multHermitianAdd", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_323multHermitianAdd, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_322multHermitianAdd}, {"SOR", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_325SOR, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_324SOR}, {"getDiagonalBlock", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_327getDiagonalBlock, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_326getDiagonalBlock}, {"increaseOverlap", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_329increaseOverlap, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_328increaseOverlap}, {"createSubMatrix", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_331createSubMatrix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_330createSubMatrix}, {"createSubMatrices", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_333createSubMatrices, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_332createSubMatrices}, {"getLocalSubMatrix", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_335getLocalSubMatrix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_334getLocalSubMatrix}, {"restoreLocalSubMatrix", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_337restoreLocalSubMatrix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_336restoreLocalSubMatrix}, {"norm", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_339norm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_338norm}, {"scale", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_341scale, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_340scale}, {"shift", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_343shift, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_342shift}, {"chop", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_345chop, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_344chop}, {"setRandom", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_347setRandom, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_346setRandom}, {"axpy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_349axpy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_348axpy}, {"aypx", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_351aypx, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_350aypx}, {"matMult", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_353matMult, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_352matMult}, {"matTransposeMult", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_355matTransposeMult, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_354matTransposeMult}, {"transposeMatMult", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_357transposeMatMult, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_356transposeMatMult}, {"ptap", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_359ptap, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_358ptap}, {"rart", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_361rart, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_360rart}, {"matMatMult", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_363matMatMult, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_362matMatMult}, {"kron", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_365kron, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_364kron}, {"bindToCPU", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_367bindToCPU, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_366bindToCPU}, {"boundToCPU", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_369boundToCPU, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_368boundToCPU}, {"getOrdering", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_371getOrdering, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_370getOrdering}, {"reorderForNonzeroDiagonal", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_373reorderForNonzeroDiagonal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_372reorderForNonzeroDiagonal}, {"factorLU", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_375factorLU, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_374factorLU}, {"factorSymbolicLU", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_377factorSymbolicLU, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_376factorSymbolicLU}, {"factorNumericLU", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_379factorNumericLU, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_378factorNumericLU}, {"factorILU", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_381factorILU, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_380factorILU}, {"factorSymbolicILU", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_383factorSymbolicILU, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_382factorSymbolicILU}, {"factorCholesky", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_385factorCholesky, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_384factorCholesky}, {"factorSymbolicCholesky", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_387factorSymbolicCholesky, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_386factorSymbolicCholesky}, {"factorNumericCholesky", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_389factorNumericCholesky, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_388factorNumericCholesky}, {"factorICC", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_391factorICC, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_390factorICC}, {"factorSymbolicICC", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_393factorSymbolicICC, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_392factorSymbolicICC}, {"getInertia", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_395getInertia, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_394getInertia}, {"setUnfactored", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_397setUnfactored, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_396setUnfactored}, {"fixISLocalEmpty", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_399fixISLocalEmpty, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_398fixISLocalEmpty}, {"getISLocalMat", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_401getISLocalMat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_400getISLocalMat}, {"restoreISLocalMat", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_403restoreISLocalMat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_402restoreISLocalMat}, {"setISLocalMat", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_405setISLocalMat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_404setISLocalMat}, {"setISPreallocation", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_407setISPreallocation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_406setISPreallocation}, {"getLRCMats", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_409getLRCMats, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_408getLRCMats}, {"setLRCMats", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_411setLRCMats, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_410setLRCMats}, {"H2OpusOrthogonalize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_413H2OpusOrthogonalize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_412H2OpusOrthogonalize}, {"H2OpusCompress", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_415H2OpusCompress, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_414H2OpusCompress}, {"H2OpusLowRankUpdate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_417H2OpusLowRankUpdate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_416H2OpusLowRankUpdate}, {"setMumpsIcntl", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_419setMumpsIcntl, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_418setMumpsIcntl}, {"getMumpsIcntl", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_421getMumpsIcntl, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_420getMumpsIcntl}, {"setMumpsCntl", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_423setMumpsCntl, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_422setMumpsCntl}, {"getMumpsCntl", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_425getMumpsCntl, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_424getMumpsCntl}, {"getMumpsInfo", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_427getMumpsInfo, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_426getMumpsInfo}, {"getMumpsInfog", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_429getMumpsInfog, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_428getMumpsInfog}, {"getMumpsRinfo", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_431getMumpsRinfo, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_430getMumpsRinfo}, {"getMumpsRinfog", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_433getMumpsRinfog, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_432getMumpsRinfog}, {"solveForward", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_435solveForward, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_434solveForward}, {"solveBackward", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_437solveBackward, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_436solveBackward}, {"solve", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_439solve, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_438solve}, {"solveTranspose", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_441solveTranspose, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_440solveTranspose}, {"solveAdd", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_443solveAdd, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_442solveAdd}, {"solveTransposeAdd", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_445solveTransposeAdd, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_444solveTransposeAdd}, {"matSolve", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_447matSolve, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_446matSolve}, {"setDenseLDA", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_449setDenseLDA, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_448setDenseLDA}, {"getDenseLDA", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_451getDenseLDA, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_450getDenseLDA}, {"getDenseArray", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_453getDenseArray, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_452getDenseArray}, {"getDenseLocalMatrix", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_455getDenseLocalMatrix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_454getDenseLocalMatrix}, {"getDenseColumnVec", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_457getDenseColumnVec, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_456getDenseColumnVec}, {"restoreDenseColumnVec", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_459restoreDenseColumnVec, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_458restoreDenseColumnVec}, {"getNestSize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_461getNestSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_460getNestSize}, {"getNestISs", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_463getNestISs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_462getNestISs}, {"getNestLocalISs", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_465getNestLocalISs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_464getNestLocalISs}, {"getNestSubMatrix", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_467getNestSubMatrix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_466getNestSubMatrix}, {"getDM", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_469getDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_468getDM}, {"setDM", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_471setDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_470setDM}, {"__dlpack__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_473__dlpack__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_472__dlpack__}, {"__dlpack_device__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_475__dlpack_device__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_474__dlpack_device__}, {"toDLPack", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_477toDLPack, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_476toDLPack}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_8petsc4py_5PETSc_Mat[] = { {(char *)"sizes", __pyx_getprop_8petsc4py_5PETSc_3Mat_sizes, __pyx_setprop_8petsc4py_5PETSc_3Mat_sizes, (char *)PyDoc_STR("Mat.sizes: tuple[tuple[int, int], tuple[int, int]]\nMatrix local and global sizes.\nSource code at petsc4py/PETSc/Mat.pyx:5468"), 0}, {(char *)"size", __pyx_getprop_8petsc4py_5PETSc_3Mat_size, 0, (char *)PyDoc_STR("Mat.size: tuple[int, int]\nMatrix global size.\nSource code at petsc4py/PETSc/Mat.pyx:5475"), 0}, {(char *)"local_size", __pyx_getprop_8petsc4py_5PETSc_3Mat_local_size, 0, (char *)PyDoc_STR("Mat.local_size: int\nMatrix local size.\nSource code at petsc4py/PETSc/Mat.pyx:5480"), 0}, {(char *)"block_size", __pyx_getprop_8petsc4py_5PETSc_3Mat_block_size, 0, (char *)PyDoc_STR("Mat.block_size: int\nMatrix block size.\nSource code at petsc4py/PETSc/Mat.pyx:5485"), 0}, {(char *)"block_sizes", __pyx_getprop_8petsc4py_5PETSc_3Mat_block_sizes, 0, (char *)PyDoc_STR("Mat.block_sizes: tuple[int, int]\nMatrix row and column block sizes.\nSource code at petsc4py/PETSc/Mat.pyx:5490"), 0}, {(char *)"owner_range", __pyx_getprop_8petsc4py_5PETSc_3Mat_owner_range, 0, (char *)PyDoc_STR("Mat.owner_range: tuple[int, int]\nMatrix local row range.\nSource code at petsc4py/PETSc/Mat.pyx:5495"), 0}, {(char *)"owner_ranges", __pyx_getprop_8petsc4py_5PETSc_3Mat_owner_ranges, 0, (char *)PyDoc_STR("Mat.owner_ranges: ArrayInt\nMatrix row ranges.\nSource code at petsc4py/PETSc/Mat.pyx:5500"), 0}, {(char *)"assembled", __pyx_getprop_8petsc4py_5PETSc_3Mat_assembled, 0, (char *)PyDoc_STR("Mat.assembled: bool\nThe boolean flag indicating if the matrix is assembled.\nSource code at petsc4py/PETSc/Mat.pyx:5507"), 0}, {(char *)"symmetric", __pyx_getprop_8petsc4py_5PETSc_3Mat_symmetric, 0, (char *)PyDoc_STR("Mat.symmetric: bool\nThe boolean flag indicating if the matrix is symmetric.\nSource code at petsc4py/PETSc/Mat.pyx:5511"), 0}, {(char *)"hermitian", __pyx_getprop_8petsc4py_5PETSc_3Mat_hermitian, 0, (char *)PyDoc_STR("Mat.hermitian: bool\nThe boolean flag indicating if the matrix is Hermitian.\nSource code at petsc4py/PETSc/Mat.pyx:5515"), 0}, {(char *)"structsymm", __pyx_getprop_8petsc4py_5PETSc_3Mat_structsymm, 0, (char *)PyDoc_STR("Mat.structsymm: bool\nThe boolean flag indicating if the matrix is structurally symmetric.\nSource code at petsc4py/PETSc/Mat.pyx:5519"), 0}, {0, 0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot PyPetscMat_Type_slots[] = { {Py_nb_add, (void *)__pyx_nb_add_8petsc4py_5PETSc_Mat}, {Py_nb_subtract, (void *)__pyx_nb_subtract_8petsc4py_5PETSc_Mat}, {Py_nb_multiply, (void *)__pyx_nb_multiply_8petsc4py_5PETSc_Mat}, #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) {Py_nb_divide, (void *)__pyx_nb_divide_8petsc4py_5PETSc_Mat}, #endif {Py_nb_negative, (void *)__pyx_pw_8petsc4py_5PETSc_3Mat_5__neg__}, {Py_nb_positive, (void *)__pyx_pw_8petsc4py_5PETSc_3Mat_3__pos__}, {Py_nb_inplace_add, (void *)__pyx_pw_8petsc4py_5PETSc_3Mat_7__iadd__}, {Py_nb_inplace_subtract, (void *)__pyx_pw_8petsc4py_5PETSc_3Mat_9__isub__}, {Py_nb_inplace_multiply, (void *)__pyx_pw_8petsc4py_5PETSc_3Mat_11__imul__}, #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) {Py_nb_inplace_divide, (void *)__pyx_pw_8petsc4py_5PETSc_3Mat_13__idiv__}, #endif {Py_nb_true_divide, (void *)__pyx_nb_true_divide_8petsc4py_5PETSc_Mat}, {Py_nb_inplace_true_divide, (void *)__pyx_pw_8petsc4py_5PETSc_3Mat_15__itruediv__}, #if PY_VERSION_HEX >= 0x03050000 {Py_nb_matrix_multiply, (void *)__pyx_nb_matrix_multiply_8petsc4py_5PETSc_Mat}, #endif {Py_sq_item, (void *)__pyx_sq_item_8petsc4py_5PETSc_Mat}, {Py_mp_subscript, (void *)__pyx_pw_8petsc4py_5PETSc_3Mat_39__getitem__}, {Py_mp_ass_subscript, (void *)__pyx_mp_ass_subscript_8petsc4py_5PETSc_Mat}, {Py_tp_call, (void *)__pyx_pw_8petsc4py_5PETSc_3Mat_43__call__}, {Py_tp_doc, (void *)PyDoc_STR("Matrix object.\n\n Mat is described in the `PETSc manual `.\n\n See Also\n --------\n petsc.Mat\n\n ")}, {Py_tp_traverse, (void *)__pyx_tp_traverse_8petsc4py_5PETSc_Object}, {Py_tp_clear, (void *)__pyx_tp_clear_8petsc4py_5PETSc_Object}, {Py_tp_methods, (void *)__pyx_methods_8petsc4py_5PETSc_Mat}, {Py_tp_getset, (void *)__pyx_getsets_8petsc4py_5PETSc_Mat}, {Py_tp_new, (void *)__pyx_tp_new_8petsc4py_5PETSc_Mat}, {0, 0}, }; static PyType_Spec PyPetscMat_Type_spec = { "petsc4py.PETSc.Mat", sizeof(struct PyPetscMatObject), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, PyPetscMat_Type_slots, }; #else static PyNumberMethods __pyx_tp_as_number_Mat = { __pyx_nb_add_8petsc4py_5PETSc_Mat, /*nb_add*/ __pyx_nb_subtract_8petsc4py_5PETSc_Mat, /*nb_subtract*/ __pyx_nb_multiply_8petsc4py_5PETSc_Mat, /*nb_multiply*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) __pyx_nb_divide_8petsc4py_5PETSc_Mat, /*nb_divide*/ #endif 0, /*nb_remainder*/ 0, /*nb_divmod*/ 0, /*nb_power*/ __pyx_pw_8petsc4py_5PETSc_3Mat_5__neg__, /*nb_negative*/ __pyx_pw_8petsc4py_5PETSc_3Mat_3__pos__, /*nb_positive*/ 0, /*nb_absolute*/ #if CYTHON_COMPILING_IN_PYPY || 0 __pyx_pw_8petsc4py_5PETSc_6Object_7__bool__, /*nb_bool*/ #else 0, /*nb_bool*/ #endif 0, /*nb_invert*/ 0, /*nb_lshift*/ 0, /*nb_rshift*/ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_coerce*/ #endif 0, /*nb_int*/ #if PY_MAJOR_VERSION < 3 0, /*nb_long*/ #else 0, /*reserved*/ #endif 0, /*nb_float*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_oct*/ #endif #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_hex*/ #endif __pyx_pw_8petsc4py_5PETSc_3Mat_7__iadd__, /*nb_inplace_add*/ __pyx_pw_8petsc4py_5PETSc_3Mat_9__isub__, /*nb_inplace_subtract*/ __pyx_pw_8petsc4py_5PETSc_3Mat_11__imul__, /*nb_inplace_multiply*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) __pyx_pw_8petsc4py_5PETSc_3Mat_13__idiv__, /*nb_inplace_divide*/ #endif 0, /*nb_inplace_remainder*/ 0, /*nb_inplace_power*/ 0, /*nb_inplace_lshift*/ 0, /*nb_inplace_rshift*/ 0, /*nb_inplace_and*/ 0, /*nb_inplace_xor*/ 0, /*nb_inplace_or*/ 0, /*nb_floor_divide*/ __pyx_nb_true_divide_8petsc4py_5PETSc_Mat, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ __pyx_pw_8petsc4py_5PETSc_3Mat_15__itruediv__, /*nb_inplace_true_divide*/ 0, /*nb_index*/ #if PY_VERSION_HEX >= 0x03050000 __pyx_nb_matrix_multiply_8petsc4py_5PETSc_Mat, /*nb_matrix_multiply*/ #endif #if PY_VERSION_HEX >= 0x03050000 0, /*nb_inplace_matrix_multiply*/ #endif }; static PySequenceMethods __pyx_tp_as_sequence_Mat = { 0, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ __pyx_sq_item_8petsc4py_5PETSc_Mat, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ 0, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; static PyMappingMethods __pyx_tp_as_mapping_Mat = { 0, /*mp_length*/ __pyx_pw_8petsc4py_5PETSc_3Mat_39__getitem__, /*mp_subscript*/ __pyx_mp_ass_subscript_8petsc4py_5PETSc_Mat, /*mp_ass_subscript*/ }; DL_EXPORT(PyTypeObject) PyPetscMat_Type = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.""Mat", /*tp_name*/ sizeof(struct PyPetscMatObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Object, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ &__pyx_tp_as_number_Mat, /*tp_as_number*/ &__pyx_tp_as_sequence_Mat, /*tp_as_sequence*/ &__pyx_tp_as_mapping_Mat, /*tp_as_mapping*/ 0, /*tp_hash*/ __pyx_pw_8petsc4py_5PETSc_3Mat_43__call__, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ PyDoc_STR("Matrix object.\n\n Mat is described in the `PETSc manual `.\n\n See Also\n --------\n petsc.Mat\n\n "), /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc_Object, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc_Object, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_Mat, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_8petsc4py_5PETSc_Mat, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_Mat, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static struct __pyx_vtabstruct_8petsc4py_5PETSc_MatPartitioning __pyx_vtable_8petsc4py_5PETSc_MatPartitioning; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_MatPartitioning(PyTypeObject *t, PyObject *a, PyObject *k) { struct PyPetscMatPartitioningObject *p; PyObject *o = __pyx_tp_new_8petsc4py_5PETSc_Object(t, a, k); if (unlikely(!o)) return 0; p = ((struct PyPetscMatPartitioningObject *)o); p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Object*)__pyx_vtabptr_8petsc4py_5PETSc_MatPartitioning; if (unlikely(__pyx_pw_8petsc4py_5PETSc_15MatPartitioning_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_MatPartitioning[] = { {"view", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15MatPartitioning_5view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15MatPartitioning_4view}, {"destroy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15MatPartitioning_7destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15MatPartitioning_6destroy}, {"create", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15MatPartitioning_9create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15MatPartitioning_8create}, {"setType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15MatPartitioning_11setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15MatPartitioning_10setType}, {"getType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15MatPartitioning_13getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15MatPartitioning_12getType}, {"setFromOptions", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15MatPartitioning_15setFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15MatPartitioning_14setFromOptions}, {"setAdjacency", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15MatPartitioning_17setAdjacency, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15MatPartitioning_16setAdjacency}, {"apply", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15MatPartitioning_19apply, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15MatPartitioning_18apply}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot PyPetscMatPartitioning_Type_slots[] = { {Py_tp_call, (void *)__pyx_pw_8petsc4py_5PETSc_15MatPartitioning_3__call__}, {Py_tp_doc, (void *)PyDoc_STR("Object for managing the partitioning of a matrix or graph.")}, {Py_tp_traverse, (void *)__pyx_tp_traverse_8petsc4py_5PETSc_Object}, {Py_tp_clear, (void *)__pyx_tp_clear_8petsc4py_5PETSc_Object}, {Py_tp_methods, (void *)__pyx_methods_8petsc4py_5PETSc_MatPartitioning}, {Py_tp_new, (void *)__pyx_tp_new_8petsc4py_5PETSc_MatPartitioning}, {0, 0}, }; static PyType_Spec PyPetscMatPartitioning_Type_spec = { "petsc4py.PETSc.MatPartitioning", sizeof(struct PyPetscMatPartitioningObject), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, PyPetscMatPartitioning_Type_slots, }; #else DL_EXPORT(PyTypeObject) PyPetscMatPartitioning_Type = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.""MatPartitioning", /*tp_name*/ sizeof(struct PyPetscMatPartitioningObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Object, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ __pyx_pw_8petsc4py_5PETSc_15MatPartitioning_3__call__, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ PyDoc_STR("Object for managing the partitioning of a matrix or graph."), /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc_Object, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc_Object, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_MatPartitioning, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_MatPartitioning, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static struct __pyx_vtabstruct_8petsc4py_5PETSc_NullSpace __pyx_vtable_8petsc4py_5PETSc_NullSpace; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_NullSpace(PyTypeObject *t, PyObject *a, PyObject *k) { struct PyPetscNullSpaceObject *p; PyObject *o = __pyx_tp_new_8petsc4py_5PETSc_Object(t, a, k); if (unlikely(!o)) return 0; p = ((struct PyPetscNullSpaceObject *)o); p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Object*)__pyx_vtabptr_8petsc4py_5PETSc_NullSpace; if (unlikely(__pyx_pw_8petsc4py_5PETSc_9NullSpace_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_NullSpace[] = { {"view", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9NullSpace_5view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9NullSpace_4view}, {"destroy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9NullSpace_7destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9NullSpace_6destroy}, {"create", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9NullSpace_9create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9NullSpace_8create}, {"createRigidBody", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9NullSpace_11createRigidBody, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9NullSpace_10createRigidBody}, {"setFunction", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9NullSpace_13setFunction, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9NullSpace_12setFunction}, {"hasConstant", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9NullSpace_15hasConstant, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9NullSpace_14hasConstant}, {"getVecs", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9NullSpace_17getVecs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9NullSpace_16getVecs}, {"getFunction", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9NullSpace_19getFunction, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9NullSpace_18getFunction}, {"remove", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9NullSpace_21remove, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9NullSpace_20remove}, {"test", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9NullSpace_23test, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9NullSpace_22test}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot PyPetscNullSpace_Type_slots[] = { {Py_tp_call, (void *)__pyx_pw_8petsc4py_5PETSc_9NullSpace_3__call__}, {Py_tp_doc, (void *)PyDoc_STR("Nullspace object.\n\n See Also\n --------\n petsc.MatNullSpace\n\n ")}, {Py_tp_traverse, (void *)__pyx_tp_traverse_8petsc4py_5PETSc_Object}, {Py_tp_clear, (void *)__pyx_tp_clear_8petsc4py_5PETSc_Object}, {Py_tp_methods, (void *)__pyx_methods_8petsc4py_5PETSc_NullSpace}, {Py_tp_new, (void *)__pyx_tp_new_8petsc4py_5PETSc_NullSpace}, {0, 0}, }; static PyType_Spec PyPetscNullSpace_Type_spec = { "petsc4py.PETSc.NullSpace", sizeof(struct PyPetscNullSpaceObject), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, PyPetscNullSpace_Type_slots, }; #else DL_EXPORT(PyTypeObject) PyPetscNullSpace_Type = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.""NullSpace", /*tp_name*/ sizeof(struct PyPetscNullSpaceObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Object, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ __pyx_pw_8petsc4py_5PETSc_9NullSpace_3__call__, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ PyDoc_STR("Nullspace object.\n\n See Also\n --------\n petsc.MatNullSpace\n\n "), /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc_Object, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc_Object, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_NullSpace, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_NullSpace, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static struct __pyx_vtabstruct_8petsc4py_5PETSc_PC __pyx_vtable_8petsc4py_5PETSc_PC; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_PC(PyTypeObject *t, PyObject *a, PyObject *k) { struct PyPetscPCObject *p; PyObject *o = __pyx_tp_new_8petsc4py_5PETSc_Object(t, a, k); if (unlikely(!o)) return 0; p = ((struct PyPetscPCObject *)o); p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Object*)__pyx_vtabptr_8petsc4py_5PETSc_PC; if (unlikely(__pyx_pw_8petsc4py_5PETSc_2PC_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_PC[] = { {"view", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_5view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_4view}, {"destroy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_7destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_6destroy}, {"create", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_9create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_8create}, {"setType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_11setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_10setType}, {"getType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_13getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_12getType}, {"setOptionsPrefix", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_15setOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_14setOptionsPrefix}, {"getOptionsPrefix", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_17getOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_16getOptionsPrefix}, {"appendOptionsPrefix", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_19appendOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_18appendOptionsPrefix}, {"setFromOptions", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_21setFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_20setFromOptions}, {"setOperators", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_23setOperators, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_22setOperators}, {"getOperators", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_25getOperators, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_24getOperators}, {"setUseAmat", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_27setUseAmat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_26setUseAmat}, {"getUseAmat", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_29getUseAmat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_28getUseAmat}, {"setReusePreconditioner", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_31setReusePreconditioner, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_30setReusePreconditioner}, {"setFailedReason", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_33setFailedReason, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_32setFailedReason}, {"getFailedReason", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_35getFailedReason, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_34getFailedReason}, {"getFailedReasonRank", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_37getFailedReasonRank, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_36getFailedReasonRank}, {"setUp", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_39setUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_38setUp}, {"reset", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_41reset, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_40reset}, {"setUpOnBlocks", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_43setUpOnBlocks, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_42setUpOnBlocks}, {"apply", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_45apply, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_44apply}, {"matApply", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_47matApply, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_46matApply}, {"applyTranspose", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_49applyTranspose, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_48applyTranspose}, {"applySymmetricLeft", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_51applySymmetricLeft, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_50applySymmetricLeft}, {"applySymmetricRight", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_53applySymmetricRight, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_52applySymmetricRight}, {"getDM", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_55getDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_54getDM}, {"setDM", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_57setDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_56setDM}, {"setCoordinates", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_59setCoordinates, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_58setCoordinates}, {"createPython", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_61createPython, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_60createPython}, {"setPythonContext", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_63setPythonContext, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_62setPythonContext}, {"getPythonContext", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_65getPythonContext, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_64getPythonContext}, {"setPythonType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_67setPythonType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_66setPythonType}, {"getPythonType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_69getPythonType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_68getPythonType}, {"setASMType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_71setASMType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_70setASMType}, {"setASMOverlap", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_73setASMOverlap, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_72setASMOverlap}, {"setASMLocalSubdomains", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_75setASMLocalSubdomains, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_74setASMLocalSubdomains}, {"setASMTotalSubdomains", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_77setASMTotalSubdomains, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_76setASMTotalSubdomains}, {"getASMSubKSP", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_79getASMSubKSP, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_78getASMSubKSP}, {"setASMSortIndices", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_81setASMSortIndices, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_80setASMSortIndices}, {"setGASMType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_83setGASMType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_82setGASMType}, {"setGASMOverlap", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_85setGASMOverlap, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_84setGASMOverlap}, {"setGAMGType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_87setGAMGType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_86setGAMGType}, {"setGAMGLevels", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_89setGAMGLevels, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_88setGAMGLevels}, {"setGAMGSmooths", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_91setGAMGSmooths, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_90setGAMGSmooths}, {"getHYPREType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_93getHYPREType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_92getHYPREType}, {"setHYPREType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_95setHYPREType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_94setHYPREType}, {"setHYPREDiscreteCurl", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_97setHYPREDiscreteCurl, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_96setHYPREDiscreteCurl}, {"setHYPREDiscreteGradient", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_99setHYPREDiscreteGradient, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_98setHYPREDiscreteGradient}, {"setHYPRESetAlphaPoissonMatrix", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_101setHYPRESetAlphaPoissonMatrix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_100setHYPRESetAlphaPoissonMatrix}, {"setHYPRESetBetaPoissonMatrix", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_103setHYPRESetBetaPoissonMatrix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_102setHYPRESetBetaPoissonMatrix}, {"setHYPRESetInterpolations", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_105setHYPRESetInterpolations, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_104setHYPRESetInterpolations}, {"setHYPRESetEdgeConstantVectors", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_107setHYPRESetEdgeConstantVectors, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_106setHYPRESetEdgeConstantVectors}, {"setHYPREAMSSetInteriorNodes", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_109setHYPREAMSSetInteriorNodes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_108setHYPREAMSSetInteriorNodes}, {"setFactorSolverType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_111setFactorSolverType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_110setFactorSolverType}, {"getFactorSolverType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_113getFactorSolverType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_112getFactorSolverType}, {"setFactorSetUpSolverType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_115setFactorSetUpSolverType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_114setFactorSetUpSolverType}, {"setFactorOrdering", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_117setFactorOrdering, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_116setFactorOrdering}, {"setFactorPivot", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_119setFactorPivot, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_118setFactorPivot}, {"setFactorShift", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_121setFactorShift, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_120setFactorShift}, {"setFactorLevels", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_123setFactorLevels, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_122setFactorLevels}, {"getFactorMatrix", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_125getFactorMatrix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_124getFactorMatrix}, {"setFieldSplitType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_127setFieldSplitType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_126setFieldSplitType}, {"setFieldSplitIS", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_129setFieldSplitIS, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_128setFieldSplitIS}, {"setFieldSplitFields", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_131setFieldSplitFields, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_130setFieldSplitFields}, {"getFieldSplitSubKSP", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_133getFieldSplitSubKSP, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_132getFieldSplitSubKSP}, {"getFieldSplitSchurGetSubKSP", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_135getFieldSplitSchurGetSubKSP, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_134getFieldSplitSchurGetSubKSP}, {"setFieldSplitSchurFactType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_137setFieldSplitSchurFactType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_136setFieldSplitSchurFactType}, {"setFieldSplitSchurPreType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_139setFieldSplitSchurPreType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_138setFieldSplitSchurPreType}, {"setCompositeType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_141setCompositeType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_140setCompositeType}, {"getCompositePC", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_143getCompositePC, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_142getCompositePC}, {"addCompositePCType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_145addCompositePCType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_144addCompositePCType}, {"getKSP", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_147getKSP, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_146getKSP}, {"getMGType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_149getMGType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_148getMGType}, {"setMGType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_151setMGType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_150setMGType}, {"getMGLevels", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_153getMGLevels, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_152getMGLevels}, {"setMGLevels", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_155setMGLevels, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_154setMGLevels}, {"getMGCoarseSolve", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_157getMGCoarseSolve, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_156getMGCoarseSolve}, {"setMGInterpolation", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_159setMGInterpolation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_158setMGInterpolation}, {"getMGInterpolation", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_161getMGInterpolation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_160getMGInterpolation}, {"setMGRestriction", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_163setMGRestriction, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_162setMGRestriction}, {"getMGRestriction", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_165getMGRestriction, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_164getMGRestriction}, {"setMGRScale", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_167setMGRScale, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_166setMGRScale}, {"getMGRScale", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_169getMGRScale, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_168getMGRScale}, {"getMGSmoother", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_171getMGSmoother, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_170getMGSmoother}, {"getMGSmootherDown", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_173getMGSmootherDown, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_172getMGSmootherDown}, {"getMGSmootherUp", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_175getMGSmootherUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_174getMGSmootherUp}, {"setMGCycleType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_177setMGCycleType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_176setMGCycleType}, {"setMGCycleTypeOnLevel", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_179setMGCycleTypeOnLevel, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_178setMGCycleTypeOnLevel}, {"setMGRhs", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_181setMGRhs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_180setMGRhs}, {"setMGX", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_183setMGX, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_182setMGX}, {"setMGR", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_185setMGR, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_184setMGR}, {"setBDDCDivergenceMat", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_187setBDDCDivergenceMat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_186setBDDCDivergenceMat}, {"setBDDCDiscreteGradient", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_189setBDDCDiscreteGradient, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_188setBDDCDiscreteGradient}, {"setBDDCChangeOfBasisMat", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_191setBDDCChangeOfBasisMat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_190setBDDCChangeOfBasisMat}, {"setBDDCPrimalVerticesIS", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_193setBDDCPrimalVerticesIS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_192setBDDCPrimalVerticesIS}, {"setBDDCPrimalVerticesLocalIS", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_195setBDDCPrimalVerticesLocalIS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_194setBDDCPrimalVerticesLocalIS}, {"setBDDCCoarseningRatio", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_197setBDDCCoarseningRatio, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_196setBDDCCoarseningRatio}, {"setBDDCLevels", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_199setBDDCLevels, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_198setBDDCLevels}, {"setBDDCDirichletBoundaries", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_201setBDDCDirichletBoundaries, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_200setBDDCDirichletBoundaries}, {"setBDDCDirichletBoundariesLocal", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_203setBDDCDirichletBoundariesLocal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_202setBDDCDirichletBoundariesLocal}, {"setBDDCNeumannBoundaries", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_205setBDDCNeumannBoundaries, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_204setBDDCNeumannBoundaries}, {"setBDDCNeumannBoundariesLocal", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_207setBDDCNeumannBoundariesLocal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_206setBDDCNeumannBoundariesLocal}, {"setBDDCDofsSplitting", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_209setBDDCDofsSplitting, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_208setBDDCDofsSplitting}, {"setBDDCDofsSplittingLocal", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_211setBDDCDofsSplittingLocal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_210setBDDCDofsSplittingLocal}, {"setPatchCellNumbering", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_213setPatchCellNumbering, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_212setPatchCellNumbering}, {"setPatchDiscretisationInfo", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_215setPatchDiscretisationInfo, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_214setPatchDiscretisationInfo}, {"setPatchComputeOperator", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_217setPatchComputeOperator, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_216setPatchComputeOperator}, {"setPatchComputeOperatorInteriorFacets", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_219setPatchComputeOperatorInteriorFacets, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_218setPatchComputeOperatorInteriorFacets}, {"setPatchComputeFunction", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_221setPatchComputeFunction, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_220setPatchComputeFunction}, {"setPatchComputeFunctionInteriorFacets", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_223setPatchComputeFunctionInteriorFacets, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_222setPatchComputeFunctionInteriorFacets}, {"setPatchConstructType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_225setPatchConstructType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_224setPatchConstructType}, {"setHPDDMAuxiliaryMat", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_227setHPDDMAuxiliaryMat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_226setHPDDMAuxiliaryMat}, {"setHPDDMRHSMat", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_229setHPDDMRHSMat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_228setHPDDMRHSMat}, {"setHPDDMHasNeumannMat", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_231setHPDDMHasNeumannMat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_230setHPDDMHasNeumannMat}, {"setHPDDMCoarseCorrectionType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_233setHPDDMCoarseCorrectionType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_232setHPDDMCoarseCorrectionType}, {"getHPDDMCoarseCorrectionType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_235getHPDDMCoarseCorrectionType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_234getHPDDMCoarseCorrectionType}, {"getHPDDMSTShareSubKSP", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_237getHPDDMSTShareSubKSP, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_236getHPDDMSTShareSubKSP}, {"setHPDDMDeflationMat", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_239setHPDDMDeflationMat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_238setHPDDMDeflationMat}, {"setSPAIEpsilon", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_241setSPAIEpsilon, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_240setSPAIEpsilon}, {"setSPAINBSteps", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_243setSPAINBSteps, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_242setSPAINBSteps}, {"setSPAIMax", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_245setSPAIMax, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_244setSPAIMax}, {"setSPAIMaxNew", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_247setSPAIMaxNew, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_246setSPAIMaxNew}, {"setSPAIBlockSize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_249setSPAIBlockSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_248setSPAIBlockSize}, {"setSPAICacheSize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_251setSPAICacheSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_250setSPAICacheSize}, {"setSPAIVerbose", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_253setSPAIVerbose, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_252setSPAIVerbose}, {"setSPAISp", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_255setSPAISp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_254setSPAISp}, {"setDeflationInitOnly", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_257setDeflationInitOnly, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_256setDeflationInitOnly}, {"setDeflationLevels", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_259setDeflationLevels, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_258setDeflationLevels}, {"setDeflationReductionFactor", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_261setDeflationReductionFactor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_260setDeflationReductionFactor}, {"setDeflationCorrectionFactor", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_263setDeflationCorrectionFactor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_262setDeflationCorrectionFactor}, {"setDeflationSpaceToCompute", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_265setDeflationSpaceToCompute, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_264setDeflationSpaceToCompute}, {"setDeflationSpace", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_267setDeflationSpace, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_266setDeflationSpace}, {"setDeflationProjectionNullSpaceMat", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_269setDeflationProjectionNullSpaceMat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_268setDeflationProjectionNullSpaceMat}, {"setDeflationCoarseMat", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_271setDeflationCoarseMat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_270setDeflationCoarseMat}, {"getDeflationCoarseKSP", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_273getDeflationCoarseKSP, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_272getDeflationCoarseKSP}, {"getDeflationPC", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_275getDeflationPC, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_274getDeflationPC}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot PyPetscPC_Type_slots[] = { {Py_tp_call, (void *)__pyx_pw_8petsc4py_5PETSc_2PC_3__call__}, {Py_tp_doc, (void *)PyDoc_STR("Preconditioners.\n\n `PC` is described in the `PETSc manual `.\n Calling the `PC` with a vector as an argument will `apply` the\n preconditioner as shown in the example below.\n\n Examples\n --------\n >>> from petsc4py import PETSc\n >>> v = PETSc.Vec().createWithArray([1,2])\n >>> m = PETSc.Mat().createDense(2,array=[[1,0],[0,1]])\n >>> pc = PETSc.PC().create()\n >>> pc.setOperators(m)\n >>> u = pc(v) # Vec u is created internally, can also be passed as second argument\n\n See Also\n --------\n petsc.PC\n\n ")}, {Py_tp_traverse, (void *)__pyx_tp_traverse_8petsc4py_5PETSc_Object}, {Py_tp_clear, (void *)__pyx_tp_clear_8petsc4py_5PETSc_Object}, {Py_tp_methods, (void *)__pyx_methods_8petsc4py_5PETSc_PC}, {Py_tp_new, (void *)__pyx_tp_new_8petsc4py_5PETSc_PC}, {0, 0}, }; static PyType_Spec PyPetscPC_Type_spec = { "petsc4py.PETSc.PC", sizeof(struct PyPetscPCObject), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, PyPetscPC_Type_slots, }; #else DL_EXPORT(PyTypeObject) PyPetscPC_Type = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.""PC", /*tp_name*/ sizeof(struct PyPetscPCObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Object, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ __pyx_pw_8petsc4py_5PETSc_2PC_3__call__, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ PyDoc_STR("Preconditioners.\n\n `PC` is described in the `PETSc manual `.\n Calling the `PC` with a vector as an argument will `apply` the\n preconditioner as shown in the example below.\n\n Examples\n --------\n >>> from petsc4py import PETSc\n >>> v = PETSc.Vec().createWithArray([1,2])\n >>> m = PETSc.Mat().createDense(2,array=[[1,0],[0,1]])\n >>> pc = PETSc.PC().create()\n >>> pc.setOperators(m)\n >>> u = pc(v) # Vec u is created internally, can also be passed as second argument\n\n See Also\n --------\n petsc.PC\n\n "), /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc_Object, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc_Object, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_PC, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_PC, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static struct __pyx_vtabstruct_8petsc4py_5PETSc_KSP __pyx_vtable_8petsc4py_5PETSc_KSP; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_KSP(PyTypeObject *t, PyObject *a, PyObject *k) { struct PyPetscKSPObject *p; PyObject *o = __pyx_tp_new_8petsc4py_5PETSc_Object(t, a, k); if (unlikely(!o)) return 0; p = ((struct PyPetscKSPObject *)o); p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Object*)__pyx_vtabptr_8petsc4py_5PETSc_KSP; if (unlikely(__pyx_pw_8petsc4py_5PETSc_3KSP_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3KSP_appctx(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3KSP_6appctx_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_3KSP_appctx(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_3KSP_6appctx_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3KSP_dm(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3KSP_2dm_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_3KSP_dm(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_3KSP_2dm_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3KSP_vec_sol(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3KSP_7vec_sol_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3KSP_vec_rhs(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3KSP_7vec_rhs_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3KSP_mat_op(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3KSP_6mat_op_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3KSP_mat_pc(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3KSP_6mat_pc_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3KSP_guess_nonzero(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3KSP_13guess_nonzero_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_3KSP_guess_nonzero(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_3KSP_13guess_nonzero_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3KSP_guess_knoll(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3KSP_11guess_knoll_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_3KSP_guess_knoll(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_3KSP_11guess_knoll_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3KSP_pc(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3KSP_2pc_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3KSP_pc_side(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3KSP_7pc_side_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_3KSP_pc_side(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_3KSP_7pc_side_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3KSP_norm_type(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3KSP_9norm_type_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_3KSP_norm_type(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_3KSP_9norm_type_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3KSP_rtol(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3KSP_4rtol_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_3KSP_rtol(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_3KSP_4rtol_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3KSP_atol(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3KSP_4atol_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_3KSP_atol(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_3KSP_4atol_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3KSP_divtol(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3KSP_6divtol_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_3KSP_divtol(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_3KSP_6divtol_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3KSP_max_it(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3KSP_6max_it_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_3KSP_max_it(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_3KSP_6max_it_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3KSP_its(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3KSP_3its_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_3KSP_its(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_3KSP_3its_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3KSP_norm(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3KSP_4norm_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_3KSP_norm(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_3KSP_4norm_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3KSP_history(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3KSP_7history_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3KSP_reason(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3KSP_6reason_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_3KSP_reason(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_3KSP_6reason_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3KSP_is_iterating(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3KSP_12is_iterating_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3KSP_is_converged(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3KSP_12is_converged_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3KSP_is_diverged(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3KSP_11is_diverged_1__get__(o); } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_KSP[] = { {"view", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_5view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_4view}, {"destroy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_7destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_6destroy}, {"create", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_9create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_8create}, {"setType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_11setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_10setType}, {"getType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_13getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_12getType}, {"setOptionsPrefix", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_15setOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_14setOptionsPrefix}, {"getOptionsPrefix", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_17getOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_16getOptionsPrefix}, {"appendOptionsPrefix", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_19appendOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_18appendOptionsPrefix}, {"setFromOptions", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_21setFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_20setFromOptions}, {"setAppCtx", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_23setAppCtx, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_22setAppCtx}, {"getAppCtx", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_25getAppCtx, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_24getAppCtx}, {"getDM", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_27getDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_26getDM}, {"setDM", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_29setDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_28setDM}, {"setDMActive", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_31setDMActive, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_30setDMActive}, {"setComputeRHS", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_33setComputeRHS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_32setComputeRHS}, {"setComputeOperators", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_35setComputeOperators, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_34setComputeOperators}, {"setOperators", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_37setOperators, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_36setOperators}, {"getOperators", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_39getOperators, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_38getOperators}, {"setPC", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_41setPC, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_40setPC}, {"getPC", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_43getPC, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_42getPC}, {"setTolerances", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_45setTolerances, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_44setTolerances}, {"getTolerances", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_47getTolerances, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_46getTolerances}, {"setConvergenceTest", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_49setConvergenceTest, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_48setConvergenceTest}, {"getConvergenceTest", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_51getConvergenceTest, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_50getConvergenceTest}, {"callConvergenceTest", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_53callConvergenceTest, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_52callConvergenceTest}, {"setConvergenceHistory", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_55setConvergenceHistory, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_54setConvergenceHistory}, {"getConvergenceHistory", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_57getConvergenceHistory, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_56getConvergenceHistory}, {"logConvergenceHistory", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_59logConvergenceHistory, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_58logConvergenceHistory}, {"setMonitor", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_61setMonitor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_60setMonitor}, {"getMonitor", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_63getMonitor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_62getMonitor}, {"monitorCancel", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_65monitorCancel, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_64monitorCancel}, {"monitor", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_67monitor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_66monitor}, {"setPCSide", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_69setPCSide, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_68setPCSide}, {"getPCSide", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_71getPCSide, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_70getPCSide}, {"setNormType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_73setNormType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_72setNormType}, {"getNormType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_75getNormType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_74getNormType}, {"setComputeEigenvalues", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_77setComputeEigenvalues, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_76setComputeEigenvalues}, {"getComputeEigenvalues", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_79getComputeEigenvalues, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_78getComputeEigenvalues}, {"setComputeSingularValues", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_81setComputeSingularValues, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_80setComputeSingularValues}, {"getComputeSingularValues", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_83getComputeSingularValues, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_82getComputeSingularValues}, {"setInitialGuessNonzero", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_85setInitialGuessNonzero, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_84setInitialGuessNonzero}, {"getInitialGuessNonzero", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_87getInitialGuessNonzero, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_86getInitialGuessNonzero}, {"setInitialGuessKnoll", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_89setInitialGuessKnoll, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_88setInitialGuessKnoll}, {"getInitialGuessKnoll", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_91getInitialGuessKnoll, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_90getInitialGuessKnoll}, {"setUseFischerGuess", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_93setUseFischerGuess, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_92setUseFischerGuess}, {"setUp", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_95setUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_94setUp}, {"reset", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_97reset, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_96reset}, {"setUpOnBlocks", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_99setUpOnBlocks, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_98setUpOnBlocks}, {"solve", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_101solve, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_100solve}, {"solveTranspose", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_103solveTranspose, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_102solveTranspose}, {"matSolve", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_105matSolve, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_104matSolve}, {"matSolveTranspose", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_107matSolveTranspose, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_106matSolveTranspose}, {"setIterationNumber", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_109setIterationNumber, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_108setIterationNumber}, {"getIterationNumber", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_111getIterationNumber, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_110getIterationNumber}, {"setResidualNorm", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_113setResidualNorm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_112setResidualNorm}, {"getResidualNorm", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_115getResidualNorm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_114getResidualNorm}, {"setConvergedReason", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_117setConvergedReason, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_116setConvergedReason}, {"getConvergedReason", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_119getConvergedReason, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_118getConvergedReason}, {"setHPDDMType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_121setHPDDMType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_120setHPDDMType}, {"getHPDDMType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_123getHPDDMType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_122getHPDDMType}, {"setErrorIfNotConverged", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_125setErrorIfNotConverged, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_124setErrorIfNotConverged}, {"getErrorIfNotConverged", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_127getErrorIfNotConverged, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_126getErrorIfNotConverged}, {"getRhs", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_129getRhs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_128getRhs}, {"getSolution", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_131getSolution, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_130getSolution}, {"getWorkVecs", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_133getWorkVecs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_132getWorkVecs}, {"buildSolution", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_135buildSolution, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_134buildSolution}, {"buildResidual", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_137buildResidual, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_136buildResidual}, {"computeEigenvalues", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_139computeEigenvalues, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_138computeEigenvalues}, {"computeExtremeSingularValues", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_141computeExtremeSingularValues, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_140computeExtremeSingularValues}, {"setGMRESRestart", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_143setGMRESRestart, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_142setGMRESRestart}, {"createPython", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_145createPython, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_144createPython}, {"setPythonContext", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_147setPythonContext, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_146setPythonContext}, {"getPythonContext", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_149getPythonContext, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_148getPythonContext}, {"setPythonType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_151setPythonType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_150setPythonType}, {"getPythonType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_153getPythonType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_152getPythonType}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_8petsc4py_5PETSc_KSP[] = { {(char *)"appctx", __pyx_getprop_8petsc4py_5PETSc_3KSP_appctx, __pyx_setprop_8petsc4py_5PETSc_3KSP_appctx, (char *)PyDoc_STR("KSP.appctx: Any\nThe solver application context.\nSource code at petsc4py/PETSc/KSP.pyx:2088"), 0}, {(char *)"dm", __pyx_getprop_8petsc4py_5PETSc_3KSP_dm, __pyx_setprop_8petsc4py_5PETSc_3KSP_dm, (char *)PyDoc_STR("KSP.dm: DM\nThe solver `DM`.\nSource code at petsc4py/PETSc/KSP.pyx:2097"), 0}, {(char *)"vec_sol", __pyx_getprop_8petsc4py_5PETSc_3KSP_vec_sol, 0, (char *)PyDoc_STR("KSP.vec_sol: Vec\nThe solution vector.\nSource code at petsc4py/PETSc/KSP.pyx:2106"), 0}, {(char *)"vec_rhs", __pyx_getprop_8petsc4py_5PETSc_3KSP_vec_rhs, 0, (char *)PyDoc_STR("KSP.vec_rhs: Vec\nThe right-hand side vector.\nSource code at petsc4py/PETSc/KSP.pyx:2111"), 0}, {(char *)"mat_op", __pyx_getprop_8petsc4py_5PETSc_3KSP_mat_op, 0, (char *)PyDoc_STR("KSP.mat_op: Mat\nThe system matrix operator.\nSource code at petsc4py/PETSc/KSP.pyx:2118"), 0}, {(char *)"mat_pc", __pyx_getprop_8petsc4py_5PETSc_3KSP_mat_pc, 0, (char *)PyDoc_STR("KSP.mat_pc: Mat\nThe preconditioner operator.\nSource code at petsc4py/PETSc/KSP.pyx:2123"), 0}, {(char *)"guess_nonzero", __pyx_getprop_8petsc4py_5PETSc_3KSP_guess_nonzero, __pyx_setprop_8petsc4py_5PETSc_3KSP_guess_nonzero, (char *)PyDoc_STR("KSP.guess_nonzero: bool\nWhether guess is non-zero.\nSource code at petsc4py/PETSc/KSP.pyx:2130"), 0}, {(char *)"guess_knoll", __pyx_getprop_8petsc4py_5PETSc_3KSP_guess_knoll, __pyx_setprop_8petsc4py_5PETSc_3KSP_guess_knoll, (char *)PyDoc_STR("KSP.guess_knoll: bool\nWhether solver uses Knoll trick.\nSource code at petsc4py/PETSc/KSP.pyx:2137"), 0}, {(char *)"pc", __pyx_getprop_8petsc4py_5PETSc_3KSP_pc, 0, (char *)PyDoc_STR("KSP.pc: PC\nThe `PC` of the solver.\nSource code at petsc4py/PETSc/KSP.pyx:2146"), 0}, {(char *)"pc_side", __pyx_getprop_8petsc4py_5PETSc_3KSP_pc_side, __pyx_setprop_8petsc4py_5PETSc_3KSP_pc_side, (char *)PyDoc_STR("KSP.pc_side: PC.Side\nThe side on which preconditioning is performed.\nSource code at petsc4py/PETSc/KSP.pyx:2151"), 0}, {(char *)"norm_type", __pyx_getprop_8petsc4py_5PETSc_3KSP_norm_type, __pyx_setprop_8petsc4py_5PETSc_3KSP_norm_type, (char *)PyDoc_STR("KSP.norm_type: NormType\nThe norm used by the solver.\nSource code at petsc4py/PETSc/KSP.pyx:2158"), 0}, {(char *)"rtol", __pyx_getprop_8petsc4py_5PETSc_3KSP_rtol, __pyx_setprop_8petsc4py_5PETSc_3KSP_rtol, (char *)PyDoc_STR("KSP.rtol: float\nThe relative tolerance of the solver.\nSource code at petsc4py/PETSc/KSP.pyx:2167"), 0}, {(char *)"atol", __pyx_getprop_8petsc4py_5PETSc_3KSP_atol, __pyx_setprop_8petsc4py_5PETSc_3KSP_atol, (char *)PyDoc_STR("KSP.atol: float\nThe absolute tolerance of the solver.\nSource code at petsc4py/PETSc/KSP.pyx:2174"), 0}, {(char *)"divtol", __pyx_getprop_8petsc4py_5PETSc_3KSP_divtol, __pyx_setprop_8petsc4py_5PETSc_3KSP_divtol, (char *)PyDoc_STR("KSP.divtol: float\nThe divergence tolerance of the solver.\nSource code at petsc4py/PETSc/KSP.pyx:2181"), 0}, {(char *)"max_it", __pyx_getprop_8petsc4py_5PETSc_3KSP_max_it, __pyx_setprop_8petsc4py_5PETSc_3KSP_max_it, (char *)PyDoc_STR("KSP.max_it: int\nThe maximum number of iteration the solver may take.\nSource code at petsc4py/PETSc/KSP.pyx:2188"), 0}, {(char *)"its", __pyx_getprop_8petsc4py_5PETSc_3KSP_its, __pyx_setprop_8petsc4py_5PETSc_3KSP_its, (char *)PyDoc_STR("KSP.its: int\nThe current number of iterations the solver has taken.\nSource code at petsc4py/PETSc/KSP.pyx:2197"), 0}, {(char *)"norm", __pyx_getprop_8petsc4py_5PETSc_3KSP_norm, __pyx_setprop_8petsc4py_5PETSc_3KSP_norm, (char *)PyDoc_STR("KSP.norm: float\nThe norm of the residual at the current iteration.\nSource code at petsc4py/PETSc/KSP.pyx:2204"), 0}, {(char *)"history", __pyx_getprop_8petsc4py_5PETSc_3KSP_history, 0, (char *)PyDoc_STR("KSP.history: ndarray\nThe convergence history of the solver.\nSource code at petsc4py/PETSc/KSP.pyx:2211"), 0}, {(char *)"reason", __pyx_getprop_8petsc4py_5PETSc_3KSP_reason, __pyx_setprop_8petsc4py_5PETSc_3KSP_reason, (char *)PyDoc_STR("KSP.reason: KSP.ConvergedReason\nThe converged reason.\nSource code at petsc4py/PETSc/KSP.pyx:2218"), 0}, {(char *)"is_iterating", __pyx_getprop_8petsc4py_5PETSc_3KSP_is_iterating, 0, (char *)PyDoc_STR("KSP.is_iterating: bool\nBoolean indicating if the solver has not converged yet.\nSource code at petsc4py/PETSc/KSP.pyx:2225"), 0}, {(char *)"is_converged", __pyx_getprop_8petsc4py_5PETSc_3KSP_is_converged, 0, (char *)PyDoc_STR("KSP.is_converged: bool\nBoolean indicating if the solver has converged.\nSource code at petsc4py/PETSc/KSP.pyx:2230"), 0}, {(char *)"is_diverged", __pyx_getprop_8petsc4py_5PETSc_3KSP_is_diverged, 0, (char *)PyDoc_STR("KSP.is_diverged: bool\nBoolean indicating if the solver has failed.\nSource code at petsc4py/PETSc/KSP.pyx:2235"), 0}, {0, 0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot PyPetscKSP_Type_slots[] = { {Py_tp_call, (void *)__pyx_pw_8petsc4py_5PETSc_3KSP_3__call__}, {Py_tp_doc, (void *)PyDoc_STR("Abstract PETSc object that manages all Krylov methods.\n\n This is the object that manages the linear solves in PETSc (even\n those such as direct solvers that do no use Krylov accelerators).\n\n Notes\n -----\n When a direct solver is used, but no Krylov solver is used, the KSP\n object is still used but with a `Type.PREONLY`, meaning that\n only application of the preconditioner is used as the linear\n solver.\n\n See Also\n --------\n create, setType, SNES, TS, PC, Type.CG, Type.GMRES,\n petsc.KSP\n\n ")}, {Py_tp_traverse, (void *)__pyx_tp_traverse_8petsc4py_5PETSc_Object}, {Py_tp_clear, (void *)__pyx_tp_clear_8petsc4py_5PETSc_Object}, {Py_tp_methods, (void *)__pyx_methods_8petsc4py_5PETSc_KSP}, {Py_tp_getset, (void *)__pyx_getsets_8petsc4py_5PETSc_KSP}, {Py_tp_new, (void *)__pyx_tp_new_8petsc4py_5PETSc_KSP}, {0, 0}, }; static PyType_Spec PyPetscKSP_Type_spec = { "petsc4py.PETSc.KSP", sizeof(struct PyPetscKSPObject), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, PyPetscKSP_Type_slots, }; #else DL_EXPORT(PyTypeObject) PyPetscKSP_Type = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.""KSP", /*tp_name*/ sizeof(struct PyPetscKSPObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Object, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ __pyx_pw_8petsc4py_5PETSc_3KSP_3__call__, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ PyDoc_STR("Abstract PETSc object that manages all Krylov methods.\n\n This is the object that manages the linear solves in PETSc (even\n those such as direct solvers that do no use Krylov accelerators).\n\n Notes\n -----\n When a direct solver is used, but no Krylov solver is used, the KSP\n object is still used but with a `Type.PREONLY`, meaning that\n only application of the preconditioner is used as the linear\n solver.\n\n See Also\n --------\n create, setType, SNES, TS, PC, Type.CG, Type.GMRES,\n petsc.KSP\n\n "), /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc_Object, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc_Object, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_KSP, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_8petsc4py_5PETSc_KSP, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_KSP, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES __pyx_vtable_8petsc4py_5PETSc_SNES; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_SNES(PyTypeObject *t, PyObject *a, PyObject *k) { struct PyPetscSNESObject *p; PyObject *o = __pyx_tp_new_8petsc4py_5PETSc_Object(t, a, k); if (unlikely(!o)) return 0; p = ((struct PyPetscSNESObject *)o); p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Object*)__pyx_vtabptr_8petsc4py_5PETSc_SNES; if (unlikely(__pyx_pw_8petsc4py_5PETSc_4SNES_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4SNES_appctx(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4SNES_6appctx_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_4SNES_appctx(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_4SNES_6appctx_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4SNES_dm(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4SNES_2dm_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_4SNES_dm(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_4SNES_2dm_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4SNES_npc(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4SNES_3npc_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_4SNES_npc(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_4SNES_3npc_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4SNES_vec_sol(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4SNES_7vec_sol_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4SNES_vec_upd(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4SNES_7vec_upd_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4SNES_vec_rhs(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4SNES_7vec_rhs_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4SNES_ksp(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4SNES_3ksp_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_4SNES_ksp(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_4SNES_3ksp_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4SNES_use_ew(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4SNES_6use_ew_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_4SNES_use_ew(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_4SNES_6use_ew_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4SNES_rtol(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4SNES_4rtol_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_4SNES_rtol(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_4SNES_4rtol_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4SNES_atol(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4SNES_4atol_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_4SNES_atol(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_4SNES_4atol_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4SNES_stol(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4SNES_4stol_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_4SNES_stol(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_4SNES_4stol_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4SNES_max_it(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4SNES_6max_it_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_4SNES_max_it(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_4SNES_6max_it_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4SNES_max_funcs(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4SNES_9max_funcs_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_4SNES_max_funcs(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_4SNES_9max_funcs_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4SNES_its(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4SNES_3its_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_4SNES_its(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_4SNES_3its_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4SNES_norm(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4SNES_4norm_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_4SNES_norm(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_4SNES_4norm_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4SNES_history(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4SNES_7history_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4SNES_reason(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4SNES_6reason_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_4SNES_reason(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_4SNES_6reason_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4SNES_is_iterating(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4SNES_12is_iterating_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4SNES_is_converged(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4SNES_12is_converged_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4SNES_is_diverged(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4SNES_11is_diverged_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4SNES_use_mf(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4SNES_6use_mf_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_4SNES_use_mf(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_4SNES_6use_mf_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4SNES_use_fd(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4SNES_6use_fd_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_4SNES_use_fd(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_4SNES_6use_fd_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_SNES[] = { {"view", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_3view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_2view}, {"destroy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_5destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_4destroy}, {"create", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_7create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_6create}, {"setType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_9setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_8setType}, {"getType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_11getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_10getType}, {"setOptionsPrefix", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_13setOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_12setOptionsPrefix}, {"getOptionsPrefix", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_15getOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_14getOptionsPrefix}, {"appendOptionsPrefix", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_17appendOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_16appendOptionsPrefix}, {"setFromOptions", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_19setFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_18setFromOptions}, {"setApplicationContext", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_21setApplicationContext, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_20setApplicationContext}, {"getApplicationContext", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_23getApplicationContext, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_22getApplicationContext}, {"getDM", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_25getDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_24getDM}, {"setDM", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_27setDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_26setDM}, {"setFASInterpolation", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_29setFASInterpolation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_28setFASInterpolation}, {"getFASInterpolation", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_31getFASInterpolation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_30getFASInterpolation}, {"setFASRestriction", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_33setFASRestriction, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_32setFASRestriction}, {"getFASRestriction", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_35getFASRestriction, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_34getFASRestriction}, {"setFASInjection", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_37setFASInjection, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_36setFASInjection}, {"getFASInjection", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_39getFASInjection, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_38getFASInjection}, {"setFASRScale", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_41setFASRScale, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_40setFASRScale}, {"setFASLevels", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_43setFASLevels, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_42setFASLevels}, {"getFASLevels", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_45getFASLevels, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_44getFASLevels}, {"getFASCycleSNES", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_47getFASCycleSNES, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_46getFASCycleSNES}, {"getFASCoarseSolve", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_49getFASCoarseSolve, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_48getFASCoarseSolve}, {"getFASSmoother", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_51getFASSmoother, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_50getFASSmoother}, {"getFASSmootherDown", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_53getFASSmootherDown, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_52getFASSmootherDown}, {"getFASSmootherUp", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_55getFASSmootherUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_54getFASSmootherUp}, {"getNPC", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_57getNPC, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_56getNPC}, {"hasNPC", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_59hasNPC, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_58hasNPC}, {"setNPC", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_61setNPC, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_60setNPC}, {"setNPCSide", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_63setNPCSide, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_62setNPCSide}, {"getNPCSide", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_65getNPCSide, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_64getNPCSide}, {"setLineSearchPreCheck", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_67setLineSearchPreCheck, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_66setLineSearchPreCheck}, {"setInitialGuess", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_69setInitialGuess, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_68setInitialGuess}, {"getInitialGuess", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_71getInitialGuess, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_70getInitialGuess}, {"setFunction", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_73setFunction, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_72setFunction}, {"getFunction", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_75getFunction, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_74getFunction}, {"setUpdate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_77setUpdate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_76setUpdate}, {"getUpdate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_79getUpdate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_78getUpdate}, {"setJacobian", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_81setJacobian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_80setJacobian}, {"getJacobian", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_83getJacobian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_82getJacobian}, {"setObjective", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_85setObjective, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_84setObjective}, {"getObjective", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_87getObjective, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_86getObjective}, {"computeFunction", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_89computeFunction, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_88computeFunction}, {"computeJacobian", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_91computeJacobian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_90computeJacobian}, {"computeObjective", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_93computeObjective, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_92computeObjective}, {"setNGS", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_95setNGS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_94setNGS}, {"getNGS", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_97getNGS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_96getNGS}, {"computeNGS", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_99computeNGS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_98computeNGS}, {"setTolerances", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_101setTolerances, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_100setTolerances}, {"getTolerances", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_103getTolerances, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_102getTolerances}, {"setNormSchedule", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_105setNormSchedule, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_104setNormSchedule}, {"getNormSchedule", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_107getNormSchedule, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_106getNormSchedule}, {"setConvergenceTest", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_109setConvergenceTest, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_108setConvergenceTest}, {"getConvergenceTest", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_111getConvergenceTest, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_110getConvergenceTest}, {"callConvergenceTest", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_113callConvergenceTest, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_112callConvergenceTest}, {"converged", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_115converged, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_114converged}, {"setConvergenceHistory", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_117setConvergenceHistory, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_116setConvergenceHistory}, {"getConvergenceHistory", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_119getConvergenceHistory, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_118getConvergenceHistory}, {"logConvergenceHistory", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_121logConvergenceHistory, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_120logConvergenceHistory}, {"setResetCounters", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_123setResetCounters, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_122setResetCounters}, {"setMonitor", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_125setMonitor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_124setMonitor}, {"getMonitor", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_127getMonitor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_126getMonitor}, {"monitorCancel", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_129monitorCancel, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_128monitorCancel}, {"monitor", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_131monitor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_130monitor}, {"setMaxFunctionEvaluations", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_133setMaxFunctionEvaluations, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_132setMaxFunctionEvaluations}, {"getMaxFunctionEvaluations", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_135getMaxFunctionEvaluations, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_134getMaxFunctionEvaluations}, {"getFunctionEvaluations", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_137getFunctionEvaluations, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_136getFunctionEvaluations}, {"setMaxStepFailures", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_139setMaxStepFailures, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_138setMaxStepFailures}, {"getMaxStepFailures", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_141getMaxStepFailures, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_140getMaxStepFailures}, {"getStepFailures", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_143getStepFailures, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_142getStepFailures}, {"setMaxKSPFailures", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_145setMaxKSPFailures, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_144setMaxKSPFailures}, {"getMaxKSPFailures", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_147getMaxKSPFailures, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_146getMaxKSPFailures}, {"getKSPFailures", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_149getKSPFailures, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_148getKSPFailures}, {"setUp", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_151setUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_150setUp}, {"setUpMatrices", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_153setUpMatrices, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_152setUpMatrices}, {"reset", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_155reset, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_154reset}, {"solve", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_157solve, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_156solve}, {"setConvergedReason", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_159setConvergedReason, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_158setConvergedReason}, {"getConvergedReason", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_161getConvergedReason, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_160getConvergedReason}, {"setErrorIfNotConverged", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_163setErrorIfNotConverged, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_162setErrorIfNotConverged}, {"getErrorIfNotConverged", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_165getErrorIfNotConverged, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_164getErrorIfNotConverged}, {"setIterationNumber", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_167setIterationNumber, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_166setIterationNumber}, {"getIterationNumber", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_169getIterationNumber, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_168getIterationNumber}, {"setForceIteration", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_171setForceIteration, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_170setForceIteration}, {"setFunctionNorm", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_173setFunctionNorm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_172setFunctionNorm}, {"getFunctionNorm", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_175getFunctionNorm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_174getFunctionNorm}, {"getLinearSolveIterations", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_177getLinearSolveIterations, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_176getLinearSolveIterations}, {"getRhs", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_179getRhs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_178getRhs}, {"getSolution", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_181getSolution, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_180getSolution}, {"setSolution", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_183setSolution, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_182setSolution}, {"getSolutionUpdate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_185getSolutionUpdate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_184getSolutionUpdate}, {"setKSP", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_187setKSP, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_186setKSP}, {"getKSP", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_189getKSP, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_188getKSP}, {"setUseEW", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_191setUseEW, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_190setUseEW}, {"getUseEW", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_193getUseEW, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_192getUseEW}, {"setParamsEW", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_195setParamsEW, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_194setParamsEW}, {"getParamsEW", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_197getParamsEW, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_196getParamsEW}, {"setUseMF", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_199setUseMF, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_198setUseMF}, {"getUseMF", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_201getUseMF, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_200getUseMF}, {"setUseFD", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_203setUseFD, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_202setUseFD}, {"getUseFD", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_205getUseFD, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_204getUseFD}, {"setVariableBounds", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_207setVariableBounds, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_206setVariableBounds}, {"getVIInactiveSet", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_209getVIInactiveSet, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_208getVIInactiveSet}, {"createPython", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_211createPython, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_210createPython}, {"setPythonContext", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_213setPythonContext, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_212setPythonContext}, {"getPythonContext", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_215getPythonContext, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_214getPythonContext}, {"setPythonType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_217setPythonType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_216setPythonType}, {"getPythonType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_219getPythonType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_218getPythonType}, {"getCompositeSNES", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_221getCompositeSNES, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_220getCompositeSNES}, {"getCompositeNumber", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_223getCompositeNumber, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_222getCompositeNumber}, {"getNASMSNES", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_225getNASMSNES, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_224getNASMSNES}, {"getNASMNumber", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_227getNASMNumber, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_226getNASMNumber}, {"setPatchCellNumbering", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_229setPatchCellNumbering, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_228setPatchCellNumbering}, {"setPatchDiscretisationInfo", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_231setPatchDiscretisationInfo, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_230setPatchDiscretisationInfo}, {"setPatchComputeOperator", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_233setPatchComputeOperator, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_232setPatchComputeOperator}, {"setPatchComputeFunction", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_235setPatchComputeFunction, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_234setPatchComputeFunction}, {"setPatchConstructType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_237setPatchConstructType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_236setPatchConstructType}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_8petsc4py_5PETSc_SNES[] = { {(char *)"appctx", __pyx_getprop_8petsc4py_5PETSc_4SNES_appctx, __pyx_setprop_8petsc4py_5PETSc_4SNES_appctx, (char *)PyDoc_STR("SNES.appctx: Any\nApplication context.\nSource code at petsc4py/PETSc/SNES.pyx:2209"), 0}, {(char *)"dm", __pyx_getprop_8petsc4py_5PETSc_4SNES_dm, __pyx_setprop_8petsc4py_5PETSc_4SNES_dm, (char *)PyDoc_STR("SNES.dm: DM\n`DM`.\nSource code at petsc4py/PETSc/SNES.pyx:2218"), 0}, {(char *)"npc", __pyx_getprop_8petsc4py_5PETSc_4SNES_npc, __pyx_setprop_8petsc4py_5PETSc_4SNES_npc, (char *)PyDoc_STR("SNES.npc: SNES\nNonlinear preconditioner.\nSource code at petsc4py/PETSc/SNES.pyx:2227"), 0}, {(char *)"vec_sol", __pyx_getprop_8petsc4py_5PETSc_4SNES_vec_sol, 0, (char *)PyDoc_STR("SNES.vec_sol: Vec\nSolution vector.\nSource code at petsc4py/PETSc/SNES.pyx:2236"), 0}, {(char *)"vec_upd", __pyx_getprop_8petsc4py_5PETSc_4SNES_vec_upd, 0, (char *)PyDoc_STR("SNES.vec_upd: Vec\nUpdate vector.\nSource code at petsc4py/PETSc/SNES.pyx:2241"), 0}, {(char *)"vec_rhs", __pyx_getprop_8petsc4py_5PETSc_4SNES_vec_rhs, 0, (char *)PyDoc_STR("SNES.vec_rhs: Vec\nRight-hand side vector.\nSource code at petsc4py/PETSc/SNES.pyx:2246"), 0}, {(char *)"ksp", __pyx_getprop_8petsc4py_5PETSc_4SNES_ksp, __pyx_setprop_8petsc4py_5PETSc_4SNES_ksp, (char *)PyDoc_STR("SNES.ksp: KSP\nLinear solver.\nSource code at petsc4py/PETSc/SNES.pyx:2253"), 0}, {(char *)"use_ew", __pyx_getprop_8petsc4py_5PETSc_4SNES_use_ew, __pyx_setprop_8petsc4py_5PETSc_4SNES_use_ew, (char *)0, 0}, {(char *)"rtol", __pyx_getprop_8petsc4py_5PETSc_4SNES_rtol, __pyx_setprop_8petsc4py_5PETSc_4SNES_rtol, (char *)PyDoc_STR("SNES.rtol: float\nRelative residual tolerance.\nSource code at petsc4py/PETSc/SNES.pyx:2268"), 0}, {(char *)"atol", __pyx_getprop_8petsc4py_5PETSc_4SNES_atol, __pyx_setprop_8petsc4py_5PETSc_4SNES_atol, (char *)PyDoc_STR("SNES.atol: float\nAbsolute residual tolerance.\nSource code at petsc4py/PETSc/SNES.pyx:2275"), 0}, {(char *)"stol", __pyx_getprop_8petsc4py_5PETSc_4SNES_stol, __pyx_setprop_8petsc4py_5PETSc_4SNES_stol, (char *)PyDoc_STR("SNES.stol: float\nSolution update tolerance.\nSource code at petsc4py/PETSc/SNES.pyx:2282"), 0}, {(char *)"max_it", __pyx_getprop_8petsc4py_5PETSc_4SNES_max_it, __pyx_setprop_8petsc4py_5PETSc_4SNES_max_it, (char *)PyDoc_STR("SNES.max_it: int\nMaximum number of iterations.\nSource code at petsc4py/PETSc/SNES.pyx:2289"), 0}, {(char *)"max_funcs", __pyx_getprop_8petsc4py_5PETSc_4SNES_max_funcs, __pyx_setprop_8petsc4py_5PETSc_4SNES_max_funcs, (char *)PyDoc_STR("SNES.max_funcs: int\nMaximum number of function evaluations.\nSource code at petsc4py/PETSc/SNES.pyx:2298"), 0}, {(char *)"its", __pyx_getprop_8petsc4py_5PETSc_4SNES_its, __pyx_setprop_8petsc4py_5PETSc_4SNES_its, (char *)PyDoc_STR("SNES.its: int\nNumber of iterations.\nSource code at petsc4py/PETSc/SNES.pyx:2307"), 0}, {(char *)"norm", __pyx_getprop_8petsc4py_5PETSc_4SNES_norm, __pyx_setprop_8petsc4py_5PETSc_4SNES_norm, (char *)PyDoc_STR("SNES.norm: float\nFunction norm.\nSource code at petsc4py/PETSc/SNES.pyx:2314"), 0}, {(char *)"history", __pyx_getprop_8petsc4py_5PETSc_4SNES_history, 0, (char *)PyDoc_STR("SNES.history: tuple[ArrayReal, ArrayInt]\nConvergence history.\nSource code at petsc4py/PETSc/SNES.pyx:2321"), 0}, {(char *)"reason", __pyx_getprop_8petsc4py_5PETSc_4SNES_reason, __pyx_setprop_8petsc4py_5PETSc_4SNES_reason, (char *)PyDoc_STR("SNES.reason: ConvergedReason\nConverged reason.\nSource code at petsc4py/PETSc/SNES.pyx:2328"), 0}, {(char *)"is_iterating", __pyx_getprop_8petsc4py_5PETSc_4SNES_is_iterating, 0, (char *)PyDoc_STR("SNES.is_iterating: bool\nBoolean indicating if the solver has not converged yet.\nSource code at petsc4py/PETSc/SNES.pyx:2335"), 0}, {(char *)"is_converged", __pyx_getprop_8petsc4py_5PETSc_4SNES_is_converged, 0, (char *)PyDoc_STR("SNES.is_converged: bool\nBoolean indicating if the solver has converged.\nSource code at petsc4py/PETSc/SNES.pyx:2340"), 0}, {(char *)"is_diverged", __pyx_getprop_8petsc4py_5PETSc_4SNES_is_diverged, 0, (char *)PyDoc_STR("SNES.is_diverged: bool\nBoolean indicating if the solver has failed.\nSource code at petsc4py/PETSc/SNES.pyx:2345"), 0}, {(char *)"use_mf", __pyx_getprop_8petsc4py_5PETSc_4SNES_use_mf, __pyx_setprop_8petsc4py_5PETSc_4SNES_use_mf, (char *)PyDoc_STR("SNES.use_mf: bool\nBoolean indicating if the solver uses matrix-free finite-differencing.\nSource code at petsc4py/PETSc/SNES.pyx:2352"), 0}, {(char *)"use_fd", __pyx_getprop_8petsc4py_5PETSc_4SNES_use_fd, __pyx_setprop_8petsc4py_5PETSc_4SNES_use_fd, (char *)PyDoc_STR("SNES.use_fd: bool\nBoolean indicating if the solver uses coloring finite-differencing.\nSource code at petsc4py/PETSc/SNES.pyx:2359"), 0}, {0, 0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot PyPetscSNES_Type_slots[] = { {Py_tp_doc, (void *)PyDoc_STR("Nonlinear equations solver.\n\n SNES is described in the `PETSc manual `.\n\n See Also\n --------\n petsc.SNES\n\n ")}, {Py_tp_traverse, (void *)__pyx_tp_traverse_8petsc4py_5PETSc_Object}, {Py_tp_clear, (void *)__pyx_tp_clear_8petsc4py_5PETSc_Object}, {Py_tp_methods, (void *)__pyx_methods_8petsc4py_5PETSc_SNES}, {Py_tp_getset, (void *)__pyx_getsets_8petsc4py_5PETSc_SNES}, {Py_tp_new, (void *)__pyx_tp_new_8petsc4py_5PETSc_SNES}, {0, 0}, }; static PyType_Spec PyPetscSNES_Type_spec = { "petsc4py.PETSc.SNES", sizeof(struct PyPetscSNESObject), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, PyPetscSNES_Type_slots, }; #else DL_EXPORT(PyTypeObject) PyPetscSNES_Type = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.""SNES", /*tp_name*/ sizeof(struct PyPetscSNESObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Object, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ PyDoc_STR("Nonlinear equations solver.\n\n SNES is described in the `PETSc manual `.\n\n See Also\n --------\n petsc.SNES\n\n "), /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc_Object, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc_Object, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_SNES, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_8petsc4py_5PETSc_SNES, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_SNES, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static struct __pyx_vtabstruct_8petsc4py_5PETSc_TS __pyx_vtable_8petsc4py_5PETSc_TS; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_TS(PyTypeObject *t, PyObject *a, PyObject *k) { struct PyPetscTSObject *p; PyObject *o = __pyx_tp_new_8petsc4py_5PETSc_Object(t, a, k); if (unlikely(!o)) return 0; p = ((struct PyPetscTSObject *)o); p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Object*)__pyx_vtabptr_8petsc4py_5PETSc_TS; if (unlikely(__pyx_pw_8petsc4py_5PETSc_2TS_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static PyObject *__pyx_getprop_8petsc4py_5PETSc_2TS_appctx(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_2TS_6appctx_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_2TS_appctx(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_2TS_6appctx_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_2TS_dm(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_2TS_2dm_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_2TS_dm(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_2TS_2dm_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_2TS_problem_type(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_2TS_12problem_type_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_2TS_problem_type(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_2TS_12problem_type_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_2TS_equation_type(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_2TS_13equation_type_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_2TS_equation_type(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_2TS_13equation_type_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_2TS_snes(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_2TS_4snes_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_2TS_ksp(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_2TS_3ksp_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_2TS_vec_sol(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_2TS_7vec_sol_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_2TS_time(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_2TS_4time_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_2TS_time(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_2TS_4time_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_2TS_time_step(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_2TS_9time_step_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_2TS_time_step(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_2TS_9time_step_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_2TS_step_number(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_2TS_11step_number_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_2TS_step_number(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_2TS_11step_number_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_2TS_max_time(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_2TS_8max_time_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_2TS_max_time(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_2TS_8max_time_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_2TS_max_steps(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_2TS_9max_steps_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_2TS_max_steps(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_2TS_9max_steps_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_2TS_rtol(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_2TS_4rtol_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_2TS_rtol(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_2TS_4rtol_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_2TS_atol(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_2TS_4atol_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_2TS_atol(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_2TS_4atol_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_2TS_reason(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_2TS_6reason_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_2TS_reason(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_2TS_6reason_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_2TS_iterating(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_2TS_9iterating_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_2TS_converged(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_2TS_9converged_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_2TS_diverged(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_2TS_8diverged_1__get__(o); } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_TS[] = { {"view", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_3view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_2view}, {"load", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_5load, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_4load}, {"destroy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_7destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_6destroy}, {"create", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_9create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_8create}, {"clone", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_11clone, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_10clone}, {"setType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_13setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_12setType}, {"setRKType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_15setRKType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_14setRKType}, {"setARKIMEXType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_17setARKIMEXType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_16setARKIMEXType}, {"setARKIMEXFullyImplicit", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_19setARKIMEXFullyImplicit, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_18setARKIMEXFullyImplicit}, {"getType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_21getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_20getType}, {"getRKType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_23getRKType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_22getRKType}, {"getARKIMEXType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_25getARKIMEXType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_24getARKIMEXType}, {"setDIRKType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_27setDIRKType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_26setDIRKType}, {"getDIRKType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_29getDIRKType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_28getDIRKType}, {"setProblemType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_31setProblemType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_30setProblemType}, {"getProblemType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_33getProblemType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_32getProblemType}, {"setEquationType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_35setEquationType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_34setEquationType}, {"getEquationType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_37getEquationType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_36getEquationType}, {"setOptionsPrefix", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_39setOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_38setOptionsPrefix}, {"getOptionsPrefix", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_41getOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_40getOptionsPrefix}, {"appendOptionsPrefix", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_43appendOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_42appendOptionsPrefix}, {"setFromOptions", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_45setFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_44setFromOptions}, {"setAppCtx", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_47setAppCtx, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_46setAppCtx}, {"getAppCtx", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_49getAppCtx, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_48getAppCtx}, {"setRHSFunction", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_51setRHSFunction, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_50setRHSFunction}, {"setRHSJacobian", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_53setRHSJacobian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_52setRHSJacobian}, {"computeRHSFunction", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_55computeRHSFunction, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_54computeRHSFunction}, {"computeRHSFunctionLinear", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_57computeRHSFunctionLinear, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_56computeRHSFunctionLinear}, {"computeRHSJacobian", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_59computeRHSJacobian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_58computeRHSJacobian}, {"computeRHSJacobianConstant", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_61computeRHSJacobianConstant, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_60computeRHSJacobianConstant}, {"getRHSFunction", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_63getRHSFunction, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_62getRHSFunction}, {"getRHSJacobian", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_65getRHSJacobian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_64getRHSJacobian}, {"setIFunction", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_67setIFunction, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_66setIFunction}, {"setIJacobian", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_69setIJacobian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_68setIJacobian}, {"setIJacobianP", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_71setIJacobianP, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_70setIJacobianP}, {"computeIFunction", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_73computeIFunction, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_72computeIFunction}, {"computeIJacobian", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_75computeIJacobian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_74computeIJacobian}, {"computeIJacobianP", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_77computeIJacobianP, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_76computeIJacobianP}, {"getIFunction", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_79getIFunction, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_78getIFunction}, {"getIJacobian", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_81getIJacobian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_80getIJacobian}, {"setI2Function", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_83setI2Function, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_82setI2Function}, {"setI2Jacobian", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_85setI2Jacobian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_84setI2Jacobian}, {"computeI2Function", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_87computeI2Function, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_86computeI2Function}, {"computeI2Jacobian", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_89computeI2Jacobian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_88computeI2Jacobian}, {"getI2Function", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_91getI2Function, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_90getI2Function}, {"getI2Jacobian", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_93getI2Jacobian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_92getI2Jacobian}, {"setSolution", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_95setSolution, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_94setSolution}, {"getSolution", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_97getSolution, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_96getSolution}, {"setSolution2", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_99setSolution2, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_98setSolution2}, {"getSolution2", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_101getSolution2, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_100getSolution2}, {"setTimeSpan", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_103setTimeSpan, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_102setTimeSpan}, {"getTimeSpan", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_105getTimeSpan, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_104getTimeSpan}, {"getTimeSpanSolutions", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_107getTimeSpanSolutions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_106getTimeSpanSolutions}, {"getSNES", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_109getSNES, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_108getSNES}, {"getKSP", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_111getKSP, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_110getKSP}, {"getDM", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_113getDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_112getDM}, {"setDM", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_115setDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_114setDM}, {"setTime", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_117setTime, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_116setTime}, {"getTime", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_119getTime, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_118getTime}, {"getPrevTime", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_121getPrevTime, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_120getPrevTime}, {"getSolveTime", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_123getSolveTime, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_122getSolveTime}, {"setTimeStep", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_125setTimeStep, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_124setTimeStep}, {"getTimeStep", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_127getTimeStep, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_126getTimeStep}, {"setStepNumber", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_129setStepNumber, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_128setStepNumber}, {"getStepNumber", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_131getStepNumber, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_130getStepNumber}, {"setMaxTime", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_133setMaxTime, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_132setMaxTime}, {"getMaxTime", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_135getMaxTime, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_134getMaxTime}, {"setMaxSteps", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_137setMaxSteps, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_136setMaxSteps}, {"getMaxSteps", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_139getMaxSteps, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_138getMaxSteps}, {"getSNESIterations", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_141getSNESIterations, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_140getSNESIterations}, {"getKSPIterations", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_143getKSPIterations, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_142getKSPIterations}, {"setMaxStepRejections", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_145setMaxStepRejections, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_144setMaxStepRejections}, {"getStepRejections", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_147getStepRejections, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_146getStepRejections}, {"setMaxSNESFailures", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_149setMaxSNESFailures, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_148setMaxSNESFailures}, {"getSNESFailures", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_151getSNESFailures, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_150getSNESFailures}, {"setErrorIfStepFails", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_153setErrorIfStepFails, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_152setErrorIfStepFails}, {"setTolerances", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_155setTolerances, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_154setTolerances}, {"getTolerances", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_157getTolerances, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_156getTolerances}, {"setExactFinalTime", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_159setExactFinalTime, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_158setExactFinalTime}, {"setConvergedReason", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_161setConvergedReason, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_160setConvergedReason}, {"getConvergedReason", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_163getConvergedReason, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_162getConvergedReason}, {"setMonitor", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_165setMonitor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_164setMonitor}, {"getMonitor", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_167getMonitor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_166getMonitor}, {"monitorCancel", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_169monitorCancel, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_168monitorCancel}, {"monitor", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_171monitor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_170monitor}, {"setEventHandler", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_173setEventHandler, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_172setEventHandler}, {"setEventTolerances", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_175setEventTolerances, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_174setEventTolerances}, {"getNumEvents", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_177getNumEvents, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_176getNumEvents}, {"setPreStep", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_179setPreStep, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_178setPreStep}, {"getPreStep", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_181getPreStep, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_180getPreStep}, {"setPostStep", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_183setPostStep, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_182setPostStep}, {"getPostStep", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_185getPostStep, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_184getPostStep}, {"setUp", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_187setUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_186setUp}, {"reset", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_189reset, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_188reset}, {"step", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_191step, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_190step}, {"restartStep", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_193restartStep, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_192restartStep}, {"rollBack", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_195rollBack, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_194rollBack}, {"solve", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_197solve, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_196solve}, {"interpolate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_199interpolate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_198interpolate}, {"setStepLimits", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_201setStepLimits, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_200setStepLimits}, {"getStepLimits", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_203getStepLimits, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_202getStepLimits}, {"setSaveTrajectory", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_205setSaveTrajectory, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_204setSaveTrajectory}, {"removeTrajectory", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_207removeTrajectory, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_206removeTrajectory}, {"getCostIntegral", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_209getCostIntegral, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_208getCostIntegral}, {"setCostGradients", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_211setCostGradients, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_210setCostGradients}, {"getCostGradients", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_213getCostGradients, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_212getCostGradients}, {"setRHSJacobianP", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_215setRHSJacobianP, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_214setRHSJacobianP}, {"createQuadratureTS", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_217createQuadratureTS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_216createQuadratureTS}, {"getQuadratureTS", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_219getQuadratureTS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_218getQuadratureTS}, {"setRHSJacobianP", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_221setRHSJacobianP, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_220setRHSJacobianP}, {"computeRHSJacobianP", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_223computeRHSJacobianP, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_222computeRHSJacobianP}, {"adjointSetSteps", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_225adjointSetSteps, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_224adjointSetSteps}, {"adjointSetUp", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_227adjointSetUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_226adjointSetUp}, {"adjointSolve", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_229adjointSolve, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_228adjointSolve}, {"adjointStep", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_231adjointStep, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_230adjointStep}, {"adjointReset", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_233adjointReset, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_232adjointReset}, {"createPython", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_235createPython, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_234createPython}, {"setPythonContext", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_237setPythonContext, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_236setPythonContext}, {"getPythonContext", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_239getPythonContext, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_238getPythonContext}, {"setPythonType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_241setPythonType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_240setPythonType}, {"getPythonType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_243getPythonType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_242getPythonType}, {"setTheta", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_245setTheta, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_244setTheta}, {"getTheta", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_247getTheta, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_246getTheta}, {"setThetaEndpoint", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_249setThetaEndpoint, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_248setThetaEndpoint}, {"getThetaEndpoint", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_251getThetaEndpoint, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_250getThetaEndpoint}, {"setAlphaRadius", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_253setAlphaRadius, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_252setAlphaRadius}, {"setAlphaParams", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_255setAlphaParams, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_254setAlphaParams}, {"getAlphaParams", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_257getAlphaParams, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_256getAlphaParams}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_8petsc4py_5PETSc_TS[] = { {(char *)"appctx", __pyx_getprop_8petsc4py_5PETSc_2TS_appctx, __pyx_setprop_8petsc4py_5PETSc_2TS_appctx, (char *)PyDoc_STR("TS.appctx: Any\nApplication context.\nSource code at petsc4py/PETSc/TS.pyx:2841"), 0}, {(char *)"dm", __pyx_getprop_8petsc4py_5PETSc_2TS_dm, __pyx_setprop_8petsc4py_5PETSc_2TS_dm, (char *)PyDoc_STR("TS.dm: DM\nThe `DM`.\nSource code at petsc4py/PETSc/TS.pyx:2850"), 0}, {(char *)"problem_type", __pyx_getprop_8petsc4py_5PETSc_2TS_problem_type, __pyx_setprop_8petsc4py_5PETSc_2TS_problem_type, (char *)PyDoc_STR("TS.problem_type: ProblemType\nThe problem type.\nSource code at petsc4py/PETSc/TS.pyx:2859"), 0}, {(char *)"equation_type", __pyx_getprop_8petsc4py_5PETSc_2TS_equation_type, __pyx_setprop_8petsc4py_5PETSc_2TS_equation_type, (char *)PyDoc_STR("TS.equation_type: EquationType\nThe equation type.\nSource code at petsc4py/PETSc/TS.pyx:2866"), 0}, {(char *)"snes", __pyx_getprop_8petsc4py_5PETSc_2TS_snes, 0, (char *)PyDoc_STR("TS.snes: SNES\nThe `SNES`.\nSource code at petsc4py/PETSc/TS.pyx:2873"), 0}, {(char *)"ksp", __pyx_getprop_8petsc4py_5PETSc_2TS_ksp, 0, (char *)PyDoc_STR("TS.ksp: KSP\nThe `KSP`.\nSource code at petsc4py/PETSc/TS.pyx:2878"), 0}, {(char *)"vec_sol", __pyx_getprop_8petsc4py_5PETSc_2TS_vec_sol, 0, (char *)PyDoc_STR("TS.vec_sol: Vec\nThe solution vector.\nSource code at petsc4py/PETSc/TS.pyx:2883"), 0}, {(char *)"time", __pyx_getprop_8petsc4py_5PETSc_2TS_time, __pyx_setprop_8petsc4py_5PETSc_2TS_time, (char *)PyDoc_STR("TS.time: float\nThe current time.\nSource code at petsc4py/PETSc/TS.pyx:2890"), 0}, {(char *)"time_step", __pyx_getprop_8petsc4py_5PETSc_2TS_time_step, __pyx_setprop_8petsc4py_5PETSc_2TS_time_step, (char *)PyDoc_STR("TS.time_step: None\nThe current time step size.\nSource code at petsc4py/PETSc/TS.pyx:2897"), 0}, {(char *)"step_number", __pyx_getprop_8petsc4py_5PETSc_2TS_step_number, __pyx_setprop_8petsc4py_5PETSc_2TS_step_number, (char *)PyDoc_STR("TS.step_number: int\nThe current step number.\nSource code at petsc4py/PETSc/TS.pyx:2904"), 0}, {(char *)"max_time", __pyx_getprop_8petsc4py_5PETSc_2TS_max_time, __pyx_setprop_8petsc4py_5PETSc_2TS_max_time, (char *)PyDoc_STR("TS.max_time: float\nThe maximum time.\nSource code at petsc4py/PETSc/TS.pyx:2911"), 0}, {(char *)"max_steps", __pyx_getprop_8petsc4py_5PETSc_2TS_max_steps, __pyx_setprop_8petsc4py_5PETSc_2TS_max_steps, (char *)PyDoc_STR("TS.max_steps: int\nThe maximum number of steps.\nSource code at petsc4py/PETSc/TS.pyx:2918"), 0}, {(char *)"rtol", __pyx_getprop_8petsc4py_5PETSc_2TS_rtol, __pyx_setprop_8petsc4py_5PETSc_2TS_rtol, (char *)PyDoc_STR("TS.rtol: float\nThe relative tolerance.\nSource code at petsc4py/PETSc/TS.pyx:2927"), 0}, {(char *)"atol", __pyx_getprop_8petsc4py_5PETSc_2TS_atol, __pyx_setprop_8petsc4py_5PETSc_2TS_atol, (char *)PyDoc_STR("TS.atol: float\nThe absolute tolerance.\nSource code at petsc4py/PETSc/TS.pyx:2934"), 0}, {(char *)"reason", __pyx_getprop_8petsc4py_5PETSc_2TS_reason, __pyx_setprop_8petsc4py_5PETSc_2TS_reason, (char *)PyDoc_STR("TS.reason: TSConvergedReason\nThe converged reason.\nSource code at petsc4py/PETSc/TS.pyx:2941"), 0}, {(char *)"iterating", __pyx_getprop_8petsc4py_5PETSc_2TS_iterating, 0, (char *)PyDoc_STR("TS.iterating: bool\nIndicates the `TS` is still iterating.\nSource code at petsc4py/PETSc/TS.pyx:2948"), 0}, {(char *)"converged", __pyx_getprop_8petsc4py_5PETSc_2TS_converged, 0, (char *)PyDoc_STR("TS.converged: bool\nIndicates the `TS` has converged.\nSource code at petsc4py/PETSc/TS.pyx:2953"), 0}, {(char *)"diverged", __pyx_getprop_8petsc4py_5PETSc_2TS_diverged, 0, (char *)PyDoc_STR("TS.diverged: bool\nIndicates the `TS` has stopped.\nSource code at petsc4py/PETSc/TS.pyx:2958"), 0}, {0, 0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot PyPetscTS_Type_slots[] = { {Py_tp_doc, (void *)PyDoc_STR("ODE integrator.\n\n TS is described in the `PETSc manual `.\n\n See Also\n --------\n petsc.TS\n\n ")}, {Py_tp_traverse, (void *)__pyx_tp_traverse_8petsc4py_5PETSc_Object}, {Py_tp_clear, (void *)__pyx_tp_clear_8petsc4py_5PETSc_Object}, {Py_tp_methods, (void *)__pyx_methods_8petsc4py_5PETSc_TS}, {Py_tp_getset, (void *)__pyx_getsets_8petsc4py_5PETSc_TS}, {Py_tp_new, (void *)__pyx_tp_new_8petsc4py_5PETSc_TS}, {0, 0}, }; static PyType_Spec PyPetscTS_Type_spec = { "petsc4py.PETSc.TS", sizeof(struct PyPetscTSObject), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, PyPetscTS_Type_slots, }; #else DL_EXPORT(PyTypeObject) PyPetscTS_Type = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.""TS", /*tp_name*/ sizeof(struct PyPetscTSObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Object, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ PyDoc_STR("ODE integrator.\n\n TS is described in the `PETSc manual `.\n\n See Also\n --------\n petsc.TS\n\n "), /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc_Object, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc_Object, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_TS, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_8petsc4py_5PETSc_TS, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_TS, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO __pyx_vtable_8petsc4py_5PETSc_TAO; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_TAO(PyTypeObject *t, PyObject *a, PyObject *k) { struct PyPetscTAOObject *p; PyObject *o = __pyx_tp_new_8petsc4py_5PETSc_Object(t, a, k); if (unlikely(!o)) return 0; p = ((struct PyPetscTAOObject *)o); p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Object*)__pyx_vtabptr_8petsc4py_5PETSc_TAO; if (unlikely(__pyx_pw_8petsc4py_5PETSc_3TAO_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3TAO_appctx(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3TAO_6appctx_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_3TAO_appctx(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_3TAO_6appctx_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3TAO_ksp(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3TAO_3ksp_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3TAO_ftol(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3TAO_4ftol_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_3TAO_ftol(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_3TAO_4ftol_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3TAO_gtol(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3TAO_4gtol_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_3TAO_gtol(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_3TAO_4gtol_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3TAO_ctol(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3TAO_4ctol_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_3TAO_ctol(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_3TAO_4ctol_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3TAO_its(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3TAO_3its_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3TAO_gnorm(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3TAO_5gnorm_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3TAO_cnorm(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3TAO_5cnorm_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3TAO_solution(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3TAO_8solution_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3TAO_objective(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3TAO_9objective_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3TAO_function(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3TAO_8function_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3TAO_gradient(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3TAO_8gradient_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3TAO_reason(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3TAO_6reason_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3TAO_iterating(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3TAO_9iterating_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3TAO_converged(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3TAO_9converged_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3TAO_diverged(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3TAO_8diverged_1__get__(o); } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_TAO[] = { {"view", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_3view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_2view}, {"destroy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_5destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_4destroy}, {"create", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_7create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_6create}, {"setType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_9setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_8setType}, {"getType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_11getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_10getType}, {"setOptionsPrefix", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_13setOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_12setOptionsPrefix}, {"appendOptionsPrefix", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_15appendOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_14appendOptionsPrefix}, {"getOptionsPrefix", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_17getOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_16getOptionsPrefix}, {"setFromOptions", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_19setFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_18setFromOptions}, {"setUp", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_21setUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_20setUp}, {"setInitialTrustRegionRadius", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_23setInitialTrustRegionRadius, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_22setInitialTrustRegionRadius}, {"setAppCtx", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_25setAppCtx, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_24setAppCtx}, {"getAppCtx", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_27getAppCtx, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_26getAppCtx}, {"setSolution", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_29setSolution, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_28setSolution}, {"setObjective", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_31setObjective, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_30setObjective}, {"setResidual", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_33setResidual, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_32setResidual}, {"setJacobianResidual", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_35setJacobianResidual, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_34setJacobianResidual}, {"setGradient", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_37setGradient, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_36setGradient}, {"getGradient", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_39getGradient, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_38getGradient}, {"setObjectiveGradient", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_41setObjectiveGradient, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_40setObjectiveGradient}, {"getObjectiveAndGradient", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_43getObjectiveAndGradient, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_42getObjectiveAndGradient}, {"setVariableBounds", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_45setVariableBounds, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_44setVariableBounds}, {"setConstraints", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_47setConstraints, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_46setConstraints}, {"setHessian", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_49setHessian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_48setHessian}, {"getHessian", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_51getHessian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_50getHessian}, {"setJacobian", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_53setJacobian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_52setJacobian}, {"setStateDesignIS", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_55setStateDesignIS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_54setStateDesignIS}, {"setJacobianState", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_57setJacobianState, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_56setJacobianState}, {"setJacobianDesign", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_59setJacobianDesign, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_58setJacobianDesign}, {"setEqualityConstraints", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_61setEqualityConstraints, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_60setEqualityConstraints}, {"setJacobianEquality", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_63setJacobianEquality, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_62setJacobianEquality}, {"setUpdate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_65setUpdate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_64setUpdate}, {"getUpdate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_67getUpdate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_66getUpdate}, {"computeObjective", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_69computeObjective, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_68computeObjective}, {"computeResidual", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_71computeResidual, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_70computeResidual}, {"computeGradient", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_73computeGradient, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_72computeGradient}, {"computeObjectiveGradient", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_75computeObjectiveGradient, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_74computeObjectiveGradient}, {"computeDualVariables", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_77computeDualVariables, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_76computeDualVariables}, {"computeVariableBounds", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_79computeVariableBounds, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_78computeVariableBounds}, {"computeConstraints", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_81computeConstraints, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_80computeConstraints}, {"computeHessian", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_83computeHessian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_82computeHessian}, {"computeJacobian", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_85computeJacobian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_84computeJacobian}, {"setTolerances", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_87setTolerances, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_86setTolerances}, {"getTolerances", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_89getTolerances, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_88getTolerances}, {"setMaximumIterations", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_91setMaximumIterations, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_90setMaximumIterations}, {"getMaximumIterations", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_93getMaximumIterations, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_92getMaximumIterations}, {"setMaximumFunctionEvaluations", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_95setMaximumFunctionEvaluations, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_94setMaximumFunctionEvaluations}, {"getMaximumFunctionEvaluations", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_97getMaximumFunctionEvaluations, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_96getMaximumFunctionEvaluations}, {"setConstraintTolerances", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_99setConstraintTolerances, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_98setConstraintTolerances}, {"getConstraintTolerances", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_101getConstraintTolerances, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_100getConstraintTolerances}, {"setConvergenceTest", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_103setConvergenceTest, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_102setConvergenceTest}, {"getConvergenceTest", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_105getConvergenceTest, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_104getConvergenceTest}, {"setConvergedReason", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_107setConvergedReason, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_106setConvergedReason}, {"getConvergedReason", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_109getConvergedReason, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_108getConvergedReason}, {"setMonitor", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_111setMonitor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_110setMonitor}, {"getMonitor", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_113getMonitor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_112getMonitor}, {"cancelMonitor", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_115cancelMonitor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_114cancelMonitor}, {"monitor", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_117monitor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_116monitor}, {"solve", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_119solve, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_118solve}, {"getSolution", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_121getSolution, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_120getSolution}, {"setGradientNorm", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_123setGradientNorm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_122setGradientNorm}, {"getGradientNorm", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_125getGradientNorm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_124getGradientNorm}, {"setLMVMH0", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_127setLMVMH0, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_126setLMVMH0}, {"getLMVMH0", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_129getLMVMH0, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_128getLMVMH0}, {"getLMVMH0KSP", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_131getLMVMH0KSP, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_130getLMVMH0KSP}, {"getVariableBounds", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_133getVariableBounds, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_132getVariableBounds}, {"setBNCGType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_135setBNCGType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_134setBNCGType}, {"getBNCGType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_137getBNCGType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_136getBNCGType}, {"setIterationNumber", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_139setIterationNumber, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_138setIterationNumber}, {"getIterationNumber", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_141getIterationNumber, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_140getIterationNumber}, {"getObjectiveValue", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_143getObjectiveValue, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_142getObjectiveValue}, {"getConvergedReason", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_145getConvergedReason, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_144getConvergedReason}, {"getSolutionNorm", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_147getSolutionNorm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_146getSolutionNorm}, {"getSolutionStatus", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_149getSolutionStatus, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_148getSolutionStatus}, {"getKSP", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_151getKSP, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_150getKSP}, {"getBRGNSubsolver", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_153getBRGNSubsolver, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_152getBRGNSubsolver}, {"setBRGNRegularizerObjectiveGradient", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_155setBRGNRegularizerObjectiveGradient, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_154setBRGNRegularizerObjectiveGradient}, {"setBRGNRegularizerHessian", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_157setBRGNRegularizerHessian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_156setBRGNRegularizerHessian}, {"setBRGNRegularizerWeight", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_159setBRGNRegularizerWeight, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_158setBRGNRegularizerWeight}, {"setBRGNSmoothL1Epsilon", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_161setBRGNSmoothL1Epsilon, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_160setBRGNSmoothL1Epsilon}, {"setBRGNDictionaryMatrix", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_163setBRGNDictionaryMatrix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_162setBRGNDictionaryMatrix}, {"getBRGNDampingVector", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_165getBRGNDampingVector, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_164getBRGNDampingVector}, {"createPython", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_167createPython, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_166createPython}, {"setPythonContext", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_169setPythonContext, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_168setPythonContext}, {"getPythonContext", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_171getPythonContext, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_170getPythonContext}, {"setPythonType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_173setPythonType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_172setPythonType}, {"getPythonType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_175getPythonType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_174getPythonType}, {"getLineSearch", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_177getLineSearch, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_176getLineSearch}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_8petsc4py_5PETSc_TAO[] = { {(char *)"appctx", __pyx_getprop_8petsc4py_5PETSc_3TAO_appctx, __pyx_setprop_8petsc4py_5PETSc_3TAO_appctx, (char *)PyDoc_STR("TAO.appctx: Any\nApplication context.\nSource code at petsc4py/PETSc/TAO.pyx:1755"), 0}, {(char *)"ksp", __pyx_getprop_8petsc4py_5PETSc_3TAO_ksp, 0, (char *)PyDoc_STR("TAO.ksp: KSP\nLinear solver.\nSource code at petsc4py/PETSc/TAO.pyx:1764"), 0}, {(char *)"ftol", __pyx_getprop_8petsc4py_5PETSc_3TAO_ftol, __pyx_setprop_8petsc4py_5PETSc_3TAO_ftol, (char *)PyDoc_STR("TAO.ftol: Any\nBroken.\nSource code at petsc4py/PETSc/TAO.pyx:1772"), 0}, {(char *)"gtol", __pyx_getprop_8petsc4py_5PETSc_3TAO_gtol, __pyx_setprop_8petsc4py_5PETSc_3TAO_gtol, (char *)PyDoc_STR("TAO.gtol: Any\nBroken.\nSource code at petsc4py/PETSc/TAO.pyx:1784"), 0}, {(char *)"ctol", __pyx_getprop_8petsc4py_5PETSc_3TAO_ctol, __pyx_setprop_8petsc4py_5PETSc_3TAO_ctol, (char *)PyDoc_STR("TAO.ctol: Any\nBroken.\nSource code at petsc4py/PETSc/TAO.pyx:1796"), 0}, {(char *)"its", __pyx_getprop_8petsc4py_5PETSc_3TAO_its, 0, (char *)PyDoc_STR("TAO.its: int\nNumber of iterations.\nSource code at petsc4py/PETSc/TAO.pyx:1810"), 0}, {(char *)"gnorm", __pyx_getprop_8petsc4py_5PETSc_3TAO_gnorm, 0, (char *)PyDoc_STR("TAO.gnorm: float\nGradient norm.\nSource code at petsc4py/PETSc/TAO.pyx:1815"), 0}, {(char *)"cnorm", __pyx_getprop_8petsc4py_5PETSc_3TAO_cnorm, 0, (char *)PyDoc_STR("TAO.cnorm: float\nConstraints norm.\nSource code at petsc4py/PETSc/TAO.pyx:1820"), 0}, {(char *)"solution", __pyx_getprop_8petsc4py_5PETSc_3TAO_solution, 0, (char *)PyDoc_STR("TAO.solution: Vec\nSolution vector.\nSource code at petsc4py/PETSc/TAO.pyx:1825"), 0}, {(char *)"objective", __pyx_getprop_8petsc4py_5PETSc_3TAO_objective, 0, (char *)PyDoc_STR("TAO.objective: float\nObjective value.\nSource code at petsc4py/PETSc/TAO.pyx:1830"), 0}, {(char *)"function", __pyx_getprop_8petsc4py_5PETSc_3TAO_function, 0, (char *)PyDoc_STR("TAO.function: float\nObjective value.\nSource code at petsc4py/PETSc/TAO.pyx:1835"), 0}, {(char *)"gradient", __pyx_getprop_8petsc4py_5PETSc_3TAO_gradient, 0, (char *)PyDoc_STR("TAO.gradient: Vec\nGradient vector.\nSource code at petsc4py/PETSc/TAO.pyx:1840"), 0}, {(char *)"reason", __pyx_getprop_8petsc4py_5PETSc_3TAO_reason, 0, (char *)PyDoc_STR("TAO.reason: ConvergedReason\nConverged reason.\nSource code at petsc4py/PETSc/TAO.pyx:1847"), 0}, {(char *)"iterating", __pyx_getprop_8petsc4py_5PETSc_3TAO_iterating, 0, (char *)PyDoc_STR("TAO.iterating: bool\nBoolean indicating if the solver has not converged yet.\nSource code at petsc4py/PETSc/TAO.pyx:1852"), 0}, {(char *)"converged", __pyx_getprop_8petsc4py_5PETSc_3TAO_converged, 0, (char *)PyDoc_STR("TAO.converged: bool\nBoolean indicating if the solver has converged.\nSource code at petsc4py/PETSc/TAO.pyx:1857"), 0}, {(char *)"diverged", __pyx_getprop_8petsc4py_5PETSc_3TAO_diverged, 0, (char *)PyDoc_STR("TAO.diverged: bool\nBoolean indicating if the solver has failed.\nSource code at petsc4py/PETSc/TAO.pyx:1862"), 0}, {0, 0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot PyPetscTAO_Type_slots[] = { {Py_tp_doc, (void *)PyDoc_STR("Optimization solver.\n\n TAO is described in the `PETSc manual `.\n\n See Also\n --------\n petsc.Tao\n\n ")}, {Py_tp_traverse, (void *)__pyx_tp_traverse_8petsc4py_5PETSc_Object}, {Py_tp_clear, (void *)__pyx_tp_clear_8petsc4py_5PETSc_Object}, {Py_tp_methods, (void *)__pyx_methods_8petsc4py_5PETSc_TAO}, {Py_tp_getset, (void *)__pyx_getsets_8petsc4py_5PETSc_TAO}, {Py_tp_new, (void *)__pyx_tp_new_8petsc4py_5PETSc_TAO}, {0, 0}, }; static PyType_Spec PyPetscTAO_Type_spec = { "petsc4py.PETSc.TAO", sizeof(struct PyPetscTAOObject), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, PyPetscTAO_Type_slots, }; #else DL_EXPORT(PyTypeObject) PyPetscTAO_Type = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.""TAO", /*tp_name*/ sizeof(struct PyPetscTAOObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Object, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ PyDoc_STR("Optimization solver.\n\n TAO is described in the `PETSc manual `.\n\n See Also\n --------\n petsc.Tao\n\n "), /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc_Object, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc_Object, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_TAO, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_8petsc4py_5PETSc_TAO, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_TAO, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static struct __pyx_vtabstruct_8petsc4py_5PETSc_TAOLineSearch __pyx_vtable_8petsc4py_5PETSc_TAOLineSearch; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_TAOLineSearch(PyTypeObject *t, PyObject *a, PyObject *k) { struct PyPetscTAOLineSearchObject *p; PyObject *o = __pyx_tp_new_8petsc4py_5PETSc_Object(t, a, k); if (unlikely(!o)) return 0; p = ((struct PyPetscTAOLineSearchObject *)o); p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Object*)__pyx_vtabptr_8petsc4py_5PETSc_TAOLineSearch; if (unlikely(__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_TAOLineSearch[] = { {"view", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_3view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13TAOLineSearch_2view}, {"destroy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_5destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13TAOLineSearch_4destroy}, {"create", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_7create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13TAOLineSearch_6create}, {"setType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_9setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13TAOLineSearch_8setType}, {"getType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_11getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13TAOLineSearch_10getType}, {"setFromOptions", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_13setFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13TAOLineSearch_12setFromOptions}, {"setUp", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_15setUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13TAOLineSearch_14setUp}, {"setOptionsPrefix", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_17setOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13TAOLineSearch_16setOptionsPrefix}, {"getOptionsPrefix", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_19getOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13TAOLineSearch_18getOptionsPrefix}, {"setObjective", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_21setObjective, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13TAOLineSearch_20setObjective}, {"setGradient", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_23setGradient, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13TAOLineSearch_22setGradient}, {"setObjectiveGradient", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_25setObjectiveGradient, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13TAOLineSearch_24setObjectiveGradient}, {"useTAORoutine", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_27useTAORoutine, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13TAOLineSearch_26useTAORoutine}, {"apply", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_29apply, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13TAOLineSearch_28apply}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot PyPetscTAOLineSearch_Type_slots[] = { {Py_tp_doc, (void *)PyDoc_STR("TAO Line Search.")}, {Py_tp_traverse, (void *)__pyx_tp_traverse_8petsc4py_5PETSc_Object}, {Py_tp_clear, (void *)__pyx_tp_clear_8petsc4py_5PETSc_Object}, {Py_tp_methods, (void *)__pyx_methods_8petsc4py_5PETSc_TAOLineSearch}, {Py_tp_new, (void *)__pyx_tp_new_8petsc4py_5PETSc_TAOLineSearch}, {0, 0}, }; static PyType_Spec PyPetscTAOLineSearch_Type_spec = { "petsc4py.PETSc.TAOLineSearch", sizeof(struct PyPetscTAOLineSearchObject), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, PyPetscTAOLineSearch_Type_slots, }; #else DL_EXPORT(PyTypeObject) PyPetscTAOLineSearch_Type = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.""TAOLineSearch", /*tp_name*/ sizeof(struct PyPetscTAOLineSearchObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Object, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ PyDoc_STR("TAO Line Search."), /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc_Object, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc_Object, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_TAOLineSearch, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_TAOLineSearch, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static struct __pyx_vtabstruct_8petsc4py_5PETSc_AO __pyx_vtable_8petsc4py_5PETSc_AO; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_AO(PyTypeObject *t, PyObject *a, PyObject *k) { struct PyPetscAOObject *p; PyObject *o = __pyx_tp_new_8petsc4py_5PETSc_Object(t, a, k); if (unlikely(!o)) return 0; p = ((struct PyPetscAOObject *)o); p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Object*)__pyx_vtabptr_8petsc4py_5PETSc_AO; if (unlikely(__pyx_pw_8petsc4py_5PETSc_2AO_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_AO[] = { {"view", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2AO_3view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2AO_2view}, {"destroy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2AO_5destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2AO_4destroy}, {"createBasic", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2AO_7createBasic, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2AO_6createBasic}, {"createMemoryScalable", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2AO_9createMemoryScalable, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2AO_8createMemoryScalable}, {"createMapping", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2AO_11createMapping, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2AO_10createMapping}, {"getType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2AO_13getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2AO_12getType}, {"app2petsc", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2AO_15app2petsc, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2AO_14app2petsc}, {"petsc2app", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2AO_17petsc2app, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2AO_16petsc2app}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot PyPetscAO_Type_slots[] = { {Py_tp_doc, (void *)PyDoc_STR("Application ordering object.")}, {Py_tp_traverse, (void *)__pyx_tp_traverse_8petsc4py_5PETSc_Object}, {Py_tp_clear, (void *)__pyx_tp_clear_8petsc4py_5PETSc_Object}, {Py_tp_methods, (void *)__pyx_methods_8petsc4py_5PETSc_AO}, {Py_tp_new, (void *)__pyx_tp_new_8petsc4py_5PETSc_AO}, {0, 0}, }; static PyType_Spec PyPetscAO_Type_spec = { "petsc4py.PETSc.AO", sizeof(struct PyPetscAOObject), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, PyPetscAO_Type_slots, }; #else DL_EXPORT(PyTypeObject) PyPetscAO_Type = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.""AO", /*tp_name*/ sizeof(struct PyPetscAOObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Object, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ PyDoc_STR("Application ordering object."), /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc_Object, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc_Object, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_AO, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_AO, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static struct __pyx_vtabstruct_8petsc4py_5PETSc_DM __pyx_vtable_8petsc4py_5PETSc_DM; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_DM(PyTypeObject *t, PyObject *a, PyObject *k) { struct PyPetscDMObject *p; PyObject *o = __pyx_tp_new_8petsc4py_5PETSc_Object(t, a, k); if (unlikely(!o)) return 0; p = ((struct PyPetscDMObject *)o); p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Object*)__pyx_vtabptr_8petsc4py_5PETSc_DM; if (unlikely(__pyx_pw_8petsc4py_5PETSc_2DM_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static PyObject *__pyx_getprop_8petsc4py_5PETSc_2DM_appctx(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_2DM_6appctx_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_2DM_appctx(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_2DM_6appctx_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_2DM_ds(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_2DM_2ds_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_2DM_ds(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_2DM_2ds_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_DM[] = { {"view", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_3view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_2view}, {"load", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_5load, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_4load}, {"destroy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_7destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_6destroy}, {"create", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_9create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_8create}, {"clone", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_11clone, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_10clone}, {"setType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_13setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_12setType}, {"getType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_15getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_14getType}, {"getDimension", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_17getDimension, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_16getDimension}, {"setDimension", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_19setDimension, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_18setDimension}, {"getCoordinateDim", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_21getCoordinateDim, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_20getCoordinateDim}, {"setCoordinateDim", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_23setCoordinateDim, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_22setCoordinateDim}, {"setOptionsPrefix", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_25setOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_24setOptionsPrefix}, {"getOptionsPrefix", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_27getOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_26getOptionsPrefix}, {"appendOptionsPrefix", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_29appendOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_28appendOptionsPrefix}, {"setFromOptions", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_31setFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_30setFromOptions}, {"viewFromOptions", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_33viewFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_32viewFromOptions}, {"setUp", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_35setUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_34setUp}, {"setAppCtx", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_37setAppCtx, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_36setAppCtx}, {"getAppCtx", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_39getAppCtx, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_38getAppCtx}, {"setBasicAdjacency", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_41setBasicAdjacency, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_40setBasicAdjacency}, {"getBasicAdjacency", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_43getBasicAdjacency, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_42getBasicAdjacency}, {"setFieldAdjacency", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_45setFieldAdjacency, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_44setFieldAdjacency}, {"getFieldAdjacency", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_47getFieldAdjacency, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_46getFieldAdjacency}, {"createSubDM", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_49createSubDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_48createSubDM}, {"setAuxiliaryVec", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_51setAuxiliaryVec, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_50setAuxiliaryVec}, {"getAuxiliaryVec", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_53getAuxiliaryVec, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_52getAuxiliaryVec}, {"setNumFields", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_55setNumFields, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_54setNumFields}, {"getNumFields", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_57getNumFields, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_56getNumFields}, {"setField", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_59setField, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_58setField}, {"getField", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_61getField, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_60getField}, {"addField", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_63addField, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_62addField}, {"clearFields", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_65clearFields, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_64clearFields}, {"copyFields", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_67copyFields, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_66copyFields}, {"createDS", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_69createDS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_68createDS}, {"clearDS", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_71clearDS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_70clearDS}, {"getDS", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_73getDS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_72getDS}, {"copyDS", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_75copyDS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_74copyDS}, {"copyDisc", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_77copyDisc, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_76copyDisc}, {"getBlockSize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_79getBlockSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_78getBlockSize}, {"setVecType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_81setVecType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_80setVecType}, {"createGlobalVec", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_83createGlobalVec, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_82createGlobalVec}, {"createLocalVec", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_85createLocalVec, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_84createLocalVec}, {"getGlobalVec", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_87getGlobalVec, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_86getGlobalVec}, {"restoreGlobalVec", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_89restoreGlobalVec, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_88restoreGlobalVec}, {"getLocalVec", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_91getLocalVec, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_90getLocalVec}, {"restoreLocalVec", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_93restoreLocalVec, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_92restoreLocalVec}, {"globalToLocal", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_95globalToLocal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_94globalToLocal}, {"localToGlobal", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_97localToGlobal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_96localToGlobal}, {"localToLocal", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_99localToLocal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_98localToLocal}, {"getLGMap", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_101getLGMap, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_100getLGMap}, {"getCoarseDM", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_103getCoarseDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_102getCoarseDM}, {"setCoarseDM", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_105setCoarseDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_104setCoarseDM}, {"getCoordinateDM", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_107getCoordinateDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_106getCoordinateDM}, {"getCoordinateSection", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_109getCoordinateSection, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_108getCoordinateSection}, {"setCoordinates", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_111setCoordinates, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_110setCoordinates}, {"getCoordinates", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_113getCoordinates, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_112getCoordinates}, {"setCoordinatesLocal", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_115setCoordinatesLocal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_114setCoordinatesLocal}, {"getCoordinatesLocal", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_117getCoordinatesLocal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_116getCoordinatesLocal}, {"projectCoordinates", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_119projectCoordinates, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_118projectCoordinates}, {"getBoundingBox", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_121getBoundingBox, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_120getBoundingBox}, {"getLocalBoundingBox", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_123getLocalBoundingBox, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_122getLocalBoundingBox}, {"localizeCoordinates", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_125localizeCoordinates, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_124localizeCoordinates}, {"setMatType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_127setMatType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_126setMatType}, {"createMat", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_129createMat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_128createMat}, {"createMassMatrix", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_131createMassMatrix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_130createMassMatrix}, {"createInterpolation", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_133createInterpolation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_132createInterpolation}, {"createInjection", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_135createInjection, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_134createInjection}, {"createRestriction", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_137createRestriction, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_136createRestriction}, {"convert", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_139convert, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_138convert}, {"refine", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_141refine, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_140refine}, {"coarsen", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_143coarsen, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_142coarsen}, {"refineHierarchy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_145refineHierarchy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_144refineHierarchy}, {"coarsenHierarchy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_147coarsenHierarchy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_146coarsenHierarchy}, {"getRefineLevel", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_149getRefineLevel, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_148getRefineLevel}, {"setRefineLevel", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_151setRefineLevel, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_150setRefineLevel}, {"getCoarsenLevel", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_153getCoarsenLevel, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_152getCoarsenLevel}, {"adaptLabel", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_155adaptLabel, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_154adaptLabel}, {"adaptMetric", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_157adaptMetric, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_156adaptMetric}, {"getLabel", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_159getLabel, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_158getLabel}, {"setLocalSection", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_161setLocalSection, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_160setLocalSection}, {"getLocalSection", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_163getLocalSection, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_162getLocalSection}, {"setGlobalSection", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_165setGlobalSection, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_164setGlobalSection}, {"getGlobalSection", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_167getGlobalSection, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_166getGlobalSection}, {"createSectionSF", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_169createSectionSF, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_168createSectionSF}, {"getSectionSF", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_171getSectionSF, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_170getSectionSF}, {"setSectionSF", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_173setSectionSF, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_172setSectionSF}, {"getPointSF", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_175getPointSF, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_174getPointSF}, {"setPointSF", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_177setPointSF, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_176setPointSF}, {"getNumLabels", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_179getNumLabels, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_178getNumLabels}, {"getLabelName", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_181getLabelName, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_180getLabelName}, {"hasLabel", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_183hasLabel, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_182hasLabel}, {"createLabel", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_185createLabel, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_184createLabel}, {"removeLabel", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_187removeLabel, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_186removeLabel}, {"getLabelValue", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_189getLabelValue, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_188getLabelValue}, {"setLabelValue", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_191setLabelValue, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_190setLabelValue}, {"clearLabelValue", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_193clearLabelValue, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_192clearLabelValue}, {"getLabelSize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_195getLabelSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_194getLabelSize}, {"getLabelIdIS", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_197getLabelIdIS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_196getLabelIdIS}, {"getStratumSize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_199getStratumSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_198getStratumSize}, {"getStratumIS", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_201getStratumIS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_200getStratumIS}, {"clearLabelStratum", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_203clearLabelStratum, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_202clearLabelStratum}, {"setLabelOutput", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_205setLabelOutput, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_204setLabelOutput}, {"getLabelOutput", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_207getLabelOutput, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_206getLabelOutput}, {"setKSPComputeOperators", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_209setKSPComputeOperators, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_208setKSPComputeOperators}, {"createFieldDecomposition", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_211createFieldDecomposition, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_210createFieldDecomposition}, {"setSNESFunction", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_213setSNESFunction, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_212setSNESFunction}, {"setSNESJacobian", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_215setSNESJacobian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_214setSNESJacobian}, {"addCoarsenHook", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_217addCoarsenHook, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_216addCoarsenHook}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_8petsc4py_5PETSc_DM[] = { {(char *)"appctx", __pyx_getprop_8petsc4py_5PETSc_2DM_appctx, __pyx_setprop_8petsc4py_5PETSc_2DM_appctx, (char *)0, 0}, {(char *)"ds", __pyx_getprop_8petsc4py_5PETSc_2DM_ds, __pyx_setprop_8petsc4py_5PETSc_2DM_ds, (char *)0, 0}, {0, 0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot PyPetscDM_Type_slots[] = { {Py_tp_doc, (void *)PyDoc_STR("An object describing a computational grid or mesh.\n\n ")}, {Py_tp_traverse, (void *)__pyx_tp_traverse_8petsc4py_5PETSc_Object}, {Py_tp_clear, (void *)__pyx_tp_clear_8petsc4py_5PETSc_Object}, {Py_tp_methods, (void *)__pyx_methods_8petsc4py_5PETSc_DM}, {Py_tp_getset, (void *)__pyx_getsets_8petsc4py_5PETSc_DM}, {Py_tp_new, (void *)__pyx_tp_new_8petsc4py_5PETSc_DM}, {0, 0}, }; static PyType_Spec PyPetscDM_Type_spec = { "petsc4py.PETSc.DM", sizeof(struct PyPetscDMObject), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, PyPetscDM_Type_slots, }; #else DL_EXPORT(PyTypeObject) PyPetscDM_Type = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.""DM", /*tp_name*/ sizeof(struct PyPetscDMObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Object, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ PyDoc_STR("An object describing a computational grid or mesh.\n\n "), /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc_Object, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc_Object, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_DM, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_8petsc4py_5PETSc_DM, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_DM, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static struct __pyx_vtabstruct_8petsc4py_5PETSc_DMPlexTransform __pyx_vtable_8petsc4py_5PETSc_DMPlexTransform; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_DMPlexTransform(PyTypeObject *t, PyObject *a, PyObject *k) { struct PyPetscDMPlexTransformObject *p; PyObject *o = __pyx_tp_new_8petsc4py_5PETSc_Object(t, a, k); if (unlikely(!o)) return 0; p = ((struct PyPetscDMPlexTransformObject *)o); p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Object*)__pyx_vtabptr_8petsc4py_5PETSc_DMPlexTransform; if (unlikely(__pyx_pw_8petsc4py_5PETSc_15DMPlexTransform_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_DMPlexTransform[] = { {"apply", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15DMPlexTransform_3apply, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15DMPlexTransform_2apply}, {"create", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15DMPlexTransform_5create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15DMPlexTransform_4create}, {"destroy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15DMPlexTransform_7destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15DMPlexTransform_6destroy}, {"getType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15DMPlexTransform_9getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15DMPlexTransform_8getType}, {"setUp", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15DMPlexTransform_11setUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15DMPlexTransform_10setUp}, {"setType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15DMPlexTransform_13setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15DMPlexTransform_12setType}, {"setDM", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15DMPlexTransform_15setDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15DMPlexTransform_14setDM}, {"setFromOptions", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15DMPlexTransform_17setFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15DMPlexTransform_16setFromOptions}, {"view", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15DMPlexTransform_19view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15DMPlexTransform_18view}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot PyPetscDMPlexTransform_Type_slots[] = { {Py_tp_traverse, (void *)__pyx_tp_traverse_8petsc4py_5PETSc_Object}, {Py_tp_clear, (void *)__pyx_tp_clear_8petsc4py_5PETSc_Object}, {Py_tp_methods, (void *)__pyx_methods_8petsc4py_5PETSc_DMPlexTransform}, {Py_tp_new, (void *)__pyx_tp_new_8petsc4py_5PETSc_DMPlexTransform}, {0, 0}, }; static PyType_Spec PyPetscDMPlexTransform_Type_spec = { "petsc4py.PETSc.DMPlexTransform", sizeof(struct PyPetscDMPlexTransformObject), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, PyPetscDMPlexTransform_Type_slots, }; #else DL_EXPORT(PyTypeObject) PyPetscDMPlexTransform_Type = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.""DMPlexTransform", /*tp_name*/ sizeof(struct PyPetscDMPlexTransformObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Object, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc_Object, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc_Object, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_DMPlexTransform, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_DMPlexTransform, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static struct __pyx_vtabstruct_8petsc4py_5PETSc_DS __pyx_vtable_8petsc4py_5PETSc_DS; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_DS(PyTypeObject *t, PyObject *a, PyObject *k) { struct PyPetscDSObject *p; PyObject *o = __pyx_tp_new_8petsc4py_5PETSc_Object(t, a, k); if (unlikely(!o)) return 0; p = ((struct PyPetscDSObject *)o); p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Object*)__pyx_vtabptr_8petsc4py_5PETSc_DS; if (unlikely(__pyx_pw_8petsc4py_5PETSc_2DS_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_DS[] = { {"view", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DS_3view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DS_2view}, {"destroy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DS_5destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DS_4destroy}, {"create", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DS_7create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DS_6create}, {"setType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DS_9setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DS_8setType}, {"getType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DS_11getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DS_10getType}, {"setFromOptions", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DS_13setFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DS_12setFromOptions}, {"setUp", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DS_15setUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DS_14setUp}, {"getSpatialDimension", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DS_17getSpatialDimension, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DS_16getSpatialDimension}, {"getCoordinateDimension", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DS_19getCoordinateDimension, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DS_18getCoordinateDimension}, {"getNumFields", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DS_21getNumFields, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DS_20getNumFields}, {"getFieldIndex", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DS_23getFieldIndex, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DS_22getFieldIndex}, {"getTotalDimensions", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DS_25getTotalDimensions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DS_24getTotalDimensions}, {"getTotalComponents", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DS_27getTotalComponents, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DS_26getTotalComponents}, {"getDimensions", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DS_29getDimensions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DS_28getDimensions}, {"getComponents", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DS_31getComponents, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DS_30getComponents}, {"setDiscretisation", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DS_33setDiscretisation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DS_32setDiscretisation}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot PyPetscDS_Type_slots[] = { {Py_tp_doc, (void *)PyDoc_STR("Discrete System object.")}, {Py_tp_traverse, (void *)__pyx_tp_traverse_8petsc4py_5PETSc_Object}, {Py_tp_clear, (void *)__pyx_tp_clear_8petsc4py_5PETSc_Object}, {Py_tp_methods, (void *)__pyx_methods_8petsc4py_5PETSc_DS}, {Py_tp_new, (void *)__pyx_tp_new_8petsc4py_5PETSc_DS}, {0, 0}, }; static PyType_Spec PyPetscDS_Type_spec = { "petsc4py.PETSc.DS", sizeof(struct PyPetscDSObject), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, PyPetscDS_Type_slots, }; #else DL_EXPORT(PyTypeObject) PyPetscDS_Type = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.""DS", /*tp_name*/ sizeof(struct PyPetscDSObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Object, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ PyDoc_STR("Discrete System object."), /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc_Object, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc_Object, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_DS, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_DS, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static struct __pyx_vtabstruct_8petsc4py_5PETSc_Partitioner __pyx_vtable_8petsc4py_5PETSc_Partitioner; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_Partitioner(PyTypeObject *t, PyObject *a, PyObject *k) { struct PyPetscPartitionerObject *p; PyObject *o = __pyx_tp_new_8petsc4py_5PETSc_Object(t, a, k); if (unlikely(!o)) return 0; p = ((struct PyPetscPartitionerObject *)o); p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Object*)__pyx_vtabptr_8petsc4py_5PETSc_Partitioner; if (unlikely(__pyx_pw_8petsc4py_5PETSc_11Partitioner_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_Partitioner[] = { {"view", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_11Partitioner_3view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11Partitioner_2view}, {"destroy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_11Partitioner_5destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11Partitioner_4destroy}, {"create", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_11Partitioner_7create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11Partitioner_6create}, {"setType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_11Partitioner_9setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11Partitioner_8setType}, {"getType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_11Partitioner_11getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11Partitioner_10getType}, {"setFromOptions", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_11Partitioner_13setFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11Partitioner_12setFromOptions}, {"setUp", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_11Partitioner_15setUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11Partitioner_14setUp}, {"reset", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_11Partitioner_17reset, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11Partitioner_16reset}, {"setShellPartition", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_11Partitioner_19setShellPartition, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11Partitioner_18setShellPartition}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot PyPetscPartitioner_Type_slots[] = { {Py_tp_doc, (void *)PyDoc_STR("A graph partitioner.")}, {Py_tp_traverse, (void *)__pyx_tp_traverse_8petsc4py_5PETSc_Object}, {Py_tp_clear, (void *)__pyx_tp_clear_8petsc4py_5PETSc_Object}, {Py_tp_methods, (void *)__pyx_methods_8petsc4py_5PETSc_Partitioner}, {Py_tp_new, (void *)__pyx_tp_new_8petsc4py_5PETSc_Partitioner}, {0, 0}, }; static PyType_Spec PyPetscPartitioner_Type_spec = { "petsc4py.PETSc.Partitioner", sizeof(struct PyPetscPartitionerObject), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, PyPetscPartitioner_Type_slots, }; #else DL_EXPORT(PyTypeObject) PyPetscPartitioner_Type = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.""Partitioner", /*tp_name*/ sizeof(struct PyPetscPartitionerObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Object, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ PyDoc_STR("A graph partitioner."), /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc_Object, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc_Object, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_Partitioner, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_Partitioner, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static struct __pyx_vtabstruct_8petsc4py_5PETSc_DMLabel __pyx_vtable_8petsc4py_5PETSc_DMLabel; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_DMLabel(PyTypeObject *t, PyObject *a, PyObject *k) { struct PyPetscDMLabelObject *p; PyObject *o = __pyx_tp_new_8petsc4py_5PETSc_Object(t, a, k); if (unlikely(!o)) return 0; p = ((struct PyPetscDMLabelObject *)o); p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Object*)__pyx_vtabptr_8petsc4py_5PETSc_DMLabel; if (unlikely(__pyx_pw_8petsc4py_5PETSc_7DMLabel_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_DMLabel[] = { {"destroy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_3destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_2destroy}, {"view", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_5view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_4view}, {"create", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_7create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_6create}, {"duplicate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_9duplicate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_8duplicate}, {"reset", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_11reset, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_10reset}, {"insertIS", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_13insertIS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_12insertIS}, {"setValue", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_15setValue, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_14setValue}, {"getValue", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_17getValue, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_16getValue}, {"getDefaultValue", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_19getDefaultValue, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_18getDefaultValue}, {"setDefaultValue", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_21setDefaultValue, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_20setDefaultValue}, {"clearValue", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_23clearValue, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_22clearValue}, {"addStratum", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_25addStratum, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_24addStratum}, {"addStrata", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_27addStrata, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_26addStrata}, {"addStrataIS", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_29addStrataIS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_28addStrataIS}, {"getNumValues", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_31getNumValues, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_30getNumValues}, {"getValueIS", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_33getValueIS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_32getValueIS}, {"stratumHasPoint", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_35stratumHasPoint, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_34stratumHasPoint}, {"hasStratum", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_37hasStratum, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_36hasStratum}, {"getStratumSize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_39getStratumSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_38getStratumSize}, {"getStratumIS", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_41getStratumIS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_40getStratumIS}, {"setStratumIS", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_43setStratumIS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_42setStratumIS}, {"clearStratum", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_45clearStratum, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_44clearStratum}, {"computeIndex", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_47computeIndex, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_46computeIndex}, {"createIndex", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_49createIndex, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_48createIndex}, {"destroyIndex", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_51destroyIndex, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_50destroyIndex}, {"hasValue", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_53hasValue, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_52hasValue}, {"hasPoint", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_55hasPoint, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_54hasPoint}, {"getBounds", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_57getBounds, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_56getBounds}, {"filter", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_59filter, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_58filter}, {"permute", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_61permute, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_60permute}, {"distribute", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_63distribute, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_62distribute}, {"gather", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_65gather, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_64gather}, {"convertToSection", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_67convertToSection, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_66convertToSection}, {"getNonEmptyStratumValuesIS", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_69getNonEmptyStratumValuesIS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_68getNonEmptyStratumValuesIS}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot PyPetscDMLabel_Type_slots[] = { {Py_tp_doc, (void *)PyDoc_STR("An object representing a subset of mesh entities from a `DM`.")}, {Py_tp_traverse, (void *)__pyx_tp_traverse_8petsc4py_5PETSc_Object}, {Py_tp_clear, (void *)__pyx_tp_clear_8petsc4py_5PETSc_Object}, {Py_tp_methods, (void *)__pyx_methods_8petsc4py_5PETSc_DMLabel}, {Py_tp_new, (void *)__pyx_tp_new_8petsc4py_5PETSc_DMLabel}, {0, 0}, }; static PyType_Spec PyPetscDMLabel_Type_spec = { "petsc4py.PETSc.DMLabel", sizeof(struct PyPetscDMLabelObject), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, PyPetscDMLabel_Type_slots, }; #else DL_EXPORT(PyTypeObject) PyPetscDMLabel_Type = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.""DMLabel", /*tp_name*/ sizeof(struct PyPetscDMLabelObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Object, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ PyDoc_STR("An object representing a subset of mesh entities from a `DM`."), /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc_Object, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc_Object, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_DMLabel, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_DMLabel, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static struct __pyx_vtabstruct_8petsc4py_5PETSc__IS_buffer __pyx_vtable_8petsc4py_5PETSc__IS_buffer; static PyObject *__pyx_tp_new_8petsc4py_5PETSc__IS_buffer(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *p; PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; #endif p = ((struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *)o); p->__pyx_vtab = __pyx_vtabptr_8petsc4py_5PETSc__IS_buffer; if (unlikely(__pyx_pw_8petsc4py_5PETSc_10_IS_buffer_1__cinit__(o, a, k) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_8petsc4py_5PETSc__IS_buffer(PyObject *o) { #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_8petsc4py_5PETSc__IS_buffer) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); __pyx_pw_8petsc4py_5PETSc_10_IS_buffer_3__dealloc__(o); __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); PyErr_Restore(etype, eval, etb); } #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static PyObject *__pyx_getprop_8petsc4py_5PETSc_10_IS_buffer___array_interface__(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_10_IS_buffer_19__array_interface___1__get__(o); } static PyMethodDef __pyx_methods_8petsc4py_5PETSc__IS_buffer[] = { {"__enter__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_10_IS_buffer_9__enter__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_10_IS_buffer_8__enter__}, {"__exit__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_10_IS_buffer_11__exit__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_10_IS_buffer_10__exit__}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_8petsc4py_5PETSc__IS_buffer[] = { {(char *)"__array_interface__", __pyx_getprop_8petsc4py_5PETSc_10_IS_buffer___array_interface__, 0, (char *)0, 0}, {0, 0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS #if !CYTHON_COMPILING_IN_LIMITED_API static PyBufferProcs __pyx_tp_as_buffer__IS_buffer = { #if PY_MAJOR_VERSION < 3 __pyx_pw_8petsc4py_5PETSc_10_IS_buffer_15__getreadbuffer__, /*bf_getreadbuffer*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getwritebuffer*/ #endif #if PY_MAJOR_VERSION < 3 __pyx_pw_8petsc4py_5PETSc_10_IS_buffer_13__getsegcount__, /*bf_getsegcount*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getcharbuffer*/ #endif __pyx_pw_8petsc4py_5PETSc_10_IS_buffer_5__getbuffer__, /*bf_getbuffer*/ __pyx_pw_8petsc4py_5PETSc_10_IS_buffer_7__releasebuffer__, /*bf_releasebuffer*/ }; #endif static PyType_Slot __pyx_type_8petsc4py_5PETSc__IS_buffer_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8petsc4py_5PETSc__IS_buffer}, #if PY_MAJOR_VERSION < 3 {Py_bf_getreadbuffer, (void *)__pyx_pw_8petsc4py_5PETSc_10_IS_buffer_15__getreadbuffer__}, #endif #if PY_MAJOR_VERSION < 3 {Py_bf_getsegcount, (void *)__pyx_pw_8petsc4py_5PETSc_10_IS_buffer_13__getsegcount__}, #endif #if defined(Py_bf_getbuffer) {Py_bf_getbuffer, (void *)__pyx_pw_8petsc4py_5PETSc_10_IS_buffer_5__getbuffer__}, #endif #if defined(Py_bf_releasebuffer) {Py_bf_releasebuffer, (void *)__pyx_pw_8petsc4py_5PETSc_10_IS_buffer_7__releasebuffer__}, #endif {Py_tp_methods, (void *)__pyx_methods_8petsc4py_5PETSc__IS_buffer}, {Py_tp_getset, (void *)__pyx_getsets_8petsc4py_5PETSc__IS_buffer}, {Py_tp_new, (void *)__pyx_tp_new_8petsc4py_5PETSc__IS_buffer}, {0, 0}, }; static PyType_Spec __pyx_type_8petsc4py_5PETSc__IS_buffer_spec = { "petsc4py.PETSc._IS_buffer", sizeof(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, __pyx_type_8petsc4py_5PETSc__IS_buffer_slots, }; #else static PyBufferProcs __pyx_tp_as_buffer__IS_buffer = { #if PY_MAJOR_VERSION < 3 __pyx_pw_8petsc4py_5PETSc_10_IS_buffer_15__getreadbuffer__, /*bf_getreadbuffer*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getwritebuffer*/ #endif #if PY_MAJOR_VERSION < 3 __pyx_pw_8petsc4py_5PETSc_10_IS_buffer_13__getsegcount__, /*bf_getsegcount*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getcharbuffer*/ #endif __pyx_pw_8petsc4py_5PETSc_10_IS_buffer_5__getbuffer__, /*bf_getbuffer*/ __pyx_pw_8petsc4py_5PETSc_10_IS_buffer_7__releasebuffer__, /*bf_releasebuffer*/ }; static PyTypeObject __pyx_type_8petsc4py_5PETSc__IS_buffer = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.""_IS_buffer", /*tp_name*/ sizeof(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc__IS_buffer, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer__IS_buffer, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ 0, /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc__IS_buffer, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_8petsc4py_5PETSc__IS_buffer, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc__IS_buffer, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static struct __pyx_vtabstruct_8petsc4py_5PETSc__Vec_buffer __pyx_vtable_8petsc4py_5PETSc__Vec_buffer; static PyObject *__pyx_tp_new_8petsc4py_5PETSc__Vec_buffer(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *p; PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; #endif p = ((struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *)o); p->__pyx_vtab = __pyx_vtabptr_8petsc4py_5PETSc__Vec_buffer; if (unlikely(__pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_1__cinit__(o, a, k) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_8petsc4py_5PETSc__Vec_buffer(PyObject *o) { #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_8petsc4py_5PETSc__Vec_buffer) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); __pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_3__dealloc__(o); __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); PyErr_Restore(etype, eval, etb); } #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static PyObject *__pyx_getprop_8petsc4py_5PETSc_11_Vec_buffer___array_interface__(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_19__array_interface___1__get__(o); } static PyMethodDef __pyx_methods_8petsc4py_5PETSc__Vec_buffer[] = { {"__enter__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_9__enter__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11_Vec_buffer_8__enter__}, {"__exit__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_11__exit__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11_Vec_buffer_10__exit__}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_8petsc4py_5PETSc__Vec_buffer[] = { {(char *)"__array_interface__", __pyx_getprop_8petsc4py_5PETSc_11_Vec_buffer___array_interface__, 0, (char *)0, 0}, {0, 0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS #if !CYTHON_COMPILING_IN_LIMITED_API static PyBufferProcs __pyx_tp_as_buffer__Vec_buffer = { #if PY_MAJOR_VERSION < 3 __pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_15__getreadbuffer__, /*bf_getreadbuffer*/ #endif #if PY_MAJOR_VERSION < 3 __pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_17__getwritebuffer__, /*bf_getwritebuffer*/ #endif #if PY_MAJOR_VERSION < 3 __pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_13__getsegcount__, /*bf_getsegcount*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getcharbuffer*/ #endif __pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_5__getbuffer__, /*bf_getbuffer*/ __pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_7__releasebuffer__, /*bf_releasebuffer*/ }; #endif static PyType_Slot __pyx_type_8petsc4py_5PETSc__Vec_buffer_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8petsc4py_5PETSc__Vec_buffer}, #if PY_MAJOR_VERSION < 3 {Py_bf_getreadbuffer, (void *)__pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_15__getreadbuffer__}, #endif #if PY_MAJOR_VERSION < 3 {Py_bf_getwritebuffer, (void *)__pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_17__getwritebuffer__}, #endif #if PY_MAJOR_VERSION < 3 {Py_bf_getsegcount, (void *)__pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_13__getsegcount__}, #endif #if defined(Py_bf_getbuffer) {Py_bf_getbuffer, (void *)__pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_5__getbuffer__}, #endif #if defined(Py_bf_releasebuffer) {Py_bf_releasebuffer, (void *)__pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_7__releasebuffer__}, #endif {Py_tp_methods, (void *)__pyx_methods_8petsc4py_5PETSc__Vec_buffer}, {Py_tp_getset, (void *)__pyx_getsets_8petsc4py_5PETSc__Vec_buffer}, {Py_tp_new, (void *)__pyx_tp_new_8petsc4py_5PETSc__Vec_buffer}, {0, 0}, }; static PyType_Spec __pyx_type_8petsc4py_5PETSc__Vec_buffer_spec = { "petsc4py.PETSc._Vec_buffer", sizeof(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, __pyx_type_8petsc4py_5PETSc__Vec_buffer_slots, }; #else static PyBufferProcs __pyx_tp_as_buffer__Vec_buffer = { #if PY_MAJOR_VERSION < 3 __pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_15__getreadbuffer__, /*bf_getreadbuffer*/ #endif #if PY_MAJOR_VERSION < 3 __pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_17__getwritebuffer__, /*bf_getwritebuffer*/ #endif #if PY_MAJOR_VERSION < 3 __pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_13__getsegcount__, /*bf_getsegcount*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getcharbuffer*/ #endif __pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_5__getbuffer__, /*bf_getbuffer*/ __pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_7__releasebuffer__, /*bf_releasebuffer*/ }; static PyTypeObject __pyx_type_8petsc4py_5PETSc__Vec_buffer = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.""_Vec_buffer", /*tp_name*/ sizeof(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc__Vec_buffer, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer__Vec_buffer, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ 0, /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc__Vec_buffer, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_8petsc4py_5PETSc__Vec_buffer, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc__Vec_buffer, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static PyObject *__pyx_tp_new_8petsc4py_5PETSc__Vec_LocalForm(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_8petsc4py_5PETSc__Vec_LocalForm *p; PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; #endif p = ((struct __pyx_obj_8petsc4py_5PETSc__Vec_LocalForm *)o); p->gvec = ((struct PyPetscVecObject *)Py_None); Py_INCREF(Py_None); p->lvec = ((struct PyPetscVecObject *)Py_None); Py_INCREF(Py_None); return o; } static void __pyx_tp_dealloc_8petsc4py_5PETSc__Vec_LocalForm(PyObject *o) { struct __pyx_obj_8petsc4py_5PETSc__Vec_LocalForm *p = (struct __pyx_obj_8petsc4py_5PETSc__Vec_LocalForm *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_8petsc4py_5PETSc__Vec_LocalForm) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->gvec); Py_CLEAR(p->lvec); #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static int __pyx_tp_traverse_8petsc4py_5PETSc__Vec_LocalForm(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_8petsc4py_5PETSc__Vec_LocalForm *p = (struct __pyx_obj_8petsc4py_5PETSc__Vec_LocalForm *)o; if (p->gvec) { e = (*v)(((PyObject *)p->gvec), a); if (e) return e; } if (p->lvec) { e = (*v)(((PyObject *)p->lvec), a); if (e) return e; } return 0; } static int __pyx_tp_clear_8petsc4py_5PETSc__Vec_LocalForm(PyObject *o) { PyObject* tmp; struct __pyx_obj_8petsc4py_5PETSc__Vec_LocalForm *p = (struct __pyx_obj_8petsc4py_5PETSc__Vec_LocalForm *)o; tmp = ((PyObject*)p->gvec); p->gvec = ((struct PyPetscVecObject *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->lvec); p->lvec = ((struct PyPetscVecObject *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyMethodDef __pyx_methods_8petsc4py_5PETSc__Vec_LocalForm[] = { {"__enter__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_14_Vec_LocalForm_3__enter__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_14_Vec_LocalForm_2__enter__}, {"__exit__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_14_Vec_LocalForm_5__exit__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_14_Vec_LocalForm_4__exit__}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_8petsc4py_5PETSc__Vec_LocalForm_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8petsc4py_5PETSc__Vec_LocalForm}, {Py_tp_doc, (void *)PyDoc_STR("_Vec_LocalForm(gvec: Vec)\nContext manager for `Vec` local form\nSource code at petsc4py/PETSc/petscvec.pxi:626")}, {Py_tp_traverse, (void *)__pyx_tp_traverse_8petsc4py_5PETSc__Vec_LocalForm}, {Py_tp_clear, (void *)__pyx_tp_clear_8petsc4py_5PETSc__Vec_LocalForm}, {Py_tp_methods, (void *)__pyx_methods_8petsc4py_5PETSc__Vec_LocalForm}, {Py_tp_init, (void *)__pyx_pw_8petsc4py_5PETSc_14_Vec_LocalForm_1__init__}, {Py_tp_new, (void *)__pyx_tp_new_8petsc4py_5PETSc__Vec_LocalForm}, {0, 0}, }; static PyType_Spec __pyx_type_8petsc4py_5PETSc__Vec_LocalForm_spec = { "petsc4py.PETSc._Vec_LocalForm", sizeof(struct __pyx_obj_8petsc4py_5PETSc__Vec_LocalForm), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, __pyx_type_8petsc4py_5PETSc__Vec_LocalForm_slots, }; #else static PyTypeObject __pyx_type_8petsc4py_5PETSc__Vec_LocalForm = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.""_Vec_LocalForm", /*tp_name*/ sizeof(struct __pyx_obj_8petsc4py_5PETSc__Vec_LocalForm), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc__Vec_LocalForm, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ PyDoc_STR("_Vec_LocalForm(gvec: Vec)\nContext manager for `Vec` local form\nSource code at petsc4py/PETSc/petscvec.pxi:626"), /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc__Vec_LocalForm, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc__Vec_LocalForm, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc__Vec_LocalForm, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif __pyx_pw_8petsc4py_5PETSc_14_Vec_LocalForm_1__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc__Vec_LocalForm, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static struct __pyx_vtabstruct_8petsc4py_5PETSc__DMDA_Vec_array __pyx_vtable_8petsc4py_5PETSc__DMDA_Vec_array; static PyObject *__pyx_tp_new_8petsc4py_5PETSc__DMDA_Vec_array(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *p; PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; #endif p = ((struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *)o); p->__pyx_vtab = __pyx_vtabptr_8petsc4py_5PETSc__DMDA_Vec_array; p->vecbuf = ((struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *)Py_None); Py_INCREF(Py_None); p->starts = ((PyObject*)Py_None); Py_INCREF(Py_None); p->sizes = ((PyObject*)Py_None); Py_INCREF(Py_None); p->shape = ((PyObject*)Py_None); Py_INCREF(Py_None); p->strides = ((PyObject*)Py_None); Py_INCREF(Py_None); p->array = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); if (unlikely(__pyx_pw_8petsc4py_5PETSc_15_DMDA_Vec_array_1__cinit__(o, a, k) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_8petsc4py_5PETSc__DMDA_Vec_array(PyObject *o) { struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *p = (struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_8petsc4py_5PETSc__DMDA_Vec_array) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->vecbuf); Py_CLEAR(p->starts); Py_CLEAR(p->sizes); Py_CLEAR(p->shape); Py_CLEAR(p->strides); Py_CLEAR(p->array); #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static int __pyx_tp_traverse_8petsc4py_5PETSc__DMDA_Vec_array(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *p = (struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *)o; if (p->vecbuf) { e = (*v)(((PyObject *)p->vecbuf), a); if (e) return e; } if (p->starts) { e = (*v)(p->starts, a); if (e) return e; } if (p->sizes) { e = (*v)(p->sizes, a); if (e) return e; } if (p->shape) { e = (*v)(p->shape, a); if (e) return e; } if (p->strides) { e = (*v)(p->strides, a); if (e) return e; } if (p->array) { e = (*v)(((PyObject *)p->array), a); if (e) return e; } return 0; } static int __pyx_tp_clear_8petsc4py_5PETSc__DMDA_Vec_array(PyObject *o) { PyObject* tmp; struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *p = (struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *)o; tmp = ((PyObject*)p->vecbuf); p->vecbuf = ((struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->starts); p->starts = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->sizes); p->sizes = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->shape); p->shape = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->strides); p->strides = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->array); p->array = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_sq_item_8petsc4py_5PETSc__DMDA_Vec_array(PyObject *o, Py_ssize_t i) { PyObject *r; PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); Py_DECREF(x); return r; } static int __pyx_mp_ass_subscript_8petsc4py_5PETSc__DMDA_Vec_array(PyObject *o, PyObject *i, PyObject *v) { if (v) { return __pyx_pw_8petsc4py_5PETSc_15_DMDA_Vec_array_5__setitem__(o, i, v); } else { __Pyx_TypeName o_type_name; o_type_name = __Pyx_PyType_GetName(Py_TYPE(o)); PyErr_Format(PyExc_NotImplementedError, "Subscript deletion not supported by " __Pyx_FMT_TYPENAME, o_type_name); __Pyx_DECREF_TypeName(o_type_name); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_15_DMDA_Vec_array_starts(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_15_DMDA_Vec_array_6starts_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_15_DMDA_Vec_array_sizes(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_15_DMDA_Vec_array_5sizes_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_15_DMDA_Vec_array_shape(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_15_DMDA_Vec_array_5shape_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_15_DMDA_Vec_array_strides(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_15_DMDA_Vec_array_7strides_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_15_DMDA_Vec_array_array(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_15_DMDA_Vec_array_5array_1__get__(o); } static PyMethodDef __pyx_methods_8petsc4py_5PETSc__DMDA_Vec_array[] = { {"__enter__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15_DMDA_Vec_array_7__enter__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15_DMDA_Vec_array_6__enter__}, {"__exit__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_15_DMDA_Vec_array_9__exit__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15_DMDA_Vec_array_8__exit__}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_8petsc4py_5PETSc__DMDA_Vec_array[] = { {(char *)"starts", __pyx_getprop_8petsc4py_5PETSc_15_DMDA_Vec_array_starts, 0, (char *)0, 0}, {(char *)"sizes", __pyx_getprop_8petsc4py_5PETSc_15_DMDA_Vec_array_sizes, 0, (char *)0, 0}, {(char *)"shape", __pyx_getprop_8petsc4py_5PETSc_15_DMDA_Vec_array_shape, 0, (char *)0, 0}, {(char *)"strides", __pyx_getprop_8petsc4py_5PETSc_15_DMDA_Vec_array_strides, 0, (char *)0, 0}, {(char *)"array", __pyx_getprop_8petsc4py_5PETSc_15_DMDA_Vec_array_array, 0, (char *)0, 0}, {0, 0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_8petsc4py_5PETSc__DMDA_Vec_array_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8petsc4py_5PETSc__DMDA_Vec_array}, {Py_sq_item, (void *)__pyx_sq_item_8petsc4py_5PETSc__DMDA_Vec_array}, {Py_mp_subscript, (void *)__pyx_pw_8petsc4py_5PETSc_15_DMDA_Vec_array_3__getitem__}, {Py_mp_ass_subscript, (void *)__pyx_mp_ass_subscript_8petsc4py_5PETSc__DMDA_Vec_array}, {Py_tp_traverse, (void *)__pyx_tp_traverse_8petsc4py_5PETSc__DMDA_Vec_array}, {Py_tp_clear, (void *)__pyx_tp_clear_8petsc4py_5PETSc__DMDA_Vec_array}, {Py_tp_methods, (void *)__pyx_methods_8petsc4py_5PETSc__DMDA_Vec_array}, {Py_tp_getset, (void *)__pyx_getsets_8petsc4py_5PETSc__DMDA_Vec_array}, {Py_tp_new, (void *)__pyx_tp_new_8petsc4py_5PETSc__DMDA_Vec_array}, {0, 0}, }; static PyType_Spec __pyx_type_8petsc4py_5PETSc__DMDA_Vec_array_spec = { "petsc4py.PETSc._DMDA_Vec_array", sizeof(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, __pyx_type_8petsc4py_5PETSc__DMDA_Vec_array_slots, }; #else static PySequenceMethods __pyx_tp_as_sequence__DMDA_Vec_array = { 0, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ __pyx_sq_item_8petsc4py_5PETSc__DMDA_Vec_array, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ 0, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; static PyMappingMethods __pyx_tp_as_mapping__DMDA_Vec_array = { 0, /*mp_length*/ __pyx_pw_8petsc4py_5PETSc_15_DMDA_Vec_array_3__getitem__, /*mp_subscript*/ __pyx_mp_ass_subscript_8petsc4py_5PETSc__DMDA_Vec_array, /*mp_ass_subscript*/ }; static PyTypeObject __pyx_type_8petsc4py_5PETSc__DMDA_Vec_array = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.""_DMDA_Vec_array", /*tp_name*/ sizeof(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc__DMDA_Vec_array, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ &__pyx_tp_as_sequence__DMDA_Vec_array, /*tp_as_sequence*/ &__pyx_tp_as_mapping__DMDA_Vec_array, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc__DMDA_Vec_array, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc__DMDA_Vec_array, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc__DMDA_Vec_array, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_8petsc4py_5PETSc__DMDA_Vec_array, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc__DMDA_Vec_array, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static PyObject *__pyx_tp_new_8petsc4py_5PETSc__DMComposite_access(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_8petsc4py_5PETSc__DMComposite_access *p; PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; #endif p = ((struct __pyx_obj_8petsc4py_5PETSc__DMComposite_access *)o); p->locs_mem = Py_None; Py_INCREF(Py_None); p->vecs_mem = Py_None; Py_INCREF(Py_None); p->access = Py_None; Py_INCREF(Py_None); if (unlikely(__pyx_pw_8petsc4py_5PETSc_19_DMComposite_access_1__cinit__(o, a, k) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_8petsc4py_5PETSc__DMComposite_access(PyObject *o) { struct __pyx_obj_8petsc4py_5PETSc__DMComposite_access *p = (struct __pyx_obj_8petsc4py_5PETSc__DMComposite_access *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_8petsc4py_5PETSc__DMComposite_access) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); __pyx_pw_8petsc4py_5PETSc_19_DMComposite_access_3__dealloc__(o); __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); PyErr_Restore(etype, eval, etb); } Py_CLEAR(p->locs_mem); Py_CLEAR(p->vecs_mem); Py_CLEAR(p->access); #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static int __pyx_tp_traverse_8petsc4py_5PETSc__DMComposite_access(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_8petsc4py_5PETSc__DMComposite_access *p = (struct __pyx_obj_8petsc4py_5PETSc__DMComposite_access *)o; if (p->locs_mem) { e = (*v)(p->locs_mem, a); if (e) return e; } if (p->vecs_mem) { e = (*v)(p->vecs_mem, a); if (e) return e; } if (p->access) { e = (*v)(p->access, a); if (e) return e; } return 0; } static int __pyx_tp_clear_8petsc4py_5PETSc__DMComposite_access(PyObject *o) { PyObject* tmp; struct __pyx_obj_8petsc4py_5PETSc__DMComposite_access *p = (struct __pyx_obj_8petsc4py_5PETSc__DMComposite_access *)o; tmp = ((PyObject*)p->locs_mem); p->locs_mem = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->vecs_mem); p->vecs_mem = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->access); p->access = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyMethodDef __pyx_methods_8petsc4py_5PETSc__DMComposite_access[] = { {"__enter__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_19_DMComposite_access_5__enter__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_19_DMComposite_access_4__enter__}, {"__exit__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_19_DMComposite_access_7__exit__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_19_DMComposite_access_6__exit__}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_8petsc4py_5PETSc__DMComposite_access_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8petsc4py_5PETSc__DMComposite_access}, {Py_tp_traverse, (void *)__pyx_tp_traverse_8petsc4py_5PETSc__DMComposite_access}, {Py_tp_clear, (void *)__pyx_tp_clear_8petsc4py_5PETSc__DMComposite_access}, {Py_tp_methods, (void *)__pyx_methods_8petsc4py_5PETSc__DMComposite_access}, {Py_tp_new, (void *)__pyx_tp_new_8petsc4py_5PETSc__DMComposite_access}, {0, 0}, }; static PyType_Spec __pyx_type_8petsc4py_5PETSc__DMComposite_access_spec = { "petsc4py.PETSc._DMComposite_access", sizeof(struct __pyx_obj_8petsc4py_5PETSc__DMComposite_access), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, __pyx_type_8petsc4py_5PETSc__DMComposite_access_slots, }; #else static PyTypeObject __pyx_type_8petsc4py_5PETSc__DMComposite_access = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.""_DMComposite_access", /*tp_name*/ sizeof(struct __pyx_obj_8petsc4py_5PETSc__DMComposite_access), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc__DMComposite_access, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc__DMComposite_access, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc__DMComposite_access, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc__DMComposite_access, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc__DMComposite_access, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static PyObject *__pyx_tp_new_8petsc4py_5PETSc_Options(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_8petsc4py_5PETSc_Options *p; PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; #endif p = ((struct __pyx_obj_8petsc4py_5PETSc_Options *)o); p->_prefix = Py_None; Py_INCREF(Py_None); return o; } static void __pyx_tp_dealloc_8petsc4py_5PETSc_Options(PyObject *o) { struct __pyx_obj_8petsc4py_5PETSc_Options *p = (struct __pyx_obj_8petsc4py_5PETSc_Options *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_8petsc4py_5PETSc_Options) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); __pyx_pw_8petsc4py_5PETSc_7Options_3__dealloc__(o); __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); PyErr_Restore(etype, eval, etb); } Py_CLEAR(p->_prefix); #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static int __pyx_tp_traverse_8petsc4py_5PETSc_Options(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_8petsc4py_5PETSc_Options *p = (struct __pyx_obj_8petsc4py_5PETSc_Options *)o; if (p->_prefix) { e = (*v)(p->_prefix, a); if (e) return e; } return 0; } static int __pyx_tp_clear_8petsc4py_5PETSc_Options(PyObject *o) { PyObject* tmp; struct __pyx_obj_8petsc4py_5PETSc_Options *p = (struct __pyx_obj_8petsc4py_5PETSc_Options *)o; tmp = ((PyObject*)p->_prefix); p->_prefix = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_sq_item_8petsc4py_5PETSc_Options(PyObject *o, Py_ssize_t i) { PyObject *r; PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); Py_DECREF(x); return r; } static int __pyx_mp_ass_subscript_8petsc4py_5PETSc_Options(PyObject *o, PyObject *i, PyObject *v) { if (v) { return __pyx_pw_8petsc4py_5PETSc_7Options_9__setitem__(o, i, v); } else { return __pyx_pw_8petsc4py_5PETSc_7Options_11__delitem__(o, i); } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_7Options_prefix(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_7Options_6prefix_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_7Options_prefix(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_7Options_6prefix_3__set__(o, v); } else { return __pyx_pw_8petsc4py_5PETSc_7Options_6prefix_5__del__(o); } } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_Options[] = { {"create", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_13create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_12create}, {"destroy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_15destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_14destroy}, {"clear", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_17clear, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_16clear}, {"view", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_19view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_18view}, {"prefixPush", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_21prefixPush, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_20prefixPush}, {"prefixPop", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_23prefixPop, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_22prefixPop}, {"hasName", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_25hasName, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_24hasName}, {"setValue", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_27setValue, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_26setValue}, {"delValue", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_29delValue, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_28delValue}, {"getBool", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_31getBool, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_30getBool}, {"getInt", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_33getInt, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_32getInt}, {"getReal", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_35getReal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_34getReal}, {"getScalar", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_37getScalar, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_36getScalar}, {"getString", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_39getString, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_38getString}, {"insertString", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_41insertString, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_40insertString}, {"getAll", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_43getAll, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_42getAll}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_8petsc4py_5PETSc_Options[] = { {(char *)"prefix", __pyx_getprop_8petsc4py_5PETSc_7Options_prefix, __pyx_setprop_8petsc4py_5PETSc_7Options_prefix, (char *)0, 0}, {0, 0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_8petsc4py_5PETSc_Options_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8petsc4py_5PETSc_Options}, {Py_sq_item, (void *)__pyx_sq_item_8petsc4py_5PETSc_Options}, {Py_sq_contains, (void *)__pyx_pw_8petsc4py_5PETSc_7Options_5__contains__}, {Py_mp_subscript, (void *)__pyx_pw_8petsc4py_5PETSc_7Options_7__getitem__}, {Py_mp_ass_subscript, (void *)__pyx_mp_ass_subscript_8petsc4py_5PETSc_Options}, {Py_tp_doc, (void *)PyDoc_STR("Options(prefix=None)\nSource code at petsc4py/PETSc/Options.pyx:8")}, {Py_tp_traverse, (void *)__pyx_tp_traverse_8petsc4py_5PETSc_Options}, {Py_tp_clear, (void *)__pyx_tp_clear_8petsc4py_5PETSc_Options}, {Py_tp_methods, (void *)__pyx_methods_8petsc4py_5PETSc_Options}, {Py_tp_getset, (void *)__pyx_getsets_8petsc4py_5PETSc_Options}, {Py_tp_init, (void *)__pyx_pw_8petsc4py_5PETSc_7Options_1__init__}, {Py_tp_new, (void *)__pyx_tp_new_8petsc4py_5PETSc_Options}, {0, 0}, }; static PyType_Spec __pyx_type_8petsc4py_5PETSc_Options_spec = { "petsc4py.PETSc.Options", sizeof(struct __pyx_obj_8petsc4py_5PETSc_Options), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, __pyx_type_8petsc4py_5PETSc_Options_slots, }; #else static PySequenceMethods __pyx_tp_as_sequence_Options = { 0, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ __pyx_sq_item_8petsc4py_5PETSc_Options, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ __pyx_pw_8petsc4py_5PETSc_7Options_5__contains__, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; static PyMappingMethods __pyx_tp_as_mapping_Options = { 0, /*mp_length*/ __pyx_pw_8petsc4py_5PETSc_7Options_7__getitem__, /*mp_subscript*/ __pyx_mp_ass_subscript_8petsc4py_5PETSc_Options, /*mp_ass_subscript*/ }; static PyTypeObject __pyx_type_8petsc4py_5PETSc_Options = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.""Options", /*tp_name*/ sizeof(struct __pyx_obj_8petsc4py_5PETSc_Options), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Options, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ &__pyx_tp_as_sequence_Options, /*tp_as_sequence*/ &__pyx_tp_as_mapping_Options, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ PyDoc_STR("Options(prefix=None)\nSource code at petsc4py/PETSc/Options.pyx:8"), /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc_Options, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc_Options, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_Options, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_8petsc4py_5PETSc_Options, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif __pyx_pw_8petsc4py_5PETSc_7Options_1__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_Options, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static PyObject *__pyx_tp_new_8petsc4py_5PETSc_Sys(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; #endif return o; } static void __pyx_tp_dealloc_8petsc4py_5PETSc_Sys(PyObject *o) { #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_8petsc4py_5PETSc_Sys) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_Sys[] = { {"getVersion", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Sys_1getVersion, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Sys_getVersion}, {"getVersionInfo", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Sys_3getVersionInfo, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Sys_2getVersionInfo}, {"isInitialized", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Sys_5isInitialized, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Sys_4isInitialized}, {"isFinalized", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Sys_7isFinalized, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Sys_6isFinalized}, {"getDefaultComm", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Sys_9getDefaultComm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Sys_8getDefaultComm}, {"setDefaultComm", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Sys_11setDefaultComm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Sys_10setDefaultComm}, {"Print", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Sys_13Print, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Sys_12Print}, {"syncPrint", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Sys_15syncPrint, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Sys_14syncPrint}, {"syncFlush", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Sys_17syncFlush, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Sys_16syncFlush}, {"splitOwnership", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Sys_19splitOwnership, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Sys_18splitOwnership}, {"sleep", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Sys_21sleep, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Sys_20sleep}, {"pushErrorHandler", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Sys_23pushErrorHandler, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Sys_22pushErrorHandler}, {"popErrorHandler", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Sys_25popErrorHandler, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Sys_24popErrorHandler}, {"popSignalHandler", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Sys_27popSignalHandler, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Sys_26popSignalHandler}, {"infoAllow", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Sys_29infoAllow, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Sys_28infoAllow}, {"registerCitation", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Sys_31registerCitation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Sys_30registerCitation}, {"hasExternalPackage", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Sys_33hasExternalPackage, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Sys_32hasExternalPackage}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_8petsc4py_5PETSc_Sys_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8petsc4py_5PETSc_Sys}, {Py_tp_doc, (void *)PyDoc_STR("System utilities.")}, {Py_tp_methods, (void *)__pyx_methods_8petsc4py_5PETSc_Sys}, {Py_tp_new, (void *)__pyx_tp_new_8petsc4py_5PETSc_Sys}, {0, 0}, }; static PyType_Spec __pyx_type_8petsc4py_5PETSc_Sys_spec = { "petsc4py.PETSc.Sys", sizeof(struct __pyx_obj_8petsc4py_5PETSc_Sys), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, __pyx_type_8petsc4py_5PETSc_Sys_slots, }; #else static PyTypeObject __pyx_type_8petsc4py_5PETSc_Sys = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.""Sys", /*tp_name*/ sizeof(struct __pyx_obj_8petsc4py_5PETSc_Sys), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Sys, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ PyDoc_STR("System utilities."), /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_Sys, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_Sys, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static PyObject *__pyx_tp_new_8petsc4py_5PETSc_Log(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; #endif return o; } static void __pyx_tp_dealloc_8petsc4py_5PETSc_Log(PyObject *o) { #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_8petsc4py_5PETSc_Log) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_Log[] = { {"Stage", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Log_1Stage, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Log_Stage}, {"Class", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Log_3Class, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Log_2Class}, {"Event", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Log_5Event, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Log_4Event}, {"begin", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Log_7begin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Log_6begin}, {"view", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Log_9view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Log_8view}, {"logFlops", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Log_11logFlops, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Log_10logFlops}, {"addFlops", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Log_13addFlops, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Log_12addFlops}, {"getFlops", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Log_15getFlops, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Log_14getFlops}, {"getTime", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Log_17getTime, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Log_16getTime}, {"getCPUTime", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Log_19getCPUTime, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Log_18getCPUTime}, {"EventDecorator", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Log_21EventDecorator, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Log_20EventDecorator}, {"isActive", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Log_23isActive, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Log_22isActive}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_8petsc4py_5PETSc_Log_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8petsc4py_5PETSc_Log}, {Py_tp_doc, (void *)PyDoc_STR("Logging support.")}, {Py_tp_methods, (void *)__pyx_methods_8petsc4py_5PETSc_Log}, {Py_tp_new, (void *)__pyx_tp_new_8petsc4py_5PETSc_Log}, {0, 0}, }; static PyType_Spec __pyx_type_8petsc4py_5PETSc_Log_spec = { "petsc4py.PETSc.Log", sizeof(struct __pyx_obj_8petsc4py_5PETSc_Log), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, __pyx_type_8petsc4py_5PETSc_Log_slots, }; #else static PyTypeObject __pyx_type_8petsc4py_5PETSc_Log = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.""Log", /*tp_name*/ sizeof(struct __pyx_obj_8petsc4py_5PETSc_Log), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Log, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ PyDoc_STR("Logging support."), /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_Log, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_Log, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static PyObject *__pyx_tp_new_8petsc4py_5PETSc_LogStage(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; #endif if (unlikely(__pyx_pw_8petsc4py_5PETSc_8LogStage_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_8petsc4py_5PETSc_LogStage(PyObject *o) { #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_8petsc4py_5PETSc_LogStage) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static PyObject *__pyx_getprop_8petsc4py_5PETSc_8LogStage_name(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_8LogStage_4name_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_8LogStage_name(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_8LogStage_4name_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_8LogStage_active(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_8LogStage_6active_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_8LogStage_active(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_8LogStage_6active_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_8LogStage_visible(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_8LogStage_7visible_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_8LogStage_visible(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_8LogStage_7visible_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_8LogStage_id(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_8LogStage_2id_1__get__(o); } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_LogStage[] = { {"__enter__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogStage_5__enter__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogStage_4__enter__}, {"__exit__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogStage_7__exit__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogStage_6__exit__}, {"push", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogStage_9push, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogStage_8push}, {"pop", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogStage_11pop, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogStage_10pop}, {"getName", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogStage_13getName, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogStage_12getName}, {"activate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogStage_15activate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogStage_14activate}, {"deactivate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogStage_17deactivate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogStage_16deactivate}, {"getActive", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogStage_19getActive, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogStage_18getActive}, {"setActive", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogStage_21setActive, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogStage_20setActive}, {"getVisible", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogStage_23getVisible, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogStage_22getVisible}, {"setVisible", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogStage_25setVisible, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogStage_24setVisible}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_8petsc4py_5PETSc_LogStage[] = { {(char *)"name", __pyx_getprop_8petsc4py_5PETSc_8LogStage_name, __pyx_setprop_8petsc4py_5PETSc_8LogStage_name, (char *)0, 0}, {(char *)"active", __pyx_getprop_8petsc4py_5PETSc_8LogStage_active, __pyx_setprop_8petsc4py_5PETSc_8LogStage_active, (char *)0, 0}, {(char *)"visible", __pyx_getprop_8petsc4py_5PETSc_8LogStage_visible, __pyx_setprop_8petsc4py_5PETSc_8LogStage_visible, (char *)0, 0}, {(char *)"id", __pyx_getprop_8petsc4py_5PETSc_8LogStage_id, 0, (char *)0, 0}, {0, 0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_8petsc4py_5PETSc_LogStage_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8petsc4py_5PETSc_LogStage}, {Py_nb_int, (void *)__pyx_pw_8petsc4py_5PETSc_8LogStage_3__int__}, #if PY_MAJOR_VERSION < 3 {Py_nb_long, (void *)__pyx_pw_8petsc4py_5PETSc_8LogStage_3__int__}, #endif {Py_tp_doc, (void *)PyDoc_STR("Logging support for different stages.")}, {Py_tp_methods, (void *)__pyx_methods_8petsc4py_5PETSc_LogStage}, {Py_tp_getset, (void *)__pyx_getsets_8petsc4py_5PETSc_LogStage}, {Py_tp_new, (void *)__pyx_tp_new_8petsc4py_5PETSc_LogStage}, {0, 0}, }; static PyType_Spec __pyx_type_8petsc4py_5PETSc_LogStage_spec = { "petsc4py.PETSc.LogStage", sizeof(struct __pyx_obj_8petsc4py_5PETSc_LogStage), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, __pyx_type_8petsc4py_5PETSc_LogStage_slots, }; #else static PyNumberMethods __pyx_tp_as_number_LogStage = { 0, /*nb_add*/ 0, /*nb_subtract*/ 0, /*nb_multiply*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_divide*/ #endif 0, /*nb_remainder*/ 0, /*nb_divmod*/ 0, /*nb_power*/ 0, /*nb_negative*/ 0, /*nb_positive*/ 0, /*nb_absolute*/ 0, /*nb_bool*/ 0, /*nb_invert*/ 0, /*nb_lshift*/ 0, /*nb_rshift*/ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_coerce*/ #endif __pyx_pw_8petsc4py_5PETSc_8LogStage_3__int__, /*nb_int*/ #if PY_MAJOR_VERSION < 3 __pyx_pw_8petsc4py_5PETSc_8LogStage_3__int__, /*nb_long*/ #else 0, /*reserved*/ #endif 0, /*nb_float*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_oct*/ #endif #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_hex*/ #endif 0, /*nb_inplace_add*/ 0, /*nb_inplace_subtract*/ 0, /*nb_inplace_multiply*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_inplace_divide*/ #endif 0, /*nb_inplace_remainder*/ 0, /*nb_inplace_power*/ 0, /*nb_inplace_lshift*/ 0, /*nb_inplace_rshift*/ 0, /*nb_inplace_and*/ 0, /*nb_inplace_xor*/ 0, /*nb_inplace_or*/ 0, /*nb_floor_divide*/ 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ 0, /*nb_index*/ #if PY_VERSION_HEX >= 0x03050000 0, /*nb_matrix_multiply*/ #endif #if PY_VERSION_HEX >= 0x03050000 0, /*nb_inplace_matrix_multiply*/ #endif }; static PyTypeObject __pyx_type_8petsc4py_5PETSc_LogStage = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.""LogStage", /*tp_name*/ sizeof(struct __pyx_obj_8petsc4py_5PETSc_LogStage), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_LogStage, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ &__pyx_tp_as_number_LogStage, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ PyDoc_STR("Logging support for different stages."), /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_LogStage, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_8petsc4py_5PETSc_LogStage, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_LogStage, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static PyObject *__pyx_tp_new_8petsc4py_5PETSc_LogClass(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; #endif if (unlikely(__pyx_pw_8petsc4py_5PETSc_8LogClass_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_8petsc4py_5PETSc_LogClass(PyObject *o) { #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_8petsc4py_5PETSc_LogClass) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static PyObject *__pyx_getprop_8petsc4py_5PETSc_8LogClass_name(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_8LogClass_4name_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_8LogClass_name(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_8LogClass_4name_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_8LogClass_active(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_8LogClass_6active_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_8LogClass_active(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_8LogClass_6active_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_8LogClass_id(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_8LogClass_2id_1__get__(o); } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_LogClass[] = { {"getName", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogClass_5getName, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogClass_4getName}, {"activate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogClass_7activate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogClass_6activate}, {"deactivate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogClass_9deactivate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogClass_8deactivate}, {"getActive", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogClass_11getActive, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogClass_10getActive}, {"setActive", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogClass_13setActive, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogClass_12setActive}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_8petsc4py_5PETSc_LogClass[] = { {(char *)"name", __pyx_getprop_8petsc4py_5PETSc_8LogClass_name, __pyx_setprop_8petsc4py_5PETSc_8LogClass_name, (char *)0, 0}, {(char *)"active", __pyx_getprop_8petsc4py_5PETSc_8LogClass_active, __pyx_setprop_8petsc4py_5PETSc_8LogClass_active, (char *)0, 0}, {(char *)"id", __pyx_getprop_8petsc4py_5PETSc_8LogClass_id, 0, (char *)0, 0}, {0, 0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_8petsc4py_5PETSc_LogClass_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8petsc4py_5PETSc_LogClass}, {Py_nb_int, (void *)__pyx_pw_8petsc4py_5PETSc_8LogClass_3__int__}, #if PY_MAJOR_VERSION < 3 {Py_nb_long, (void *)__pyx_pw_8petsc4py_5PETSc_8LogClass_3__int__}, #endif {Py_tp_methods, (void *)__pyx_methods_8petsc4py_5PETSc_LogClass}, {Py_tp_getset, (void *)__pyx_getsets_8petsc4py_5PETSc_LogClass}, {Py_tp_new, (void *)__pyx_tp_new_8petsc4py_5PETSc_LogClass}, {0, 0}, }; static PyType_Spec __pyx_type_8petsc4py_5PETSc_LogClass_spec = { "petsc4py.PETSc.LogClass", sizeof(struct __pyx_obj_8petsc4py_5PETSc_LogClass), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, __pyx_type_8petsc4py_5PETSc_LogClass_slots, }; #else static PyNumberMethods __pyx_tp_as_number_LogClass = { 0, /*nb_add*/ 0, /*nb_subtract*/ 0, /*nb_multiply*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_divide*/ #endif 0, /*nb_remainder*/ 0, /*nb_divmod*/ 0, /*nb_power*/ 0, /*nb_negative*/ 0, /*nb_positive*/ 0, /*nb_absolute*/ 0, /*nb_bool*/ 0, /*nb_invert*/ 0, /*nb_lshift*/ 0, /*nb_rshift*/ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_coerce*/ #endif __pyx_pw_8petsc4py_5PETSc_8LogClass_3__int__, /*nb_int*/ #if PY_MAJOR_VERSION < 3 __pyx_pw_8petsc4py_5PETSc_8LogClass_3__int__, /*nb_long*/ #else 0, /*reserved*/ #endif 0, /*nb_float*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_oct*/ #endif #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_hex*/ #endif 0, /*nb_inplace_add*/ 0, /*nb_inplace_subtract*/ 0, /*nb_inplace_multiply*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_inplace_divide*/ #endif 0, /*nb_inplace_remainder*/ 0, /*nb_inplace_power*/ 0, /*nb_inplace_lshift*/ 0, /*nb_inplace_rshift*/ 0, /*nb_inplace_and*/ 0, /*nb_inplace_xor*/ 0, /*nb_inplace_or*/ 0, /*nb_floor_divide*/ 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ 0, /*nb_index*/ #if PY_VERSION_HEX >= 0x03050000 0, /*nb_matrix_multiply*/ #endif #if PY_VERSION_HEX >= 0x03050000 0, /*nb_inplace_matrix_multiply*/ #endif }; static PyTypeObject __pyx_type_8petsc4py_5PETSc_LogClass = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.""LogClass", /*tp_name*/ sizeof(struct __pyx_obj_8petsc4py_5PETSc_LogClass), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_LogClass, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ &__pyx_tp_as_number_LogClass, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ 0, /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_LogClass, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_8petsc4py_5PETSc_LogClass, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_LogClass, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static PyObject *__pyx_tp_new_8petsc4py_5PETSc_LogEvent(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; #endif if (unlikely(__pyx_pw_8petsc4py_5PETSc_8LogEvent_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_8petsc4py_5PETSc_LogEvent(PyObject *o) { #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_8petsc4py_5PETSc_LogEvent) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static PyObject *__pyx_getprop_8petsc4py_5PETSc_8LogEvent_name(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_8LogEvent_4name_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_8LogEvent_name(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_8LogEvent_4name_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_8LogEvent_active(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_8LogEvent_6active_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_8LogEvent_active(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_8LogEvent_6active_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_8LogEvent_active_all(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_8LogEvent_10active_all_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_8LogEvent_active_all(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_8LogEvent_10active_all_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_8LogEvent_id(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_8LogEvent_2id_1__get__(o); } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_LogEvent[] = { {"__enter__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogEvent_5__enter__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogEvent_4__enter__}, {"__exit__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogEvent_7__exit__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogEvent_6__exit__}, {"begin", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogEvent_9begin, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogEvent_8begin}, {"end", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogEvent_11end, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogEvent_10end}, {"getName", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogEvent_13getName, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogEvent_12getName}, {"activate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogEvent_15activate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogEvent_14activate}, {"deactivate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogEvent_17deactivate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogEvent_16deactivate}, {"getActive", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogEvent_19getActive, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogEvent_18getActive}, {"setActive", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogEvent_21setActive, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogEvent_20setActive}, {"getActiveAll", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogEvent_23getActiveAll, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogEvent_22getActiveAll}, {"setActiveAll", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogEvent_25setActiveAll, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogEvent_24setActiveAll}, {"getPerfInfo", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogEvent_27getPerfInfo, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogEvent_26getPerfInfo}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_8petsc4py_5PETSc_LogEvent[] = { {(char *)"name", __pyx_getprop_8petsc4py_5PETSc_8LogEvent_name, __pyx_setprop_8petsc4py_5PETSc_8LogEvent_name, (char *)0, 0}, {(char *)"active", __pyx_getprop_8petsc4py_5PETSc_8LogEvent_active, __pyx_setprop_8petsc4py_5PETSc_8LogEvent_active, (char *)0, 0}, {(char *)"active_all", __pyx_getprop_8petsc4py_5PETSc_8LogEvent_active_all, __pyx_setprop_8petsc4py_5PETSc_8LogEvent_active_all, (char *)0, 0}, {(char *)"id", __pyx_getprop_8petsc4py_5PETSc_8LogEvent_id, 0, (char *)0, 0}, {0, 0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_8petsc4py_5PETSc_LogEvent_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8petsc4py_5PETSc_LogEvent}, {Py_nb_int, (void *)__pyx_pw_8petsc4py_5PETSc_8LogEvent_3__int__}, #if PY_MAJOR_VERSION < 3 {Py_nb_long, (void *)__pyx_pw_8petsc4py_5PETSc_8LogEvent_3__int__}, #endif {Py_tp_methods, (void *)__pyx_methods_8petsc4py_5PETSc_LogEvent}, {Py_tp_getset, (void *)__pyx_getsets_8petsc4py_5PETSc_LogEvent}, {Py_tp_new, (void *)__pyx_tp_new_8petsc4py_5PETSc_LogEvent}, {0, 0}, }; static PyType_Spec __pyx_type_8petsc4py_5PETSc_LogEvent_spec = { "petsc4py.PETSc.LogEvent", sizeof(struct __pyx_obj_8petsc4py_5PETSc_LogEvent), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, __pyx_type_8petsc4py_5PETSc_LogEvent_slots, }; #else static PyNumberMethods __pyx_tp_as_number_LogEvent = { 0, /*nb_add*/ 0, /*nb_subtract*/ 0, /*nb_multiply*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_divide*/ #endif 0, /*nb_remainder*/ 0, /*nb_divmod*/ 0, /*nb_power*/ 0, /*nb_negative*/ 0, /*nb_positive*/ 0, /*nb_absolute*/ 0, /*nb_bool*/ 0, /*nb_invert*/ 0, /*nb_lshift*/ 0, /*nb_rshift*/ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_coerce*/ #endif __pyx_pw_8petsc4py_5PETSc_8LogEvent_3__int__, /*nb_int*/ #if PY_MAJOR_VERSION < 3 __pyx_pw_8petsc4py_5PETSc_8LogEvent_3__int__, /*nb_long*/ #else 0, /*reserved*/ #endif 0, /*nb_float*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_oct*/ #endif #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_hex*/ #endif 0, /*nb_inplace_add*/ 0, /*nb_inplace_subtract*/ 0, /*nb_inplace_multiply*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_inplace_divide*/ #endif 0, /*nb_inplace_remainder*/ 0, /*nb_inplace_power*/ 0, /*nb_inplace_lshift*/ 0, /*nb_inplace_rshift*/ 0, /*nb_inplace_and*/ 0, /*nb_inplace_xor*/ 0, /*nb_inplace_or*/ 0, /*nb_floor_divide*/ 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ 0, /*nb_index*/ #if PY_VERSION_HEX >= 0x03050000 0, /*nb_matrix_multiply*/ #endif #if PY_VERSION_HEX >= 0x03050000 0, /*nb_inplace_matrix_multiply*/ #endif }; static PyTypeObject __pyx_type_8petsc4py_5PETSc_LogEvent = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.""LogEvent", /*tp_name*/ sizeof(struct __pyx_obj_8petsc4py_5PETSc_LogEvent), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_LogEvent, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ &__pyx_tp_as_number_LogEvent, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ 0, /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_LogEvent, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_8petsc4py_5PETSc_LogEvent, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_LogEvent, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static struct __pyx_vtabstruct_8petsc4py_5PETSc_ViewerHDF5 __pyx_vtable_8petsc4py_5PETSc_ViewerHDF5; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_ViewerHDF5(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *p; PyObject *o = __pyx_tp_new_8petsc4py_5PETSc_Viewer(t, a, k); if (unlikely(!o)) return 0; p = ((struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *)o); p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Object*)__pyx_vtabptr_8petsc4py_5PETSc_ViewerHDF5; return o; } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_ViewerHDF5[] = { {"create", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_1create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_10ViewerHDF5_create}, {"pushTimestepping", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_3pushTimestepping, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_10ViewerHDF5_2pushTimestepping}, {"popTimestepping", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_5popTimestepping, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_10ViewerHDF5_4popTimestepping}, {"getTimestep", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_7getTimestep, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_10ViewerHDF5_6getTimestep}, {"setTimestep", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_9setTimestep, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_10ViewerHDF5_8setTimestep}, {"incrementTimestep", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_11incrementTimestep, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_10ViewerHDF5_10incrementTimestep}, {"pushGroup", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_13pushGroup, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_10ViewerHDF5_12pushGroup}, {"popGroup", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_15popGroup, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_10ViewerHDF5_14popGroup}, {"getGroup", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_17getGroup, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_10ViewerHDF5_16getGroup}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_8petsc4py_5PETSc_ViewerHDF5_slots[] = { {Py_tp_traverse, (void *)__pyx_tp_traverse_8petsc4py_5PETSc_Object}, {Py_tp_clear, (void *)__pyx_tp_clear_8petsc4py_5PETSc_Object}, {Py_tp_methods, (void *)__pyx_methods_8petsc4py_5PETSc_ViewerHDF5}, {Py_tp_new, (void *)__pyx_tp_new_8petsc4py_5PETSc_ViewerHDF5}, {0, 0}, }; static PyType_Spec __pyx_type_8petsc4py_5PETSc_ViewerHDF5_spec = { "petsc4py.PETSc.ViewerHDF5", sizeof(struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, __pyx_type_8petsc4py_5PETSc_ViewerHDF5_slots, }; #else static PyTypeObject __pyx_type_8petsc4py_5PETSc_ViewerHDF5 = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.""ViewerHDF5", /*tp_name*/ sizeof(struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Object, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ #if CYTHON_COMPILING_IN_PYPY || 0 __pyx_pw_8petsc4py_5PETSc_6Viewer_3__call__, /*tp_call*/ #else 0, /*tp_call*/ #endif 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc_Object, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc_Object, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_ViewerHDF5, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_ViewerHDF5, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static PyObject *__pyx_tp_new_8petsc4py_5PETSc_MatStencil(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; #endif return o; } static void __pyx_tp_dealloc_8petsc4py_5PETSc_MatStencil(PyObject *o) { #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_8petsc4py_5PETSc_MatStencil) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static PyObject *__pyx_getprop_8petsc4py_5PETSc_10MatStencil_i(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_10MatStencil_1i_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_10MatStencil_i(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_10MatStencil_1i_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_10MatStencil_j(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_10MatStencil_1j_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_10MatStencil_j(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_10MatStencil_1j_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_10MatStencil_k(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_10MatStencil_1k_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_10MatStencil_k(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_10MatStencil_1k_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_10MatStencil_c(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_10MatStencil_1c_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_10MatStencil_c(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_10MatStencil_1c_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_10MatStencil_index(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_10MatStencil_5index_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_10MatStencil_index(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_10MatStencil_5index_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_10MatStencil_field(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_10MatStencil_5field_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_10MatStencil_field(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_10MatStencil_5field_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static struct PyGetSetDef __pyx_getsets_8petsc4py_5PETSc_MatStencil[] = { {(char *)"i", __pyx_getprop_8petsc4py_5PETSc_10MatStencil_i, __pyx_setprop_8petsc4py_5PETSc_10MatStencil_i, (char *)PyDoc_STR("MatStencil.i: int\nFirst logical grid coordinate.\nSource code at petsc4py/PETSc/Mat.pyx:280"), 0}, {(char *)"j", __pyx_getprop_8petsc4py_5PETSc_10MatStencil_j, __pyx_setprop_8petsc4py_5PETSc_10MatStencil_j, (char *)PyDoc_STR("MatStencil.j: int\nSecond logical grid coordinate.\nSource code at petsc4py/PETSc/Mat.pyx:287"), 0}, {(char *)"k", __pyx_getprop_8petsc4py_5PETSc_10MatStencil_k, __pyx_setprop_8petsc4py_5PETSc_10MatStencil_k, (char *)PyDoc_STR("MatStencil.k: int\nThird logical grid coordinate.\nSource code at petsc4py/PETSc/Mat.pyx:294"), 0}, {(char *)"c", __pyx_getprop_8petsc4py_5PETSc_10MatStencil_c, __pyx_setprop_8petsc4py_5PETSc_10MatStencil_c, (char *)PyDoc_STR("MatStencil.c: int\nField component.\nSource code at petsc4py/PETSc/Mat.pyx:301"), 0}, {(char *)"index", __pyx_getprop_8petsc4py_5PETSc_10MatStencil_index, __pyx_setprop_8petsc4py_5PETSc_10MatStencil_index, (char *)PyDoc_STR("MatStencil.index: tuple[int, int, int]\nLogical grid coordinates ``(i, j, k)``.\nSource code at petsc4py/PETSc/Mat.pyx:308"), 0}, {(char *)"field", __pyx_getprop_8petsc4py_5PETSc_10MatStencil_field, __pyx_setprop_8petsc4py_5PETSc_10MatStencil_field, (char *)PyDoc_STR("MatStencil.field: int\nField component.\nSource code at petsc4py/PETSc/Mat.pyx:318"), 0}, {0, 0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_8petsc4py_5PETSc_MatStencil_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8petsc4py_5PETSc_MatStencil}, {Py_tp_doc, (void *)PyDoc_STR("Associate structured grid coordinates with matrix indices.\n\n See Also\n --------\n petsc.MatStencil\n\n ")}, {Py_tp_getset, (void *)__pyx_getsets_8petsc4py_5PETSc_MatStencil}, {Py_tp_new, (void *)__pyx_tp_new_8petsc4py_5PETSc_MatStencil}, {0, 0}, }; static PyType_Spec __pyx_type_8petsc4py_5PETSc_MatStencil_spec = { "petsc4py.PETSc.MatStencil", sizeof(struct __pyx_obj_8petsc4py_5PETSc_MatStencil), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, __pyx_type_8petsc4py_5PETSc_MatStencil_slots, }; #else static PyTypeObject __pyx_type_8petsc4py_5PETSc_MatStencil = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.""MatStencil", /*tp_name*/ sizeof(struct __pyx_obj_8petsc4py_5PETSc_MatStencil), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_MatStencil, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ PyDoc_STR("Associate structured grid coordinates with matrix indices.\n\n See Also\n --------\n petsc.MatStencil\n\n "), /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_8petsc4py_5PETSc_MatStencil, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_MatStencil, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static struct __pyx_vtabstruct_8petsc4py_5PETSc_DMDA __pyx_vtable_8petsc4py_5PETSc_DMDA; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_DMDA(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_8petsc4py_5PETSc_DMDA *p; PyObject *o = __pyx_tp_new_8petsc4py_5PETSc_DM(t, a, k); if (unlikely(!o)) return 0; p = ((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)o); p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Object*)__pyx_vtabptr_8petsc4py_5PETSc_DMDA; return o; } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4DMDA_dim(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4DMDA_3dim_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4DMDA_dof(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4DMDA_3dof_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4DMDA_sizes(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4DMDA_5sizes_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4DMDA_proc_sizes(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4DMDA_10proc_sizes_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4DMDA_boundary_type(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4DMDA_13boundary_type_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4DMDA_stencil(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4DMDA_7stencil_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4DMDA_stencil_type(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4DMDA_12stencil_type_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4DMDA_stencil_width(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4DMDA_13stencil_width_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4DMDA_ranges(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4DMDA_6ranges_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4DMDA_ghost_ranges(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4DMDA_12ghost_ranges_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4DMDA_corners(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4DMDA_7corners_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4DMDA_ghost_corners(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4DMDA_13ghost_corners_1__get__(o); } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_DMDA[] = { {"create", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_1create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_create}, {"duplicate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_3duplicate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_2duplicate}, {"setDim", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_5setDim, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_4setDim}, {"getDim", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_7getDim, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_6getDim}, {"setDof", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_9setDof, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_8setDof}, {"getDof", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_11getDof, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_10getDof}, {"setSizes", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_13setSizes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_12setSizes}, {"getSizes", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_15getSizes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_14getSizes}, {"setProcSizes", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_17setProcSizes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_16setProcSizes}, {"getProcSizes", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_19getProcSizes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_18getProcSizes}, {"setBoundaryType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_21setBoundaryType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_20setBoundaryType}, {"getBoundaryType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_23getBoundaryType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_22getBoundaryType}, {"setStencilType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_25setStencilType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_24setStencilType}, {"getStencilType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_27getStencilType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_26getStencilType}, {"setStencilWidth", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_29setStencilWidth, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_28setStencilWidth}, {"getStencilWidth", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_31getStencilWidth, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_30getStencilWidth}, {"setStencil", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_33setStencil, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_32setStencil}, {"getStencil", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_35getStencil, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_34getStencil}, {"getRanges", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_37getRanges, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_36getRanges}, {"getGhostRanges", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_39getGhostRanges, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_38getGhostRanges}, {"getOwnershipRanges", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_41getOwnershipRanges, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_40getOwnershipRanges}, {"getCorners", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_43getCorners, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_42getCorners}, {"getGhostCorners", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_45getGhostCorners, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_44getGhostCorners}, {"setFieldName", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_47setFieldName, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_46setFieldName}, {"getFieldName", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_49getFieldName, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_48getFieldName}, {"getVecArray", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_51getVecArray, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_50getVecArray}, {"setUniformCoordinates", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_53setUniformCoordinates, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_52setUniformCoordinates}, {"setCoordinateName", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_55setCoordinateName, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_54setCoordinateName}, {"getCoordinateName", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_57getCoordinateName, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_56getCoordinateName}, {"createNaturalVec", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_59createNaturalVec, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_58createNaturalVec}, {"globalToNatural", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_61globalToNatural, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_60globalToNatural}, {"naturalToGlobal", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_63naturalToGlobal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_62naturalToGlobal}, {"getAO", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_65getAO, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_64getAO}, {"getScatter", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_67getScatter, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_66getScatter}, {"setRefinementFactor", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_69setRefinementFactor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_68setRefinementFactor}, {"getRefinementFactor", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_71getRefinementFactor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_70getRefinementFactor}, {"setInterpolationType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_73setInterpolationType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_72setInterpolationType}, {"getInterpolationType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_75getInterpolationType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_74getInterpolationType}, {"setElementType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_77setElementType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_76setElementType}, {"getElementType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_79getElementType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_78getElementType}, {"getElements", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_81getElements, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_80getElements}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_8petsc4py_5PETSc_DMDA[] = { {(char *)"dim", __pyx_getprop_8petsc4py_5PETSc_4DMDA_dim, 0, (char *)PyDoc_STR("DMDA.dim: int\nThe grid dimension.\nSource code at petsc4py/PETSc/DMDA.pyx:1101"), 0}, {(char *)"dof", __pyx_getprop_8petsc4py_5PETSc_4DMDA_dof, 0, (char *)PyDoc_STR("DMDA.dof: int\nThe number of DOFs associated with each stratum of the grid.\nSource code at petsc4py/PETSc/DMDA.pyx:1106"), 0}, {(char *)"sizes", __pyx_getprop_8petsc4py_5PETSc_4DMDA_sizes, 0, (char *)PyDoc_STR("DMDA.sizes: tuple[int, ...]\nThe global dimension.\nSource code at petsc4py/PETSc/DMDA.pyx:1111"), 0}, {(char *)"proc_sizes", __pyx_getprop_8petsc4py_5PETSc_4DMDA_proc_sizes, 0, (char *)PyDoc_STR("DMDA.proc_sizes: tuple[int, ...]\nThe number of processes in each dimension in the global decomposition.\nSource code at petsc4py/PETSc/DMDA.pyx:1116"), 0}, {(char *)"boundary_type", __pyx_getprop_8petsc4py_5PETSc_4DMDA_boundary_type, 0, (char *)PyDoc_STR("DMDA.boundary_type: tuple[DM.BoundaryType, ...]\nBoundary types in each dimension.\nSource code at petsc4py/PETSc/DMDA.pyx:1121"), 0}, {(char *)"stencil", __pyx_getprop_8petsc4py_5PETSc_4DMDA_stencil, 0, (char *)PyDoc_STR("DMDA.stencil: tuple[StencilType, int]\nStencil type and width.\nSource code at petsc4py/PETSc/DMDA.pyx:1126"), 0}, {(char *)"stencil_type", __pyx_getprop_8petsc4py_5PETSc_4DMDA_stencil_type, 0, (char *)PyDoc_STR("DMDA.stencil_type: str\nStencil type.\nSource code at petsc4py/PETSc/DMDA.pyx:1131"), 0}, {(char *)"stencil_width", __pyx_getprop_8petsc4py_5PETSc_4DMDA_stencil_width, 0, (char *)PyDoc_STR("DMDA.stencil_width: int\nElementwise stencil width.\nSource code at petsc4py/PETSc/DMDA.pyx:1136"), 0}, {(char *)"ranges", __pyx_getprop_8petsc4py_5PETSc_4DMDA_ranges, 0, (char *)PyDoc_STR("DMDA.ranges: tuple[tuple[int, int], ...]\nRanges of the local region in each dimension.\nSource code at petsc4py/PETSc/DMDA.pyx:1141"), 0}, {(char *)"ghost_ranges", __pyx_getprop_8petsc4py_5PETSc_4DMDA_ghost_ranges, 0, (char *)PyDoc_STR("DMDA.ghost_ranges: tuple[tuple[int, int], ...]\nRanges of local region, including ghost nodes.\nSource code at petsc4py/PETSc/DMDA.pyx:1146"), 0}, {(char *)"corners", __pyx_getprop_8petsc4py_5PETSc_4DMDA_corners, 0, (char *)PyDoc_STR("DMDA.corners: tuple[tuple[int, ...], tuple[int, ...]]\nThe lower left corner and size of local region in each dimension.\nSource code at petsc4py/PETSc/DMDA.pyx:1151"), 0}, {(char *)"ghost_corners", __pyx_getprop_8petsc4py_5PETSc_4DMDA_ghost_corners, 0, (char *)PyDoc_STR("DMDA.ghost_corners: tuple[tuple[int, ...], tuple[int, ...]]\nThe lower left corner and size of local region in each dimension.\nSource code at petsc4py/PETSc/DMDA.pyx:1156"), 0}, {0, 0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_8petsc4py_5PETSc_DMDA_slots[] = { {Py_tp_doc, (void *)PyDoc_STR("A DM object that is used to manage data for a structured grid.")}, {Py_tp_traverse, (void *)__pyx_tp_traverse_8petsc4py_5PETSc_Object}, {Py_tp_clear, (void *)__pyx_tp_clear_8petsc4py_5PETSc_Object}, {Py_tp_methods, (void *)__pyx_methods_8petsc4py_5PETSc_DMDA}, {Py_tp_getset, (void *)__pyx_getsets_8petsc4py_5PETSc_DMDA}, {Py_tp_new, (void *)__pyx_tp_new_8petsc4py_5PETSc_DMDA}, {0, 0}, }; static PyType_Spec __pyx_type_8petsc4py_5PETSc_DMDA_spec = { "petsc4py.PETSc.DMDA", sizeof(struct __pyx_obj_8petsc4py_5PETSc_DMDA), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, __pyx_type_8petsc4py_5PETSc_DMDA_slots, }; #else static PyTypeObject __pyx_type_8petsc4py_5PETSc_DMDA = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.""DMDA", /*tp_name*/ sizeof(struct __pyx_obj_8petsc4py_5PETSc_DMDA), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Object, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ PyDoc_STR("A DM object that is used to manage data for a structured grid."), /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc_Object, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc_Object, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_DMDA, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_8petsc4py_5PETSc_DMDA, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_DMDA, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static struct __pyx_vtabstruct_8petsc4py_5PETSc_DMPlex __pyx_vtable_8petsc4py_5PETSc_DMPlex; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_DMPlex(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_8petsc4py_5PETSc_DMPlex *p; PyObject *o = __pyx_tp_new_8petsc4py_5PETSc_DM(t, a, k); if (unlikely(!o)) return 0; p = ((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)o); p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Object*)__pyx_vtabptr_8petsc4py_5PETSc_DMPlex; return o; } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_DMPlex[] = { {"create", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_1create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_create}, {"createFromCellList", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_3createFromCellList, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_2createFromCellList}, {"createBoxMesh", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_5createBoxMesh, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_4createBoxMesh}, {"createBoxSurfaceMesh", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_7createBoxSurfaceMesh, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_6createBoxSurfaceMesh}, {"createFromFile", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_9createFromFile, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_8createFromFile}, {"createCGNS", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_11createCGNS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_10createCGNS}, {"createCGNSFromFile", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_13createCGNSFromFile, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_12createCGNSFromFile}, {"createExodusFromFile", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_15createExodusFromFile, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_14createExodusFromFile}, {"createExodus", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_17createExodus, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_16createExodus}, {"createGmsh", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_19createGmsh, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_18createGmsh}, {"createCohesiveSubmesh", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_21createCohesiveSubmesh, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_20createCohesiveSubmesh}, {"getChart", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_23getChart, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_22getChart}, {"setChart", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_25setChart, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_24setChart}, {"getConeSize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_27getConeSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_26getConeSize}, {"setConeSize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_29setConeSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_28setConeSize}, {"getCone", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_31getCone, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_30getCone}, {"setCone", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_33setCone, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_32setCone}, {"insertCone", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_35insertCone, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_34insertCone}, {"insertConeOrientation", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_37insertConeOrientation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_36insertConeOrientation}, {"getConeOrientation", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_39getConeOrientation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_38getConeOrientation}, {"setConeOrientation", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_41setConeOrientation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_40setConeOrientation}, {"setCellType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_43setCellType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_42setCellType}, {"getCellType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_45getCellType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_44getCellType}, {"getCellTypeLabel", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_47getCellTypeLabel, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_46getCellTypeLabel}, {"getSupportSize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_49getSupportSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_48getSupportSize}, {"setSupportSize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_51setSupportSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_50setSupportSize}, {"getSupport", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_53getSupport, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_52getSupport}, {"setSupport", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_55setSupport, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_54setSupport}, {"getMaxSizes", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_57getMaxSizes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_56getMaxSizes}, {"symmetrize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_59symmetrize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_58symmetrize}, {"stratify", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_61stratify, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_60stratify}, {"orient", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_63orient, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_62orient}, {"getCellNumbering", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_65getCellNumbering, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_64getCellNumbering}, {"getVertexNumbering", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_67getVertexNumbering, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_66getVertexNumbering}, {"createPointNumbering", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_69createPointNumbering, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_68createPointNumbering}, {"getDepth", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_71getDepth, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_70getDepth}, {"getDepthStratum", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_73getDepthStratum, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_72getDepthStratum}, {"getHeightStratum", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_75getHeightStratum, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_74getHeightStratum}, {"getPointDepth", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_77getPointDepth, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_76getPointDepth}, {"getPointHeight", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_79getPointHeight, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_78getPointHeight}, {"getMeet", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_81getMeet, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_80getMeet}, {"getJoin", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_83getJoin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_82getJoin}, {"getFullJoin", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_85getFullJoin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_84getFullJoin}, {"getTransitiveClosure", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_87getTransitiveClosure, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_86getTransitiveClosure}, {"vecGetClosure", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_89vecGetClosure, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_88vecGetClosure}, {"getVecClosure", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_91getVecClosure, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_90getVecClosure}, {"setVecClosure", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_93setVecClosure, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_92setVecClosure}, {"setMatClosure", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_95setMatClosure, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_94setMatClosure}, {"generate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_97generate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_96generate}, {"setTriangleOptions", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_99setTriangleOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_98setTriangleOptions}, {"setTetGenOptions", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_101setTetGenOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_100setTetGenOptions}, {"markBoundaryFaces", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_103markBoundaryFaces, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_102markBoundaryFaces}, {"labelComplete", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_105labelComplete, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_104labelComplete}, {"labelCohesiveComplete", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_107labelCohesiveComplete, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_106labelCohesiveComplete}, {"setAdjacencyUseAnchors", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_109setAdjacencyUseAnchors, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_108setAdjacencyUseAnchors}, {"getAdjacencyUseAnchors", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_111getAdjacencyUseAnchors, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_110getAdjacencyUseAnchors}, {"getAdjacency", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_113getAdjacency, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_112getAdjacency}, {"setPartitioner", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_115setPartitioner, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_114setPartitioner}, {"getPartitioner", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_117getPartitioner, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_116getPartitioner}, {"rebalanceSharedPoints", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_119rebalanceSharedPoints, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_118rebalanceSharedPoints}, {"distribute", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_121distribute, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_120distribute}, {"distributeOverlap", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_123distributeOverlap, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_122distributeOverlap}, {"isDistributed", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_125isDistributed, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_124isDistributed}, {"isSimplex", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_127isSimplex, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_126isSimplex}, {"distributeGetDefault", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_129distributeGetDefault, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_128distributeGetDefault}, {"distributeSetDefault", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_131distributeSetDefault, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_130distributeSetDefault}, {"distributionSetName", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_133distributionSetName, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_132distributionSetName}, {"distributionGetName", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_135distributionGetName, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_134distributionGetName}, {"interpolate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_137interpolate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_136interpolate}, {"uninterpolate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_139uninterpolate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_138uninterpolate}, {"distributeField", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_141distributeField, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_140distributeField}, {"getMinRadius", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_143getMinRadius, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_142getMinRadius}, {"createCoarsePointIS", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_145createCoarsePointIS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_144createCoarsePointIS}, {"createSection", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_147createSection, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_146createSection}, {"getPointLocal", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_149getPointLocal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_148getPointLocal}, {"getPointLocalField", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_151getPointLocalField, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_150getPointLocalField}, {"getPointGlobal", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_153getPointGlobal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_152getPointGlobal}, {"getPointGlobalField", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_155getPointGlobalField, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_154getPointGlobalField}, {"createClosureIndex", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_157createClosureIndex, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_156createClosureIndex}, {"setRefinementUniform", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_159setRefinementUniform, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_158setRefinementUniform}, {"getRefinementUniform", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_161getRefinementUniform, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_160getRefinementUniform}, {"setRefinementLimit", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_163setRefinementLimit, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_162setRefinementLimit}, {"getRefinementLimit", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_165getRefinementLimit, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_164getRefinementLimit}, {"getOrdering", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_167getOrdering, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_166getOrdering}, {"permute", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_169permute, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_168permute}, {"reorderGetDefault", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_171reorderGetDefault, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_170reorderGetDefault}, {"reorderSetDefault", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_173reorderSetDefault, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_172reorderSetDefault}, {"computeCellGeometryFVM", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_175computeCellGeometryFVM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_174computeCellGeometryFVM}, {"constructGhostCells", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_177constructGhostCells, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_176constructGhostCells}, {"metricSetFromOptions", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_179metricSetFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_178metricSetFromOptions}, {"metricSetUniform", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_181metricSetUniform, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_180metricSetUniform}, {"metricIsUniform", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_183metricIsUniform, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_182metricIsUniform}, {"metricSetIsotropic", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_185metricSetIsotropic, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_184metricSetIsotropic}, {"metricIsIsotropic", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_187metricIsIsotropic, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_186metricIsIsotropic}, {"metricSetRestrictAnisotropyFirst", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_189metricSetRestrictAnisotropyFirst, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_188metricSetRestrictAnisotropyFirst}, {"metricRestrictAnisotropyFirst", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_191metricRestrictAnisotropyFirst, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_190metricRestrictAnisotropyFirst}, {"metricSetNoInsertion", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_193metricSetNoInsertion, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_192metricSetNoInsertion}, {"metricNoInsertion", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_195metricNoInsertion, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_194metricNoInsertion}, {"metricSetNoSwapping", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_197metricSetNoSwapping, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_196metricSetNoSwapping}, {"metricNoSwapping", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_199metricNoSwapping, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_198metricNoSwapping}, {"metricSetNoMovement", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_201metricSetNoMovement, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_200metricSetNoMovement}, {"metricNoMovement", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_203metricNoMovement, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_202metricNoMovement}, {"metricSetNoSurf", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_205metricSetNoSurf, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_204metricSetNoSurf}, {"metricNoSurf", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_207metricNoSurf, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_206metricNoSurf}, {"metricSetVerbosity", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_209metricSetVerbosity, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_208metricSetVerbosity}, {"metricGetVerbosity", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_211metricGetVerbosity, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_210metricGetVerbosity}, {"metricSetNumIterations", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_213metricSetNumIterations, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_212metricSetNumIterations}, {"metricGetNumIterations", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_215metricGetNumIterations, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_214metricGetNumIterations}, {"metricSetMinimumMagnitude", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_217metricSetMinimumMagnitude, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_216metricSetMinimumMagnitude}, {"metricGetMinimumMagnitude", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_219metricGetMinimumMagnitude, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_218metricGetMinimumMagnitude}, {"metricSetMaximumMagnitude", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_221metricSetMaximumMagnitude, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_220metricSetMaximumMagnitude}, {"metricGetMaximumMagnitude", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_223metricGetMaximumMagnitude, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_222metricGetMaximumMagnitude}, {"metricSetMaximumAnisotropy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_225metricSetMaximumAnisotropy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_224metricSetMaximumAnisotropy}, {"metricGetMaximumAnisotropy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_227metricGetMaximumAnisotropy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_226metricGetMaximumAnisotropy}, {"metricSetTargetComplexity", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_229metricSetTargetComplexity, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_228metricSetTargetComplexity}, {"metricGetTargetComplexity", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_231metricGetTargetComplexity, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_230metricGetTargetComplexity}, {"metricSetNormalizationOrder", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_233metricSetNormalizationOrder, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_232metricSetNormalizationOrder}, {"metricGetNormalizationOrder", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_235metricGetNormalizationOrder, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_234metricGetNormalizationOrder}, {"metricSetGradationFactor", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_237metricSetGradationFactor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_236metricSetGradationFactor}, {"metricGetGradationFactor", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_239metricGetGradationFactor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_238metricGetGradationFactor}, {"metricSetHausdorffNumber", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_241metricSetHausdorffNumber, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_240metricSetHausdorffNumber}, {"metricGetHausdorffNumber", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_243metricGetHausdorffNumber, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_242metricGetHausdorffNumber}, {"metricCreate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_245metricCreate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_244metricCreate}, {"metricCreateUniform", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_247metricCreateUniform, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_246metricCreateUniform}, {"metricCreateIsotropic", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_249metricCreateIsotropic, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_248metricCreateIsotropic}, {"metricDeterminantCreate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_251metricDeterminantCreate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_250metricDeterminantCreate}, {"metricEnforceSPD", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_253metricEnforceSPD, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_252metricEnforceSPD}, {"metricNormalize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_255metricNormalize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_254metricNormalize}, {"metricAverage2", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_257metricAverage2, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_256metricAverage2}, {"metricAverage3", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_259metricAverage3, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_258metricAverage3}, {"metricIntersection2", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_261metricIntersection2, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_260metricIntersection2}, {"metricIntersection3", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_263metricIntersection3, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_262metricIntersection3}, {"computeGradientClementInterpolant", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_265computeGradientClementInterpolant, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_264computeGradientClementInterpolant}, {"topologyView", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_267topologyView, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_266topologyView}, {"coordinatesView", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_269coordinatesView, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_268coordinatesView}, {"labelsView", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_271labelsView, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_270labelsView}, {"sectionView", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_273sectionView, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_272sectionView}, {"globalVectorView", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_275globalVectorView, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_274globalVectorView}, {"localVectorView", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_277localVectorView, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_276localVectorView}, {"topologyLoad", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_279topologyLoad, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_278topologyLoad}, {"coordinatesLoad", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_281coordinatesLoad, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_280coordinatesLoad}, {"labelsLoad", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_283labelsLoad, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_282labelsLoad}, {"sectionLoad", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_285sectionLoad, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_284sectionLoad}, {"globalVectorLoad", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_287globalVectorLoad, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_286globalVectorLoad}, {"localVectorLoad", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_289localVectorLoad, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_288localVectorLoad}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_8petsc4py_5PETSc_DMPlex_slots[] = { {Py_tp_doc, (void *)PyDoc_STR("Encapsulate an unstructured mesh.\n\n DMPlex encapsulates both topology and geometry. It is capable of parallel refinement and coarsening (using Pragmatic or ParMmg) and parallel redistribution for load balancing. It is designed to interface with the `FE` and ``FV`` trial discretization objects.\n\n ")}, {Py_tp_traverse, (void *)__pyx_tp_traverse_8petsc4py_5PETSc_Object}, {Py_tp_clear, (void *)__pyx_tp_clear_8petsc4py_5PETSc_Object}, {Py_tp_methods, (void *)__pyx_methods_8petsc4py_5PETSc_DMPlex}, {Py_tp_new, (void *)__pyx_tp_new_8petsc4py_5PETSc_DMPlex}, {0, 0}, }; static PyType_Spec __pyx_type_8petsc4py_5PETSc_DMPlex_spec = { "petsc4py.PETSc.DMPlex", sizeof(struct __pyx_obj_8petsc4py_5PETSc_DMPlex), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, __pyx_type_8petsc4py_5PETSc_DMPlex_slots, }; #else static PyTypeObject __pyx_type_8petsc4py_5PETSc_DMPlex = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.""DMPlex", /*tp_name*/ sizeof(struct __pyx_obj_8petsc4py_5PETSc_DMPlex), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Object, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ PyDoc_STR("Encapsulate an unstructured mesh.\n\n DMPlex encapsulates both topology and geometry. It is capable of parallel refinement and coarsening (using Pragmatic or ParMmg) and parallel redistribution for load balancing. It is designed to interface with the `FE` and ``FV`` trial discretization objects.\n\n "), /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc_Object, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc_Object, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_DMPlex, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_DMPlex, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static struct __pyx_vtabstruct_8petsc4py_5PETSc_DMStag __pyx_vtable_8petsc4py_5PETSc_DMStag; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_DMStag(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_8petsc4py_5PETSc_DMStag *p; PyObject *o = __pyx_tp_new_8petsc4py_5PETSc_DM(t, a, k); if (unlikely(!o)) return 0; p = ((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)o); p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Object*)__pyx_vtabptr_8petsc4py_5PETSc_DMStag; return o; } static PyObject *__pyx_getprop_8petsc4py_5PETSc_6DMStag_dim(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_6DMStag_3dim_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_6DMStag_dofs(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_6DMStag_4dofs_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_6DMStag_entries_per_element(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_6DMStag_19entries_per_element_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_6DMStag_global_sizes(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_6DMStag_12global_sizes_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_6DMStag_local_sizes(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_6DMStag_11local_sizes_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_6DMStag_proc_sizes(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_6DMStag_10proc_sizes_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_6DMStag_boundary_types(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_6DMStag_14boundary_types_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_6DMStag_stencil_type(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_6DMStag_12stencil_type_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_6DMStag_stencil_width(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_6DMStag_13stencil_width_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_6DMStag_corners(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_6DMStag_7corners_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_6DMStag_ghost_corners(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_6DMStag_13ghost_corners_1__get__(o); } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_DMStag[] = { {"create", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_1create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_create}, {"setStencilWidth", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_3setStencilWidth, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_2setStencilWidth}, {"setStencilType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_5setStencilType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_4setStencilType}, {"setBoundaryTypes", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_7setBoundaryTypes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_6setBoundaryTypes}, {"setDof", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_9setDof, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_8setDof}, {"setGlobalSizes", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_11setGlobalSizes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_10setGlobalSizes}, {"setProcSizes", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_13setProcSizes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_12setProcSizes}, {"setOwnershipRanges", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_15setOwnershipRanges, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_14setOwnershipRanges}, {"getDim", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_17getDim, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_16getDim}, {"getEntriesPerElement", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_19getEntriesPerElement, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_18getEntriesPerElement}, {"getStencilWidth", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_21getStencilWidth, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_20getStencilWidth}, {"getDof", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_23getDof, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_22getDof}, {"getCorners", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_25getCorners, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_24getCorners}, {"getGhostCorners", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_27getGhostCorners, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_26getGhostCorners}, {"getLocalSizes", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_29getLocalSizes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_28getLocalSizes}, {"getGlobalSizes", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_31getGlobalSizes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_30getGlobalSizes}, {"getProcSizes", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_33getProcSizes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_32getProcSizes}, {"getStencilType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_35getStencilType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_34getStencilType}, {"getOwnershipRanges", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_37getOwnershipRanges, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_36getOwnershipRanges}, {"getBoundaryTypes", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_39getBoundaryTypes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_38getBoundaryTypes}, {"getIsFirstRank", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_41getIsFirstRank, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_40getIsFirstRank}, {"getIsLastRank", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_43getIsLastRank, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_42getIsLastRank}, {"setUniformCoordinatesExplicit", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_45setUniformCoordinatesExplicit, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_44setUniformCoordinatesExplicit}, {"setUniformCoordinatesProduct", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_47setUniformCoordinatesProduct, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_46setUniformCoordinatesProduct}, {"setUniformCoordinates", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_49setUniformCoordinates, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_48setUniformCoordinates}, {"setCoordinateDMType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_51setCoordinateDMType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_50setCoordinateDMType}, {"getLocationSlot", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_53getLocationSlot, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_52getLocationSlot}, {"getProductCoordinateLocationSlot", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_55getProductCoordinateLocationSlot, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_54getProductCoordinateLocationSlot}, {"getLocationDof", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_57getLocationDof, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_56getLocationDof}, {"migrateVec", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_59migrateVec, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_58migrateVec}, {"createCompatibleDMStag", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_61createCompatibleDMStag, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_60createCompatibleDMStag}, {"VecSplitToDMDA", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_63VecSplitToDMDA, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_62VecSplitToDMDA}, {"getVecArray", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_65getVecArray, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_64getVecArray}, {"get1dCoordinatecArrays", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_67get1dCoordinatecArrays, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_66get1dCoordinatecArrays}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_8petsc4py_5PETSc_DMStag[] = { {(char *)"dim", __pyx_getprop_8petsc4py_5PETSc_6DMStag_dim, 0, (char *)PyDoc_STR("DMStag.dim: int\nThe dimension.\nSource code at petsc4py/PETSc/DMStag.pyx:838"), 0}, {(char *)"dofs", __pyx_getprop_8petsc4py_5PETSc_6DMStag_dofs, 0, (char *)PyDoc_STR("DMStag.dofs: tuple[int, ...]\nThe number of DOFs associated with each stratum of the grid.\nSource code at petsc4py/PETSc/DMStag.pyx:843"), 0}, {(char *)"entries_per_element", __pyx_getprop_8petsc4py_5PETSc_6DMStag_entries_per_element, 0, (char *)PyDoc_STR("DMStag.entries_per_element: int\nThe number of entries per element in the local representation.\nSource code at petsc4py/PETSc/DMStag.pyx:848"), 0}, {(char *)"global_sizes", __pyx_getprop_8petsc4py_5PETSc_6DMStag_global_sizes, 0, (char *)PyDoc_STR("DMStag.global_sizes: tuple[int, ...]\nGlobal element counts in each dimension.\nSource code at petsc4py/PETSc/DMStag.pyx:853"), 0}, {(char *)"local_sizes", __pyx_getprop_8petsc4py_5PETSc_6DMStag_local_sizes, 0, (char *)PyDoc_STR("DMStag.local_sizes: tuple[int, ...]\nLocal elementwise sizes in each dimension.\nSource code at petsc4py/PETSc/DMStag.pyx:858"), 0}, {(char *)"proc_sizes", __pyx_getprop_8petsc4py_5PETSc_6DMStag_proc_sizes, 0, (char *)PyDoc_STR("DMStag.proc_sizes: tuple[int, ...]\nThe number of processes in each dimension in the global decomposition.\nSource code at petsc4py/PETSc/DMStag.pyx:863"), 0}, {(char *)"boundary_types", __pyx_getprop_8petsc4py_5PETSc_6DMStag_boundary_types, 0, (char *)PyDoc_STR("DMStag.boundary_types: tuple[str, ...]\nBoundary types in each dimension.\nSource code at petsc4py/PETSc/DMStag.pyx:868"), 0}, {(char *)"stencil_type", __pyx_getprop_8petsc4py_5PETSc_6DMStag_stencil_type, 0, (char *)PyDoc_STR("DMStag.stencil_type: str\nStencil type.\nSource code at petsc4py/PETSc/DMStag.pyx:873"), 0}, {(char *)"stencil_width", __pyx_getprop_8petsc4py_5PETSc_6DMStag_stencil_width, 0, (char *)PyDoc_STR("DMStag.stencil_width: int\nElementwise stencil width.\nSource code at petsc4py/PETSc/DMStag.pyx:878"), 0}, {(char *)"corners", __pyx_getprop_8petsc4py_5PETSc_6DMStag_corners, 0, (char *)PyDoc_STR("DMStag.corners: tuple[tuple[int, ...], tuple[int, ...]]\nThe lower left corner and size of local region in each dimension.\nSource code at petsc4py/PETSc/DMStag.pyx:883"), 0}, {(char *)"ghost_corners", __pyx_getprop_8petsc4py_5PETSc_6DMStag_ghost_corners, 0, (char *)PyDoc_STR("DMStag.ghost_corners: tuple[tuple[int, ...], tuple[int, ...]]\nThe lower left corner and size of local region in each dimension.\nSource code at petsc4py/PETSc/DMStag.pyx:888"), 0}, {0, 0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_8petsc4py_5PETSc_DMStag_slots[] = { {Py_tp_doc, (void *)PyDoc_STR("A DM object representing a \"staggered grid\" or a structured cell complex.")}, {Py_tp_traverse, (void *)__pyx_tp_traverse_8petsc4py_5PETSc_Object}, {Py_tp_clear, (void *)__pyx_tp_clear_8petsc4py_5PETSc_Object}, {Py_tp_methods, (void *)__pyx_methods_8petsc4py_5PETSc_DMStag}, {Py_tp_getset, (void *)__pyx_getsets_8petsc4py_5PETSc_DMStag}, {Py_tp_new, (void *)__pyx_tp_new_8petsc4py_5PETSc_DMStag}, {0, 0}, }; static PyType_Spec __pyx_type_8petsc4py_5PETSc_DMStag_spec = { "petsc4py.PETSc.DMStag", sizeof(struct __pyx_obj_8petsc4py_5PETSc_DMStag), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, __pyx_type_8petsc4py_5PETSc_DMStag_slots, }; #else static PyTypeObject __pyx_type_8petsc4py_5PETSc_DMStag = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.""DMStag", /*tp_name*/ sizeof(struct __pyx_obj_8petsc4py_5PETSc_DMStag), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Object, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ PyDoc_STR("A DM object representing a \"staggered grid\" or a structured cell complex."), /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc_Object, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc_Object, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_DMStag, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_8petsc4py_5PETSc_DMStag, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_DMStag, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static struct __pyx_vtabstruct_8petsc4py_5PETSc_DMComposite __pyx_vtable_8petsc4py_5PETSc_DMComposite; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_DMComposite(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_8petsc4py_5PETSc_DMComposite *p; PyObject *o = __pyx_tp_new_8petsc4py_5PETSc_DM(t, a, k); if (unlikely(!o)) return 0; p = ((struct __pyx_obj_8petsc4py_5PETSc_DMComposite *)o); p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Object*)__pyx_vtabptr_8petsc4py_5PETSc_DMComposite; return o; } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_DMComposite[] = { {"create", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_11DMComposite_1create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11DMComposite_create}, {"addDM", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_11DMComposite_3addDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11DMComposite_2addDM}, {"getNumber", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_11DMComposite_5getNumber, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11DMComposite_4getNumber}, {"getEntries", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_11DMComposite_7getEntries, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11DMComposite_6getEntries}, {"scatter", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_11DMComposite_9scatter, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11DMComposite_8scatter}, {"gather", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_11DMComposite_11gather, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11DMComposite_10gather}, {"getGlobalISs", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_11DMComposite_13getGlobalISs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11DMComposite_12getGlobalISs}, {"getLocalISs", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_11DMComposite_15getLocalISs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11DMComposite_14getLocalISs}, {"getLGMaps", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_11DMComposite_17getLGMaps, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11DMComposite_16getLGMaps}, {"getAccess", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_11DMComposite_19getAccess, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11DMComposite_18getAccess}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_8petsc4py_5PETSc_DMComposite_slots[] = { {Py_tp_doc, (void *)PyDoc_STR("A DM object that is used to manage data for a collection of DMs.")}, {Py_tp_traverse, (void *)__pyx_tp_traverse_8petsc4py_5PETSc_Object}, {Py_tp_clear, (void *)__pyx_tp_clear_8petsc4py_5PETSc_Object}, {Py_tp_methods, (void *)__pyx_methods_8petsc4py_5PETSc_DMComposite}, {Py_tp_new, (void *)__pyx_tp_new_8petsc4py_5PETSc_DMComposite}, {0, 0}, }; static PyType_Spec __pyx_type_8petsc4py_5PETSc_DMComposite_spec = { "petsc4py.PETSc.DMComposite", sizeof(struct __pyx_obj_8petsc4py_5PETSc_DMComposite), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, __pyx_type_8petsc4py_5PETSc_DMComposite_slots, }; #else static PyTypeObject __pyx_type_8petsc4py_5PETSc_DMComposite = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.""DMComposite", /*tp_name*/ sizeof(struct __pyx_obj_8petsc4py_5PETSc_DMComposite), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Object, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ PyDoc_STR("A DM object that is used to manage data for a collection of DMs."), /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc_Object, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc_Object, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_DMComposite, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_DMComposite, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static struct __pyx_vtabstruct_8petsc4py_5PETSc_DMShell __pyx_vtable_8petsc4py_5PETSc_DMShell; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_DMShell(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_8petsc4py_5PETSc_DMShell *p; PyObject *o = __pyx_tp_new_8petsc4py_5PETSc_DM(t, a, k); if (unlikely(!o)) return 0; p = ((struct __pyx_obj_8petsc4py_5PETSc_DMShell *)o); p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Object*)__pyx_vtabptr_8petsc4py_5PETSc_DMShell; return o; } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_DMShell[] = { {"create", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_1create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_create}, {"setMatrix", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_3setMatrix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_2setMatrix}, {"setGlobalVector", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_5setGlobalVector, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_4setGlobalVector}, {"setLocalVector", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_7setLocalVector, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_6setLocalVector}, {"setCreateGlobalVector", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_9setCreateGlobalVector, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_8setCreateGlobalVector}, {"setCreateLocalVector", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_11setCreateLocalVector, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_10setCreateLocalVector}, {"setGlobalToLocal", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_13setGlobalToLocal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_12setGlobalToLocal}, {"setGlobalToLocalVecScatter", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_15setGlobalToLocalVecScatter, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_14setGlobalToLocalVecScatter}, {"setLocalToGlobal", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_17setLocalToGlobal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_16setLocalToGlobal}, {"setLocalToGlobalVecScatter", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_19setLocalToGlobalVecScatter, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_18setLocalToGlobalVecScatter}, {"setLocalToLocal", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_21setLocalToLocal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_20setLocalToLocal}, {"setLocalToLocalVecScatter", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_23setLocalToLocalVecScatter, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_22setLocalToLocalVecScatter}, {"setCreateMatrix", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_25setCreateMatrix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_24setCreateMatrix}, {"setCoarsen", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_27setCoarsen, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_26setCoarsen}, {"setRefine", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_29setRefine, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_28setRefine}, {"setCreateInterpolation", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_31setCreateInterpolation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_30setCreateInterpolation}, {"setCreateInjection", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_33setCreateInjection, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_32setCreateInjection}, {"setCreateRestriction", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_35setCreateRestriction, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_34setCreateRestriction}, {"setCreateFieldDecomposition", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_37setCreateFieldDecomposition, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_36setCreateFieldDecomposition}, {"setCreateDomainDecomposition", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_39setCreateDomainDecomposition, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_38setCreateDomainDecomposition}, {"setCreateDomainDecompositionScatters", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_41setCreateDomainDecompositionScatters, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_40setCreateDomainDecompositionScatters}, {"setCreateSubDM", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_43setCreateSubDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_42setCreateSubDM}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_8petsc4py_5PETSc_DMShell_slots[] = { {Py_tp_doc, (void *)PyDoc_STR("A shell DM object, used to manage user-defined problem data.")}, {Py_tp_traverse, (void *)__pyx_tp_traverse_8petsc4py_5PETSc_Object}, {Py_tp_clear, (void *)__pyx_tp_clear_8petsc4py_5PETSc_Object}, {Py_tp_methods, (void *)__pyx_methods_8petsc4py_5PETSc_DMShell}, {Py_tp_new, (void *)__pyx_tp_new_8petsc4py_5PETSc_DMShell}, {0, 0}, }; static PyType_Spec __pyx_type_8petsc4py_5PETSc_DMShell_spec = { "petsc4py.PETSc.DMShell", sizeof(struct __pyx_obj_8petsc4py_5PETSc_DMShell), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, __pyx_type_8petsc4py_5PETSc_DMShell_slots, }; #else static PyTypeObject __pyx_type_8petsc4py_5PETSc_DMShell = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.""DMShell", /*tp_name*/ sizeof(struct __pyx_obj_8petsc4py_5PETSc_DMShell), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Object, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ PyDoc_STR("A shell DM object, used to manage user-defined problem data."), /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc_Object, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc_Object, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_DMShell, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_DMShell, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static struct __pyx_vtabstruct_8petsc4py_5PETSc_DMSwarm __pyx_vtable_8petsc4py_5PETSc_DMSwarm; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_DMSwarm(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *p; PyObject *o = __pyx_tp_new_8petsc4py_5PETSc_DM(t, a, k); if (unlikely(!o)) return 0; p = ((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)o); p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Object*)__pyx_vtabptr_8petsc4py_5PETSc_DMSwarm; return o; } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_DMSwarm[] = { {"create", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_1create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_create}, {"createGlobalVectorFromField", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_3createGlobalVectorFromField, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_2createGlobalVectorFromField}, {"destroyGlobalVectorFromField", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_5destroyGlobalVectorFromField, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_4destroyGlobalVectorFromField}, {"createLocalVectorFromField", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_7createLocalVectorFromField, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_6createLocalVectorFromField}, {"destroyLocalVectorFromField", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_9destroyLocalVectorFromField, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_8destroyLocalVectorFromField}, {"initializeFieldRegister", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_11initializeFieldRegister, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_10initializeFieldRegister}, {"finalizeFieldRegister", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_13finalizeFieldRegister, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_12finalizeFieldRegister}, {"setLocalSizes", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_15setLocalSizes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_14setLocalSizes}, {"registerField", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_17registerField, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_16registerField}, {"getField", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_19getField, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_18getField}, {"restoreField", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_21restoreField, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_20restoreField}, {"vectorDefineField", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_23vectorDefineField, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_22vectorDefineField}, {"addPoint", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_25addPoint, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_24addPoint}, {"addNPoints", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_27addNPoints, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_26addNPoints}, {"removePoint", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_29removePoint, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_28removePoint}, {"removePointAtIndex", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_31removePointAtIndex, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_30removePointAtIndex}, {"copyPoint", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_33copyPoint, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_32copyPoint}, {"getLocalSize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_35getLocalSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_34getLocalSize}, {"getSize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_37getSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_36getSize}, {"migrate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_39migrate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_38migrate}, {"collectViewCreate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_41collectViewCreate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_40collectViewCreate}, {"collectViewDestroy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_43collectViewDestroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_42collectViewDestroy}, {"setCellDM", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_45setCellDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_44setCellDM}, {"getCellDM", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_47getCellDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_46getCellDM}, {"setType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_49setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_48setType}, {"setPointsUniformCoordinates", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_51setPointsUniformCoordinates, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_50setPointsUniformCoordinates}, {"setPointCoordinates", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_53setPointCoordinates, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_52setPointCoordinates}, {"insertPointUsingCellDM", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_55insertPointUsingCellDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_54insertPointUsingCellDM}, {"setPointCoordinatesCellwise", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_57setPointCoordinatesCellwise, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_56setPointCoordinatesCellwise}, {"viewFieldsXDMF", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_59viewFieldsXDMF, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_58viewFieldsXDMF}, {"viewXDMF", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_61viewXDMF, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_60viewXDMF}, {"sortGetAccess", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_63sortGetAccess, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_62sortGetAccess}, {"sortRestoreAccess", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_65sortRestoreAccess, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_64sortRestoreAccess}, {"sortGetPointsPerCell", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_67sortGetPointsPerCell, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_66sortGetPointsPerCell}, {"sortGetNumberOfPointsPerCell", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_69sortGetNumberOfPointsPerCell, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_68sortGetNumberOfPointsPerCell}, {"sortGetIsValid", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_71sortGetIsValid, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_70sortGetIsValid}, {"sortGetSizes", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_73sortGetSizes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_72sortGetSizes}, {"projectFields", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_75projectFields, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_74projectFields}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_8petsc4py_5PETSc_DMSwarm_slots[] = { {Py_tp_doc, (void *)PyDoc_STR("A `DM` object used to represent arrays of data (fields) of arbitrary type.")}, {Py_tp_traverse, (void *)__pyx_tp_traverse_8petsc4py_5PETSc_Object}, {Py_tp_clear, (void *)__pyx_tp_clear_8petsc4py_5PETSc_Object}, {Py_tp_methods, (void *)__pyx_methods_8petsc4py_5PETSc_DMSwarm}, {Py_tp_new, (void *)__pyx_tp_new_8petsc4py_5PETSc_DMSwarm}, {0, 0}, }; static PyType_Spec __pyx_type_8petsc4py_5PETSc_DMSwarm_spec = { "petsc4py.PETSc.DMSwarm", sizeof(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, __pyx_type_8petsc4py_5PETSc_DMSwarm_slots, }; #else static PyTypeObject __pyx_type_8petsc4py_5PETSc_DMSwarm = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.""DMSwarm", /*tp_name*/ sizeof(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Object, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ PyDoc_STR("A `DM` object used to represent arrays of data (fields) of arbitrary type."), /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc_Object, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc_Object, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_DMSwarm, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_DMSwarm, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static PyObject *__pyx_tp_new_8petsc4py_5PETSc_DMInterpolation(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; #endif if (unlikely(__pyx_pw_8petsc4py_5PETSc_15DMInterpolation_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_8petsc4py_5PETSc_DMInterpolation(PyObject *o) { #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_8petsc4py_5PETSc_DMInterpolation) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); __pyx_pw_8petsc4py_5PETSc_15DMInterpolation_3__dealloc__(o); __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); PyErr_Restore(etype, eval, etb); } #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_DMInterpolation[] = { {"create", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15DMInterpolation_5create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15DMInterpolation_4create}, {"destroy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15DMInterpolation_7destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15DMInterpolation_6destroy}, {"evaluate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15DMInterpolation_9evaluate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15DMInterpolation_8evaluate}, {"getCoordinates", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15DMInterpolation_11getCoordinates, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15DMInterpolation_10getCoordinates}, {"getDim", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15DMInterpolation_13getDim, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15DMInterpolation_12getDim}, {"getDof", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15DMInterpolation_15getDof, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15DMInterpolation_14getDof}, {"setDim", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15DMInterpolation_17setDim, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15DMInterpolation_16setDim}, {"setDof", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15DMInterpolation_19setDof, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15DMInterpolation_18setDof}, {"setUp", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15DMInterpolation_21setUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15DMInterpolation_20setUp}, {"getVector", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15DMInterpolation_23getVector, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15DMInterpolation_22getVector}, {"restoreVector", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15DMInterpolation_25restoreVector, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15DMInterpolation_24restoreVector}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_8petsc4py_5PETSc_DMInterpolation_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8petsc4py_5PETSc_DMInterpolation}, {Py_tp_doc, (void *)PyDoc_STR("Interpolation on a mesh.")}, {Py_tp_methods, (void *)__pyx_methods_8petsc4py_5PETSc_DMInterpolation}, {Py_tp_new, (void *)__pyx_tp_new_8petsc4py_5PETSc_DMInterpolation}, {0, 0}, }; static PyType_Spec __pyx_type_8petsc4py_5PETSc_DMInterpolation_spec = { "petsc4py.PETSc.DMInterpolation", sizeof(struct __pyx_obj_8petsc4py_5PETSc_DMInterpolation), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, __pyx_type_8petsc4py_5PETSc_DMInterpolation_slots, }; #else static PyTypeObject __pyx_type_8petsc4py_5PETSc_DMInterpolation = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.""DMInterpolation", /*tp_name*/ sizeof(struct __pyx_obj_8petsc4py_5PETSc_DMInterpolation), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_DMInterpolation, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ PyDoc_STR("Interpolation on a mesh."), /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_DMInterpolation, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_DMInterpolation, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static struct __pyx_vtabstruct_8petsc4py_5PETSc__PyObj __pyx_vtable_8petsc4py_5PETSc__PyObj; static PyObject *__pyx_tp_new_8petsc4py_5PETSc__PyObj(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_8petsc4py_5PETSc__PyObj *p; PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; #endif p = ((struct __pyx_obj_8petsc4py_5PETSc__PyObj *)o); p->__pyx_vtab = __pyx_vtabptr_8petsc4py_5PETSc__PyObj; p->self = Py_None; Py_INCREF(Py_None); p->name = ((PyObject*)Py_None); Py_INCREF(Py_None); return o; } static void __pyx_tp_dealloc_8petsc4py_5PETSc__PyObj(PyObject *o) { struct __pyx_obj_8petsc4py_5PETSc__PyObj *p = (struct __pyx_obj_8petsc4py_5PETSc__PyObj *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_8petsc4py_5PETSc__PyObj) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->self); Py_CLEAR(p->name); #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static int __pyx_tp_traverse_8petsc4py_5PETSc__PyObj(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_8petsc4py_5PETSc__PyObj *p = (struct __pyx_obj_8petsc4py_5PETSc__PyObj *)o; if (p->self) { e = (*v)(p->self, a); if (e) return e; } return 0; } static int __pyx_tp_clear_8petsc4py_5PETSc__PyObj(PyObject *o) { PyObject* tmp; struct __pyx_obj_8petsc4py_5PETSc__PyObj *p = (struct __pyx_obj_8petsc4py_5PETSc__PyObj *)o; tmp = ((PyObject*)p->self); p->self = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_tp_getattro_8petsc4py_5PETSc__PyObj(PyObject *o, PyObject *n) { PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n); if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); v = __pyx_pw_8petsc4py_5PETSc_6_PyObj_1__getattr__(o, n); } return v; } static PyMethodDef __pyx_methods_8petsc4py_5PETSc__PyObj[] = { {"__getattr__", (PyCFunction)__pyx_pw_8petsc4py_5PETSc_6_PyObj_1__getattr__, METH_O|METH_COEXIST, 0}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_8petsc4py_5PETSc__PyObj_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8petsc4py_5PETSc__PyObj}, {Py_tp_getattro, (void *)__pyx_tp_getattro_8petsc4py_5PETSc__PyObj}, {Py_tp_traverse, (void *)__pyx_tp_traverse_8petsc4py_5PETSc__PyObj}, {Py_tp_clear, (void *)__pyx_tp_clear_8petsc4py_5PETSc__PyObj}, {Py_tp_methods, (void *)__pyx_methods_8petsc4py_5PETSc__PyObj}, {Py_tp_new, (void *)__pyx_tp_new_8petsc4py_5PETSc__PyObj}, {0, 0}, }; static PyType_Spec __pyx_type_8petsc4py_5PETSc__PyObj_spec = { "petsc4py.PETSc._PyObj", sizeof(struct __pyx_obj_8petsc4py_5PETSc__PyObj), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, __pyx_type_8petsc4py_5PETSc__PyObj_slots, }; #else static PyTypeObject __pyx_type_8petsc4py_5PETSc__PyObj = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.""_PyObj", /*tp_name*/ sizeof(struct __pyx_obj_8petsc4py_5PETSc__PyObj), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc__PyObj, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ __pyx_tp_getattro_8petsc4py_5PETSc__PyObj, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc__PyObj, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc__PyObj, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc__PyObj, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc__PyObj, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static struct __pyx_vtabstruct_8petsc4py_5PETSc__PyMat __pyx_vtable_8petsc4py_5PETSc__PyMat; static PyObject *__pyx_tp_new_8petsc4py_5PETSc__PyMat(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_8petsc4py_5PETSc__PyMat *p; PyObject *o = __pyx_tp_new_8petsc4py_5PETSc__PyObj(t, a, k); if (unlikely(!o)) return 0; p = ((struct __pyx_obj_8petsc4py_5PETSc__PyMat *)o); p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc__PyObj*)__pyx_vtabptr_8petsc4py_5PETSc__PyMat; return o; } #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_8petsc4py_5PETSc__PyMat_slots[] = { {Py_tp_traverse, (void *)__pyx_tp_traverse_8petsc4py_5PETSc__PyObj}, {Py_tp_clear, (void *)__pyx_tp_clear_8petsc4py_5PETSc__PyObj}, {Py_tp_new, (void *)__pyx_tp_new_8petsc4py_5PETSc__PyMat}, {0, 0}, }; static PyType_Spec __pyx_type_8petsc4py_5PETSc__PyMat_spec = { "petsc4py.PETSc._PyMat", sizeof(struct __pyx_obj_8petsc4py_5PETSc__PyMat), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, __pyx_type_8petsc4py_5PETSc__PyMat_slots, }; #else static PyTypeObject __pyx_type_8petsc4py_5PETSc__PyMat = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.""_PyMat", /*tp_name*/ sizeof(struct __pyx_obj_8petsc4py_5PETSc__PyMat), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc__PyObj, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc__PyObj, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc__PyObj, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc__PyMat, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static struct __pyx_vtabstruct_8petsc4py_5PETSc__PyPC __pyx_vtable_8petsc4py_5PETSc__PyPC; static PyObject *__pyx_tp_new_8petsc4py_5PETSc__PyPC(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_8petsc4py_5PETSc__PyPC *p; PyObject *o = __pyx_tp_new_8petsc4py_5PETSc__PyObj(t, a, k); if (unlikely(!o)) return 0; p = ((struct __pyx_obj_8petsc4py_5PETSc__PyPC *)o); p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc__PyObj*)__pyx_vtabptr_8petsc4py_5PETSc__PyPC; return o; } #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_8petsc4py_5PETSc__PyPC_slots[] = { {Py_tp_traverse, (void *)__pyx_tp_traverse_8petsc4py_5PETSc__PyObj}, {Py_tp_clear, (void *)__pyx_tp_clear_8petsc4py_5PETSc__PyObj}, {Py_tp_new, (void *)__pyx_tp_new_8petsc4py_5PETSc__PyPC}, {0, 0}, }; static PyType_Spec __pyx_type_8petsc4py_5PETSc__PyPC_spec = { "petsc4py.PETSc._PyPC", sizeof(struct __pyx_obj_8petsc4py_5PETSc__PyPC), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, __pyx_type_8petsc4py_5PETSc__PyPC_slots, }; #else static PyTypeObject __pyx_type_8petsc4py_5PETSc__PyPC = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.""_PyPC", /*tp_name*/ sizeof(struct __pyx_obj_8petsc4py_5PETSc__PyPC), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc__PyObj, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc__PyObj, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc__PyObj, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc__PyPC, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static struct __pyx_vtabstruct_8petsc4py_5PETSc__PyKSP __pyx_vtable_8petsc4py_5PETSc__PyKSP; static PyObject *__pyx_tp_new_8petsc4py_5PETSc__PyKSP(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_8petsc4py_5PETSc__PyKSP *p; PyObject *o = __pyx_tp_new_8petsc4py_5PETSc__PyObj(t, a, k); if (unlikely(!o)) return 0; p = ((struct __pyx_obj_8petsc4py_5PETSc__PyKSP *)o); p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc__PyObj*)__pyx_vtabptr_8petsc4py_5PETSc__PyKSP; return o; } #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_8petsc4py_5PETSc__PyKSP_slots[] = { {Py_tp_traverse, (void *)__pyx_tp_traverse_8petsc4py_5PETSc__PyObj}, {Py_tp_clear, (void *)__pyx_tp_clear_8petsc4py_5PETSc__PyObj}, {Py_tp_new, (void *)__pyx_tp_new_8petsc4py_5PETSc__PyKSP}, {0, 0}, }; static PyType_Spec __pyx_type_8petsc4py_5PETSc__PyKSP_spec = { "petsc4py.PETSc._PyKSP", sizeof(struct __pyx_obj_8petsc4py_5PETSc__PyKSP), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, __pyx_type_8petsc4py_5PETSc__PyKSP_slots, }; #else static PyTypeObject __pyx_type_8petsc4py_5PETSc__PyKSP = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.""_PyKSP", /*tp_name*/ sizeof(struct __pyx_obj_8petsc4py_5PETSc__PyKSP), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc__PyObj, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc__PyObj, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc__PyObj, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc__PyKSP, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static struct __pyx_vtabstruct_8petsc4py_5PETSc__PySNES __pyx_vtable_8petsc4py_5PETSc__PySNES; static PyObject *__pyx_tp_new_8petsc4py_5PETSc__PySNES(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_8petsc4py_5PETSc__PySNES *p; PyObject *o = __pyx_tp_new_8petsc4py_5PETSc__PyObj(t, a, k); if (unlikely(!o)) return 0; p = ((struct __pyx_obj_8petsc4py_5PETSc__PySNES *)o); p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc__PyObj*)__pyx_vtabptr_8petsc4py_5PETSc__PySNES; return o; } #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_8petsc4py_5PETSc__PySNES_slots[] = { {Py_tp_traverse, (void *)__pyx_tp_traverse_8petsc4py_5PETSc__PyObj}, {Py_tp_clear, (void *)__pyx_tp_clear_8petsc4py_5PETSc__PyObj}, {Py_tp_new, (void *)__pyx_tp_new_8petsc4py_5PETSc__PySNES}, {0, 0}, }; static PyType_Spec __pyx_type_8petsc4py_5PETSc__PySNES_spec = { "petsc4py.PETSc._PySNES", sizeof(struct __pyx_obj_8petsc4py_5PETSc__PySNES), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, __pyx_type_8petsc4py_5PETSc__PySNES_slots, }; #else static PyTypeObject __pyx_type_8petsc4py_5PETSc__PySNES = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.""_PySNES", /*tp_name*/ sizeof(struct __pyx_obj_8petsc4py_5PETSc__PySNES), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc__PyObj, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc__PyObj, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc__PyObj, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc__PySNES, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static struct __pyx_vtabstruct_8petsc4py_5PETSc__PyTS __pyx_vtable_8petsc4py_5PETSc__PyTS; static PyObject *__pyx_tp_new_8petsc4py_5PETSc__PyTS(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_8petsc4py_5PETSc__PyTS *p; PyObject *o = __pyx_tp_new_8petsc4py_5PETSc__PyObj(t, a, k); if (unlikely(!o)) return 0; p = ((struct __pyx_obj_8petsc4py_5PETSc__PyTS *)o); p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc__PyObj*)__pyx_vtabptr_8petsc4py_5PETSc__PyTS; return o; } #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_8petsc4py_5PETSc__PyTS_slots[] = { {Py_tp_traverse, (void *)__pyx_tp_traverse_8petsc4py_5PETSc__PyObj}, {Py_tp_clear, (void *)__pyx_tp_clear_8petsc4py_5PETSc__PyObj}, {Py_tp_new, (void *)__pyx_tp_new_8petsc4py_5PETSc__PyTS}, {0, 0}, }; static PyType_Spec __pyx_type_8petsc4py_5PETSc__PyTS_spec = { "petsc4py.PETSc._PyTS", sizeof(struct __pyx_obj_8petsc4py_5PETSc__PyTS), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, __pyx_type_8petsc4py_5PETSc__PyTS_slots, }; #else static PyTypeObject __pyx_type_8petsc4py_5PETSc__PyTS = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.""_PyTS", /*tp_name*/ sizeof(struct __pyx_obj_8petsc4py_5PETSc__PyTS), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc__PyObj, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc__PyObj, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc__PyObj, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc__PyTS, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static struct __pyx_vtabstruct_8petsc4py_5PETSc__PyTao __pyx_vtable_8petsc4py_5PETSc__PyTao; static PyObject *__pyx_tp_new_8petsc4py_5PETSc__PyTao(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_8petsc4py_5PETSc__PyTao *p; PyObject *o = __pyx_tp_new_8petsc4py_5PETSc__PyObj(t, a, k); if (unlikely(!o)) return 0; p = ((struct __pyx_obj_8petsc4py_5PETSc__PyTao *)o); p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc__PyObj*)__pyx_vtabptr_8petsc4py_5PETSc__PyTao; return o; } #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_8petsc4py_5PETSc__PyTao_slots[] = { {Py_tp_traverse, (void *)__pyx_tp_traverse_8petsc4py_5PETSc__PyObj}, {Py_tp_clear, (void *)__pyx_tp_clear_8petsc4py_5PETSc__PyObj}, {Py_tp_new, (void *)__pyx_tp_new_8petsc4py_5PETSc__PyTao}, {0, 0}, }; static PyType_Spec __pyx_type_8petsc4py_5PETSc__PyTao_spec = { "petsc4py.PETSc._PyTao", sizeof(struct __pyx_obj_8petsc4py_5PETSc__PyTao), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, __pyx_type_8petsc4py_5PETSc__PyTao_slots, }; #else static PyTypeObject __pyx_type_8petsc4py_5PETSc__PyTao = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.""_PyTao", /*tp_name*/ sizeof(struct __pyx_obj_8petsc4py_5PETSc__PyTao), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc__PyObj, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc__PyObj, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc__PyObj, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc__PyTao, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator *__pyx_freelist_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator[8]; static int __pyx_freecount_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator = 0; static PyObject *__pyx_tp_new_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_COMPILING_IN_CPYTHON if (likely((int)(__pyx_freecount_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator)))) { o = (PyObject*)__pyx_freelist_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator[--__pyx_freecount_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator]; memset(o, 0, sizeof(struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else #endif { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } #endif return o; } static void __pyx_tp_dealloc_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator(PyObject *o) { struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator *p = (struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_cls); Py_CLEAR(p->__pyx_v_klass); Py_CLEAR(p->__pyx_v_name); #if CYTHON_COMPILING_IN_CPYTHON if (((int)(__pyx_freecount_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator)))) { __pyx_freelist_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator[__pyx_freecount_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator++] = ((struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator *)o); } else #endif { #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } } static int __pyx_tp_traverse_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator *p = (struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator *)o; if (p->__pyx_v_cls) { e = (*v)(((PyObject *)p->__pyx_v_cls), a); if (e) return e; } if (p->__pyx_v_klass) { e = (*v)(p->__pyx_v_klass, a); if (e) return e; } if (p->__pyx_v_name) { e = (*v)(p->__pyx_v_name, a); if (e) return e; } return 0; } static int __pyx_tp_clear_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator(PyObject *o) { PyObject* tmp; struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator *p = (struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator *)o; tmp = ((PyObject*)p->__pyx_v_cls); p->__pyx_v_cls = ((PyTypeObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->__pyx_v_klass); p->__pyx_v_klass = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->__pyx_v_name); p->__pyx_v_name = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator}, {Py_tp_traverse, (void *)__pyx_tp_traverse_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator}, {Py_tp_clear, (void *)__pyx_tp_clear_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator}, {Py_tp_new, (void *)__pyx_tp_new_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator}, {0, 0}, }; static PyType_Spec __pyx_type_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator_spec = { "petsc4py.PETSc.__pyx_scope_struct__EventDecorator", sizeof(struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, __pyx_type_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator_slots, }; #else static PyTypeObject __pyx_type_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.""__pyx_scope_struct__EventDecorator", /*tp_name*/ sizeof(struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct_1_decorator *__pyx_freelist_8petsc4py_5PETSc___pyx_scope_struct_1_decorator[8]; static int __pyx_freecount_8petsc4py_5PETSc___pyx_scope_struct_1_decorator = 0; static PyObject *__pyx_tp_new_8petsc4py_5PETSc___pyx_scope_struct_1_decorator(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_COMPILING_IN_CPYTHON if (likely((int)(__pyx_freecount_8petsc4py_5PETSc___pyx_scope_struct_1_decorator > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct_1_decorator)))) { o = (PyObject*)__pyx_freelist_8petsc4py_5PETSc___pyx_scope_struct_1_decorator[--__pyx_freecount_8petsc4py_5PETSc___pyx_scope_struct_1_decorator]; memset(o, 0, sizeof(struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct_1_decorator)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else #endif { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } #endif return o; } static void __pyx_tp_dealloc_8petsc4py_5PETSc___pyx_scope_struct_1_decorator(PyObject *o) { struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct_1_decorator *p = (struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct_1_decorator *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_8petsc4py_5PETSc___pyx_scope_struct_1_decorator) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_outer_scope); Py_CLEAR(p->__pyx_v_func); #if CYTHON_COMPILING_IN_CPYTHON if (((int)(__pyx_freecount_8petsc4py_5PETSc___pyx_scope_struct_1_decorator < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct_1_decorator)))) { __pyx_freelist_8petsc4py_5PETSc___pyx_scope_struct_1_decorator[__pyx_freecount_8petsc4py_5PETSc___pyx_scope_struct_1_decorator++] = ((struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct_1_decorator *)o); } else #endif { #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } } static int __pyx_tp_traverse_8petsc4py_5PETSc___pyx_scope_struct_1_decorator(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct_1_decorator *p = (struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct_1_decorator *)o; if (p->__pyx_outer_scope) { e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; } if (p->__pyx_v_func) { e = (*v)(p->__pyx_v_func, a); if (e) return e; } return 0; } static int __pyx_tp_clear_8petsc4py_5PETSc___pyx_scope_struct_1_decorator(PyObject *o) { PyObject* tmp; struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct_1_decorator *p = (struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct_1_decorator *)o; tmp = ((PyObject*)p->__pyx_outer_scope); p->__pyx_outer_scope = ((struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->__pyx_v_func); p->__pyx_v_func = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_8petsc4py_5PETSc___pyx_scope_struct_1_decorator_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8petsc4py_5PETSc___pyx_scope_struct_1_decorator}, {Py_tp_traverse, (void *)__pyx_tp_traverse_8petsc4py_5PETSc___pyx_scope_struct_1_decorator}, {Py_tp_clear, (void *)__pyx_tp_clear_8petsc4py_5PETSc___pyx_scope_struct_1_decorator}, {Py_tp_new, (void *)__pyx_tp_new_8petsc4py_5PETSc___pyx_scope_struct_1_decorator}, {0, 0}, }; static PyType_Spec __pyx_type_8petsc4py_5PETSc___pyx_scope_struct_1_decorator_spec = { "petsc4py.PETSc.__pyx_scope_struct_1_decorator", sizeof(struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct_1_decorator), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, __pyx_type_8petsc4py_5PETSc___pyx_scope_struct_1_decorator_slots, }; #else static PyTypeObject __pyx_type_8petsc4py_5PETSc___pyx_scope_struct_1_decorator = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.""__pyx_scope_struct_1_decorator", /*tp_name*/ sizeof(struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct_1_decorator), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc___pyx_scope_struct_1_decorator, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc___pyx_scope_struct_1_decorator, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc___pyx_scope_struct_1_decorator, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc___pyx_scope_struct_1_decorator, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static struct __pyx_vtabstruct_array __pyx_vtable_array; static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_array_obj *p; PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; #endif p = ((struct __pyx_array_obj *)o); p->__pyx_vtab = __pyx_vtabptr_array; p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None); p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None); if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_array(PyObject *o) { struct __pyx_array_obj *p = (struct __pyx_array_obj *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_array) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); __pyx_array___dealloc__(o); __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); PyErr_Restore(etype, eval, etb); } Py_CLEAR(p->mode); Py_CLEAR(p->_format); #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) { PyObject *r; PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); Py_DECREF(x); return r; } static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) { if (v) { return __pyx_array___setitem__(o, i, v); } else { __Pyx_TypeName o_type_name; o_type_name = __Pyx_PyType_GetName(Py_TYPE(o)); PyErr_Format(PyExc_NotImplementedError, "Subscript deletion not supported by " __Pyx_FMT_TYPENAME, o_type_name); __Pyx_DECREF_TypeName(o_type_name); return -1; } } static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) { PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n); if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); v = __pyx_array___getattr__(o, n); } return v; } static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o); } static PyMethodDef __pyx_methods_array[] = { {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0}, {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_array_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_array_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_array[] = { {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0}, {0, 0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS #if !CYTHON_COMPILING_IN_LIMITED_API static PyBufferProcs __pyx_tp_as_buffer_array = { #if PY_MAJOR_VERSION < 3 0, /*bf_getreadbuffer*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getwritebuffer*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getsegcount*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getcharbuffer*/ #endif __pyx_array_getbuffer, /*bf_getbuffer*/ 0, /*bf_releasebuffer*/ }; #endif static PyType_Slot __pyx_type___pyx_array_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_array}, {Py_sq_length, (void *)__pyx_array___len__}, {Py_sq_item, (void *)__pyx_sq_item_array}, {Py_mp_length, (void *)__pyx_array___len__}, {Py_mp_subscript, (void *)__pyx_array___getitem__}, {Py_mp_ass_subscript, (void *)__pyx_mp_ass_subscript_array}, {Py_tp_getattro, (void *)__pyx_tp_getattro_array}, #if defined(Py_bf_getbuffer) {Py_bf_getbuffer, (void *)__pyx_array_getbuffer}, #endif {Py_tp_methods, (void *)__pyx_methods_array}, {Py_tp_getset, (void *)__pyx_getsets_array}, {Py_tp_new, (void *)__pyx_tp_new_array}, {0, 0}, }; static PyType_Spec __pyx_type___pyx_array_spec = { "petsc4py.PETSc.array", sizeof(struct __pyx_array_obj), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_SEQUENCE, __pyx_type___pyx_array_slots, }; #else static PySequenceMethods __pyx_tp_as_sequence_array = { __pyx_array___len__, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ __pyx_sq_item_array, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ 0, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; static PyMappingMethods __pyx_tp_as_mapping_array = { __pyx_array___len__, /*mp_length*/ __pyx_array___getitem__, /*mp_subscript*/ __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/ }; static PyBufferProcs __pyx_tp_as_buffer_array = { #if PY_MAJOR_VERSION < 3 0, /*bf_getreadbuffer*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getwritebuffer*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getsegcount*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getcharbuffer*/ #endif __pyx_array_getbuffer, /*bf_getbuffer*/ 0, /*bf_releasebuffer*/ }; static PyTypeObject __pyx_type___pyx_array = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.""array", /*tp_name*/ sizeof(struct __pyx_array_obj), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_array, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ &__pyx_tp_as_sequence_array, /*tp_as_sequence*/ &__pyx_tp_as_mapping_array, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ __pyx_tp_getattro_array, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer_array, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_SEQUENCE, /*tp_flags*/ 0, /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_array, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_array, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_array, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_MemviewEnum_obj *p; PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; #endif p = ((struct __pyx_MemviewEnum_obj *)o); p->name = Py_None; Py_INCREF(Py_None); return o; } static void __pyx_tp_dealloc_Enum(PyObject *o) { struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_Enum) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->name); #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) { int e; struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o; if (p->name) { e = (*v)(p->name, a); if (e) return e; } return 0; } static int __pyx_tp_clear_Enum(PyObject *o) { PyObject* tmp; struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o; tmp = ((PyObject*)p->name); p->name = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_specialmethod___pyx_MemviewEnum___repr__(PyObject *self, CYTHON_UNUSED PyObject *arg) { return __pyx_MemviewEnum___repr__(self); } static PyMethodDef __pyx_methods_Enum[] = { {"__repr__", (PyCFunction)__pyx_specialmethod___pyx_MemviewEnum___repr__, METH_NOARGS|METH_COEXIST, 0}, {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type___pyx_MemviewEnum_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_Enum}, {Py_tp_repr, (void *)__pyx_MemviewEnum___repr__}, {Py_tp_traverse, (void *)__pyx_tp_traverse_Enum}, {Py_tp_clear, (void *)__pyx_tp_clear_Enum}, {Py_tp_methods, (void *)__pyx_methods_Enum}, {Py_tp_init, (void *)__pyx_MemviewEnum___init__}, {Py_tp_new, (void *)__pyx_tp_new_Enum}, {0, 0}, }; static PyType_Spec __pyx_type___pyx_MemviewEnum_spec = { "petsc4py.PETSc.Enum", sizeof(struct __pyx_MemviewEnum_obj), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, __pyx_type___pyx_MemviewEnum_slots, }; #else static PyTypeObject __pyx_type___pyx_MemviewEnum = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.""Enum", /*tp_name*/ sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_Enum, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif __pyx_MemviewEnum___repr__, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_Enum, /*tp_traverse*/ __pyx_tp_clear_Enum, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_Enum, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif __pyx_MemviewEnum___init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_Enum, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview; static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_memoryview_obj *p; PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; #endif p = ((struct __pyx_memoryview_obj *)o); p->__pyx_vtab = __pyx_vtabptr_memoryview; p->obj = Py_None; Py_INCREF(Py_None); p->_size = Py_None; Py_INCREF(Py_None); p->_array_interface = Py_None; Py_INCREF(Py_None); p->view.obj = NULL; if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_memoryview(PyObject *o) { struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_memoryview) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); __pyx_memoryview___dealloc__(o); __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); PyErr_Restore(etype, eval, etb); } Py_CLEAR(p->obj); Py_CLEAR(p->_size); Py_CLEAR(p->_array_interface); #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) { int e; struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o; if (p->obj) { e = (*v)(p->obj, a); if (e) return e; } if (p->_size) { e = (*v)(p->_size, a); if (e) return e; } if (p->_array_interface) { e = (*v)(p->_array_interface, a); if (e) return e; } if (p->view.obj) { e = (*v)(p->view.obj, a); if (e) return e; } return 0; } static int __pyx_tp_clear_memoryview(PyObject *o) { PyObject* tmp; struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o; tmp = ((PyObject*)p->obj); p->obj = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_size); p->_size = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_array_interface); p->_array_interface = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); Py_CLEAR(p->view.obj); return 0; } static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) { PyObject *r; PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); Py_DECREF(x); return r; } static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) { if (v) { return __pyx_memoryview___setitem__(o, i, v); } else { __Pyx_TypeName o_type_name; o_type_name = __Pyx_PyType_GetName(Py_TYPE(o)); PyErr_Format(PyExc_NotImplementedError, "Subscript deletion not supported by " __Pyx_FMT_TYPENAME, o_type_name); __Pyx_DECREF_TypeName(o_type_name); return -1; } } static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o); } static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o); } static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o); } static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o); } static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o); } static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o); } static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o); } static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o); } static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o); } static PyObject *__pyx_specialmethod___pyx_memoryview___repr__(PyObject *self, CYTHON_UNUSED PyObject *arg) { return __pyx_memoryview___repr__(self); } static PyMethodDef __pyx_methods_memoryview[] = { {"__repr__", (PyCFunction)__pyx_specialmethod___pyx_memoryview___repr__, METH_NOARGS|METH_COEXIST, 0}, {"is_c_contig", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_is_c_contig, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"is_f_contig", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_is_f_contig, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"copy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"copy_fortran", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_copy_fortran, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryview_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryview_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_memoryview[] = { {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0}, {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0}, {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0}, {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0}, {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0}, {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0}, {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0}, {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0}, {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0}, {0, 0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS #if !CYTHON_COMPILING_IN_LIMITED_API static PyBufferProcs __pyx_tp_as_buffer_memoryview = { #if PY_MAJOR_VERSION < 3 0, /*bf_getreadbuffer*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getwritebuffer*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getsegcount*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getcharbuffer*/ #endif __pyx_memoryview_getbuffer, /*bf_getbuffer*/ 0, /*bf_releasebuffer*/ }; #endif static PyType_Slot __pyx_type___pyx_memoryview_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_memoryview}, {Py_tp_repr, (void *)__pyx_memoryview___repr__}, {Py_sq_length, (void *)__pyx_memoryview___len__}, {Py_sq_item, (void *)__pyx_sq_item_memoryview}, {Py_mp_length, (void *)__pyx_memoryview___len__}, {Py_mp_subscript, (void *)__pyx_memoryview___getitem__}, {Py_mp_ass_subscript, (void *)__pyx_mp_ass_subscript_memoryview}, {Py_tp_str, (void *)__pyx_memoryview___str__}, #if defined(Py_bf_getbuffer) {Py_bf_getbuffer, (void *)__pyx_memoryview_getbuffer}, #endif {Py_tp_traverse, (void *)__pyx_tp_traverse_memoryview}, {Py_tp_clear, (void *)__pyx_tp_clear_memoryview}, {Py_tp_methods, (void *)__pyx_methods_memoryview}, {Py_tp_getset, (void *)__pyx_getsets_memoryview}, {Py_tp_new, (void *)__pyx_tp_new_memoryview}, {0, 0}, }; static PyType_Spec __pyx_type___pyx_memoryview_spec = { "petsc4py.PETSc.memoryview", sizeof(struct __pyx_memoryview_obj), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, __pyx_type___pyx_memoryview_slots, }; #else static PySequenceMethods __pyx_tp_as_sequence_memoryview = { __pyx_memoryview___len__, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ __pyx_sq_item_memoryview, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ 0, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; static PyMappingMethods __pyx_tp_as_mapping_memoryview = { __pyx_memoryview___len__, /*mp_length*/ __pyx_memoryview___getitem__, /*mp_subscript*/ __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/ }; static PyBufferProcs __pyx_tp_as_buffer_memoryview = { #if PY_MAJOR_VERSION < 3 0, /*bf_getreadbuffer*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getwritebuffer*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getsegcount*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getcharbuffer*/ #endif __pyx_memoryview_getbuffer, /*bf_getbuffer*/ 0, /*bf_releasebuffer*/ }; static PyTypeObject __pyx_type___pyx_memoryview = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.""memoryview", /*tp_name*/ sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_memoryview, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif __pyx_memoryview___repr__, /*tp_repr*/ 0, /*tp_as_number*/ &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/ &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ __pyx_memoryview___str__, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_memoryview, /*tp_traverse*/ __pyx_tp_clear_memoryview, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_memoryview, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_memoryview, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_memoryview, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice; static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_memoryviewslice_obj *p; PyObject *o = __pyx_tp_new_memoryview(t, a, k); if (unlikely(!o)) return 0; p = ((struct __pyx_memoryviewslice_obj *)o); p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice; p->from_object = Py_None; Py_INCREF(Py_None); p->from_slice.memview = NULL; return o; } static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) { struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc__memoryviewslice) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); __pyx_memoryviewslice___dealloc__(o); __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); PyErr_Restore(etype, eval, etb); } Py_CLEAR(p->from_object); PyObject_GC_Track(o); __pyx_tp_dealloc_memoryview(o); } static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) { int e; struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o; e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e; if (p->from_object) { e = (*v)(p->from_object, a); if (e) return e; } return 0; } static int __pyx_tp_clear__memoryviewslice(PyObject *o) { PyObject* tmp; struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o; __pyx_tp_clear_memoryview(o); tmp = ((PyObject*)p->from_object); p->from_object = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); __PYX_XCLEAR_MEMVIEW(&p->from_slice, 1); return 0; } static PyMethodDef __pyx_methods__memoryviewslice[] = { {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type___pyx_memoryviewslice_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc__memoryviewslice}, {Py_tp_doc, (void *)PyDoc_STR("Internal class for passing memoryview slices to Python")}, {Py_tp_traverse, (void *)__pyx_tp_traverse__memoryviewslice}, {Py_tp_clear, (void *)__pyx_tp_clear__memoryviewslice}, {Py_tp_methods, (void *)__pyx_methods__memoryviewslice}, {Py_tp_new, (void *)__pyx_tp_new__memoryviewslice}, {0, 0}, }; static PyType_Spec __pyx_type___pyx_memoryviewslice_spec = { "petsc4py.PETSc._memoryviewslice", sizeof(struct __pyx_memoryviewslice_obj), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_SEQUENCE, __pyx_type___pyx_memoryviewslice_slots, }; #else static PyTypeObject __pyx_type___pyx_memoryviewslice = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.""_memoryviewslice", /*tp_name*/ sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif #if CYTHON_COMPILING_IN_PYPY || 0 __pyx_memoryview___repr__, /*tp_repr*/ #else 0, /*tp_repr*/ #endif 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ #if CYTHON_COMPILING_IN_PYPY || 0 __pyx_memoryview___str__, /*tp_str*/ #else 0, /*tp_str*/ #endif 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_SEQUENCE, /*tp_flags*/ PyDoc_STR("Internal class for passing memoryview slices to Python"), /*tp_doc*/ __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/ __pyx_tp_clear__memoryviewslice, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods__memoryviewslice, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new__memoryviewslice, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif #endif /* #### Code section: pystring_table ### */ static int __Pyx_CreateStringTabAndInitStrings(void) { __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_u_, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0}, {&__pyx_n_s_A, __pyx_k_A, sizeof(__pyx_k_A), 0, 0, 1, 1}, {&__pyx_n_s_A11, __pyx_k_A11, sizeof(__pyx_k_A11), 0, 0, 1, 1}, {&__pyx_n_s_AB, __pyx_k_AB, sizeof(__pyx_k_AB), 0, 0, 1, 1}, {&__pyx_n_s_ABC, __pyx_k_ABC, sizeof(__pyx_k_ABC), 0, 0, 1, 1}, {&__pyx_n_s_ABt, __pyx_k_ABt, sizeof(__pyx_k_ABt), 0, 0, 1, 1}, {&__pyx_n_s_ADD, __pyx_k_ADD, sizeof(__pyx_k_ADD), 0, 0, 1, 1}, {&__pyx_n_s_ADDITIVE, __pyx_k_ADDITIVE, sizeof(__pyx_k_ADDITIVE), 0, 0, 1, 1}, {&__pyx_n_s_ADD_ALL, __pyx_k_ADD_ALL, sizeof(__pyx_k_ADD_ALL), 0, 0, 1, 1}, {&__pyx_n_s_ADD_ALL_VALUES, __pyx_k_ADD_ALL_VALUES, sizeof(__pyx_k_ADD_ALL_VALUES), 0, 0, 1, 1}, {&__pyx_n_s_ADD_BC, __pyx_k_ADD_BC, sizeof(__pyx_k_ADD_BC), 0, 0, 1, 1}, {&__pyx_n_s_ADD_BC_VALUES, __pyx_k_ADD_BC_VALUES, sizeof(__pyx_k_ADD_BC_VALUES), 0, 0, 1, 1}, {&__pyx_n_s_ADD_VALUES, __pyx_k_ADD_VALUES, sizeof(__pyx_k_ADD_VALUES), 0, 0, 1, 1}, {&__pyx_n_s_ADIOS, __pyx_k_ADIOS, sizeof(__pyx_k_ADIOS), 0, 0, 1, 1}, {&__pyx_n_s_ADMM, __pyx_k_ADMM, sizeof(__pyx_k_ADMM), 0, 0, 1, 1}, {&__pyx_n_s_ADVANCED, __pyx_k_ADVANCED, sizeof(__pyx_k_ADVANCED), 0, 0, 1, 1}, {&__pyx_n_s_AGG, __pyx_k_AGG, sizeof(__pyx_k_AGG), 0, 0, 1, 1}, {&__pyx_n_s_AGGREGATION, __pyx_k_AGGREGATION, sizeof(__pyx_k_AGGREGATION), 0, 0, 1, 1}, {&__pyx_n_s_AIJ, __pyx_k_AIJ, sizeof(__pyx_k_AIJ), 0, 0, 1, 1}, {&__pyx_n_s_AIJCRL, __pyx_k_AIJCRL, sizeof(__pyx_k_AIJCRL), 0, 0, 1, 1}, {&__pyx_n_s_AIJCUSPARSE, __pyx_k_AIJCUSPARSE, sizeof(__pyx_k_AIJCUSPARSE), 0, 0, 1, 1}, {&__pyx_n_s_AIJMKL, __pyx_k_AIJMKL, sizeof(__pyx_k_AIJMKL), 0, 0, 1, 1}, {&__pyx_n_s_AIJPERM, __pyx_k_AIJPERM, sizeof(__pyx_k_AIJPERM), 0, 0, 1, 1}, {&__pyx_n_s_AIJSELL, __pyx_k_AIJSELL, sizeof(__pyx_k_AIJSELL), 0, 0, 1, 1}, {&__pyx_n_s_AIJVIENNACL, __pyx_k_AIJVIENNACL, sizeof(__pyx_k_AIJVIENNACL), 0, 0, 1, 1}, {&__pyx_n_s_ALLGATHER, __pyx_k_ALLGATHER, sizeof(__pyx_k_ALLGATHER), 0, 0, 1, 1}, {&__pyx_n_s_ALLGATHERV, __pyx_k_ALLGATHERV, sizeof(__pyx_k_ALLGATHERV), 0, 0, 1, 1}, {&__pyx_n_s_ALLTOALL, __pyx_k_ALLTOALL, sizeof(__pyx_k_ALLTOALL), 0, 0, 1, 1}, {&__pyx_n_s_ALMM, __pyx_k_ALMM, sizeof(__pyx_k_ALMM), 0, 0, 1, 1}, {&__pyx_n_s_ALPHA, __pyx_k_ALPHA, sizeof(__pyx_k_ALPHA), 0, 0, 1, 1}, {&__pyx_n_s_ALPHA2, __pyx_k_ALPHA2, sizeof(__pyx_k_ALPHA2), 0, 0, 1, 1}, {&__pyx_n_s_ALWAYS, __pyx_k_ALWAYS, sizeof(__pyx_k_ALWAYS), 0, 0, 1, 1}, {&__pyx_n_s_AMD, __pyx_k_AMD, sizeof(__pyx_k_AMD), 0, 0, 1, 1}, {&__pyx_n_s_ANDERSON, __pyx_k_ANDERSON, sizeof(__pyx_k_ANDERSON), 0, 0, 1, 1}, {&__pyx_n_s_AO, __pyx_k_AO, sizeof(__pyx_k_AO), 0, 0, 1, 1}, {&__pyx_n_s_AOType, __pyx_k_AOType, sizeof(__pyx_k_AOType), 0, 0, 1, 1}, {&__pyx_n_s_APPEND, __pyx_k_APPEND, sizeof(__pyx_k_APPEND), 0, 0, 1, 1}, {&__pyx_n_s_APPEND_UPDATE, __pyx_k_APPEND_UPDATE, sizeof(__pyx_k_APPEND_UPDATE), 0, 0, 1, 1}, {&__pyx_n_s_APPLY_LOWER, __pyx_k_APPLY_LOWER, sizeof(__pyx_k_APPLY_LOWER), 0, 0, 1, 1}, {&__pyx_n_s_APPLY_UPPER, __pyx_k_APPLY_UPPER, sizeof(__pyx_k_APPLY_UPPER), 0, 0, 1, 1}, {&__pyx_n_s_ARKIMEX, __pyx_k_ARKIMEX, sizeof(__pyx_k_ARKIMEX), 0, 0, 1, 1}, {&__pyx_n_s_ARKIMEX1BEE, __pyx_k_ARKIMEX1BEE, sizeof(__pyx_k_ARKIMEX1BEE), 0, 0, 1, 1}, {&__pyx_n_s_ARKIMEX2C, __pyx_k_ARKIMEX2C, sizeof(__pyx_k_ARKIMEX2C), 0, 0, 1, 1}, {&__pyx_n_s_ARKIMEX2D, __pyx_k_ARKIMEX2D, sizeof(__pyx_k_ARKIMEX2D), 0, 0, 1, 1}, {&__pyx_n_s_ARKIMEX2E, __pyx_k_ARKIMEX2E, sizeof(__pyx_k_ARKIMEX2E), 0, 0, 1, 1}, {&__pyx_n_s_ARKIMEX3, __pyx_k_ARKIMEX3, sizeof(__pyx_k_ARKIMEX3), 0, 0, 1, 1}, {&__pyx_n_s_ARKIMEX4, __pyx_k_ARKIMEX4, sizeof(__pyx_k_ARKIMEX4), 0, 0, 1, 1}, {&__pyx_n_s_ARKIMEX5, __pyx_k_ARKIMEX5, sizeof(__pyx_k_ARKIMEX5), 0, 0, 1, 1}, {&__pyx_n_s_ARKIMEXA2, __pyx_k_ARKIMEXA2, sizeof(__pyx_k_ARKIMEXA2), 0, 0, 1, 1}, {&__pyx_n_s_ARKIMEXARS122, __pyx_k_ARKIMEXARS122, sizeof(__pyx_k_ARKIMEXARS122), 0, 0, 1, 1}, {&__pyx_n_s_ARKIMEXARS443, __pyx_k_ARKIMEXARS443, sizeof(__pyx_k_ARKIMEXARS443), 0, 0, 1, 1}, {&__pyx_n_s_ARKIMEXBPR3, __pyx_k_ARKIMEXBPR3, sizeof(__pyx_k_ARKIMEXBPR3), 0, 0, 1, 1}, {&__pyx_n_s_ARKIMEXL2, __pyx_k_ARKIMEXL2, sizeof(__pyx_k_ARKIMEXL2), 0, 0, 1, 1}, {&__pyx_n_s_ARKIMEXPRSSP2, __pyx_k_ARKIMEXPRSSP2, sizeof(__pyx_k_ARKIMEXPRSSP2), 0, 0, 1, 1}, {&__pyx_n_s_ARKIMEXType, __pyx_k_ARKIMEXType, sizeof(__pyx_k_ARKIMEXType), 0, 0, 1, 1}, {&__pyx_n_s_ARMIJO, __pyx_k_ARMIJO, sizeof(__pyx_k_ARMIJO), 0, 0, 1, 1}, {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1}, {&__pyx_n_s_ASCII_COMMON, __pyx_k_ASCII_COMMON, sizeof(__pyx_k_ASCII_COMMON), 0, 0, 1, 1}, {&__pyx_n_s_ASCII_CSV, __pyx_k_ASCII_CSV, sizeof(__pyx_k_ASCII_CSV), 0, 0, 1, 1}, {&__pyx_n_s_ASCII_DENSE, __pyx_k_ASCII_DENSE, sizeof(__pyx_k_ASCII_DENSE), 0, 0, 1, 1}, {&__pyx_n_s_ASCII_FACTOR_INFO, __pyx_k_ASCII_FACTOR_INFO, sizeof(__pyx_k_ASCII_FACTOR_INFO), 0, 0, 1, 1}, {&__pyx_n_s_ASCII_GLVIS, __pyx_k_ASCII_GLVIS, sizeof(__pyx_k_ASCII_GLVIS), 0, 0, 1, 1}, {&__pyx_n_s_ASCII_IMPL, __pyx_k_ASCII_IMPL, sizeof(__pyx_k_ASCII_IMPL), 0, 0, 1, 1}, {&__pyx_n_s_ASCII_INDEX, __pyx_k_ASCII_INDEX, sizeof(__pyx_k_ASCII_INDEX), 0, 0, 1, 1}, {&__pyx_n_s_ASCII_INFO, __pyx_k_ASCII_INFO, sizeof(__pyx_k_ASCII_INFO), 0, 0, 1, 1}, {&__pyx_n_s_ASCII_INFO_DETAIL, __pyx_k_ASCII_INFO_DETAIL, sizeof(__pyx_k_ASCII_INFO_DETAIL), 0, 0, 1, 1}, {&__pyx_n_s_ASCII_LATEX, __pyx_k_ASCII_LATEX, sizeof(__pyx_k_ASCII_LATEX), 0, 0, 1, 1}, {&__pyx_n_s_ASCII_MATHEMATICA, __pyx_k_ASCII_MATHEMATICA, sizeof(__pyx_k_ASCII_MATHEMATICA), 0, 0, 1, 1}, {&__pyx_n_s_ASCII_MATLAB, __pyx_k_ASCII_MATLAB, sizeof(__pyx_k_ASCII_MATLAB), 0, 0, 1, 1}, {&__pyx_n_s_ASCII_MATRIXMARKET, __pyx_k_ASCII_MATRIXMARKET, sizeof(__pyx_k_ASCII_MATRIXMARKET), 0, 0, 1, 1}, {&__pyx_n_s_ASCII_PCICE, __pyx_k_ASCII_PCICE, sizeof(__pyx_k_ASCII_PCICE), 0, 0, 1, 1}, {&__pyx_n_s_ASCII_PYTHON, __pyx_k_ASCII_PYTHON, sizeof(__pyx_k_ASCII_PYTHON), 0, 0, 1, 1}, {&__pyx_n_s_ASCII_SYMMODU, __pyx_k_ASCII_SYMMODU, sizeof(__pyx_k_ASCII_SYMMODU), 0, 0, 1, 1}, {&__pyx_n_s_ASCII_VTK, __pyx_k_ASCII_VTK, sizeof(__pyx_k_ASCII_VTK), 0, 0, 1, 1}, {&__pyx_n_s_ASCII_VTK_CELL, __pyx_k_ASCII_VTK_CELL, sizeof(__pyx_k_ASCII_VTK_CELL), 0, 0, 1, 1}, {&__pyx_n_s_ASCII_VTK_COORDS, __pyx_k_ASCII_VTK_COORDS, sizeof(__pyx_k_ASCII_VTK_COORDS), 0, 0, 1, 1}, {&__pyx_n_s_ASCII_XML, __pyx_k_ASCII_XML, sizeof(__pyx_k_ASCII_XML), 0, 0, 1, 1}, {&__pyx_n_s_ASFLS, __pyx_k_ASFLS, sizeof(__pyx_k_ASFLS), 0, 0, 1, 1}, {&__pyx_n_s_ASILS, __pyx_k_ASILS, sizeof(__pyx_k_ASILS), 0, 0, 1, 1}, {&__pyx_n_s_ASM, __pyx_k_ASM, sizeof(__pyx_k_ASM), 0, 0, 1, 1}, {&__pyx_n_s_ASMType, __pyx_k_ASMType, sizeof(__pyx_k_ASMType), 0, 0, 1, 1}, {&__pyx_n_s_ASPIN, __pyx_k_ASPIN, sizeof(__pyx_k_ASPIN), 0, 0, 1, 1}, {&__pyx_n_s_AU, __pyx_k_AU, sizeof(__pyx_k_AU), 0, 0, 1, 1}, {&__pyx_kp_s_A_matrix_with_d_rows_requires_a, __pyx_k_A_matrix_with_d_rows_requires_a, sizeof(__pyx_k_A_matrix_with_d_rows_requires_a), 0, 0, 1, 0}, {&__pyx_kp_s_All_dimensions_preceding_dimensi, __pyx_k_All_dimensions_preceding_dimensi, sizeof(__pyx_k_All_dimensions_preceding_dimensi), 0, 0, 1, 0}, {&__pyx_n_s_AssemblyType, __pyx_k_AssemblyType, sizeof(__pyx_k_AssemblyType), 0, 0, 1, 1}, {&__pyx_n_s_AssertionError, __pyx_k_AssertionError, sizeof(__pyx_k_AssertionError), 0, 0, 1, 1}, {&__pyx_n_s_AtB, __pyx_k_AtB, sizeof(__pyx_k_AtB), 0, 0, 1, 1}, {&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1}, {&__pyx_n_s_B, __pyx_k_B, sizeof(__pyx_k_B), 0, 0, 1, 1}, {&__pyx_n_s_BACK, __pyx_k_BACK, sizeof(__pyx_k_BACK), 0, 0, 1, 1}, {&__pyx_n_s_BACKWARD_SWEEP, __pyx_k_BACKWARD_SWEEP, sizeof(__pyx_k_BACKWARD_SWEEP), 0, 0, 1, 1}, {&__pyx_n_s_BACK_DOWN, __pyx_k_BACK_DOWN, sizeof(__pyx_k_BACK_DOWN), 0, 0, 1, 1}, {&__pyx_n_s_BACK_DOWN_LEFT, __pyx_k_BACK_DOWN_LEFT, sizeof(__pyx_k_BACK_DOWN_LEFT), 0, 0, 1, 1}, {&__pyx_n_s_BACK_DOWN_RIGHT, __pyx_k_BACK_DOWN_RIGHT, sizeof(__pyx_k_BACK_DOWN_RIGHT), 0, 0, 1, 1}, {&__pyx_n_s_BACK_LEFT, __pyx_k_BACK_LEFT, sizeof(__pyx_k_BACK_LEFT), 0, 0, 1, 1}, {&__pyx_n_s_BACK_RIGHT, __pyx_k_BACK_RIGHT, sizeof(__pyx_k_BACK_RIGHT), 0, 0, 1, 1}, {&__pyx_n_s_BACK_UP, __pyx_k_BACK_UP, sizeof(__pyx_k_BACK_UP), 0, 0, 1, 1}, {&__pyx_n_s_BACK_UP_LEFT, __pyx_k_BACK_UP_LEFT, sizeof(__pyx_k_BACK_UP_LEFT), 0, 0, 1, 1}, {&__pyx_n_s_BACK_UP_RIGHT, __pyx_k_BACK_UP_RIGHT, sizeof(__pyx_k_BACK_UP_RIGHT), 0, 0, 1, 1}, {&__pyx_n_s_BAIJ, __pyx_k_BAIJ, sizeof(__pyx_k_BAIJ), 0, 0, 1, 1}, {&__pyx_n_s_BAIJMKL, __pyx_k_BAIJMKL, sizeof(__pyx_k_BAIJMKL), 0, 0, 1, 1}, {&__pyx_n_s_BALANCED, __pyx_k_BALANCED, sizeof(__pyx_k_BALANCED), 0, 0, 1, 1}, {&__pyx_n_s_BAS, __pyx_k_BAS, sizeof(__pyx_k_BAS), 0, 0, 1, 1}, {&__pyx_n_s_BASIC, __pyx_k_BASIC, sizeof(__pyx_k_BASIC), 0, 0, 1, 1}, {&__pyx_n_s_BASICSYMPLECTIC, __pyx_k_BASICSYMPLECTIC, sizeof(__pyx_k_BASICSYMPLECTIC), 0, 0, 1, 1}, {&__pyx_n_s_BCG, __pyx_k_BCG, sizeof(__pyx_k_BCG), 0, 0, 1, 1}, {&__pyx_n_s_BCGS, __pyx_k_BCGS, sizeof(__pyx_k_BCGS), 0, 0, 1, 1}, {&__pyx_n_s_BCGSL, __pyx_k_BCGSL, sizeof(__pyx_k_BCGSL), 0, 0, 1, 1}, {&__pyx_n_s_BDDC, __pyx_k_BDDC, sizeof(__pyx_k_BDDC), 0, 0, 1, 1}, {&__pyx_n_s_BDF, __pyx_k_BDF, sizeof(__pyx_k_BDF), 0, 0, 1, 1}, {&__pyx_n_s_BDM, __pyx_k_BDM, sizeof(__pyx_k_BDM), 0, 0, 1, 1}, {&__pyx_n_s_BE, __pyx_k_BE, sizeof(__pyx_k_BE), 0, 0, 1, 1}, {&__pyx_n_s_BEULER, __pyx_k_BEULER, sizeof(__pyx_k_BEULER), 0, 0, 1, 1}, {&__pyx_n_s_BFBCG, __pyx_k_BFBCG, sizeof(__pyx_k_BFBCG), 0, 0, 1, 1}, {&__pyx_n_s_BFBT, __pyx_k_BFBT, sizeof(__pyx_k_BFBT), 0, 0, 1, 1}, {&__pyx_n_s_BGCRODR, __pyx_k_BGCRODR, sizeof(__pyx_k_BGCRODR), 0, 0, 1, 1}, {&__pyx_n_s_BGMRES, __pyx_k_BGMRES, sizeof(__pyx_k_BGMRES), 0, 0, 1, 1}, {&__pyx_n_s_BICG, __pyx_k_BICG, sizeof(__pyx_k_BICG), 0, 0, 1, 1}, {&__pyx_n_s_BINARY, __pyx_k_BINARY, sizeof(__pyx_k_BINARY), 0, 0, 1, 1}, {&__pyx_n_s_BINARY_MATLAB, __pyx_k_BINARY_MATLAB, sizeof(__pyx_k_BINARY_MATLAB), 0, 0, 1, 1}, {&__pyx_n_s_BIORTH22, __pyx_k_BIORTH22, sizeof(__pyx_k_BIORTH22), 0, 0, 1, 1}, {&__pyx_n_s_BJACOBI, __pyx_k_BJACOBI, sizeof(__pyx_k_BJACOBI), 0, 0, 1, 1}, {&__pyx_n_s_BLMVM, __pyx_k_BLMVM, sizeof(__pyx_k_BLMVM), 0, 0, 1, 1}, {&__pyx_n_s_BLOCK, __pyx_k_BLOCK, sizeof(__pyx_k_BLOCK), 0, 0, 1, 1}, {&__pyx_n_s_BLOCKMAT, __pyx_k_BLOCKMAT, sizeof(__pyx_k_BLOCKMAT), 0, 0, 1, 1}, {&__pyx_n_s_BMRM, __pyx_k_BMRM, sizeof(__pyx_k_BMRM), 0, 0, 1, 1}, {&__pyx_n_s_BNCG, __pyx_k_BNCG, sizeof(__pyx_k_BNCG), 0, 0, 1, 1}, {&__pyx_n_s_BNCGType, __pyx_k_BNCGType, sizeof(__pyx_k_BNCGType), 0, 0, 1, 1}, {&__pyx_n_s_BNLS, __pyx_k_BNLS, sizeof(__pyx_k_BNLS), 0, 0, 1, 1}, {&__pyx_n_s_BNTL, __pyx_k_BNTL, sizeof(__pyx_k_BNTL), 0, 0, 1, 1}, {&__pyx_n_s_BNTR, __pyx_k_BNTR, sizeof(__pyx_k_BNTR), 0, 0, 1, 1}, {&__pyx_n_s_BOX, __pyx_k_BOX, sizeof(__pyx_k_BOX), 0, 0, 1, 1}, {&__pyx_n_s_BQNKLS, __pyx_k_BQNKLS, sizeof(__pyx_k_BQNKLS), 0, 0, 1, 1}, {&__pyx_n_s_BQNKTL, __pyx_k_BQNKTL, sizeof(__pyx_k_BQNKTL), 0, 0, 1, 1}, {&__pyx_n_s_BQNKTR, __pyx_k_BQNKTR, sizeof(__pyx_k_BQNKTR), 0, 0, 1, 1}, {&__pyx_n_s_BQNLS, __pyx_k_BQNLS, sizeof(__pyx_k_BQNLS), 0, 0, 1, 1}, {&__pyx_n_s_BQPIP, __pyx_k_BQPIP, sizeof(__pyx_k_BQPIP), 0, 0, 1, 1}, {&__pyx_n_s_BRGN, __pyx_k_BRGN, sizeof(__pyx_k_BRGN), 0, 0, 1, 1}, {&__pyx_n_s_Barrier, __pyx_k_Barrier, sizeof(__pyx_k_Barrier), 0, 0, 1, 1}, {&__pyx_kp_s_Basic_constants_DECIDE_Use_a_de, __pyx_k_Basic_constants_DECIDE_Use_a_de, sizeof(__pyx_k_Basic_constants_DECIDE_Use_a_de), 0, 0, 1, 0}, {&__pyx_n_s_BoundaryType, __pyx_k_BoundaryType, sizeof(__pyx_k_BoundaryType), 0, 0, 1, 1}, {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0}, {&__pyx_n_s_C, __pyx_k_C, sizeof(__pyx_k_C), 0, 0, 1, 1}, {&__pyx_n_s_CG, __pyx_k_CG, sizeof(__pyx_k_CG), 0, 0, 1, 1}, {&__pyx_n_s_CGLS, __pyx_k_CGLS, sizeof(__pyx_k_CGLS), 0, 0, 1, 1}, {&__pyx_n_s_CGNE, __pyx_k_CGNE, sizeof(__pyx_k_CGNE), 0, 0, 1, 1}, {&__pyx_n_s_CGS, __pyx_k_CGS, sizeof(__pyx_k_CGS), 0, 0, 1, 1}, {&__pyx_n_s_CHACO, __pyx_k_CHACO, sizeof(__pyx_k_CHACO), 0, 0, 1, 1}, {&__pyx_n_s_CHEBYSHEV, __pyx_k_CHEBYSHEV, sizeof(__pyx_k_CHEBYSHEV), 0, 0, 1, 1}, {&__pyx_n_s_CHOLESKY, __pyx_k_CHOLESKY, sizeof(__pyx_k_CHOLESKY), 0, 0, 1, 1}, {&__pyx_n_s_CHOLMOD, __pyx_k_CHOLMOD, sizeof(__pyx_k_CHOLMOD), 0, 0, 1, 1}, {&__pyx_n_s_CHOWILUVIENNACL, __pyx_k_CHOWILUVIENNACL, sizeof(__pyx_k_CHOWILUVIENNACL), 0, 0, 1, 1}, {&__pyx_n_s_CLASSICAL, __pyx_k_CLASSICAL, sizeof(__pyx_k_CLASSICAL), 0, 0, 1, 1}, {&__pyx_n_s_CN, __pyx_k_CN, sizeof(__pyx_k_CN), 0, 0, 1, 1}, {&__pyx_n_s_COLLECT_BASIC, __pyx_k_COLLECT_BASIC, sizeof(__pyx_k_COLLECT_BASIC), 0, 0, 1, 1}, {&__pyx_n_s_COLLECT_DMDABOUNDINGBOX, __pyx_k_COLLECT_DMDABOUNDINGBOX, sizeof(__pyx_k_COLLECT_DMDABOUNDINGBOX), 0, 0, 1, 1}, {&__pyx_n_s_COLLECT_GENERAL, __pyx_k_COLLECT_GENERAL, sizeof(__pyx_k_COLLECT_GENERAL), 0, 0, 1, 1}, {&__pyx_n_s_COLLECT_USER, __pyx_k_COLLECT_USER, sizeof(__pyx_k_COLLECT_USER), 0, 0, 1, 1}, {&__pyx_n_s_COMM_NULL, __pyx_k_COMM_NULL, sizeof(__pyx_k_COMM_NULL), 0, 0, 1, 1}, {&__pyx_n_s_COMM_SELF, __pyx_k_COMM_SELF, sizeof(__pyx_k_COMM_SELF), 0, 0, 1, 1}, {&__pyx_n_s_COMM_WORLD, __pyx_k_COMM_WORLD, sizeof(__pyx_k_COMM_WORLD), 0, 0, 1, 1}, {&__pyx_n_s_COMPOSITE, __pyx_k_COMPOSITE, sizeof(__pyx_k_COMPOSITE), 0, 0, 1, 1}, {&__pyx_n_s_CONSTANTDIAGONAL, __pyx_k_CONSTANTDIAGONAL, sizeof(__pyx_k_CONSTANTDIAGONAL), 0, 0, 1, 1}, {&__pyx_n_s_CONTINUE_ITERATING, __pyx_k_CONTINUE_ITERATING, sizeof(__pyx_k_CONTINUE_ITERATING), 0, 0, 1, 1}, {&__pyx_n_s_CONTINUE_SEARCH, __pyx_k_CONTINUE_SEARCH, sizeof(__pyx_k_CONTINUE_SEARCH), 0, 0, 1, 1}, {&__pyx_n_s_CONVERGED_ATOL, __pyx_k_CONVERGED_ATOL, sizeof(__pyx_k_CONVERGED_ATOL), 0, 0, 1, 1}, {&__pyx_n_s_CONVERGED_ATOL_NORMAL, __pyx_k_CONVERGED_ATOL_NORMAL, sizeof(__pyx_k_CONVERGED_ATOL_NORMAL), 0, 0, 1, 1}, {&__pyx_n_s_CONVERGED_EVENT, __pyx_k_CONVERGED_EVENT, sizeof(__pyx_k_CONVERGED_EVENT), 0, 0, 1, 1}, {&__pyx_n_s_CONVERGED_FNORM_ABS, __pyx_k_CONVERGED_FNORM_ABS, sizeof(__pyx_k_CONVERGED_FNORM_ABS), 0, 0, 1, 1}, {&__pyx_n_s_CONVERGED_FNORM_RELATIVE, __pyx_k_CONVERGED_FNORM_RELATIVE, sizeof(__pyx_k_CONVERGED_FNORM_RELATIVE), 0, 0, 1, 1}, {&__pyx_n_s_CONVERGED_GATOL, __pyx_k_CONVERGED_GATOL, sizeof(__pyx_k_CONVERGED_GATOL), 0, 0, 1, 1}, {&__pyx_n_s_CONVERGED_GRTOL, __pyx_k_CONVERGED_GRTOL, sizeof(__pyx_k_CONVERGED_GRTOL), 0, 0, 1, 1}, {&__pyx_n_s_CONVERGED_GTTOL, __pyx_k_CONVERGED_GTTOL, sizeof(__pyx_k_CONVERGED_GTTOL), 0, 0, 1, 1}, {&__pyx_n_s_CONVERGED_HAPPY_BREAKDOWN, __pyx_k_CONVERGED_HAPPY_BREAKDOWN, sizeof(__pyx_k_CONVERGED_HAPPY_BREAKDOWN), 0, 0, 1, 1}, {&__pyx_n_s_CONVERGED_ITERATING, __pyx_k_CONVERGED_ITERATING, sizeof(__pyx_k_CONVERGED_ITERATING), 0, 0, 1, 1}, {&__pyx_n_s_CONVERGED_ITS, __pyx_k_CONVERGED_ITS, sizeof(__pyx_k_CONVERGED_ITS), 0, 0, 1, 1}, {&__pyx_n_s_CONVERGED_MINF, __pyx_k_CONVERGED_MINF, sizeof(__pyx_k_CONVERGED_MINF), 0, 0, 1, 1}, {&__pyx_n_s_CONVERGED_NEG_CURVE, __pyx_k_CONVERGED_NEG_CURVE, sizeof(__pyx_k_CONVERGED_NEG_CURVE), 0, 0, 1, 1}, {&__pyx_n_s_CONVERGED_RTOL, __pyx_k_CONVERGED_RTOL, sizeof(__pyx_k_CONVERGED_RTOL), 0, 0, 1, 1}, {&__pyx_n_s_CONVERGED_RTOL_NORMAL, __pyx_k_CONVERGED_RTOL_NORMAL, sizeof(__pyx_k_CONVERGED_RTOL_NORMAL), 0, 0, 1, 1}, {&__pyx_n_s_CONVERGED_SNORM_RELATIVE, __pyx_k_CONVERGED_SNORM_RELATIVE, sizeof(__pyx_k_CONVERGED_SNORM_RELATIVE), 0, 0, 1, 1}, {&__pyx_n_s_CONVERGED_STEPTOL, __pyx_k_CONVERGED_STEPTOL, sizeof(__pyx_k_CONVERGED_STEPTOL), 0, 0, 1, 1}, {&__pyx_n_s_CONVERGED_STEP_LENGTH, __pyx_k_CONVERGED_STEP_LENGTH, sizeof(__pyx_k_CONVERGED_STEP_LENGTH), 0, 0, 1, 1}, {&__pyx_n_s_CONVERGED_TIME, __pyx_k_CONVERGED_TIME, sizeof(__pyx_k_CONVERGED_TIME), 0, 0, 1, 1}, {&__pyx_n_s_CONVERGED_USER, __pyx_k_CONVERGED_USER, sizeof(__pyx_k_CONVERGED_USER), 0, 0, 1, 1}, {&__pyx_n_s_COPY_VALUES, __pyx_k_COPY_VALUES, sizeof(__pyx_k_COPY_VALUES), 0, 0, 1, 1}, {&__pyx_n_s_CP, __pyx_k_CP, sizeof(__pyx_k_CP), 0, 0, 1, 1}, {&__pyx_n_s_CR, __pyx_k_CR, sizeof(__pyx_k_CR), 0, 0, 1, 1}, {&__pyx_n_s_CRANK_NICOLSON, __pyx_k_CRANK_NICOLSON, sizeof(__pyx_k_CRANK_NICOLSON), 0, 0, 1, 1}, {&__pyx_n_s_CUDA, __pyx_k_CUDA, sizeof(__pyx_k_CUDA), 0, 0, 1, 1}, {&__pyx_n_s_CUSPARSE, __pyx_k_CUSPARSE, sizeof(__pyx_k_CUSPARSE), 0, 0, 1, 1}, {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0}, {&__pyx_kp_s_Cannot_assign_to_read_only_memor, __pyx_k_Cannot_assign_to_read_only_memor, sizeof(__pyx_k_Cannot_assign_to_read_only_memor), 0, 0, 1, 0}, {&__pyx_kp_s_Cannot_create_writable_memory_vi, __pyx_k_Cannot_create_writable_memory_vi, sizeof(__pyx_k_Cannot_create_writable_memory_vi), 0, 0, 1, 0}, {&__pyx_kp_u_Cannot_index_with_type, __pyx_k_Cannot_index_with_type, sizeof(__pyx_k_Cannot_index_with_type), 0, 1, 0, 0}, {&__pyx_kp_s_Cannot_transpose_memoryview_with, __pyx_k_Cannot_transpose_memoryview_with, sizeof(__pyx_k_Cannot_transpose_memoryview_with), 0, 0, 1, 0}, {&__pyx_n_s_Class, __pyx_k_Class, sizeof(__pyx_k_Class), 0, 0, 1, 1}, {&__pyx_n_s_Clone, __pyx_k_Clone, sizeof(__pyx_k_Clone), 0, 0, 1, 1}, {&__pyx_n_s_CollectType, __pyx_k_CollectType, sizeof(__pyx_k_CollectType), 0, 0, 1, 1}, {&__pyx_n_s_Comm, __pyx_k_Comm, sizeof(__pyx_k_Comm), 0, 0, 1, 1}, {&__pyx_n_s_ComplexType, __pyx_k_ComplexType, sizeof(__pyx_k_ComplexType), 0, 0, 1, 1}, {&__pyx_n_s_CompositeType, __pyx_k_CompositeType, sizeof(__pyx_k_CompositeType), 0, 0, 1, 1}, {&__pyx_n_s_ConvergedReason, __pyx_k_ConvergedReason, sizeof(__pyx_k_ConvergedReason), 0, 0, 1, 1}, {&__pyx_n_s_D, __pyx_k_D, sizeof(__pyx_k_D), 0, 0, 1, 1}, {&__pyx_n_s_DA, __pyx_k_DA, sizeof(__pyx_k_DA), 0, 0, 1, 1}, {&__pyx_n_s_DAE_IMPLICIT_INDEX1, __pyx_k_DAE_IMPLICIT_INDEX1, sizeof(__pyx_k_DAE_IMPLICIT_INDEX1), 0, 0, 1, 1}, {&__pyx_n_s_DAE_IMPLICIT_INDEX2, __pyx_k_DAE_IMPLICIT_INDEX2, sizeof(__pyx_k_DAE_IMPLICIT_INDEX2), 0, 0, 1, 1}, {&__pyx_n_s_DAE_IMPLICIT_INDEX3, __pyx_k_DAE_IMPLICIT_INDEX3, sizeof(__pyx_k_DAE_IMPLICIT_INDEX3), 0, 0, 1, 1}, {&__pyx_n_s_DAE_IMPLICIT_INDEXHI, __pyx_k_DAE_IMPLICIT_INDEXHI, sizeof(__pyx_k_DAE_IMPLICIT_INDEXHI), 0, 0, 1, 1}, {&__pyx_n_s_DAE_SEMI_EXPLICIT_INDEX1, __pyx_k_DAE_SEMI_EXPLICIT_INDEX1, sizeof(__pyx_k_DAE_SEMI_EXPLICIT_INDEX1), 0, 0, 1, 1}, {&__pyx_n_s_DAE_SEMI_EXPLICIT_INDEX2, __pyx_k_DAE_SEMI_EXPLICIT_INDEX2, sizeof(__pyx_k_DAE_SEMI_EXPLICIT_INDEX2), 0, 0, 1, 1}, {&__pyx_n_s_DAE_SEMI_EXPLICIT_INDEX3, __pyx_k_DAE_SEMI_EXPLICIT_INDEX3, sizeof(__pyx_k_DAE_SEMI_EXPLICIT_INDEX3), 0, 0, 1, 1}, {&__pyx_n_s_DAE_SEMI_EXPLICIT_INDEXHI, __pyx_k_DAE_SEMI_EXPLICIT_INDEXHI, sizeof(__pyx_k_DAE_SEMI_EXPLICIT_INDEXHI), 0, 0, 1, 1}, {&__pyx_n_s_DB16, __pyx_k_DB16, sizeof(__pyx_k_DB16), 0, 0, 1, 1}, {&__pyx_n_s_DB2, __pyx_k_DB2, sizeof(__pyx_k_DB2), 0, 0, 1, 1}, {&__pyx_n_s_DB4, __pyx_k_DB4, sizeof(__pyx_k_DB4), 0, 0, 1, 1}, {&__pyx_n_s_DB8, __pyx_k_DB8, sizeof(__pyx_k_DB8), 0, 0, 1, 1}, {&__pyx_n_s_DECIDE, __pyx_k_DECIDE, sizeof(__pyx_k_DECIDE), 0, 0, 1, 1}, {&__pyx_n_s_DEFAULT, __pyx_k_DEFAULT, sizeof(__pyx_k_DEFAULT), 0, 0, 1, 1}, {&__pyx_n_s_DEFAULT_BLOCKING, __pyx_k_DEFAULT_BLOCKING, sizeof(__pyx_k_DEFAULT_BLOCKING), 0, 0, 1, 1}, {&__pyx_n_s_DEFLATED, __pyx_k_DEFLATED, sizeof(__pyx_k_DEFLATED), 0, 0, 1, 1}, {&__pyx_n_s_DEFLATION, __pyx_k_DEFLATION, sizeof(__pyx_k_DEFLATION), 0, 0, 1, 1}, {&__pyx_n_s_DENSE, __pyx_k_DENSE, sizeof(__pyx_k_DENSE), 0, 0, 1, 1}, {&__pyx_n_s_DENSECUDA, __pyx_k_DENSECUDA, sizeof(__pyx_k_DENSECUDA), 0, 0, 1, 1}, {&__pyx_n_s_DESTROY, __pyx_k_DESTROY, sizeof(__pyx_k_DESTROY), 0, 0, 1, 1}, {&__pyx_n_s_DETERMINE, __pyx_k_DETERMINE, sizeof(__pyx_k_DETERMINE), 0, 0, 1, 1}, {&__pyx_n_s_DGMRES, __pyx_k_DGMRES, sizeof(__pyx_k_DGMRES), 0, 0, 1, 1}, {&__pyx_n_s_DIAG, __pyx_k_DIAG, sizeof(__pyx_k_DIAG), 0, 0, 1, 1}, {&__pyx_n_s_DIAGONAL, __pyx_k_DIAGONAL, sizeof(__pyx_k_DIAGONAL), 0, 0, 1, 1}, {&__pyx_n_s_DIFFERENT, __pyx_k_DIFFERENT, sizeof(__pyx_k_DIFFERENT), 0, 0, 1, 1}, {&__pyx_n_s_DIFFERENT_NONZERO_PATTERN, __pyx_k_DIFFERENT_NONZERO_PATTERN, sizeof(__pyx_k_DIFFERENT_NONZERO_PATTERN), 0, 0, 1, 1}, {&__pyx_n_s_DIFFERENT_NZ, __pyx_k_DIFFERENT_NZ, sizeof(__pyx_k_DIFFERENT_NZ), 0, 0, 1, 1}, {&__pyx_n_s_DIRK, __pyx_k_DIRK, sizeof(__pyx_k_DIRK), 0, 0, 1, 1}, {&__pyx_n_s_DIRK657A, __pyx_k_DIRK657A, sizeof(__pyx_k_DIRK657A), 0, 0, 1, 1}, {&__pyx_n_s_DIRK658A, __pyx_k_DIRK658A, sizeof(__pyx_k_DIRK658A), 0, 0, 1, 1}, {&__pyx_n_s_DIRK7510SAL, __pyx_k_DIRK7510SAL, sizeof(__pyx_k_DIRK7510SAL), 0, 0, 1, 1}, {&__pyx_n_s_DIRK759A, __pyx_k_DIRK759A, sizeof(__pyx_k_DIRK759A), 0, 0, 1, 1}, {&__pyx_n_s_DIRK8614A, __pyx_k_DIRK8614A, sizeof(__pyx_k_DIRK8614A), 0, 0, 1, 1}, {&__pyx_n_s_DIRK8616SAL, __pyx_k_DIRK8616SAL, sizeof(__pyx_k_DIRK8616SAL), 0, 0, 1, 1}, {&__pyx_n_s_DIRKES122SAL, __pyx_k_DIRKES122SAL, sizeof(__pyx_k_DIRKES122SAL), 0, 0, 1, 1}, {&__pyx_n_s_DIRKES213SAL, __pyx_k_DIRKES213SAL, sizeof(__pyx_k_DIRKES213SAL), 0, 0, 1, 1}, {&__pyx_n_s_DIRKES324SAL, __pyx_k_DIRKES324SAL, sizeof(__pyx_k_DIRKES324SAL), 0, 0, 1, 1}, {&__pyx_n_s_DIRKES325SAL, __pyx_k_DIRKES325SAL, sizeof(__pyx_k_DIRKES325SAL), 0, 0, 1, 1}, {&__pyx_n_s_DIRKES648SA, __pyx_k_DIRKES648SA, sizeof(__pyx_k_DIRKES648SA), 0, 0, 1, 1}, {&__pyx_n_s_DIRKES7510SA, __pyx_k_DIRKES7510SA, sizeof(__pyx_k_DIRKES7510SA), 0, 0, 1, 1}, {&__pyx_n_s_DIRKES8516SAL, __pyx_k_DIRKES8516SAL, sizeof(__pyx_k_DIRKES8516SAL), 0, 0, 1, 1}, {&__pyx_n_s_DIRKS212, __pyx_k_DIRKS212, sizeof(__pyx_k_DIRKS212), 0, 0, 1, 1}, {&__pyx_n_s_DIRKS659A, __pyx_k_DIRKS659A, sizeof(__pyx_k_DIRKS659A), 0, 0, 1, 1}, {&__pyx_n_s_DIRKS7511SAL, __pyx_k_DIRKS7511SAL, sizeof(__pyx_k_DIRKS7511SAL), 0, 0, 1, 1}, {&__pyx_n_s_DIRKType, __pyx_k_DIRKType, sizeof(__pyx_k_DIRKType), 0, 0, 1, 1}, {&__pyx_n_s_DISCGRAD, __pyx_k_DISCGRAD, sizeof(__pyx_k_DISCGRAD), 0, 0, 1, 1}, {&__pyx_n_s_DIVERGED_BREAKDOWN, __pyx_k_DIVERGED_BREAKDOWN, sizeof(__pyx_k_DIVERGED_BREAKDOWN), 0, 0, 1, 1}, {&__pyx_n_s_DIVERGED_BREAKDOWN_BICG, __pyx_k_DIVERGED_BREAKDOWN_BICG, sizeof(__pyx_k_DIVERGED_BREAKDOWN_BICG), 0, 0, 1, 1}, {&__pyx_n_s_DIVERGED_DTOL, __pyx_k_DIVERGED_DTOL, sizeof(__pyx_k_DIVERGED_DTOL), 0, 0, 1, 1}, {&__pyx_n_s_DIVERGED_FNORM_NAN, __pyx_k_DIVERGED_FNORM_NAN, sizeof(__pyx_k_DIVERGED_FNORM_NAN), 0, 0, 1, 1}, {&__pyx_n_s_DIVERGED_FUNCTION_COUNT, __pyx_k_DIVERGED_FUNCTION_COUNT, sizeof(__pyx_k_DIVERGED_FUNCTION_COUNT), 0, 0, 1, 1}, {&__pyx_n_s_DIVERGED_FUNCTION_DOMAIN, __pyx_k_DIVERGED_FUNCTION_DOMAIN, sizeof(__pyx_k_DIVERGED_FUNCTION_DOMAIN), 0, 0, 1, 1}, {&__pyx_n_s_DIVERGED_INDEFINITE_MAT, __pyx_k_DIVERGED_INDEFINITE_MAT, sizeof(__pyx_k_DIVERGED_INDEFINITE_MAT), 0, 0, 1, 1}, {&__pyx_n_s_DIVERGED_INDEFINITE_PC, __pyx_k_DIVERGED_INDEFINITE_PC, sizeof(__pyx_k_DIVERGED_INDEFINITE_PC), 0, 0, 1, 1}, {&__pyx_n_s_DIVERGED_INNER, __pyx_k_DIVERGED_INNER, sizeof(__pyx_k_DIVERGED_INNER), 0, 0, 1, 1}, {&__pyx_n_s_DIVERGED_JACOBIAN_DOMAIN, __pyx_k_DIVERGED_JACOBIAN_DOMAIN, sizeof(__pyx_k_DIVERGED_JACOBIAN_DOMAIN), 0, 0, 1, 1}, {&__pyx_n_s_DIVERGED_LINEAR_SOLVE, __pyx_k_DIVERGED_LINEAR_SOLVE, sizeof(__pyx_k_DIVERGED_LINEAR_SOLVE), 0, 0, 1, 1}, {&__pyx_n_s_DIVERGED_LINE_SEARCH, __pyx_k_DIVERGED_LINE_SEARCH, sizeof(__pyx_k_DIVERGED_LINE_SEARCH), 0, 0, 1, 1}, {&__pyx_n_s_DIVERGED_LOCAL_MIN, __pyx_k_DIVERGED_LOCAL_MIN, sizeof(__pyx_k_DIVERGED_LOCAL_MIN), 0, 0, 1, 1}, {&__pyx_n_s_DIVERGED_LS_FAILURE, __pyx_k_DIVERGED_LS_FAILURE, sizeof(__pyx_k_DIVERGED_LS_FAILURE), 0, 0, 1, 1}, {&__pyx_n_s_DIVERGED_MAXFCN, __pyx_k_DIVERGED_MAXFCN, sizeof(__pyx_k_DIVERGED_MAXFCN), 0, 0, 1, 1}, {&__pyx_n_s_DIVERGED_MAXITS, __pyx_k_DIVERGED_MAXITS, sizeof(__pyx_k_DIVERGED_MAXITS), 0, 0, 1, 1}, {&__pyx_n_s_DIVERGED_MAX_IT, __pyx_k_DIVERGED_MAX_IT, sizeof(__pyx_k_DIVERGED_MAX_IT), 0, 0, 1, 1}, {&__pyx_n_s_DIVERGED_NAN, __pyx_k_DIVERGED_NAN, sizeof(__pyx_k_DIVERGED_NAN), 0, 0, 1, 1}, {&__pyx_n_s_DIVERGED_NANORINF, __pyx_k_DIVERGED_NANORINF, sizeof(__pyx_k_DIVERGED_NANORINF), 0, 0, 1, 1}, {&__pyx_n_s_DIVERGED_NONLINEAR_SOLVE, __pyx_k_DIVERGED_NONLINEAR_SOLVE, sizeof(__pyx_k_DIVERGED_NONLINEAR_SOLVE), 0, 0, 1, 1}, {&__pyx_n_s_DIVERGED_NONSYMMETRIC, __pyx_k_DIVERGED_NONSYMMETRIC, sizeof(__pyx_k_DIVERGED_NONSYMMETRIC), 0, 0, 1, 1}, {&__pyx_n_s_DIVERGED_NULL, __pyx_k_DIVERGED_NULL, sizeof(__pyx_k_DIVERGED_NULL), 0, 0, 1, 1}, {&__pyx_n_s_DIVERGED_PCSETUP_FAILED, __pyx_k_DIVERGED_PCSETUP_FAILED, sizeof(__pyx_k_DIVERGED_PCSETUP_FAILED), 0, 0, 1, 1}, {&__pyx_n_s_DIVERGED_STEP_REJECTED, __pyx_k_DIVERGED_STEP_REJECTED, sizeof(__pyx_k_DIVERGED_STEP_REJECTED), 0, 0, 1, 1}, {&__pyx_n_s_DIVERGED_TR_DELTA, __pyx_k_DIVERGED_TR_DELTA, sizeof(__pyx_k_DIVERGED_TR_DELTA), 0, 0, 1, 1}, {&__pyx_n_s_DIVERGED_TR_REDUCTION, __pyx_k_DIVERGED_TR_REDUCTION, sizeof(__pyx_k_DIVERGED_TR_REDUCTION), 0, 0, 1, 1}, {&__pyx_n_s_DIVERGED_USER, __pyx_k_DIVERGED_USER, sizeof(__pyx_k_DIVERGED_USER), 0, 0, 1, 1}, {&__pyx_n_s_DK, __pyx_k_DK, sizeof(__pyx_k_DK), 0, 0, 1, 1}, {&__pyx_n_s_DM, __pyx_k_DM, sizeof(__pyx_k_DM), 0, 0, 1, 1}, {&__pyx_n_s_DMBoundaryType, __pyx_k_DMBoundaryType, sizeof(__pyx_k_DMBoundaryType), 0, 0, 1, 1}, {&__pyx_n_s_DMComposite, __pyx_k_DMComposite, sizeof(__pyx_k_DMComposite), 0, 0, 1, 1}, {&__pyx_n_s_DMComposite_access, __pyx_k_DMComposite_access, sizeof(__pyx_k_DMComposite_access), 0, 0, 1, 1}, {&__pyx_n_s_DMDA, __pyx_k_DMDA, sizeof(__pyx_k_DMDA), 0, 0, 1, 1}, {&__pyx_n_s_DMDAElementType, __pyx_k_DMDAElementType, sizeof(__pyx_k_DMDAElementType), 0, 0, 1, 1}, {&__pyx_n_s_DMDAInterpolationType, __pyx_k_DMDAInterpolationType, sizeof(__pyx_k_DMDAInterpolationType), 0, 0, 1, 1}, {&__pyx_n_s_DMDAStencilType, __pyx_k_DMDAStencilType, sizeof(__pyx_k_DMDAStencilType), 0, 0, 1, 1}, {&__pyx_n_s_DMDA_Vec_array, __pyx_k_DMDA_Vec_array, sizeof(__pyx_k_DMDA_Vec_array), 0, 0, 1, 1}, {&__pyx_n_s_DMInterpolation, __pyx_k_DMInterpolation, sizeof(__pyx_k_DMInterpolation), 0, 0, 1, 1}, {&__pyx_n_s_DMLabel, __pyx_k_DMLabel, sizeof(__pyx_k_DMLabel), 0, 0, 1, 1}, {&__pyx_n_s_DMPlex, __pyx_k_DMPlex, sizeof(__pyx_k_DMPlex), 0, 0, 1, 1}, {&__pyx_n_s_DMPlexReorderDefaultFlag, __pyx_k_DMPlexReorderDefaultFlag, sizeof(__pyx_k_DMPlexReorderDefaultFlag), 0, 0, 1, 1}, {&__pyx_n_s_DMPlexTransform, __pyx_k_DMPlexTransform, sizeof(__pyx_k_DMPlexTransform), 0, 0, 1, 1}, {&__pyx_n_s_DMPlexTransformType, __pyx_k_DMPlexTransformType, sizeof(__pyx_k_DMPlexTransformType), 0, 0, 1, 1}, {&__pyx_n_s_DMPolytopeType, __pyx_k_DMPolytopeType, sizeof(__pyx_k_DMPolytopeType), 0, 0, 1, 1}, {&__pyx_n_s_DMShell, __pyx_k_DMShell, sizeof(__pyx_k_DMShell), 0, 0, 1, 1}, {&__pyx_n_s_DMStag, __pyx_k_DMStag, sizeof(__pyx_k_DMStag), 0, 0, 1, 1}, {&__pyx_n_s_DMStagStencilLocation, __pyx_k_DMStagStencilLocation, sizeof(__pyx_k_DMStagStencilLocation), 0, 0, 1, 1}, {&__pyx_n_s_DMStagStencilType, __pyx_k_DMStagStencilType, sizeof(__pyx_k_DMStagStencilType), 0, 0, 1, 1}, {&__pyx_n_s_DMSwarm, __pyx_k_DMSwarm, sizeof(__pyx_k_DMSwarm), 0, 0, 1, 1}, {&__pyx_n_s_DMSwarmCollectType, __pyx_k_DMSwarmCollectType, sizeof(__pyx_k_DMSwarmCollectType), 0, 0, 1, 1}, {&__pyx_n_s_DMSwarmMigrateType, __pyx_k_DMSwarmMigrateType, sizeof(__pyx_k_DMSwarmMigrateType), 0, 0, 1, 1}, {&__pyx_n_s_DMSwarmPICLayoutType, __pyx_k_DMSwarmPICLayoutType, sizeof(__pyx_k_DMSwarmPICLayoutType), 0, 0, 1, 1}, {&__pyx_n_s_DMSwarmType, __pyx_k_DMSwarmType, sizeof(__pyx_k_DMSwarmType), 0, 0, 1, 1}, {&__pyx_n_s_DMType, __pyx_k_DMType, sizeof(__pyx_k_DMType), 0, 0, 1, 1}, {&__pyx_kp_s_DM_Boundary_types, __pyx_k_DM_Boundary_types, sizeof(__pyx_k_DM_Boundary_types), 0, 0, 1, 0}, {&__pyx_kp_s_DM_types, __pyx_k_DM_types, sizeof(__pyx_k_DM_types), 0, 0, 1, 0}, {&__pyx_n_s_DOF, __pyx_k_DOF, sizeof(__pyx_k_DOF), 0, 0, 1, 1}, {&__pyx_n_s_DOWN, __pyx_k_DOWN, sizeof(__pyx_k_DOWN), 0, 0, 1, 1}, {&__pyx_n_s_DOWN_LEFT, __pyx_k_DOWN_LEFT, sizeof(__pyx_k_DOWN_LEFT), 0, 0, 1, 1}, {&__pyx_n_s_DOWN_RIGHT, __pyx_k_DOWN_RIGHT, sizeof(__pyx_k_DOWN_RIGHT), 0, 0, 1, 1}, {&__pyx_n_s_DO_NOT_COPY_VALUES, __pyx_k_DO_NOT_COPY_VALUES, sizeof(__pyx_k_DO_NOT_COPY_VALUES), 0, 0, 1, 1}, {&__pyx_n_s_DRAW, __pyx_k_DRAW, sizeof(__pyx_k_DRAW), 0, 0, 1, 1}, {&__pyx_n_s_DRAW_BASIC, __pyx_k_DRAW_BASIC, sizeof(__pyx_k_DRAW_BASIC), 0, 0, 1, 1}, {&__pyx_n_s_DRAW_CONTOUR, __pyx_k_DRAW_CONTOUR, sizeof(__pyx_k_DRAW_CONTOUR), 0, 0, 1, 1}, {&__pyx_n_s_DRAW_LG, __pyx_k_DRAW_LG, sizeof(__pyx_k_DRAW_LG), 0, 0, 1, 1}, {&__pyx_n_s_DRAW_LG_XRANGE, __pyx_k_DRAW_LG_XRANGE, sizeof(__pyx_k_DRAW_LG_XRANGE), 0, 0, 1, 1}, {&__pyx_n_s_DRAW_PORTS, __pyx_k_DRAW_PORTS, sizeof(__pyx_k_DRAW_PORTS), 0, 0, 1, 1}, {&__pyx_n_s_DROP, __pyx_k_DROP, sizeof(__pyx_k_DROP), 0, 0, 1, 1}, {&__pyx_n_s_DS, __pyx_k_DS, sizeof(__pyx_k_DS), 0, 0, 1, 1}, {&__pyx_n_s_DSType, __pyx_k_DSType, sizeof(__pyx_k_DSType), 0, 0, 1, 1}, {&__pyx_n_s_DUMMY, __pyx_k_DUMMY, sizeof(__pyx_k_DUMMY), 0, 0, 1, 1}, {&__pyx_n_s_DY, __pyx_k_DY, sizeof(__pyx_k_DY), 0, 0, 1, 1}, {&__pyx_n_s_DeflationSpaceType, __pyx_k_DeflationSpaceType, sizeof(__pyx_k_DeflationSpaceType), 0, 0, 1, 1}, {&__pyx_n_s_Device, __pyx_k_Device, sizeof(__pyx_k_Device), 0, 0, 1, 1}, {&__pyx_n_s_DeviceContext, __pyx_k_DeviceContext, sizeof(__pyx_k_DeviceContext), 0, 0, 1, 1}, {&__pyx_n_s_DeviceJoinMode, __pyx_k_DeviceJoinMode, sizeof(__pyx_k_DeviceJoinMode), 0, 0, 1, 1}, {&__pyx_n_s_DeviceType, __pyx_k_DeviceType, sizeof(__pyx_k_DeviceType), 0, 0, 1, 1}, {&__pyx_kp_s_Device_type_not_supported, __pyx_k_Device_type_not_supported, sizeof(__pyx_k_Device_type_not_supported), 0, 0, 1, 0}, {&__pyx_kp_s_Dimension_d_is_not_direct, __pyx_k_Dimension_d_is_not_direct, sizeof(__pyx_k_Dimension_d_is_not_direct), 0, 0, 1, 0}, {&__pyx_kp_s_Distinguishes_among_types_of_exp, __pyx_k_Distinguishes_among_types_of_exp, sizeof(__pyx_k_Distinguishes_among_types_of_exp), 0, 0, 1, 0}, {&__pyx_kp_s_Distinguishes_linear_and_nonline, __pyx_k_Distinguishes_linear_and_nonline, sizeof(__pyx_k_Distinguishes_linear_and_nonline), 0, 0, 1, 0}, {&__pyx_n_s_DrawSize, __pyx_k_DrawSize, sizeof(__pyx_k_DrawSize), 0, 0, 1, 1}, {&__pyx_n_s_DualSpace, __pyx_k_DualSpace, sizeof(__pyx_k_DualSpace), 0, 0, 1, 1}, {&__pyx_n_s_DualSpaceType, __pyx_k_DualSpaceType, sizeof(__pyx_k_DualSpaceType), 0, 0, 1, 1}, {&__pyx_n_s_Dup, __pyx_k_Dup, sizeof(__pyx_k_Dup), 0, 0, 1, 1}, {&__pyx_n_s_DuplicateOption, __pyx_k_DuplicateOption, sizeof(__pyx_k_DuplicateOption), 0, 0, 1, 1}, {&__pyx_n_s_EIMEX, __pyx_k_EIMEX, sizeof(__pyx_k_EIMEX), 0, 0, 1, 1}, {&__pyx_n_s_EISENSTAT, __pyx_k_EISENSTAT, sizeof(__pyx_k_EISENSTAT), 0, 0, 1, 1}, {&__pyx_n_s_ELEMENT, __pyx_k_ELEMENT, sizeof(__pyx_k_ELEMENT), 0, 0, 1, 1}, {&__pyx_n_s_ELEMENTAL, __pyx_k_ELEMENTAL, sizeof(__pyx_k_ELEMENTAL), 0, 0, 1, 1}, {&__pyx_n_s_ERROR_LOWER_TRIANGULAR, __pyx_k_ERROR_LOWER_TRIANGULAR, sizeof(__pyx_k_ERROR_LOWER_TRIANGULAR), 0, 0, 1, 1}, {&__pyx_n_s_ESSL, __pyx_k_ESSL, sizeof(__pyx_k_ESSL), 0, 0, 1, 1}, {&__pyx_n_s_EULER, __pyx_k_EULER, sizeof(__pyx_k_EULER), 0, 0, 1, 1}, {&__pyx_n_s_EXODUSII, __pyx_k_EXODUSII, sizeof(__pyx_k_EXODUSII), 0, 0, 1, 1}, {&__pyx_n_s_EXOTIC, __pyx_k_EXOTIC, sizeof(__pyx_k_EXOTIC), 0, 0, 1, 1}, {&__pyx_n_s_EXPLICIT, __pyx_k_EXPLICIT, sizeof(__pyx_k_EXPLICIT), 0, 0, 1, 1}, {&__pyx_n_s_EXTRUDE, __pyx_k_EXTRUDE, sizeof(__pyx_k_EXTRUDE), 0, 0, 1, 1}, {&__pyx_n_s_ElementType, __pyx_k_ElementType, sizeof(__pyx_k_ElementType), 0, 0, 1, 1}, {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1}, {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr, sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0}, {&__pyx_kp_s_Enum_describing_mapping_behavior, __pyx_k_Enum_describing_mapping_behavior, sizeof(__pyx_k_Enum_describing_mapping_behavior), 0, 0, 1, 0}, {&__pyx_n_s_EquationType, __pyx_k_EquationType, sizeof(__pyx_k_EquationType), 0, 0, 1, 1}, {&__pyx_n_s_Error, __pyx_k_Error, sizeof(__pyx_k_Error), 0, 0, 1, 1}, {&__pyx_n_s_Error___bool, __pyx_k_Error___bool, sizeof(__pyx_k_Error___bool), 0, 0, 1, 1}, {&__pyx_n_s_Error___init, __pyx_k_Error___init, sizeof(__pyx_k_Error___init), 0, 0, 1, 1}, {&__pyx_n_s_Error___repr, __pyx_k_Error___repr, sizeof(__pyx_k_Error___repr), 0, 0, 1, 1}, {&__pyx_n_s_Error___str, __pyx_k_Error___str, sizeof(__pyx_k_Error___str), 0, 0, 1, 1}, {&__pyx_n_s_Event, __pyx_k_Event, sizeof(__pyx_k_Event), 0, 0, 1, 1}, {&__pyx_n_s_EventDecorator, __pyx_k_EventDecorator, sizeof(__pyx_k_EventDecorator), 0, 0, 1, 1}, {&__pyx_n_s_EventDecorator_locals_decorator, __pyx_k_EventDecorator_locals_decorator, sizeof(__pyx_k_EventDecorator_locals_decorator), 0, 0, 1, 1}, {&__pyx_n_s_EventDecorator_locals_decorator_2, __pyx_k_EventDecorator_locals_decorator_2, sizeof(__pyx_k_EventDecorator_locals_decorator_2), 0, 0, 1, 1}, {&__pyx_n_s_ExactFinalTime, __pyx_k_ExactFinalTime, sizeof(__pyx_k_ExactFinalTime), 0, 0, 1, 1}, {&__pyx_n_s_ExactFinalTimeOption, __pyx_k_ExactFinalTimeOption, sizeof(__pyx_k_ExactFinalTimeOption), 0, 0, 1, 1}, {&__pyx_kp_s_Expect_a_dltensor_field_pycapsul, __pyx_k_Expect_a_dltensor_field_pycapsul, sizeof(__pyx_k_Expect_a_dltensor_field_pycapsul), 0, 0, 1, 0}, {&__pyx_kp_s_Expect_a_dltensor_or_used_dltens, __pyx_k_Expect_a_dltensor_or_used_dltens, sizeof(__pyx_k_Expect_a_dltensor_or_used_dltens), 0, 0, 1, 0}, {&__pyx_n_s_FACTOR_NUMERIC_ZEROPIVOT, __pyx_k_FACTOR_NUMERIC_ZEROPIVOT, sizeof(__pyx_k_FACTOR_NUMERIC_ZEROPIVOT), 0, 0, 1, 1}, {&__pyx_n_s_FACTOR_OTHER, __pyx_k_FACTOR_OTHER, sizeof(__pyx_k_FACTOR_OTHER), 0, 0, 1, 1}, {&__pyx_n_s_FACTOR_OUTMEMORY, __pyx_k_FACTOR_OUTMEMORY, sizeof(__pyx_k_FACTOR_OUTMEMORY), 0, 0, 1, 1}, {&__pyx_n_s_FACTOR_STRUCT_ZEROPIVOT, __pyx_k_FACTOR_STRUCT_ZEROPIVOT, sizeof(__pyx_k_FACTOR_STRUCT_ZEROPIVOT), 0, 0, 1, 1}, {&__pyx_n_s_FAILED, __pyx_k_FAILED, sizeof(__pyx_k_FAILED), 0, 0, 1, 1}, {&__pyx_n_s_FAILED_ASCENT, __pyx_k_FAILED_ASCENT, sizeof(__pyx_k_FAILED_ASCENT), 0, 0, 1, 1}, {&__pyx_n_s_FAILED_BADPARAMETER, __pyx_k_FAILED_BADPARAMETER, sizeof(__pyx_k_FAILED_BADPARAMETER), 0, 0, 1, 1}, {&__pyx_n_s_FAILED_INFORNAN, __pyx_k_FAILED_INFORNAN, sizeof(__pyx_k_FAILED_INFORNAN), 0, 0, 1, 1}, {&__pyx_n_s_FALSE, __pyx_k_FALSE, sizeof(__pyx_k_FALSE), 0, 0, 1, 1}, {&__pyx_n_s_FAS, __pyx_k_FAS, sizeof(__pyx_k_FAS), 0, 0, 1, 1}, {&__pyx_n_s_FBCGS, __pyx_k_FBCGS, sizeof(__pyx_k_FBCGS), 0, 0, 1, 1}, {&__pyx_n_s_FBCGSR, __pyx_k_FBCGSR, sizeof(__pyx_k_FBCGSR), 0, 0, 1, 1}, {&__pyx_n_s_FCG, __pyx_k_FCG, sizeof(__pyx_k_FCG), 0, 0, 1, 1}, {&__pyx_n_s_FE, __pyx_k_FE, sizeof(__pyx_k_FE), 0, 0, 1, 1}, {&__pyx_n_s_FETIDP, __pyx_k_FETIDP, sizeof(__pyx_k_FETIDP), 0, 0, 1, 1}, {&__pyx_n_s_FEType, __pyx_k_FEType, sizeof(__pyx_k_FEType), 0, 0, 1, 1}, {&__pyx_n_s_FFT, __pyx_k_FFT, sizeof(__pyx_k_FFT), 0, 0, 1, 1}, {&__pyx_n_s_FFTW, __pyx_k_FFTW, sizeof(__pyx_k_FFTW), 0, 0, 1, 1}, {&__pyx_n_s_FGMRES, __pyx_k_FGMRES, sizeof(__pyx_k_FGMRES), 0, 0, 1, 1}, {&__pyx_n_s_FIELDSPLIT, __pyx_k_FIELDSPLIT, sizeof(__pyx_k_FIELDSPLIT), 0, 0, 1, 1}, {&__pyx_n_s_FINAL, __pyx_k_FINAL, sizeof(__pyx_k_FINAL), 0, 0, 1, 1}, {&__pyx_n_s_FINAL_ASSEMBLY, __pyx_k_FINAL_ASSEMBLY, sizeof(__pyx_k_FINAL_ASSEMBLY), 0, 0, 1, 1}, {&__pyx_n_s_FINAL_ONLY, __pyx_k_FINAL_ONLY, sizeof(__pyx_k_FINAL_ONLY), 0, 0, 1, 1}, {&__pyx_n_s_FLUSH, __pyx_k_FLUSH, sizeof(__pyx_k_FLUSH), 0, 0, 1, 1}, {&__pyx_n_s_FLUSH_ASSEMBLY, __pyx_k_FLUSH_ASSEMBLY, sizeof(__pyx_k_FLUSH_ASSEMBLY), 0, 0, 1, 1}, {&__pyx_n_s_FORCE_DIAGONAL_ENTRIES, __pyx_k_FORCE_DIAGONAL_ENTRIES, sizeof(__pyx_k_FORCE_DIAGONAL_ENTRIES), 0, 0, 1, 1}, {&__pyx_n_s_FOREST, __pyx_k_FOREST, sizeof(__pyx_k_FOREST), 0, 0, 1, 1}, {&__pyx_n_s_FORWARD, __pyx_k_FORWARD, sizeof(__pyx_k_FORWARD), 0, 0, 1, 1}, {&__pyx_n_s_FORWARD_LOCAL, __pyx_k_FORWARD_LOCAL, sizeof(__pyx_k_FORWARD_LOCAL), 0, 0, 1, 1}, {&__pyx_n_s_FORWARD_SWEEP, __pyx_k_FORWARD_SWEEP, sizeof(__pyx_k_FORWARD_SWEEP), 0, 0, 1, 1}, {&__pyx_n_s_FR, __pyx_k_FR, sizeof(__pyx_k_FR), 0, 0, 1, 1}, {&__pyx_n_s_FRB, __pyx_k_FRB, sizeof(__pyx_k_FRB), 0, 0, 1, 1}, {&__pyx_n_s_FROBENIUS, __pyx_k_FROBENIUS, sizeof(__pyx_k_FROBENIUS), 0, 0, 1, 1}, {&__pyx_n_s_FRONT, __pyx_k_FRONT, sizeof(__pyx_k_FRONT), 0, 0, 1, 1}, {&__pyx_n_s_FRONT_DOWN, __pyx_k_FRONT_DOWN, sizeof(__pyx_k_FRONT_DOWN), 0, 0, 1, 1}, {&__pyx_n_s_FRONT_DOWN_LEFT, __pyx_k_FRONT_DOWN_LEFT, sizeof(__pyx_k_FRONT_DOWN_LEFT), 0, 0, 1, 1}, {&__pyx_n_s_FRONT_DOWN_RIGHT, __pyx_k_FRONT_DOWN_RIGHT, sizeof(__pyx_k_FRONT_DOWN_RIGHT), 0, 0, 1, 1}, {&__pyx_n_s_FRONT_LEFT, __pyx_k_FRONT_LEFT, sizeof(__pyx_k_FRONT_LEFT), 0, 0, 1, 1}, {&__pyx_n_s_FRONT_RIGHT, __pyx_k_FRONT_RIGHT, sizeof(__pyx_k_FRONT_RIGHT), 0, 0, 1, 1}, {&__pyx_n_s_FRONT_UP, __pyx_k_FRONT_UP, sizeof(__pyx_k_FRONT_UP), 0, 0, 1, 1}, {&__pyx_n_s_FRONT_UP_LEFT, __pyx_k_FRONT_UP_LEFT, sizeof(__pyx_k_FRONT_UP_LEFT), 0, 0, 1, 1}, {&__pyx_n_s_FRONT_UP_RIGHT, __pyx_k_FRONT_UP_RIGHT, sizeof(__pyx_k_FRONT_UP_RIGHT), 0, 0, 1, 1}, {&__pyx_n_s_FULL, __pyx_k_FULL, sizeof(__pyx_k_FULL), 0, 0, 1, 1}, {&__pyx_n_s_FULL_SIZE, __pyx_k_FULL_SIZE, sizeof(__pyx_k_FULL_SIZE), 0, 0, 1, 1}, {&__pyx_n_s_FV_GHOST, __pyx_k_FV_GHOST, sizeof(__pyx_k_FV_GHOST), 0, 0, 1, 1}, {&__pyx_n_s_FactorShiftType, __pyx_k_FactorShiftType, sizeof(__pyx_k_FactorShiftType), 0, 0, 1, 1}, {&__pyx_kp_s_Factored_matrix_ordering_type_Se, __pyx_k_Factored_matrix_ordering_type_Se, sizeof(__pyx_k_Factored_matrix_ordering_type_Se), 0, 0, 1, 0}, {&__pyx_kp_s_Factored_matrix_shift_type_See_A, __pyx_k_Factored_matrix_shift_type_See_A, sizeof(__pyx_k_Factored_matrix_shift_type_See_A), 0, 0, 1, 0}, {&__pyx_kp_s_Factored_matrix_solver_type_See, __pyx_k_Factored_matrix_solver_type_See, sizeof(__pyx_k_Factored_matrix_solver_type_See), 0, 0, 1, 0}, {&__pyx_n_s_FailedReason, __pyx_k_FailedReason, sizeof(__pyx_k_FailedReason), 0, 0, 1, 1}, {&__pyx_n_s_FieldSplitSchurFactType, __pyx_k_FieldSplitSchurFactType, sizeof(__pyx_k_FieldSplitSchurFactType), 0, 0, 1, 1}, {&__pyx_n_s_FieldSplitSchurPreType, __pyx_k_FieldSplitSchurPreType, sizeof(__pyx_k_FieldSplitSchurPreType), 0, 0, 1, 1}, {&__pyx_n_s_FileMode, __pyx_k_FileMode, sizeof(__pyx_k_FileMode), 0, 0, 1, 1}, {&__pyx_n_s_Format, __pyx_k_Format, sizeof(__pyx_k_Format), 0, 0, 1, 1}, {&__pyx_n_s_Free, __pyx_k_Free, sizeof(__pyx_k_Free), 0, 0, 1, 1}, {&__pyx_n_s_G, __pyx_k_G, sizeof(__pyx_k_G), 0, 0, 1, 1}, {&__pyx_n_s_GALERKIN, __pyx_k_GALERKIN, sizeof(__pyx_k_GALERKIN), 0, 0, 1, 1}, {&__pyx_n_s_GAMG, __pyx_k_GAMG, sizeof(__pyx_k_GAMG), 0, 0, 1, 1}, {&__pyx_n_s_GAMGType, __pyx_k_GAMGType, sizeof(__pyx_k_GAMGType), 0, 0, 1, 1}, {&__pyx_n_s_GASM, __pyx_k_GASM, sizeof(__pyx_k_GASM), 0, 0, 1, 1}, {&__pyx_n_s_GASMType, __pyx_k_GASMType, sizeof(__pyx_k_GASMType), 0, 0, 1, 1}, {&__pyx_n_s_GATHER, __pyx_k_GATHER, sizeof(__pyx_k_GATHER), 0, 0, 1, 1}, {&__pyx_n_s_GATHERV, __pyx_k_GATHERV, sizeof(__pyx_k_GATHERV), 0, 0, 1, 1}, {&__pyx_n_s_GCR, __pyx_k_GCR, sizeof(__pyx_k_GCR), 0, 0, 1, 1}, {&__pyx_n_s_GCRODR, __pyx_k_GCRODR, sizeof(__pyx_k_GCRODR), 0, 0, 1, 1}, {&__pyx_n_s_GD, __pyx_k_GD, sizeof(__pyx_k_GD), 0, 0, 1, 1}, {&__pyx_n_s_GENERAL, __pyx_k_GENERAL, sizeof(__pyx_k_GENERAL), 0, 0, 1, 1}, {&__pyx_n_s_GEO, __pyx_k_GEO, sizeof(__pyx_k_GEO), 0, 0, 1, 1}, {&__pyx_n_s_GETROW_UPPERTRIANGULAR, __pyx_k_GETROW_UPPERTRIANGULAR, sizeof(__pyx_k_GETROW_UPPERTRIANGULAR), 0, 0, 1, 1}, {&__pyx_n_s_GHOSTED, __pyx_k_GHOSTED, sizeof(__pyx_k_GHOSTED), 0, 0, 1, 1}, {&__pyx_kp_s_GIT_Date, __pyx_k_GIT_Date, sizeof(__pyx_k_GIT_Date), 0, 0, 1, 0}, {&__pyx_n_s_GLEE, __pyx_k_GLEE, sizeof(__pyx_k_GLEE), 0, 0, 1, 1}, {&__pyx_n_s_GLLE, __pyx_k_GLLE, sizeof(__pyx_k_GLLE), 0, 0, 1, 1}, {&__pyx_n_s_GLMapMode, __pyx_k_GLMapMode, sizeof(__pyx_k_GLMapMode), 0, 0, 1, 1}, {&__pyx_n_s_GLOBAL_BLOCKING, __pyx_k_GLOBAL_BLOCKING, sizeof(__pyx_k_GLOBAL_BLOCKING), 0, 0, 1, 1}, {&__pyx_n_s_GLOBAL_MAX, __pyx_k_GLOBAL_MAX, sizeof(__pyx_k_GLOBAL_MAX), 0, 0, 1, 1}, {&__pyx_n_s_GLOBAL_NONBLOCKING, __pyx_k_GLOBAL_NONBLOCKING, sizeof(__pyx_k_GLOBAL_NONBLOCKING), 0, 0, 1, 1}, {&__pyx_n_s_GLOBAL_SUM, __pyx_k_GLOBAL_SUM, sizeof(__pyx_k_GLOBAL_SUM), 0, 0, 1, 1}, {&__pyx_n_s_GLTR, __pyx_k_GLTR, sizeof(__pyx_k_GLTR), 0, 0, 1, 1}, {&__pyx_n_s_GLVIS, __pyx_k_GLVIS, sizeof(__pyx_k_GLVIS), 0, 0, 1, 1}, {&__pyx_n_s_GMRES, __pyx_k_GMRES, sizeof(__pyx_k_GMRES), 0, 0, 1, 1}, {&__pyx_n_s_GPCG, __pyx_k_GPCG, sizeof(__pyx_k_GPCG), 0, 0, 1, 1}, {&__pyx_n_s_GROPPCG, __pyx_k_GROPPCG, sizeof(__pyx_k_GROPPCG), 0, 0, 1, 1}, {&__pyx_n_s_Get_rank, __pyx_k_Get_rank, sizeof(__pyx_k_Get_rank), 0, 0, 1, 1}, {&__pyx_n_s_Get_size, __pyx_k_Get_size, sizeof(__pyx_k_Get_size), 0, 0, 1, 1}, {&__pyx_kp_s_Given_d_column_indices_but_d_non, __pyx_k_Given_d_column_indices_but_d_non, sizeof(__pyx_k_Given_d_column_indices_but_d_non), 0, 0, 1, 0}, {&__pyx_n_s_H, __pyx_k_H, sizeof(__pyx_k_H), 0, 0, 1, 1}, {&__pyx_n_s_H2OPUS, __pyx_k_H2OPUS, sizeof(__pyx_k_H2OPUS), 0, 0, 1, 1}, {&__pyx_n_s_HAAR, __pyx_k_HAAR, sizeof(__pyx_k_HAAR), 0, 0, 1, 1}, {&__pyx_n_s_HALF, __pyx_k_HALF, sizeof(__pyx_k_HALF), 0, 0, 1, 1}, {&__pyx_n_s_HALF_SIZE, __pyx_k_HALF_SIZE, sizeof(__pyx_k_HALF_SIZE), 0, 0, 1, 1}, {&__pyx_n_s_HALTED_LOWERBOUND, __pyx_k_HALTED_LOWERBOUND, sizeof(__pyx_k_HALTED_LOWERBOUND), 0, 0, 1, 1}, {&__pyx_n_s_HALTED_MAXFCN, __pyx_k_HALTED_MAXFCN, sizeof(__pyx_k_HALTED_MAXFCN), 0, 0, 1, 1}, {&__pyx_n_s_HALTED_OTHER, __pyx_k_HALTED_OTHER, sizeof(__pyx_k_HALTED_OTHER), 0, 0, 1, 1}, {&__pyx_n_s_HALTED_RTOL, __pyx_k_HALTED_RTOL, sizeof(__pyx_k_HALTED_RTOL), 0, 0, 1, 1}, {&__pyx_n_s_HALTED_UPPERBOUND, __pyx_k_HALTED_UPPERBOUND, sizeof(__pyx_k_HALTED_UPPERBOUND), 0, 0, 1, 1}, {&__pyx_n_s_HALTED_USER, __pyx_k_HALTED_USER, sizeof(__pyx_k_HALTED_USER), 0, 0, 1, 1}, {&__pyx_n_s_HASH, __pyx_k_HASH, sizeof(__pyx_k_HASH), 0, 0, 1, 1}, {&__pyx_n_s_HDF5, __pyx_k_HDF5, sizeof(__pyx_k_HDF5), 0, 0, 1, 1}, {&__pyx_n_s_HDF5_MAT, __pyx_k_HDF5_MAT, sizeof(__pyx_k_HDF5_MAT), 0, 0, 1, 1}, {&__pyx_n_s_HDF5_PETSC, __pyx_k_HDF5_PETSC, sizeof(__pyx_k_HDF5_PETSC), 0, 0, 1, 1}, {&__pyx_n_s_HDF5_VIZ, __pyx_k_HDF5_VIZ, sizeof(__pyx_k_HDF5_VIZ), 0, 0, 1, 1}, {&__pyx_n_s_HDF5_XDMF, __pyx_k_HDF5_XDMF, sizeof(__pyx_k_HDF5_XDMF), 0, 0, 1, 1}, {&__pyx_n_s_HERMITIAN, __pyx_k_HERMITIAN, sizeof(__pyx_k_HERMITIAN), 0, 0, 1, 1}, {&__pyx_n_s_HERMITIANTRANSPOSE, __pyx_k_HERMITIANTRANSPOSE, sizeof(__pyx_k_HERMITIANTRANSPOSE), 0, 0, 1, 1}, {&__pyx_n_s_HEXAHEDRON, __pyx_k_HEXAHEDRON, sizeof(__pyx_k_HEXAHEDRON), 0, 0, 1, 1}, {&__pyx_n_s_HIP, __pyx_k_HIP, sizeof(__pyx_k_HIP), 0, 0, 1, 1}, {&__pyx_n_s_HMG, __pyx_k_HMG, sizeof(__pyx_k_HMG), 0, 0, 1, 1}, {&__pyx_n_s_HOST, __pyx_k_HOST, sizeof(__pyx_k_HOST), 0, 0, 1, 1}, {&__pyx_n_s_HPDDM, __pyx_k_HPDDM, sizeof(__pyx_k_HPDDM), 0, 0, 1, 1}, {&__pyx_n_s_HPDDMCoarseCorrectionType, __pyx_k_HPDDMCoarseCorrectionType, sizeof(__pyx_k_HPDDMCoarseCorrectionType), 0, 0, 1, 1}, {&__pyx_n_s_HPDDMType, __pyx_k_HPDDMType, sizeof(__pyx_k_HPDDMType), 0, 0, 1, 1}, {&__pyx_n_s_HS, __pyx_k_HS, sizeof(__pyx_k_HS), 0, 0, 1, 1}, {&__pyx_n_s_HYPRE, __pyx_k_HYPRE, sizeof(__pyx_k_HYPRE), 0, 0, 1, 1}, {&__pyx_n_s_HYPRESSTRUCT, __pyx_k_HYPRESSTRUCT, sizeof(__pyx_k_HYPRESSTRUCT), 0, 0, 1, 1}, {&__pyx_n_s_HYPRESTRUCT, __pyx_k_HYPRESTRUCT, sizeof(__pyx_k_HYPRESTRUCT), 0, 0, 1, 1}, {&__pyx_n_s_HZ, __pyx_k_HZ, sizeof(__pyx_k_HZ), 0, 0, 1, 1}, {&__pyx_n_s_I, __pyx_k_I, sizeof(__pyx_k_I), 0, 0, 1, 1}, {&__pyx_n_s_IBCGS, __pyx_k_IBCGS, sizeof(__pyx_k_IBCGS), 0, 0, 1, 1}, {&__pyx_n_s_ICC, __pyx_k_ICC, sizeof(__pyx_k_ICC), 0, 0, 1, 1}, {&__pyx_n_s_IGNORE_LOWER_TRIANGULAR, __pyx_k_IGNORE_LOWER_TRIANGULAR, sizeof(__pyx_k_IGNORE_LOWER_TRIANGULAR), 0, 0, 1, 1}, {&__pyx_n_s_IGNORE_NEGATIVE_INDICES, __pyx_k_IGNORE_NEGATIVE_INDICES, sizeof(__pyx_k_IGNORE_NEGATIVE_INDICES), 0, 0, 1, 1}, {&__pyx_n_s_IGNORE_OFF_PROC_ENTRIES, __pyx_k_IGNORE_OFF_PROC_ENTRIES, sizeof(__pyx_k_IGNORE_OFF_PROC_ENTRIES), 0, 0, 1, 1}, {&__pyx_n_s_IGNORE_ZERO_ENTRIES, __pyx_k_IGNORE_ZERO_ENTRIES, sizeof(__pyx_k_IGNORE_ZERO_ENTRIES), 0, 0, 1, 1}, {&__pyx_n_s_ILU, __pyx_k_ILU, sizeof(__pyx_k_ILU), 0, 0, 1, 1}, {&__pyx_n_s_IMPLICIT, __pyx_k_IMPLICIT, sizeof(__pyx_k_IMPLICIT), 0, 0, 1, 1}, {&__pyx_n_s_INBLOCKS, __pyx_k_INBLOCKS, sizeof(__pyx_k_INBLOCKS), 0, 0, 1, 1}, {&__pyx_n_s_INF, __pyx_k_INF, sizeof(__pyx_k_INF), 0, 0, 1, 1}, {&__pyx_n_s_INFINITY, __pyx_k_INFINITY, sizeof(__pyx_k_INFINITY), 0, 0, 1, 1}, {&__pyx_n_s_INITIAL_FINAL_ONLY, __pyx_k_INITIAL_FINAL_ONLY, sizeof(__pyx_k_INITIAL_FINAL_ONLY), 0, 0, 1, 1}, {&__pyx_n_s_INITIAL_ONLY, __pyx_k_INITIAL_ONLY, sizeof(__pyx_k_INITIAL_ONLY), 0, 0, 1, 1}, {&__pyx_n_s_INSERT, __pyx_k_INSERT, sizeof(__pyx_k_INSERT), 0, 0, 1, 1}, {&__pyx_n_s_INSERT_ALL, __pyx_k_INSERT_ALL, sizeof(__pyx_k_INSERT_ALL), 0, 0, 1, 1}, {&__pyx_n_s_INSERT_ALL_VALUES, __pyx_k_INSERT_ALL_VALUES, sizeof(__pyx_k_INSERT_ALL_VALUES), 0, 0, 1, 1}, {&__pyx_n_s_INSERT_BC, __pyx_k_INSERT_BC, sizeof(__pyx_k_INSERT_BC), 0, 0, 1, 1}, {&__pyx_n_s_INSERT_BC_VALUES, __pyx_k_INSERT_BC_VALUES, sizeof(__pyx_k_INSERT_BC_VALUES), 0, 0, 1, 1}, {&__pyx_n_s_INSERT_VALUES, __pyx_k_INSERT_VALUES, sizeof(__pyx_k_INSERT_VALUES), 0, 0, 1, 1}, {&__pyx_n_s_INTERIOR_GHOST, __pyx_k_INTERIOR_GHOST, sizeof(__pyx_k_INTERIOR_GHOST), 0, 0, 1, 1}, {&__pyx_n_s_INTERPOLATE, __pyx_k_INTERPOLATE, sizeof(__pyx_k_INTERPOLATE), 0, 0, 1, 1}, {&__pyx_n_s_IPM, __pyx_k_IPM, sizeof(__pyx_k_IPM), 0, 0, 1, 1}, {&__pyx_n_s_IS, __pyx_k_IS, sizeof(__pyx_k_IS), 0, 0, 1, 1}, {&__pyx_n_s_ISType, __pyx_k_ISType, sizeof(__pyx_k_ISType), 0, 0, 1, 1}, {&__pyx_n_s_IS_buffer, __pyx_k_IS_buffer, sizeof(__pyx_k_IS_buffer), 0, 0, 1, 1}, {&__pyx_n_s_ITERATING, __pyx_k_ITERATING, sizeof(__pyx_k_ITERATING), 0, 0, 1, 1}, {&__pyx_kp_s_I_0_is_d_expected_d, __pyx_k_I_0_is_d_expected_d, sizeof(__pyx_k_I_0_is_d_expected_d), 0, 0, 1, 0}, {&__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_k_Incompatible_checksums_0x_x_vs_0, sizeof(__pyx_k_Incompatible_checksums_0x_x_vs_0), 0, 0, 1, 0}, {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1}, {&__pyx_kp_s_Index_out_of_bounds_axis_d, __pyx_k_Index_out_of_bounds_axis_d, sizeof(__pyx_k_Index_out_of_bounds_axis_d), 0, 0, 1, 0}, {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0}, {&__pyx_n_s_InfoType, __pyx_k_InfoType, sizeof(__pyx_k_InfoType), 0, 0, 1, 1}, {&__pyx_kp_s_Input_vector_has_no_tensor_infor, __pyx_k_Input_vector_has_no_tensor_infor, sizeof(__pyx_k_Input_vector_has_no_tensor_infor), 0, 0, 1, 0}, {&__pyx_n_s_InsertMode, __pyx_k_InsertMode, sizeof(__pyx_k_InsertMode), 0, 0, 1, 1}, {&__pyx_kp_s_Insertion_mode_Most_commonly_use, __pyx_k_Insertion_mode_Most_commonly_use, sizeof(__pyx_k_Insertion_mode_Most_commonly_use), 0, 0, 1, 0}, {&__pyx_n_s_IntType, __pyx_k_IntType, sizeof(__pyx_k_IntType), 0, 0, 1, 1}, {&__pyx_n_s_InterpolationType, __pyx_k_InterpolationType, sizeof(__pyx_k_InterpolationType), 0, 0, 1, 1}, {&__pyx_kp_u_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr, sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 1, 0, 0}, {&__pyx_kp_s_Invalid_mode_expected_r_w_or_rw, __pyx_k_Invalid_mode_expected_r_w_or_rw, sizeof(__pyx_k_Invalid_mode_expected_r_w_or_rw), 0, 0, 1, 0}, {&__pyx_kp_s_Invalid_mode_expected_rw_r_or_w, __pyx_k_Invalid_mode_expected_rw_r_or_w, sizeof(__pyx_k_Invalid_mode_expected_rw_r_or_w), 0, 0, 1, 0}, {&__pyx_kp_u_Invalid_shape_in_axis, __pyx_k_Invalid_shape_in_axis, sizeof(__pyx_k_Invalid_shape_in_axis), 0, 1, 0, 0}, {&__pyx_n_s_J, __pyx_k_J, sizeof(__pyx_k_J), 0, 0, 1, 1}, {&__pyx_n_s_JACOBI, __pyx_k_JACOBI, sizeof(__pyx_k_JACOBI), 0, 0, 1, 1}, {&__pyx_n_s_JoinMode, __pyx_k_JoinMode, sizeof(__pyx_k_JoinMode), 0, 0, 1, 1}, {&__pyx_n_s_KACZMARZ, __pyx_k_KACZMARZ, sizeof(__pyx_k_KACZMARZ), 0, 0, 1, 1}, {&__pyx_n_s_KAIJ, __pyx_k_KAIJ, sizeof(__pyx_k_KAIJ), 0, 0, 1, 1}, {&__pyx_n_s_KASKADE, __pyx_k_KASKADE, sizeof(__pyx_k_KASKADE), 0, 0, 1, 1}, {&__pyx_n_s_KD, __pyx_k_KD, sizeof(__pyx_k_KD), 0, 0, 1, 1}, {&__pyx_n_s_KEEP_NONZERO_PATTERN, __pyx_k_KEEP_NONZERO_PATTERN, sizeof(__pyx_k_KEEP_NONZERO_PATTERN), 0, 0, 1, 1}, {&__pyx_n_s_KLU, __pyx_k_KLU, sizeof(__pyx_k_KLU), 0, 0, 1, 1}, {&__pyx_n_s_KOKKOS, __pyx_k_KOKKOS, sizeof(__pyx_k_KOKKOS), 0, 0, 1, 1}, {&__pyx_n_s_KSP, __pyx_k_KSP, sizeof(__pyx_k_KSP), 0, 0, 1, 1}, {&__pyx_n_s_KSPConvergedReason, __pyx_k_KSPConvergedReason, sizeof(__pyx_k_KSPConvergedReason), 0, 0, 1, 1}, {&__pyx_n_s_KSPHPDDMType, __pyx_k_KSPHPDDMType, sizeof(__pyx_k_KSPHPDDMType), 0, 0, 1, 1}, {&__pyx_n_s_KSPNormType, __pyx_k_KSPNormType, sizeof(__pyx_k_KSPNormType), 0, 0, 1, 1}, {&__pyx_n_s_KSPONLY, __pyx_k_KSPONLY, sizeof(__pyx_k_KSPONLY), 0, 0, 1, 1}, {&__pyx_n_s_KSPTRANSPOSEONLY, __pyx_k_KSPTRANSPOSEONLY, sizeof(__pyx_k_KSPTRANSPOSEONLY), 0, 0, 1, 1}, {&__pyx_n_s_KSPType, __pyx_k_KSPType, sizeof(__pyx_k_KSPType), 0, 0, 1, 1}, {&__pyx_kp_s_KSP_Converged_Reason_CONVERGED_I, __pyx_k_KSP_Converged_Reason_CONVERGED_I, sizeof(__pyx_k_KSP_Converged_Reason_CONVERGED_I), 0, 0, 1, 0}, {&__pyx_kp_s_KSP_Type_The_available_types_are, __pyx_k_KSP_Type_The_available_types_are, sizeof(__pyx_k_KSP_Type_The_available_types_are), 0, 0, 1, 0}, {&__pyx_kp_s_KSP_norm_type_The_available_norm, __pyx_k_KSP_norm_type_The_available_norm, sizeof(__pyx_k_KSP_norm_type_The_available_norm), 0, 0, 1, 0}, {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1}, {&__pyx_n_s_L, __pyx_k_L, sizeof(__pyx_k_L), 0, 0, 1, 1}, {&__pyx_n_s_LAGRANGE, __pyx_k_LAGRANGE, sizeof(__pyx_k_LAGRANGE), 0, 0, 1, 1}, {&__pyx_n_s_LAYOUT_GAUSS, __pyx_k_LAYOUT_GAUSS, sizeof(__pyx_k_LAYOUT_GAUSS), 0, 0, 1, 1}, {&__pyx_n_s_LAYOUT_REGULAR, __pyx_k_LAYOUT_REGULAR, sizeof(__pyx_k_LAYOUT_REGULAR), 0, 0, 1, 1}, {&__pyx_n_s_LAYOUT_SUBDIVISION, __pyx_k_LAYOUT_SUBDIVISION, sizeof(__pyx_k_LAYOUT_SUBDIVISION), 0, 0, 1, 1}, {&__pyx_n_s_LCD, __pyx_k_LCD, sizeof(__pyx_k_LCD), 0, 0, 1, 1}, {&__pyx_n_s_LCL, __pyx_k_LCL, sizeof(__pyx_k_LCL), 0, 0, 1, 1}, {&__pyx_n_s_LEFT, __pyx_k_LEFT, sizeof(__pyx_k_LEFT), 0, 0, 1, 1}, {&__pyx_n_s_LGMRES, __pyx_k_LGMRES, sizeof(__pyx_k_LGMRES), 0, 0, 1, 1}, {&__pyx_n_s_LGMap, __pyx_k_LGMap, sizeof(__pyx_k_LGMap), 0, 0, 1, 1}, {&__pyx_n_s_LGMapType, __pyx_k_LGMapType, sizeof(__pyx_k_LGMapType), 0, 0, 1, 1}, {&__pyx_n_s_LINEAR, __pyx_k_LINEAR, sizeof(__pyx_k_LINEAR), 0, 0, 1, 1}, {&__pyx_n_s_LMVM, __pyx_k_LMVM, sizeof(__pyx_k_LMVM), 0, 0, 1, 1}, {&__pyx_n_s_LMVMBADBROYDEN, __pyx_k_LMVMBADBROYDEN, sizeof(__pyx_k_LMVMBADBROYDEN), 0, 0, 1, 1}, {&__pyx_n_s_LMVMBFGS, __pyx_k_LMVMBFGS, sizeof(__pyx_k_LMVMBFGS), 0, 0, 1, 1}, {&__pyx_n_s_LMVMBROYDEN, __pyx_k_LMVMBROYDEN, sizeof(__pyx_k_LMVMBROYDEN), 0, 0, 1, 1}, {&__pyx_n_s_LMVMDFP, __pyx_k_LMVMDFP, sizeof(__pyx_k_LMVMDFP), 0, 0, 1, 1}, {&__pyx_n_s_LMVMDIAGBBROYDEN, __pyx_k_LMVMDIAGBBROYDEN, sizeof(__pyx_k_LMVMDIAGBBROYDEN), 0, 0, 1, 1}, {&__pyx_n_s_LMVMSR1, __pyx_k_LMVMSR1, sizeof(__pyx_k_LMVMSR1), 0, 0, 1, 1}, {&__pyx_n_s_LMVMSYMBADBROYDEN, __pyx_k_LMVMSYMBADBROYDEN, sizeof(__pyx_k_LMVMSYMBADBROYDEN), 0, 0, 1, 1}, {&__pyx_n_s_LMVMSYMBROYDEN, __pyx_k_LMVMSYMBROYDEN, sizeof(__pyx_k_LMVMSYMBROYDEN), 0, 0, 1, 1}, {&__pyx_n_s_LOAD_BALANCE, __pyx_k_LOAD_BALANCE, sizeof(__pyx_k_LOAD_BALANCE), 0, 0, 1, 1}, {&__pyx_n_s_LOCAL, __pyx_k_LOCAL, sizeof(__pyx_k_LOCAL), 0, 0, 1, 1}, {&__pyx_n_s_LOCALREF, __pyx_k_LOCALREF, sizeof(__pyx_k_LOCALREF), 0, 0, 1, 1}, {&__pyx_n_s_LOCAL_BACKWARD_SWEEP, __pyx_k_LOCAL_BACKWARD_SWEEP, sizeof(__pyx_k_LOCAL_BACKWARD_SWEEP), 0, 0, 1, 1}, {&__pyx_n_s_LOCAL_FORWARD_SWEEP, __pyx_k_LOCAL_FORWARD_SWEEP, sizeof(__pyx_k_LOCAL_FORWARD_SWEEP), 0, 0, 1, 1}, {&__pyx_n_s_LOCAL_SYMMETRIC_SWEEP, __pyx_k_LOCAL_SYMMETRIC_SWEEP, sizeof(__pyx_k_LOCAL_SYMMETRIC_SWEEP), 0, 0, 1, 1}, {&__pyx_n_s_LOWER, __pyx_k_LOWER, sizeof(__pyx_k_LOWER), 0, 0, 1, 1}, {&__pyx_n_s_LRC, __pyx_k_LRC, sizeof(__pyx_k_LRC), 0, 0, 1, 1}, {&__pyx_n_s_LSC, __pyx_k_LSC, sizeof(__pyx_k_LSC), 0, 0, 1, 1}, {&__pyx_n_s_LSQR, __pyx_k_LSQR, sizeof(__pyx_k_LSQR), 0, 0, 1, 1}, {&__pyx_n_s_LU, __pyx_k_LU, sizeof(__pyx_k_LU), 0, 0, 1, 1}, {&__pyx_n_s_LUSOL, __pyx_k_LUSOL, sizeof(__pyx_k_LUSOL), 0, 0, 1, 1}, {&__pyx_n_s_Left, __pyx_k_Left, sizeof(__pyx_k_Left), 0, 0, 1, 1}, {&__pyx_n_s_Log, __pyx_k_Log, sizeof(__pyx_k_Log), 0, 0, 1, 1}, {&__pyx_n_s_LogClass, __pyx_k_LogClass, sizeof(__pyx_k_LogClass), 0, 0, 1, 1}, {&__pyx_n_s_LogEvent, __pyx_k_LogEvent, sizeof(__pyx_k_LogEvent), 0, 0, 1, 1}, {&__pyx_n_s_LogStage, __pyx_k_LogStage, sizeof(__pyx_k_LogStage), 0, 0, 1, 1}, {&__pyx_n_s_MAIJ, __pyx_k_MAIJ, sizeof(__pyx_k_MAIJ), 0, 0, 1, 1}, {&__pyx_n_s_MAPPING, __pyx_k_MAPPING, sizeof(__pyx_k_MAPPING), 0, 0, 1, 1}, {&__pyx_n_s_MASK, __pyx_k_MASK, sizeof(__pyx_k_MASK), 0, 0, 1, 1}, {&__pyx_n_s_MAT, __pyx_k_MAT, sizeof(__pyx_k_MAT), 0, 0, 1, 1}, {&__pyx_n_s_MATCHSTEP, __pyx_k_MATCHSTEP, sizeof(__pyx_k_MATCHSTEP), 0, 0, 1, 1}, {&__pyx_n_s_MATHEMATICA, __pyx_k_MATHEMATICA, sizeof(__pyx_k_MATHEMATICA), 0, 0, 1, 1}, {&__pyx_n_s_MATLAB, __pyx_k_MATLAB, sizeof(__pyx_k_MATLAB), 0, 0, 1, 1}, {&__pyx_n_s_MATPARTITIONING, __pyx_k_MATPARTITIONING, sizeof(__pyx_k_MATPARTITIONING), 0, 0, 1, 1}, {&__pyx_n_s_MAX, __pyx_k_MAX, sizeof(__pyx_k_MAX), 0, 0, 1, 1}, {&__pyx_n_s_MAX_VALUES, __pyx_k_MAX_VALUES, sizeof(__pyx_k_MAX_VALUES), 0, 0, 1, 1}, {&__pyx_n_s_MEMORYSCALABLE, __pyx_k_MEMORYSCALABLE, sizeof(__pyx_k_MEMORYSCALABLE), 0, 0, 1, 1}, {&__pyx_n_s_METISND, __pyx_k_METISND, sizeof(__pyx_k_METISND), 0, 0, 1, 1}, {&__pyx_n_s_MEYER, __pyx_k_MEYER, sizeof(__pyx_k_MEYER), 0, 0, 1, 1}, {&__pyx_n_s_MFFD, __pyx_k_MFFD, sizeof(__pyx_k_MFFD), 0, 0, 1, 1}, {&__pyx_n_s_MG, __pyx_k_MG, sizeof(__pyx_k_MG), 0, 0, 1, 1}, {&__pyx_n_s_MGCycleType, __pyx_k_MGCycleType, sizeof(__pyx_k_MGCycleType), 0, 0, 1, 1}, {&__pyx_n_s_MGType, __pyx_k_MGType, sizeof(__pyx_k_MGType), 0, 0, 1, 1}, {&__pyx_n_s_MIGRATE_BASIC, __pyx_k_MIGRATE_BASIC, sizeof(__pyx_k_MIGRATE_BASIC), 0, 0, 1, 1}, {&__pyx_n_s_MIGRATE_DMCELLEXACT, __pyx_k_MIGRATE_DMCELLEXACT, sizeof(__pyx_k_MIGRATE_DMCELLEXACT), 0, 0, 1, 1}, {&__pyx_n_s_MIGRATE_DMCELLNSCATTER, __pyx_k_MIGRATE_DMCELLNSCATTER, sizeof(__pyx_k_MIGRATE_DMCELLNSCATTER), 0, 0, 1, 1}, {&__pyx_n_s_MIGRATE_USER, __pyx_k_MIGRATE_USER, sizeof(__pyx_k_MIGRATE_USER), 0, 0, 1, 1}, {&__pyx_n_s_MIMEX, __pyx_k_MIMEX, sizeof(__pyx_k_MIMEX), 0, 0, 1, 1}, {&__pyx_n_s_MINRES, __pyx_k_MINRES, sizeof(__pyx_k_MINRES), 0, 0, 1, 1}, {&__pyx_n_s_MIRROR, __pyx_k_MIRROR, sizeof(__pyx_k_MIRROR), 0, 0, 1, 1}, {&__pyx_n_s_MKL_CPARDISO, __pyx_k_MKL_CPARDISO, sizeof(__pyx_k_MKL_CPARDISO), 0, 0, 1, 1}, {&__pyx_n_s_MKL_PARDISO, __pyx_k_MKL_PARDISO, sizeof(__pyx_k_MKL_PARDISO), 0, 0, 1, 1}, {&__pyx_n_s_ML, __pyx_k_ML, sizeof(__pyx_k_ML), 0, 0, 1, 1}, {&__pyx_n_s_MOAB, __pyx_k_MOAB, sizeof(__pyx_k_MOAB), 0, 0, 1, 1}, {&__pyx_n_s_MORETHUENTE, __pyx_k_MORETHUENTE, sizeof(__pyx_k_MORETHUENTE), 0, 0, 1, 1}, {&__pyx_n_s_MPI, __pyx_k_MPI, sizeof(__pyx_k_MPI), 0, 0, 1, 1}, {&__pyx_n_s_MPIADJ, __pyx_k_MPIADJ, sizeof(__pyx_k_MPIADJ), 0, 0, 1, 1}, {&__pyx_n_s_MPIAIJ, __pyx_k_MPIAIJ, sizeof(__pyx_k_MPIAIJ), 0, 0, 1, 1}, {&__pyx_n_s_MPIAIJCRL, __pyx_k_MPIAIJCRL, sizeof(__pyx_k_MPIAIJCRL), 0, 0, 1, 1}, {&__pyx_n_s_MPIAIJCUSPARSE, __pyx_k_MPIAIJCUSPARSE, sizeof(__pyx_k_MPIAIJCUSPARSE), 0, 0, 1, 1}, {&__pyx_n_s_MPIAIJMKL, __pyx_k_MPIAIJMKL, sizeof(__pyx_k_MPIAIJMKL), 0, 0, 1, 1}, {&__pyx_n_s_MPIAIJPERM, __pyx_k_MPIAIJPERM, sizeof(__pyx_k_MPIAIJPERM), 0, 0, 1, 1}, {&__pyx_n_s_MPIAIJSELL, __pyx_k_MPIAIJSELL, sizeof(__pyx_k_MPIAIJSELL), 0, 0, 1, 1}, {&__pyx_n_s_MPIAIJVIENNACL, __pyx_k_MPIAIJVIENNACL, sizeof(__pyx_k_MPIAIJVIENNACL), 0, 0, 1, 1}, {&__pyx_n_s_MPIBAIJ, __pyx_k_MPIBAIJ, sizeof(__pyx_k_MPIBAIJ), 0, 0, 1, 1}, {&__pyx_n_s_MPIBAIJMKL, __pyx_k_MPIBAIJMKL, sizeof(__pyx_k_MPIBAIJMKL), 0, 0, 1, 1}, {&__pyx_n_s_MPICUDA, __pyx_k_MPICUDA, sizeof(__pyx_k_MPICUDA), 0, 0, 1, 1}, {&__pyx_n_s_MPIDENSE, __pyx_k_MPIDENSE, sizeof(__pyx_k_MPIDENSE), 0, 0, 1, 1}, {&__pyx_n_s_MPIDENSECUDA, __pyx_k_MPIDENSECUDA, sizeof(__pyx_k_MPIDENSECUDA), 0, 0, 1, 1}, {&__pyx_n_s_MPIHIP, __pyx_k_MPIHIP, sizeof(__pyx_k_MPIHIP), 0, 0, 1, 1}, {&__pyx_n_s_MPIKAIJ, __pyx_k_MPIKAIJ, sizeof(__pyx_k_MPIKAIJ), 0, 0, 1, 1}, {&__pyx_n_s_MPIKOKKOS, __pyx_k_MPIKOKKOS, sizeof(__pyx_k_MPIKOKKOS), 0, 0, 1, 1}, {&__pyx_n_s_MPIMAIJ, __pyx_k_MPIMAIJ, sizeof(__pyx_k_MPIMAIJ), 0, 0, 1, 1}, {&__pyx_n_s_MPISBAIJ, __pyx_k_MPISBAIJ, sizeof(__pyx_k_MPISBAIJ), 0, 0, 1, 1}, {&__pyx_n_s_MPISELL, __pyx_k_MPISELL, sizeof(__pyx_k_MPISELL), 0, 0, 1, 1}, {&__pyx_n_s_MPIVIENNACL, __pyx_k_MPIVIENNACL, sizeof(__pyx_k_MPIVIENNACL), 0, 0, 1, 1}, {&__pyx_n_s_MPRK, __pyx_k_MPRK, sizeof(__pyx_k_MPRK), 0, 0, 1, 1}, {&__pyx_n_s_MS, __pyx_k_MS, sizeof(__pyx_k_MS), 0, 0, 1, 1}, {&__pyx_n_s_MULTIPLICATIVE, __pyx_k_MULTIPLICATIVE, sizeof(__pyx_k_MULTIPLICATIVE), 0, 0, 1, 1}, {&__pyx_n_s_MUMPS, __pyx_k_MUMPS, sizeof(__pyx_k_MUMPS), 0, 0, 1, 1}, {&__pyx_n_s_MapMode, __pyx_k_MapMode, sizeof(__pyx_k_MapMode), 0, 0, 1, 1}, {&__pyx_n_s_Mat, __pyx_k_Mat, sizeof(__pyx_k_Mat), 0, 0, 1, 1}, {&__pyx_n_s_MatAssemblyType, __pyx_k_MatAssemblyType, sizeof(__pyx_k_MatAssemblyType), 0, 0, 1, 1}, {&__pyx_n_s_MatDuplicateOption, __pyx_k_MatDuplicateOption, sizeof(__pyx_k_MatDuplicateOption), 0, 0, 1, 1}, {&__pyx_n_s_MatFactorShiftType, __pyx_k_MatFactorShiftType, sizeof(__pyx_k_MatFactorShiftType), 0, 0, 1, 1}, {&__pyx_n_s_MatInfoType, __pyx_k_MatInfoType, sizeof(__pyx_k_MatInfoType), 0, 0, 1, 1}, {&__pyx_n_s_MatOption, __pyx_k_MatOption, sizeof(__pyx_k_MatOption), 0, 0, 1, 1}, {&__pyx_n_s_MatOrderingType, __pyx_k_MatOrderingType, sizeof(__pyx_k_MatOrderingType), 0, 0, 1, 1}, {&__pyx_n_s_MatPartitioning, __pyx_k_MatPartitioning, sizeof(__pyx_k_MatPartitioning), 0, 0, 1, 1}, {&__pyx_n_s_MatPartitioningType, __pyx_k_MatPartitioningType, sizeof(__pyx_k_MatPartitioningType), 0, 0, 1, 1}, {&__pyx_n_s_MatSORType, __pyx_k_MatSORType, sizeof(__pyx_k_MatSORType), 0, 0, 1, 1}, {&__pyx_n_s_MatSolverType, __pyx_k_MatSolverType, sizeof(__pyx_k_MatSolverType), 0, 0, 1, 1}, {&__pyx_n_s_MatStructure, __pyx_k_MatStructure, sizeof(__pyx_k_MatStructure), 0, 0, 1, 1}, {&__pyx_n_s_MatType, __pyx_k_MatType, sizeof(__pyx_k_MatType), 0, 0, 1, 1}, {&__pyx_kp_s_Matrix_SOR_type_See_Also_petsc_M, __pyx_k_Matrix_SOR_type_See_Also_petsc_M, sizeof(__pyx_k_Matrix_SOR_type_See_Also_petsc_M), 0, 0, 1, 0}, {&__pyx_kp_s_Matrix_assembly_type_See_Also_pe, __pyx_k_Matrix_assembly_type_See_Also_pe, sizeof(__pyx_k_Matrix_assembly_type_See_Also_pe), 0, 0, 1, 0}, {&__pyx_kp_s_Matrix_duplicate_option_See_Also, __pyx_k_Matrix_duplicate_option_See_Also, sizeof(__pyx_k_Matrix_duplicate_option_See_Also), 0, 0, 1, 0}, {&__pyx_kp_s_Matrix_info_type, __pyx_k_Matrix_info_type, sizeof(__pyx_k_Matrix_info_type), 0, 0, 1, 0}, {&__pyx_kp_s_Matrix_modification_structure_Se, __pyx_k_Matrix_modification_structure_Se, sizeof(__pyx_k_Matrix_modification_structure_Se), 0, 0, 1, 0}, {&__pyx_kp_s_Matrix_option_See_Also_petsc_Mat, __pyx_k_Matrix_option_See_Also_petsc_Mat, sizeof(__pyx_k_Matrix_option_See_Also_petsc_Mat), 0, 0, 1, 0}, {&__pyx_kp_s_Matrix_type_See_Also_petsc_MatTy, __pyx_k_Matrix_type_See_Also_petsc_MatTy, sizeof(__pyx_k_Matrix_type_See_Also_petsc_MatTy), 0, 0, 1, 0}, {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1}, {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x, sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0}, {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object, sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0}, {&__pyx_n_s_MigrateType, __pyx_k_MigrateType, sizeof(__pyx_k_MigrateType), 0, 0, 1, 1}, {&__pyx_kp_s_Missing_input_parameters, __pyx_k_Missing_input_parameters, sizeof(__pyx_k_Missing_input_parameters), 0, 0, 1, 0}, {&__pyx_n_s_Mode, __pyx_k_Mode, sizeof(__pyx_k_Mode), 0, 0, 1, 1}, {&__pyx_kp_s_More_constants_INFINITY_Very_la, __pyx_k_More_constants_INFINITY_Very_la, sizeof(__pyx_k_More_constants_INFINITY_Very_la), 0, 0, 1, 0}, {&__pyx_kp_s_Must_provide_as_many_communicato, __pyx_k_Must_provide_as_many_communicato, sizeof(__pyx_k_Must_provide_as_many_communicato), 0, 0, 1, 0}, {&__pyx_kp_s_Must_provide_both_sizes_and_poin, __pyx_k_Must_provide_both_sizes_and_poin, sizeof(__pyx_k_Must_provide_both_sizes_and_poin), 0, 0, 1, 0}, {&__pyx_kp_s_Must_provide_operator_for_USER_o, __pyx_k_Must_provide_operator_for_USER_o, sizeof(__pyx_k_Must_provide_operator_for_USER_o), 0, 0, 1, 0}, {&__pyx_n_s_N1, __pyx_k_N1, sizeof(__pyx_k_N1), 0, 0, 1, 1}, {&__pyx_n_s_N12, __pyx_k_N12, sizeof(__pyx_k_N12), 0, 0, 1, 1}, {&__pyx_n_s_N2, __pyx_k_N2, sizeof(__pyx_k_N2), 0, 0, 1, 1}, {&__pyx_n_s_NASH, __pyx_k_NASH, sizeof(__pyx_k_NASH), 0, 0, 1, 1}, {&__pyx_n_s_NASM, __pyx_k_NASM, sizeof(__pyx_k_NASM), 0, 0, 1, 1}, {&__pyx_n_s_NATIVE, __pyx_k_NATIVE, sizeof(__pyx_k_NATIVE), 0, 0, 1, 1}, {&__pyx_n_s_NATURAL, __pyx_k_NATURAL, sizeof(__pyx_k_NATURAL), 0, 0, 1, 1}, {&__pyx_n_s_NCG, __pyx_k_NCG, sizeof(__pyx_k_NCG), 0, 0, 1, 1}, {&__pyx_n_s_ND, __pyx_k_ND, sizeof(__pyx_k_ND), 0, 0, 1, 1}, {&__pyx_n_s_ND_Pi, __pyx_k_ND_Pi, sizeof(__pyx_k_ND_Pi), 0, 0, 1, 1}, {&__pyx_n_s_ND_Pi_Full, __pyx_k_ND_Pi_Full, sizeof(__pyx_k_ND_Pi_Full), 0, 0, 1, 1}, {&__pyx_n_s_NEIGHBOR, __pyx_k_NEIGHBOR, sizeof(__pyx_k_NEIGHBOR), 0, 0, 1, 1}, {&__pyx_n_s_NEST, __pyx_k_NEST, sizeof(__pyx_k_NEST), 0, 0, 1, 1}, {&__pyx_n_s_NETWORK, __pyx_k_NETWORK, sizeof(__pyx_k_NETWORK), 0, 0, 1, 1}, {&__pyx_n_s_NEWTONLS, __pyx_k_NEWTONLS, sizeof(__pyx_k_NEWTONLS), 0, 0, 1, 1}, {&__pyx_n_s_NEWTONTR, __pyx_k_NEWTONTR, sizeof(__pyx_k_NEWTONTR), 0, 0, 1, 1}, {&__pyx_n_s_NEW_NONZERO_ALLOCATION_ERR, __pyx_k_NEW_NONZERO_ALLOCATION_ERR, sizeof(__pyx_k_NEW_NONZERO_ALLOCATION_ERR), 0, 0, 1, 1}, {&__pyx_n_s_NEW_NONZERO_LOCATIONS, __pyx_k_NEW_NONZERO_LOCATIONS, sizeof(__pyx_k_NEW_NONZERO_LOCATIONS), 0, 0, 1, 1}, {&__pyx_n_s_NEW_NONZERO_LOCATION_ERR, __pyx_k_NEW_NONZERO_LOCATION_ERR, sizeof(__pyx_k_NEW_NONZERO_LOCATION_ERR), 0, 0, 1, 1}, {&__pyx_n_s_NGMRES, __pyx_k_NGMRES, sizeof(__pyx_k_NGMRES), 0, 0, 1, 1}, {&__pyx_n_s_NGS, __pyx_k_NGS, sizeof(__pyx_k_NGS), 0, 0, 1, 1}, {&__pyx_n_s_NINFINITY, __pyx_k_NINFINITY, sizeof(__pyx_k_NINFINITY), 0, 0, 1, 1}, {&__pyx_n_s_NLS, __pyx_k_NLS, sizeof(__pyx_k_NLS), 0, 0, 1, 1}, {&__pyx_n_s_NM, __pyx_k_NM, sizeof(__pyx_k_NM), 0, 0, 1, 1}, {&__pyx_n_s_NN, __pyx_k_NN, sizeof(__pyx_k_NN), 0, 0, 1, 1}, {&__pyx_n_s_NO, __pyx_k_NO, sizeof(__pyx_k_NO), 0, 0, 1, 1}, {&__pyx_n_s_NOERROR, __pyx_k_NOERROR, sizeof(__pyx_k_NOERROR), 0, 0, 1, 1}, {&__pyx_n_s_NOFORMAT, __pyx_k_NOFORMAT, sizeof(__pyx_k_NOFORMAT), 0, 0, 1, 1}, {&__pyx_n_s_NONE, __pyx_k_NONE, sizeof(__pyx_k_NONE), 0, 0, 1, 1}, {&__pyx_n_s_NONLINEAR, __pyx_k_NONLINEAR, sizeof(__pyx_k_NONLINEAR), 0, 0, 1, 1}, {&__pyx_n_s_NONZERO, __pyx_k_NONZERO, sizeof(__pyx_k_NONZERO), 0, 0, 1, 1}, {&__pyx_n_s_NORMAL, __pyx_k_NORMAL, sizeof(__pyx_k_NORMAL), 0, 0, 1, 1}, {&__pyx_n_s_NORMALHERMITIAN, __pyx_k_NORMALHERMITIAN, sizeof(__pyx_k_NORMALHERMITIAN), 0, 0, 1, 1}, {&__pyx_n_s_NORM_1, __pyx_k_NORM_1, sizeof(__pyx_k_NORM_1), 0, 0, 1, 1}, {&__pyx_n_s_NORM_1_AND_2, __pyx_k_NORM_1_AND_2, sizeof(__pyx_k_NORM_1_AND_2), 0, 0, 1, 1}, {&__pyx_n_s_NORM_2, __pyx_k_NORM_2, sizeof(__pyx_k_NORM_2), 0, 0, 1, 1}, {&__pyx_n_s_NORM_ALWAYS, __pyx_k_NORM_ALWAYS, sizeof(__pyx_k_NORM_ALWAYS), 0, 0, 1, 1}, {&__pyx_n_s_NORM_DEFAULT, __pyx_k_NORM_DEFAULT, sizeof(__pyx_k_NORM_DEFAULT), 0, 0, 1, 1}, {&__pyx_n_s_NORM_FINAL_ONLY, __pyx_k_NORM_FINAL_ONLY, sizeof(__pyx_k_NORM_FINAL_ONLY), 0, 0, 1, 1}, {&__pyx_n_s_NORM_FROBENIUS, __pyx_k_NORM_FROBENIUS, sizeof(__pyx_k_NORM_FROBENIUS), 0, 0, 1, 1}, {&__pyx_n_s_NORM_INFINITY, __pyx_k_NORM_INFINITY, sizeof(__pyx_k_NORM_INFINITY), 0, 0, 1, 1}, {&__pyx_n_s_NORM_INITIAL_FINAL_ONLY, __pyx_k_NORM_INITIAL_FINAL_ONLY, sizeof(__pyx_k_NORM_INITIAL_FINAL_ONLY), 0, 0, 1, 1}, {&__pyx_n_s_NORM_INITIAL_ONLY, __pyx_k_NORM_INITIAL_ONLY, sizeof(__pyx_k_NORM_INITIAL_ONLY), 0, 0, 1, 1}, {&__pyx_n_s_NORM_MAX, __pyx_k_NORM_MAX, sizeof(__pyx_k_NORM_MAX), 0, 0, 1, 1}, {&__pyx_n_s_NORM_NATURAL, __pyx_k_NORM_NATURAL, sizeof(__pyx_k_NORM_NATURAL), 0, 0, 1, 1}, {&__pyx_n_s_NORM_NONE, __pyx_k_NORM_NONE, sizeof(__pyx_k_NORM_NONE), 0, 0, 1, 1}, {&__pyx_n_s_NORM_PRECONDITIONED, __pyx_k_NORM_PRECONDITIONED, sizeof(__pyx_k_NORM_PRECONDITIONED), 0, 0, 1, 1}, {&__pyx_n_s_NORM_UNPRECONDITIONED, __pyx_k_NORM_UNPRECONDITIONED, sizeof(__pyx_k_NORM_UNPRECONDITIONED), 0, 0, 1, 1}, {&__pyx_n_s_NOTSET, __pyx_k_NOTSET, sizeof(__pyx_k_NOTSET), 0, 0, 1, 1}, {&__pyx_n_s_NOT_SET_VALUES, __pyx_k_NOT_SET_VALUES, sizeof(__pyx_k_NOT_SET_VALUES), 0, 0, 1, 1}, {&__pyx_n_s_NO_OFF_PROC_ENTRIES, __pyx_k_NO_OFF_PROC_ENTRIES, sizeof(__pyx_k_NO_OFF_PROC_ENTRIES), 0, 0, 1, 1}, {&__pyx_n_s_NO_OFF_PROC_ZERO_ROWS, __pyx_k_NO_OFF_PROC_ZERO_ROWS, sizeof(__pyx_k_NO_OFF_PROC_ZERO_ROWS), 0, 0, 1, 1}, {&__pyx_n_s_NO_SYNC, __pyx_k_NO_SYNC, sizeof(__pyx_k_NO_SYNC), 0, 0, 1, 1}, {&__pyx_n_s_NRICHARDSON, __pyx_k_NRICHARDSON, sizeof(__pyx_k_NRICHARDSON), 0, 0, 1, 1}, {&__pyx_n_s_NTL, __pyx_k_NTL, sizeof(__pyx_k_NTL), 0, 0, 1, 1}, {&__pyx_n_s_NTR, __pyx_k_NTR, sizeof(__pyx_k_NTR), 0, 0, 1, 1}, {&__pyx_n_s_NULLLOC, __pyx_k_NULLLOC, sizeof(__pyx_k_NULLLOC), 0, 0, 1, 1}, {&__pyx_n_s_NZ, __pyx_k_NZ, sizeof(__pyx_k_NZ), 0, 0, 1, 1}, {&__pyx_n_s_NormSchedule, __pyx_k_NormSchedule, sizeof(__pyx_k_NormSchedule), 0, 0, 1, 1}, {&__pyx_n_s_NormType, __pyx_k_NormType, sizeof(__pyx_k_NormType), 0, 0, 1, 1}, {&__pyx_kp_s_Norm_type_Commonly_used_norm_typ, __pyx_k_Norm_type_Commonly_used_norm_typ, sizeof(__pyx_k_Norm_type_Commonly_used_norm_typ), 0, 0, 1, 0}, {&__pyx_n_s_NotImplemented, __pyx_k_NotImplemented, sizeof(__pyx_k_NotImplemented), 0, 0, 1, 1}, {&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1}, {&__pyx_kp_s_Not_for_rectangular_matrices, __pyx_k_Not_for_rectangular_matrices, sizeof(__pyx_k_Not_for_rectangular_matrices), 0, 0, 1, 0}, {&__pyx_kp_s_Not_for_type, __pyx_k_Not_for_type, sizeof(__pyx_k_Not_for_type), 0, 0, 1, 0}, {&__pyx_n_s_NullSpace, __pyx_k_NullSpace, sizeof(__pyx_k_NullSpace), 0, 0, 1, 1}, {&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1}, {&__pyx_n_s_ODE_EXPLICIT, __pyx_k_ODE_EXPLICIT, sizeof(__pyx_k_ODE_EXPLICIT), 0, 0, 1, 1}, {&__pyx_n_s_ODE_IMPLICIT, __pyx_k_ODE_IMPLICIT, sizeof(__pyx_k_ODE_IMPLICIT), 0, 0, 1, 1}, {&__pyx_n_s_OPENCL, __pyx_k_OPENCL, sizeof(__pyx_k_OPENCL), 0, 0, 1, 1}, {&__pyx_n_s_OPTION_MAX, __pyx_k_OPTION_MAX, sizeof(__pyx_k_OPTION_MAX), 0, 0, 1, 1}, {&__pyx_n_s_OPTION_MIN, __pyx_k_OPTION_MIN, sizeof(__pyx_k_OPTION_MIN), 0, 0, 1, 1}, {&__pyx_n_s_OWARMIJO, __pyx_k_OWARMIJO, sizeof(__pyx_k_OWARMIJO), 0, 0, 1, 1}, {&__pyx_n_s_OWD, __pyx_k_OWD, sizeof(__pyx_k_OWD), 0, 0, 1, 1}, {&__pyx_n_s_OWLQN, __pyx_k_OWLQN, sizeof(__pyx_k_OWLQN), 0, 0, 1, 1}, {&__pyx_n_s_Object, __pyx_k_Object, sizeof(__pyx_k_Object), 0, 0, 1, 1}, {&__pyx_kp_s_Object_is_not_writable, __pyx_k_Object_is_not_writable, sizeof(__pyx_k_Object_is_not_writable), 0, 0, 1, 0}, {&__pyx_n_s_Option, __pyx_k_Option, sizeof(__pyx_k_Option), 0, 0, 1, 1}, {&__pyx_n_s_Options, __pyx_k_Options, sizeof(__pyx_k_Options), 0, 0, 1, 1}, {&__pyx_n_s_OrderingType, __pyx_k_OrderingType, sizeof(__pyx_k_OrderingType), 0, 0, 1, 1}, {&__pyx_kp_u_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a, sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 1, 0, 0}, {&__pyx_kp_s_Out_of_memory_Allocated_d_Used_b, __pyx_k_Out_of_memory_Allocated_d_Used_b, sizeof(__pyx_k_Out_of_memory_Allocated_d_Used_b), 0, 0, 1, 0}, {&__pyx_n_s_P, __pyx_k_P, sizeof(__pyx_k_P), 0, 0, 1, 1}, {&__pyx_n_s_P1, __pyx_k_P1, sizeof(__pyx_k_P1), 0, 0, 1, 1}, {&__pyx_n_s_P4EST, __pyx_k_P4EST, sizeof(__pyx_k_P4EST), 0, 0, 1, 1}, {&__pyx_n_s_P8EST, __pyx_k_P8EST, sizeof(__pyx_k_P8EST), 0, 0, 1, 1}, {&__pyx_n_s_PARDECOMP, __pyx_k_PARDECOMP, sizeof(__pyx_k_PARDECOMP), 0, 0, 1, 1}, {&__pyx_n_s_PARMETIS, __pyx_k_PARMETIS, sizeof(__pyx_k_PARMETIS), 0, 0, 1, 1}, {&__pyx_n_s_PARMS, __pyx_k_PARMS, sizeof(__pyx_k_PARMS), 0, 0, 1, 1}, {&__pyx_n_s_PARTITIONINGAVERAGE, __pyx_k_PARTITIONINGAVERAGE, sizeof(__pyx_k_PARTITIONINGAVERAGE), 0, 0, 1, 1}, {&__pyx_n_s_PARTITIONINGCHACO, __pyx_k_PARTITIONINGCHACO, sizeof(__pyx_k_PARTITIONINGCHACO), 0, 0, 1, 1}, {&__pyx_n_s_PARTITIONINGCURRENT, __pyx_k_PARTITIONINGCURRENT, sizeof(__pyx_k_PARTITIONINGCURRENT), 0, 0, 1, 1}, {&__pyx_n_s_PARTITIONINGHIERARCH, __pyx_k_PARTITIONINGHIERARCH, sizeof(__pyx_k_PARTITIONINGHIERARCH), 0, 0, 1, 1}, {&__pyx_n_s_PARTITIONINGPARMETIS, __pyx_k_PARTITIONINGPARMETIS, sizeof(__pyx_k_PARTITIONINGPARMETIS), 0, 0, 1, 1}, {&__pyx_n_s_PARTITIONINGPARTY, __pyx_k_PARTITIONINGPARTY, sizeof(__pyx_k_PARTITIONINGPARTY), 0, 0, 1, 1}, {&__pyx_n_s_PARTITIONINGPTSCOTCH, __pyx_k_PARTITIONINGPTSCOTCH, sizeof(__pyx_k_PARTITIONINGPTSCOTCH), 0, 0, 1, 1}, {&__pyx_n_s_PARTITIONINGSQUARE, __pyx_k_PARTITIONINGSQUARE, sizeof(__pyx_k_PARTITIONINGSQUARE), 0, 0, 1, 1}, {&__pyx_n_s_PASTIX, __pyx_k_PASTIX, sizeof(__pyx_k_PASTIX), 0, 0, 1, 1}, {&__pyx_n_s_PATCH, __pyx_k_PATCH, sizeof(__pyx_k_PATCH), 0, 0, 1, 1}, {&__pyx_n_s_PBJACOBI, __pyx_k_PBJACOBI, sizeof(__pyx_k_PBJACOBI), 0, 0, 1, 1}, {&__pyx_n_s_PC, __pyx_k_PC, sizeof(__pyx_k_PC), 0, 0, 1, 1}, {&__pyx_n_s_PCASMType, __pyx_k_PCASMType, sizeof(__pyx_k_PCASMType), 0, 0, 1, 1}, {&__pyx_n_s_PCCompositeType, __pyx_k_PCCompositeType, sizeof(__pyx_k_PCCompositeType), 0, 0, 1, 1}, {&__pyx_n_s_PCDeflationSpaceType, __pyx_k_PCDeflationSpaceType, sizeof(__pyx_k_PCDeflationSpaceType), 0, 0, 1, 1}, {&__pyx_n_s_PCFailedReason, __pyx_k_PCFailedReason, sizeof(__pyx_k_PCFailedReason), 0, 0, 1, 1}, {&__pyx_n_s_PCFieldSplitSchurFactType, __pyx_k_PCFieldSplitSchurFactType, sizeof(__pyx_k_PCFieldSplitSchurFactType), 0, 0, 1, 1}, {&__pyx_n_s_PCFieldSplitSchurPreType, __pyx_k_PCFieldSplitSchurPreType, sizeof(__pyx_k_PCFieldSplitSchurPreType), 0, 0, 1, 1}, {&__pyx_n_s_PCGAMGType, __pyx_k_PCGAMGType, sizeof(__pyx_k_PCGAMGType), 0, 0, 1, 1}, {&__pyx_n_s_PCGASMType, __pyx_k_PCGASMType, sizeof(__pyx_k_PCGASMType), 0, 0, 1, 1}, {&__pyx_n_s_PCGD, __pyx_k_PCGD, sizeof(__pyx_k_PCGD), 0, 0, 1, 1}, {&__pyx_n_s_PCHPDDMCoarseCorrectionType, __pyx_k_PCHPDDMCoarseCorrectionType, sizeof(__pyx_k_PCHPDDMCoarseCorrectionType), 0, 0, 1, 1}, {&__pyx_n_s_PCMGCycleType, __pyx_k_PCMGCycleType, sizeof(__pyx_k_PCMGCycleType), 0, 0, 1, 1}, {&__pyx_n_s_PCMGType, __pyx_k_PCMGType, sizeof(__pyx_k_PCMGType), 0, 0, 1, 1}, {&__pyx_n_s_PCPatchConstructType, __pyx_k_PCPatchConstructType, sizeof(__pyx_k_PCPatchConstructType), 0, 0, 1, 1}, {&__pyx_n_s_PCSide, __pyx_k_PCSide, sizeof(__pyx_k_PCSide), 0, 0, 1, 1}, {&__pyx_n_s_PCType, __pyx_k_PCType, sizeof(__pyx_k_PCType), 0, 0, 1, 1}, {&__pyx_n_s_PD, __pyx_k_PD, sizeof(__pyx_k_PD), 0, 0, 1, 1}, {&__pyx_n_s_PDIPM, __pyx_k_PDIPM, sizeof(__pyx_k_PDIPM), 0, 0, 1, 1}, {&__pyx_n_s_PERIODIC, __pyx_k_PERIODIC, sizeof(__pyx_k_PERIODIC), 0, 0, 1, 1}, {&__pyx_n_s_PETSC, __pyx_k_PETSC, sizeof(__pyx_k_PETSC), 0, 0, 1, 1}, {&__pyx_kp_s_PETSc_Error_Attributes_ierr_int, __pyx_k_PETSc_Error_Attributes_ierr_int, sizeof(__pyx_k_PETSc_Error_Attributes_ierr_int), 0, 0, 1, 0}, {&__pyx_kp_s_PETSc_Error_d, __pyx_k_PETSc_Error_d, sizeof(__pyx_k_PETSc_Error_d), 0, 0, 1, 0}, {&__pyx_n_s_PFMG, __pyx_k_PFMG, sizeof(__pyx_k_PFMG), 0, 0, 1, 1}, {&__pyx_n_s_PGMRES, __pyx_k_PGMRES, sizeof(__pyx_k_PGMRES), 0, 0, 1, 1}, {&__pyx_n_s_PIC, __pyx_k_PIC, sizeof(__pyx_k_PIC), 0, 0, 1, 1}, {&__pyx_n_s_PICLayoutType, __pyx_k_PICLayoutType, sizeof(__pyx_k_PICLayoutType), 0, 0, 1, 1}, {&__pyx_n_s_PINFINITY, __pyx_k_PINFINITY, sizeof(__pyx_k_PINFINITY), 0, 0, 1, 1}, {&__pyx_n_s_PIPEBCGS, __pyx_k_PIPEBCGS, sizeof(__pyx_k_PIPEBCGS), 0, 0, 1, 1}, {&__pyx_n_s_PIPECG, __pyx_k_PIPECG, sizeof(__pyx_k_PIPECG), 0, 0, 1, 1}, {&__pyx_n_s_PIPECG2, __pyx_k_PIPECG2, sizeof(__pyx_k_PIPECG2), 0, 0, 1, 1}, {&__pyx_n_s_PIPECGRR, __pyx_k_PIPECGRR, sizeof(__pyx_k_PIPECGRR), 0, 0, 1, 1}, {&__pyx_n_s_PIPECR, __pyx_k_PIPECR, sizeof(__pyx_k_PIPECR), 0, 0, 1, 1}, {&__pyx_n_s_PIPEFCG, __pyx_k_PIPEFCG, sizeof(__pyx_k_PIPEFCG), 0, 0, 1, 1}, {&__pyx_n_s_PIPEFGMRES, __pyx_k_PIPEFGMRES, sizeof(__pyx_k_PIPEFGMRES), 0, 0, 1, 1}, {&__pyx_n_s_PIPEGCR, __pyx_k_PIPEGCR, sizeof(__pyx_k_PIPEGCR), 0, 0, 1, 1}, {&__pyx_n_s_PIPELCG, __pyx_k_PIPELCG, sizeof(__pyx_k_PIPELCG), 0, 0, 1, 1}, {&__pyx_n_s_PIPEPRCG, __pyx_k_PIPEPRCG, sizeof(__pyx_k_PIPEPRCG), 0, 0, 1, 1}, {&__pyx_n_s_PLEX, __pyx_k_PLEX, sizeof(__pyx_k_PLEX), 0, 0, 1, 1}, {&__pyx_n_s_POINT, __pyx_k_POINT, sizeof(__pyx_k_POINT), 0, 0, 1, 1}, {&__pyx_n_s_POINT_PRISM_TENSOR, __pyx_k_POINT_PRISM_TENSOR, sizeof(__pyx_k_POINT_PRISM_TENSOR), 0, 0, 1, 1}, {&__pyx_n_s_POLYNOMIAL, __pyx_k_POLYNOMIAL, sizeof(__pyx_k_POLYNOMIAL), 0, 0, 1, 1}, {&__pyx_n_s_POSITIVE_DEFINITE, __pyx_k_POSITIVE_DEFINITE, sizeof(__pyx_k_POSITIVE_DEFINITE), 0, 0, 1, 1}, {&__pyx_n_s_POUNDERS, __pyx_k_POUNDERS, sizeof(__pyx_k_POUNDERS), 0, 0, 1, 1}, {&__pyx_n_s_PREALLOCATOR, __pyx_k_PREALLOCATOR, sizeof(__pyx_k_PREALLOCATOR), 0, 0, 1, 1}, {&__pyx_n_s_PRECONDITIONED, __pyx_k_PRECONDITIONED, sizeof(__pyx_k_PRECONDITIONED), 0, 0, 1, 1}, {&__pyx_n_s_PREONLY, __pyx_k_PREONLY, sizeof(__pyx_k_PREONLY), 0, 0, 1, 1}, {&__pyx_n_s_PRODUCT, __pyx_k_PRODUCT, sizeof(__pyx_k_PRODUCT), 0, 0, 1, 1}, {&__pyx_n_s_PRP, __pyx_k_PRP, sizeof(__pyx_k_PRP), 0, 0, 1, 1}, {&__pyx_n_s_PRP_PLUS, __pyx_k_PRP_PLUS, sizeof(__pyx_k_PRP_PLUS), 0, 0, 1, 1}, {&__pyx_n_s_PSEUDO, __pyx_k_PSEUDO, sizeof(__pyx_k_PSEUDO), 0, 0, 1, 1}, {&__pyx_n_s_PTRIMMED, __pyx_k_PTRIMMED, sizeof(__pyx_k_PTRIMMED), 0, 0, 1, 1}, {&__pyx_n_s_PTSCOTCH, __pyx_k_PTSCOTCH, sizeof(__pyx_k_PTSCOTCH), 0, 0, 1, 1}, {&__pyx_n_s_PYRAMID, __pyx_k_PYRAMID, sizeof(__pyx_k_PYRAMID), 0, 0, 1, 1}, {&__pyx_n_s_PYTHON, __pyx_k_PYTHON, sizeof(__pyx_k_PYTHON), 0, 0, 1, 1}, {&__pyx_n_s_Partitioner, __pyx_k_Partitioner, sizeof(__pyx_k_Partitioner), 0, 0, 1, 1}, {&__pyx_n_s_PartitionerType, __pyx_k_PartitionerType, sizeof(__pyx_k_PartitionerType), 0, 0, 1, 1}, {&__pyx_n_s_PatchConstructType, __pyx_k_PatchConstructType, sizeof(__pyx_k_PatchConstructType), 0, 0, 1, 1}, {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1}, {&__pyx_n_s_PolytopeType, __pyx_k_PolytopeType, sizeof(__pyx_k_PolytopeType), 0, 0, 1, 1}, {&__pyx_kp_s_Portable_Extensible_Toolkit_for, __pyx_k_Portable_Extensible_Toolkit_for, sizeof(__pyx_k_Portable_Extensible_Toolkit_for), 0, 0, 1, 0}, {&__pyx_n_s_Print, __pyx_k_Print, sizeof(__pyx_k_Print), 0, 0, 1, 1}, {&__pyx_n_s_ProblemType, __pyx_k_ProblemType, sizeof(__pyx_k_ProblemType), 0, 0, 1, 1}, {&__pyx_n_s_PtAP, __pyx_k_PtAP, sizeof(__pyx_k_PtAP), 0, 0, 1, 1}, {&__pyx_n_s_Q0, __pyx_k_Q0, sizeof(__pyx_k_Q0), 0, 0, 1, 1}, {&__pyx_n_s_Q1, __pyx_k_Q1, sizeof(__pyx_k_Q1), 0, 0, 1, 1}, {&__pyx_n_s_QCG, __pyx_k_QCG, sizeof(__pyx_k_QCG), 0, 0, 1, 1}, {&__pyx_n_s_QMD, __pyx_k_QMD, sizeof(__pyx_k_QMD), 0, 0, 1, 1}, {&__pyx_n_s_QMRCGS, __pyx_k_QMRCGS, sizeof(__pyx_k_QMRCGS), 0, 0, 1, 1}, {&__pyx_n_s_QN, __pyx_k_QN, sizeof(__pyx_k_QN), 0, 0, 1, 1}, {&__pyx_n_s_QR, __pyx_k_QR, sizeof(__pyx_k_QR), 0, 0, 1, 1}, {&__pyx_n_s_QUADRILATERAL, __pyx_k_QUADRILATERAL, sizeof(__pyx_k_QUADRILATERAL), 0, 0, 1, 1}, {&__pyx_n_s_QUAD_PRISM_TENSOR, __pyx_k_QUAD_PRISM_TENSOR, sizeof(__pyx_k_QUAD_PRISM_TENSOR), 0, 0, 1, 1}, {&__pyx_n_s_QUARTER, __pyx_k_QUARTER, sizeof(__pyx_k_QUARTER), 0, 0, 1, 1}, {&__pyx_n_s_QUARTER_SIZE, __pyx_k_QUARTER_SIZE, sizeof(__pyx_k_QUARTER_SIZE), 0, 0, 1, 1}, {&__pyx_n_s_Quad, __pyx_k_Quad, sizeof(__pyx_k_Quad), 0, 0, 1, 1}, {&__pyx_n_s_R, __pyx_k_R, sizeof(__pyx_k_R), 0, 0, 1, 1}, {&__pyx_n_s_RADAU5, __pyx_k_RADAU5, sizeof(__pyx_k_RADAU5), 0, 0, 1, 1}, {&__pyx_n_s_RAND, __pyx_k_RAND, sizeof(__pyx_k_RAND), 0, 0, 1, 1}, {&__pyx_n_s_RAND48, __pyx_k_RAND48, sizeof(__pyx_k_RAND48), 0, 0, 1, 1}, {&__pyx_n_s_RANDER48, __pyx_k_RANDER48, sizeof(__pyx_k_RANDER48), 0, 0, 1, 1}, {&__pyx_n_s_RANDOM123, __pyx_k_RANDOM123, sizeof(__pyx_k_RANDOM123), 0, 0, 1, 1}, {&__pyx_n_s_RARt, __pyx_k_RARt, sizeof(__pyx_k_RARt), 0, 0, 1, 1}, {&__pyx_n_s_RCM, __pyx_k_RCM, sizeof(__pyx_k_RCM), 0, 0, 1, 1}, {&__pyx_n_s_READ, __pyx_k_READ, sizeof(__pyx_k_READ), 0, 0, 1, 1}, {&__pyx_n_s_REDISTRIBUTE, __pyx_k_REDISTRIBUTE, sizeof(__pyx_k_REDISTRIBUTE), 0, 0, 1, 1}, {&__pyx_n_s_REDUNDANT, __pyx_k_REDUNDANT, sizeof(__pyx_k_REDUNDANT), 0, 0, 1, 1}, {&__pyx_n_s_REFINE1D, __pyx_k_REFINE1D, sizeof(__pyx_k_REFINE1D), 0, 0, 1, 1}, {&__pyx_n_s_REFINEALFELD, __pyx_k_REFINEALFELD, sizeof(__pyx_k_REFINEALFELD), 0, 0, 1, 1}, {&__pyx_n_s_REFINEBOUNDARYLAYER, __pyx_k_REFINEBOUNDARYLAYER, sizeof(__pyx_k_REFINEBOUNDARYLAYER), 0, 0, 1, 1}, {&__pyx_n_s_REFINED, __pyx_k_REFINED, sizeof(__pyx_k_REFINED), 0, 0, 1, 1}, {&__pyx_n_s_REFINEPOWELLSABIN, __pyx_k_REFINEPOWELLSABIN, sizeof(__pyx_k_REFINEPOWELLSABIN), 0, 0, 1, 1}, {&__pyx_n_s_REFINEREGULAR, __pyx_k_REFINEREGULAR, sizeof(__pyx_k_REFINEREGULAR), 0, 0, 1, 1}, {&__pyx_n_s_REFINESBR, __pyx_k_REFINESBR, sizeof(__pyx_k_REFINESBR), 0, 0, 1, 1}, {&__pyx_n_s_REFINETOBOX, __pyx_k_REFINETOBOX, sizeof(__pyx_k_REFINETOBOX), 0, 0, 1, 1}, {&__pyx_n_s_REFINETOSIMPLEX, __pyx_k_REFINETOSIMPLEX, sizeof(__pyx_k_REFINETOSIMPLEX), 0, 0, 1, 1}, {&__pyx_n_s_RESTRICT, __pyx_k_RESTRICT, sizeof(__pyx_k_RESTRICT), 0, 0, 1, 1}, {&__pyx_n_s_REVERSE, __pyx_k_REVERSE, sizeof(__pyx_k_REVERSE), 0, 0, 1, 1}, {&__pyx_n_s_REVERSE_LOCAL, __pyx_k_REVERSE_LOCAL, sizeof(__pyx_k_REVERSE_LOCAL), 0, 0, 1, 1}, {&__pyx_n_s_RICHARDSON, __pyx_k_RICHARDSON, sizeof(__pyx_k_RICHARDSON), 0, 0, 1, 1}, {&__pyx_n_s_RIGHT, __pyx_k_RIGHT, sizeof(__pyx_k_RIGHT), 0, 0, 1, 1}, {&__pyx_n_s_RK, __pyx_k_RK, sizeof(__pyx_k_RK), 0, 0, 1, 1}, {&__pyx_n_s_RK1FE, __pyx_k_RK1FE, sizeof(__pyx_k_RK1FE), 0, 0, 1, 1}, {&__pyx_n_s_RK2A, __pyx_k_RK2A, sizeof(__pyx_k_RK2A), 0, 0, 1, 1}, {&__pyx_n_s_RK2B, __pyx_k_RK2B, sizeof(__pyx_k_RK2B), 0, 0, 1, 1}, {&__pyx_n_s_RK3, __pyx_k_RK3, sizeof(__pyx_k_RK3), 0, 0, 1, 1}, {&__pyx_n_s_RK3BS, __pyx_k_RK3BS, sizeof(__pyx_k_RK3BS), 0, 0, 1, 1}, {&__pyx_n_s_RK4, __pyx_k_RK4, sizeof(__pyx_k_RK4), 0, 0, 1, 1}, {&__pyx_n_s_RK5BS, __pyx_k_RK5BS, sizeof(__pyx_k_RK5BS), 0, 0, 1, 1}, {&__pyx_n_s_RK5DP, __pyx_k_RK5DP, sizeof(__pyx_k_RK5DP), 0, 0, 1, 1}, {&__pyx_n_s_RK5F, __pyx_k_RK5F, sizeof(__pyx_k_RK5F), 0, 0, 1, 1}, {&__pyx_n_s_RK6VR, __pyx_k_RK6VR, sizeof(__pyx_k_RK6VR), 0, 0, 1, 1}, {&__pyx_n_s_RK7VR, __pyx_k_RK7VR, sizeof(__pyx_k_RK7VR), 0, 0, 1, 1}, {&__pyx_n_s_RK8VR, __pyx_k_RK8VR, sizeof(__pyx_k_RK8VR), 0, 0, 1, 1}, {&__pyx_n_s_RKType, __pyx_k_RKType, sizeof(__pyx_k_RKType), 0, 0, 1, 1}, {&__pyx_n_s_ROSW, __pyx_k_ROSW, sizeof(__pyx_k_ROSW), 0, 0, 1, 1}, {&__pyx_n_s_ROWLENGTH, __pyx_k_ROWLENGTH, sizeof(__pyx_k_ROWLENGTH), 0, 0, 1, 1}, {&__pyx_n_s_ROWSCALINGVIENNACL, __pyx_k_ROWSCALINGVIENNACL, sizeof(__pyx_k_ROWSCALINGVIENNACL), 0, 0, 1, 1}, {&__pyx_n_s_ROW_ORIENTED, __pyx_k_ROW_ORIENTED, sizeof(__pyx_k_ROW_ORIENTED), 0, 0, 1, 1}, {&__pyx_n_s_RT_Pi, __pyx_k_RT_Pi, sizeof(__pyx_k_RT_Pi), 0, 0, 1, 1}, {&__pyx_n_s_RT_Pi_Full, __pyx_k_RT_Pi_Full, sizeof(__pyx_k_RT_Pi_Full), 0, 0, 1, 1}, {&__pyx_n_s_RUNGE_KUTTA, __pyx_k_RUNGE_KUTTA, sizeof(__pyx_k_RUNGE_KUTTA), 0, 0, 1, 1}, {&__pyx_n_s_Random, __pyx_k_Random, sizeof(__pyx_k_Random), 0, 0, 1, 1}, {&__pyx_n_s_RandomType, __pyx_k_RandomType, sizeof(__pyx_k_RandomType), 0, 0, 1, 1}, {&__pyx_n_s_RealType, __pyx_k_RealType, sizeof(__pyx_k_RealType), 0, 0, 1, 1}, {&__pyx_n_s_Reason, __pyx_k_Reason, sizeof(__pyx_k_Reason), 0, 0, 1, 1}, {&__pyx_n_s_ReorderDefaultFlag, __pyx_k_ReorderDefaultFlag, sizeof(__pyx_k_ReorderDefaultFlag), 0, 0, 1, 1}, {&__pyx_n_s_Right, __pyx_k_Right, sizeof(__pyx_k_Right), 0, 0, 1, 1}, {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, {&__pyx_n_s_S, __pyx_k_S, sizeof(__pyx_k_S), 0, 0, 1, 1}, {&__pyx_n_s_SAME, __pyx_k_SAME, sizeof(__pyx_k_SAME), 0, 0, 1, 1}, {&__pyx_n_s_SAME_NONZERO_PATTERN, __pyx_k_SAME_NONZERO_PATTERN, sizeof(__pyx_k_SAME_NONZERO_PATTERN), 0, 0, 1, 1}, {&__pyx_n_s_SAME_NZ, __pyx_k_SAME_NZ, sizeof(__pyx_k_SAME_NZ), 0, 0, 1, 1}, {&__pyx_n_s_SAVIENNACL, __pyx_k_SAVIENNACL, sizeof(__pyx_k_SAVIENNACL), 0, 0, 1, 1}, {&__pyx_n_s_SAWS, __pyx_k_SAWS, sizeof(__pyx_k_SAWS), 0, 0, 1, 1}, {&__pyx_n_s_SBAIJ, __pyx_k_SBAIJ, sizeof(__pyx_k_SBAIJ), 0, 0, 1, 1}, {&__pyx_n_s_SCALAPACK, __pyx_k_SCALAPACK, sizeof(__pyx_k_SCALAPACK), 0, 0, 1, 1}, {&__pyx_n_s_SCATTER, __pyx_k_SCATTER, sizeof(__pyx_k_SCATTER), 0, 0, 1, 1}, {&__pyx_n_s_SCATTER_FORWARD, __pyx_k_SCATTER_FORWARD, sizeof(__pyx_k_SCATTER_FORWARD), 0, 0, 1, 1}, {&__pyx_n_s_SCATTER_FORWARD_LOCAL, __pyx_k_SCATTER_FORWARD_LOCAL, sizeof(__pyx_k_SCATTER_FORWARD_LOCAL), 0, 0, 1, 1}, {&__pyx_n_s_SCATTER_REVERSE, __pyx_k_SCATTER_REVERSE, sizeof(__pyx_k_SCATTER_REVERSE), 0, 0, 1, 1}, {&__pyx_n_s_SCATTER_REVERSE_LOCAL, __pyx_k_SCATTER_REVERSE_LOCAL, sizeof(__pyx_k_SCATTER_REVERSE_LOCAL), 0, 0, 1, 1}, {&__pyx_n_s_SCHUR, __pyx_k_SCHUR, sizeof(__pyx_k_SCHUR), 0, 0, 1, 1}, {&__pyx_n_s_SCHURCOMPLEMENT, __pyx_k_SCHURCOMPLEMENT, sizeof(__pyx_k_SCHURCOMPLEMENT), 0, 0, 1, 1}, {&__pyx_n_s_SEGMENT, __pyx_k_SEGMENT, sizeof(__pyx_k_SEGMENT), 0, 0, 1, 1}, {&__pyx_n_s_SEG_PRISM_TENSOR, __pyx_k_SEG_PRISM_TENSOR, sizeof(__pyx_k_SEG_PRISM_TENSOR), 0, 0, 1, 1}, {&__pyx_n_s_SELF, __pyx_k_SELF, sizeof(__pyx_k_SELF), 0, 0, 1, 1}, {&__pyx_n_s_SELFP, __pyx_k_SELFP, sizeof(__pyx_k_SELFP), 0, 0, 1, 1}, {&__pyx_n_s_SELL, __pyx_k_SELL, sizeof(__pyx_k_SELL), 0, 0, 1, 1}, {&__pyx_n_s_SEQ, __pyx_k_SEQ, sizeof(__pyx_k_SEQ), 0, 0, 1, 1}, {&__pyx_n_s_SEQAIJ, __pyx_k_SEQAIJ, sizeof(__pyx_k_SEQAIJ), 0, 0, 1, 1}, {&__pyx_n_s_SEQAIJCRL, __pyx_k_SEQAIJCRL, sizeof(__pyx_k_SEQAIJCRL), 0, 0, 1, 1}, {&__pyx_n_s_SEQAIJCUSPARSE, __pyx_k_SEQAIJCUSPARSE, sizeof(__pyx_k_SEQAIJCUSPARSE), 0, 0, 1, 1}, {&__pyx_n_s_SEQAIJMKL, __pyx_k_SEQAIJMKL, sizeof(__pyx_k_SEQAIJMKL), 0, 0, 1, 1}, {&__pyx_n_s_SEQAIJPERM, __pyx_k_SEQAIJPERM, sizeof(__pyx_k_SEQAIJPERM), 0, 0, 1, 1}, {&__pyx_n_s_SEQAIJSELL, __pyx_k_SEQAIJSELL, sizeof(__pyx_k_SEQAIJSELL), 0, 0, 1, 1}, {&__pyx_n_s_SEQAIJVIENNACL, __pyx_k_SEQAIJVIENNACL, sizeof(__pyx_k_SEQAIJVIENNACL), 0, 0, 1, 1}, {&__pyx_n_s_SEQBAIJ, __pyx_k_SEQBAIJ, sizeof(__pyx_k_SEQBAIJ), 0, 0, 1, 1}, {&__pyx_n_s_SEQBAIJMKL, __pyx_k_SEQBAIJMKL, sizeof(__pyx_k_SEQBAIJMKL), 0, 0, 1, 1}, {&__pyx_n_s_SEQCUDA, __pyx_k_SEQCUDA, sizeof(__pyx_k_SEQCUDA), 0, 0, 1, 1}, {&__pyx_n_s_SEQCUFFT, __pyx_k_SEQCUFFT, sizeof(__pyx_k_SEQCUFFT), 0, 0, 1, 1}, {&__pyx_n_s_SEQDENSE, __pyx_k_SEQDENSE, sizeof(__pyx_k_SEQDENSE), 0, 0, 1, 1}, {&__pyx_n_s_SEQDENSECUDA, __pyx_k_SEQDENSECUDA, sizeof(__pyx_k_SEQDENSECUDA), 0, 0, 1, 1}, {&__pyx_n_s_SEQHIP, __pyx_k_SEQHIP, sizeof(__pyx_k_SEQHIP), 0, 0, 1, 1}, {&__pyx_n_s_SEQKAIJ, __pyx_k_SEQKAIJ, sizeof(__pyx_k_SEQKAIJ), 0, 0, 1, 1}, {&__pyx_n_s_SEQKOKKOS, __pyx_k_SEQKOKKOS, sizeof(__pyx_k_SEQKOKKOS), 0, 0, 1, 1}, {&__pyx_n_s_SEQMAIJ, __pyx_k_SEQMAIJ, sizeof(__pyx_k_SEQMAIJ), 0, 0, 1, 1}, {&__pyx_n_s_SEQSBAIJ, __pyx_k_SEQSBAIJ, sizeof(__pyx_k_SEQSBAIJ), 0, 0, 1, 1}, {&__pyx_n_s_SEQSELL, __pyx_k_SEQSELL, sizeof(__pyx_k_SEQSELL), 0, 0, 1, 1}, {&__pyx_n_s_SEQVIENNACL, __pyx_k_SEQVIENNACL, sizeof(__pyx_k_SEQVIENNACL), 0, 0, 1, 1}, {&__pyx_n_s_SETUP_ERROR, __pyx_k_SETUP_ERROR, sizeof(__pyx_k_SETUP_ERROR), 0, 0, 1, 1}, {&__pyx_n_s_SF, __pyx_k_SF, sizeof(__pyx_k_SF), 0, 0, 1, 1}, {&__pyx_n_s_SFType, __pyx_k_SFType, sizeof(__pyx_k_SFType), 0, 0, 1, 1}, {&__pyx_n_s_SHARED, __pyx_k_SHARED, sizeof(__pyx_k_SHARED), 0, 0, 1, 1}, {&__pyx_n_s_SHARE_NONZERO_PATTERN, __pyx_k_SHARE_NONZERO_PATTERN, sizeof(__pyx_k_SHARE_NONZERO_PATTERN), 0, 0, 1, 1}, {&__pyx_n_s_SHELL, __pyx_k_SHELL, sizeof(__pyx_k_SHELL), 0, 0, 1, 1}, {&__pyx_n_s_SIMPLE, __pyx_k_SIMPLE, sizeof(__pyx_k_SIMPLE), 0, 0, 1, 1}, {&__pyx_n_s_SLICED, __pyx_k_SLICED, sizeof(__pyx_k_SLICED), 0, 0, 1, 1}, {&__pyx_n_s_SNES, __pyx_k_SNES, sizeof(__pyx_k_SNES), 0, 0, 1, 1}, {&__pyx_n_s_SNESConvergedReason, __pyx_k_SNESConvergedReason, sizeof(__pyx_k_SNESConvergedReason), 0, 0, 1, 1}, {&__pyx_n_s_SNESNormSchedule, __pyx_k_SNESNormSchedule, sizeof(__pyx_k_SNESNormSchedule), 0, 0, 1, 1}, {&__pyx_n_s_SNESType, __pyx_k_SNESType, sizeof(__pyx_k_SNESType), 0, 0, 1, 1}, {&__pyx_kp_s_SNES_norm_schedule_See_Also_pets, __pyx_k_SNES_norm_schedule_See_Also_pets, sizeof(__pyx_k_SNES_norm_schedule_See_Also_pets), 0, 0, 1, 0}, {&__pyx_kp_s_SNES_solver_termination_reason_S, __pyx_k_SNES_solver_termination_reason_S, sizeof(__pyx_k_SNES_solver_termination_reason_S), 0, 0, 1, 0}, {&__pyx_kp_s_SNES_solver_type_See_Also_petsc, __pyx_k_SNES_solver_type_See_Also_petsc, sizeof(__pyx_k_SNES_solver_type_See_Also_petsc), 0, 0, 1, 0}, {&__pyx_n_s_SOCKET, __pyx_k_SOCKET, sizeof(__pyx_k_SOCKET), 0, 0, 1, 1}, {&__pyx_n_s_SOR, __pyx_k_SOR, sizeof(__pyx_k_SOR), 0, 0, 1, 1}, {&__pyx_n_s_SORTED_FULL, __pyx_k_SORTED_FULL, sizeof(__pyx_k_SORTED_FULL), 0, 0, 1, 1}, {&__pyx_n_s_SORType, __pyx_k_SORType, sizeof(__pyx_k_SORType), 0, 0, 1, 1}, {&__pyx_n_s_SPAI, __pyx_k_SPAI, sizeof(__pyx_k_SPAI), 0, 0, 1, 1}, {&__pyx_n_s_SPD, __pyx_k_SPD, sizeof(__pyx_k_SPD), 0, 0, 1, 1}, {&__pyx_n_s_SPECIAL, __pyx_k_SPECIAL, sizeof(__pyx_k_SPECIAL), 0, 0, 1, 1}, {&__pyx_n_s_SPECTRAL, __pyx_k_SPECTRAL, sizeof(__pyx_k_SPECTRAL), 0, 0, 1, 1}, {&__pyx_n_s_SPQR, __pyx_k_SPQR, sizeof(__pyx_k_SPQR), 0, 0, 1, 1}, {&__pyx_n_s_SPRNG, __pyx_k_SPRNG, sizeof(__pyx_k_SPRNG), 0, 0, 1, 1}, {&__pyx_n_s_SSFLS, __pyx_k_SSFLS, sizeof(__pyx_k_SSFLS), 0, 0, 1, 1}, {&__pyx_n_s_SSILS, __pyx_k_SSILS, sizeof(__pyx_k_SSILS), 0, 0, 1, 1}, {&__pyx_n_s_SSML_BFGS, __pyx_k_SSML_BFGS, sizeof(__pyx_k_SSML_BFGS), 0, 0, 1, 1}, {&__pyx_n_s_SSML_BRDN, __pyx_k_SSML_BRDN, sizeof(__pyx_k_SSML_BRDN), 0, 0, 1, 1}, {&__pyx_n_s_SSML_DFP, __pyx_k_SSML_DFP, sizeof(__pyx_k_SSML_DFP), 0, 0, 1, 1}, {&__pyx_n_s_SSP, __pyx_k_SSP, sizeof(__pyx_k_SSP), 0, 0, 1, 1}, {&__pyx_n_s_STAG, __pyx_k_STAG, sizeof(__pyx_k_STAG), 0, 0, 1, 1}, {&__pyx_n_s_STANDARD, __pyx_k_STANDARD, sizeof(__pyx_k_STANDARD), 0, 0, 1, 1}, {&__pyx_n_s_STAR, __pyx_k_STAR, sizeof(__pyx_k_STAR), 0, 0, 1, 1}, {&__pyx_n_s_STCG, __pyx_k_STCG, sizeof(__pyx_k_STCG), 0, 0, 1, 1}, {&__pyx_n_s_STDERR, __pyx_k_STDERR, sizeof(__pyx_k_STDERR), 0, 0, 1, 1}, {&__pyx_n_s_STDOUT, __pyx_k_STDOUT, sizeof(__pyx_k_STDOUT), 0, 0, 1, 1}, {&__pyx_n_s_STEPOVER, __pyx_k_STEPOVER, sizeof(__pyx_k_STEPOVER), 0, 0, 1, 1}, {&__pyx_n_s_STRIDE, __pyx_k_STRIDE, sizeof(__pyx_k_STRIDE), 0, 0, 1, 1}, {&__pyx_n_s_STRING, __pyx_k_STRING, sizeof(__pyx_k_STRING), 0, 0, 1, 1}, {&__pyx_n_s_STRUCTURALLY_SYMMETRIC, __pyx_k_STRUCTURALLY_SYMMETRIC, sizeof(__pyx_k_STRUCTURALLY_SYMMETRIC), 0, 0, 1, 1}, {&__pyx_n_s_STRUCTURE_ONLY, __pyx_k_STRUCTURE_ONLY, sizeof(__pyx_k_STRUCTURE_ONLY), 0, 0, 1, 1}, {&__pyx_n_s_STRUMPACK, __pyx_k_STRUMPACK, sizeof(__pyx_k_STRUMPACK), 0, 0, 1, 1}, {&__pyx_n_s_SUBMATRIX, __pyx_k_SUBMATRIX, sizeof(__pyx_k_SUBMATRIX), 0, 0, 1, 1}, {&__pyx_n_s_SUBMAT_SINGLEIS, __pyx_k_SUBMAT_SINGLEIS, sizeof(__pyx_k_SUBMAT_SINGLEIS), 0, 0, 1, 1}, {&__pyx_n_s_SUBPC_ERROR, __pyx_k_SUBPC_ERROR, sizeof(__pyx_k_SUBPC_ERROR), 0, 0, 1, 1}, {&__pyx_n_s_SUBSET, __pyx_k_SUBSET, sizeof(__pyx_k_SUBSET), 0, 0, 1, 1}, {&__pyx_n_s_SUBSET_NONZERO_PATTERN, __pyx_k_SUBSET_NONZERO_PATTERN, sizeof(__pyx_k_SUBSET_NONZERO_PATTERN), 0, 0, 1, 1}, {&__pyx_n_s_SUBSET_NZ, __pyx_k_SUBSET_NZ, sizeof(__pyx_k_SUBSET_NZ), 0, 0, 1, 1}, {&__pyx_n_s_SUBSET_OFF_PROC_ENTRIES, __pyx_k_SUBSET_OFF_PROC_ENTRIES, sizeof(__pyx_k_SUBSET_OFF_PROC_ENTRIES), 0, 0, 1, 1}, {&__pyx_n_s_SUBSPACE, __pyx_k_SUBSPACE, sizeof(__pyx_k_SUBSPACE), 0, 0, 1, 1}, {&__pyx_n_s_SUCCESS, __pyx_k_SUCCESS, sizeof(__pyx_k_SUCCESS), 0, 0, 1, 1}, {&__pyx_n_s_SUCCESS_USER, __pyx_k_SUCCESS_USER, sizeof(__pyx_k_SUCCESS_USER), 0, 0, 1, 1}, {&__pyx_n_s_SUM, __pyx_k_SUM, sizeof(__pyx_k_SUM), 0, 0, 1, 1}, {&__pyx_n_s_SUNDIALS, __pyx_k_SUNDIALS, sizeof(__pyx_k_SUNDIALS), 0, 0, 1, 1}, {&__pyx_n_s_SUPERLU, __pyx_k_SUPERLU, sizeof(__pyx_k_SUPERLU), 0, 0, 1, 1}, {&__pyx_n_s_SUPERLU_DIST, __pyx_k_SUPERLU_DIST, sizeof(__pyx_k_SUPERLU_DIST), 0, 0, 1, 1}, {&__pyx_n_s_SVD, __pyx_k_SVD, sizeof(__pyx_k_SVD), 0, 0, 1, 1}, {&__pyx_n_s_SWARM, __pyx_k_SWARM, sizeof(__pyx_k_SWARM), 0, 0, 1, 1}, {&__pyx_n_s_SYCL, __pyx_k_SYCL, sizeof(__pyx_k_SYCL), 0, 0, 1, 1}, {&__pyx_n_s_SYMMETRIC, __pyx_k_SYMMETRIC, sizeof(__pyx_k_SYMMETRIC), 0, 0, 1, 1}, {&__pyx_n_s_SYMMETRIC_MULTIPLICATIVE, __pyx_k_SYMMETRIC_MULTIPLICATIVE, sizeof(__pyx_k_SYMMETRIC_MULTIPLICATIVE), 0, 0, 1, 1}, {&__pyx_n_s_SYMMETRY_ETERNAL, __pyx_k_SYMMETRY_ETERNAL, sizeof(__pyx_k_SYMMETRY_ETERNAL), 0, 0, 1, 1}, {&__pyx_n_s_SYMMETRY_SWEEP, __pyx_k_SYMMETRY_SWEEP, sizeof(__pyx_k_SYMMETRY_SWEEP), 0, 0, 1, 1}, {&__pyx_n_s_SYMMLQ, __pyx_k_SYMMLQ, sizeof(__pyx_k_SYMMLQ), 0, 0, 1, 1}, {&__pyx_n_s_SYNC, __pyx_k_SYNC, sizeof(__pyx_k_SYNC), 0, 0, 1, 1}, {&__pyx_n_s_SYSPFMG, __pyx_k_SYSPFMG, sizeof(__pyx_k_SYSPFMG), 0, 0, 1, 1}, {&__pyx_n_s_ScalarType, __pyx_k_ScalarType, sizeof(__pyx_k_ScalarType), 0, 0, 1, 1}, {&__pyx_n_s_Scatter, __pyx_k_Scatter, sizeof(__pyx_k_Scatter), 0, 0, 1, 1}, {&__pyx_n_s_ScatterMode, __pyx_k_ScatterMode, sizeof(__pyx_k_ScatterMode), 0, 0, 1, 1}, {&__pyx_n_s_ScatterType, __pyx_k_ScatterType, sizeof(__pyx_k_ScatterType), 0, 0, 1, 1}, {&__pyx_kp_s_Scatter_mode_Most_commonly_used, __pyx_k_Scatter_mode_Most_commonly_used, sizeof(__pyx_k_Scatter_mode_Most_commonly_used), 0, 0, 1, 0}, {&__pyx_kp_s_Scatter_type_See_Also_petsc_VecS, __pyx_k_Scatter_type_See_Also_petsc_VecS, sizeof(__pyx_k_Scatter_type_See_Also_petsc_VecS), 0, 0, 1, 0}, {&__pyx_n_s_SchurFactType, __pyx_k_SchurFactType, sizeof(__pyx_k_SchurFactType), 0, 0, 1, 1}, {&__pyx_n_s_SchurPreType, __pyx_k_SchurPreType, sizeof(__pyx_k_SchurPreType), 0, 0, 1, 1}, {&__pyx_n_s_Section, __pyx_k_Section, sizeof(__pyx_k_Section), 0, 0, 1, 1}, {&__pyx_n_s_Sequence, __pyx_k_Sequence, sizeof(__pyx_k_Sequence), 0, 0, 1, 1}, {&__pyx_n_s_Side, __pyx_k_Side, sizeof(__pyx_k_Side), 0, 0, 1, 1}, {&__pyx_n_s_Size, __pyx_k_Size, sizeof(__pyx_k_Size), 0, 0, 1, 1}, {&__pyx_n_s_SolverType, __pyx_k_SolverType, sizeof(__pyx_k_SolverType), 0, 0, 1, 1}, {&__pyx_n_s_Space, __pyx_k_Space, sizeof(__pyx_k_Space), 0, 0, 1, 1}, {&__pyx_n_s_SpaceType, __pyx_k_SpaceType, sizeof(__pyx_k_SpaceType), 0, 0, 1, 1}, {&__pyx_n_s_Stage, __pyx_k_Stage, sizeof(__pyx_k_Stage), 0, 0, 1, 1}, {&__pyx_n_s_Stencil, __pyx_k_Stencil, sizeof(__pyx_k_Stencil), 0, 0, 1, 1}, {&__pyx_n_s_StencilLocation, __pyx_k_StencilLocation, sizeof(__pyx_k_StencilLocation), 0, 0, 1, 1}, {&__pyx_n_s_StencilType, __pyx_k_StencilType, sizeof(__pyx_k_StencilType), 0, 0, 1, 1}, {&__pyx_kp_s_Step_may_not_be_zero_axis_d, __pyx_k_Step_may_not_be_zero_axis_d, sizeof(__pyx_k_Step_may_not_be_zero_axis_d), 0, 0, 1, 0}, {&__pyx_n_s_StreamType, __pyx_k_StreamType, sizeof(__pyx_k_StreamType), 0, 0, 1, 1}, {&__pyx_n_s_Structure, __pyx_k_Structure, sizeof(__pyx_k_Structure), 0, 0, 1, 1}, {&__pyx_n_s_Sys, __pyx_k_Sys, sizeof(__pyx_k_Sys), 0, 0, 1, 1}, {&__pyx_n_s_SystemError, __pyx_k_SystemError, sizeof(__pyx_k_SystemError), 0, 0, 1, 1}, {&__pyx_kp_b_T, __pyx_k_T, sizeof(__pyx_k_T), 0, 0, 0, 0}, {&__pyx_n_s_TAO, __pyx_k_TAO, sizeof(__pyx_k_TAO), 0, 0, 1, 1}, {&__pyx_n_s_TAOBNCGType, __pyx_k_TAOBNCGType, sizeof(__pyx_k_TAOBNCGType), 0, 0, 1, 1}, {&__pyx_n_s_TAOConvergedReason, __pyx_k_TAOConvergedReason, sizeof(__pyx_k_TAOConvergedReason), 0, 0, 1, 1}, {&__pyx_n_s_TAOLineSearch, __pyx_k_TAOLineSearch, sizeof(__pyx_k_TAOLineSearch), 0, 0, 1, 1}, {&__pyx_n_s_TAOLineSearchConvergedReason, __pyx_k_TAOLineSearchConvergedReason, sizeof(__pyx_k_TAOLineSearchConvergedReason), 0, 0, 1, 1}, {&__pyx_n_s_TAOLineSearchType, __pyx_k_TAOLineSearchType, sizeof(__pyx_k_TAOLineSearchType), 0, 0, 1, 1}, {&__pyx_n_s_TAOType, __pyx_k_TAOType, sizeof(__pyx_k_TAOType), 0, 0, 1, 1}, {&__pyx_kp_s_TAO_Bound_Constrained_Conjugate, __pyx_k_TAO_Bound_Constrained_Conjugate, sizeof(__pyx_k_TAO_Bound_Constrained_Conjugate), 0, 0, 1, 0}, {&__pyx_kp_s_TAO_Line_Search_Termination_Reas, __pyx_k_TAO_Line_Search_Termination_Reas, sizeof(__pyx_k_TAO_Line_Search_Termination_Reas), 0, 0, 1, 0}, {&__pyx_kp_s_TAO_Line_Search_Types, __pyx_k_TAO_Line_Search_Types, sizeof(__pyx_k_TAO_Line_Search_Types), 0, 0, 1, 0}, {&__pyx_kp_s_TAO_solver_termination_reason_Se, __pyx_k_TAO_solver_termination_reason_Se, sizeof(__pyx_k_TAO_solver_termination_reason_Se), 0, 0, 1, 0}, {&__pyx_kp_s_TAO_solver_type_See_Also_petsc_T, __pyx_k_TAO_solver_type_See_Also_petsc_T, sizeof(__pyx_k_TAO_solver_type_See_Also_petsc_T), 0, 0, 1, 0}, {&__pyx_n_s_TCQMR, __pyx_k_TCQMR, sizeof(__pyx_k_TCQMR), 0, 0, 1, 1}, {&__pyx_n_s_TELESCOPE, __pyx_k_TELESCOPE, sizeof(__pyx_k_TELESCOPE), 0, 0, 1, 1}, {&__pyx_n_s_TENSOR, __pyx_k_TENSOR, sizeof(__pyx_k_TENSOR), 0, 0, 1, 1}, {&__pyx_n_s_TETRAHEDRON, __pyx_k_TETRAHEDRON, sizeof(__pyx_k_TETRAHEDRON), 0, 0, 1, 1}, {&__pyx_n_s_TFQMR, __pyx_k_TFQMR, sizeof(__pyx_k_TFQMR), 0, 0, 1, 1}, {&__pyx_n_s_TFS, __pyx_k_TFS, sizeof(__pyx_k_TFS), 0, 0, 1, 1}, {&__pyx_n_s_TH, __pyx_k_TH, sizeof(__pyx_k_TH), 0, 0, 1, 1}, {&__pyx_n_s_THETA, __pyx_k_THETA, sizeof(__pyx_k_THETA), 0, 0, 1, 1}, {&__pyx_n_s_THIRD, __pyx_k_THIRD, sizeof(__pyx_k_THIRD), 0, 0, 1, 1}, {&__pyx_n_s_THIRD_SIZE, __pyx_k_THIRD_SIZE, sizeof(__pyx_k_THIRD_SIZE), 0, 0, 1, 1}, {&__pyx_n_s_TRANSFORMFILTER, __pyx_k_TRANSFORMFILTER, sizeof(__pyx_k_TRANSFORMFILTER), 0, 0, 1, 1}, {&__pyx_n_s_TRANSPOSE, __pyx_k_TRANSPOSE, sizeof(__pyx_k_TRANSPOSE), 0, 0, 1, 1}, {&__pyx_n_s_TRIANGLE, __pyx_k_TRIANGLE, sizeof(__pyx_k_TRIANGLE), 0, 0, 1, 1}, {&__pyx_n_s_TRI_PRISM, __pyx_k_TRI_PRISM, sizeof(__pyx_k_TRI_PRISM), 0, 0, 1, 1}, {&__pyx_n_s_TRI_PRISM_TENSOR, __pyx_k_TRI_PRISM_TENSOR, sizeof(__pyx_k_TRI_PRISM_TENSOR), 0, 0, 1, 1}, {&__pyx_n_s_TRON, __pyx_k_TRON, sizeof(__pyx_k_TRON), 0, 0, 1, 1}, {&__pyx_n_s_TRUE, __pyx_k_TRUE, sizeof(__pyx_k_TRUE), 0, 0, 1, 1}, {&__pyx_n_s_TS, __pyx_k_TS, sizeof(__pyx_k_TS), 0, 0, 1, 1}, {&__pyx_n_s_TSARKIMEXType, __pyx_k_TSARKIMEXType, sizeof(__pyx_k_TSARKIMEXType), 0, 0, 1, 1}, {&__pyx_n_s_TSConvergedReason, __pyx_k_TSConvergedReason, sizeof(__pyx_k_TSConvergedReason), 0, 0, 1, 1}, {&__pyx_n_s_TSDIRKType, __pyx_k_TSDIRKType, sizeof(__pyx_k_TSDIRKType), 0, 0, 1, 1}, {&__pyx_n_s_TSEquationType, __pyx_k_TSEquationType, sizeof(__pyx_k_TSEquationType), 0, 0, 1, 1}, {&__pyx_n_s_TSExactFinalTime, __pyx_k_TSExactFinalTime, sizeof(__pyx_k_TSExactFinalTime), 0, 0, 1, 1}, {&__pyx_n_s_TSIRM, __pyx_k_TSIRM, sizeof(__pyx_k_TSIRM), 0, 0, 1, 1}, {&__pyx_n_s_TSProblemType, __pyx_k_TSProblemType, sizeof(__pyx_k_TSProblemType), 0, 0, 1, 1}, {&__pyx_n_s_TSRKType, __pyx_k_TSRKType, sizeof(__pyx_k_TSRKType), 0, 0, 1, 1}, {&__pyx_n_s_TSType, __pyx_k_TSType, sizeof(__pyx_k_TSType), 0, 0, 1, 1}, {&__pyx_n_s_TWIST, __pyx_k_TWIST, sizeof(__pyx_k_TWIST), 0, 0, 1, 1}, {&__pyx_n_s_T_2, __pyx_k_T_2, sizeof(__pyx_k_T_2), 0, 0, 1, 1}, {&__pyx_kp_s_Tensor_dtype_does_not_match_PETS, __pyx_k_Tensor_dtype_does_not_match_PETS, sizeof(__pyx_k_Tensor_dtype_does_not_match_PETS), 0, 0, 1, 0}, {&__pyx_kp_s_The_ARKIMEX_subtype, __pyx_k_The_ARKIMEX_subtype, sizeof(__pyx_k_The_ARKIMEX_subtype), 0, 0, 1, 0}, {&__pyx_kp_s_The_ASM_subtype, __pyx_k_The_ASM_subtype, sizeof(__pyx_k_The_ASM_subtype), 0, 0, 1, 0}, {&__pyx_kp_s_The_DIRK_subtype, __pyx_k_The_DIRK_subtype, sizeof(__pyx_k_The_DIRK_subtype), 0, 0, 1, 0}, {&__pyx_kp_s_The_GAMG_subtype, __pyx_k_The_GAMG_subtype, sizeof(__pyx_k_The_GAMG_subtype), 0, 0, 1, 0}, {&__pyx_kp_s_The_GASM_subtype, __pyx_k_The_GASM_subtype, sizeof(__pyx_k_The_GASM_subtype), 0, 0, 1, 0}, {&__pyx_kp_s_The_HPDDM_Krylov_solver_type, __pyx_k_The_HPDDM_Krylov_solver_type, sizeof(__pyx_k_The_HPDDM_Krylov_solver_type), 0, 0, 1, 0}, {&__pyx_kp_s_The_HPDDM_coarse_correction_type, __pyx_k_The_HPDDM_coarse_correction_type, sizeof(__pyx_k_The_HPDDM_coarse_correction_type), 0, 0, 1, 0}, {&__pyx_kp_s_The_MG_cycle_type, __pyx_k_The_MG_cycle_type, sizeof(__pyx_k_The_MG_cycle_type), 0, 0, 1, 0}, {&__pyx_kp_s_The_MG_subtype, __pyx_k_The_MG_subtype, sizeof(__pyx_k_The_MG_subtype), 0, 0, 1, 0}, {&__pyx_kp_s_The_RK_subtype, __pyx_k_The_RK_subtype, sizeof(__pyx_k_The_RK_subtype), 0, 0, 1, 0}, {&__pyx_kp_s_The_composite_type, __pyx_k_The_composite_type, sizeof(__pyx_k_The_composite_type), 0, 0, 1, 0}, {&__pyx_kp_s_The_deflation_space_subtype, __pyx_k_The_deflation_space_subtype, sizeof(__pyx_k_The_deflation_space_subtype), 0, 0, 1, 0}, {&__pyx_kp_s_The_field_split_Schur_factorizat, __pyx_k_The_field_split_Schur_factorizat, sizeof(__pyx_k_The_field_split_Schur_factorizat), 0, 0, 1, 0}, {&__pyx_kp_s_The_field_split_Schur_subtype, __pyx_k_The_field_split_Schur_subtype, sizeof(__pyx_k_The_field_split_Schur_subtype), 0, 0, 1, 0}, {&__pyx_kp_s_The_manner_in_which_the_precondi, __pyx_k_The_manner_in_which_the_precondi, sizeof(__pyx_k_The_manner_in_which_the_precondi), 0, 0, 1, 0}, {&__pyx_kp_s_The_method_for_ending_time_stepp, __pyx_k_The_method_for_ending_time_stepp, sizeof(__pyx_k_The_method_for_ending_time_stepp), 0, 0, 1, 0}, {&__pyx_kp_s_The_patch_construction_type, __pyx_k_The_patch_construction_type, sizeof(__pyx_k_The_patch_construction_type), 0, 0, 1, 0}, {&__pyx_kp_s_The_preconditioner_method, __pyx_k_The_preconditioner_method, sizeof(__pyx_k_The_preconditioner_method), 0, 0, 1, 0}, {&__pyx_kp_s_The_random_number_generator_type, __pyx_k_The_random_number_generator_type, sizeof(__pyx_k_The_random_number_generator_type), 0, 0, 1, 0}, {&__pyx_kp_s_The_reason_the_preconditioner_ha, __pyx_k_The_reason_the_preconditioner_ha, sizeof(__pyx_k_The_reason_the_preconditioner_ha), 0, 0, 1, 0}, {&__pyx_kp_s_The_reason_the_time_step_is_conv, __pyx_k_The_reason_the_time_step_is_conv, sizeof(__pyx_k_The_reason_the_time_step_is_conv), 0, 0, 1, 0}, {&__pyx_kp_s_The_time_stepping_method, __pyx_k_The_time_stepping_method, sizeof(__pyx_k_The_time_stepping_method), 0, 0, 1, 0}, {&__pyx_kp_s_The_type_of_device_See_Also_Devi, __pyx_k_The_type_of_device_See_Also_Devi, sizeof(__pyx_k_The_type_of_device_See_Also_Devi), 0, 0, 1, 0}, {&__pyx_kp_s_The_type_of_join_to_perform_See, __pyx_k_The_type_of_join_to_perform_See, sizeof(__pyx_k_The_type_of_join_to_perform_See), 0, 0, 1, 0}, {&__pyx_kp_s_The_type_of_stream_See_Also_Devi, __pyx_k_The_type_of_stream_See_Also_Devi, sizeof(__pyx_k_The_type_of_stream_See_Also_Devi), 0, 0, 1, 0}, {&__pyx_kp_s_The_vector_type, __pyx_k_The_vector_type, sizeof(__pyx_k_The_vector_type), 0, 0, 1, 0}, {&__pyx_n_s_Type, __pyx_k_Type, sizeof(__pyx_k_Type), 0, 0, 1, 1}, {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, {&__pyx_n_s_U, __pyx_k_U, sizeof(__pyx_k_U), 0, 0, 1, 1}, {&__pyx_n_s_UA, __pyx_k_UA, sizeof(__pyx_k_UA), 0, 0, 1, 1}, {&__pyx_n_s_UMFPACK, __pyx_k_UMFPACK, sizeof(__pyx_k_UMFPACK), 0, 0, 1, 1}, {&__pyx_n_s_UNIT, __pyx_k_UNIT, sizeof(__pyx_k_UNIT), 0, 0, 1, 1}, {&__pyx_n_s_UNKNOWN, __pyx_k_UNKNOWN, sizeof(__pyx_k_UNKNOWN), 0, 0, 1, 1}, {&__pyx_n_s_UNKNOWN_NONZERO_PATTERN, __pyx_k_UNKNOWN_NONZERO_PATTERN, sizeof(__pyx_k_UNKNOWN_NONZERO_PATTERN), 0, 0, 1, 1}, {&__pyx_n_s_UNKNOWN_NZ, __pyx_k_UNKNOWN_NZ, sizeof(__pyx_k_UNKNOWN_NZ), 0, 0, 1, 1}, {&__pyx_n_s_UNPRECONDITIONED, __pyx_k_UNPRECONDITIONED, sizeof(__pyx_k_UNPRECONDITIONED), 0, 0, 1, 1}, {&__pyx_n_s_UNSPECIFIED, __pyx_k_UNSPECIFIED, sizeof(__pyx_k_UNSPECIFIED), 0, 0, 1, 1}, {&__pyx_n_s_UNUSED_NONZERO_LOCATION_ERR, __pyx_k_UNUSED_NONZERO_LOCATION_ERR, sizeof(__pyx_k_UNUSED_NONZERO_LOCATION_ERR), 0, 0, 1, 1}, {&__pyx_n_s_UP, __pyx_k_UP, sizeof(__pyx_k_UP), 0, 0, 1, 1}, {&__pyx_n_s_UPDATE, __pyx_k_UPDATE, sizeof(__pyx_k_UPDATE), 0, 0, 1, 1}, {&__pyx_n_s_UPPER, __pyx_k_UPPER, sizeof(__pyx_k_UPPER), 0, 0, 1, 1}, {&__pyx_n_s_UP_LEFT, __pyx_k_UP_LEFT, sizeof(__pyx_k_UP_LEFT), 0, 0, 1, 1}, {&__pyx_n_s_UP_RIGHT, __pyx_k_UP_RIGHT, sizeof(__pyx_k_UP_RIGHT), 0, 0, 1, 1}, {&__pyx_n_s_USER, __pyx_k_USER, sizeof(__pyx_k_USER), 0, 0, 1, 1}, {&__pyx_n_s_USE_HASH_TABLE, __pyx_k_USE_HASH_TABLE, sizeof(__pyx_k_USE_HASH_TABLE), 0, 0, 1, 1}, {&__pyx_n_s_USE_INODES, __pyx_k_USE_INODES, sizeof(__pyx_k_USE_INODES), 0, 0, 1, 1}, {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object, sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0}, {&__pyx_kp_s_Unsupported_PetscScalar_type, __pyx_k_Unsupported_PetscScalar_type, sizeof(__pyx_k_Unsupported_PetscScalar_type), 0, 0, 1, 0}, {&__pyx_n_s_V, __pyx_k_V, sizeof(__pyx_k_V), 0, 0, 1, 1}, {&__pyx_n_s_VANKA, __pyx_k_VANKA, sizeof(__pyx_k_VANKA), 0, 0, 1, 1}, {&__pyx_n_s_VIENNACL, __pyx_k_VIENNACL, sizeof(__pyx_k_VIENNACL), 0, 0, 1, 1}, {&__pyx_n_s_VINEWTONRSLS, __pyx_k_VINEWTONRSLS, sizeof(__pyx_k_VINEWTONRSLS), 0, 0, 1, 1}, {&__pyx_n_s_VINEWTONSSLS, __pyx_k_VINEWTONSSLS, sizeof(__pyx_k_VINEWTONSSLS), 0, 0, 1, 1}, {&__pyx_n_s_VPBJACOBI, __pyx_k_VPBJACOBI, sizeof(__pyx_k_VPBJACOBI), 0, 0, 1, 1}, {&__pyx_n_s_VTK, __pyx_k_VTK, sizeof(__pyx_k_VTK), 0, 0, 1, 1}, {&__pyx_n_s_VTK_VTR, __pyx_k_VTK_VTR, sizeof(__pyx_k_VTK_VTR), 0, 0, 1, 1}, {&__pyx_n_s_VTK_VTS, __pyx_k_VTK_VTS, sizeof(__pyx_k_VTK_VTS), 0, 0, 1, 1}, {&__pyx_n_s_VTK_VTU, __pyx_k_VTK_VTU, sizeof(__pyx_k_VTK_VTU), 0, 0, 1, 1}, {&__pyx_n_s_VU, __pyx_k_VU, sizeof(__pyx_k_VU), 0, 0, 1, 1}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, {&__pyx_n_s_Vec, __pyx_k_Vec, sizeof(__pyx_k_Vec), 0, 0, 1, 1}, {&__pyx_n_s_VecOption, __pyx_k_VecOption, sizeof(__pyx_k_VecOption), 0, 0, 1, 1}, {&__pyx_n_s_VecType, __pyx_k_VecType, sizeof(__pyx_k_VecType), 0, 0, 1, 1}, {&__pyx_n_s_Vec_LocalForm, __pyx_k_Vec_LocalForm, sizeof(__pyx_k_Vec_LocalForm), 0, 0, 1, 1}, {&__pyx_n_s_Vec_buffer, __pyx_k_Vec_buffer, sizeof(__pyx_k_Vec_buffer), 0, 0, 1, 1}, {&__pyx_kp_s_Vector_assembly_option, __pyx_k_Vector_assembly_option, sizeof(__pyx_k_Vector_assembly_option), 0, 0, 1, 0}, {&__pyx_kp_s_Vector_local_size_d_is_not_compa, __pyx_k_Vector_local_size_d_is_not_compa, sizeof(__pyx_k_Vector_local_size_d_is_not_compa), 0, 0, 1, 0}, {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView, sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1}, {&__pyx_n_s_Viewer, __pyx_k_Viewer, sizeof(__pyx_k_Viewer), 0, 0, 1, 1}, {&__pyx_n_s_ViewerDrawSize, __pyx_k_ViewerDrawSize, sizeof(__pyx_k_ViewerDrawSize), 0, 0, 1, 1}, {&__pyx_n_s_ViewerFileMode, __pyx_k_ViewerFileMode, sizeof(__pyx_k_ViewerFileMode), 0, 0, 1, 1}, {&__pyx_n_s_ViewerFormat, __pyx_k_ViewerFormat, sizeof(__pyx_k_ViewerFormat), 0, 0, 1, 1}, {&__pyx_n_s_ViewerHDF5, __pyx_k_ViewerHDF5, sizeof(__pyx_k_ViewerHDF5), 0, 0, 1, 1}, {&__pyx_n_s_ViewerType, __pyx_k_ViewerType, sizeof(__pyx_k_ViewerType), 0, 0, 1, 1}, {&__pyx_kp_s_Viewer_file_mode, __pyx_k_Viewer_file_mode, sizeof(__pyx_k_Viewer_file_mode), 0, 0, 1, 0}, {&__pyx_kp_s_Viewer_format, __pyx_k_Viewer_format, sizeof(__pyx_k_Viewer_format), 0, 0, 1, 0}, {&__pyx_kp_s_Viewer_type, __pyx_k_Viewer_type, sizeof(__pyx_k_Viewer_type), 0, 0, 1, 0}, {&__pyx_n_s_W, __pyx_k_W, sizeof(__pyx_k_W), 0, 0, 1, 1}, {&__pyx_n_s_WBM, __pyx_k_WBM, sizeof(__pyx_k_WBM), 0, 0, 1, 1}, {&__pyx_n_s_WINDOW, __pyx_k_WINDOW, sizeof(__pyx_k_WINDOW), 0, 0, 1, 1}, {&__pyx_n_s_WRITE, __pyx_k_WRITE, sizeof(__pyx_k_WRITE), 0, 0, 1, 1}, {&__pyx_n_s_WXY, __pyx_k_WXY, sizeof(__pyx_k_WXY), 0, 0, 1, 1}, {&__pyx_kp_s_Window_size, __pyx_k_Window_size, sizeof(__pyx_k_Window_size), 0, 0, 1, 0}, {&__pyx_n_s_X, __pyx_k_X, sizeof(__pyx_k_X), 0, 0, 1, 1}, {&__pyx_n_s_ZERO_INITIAL_GUESS, __pyx_k_ZERO_INITIAL_GUESS, sizeof(__pyx_k_ZERO_INITIAL_GUESS), 0, 0, 1, 1}, {&__pyx_kp_b__10, __pyx_k__10, sizeof(__pyx_k__10), 0, 0, 0, 0}, {&__pyx_kp_s__10, __pyx_k__10, sizeof(__pyx_k__10), 0, 0, 1, 0}, {&__pyx_kp_b__11, __pyx_k__11, sizeof(__pyx_k__11), 0, 0, 0, 0}, {&__pyx_kp_s__11, __pyx_k__11, sizeof(__pyx_k__11), 0, 0, 1, 0}, {&__pyx_kp_b__12, __pyx_k__12, sizeof(__pyx_k__12), 0, 0, 0, 0}, {&__pyx_kp_u__13, __pyx_k__13, sizeof(__pyx_k__13), 0, 1, 0, 0}, {&__pyx_kp_s__14, __pyx_k__14, sizeof(__pyx_k__14), 0, 0, 1, 0}, {&__pyx_kp_u__14, __pyx_k__14, sizeof(__pyx_k__14), 0, 1, 0, 0}, {&__pyx_kp_s__16, __pyx_k__16, sizeof(__pyx_k__16), 0, 0, 1, 0}, {&__pyx_kp_b__18, __pyx_k__18, sizeof(__pyx_k__18), 0, 0, 0, 0}, {&__pyx_kp_s__18, __pyx_k__18, sizeof(__pyx_k__18), 0, 0, 1, 0}, {&__pyx_kp_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 0}, {&__pyx_kp_u__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0, 0}, {&__pyx_n_s__257, __pyx_k__257, sizeof(__pyx_k__257), 0, 0, 1, 1}, {&__pyx_kp_s__26, __pyx_k__26, sizeof(__pyx_k__26), 0, 0, 1, 0}, {&__pyx_n_s__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 0, 1, 1}, {&__pyx_kp_u__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 1, 0, 0}, {&__pyx_kp_u__7, __pyx_k__7, sizeof(__pyx_k__7), 0, 1, 0, 0}, {&__pyx_kp_b__9, __pyx_k__9, sizeof(__pyx_k__9), 0, 0, 0, 0}, {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1}, {&__pyx_kp_s_a_2, __pyx_k_a_2, sizeof(__pyx_k_a_2), 0, 0, 1, 0}, {&__pyx_n_s_a_max, __pyx_k_a_max, sizeof(__pyx_k_a_max), 0, 0, 1, 1}, {&__pyx_n_s_abc, __pyx_k_abc, sizeof(__pyx_k_abc), 0, 0, 1, 1}, {&__pyx_n_s_abort, __pyx_k_abort, sizeof(__pyx_k_abort), 0, 0, 1, 1}, {&__pyx_kp_s_accessing_non_existent_buffer_se, __pyx_k_accessing_non_existent_buffer_se, sizeof(__pyx_k_accessing_non_existent_buffer_se), 0, 0, 1, 0}, {&__pyx_n_s_adaptStep, __pyx_k_adaptStep, sizeof(__pyx_k_adaptStep), 0, 0, 1, 1}, {&__pyx_n_s_addFlops, __pyx_k_addFlops, sizeof(__pyx_k_addFlops), 0, 0, 1, 1}, {&__pyx_n_s_addv, __pyx_k_addv, sizeof(__pyx_k_addv), 0, 0, 1, 1}, {&__pyx_n_s_adj, __pyx_k_adj, sizeof(__pyx_k_adj), 0, 0, 1, 1}, {&__pyx_n_s_adjoint_steps, __pyx_k_adjoint_steps, sizeof(__pyx_k_adjoint_steps), 0, 0, 1, 1}, {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1}, {&__pyx_n_s_alpha, __pyx_k_alpha, sizeof(__pyx_k_alpha), 0, 0, 1, 1}, {&__pyx_n_s_alpha2, __pyx_k_alpha2, sizeof(__pyx_k_alpha2), 0, 0, 1, 1}, {&__pyx_n_s_alpha_f, __pyx_k_alpha_f, sizeof(__pyx_k_alpha_f), 0, 0, 1, 1}, {&__pyx_n_s_alpha_m, __pyx_k_alpha_m, sizeof(__pyx_k_alpha_m), 0, 0, 1, 1}, {&__pyx_n_s_alphas, __pyx_k_alphas, sizeof(__pyx_k_alphas), 0, 0, 1, 1}, {&__pyx_n_s_amount, __pyx_k_amount, sizeof(__pyx_k_amount), 0, 0, 1, 1}, {&__pyx_kp_u_and, __pyx_k_and, sizeof(__pyx_k_and), 0, 1, 0, 0}, {&__pyx_n_s_app, __pyx_k_app, sizeof(__pyx_k_app), 0, 0, 1, 1}, {&__pyx_n_s_appctx, __pyx_k_appctx, sizeof(__pyx_k_appctx), 0, 0, 1, 1}, {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1}, {&__pyx_n_s_apply, __pyx_k_apply, sizeof(__pyx_k_apply), 0, 0, 1, 1}, {&__pyx_n_s_applySymmetricLeft, __pyx_k_applySymmetricLeft, sizeof(__pyx_k_applySymmetricLeft), 0, 0, 1, 1}, {&__pyx_n_s_applySymmetricRight, __pyx_k_applySymmetricRight, sizeof(__pyx_k_applySymmetricRight), 0, 0, 1, 1}, {&__pyx_n_s_applyTranspose, __pyx_k_applyTranspose, sizeof(__pyx_k_applyTranspose), 0, 0, 1, 1}, {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, {&__pyx_n_s_array, __pyx_k_array, sizeof(__pyx_k_array), 0, 0, 1, 1}, {&__pyx_n_s_array_interface, __pyx_k_array_interface, sizeof(__pyx_k_array_interface), 0, 0, 1, 1}, {&__pyx_kp_s_array_size_d_and_vector_local_si, __pyx_k_array_size_d_and_vector_local_si, sizeof(__pyx_k_array_size_d_and_vector_local_si), 0, 0, 1, 0}, {&__pyx_kp_s_array_size_d_incompatible_with_v, __pyx_k_array_size_d_incompatible_with_v, sizeof(__pyx_k_array_size_d_incompatible_with_v), 0, 0, 1, 0}, {&__pyx_n_s_array_w, __pyx_k_array_w, sizeof(__pyx_k_array_w), 0, 0, 1, 1}, {&__pyx_n_s_asmtype, __pyx_k_asmtype, sizeof(__pyx_k_asmtype), 0, 0, 1, 1}, {&__pyx_n_s_assemblies, __pyx_k_assemblies, sizeof(__pyx_k_assemblies), 0, 0, 1, 1}, {&__pyx_n_s_assembly, __pyx_k_assembly, sizeof(__pyx_k_assembly), 0, 0, 1, 1}, {&__pyx_n_s_assemblyBegin, __pyx_k_assemblyBegin, sizeof(__pyx_k_assemblyBegin), 0, 0, 1, 1}, {&__pyx_n_s_assemblyEnd, __pyx_k_assemblyEnd, sizeof(__pyx_k_assemblyEnd), 0, 0, 1, 1}, {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, {&__pyx_n_s_atexit, __pyx_k_atexit, sizeof(__pyx_k_atexit), 0, 0, 1, 1}, {&__pyx_n_s_atol, __pyx_k_atol, sizeof(__pyx_k_atol), 0, 0, 1, 1}, {&__pyx_n_s_attr, __pyx_k_attr, sizeof(__pyx_k_attr), 0, 0, 1, 1}, {&__pyx_n_s_au, __pyx_k_au, sizeof(__pyx_k_au), 0, 0, 1, 1}, {&__pyx_n_s_author, __pyx_k_author, sizeof(__pyx_k_author), 0, 0, 1, 1}, {&__pyx_n_s_authorinfo, __pyx_k_authorinfo, sizeof(__pyx_k_authorinfo), 0, 0, 1, 1}, {&__pyx_n_s_aux, __pyx_k_aux, sizeof(__pyx_k_aux), 0, 0, 1, 1}, {&__pyx_n_s_axpy, __pyx_k_axpy, sizeof(__pyx_k_axpy), 0, 0, 1, 1}, {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1}, {&__pyx_n_s_back, __pyx_k_back, sizeof(__pyx_k_back), 0, 0, 1, 1}, {&__pyx_n_s_back_down, __pyx_k_back_down, sizeof(__pyx_k_back_down), 0, 0, 1, 1}, {&__pyx_n_s_back_down_left, __pyx_k_back_down_left, sizeof(__pyx_k_back_down_left), 0, 0, 1, 1}, {&__pyx_n_s_back_down_right, __pyx_k_back_down_right, sizeof(__pyx_k_back_down_right), 0, 0, 1, 1}, {&__pyx_n_s_back_left, __pyx_k_back_left, sizeof(__pyx_k_back_left), 0, 0, 1, 1}, {&__pyx_n_s_back_right, __pyx_k_back_right, sizeof(__pyx_k_back_right), 0, 0, 1, 1}, {&__pyx_n_s_back_up, __pyx_k_back_up, sizeof(__pyx_k_back_up), 0, 0, 1, 1}, {&__pyx_n_s_back_up_left, __pyx_k_back_up_left, sizeof(__pyx_k_back_up_left), 0, 0, 1, 1}, {&__pyx_n_s_back_up_right, __pyx_k_back_up_right, sizeof(__pyx_k_back_up_right), 0, 0, 1, 1}, {&__pyx_n_s_barrier, __pyx_k_barrier, sizeof(__pyx_k_barrier), 0, 0, 1, 1}, {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1}, {&__pyx_n_s_batchSize, __pyx_k_batchSize, sizeof(__pyx_k_batchSize), 0, 0, 1, 1}, {&__pyx_n_s_bcComps, __pyx_k_bcComps, sizeof(__pyx_k_bcComps), 0, 0, 1, 1}, {&__pyx_n_s_bcField, __pyx_k_bcField, sizeof(__pyx_k_bcField), 0, 0, 1, 1}, {&__pyx_n_s_bcPoints, __pyx_k_bcPoints, sizeof(__pyx_k_bcPoints), 0, 0, 1, 1}, {&__pyx_kp_s_bcPoints_is_a_required_argument, __pyx_k_bcPoints_is_a_required_argument, sizeof(__pyx_k_bcPoints_is_a_required_argument), 0, 0, 1, 0}, {&__pyx_n_s_bdLabel, __pyx_k_bdLabel, sizeof(__pyx_k_bdLabel), 0, 0, 1, 1}, {&__pyx_n_s_bdlabel, __pyx_k_bdlabel, sizeof(__pyx_k_bdlabel), 0, 0, 1, 1}, {&__pyx_n_s_bdvalue, __pyx_k_bdvalue, sizeof(__pyx_k_bdvalue), 0, 0, 1, 1}, {&__pyx_n_s_begin, __pyx_k_begin, sizeof(__pyx_k_begin), 0, 0, 1, 1}, {&__pyx_n_s_begin_args, __pyx_k_begin_args, sizeof(__pyx_k_begin_args), 0, 0, 1, 1}, {&__pyx_n_s_begin_kargs, __pyx_k_begin_kargs, sizeof(__pyx_k_begin_kargs), 0, 0, 1, 1}, {&__pyx_n_s_beta, __pyx_k_beta, sizeof(__pyx_k_beta), 0, 0, 1, 1}, {&__pyx_n_s_bits, __pyx_k_bits, sizeof(__pyx_k_bits), 0, 0, 1, 1}, {&__pyx_n_s_blockSize, __pyx_k_blockSize, sizeof(__pyx_k_blockSize), 0, 0, 1, 1}, {&__pyx_n_s_block_size, __pyx_k_block_size, sizeof(__pyx_k_block_size), 0, 0, 1, 1}, {&__pyx_kp_s_block_size_d_must_be_positive, __pyx_k_block_size_d_must_be_positive, sizeof(__pyx_k_block_size_d_must_be_positive), 0, 0, 1, 0}, {&__pyx_kp_s_block_size_not_set, __pyx_k_block_size_not_set, sizeof(__pyx_k_block_size_not_set), 0, 0, 1, 0}, {&__pyx_n_s_blocksize, __pyx_k_blocksize, sizeof(__pyx_k_blocksize), 0, 0, 1, 1}, {&__pyx_n_s_bndr, __pyx_k_bndr, sizeof(__pyx_k_bndr), 0, 0, 1, 1}, {&__pyx_n_s_bool, __pyx_k_bool, sizeof(__pyx_k_bool), 0, 0, 1, 1}, {&__pyx_n_s_boundary, __pyx_k_boundary, sizeof(__pyx_k_boundary), 0, 0, 1, 1}, {&__pyx_n_s_boundary_type, __pyx_k_boundary_type, sizeof(__pyx_k_boundary_type), 0, 0, 1, 1}, {&__pyx_n_s_boundary_types, __pyx_k_boundary_types, sizeof(__pyx_k_boundary_types), 0, 0, 1, 1}, {&__pyx_n_s_box, __pyx_k_box, sizeof(__pyx_k_box), 0, 0, 1, 1}, {&__pyx_n_s_bs, __pyx_k_bs, sizeof(__pyx_k_bs), 0, 0, 1, 1}, {&__pyx_n_s_bsize, __pyx_k_bsize, sizeof(__pyx_k_bsize), 0, 0, 1, 1}, {&__pyx_n_s_buffer, __pyx_k_buffer, sizeof(__pyx_k_buffer), 0, 0, 1, 1}, {&__pyx_n_s_buffer_w, __pyx_k_buffer_w, sizeof(__pyx_k_buffer_w), 0, 0, 1, 1}, {&__pyx_n_s_buildResidual, __pyx_k_buildResidual, sizeof(__pyx_k_buildResidual), 0, 0, 1, 1}, {&__pyx_n_s_buildSolution, __pyx_k_buildSolution, sizeof(__pyx_k_buildSolution), 0, 0, 1, 1}, {&__pyx_n_s_builtins, __pyx_k_builtins, sizeof(__pyx_k_builtins), 0, 0, 1, 1}, {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1}, {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1}, {&__pyx_kp_s_c_d, __pyx_k_c_d, sizeof(__pyx_k_c_d), 0, 0, 1, 0}, {&__pyx_n_s_cancelMonitor, __pyx_k_cancelMonitor, sizeof(__pyx_k_cancelMonitor), 0, 0, 1, 1}, {&__pyx_kp_s_cannot_place_input_array_size_d, __pyx_k_cannot_place_input_array_size_d, sizeof(__pyx_k_cannot_place_input_array_size_d), 0, 0, 1, 0}, {&__pyx_n_s_catol, __pyx_k_catol, sizeof(__pyx_k_catol), 0, 0, 1, 1}, {&__pyx_n_s_ccomm, __pyx_k_ccomm, sizeof(__pyx_k_ccomm), 0, 0, 1, 1}, {&__pyx_n_s_cdctx, __pyx_k_cdctx, sizeof(__pyx_k_cdctx), 0, 0, 1, 1}, {&__pyx_n_s_cdevice_type, __pyx_k_cdevice_type, sizeof(__pyx_k_cdevice_type), 0, 0, 1, 1}, {&__pyx_n_s_cell, __pyx_k_cell, sizeof(__pyx_k_cell), 0, 0, 1, 1}, {&__pyx_n_s_cellNodeMaps, __pyx_k_cellNodeMaps, sizeof(__pyx_k_cellNodeMaps), 0, 0, 1, 1}, {&__pyx_kp_s_cell_indices_must_have_two_dimen, __pyx_k_cell_indices_must_have_two_dimen, sizeof(__pyx_k_cell_indices_must_have_two_dimen), 0, 0, 1, 0}, {&__pyx_n_s_cells, __pyx_k_cells, sizeof(__pyx_k_cells), 0, 0, 1, 1}, {&__pyx_n_s_cg_type, __pyx_k_cg_type, sizeof(__pyx_k_cg_type), 0, 0, 1, 1}, {&__pyx_n_s_cgid, __pyx_k_cgid, sizeof(__pyx_k_cgid), 0, 0, 1, 1}, {&__pyx_n_s_citation, __pyx_k_citation, sizeof(__pyx_k_citation), 0, 0, 1, 1}, {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1}, {&__pyx_n_s_class_getitem, __pyx_k_class_getitem, sizeof(__pyx_k_class_getitem), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_cmap, __pyx_k_cmap, sizeof(__pyx_k_cmap), 0, 0, 1, 1}, {&__pyx_n_s_cnorm, __pyx_k_cnorm, sizeof(__pyx_k_cnorm), 0, 0, 1, 1}, {&__pyx_n_s_coarsen, __pyx_k_coarsen, sizeof(__pyx_k_coarsen), 0, 0, 1, 1}, {&__pyx_n_s_coarsenhook, __pyx_k_coarsenhook, sizeof(__pyx_k_coarsenhook), 0, 0, 1, 1}, {&__pyx_n_s_code, __pyx_k_code, sizeof(__pyx_k_code), 0, 0, 1, 1}, {&__pyx_n_s_col, __pyx_k_col, sizeof(__pyx_k_col), 0, 0, 1, 1}, {&__pyx_n_s_col_bsize, __pyx_k_col_bsize, sizeof(__pyx_k_col_bsize), 0, 0, 1, 1}, {&__pyx_n_s_collections, __pyx_k_collections, sizeof(__pyx_k_collections), 0, 0, 1, 1}, {&__pyx_kp_s_collections_abc, __pyx_k_collections_abc, sizeof(__pyx_k_collections_abc), 0, 0, 1, 0}, {&__pyx_n_s_cols, __pyx_k_cols, sizeof(__pyx_k_cols), 0, 0, 1, 1}, {&__pyx_n_s_column, __pyx_k_column, sizeof(__pyx_k_column), 0, 0, 1, 1}, {&__pyx_kp_s_column_indices_must_have_two_dim, __pyx_k_column_indices_must_have_two_dim, sizeof(__pyx_k_column_indices_must_have_two_dim), 0, 0, 1, 0}, {&__pyx_n_s_comm, __pyx_k_comm, sizeof(__pyx_k_comm), 0, 0, 1, 1}, {&__pyx_n_s_comms, __pyx_k_comms, sizeof(__pyx_k_comms), 0, 0, 1, 1}, {&__pyx_kp_s_communicator_not_owned, __pyx_k_communicator_not_owned, sizeof(__pyx_k_communicator_not_owned), 0, 0, 1, 0}, {&__pyx_n_s_comp, __pyx_k_comp, sizeof(__pyx_k_comp), 0, 0, 1, 1}, {&__pyx_n_s_compile, __pyx_k_compile, sizeof(__pyx_k_compile), 0, 0, 1, 1}, {&__pyx_n_s_compressed, __pyx_k_compressed, sizeof(__pyx_k_compressed), 0, 0, 1, 1}, {&__pyx_n_s_concatenate, __pyx_k_concatenate, sizeof(__pyx_k_concatenate), 0, 0, 1, 1}, {&__pyx_n_s_cone, __pyx_k_cone, sizeof(__pyx_k_cone), 0, 0, 1, 1}, {&__pyx_n_s_coneOrientation, __pyx_k_coneOrientation, sizeof(__pyx_k_coneOrientation), 0, 0, 1, 1}, {&__pyx_n_s_conePoint, __pyx_k_conePoint, sizeof(__pyx_k_conePoint), 0, 0, 1, 1}, {&__pyx_n_s_conePos, __pyx_k_conePos, sizeof(__pyx_k_conePos), 0, 0, 1, 1}, {&__pyx_n_s_conforming, __pyx_k_conforming, sizeof(__pyx_k_conforming), 0, 0, 1, 1}, {&__pyx_n_s_conjugate, __pyx_k_conjugate, sizeof(__pyx_k_conjugate), 0, 0, 1, 1}, {&__pyx_n_s_constant, __pyx_k_constant, sizeof(__pyx_k_constant), 0, 0, 1, 1}, {&__pyx_n_s_constraints, __pyx_k_constraints, sizeof(__pyx_k_constraints), 0, 0, 1, 1}, {&__pyx_n_s_context, __pyx_k_context, sizeof(__pyx_k_context), 0, 0, 1, 1}, {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0}, {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0}, {&__pyx_n_s_continuous, __pyx_k_continuous, sizeof(__pyx_k_continuous), 0, 0, 1, 1}, {&__pyx_n_s_converged, __pyx_k_converged, sizeof(__pyx_k_converged), 0, 0, 1, 1}, {&__pyx_n_s_coordinates, __pyx_k_coordinates, sizeof(__pyx_k_coordinates), 0, 0, 1, 1}, {&__pyx_kp_s_coordinates_must_have_two_dimens, __pyx_k_coordinates_must_have_two_dimens, sizeof(__pyx_k_coordinates_must_have_two_dimens), 0, 0, 1, 0}, {&__pyx_kp_s_coordinates_size_must_be_at_leas, __pyx_k_coordinates_size_must_be_at_leas, sizeof(__pyx_k_coordinates_size_must_be_at_leas), 0, 0, 1, 0}, {&__pyx_n_s_coords, __pyx_k_coords, sizeof(__pyx_k_coords), 0, 0, 1, 1}, {&__pyx_kp_s_coords_vertices_must_have_two_di, __pyx_k_coords_vertices_must_have_two_di, sizeof(__pyx_k_coords_vertices_must_have_two_di), 0, 0, 1, 0}, {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1}, {&__pyx_n_s_correction_type, __pyx_k_correction_type, sizeof(__pyx_k_correction_type), 0, 0, 1, 1}, {&__pyx_n_s_count, __pyx_k_count, sizeof(__pyx_k_count), 0, 0, 1, 1}, {&__pyx_n_s_cpuarray, __pyx_k_cpuarray, sizeof(__pyx_k_cpuarray), 0, 0, 1, 1}, {&__pyx_n_s_crank, __pyx_k_crank, sizeof(__pyx_k_crank), 0, 0, 1, 1}, {&__pyx_n_s_cratio, __pyx_k_cratio, sizeof(__pyx_k_cratio), 0, 0, 1, 1}, {&__pyx_n_s_create, __pyx_k_create, sizeof(__pyx_k_create), 0, 0, 1, 1}, {&__pyx_n_s_createDefaultSF, __pyx_k_createDefaultSF, sizeof(__pyx_k_createDefaultSF), 0, 0, 1, 1}, {&__pyx_n_s_createGlobalVec, __pyx_k_createGlobalVec, sizeof(__pyx_k_createGlobalVec), 0, 0, 1, 1}, {&__pyx_n_s_createGlobalVector, __pyx_k_createGlobalVector, sizeof(__pyx_k_createGlobalVector), 0, 0, 1, 1}, {&__pyx_n_s_createLabel, __pyx_k_createLabel, sizeof(__pyx_k_createLabel), 0, 0, 1, 1}, {&__pyx_n_s_createLocalVec, __pyx_k_createLocalVec, sizeof(__pyx_k_createLocalVec), 0, 0, 1, 1}, {&__pyx_n_s_createLocalVector, __pyx_k_createLocalVector, sizeof(__pyx_k_createLocalVector), 0, 0, 1, 1}, {&__pyx_n_s_createMat, __pyx_k_createMat, sizeof(__pyx_k_createMat), 0, 0, 1, 1}, {&__pyx_n_s_createMatrix, __pyx_k_createMatrix, sizeof(__pyx_k_createMatrix), 0, 0, 1, 1}, {&__pyx_n_s_createNaturalVec, __pyx_k_createNaturalVec, sizeof(__pyx_k_createNaturalVec), 0, 0, 1, 1}, {&__pyx_n_s_createNaturalVector, __pyx_k_createNaturalVector, sizeof(__pyx_k_createNaturalVector), 0, 0, 1, 1}, {&__pyx_n_s_createSectionSF, __pyx_k_createSectionSF, sizeof(__pyx_k_createSectionSF), 0, 0, 1, 1}, {&__pyx_n_s_createSubMatrix, __pyx_k_createSubMatrix, sizeof(__pyx_k_createSubMatrix), 0, 0, 1, 1}, {&__pyx_n_s_createVecLeft, __pyx_k_createVecLeft, sizeof(__pyx_k_createVecLeft), 0, 0, 1, 1}, {&__pyx_n_s_createVecRight, __pyx_k_createVecRight, sizeof(__pyx_k_createVecRight), 0, 0, 1, 1}, {&__pyx_n_s_createVecs, __pyx_k_createVecs, sizeof(__pyx_k_createVecs), 0, 0, 1, 1}, {&__pyx_n_s_create_gvec, __pyx_k_create_gvec, sizeof(__pyx_k_create_gvec), 0, 0, 1, 1}, {&__pyx_n_s_create_injection, __pyx_k_create_injection, sizeof(__pyx_k_create_injection), 0, 0, 1, 1}, {&__pyx_n_s_create_interpolation, __pyx_k_create_interpolation, sizeof(__pyx_k_create_interpolation), 0, 0, 1, 1}, {&__pyx_n_s_create_lvec, __pyx_k_create_lvec, sizeof(__pyx_k_create_lvec), 0, 0, 1, 1}, {&__pyx_n_s_create_matrix, __pyx_k_create_matrix, sizeof(__pyx_k_create_matrix), 0, 0, 1, 1}, {&__pyx_n_s_create_restriction, __pyx_k_create_restriction, sizeof(__pyx_k_create_restriction), 0, 0, 1, 1}, {&__pyx_n_s_create_subdm, __pyx_k_create_subdm, sizeof(__pyx_k_create_subdm), 0, 0, 1, 1}, {&__pyx_n_s_crtol, __pyx_k_crtol, sizeof(__pyx_k_crtol), 0, 0, 1, 1}, {&__pyx_n_s_csize, __pyx_k_csize, sizeof(__pyx_k_csize), 0, 0, 1, 1}, {&__pyx_n_s_csr, __pyx_k_csr, sizeof(__pyx_k_csr), 0, 0, 1, 1}, {&__pyx_n_s_ctype, __pyx_k_ctype, sizeof(__pyx_k_ctype), 0, 0, 1, 1}, {&__pyx_n_s_cudahandle, __pyx_k_cudahandle, sizeof(__pyx_k_cudahandle), 0, 0, 1, 1}, {&__pyx_n_s_cycle_type, __pyx_k_cycle_type, sizeof(__pyx_k_cycle_type), 0, 0, 1, 1}, {&__pyx_kp_s_d_s, __pyx_k_d_s, sizeof(__pyx_k_d_s), 0, 0, 1, 0}, {&__pyx_n_s_da, __pyx_k_da, sizeof(__pyx_k_da), 0, 0, 1, 1}, {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1}, {&__pyx_n_s_date, __pyx_k_date, sizeof(__pyx_k_date), 0, 0, 1, 1}, {&__pyx_n_s_dctx, __pyx_k_dctx, sizeof(__pyx_k_dctx), 0, 0, 1, 1}, {&__pyx_n_s_debugger, __pyx_k_debugger, sizeof(__pyx_k_debugger), 0, 0, 1, 1}, {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1}, {&__pyx_n_s_decomp, __pyx_k_decomp, sizeof(__pyx_k_decomp), 0, 0, 1, 1}, {&__pyx_n_s_decorator, __pyx_k_decorator, sizeof(__pyx_k_decorator), 0, 0, 1, 1}, {&__pyx_n_s_default, __pyx_k_default, sizeof(__pyx_k_default), 0, 0, 1, 1}, {&__pyx_n_s_degree, __pyx_k_degree, sizeof(__pyx_k_degree), 0, 0, 1, 1}, {&__pyx_n_s_delValue, __pyx_k_delValue, sizeof(__pyx_k_delValue), 0, 0, 1, 1}, {&__pyx_n_s_dense, __pyx_k_dense, sizeof(__pyx_k_dense), 0, 0, 1, 1}, {&__pyx_n_s_design, __pyx_k_design, sizeof(__pyx_k_design), 0, 0, 1, 1}, {&__pyx_n_s_destroy, __pyx_k_destroy, sizeof(__pyx_k_destroy), 0, 0, 1, 1}, {&__pyx_n_s_determinant, __pyx_k_determinant, sizeof(__pyx_k_determinant), 0, 0, 1, 1}, {&__pyx_n_s_devel, __pyx_k_devel, sizeof(__pyx_k_devel), 0, 0, 1, 1}, {&__pyx_n_s_device, __pyx_k_device, sizeof(__pyx_k_device), 0, 0, 1, 1}, {&__pyx_n_s_device_id, __pyx_k_device_id, sizeof(__pyx_k_device_id), 0, 0, 1, 1}, {&__pyx_n_s_device_type, __pyx_k_device_type, sizeof(__pyx_k_device_type), 0, 0, 1, 1}, {&__pyx_n_s_diag, __pyx_k_diag, sizeof(__pyx_k_diag), 0, 0, 1, 1}, {&__pyx_n_s_diagonalScale, __pyx_k_diagonalScale, sizeof(__pyx_k_diagonalScale), 0, 0, 1, 1}, {&__pyx_n_s_diagonal_fill, __pyx_k_diagonal_fill, sizeof(__pyx_k_diagonal_fill), 0, 0, 1, 1}, {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, {&__pyx_n_s_dim, __pyx_k_dim, sizeof(__pyx_k_dim), 0, 0, 1, 1}, {&__pyx_n_s_dims, __pyx_k_dims, sizeof(__pyx_k_dims), 0, 0, 1, 1}, {&__pyx_n_s_direction, __pyx_k_direction, sizeof(__pyx_k_direction), 0, 0, 1, 1}, {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0}, {&__pyx_n_s_disc, __pyx_k_disc, sizeof(__pyx_k_disc), 0, 0, 1, 1}, {&__pyx_n_s_display, __pyx_k_display, sizeof(__pyx_k_display), 0, 0, 1, 1}, {&__pyx_n_s_dist, __pyx_k_dist, sizeof(__pyx_k_dist), 0, 0, 1, 1}, {&__pyx_n_s_div, __pyx_k_div, sizeof(__pyx_k_div), 0, 0, 1, 1}, {&__pyx_n_s_divtol, __pyx_k_divtol, sizeof(__pyx_k_divtol), 0, 0, 1, 1}, {&__pyx_n_s_dlpack, __pyx_k_dlpack, sizeof(__pyx_k_dlpack), 0, 0, 1, 1}, {&__pyx_n_s_dltensor, __pyx_k_dltensor, sizeof(__pyx_k_dltensor), 0, 0, 1, 1}, {&__pyx_n_s_dm, __pyx_k_dm, sizeof(__pyx_k_dm), 0, 0, 1, 1}, {&__pyx_n_s_dmTo, __pyx_k_dmTo, sizeof(__pyx_k_dmTo), 0, 0, 1, 1}, {&__pyx_n_s_dm_type, __pyx_k_dm_type, sizeof(__pyx_k_dm_type), 0, 0, 1, 1}, {&__pyx_n_s_dmf, __pyx_k_dmf, sizeof(__pyx_k_dmf), 0, 0, 1, 1}, {&__pyx_n_s_dms, __pyx_k_dms, sizeof(__pyx_k_dms), 0, 0, 1, 1}, {&__pyx_n_s_dmswarm_type, __pyx_k_dmswarm_type, sizeof(__pyx_k_dmswarm_type), 0, 0, 1, 1}, {&__pyx_n_s_dmtype, __pyx_k_dmtype, sizeof(__pyx_k_dmtype), 0, 0, 1, 1}, {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, {&__pyx_n_s_dof, __pyx_k_dof, sizeof(__pyx_k_dof), 0, 0, 1, 1}, {&__pyx_n_s_dofs, __pyx_k_dofs, sizeof(__pyx_k_dofs), 0, 0, 1, 1}, {&__pyx_n_s_dosort, __pyx_k_dosort, sizeof(__pyx_k_dosort), 0, 0, 1, 1}, {&__pyx_n_s_dot, __pyx_k_dot, sizeof(__pyx_k_dot), 0, 0, 1, 1}, {&__pyx_n_s_down, __pyx_k_down, sizeof(__pyx_k_down), 0, 0, 1, 1}, {&__pyx_n_s_down_left, __pyx_k_down_left, sizeof(__pyx_k_down_left), 0, 0, 1, 1}, {&__pyx_n_s_down_right, __pyx_k_down_right, sizeof(__pyx_k_down_right), 0, 0, 1, 1}, {&__pyx_n_s_drop, __pyx_k_drop, sizeof(__pyx_k_drop), 0, 0, 1, 1}, {&__pyx_n_s_ds_type, __pyx_k_ds_type, sizeof(__pyx_k_ds_type), 0, 0, 1, 1}, {&__pyx_n_s_dspace, __pyx_k_dspace, sizeof(__pyx_k_dspace), 0, 0, 1, 1}, {&__pyx_n_s_dt, __pyx_k_dt, sizeof(__pyx_k_dt), 0, 0, 1, 1}, {&__pyx_n_s_dtcol, __pyx_k_dtcol, sizeof(__pyx_k_dtcol), 0, 0, 1, 1}, {&__pyx_n_s_dtcount, __pyx_k_dtcount, sizeof(__pyx_k_dtcount), 0, 0, 1, 1}, {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1}, {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1}, {&__pyx_n_s_dualspace_type, __pyx_k_dualspace_type, sizeof(__pyx_k_dualspace_type), 0, 0, 1, 1}, {&__pyx_n_s_duplicate, __pyx_k_duplicate, sizeof(__pyx_k_duplicate), 0, 0, 1, 1}, {&__pyx_n_s_e, __pyx_k_e, sizeof(__pyx_k_e), 0, 0, 1, 1}, {&__pyx_n_s_elem_type, __pyx_k_elem_type, sizeof(__pyx_k_elem_type), 0, 0, 1, 1}, {&__pyx_n_s_element, __pyx_k_element, sizeof(__pyx_k_element), 0, 0, 1, 1}, {&__pyx_n_s_emacs, __pyx_k_emacs, sizeof(__pyx_k_emacs), 0, 0, 1, 1}, {&__pyx_kp_s_empty_citation, __pyx_k_empty_citation, sizeof(__pyx_k_empty_citation), 0, 0, 1, 0}, {&__pyx_kp_s_empty_name, __pyx_k_empty_name, sizeof(__pyx_k_empty_name), 0, 0, 1, 0}, {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0}, {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1}, {&__pyx_n_s_end_args, __pyx_k_end_args, sizeof(__pyx_k_end_args), 0, 0, 1, 1}, {&__pyx_n_s_end_kargs, __pyx_k_end_kargs, sizeof(__pyx_k_end_kargs), 0, 0, 1, 1}, {&__pyx_n_s_enter, __pyx_k_enter, sizeof(__pyx_k_enter), 0, 0, 1, 1}, {&__pyx_n_s_entityDepth, __pyx_k_entityDepth, sizeof(__pyx_k_entityDepth), 0, 0, 1, 1}, {&__pyx_n_s_entry, __pyx_k_entry, sizeof(__pyx_k_entry), 0, 0, 1, 1}, {&__pyx_n_s_enum2str, __pyx_k_enum2str, sizeof(__pyx_k_enum2str), 0, 0, 1, 1}, {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1}, {&__pyx_n_s_epsilon, __pyx_k_epsilon, sizeof(__pyx_k_epsilon), 0, 0, 1, 1}, {&__pyx_n_s_eqtype, __pyx_k_eqtype, sizeof(__pyx_k_eqtype), 0, 0, 1, 1}, {&__pyx_n_s_equality_constraints, __pyx_k_equality_constraints, sizeof(__pyx_k_equality_constraints), 0, 0, 1, 1}, {&__pyx_n_s_errhandler, __pyx_k_errhandler, sizeof(__pyx_k_errhandler), 0, 0, 1, 1}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_kp_s_error_code_d, __pyx_k_error_code_d, sizeof(__pyx_k_error_code_d), 0, 0, 1, 0}, {&__pyx_n_s_eta, __pyx_k_eta, sizeof(__pyx_k_eta), 0, 0, 1, 1}, {&__pyx_n_s_evaluatestep, __pyx_k_evaluatestep, sizeof(__pyx_k_evaluatestep), 0, 0, 1, 1}, {&__pyx_n_s_eventhandler, __pyx_k_eventhandler, sizeof(__pyx_k_eventhandler), 0, 0, 1, 1}, {&__pyx_n_s_exec, __pyx_k_exec, sizeof(__pyx_k_exec), 0, 0, 1, 1}, {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1}, {&__pyx_n_s_exoid, __pyx_k_exoid, sizeof(__pyx_k_exoid), 0, 0, 1, 1}, {&__pyx_kp_s_expecting_a_C_contiguous_array, __pyx_k_expecting_a_C_contiguous_array, sizeof(__pyx_k_expecting_a_C_contiguous_array), 0, 0, 1, 0}, {&__pyx_kp_s_expecting_tuple_list_or_dict, __pyx_k_expecting_tuple_list_or_dict, sizeof(__pyx_k_expecting_tuple_list_or_dict), 0, 0, 1, 0}, {&__pyx_n_s_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 0, 1, 1}, {&__pyx_n_s_faces, __pyx_k_faces, sizeof(__pyx_k_faces), 0, 0, 1, 1}, {&__pyx_n_s_fact, __pyx_k_fact, sizeof(__pyx_k_fact), 0, 0, 1, 1}, {&__pyx_n_s_factor_mallocs, __pyx_k_factor_mallocs, sizeof(__pyx_k_factor_mallocs), 0, 0, 1, 1}, {&__pyx_n_s_fe_type, __pyx_k_fe_type, sizeof(__pyx_k_fe_type), 0, 0, 1, 1}, {&__pyx_n_s_fget, __pyx_k_fget, sizeof(__pyx_k_fget), 0, 0, 1, 1}, {&__pyx_n_s_field, __pyx_k_field, sizeof(__pyx_k_field), 0, 0, 1, 1}, {&__pyx_n_s_fieldName, __pyx_k_fieldName, sizeof(__pyx_k_fieldName), 0, 0, 1, 1}, {&__pyx_n_s_fieldname, __pyx_k_fieldname, sizeof(__pyx_k_fieldname), 0, 0, 1, 1}, {&__pyx_n_s_fieldnames, __pyx_k_fieldnames, sizeof(__pyx_k_fieldnames), 0, 0, 1, 1}, {&__pyx_n_s_fields, __pyx_k_fields, sizeof(__pyx_k_fields), 0, 0, 1, 1}, {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1}, {&__pyx_n_s_filename, __pyx_k_filename, sizeof(__pyx_k_filename), 0, 0, 1, 1}, {&__pyx_n_s_fill, __pyx_k_fill, sizeof(__pyx_k_fill), 0, 0, 1, 1}, {&__pyx_n_s_fill_param, __pyx_k_fill_param, sizeof(__pyx_k_fill_param), 0, 0, 1, 1}, {&__pyx_n_s_fill_ratio_given, __pyx_k_fill_ratio_given, sizeof(__pyx_k_fill_ratio_given), 0, 0, 1, 1}, {&__pyx_n_s_fill_ratio_needed, __pyx_k_fill_ratio_needed, sizeof(__pyx_k_fill_ratio_needed), 0, 0, 1, 1}, {&__pyx_n_s_finalize, __pyx_k_finalize, sizeof(__pyx_k_finalize), 0, 0, 1, 1}, {&__pyx_n_s_first, __pyx_k_first, sizeof(__pyx_k_first), 0, 0, 1, 1}, {&__pyx_n_s_fix, __pyx_k_fix, sizeof(__pyx_k_fix), 0, 0, 1, 1}, {&__pyx_n_s_flag, __pyx_k_flag, sizeof(__pyx_k_flag), 0, 0, 1, 1}, {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1}, {&__pyx_n_s_flg, __pyx_k_flg, sizeof(__pyx_k_flg), 0, 0, 1, 1}, {&__pyx_n_s_flip, __pyx_k_flip, sizeof(__pyx_k_flip), 0, 0, 1, 1}, {&__pyx_n_s_flops, __pyx_k_flops, sizeof(__pyx_k_flops), 0, 0, 1, 1}, {&__pyx_n_s_flush, __pyx_k_flush, sizeof(__pyx_k_flush), 0, 0, 1, 1}, {&__pyx_n_s_fnorm, __pyx_k_fnorm, sizeof(__pyx_k_fnorm), 0, 0, 1, 1}, {&__pyx_n_s_force, __pyx_k_force, sizeof(__pyx_k_force), 0, 0, 1, 1}, {&__pyx_n_s_formDegree, __pyx_k_formDegree, sizeof(__pyx_k_formDegree), 0, 0, 1, 1}, {&__pyx_n_s_formSNESFunction, __pyx_k_formSNESFunction, sizeof(__pyx_k_formSNESFunction), 0, 0, 1, 1}, {&__pyx_n_s_formSNESJacobian, __pyx_k_formSNESJacobian, sizeof(__pyx_k_formSNESJacobian), 0, 0, 1, 1}, {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1}, {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1}, {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1}, {&__pyx_n_s_forward, __pyx_k_forward, sizeof(__pyx_k_forward), 0, 0, 1, 1}, {&__pyx_n_s_front, __pyx_k_front, sizeof(__pyx_k_front), 0, 0, 1, 1}, {&__pyx_n_s_front_down, __pyx_k_front_down, sizeof(__pyx_k_front_down), 0, 0, 1, 1}, {&__pyx_n_s_front_down_left, __pyx_k_front_down_left, sizeof(__pyx_k_front_down_left), 0, 0, 1, 1}, {&__pyx_n_s_front_down_right, __pyx_k_front_down_right, sizeof(__pyx_k_front_down_right), 0, 0, 1, 1}, {&__pyx_n_s_front_left, __pyx_k_front_left, sizeof(__pyx_k_front_left), 0, 0, 1, 1}, {&__pyx_n_s_front_right, __pyx_k_front_right, sizeof(__pyx_k_front_right), 0, 0, 1, 1}, {&__pyx_n_s_front_up, __pyx_k_front_up, sizeof(__pyx_k_front_up), 0, 0, 1, 1}, {&__pyx_n_s_front_up_left, __pyx_k_front_up_left, sizeof(__pyx_k_front_up_left), 0, 0, 1, 1}, {&__pyx_n_s_front_up_right, __pyx_k_front_up_right, sizeof(__pyx_k_front_up_right), 0, 0, 1, 1}, {&__pyx_n_s_func, __pyx_k_func, sizeof(__pyx_k_func), 0, 0, 1, 1}, {&__pyx_n_s_function, __pyx_k_function, sizeof(__pyx_k_function), 0, 0, 1, 1}, {&__pyx_n_s_functional, __pyx_k_functional, sizeof(__pyx_k_functional), 0, 0, 1, 1}, {&__pyx_n_s_functools, __pyx_k_functools, sizeof(__pyx_k_functools), 0, 0, 1, 1}, {&__pyx_n_s_g, __pyx_k_g, sizeof(__pyx_k_g), 0, 0, 1, 1}, {&__pyx_n_s_gamgtype, __pyx_k_gamgtype, sizeof(__pyx_k_gamgtype), 0, 0, 1, 1}, {&__pyx_n_s_gamma, __pyx_k_gamma, sizeof(__pyx_k_gamma), 0, 0, 1, 1}, {&__pyx_n_s_garbage_cleanup, __pyx_k_garbage_cleanup, sizeof(__pyx_k_garbage_cleanup), 0, 0, 1, 1}, {&__pyx_n_s_garbage_view, __pyx_k_garbage_view, sizeof(__pyx_k_garbage_view), 0, 0, 1, 1}, {&__pyx_n_s_gasmtype, __pyx_k_gasmtype, sizeof(__pyx_k_gasmtype), 0, 0, 1, 1}, {&__pyx_n_s_gatol, __pyx_k_gatol, sizeof(__pyx_k_gatol), 0, 0, 1, 1}, {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0}, {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1}, {&__pyx_kp_s_get1dCoordinatecArrays_for_DMSta, __pyx_k_get1dCoordinatecArrays_for_DMSta, sizeof(__pyx_k_get1dCoordinatecArrays_for_DMSta), 0, 0, 1, 0}, {&__pyx_n_s_getActive, __pyx_k_getActive, sizeof(__pyx_k_getActive), 0, 0, 1, 1}, {&__pyx_n_s_getActiveAll, __pyx_k_getActiveAll, sizeof(__pyx_k_getActiveAll), 0, 0, 1, 1}, {&__pyx_n_s_getAppCtx, __pyx_k_getAppCtx, sizeof(__pyx_k_getAppCtx), 0, 0, 1, 1}, {&__pyx_n_s_getApplicationContext, __pyx_k_getApplicationContext, sizeof(__pyx_k_getApplicationContext), 0, 0, 1, 1}, {&__pyx_n_s_getArray, __pyx_k_getArray, sizeof(__pyx_k_getArray), 0, 0, 1, 1}, {&__pyx_n_s_getBlockIndices, __pyx_k_getBlockIndices, sizeof(__pyx_k_getBlockIndices), 0, 0, 1, 1}, {&__pyx_n_s_getBlockInfo, __pyx_k_getBlockInfo, sizeof(__pyx_k_getBlockInfo), 0, 0, 1, 1}, {&__pyx_n_s_getBlockSize, __pyx_k_getBlockSize, sizeof(__pyx_k_getBlockSize), 0, 0, 1, 1}, {&__pyx_n_s_getBlockSizes, __pyx_k_getBlockSizes, sizeof(__pyx_k_getBlockSizes), 0, 0, 1, 1}, {&__pyx_n_s_getBoundaryType, __pyx_k_getBoundaryType, sizeof(__pyx_k_getBoundaryType), 0, 0, 1, 1}, {&__pyx_n_s_getBoundaryTypes, __pyx_k_getBoundaryTypes, sizeof(__pyx_k_getBoundaryTypes), 0, 0, 1, 1}, {&__pyx_n_s_getBuffer, __pyx_k_getBuffer, sizeof(__pyx_k_getBuffer), 0, 0, 1, 1}, {&__pyx_n_s_getCPUTime, __pyx_k_getCPUTime, sizeof(__pyx_k_getCPUTime), 0, 0, 1, 1}, {&__pyx_n_s_getClassId, __pyx_k_getClassId, sizeof(__pyx_k_getClassId), 0, 0, 1, 1}, {&__pyx_n_s_getClassName, __pyx_k_getClassName, sizeof(__pyx_k_getClassName), 0, 0, 1, 1}, {&__pyx_n_s_getComm, __pyx_k_getComm, sizeof(__pyx_k_getComm), 0, 0, 1, 1}, {&__pyx_n_s_getConstraintTolerances, __pyx_k_getConstraintTolerances, sizeof(__pyx_k_getConstraintTolerances), 0, 0, 1, 1}, {&__pyx_n_s_getConvergedReason, __pyx_k_getConvergedReason, sizeof(__pyx_k_getConvergedReason), 0, 0, 1, 1}, {&__pyx_n_s_getConvergenceHistory, __pyx_k_getConvergenceHistory, sizeof(__pyx_k_getConvergenceHistory), 0, 0, 1, 1}, {&__pyx_n_s_getCorners, __pyx_k_getCorners, sizeof(__pyx_k_getCorners), 0, 0, 1, 1}, {&__pyx_n_s_getCurrent, __pyx_k_getCurrent, sizeof(__pyx_k_getCurrent), 0, 0, 1, 1}, {&__pyx_n_s_getDM, __pyx_k_getDM, sizeof(__pyx_k_getDM), 0, 0, 1, 1}, {&__pyx_n_s_getDS, __pyx_k_getDS, sizeof(__pyx_k_getDS), 0, 0, 1, 1}, {&__pyx_n_s_getDefaultComm, __pyx_k_getDefaultComm, sizeof(__pyx_k_getDefaultComm), 0, 0, 1, 1}, {&__pyx_n_s_getDefaultGlobalSection, __pyx_k_getDefaultGlobalSection, sizeof(__pyx_k_getDefaultGlobalSection), 0, 0, 1, 1}, {&__pyx_n_s_getDefaultLocalSection, __pyx_k_getDefaultLocalSection, sizeof(__pyx_k_getDefaultLocalSection), 0, 0, 1, 1}, {&__pyx_n_s_getDefaultSF, __pyx_k_getDefaultSF, sizeof(__pyx_k_getDefaultSF), 0, 0, 1, 1}, {&__pyx_n_s_getDefaultSection, __pyx_k_getDefaultSection, sizeof(__pyx_k_getDefaultSection), 0, 0, 1, 1}, {&__pyx_n_s_getDevice, __pyx_k_getDevice, sizeof(__pyx_k_getDevice), 0, 0, 1, 1}, {&__pyx_n_s_getDeviceId, __pyx_k_getDeviceId, sizeof(__pyx_k_getDeviceId), 0, 0, 1, 1}, {&__pyx_n_s_getDeviceType, __pyx_k_getDeviceType, sizeof(__pyx_k_getDeviceType), 0, 0, 1, 1}, {&__pyx_n_s_getDiagonal, __pyx_k_getDiagonal, sizeof(__pyx_k_getDiagonal), 0, 0, 1, 1}, {&__pyx_n_s_getDiagonalBlock, __pyx_k_getDiagonalBlock, sizeof(__pyx_k_getDiagonalBlock), 0, 0, 1, 1}, {&__pyx_n_s_getDim, __pyx_k_getDim, sizeof(__pyx_k_getDim), 0, 0, 1, 1}, {&__pyx_n_s_getDimension, __pyx_k_getDimension, sizeof(__pyx_k_getDimension), 0, 0, 1, 1}, {&__pyx_n_s_getDof, __pyx_k_getDof, sizeof(__pyx_k_getDof), 0, 0, 1, 1}, {&__pyx_n_s_getEntriesPerElement, __pyx_k_getEntriesPerElement, sizeof(__pyx_k_getEntriesPerElement), 0, 0, 1, 1}, {&__pyx_n_s_getEquationType, __pyx_k_getEquationType, sizeof(__pyx_k_getEquationType), 0, 0, 1, 1}, {&__pyx_n_s_getFlops, __pyx_k_getFlops, sizeof(__pyx_k_getFlops), 0, 0, 1, 1}, {&__pyx_n_s_getFunctionNorm, __pyx_k_getFunctionNorm, sizeof(__pyx_k_getFunctionNorm), 0, 0, 1, 1}, {&__pyx_n_s_getFunctionTolerances, __pyx_k_getFunctionTolerances, sizeof(__pyx_k_getFunctionTolerances), 0, 0, 1, 1}, {&__pyx_n_s_getFunctionValue, __pyx_k_getFunctionValue, sizeof(__pyx_k_getFunctionValue), 0, 0, 1, 1}, {&__pyx_n_s_getGhostCorners, __pyx_k_getGhostCorners, sizeof(__pyx_k_getGhostCorners), 0, 0, 1, 1}, {&__pyx_n_s_getGhostRanges, __pyx_k_getGhostRanges, sizeof(__pyx_k_getGhostRanges), 0, 0, 1, 1}, {&__pyx_n_s_getGlobalSection, __pyx_k_getGlobalSection, sizeof(__pyx_k_getGlobalSection), 0, 0, 1, 1}, {&__pyx_n_s_getGlobalSizes, __pyx_k_getGlobalSizes, sizeof(__pyx_k_getGlobalSizes), 0, 0, 1, 1}, {&__pyx_n_s_getGradient, __pyx_k_getGradient, sizeof(__pyx_k_getGradient), 0, 0, 1, 1}, {&__pyx_n_s_getGradientTolerances, __pyx_k_getGradientTolerances, sizeof(__pyx_k_getGradientTolerances), 0, 0, 1, 1}, {&__pyx_n_s_getIndices, __pyx_k_getIndices, sizeof(__pyx_k_getIndices), 0, 0, 1, 1}, {&__pyx_n_s_getInfo, __pyx_k_getInfo, sizeof(__pyx_k_getInfo), 0, 0, 1, 1}, {&__pyx_n_s_getInitialGuessKnoll, __pyx_k_getInitialGuessKnoll, sizeof(__pyx_k_getInitialGuessKnoll), 0, 0, 1, 1}, {&__pyx_n_s_getInitialGuessNonzero, __pyx_k_getInitialGuessNonzero, sizeof(__pyx_k_getInitialGuessNonzero), 0, 0, 1, 1}, {&__pyx_n_s_getInterval, __pyx_k_getInterval, sizeof(__pyx_k_getInterval), 0, 0, 1, 1}, {&__pyx_n_s_getIterationNumber, __pyx_k_getIterationNumber, sizeof(__pyx_k_getIterationNumber), 0, 0, 1, 1}, {&__pyx_n_s_getKSP, __pyx_k_getKSP, sizeof(__pyx_k_getKSP), 0, 0, 1, 1}, {&__pyx_n_s_getKSPFailures, __pyx_k_getKSPFailures, sizeof(__pyx_k_getKSPFailures), 0, 0, 1, 1}, {&__pyx_n_s_getLinearSolveFailures, __pyx_k_getLinearSolveFailures, sizeof(__pyx_k_getLinearSolveFailures), 0, 0, 1, 1}, {&__pyx_n_s_getLocalSection, __pyx_k_getLocalSection, sizeof(__pyx_k_getLocalSection), 0, 0, 1, 1}, {&__pyx_n_s_getLocalSize, __pyx_k_getLocalSize, sizeof(__pyx_k_getLocalSize), 0, 0, 1, 1}, {&__pyx_n_s_getLocalSizes, __pyx_k_getLocalSizes, sizeof(__pyx_k_getLocalSizes), 0, 0, 1, 1}, {&__pyx_n_s_getMatrix, __pyx_k_getMatrix, sizeof(__pyx_k_getMatrix), 0, 0, 1, 1}, {&__pyx_n_s_getMaxFunctionEvaluations, __pyx_k_getMaxFunctionEvaluations, sizeof(__pyx_k_getMaxFunctionEvaluations), 0, 0, 1, 1}, {&__pyx_n_s_getMaxKSPFailures, __pyx_k_getMaxKSPFailures, sizeof(__pyx_k_getMaxKSPFailures), 0, 0, 1, 1}, {&__pyx_n_s_getMaxLinearSolveFailures, __pyx_k_getMaxLinearSolveFailures, sizeof(__pyx_k_getMaxLinearSolveFailures), 0, 0, 1, 1}, {&__pyx_n_s_getMaxNonlinearStepFailures, __pyx_k_getMaxNonlinearStepFailures, sizeof(__pyx_k_getMaxNonlinearStepFailures), 0, 0, 1, 1}, {&__pyx_n_s_getMaxStepFailures, __pyx_k_getMaxStepFailures, sizeof(__pyx_k_getMaxStepFailures), 0, 0, 1, 1}, {&__pyx_n_s_getMaxSteps, __pyx_k_getMaxSteps, sizeof(__pyx_k_getMaxSteps), 0, 0, 1, 1}, {&__pyx_n_s_getMaxTime, __pyx_k_getMaxTime, sizeof(__pyx_k_getMaxTime), 0, 0, 1, 1}, {&__pyx_n_s_getNPC, __pyx_k_getNPC, sizeof(__pyx_k_getNPC), 0, 0, 1, 1}, {&__pyx_n_s_getName, __pyx_k_getName, sizeof(__pyx_k_getName), 0, 0, 1, 1}, {&__pyx_n_s_getNonlinearStepFailures, __pyx_k_getNonlinearStepFailures, sizeof(__pyx_k_getNonlinearStepFailures), 0, 0, 1, 1}, {&__pyx_n_s_getNormType, __pyx_k_getNormType, sizeof(__pyx_k_getNormType), 0, 0, 1, 1}, {&__pyx_n_s_getNumber, __pyx_k_getNumber, sizeof(__pyx_k_getNumber), 0, 0, 1, 1}, {&__pyx_n_s_getNumberDM, __pyx_k_getNumberDM, sizeof(__pyx_k_getNumberDM), 0, 0, 1, 1}, {&__pyx_n_s_getObjectiveValue, __pyx_k_getObjectiveValue, sizeof(__pyx_k_getObjectiveValue), 0, 0, 1, 1}, {&__pyx_n_s_getOperators, __pyx_k_getOperators, sizeof(__pyx_k_getOperators), 0, 0, 1, 1}, {&__pyx_n_s_getOptionsPrefix, __pyx_k_getOptionsPrefix, sizeof(__pyx_k_getOptionsPrefix), 0, 0, 1, 1}, {&__pyx_n_s_getOwnershipRange, __pyx_k_getOwnershipRange, sizeof(__pyx_k_getOwnershipRange), 0, 0, 1, 1}, {&__pyx_n_s_getOwnershipRanges, __pyx_k_getOwnershipRanges, sizeof(__pyx_k_getOwnershipRanges), 0, 0, 1, 1}, {&__pyx_n_s_getPC, __pyx_k_getPC, sizeof(__pyx_k_getPC), 0, 0, 1, 1}, {&__pyx_n_s_getPCSide, __pyx_k_getPCSide, sizeof(__pyx_k_getPCSide), 0, 0, 1, 1}, {&__pyx_n_s_getProblemType, __pyx_k_getProblemType, sizeof(__pyx_k_getProblemType), 0, 0, 1, 1}, {&__pyx_n_s_getProcSizes, __pyx_k_getProcSizes, sizeof(__pyx_k_getProcSizes), 0, 0, 1, 1}, {&__pyx_n_s_getRanges, __pyx_k_getRanges, sizeof(__pyx_k_getRanges), 0, 0, 1, 1}, {&__pyx_n_s_getRank, __pyx_k_getRank, sizeof(__pyx_k_getRank), 0, 0, 1, 1}, {&__pyx_n_s_getRefCount, __pyx_k_getRefCount, sizeof(__pyx_k_getRefCount), 0, 0, 1, 1}, {&__pyx_n_s_getResidualNorm, __pyx_k_getResidualNorm, sizeof(__pyx_k_getResidualNorm), 0, 0, 1, 1}, {&__pyx_n_s_getRhs, __pyx_k_getRhs, sizeof(__pyx_k_getRhs), 0, 0, 1, 1}, {&__pyx_n_s_getSNES, __pyx_k_getSNES, sizeof(__pyx_k_getSNES), 0, 0, 1, 1}, {&__pyx_n_s_getSection, __pyx_k_getSection, sizeof(__pyx_k_getSection), 0, 0, 1, 1}, {&__pyx_n_s_getSectionSF, __pyx_k_getSectionSF, sizeof(__pyx_k_getSectionSF), 0, 0, 1, 1}, {&__pyx_n_s_getSeed, __pyx_k_getSeed, sizeof(__pyx_k_getSeed), 0, 0, 1, 1}, {&__pyx_n_s_getSize, __pyx_k_getSize, sizeof(__pyx_k_getSize), 0, 0, 1, 1}, {&__pyx_n_s_getSizes, __pyx_k_getSizes, sizeof(__pyx_k_getSizes), 0, 0, 1, 1}, {&__pyx_n_s_getSolution, __pyx_k_getSolution, sizeof(__pyx_k_getSolution), 0, 0, 1, 1}, {&__pyx_n_s_getSolutionNorm, __pyx_k_getSolutionNorm, sizeof(__pyx_k_getSolutionNorm), 0, 0, 1, 1}, {&__pyx_n_s_getSolutionUpdate, __pyx_k_getSolutionUpdate, sizeof(__pyx_k_getSolutionUpdate), 0, 0, 1, 1}, {&__pyx_n_s_getStencil, __pyx_k_getStencil, sizeof(__pyx_k_getStencil), 0, 0, 1, 1}, {&__pyx_n_s_getStencilType, __pyx_k_getStencilType, sizeof(__pyx_k_getStencilType), 0, 0, 1, 1}, {&__pyx_n_s_getStencilWidth, __pyx_k_getStencilWidth, sizeof(__pyx_k_getStencilWidth), 0, 0, 1, 1}, {&__pyx_n_s_getStepFailures, __pyx_k_getStepFailures, sizeof(__pyx_k_getStepFailures), 0, 0, 1, 1}, {&__pyx_n_s_getStepNumber, __pyx_k_getStepNumber, sizeof(__pyx_k_getStepNumber), 0, 0, 1, 1}, {&__pyx_n_s_getStreamType, __pyx_k_getStreamType, sizeof(__pyx_k_getStreamType), 0, 0, 1, 1}, {&__pyx_n_s_getString, __pyx_k_getString, sizeof(__pyx_k_getString), 0, 0, 1, 1}, {&__pyx_n_s_getTime, __pyx_k_getTime, sizeof(__pyx_k_getTime), 0, 0, 1, 1}, {&__pyx_n_s_getTimeStep, __pyx_k_getTimeStep, sizeof(__pyx_k_getTimeStep), 0, 0, 1, 1}, {&__pyx_n_s_getTolerances, __pyx_k_getTolerances, sizeof(__pyx_k_getTolerances), 0, 0, 1, 1}, {&__pyx_n_s_getType, __pyx_k_getType, sizeof(__pyx_k_getType), 0, 0, 1, 1}, {&__pyx_n_s_getUseEW, __pyx_k_getUseEW, sizeof(__pyx_k_getUseEW), 0, 0, 1, 1}, {&__pyx_n_s_getUseFD, __pyx_k_getUseFD, sizeof(__pyx_k_getUseFD), 0, 0, 1, 1}, {&__pyx_n_s_getUseMF, __pyx_k_getUseMF, sizeof(__pyx_k_getUseMF), 0, 0, 1, 1}, {&__pyx_n_s_getValue, __pyx_k_getValue, sizeof(__pyx_k_getValue), 0, 0, 1, 1}, {&__pyx_kp_s_getVecArray_for_DMStag_not_yet_i, __pyx_k_getVecArray_for_DMStag_not_yet_i, sizeof(__pyx_k_getVecArray_for_DMStag_not_yet_i), 0, 0, 1, 0}, {&__pyx_n_s_getVecLeft, __pyx_k_getVecLeft, sizeof(__pyx_k_getVecLeft), 0, 0, 1, 1}, {&__pyx_n_s_getVecRight, __pyx_k_getVecRight, sizeof(__pyx_k_getVecRight), 0, 0, 1, 1}, {&__pyx_n_s_getVecs, __pyx_k_getVecs, sizeof(__pyx_k_getVecs), 0, 0, 1, 1}, {&__pyx_n_s_getVersion, __pyx_k_getVersion, sizeof(__pyx_k_getVersion), 0, 0, 1, 1}, {&__pyx_n_s_getVersionInfo, __pyx_k_getVersionInfo, sizeof(__pyx_k_getVersionInfo), 0, 0, 1, 1}, {&__pyx_n_s_getVisible, __pyx_k_getVisible, sizeof(__pyx_k_getVisible), 0, 0, 1, 1}, {&__pyx_n_s_get_2, __pyx_k_get_2, sizeof(__pyx_k_get_2), 0, 0, 1, 1}, {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1}, {&__pyx_n_s_ghostBcNodes, __pyx_k_ghostBcNodes, sizeof(__pyx_k_ghostBcNodes), 0, 0, 1, 1}, {&__pyx_n_s_ghosted, __pyx_k_ghosted, sizeof(__pyx_k_ghosted), 0, 0, 1, 1}, {&__pyx_n_s_ghosts, __pyx_k_ghosts, sizeof(__pyx_k_ghosts), 0, 0, 1, 1}, {&__pyx_kp_s_ghosts_size_d_array_size_d_and_v, __pyx_k_ghosts_size_d_array_size_d_and_v, sizeof(__pyx_k_ghosts_size_d_array_size_d_and_v), 0, 0, 1, 0}, {&__pyx_n_s_globalBcNodes, __pyx_k_globalBcNodes, sizeof(__pyx_k_globalBcNodes), 0, 0, 1, 1}, {&__pyx_kp_s_global_size_d_not_divisible_by_b, __pyx_k_global_size_d_not_divisible_by_b, sizeof(__pyx_k_global_size_d_not_divisible_by_b), 0, 0, 1, 0}, {&__pyx_n_s_globalsec, __pyx_k_globalsec, sizeof(__pyx_k_globalsec), 0, 0, 1, 1}, {&__pyx_n_s_gord, __pyx_k_gord, sizeof(__pyx_k_gord), 0, 0, 1, 1}, {&__pyx_kp_u_got, __pyx_k_got, sizeof(__pyx_k_got), 0, 1, 0, 0}, {&__pyx_kp_u_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi, sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 1, 0, 0}, {&__pyx_n_s_gradient, __pyx_k_gradient, sizeof(__pyx_k_gradient), 0, 0, 1, 1}, {&__pyx_n_s_group, __pyx_k_group, sizeof(__pyx_k_group), 0, 0, 1, 1}, {&__pyx_n_s_grtol, __pyx_k_grtol, sizeof(__pyx_k_grtol), 0, 0, 1, 1}, {&__pyx_n_s_gsec, __pyx_k_gsec, sizeof(__pyx_k_gsec), 0, 0, 1, 1}, {&__pyx_n_s_gtol, __pyx_k_gtol, sizeof(__pyx_k_gtol), 0, 0, 1, 1}, {&__pyx_n_s_gttol, __pyx_k_gttol, sizeof(__pyx_k_gttol), 0, 0, 1, 1}, {&__pyx_n_s_gv, __pyx_k_gv, sizeof(__pyx_k_gv), 0, 0, 1, 1}, {&__pyx_n_s_gvec, __pyx_k_gvec, sizeof(__pyx_k_gvec), 0, 0, 1, 1}, {&__pyx_n_s_h_max, __pyx_k_h_max, sizeof(__pyx_k_h_max), 0, 0, 1, 1}, {&__pyx_n_s_h_min, __pyx_k_h_min, sizeof(__pyx_k_h_min), 0, 0, 1, 1}, {&__pyx_n_s_handle, __pyx_k_handle, sizeof(__pyx_k_handle), 0, 0, 1, 1}, {&__pyx_n_s_has, __pyx_k_has, sizeof(__pyx_k_has), 0, 0, 1, 1}, {&__pyx_n_s_hasExternalPackage, __pyx_k_hasExternalPackage, sizeof(__pyx_k_hasExternalPackage), 0, 0, 1, 1}, {&__pyx_n_s_hasLabel, __pyx_k_hasLabel, sizeof(__pyx_k_hasLabel), 0, 0, 1, 1}, {&__pyx_n_s_hasLagrange, __pyx_k_hasLagrange, sizeof(__pyx_k_hasLagrange), 0, 0, 1, 1}, {&__pyx_n_s_hasName, __pyx_k_hasName, sizeof(__pyx_k_hasName), 0, 0, 1, 1}, {&__pyx_n_s_hausd, __pyx_k_hausd, sizeof(__pyx_k_hausd), 0, 0, 1, 1}, {&__pyx_n_s_hessian, __pyx_k_hessian, sizeof(__pyx_k_hessian), 0, 0, 1, 1}, {&__pyx_n_s_hiphandle, __pyx_k_hiphandle, sizeof(__pyx_k_hiphandle), 0, 0, 1, 1}, {&__pyx_n_s_hmax, __pyx_k_hmax, sizeof(__pyx_k_hmax), 0, 0, 1, 1}, {&__pyx_n_s_hmin, __pyx_k_hmin, sizeof(__pyx_k_hmin), 0, 0, 1, 1}, {&__pyx_n_s_hpddm_type, __pyx_k_hpddm_type, sizeof(__pyx_k_hpddm_type), 0, 0, 1, 1}, {&__pyx_n_s_hypretype, __pyx_k_hypretype, sizeof(__pyx_k_hypretype), 0, 0, 1, 1}, {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, {&__pyx_n_s_icntl, __pyx_k_icntl, sizeof(__pyx_k_icntl), 0, 0, 1, 1}, {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1}, {&__pyx_n_s_idx, __pyx_k_idx, sizeof(__pyx_k_idx), 0, 0, 1, 1}, {&__pyx_n_s_idxm, __pyx_k_idxm, sizeof(__pyx_k_idxm), 0, 0, 1, 1}, {&__pyx_n_s_ierr, __pyx_k_ierr, sizeof(__pyx_k_ierr), 0, 0, 1, 1}, {&__pyx_n_s_ignore, __pyx_k_ignore, sizeof(__pyx_k_ignore), 0, 0, 1, 1}, {&__pyx_n_s_ignoreOutsideDomain, __pyx_k_ignoreOutsideDomain, sizeof(__pyx_k_ignoreOutsideDomain), 0, 0, 1, 1}, {&__pyx_n_s_imag, __pyx_k_imag, sizeof(__pyx_k_imag), 0, 0, 1, 1}, {&__pyx_n_s_imagPart, __pyx_k_imagPart, sizeof(__pyx_k_imagPart), 0, 0, 1, 1}, {&__pyx_n_s_imex, __pyx_k_imex, sizeof(__pyx_k_imex), 0, 0, 1, 1}, {&__pyx_n_s_imode, __pyx_k_imode, sizeof(__pyx_k_imode), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_inblocks, __pyx_k_inblocks, sizeof(__pyx_k_inblocks), 0, 0, 1, 1}, {&__pyx_kp_s_incompatible_array_sizes, __pyx_k_incompatible_array_sizes, sizeof(__pyx_k_incompatible_array_sizes), 0, 0, 1, 0}, {&__pyx_kp_s_incompatible_array_sizes_ni_d_nj, __pyx_k_incompatible_array_sizes_ni_d_nj, sizeof(__pyx_k_incompatible_array_sizes_ni_d_nj), 0, 0, 1, 0}, {&__pyx_kp_s_incompatible_array_sizes_ni_d_nv, __pyx_k_incompatible_array_sizes_ni_d_nv, sizeof(__pyx_k_incompatible_array_sizes_ni_d_nv), 0, 0, 1, 0}, {&__pyx_kp_s_incompatible_array_sizes_ni_d_nv_2, __pyx_k_incompatible_array_sizes_ni_d_nv_2, sizeof(__pyx_k_incompatible_array_sizes_ni_d_nv_2), 0, 0, 1, 0}, {&__pyx_kp_s_incompatible_array_sizes_nv_d, __pyx_k_incompatible_array_sizes_nv_d, sizeof(__pyx_k_incompatible_array_sizes_nv_d), 0, 0, 1, 0}, {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1}, {&__pyx_n_s_indicator, __pyx_k_indicator, sizeof(__pyx_k_indicator), 0, 0, 1, 1}, {&__pyx_n_s_indices, __pyx_k_indices, sizeof(__pyx_k_indices), 0, 0, 1, 1}, {&__pyx_n_s_info, __pyx_k_info, sizeof(__pyx_k_info), 0, 0, 1, 1}, {&__pyx_n_s_infoAllow, __pyx_k_infoAllow, sizeof(__pyx_k_infoAllow), 0, 0, 1, 1}, {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, {&__pyx_n_s_init_subclass, __pyx_k_init_subclass, sizeof(__pyx_k_init_subclass), 0, 0, 1, 1}, {&__pyx_n_s_initialguess, __pyx_k_initialguess, sizeof(__pyx_k_initialguess), 0, 0, 1, 1}, {&__pyx_n_s_initialize, __pyx_k_initialize, sizeof(__pyx_k_initialize), 0, 0, 1, 1}, {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, {&__pyx_kp_s_input_arrays_have_incompatible_s, __pyx_k_input_arrays_have_incompatible_s, sizeof(__pyx_k_input_arrays_have_incompatible_s), 0, 0, 1, 0}, {&__pyx_n_s_int, __pyx_k_int, sizeof(__pyx_k_int), 0, 0, 1, 1}, {&__pyx_n_s_interior, __pyx_k_interior, sizeof(__pyx_k_interior), 0, 0, 1, 1}, {&__pyx_n_s_interp_type, __pyx_k_interp_type, sizeof(__pyx_k_interp_type), 0, 0, 1, 1}, {&__pyx_n_s_interpolate, __pyx_k_interpolate, sizeof(__pyx_k_interpolate), 0, 0, 1, 1}, {&__pyx_n_s_interval, __pyx_k_interval, sizeof(__pyx_k_interval), 0, 0, 1, 1}, {&__pyx_n_s_invert, __pyx_k_invert, sizeof(__pyx_k_invert), 0, 0, 1, 1}, {&__pyx_n_s_is, __pyx_k_is, sizeof(__pyx_k_is), 0, 0, 1, 1}, {&__pyx_n_s_isActive, __pyx_k_isActive, sizeof(__pyx_k_isActive), 0, 0, 1, 1}, {&__pyx_n_s_isAssembled, __pyx_k_isAssembled, sizeof(__pyx_k_isAssembled), 0, 0, 1, 1}, {&__pyx_n_s_isFinalized, __pyx_k_isFinalized, sizeof(__pyx_k_isFinalized), 0, 0, 1, 1}, {&__pyx_n_s_isHermitian, __pyx_k_isHermitian, sizeof(__pyx_k_isHermitian), 0, 0, 1, 1}, {&__pyx_n_s_isIdentity, __pyx_k_isIdentity, sizeof(__pyx_k_isIdentity), 0, 0, 1, 1}, {&__pyx_n_s_isInitialized, __pyx_k_isInitialized, sizeof(__pyx_k_isInitialized), 0, 0, 1, 1}, {&__pyx_n_s_isPermutation, __pyx_k_isPermutation, sizeof(__pyx_k_isPermutation), 0, 0, 1, 1}, {&__pyx_n_s_isSimplex, __pyx_k_isSimplex, sizeof(__pyx_k_isSimplex), 0, 0, 1, 1}, {&__pyx_n_s_isSorted, __pyx_k_isSorted, sizeof(__pyx_k_isSorted), 0, 0, 1, 1}, {&__pyx_n_s_isStructurallySymmetric, __pyx_k_isStructurallySymmetric, sizeof(__pyx_k_isStructurallySymmetric), 0, 0, 1, 1}, {&__pyx_n_s_isSymmetric, __pyx_k_isSymmetric, sizeof(__pyx_k_isSymmetric), 0, 0, 1, 1}, {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, {&__pyx_n_s_is_from, __pyx_k_is_from, sizeof(__pyx_k_is_from), 0, 0, 1, 1}, {&__pyx_n_s_is_local, __pyx_k_is_local, sizeof(__pyx_k_is_local), 0, 0, 1, 1}, {&__pyx_n_s_is_to, __pyx_k_is_to, sizeof(__pyx_k_is_to), 0, 0, 1, 1}, {&__pyx_n_s_is_type, __pyx_k_is_type, sizeof(__pyx_k_is_type), 0, 0, 1, 1}, {&__pyx_n_s_iscol, __pyx_k_iscol, sizeof(__pyx_k_iscol), 0, 0, 1, 1}, {&__pyx_n_s_iscols, __pyx_k_iscols, sizeof(__pyx_k_iscols), 0, 0, 1, 1}, {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0}, {&__pyx_n_s_iset, __pyx_k_iset, sizeof(__pyx_k_iset), 0, 0, 1, 1}, {&__pyx_n_s_isets, __pyx_k_isets, sizeof(__pyx_k_isets), 0, 0, 1, 1}, {&__pyx_n_s_isfields, __pyx_k_isfields, sizeof(__pyx_k_isfields), 0, 0, 1, 1}, {&__pyx_n_s_isotropic, __pyx_k_isotropic, sizeof(__pyx_k_isotropic), 0, 0, 1, 1}, {&__pyx_n_s_isperm, __pyx_k_isperm, sizeof(__pyx_k_isperm), 0, 0, 1, 1}, {&__pyx_n_s_isrow, __pyx_k_isrow, sizeof(__pyx_k_isrow), 0, 0, 1, 1}, {&__pyx_n_s_isrows, __pyx_k_isrows, sizeof(__pyx_k_isrows), 0, 0, 1, 1}, {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1}, {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array, sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0}, {&__pyx_n_s_its, __pyx_k_its, sizeof(__pyx_k_its), 0, 0, 1, 1}, {&__pyx_n_s_ival, __pyx_k_ival, sizeof(__pyx_k_ival), 0, 0, 1, 1}, {&__pyx_n_s_j, __pyx_k_j, sizeof(__pyx_k_j), 0, 0, 1, 1}, {&__pyx_n_s_jacobian, __pyx_k_jacobian, sizeof(__pyx_k_jacobian), 0, 0, 1, 1}, {&__pyx_n_s_jacobian_design, __pyx_k_jacobian_design, sizeof(__pyx_k_jacobian_design), 0, 0, 1, 1}, {&__pyx_n_s_jacobian_equality, __pyx_k_jacobian_equality, sizeof(__pyx_k_jacobian_equality), 0, 0, 1, 1}, {&__pyx_n_s_jacobian_state, __pyx_k_jacobian_state, sizeof(__pyx_k_jacobian_state), 0, 0, 1, 1}, {&__pyx_n_s_jacobianp, __pyx_k_jacobianp, sizeof(__pyx_k_jacobianp), 0, 0, 1, 1}, {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1}, {&__pyx_n_s_join_mode, __pyx_k_join_mode, sizeof(__pyx_k_join_mode), 0, 0, 1, 1}, {&__pyx_n_s_k, __pyx_k_k, sizeof(__pyx_k_k), 0, 0, 1, 1}, {&__pyx_n_s_kargs, __pyx_k_kargs, sizeof(__pyx_k_kargs), 0, 0, 1, 1}, {&__pyx_kp_s_key_d_cannot_register_s_already, __pyx_k_key_d_cannot_register_s_already, sizeof(__pyx_k_key_d_cannot_register_s_already), 0, 0, 1, 0}, {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1}, {&__pyx_n_s_kind, __pyx_k_kind, sizeof(__pyx_k_kind), 0, 0, 1, 1}, {&__pyx_n_s_klass, __pyx_k_klass, sizeof(__pyx_k_klass), 0, 0, 1, 1}, {&__pyx_n_s_ksp, __pyx_k_ksp, sizeof(__pyx_k_ksp), 0, 0, 1, 1}, {&__pyx_n_s_ksp_type, __pyx_k_ksp_type, sizeof(__pyx_k_ksp_type), 0, 0, 1, 1}, {&__pyx_n_s_kwargs, __pyx_k_kwargs, sizeof(__pyx_k_kwargs), 0, 0, 1, 1}, {&__pyx_n_s_l, __pyx_k_l, sizeof(__pyx_k_l), 0, 0, 1, 1}, {&__pyx_n_s_l2l, __pyx_k_l2l, sizeof(__pyx_k_l2l), 0, 0, 1, 1}, {&__pyx_n_s_label, __pyx_k_label, sizeof(__pyx_k_label), 0, 0, 1, 1}, {&__pyx_n_s_labelName, __pyx_k_labelName, sizeof(__pyx_k_labelName), 0, 0, 1, 1}, {&__pyx_n_s_lambda, __pyx_k_lambda, sizeof(__pyx_k_lambda), 0, 0, 1, 1}, {&__pyx_n_s_lanes, __pyx_k_lanes, sizeof(__pyx_k_lanes), 0, 0, 1, 1}, {&__pyx_n_s_layoutType, __pyx_k_layoutType, sizeof(__pyx_k_layoutType), 0, 0, 1, 1}, {&__pyx_n_s_lda, __pyx_k_lda, sizeof(__pyx_k_lda), 0, 0, 1, 1}, {&__pyx_n_s_leafSection, __pyx_k_leafSection, sizeof(__pyx_k_leafSection), 0, 0, 1, 1}, {&__pyx_n_s_leafdata, __pyx_k_leafdata, sizeof(__pyx_k_leafdata), 0, 0, 1, 1}, {&__pyx_n_s_leafsize, __pyx_k_leafsize, sizeof(__pyx_k_leafsize), 0, 0, 1, 1}, {&__pyx_n_s_leafupdate, __pyx_k_leafupdate, sizeof(__pyx_k_leafupdate), 0, 0, 1, 1}, {&__pyx_n_s_left, __pyx_k_left, sizeof(__pyx_k_left), 0, 0, 1, 1}, {&__pyx_n_s_length, __pyx_k_length, sizeof(__pyx_k_length), 0, 0, 1, 1}, {&__pyx_n_s_level, __pyx_k_level, sizeof(__pyx_k_level), 0, 0, 1, 1}, {&__pyx_n_s_levels, __pyx_k_levels, sizeof(__pyx_k_levels), 0, 0, 1, 1}, {&__pyx_n_s_lgmap, __pyx_k_lgmap, sizeof(__pyx_k_lgmap), 0, 0, 1, 1}, {&__pyx_n_s_lgmap_type, __pyx_k_lgmap_type, sizeof(__pyx_k_lgmap_type), 0, 0, 1, 1}, {&__pyx_n_s_lgmapc, __pyx_k_lgmapc, sizeof(__pyx_k_lgmapc), 0, 0, 1, 1}, {&__pyx_n_s_lgmapr, __pyx_k_lgmapr, sizeof(__pyx_k_lgmapr), 0, 0, 1, 1}, {&__pyx_n_s_linear_its, __pyx_k_linear_its, sizeof(__pyx_k_linear_its), 0, 0, 1, 1}, {&__pyx_n_s_lits, __pyx_k_lits, sizeof(__pyx_k_lits), 0, 0, 1, 1}, {&__pyx_n_s_loc, __pyx_k_loc, sizeof(__pyx_k_loc), 0, 0, 1, 1}, {&__pyx_n_s_locC, __pyx_k_locC, sizeof(__pyx_k_locC), 0, 0, 1, 1}, {&__pyx_n_s_locX, __pyx_k_locX, sizeof(__pyx_k_locX), 0, 0, 1, 1}, {&__pyx_n_s_local, __pyx_k_local, sizeof(__pyx_k_local), 0, 0, 1, 1}, {&__pyx_kp_s_local_and_global_sizes_cannot_be, __pyx_k_local_and_global_sizes_cannot_be, sizeof(__pyx_k_local_and_global_sizes_cannot_be), 0, 0, 1, 0}, {&__pyx_kp_s_local_size_d_not_divisible_by_bl, __pyx_k_local_size_d_not_divisible_by_bl, sizeof(__pyx_k_local_size_d_not_divisible_by_bl), 0, 0, 1, 0}, {&__pyx_n_s_localsec, __pyx_k_localsec, sizeof(__pyx_k_localsec), 0, 0, 1, 1}, {&__pyx_n_s_locs, __pyx_k_locs, sizeof(__pyx_k_locs), 0, 0, 1, 1}, {&__pyx_n_s_logFlops, __pyx_k_logFlops, sizeof(__pyx_k_logFlops), 0, 0, 1, 1}, {&__pyx_n_s_lower, __pyx_k_lower, sizeof(__pyx_k_lower), 0, 0, 1, 1}, {&__pyx_n_s_ls_type, __pyx_k_ls_type, sizeof(__pyx_k_ls_type), 0, 0, 1, 1}, {&__pyx_n_s_ltog, __pyx_k_ltog, sizeof(__pyx_k_ltog), 0, 0, 1, 1}, {&__pyx_n_s_ltol, __pyx_k_ltol, sizeof(__pyx_k_ltol), 0, 0, 1, 1}, {&__pyx_n_s_lv, __pyx_k_lv, sizeof(__pyx_k_lv), 0, 0, 1, 1}, {&__pyx_n_s_lvec, __pyx_k_lvec, sizeof(__pyx_k_lvec), 0, 0, 1, 1}, {&__pyx_n_s_lvecs, __pyx_k_lvecs, sizeof(__pyx_k_lvecs), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_major, __pyx_k_major, sizeof(__pyx_k_major), 0, 0, 1, 1}, {&__pyx_n_s_mallocs, __pyx_k_mallocs, sizeof(__pyx_k_mallocs), 0, 0, 1, 1}, {&__pyx_n_s_mat, __pyx_k_mat, sizeof(__pyx_k_mat), 0, 0, 1, 1}, {&__pyx_n_s_matApply, __pyx_k_matApply, sizeof(__pyx_k_matApply), 0, 0, 1, 1}, {&__pyx_n_s_matMult, __pyx_k_matMult, sizeof(__pyx_k_matMult), 0, 0, 1, 1}, {&__pyx_n_s_mat_type, __pyx_k_mat_type, sizeof(__pyx_k_mat_type), 0, 0, 1, 1}, {&__pyx_n_s_matpartitioning_type, __pyx_k_matpartitioning_type, sizeof(__pyx_k_matpartitioning_type), 0, 0, 1, 1}, {&__pyx_n_s_mats, __pyx_k_mats, sizeof(__pyx_k_mats), 0, 0, 1, 1}, {&__pyx_n_s_max, __pyx_k_max, sizeof(__pyx_k_max), 0, 0, 1, 1}, {&__pyx_n_s_maxDegree, __pyx_k_maxDegree, sizeof(__pyx_k_maxDegree), 0, 0, 1, 1}, {&__pyx_n_s_max_fails, __pyx_k_max_fails, sizeof(__pyx_k_max_fails), 0, 0, 1, 1}, {&__pyx_n_s_max_funcs, __pyx_k_max_funcs, sizeof(__pyx_k_max_funcs), 0, 0, 1, 1}, {&__pyx_n_s_max_it, __pyx_k_max_it, sizeof(__pyx_k_max_it), 0, 0, 1, 1}, {&__pyx_n_s_max_steps, __pyx_k_max_steps, sizeof(__pyx_k_max_steps), 0, 0, 1, 1}, {&__pyx_n_s_max_time, __pyx_k_max_time, sizeof(__pyx_k_max_time), 0, 0, 1, 1}, {&__pyx_n_s_maxrank, __pyx_k_maxrank, sizeof(__pyx_k_maxrank), 0, 0, 1, 1}, {&__pyx_n_s_maxval, __pyx_k_maxval, sizeof(__pyx_k_maxval), 0, 0, 1, 1}, {&__pyx_n_s_memo, __pyx_k_memo, sizeof(__pyx_k_memo), 0, 0, 1, 1}, {&__pyx_n_s_memory, __pyx_k_memory, sizeof(__pyx_k_memory), 0, 0, 1, 1}, {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1}, {&__pyx_n_s_messageLength, __pyx_k_messageLength, sizeof(__pyx_k_messageLength), 0, 0, 1, 1}, {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, {&__pyx_n_s_metric, __pyx_k_metric, sizeof(__pyx_k_metric), 0, 0, 1, 1}, {&__pyx_n_s_metric1, __pyx_k_metric1, sizeof(__pyx_k_metric1), 0, 0, 1, 1}, {&__pyx_n_s_metric2, __pyx_k_metric2, sizeof(__pyx_k_metric2), 0, 0, 1, 1}, {&__pyx_n_s_metric3, __pyx_k_metric3, sizeof(__pyx_k_metric3), 0, 0, 1, 1}, {&__pyx_n_s_metricAvg, __pyx_k_metricAvg, sizeof(__pyx_k_metricAvg), 0, 0, 1, 1}, {&__pyx_n_s_metricInt, __pyx_k_metricInt, sizeof(__pyx_k_metricInt), 0, 0, 1, 1}, {&__pyx_n_s_mgtype, __pyx_k_mgtype, sizeof(__pyx_k_mgtype), 0, 0, 1, 1}, {&__pyx_n_s_min, __pyx_k_min, sizeof(__pyx_k_min), 0, 0, 1, 1}, {&__pyx_n_s_minor, __pyx_k_minor, sizeof(__pyx_k_minor), 0, 0, 1, 1}, {&__pyx_n_s_mirror, __pyx_k_mirror, sizeof(__pyx_k_mirror), 0, 0, 1, 1}, {&__pyx_n_s_missingDiagonal, __pyx_k_missingDiagonal, sizeof(__pyx_k_missingDiagonal), 0, 0, 1, 1}, {&__pyx_n_s_mit, __pyx_k_mit, sizeof(__pyx_k_mit), 0, 0, 1, 1}, {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1}, {&__pyx_n_s_model, __pyx_k_model, sizeof(__pyx_k_model), 0, 0, 1, 1}, {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, {&__pyx_n_s_monitor, __pyx_k_monitor, sizeof(__pyx_k_monitor), 0, 0, 1, 1}, {&__pyx_n_s_monitorCancel, __pyx_k_monitorCancel, sizeof(__pyx_k_monitorCancel), 0, 0, 1, 1}, {&__pyx_n_s_mpi4py, __pyx_k_mpi4py, sizeof(__pyx_k_mpi4py), 0, 0, 1, 1}, {&__pyx_kp_s_mpi4py_MPI, __pyx_k_mpi4py_MPI, sizeof(__pyx_k_mpi4py_MPI), 0, 0, 1, 0}, {&__pyx_n_s_mpiabort, __pyx_k_mpiabort, sizeof(__pyx_k_mpiabort), 0, 0, 1, 1}, {&__pyx_n_s_mro_entries, __pyx_k_mro_entries, sizeof(__pyx_k_mro_entries), 0, 0, 1, 1}, {&__pyx_n_s_msg, __pyx_k_msg, sizeof(__pyx_k_msg), 0, 0, 1, 1}, {&__pyx_n_s_mult, __pyx_k_mult, sizeof(__pyx_k_mult), 0, 0, 1, 1}, {&__pyx_n_s_multAdd, __pyx_k_multAdd, sizeof(__pyx_k_multAdd), 0, 0, 1, 1}, {&__pyx_n_s_multDiagonalBlock, __pyx_k_multDiagonalBlock, sizeof(__pyx_k_multDiagonalBlock), 0, 0, 1, 1}, {&__pyx_n_s_multHermitian, __pyx_k_multHermitian, sizeof(__pyx_k_multHermitian), 0, 0, 1, 1}, {&__pyx_n_s_multHermitianAdd, __pyx_k_multHermitianAdd, sizeof(__pyx_k_multHermitianAdd), 0, 0, 1, 1}, {&__pyx_n_s_multTranspose, __pyx_k_multTranspose, sizeof(__pyx_k_multTranspose), 0, 0, 1, 1}, {&__pyx_n_s_multTransposeAdd, __pyx_k_multTransposeAdd, sizeof(__pyx_k_multTransposeAdd), 0, 0, 1, 1}, {&__pyx_n_s_multirootdata, __pyx_k_multirootdata, sizeof(__pyx_k_multirootdata), 0, 0, 1, 1}, {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1}, {&__pyx_n_s_na, __pyx_k_na, sizeof(__pyx_k_na), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1}, {&__pyx_n_s_name_3, __pyx_k_name_3, sizeof(__pyx_k_name_3), 0, 0, 1, 1}, {&__pyx_n_s_nbsteps, __pyx_k_nbsteps, sizeof(__pyx_k_nbsteps), 0, 0, 1, 1}, {&__pyx_n_s_nc, __pyx_k_nc, sizeof(__pyx_k_nc), 0, 0, 1, 1}, {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1}, {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1}, {&__pyx_n_s_newsec, __pyx_k_newsec, sizeof(__pyx_k_newsec), 0, 0, 1, 1}, {&__pyx_n_s_newvec, __pyx_k_newvec, sizeof(__pyx_k_newvec), 0, 0, 1, 1}, {&__pyx_n_s_ngs, __pyx_k_ngs, sizeof(__pyx_k_ngs), 0, 0, 1, 1}, {&__pyx_n_s_nlevels, __pyx_k_nlevels, sizeof(__pyx_k_nlevels), 0, 0, 1, 1}, {&__pyx_n_s_nlocal, __pyx_k_nlocal, sizeof(__pyx_k_nlocal), 0, 0, 1, 1}, {&__pyx_n_s_nmax, __pyx_k_nmax, sizeof(__pyx_k_nmax), 0, 0, 1, 1}, {&__pyx_n_s_nmin, __pyx_k_nmin, sizeof(__pyx_k_nmin), 0, 0, 1, 1}, {&__pyx_n_s_nnz, __pyx_k_nnz, sizeof(__pyx_k_nnz), 0, 0, 1, 1}, {&__pyx_n_s_noInsert, __pyx_k_noInsert, sizeof(__pyx_k_noInsert), 0, 0, 1, 1}, {&__pyx_n_s_noMove, __pyx_k_noMove, sizeof(__pyx_k_noMove), 0, 0, 1, 1}, {&__pyx_n_s_noSurf, __pyx_k_noSurf, sizeof(__pyx_k_noSurf), 0, 0, 1, 1}, {&__pyx_n_s_noSwap, __pyx_k_noSwap, sizeof(__pyx_k_noSwap), 0, 0, 1, 1}, {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0}, {&__pyx_n_s_none, __pyx_k_none, sizeof(__pyx_k_none), 0, 0, 1, 1}, {&__pyx_n_s_nonzero, __pyx_k_nonzero, sizeof(__pyx_k_nonzero), 0, 0, 1, 1}, {&__pyx_n_s_norm, __pyx_k_norm, sizeof(__pyx_k_norm), 0, 0, 1, 1}, {&__pyx_n_s_norm_type, __pyx_k_norm_type, sizeof(__pyx_k_norm_type), 0, 0, 1, 1}, {&__pyx_n_s_normsched, __pyx_k_normsched, sizeof(__pyx_k_normsched), 0, 0, 1, 1}, {&__pyx_n_s_normtype, __pyx_k_normtype, sizeof(__pyx_k_normtype), 0, 0, 1, 1}, {&__pyx_n_s_npoints, __pyx_k_npoints, sizeof(__pyx_k_npoints), 0, 0, 1, 1}, {&__pyx_n_s_nroots, __pyx_k_nroots, sizeof(__pyx_k_nroots), 0, 0, 1, 1}, {&__pyx_n_s_nsd, __pyx_k_nsd, sizeof(__pyx_k_nsd), 0, 0, 1, 1}, {&__pyx_n_s_nsp, __pyx_k_nsp, sizeof(__pyx_k_nsp), 0, 0, 1, 1}, {&__pyx_n_s_nsubcomm, __pyx_k_nsubcomm, sizeof(__pyx_k_nsubcomm), 0, 0, 1, 1}, {&__pyx_n_s_null, __pyx_k_null, sizeof(__pyx_k_null), 0, 0, 1, 1}, {&__pyx_kp_s_null_communicator, __pyx_k_null_communicator, sizeof(__pyx_k_null_communicator), 0, 0, 1, 0}, {&__pyx_n_s_numBatches, __pyx_k_numBatches, sizeof(__pyx_k_numBatches), 0, 0, 1, 1}, {&__pyx_n_s_numBlocks, __pyx_k_numBlocks, sizeof(__pyx_k_numBlocks), 0, 0, 1, 1}, {&__pyx_n_s_numComp, __pyx_k_numComp, sizeof(__pyx_k_numComp), 0, 0, 1, 1}, {&__pyx_n_s_numDof, __pyx_k_numDof, sizeof(__pyx_k_numDof), 0, 0, 1, 1}, {&__pyx_n_s_numFields, __pyx_k_numFields, sizeof(__pyx_k_numFields), 0, 0, 1, 1}, {&__pyx_n_s_numIter, __pyx_k_numIter, sizeof(__pyx_k_numIter), 0, 0, 1, 1}, {&__pyx_n_s_numMessages, __pyx_k_numMessages, sizeof(__pyx_k_numMessages), 0, 0, 1, 1}, {&__pyx_n_s_numProcs, __pyx_k_numProcs, sizeof(__pyx_k_numProcs), 0, 0, 1, 1}, {&__pyx_n_s_numReductions, __pyx_k_numReductions, sizeof(__pyx_k_numReductions), 0, 0, 1, 1}, {&__pyx_n_s_numSumSpaces, __pyx_k_numSumSpaces, sizeof(__pyx_k_numSumSpaces), 0, 0, 1, 1}, {&__pyx_n_s_numTensSpaces, __pyx_k_numTensSpaces, sizeof(__pyx_k_numTensSpaces), 0, 0, 1, 1}, {&__pyx_kp_s_number_of_dimensions_d_and_numbe, __pyx_k_number_of_dimensions_d_and_numbe, sizeof(__pyx_k_number_of_dimensions_d_and_numbe), 0, 0, 1, 0}, {&__pyx_n_s_nz_allocated, __pyx_k_nz_allocated, sizeof(__pyx_k_nz_allocated), 0, 0, 1, 1}, {&__pyx_n_s_nz_unneeded, __pyx_k_nz_unneeded, sizeof(__pyx_k_nz_unneeded), 0, 0, 1, 1}, {&__pyx_n_s_nz_used, __pyx_k_nz_used, sizeof(__pyx_k_nz_used), 0, 0, 1, 1}, {&__pyx_n_s_nzdiag, __pyx_k_nzdiag, sizeof(__pyx_k_nzdiag), 0, 0, 1, 1}, {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1}, {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1}, {&__pyx_n_s_objective, __pyx_k_objective, sizeof(__pyx_k_objective), 0, 0, 1, 1}, {&__pyx_n_s_objgrad, __pyx_k_objgrad, sizeof(__pyx_k_objgrad), 0, 0, 1, 1}, {&__pyx_n_s_offset, __pyx_k_offset, sizeof(__pyx_k_offset), 0, 0, 1, 1}, {&__pyx_n_s_omega, __pyx_k_omega, sizeof(__pyx_k_omega), 0, 0, 1, 1}, {&__pyx_n_s_ometric, __pyx_k_ometric, sizeof(__pyx_k_ometric), 0, 0, 1, 1}, {&__pyx_kp_s_only_and, __pyx_k_only_and, sizeof(__pyx_k_only_and), 0, 0, 1, 0}, {&__pyx_n_s_onnz, __pyx_k_onnz, sizeof(__pyx_k_onnz), 0, 0, 1, 1}, {&__pyx_n_s_op, __pyx_k_op, sizeof(__pyx_k_op), 0, 0, 1, 1}, {&__pyx_n_s_open, __pyx_k_open, sizeof(__pyx_k_open), 0, 0, 1, 1}, {&__pyx_n_s_operator, __pyx_k_operator, sizeof(__pyx_k_operator), 0, 0, 1, 1}, {&__pyx_n_s_operators, __pyx_k_operators, sizeof(__pyx_k_operators), 0, 0, 1, 1}, {&__pyx_n_s_option, __pyx_k_option, sizeof(__pyx_k_option), 0, 0, 1, 1}, {&__pyx_kp_s_option_prefix_must_be_string, __pyx_k_option_prefix_must_be_string, sizeof(__pyx_k_option_prefix_must_be_string), 0, 0, 1, 0}, {&__pyx_kp_s_option_prefix_should_not_have_sp, __pyx_k_option_prefix_should_not_have_sp, sizeof(__pyx_k_option_prefix_should_not_have_sp), 0, 0, 1, 0}, {&__pyx_kp_s_option_prefix_should_not_start_w, __pyx_k_option_prefix_should_not_start_w, sizeof(__pyx_k_option_prefix_should_not_start_w), 0, 0, 1, 0}, {&__pyx_n_s_options, __pyx_k_options, sizeof(__pyx_k_options), 0, 0, 1, 1}, {&__pyx_n_s_opts, __pyx_k_opts, sizeof(__pyx_k_opts), 0, 0, 1, 1}, {&__pyx_n_s_ord_type, __pyx_k_ord_type, sizeof(__pyx_k_ord_type), 0, 0, 1, 1}, {&__pyx_n_s_order, __pyx_k_order, sizeof(__pyx_k_order), 0, 0, 1, 1}, {&__pyx_n_s_orientation, __pyx_k_orientation, sizeof(__pyx_k_orientation), 0, 0, 1, 1}, {&__pyx_n_s_other, __pyx_k_other, sizeof(__pyx_k_other), 0, 0, 1, 1}, {&__pyx_n_s_otype, __pyx_k_otype, sizeof(__pyx_k_otype), 0, 0, 1, 1}, {&__pyx_n_s_out, __pyx_k_out, sizeof(__pyx_k_out), 0, 0, 1, 1}, {&__pyx_n_s_output, __pyx_k_output, sizeof(__pyx_k_output), 0, 0, 1, 1}, {&__pyx_n_s_overlap, __pyx_k_overlap, sizeof(__pyx_k_overlap), 0, 0, 1, 1}, {&__pyx_kp_s_ownership_range_size_d_and_numbe, __pyx_k_ownership_range_size_d_and_numbe, sizeof(__pyx_k_ownership_range_size_d_and_numbe), 0, 0, 1, 0}, {&__pyx_n_s_ownership_ranges, __pyx_k_ownership_ranges, sizeof(__pyx_k_ownership_ranges), 0, 0, 1, 1}, {&__pyx_n_s_ozz, __pyx_k_ozz, sizeof(__pyx_k_ozz), 0, 0, 1, 1}, {&__pyx_n_s_p, __pyx_k_p, sizeof(__pyx_k_p), 0, 0, 1, 1}, {&__pyx_n_s_p1, __pyx_k_p1, sizeof(__pyx_k_p1), 0, 0, 1, 1}, {&__pyx_n_s_pEnd, __pyx_k_pEnd, sizeof(__pyx_k_pEnd), 0, 0, 1, 1}, {&__pyx_n_s_pStart, __pyx_k_pStart, sizeof(__pyx_k_pStart), 0, 0, 1, 1}, {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1}, {&__pyx_n_s_package, __pyx_k_package, sizeof(__pyx_k_package), 0, 0, 1, 1}, {&__pyx_n_s_package_2, __pyx_k_package_2, sizeof(__pyx_k_package_2), 0, 0, 1, 1}, {&__pyx_n_s_parallel, __pyx_k_parallel, sizeof(__pyx_k_parallel), 0, 0, 1, 1}, {&__pyx_n_s_parent, __pyx_k_parent, sizeof(__pyx_k_parent), 0, 0, 1, 1}, {&__pyx_n_s_part, __pyx_k_part, sizeof(__pyx_k_part), 0, 0, 1, 1}, {&__pyx_n_s_part_type, __pyx_k_part_type, sizeof(__pyx_k_part_type), 0, 0, 1, 1}, {&__pyx_n_s_partitioning, __pyx_k_partitioning, sizeof(__pyx_k_partitioning), 0, 0, 1, 1}, {&__pyx_n_s_pc, __pyx_k_pc, sizeof(__pyx_k_pc), 0, 0, 1, 1}, {&__pyx_n_s_pc_type, __pyx_k_pc_type, sizeof(__pyx_k_pc_type), 0, 0, 1, 1}, {&__pyx_n_s_pd, __pyx_k_pd, sizeof(__pyx_k_pd), 0, 0, 1, 1}, {&__pyx_n_s_periodic, __pyx_k_periodic, sizeof(__pyx_k_periodic), 0, 0, 1, 1}, {&__pyx_n_s_perm, __pyx_k_perm, sizeof(__pyx_k_perm), 0, 0, 1, 1}, {&__pyx_n_s_permutation, __pyx_k_permutation, sizeof(__pyx_k_permutation), 0, 0, 1, 1}, {&__pyx_n_s_petsc, __pyx_k_petsc, sizeof(__pyx_k_petsc), 0, 0, 1, 1}, {&__pyx_n_s_petsc4py_PETSc, __pyx_k_petsc4py_PETSc, sizeof(__pyx_k_petsc4py_PETSc), 0, 0, 1, 1}, {&__pyx_kp_s_petsc4py_PETSc_Device_pyx, __pyx_k_petsc4py_PETSc_Device_pyx, sizeof(__pyx_k_petsc4py_PETSc_Device_pyx), 0, 0, 1, 0}, {&__pyx_kp_s_petsc4py_PETSc_Error_pyx, __pyx_k_petsc4py_PETSc_Error_pyx, sizeof(__pyx_k_petsc4py_PETSc_Error_pyx), 0, 0, 1, 0}, {&__pyx_kp_s_petsc4py_PETSc_Log_pyx, __pyx_k_petsc4py_PETSc_Log_pyx, sizeof(__pyx_k_petsc4py_PETSc_Log_pyx), 0, 0, 1, 0}, {&__pyx_kp_s_petsc4py_PETSc_PETSc_pyx, __pyx_k_petsc4py_PETSc_PETSc_pyx, sizeof(__pyx_k_petsc4py_PETSc_PETSc_pyx), 0, 0, 1, 0}, {&__pyx_kp_s_petsc4py_PETSc_cyclicgc_pxi, __pyx_k_petsc4py_PETSc_cyclicgc_pxi, sizeof(__pyx_k_petsc4py_PETSc_cyclicgc_pxi), 0, 0, 1, 0}, {&__pyx_n_s_pi, __pyx_k_pi, sizeof(__pyx_k_pi), 0, 0, 1, 1}, {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1}, {&__pyx_n_s_pj, __pyx_k_pj, sizeof(__pyx_k_pj), 0, 0, 1, 1}, {&__pyx_n_s_plexname, __pyx_k_plexname, sizeof(__pyx_k_plexname), 0, 0, 1, 1}, {&__pyx_n_s_point, __pyx_k_point, sizeof(__pyx_k_point), 0, 0, 1, 1}, {&__pyx_n_s_points, __pyx_k_points, sizeof(__pyx_k_points), 0, 0, 1, 1}, {&__pyx_n_s_pop, __pyx_k_pop, sizeof(__pyx_k_pop), 0, 0, 1, 1}, {&__pyx_n_s_popErrorHandler, __pyx_k_popErrorHandler, sizeof(__pyx_k_popErrorHandler), 0, 0, 1, 1}, {&__pyx_n_s_popSignalHandler, __pyx_k_popSignalHandler, sizeof(__pyx_k_popSignalHandler), 0, 0, 1, 1}, {&__pyx_n_s_pop_python_vfprintf, __pyx_k_pop_python_vfprintf, sizeof(__pyx_k_pop_python_vfprintf), 0, 0, 1, 1}, {&__pyx_n_s_position, __pyx_k_position, sizeof(__pyx_k_position), 0, 0, 1, 1}, {&__pyx_n_s_positive_definite, __pyx_k_positive_definite, sizeof(__pyx_k_positive_definite), 0, 0, 1, 1}, {&__pyx_n_s_postSolve, __pyx_k_postSolve, sizeof(__pyx_k_postSolve), 0, 0, 1, 1}, {&__pyx_n_s_postStep, __pyx_k_postStep, sizeof(__pyx_k_postStep), 0, 0, 1, 1}, {&__pyx_n_s_postevent, __pyx_k_postevent, sizeof(__pyx_k_postevent), 0, 0, 1, 1}, {&__pyx_n_s_poststep, __pyx_k_poststep, sizeof(__pyx_k_poststep), 0, 0, 1, 1}, {&__pyx_n_s_pre, __pyx_k_pre, sizeof(__pyx_k_pre), 0, 0, 1, 1}, {&__pyx_n_s_preSolve, __pyx_k_preSolve, sizeof(__pyx_k_preSolve), 0, 0, 1, 1}, {&__pyx_n_s_preStep, __pyx_k_preStep, sizeof(__pyx_k_preStep), 0, 0, 1, 1}, {&__pyx_n_s_pre_finalize, __pyx_k_pre_finalize, sizeof(__pyx_k_pre_finalize), 0, 0, 1, 1}, {&__pyx_n_s_precheck, __pyx_k_precheck, sizeof(__pyx_k_precheck), 0, 0, 1, 1}, {&__pyx_n_s_prefix, __pyx_k_prefix, sizeof(__pyx_k_prefix), 0, 0, 1, 1}, {&__pyx_kp_s_prefix_s_name_s, __pyx_k_prefix_s_name_s, sizeof(__pyx_k_prefix_s_name_s), 0, 0, 1, 0}, {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, {&__pyx_n_s_prestep, __pyx_k_prestep, sizeof(__pyx_k_prestep), 0, 0, 1, 1}, {&__pyx_n_s_primv, __pyx_k_primv, sizeof(__pyx_k_primv), 0, 0, 1, 1}, {&__pyx_n_s_proc_sizes, __pyx_k_proc_sizes, sizeof(__pyx_k_proc_sizes), 0, 0, 1, 1}, {&__pyx_n_s_productNumeric, __pyx_k_productNumeric, sizeof(__pyx_k_productNumeric), 0, 0, 1, 1}, {&__pyx_n_s_productSetFromOptions, __pyx_k_productSetFromOptions, sizeof(__pyx_k_productSetFromOptions), 0, 0, 1, 1}, {&__pyx_n_s_productSymbolic, __pyx_k_productSymbolic, sizeof(__pyx_k_productSymbolic), 0, 0, 1, 1}, {&__pyx_n_s_property, __pyx_k_property, sizeof(__pyx_k_property), 0, 0, 1, 1}, {&__pyx_n_s_ptap, __pyx_k_ptap, sizeof(__pyx_k_ptap), 0, 0, 1, 1}, {&__pyx_n_s_ptype, __pyx_k_ptype, sizeof(__pyx_k_ptype), 0, 0, 1, 1}, {&__pyx_n_s_push, __pyx_k_push, sizeof(__pyx_k_push), 0, 0, 1, 1}, {&__pyx_n_s_pushErrorHandler, __pyx_k_pushErrorHandler, sizeof(__pyx_k_pushErrorHandler), 0, 0, 1, 1}, {&__pyx_n_s_push_python_vfprintf, __pyx_k_push_python_vfprintf, sizeof(__pyx_k_push_python_vfprintf), 0, 0, 1, 1}, {&__pyx_n_s_py_sub_ctxs, __pyx_k_py_sub_ctxs, sizeof(__pyx_k_py_sub_ctxs), 0, 0, 1, 1}, {&__pyx_n_s_py_type, __pyx_k_py_type, sizeof(__pyx_k_py_type), 0, 0, 1, 1}, {&__pyx_n_s_python, __pyx_k_python, sizeof(__pyx_k_python), 0, 0, 1, 1}, {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1}, {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1}, {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1}, {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1}, {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1}, {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum, sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1}, {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, {&__pyx_n_s_q0, __pyx_k_q0, sizeof(__pyx_k_q0), 0, 0, 1, 1}, {&__pyx_n_s_q1, __pyx_k_q1, sizeof(__pyx_k_q1), 0, 0, 1, 1}, {&__pyx_n_s_qorder, __pyx_k_qorder, sizeof(__pyx_k_qorder), 0, 0, 1, 1}, {&__pyx_n_s_quad, __pyx_k_quad, sizeof(__pyx_k_quad), 0, 0, 1, 1}, {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, {&__pyx_n_s_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 1, 1}, {&__pyx_kp_s_r_2, __pyx_k_r_2, sizeof(__pyx_k_r_2), 0, 0, 1, 0}, {&__pyx_n_s_radius, __pyx_k_radius, sizeof(__pyx_k_radius), 0, 0, 1, 1}, {&__pyx_n_s_random, __pyx_k_random, sizeof(__pyx_k_random), 0, 0, 1, 1}, {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, {&__pyx_n_s_ranges, __pyx_k_ranges, sizeof(__pyx_k_ranges), 0, 0, 1, 1}, {&__pyx_n_s_rank, __pyx_k_rank, sizeof(__pyx_k_rank), 0, 0, 1, 1}, {&__pyx_n_s_read, __pyx_k_read, sizeof(__pyx_k_read), 0, 0, 1, 1}, {&__pyx_n_s_readonly, __pyx_k_readonly, sizeof(__pyx_k_readonly), 0, 0, 1, 1}, {&__pyx_kp_s_readonly_attribute, __pyx_k_readonly_attribute, sizeof(__pyx_k_readonly_attribute), 0, 0, 1, 0}, {&__pyx_n_s_ready, __pyx_k_ready, sizeof(__pyx_k_ready), 0, 0, 1, 1}, {&__pyx_n_s_real, __pyx_k_real, sizeof(__pyx_k_real), 0, 0, 1, 1}, {&__pyx_n_s_realPart, __pyx_k_realPart, sizeof(__pyx_k_realPart), 0, 0, 1, 1}, {&__pyx_n_s_reason, __pyx_k_reason, sizeof(__pyx_k_reason), 0, 0, 1, 1}, {&__pyx_n_s_reciprocal, __pyx_k_reciprocal, sizeof(__pyx_k_reciprocal), 0, 0, 1, 1}, {&__pyx_n_s_red, __pyx_k_red, sizeof(__pyx_k_red), 0, 0, 1, 1}, {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1}, {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1}, {&__pyx_n_s_redundant, __pyx_k_redundant, sizeof(__pyx_k_redundant), 0, 0, 1, 1}, {&__pyx_n_s_redundantPoints, __pyx_k_redundantPoints, sizeof(__pyx_k_redundantPoints), 0, 0, 1, 1}, {&__pyx_n_s_refine, __pyx_k_refine, sizeof(__pyx_k_refine), 0, 0, 1, 1}, {&__pyx_n_s_refine_x, __pyx_k_refine_x, sizeof(__pyx_k_refine_x), 0, 0, 1, 1}, {&__pyx_n_s_refine_y, __pyx_k_refine_y, sizeof(__pyx_k_refine_y), 0, 0, 1, 1}, {&__pyx_n_s_refine_z, __pyx_k_refine_z, sizeof(__pyx_k_refine_z), 0, 0, 1, 1}, {&__pyx_n_s_refinementLimit, __pyx_k_refinementLimit, sizeof(__pyx_k_refinementLimit), 0, 0, 1, 1}, {&__pyx_n_s_refinementUniform, __pyx_k_refinementUniform, sizeof(__pyx_k_refinementUniform), 0, 0, 1, 1}, {&__pyx_n_s_register, __pyx_k_register, sizeof(__pyx_k_register), 0, 0, 1, 1}, {&__pyx_n_s_registerCitation, __pyx_k_registerCitation, sizeof(__pyx_k_registerCitation), 0, 0, 1, 1}, {&__pyx_n_s_release, __pyx_k_release, sizeof(__pyx_k_release), 0, 0, 1, 1}, {&__pyx_n_s_remote, __pyx_k_remote, sizeof(__pyx_k_remote), 0, 0, 1, 1}, {&__pyx_n_s_remoteOffsets, __pyx_k_remoteOffsets, sizeof(__pyx_k_remoteOffsets), 0, 0, 1, 1}, {&__pyx_n_s_remove, __pyx_k_remove, sizeof(__pyx_k_remove), 0, 0, 1, 1}, {&__pyx_n_s_remove_sent_points, __pyx_k_remove_sent_points, sizeof(__pyx_k_remove_sent_points), 0, 0, 1, 1}, {&__pyx_n_s_replace, __pyx_k_replace, sizeof(__pyx_k_replace), 0, 0, 1, 1}, {&__pyx_n_s_repr, __pyx_k_repr, sizeof(__pyx_k_repr), 0, 0, 1, 1}, {&__pyx_n_s_res, __pyx_k_res, sizeof(__pyx_k_res), 0, 0, 1, 1}, {&__pyx_n_s_reset, __pyx_k_reset, sizeof(__pyx_k_reset), 0, 0, 1, 1}, {&__pyx_n_s_reshape, __pyx_k_reshape, sizeof(__pyx_k_reshape), 0, 0, 1, 1}, {&__pyx_n_s_residual, __pyx_k_residual, sizeof(__pyx_k_residual), 0, 0, 1, 1}, {&__pyx_n_s_restart, __pyx_k_restart, sizeof(__pyx_k_restart), 0, 0, 1, 1}, {&__pyx_n_s_restrictAnisotropy, __pyx_k_restrictAnisotropy, sizeof(__pyx_k_restrictAnisotropy), 0, 0, 1, 1}, {&__pyx_n_s_restrictAnisotropyFirst, __pyx_k_restrictAnisotropyFirst, sizeof(__pyx_k_restrictAnisotropyFirst), 0, 0, 1, 1}, {&__pyx_n_s_restrictSizes, __pyx_k_restrictSizes, sizeof(__pyx_k_restrictSizes), 0, 0, 1, 1}, {&__pyx_n_s_restricthook, __pyx_k_restricthook, sizeof(__pyx_k_restricthook), 0, 0, 1, 1}, {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1}, {&__pyx_n_s_reuse, __pyx_k_reuse, sizeof(__pyx_k_reuse), 0, 0, 1, 1}, {&__pyx_n_s_reverse, __pyx_k_reverse, sizeof(__pyx_k_reverse), 0, 0, 1, 1}, {&__pyx_n_s_rgLabel, __pyx_k_rgLabel, sizeof(__pyx_k_rgLabel), 0, 0, 1, 1}, {&__pyx_n_s_rhs, __pyx_k_rhs, sizeof(__pyx_k_rhs), 0, 0, 1, 1}, {&__pyx_n_s_rhsjacobianp, __pyx_k_rhsjacobianp, sizeof(__pyx_k_rhsjacobianp), 0, 0, 1, 1}, {&__pyx_n_s_right, __pyx_k_right, sizeof(__pyx_k_right), 0, 0, 1, 1}, {&__pyx_n_s_rmap, __pyx_k_rmap, sizeof(__pyx_k_rmap), 0, 0, 1, 1}, {&__pyx_n_s_rnd_type, __pyx_k_rnd_type, sizeof(__pyx_k_rnd_type), 0, 0, 1, 1}, {&__pyx_n_s_rnorm, __pyx_k_rnorm, sizeof(__pyx_k_rnorm), 0, 0, 1, 1}, {&__pyx_n_s_rollback, __pyx_k_rollback, sizeof(__pyx_k_rollback), 0, 0, 1, 1}, {&__pyx_n_s_rootSection, __pyx_k_rootSection, sizeof(__pyx_k_rootSection), 0, 0, 1, 1}, {&__pyx_n_s_rootdata, __pyx_k_rootdata, sizeof(__pyx_k_rootdata), 0, 0, 1, 1}, {&__pyx_n_s_row, __pyx_k_row, sizeof(__pyx_k_row), 0, 0, 1, 1}, {&__pyx_n_s_row_bsize, __pyx_k_row_bsize, sizeof(__pyx_k_row_bsize), 0, 0, 1, 1}, {&__pyx_kp_s_row_indices_must_have_two_dimens, __pyx_k_row_indices_must_have_two_dimens, sizeof(__pyx_k_row_indices_must_have_two_dimens), 0, 0, 1, 0}, {&__pyx_n_s_rowmap, __pyx_k_rowmap, sizeof(__pyx_k_rowmap), 0, 0, 1, 1}, {&__pyx_n_s_rows, __pyx_k_rows, sizeof(__pyx_k_rows), 0, 0, 1, 1}, {&__pyx_n_s_rscale, __pyx_k_rscale, sizeof(__pyx_k_rscale), 0, 0, 1, 1}, {&__pyx_n_s_rsplit, __pyx_k_rsplit, sizeof(__pyx_k_rsplit), 0, 0, 1, 1}, {&__pyx_n_s_rtol, __pyx_k_rtol, sizeof(__pyx_k_rtol), 0, 0, 1, 1}, {&__pyx_n_s_rtol_0, __pyx_k_rtol_0, sizeof(__pyx_k_rtol_0), 0, 0, 1, 1}, {&__pyx_n_s_rtol_max, __pyx_k_rtol_max, sizeof(__pyx_k_rtol_max), 0, 0, 1, 1}, {&__pyx_n_s_rw, __pyx_k_rw, sizeof(__pyx_k_rw), 0, 0, 1, 1}, {&__pyx_kp_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 0}, {&__pyx_n_s_s_2, __pyx_k_s_2, sizeof(__pyx_k_s_2), 0, 0, 1, 1}, {&__pyx_kp_s_s_at_s_d, __pyx_k_s_at_s_d, sizeof(__pyx_k_s_at_s_d), 0, 0, 1, 0}, {&__pyx_kp_s_s_s, __pyx_k_s_s, sizeof(__pyx_k_s_s), 0, 0, 1, 0}, {&__pyx_n_s_scale, __pyx_k_scale, sizeof(__pyx_k_scale), 0, 0, 1, 1}, {&__pyx_n_s_scatter, __pyx_k_scatter, sizeof(__pyx_k_scatter), 0, 0, 1, 1}, {&__pyx_n_s_scatterBegin, __pyx_k_scatterBegin, sizeof(__pyx_k_scatterBegin), 0, 0, 1, 1}, {&__pyx_n_s_scatterEnd, __pyx_k_scatterEnd, sizeof(__pyx_k_scatterEnd), 0, 0, 1, 1}, {&__pyx_n_s_scatter_type, __pyx_k_scatter_type, sizeof(__pyx_k_scatter_type), 0, 0, 1, 1}, {&__pyx_n_s_sec, __pyx_k_sec, sizeof(__pyx_k_sec), 0, 0, 1, 1}, {&__pyx_n_s_seconds, __pyx_k_seconds, sizeof(__pyx_k_seconds), 0, 0, 1, 1}, {&__pyx_n_s_sectiondm, __pyx_k_sectiondm, sizeof(__pyx_k_sectiondm), 0, 0, 1, 1}, {&__pyx_n_s_seed, __pyx_k_seed, sizeof(__pyx_k_seed), 0, 0, 1, 1}, {&__pyx_n_s_selected, __pyx_k_selected, sizeof(__pyx_k_selected), 0, 0, 1, 1}, {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, {&__pyx_n_s_sep, __pyx_k_sep, sizeof(__pyx_k_sep), 0, 0, 1, 1}, {&__pyx_n_s_setActive, __pyx_k_setActive, sizeof(__pyx_k_setActive), 0, 0, 1, 1}, {&__pyx_n_s_setActiveAll, __pyx_k_setActiveAll, sizeof(__pyx_k_setActiveAll), 0, 0, 1, 1}, {&__pyx_n_s_setAppCtx, __pyx_k_setAppCtx, sizeof(__pyx_k_setAppCtx), 0, 0, 1, 1}, {&__pyx_n_s_setApplicationContext, __pyx_k_setApplicationContext, sizeof(__pyx_k_setApplicationContext), 0, 0, 1, 1}, {&__pyx_n_s_setConvergedReason, __pyx_k_setConvergedReason, sizeof(__pyx_k_setConvergedReason), 0, 0, 1, 1}, {&__pyx_n_s_setCurrent, __pyx_k_setCurrent, sizeof(__pyx_k_setCurrent), 0, 0, 1, 1}, {&__pyx_n_s_setDM, __pyx_k_setDM, sizeof(__pyx_k_setDM), 0, 0, 1, 1}, {&__pyx_n_s_setDS, __pyx_k_setDS, sizeof(__pyx_k_setDS), 0, 0, 1, 1}, {&__pyx_n_s_setDefaultComm, __pyx_k_setDefaultComm, sizeof(__pyx_k_setDefaultComm), 0, 0, 1, 1}, {&__pyx_n_s_setDefaultGlobalSection, __pyx_k_setDefaultGlobalSection, sizeof(__pyx_k_setDefaultGlobalSection), 0, 0, 1, 1}, {&__pyx_n_s_setDefaultLocalSection, __pyx_k_setDefaultLocalSection, sizeof(__pyx_k_setDefaultLocalSection), 0, 0, 1, 1}, {&__pyx_n_s_setDefaultSF, __pyx_k_setDefaultSF, sizeof(__pyx_k_setDefaultSF), 0, 0, 1, 1}, {&__pyx_n_s_setDefaultSection, __pyx_k_setDefaultSection, sizeof(__pyx_k_setDefaultSection), 0, 0, 1, 1}, {&__pyx_n_s_setDefaultType, __pyx_k_setDefaultType, sizeof(__pyx_k_setDefaultType), 0, 0, 1, 1}, {&__pyx_n_s_setDevice, __pyx_k_setDevice, sizeof(__pyx_k_setDevice), 0, 0, 1, 1}, {&__pyx_n_s_setDiagonal, __pyx_k_setDiagonal, sizeof(__pyx_k_setDiagonal), 0, 0, 1, 1}, {&__pyx_n_s_setDimension, __pyx_k_setDimension, sizeof(__pyx_k_setDimension), 0, 0, 1, 1}, {&__pyx_n_s_setEquationType, __pyx_k_setEquationType, sizeof(__pyx_k_setEquationType), 0, 0, 1, 1}, {&__pyx_n_s_setFromOptions, __pyx_k_setFromOptions, sizeof(__pyx_k_setFromOptions), 0, 0, 1, 1}, {&__pyx_n_s_setFunctionNorm, __pyx_k_setFunctionNorm, sizeof(__pyx_k_setFunctionNorm), 0, 0, 1, 1}, {&__pyx_n_s_setFunctionTolerances, __pyx_k_setFunctionTolerances, sizeof(__pyx_k_setFunctionTolerances), 0, 0, 1, 1}, {&__pyx_n_s_setGlobalSection, __pyx_k_setGlobalSection, sizeof(__pyx_k_setGlobalSection), 0, 0, 1, 1}, {&__pyx_n_s_setInitial, __pyx_k_setInitial, sizeof(__pyx_k_setInitial), 0, 0, 1, 1}, {&__pyx_n_s_setInitialGuessKnoll, __pyx_k_setInitialGuessKnoll, sizeof(__pyx_k_setInitialGuessKnoll), 0, 0, 1, 1}, {&__pyx_n_s_setInitialGuessNonzero, __pyx_k_setInitialGuessNonzero, sizeof(__pyx_k_setInitialGuessNonzero), 0, 0, 1, 1}, {&__pyx_n_s_setInterval, __pyx_k_setInterval, sizeof(__pyx_k_setInterval), 0, 0, 1, 1}, {&__pyx_n_s_setIterationNumber, __pyx_k_setIterationNumber, sizeof(__pyx_k_setIterationNumber), 0, 0, 1, 1}, {&__pyx_n_s_setKSP, __pyx_k_setKSP, sizeof(__pyx_k_setKSP), 0, 0, 1, 1}, {&__pyx_n_s_setLocalSection, __pyx_k_setLocalSection, sizeof(__pyx_k_setLocalSection), 0, 0, 1, 1}, {&__pyx_n_s_setMaxFunctionEvaluations, __pyx_k_setMaxFunctionEvaluations, sizeof(__pyx_k_setMaxFunctionEvaluations), 0, 0, 1, 1}, {&__pyx_n_s_setMaxKSPFailures, __pyx_k_setMaxKSPFailures, sizeof(__pyx_k_setMaxKSPFailures), 0, 0, 1, 1}, {&__pyx_n_s_setMaxLinearSolveFailures, __pyx_k_setMaxLinearSolveFailures, sizeof(__pyx_k_setMaxLinearSolveFailures), 0, 0, 1, 1}, {&__pyx_n_s_setMaxNonlinearStepFailures, __pyx_k_setMaxNonlinearStepFailures, sizeof(__pyx_k_setMaxNonlinearStepFailures), 0, 0, 1, 1}, {&__pyx_n_s_setMaxStepFailures, __pyx_k_setMaxStepFailures, sizeof(__pyx_k_setMaxStepFailures), 0, 0, 1, 1}, {&__pyx_n_s_setMaxSteps, __pyx_k_setMaxSteps, sizeof(__pyx_k_setMaxSteps), 0, 0, 1, 1}, {&__pyx_n_s_setMaxTime, __pyx_k_setMaxTime, sizeof(__pyx_k_setMaxTime), 0, 0, 1, 1}, {&__pyx_n_s_setMonitor, __pyx_k_setMonitor, sizeof(__pyx_k_setMonitor), 0, 0, 1, 1}, {&__pyx_n_s_setNPC, __pyx_k_setNPC, sizeof(__pyx_k_setNPC), 0, 0, 1, 1}, {&__pyx_n_s_setName, __pyx_k_setName, sizeof(__pyx_k_setName), 0, 0, 1, 1}, {&__pyx_n_s_setNormType, __pyx_k_setNormType, sizeof(__pyx_k_setNormType), 0, 0, 1, 1}, {&__pyx_n_s_setOption, __pyx_k_setOption, sizeof(__pyx_k_setOption), 0, 0, 1, 1}, {&__pyx_n_s_setOptionsPrefix, __pyx_k_setOptionsPrefix, sizeof(__pyx_k_setOptionsPrefix), 0, 0, 1, 1}, {&__pyx_n_s_setPCSide, __pyx_k_setPCSide, sizeof(__pyx_k_setPCSide), 0, 0, 1, 1}, {&__pyx_n_s_setParamsEW, __pyx_k_setParamsEW, sizeof(__pyx_k_setParamsEW), 0, 0, 1, 1}, {&__pyx_n_s_setProblemType, __pyx_k_setProblemType, sizeof(__pyx_k_setProblemType), 0, 0, 1, 1}, {&__pyx_n_s_setResidualNorm, __pyx_k_setResidualNorm, sizeof(__pyx_k_setResidualNorm), 0, 0, 1, 1}, {&__pyx_n_s_setSection, __pyx_k_setSection, sizeof(__pyx_k_setSection), 0, 0, 1, 1}, {&__pyx_n_s_setSectionSF, __pyx_k_setSectionSF, sizeof(__pyx_k_setSectionSF), 0, 0, 1, 1}, {&__pyx_n_s_setSeed, __pyx_k_setSeed, sizeof(__pyx_k_setSeed), 0, 0, 1, 1}, {&__pyx_n_s_setSizes, __pyx_k_setSizes, sizeof(__pyx_k_setSizes), 0, 0, 1, 1}, {&__pyx_n_s_setSolution, __pyx_k_setSolution, sizeof(__pyx_k_setSolution), 0, 0, 1, 1}, {&__pyx_n_s_setStepNumber, __pyx_k_setStepNumber, sizeof(__pyx_k_setStepNumber), 0, 0, 1, 1}, {&__pyx_n_s_setStreamType, __pyx_k_setStreamType, sizeof(__pyx_k_setStreamType), 0, 0, 1, 1}, {&__pyx_n_s_setTime, __pyx_k_setTime, sizeof(__pyx_k_setTime), 0, 0, 1, 1}, {&__pyx_n_s_setTimeStep, __pyx_k_setTimeStep, sizeof(__pyx_k_setTimeStep), 0, 0, 1, 1}, {&__pyx_n_s_setTolerances, __pyx_k_setTolerances, sizeof(__pyx_k_setTolerances), 0, 0, 1, 1}, {&__pyx_n_s_setType, __pyx_k_setType, sizeof(__pyx_k_setType), 0, 0, 1, 1}, {&__pyx_n_s_setUp, __pyx_k_setUp, sizeof(__pyx_k_setUp), 0, 0, 1, 1}, {&__pyx_n_s_setUseEW, __pyx_k_setUseEW, sizeof(__pyx_k_setUseEW), 0, 0, 1, 1}, {&__pyx_n_s_setUseFD, __pyx_k_setUseFD, sizeof(__pyx_k_setUseFD), 0, 0, 1, 1}, {&__pyx_n_s_setUseMF, __pyx_k_setUseMF, sizeof(__pyx_k_setUseMF), 0, 0, 1, 1}, {&__pyx_n_s_setValue, __pyx_k_setValue, sizeof(__pyx_k_setValue), 0, 0, 1, 1}, {&__pyx_n_s_setVisible, __pyx_k_setVisible, sizeof(__pyx_k_setVisible), 0, 0, 1, 1}, {&__pyx_n_s_set_name, __pyx_k_set_name, sizeof(__pyx_k_set_name), 0, 0, 1, 1}, {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1}, {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_setup, __pyx_k_setup, sizeof(__pyx_k_setup), 0, 0, 1, 1}, {&__pyx_n_s_sf, __pyx_k_sf, sizeof(__pyx_k_sf), 0, 0, 1, 1}, {&__pyx_n_s_sf_type, __pyx_k_sf_type, sizeof(__pyx_k_sf_type), 0, 0, 1, 1}, {&__pyx_n_s_sfxc, __pyx_k_sfxc, sizeof(__pyx_k_sfxc), 0, 0, 1, 1}, {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1}, {&__pyx_n_s_shift, __pyx_k_shift, sizeof(__pyx_k_shift), 0, 0, 1, 1}, {&__pyx_n_s_shift_type, __pyx_k_shift_type, sizeof(__pyx_k_shift_type), 0, 0, 1, 1}, {&__pyx_n_s_shiftamount, __pyx_k_shiftamount, sizeof(__pyx_k_shiftamount), 0, 0, 1, 1}, {&__pyx_n_s_shifttype, __pyx_k_shifttype, sizeof(__pyx_k_shifttype), 0, 0, 1, 1}, {&__pyx_n_s_side, __pyx_k_side, sizeof(__pyx_k_side), 0, 0, 1, 1}, {&__pyx_kp_s_side_r_not_understood, __pyx_k_side_r_not_understood, sizeof(__pyx_k_side_r_not_understood), 0, 0, 1, 0}, {&__pyx_n_s_simplex, __pyx_k_simplex, sizeof(__pyx_k_simplex), 0, 0, 1, 1}, {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, {&__pyx_kp_s_size_I_is_d_expected_d, __pyx_k_size_I_is_d_expected_d, sizeof(__pyx_k_size_I_is_d_expected_d), 0, 0, 1, 0}, {&__pyx_kp_s_size_J_is_d_expected_d, __pyx_k_size_J_is_d_expected_d, sizeof(__pyx_k_size_J_is_d_expected_d), 0, 0, 1, 0}, {&__pyx_kp_s_size_V_is_d_expected_d, __pyx_k_size_V_is_d_expected_d, sizeof(__pyx_k_size_V_is_d_expected_d), 0, 0, 1, 0}, {&__pyx_kp_s_size_array_is_d_expected_dx_d_d, __pyx_k_size_array_is_d_expected_dx_d_d, sizeof(__pyx_k_size_array_is_d_expected_dx_d_d), 0, 0, 1, 0}, {&__pyx_kp_s_size_d_nnz_is_d_expected_d, __pyx_k_size_d_nnz_is_d_expected_d, sizeof(__pyx_k_size_d_nnz_is_d_expected_d), 0, 0, 1, 0}, {&__pyx_kp_s_size_o_nnz_is_d_expected_d, __pyx_k_size_o_nnz_is_d_expected_d, sizeof(__pyx_k_size_o_nnz_is_d_expected_d), 0, 0, 1, 0}, {&__pyx_n_s_sizes, __pyx_k_sizes, sizeof(__pyx_k_sizes), 0, 0, 1, 1}, {&__pyx_kp_s_sizes_array_should_have_d_entrie, __pyx_k_sizes_array_should_have_d_entrie, sizeof(__pyx_k_sizes_array_should_have_d_entrie), 0, 0, 1, 0}, {&__pyx_n_s_skip, __pyx_k_skip, sizeof(__pyx_k_skip), 0, 0, 1, 1}, {&__pyx_n_s_sleep, __pyx_k_sleep, sizeof(__pyx_k_sleep), 0, 0, 1, 1}, {&__pyx_n_s_smooths, __pyx_k_smooths, sizeof(__pyx_k_smooths), 0, 0, 1, 1}, {&__pyx_n_s_snes, __pyx_k_snes, sizeof(__pyx_k_snes), 0, 0, 1, 1}, {&__pyx_n_s_snes_type, __pyx_k_snes_type, sizeof(__pyx_k_snes_type), 0, 0, 1, 1}, {&__pyx_n_s_solve, __pyx_k_solve, sizeof(__pyx_k_solve), 0, 0, 1, 1}, {&__pyx_n_s_solveAdd, __pyx_k_solveAdd, sizeof(__pyx_k_solveAdd), 0, 0, 1, 1}, {&__pyx_n_s_solveStep, __pyx_k_solveStep, sizeof(__pyx_k_solveStep), 0, 0, 1, 1}, {&__pyx_n_s_solveTranspose, __pyx_k_solveTranspose, sizeof(__pyx_k_solveTranspose), 0, 0, 1, 1}, {&__pyx_n_s_solveTransposeAdd, __pyx_k_solveTransposeAdd, sizeof(__pyx_k_solveTransposeAdd), 0, 0, 1, 1}, {&__pyx_n_s_solver, __pyx_k_solver, sizeof(__pyx_k_solver), 0, 0, 1, 1}, {&__pyx_n_s_sortype, __pyx_k_sortype, sizeof(__pyx_k_sortype), 0, 0, 1, 1}, {&__pyx_n_s_sp, __pyx_k_sp, sizeof(__pyx_k_sp), 0, 0, 1, 1}, {&__pyx_n_s_space_type, __pyx_k_space_type, sizeof(__pyx_k_space_type), 0, 0, 1, 1}, {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1}, {&__pyx_n_s_splitOwnership, __pyx_k_splitOwnership, sizeof(__pyx_k_splitOwnership), 0, 0, 1, 1}, {&__pyx_n_s_stage, __pyx_k_stage, sizeof(__pyx_k_stage), 0, 0, 1, 1}, {&__pyx_n_s_star, __pyx_k_star, sizeof(__pyx_k_star), 0, 0, 1, 1}, {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1}, {&__pyx_n_s_starts, __pyx_k_starts, sizeof(__pyx_k_starts), 0, 0, 1, 1}, {&__pyx_n_s_startswith, __pyx_k_startswith, sizeof(__pyx_k_startswith), 0, 0, 1, 1}, {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1}, {&__pyx_n_s_staticmethod, __pyx_k_staticmethod, sizeof(__pyx_k_staticmethod), 0, 0, 1, 1}, {&__pyx_n_s_staticproperty, __pyx_k_staticproperty, sizeof(__pyx_k_staticproperty), 0, 0, 1, 1}, {&__pyx_n_s_staticproperty___get, __pyx_k_staticproperty___get, sizeof(__pyx_k_staticproperty___get), 0, 0, 1, 1}, {&__pyx_n_s_stderr, __pyx_k_stderr, sizeof(__pyx_k_stderr), 0, 0, 1, 1}, {&__pyx_n_s_stderr_2, __pyx_k_stderr_2, sizeof(__pyx_k_stderr_2), 0, 0, 1, 1}, {&__pyx_n_s_stdout, __pyx_k_stdout, sizeof(__pyx_k_stdout), 0, 0, 1, 1}, {&__pyx_n_s_stdout_2, __pyx_k_stdout_2, sizeof(__pyx_k_stdout_2), 0, 0, 1, 1}, {&__pyx_n_s_stdout_is_stderr, __pyx_k_stdout_is_stderr, sizeof(__pyx_k_stdout_is_stderr), 0, 0, 1, 1}, {&__pyx_n_s_stencil_type, __pyx_k_stencil_type, sizeof(__pyx_k_stencil_type), 0, 0, 1, 1}, {&__pyx_n_s_stencil_width, __pyx_k_stencil_width, sizeof(__pyx_k_stencil_width), 0, 0, 1, 1}, {&__pyx_n_s_stenciltype, __pyx_k_stenciltype, sizeof(__pyx_k_stenciltype), 0, 0, 1, 1}, {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1}, {&__pyx_n_s_stepTranspose, __pyx_k_stepTranspose, sizeof(__pyx_k_stepTranspose), 0, 0, 1, 1}, {&__pyx_n_s_step_number, __pyx_k_step_number, sizeof(__pyx_k_step_number), 0, 0, 1, 1}, {&__pyx_n_s_stol, __pyx_k_stol, sizeof(__pyx_k_stol), 0, 0, 1, 1}, {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1}, {&__pyx_n_s_str, __pyx_k_str, sizeof(__pyx_k_str), 0, 0, 1, 1}, {&__pyx_n_s_strata, __pyx_k_strata, sizeof(__pyx_k_strata), 0, 0, 1, 1}, {&__pyx_n_s_stratum, __pyx_k_stratum, sizeof(__pyx_k_stratum), 0, 0, 1, 1}, {&__pyx_n_s_stream, __pyx_k_stream, sizeof(__pyx_k_stream), 0, 0, 1, 1}, {&__pyx_n_s_stream_type, __pyx_k_stream_type, sizeof(__pyx_k_stream_type), 0, 0, 1, 1}, {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0}, {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect, sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0}, {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0}, {&__pyx_n_s_strides, __pyx_k_strides, sizeof(__pyx_k_strides), 0, 0, 1, 1}, {&__pyx_n_s_string, __pyx_k_string, sizeof(__pyx_k_string), 0, 0, 1, 1}, {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0}, {&__pyx_n_s_strip, __pyx_k_strip, sizeof(__pyx_k_strip), 0, 0, 1, 1}, {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1}, {&__pyx_n_s_structure, __pyx_k_structure, sizeof(__pyx_k_structure), 0, 0, 1, 1}, {&__pyx_n_s_sub, __pyx_k_sub, sizeof(__pyx_k_sub), 0, 0, 1, 1}, {&__pyx_n_s_subcomm, __pyx_k_subcomm, sizeof(__pyx_k_subcomm), 0, 0, 1, 1}, {&__pyx_n_s_subdm, __pyx_k_subdm, sizeof(__pyx_k_subdm), 0, 0, 1, 1}, {&__pyx_n_s_submat, __pyx_k_submat, sizeof(__pyx_k_submat), 0, 0, 1, 1}, {&__pyx_n_s_submats, __pyx_k_submats, sizeof(__pyx_k_submats), 0, 0, 1, 1}, {&__pyx_n_s_subminor, __pyx_k_subminor, sizeof(__pyx_k_subminor), 0, 0, 1, 1}, {&__pyx_n_s_subsp, __pyx_k_subsp, sizeof(__pyx_k_subsp), 0, 0, 1, 1}, {&__pyx_n_s_subspaceOffsets, __pyx_k_subspaceOffsets, sizeof(__pyx_k_subspaceOffsets), 0, 0, 1, 1}, {&__pyx_n_s_subvec, __pyx_k_subvec, sizeof(__pyx_k_subvec), 0, 0, 1, 1}, {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1}, {&__pyx_n_s_supp, __pyx_k_supp, sizeof(__pyx_k_supp), 0, 0, 1, 1}, {&__pyx_n_s_svalue, __pyx_k_svalue, sizeof(__pyx_k_svalue), 0, 0, 1, 1}, {&__pyx_n_s_swidth, __pyx_k_swidth, sizeof(__pyx_k_swidth), 0, 0, 1, 1}, {&__pyx_n_s_sx, __pyx_k_sx, sizeof(__pyx_k_sx), 0, 0, 1, 1}, {&__pyx_n_s_sym, __pyx_k_sym, sizeof(__pyx_k_sym), 0, 0, 1, 1}, {&__pyx_n_s_symmetric, __pyx_k_symmetric, sizeof(__pyx_k_symmetric), 0, 0, 1, 1}, {&__pyx_n_s_syncFlush, __pyx_k_syncFlush, sizeof(__pyx_k_syncFlush), 0, 0, 1, 1}, {&__pyx_n_s_syncPrint, __pyx_k_syncPrint, sizeof(__pyx_k_syncPrint), 0, 0, 1, 1}, {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1}, {&__pyx_n_s_t, __pyx_k_t, sizeof(__pyx_k_t), 0, 0, 1, 1}, {&__pyx_n_s_tab, __pyx_k_tab, sizeof(__pyx_k_tab), 0, 0, 1, 1}, {&__pyx_n_s_tabs, __pyx_k_tabs, sizeof(__pyx_k_tabs), 0, 0, 1, 1}, {&__pyx_n_s_tao, __pyx_k_tao, sizeof(__pyx_k_tao), 0, 0, 1, 1}, {&__pyx_n_s_tao_type, __pyx_k_tao_type, sizeof(__pyx_k_tao_type), 0, 0, 1, 1}, {&__pyx_n_s_targetComplexity, __pyx_k_targetComplexity, sizeof(__pyx_k_targetComplexity), 0, 0, 1, 1}, {&__pyx_n_s_tbline, __pyx_k_tbline, sizeof(__pyx_k_tbline), 0, 0, 1, 1}, {&__pyx_n_s_tblist, __pyx_k_tblist, sizeof(__pyx_k_tblist), 0, 0, 1, 1}, {&__pyx_n_s_tensor, __pyx_k_tensor, sizeof(__pyx_k_tensor), 0, 0, 1, 1}, {&__pyx_n_s_terminate, __pyx_k_terminate, sizeof(__pyx_k_terminate), 0, 0, 1, 1}, {&__pyx_n_s_theta, __pyx_k_theta, sizeof(__pyx_k_theta), 0, 0, 1, 1}, {&__pyx_n_s_threshold, __pyx_k_threshold, sizeof(__pyx_k_threshold), 0, 0, 1, 1}, {&__pyx_n_s_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 0, 1, 1}, {&__pyx_n_s_time_step, __pyx_k_time_step, sizeof(__pyx_k_time_step), 0, 0, 1, 1}, {&__pyx_n_s_timestep, __pyx_k_timestep, sizeof(__pyx_k_timestep), 0, 0, 1, 1}, {&__pyx_n_s_title, __pyx_k_title, sizeof(__pyx_k_title), 0, 0, 1, 1}, {&__pyx_n_s_toAll, __pyx_k_toAll, sizeof(__pyx_k_toAll), 0, 0, 1, 1}, {&__pyx_n_s_toDLPack, __pyx_k_toDLPack, sizeof(__pyx_k_toDLPack), 0, 0, 1, 1}, {&__pyx_n_s_toZero, __pyx_k_toZero, sizeof(__pyx_k_toZero), 0, 0, 1, 1}, {&__pyx_n_s_toindx, __pyx_k_toindx, sizeof(__pyx_k_toindx), 0, 0, 1, 1}, {&__pyx_n_s_tol, __pyx_k_tol, sizeof(__pyx_k_tol), 0, 0, 1, 1}, {&__pyx_n_s_tr_type, __pyx_k_tr_type, sizeof(__pyx_k_tr_type), 0, 0, 1, 1}, {&__pyx_n_s_traceback, __pyx_k_traceback, sizeof(__pyx_k_traceback), 0, 0, 1, 1}, {&__pyx_n_s_traceback_2, __pyx_k_traceback_2, sizeof(__pyx_k_traceback_2), 0, 0, 1, 1}, {&__pyx_n_s_trans, __pyx_k_trans, sizeof(__pyx_k_trans), 0, 0, 1, 1}, {&__pyx_n_s_transpose, __pyx_k_transpose, sizeof(__pyx_k_transpose), 0, 0, 1, 1}, {&__pyx_n_s_trimmed, __pyx_k_trimmed, sizeof(__pyx_k_trimmed), 0, 0, 1, 1}, {&__pyx_n_s_ts_type, __pyx_k_ts_type, sizeof(__pyx_k_ts_type), 0, 0, 1, 1}, {&__pyx_n_s_tspan, __pyx_k_tspan, sizeof(__pyx_k_tspan), 0, 0, 1, 1}, {&__pyx_n_s_twist, __pyx_k_twist, sizeof(__pyx_k_twist), 0, 0, 1, 1}, {&__pyx_n_s_typ, __pyx_k_typ, sizeof(__pyx_k_typ), 0, 0, 1, 1}, {&__pyx_n_s_type_registry, __pyx_k_type_registry, sizeof(__pyx_k_type_registry), 0, 0, 1, 1}, {&__pyx_n_s_typestr, __pyx_k_typestr, sizeof(__pyx_k_typestr), 0, 0, 1, 1}, {&__pyx_n_s_u, __pyx_k_u, sizeof(__pyx_k_u), 0, 0, 1, 1}, {&__pyx_n_s_ua, __pyx_k_ua, sizeof(__pyx_k_ua), 0, 0, 1, 1}, {&__pyx_n_s_uaux, __pyx_k_uaux, sizeof(__pyx_k_uaux), 0, 0, 1, 1}, {&__pyx_n_s_uis, __pyx_k_uis, sizeof(__pyx_k_uis), 0, 0, 1, 1}, {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data, sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0}, {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str, sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0}, {&__pyx_kp_s_unhandled_PetscDeviceContextJoin, __pyx_k_unhandled_PetscDeviceContextJoin, sizeof(__pyx_k_unhandled_PetscDeviceContextJoin), 0, 0, 1, 0}, {&__pyx_kp_s_unhandled_PetscDeviceType_d, __pyx_k_unhandled_PetscDeviceType_d, sizeof(__pyx_k_unhandled_PetscDeviceType_d), 0, 0, 1, 0}, {&__pyx_kp_s_unhandled_PetscStreamType_d, __pyx_k_unhandled_PetscStreamType_d, sizeof(__pyx_k_unhandled_PetscStreamType_d), 0, 0, 1, 0}, {&__pyx_n_s_uniform, __pyx_k_uniform, sizeof(__pyx_k_uniform), 0, 0, 1, 1}, {&__pyx_n_s_unit, __pyx_k_unit, sizeof(__pyx_k_unit), 0, 0, 1, 1}, {&__pyx_kp_s_unknown_boundary_type_s, __pyx_k_unknown_boundary_type_s, sizeof(__pyx_k_unknown_boundary_type_s), 0, 0, 1, 0}, {&__pyx_kp_s_unknown_device_type_s, __pyx_k_unknown_device_type_s, sizeof(__pyx_k_unknown_device_type_s), 0, 0, 1, 0}, {&__pyx_kp_s_unknown_element_type_s, __pyx_k_unknown_element_type_s, sizeof(__pyx_k_unknown_element_type_s), 0, 0, 1, 0}, {&__pyx_kp_u_unknown_error_handler, __pyx_k_unknown_error_handler, sizeof(__pyx_k_unknown_error_handler), 0, 1, 0, 0}, {&__pyx_kp_s_unknown_interpolation_type_s, __pyx_k_unknown_interpolation_type_s, sizeof(__pyx_k_unknown_interpolation_type_s), 0, 0, 1, 0}, {&__pyx_kp_s_unknown_join_mode_s, __pyx_k_unknown_join_mode_s, sizeof(__pyx_k_unknown_join_mode_s), 0, 0, 1, 0}, {&__pyx_kp_s_unknown_options_s, __pyx_k_unknown_options_s, sizeof(__pyx_k_unknown_options_s), 0, 0, 1, 0}, {&__pyx_kp_s_unknown_scatter_mode_s, __pyx_k_unknown_scatter_mode_s, sizeof(__pyx_k_unknown_scatter_mode_s), 0, 0, 1, 0}, {&__pyx_kp_s_unknown_shift_type_s, __pyx_k_unknown_shift_type_s, sizeof(__pyx_k_unknown_shift_type_s), 0, 0, 1, 0}, {&__pyx_kp_s_unknown_stencil_location_type_s, __pyx_k_unknown_stencil_location_type_s, sizeof(__pyx_k_unknown_stencil_location_type_s), 0, 0, 1, 0}, {&__pyx_kp_s_unknown_stencil_type_s, __pyx_k_unknown_stencil_type_s, sizeof(__pyx_k_unknown_stencil_type_s), 0, 0, 1, 0}, {&__pyx_kp_s_unknown_stream_type_s, __pyx_k_unknown_stream_type_s, sizeof(__pyx_k_unknown_stream_type_s), 0, 0, 1, 0}, {&__pyx_n_s_unnamed, __pyx_k_unnamed, sizeof(__pyx_k_unnamed), 0, 0, 1, 1}, {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1}, {&__pyx_n_s_up, __pyx_k_up, sizeof(__pyx_k_up), 0, 0, 1, 1}, {&__pyx_n_s_up_left, __pyx_k_up_left, sizeof(__pyx_k_up_left), 0, 0, 1, 1}, {&__pyx_n_s_up_right, __pyx_k_up_right, sizeof(__pyx_k_up_right), 0, 0, 1, 1}, {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1}, {&__pyx_n_s_upper, __pyx_k_upper, sizeof(__pyx_k_upper), 0, 0, 1, 1}, {&__pyx_n_s_useAnchors, __pyx_k_useAnchors, sizeof(__pyx_k_useAnchors), 0, 0, 1, 1}, {&__pyx_n_s_useClosure, __pyx_k_useClosure, sizeof(__pyx_k_useClosure), 0, 0, 1, 1}, {&__pyx_n_s_useCone, __pyx_k_useCone, sizeof(__pyx_k_useCone), 0, 0, 1, 1}, {&__pyx_n_s_useInitialGuess, __pyx_k_useInitialGuess, sizeof(__pyx_k_useInitialGuess), 0, 0, 1, 1}, {&__pyx_n_s_v, __pyx_k_v, sizeof(__pyx_k_v), 0, 0, 1, 1}, {&__pyx_n_s_val, __pyx_k_val, sizeof(__pyx_k_val), 0, 0, 1, 1}, {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1}, {&__pyx_kp_s_values_must_have_two_or_more_dim, __pyx_k_values_must_have_two_or_more_dim, sizeof(__pyx_k_values_must_have_two_or_more_dim), 0, 0, 1, 0}, {&__pyx_n_s_varbounds, __pyx_k_varbounds, sizeof(__pyx_k_varbounds), 0, 0, 1, 1}, {&__pyx_n_s_vec, __pyx_k_vec, sizeof(__pyx_k_vec), 0, 0, 1, 1}, {&__pyx_n_s_vecTo, __pyx_k_vecTo, sizeof(__pyx_k_vecTo), 0, 0, 1, 1}, {&__pyx_n_s_vec_from, __pyx_k_vec_from, sizeof(__pyx_k_vec_from), 0, 0, 1, 1}, {&__pyx_n_s_vec_to, __pyx_k_vec_to, sizeof(__pyx_k_vec_to), 0, 0, 1, 1}, {&__pyx_n_s_vec_type, __pyx_k_vec_type, sizeof(__pyx_k_vec_type), 0, 0, 1, 1}, {&__pyx_n_s_vecs, __pyx_k_vecs, sizeof(__pyx_k_vecs), 0, 0, 1, 1}, {&__pyx_n_s_vectors, __pyx_k_vectors, sizeof(__pyx_k_vectors), 0, 0, 1, 1}, {&__pyx_n_s_verbosity, __pyx_k_verbosity, sizeof(__pyx_k_verbosity), 0, 0, 1, 1}, {&__pyx_n_s_version, __pyx_k_version, sizeof(__pyx_k_version), 0, 0, 1, 1}, {&__pyx_n_s_version_info, __pyx_k_version_info, sizeof(__pyx_k_version_info), 0, 0, 1, 1}, {&__pyx_n_s_vg, __pyx_k_vg, sizeof(__pyx_k_vg), 0, 0, 1, 1}, {&__pyx_n_s_viennaclvechandle, __pyx_k_viennaclvechandle, sizeof(__pyx_k_viennaclvechandle), 0, 0, 1, 1}, {&__pyx_n_s_view, __pyx_k_view, sizeof(__pyx_k_view), 0, 0, 1, 1}, {&__pyx_n_s_viewer, __pyx_k_viewer, sizeof(__pyx_k_viewer), 0, 0, 1, 1}, {&__pyx_n_s_vl, __pyx_k_vl, sizeof(__pyx_k_vl), 0, 0, 1, 1}, {&__pyx_n_s_vlg, __pyx_k_vlg, sizeof(__pyx_k_vlg), 0, 0, 1, 1}, {&__pyx_n_s_vm, __pyx_k_vm, sizeof(__pyx_k_vm), 0, 0, 1, 1}, {&__pyx_n_s_vn, __pyx_k_vn, sizeof(__pyx_k_vn), 0, 0, 1, 1}, {&__pyx_n_s_vtol, __pyx_k_vtol, sizeof(__pyx_k_vtol), 0, 0, 1, 1}, {&__pyx_n_s_vwr_type, __pyx_k_vwr_type, sizeof(__pyx_k_vwr_type), 0, 0, 1, 1}, {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1}, {&__pyx_kp_s_w_2, __pyx_k_w_2, sizeof(__pyx_k_w_2), 0, 0, 1, 0}, {&__pyx_n_s_weight, __pyx_k_weight, sizeof(__pyx_k_weight), 0, 0, 1, 1}, {&__pyx_n_s_width, __pyx_k_width, sizeof(__pyx_k_width), 0, 0, 1, 1}, {&__pyx_n_s_wrapped_func, __pyx_k_wrapped_func, sizeof(__pyx_k_wrapped_func), 0, 0, 1, 1}, {&__pyx_n_s_wraps, __pyx_k_wraps, sizeof(__pyx_k_wraps), 0, 0, 1, 1}, {&__pyx_n_s_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 0, 1, 1}, {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, {&__pyx_n_s_xdot, __pyx_k_xdot, sizeof(__pyx_k_xdot), 0, 0, 1, 1}, {&__pyx_n_s_xdotdot, __pyx_k_xdotdot, sizeof(__pyx_k_xdotdot), 0, 0, 1, 1}, {&__pyx_n_s_xl, __pyx_k_xl, sizeof(__pyx_k_xl), 0, 0, 1, 1}, {&__pyx_n_s_xmax, __pyx_k_xmax, sizeof(__pyx_k_xmax), 0, 0, 1, 1}, {&__pyx_n_s_xmin, __pyx_k_xmin, sizeof(__pyx_k_xmin), 0, 0, 1, 1}, {&__pyx_n_s_xnorm, __pyx_k_xnorm, sizeof(__pyx_k_xnorm), 0, 0, 1, 1}, {&__pyx_n_s_xu, __pyx_k_xu, sizeof(__pyx_k_xu), 0, 0, 1, 1}, {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1}, {&__pyx_n_s_ymax, __pyx_k_ymax, sizeof(__pyx_k_ymax), 0, 0, 1, 1}, {&__pyx_n_s_ymin, __pyx_k_ymin, sizeof(__pyx_k_ymin), 0, 0, 1, 1}, {&__pyx_n_s_ynorm, __pyx_k_ynorm, sizeof(__pyx_k_ynorm), 0, 0, 1, 1}, {&__pyx_n_s_zeroEntries, __pyx_k_zeroEntries, sizeof(__pyx_k_zeroEntries), 0, 0, 1, 1}, {&__pyx_n_s_zeroRowsColumns, __pyx_k_zeroRowsColumns, sizeof(__pyx_k_zeroRowsColumns), 0, 0, 1, 1}, {&__pyx_n_s_zeropivot, __pyx_k_zeropivot, sizeof(__pyx_k_zeropivot), 0, 0, 1, 1}, {&__pyx_n_s_zmax, __pyx_k_zmax, sizeof(__pyx_k_zmax), 0, 0, 1, 1}, {&__pyx_n_s_zmin, __pyx_k_zmin, sizeof(__pyx_k_zmin), 0, 0, 1, 1}, {&__pyx_n_s_zoz, __pyx_k_zoz, sizeof(__pyx_k_zoz), 0, 0, 1, 1}, {&__pyx_n_s_zzo, __pyx_k_zzo, sizeof(__pyx_k_zzo), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; return __Pyx_InitStrings(__pyx_string_tab); } /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 37, __pyx_L1_error) __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(1, 3, __pyx_L1_error) __pyx_builtin_property = __Pyx_GetBuiltinName(__pyx_n_s_property); if (!__pyx_builtin_property) __PYX_ERR(2, 3, __pyx_L1_error) __pyx_builtin_staticmethod = __Pyx_GetBuiltinName(__pyx_n_s_staticmethod); if (!__pyx_builtin_staticmethod) __PYX_ERR(2, 191, __pyx_L1_error) __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(3, 58, __pyx_L1_error) __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(4, 46, __pyx_L1_error) __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(4, 68, __pyx_L1_error) __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) __PYX_ERR(5, 71, __pyx_L1_error) __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(5, 79, __pyx_L1_error) __pyx_builtin_SystemError = __Pyx_GetBuiltinName(__pyx_n_s_SystemError); if (!__pyx_builtin_SystemError) __PYX_ERR(6, 202, __pyx_L1_error) __pyx_builtin_NotImplemented = __Pyx_GetBuiltinName(__pyx_n_s_NotImplemented); if (!__pyx_builtin_NotImplemented) __PYX_ERR(7, 321, __pyx_L1_error) __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(7, 440, __pyx_L1_error) __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_n_s_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(8, 759, __pyx_L1_error) __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(9, 485, __pyx_L1_error) __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(10, 293, __pyx_L1_error) __pyx_builtin_open = __Pyx_GetBuiltinName(__pyx_n_s_open); if (!__pyx_builtin_open) __PYX_ERR(11, 161, __pyx_L1_error) __pyx_builtin_compile = __Pyx_GetBuiltinName(__pyx_n_s_compile); if (!__pyx_builtin_compile) __PYX_ERR(11, 162, __pyx_L1_error) __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(12, 370, __pyx_L1_error) __pyx_builtin___import__ = __Pyx_GetBuiltinName(__pyx_n_s_import); if (!__pyx_builtin___import__) __PYX_ERR(13, 100, __pyx_L1_error) __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(13, 618, __pyx_L1_error) __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(13, 914, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: cached_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "View.MemoryView":582 * def suboffsets(self): * if self.view.suboffsets == NULL: * return (-1,) * self.view.ndim # <<<<<<<<<<<<<< * * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) */ __pyx_tuple__4 = PyTuple_New(1); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(13, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_INCREF(__pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_tuple__4, 0, __pyx_int_neg_1)) __PYX_ERR(13, 582, __pyx_L1_error); __Pyx_GIVEREF(__pyx_tuple__4); /* "View.MemoryView":679 * tup = index if isinstance(index, tuple) else (index,) * * result = [slice(None)] * ndim # <<<<<<<<<<<<<< * have_slices = False * seen_ellipsis = False */ __pyx_slice__5 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__5)) __PYX_ERR(13, 679, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__5); __Pyx_GIVEREF(__pyx_slice__5); /* "(tree fragment)":4 * cdef object __pyx_PickleError * cdef object __pyx_result * if __pyx_checksum not in (0x82a3537, 0x6ae9995, 0xb068931): # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum */ __pyx_tuple__8 = PyTuple_Pack(3, __pyx_int_136983863, __pyx_int_112105877, __pyx_int_184977713); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(13, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); /* "petsc4py/PETSc/petscopt.pxi":46 * prefix = prefix.getOptionsPrefix() * elif not isinstance(prefix, str): * raise TypeError('option prefix must be string') # <<<<<<<<<<<<<< * if not prefix: * return None */ __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_option_prefix_must_be_string); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(4, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__15); __Pyx_GIVEREF(__pyx_tuple__15); /* "petsc4py/PETSc/petscopt.pxi":50 * return None * if prefix.count(' '): * raise ValueError('option prefix should not have spaces') # <<<<<<<<<<<<<< * if prefix.startswith('-'): * raise ValueError('option prefix should not start with a hyphen') */ __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_option_prefix_should_not_have_sp); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(4, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__17); __Pyx_GIVEREF(__pyx_tuple__17); /* "petsc4py/PETSc/petscopt.pxi":52 * raise ValueError('option prefix should not have spaces') * if prefix.startswith('-'): * raise ValueError('option prefix should not start with a hyphen') # <<<<<<<<<<<<<< * return prefix * */ __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_option_prefix_should_not_start_w); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(4, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__19); __Pyx_GIVEREF(__pyx_tuple__19); /* "petsc4py/PETSc/petscopt.pxi":175 * if not iskey(key): * return None * key = key[1:] # <<<<<<<<<<<<<< * if key[0] == '-': * key = key[1:] */ __pyx_slice__20 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__20)) __PYX_ERR(4, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__20); __Pyx_GIVEREF(__pyx_slice__20); /* "petsc4py/PETSc/petscmpi.pxi":121 * * cdef inline int comm_size(MPI_Comm comm) except ? -1: * if comm == MPI_COMM_NULL: raise ValueError("null communicator") # <<<<<<<<<<<<<< * cdef int size = 0 * CHKERR( MPI_Comm_size(comm, &size) ) */ __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_null_communicator); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(17, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__21); __Pyx_GIVEREF(__pyx_tuple__21); /* "petsc4py/PETSc/petscsys.pxi":79 * if (bs < 1): raise ValueError( * "block size %d must be positive" % toInt(bs)) * if n==PETSC_DECIDE and N==PETSC_DECIDE: raise ValueError( # <<<<<<<<<<<<<< * "local and global sizes cannot be both 'DECIDE'") * if (n > 0) and (n % bs): raise ValueError( */ __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_local_and_global_sizes_cannot_be); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(18, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__22); __Pyx_GIVEREF(__pyx_tuple__22); /* "petsc4py/PETSc/petscis.pxi":202 * * def __getreadbuffer__(self, Py_ssize_t idx, void **p): * if idx != 0: raise SystemError( # <<<<<<<<<<<<<< * "accessing non-existent buffer segment") * return self.getbuffer(p) */ __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_accessing_non_existent_buffer_se); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(6, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__23); __Pyx_GIVEREF(__pyx_tuple__23); /* "petsc4py/PETSc/petscvec.pxi":598 * if idx != 0: raise SystemError( * "accessing non-existent buffer segment") * if self.readonly: raise TypeError( # <<<<<<<<<<<<<< * "Object is not writable.") * return self.getbuffer(p) */ __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_Object_is_not_writable); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(7, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__24); __Pyx_GIVEREF(__pyx_tuple__24); /* "petsc4py/PETSc/petscmat.pxi":936 * ("row indices must have two dimensions: " * "rows.ndim=%d") % (PyArray_NDIM(ai)) ) * elif not PyArray_ISCONTIGUOUS(ai): raise ValueError( # <<<<<<<<<<<<<< * "expecting a C-contiguous array") * if PyArray_NDIM(aj) != 2: raise ValueError( */ __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_expecting_a_C_contiguous_array); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(8, 936, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__25); __Pyx_GIVEREF(__pyx_tuple__25); /* "petsc4py/PETSc/Sys.pyx":53 * vstr = bytes2str(cversion) * if release != 0: * date = vstr.split(",", 1)[-1].strip() # <<<<<<<<<<<<<< * else: * date = vstr.split("GIT Date:")[-1].strip() */ __pyx_tuple__27 = PyTuple_Pack(2, __pyx_kp_s__14, __pyx_int_1); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(32, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__27); __Pyx_GIVEREF(__pyx_tuple__27); /* "petsc4py/PETSc/Sys.pyx":79 * * """ * version, dev, date, author = cls.getVersion(True, True, True) # <<<<<<<<<<<<<< * return dict(major = version[0], * minor = version[1], */ __pyx_tuple__28 = PyTuple_Pack(3, Py_True, Py_True, Py_True); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(32, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__28); __Pyx_GIVEREF(__pyx_tuple__28); /* "petsc4py/PETSc/Sys.pyx":189 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * if comm_rank(ccomm) == 0: * if not args: args = ('',) # <<<<<<<<<<<<<< * format = ['%s', sep] * len(args) * format[-1] = end */ __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s__10); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(32, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__29); __Pyx_GIVEREF(__pyx_tuple__29); /* "petsc4py/PETSc/Sys.pyx":448 * * """ * if not citation: raise ValueError("empty citation") # <<<<<<<<<<<<<< * cdef const char *cit = NULL * citation = str2bytes(citation, &cit) */ __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_empty_citation); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(32, 448, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__30); __Pyx_GIVEREF(__pyx_tuple__30); /* "petsc4py/PETSc/Log.pyx":13 * @classmethod * def Stage(cls, name): * if not name: raise ValueError("empty name") # <<<<<<<<<<<<<< * cdef const char *cname = NULL * name = str2bytes(name, &cname) */ __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_empty_name); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(33, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__31); __Pyx_GIVEREF(__pyx_tuple__31); /* "petsc4py/PETSc/Log.pyx":188 * else: * name_ = ".".join([func.__module__, getattr(func, "__qualname__", func.__name__)]) * with cls.Event(name_, klass): # <<<<<<<<<<<<<< * return func(*args, **kwargs) * return wrapped_func */ __pyx_tuple__32 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(33, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__32); __Pyx_GIVEREF(__pyx_tuple__32); /* "petsc4py/PETSc/Log.pyx":182 * """Decorate a function with a `PETSc` event.""" * def decorator(func): * @functools.wraps(func) # <<<<<<<<<<<<<< * def wrapped_func(*args, **kwargs): * if name: */ __pyx_tuple__33 = PyTuple_Pack(3, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_name_3); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(33, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__33); __Pyx_GIVEREF(__pyx_tuple__33); __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_petsc4py_PETSc_Log_pyx, __pyx_n_s_wrapped_func, 182, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(33, 182, __pyx_L1_error) /* "petsc4py/PETSc/Log.pyx":181 * def EventDecorator(cls, name=None, klass=None): * """Decorate a function with a `PETSc` event.""" * def decorator(func): # <<<<<<<<<<<<<< * @functools.wraps(func) * def wrapped_func(*args, **kwargs): */ __pyx_tuple__35 = PyTuple_Pack(3, __pyx_n_s_func, __pyx_n_s_wrapped_func, __pyx_n_s_wrapped_func); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(33, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__35); __Pyx_GIVEREF(__pyx_tuple__35); __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_petsc4py_PETSc_Log_pyx, __pyx_n_s_decorator, 181, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(33, 181, __pyx_L1_error) /* "petsc4py/PETSc/Log.pyx":267 * def __set__(self, value): * self; value; # unused * raise TypeError("readonly attribute") # <<<<<<<<<<<<<< * * # */ __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_readonly_attribute); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(33, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__37); __Pyx_GIVEREF(__pyx_tuple__37); /* "petsc4py/PETSc/Comm.pyx":41 * if not isinstance(self, Comm): return NotImplemented * if not isinstance(other, Comm): return NotImplemented * if op!=2 and op!=3: raise TypeError("only '==' and '!='") # <<<<<<<<<<<<<< * cdef Comm s = self * cdef Comm o = other */ __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_s_only_and); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(34, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__38); __Pyx_GIVEREF(__pyx_tuple__38); /* "petsc4py/PETSc/Comm.pyx":73 * if self.comm == MPI_COMM_NULL: return * if not self.isdup: * raise ValueError("communicator not owned") # <<<<<<<<<<<<<< * CHKERR( PetscCommDestroy(&self.comm) ) * self.comm = MPI_COMM_NULL */ __pyx_tuple__39 = PyTuple_Pack(1, __pyx_kp_s_communicator_not_owned); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(34, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__39); __Pyx_GIVEREF(__pyx_tuple__39); /* "petsc4py/PETSc/Device.pyx":17 * attrs['__enum2str'] = enum2str * attrs['__doc__'] = class_docstring * return type(class_name, (object, ), attrs) # <<<<<<<<<<<<<< * * DeviceType = make_enum_class( */ __pyx_tuple__40 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(2, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__40); __Pyx_GIVEREF(__pyx_tuple__40); /* "petsc4py/PETSc/Vec.pyx":613 * PyCapsule_SetName(dltensor, 'used_dltensor') * else: * raise ValueError("Expect a dltensor field, pycapsule.PyCapsule can only be consumed once") # <<<<<<<<<<<<<< * if size is None: size = (toInt(nz), toInt(PETSC_DECIDE)) * Vec_Sizes(size, bsize, &bs, &n, &N) */ __pyx_tuple__42 = PyTuple_Pack(1, __pyx_kp_s_Expect_a_dltensor_field_pycapsul); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(41, 613, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__42); __Pyx_GIVEREF(__pyx_tuple__42); /* "petsc4py/PETSc/Vec.pyx":691 * * if vec is None and dltensor is None: * raise ValueError('Missing input parameters') # <<<<<<<<<<<<<< * if vec is not None: * ctx = (vec).get_attr('__dltensor_ctx__') */ __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_s_Missing_input_parameters); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(41, 691, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__43); __Pyx_GIVEREF(__pyx_tuple__43); /* "petsc4py/PETSc/Vec.pyx":695 * ctx = (vec).get_attr('__dltensor_ctx__') * if ctx is None: * raise ValueError('Input vector has no tensor information') # <<<<<<<<<<<<<< * self.set_attr('__dltensor_ctx__', ctx) * else: */ __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_s_Input_vector_has_no_tensor_infor); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(41, 695, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__44); __Pyx_GIVEREF(__pyx_tuple__44); /* "petsc4py/PETSc/Vec.pyx":703 * ptr = PyCapsule_GetPointer(dltensor, 'used_dltensor') * else: * raise ValueError("Expect a dltensor or used_dltensor field") # <<<<<<<<<<<<<< * bits = ptr.dl_tensor.dtype.bits * if bits != 8*sizeof(PetscScalar): */ __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_s_Expect_a_dltensor_or_used_dltens); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(41, 703, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__45); __Pyx_GIVEREF(__pyx_tuple__45); /* "petsc4py/PETSc/Vec.pyx":766 * if mode is None: mode = 'rw' * if mode not in ['rw', 'r', 'w']: * raise ValueError("Invalid mode: expected 'rw', 'r', or 'w'") # <<<<<<<<<<<<<< * * cdef int64_t ndim = 0 */ __pyx_tuple__46 = PyTuple_Pack(1, __pyx_kp_s_Invalid_mode_expected_rw_r_or_w); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(41, 766, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__46); __Pyx_GIVEREF(__pyx_tuple__46); /* "petsc4py/PETSc/Vec.pyx":824 * dtype.bits = 32 * else: * raise ValueError('Unsupported PetscScalar type') # <<<<<<<<<<<<<< * dtype.lanes = 1 * dlm_tensor.manager_ctx = self.vec */ __pyx_tuple__47 = PyTuple_Pack(1, __pyx_kp_s_Unsupported_PetscScalar_type); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(41, 824, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__47); __Pyx_GIVEREF(__pyx_tuple__47); /* "petsc4py/PETSc/Vec.pyx":1689 * CHKERR( VecViennaCLGetCLMemWrite(self.vec, &memhdl) ) * else: * raise ValueError("Invalid mode: expected 'r', 'w' or 'rw'") # <<<<<<<<<<<<<< * return memhdl * */ __pyx_tuple__48 = PyTuple_Pack(1, __pyx_kp_s_Invalid_mode_expected_r_w_or_rw); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(41, 1689, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__48); __Pyx_GIVEREF(__pyx_tuple__48); /* "petsc4py/PETSc/Mat.pyx":1449 * nvtx = PyArray_DIM(xyz, 0) * CHKERR( MatGetLocalSize(A.mat, &rl, &cl) ) * if cl != rl: raise ValueError("Not for rectangular matrices") # <<<<<<<<<<<<<< * if nvtx < rl: raise ValueError( * ("coordinates size must be at least %d" % rl )) */ __pyx_tuple__51 = PyTuple_Pack(1, __pyx_kp_s_Not_for_rectangular_matrices); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(46, 1449, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__51); __Pyx_GIVEREF(__pyx_tuple__51); /* "petsc4py/PETSc/Mat.pyx":3564 * cdef ndarray ibdiag = array_s(m*bs, cibdiag) * ibdiag.shape = (toInt(m//bs), toInt(bs), toInt(bs)) * return ibdiag.transpose(0, 2, 1) # <<<<<<<<<<<<<< * * # null space */ __pyx_tuple__52 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_2, __pyx_int_1); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(46, 3564, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__52); __Pyx_GIVEREF(__pyx_tuple__52); /* "petsc4py/PETSc/PC.pyx":2382 * * if typ in {PC.PatchConstructType.PYTHON, PC.PatchConstructType.USER} and operator is None: * raise ValueError("Must provide operator for USER or PYTHON type") # <<<<<<<<<<<<<< * if operator is not None: * context = (operator, args, kargs) */ __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_s_Must_provide_operator_for_USER_o); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(48, 2382, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__53); __Pyx_GIVEREF(__pyx_tuple__53); /* "petsc4py/PETSc/SNES.pyx":433 * if comms is not None: * if clevels != len(comms): * raise ValueError("Must provide as many communicators as levels") # <<<<<<<<<<<<<< * CHKERR( PetscMalloc(sizeof(MPI_Comm)*clevels, &ccomms) ) * try: */ __pyx_tuple__54 = PyTuple_Pack(1, __pyx_kp_s_Must_provide_as_many_communicato); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(50, 433, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__54); __Pyx_GIVEREF(__pyx_tuple__54); /* "petsc4py/PETSc/TAO.pyx":1782 * self.setFunctionTolerances(**value) * else: * raise TypeError("expecting tuple/list or dict") # <<<<<<<<<<<<<< * * property gtol: */ __pyx_tuple__55 = PyTuple_Pack(1, __pyx_kp_s_expecting_tuple_list_or_dict); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(52, 1782, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__55); __Pyx_GIVEREF(__pyx_tuple__55); /* "petsc4py/PETSc/DMPlex.pyx":98 * return self * * def createBoxMesh(self, faces: Sequence[int], lower: Sequence[float] | None = (0,0,0), upper: Sequence[float] | None = (1,1,1), # <<<<<<<<<<<<<< * simplex: bool | None = True, periodic: Sequence | str | int | bool | None = False, interpolate: bool | None = True, comm: Comm | None = None) -> Self: * """Create a mesh on the tensor product of intervals. */ __pyx_tuple__56 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(57, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__56); __Pyx_GIVEREF(__pyx_tuple__56); __pyx_tuple__57 = PyTuple_Pack(3, __pyx_int_1, __pyx_int_1, __pyx_int_1); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(57, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__57); __Pyx_GIVEREF(__pyx_tuple__57); /* "petsc4py/PETSc/DMPlex.pyx":1147 * finally: * CHKERR( DMPlexRestoreTransitiveClosure(self.dm, cp, cuseCone, &numPoints, &points) ) * return out[::2],out[1::2] # <<<<<<<<<<<<<< * * def vecGetClosure(self, Section sec, Vec vec, p: int) -> ArrayScalar: */ __pyx_slice__58 = PySlice_New(Py_None, Py_None, __pyx_int_2); if (unlikely(!__pyx_slice__58)) __PYX_ERR(57, 1147, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__58); __Pyx_GIVEREF(__pyx_slice__58); __pyx_slice__59 = PySlice_New(__pyx_int_1, Py_None, __pyx_int_2); if (unlikely(!__pyx_slice__59)) __PYX_ERR(57, 1147, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__59); __Pyx_GIVEREF(__pyx_slice__59); /* "petsc4py/PETSc/DMPlex.pyx":1867 * bcpoints[i] = (bcPoints[i]).iset * else: * raise ValueError("bcPoints is a required argument") # <<<<<<<<<<<<<< * else: * assert bcComps is None */ __pyx_tuple__60 = PyTuple_Pack(1, __pyx_kp_s_bcPoints_is_a_required_argument); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(57, 1867, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__60); __Pyx_GIVEREF(__pyx_tuple__60); /* "petsc4py/PETSc/DMStag.pyx":832 * def getVecArray(self, Vec vec) -> None: * """**Not implemented in petsc4py.**""" * raise NotImplementedError('getVecArray for DMStag not yet implemented in petsc4py') # <<<<<<<<<<<<<< * * def get1dCoordinatecArrays(self) -> None: */ __pyx_tuple__61 = PyTuple_Pack(1, __pyx_kp_s_getVecArray_for_DMStag_not_yet_i); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(58, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__61); __Pyx_GIVEREF(__pyx_tuple__61); /* "petsc4py/PETSc/DMStag.pyx":836 * def get1dCoordinatecArrays(self) -> None: * """**Not implemented in petsc4py.**""" * raise NotImplementedError('get1dCoordinatecArrays for DMStag not yet implemented in petsc4py') # <<<<<<<<<<<<<< * * property dim: */ __pyx_tuple__62 = PyTuple_Pack(1, __pyx_kp_s_get1dCoordinatecArrays_for_DMSta); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(58, 836, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__62); __Pyx_GIVEREF(__pyx_tuple__62); /* "petsc4py/PETSc/Partitioner.pyx":181 * numProcs, toInt(nsize)) * if points is None: * raise ValueError("Must provide both sizes and points arrays") # <<<<<<<<<<<<<< * if points is not None: * points = iarray_i(points, NULL, &cpoints) */ __pyx_tuple__64 = PyTuple_Pack(1, __pyx_kp_s_Must_provide_both_sizes_and_poin); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(63, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__64); __Pyx_GIVEREF(__pyx_tuple__64); /* "petsc4py/PETSc/libpetsc4py.pyx":148 * * cdef object parse_url(object url): * path, name = url.rsplit(":", 1) # <<<<<<<<<<<<<< * return (path, name) * */ __pyx_tuple__65 = PyTuple_Pack(2, __pyx_kp_s__11, __pyx_int_1); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(11, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__65); __Pyx_GIVEREF(__pyx_tuple__65); /* "petsc4py/PETSc/libpetsc4py.pyx":263 * # package.module[.{function|class}] * if '.' in name: * modname, clsname = name.rsplit('.', 1) # <<<<<<<<<<<<<< * mod = PyImport_Import(modname) * if hasattr(mod, clsname): */ __pyx_tuple__66 = PyTuple_Pack(2, __pyx_kp_s__2, __pyx_int_1); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(11, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__66); __Pyx_GIVEREF(__pyx_tuple__66); /* "View.MemoryView":100 * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence" * try: * if __import__("sys").version_info >= (3, 3): # <<<<<<<<<<<<<< * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence * else: */ __pyx_tuple__67 = PyTuple_Pack(1, __pyx_n_s_sys); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(13, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__67); __Pyx_GIVEREF(__pyx_tuple__67); __pyx_tuple__68 = PyTuple_Pack(2, __pyx_int_3, __pyx_int_3); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(13, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__68); __Pyx_GIVEREF(__pyx_tuple__68); /* "View.MemoryView":101 * try: * if __import__("sys").version_info >= (3, 3): * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence # <<<<<<<<<<<<<< * else: * __pyx_collections_abc_Sequence = __import__("collections").Sequence */ __pyx_tuple__69 = PyTuple_Pack(1, __pyx_kp_s_collections_abc); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(13, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__69); __Pyx_GIVEREF(__pyx_tuple__69); /* "View.MemoryView":103 * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence * else: * __pyx_collections_abc_Sequence = __import__("collections").Sequence # <<<<<<<<<<<<<< * except: * */ __pyx_tuple__70 = PyTuple_Pack(1, __pyx_n_s_collections); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(13, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__70); __Pyx_GIVEREF(__pyx_tuple__70); /* "View.MemoryView":309 * return self.name * * cdef generic = Enum("") # <<<<<<<<<<<<<< * cdef strided = Enum("") # default * cdef indirect = Enum("") */ __pyx_tuple__71 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(13, 309, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__71); __Pyx_GIVEREF(__pyx_tuple__71); /* "View.MemoryView":310 * * cdef generic = Enum("") * cdef strided = Enum("") # default # <<<<<<<<<<<<<< * cdef indirect = Enum("") * */ __pyx_tuple__72 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(13, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__72); __Pyx_GIVEREF(__pyx_tuple__72); /* "View.MemoryView":311 * cdef generic = Enum("") * cdef strided = Enum("") # default * cdef indirect = Enum("") # <<<<<<<<<<<<<< * * */ __pyx_tuple__73 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(13, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__73); __Pyx_GIVEREF(__pyx_tuple__73); /* "View.MemoryView":314 * * * cdef contiguous = Enum("") # <<<<<<<<<<<<<< * cdef indirect_contiguous = Enum("") * */ __pyx_tuple__74 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(13, 314, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__74); __Pyx_GIVEREF(__pyx_tuple__74); /* "View.MemoryView":315 * * cdef contiguous = Enum("") * cdef indirect_contiguous = Enum("") # <<<<<<<<<<<<<< * * */ __pyx_tuple__75 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(13, 315, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__75); __Pyx_GIVEREF(__pyx_tuple__75); /* "(tree fragment)":1 * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ __pyx_tuple__76 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(13, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__76); __Pyx_GIVEREF(__pyx_tuple__76); __pyx_codeobj__77 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__76, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__77)) __PYX_ERR(13, 1, __pyx_L1_error) /* "petsc4py/PETSc/Const.pyx":37 * # ------------------------------------------------------------------------------ * * class InsertMode(object): # <<<<<<<<<<<<<< * """Insertion mode. * */ __pyx_tuple__78 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__78); __Pyx_GIVEREF(__pyx_tuple__78); __pyx_tuple__79 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__79); __Pyx_GIVEREF(__pyx_tuple__79); /* "petsc4py/PETSc/Const.pyx":74 * # ------------------------------------------------------------------------------ * * class ScatterMode(object): # <<<<<<<<<<<<<< * """Scatter mode. * */ __pyx_tuple__80 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__80)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__80); __Pyx_GIVEREF(__pyx_tuple__80); __pyx_tuple__81 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__81); __Pyx_GIVEREF(__pyx_tuple__81); /* "petsc4py/PETSc/Const.pyx":103 * # ------------------------------------------------------------------------------ * * class NormType(object): # <<<<<<<<<<<<<< * """Norm type. * */ __pyx_tuple__82 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__82)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__82); __Pyx_GIVEREF(__pyx_tuple__82); __pyx_tuple__83 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__83)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__83); __Pyx_GIVEREF(__pyx_tuple__83); /* "petsc4py/PETSc/Error.pyx":3 * # -------------------------------------------------------------------- * * class Error(RuntimeError): # <<<<<<<<<<<<<< * """PETSc Error. * */ __pyx_tuple__84 = PyTuple_Pack(1, __pyx_builtin_RuntimeError); if (unlikely(!__pyx_tuple__84)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__84); __Pyx_GIVEREF(__pyx_tuple__84); __pyx_tuple__85 = PyTuple_Pack(1, __pyx_builtin_RuntimeError); if (unlikely(!__pyx_tuple__85)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__85); __Pyx_GIVEREF(__pyx_tuple__85); /* "petsc4py/PETSc/Error.pyx":15 * _traceback_ = [] * * def __init__(self, int ierr=0): # <<<<<<<<<<<<<< * self.ierr = ierr * RuntimeError.__init__(self, self.ierr) */ __pyx_tuple__86 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_ierr); if (unlikely(!__pyx_tuple__86)) __PYX_ERR(1, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__86); __Pyx_GIVEREF(__pyx_tuple__86); __pyx_codeobj__87 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_petsc4py_PETSc_Error_pyx, __pyx_n_s_init, 15, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__87)) __PYX_ERR(1, 15, __pyx_L1_error) /* "petsc4py/PETSc/Error.pyx":19 * RuntimeError.__init__(self, self.ierr) * * def __bool__(self): # <<<<<<<<<<<<<< * cdef int ierr = self.ierr * return ierr != 0 */ __pyx_codeobj__88 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_petsc4py_PETSc_Error_pyx, __pyx_n_s_bool, 19, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__88)) __PYX_ERR(1, 19, __pyx_L1_error) /* "petsc4py/PETSc/Error.pyx":23 * return ierr != 0 * * def __repr__(self): # <<<<<<<<<<<<<< * return 'PETSc.Error(%d)' % self.ierr * */ __pyx_tuple__89 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__89)) __PYX_ERR(1, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__89); __Pyx_GIVEREF(__pyx_tuple__89); __pyx_codeobj__90 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__89, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_petsc4py_PETSc_Error_pyx, __pyx_n_s_repr, 23, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__90)) __PYX_ERR(1, 23, __pyx_L1_error) /* "petsc4py/PETSc/Error.pyx":26 * return 'PETSc.Error(%d)' % self.ierr * * def __str__(self): # <<<<<<<<<<<<<< * cdef int csize=1, crank=0 * if not (PetscFinalizeCalled): */ __pyx_tuple__91 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_csize, __pyx_n_s_crank, __pyx_n_s_width, __pyx_n_s_rank, __pyx_n_s_tblist, __pyx_n_s_entry, __pyx_n_s_tbline); if (unlikely(!__pyx_tuple__91)) __PYX_ERR(1, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__91); __Pyx_GIVEREF(__pyx_tuple__91); __pyx_codeobj__92 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__91, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_petsc4py_PETSc_Error_pyx, __pyx_n_s_str, 26, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__92)) __PYX_ERR(1, 26, __pyx_L1_error) /* "petsc4py/PETSc/cyclicgc.pxi":41 * t.tp_clear = tp_clear * * def garbage_cleanup(comm=None): # <<<<<<<<<<<<<< * """Clean up unused PETSc objects. * */ __pyx_tuple__93 = PyTuple_Pack(2, __pyx_n_s_comm, __pyx_n_s_ccomm); if (unlikely(!__pyx_tuple__93)) __PYX_ERR(36, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__93); __Pyx_GIVEREF(__pyx_tuple__93); __pyx_codeobj__94 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__93, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_petsc4py_PETSc_cyclicgc_pxi, __pyx_n_s_garbage_cleanup, 41, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__94)) __PYX_ERR(36, 41, __pyx_L1_error) /* "petsc4py/PETSc/cyclicgc.pxi":64 * CHKERR( PetscGarbageCleanup(ccomm) ) * * def garbage_view(comm=None): # <<<<<<<<<<<<<< * """Print summary of the garbage PETSc objects. * */ __pyx_codeobj__95 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__93, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_petsc4py_PETSc_cyclicgc_pxi, __pyx_n_s_garbage_view, 64, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__95)) __PYX_ERR(36, 64, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":3 * # -------------------------------------------------------------------- * * class ViewerType(object): # <<<<<<<<<<<<<< * """Viewer type.""" * SOCKET = S_(PETSCVIEWERSOCKET) */ __pyx_tuple__96 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__96)) __PYX_ERR(37, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__96); __Pyx_GIVEREF(__pyx_tuple__96); __pyx_tuple__97 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__97)) __PYX_ERR(37, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__97); __Pyx_GIVEREF(__pyx_tuple__97); /* "petsc4py/PETSc/Viewer.pyx":20 * EXODUSII = S_(PETSCVIEWEREXODUSII) * * class ViewerFormat(object): # <<<<<<<<<<<<<< * """Viewer format.""" * DEFAULT = PETSC_VIEWER_DEFAULT */ __pyx_tuple__98 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__98)) __PYX_ERR(37, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__98); __Pyx_GIVEREF(__pyx_tuple__98); __pyx_tuple__99 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__99)) __PYX_ERR(37, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__99); __Pyx_GIVEREF(__pyx_tuple__99); /* "petsc4py/PETSc/Viewer.pyx":61 * FAILED = PETSC_VIEWER_FAILED * * class ViewerFileMode(object): # <<<<<<<<<<<<<< * """Viewer file mode.""" * # native */ __pyx_tuple__100 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__100)) __PYX_ERR(37, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__100); __Pyx_GIVEREF(__pyx_tuple__100); __pyx_tuple__101 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__101)) __PYX_ERR(37, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__101); __Pyx_GIVEREF(__pyx_tuple__101); /* "petsc4py/PETSc/Viewer.pyx":73 * AU = UA = APPEND_UPDATE * * class ViewerDrawSize(object): # <<<<<<<<<<<<<< * """Window size.""" * # native */ __pyx_tuple__102 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__102)) __PYX_ERR(37, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__102); __Pyx_GIVEREF(__pyx_tuple__102); __pyx_tuple__103 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__103)) __PYX_ERR(37, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__103); __Pyx_GIVEREF(__pyx_tuple__103); /* "petsc4py/PETSc/Random.pyx":3 * # -------------------------------------------------------------------- * * class RandomType(object): # <<<<<<<<<<<<<< * """The random number generator type.""" * RAND = S_(PETSCRAND) */ __pyx_tuple__104 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__104)) __PYX_ERR(38, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__104); __Pyx_GIVEREF(__pyx_tuple__104); __pyx_tuple__105 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__105)) __PYX_ERR(38, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__105); __Pyx_GIVEREF(__pyx_tuple__105); /* "petsc4py/PETSc/Device.pyx":3 * # -------------------------------------------------------------------- * * class staticproperty(property): # <<<<<<<<<<<<<< * def __get__(self, *args, **kwargs): * return self.fget.__get__(*args, **kwargs)() */ __pyx_tuple__106 = PyTuple_Pack(1, __pyx_builtin_property); if (unlikely(!__pyx_tuple__106)) __PYX_ERR(2, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__106); __Pyx_GIVEREF(__pyx_tuple__106); __pyx_tuple__107 = PyTuple_Pack(1, __pyx_builtin_property); if (unlikely(!__pyx_tuple__107)) __PYX_ERR(2, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__107); __Pyx_GIVEREF(__pyx_tuple__107); /* "petsc4py/PETSc/Device.pyx":4 * * class staticproperty(property): * def __get__(self, *args, **kwargs): # <<<<<<<<<<<<<< * return self.fget.__get__(*args, **kwargs)() * */ __pyx_tuple__108 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_args, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__108)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__108); __Pyx_GIVEREF(__pyx_tuple__108); __pyx_codeobj__109 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__108, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_petsc4py_PETSc_Device_pyx, __pyx_n_s_get, 4, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__109)) __PYX_ERR(2, 4, __pyx_L1_error) /* "petsc4py/PETSc/Device.pyx":191 * return toInt(cdevice_id) * * @staticmethod # <<<<<<<<<<<<<< * def setDefaultType(device_type: Type | str) -> None: * """Set the device type to be used as the default in subsequent calls to `create`. */ __pyx_tuple__110 = PyTuple_Pack(2, __pyx_n_s_device_type, __pyx_n_s_cdevice_type); if (unlikely(!__pyx_tuple__110)) __PYX_ERR(2, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__110); __Pyx_GIVEREF(__pyx_tuple__110); __pyx_codeobj__111 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__110, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_petsc4py_PETSc_Device_pyx, __pyx_n_s_setDefaultType, 191, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__111)) __PYX_ERR(2, 191, __pyx_L1_error) /* "petsc4py/PETSc/Device.pyx":487 * CHKERR(PetscDeviceContextSetFromOptions(ccomm, self.dctx)) * * @staticmethod # <<<<<<<<<<<<<< * def getCurrent() -> DeviceContext: * """Return the current device context. */ __pyx_tuple__112 = PyTuple_Pack(1, __pyx_n_s_dctx); if (unlikely(!__pyx_tuple__112)) __PYX_ERR(2, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__112); __Pyx_GIVEREF(__pyx_tuple__112); __pyx_codeobj__113 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__112, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_petsc4py_PETSc_Device_pyx, __pyx_n_s_getCurrent, 487, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__113)) __PYX_ERR(2, 487, __pyx_L1_error) /* "petsc4py/PETSc/Device.pyx":503 * return PyPetscDeviceContext_New(dctx) * * @staticmethod # <<<<<<<<<<<<<< * def setCurrent(dctx: DeviceContext | None) -> None: * """Set the current device context. */ __pyx_tuple__114 = PyTuple_Pack(2, __pyx_n_s_dctx, __pyx_n_s_cdctx); if (unlikely(!__pyx_tuple__114)) __PYX_ERR(2, 503, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__114); __Pyx_GIVEREF(__pyx_tuple__114); __pyx_codeobj__115 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__114, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_petsc4py_PETSc_Device_pyx, __pyx_n_s_setCurrent, 503, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__115)) __PYX_ERR(2, 503, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":3 * # -------------------------------------------------------------------- * * class ISType(object): # <<<<<<<<<<<<<< * GENERAL = S_(ISGENERAL) * BLOCK = S_(ISBLOCK) */ __pyx_tuple__116 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__116)) __PYX_ERR(39, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__116); __Pyx_GIVEREF(__pyx_tuple__116); __pyx_tuple__117 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__117)) __PYX_ERR(39, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__117); __Pyx_GIVEREF(__pyx_tuple__117); /* "petsc4py/PETSc/IS.pyx":1053 * * * class GLMapMode(object): # <<<<<<<<<<<<<< * """Enum describing mapping behavior for global-to-local maps when global indices are missing. * */ __pyx_tuple__118 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__118)) __PYX_ERR(39, 1053, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__118); __Pyx_GIVEREF(__pyx_tuple__118); __pyx_tuple__119 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__119)) __PYX_ERR(39, 1053, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__119); __Pyx_GIVEREF(__pyx_tuple__119); /* "petsc4py/PETSc/IS.pyx":1070 * * * class LGMapType(object): # <<<<<<<<<<<<<< * BASIC = S_(ISLOCALTOGLOBALMAPPINGBASIC) * HASH = S_(ISLOCALTOGLOBALMAPPINGHASH) */ __pyx_tuple__120 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__120)) __PYX_ERR(39, 1070, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__120); __Pyx_GIVEREF(__pyx_tuple__120); __pyx_tuple__121 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__121)) __PYX_ERR(39, 1070, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__121); __Pyx_GIVEREF(__pyx_tuple__121); /* "petsc4py/PETSc/SF.pyx":3 * # -------------------------------------------------------------------- * * class SFType(object): # <<<<<<<<<<<<<< * BASIC = S_(PETSCSFBASIC) * NEIGHBOR = S_(PETSCSFNEIGHBOR) */ __pyx_tuple__122 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__122)) __PYX_ERR(40, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__122); __Pyx_GIVEREF(__pyx_tuple__122); __pyx_tuple__123 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__123)) __PYX_ERR(40, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__123); __Pyx_GIVEREF(__pyx_tuple__123); /* "petsc4py/PETSc/Vec.pyx":3 * # -------------------------------------------------------------------- * * class VecType(object): # <<<<<<<<<<<<<< * """The vector type.""" * SEQ = S_(VECSEQ) */ __pyx_tuple__124 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__124)) __PYX_ERR(41, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__124); __Pyx_GIVEREF(__pyx_tuple__124); __pyx_tuple__125 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__125)) __PYX_ERR(41, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__125); __Pyx_GIVEREF(__pyx_tuple__125); /* "petsc4py/PETSc/Vec.pyx":23 * KOKKOS = S_(VECKOKKOS) * * class VecOption(object): # <<<<<<<<<<<<<< * """Vector assembly option.""" * IGNORE_OFF_PROC_ENTRIES = VEC_IGNORE_OFF_PROC_ENTRIES */ __pyx_tuple__126 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__126)) __PYX_ERR(41, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__126); __Pyx_GIVEREF(__pyx_tuple__126); __pyx_tuple__127 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__127)) __PYX_ERR(41, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__127); __Pyx_GIVEREF(__pyx_tuple__127); /* "petsc4py/PETSc/FE.pyx":3 * # -------------------------------------------------------------------- * * class FEType(object): # <<<<<<<<<<<<<< * BASIC = S_(PETSCFEBASIC) * OPENCL = S_(PETSCFEOPENCL) */ __pyx_tuple__128 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__128)) __PYX_ERR(43, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__128); __Pyx_GIVEREF(__pyx_tuple__128); __pyx_tuple__129 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__129)) __PYX_ERR(43, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__129); __Pyx_GIVEREF(__pyx_tuple__129); /* "petsc4py/PETSc/Scatter.pyx":3 * # -------------------------------------------------------------------- * * class ScatterType(object): # <<<<<<<<<<<<<< * """Scatter type. * */ __pyx_tuple__130 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__130)) __PYX_ERR(44, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__130); __Pyx_GIVEREF(__pyx_tuple__130); __pyx_tuple__131 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__131)) __PYX_ERR(44, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__131); __Pyx_GIVEREF(__pyx_tuple__131); /* "petsc4py/PETSc/Mat.pyx":3 * # -------------------------------------------------------------------- * * class MatType(object): # <<<<<<<<<<<<<< * """Matrix type. * */ __pyx_tuple__132 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__132)) __PYX_ERR(46, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__132); __Pyx_GIVEREF(__pyx_tuple__132); __pyx_tuple__133 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__133)) __PYX_ERR(46, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__133); __Pyx_GIVEREF(__pyx_tuple__133); /* "petsc4py/PETSc/Mat.pyx":96 * H2OPUS = S_(MATH2OPUS) * * class MatOption(object): # <<<<<<<<<<<<<< * """Matrix option. * */ __pyx_tuple__134 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__134)) __PYX_ERR(46, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__134); __Pyx_GIVEREF(__pyx_tuple__134); __pyx_tuple__135 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__135)) __PYX_ERR(46, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__135); __Pyx_GIVEREF(__pyx_tuple__135); /* "petsc4py/PETSc/Mat.pyx":132 * OPTION_MAX = MAT_OPTION_MAX * * class MatAssemblyType(object): # <<<<<<<<<<<<<< * """Matrix assembly type. * */ __pyx_tuple__136 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__136)) __PYX_ERR(46, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__136); __Pyx_GIVEREF(__pyx_tuple__136); __pyx_tuple__137 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__137)) __PYX_ERR(46, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__137); __Pyx_GIVEREF(__pyx_tuple__137); /* "petsc4py/PETSc/Mat.pyx":147 * FLUSH = FLUSH_ASSEMBLY * * class MatInfoType(object): # <<<<<<<<<<<<<< * """Matrix info type.""" * LOCAL = MAT_LOCAL */ __pyx_tuple__138 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__138)) __PYX_ERR(46, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__138); __Pyx_GIVEREF(__pyx_tuple__138); __pyx_tuple__139 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__139)) __PYX_ERR(46, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__139); __Pyx_GIVEREF(__pyx_tuple__139); /* "petsc4py/PETSc/Mat.pyx":153 * GLOBAL_SUM = MAT_GLOBAL_SUM * * class MatStructure(object): # <<<<<<<<<<<<<< * """Matrix modification structure. * */ __pyx_tuple__140 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__140)) __PYX_ERR(46, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__140); __Pyx_GIVEREF(__pyx_tuple__140); __pyx_tuple__141 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__141)) __PYX_ERR(46, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__141); __Pyx_GIVEREF(__pyx_tuple__141); /* "petsc4py/PETSc/Mat.pyx":172 * UNKNOWN = UNKNOWN_NZ = UNKNOWN_NONZERO_PATTERN * * class MatDuplicateOption(object): # <<<<<<<<<<<<<< * """Matrix duplicate option. * */ __pyx_tuple__142 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__142)) __PYX_ERR(46, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__142); __Pyx_GIVEREF(__pyx_tuple__142); __pyx_tuple__143 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__143)) __PYX_ERR(46, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__143); __Pyx_GIVEREF(__pyx_tuple__143); /* "petsc4py/PETSc/Mat.pyx":184 * SHARE_NONZERO_PATTERN = MAT_SHARE_NONZERO_PATTERN * * class MatOrderingType(object): # <<<<<<<<<<<<<< * """Factored matrix ordering type. * */ __pyx_tuple__144 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__144)) __PYX_ERR(46, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__144); __Pyx_GIVEREF(__pyx_tuple__144); __pyx_tuple__145 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__145)) __PYX_ERR(46, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__145); __Pyx_GIVEREF(__pyx_tuple__145); /* "petsc4py/PETSc/Mat.pyx":203 * METISND = S_(MATORDERINGMETISND) * * class MatSolverType(object): # <<<<<<<<<<<<<< * """Factored matrix solver type. * */ __pyx_tuple__146 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__146)) __PYX_ERR(46, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__146); __Pyx_GIVEREF(__pyx_tuple__146); __pyx_tuple__147 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__147)) __PYX_ERR(46, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__147); __Pyx_GIVEREF(__pyx_tuple__147); /* "petsc4py/PETSc/Mat.pyx":232 * SPQR = S_(MATSOLVERSPQR) * * class MatFactorShiftType(object): # <<<<<<<<<<<<<< * """Factored matrix shift type. * */ __pyx_tuple__148 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__148)) __PYX_ERR(46, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__148); __Pyx_GIVEREF(__pyx_tuple__148); __pyx_tuple__149 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__149)) __PYX_ERR(46, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__149); __Pyx_GIVEREF(__pyx_tuple__149); /* "petsc4py/PETSc/Mat.pyx":249 * PD = MAT_SHIFT_POSITIVE_DEFINITE * * class MatSORType(object): # <<<<<<<<<<<<<< * """Matrix SOR type. * */ __pyx_tuple__150 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__150)) __PYX_ERR(46, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__150); __Pyx_GIVEREF(__pyx_tuple__150); __pyx_tuple__151 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__151)) __PYX_ERR(46, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__151); __Pyx_GIVEREF(__pyx_tuple__151); /* "petsc4py/PETSc/MatPartitioning.pyx":3 * # -------------------------------------------------------------------- * * class MatPartitioningType(object): # <<<<<<<<<<<<<< * PARTITIONINGCURRENT = S_(MATPARTITIONINGCURRENT) * PARTITIONINGAVERAGE = S_(MATPARTITIONINGAVERAGE) */ __pyx_tuple__152 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__152)) __PYX_ERR(47, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__152); __Pyx_GIVEREF(__pyx_tuple__152); __pyx_tuple__153 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__153)) __PYX_ERR(47, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__153); __Pyx_GIVEREF(__pyx_tuple__153); /* "petsc4py/PETSc/PC.pyx":3 * # -------------------------------------------------------------------- * * class PCType(object): # <<<<<<<<<<<<<< * """The preconditioner method.""" * NONE = S_(PCNONE) */ __pyx_tuple__154 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__154)) __PYX_ERR(48, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__154); __Pyx_GIVEREF(__pyx_tuple__154); __pyx_tuple__155 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__155)) __PYX_ERR(48, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__155); __Pyx_GIVEREF(__pyx_tuple__155); /* "petsc4py/PETSc/PC.pyx":56 * H2OPUS = S_(PCH2OPUS) * * class PCSide(object): # <<<<<<<<<<<<<< * """The manner in which the preconditioner is applied.""" * # native */ __pyx_tuple__156 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__156)) __PYX_ERR(48, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__156); __Pyx_GIVEREF(__pyx_tuple__156); __pyx_tuple__157 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__157)) __PYX_ERR(48, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__157); __Pyx_GIVEREF(__pyx_tuple__157); /* "petsc4py/PETSc/PC.pyx":67 * S = SYMMETRIC * * class PCASMType(object): # <<<<<<<<<<<<<< * """The *ASM* subtype.""" * NONE = PC_ASM_NONE */ __pyx_tuple__158 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__158)) __PYX_ERR(48, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__158); __Pyx_GIVEREF(__pyx_tuple__158); __pyx_tuple__159 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__159)) __PYX_ERR(48, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__159); __Pyx_GIVEREF(__pyx_tuple__159); /* "petsc4py/PETSc/PC.pyx":74 * INTERPOLATE = PC_ASM_INTERPOLATE * * class PCGASMType(object): # <<<<<<<<<<<<<< * """The *GASM* subtype.""" * NONE = PC_GASM_NONE */ __pyx_tuple__160 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__160)) __PYX_ERR(48, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__160); __Pyx_GIVEREF(__pyx_tuple__160); __pyx_tuple__161 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__161)) __PYX_ERR(48, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__161); __Pyx_GIVEREF(__pyx_tuple__161); /* "petsc4py/PETSc/PC.pyx":81 * INTERPOLATE = PC_GASM_INTERPOLATE * * class PCMGType(object): # <<<<<<<<<<<<<< * """The *MG* subtype.""" * MULTIPLICATIVE = PC_MG_MULTIPLICATIVE */ __pyx_tuple__162 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__162)) __PYX_ERR(48, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__162); __Pyx_GIVEREF(__pyx_tuple__162); __pyx_tuple__163 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__163)) __PYX_ERR(48, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__163); __Pyx_GIVEREF(__pyx_tuple__163); /* "petsc4py/PETSc/PC.pyx":88 * KASKADE = PC_MG_KASKADE * * class PCMGCycleType(object): # <<<<<<<<<<<<<< * """The *MG* cycle type.""" * V = PC_MG_CYCLE_V */ __pyx_tuple__164 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__164)) __PYX_ERR(48, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__164); __Pyx_GIVEREF(__pyx_tuple__164); __pyx_tuple__165 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__165)) __PYX_ERR(48, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__165); __Pyx_GIVEREF(__pyx_tuple__165); /* "petsc4py/PETSc/PC.pyx":93 * W = PC_MG_CYCLE_W * * class PCGAMGType(object): # <<<<<<<<<<<<<< * """The *GAMG* subtype.""" * AGG = S_(PCGAMGAGG) */ __pyx_tuple__166 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__166)) __PYX_ERR(48, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__166); __Pyx_GIVEREF(__pyx_tuple__166); __pyx_tuple__167 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__167)) __PYX_ERR(48, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__167); __Pyx_GIVEREF(__pyx_tuple__167); /* "petsc4py/PETSc/PC.pyx":99 * CLASSICAL = S_(PCGAMGCLASSICAL) * * class PCCompositeType(object): # <<<<<<<<<<<<<< * """The composite type.""" * ADDITIVE = PC_COMPOSITE_ADDITIVE */ __pyx_tuple__168 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__168)) __PYX_ERR(48, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__168); __Pyx_GIVEREF(__pyx_tuple__168); __pyx_tuple__169 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__169)) __PYX_ERR(48, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__169); __Pyx_GIVEREF(__pyx_tuple__169); /* "petsc4py/PETSc/PC.pyx":107 * SCHUR = PC_COMPOSITE_SCHUR * * class PCFieldSplitSchurPreType(object): # <<<<<<<<<<<<<< * """The field split Schur subtype.""" * SELF = PC_FIELDSPLIT_SCHUR_PRE_SELF */ __pyx_tuple__170 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__170)) __PYX_ERR(48, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__170); __Pyx_GIVEREF(__pyx_tuple__170); __pyx_tuple__171 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__171)) __PYX_ERR(48, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__171); __Pyx_GIVEREF(__pyx_tuple__171); /* "petsc4py/PETSc/PC.pyx":115 * FULL = PC_FIELDSPLIT_SCHUR_PRE_FULL * * class PCFieldSplitSchurFactType(object): # <<<<<<<<<<<<<< * """The field split Schur factorization type.""" * DIAG = PC_FIELDSPLIT_SCHUR_FACT_DIAG */ __pyx_tuple__172 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__172)) __PYX_ERR(48, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__172); __Pyx_GIVEREF(__pyx_tuple__172); __pyx_tuple__173 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__173)) __PYX_ERR(48, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__173); __Pyx_GIVEREF(__pyx_tuple__173); /* "petsc4py/PETSc/PC.pyx":122 * FULL = PC_FIELDSPLIT_SCHUR_FACT_FULL * * class PCPatchConstructType(object): # <<<<<<<<<<<<<< * """The patch construction type.""" * STAR = PC_PATCH_STAR */ __pyx_tuple__174 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__174)) __PYX_ERR(48, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__174); __Pyx_GIVEREF(__pyx_tuple__174); __pyx_tuple__175 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__175)) __PYX_ERR(48, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__175); __Pyx_GIVEREF(__pyx_tuple__175); /* "petsc4py/PETSc/PC.pyx":130 * PYTHON = PC_PATCH_PYTHON * * class PCHPDDMCoarseCorrectionType(object): # <<<<<<<<<<<<<< * """The *HPDDM* coarse correction type.""" * DEFLATED = PC_HPDDM_COARSE_CORRECTION_DEFLATED */ __pyx_tuple__176 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__176)) __PYX_ERR(48, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__176); __Pyx_GIVEREF(__pyx_tuple__176); __pyx_tuple__177 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__177)) __PYX_ERR(48, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__177); __Pyx_GIVEREF(__pyx_tuple__177); /* "petsc4py/PETSc/PC.pyx":136 * BALANCED = PC_HPDDM_COARSE_CORRECTION_BALANCED * * class PCDeflationSpaceType(object): # <<<<<<<<<<<<<< * """The deflation space subtype.""" * HAAR = PC_DEFLATION_SPACE_HAAR */ __pyx_tuple__178 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__178)) __PYX_ERR(48, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__178); __Pyx_GIVEREF(__pyx_tuple__178); __pyx_tuple__179 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__179)) __PYX_ERR(48, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__179); __Pyx_GIVEREF(__pyx_tuple__179); /* "petsc4py/PETSc/PC.pyx":148 * USER = PC_DEFLATION_SPACE_USER * * class PCFailedReason(object): # <<<<<<<<<<<<<< * """The reason the preconditioner has failed.""" * SETUP_ERROR = PC_SETUP_ERROR */ __pyx_tuple__180 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__180)) __PYX_ERR(48, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__180); __Pyx_GIVEREF(__pyx_tuple__180); __pyx_tuple__181 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__181)) __PYX_ERR(48, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__181); __Pyx_GIVEREF(__pyx_tuple__181); /* "petsc4py/PETSc/KSP.pyx":3 * # -------------------------------------------------------------------- * * class KSPType(object): # <<<<<<<<<<<<<< * """KSP Type. * */ __pyx_tuple__182 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__182)) __PYX_ERR(49, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__182); __Pyx_GIVEREF(__pyx_tuple__182); __pyx_tuple__183 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__183)) __PYX_ERR(49, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__183); __Pyx_GIVEREF(__pyx_tuple__183); /* "petsc4py/PETSc/KSP.pyx":230 * HPDDM = S_(KSPHPDDM) * * class KSPNormType(object): # <<<<<<<<<<<<<< * """KSP norm type. * */ __pyx_tuple__184 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__184)) __PYX_ERR(49, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__184); __Pyx_GIVEREF(__pyx_tuple__184); __pyx_tuple__185 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__185)) __PYX_ERR(49, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__185); __Pyx_GIVEREF(__pyx_tuple__185); /* "petsc4py/PETSc/KSP.pyx":265 * NATURAL = NORM_NATURAL * * class KSPConvergedReason(object): # <<<<<<<<<<<<<< * """KSP Converged Reason. * */ __pyx_tuple__186 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__186)) __PYX_ERR(49, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__186); __Pyx_GIVEREF(__pyx_tuple__186); __pyx_tuple__187 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__187)) __PYX_ERR(49, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__187); __Pyx_GIVEREF(__pyx_tuple__187); /* "petsc4py/PETSc/KSP.pyx":356 * DIVERGED_PCSETUP_FAILED = KSP_DIVERGED_PC_FAILED * * class KSPHPDDMType(object): # <<<<<<<<<<<<<< * """The *HPDDM* Krylov solver type.""" * GMRES = KSP_HPDDM_TYPE_GMRES */ __pyx_tuple__188 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__188)) __PYX_ERR(49, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__188); __Pyx_GIVEREF(__pyx_tuple__188); __pyx_tuple__189 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__189)) __PYX_ERR(49, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__189); __Pyx_GIVEREF(__pyx_tuple__189); /* "petsc4py/PETSc/SNES.pyx":3 * # -------------------------------------------------------------------- * * class SNESType(object): # <<<<<<<<<<<<<< * """SNES solver type. * */ __pyx_tuple__190 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__190)) __PYX_ERR(50, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__190); __Pyx_GIVEREF(__pyx_tuple__190); __pyx_tuple__191 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__191)) __PYX_ERR(50, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__191); __Pyx_GIVEREF(__pyx_tuple__191); /* "petsc4py/PETSc/SNES.pyx":32 * PATCH = S_(SNESPATCH) * * class SNESNormSchedule(object): # <<<<<<<<<<<<<< * """SNES norm schedule. * */ __pyx_tuple__192 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__192)) __PYX_ERR(50, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__192); __Pyx_GIVEREF(__pyx_tuple__192); __pyx_tuple__193 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__193)) __PYX_ERR(50, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__193); __Pyx_GIVEREF(__pyx_tuple__193); /* "petsc4py/PETSc/SNES.pyx":56 * * # FIXME Missing reference petsc.SNESConvergedReason * class SNESConvergedReason(object): # <<<<<<<<<<<<<< * """SNES solver termination reason. * */ __pyx_tuple__194 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__194)) __PYX_ERR(50, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__194); __Pyx_GIVEREF(__pyx_tuple__194); __pyx_tuple__195 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__195)) __PYX_ERR(50, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__195); __Pyx_GIVEREF(__pyx_tuple__195); /* "petsc4py/PETSc/TS.pyx":3 * # ----------------------------------------------------------------------------- * * class TSType(object): # <<<<<<<<<<<<<< * """The time stepping method.""" * # native */ __pyx_tuple__196 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__196)) __PYX_ERR(51, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__196); __Pyx_GIVEREF(__pyx_tuple__196); __pyx_tuple__197 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__197)) __PYX_ERR(51, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__197); __Pyx_GIVEREF(__pyx_tuple__197); /* "petsc4py/PETSc/TS.pyx":36 * RUNGE_KUTTA = RK * * class TSRKType(object): # <<<<<<<<<<<<<< * """The *RK* subtype.""" * RK1FE = S_(TSRK1FE) */ __pyx_tuple__198 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__198)) __PYX_ERR(51, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__198); __Pyx_GIVEREF(__pyx_tuple__198); __pyx_tuple__199 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__199)) __PYX_ERR(51, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__199); __Pyx_GIVEREF(__pyx_tuple__199); /* "petsc4py/PETSc/TS.pyx":51 * RK8VR = S_(TSRK8VR) * * class TSARKIMEXType(object): # <<<<<<<<<<<<<< * """The *ARKIMEX* subtype.""" * ARKIMEX1BEE = S_(TSARKIMEX1BEE) */ __pyx_tuple__200 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__200)) __PYX_ERR(51, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__200); __Pyx_GIVEREF(__pyx_tuple__200); __pyx_tuple__201 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__201)) __PYX_ERR(51, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__201); __Pyx_GIVEREF(__pyx_tuple__201); /* "petsc4py/PETSc/TS.pyx":67 * ARKIMEX5 = S_(TSARKIMEX5) * * class TSDIRKType(object): # <<<<<<<<<<<<<< * """The *DIRK* subtype.""" * DIRKS212 = S_(TSDIRKS212) */ __pyx_tuple__202 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__202)) __PYX_ERR(51, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__202); __Pyx_GIVEREF(__pyx_tuple__202); __pyx_tuple__203 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__203)) __PYX_ERR(51, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__203); __Pyx_GIVEREF(__pyx_tuple__203); /* "petsc4py/PETSc/TS.pyx":86 * DIRKES8516SAL = S_(TSDIRKES8516SAL) * * class TSProblemType(object): # <<<<<<<<<<<<<< * """Distinguishes linear and nonlinear problems.""" * LINEAR = TS_LINEAR */ __pyx_tuple__204 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__204)) __PYX_ERR(51, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__204); __Pyx_GIVEREF(__pyx_tuple__204); __pyx_tuple__205 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__205)) __PYX_ERR(51, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__205); __Pyx_GIVEREF(__pyx_tuple__205); /* "petsc4py/PETSc/TS.pyx":91 * NONLINEAR = TS_NONLINEAR * * class TSEquationType(object): # <<<<<<<<<<<<<< * """Distinguishes among types of explicit and implicit equations.""" * UNSPECIFIED = TS_EQ_UNSPECIFIED */ __pyx_tuple__206 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__206)) __PYX_ERR(51, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__206); __Pyx_GIVEREF(__pyx_tuple__206); __pyx_tuple__207 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__207)) __PYX_ERR(51, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__207); __Pyx_GIVEREF(__pyx_tuple__207); /* "petsc4py/PETSc/TS.pyx":107 * DAE_IMPLICIT_INDEXHI = TS_EQ_DAE_IMPLICIT_INDEXHI * * class TSExactFinalTime(object): # <<<<<<<<<<<<<< * """The method for ending time stepping.""" * UNSPECIFIED = TS_EXACTFINALTIME_UNSPECIFIED */ __pyx_tuple__208 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__208)) __PYX_ERR(51, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__208); __Pyx_GIVEREF(__pyx_tuple__208); __pyx_tuple__209 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__209)) __PYX_ERR(51, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__209); __Pyx_GIVEREF(__pyx_tuple__209); /* "petsc4py/PETSc/TS.pyx":114 * MATCHSTEP = TS_EXACTFINALTIME_MATCHSTEP * * class TSConvergedReason(object): # <<<<<<<<<<<<<< * """The reason the time step is converging.""" * # iterating */ __pyx_tuple__210 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__210)) __PYX_ERR(51, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__210); __Pyx_GIVEREF(__pyx_tuple__210); __pyx_tuple__211 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__211)) __PYX_ERR(51, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__211); __Pyx_GIVEREF(__pyx_tuple__211); /* "petsc4py/PETSc/AO.pyx":3 * # -------------------------------------------------------------------- * * class AOType(object): # <<<<<<<<<<<<<< * BASIC = S_(AOBASIC) * ADVANCED = S_(AOADVANCED) */ __pyx_tuple__212 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__212)) __PYX_ERR(53, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__212); __Pyx_GIVEREF(__pyx_tuple__212); __pyx_tuple__213 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__213)) __PYX_ERR(53, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__213); __Pyx_GIVEREF(__pyx_tuple__213); /* "petsc4py/PETSc/DM.pyx":3 * # -------------------------------------------------------------------- * * class DMType(object): # <<<<<<<<<<<<<< * """`DM` types.""" * DA = S_(DMDA_type) */ __pyx_tuple__214 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__214)) __PYX_ERR(54, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__214); __Pyx_GIVEREF(__pyx_tuple__214); __pyx_tuple__215 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__215)) __PYX_ERR(54, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__215); __Pyx_GIVEREF(__pyx_tuple__215); /* "petsc4py/PETSc/DM.pyx":21 * STAG = S_(DMSTAG) * * class DMBoundaryType(object): # <<<<<<<<<<<<<< * """`DM` Boundary types.""" * NONE = DM_BOUNDARY_NONE */ __pyx_tuple__216 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__216)) __PYX_ERR(54, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__216); __Pyx_GIVEREF(__pyx_tuple__216); __pyx_tuple__217 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__217)) __PYX_ERR(54, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__217); __Pyx_GIVEREF(__pyx_tuple__217); /* "petsc4py/PETSc/DM.pyx":29 * TWIST = DM_BOUNDARY_TWIST * * class DMPolytopeType(object): # <<<<<<<<<<<<<< * POINT = DM_POLYTOPE_POINT * SEGMENT = DM_POLYTOPE_SEGMENT */ __pyx_tuple__218 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__218)) __PYX_ERR(54, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__218); __Pyx_GIVEREF(__pyx_tuple__218); __pyx_tuple__219 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__219)) __PYX_ERR(54, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__219); __Pyx_GIVEREF(__pyx_tuple__219); /* "petsc4py/PETSc/DS.pyx":3 * # -------------------------------------------------------------------- * * class DSType(object): # <<<<<<<<<<<<<< * BASIC = S_(PETSCDSBASIC) * */ __pyx_tuple__220 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__220)) __PYX_ERR(55, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__220); __Pyx_GIVEREF(__pyx_tuple__220); __pyx_tuple__221 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__221)) __PYX_ERR(55, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__221); __Pyx_GIVEREF(__pyx_tuple__221); /* "petsc4py/PETSc/DMDA.pyx":3 * # -------------------------------------------------------------------- * * class DMDAStencilType(object): # <<<<<<<<<<<<<< * STAR = DMDA_STENCIL_STAR * BOX = DMDA_STENCIL_BOX */ __pyx_tuple__222 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__222)) __PYX_ERR(56, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__222); __Pyx_GIVEREF(__pyx_tuple__222); __pyx_tuple__223 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__223)) __PYX_ERR(56, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__223); __Pyx_GIVEREF(__pyx_tuple__223); /* "petsc4py/PETSc/DMDA.pyx":7 * BOX = DMDA_STENCIL_BOX * * class DMDAInterpolationType(object): # <<<<<<<<<<<<<< * Q0 = DMDA_INTERPOLATION_Q0 * Q1 = DMDA_INTERPOLATION_Q1 */ __pyx_tuple__224 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__224)) __PYX_ERR(56, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__224); __Pyx_GIVEREF(__pyx_tuple__224); __pyx_tuple__225 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__225)) __PYX_ERR(56, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__225); __Pyx_GIVEREF(__pyx_tuple__225); /* "petsc4py/PETSc/DMDA.pyx":11 * Q1 = DMDA_INTERPOLATION_Q1 * * class DMDAElementType(object): # <<<<<<<<<<<<<< * P1 = DMDA_ELEMENT_P1 * Q1 = DMDA_ELEMENT_Q1 */ __pyx_tuple__226 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__226)) __PYX_ERR(56, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__226); __Pyx_GIVEREF(__pyx_tuple__226); __pyx_tuple__227 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__227)) __PYX_ERR(56, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__227); __Pyx_GIVEREF(__pyx_tuple__227); /* "petsc4py/PETSc/DMPlex.pyx":3 * # -------------------------------------------------------------------- * * class DMPlexReorderDefaultFlag(object): # <<<<<<<<<<<<<< * NOTSET = DMPLEX_REORDER_DEFAULT_NOTSET * FALSE = DMPLEX_REORDER_DEFAULT_FALSE */ __pyx_tuple__228 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__228)) __PYX_ERR(57, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__228); __Pyx_GIVEREF(__pyx_tuple__228); __pyx_tuple__229 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__229)) __PYX_ERR(57, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__229); __Pyx_GIVEREF(__pyx_tuple__229); /* "petsc4py/PETSc/DMPlex.pyx":3283 * * # -------------------------------------------------------------------- * class DMPlexTransformType(object): # <<<<<<<<<<<<<< * REFINEREGULAR = S_(DMPLEXREFINEREGULAR) * REFINEALFELD = S_(DMPLEXREFINEALFELD) */ __pyx_tuple__230 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__230)) __PYX_ERR(57, 3283, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__230); __Pyx_GIVEREF(__pyx_tuple__230); __pyx_tuple__231 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__231)) __PYX_ERR(57, 3283, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__231); __Pyx_GIVEREF(__pyx_tuple__231); /* "petsc4py/PETSc/DMStag.pyx":3 * # -------------------------------------------------------------------- * * class DMStagStencilType(object): # <<<<<<<<<<<<<< * STAR = DMSTAG_STENCIL_STAR * BOX = DMSTAG_STENCIL_BOX */ __pyx_tuple__232 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__232)) __PYX_ERR(58, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__232); __Pyx_GIVEREF(__pyx_tuple__232); __pyx_tuple__233 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__233)) __PYX_ERR(58, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__233); __Pyx_GIVEREF(__pyx_tuple__233); /* "petsc4py/PETSc/DMStag.pyx":8 * NONE = DMSTAG_STENCIL_NONE * * class DMStagStencilLocation(object): # <<<<<<<<<<<<<< * NULLLOC = DMSTAG_NULL_LOCATION * BACK_DOWN_LEFT = DMSTAG_BACK_DOWN_LEFT */ __pyx_tuple__234 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__234)) __PYX_ERR(58, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__234); __Pyx_GIVEREF(__pyx_tuple__234); __pyx_tuple__235 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__235)) __PYX_ERR(58, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__235); __Pyx_GIVEREF(__pyx_tuple__235); /* "petsc4py/PETSc/DMSwarm.pyx":3 * # -------------------------------------------------------------------- * * class DMSwarmType(object): # <<<<<<<<<<<<<< * BASIC = DMSWARM_BASIC * PIC = DMSWARM_PIC */ __pyx_tuple__236 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__236)) __PYX_ERR(62, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__236); __Pyx_GIVEREF(__pyx_tuple__236); __pyx_tuple__237 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__237)) __PYX_ERR(62, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__237); __Pyx_GIVEREF(__pyx_tuple__237); /* "petsc4py/PETSc/DMSwarm.pyx":7 * PIC = DMSWARM_PIC * * class DMSwarmMigrateType(object): # <<<<<<<<<<<<<< * MIGRATE_BASIC = DMSWARM_MIGRATE_BASIC * MIGRATE_DMCELLNSCATTER = DMSWARM_MIGRATE_DMCELLNSCATTER */ __pyx_tuple__238 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__238)) __PYX_ERR(62, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__238); __Pyx_GIVEREF(__pyx_tuple__238); __pyx_tuple__239 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__239)) __PYX_ERR(62, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__239); __Pyx_GIVEREF(__pyx_tuple__239); /* "petsc4py/PETSc/DMSwarm.pyx":13 * MIGRATE_USER = DMSWARM_MIGRATE_USER * * class DMSwarmCollectType(object): # <<<<<<<<<<<<<< * COLLECT_BASIC = DMSWARM_COLLECT_BASIC * COLLECT_DMDABOUNDINGBOX = DMSWARM_COLLECT_DMDABOUNDINGBOX */ __pyx_tuple__240 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__240)) __PYX_ERR(62, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__240); __Pyx_GIVEREF(__pyx_tuple__240); __pyx_tuple__241 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__241)) __PYX_ERR(62, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__241); __Pyx_GIVEREF(__pyx_tuple__241); /* "petsc4py/PETSc/DMSwarm.pyx":19 * COLLECT_USER = DMSWARM_COLLECT_USER * * class DMSwarmPICLayoutType(object): # <<<<<<<<<<<<<< * LAYOUT_REGULAR = DMSWARMPIC_LAYOUT_REGULAR * LAYOUT_GAUSS = DMSWARMPIC_LAYOUT_GAUSS */ __pyx_tuple__242 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__242)) __PYX_ERR(62, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__242); __Pyx_GIVEREF(__pyx_tuple__242); __pyx_tuple__243 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__243)) __PYX_ERR(62, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__243); __Pyx_GIVEREF(__pyx_tuple__243); /* "petsc4py/PETSc/Partitioner.pyx":3 * # -------------------------------------------------------------------- * * class PartitionerType(object): # <<<<<<<<<<<<<< * PARMETIS = S_(PETSCPARTITIONERPARMETIS) * PTSCOTCH = S_(PETSCPARTITIONERPTSCOTCH) */ __pyx_tuple__244 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__244)) __PYX_ERR(63, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__244); __Pyx_GIVEREF(__pyx_tuple__244); __pyx_tuple__245 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__245)) __PYX_ERR(63, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__245); __Pyx_GIVEREF(__pyx_tuple__245); /* "petsc4py/PETSc/Space.pyx":3 * # -------------------------------------------------------------------- * * class SpaceType(object): # <<<<<<<<<<<<<< * POLYNOMIAL = S_(PETSCSPACEPOLYNOMIAL) * PTRIMMED = S_(PETSCSPACEPTRIMMED) */ __pyx_tuple__246 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__246)) __PYX_ERR(64, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__246); __Pyx_GIVEREF(__pyx_tuple__246); __pyx_tuple__247 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__247)) __PYX_ERR(64, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__247); __Pyx_GIVEREF(__pyx_tuple__247); /* "petsc4py/PETSc/Space.pyx":552 * # -------------------------------------------------------------------- * * class DualSpaceType(object): # <<<<<<<<<<<<<< * LAGRANGE = S_(PETSCDUALSPACELAGRANGE) * SIMPLE = S_(PETSCDUALSPACESIMPLE) */ __pyx_tuple__248 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__248)) __PYX_ERR(64, 552, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__248); __Pyx_GIVEREF(__pyx_tuple__248); __pyx_tuple__249 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__249)) __PYX_ERR(64, 552, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__249); __Pyx_GIVEREF(__pyx_tuple__249); /* "petsc4py/PETSc/PETSc.pyx":574 * # -------------------------------------------------------------------- * * def _initialize(args=None, comm=None): # <<<<<<<<<<<<<< * import atexit * global tracebacklist */ __pyx_tuple__250 = PyTuple_Pack(4, __pyx_n_s_args, __pyx_n_s_comm, __pyx_n_s_atexit, __pyx_n_s_ready); if (unlikely(!__pyx_tuple__250)) __PYX_ERR(12, 574, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__250); __Pyx_GIVEREF(__pyx_tuple__250); __pyx_codeobj__251 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__250, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_petsc4py_PETSc_PETSc_pyx, __pyx_n_s_initialize, 574, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__251)) __PYX_ERR(12, 574, __pyx_L1_error) /* "petsc4py/PETSc/PETSc.pyx":593 * atexit.register(_pre_finalize) * * def _pre_finalize(): # <<<<<<<<<<<<<< * # Called while the Python interpreter is still running * garbage_cleanup() */ __pyx_codeobj__252 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_petsc4py_PETSc_PETSc_pyx, __pyx_n_s_pre_finalize, 593, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__252)) __PYX_ERR(12, 593, __pyx_L1_error) /* "petsc4py/PETSc/PETSc.pyx":597 * garbage_cleanup() * * def _finalize(): # <<<<<<<<<<<<<< * finalize() * # */ __pyx_codeobj__253 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_petsc4py_PETSc_PETSc_pyx, __pyx_n_s_finalize, 597, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__253)) __PYX_ERR(12, 597, __pyx_L1_error) /* "petsc4py/PETSc/PETSc.pyx":619 * citations_registry.clear() * * def _push_python_vfprintf(): # <<<<<<<<<<<<<< * _push_vfprintf(&PetscVFPrintf_PythonStdStream) * */ __pyx_codeobj__254 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_petsc4py_PETSc_PETSc_pyx, __pyx_n_s_push_python_vfprintf, 619, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__254)) __PYX_ERR(12, 619, __pyx_L1_error) /* "petsc4py/PETSc/PETSc.pyx":622 * _push_vfprintf(&PetscVFPrintf_PythonStdStream) * * def _pop_python_vfprintf(): # <<<<<<<<<<<<<< * _pop_vfprintf() * */ __pyx_codeobj__255 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_petsc4py_PETSc_PETSc_pyx, __pyx_n_s_pop_python_vfprintf, 622, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__255)) __PYX_ERR(12, 622, __pyx_L1_error) /* "petsc4py/PETSc/PETSc.pyx":625 * _pop_vfprintf() * * def _stdout_is_stderr(): # <<<<<<<<<<<<<< * global PETSC_STDOUT, PETSC_STDERR * return PETSC_STDOUT == PETSC_STDERR */ __pyx_codeobj__256 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_petsc4py_PETSc_PETSc_pyx, __pyx_n_s_stdout_is_stderr, 625, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__256)) __PYX_ERR(12, 625, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } /* #### Code section: init_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { __pyx_umethod_PyDict_Type_get.type = (PyObject*)&PyDict_Type; __pyx_umethod_PyDict_Type_get.method_name = &__pyx_n_s_get_2; __pyx_umethod_PyDict_Type_keys.type = (PyObject*)&PyDict_Type; __pyx_umethod_PyDict_Type_keys.method_name = &__pyx_n_s_keys; __pyx_umethod_PyDict_Type_pop.type = (PyObject*)&PyDict_Type; __pyx_umethod_PyDict_Type_pop.method_name = &__pyx_n_s_pop; __pyx_umethod_PyList_Type_pop.type = (PyObject*)&PyList_Type; __pyx_umethod_PyList_Type_pop.method_name = &__pyx_n_s_pop; if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(14, 1, __pyx_L1_error); __pyx_float_0_ = PyFloat_FromDouble(0.); if (unlikely(!__pyx_float_0_)) __PYX_ERR(14, 1, __pyx_L1_error) __pyx_float_0_0 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_float_0_0)) __PYX_ERR(14, 1, __pyx_L1_error) __pyx_float_1_0 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_float_1_0)) __PYX_ERR(14, 1, __pyx_L1_error) __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(14, 1, __pyx_L1_error) __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(14, 1, __pyx_L1_error) __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(14, 1, __pyx_L1_error) __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(14, 1, __pyx_L1_error) __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) __PYX_ERR(14, 1, __pyx_L1_error) __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) __PYX_ERR(14, 1, __pyx_L1_error) __pyx_int_6 = PyInt_FromLong(6); if (unlikely(!__pyx_int_6)) __PYX_ERR(14, 1, __pyx_L1_error) __pyx_int_7 = PyInt_FromLong(7); if (unlikely(!__pyx_int_7)) __PYX_ERR(14, 1, __pyx_L1_error) __pyx_int_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) __PYX_ERR(14, 1, __pyx_L1_error) __pyx_int_9 = PyInt_FromLong(9); if (unlikely(!__pyx_int_9)) __PYX_ERR(14, 1, __pyx_L1_error) __pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) __PYX_ERR(14, 1, __pyx_L1_error) __pyx_int_13 = PyInt_FromLong(13); if (unlikely(!__pyx_int_13)) __PYX_ERR(14, 1, __pyx_L1_error) __pyx_int_17 = PyInt_FromLong(17); if (unlikely(!__pyx_int_17)) __PYX_ERR(14, 1, __pyx_L1_error) __pyx_int_18 = PyInt_FromLong(18); if (unlikely(!__pyx_int_18)) __PYX_ERR(14, 1, __pyx_L1_error) __pyx_int_19 = PyInt_FromLong(19); if (unlikely(!__pyx_int_19)) __PYX_ERR(14, 1, __pyx_L1_error) __pyx_int_23 = PyInt_FromLong(23); if (unlikely(!__pyx_int_23)) __PYX_ERR(14, 1, __pyx_L1_error) __pyx_int_32 = PyInt_FromLong(32); if (unlikely(!__pyx_int_32)) __PYX_ERR(14, 1, __pyx_L1_error) __pyx_int_34 = PyInt_FromLong(34); if (unlikely(!__pyx_int_34)) __PYX_ERR(14, 1, __pyx_L1_error) __pyx_int_43 = PyInt_FromLong(43); if (unlikely(!__pyx_int_43)) __PYX_ERR(14, 1, __pyx_L1_error) __pyx_int_45 = PyInt_FromLong(45); if (unlikely(!__pyx_int_45)) __PYX_ERR(14, 1, __pyx_L1_error) __pyx_int_46 = PyInt_FromLong(46); if (unlikely(!__pyx_int_46)) __PYX_ERR(14, 1, __pyx_L1_error) __pyx_int_47 = PyInt_FromLong(47); if (unlikely(!__pyx_int_47)) __PYX_ERR(14, 1, __pyx_L1_error) __pyx_int_48 = PyInt_FromLong(48); if (unlikely(!__pyx_int_48)) __PYX_ERR(14, 1, __pyx_L1_error) __pyx_int_59 = PyInt_FromLong(59); if (unlikely(!__pyx_int_59)) __PYX_ERR(14, 1, __pyx_L1_error) __pyx_int_88 = PyInt_FromLong(88); if (unlikely(!__pyx_int_88)) __PYX_ERR(14, 1, __pyx_L1_error) __pyx_int_102 = PyInt_FromLong(102); if (unlikely(!__pyx_int_102)) __PYX_ERR(14, 1, __pyx_L1_error) __pyx_int_105 = PyInt_FromLong(105); if (unlikely(!__pyx_int_105)) __PYX_ERR(14, 1, __pyx_L1_error) __pyx_int_106 = PyInt_FromLong(106); if (unlikely(!__pyx_int_106)) __PYX_ERR(14, 1, __pyx_L1_error) __pyx_int_113 = PyInt_FromLong(113); if (unlikely(!__pyx_int_113)) __PYX_ERR(14, 1, __pyx_L1_error) __pyx_int_119 = PyInt_FromLong(119); if (unlikely(!__pyx_int_119)) __PYX_ERR(14, 1, __pyx_L1_error) __pyx_int_121 = PyInt_FromLong(121); if (unlikely(!__pyx_int_121)) __PYX_ERR(14, 1, __pyx_L1_error) __pyx_int_122 = PyInt_FromLong(122); if (unlikely(!__pyx_int_122)) __PYX_ERR(14, 1, __pyx_L1_error) __pyx_int_112105877 = PyInt_FromLong(112105877L); if (unlikely(!__pyx_int_112105877)) __PYX_ERR(14, 1, __pyx_L1_error) __pyx_int_136983863 = PyInt_FromLong(136983863L); if (unlikely(!__pyx_int_136983863)) __PYX_ERR(14, 1, __pyx_L1_error) __pyx_int_184977713 = PyInt_FromLong(184977713L); if (unlikely(!__pyx_int_184977713)) __PYX_ERR(14, 1, __pyx_L1_error) __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(14, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_globals ### */ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { /* AssertionsEnabled.init */ if (likely(__Pyx_init_assertions_enabled() == 0)); else if (unlikely(PyErr_Occurred())) __PYX_ERR(14, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_module ### */ static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __pyx_v_8petsc4py_5PETSc_PetscError = Py_None; Py_INCREF(Py_None); __pyx_v_8petsc4py_5PETSc_appctx_registry = ((PyObject*)Py_None); Py_INCREF(Py_None); __pyx_v_8petsc4py_5PETSc_citations_registry = ((PyObject*)Py_None); Py_INCREF(Py_None); __pyx_v_8petsc4py_5PETSc_functools = Py_None; Py_INCREF(Py_None); __pyx_v_8petsc4py_5PETSc_stage_registry = ((PyObject*)Py_None); Py_INCREF(Py_None); __pyx_v_8petsc4py_5PETSc_class_registry = ((PyObject*)Py_None); Py_INCREF(Py_None); __pyx_v_8petsc4py_5PETSc_event_registry = ((PyObject*)Py_None); Py_INCREF(Py_None); __pyx_v_8petsc4py_5PETSc___COMM_NULL__ = ((struct PyPetscCommObject *)Py_None); Py_INCREF(Py_None); __pyx_v_8petsc4py_5PETSc___COMM_SELF__ = ((struct PyPetscCommObject *)Py_None); Py_INCREF(Py_None); __pyx_v_8petsc4py_5PETSc___COMM_WORLD__ = ((struct PyPetscCommObject *)Py_None); Py_INCREF(Py_None); __pyx_v_8petsc4py_5PETSc_type_registry = ((PyObject*)Py_None); Py_INCREF(Py_None); __pyx_v_8petsc4py_5PETSc_module_cache = ((PyObject*)Py_None); Py_INCREF(Py_None); __pyx_v_8petsc4py_5PETSc_dMatOps = ((PyObject*)Py_None); Py_INCREF(Py_None); __pyx_v_8petsc4py_5PETSc_tracebacklist = Py_None; Py_INCREF(Py_None); __pyx_collections_abc_Sequence = Py_None; Py_INCREF(Py_None); generic = Py_None; Py_INCREF(Py_None); strided = Py_None; Py_INCREF(Py_None); indirect = Py_None; Py_INCREF(Py_None); contiguous = Py_None; Py_INCREF(Py_None); indirect_contiguous = Py_None; Py_INCREF(Py_None); __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ if (__Pyx_ExportFunction("GetComm", (void (*)(void))__pyx_f_8petsc4py_5PETSc_GetComm, "MPI_Comm (PyObject *, MPI_Comm)") < 0) __PYX_ERR(14, 1, __pyx_L1_error) if (__Pyx_ExportFunction("GetCommDefault", (void (*)(void))__pyx_f_8petsc4py_5PETSc_GetCommDefault, "MPI_Comm (void)") < 0) __PYX_ERR(14, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscType_Register", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscType_Register, "int (int, PyTypeObject *)") < 0) __PYX_ERR(14, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscType_Lookup", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscType_Lookup, "PyTypeObject *(int)") < 0) __PYX_ERR(14, 1, __pyx_L1_error) if (__Pyx_ExportFunction("CHKERR", (void (*)(void))__pyx_f_8petsc4py_5PETSc_CHKERR, "PetscErrorCode (PetscErrorCode)") < 0) __PYX_ERR(14, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscError_Set", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscError_Set, "int (PetscErrorCode)") < 0) __PYX_ERR(14, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscComm_New", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscComm_New, "PyObject *(MPI_Comm)") < 0) __PYX_ERR(14, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscComm_Get", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscComm_Get, "MPI_Comm (PyObject *)") < 0) __PYX_ERR(14, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscComm_GetPtr", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscComm_GetPtr, "MPI_Comm *(PyObject *)") < 0) __PYX_ERR(14, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscObject_New", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscObject_New, "PyObject *(PetscObject)") < 0) __PYX_ERR(14, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscObject_Get", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscObject_Get, "PetscObject (PyObject *)") < 0) __PYX_ERR(14, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscObject_GetPtr", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscObject_GetPtr, "PetscObject *(PyObject *)") < 0) __PYX_ERR(14, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscViewer_New", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscViewer_New, "PyObject *(PetscViewer)") < 0) __PYX_ERR(14, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscViewer_Get", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscViewer_Get, "PetscViewer (PyObject *)") < 0) __PYX_ERR(14, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscRandom_New", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscRandom_New, "PyObject *(PetscRandom)") < 0) __PYX_ERR(14, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscRandom_Get", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscRandom_Get, "PetscRandom (PyObject *)") < 0) __PYX_ERR(14, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscDevice_New", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscDevice_New, "struct PyPetscDeviceObject *(PetscDevice)") < 0) __PYX_ERR(14, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscDevice_Get", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscDevice_Get, "PetscDevice (PyObject *)") < 0) __PYX_ERR(14, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscDeviceContext_New", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscDeviceContext_New, "struct PyPetscDeviceContextObject *(PetscDeviceContext)") < 0) __PYX_ERR(14, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscDeviceContext_Get", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscDeviceContext_Get, "PetscDeviceContext (PyObject *)") < 0) __PYX_ERR(14, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscIS_New", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscIS_New, "PyObject *(IS)") < 0) __PYX_ERR(14, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscIS_Get", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscIS_Get, "IS (PyObject *)") < 0) __PYX_ERR(14, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscLGMap_New", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscLGMap_New, "PyObject *(ISLocalToGlobalMapping)") < 0) __PYX_ERR(14, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscLGMap_Get", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscLGMap_Get, "ISLocalToGlobalMapping (PyObject *)") < 0) __PYX_ERR(14, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscSF_New", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscSF_New, "PyObject *(PetscSF)") < 0) __PYX_ERR(14, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscSF_Get", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscSF_Get, "PetscSF (PyObject *)") < 0) __PYX_ERR(14, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscVec_New", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscVec_New, "PyObject *(Vec)") < 0) __PYX_ERR(14, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscVec_Get", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscVec_Get, "Vec (PyObject *)") < 0) __PYX_ERR(14, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscScatter_New", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscScatter_New, "PyObject *(VecScatter)") < 0) __PYX_ERR(14, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscScatter_Get", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscScatter_Get, "VecScatter (PyObject *)") < 0) __PYX_ERR(14, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscSection_New", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscSection_New, "PyObject *(PetscSection)") < 0) __PYX_ERR(14, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscSection_Get", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscSection_Get, "PetscSection (PyObject *)") < 0) __PYX_ERR(14, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscMat_New", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscMat_New, "PyObject *(Mat)") < 0) __PYX_ERR(14, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscMat_Get", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscMat_Get, "Mat (PyObject *)") < 0) __PYX_ERR(14, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscMatPartitioning_New", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscMatPartitioning_New, "PyObject *(MatPartitioning)") < 0) __PYX_ERR(14, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscMatPartitioning_Get", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscMatPartitioning_Get, "MatPartitioning (PyObject *)") < 0) __PYX_ERR(14, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscPC_New", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscPC_New, "PyObject *(PC)") < 0) __PYX_ERR(14, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscPC_Get", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscPC_Get, "PC (PyObject *)") < 0) __PYX_ERR(14, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscKSP_New", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscKSP_New, "PyObject *(KSP)") < 0) __PYX_ERR(14, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscKSP_Get", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscKSP_Get, "KSP (PyObject *)") < 0) __PYX_ERR(14, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscSNES_New", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscSNES_New, "PyObject *(SNES)") < 0) __PYX_ERR(14, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscSNES_Get", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscSNES_Get, "SNES (PyObject *)") < 0) __PYX_ERR(14, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscTS_New", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscTS_New, "PyObject *(TS)") < 0) __PYX_ERR(14, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscTS_Get", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscTS_Get, "TS (PyObject *)") < 0) __PYX_ERR(14, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscTAO_New", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscTAO_New, "PyObject *(Tao)") < 0) __PYX_ERR(14, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscTAO_Get", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscTAO_Get, "Tao (PyObject *)") < 0) __PYX_ERR(14, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscTAOLineSearch_New", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscTAOLineSearch_New, "PyObject *(TaoLineSearch)") < 0) __PYX_ERR(14, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscTAOLineSearch_Get", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscTAOLineSearch_Get, "TaoLineSearch (PyObject *)") < 0) __PYX_ERR(14, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscAO_New", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscAO_New, "PyObject *(AO)") < 0) __PYX_ERR(14, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscAO_Get", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscAO_Get, "AO (PyObject *)") < 0) __PYX_ERR(14, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscDM_New", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscDM_New, "PyObject *(DM)") < 0) __PYX_ERR(14, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscDM_Get", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscDM_Get, "DM (PyObject *)") < 0) __PYX_ERR(14, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscDS_New", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscDS_New, "PyObject *(PetscDS)") < 0) __PYX_ERR(14, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscDS_Get", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscDS_Get, "PetscDS (PyObject *)") < 0) __PYX_ERR(14, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscPartitioner_New", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscPartitioner_New, "PyObject *(PetscPartitioner)") < 0) __PYX_ERR(14, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscPartitioner_Get", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscPartitioner_Get, "PetscPartitioner (PyObject *)") < 0) __PYX_ERR(14, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscFE_New", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscFE_New, "PyObject *(PetscFE)") < 0) __PYX_ERR(14, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscFE_Get", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscFE_Get, "PetscFE (PyObject *)") < 0) __PYX_ERR(14, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscQuad_New", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscQuad_New, "PyObject *(PetscQuadrature)") < 0) __PYX_ERR(14, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscQuad_Get", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscQuad_Get, "PetscQuadrature (PyObject *)") < 0) __PYX_ERR(14, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscDMLabel_New", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscDMLabel_New, "PyObject *(DMLabel)") < 0) __PYX_ERR(14, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscDMLabel_Get", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscDMLabel_Get, "DMLabel (PyObject *)") < 0) __PYX_ERR(14, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscSpace_New", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscSpace_New, "PyObject *(PetscSpace)") < 0) __PYX_ERR(14, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscSpace_Get", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscSpace_Get, "PetscSpace (PyObject *)") < 0) __PYX_ERR(14, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscDualSpace_New", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscDualSpace_New, "PyObject *(PetscDualSpace)") < 0) __PYX_ERR(14, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscDualSpace_Get", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscDualSpace_Get, "PetscDualSpace (PyObject *)") < 0) __PYX_ERR(14, 1, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ #if CYTHON_USE_TYPE_SPECS __pyx_ptype_8petsc4py_5PETSc_Comm = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &PyPetscComm_Type_spec, NULL); if (unlikely(!__pyx_ptype_8petsc4py_5PETSc_Comm)) __PYX_ERR(34, 3, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&PyPetscComm_Type_spec, __pyx_ptype_8petsc4py_5PETSc_Comm) < 0) __PYX_ERR(34, 3, __pyx_L1_error) #else __pyx_ptype_8petsc4py_5PETSc_Comm = &PyPetscComm_Type; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_8petsc4py_5PETSc_Comm) < 0) __PYX_ERR(34, 3, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_8petsc4py_5PETSc_Comm->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_8petsc4py_5PETSc_Comm->tp_dictoffset && __pyx_ptype_8petsc4py_5PETSc_Comm->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_8petsc4py_5PETSc_Comm->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Comm, (PyObject *) __pyx_ptype_8petsc4py_5PETSc_Comm) < 0) __PYX_ERR(34, 3, __pyx_L1_error) __pyx_vtabptr_8petsc4py_5PETSc_Object = &__pyx_vtable_8petsc4py_5PETSc_Object; __pyx_vtable_8petsc4py_5PETSc_Object.get_attr = (PyObject *(*)(struct PyPetscObjectObject *, char *))__pyx_f_8petsc4py_5PETSc_6Object_get_attr; __pyx_vtable_8petsc4py_5PETSc_Object.set_attr = (PyObject *(*)(struct PyPetscObjectObject *, char *, PyObject *))__pyx_f_8petsc4py_5PETSc_6Object_set_attr; __pyx_vtable_8petsc4py_5PETSc_Object.get_dict = (PyObject *(*)(struct PyPetscObjectObject *))__pyx_f_8petsc4py_5PETSc_6Object_get_dict; #if CYTHON_USE_TYPE_SPECS __pyx_ptype_8petsc4py_5PETSc_Object = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &PyPetscObject_Type_spec, NULL); if (unlikely(!__pyx_ptype_8petsc4py_5PETSc_Object)) __PYX_ERR(35, 3, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&PyPetscObject_Type_spec, __pyx_ptype_8petsc4py_5PETSc_Object) < 0) __PYX_ERR(35, 3, __pyx_L1_error) #else __pyx_ptype_8petsc4py_5PETSc_Object = &PyPetscObject_Type; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_8petsc4py_5PETSc_Object) < 0) __PYX_ERR(35, 3, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_8petsc4py_5PETSc_Object->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_8petsc4py_5PETSc_Object->tp_dictoffset && __pyx_ptype_8petsc4py_5PETSc_Object->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_8petsc4py_5PETSc_Object->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_ptype_8petsc4py_5PETSc_Object, __pyx_vtabptr_8petsc4py_5PETSc_Object) < 0) __PYX_ERR(35, 3, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_8petsc4py_5PETSc_Object) < 0) __PYX_ERR(35, 3, __pyx_L1_error) #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Object, (PyObject *) __pyx_ptype_8petsc4py_5PETSc_Object) < 0) __PYX_ERR(35, 3, __pyx_L1_error) if (__pyx_ptype_8petsc4py_5PETSc_Object->tp_weaklistoffset == 0) __pyx_ptype_8petsc4py_5PETSc_Object->tp_weaklistoffset = offsetof(struct PyPetscObjectObject, __weakref__); __pyx_vtabptr_8petsc4py_5PETSc_Viewer = &__pyx_vtable_8petsc4py_5PETSc_Viewer; __pyx_vtable_8petsc4py_5PETSc_Viewer.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc_Object; #if CYTHON_USE_TYPE_SPECS __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Object); if (unlikely(!__pyx_t_1)) __PYX_ERR(37, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_8petsc4py_5PETSc_Viewer = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &PyPetscViewer_Type_spec, __pyx_t_1); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_ptype_8petsc4py_5PETSc_Viewer)) __PYX_ERR(37, 88, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&PyPetscViewer_Type_spec, __pyx_ptype_8petsc4py_5PETSc_Viewer) < 0) __PYX_ERR(37, 88, __pyx_L1_error) #else __pyx_ptype_8petsc4py_5PETSc_Viewer = &PyPetscViewer_Type; #endif #if !CYTHON_COMPILING_IN_LIMITED_API __pyx_ptype_8petsc4py_5PETSc_Viewer->tp_base = __pyx_ptype_8petsc4py_5PETSc_Object; #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_8petsc4py_5PETSc_Viewer) < 0) __PYX_ERR(37, 88, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_8petsc4py_5PETSc_Viewer->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_8petsc4py_5PETSc_Viewer->tp_dictoffset && __pyx_ptype_8petsc4py_5PETSc_Viewer->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_8petsc4py_5PETSc_Viewer->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif #if CYTHON_UPDATE_DESCRIPTOR_DOC { PyObject *wrapper = PyObject_GetAttrString((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Viewer, "__call__"); if (unlikely(!wrapper)) __PYX_ERR(37, 88, __pyx_L1_error) if (__Pyx_IS_TYPE(wrapper, &PyWrapperDescr_Type)) { __pyx_wrapperbase_8petsc4py_5PETSc_6Viewer_2__call__ = *((PyWrapperDescrObject *)wrapper)->d_base; __pyx_wrapperbase_8petsc4py_5PETSc_6Viewer_2__call__.doc = __pyx_doc_8petsc4py_5PETSc_6Viewer_2__call__; ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8petsc4py_5PETSc_6Viewer_2__call__; } } #endif if (__Pyx_SetVtable(__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_vtabptr_8petsc4py_5PETSc_Viewer) < 0) __PYX_ERR(37, 88, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_8petsc4py_5PETSc_Viewer) < 0) __PYX_ERR(37, 88, __pyx_L1_error) #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Viewer, (PyObject *) __pyx_ptype_8petsc4py_5PETSc_Viewer) < 0) __PYX_ERR(37, 88, __pyx_L1_error) if (__pyx_ptype_8petsc4py_5PETSc_Viewer->tp_weaklistoffset == 0) __pyx_ptype_8petsc4py_5PETSc_Viewer->tp_weaklistoffset = offsetof(struct PyPetscViewerObject, __pyx_base.__weakref__); __pyx_vtabptr_8petsc4py_5PETSc_Random = &__pyx_vtable_8petsc4py_5PETSc_Random; __pyx_vtable_8petsc4py_5PETSc_Random.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc_Object; #if CYTHON_USE_TYPE_SPECS __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Object); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_8petsc4py_5PETSc_Random = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &PyPetscRandom_Type_spec, __pyx_t_1); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_ptype_8petsc4py_5PETSc_Random)) __PYX_ERR(38, 13, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&PyPetscRandom_Type_spec, __pyx_ptype_8petsc4py_5PETSc_Random) < 0) __PYX_ERR(38, 13, __pyx_L1_error) #else __pyx_ptype_8petsc4py_5PETSc_Random = &PyPetscRandom_Type; #endif #if !CYTHON_COMPILING_IN_LIMITED_API __pyx_ptype_8petsc4py_5PETSc_Random->tp_base = __pyx_ptype_8petsc4py_5PETSc_Object; #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_8petsc4py_5PETSc_Random) < 0) __PYX_ERR(38, 13, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_8petsc4py_5PETSc_Random->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_8petsc4py_5PETSc_Random->tp_dictoffset && __pyx_ptype_8petsc4py_5PETSc_Random->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_8petsc4py_5PETSc_Random->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif #if CYTHON_UPDATE_DESCRIPTOR_DOC { PyObject *wrapper = PyObject_GetAttrString((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Random, "__call__"); if (unlikely(!wrapper)) __PYX_ERR(38, 13, __pyx_L1_error) if (__Pyx_IS_TYPE(wrapper, &PyWrapperDescr_Type)) { __pyx_wrapperbase_8petsc4py_5PETSc_6Random_2__call__ = *((PyWrapperDescrObject *)wrapper)->d_base; __pyx_wrapperbase_8petsc4py_5PETSc_6Random_2__call__.doc = __pyx_doc_8petsc4py_5PETSc_6Random_2__call__; ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8petsc4py_5PETSc_6Random_2__call__; } } #endif if (__Pyx_SetVtable(__pyx_ptype_8petsc4py_5PETSc_Random, __pyx_vtabptr_8petsc4py_5PETSc_Random) < 0) __PYX_ERR(38, 13, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_8petsc4py_5PETSc_Random) < 0) __PYX_ERR(38, 13, __pyx_L1_error) #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Random, (PyObject *) __pyx_ptype_8petsc4py_5PETSc_Random) < 0) __PYX_ERR(38, 13, __pyx_L1_error) if (__pyx_ptype_8petsc4py_5PETSc_Random->tp_weaklistoffset == 0) __pyx_ptype_8petsc4py_5PETSc_Random->tp_weaklistoffset = offsetof(struct PyPetscRandomObject, __pyx_base.__weakref__); #if CYTHON_USE_TYPE_SPECS __pyx_ptype_8petsc4py_5PETSc_Device = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &PyPetscDevice_Type_spec, NULL); if (unlikely(!__pyx_ptype_8petsc4py_5PETSc_Device)) __PYX_ERR(2, 71, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&PyPetscDevice_Type_spec, __pyx_ptype_8petsc4py_5PETSc_Device) < 0) __PYX_ERR(2, 71, __pyx_L1_error) #else __pyx_ptype_8petsc4py_5PETSc_Device = &PyPetscDevice_Type; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_8petsc4py_5PETSc_Device) < 0) __PYX_ERR(2, 71, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_8petsc4py_5PETSc_Device->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_8petsc4py_5PETSc_Device->tp_dictoffset && __pyx_ptype_8petsc4py_5PETSc_Device->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_8petsc4py_5PETSc_Device->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Device, (PyObject *) __pyx_ptype_8petsc4py_5PETSc_Device) < 0) __PYX_ERR(2, 71, __pyx_L1_error) if (__pyx_ptype_8petsc4py_5PETSc_Device->tp_weaklistoffset == 0) __pyx_ptype_8petsc4py_5PETSc_Device->tp_weaklistoffset = offsetof(struct PyPetscDeviceObject, __weakref__); __pyx_vtabptr_8petsc4py_5PETSc_DeviceContext = &__pyx_vtable_8petsc4py_5PETSc_DeviceContext; __pyx_vtable_8petsc4py_5PETSc_DeviceContext.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc_Object; #if CYTHON_USE_TYPE_SPECS __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Object); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_8petsc4py_5PETSc_DeviceContext = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &PyPetscDeviceContext_Type_spec, __pyx_t_1); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_ptype_8petsc4py_5PETSc_DeviceContext)) __PYX_ERR(2, 219, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&PyPetscDeviceContext_Type_spec, __pyx_ptype_8petsc4py_5PETSc_DeviceContext) < 0) __PYX_ERR(2, 219, __pyx_L1_error) #else __pyx_ptype_8petsc4py_5PETSc_DeviceContext = &PyPetscDeviceContext_Type; #endif #if !CYTHON_COMPILING_IN_LIMITED_API __pyx_ptype_8petsc4py_5PETSc_DeviceContext->tp_base = __pyx_ptype_8petsc4py_5PETSc_Object; #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_8petsc4py_5PETSc_DeviceContext) < 0) __PYX_ERR(2, 219, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_8petsc4py_5PETSc_DeviceContext->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_8petsc4py_5PETSc_DeviceContext->tp_dictoffset && __pyx_ptype_8petsc4py_5PETSc_DeviceContext->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_8petsc4py_5PETSc_DeviceContext->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_ptype_8petsc4py_5PETSc_DeviceContext, __pyx_vtabptr_8petsc4py_5PETSc_DeviceContext) < 0) __PYX_ERR(2, 219, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_8petsc4py_5PETSc_DeviceContext) < 0) __PYX_ERR(2, 219, __pyx_L1_error) #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DeviceContext, (PyObject *) __pyx_ptype_8petsc4py_5PETSc_DeviceContext) < 0) __PYX_ERR(2, 219, __pyx_L1_error) if (__pyx_ptype_8petsc4py_5PETSc_DeviceContext->tp_weaklistoffset == 0) __pyx_ptype_8petsc4py_5PETSc_DeviceContext->tp_weaklistoffset = offsetof(struct PyPetscDeviceContextObject, __pyx_base.__weakref__); __pyx_vtabptr_8petsc4py_5PETSc_IS = &__pyx_vtable_8petsc4py_5PETSc_IS; __pyx_vtable_8petsc4py_5PETSc_IS.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc_Object; #if CYTHON_USE_TYPE_SPECS __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Object); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_8petsc4py_5PETSc_IS = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &PyPetscIS_Type_spec, __pyx_t_1); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_ptype_8petsc4py_5PETSc_IS)) __PYX_ERR(39, 10, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API __pyx_ptype_8petsc4py_5PETSc_IS->tp_as_buffer = &__pyx_tp_as_buffer_IS; #elif defined(Py_bf_getbuffer) && defined(Py_bf_releasebuffer) /* PY_VERSION_HEX >= 0x03090000 || Py_LIMITED_API >= 0x030B0000 */ #elif defined(_MSC_VER) #pragma message ("The buffer protocol is not supported in the Limited C-API < 3.11.") #else #warning "The buffer protocol is not supported in the Limited C-API < 3.11." #endif if (__Pyx_fix_up_extension_type_from_spec(&PyPetscIS_Type_spec, __pyx_ptype_8petsc4py_5PETSc_IS) < 0) __PYX_ERR(39, 10, __pyx_L1_error) #else __pyx_ptype_8petsc4py_5PETSc_IS = &PyPetscIS_Type; #endif #if !CYTHON_COMPILING_IN_LIMITED_API __pyx_ptype_8petsc4py_5PETSc_IS->tp_base = __pyx_ptype_8petsc4py_5PETSc_Object; #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_8petsc4py_5PETSc_IS) < 0) __PYX_ERR(39, 10, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_8petsc4py_5PETSc_IS->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_8petsc4py_5PETSc_IS->tp_dictoffset && __pyx_ptype_8petsc4py_5PETSc_IS->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_8petsc4py_5PETSc_IS->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_vtabptr_8petsc4py_5PETSc_IS) < 0) __PYX_ERR(39, 10, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_8petsc4py_5PETSc_IS) < 0) __PYX_ERR(39, 10, __pyx_L1_error) #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_IS, (PyObject *) __pyx_ptype_8petsc4py_5PETSc_IS) < 0) __PYX_ERR(39, 10, __pyx_L1_error) if (__pyx_ptype_8petsc4py_5PETSc_IS->tp_weaklistoffset == 0) __pyx_ptype_8petsc4py_5PETSc_IS->tp_weaklistoffset = offsetof(struct PyPetscISObject, __pyx_base.__weakref__); __pyx_vtabptr_8petsc4py_5PETSc_LGMap = &__pyx_vtable_8petsc4py_5PETSc_LGMap; __pyx_vtable_8petsc4py_5PETSc_LGMap.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc_Object; #if CYTHON_USE_TYPE_SPECS __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Object); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 1077, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_8petsc4py_5PETSc_LGMap = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &PyPetscLGMap_Type_spec, __pyx_t_1); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_ptype_8petsc4py_5PETSc_LGMap)) __PYX_ERR(39, 1077, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&PyPetscLGMap_Type_spec, __pyx_ptype_8petsc4py_5PETSc_LGMap) < 0) __PYX_ERR(39, 1077, __pyx_L1_error) #else __pyx_ptype_8petsc4py_5PETSc_LGMap = &PyPetscLGMap_Type; #endif #if !CYTHON_COMPILING_IN_LIMITED_API __pyx_ptype_8petsc4py_5PETSc_LGMap->tp_base = __pyx_ptype_8petsc4py_5PETSc_Object; #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_8petsc4py_5PETSc_LGMap) < 0) __PYX_ERR(39, 1077, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_8petsc4py_5PETSc_LGMap->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_8petsc4py_5PETSc_LGMap->tp_dictoffset && __pyx_ptype_8petsc4py_5PETSc_LGMap->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_8petsc4py_5PETSc_LGMap->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif #if CYTHON_UPDATE_DESCRIPTOR_DOC { PyObject *wrapper = PyObject_GetAttrString((PyObject *)__pyx_ptype_8petsc4py_5PETSc_LGMap, "__call__"); if (unlikely(!wrapper)) __PYX_ERR(39, 1077, __pyx_L1_error) if (__Pyx_IS_TYPE(wrapper, &PyWrapperDescr_Type)) { __pyx_wrapperbase_8petsc4py_5PETSc_5LGMap_2__call__ = *((PyWrapperDescrObject *)wrapper)->d_base; __pyx_wrapperbase_8petsc4py_5PETSc_5LGMap_2__call__.doc = __pyx_doc_8petsc4py_5PETSc_5LGMap_2__call__; ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8petsc4py_5PETSc_5LGMap_2__call__; } } #endif if (__Pyx_SetVtable(__pyx_ptype_8petsc4py_5PETSc_LGMap, __pyx_vtabptr_8petsc4py_5PETSc_LGMap) < 0) __PYX_ERR(39, 1077, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_8petsc4py_5PETSc_LGMap) < 0) __PYX_ERR(39, 1077, __pyx_L1_error) #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_LGMap, (PyObject *) __pyx_ptype_8petsc4py_5PETSc_LGMap) < 0) __PYX_ERR(39, 1077, __pyx_L1_error) if (__pyx_ptype_8petsc4py_5PETSc_LGMap->tp_weaklistoffset == 0) __pyx_ptype_8petsc4py_5PETSc_LGMap->tp_weaklistoffset = offsetof(struct PyPetscLGMapObject, __pyx_base.__weakref__); __pyx_vtabptr_8petsc4py_5PETSc_SF = &__pyx_vtable_8petsc4py_5PETSc_SF; __pyx_vtable_8petsc4py_5PETSc_SF.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc_Object; #if CYTHON_USE_TYPE_SPECS __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Object); if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_8petsc4py_5PETSc_SF = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &PyPetscSF_Type_spec, __pyx_t_1); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_ptype_8petsc4py_5PETSc_SF)) __PYX_ERR(40, 15, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&PyPetscSF_Type_spec, __pyx_ptype_8petsc4py_5PETSc_SF) < 0) __PYX_ERR(40, 15, __pyx_L1_error) #else __pyx_ptype_8petsc4py_5PETSc_SF = &PyPetscSF_Type; #endif #if !CYTHON_COMPILING_IN_LIMITED_API __pyx_ptype_8petsc4py_5PETSc_SF->tp_base = __pyx_ptype_8petsc4py_5PETSc_Object; #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_8petsc4py_5PETSc_SF) < 0) __PYX_ERR(40, 15, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_8petsc4py_5PETSc_SF->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_8petsc4py_5PETSc_SF->tp_dictoffset && __pyx_ptype_8petsc4py_5PETSc_SF->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_8petsc4py_5PETSc_SF->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_ptype_8petsc4py_5PETSc_SF, __pyx_vtabptr_8petsc4py_5PETSc_SF) < 0) __PYX_ERR(40, 15, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_8petsc4py_5PETSc_SF) < 0) __PYX_ERR(40, 15, __pyx_L1_error) #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SF, (PyObject *) __pyx_ptype_8petsc4py_5PETSc_SF) < 0) __PYX_ERR(40, 15, __pyx_L1_error) if (__pyx_ptype_8petsc4py_5PETSc_SF->tp_weaklistoffset == 0) __pyx_ptype_8petsc4py_5PETSc_SF->tp_weaklistoffset = offsetof(struct PyPetscSFObject, __pyx_base.__weakref__); __pyx_vtabptr_8petsc4py_5PETSc_Vec = &__pyx_vtable_8petsc4py_5PETSc_Vec; __pyx_vtable_8petsc4py_5PETSc_Vec.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc_Object; #if CYTHON_USE_TYPE_SPECS __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Object); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_8petsc4py_5PETSc_Vec = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &PyPetscVec_Type_spec, __pyx_t_1); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_ptype_8petsc4py_5PETSc_Vec)) __PYX_ERR(41, 29, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API __pyx_ptype_8petsc4py_5PETSc_Vec->tp_as_buffer = &__pyx_tp_as_buffer_Vec; #elif defined(Py_bf_getbuffer) && defined(Py_bf_releasebuffer) /* PY_VERSION_HEX >= 0x03090000 || Py_LIMITED_API >= 0x030B0000 */ #elif defined(_MSC_VER) #pragma message ("The buffer protocol is not supported in the Limited C-API < 3.11.") #else #warning "The buffer protocol is not supported in the Limited C-API < 3.11." #endif if (__Pyx_fix_up_extension_type_from_spec(&PyPetscVec_Type_spec, __pyx_ptype_8petsc4py_5PETSc_Vec) < 0) __PYX_ERR(41, 29, __pyx_L1_error) #else __pyx_ptype_8petsc4py_5PETSc_Vec = &PyPetscVec_Type; #endif #if !CYTHON_COMPILING_IN_LIMITED_API __pyx_ptype_8petsc4py_5PETSc_Vec->tp_base = __pyx_ptype_8petsc4py_5PETSc_Object; #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_8petsc4py_5PETSc_Vec) < 0) __PYX_ERR(41, 29, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_8petsc4py_5PETSc_Vec->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_8petsc4py_5PETSc_Vec->tp_dictoffset && __pyx_ptype_8petsc4py_5PETSc_Vec->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_8petsc4py_5PETSc_Vec->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_vtabptr_8petsc4py_5PETSc_Vec) < 0) __PYX_ERR(41, 29, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_8petsc4py_5PETSc_Vec) < 0) __PYX_ERR(41, 29, __pyx_L1_error) #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Vec, (PyObject *) __pyx_ptype_8petsc4py_5PETSc_Vec) < 0) __PYX_ERR(41, 29, __pyx_L1_error) if (__pyx_ptype_8petsc4py_5PETSc_Vec->tp_weaklistoffset == 0) __pyx_ptype_8petsc4py_5PETSc_Vec->tp_weaklistoffset = offsetof(struct PyPetscVecObject, __pyx_base.__weakref__); __pyx_vtabptr_8petsc4py_5PETSc_Space = &__pyx_vtable_8petsc4py_5PETSc_Space; __pyx_vtable_8petsc4py_5PETSc_Space.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc_Object; #if CYTHON_USE_TYPE_SPECS __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Object); if (unlikely(!__pyx_t_1)) __PYX_ERR(64, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_8petsc4py_5PETSc_Space = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &PyPetscSpace_Type_spec, __pyx_t_1); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_ptype_8petsc4py_5PETSc_Space)) __PYX_ERR(64, 14, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&PyPetscSpace_Type_spec, __pyx_ptype_8petsc4py_5PETSc_Space) < 0) __PYX_ERR(64, 14, __pyx_L1_error) #else __pyx_ptype_8petsc4py_5PETSc_Space = &PyPetscSpace_Type; #endif #if !CYTHON_COMPILING_IN_LIMITED_API __pyx_ptype_8petsc4py_5PETSc_Space->tp_base = __pyx_ptype_8petsc4py_5PETSc_Object; #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_8petsc4py_5PETSc_Space) < 0) __PYX_ERR(64, 14, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_8petsc4py_5PETSc_Space->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_8petsc4py_5PETSc_Space->tp_dictoffset && __pyx_ptype_8petsc4py_5PETSc_Space->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_8petsc4py_5PETSc_Space->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_ptype_8petsc4py_5PETSc_Space, __pyx_vtabptr_8petsc4py_5PETSc_Space) < 0) __PYX_ERR(64, 14, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_8petsc4py_5PETSc_Space) < 0) __PYX_ERR(64, 14, __pyx_L1_error) #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Space, (PyObject *) __pyx_ptype_8petsc4py_5PETSc_Space) < 0) __PYX_ERR(64, 14, __pyx_L1_error) if (__pyx_ptype_8petsc4py_5PETSc_Space->tp_weaklistoffset == 0) __pyx_ptype_8petsc4py_5PETSc_Space->tp_weaklistoffset = offsetof(struct PyPetscSpaceObject, __pyx_base.__weakref__); __pyx_vtabptr_8petsc4py_5PETSc_DualSpace = &__pyx_vtable_8petsc4py_5PETSc_DualSpace; __pyx_vtable_8petsc4py_5PETSc_DualSpace.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc_Object; #if CYTHON_USE_TYPE_SPECS __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Object); if (unlikely(!__pyx_t_1)) __PYX_ERR(64, 560, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_8petsc4py_5PETSc_DualSpace = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &PyPetscDualSpace_Type_spec, __pyx_t_1); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_ptype_8petsc4py_5PETSc_DualSpace)) __PYX_ERR(64, 560, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&PyPetscDualSpace_Type_spec, __pyx_ptype_8petsc4py_5PETSc_DualSpace) < 0) __PYX_ERR(64, 560, __pyx_L1_error) #else __pyx_ptype_8petsc4py_5PETSc_DualSpace = &PyPetscDualSpace_Type; #endif #if !CYTHON_COMPILING_IN_LIMITED_API __pyx_ptype_8petsc4py_5PETSc_DualSpace->tp_base = __pyx_ptype_8petsc4py_5PETSc_Object; #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_8petsc4py_5PETSc_DualSpace) < 0) __PYX_ERR(64, 560, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_8petsc4py_5PETSc_DualSpace->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_8petsc4py_5PETSc_DualSpace->tp_dictoffset && __pyx_ptype_8petsc4py_5PETSc_DualSpace->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_8petsc4py_5PETSc_DualSpace->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_ptype_8petsc4py_5PETSc_DualSpace, __pyx_vtabptr_8petsc4py_5PETSc_DualSpace) < 0) __PYX_ERR(64, 560, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_8petsc4py_5PETSc_DualSpace) < 0) __PYX_ERR(64, 560, __pyx_L1_error) #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DualSpace, (PyObject *) __pyx_ptype_8petsc4py_5PETSc_DualSpace) < 0) __PYX_ERR(64, 560, __pyx_L1_error) if (__pyx_ptype_8petsc4py_5PETSc_DualSpace->tp_weaklistoffset == 0) __pyx_ptype_8petsc4py_5PETSc_DualSpace->tp_weaklistoffset = offsetof(struct PyPetscDualSpaceObject, __pyx_base.__weakref__); __pyx_vtabptr_8petsc4py_5PETSc_FE = &__pyx_vtable_8petsc4py_5PETSc_FE; __pyx_vtable_8petsc4py_5PETSc_FE.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc_Object; #if CYTHON_USE_TYPE_SPECS __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Object); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_8petsc4py_5PETSc_FE = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &PyPetscFE_Type_spec, __pyx_t_1); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_ptype_8petsc4py_5PETSc_FE)) __PYX_ERR(43, 10, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&PyPetscFE_Type_spec, __pyx_ptype_8petsc4py_5PETSc_FE) < 0) __PYX_ERR(43, 10, __pyx_L1_error) #else __pyx_ptype_8petsc4py_5PETSc_FE = &PyPetscFE_Type; #endif #if !CYTHON_COMPILING_IN_LIMITED_API __pyx_ptype_8petsc4py_5PETSc_FE->tp_base = __pyx_ptype_8petsc4py_5PETSc_Object; #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_8petsc4py_5PETSc_FE) < 0) __PYX_ERR(43, 10, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_8petsc4py_5PETSc_FE->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_8petsc4py_5PETSc_FE->tp_dictoffset && __pyx_ptype_8petsc4py_5PETSc_FE->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_8petsc4py_5PETSc_FE->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_ptype_8petsc4py_5PETSc_FE, __pyx_vtabptr_8petsc4py_5PETSc_FE) < 0) __PYX_ERR(43, 10, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_8petsc4py_5PETSc_FE) < 0) __PYX_ERR(43, 10, __pyx_L1_error) #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FE, (PyObject *) __pyx_ptype_8petsc4py_5PETSc_FE) < 0) __PYX_ERR(43, 10, __pyx_L1_error) if (__pyx_ptype_8petsc4py_5PETSc_FE->tp_weaklistoffset == 0) __pyx_ptype_8petsc4py_5PETSc_FE->tp_weaklistoffset = offsetof(struct PyPetscFEObject, __pyx_base.__weakref__); __pyx_vtabptr_8petsc4py_5PETSc_Quad = &__pyx_vtable_8petsc4py_5PETSc_Quad; __pyx_vtable_8petsc4py_5PETSc_Quad.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc_Object; #if CYTHON_USE_TYPE_SPECS __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Object); if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_8petsc4py_5PETSc_Quad = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &PyPetscQuad_Type_spec, __pyx_t_1); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_ptype_8petsc4py_5PETSc_Quad)) __PYX_ERR(42, 3, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&PyPetscQuad_Type_spec, __pyx_ptype_8petsc4py_5PETSc_Quad) < 0) __PYX_ERR(42, 3, __pyx_L1_error) #else __pyx_ptype_8petsc4py_5PETSc_Quad = &PyPetscQuad_Type; #endif #if !CYTHON_COMPILING_IN_LIMITED_API __pyx_ptype_8petsc4py_5PETSc_Quad->tp_base = __pyx_ptype_8petsc4py_5PETSc_Object; #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_8petsc4py_5PETSc_Quad) < 0) __PYX_ERR(42, 3, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_8petsc4py_5PETSc_Quad->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_8petsc4py_5PETSc_Quad->tp_dictoffset && __pyx_ptype_8petsc4py_5PETSc_Quad->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_8petsc4py_5PETSc_Quad->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_ptype_8petsc4py_5PETSc_Quad, __pyx_vtabptr_8petsc4py_5PETSc_Quad) < 0) __PYX_ERR(42, 3, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_8petsc4py_5PETSc_Quad) < 0) __PYX_ERR(42, 3, __pyx_L1_error) #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Quad, (PyObject *) __pyx_ptype_8petsc4py_5PETSc_Quad) < 0) __PYX_ERR(42, 3, __pyx_L1_error) if (__pyx_ptype_8petsc4py_5PETSc_Quad->tp_weaklistoffset == 0) __pyx_ptype_8petsc4py_5PETSc_Quad->tp_weaklistoffset = offsetof(struct PyPetscQuadObject, __pyx_base.__weakref__); __pyx_vtabptr_8petsc4py_5PETSc_Scatter = &__pyx_vtable_8petsc4py_5PETSc_Scatter; __pyx_vtable_8petsc4py_5PETSc_Scatter.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc_Object; #if CYTHON_USE_TYPE_SPECS __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Object); if (unlikely(!__pyx_t_1)) __PYX_ERR(44, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_8petsc4py_5PETSc_Scatter = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &PyPetscScatter_Type_spec, __pyx_t_1); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_ptype_8petsc4py_5PETSc_Scatter)) __PYX_ERR(44, 22, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&PyPetscScatter_Type_spec, __pyx_ptype_8petsc4py_5PETSc_Scatter) < 0) __PYX_ERR(44, 22, __pyx_L1_error) #else __pyx_ptype_8petsc4py_5PETSc_Scatter = &PyPetscScatter_Type; #endif #if !CYTHON_COMPILING_IN_LIMITED_API __pyx_ptype_8petsc4py_5PETSc_Scatter->tp_base = __pyx_ptype_8petsc4py_5PETSc_Object; #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_8petsc4py_5PETSc_Scatter) < 0) __PYX_ERR(44, 22, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_8petsc4py_5PETSc_Scatter->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_8petsc4py_5PETSc_Scatter->tp_dictoffset && __pyx_ptype_8petsc4py_5PETSc_Scatter->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_8petsc4py_5PETSc_Scatter->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif #if CYTHON_UPDATE_DESCRIPTOR_DOC { PyObject *wrapper = PyObject_GetAttrString((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Scatter, "__call__"); if (unlikely(!wrapper)) __PYX_ERR(44, 22, __pyx_L1_error) if (__Pyx_IS_TYPE(wrapper, &PyWrapperDescr_Type)) { __pyx_wrapperbase_8petsc4py_5PETSc_7Scatter_2__call__ = *((PyWrapperDescrObject *)wrapper)->d_base; __pyx_wrapperbase_8petsc4py_5PETSc_7Scatter_2__call__.doc = __pyx_doc_8petsc4py_5PETSc_7Scatter_2__call__; ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8petsc4py_5PETSc_7Scatter_2__call__; } } #endif if (__Pyx_SetVtable(__pyx_ptype_8petsc4py_5PETSc_Scatter, __pyx_vtabptr_8petsc4py_5PETSc_Scatter) < 0) __PYX_ERR(44, 22, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_8petsc4py_5PETSc_Scatter) < 0) __PYX_ERR(44, 22, __pyx_L1_error) #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Scatter, (PyObject *) __pyx_ptype_8petsc4py_5PETSc_Scatter) < 0) __PYX_ERR(44, 22, __pyx_L1_error) if (__pyx_ptype_8petsc4py_5PETSc_Scatter->tp_weaklistoffset == 0) __pyx_ptype_8petsc4py_5PETSc_Scatter->tp_weaklistoffset = offsetof(struct PyPetscScatterObject, __pyx_base.__weakref__); __pyx_vtabptr_8petsc4py_5PETSc_Section = &__pyx_vtable_8petsc4py_5PETSc_Section; __pyx_vtable_8petsc4py_5PETSc_Section.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc_Object; #if CYTHON_USE_TYPE_SPECS __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Object); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_8petsc4py_5PETSc_Section = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &PyPetscSection_Type_spec, __pyx_t_1); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_ptype_8petsc4py_5PETSc_Section)) __PYX_ERR(45, 3, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&PyPetscSection_Type_spec, __pyx_ptype_8petsc4py_5PETSc_Section) < 0) __PYX_ERR(45, 3, __pyx_L1_error) #else __pyx_ptype_8petsc4py_5PETSc_Section = &PyPetscSection_Type; #endif #if !CYTHON_COMPILING_IN_LIMITED_API __pyx_ptype_8petsc4py_5PETSc_Section->tp_base = __pyx_ptype_8petsc4py_5PETSc_Object; #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_8petsc4py_5PETSc_Section) < 0) __PYX_ERR(45, 3, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_8petsc4py_5PETSc_Section->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_8petsc4py_5PETSc_Section->tp_dictoffset && __pyx_ptype_8petsc4py_5PETSc_Section->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_8petsc4py_5PETSc_Section->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_ptype_8petsc4py_5PETSc_Section, __pyx_vtabptr_8petsc4py_5PETSc_Section) < 0) __PYX_ERR(45, 3, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_8petsc4py_5PETSc_Section) < 0) __PYX_ERR(45, 3, __pyx_L1_error) #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Section, (PyObject *) __pyx_ptype_8petsc4py_5PETSc_Section) < 0) __PYX_ERR(45, 3, __pyx_L1_error) if (__pyx_ptype_8petsc4py_5PETSc_Section->tp_weaklistoffset == 0) __pyx_ptype_8petsc4py_5PETSc_Section->tp_weaklistoffset = offsetof(struct PyPetscSectionObject, __pyx_base.__weakref__); __pyx_vtabptr_8petsc4py_5PETSc_Mat = &__pyx_vtable_8petsc4py_5PETSc_Mat; __pyx_vtable_8petsc4py_5PETSc_Mat.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc_Object; #if CYTHON_USE_TYPE_SPECS __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Object); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_8petsc4py_5PETSc_Mat = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &PyPetscMat_Type_spec, __pyx_t_1); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_ptype_8petsc4py_5PETSc_Mat)) __PYX_ERR(46, 329, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&PyPetscMat_Type_spec, __pyx_ptype_8petsc4py_5PETSc_Mat) < 0) __PYX_ERR(46, 329, __pyx_L1_error) #else __pyx_ptype_8petsc4py_5PETSc_Mat = &PyPetscMat_Type; #endif #if !CYTHON_COMPILING_IN_LIMITED_API __pyx_ptype_8petsc4py_5PETSc_Mat->tp_base = __pyx_ptype_8petsc4py_5PETSc_Object; #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_8petsc4py_5PETSc_Mat) < 0) __PYX_ERR(46, 329, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_8petsc4py_5PETSc_Mat->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_8petsc4py_5PETSc_Mat->tp_dictoffset && __pyx_ptype_8petsc4py_5PETSc_Mat->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_8petsc4py_5PETSc_Mat->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_vtabptr_8petsc4py_5PETSc_Mat) < 0) __PYX_ERR(46, 329, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_8petsc4py_5PETSc_Mat) < 0) __PYX_ERR(46, 329, __pyx_L1_error) #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Mat, (PyObject *) __pyx_ptype_8petsc4py_5PETSc_Mat) < 0) __PYX_ERR(46, 329, __pyx_L1_error) if (__pyx_ptype_8petsc4py_5PETSc_Mat->tp_weaklistoffset == 0) __pyx_ptype_8petsc4py_5PETSc_Mat->tp_weaklistoffset = offsetof(struct PyPetscMatObject, __pyx_base.__weakref__); __pyx_vtabptr_8petsc4py_5PETSc_MatPartitioning = &__pyx_vtable_8petsc4py_5PETSc_MatPartitioning; __pyx_vtable_8petsc4py_5PETSc_MatPartitioning.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc_Object; #if CYTHON_USE_TYPE_SPECS __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Object); if (unlikely(!__pyx_t_1)) __PYX_ERR(47, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_8petsc4py_5PETSc_MatPartitioning = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &PyPetscMatPartitioning_Type_spec, __pyx_t_1); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_ptype_8petsc4py_5PETSc_MatPartitioning)) __PYX_ERR(47, 15, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&PyPetscMatPartitioning_Type_spec, __pyx_ptype_8petsc4py_5PETSc_MatPartitioning) < 0) __PYX_ERR(47, 15, __pyx_L1_error) #else __pyx_ptype_8petsc4py_5PETSc_MatPartitioning = &PyPetscMatPartitioning_Type; #endif #if !CYTHON_COMPILING_IN_LIMITED_API __pyx_ptype_8petsc4py_5PETSc_MatPartitioning->tp_base = __pyx_ptype_8petsc4py_5PETSc_Object; #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_8petsc4py_5PETSc_MatPartitioning) < 0) __PYX_ERR(47, 15, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_8petsc4py_5PETSc_MatPartitioning->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_8petsc4py_5PETSc_MatPartitioning->tp_dictoffset && __pyx_ptype_8petsc4py_5PETSc_MatPartitioning->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_8petsc4py_5PETSc_MatPartitioning->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_ptype_8petsc4py_5PETSc_MatPartitioning, __pyx_vtabptr_8petsc4py_5PETSc_MatPartitioning) < 0) __PYX_ERR(47, 15, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_8petsc4py_5PETSc_MatPartitioning) < 0) __PYX_ERR(47, 15, __pyx_L1_error) #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_MatPartitioning, (PyObject *) __pyx_ptype_8petsc4py_5PETSc_MatPartitioning) < 0) __PYX_ERR(47, 15, __pyx_L1_error) if (__pyx_ptype_8petsc4py_5PETSc_MatPartitioning->tp_weaklistoffset == 0) __pyx_ptype_8petsc4py_5PETSc_MatPartitioning->tp_weaklistoffset = offsetof(struct PyPetscMatPartitioningObject, __pyx_base.__weakref__); __pyx_vtabptr_8petsc4py_5PETSc_NullSpace = &__pyx_vtable_8petsc4py_5PETSc_NullSpace; __pyx_vtable_8petsc4py_5PETSc_NullSpace.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc_Object; #if CYTHON_USE_TYPE_SPECS __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Object); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 5605, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_8petsc4py_5PETSc_NullSpace = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &PyPetscNullSpace_Type_spec, __pyx_t_1); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_ptype_8petsc4py_5PETSc_NullSpace)) __PYX_ERR(46, 5605, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&PyPetscNullSpace_Type_spec, __pyx_ptype_8petsc4py_5PETSc_NullSpace) < 0) __PYX_ERR(46, 5605, __pyx_L1_error) #else __pyx_ptype_8petsc4py_5PETSc_NullSpace = &PyPetscNullSpace_Type; #endif #if !CYTHON_COMPILING_IN_LIMITED_API __pyx_ptype_8petsc4py_5PETSc_NullSpace->tp_base = __pyx_ptype_8petsc4py_5PETSc_Object; #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_8petsc4py_5PETSc_NullSpace) < 0) __PYX_ERR(46, 5605, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_8petsc4py_5PETSc_NullSpace->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_8petsc4py_5PETSc_NullSpace->tp_dictoffset && __pyx_ptype_8petsc4py_5PETSc_NullSpace->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_8petsc4py_5PETSc_NullSpace->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_ptype_8petsc4py_5PETSc_NullSpace, __pyx_vtabptr_8petsc4py_5PETSc_NullSpace) < 0) __PYX_ERR(46, 5605, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_8petsc4py_5PETSc_NullSpace) < 0) __PYX_ERR(46, 5605, __pyx_L1_error) #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_NullSpace, (PyObject *) __pyx_ptype_8petsc4py_5PETSc_NullSpace) < 0) __PYX_ERR(46, 5605, __pyx_L1_error) if (__pyx_ptype_8petsc4py_5PETSc_NullSpace->tp_weaklistoffset == 0) __pyx_ptype_8petsc4py_5PETSc_NullSpace->tp_weaklistoffset = offsetof(struct PyPetscNullSpaceObject, __pyx_base.__weakref__); __pyx_vtabptr_8petsc4py_5PETSc_PC = &__pyx_vtable_8petsc4py_5PETSc_PC; __pyx_vtable_8petsc4py_5PETSc_PC.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc_Object; #if CYTHON_USE_TYPE_SPECS __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Object); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_8petsc4py_5PETSc_PC = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &PyPetscPC_Type_spec, __pyx_t_1); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_ptype_8petsc4py_5PETSc_PC)) __PYX_ERR(48, 160, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&PyPetscPC_Type_spec, __pyx_ptype_8petsc4py_5PETSc_PC) < 0) __PYX_ERR(48, 160, __pyx_L1_error) #else __pyx_ptype_8petsc4py_5PETSc_PC = &PyPetscPC_Type; #endif #if !CYTHON_COMPILING_IN_LIMITED_API __pyx_ptype_8petsc4py_5PETSc_PC->tp_base = __pyx_ptype_8petsc4py_5PETSc_Object; #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_8petsc4py_5PETSc_PC) < 0) __PYX_ERR(48, 160, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_8petsc4py_5PETSc_PC->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_8petsc4py_5PETSc_PC->tp_dictoffset && __pyx_ptype_8petsc4py_5PETSc_PC->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_8petsc4py_5PETSc_PC->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_vtabptr_8petsc4py_5PETSc_PC) < 0) __PYX_ERR(48, 160, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_8petsc4py_5PETSc_PC) < 0) __PYX_ERR(48, 160, __pyx_L1_error) #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_PC, (PyObject *) __pyx_ptype_8petsc4py_5PETSc_PC) < 0) __PYX_ERR(48, 160, __pyx_L1_error) if (__pyx_ptype_8petsc4py_5PETSc_PC->tp_weaklistoffset == 0) __pyx_ptype_8petsc4py_5PETSc_PC->tp_weaklistoffset = offsetof(struct PyPetscPCObject, __pyx_base.__weakref__); __pyx_vtabptr_8petsc4py_5PETSc_KSP = &__pyx_vtable_8petsc4py_5PETSc_KSP; __pyx_vtable_8petsc4py_5PETSc_KSP.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc_Object; #if CYTHON_USE_TYPE_SPECS __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Object); if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 369, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_8petsc4py_5PETSc_KSP = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &PyPetscKSP_Type_spec, __pyx_t_1); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_ptype_8petsc4py_5PETSc_KSP)) __PYX_ERR(49, 369, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&PyPetscKSP_Type_spec, __pyx_ptype_8petsc4py_5PETSc_KSP) < 0) __PYX_ERR(49, 369, __pyx_L1_error) #else __pyx_ptype_8petsc4py_5PETSc_KSP = &PyPetscKSP_Type; #endif #if !CYTHON_COMPILING_IN_LIMITED_API __pyx_ptype_8petsc4py_5PETSc_KSP->tp_base = __pyx_ptype_8petsc4py_5PETSc_Object; #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_8petsc4py_5PETSc_KSP) < 0) __PYX_ERR(49, 369, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_8petsc4py_5PETSc_KSP->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_8petsc4py_5PETSc_KSP->tp_dictoffset && __pyx_ptype_8petsc4py_5PETSc_KSP->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_8petsc4py_5PETSc_KSP->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif #if CYTHON_UPDATE_DESCRIPTOR_DOC { PyObject *wrapper = PyObject_GetAttrString((PyObject *)__pyx_ptype_8petsc4py_5PETSc_KSP, "__call__"); if (unlikely(!wrapper)) __PYX_ERR(49, 369, __pyx_L1_error) if (__Pyx_IS_TYPE(wrapper, &PyWrapperDescr_Type)) { __pyx_wrapperbase_8petsc4py_5PETSc_3KSP_2__call__ = *((PyWrapperDescrObject *)wrapper)->d_base; __pyx_wrapperbase_8petsc4py_5PETSc_3KSP_2__call__.doc = __pyx_doc_8petsc4py_5PETSc_3KSP_2__call__; ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8petsc4py_5PETSc_3KSP_2__call__; } } #endif if (__Pyx_SetVtable(__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_vtabptr_8petsc4py_5PETSc_KSP) < 0) __PYX_ERR(49, 369, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_8petsc4py_5PETSc_KSP) < 0) __PYX_ERR(49, 369, __pyx_L1_error) #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_KSP, (PyObject *) __pyx_ptype_8petsc4py_5PETSc_KSP) < 0) __PYX_ERR(49, 369, __pyx_L1_error) if (__pyx_ptype_8petsc4py_5PETSc_KSP->tp_weaklistoffset == 0) __pyx_ptype_8petsc4py_5PETSc_KSP->tp_weaklistoffset = offsetof(struct PyPetscKSPObject, __pyx_base.__weakref__); __pyx_vtabptr_8petsc4py_5PETSc_SNES = &__pyx_vtable_8petsc4py_5PETSc_SNES; __pyx_vtable_8petsc4py_5PETSc_SNES.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc_Object; #if CYTHON_USE_TYPE_SPECS __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Object); if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_8petsc4py_5PETSc_SNES = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &PyPetscSNES_Type_spec, __pyx_t_1); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_ptype_8petsc4py_5PETSc_SNES)) __PYX_ERR(50, 87, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&PyPetscSNES_Type_spec, __pyx_ptype_8petsc4py_5PETSc_SNES) < 0) __PYX_ERR(50, 87, __pyx_L1_error) #else __pyx_ptype_8petsc4py_5PETSc_SNES = &PyPetscSNES_Type; #endif #if !CYTHON_COMPILING_IN_LIMITED_API __pyx_ptype_8petsc4py_5PETSc_SNES->tp_base = __pyx_ptype_8petsc4py_5PETSc_Object; #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_8petsc4py_5PETSc_SNES) < 0) __PYX_ERR(50, 87, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_8petsc4py_5PETSc_SNES->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_8petsc4py_5PETSc_SNES->tp_dictoffset && __pyx_ptype_8petsc4py_5PETSc_SNES->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_8petsc4py_5PETSc_SNES->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_vtabptr_8petsc4py_5PETSc_SNES) < 0) __PYX_ERR(50, 87, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_8petsc4py_5PETSc_SNES) < 0) __PYX_ERR(50, 87, __pyx_L1_error) #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SNES, (PyObject *) __pyx_ptype_8petsc4py_5PETSc_SNES) < 0) __PYX_ERR(50, 87, __pyx_L1_error) if (__pyx_ptype_8petsc4py_5PETSc_SNES->tp_weaklistoffset == 0) __pyx_ptype_8petsc4py_5PETSc_SNES->tp_weaklistoffset = offsetof(struct PyPetscSNESObject, __pyx_base.__weakref__); __pyx_vtabptr_8petsc4py_5PETSc_TS = &__pyx_vtable_8petsc4py_5PETSc_TS; __pyx_vtable_8petsc4py_5PETSc_TS.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc_Object; #if CYTHON_USE_TYPE_SPECS __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Object); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_8petsc4py_5PETSc_TS = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &PyPetscTS_Type_spec, __pyx_t_1); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_ptype_8petsc4py_5PETSc_TS)) __PYX_ERR(51, 130, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&PyPetscTS_Type_spec, __pyx_ptype_8petsc4py_5PETSc_TS) < 0) __PYX_ERR(51, 130, __pyx_L1_error) #else __pyx_ptype_8petsc4py_5PETSc_TS = &PyPetscTS_Type; #endif #if !CYTHON_COMPILING_IN_LIMITED_API __pyx_ptype_8petsc4py_5PETSc_TS->tp_base = __pyx_ptype_8petsc4py_5PETSc_Object; #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_8petsc4py_5PETSc_TS) < 0) __PYX_ERR(51, 130, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_8petsc4py_5PETSc_TS->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_8petsc4py_5PETSc_TS->tp_dictoffset && __pyx_ptype_8petsc4py_5PETSc_TS->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_8petsc4py_5PETSc_TS->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_vtabptr_8petsc4py_5PETSc_TS) < 0) __PYX_ERR(51, 130, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_8petsc4py_5PETSc_TS) < 0) __PYX_ERR(51, 130, __pyx_L1_error) #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_TS, (PyObject *) __pyx_ptype_8petsc4py_5PETSc_TS) < 0) __PYX_ERR(51, 130, __pyx_L1_error) if (__pyx_ptype_8petsc4py_5PETSc_TS->tp_weaklistoffset == 0) __pyx_ptype_8petsc4py_5PETSc_TS->tp_weaklistoffset = offsetof(struct PyPetscTSObject, __pyx_base.__weakref__); __pyx_vtabptr_8petsc4py_5PETSc_TAO = &__pyx_vtable_8petsc4py_5PETSc_TAO; __pyx_vtable_8petsc4py_5PETSc_TAO.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc_Object; #if CYTHON_USE_TYPE_SPECS __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Object); if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_8petsc4py_5PETSc_TAO = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &PyPetscTAO_Type_spec, __pyx_t_1); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_ptype_8petsc4py_5PETSc_TAO)) __PYX_ERR(52, 89, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&PyPetscTAO_Type_spec, __pyx_ptype_8petsc4py_5PETSc_TAO) < 0) __PYX_ERR(52, 89, __pyx_L1_error) #else __pyx_ptype_8petsc4py_5PETSc_TAO = &PyPetscTAO_Type; #endif #if !CYTHON_COMPILING_IN_LIMITED_API __pyx_ptype_8petsc4py_5PETSc_TAO->tp_base = __pyx_ptype_8petsc4py_5PETSc_Object; #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_8petsc4py_5PETSc_TAO) < 0) __PYX_ERR(52, 89, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_8petsc4py_5PETSc_TAO->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_8petsc4py_5PETSc_TAO->tp_dictoffset && __pyx_ptype_8petsc4py_5PETSc_TAO->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_8petsc4py_5PETSc_TAO->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_vtabptr_8petsc4py_5PETSc_TAO) < 0) __PYX_ERR(52, 89, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_8petsc4py_5PETSc_TAO) < 0) __PYX_ERR(52, 89, __pyx_L1_error) #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_TAO, (PyObject *) __pyx_ptype_8petsc4py_5PETSc_TAO) < 0) __PYX_ERR(52, 89, __pyx_L1_error) if (__pyx_ptype_8petsc4py_5PETSc_TAO->tp_weaklistoffset == 0) __pyx_ptype_8petsc4py_5PETSc_TAO->tp_weaklistoffset = offsetof(struct PyPetscTAOObject, __pyx_base.__weakref__); __pyx_vtabptr_8petsc4py_5PETSc_TAOLineSearch = &__pyx_vtable_8petsc4py_5PETSc_TAOLineSearch; __pyx_vtable_8petsc4py_5PETSc_TAOLineSearch.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc_Object; #if CYTHON_USE_TYPE_SPECS __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Object); if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 1905, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_8petsc4py_5PETSc_TAOLineSearch = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &PyPetscTAOLineSearch_Type_spec, __pyx_t_1); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_ptype_8petsc4py_5PETSc_TAOLineSearch)) __PYX_ERR(52, 1905, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&PyPetscTAOLineSearch_Type_spec, __pyx_ptype_8petsc4py_5PETSc_TAOLineSearch) < 0) __PYX_ERR(52, 1905, __pyx_L1_error) #else __pyx_ptype_8petsc4py_5PETSc_TAOLineSearch = &PyPetscTAOLineSearch_Type; #endif #if !CYTHON_COMPILING_IN_LIMITED_API __pyx_ptype_8petsc4py_5PETSc_TAOLineSearch->tp_base = __pyx_ptype_8petsc4py_5PETSc_Object; #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_8petsc4py_5PETSc_TAOLineSearch) < 0) __PYX_ERR(52, 1905, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_8petsc4py_5PETSc_TAOLineSearch->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_8petsc4py_5PETSc_TAOLineSearch->tp_dictoffset && __pyx_ptype_8petsc4py_5PETSc_TAOLineSearch->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_8petsc4py_5PETSc_TAOLineSearch->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_ptype_8petsc4py_5PETSc_TAOLineSearch, __pyx_vtabptr_8petsc4py_5PETSc_TAOLineSearch) < 0) __PYX_ERR(52, 1905, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_8petsc4py_5PETSc_TAOLineSearch) < 0) __PYX_ERR(52, 1905, __pyx_L1_error) #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_TAOLineSearch, (PyObject *) __pyx_ptype_8petsc4py_5PETSc_TAOLineSearch) < 0) __PYX_ERR(52, 1905, __pyx_L1_error) if (__pyx_ptype_8petsc4py_5PETSc_TAOLineSearch->tp_weaklistoffset == 0) __pyx_ptype_8petsc4py_5PETSc_TAOLineSearch->tp_weaklistoffset = offsetof(struct PyPetscTAOLineSearchObject, __pyx_base.__weakref__); __pyx_vtabptr_8petsc4py_5PETSc_AO = &__pyx_vtable_8petsc4py_5PETSc_AO; __pyx_vtable_8petsc4py_5PETSc_AO.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc_Object; #if CYTHON_USE_TYPE_SPECS __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Object); if (unlikely(!__pyx_t_1)) __PYX_ERR(53, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_8petsc4py_5PETSc_AO = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &PyPetscAO_Type_spec, __pyx_t_1); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_ptype_8petsc4py_5PETSc_AO)) __PYX_ERR(53, 11, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&PyPetscAO_Type_spec, __pyx_ptype_8petsc4py_5PETSc_AO) < 0) __PYX_ERR(53, 11, __pyx_L1_error) #else __pyx_ptype_8petsc4py_5PETSc_AO = &PyPetscAO_Type; #endif #if !CYTHON_COMPILING_IN_LIMITED_API __pyx_ptype_8petsc4py_5PETSc_AO->tp_base = __pyx_ptype_8petsc4py_5PETSc_Object; #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_8petsc4py_5PETSc_AO) < 0) __PYX_ERR(53, 11, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_8petsc4py_5PETSc_AO->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_8petsc4py_5PETSc_AO->tp_dictoffset && __pyx_ptype_8petsc4py_5PETSc_AO->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_8petsc4py_5PETSc_AO->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_ptype_8petsc4py_5PETSc_AO, __pyx_vtabptr_8petsc4py_5PETSc_AO) < 0) __PYX_ERR(53, 11, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_8petsc4py_5PETSc_AO) < 0) __PYX_ERR(53, 11, __pyx_L1_error) #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_AO, (PyObject *) __pyx_ptype_8petsc4py_5PETSc_AO) < 0) __PYX_ERR(53, 11, __pyx_L1_error) if (__pyx_ptype_8petsc4py_5PETSc_AO->tp_weaklistoffset == 0) __pyx_ptype_8petsc4py_5PETSc_AO->tp_weaklistoffset = offsetof(struct PyPetscAOObject, __pyx_base.__weakref__); __pyx_vtabptr_8petsc4py_5PETSc_DM = &__pyx_vtable_8petsc4py_5PETSc_DM; __pyx_vtable_8petsc4py_5PETSc_DM.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc_Object; #if CYTHON_USE_TYPE_SPECS __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Object); if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_8petsc4py_5PETSc_DM = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &PyPetscDM_Type_spec, __pyx_t_1); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_ptype_8petsc4py_5PETSc_DM)) __PYX_ERR(54, 48, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&PyPetscDM_Type_spec, __pyx_ptype_8petsc4py_5PETSc_DM) < 0) __PYX_ERR(54, 48, __pyx_L1_error) #else __pyx_ptype_8petsc4py_5PETSc_DM = &PyPetscDM_Type; #endif #if !CYTHON_COMPILING_IN_LIMITED_API __pyx_ptype_8petsc4py_5PETSc_DM->tp_base = __pyx_ptype_8petsc4py_5PETSc_Object; #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_8petsc4py_5PETSc_DM) < 0) __PYX_ERR(54, 48, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_8petsc4py_5PETSc_DM->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_8petsc4py_5PETSc_DM->tp_dictoffset && __pyx_ptype_8petsc4py_5PETSc_DM->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_8petsc4py_5PETSc_DM->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_vtabptr_8petsc4py_5PETSc_DM) < 0) __PYX_ERR(54, 48, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_8petsc4py_5PETSc_DM) < 0) __PYX_ERR(54, 48, __pyx_L1_error) #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DM, (PyObject *) __pyx_ptype_8petsc4py_5PETSc_DM) < 0) __PYX_ERR(54, 48, __pyx_L1_error) if (__pyx_ptype_8petsc4py_5PETSc_DM->tp_weaklistoffset == 0) __pyx_ptype_8petsc4py_5PETSc_DM->tp_weaklistoffset = offsetof(struct PyPetscDMObject, __pyx_base.__weakref__); __pyx_vtabptr_8petsc4py_5PETSc_DMPlexTransform = &__pyx_vtable_8petsc4py_5PETSc_DMPlexTransform; __pyx_vtable_8petsc4py_5PETSc_DMPlexTransform.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc_Object; #if CYTHON_USE_TYPE_SPECS __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Object); if (unlikely(!__pyx_t_1)) __PYX_ERR(57, 3295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_8petsc4py_5PETSc_DMPlexTransform = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &PyPetscDMPlexTransform_Type_spec, __pyx_t_1); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_ptype_8petsc4py_5PETSc_DMPlexTransform)) __PYX_ERR(57, 3295, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&PyPetscDMPlexTransform_Type_spec, __pyx_ptype_8petsc4py_5PETSc_DMPlexTransform) < 0) __PYX_ERR(57, 3295, __pyx_L1_error) #else __pyx_ptype_8petsc4py_5PETSc_DMPlexTransform = &PyPetscDMPlexTransform_Type; #endif #if !CYTHON_COMPILING_IN_LIMITED_API __pyx_ptype_8petsc4py_5PETSc_DMPlexTransform->tp_base = __pyx_ptype_8petsc4py_5PETSc_Object; #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_8petsc4py_5PETSc_DMPlexTransform) < 0) __PYX_ERR(57, 3295, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_8petsc4py_5PETSc_DMPlexTransform->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_8petsc4py_5PETSc_DMPlexTransform->tp_dictoffset && __pyx_ptype_8petsc4py_5PETSc_DMPlexTransform->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_8petsc4py_5PETSc_DMPlexTransform->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_ptype_8petsc4py_5PETSc_DMPlexTransform, __pyx_vtabptr_8petsc4py_5PETSc_DMPlexTransform) < 0) __PYX_ERR(57, 3295, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_8petsc4py_5PETSc_DMPlexTransform) < 0) __PYX_ERR(57, 3295, __pyx_L1_error) #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DMPlexTransform, (PyObject *) __pyx_ptype_8petsc4py_5PETSc_DMPlexTransform) < 0) __PYX_ERR(57, 3295, __pyx_L1_error) if (__pyx_ptype_8petsc4py_5PETSc_DMPlexTransform->tp_weaklistoffset == 0) __pyx_ptype_8petsc4py_5PETSc_DMPlexTransform->tp_weaklistoffset = offsetof(struct PyPetscDMPlexTransformObject, __pyx_base.__weakref__); __pyx_vtabptr_8petsc4py_5PETSc_DS = &__pyx_vtable_8petsc4py_5PETSc_DS; __pyx_vtable_8petsc4py_5PETSc_DS.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc_Object; #if CYTHON_USE_TYPE_SPECS __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Object); if (unlikely(!__pyx_t_1)) __PYX_ERR(55, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_8petsc4py_5PETSc_DS = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &PyPetscDS_Type_spec, __pyx_t_1); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_ptype_8petsc4py_5PETSc_DS)) __PYX_ERR(55, 8, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&PyPetscDS_Type_spec, __pyx_ptype_8petsc4py_5PETSc_DS) < 0) __PYX_ERR(55, 8, __pyx_L1_error) #else __pyx_ptype_8petsc4py_5PETSc_DS = &PyPetscDS_Type; #endif #if !CYTHON_COMPILING_IN_LIMITED_API __pyx_ptype_8petsc4py_5PETSc_DS->tp_base = __pyx_ptype_8petsc4py_5PETSc_Object; #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_8petsc4py_5PETSc_DS) < 0) __PYX_ERR(55, 8, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_8petsc4py_5PETSc_DS->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_8petsc4py_5PETSc_DS->tp_dictoffset && __pyx_ptype_8petsc4py_5PETSc_DS->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_8petsc4py_5PETSc_DS->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_ptype_8petsc4py_5PETSc_DS, __pyx_vtabptr_8petsc4py_5PETSc_DS) < 0) __PYX_ERR(55, 8, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_8petsc4py_5PETSc_DS) < 0) __PYX_ERR(55, 8, __pyx_L1_error) #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DS, (PyObject *) __pyx_ptype_8petsc4py_5PETSc_DS) < 0) __PYX_ERR(55, 8, __pyx_L1_error) if (__pyx_ptype_8petsc4py_5PETSc_DS->tp_weaklistoffset == 0) __pyx_ptype_8petsc4py_5PETSc_DS->tp_weaklistoffset = offsetof(struct PyPetscDSObject, __pyx_base.__weakref__); __pyx_vtabptr_8petsc4py_5PETSc_Partitioner = &__pyx_vtable_8petsc4py_5PETSc_Partitioner; __pyx_vtable_8petsc4py_5PETSc_Partitioner.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc_Object; #if CYTHON_USE_TYPE_SPECS __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Object); if (unlikely(!__pyx_t_1)) __PYX_ERR(63, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_8petsc4py_5PETSc_Partitioner = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &PyPetscPartitioner_Type_spec, __pyx_t_1); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_ptype_8petsc4py_5PETSc_Partitioner)) __PYX_ERR(63, 14, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&PyPetscPartitioner_Type_spec, __pyx_ptype_8petsc4py_5PETSc_Partitioner) < 0) __PYX_ERR(63, 14, __pyx_L1_error) #else __pyx_ptype_8petsc4py_5PETSc_Partitioner = &PyPetscPartitioner_Type; #endif #if !CYTHON_COMPILING_IN_LIMITED_API __pyx_ptype_8petsc4py_5PETSc_Partitioner->tp_base = __pyx_ptype_8petsc4py_5PETSc_Object; #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_8petsc4py_5PETSc_Partitioner) < 0) __PYX_ERR(63, 14, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_8petsc4py_5PETSc_Partitioner->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_8petsc4py_5PETSc_Partitioner->tp_dictoffset && __pyx_ptype_8petsc4py_5PETSc_Partitioner->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_8petsc4py_5PETSc_Partitioner->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_ptype_8petsc4py_5PETSc_Partitioner, __pyx_vtabptr_8petsc4py_5PETSc_Partitioner) < 0) __PYX_ERR(63, 14, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_8petsc4py_5PETSc_Partitioner) < 0) __PYX_ERR(63, 14, __pyx_L1_error) #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Partitioner, (PyObject *) __pyx_ptype_8petsc4py_5PETSc_Partitioner) < 0) __PYX_ERR(63, 14, __pyx_L1_error) if (__pyx_ptype_8petsc4py_5PETSc_Partitioner->tp_weaklistoffset == 0) __pyx_ptype_8petsc4py_5PETSc_Partitioner->tp_weaklistoffset = offsetof(struct PyPetscPartitionerObject, __pyx_base.__weakref__); __pyx_vtabptr_8petsc4py_5PETSc_DMLabel = &__pyx_vtable_8petsc4py_5PETSc_DMLabel; __pyx_vtable_8petsc4py_5PETSc_DMLabel.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc_Object; #if CYTHON_USE_TYPE_SPECS __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Object); if (unlikely(!__pyx_t_1)) __PYX_ERR(61, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_8petsc4py_5PETSc_DMLabel = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &PyPetscDMLabel_Type_spec, __pyx_t_1); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_ptype_8petsc4py_5PETSc_DMLabel)) __PYX_ERR(61, 2, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&PyPetscDMLabel_Type_spec, __pyx_ptype_8petsc4py_5PETSc_DMLabel) < 0) __PYX_ERR(61, 2, __pyx_L1_error) #else __pyx_ptype_8petsc4py_5PETSc_DMLabel = &PyPetscDMLabel_Type; #endif #if !CYTHON_COMPILING_IN_LIMITED_API __pyx_ptype_8petsc4py_5PETSc_DMLabel->tp_base = __pyx_ptype_8petsc4py_5PETSc_Object; #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_8petsc4py_5PETSc_DMLabel) < 0) __PYX_ERR(61, 2, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_8petsc4py_5PETSc_DMLabel->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_8petsc4py_5PETSc_DMLabel->tp_dictoffset && __pyx_ptype_8petsc4py_5PETSc_DMLabel->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_8petsc4py_5PETSc_DMLabel->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_ptype_8petsc4py_5PETSc_DMLabel, __pyx_vtabptr_8petsc4py_5PETSc_DMLabel) < 0) __PYX_ERR(61, 2, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_8petsc4py_5PETSc_DMLabel) < 0) __PYX_ERR(61, 2, __pyx_L1_error) #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DMLabel, (PyObject *) __pyx_ptype_8petsc4py_5PETSc_DMLabel) < 0) __PYX_ERR(61, 2, __pyx_L1_error) if (__pyx_ptype_8petsc4py_5PETSc_DMLabel->tp_weaklistoffset == 0) __pyx_ptype_8petsc4py_5PETSc_DMLabel->tp_weaklistoffset = offsetof(struct PyPetscDMLabelObject, __pyx_base.__weakref__); __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_8petsc4py_5PETSc_dtype = __Pyx_ImportType_3_0_6(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_0_6(PyArray_Descr),__Pyx_ImportType_CheckSize_Warn_3_0_6); if (!__pyx_ptype_8petsc4py_5PETSc_dtype) __PYX_ERR(15, 9, __pyx_L1_error) __pyx_ptype_8petsc4py_5PETSc_ndarray = __Pyx_ImportType_3_0_6(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_6(PyArrayObject),__Pyx_ImportType_CheckSize_Warn_3_0_6); if (!__pyx_ptype_8petsc4py_5PETSc_ndarray) __PYX_ERR(15, 12, __pyx_L1_error) __pyx_vtabptr_8petsc4py_5PETSc__IS_buffer = &__pyx_vtable_8petsc4py_5PETSc__IS_buffer; __pyx_vtable_8petsc4py_5PETSc__IS_buffer.acquire = (int (*)(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *))__pyx_f_8petsc4py_5PETSc_10_IS_buffer_acquire; __pyx_vtable_8petsc4py_5PETSc__IS_buffer.release = (int (*)(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *))__pyx_f_8petsc4py_5PETSc_10_IS_buffer_release; __pyx_vtable_8petsc4py_5PETSc__IS_buffer.acquirebuffer = (int (*)(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *, Py_buffer *, int))__pyx_f_8petsc4py_5PETSc_10_IS_buffer_acquirebuffer; __pyx_vtable_8petsc4py_5PETSc__IS_buffer.releasebuffer = (int (*)(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *, Py_buffer *))__pyx_f_8petsc4py_5PETSc_10_IS_buffer_releasebuffer; __pyx_vtable_8petsc4py_5PETSc__IS_buffer.enter = (PyObject *(*)(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *))__pyx_f_8petsc4py_5PETSc_10_IS_buffer_enter; __pyx_vtable_8petsc4py_5PETSc__IS_buffer.exit = (PyObject *(*)(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *))__pyx_f_8petsc4py_5PETSc_10_IS_buffer_exit; __pyx_vtable_8petsc4py_5PETSc__IS_buffer.getbuffer = (Py_ssize_t (*)(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *, void **))__pyx_f_8petsc4py_5PETSc_10_IS_buffer_getbuffer; #if CYTHON_USE_TYPE_SPECS __pyx_ptype_8petsc4py_5PETSc__IS_buffer = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8petsc4py_5PETSc__IS_buffer_spec, NULL); if (unlikely(!__pyx_ptype_8petsc4py_5PETSc__IS_buffer)) __PYX_ERR(6, 111, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API __pyx_ptype_8petsc4py_5PETSc__IS_buffer->tp_as_buffer = &__pyx_tp_as_buffer__IS_buffer; #elif defined(Py_bf_getbuffer) && defined(Py_bf_releasebuffer) /* PY_VERSION_HEX >= 0x03090000 || Py_LIMITED_API >= 0x030B0000 */ #elif defined(_MSC_VER) #pragma message ("The buffer protocol is not supported in the Limited C-API < 3.11.") #else #warning "The buffer protocol is not supported in the Limited C-API < 3.11." #endif if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8petsc4py_5PETSc__IS_buffer_spec, __pyx_ptype_8petsc4py_5PETSc__IS_buffer) < 0) __PYX_ERR(6, 111, __pyx_L1_error) #else __pyx_ptype_8petsc4py_5PETSc__IS_buffer = &__pyx_type_8petsc4py_5PETSc__IS_buffer; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_8petsc4py_5PETSc__IS_buffer) < 0) __PYX_ERR(6, 111, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_8petsc4py_5PETSc__IS_buffer->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_8petsc4py_5PETSc__IS_buffer->tp_dictoffset && __pyx_ptype_8petsc4py_5PETSc__IS_buffer->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_8petsc4py_5PETSc__IS_buffer->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_ptype_8petsc4py_5PETSc__IS_buffer, __pyx_vtabptr_8petsc4py_5PETSc__IS_buffer) < 0) __PYX_ERR(6, 111, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_8petsc4py_5PETSc__IS_buffer) < 0) __PYX_ERR(6, 111, __pyx_L1_error) #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_IS_buffer, (PyObject *) __pyx_ptype_8petsc4py_5PETSc__IS_buffer) < 0) __PYX_ERR(6, 111, __pyx_L1_error) __pyx_vtabptr_8petsc4py_5PETSc__Vec_buffer = &__pyx_vtable_8petsc4py_5PETSc__Vec_buffer; __pyx_vtable_8petsc4py_5PETSc__Vec_buffer.acquire = (int (*)(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *))__pyx_f_8petsc4py_5PETSc_11_Vec_buffer_acquire; __pyx_vtable_8petsc4py_5PETSc__Vec_buffer.release = (int (*)(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *))__pyx_f_8petsc4py_5PETSc_11_Vec_buffer_release; __pyx_vtable_8petsc4py_5PETSc__Vec_buffer.acquirebuffer = (int (*)(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *, Py_buffer *, int))__pyx_f_8petsc4py_5PETSc_11_Vec_buffer_acquirebuffer; __pyx_vtable_8petsc4py_5PETSc__Vec_buffer.releasebuffer = (int (*)(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *, Py_buffer *))__pyx_f_8petsc4py_5PETSc_11_Vec_buffer_releasebuffer; __pyx_vtable_8petsc4py_5PETSc__Vec_buffer.enter = (PyObject *(*)(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *))__pyx_f_8petsc4py_5PETSc_11_Vec_buffer_enter; __pyx_vtable_8petsc4py_5PETSc__Vec_buffer.exit = (PyObject *(*)(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *))__pyx_f_8petsc4py_5PETSc_11_Vec_buffer_exit; __pyx_vtable_8petsc4py_5PETSc__Vec_buffer.getbuffer = (Py_ssize_t (*)(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *, void **))__pyx_f_8petsc4py_5PETSc_11_Vec_buffer_getbuffer; #if CYTHON_USE_TYPE_SPECS __pyx_ptype_8petsc4py_5PETSc__Vec_buffer = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8petsc4py_5PETSc__Vec_buffer_spec, NULL); if (unlikely(!__pyx_ptype_8petsc4py_5PETSc__Vec_buffer)) __PYX_ERR(7, 499, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API __pyx_ptype_8petsc4py_5PETSc__Vec_buffer->tp_as_buffer = &__pyx_tp_as_buffer__Vec_buffer; #elif defined(Py_bf_getbuffer) && defined(Py_bf_releasebuffer) /* PY_VERSION_HEX >= 0x03090000 || Py_LIMITED_API >= 0x030B0000 */ #elif defined(_MSC_VER) #pragma message ("The buffer protocol is not supported in the Limited C-API < 3.11.") #else #warning "The buffer protocol is not supported in the Limited C-API < 3.11." #endif if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8petsc4py_5PETSc__Vec_buffer_spec, __pyx_ptype_8petsc4py_5PETSc__Vec_buffer) < 0) __PYX_ERR(7, 499, __pyx_L1_error) #else __pyx_ptype_8petsc4py_5PETSc__Vec_buffer = &__pyx_type_8petsc4py_5PETSc__Vec_buffer; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_8petsc4py_5PETSc__Vec_buffer) < 0) __PYX_ERR(7, 499, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_8petsc4py_5PETSc__Vec_buffer->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_8petsc4py_5PETSc__Vec_buffer->tp_dictoffset && __pyx_ptype_8petsc4py_5PETSc__Vec_buffer->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_8petsc4py_5PETSc__Vec_buffer->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_ptype_8petsc4py_5PETSc__Vec_buffer, __pyx_vtabptr_8petsc4py_5PETSc__Vec_buffer) < 0) __PYX_ERR(7, 499, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_8petsc4py_5PETSc__Vec_buffer) < 0) __PYX_ERR(7, 499, __pyx_L1_error) #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Vec_buffer, (PyObject *) __pyx_ptype_8petsc4py_5PETSc__Vec_buffer) < 0) __PYX_ERR(7, 499, __pyx_L1_error) #if CYTHON_USE_TYPE_SPECS __pyx_ptype_8petsc4py_5PETSc__Vec_LocalForm = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8petsc4py_5PETSc__Vec_LocalForm_spec, NULL); if (unlikely(!__pyx_ptype_8petsc4py_5PETSc__Vec_LocalForm)) __PYX_ERR(7, 619, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8petsc4py_5PETSc__Vec_LocalForm_spec, __pyx_ptype_8petsc4py_5PETSc__Vec_LocalForm) < 0) __PYX_ERR(7, 619, __pyx_L1_error) #else __pyx_ptype_8petsc4py_5PETSc__Vec_LocalForm = &__pyx_type_8petsc4py_5PETSc__Vec_LocalForm; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_8petsc4py_5PETSc__Vec_LocalForm) < 0) __PYX_ERR(7, 619, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_8petsc4py_5PETSc__Vec_LocalForm->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_8petsc4py_5PETSc__Vec_LocalForm->tp_dictoffset && __pyx_ptype_8petsc4py_5PETSc__Vec_LocalForm->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_8petsc4py_5PETSc__Vec_LocalForm->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Vec_LocalForm, (PyObject *) __pyx_ptype_8petsc4py_5PETSc__Vec_LocalForm) < 0) __PYX_ERR(7, 619, __pyx_L1_error) __pyx_vtabptr_8petsc4py_5PETSc__DMDA_Vec_array = &__pyx_vtable_8petsc4py_5PETSc__DMDA_Vec_array; __pyx_vtable_8petsc4py_5PETSc__DMDA_Vec_array.acquire = (int (*)(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *))__pyx_f_8petsc4py_5PETSc_15_DMDA_Vec_array_acquire; __pyx_vtable_8petsc4py_5PETSc__DMDA_Vec_array.release = (int (*)(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *))__pyx_f_8petsc4py_5PETSc_15_DMDA_Vec_array_release; #if CYTHON_USE_TYPE_SPECS __pyx_ptype_8petsc4py_5PETSc__DMDA_Vec_array = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8petsc4py_5PETSc__DMDA_Vec_array_spec, NULL); if (unlikely(!__pyx_ptype_8petsc4py_5PETSc__DMDA_Vec_array)) __PYX_ERR(10, 198, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8petsc4py_5PETSc__DMDA_Vec_array_spec, __pyx_ptype_8petsc4py_5PETSc__DMDA_Vec_array) < 0) __PYX_ERR(10, 198, __pyx_L1_error) #else __pyx_ptype_8petsc4py_5PETSc__DMDA_Vec_array = &__pyx_type_8petsc4py_5PETSc__DMDA_Vec_array; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_8petsc4py_5PETSc__DMDA_Vec_array) < 0) __PYX_ERR(10, 198, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_8petsc4py_5PETSc__DMDA_Vec_array->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_8petsc4py_5PETSc__DMDA_Vec_array->tp_dictoffset && __pyx_ptype_8petsc4py_5PETSc__DMDA_Vec_array->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_8petsc4py_5PETSc__DMDA_Vec_array->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_ptype_8petsc4py_5PETSc__DMDA_Vec_array, __pyx_vtabptr_8petsc4py_5PETSc__DMDA_Vec_array) < 0) __PYX_ERR(10, 198, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_8petsc4py_5PETSc__DMDA_Vec_array) < 0) __PYX_ERR(10, 198, __pyx_L1_error) #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DMDA_Vec_array, (PyObject *) __pyx_ptype_8petsc4py_5PETSc__DMDA_Vec_array) < 0) __PYX_ERR(10, 198, __pyx_L1_error) #if CYTHON_USE_TYPE_SPECS __pyx_ptype_8petsc4py_5PETSc__DMComposite_access = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8petsc4py_5PETSc__DMComposite_access_spec, NULL); if (unlikely(!__pyx_ptype_8petsc4py_5PETSc__DMComposite_access)) __PYX_ERR(28, 17, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8petsc4py_5PETSc__DMComposite_access_spec, __pyx_ptype_8petsc4py_5PETSc__DMComposite_access) < 0) __PYX_ERR(28, 17, __pyx_L1_error) #else __pyx_ptype_8petsc4py_5PETSc__DMComposite_access = &__pyx_type_8petsc4py_5PETSc__DMComposite_access; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_8petsc4py_5PETSc__DMComposite_access) < 0) __PYX_ERR(28, 17, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_8petsc4py_5PETSc__DMComposite_access->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_8petsc4py_5PETSc__DMComposite_access->tp_dictoffset && __pyx_ptype_8petsc4py_5PETSc__DMComposite_access->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_8petsc4py_5PETSc__DMComposite_access->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DMComposite_access, (PyObject *) __pyx_ptype_8petsc4py_5PETSc__DMComposite_access) < 0) __PYX_ERR(28, 17, __pyx_L1_error) #if CYTHON_USE_TYPE_SPECS __pyx_ptype_8petsc4py_5PETSc_Options = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8petsc4py_5PETSc_Options_spec, NULL); if (unlikely(!__pyx_ptype_8petsc4py_5PETSc_Options)) __PYX_ERR(31, 3, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8petsc4py_5PETSc_Options_spec, __pyx_ptype_8petsc4py_5PETSc_Options) < 0) __PYX_ERR(31, 3, __pyx_L1_error) #else __pyx_ptype_8petsc4py_5PETSc_Options = &__pyx_type_8petsc4py_5PETSc_Options; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_8petsc4py_5PETSc_Options) < 0) __PYX_ERR(31, 3, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_8petsc4py_5PETSc_Options->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_8petsc4py_5PETSc_Options->tp_dictoffset && __pyx_ptype_8petsc4py_5PETSc_Options->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_8petsc4py_5PETSc_Options->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Options, (PyObject *) __pyx_ptype_8petsc4py_5PETSc_Options) < 0) __PYX_ERR(31, 3, __pyx_L1_error) #if CYTHON_USE_TYPE_SPECS __pyx_ptype_8petsc4py_5PETSc_Sys = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8petsc4py_5PETSc_Sys_spec, NULL); if (unlikely(!__pyx_ptype_8petsc4py_5PETSc_Sys)) __PYX_ERR(32, 3, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8petsc4py_5PETSc_Sys_spec, __pyx_ptype_8petsc4py_5PETSc_Sys) < 0) __PYX_ERR(32, 3, __pyx_L1_error) #else __pyx_ptype_8petsc4py_5PETSc_Sys = &__pyx_type_8petsc4py_5PETSc_Sys; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_8petsc4py_5PETSc_Sys) < 0) __PYX_ERR(32, 3, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_8petsc4py_5PETSc_Sys->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_8petsc4py_5PETSc_Sys->tp_dictoffset && __pyx_ptype_8petsc4py_5PETSc_Sys->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_8petsc4py_5PETSc_Sys->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Sys, (PyObject *) __pyx_ptype_8petsc4py_5PETSc_Sys) < 0) __PYX_ERR(32, 3, __pyx_L1_error) #if CYTHON_USE_TYPE_SPECS __pyx_ptype_8petsc4py_5PETSc_Log = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8petsc4py_5PETSc_Log_spec, NULL); if (unlikely(!__pyx_ptype_8petsc4py_5PETSc_Log)) __PYX_ERR(33, 8, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8petsc4py_5PETSc_Log_spec, __pyx_ptype_8petsc4py_5PETSc_Log) < 0) __PYX_ERR(33, 8, __pyx_L1_error) #else __pyx_ptype_8petsc4py_5PETSc_Log = &__pyx_type_8petsc4py_5PETSc_Log; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_8petsc4py_5PETSc_Log) < 0) __PYX_ERR(33, 8, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_8petsc4py_5PETSc_Log->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_8petsc4py_5PETSc_Log->tp_dictoffset && __pyx_ptype_8petsc4py_5PETSc_Log->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_8petsc4py_5PETSc_Log->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Log, (PyObject *) __pyx_ptype_8petsc4py_5PETSc_Log) < 0) __PYX_ERR(33, 8, __pyx_L1_error) #if CYTHON_USE_TYPE_SPECS __pyx_ptype_8petsc4py_5PETSc_LogStage = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8petsc4py_5PETSc_LogStage_spec, NULL); if (unlikely(!__pyx_ptype_8petsc4py_5PETSc_LogStage)) __PYX_ERR(33, 210, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8petsc4py_5PETSc_LogStage_spec, __pyx_ptype_8petsc4py_5PETSc_LogStage) < 0) __PYX_ERR(33, 210, __pyx_L1_error) #else __pyx_ptype_8petsc4py_5PETSc_LogStage = &__pyx_type_8petsc4py_5PETSc_LogStage; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_8petsc4py_5PETSc_LogStage) < 0) __PYX_ERR(33, 210, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_8petsc4py_5PETSc_LogStage->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_8petsc4py_5PETSc_LogStage->tp_dictoffset && __pyx_ptype_8petsc4py_5PETSc_LogStage->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_8petsc4py_5PETSc_LogStage->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_LogStage, (PyObject *) __pyx_ptype_8petsc4py_5PETSc_LogStage) < 0) __PYX_ERR(33, 210, __pyx_L1_error) #if CYTHON_USE_TYPE_SPECS __pyx_ptype_8petsc4py_5PETSc_LogClass = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8petsc4py_5PETSc_LogClass_spec, NULL); if (unlikely(!__pyx_ptype_8petsc4py_5PETSc_LogClass)) __PYX_ERR(33, 384, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8petsc4py_5PETSc_LogClass_spec, __pyx_ptype_8petsc4py_5PETSc_LogClass) < 0) __PYX_ERR(33, 384, __pyx_L1_error) #else __pyx_ptype_8petsc4py_5PETSc_LogClass = &__pyx_type_8petsc4py_5PETSc_LogClass; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_8petsc4py_5PETSc_LogClass) < 0) __PYX_ERR(33, 384, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_8petsc4py_5PETSc_LogClass->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_8petsc4py_5PETSc_LogClass->tp_dictoffset && __pyx_ptype_8petsc4py_5PETSc_LogClass->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_8petsc4py_5PETSc_LogClass->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_LogClass, (PyObject *) __pyx_ptype_8petsc4py_5PETSc_LogClass) < 0) __PYX_ERR(33, 384, __pyx_L1_error) #if CYTHON_USE_TYPE_SPECS __pyx_ptype_8petsc4py_5PETSc_LogEvent = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8petsc4py_5PETSc_LogEvent_spec, NULL); if (unlikely(!__pyx_ptype_8petsc4py_5PETSc_LogEvent)) __PYX_ERR(33, 446, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8petsc4py_5PETSc_LogEvent_spec, __pyx_ptype_8petsc4py_5PETSc_LogEvent) < 0) __PYX_ERR(33, 446, __pyx_L1_error) #else __pyx_ptype_8petsc4py_5PETSc_LogEvent = &__pyx_type_8petsc4py_5PETSc_LogEvent; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_8petsc4py_5PETSc_LogEvent) < 0) __PYX_ERR(33, 446, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_8petsc4py_5PETSc_LogEvent->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_8petsc4py_5PETSc_LogEvent->tp_dictoffset && __pyx_ptype_8petsc4py_5PETSc_LogEvent->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_8petsc4py_5PETSc_LogEvent->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_LogEvent, (PyObject *) __pyx_ptype_8petsc4py_5PETSc_LogEvent) < 0) __PYX_ERR(33, 446, __pyx_L1_error) __pyx_vtabptr_8petsc4py_5PETSc_ViewerHDF5 = &__pyx_vtable_8petsc4py_5PETSc_ViewerHDF5; __pyx_vtable_8petsc4py_5PETSc_ViewerHDF5.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc_Viewer; #if CYTHON_USE_TYPE_SPECS __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Viewer); if (unlikely(!__pyx_t_2)) __PYX_ERR(37, 906, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_ptype_8petsc4py_5PETSc_ViewerHDF5 = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8petsc4py_5PETSc_ViewerHDF5_spec, __pyx_t_2); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_ptype_8petsc4py_5PETSc_ViewerHDF5)) __PYX_ERR(37, 906, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8petsc4py_5PETSc_ViewerHDF5_spec, __pyx_ptype_8petsc4py_5PETSc_ViewerHDF5) < 0) __PYX_ERR(37, 906, __pyx_L1_error) #else __pyx_ptype_8petsc4py_5PETSc_ViewerHDF5 = &__pyx_type_8petsc4py_5PETSc_ViewerHDF5; #endif #if !CYTHON_COMPILING_IN_LIMITED_API __pyx_ptype_8petsc4py_5PETSc_ViewerHDF5->tp_base = __pyx_ptype_8petsc4py_5PETSc_Viewer; #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_8petsc4py_5PETSc_ViewerHDF5) < 0) __PYX_ERR(37, 906, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_8petsc4py_5PETSc_ViewerHDF5->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_8petsc4py_5PETSc_ViewerHDF5->tp_dictoffset && __pyx_ptype_8petsc4py_5PETSc_ViewerHDF5->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_8petsc4py_5PETSc_ViewerHDF5->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_ptype_8petsc4py_5PETSc_ViewerHDF5, __pyx_vtabptr_8petsc4py_5PETSc_ViewerHDF5) < 0) __PYX_ERR(37, 906, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_8petsc4py_5PETSc_ViewerHDF5) < 0) __PYX_ERR(37, 906, __pyx_L1_error) #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ViewerHDF5, (PyObject *) __pyx_ptype_8petsc4py_5PETSc_ViewerHDF5) < 0) __PYX_ERR(37, 906, __pyx_L1_error) if (__pyx_ptype_8petsc4py_5PETSc_ViewerHDF5->tp_weaklistoffset == 0) __pyx_ptype_8petsc4py_5PETSc_ViewerHDF5->tp_weaklistoffset = offsetof(struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5, __pyx_base.__pyx_base.__weakref__); #if CYTHON_USE_TYPE_SPECS __pyx_ptype_8petsc4py_5PETSc_MatStencil = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8petsc4py_5PETSc_MatStencil_spec, NULL); if (unlikely(!__pyx_ptype_8petsc4py_5PETSc_MatStencil)) __PYX_ERR(46, 269, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8petsc4py_5PETSc_MatStencil_spec, __pyx_ptype_8petsc4py_5PETSc_MatStencil) < 0) __PYX_ERR(46, 269, __pyx_L1_error) #else __pyx_ptype_8petsc4py_5PETSc_MatStencil = &__pyx_type_8petsc4py_5PETSc_MatStencil; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_8petsc4py_5PETSc_MatStencil) < 0) __PYX_ERR(46, 269, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_8petsc4py_5PETSc_MatStencil->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_8petsc4py_5PETSc_MatStencil->tp_dictoffset && __pyx_ptype_8petsc4py_5PETSc_MatStencil->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_8petsc4py_5PETSc_MatStencil->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif __pyx_vtabptr_8petsc4py_5PETSc_DMDA = &__pyx_vtable_8petsc4py_5PETSc_DMDA; __pyx_vtable_8petsc4py_5PETSc_DMDA.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc_DM; #if CYTHON_USE_TYPE_SPECS __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_ptype_8petsc4py_5PETSc_DMDA = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8petsc4py_5PETSc_DMDA_spec, __pyx_t_2); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_ptype_8petsc4py_5PETSc_DMDA)) __PYX_ERR(56, 17, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8petsc4py_5PETSc_DMDA_spec, __pyx_ptype_8petsc4py_5PETSc_DMDA) < 0) __PYX_ERR(56, 17, __pyx_L1_error) #else __pyx_ptype_8petsc4py_5PETSc_DMDA = &__pyx_type_8petsc4py_5PETSc_DMDA; #endif #if !CYTHON_COMPILING_IN_LIMITED_API __pyx_ptype_8petsc4py_5PETSc_DMDA->tp_base = __pyx_ptype_8petsc4py_5PETSc_DM; #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_8petsc4py_5PETSc_DMDA) < 0) __PYX_ERR(56, 17, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_8petsc4py_5PETSc_DMDA->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_8petsc4py_5PETSc_DMDA->tp_dictoffset && __pyx_ptype_8petsc4py_5PETSc_DMDA->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_8petsc4py_5PETSc_DMDA->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_ptype_8petsc4py_5PETSc_DMDA, __pyx_vtabptr_8petsc4py_5PETSc_DMDA) < 0) __PYX_ERR(56, 17, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_8petsc4py_5PETSc_DMDA) < 0) __PYX_ERR(56, 17, __pyx_L1_error) #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DMDA, (PyObject *) __pyx_ptype_8petsc4py_5PETSc_DMDA) < 0) __PYX_ERR(56, 17, __pyx_L1_error) if (__pyx_ptype_8petsc4py_5PETSc_DMDA->tp_weaklistoffset == 0) __pyx_ptype_8petsc4py_5PETSc_DMDA->tp_weaklistoffset = offsetof(struct __pyx_obj_8petsc4py_5PETSc_DMDA, __pyx_base.__pyx_base.__weakref__); __pyx_vtabptr_8petsc4py_5PETSc_DMPlex = &__pyx_vtable_8petsc4py_5PETSc_DMPlex; __pyx_vtable_8petsc4py_5PETSc_DMPlex.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc_DM; #if CYTHON_USE_TYPE_SPECS __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM); if (unlikely(!__pyx_t_2)) __PYX_ERR(57, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_ptype_8petsc4py_5PETSc_DMPlex = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8petsc4py_5PETSc_DMPlex_spec, __pyx_t_2); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_ptype_8petsc4py_5PETSc_DMPlex)) __PYX_ERR(57, 10, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8petsc4py_5PETSc_DMPlex_spec, __pyx_ptype_8petsc4py_5PETSc_DMPlex) < 0) __PYX_ERR(57, 10, __pyx_L1_error) #else __pyx_ptype_8petsc4py_5PETSc_DMPlex = &__pyx_type_8petsc4py_5PETSc_DMPlex; #endif #if !CYTHON_COMPILING_IN_LIMITED_API __pyx_ptype_8petsc4py_5PETSc_DMPlex->tp_base = __pyx_ptype_8petsc4py_5PETSc_DM; #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_8petsc4py_5PETSc_DMPlex) < 0) __PYX_ERR(57, 10, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_8petsc4py_5PETSc_DMPlex->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_8petsc4py_5PETSc_DMPlex->tp_dictoffset && __pyx_ptype_8petsc4py_5PETSc_DMPlex->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_8petsc4py_5PETSc_DMPlex->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_vtabptr_8petsc4py_5PETSc_DMPlex) < 0) __PYX_ERR(57, 10, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_8petsc4py_5PETSc_DMPlex) < 0) __PYX_ERR(57, 10, __pyx_L1_error) #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DMPlex, (PyObject *) __pyx_ptype_8petsc4py_5PETSc_DMPlex) < 0) __PYX_ERR(57, 10, __pyx_L1_error) if (__pyx_ptype_8petsc4py_5PETSc_DMPlex->tp_weaklistoffset == 0) __pyx_ptype_8petsc4py_5PETSc_DMPlex->tp_weaklistoffset = offsetof(struct __pyx_obj_8petsc4py_5PETSc_DMPlex, __pyx_base.__pyx_base.__weakref__); __pyx_vtabptr_8petsc4py_5PETSc_DMStag = &__pyx_vtable_8petsc4py_5PETSc_DMStag; __pyx_vtable_8petsc4py_5PETSc_DMStag.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc_DM; #if CYTHON_USE_TYPE_SPECS __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM); if (unlikely(!__pyx_t_2)) __PYX_ERR(58, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_ptype_8petsc4py_5PETSc_DMStag = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8petsc4py_5PETSc_DMStag_spec, __pyx_t_2); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_ptype_8petsc4py_5PETSc_DMStag)) __PYX_ERR(58, 40, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8petsc4py_5PETSc_DMStag_spec, __pyx_ptype_8petsc4py_5PETSc_DMStag) < 0) __PYX_ERR(58, 40, __pyx_L1_error) #else __pyx_ptype_8petsc4py_5PETSc_DMStag = &__pyx_type_8petsc4py_5PETSc_DMStag; #endif #if !CYTHON_COMPILING_IN_LIMITED_API __pyx_ptype_8petsc4py_5PETSc_DMStag->tp_base = __pyx_ptype_8petsc4py_5PETSc_DM; #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_8petsc4py_5PETSc_DMStag) < 0) __PYX_ERR(58, 40, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_8petsc4py_5PETSc_DMStag->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_8petsc4py_5PETSc_DMStag->tp_dictoffset && __pyx_ptype_8petsc4py_5PETSc_DMStag->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_8petsc4py_5PETSc_DMStag->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_ptype_8petsc4py_5PETSc_DMStag, __pyx_vtabptr_8petsc4py_5PETSc_DMStag) < 0) __PYX_ERR(58, 40, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_8petsc4py_5PETSc_DMStag) < 0) __PYX_ERR(58, 40, __pyx_L1_error) #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DMStag, (PyObject *) __pyx_ptype_8petsc4py_5PETSc_DMStag) < 0) __PYX_ERR(58, 40, __pyx_L1_error) if (__pyx_ptype_8petsc4py_5PETSc_DMStag->tp_weaklistoffset == 0) __pyx_ptype_8petsc4py_5PETSc_DMStag->tp_weaklistoffset = offsetof(struct __pyx_obj_8petsc4py_5PETSc_DMStag, __pyx_base.__pyx_base.__weakref__); __pyx_vtabptr_8petsc4py_5PETSc_DMComposite = &__pyx_vtable_8petsc4py_5PETSc_DMComposite; __pyx_vtable_8petsc4py_5PETSc_DMComposite.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc_DM; #if CYTHON_USE_TYPE_SPECS __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM); if (unlikely(!__pyx_t_2)) __PYX_ERR(59, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_ptype_8petsc4py_5PETSc_DMComposite = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8petsc4py_5PETSc_DMComposite_spec, __pyx_t_2); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_ptype_8petsc4py_5PETSc_DMComposite)) __PYX_ERR(59, 3, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8petsc4py_5PETSc_DMComposite_spec, __pyx_ptype_8petsc4py_5PETSc_DMComposite) < 0) __PYX_ERR(59, 3, __pyx_L1_error) #else __pyx_ptype_8petsc4py_5PETSc_DMComposite = &__pyx_type_8petsc4py_5PETSc_DMComposite; #endif #if !CYTHON_COMPILING_IN_LIMITED_API __pyx_ptype_8petsc4py_5PETSc_DMComposite->tp_base = __pyx_ptype_8petsc4py_5PETSc_DM; #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_8petsc4py_5PETSc_DMComposite) < 0) __PYX_ERR(59, 3, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_8petsc4py_5PETSc_DMComposite->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_8petsc4py_5PETSc_DMComposite->tp_dictoffset && __pyx_ptype_8petsc4py_5PETSc_DMComposite->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_8petsc4py_5PETSc_DMComposite->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_ptype_8petsc4py_5PETSc_DMComposite, __pyx_vtabptr_8petsc4py_5PETSc_DMComposite) < 0) __PYX_ERR(59, 3, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_8petsc4py_5PETSc_DMComposite) < 0) __PYX_ERR(59, 3, __pyx_L1_error) #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DMComposite, (PyObject *) __pyx_ptype_8petsc4py_5PETSc_DMComposite) < 0) __PYX_ERR(59, 3, __pyx_L1_error) if (__pyx_ptype_8petsc4py_5PETSc_DMComposite->tp_weaklistoffset == 0) __pyx_ptype_8petsc4py_5PETSc_DMComposite->tp_weaklistoffset = offsetof(struct __pyx_obj_8petsc4py_5PETSc_DMComposite, __pyx_base.__pyx_base.__weakref__); __pyx_vtabptr_8petsc4py_5PETSc_DMShell = &__pyx_vtable_8petsc4py_5PETSc_DMShell; __pyx_vtable_8petsc4py_5PETSc_DMShell.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc_DM; #if CYTHON_USE_TYPE_SPECS __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM); if (unlikely(!__pyx_t_2)) __PYX_ERR(60, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_ptype_8petsc4py_5PETSc_DMShell = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8petsc4py_5PETSc_DMShell_spec, __pyx_t_2); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_ptype_8petsc4py_5PETSc_DMShell)) __PYX_ERR(60, 1, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8petsc4py_5PETSc_DMShell_spec, __pyx_ptype_8petsc4py_5PETSc_DMShell) < 0) __PYX_ERR(60, 1, __pyx_L1_error) #else __pyx_ptype_8petsc4py_5PETSc_DMShell = &__pyx_type_8petsc4py_5PETSc_DMShell; #endif #if !CYTHON_COMPILING_IN_LIMITED_API __pyx_ptype_8petsc4py_5PETSc_DMShell->tp_base = __pyx_ptype_8petsc4py_5PETSc_DM; #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_8petsc4py_5PETSc_DMShell) < 0) __PYX_ERR(60, 1, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_8petsc4py_5PETSc_DMShell->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_8petsc4py_5PETSc_DMShell->tp_dictoffset && __pyx_ptype_8petsc4py_5PETSc_DMShell->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_8petsc4py_5PETSc_DMShell->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_ptype_8petsc4py_5PETSc_DMShell, __pyx_vtabptr_8petsc4py_5PETSc_DMShell) < 0) __PYX_ERR(60, 1, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_8petsc4py_5PETSc_DMShell) < 0) __PYX_ERR(60, 1, __pyx_L1_error) #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DMShell, (PyObject *) __pyx_ptype_8petsc4py_5PETSc_DMShell) < 0) __PYX_ERR(60, 1, __pyx_L1_error) if (__pyx_ptype_8petsc4py_5PETSc_DMShell->tp_weaklistoffset == 0) __pyx_ptype_8petsc4py_5PETSc_DMShell->tp_weaklistoffset = offsetof(struct __pyx_obj_8petsc4py_5PETSc_DMShell, __pyx_base.__pyx_base.__weakref__); __pyx_vtabptr_8petsc4py_5PETSc_DMSwarm = &__pyx_vtable_8petsc4py_5PETSc_DMSwarm; __pyx_vtable_8petsc4py_5PETSc_DMSwarm.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc_DM; #if CYTHON_USE_TYPE_SPECS __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM); if (unlikely(!__pyx_t_2)) __PYX_ERR(62, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_ptype_8petsc4py_5PETSc_DMSwarm = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8petsc4py_5PETSc_DMSwarm_spec, __pyx_t_2); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_ptype_8petsc4py_5PETSc_DMSwarm)) __PYX_ERR(62, 25, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8petsc4py_5PETSc_DMSwarm_spec, __pyx_ptype_8petsc4py_5PETSc_DMSwarm) < 0) __PYX_ERR(62, 25, __pyx_L1_error) #else __pyx_ptype_8petsc4py_5PETSc_DMSwarm = &__pyx_type_8petsc4py_5PETSc_DMSwarm; #endif #if !CYTHON_COMPILING_IN_LIMITED_API __pyx_ptype_8petsc4py_5PETSc_DMSwarm->tp_base = __pyx_ptype_8petsc4py_5PETSc_DM; #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_8petsc4py_5PETSc_DMSwarm) < 0) __PYX_ERR(62, 25, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_8petsc4py_5PETSc_DMSwarm->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_8petsc4py_5PETSc_DMSwarm->tp_dictoffset && __pyx_ptype_8petsc4py_5PETSc_DMSwarm->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_8petsc4py_5PETSc_DMSwarm->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_ptype_8petsc4py_5PETSc_DMSwarm, __pyx_vtabptr_8petsc4py_5PETSc_DMSwarm) < 0) __PYX_ERR(62, 25, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_8petsc4py_5PETSc_DMSwarm) < 0) __PYX_ERR(62, 25, __pyx_L1_error) #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DMSwarm, (PyObject *) __pyx_ptype_8petsc4py_5PETSc_DMSwarm) < 0) __PYX_ERR(62, 25, __pyx_L1_error) if (__pyx_ptype_8petsc4py_5PETSc_DMSwarm->tp_weaklistoffset == 0) __pyx_ptype_8petsc4py_5PETSc_DMSwarm->tp_weaklistoffset = offsetof(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm, __pyx_base.__pyx_base.__weakref__); #if CYTHON_USE_TYPE_SPECS __pyx_ptype_8petsc4py_5PETSc_DMInterpolation = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8petsc4py_5PETSc_DMInterpolation_spec, NULL); if (unlikely(!__pyx_ptype_8petsc4py_5PETSc_DMInterpolation)) __PYX_ERR(65, 2, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8petsc4py_5PETSc_DMInterpolation_spec, __pyx_ptype_8petsc4py_5PETSc_DMInterpolation) < 0) __PYX_ERR(65, 2, __pyx_L1_error) #else __pyx_ptype_8petsc4py_5PETSc_DMInterpolation = &__pyx_type_8petsc4py_5PETSc_DMInterpolation; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_8petsc4py_5PETSc_DMInterpolation) < 0) __PYX_ERR(65, 2, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_8petsc4py_5PETSc_DMInterpolation->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_8petsc4py_5PETSc_DMInterpolation->tp_dictoffset && __pyx_ptype_8petsc4py_5PETSc_DMInterpolation->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_8petsc4py_5PETSc_DMInterpolation->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DMInterpolation, (PyObject *) __pyx_ptype_8petsc4py_5PETSc_DMInterpolation) < 0) __PYX_ERR(65, 2, __pyx_L1_error) __pyx_vtabptr_8petsc4py_5PETSc__PyObj = &__pyx_vtable_8petsc4py_5PETSc__PyObj; __pyx_vtable_8petsc4py_5PETSc__PyObj.setcontext = (int (*)(struct __pyx_obj_8petsc4py_5PETSc__PyObj *, void *, struct PyPetscObjectObject *))__pyx_f_8petsc4py_5PETSc_6_PyObj_setcontext; __pyx_vtable_8petsc4py_5PETSc__PyObj.getcontext = (int (*)(struct __pyx_obj_8petsc4py_5PETSc__PyObj *, void **))__pyx_f_8petsc4py_5PETSc_6_PyObj_getcontext; __pyx_vtable_8petsc4py_5PETSc__PyObj.setname = (int (*)(struct __pyx_obj_8petsc4py_5PETSc__PyObj *, char *))__pyx_f_8petsc4py_5PETSc_6_PyObj_setname; __pyx_vtable_8petsc4py_5PETSc__PyObj.getname = (char *(*)(struct __pyx_obj_8petsc4py_5PETSc__PyObj *))__pyx_f_8petsc4py_5PETSc_6_PyObj_getname; #if CYTHON_USE_TYPE_SPECS __pyx_ptype_8petsc4py_5PETSc__PyObj = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8petsc4py_5PETSc__PyObj_spec, NULL); if (unlikely(!__pyx_ptype_8petsc4py_5PETSc__PyObj)) __PYX_ERR(11, 172, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8petsc4py_5PETSc__PyObj_spec, __pyx_ptype_8petsc4py_5PETSc__PyObj) < 0) __PYX_ERR(11, 172, __pyx_L1_error) #else __pyx_ptype_8petsc4py_5PETSc__PyObj = &__pyx_type_8petsc4py_5PETSc__PyObj; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_8petsc4py_5PETSc__PyObj) < 0) __PYX_ERR(11, 172, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_8petsc4py_5PETSc__PyObj->tp_print = 0; #endif if (__Pyx_SetVtable(__pyx_ptype_8petsc4py_5PETSc__PyObj, __pyx_vtabptr_8petsc4py_5PETSc__PyObj) < 0) __PYX_ERR(11, 172, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_8petsc4py_5PETSc__PyObj) < 0) __PYX_ERR(11, 172, __pyx_L1_error) #endif __pyx_vtabptr_8petsc4py_5PETSc__PyMat = &__pyx_vtable_8petsc4py_5PETSc__PyMat; __pyx_vtable_8petsc4py_5PETSc__PyMat.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc__PyObj; #if CYTHON_USE_TYPE_SPECS __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_8petsc4py_5PETSc__PyObj); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_ptype_8petsc4py_5PETSc__PyMat = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8petsc4py_5PETSc__PyMat_spec, __pyx_t_2); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_ptype_8petsc4py_5PETSc__PyMat)) __PYX_ERR(11, 343, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8petsc4py_5PETSc__PyMat_spec, __pyx_ptype_8petsc4py_5PETSc__PyMat) < 0) __PYX_ERR(11, 343, __pyx_L1_error) #else __pyx_ptype_8petsc4py_5PETSc__PyMat = &__pyx_type_8petsc4py_5PETSc__PyMat; #endif #if !CYTHON_COMPILING_IN_LIMITED_API __pyx_ptype_8petsc4py_5PETSc__PyMat->tp_base = __pyx_ptype_8petsc4py_5PETSc__PyObj; #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_8petsc4py_5PETSc__PyMat) < 0) __PYX_ERR(11, 343, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_8petsc4py_5PETSc__PyMat->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_8petsc4py_5PETSc__PyMat->tp_dictoffset && __pyx_ptype_8petsc4py_5PETSc__PyMat->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_8petsc4py_5PETSc__PyMat->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_ptype_8petsc4py_5PETSc__PyMat, __pyx_vtabptr_8petsc4py_5PETSc__PyMat) < 0) __PYX_ERR(11, 343, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_8petsc4py_5PETSc__PyMat) < 0) __PYX_ERR(11, 343, __pyx_L1_error) #endif __pyx_vtabptr_8petsc4py_5PETSc__PyPC = &__pyx_vtable_8petsc4py_5PETSc__PyPC; __pyx_vtable_8petsc4py_5PETSc__PyPC.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc__PyObj; #if CYTHON_USE_TYPE_SPECS __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_8petsc4py_5PETSc__PyObj); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_ptype_8petsc4py_5PETSc__PyPC = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8petsc4py_5PETSc__PyPC_spec, __pyx_t_2); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_ptype_8petsc4py_5PETSc__PyPC)) __PYX_ERR(11, 1252, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8petsc4py_5PETSc__PyPC_spec, __pyx_ptype_8petsc4py_5PETSc__PyPC) < 0) __PYX_ERR(11, 1252, __pyx_L1_error) #else __pyx_ptype_8petsc4py_5PETSc__PyPC = &__pyx_type_8petsc4py_5PETSc__PyPC; #endif #if !CYTHON_COMPILING_IN_LIMITED_API __pyx_ptype_8petsc4py_5PETSc__PyPC->tp_base = __pyx_ptype_8petsc4py_5PETSc__PyObj; #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_8petsc4py_5PETSc__PyPC) < 0) __PYX_ERR(11, 1252, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_8petsc4py_5PETSc__PyPC->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_8petsc4py_5PETSc__PyPC->tp_dictoffset && __pyx_ptype_8petsc4py_5PETSc__PyPC->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_8petsc4py_5PETSc__PyPC->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_ptype_8petsc4py_5PETSc__PyPC, __pyx_vtabptr_8petsc4py_5PETSc__PyPC) < 0) __PYX_ERR(11, 1252, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_8petsc4py_5PETSc__PyPC) < 0) __PYX_ERR(11, 1252, __pyx_L1_error) #endif __pyx_vtabptr_8petsc4py_5PETSc__PyKSP = &__pyx_vtable_8petsc4py_5PETSc__PyKSP; __pyx_vtable_8petsc4py_5PETSc__PyKSP.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc__PyObj; #if CYTHON_USE_TYPE_SPECS __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_8petsc4py_5PETSc__PyObj); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1549, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_ptype_8petsc4py_5PETSc__PyKSP = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8petsc4py_5PETSc__PyKSP_spec, __pyx_t_2); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_ptype_8petsc4py_5PETSc__PyKSP)) __PYX_ERR(11, 1549, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8petsc4py_5PETSc__PyKSP_spec, __pyx_ptype_8petsc4py_5PETSc__PyKSP) < 0) __PYX_ERR(11, 1549, __pyx_L1_error) #else __pyx_ptype_8petsc4py_5PETSc__PyKSP = &__pyx_type_8petsc4py_5PETSc__PyKSP; #endif #if !CYTHON_COMPILING_IN_LIMITED_API __pyx_ptype_8petsc4py_5PETSc__PyKSP->tp_base = __pyx_ptype_8petsc4py_5PETSc__PyObj; #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_8petsc4py_5PETSc__PyKSP) < 0) __PYX_ERR(11, 1549, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_8petsc4py_5PETSc__PyKSP->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_8petsc4py_5PETSc__PyKSP->tp_dictoffset && __pyx_ptype_8petsc4py_5PETSc__PyKSP->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_8petsc4py_5PETSc__PyKSP->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_ptype_8petsc4py_5PETSc__PyKSP, __pyx_vtabptr_8petsc4py_5PETSc__PyKSP) < 0) __PYX_ERR(11, 1549, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_8petsc4py_5PETSc__PyKSP) < 0) __PYX_ERR(11, 1549, __pyx_L1_error) #endif __pyx_vtabptr_8petsc4py_5PETSc__PySNES = &__pyx_vtable_8petsc4py_5PETSc__PySNES; __pyx_vtable_8petsc4py_5PETSc__PySNES.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc__PyObj; #if CYTHON_USE_TYPE_SPECS __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_8petsc4py_5PETSc__PyObj); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 1910, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_ptype_8petsc4py_5PETSc__PySNES = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8petsc4py_5PETSc__PySNES_spec, __pyx_t_2); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_ptype_8petsc4py_5PETSc__PySNES)) __PYX_ERR(11, 1910, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8petsc4py_5PETSc__PySNES_spec, __pyx_ptype_8petsc4py_5PETSc__PySNES) < 0) __PYX_ERR(11, 1910, __pyx_L1_error) #else __pyx_ptype_8petsc4py_5PETSc__PySNES = &__pyx_type_8petsc4py_5PETSc__PySNES; #endif #if !CYTHON_COMPILING_IN_LIMITED_API __pyx_ptype_8petsc4py_5PETSc__PySNES->tp_base = __pyx_ptype_8petsc4py_5PETSc__PyObj; #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_8petsc4py_5PETSc__PySNES) < 0) __PYX_ERR(11, 1910, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_8petsc4py_5PETSc__PySNES->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_8petsc4py_5PETSc__PySNES->tp_dictoffset && __pyx_ptype_8petsc4py_5PETSc__PySNES->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_8petsc4py_5PETSc__PySNES->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_ptype_8petsc4py_5PETSc__PySNES, __pyx_vtabptr_8petsc4py_5PETSc__PySNES) < 0) __PYX_ERR(11, 1910, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_8petsc4py_5PETSc__PySNES) < 0) __PYX_ERR(11, 1910, __pyx_L1_error) #endif __pyx_vtabptr_8petsc4py_5PETSc__PyTS = &__pyx_vtable_8petsc4py_5PETSc__PyTS; __pyx_vtable_8petsc4py_5PETSc__PyTS.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc__PyObj; #if CYTHON_USE_TYPE_SPECS __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_8petsc4py_5PETSc__PyObj); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 2259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_ptype_8petsc4py_5PETSc__PyTS = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8petsc4py_5PETSc__PyTS_spec, __pyx_t_2); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_ptype_8petsc4py_5PETSc__PyTS)) __PYX_ERR(11, 2259, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8petsc4py_5PETSc__PyTS_spec, __pyx_ptype_8petsc4py_5PETSc__PyTS) < 0) __PYX_ERR(11, 2259, __pyx_L1_error) #else __pyx_ptype_8petsc4py_5PETSc__PyTS = &__pyx_type_8petsc4py_5PETSc__PyTS; #endif #if !CYTHON_COMPILING_IN_LIMITED_API __pyx_ptype_8petsc4py_5PETSc__PyTS->tp_base = __pyx_ptype_8petsc4py_5PETSc__PyObj; #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_8petsc4py_5PETSc__PyTS) < 0) __PYX_ERR(11, 2259, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_8petsc4py_5PETSc__PyTS->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_8petsc4py_5PETSc__PyTS->tp_dictoffset && __pyx_ptype_8petsc4py_5PETSc__PyTS->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_8petsc4py_5PETSc__PyTS->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_ptype_8petsc4py_5PETSc__PyTS, __pyx_vtabptr_8petsc4py_5PETSc__PyTS) < 0) __PYX_ERR(11, 2259, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_8petsc4py_5PETSc__PyTS) < 0) __PYX_ERR(11, 2259, __pyx_L1_error) #endif __pyx_vtabptr_8petsc4py_5PETSc__PyTao = &__pyx_vtable_8petsc4py_5PETSc__PyTao; __pyx_vtable_8petsc4py_5PETSc__PyTao.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc__PyObj; #if CYTHON_USE_TYPE_SPECS __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_8petsc4py_5PETSc__PyObj); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 2680, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_ptype_8petsc4py_5PETSc__PyTao = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8petsc4py_5PETSc__PyTao_spec, __pyx_t_2); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_ptype_8petsc4py_5PETSc__PyTao)) __PYX_ERR(11, 2680, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8petsc4py_5PETSc__PyTao_spec, __pyx_ptype_8petsc4py_5PETSc__PyTao) < 0) __PYX_ERR(11, 2680, __pyx_L1_error) #else __pyx_ptype_8petsc4py_5PETSc__PyTao = &__pyx_type_8petsc4py_5PETSc__PyTao; #endif #if !CYTHON_COMPILING_IN_LIMITED_API __pyx_ptype_8petsc4py_5PETSc__PyTao->tp_base = __pyx_ptype_8petsc4py_5PETSc__PyObj; #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_8petsc4py_5PETSc__PyTao) < 0) __PYX_ERR(11, 2680, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_8petsc4py_5PETSc__PyTao->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_8petsc4py_5PETSc__PyTao->tp_dictoffset && __pyx_ptype_8petsc4py_5PETSc__PyTao->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_8petsc4py_5PETSc__PyTao->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_ptype_8petsc4py_5PETSc__PyTao, __pyx_vtabptr_8petsc4py_5PETSc__PyTao) < 0) __PYX_ERR(11, 2680, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_8petsc4py_5PETSc__PyTao) < 0) __PYX_ERR(11, 2680, __pyx_L1_error) #endif #if CYTHON_USE_TYPE_SPECS __pyx_ptype_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator_spec, NULL); if (unlikely(!__pyx_ptype_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator)) __PYX_ERR(33, 178, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator_spec, __pyx_ptype_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator) < 0) __PYX_ERR(33, 178, __pyx_L1_error) #else __pyx_ptype_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator = &__pyx_type_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator) < 0) __PYX_ERR(33, 178, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator->tp_dictoffset && __pyx_ptype_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif #if CYTHON_USE_TYPE_SPECS __pyx_ptype_8petsc4py_5PETSc___pyx_scope_struct_1_decorator = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8petsc4py_5PETSc___pyx_scope_struct_1_decorator_spec, NULL); if (unlikely(!__pyx_ptype_8petsc4py_5PETSc___pyx_scope_struct_1_decorator)) __PYX_ERR(33, 181, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8petsc4py_5PETSc___pyx_scope_struct_1_decorator_spec, __pyx_ptype_8petsc4py_5PETSc___pyx_scope_struct_1_decorator) < 0) __PYX_ERR(33, 181, __pyx_L1_error) #else __pyx_ptype_8petsc4py_5PETSc___pyx_scope_struct_1_decorator = &__pyx_type_8petsc4py_5PETSc___pyx_scope_struct_1_decorator; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_8petsc4py_5PETSc___pyx_scope_struct_1_decorator) < 0) __PYX_ERR(33, 181, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_8petsc4py_5PETSc___pyx_scope_struct_1_decorator->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_8petsc4py_5PETSc___pyx_scope_struct_1_decorator->tp_dictoffset && __pyx_ptype_8petsc4py_5PETSc___pyx_scope_struct_1_decorator->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_8petsc4py_5PETSc___pyx_scope_struct_1_decorator->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif __pyx_vtabptr_array = &__pyx_vtable_array; __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview; #if CYTHON_USE_TYPE_SPECS __pyx_array_type = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type___pyx_array_spec, NULL); if (unlikely(!__pyx_array_type)) __PYX_ERR(13, 114, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API __pyx_array_type->tp_as_buffer = &__pyx_tp_as_buffer_array; if (!__pyx_array_type->tp_as_buffer->bf_releasebuffer && __pyx_array_type->tp_base->tp_as_buffer && __pyx_array_type->tp_base->tp_as_buffer->bf_releasebuffer) { __pyx_array_type->tp_as_buffer->bf_releasebuffer = __pyx_array_type->tp_base->tp_as_buffer->bf_releasebuffer; } #elif defined(Py_bf_getbuffer) && defined(Py_bf_releasebuffer) /* PY_VERSION_HEX >= 0x03090000 || Py_LIMITED_API >= 0x030B0000 */ #elif defined(_MSC_VER) #pragma message ("The buffer protocol is not supported in the Limited C-API < 3.11.") #else #warning "The buffer protocol is not supported in the Limited C-API < 3.11." #endif if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type___pyx_array_spec, __pyx_array_type) < 0) __PYX_ERR(13, 114, __pyx_L1_error) #else __pyx_array_type = &__pyx_type___pyx_array; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_array_type) < 0) __PYX_ERR(13, 114, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_array_type->tp_print = 0; #endif if (__Pyx_SetVtable(__pyx_array_type, __pyx_vtabptr_array) < 0) __PYX_ERR(13, 114, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_array_type) < 0) __PYX_ERR(13, 114, __pyx_L1_error) #endif #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_setup_reduce((PyObject *) __pyx_array_type) < 0) __PYX_ERR(13, 114, __pyx_L1_error) #endif #if CYTHON_USE_TYPE_SPECS __pyx_MemviewEnum_type = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type___pyx_MemviewEnum_spec, NULL); if (unlikely(!__pyx_MemviewEnum_type)) __PYX_ERR(13, 302, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type___pyx_MemviewEnum_spec, __pyx_MemviewEnum_type) < 0) __PYX_ERR(13, 302, __pyx_L1_error) #else __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_MemviewEnum_type) < 0) __PYX_ERR(13, 302, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_MemviewEnum_type->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_MemviewEnum_type->tp_dictoffset && __pyx_MemviewEnum_type->tp_getattro == PyObject_GenericGetAttr)) { __pyx_MemviewEnum_type->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_setup_reduce((PyObject *) __pyx_MemviewEnum_type) < 0) __PYX_ERR(13, 302, __pyx_L1_error) #endif __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview; __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer; __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice; __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment; __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar; __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed; __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object; __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object; __pyx_vtable_memoryview._get_base = (PyObject *(*)(struct __pyx_memoryview_obj *))__pyx_memoryview__get_base; #if CYTHON_USE_TYPE_SPECS __pyx_memoryview_type = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type___pyx_memoryview_spec, NULL); if (unlikely(!__pyx_memoryview_type)) __PYX_ERR(13, 337, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API __pyx_memoryview_type->tp_as_buffer = &__pyx_tp_as_buffer_memoryview; if (!__pyx_memoryview_type->tp_as_buffer->bf_releasebuffer && __pyx_memoryview_type->tp_base->tp_as_buffer && __pyx_memoryview_type->tp_base->tp_as_buffer->bf_releasebuffer) { __pyx_memoryview_type->tp_as_buffer->bf_releasebuffer = __pyx_memoryview_type->tp_base->tp_as_buffer->bf_releasebuffer; } #elif defined(Py_bf_getbuffer) && defined(Py_bf_releasebuffer) /* PY_VERSION_HEX >= 0x03090000 || Py_LIMITED_API >= 0x030B0000 */ #elif defined(_MSC_VER) #pragma message ("The buffer protocol is not supported in the Limited C-API < 3.11.") #else #warning "The buffer protocol is not supported in the Limited C-API < 3.11." #endif if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type___pyx_memoryview_spec, __pyx_memoryview_type) < 0) __PYX_ERR(13, 337, __pyx_L1_error) #else __pyx_memoryview_type = &__pyx_type___pyx_memoryview; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_memoryview_type) < 0) __PYX_ERR(13, 337, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_memoryview_type->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_memoryview_type->tp_dictoffset && __pyx_memoryview_type->tp_getattro == PyObject_GenericGetAttr)) { __pyx_memoryview_type->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_memoryview_type, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(13, 337, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_memoryview_type) < 0) __PYX_ERR(13, 337, __pyx_L1_error) #endif #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_setup_reduce((PyObject *) __pyx_memoryview_type) < 0) __PYX_ERR(13, 337, __pyx_L1_error) #endif __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice; __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview; __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object; __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object; __pyx_vtable__memoryviewslice.__pyx_base._get_base = (PyObject *(*)(struct __pyx_memoryview_obj *))__pyx_memoryviewslice__get_base; #if CYTHON_USE_TYPE_SPECS __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_memoryview_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 952, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_memoryviewslice_type = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type___pyx_memoryviewslice_spec, __pyx_t_2); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_memoryviewslice_type)) __PYX_ERR(13, 952, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type___pyx_memoryviewslice_spec, __pyx_memoryviewslice_type) < 0) __PYX_ERR(13, 952, __pyx_L1_error) #else __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice; #endif #if !CYTHON_COMPILING_IN_LIMITED_API __pyx_memoryviewslice_type->tp_base = __pyx_memoryview_type; #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_memoryviewslice_type) < 0) __PYX_ERR(13, 952, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_memoryviewslice_type->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_memoryviewslice_type->tp_dictoffset && __pyx_memoryviewslice_type->tp_getattro == PyObject_GenericGetAttr)) { __pyx_memoryviewslice_type->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_memoryviewslice_type, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(13, 952, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_memoryviewslice_type) < 0) __PYX_ERR(13, 952, __pyx_L1_error) #endif #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_setup_reduce((PyObject *) __pyx_memoryviewslice_type) < 0) __PYX_ERR(13, 952, __pyx_L1_error) #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_PETSc(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_PETSc}, {0, NULL} }; #endif #ifdef __cplusplus namespace { struct PyModuleDef __pyx_moduledef = #else static struct PyModuleDef __pyx_moduledef = #endif { PyModuleDef_HEAD_INIT, "PETSc", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #elif CYTHON_USE_MODULE_STATE sizeof(__pyx_mstate), /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif #if CYTHON_USE_MODULE_STATE __pyx_m_traverse, /* m_traverse */ __pyx_m_clear, /* m_clear */ (freefunc)__pyx_module_cleanup /* m_free */ #else NULL, /* m_traverse */ NULL, /* m_clear */ (freefunc)__pyx_module_cleanup /* m_free */ #endif }; #ifdef __cplusplus } /* anonymous namespace */ #endif #endif #ifndef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #elif PY_MAJOR_VERSION < 3 #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" void #else #define __Pyx_PyMODINIT_FUNC void #endif #else #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * #else #define __Pyx_PyMODINIT_FUNC PyObject * #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC initPETSc(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC initPETSc(void) #else __Pyx_PyMODINIT_FUNC PyInit_PETSc(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_PETSc(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) #else static PyInterpreterState *main_interpreter = NULL; PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; if (!main_interpreter) { main_interpreter = current_interpreter; } else if (unlikely(main_interpreter != current_interpreter)) #endif { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) #else static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) #endif { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { #if CYTHON_COMPILING_IN_LIMITED_API result = PyModule_AddObject(module, to_name, value); #else result = PyDict_SetItemString(moddict, to_name, value); #endif } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; CYTHON_UNUSED_VAR(def); if (__Pyx_check_single_interpreter()) return NULL; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API moddict = module; #else moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; #endif if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static CYTHON_SMALL_CODE int __pyx_pymod_exec_PETSc(PyObject *__pyx_pyinit_module) #endif #endif { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; static PyThread_type_lock __pyx_t_8[8]; int __pyx_t_9; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { if (__pyx_m == __pyx_pyinit_module) return 0; PyErr_SetString(PyExc_RuntimeError, "Module 'PETSc' has already been imported. Re-initialisation is not supported."); return -1; } #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("PETSc", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); if (unlikely(!__pyx_m)) __PYX_ERR(14, 1, __pyx_L1_error) #elif CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to PETSc pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(14, 1, __pyx_L1_error) pystate_addmodule_run = 1; } #else __pyx_m = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_m)) __PYX_ERR(14, 1, __pyx_L1_error) #endif #endif CYTHON_UNUSED_VAR(__pyx_t_1); __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(14, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(14, 1, __pyx_L1_error) __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(14, 1, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(14, 1, __pyx_L1_error) #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_PETSc(void)", 0); if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(14, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(14, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(14, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(14, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(14, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(14, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(14, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(14, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(14, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(14, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS PyEval_InitThreads(); #endif /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitConstants() < 0) __PYX_ERR(14, 1, __pyx_L1_error) stringtab_initialized = 1; if (__Pyx_InitGlobals() < 0) __PYX_ERR(14, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(14, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_petsc4py__PETSc) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(14, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(14, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "petsc4py.PETSc")) { if (unlikely((PyDict_SetItemString(modules, "petsc4py.PETSc", __pyx_m) < 0))) __PYX_ERR(14, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(14, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(14, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); if (unlikely((__Pyx_modinit_function_export_code() < 0))) __PYX_ERR(14, 1, __pyx_L1_error) if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(14, 1, __pyx_L1_error) (void)__Pyx_modinit_type_import_code(); (void)__Pyx_modinit_variable_import_code(); (void)__Pyx_modinit_function_import_code(); /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(14, 1, __pyx_L1_error) #endif /* "View.MemoryView":99 * * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence" * try: # <<<<<<<<<<<<<< * if __import__("sys").version_info >= (3, 3): * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { /* "View.MemoryView":100 * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence" * try: * if __import__("sys").version_info >= (3, 3): # <<<<<<<<<<<<<< * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence * else: */ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__67, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 100, __pyx_L2_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_version_info); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 100, __pyx_L2_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_tuple__68, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 100, __pyx_L2_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(13, 100, __pyx_L2_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { /* "View.MemoryView":101 * try: * if __import__("sys").version_info >= (3, 3): * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence # <<<<<<<<<<<<<< * else: * __pyx_collections_abc_Sequence = __import__("collections").Sequence */ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__69, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 101, __pyx_L2_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_abc); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 101, __pyx_L2_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_Sequence); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 101, __pyx_L2_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XGOTREF(__pyx_collections_abc_Sequence); __Pyx_DECREF_SET(__pyx_collections_abc_Sequence, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; /* "View.MemoryView":100 * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence" * try: * if __import__("sys").version_info >= (3, 3): # <<<<<<<<<<<<<< * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence * else: */ goto __pyx_L8; } /* "View.MemoryView":103 * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence * else: * __pyx_collections_abc_Sequence = __import__("collections").Sequence # <<<<<<<<<<<<<< * except: * */ /*else*/ { __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__70, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 103, __pyx_L2_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Sequence); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 103, __pyx_L2_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XGOTREF(__pyx_collections_abc_Sequence); __Pyx_DECREF_SET(__pyx_collections_abc_Sequence, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_L8:; /* "View.MemoryView":99 * * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence" * try: # <<<<<<<<<<<<<< * if __import__("sys").version_info >= (3, 3): * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence */ } __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L7_try_end; __pyx_L2_error:; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /* "View.MemoryView":104 * else: * __pyx_collections_abc_Sequence = __import__("collections").Sequence * except: # <<<<<<<<<<<<<< * * __pyx_collections_abc_Sequence = None */ /*except:*/ { __Pyx_AddTraceback("View.MemoryView", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_7) < 0) __PYX_ERR(13, 104, __pyx_L4_except_error) __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_7); /* "View.MemoryView":106 * except: * * __pyx_collections_abc_Sequence = None # <<<<<<<<<<<<<< * * */ __Pyx_INCREF(Py_None); __Pyx_XGOTREF(__pyx_collections_abc_Sequence); __Pyx_DECREF_SET(__pyx_collections_abc_Sequence, Py_None); __Pyx_GIVEREF(Py_None); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L3_exception_handled; } /* "View.MemoryView":99 * * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence" * try: # <<<<<<<<<<<<<< * if __import__("sys").version_info >= (3, 3): * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence */ __pyx_L4_except_error:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; __pyx_L3_exception_handled:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); __pyx_L7_try_end:; } /* "View.MemoryView":241 * * * try: # <<<<<<<<<<<<<< * count = __pyx_collections_abc_Sequence.count * index = __pyx_collections_abc_Sequence.index */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_1); /*try:*/ { /* "View.MemoryView":242 * * try: * count = __pyx_collections_abc_Sequence.count # <<<<<<<<<<<<<< * index = __pyx_collections_abc_Sequence.index * except: */ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_n_s_count); if (unlikely(!__pyx_t_7)) __PYX_ERR(13, 242, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetItemOnTypeDict(__pyx_array_type, __pyx_n_s_count, __pyx_t_7) < 0) __PYX_ERR(13, 242, __pyx_L11_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; PyType_Modified(__pyx_array_type); /* "View.MemoryView":243 * try: * count = __pyx_collections_abc_Sequence.count * index = __pyx_collections_abc_Sequence.index # <<<<<<<<<<<<<< * except: * pass */ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_n_s_index); if (unlikely(!__pyx_t_7)) __PYX_ERR(13, 243, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetItemOnTypeDict(__pyx_array_type, __pyx_n_s_index, __pyx_t_7) < 0) __PYX_ERR(13, 243, __pyx_L11_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; PyType_Modified(__pyx_array_type); /* "View.MemoryView":241 * * * try: # <<<<<<<<<<<<<< * count = __pyx_collections_abc_Sequence.count * index = __pyx_collections_abc_Sequence.index */ } __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L16_try_end; __pyx_L11_error:; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; /* "View.MemoryView":244 * count = __pyx_collections_abc_Sequence.count * index = __pyx_collections_abc_Sequence.index * except: # <<<<<<<<<<<<<< * pass * */ /*except:*/ { __Pyx_ErrRestore(0,0,0); goto __pyx_L12_exception_handled; } __pyx_L12_exception_handled:; __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_1); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1); __pyx_L16_try_end:; } /* "View.MemoryView":309 * return self.name * * cdef generic = Enum("") # <<<<<<<<<<<<<< * cdef strided = Enum("") # default * cdef indirect = Enum("") */ __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__71, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(13, 309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_XGOTREF(generic); __Pyx_DECREF_SET(generic, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = 0; /* "View.MemoryView":310 * * cdef generic = Enum("") * cdef strided = Enum("") # default # <<<<<<<<<<<<<< * cdef indirect = Enum("") * */ __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__72, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(13, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_XGOTREF(strided); __Pyx_DECREF_SET(strided, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = 0; /* "View.MemoryView":311 * cdef generic = Enum("") * cdef strided = Enum("") # default * cdef indirect = Enum("") # <<<<<<<<<<<<<< * * */ __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__73, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(13, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_XGOTREF(indirect); __Pyx_DECREF_SET(indirect, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = 0; /* "View.MemoryView":314 * * * cdef contiguous = Enum("") # <<<<<<<<<<<<<< * cdef indirect_contiguous = Enum("") * */ __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__74, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(13, 314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_XGOTREF(contiguous); __Pyx_DECREF_SET(contiguous, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = 0; /* "View.MemoryView":315 * * cdef contiguous = Enum("") * cdef indirect_contiguous = Enum("") # <<<<<<<<<<<<<< * * */ __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__75, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(13, 315, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_XGOTREF(indirect_contiguous); __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = 0; /* "View.MemoryView":323 * * * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<< * cdef PyThread_type_lock[8] __pyx_memoryview_thread_locks = [ * PyThread_allocate_lock(), */ __pyx_memoryview_thread_locks_used = 0; /* "View.MemoryView":324 * * cdef int __pyx_memoryview_thread_locks_used = 0 * cdef PyThread_type_lock[8] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<< * PyThread_allocate_lock(), * PyThread_allocate_lock(), */ __pyx_t_8[0] = PyThread_allocate_lock(); __pyx_t_8[1] = PyThread_allocate_lock(); __pyx_t_8[2] = PyThread_allocate_lock(); __pyx_t_8[3] = PyThread_allocate_lock(); __pyx_t_8[4] = PyThread_allocate_lock(); __pyx_t_8[5] = PyThread_allocate_lock(); __pyx_t_8[6] = PyThread_allocate_lock(); __pyx_t_8[7] = PyThread_allocate_lock(); memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_8, sizeof(__pyx_memoryview_thread_locks[0]) * (8)); /* "View.MemoryView":982 * * * try: # <<<<<<<<<<<<<< * count = __pyx_collections_abc_Sequence.count * index = __pyx_collections_abc_Sequence.index */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { /* "View.MemoryView":983 * * try: * count = __pyx_collections_abc_Sequence.count # <<<<<<<<<<<<<< * index = __pyx_collections_abc_Sequence.index * except: */ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_n_s_count); if (unlikely(!__pyx_t_7)) __PYX_ERR(13, 983, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetItemOnTypeDict(__pyx_memoryviewslice_type, __pyx_n_s_count, __pyx_t_7) < 0) __PYX_ERR(13, 983, __pyx_L17_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; PyType_Modified(__pyx_memoryviewslice_type); /* "View.MemoryView":984 * try: * count = __pyx_collections_abc_Sequence.count * index = __pyx_collections_abc_Sequence.index # <<<<<<<<<<<<<< * except: * pass */ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_n_s_index); if (unlikely(!__pyx_t_7)) __PYX_ERR(13, 984, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetItemOnTypeDict(__pyx_memoryviewslice_type, __pyx_n_s_index, __pyx_t_7) < 0) __PYX_ERR(13, 984, __pyx_L17_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; PyType_Modified(__pyx_memoryviewslice_type); /* "View.MemoryView":982 * * * try: # <<<<<<<<<<<<<< * count = __pyx_collections_abc_Sequence.count * index = __pyx_collections_abc_Sequence.index */ } __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L22_try_end; __pyx_L17_error:; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; /* "View.MemoryView":985 * count = __pyx_collections_abc_Sequence.count * index = __pyx_collections_abc_Sequence.index * except: # <<<<<<<<<<<<<< * pass * */ /*except:*/ { __Pyx_ErrRestore(0,0,0); goto __pyx_L18_exception_handled; } __pyx_L18_exception_handled:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); __pyx_L22_try_end:; } /* "View.MemoryView":988 * pass * * try: # <<<<<<<<<<<<<< * if __pyx_collections_abc_Sequence: * */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_1); /*try:*/ { /* "View.MemoryView":989 * * try: * if __pyx_collections_abc_Sequence: # <<<<<<<<<<<<<< * * */ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_collections_abc_Sequence); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(13, 989, __pyx_L23_error) if (__pyx_t_6) { /* "View.MemoryView":993 * * * __pyx_collections_abc_Sequence.register(_memoryviewslice) # <<<<<<<<<<<<<< * __pyx_collections_abc_Sequence.register(array) * except: */ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_n_s_register); if (unlikely(!__pyx_t_7)) __PYX_ERR(13, 993, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, ((PyObject *)__pyx_memoryviewslice_type)); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 993, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "View.MemoryView":994 * * __pyx_collections_abc_Sequence.register(_memoryviewslice) * __pyx_collections_abc_Sequence.register(array) # <<<<<<<<<<<<<< * except: * pass # ignore failure, it's a minor issue */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_n_s_register); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 994, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_array_type)); if (unlikely(!__pyx_t_7)) __PYX_ERR(13, 994, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "View.MemoryView":989 * * try: * if __pyx_collections_abc_Sequence: # <<<<<<<<<<<<<< * * */ } /* "View.MemoryView":988 * pass * * try: # <<<<<<<<<<<<<< * if __pyx_collections_abc_Sequence: * */ } __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L28_try_end; __pyx_L23_error:; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; /* "View.MemoryView":995 * __pyx_collections_abc_Sequence.register(_memoryviewslice) * __pyx_collections_abc_Sequence.register(array) * except: # <<<<<<<<<<<<<< * pass # ignore failure, it's a minor issue * */ /*except:*/ { __Pyx_ErrRestore(0,0,0); goto __pyx_L24_exception_handled; } __pyx_L24_exception_handled:; __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_1); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1); __pyx_L28_try_end:; } /* "(tree fragment)":1 * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ __pyx_t_7 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView); if (unlikely(!__pyx_t_7)) __PYX_ERR(13, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_7) < 0) __PYX_ERR(13, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "petsc4py/PETSc/PETSc.pyx":65 * # -------------- * * cdef object PetscError = PyExc_RuntimeError # <<<<<<<<<<<<<< * * cdef inline int SETERR(PetscErrorCode ierr) except -1 nogil: */ __pyx_t_7 = ((PyObject *)PyExc_RuntimeError); __Pyx_INCREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_v_8petsc4py_5PETSc_PetscError); __Pyx_DECREF_SET(__pyx_v_8petsc4py_5PETSc_PetscError, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = 0; /* "petsc4py/PETSc/PETSc.pyx":158 * include "arraynpy.pxi" * * import_array() # <<<<<<<<<<<<<< * * IntType = PyArray_TypeObjectFromType(NPY_PETSC_INT) */ __pyx_t_9 = _import_array(); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(12, 158, __pyx_L1_error) /* "petsc4py/PETSc/PETSc.pyx":160 * import_array() * * IntType = PyArray_TypeObjectFromType(NPY_PETSC_INT) # <<<<<<<<<<<<<< * RealType = PyArray_TypeObjectFromType(NPY_PETSC_REAL) * ScalarType = PyArray_TypeObjectFromType(NPY_PETSC_SCALAR) */ __pyx_t_7 = PyArray_TypeObjectFromType(NPY_PETSC_INT); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_IntType, __pyx_t_7) < 0) __PYX_ERR(12, 160, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "petsc4py/PETSc/PETSc.pyx":161 * * IntType = PyArray_TypeObjectFromType(NPY_PETSC_INT) * RealType = PyArray_TypeObjectFromType(NPY_PETSC_REAL) # <<<<<<<<<<<<<< * ScalarType = PyArray_TypeObjectFromType(NPY_PETSC_SCALAR) * ComplexType = PyArray_TypeObjectFromType(NPY_PETSC_COMPLEX) */ __pyx_t_7 = PyArray_TypeObjectFromType(NPY_PETSC_REAL); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_RealType, __pyx_t_7) < 0) __PYX_ERR(12, 161, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "petsc4py/PETSc/PETSc.pyx":162 * IntType = PyArray_TypeObjectFromType(NPY_PETSC_INT) * RealType = PyArray_TypeObjectFromType(NPY_PETSC_REAL) * ScalarType = PyArray_TypeObjectFromType(NPY_PETSC_SCALAR) # <<<<<<<<<<<<<< * ComplexType = PyArray_TypeObjectFromType(NPY_PETSC_COMPLEX) * */ __pyx_t_7 = PyArray_TypeObjectFromType(NPY_PETSC_SCALAR); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_ScalarType, __pyx_t_7) < 0) __PYX_ERR(12, 162, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "petsc4py/PETSc/PETSc.pyx":163 * RealType = PyArray_TypeObjectFromType(NPY_PETSC_REAL) * ScalarType = PyArray_TypeObjectFromType(NPY_PETSC_SCALAR) * ComplexType = PyArray_TypeObjectFromType(NPY_PETSC_COMPLEX) # <<<<<<<<<<<<<< * * include "dlpack.pxi" */ __pyx_t_7 = PyArray_TypeObjectFromType(NPY_PETSC_COMPLEX); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_ComplexType, __pyx_t_7) < 0) __PYX_ERR(12, 163, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "petsc4py/PETSc/petscpyappctx.pxi":1 * cdef set appctx_registry = set() # <<<<<<<<<<<<<< * * cdef inline object registerAppCtx(void *appctx): */ __pyx_t_7 = PySet_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(30, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_v_8petsc4py_5PETSc_appctx_registry); __Pyx_DECREF_SET(__pyx_v_8petsc4py_5PETSc_appctx_registry, ((PyObject*)__pyx_t_7)); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = 0; /* "petsc4py/PETSc/PETSc.pyx":212 * # -------------------------------------------------------------------- * * __doc__ = """ # <<<<<<<<<<<<<< * Portable, Extensible Toolkit for Scientific Computation. * """ */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_doc, __pyx_kp_s_Portable_Extensible_Toolkit_for) < 0) __PYX_ERR(12, 212, __pyx_L1_error) /* "petsc4py/PETSc/Const.pyx":3 * # ------------------------------------------------------------------------------ * * DECIDE = PETSC_DECIDE # <<<<<<<<<<<<<< * DEFAULT = PETSC_DEFAULT * DETERMINE = PETSC_DETERMINE */ __pyx_t_7 = __Pyx_PyInt_From___pyx_anon_enum(PETSC_DECIDE); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_DECIDE, __pyx_t_7) < 0) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "petsc4py/PETSc/Const.pyx":4 * * DECIDE = PETSC_DECIDE * DEFAULT = PETSC_DEFAULT # <<<<<<<<<<<<<< * DETERMINE = PETSC_DETERMINE * */ __pyx_t_7 = __Pyx_PyInt_From___pyx_anon_enum(PETSC_DEFAULT); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_DEFAULT, __pyx_t_7) < 0) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "petsc4py/PETSc/Const.pyx":5 * DECIDE = PETSC_DECIDE * DEFAULT = PETSC_DEFAULT * DETERMINE = PETSC_DETERMINE # <<<<<<<<<<<<<< * * __doc__ += """ */ __pyx_t_7 = __Pyx_PyInt_From___pyx_anon_enum(PETSC_DETERMINE); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_DETERMINE, __pyx_t_7) < 0) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "petsc4py/PETSc/Const.pyx":7 * DETERMINE = PETSC_DETERMINE * * __doc__ += """ # <<<<<<<<<<<<<< * Basic constants: * */ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_doc); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_7, __pyx_kp_s_Basic_constants_DECIDE_Use_a_de); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_doc, __pyx_t_4) < 0) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/Const.pyx":20 * # ------------------------------------------------------------------------------ * * INFINITY = toReal(PETSC_INFINITY) # <<<<<<<<<<<<<< * NINFINITY = toReal(PETSC_NINFINITY) * PINFINITY = toReal(PETSC_INFINITY) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toReal(PETSC_INFINITY); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_INFINITY, __pyx_t_4) < 0) __PYX_ERR(0, 20, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/Const.pyx":21 * * INFINITY = toReal(PETSC_INFINITY) * NINFINITY = toReal(PETSC_NINFINITY) # <<<<<<<<<<<<<< * PINFINITY = toReal(PETSC_INFINITY) * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toReal(PETSC_NINFINITY); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_NINFINITY, __pyx_t_4) < 0) __PYX_ERR(0, 21, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/Const.pyx":22 * INFINITY = toReal(PETSC_INFINITY) * NINFINITY = toReal(PETSC_NINFINITY) * PINFINITY = toReal(PETSC_INFINITY) # <<<<<<<<<<<<<< * * __doc__ += """ */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toReal(PETSC_INFINITY); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_PINFINITY, __pyx_t_4) < 0) __PYX_ERR(0, 22, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/Const.pyx":24 * PINFINITY = toReal(PETSC_INFINITY) * * __doc__ += """ # <<<<<<<<<<<<<< * More constants: * */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_doc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_t_4, __pyx_kp_s_More_constants_INFINITY_Very_la); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_doc, __pyx_t_7) < 0) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "petsc4py/PETSc/Const.pyx":37 * # ------------------------------------------------------------------------------ * * class InsertMode(object): # <<<<<<<<<<<<<< * """Insertion mode. * */ __pyx_t_7 = __Pyx_PEP560_update_bases(__pyx_tuple__79); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_7, __pyx_n_s_InsertMode, __pyx_n_s_InsertMode, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, __pyx_kp_s_Insertion_mode_Most_commonly_use); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_7 != __pyx_tuple__79) { if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_tuple__79) < 0))) __PYX_ERR(0, 37, __pyx_L1_error) } /* "petsc4py/PETSc/Const.pyx":55 * """ * # native * NOT_SET_VALUES = PETSC_NOT_SET_VALUES # <<<<<<<<<<<<<< * INSERT_VALUES = PETSC_INSERT_VALUES * ADD_VALUES = PETSC_ADD_VALUES */ __pyx_t_10 = __Pyx_PyInt_From_InsertMode(NOT_SET_VALUES); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_NOT_SET_VALUES, __pyx_t_10) < 0) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Const.pyx":56 * # native * NOT_SET_VALUES = PETSC_NOT_SET_VALUES * INSERT_VALUES = PETSC_INSERT_VALUES # <<<<<<<<<<<<<< * ADD_VALUES = PETSC_ADD_VALUES * MAX_VALUES = PETSC_MAX_VALUES */ __pyx_t_10 = __Pyx_PyInt_From_InsertMode(INSERT_VALUES); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_INSERT_VALUES, __pyx_t_10) < 0) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Const.pyx":57 * NOT_SET_VALUES = PETSC_NOT_SET_VALUES * INSERT_VALUES = PETSC_INSERT_VALUES * ADD_VALUES = PETSC_ADD_VALUES # <<<<<<<<<<<<<< * MAX_VALUES = PETSC_MAX_VALUES * INSERT_ALL_VALUES = PETSC_INSERT_ALL_VALUES */ __pyx_t_10 = __Pyx_PyInt_From_InsertMode(ADD_VALUES); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_ADD_VALUES, __pyx_t_10) < 0) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Const.pyx":58 * INSERT_VALUES = PETSC_INSERT_VALUES * ADD_VALUES = PETSC_ADD_VALUES * MAX_VALUES = PETSC_MAX_VALUES # <<<<<<<<<<<<<< * INSERT_ALL_VALUES = PETSC_INSERT_ALL_VALUES * ADD_ALL_VALUES = PETSC_ADD_ALL_VALUES */ __pyx_t_10 = __Pyx_PyInt_From_InsertMode(MAX_VALUES); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_MAX_VALUES, __pyx_t_10) < 0) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Const.pyx":59 * ADD_VALUES = PETSC_ADD_VALUES * MAX_VALUES = PETSC_MAX_VALUES * INSERT_ALL_VALUES = PETSC_INSERT_ALL_VALUES # <<<<<<<<<<<<<< * ADD_ALL_VALUES = PETSC_ADD_ALL_VALUES * INSERT_BC_VALUES = PETSC_INSERT_BC_VALUES */ __pyx_t_10 = __Pyx_PyInt_From_InsertMode(INSERT_ALL_VALUES); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_INSERT_ALL_VALUES, __pyx_t_10) < 0) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Const.pyx":60 * MAX_VALUES = PETSC_MAX_VALUES * INSERT_ALL_VALUES = PETSC_INSERT_ALL_VALUES * ADD_ALL_VALUES = PETSC_ADD_ALL_VALUES # <<<<<<<<<<<<<< * INSERT_BC_VALUES = PETSC_INSERT_BC_VALUES * ADD_BC_VALUES = PETSC_ADD_BC_VALUES */ __pyx_t_10 = __Pyx_PyInt_From_InsertMode(ADD_ALL_VALUES); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_ADD_ALL_VALUES, __pyx_t_10) < 0) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Const.pyx":61 * INSERT_ALL_VALUES = PETSC_INSERT_ALL_VALUES * ADD_ALL_VALUES = PETSC_ADD_ALL_VALUES * INSERT_BC_VALUES = PETSC_INSERT_BC_VALUES # <<<<<<<<<<<<<< * ADD_BC_VALUES = PETSC_ADD_BC_VALUES * # aliases */ __pyx_t_10 = __Pyx_PyInt_From_InsertMode(INSERT_BC_VALUES); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_INSERT_BC_VALUES, __pyx_t_10) < 0) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Const.pyx":62 * ADD_ALL_VALUES = PETSC_ADD_ALL_VALUES * INSERT_BC_VALUES = PETSC_INSERT_BC_VALUES * ADD_BC_VALUES = PETSC_ADD_BC_VALUES # <<<<<<<<<<<<<< * # aliases * INSERT = INSERT_VALUES */ __pyx_t_10 = __Pyx_PyInt_From_InsertMode(ADD_BC_VALUES); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_ADD_BC_VALUES, __pyx_t_10) < 0) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Const.pyx":64 * ADD_BC_VALUES = PETSC_ADD_BC_VALUES * # aliases * INSERT = INSERT_VALUES # <<<<<<<<<<<<<< * ADD = ADD_VALUES * MAX = MAX_VALUES */ __pyx_t_10 = PyObject_GetItem(__pyx_t_5, __pyx_n_s_INSERT_VALUES); if (unlikely(!__pyx_t_10)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_INSERT_VALUES); } if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_INSERT, __pyx_t_10) < 0) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Const.pyx":65 * # aliases * INSERT = INSERT_VALUES * ADD = ADD_VALUES # <<<<<<<<<<<<<< * MAX = MAX_VALUES * INSERT_ALL = INSERT_ALL_VALUES */ __pyx_t_10 = PyObject_GetItem(__pyx_t_5, __pyx_n_s_ADD_VALUES); if (unlikely(!__pyx_t_10)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_ADD_VALUES); } if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_ADD, __pyx_t_10) < 0) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Const.pyx":66 * INSERT = INSERT_VALUES * ADD = ADD_VALUES * MAX = MAX_VALUES # <<<<<<<<<<<<<< * INSERT_ALL = INSERT_ALL_VALUES * ADD_ALL = ADD_ALL_VALUES */ __pyx_t_10 = PyObject_GetItem(__pyx_t_5, __pyx_n_s_MAX_VALUES); if (unlikely(!__pyx_t_10)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_MAX_VALUES); } if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_MAX, __pyx_t_10) < 0) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Const.pyx":67 * ADD = ADD_VALUES * MAX = MAX_VALUES * INSERT_ALL = INSERT_ALL_VALUES # <<<<<<<<<<<<<< * ADD_ALL = ADD_ALL_VALUES * INSERT_BC = INSERT_BC_VALUES */ __pyx_t_10 = PyObject_GetItem(__pyx_t_5, __pyx_n_s_INSERT_ALL_VALUES); if (unlikely(!__pyx_t_10)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_INSERT_ALL_VALUES); } if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_INSERT_ALL, __pyx_t_10) < 0) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Const.pyx":68 * MAX = MAX_VALUES * INSERT_ALL = INSERT_ALL_VALUES * ADD_ALL = ADD_ALL_VALUES # <<<<<<<<<<<<<< * INSERT_BC = INSERT_BC_VALUES * ADD_BC = ADD_BC_VALUES */ __pyx_t_10 = PyObject_GetItem(__pyx_t_5, __pyx_n_s_ADD_ALL_VALUES); if (unlikely(!__pyx_t_10)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_ADD_ALL_VALUES); } if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_ADD_ALL, __pyx_t_10) < 0) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Const.pyx":69 * INSERT_ALL = INSERT_ALL_VALUES * ADD_ALL = ADD_ALL_VALUES * INSERT_BC = INSERT_BC_VALUES # <<<<<<<<<<<<<< * ADD_BC = ADD_BC_VALUES * */ __pyx_t_10 = PyObject_GetItem(__pyx_t_5, __pyx_n_s_INSERT_BC_VALUES); if (unlikely(!__pyx_t_10)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_INSERT_BC_VALUES); } if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_INSERT_BC, __pyx_t_10) < 0) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Const.pyx":70 * ADD_ALL = ADD_ALL_VALUES * INSERT_BC = INSERT_BC_VALUES * ADD_BC = ADD_BC_VALUES # <<<<<<<<<<<<<< * * # ------------------------------------------------------------------------------ */ __pyx_t_10 = PyObject_GetItem(__pyx_t_5, __pyx_n_s_ADD_BC_VALUES); if (unlikely(!__pyx_t_10)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_ADD_BC_VALUES); } if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_ADD_BC, __pyx_t_10) < 0) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Const.pyx":37 * # ------------------------------------------------------------------------------ * * class InsertMode(object): # <<<<<<<<<<<<<< * """Insertion mode. * */ __pyx_t_10 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_n_s_InsertMode, __pyx_t_7, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (PyDict_SetItem(__pyx_d, __pyx_n_s_InsertMode, __pyx_t_10) < 0) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "petsc4py/PETSc/Const.pyx":74 * # ------------------------------------------------------------------------------ * * class ScatterMode(object): # <<<<<<<<<<<<<< * """Scatter mode. * */ __pyx_t_7 = __Pyx_PEP560_update_bases(__pyx_tuple__81); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_7, __pyx_n_s_ScatterMode, __pyx_n_s_ScatterMode, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, __pyx_kp_s_Scatter_mode_Most_commonly_used); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_7 != __pyx_tuple__81) { if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_tuple__81) < 0))) __PYX_ERR(0, 74, __pyx_L1_error) } /* "petsc4py/PETSc/Const.pyx":91 * """ * # native * SCATTER_FORWARD = PETSC_SCATTER_FORWARD # <<<<<<<<<<<<<< * SCATTER_REVERSE = PETSC_SCATTER_REVERSE * SCATTER_FORWARD_LOCAL = PETSC_SCATTER_FORWARD_LOCAL */ __pyx_t_10 = __Pyx_PyInt_From_ScatterMode(SCATTER_FORWARD); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_SCATTER_FORWARD, __pyx_t_10) < 0) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Const.pyx":92 * # native * SCATTER_FORWARD = PETSC_SCATTER_FORWARD * SCATTER_REVERSE = PETSC_SCATTER_REVERSE # <<<<<<<<<<<<<< * SCATTER_FORWARD_LOCAL = PETSC_SCATTER_FORWARD_LOCAL * SCATTER_REVERSE_LOCAL = PETSC_SCATTER_REVERSE_LOCAL */ __pyx_t_10 = __Pyx_PyInt_From_ScatterMode(SCATTER_REVERSE); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_SCATTER_REVERSE, __pyx_t_10) < 0) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Const.pyx":93 * SCATTER_FORWARD = PETSC_SCATTER_FORWARD * SCATTER_REVERSE = PETSC_SCATTER_REVERSE * SCATTER_FORWARD_LOCAL = PETSC_SCATTER_FORWARD_LOCAL # <<<<<<<<<<<<<< * SCATTER_REVERSE_LOCAL = PETSC_SCATTER_REVERSE_LOCAL * # aliases */ __pyx_t_10 = __Pyx_PyInt_From_ScatterMode(SCATTER_FORWARD_LOCAL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_SCATTER_FORWARD_LOCAL, __pyx_t_10) < 0) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Const.pyx":94 * SCATTER_REVERSE = PETSC_SCATTER_REVERSE * SCATTER_FORWARD_LOCAL = PETSC_SCATTER_FORWARD_LOCAL * SCATTER_REVERSE_LOCAL = PETSC_SCATTER_REVERSE_LOCAL # <<<<<<<<<<<<<< * # aliases * FORWARD = SCATTER_FORWARD */ __pyx_t_10 = __Pyx_PyInt_From_ScatterMode(SCATTER_REVERSE_LOCAL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_SCATTER_REVERSE_LOCAL, __pyx_t_10) < 0) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Const.pyx":96 * SCATTER_REVERSE_LOCAL = PETSC_SCATTER_REVERSE_LOCAL * # aliases * FORWARD = SCATTER_FORWARD # <<<<<<<<<<<<<< * REVERSE = SCATTER_REVERSE * FORWARD_LOCAL = SCATTER_FORWARD_LOCAL */ __pyx_t_10 = PyObject_GetItem(__pyx_t_5, __pyx_n_s_SCATTER_FORWARD); if (unlikely(!__pyx_t_10)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_SCATTER_FORWARD); } if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_FORWARD, __pyx_t_10) < 0) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Const.pyx":97 * # aliases * FORWARD = SCATTER_FORWARD * REVERSE = SCATTER_REVERSE # <<<<<<<<<<<<<< * FORWARD_LOCAL = SCATTER_FORWARD_LOCAL * REVERSE_LOCAL = SCATTER_REVERSE_LOCAL */ __pyx_t_10 = PyObject_GetItem(__pyx_t_5, __pyx_n_s_SCATTER_REVERSE); if (unlikely(!__pyx_t_10)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_SCATTER_REVERSE); } if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_REVERSE, __pyx_t_10) < 0) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Const.pyx":98 * FORWARD = SCATTER_FORWARD * REVERSE = SCATTER_REVERSE * FORWARD_LOCAL = SCATTER_FORWARD_LOCAL # <<<<<<<<<<<<<< * REVERSE_LOCAL = SCATTER_REVERSE_LOCAL * */ __pyx_t_10 = PyObject_GetItem(__pyx_t_5, __pyx_n_s_SCATTER_FORWARD_LOCAL); if (unlikely(!__pyx_t_10)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_SCATTER_FORWARD_LOCAL); } if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_FORWARD_LOCAL, __pyx_t_10) < 0) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Const.pyx":99 * REVERSE = SCATTER_REVERSE * FORWARD_LOCAL = SCATTER_FORWARD_LOCAL * REVERSE_LOCAL = SCATTER_REVERSE_LOCAL # <<<<<<<<<<<<<< * * # ------------------------------------------------------------------------------ */ __pyx_t_10 = PyObject_GetItem(__pyx_t_5, __pyx_n_s_SCATTER_REVERSE_LOCAL); if (unlikely(!__pyx_t_10)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_SCATTER_REVERSE_LOCAL); } if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_REVERSE_LOCAL, __pyx_t_10) < 0) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Const.pyx":74 * # ------------------------------------------------------------------------------ * * class ScatterMode(object): # <<<<<<<<<<<<<< * """Scatter mode. * */ __pyx_t_10 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_n_s_ScatterMode, __pyx_t_7, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (PyDict_SetItem(__pyx_d, __pyx_n_s_ScatterMode, __pyx_t_10) < 0) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "petsc4py/PETSc/Const.pyx":103 * # ------------------------------------------------------------------------------ * * class NormType(object): # <<<<<<<<<<<<<< * """Norm type. * */ __pyx_t_7 = __Pyx_PEP560_update_bases(__pyx_tuple__83); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_7, __pyx_n_s_NormType, __pyx_n_s_NormType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, __pyx_kp_s_Norm_type_Commonly_used_norm_typ); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_7 != __pyx_tuple__83) { if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_tuple__83) < 0))) __PYX_ERR(0, 103, __pyx_L1_error) } /* "petsc4py/PETSc/Const.pyx":123 * """ * # native * NORM_1 = PETSC_NORM_1 # <<<<<<<<<<<<<< * NORM_2 = PETSC_NORM_2 * NORM_1_AND_2 = PETSC_NORM_1_AND_2 */ __pyx_t_10 = __Pyx_PyInt_From_NormType(NORM_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_NORM_1, __pyx_t_10) < 0) __PYX_ERR(0, 123, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Const.pyx":124 * # native * NORM_1 = PETSC_NORM_1 * NORM_2 = PETSC_NORM_2 # <<<<<<<<<<<<<< * NORM_1_AND_2 = PETSC_NORM_1_AND_2 * NORM_FROBENIUS = PETSC_NORM_FROBENIUS */ __pyx_t_10 = __Pyx_PyInt_From_NormType(NORM_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_NORM_2, __pyx_t_10) < 0) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Const.pyx":125 * NORM_1 = PETSC_NORM_1 * NORM_2 = PETSC_NORM_2 * NORM_1_AND_2 = PETSC_NORM_1_AND_2 # <<<<<<<<<<<<<< * NORM_FROBENIUS = PETSC_NORM_FROBENIUS * NORM_INFINITY = PETSC_NORM_INFINITY */ __pyx_t_10 = __Pyx_PyInt_From_NormType(NORM_1_AND_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_NORM_1_AND_2, __pyx_t_10) < 0) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Const.pyx":126 * NORM_2 = PETSC_NORM_2 * NORM_1_AND_2 = PETSC_NORM_1_AND_2 * NORM_FROBENIUS = PETSC_NORM_FROBENIUS # <<<<<<<<<<<<<< * NORM_INFINITY = PETSC_NORM_INFINITY * NORM_MAX = PETSC_NORM_MAX */ __pyx_t_10 = __Pyx_PyInt_From_NormType(NORM_FROBENIUS); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_NORM_FROBENIUS, __pyx_t_10) < 0) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Const.pyx":127 * NORM_1_AND_2 = PETSC_NORM_1_AND_2 * NORM_FROBENIUS = PETSC_NORM_FROBENIUS * NORM_INFINITY = PETSC_NORM_INFINITY # <<<<<<<<<<<<<< * NORM_MAX = PETSC_NORM_MAX * # aliases */ __pyx_t_10 = __Pyx_PyInt_From_NormType(NORM_INFINITY); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_NORM_INFINITY, __pyx_t_10) < 0) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Const.pyx":128 * NORM_FROBENIUS = PETSC_NORM_FROBENIUS * NORM_INFINITY = PETSC_NORM_INFINITY * NORM_MAX = PETSC_NORM_MAX # <<<<<<<<<<<<<< * # aliases * N1 = NORM_1 */ __pyx_t_10 = __Pyx_PyInt_From_NormType(NORM_MAX); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_NORM_MAX, __pyx_t_10) < 0) __PYX_ERR(0, 128, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Const.pyx":130 * NORM_MAX = PETSC_NORM_MAX * # aliases * N1 = NORM_1 # <<<<<<<<<<<<<< * N2 = NORM_2 * N12 = NORM_1_AND_2 */ __pyx_t_10 = PyObject_GetItem(__pyx_t_5, __pyx_n_s_NORM_1); if (unlikely(!__pyx_t_10)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_NORM_1); } if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_N1, __pyx_t_10) < 0) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Const.pyx":131 * # aliases * N1 = NORM_1 * N2 = NORM_2 # <<<<<<<<<<<<<< * N12 = NORM_1_AND_2 * MAX = NORM_MAX */ __pyx_t_10 = PyObject_GetItem(__pyx_t_5, __pyx_n_s_NORM_2); if (unlikely(!__pyx_t_10)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_NORM_2); } if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_N2, __pyx_t_10) < 0) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Const.pyx":132 * N1 = NORM_1 * N2 = NORM_2 * N12 = NORM_1_AND_2 # <<<<<<<<<<<<<< * MAX = NORM_MAX * FROBENIUS = NORM_FROBENIUS */ __pyx_t_10 = PyObject_GetItem(__pyx_t_5, __pyx_n_s_NORM_1_AND_2); if (unlikely(!__pyx_t_10)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_NORM_1_AND_2); } if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_N12, __pyx_t_10) < 0) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Const.pyx":133 * N2 = NORM_2 * N12 = NORM_1_AND_2 * MAX = NORM_MAX # <<<<<<<<<<<<<< * FROBENIUS = NORM_FROBENIUS * INFINITY = NORM_INFINITY */ __pyx_t_10 = PyObject_GetItem(__pyx_t_5, __pyx_n_s_NORM_MAX); if (unlikely(!__pyx_t_10)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_NORM_MAX); } if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_MAX, __pyx_t_10) < 0) __PYX_ERR(0, 133, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Const.pyx":134 * N12 = NORM_1_AND_2 * MAX = NORM_MAX * FROBENIUS = NORM_FROBENIUS # <<<<<<<<<<<<<< * INFINITY = NORM_INFINITY * # extra aliases */ __pyx_t_10 = PyObject_GetItem(__pyx_t_5, __pyx_n_s_NORM_FROBENIUS); if (unlikely(!__pyx_t_10)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_NORM_FROBENIUS); } if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_FROBENIUS, __pyx_t_10) < 0) __PYX_ERR(0, 134, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Const.pyx":135 * MAX = NORM_MAX * FROBENIUS = NORM_FROBENIUS * INFINITY = NORM_INFINITY # <<<<<<<<<<<<<< * # extra aliases * FRB = FROBENIUS */ __pyx_t_10 = PyObject_GetItem(__pyx_t_5, __pyx_n_s_NORM_INFINITY); if (unlikely(!__pyx_t_10)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_NORM_INFINITY); } if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_INFINITY, __pyx_t_10) < 0) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Const.pyx":137 * INFINITY = NORM_INFINITY * # extra aliases * FRB = FROBENIUS # <<<<<<<<<<<<<< * INF = INFINITY * */ __pyx_t_10 = PyObject_GetItem(__pyx_t_5, __pyx_n_s_FROBENIUS); if (unlikely(!__pyx_t_10)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_FROBENIUS); } if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_FRB, __pyx_t_10) < 0) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Const.pyx":138 * # extra aliases * FRB = FROBENIUS * INF = INFINITY # <<<<<<<<<<<<<< * * # ------------------------------------------------------------------------------ */ __pyx_t_10 = PyObject_GetItem(__pyx_t_5, __pyx_n_s_INFINITY); if (unlikely(!__pyx_t_10)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_INFINITY); } if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_INF, __pyx_t_10) < 0) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Const.pyx":103 * # ------------------------------------------------------------------------------ * * class NormType(object): # <<<<<<<<<<<<<< * """Norm type. * */ __pyx_t_10 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_n_s_NormType, __pyx_t_7, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (PyDict_SetItem(__pyx_d, __pyx_n_s_NormType, __pyx_t_10) < 0) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "petsc4py/PETSc/Error.pyx":3 * # -------------------------------------------------------------------- * * class Error(RuntimeError): # <<<<<<<<<<<<<< * """PETSc Error. * */ __pyx_t_7 = __Pyx_PEP560_update_bases(__pyx_tuple__85); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_7, __pyx_n_s_Error, __pyx_n_s_Error, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, __pyx_kp_s_PETSc_Error_Attributes_ierr_int); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_7 != __pyx_tuple__85) { if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_tuple__85) < 0))) __PYX_ERR(1, 3, __pyx_L1_error) } /* "petsc4py/PETSc/Error.pyx":13 * """ * * _traceback_ = [] # <<<<<<<<<<<<<< * * def __init__(self, int ierr=0): */ __pyx_t_10 = PyList_New(0); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_traceback, __pyx_t_10) < 0) __PYX_ERR(1, 13, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Error.pyx":15 * _traceback_ = [] * * def __init__(self, int ierr=0): # <<<<<<<<<<<<<< * self.ierr = ierr * RuntimeError.__init__(self, self.ierr) */ __pyx_t_10 = __Pyx_PyInt_From_int(((int)0)); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_10); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10)) __PYX_ERR(1, 15, __pyx_L1_error); __pyx_t_10 = 0; __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_5Error_1__init__, 0, __pyx_n_s_Error___init, NULL, __pyx_n_s_petsc4py_PETSc, __pyx_d, ((PyObject *)__pyx_codeobj__87)); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_t_11); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_init, __pyx_t_10) < 0) __PYX_ERR(1, 15, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Error.pyx":19 * RuntimeError.__init__(self, self.ierr) * * def __bool__(self): # <<<<<<<<<<<<<< * cdef int ierr = self.ierr * return ierr != 0 */ __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_5Error_3__bool__, 0, __pyx_n_s_Error___bool, NULL, __pyx_n_s_petsc4py_PETSc, __pyx_d, ((PyObject *)__pyx_codeobj__88)); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_bool, __pyx_t_10) < 0) __PYX_ERR(1, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Error.pyx":23 * return ierr != 0 * * def __repr__(self): # <<<<<<<<<<<<<< * return 'PETSc.Error(%d)' % self.ierr * */ __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_5Error_5__repr__, 0, __pyx_n_s_Error___repr, NULL, __pyx_n_s_petsc4py_PETSc, __pyx_d, ((PyObject *)__pyx_codeobj__90)); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_repr, __pyx_t_10) < 0) __PYX_ERR(1, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Error.pyx":26 * return 'PETSc.Error(%d)' % self.ierr * * def __str__(self): # <<<<<<<<<<<<<< * cdef int csize=1, crank=0 * if not (PetscFinalizeCalled): */ __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_5Error_7__str__, 0, __pyx_n_s_Error___str, NULL, __pyx_n_s_petsc4py_PETSc, __pyx_d, ((PyObject *)__pyx_codeobj__92)); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_str, __pyx_t_10) < 0) __PYX_ERR(1, 26, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Error.pyx":3 * # -------------------------------------------------------------------- * * class Error(RuntimeError): # <<<<<<<<<<<<<< * """PETSc Error. * */ __pyx_t_10 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_n_s_Error, __pyx_t_7, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Error, __pyx_t_10) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "petsc4py/PETSc/Sys.pyx":7 * """System utilities.""" * * @classmethod # <<<<<<<<<<<<<< * def getVersion( * cls, */ __Pyx_GetNameInClass(__pyx_t_7, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_n_s_getVersion); if (unlikely(!__pyx_t_7)) __PYX_ERR(32, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_4 = __Pyx_Method_ClassMethod(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_n_s_getVersion, __pyx_t_4) < 0) __PYX_ERR(32, 7, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Sys); /* "petsc4py/PETSc/Sys.pyx":63 * return tuple(out) * * @classmethod # <<<<<<<<<<<<<< * def getVersionInfo(cls) -> dict[str, bool | int | str]: * """Return PETSc version information. */ __Pyx_GetNameInClass(__pyx_t_4, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_n_s_getVersionInfo); if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = __Pyx_Method_ClassMethod(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(32, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_n_s_getVersionInfo, __pyx_t_7) < 0) __PYX_ERR(32, 63, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Sys); /* "petsc4py/PETSc/Sys.pyx":89 * # --- xxx --- * * @classmethod # <<<<<<<<<<<<<< * def isInitialized(cls) -> bool: * """Return whether PETSc has been initialized. */ __Pyx_GetNameInClass(__pyx_t_7, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_n_s_isInitialized); if (unlikely(!__pyx_t_7)) __PYX_ERR(32, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_4 = __Pyx_Method_ClassMethod(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_n_s_isInitialized, __pyx_t_4) < 0) __PYX_ERR(32, 89, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Sys); /* "petsc4py/PETSc/Sys.pyx":102 * return toBool(PetscInitializeCalled) * * @classmethod # <<<<<<<<<<<<<< * def isFinalized(cls) -> bool: * """Return whether PETSc has been finalized. */ __Pyx_GetNameInClass(__pyx_t_4, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_n_s_isFinalized); if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = __Pyx_Method_ClassMethod(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(32, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_n_s_isFinalized, __pyx_t_7) < 0) __PYX_ERR(32, 102, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Sys); /* "petsc4py/PETSc/Sys.pyx":117 * # --- xxx --- * * @classmethod # <<<<<<<<<<<<<< * def getDefaultComm(cls) -> Comm: * """Get the default MPI communicator used to create PETSc objects. */ __Pyx_GetNameInClass(__pyx_t_7, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_n_s_getDefaultComm); if (unlikely(!__pyx_t_7)) __PYX_ERR(32, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_4 = __Pyx_Method_ClassMethod(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_n_s_getDefaultComm, __pyx_t_4) < 0) __PYX_ERR(32, 117, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Sys); /* "petsc4py/PETSc/Sys.pyx":132 * return comm * * @classmethod # <<<<<<<<<<<<<< * def setDefaultComm(cls, comm: Comm | None) -> None: * """Set the default MPI communicator used to create PETSc objects. */ __Pyx_GetNameInClass(__pyx_t_4, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_n_s_setDefaultComm); if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = __Pyx_Method_ClassMethod(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(32, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_n_s_setDefaultComm, __pyx_t_7) < 0) __PYX_ERR(32, 132, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Sys); /* "petsc4py/PETSc/Sys.pyx":156 * # --- xxx --- * * @classmethod # <<<<<<<<<<<<<< * def Print( * cls, */ __Pyx_GetNameInClass(__pyx_t_7, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_n_s_Print); if (unlikely(!__pyx_t_7)) __PYX_ERR(32, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_4 = __Pyx_Method_ClassMethod(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_n_s_Print, __pyx_t_4) < 0) __PYX_ERR(32, 156, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Sys); /* "petsc4py/PETSc/Sys.pyx":199 * CHKERR( PetscPrintf(ccomm, '%s', m) ) * * @classmethod # <<<<<<<<<<<<<< * def syncPrint( * cls, */ __Pyx_GetNameInClass(__pyx_t_4, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_n_s_syncPrint); if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = __Pyx_Method_ClassMethod(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(32, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_n_s_syncPrint, __pyx_t_7) < 0) __PYX_ERR(32, 199, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Sys); /* "petsc4py/PETSc/Sys.pyx":243 * if flush: CHKERR( PetscSynchronizedFlush(ccomm, PETSC_STDOUT) ) * * @classmethod # <<<<<<<<<<<<<< * def syncFlush(cls, comm: Comm | None = None) -> None: * """Flush output from previous `syncPrint` calls. */ __Pyx_GetNameInClass(__pyx_t_7, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_n_s_syncFlush); if (unlikely(!__pyx_t_7)) __PYX_ERR(32, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_4 = __Pyx_Method_ClassMethod(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_n_s_syncFlush, __pyx_t_4) < 0) __PYX_ERR(32, 243, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Sys); /* "petsc4py/PETSc/Sys.pyx":264 * # --- xxx --- * * @classmethod # <<<<<<<<<<<<<< * def splitOwnership( * cls, */ __Pyx_GetNameInClass(__pyx_t_4, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_n_s_splitOwnership); if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 264, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = __Pyx_Method_ClassMethod(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(32, 264, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_n_s_splitOwnership, __pyx_t_7) < 0) __PYX_ERR(32, 264, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Sys); /* "petsc4py/PETSc/Sys.pyx":314 * return (toInt(n), toInt(N)) * * @classmethod # <<<<<<<<<<<<<< * def sleep(cls, seconds: float = 1.0) -> None: * """Sleep some number of seconds. */ __Pyx_GetNameInClass(__pyx_t_7, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_n_s_sleep); if (unlikely(!__pyx_t_7)) __PYX_ERR(32, 314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_4 = __Pyx_Method_ClassMethod(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_n_s_sleep, __pyx_t_4) < 0) __PYX_ERR(32, 314, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Sys); /* "petsc4py/PETSc/Sys.pyx":335 * # --- xxx --- * * @classmethod # <<<<<<<<<<<<<< * def pushErrorHandler(cls, errhandler: str) -> None: * """Set the current error handler. */ __Pyx_GetNameInClass(__pyx_t_4, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_n_s_pushErrorHandler); if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = __Pyx_Method_ClassMethod(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(32, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_n_s_pushErrorHandler, __pyx_t_7) < 0) __PYX_ERR(32, 335, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Sys); /* "petsc4py/PETSc/Sys.pyx":371 * * * @classmethod # <<<<<<<<<<<<<< * def popErrorHandler(cls) -> None: * """Remove the current error handler. */ __Pyx_GetNameInClass(__pyx_t_7, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_n_s_popErrorHandler); if (unlikely(!__pyx_t_7)) __PYX_ERR(32, 371, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_4 = __Pyx_Method_ClassMethod(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 371, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_n_s_popErrorHandler, __pyx_t_4) < 0) __PYX_ERR(32, 371, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Sys); /* "petsc4py/PETSc/Sys.pyx":384 * CHKERR( PetscPopErrorHandler() ) * * @classmethod # <<<<<<<<<<<<<< * def popSignalHandler(cls) -> None: * """Remove the current signal handler. */ __Pyx_GetNameInClass(__pyx_t_4, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_n_s_popSignalHandler); if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 384, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = __Pyx_Method_ClassMethod(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(32, 384, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_n_s_popSignalHandler, __pyx_t_7) < 0) __PYX_ERR(32, 384, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Sys); /* "petsc4py/PETSc/Sys.pyx":397 * CHKERR( PetscPopSignalHandler() ) * * @classmethod # <<<<<<<<<<<<<< * def infoAllow( * cls, */ __Pyx_GetNameInClass(__pyx_t_7, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_n_s_infoAllow); if (unlikely(!__pyx_t_7)) __PYX_ERR(32, 397, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_4 = __Pyx_Method_ClassMethod(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 397, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_n_s_infoAllow, __pyx_t_4) < 0) __PYX_ERR(32, 397, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Sys); /* "petsc4py/PETSc/Sys.pyx":432 * CHKERR( PetscInfoSetFile(cfilename, cmode) ) * * @classmethod # <<<<<<<<<<<<<< * def registerCitation(cls, citation: str) -> None: * """Register BibTeX citation. */ __Pyx_GetNameInClass(__pyx_t_4, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_n_s_registerCitation); if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 432, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = __Pyx_Method_ClassMethod(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(32, 432, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_n_s_registerCitation, __pyx_t_7) < 0) __PYX_ERR(32, 432, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Sys); /* "petsc4py/PETSc/Sys.pyx":455 * set_citation(citation, toBool(flag)) * * @classmethod # <<<<<<<<<<<<<< * def hasExternalPackage(cls, package: str) -> bool: * """Return whether PETSc has support for external package. */ __Pyx_GetNameInClass(__pyx_t_7, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_n_s_hasExternalPackage); if (unlikely(!__pyx_t_7)) __PYX_ERR(32, 455, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_4 = __Pyx_Method_ClassMethod(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 455, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_n_s_hasExternalPackage, __pyx_t_4) < 0) __PYX_ERR(32, 455, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Sys); /* "petsc4py/PETSc/Sys.pyx":478 * * * cdef dict citations_registry = { } # <<<<<<<<<<<<<< * * cdef PetscBool get_citation(object citation): */ __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_v_8petsc4py_5PETSc_citations_registry); __Pyx_DECREF_SET(__pyx_v_8petsc4py_5PETSc_citations_registry, ((PyObject*)__pyx_t_4)); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/Log.pyx":3 * # -------------------------------------------------------------------- * * cdef object functools = None # <<<<<<<<<<<<<< * import functools * */ __Pyx_INCREF(Py_None); __Pyx_XGOTREF(__pyx_v_8petsc4py_5PETSc_functools); __Pyx_DECREF_SET(__pyx_v_8petsc4py_5PETSc_functools, Py_None); __Pyx_GIVEREF(Py_None); /* "petsc4py/PETSc/Log.pyx":4 * * cdef object functools = None * import functools # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_t_4 = __Pyx_ImportDottedModule(__pyx_n_s_functools, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(33, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_v_8petsc4py_5PETSc_functools); __Pyx_DECREF_SET(__pyx_v_8petsc4py_5PETSc_functools, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/Log.pyx":11 * """Logging support.""" * * @classmethod # <<<<<<<<<<<<<< * def Stage(cls, name): * if not name: raise ValueError("empty name") */ __Pyx_GetNameInClass(__pyx_t_4, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Log, __pyx_n_s_Stage); if (unlikely(!__pyx_t_4)) __PYX_ERR(33, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = __Pyx_Method_ClassMethod(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(33, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Log, __pyx_n_s_Stage, __pyx_t_7) < 0) __PYX_ERR(33, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Log); /* "petsc4py/PETSc/Log.pyx":25 * return stage * * @classmethod # <<<<<<<<<<<<<< * def Class(cls, name): * if not name: raise ValueError("empty name") */ __Pyx_GetNameInClass(__pyx_t_7, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Log, __pyx_n_s_Class); if (unlikely(!__pyx_t_7)) __PYX_ERR(33, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_4 = __Pyx_Method_ClassMethod(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(33, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Log, __pyx_n_s_Class, __pyx_t_4) < 0) __PYX_ERR(33, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Log); /* "petsc4py/PETSc/Log.pyx":39 * return klass * * @classmethod # <<<<<<<<<<<<<< * def Event(cls, name, klass=None): * if not name: raise ValueError("empty name") */ __Pyx_GetNameInClass(__pyx_t_4, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Log, __pyx_n_s_Event); if (unlikely(!__pyx_t_4)) __PYX_ERR(33, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = __Pyx_Method_ClassMethod(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(33, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Log, __pyx_n_s_Event, __pyx_t_7) < 0) __PYX_ERR(33, 39, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Log); /* "petsc4py/PETSc/Log.pyx":55 * return event * * @classmethod # <<<<<<<<<<<<<< * def begin(cls): * """Turn on logging of objects and events. */ __Pyx_GetNameInClass(__pyx_t_7, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Log, __pyx_n_s_begin); if (unlikely(!__pyx_t_7)) __PYX_ERR(33, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_4 = __Pyx_Method_ClassMethod(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(33, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Log, __pyx_n_s_begin, __pyx_t_4) < 0) __PYX_ERR(33, 55, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Log); /* "petsc4py/PETSc/Log.pyx":68 * CHKERR( PetscLogDefaultBegin() ) * * @classmethod # <<<<<<<<<<<<<< * def view(cls, Viewer viewer=None) -> None: * """Print the log. */ __Pyx_GetNameInClass(__pyx_t_4, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Log, __pyx_n_s_view); if (unlikely(!__pyx_t_4)) __PYX_ERR(33, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = __Pyx_Method_ClassMethod(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(33, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Log, __pyx_n_s_view, __pyx_t_7) < 0) __PYX_ERR(33, 68, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Log); /* "petsc4py/PETSc/Log.pyx":89 * CHKERR( PetscLogView(vwr) ) * * @classmethod # <<<<<<<<<<<<<< * def logFlops(cls, flops: float) -> None: * """Add floating point operations to the current event. */ __Pyx_GetNameInClass(__pyx_t_7, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Log, __pyx_n_s_logFlops); if (unlikely(!__pyx_t_7)) __PYX_ERR(33, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_4 = __Pyx_Method_ClassMethod(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(33, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Log, __pyx_n_s_logFlops, __pyx_t_4) < 0) __PYX_ERR(33, 89, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Log); /* "petsc4py/PETSc/Log.pyx":108 * CHKERR( PetscLogFlops(cflops) ) * * @classmethod # <<<<<<<<<<<<<< * def addFlops(cls, flops: float) -> None: * """Add floating point operations to the current event. */ __Pyx_GetNameInClass(__pyx_t_4, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Log, __pyx_n_s_addFlops); if (unlikely(!__pyx_t_4)) __PYX_ERR(33, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = __Pyx_Method_ClassMethod(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(33, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Log, __pyx_n_s_addFlops, __pyx_t_7) < 0) __PYX_ERR(33, 108, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Log); /* "petsc4py/PETSc/Log.pyx":131 * CHKERR( PetscLogFlops(cflops) ) * * @classmethod # <<<<<<<<<<<<<< * def getFlops(cls) -> float: * """Return the number of flops used on this processor since the program began. */ __Pyx_GetNameInClass(__pyx_t_7, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Log, __pyx_n_s_getFlops); if (unlikely(!__pyx_t_7)) __PYX_ERR(33, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_4 = __Pyx_Method_ClassMethod(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(33, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Log, __pyx_n_s_getFlops, __pyx_t_4) < 0) __PYX_ERR(33, 131, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Log); /* "petsc4py/PETSc/Log.pyx":151 * return cflops * * @classmethod # <<<<<<<<<<<<<< * def getTime(cls) -> float: * """Return the current time of day in seconds. */ __Pyx_GetNameInClass(__pyx_t_4, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Log, __pyx_n_s_getTime); if (unlikely(!__pyx_t_4)) __PYX_ERR(33, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = __Pyx_Method_ClassMethod(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(33, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Log, __pyx_n_s_getTime, __pyx_t_7) < 0) __PYX_ERR(33, 151, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Log); /* "petsc4py/PETSc/Log.pyx":171 * return wctime * * @classmethod # <<<<<<<<<<<<<< * def getCPUTime(cls) -> float: * """Return the CPU time.""" */ __Pyx_GetNameInClass(__pyx_t_7, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Log, __pyx_n_s_getCPUTime); if (unlikely(!__pyx_t_7)) __PYX_ERR(33, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_4 = __Pyx_Method_ClassMethod(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(33, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Log, __pyx_n_s_getCPUTime, __pyx_t_4) < 0) __PYX_ERR(33, 171, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Log); /* "petsc4py/PETSc/Log.pyx":178 * return cputime * * @classmethod # <<<<<<<<<<<<<< * def EventDecorator(cls, name=None, klass=None): * """Decorate a function with a `PETSc` event.""" */ __Pyx_GetNameInClass(__pyx_t_4, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Log, __pyx_n_s_EventDecorator); if (unlikely(!__pyx_t_4)) __PYX_ERR(33, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = __Pyx_Method_ClassMethod(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(33, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Log, __pyx_n_s_EventDecorator, __pyx_t_7) < 0) __PYX_ERR(33, 178, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Log); /* "petsc4py/PETSc/Log.pyx":193 * return decorator * * @classmethod # <<<<<<<<<<<<<< * def isActive(cls) -> bool: * """Return whether logging is currently in progress. */ __Pyx_GetNameInClass(__pyx_t_7, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Log, __pyx_n_s_isActive); if (unlikely(!__pyx_t_7)) __PYX_ERR(33, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_4 = __Pyx_Method_ClassMethod(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(33, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Log, __pyx_n_s_isActive, __pyx_t_4) < 0) __PYX_ERR(33, 193, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Log); /* "petsc4py/PETSc/Log.pyx":371 * * * cdef dict stage_registry = { } # <<<<<<<<<<<<<< * * cdef LogStage get_LogStage(object name): */ __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(33, 371, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_v_8petsc4py_5PETSc_stage_registry); __Pyx_DECREF_SET(__pyx_v_8petsc4py_5PETSc_stage_registry, ((PyObject*)__pyx_t_4)); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/Log.pyx":433 * * * cdef dict class_registry = { } # <<<<<<<<<<<<<< * * cdef LogClass get_LogClass(object name): */ __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(33, 433, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_v_8petsc4py_5PETSc_class_registry); __Pyx_DECREF_SET(__pyx_v_8petsc4py_5PETSc_class_registry, ((PyObject*)__pyx_t_4)); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/Log.pyx":629 * return info * * cdef dict event_registry = { } # <<<<<<<<<<<<<< * * cdef LogEvent get_LogEvent(object name): */ __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(33, 629, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_v_8petsc4py_5PETSc_event_registry); __Pyx_DECREF_SET(__pyx_v_8petsc4py_5PETSc_event_registry, ((PyObject*)__pyx_t_4)); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/Comm.pyx":170 * # --- mpi4py compatibility API --- * * Free = destroy # <<<<<<<<<<<<<< * Clone = duplicate * Dup = duplicate */ __Pyx_GetNameInClass(__pyx_t_4, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Comm, __pyx_n_s_destroy); if (unlikely(!__pyx_t_4)) __PYX_ERR(34, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Comm, __pyx_n_s_Free, __pyx_t_4) < 0) __PYX_ERR(34, 170, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Comm); /* "petsc4py/PETSc/Comm.pyx":171 * * Free = destroy * Clone = duplicate # <<<<<<<<<<<<<< * Dup = duplicate * Get_size = getSize */ __Pyx_GetNameInClass(__pyx_t_4, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Comm, __pyx_n_s_duplicate); if (unlikely(!__pyx_t_4)) __PYX_ERR(34, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Comm, __pyx_n_s_Clone, __pyx_t_4) < 0) __PYX_ERR(34, 171, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Comm); /* "petsc4py/PETSc/Comm.pyx":172 * Free = destroy * Clone = duplicate * Dup = duplicate # <<<<<<<<<<<<<< * Get_size = getSize * Get_rank = getRank */ __Pyx_GetNameInClass(__pyx_t_4, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Comm, __pyx_n_s_duplicate); if (unlikely(!__pyx_t_4)) __PYX_ERR(34, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Comm, __pyx_n_s_Dup, __pyx_t_4) < 0) __PYX_ERR(34, 172, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Comm); /* "petsc4py/PETSc/Comm.pyx":173 * Clone = duplicate * Dup = duplicate * Get_size = getSize # <<<<<<<<<<<<<< * Get_rank = getRank * Barrier = barrier */ __Pyx_GetNameInClass(__pyx_t_4, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Comm, __pyx_n_s_getSize); if (unlikely(!__pyx_t_4)) __PYX_ERR(34, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Comm, __pyx_n_s_Get_size, __pyx_t_4) < 0) __PYX_ERR(34, 173, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Comm); /* "petsc4py/PETSc/Comm.pyx":174 * Dup = duplicate * Get_size = getSize * Get_rank = getRank # <<<<<<<<<<<<<< * Barrier = barrier * */ __Pyx_GetNameInClass(__pyx_t_4, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Comm, __pyx_n_s_getRank); if (unlikely(!__pyx_t_4)) __PYX_ERR(34, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Comm, __pyx_n_s_Get_rank, __pyx_t_4) < 0) __PYX_ERR(34, 174, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Comm); /* "petsc4py/PETSc/Comm.pyx":175 * Get_size = getSize * Get_rank = getRank * Barrier = barrier # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_GetNameInClass(__pyx_t_4, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Comm, __pyx_n_s_barrier); if (unlikely(!__pyx_t_4)) __PYX_ERR(34, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Comm, __pyx_n_s_Barrier, __pyx_t_4) < 0) __PYX_ERR(34, 175, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Comm); /* "petsc4py/PETSc/Comm.pyx":179 * # -------------------------------------------------------------------- * * cdef Comm __COMM_NULL__ = Comm() # <<<<<<<<<<<<<< * cdef Comm __COMM_SELF__ = Comm() * cdef Comm __COMM_WORLD__ = Comm() */ __pyx_t_4 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Comm)); if (unlikely(!__pyx_t_4)) __PYX_ERR(34, 179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XGOTREF((PyObject *)__pyx_v_8petsc4py_5PETSc___COMM_NULL__); __Pyx_DECREF_SET(__pyx_v_8petsc4py_5PETSc___COMM_NULL__, ((struct PyPetscCommObject *)__pyx_t_4)); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/Comm.pyx":180 * * cdef Comm __COMM_NULL__ = Comm() * cdef Comm __COMM_SELF__ = Comm() # <<<<<<<<<<<<<< * cdef Comm __COMM_WORLD__ = Comm() * */ __pyx_t_4 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Comm)); if (unlikely(!__pyx_t_4)) __PYX_ERR(34, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XGOTREF((PyObject *)__pyx_v_8petsc4py_5PETSc___COMM_SELF__); __Pyx_DECREF_SET(__pyx_v_8petsc4py_5PETSc___COMM_SELF__, ((struct PyPetscCommObject *)__pyx_t_4)); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/Comm.pyx":181 * cdef Comm __COMM_NULL__ = Comm() * cdef Comm __COMM_SELF__ = Comm() * cdef Comm __COMM_WORLD__ = Comm() # <<<<<<<<<<<<<< * * COMM_NULL = __COMM_NULL__ */ __pyx_t_4 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Comm)); if (unlikely(!__pyx_t_4)) __PYX_ERR(34, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XGOTREF((PyObject *)__pyx_v_8petsc4py_5PETSc___COMM_WORLD__); __Pyx_DECREF_SET(__pyx_v_8petsc4py_5PETSc___COMM_WORLD__, ((struct PyPetscCommObject *)__pyx_t_4)); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/Comm.pyx":183 * cdef Comm __COMM_WORLD__ = Comm() * * COMM_NULL = __COMM_NULL__ # <<<<<<<<<<<<<< * COMM_SELF = __COMM_SELF__ * COMM_WORLD = __COMM_WORLD__ */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_COMM_NULL, ((PyObject *)__pyx_v_8petsc4py_5PETSc___COMM_NULL__)) < 0) __PYX_ERR(34, 183, __pyx_L1_error) /* "petsc4py/PETSc/Comm.pyx":184 * * COMM_NULL = __COMM_NULL__ * COMM_SELF = __COMM_SELF__ # <<<<<<<<<<<<<< * COMM_WORLD = __COMM_WORLD__ * */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_COMM_SELF, ((PyObject *)__pyx_v_8petsc4py_5PETSc___COMM_SELF__)) < 0) __PYX_ERR(34, 184, __pyx_L1_error) /* "petsc4py/PETSc/Comm.pyx":185 * COMM_NULL = __COMM_NULL__ * COMM_SELF = __COMM_SELF__ * COMM_WORLD = __COMM_WORLD__ # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_COMM_WORLD, ((PyObject *)__pyx_v_8petsc4py_5PETSc___COMM_WORLD__)) < 0) __PYX_ERR(34, 185, __pyx_L1_error) /* "petsc4py/PETSc/Comm.pyx":189 * # -------------------------------------------------------------------- * * cdef MPI_Comm PETSC_COMM_DEFAULT = MPI_COMM_NULL # <<<<<<<<<<<<<< * * cdef MPI_Comm GetComm( */ __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT = MPI_COMM_NULL; /* "petsc4py/PETSc/cyclicgc.pxi":41 * t.tp_clear = tp_clear * * def garbage_cleanup(comm=None): # <<<<<<<<<<<<<< * """Clean up unused PETSc objects. * */ __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_8petsc4py_5PETSc_1garbage_cleanup, NULL, __pyx_n_s_petsc4py_PETSc); if (unlikely(!__pyx_t_4)) __PYX_ERR(36, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_garbage_cleanup, __pyx_t_4) < 0) __PYX_ERR(36, 41, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/cyclicgc.pxi":64 * CHKERR( PetscGarbageCleanup(ccomm) ) * * def garbage_view(comm=None): # <<<<<<<<<<<<<< * """Print summary of the garbage PETSc objects. * */ __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_8petsc4py_5PETSc_3garbage_view, NULL, __pyx_n_s_petsc4py_PETSc); if (unlikely(!__pyx_t_4)) __PYX_ERR(36, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_garbage_view, __pyx_t_4) < 0) __PYX_ERR(36, 64, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/Object.pyx":264 * include "cyclicgc.pxi" * * cdef dict type_registry = { 0 : None } # <<<<<<<<<<<<<< * __type_registry__ = type_registry * */ __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(35, 264, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_int_0, Py_None) < 0) __PYX_ERR(35, 264, __pyx_L1_error) __Pyx_XGOTREF(__pyx_v_8petsc4py_5PETSc_type_registry); __Pyx_DECREF_SET(__pyx_v_8petsc4py_5PETSc_type_registry, ((PyObject*)__pyx_t_4)); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/Object.pyx":265 * * cdef dict type_registry = { 0 : None } * __type_registry__ = type_registry # <<<<<<<<<<<<<< * * cdef int PyPetscType_Register(int classid, type cls) except -1: */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_type_registry, __pyx_v_8petsc4py_5PETSc_type_registry) < 0) __PYX_ERR(35, 265, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":3 * # -------------------------------------------------------------------- * * class ViewerType(object): # <<<<<<<<<<<<<< * """Viewer type.""" * SOCKET = S_(PETSCVIEWERSOCKET) */ __pyx_t_4 = __Pyx_PEP560_update_bases(__pyx_tuple__97); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = __Pyx_CalculateMetaclass(NULL, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(37, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_7, __pyx_t_4, __pyx_n_s_ViewerType, __pyx_n_s_ViewerType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, __pyx_kp_s_Viewer_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(37, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_4 != __pyx_tuple__97) { if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_tuple__97) < 0))) __PYX_ERR(37, 3, __pyx_L1_error) } /* "petsc4py/PETSc/Viewer.pyx":5 * class ViewerType(object): * """Viewer type.""" * SOCKET = S_(PETSCVIEWERSOCKET) # <<<<<<<<<<<<<< * ASCII = S_(PETSCVIEWERASCII) * BINARY = S_(PETSCVIEWERBINARY) */ __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_S_(PETSCVIEWERSOCKET); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_SOCKET, __pyx_t_10) < 0) __PYX_ERR(37, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Viewer.pyx":6 * """Viewer type.""" * SOCKET = S_(PETSCVIEWERSOCKET) * ASCII = S_(PETSCVIEWERASCII) # <<<<<<<<<<<<<< * BINARY = S_(PETSCVIEWERBINARY) * STRING = S_(PETSCVIEWERSTRING) */ __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_S_(PETSCVIEWERASCII); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_ASCII, __pyx_t_10) < 0) __PYX_ERR(37, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Viewer.pyx":7 * SOCKET = S_(PETSCVIEWERSOCKET) * ASCII = S_(PETSCVIEWERASCII) * BINARY = S_(PETSCVIEWERBINARY) # <<<<<<<<<<<<<< * STRING = S_(PETSCVIEWERSTRING) * DRAW = S_(PETSCVIEWERDRAW) */ __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_S_(PETSCVIEWERBINARY); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_BINARY, __pyx_t_10) < 0) __PYX_ERR(37, 7, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Viewer.pyx":8 * ASCII = S_(PETSCVIEWERASCII) * BINARY = S_(PETSCVIEWERBINARY) * STRING = S_(PETSCVIEWERSTRING) # <<<<<<<<<<<<<< * DRAW = S_(PETSCVIEWERDRAW) * VU = S_(PETSCVIEWERVU) */ __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_S_(PETSCVIEWERSTRING); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_STRING, __pyx_t_10) < 0) __PYX_ERR(37, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Viewer.pyx":9 * BINARY = S_(PETSCVIEWERBINARY) * STRING = S_(PETSCVIEWERSTRING) * DRAW = S_(PETSCVIEWERDRAW) # <<<<<<<<<<<<<< * VU = S_(PETSCVIEWERVU) * MATHEMATICA = S_(PETSCVIEWERMATHEMATICA) */ __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_S_(PETSCVIEWERDRAW); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_DRAW, __pyx_t_10) < 0) __PYX_ERR(37, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Viewer.pyx":10 * STRING = S_(PETSCVIEWERSTRING) * DRAW = S_(PETSCVIEWERDRAW) * VU = S_(PETSCVIEWERVU) # <<<<<<<<<<<<<< * MATHEMATICA = S_(PETSCVIEWERMATHEMATICA) * HDF5 = S_(PETSCVIEWERHDF5) */ __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_S_(PETSCVIEWERVU); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_VU, __pyx_t_10) < 0) __PYX_ERR(37, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Viewer.pyx":11 * DRAW = S_(PETSCVIEWERDRAW) * VU = S_(PETSCVIEWERVU) * MATHEMATICA = S_(PETSCVIEWERMATHEMATICA) # <<<<<<<<<<<<<< * HDF5 = S_(PETSCVIEWERHDF5) * VTK = S_(PETSCVIEWERVTK) */ __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_S_(PETSCVIEWERMATHEMATICA); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_MATHEMATICA, __pyx_t_10) < 0) __PYX_ERR(37, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Viewer.pyx":12 * VU = S_(PETSCVIEWERVU) * MATHEMATICA = S_(PETSCVIEWERMATHEMATICA) * HDF5 = S_(PETSCVIEWERHDF5) # <<<<<<<<<<<<<< * VTK = S_(PETSCVIEWERVTK) * MATLAB = S_(PETSCVIEWERMATLAB) */ __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_S_(PETSCVIEWERHDF5); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_HDF5, __pyx_t_10) < 0) __PYX_ERR(37, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Viewer.pyx":13 * MATHEMATICA = S_(PETSCVIEWERMATHEMATICA) * HDF5 = S_(PETSCVIEWERHDF5) * VTK = S_(PETSCVIEWERVTK) # <<<<<<<<<<<<<< * MATLAB = S_(PETSCVIEWERMATLAB) * SAWS = S_(PETSCVIEWERSAWS) */ __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_S_(PETSCVIEWERVTK); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_VTK, __pyx_t_10) < 0) __PYX_ERR(37, 13, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Viewer.pyx":14 * HDF5 = S_(PETSCVIEWERHDF5) * VTK = S_(PETSCVIEWERVTK) * MATLAB = S_(PETSCVIEWERMATLAB) # <<<<<<<<<<<<<< * SAWS = S_(PETSCVIEWERSAWS) * GLVIS = S_(PETSCVIEWERGLVIS) */ __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_S_(PETSCVIEWERMATLAB); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_MATLAB, __pyx_t_10) < 0) __PYX_ERR(37, 14, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Viewer.pyx":15 * VTK = S_(PETSCVIEWERVTK) * MATLAB = S_(PETSCVIEWERMATLAB) * SAWS = S_(PETSCVIEWERSAWS) # <<<<<<<<<<<<<< * GLVIS = S_(PETSCVIEWERGLVIS) * ADIOS = S_(PETSCVIEWERADIOS) */ __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_S_(PETSCVIEWERSAWS); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_SAWS, __pyx_t_10) < 0) __PYX_ERR(37, 15, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Viewer.pyx":16 * MATLAB = S_(PETSCVIEWERMATLAB) * SAWS = S_(PETSCVIEWERSAWS) * GLVIS = S_(PETSCVIEWERGLVIS) # <<<<<<<<<<<<<< * ADIOS = S_(PETSCVIEWERADIOS) * EXODUSII = S_(PETSCVIEWEREXODUSII) */ __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_S_(PETSCVIEWERGLVIS); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_GLVIS, __pyx_t_10) < 0) __PYX_ERR(37, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Viewer.pyx":17 * SAWS = S_(PETSCVIEWERSAWS) * GLVIS = S_(PETSCVIEWERGLVIS) * ADIOS = S_(PETSCVIEWERADIOS) # <<<<<<<<<<<<<< * EXODUSII = S_(PETSCVIEWEREXODUSII) * */ __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_S_(PETSCVIEWERADIOS); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_ADIOS, __pyx_t_10) < 0) __PYX_ERR(37, 17, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Viewer.pyx":18 * GLVIS = S_(PETSCVIEWERGLVIS) * ADIOS = S_(PETSCVIEWERADIOS) * EXODUSII = S_(PETSCVIEWEREXODUSII) # <<<<<<<<<<<<<< * * class ViewerFormat(object): */ __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_S_(PETSCVIEWEREXODUSII); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_EXODUSII, __pyx_t_10) < 0) __PYX_ERR(37, 18, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Viewer.pyx":3 * # -------------------------------------------------------------------- * * class ViewerType(object): # <<<<<<<<<<<<<< * """Viewer type.""" * SOCKET = S_(PETSCVIEWERSOCKET) */ __pyx_t_10 = __Pyx_Py3ClassCreate(__pyx_t_7, __pyx_n_s_ViewerType, __pyx_t_4, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (PyDict_SetItem(__pyx_d, __pyx_n_s_ViewerType, __pyx_t_10) < 0) __PYX_ERR(37, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/Viewer.pyx":20 * EXODUSII = S_(PETSCVIEWEREXODUSII) * * class ViewerFormat(object): # <<<<<<<<<<<<<< * """Viewer format.""" * DEFAULT = PETSC_VIEWER_DEFAULT */ __pyx_t_4 = __Pyx_PEP560_update_bases(__pyx_tuple__99); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = __Pyx_CalculateMetaclass(NULL, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(37, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_7, __pyx_t_4, __pyx_n_s_ViewerFormat, __pyx_n_s_ViewerFormat, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, __pyx_kp_s_Viewer_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(37, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_4 != __pyx_tuple__99) { if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_tuple__99) < 0))) __PYX_ERR(37, 20, __pyx_L1_error) } /* "petsc4py/PETSc/Viewer.pyx":22 * class ViewerFormat(object): * """Viewer format.""" * DEFAULT = PETSC_VIEWER_DEFAULT # <<<<<<<<<<<<<< * ASCII_MATLAB = PETSC_VIEWER_ASCII_MATLAB * ASCII_MATHEMATICA = PETSC_VIEWER_ASCII_MATHEMATICA */ __pyx_t_10 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_DEFAULT); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_DEFAULT, __pyx_t_10) < 0) __PYX_ERR(37, 22, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Viewer.pyx":23 * """Viewer format.""" * DEFAULT = PETSC_VIEWER_DEFAULT * ASCII_MATLAB = PETSC_VIEWER_ASCII_MATLAB # <<<<<<<<<<<<<< * ASCII_MATHEMATICA = PETSC_VIEWER_ASCII_MATHEMATICA * ASCII_IMPL = PETSC_VIEWER_ASCII_IMPL */ __pyx_t_10 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_ASCII_MATLAB); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_ASCII_MATLAB, __pyx_t_10) < 0) __PYX_ERR(37, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Viewer.pyx":24 * DEFAULT = PETSC_VIEWER_DEFAULT * ASCII_MATLAB = PETSC_VIEWER_ASCII_MATLAB * ASCII_MATHEMATICA = PETSC_VIEWER_ASCII_MATHEMATICA # <<<<<<<<<<<<<< * ASCII_IMPL = PETSC_VIEWER_ASCII_IMPL * ASCII_INFO = PETSC_VIEWER_ASCII_INFO */ __pyx_t_10 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_ASCII_MATHEMATICA); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_ASCII_MATHEMATICA, __pyx_t_10) < 0) __PYX_ERR(37, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Viewer.pyx":25 * ASCII_MATLAB = PETSC_VIEWER_ASCII_MATLAB * ASCII_MATHEMATICA = PETSC_VIEWER_ASCII_MATHEMATICA * ASCII_IMPL = PETSC_VIEWER_ASCII_IMPL # <<<<<<<<<<<<<< * ASCII_INFO = PETSC_VIEWER_ASCII_INFO * ASCII_INFO_DETAIL = PETSC_VIEWER_ASCII_INFO_DETAIL */ __pyx_t_10 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_ASCII_IMPL); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_ASCII_IMPL, __pyx_t_10) < 0) __PYX_ERR(37, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Viewer.pyx":26 * ASCII_MATHEMATICA = PETSC_VIEWER_ASCII_MATHEMATICA * ASCII_IMPL = PETSC_VIEWER_ASCII_IMPL * ASCII_INFO = PETSC_VIEWER_ASCII_INFO # <<<<<<<<<<<<<< * ASCII_INFO_DETAIL = PETSC_VIEWER_ASCII_INFO_DETAIL * ASCII_COMMON = PETSC_VIEWER_ASCII_COMMON */ __pyx_t_10 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_ASCII_INFO); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_ASCII_INFO, __pyx_t_10) < 0) __PYX_ERR(37, 26, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Viewer.pyx":27 * ASCII_IMPL = PETSC_VIEWER_ASCII_IMPL * ASCII_INFO = PETSC_VIEWER_ASCII_INFO * ASCII_INFO_DETAIL = PETSC_VIEWER_ASCII_INFO_DETAIL # <<<<<<<<<<<<<< * ASCII_COMMON = PETSC_VIEWER_ASCII_COMMON * ASCII_SYMMODU = PETSC_VIEWER_ASCII_SYMMODU */ __pyx_t_10 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_ASCII_INFO_DETAIL); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_ASCII_INFO_DETAIL, __pyx_t_10) < 0) __PYX_ERR(37, 27, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Viewer.pyx":28 * ASCII_INFO = PETSC_VIEWER_ASCII_INFO * ASCII_INFO_DETAIL = PETSC_VIEWER_ASCII_INFO_DETAIL * ASCII_COMMON = PETSC_VIEWER_ASCII_COMMON # <<<<<<<<<<<<<< * ASCII_SYMMODU = PETSC_VIEWER_ASCII_SYMMODU * ASCII_INDEX = PETSC_VIEWER_ASCII_INDEX */ __pyx_t_10 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_ASCII_COMMON); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_ASCII_COMMON, __pyx_t_10) < 0) __PYX_ERR(37, 28, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Viewer.pyx":29 * ASCII_INFO_DETAIL = PETSC_VIEWER_ASCII_INFO_DETAIL * ASCII_COMMON = PETSC_VIEWER_ASCII_COMMON * ASCII_SYMMODU = PETSC_VIEWER_ASCII_SYMMODU # <<<<<<<<<<<<<< * ASCII_INDEX = PETSC_VIEWER_ASCII_INDEX * ASCII_DENSE = PETSC_VIEWER_ASCII_DENSE */ __pyx_t_10 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_ASCII_SYMMODU); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_ASCII_SYMMODU, __pyx_t_10) < 0) __PYX_ERR(37, 29, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Viewer.pyx":30 * ASCII_COMMON = PETSC_VIEWER_ASCII_COMMON * ASCII_SYMMODU = PETSC_VIEWER_ASCII_SYMMODU * ASCII_INDEX = PETSC_VIEWER_ASCII_INDEX # <<<<<<<<<<<<<< * ASCII_DENSE = PETSC_VIEWER_ASCII_DENSE * ASCII_MATRIXMARKET= PETSC_VIEWER_ASCII_MATRIXMARKET */ __pyx_t_10 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_ASCII_INDEX); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_ASCII_INDEX, __pyx_t_10) < 0) __PYX_ERR(37, 30, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Viewer.pyx":31 * ASCII_SYMMODU = PETSC_VIEWER_ASCII_SYMMODU * ASCII_INDEX = PETSC_VIEWER_ASCII_INDEX * ASCII_DENSE = PETSC_VIEWER_ASCII_DENSE # <<<<<<<<<<<<<< * ASCII_MATRIXMARKET= PETSC_VIEWER_ASCII_MATRIXMARKET * ASCII_VTK = PETSC_VIEWER_ASCII_VTK_DEPRECATED */ __pyx_t_10 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_ASCII_DENSE); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_ASCII_DENSE, __pyx_t_10) < 0) __PYX_ERR(37, 31, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Viewer.pyx":32 * ASCII_INDEX = PETSC_VIEWER_ASCII_INDEX * ASCII_DENSE = PETSC_VIEWER_ASCII_DENSE * ASCII_MATRIXMARKET= PETSC_VIEWER_ASCII_MATRIXMARKET # <<<<<<<<<<<<<< * ASCII_VTK = PETSC_VIEWER_ASCII_VTK_DEPRECATED * ASCII_VTK_CELL = PETSC_VIEWER_ASCII_VTK_CELL_DEPRECATED */ __pyx_t_10 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_ASCII_MATRIXMARKET); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_ASCII_MATRIXMARKET, __pyx_t_10) < 0) __PYX_ERR(37, 32, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Viewer.pyx":33 * ASCII_DENSE = PETSC_VIEWER_ASCII_DENSE * ASCII_MATRIXMARKET= PETSC_VIEWER_ASCII_MATRIXMARKET * ASCII_VTK = PETSC_VIEWER_ASCII_VTK_DEPRECATED # <<<<<<<<<<<<<< * ASCII_VTK_CELL = PETSC_VIEWER_ASCII_VTK_CELL_DEPRECATED * ASCII_VTK_COORDS = PETSC_VIEWER_ASCII_VTK_COORDS_DEPRECATED */ __pyx_t_10 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_ASCII_VTK_DEPRECATED); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_ASCII_VTK, __pyx_t_10) < 0) __PYX_ERR(37, 33, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Viewer.pyx":34 * ASCII_MATRIXMARKET= PETSC_VIEWER_ASCII_MATRIXMARKET * ASCII_VTK = PETSC_VIEWER_ASCII_VTK_DEPRECATED * ASCII_VTK_CELL = PETSC_VIEWER_ASCII_VTK_CELL_DEPRECATED # <<<<<<<<<<<<<< * ASCII_VTK_COORDS = PETSC_VIEWER_ASCII_VTK_COORDS_DEPRECATED * ASCII_PCICE = PETSC_VIEWER_ASCII_PCICE */ __pyx_t_10 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_ASCII_VTK_CELL_DEPRECATED); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_ASCII_VTK_CELL, __pyx_t_10) < 0) __PYX_ERR(37, 34, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Viewer.pyx":35 * ASCII_VTK = PETSC_VIEWER_ASCII_VTK_DEPRECATED * ASCII_VTK_CELL = PETSC_VIEWER_ASCII_VTK_CELL_DEPRECATED * ASCII_VTK_COORDS = PETSC_VIEWER_ASCII_VTK_COORDS_DEPRECATED # <<<<<<<<<<<<<< * ASCII_PCICE = PETSC_VIEWER_ASCII_PCICE * ASCII_PYTHON = PETSC_VIEWER_ASCII_PYTHON */ __pyx_t_10 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_ASCII_VTK_COORDS_DEPRECATED); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_ASCII_VTK_COORDS, __pyx_t_10) < 0) __PYX_ERR(37, 35, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Viewer.pyx":36 * ASCII_VTK_CELL = PETSC_VIEWER_ASCII_VTK_CELL_DEPRECATED * ASCII_VTK_COORDS = PETSC_VIEWER_ASCII_VTK_COORDS_DEPRECATED * ASCII_PCICE = PETSC_VIEWER_ASCII_PCICE # <<<<<<<<<<<<<< * ASCII_PYTHON = PETSC_VIEWER_ASCII_PYTHON * ASCII_FACTOR_INFO = PETSC_VIEWER_ASCII_FACTOR_INFO */ __pyx_t_10 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_ASCII_PCICE); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_ASCII_PCICE, __pyx_t_10) < 0) __PYX_ERR(37, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Viewer.pyx":37 * ASCII_VTK_COORDS = PETSC_VIEWER_ASCII_VTK_COORDS_DEPRECATED * ASCII_PCICE = PETSC_VIEWER_ASCII_PCICE * ASCII_PYTHON = PETSC_VIEWER_ASCII_PYTHON # <<<<<<<<<<<<<< * ASCII_FACTOR_INFO = PETSC_VIEWER_ASCII_FACTOR_INFO * ASCII_LATEX = PETSC_VIEWER_ASCII_LATEX */ __pyx_t_10 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_ASCII_PYTHON); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_ASCII_PYTHON, __pyx_t_10) < 0) __PYX_ERR(37, 37, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Viewer.pyx":38 * ASCII_PCICE = PETSC_VIEWER_ASCII_PCICE * ASCII_PYTHON = PETSC_VIEWER_ASCII_PYTHON * ASCII_FACTOR_INFO = PETSC_VIEWER_ASCII_FACTOR_INFO # <<<<<<<<<<<<<< * ASCII_LATEX = PETSC_VIEWER_ASCII_LATEX * ASCII_XML = PETSC_VIEWER_ASCII_XML */ __pyx_t_10 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_ASCII_FACTOR_INFO); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_ASCII_FACTOR_INFO, __pyx_t_10) < 0) __PYX_ERR(37, 38, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Viewer.pyx":39 * ASCII_PYTHON = PETSC_VIEWER_ASCII_PYTHON * ASCII_FACTOR_INFO = PETSC_VIEWER_ASCII_FACTOR_INFO * ASCII_LATEX = PETSC_VIEWER_ASCII_LATEX # <<<<<<<<<<<<<< * ASCII_XML = PETSC_VIEWER_ASCII_XML * ASCII_GLVIS = PETSC_VIEWER_ASCII_GLVIS */ __pyx_t_10 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_ASCII_LATEX); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_ASCII_LATEX, __pyx_t_10) < 0) __PYX_ERR(37, 39, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Viewer.pyx":40 * ASCII_FACTOR_INFO = PETSC_VIEWER_ASCII_FACTOR_INFO * ASCII_LATEX = PETSC_VIEWER_ASCII_LATEX * ASCII_XML = PETSC_VIEWER_ASCII_XML # <<<<<<<<<<<<<< * ASCII_GLVIS = PETSC_VIEWER_ASCII_GLVIS * ASCII_CSV = PETSC_VIEWER_ASCII_CSV */ __pyx_t_10 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_ASCII_XML); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_ASCII_XML, __pyx_t_10) < 0) __PYX_ERR(37, 40, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Viewer.pyx":41 * ASCII_LATEX = PETSC_VIEWER_ASCII_LATEX * ASCII_XML = PETSC_VIEWER_ASCII_XML * ASCII_GLVIS = PETSC_VIEWER_ASCII_GLVIS # <<<<<<<<<<<<<< * ASCII_CSV = PETSC_VIEWER_ASCII_CSV * DRAW_BASIC = PETSC_VIEWER_DRAW_BASIC */ __pyx_t_10 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_ASCII_GLVIS); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_ASCII_GLVIS, __pyx_t_10) < 0) __PYX_ERR(37, 41, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Viewer.pyx":42 * ASCII_XML = PETSC_VIEWER_ASCII_XML * ASCII_GLVIS = PETSC_VIEWER_ASCII_GLVIS * ASCII_CSV = PETSC_VIEWER_ASCII_CSV # <<<<<<<<<<<<<< * DRAW_BASIC = PETSC_VIEWER_DRAW_BASIC * DRAW_LG = PETSC_VIEWER_DRAW_LG */ __pyx_t_10 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_ASCII_CSV); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_ASCII_CSV, __pyx_t_10) < 0) __PYX_ERR(37, 42, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Viewer.pyx":43 * ASCII_GLVIS = PETSC_VIEWER_ASCII_GLVIS * ASCII_CSV = PETSC_VIEWER_ASCII_CSV * DRAW_BASIC = PETSC_VIEWER_DRAW_BASIC # <<<<<<<<<<<<<< * DRAW_LG = PETSC_VIEWER_DRAW_LG * DRAW_LG_XRANGE = PETSC_VIEWER_DRAW_LG_XRANGE */ __pyx_t_10 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_DRAW_BASIC); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_DRAW_BASIC, __pyx_t_10) < 0) __PYX_ERR(37, 43, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Viewer.pyx":44 * ASCII_CSV = PETSC_VIEWER_ASCII_CSV * DRAW_BASIC = PETSC_VIEWER_DRAW_BASIC * DRAW_LG = PETSC_VIEWER_DRAW_LG # <<<<<<<<<<<<<< * DRAW_LG_XRANGE = PETSC_VIEWER_DRAW_LG_XRANGE * DRAW_CONTOUR = PETSC_VIEWER_DRAW_CONTOUR */ __pyx_t_10 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_DRAW_LG); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_DRAW_LG, __pyx_t_10) < 0) __PYX_ERR(37, 44, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Viewer.pyx":45 * DRAW_BASIC = PETSC_VIEWER_DRAW_BASIC * DRAW_LG = PETSC_VIEWER_DRAW_LG * DRAW_LG_XRANGE = PETSC_VIEWER_DRAW_LG_XRANGE # <<<<<<<<<<<<<< * DRAW_CONTOUR = PETSC_VIEWER_DRAW_CONTOUR * DRAW_PORTS = PETSC_VIEWER_DRAW_PORTS */ __pyx_t_10 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_DRAW_LG_XRANGE); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_DRAW_LG_XRANGE, __pyx_t_10) < 0) __PYX_ERR(37, 45, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Viewer.pyx":46 * DRAW_LG = PETSC_VIEWER_DRAW_LG * DRAW_LG_XRANGE = PETSC_VIEWER_DRAW_LG_XRANGE * DRAW_CONTOUR = PETSC_VIEWER_DRAW_CONTOUR # <<<<<<<<<<<<<< * DRAW_PORTS = PETSC_VIEWER_DRAW_PORTS * VTK_VTS = PETSC_VIEWER_VTK_VTS */ __pyx_t_10 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_DRAW_CONTOUR); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_DRAW_CONTOUR, __pyx_t_10) < 0) __PYX_ERR(37, 46, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Viewer.pyx":47 * DRAW_LG_XRANGE = PETSC_VIEWER_DRAW_LG_XRANGE * DRAW_CONTOUR = PETSC_VIEWER_DRAW_CONTOUR * DRAW_PORTS = PETSC_VIEWER_DRAW_PORTS # <<<<<<<<<<<<<< * VTK_VTS = PETSC_VIEWER_VTK_VTS * VTK_VTR = PETSC_VIEWER_VTK_VTR */ __pyx_t_10 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_DRAW_PORTS); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_DRAW_PORTS, __pyx_t_10) < 0) __PYX_ERR(37, 47, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Viewer.pyx":48 * DRAW_CONTOUR = PETSC_VIEWER_DRAW_CONTOUR * DRAW_PORTS = PETSC_VIEWER_DRAW_PORTS * VTK_VTS = PETSC_VIEWER_VTK_VTS # <<<<<<<<<<<<<< * VTK_VTR = PETSC_VIEWER_VTK_VTR * VTK_VTU = PETSC_VIEWER_VTK_VTU */ __pyx_t_10 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_VTK_VTS); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_VTK_VTS, __pyx_t_10) < 0) __PYX_ERR(37, 48, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Viewer.pyx":49 * DRAW_PORTS = PETSC_VIEWER_DRAW_PORTS * VTK_VTS = PETSC_VIEWER_VTK_VTS * VTK_VTR = PETSC_VIEWER_VTK_VTR # <<<<<<<<<<<<<< * VTK_VTU = PETSC_VIEWER_VTK_VTU * BINARY_MATLAB = PETSC_VIEWER_BINARY_MATLAB */ __pyx_t_10 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_VTK_VTR); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_VTK_VTR, __pyx_t_10) < 0) __PYX_ERR(37, 49, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Viewer.pyx":50 * VTK_VTS = PETSC_VIEWER_VTK_VTS * VTK_VTR = PETSC_VIEWER_VTK_VTR * VTK_VTU = PETSC_VIEWER_VTK_VTU # <<<<<<<<<<<<<< * BINARY_MATLAB = PETSC_VIEWER_BINARY_MATLAB * NATIVE = PETSC_VIEWER_NATIVE */ __pyx_t_10 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_VTK_VTU); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_VTK_VTU, __pyx_t_10) < 0) __PYX_ERR(37, 50, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Viewer.pyx":51 * VTK_VTR = PETSC_VIEWER_VTK_VTR * VTK_VTU = PETSC_VIEWER_VTK_VTU * BINARY_MATLAB = PETSC_VIEWER_BINARY_MATLAB # <<<<<<<<<<<<<< * NATIVE = PETSC_VIEWER_NATIVE * HDF5_PETSC = PETSC_VIEWER_HDF5_PETSC */ __pyx_t_10 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_BINARY_MATLAB); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_BINARY_MATLAB, __pyx_t_10) < 0) __PYX_ERR(37, 51, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Viewer.pyx":52 * VTK_VTU = PETSC_VIEWER_VTK_VTU * BINARY_MATLAB = PETSC_VIEWER_BINARY_MATLAB * NATIVE = PETSC_VIEWER_NATIVE # <<<<<<<<<<<<<< * HDF5_PETSC = PETSC_VIEWER_HDF5_PETSC * HDF5_VIZ = PETSC_VIEWER_HDF5_VIZ */ __pyx_t_10 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_NATIVE); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_NATIVE, __pyx_t_10) < 0) __PYX_ERR(37, 52, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Viewer.pyx":53 * BINARY_MATLAB = PETSC_VIEWER_BINARY_MATLAB * NATIVE = PETSC_VIEWER_NATIVE * HDF5_PETSC = PETSC_VIEWER_HDF5_PETSC # <<<<<<<<<<<<<< * HDF5_VIZ = PETSC_VIEWER_HDF5_VIZ * HDF5_XDMF = PETSC_VIEWER_HDF5_XDMF */ __pyx_t_10 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_HDF5_PETSC); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_HDF5_PETSC, __pyx_t_10) < 0) __PYX_ERR(37, 53, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Viewer.pyx":54 * NATIVE = PETSC_VIEWER_NATIVE * HDF5_PETSC = PETSC_VIEWER_HDF5_PETSC * HDF5_VIZ = PETSC_VIEWER_HDF5_VIZ # <<<<<<<<<<<<<< * HDF5_XDMF = PETSC_VIEWER_HDF5_XDMF * HDF5_MAT = PETSC_VIEWER_HDF5_MAT */ __pyx_t_10 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_HDF5_VIZ); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_HDF5_VIZ, __pyx_t_10) < 0) __PYX_ERR(37, 54, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Viewer.pyx":55 * HDF5_PETSC = PETSC_VIEWER_HDF5_PETSC * HDF5_VIZ = PETSC_VIEWER_HDF5_VIZ * HDF5_XDMF = PETSC_VIEWER_HDF5_XDMF # <<<<<<<<<<<<<< * HDF5_MAT = PETSC_VIEWER_HDF5_MAT * NOFORMAT = PETSC_VIEWER_NOFORMAT */ __pyx_t_10 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_HDF5_XDMF); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_HDF5_XDMF, __pyx_t_10) < 0) __PYX_ERR(37, 55, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Viewer.pyx":56 * HDF5_VIZ = PETSC_VIEWER_HDF5_VIZ * HDF5_XDMF = PETSC_VIEWER_HDF5_XDMF * HDF5_MAT = PETSC_VIEWER_HDF5_MAT # <<<<<<<<<<<<<< * NOFORMAT = PETSC_VIEWER_NOFORMAT * LOAD_BALANCE = PETSC_VIEWER_LOAD_BALANCE */ __pyx_t_10 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_HDF5_MAT); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_HDF5_MAT, __pyx_t_10) < 0) __PYX_ERR(37, 56, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Viewer.pyx":57 * HDF5_XDMF = PETSC_VIEWER_HDF5_XDMF * HDF5_MAT = PETSC_VIEWER_HDF5_MAT * NOFORMAT = PETSC_VIEWER_NOFORMAT # <<<<<<<<<<<<<< * LOAD_BALANCE = PETSC_VIEWER_LOAD_BALANCE * FAILED = PETSC_VIEWER_FAILED */ __pyx_t_10 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_NOFORMAT); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_NOFORMAT, __pyx_t_10) < 0) __PYX_ERR(37, 57, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Viewer.pyx":58 * HDF5_MAT = PETSC_VIEWER_HDF5_MAT * NOFORMAT = PETSC_VIEWER_NOFORMAT * LOAD_BALANCE = PETSC_VIEWER_LOAD_BALANCE # <<<<<<<<<<<<<< * FAILED = PETSC_VIEWER_FAILED * */ __pyx_t_10 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_LOAD_BALANCE); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_LOAD_BALANCE, __pyx_t_10) < 0) __PYX_ERR(37, 58, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Viewer.pyx":59 * NOFORMAT = PETSC_VIEWER_NOFORMAT * LOAD_BALANCE = PETSC_VIEWER_LOAD_BALANCE * FAILED = PETSC_VIEWER_FAILED # <<<<<<<<<<<<<< * * class ViewerFileMode(object): */ __pyx_t_10 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_FAILED); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_FAILED, __pyx_t_10) < 0) __PYX_ERR(37, 59, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Viewer.pyx":20 * EXODUSII = S_(PETSCVIEWEREXODUSII) * * class ViewerFormat(object): # <<<<<<<<<<<<<< * """Viewer format.""" * DEFAULT = PETSC_VIEWER_DEFAULT */ __pyx_t_10 = __Pyx_Py3ClassCreate(__pyx_t_7, __pyx_n_s_ViewerFormat, __pyx_t_4, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (PyDict_SetItem(__pyx_d, __pyx_n_s_ViewerFormat, __pyx_t_10) < 0) __PYX_ERR(37, 20, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/Viewer.pyx":61 * FAILED = PETSC_VIEWER_FAILED * * class ViewerFileMode(object): # <<<<<<<<<<<<<< * """Viewer file mode.""" * # native */ __pyx_t_4 = __Pyx_PEP560_update_bases(__pyx_tuple__101); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = __Pyx_CalculateMetaclass(NULL, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(37, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_7, __pyx_t_4, __pyx_n_s_ViewerFileMode, __pyx_n_s_ViewerFileMode, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, __pyx_kp_s_Viewer_file_mode); if (unlikely(!__pyx_t_5)) __PYX_ERR(37, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_4 != __pyx_tuple__101) { if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_tuple__101) < 0))) __PYX_ERR(37, 61, __pyx_L1_error) } /* "petsc4py/PETSc/Viewer.pyx":64 * """Viewer file mode.""" * # native * READ = PETSC_FILE_MODE_READ # <<<<<<<<<<<<<< * WRITE = PETSC_FILE_MODE_WRITE * APPEND = PETSC_FILE_MODE_APPEND */ __pyx_t_10 = __Pyx_PyInt_From_PetscFileMode(FILE_MODE_READ); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_READ, __pyx_t_10) < 0) __PYX_ERR(37, 64, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Viewer.pyx":65 * # native * READ = PETSC_FILE_MODE_READ * WRITE = PETSC_FILE_MODE_WRITE # <<<<<<<<<<<<<< * APPEND = PETSC_FILE_MODE_APPEND * UPDATE = PETSC_FILE_MODE_UPDATE */ __pyx_t_10 = __Pyx_PyInt_From_PetscFileMode(FILE_MODE_WRITE); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_WRITE, __pyx_t_10) < 0) __PYX_ERR(37, 65, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Viewer.pyx":66 * READ = PETSC_FILE_MODE_READ * WRITE = PETSC_FILE_MODE_WRITE * APPEND = PETSC_FILE_MODE_APPEND # <<<<<<<<<<<<<< * UPDATE = PETSC_FILE_MODE_UPDATE * APPEND_UPDATE = PETSC_FILE_MODE_APPEND_UPDATE */ __pyx_t_10 = __Pyx_PyInt_From_PetscFileMode(FILE_MODE_APPEND); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_APPEND, __pyx_t_10) < 0) __PYX_ERR(37, 66, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Viewer.pyx":67 * WRITE = PETSC_FILE_MODE_WRITE * APPEND = PETSC_FILE_MODE_APPEND * UPDATE = PETSC_FILE_MODE_UPDATE # <<<<<<<<<<<<<< * APPEND_UPDATE = PETSC_FILE_MODE_APPEND_UPDATE * # aliases */ __pyx_t_10 = __Pyx_PyInt_From_PetscFileMode(FILE_MODE_UPDATE); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_UPDATE, __pyx_t_10) < 0) __PYX_ERR(37, 67, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Viewer.pyx":68 * APPEND = PETSC_FILE_MODE_APPEND * UPDATE = PETSC_FILE_MODE_UPDATE * APPEND_UPDATE = PETSC_FILE_MODE_APPEND_UPDATE # <<<<<<<<<<<<<< * # aliases * R, W, A, U = READ, WRITE, APPEND, UPDATE */ __pyx_t_10 = __Pyx_PyInt_From_PetscFileMode(FILE_MODE_APPEND_UPDATE); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_APPEND_UPDATE, __pyx_t_10) < 0) __PYX_ERR(37, 68, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Viewer.pyx":70 * APPEND_UPDATE = PETSC_FILE_MODE_APPEND_UPDATE * # aliases * R, W, A, U = READ, WRITE, APPEND, UPDATE # <<<<<<<<<<<<<< * AU = UA = APPEND_UPDATE * */ __pyx_t_10 = PyObject_GetItem(__pyx_t_5, __pyx_n_s_READ); if (unlikely(!__pyx_t_10)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_READ); } if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = PyObject_GetItem(__pyx_t_5, __pyx_n_s_WRITE); if (unlikely(!__pyx_t_11)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_WRITE); } if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_12 = PyObject_GetItem(__pyx_t_5, __pyx_n_s_APPEND); if (unlikely(!__pyx_t_12)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_APPEND); } if (unlikely(!__pyx_t_12)) __PYX_ERR(37, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_13 = PyObject_GetItem(__pyx_t_5, __pyx_n_s_UPDATE); if (unlikely(!__pyx_t_13)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_UPDATE); } if (unlikely(!__pyx_t_13)) __PYX_ERR(37, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_R, __pyx_t_10) < 0) __PYX_ERR(37, 70, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_W, __pyx_t_11) < 0) __PYX_ERR(37, 70, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_A, __pyx_t_12) < 0) __PYX_ERR(37, 70, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_U, __pyx_t_13) < 0) __PYX_ERR(37, 70, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/Viewer.pyx":71 * # aliases * R, W, A, U = READ, WRITE, APPEND, UPDATE * AU = UA = APPEND_UPDATE # <<<<<<<<<<<<<< * * class ViewerDrawSize(object): */ __pyx_t_13 = PyObject_GetItem(__pyx_t_5, __pyx_n_s_APPEND_UPDATE); if (unlikely(!__pyx_t_13)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_APPEND_UPDATE); } if (unlikely(!__pyx_t_13)) __PYX_ERR(37, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_AU, __pyx_t_13) < 0) __PYX_ERR(37, 71, __pyx_L1_error) if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_UA, __pyx_t_13) < 0) __PYX_ERR(37, 71, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/Viewer.pyx":61 * FAILED = PETSC_VIEWER_FAILED * * class ViewerFileMode(object): # <<<<<<<<<<<<<< * """Viewer file mode.""" * # native */ __pyx_t_13 = __Pyx_Py3ClassCreate(__pyx_t_7, __pyx_n_s_ViewerFileMode, __pyx_t_4, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(37, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (PyDict_SetItem(__pyx_d, __pyx_n_s_ViewerFileMode, __pyx_t_13) < 0) __PYX_ERR(37, 61, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/Viewer.pyx":73 * AU = UA = APPEND_UPDATE * * class ViewerDrawSize(object): # <<<<<<<<<<<<<< * """Window size.""" * # native */ __pyx_t_4 = __Pyx_PEP560_update_bases(__pyx_tuple__103); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = __Pyx_CalculateMetaclass(NULL, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(37, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_7, __pyx_t_4, __pyx_n_s_ViewerDrawSize, __pyx_n_s_ViewerDrawSize, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, __pyx_kp_s_Window_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(37, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_4 != __pyx_tuple__103) { if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_tuple__103) < 0))) __PYX_ERR(37, 73, __pyx_L1_error) } /* "petsc4py/PETSc/Viewer.pyx":76 * """Window size.""" * # native * FULL_SIZE = PETSC_DRAW_FULL_SIZE # <<<<<<<<<<<<<< * HALF_SIZE = PETSC_DRAW_HALF_SIZE * THIRD_SIZE = PETSC_DRAW_THIRD_SIZE */ __pyx_t_13 = __Pyx_PyInt_From___pyx_anon_enum(PETSC_DRAW_FULL_SIZE); if (unlikely(!__pyx_t_13)) __PYX_ERR(37, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_FULL_SIZE, __pyx_t_13) < 0) __PYX_ERR(37, 76, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/Viewer.pyx":77 * # native * FULL_SIZE = PETSC_DRAW_FULL_SIZE * HALF_SIZE = PETSC_DRAW_HALF_SIZE # <<<<<<<<<<<<<< * THIRD_SIZE = PETSC_DRAW_THIRD_SIZE * QUARTER_SIZE = PETSC_DRAW_QUARTER_SIZE */ __pyx_t_13 = __Pyx_PyInt_From___pyx_anon_enum(PETSC_DRAW_HALF_SIZE); if (unlikely(!__pyx_t_13)) __PYX_ERR(37, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_HALF_SIZE, __pyx_t_13) < 0) __PYX_ERR(37, 77, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/Viewer.pyx":78 * FULL_SIZE = PETSC_DRAW_FULL_SIZE * HALF_SIZE = PETSC_DRAW_HALF_SIZE * THIRD_SIZE = PETSC_DRAW_THIRD_SIZE # <<<<<<<<<<<<<< * QUARTER_SIZE = PETSC_DRAW_QUARTER_SIZE * # aliases */ __pyx_t_13 = __Pyx_PyInt_From___pyx_anon_enum(PETSC_DRAW_THIRD_SIZE); if (unlikely(!__pyx_t_13)) __PYX_ERR(37, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_THIRD_SIZE, __pyx_t_13) < 0) __PYX_ERR(37, 78, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/Viewer.pyx":79 * HALF_SIZE = PETSC_DRAW_HALF_SIZE * THIRD_SIZE = PETSC_DRAW_THIRD_SIZE * QUARTER_SIZE = PETSC_DRAW_QUARTER_SIZE # <<<<<<<<<<<<<< * # aliases * FULL = FULL_SIZE */ __pyx_t_13 = __Pyx_PyInt_From___pyx_anon_enum(PETSC_DRAW_QUARTER_SIZE); if (unlikely(!__pyx_t_13)) __PYX_ERR(37, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_QUARTER_SIZE, __pyx_t_13) < 0) __PYX_ERR(37, 79, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/Viewer.pyx":81 * QUARTER_SIZE = PETSC_DRAW_QUARTER_SIZE * # aliases * FULL = FULL_SIZE # <<<<<<<<<<<<<< * HALF = HALF_SIZE * THIRD = THIRD_SIZE */ __pyx_t_13 = PyObject_GetItem(__pyx_t_5, __pyx_n_s_FULL_SIZE); if (unlikely(!__pyx_t_13)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_FULL_SIZE); } if (unlikely(!__pyx_t_13)) __PYX_ERR(37, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_FULL, __pyx_t_13) < 0) __PYX_ERR(37, 81, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/Viewer.pyx":82 * # aliases * FULL = FULL_SIZE * HALF = HALF_SIZE # <<<<<<<<<<<<<< * THIRD = THIRD_SIZE * QUARTER = QUARTER_SIZE */ __pyx_t_13 = PyObject_GetItem(__pyx_t_5, __pyx_n_s_HALF_SIZE); if (unlikely(!__pyx_t_13)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_HALF_SIZE); } if (unlikely(!__pyx_t_13)) __PYX_ERR(37, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_HALF, __pyx_t_13) < 0) __PYX_ERR(37, 82, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/Viewer.pyx":83 * FULL = FULL_SIZE * HALF = HALF_SIZE * THIRD = THIRD_SIZE # <<<<<<<<<<<<<< * QUARTER = QUARTER_SIZE * */ __pyx_t_13 = PyObject_GetItem(__pyx_t_5, __pyx_n_s_THIRD_SIZE); if (unlikely(!__pyx_t_13)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_THIRD_SIZE); } if (unlikely(!__pyx_t_13)) __PYX_ERR(37, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_THIRD, __pyx_t_13) < 0) __PYX_ERR(37, 83, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/Viewer.pyx":84 * HALF = HALF_SIZE * THIRD = THIRD_SIZE * QUARTER = QUARTER_SIZE # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_t_13 = PyObject_GetItem(__pyx_t_5, __pyx_n_s_QUARTER_SIZE); if (unlikely(!__pyx_t_13)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_QUARTER_SIZE); } if (unlikely(!__pyx_t_13)) __PYX_ERR(37, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_QUARTER, __pyx_t_13) < 0) __PYX_ERR(37, 84, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/Viewer.pyx":73 * AU = UA = APPEND_UPDATE * * class ViewerDrawSize(object): # <<<<<<<<<<<<<< * """Window size.""" * # native */ __pyx_t_13 = __Pyx_Py3ClassCreate(__pyx_t_7, __pyx_n_s_ViewerDrawSize, __pyx_t_4, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(37, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (PyDict_SetItem(__pyx_d, __pyx_n_s_ViewerDrawSize, __pyx_t_13) < 0) __PYX_ERR(37, 73, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "petsc4py/PETSc/Viewer.pyx":112 * """ * * Type = ViewerType # <<<<<<<<<<<<<< * Format = ViewerFormat * FileMode = ViewerFileMode */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ViewerType); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_n_s_Type, __pyx_t_4) < 0) __PYX_ERR(37, 112, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Viewer); /* "petsc4py/PETSc/Viewer.pyx":113 * * Type = ViewerType * Format = ViewerFormat # <<<<<<<<<<<<<< * FileMode = ViewerFileMode * DrawSize = ViewerDrawSize */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ViewerFormat); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_n_s_Format, __pyx_t_4) < 0) __PYX_ERR(37, 113, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Viewer); /* "petsc4py/PETSc/Viewer.pyx":114 * Type = ViewerType * Format = ViewerFormat * FileMode = ViewerFileMode # <<<<<<<<<<<<<< * DrawSize = ViewerDrawSize * */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ViewerFileMode); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_n_s_FileMode, __pyx_t_4) < 0) __PYX_ERR(37, 114, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Viewer); /* "petsc4py/PETSc/Viewer.pyx":115 * Format = ViewerFormat * FileMode = ViewerFileMode * DrawSize = ViewerDrawSize # <<<<<<<<<<<<<< * * # backward compatibility */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ViewerDrawSize); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_n_s_DrawSize, __pyx_t_4) < 0) __PYX_ERR(37, 115, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Viewer); /* "petsc4py/PETSc/Viewer.pyx":118 * * # backward compatibility * Mode = ViewerFileMode # <<<<<<<<<<<<<< * Size = ViewerFileMode * */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ViewerFileMode); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_n_s_Mode, __pyx_t_4) < 0) __PYX_ERR(37, 118, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Viewer); /* "petsc4py/PETSc/Viewer.pyx":119 * # backward compatibility * Mode = ViewerFileMode * Size = ViewerFileMode # <<<<<<<<<<<<<< * * # */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ViewerFileMode); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_n_s_Size, __pyx_t_4) < 0) __PYX_ERR(37, 119, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Viewer); /* "petsc4py/PETSc/Viewer.pyx":539 * CHKERR( PetscViewerRestoreSubViewer(self.vwr, ccomm, &sub.vwr) ) * * @classmethod # <<<<<<<<<<<<<< * def STDOUT(cls, comm: Comm | None = None) -> Viewer: * """Return the standard output viewer associated with the communicator. */ __Pyx_GetNameInClass(__pyx_t_4, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_n_s_STDOUT); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = __Pyx_Method_ClassMethod(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(37, 539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_n_s_STDOUT, __pyx_t_7) < 0) __PYX_ERR(37, 539, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Viewer); /* "petsc4py/PETSc/Viewer.pyx":557 * return viewer * * @classmethod # <<<<<<<<<<<<<< * def STDERR(cls, comm: Comm | None = None) -> Viewer: * """Return the standard error viewer associated with the communicator. */ __Pyx_GetNameInClass(__pyx_t_7, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_n_s_STDERR); if (unlikely(!__pyx_t_7)) __PYX_ERR(37, 557, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_4 = __Pyx_Method_ClassMethod(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 557, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_n_s_STDERR, __pyx_t_4) < 0) __PYX_ERR(37, 557, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Viewer); /* "petsc4py/PETSc/Viewer.pyx":575 * return viewer * * @classmethod # <<<<<<<<<<<<<< * def ASCII(cls, name : str, comm: Comm | None = None) -> Viewer: * """Return an ASCII viewer associated with the communicator. */ __Pyx_GetNameInClass(__pyx_t_4, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_n_s_ASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 575, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = __Pyx_Method_ClassMethod(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(37, 575, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_n_s_ASCII, __pyx_t_7) < 0) __PYX_ERR(37, 575, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Viewer); /* "petsc4py/PETSc/Viewer.pyx":596 * return viewer * * @classmethod # <<<<<<<<<<<<<< * def BINARY(cls, comm: Comm | None = None) -> Viewer: * """Return the default `Type.BINARY` viewer associated with the communicator. */ __Pyx_GetNameInClass(__pyx_t_7, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_n_s_BINARY); if (unlikely(!__pyx_t_7)) __PYX_ERR(37, 596, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_4 = __Pyx_Method_ClassMethod(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 596, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_n_s_BINARY, __pyx_t_4) < 0) __PYX_ERR(37, 596, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Viewer); /* "petsc4py/PETSc/Viewer.pyx":614 * return viewer * * @classmethod # <<<<<<<<<<<<<< * def DRAW(cls, comm: Comm | None = None) -> Viewer: * """Return the default `Type.DRAW` viewer associated with the communicator. */ __Pyx_GetNameInClass(__pyx_t_4, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_n_s_DRAW); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = __Pyx_Method_ClassMethod(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(37, 614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_n_s_DRAW, __pyx_t_7) < 0) __PYX_ERR(37, 614, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Viewer); /* "petsc4py/PETSc/Viewer.pyx":955 * # -------------------------------------------------------------------- * * del ViewerType # <<<<<<<<<<<<<< * del ViewerFormat * del ViewerFileMode */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_ViewerType) < 0) __PYX_ERR(37, 955, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":956 * * del ViewerType * del ViewerFormat # <<<<<<<<<<<<<< * del ViewerFileMode * del ViewerDrawSize */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_ViewerFormat) < 0) __PYX_ERR(37, 956, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":957 * del ViewerType * del ViewerFormat * del ViewerFileMode # <<<<<<<<<<<<<< * del ViewerDrawSize * */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_ViewerFileMode) < 0) __PYX_ERR(37, 957, __pyx_L1_error) /* "petsc4py/PETSc/Viewer.pyx":958 * del ViewerFormat * del ViewerFileMode * del ViewerDrawSize # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_ViewerDrawSize) < 0) __PYX_ERR(37, 958, __pyx_L1_error) /* "petsc4py/PETSc/Random.pyx":3 * # -------------------------------------------------------------------- * * class RandomType(object): # <<<<<<<<<<<<<< * """The random number generator type.""" * RAND = S_(PETSCRAND) */ __pyx_t_7 = __Pyx_PEP560_update_bases(__pyx_tuple__105); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(38, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_7, __pyx_n_s_RandomType, __pyx_n_s_RandomType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, __pyx_kp_s_The_random_number_generator_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(38, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_7 != __pyx_tuple__105) { if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_tuple__105) < 0))) __PYX_ERR(38, 3, __pyx_L1_error) } /* "petsc4py/PETSc/Random.pyx":5 * class RandomType(object): * """The random number generator type.""" * RAND = S_(PETSCRAND) # <<<<<<<<<<<<<< * RAND48 = S_(PETSCRAND48) * SPRNG = S_(PETSCSPRNG) */ __pyx_t_13 = __pyx_f_8petsc4py_5PETSc_S_(PETSCRAND); if (unlikely(!__pyx_t_13)) __PYX_ERR(38, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_RAND, __pyx_t_13) < 0) __PYX_ERR(38, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/Random.pyx":6 * """The random number generator type.""" * RAND = S_(PETSCRAND) * RAND48 = S_(PETSCRAND48) # <<<<<<<<<<<<<< * SPRNG = S_(PETSCSPRNG) * RANDER48 = S_(PETSCRANDER48) */ __pyx_t_13 = __pyx_f_8petsc4py_5PETSc_S_(PETSCRAND48); if (unlikely(!__pyx_t_13)) __PYX_ERR(38, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_RAND48, __pyx_t_13) < 0) __PYX_ERR(38, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/Random.pyx":7 * RAND = S_(PETSCRAND) * RAND48 = S_(PETSCRAND48) * SPRNG = S_(PETSCSPRNG) # <<<<<<<<<<<<<< * RANDER48 = S_(PETSCRANDER48) * RANDOM123 = S_(PETSCRANDOM123) */ __pyx_t_13 = __pyx_f_8petsc4py_5PETSc_S_(PETSCSPRNG); if (unlikely(!__pyx_t_13)) __PYX_ERR(38, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_SPRNG, __pyx_t_13) < 0) __PYX_ERR(38, 7, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/Random.pyx":8 * RAND48 = S_(PETSCRAND48) * SPRNG = S_(PETSCSPRNG) * RANDER48 = S_(PETSCRANDER48) # <<<<<<<<<<<<<< * RANDOM123 = S_(PETSCRANDOM123) * */ __pyx_t_13 = __pyx_f_8petsc4py_5PETSc_S_(PETSCRANDER48); if (unlikely(!__pyx_t_13)) __PYX_ERR(38, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_RANDER48, __pyx_t_13) < 0) __PYX_ERR(38, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/Random.pyx":9 * SPRNG = S_(PETSCSPRNG) * RANDER48 = S_(PETSCRANDER48) * RANDOM123 = S_(PETSCRANDOM123) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_t_13 = __pyx_f_8petsc4py_5PETSc_S_(PETSCRANDOM123); if (unlikely(!__pyx_t_13)) __PYX_ERR(38, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_RANDOM123, __pyx_t_13) < 0) __PYX_ERR(38, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/Random.pyx":3 * # -------------------------------------------------------------------- * * class RandomType(object): # <<<<<<<<<<<<<< * """The random number generator type.""" * RAND = S_(PETSCRAND) */ __pyx_t_13 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_n_s_RandomType, __pyx_t_7, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(38, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (PyDict_SetItem(__pyx_d, __pyx_n_s_RandomType, __pyx_t_13) < 0) __PYX_ERR(38, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "petsc4py/PETSc/Random.pyx":22 * """ * * Type = RandomType # <<<<<<<<<<<<<< * * def __cinit__(self) -> None: */ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_RandomType); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Random, __pyx_n_s_Type, __pyx_t_7) < 0) __PYX_ERR(38, 22, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Random); /* "petsc4py/PETSc/Random.pyx":248 * # -------------------------------------------------------------------- * * del RandomType # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_RandomType) < 0) __PYX_ERR(38, 248, __pyx_L1_error) /* "petsc4py/PETSc/Device.pyx":3 * # -------------------------------------------------------------------- * * class staticproperty(property): # <<<<<<<<<<<<<< * def __get__(self, *args, **kwargs): * return self.fget.__get__(*args, **kwargs)() */ __pyx_t_7 = __Pyx_PEP560_update_bases(__pyx_tuple__107); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_7, __pyx_n_s_staticproperty, __pyx_n_s_staticproperty, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_7 != __pyx_tuple__107) { if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_tuple__107) < 0))) __PYX_ERR(2, 3, __pyx_L1_error) } /* "petsc4py/PETSc/Device.pyx":4 * * class staticproperty(property): * def __get__(self, *args, **kwargs): # <<<<<<<<<<<<<< * return self.fget.__get__(*args, **kwargs)() * */ __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_14staticproperty_1__get__, 0, __pyx_n_s_staticproperty___get, NULL, __pyx_n_s_petsc4py_PETSc, __pyx_d, ((PyObject *)__pyx_codeobj__109)); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_get, __pyx_t_13) < 0) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/Device.pyx":3 * # -------------------------------------------------------------------- * * class staticproperty(property): # <<<<<<<<<<<<<< * def __get__(self, *args, **kwargs): * return self.fget.__get__(*args, **kwargs)() */ __pyx_t_13 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_n_s_staticproperty, __pyx_t_7, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (PyDict_SetItem(__pyx_d, __pyx_n_s_staticproperty, __pyx_t_13) < 0) __PYX_ERR(2, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "petsc4py/PETSc/Device.pyx":29 * """, * ( * ("HOST" , PETSC_DEVICE_HOST), # <<<<<<<<<<<<<< * ("CUDA" , PETSC_DEVICE_CUDA), * ("HIP" , PETSC_DEVICE_HIP), */ __pyx_t_7 = __Pyx_PyInt_From_PetscDeviceType(PETSC_DEVICE_HOST); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_n_s_HOST); __Pyx_GIVEREF(__pyx_n_s_HOST); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_HOST)) __PYX_ERR(2, 29, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_7)) __PYX_ERR(2, 29, __pyx_L1_error); __pyx_t_7 = 0; /* "petsc4py/PETSc/Device.pyx":30 * ( * ("HOST" , PETSC_DEVICE_HOST), * ("CUDA" , PETSC_DEVICE_CUDA), # <<<<<<<<<<<<<< * ("HIP" , PETSC_DEVICE_HIP), * ("SYCL" , PETSC_DEVICE_SYCL), */ __pyx_t_7 = __Pyx_PyInt_From_PetscDeviceType(PETSC_DEVICE_CUDA); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_n_s_CUDA); __Pyx_GIVEREF(__pyx_n_s_CUDA); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_CUDA)) __PYX_ERR(2, 30, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_7)) __PYX_ERR(2, 30, __pyx_L1_error); __pyx_t_7 = 0; /* "petsc4py/PETSc/Device.pyx":31 * ("HOST" , PETSC_DEVICE_HOST), * ("CUDA" , PETSC_DEVICE_CUDA), * ("HIP" , PETSC_DEVICE_HIP), # <<<<<<<<<<<<<< * ("SYCL" , PETSC_DEVICE_SYCL), * ("DEFAULT" , staticproperty(lambda *_,**__: PETSC_DEVICE_DEFAULT())) */ __pyx_t_7 = __Pyx_PyInt_From_PetscDeviceType(PETSC_DEVICE_HIP); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_INCREF(__pyx_n_s_HIP); __Pyx_GIVEREF(__pyx_n_s_HIP); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_n_s_HIP)) __PYX_ERR(2, 31, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_7)) __PYX_ERR(2, 31, __pyx_L1_error); __pyx_t_7 = 0; /* "petsc4py/PETSc/Device.pyx":32 * ("CUDA" , PETSC_DEVICE_CUDA), * ("HIP" , PETSC_DEVICE_HIP), * ("SYCL" , PETSC_DEVICE_SYCL), # <<<<<<<<<<<<<< * ("DEFAULT" , staticproperty(lambda *_,**__: PETSC_DEVICE_DEFAULT())) * ) */ __pyx_t_7 = __Pyx_PyInt_From_PetscDeviceType(PETSC_DEVICE_SYCL); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(2, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_INCREF(__pyx_n_s_SYCL); __Pyx_GIVEREF(__pyx_n_s_SYCL); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_n_s_SYCL)) __PYX_ERR(2, 32, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_7)) __PYX_ERR(2, 32, __pyx_L1_error); __pyx_t_7 = 0; /* "petsc4py/PETSc/Device.pyx":33 * ("HIP" , PETSC_DEVICE_HIP), * ("SYCL" , PETSC_DEVICE_SYCL), * ("DEFAULT" , staticproperty(lambda *_,**__: PETSC_DEVICE_DEFAULT())) # <<<<<<<<<<<<<< * ) * ) */ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_staticproperty); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_16lambda, 0, __pyx_n_s_lambda, NULL, __pyx_n_s_petsc4py_PETSc, __pyx_d, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_INCREF(__pyx_n_s_DEFAULT); __Pyx_GIVEREF(__pyx_n_s_DEFAULT); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_n_s_DEFAULT)) __PYX_ERR(2, 33, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_10); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_10)) __PYX_ERR(2, 33, __pyx_L1_error); __pyx_t_10 = 0; /* "petsc4py/PETSc/Device.pyx":29 * """, * ( * ("HOST" , PETSC_DEVICE_HOST), # <<<<<<<<<<<<<< * ("CUDA" , PETSC_DEVICE_CUDA), * ("HIP" , PETSC_DEVICE_HIP), */ __pyx_t_10 = PyTuple_New(5); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_4)) __PYX_ERR(2, 29, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_5)) __PYX_ERR(2, 29, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_13); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_13)) __PYX_ERR(2, 29, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_12); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_12)) __PYX_ERR(2, 29, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_11); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_t_11)) __PYX_ERR(2, 29, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_13 = 0; __pyx_t_12 = 0; __pyx_t_11 = 0; /* "petsc4py/PETSc/Device.pyx":19 * return type(class_name, (object, ), attrs) * * DeviceType = make_enum_class( # <<<<<<<<<<<<<< * "DeviceType", * """The type of device. */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_make_enum_class(__pyx_n_s_DeviceType, __pyx_kp_s_The_type_of_device_See_Also_Devi, ((PyObject*)__pyx_t_10)); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_DeviceType, __pyx_t_11) < 0) __PYX_ERR(2, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Device.pyx":47 * """, * ( * ("GLOBAL_BLOCKING" , PETSC_STREAM_GLOBAL_BLOCKING), # <<<<<<<<<<<<<< * ("DEFAULT_BLOCKING" , PETSC_STREAM_DEFAULT_BLOCKING), * ("GLOBAL_NONBLOCKING" , PETSC_STREAM_GLOBAL_NONBLOCKING), */ __pyx_t_11 = __Pyx_PyInt_From_PetscStreamType(PETSC_STREAM_GLOBAL_BLOCKING); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_INCREF(__pyx_n_s_GLOBAL_BLOCKING); __Pyx_GIVEREF(__pyx_n_s_GLOBAL_BLOCKING); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_n_s_GLOBAL_BLOCKING)) __PYX_ERR(2, 47, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_11); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_11)) __PYX_ERR(2, 47, __pyx_L1_error); __pyx_t_11 = 0; /* "petsc4py/PETSc/Device.pyx":48 * ( * ("GLOBAL_BLOCKING" , PETSC_STREAM_GLOBAL_BLOCKING), * ("DEFAULT_BLOCKING" , PETSC_STREAM_DEFAULT_BLOCKING), # <<<<<<<<<<<<<< * ("GLOBAL_NONBLOCKING" , PETSC_STREAM_GLOBAL_NONBLOCKING), * ) */ __pyx_t_11 = __Pyx_PyInt_From_PetscStreamType(PETSC_STREAM_DEFAULT_BLOCKING); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(2, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_INCREF(__pyx_n_s_DEFAULT_BLOCKING); __Pyx_GIVEREF(__pyx_n_s_DEFAULT_BLOCKING); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_n_s_DEFAULT_BLOCKING)) __PYX_ERR(2, 48, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_11); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_11)) __PYX_ERR(2, 48, __pyx_L1_error); __pyx_t_11 = 0; /* "petsc4py/PETSc/Device.pyx":49 * ("GLOBAL_BLOCKING" , PETSC_STREAM_GLOBAL_BLOCKING), * ("DEFAULT_BLOCKING" , PETSC_STREAM_DEFAULT_BLOCKING), * ("GLOBAL_NONBLOCKING" , PETSC_STREAM_GLOBAL_NONBLOCKING), # <<<<<<<<<<<<<< * ) * ) */ __pyx_t_11 = __Pyx_PyInt_From_PetscStreamType(PETSC_STREAM_GLOBAL_NONBLOCKING); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_INCREF(__pyx_n_s_GLOBAL_NONBLOCKING); __Pyx_GIVEREF(__pyx_n_s_GLOBAL_NONBLOCKING); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_n_s_GLOBAL_NONBLOCKING)) __PYX_ERR(2, 49, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_11); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_11)) __PYX_ERR(2, 49, __pyx_L1_error); __pyx_t_11 = 0; /* "petsc4py/PETSc/Device.pyx":47 * """, * ( * ("GLOBAL_BLOCKING" , PETSC_STREAM_GLOBAL_BLOCKING), # <<<<<<<<<<<<<< * ("DEFAULT_BLOCKING" , PETSC_STREAM_DEFAULT_BLOCKING), * ("GLOBAL_NONBLOCKING" , PETSC_STREAM_GLOBAL_NONBLOCKING), */ __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_10); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10)) __PYX_ERR(2, 47, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_12); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_12)) __PYX_ERR(2, 47, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_13); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_13)) __PYX_ERR(2, 47, __pyx_L1_error); __pyx_t_10 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; /* "petsc4py/PETSc/Device.pyx":37 * ) * * StreamType = make_enum_class( # <<<<<<<<<<<<<< * "StreamType", * """The type of stream. */ __pyx_t_13 = __pyx_f_8petsc4py_5PETSc_make_enum_class(__pyx_n_s_StreamType, __pyx_kp_s_The_type_of_stream_See_Also_Devi, ((PyObject*)__pyx_t_11)); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_StreamType, __pyx_t_13) < 0) __PYX_ERR(2, 37, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/Device.pyx":63 * """, * ( * ("DESTROY" , PETSC_DEVICE_CONTEXT_JOIN_DESTROY), # <<<<<<<<<<<<<< * ("SYNC" , PETSC_DEVICE_CONTEXT_JOIN_SYNC), * ("NO_SYNC" , PETSC_DEVICE_CONTEXT_JOIN_NO_SYNC), */ __pyx_t_13 = __Pyx_PyInt_From_PetscDeviceContextJoinMode(PETSC_DEVICE_CONTEXT_JOIN_DESTROY); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_INCREF(__pyx_n_s_DESTROY); __Pyx_GIVEREF(__pyx_n_s_DESTROY); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_n_s_DESTROY)) __PYX_ERR(2, 63, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_13); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_13)) __PYX_ERR(2, 63, __pyx_L1_error); __pyx_t_13 = 0; /* "petsc4py/PETSc/Device.pyx":64 * ( * ("DESTROY" , PETSC_DEVICE_CONTEXT_JOIN_DESTROY), * ("SYNC" , PETSC_DEVICE_CONTEXT_JOIN_SYNC), # <<<<<<<<<<<<<< * ("NO_SYNC" , PETSC_DEVICE_CONTEXT_JOIN_NO_SYNC), * ) */ __pyx_t_13 = __Pyx_PyInt_From_PetscDeviceContextJoinMode(PETSC_DEVICE_CONTEXT_JOIN_SYNC); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(2, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_INCREF(__pyx_n_s_SYNC); __Pyx_GIVEREF(__pyx_n_s_SYNC); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_n_s_SYNC)) __PYX_ERR(2, 64, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_13); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_13)) __PYX_ERR(2, 64, __pyx_L1_error); __pyx_t_13 = 0; /* "petsc4py/PETSc/Device.pyx":65 * ("DESTROY" , PETSC_DEVICE_CONTEXT_JOIN_DESTROY), * ("SYNC" , PETSC_DEVICE_CONTEXT_JOIN_SYNC), * ("NO_SYNC" , PETSC_DEVICE_CONTEXT_JOIN_NO_SYNC), # <<<<<<<<<<<<<< * ) * ) */ __pyx_t_13 = __Pyx_PyInt_From_PetscDeviceContextJoinMode(PETSC_DEVICE_CONTEXT_JOIN_NO_SYNC); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_INCREF(__pyx_n_s_NO_SYNC); __Pyx_GIVEREF(__pyx_n_s_NO_SYNC); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_n_s_NO_SYNC)) __PYX_ERR(2, 65, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_13); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_13)) __PYX_ERR(2, 65, __pyx_L1_error); __pyx_t_13 = 0; /* "petsc4py/PETSc/Device.pyx":63 * """, * ( * ("DESTROY" , PETSC_DEVICE_CONTEXT_JOIN_DESTROY), # <<<<<<<<<<<<<< * ("SYNC" , PETSC_DEVICE_CONTEXT_JOIN_SYNC), * ("NO_SYNC" , PETSC_DEVICE_CONTEXT_JOIN_NO_SYNC), */ __pyx_t_13 = PyTuple_New(3); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_GIVEREF(__pyx_t_11); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11)) __PYX_ERR(2, 63, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_12); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_12)) __PYX_ERR(2, 63, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_10); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_10)) __PYX_ERR(2, 63, __pyx_L1_error); __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_10 = 0; /* "petsc4py/PETSc/Device.pyx":53 * ) * * DeviceJoinMode = make_enum_class( # <<<<<<<<<<<<<< * "DeviceJoinMode", * """The type of join to perform. */ __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_make_enum_class(__pyx_n_s_DeviceJoinMode, __pyx_kp_s_The_type_of_join_to_perform_See, ((PyObject*)__pyx_t_13)); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_DeviceJoinMode, __pyx_t_10) < 0) __PYX_ERR(2, 53, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Device.pyx":82 * """ * * Type = DeviceType # <<<<<<<<<<<<<< * * def __cinit__(self): */ __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_DeviceType); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Device, __pyx_n_s_Type, __pyx_t_10) < 0) __PYX_ERR(2, 82, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Device); /* "petsc4py/PETSc/Device.pyx":91 * * @classmethod * def create(cls, dtype: Type | None = None, device_id: int = DECIDE) -> Device: # <<<<<<<<<<<<<< * """Create a device object. * */ __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_DECIDE); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_k__41 = __pyx_t_10; __Pyx_GIVEREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/Device.pyx":90 * self.destroy() * * @classmethod # <<<<<<<<<<<<<< * def create(cls, dtype: Type | None = None, device_id: int = DECIDE) -> Device: * """Create a device object. */ __Pyx_GetNameInClass(__pyx_t_10, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Device, __pyx_n_s_create); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_13 = __Pyx_Method_ClassMethod(__pyx_t_10); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Device, __pyx_n_s_create, __pyx_t_13) < 0) __PYX_ERR(2, 90, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Device); /* "petsc4py/PETSc/Device.pyx":191 * return toInt(cdevice_id) * * @staticmethod # <<<<<<<<<<<<<< * def setDefaultType(device_type: Type | str) -> None: * """Set the device type to be used as the default in subsequent calls to `create`. */ __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_8petsc4py_5PETSc_6Device_17setDefaultType, NULL, __pyx_n_s_petsc4py_PETSc); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Device, __pyx_n_s_setDefaultType, __pyx_t_13) < 0) __PYX_ERR(2, 191, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Device); __Pyx_GetNameInClass(__pyx_t_13, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Device, __pyx_n_s_setDefaultType); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Device, __pyx_n_s_setDefaultType, __pyx_t_10) < 0) __PYX_ERR(2, 191, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Device); /* "petsc4py/PETSc/Device.pyx":229 * * """ * JoinMode = DeviceJoinMode # <<<<<<<<<<<<<< * StreamType = StreamType * */ __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_DeviceJoinMode); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DeviceContext, __pyx_n_s_JoinMode, __pyx_t_10) < 0) __PYX_ERR(2, 229, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_DeviceContext); /* "petsc4py/PETSc/Device.pyx":230 * """ * JoinMode = DeviceJoinMode * StreamType = StreamType # <<<<<<<<<<<<<< * * def __cinit__(self): */ __Pyx_GetNameInClass(__pyx_t_10, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_DeviceContext, __pyx_n_s_StreamType); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DeviceContext, __pyx_n_s_StreamType, __pyx_t_10) < 0) __PYX_ERR(2, 230, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_DeviceContext); /* "petsc4py/PETSc/Device.pyx":239 * self.destroy() * * @classmethod # <<<<<<<<<<<<<< * def create(cls) -> DeviceContext: * """Create an empty DeviceContext. */ __Pyx_GetNameInClass(__pyx_t_10, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_DeviceContext, __pyx_n_s_create); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_13 = __Pyx_Method_ClassMethod(__pyx_t_10); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DeviceContext, __pyx_n_s_create, __pyx_t_13) < 0) __PYX_ERR(2, 239, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_DeviceContext); /* "petsc4py/PETSc/Device.pyx":487 * CHKERR(PetscDeviceContextSetFromOptions(ccomm, self.dctx)) * * @staticmethod # <<<<<<<<<<<<<< * def getCurrent() -> DeviceContext: * """Return the current device context. */ __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_8petsc4py_5PETSc_13DeviceContext_31getCurrent, NULL, __pyx_n_s_petsc4py_PETSc); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DeviceContext, __pyx_n_s_getCurrent, __pyx_t_13) < 0) __PYX_ERR(2, 487, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_DeviceContext); __Pyx_GetNameInClass(__pyx_t_13, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_DeviceContext, __pyx_n_s_getCurrent); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DeviceContext, __pyx_n_s_getCurrent, __pyx_t_10) < 0) __PYX_ERR(2, 487, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_DeviceContext); /* "petsc4py/PETSc/Device.pyx":503 * return PyPetscDeviceContext_New(dctx) * * @staticmethod # <<<<<<<<<<<<<< * def setCurrent(dctx: DeviceContext | None) -> None: * """Set the current device context. */ __pyx_t_10 = PyCFunction_NewEx(&__pyx_mdef_8petsc4py_5PETSc_13DeviceContext_33setCurrent, NULL, __pyx_n_s_petsc4py_PETSc); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 503, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DeviceContext, __pyx_n_s_setCurrent, __pyx_t_10) < 0) __PYX_ERR(2, 503, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_DeviceContext); __Pyx_GetNameInClass(__pyx_t_10, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_DeviceContext, __pyx_n_s_setCurrent); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 503, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_13 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_10); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 503, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DeviceContext, __pyx_n_s_setCurrent, __pyx_t_13) < 0) __PYX_ERR(2, 503, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_DeviceContext); /* "petsc4py/PETSc/Device.pyx":549 * # -------------------------------------------------------------------- * * del DeviceType # <<<<<<<<<<<<<< * del DeviceJoinMode * del StreamType */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_DeviceType) < 0) __PYX_ERR(2, 549, __pyx_L1_error) /* "petsc4py/PETSc/Device.pyx":550 * * del DeviceType * del DeviceJoinMode # <<<<<<<<<<<<<< * del StreamType * del staticproperty */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_DeviceJoinMode) < 0) __PYX_ERR(2, 550, __pyx_L1_error) /* "petsc4py/PETSc/Device.pyx":551 * del DeviceType * del DeviceJoinMode * del StreamType # <<<<<<<<<<<<<< * del staticproperty */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_StreamType) < 0) __PYX_ERR(2, 551, __pyx_L1_error) /* "petsc4py/PETSc/Device.pyx":552 * del DeviceJoinMode * del StreamType * del staticproperty # <<<<<<<<<<<<<< */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_staticproperty) < 0) __PYX_ERR(2, 552, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":3 * # -------------------------------------------------------------------- * * class ISType(object): # <<<<<<<<<<<<<< * GENERAL = S_(ISGENERAL) * BLOCK = S_(ISBLOCK) */ __pyx_t_13 = __Pyx_PEP560_update_bases(__pyx_tuple__117); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(39, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_13, __pyx_n_s_ISType, __pyx_n_s_ISType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(39, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_13 != __pyx_tuple__117) { if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_tuple__117) < 0))) __PYX_ERR(39, 3, __pyx_L1_error) } /* "petsc4py/PETSc/IS.pyx":4 * * class ISType(object): * GENERAL = S_(ISGENERAL) # <<<<<<<<<<<<<< * BLOCK = S_(ISBLOCK) * STRIDE = S_(ISSTRIDE) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(ISGENERAL); if (unlikely(!__pyx_t_11)) __PYX_ERR(39, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_GENERAL, __pyx_t_11) < 0) __PYX_ERR(39, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/IS.pyx":5 * class ISType(object): * GENERAL = S_(ISGENERAL) * BLOCK = S_(ISBLOCK) # <<<<<<<<<<<<<< * STRIDE = S_(ISSTRIDE) * */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(ISBLOCK); if (unlikely(!__pyx_t_11)) __PYX_ERR(39, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_BLOCK, __pyx_t_11) < 0) __PYX_ERR(39, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/IS.pyx":6 * GENERAL = S_(ISGENERAL) * BLOCK = S_(ISBLOCK) * STRIDE = S_(ISSTRIDE) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(ISSTRIDE); if (unlikely(!__pyx_t_11)) __PYX_ERR(39, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_STRIDE, __pyx_t_11) < 0) __PYX_ERR(39, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/IS.pyx":3 * # -------------------------------------------------------------------- * * class ISType(object): # <<<<<<<<<<<<<< * GENERAL = S_(ISGENERAL) * BLOCK = S_(ISBLOCK) */ __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_ISType, __pyx_t_13, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(39, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_ISType, __pyx_t_11) < 0) __PYX_ERR(39, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/IS.pyx":22 * """ * * Type = ISType # <<<<<<<<<<<<<< * * # */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_ISType); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_n_s_Type, __pyx_t_13) < 0) __PYX_ERR(39, 22, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_IS); /* "petsc4py/PETSc/IS.pyx":1053 * * * class GLMapMode(object): # <<<<<<<<<<<<<< * """Enum describing mapping behavior for global-to-local maps when global indices are missing. * */ __pyx_t_13 = __Pyx_PEP560_update_bases(__pyx_tuple__119); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 1053, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(39, 1053, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_13, __pyx_n_s_GLMapMode, __pyx_n_s_GLMapMode, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, __pyx_kp_s_Enum_describing_mapping_behavior); if (unlikely(!__pyx_t_12)) __PYX_ERR(39, 1053, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_13 != __pyx_tuple__119) { if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_tuple__119) < 0))) __PYX_ERR(39, 1053, __pyx_L1_error) } /* "petsc4py/PETSc/IS.pyx":1066 * * """ * MASK = PETSC_IS_GTOLM_MASK # <<<<<<<<<<<<<< * DROP = PETSC_IS_GTOLM_DROP * */ __pyx_t_11 = __Pyx_PyInt_From_ISGlobalToLocalMappingMode(IS_GTOLM_MASK); if (unlikely(!__pyx_t_11)) __PYX_ERR(39, 1066, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_MASK, __pyx_t_11) < 0) __PYX_ERR(39, 1066, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/IS.pyx":1067 * """ * MASK = PETSC_IS_GTOLM_MASK * DROP = PETSC_IS_GTOLM_DROP # <<<<<<<<<<<<<< * * */ __pyx_t_11 = __Pyx_PyInt_From_ISGlobalToLocalMappingMode(IS_GTOLM_DROP); if (unlikely(!__pyx_t_11)) __PYX_ERR(39, 1067, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DROP, __pyx_t_11) < 0) __PYX_ERR(39, 1067, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/IS.pyx":1053 * * * class GLMapMode(object): # <<<<<<<<<<<<<< * """Enum describing mapping behavior for global-to-local maps when global indices are missing. * */ __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_GLMapMode, __pyx_t_13, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(39, 1053, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GLMapMode, __pyx_t_11) < 0) __PYX_ERR(39, 1053, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/IS.pyx":1070 * * * class LGMapType(object): # <<<<<<<<<<<<<< * BASIC = S_(ISLOCALTOGLOBALMAPPINGBASIC) * HASH = S_(ISLOCALTOGLOBALMAPPINGHASH) */ __pyx_t_13 = __Pyx_PEP560_update_bases(__pyx_tuple__121); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 1070, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(39, 1070, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_13, __pyx_n_s_LGMapType, __pyx_n_s_LGMapType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(39, 1070, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_13 != __pyx_tuple__121) { if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_tuple__121) < 0))) __PYX_ERR(39, 1070, __pyx_L1_error) } /* "petsc4py/PETSc/IS.pyx":1071 * * class LGMapType(object): * BASIC = S_(ISLOCALTOGLOBALMAPPINGBASIC) # <<<<<<<<<<<<<< * HASH = S_(ISLOCALTOGLOBALMAPPINGHASH) * */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(ISLOCALTOGLOBALMAPPINGBASIC); if (unlikely(!__pyx_t_11)) __PYX_ERR(39, 1071, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_BASIC, __pyx_t_11) < 0) __PYX_ERR(39, 1071, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/IS.pyx":1072 * class LGMapType(object): * BASIC = S_(ISLOCALTOGLOBALMAPPINGBASIC) * HASH = S_(ISLOCALTOGLOBALMAPPINGHASH) # <<<<<<<<<<<<<< * * */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(ISLOCALTOGLOBALMAPPINGHASH); if (unlikely(!__pyx_t_11)) __PYX_ERR(39, 1072, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_HASH, __pyx_t_11) < 0) __PYX_ERR(39, 1072, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/IS.pyx":1070 * * * class LGMapType(object): # <<<<<<<<<<<<<< * BASIC = S_(ISLOCALTOGLOBALMAPPINGBASIC) * HASH = S_(ISLOCALTOGLOBALMAPPINGHASH) */ __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_LGMapType, __pyx_t_13, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(39, 1070, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_LGMapType, __pyx_t_11) < 0) __PYX_ERR(39, 1070, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/IS.pyx":1086 * """ * * MapMode = GLMapMode # <<<<<<<<<<<<<< * * Type = LGMapType */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_GLMapMode); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 1086, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_LGMap, __pyx_n_s_MapMode, __pyx_t_13) < 0) __PYX_ERR(39, 1086, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_LGMap); /* "petsc4py/PETSc/IS.pyx":1088 * MapMode = GLMapMode * * Type = LGMapType # <<<<<<<<<<<<<< * # * */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_LGMapType); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 1088, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_LGMap, __pyx_n_s_Type, __pyx_t_13) < 0) __PYX_ERR(39, 1088, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_LGMap); /* "petsc4py/PETSc/IS.pyx":1669 * # -------------------------------------------------------------------- * * del ISType # <<<<<<<<<<<<<< * del GLMapMode * del LGMapType */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_ISType) < 0) __PYX_ERR(39, 1669, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":1670 * * del ISType * del GLMapMode # <<<<<<<<<<<<<< * del LGMapType * # -------------------------------------------------------------------- */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_GLMapMode) < 0) __PYX_ERR(39, 1670, __pyx_L1_error) /* "petsc4py/PETSc/IS.pyx":1671 * del ISType * del GLMapMode * del LGMapType # <<<<<<<<<<<<<< * # -------------------------------------------------------------------- */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_LGMapType) < 0) __PYX_ERR(39, 1671, __pyx_L1_error) /* "petsc4py/PETSc/SF.pyx":3 * # -------------------------------------------------------------------- * * class SFType(object): # <<<<<<<<<<<<<< * BASIC = S_(PETSCSFBASIC) * NEIGHBOR = S_(PETSCSFNEIGHBOR) */ __pyx_t_13 = __Pyx_PEP560_update_bases(__pyx_tuple__123); if (unlikely(!__pyx_t_13)) __PYX_ERR(40, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(40, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_13, __pyx_n_s_SFType, __pyx_n_s_SFType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(40, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_13 != __pyx_tuple__123) { if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_tuple__123) < 0))) __PYX_ERR(40, 3, __pyx_L1_error) } /* "petsc4py/PETSc/SF.pyx":4 * * class SFType(object): * BASIC = S_(PETSCSFBASIC) # <<<<<<<<<<<<<< * NEIGHBOR = S_(PETSCSFNEIGHBOR) * ALLGATHERV = S_(PETSCSFALLGATHERV) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PETSCSFBASIC); if (unlikely(!__pyx_t_11)) __PYX_ERR(40, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_BASIC, __pyx_t_11) < 0) __PYX_ERR(40, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/SF.pyx":5 * class SFType(object): * BASIC = S_(PETSCSFBASIC) * NEIGHBOR = S_(PETSCSFNEIGHBOR) # <<<<<<<<<<<<<< * ALLGATHERV = S_(PETSCSFALLGATHERV) * ALLGATHER = S_(PETSCSFALLGATHER) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PETSCSFNEIGHBOR); if (unlikely(!__pyx_t_11)) __PYX_ERR(40, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_NEIGHBOR, __pyx_t_11) < 0) __PYX_ERR(40, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/SF.pyx":6 * BASIC = S_(PETSCSFBASIC) * NEIGHBOR = S_(PETSCSFNEIGHBOR) * ALLGATHERV = S_(PETSCSFALLGATHERV) # <<<<<<<<<<<<<< * ALLGATHER = S_(PETSCSFALLGATHER) * GATHERV = S_(PETSCSFGATHERV) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PETSCSFALLGATHERV); if (unlikely(!__pyx_t_11)) __PYX_ERR(40, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_ALLGATHERV, __pyx_t_11) < 0) __PYX_ERR(40, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/SF.pyx":7 * NEIGHBOR = S_(PETSCSFNEIGHBOR) * ALLGATHERV = S_(PETSCSFALLGATHERV) * ALLGATHER = S_(PETSCSFALLGATHER) # <<<<<<<<<<<<<< * GATHERV = S_(PETSCSFGATHERV) * GATHER = S_(PETSCSFGATHER) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PETSCSFALLGATHER); if (unlikely(!__pyx_t_11)) __PYX_ERR(40, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_ALLGATHER, __pyx_t_11) < 0) __PYX_ERR(40, 7, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/SF.pyx":8 * ALLGATHERV = S_(PETSCSFALLGATHERV) * ALLGATHER = S_(PETSCSFALLGATHER) * GATHERV = S_(PETSCSFGATHERV) # <<<<<<<<<<<<<< * GATHER = S_(PETSCSFGATHER) * ALLTOALL = S_(PETSCSFALLTOALL) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PETSCSFGATHERV); if (unlikely(!__pyx_t_11)) __PYX_ERR(40, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_GATHERV, __pyx_t_11) < 0) __PYX_ERR(40, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/SF.pyx":9 * ALLGATHER = S_(PETSCSFALLGATHER) * GATHERV = S_(PETSCSFGATHERV) * GATHER = S_(PETSCSFGATHER) # <<<<<<<<<<<<<< * ALLTOALL = S_(PETSCSFALLTOALL) * WINDOW = S_(PETSCSFWINDOW) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PETSCSFGATHER); if (unlikely(!__pyx_t_11)) __PYX_ERR(40, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_GATHER, __pyx_t_11) < 0) __PYX_ERR(40, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/SF.pyx":10 * GATHERV = S_(PETSCSFGATHERV) * GATHER = S_(PETSCSFGATHER) * ALLTOALL = S_(PETSCSFALLTOALL) # <<<<<<<<<<<<<< * WINDOW = S_(PETSCSFWINDOW) * */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PETSCSFALLTOALL); if (unlikely(!__pyx_t_11)) __PYX_ERR(40, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_ALLTOALL, __pyx_t_11) < 0) __PYX_ERR(40, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/SF.pyx":11 * GATHER = S_(PETSCSFGATHER) * ALLTOALL = S_(PETSCSFALLTOALL) * WINDOW = S_(PETSCSFWINDOW) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PETSCSFWINDOW); if (unlikely(!__pyx_t_11)) __PYX_ERR(40, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_WINDOW, __pyx_t_11) < 0) __PYX_ERR(40, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/SF.pyx":3 * # -------------------------------------------------------------------- * * class SFType(object): # <<<<<<<<<<<<<< * BASIC = S_(PETSCSFBASIC) * NEIGHBOR = S_(PETSCSFNEIGHBOR) */ __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_SFType, __pyx_t_13, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(40, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_SFType, __pyx_t_11) < 0) __PYX_ERR(40, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/SF.pyx":23 * """ * * Type = SFType # <<<<<<<<<<<<<< * * def __cinit__(self): */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_SFType); if (unlikely(!__pyx_t_13)) __PYX_ERR(40, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SF, __pyx_n_s_Type, __pyx_t_13) < 0) __PYX_ERR(40, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_SF); /* "petsc4py/PETSc/SF.pyx":713 * # -------------------------------------------------------------------- * * del SFType # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_SFType) < 0) __PYX_ERR(40, 713, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":3 * # -------------------------------------------------------------------- * * class VecType(object): # <<<<<<<<<<<<<< * """The vector type.""" * SEQ = S_(VECSEQ) */ __pyx_t_13 = __Pyx_PEP560_update_bases(__pyx_tuple__125); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(41, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_13, __pyx_n_s_VecType, __pyx_n_s_VecType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, __pyx_kp_s_The_vector_type); if (unlikely(!__pyx_t_12)) __PYX_ERR(41, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_13 != __pyx_tuple__125) { if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_tuple__125) < 0))) __PYX_ERR(41, 3, __pyx_L1_error) } /* "petsc4py/PETSc/Vec.pyx":5 * class VecType(object): * """The vector type.""" * SEQ = S_(VECSEQ) # <<<<<<<<<<<<<< * MPI = S_(VECMPI) * STANDARD = S_(VECSTANDARD) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(VECSEQ); if (unlikely(!__pyx_t_11)) __PYX_ERR(41, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SEQ, __pyx_t_11) < 0) __PYX_ERR(41, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Vec.pyx":6 * """The vector type.""" * SEQ = S_(VECSEQ) * MPI = S_(VECMPI) # <<<<<<<<<<<<<< * STANDARD = S_(VECSTANDARD) * SHARED = S_(VECSHARED) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(VECMPI); if (unlikely(!__pyx_t_11)) __PYX_ERR(41, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_MPI, __pyx_t_11) < 0) __PYX_ERR(41, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Vec.pyx":7 * SEQ = S_(VECSEQ) * MPI = S_(VECMPI) * STANDARD = S_(VECSTANDARD) # <<<<<<<<<<<<<< * SHARED = S_(VECSHARED) * SEQVIENNACL= S_(VECSEQVIENNACL) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(VECSTANDARD); if (unlikely(!__pyx_t_11)) __PYX_ERR(41, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_STANDARD, __pyx_t_11) < 0) __PYX_ERR(41, 7, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Vec.pyx":8 * MPI = S_(VECMPI) * STANDARD = S_(VECSTANDARD) * SHARED = S_(VECSHARED) # <<<<<<<<<<<<<< * SEQVIENNACL= S_(VECSEQVIENNACL) * MPIVIENNACL= S_(VECMPIVIENNACL) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(VECSHARED); if (unlikely(!__pyx_t_11)) __PYX_ERR(41, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SHARED, __pyx_t_11) < 0) __PYX_ERR(41, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Vec.pyx":9 * STANDARD = S_(VECSTANDARD) * SHARED = S_(VECSHARED) * SEQVIENNACL= S_(VECSEQVIENNACL) # <<<<<<<<<<<<<< * MPIVIENNACL= S_(VECMPIVIENNACL) * VIENNACL = S_(VECVIENNACL) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(VECSEQVIENNACL); if (unlikely(!__pyx_t_11)) __PYX_ERR(41, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SEQVIENNACL, __pyx_t_11) < 0) __PYX_ERR(41, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Vec.pyx":10 * SHARED = S_(VECSHARED) * SEQVIENNACL= S_(VECSEQVIENNACL) * MPIVIENNACL= S_(VECMPIVIENNACL) # <<<<<<<<<<<<<< * VIENNACL = S_(VECVIENNACL) * SEQCUDA = S_(VECSEQCUDA) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(VECMPIVIENNACL); if (unlikely(!__pyx_t_11)) __PYX_ERR(41, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_MPIVIENNACL, __pyx_t_11) < 0) __PYX_ERR(41, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Vec.pyx":11 * SEQVIENNACL= S_(VECSEQVIENNACL) * MPIVIENNACL= S_(VECMPIVIENNACL) * VIENNACL = S_(VECVIENNACL) # <<<<<<<<<<<<<< * SEQCUDA = S_(VECSEQCUDA) * MPICUDA = S_(VECMPICUDA) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(VECVIENNACL); if (unlikely(!__pyx_t_11)) __PYX_ERR(41, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_VIENNACL, __pyx_t_11) < 0) __PYX_ERR(41, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Vec.pyx":12 * MPIVIENNACL= S_(VECMPIVIENNACL) * VIENNACL = S_(VECVIENNACL) * SEQCUDA = S_(VECSEQCUDA) # <<<<<<<<<<<<<< * MPICUDA = S_(VECMPICUDA) * CUDA = S_(VECCUDA) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(VECSEQCUDA); if (unlikely(!__pyx_t_11)) __PYX_ERR(41, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SEQCUDA, __pyx_t_11) < 0) __PYX_ERR(41, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Vec.pyx":13 * VIENNACL = S_(VECVIENNACL) * SEQCUDA = S_(VECSEQCUDA) * MPICUDA = S_(VECMPICUDA) # <<<<<<<<<<<<<< * CUDA = S_(VECCUDA) * SEQHIP = S_(VECSEQHIP) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(VECMPICUDA); if (unlikely(!__pyx_t_11)) __PYX_ERR(41, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_MPICUDA, __pyx_t_11) < 0) __PYX_ERR(41, 13, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Vec.pyx":14 * SEQCUDA = S_(VECSEQCUDA) * MPICUDA = S_(VECMPICUDA) * CUDA = S_(VECCUDA) # <<<<<<<<<<<<<< * SEQHIP = S_(VECSEQHIP) * MPIHIP = S_(VECMPIHIP) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(VECCUDA); if (unlikely(!__pyx_t_11)) __PYX_ERR(41, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_CUDA, __pyx_t_11) < 0) __PYX_ERR(41, 14, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Vec.pyx":15 * MPICUDA = S_(VECMPICUDA) * CUDA = S_(VECCUDA) * SEQHIP = S_(VECSEQHIP) # <<<<<<<<<<<<<< * MPIHIP = S_(VECMPIHIP) * HIP = S_(VECHIP) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(VECSEQHIP); if (unlikely(!__pyx_t_11)) __PYX_ERR(41, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SEQHIP, __pyx_t_11) < 0) __PYX_ERR(41, 15, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Vec.pyx":16 * CUDA = S_(VECCUDA) * SEQHIP = S_(VECSEQHIP) * MPIHIP = S_(VECMPIHIP) # <<<<<<<<<<<<<< * HIP = S_(VECHIP) * NEST = S_(VECNEST) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(VECMPIHIP); if (unlikely(!__pyx_t_11)) __PYX_ERR(41, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_MPIHIP, __pyx_t_11) < 0) __PYX_ERR(41, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Vec.pyx":17 * SEQHIP = S_(VECSEQHIP) * MPIHIP = S_(VECMPIHIP) * HIP = S_(VECHIP) # <<<<<<<<<<<<<< * NEST = S_(VECNEST) * SEQKOKKOS = S_(VECSEQKOKKOS) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(VECHIP); if (unlikely(!__pyx_t_11)) __PYX_ERR(41, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_HIP, __pyx_t_11) < 0) __PYX_ERR(41, 17, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Vec.pyx":18 * MPIHIP = S_(VECMPIHIP) * HIP = S_(VECHIP) * NEST = S_(VECNEST) # <<<<<<<<<<<<<< * SEQKOKKOS = S_(VECSEQKOKKOS) * MPIKOKKOS = S_(VECMPIKOKKOS) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(VECNEST); if (unlikely(!__pyx_t_11)) __PYX_ERR(41, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_NEST, __pyx_t_11) < 0) __PYX_ERR(41, 18, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Vec.pyx":19 * HIP = S_(VECHIP) * NEST = S_(VECNEST) * SEQKOKKOS = S_(VECSEQKOKKOS) # <<<<<<<<<<<<<< * MPIKOKKOS = S_(VECMPIKOKKOS) * KOKKOS = S_(VECKOKKOS) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(VECSEQKOKKOS); if (unlikely(!__pyx_t_11)) __PYX_ERR(41, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SEQKOKKOS, __pyx_t_11) < 0) __PYX_ERR(41, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Vec.pyx":20 * NEST = S_(VECNEST) * SEQKOKKOS = S_(VECSEQKOKKOS) * MPIKOKKOS = S_(VECMPIKOKKOS) # <<<<<<<<<<<<<< * KOKKOS = S_(VECKOKKOS) * */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(VECMPIKOKKOS); if (unlikely(!__pyx_t_11)) __PYX_ERR(41, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_MPIKOKKOS, __pyx_t_11) < 0) __PYX_ERR(41, 20, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Vec.pyx":21 * SEQKOKKOS = S_(VECSEQKOKKOS) * MPIKOKKOS = S_(VECMPIKOKKOS) * KOKKOS = S_(VECKOKKOS) # <<<<<<<<<<<<<< * * class VecOption(object): */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(VECKOKKOS); if (unlikely(!__pyx_t_11)) __PYX_ERR(41, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_KOKKOS, __pyx_t_11) < 0) __PYX_ERR(41, 21, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Vec.pyx":3 * # -------------------------------------------------------------------- * * class VecType(object): # <<<<<<<<<<<<<< * """The vector type.""" * SEQ = S_(VECSEQ) */ __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_VecType, __pyx_t_13, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(41, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_VecType, __pyx_t_11) < 0) __PYX_ERR(41, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/Vec.pyx":23 * KOKKOS = S_(VECKOKKOS) * * class VecOption(object): # <<<<<<<<<<<<<< * """Vector assembly option.""" * IGNORE_OFF_PROC_ENTRIES = VEC_IGNORE_OFF_PROC_ENTRIES */ __pyx_t_13 = __Pyx_PEP560_update_bases(__pyx_tuple__127); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(41, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_13, __pyx_n_s_VecOption, __pyx_n_s_VecOption, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, __pyx_kp_s_Vector_assembly_option); if (unlikely(!__pyx_t_12)) __PYX_ERR(41, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_13 != __pyx_tuple__127) { if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_tuple__127) < 0))) __PYX_ERR(41, 23, __pyx_L1_error) } /* "petsc4py/PETSc/Vec.pyx":25 * class VecOption(object): * """Vector assembly option.""" * IGNORE_OFF_PROC_ENTRIES = VEC_IGNORE_OFF_PROC_ENTRIES # <<<<<<<<<<<<<< * IGNORE_NEGATIVE_INDICES = VEC_IGNORE_NEGATIVE_INDICES * */ __pyx_t_11 = __Pyx_PyInt_From_VecOption(VEC_IGNORE_OFF_PROC_ENTRIES); if (unlikely(!__pyx_t_11)) __PYX_ERR(41, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_IGNORE_OFF_PROC_ENTRIES, __pyx_t_11) < 0) __PYX_ERR(41, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Vec.pyx":26 * """Vector assembly option.""" * IGNORE_OFF_PROC_ENTRIES = VEC_IGNORE_OFF_PROC_ENTRIES * IGNORE_NEGATIVE_INDICES = VEC_IGNORE_NEGATIVE_INDICES # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_t_11 = __Pyx_PyInt_From_VecOption(VEC_IGNORE_NEGATIVE_INDICES); if (unlikely(!__pyx_t_11)) __PYX_ERR(41, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_IGNORE_NEGATIVE_INDICES, __pyx_t_11) < 0) __PYX_ERR(41, 26, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Vec.pyx":23 * KOKKOS = S_(VECKOKKOS) * * class VecOption(object): # <<<<<<<<<<<<<< * """Vector assembly option.""" * IGNORE_OFF_PROC_ENTRIES = VEC_IGNORE_OFF_PROC_ENTRIES */ __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_VecOption, __pyx_t_13, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(41, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_VecOption, __pyx_t_11) < 0) __PYX_ERR(41, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/Vec.pyx":38 * """ * * Type = VecType # <<<<<<<<<<<<<< * Option = VecOption * */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_VecType); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_n_s_Type, __pyx_t_13) < 0) __PYX_ERR(41, 38, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Vec); /* "petsc4py/PETSc/Vec.pyx":39 * * Type = VecType * Option = VecOption # <<<<<<<<<<<<<< * * # */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_VecOption); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_n_s_Option, __pyx_t_13) < 0) __PYX_ERR(41, 39, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Vec); /* "petsc4py/PETSc/Vec.pyx":3467 * # -------------------------------------------------------------------- * * del VecType # <<<<<<<<<<<<<< * del VecOption * */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_VecType) < 0) __PYX_ERR(41, 3467, __pyx_L1_error) /* "petsc4py/PETSc/Vec.pyx":3468 * * del VecType * del VecOption # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_VecOption) < 0) __PYX_ERR(41, 3468, __pyx_L1_error) /* "petsc4py/PETSc/FE.pyx":3 * # -------------------------------------------------------------------- * * class FEType(object): # <<<<<<<<<<<<<< * BASIC = S_(PETSCFEBASIC) * OPENCL = S_(PETSCFEOPENCL) */ __pyx_t_13 = __Pyx_PEP560_update_bases(__pyx_tuple__129); if (unlikely(!__pyx_t_13)) __PYX_ERR(43, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(43, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_13, __pyx_n_s_FEType, __pyx_n_s_FEType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(43, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_13 != __pyx_tuple__129) { if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_tuple__129) < 0))) __PYX_ERR(43, 3, __pyx_L1_error) } /* "petsc4py/PETSc/FE.pyx":4 * * class FEType(object): * BASIC = S_(PETSCFEBASIC) # <<<<<<<<<<<<<< * OPENCL = S_(PETSCFEOPENCL) * COMPOSITE = S_(PETSCFECOMPOSITE) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PETSCFEBASIC); if (unlikely(!__pyx_t_11)) __PYX_ERR(43, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_BASIC, __pyx_t_11) < 0) __PYX_ERR(43, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/FE.pyx":5 * class FEType(object): * BASIC = S_(PETSCFEBASIC) * OPENCL = S_(PETSCFEOPENCL) # <<<<<<<<<<<<<< * COMPOSITE = S_(PETSCFECOMPOSITE) * */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PETSCFEOPENCL); if (unlikely(!__pyx_t_11)) __PYX_ERR(43, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_OPENCL, __pyx_t_11) < 0) __PYX_ERR(43, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/FE.pyx":6 * BASIC = S_(PETSCFEBASIC) * OPENCL = S_(PETSCFEOPENCL) * COMPOSITE = S_(PETSCFECOMPOSITE) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PETSCFECOMPOSITE); if (unlikely(!__pyx_t_11)) __PYX_ERR(43, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_COMPOSITE, __pyx_t_11) < 0) __PYX_ERR(43, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/FE.pyx":3 * # -------------------------------------------------------------------- * * class FEType(object): # <<<<<<<<<<<<<< * BASIC = S_(PETSCFEBASIC) * OPENCL = S_(PETSCFEOPENCL) */ __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_FEType, __pyx_t_13, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(43, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_FEType, __pyx_t_11) < 0) __PYX_ERR(43, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/FE.pyx":13 * """A PETSc object that manages a finite element space.""" * * Type = FEType # <<<<<<<<<<<<<< * * def __cinit__(self): */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_FEType); if (unlikely(!__pyx_t_13)) __PYX_ERR(43, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_FE, __pyx_n_s_Type, __pyx_t_13) < 0) __PYX_ERR(43, 13, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_FE); /* "petsc4py/PETSc/FE.pyx":79 * nc: int, * isSimplex: bool, * qorder: int = DETERMINE, # <<<<<<<<<<<<<< * prefix: str = None, * comm: Comm | None = None */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_DETERMINE); if (unlikely(!__pyx_t_13)) __PYX_ERR(43, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_k__49 = __pyx_t_13; __Pyx_GIVEREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/FE.pyx":127 * isSimplex: bool, * k: int, * qorder: int = DETERMINE, # <<<<<<<<<<<<<< * comm: Comm | None = None * ) -> Self: */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_DETERMINE); if (unlikely(!__pyx_t_13)) __PYX_ERR(43, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_k__50 = __pyx_t_13; __Pyx_GIVEREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/FE.pyx":497 * # -------------------------------------------------------------------- * * del FEType # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_FEType) < 0) __PYX_ERR(43, 497, __pyx_L1_error) /* "petsc4py/PETSc/Scatter.pyx":3 * # -------------------------------------------------------------------- * * class ScatterType(object): # <<<<<<<<<<<<<< * """Scatter type. * */ __pyx_t_13 = __Pyx_PEP560_update_bases(__pyx_tuple__131); if (unlikely(!__pyx_t_13)) __PYX_ERR(44, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(44, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_13, __pyx_n_s_ScatterType, __pyx_n_s_ScatterType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, __pyx_kp_s_Scatter_type_See_Also_petsc_VecS); if (unlikely(!__pyx_t_12)) __PYX_ERR(44, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_13 != __pyx_tuple__131) { if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_tuple__131) < 0))) __PYX_ERR(44, 3, __pyx_L1_error) } /* "petsc4py/PETSc/Scatter.pyx":11 * * """ * BASIC = S_(PETSCSFBASIC) # <<<<<<<<<<<<<< * NEIGHBOR = S_(PETSCSFNEIGHBOR) * ALLGATHERV = S_(PETSCSFALLGATHERV) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PETSCSFBASIC); if (unlikely(!__pyx_t_11)) __PYX_ERR(44, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_BASIC, __pyx_t_11) < 0) __PYX_ERR(44, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Scatter.pyx":12 * """ * BASIC = S_(PETSCSFBASIC) * NEIGHBOR = S_(PETSCSFNEIGHBOR) # <<<<<<<<<<<<<< * ALLGATHERV = S_(PETSCSFALLGATHERV) * ALLGATHER = S_(PETSCSFALLGATHER) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PETSCSFNEIGHBOR); if (unlikely(!__pyx_t_11)) __PYX_ERR(44, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_NEIGHBOR, __pyx_t_11) < 0) __PYX_ERR(44, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Scatter.pyx":13 * BASIC = S_(PETSCSFBASIC) * NEIGHBOR = S_(PETSCSFNEIGHBOR) * ALLGATHERV = S_(PETSCSFALLGATHERV) # <<<<<<<<<<<<<< * ALLGATHER = S_(PETSCSFALLGATHER) * GATHERV = S_(PETSCSFGATHERV) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PETSCSFALLGATHERV); if (unlikely(!__pyx_t_11)) __PYX_ERR(44, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_ALLGATHERV, __pyx_t_11) < 0) __PYX_ERR(44, 13, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Scatter.pyx":14 * NEIGHBOR = S_(PETSCSFNEIGHBOR) * ALLGATHERV = S_(PETSCSFALLGATHERV) * ALLGATHER = S_(PETSCSFALLGATHER) # <<<<<<<<<<<<<< * GATHERV = S_(PETSCSFGATHERV) * GATHER = S_(PETSCSFGATHER) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PETSCSFALLGATHER); if (unlikely(!__pyx_t_11)) __PYX_ERR(44, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_ALLGATHER, __pyx_t_11) < 0) __PYX_ERR(44, 14, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Scatter.pyx":15 * ALLGATHERV = S_(PETSCSFALLGATHERV) * ALLGATHER = S_(PETSCSFALLGATHER) * GATHERV = S_(PETSCSFGATHERV) # <<<<<<<<<<<<<< * GATHER = S_(PETSCSFGATHER) * ALLTOALL = S_(PETSCSFALLTOALL) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PETSCSFGATHERV); if (unlikely(!__pyx_t_11)) __PYX_ERR(44, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_GATHERV, __pyx_t_11) < 0) __PYX_ERR(44, 15, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Scatter.pyx":16 * ALLGATHER = S_(PETSCSFALLGATHER) * GATHERV = S_(PETSCSFGATHERV) * GATHER = S_(PETSCSFGATHER) # <<<<<<<<<<<<<< * ALLTOALL = S_(PETSCSFALLTOALL) * WINDOW = S_(PETSCSFWINDOW) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PETSCSFGATHER); if (unlikely(!__pyx_t_11)) __PYX_ERR(44, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_GATHER, __pyx_t_11) < 0) __PYX_ERR(44, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Scatter.pyx":17 * GATHERV = S_(PETSCSFGATHERV) * GATHER = S_(PETSCSFGATHER) * ALLTOALL = S_(PETSCSFALLTOALL) # <<<<<<<<<<<<<< * WINDOW = S_(PETSCSFWINDOW) * */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PETSCSFALLTOALL); if (unlikely(!__pyx_t_11)) __PYX_ERR(44, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_ALLTOALL, __pyx_t_11) < 0) __PYX_ERR(44, 17, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Scatter.pyx":18 * GATHER = S_(PETSCSFGATHER) * ALLTOALL = S_(PETSCSFALLTOALL) * WINDOW = S_(PETSCSFWINDOW) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PETSCSFWINDOW); if (unlikely(!__pyx_t_11)) __PYX_ERR(44, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_WINDOW, __pyx_t_11) < 0) __PYX_ERR(44, 18, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Scatter.pyx":3 * # -------------------------------------------------------------------- * * class ScatterType(object): # <<<<<<<<<<<<<< * """Scatter type. * */ __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_ScatterType, __pyx_t_13, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(44, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_ScatterType, __pyx_t_11) < 0) __PYX_ERR(44, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/Scatter.pyx":35 * * * Type = ScatterType # <<<<<<<<<<<<<< * Mode = ScatterMode * */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_ScatterType); if (unlikely(!__pyx_t_13)) __PYX_ERR(44, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Scatter, __pyx_n_s_Type, __pyx_t_13) < 0) __PYX_ERR(44, 35, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Scatter); /* "petsc4py/PETSc/Scatter.pyx":36 * * Type = ScatterType * Mode = ScatterMode # <<<<<<<<<<<<<< * * # */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_ScatterMode); if (unlikely(!__pyx_t_13)) __PYX_ERR(44, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Scatter, __pyx_n_s_Mode, __pyx_t_13) < 0) __PYX_ERR(44, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Scatter); /* "petsc4py/PETSc/Scatter.pyx":206 * return scatter * * @classmethod # <<<<<<<<<<<<<< * def toAll(cls, Vec vec) -> tuple[Scatter, Vec]: * """Create a scatter that communicates a vector to all sharing processes. */ __Pyx_GetNameInClass(__pyx_t_13, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Scatter, __pyx_n_s_toAll); if (unlikely(!__pyx_t_13)) __PYX_ERR(44, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_Method_ClassMethod(__pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(44, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Scatter, __pyx_n_s_toAll, __pyx_t_10) < 0) __PYX_ERR(44, 206, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Scatter); /* "petsc4py/PETSc/Scatter.pyx":234 * return (scatter, ovec) * * @classmethod # <<<<<<<<<<<<<< * def toZero(cls, Vec vec) -> tuple[Scatter, Vec]: * """Create a scatter that communicates a vector to rank zero. */ __Pyx_GetNameInClass(__pyx_t_10, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Scatter, __pyx_n_s_toZero); if (unlikely(!__pyx_t_10)) __PYX_ERR(44, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_13 = __Pyx_Method_ClassMethod(__pyx_t_10); if (unlikely(!__pyx_t_13)) __PYX_ERR(44, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Scatter, __pyx_n_s_toZero, __pyx_t_13) < 0) __PYX_ERR(44, 234, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Scatter); /* "petsc4py/PETSc/Scatter.pyx":345 * caddv, csctm) ) * * scatterBegin = begin # <<<<<<<<<<<<<< * scatterEnd = end * */ __Pyx_GetNameInClass(__pyx_t_13, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Scatter, __pyx_n_s_begin); if (unlikely(!__pyx_t_13)) __PYX_ERR(44, 345, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Scatter, __pyx_n_s_scatterBegin, __pyx_t_13) < 0) __PYX_ERR(44, 345, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Scatter); /* "petsc4py/PETSc/Scatter.pyx":346 * * scatterBegin = begin * scatterEnd = end # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_GetNameInClass(__pyx_t_13, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Scatter, __pyx_n_s_end); if (unlikely(!__pyx_t_13)) __PYX_ERR(44, 346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Scatter, __pyx_n_s_scatterEnd, __pyx_t_13) < 0) __PYX_ERR(44, 346, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Scatter); /* "petsc4py/PETSc/Scatter.pyx":350 * # -------------------------------------------------------------------- * * del ScatterType # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_ScatterType) < 0) __PYX_ERR(44, 350, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":3 * # -------------------------------------------------------------------- * * class MatType(object): # <<<<<<<<<<<<<< * """Matrix type. * */ __pyx_t_13 = __Pyx_PEP560_update_bases(__pyx_tuple__133); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(46, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_13, __pyx_n_s_MatType, __pyx_n_s_MatType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, __pyx_kp_s_Matrix_type_See_Also_petsc_MatTy); if (unlikely(!__pyx_t_12)) __PYX_ERR(46, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_13 != __pyx_tuple__133) { if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_tuple__133) < 0))) __PYX_ERR(46, 3, __pyx_L1_error) } /* "petsc4py/PETSc/Mat.pyx":11 * * """ * SAME = S_(MATSAME) # <<<<<<<<<<<<<< * MAIJ = S_(MATMAIJ) * SEQMAIJ = S_(MATSEQMAIJ) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATSAME); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SAME, __pyx_t_11) < 0) __PYX_ERR(46, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":12 * """ * SAME = S_(MATSAME) * MAIJ = S_(MATMAIJ) # <<<<<<<<<<<<<< * SEQMAIJ = S_(MATSEQMAIJ) * MPIMAIJ = S_(MATMPIMAIJ) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATMAIJ); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_MAIJ, __pyx_t_11) < 0) __PYX_ERR(46, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":13 * SAME = S_(MATSAME) * MAIJ = S_(MATMAIJ) * SEQMAIJ = S_(MATSEQMAIJ) # <<<<<<<<<<<<<< * MPIMAIJ = S_(MATMPIMAIJ) * KAIJ = S_(MATKAIJ) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATSEQMAIJ); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SEQMAIJ, __pyx_t_11) < 0) __PYX_ERR(46, 13, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":14 * MAIJ = S_(MATMAIJ) * SEQMAIJ = S_(MATSEQMAIJ) * MPIMAIJ = S_(MATMPIMAIJ) # <<<<<<<<<<<<<< * KAIJ = S_(MATKAIJ) * SEQKAIJ = S_(MATSEQKAIJ) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATMPIMAIJ); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_MPIMAIJ, __pyx_t_11) < 0) __PYX_ERR(46, 14, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":15 * SEQMAIJ = S_(MATSEQMAIJ) * MPIMAIJ = S_(MATMPIMAIJ) * KAIJ = S_(MATKAIJ) # <<<<<<<<<<<<<< * SEQKAIJ = S_(MATSEQKAIJ) * MPIKAIJ = S_(MATMPIKAIJ) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATKAIJ); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_KAIJ, __pyx_t_11) < 0) __PYX_ERR(46, 15, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":16 * MPIMAIJ = S_(MATMPIMAIJ) * KAIJ = S_(MATKAIJ) * SEQKAIJ = S_(MATSEQKAIJ) # <<<<<<<<<<<<<< * MPIKAIJ = S_(MATMPIKAIJ) * IS = S_(MATIS) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATSEQKAIJ); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SEQKAIJ, __pyx_t_11) < 0) __PYX_ERR(46, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":17 * KAIJ = S_(MATKAIJ) * SEQKAIJ = S_(MATSEQKAIJ) * MPIKAIJ = S_(MATMPIKAIJ) # <<<<<<<<<<<<<< * IS = S_(MATIS) * AIJ = S_(MATAIJ) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATMPIKAIJ); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_MPIKAIJ, __pyx_t_11) < 0) __PYX_ERR(46, 17, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":18 * SEQKAIJ = S_(MATSEQKAIJ) * MPIKAIJ = S_(MATMPIKAIJ) * IS = S_(MATIS) # <<<<<<<<<<<<<< * AIJ = S_(MATAIJ) * SEQAIJ = S_(MATSEQAIJ) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATIS); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_IS, __pyx_t_11) < 0) __PYX_ERR(46, 18, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":19 * MPIKAIJ = S_(MATMPIKAIJ) * IS = S_(MATIS) * AIJ = S_(MATAIJ) # <<<<<<<<<<<<<< * SEQAIJ = S_(MATSEQAIJ) * MPIAIJ = S_(MATMPIAIJ) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATAIJ); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_AIJ, __pyx_t_11) < 0) __PYX_ERR(46, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":20 * IS = S_(MATIS) * AIJ = S_(MATAIJ) * SEQAIJ = S_(MATSEQAIJ) # <<<<<<<<<<<<<< * MPIAIJ = S_(MATMPIAIJ) * AIJCRL = S_(MATAIJCRL) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATSEQAIJ); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SEQAIJ, __pyx_t_11) < 0) __PYX_ERR(46, 20, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":21 * AIJ = S_(MATAIJ) * SEQAIJ = S_(MATSEQAIJ) * MPIAIJ = S_(MATMPIAIJ) # <<<<<<<<<<<<<< * AIJCRL = S_(MATAIJCRL) * SEQAIJCRL = S_(MATSEQAIJCRL) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATMPIAIJ); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_MPIAIJ, __pyx_t_11) < 0) __PYX_ERR(46, 21, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":22 * SEQAIJ = S_(MATSEQAIJ) * MPIAIJ = S_(MATMPIAIJ) * AIJCRL = S_(MATAIJCRL) # <<<<<<<<<<<<<< * SEQAIJCRL = S_(MATSEQAIJCRL) * MPIAIJCRL = S_(MATMPIAIJCRL) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATAIJCRL); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_AIJCRL, __pyx_t_11) < 0) __PYX_ERR(46, 22, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":23 * MPIAIJ = S_(MATMPIAIJ) * AIJCRL = S_(MATAIJCRL) * SEQAIJCRL = S_(MATSEQAIJCRL) # <<<<<<<<<<<<<< * MPIAIJCRL = S_(MATMPIAIJCRL) * AIJCUSPARSE = S_(MATAIJCUSPARSE) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATSEQAIJCRL); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SEQAIJCRL, __pyx_t_11) < 0) __PYX_ERR(46, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":24 * AIJCRL = S_(MATAIJCRL) * SEQAIJCRL = S_(MATSEQAIJCRL) * MPIAIJCRL = S_(MATMPIAIJCRL) # <<<<<<<<<<<<<< * AIJCUSPARSE = S_(MATAIJCUSPARSE) * SEQAIJCUSPARSE = S_(MATSEQAIJCUSPARSE) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATMPIAIJCRL); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_MPIAIJCRL, __pyx_t_11) < 0) __PYX_ERR(46, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":25 * SEQAIJCRL = S_(MATSEQAIJCRL) * MPIAIJCRL = S_(MATMPIAIJCRL) * AIJCUSPARSE = S_(MATAIJCUSPARSE) # <<<<<<<<<<<<<< * SEQAIJCUSPARSE = S_(MATSEQAIJCUSPARSE) * MPIAIJCUSPARSE = S_(MATMPIAIJCUSPARSE) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATAIJCUSPARSE); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_AIJCUSPARSE, __pyx_t_11) < 0) __PYX_ERR(46, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":26 * MPIAIJCRL = S_(MATMPIAIJCRL) * AIJCUSPARSE = S_(MATAIJCUSPARSE) * SEQAIJCUSPARSE = S_(MATSEQAIJCUSPARSE) # <<<<<<<<<<<<<< * MPIAIJCUSPARSE = S_(MATMPIAIJCUSPARSE) * AIJVIENNACL = S_(MATAIJVIENNACL) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATSEQAIJCUSPARSE); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SEQAIJCUSPARSE, __pyx_t_11) < 0) __PYX_ERR(46, 26, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":27 * AIJCUSPARSE = S_(MATAIJCUSPARSE) * SEQAIJCUSPARSE = S_(MATSEQAIJCUSPARSE) * MPIAIJCUSPARSE = S_(MATMPIAIJCUSPARSE) # <<<<<<<<<<<<<< * AIJVIENNACL = S_(MATAIJVIENNACL) * SEQAIJVIENNACL = S_(MATSEQAIJVIENNACL) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATMPIAIJCUSPARSE); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_MPIAIJCUSPARSE, __pyx_t_11) < 0) __PYX_ERR(46, 27, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":28 * SEQAIJCUSPARSE = S_(MATSEQAIJCUSPARSE) * MPIAIJCUSPARSE = S_(MATMPIAIJCUSPARSE) * AIJVIENNACL = S_(MATAIJVIENNACL) # <<<<<<<<<<<<<< * SEQAIJVIENNACL = S_(MATSEQAIJVIENNACL) * MPIAIJVIENNACL = S_(MATMPIAIJVIENNACL) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATAIJVIENNACL); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_AIJVIENNACL, __pyx_t_11) < 0) __PYX_ERR(46, 28, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":29 * MPIAIJCUSPARSE = S_(MATMPIAIJCUSPARSE) * AIJVIENNACL = S_(MATAIJVIENNACL) * SEQAIJVIENNACL = S_(MATSEQAIJVIENNACL) # <<<<<<<<<<<<<< * MPIAIJVIENNACL = S_(MATMPIAIJVIENNACL) * AIJPERM = S_(MATAIJPERM) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATSEQAIJVIENNACL); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SEQAIJVIENNACL, __pyx_t_11) < 0) __PYX_ERR(46, 29, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":30 * AIJVIENNACL = S_(MATAIJVIENNACL) * SEQAIJVIENNACL = S_(MATSEQAIJVIENNACL) * MPIAIJVIENNACL = S_(MATMPIAIJVIENNACL) # <<<<<<<<<<<<<< * AIJPERM = S_(MATAIJPERM) * SEQAIJPERM = S_(MATSEQAIJPERM) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATMPIAIJVIENNACL); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_MPIAIJVIENNACL, __pyx_t_11) < 0) __PYX_ERR(46, 30, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":31 * SEQAIJVIENNACL = S_(MATSEQAIJVIENNACL) * MPIAIJVIENNACL = S_(MATMPIAIJVIENNACL) * AIJPERM = S_(MATAIJPERM) # <<<<<<<<<<<<<< * SEQAIJPERM = S_(MATSEQAIJPERM) * MPIAIJPERM = S_(MATMPIAIJPERM) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATAIJPERM); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_AIJPERM, __pyx_t_11) < 0) __PYX_ERR(46, 31, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":32 * MPIAIJVIENNACL = S_(MATMPIAIJVIENNACL) * AIJPERM = S_(MATAIJPERM) * SEQAIJPERM = S_(MATSEQAIJPERM) # <<<<<<<<<<<<<< * MPIAIJPERM = S_(MATMPIAIJPERM) * AIJSELL = S_(MATAIJSELL) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATSEQAIJPERM); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SEQAIJPERM, __pyx_t_11) < 0) __PYX_ERR(46, 32, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":33 * AIJPERM = S_(MATAIJPERM) * SEQAIJPERM = S_(MATSEQAIJPERM) * MPIAIJPERM = S_(MATMPIAIJPERM) # <<<<<<<<<<<<<< * AIJSELL = S_(MATAIJSELL) * SEQAIJSELL = S_(MATSEQAIJSELL) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATMPIAIJPERM); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_MPIAIJPERM, __pyx_t_11) < 0) __PYX_ERR(46, 33, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":34 * SEQAIJPERM = S_(MATSEQAIJPERM) * MPIAIJPERM = S_(MATMPIAIJPERM) * AIJSELL = S_(MATAIJSELL) # <<<<<<<<<<<<<< * SEQAIJSELL = S_(MATSEQAIJSELL) * MPIAIJSELL = S_(MATMPIAIJSELL) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATAIJSELL); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_AIJSELL, __pyx_t_11) < 0) __PYX_ERR(46, 34, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":35 * MPIAIJPERM = S_(MATMPIAIJPERM) * AIJSELL = S_(MATAIJSELL) * SEQAIJSELL = S_(MATSEQAIJSELL) # <<<<<<<<<<<<<< * MPIAIJSELL = S_(MATMPIAIJSELL) * AIJMKL = S_(MATAIJMKL) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATSEQAIJSELL); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SEQAIJSELL, __pyx_t_11) < 0) __PYX_ERR(46, 35, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":36 * AIJSELL = S_(MATAIJSELL) * SEQAIJSELL = S_(MATSEQAIJSELL) * MPIAIJSELL = S_(MATMPIAIJSELL) # <<<<<<<<<<<<<< * AIJMKL = S_(MATAIJMKL) * SEQAIJMKL = S_(MATSEQAIJMKL) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATMPIAIJSELL); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_MPIAIJSELL, __pyx_t_11) < 0) __PYX_ERR(46, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":37 * SEQAIJSELL = S_(MATSEQAIJSELL) * MPIAIJSELL = S_(MATMPIAIJSELL) * AIJMKL = S_(MATAIJMKL) # <<<<<<<<<<<<<< * SEQAIJMKL = S_(MATSEQAIJMKL) * MPIAIJMKL = S_(MATMPIAIJMKL) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATAIJMKL); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_AIJMKL, __pyx_t_11) < 0) __PYX_ERR(46, 37, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":38 * MPIAIJSELL = S_(MATMPIAIJSELL) * AIJMKL = S_(MATAIJMKL) * SEQAIJMKL = S_(MATSEQAIJMKL) # <<<<<<<<<<<<<< * MPIAIJMKL = S_(MATMPIAIJMKL) * BAIJMKL = S_(MATBAIJMKL) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATSEQAIJMKL); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SEQAIJMKL, __pyx_t_11) < 0) __PYX_ERR(46, 38, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":39 * AIJMKL = S_(MATAIJMKL) * SEQAIJMKL = S_(MATSEQAIJMKL) * MPIAIJMKL = S_(MATMPIAIJMKL) # <<<<<<<<<<<<<< * BAIJMKL = S_(MATBAIJMKL) * SEQBAIJMKL = S_(MATSEQBAIJMKL) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATMPIAIJMKL); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_MPIAIJMKL, __pyx_t_11) < 0) __PYX_ERR(46, 39, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":40 * SEQAIJMKL = S_(MATSEQAIJMKL) * MPIAIJMKL = S_(MATMPIAIJMKL) * BAIJMKL = S_(MATBAIJMKL) # <<<<<<<<<<<<<< * SEQBAIJMKL = S_(MATSEQBAIJMKL) * MPIBAIJMKL = S_(MATMPIBAIJMKL) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATBAIJMKL); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_BAIJMKL, __pyx_t_11) < 0) __PYX_ERR(46, 40, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":41 * MPIAIJMKL = S_(MATMPIAIJMKL) * BAIJMKL = S_(MATBAIJMKL) * SEQBAIJMKL = S_(MATSEQBAIJMKL) # <<<<<<<<<<<<<< * MPIBAIJMKL = S_(MATMPIBAIJMKL) * SHELL = S_(MATSHELL) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATSEQBAIJMKL); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SEQBAIJMKL, __pyx_t_11) < 0) __PYX_ERR(46, 41, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":42 * BAIJMKL = S_(MATBAIJMKL) * SEQBAIJMKL = S_(MATSEQBAIJMKL) * MPIBAIJMKL = S_(MATMPIBAIJMKL) # <<<<<<<<<<<<<< * SHELL = S_(MATSHELL) * DENSE = S_(MATDENSE) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATMPIBAIJMKL); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_MPIBAIJMKL, __pyx_t_11) < 0) __PYX_ERR(46, 42, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":43 * SEQBAIJMKL = S_(MATSEQBAIJMKL) * MPIBAIJMKL = S_(MATMPIBAIJMKL) * SHELL = S_(MATSHELL) # <<<<<<<<<<<<<< * DENSE = S_(MATDENSE) * DENSECUDA = S_(MATDENSECUDA) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATSHELL); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SHELL, __pyx_t_11) < 0) __PYX_ERR(46, 43, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":44 * MPIBAIJMKL = S_(MATMPIBAIJMKL) * SHELL = S_(MATSHELL) * DENSE = S_(MATDENSE) # <<<<<<<<<<<<<< * DENSECUDA = S_(MATDENSECUDA) * SEQDENSE = S_(MATSEQDENSE) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATDENSE); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DENSE, __pyx_t_11) < 0) __PYX_ERR(46, 44, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":45 * SHELL = S_(MATSHELL) * DENSE = S_(MATDENSE) * DENSECUDA = S_(MATDENSECUDA) # <<<<<<<<<<<<<< * SEQDENSE = S_(MATSEQDENSE) * SEQDENSECUDA = S_(MATSEQDENSECUDA) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATDENSECUDA); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DENSECUDA, __pyx_t_11) < 0) __PYX_ERR(46, 45, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":46 * DENSE = S_(MATDENSE) * DENSECUDA = S_(MATDENSECUDA) * SEQDENSE = S_(MATSEQDENSE) # <<<<<<<<<<<<<< * SEQDENSECUDA = S_(MATSEQDENSECUDA) * MPIDENSE = S_(MATMPIDENSE) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATSEQDENSE); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SEQDENSE, __pyx_t_11) < 0) __PYX_ERR(46, 46, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":47 * DENSECUDA = S_(MATDENSECUDA) * SEQDENSE = S_(MATSEQDENSE) * SEQDENSECUDA = S_(MATSEQDENSECUDA) # <<<<<<<<<<<<<< * MPIDENSE = S_(MATMPIDENSE) * MPIDENSECUDA = S_(MATMPIDENSECUDA) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATSEQDENSECUDA); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SEQDENSECUDA, __pyx_t_11) < 0) __PYX_ERR(46, 47, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":48 * SEQDENSE = S_(MATSEQDENSE) * SEQDENSECUDA = S_(MATSEQDENSECUDA) * MPIDENSE = S_(MATMPIDENSE) # <<<<<<<<<<<<<< * MPIDENSECUDA = S_(MATMPIDENSECUDA) * ELEMENTAL = S_(MATELEMENTAL) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATMPIDENSE); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_MPIDENSE, __pyx_t_11) < 0) __PYX_ERR(46, 48, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":49 * SEQDENSECUDA = S_(MATSEQDENSECUDA) * MPIDENSE = S_(MATMPIDENSE) * MPIDENSECUDA = S_(MATMPIDENSECUDA) # <<<<<<<<<<<<<< * ELEMENTAL = S_(MATELEMENTAL) * BAIJ = S_(MATBAIJ) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATMPIDENSECUDA); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_MPIDENSECUDA, __pyx_t_11) < 0) __PYX_ERR(46, 49, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":50 * MPIDENSE = S_(MATMPIDENSE) * MPIDENSECUDA = S_(MATMPIDENSECUDA) * ELEMENTAL = S_(MATELEMENTAL) # <<<<<<<<<<<<<< * BAIJ = S_(MATBAIJ) * SEQBAIJ = S_(MATSEQBAIJ) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATELEMENTAL); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_ELEMENTAL, __pyx_t_11) < 0) __PYX_ERR(46, 50, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":51 * MPIDENSECUDA = S_(MATMPIDENSECUDA) * ELEMENTAL = S_(MATELEMENTAL) * BAIJ = S_(MATBAIJ) # <<<<<<<<<<<<<< * SEQBAIJ = S_(MATSEQBAIJ) * MPIBAIJ = S_(MATMPIBAIJ) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATBAIJ); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_BAIJ, __pyx_t_11) < 0) __PYX_ERR(46, 51, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":52 * ELEMENTAL = S_(MATELEMENTAL) * BAIJ = S_(MATBAIJ) * SEQBAIJ = S_(MATSEQBAIJ) # <<<<<<<<<<<<<< * MPIBAIJ = S_(MATMPIBAIJ) * MPIADJ = S_(MATMPIADJ) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATSEQBAIJ); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SEQBAIJ, __pyx_t_11) < 0) __PYX_ERR(46, 52, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":53 * BAIJ = S_(MATBAIJ) * SEQBAIJ = S_(MATSEQBAIJ) * MPIBAIJ = S_(MATMPIBAIJ) # <<<<<<<<<<<<<< * MPIADJ = S_(MATMPIADJ) * SBAIJ = S_(MATSBAIJ) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATMPIBAIJ); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_MPIBAIJ, __pyx_t_11) < 0) __PYX_ERR(46, 53, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":54 * SEQBAIJ = S_(MATSEQBAIJ) * MPIBAIJ = S_(MATMPIBAIJ) * MPIADJ = S_(MATMPIADJ) # <<<<<<<<<<<<<< * SBAIJ = S_(MATSBAIJ) * SEQSBAIJ = S_(MATSEQSBAIJ) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATMPIADJ); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_MPIADJ, __pyx_t_11) < 0) __PYX_ERR(46, 54, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":55 * MPIBAIJ = S_(MATMPIBAIJ) * MPIADJ = S_(MATMPIADJ) * SBAIJ = S_(MATSBAIJ) # <<<<<<<<<<<<<< * SEQSBAIJ = S_(MATSEQSBAIJ) * MPISBAIJ = S_(MATMPISBAIJ) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATSBAIJ); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SBAIJ, __pyx_t_11) < 0) __PYX_ERR(46, 55, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":56 * MPIADJ = S_(MATMPIADJ) * SBAIJ = S_(MATSBAIJ) * SEQSBAIJ = S_(MATSEQSBAIJ) # <<<<<<<<<<<<<< * MPISBAIJ = S_(MATMPISBAIJ) * MFFD = S_(MATMFFD) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATSEQSBAIJ); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SEQSBAIJ, __pyx_t_11) < 0) __PYX_ERR(46, 56, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":57 * SBAIJ = S_(MATSBAIJ) * SEQSBAIJ = S_(MATSEQSBAIJ) * MPISBAIJ = S_(MATMPISBAIJ) # <<<<<<<<<<<<<< * MFFD = S_(MATMFFD) * NORMAL = S_(MATNORMAL) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATMPISBAIJ); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_MPISBAIJ, __pyx_t_11) < 0) __PYX_ERR(46, 57, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":58 * SEQSBAIJ = S_(MATSEQSBAIJ) * MPISBAIJ = S_(MATMPISBAIJ) * MFFD = S_(MATMFFD) # <<<<<<<<<<<<<< * NORMAL = S_(MATNORMAL) * NORMALHERMITIAN = S_(MATNORMALHERMITIAN) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATMFFD); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_MFFD, __pyx_t_11) < 0) __PYX_ERR(46, 58, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":59 * MPISBAIJ = S_(MATMPISBAIJ) * MFFD = S_(MATMFFD) * NORMAL = S_(MATNORMAL) # <<<<<<<<<<<<<< * NORMALHERMITIAN = S_(MATNORMALHERMITIAN) * LRC = S_(MATLRC) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATNORMAL); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_NORMAL, __pyx_t_11) < 0) __PYX_ERR(46, 59, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":60 * MFFD = S_(MATMFFD) * NORMAL = S_(MATNORMAL) * NORMALHERMITIAN = S_(MATNORMALHERMITIAN) # <<<<<<<<<<<<<< * LRC = S_(MATLRC) * SCATTER = S_(MATSCATTER) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATNORMALHERMITIAN); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_NORMALHERMITIAN, __pyx_t_11) < 0) __PYX_ERR(46, 60, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":61 * NORMAL = S_(MATNORMAL) * NORMALHERMITIAN = S_(MATNORMALHERMITIAN) * LRC = S_(MATLRC) # <<<<<<<<<<<<<< * SCATTER = S_(MATSCATTER) * BLOCKMAT = S_(MATBLOCKMAT) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATLRC); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_LRC, __pyx_t_11) < 0) __PYX_ERR(46, 61, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":62 * NORMALHERMITIAN = S_(MATNORMALHERMITIAN) * LRC = S_(MATLRC) * SCATTER = S_(MATSCATTER) # <<<<<<<<<<<<<< * BLOCKMAT = S_(MATBLOCKMAT) * COMPOSITE = S_(MATCOMPOSITE) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATSCATTER); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SCATTER, __pyx_t_11) < 0) __PYX_ERR(46, 62, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":63 * LRC = S_(MATLRC) * SCATTER = S_(MATSCATTER) * BLOCKMAT = S_(MATBLOCKMAT) # <<<<<<<<<<<<<< * COMPOSITE = S_(MATCOMPOSITE) * FFT = S_(MATFFT) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATBLOCKMAT); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_BLOCKMAT, __pyx_t_11) < 0) __PYX_ERR(46, 63, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":64 * SCATTER = S_(MATSCATTER) * BLOCKMAT = S_(MATBLOCKMAT) * COMPOSITE = S_(MATCOMPOSITE) # <<<<<<<<<<<<<< * FFT = S_(MATFFT) * FFTW = S_(MATFFTW) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATCOMPOSITE); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_COMPOSITE, __pyx_t_11) < 0) __PYX_ERR(46, 64, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":65 * BLOCKMAT = S_(MATBLOCKMAT) * COMPOSITE = S_(MATCOMPOSITE) * FFT = S_(MATFFT) # <<<<<<<<<<<<<< * FFTW = S_(MATFFTW) * SEQCUFFT = S_(MATSEQCUFFT) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATFFT); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_FFT, __pyx_t_11) < 0) __PYX_ERR(46, 65, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":66 * COMPOSITE = S_(MATCOMPOSITE) * FFT = S_(MATFFT) * FFTW = S_(MATFFTW) # <<<<<<<<<<<<<< * SEQCUFFT = S_(MATSEQCUFFT) * TRANSPOSE = S_(MATTRANSPOSEVIRTUAL) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATFFTW); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_FFTW, __pyx_t_11) < 0) __PYX_ERR(46, 66, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":67 * FFT = S_(MATFFT) * FFTW = S_(MATFFTW) * SEQCUFFT = S_(MATSEQCUFFT) # <<<<<<<<<<<<<< * TRANSPOSE = S_(MATTRANSPOSEVIRTUAL) * HERMITIANTRANSPOSE = S_(MATHERMITIANTRANSPOSEVIRTUAL) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATSEQCUFFT); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SEQCUFFT, __pyx_t_11) < 0) __PYX_ERR(46, 67, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":68 * FFTW = S_(MATFFTW) * SEQCUFFT = S_(MATSEQCUFFT) * TRANSPOSE = S_(MATTRANSPOSEVIRTUAL) # <<<<<<<<<<<<<< * HERMITIANTRANSPOSE = S_(MATHERMITIANTRANSPOSEVIRTUAL) * SCHURCOMPLEMENT = S_(MATSCHURCOMPLEMENT) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATTRANSPOSEVIRTUAL); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_TRANSPOSE, __pyx_t_11) < 0) __PYX_ERR(46, 68, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":69 * SEQCUFFT = S_(MATSEQCUFFT) * TRANSPOSE = S_(MATTRANSPOSEVIRTUAL) * HERMITIANTRANSPOSE = S_(MATHERMITIANTRANSPOSEVIRTUAL) # <<<<<<<<<<<<<< * SCHURCOMPLEMENT = S_(MATSCHURCOMPLEMENT) * PYTHON = S_(MATPYTHON) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATHERMITIANTRANSPOSEVIRTUAL); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_HERMITIANTRANSPOSE, __pyx_t_11) < 0) __PYX_ERR(46, 69, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":70 * TRANSPOSE = S_(MATTRANSPOSEVIRTUAL) * HERMITIANTRANSPOSE = S_(MATHERMITIANTRANSPOSEVIRTUAL) * SCHURCOMPLEMENT = S_(MATSCHURCOMPLEMENT) # <<<<<<<<<<<<<< * PYTHON = S_(MATPYTHON) * HYPRE = S_(MATHYPRE) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATSCHURCOMPLEMENT); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SCHURCOMPLEMENT, __pyx_t_11) < 0) __PYX_ERR(46, 70, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":71 * HERMITIANTRANSPOSE = S_(MATHERMITIANTRANSPOSEVIRTUAL) * SCHURCOMPLEMENT = S_(MATSCHURCOMPLEMENT) * PYTHON = S_(MATPYTHON) # <<<<<<<<<<<<<< * HYPRE = S_(MATHYPRE) * HYPRESTRUCT = S_(MATHYPRESTRUCT) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATPYTHON); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_PYTHON, __pyx_t_11) < 0) __PYX_ERR(46, 71, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":72 * SCHURCOMPLEMENT = S_(MATSCHURCOMPLEMENT) * PYTHON = S_(MATPYTHON) * HYPRE = S_(MATHYPRE) # <<<<<<<<<<<<<< * HYPRESTRUCT = S_(MATHYPRESTRUCT) * HYPRESSTRUCT = S_(MATHYPRESSTRUCT) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATHYPRE); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_HYPRE, __pyx_t_11) < 0) __PYX_ERR(46, 72, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":73 * PYTHON = S_(MATPYTHON) * HYPRE = S_(MATHYPRE) * HYPRESTRUCT = S_(MATHYPRESTRUCT) # <<<<<<<<<<<<<< * HYPRESSTRUCT = S_(MATHYPRESSTRUCT) * SUBMATRIX = S_(MATSUBMATRIX) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATHYPRESTRUCT); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_HYPRESTRUCT, __pyx_t_11) < 0) __PYX_ERR(46, 73, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":74 * HYPRE = S_(MATHYPRE) * HYPRESTRUCT = S_(MATHYPRESTRUCT) * HYPRESSTRUCT = S_(MATHYPRESSTRUCT) # <<<<<<<<<<<<<< * SUBMATRIX = S_(MATSUBMATRIX) * LOCALREF = S_(MATLOCALREF) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATHYPRESSTRUCT); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_HYPRESSTRUCT, __pyx_t_11) < 0) __PYX_ERR(46, 74, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":75 * HYPRESTRUCT = S_(MATHYPRESTRUCT) * HYPRESSTRUCT = S_(MATHYPRESSTRUCT) * SUBMATRIX = S_(MATSUBMATRIX) # <<<<<<<<<<<<<< * LOCALREF = S_(MATLOCALREF) * NEST = S_(MATNEST) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATSUBMATRIX); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SUBMATRIX, __pyx_t_11) < 0) __PYX_ERR(46, 75, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":76 * HYPRESSTRUCT = S_(MATHYPRESSTRUCT) * SUBMATRIX = S_(MATSUBMATRIX) * LOCALREF = S_(MATLOCALREF) # <<<<<<<<<<<<<< * NEST = S_(MATNEST) * PREALLOCATOR = S_(MATPREALLOCATOR) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATLOCALREF); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_LOCALREF, __pyx_t_11) < 0) __PYX_ERR(46, 76, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":77 * SUBMATRIX = S_(MATSUBMATRIX) * LOCALREF = S_(MATLOCALREF) * NEST = S_(MATNEST) # <<<<<<<<<<<<<< * PREALLOCATOR = S_(MATPREALLOCATOR) * SELL = S_(MATSELL) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATNEST); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_NEST, __pyx_t_11) < 0) __PYX_ERR(46, 77, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":78 * LOCALREF = S_(MATLOCALREF) * NEST = S_(MATNEST) * PREALLOCATOR = S_(MATPREALLOCATOR) # <<<<<<<<<<<<<< * SELL = S_(MATSELL) * SEQSELL = S_(MATSEQSELL) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATPREALLOCATOR); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_PREALLOCATOR, __pyx_t_11) < 0) __PYX_ERR(46, 78, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":79 * NEST = S_(MATNEST) * PREALLOCATOR = S_(MATPREALLOCATOR) * SELL = S_(MATSELL) # <<<<<<<<<<<<<< * SEQSELL = S_(MATSEQSELL) * MPISELL = S_(MATMPISELL) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATSELL); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SELL, __pyx_t_11) < 0) __PYX_ERR(46, 79, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":80 * PREALLOCATOR = S_(MATPREALLOCATOR) * SELL = S_(MATSELL) * SEQSELL = S_(MATSEQSELL) # <<<<<<<<<<<<<< * MPISELL = S_(MATMPISELL) * DUMMY = S_(MATDUMMY) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATSEQSELL); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SEQSELL, __pyx_t_11) < 0) __PYX_ERR(46, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":81 * SELL = S_(MATSELL) * SEQSELL = S_(MATSEQSELL) * MPISELL = S_(MATMPISELL) # <<<<<<<<<<<<<< * DUMMY = S_(MATDUMMY) * LMVM = S_(MATLMVM) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATMPISELL); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_MPISELL, __pyx_t_11) < 0) __PYX_ERR(46, 81, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":82 * SEQSELL = S_(MATSEQSELL) * MPISELL = S_(MATMPISELL) * DUMMY = S_(MATDUMMY) # <<<<<<<<<<<<<< * LMVM = S_(MATLMVM) * LMVMDFP = S_(MATLMVMDFP) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATDUMMY); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DUMMY, __pyx_t_11) < 0) __PYX_ERR(46, 82, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":83 * MPISELL = S_(MATMPISELL) * DUMMY = S_(MATDUMMY) * LMVM = S_(MATLMVM) # <<<<<<<<<<<<<< * LMVMDFP = S_(MATLMVMDFP) * LMVMBFGS = S_(MATLMVMBFGS) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATLMVM); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_LMVM, __pyx_t_11) < 0) __PYX_ERR(46, 83, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":84 * DUMMY = S_(MATDUMMY) * LMVM = S_(MATLMVM) * LMVMDFP = S_(MATLMVMDFP) # <<<<<<<<<<<<<< * LMVMBFGS = S_(MATLMVMBFGS) * LMVMSR1 = S_(MATLMVMSR1) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATLMVMDFP); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_LMVMDFP, __pyx_t_11) < 0) __PYX_ERR(46, 84, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":85 * LMVM = S_(MATLMVM) * LMVMDFP = S_(MATLMVMDFP) * LMVMBFGS = S_(MATLMVMBFGS) # <<<<<<<<<<<<<< * LMVMSR1 = S_(MATLMVMSR1) * LMVMBROYDEN = S_(MATLMVMBROYDEN) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATLMVMBFGS); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_LMVMBFGS, __pyx_t_11) < 0) __PYX_ERR(46, 85, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":86 * LMVMDFP = S_(MATLMVMDFP) * LMVMBFGS = S_(MATLMVMBFGS) * LMVMSR1 = S_(MATLMVMSR1) # <<<<<<<<<<<<<< * LMVMBROYDEN = S_(MATLMVMBROYDEN) * LMVMBADBROYDEN = S_(MATLMVMBADBROYDEN) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATLMVMSR1); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_LMVMSR1, __pyx_t_11) < 0) __PYX_ERR(46, 86, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":87 * LMVMBFGS = S_(MATLMVMBFGS) * LMVMSR1 = S_(MATLMVMSR1) * LMVMBROYDEN = S_(MATLMVMBROYDEN) # <<<<<<<<<<<<<< * LMVMBADBROYDEN = S_(MATLMVMBADBROYDEN) * LMVMSYMBROYDEN = S_(MATLMVMSYMBROYDEN) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATLMVMBROYDEN); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_LMVMBROYDEN, __pyx_t_11) < 0) __PYX_ERR(46, 87, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":88 * LMVMSR1 = S_(MATLMVMSR1) * LMVMBROYDEN = S_(MATLMVMBROYDEN) * LMVMBADBROYDEN = S_(MATLMVMBADBROYDEN) # <<<<<<<<<<<<<< * LMVMSYMBROYDEN = S_(MATLMVMSYMBROYDEN) * LMVMSYMBADBROYDEN = S_(MATLMVMSYMBADBROYDEN) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATLMVMBADBROYDEN); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_LMVMBADBROYDEN, __pyx_t_11) < 0) __PYX_ERR(46, 88, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":89 * LMVMBROYDEN = S_(MATLMVMBROYDEN) * LMVMBADBROYDEN = S_(MATLMVMBADBROYDEN) * LMVMSYMBROYDEN = S_(MATLMVMSYMBROYDEN) # <<<<<<<<<<<<<< * LMVMSYMBADBROYDEN = S_(MATLMVMSYMBADBROYDEN) * LMVMDIAGBBROYDEN = S_(MATLMVMDIAGBROYDEN) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATLMVMSYMBROYDEN); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_LMVMSYMBROYDEN, __pyx_t_11) < 0) __PYX_ERR(46, 89, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":90 * LMVMBADBROYDEN = S_(MATLMVMBADBROYDEN) * LMVMSYMBROYDEN = S_(MATLMVMSYMBROYDEN) * LMVMSYMBADBROYDEN = S_(MATLMVMSYMBADBROYDEN) # <<<<<<<<<<<<<< * LMVMDIAGBBROYDEN = S_(MATLMVMDIAGBROYDEN) * CONSTANTDIAGONAL = S_(MATCONSTANTDIAGONAL) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATLMVMSYMBADBROYDEN); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_LMVMSYMBADBROYDEN, __pyx_t_11) < 0) __PYX_ERR(46, 90, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":91 * LMVMSYMBROYDEN = S_(MATLMVMSYMBROYDEN) * LMVMSYMBADBROYDEN = S_(MATLMVMSYMBADBROYDEN) * LMVMDIAGBBROYDEN = S_(MATLMVMDIAGBROYDEN) # <<<<<<<<<<<<<< * CONSTANTDIAGONAL = S_(MATCONSTANTDIAGONAL) * DIAGONAL = S_(MATDIAGONAL) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATLMVMDIAGBROYDEN); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_LMVMDIAGBBROYDEN, __pyx_t_11) < 0) __PYX_ERR(46, 91, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":92 * LMVMSYMBADBROYDEN = S_(MATLMVMSYMBADBROYDEN) * LMVMDIAGBBROYDEN = S_(MATLMVMDIAGBROYDEN) * CONSTANTDIAGONAL = S_(MATCONSTANTDIAGONAL) # <<<<<<<<<<<<<< * DIAGONAL = S_(MATDIAGONAL) * H2OPUS = S_(MATH2OPUS) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATCONSTANTDIAGONAL); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_CONSTANTDIAGONAL, __pyx_t_11) < 0) __PYX_ERR(46, 92, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":93 * LMVMDIAGBBROYDEN = S_(MATLMVMDIAGBROYDEN) * CONSTANTDIAGONAL = S_(MATCONSTANTDIAGONAL) * DIAGONAL = S_(MATDIAGONAL) # <<<<<<<<<<<<<< * H2OPUS = S_(MATH2OPUS) * */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATDIAGONAL); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DIAGONAL, __pyx_t_11) < 0) __PYX_ERR(46, 93, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":94 * CONSTANTDIAGONAL = S_(MATCONSTANTDIAGONAL) * DIAGONAL = S_(MATDIAGONAL) * H2OPUS = S_(MATH2OPUS) # <<<<<<<<<<<<<< * * class MatOption(object): */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATH2OPUS); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_H2OPUS, __pyx_t_11) < 0) __PYX_ERR(46, 94, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":3 * # -------------------------------------------------------------------- * * class MatType(object): # <<<<<<<<<<<<<< * """Matrix type. * */ __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_MatType, __pyx_t_13, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_MatType, __pyx_t_11) < 0) __PYX_ERR(46, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/Mat.pyx":96 * H2OPUS = S_(MATH2OPUS) * * class MatOption(object): # <<<<<<<<<<<<<< * """Matrix option. * */ __pyx_t_13 = __Pyx_PEP560_update_bases(__pyx_tuple__135); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(46, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_13, __pyx_n_s_MatOption, __pyx_n_s_MatOption, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, __pyx_kp_s_Matrix_option_See_Also_petsc_Mat); if (unlikely(!__pyx_t_12)) __PYX_ERR(46, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_13 != __pyx_tuple__135) { if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_tuple__135) < 0))) __PYX_ERR(46, 96, __pyx_L1_error) } /* "petsc4py/PETSc/Mat.pyx":104 * * """ * OPTION_MIN = MAT_OPTION_MIN # <<<<<<<<<<<<<< * UNUSED_NONZERO_LOCATION_ERR = MAT_UNUSED_NONZERO_LOCATION_ERR * ROW_ORIENTED = MAT_ROW_ORIENTED */ __pyx_t_11 = __Pyx_PyInt_From_MatOption(MAT_OPTION_MIN); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_OPTION_MIN, __pyx_t_11) < 0) __PYX_ERR(46, 104, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":105 * """ * OPTION_MIN = MAT_OPTION_MIN * UNUSED_NONZERO_LOCATION_ERR = MAT_UNUSED_NONZERO_LOCATION_ERR # <<<<<<<<<<<<<< * ROW_ORIENTED = MAT_ROW_ORIENTED * SYMMETRIC = MAT_SYMMETRIC */ __pyx_t_11 = __Pyx_PyInt_From_MatOption(MAT_UNUSED_NONZERO_LOCATION_ERR); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_UNUSED_NONZERO_LOCATION_ERR, __pyx_t_11) < 0) __PYX_ERR(46, 105, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":106 * OPTION_MIN = MAT_OPTION_MIN * UNUSED_NONZERO_LOCATION_ERR = MAT_UNUSED_NONZERO_LOCATION_ERR * ROW_ORIENTED = MAT_ROW_ORIENTED # <<<<<<<<<<<<<< * SYMMETRIC = MAT_SYMMETRIC * STRUCTURALLY_SYMMETRIC = MAT_STRUCTURALLY_SYMMETRIC */ __pyx_t_11 = __Pyx_PyInt_From_MatOption(MAT_ROW_ORIENTED); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_ROW_ORIENTED, __pyx_t_11) < 0) __PYX_ERR(46, 106, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":107 * UNUSED_NONZERO_LOCATION_ERR = MAT_UNUSED_NONZERO_LOCATION_ERR * ROW_ORIENTED = MAT_ROW_ORIENTED * SYMMETRIC = MAT_SYMMETRIC # <<<<<<<<<<<<<< * STRUCTURALLY_SYMMETRIC = MAT_STRUCTURALLY_SYMMETRIC * FORCE_DIAGONAL_ENTRIES = MAT_FORCE_DIAGONAL_ENTRIES */ __pyx_t_11 = __Pyx_PyInt_From_MatOption(MAT_SYMMETRIC); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SYMMETRIC, __pyx_t_11) < 0) __PYX_ERR(46, 107, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":108 * ROW_ORIENTED = MAT_ROW_ORIENTED * SYMMETRIC = MAT_SYMMETRIC * STRUCTURALLY_SYMMETRIC = MAT_STRUCTURALLY_SYMMETRIC # <<<<<<<<<<<<<< * FORCE_DIAGONAL_ENTRIES = MAT_FORCE_DIAGONAL_ENTRIES * IGNORE_OFF_PROC_ENTRIES = MAT_IGNORE_OFF_PROC_ENTRIES */ __pyx_t_11 = __Pyx_PyInt_From_MatOption(MAT_STRUCTURALLY_SYMMETRIC); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_STRUCTURALLY_SYMMETRIC, __pyx_t_11) < 0) __PYX_ERR(46, 108, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":109 * SYMMETRIC = MAT_SYMMETRIC * STRUCTURALLY_SYMMETRIC = MAT_STRUCTURALLY_SYMMETRIC * FORCE_DIAGONAL_ENTRIES = MAT_FORCE_DIAGONAL_ENTRIES # <<<<<<<<<<<<<< * IGNORE_OFF_PROC_ENTRIES = MAT_IGNORE_OFF_PROC_ENTRIES * USE_HASH_TABLE = MAT_USE_HASH_TABLE */ __pyx_t_11 = __Pyx_PyInt_From_MatOption(MAT_FORCE_DIAGONAL_ENTRIES); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_FORCE_DIAGONAL_ENTRIES, __pyx_t_11) < 0) __PYX_ERR(46, 109, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":110 * STRUCTURALLY_SYMMETRIC = MAT_STRUCTURALLY_SYMMETRIC * FORCE_DIAGONAL_ENTRIES = MAT_FORCE_DIAGONAL_ENTRIES * IGNORE_OFF_PROC_ENTRIES = MAT_IGNORE_OFF_PROC_ENTRIES # <<<<<<<<<<<<<< * USE_HASH_TABLE = MAT_USE_HASH_TABLE * KEEP_NONZERO_PATTERN = MAT_KEEP_NONZERO_PATTERN */ __pyx_t_11 = __Pyx_PyInt_From_MatOption(MAT_IGNORE_OFF_PROC_ENTRIES); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_IGNORE_OFF_PROC_ENTRIES, __pyx_t_11) < 0) __PYX_ERR(46, 110, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":111 * FORCE_DIAGONAL_ENTRIES = MAT_FORCE_DIAGONAL_ENTRIES * IGNORE_OFF_PROC_ENTRIES = MAT_IGNORE_OFF_PROC_ENTRIES * USE_HASH_TABLE = MAT_USE_HASH_TABLE # <<<<<<<<<<<<<< * KEEP_NONZERO_PATTERN = MAT_KEEP_NONZERO_PATTERN * IGNORE_ZERO_ENTRIES = MAT_IGNORE_ZERO_ENTRIES */ __pyx_t_11 = __Pyx_PyInt_From_MatOption(MAT_USE_HASH_TABLE); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_USE_HASH_TABLE, __pyx_t_11) < 0) __PYX_ERR(46, 111, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":112 * IGNORE_OFF_PROC_ENTRIES = MAT_IGNORE_OFF_PROC_ENTRIES * USE_HASH_TABLE = MAT_USE_HASH_TABLE * KEEP_NONZERO_PATTERN = MAT_KEEP_NONZERO_PATTERN # <<<<<<<<<<<<<< * IGNORE_ZERO_ENTRIES = MAT_IGNORE_ZERO_ENTRIES * USE_INODES = MAT_USE_INODES */ __pyx_t_11 = __Pyx_PyInt_From_MatOption(MAT_KEEP_NONZERO_PATTERN); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_KEEP_NONZERO_PATTERN, __pyx_t_11) < 0) __PYX_ERR(46, 112, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":113 * USE_HASH_TABLE = MAT_USE_HASH_TABLE * KEEP_NONZERO_PATTERN = MAT_KEEP_NONZERO_PATTERN * IGNORE_ZERO_ENTRIES = MAT_IGNORE_ZERO_ENTRIES # <<<<<<<<<<<<<< * USE_INODES = MAT_USE_INODES * HERMITIAN = MAT_HERMITIAN */ __pyx_t_11 = __Pyx_PyInt_From_MatOption(MAT_IGNORE_ZERO_ENTRIES); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_IGNORE_ZERO_ENTRIES, __pyx_t_11) < 0) __PYX_ERR(46, 113, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":114 * KEEP_NONZERO_PATTERN = MAT_KEEP_NONZERO_PATTERN * IGNORE_ZERO_ENTRIES = MAT_IGNORE_ZERO_ENTRIES * USE_INODES = MAT_USE_INODES # <<<<<<<<<<<<<< * HERMITIAN = MAT_HERMITIAN * SYMMETRY_ETERNAL = MAT_SYMMETRY_ETERNAL */ __pyx_t_11 = __Pyx_PyInt_From_MatOption(MAT_USE_INODES); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_USE_INODES, __pyx_t_11) < 0) __PYX_ERR(46, 114, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":115 * IGNORE_ZERO_ENTRIES = MAT_IGNORE_ZERO_ENTRIES * USE_INODES = MAT_USE_INODES * HERMITIAN = MAT_HERMITIAN # <<<<<<<<<<<<<< * SYMMETRY_ETERNAL = MAT_SYMMETRY_ETERNAL * NEW_NONZERO_LOCATION_ERR = MAT_NEW_NONZERO_LOCATION_ERR */ __pyx_t_11 = __Pyx_PyInt_From_MatOption(MAT_HERMITIAN); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_HERMITIAN, __pyx_t_11) < 0) __PYX_ERR(46, 115, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":116 * USE_INODES = MAT_USE_INODES * HERMITIAN = MAT_HERMITIAN * SYMMETRY_ETERNAL = MAT_SYMMETRY_ETERNAL # <<<<<<<<<<<<<< * NEW_NONZERO_LOCATION_ERR = MAT_NEW_NONZERO_LOCATION_ERR * IGNORE_LOWER_TRIANGULAR = MAT_IGNORE_LOWER_TRIANGULAR */ __pyx_t_11 = __Pyx_PyInt_From_MatOption(MAT_SYMMETRY_ETERNAL); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SYMMETRY_ETERNAL, __pyx_t_11) < 0) __PYX_ERR(46, 116, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":117 * HERMITIAN = MAT_HERMITIAN * SYMMETRY_ETERNAL = MAT_SYMMETRY_ETERNAL * NEW_NONZERO_LOCATION_ERR = MAT_NEW_NONZERO_LOCATION_ERR # <<<<<<<<<<<<<< * IGNORE_LOWER_TRIANGULAR = MAT_IGNORE_LOWER_TRIANGULAR * ERROR_LOWER_TRIANGULAR = MAT_ERROR_LOWER_TRIANGULAR */ __pyx_t_11 = __Pyx_PyInt_From_MatOption(MAT_NEW_NONZERO_LOCATION_ERR); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_NEW_NONZERO_LOCATION_ERR, __pyx_t_11) < 0) __PYX_ERR(46, 117, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":118 * SYMMETRY_ETERNAL = MAT_SYMMETRY_ETERNAL * NEW_NONZERO_LOCATION_ERR = MAT_NEW_NONZERO_LOCATION_ERR * IGNORE_LOWER_TRIANGULAR = MAT_IGNORE_LOWER_TRIANGULAR # <<<<<<<<<<<<<< * ERROR_LOWER_TRIANGULAR = MAT_ERROR_LOWER_TRIANGULAR * GETROW_UPPERTRIANGULAR = MAT_GETROW_UPPERTRIANGULAR */ __pyx_t_11 = __Pyx_PyInt_From_MatOption(MAT_IGNORE_LOWER_TRIANGULAR); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_IGNORE_LOWER_TRIANGULAR, __pyx_t_11) < 0) __PYX_ERR(46, 118, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":119 * NEW_NONZERO_LOCATION_ERR = MAT_NEW_NONZERO_LOCATION_ERR * IGNORE_LOWER_TRIANGULAR = MAT_IGNORE_LOWER_TRIANGULAR * ERROR_LOWER_TRIANGULAR = MAT_ERROR_LOWER_TRIANGULAR # <<<<<<<<<<<<<< * GETROW_UPPERTRIANGULAR = MAT_GETROW_UPPERTRIANGULAR * SPD = MAT_SPD */ __pyx_t_11 = __Pyx_PyInt_From_MatOption(MAT_ERROR_LOWER_TRIANGULAR); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_ERROR_LOWER_TRIANGULAR, __pyx_t_11) < 0) __PYX_ERR(46, 119, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":120 * IGNORE_LOWER_TRIANGULAR = MAT_IGNORE_LOWER_TRIANGULAR * ERROR_LOWER_TRIANGULAR = MAT_ERROR_LOWER_TRIANGULAR * GETROW_UPPERTRIANGULAR = MAT_GETROW_UPPERTRIANGULAR # <<<<<<<<<<<<<< * SPD = MAT_SPD * NO_OFF_PROC_ZERO_ROWS = MAT_NO_OFF_PROC_ZERO_ROWS */ __pyx_t_11 = __Pyx_PyInt_From_MatOption(MAT_GETROW_UPPERTRIANGULAR); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_GETROW_UPPERTRIANGULAR, __pyx_t_11) < 0) __PYX_ERR(46, 120, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":121 * ERROR_LOWER_TRIANGULAR = MAT_ERROR_LOWER_TRIANGULAR * GETROW_UPPERTRIANGULAR = MAT_GETROW_UPPERTRIANGULAR * SPD = MAT_SPD # <<<<<<<<<<<<<< * NO_OFF_PROC_ZERO_ROWS = MAT_NO_OFF_PROC_ZERO_ROWS * NO_OFF_PROC_ENTRIES = MAT_NO_OFF_PROC_ENTRIES */ __pyx_t_11 = __Pyx_PyInt_From_MatOption(MAT_SPD); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SPD, __pyx_t_11) < 0) __PYX_ERR(46, 121, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":122 * GETROW_UPPERTRIANGULAR = MAT_GETROW_UPPERTRIANGULAR * SPD = MAT_SPD * NO_OFF_PROC_ZERO_ROWS = MAT_NO_OFF_PROC_ZERO_ROWS # <<<<<<<<<<<<<< * NO_OFF_PROC_ENTRIES = MAT_NO_OFF_PROC_ENTRIES * NEW_NONZERO_LOCATIONS = MAT_NEW_NONZERO_LOCATIONS */ __pyx_t_11 = __Pyx_PyInt_From_MatOption(MAT_NO_OFF_PROC_ZERO_ROWS); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_NO_OFF_PROC_ZERO_ROWS, __pyx_t_11) < 0) __PYX_ERR(46, 122, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":123 * SPD = MAT_SPD * NO_OFF_PROC_ZERO_ROWS = MAT_NO_OFF_PROC_ZERO_ROWS * NO_OFF_PROC_ENTRIES = MAT_NO_OFF_PROC_ENTRIES # <<<<<<<<<<<<<< * NEW_NONZERO_LOCATIONS = MAT_NEW_NONZERO_LOCATIONS * NEW_NONZERO_ALLOCATION_ERR = MAT_NEW_NONZERO_ALLOCATION_ERR */ __pyx_t_11 = __Pyx_PyInt_From_MatOption(MAT_NO_OFF_PROC_ENTRIES); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_NO_OFF_PROC_ENTRIES, __pyx_t_11) < 0) __PYX_ERR(46, 123, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":124 * NO_OFF_PROC_ZERO_ROWS = MAT_NO_OFF_PROC_ZERO_ROWS * NO_OFF_PROC_ENTRIES = MAT_NO_OFF_PROC_ENTRIES * NEW_NONZERO_LOCATIONS = MAT_NEW_NONZERO_LOCATIONS # <<<<<<<<<<<<<< * NEW_NONZERO_ALLOCATION_ERR = MAT_NEW_NONZERO_ALLOCATION_ERR * SUBSET_OFF_PROC_ENTRIES = MAT_SUBSET_OFF_PROC_ENTRIES */ __pyx_t_11 = __Pyx_PyInt_From_MatOption(MAT_NEW_NONZERO_LOCATIONS); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_NEW_NONZERO_LOCATIONS, __pyx_t_11) < 0) __PYX_ERR(46, 124, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":125 * NO_OFF_PROC_ENTRIES = MAT_NO_OFF_PROC_ENTRIES * NEW_NONZERO_LOCATIONS = MAT_NEW_NONZERO_LOCATIONS * NEW_NONZERO_ALLOCATION_ERR = MAT_NEW_NONZERO_ALLOCATION_ERR # <<<<<<<<<<<<<< * SUBSET_OFF_PROC_ENTRIES = MAT_SUBSET_OFF_PROC_ENTRIES * SUBMAT_SINGLEIS = MAT_SUBMAT_SINGLEIS */ __pyx_t_11 = __Pyx_PyInt_From_MatOption(MAT_NEW_NONZERO_ALLOCATION_ERR); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_NEW_NONZERO_ALLOCATION_ERR, __pyx_t_11) < 0) __PYX_ERR(46, 125, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":126 * NEW_NONZERO_LOCATIONS = MAT_NEW_NONZERO_LOCATIONS * NEW_NONZERO_ALLOCATION_ERR = MAT_NEW_NONZERO_ALLOCATION_ERR * SUBSET_OFF_PROC_ENTRIES = MAT_SUBSET_OFF_PROC_ENTRIES # <<<<<<<<<<<<<< * SUBMAT_SINGLEIS = MAT_SUBMAT_SINGLEIS * STRUCTURE_ONLY = MAT_STRUCTURE_ONLY */ __pyx_t_11 = __Pyx_PyInt_From_MatOption(MAT_SUBSET_OFF_PROC_ENTRIES); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SUBSET_OFF_PROC_ENTRIES, __pyx_t_11) < 0) __PYX_ERR(46, 126, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":127 * NEW_NONZERO_ALLOCATION_ERR = MAT_NEW_NONZERO_ALLOCATION_ERR * SUBSET_OFF_PROC_ENTRIES = MAT_SUBSET_OFF_PROC_ENTRIES * SUBMAT_SINGLEIS = MAT_SUBMAT_SINGLEIS # <<<<<<<<<<<<<< * STRUCTURE_ONLY = MAT_STRUCTURE_ONLY * SORTED_FULL = MAT_SORTED_FULL */ __pyx_t_11 = __Pyx_PyInt_From_MatOption(MAT_SUBMAT_SINGLEIS); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SUBMAT_SINGLEIS, __pyx_t_11) < 0) __PYX_ERR(46, 127, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":128 * SUBSET_OFF_PROC_ENTRIES = MAT_SUBSET_OFF_PROC_ENTRIES * SUBMAT_SINGLEIS = MAT_SUBMAT_SINGLEIS * STRUCTURE_ONLY = MAT_STRUCTURE_ONLY # <<<<<<<<<<<<<< * SORTED_FULL = MAT_SORTED_FULL * OPTION_MAX = MAT_OPTION_MAX */ __pyx_t_11 = __Pyx_PyInt_From_MatOption(MAT_STRUCTURE_ONLY); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_STRUCTURE_ONLY, __pyx_t_11) < 0) __PYX_ERR(46, 128, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":129 * SUBMAT_SINGLEIS = MAT_SUBMAT_SINGLEIS * STRUCTURE_ONLY = MAT_STRUCTURE_ONLY * SORTED_FULL = MAT_SORTED_FULL # <<<<<<<<<<<<<< * OPTION_MAX = MAT_OPTION_MAX * */ __pyx_t_11 = __Pyx_PyInt_From_MatOption(MAT_SORTED_FULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SORTED_FULL, __pyx_t_11) < 0) __PYX_ERR(46, 129, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":130 * STRUCTURE_ONLY = MAT_STRUCTURE_ONLY * SORTED_FULL = MAT_SORTED_FULL * OPTION_MAX = MAT_OPTION_MAX # <<<<<<<<<<<<<< * * class MatAssemblyType(object): */ __pyx_t_11 = __Pyx_PyInt_From_MatOption(MAT_OPTION_MAX); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_OPTION_MAX, __pyx_t_11) < 0) __PYX_ERR(46, 130, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":96 * H2OPUS = S_(MATH2OPUS) * * class MatOption(object): # <<<<<<<<<<<<<< * """Matrix option. * */ __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_MatOption, __pyx_t_13, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_MatOption, __pyx_t_11) < 0) __PYX_ERR(46, 96, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/Mat.pyx":132 * OPTION_MAX = MAT_OPTION_MAX * * class MatAssemblyType(object): # <<<<<<<<<<<<<< * """Matrix assembly type. * */ __pyx_t_13 = __Pyx_PEP560_update_bases(__pyx_tuple__137); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(46, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_13, __pyx_n_s_MatAssemblyType, __pyx_n_s_MatAssemblyType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, __pyx_kp_s_Matrix_assembly_type_See_Also_pe); if (unlikely(!__pyx_t_12)) __PYX_ERR(46, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_13 != __pyx_tuple__137) { if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_tuple__137) < 0))) __PYX_ERR(46, 132, __pyx_L1_error) } /* "petsc4py/PETSc/Mat.pyx":141 * """ * # native * FINAL_ASSEMBLY = MAT_FINAL_ASSEMBLY # <<<<<<<<<<<<<< * FLUSH_ASSEMBLY = MAT_FLUSH_ASSEMBLY * # aliases */ __pyx_t_11 = __Pyx_PyInt_From_MatAssemblyType(MAT_FINAL_ASSEMBLY); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_FINAL_ASSEMBLY, __pyx_t_11) < 0) __PYX_ERR(46, 141, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":142 * # native * FINAL_ASSEMBLY = MAT_FINAL_ASSEMBLY * FLUSH_ASSEMBLY = MAT_FLUSH_ASSEMBLY # <<<<<<<<<<<<<< * # aliases * FINAL = FINAL_ASSEMBLY */ __pyx_t_11 = __Pyx_PyInt_From_MatAssemblyType(MAT_FLUSH_ASSEMBLY); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_FLUSH_ASSEMBLY, __pyx_t_11) < 0) __PYX_ERR(46, 142, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":144 * FLUSH_ASSEMBLY = MAT_FLUSH_ASSEMBLY * # aliases * FINAL = FINAL_ASSEMBLY # <<<<<<<<<<<<<< * FLUSH = FLUSH_ASSEMBLY * */ __pyx_t_11 = PyObject_GetItem(__pyx_t_12, __pyx_n_s_FINAL_ASSEMBLY); if (unlikely(!__pyx_t_11)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_FINAL_ASSEMBLY); } if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_FINAL, __pyx_t_11) < 0) __PYX_ERR(46, 144, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":145 * # aliases * FINAL = FINAL_ASSEMBLY * FLUSH = FLUSH_ASSEMBLY # <<<<<<<<<<<<<< * * class MatInfoType(object): */ __pyx_t_11 = PyObject_GetItem(__pyx_t_12, __pyx_n_s_FLUSH_ASSEMBLY); if (unlikely(!__pyx_t_11)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_FLUSH_ASSEMBLY); } if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_FLUSH, __pyx_t_11) < 0) __PYX_ERR(46, 145, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":132 * OPTION_MAX = MAT_OPTION_MAX * * class MatAssemblyType(object): # <<<<<<<<<<<<<< * """Matrix assembly type. * */ __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_MatAssemblyType, __pyx_t_13, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_MatAssemblyType, __pyx_t_11) < 0) __PYX_ERR(46, 132, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/Mat.pyx":147 * FLUSH = FLUSH_ASSEMBLY * * class MatInfoType(object): # <<<<<<<<<<<<<< * """Matrix info type.""" * LOCAL = MAT_LOCAL */ __pyx_t_13 = __Pyx_PEP560_update_bases(__pyx_tuple__139); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(46, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_13, __pyx_n_s_MatInfoType, __pyx_n_s_MatInfoType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, __pyx_kp_s_Matrix_info_type); if (unlikely(!__pyx_t_12)) __PYX_ERR(46, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_13 != __pyx_tuple__139) { if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_tuple__139) < 0))) __PYX_ERR(46, 147, __pyx_L1_error) } /* "petsc4py/PETSc/Mat.pyx":149 * class MatInfoType(object): * """Matrix info type.""" * LOCAL = MAT_LOCAL # <<<<<<<<<<<<<< * GLOBAL_MAX = MAT_GLOBAL_MAX * GLOBAL_SUM = MAT_GLOBAL_SUM */ __pyx_t_11 = __Pyx_PyInt_From_MatInfoType(MAT_LOCAL); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_LOCAL, __pyx_t_11) < 0) __PYX_ERR(46, 149, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":150 * """Matrix info type.""" * LOCAL = MAT_LOCAL * GLOBAL_MAX = MAT_GLOBAL_MAX # <<<<<<<<<<<<<< * GLOBAL_SUM = MAT_GLOBAL_SUM * */ __pyx_t_11 = __Pyx_PyInt_From_MatInfoType(MAT_GLOBAL_MAX); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_GLOBAL_MAX, __pyx_t_11) < 0) __PYX_ERR(46, 150, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":151 * LOCAL = MAT_LOCAL * GLOBAL_MAX = MAT_GLOBAL_MAX * GLOBAL_SUM = MAT_GLOBAL_SUM # <<<<<<<<<<<<<< * * class MatStructure(object): */ __pyx_t_11 = __Pyx_PyInt_From_MatInfoType(MAT_GLOBAL_SUM); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_GLOBAL_SUM, __pyx_t_11) < 0) __PYX_ERR(46, 151, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":147 * FLUSH = FLUSH_ASSEMBLY * * class MatInfoType(object): # <<<<<<<<<<<<<< * """Matrix info type.""" * LOCAL = MAT_LOCAL */ __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_MatInfoType, __pyx_t_13, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_MatInfoType, __pyx_t_11) < 0) __PYX_ERR(46, 147, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/Mat.pyx":153 * GLOBAL_SUM = MAT_GLOBAL_SUM * * class MatStructure(object): # <<<<<<<<<<<<<< * """Matrix modification structure. * */ __pyx_t_13 = __Pyx_PEP560_update_bases(__pyx_tuple__141); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(46, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_13, __pyx_n_s_MatStructure, __pyx_n_s_MatStructure, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, __pyx_kp_s_Matrix_modification_structure_Se); if (unlikely(!__pyx_t_12)) __PYX_ERR(46, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_13 != __pyx_tuple__141) { if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_tuple__141) < 0))) __PYX_ERR(46, 153, __pyx_L1_error) } /* "petsc4py/PETSc/Mat.pyx":162 * """ * # native * SAME_NONZERO_PATTERN = MAT_SAME_NONZERO_PATTERN # <<<<<<<<<<<<<< * DIFFERENT_NONZERO_PATTERN = MAT_DIFFERENT_NONZERO_PATTERN * SUBSET_NONZERO_PATTERN = MAT_SUBSET_NONZERO_PATTERN */ __pyx_t_11 = __Pyx_PyInt_From_MatStructure(SAME_NONZERO_PATTERN); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SAME_NONZERO_PATTERN, __pyx_t_11) < 0) __PYX_ERR(46, 162, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":163 * # native * SAME_NONZERO_PATTERN = MAT_SAME_NONZERO_PATTERN * DIFFERENT_NONZERO_PATTERN = MAT_DIFFERENT_NONZERO_PATTERN # <<<<<<<<<<<<<< * SUBSET_NONZERO_PATTERN = MAT_SUBSET_NONZERO_PATTERN * UNKNOWN_NONZERO_PATTERN = MAT_UNKNOWN_NONZERO_PATTERN */ __pyx_t_11 = __Pyx_PyInt_From_MatStructure(DIFFERENT_NONZERO_PATTERN); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DIFFERENT_NONZERO_PATTERN, __pyx_t_11) < 0) __PYX_ERR(46, 163, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":164 * SAME_NONZERO_PATTERN = MAT_SAME_NONZERO_PATTERN * DIFFERENT_NONZERO_PATTERN = MAT_DIFFERENT_NONZERO_PATTERN * SUBSET_NONZERO_PATTERN = MAT_SUBSET_NONZERO_PATTERN # <<<<<<<<<<<<<< * UNKNOWN_NONZERO_PATTERN = MAT_UNKNOWN_NONZERO_PATTERN * # aliases */ __pyx_t_11 = __Pyx_PyInt_From_MatStructure(SUBSET_NONZERO_PATTERN); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SUBSET_NONZERO_PATTERN, __pyx_t_11) < 0) __PYX_ERR(46, 164, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":165 * DIFFERENT_NONZERO_PATTERN = MAT_DIFFERENT_NONZERO_PATTERN * SUBSET_NONZERO_PATTERN = MAT_SUBSET_NONZERO_PATTERN * UNKNOWN_NONZERO_PATTERN = MAT_UNKNOWN_NONZERO_PATTERN # <<<<<<<<<<<<<< * # aliases * SAME = SAME_NZ = SAME_NONZERO_PATTERN */ __pyx_t_11 = __Pyx_PyInt_From_MatStructure(UNKNOWN_NONZERO_PATTERN); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_UNKNOWN_NONZERO_PATTERN, __pyx_t_11) < 0) __PYX_ERR(46, 165, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":167 * UNKNOWN_NONZERO_PATTERN = MAT_UNKNOWN_NONZERO_PATTERN * # aliases * SAME = SAME_NZ = SAME_NONZERO_PATTERN # <<<<<<<<<<<<<< * SUBSET = SUBSET_NZ = SUBSET_NONZERO_PATTERN * DIFFERENT = DIFFERENT_NZ = DIFFERENT_NONZERO_PATTERN */ __pyx_t_11 = PyObject_GetItem(__pyx_t_12, __pyx_n_s_SAME_NONZERO_PATTERN); if (unlikely(!__pyx_t_11)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_SAME_NONZERO_PATTERN); } if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SAME, __pyx_t_11) < 0) __PYX_ERR(46, 167, __pyx_L1_error) if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SAME_NZ, __pyx_t_11) < 0) __PYX_ERR(46, 167, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":168 * # aliases * SAME = SAME_NZ = SAME_NONZERO_PATTERN * SUBSET = SUBSET_NZ = SUBSET_NONZERO_PATTERN # <<<<<<<<<<<<<< * DIFFERENT = DIFFERENT_NZ = DIFFERENT_NONZERO_PATTERN * UNKNOWN = UNKNOWN_NZ = UNKNOWN_NONZERO_PATTERN */ __pyx_t_11 = PyObject_GetItem(__pyx_t_12, __pyx_n_s_SUBSET_NONZERO_PATTERN); if (unlikely(!__pyx_t_11)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_SUBSET_NONZERO_PATTERN); } if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SUBSET, __pyx_t_11) < 0) __PYX_ERR(46, 168, __pyx_L1_error) if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SUBSET_NZ, __pyx_t_11) < 0) __PYX_ERR(46, 168, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":169 * SAME = SAME_NZ = SAME_NONZERO_PATTERN * SUBSET = SUBSET_NZ = SUBSET_NONZERO_PATTERN * DIFFERENT = DIFFERENT_NZ = DIFFERENT_NONZERO_PATTERN # <<<<<<<<<<<<<< * UNKNOWN = UNKNOWN_NZ = UNKNOWN_NONZERO_PATTERN * */ __pyx_t_11 = PyObject_GetItem(__pyx_t_12, __pyx_n_s_DIFFERENT_NONZERO_PATTERN); if (unlikely(!__pyx_t_11)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_DIFFERENT_NONZERO_PATTERN); } if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DIFFERENT, __pyx_t_11) < 0) __PYX_ERR(46, 169, __pyx_L1_error) if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DIFFERENT_NZ, __pyx_t_11) < 0) __PYX_ERR(46, 169, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":170 * SUBSET = SUBSET_NZ = SUBSET_NONZERO_PATTERN * DIFFERENT = DIFFERENT_NZ = DIFFERENT_NONZERO_PATTERN * UNKNOWN = UNKNOWN_NZ = UNKNOWN_NONZERO_PATTERN # <<<<<<<<<<<<<< * * class MatDuplicateOption(object): */ __pyx_t_11 = PyObject_GetItem(__pyx_t_12, __pyx_n_s_UNKNOWN_NONZERO_PATTERN); if (unlikely(!__pyx_t_11)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_UNKNOWN_NONZERO_PATTERN); } if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_UNKNOWN, __pyx_t_11) < 0) __PYX_ERR(46, 170, __pyx_L1_error) if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_UNKNOWN_NZ, __pyx_t_11) < 0) __PYX_ERR(46, 170, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":153 * GLOBAL_SUM = MAT_GLOBAL_SUM * * class MatStructure(object): # <<<<<<<<<<<<<< * """Matrix modification structure. * */ __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_MatStructure, __pyx_t_13, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_MatStructure, __pyx_t_11) < 0) __PYX_ERR(46, 153, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/Mat.pyx":172 * UNKNOWN = UNKNOWN_NZ = UNKNOWN_NONZERO_PATTERN * * class MatDuplicateOption(object): # <<<<<<<<<<<<<< * """Matrix duplicate option. * */ __pyx_t_13 = __Pyx_PEP560_update_bases(__pyx_tuple__143); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(46, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_13, __pyx_n_s_MatDuplicateOption, __pyx_n_s_MatDuplicateOption, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, __pyx_kp_s_Matrix_duplicate_option_See_Also); if (unlikely(!__pyx_t_12)) __PYX_ERR(46, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_13 != __pyx_tuple__143) { if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_tuple__143) < 0))) __PYX_ERR(46, 172, __pyx_L1_error) } /* "petsc4py/PETSc/Mat.pyx":180 * * """ * DO_NOT_COPY_VALUES = MAT_DO_NOT_COPY_VALUES # <<<<<<<<<<<<<< * COPY_VALUES = MAT_COPY_VALUES * SHARE_NONZERO_PATTERN = MAT_SHARE_NONZERO_PATTERN */ __pyx_t_11 = __Pyx_PyInt_From_MatDuplicateOption(MAT_DO_NOT_COPY_VALUES); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DO_NOT_COPY_VALUES, __pyx_t_11) < 0) __PYX_ERR(46, 180, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":181 * """ * DO_NOT_COPY_VALUES = MAT_DO_NOT_COPY_VALUES * COPY_VALUES = MAT_COPY_VALUES # <<<<<<<<<<<<<< * SHARE_NONZERO_PATTERN = MAT_SHARE_NONZERO_PATTERN * */ __pyx_t_11 = __Pyx_PyInt_From_MatDuplicateOption(MAT_COPY_VALUES); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_COPY_VALUES, __pyx_t_11) < 0) __PYX_ERR(46, 181, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":182 * DO_NOT_COPY_VALUES = MAT_DO_NOT_COPY_VALUES * COPY_VALUES = MAT_COPY_VALUES * SHARE_NONZERO_PATTERN = MAT_SHARE_NONZERO_PATTERN # <<<<<<<<<<<<<< * * class MatOrderingType(object): */ __pyx_t_11 = __Pyx_PyInt_From_MatDuplicateOption(MAT_SHARE_NONZERO_PATTERN); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SHARE_NONZERO_PATTERN, __pyx_t_11) < 0) __PYX_ERR(46, 182, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":172 * UNKNOWN = UNKNOWN_NZ = UNKNOWN_NONZERO_PATTERN * * class MatDuplicateOption(object): # <<<<<<<<<<<<<< * """Matrix duplicate option. * */ __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_MatDuplicateOption, __pyx_t_13, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_MatDuplicateOption, __pyx_t_11) < 0) __PYX_ERR(46, 172, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/Mat.pyx":184 * SHARE_NONZERO_PATTERN = MAT_SHARE_NONZERO_PATTERN * * class MatOrderingType(object): # <<<<<<<<<<<<<< * """Factored matrix ordering type. * */ __pyx_t_13 = __Pyx_PEP560_update_bases(__pyx_tuple__145); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(46, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_13, __pyx_n_s_MatOrderingType, __pyx_n_s_MatOrderingType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, __pyx_kp_s_Factored_matrix_ordering_type_Se); if (unlikely(!__pyx_t_12)) __PYX_ERR(46, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_13 != __pyx_tuple__145) { if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_tuple__145) < 0))) __PYX_ERR(46, 184, __pyx_L1_error) } /* "petsc4py/PETSc/Mat.pyx":192 * * """ * NATURAL = S_(MATORDERINGNATURAL) # <<<<<<<<<<<<<< * ND = S_(MATORDERINGND) * OWD = S_(MATORDERING1WD) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATORDERINGNATURAL); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_NATURAL, __pyx_t_11) < 0) __PYX_ERR(46, 192, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":193 * """ * NATURAL = S_(MATORDERINGNATURAL) * ND = S_(MATORDERINGND) # <<<<<<<<<<<<<< * OWD = S_(MATORDERING1WD) * RCM = S_(MATORDERINGRCM) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATORDERINGND); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_ND, __pyx_t_11) < 0) __PYX_ERR(46, 193, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":194 * NATURAL = S_(MATORDERINGNATURAL) * ND = S_(MATORDERINGND) * OWD = S_(MATORDERING1WD) # <<<<<<<<<<<<<< * RCM = S_(MATORDERINGRCM) * QMD = S_(MATORDERINGQMD) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATORDERING1WD); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_OWD, __pyx_t_11) < 0) __PYX_ERR(46, 194, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":195 * ND = S_(MATORDERINGND) * OWD = S_(MATORDERING1WD) * RCM = S_(MATORDERINGRCM) # <<<<<<<<<<<<<< * QMD = S_(MATORDERINGQMD) * ROWLENGTH = S_(MATORDERINGROWLENGTH) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATORDERINGRCM); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_RCM, __pyx_t_11) < 0) __PYX_ERR(46, 195, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":196 * OWD = S_(MATORDERING1WD) * RCM = S_(MATORDERINGRCM) * QMD = S_(MATORDERINGQMD) # <<<<<<<<<<<<<< * ROWLENGTH = S_(MATORDERINGROWLENGTH) * WBM = S_(MATORDERINGWBM) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATORDERINGQMD); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_QMD, __pyx_t_11) < 0) __PYX_ERR(46, 196, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":197 * RCM = S_(MATORDERINGRCM) * QMD = S_(MATORDERINGQMD) * ROWLENGTH = S_(MATORDERINGROWLENGTH) # <<<<<<<<<<<<<< * WBM = S_(MATORDERINGWBM) * SPECTRAL = S_(MATORDERINGSPECTRAL) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATORDERINGROWLENGTH); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_ROWLENGTH, __pyx_t_11) < 0) __PYX_ERR(46, 197, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":198 * QMD = S_(MATORDERINGQMD) * ROWLENGTH = S_(MATORDERINGROWLENGTH) * WBM = S_(MATORDERINGWBM) # <<<<<<<<<<<<<< * SPECTRAL = S_(MATORDERINGSPECTRAL) * AMD = S_(MATORDERINGAMD) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATORDERINGWBM); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_WBM, __pyx_t_11) < 0) __PYX_ERR(46, 198, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":199 * ROWLENGTH = S_(MATORDERINGROWLENGTH) * WBM = S_(MATORDERINGWBM) * SPECTRAL = S_(MATORDERINGSPECTRAL) # <<<<<<<<<<<<<< * AMD = S_(MATORDERINGAMD) * METISND = S_(MATORDERINGMETISND) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATORDERINGSPECTRAL); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SPECTRAL, __pyx_t_11) < 0) __PYX_ERR(46, 199, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":200 * WBM = S_(MATORDERINGWBM) * SPECTRAL = S_(MATORDERINGSPECTRAL) * AMD = S_(MATORDERINGAMD) # <<<<<<<<<<<<<< * METISND = S_(MATORDERINGMETISND) * */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATORDERINGAMD); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_AMD, __pyx_t_11) < 0) __PYX_ERR(46, 200, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":201 * SPECTRAL = S_(MATORDERINGSPECTRAL) * AMD = S_(MATORDERINGAMD) * METISND = S_(MATORDERINGMETISND) # <<<<<<<<<<<<<< * * class MatSolverType(object): */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATORDERINGMETISND); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_METISND, __pyx_t_11) < 0) __PYX_ERR(46, 201, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":184 * SHARE_NONZERO_PATTERN = MAT_SHARE_NONZERO_PATTERN * * class MatOrderingType(object): # <<<<<<<<<<<<<< * """Factored matrix ordering type. * */ __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_MatOrderingType, __pyx_t_13, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_MatOrderingType, __pyx_t_11) < 0) __PYX_ERR(46, 184, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/Mat.pyx":203 * METISND = S_(MATORDERINGMETISND) * * class MatSolverType(object): # <<<<<<<<<<<<<< * """Factored matrix solver type. * */ __pyx_t_13 = __Pyx_PEP560_update_bases(__pyx_tuple__147); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(46, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_13, __pyx_n_s_MatSolverType, __pyx_n_s_MatSolverType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, __pyx_kp_s_Factored_matrix_solver_type_See); if (unlikely(!__pyx_t_12)) __PYX_ERR(46, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_13 != __pyx_tuple__147) { if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_tuple__147) < 0))) __PYX_ERR(46, 203, __pyx_L1_error) } /* "petsc4py/PETSc/Mat.pyx":211 * * """ * SUPERLU = S_(MATSOLVERSUPERLU) # <<<<<<<<<<<<<< * SUPERLU_DIST = S_(MATSOLVERSUPERLU_DIST) * STRUMPACK = S_(MATSOLVERSTRUMPACK) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATSOLVERSUPERLU); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SUPERLU, __pyx_t_11) < 0) __PYX_ERR(46, 211, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":212 * """ * SUPERLU = S_(MATSOLVERSUPERLU) * SUPERLU_DIST = S_(MATSOLVERSUPERLU_DIST) # <<<<<<<<<<<<<< * STRUMPACK = S_(MATSOLVERSTRUMPACK) * UMFPACK = S_(MATSOLVERUMFPACK) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATSOLVERSUPERLU_DIST); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SUPERLU_DIST, __pyx_t_11) < 0) __PYX_ERR(46, 212, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":213 * SUPERLU = S_(MATSOLVERSUPERLU) * SUPERLU_DIST = S_(MATSOLVERSUPERLU_DIST) * STRUMPACK = S_(MATSOLVERSTRUMPACK) # <<<<<<<<<<<<<< * UMFPACK = S_(MATSOLVERUMFPACK) * CHOLMOD = S_(MATSOLVERCHOLMOD) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATSOLVERSTRUMPACK); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_STRUMPACK, __pyx_t_11) < 0) __PYX_ERR(46, 213, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":214 * SUPERLU_DIST = S_(MATSOLVERSUPERLU_DIST) * STRUMPACK = S_(MATSOLVERSTRUMPACK) * UMFPACK = S_(MATSOLVERUMFPACK) # <<<<<<<<<<<<<< * CHOLMOD = S_(MATSOLVERCHOLMOD) * KLU = S_(MATSOLVERKLU) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATSOLVERUMFPACK); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_UMFPACK, __pyx_t_11) < 0) __PYX_ERR(46, 214, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":215 * STRUMPACK = S_(MATSOLVERSTRUMPACK) * UMFPACK = S_(MATSOLVERUMFPACK) * CHOLMOD = S_(MATSOLVERCHOLMOD) # <<<<<<<<<<<<<< * KLU = S_(MATSOLVERKLU) * ELEMENTAL = S_(MATSOLVERELEMENTAL) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATSOLVERCHOLMOD); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_CHOLMOD, __pyx_t_11) < 0) __PYX_ERR(46, 215, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":216 * UMFPACK = S_(MATSOLVERUMFPACK) * CHOLMOD = S_(MATSOLVERCHOLMOD) * KLU = S_(MATSOLVERKLU) # <<<<<<<<<<<<<< * ELEMENTAL = S_(MATSOLVERELEMENTAL) * SCALAPACK = S_(MATSOLVERSCALAPACK) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATSOLVERKLU); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_KLU, __pyx_t_11) < 0) __PYX_ERR(46, 216, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":217 * CHOLMOD = S_(MATSOLVERCHOLMOD) * KLU = S_(MATSOLVERKLU) * ELEMENTAL = S_(MATSOLVERELEMENTAL) # <<<<<<<<<<<<<< * SCALAPACK = S_(MATSOLVERSCALAPACK) * ESSL = S_(MATSOLVERESSL) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATSOLVERELEMENTAL); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_ELEMENTAL, __pyx_t_11) < 0) __PYX_ERR(46, 217, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":218 * KLU = S_(MATSOLVERKLU) * ELEMENTAL = S_(MATSOLVERELEMENTAL) * SCALAPACK = S_(MATSOLVERSCALAPACK) # <<<<<<<<<<<<<< * ESSL = S_(MATSOLVERESSL) * LUSOL = S_(MATSOLVERLUSOL) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATSOLVERSCALAPACK); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SCALAPACK, __pyx_t_11) < 0) __PYX_ERR(46, 218, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":219 * ELEMENTAL = S_(MATSOLVERELEMENTAL) * SCALAPACK = S_(MATSOLVERSCALAPACK) * ESSL = S_(MATSOLVERESSL) # <<<<<<<<<<<<<< * LUSOL = S_(MATSOLVERLUSOL) * MUMPS = S_(MATSOLVERMUMPS) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATSOLVERESSL); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_ESSL, __pyx_t_11) < 0) __PYX_ERR(46, 219, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":220 * SCALAPACK = S_(MATSOLVERSCALAPACK) * ESSL = S_(MATSOLVERESSL) * LUSOL = S_(MATSOLVERLUSOL) # <<<<<<<<<<<<<< * MUMPS = S_(MATSOLVERMUMPS) * MKL_PARDISO = S_(MATSOLVERMKL_PARDISO) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATSOLVERLUSOL); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_LUSOL, __pyx_t_11) < 0) __PYX_ERR(46, 220, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":221 * ESSL = S_(MATSOLVERESSL) * LUSOL = S_(MATSOLVERLUSOL) * MUMPS = S_(MATSOLVERMUMPS) # <<<<<<<<<<<<<< * MKL_PARDISO = S_(MATSOLVERMKL_PARDISO) * MKL_CPARDISO = S_(MATSOLVERMKL_CPARDISO) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATSOLVERMUMPS); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_MUMPS, __pyx_t_11) < 0) __PYX_ERR(46, 221, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":222 * LUSOL = S_(MATSOLVERLUSOL) * MUMPS = S_(MATSOLVERMUMPS) * MKL_PARDISO = S_(MATSOLVERMKL_PARDISO) # <<<<<<<<<<<<<< * MKL_CPARDISO = S_(MATSOLVERMKL_CPARDISO) * PASTIX = S_(MATSOLVERPASTIX) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATSOLVERMKL_PARDISO); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_MKL_PARDISO, __pyx_t_11) < 0) __PYX_ERR(46, 222, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":223 * MUMPS = S_(MATSOLVERMUMPS) * MKL_PARDISO = S_(MATSOLVERMKL_PARDISO) * MKL_CPARDISO = S_(MATSOLVERMKL_CPARDISO) # <<<<<<<<<<<<<< * PASTIX = S_(MATSOLVERPASTIX) * MATLAB = S_(MATSOLVERMATLAB) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATSOLVERMKL_CPARDISO); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_MKL_CPARDISO, __pyx_t_11) < 0) __PYX_ERR(46, 223, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":224 * MKL_PARDISO = S_(MATSOLVERMKL_PARDISO) * MKL_CPARDISO = S_(MATSOLVERMKL_CPARDISO) * PASTIX = S_(MATSOLVERPASTIX) # <<<<<<<<<<<<<< * MATLAB = S_(MATSOLVERMATLAB) * PETSC = S_(MATSOLVERPETSC) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATSOLVERPASTIX); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_PASTIX, __pyx_t_11) < 0) __PYX_ERR(46, 224, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":225 * MKL_CPARDISO = S_(MATSOLVERMKL_CPARDISO) * PASTIX = S_(MATSOLVERPASTIX) * MATLAB = S_(MATSOLVERMATLAB) # <<<<<<<<<<<<<< * PETSC = S_(MATSOLVERPETSC) * BAS = S_(MATSOLVERBAS) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATSOLVERMATLAB); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_MATLAB, __pyx_t_11) < 0) __PYX_ERR(46, 225, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":226 * PASTIX = S_(MATSOLVERPASTIX) * MATLAB = S_(MATSOLVERMATLAB) * PETSC = S_(MATSOLVERPETSC) # <<<<<<<<<<<<<< * BAS = S_(MATSOLVERBAS) * CUSPARSE = S_(MATSOLVERCUSPARSE) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATSOLVERPETSC); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_PETSC, __pyx_t_11) < 0) __PYX_ERR(46, 226, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":227 * MATLAB = S_(MATSOLVERMATLAB) * PETSC = S_(MATSOLVERPETSC) * BAS = S_(MATSOLVERBAS) # <<<<<<<<<<<<<< * CUSPARSE = S_(MATSOLVERCUSPARSE) * CUDA = S_(MATSOLVERCUDA) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATSOLVERBAS); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_BAS, __pyx_t_11) < 0) __PYX_ERR(46, 227, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":228 * PETSC = S_(MATSOLVERPETSC) * BAS = S_(MATSOLVERBAS) * CUSPARSE = S_(MATSOLVERCUSPARSE) # <<<<<<<<<<<<<< * CUDA = S_(MATSOLVERCUDA) * SPQR = S_(MATSOLVERSPQR) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATSOLVERCUSPARSE); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_CUSPARSE, __pyx_t_11) < 0) __PYX_ERR(46, 228, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":229 * BAS = S_(MATSOLVERBAS) * CUSPARSE = S_(MATSOLVERCUSPARSE) * CUDA = S_(MATSOLVERCUDA) # <<<<<<<<<<<<<< * SPQR = S_(MATSOLVERSPQR) * */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATSOLVERCUDA); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_CUDA, __pyx_t_11) < 0) __PYX_ERR(46, 229, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":230 * CUSPARSE = S_(MATSOLVERCUSPARSE) * CUDA = S_(MATSOLVERCUDA) * SPQR = S_(MATSOLVERSPQR) # <<<<<<<<<<<<<< * * class MatFactorShiftType(object): */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATSOLVERSPQR); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SPQR, __pyx_t_11) < 0) __PYX_ERR(46, 230, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":203 * METISND = S_(MATORDERINGMETISND) * * class MatSolverType(object): # <<<<<<<<<<<<<< * """Factored matrix solver type. * */ __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_MatSolverType, __pyx_t_13, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_MatSolverType, __pyx_t_11) < 0) __PYX_ERR(46, 203, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/Mat.pyx":232 * SPQR = S_(MATSOLVERSPQR) * * class MatFactorShiftType(object): # <<<<<<<<<<<<<< * """Factored matrix shift type. * */ __pyx_t_13 = __Pyx_PEP560_update_bases(__pyx_tuple__149); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(46, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_13, __pyx_n_s_MatFactorShiftType, __pyx_n_s_MatFactorShiftType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, __pyx_kp_s_Factored_matrix_shift_type_See_A); if (unlikely(!__pyx_t_12)) __PYX_ERR(46, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_13 != __pyx_tuple__149) { if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_tuple__149) < 0))) __PYX_ERR(46, 232, __pyx_L1_error) } /* "petsc4py/PETSc/Mat.pyx":241 * """ * # native * NONE = MAT_SHIFT_NONE # <<<<<<<<<<<<<< * NONZERO = MAT_SHIFT_NONZERO * POSITIVE_DEFINITE = MAT_SHIFT_POSITIVE_DEFINITE */ __pyx_t_11 = __Pyx_PyInt_From_MatFactorShiftType(MAT_SHIFT_NONE); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_NONE, __pyx_t_11) < 0) __PYX_ERR(46, 241, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":242 * # native * NONE = MAT_SHIFT_NONE * NONZERO = MAT_SHIFT_NONZERO # <<<<<<<<<<<<<< * POSITIVE_DEFINITE = MAT_SHIFT_POSITIVE_DEFINITE * INBLOCKS = MAT_SHIFT_INBLOCKS */ __pyx_t_11 = __Pyx_PyInt_From_MatFactorShiftType(MAT_SHIFT_NONZERO); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_NONZERO, __pyx_t_11) < 0) __PYX_ERR(46, 242, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":243 * NONE = MAT_SHIFT_NONE * NONZERO = MAT_SHIFT_NONZERO * POSITIVE_DEFINITE = MAT_SHIFT_POSITIVE_DEFINITE # <<<<<<<<<<<<<< * INBLOCKS = MAT_SHIFT_INBLOCKS * # aliases */ __pyx_t_11 = __Pyx_PyInt_From_MatFactorShiftType(MAT_SHIFT_POSITIVE_DEFINITE); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_POSITIVE_DEFINITE, __pyx_t_11) < 0) __PYX_ERR(46, 243, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":244 * NONZERO = MAT_SHIFT_NONZERO * POSITIVE_DEFINITE = MAT_SHIFT_POSITIVE_DEFINITE * INBLOCKS = MAT_SHIFT_INBLOCKS # <<<<<<<<<<<<<< * # aliases * NZ = MAT_SHIFT_NONZERO */ __pyx_t_11 = __Pyx_PyInt_From_MatFactorShiftType(MAT_SHIFT_INBLOCKS); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_INBLOCKS, __pyx_t_11) < 0) __PYX_ERR(46, 244, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":246 * INBLOCKS = MAT_SHIFT_INBLOCKS * # aliases * NZ = MAT_SHIFT_NONZERO # <<<<<<<<<<<<<< * PD = MAT_SHIFT_POSITIVE_DEFINITE * */ __pyx_t_11 = __Pyx_PyInt_From_MatFactorShiftType(MAT_SHIFT_NONZERO); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_NZ, __pyx_t_11) < 0) __PYX_ERR(46, 246, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":247 * # aliases * NZ = MAT_SHIFT_NONZERO * PD = MAT_SHIFT_POSITIVE_DEFINITE # <<<<<<<<<<<<<< * * class MatSORType(object): */ __pyx_t_11 = __Pyx_PyInt_From_MatFactorShiftType(MAT_SHIFT_POSITIVE_DEFINITE); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_PD, __pyx_t_11) < 0) __PYX_ERR(46, 247, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":232 * SPQR = S_(MATSOLVERSPQR) * * class MatFactorShiftType(object): # <<<<<<<<<<<<<< * """Factored matrix shift type. * */ __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_MatFactorShiftType, __pyx_t_13, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_MatFactorShiftType, __pyx_t_11) < 0) __PYX_ERR(46, 232, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/Mat.pyx":249 * PD = MAT_SHIFT_POSITIVE_DEFINITE * * class MatSORType(object): # <<<<<<<<<<<<<< * """Matrix SOR type. * */ __pyx_t_13 = __Pyx_PEP560_update_bases(__pyx_tuple__151); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(46, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_13, __pyx_n_s_MatSORType, __pyx_n_s_MatSORType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, __pyx_kp_s_Matrix_SOR_type_See_Also_petsc_M); if (unlikely(!__pyx_t_12)) __PYX_ERR(46, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_13 != __pyx_tuple__151) { if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_tuple__151) < 0))) __PYX_ERR(46, 249, __pyx_L1_error) } /* "petsc4py/PETSc/Mat.pyx":257 * * """ * FORWARD_SWEEP = SOR_FORWARD_SWEEP # <<<<<<<<<<<<<< * BACKWARD_SWEEP = SOR_BACKWARD_SWEEP * SYMMETRY_SWEEP = SOR_SYMMETRIC_SWEEP */ __pyx_t_11 = __Pyx_PyInt_From_MatSORType(SOR_FORWARD_SWEEP); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_FORWARD_SWEEP, __pyx_t_11) < 0) __PYX_ERR(46, 257, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":258 * """ * FORWARD_SWEEP = SOR_FORWARD_SWEEP * BACKWARD_SWEEP = SOR_BACKWARD_SWEEP # <<<<<<<<<<<<<< * SYMMETRY_SWEEP = SOR_SYMMETRIC_SWEEP * LOCAL_FORWARD_SWEEP = SOR_LOCAL_FORWARD_SWEEP */ __pyx_t_11 = __Pyx_PyInt_From_MatSORType(SOR_BACKWARD_SWEEP); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_BACKWARD_SWEEP, __pyx_t_11) < 0) __PYX_ERR(46, 258, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":259 * FORWARD_SWEEP = SOR_FORWARD_SWEEP * BACKWARD_SWEEP = SOR_BACKWARD_SWEEP * SYMMETRY_SWEEP = SOR_SYMMETRIC_SWEEP # <<<<<<<<<<<<<< * LOCAL_FORWARD_SWEEP = SOR_LOCAL_FORWARD_SWEEP * LOCAL_BACKWARD_SWEEP = SOR_LOCAL_BACKWARD_SWEEP */ __pyx_t_11 = __Pyx_PyInt_From_MatSORType(SOR_SYMMETRIC_SWEEP); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SYMMETRY_SWEEP, __pyx_t_11) < 0) __PYX_ERR(46, 259, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":260 * BACKWARD_SWEEP = SOR_BACKWARD_SWEEP * SYMMETRY_SWEEP = SOR_SYMMETRIC_SWEEP * LOCAL_FORWARD_SWEEP = SOR_LOCAL_FORWARD_SWEEP # <<<<<<<<<<<<<< * LOCAL_BACKWARD_SWEEP = SOR_LOCAL_BACKWARD_SWEEP * LOCAL_SYMMETRIC_SWEEP = SOR_LOCAL_SYMMETRIC_SWEEP */ __pyx_t_11 = __Pyx_PyInt_From_MatSORType(SOR_LOCAL_FORWARD_SWEEP); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_LOCAL_FORWARD_SWEEP, __pyx_t_11) < 0) __PYX_ERR(46, 260, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":261 * SYMMETRY_SWEEP = SOR_SYMMETRIC_SWEEP * LOCAL_FORWARD_SWEEP = SOR_LOCAL_FORWARD_SWEEP * LOCAL_BACKWARD_SWEEP = SOR_LOCAL_BACKWARD_SWEEP # <<<<<<<<<<<<<< * LOCAL_SYMMETRIC_SWEEP = SOR_LOCAL_SYMMETRIC_SWEEP * ZERO_INITIAL_GUESS = SOR_ZERO_INITIAL_GUESS */ __pyx_t_11 = __Pyx_PyInt_From_MatSORType(SOR_LOCAL_BACKWARD_SWEEP); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_LOCAL_BACKWARD_SWEEP, __pyx_t_11) < 0) __PYX_ERR(46, 261, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":262 * LOCAL_FORWARD_SWEEP = SOR_LOCAL_FORWARD_SWEEP * LOCAL_BACKWARD_SWEEP = SOR_LOCAL_BACKWARD_SWEEP * LOCAL_SYMMETRIC_SWEEP = SOR_LOCAL_SYMMETRIC_SWEEP # <<<<<<<<<<<<<< * ZERO_INITIAL_GUESS = SOR_ZERO_INITIAL_GUESS * EISENSTAT = SOR_EISENSTAT */ __pyx_t_11 = __Pyx_PyInt_From_MatSORType(SOR_LOCAL_SYMMETRIC_SWEEP); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_LOCAL_SYMMETRIC_SWEEP, __pyx_t_11) < 0) __PYX_ERR(46, 262, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":263 * LOCAL_BACKWARD_SWEEP = SOR_LOCAL_BACKWARD_SWEEP * LOCAL_SYMMETRIC_SWEEP = SOR_LOCAL_SYMMETRIC_SWEEP * ZERO_INITIAL_GUESS = SOR_ZERO_INITIAL_GUESS # <<<<<<<<<<<<<< * EISENSTAT = SOR_EISENSTAT * APPLY_UPPER = SOR_APPLY_UPPER */ __pyx_t_11 = __Pyx_PyInt_From_MatSORType(SOR_ZERO_INITIAL_GUESS); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_ZERO_INITIAL_GUESS, __pyx_t_11) < 0) __PYX_ERR(46, 263, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":264 * LOCAL_SYMMETRIC_SWEEP = SOR_LOCAL_SYMMETRIC_SWEEP * ZERO_INITIAL_GUESS = SOR_ZERO_INITIAL_GUESS * EISENSTAT = SOR_EISENSTAT # <<<<<<<<<<<<<< * APPLY_UPPER = SOR_APPLY_UPPER * APPLY_LOWER = SOR_APPLY_LOWER */ __pyx_t_11 = __Pyx_PyInt_From_MatSORType(SOR_EISENSTAT); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 264, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_EISENSTAT, __pyx_t_11) < 0) __PYX_ERR(46, 264, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":265 * ZERO_INITIAL_GUESS = SOR_ZERO_INITIAL_GUESS * EISENSTAT = SOR_EISENSTAT * APPLY_UPPER = SOR_APPLY_UPPER # <<<<<<<<<<<<<< * APPLY_LOWER = SOR_APPLY_LOWER * */ __pyx_t_11 = __Pyx_PyInt_From_MatSORType(SOR_APPLY_UPPER); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_APPLY_UPPER, __pyx_t_11) < 0) __PYX_ERR(46, 265, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":266 * EISENSTAT = SOR_EISENSTAT * APPLY_UPPER = SOR_APPLY_UPPER * APPLY_LOWER = SOR_APPLY_LOWER # <<<<<<<<<<<<<< * * @cython.internal */ __pyx_t_11 = __Pyx_PyInt_From_MatSORType(SOR_APPLY_LOWER); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_APPLY_LOWER, __pyx_t_11) < 0) __PYX_ERR(46, 266, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Mat.pyx":249 * PD = MAT_SHIFT_POSITIVE_DEFINITE * * class MatSORType(object): # <<<<<<<<<<<<<< * """Matrix SOR type. * */ __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_MatSORType, __pyx_t_13, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_MatSORType, __pyx_t_11) < 0) __PYX_ERR(46, 249, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/Mat.pyx":340 * """ * * Type = MatType # <<<<<<<<<<<<<< * Option = MatOption * AssemblyType = MatAssemblyType */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_MatType); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_n_s_Type, __pyx_t_13) < 0) __PYX_ERR(46, 340, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Mat); /* "petsc4py/PETSc/Mat.pyx":341 * * Type = MatType * Option = MatOption # <<<<<<<<<<<<<< * AssemblyType = MatAssemblyType * InfoType = MatInfoType */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_MatOption); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_n_s_Option, __pyx_t_13) < 0) __PYX_ERR(46, 341, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Mat); /* "petsc4py/PETSc/Mat.pyx":342 * Type = MatType * Option = MatOption * AssemblyType = MatAssemblyType # <<<<<<<<<<<<<< * InfoType = MatInfoType * Structure = MatStructure */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_MatAssemblyType); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_n_s_AssemblyType, __pyx_t_13) < 0) __PYX_ERR(46, 342, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Mat); /* "petsc4py/PETSc/Mat.pyx":343 * Option = MatOption * AssemblyType = MatAssemblyType * InfoType = MatInfoType # <<<<<<<<<<<<<< * Structure = MatStructure * DuplicateOption = MatDuplicateOption */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_MatInfoType); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_n_s_InfoType, __pyx_t_13) < 0) __PYX_ERR(46, 343, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Mat); /* "petsc4py/PETSc/Mat.pyx":344 * AssemblyType = MatAssemblyType * InfoType = MatInfoType * Structure = MatStructure # <<<<<<<<<<<<<< * DuplicateOption = MatDuplicateOption * OrderingType = MatOrderingType */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_MatStructure); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_n_s_Structure, __pyx_t_13) < 0) __PYX_ERR(46, 344, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Mat); /* "petsc4py/PETSc/Mat.pyx":345 * InfoType = MatInfoType * Structure = MatStructure * DuplicateOption = MatDuplicateOption # <<<<<<<<<<<<<< * OrderingType = MatOrderingType * SolverType = MatSolverType */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_MatDuplicateOption); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 345, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_n_s_DuplicateOption, __pyx_t_13) < 0) __PYX_ERR(46, 345, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Mat); /* "petsc4py/PETSc/Mat.pyx":346 * Structure = MatStructure * DuplicateOption = MatDuplicateOption * OrderingType = MatOrderingType # <<<<<<<<<<<<<< * SolverType = MatSolverType * FactorShiftType = MatFactorShiftType */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_MatOrderingType); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_n_s_OrderingType, __pyx_t_13) < 0) __PYX_ERR(46, 346, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Mat); /* "petsc4py/PETSc/Mat.pyx":347 * DuplicateOption = MatDuplicateOption * OrderingType = MatOrderingType * SolverType = MatSolverType # <<<<<<<<<<<<<< * FactorShiftType = MatFactorShiftType * SORType = MatSORType */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_MatSolverType); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 347, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_n_s_SolverType, __pyx_t_13) < 0) __PYX_ERR(46, 347, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Mat); /* "petsc4py/PETSc/Mat.pyx":348 * OrderingType = MatOrderingType * SolverType = MatSolverType * FactorShiftType = MatFactorShiftType # <<<<<<<<<<<<<< * SORType = MatSORType * # */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_MatFactorShiftType); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_n_s_FactorShiftType, __pyx_t_13) < 0) __PYX_ERR(46, 348, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Mat); /* "petsc4py/PETSc/Mat.pyx":349 * SolverType = MatSolverType * FactorShiftType = MatFactorShiftType * SORType = MatSORType # <<<<<<<<<<<<<< * # * */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_MatSORType); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_n_s_SORType, __pyx_t_13) < 0) __PYX_ERR(46, 349, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Mat); /* "petsc4py/PETSc/Mat.pyx":2964 * # * * Stencil = MatStencil # <<<<<<<<<<<<<< * * def setStencil(self, dims: DimsSpec, starts: DimsSpec | None = None, dof: int = 1) -> None: */ if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_n_s_Stencil, ((PyObject *)__pyx_ptype_8petsc4py_5PETSc_MatStencil)) < 0) __PYX_ERR(46, 2964, __pyx_L1_error) PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Mat); /* "petsc4py/PETSc/Mat.pyx":3402 * return vecl * * getVecs = createVecs # <<<<<<<<<<<<<< * getVecRight = createVecRight * getVecLeft = createVecLeft */ __Pyx_GetNameInClass(__pyx_t_13, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_n_s_createVecs); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 3402, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_n_s_getVecs, __pyx_t_13) < 0) __PYX_ERR(46, 3402, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Mat); /* "petsc4py/PETSc/Mat.pyx":3403 * * getVecs = createVecs * getVecRight = createVecRight # <<<<<<<<<<<<<< * getVecLeft = createVecLeft * */ __Pyx_GetNameInClass(__pyx_t_13, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_n_s_createVecRight); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 3403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_n_s_getVecRight, __pyx_t_13) < 0) __PYX_ERR(46, 3403, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Mat); /* "petsc4py/PETSc/Mat.pyx":3404 * getVecs = createVecs * getVecRight = createVecRight * getVecLeft = createVecLeft # <<<<<<<<<<<<<< * * # */ __Pyx_GetNameInClass(__pyx_t_13, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_n_s_createVecLeft); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 3404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_n_s_getVecLeft, __pyx_t_13) < 0) __PYX_ERR(46, 3404, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Mat); /* "petsc4py/PETSc/Mat.pyx":5464 * # backward compatibility * * PtAP = ptap # <<<<<<<<<<<<<< * * # */ __Pyx_GetNameInClass(__pyx_t_13, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_n_s_ptap); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 5464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_n_s_PtAP, __pyx_t_13) < 0) __PYX_ERR(46, 5464, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Mat); /* "petsc4py/PETSc/Mat.pyx":5837 * # -------------------------------------------------------------------- * * del MatType # <<<<<<<<<<<<<< * del MatOption * del MatAssemblyType */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_MatType) < 0) __PYX_ERR(46, 5837, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":5838 * * del MatType * del MatOption # <<<<<<<<<<<<<< * del MatAssemblyType * del MatInfoType */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_MatOption) < 0) __PYX_ERR(46, 5838, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":5839 * del MatType * del MatOption * del MatAssemblyType # <<<<<<<<<<<<<< * del MatInfoType * del MatStructure */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_MatAssemblyType) < 0) __PYX_ERR(46, 5839, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":5840 * del MatOption * del MatAssemblyType * del MatInfoType # <<<<<<<<<<<<<< * del MatStructure * del MatDuplicateOption */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_MatInfoType) < 0) __PYX_ERR(46, 5840, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":5841 * del MatAssemblyType * del MatInfoType * del MatStructure # <<<<<<<<<<<<<< * del MatDuplicateOption * del MatOrderingType */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_MatStructure) < 0) __PYX_ERR(46, 5841, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":5842 * del MatInfoType * del MatStructure * del MatDuplicateOption # <<<<<<<<<<<<<< * del MatOrderingType * del MatSolverType */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_MatDuplicateOption) < 0) __PYX_ERR(46, 5842, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":5843 * del MatStructure * del MatDuplicateOption * del MatOrderingType # <<<<<<<<<<<<<< * del MatSolverType * del MatFactorShiftType */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_MatOrderingType) < 0) __PYX_ERR(46, 5843, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":5844 * del MatDuplicateOption * del MatOrderingType * del MatSolverType # <<<<<<<<<<<<<< * del MatFactorShiftType * del MatSORType */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_MatSolverType) < 0) __PYX_ERR(46, 5844, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":5845 * del MatOrderingType * del MatSolverType * del MatFactorShiftType # <<<<<<<<<<<<<< * del MatSORType * */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_MatFactorShiftType) < 0) __PYX_ERR(46, 5845, __pyx_L1_error) /* "petsc4py/PETSc/Mat.pyx":5846 * del MatSolverType * del MatFactorShiftType * del MatSORType # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_MatSORType) < 0) __PYX_ERR(46, 5846, __pyx_L1_error) /* "petsc4py/PETSc/MatPartitioning.pyx":3 * # -------------------------------------------------------------------- * * class MatPartitioningType(object): # <<<<<<<<<<<<<< * PARTITIONINGCURRENT = S_(MATPARTITIONINGCURRENT) * PARTITIONINGAVERAGE = S_(MATPARTITIONINGAVERAGE) */ __pyx_t_13 = __Pyx_PEP560_update_bases(__pyx_tuple__153); if (unlikely(!__pyx_t_13)) __PYX_ERR(47, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(47, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_13, __pyx_n_s_MatPartitioningType, __pyx_n_s_MatPartitioningType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(47, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_13 != __pyx_tuple__153) { if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_tuple__153) < 0))) __PYX_ERR(47, 3, __pyx_L1_error) } /* "petsc4py/PETSc/MatPartitioning.pyx":4 * * class MatPartitioningType(object): * PARTITIONINGCURRENT = S_(MATPARTITIONINGCURRENT) # <<<<<<<<<<<<<< * PARTITIONINGAVERAGE = S_(MATPARTITIONINGAVERAGE) * PARTITIONINGSQUARE = S_(MATPARTITIONINGSQUARE) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATPARTITIONINGCURRENT); if (unlikely(!__pyx_t_11)) __PYX_ERR(47, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_PARTITIONINGCURRENT, __pyx_t_11) < 0) __PYX_ERR(47, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/MatPartitioning.pyx":5 * class MatPartitioningType(object): * PARTITIONINGCURRENT = S_(MATPARTITIONINGCURRENT) * PARTITIONINGAVERAGE = S_(MATPARTITIONINGAVERAGE) # <<<<<<<<<<<<<< * PARTITIONINGSQUARE = S_(MATPARTITIONINGSQUARE) * PARTITIONINGPARMETIS = S_(MATPARTITIONINGPARMETIS) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATPARTITIONINGAVERAGE); if (unlikely(!__pyx_t_11)) __PYX_ERR(47, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_PARTITIONINGAVERAGE, __pyx_t_11) < 0) __PYX_ERR(47, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/MatPartitioning.pyx":6 * PARTITIONINGCURRENT = S_(MATPARTITIONINGCURRENT) * PARTITIONINGAVERAGE = S_(MATPARTITIONINGAVERAGE) * PARTITIONINGSQUARE = S_(MATPARTITIONINGSQUARE) # <<<<<<<<<<<<<< * PARTITIONINGPARMETIS = S_(MATPARTITIONINGPARMETIS) * PARTITIONINGCHACO = S_(MATPARTITIONINGCHACO) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATPARTITIONINGSQUARE); if (unlikely(!__pyx_t_11)) __PYX_ERR(47, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_PARTITIONINGSQUARE, __pyx_t_11) < 0) __PYX_ERR(47, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/MatPartitioning.pyx":7 * PARTITIONINGAVERAGE = S_(MATPARTITIONINGAVERAGE) * PARTITIONINGSQUARE = S_(MATPARTITIONINGSQUARE) * PARTITIONINGPARMETIS = S_(MATPARTITIONINGPARMETIS) # <<<<<<<<<<<<<< * PARTITIONINGCHACO = S_(MATPARTITIONINGCHACO) * PARTITIONINGPARTY = S_(MATPARTITIONINGPARTY) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATPARTITIONINGPARMETIS); if (unlikely(!__pyx_t_11)) __PYX_ERR(47, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_PARTITIONINGPARMETIS, __pyx_t_11) < 0) __PYX_ERR(47, 7, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/MatPartitioning.pyx":8 * PARTITIONINGSQUARE = S_(MATPARTITIONINGSQUARE) * PARTITIONINGPARMETIS = S_(MATPARTITIONINGPARMETIS) * PARTITIONINGCHACO = S_(MATPARTITIONINGCHACO) # <<<<<<<<<<<<<< * PARTITIONINGPARTY = S_(MATPARTITIONINGPARTY) * PARTITIONINGPTSCOTCH = S_(MATPARTITIONINGPTSCOTCH) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATPARTITIONINGCHACO); if (unlikely(!__pyx_t_11)) __PYX_ERR(47, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_PARTITIONINGCHACO, __pyx_t_11) < 0) __PYX_ERR(47, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/MatPartitioning.pyx":9 * PARTITIONINGPARMETIS = S_(MATPARTITIONINGPARMETIS) * PARTITIONINGCHACO = S_(MATPARTITIONINGCHACO) * PARTITIONINGPARTY = S_(MATPARTITIONINGPARTY) # <<<<<<<<<<<<<< * PARTITIONINGPTSCOTCH = S_(MATPARTITIONINGPTSCOTCH) * PARTITIONINGHIERARCH = S_(MATPARTITIONINGHIERARCH) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATPARTITIONINGPARTY); if (unlikely(!__pyx_t_11)) __PYX_ERR(47, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_PARTITIONINGPARTY, __pyx_t_11) < 0) __PYX_ERR(47, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/MatPartitioning.pyx":10 * PARTITIONINGCHACO = S_(MATPARTITIONINGCHACO) * PARTITIONINGPARTY = S_(MATPARTITIONINGPARTY) * PARTITIONINGPTSCOTCH = S_(MATPARTITIONINGPTSCOTCH) # <<<<<<<<<<<<<< * PARTITIONINGHIERARCH = S_(MATPARTITIONINGHIERARCH) * */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATPARTITIONINGPTSCOTCH); if (unlikely(!__pyx_t_11)) __PYX_ERR(47, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_PARTITIONINGPTSCOTCH, __pyx_t_11) < 0) __PYX_ERR(47, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/MatPartitioning.pyx":11 * PARTITIONINGPARTY = S_(MATPARTITIONINGPARTY) * PARTITIONINGPTSCOTCH = S_(MATPARTITIONINGPTSCOTCH) * PARTITIONINGHIERARCH = S_(MATPARTITIONINGHIERARCH) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(MATPARTITIONINGHIERARCH); if (unlikely(!__pyx_t_11)) __PYX_ERR(47, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_PARTITIONINGHIERARCH, __pyx_t_11) < 0) __PYX_ERR(47, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/MatPartitioning.pyx":3 * # -------------------------------------------------------------------- * * class MatPartitioningType(object): # <<<<<<<<<<<<<< * PARTITIONINGCURRENT = S_(MATPARTITIONINGCURRENT) * PARTITIONINGAVERAGE = S_(MATPARTITIONINGAVERAGE) */ __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_MatPartitioningType, __pyx_t_13, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(47, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_MatPartitioningType, __pyx_t_11) < 0) __PYX_ERR(47, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/MatPartitioning.pyx":18 * """Object for managing the partitioning of a matrix or graph.""" * * Type = MatPartitioningType # <<<<<<<<<<<<<< * * def __cinit__(self): */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_MatPartitioningType); if (unlikely(!__pyx_t_13)) __PYX_ERR(47, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_MatPartitioning, __pyx_n_s_Type, __pyx_t_13) < 0) __PYX_ERR(47, 18, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_MatPartitioning); /* "petsc4py/PETSc/MatPartitioning.pyx":159 * # -------------------------------------------------------------------- * * del MatPartitioningType # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_MatPartitioningType) < 0) __PYX_ERR(47, 159, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":3 * # -------------------------------------------------------------------- * * class PCType(object): # <<<<<<<<<<<<<< * """The preconditioner method.""" * NONE = S_(PCNONE) */ __pyx_t_13 = __Pyx_PEP560_update_bases(__pyx_tuple__155); if (unlikely(!__pyx_t_13)) __PYX_ERR(48, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(48, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_13, __pyx_n_s_PCType, __pyx_n_s_PCType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, __pyx_kp_s_The_preconditioner_method); if (unlikely(!__pyx_t_12)) __PYX_ERR(48, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_13 != __pyx_tuple__155) { if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_tuple__155) < 0))) __PYX_ERR(48, 3, __pyx_L1_error) } /* "petsc4py/PETSc/PC.pyx":5 * class PCType(object): * """The preconditioner method.""" * NONE = S_(PCNONE) # <<<<<<<<<<<<<< * JACOBI = S_(PCJACOBI) * SOR = S_(PCSOR) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PCNONE); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_NONE, __pyx_t_11) < 0) __PYX_ERR(48, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":6 * """The preconditioner method.""" * NONE = S_(PCNONE) * JACOBI = S_(PCJACOBI) # <<<<<<<<<<<<<< * SOR = S_(PCSOR) * LU = S_(PCLU) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PCJACOBI); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_JACOBI, __pyx_t_11) < 0) __PYX_ERR(48, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":7 * NONE = S_(PCNONE) * JACOBI = S_(PCJACOBI) * SOR = S_(PCSOR) # <<<<<<<<<<<<<< * LU = S_(PCLU) * QR = S_(PCQR) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PCSOR); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SOR, __pyx_t_11) < 0) __PYX_ERR(48, 7, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":8 * JACOBI = S_(PCJACOBI) * SOR = S_(PCSOR) * LU = S_(PCLU) # <<<<<<<<<<<<<< * QR = S_(PCQR) * SHELL = S_(PCSHELL) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PCLU); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_LU, __pyx_t_11) < 0) __PYX_ERR(48, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":9 * SOR = S_(PCSOR) * LU = S_(PCLU) * QR = S_(PCQR) # <<<<<<<<<<<<<< * SHELL = S_(PCSHELL) * BJACOBI = S_(PCBJACOBI) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PCQR); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_QR, __pyx_t_11) < 0) __PYX_ERR(48, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":10 * LU = S_(PCLU) * QR = S_(PCQR) * SHELL = S_(PCSHELL) # <<<<<<<<<<<<<< * BJACOBI = S_(PCBJACOBI) * VPBJACOBI = S_(PCVPBJACOBI) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PCSHELL); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SHELL, __pyx_t_11) < 0) __PYX_ERR(48, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":11 * QR = S_(PCQR) * SHELL = S_(PCSHELL) * BJACOBI = S_(PCBJACOBI) # <<<<<<<<<<<<<< * VPBJACOBI = S_(PCVPBJACOBI) * MG = S_(PCMG) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PCBJACOBI); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_BJACOBI, __pyx_t_11) < 0) __PYX_ERR(48, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":12 * SHELL = S_(PCSHELL) * BJACOBI = S_(PCBJACOBI) * VPBJACOBI = S_(PCVPBJACOBI) # <<<<<<<<<<<<<< * MG = S_(PCMG) * EISENSTAT = S_(PCEISENSTAT) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PCVPBJACOBI); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_VPBJACOBI, __pyx_t_11) < 0) __PYX_ERR(48, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":13 * BJACOBI = S_(PCBJACOBI) * VPBJACOBI = S_(PCVPBJACOBI) * MG = S_(PCMG) # <<<<<<<<<<<<<< * EISENSTAT = S_(PCEISENSTAT) * ILU = S_(PCILU) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PCMG); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_MG, __pyx_t_11) < 0) __PYX_ERR(48, 13, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":14 * VPBJACOBI = S_(PCVPBJACOBI) * MG = S_(PCMG) * EISENSTAT = S_(PCEISENSTAT) # <<<<<<<<<<<<<< * ILU = S_(PCILU) * ICC = S_(PCICC) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PCEISENSTAT); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_EISENSTAT, __pyx_t_11) < 0) __PYX_ERR(48, 14, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":15 * MG = S_(PCMG) * EISENSTAT = S_(PCEISENSTAT) * ILU = S_(PCILU) # <<<<<<<<<<<<<< * ICC = S_(PCICC) * ASM = S_(PCASM) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PCILU); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_ILU, __pyx_t_11) < 0) __PYX_ERR(48, 15, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":16 * EISENSTAT = S_(PCEISENSTAT) * ILU = S_(PCILU) * ICC = S_(PCICC) # <<<<<<<<<<<<<< * ASM = S_(PCASM) * GASM = S_(PCGASM) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PCICC); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_ICC, __pyx_t_11) < 0) __PYX_ERR(48, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":17 * ILU = S_(PCILU) * ICC = S_(PCICC) * ASM = S_(PCASM) # <<<<<<<<<<<<<< * GASM = S_(PCGASM) * KSP = S_(PCKSP) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PCASM); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_ASM, __pyx_t_11) < 0) __PYX_ERR(48, 17, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":18 * ICC = S_(PCICC) * ASM = S_(PCASM) * GASM = S_(PCGASM) # <<<<<<<<<<<<<< * KSP = S_(PCKSP) * COMPOSITE = S_(PCCOMPOSITE) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PCGASM); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_GASM, __pyx_t_11) < 0) __PYX_ERR(48, 18, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":19 * ASM = S_(PCASM) * GASM = S_(PCGASM) * KSP = S_(PCKSP) # <<<<<<<<<<<<<< * COMPOSITE = S_(PCCOMPOSITE) * REDUNDANT = S_(PCREDUNDANT) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PCKSP); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_KSP, __pyx_t_11) < 0) __PYX_ERR(48, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":20 * GASM = S_(PCGASM) * KSP = S_(PCKSP) * COMPOSITE = S_(PCCOMPOSITE) # <<<<<<<<<<<<<< * REDUNDANT = S_(PCREDUNDANT) * SPAI = S_(PCSPAI) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PCCOMPOSITE); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_COMPOSITE, __pyx_t_11) < 0) __PYX_ERR(48, 20, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":21 * KSP = S_(PCKSP) * COMPOSITE = S_(PCCOMPOSITE) * REDUNDANT = S_(PCREDUNDANT) # <<<<<<<<<<<<<< * SPAI = S_(PCSPAI) * NN = S_(PCNN) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PCREDUNDANT); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_REDUNDANT, __pyx_t_11) < 0) __PYX_ERR(48, 21, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":22 * COMPOSITE = S_(PCCOMPOSITE) * REDUNDANT = S_(PCREDUNDANT) * SPAI = S_(PCSPAI) # <<<<<<<<<<<<<< * NN = S_(PCNN) * CHOLESKY = S_(PCCHOLESKY) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PCSPAI); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SPAI, __pyx_t_11) < 0) __PYX_ERR(48, 22, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":23 * REDUNDANT = S_(PCREDUNDANT) * SPAI = S_(PCSPAI) * NN = S_(PCNN) # <<<<<<<<<<<<<< * CHOLESKY = S_(PCCHOLESKY) * PBJACOBI = S_(PCPBJACOBI) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PCNN); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_NN, __pyx_t_11) < 0) __PYX_ERR(48, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":24 * SPAI = S_(PCSPAI) * NN = S_(PCNN) * CHOLESKY = S_(PCCHOLESKY) # <<<<<<<<<<<<<< * PBJACOBI = S_(PCPBJACOBI) * MAT = S_(PCMAT) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PCCHOLESKY); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_CHOLESKY, __pyx_t_11) < 0) __PYX_ERR(48, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":25 * NN = S_(PCNN) * CHOLESKY = S_(PCCHOLESKY) * PBJACOBI = S_(PCPBJACOBI) # <<<<<<<<<<<<<< * MAT = S_(PCMAT) * HYPRE = S_(PCHYPRE) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PCPBJACOBI); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_PBJACOBI, __pyx_t_11) < 0) __PYX_ERR(48, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":26 * CHOLESKY = S_(PCCHOLESKY) * PBJACOBI = S_(PCPBJACOBI) * MAT = S_(PCMAT) # <<<<<<<<<<<<<< * HYPRE = S_(PCHYPRE) * PARMS = S_(PCPARMS) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PCMAT); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_MAT, __pyx_t_11) < 0) __PYX_ERR(48, 26, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":27 * PBJACOBI = S_(PCPBJACOBI) * MAT = S_(PCMAT) * HYPRE = S_(PCHYPRE) # <<<<<<<<<<<<<< * PARMS = S_(PCPARMS) * FIELDSPLIT = S_(PCFIELDSPLIT) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PCHYPRE); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_HYPRE, __pyx_t_11) < 0) __PYX_ERR(48, 27, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":28 * MAT = S_(PCMAT) * HYPRE = S_(PCHYPRE) * PARMS = S_(PCPARMS) # <<<<<<<<<<<<<< * FIELDSPLIT = S_(PCFIELDSPLIT) * TFS = S_(PCTFS) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PCPARMS); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_PARMS, __pyx_t_11) < 0) __PYX_ERR(48, 28, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":29 * HYPRE = S_(PCHYPRE) * PARMS = S_(PCPARMS) * FIELDSPLIT = S_(PCFIELDSPLIT) # <<<<<<<<<<<<<< * TFS = S_(PCTFS) * ML = S_(PCML) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PCFIELDSPLIT); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_FIELDSPLIT, __pyx_t_11) < 0) __PYX_ERR(48, 29, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":30 * PARMS = S_(PCPARMS) * FIELDSPLIT = S_(PCFIELDSPLIT) * TFS = S_(PCTFS) # <<<<<<<<<<<<<< * ML = S_(PCML) * GALERKIN = S_(PCGALERKIN) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PCTFS); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_TFS, __pyx_t_11) < 0) __PYX_ERR(48, 30, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":31 * FIELDSPLIT = S_(PCFIELDSPLIT) * TFS = S_(PCTFS) * ML = S_(PCML) # <<<<<<<<<<<<<< * GALERKIN = S_(PCGALERKIN) * EXOTIC = S_(PCEXOTIC) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PCML); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_ML, __pyx_t_11) < 0) __PYX_ERR(48, 31, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":32 * TFS = S_(PCTFS) * ML = S_(PCML) * GALERKIN = S_(PCGALERKIN) # <<<<<<<<<<<<<< * EXOTIC = S_(PCEXOTIC) * CP = S_(PCCP) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PCGALERKIN); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_GALERKIN, __pyx_t_11) < 0) __PYX_ERR(48, 32, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":33 * ML = S_(PCML) * GALERKIN = S_(PCGALERKIN) * EXOTIC = S_(PCEXOTIC) # <<<<<<<<<<<<<< * CP = S_(PCCP) * BFBT = S_(PCBFBT) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PCEXOTIC); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_EXOTIC, __pyx_t_11) < 0) __PYX_ERR(48, 33, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":34 * GALERKIN = S_(PCGALERKIN) * EXOTIC = S_(PCEXOTIC) * CP = S_(PCCP) # <<<<<<<<<<<<<< * BFBT = S_(PCBFBT) * LSC = S_(PCLSC) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PCCP); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_CP, __pyx_t_11) < 0) __PYX_ERR(48, 34, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":35 * EXOTIC = S_(PCEXOTIC) * CP = S_(PCCP) * BFBT = S_(PCBFBT) # <<<<<<<<<<<<<< * LSC = S_(PCLSC) * PYTHON = S_(PCPYTHON) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PCBFBT); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_BFBT, __pyx_t_11) < 0) __PYX_ERR(48, 35, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":36 * CP = S_(PCCP) * BFBT = S_(PCBFBT) * LSC = S_(PCLSC) # <<<<<<<<<<<<<< * PYTHON = S_(PCPYTHON) * PFMG = S_(PCPFMG) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PCLSC); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_LSC, __pyx_t_11) < 0) __PYX_ERR(48, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":37 * BFBT = S_(PCBFBT) * LSC = S_(PCLSC) * PYTHON = S_(PCPYTHON) # <<<<<<<<<<<<<< * PFMG = S_(PCPFMG) * SYSPFMG = S_(PCSYSPFMG) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PCPYTHON); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_PYTHON, __pyx_t_11) < 0) __PYX_ERR(48, 37, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":38 * LSC = S_(PCLSC) * PYTHON = S_(PCPYTHON) * PFMG = S_(PCPFMG) # <<<<<<<<<<<<<< * SYSPFMG = S_(PCSYSPFMG) * REDISTRIBUTE = S_(PCREDISTRIBUTE) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PCPFMG); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_PFMG, __pyx_t_11) < 0) __PYX_ERR(48, 38, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":39 * PYTHON = S_(PCPYTHON) * PFMG = S_(PCPFMG) * SYSPFMG = S_(PCSYSPFMG) # <<<<<<<<<<<<<< * REDISTRIBUTE = S_(PCREDISTRIBUTE) * SVD = S_(PCSVD) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PCSYSPFMG); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SYSPFMG, __pyx_t_11) < 0) __PYX_ERR(48, 39, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":40 * PFMG = S_(PCPFMG) * SYSPFMG = S_(PCSYSPFMG) * REDISTRIBUTE = S_(PCREDISTRIBUTE) # <<<<<<<<<<<<<< * SVD = S_(PCSVD) * GAMG = S_(PCGAMG) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PCREDISTRIBUTE); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_REDISTRIBUTE, __pyx_t_11) < 0) __PYX_ERR(48, 40, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":41 * SYSPFMG = S_(PCSYSPFMG) * REDISTRIBUTE = S_(PCREDISTRIBUTE) * SVD = S_(PCSVD) # <<<<<<<<<<<<<< * GAMG = S_(PCGAMG) * CHOWILUVIENNACL = S_(PCCHOWILUVIENNACL) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PCSVD); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SVD, __pyx_t_11) < 0) __PYX_ERR(48, 41, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":42 * REDISTRIBUTE = S_(PCREDISTRIBUTE) * SVD = S_(PCSVD) * GAMG = S_(PCGAMG) # <<<<<<<<<<<<<< * CHOWILUVIENNACL = S_(PCCHOWILUVIENNACL) * ROWSCALINGVIENNACL = S_(PCROWSCALINGVIENNACL) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PCGAMG); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_GAMG, __pyx_t_11) < 0) __PYX_ERR(48, 42, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":43 * SVD = S_(PCSVD) * GAMG = S_(PCGAMG) * CHOWILUVIENNACL = S_(PCCHOWILUVIENNACL) # <<<<<<<<<<<<<< * ROWSCALINGVIENNACL = S_(PCROWSCALINGVIENNACL) * SAVIENNACL = S_(PCSAVIENNACL) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PCCHOWILUVIENNACL); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_CHOWILUVIENNACL, __pyx_t_11) < 0) __PYX_ERR(48, 43, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":44 * GAMG = S_(PCGAMG) * CHOWILUVIENNACL = S_(PCCHOWILUVIENNACL) * ROWSCALINGVIENNACL = S_(PCROWSCALINGVIENNACL) # <<<<<<<<<<<<<< * SAVIENNACL = S_(PCSAVIENNACL) * BDDC = S_(PCBDDC) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PCROWSCALINGVIENNACL); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_ROWSCALINGVIENNACL, __pyx_t_11) < 0) __PYX_ERR(48, 44, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":45 * CHOWILUVIENNACL = S_(PCCHOWILUVIENNACL) * ROWSCALINGVIENNACL = S_(PCROWSCALINGVIENNACL) * SAVIENNACL = S_(PCSAVIENNACL) # <<<<<<<<<<<<<< * BDDC = S_(PCBDDC) * KACZMARZ = S_(PCKACZMARZ) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PCSAVIENNACL); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SAVIENNACL, __pyx_t_11) < 0) __PYX_ERR(48, 45, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":46 * ROWSCALINGVIENNACL = S_(PCROWSCALINGVIENNACL) * SAVIENNACL = S_(PCSAVIENNACL) * BDDC = S_(PCBDDC) # <<<<<<<<<<<<<< * KACZMARZ = S_(PCKACZMARZ) * TELESCOPE = S_(PCTELESCOPE) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PCBDDC); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_BDDC, __pyx_t_11) < 0) __PYX_ERR(48, 46, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":47 * SAVIENNACL = S_(PCSAVIENNACL) * BDDC = S_(PCBDDC) * KACZMARZ = S_(PCKACZMARZ) # <<<<<<<<<<<<<< * TELESCOPE = S_(PCTELESCOPE) * PATCH = S_(PCPATCH) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PCKACZMARZ); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_KACZMARZ, __pyx_t_11) < 0) __PYX_ERR(48, 47, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":48 * BDDC = S_(PCBDDC) * KACZMARZ = S_(PCKACZMARZ) * TELESCOPE = S_(PCTELESCOPE) # <<<<<<<<<<<<<< * PATCH = S_(PCPATCH) * LMVM = S_(PCLMVM) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PCTELESCOPE); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_TELESCOPE, __pyx_t_11) < 0) __PYX_ERR(48, 48, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":49 * KACZMARZ = S_(PCKACZMARZ) * TELESCOPE = S_(PCTELESCOPE) * PATCH = S_(PCPATCH) # <<<<<<<<<<<<<< * LMVM = S_(PCLMVM) * HMG = S_(PCHMG) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PCPATCH); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_PATCH, __pyx_t_11) < 0) __PYX_ERR(48, 49, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":50 * TELESCOPE = S_(PCTELESCOPE) * PATCH = S_(PCPATCH) * LMVM = S_(PCLMVM) # <<<<<<<<<<<<<< * HMG = S_(PCHMG) * DEFLATION = S_(PCDEFLATION) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PCLMVM); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_LMVM, __pyx_t_11) < 0) __PYX_ERR(48, 50, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":51 * PATCH = S_(PCPATCH) * LMVM = S_(PCLMVM) * HMG = S_(PCHMG) # <<<<<<<<<<<<<< * DEFLATION = S_(PCDEFLATION) * HPDDM = S_(PCHPDDM) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PCHMG); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_HMG, __pyx_t_11) < 0) __PYX_ERR(48, 51, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":52 * LMVM = S_(PCLMVM) * HMG = S_(PCHMG) * DEFLATION = S_(PCDEFLATION) # <<<<<<<<<<<<<< * HPDDM = S_(PCHPDDM) * H2OPUS = S_(PCH2OPUS) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PCDEFLATION); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DEFLATION, __pyx_t_11) < 0) __PYX_ERR(48, 52, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":53 * HMG = S_(PCHMG) * DEFLATION = S_(PCDEFLATION) * HPDDM = S_(PCHPDDM) # <<<<<<<<<<<<<< * H2OPUS = S_(PCH2OPUS) * */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PCHPDDM); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_HPDDM, __pyx_t_11) < 0) __PYX_ERR(48, 53, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":54 * DEFLATION = S_(PCDEFLATION) * HPDDM = S_(PCHPDDM) * H2OPUS = S_(PCH2OPUS) # <<<<<<<<<<<<<< * * class PCSide(object): */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PCH2OPUS); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_H2OPUS, __pyx_t_11) < 0) __PYX_ERR(48, 54, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":3 * # -------------------------------------------------------------------- * * class PCType(object): # <<<<<<<<<<<<<< * """The preconditioner method.""" * NONE = S_(PCNONE) */ __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_PCType, __pyx_t_13, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_PCType, __pyx_t_11) < 0) __PYX_ERR(48, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/PC.pyx":56 * H2OPUS = S_(PCH2OPUS) * * class PCSide(object): # <<<<<<<<<<<<<< * """The manner in which the preconditioner is applied.""" * # native */ __pyx_t_13 = __Pyx_PEP560_update_bases(__pyx_tuple__157); if (unlikely(!__pyx_t_13)) __PYX_ERR(48, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(48, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_13, __pyx_n_s_PCSide, __pyx_n_s_PCSide, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, __pyx_kp_s_The_manner_in_which_the_precondi); if (unlikely(!__pyx_t_12)) __PYX_ERR(48, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_13 != __pyx_tuple__157) { if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_tuple__157) < 0))) __PYX_ERR(48, 56, __pyx_L1_error) } /* "petsc4py/PETSc/PC.pyx":59 * """The manner in which the preconditioner is applied.""" * # native * LEFT = PC_LEFT # <<<<<<<<<<<<<< * RIGHT = PC_RIGHT * SYMMETRIC = PC_SYMMETRIC */ __pyx_t_11 = __Pyx_PyInt_From_PCSide(PC_LEFT); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_LEFT, __pyx_t_11) < 0) __PYX_ERR(48, 59, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":60 * # native * LEFT = PC_LEFT * RIGHT = PC_RIGHT # <<<<<<<<<<<<<< * SYMMETRIC = PC_SYMMETRIC * # aliases */ __pyx_t_11 = __Pyx_PyInt_From_PCSide(PC_RIGHT); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_RIGHT, __pyx_t_11) < 0) __PYX_ERR(48, 60, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":61 * LEFT = PC_LEFT * RIGHT = PC_RIGHT * SYMMETRIC = PC_SYMMETRIC # <<<<<<<<<<<<<< * # aliases * L = LEFT */ __pyx_t_11 = __Pyx_PyInt_From_PCSide(PC_SYMMETRIC); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SYMMETRIC, __pyx_t_11) < 0) __PYX_ERR(48, 61, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":63 * SYMMETRIC = PC_SYMMETRIC * # aliases * L = LEFT # <<<<<<<<<<<<<< * R = RIGHT * S = SYMMETRIC */ __pyx_t_11 = PyObject_GetItem(__pyx_t_12, __pyx_n_s_LEFT); if (unlikely(!__pyx_t_11)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_LEFT); } if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_L, __pyx_t_11) < 0) __PYX_ERR(48, 63, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":64 * # aliases * L = LEFT * R = RIGHT # <<<<<<<<<<<<<< * S = SYMMETRIC * */ __pyx_t_11 = PyObject_GetItem(__pyx_t_12, __pyx_n_s_RIGHT); if (unlikely(!__pyx_t_11)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_RIGHT); } if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_R, __pyx_t_11) < 0) __PYX_ERR(48, 64, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":65 * L = LEFT * R = RIGHT * S = SYMMETRIC # <<<<<<<<<<<<<< * * class PCASMType(object): */ __pyx_t_11 = PyObject_GetItem(__pyx_t_12, __pyx_n_s_SYMMETRIC); if (unlikely(!__pyx_t_11)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_SYMMETRIC); } if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_S, __pyx_t_11) < 0) __PYX_ERR(48, 65, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":56 * H2OPUS = S_(PCH2OPUS) * * class PCSide(object): # <<<<<<<<<<<<<< * """The manner in which the preconditioner is applied.""" * # native */ __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_PCSide, __pyx_t_13, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_PCSide, __pyx_t_11) < 0) __PYX_ERR(48, 56, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/PC.pyx":67 * S = SYMMETRIC * * class PCASMType(object): # <<<<<<<<<<<<<< * """The *ASM* subtype.""" * NONE = PC_ASM_NONE */ __pyx_t_13 = __Pyx_PEP560_update_bases(__pyx_tuple__159); if (unlikely(!__pyx_t_13)) __PYX_ERR(48, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(48, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_13, __pyx_n_s_PCASMType, __pyx_n_s_PCASMType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, __pyx_kp_s_The_ASM_subtype); if (unlikely(!__pyx_t_12)) __PYX_ERR(48, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_13 != __pyx_tuple__159) { if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_tuple__159) < 0))) __PYX_ERR(48, 67, __pyx_L1_error) } /* "petsc4py/PETSc/PC.pyx":69 * class PCASMType(object): * """The *ASM* subtype.""" * NONE = PC_ASM_NONE # <<<<<<<<<<<<<< * BASIC = PC_ASM_BASIC * RESTRICT = PC_ASM_RESTRICT */ __pyx_t_11 = __Pyx_PyInt_From_PCASMType(PC_ASM_NONE); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_NONE, __pyx_t_11) < 0) __PYX_ERR(48, 69, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":70 * """The *ASM* subtype.""" * NONE = PC_ASM_NONE * BASIC = PC_ASM_BASIC # <<<<<<<<<<<<<< * RESTRICT = PC_ASM_RESTRICT * INTERPOLATE = PC_ASM_INTERPOLATE */ __pyx_t_11 = __Pyx_PyInt_From_PCASMType(PC_ASM_BASIC); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_BASIC, __pyx_t_11) < 0) __PYX_ERR(48, 70, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":71 * NONE = PC_ASM_NONE * BASIC = PC_ASM_BASIC * RESTRICT = PC_ASM_RESTRICT # <<<<<<<<<<<<<< * INTERPOLATE = PC_ASM_INTERPOLATE * */ __pyx_t_11 = __Pyx_PyInt_From_PCASMType(PC_ASM_RESTRICT); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_RESTRICT, __pyx_t_11) < 0) __PYX_ERR(48, 71, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":72 * BASIC = PC_ASM_BASIC * RESTRICT = PC_ASM_RESTRICT * INTERPOLATE = PC_ASM_INTERPOLATE # <<<<<<<<<<<<<< * * class PCGASMType(object): */ __pyx_t_11 = __Pyx_PyInt_From_PCASMType(PC_ASM_INTERPOLATE); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_INTERPOLATE, __pyx_t_11) < 0) __PYX_ERR(48, 72, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":67 * S = SYMMETRIC * * class PCASMType(object): # <<<<<<<<<<<<<< * """The *ASM* subtype.""" * NONE = PC_ASM_NONE */ __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_PCASMType, __pyx_t_13, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_PCASMType, __pyx_t_11) < 0) __PYX_ERR(48, 67, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/PC.pyx":74 * INTERPOLATE = PC_ASM_INTERPOLATE * * class PCGASMType(object): # <<<<<<<<<<<<<< * """The *GASM* subtype.""" * NONE = PC_GASM_NONE */ __pyx_t_13 = __Pyx_PEP560_update_bases(__pyx_tuple__161); if (unlikely(!__pyx_t_13)) __PYX_ERR(48, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(48, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_13, __pyx_n_s_PCGASMType, __pyx_n_s_PCGASMType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, __pyx_kp_s_The_GASM_subtype); if (unlikely(!__pyx_t_12)) __PYX_ERR(48, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_13 != __pyx_tuple__161) { if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_tuple__161) < 0))) __PYX_ERR(48, 74, __pyx_L1_error) } /* "petsc4py/PETSc/PC.pyx":76 * class PCGASMType(object): * """The *GASM* subtype.""" * NONE = PC_GASM_NONE # <<<<<<<<<<<<<< * BASIC = PC_GASM_BASIC * RESTRICT = PC_GASM_RESTRICT */ __pyx_t_11 = __Pyx_PyInt_From_PCGASMType(PC_GASM_NONE); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_NONE, __pyx_t_11) < 0) __PYX_ERR(48, 76, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":77 * """The *GASM* subtype.""" * NONE = PC_GASM_NONE * BASIC = PC_GASM_BASIC # <<<<<<<<<<<<<< * RESTRICT = PC_GASM_RESTRICT * INTERPOLATE = PC_GASM_INTERPOLATE */ __pyx_t_11 = __Pyx_PyInt_From_PCGASMType(PC_GASM_BASIC); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_BASIC, __pyx_t_11) < 0) __PYX_ERR(48, 77, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":78 * NONE = PC_GASM_NONE * BASIC = PC_GASM_BASIC * RESTRICT = PC_GASM_RESTRICT # <<<<<<<<<<<<<< * INTERPOLATE = PC_GASM_INTERPOLATE * */ __pyx_t_11 = __Pyx_PyInt_From_PCGASMType(PC_GASM_RESTRICT); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_RESTRICT, __pyx_t_11) < 0) __PYX_ERR(48, 78, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":79 * BASIC = PC_GASM_BASIC * RESTRICT = PC_GASM_RESTRICT * INTERPOLATE = PC_GASM_INTERPOLATE # <<<<<<<<<<<<<< * * class PCMGType(object): */ __pyx_t_11 = __Pyx_PyInt_From_PCGASMType(PC_GASM_INTERPOLATE); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_INTERPOLATE, __pyx_t_11) < 0) __PYX_ERR(48, 79, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":74 * INTERPOLATE = PC_ASM_INTERPOLATE * * class PCGASMType(object): # <<<<<<<<<<<<<< * """The *GASM* subtype.""" * NONE = PC_GASM_NONE */ __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_PCGASMType, __pyx_t_13, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_PCGASMType, __pyx_t_11) < 0) __PYX_ERR(48, 74, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/PC.pyx":81 * INTERPOLATE = PC_GASM_INTERPOLATE * * class PCMGType(object): # <<<<<<<<<<<<<< * """The *MG* subtype.""" * MULTIPLICATIVE = PC_MG_MULTIPLICATIVE */ __pyx_t_13 = __Pyx_PEP560_update_bases(__pyx_tuple__163); if (unlikely(!__pyx_t_13)) __PYX_ERR(48, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(48, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_13, __pyx_n_s_PCMGType, __pyx_n_s_PCMGType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, __pyx_kp_s_The_MG_subtype); if (unlikely(!__pyx_t_12)) __PYX_ERR(48, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_13 != __pyx_tuple__163) { if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_tuple__163) < 0))) __PYX_ERR(48, 81, __pyx_L1_error) } /* "petsc4py/PETSc/PC.pyx":83 * class PCMGType(object): * """The *MG* subtype.""" * MULTIPLICATIVE = PC_MG_MULTIPLICATIVE # <<<<<<<<<<<<<< * ADDITIVE = PC_MG_ADDITIVE * FULL = PC_MG_FULL */ __pyx_t_11 = __Pyx_PyInt_From_PCMGType(PC_MG_MULTIPLICATIVE); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_MULTIPLICATIVE, __pyx_t_11) < 0) __PYX_ERR(48, 83, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":84 * """The *MG* subtype.""" * MULTIPLICATIVE = PC_MG_MULTIPLICATIVE * ADDITIVE = PC_MG_ADDITIVE # <<<<<<<<<<<<<< * FULL = PC_MG_FULL * KASKADE = PC_MG_KASKADE */ __pyx_t_11 = __Pyx_PyInt_From_PCMGType(PC_MG_ADDITIVE); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_ADDITIVE, __pyx_t_11) < 0) __PYX_ERR(48, 84, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":85 * MULTIPLICATIVE = PC_MG_MULTIPLICATIVE * ADDITIVE = PC_MG_ADDITIVE * FULL = PC_MG_FULL # <<<<<<<<<<<<<< * KASKADE = PC_MG_KASKADE * */ __pyx_t_11 = __Pyx_PyInt_From_PCMGType(PC_MG_FULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_FULL, __pyx_t_11) < 0) __PYX_ERR(48, 85, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":86 * ADDITIVE = PC_MG_ADDITIVE * FULL = PC_MG_FULL * KASKADE = PC_MG_KASKADE # <<<<<<<<<<<<<< * * class PCMGCycleType(object): */ __pyx_t_11 = __Pyx_PyInt_From_PCMGType(PC_MG_KASKADE); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_KASKADE, __pyx_t_11) < 0) __PYX_ERR(48, 86, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":81 * INTERPOLATE = PC_GASM_INTERPOLATE * * class PCMGType(object): # <<<<<<<<<<<<<< * """The *MG* subtype.""" * MULTIPLICATIVE = PC_MG_MULTIPLICATIVE */ __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_PCMGType, __pyx_t_13, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_PCMGType, __pyx_t_11) < 0) __PYX_ERR(48, 81, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/PC.pyx":88 * KASKADE = PC_MG_KASKADE * * class PCMGCycleType(object): # <<<<<<<<<<<<<< * """The *MG* cycle type.""" * V = PC_MG_CYCLE_V */ __pyx_t_13 = __Pyx_PEP560_update_bases(__pyx_tuple__165); if (unlikely(!__pyx_t_13)) __PYX_ERR(48, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(48, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_13, __pyx_n_s_PCMGCycleType, __pyx_n_s_PCMGCycleType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, __pyx_kp_s_The_MG_cycle_type); if (unlikely(!__pyx_t_12)) __PYX_ERR(48, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_13 != __pyx_tuple__165) { if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_tuple__165) < 0))) __PYX_ERR(48, 88, __pyx_L1_error) } /* "petsc4py/PETSc/PC.pyx":90 * class PCMGCycleType(object): * """The *MG* cycle type.""" * V = PC_MG_CYCLE_V # <<<<<<<<<<<<<< * W = PC_MG_CYCLE_W * */ __pyx_t_11 = __Pyx_PyInt_From_PCMGCycleType(PC_MG_CYCLE_V); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_V, __pyx_t_11) < 0) __PYX_ERR(48, 90, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":91 * """The *MG* cycle type.""" * V = PC_MG_CYCLE_V * W = PC_MG_CYCLE_W # <<<<<<<<<<<<<< * * class PCGAMGType(object): */ __pyx_t_11 = __Pyx_PyInt_From_PCMGCycleType(PC_MG_CYCLE_W); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_W, __pyx_t_11) < 0) __PYX_ERR(48, 91, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":88 * KASKADE = PC_MG_KASKADE * * class PCMGCycleType(object): # <<<<<<<<<<<<<< * """The *MG* cycle type.""" * V = PC_MG_CYCLE_V */ __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_PCMGCycleType, __pyx_t_13, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_PCMGCycleType, __pyx_t_11) < 0) __PYX_ERR(48, 88, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/PC.pyx":93 * W = PC_MG_CYCLE_W * * class PCGAMGType(object): # <<<<<<<<<<<<<< * """The *GAMG* subtype.""" * AGG = S_(PCGAMGAGG) */ __pyx_t_13 = __Pyx_PEP560_update_bases(__pyx_tuple__167); if (unlikely(!__pyx_t_13)) __PYX_ERR(48, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(48, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_13, __pyx_n_s_PCGAMGType, __pyx_n_s_PCGAMGType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, __pyx_kp_s_The_GAMG_subtype); if (unlikely(!__pyx_t_12)) __PYX_ERR(48, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_13 != __pyx_tuple__167) { if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_tuple__167) < 0))) __PYX_ERR(48, 93, __pyx_L1_error) } /* "petsc4py/PETSc/PC.pyx":95 * class PCGAMGType(object): * """The *GAMG* subtype.""" * AGG = S_(PCGAMGAGG) # <<<<<<<<<<<<<< * GEO = S_(PCGAMGGEO) * CLASSICAL = S_(PCGAMGCLASSICAL) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PCGAMGAGG); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_AGG, __pyx_t_11) < 0) __PYX_ERR(48, 95, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":96 * """The *GAMG* subtype.""" * AGG = S_(PCGAMGAGG) * GEO = S_(PCGAMGGEO) # <<<<<<<<<<<<<< * CLASSICAL = S_(PCGAMGCLASSICAL) * */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PCGAMGGEO); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_GEO, __pyx_t_11) < 0) __PYX_ERR(48, 96, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":97 * AGG = S_(PCGAMGAGG) * GEO = S_(PCGAMGGEO) * CLASSICAL = S_(PCGAMGCLASSICAL) # <<<<<<<<<<<<<< * * class PCCompositeType(object): */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PCGAMGCLASSICAL); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_CLASSICAL, __pyx_t_11) < 0) __PYX_ERR(48, 97, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":93 * W = PC_MG_CYCLE_W * * class PCGAMGType(object): # <<<<<<<<<<<<<< * """The *GAMG* subtype.""" * AGG = S_(PCGAMGAGG) */ __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_PCGAMGType, __pyx_t_13, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_PCGAMGType, __pyx_t_11) < 0) __PYX_ERR(48, 93, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/PC.pyx":99 * CLASSICAL = S_(PCGAMGCLASSICAL) * * class PCCompositeType(object): # <<<<<<<<<<<<<< * """The composite type.""" * ADDITIVE = PC_COMPOSITE_ADDITIVE */ __pyx_t_13 = __Pyx_PEP560_update_bases(__pyx_tuple__169); if (unlikely(!__pyx_t_13)) __PYX_ERR(48, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(48, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_13, __pyx_n_s_PCCompositeType, __pyx_n_s_PCCompositeType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, __pyx_kp_s_The_composite_type); if (unlikely(!__pyx_t_12)) __PYX_ERR(48, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_13 != __pyx_tuple__169) { if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_tuple__169) < 0))) __PYX_ERR(48, 99, __pyx_L1_error) } /* "petsc4py/PETSc/PC.pyx":101 * class PCCompositeType(object): * """The composite type.""" * ADDITIVE = PC_COMPOSITE_ADDITIVE # <<<<<<<<<<<<<< * MULTIPLICATIVE = PC_COMPOSITE_MULTIPLICATIVE * SYMMETRIC_MULTIPLICATIVE = PC_COMPOSITE_SYMMETRIC_MULTIPLICATIVE */ __pyx_t_11 = __Pyx_PyInt_From_PCCompositeType(PC_COMPOSITE_ADDITIVE); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_ADDITIVE, __pyx_t_11) < 0) __PYX_ERR(48, 101, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":102 * """The composite type.""" * ADDITIVE = PC_COMPOSITE_ADDITIVE * MULTIPLICATIVE = PC_COMPOSITE_MULTIPLICATIVE # <<<<<<<<<<<<<< * SYMMETRIC_MULTIPLICATIVE = PC_COMPOSITE_SYMMETRIC_MULTIPLICATIVE * SPECIAL = PC_COMPOSITE_SPECIAL */ __pyx_t_11 = __Pyx_PyInt_From_PCCompositeType(PC_COMPOSITE_MULTIPLICATIVE); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_MULTIPLICATIVE, __pyx_t_11) < 0) __PYX_ERR(48, 102, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":103 * ADDITIVE = PC_COMPOSITE_ADDITIVE * MULTIPLICATIVE = PC_COMPOSITE_MULTIPLICATIVE * SYMMETRIC_MULTIPLICATIVE = PC_COMPOSITE_SYMMETRIC_MULTIPLICATIVE # <<<<<<<<<<<<<< * SPECIAL = PC_COMPOSITE_SPECIAL * SCHUR = PC_COMPOSITE_SCHUR */ __pyx_t_11 = __Pyx_PyInt_From_PCCompositeType(PC_COMPOSITE_SYMMETRIC_MULTIPLICATIVE); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SYMMETRIC_MULTIPLICATIVE, __pyx_t_11) < 0) __PYX_ERR(48, 103, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":104 * MULTIPLICATIVE = PC_COMPOSITE_MULTIPLICATIVE * SYMMETRIC_MULTIPLICATIVE = PC_COMPOSITE_SYMMETRIC_MULTIPLICATIVE * SPECIAL = PC_COMPOSITE_SPECIAL # <<<<<<<<<<<<<< * SCHUR = PC_COMPOSITE_SCHUR * */ __pyx_t_11 = __Pyx_PyInt_From_PCCompositeType(PC_COMPOSITE_SPECIAL); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SPECIAL, __pyx_t_11) < 0) __PYX_ERR(48, 104, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":105 * SYMMETRIC_MULTIPLICATIVE = PC_COMPOSITE_SYMMETRIC_MULTIPLICATIVE * SPECIAL = PC_COMPOSITE_SPECIAL * SCHUR = PC_COMPOSITE_SCHUR # <<<<<<<<<<<<<< * * class PCFieldSplitSchurPreType(object): */ __pyx_t_11 = __Pyx_PyInt_From_PCCompositeType(PC_COMPOSITE_SCHUR); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SCHUR, __pyx_t_11) < 0) __PYX_ERR(48, 105, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":99 * CLASSICAL = S_(PCGAMGCLASSICAL) * * class PCCompositeType(object): # <<<<<<<<<<<<<< * """The composite type.""" * ADDITIVE = PC_COMPOSITE_ADDITIVE */ __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_PCCompositeType, __pyx_t_13, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_PCCompositeType, __pyx_t_11) < 0) __PYX_ERR(48, 99, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/PC.pyx":107 * SCHUR = PC_COMPOSITE_SCHUR * * class PCFieldSplitSchurPreType(object): # <<<<<<<<<<<<<< * """The field split Schur subtype.""" * SELF = PC_FIELDSPLIT_SCHUR_PRE_SELF */ __pyx_t_13 = __Pyx_PEP560_update_bases(__pyx_tuple__171); if (unlikely(!__pyx_t_13)) __PYX_ERR(48, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(48, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_13, __pyx_n_s_PCFieldSplitSchurPreType, __pyx_n_s_PCFieldSplitSchurPreType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, __pyx_kp_s_The_field_split_Schur_subtype); if (unlikely(!__pyx_t_12)) __PYX_ERR(48, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_13 != __pyx_tuple__171) { if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_tuple__171) < 0))) __PYX_ERR(48, 107, __pyx_L1_error) } /* "petsc4py/PETSc/PC.pyx":109 * class PCFieldSplitSchurPreType(object): * """The field split Schur subtype.""" * SELF = PC_FIELDSPLIT_SCHUR_PRE_SELF # <<<<<<<<<<<<<< * SELFP = PC_FIELDSPLIT_SCHUR_PRE_SELFP * A11 = PC_FIELDSPLIT_SCHUR_PRE_A11 */ __pyx_t_11 = __Pyx_PyInt_From_PCFieldSplitSchurPreType(PC_FIELDSPLIT_SCHUR_PRE_SELF); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SELF, __pyx_t_11) < 0) __PYX_ERR(48, 109, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":110 * """The field split Schur subtype.""" * SELF = PC_FIELDSPLIT_SCHUR_PRE_SELF * SELFP = PC_FIELDSPLIT_SCHUR_PRE_SELFP # <<<<<<<<<<<<<< * A11 = PC_FIELDSPLIT_SCHUR_PRE_A11 * USER = PC_FIELDSPLIT_SCHUR_PRE_USER */ __pyx_t_11 = __Pyx_PyInt_From_PCFieldSplitSchurPreType(PC_FIELDSPLIT_SCHUR_PRE_SELFP); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SELFP, __pyx_t_11) < 0) __PYX_ERR(48, 110, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":111 * SELF = PC_FIELDSPLIT_SCHUR_PRE_SELF * SELFP = PC_FIELDSPLIT_SCHUR_PRE_SELFP * A11 = PC_FIELDSPLIT_SCHUR_PRE_A11 # <<<<<<<<<<<<<< * USER = PC_FIELDSPLIT_SCHUR_PRE_USER * FULL = PC_FIELDSPLIT_SCHUR_PRE_FULL */ __pyx_t_11 = __Pyx_PyInt_From_PCFieldSplitSchurPreType(PC_FIELDSPLIT_SCHUR_PRE_A11); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_A11, __pyx_t_11) < 0) __PYX_ERR(48, 111, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":112 * SELFP = PC_FIELDSPLIT_SCHUR_PRE_SELFP * A11 = PC_FIELDSPLIT_SCHUR_PRE_A11 * USER = PC_FIELDSPLIT_SCHUR_PRE_USER # <<<<<<<<<<<<<< * FULL = PC_FIELDSPLIT_SCHUR_PRE_FULL * */ __pyx_t_11 = __Pyx_PyInt_From_PCFieldSplitSchurPreType(PC_FIELDSPLIT_SCHUR_PRE_USER); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_USER, __pyx_t_11) < 0) __PYX_ERR(48, 112, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":113 * A11 = PC_FIELDSPLIT_SCHUR_PRE_A11 * USER = PC_FIELDSPLIT_SCHUR_PRE_USER * FULL = PC_FIELDSPLIT_SCHUR_PRE_FULL # <<<<<<<<<<<<<< * * class PCFieldSplitSchurFactType(object): */ __pyx_t_11 = __Pyx_PyInt_From_PCFieldSplitSchurPreType(PC_FIELDSPLIT_SCHUR_PRE_FULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_FULL, __pyx_t_11) < 0) __PYX_ERR(48, 113, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":107 * SCHUR = PC_COMPOSITE_SCHUR * * class PCFieldSplitSchurPreType(object): # <<<<<<<<<<<<<< * """The field split Schur subtype.""" * SELF = PC_FIELDSPLIT_SCHUR_PRE_SELF */ __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_PCFieldSplitSchurPreType, __pyx_t_13, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_PCFieldSplitSchurPreType, __pyx_t_11) < 0) __PYX_ERR(48, 107, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/PC.pyx":115 * FULL = PC_FIELDSPLIT_SCHUR_PRE_FULL * * class PCFieldSplitSchurFactType(object): # <<<<<<<<<<<<<< * """The field split Schur factorization type.""" * DIAG = PC_FIELDSPLIT_SCHUR_FACT_DIAG */ __pyx_t_13 = __Pyx_PEP560_update_bases(__pyx_tuple__173); if (unlikely(!__pyx_t_13)) __PYX_ERR(48, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(48, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_13, __pyx_n_s_PCFieldSplitSchurFactType, __pyx_n_s_PCFieldSplitSchurFactType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, __pyx_kp_s_The_field_split_Schur_factorizat); if (unlikely(!__pyx_t_12)) __PYX_ERR(48, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_13 != __pyx_tuple__173) { if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_tuple__173) < 0))) __PYX_ERR(48, 115, __pyx_L1_error) } /* "petsc4py/PETSc/PC.pyx":117 * class PCFieldSplitSchurFactType(object): * """The field split Schur factorization type.""" * DIAG = PC_FIELDSPLIT_SCHUR_FACT_DIAG # <<<<<<<<<<<<<< * LOWER = PC_FIELDSPLIT_SCHUR_FACT_LOWER * UPPER = PC_FIELDSPLIT_SCHUR_FACT_UPPER */ __pyx_t_11 = __Pyx_PyInt_From_PCFieldSplitSchurFactType(PC_FIELDSPLIT_SCHUR_FACT_DIAG); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DIAG, __pyx_t_11) < 0) __PYX_ERR(48, 117, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":118 * """The field split Schur factorization type.""" * DIAG = PC_FIELDSPLIT_SCHUR_FACT_DIAG * LOWER = PC_FIELDSPLIT_SCHUR_FACT_LOWER # <<<<<<<<<<<<<< * UPPER = PC_FIELDSPLIT_SCHUR_FACT_UPPER * FULL = PC_FIELDSPLIT_SCHUR_FACT_FULL */ __pyx_t_11 = __Pyx_PyInt_From_PCFieldSplitSchurFactType(PC_FIELDSPLIT_SCHUR_FACT_LOWER); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_LOWER, __pyx_t_11) < 0) __PYX_ERR(48, 118, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":119 * DIAG = PC_FIELDSPLIT_SCHUR_FACT_DIAG * LOWER = PC_FIELDSPLIT_SCHUR_FACT_LOWER * UPPER = PC_FIELDSPLIT_SCHUR_FACT_UPPER # <<<<<<<<<<<<<< * FULL = PC_FIELDSPLIT_SCHUR_FACT_FULL * */ __pyx_t_11 = __Pyx_PyInt_From_PCFieldSplitSchurFactType(PC_FIELDSPLIT_SCHUR_FACT_UPPER); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_UPPER, __pyx_t_11) < 0) __PYX_ERR(48, 119, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":120 * LOWER = PC_FIELDSPLIT_SCHUR_FACT_LOWER * UPPER = PC_FIELDSPLIT_SCHUR_FACT_UPPER * FULL = PC_FIELDSPLIT_SCHUR_FACT_FULL # <<<<<<<<<<<<<< * * class PCPatchConstructType(object): */ __pyx_t_11 = __Pyx_PyInt_From_PCFieldSplitSchurFactType(PC_FIELDSPLIT_SCHUR_FACT_FULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_FULL, __pyx_t_11) < 0) __PYX_ERR(48, 120, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":115 * FULL = PC_FIELDSPLIT_SCHUR_PRE_FULL * * class PCFieldSplitSchurFactType(object): # <<<<<<<<<<<<<< * """The field split Schur factorization type.""" * DIAG = PC_FIELDSPLIT_SCHUR_FACT_DIAG */ __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_PCFieldSplitSchurFactType, __pyx_t_13, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_PCFieldSplitSchurFactType, __pyx_t_11) < 0) __PYX_ERR(48, 115, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/PC.pyx":122 * FULL = PC_FIELDSPLIT_SCHUR_FACT_FULL * * class PCPatchConstructType(object): # <<<<<<<<<<<<<< * """The patch construction type.""" * STAR = PC_PATCH_STAR */ __pyx_t_13 = __Pyx_PEP560_update_bases(__pyx_tuple__175); if (unlikely(!__pyx_t_13)) __PYX_ERR(48, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(48, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_13, __pyx_n_s_PCPatchConstructType, __pyx_n_s_PCPatchConstructType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, __pyx_kp_s_The_patch_construction_type); if (unlikely(!__pyx_t_12)) __PYX_ERR(48, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_13 != __pyx_tuple__175) { if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_tuple__175) < 0))) __PYX_ERR(48, 122, __pyx_L1_error) } /* "petsc4py/PETSc/PC.pyx":124 * class PCPatchConstructType(object): * """The patch construction type.""" * STAR = PC_PATCH_STAR # <<<<<<<<<<<<<< * VANKA = PC_PATCH_VANKA * PARDECOMP = PC_PATCH_PARDECOMP */ __pyx_t_11 = __Pyx_PyInt_From_PCPatchConstructType(PC_PATCH_STAR); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_STAR, __pyx_t_11) < 0) __PYX_ERR(48, 124, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":125 * """The patch construction type.""" * STAR = PC_PATCH_STAR * VANKA = PC_PATCH_VANKA # <<<<<<<<<<<<<< * PARDECOMP = PC_PATCH_PARDECOMP * USER = PC_PATCH_USER */ __pyx_t_11 = __Pyx_PyInt_From_PCPatchConstructType(PC_PATCH_VANKA); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_VANKA, __pyx_t_11) < 0) __PYX_ERR(48, 125, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":126 * STAR = PC_PATCH_STAR * VANKA = PC_PATCH_VANKA * PARDECOMP = PC_PATCH_PARDECOMP # <<<<<<<<<<<<<< * USER = PC_PATCH_USER * PYTHON = PC_PATCH_PYTHON */ __pyx_t_11 = __Pyx_PyInt_From_PCPatchConstructType(PC_PATCH_PARDECOMP); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_PARDECOMP, __pyx_t_11) < 0) __PYX_ERR(48, 126, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":127 * VANKA = PC_PATCH_VANKA * PARDECOMP = PC_PATCH_PARDECOMP * USER = PC_PATCH_USER # <<<<<<<<<<<<<< * PYTHON = PC_PATCH_PYTHON * */ __pyx_t_11 = __Pyx_PyInt_From_PCPatchConstructType(PC_PATCH_USER); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_USER, __pyx_t_11) < 0) __PYX_ERR(48, 127, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":128 * PARDECOMP = PC_PATCH_PARDECOMP * USER = PC_PATCH_USER * PYTHON = PC_PATCH_PYTHON # <<<<<<<<<<<<<< * * class PCHPDDMCoarseCorrectionType(object): */ __pyx_t_11 = __Pyx_PyInt_From_PCPatchConstructType(PC_PATCH_PYTHON); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_PYTHON, __pyx_t_11) < 0) __PYX_ERR(48, 128, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":122 * FULL = PC_FIELDSPLIT_SCHUR_FACT_FULL * * class PCPatchConstructType(object): # <<<<<<<<<<<<<< * """The patch construction type.""" * STAR = PC_PATCH_STAR */ __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_PCPatchConstructType, __pyx_t_13, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_PCPatchConstructType, __pyx_t_11) < 0) __PYX_ERR(48, 122, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/PC.pyx":130 * PYTHON = PC_PATCH_PYTHON * * class PCHPDDMCoarseCorrectionType(object): # <<<<<<<<<<<<<< * """The *HPDDM* coarse correction type.""" * DEFLATED = PC_HPDDM_COARSE_CORRECTION_DEFLATED */ __pyx_t_13 = __Pyx_PEP560_update_bases(__pyx_tuple__177); if (unlikely(!__pyx_t_13)) __PYX_ERR(48, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(48, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_13, __pyx_n_s_PCHPDDMCoarseCorrectionType, __pyx_n_s_PCHPDDMCoarseCorrectionType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, __pyx_kp_s_The_HPDDM_coarse_correction_type); if (unlikely(!__pyx_t_12)) __PYX_ERR(48, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_13 != __pyx_tuple__177) { if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_tuple__177) < 0))) __PYX_ERR(48, 130, __pyx_L1_error) } /* "petsc4py/PETSc/PC.pyx":132 * class PCHPDDMCoarseCorrectionType(object): * """The *HPDDM* coarse correction type.""" * DEFLATED = PC_HPDDM_COARSE_CORRECTION_DEFLATED # <<<<<<<<<<<<<< * ADDITIVE = PC_HPDDM_COARSE_CORRECTION_ADDITIVE * BALANCED = PC_HPDDM_COARSE_CORRECTION_BALANCED */ __pyx_t_11 = __Pyx_PyInt_From_PCHPDDMCoarseCorrectionType(PC_HPDDM_COARSE_CORRECTION_DEFLATED); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DEFLATED, __pyx_t_11) < 0) __PYX_ERR(48, 132, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":133 * """The *HPDDM* coarse correction type.""" * DEFLATED = PC_HPDDM_COARSE_CORRECTION_DEFLATED * ADDITIVE = PC_HPDDM_COARSE_CORRECTION_ADDITIVE # <<<<<<<<<<<<<< * BALANCED = PC_HPDDM_COARSE_CORRECTION_BALANCED * */ __pyx_t_11 = __Pyx_PyInt_From_PCHPDDMCoarseCorrectionType(PC_HPDDM_COARSE_CORRECTION_ADDITIVE); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_ADDITIVE, __pyx_t_11) < 0) __PYX_ERR(48, 133, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":134 * DEFLATED = PC_HPDDM_COARSE_CORRECTION_DEFLATED * ADDITIVE = PC_HPDDM_COARSE_CORRECTION_ADDITIVE * BALANCED = PC_HPDDM_COARSE_CORRECTION_BALANCED # <<<<<<<<<<<<<< * * class PCDeflationSpaceType(object): */ __pyx_t_11 = __Pyx_PyInt_From_PCHPDDMCoarseCorrectionType(PC_HPDDM_COARSE_CORRECTION_BALANCED); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_BALANCED, __pyx_t_11) < 0) __PYX_ERR(48, 134, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":130 * PYTHON = PC_PATCH_PYTHON * * class PCHPDDMCoarseCorrectionType(object): # <<<<<<<<<<<<<< * """The *HPDDM* coarse correction type.""" * DEFLATED = PC_HPDDM_COARSE_CORRECTION_DEFLATED */ __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_PCHPDDMCoarseCorrectionType, __pyx_t_13, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_PCHPDDMCoarseCorrectionType, __pyx_t_11) < 0) __PYX_ERR(48, 130, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/PC.pyx":136 * BALANCED = PC_HPDDM_COARSE_CORRECTION_BALANCED * * class PCDeflationSpaceType(object): # <<<<<<<<<<<<<< * """The deflation space subtype.""" * HAAR = PC_DEFLATION_SPACE_HAAR */ __pyx_t_13 = __Pyx_PEP560_update_bases(__pyx_tuple__179); if (unlikely(!__pyx_t_13)) __PYX_ERR(48, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(48, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_13, __pyx_n_s_PCDeflationSpaceType, __pyx_n_s_PCDeflationSpaceType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, __pyx_kp_s_The_deflation_space_subtype); if (unlikely(!__pyx_t_12)) __PYX_ERR(48, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_13 != __pyx_tuple__179) { if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_tuple__179) < 0))) __PYX_ERR(48, 136, __pyx_L1_error) } /* "petsc4py/PETSc/PC.pyx":138 * class PCDeflationSpaceType(object): * """The deflation space subtype.""" * HAAR = PC_DEFLATION_SPACE_HAAR # <<<<<<<<<<<<<< * DB2 = PC_DEFLATION_SPACE_DB2 * DB4 = PC_DEFLATION_SPACE_DB4 */ __pyx_t_11 = __Pyx_PyInt_From_PCDeflationSpaceType(PC_DEFLATION_SPACE_HAAR); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_HAAR, __pyx_t_11) < 0) __PYX_ERR(48, 138, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":139 * """The deflation space subtype.""" * HAAR = PC_DEFLATION_SPACE_HAAR * DB2 = PC_DEFLATION_SPACE_DB2 # <<<<<<<<<<<<<< * DB4 = PC_DEFLATION_SPACE_DB4 * DB8 = PC_DEFLATION_SPACE_DB8 */ __pyx_t_11 = __Pyx_PyInt_From_PCDeflationSpaceType(PC_DEFLATION_SPACE_DB2); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DB2, __pyx_t_11) < 0) __PYX_ERR(48, 139, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":140 * HAAR = PC_DEFLATION_SPACE_HAAR * DB2 = PC_DEFLATION_SPACE_DB2 * DB4 = PC_DEFLATION_SPACE_DB4 # <<<<<<<<<<<<<< * DB8 = PC_DEFLATION_SPACE_DB8 * DB16 = PC_DEFLATION_SPACE_DB16 */ __pyx_t_11 = __Pyx_PyInt_From_PCDeflationSpaceType(PC_DEFLATION_SPACE_DB4); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DB4, __pyx_t_11) < 0) __PYX_ERR(48, 140, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":141 * DB2 = PC_DEFLATION_SPACE_DB2 * DB4 = PC_DEFLATION_SPACE_DB4 * DB8 = PC_DEFLATION_SPACE_DB8 # <<<<<<<<<<<<<< * DB16 = PC_DEFLATION_SPACE_DB16 * BIORTH22 = PC_DEFLATION_SPACE_BIORTH22 */ __pyx_t_11 = __Pyx_PyInt_From_PCDeflationSpaceType(PC_DEFLATION_SPACE_DB8); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DB8, __pyx_t_11) < 0) __PYX_ERR(48, 141, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":142 * DB4 = PC_DEFLATION_SPACE_DB4 * DB8 = PC_DEFLATION_SPACE_DB8 * DB16 = PC_DEFLATION_SPACE_DB16 # <<<<<<<<<<<<<< * BIORTH22 = PC_DEFLATION_SPACE_BIORTH22 * MEYER = PC_DEFLATION_SPACE_MEYER */ __pyx_t_11 = __Pyx_PyInt_From_PCDeflationSpaceType(PC_DEFLATION_SPACE_DB16); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DB16, __pyx_t_11) < 0) __PYX_ERR(48, 142, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":143 * DB8 = PC_DEFLATION_SPACE_DB8 * DB16 = PC_DEFLATION_SPACE_DB16 * BIORTH22 = PC_DEFLATION_SPACE_BIORTH22 # <<<<<<<<<<<<<< * MEYER = PC_DEFLATION_SPACE_MEYER * AGGREGATION = PC_DEFLATION_SPACE_AGGREGATION */ __pyx_t_11 = __Pyx_PyInt_From_PCDeflationSpaceType(PC_DEFLATION_SPACE_BIORTH22); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_BIORTH22, __pyx_t_11) < 0) __PYX_ERR(48, 143, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":144 * DB16 = PC_DEFLATION_SPACE_DB16 * BIORTH22 = PC_DEFLATION_SPACE_BIORTH22 * MEYER = PC_DEFLATION_SPACE_MEYER # <<<<<<<<<<<<<< * AGGREGATION = PC_DEFLATION_SPACE_AGGREGATION * USER = PC_DEFLATION_SPACE_USER */ __pyx_t_11 = __Pyx_PyInt_From_PCDeflationSpaceType(PC_DEFLATION_SPACE_MEYER); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_MEYER, __pyx_t_11) < 0) __PYX_ERR(48, 144, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":145 * BIORTH22 = PC_DEFLATION_SPACE_BIORTH22 * MEYER = PC_DEFLATION_SPACE_MEYER * AGGREGATION = PC_DEFLATION_SPACE_AGGREGATION # <<<<<<<<<<<<<< * USER = PC_DEFLATION_SPACE_USER * */ __pyx_t_11 = __Pyx_PyInt_From_PCDeflationSpaceType(PC_DEFLATION_SPACE_AGGREGATION); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_AGGREGATION, __pyx_t_11) < 0) __PYX_ERR(48, 145, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":146 * MEYER = PC_DEFLATION_SPACE_MEYER * AGGREGATION = PC_DEFLATION_SPACE_AGGREGATION * USER = PC_DEFLATION_SPACE_USER # <<<<<<<<<<<<<< * * class PCFailedReason(object): */ __pyx_t_11 = __Pyx_PyInt_From_PCDeflationSpaceType(PC_DEFLATION_SPACE_USER); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_USER, __pyx_t_11) < 0) __PYX_ERR(48, 146, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":136 * BALANCED = PC_HPDDM_COARSE_CORRECTION_BALANCED * * class PCDeflationSpaceType(object): # <<<<<<<<<<<<<< * """The deflation space subtype.""" * HAAR = PC_DEFLATION_SPACE_HAAR */ __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_PCDeflationSpaceType, __pyx_t_13, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_PCDeflationSpaceType, __pyx_t_11) < 0) __PYX_ERR(48, 136, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/PC.pyx":148 * USER = PC_DEFLATION_SPACE_USER * * class PCFailedReason(object): # <<<<<<<<<<<<<< * """The reason the preconditioner has failed.""" * SETUP_ERROR = PC_SETUP_ERROR */ __pyx_t_13 = __Pyx_PEP560_update_bases(__pyx_tuple__181); if (unlikely(!__pyx_t_13)) __PYX_ERR(48, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(48, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_13, __pyx_n_s_PCFailedReason, __pyx_n_s_PCFailedReason, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, __pyx_kp_s_The_reason_the_preconditioner_ha); if (unlikely(!__pyx_t_12)) __PYX_ERR(48, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_13 != __pyx_tuple__181) { if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_tuple__181) < 0))) __PYX_ERR(48, 148, __pyx_L1_error) } /* "petsc4py/PETSc/PC.pyx":150 * class PCFailedReason(object): * """The reason the preconditioner has failed.""" * SETUP_ERROR = PC_SETUP_ERROR # <<<<<<<<<<<<<< * NOERROR = PC_NOERROR * FACTOR_STRUCT_ZEROPIVOT = PC_FACTOR_STRUCT_ZEROPIVOT */ __pyx_t_11 = __Pyx_PyInt_From_PCFailedReason(PC_SETUP_ERROR); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SETUP_ERROR, __pyx_t_11) < 0) __PYX_ERR(48, 150, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":151 * """The reason the preconditioner has failed.""" * SETUP_ERROR = PC_SETUP_ERROR * NOERROR = PC_NOERROR # <<<<<<<<<<<<<< * FACTOR_STRUCT_ZEROPIVOT = PC_FACTOR_STRUCT_ZEROPIVOT * FACTOR_NUMERIC_ZEROPIVOT = PC_FACTOR_NUMERIC_ZEROPIVOT */ __pyx_t_11 = __Pyx_PyInt_From_PCFailedReason(PC_NOERROR); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_NOERROR, __pyx_t_11) < 0) __PYX_ERR(48, 151, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":152 * SETUP_ERROR = PC_SETUP_ERROR * NOERROR = PC_NOERROR * FACTOR_STRUCT_ZEROPIVOT = PC_FACTOR_STRUCT_ZEROPIVOT # <<<<<<<<<<<<<< * FACTOR_NUMERIC_ZEROPIVOT = PC_FACTOR_NUMERIC_ZEROPIVOT * FACTOR_OUTMEMORY = PC_FACTOR_OUTMEMORY */ __pyx_t_11 = __Pyx_PyInt_From_PCFailedReason(PC_FACTOR_STRUCT_ZEROPIVOT); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_FACTOR_STRUCT_ZEROPIVOT, __pyx_t_11) < 0) __PYX_ERR(48, 152, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":153 * NOERROR = PC_NOERROR * FACTOR_STRUCT_ZEROPIVOT = PC_FACTOR_STRUCT_ZEROPIVOT * FACTOR_NUMERIC_ZEROPIVOT = PC_FACTOR_NUMERIC_ZEROPIVOT # <<<<<<<<<<<<<< * FACTOR_OUTMEMORY = PC_FACTOR_OUTMEMORY * FACTOR_OTHER = PC_FACTOR_OTHER */ __pyx_t_11 = __Pyx_PyInt_From_PCFailedReason(PC_FACTOR_NUMERIC_ZEROPIVOT); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_FACTOR_NUMERIC_ZEROPIVOT, __pyx_t_11) < 0) __PYX_ERR(48, 153, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":154 * FACTOR_STRUCT_ZEROPIVOT = PC_FACTOR_STRUCT_ZEROPIVOT * FACTOR_NUMERIC_ZEROPIVOT = PC_FACTOR_NUMERIC_ZEROPIVOT * FACTOR_OUTMEMORY = PC_FACTOR_OUTMEMORY # <<<<<<<<<<<<<< * FACTOR_OTHER = PC_FACTOR_OTHER * SUBPC_ERROR = PC_SUBPC_ERROR */ __pyx_t_11 = __Pyx_PyInt_From_PCFailedReason(PC_FACTOR_OUTMEMORY); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_FACTOR_OUTMEMORY, __pyx_t_11) < 0) __PYX_ERR(48, 154, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":155 * FACTOR_NUMERIC_ZEROPIVOT = PC_FACTOR_NUMERIC_ZEROPIVOT * FACTOR_OUTMEMORY = PC_FACTOR_OUTMEMORY * FACTOR_OTHER = PC_FACTOR_OTHER # <<<<<<<<<<<<<< * SUBPC_ERROR = PC_SUBPC_ERROR * */ __pyx_t_11 = __Pyx_PyInt_From_PCFailedReason(PC_FACTOR_OTHER); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_FACTOR_OTHER, __pyx_t_11) < 0) __PYX_ERR(48, 155, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":156 * FACTOR_OUTMEMORY = PC_FACTOR_OUTMEMORY * FACTOR_OTHER = PC_FACTOR_OTHER * SUBPC_ERROR = PC_SUBPC_ERROR # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_t_11 = __Pyx_PyInt_From_PCFailedReason(PC_SUBPC_ERROR); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SUBPC_ERROR, __pyx_t_11) < 0) __PYX_ERR(48, 156, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/PC.pyx":148 * USER = PC_DEFLATION_SPACE_USER * * class PCFailedReason(object): # <<<<<<<<<<<<<< * """The reason the preconditioner has failed.""" * SETUP_ERROR = PC_SETUP_ERROR */ __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_PCFailedReason, __pyx_t_13, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(48, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_PCFailedReason, __pyx_t_11) < 0) __PYX_ERR(48, 148, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/PC.pyx":182 * """ * * Type = PCType # <<<<<<<<<<<<<< * Side = PCSide * */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_PCType); if (unlikely(!__pyx_t_13)) __PYX_ERR(48, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_n_s_Type, __pyx_t_13) < 0) __PYX_ERR(48, 182, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_PC); /* "petsc4py/PETSc/PC.pyx":183 * * Type = PCType * Side = PCSide # <<<<<<<<<<<<<< * * ASMType = PCASMType */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_PCSide); if (unlikely(!__pyx_t_13)) __PYX_ERR(48, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_n_s_Side, __pyx_t_13) < 0) __PYX_ERR(48, 183, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_PC); /* "petsc4py/PETSc/PC.pyx":185 * Side = PCSide * * ASMType = PCASMType # <<<<<<<<<<<<<< * GASMType = PCGASMType * MGType = PCMGType */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_PCASMType); if (unlikely(!__pyx_t_13)) __PYX_ERR(48, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_n_s_ASMType, __pyx_t_13) < 0) __PYX_ERR(48, 185, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_PC); /* "petsc4py/PETSc/PC.pyx":186 * * ASMType = PCASMType * GASMType = PCGASMType # <<<<<<<<<<<<<< * MGType = PCMGType * MGCycleType = PCMGCycleType */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_PCGASMType); if (unlikely(!__pyx_t_13)) __PYX_ERR(48, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_n_s_GASMType, __pyx_t_13) < 0) __PYX_ERR(48, 186, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_PC); /* "petsc4py/PETSc/PC.pyx":187 * ASMType = PCASMType * GASMType = PCGASMType * MGType = PCMGType # <<<<<<<<<<<<<< * MGCycleType = PCMGCycleType * GAMGType = PCGAMGType */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_PCMGType); if (unlikely(!__pyx_t_13)) __PYX_ERR(48, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_n_s_MGType, __pyx_t_13) < 0) __PYX_ERR(48, 187, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_PC); /* "petsc4py/PETSc/PC.pyx":188 * GASMType = PCGASMType * MGType = PCMGType * MGCycleType = PCMGCycleType # <<<<<<<<<<<<<< * GAMGType = PCGAMGType * CompositeType = PCCompositeType */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_PCMGCycleType); if (unlikely(!__pyx_t_13)) __PYX_ERR(48, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_n_s_MGCycleType, __pyx_t_13) < 0) __PYX_ERR(48, 188, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_PC); /* "petsc4py/PETSc/PC.pyx":189 * MGType = PCMGType * MGCycleType = PCMGCycleType * GAMGType = PCGAMGType # <<<<<<<<<<<<<< * CompositeType = PCCompositeType * FieldSplitSchurFactType = PCFieldSplitSchurFactType */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_PCGAMGType); if (unlikely(!__pyx_t_13)) __PYX_ERR(48, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_n_s_GAMGType, __pyx_t_13) < 0) __PYX_ERR(48, 189, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_PC); /* "petsc4py/PETSc/PC.pyx":190 * MGCycleType = PCMGCycleType * GAMGType = PCGAMGType * CompositeType = PCCompositeType # <<<<<<<<<<<<<< * FieldSplitSchurFactType = PCFieldSplitSchurFactType * FieldSplitSchurPreType = PCFieldSplitSchurPreType */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_PCCompositeType); if (unlikely(!__pyx_t_13)) __PYX_ERR(48, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_n_s_CompositeType, __pyx_t_13) < 0) __PYX_ERR(48, 190, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_PC); /* "petsc4py/PETSc/PC.pyx":191 * GAMGType = PCGAMGType * CompositeType = PCCompositeType * FieldSplitSchurFactType = PCFieldSplitSchurFactType # <<<<<<<<<<<<<< * FieldSplitSchurPreType = PCFieldSplitSchurPreType * PatchConstructType = PCPatchConstructType */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_PCFieldSplitSchurFactType); if (unlikely(!__pyx_t_13)) __PYX_ERR(48, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_n_s_FieldSplitSchurFactType, __pyx_t_13) < 0) __PYX_ERR(48, 191, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_PC); /* "petsc4py/PETSc/PC.pyx":192 * CompositeType = PCCompositeType * FieldSplitSchurFactType = PCFieldSplitSchurFactType * FieldSplitSchurPreType = PCFieldSplitSchurPreType # <<<<<<<<<<<<<< * PatchConstructType = PCPatchConstructType * HPDDMCoarseCorrectionType = PCHPDDMCoarseCorrectionType */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_PCFieldSplitSchurPreType); if (unlikely(!__pyx_t_13)) __PYX_ERR(48, 192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_n_s_FieldSplitSchurPreType, __pyx_t_13) < 0) __PYX_ERR(48, 192, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_PC); /* "petsc4py/PETSc/PC.pyx":193 * FieldSplitSchurFactType = PCFieldSplitSchurFactType * FieldSplitSchurPreType = PCFieldSplitSchurPreType * PatchConstructType = PCPatchConstructType # <<<<<<<<<<<<<< * HPDDMCoarseCorrectionType = PCHPDDMCoarseCorrectionType * DeflationSpaceType = PCDeflationSpaceType */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_PCPatchConstructType); if (unlikely(!__pyx_t_13)) __PYX_ERR(48, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_n_s_PatchConstructType, __pyx_t_13) < 0) __PYX_ERR(48, 193, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_PC); /* "petsc4py/PETSc/PC.pyx":194 * FieldSplitSchurPreType = PCFieldSplitSchurPreType * PatchConstructType = PCPatchConstructType * HPDDMCoarseCorrectionType = PCHPDDMCoarseCorrectionType # <<<<<<<<<<<<<< * DeflationSpaceType = PCDeflationSpaceType * FailedReason = PCFailedReason */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_PCHPDDMCoarseCorrectionType); if (unlikely(!__pyx_t_13)) __PYX_ERR(48, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_n_s_HPDDMCoarseCorrectionType, __pyx_t_13) < 0) __PYX_ERR(48, 194, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_PC); /* "petsc4py/PETSc/PC.pyx":195 * PatchConstructType = PCPatchConstructType * HPDDMCoarseCorrectionType = PCHPDDMCoarseCorrectionType * DeflationSpaceType = PCDeflationSpaceType # <<<<<<<<<<<<<< * FailedReason = PCFailedReason * # Backward compatibility */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_PCDeflationSpaceType); if (unlikely(!__pyx_t_13)) __PYX_ERR(48, 195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_n_s_DeflationSpaceType, __pyx_t_13) < 0) __PYX_ERR(48, 195, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_PC); /* "petsc4py/PETSc/PC.pyx":196 * HPDDMCoarseCorrectionType = PCHPDDMCoarseCorrectionType * DeflationSpaceType = PCDeflationSpaceType * FailedReason = PCFailedReason # <<<<<<<<<<<<<< * # Backward compatibility * SchurFactType = PCFieldSplitSchurFactType */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_PCFailedReason); if (unlikely(!__pyx_t_13)) __PYX_ERR(48, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_n_s_FailedReason, __pyx_t_13) < 0) __PYX_ERR(48, 196, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_PC); /* "petsc4py/PETSc/PC.pyx":198 * FailedReason = PCFailedReason * # Backward compatibility * SchurFactType = PCFieldSplitSchurFactType # <<<<<<<<<<<<<< * SchurPreType = PCFieldSplitSchurPreType * */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_PCFieldSplitSchurFactType); if (unlikely(!__pyx_t_13)) __PYX_ERR(48, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_n_s_SchurFactType, __pyx_t_13) < 0) __PYX_ERR(48, 198, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_PC); /* "petsc4py/PETSc/PC.pyx":199 * # Backward compatibility * SchurFactType = PCFieldSplitSchurFactType * SchurPreType = PCFieldSplitSchurPreType # <<<<<<<<<<<<<< * * # --- xxx --- */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_PCFieldSplitSchurPreType); if (unlikely(!__pyx_t_13)) __PYX_ERR(48, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_n_s_SchurPreType, __pyx_t_13) < 0) __PYX_ERR(48, 199, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_PC); /* "petsc4py/PETSc/PC.pyx":2814 * # -------------------------------------------------------------------- * * del PCType # <<<<<<<<<<<<<< * del PCSide * del PCASMType */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_PCType) < 0) __PYX_ERR(48, 2814, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":2815 * * del PCType * del PCSide # <<<<<<<<<<<<<< * del PCASMType * del PCGASMType */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_PCSide) < 0) __PYX_ERR(48, 2815, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":2816 * del PCType * del PCSide * del PCASMType # <<<<<<<<<<<<<< * del PCGASMType * del PCMGType */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_PCASMType) < 0) __PYX_ERR(48, 2816, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":2817 * del PCSide * del PCASMType * del PCGASMType # <<<<<<<<<<<<<< * del PCMGType * del PCMGCycleType */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_PCGASMType) < 0) __PYX_ERR(48, 2817, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":2818 * del PCASMType * del PCGASMType * del PCMGType # <<<<<<<<<<<<<< * del PCMGCycleType * del PCGAMGType */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_PCMGType) < 0) __PYX_ERR(48, 2818, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":2819 * del PCGASMType * del PCMGType * del PCMGCycleType # <<<<<<<<<<<<<< * del PCGAMGType * del PCCompositeType */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_PCMGCycleType) < 0) __PYX_ERR(48, 2819, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":2820 * del PCMGType * del PCMGCycleType * del PCGAMGType # <<<<<<<<<<<<<< * del PCCompositeType * del PCFieldSplitSchurPreType */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_PCGAMGType) < 0) __PYX_ERR(48, 2820, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":2821 * del PCMGCycleType * del PCGAMGType * del PCCompositeType # <<<<<<<<<<<<<< * del PCFieldSplitSchurPreType * del PCFieldSplitSchurFactType */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_PCCompositeType) < 0) __PYX_ERR(48, 2821, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":2822 * del PCGAMGType * del PCCompositeType * del PCFieldSplitSchurPreType # <<<<<<<<<<<<<< * del PCFieldSplitSchurFactType * del PCPatchConstructType */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_PCFieldSplitSchurPreType) < 0) __PYX_ERR(48, 2822, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":2823 * del PCCompositeType * del PCFieldSplitSchurPreType * del PCFieldSplitSchurFactType # <<<<<<<<<<<<<< * del PCPatchConstructType * del PCHPDDMCoarseCorrectionType */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_PCFieldSplitSchurFactType) < 0) __PYX_ERR(48, 2823, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":2824 * del PCFieldSplitSchurPreType * del PCFieldSplitSchurFactType * del PCPatchConstructType # <<<<<<<<<<<<<< * del PCHPDDMCoarseCorrectionType * del PCDeflationSpaceType */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_PCPatchConstructType) < 0) __PYX_ERR(48, 2824, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":2825 * del PCFieldSplitSchurFactType * del PCPatchConstructType * del PCHPDDMCoarseCorrectionType # <<<<<<<<<<<<<< * del PCDeflationSpaceType * del PCFailedReason */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_PCHPDDMCoarseCorrectionType) < 0) __PYX_ERR(48, 2825, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":2826 * del PCPatchConstructType * del PCHPDDMCoarseCorrectionType * del PCDeflationSpaceType # <<<<<<<<<<<<<< * del PCFailedReason * */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_PCDeflationSpaceType) < 0) __PYX_ERR(48, 2826, __pyx_L1_error) /* "petsc4py/PETSc/PC.pyx":2827 * del PCHPDDMCoarseCorrectionType * del PCDeflationSpaceType * del PCFailedReason # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_PCFailedReason) < 0) __PYX_ERR(48, 2827, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":3 * # -------------------------------------------------------------------- * * class KSPType(object): # <<<<<<<<<<<<<< * """KSP Type. * */ __pyx_t_13 = __Pyx_PEP560_update_bases(__pyx_tuple__183); if (unlikely(!__pyx_t_13)) __PYX_ERR(49, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(49, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_13, __pyx_n_s_KSPType, __pyx_n_s_KSPType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, __pyx_kp_s_KSP_Type_The_available_types_are); if (unlikely(!__pyx_t_12)) __PYX_ERR(49, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_13 != __pyx_tuple__183) { if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_tuple__183) < 0))) __PYX_ERR(49, 3, __pyx_L1_error) } /* "petsc4py/PETSc/KSP.pyx":181 * * """ * RICHARDSON = S_(KSPRICHARDSON) # <<<<<<<<<<<<<< * CHEBYSHEV = S_(KSPCHEBYSHEV) * CG = S_(KSPCG) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(KSPRICHARDSON); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_RICHARDSON, __pyx_t_11) < 0) __PYX_ERR(49, 181, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":182 * """ * RICHARDSON = S_(KSPRICHARDSON) * CHEBYSHEV = S_(KSPCHEBYSHEV) # <<<<<<<<<<<<<< * CG = S_(KSPCG) * GROPPCG = S_(KSPGROPPCG) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(KSPCHEBYSHEV); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_CHEBYSHEV, __pyx_t_11) < 0) __PYX_ERR(49, 182, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":183 * RICHARDSON = S_(KSPRICHARDSON) * CHEBYSHEV = S_(KSPCHEBYSHEV) * CG = S_(KSPCG) # <<<<<<<<<<<<<< * GROPPCG = S_(KSPGROPPCG) * PIPECG = S_(KSPPIPECG) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(KSPCG); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_CG, __pyx_t_11) < 0) __PYX_ERR(49, 183, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":184 * CHEBYSHEV = S_(KSPCHEBYSHEV) * CG = S_(KSPCG) * GROPPCG = S_(KSPGROPPCG) # <<<<<<<<<<<<<< * PIPECG = S_(KSPPIPECG) * PIPECGRR = S_(KSPPIPECGRR) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(KSPGROPPCG); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_GROPPCG, __pyx_t_11) < 0) __PYX_ERR(49, 184, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":185 * CG = S_(KSPCG) * GROPPCG = S_(KSPGROPPCG) * PIPECG = S_(KSPPIPECG) # <<<<<<<<<<<<<< * PIPECGRR = S_(KSPPIPECGRR) * PIPELCG = S_(KSPPIPELCG) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(KSPPIPECG); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_PIPECG, __pyx_t_11) < 0) __PYX_ERR(49, 185, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":186 * GROPPCG = S_(KSPGROPPCG) * PIPECG = S_(KSPPIPECG) * PIPECGRR = S_(KSPPIPECGRR) # <<<<<<<<<<<<<< * PIPELCG = S_(KSPPIPELCG) * PIPEPRCG = S_(KSPPIPEPRCG) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(KSPPIPECGRR); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_PIPECGRR, __pyx_t_11) < 0) __PYX_ERR(49, 186, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":187 * PIPECG = S_(KSPPIPECG) * PIPECGRR = S_(KSPPIPECGRR) * PIPELCG = S_(KSPPIPELCG) # <<<<<<<<<<<<<< * PIPEPRCG = S_(KSPPIPEPRCG) * PIPECG2 = S_(KSPPIPECG2) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(KSPPIPELCG); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_PIPELCG, __pyx_t_11) < 0) __PYX_ERR(49, 187, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":188 * PIPECGRR = S_(KSPPIPECGRR) * PIPELCG = S_(KSPPIPELCG) * PIPEPRCG = S_(KSPPIPEPRCG) # <<<<<<<<<<<<<< * PIPECG2 = S_(KSPPIPECG2) * CGNE = S_(KSPCGNE) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(KSPPIPEPRCG); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_PIPEPRCG, __pyx_t_11) < 0) __PYX_ERR(49, 188, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":189 * PIPELCG = S_(KSPPIPELCG) * PIPEPRCG = S_(KSPPIPEPRCG) * PIPECG2 = S_(KSPPIPECG2) # <<<<<<<<<<<<<< * CGNE = S_(KSPCGNE) * NASH = S_(KSPNASH) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(KSPPIPECG2); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_PIPECG2, __pyx_t_11) < 0) __PYX_ERR(49, 189, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":190 * PIPEPRCG = S_(KSPPIPEPRCG) * PIPECG2 = S_(KSPPIPECG2) * CGNE = S_(KSPCGNE) # <<<<<<<<<<<<<< * NASH = S_(KSPNASH) * STCG = S_(KSPSTCG) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(KSPCGNE); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_CGNE, __pyx_t_11) < 0) __PYX_ERR(49, 190, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":191 * PIPECG2 = S_(KSPPIPECG2) * CGNE = S_(KSPCGNE) * NASH = S_(KSPNASH) # <<<<<<<<<<<<<< * STCG = S_(KSPSTCG) * GLTR = S_(KSPGLTR) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(KSPNASH); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_NASH, __pyx_t_11) < 0) __PYX_ERR(49, 191, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":192 * CGNE = S_(KSPCGNE) * NASH = S_(KSPNASH) * STCG = S_(KSPSTCG) # <<<<<<<<<<<<<< * GLTR = S_(KSPGLTR) * FCG = S_(KSPFCG) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(KSPSTCG); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_STCG, __pyx_t_11) < 0) __PYX_ERR(49, 192, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":193 * NASH = S_(KSPNASH) * STCG = S_(KSPSTCG) * GLTR = S_(KSPGLTR) # <<<<<<<<<<<<<< * FCG = S_(KSPFCG) * PIPEFCG = S_(KSPPIPEFCG) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(KSPGLTR); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_GLTR, __pyx_t_11) < 0) __PYX_ERR(49, 193, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":194 * STCG = S_(KSPSTCG) * GLTR = S_(KSPGLTR) * FCG = S_(KSPFCG) # <<<<<<<<<<<<<< * PIPEFCG = S_(KSPPIPEFCG) * GMRES = S_(KSPGMRES) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(KSPFCG); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_FCG, __pyx_t_11) < 0) __PYX_ERR(49, 194, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":195 * GLTR = S_(KSPGLTR) * FCG = S_(KSPFCG) * PIPEFCG = S_(KSPPIPEFCG) # <<<<<<<<<<<<<< * GMRES = S_(KSPGMRES) * PIPEFGMRES = S_(KSPPIPEFGMRES) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(KSPPIPEFCG); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_PIPEFCG, __pyx_t_11) < 0) __PYX_ERR(49, 195, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":196 * FCG = S_(KSPFCG) * PIPEFCG = S_(KSPPIPEFCG) * GMRES = S_(KSPGMRES) # <<<<<<<<<<<<<< * PIPEFGMRES = S_(KSPPIPEFGMRES) * FGMRES = S_(KSPFGMRES) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(KSPGMRES); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_GMRES, __pyx_t_11) < 0) __PYX_ERR(49, 196, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":197 * PIPEFCG = S_(KSPPIPEFCG) * GMRES = S_(KSPGMRES) * PIPEFGMRES = S_(KSPPIPEFGMRES) # <<<<<<<<<<<<<< * FGMRES = S_(KSPFGMRES) * LGMRES = S_(KSPLGMRES) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(KSPPIPEFGMRES); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_PIPEFGMRES, __pyx_t_11) < 0) __PYX_ERR(49, 197, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":198 * GMRES = S_(KSPGMRES) * PIPEFGMRES = S_(KSPPIPEFGMRES) * FGMRES = S_(KSPFGMRES) # <<<<<<<<<<<<<< * LGMRES = S_(KSPLGMRES) * DGMRES = S_(KSPDGMRES) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(KSPFGMRES); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_FGMRES, __pyx_t_11) < 0) __PYX_ERR(49, 198, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":199 * PIPEFGMRES = S_(KSPPIPEFGMRES) * FGMRES = S_(KSPFGMRES) * LGMRES = S_(KSPLGMRES) # <<<<<<<<<<<<<< * DGMRES = S_(KSPDGMRES) * PGMRES = S_(KSPPGMRES) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(KSPLGMRES); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_LGMRES, __pyx_t_11) < 0) __PYX_ERR(49, 199, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":200 * FGMRES = S_(KSPFGMRES) * LGMRES = S_(KSPLGMRES) * DGMRES = S_(KSPDGMRES) # <<<<<<<<<<<<<< * PGMRES = S_(KSPPGMRES) * TCQMR = S_(KSPTCQMR) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(KSPDGMRES); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DGMRES, __pyx_t_11) < 0) __PYX_ERR(49, 200, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":201 * LGMRES = S_(KSPLGMRES) * DGMRES = S_(KSPDGMRES) * PGMRES = S_(KSPPGMRES) # <<<<<<<<<<<<<< * TCQMR = S_(KSPTCQMR) * BCGS = S_(KSPBCGS) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(KSPPGMRES); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_PGMRES, __pyx_t_11) < 0) __PYX_ERR(49, 201, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":202 * DGMRES = S_(KSPDGMRES) * PGMRES = S_(KSPPGMRES) * TCQMR = S_(KSPTCQMR) # <<<<<<<<<<<<<< * BCGS = S_(KSPBCGS) * IBCGS = S_(KSPIBCGS) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(KSPTCQMR); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_TCQMR, __pyx_t_11) < 0) __PYX_ERR(49, 202, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":203 * PGMRES = S_(KSPPGMRES) * TCQMR = S_(KSPTCQMR) * BCGS = S_(KSPBCGS) # <<<<<<<<<<<<<< * IBCGS = S_(KSPIBCGS) * QMRCGS = S_(KSPQMRCGS) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(KSPBCGS); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_BCGS, __pyx_t_11) < 0) __PYX_ERR(49, 203, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":204 * TCQMR = S_(KSPTCQMR) * BCGS = S_(KSPBCGS) * IBCGS = S_(KSPIBCGS) # <<<<<<<<<<<<<< * QMRCGS = S_(KSPQMRCGS) * FBCGS = S_(KSPFBCGS) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(KSPIBCGS); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_IBCGS, __pyx_t_11) < 0) __PYX_ERR(49, 204, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":205 * BCGS = S_(KSPBCGS) * IBCGS = S_(KSPIBCGS) * QMRCGS = S_(KSPQMRCGS) # <<<<<<<<<<<<<< * FBCGS = S_(KSPFBCGS) * FBCGSR = S_(KSPFBCGSR) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(KSPQMRCGS); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_QMRCGS, __pyx_t_11) < 0) __PYX_ERR(49, 205, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":206 * IBCGS = S_(KSPIBCGS) * QMRCGS = S_(KSPQMRCGS) * FBCGS = S_(KSPFBCGS) # <<<<<<<<<<<<<< * FBCGSR = S_(KSPFBCGSR) * BCGSL = S_(KSPBCGSL) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(KSPFBCGS); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_FBCGS, __pyx_t_11) < 0) __PYX_ERR(49, 206, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":207 * QMRCGS = S_(KSPQMRCGS) * FBCGS = S_(KSPFBCGS) * FBCGSR = S_(KSPFBCGSR) # <<<<<<<<<<<<<< * BCGSL = S_(KSPBCGSL) * PIPEBCGS = S_(KSPPIPEBCGS) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(KSPFBCGSR); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_FBCGSR, __pyx_t_11) < 0) __PYX_ERR(49, 207, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":208 * FBCGS = S_(KSPFBCGS) * FBCGSR = S_(KSPFBCGSR) * BCGSL = S_(KSPBCGSL) # <<<<<<<<<<<<<< * PIPEBCGS = S_(KSPPIPEBCGS) * CGS = S_(KSPCGS) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(KSPBCGSL); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_BCGSL, __pyx_t_11) < 0) __PYX_ERR(49, 208, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":209 * FBCGSR = S_(KSPFBCGSR) * BCGSL = S_(KSPBCGSL) * PIPEBCGS = S_(KSPPIPEBCGS) # <<<<<<<<<<<<<< * CGS = S_(KSPCGS) * TFQMR = S_(KSPTFQMR) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(KSPPIPEBCGS); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_PIPEBCGS, __pyx_t_11) < 0) __PYX_ERR(49, 209, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":210 * BCGSL = S_(KSPBCGSL) * PIPEBCGS = S_(KSPPIPEBCGS) * CGS = S_(KSPCGS) # <<<<<<<<<<<<<< * TFQMR = S_(KSPTFQMR) * CR = S_(KSPCR) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(KSPCGS); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_CGS, __pyx_t_11) < 0) __PYX_ERR(49, 210, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":211 * PIPEBCGS = S_(KSPPIPEBCGS) * CGS = S_(KSPCGS) * TFQMR = S_(KSPTFQMR) # <<<<<<<<<<<<<< * CR = S_(KSPCR) * PIPECR = S_(KSPPIPECR) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(KSPTFQMR); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_TFQMR, __pyx_t_11) < 0) __PYX_ERR(49, 211, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":212 * CGS = S_(KSPCGS) * TFQMR = S_(KSPTFQMR) * CR = S_(KSPCR) # <<<<<<<<<<<<<< * PIPECR = S_(KSPPIPECR) * LSQR = S_(KSPLSQR) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(KSPCR); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_CR, __pyx_t_11) < 0) __PYX_ERR(49, 212, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":213 * TFQMR = S_(KSPTFQMR) * CR = S_(KSPCR) * PIPECR = S_(KSPPIPECR) # <<<<<<<<<<<<<< * LSQR = S_(KSPLSQR) * PREONLY = S_(KSPPREONLY) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(KSPPIPECR); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_PIPECR, __pyx_t_11) < 0) __PYX_ERR(49, 213, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":214 * CR = S_(KSPCR) * PIPECR = S_(KSPPIPECR) * LSQR = S_(KSPLSQR) # <<<<<<<<<<<<<< * PREONLY = S_(KSPPREONLY) * NONE = S_(KSPNONE) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(KSPLSQR); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_LSQR, __pyx_t_11) < 0) __PYX_ERR(49, 214, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":215 * PIPECR = S_(KSPPIPECR) * LSQR = S_(KSPLSQR) * PREONLY = S_(KSPPREONLY) # <<<<<<<<<<<<<< * NONE = S_(KSPNONE) * QCG = S_(KSPQCG) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(KSPPREONLY); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_PREONLY, __pyx_t_11) < 0) __PYX_ERR(49, 215, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":216 * LSQR = S_(KSPLSQR) * PREONLY = S_(KSPPREONLY) * NONE = S_(KSPNONE) # <<<<<<<<<<<<<< * QCG = S_(KSPQCG) * BICG = S_(KSPBICG) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(KSPNONE); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_NONE, __pyx_t_11) < 0) __PYX_ERR(49, 216, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":217 * PREONLY = S_(KSPPREONLY) * NONE = S_(KSPNONE) * QCG = S_(KSPQCG) # <<<<<<<<<<<<<< * BICG = S_(KSPBICG) * MINRES = S_(KSPMINRES) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(KSPQCG); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_QCG, __pyx_t_11) < 0) __PYX_ERR(49, 217, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":218 * NONE = S_(KSPNONE) * QCG = S_(KSPQCG) * BICG = S_(KSPBICG) # <<<<<<<<<<<<<< * MINRES = S_(KSPMINRES) * SYMMLQ = S_(KSPSYMMLQ) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(KSPBICG); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_BICG, __pyx_t_11) < 0) __PYX_ERR(49, 218, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":219 * QCG = S_(KSPQCG) * BICG = S_(KSPBICG) * MINRES = S_(KSPMINRES) # <<<<<<<<<<<<<< * SYMMLQ = S_(KSPSYMMLQ) * LCD = S_(KSPLCD) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(KSPMINRES); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_MINRES, __pyx_t_11) < 0) __PYX_ERR(49, 219, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":220 * BICG = S_(KSPBICG) * MINRES = S_(KSPMINRES) * SYMMLQ = S_(KSPSYMMLQ) # <<<<<<<<<<<<<< * LCD = S_(KSPLCD) * PYTHON = S_(KSPPYTHON) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(KSPSYMMLQ); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SYMMLQ, __pyx_t_11) < 0) __PYX_ERR(49, 220, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":221 * MINRES = S_(KSPMINRES) * SYMMLQ = S_(KSPSYMMLQ) * LCD = S_(KSPLCD) # <<<<<<<<<<<<<< * PYTHON = S_(KSPPYTHON) * GCR = S_(KSPGCR) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(KSPLCD); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_LCD, __pyx_t_11) < 0) __PYX_ERR(49, 221, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":222 * SYMMLQ = S_(KSPSYMMLQ) * LCD = S_(KSPLCD) * PYTHON = S_(KSPPYTHON) # <<<<<<<<<<<<<< * GCR = S_(KSPGCR) * PIPEGCR = S_(KSPPIPEGCR) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(KSPPYTHON); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_PYTHON, __pyx_t_11) < 0) __PYX_ERR(49, 222, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":223 * LCD = S_(KSPLCD) * PYTHON = S_(KSPPYTHON) * GCR = S_(KSPGCR) # <<<<<<<<<<<<<< * PIPEGCR = S_(KSPPIPEGCR) * TSIRM = S_(KSPTSIRM) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(KSPGCR); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_GCR, __pyx_t_11) < 0) __PYX_ERR(49, 223, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":224 * PYTHON = S_(KSPPYTHON) * GCR = S_(KSPGCR) * PIPEGCR = S_(KSPPIPEGCR) # <<<<<<<<<<<<<< * TSIRM = S_(KSPTSIRM) * CGLS = S_(KSPCGLS) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(KSPPIPEGCR); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_PIPEGCR, __pyx_t_11) < 0) __PYX_ERR(49, 224, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":225 * GCR = S_(KSPGCR) * PIPEGCR = S_(KSPPIPEGCR) * TSIRM = S_(KSPTSIRM) # <<<<<<<<<<<<<< * CGLS = S_(KSPCGLS) * FETIDP = S_(KSPFETIDP) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(KSPTSIRM); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_TSIRM, __pyx_t_11) < 0) __PYX_ERR(49, 225, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":226 * PIPEGCR = S_(KSPPIPEGCR) * TSIRM = S_(KSPTSIRM) * CGLS = S_(KSPCGLS) # <<<<<<<<<<<<<< * FETIDP = S_(KSPFETIDP) * HPDDM = S_(KSPHPDDM) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(KSPCGLS); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_CGLS, __pyx_t_11) < 0) __PYX_ERR(49, 226, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":227 * TSIRM = S_(KSPTSIRM) * CGLS = S_(KSPCGLS) * FETIDP = S_(KSPFETIDP) # <<<<<<<<<<<<<< * HPDDM = S_(KSPHPDDM) * */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(KSPFETIDP); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_FETIDP, __pyx_t_11) < 0) __PYX_ERR(49, 227, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":228 * CGLS = S_(KSPCGLS) * FETIDP = S_(KSPFETIDP) * HPDDM = S_(KSPHPDDM) # <<<<<<<<<<<<<< * * class KSPNormType(object): */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(KSPHPDDM); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_HPDDM, __pyx_t_11) < 0) __PYX_ERR(49, 228, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":3 * # -------------------------------------------------------------------- * * class KSPType(object): # <<<<<<<<<<<<<< * """KSP Type. * */ __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_KSPType, __pyx_t_13, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_KSPType, __pyx_t_11) < 0) __PYX_ERR(49, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/KSP.pyx":230 * HPDDM = S_(KSPHPDDM) * * class KSPNormType(object): # <<<<<<<<<<<<<< * """KSP norm type. * */ __pyx_t_13 = __Pyx_PEP560_update_bases(__pyx_tuple__185); if (unlikely(!__pyx_t_13)) __PYX_ERR(49, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(49, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_13, __pyx_n_s_KSPNormType, __pyx_n_s_KSPNormType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, __pyx_kp_s_KSP_norm_type_The_available_norm); if (unlikely(!__pyx_t_12)) __PYX_ERR(49, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_13 != __pyx_tuple__185) { if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_tuple__185) < 0))) __PYX_ERR(49, 230, __pyx_L1_error) } /* "petsc4py/PETSc/KSP.pyx":253 * """ * # native * NORM_DEFAULT = KSP_NORM_DEFAULT # <<<<<<<<<<<<<< * NORM_NONE = KSP_NORM_NONE * NORM_PRECONDITIONED = KSP_NORM_PRECONDITIONED */ __pyx_t_11 = __Pyx_PyInt_From_KSPNormType(KSP_NORM_DEFAULT); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_NORM_DEFAULT, __pyx_t_11) < 0) __PYX_ERR(49, 253, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":254 * # native * NORM_DEFAULT = KSP_NORM_DEFAULT * NORM_NONE = KSP_NORM_NONE # <<<<<<<<<<<<<< * NORM_PRECONDITIONED = KSP_NORM_PRECONDITIONED * NORM_UNPRECONDITIONED = KSP_NORM_UNPRECONDITIONED */ __pyx_t_11 = __Pyx_PyInt_From_KSPNormType(KSP_NORM_NONE); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_NORM_NONE, __pyx_t_11) < 0) __PYX_ERR(49, 254, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":255 * NORM_DEFAULT = KSP_NORM_DEFAULT * NORM_NONE = KSP_NORM_NONE * NORM_PRECONDITIONED = KSP_NORM_PRECONDITIONED # <<<<<<<<<<<<<< * NORM_UNPRECONDITIONED = KSP_NORM_UNPRECONDITIONED * NORM_NATURAL = KSP_NORM_NATURAL */ __pyx_t_11 = __Pyx_PyInt_From_KSPNormType(KSP_NORM_PRECONDITIONED); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_NORM_PRECONDITIONED, __pyx_t_11) < 0) __PYX_ERR(49, 255, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":256 * NORM_NONE = KSP_NORM_NONE * NORM_PRECONDITIONED = KSP_NORM_PRECONDITIONED * NORM_UNPRECONDITIONED = KSP_NORM_UNPRECONDITIONED # <<<<<<<<<<<<<< * NORM_NATURAL = KSP_NORM_NATURAL * # aliases */ __pyx_t_11 = __Pyx_PyInt_From_KSPNormType(KSP_NORM_UNPRECONDITIONED); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_NORM_UNPRECONDITIONED, __pyx_t_11) < 0) __PYX_ERR(49, 256, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":257 * NORM_PRECONDITIONED = KSP_NORM_PRECONDITIONED * NORM_UNPRECONDITIONED = KSP_NORM_UNPRECONDITIONED * NORM_NATURAL = KSP_NORM_NATURAL # <<<<<<<<<<<<<< * # aliases * DEFAULT = NORM_DEFAULT */ __pyx_t_11 = __Pyx_PyInt_From_KSPNormType(KSP_NORM_NATURAL); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_NORM_NATURAL, __pyx_t_11) < 0) __PYX_ERR(49, 257, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":259 * NORM_NATURAL = KSP_NORM_NATURAL * # aliases * DEFAULT = NORM_DEFAULT # <<<<<<<<<<<<<< * NONE = NO = NORM_NONE * PRECONDITIONED = NORM_PRECONDITIONED */ __pyx_t_11 = PyObject_GetItem(__pyx_t_12, __pyx_n_s_NORM_DEFAULT); if (unlikely(!__pyx_t_11)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_NORM_DEFAULT); } if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DEFAULT, __pyx_t_11) < 0) __PYX_ERR(49, 259, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":260 * # aliases * DEFAULT = NORM_DEFAULT * NONE = NO = NORM_NONE # <<<<<<<<<<<<<< * PRECONDITIONED = NORM_PRECONDITIONED * UNPRECONDITIONED = NORM_UNPRECONDITIONED */ __pyx_t_11 = PyObject_GetItem(__pyx_t_12, __pyx_n_s_NORM_NONE); if (unlikely(!__pyx_t_11)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_NORM_NONE); } if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_NONE, __pyx_t_11) < 0) __PYX_ERR(49, 260, __pyx_L1_error) if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_NO, __pyx_t_11) < 0) __PYX_ERR(49, 260, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":261 * DEFAULT = NORM_DEFAULT * NONE = NO = NORM_NONE * PRECONDITIONED = NORM_PRECONDITIONED # <<<<<<<<<<<<<< * UNPRECONDITIONED = NORM_UNPRECONDITIONED * NATURAL = NORM_NATURAL */ __pyx_t_11 = PyObject_GetItem(__pyx_t_12, __pyx_n_s_NORM_PRECONDITIONED); if (unlikely(!__pyx_t_11)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_NORM_PRECONDITIONED); } if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_PRECONDITIONED, __pyx_t_11) < 0) __PYX_ERR(49, 261, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":262 * NONE = NO = NORM_NONE * PRECONDITIONED = NORM_PRECONDITIONED * UNPRECONDITIONED = NORM_UNPRECONDITIONED # <<<<<<<<<<<<<< * NATURAL = NORM_NATURAL * */ __pyx_t_11 = PyObject_GetItem(__pyx_t_12, __pyx_n_s_NORM_UNPRECONDITIONED); if (unlikely(!__pyx_t_11)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_NORM_UNPRECONDITIONED); } if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_UNPRECONDITIONED, __pyx_t_11) < 0) __PYX_ERR(49, 262, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":263 * PRECONDITIONED = NORM_PRECONDITIONED * UNPRECONDITIONED = NORM_UNPRECONDITIONED * NATURAL = NORM_NATURAL # <<<<<<<<<<<<<< * * class KSPConvergedReason(object): */ __pyx_t_11 = PyObject_GetItem(__pyx_t_12, __pyx_n_s_NORM_NATURAL); if (unlikely(!__pyx_t_11)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_NORM_NATURAL); } if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_NATURAL, __pyx_t_11) < 0) __PYX_ERR(49, 263, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":230 * HPDDM = S_(KSPHPDDM) * * class KSPNormType(object): # <<<<<<<<<<<<<< * """KSP norm type. * */ __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_KSPNormType, __pyx_t_13, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_KSPNormType, __pyx_t_11) < 0) __PYX_ERR(49, 230, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/KSP.pyx":265 * NATURAL = NORM_NATURAL * * class KSPConvergedReason(object): # <<<<<<<<<<<<<< * """KSP Converged Reason. * */ __pyx_t_13 = __Pyx_PEP560_update_bases(__pyx_tuple__187); if (unlikely(!__pyx_t_13)) __PYX_ERR(49, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(49, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_13, __pyx_n_s_KSPConvergedReason, __pyx_n_s_KSPConvergedReason, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, __pyx_kp_s_KSP_Converged_Reason_CONVERGED_I); if (unlikely(!__pyx_t_12)) __PYX_ERR(49, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_13 != __pyx_tuple__187) { if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_tuple__187) < 0))) __PYX_ERR(49, 265, __pyx_L1_error) } /* "petsc4py/PETSc/KSP.pyx":333 * """ * #iterating * CONVERGED_ITERATING = KSP_CONVERGED_ITERATING # <<<<<<<<<<<<<< * ITERATING = KSP_CONVERGED_ITERATING * # converged */ __pyx_t_11 = __Pyx_PyInt_From_KSPConvergedReason(KSP_CONVERGED_ITERATING); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_CONVERGED_ITERATING, __pyx_t_11) < 0) __PYX_ERR(49, 333, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":334 * #iterating * CONVERGED_ITERATING = KSP_CONVERGED_ITERATING * ITERATING = KSP_CONVERGED_ITERATING # <<<<<<<<<<<<<< * # converged * CONVERGED_RTOL_NORMAL = KSP_CONVERGED_RTOL_NORMAL */ __pyx_t_11 = __Pyx_PyInt_From_KSPConvergedReason(KSP_CONVERGED_ITERATING); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_ITERATING, __pyx_t_11) < 0) __PYX_ERR(49, 334, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":336 * ITERATING = KSP_CONVERGED_ITERATING * # converged * CONVERGED_RTOL_NORMAL = KSP_CONVERGED_RTOL_NORMAL # <<<<<<<<<<<<<< * CONVERGED_ATOL_NORMAL = KSP_CONVERGED_ATOL_NORMAL * CONVERGED_RTOL = KSP_CONVERGED_RTOL */ __pyx_t_11 = __Pyx_PyInt_From_KSPConvergedReason(KSP_CONVERGED_RTOL_NORMAL); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_CONVERGED_RTOL_NORMAL, __pyx_t_11) < 0) __PYX_ERR(49, 336, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":337 * # converged * CONVERGED_RTOL_NORMAL = KSP_CONVERGED_RTOL_NORMAL * CONVERGED_ATOL_NORMAL = KSP_CONVERGED_ATOL_NORMAL # <<<<<<<<<<<<<< * CONVERGED_RTOL = KSP_CONVERGED_RTOL * CONVERGED_ATOL = KSP_CONVERGED_ATOL */ __pyx_t_11 = __Pyx_PyInt_From_KSPConvergedReason(KSP_CONVERGED_ATOL_NORMAL); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_CONVERGED_ATOL_NORMAL, __pyx_t_11) < 0) __PYX_ERR(49, 337, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":338 * CONVERGED_RTOL_NORMAL = KSP_CONVERGED_RTOL_NORMAL * CONVERGED_ATOL_NORMAL = KSP_CONVERGED_ATOL_NORMAL * CONVERGED_RTOL = KSP_CONVERGED_RTOL # <<<<<<<<<<<<<< * CONVERGED_ATOL = KSP_CONVERGED_ATOL * CONVERGED_ITS = KSP_CONVERGED_ITS */ __pyx_t_11 = __Pyx_PyInt_From_KSPConvergedReason(KSP_CONVERGED_RTOL); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_CONVERGED_RTOL, __pyx_t_11) < 0) __PYX_ERR(49, 338, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":339 * CONVERGED_ATOL_NORMAL = KSP_CONVERGED_ATOL_NORMAL * CONVERGED_RTOL = KSP_CONVERGED_RTOL * CONVERGED_ATOL = KSP_CONVERGED_ATOL # <<<<<<<<<<<<<< * CONVERGED_ITS = KSP_CONVERGED_ITS * CONVERGED_NEG_CURVE = KSP_CONVERGED_NEG_CURVE */ __pyx_t_11 = __Pyx_PyInt_From_KSPConvergedReason(KSP_CONVERGED_ATOL); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 339, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_CONVERGED_ATOL, __pyx_t_11) < 0) __PYX_ERR(49, 339, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":340 * CONVERGED_RTOL = KSP_CONVERGED_RTOL * CONVERGED_ATOL = KSP_CONVERGED_ATOL * CONVERGED_ITS = KSP_CONVERGED_ITS # <<<<<<<<<<<<<< * CONVERGED_NEG_CURVE = KSP_CONVERGED_NEG_CURVE * CONVERGED_STEP_LENGTH = KSP_CONVERGED_STEP_LENGTH */ __pyx_t_11 = __Pyx_PyInt_From_KSPConvergedReason(KSP_CONVERGED_ITS); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_CONVERGED_ITS, __pyx_t_11) < 0) __PYX_ERR(49, 340, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":341 * CONVERGED_ATOL = KSP_CONVERGED_ATOL * CONVERGED_ITS = KSP_CONVERGED_ITS * CONVERGED_NEG_CURVE = KSP_CONVERGED_NEG_CURVE # <<<<<<<<<<<<<< * CONVERGED_STEP_LENGTH = KSP_CONVERGED_STEP_LENGTH * CONVERGED_HAPPY_BREAKDOWN = KSP_CONVERGED_HAPPY_BREAKDOWN */ __pyx_t_11 = __Pyx_PyInt_From_KSPConvergedReason(KSP_CONVERGED_NEG_CURVE); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_CONVERGED_NEG_CURVE, __pyx_t_11) < 0) __PYX_ERR(49, 341, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":342 * CONVERGED_ITS = KSP_CONVERGED_ITS * CONVERGED_NEG_CURVE = KSP_CONVERGED_NEG_CURVE * CONVERGED_STEP_LENGTH = KSP_CONVERGED_STEP_LENGTH # <<<<<<<<<<<<<< * CONVERGED_HAPPY_BREAKDOWN = KSP_CONVERGED_HAPPY_BREAKDOWN * # diverged */ __pyx_t_11 = __Pyx_PyInt_From_KSPConvergedReason(KSP_CONVERGED_STEP_LENGTH); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_CONVERGED_STEP_LENGTH, __pyx_t_11) < 0) __PYX_ERR(49, 342, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":343 * CONVERGED_NEG_CURVE = KSP_CONVERGED_NEG_CURVE * CONVERGED_STEP_LENGTH = KSP_CONVERGED_STEP_LENGTH * CONVERGED_HAPPY_BREAKDOWN = KSP_CONVERGED_HAPPY_BREAKDOWN # <<<<<<<<<<<<<< * # diverged * DIVERGED_NULL = KSP_DIVERGED_NULL */ __pyx_t_11 = __Pyx_PyInt_From_KSPConvergedReason(KSP_CONVERGED_HAPPY_BREAKDOWN); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_CONVERGED_HAPPY_BREAKDOWN, __pyx_t_11) < 0) __PYX_ERR(49, 343, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":345 * CONVERGED_HAPPY_BREAKDOWN = KSP_CONVERGED_HAPPY_BREAKDOWN * # diverged * DIVERGED_NULL = KSP_DIVERGED_NULL # <<<<<<<<<<<<<< * DIVERGED_MAX_IT = KSP_DIVERGED_MAX_IT * DIVERGED_DTOL = KSP_DIVERGED_DTOL */ __pyx_t_11 = __Pyx_PyInt_From_KSPConvergedReason(KSP_DIVERGED_NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 345, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DIVERGED_NULL, __pyx_t_11) < 0) __PYX_ERR(49, 345, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":346 * # diverged * DIVERGED_NULL = KSP_DIVERGED_NULL * DIVERGED_MAX_IT = KSP_DIVERGED_MAX_IT # <<<<<<<<<<<<<< * DIVERGED_DTOL = KSP_DIVERGED_DTOL * DIVERGED_BREAKDOWN = KSP_DIVERGED_BREAKDOWN */ __pyx_t_11 = __Pyx_PyInt_From_KSPConvergedReason(KSP_DIVERGED_ITS); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DIVERGED_MAX_IT, __pyx_t_11) < 0) __PYX_ERR(49, 346, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":347 * DIVERGED_NULL = KSP_DIVERGED_NULL * DIVERGED_MAX_IT = KSP_DIVERGED_MAX_IT * DIVERGED_DTOL = KSP_DIVERGED_DTOL # <<<<<<<<<<<<<< * DIVERGED_BREAKDOWN = KSP_DIVERGED_BREAKDOWN * DIVERGED_BREAKDOWN_BICG = KSP_DIVERGED_BREAKDOWN_BICG */ __pyx_t_11 = __Pyx_PyInt_From_KSPConvergedReason(KSP_DIVERGED_DTOL); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 347, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DIVERGED_DTOL, __pyx_t_11) < 0) __PYX_ERR(49, 347, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":348 * DIVERGED_MAX_IT = KSP_DIVERGED_MAX_IT * DIVERGED_DTOL = KSP_DIVERGED_DTOL * DIVERGED_BREAKDOWN = KSP_DIVERGED_BREAKDOWN # <<<<<<<<<<<<<< * DIVERGED_BREAKDOWN_BICG = KSP_DIVERGED_BREAKDOWN_BICG * DIVERGED_NONSYMMETRIC = KSP_DIVERGED_NONSYMMETRIC */ __pyx_t_11 = __Pyx_PyInt_From_KSPConvergedReason(KSP_DIVERGED_BREAKDOWN); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DIVERGED_BREAKDOWN, __pyx_t_11) < 0) __PYX_ERR(49, 348, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":349 * DIVERGED_DTOL = KSP_DIVERGED_DTOL * DIVERGED_BREAKDOWN = KSP_DIVERGED_BREAKDOWN * DIVERGED_BREAKDOWN_BICG = KSP_DIVERGED_BREAKDOWN_BICG # <<<<<<<<<<<<<< * DIVERGED_NONSYMMETRIC = KSP_DIVERGED_NONSYMMETRIC * DIVERGED_INDEFINITE_PC = KSP_DIVERGED_INDEFINITE_PC */ __pyx_t_11 = __Pyx_PyInt_From_KSPConvergedReason(KSP_DIVERGED_BREAKDOWN_BICG); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DIVERGED_BREAKDOWN_BICG, __pyx_t_11) < 0) __PYX_ERR(49, 349, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":350 * DIVERGED_BREAKDOWN = KSP_DIVERGED_BREAKDOWN * DIVERGED_BREAKDOWN_BICG = KSP_DIVERGED_BREAKDOWN_BICG * DIVERGED_NONSYMMETRIC = KSP_DIVERGED_NONSYMMETRIC # <<<<<<<<<<<<<< * DIVERGED_INDEFINITE_PC = KSP_DIVERGED_INDEFINITE_PC * DIVERGED_NANORINF = KSP_DIVERGED_NANORINF */ __pyx_t_11 = __Pyx_PyInt_From_KSPConvergedReason(KSP_DIVERGED_NONSYMMETRIC); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DIVERGED_NONSYMMETRIC, __pyx_t_11) < 0) __PYX_ERR(49, 350, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":351 * DIVERGED_BREAKDOWN_BICG = KSP_DIVERGED_BREAKDOWN_BICG * DIVERGED_NONSYMMETRIC = KSP_DIVERGED_NONSYMMETRIC * DIVERGED_INDEFINITE_PC = KSP_DIVERGED_INDEFINITE_PC # <<<<<<<<<<<<<< * DIVERGED_NANORINF = KSP_DIVERGED_NANORINF * DIVERGED_INDEFINITE_MAT = KSP_DIVERGED_INDEFINITE_MAT */ __pyx_t_11 = __Pyx_PyInt_From_KSPConvergedReason(KSP_DIVERGED_INDEFINITE_PC); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DIVERGED_INDEFINITE_PC, __pyx_t_11) < 0) __PYX_ERR(49, 351, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":352 * DIVERGED_NONSYMMETRIC = KSP_DIVERGED_NONSYMMETRIC * DIVERGED_INDEFINITE_PC = KSP_DIVERGED_INDEFINITE_PC * DIVERGED_NANORINF = KSP_DIVERGED_NANORINF # <<<<<<<<<<<<<< * DIVERGED_INDEFINITE_MAT = KSP_DIVERGED_INDEFINITE_MAT * DIVERGED_PCSETUP_FAILED = KSP_DIVERGED_PC_FAILED */ __pyx_t_11 = __Pyx_PyInt_From_KSPConvergedReason(KSP_DIVERGED_NANORINF); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DIVERGED_NANORINF, __pyx_t_11) < 0) __PYX_ERR(49, 352, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":353 * DIVERGED_INDEFINITE_PC = KSP_DIVERGED_INDEFINITE_PC * DIVERGED_NANORINF = KSP_DIVERGED_NANORINF * DIVERGED_INDEFINITE_MAT = KSP_DIVERGED_INDEFINITE_MAT # <<<<<<<<<<<<<< * DIVERGED_PCSETUP_FAILED = KSP_DIVERGED_PC_FAILED * */ __pyx_t_11 = __Pyx_PyInt_From_KSPConvergedReason(KSP_DIVERGED_INDEFINITE_MAT); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DIVERGED_INDEFINITE_MAT, __pyx_t_11) < 0) __PYX_ERR(49, 353, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":354 * DIVERGED_NANORINF = KSP_DIVERGED_NANORINF * DIVERGED_INDEFINITE_MAT = KSP_DIVERGED_INDEFINITE_MAT * DIVERGED_PCSETUP_FAILED = KSP_DIVERGED_PC_FAILED # <<<<<<<<<<<<<< * * class KSPHPDDMType(object): */ __pyx_t_11 = __Pyx_PyInt_From_KSPConvergedReason(KSP_DIVERGED_PC_FAILED); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DIVERGED_PCSETUP_FAILED, __pyx_t_11) < 0) __PYX_ERR(49, 354, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":265 * NATURAL = NORM_NATURAL * * class KSPConvergedReason(object): # <<<<<<<<<<<<<< * """KSP Converged Reason. * */ __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_KSPConvergedReason, __pyx_t_13, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_KSPConvergedReason, __pyx_t_11) < 0) __PYX_ERR(49, 265, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/KSP.pyx":356 * DIVERGED_PCSETUP_FAILED = KSP_DIVERGED_PC_FAILED * * class KSPHPDDMType(object): # <<<<<<<<<<<<<< * """The *HPDDM* Krylov solver type.""" * GMRES = KSP_HPDDM_TYPE_GMRES */ __pyx_t_13 = __Pyx_PEP560_update_bases(__pyx_tuple__189); if (unlikely(!__pyx_t_13)) __PYX_ERR(49, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(49, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_13, __pyx_n_s_KSPHPDDMType, __pyx_n_s_KSPHPDDMType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, __pyx_kp_s_The_HPDDM_Krylov_solver_type); if (unlikely(!__pyx_t_12)) __PYX_ERR(49, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_13 != __pyx_tuple__189) { if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_tuple__189) < 0))) __PYX_ERR(49, 356, __pyx_L1_error) } /* "petsc4py/PETSc/KSP.pyx":358 * class KSPHPDDMType(object): * """The *HPDDM* Krylov solver type.""" * GMRES = KSP_HPDDM_TYPE_GMRES # <<<<<<<<<<<<<< * BGMRES = KSP_HPDDM_TYPE_BGMRES * CG = KSP_HPDDM_TYPE_CG */ __pyx_t_11 = __Pyx_PyInt_From_KSPHPDDMType(KSP_HPDDM_TYPE_GMRES); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_GMRES, __pyx_t_11) < 0) __PYX_ERR(49, 358, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":359 * """The *HPDDM* Krylov solver type.""" * GMRES = KSP_HPDDM_TYPE_GMRES * BGMRES = KSP_HPDDM_TYPE_BGMRES # <<<<<<<<<<<<<< * CG = KSP_HPDDM_TYPE_CG * BCG = KSP_HPDDM_TYPE_BCG */ __pyx_t_11 = __Pyx_PyInt_From_KSPHPDDMType(KSP_HPDDM_TYPE_BGMRES); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_BGMRES, __pyx_t_11) < 0) __PYX_ERR(49, 359, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":360 * GMRES = KSP_HPDDM_TYPE_GMRES * BGMRES = KSP_HPDDM_TYPE_BGMRES * CG = KSP_HPDDM_TYPE_CG # <<<<<<<<<<<<<< * BCG = KSP_HPDDM_TYPE_BCG * GCRODR = KSP_HPDDM_TYPE_GCRODR */ __pyx_t_11 = __Pyx_PyInt_From_KSPHPDDMType(KSP_HPDDM_TYPE_CG); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_CG, __pyx_t_11) < 0) __PYX_ERR(49, 360, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":361 * BGMRES = KSP_HPDDM_TYPE_BGMRES * CG = KSP_HPDDM_TYPE_CG * BCG = KSP_HPDDM_TYPE_BCG # <<<<<<<<<<<<<< * GCRODR = KSP_HPDDM_TYPE_GCRODR * BGCRODR = KSP_HPDDM_TYPE_BGCRODR */ __pyx_t_11 = __Pyx_PyInt_From_KSPHPDDMType(KSP_HPDDM_TYPE_BCG); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_BCG, __pyx_t_11) < 0) __PYX_ERR(49, 361, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":362 * CG = KSP_HPDDM_TYPE_CG * BCG = KSP_HPDDM_TYPE_BCG * GCRODR = KSP_HPDDM_TYPE_GCRODR # <<<<<<<<<<<<<< * BGCRODR = KSP_HPDDM_TYPE_BGCRODR * BFBCG = KSP_HPDDM_TYPE_BFBCG */ __pyx_t_11 = __Pyx_PyInt_From_KSPHPDDMType(KSP_HPDDM_TYPE_GCRODR); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_GCRODR, __pyx_t_11) < 0) __PYX_ERR(49, 362, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":363 * BCG = KSP_HPDDM_TYPE_BCG * GCRODR = KSP_HPDDM_TYPE_GCRODR * BGCRODR = KSP_HPDDM_TYPE_BGCRODR # <<<<<<<<<<<<<< * BFBCG = KSP_HPDDM_TYPE_BFBCG * PREONLY = KSP_HPDDM_TYPE_PREONLY */ __pyx_t_11 = __Pyx_PyInt_From_KSPHPDDMType(KSP_HPDDM_TYPE_BGCRODR); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_BGCRODR, __pyx_t_11) < 0) __PYX_ERR(49, 363, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":364 * GCRODR = KSP_HPDDM_TYPE_GCRODR * BGCRODR = KSP_HPDDM_TYPE_BGCRODR * BFBCG = KSP_HPDDM_TYPE_BFBCG # <<<<<<<<<<<<<< * PREONLY = KSP_HPDDM_TYPE_PREONLY * */ __pyx_t_11 = __Pyx_PyInt_From_KSPHPDDMType(KSP_HPDDM_TYPE_BFBCG); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_BFBCG, __pyx_t_11) < 0) __PYX_ERR(49, 364, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":365 * BGCRODR = KSP_HPDDM_TYPE_BGCRODR * BFBCG = KSP_HPDDM_TYPE_BFBCG * PREONLY = KSP_HPDDM_TYPE_PREONLY # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_t_11 = __Pyx_PyInt_From_KSPHPDDMType(KSP_HPDDM_TYPE_PREONLY); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 365, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_PREONLY, __pyx_t_11) < 0) __PYX_ERR(49, 365, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/KSP.pyx":356 * DIVERGED_PCSETUP_FAILED = KSP_DIVERGED_PC_FAILED * * class KSPHPDDMType(object): # <<<<<<<<<<<<<< * """The *HPDDM* Krylov solver type.""" * GMRES = KSP_HPDDM_TYPE_GMRES */ __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_KSPHPDDMType, __pyx_t_13, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(49, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_KSPHPDDMType, __pyx_t_11) < 0) __PYX_ERR(49, 356, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/KSP.pyx":389 * """ * * Type = KSPType # <<<<<<<<<<<<<< * NormType = KSPNormType * ConvergedReason = KSPConvergedReason */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_KSPType); if (unlikely(!__pyx_t_13)) __PYX_ERR(49, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_n_s_Type, __pyx_t_13) < 0) __PYX_ERR(49, 389, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_KSP); /* "petsc4py/PETSc/KSP.pyx":390 * * Type = KSPType * NormType = KSPNormType # <<<<<<<<<<<<<< * ConvergedReason = KSPConvergedReason * HPDDMType = KSPHPDDMType */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_KSPNormType); if (unlikely(!__pyx_t_13)) __PYX_ERR(49, 390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_n_s_NormType, __pyx_t_13) < 0) __PYX_ERR(49, 390, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_KSP); /* "petsc4py/PETSc/KSP.pyx":391 * Type = KSPType * NormType = KSPNormType * ConvergedReason = KSPConvergedReason # <<<<<<<<<<<<<< * HPDDMType = KSPHPDDMType * */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_KSPConvergedReason); if (unlikely(!__pyx_t_13)) __PYX_ERR(49, 391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_n_s_ConvergedReason, __pyx_t_13) < 0) __PYX_ERR(49, 391, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_KSP); /* "petsc4py/PETSc/KSP.pyx":392 * NormType = KSPNormType * ConvergedReason = KSPConvergedReason * HPDDMType = KSPHPDDMType # <<<<<<<<<<<<<< * * # --- xxx --- */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_KSPHPDDMType); if (unlikely(!__pyx_t_13)) __PYX_ERR(49, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_n_s_HPDDMType, __pyx_t_13) < 0) __PYX_ERR(49, 392, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_KSP); /* "petsc4py/PETSc/KSP.pyx":1246 * self.set_attr('__monitor__', None) * * cancelMonitor = monitorCancel # <<<<<<<<<<<<<< * * def monitor(self, its: int, rnorm: float) -> None: */ __Pyx_GetNameInClass(__pyx_t_13, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_n_s_monitorCancel); if (unlikely(!__pyx_t_13)) __PYX_ERR(49, 1246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_n_s_cancelMonitor, __pyx_t_13) < 0) __PYX_ERR(49, 1246, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_KSP); /* "petsc4py/PETSc/KSP.pyx":2242 * # -------------------------------------------------------------------- * * del KSPType # <<<<<<<<<<<<<< * del KSPNormType * del KSPConvergedReason */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_KSPType) < 0) __PYX_ERR(49, 2242, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":2243 * * del KSPType * del KSPNormType # <<<<<<<<<<<<<< * del KSPConvergedReason * del KSPHPDDMType */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_KSPNormType) < 0) __PYX_ERR(49, 2243, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":2244 * del KSPType * del KSPNormType * del KSPConvergedReason # <<<<<<<<<<<<<< * del KSPHPDDMType * */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_KSPConvergedReason) < 0) __PYX_ERR(49, 2244, __pyx_L1_error) /* "petsc4py/PETSc/KSP.pyx":2245 * del KSPNormType * del KSPConvergedReason * del KSPHPDDMType # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_KSPHPDDMType) < 0) __PYX_ERR(49, 2245, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":3 * # -------------------------------------------------------------------- * * class SNESType(object): # <<<<<<<<<<<<<< * """SNES solver type. * */ __pyx_t_13 = __Pyx_PEP560_update_bases(__pyx_tuple__191); if (unlikely(!__pyx_t_13)) __PYX_ERR(50, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(50, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_13, __pyx_n_s_SNESType, __pyx_n_s_SNESType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, __pyx_kp_s_SNES_solver_type_See_Also_petsc); if (unlikely(!__pyx_t_12)) __PYX_ERR(50, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_13 != __pyx_tuple__191) { if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_tuple__191) < 0))) __PYX_ERR(50, 3, __pyx_L1_error) } /* "petsc4py/PETSc/SNES.pyx":11 * * """ * NEWTONLS = S_(SNESNEWTONLS) # <<<<<<<<<<<<<< * NEWTONTR = S_(SNESNEWTONTR) * PYTHON = S_(SNESPYTHON) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(SNESNEWTONLS); if (unlikely(!__pyx_t_11)) __PYX_ERR(50, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_NEWTONLS, __pyx_t_11) < 0) __PYX_ERR(50, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/SNES.pyx":12 * """ * NEWTONLS = S_(SNESNEWTONLS) * NEWTONTR = S_(SNESNEWTONTR) # <<<<<<<<<<<<<< * PYTHON = S_(SNESPYTHON) * NRICHARDSON = S_(SNESNRICHARDSON) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(SNESNEWTONTR); if (unlikely(!__pyx_t_11)) __PYX_ERR(50, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_NEWTONTR, __pyx_t_11) < 0) __PYX_ERR(50, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/SNES.pyx":13 * NEWTONLS = S_(SNESNEWTONLS) * NEWTONTR = S_(SNESNEWTONTR) * PYTHON = S_(SNESPYTHON) # <<<<<<<<<<<<<< * NRICHARDSON = S_(SNESNRICHARDSON) * KSPONLY = S_(SNESKSPONLY) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(SNESPYTHON); if (unlikely(!__pyx_t_11)) __PYX_ERR(50, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_PYTHON, __pyx_t_11) < 0) __PYX_ERR(50, 13, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/SNES.pyx":14 * NEWTONTR = S_(SNESNEWTONTR) * PYTHON = S_(SNESPYTHON) * NRICHARDSON = S_(SNESNRICHARDSON) # <<<<<<<<<<<<<< * KSPONLY = S_(SNESKSPONLY) * KSPTRANSPOSEONLY = S_(SNESKSPTRANSPOSEONLY) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(SNESNRICHARDSON); if (unlikely(!__pyx_t_11)) __PYX_ERR(50, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_NRICHARDSON, __pyx_t_11) < 0) __PYX_ERR(50, 14, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/SNES.pyx":15 * PYTHON = S_(SNESPYTHON) * NRICHARDSON = S_(SNESNRICHARDSON) * KSPONLY = S_(SNESKSPONLY) # <<<<<<<<<<<<<< * KSPTRANSPOSEONLY = S_(SNESKSPTRANSPOSEONLY) * VINEWTONRSLS = S_(SNESVINEWTONRSLS) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(SNESKSPONLY); if (unlikely(!__pyx_t_11)) __PYX_ERR(50, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_KSPONLY, __pyx_t_11) < 0) __PYX_ERR(50, 15, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/SNES.pyx":16 * NRICHARDSON = S_(SNESNRICHARDSON) * KSPONLY = S_(SNESKSPONLY) * KSPTRANSPOSEONLY = S_(SNESKSPTRANSPOSEONLY) # <<<<<<<<<<<<<< * VINEWTONRSLS = S_(SNESVINEWTONRSLS) * VINEWTONSSLS = S_(SNESVINEWTONSSLS) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(SNESKSPTRANSPOSEONLY); if (unlikely(!__pyx_t_11)) __PYX_ERR(50, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_KSPTRANSPOSEONLY, __pyx_t_11) < 0) __PYX_ERR(50, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/SNES.pyx":17 * KSPONLY = S_(SNESKSPONLY) * KSPTRANSPOSEONLY = S_(SNESKSPTRANSPOSEONLY) * VINEWTONRSLS = S_(SNESVINEWTONRSLS) # <<<<<<<<<<<<<< * VINEWTONSSLS = S_(SNESVINEWTONSSLS) * NGMRES = S_(SNESNGMRES) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(SNESVINEWTONRSLS); if (unlikely(!__pyx_t_11)) __PYX_ERR(50, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_VINEWTONRSLS, __pyx_t_11) < 0) __PYX_ERR(50, 17, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/SNES.pyx":18 * KSPTRANSPOSEONLY = S_(SNESKSPTRANSPOSEONLY) * VINEWTONRSLS = S_(SNESVINEWTONRSLS) * VINEWTONSSLS = S_(SNESVINEWTONSSLS) # <<<<<<<<<<<<<< * NGMRES = S_(SNESNGMRES) * QN = S_(SNESQN) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(SNESVINEWTONSSLS); if (unlikely(!__pyx_t_11)) __PYX_ERR(50, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_VINEWTONSSLS, __pyx_t_11) < 0) __PYX_ERR(50, 18, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/SNES.pyx":19 * VINEWTONRSLS = S_(SNESVINEWTONRSLS) * VINEWTONSSLS = S_(SNESVINEWTONSSLS) * NGMRES = S_(SNESNGMRES) # <<<<<<<<<<<<<< * QN = S_(SNESQN) * SHELL = S_(SNESSHELL) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(SNESNGMRES); if (unlikely(!__pyx_t_11)) __PYX_ERR(50, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_NGMRES, __pyx_t_11) < 0) __PYX_ERR(50, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/SNES.pyx":20 * VINEWTONSSLS = S_(SNESVINEWTONSSLS) * NGMRES = S_(SNESNGMRES) * QN = S_(SNESQN) # <<<<<<<<<<<<<< * SHELL = S_(SNESSHELL) * NGS = S_(SNESNGS) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(SNESQN); if (unlikely(!__pyx_t_11)) __PYX_ERR(50, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_QN, __pyx_t_11) < 0) __PYX_ERR(50, 20, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/SNES.pyx":21 * NGMRES = S_(SNESNGMRES) * QN = S_(SNESQN) * SHELL = S_(SNESSHELL) # <<<<<<<<<<<<<< * NGS = S_(SNESNGS) * NCG = S_(SNESNCG) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(SNESSHELL); if (unlikely(!__pyx_t_11)) __PYX_ERR(50, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SHELL, __pyx_t_11) < 0) __PYX_ERR(50, 21, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/SNES.pyx":22 * QN = S_(SNESQN) * SHELL = S_(SNESSHELL) * NGS = S_(SNESNGS) # <<<<<<<<<<<<<< * NCG = S_(SNESNCG) * FAS = S_(SNESFAS) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(SNESNGS); if (unlikely(!__pyx_t_11)) __PYX_ERR(50, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_NGS, __pyx_t_11) < 0) __PYX_ERR(50, 22, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/SNES.pyx":23 * SHELL = S_(SNESSHELL) * NGS = S_(SNESNGS) * NCG = S_(SNESNCG) # <<<<<<<<<<<<<< * FAS = S_(SNESFAS) * MS = S_(SNESMS) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(SNESNCG); if (unlikely(!__pyx_t_11)) __PYX_ERR(50, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_NCG, __pyx_t_11) < 0) __PYX_ERR(50, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/SNES.pyx":24 * NGS = S_(SNESNGS) * NCG = S_(SNESNCG) * FAS = S_(SNESFAS) # <<<<<<<<<<<<<< * MS = S_(SNESMS) * NASM = S_(SNESNASM) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(SNESFAS); if (unlikely(!__pyx_t_11)) __PYX_ERR(50, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_FAS, __pyx_t_11) < 0) __PYX_ERR(50, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/SNES.pyx":25 * NCG = S_(SNESNCG) * FAS = S_(SNESFAS) * MS = S_(SNESMS) # <<<<<<<<<<<<<< * NASM = S_(SNESNASM) * ANDERSON = S_(SNESANDERSON) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(SNESMS); if (unlikely(!__pyx_t_11)) __PYX_ERR(50, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_MS, __pyx_t_11) < 0) __PYX_ERR(50, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/SNES.pyx":26 * FAS = S_(SNESFAS) * MS = S_(SNESMS) * NASM = S_(SNESNASM) # <<<<<<<<<<<<<< * ANDERSON = S_(SNESANDERSON) * ASPIN = S_(SNESASPIN) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(SNESNASM); if (unlikely(!__pyx_t_11)) __PYX_ERR(50, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_NASM, __pyx_t_11) < 0) __PYX_ERR(50, 26, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/SNES.pyx":27 * MS = S_(SNESMS) * NASM = S_(SNESNASM) * ANDERSON = S_(SNESANDERSON) # <<<<<<<<<<<<<< * ASPIN = S_(SNESASPIN) * COMPOSITE = S_(SNESCOMPOSITE) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(SNESANDERSON); if (unlikely(!__pyx_t_11)) __PYX_ERR(50, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_ANDERSON, __pyx_t_11) < 0) __PYX_ERR(50, 27, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/SNES.pyx":28 * NASM = S_(SNESNASM) * ANDERSON = S_(SNESANDERSON) * ASPIN = S_(SNESASPIN) # <<<<<<<<<<<<<< * COMPOSITE = S_(SNESCOMPOSITE) * PATCH = S_(SNESPATCH) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(SNESASPIN); if (unlikely(!__pyx_t_11)) __PYX_ERR(50, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_ASPIN, __pyx_t_11) < 0) __PYX_ERR(50, 28, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/SNES.pyx":29 * ANDERSON = S_(SNESANDERSON) * ASPIN = S_(SNESASPIN) * COMPOSITE = S_(SNESCOMPOSITE) # <<<<<<<<<<<<<< * PATCH = S_(SNESPATCH) * */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(SNESCOMPOSITE); if (unlikely(!__pyx_t_11)) __PYX_ERR(50, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_COMPOSITE, __pyx_t_11) < 0) __PYX_ERR(50, 29, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/SNES.pyx":30 * ASPIN = S_(SNESASPIN) * COMPOSITE = S_(SNESCOMPOSITE) * PATCH = S_(SNESPATCH) # <<<<<<<<<<<<<< * * class SNESNormSchedule(object): */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(SNESPATCH); if (unlikely(!__pyx_t_11)) __PYX_ERR(50, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_PATCH, __pyx_t_11) < 0) __PYX_ERR(50, 30, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/SNES.pyx":3 * # -------------------------------------------------------------------- * * class SNESType(object): # <<<<<<<<<<<<<< * """SNES solver type. * */ __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_SNESType, __pyx_t_13, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(50, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_SNESType, __pyx_t_11) < 0) __PYX_ERR(50, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/SNES.pyx":32 * PATCH = S_(SNESPATCH) * * class SNESNormSchedule(object): # <<<<<<<<<<<<<< * """SNES norm schedule. * */ __pyx_t_13 = __Pyx_PEP560_update_bases(__pyx_tuple__193); if (unlikely(!__pyx_t_13)) __PYX_ERR(50, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(50, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_13, __pyx_n_s_SNESNormSchedule, __pyx_n_s_SNESNormSchedule, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, __pyx_kp_s_SNES_norm_schedule_See_Also_pets); if (unlikely(!__pyx_t_12)) __PYX_ERR(50, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_13 != __pyx_tuple__193) { if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_tuple__193) < 0))) __PYX_ERR(50, 32, __pyx_L1_error) } /* "petsc4py/PETSc/SNES.pyx":41 * """ * # native * NORM_DEFAULT = SNES_NORM_DEFAULT # <<<<<<<<<<<<<< * NORM_NONE = SNES_NORM_NONE * NORM_ALWAYS = SNES_NORM_ALWAYS */ __pyx_t_11 = __Pyx_PyInt_From_SNESNormSchedule(SNES_NORM_DEFAULT); if (unlikely(!__pyx_t_11)) __PYX_ERR(50, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_NORM_DEFAULT, __pyx_t_11) < 0) __PYX_ERR(50, 41, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/SNES.pyx":42 * # native * NORM_DEFAULT = SNES_NORM_DEFAULT * NORM_NONE = SNES_NORM_NONE # <<<<<<<<<<<<<< * NORM_ALWAYS = SNES_NORM_ALWAYS * NORM_INITIAL_ONLY = SNES_NORM_INITIAL_ONLY */ __pyx_t_11 = __Pyx_PyInt_From_SNESNormSchedule(SNES_NORM_NONE); if (unlikely(!__pyx_t_11)) __PYX_ERR(50, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_NORM_NONE, __pyx_t_11) < 0) __PYX_ERR(50, 42, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/SNES.pyx":43 * NORM_DEFAULT = SNES_NORM_DEFAULT * NORM_NONE = SNES_NORM_NONE * NORM_ALWAYS = SNES_NORM_ALWAYS # <<<<<<<<<<<<<< * NORM_INITIAL_ONLY = SNES_NORM_INITIAL_ONLY * NORM_FINAL_ONLY = SNES_NORM_FINAL_ONLY */ __pyx_t_11 = __Pyx_PyInt_From_SNESNormSchedule(SNES_NORM_ALWAYS); if (unlikely(!__pyx_t_11)) __PYX_ERR(50, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_NORM_ALWAYS, __pyx_t_11) < 0) __PYX_ERR(50, 43, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/SNES.pyx":44 * NORM_NONE = SNES_NORM_NONE * NORM_ALWAYS = SNES_NORM_ALWAYS * NORM_INITIAL_ONLY = SNES_NORM_INITIAL_ONLY # <<<<<<<<<<<<<< * NORM_FINAL_ONLY = SNES_NORM_FINAL_ONLY * NORM_INITIAL_FINAL_ONLY = SNES_NORM_INITIAL_FINAL_ONLY */ __pyx_t_11 = __Pyx_PyInt_From_SNESNormSchedule(SNES_NORM_INITIAL_ONLY); if (unlikely(!__pyx_t_11)) __PYX_ERR(50, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_NORM_INITIAL_ONLY, __pyx_t_11) < 0) __PYX_ERR(50, 44, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/SNES.pyx":45 * NORM_ALWAYS = SNES_NORM_ALWAYS * NORM_INITIAL_ONLY = SNES_NORM_INITIAL_ONLY * NORM_FINAL_ONLY = SNES_NORM_FINAL_ONLY # <<<<<<<<<<<<<< * NORM_INITIAL_FINAL_ONLY = SNES_NORM_INITIAL_FINAL_ONLY * # aliases */ __pyx_t_11 = __Pyx_PyInt_From_SNESNormSchedule(SNES_NORM_FINAL_ONLY); if (unlikely(!__pyx_t_11)) __PYX_ERR(50, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_NORM_FINAL_ONLY, __pyx_t_11) < 0) __PYX_ERR(50, 45, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/SNES.pyx":46 * NORM_INITIAL_ONLY = SNES_NORM_INITIAL_ONLY * NORM_FINAL_ONLY = SNES_NORM_FINAL_ONLY * NORM_INITIAL_FINAL_ONLY = SNES_NORM_INITIAL_FINAL_ONLY # <<<<<<<<<<<<<< * # aliases * DEFAULT = NORM_DEFAULT */ __pyx_t_11 = __Pyx_PyInt_From_SNESNormSchedule(SNES_NORM_INITIAL_FINAL_ONLY); if (unlikely(!__pyx_t_11)) __PYX_ERR(50, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_NORM_INITIAL_FINAL_ONLY, __pyx_t_11) < 0) __PYX_ERR(50, 46, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/SNES.pyx":48 * NORM_INITIAL_FINAL_ONLY = SNES_NORM_INITIAL_FINAL_ONLY * # aliases * DEFAULT = NORM_DEFAULT # <<<<<<<<<<<<<< * NONE = NORM_NONE * ALWAYS = NORM_ALWAYS */ __pyx_t_11 = PyObject_GetItem(__pyx_t_12, __pyx_n_s_NORM_DEFAULT); if (unlikely(!__pyx_t_11)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_NORM_DEFAULT); } if (unlikely(!__pyx_t_11)) __PYX_ERR(50, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DEFAULT, __pyx_t_11) < 0) __PYX_ERR(50, 48, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/SNES.pyx":49 * # aliases * DEFAULT = NORM_DEFAULT * NONE = NORM_NONE # <<<<<<<<<<<<<< * ALWAYS = NORM_ALWAYS * INITIAL_ONLY = NORM_INITIAL_ONLY */ __pyx_t_11 = PyObject_GetItem(__pyx_t_12, __pyx_n_s_NORM_NONE); if (unlikely(!__pyx_t_11)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_NORM_NONE); } if (unlikely(!__pyx_t_11)) __PYX_ERR(50, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_NONE, __pyx_t_11) < 0) __PYX_ERR(50, 49, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/SNES.pyx":50 * DEFAULT = NORM_DEFAULT * NONE = NORM_NONE * ALWAYS = NORM_ALWAYS # <<<<<<<<<<<<<< * INITIAL_ONLY = NORM_INITIAL_ONLY * FINAL_ONLY = NORM_FINAL_ONLY */ __pyx_t_11 = PyObject_GetItem(__pyx_t_12, __pyx_n_s_NORM_ALWAYS); if (unlikely(!__pyx_t_11)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_NORM_ALWAYS); } if (unlikely(!__pyx_t_11)) __PYX_ERR(50, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_ALWAYS, __pyx_t_11) < 0) __PYX_ERR(50, 50, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/SNES.pyx":51 * NONE = NORM_NONE * ALWAYS = NORM_ALWAYS * INITIAL_ONLY = NORM_INITIAL_ONLY # <<<<<<<<<<<<<< * FINAL_ONLY = NORM_FINAL_ONLY * INITIAL_FINAL_ONLY = NORM_INITIAL_FINAL_ONLY */ __pyx_t_11 = PyObject_GetItem(__pyx_t_12, __pyx_n_s_NORM_INITIAL_ONLY); if (unlikely(!__pyx_t_11)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_NORM_INITIAL_ONLY); } if (unlikely(!__pyx_t_11)) __PYX_ERR(50, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_INITIAL_ONLY, __pyx_t_11) < 0) __PYX_ERR(50, 51, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/SNES.pyx":52 * ALWAYS = NORM_ALWAYS * INITIAL_ONLY = NORM_INITIAL_ONLY * FINAL_ONLY = NORM_FINAL_ONLY # <<<<<<<<<<<<<< * INITIAL_FINAL_ONLY = NORM_INITIAL_FINAL_ONLY * */ __pyx_t_11 = PyObject_GetItem(__pyx_t_12, __pyx_n_s_NORM_FINAL_ONLY); if (unlikely(!__pyx_t_11)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_NORM_FINAL_ONLY); } if (unlikely(!__pyx_t_11)) __PYX_ERR(50, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_FINAL_ONLY, __pyx_t_11) < 0) __PYX_ERR(50, 52, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/SNES.pyx":53 * INITIAL_ONLY = NORM_INITIAL_ONLY * FINAL_ONLY = NORM_FINAL_ONLY * INITIAL_FINAL_ONLY = NORM_INITIAL_FINAL_ONLY # <<<<<<<<<<<<<< * * # FIXME Missing reference petsc.SNESConvergedReason */ __pyx_t_11 = PyObject_GetItem(__pyx_t_12, __pyx_n_s_NORM_INITIAL_FINAL_ONLY); if (unlikely(!__pyx_t_11)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_NORM_INITIAL_FINAL_ONLY); } if (unlikely(!__pyx_t_11)) __PYX_ERR(50, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_INITIAL_FINAL_ONLY, __pyx_t_11) < 0) __PYX_ERR(50, 53, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/SNES.pyx":32 * PATCH = S_(SNESPATCH) * * class SNESNormSchedule(object): # <<<<<<<<<<<<<< * """SNES norm schedule. * */ __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_SNESNormSchedule, __pyx_t_13, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(50, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_SNESNormSchedule, __pyx_t_11) < 0) __PYX_ERR(50, 32, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/SNES.pyx":56 * * # FIXME Missing reference petsc.SNESConvergedReason * class SNESConvergedReason(object): # <<<<<<<<<<<<<< * """SNES solver termination reason. * */ __pyx_t_13 = __Pyx_PEP560_update_bases(__pyx_tuple__195); if (unlikely(!__pyx_t_13)) __PYX_ERR(50, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(50, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_13, __pyx_n_s_SNESConvergedReason, __pyx_n_s_SNESConvergedReason, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, __pyx_kp_s_SNES_solver_termination_reason_S); if (unlikely(!__pyx_t_12)) __PYX_ERR(50, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_13 != __pyx_tuple__195) { if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_tuple__195) < 0))) __PYX_ERR(50, 56, __pyx_L1_error) } /* "petsc4py/PETSc/SNES.pyx":65 * """ * # iterating * CONVERGED_ITERATING = SNES_CONVERGED_ITERATING # <<<<<<<<<<<<<< * ITERATING = SNES_CONVERGED_ITERATING * # converged */ __pyx_t_11 = __Pyx_PyInt_From_SNESConvergedReason(SNES_CONVERGED_ITERATING); if (unlikely(!__pyx_t_11)) __PYX_ERR(50, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_CONVERGED_ITERATING, __pyx_t_11) < 0) __PYX_ERR(50, 65, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/SNES.pyx":66 * # iterating * CONVERGED_ITERATING = SNES_CONVERGED_ITERATING * ITERATING = SNES_CONVERGED_ITERATING # <<<<<<<<<<<<<< * # converged * CONVERGED_FNORM_ABS = SNES_CONVERGED_FNORM_ABS */ __pyx_t_11 = __Pyx_PyInt_From_SNESConvergedReason(SNES_CONVERGED_ITERATING); if (unlikely(!__pyx_t_11)) __PYX_ERR(50, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_ITERATING, __pyx_t_11) < 0) __PYX_ERR(50, 66, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/SNES.pyx":68 * ITERATING = SNES_CONVERGED_ITERATING * # converged * CONVERGED_FNORM_ABS = SNES_CONVERGED_FNORM_ABS # <<<<<<<<<<<<<< * CONVERGED_FNORM_RELATIVE = SNES_CONVERGED_FNORM_RELATIVE * CONVERGED_SNORM_RELATIVE = SNES_CONVERGED_SNORM_RELATIVE */ __pyx_t_11 = __Pyx_PyInt_From_SNESConvergedReason(SNES_CONVERGED_FNORM_ABS); if (unlikely(!__pyx_t_11)) __PYX_ERR(50, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_CONVERGED_FNORM_ABS, __pyx_t_11) < 0) __PYX_ERR(50, 68, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/SNES.pyx":69 * # converged * CONVERGED_FNORM_ABS = SNES_CONVERGED_FNORM_ABS * CONVERGED_FNORM_RELATIVE = SNES_CONVERGED_FNORM_RELATIVE # <<<<<<<<<<<<<< * CONVERGED_SNORM_RELATIVE = SNES_CONVERGED_SNORM_RELATIVE * CONVERGED_ITS = SNES_CONVERGED_ITS */ __pyx_t_11 = __Pyx_PyInt_From_SNESConvergedReason(SNES_CONVERGED_FNORM_RELATIVE); if (unlikely(!__pyx_t_11)) __PYX_ERR(50, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_CONVERGED_FNORM_RELATIVE, __pyx_t_11) < 0) __PYX_ERR(50, 69, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/SNES.pyx":70 * CONVERGED_FNORM_ABS = SNES_CONVERGED_FNORM_ABS * CONVERGED_FNORM_RELATIVE = SNES_CONVERGED_FNORM_RELATIVE * CONVERGED_SNORM_RELATIVE = SNES_CONVERGED_SNORM_RELATIVE # <<<<<<<<<<<<<< * CONVERGED_ITS = SNES_CONVERGED_ITS * # diverged */ __pyx_t_11 = __Pyx_PyInt_From_SNESConvergedReason(SNES_CONVERGED_SNORM_RELATIVE); if (unlikely(!__pyx_t_11)) __PYX_ERR(50, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_CONVERGED_SNORM_RELATIVE, __pyx_t_11) < 0) __PYX_ERR(50, 70, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/SNES.pyx":71 * CONVERGED_FNORM_RELATIVE = SNES_CONVERGED_FNORM_RELATIVE * CONVERGED_SNORM_RELATIVE = SNES_CONVERGED_SNORM_RELATIVE * CONVERGED_ITS = SNES_CONVERGED_ITS # <<<<<<<<<<<<<< * # diverged * DIVERGED_FUNCTION_DOMAIN = SNES_DIVERGED_FUNCTION_DOMAIN */ __pyx_t_11 = __Pyx_PyInt_From_SNESConvergedReason(SNES_CONVERGED_ITS); if (unlikely(!__pyx_t_11)) __PYX_ERR(50, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_CONVERGED_ITS, __pyx_t_11) < 0) __PYX_ERR(50, 71, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/SNES.pyx":73 * CONVERGED_ITS = SNES_CONVERGED_ITS * # diverged * DIVERGED_FUNCTION_DOMAIN = SNES_DIVERGED_FUNCTION_DOMAIN # <<<<<<<<<<<<<< * DIVERGED_FUNCTION_COUNT = SNES_DIVERGED_FUNCTION_COUNT * DIVERGED_LINEAR_SOLVE = SNES_DIVERGED_LINEAR_SOLVE */ __pyx_t_11 = __Pyx_PyInt_From_SNESConvergedReason(SNES_DIVERGED_FUNCTION_DOMAIN); if (unlikely(!__pyx_t_11)) __PYX_ERR(50, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DIVERGED_FUNCTION_DOMAIN, __pyx_t_11) < 0) __PYX_ERR(50, 73, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/SNES.pyx":74 * # diverged * DIVERGED_FUNCTION_DOMAIN = SNES_DIVERGED_FUNCTION_DOMAIN * DIVERGED_FUNCTION_COUNT = SNES_DIVERGED_FUNCTION_COUNT # <<<<<<<<<<<<<< * DIVERGED_LINEAR_SOLVE = SNES_DIVERGED_LINEAR_SOLVE * DIVERGED_FNORM_NAN = SNES_DIVERGED_FNORM_NAN */ __pyx_t_11 = __Pyx_PyInt_From_SNESConvergedReason(SNES_DIVERGED_FUNCTION_COUNT); if (unlikely(!__pyx_t_11)) __PYX_ERR(50, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DIVERGED_FUNCTION_COUNT, __pyx_t_11) < 0) __PYX_ERR(50, 74, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/SNES.pyx":75 * DIVERGED_FUNCTION_DOMAIN = SNES_DIVERGED_FUNCTION_DOMAIN * DIVERGED_FUNCTION_COUNT = SNES_DIVERGED_FUNCTION_COUNT * DIVERGED_LINEAR_SOLVE = SNES_DIVERGED_LINEAR_SOLVE # <<<<<<<<<<<<<< * DIVERGED_FNORM_NAN = SNES_DIVERGED_FNORM_NAN * DIVERGED_MAX_IT = SNES_DIVERGED_MAX_IT */ __pyx_t_11 = __Pyx_PyInt_From_SNESConvergedReason(SNES_DIVERGED_LINEAR_SOLVE); if (unlikely(!__pyx_t_11)) __PYX_ERR(50, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DIVERGED_LINEAR_SOLVE, __pyx_t_11) < 0) __PYX_ERR(50, 75, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/SNES.pyx":76 * DIVERGED_FUNCTION_COUNT = SNES_DIVERGED_FUNCTION_COUNT * DIVERGED_LINEAR_SOLVE = SNES_DIVERGED_LINEAR_SOLVE * DIVERGED_FNORM_NAN = SNES_DIVERGED_FNORM_NAN # <<<<<<<<<<<<<< * DIVERGED_MAX_IT = SNES_DIVERGED_MAX_IT * DIVERGED_LINE_SEARCH = SNES_DIVERGED_LINE_SEARCH */ __pyx_t_11 = __Pyx_PyInt_From_SNESConvergedReason(SNES_DIVERGED_FNORM_NAN); if (unlikely(!__pyx_t_11)) __PYX_ERR(50, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DIVERGED_FNORM_NAN, __pyx_t_11) < 0) __PYX_ERR(50, 76, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/SNES.pyx":77 * DIVERGED_LINEAR_SOLVE = SNES_DIVERGED_LINEAR_SOLVE * DIVERGED_FNORM_NAN = SNES_DIVERGED_FNORM_NAN * DIVERGED_MAX_IT = SNES_DIVERGED_MAX_IT # <<<<<<<<<<<<<< * DIVERGED_LINE_SEARCH = SNES_DIVERGED_LINE_SEARCH * DIVERGED_INNER = SNES_DIVERGED_INNER */ __pyx_t_11 = __Pyx_PyInt_From_SNESConvergedReason(SNES_DIVERGED_MAX_IT); if (unlikely(!__pyx_t_11)) __PYX_ERR(50, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DIVERGED_MAX_IT, __pyx_t_11) < 0) __PYX_ERR(50, 77, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/SNES.pyx":78 * DIVERGED_FNORM_NAN = SNES_DIVERGED_FNORM_NAN * DIVERGED_MAX_IT = SNES_DIVERGED_MAX_IT * DIVERGED_LINE_SEARCH = SNES_DIVERGED_LINE_SEARCH # <<<<<<<<<<<<<< * DIVERGED_INNER = SNES_DIVERGED_INNER * DIVERGED_LOCAL_MIN = SNES_DIVERGED_LOCAL_MIN */ __pyx_t_11 = __Pyx_PyInt_From_SNESConvergedReason(SNES_DIVERGED_LINE_SEARCH); if (unlikely(!__pyx_t_11)) __PYX_ERR(50, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DIVERGED_LINE_SEARCH, __pyx_t_11) < 0) __PYX_ERR(50, 78, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/SNES.pyx":79 * DIVERGED_MAX_IT = SNES_DIVERGED_MAX_IT * DIVERGED_LINE_SEARCH = SNES_DIVERGED_LINE_SEARCH * DIVERGED_INNER = SNES_DIVERGED_INNER # <<<<<<<<<<<<<< * DIVERGED_LOCAL_MIN = SNES_DIVERGED_LOCAL_MIN * DIVERGED_DTOL = SNES_DIVERGED_DTOL */ __pyx_t_11 = __Pyx_PyInt_From_SNESConvergedReason(SNES_DIVERGED_INNER); if (unlikely(!__pyx_t_11)) __PYX_ERR(50, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DIVERGED_INNER, __pyx_t_11) < 0) __PYX_ERR(50, 79, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/SNES.pyx":80 * DIVERGED_LINE_SEARCH = SNES_DIVERGED_LINE_SEARCH * DIVERGED_INNER = SNES_DIVERGED_INNER * DIVERGED_LOCAL_MIN = SNES_DIVERGED_LOCAL_MIN # <<<<<<<<<<<<<< * DIVERGED_DTOL = SNES_DIVERGED_DTOL * DIVERGED_JACOBIAN_DOMAIN = SNES_DIVERGED_JACOBIAN_DOMAIN */ __pyx_t_11 = __Pyx_PyInt_From_SNESConvergedReason(SNES_DIVERGED_LOCAL_MIN); if (unlikely(!__pyx_t_11)) __PYX_ERR(50, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DIVERGED_LOCAL_MIN, __pyx_t_11) < 0) __PYX_ERR(50, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/SNES.pyx":81 * DIVERGED_INNER = SNES_DIVERGED_INNER * DIVERGED_LOCAL_MIN = SNES_DIVERGED_LOCAL_MIN * DIVERGED_DTOL = SNES_DIVERGED_DTOL # <<<<<<<<<<<<<< * DIVERGED_JACOBIAN_DOMAIN = SNES_DIVERGED_JACOBIAN_DOMAIN * DIVERGED_TR_DELTA = SNES_DIVERGED_TR_DELTA */ __pyx_t_11 = __Pyx_PyInt_From_SNESConvergedReason(SNES_DIVERGED_DTOL); if (unlikely(!__pyx_t_11)) __PYX_ERR(50, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DIVERGED_DTOL, __pyx_t_11) < 0) __PYX_ERR(50, 81, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/SNES.pyx":82 * DIVERGED_LOCAL_MIN = SNES_DIVERGED_LOCAL_MIN * DIVERGED_DTOL = SNES_DIVERGED_DTOL * DIVERGED_JACOBIAN_DOMAIN = SNES_DIVERGED_JACOBIAN_DOMAIN # <<<<<<<<<<<<<< * DIVERGED_TR_DELTA = SNES_DIVERGED_TR_DELTA * */ __pyx_t_11 = __Pyx_PyInt_From_SNESConvergedReason(SNES_DIVERGED_JACOBIAN_DOMAIN); if (unlikely(!__pyx_t_11)) __PYX_ERR(50, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DIVERGED_JACOBIAN_DOMAIN, __pyx_t_11) < 0) __PYX_ERR(50, 82, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/SNES.pyx":83 * DIVERGED_DTOL = SNES_DIVERGED_DTOL * DIVERGED_JACOBIAN_DOMAIN = SNES_DIVERGED_JACOBIAN_DOMAIN * DIVERGED_TR_DELTA = SNES_DIVERGED_TR_DELTA # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_t_11 = __Pyx_PyInt_From_SNESConvergedReason(SNES_DIVERGED_TR_DELTA); if (unlikely(!__pyx_t_11)) __PYX_ERR(50, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DIVERGED_TR_DELTA, __pyx_t_11) < 0) __PYX_ERR(50, 83, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/SNES.pyx":56 * * # FIXME Missing reference petsc.SNESConvergedReason * class SNESConvergedReason(object): # <<<<<<<<<<<<<< * """SNES solver termination reason. * */ __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_SNESConvergedReason, __pyx_t_13, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(50, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_SNESConvergedReason, __pyx_t_11) < 0) __PYX_ERR(50, 56, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/SNES.pyx":98 * """ * * Type = SNESType # <<<<<<<<<<<<<< * NormSchedule = SNESNormSchedule * ConvergedReason = SNESConvergedReason */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_SNESType); if (unlikely(!__pyx_t_13)) __PYX_ERR(50, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_n_s_Type, __pyx_t_13) < 0) __PYX_ERR(50, 98, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_SNES); /* "petsc4py/PETSc/SNES.pyx":99 * * Type = SNESType * NormSchedule = SNESNormSchedule # <<<<<<<<<<<<<< * ConvergedReason = SNESConvergedReason * */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_SNESNormSchedule); if (unlikely(!__pyx_t_13)) __PYX_ERR(50, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_n_s_NormSchedule, __pyx_t_13) < 0) __PYX_ERR(50, 99, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_SNES); /* "petsc4py/PETSc/SNES.pyx":100 * Type = SNESType * NormSchedule = SNESNormSchedule * ConvergedReason = SNESConvergedReason # <<<<<<<<<<<<<< * * # --- xxx --- */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_SNESConvergedReason); if (unlikely(!__pyx_t_13)) __PYX_ERR(50, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_n_s_ConvergedReason, __pyx_t_13) < 0) __PYX_ERR(50, 100, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_SNES); /* "petsc4py/PETSc/SNES.pyx":271 * * # backward compatibility * setAppCtx = setApplicationContext # <<<<<<<<<<<<<< * getAppCtx = getApplicationContext * */ __Pyx_GetNameInClass(__pyx_t_13, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_n_s_setApplicationContext); if (unlikely(!__pyx_t_13)) __PYX_ERR(50, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_n_s_setAppCtx, __pyx_t_13) < 0) __PYX_ERR(50, 271, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_SNES); /* "petsc4py/PETSc/SNES.pyx":272 * # backward compatibility * setAppCtx = setApplicationContext * getAppCtx = getApplicationContext # <<<<<<<<<<<<<< * * # --- discretization space --- */ __Pyx_GetNameInClass(__pyx_t_13, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_n_s_getApplicationContext); if (unlikely(!__pyx_t_13)) __PYX_ERR(50, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_n_s_getAppCtx, __pyx_t_13) < 0) __PYX_ERR(50, 272, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_SNES); /* "petsc4py/PETSc/SNES.pyx":1335 * self.set_attr('__monitor__', None) * * cancelMonitor = monitorCancel # <<<<<<<<<<<<<< * * def monitor(self, its, rnorm) -> None: */ __Pyx_GetNameInClass(__pyx_t_13, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_n_s_monitorCancel); if (unlikely(!__pyx_t_13)) __PYX_ERR(50, 1335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_n_s_cancelMonitor, __pyx_t_13) < 0) __PYX_ERR(50, 1335, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_SNES); /* "petsc4py/PETSc/SNES.pyx":1487 * return toInt(ival) * * setMaxNonlinearStepFailures = setMaxStepFailures # <<<<<<<<<<<<<< * getMaxNonlinearStepFailures = getMaxStepFailures * getNonlinearStepFailures = getStepFailures */ __Pyx_GetNameInClass(__pyx_t_13, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_n_s_setMaxStepFailures); if (unlikely(!__pyx_t_13)) __PYX_ERR(50, 1487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_n_s_setMaxNonlinearStepFailures, __pyx_t_13) < 0) __PYX_ERR(50, 1487, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_SNES); /* "petsc4py/PETSc/SNES.pyx":1488 * * setMaxNonlinearStepFailures = setMaxStepFailures * getMaxNonlinearStepFailures = getMaxStepFailures # <<<<<<<<<<<<<< * getNonlinearStepFailures = getStepFailures * setMaxLinearSolveFailures = setMaxKSPFailures */ __Pyx_GetNameInClass(__pyx_t_13, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_n_s_getMaxStepFailures); if (unlikely(!__pyx_t_13)) __PYX_ERR(50, 1488, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_n_s_getMaxNonlinearStepFailures, __pyx_t_13) < 0) __PYX_ERR(50, 1488, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_SNES); /* "petsc4py/PETSc/SNES.pyx":1489 * setMaxNonlinearStepFailures = setMaxStepFailures * getMaxNonlinearStepFailures = getMaxStepFailures * getNonlinearStepFailures = getStepFailures # <<<<<<<<<<<<<< * setMaxLinearSolveFailures = setMaxKSPFailures * getMaxLinearSolveFailures = getMaxKSPFailures */ __Pyx_GetNameInClass(__pyx_t_13, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_n_s_getStepFailures); if (unlikely(!__pyx_t_13)) __PYX_ERR(50, 1489, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_n_s_getNonlinearStepFailures, __pyx_t_13) < 0) __PYX_ERR(50, 1489, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_SNES); /* "petsc4py/PETSc/SNES.pyx":1490 * getMaxNonlinearStepFailures = getMaxStepFailures * getNonlinearStepFailures = getStepFailures * setMaxLinearSolveFailures = setMaxKSPFailures # <<<<<<<<<<<<<< * getMaxLinearSolveFailures = getMaxKSPFailures * getLinearSolveFailures = getKSPFailures */ __Pyx_GetNameInClass(__pyx_t_13, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_n_s_setMaxKSPFailures); if (unlikely(!__pyx_t_13)) __PYX_ERR(50, 1490, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_n_s_setMaxLinearSolveFailures, __pyx_t_13) < 0) __PYX_ERR(50, 1490, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_SNES); /* "petsc4py/PETSc/SNES.pyx":1491 * getNonlinearStepFailures = getStepFailures * setMaxLinearSolveFailures = setMaxKSPFailures * getMaxLinearSolveFailures = getMaxKSPFailures # <<<<<<<<<<<<<< * getLinearSolveFailures = getKSPFailures * */ __Pyx_GetNameInClass(__pyx_t_13, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_n_s_getMaxKSPFailures); if (unlikely(!__pyx_t_13)) __PYX_ERR(50, 1491, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_n_s_getMaxLinearSolveFailures, __pyx_t_13) < 0) __PYX_ERR(50, 1491, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_SNES); /* "petsc4py/PETSc/SNES.pyx":1492 * setMaxLinearSolveFailures = setMaxKSPFailures * getMaxLinearSolveFailures = getMaxKSPFailures * getLinearSolveFailures = getKSPFailures # <<<<<<<<<<<<<< * * # --- solving --- */ __Pyx_GetNameInClass(__pyx_t_13, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_n_s_getKSPFailures); if (unlikely(!__pyx_t_13)) __PYX_ERR(50, 1492, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_n_s_getLinearSolveFailures, __pyx_t_13) < 0) __PYX_ERR(50, 1492, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_SNES); /* "petsc4py/PETSc/SNES.pyx":2368 * # -------------------------------------------------------------------- * * del SNESType # <<<<<<<<<<<<<< * del SNESNormSchedule * del SNESConvergedReason */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_SNESType) < 0) __PYX_ERR(50, 2368, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":2369 * * del SNESType * del SNESNormSchedule # <<<<<<<<<<<<<< * del SNESConvergedReason * */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_SNESNormSchedule) < 0) __PYX_ERR(50, 2369, __pyx_L1_error) /* "petsc4py/PETSc/SNES.pyx":2370 * del SNESType * del SNESNormSchedule * del SNESConvergedReason # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_SNESConvergedReason) < 0) __PYX_ERR(50, 2370, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":3 * # ----------------------------------------------------------------------------- * * class TSType(object): # <<<<<<<<<<<<<< * """The time stepping method.""" * # native */ __pyx_t_13 = __Pyx_PEP560_update_bases(__pyx_tuple__197); if (unlikely(!__pyx_t_13)) __PYX_ERR(51, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(51, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_13, __pyx_n_s_TSType, __pyx_n_s_TSType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, __pyx_kp_s_The_time_stepping_method); if (unlikely(!__pyx_t_12)) __PYX_ERR(51, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_13 != __pyx_tuple__197) { if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_tuple__197) < 0))) __PYX_ERR(51, 3, __pyx_L1_error) } /* "petsc4py/PETSc/TS.pyx":6 * """The time stepping method.""" * # native * EULER = S_(TSEULER) # <<<<<<<<<<<<<< * BEULER = S_(TSBEULER) * BASICSYMPLECTIC = S_(TSBASICSYMPLECTIC) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(TSEULER); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_EULER, __pyx_t_11) < 0) __PYX_ERR(51, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":7 * # native * EULER = S_(TSEULER) * BEULER = S_(TSBEULER) # <<<<<<<<<<<<<< * BASICSYMPLECTIC = S_(TSBASICSYMPLECTIC) * PSEUDO = S_(TSPSEUDO) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(TSBEULER); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_BEULER, __pyx_t_11) < 0) __PYX_ERR(51, 7, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":8 * EULER = S_(TSEULER) * BEULER = S_(TSBEULER) * BASICSYMPLECTIC = S_(TSBASICSYMPLECTIC) # <<<<<<<<<<<<<< * PSEUDO = S_(TSPSEUDO) * CN = S_(TSCN) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(TSBASICSYMPLECTIC); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_BASICSYMPLECTIC, __pyx_t_11) < 0) __PYX_ERR(51, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":9 * BEULER = S_(TSBEULER) * BASICSYMPLECTIC = S_(TSBASICSYMPLECTIC) * PSEUDO = S_(TSPSEUDO) # <<<<<<<<<<<<<< * CN = S_(TSCN) * SUNDIALS = S_(TSSUNDIALS) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(TSPSEUDO); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_PSEUDO, __pyx_t_11) < 0) __PYX_ERR(51, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":10 * BASICSYMPLECTIC = S_(TSBASICSYMPLECTIC) * PSEUDO = S_(TSPSEUDO) * CN = S_(TSCN) # <<<<<<<<<<<<<< * SUNDIALS = S_(TSSUNDIALS) * RK = S_(TSRK) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(TSCN); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_CN, __pyx_t_11) < 0) __PYX_ERR(51, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":11 * PSEUDO = S_(TSPSEUDO) * CN = S_(TSCN) * SUNDIALS = S_(TSSUNDIALS) # <<<<<<<<<<<<<< * RK = S_(TSRK) * PYTHON = S_(TSPYTHON) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(TSSUNDIALS); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SUNDIALS, __pyx_t_11) < 0) __PYX_ERR(51, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":12 * CN = S_(TSCN) * SUNDIALS = S_(TSSUNDIALS) * RK = S_(TSRK) # <<<<<<<<<<<<<< * PYTHON = S_(TSPYTHON) * THETA = S_(TSTHETA) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(TSRK); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_RK, __pyx_t_11) < 0) __PYX_ERR(51, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":13 * SUNDIALS = S_(TSSUNDIALS) * RK = S_(TSRK) * PYTHON = S_(TSPYTHON) # <<<<<<<<<<<<<< * THETA = S_(TSTHETA) * ALPHA = S_(TSALPHA) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(TSPYTHON); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_PYTHON, __pyx_t_11) < 0) __PYX_ERR(51, 13, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":14 * RK = S_(TSRK) * PYTHON = S_(TSPYTHON) * THETA = S_(TSTHETA) # <<<<<<<<<<<<<< * ALPHA = S_(TSALPHA) * ALPHA2 = S_(TSALPHA2) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(TSTHETA); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_THETA, __pyx_t_11) < 0) __PYX_ERR(51, 14, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":15 * PYTHON = S_(TSPYTHON) * THETA = S_(TSTHETA) * ALPHA = S_(TSALPHA) # <<<<<<<<<<<<<< * ALPHA2 = S_(TSALPHA2) * GLLE = S_(TSGLLE) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(TSALPHA); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_ALPHA, __pyx_t_11) < 0) __PYX_ERR(51, 15, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":16 * THETA = S_(TSTHETA) * ALPHA = S_(TSALPHA) * ALPHA2 = S_(TSALPHA2) # <<<<<<<<<<<<<< * GLLE = S_(TSGLLE) * GLEE = S_(TSGLEE) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(TSALPHA2); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_ALPHA2, __pyx_t_11) < 0) __PYX_ERR(51, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":17 * ALPHA = S_(TSALPHA) * ALPHA2 = S_(TSALPHA2) * GLLE = S_(TSGLLE) # <<<<<<<<<<<<<< * GLEE = S_(TSGLEE) * SSP = S_(TSSSP) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(TSGLLE); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_GLLE, __pyx_t_11) < 0) __PYX_ERR(51, 17, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":18 * ALPHA2 = S_(TSALPHA2) * GLLE = S_(TSGLLE) * GLEE = S_(TSGLEE) # <<<<<<<<<<<<<< * SSP = S_(TSSSP) * ARKIMEX = S_(TSARKIMEX) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(TSGLEE); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_GLEE, __pyx_t_11) < 0) __PYX_ERR(51, 18, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":19 * GLLE = S_(TSGLLE) * GLEE = S_(TSGLEE) * SSP = S_(TSSSP) # <<<<<<<<<<<<<< * ARKIMEX = S_(TSARKIMEX) * DIRK = S_(TSDIRK) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(TSSSP); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SSP, __pyx_t_11) < 0) __PYX_ERR(51, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":20 * GLEE = S_(TSGLEE) * SSP = S_(TSSSP) * ARKIMEX = S_(TSARKIMEX) # <<<<<<<<<<<<<< * DIRK = S_(TSDIRK) * ROSW = S_(TSROSW) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(TSARKIMEX); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_ARKIMEX, __pyx_t_11) < 0) __PYX_ERR(51, 20, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":21 * SSP = S_(TSSSP) * ARKIMEX = S_(TSARKIMEX) * DIRK = S_(TSDIRK) # <<<<<<<<<<<<<< * ROSW = S_(TSROSW) * EIMEX = S_(TSEIMEX) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(TSDIRK); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DIRK, __pyx_t_11) < 0) __PYX_ERR(51, 21, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":22 * ARKIMEX = S_(TSARKIMEX) * DIRK = S_(TSDIRK) * ROSW = S_(TSROSW) # <<<<<<<<<<<<<< * EIMEX = S_(TSEIMEX) * MIMEX = S_(TSMIMEX) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(TSROSW); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_ROSW, __pyx_t_11) < 0) __PYX_ERR(51, 22, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":23 * DIRK = S_(TSDIRK) * ROSW = S_(TSROSW) * EIMEX = S_(TSEIMEX) # <<<<<<<<<<<<<< * MIMEX = S_(TSMIMEX) * BDF = S_(TSBDF) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(TSEIMEX); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_EIMEX, __pyx_t_11) < 0) __PYX_ERR(51, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":24 * ROSW = S_(TSROSW) * EIMEX = S_(TSEIMEX) * MIMEX = S_(TSMIMEX) # <<<<<<<<<<<<<< * BDF = S_(TSBDF) * RADAU5 = S_(TSRADAU5) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(TSMIMEX); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_MIMEX, __pyx_t_11) < 0) __PYX_ERR(51, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":25 * EIMEX = S_(TSEIMEX) * MIMEX = S_(TSMIMEX) * BDF = S_(TSBDF) # <<<<<<<<<<<<<< * RADAU5 = S_(TSRADAU5) * MPRK = S_(TSMPRK) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(TSBDF); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_BDF, __pyx_t_11) < 0) __PYX_ERR(51, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":26 * MIMEX = S_(TSMIMEX) * BDF = S_(TSBDF) * RADAU5 = S_(TSRADAU5) # <<<<<<<<<<<<<< * MPRK = S_(TSMPRK) * DISCGRAD = S_(TSDISCGRAD) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(TSRADAU5); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_RADAU5, __pyx_t_11) < 0) __PYX_ERR(51, 26, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":27 * BDF = S_(TSBDF) * RADAU5 = S_(TSRADAU5) * MPRK = S_(TSMPRK) # <<<<<<<<<<<<<< * DISCGRAD = S_(TSDISCGRAD) * # aliases */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(TSMPRK); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_MPRK, __pyx_t_11) < 0) __PYX_ERR(51, 27, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":28 * RADAU5 = S_(TSRADAU5) * MPRK = S_(TSMPRK) * DISCGRAD = S_(TSDISCGRAD) # <<<<<<<<<<<<<< * # aliases * FE = EULER */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(TSDISCGRAD); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DISCGRAD, __pyx_t_11) < 0) __PYX_ERR(51, 28, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":30 * DISCGRAD = S_(TSDISCGRAD) * # aliases * FE = EULER # <<<<<<<<<<<<<< * BE = BEULER * TH = THETA */ __pyx_t_11 = PyObject_GetItem(__pyx_t_12, __pyx_n_s_EULER); if (unlikely(!__pyx_t_11)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_EULER); } if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_FE, __pyx_t_11) < 0) __PYX_ERR(51, 30, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":31 * # aliases * FE = EULER * BE = BEULER # <<<<<<<<<<<<<< * TH = THETA * CRANK_NICOLSON = CN */ __pyx_t_11 = PyObject_GetItem(__pyx_t_12, __pyx_n_s_BEULER); if (unlikely(!__pyx_t_11)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_BEULER); } if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_BE, __pyx_t_11) < 0) __PYX_ERR(51, 31, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":32 * FE = EULER * BE = BEULER * TH = THETA # <<<<<<<<<<<<<< * CRANK_NICOLSON = CN * RUNGE_KUTTA = RK */ __pyx_t_11 = PyObject_GetItem(__pyx_t_12, __pyx_n_s_THETA); if (unlikely(!__pyx_t_11)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_THETA); } if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_TH, __pyx_t_11) < 0) __PYX_ERR(51, 32, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":33 * BE = BEULER * TH = THETA * CRANK_NICOLSON = CN # <<<<<<<<<<<<<< * RUNGE_KUTTA = RK * */ __pyx_t_11 = PyObject_GetItem(__pyx_t_12, __pyx_n_s_CN); if (unlikely(!__pyx_t_11)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_CN); } if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_CRANK_NICOLSON, __pyx_t_11) < 0) __PYX_ERR(51, 33, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":34 * TH = THETA * CRANK_NICOLSON = CN * RUNGE_KUTTA = RK # <<<<<<<<<<<<<< * * class TSRKType(object): */ __pyx_t_11 = PyObject_GetItem(__pyx_t_12, __pyx_n_s_RK); if (unlikely(!__pyx_t_11)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_RK); } if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_RUNGE_KUTTA, __pyx_t_11) < 0) __PYX_ERR(51, 34, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":3 * # ----------------------------------------------------------------------------- * * class TSType(object): # <<<<<<<<<<<<<< * """The time stepping method.""" * # native */ __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_TSType, __pyx_t_13, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_TSType, __pyx_t_11) < 0) __PYX_ERR(51, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/TS.pyx":36 * RUNGE_KUTTA = RK * * class TSRKType(object): # <<<<<<<<<<<<<< * """The *RK* subtype.""" * RK1FE = S_(TSRK1FE) */ __pyx_t_13 = __Pyx_PEP560_update_bases(__pyx_tuple__199); if (unlikely(!__pyx_t_13)) __PYX_ERR(51, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(51, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_13, __pyx_n_s_TSRKType, __pyx_n_s_TSRKType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, __pyx_kp_s_The_RK_subtype); if (unlikely(!__pyx_t_12)) __PYX_ERR(51, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_13 != __pyx_tuple__199) { if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_tuple__199) < 0))) __PYX_ERR(51, 36, __pyx_L1_error) } /* "petsc4py/PETSc/TS.pyx":38 * class TSRKType(object): * """The *RK* subtype.""" * RK1FE = S_(TSRK1FE) # <<<<<<<<<<<<<< * RK2A = S_(TSRK2A) * RK2B = S_(TSRK2B) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(TSRK1FE); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_RK1FE, __pyx_t_11) < 0) __PYX_ERR(51, 38, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":39 * """The *RK* subtype.""" * RK1FE = S_(TSRK1FE) * RK2A = S_(TSRK2A) # <<<<<<<<<<<<<< * RK2B = S_(TSRK2B) * RK4 = S_(TSRK4) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(TSRK2A); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_RK2A, __pyx_t_11) < 0) __PYX_ERR(51, 39, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":40 * RK1FE = S_(TSRK1FE) * RK2A = S_(TSRK2A) * RK2B = S_(TSRK2B) # <<<<<<<<<<<<<< * RK4 = S_(TSRK4) * RK3BS = S_(TSRK3BS) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(TSRK2B); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_RK2B, __pyx_t_11) < 0) __PYX_ERR(51, 40, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":41 * RK2A = S_(TSRK2A) * RK2B = S_(TSRK2B) * RK4 = S_(TSRK4) # <<<<<<<<<<<<<< * RK3BS = S_(TSRK3BS) * RK3 = S_(TSRK3) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(TSRK4); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_RK4, __pyx_t_11) < 0) __PYX_ERR(51, 41, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":42 * RK2B = S_(TSRK2B) * RK4 = S_(TSRK4) * RK3BS = S_(TSRK3BS) # <<<<<<<<<<<<<< * RK3 = S_(TSRK3) * RK5F = S_(TSRK5F) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(TSRK3BS); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_RK3BS, __pyx_t_11) < 0) __PYX_ERR(51, 42, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":43 * RK4 = S_(TSRK4) * RK3BS = S_(TSRK3BS) * RK3 = S_(TSRK3) # <<<<<<<<<<<<<< * RK5F = S_(TSRK5F) * RK5DP = S_(TSRK5DP) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(TSRK3); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_RK3, __pyx_t_11) < 0) __PYX_ERR(51, 43, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":44 * RK3BS = S_(TSRK3BS) * RK3 = S_(TSRK3) * RK5F = S_(TSRK5F) # <<<<<<<<<<<<<< * RK5DP = S_(TSRK5DP) * RK5BS = S_(TSRK5BS) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(TSRK5F); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_RK5F, __pyx_t_11) < 0) __PYX_ERR(51, 44, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":45 * RK3 = S_(TSRK3) * RK5F = S_(TSRK5F) * RK5DP = S_(TSRK5DP) # <<<<<<<<<<<<<< * RK5BS = S_(TSRK5BS) * RK6VR = S_(TSRK6VR) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(TSRK5DP); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_RK5DP, __pyx_t_11) < 0) __PYX_ERR(51, 45, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":46 * RK5F = S_(TSRK5F) * RK5DP = S_(TSRK5DP) * RK5BS = S_(TSRK5BS) # <<<<<<<<<<<<<< * RK6VR = S_(TSRK6VR) * RK7VR = S_(TSRK7VR) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(TSRK5BS); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_RK5BS, __pyx_t_11) < 0) __PYX_ERR(51, 46, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":47 * RK5DP = S_(TSRK5DP) * RK5BS = S_(TSRK5BS) * RK6VR = S_(TSRK6VR) # <<<<<<<<<<<<<< * RK7VR = S_(TSRK7VR) * RK8VR = S_(TSRK8VR) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(TSRK6VR); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_RK6VR, __pyx_t_11) < 0) __PYX_ERR(51, 47, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":48 * RK5BS = S_(TSRK5BS) * RK6VR = S_(TSRK6VR) * RK7VR = S_(TSRK7VR) # <<<<<<<<<<<<<< * RK8VR = S_(TSRK8VR) * */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(TSRK7VR); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_RK7VR, __pyx_t_11) < 0) __PYX_ERR(51, 48, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":49 * RK6VR = S_(TSRK6VR) * RK7VR = S_(TSRK7VR) * RK8VR = S_(TSRK8VR) # <<<<<<<<<<<<<< * * class TSARKIMEXType(object): */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(TSRK8VR); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_RK8VR, __pyx_t_11) < 0) __PYX_ERR(51, 49, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":36 * RUNGE_KUTTA = RK * * class TSRKType(object): # <<<<<<<<<<<<<< * """The *RK* subtype.""" * RK1FE = S_(TSRK1FE) */ __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_TSRKType, __pyx_t_13, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_TSRKType, __pyx_t_11) < 0) __PYX_ERR(51, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/TS.pyx":51 * RK8VR = S_(TSRK8VR) * * class TSARKIMEXType(object): # <<<<<<<<<<<<<< * """The *ARKIMEX* subtype.""" * ARKIMEX1BEE = S_(TSARKIMEX1BEE) */ __pyx_t_13 = __Pyx_PEP560_update_bases(__pyx_tuple__201); if (unlikely(!__pyx_t_13)) __PYX_ERR(51, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(51, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_13, __pyx_n_s_TSARKIMEXType, __pyx_n_s_TSARKIMEXType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, __pyx_kp_s_The_ARKIMEX_subtype); if (unlikely(!__pyx_t_12)) __PYX_ERR(51, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_13 != __pyx_tuple__201) { if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_tuple__201) < 0))) __PYX_ERR(51, 51, __pyx_L1_error) } /* "petsc4py/PETSc/TS.pyx":53 * class TSARKIMEXType(object): * """The *ARKIMEX* subtype.""" * ARKIMEX1BEE = S_(TSARKIMEX1BEE) # <<<<<<<<<<<<<< * ARKIMEXA2 = S_(TSARKIMEXA2) * ARKIMEXL2 = S_(TSARKIMEXL2) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(TSARKIMEX1BEE); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_ARKIMEX1BEE, __pyx_t_11) < 0) __PYX_ERR(51, 53, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":54 * """The *ARKIMEX* subtype.""" * ARKIMEX1BEE = S_(TSARKIMEX1BEE) * ARKIMEXA2 = S_(TSARKIMEXA2) # <<<<<<<<<<<<<< * ARKIMEXL2 = S_(TSARKIMEXL2) * ARKIMEXARS122 = S_(TSARKIMEXARS122) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(TSARKIMEXA2); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_ARKIMEXA2, __pyx_t_11) < 0) __PYX_ERR(51, 54, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":55 * ARKIMEX1BEE = S_(TSARKIMEX1BEE) * ARKIMEXA2 = S_(TSARKIMEXA2) * ARKIMEXL2 = S_(TSARKIMEXL2) # <<<<<<<<<<<<<< * ARKIMEXARS122 = S_(TSARKIMEXARS122) * ARKIMEX2C = S_(TSARKIMEX2C) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(TSARKIMEXL2); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_ARKIMEXL2, __pyx_t_11) < 0) __PYX_ERR(51, 55, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":56 * ARKIMEXA2 = S_(TSARKIMEXA2) * ARKIMEXL2 = S_(TSARKIMEXL2) * ARKIMEXARS122 = S_(TSARKIMEXARS122) # <<<<<<<<<<<<<< * ARKIMEX2C = S_(TSARKIMEX2C) * ARKIMEX2D = S_(TSARKIMEX2D) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(TSARKIMEXARS122); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_ARKIMEXARS122, __pyx_t_11) < 0) __PYX_ERR(51, 56, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":57 * ARKIMEXL2 = S_(TSARKIMEXL2) * ARKIMEXARS122 = S_(TSARKIMEXARS122) * ARKIMEX2C = S_(TSARKIMEX2C) # <<<<<<<<<<<<<< * ARKIMEX2D = S_(TSARKIMEX2D) * ARKIMEX2E = S_(TSARKIMEX2E) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(TSARKIMEX2C); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_ARKIMEX2C, __pyx_t_11) < 0) __PYX_ERR(51, 57, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":58 * ARKIMEXARS122 = S_(TSARKIMEXARS122) * ARKIMEX2C = S_(TSARKIMEX2C) * ARKIMEX2D = S_(TSARKIMEX2D) # <<<<<<<<<<<<<< * ARKIMEX2E = S_(TSARKIMEX2E) * ARKIMEXPRSSP2 = S_(TSARKIMEXPRSSP2) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(TSARKIMEX2D); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_ARKIMEX2D, __pyx_t_11) < 0) __PYX_ERR(51, 58, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":59 * ARKIMEX2C = S_(TSARKIMEX2C) * ARKIMEX2D = S_(TSARKIMEX2D) * ARKIMEX2E = S_(TSARKIMEX2E) # <<<<<<<<<<<<<< * ARKIMEXPRSSP2 = S_(TSARKIMEXPRSSP2) * ARKIMEX3 = S_(TSARKIMEX3) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(TSARKIMEX2E); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_ARKIMEX2E, __pyx_t_11) < 0) __PYX_ERR(51, 59, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":60 * ARKIMEX2D = S_(TSARKIMEX2D) * ARKIMEX2E = S_(TSARKIMEX2E) * ARKIMEXPRSSP2 = S_(TSARKIMEXPRSSP2) # <<<<<<<<<<<<<< * ARKIMEX3 = S_(TSARKIMEX3) * ARKIMEXBPR3 = S_(TSARKIMEXBPR3) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(TSARKIMEXPRSSP2); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_ARKIMEXPRSSP2, __pyx_t_11) < 0) __PYX_ERR(51, 60, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":61 * ARKIMEX2E = S_(TSARKIMEX2E) * ARKIMEXPRSSP2 = S_(TSARKIMEXPRSSP2) * ARKIMEX3 = S_(TSARKIMEX3) # <<<<<<<<<<<<<< * ARKIMEXBPR3 = S_(TSARKIMEXBPR3) * ARKIMEXARS443 = S_(TSARKIMEXARS443) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(TSARKIMEX3); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_ARKIMEX3, __pyx_t_11) < 0) __PYX_ERR(51, 61, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":62 * ARKIMEXPRSSP2 = S_(TSARKIMEXPRSSP2) * ARKIMEX3 = S_(TSARKIMEX3) * ARKIMEXBPR3 = S_(TSARKIMEXBPR3) # <<<<<<<<<<<<<< * ARKIMEXARS443 = S_(TSARKIMEXARS443) * ARKIMEX4 = S_(TSARKIMEX4) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(TSARKIMEXBPR3); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_ARKIMEXBPR3, __pyx_t_11) < 0) __PYX_ERR(51, 62, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":63 * ARKIMEX3 = S_(TSARKIMEX3) * ARKIMEXBPR3 = S_(TSARKIMEXBPR3) * ARKIMEXARS443 = S_(TSARKIMEXARS443) # <<<<<<<<<<<<<< * ARKIMEX4 = S_(TSARKIMEX4) * ARKIMEX5 = S_(TSARKIMEX5) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(TSARKIMEXARS443); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_ARKIMEXARS443, __pyx_t_11) < 0) __PYX_ERR(51, 63, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":64 * ARKIMEXBPR3 = S_(TSARKIMEXBPR3) * ARKIMEXARS443 = S_(TSARKIMEXARS443) * ARKIMEX4 = S_(TSARKIMEX4) # <<<<<<<<<<<<<< * ARKIMEX5 = S_(TSARKIMEX5) * */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(TSARKIMEX4); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_ARKIMEX4, __pyx_t_11) < 0) __PYX_ERR(51, 64, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":65 * ARKIMEXARS443 = S_(TSARKIMEXARS443) * ARKIMEX4 = S_(TSARKIMEX4) * ARKIMEX5 = S_(TSARKIMEX5) # <<<<<<<<<<<<<< * * class TSDIRKType(object): */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(TSARKIMEX5); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_ARKIMEX5, __pyx_t_11) < 0) __PYX_ERR(51, 65, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":51 * RK8VR = S_(TSRK8VR) * * class TSARKIMEXType(object): # <<<<<<<<<<<<<< * """The *ARKIMEX* subtype.""" * ARKIMEX1BEE = S_(TSARKIMEX1BEE) */ __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_TSARKIMEXType, __pyx_t_13, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_TSARKIMEXType, __pyx_t_11) < 0) __PYX_ERR(51, 51, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/TS.pyx":67 * ARKIMEX5 = S_(TSARKIMEX5) * * class TSDIRKType(object): # <<<<<<<<<<<<<< * """The *DIRK* subtype.""" * DIRKS212 = S_(TSDIRKS212) */ __pyx_t_13 = __Pyx_PEP560_update_bases(__pyx_tuple__203); if (unlikely(!__pyx_t_13)) __PYX_ERR(51, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(51, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_13, __pyx_n_s_TSDIRKType, __pyx_n_s_TSDIRKType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, __pyx_kp_s_The_DIRK_subtype); if (unlikely(!__pyx_t_12)) __PYX_ERR(51, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_13 != __pyx_tuple__203) { if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_tuple__203) < 0))) __PYX_ERR(51, 67, __pyx_L1_error) } /* "petsc4py/PETSc/TS.pyx":69 * class TSDIRKType(object): * """The *DIRK* subtype.""" * DIRKS212 = S_(TSDIRKS212) # <<<<<<<<<<<<<< * DIRKES122SAL = S_(TSDIRKES122SAL) * DIRKES213SAL = S_(TSDIRKES213SAL) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(TSDIRKS212); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DIRKS212, __pyx_t_11) < 0) __PYX_ERR(51, 69, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":70 * """The *DIRK* subtype.""" * DIRKS212 = S_(TSDIRKS212) * DIRKES122SAL = S_(TSDIRKES122SAL) # <<<<<<<<<<<<<< * DIRKES213SAL = S_(TSDIRKES213SAL) * DIRKES324SAL = S_(TSDIRKES324SAL) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(TSDIRKES122SAL); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DIRKES122SAL, __pyx_t_11) < 0) __PYX_ERR(51, 70, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":71 * DIRKS212 = S_(TSDIRKS212) * DIRKES122SAL = S_(TSDIRKES122SAL) * DIRKES213SAL = S_(TSDIRKES213SAL) # <<<<<<<<<<<<<< * DIRKES324SAL = S_(TSDIRKES324SAL) * DIRKES325SAL = S_(TSDIRKES325SAL) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(TSDIRKES213SAL); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DIRKES213SAL, __pyx_t_11) < 0) __PYX_ERR(51, 71, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":72 * DIRKES122SAL = S_(TSDIRKES122SAL) * DIRKES213SAL = S_(TSDIRKES213SAL) * DIRKES324SAL = S_(TSDIRKES324SAL) # <<<<<<<<<<<<<< * DIRKES325SAL = S_(TSDIRKES325SAL) * DIRK657A = S_(TSDIRK657A) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(TSDIRKES324SAL); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DIRKES324SAL, __pyx_t_11) < 0) __PYX_ERR(51, 72, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":73 * DIRKES213SAL = S_(TSDIRKES213SAL) * DIRKES324SAL = S_(TSDIRKES324SAL) * DIRKES325SAL = S_(TSDIRKES325SAL) # <<<<<<<<<<<<<< * DIRK657A = S_(TSDIRK657A) * DIRKES648SA = S_(TSDIRKES648SA) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(TSDIRKES325SAL); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DIRKES325SAL, __pyx_t_11) < 0) __PYX_ERR(51, 73, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":74 * DIRKES324SAL = S_(TSDIRKES324SAL) * DIRKES325SAL = S_(TSDIRKES325SAL) * DIRK657A = S_(TSDIRK657A) # <<<<<<<<<<<<<< * DIRKES648SA = S_(TSDIRKES648SA) * DIRK658A = S_(TSDIRK658A) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(TSDIRK657A); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DIRK657A, __pyx_t_11) < 0) __PYX_ERR(51, 74, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":75 * DIRKES325SAL = S_(TSDIRKES325SAL) * DIRK657A = S_(TSDIRK657A) * DIRKES648SA = S_(TSDIRKES648SA) # <<<<<<<<<<<<<< * DIRK658A = S_(TSDIRK658A) * DIRKS659A = S_(TSDIRKS659A) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(TSDIRKES648SA); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DIRKES648SA, __pyx_t_11) < 0) __PYX_ERR(51, 75, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":76 * DIRK657A = S_(TSDIRK657A) * DIRKES648SA = S_(TSDIRKES648SA) * DIRK658A = S_(TSDIRK658A) # <<<<<<<<<<<<<< * DIRKS659A = S_(TSDIRKS659A) * DIRK7510SAL = S_(TSDIRK7510SAL) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(TSDIRK658A); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DIRK658A, __pyx_t_11) < 0) __PYX_ERR(51, 76, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":77 * DIRKES648SA = S_(TSDIRKES648SA) * DIRK658A = S_(TSDIRK658A) * DIRKS659A = S_(TSDIRKS659A) # <<<<<<<<<<<<<< * DIRK7510SAL = S_(TSDIRK7510SAL) * DIRKES7510SA = S_(TSDIRKES7510SA) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(TSDIRKS659A); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DIRKS659A, __pyx_t_11) < 0) __PYX_ERR(51, 77, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":78 * DIRK658A = S_(TSDIRK658A) * DIRKS659A = S_(TSDIRKS659A) * DIRK7510SAL = S_(TSDIRK7510SAL) # <<<<<<<<<<<<<< * DIRKES7510SA = S_(TSDIRKES7510SA) * DIRK759A = S_(TSDIRK759A) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(TSDIRK7510SAL); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DIRK7510SAL, __pyx_t_11) < 0) __PYX_ERR(51, 78, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":79 * DIRKS659A = S_(TSDIRKS659A) * DIRK7510SAL = S_(TSDIRK7510SAL) * DIRKES7510SA = S_(TSDIRKES7510SA) # <<<<<<<<<<<<<< * DIRK759A = S_(TSDIRK759A) * DIRKS7511SAL = S_(TSDIRKS7511SAL) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(TSDIRKES7510SA); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DIRKES7510SA, __pyx_t_11) < 0) __PYX_ERR(51, 79, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":80 * DIRK7510SAL = S_(TSDIRK7510SAL) * DIRKES7510SA = S_(TSDIRKES7510SA) * DIRK759A = S_(TSDIRK759A) # <<<<<<<<<<<<<< * DIRKS7511SAL = S_(TSDIRKS7511SAL) * DIRK8614A = S_(TSDIRK8614A) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(TSDIRK759A); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DIRK759A, __pyx_t_11) < 0) __PYX_ERR(51, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":81 * DIRKES7510SA = S_(TSDIRKES7510SA) * DIRK759A = S_(TSDIRK759A) * DIRKS7511SAL = S_(TSDIRKS7511SAL) # <<<<<<<<<<<<<< * DIRK8614A = S_(TSDIRK8614A) * DIRK8616SAL = S_(TSDIRK8616SAL) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(TSDIRKS7511SAL); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DIRKS7511SAL, __pyx_t_11) < 0) __PYX_ERR(51, 81, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":82 * DIRK759A = S_(TSDIRK759A) * DIRKS7511SAL = S_(TSDIRKS7511SAL) * DIRK8614A = S_(TSDIRK8614A) # <<<<<<<<<<<<<< * DIRK8616SAL = S_(TSDIRK8616SAL) * DIRKES8516SAL = S_(TSDIRKES8516SAL) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(TSDIRK8614A); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DIRK8614A, __pyx_t_11) < 0) __PYX_ERR(51, 82, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":83 * DIRKS7511SAL = S_(TSDIRKS7511SAL) * DIRK8614A = S_(TSDIRK8614A) * DIRK8616SAL = S_(TSDIRK8616SAL) # <<<<<<<<<<<<<< * DIRKES8516SAL = S_(TSDIRKES8516SAL) * */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(TSDIRK8616SAL); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DIRK8616SAL, __pyx_t_11) < 0) __PYX_ERR(51, 83, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":84 * DIRK8614A = S_(TSDIRK8614A) * DIRK8616SAL = S_(TSDIRK8616SAL) * DIRKES8516SAL = S_(TSDIRKES8516SAL) # <<<<<<<<<<<<<< * * class TSProblemType(object): */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(TSDIRKES8516SAL); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DIRKES8516SAL, __pyx_t_11) < 0) __PYX_ERR(51, 84, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":67 * ARKIMEX5 = S_(TSARKIMEX5) * * class TSDIRKType(object): # <<<<<<<<<<<<<< * """The *DIRK* subtype.""" * DIRKS212 = S_(TSDIRKS212) */ __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_TSDIRKType, __pyx_t_13, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_TSDIRKType, __pyx_t_11) < 0) __PYX_ERR(51, 67, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/TS.pyx":86 * DIRKES8516SAL = S_(TSDIRKES8516SAL) * * class TSProblemType(object): # <<<<<<<<<<<<<< * """Distinguishes linear and nonlinear problems.""" * LINEAR = TS_LINEAR */ __pyx_t_13 = __Pyx_PEP560_update_bases(__pyx_tuple__205); if (unlikely(!__pyx_t_13)) __PYX_ERR(51, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(51, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_13, __pyx_n_s_TSProblemType, __pyx_n_s_TSProblemType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, __pyx_kp_s_Distinguishes_linear_and_nonline); if (unlikely(!__pyx_t_12)) __PYX_ERR(51, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_13 != __pyx_tuple__205) { if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_tuple__205) < 0))) __PYX_ERR(51, 86, __pyx_L1_error) } /* "petsc4py/PETSc/TS.pyx":88 * class TSProblemType(object): * """Distinguishes linear and nonlinear problems.""" * LINEAR = TS_LINEAR # <<<<<<<<<<<<<< * NONLINEAR = TS_NONLINEAR * */ __pyx_t_11 = __Pyx_PyInt_From_TSProblemType(TS_LINEAR); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_LINEAR, __pyx_t_11) < 0) __PYX_ERR(51, 88, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":89 * """Distinguishes linear and nonlinear problems.""" * LINEAR = TS_LINEAR * NONLINEAR = TS_NONLINEAR # <<<<<<<<<<<<<< * * class TSEquationType(object): */ __pyx_t_11 = __Pyx_PyInt_From_TSProblemType(TS_NONLINEAR); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_NONLINEAR, __pyx_t_11) < 0) __PYX_ERR(51, 89, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":86 * DIRKES8516SAL = S_(TSDIRKES8516SAL) * * class TSProblemType(object): # <<<<<<<<<<<<<< * """Distinguishes linear and nonlinear problems.""" * LINEAR = TS_LINEAR */ __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_TSProblemType, __pyx_t_13, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_TSProblemType, __pyx_t_11) < 0) __PYX_ERR(51, 86, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/TS.pyx":91 * NONLINEAR = TS_NONLINEAR * * class TSEquationType(object): # <<<<<<<<<<<<<< * """Distinguishes among types of explicit and implicit equations.""" * UNSPECIFIED = TS_EQ_UNSPECIFIED */ __pyx_t_13 = __Pyx_PEP560_update_bases(__pyx_tuple__207); if (unlikely(!__pyx_t_13)) __PYX_ERR(51, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(51, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_13, __pyx_n_s_TSEquationType, __pyx_n_s_TSEquationType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, __pyx_kp_s_Distinguishes_among_types_of_exp); if (unlikely(!__pyx_t_12)) __PYX_ERR(51, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_13 != __pyx_tuple__207) { if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_tuple__207) < 0))) __PYX_ERR(51, 91, __pyx_L1_error) } /* "petsc4py/PETSc/TS.pyx":93 * class TSEquationType(object): * """Distinguishes among types of explicit and implicit equations.""" * UNSPECIFIED = TS_EQ_UNSPECIFIED # <<<<<<<<<<<<<< * EXPLICIT = TS_EQ_EXPLICIT * ODE_EXPLICIT = TS_EQ_ODE_EXPLICIT */ __pyx_t_11 = __Pyx_PyInt_From_TSEquationType(TS_EQ_UNSPECIFIED); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_UNSPECIFIED, __pyx_t_11) < 0) __PYX_ERR(51, 93, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":94 * """Distinguishes among types of explicit and implicit equations.""" * UNSPECIFIED = TS_EQ_UNSPECIFIED * EXPLICIT = TS_EQ_EXPLICIT # <<<<<<<<<<<<<< * ODE_EXPLICIT = TS_EQ_ODE_EXPLICIT * DAE_SEMI_EXPLICIT_INDEX1 = TS_EQ_DAE_SEMI_EXPLICIT_INDEX1 */ __pyx_t_11 = __Pyx_PyInt_From_TSEquationType(TS_EQ_EXPLICIT); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_EXPLICIT, __pyx_t_11) < 0) __PYX_ERR(51, 94, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":95 * UNSPECIFIED = TS_EQ_UNSPECIFIED * EXPLICIT = TS_EQ_EXPLICIT * ODE_EXPLICIT = TS_EQ_ODE_EXPLICIT # <<<<<<<<<<<<<< * DAE_SEMI_EXPLICIT_INDEX1 = TS_EQ_DAE_SEMI_EXPLICIT_INDEX1 * DAE_SEMI_EXPLICIT_INDEX2 = TS_EQ_DAE_SEMI_EXPLICIT_INDEX2 */ __pyx_t_11 = __Pyx_PyInt_From_TSEquationType(TS_EQ_ODE_EXPLICIT); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_ODE_EXPLICIT, __pyx_t_11) < 0) __PYX_ERR(51, 95, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":96 * EXPLICIT = TS_EQ_EXPLICIT * ODE_EXPLICIT = TS_EQ_ODE_EXPLICIT * DAE_SEMI_EXPLICIT_INDEX1 = TS_EQ_DAE_SEMI_EXPLICIT_INDEX1 # <<<<<<<<<<<<<< * DAE_SEMI_EXPLICIT_INDEX2 = TS_EQ_DAE_SEMI_EXPLICIT_INDEX2 * DAE_SEMI_EXPLICIT_INDEX3 = TS_EQ_DAE_SEMI_EXPLICIT_INDEX3 */ __pyx_t_11 = __Pyx_PyInt_From_TSEquationType(TS_EQ_DAE_SEMI_EXPLICIT_INDEX1); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DAE_SEMI_EXPLICIT_INDEX1, __pyx_t_11) < 0) __PYX_ERR(51, 96, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":97 * ODE_EXPLICIT = TS_EQ_ODE_EXPLICIT * DAE_SEMI_EXPLICIT_INDEX1 = TS_EQ_DAE_SEMI_EXPLICIT_INDEX1 * DAE_SEMI_EXPLICIT_INDEX2 = TS_EQ_DAE_SEMI_EXPLICIT_INDEX2 # <<<<<<<<<<<<<< * DAE_SEMI_EXPLICIT_INDEX3 = TS_EQ_DAE_SEMI_EXPLICIT_INDEX3 * DAE_SEMI_EXPLICIT_INDEXHI = TS_EQ_DAE_SEMI_EXPLICIT_INDEXHI */ __pyx_t_11 = __Pyx_PyInt_From_TSEquationType(TS_EQ_DAE_SEMI_EXPLICIT_INDEX2); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DAE_SEMI_EXPLICIT_INDEX2, __pyx_t_11) < 0) __PYX_ERR(51, 97, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":98 * DAE_SEMI_EXPLICIT_INDEX1 = TS_EQ_DAE_SEMI_EXPLICIT_INDEX1 * DAE_SEMI_EXPLICIT_INDEX2 = TS_EQ_DAE_SEMI_EXPLICIT_INDEX2 * DAE_SEMI_EXPLICIT_INDEX3 = TS_EQ_DAE_SEMI_EXPLICIT_INDEX3 # <<<<<<<<<<<<<< * DAE_SEMI_EXPLICIT_INDEXHI = TS_EQ_DAE_SEMI_EXPLICIT_INDEXHI * IMPLICIT = TS_EQ_IMPLICIT */ __pyx_t_11 = __Pyx_PyInt_From_TSEquationType(TS_EQ_DAE_SEMI_EXPLICIT_INDEX3); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DAE_SEMI_EXPLICIT_INDEX3, __pyx_t_11) < 0) __PYX_ERR(51, 98, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":99 * DAE_SEMI_EXPLICIT_INDEX2 = TS_EQ_DAE_SEMI_EXPLICIT_INDEX2 * DAE_SEMI_EXPLICIT_INDEX3 = TS_EQ_DAE_SEMI_EXPLICIT_INDEX3 * DAE_SEMI_EXPLICIT_INDEXHI = TS_EQ_DAE_SEMI_EXPLICIT_INDEXHI # <<<<<<<<<<<<<< * IMPLICIT = TS_EQ_IMPLICIT * ODE_IMPLICIT = TS_EQ_ODE_IMPLICIT */ __pyx_t_11 = __Pyx_PyInt_From_TSEquationType(TS_EQ_DAE_SEMI_EXPLICIT_INDEXHI); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DAE_SEMI_EXPLICIT_INDEXHI, __pyx_t_11) < 0) __PYX_ERR(51, 99, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":100 * DAE_SEMI_EXPLICIT_INDEX3 = TS_EQ_DAE_SEMI_EXPLICIT_INDEX3 * DAE_SEMI_EXPLICIT_INDEXHI = TS_EQ_DAE_SEMI_EXPLICIT_INDEXHI * IMPLICIT = TS_EQ_IMPLICIT # <<<<<<<<<<<<<< * ODE_IMPLICIT = TS_EQ_ODE_IMPLICIT * DAE_IMPLICIT_INDEX1 = TS_EQ_DAE_IMPLICIT_INDEX1 */ __pyx_t_11 = __Pyx_PyInt_From_TSEquationType(TS_EQ_IMPLICIT); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_IMPLICIT, __pyx_t_11) < 0) __PYX_ERR(51, 100, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":101 * DAE_SEMI_EXPLICIT_INDEXHI = TS_EQ_DAE_SEMI_EXPLICIT_INDEXHI * IMPLICIT = TS_EQ_IMPLICIT * ODE_IMPLICIT = TS_EQ_ODE_IMPLICIT # <<<<<<<<<<<<<< * DAE_IMPLICIT_INDEX1 = TS_EQ_DAE_IMPLICIT_INDEX1 * DAE_IMPLICIT_INDEX2 = TS_EQ_DAE_IMPLICIT_INDEX2 */ __pyx_t_11 = __Pyx_PyInt_From_TSEquationType(TS_EQ_ODE_IMPLICIT); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_ODE_IMPLICIT, __pyx_t_11) < 0) __PYX_ERR(51, 101, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":102 * IMPLICIT = TS_EQ_IMPLICIT * ODE_IMPLICIT = TS_EQ_ODE_IMPLICIT * DAE_IMPLICIT_INDEX1 = TS_EQ_DAE_IMPLICIT_INDEX1 # <<<<<<<<<<<<<< * DAE_IMPLICIT_INDEX2 = TS_EQ_DAE_IMPLICIT_INDEX2 * DAE_IMPLICIT_INDEX3 = TS_EQ_DAE_IMPLICIT_INDEX3 */ __pyx_t_11 = __Pyx_PyInt_From_TSEquationType(TS_EQ_DAE_IMPLICIT_INDEX1); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DAE_IMPLICIT_INDEX1, __pyx_t_11) < 0) __PYX_ERR(51, 102, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":103 * ODE_IMPLICIT = TS_EQ_ODE_IMPLICIT * DAE_IMPLICIT_INDEX1 = TS_EQ_DAE_IMPLICIT_INDEX1 * DAE_IMPLICIT_INDEX2 = TS_EQ_DAE_IMPLICIT_INDEX2 # <<<<<<<<<<<<<< * DAE_IMPLICIT_INDEX3 = TS_EQ_DAE_IMPLICIT_INDEX3 * DAE_IMPLICIT_INDEXHI = TS_EQ_DAE_IMPLICIT_INDEXHI */ __pyx_t_11 = __Pyx_PyInt_From_TSEquationType(TS_EQ_DAE_IMPLICIT_INDEX2); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DAE_IMPLICIT_INDEX2, __pyx_t_11) < 0) __PYX_ERR(51, 103, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":104 * DAE_IMPLICIT_INDEX1 = TS_EQ_DAE_IMPLICIT_INDEX1 * DAE_IMPLICIT_INDEX2 = TS_EQ_DAE_IMPLICIT_INDEX2 * DAE_IMPLICIT_INDEX3 = TS_EQ_DAE_IMPLICIT_INDEX3 # <<<<<<<<<<<<<< * DAE_IMPLICIT_INDEXHI = TS_EQ_DAE_IMPLICIT_INDEXHI * */ __pyx_t_11 = __Pyx_PyInt_From_TSEquationType(TS_EQ_DAE_IMPLICIT_INDEX3); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DAE_IMPLICIT_INDEX3, __pyx_t_11) < 0) __PYX_ERR(51, 104, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":105 * DAE_IMPLICIT_INDEX2 = TS_EQ_DAE_IMPLICIT_INDEX2 * DAE_IMPLICIT_INDEX3 = TS_EQ_DAE_IMPLICIT_INDEX3 * DAE_IMPLICIT_INDEXHI = TS_EQ_DAE_IMPLICIT_INDEXHI # <<<<<<<<<<<<<< * * class TSExactFinalTime(object): */ __pyx_t_11 = __Pyx_PyInt_From_TSEquationType(TS_EQ_DAE_IMPLICIT_INDEXHI); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DAE_IMPLICIT_INDEXHI, __pyx_t_11) < 0) __PYX_ERR(51, 105, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":91 * NONLINEAR = TS_NONLINEAR * * class TSEquationType(object): # <<<<<<<<<<<<<< * """Distinguishes among types of explicit and implicit equations.""" * UNSPECIFIED = TS_EQ_UNSPECIFIED */ __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_TSEquationType, __pyx_t_13, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_TSEquationType, __pyx_t_11) < 0) __PYX_ERR(51, 91, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/TS.pyx":107 * DAE_IMPLICIT_INDEXHI = TS_EQ_DAE_IMPLICIT_INDEXHI * * class TSExactFinalTime(object): # <<<<<<<<<<<<<< * """The method for ending time stepping.""" * UNSPECIFIED = TS_EXACTFINALTIME_UNSPECIFIED */ __pyx_t_13 = __Pyx_PEP560_update_bases(__pyx_tuple__209); if (unlikely(!__pyx_t_13)) __PYX_ERR(51, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(51, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_13, __pyx_n_s_TSExactFinalTime, __pyx_n_s_TSExactFinalTime, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, __pyx_kp_s_The_method_for_ending_time_stepp); if (unlikely(!__pyx_t_12)) __PYX_ERR(51, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_13 != __pyx_tuple__209) { if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_tuple__209) < 0))) __PYX_ERR(51, 107, __pyx_L1_error) } /* "petsc4py/PETSc/TS.pyx":109 * class TSExactFinalTime(object): * """The method for ending time stepping.""" * UNSPECIFIED = TS_EXACTFINALTIME_UNSPECIFIED # <<<<<<<<<<<<<< * STEPOVER = TS_EXACTFINALTIME_STEPOVER * INTERPOLATE = TS_EXACTFINALTIME_INTERPOLATE */ __pyx_t_11 = __Pyx_PyInt_From_TSExactFinalTimeOption(TS_EXACTFINALTIME_UNSPECIFIED); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_UNSPECIFIED, __pyx_t_11) < 0) __PYX_ERR(51, 109, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":110 * """The method for ending time stepping.""" * UNSPECIFIED = TS_EXACTFINALTIME_UNSPECIFIED * STEPOVER = TS_EXACTFINALTIME_STEPOVER # <<<<<<<<<<<<<< * INTERPOLATE = TS_EXACTFINALTIME_INTERPOLATE * MATCHSTEP = TS_EXACTFINALTIME_MATCHSTEP */ __pyx_t_11 = __Pyx_PyInt_From_TSExactFinalTimeOption(TS_EXACTFINALTIME_STEPOVER); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_STEPOVER, __pyx_t_11) < 0) __PYX_ERR(51, 110, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":111 * UNSPECIFIED = TS_EXACTFINALTIME_UNSPECIFIED * STEPOVER = TS_EXACTFINALTIME_STEPOVER * INTERPOLATE = TS_EXACTFINALTIME_INTERPOLATE # <<<<<<<<<<<<<< * MATCHSTEP = TS_EXACTFINALTIME_MATCHSTEP * */ __pyx_t_11 = __Pyx_PyInt_From_TSExactFinalTimeOption(TS_EXACTFINALTIME_INTERPOLATE); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_INTERPOLATE, __pyx_t_11) < 0) __PYX_ERR(51, 111, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":112 * STEPOVER = TS_EXACTFINALTIME_STEPOVER * INTERPOLATE = TS_EXACTFINALTIME_INTERPOLATE * MATCHSTEP = TS_EXACTFINALTIME_MATCHSTEP # <<<<<<<<<<<<<< * * class TSConvergedReason(object): */ __pyx_t_11 = __Pyx_PyInt_From_TSExactFinalTimeOption(TS_EXACTFINALTIME_MATCHSTEP); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_MATCHSTEP, __pyx_t_11) < 0) __PYX_ERR(51, 112, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":107 * DAE_IMPLICIT_INDEXHI = TS_EQ_DAE_IMPLICIT_INDEXHI * * class TSExactFinalTime(object): # <<<<<<<<<<<<<< * """The method for ending time stepping.""" * UNSPECIFIED = TS_EXACTFINALTIME_UNSPECIFIED */ __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_TSExactFinalTime, __pyx_t_13, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_TSExactFinalTime, __pyx_t_11) < 0) __PYX_ERR(51, 107, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/TS.pyx":114 * MATCHSTEP = TS_EXACTFINALTIME_MATCHSTEP * * class TSConvergedReason(object): # <<<<<<<<<<<<<< * """The reason the time step is converging.""" * # iterating */ __pyx_t_13 = __Pyx_PEP560_update_bases(__pyx_tuple__211); if (unlikely(!__pyx_t_13)) __PYX_ERR(51, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(51, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_13, __pyx_n_s_TSConvergedReason, __pyx_n_s_TSConvergedReason, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, __pyx_kp_s_The_reason_the_time_step_is_conv); if (unlikely(!__pyx_t_12)) __PYX_ERR(51, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_13 != __pyx_tuple__211) { if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_tuple__211) < 0))) __PYX_ERR(51, 114, __pyx_L1_error) } /* "petsc4py/PETSc/TS.pyx":117 * """The reason the time step is converging.""" * # iterating * CONVERGED_ITERATING = TS_CONVERGED_ITERATING # <<<<<<<<<<<<<< * ITERATING = TS_CONVERGED_ITERATING * # converged */ __pyx_t_11 = __Pyx_PyInt_From_TSConvergedReason(TS_CONVERGED_ITERATING); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_CONVERGED_ITERATING, __pyx_t_11) < 0) __PYX_ERR(51, 117, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":118 * # iterating * CONVERGED_ITERATING = TS_CONVERGED_ITERATING * ITERATING = TS_CONVERGED_ITERATING # <<<<<<<<<<<<<< * # converged * CONVERGED_TIME = TS_CONVERGED_TIME */ __pyx_t_11 = __Pyx_PyInt_From_TSConvergedReason(TS_CONVERGED_ITERATING); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_ITERATING, __pyx_t_11) < 0) __PYX_ERR(51, 118, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":120 * ITERATING = TS_CONVERGED_ITERATING * # converged * CONVERGED_TIME = TS_CONVERGED_TIME # <<<<<<<<<<<<<< * CONVERGED_ITS = TS_CONVERGED_ITS * CONVERGED_USER = TS_CONVERGED_USER */ __pyx_t_11 = __Pyx_PyInt_From_TSConvergedReason(TS_CONVERGED_TIME); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_CONVERGED_TIME, __pyx_t_11) < 0) __PYX_ERR(51, 120, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":121 * # converged * CONVERGED_TIME = TS_CONVERGED_TIME * CONVERGED_ITS = TS_CONVERGED_ITS # <<<<<<<<<<<<<< * CONVERGED_USER = TS_CONVERGED_USER * CONVERGED_EVENT = TS_CONVERGED_EVENT */ __pyx_t_11 = __Pyx_PyInt_From_TSConvergedReason(TS_CONVERGED_ITS); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_CONVERGED_ITS, __pyx_t_11) < 0) __PYX_ERR(51, 121, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":122 * CONVERGED_TIME = TS_CONVERGED_TIME * CONVERGED_ITS = TS_CONVERGED_ITS * CONVERGED_USER = TS_CONVERGED_USER # <<<<<<<<<<<<<< * CONVERGED_EVENT = TS_CONVERGED_EVENT * # diverged */ __pyx_t_11 = __Pyx_PyInt_From_TSConvergedReason(TS_CONVERGED_USER); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_CONVERGED_USER, __pyx_t_11) < 0) __PYX_ERR(51, 122, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":123 * CONVERGED_ITS = TS_CONVERGED_ITS * CONVERGED_USER = TS_CONVERGED_USER * CONVERGED_EVENT = TS_CONVERGED_EVENT # <<<<<<<<<<<<<< * # diverged * DIVERGED_NONLINEAR_SOLVE = TS_DIVERGED_NONLINEAR_SOLVE */ __pyx_t_11 = __Pyx_PyInt_From_TSConvergedReason(TS_CONVERGED_EVENT); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_CONVERGED_EVENT, __pyx_t_11) < 0) __PYX_ERR(51, 123, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":125 * CONVERGED_EVENT = TS_CONVERGED_EVENT * # diverged * DIVERGED_NONLINEAR_SOLVE = TS_DIVERGED_NONLINEAR_SOLVE # <<<<<<<<<<<<<< * DIVERGED_STEP_REJECTED = TS_DIVERGED_STEP_REJECTED * */ __pyx_t_11 = __Pyx_PyInt_From_TSConvergedReason(TS_DIVERGED_NONLINEAR_SOLVE); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DIVERGED_NONLINEAR_SOLVE, __pyx_t_11) < 0) __PYX_ERR(51, 125, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":126 * # diverged * DIVERGED_NONLINEAR_SOLVE = TS_DIVERGED_NONLINEAR_SOLVE * DIVERGED_STEP_REJECTED = TS_DIVERGED_STEP_REJECTED # <<<<<<<<<<<<<< * * # ----------------------------------------------------------------------------- */ __pyx_t_11 = __Pyx_PyInt_From_TSConvergedReason(TS_DIVERGED_STEP_REJECTED); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DIVERGED_STEP_REJECTED, __pyx_t_11) < 0) __PYX_ERR(51, 126, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/TS.pyx":114 * MATCHSTEP = TS_EXACTFINALTIME_MATCHSTEP * * class TSConvergedReason(object): # <<<<<<<<<<<<<< * """The reason the time step is converging.""" * # iterating */ __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_TSConvergedReason, __pyx_t_13, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(51, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_TSConvergedReason, __pyx_t_11) < 0) __PYX_ERR(51, 114, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/TS.pyx":140 * * """ * Type = TSType # <<<<<<<<<<<<<< * RKType = TSRKType * ARKIMEXType = TSARKIMEXType */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_TSType); if (unlikely(!__pyx_t_13)) __PYX_ERR(51, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_n_s_Type, __pyx_t_13) < 0) __PYX_ERR(51, 140, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_TS); /* "petsc4py/PETSc/TS.pyx":141 * """ * Type = TSType * RKType = TSRKType # <<<<<<<<<<<<<< * ARKIMEXType = TSARKIMEXType * DIRKType = TSDIRKType */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_TSRKType); if (unlikely(!__pyx_t_13)) __PYX_ERR(51, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_n_s_RKType, __pyx_t_13) < 0) __PYX_ERR(51, 141, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_TS); /* "petsc4py/PETSc/TS.pyx":142 * Type = TSType * RKType = TSRKType * ARKIMEXType = TSARKIMEXType # <<<<<<<<<<<<<< * DIRKType = TSDIRKType * ProblemType = TSProblemType */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_TSARKIMEXType); if (unlikely(!__pyx_t_13)) __PYX_ERR(51, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_n_s_ARKIMEXType, __pyx_t_13) < 0) __PYX_ERR(51, 142, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_TS); /* "petsc4py/PETSc/TS.pyx":143 * RKType = TSRKType * ARKIMEXType = TSARKIMEXType * DIRKType = TSDIRKType # <<<<<<<<<<<<<< * ProblemType = TSProblemType * EquationType = TSEquationType */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_TSDIRKType); if (unlikely(!__pyx_t_13)) __PYX_ERR(51, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_n_s_DIRKType, __pyx_t_13) < 0) __PYX_ERR(51, 143, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_TS); /* "petsc4py/PETSc/TS.pyx":144 * ARKIMEXType = TSARKIMEXType * DIRKType = TSDIRKType * ProblemType = TSProblemType # <<<<<<<<<<<<<< * EquationType = TSEquationType * ExactFinalTime = TSExactFinalTime */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_TSProblemType); if (unlikely(!__pyx_t_13)) __PYX_ERR(51, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_n_s_ProblemType, __pyx_t_13) < 0) __PYX_ERR(51, 144, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_TS); /* "petsc4py/PETSc/TS.pyx":145 * DIRKType = TSDIRKType * ProblemType = TSProblemType * EquationType = TSEquationType # <<<<<<<<<<<<<< * ExactFinalTime = TSExactFinalTime * ExactFinalTimeOption = TSExactFinalTime */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_TSEquationType); if (unlikely(!__pyx_t_13)) __PYX_ERR(51, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_n_s_EquationType, __pyx_t_13) < 0) __PYX_ERR(51, 145, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_TS); /* "petsc4py/PETSc/TS.pyx":146 * ProblemType = TSProblemType * EquationType = TSEquationType * ExactFinalTime = TSExactFinalTime # <<<<<<<<<<<<<< * ExactFinalTimeOption = TSExactFinalTime * ConvergedReason = TSConvergedReason */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_TSExactFinalTime); if (unlikely(!__pyx_t_13)) __PYX_ERR(51, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_n_s_ExactFinalTime, __pyx_t_13) < 0) __PYX_ERR(51, 146, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_TS); /* "petsc4py/PETSc/TS.pyx":147 * EquationType = TSEquationType * ExactFinalTime = TSExactFinalTime * ExactFinalTimeOption = TSExactFinalTime # <<<<<<<<<<<<<< * ConvergedReason = TSConvergedReason * */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_TSExactFinalTime); if (unlikely(!__pyx_t_13)) __PYX_ERR(51, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_n_s_ExactFinalTimeOption, __pyx_t_13) < 0) __PYX_ERR(51, 147, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_TS); /* "petsc4py/PETSc/TS.pyx":148 * ExactFinalTime = TSExactFinalTime * ExactFinalTimeOption = TSExactFinalTime * ConvergedReason = TSConvergedReason # <<<<<<<<<<<<<< * * # --- xxx --- */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_TSConvergedReason); if (unlikely(!__pyx_t_13)) __PYX_ERR(51, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_n_s_ConvergedReason, __pyx_t_13) < 0) __PYX_ERR(51, 148, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_TS); /* "petsc4py/PETSc/TS.pyx":1951 * CHKERR( TSMonitorCancel(self.ts) ) * * cancelMonitor = monitorCancel # <<<<<<<<<<<<<< * * def monitor(self, step: int, time: float, Vec u=None) -> None: */ __Pyx_GetNameInClass(__pyx_t_13, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_n_s_monitorCancel); if (unlikely(!__pyx_t_13)) __PYX_ERR(51, 1951, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_n_s_cancelMonitor, __pyx_t_13) < 0) __PYX_ERR(51, 1951, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_TS); /* "petsc4py/PETSc/TS.pyx":2965 * # ----------------------------------------------------------------------------- * * del TSType # <<<<<<<<<<<<<< * del TSRKType * del TSARKIMEXType */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_TSType) < 0) __PYX_ERR(51, 2965, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":2966 * * del TSType * del TSRKType # <<<<<<<<<<<<<< * del TSARKIMEXType * del TSDIRKType */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_TSRKType) < 0) __PYX_ERR(51, 2966, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":2967 * del TSType * del TSRKType * del TSARKIMEXType # <<<<<<<<<<<<<< * del TSDIRKType * del TSProblemType */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_TSARKIMEXType) < 0) __PYX_ERR(51, 2967, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":2968 * del TSRKType * del TSARKIMEXType * del TSDIRKType # <<<<<<<<<<<<<< * del TSProblemType * del TSEquationType */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_TSDIRKType) < 0) __PYX_ERR(51, 2968, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":2969 * del TSARKIMEXType * del TSDIRKType * del TSProblemType # <<<<<<<<<<<<<< * del TSEquationType * del TSExactFinalTime */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_TSProblemType) < 0) __PYX_ERR(51, 2969, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":2970 * del TSDIRKType * del TSProblemType * del TSEquationType # <<<<<<<<<<<<<< * del TSExactFinalTime * del TSConvergedReason */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_TSEquationType) < 0) __PYX_ERR(51, 2970, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":2971 * del TSProblemType * del TSEquationType * del TSExactFinalTime # <<<<<<<<<<<<<< * del TSConvergedReason * */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_TSExactFinalTime) < 0) __PYX_ERR(51, 2971, __pyx_L1_error) /* "petsc4py/PETSc/TS.pyx":2972 * del TSEquationType * del TSExactFinalTime * del TSConvergedReason # <<<<<<<<<<<<<< * * # ----------------------------------------------------------------------------- */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_TSConvergedReason) < 0) __PYX_ERR(51, 2972, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":3 * # -------------------------------------------------------------------- * * class TAOType: # <<<<<<<<<<<<<< * """TAO solver type. * */ __pyx_t_13 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_TAOType, __pyx_n_s_TAOType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, __pyx_kp_s_TAO_solver_type_See_Also_petsc_T); if (unlikely(!__pyx_t_13)) __PYX_ERR(52, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); /* "petsc4py/PETSc/TAO.pyx":11 * * """ * LMVM = S_(TAOLMVM) # <<<<<<<<<<<<<< * NLS = S_(TAONLS) * NTR = S_(TAONTR) */ __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_S_(TAOLMVM); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_LMVM, __pyx_t_10) < 0) __PYX_ERR(52, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":12 * """ * LMVM = S_(TAOLMVM) * NLS = S_(TAONLS) # <<<<<<<<<<<<<< * NTR = S_(TAONTR) * NTL = S_(TAONTL) */ __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_S_(TAONLS); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_NLS, __pyx_t_10) < 0) __PYX_ERR(52, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":13 * LMVM = S_(TAOLMVM) * NLS = S_(TAONLS) * NTR = S_(TAONTR) # <<<<<<<<<<<<<< * NTL = S_(TAONTL) * CG = S_(TAOCG) */ __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_S_(TAONTR); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_NTR, __pyx_t_10) < 0) __PYX_ERR(52, 13, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":14 * NLS = S_(TAONLS) * NTR = S_(TAONTR) * NTL = S_(TAONTL) # <<<<<<<<<<<<<< * CG = S_(TAOCG) * TRON = S_(TAOTRON) */ __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_S_(TAONTL); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_NTL, __pyx_t_10) < 0) __PYX_ERR(52, 14, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":15 * NTR = S_(TAONTR) * NTL = S_(TAONTL) * CG = S_(TAOCG) # <<<<<<<<<<<<<< * TRON = S_(TAOTRON) * OWLQN = S_(TAOOWLQN) */ __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_S_(TAOCG); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_CG, __pyx_t_10) < 0) __PYX_ERR(52, 15, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":16 * NTL = S_(TAONTL) * CG = S_(TAOCG) * TRON = S_(TAOTRON) # <<<<<<<<<<<<<< * OWLQN = S_(TAOOWLQN) * BMRM = S_(TAOBMRM) */ __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_S_(TAOTRON); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_TRON, __pyx_t_10) < 0) __PYX_ERR(52, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":17 * CG = S_(TAOCG) * TRON = S_(TAOTRON) * OWLQN = S_(TAOOWLQN) # <<<<<<<<<<<<<< * BMRM = S_(TAOBMRM) * BLMVM = S_(TAOBLMVM) */ __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_S_(TAOOWLQN); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_OWLQN, __pyx_t_10) < 0) __PYX_ERR(52, 17, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":18 * TRON = S_(TAOTRON) * OWLQN = S_(TAOOWLQN) * BMRM = S_(TAOBMRM) # <<<<<<<<<<<<<< * BLMVM = S_(TAOBLMVM) * BQNLS = S_(TAOBQNLS) */ __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_S_(TAOBMRM); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_BMRM, __pyx_t_10) < 0) __PYX_ERR(52, 18, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":19 * OWLQN = S_(TAOOWLQN) * BMRM = S_(TAOBMRM) * BLMVM = S_(TAOBLMVM) # <<<<<<<<<<<<<< * BQNLS = S_(TAOBQNLS) * BNCG = S_(TAOBNCG) */ __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_S_(TAOBLMVM); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_BLMVM, __pyx_t_10) < 0) __PYX_ERR(52, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":20 * BMRM = S_(TAOBMRM) * BLMVM = S_(TAOBLMVM) * BQNLS = S_(TAOBQNLS) # <<<<<<<<<<<<<< * BNCG = S_(TAOBNCG) * BNLS = S_(TAOBNLS) */ __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_S_(TAOBQNLS); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_BQNLS, __pyx_t_10) < 0) __PYX_ERR(52, 20, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":21 * BLMVM = S_(TAOBLMVM) * BQNLS = S_(TAOBQNLS) * BNCG = S_(TAOBNCG) # <<<<<<<<<<<<<< * BNLS = S_(TAOBNLS) * BNTR = S_(TAOBNTR) */ __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_S_(TAOBNCG); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_BNCG, __pyx_t_10) < 0) __PYX_ERR(52, 21, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":22 * BQNLS = S_(TAOBQNLS) * BNCG = S_(TAOBNCG) * BNLS = S_(TAOBNLS) # <<<<<<<<<<<<<< * BNTR = S_(TAOBNTR) * BNTL = S_(TAOBNTL) */ __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_S_(TAOBNLS); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_BNLS, __pyx_t_10) < 0) __PYX_ERR(52, 22, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":23 * BNCG = S_(TAOBNCG) * BNLS = S_(TAOBNLS) * BNTR = S_(TAOBNTR) # <<<<<<<<<<<<<< * BNTL = S_(TAOBNTL) * BQNKLS = S_(TAOBQNKLS) */ __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_S_(TAOBNTR); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_BNTR, __pyx_t_10) < 0) __PYX_ERR(52, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":24 * BNLS = S_(TAOBNLS) * BNTR = S_(TAOBNTR) * BNTL = S_(TAOBNTL) # <<<<<<<<<<<<<< * BQNKLS = S_(TAOBQNKLS) * BQNKTR = S_(TAOBQNKTR) */ __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_S_(TAOBNTL); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_BNTL, __pyx_t_10) < 0) __PYX_ERR(52, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":25 * BNTR = S_(TAOBNTR) * BNTL = S_(TAOBNTL) * BQNKLS = S_(TAOBQNKLS) # <<<<<<<<<<<<<< * BQNKTR = S_(TAOBQNKTR) * BQNKTL = S_(TAOBQNKTL) */ __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_S_(TAOBQNKLS); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_BQNKLS, __pyx_t_10) < 0) __PYX_ERR(52, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":26 * BNTL = S_(TAOBNTL) * BQNKLS = S_(TAOBQNKLS) * BQNKTR = S_(TAOBQNKTR) # <<<<<<<<<<<<<< * BQNKTL = S_(TAOBQNKTL) * BQPIP = S_(TAOBQPIP) */ __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_S_(TAOBQNKTR); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_BQNKTR, __pyx_t_10) < 0) __PYX_ERR(52, 26, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":27 * BQNKLS = S_(TAOBQNKLS) * BQNKTR = S_(TAOBQNKTR) * BQNKTL = S_(TAOBQNKTL) # <<<<<<<<<<<<<< * BQPIP = S_(TAOBQPIP) * GPCG = S_(TAOGPCG) */ __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_S_(TAOBQNKTL); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_BQNKTL, __pyx_t_10) < 0) __PYX_ERR(52, 27, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":28 * BQNKTR = S_(TAOBQNKTR) * BQNKTL = S_(TAOBQNKTL) * BQPIP = S_(TAOBQPIP) # <<<<<<<<<<<<<< * GPCG = S_(TAOGPCG) * NM = S_(TAONM) */ __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_S_(TAOBQPIP); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_BQPIP, __pyx_t_10) < 0) __PYX_ERR(52, 28, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":29 * BQNKTL = S_(TAOBQNKTL) * BQPIP = S_(TAOBQPIP) * GPCG = S_(TAOGPCG) # <<<<<<<<<<<<<< * NM = S_(TAONM) * POUNDERS = S_(TAOPOUNDERS) */ __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_S_(TAOGPCG); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_GPCG, __pyx_t_10) < 0) __PYX_ERR(52, 29, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":30 * BQPIP = S_(TAOBQPIP) * GPCG = S_(TAOGPCG) * NM = S_(TAONM) # <<<<<<<<<<<<<< * POUNDERS = S_(TAOPOUNDERS) * BRGN = S_(TAOBRGN) */ __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_S_(TAONM); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_NM, __pyx_t_10) < 0) __PYX_ERR(52, 30, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":31 * GPCG = S_(TAOGPCG) * NM = S_(TAONM) * POUNDERS = S_(TAOPOUNDERS) # <<<<<<<<<<<<<< * BRGN = S_(TAOBRGN) * LCL = S_(TAOLCL) */ __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_S_(TAOPOUNDERS); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_POUNDERS, __pyx_t_10) < 0) __PYX_ERR(52, 31, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":32 * NM = S_(TAONM) * POUNDERS = S_(TAOPOUNDERS) * BRGN = S_(TAOBRGN) # <<<<<<<<<<<<<< * LCL = S_(TAOLCL) * SSILS = S_(TAOSSILS) */ __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_S_(TAOBRGN); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_BRGN, __pyx_t_10) < 0) __PYX_ERR(52, 32, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":33 * POUNDERS = S_(TAOPOUNDERS) * BRGN = S_(TAOBRGN) * LCL = S_(TAOLCL) # <<<<<<<<<<<<<< * SSILS = S_(TAOSSILS) * SSFLS = S_(TAOSSFLS) */ __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_S_(TAOLCL); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_LCL, __pyx_t_10) < 0) __PYX_ERR(52, 33, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":34 * BRGN = S_(TAOBRGN) * LCL = S_(TAOLCL) * SSILS = S_(TAOSSILS) # <<<<<<<<<<<<<< * SSFLS = S_(TAOSSFLS) * ASILS = S_(TAOASILS) */ __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_S_(TAOSSILS); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_SSILS, __pyx_t_10) < 0) __PYX_ERR(52, 34, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":35 * LCL = S_(TAOLCL) * SSILS = S_(TAOSSILS) * SSFLS = S_(TAOSSFLS) # <<<<<<<<<<<<<< * ASILS = S_(TAOASILS) * ASFLS = S_(TAOASFLS) */ __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_S_(TAOSSFLS); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_SSFLS, __pyx_t_10) < 0) __PYX_ERR(52, 35, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":36 * SSILS = S_(TAOSSILS) * SSFLS = S_(TAOSSFLS) * ASILS = S_(TAOASILS) # <<<<<<<<<<<<<< * ASFLS = S_(TAOASFLS) * IPM = S_(TAOIPM) */ __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_S_(TAOASILS); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_ASILS, __pyx_t_10) < 0) __PYX_ERR(52, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":37 * SSFLS = S_(TAOSSFLS) * ASILS = S_(TAOASILS) * ASFLS = S_(TAOASFLS) # <<<<<<<<<<<<<< * IPM = S_(TAOIPM) * PDIPM = S_(TAOPDIPM) */ __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_S_(TAOASFLS); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_ASFLS, __pyx_t_10) < 0) __PYX_ERR(52, 37, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":38 * ASILS = S_(TAOASILS) * ASFLS = S_(TAOASFLS) * IPM = S_(TAOIPM) # <<<<<<<<<<<<<< * PDIPM = S_(TAOPDIPM) * SHELL = S_(TAOSHELL) */ __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_S_(TAOIPM); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_IPM, __pyx_t_10) < 0) __PYX_ERR(52, 38, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":39 * ASFLS = S_(TAOASFLS) * IPM = S_(TAOIPM) * PDIPM = S_(TAOPDIPM) # <<<<<<<<<<<<<< * SHELL = S_(TAOSHELL) * ADMM = S_(TAOADMM) */ __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_S_(TAOPDIPM); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_PDIPM, __pyx_t_10) < 0) __PYX_ERR(52, 39, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":40 * IPM = S_(TAOIPM) * PDIPM = S_(TAOPDIPM) * SHELL = S_(TAOSHELL) # <<<<<<<<<<<<<< * ADMM = S_(TAOADMM) * ALMM = S_(TAOALMM) */ __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_S_(TAOSHELL); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_SHELL, __pyx_t_10) < 0) __PYX_ERR(52, 40, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":41 * PDIPM = S_(TAOPDIPM) * SHELL = S_(TAOSHELL) * ADMM = S_(TAOADMM) # <<<<<<<<<<<<<< * ALMM = S_(TAOALMM) * PYTHON = S_(TAOPYTHON) */ __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_S_(TAOADMM); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_ADMM, __pyx_t_10) < 0) __PYX_ERR(52, 41, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":42 * SHELL = S_(TAOSHELL) * ADMM = S_(TAOADMM) * ALMM = S_(TAOALMM) # <<<<<<<<<<<<<< * PYTHON = S_(TAOPYTHON) * */ __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_S_(TAOALMM); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_ALMM, __pyx_t_10) < 0) __PYX_ERR(52, 42, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":43 * ADMM = S_(TAOADMM) * ALMM = S_(TAOALMM) * PYTHON = S_(TAOPYTHON) # <<<<<<<<<<<<<< * * class TAOConvergedReason: */ __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_S_(TAOPYTHON); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_PYTHON, __pyx_t_10) < 0) __PYX_ERR(52, 43, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":3 * # -------------------------------------------------------------------- * * class TAOType: # <<<<<<<<<<<<<< * """TAO solver type. * */ __pyx_t_10 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_n_s_TAOType, __pyx_empty_tuple, __pyx_t_13, NULL, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (PyDict_SetItem(__pyx_d, __pyx_n_s_TAOType, __pyx_t_10) < 0) __PYX_ERR(52, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/TAO.pyx":45 * PYTHON = S_(TAOPYTHON) * * class TAOConvergedReason: # <<<<<<<<<<<<<< * """TAO solver termination reason. * */ __pyx_t_13 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_TAOConvergedReason, __pyx_n_s_TAOConvergedReason, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, __pyx_kp_s_TAO_solver_termination_reason_Se); if (unlikely(!__pyx_t_13)) __PYX_ERR(52, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); /* "petsc4py/PETSc/TAO.pyx":54 * """ * # iterating * CONTINUE_ITERATING = TAO_CONTINUE_ITERATING # iterating # <<<<<<<<<<<<<< * CONVERGED_ITERATING = TAO_CONTINUE_ITERATING # iterating * ITERATING = TAO_CONTINUE_ITERATING # iterating */ __pyx_t_10 = __Pyx_PyInt_From_TaoConvergedReason(TAO_CONTINUE_ITERATING); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_CONTINUE_ITERATING, __pyx_t_10) < 0) __PYX_ERR(52, 54, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":55 * # iterating * CONTINUE_ITERATING = TAO_CONTINUE_ITERATING # iterating * CONVERGED_ITERATING = TAO_CONTINUE_ITERATING # iterating # <<<<<<<<<<<<<< * ITERATING = TAO_CONTINUE_ITERATING # iterating * # converged */ __pyx_t_10 = __Pyx_PyInt_From_TaoConvergedReason(TAO_CONTINUE_ITERATING); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_CONVERGED_ITERATING, __pyx_t_10) < 0) __PYX_ERR(52, 55, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":56 * CONTINUE_ITERATING = TAO_CONTINUE_ITERATING # iterating * CONVERGED_ITERATING = TAO_CONTINUE_ITERATING # iterating * ITERATING = TAO_CONTINUE_ITERATING # iterating # <<<<<<<<<<<<<< * # converged * CONVERGED_GATOL = TAO_CONVERGED_GATOL # ||g(X)|| < gatol */ __pyx_t_10 = __Pyx_PyInt_From_TaoConvergedReason(TAO_CONTINUE_ITERATING); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_ITERATING, __pyx_t_10) < 0) __PYX_ERR(52, 56, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":58 * ITERATING = TAO_CONTINUE_ITERATING # iterating * # converged * CONVERGED_GATOL = TAO_CONVERGED_GATOL # ||g(X)|| < gatol # <<<<<<<<<<<<<< * CONVERGED_GRTOL = TAO_CONVERGED_GRTOL # ||g(X)||/f(X) < grtol * CONVERGED_GTTOL = TAO_CONVERGED_GTTOL # ||g(X)||/||g(X0)|| < gttol */ __pyx_t_10 = __Pyx_PyInt_From_TaoConvergedReason(TAO_CONVERGED_GATOL); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_CONVERGED_GATOL, __pyx_t_10) < 0) __PYX_ERR(52, 58, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":59 * # converged * CONVERGED_GATOL = TAO_CONVERGED_GATOL # ||g(X)|| < gatol * CONVERGED_GRTOL = TAO_CONVERGED_GRTOL # ||g(X)||/f(X) < grtol # <<<<<<<<<<<<<< * CONVERGED_GTTOL = TAO_CONVERGED_GTTOL # ||g(X)||/||g(X0)|| < gttol * CONVERGED_STEPTOL = TAO_CONVERGED_STEPTOL # small step size */ __pyx_t_10 = __Pyx_PyInt_From_TaoConvergedReason(TAO_CONVERGED_GRTOL); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_CONVERGED_GRTOL, __pyx_t_10) < 0) __PYX_ERR(52, 59, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":60 * CONVERGED_GATOL = TAO_CONVERGED_GATOL # ||g(X)|| < gatol * CONVERGED_GRTOL = TAO_CONVERGED_GRTOL # ||g(X)||/f(X) < grtol * CONVERGED_GTTOL = TAO_CONVERGED_GTTOL # ||g(X)||/||g(X0)|| < gttol # <<<<<<<<<<<<<< * CONVERGED_STEPTOL = TAO_CONVERGED_STEPTOL # small step size * CONVERGED_MINF = TAO_CONVERGED_MINF # f(X) < F_min */ __pyx_t_10 = __Pyx_PyInt_From_TaoConvergedReason(TAO_CONVERGED_GTTOL); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_CONVERGED_GTTOL, __pyx_t_10) < 0) __PYX_ERR(52, 60, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":61 * CONVERGED_GRTOL = TAO_CONVERGED_GRTOL # ||g(X)||/f(X) < grtol * CONVERGED_GTTOL = TAO_CONVERGED_GTTOL # ||g(X)||/||g(X0)|| < gttol * CONVERGED_STEPTOL = TAO_CONVERGED_STEPTOL # small step size # <<<<<<<<<<<<<< * CONVERGED_MINF = TAO_CONVERGED_MINF # f(X) < F_min * CONVERGED_USER = TAO_CONVERGED_USER # user defined */ __pyx_t_10 = __Pyx_PyInt_From_TaoConvergedReason(TAO_CONVERGED_STEPTOL); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_CONVERGED_STEPTOL, __pyx_t_10) < 0) __PYX_ERR(52, 61, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":62 * CONVERGED_GTTOL = TAO_CONVERGED_GTTOL # ||g(X)||/||g(X0)|| < gttol * CONVERGED_STEPTOL = TAO_CONVERGED_STEPTOL # small step size * CONVERGED_MINF = TAO_CONVERGED_MINF # f(X) < F_min # <<<<<<<<<<<<<< * CONVERGED_USER = TAO_CONVERGED_USER # user defined * # diverged */ __pyx_t_10 = __Pyx_PyInt_From_TaoConvergedReason(TAO_CONVERGED_MINF); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_CONVERGED_MINF, __pyx_t_10) < 0) __PYX_ERR(52, 62, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":63 * CONVERGED_STEPTOL = TAO_CONVERGED_STEPTOL # small step size * CONVERGED_MINF = TAO_CONVERGED_MINF # f(X) < F_min * CONVERGED_USER = TAO_CONVERGED_USER # user defined # <<<<<<<<<<<<<< * # diverged * DIVERGED_MAXITS = TAO_DIVERGED_MAXITS # */ __pyx_t_10 = __Pyx_PyInt_From_TaoConvergedReason(TAO_CONVERGED_USER); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_CONVERGED_USER, __pyx_t_10) < 0) __PYX_ERR(52, 63, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":65 * CONVERGED_USER = TAO_CONVERGED_USER # user defined * # diverged * DIVERGED_MAXITS = TAO_DIVERGED_MAXITS # # <<<<<<<<<<<<<< * DIVERGED_NAN = TAO_DIVERGED_NAN # * DIVERGED_MAXFCN = TAO_DIVERGED_MAXFCN # */ __pyx_t_10 = __Pyx_PyInt_From_TaoConvergedReason(TAO_DIVERGED_MAXITS); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_DIVERGED_MAXITS, __pyx_t_10) < 0) __PYX_ERR(52, 65, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":66 * # diverged * DIVERGED_MAXITS = TAO_DIVERGED_MAXITS # * DIVERGED_NAN = TAO_DIVERGED_NAN # # <<<<<<<<<<<<<< * DIVERGED_MAXFCN = TAO_DIVERGED_MAXFCN # * DIVERGED_LS_FAILURE = TAO_DIVERGED_LS_FAILURE # */ __pyx_t_10 = __Pyx_PyInt_From_TaoConvergedReason(TAO_DIVERGED_NAN); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_DIVERGED_NAN, __pyx_t_10) < 0) __PYX_ERR(52, 66, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":67 * DIVERGED_MAXITS = TAO_DIVERGED_MAXITS # * DIVERGED_NAN = TAO_DIVERGED_NAN # * DIVERGED_MAXFCN = TAO_DIVERGED_MAXFCN # # <<<<<<<<<<<<<< * DIVERGED_LS_FAILURE = TAO_DIVERGED_LS_FAILURE # * DIVERGED_TR_REDUCTION = TAO_DIVERGED_TR_REDUCTION # */ __pyx_t_10 = __Pyx_PyInt_From_TaoConvergedReason(TAO_DIVERGED_MAXFCN); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_DIVERGED_MAXFCN, __pyx_t_10) < 0) __PYX_ERR(52, 67, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":68 * DIVERGED_NAN = TAO_DIVERGED_NAN # * DIVERGED_MAXFCN = TAO_DIVERGED_MAXFCN # * DIVERGED_LS_FAILURE = TAO_DIVERGED_LS_FAILURE # # <<<<<<<<<<<<<< * DIVERGED_TR_REDUCTION = TAO_DIVERGED_TR_REDUCTION # * DIVERGED_USER = TAO_DIVERGED_USER # user defined */ __pyx_t_10 = __Pyx_PyInt_From_TaoConvergedReason(TAO_DIVERGED_LS_FAILURE); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_DIVERGED_LS_FAILURE, __pyx_t_10) < 0) __PYX_ERR(52, 68, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":69 * DIVERGED_MAXFCN = TAO_DIVERGED_MAXFCN # * DIVERGED_LS_FAILURE = TAO_DIVERGED_LS_FAILURE # * DIVERGED_TR_REDUCTION = TAO_DIVERGED_TR_REDUCTION # # <<<<<<<<<<<<<< * DIVERGED_USER = TAO_DIVERGED_USER # user defined * */ __pyx_t_10 = __Pyx_PyInt_From_TaoConvergedReason(TAO_DIVERGED_TR_REDUCTION); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_DIVERGED_TR_REDUCTION, __pyx_t_10) < 0) __PYX_ERR(52, 69, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":70 * DIVERGED_LS_FAILURE = TAO_DIVERGED_LS_FAILURE # * DIVERGED_TR_REDUCTION = TAO_DIVERGED_TR_REDUCTION # * DIVERGED_USER = TAO_DIVERGED_USER # user defined # <<<<<<<<<<<<<< * * class TAOBNCGType: */ __pyx_t_10 = __Pyx_PyInt_From_TaoConvergedReason(TAO_DIVERGED_USER); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_DIVERGED_USER, __pyx_t_10) < 0) __PYX_ERR(52, 70, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":45 * PYTHON = S_(TAOPYTHON) * * class TAOConvergedReason: # <<<<<<<<<<<<<< * """TAO solver termination reason. * */ __pyx_t_10 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_n_s_TAOConvergedReason, __pyx_empty_tuple, __pyx_t_13, NULL, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (PyDict_SetItem(__pyx_d, __pyx_n_s_TAOConvergedReason, __pyx_t_10) < 0) __PYX_ERR(52, 45, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/TAO.pyx":72 * DIVERGED_USER = TAO_DIVERGED_USER # user defined * * class TAOBNCGType: # <<<<<<<<<<<<<< * """TAO Bound Constrained Conjugate Gradient (BNCG) Update Type.""" * GD = TAO_BNCG_GD */ __pyx_t_13 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_TAOBNCGType, __pyx_n_s_TAOBNCGType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, __pyx_kp_s_TAO_Bound_Constrained_Conjugate); if (unlikely(!__pyx_t_13)) __PYX_ERR(52, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); /* "petsc4py/PETSc/TAO.pyx":74 * class TAOBNCGType: * """TAO Bound Constrained Conjugate Gradient (BNCG) Update Type.""" * GD = TAO_BNCG_GD # <<<<<<<<<<<<<< * PCGD = TAO_BNCG_PCGD * HS = TAO_BNCG_HS */ __pyx_t_10 = __Pyx_PyInt_From_TaoBNCGType(TAO_BNCG_GD); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_GD, __pyx_t_10) < 0) __PYX_ERR(52, 74, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":75 * """TAO Bound Constrained Conjugate Gradient (BNCG) Update Type.""" * GD = TAO_BNCG_GD * PCGD = TAO_BNCG_PCGD # <<<<<<<<<<<<<< * HS = TAO_BNCG_HS * FR = TAO_BNCG_FR */ __pyx_t_10 = __Pyx_PyInt_From_TaoBNCGType(TAO_BNCG_PCGD); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_PCGD, __pyx_t_10) < 0) __PYX_ERR(52, 75, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":76 * GD = TAO_BNCG_GD * PCGD = TAO_BNCG_PCGD * HS = TAO_BNCG_HS # <<<<<<<<<<<<<< * FR = TAO_BNCG_FR * PRP = TAO_BNCG_PRP */ __pyx_t_10 = __Pyx_PyInt_From_TaoBNCGType(TAO_BNCG_HS); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_HS, __pyx_t_10) < 0) __PYX_ERR(52, 76, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":77 * PCGD = TAO_BNCG_PCGD * HS = TAO_BNCG_HS * FR = TAO_BNCG_FR # <<<<<<<<<<<<<< * PRP = TAO_BNCG_PRP * PRP_PLUS = TAO_BNCG_PRP_PLUS */ __pyx_t_10 = __Pyx_PyInt_From_TaoBNCGType(TAO_BNCG_FR); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_FR, __pyx_t_10) < 0) __PYX_ERR(52, 77, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":78 * HS = TAO_BNCG_HS * FR = TAO_BNCG_FR * PRP = TAO_BNCG_PRP # <<<<<<<<<<<<<< * PRP_PLUS = TAO_BNCG_PRP_PLUS * DY = TAO_BNCG_DY */ __pyx_t_10 = __Pyx_PyInt_From_TaoBNCGType(TAO_BNCG_PRP); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_PRP, __pyx_t_10) < 0) __PYX_ERR(52, 78, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":79 * FR = TAO_BNCG_FR * PRP = TAO_BNCG_PRP * PRP_PLUS = TAO_BNCG_PRP_PLUS # <<<<<<<<<<<<<< * DY = TAO_BNCG_DY * HZ = TAO_BNCG_HZ */ __pyx_t_10 = __Pyx_PyInt_From_TaoBNCGType(TAO_BNCG_PRP_PLUS); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_PRP_PLUS, __pyx_t_10) < 0) __PYX_ERR(52, 79, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":80 * PRP = TAO_BNCG_PRP * PRP_PLUS = TAO_BNCG_PRP_PLUS * DY = TAO_BNCG_DY # <<<<<<<<<<<<<< * HZ = TAO_BNCG_HZ * DK = TAO_BNCG_DK */ __pyx_t_10 = __Pyx_PyInt_From_TaoBNCGType(TAO_BNCG_DY); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_DY, __pyx_t_10) < 0) __PYX_ERR(52, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":81 * PRP_PLUS = TAO_BNCG_PRP_PLUS * DY = TAO_BNCG_DY * HZ = TAO_BNCG_HZ # <<<<<<<<<<<<<< * DK = TAO_BNCG_DK * KD = TAO_BNCG_KD */ __pyx_t_10 = __Pyx_PyInt_From_TaoBNCGType(TAO_BNCG_HZ); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_HZ, __pyx_t_10) < 0) __PYX_ERR(52, 81, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":82 * DY = TAO_BNCG_DY * HZ = TAO_BNCG_HZ * DK = TAO_BNCG_DK # <<<<<<<<<<<<<< * KD = TAO_BNCG_KD * SSML_BFGS = TAO_BNCG_SSML_BFGS */ __pyx_t_10 = __Pyx_PyInt_From_TaoBNCGType(TAO_BNCG_DK); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_DK, __pyx_t_10) < 0) __PYX_ERR(52, 82, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":83 * HZ = TAO_BNCG_HZ * DK = TAO_BNCG_DK * KD = TAO_BNCG_KD # <<<<<<<<<<<<<< * SSML_BFGS = TAO_BNCG_SSML_BFGS * SSML_DFP = TAO_BNCG_SSML_DFP */ __pyx_t_10 = __Pyx_PyInt_From_TaoBNCGType(TAO_BNCG_KD); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_KD, __pyx_t_10) < 0) __PYX_ERR(52, 83, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":84 * DK = TAO_BNCG_DK * KD = TAO_BNCG_KD * SSML_BFGS = TAO_BNCG_SSML_BFGS # <<<<<<<<<<<<<< * SSML_DFP = TAO_BNCG_SSML_DFP * SSML_BRDN = TAO_BNCG_SSML_BRDN */ __pyx_t_10 = __Pyx_PyInt_From_TaoBNCGType(TAO_BNCG_SSML_BFGS); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_SSML_BFGS, __pyx_t_10) < 0) __PYX_ERR(52, 84, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":85 * KD = TAO_BNCG_KD * SSML_BFGS = TAO_BNCG_SSML_BFGS * SSML_DFP = TAO_BNCG_SSML_DFP # <<<<<<<<<<<<<< * SSML_BRDN = TAO_BNCG_SSML_BRDN * # -------------------------------------------------------------------- */ __pyx_t_10 = __Pyx_PyInt_From_TaoBNCGType(TAO_BNCG_SSML_DFP); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_SSML_DFP, __pyx_t_10) < 0) __PYX_ERR(52, 85, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":86 * SSML_BFGS = TAO_BNCG_SSML_BFGS * SSML_DFP = TAO_BNCG_SSML_DFP * SSML_BRDN = TAO_BNCG_SSML_BRDN # <<<<<<<<<<<<<< * # -------------------------------------------------------------------- * */ __pyx_t_10 = __Pyx_PyInt_From_TaoBNCGType(TAO_BNCG_SSML_BRDN); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_SSML_BRDN, __pyx_t_10) < 0) __PYX_ERR(52, 86, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":72 * DIVERGED_USER = TAO_DIVERGED_USER # user defined * * class TAOBNCGType: # <<<<<<<<<<<<<< * """TAO Bound Constrained Conjugate Gradient (BNCG) Update Type.""" * GD = TAO_BNCG_GD */ __pyx_t_10 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_n_s_TAOBNCGType, __pyx_empty_tuple, __pyx_t_13, NULL, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (PyDict_SetItem(__pyx_d, __pyx_n_s_TAOBNCGType, __pyx_t_10) < 0) __PYX_ERR(52, 72, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/TAO.pyx":100 * """ * * Type = TAOType # <<<<<<<<<<<<<< * ConvergedReason = TAOConvergedReason * BNCGType = TAOBNCGType */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_TAOType); if (unlikely(!__pyx_t_13)) __PYX_ERR(52, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_n_s_Type, __pyx_t_13) < 0) __PYX_ERR(52, 100, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_TAO); /* "petsc4py/PETSc/TAO.pyx":101 * * Type = TAOType * ConvergedReason = TAOConvergedReason # <<<<<<<<<<<<<< * BNCGType = TAOBNCGType * # FIXME backward compatibility */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_TAOConvergedReason); if (unlikely(!__pyx_t_13)) __PYX_ERR(52, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_n_s_ConvergedReason, __pyx_t_13) < 0) __PYX_ERR(52, 101, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_TAO); /* "petsc4py/PETSc/TAO.pyx":102 * Type = TAOType * ConvergedReason = TAOConvergedReason * BNCGType = TAOBNCGType # <<<<<<<<<<<<<< * # FIXME backward compatibility * Reason = TAOConvergedReason */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_TAOBNCGType); if (unlikely(!__pyx_t_13)) __PYX_ERR(52, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_n_s_BNCGType, __pyx_t_13) < 0) __PYX_ERR(52, 102, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_TAO); /* "petsc4py/PETSc/TAO.pyx":104 * BNCGType = TAOBNCGType * # FIXME backward compatibility * Reason = TAOConvergedReason # <<<<<<<<<<<<<< * * def __cinit__(self): */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_TAOConvergedReason); if (unlikely(!__pyx_t_13)) __PYX_ERR(52, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_n_s_Reason, __pyx_t_13) < 0) __PYX_ERR(52, 104, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_TAO); /* "petsc4py/PETSc/TAO.pyx":1461 * return toReal(fval) * * getFunctionValue = getObjectiveValue # <<<<<<<<<<<<<< * * def getConvergedReason(self) -> ConvergedReason: */ __Pyx_GetNameInClass(__pyx_t_13, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_n_s_getObjectiveValue); if (unlikely(!__pyx_t_13)) __PYX_ERR(52, 1461, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_n_s_getFunctionValue, __pyx_t_13) < 0) __PYX_ERR(52, 1461, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_TAO); /* "petsc4py/PETSc/TAO.pyx":1751 * # --- backward compatibility --- * * setInitial = setSolution # <<<<<<<<<<<<<< * * # --- application context --- */ __Pyx_GetNameInClass(__pyx_t_13, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_n_s_setSolution); if (unlikely(!__pyx_t_13)) __PYX_ERR(52, 1751, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_n_s_setInitial, __pyx_t_13) < 0) __PYX_ERR(52, 1751, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_TAO); /* "petsc4py/PETSc/TAO.pyx":1869 * # -------------------------------------------------------------------- * * del TAOType # <<<<<<<<<<<<<< * del TAOConvergedReason * del TAOBNCGType */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_TAOType) < 0) __PYX_ERR(52, 1869, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":1870 * * del TAOType * del TAOConvergedReason # <<<<<<<<<<<<<< * del TAOBNCGType * */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_TAOConvergedReason) < 0) __PYX_ERR(52, 1870, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":1871 * del TAOType * del TAOConvergedReason * del TAOBNCGType # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_TAOBNCGType) < 0) __PYX_ERR(52, 1871, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":1875 * # -------------------------------------------------------------------- * * class TAOLineSearchType: # <<<<<<<<<<<<<< * """TAO Line Search Types.""" * UNIT = S_(TAOLINESEARCHUNIT) */ __pyx_t_13 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_TAOLineSearchType, __pyx_n_s_TAOLineSearchType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, __pyx_kp_s_TAO_Line_Search_Types); if (unlikely(!__pyx_t_13)) __PYX_ERR(52, 1875, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); /* "petsc4py/PETSc/TAO.pyx":1877 * class TAOLineSearchType: * """TAO Line Search Types.""" * UNIT = S_(TAOLINESEARCHUNIT) # <<<<<<<<<<<<<< * ARMIJO = S_(TAOLINESEARCHARMIJO) * MORETHUENTE = S_(TAOLINESEARCHMT) */ __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_S_(TAOLINESEARCHUNIT); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 1877, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_UNIT, __pyx_t_10) < 0) __PYX_ERR(52, 1877, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":1878 * """TAO Line Search Types.""" * UNIT = S_(TAOLINESEARCHUNIT) * ARMIJO = S_(TAOLINESEARCHARMIJO) # <<<<<<<<<<<<<< * MORETHUENTE = S_(TAOLINESEARCHMT) * IPM = S_(TAOLINESEARCHIPM) */ __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_S_(TAOLINESEARCHARMIJO); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 1878, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_ARMIJO, __pyx_t_10) < 0) __PYX_ERR(52, 1878, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":1879 * UNIT = S_(TAOLINESEARCHUNIT) * ARMIJO = S_(TAOLINESEARCHARMIJO) * MORETHUENTE = S_(TAOLINESEARCHMT) # <<<<<<<<<<<<<< * IPM = S_(TAOLINESEARCHIPM) * OWARMIJO = S_(TAOLINESEARCHOWARMIJO) */ __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_S_(TAOLINESEARCHMT); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 1879, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_MORETHUENTE, __pyx_t_10) < 0) __PYX_ERR(52, 1879, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":1880 * ARMIJO = S_(TAOLINESEARCHARMIJO) * MORETHUENTE = S_(TAOLINESEARCHMT) * IPM = S_(TAOLINESEARCHIPM) # <<<<<<<<<<<<<< * OWARMIJO = S_(TAOLINESEARCHOWARMIJO) * GPCG = S_(TAOLINESEARCHGPCG) */ __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_S_(TAOLINESEARCHIPM); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 1880, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_IPM, __pyx_t_10) < 0) __PYX_ERR(52, 1880, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":1881 * MORETHUENTE = S_(TAOLINESEARCHMT) * IPM = S_(TAOLINESEARCHIPM) * OWARMIJO = S_(TAOLINESEARCHOWARMIJO) # <<<<<<<<<<<<<< * GPCG = S_(TAOLINESEARCHGPCG) * */ __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_S_(TAOLINESEARCHOWARMIJO); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 1881, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_OWARMIJO, __pyx_t_10) < 0) __PYX_ERR(52, 1881, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":1882 * IPM = S_(TAOLINESEARCHIPM) * OWARMIJO = S_(TAOLINESEARCHOWARMIJO) * GPCG = S_(TAOLINESEARCHGPCG) # <<<<<<<<<<<<<< * * class TAOLineSearchConvergedReason: */ __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_S_(TAOLINESEARCHGPCG); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 1882, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_GPCG, __pyx_t_10) < 0) __PYX_ERR(52, 1882, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":1875 * # -------------------------------------------------------------------- * * class TAOLineSearchType: # <<<<<<<<<<<<<< * """TAO Line Search Types.""" * UNIT = S_(TAOLINESEARCHUNIT) */ __pyx_t_10 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_n_s_TAOLineSearchType, __pyx_empty_tuple, __pyx_t_13, NULL, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 1875, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (PyDict_SetItem(__pyx_d, __pyx_n_s_TAOLineSearchType, __pyx_t_10) < 0) __PYX_ERR(52, 1875, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/TAO.pyx":1884 * GPCG = S_(TAOLINESEARCHGPCG) * * class TAOLineSearchConvergedReason: # <<<<<<<<<<<<<< * """TAO Line Search Termination Reasons.""" * # iterating */ __pyx_t_13 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_TAOLineSearchConvergedReason, __pyx_n_s_TAOLineSearchConvergedReason, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, __pyx_kp_s_TAO_Line_Search_Termination_Reas); if (unlikely(!__pyx_t_13)) __PYX_ERR(52, 1884, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); /* "petsc4py/PETSc/TAO.pyx":1887 * """TAO Line Search Termination Reasons.""" * # iterating * CONTINUE_SEARCH = TAOLINESEARCH_CONTINUE_ITERATING # <<<<<<<<<<<<<< * # failed * FAILED_INFORNAN = TAOLINESEARCH_FAILED_INFORNAN # inf or NaN in user function */ __pyx_t_10 = __Pyx_PyInt_From_TaoLineSearchConvergedReason(TAOLINESEARCH_CONTINUE_ITERATING); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 1887, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_CONTINUE_SEARCH, __pyx_t_10) < 0) __PYX_ERR(52, 1887, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":1889 * CONTINUE_SEARCH = TAOLINESEARCH_CONTINUE_ITERATING * # failed * FAILED_INFORNAN = TAOLINESEARCH_FAILED_INFORNAN # inf or NaN in user function # <<<<<<<<<<<<<< * FAILED_BADPARAMETER = TAOLINESEARCH_FAILED_BADPARAMETER # negative value set as parameter * FAILED_ASCENT = TAOLINESEARCH_FAILED_ASCENT # search direction is not a descent direction */ __pyx_t_10 = __Pyx_PyInt_From_TaoLineSearchConvergedReason(TAOLINESEARCH_FAILED_INFORNAN); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 1889, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_FAILED_INFORNAN, __pyx_t_10) < 0) __PYX_ERR(52, 1889, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":1890 * # failed * FAILED_INFORNAN = TAOLINESEARCH_FAILED_INFORNAN # inf or NaN in user function * FAILED_BADPARAMETER = TAOLINESEARCH_FAILED_BADPARAMETER # negative value set as parameter # <<<<<<<<<<<<<< * FAILED_ASCENT = TAOLINESEARCH_FAILED_ASCENT # search direction is not a descent direction * # succeeded */ __pyx_t_10 = __Pyx_PyInt_From_TaoLineSearchConvergedReason(TAOLINESEARCH_FAILED_BADPARAMETER); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 1890, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_FAILED_BADPARAMETER, __pyx_t_10) < 0) __PYX_ERR(52, 1890, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":1891 * FAILED_INFORNAN = TAOLINESEARCH_FAILED_INFORNAN # inf or NaN in user function * FAILED_BADPARAMETER = TAOLINESEARCH_FAILED_BADPARAMETER # negative value set as parameter * FAILED_ASCENT = TAOLINESEARCH_FAILED_ASCENT # search direction is not a descent direction # <<<<<<<<<<<<<< * # succeeded * SUCCESS = TAOLINESEARCH_SUCCESS # found step length */ __pyx_t_10 = __Pyx_PyInt_From_TaoLineSearchConvergedReason(TAOLINESEARCH_FAILED_ASCENT); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 1891, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_FAILED_ASCENT, __pyx_t_10) < 0) __PYX_ERR(52, 1891, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":1893 * FAILED_ASCENT = TAOLINESEARCH_FAILED_ASCENT # search direction is not a descent direction * # succeeded * SUCCESS = TAOLINESEARCH_SUCCESS # found step length # <<<<<<<<<<<<<< * SUCCESS_USER = TAOLINESEARCH_SUCCESS_USER # user-defined success criteria reached * # halted */ __pyx_t_10 = __Pyx_PyInt_From_TaoLineSearchConvergedReason(TAOLINESEARCH_SUCCESS); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 1893, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_SUCCESS, __pyx_t_10) < 0) __PYX_ERR(52, 1893, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":1894 * # succeeded * SUCCESS = TAOLINESEARCH_SUCCESS # found step length * SUCCESS_USER = TAOLINESEARCH_SUCCESS_USER # user-defined success criteria reached # <<<<<<<<<<<<<< * # halted * HALTED_OTHER = TAOLINESEARCH_HALTED_OTHER # stopped search with unknown reason */ __pyx_t_10 = __Pyx_PyInt_From_TaoLineSearchConvergedReason(TAOLINESEARCH_SUCCESS_USER); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 1894, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_SUCCESS_USER, __pyx_t_10) < 0) __PYX_ERR(52, 1894, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":1896 * SUCCESS_USER = TAOLINESEARCH_SUCCESS_USER # user-defined success criteria reached * # halted * HALTED_OTHER = TAOLINESEARCH_HALTED_OTHER # stopped search with unknown reason # <<<<<<<<<<<<<< * HALTED_MAXFCN = TAOLINESEARCH_HALTED_MAXFCN # maximum function evaluations reached * HALTED_UPPERBOUND = TAOLINESEARCH_HALTED_UPPERBOUND # stopped at upper bound */ __pyx_t_10 = __Pyx_PyInt_From_TaoLineSearchConvergedReason(TAOLINESEARCH_HALTED_OTHER); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 1896, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_HALTED_OTHER, __pyx_t_10) < 0) __PYX_ERR(52, 1896, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":1897 * # halted * HALTED_OTHER = TAOLINESEARCH_HALTED_OTHER # stopped search with unknown reason * HALTED_MAXFCN = TAOLINESEARCH_HALTED_MAXFCN # maximum function evaluations reached # <<<<<<<<<<<<<< * HALTED_UPPERBOUND = TAOLINESEARCH_HALTED_UPPERBOUND # stopped at upper bound * HALTED_LOWERBOUND = TAOLINESEARCH_HALTED_LOWERBOUND # stopped at lower bound */ __pyx_t_10 = __Pyx_PyInt_From_TaoLineSearchConvergedReason(TAOLINESEARCH_HALTED_MAXFCN); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 1897, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_HALTED_MAXFCN, __pyx_t_10) < 0) __PYX_ERR(52, 1897, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":1898 * HALTED_OTHER = TAOLINESEARCH_HALTED_OTHER # stopped search with unknown reason * HALTED_MAXFCN = TAOLINESEARCH_HALTED_MAXFCN # maximum function evaluations reached * HALTED_UPPERBOUND = TAOLINESEARCH_HALTED_UPPERBOUND # stopped at upper bound # <<<<<<<<<<<<<< * HALTED_LOWERBOUND = TAOLINESEARCH_HALTED_LOWERBOUND # stopped at lower bound * HALTED_RTOL = TAOLINESEARCH_HALTED_RTOL # range of uncertainty is below tolerance */ __pyx_t_10 = __Pyx_PyInt_From_TaoLineSearchConvergedReason(TAOLINESEARCH_HALTED_UPPERBOUND); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 1898, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_HALTED_UPPERBOUND, __pyx_t_10) < 0) __PYX_ERR(52, 1898, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":1899 * HALTED_MAXFCN = TAOLINESEARCH_HALTED_MAXFCN # maximum function evaluations reached * HALTED_UPPERBOUND = TAOLINESEARCH_HALTED_UPPERBOUND # stopped at upper bound * HALTED_LOWERBOUND = TAOLINESEARCH_HALTED_LOWERBOUND # stopped at lower bound # <<<<<<<<<<<<<< * HALTED_RTOL = TAOLINESEARCH_HALTED_RTOL # range of uncertainty is below tolerance * HALTED_USER = TAOLINESEARCH_HALTED_USER # user-defined halt criteria reached */ __pyx_t_10 = __Pyx_PyInt_From_TaoLineSearchConvergedReason(TAOLINESEARCH_HALTED_LOWERBOUND); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 1899, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_HALTED_LOWERBOUND, __pyx_t_10) < 0) __PYX_ERR(52, 1899, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":1900 * HALTED_UPPERBOUND = TAOLINESEARCH_HALTED_UPPERBOUND # stopped at upper bound * HALTED_LOWERBOUND = TAOLINESEARCH_HALTED_LOWERBOUND # stopped at lower bound * HALTED_RTOL = TAOLINESEARCH_HALTED_RTOL # range of uncertainty is below tolerance # <<<<<<<<<<<<<< * HALTED_USER = TAOLINESEARCH_HALTED_USER # user-defined halt criteria reached * */ __pyx_t_10 = __Pyx_PyInt_From_TaoLineSearchConvergedReason(TAOLINESEARCH_HALTED_RTOL); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 1900, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_HALTED_RTOL, __pyx_t_10) < 0) __PYX_ERR(52, 1900, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":1901 * HALTED_LOWERBOUND = TAOLINESEARCH_HALTED_LOWERBOUND # stopped at lower bound * HALTED_RTOL = TAOLINESEARCH_HALTED_RTOL # range of uncertainty is below tolerance * HALTED_USER = TAOLINESEARCH_HALTED_USER # user-defined halt criteria reached # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_t_10 = __Pyx_PyInt_From_TaoLineSearchConvergedReason(TAOLINESEARCH_HALTED_USER); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 1901, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_n_s_HALTED_USER, __pyx_t_10) < 0) __PYX_ERR(52, 1901, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "petsc4py/PETSc/TAO.pyx":1884 * GPCG = S_(TAOLINESEARCHGPCG) * * class TAOLineSearchConvergedReason: # <<<<<<<<<<<<<< * """TAO Line Search Termination Reasons.""" * # iterating */ __pyx_t_10 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_n_s_TAOLineSearchConvergedReason, __pyx_empty_tuple, __pyx_t_13, NULL, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(52, 1884, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (PyDict_SetItem(__pyx_d, __pyx_n_s_TAOLineSearchConvergedReason, __pyx_t_10) < 0) __PYX_ERR(52, 1884, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/TAO.pyx":1908 * """TAO Line Search.""" * * Type = TAOLineSearchType # <<<<<<<<<<<<<< * Reason = TAOLineSearchConvergedReason * */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_TAOLineSearchType); if (unlikely(!__pyx_t_13)) __PYX_ERR(52, 1908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_TAOLineSearch, __pyx_n_s_Type, __pyx_t_13) < 0) __PYX_ERR(52, 1908, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_TAOLineSearch); /* "petsc4py/PETSc/TAO.pyx":1909 * * Type = TAOLineSearchType * Reason = TAOLineSearchConvergedReason # <<<<<<<<<<<<<< * * def __cinit__(self): */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_TAOLineSearchConvergedReason); if (unlikely(!__pyx_t_13)) __PYX_ERR(52, 1909, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_TAOLineSearch, __pyx_n_s_Reason, __pyx_t_13) < 0) __PYX_ERR(52, 1909, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_TAOLineSearch); /* "petsc4py/PETSc/TAO.pyx":2162 * # -------------------------------------------------------------------- * * del TAOLineSearchType # <<<<<<<<<<<<<< * del TAOLineSearchConvergedReason */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_TAOLineSearchType) < 0) __PYX_ERR(52, 2162, __pyx_L1_error) /* "petsc4py/PETSc/TAO.pyx":2163 * * del TAOLineSearchType * del TAOLineSearchConvergedReason # <<<<<<<<<<<<<< */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_TAOLineSearchConvergedReason) < 0) __PYX_ERR(52, 2163, __pyx_L1_error) /* "petsc4py/PETSc/AO.pyx":3 * # -------------------------------------------------------------------- * * class AOType(object): # <<<<<<<<<<<<<< * BASIC = S_(AOBASIC) * ADVANCED = S_(AOADVANCED) */ __pyx_t_13 = __Pyx_PEP560_update_bases(__pyx_tuple__213); if (unlikely(!__pyx_t_13)) __PYX_ERR(53, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(53, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_13, __pyx_n_s_AOType, __pyx_n_s_AOType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(53, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_13 != __pyx_tuple__213) { if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_tuple__213) < 0))) __PYX_ERR(53, 3, __pyx_L1_error) } /* "petsc4py/PETSc/AO.pyx":4 * * class AOType(object): * BASIC = S_(AOBASIC) # <<<<<<<<<<<<<< * ADVANCED = S_(AOADVANCED) * MAPPING = S_(AOMAPPING) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(AOBASIC); if (unlikely(!__pyx_t_11)) __PYX_ERR(53, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_BASIC, __pyx_t_11) < 0) __PYX_ERR(53, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/AO.pyx":5 * class AOType(object): * BASIC = S_(AOBASIC) * ADVANCED = S_(AOADVANCED) # <<<<<<<<<<<<<< * MAPPING = S_(AOMAPPING) * MEMORYSCALABLE = S_(AOMEMORYSCALABLE) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(AOADVANCED); if (unlikely(!__pyx_t_11)) __PYX_ERR(53, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_ADVANCED, __pyx_t_11) < 0) __PYX_ERR(53, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/AO.pyx":6 * BASIC = S_(AOBASIC) * ADVANCED = S_(AOADVANCED) * MAPPING = S_(AOMAPPING) # <<<<<<<<<<<<<< * MEMORYSCALABLE = S_(AOMEMORYSCALABLE) * */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(AOMAPPING); if (unlikely(!__pyx_t_11)) __PYX_ERR(53, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_MAPPING, __pyx_t_11) < 0) __PYX_ERR(53, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/AO.pyx":7 * ADVANCED = S_(AOADVANCED) * MAPPING = S_(AOMAPPING) * MEMORYSCALABLE = S_(AOMEMORYSCALABLE) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(AOMEMORYSCALABLE); if (unlikely(!__pyx_t_11)) __PYX_ERR(53, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_MEMORYSCALABLE, __pyx_t_11) < 0) __PYX_ERR(53, 7, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/AO.pyx":3 * # -------------------------------------------------------------------- * * class AOType(object): # <<<<<<<<<<<<<< * BASIC = S_(AOBASIC) * ADVANCED = S_(AOADVANCED) */ __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_AOType, __pyx_t_13, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(53, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_AOType, __pyx_t_11) < 0) __PYX_ERR(53, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/AO.pyx":13 * cdef class AO(Object): * """Application ordering object.""" * Type = AOType # <<<<<<<<<<<<<< * * def __cinit__(self): */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_AOType); if (unlikely(!__pyx_t_13)) __PYX_ERR(53, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_AO, __pyx_n_s_Type, __pyx_t_13) < 0) __PYX_ERR(53, 13, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_AO); /* "petsc4py/PETSc/AO.pyx":285 * # -------------------------------------------------------------------- * * del AOType # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_AOType) < 0) __PYX_ERR(53, 285, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":3 * # -------------------------------------------------------------------- * * class DMType(object): # <<<<<<<<<<<<<< * """`DM` types.""" * DA = S_(DMDA_type) */ __pyx_t_13 = __Pyx_PEP560_update_bases(__pyx_tuple__215); if (unlikely(!__pyx_t_13)) __PYX_ERR(54, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(54, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_13, __pyx_n_s_DMType, __pyx_n_s_DMType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, __pyx_kp_s_DM_types); if (unlikely(!__pyx_t_12)) __PYX_ERR(54, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_13 != __pyx_tuple__215) { if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_tuple__215) < 0))) __PYX_ERR(54, 3, __pyx_L1_error) } /* "petsc4py/PETSc/DM.pyx":5 * class DMType(object): * """`DM` types.""" * DA = S_(DMDA_type) # <<<<<<<<<<<<<< * COMPOSITE = S_(DMCOMPOSITE) * SLICED = S_(DMSLICED) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(DMDA); if (unlikely(!__pyx_t_11)) __PYX_ERR(54, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DA, __pyx_t_11) < 0) __PYX_ERR(54, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DM.pyx":6 * """`DM` types.""" * DA = S_(DMDA_type) * COMPOSITE = S_(DMCOMPOSITE) # <<<<<<<<<<<<<< * SLICED = S_(DMSLICED) * SHELL = S_(DMSHELL) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(DMCOMPOSITE); if (unlikely(!__pyx_t_11)) __PYX_ERR(54, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_COMPOSITE, __pyx_t_11) < 0) __PYX_ERR(54, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DM.pyx":7 * DA = S_(DMDA_type) * COMPOSITE = S_(DMCOMPOSITE) * SLICED = S_(DMSLICED) # <<<<<<<<<<<<<< * SHELL = S_(DMSHELL) * PLEX = S_(DMPLEX) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(DMSLICED); if (unlikely(!__pyx_t_11)) __PYX_ERR(54, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SLICED, __pyx_t_11) < 0) __PYX_ERR(54, 7, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DM.pyx":8 * COMPOSITE = S_(DMCOMPOSITE) * SLICED = S_(DMSLICED) * SHELL = S_(DMSHELL) # <<<<<<<<<<<<<< * PLEX = S_(DMPLEX) * REDUNDANT = S_(DMREDUNDANT) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(DMSHELL); if (unlikely(!__pyx_t_11)) __PYX_ERR(54, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SHELL, __pyx_t_11) < 0) __PYX_ERR(54, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DM.pyx":9 * SLICED = S_(DMSLICED) * SHELL = S_(DMSHELL) * PLEX = S_(DMPLEX) # <<<<<<<<<<<<<< * REDUNDANT = S_(DMREDUNDANT) * PATCH = S_(DMPATCH) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(DMPLEX); if (unlikely(!__pyx_t_11)) __PYX_ERR(54, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_PLEX, __pyx_t_11) < 0) __PYX_ERR(54, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DM.pyx":10 * SHELL = S_(DMSHELL) * PLEX = S_(DMPLEX) * REDUNDANT = S_(DMREDUNDANT) # <<<<<<<<<<<<<< * PATCH = S_(DMPATCH) * MOAB = S_(DMMOAB) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(DMREDUNDANT); if (unlikely(!__pyx_t_11)) __PYX_ERR(54, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_REDUNDANT, __pyx_t_11) < 0) __PYX_ERR(54, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DM.pyx":11 * PLEX = S_(DMPLEX) * REDUNDANT = S_(DMREDUNDANT) * PATCH = S_(DMPATCH) # <<<<<<<<<<<<<< * MOAB = S_(DMMOAB) * NETWORK = S_(DMNETWORK) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(DMPATCH); if (unlikely(!__pyx_t_11)) __PYX_ERR(54, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_PATCH, __pyx_t_11) < 0) __PYX_ERR(54, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DM.pyx":12 * REDUNDANT = S_(DMREDUNDANT) * PATCH = S_(DMPATCH) * MOAB = S_(DMMOAB) # <<<<<<<<<<<<<< * NETWORK = S_(DMNETWORK) * FOREST = S_(DMFOREST) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(DMMOAB); if (unlikely(!__pyx_t_11)) __PYX_ERR(54, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_MOAB, __pyx_t_11) < 0) __PYX_ERR(54, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DM.pyx":13 * PATCH = S_(DMPATCH) * MOAB = S_(DMMOAB) * NETWORK = S_(DMNETWORK) # <<<<<<<<<<<<<< * FOREST = S_(DMFOREST) * P4EST = S_(DMP4EST) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(DMNETWORK); if (unlikely(!__pyx_t_11)) __PYX_ERR(54, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_NETWORK, __pyx_t_11) < 0) __PYX_ERR(54, 13, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DM.pyx":14 * MOAB = S_(DMMOAB) * NETWORK = S_(DMNETWORK) * FOREST = S_(DMFOREST) # <<<<<<<<<<<<<< * P4EST = S_(DMP4EST) * P8EST = S_(DMP8EST) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(DMFOREST); if (unlikely(!__pyx_t_11)) __PYX_ERR(54, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_FOREST, __pyx_t_11) < 0) __PYX_ERR(54, 14, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DM.pyx":15 * NETWORK = S_(DMNETWORK) * FOREST = S_(DMFOREST) * P4EST = S_(DMP4EST) # <<<<<<<<<<<<<< * P8EST = S_(DMP8EST) * SWARM = S_(DMSWARM) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(DMP4EST); if (unlikely(!__pyx_t_11)) __PYX_ERR(54, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_P4EST, __pyx_t_11) < 0) __PYX_ERR(54, 15, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DM.pyx":16 * FOREST = S_(DMFOREST) * P4EST = S_(DMP4EST) * P8EST = S_(DMP8EST) # <<<<<<<<<<<<<< * SWARM = S_(DMSWARM) * PRODUCT = S_(DMPRODUCT) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(DMP8EST); if (unlikely(!__pyx_t_11)) __PYX_ERR(54, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_P8EST, __pyx_t_11) < 0) __PYX_ERR(54, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DM.pyx":17 * P4EST = S_(DMP4EST) * P8EST = S_(DMP8EST) * SWARM = S_(DMSWARM) # <<<<<<<<<<<<<< * PRODUCT = S_(DMPRODUCT) * STAG = S_(DMSTAG) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(DMSWARM); if (unlikely(!__pyx_t_11)) __PYX_ERR(54, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SWARM, __pyx_t_11) < 0) __PYX_ERR(54, 17, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DM.pyx":18 * P8EST = S_(DMP8EST) * SWARM = S_(DMSWARM) * PRODUCT = S_(DMPRODUCT) # <<<<<<<<<<<<<< * STAG = S_(DMSTAG) * */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(DMPRODUCT); if (unlikely(!__pyx_t_11)) __PYX_ERR(54, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_PRODUCT, __pyx_t_11) < 0) __PYX_ERR(54, 18, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DM.pyx":19 * SWARM = S_(DMSWARM) * PRODUCT = S_(DMPRODUCT) * STAG = S_(DMSTAG) # <<<<<<<<<<<<<< * * class DMBoundaryType(object): */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(DMSTAG); if (unlikely(!__pyx_t_11)) __PYX_ERR(54, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_STAG, __pyx_t_11) < 0) __PYX_ERR(54, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DM.pyx":3 * # -------------------------------------------------------------------- * * class DMType(object): # <<<<<<<<<<<<<< * """`DM` types.""" * DA = S_(DMDA_type) */ __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_DMType, __pyx_t_13, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(54, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_DMType, __pyx_t_11) < 0) __PYX_ERR(54, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/DM.pyx":21 * STAG = S_(DMSTAG) * * class DMBoundaryType(object): # <<<<<<<<<<<<<< * """`DM` Boundary types.""" * NONE = DM_BOUNDARY_NONE */ __pyx_t_13 = __Pyx_PEP560_update_bases(__pyx_tuple__217); if (unlikely(!__pyx_t_13)) __PYX_ERR(54, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(54, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_13, __pyx_n_s_DMBoundaryType, __pyx_n_s_DMBoundaryType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, __pyx_kp_s_DM_Boundary_types); if (unlikely(!__pyx_t_12)) __PYX_ERR(54, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_13 != __pyx_tuple__217) { if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_tuple__217) < 0))) __PYX_ERR(54, 21, __pyx_L1_error) } /* "petsc4py/PETSc/DM.pyx":23 * class DMBoundaryType(object): * """`DM` Boundary types.""" * NONE = DM_BOUNDARY_NONE # <<<<<<<<<<<<<< * GHOSTED = DM_BOUNDARY_GHOSTED * MIRROR = DM_BOUNDARY_MIRROR */ __pyx_t_11 = __Pyx_PyInt_From_DMBoundaryType(DM_BOUNDARY_NONE); if (unlikely(!__pyx_t_11)) __PYX_ERR(54, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_NONE, __pyx_t_11) < 0) __PYX_ERR(54, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DM.pyx":24 * """`DM` Boundary types.""" * NONE = DM_BOUNDARY_NONE * GHOSTED = DM_BOUNDARY_GHOSTED # <<<<<<<<<<<<<< * MIRROR = DM_BOUNDARY_MIRROR * PERIODIC = DM_BOUNDARY_PERIODIC */ __pyx_t_11 = __Pyx_PyInt_From_DMBoundaryType(DM_BOUNDARY_GHOSTED); if (unlikely(!__pyx_t_11)) __PYX_ERR(54, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_GHOSTED, __pyx_t_11) < 0) __PYX_ERR(54, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DM.pyx":25 * NONE = DM_BOUNDARY_NONE * GHOSTED = DM_BOUNDARY_GHOSTED * MIRROR = DM_BOUNDARY_MIRROR # <<<<<<<<<<<<<< * PERIODIC = DM_BOUNDARY_PERIODIC * TWIST = DM_BOUNDARY_TWIST */ __pyx_t_11 = __Pyx_PyInt_From_DMBoundaryType(DM_BOUNDARY_MIRROR); if (unlikely(!__pyx_t_11)) __PYX_ERR(54, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_MIRROR, __pyx_t_11) < 0) __PYX_ERR(54, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DM.pyx":26 * GHOSTED = DM_BOUNDARY_GHOSTED * MIRROR = DM_BOUNDARY_MIRROR * PERIODIC = DM_BOUNDARY_PERIODIC # <<<<<<<<<<<<<< * TWIST = DM_BOUNDARY_TWIST * */ __pyx_t_11 = __Pyx_PyInt_From_DMBoundaryType(DM_BOUNDARY_PERIODIC); if (unlikely(!__pyx_t_11)) __PYX_ERR(54, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_PERIODIC, __pyx_t_11) < 0) __PYX_ERR(54, 26, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DM.pyx":27 * MIRROR = DM_BOUNDARY_MIRROR * PERIODIC = DM_BOUNDARY_PERIODIC * TWIST = DM_BOUNDARY_TWIST # <<<<<<<<<<<<<< * * class DMPolytopeType(object): */ __pyx_t_11 = __Pyx_PyInt_From_DMBoundaryType(DM_BOUNDARY_TWIST); if (unlikely(!__pyx_t_11)) __PYX_ERR(54, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_TWIST, __pyx_t_11) < 0) __PYX_ERR(54, 27, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DM.pyx":21 * STAG = S_(DMSTAG) * * class DMBoundaryType(object): # <<<<<<<<<<<<<< * """`DM` Boundary types.""" * NONE = DM_BOUNDARY_NONE */ __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_DMBoundaryType, __pyx_t_13, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(54, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_DMBoundaryType, __pyx_t_11) < 0) __PYX_ERR(54, 21, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/DM.pyx":29 * TWIST = DM_BOUNDARY_TWIST * * class DMPolytopeType(object): # <<<<<<<<<<<<<< * POINT = DM_POLYTOPE_POINT * SEGMENT = DM_POLYTOPE_SEGMENT */ __pyx_t_13 = __Pyx_PEP560_update_bases(__pyx_tuple__219); if (unlikely(!__pyx_t_13)) __PYX_ERR(54, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(54, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_13, __pyx_n_s_DMPolytopeType, __pyx_n_s_DMPolytopeType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(54, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_13 != __pyx_tuple__219) { if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_tuple__219) < 0))) __PYX_ERR(54, 29, __pyx_L1_error) } /* "petsc4py/PETSc/DM.pyx":30 * * class DMPolytopeType(object): * POINT = DM_POLYTOPE_POINT # <<<<<<<<<<<<<< * SEGMENT = DM_POLYTOPE_SEGMENT * POINT_PRISM_TENSOR = DM_POLYTOPE_POINT_PRISM_TENSOR */ __pyx_t_11 = __Pyx_PyInt_From_DMPolytopeType(DM_POLYTOPE_POINT); if (unlikely(!__pyx_t_11)) __PYX_ERR(54, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_POINT, __pyx_t_11) < 0) __PYX_ERR(54, 30, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DM.pyx":31 * class DMPolytopeType(object): * POINT = DM_POLYTOPE_POINT * SEGMENT = DM_POLYTOPE_SEGMENT # <<<<<<<<<<<<<< * POINT_PRISM_TENSOR = DM_POLYTOPE_POINT_PRISM_TENSOR * TRIANGLE = DM_POLYTOPE_TRIANGLE */ __pyx_t_11 = __Pyx_PyInt_From_DMPolytopeType(DM_POLYTOPE_SEGMENT); if (unlikely(!__pyx_t_11)) __PYX_ERR(54, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SEGMENT, __pyx_t_11) < 0) __PYX_ERR(54, 31, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DM.pyx":32 * POINT = DM_POLYTOPE_POINT * SEGMENT = DM_POLYTOPE_SEGMENT * POINT_PRISM_TENSOR = DM_POLYTOPE_POINT_PRISM_TENSOR # <<<<<<<<<<<<<< * TRIANGLE = DM_POLYTOPE_TRIANGLE * QUADRILATERAL = DM_POLYTOPE_QUADRILATERAL */ __pyx_t_11 = __Pyx_PyInt_From_DMPolytopeType(DM_POLYTOPE_POINT_PRISM_TENSOR); if (unlikely(!__pyx_t_11)) __PYX_ERR(54, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_POINT_PRISM_TENSOR, __pyx_t_11) < 0) __PYX_ERR(54, 32, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DM.pyx":33 * SEGMENT = DM_POLYTOPE_SEGMENT * POINT_PRISM_TENSOR = DM_POLYTOPE_POINT_PRISM_TENSOR * TRIANGLE = DM_POLYTOPE_TRIANGLE # <<<<<<<<<<<<<< * QUADRILATERAL = DM_POLYTOPE_QUADRILATERAL * SEG_PRISM_TENSOR = DM_POLYTOPE_SEG_PRISM_TENSOR */ __pyx_t_11 = __Pyx_PyInt_From_DMPolytopeType(DM_POLYTOPE_TRIANGLE); if (unlikely(!__pyx_t_11)) __PYX_ERR(54, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_TRIANGLE, __pyx_t_11) < 0) __PYX_ERR(54, 33, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DM.pyx":34 * POINT_PRISM_TENSOR = DM_POLYTOPE_POINT_PRISM_TENSOR * TRIANGLE = DM_POLYTOPE_TRIANGLE * QUADRILATERAL = DM_POLYTOPE_QUADRILATERAL # <<<<<<<<<<<<<< * SEG_PRISM_TENSOR = DM_POLYTOPE_SEG_PRISM_TENSOR * TETRAHEDRON = DM_POLYTOPE_TETRAHEDRON */ __pyx_t_11 = __Pyx_PyInt_From_DMPolytopeType(DM_POLYTOPE_QUADRILATERAL); if (unlikely(!__pyx_t_11)) __PYX_ERR(54, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_QUADRILATERAL, __pyx_t_11) < 0) __PYX_ERR(54, 34, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DM.pyx":35 * TRIANGLE = DM_POLYTOPE_TRIANGLE * QUADRILATERAL = DM_POLYTOPE_QUADRILATERAL * SEG_PRISM_TENSOR = DM_POLYTOPE_SEG_PRISM_TENSOR # <<<<<<<<<<<<<< * TETRAHEDRON = DM_POLYTOPE_TETRAHEDRON * HEXAHEDRON = DM_POLYTOPE_HEXAHEDRON */ __pyx_t_11 = __Pyx_PyInt_From_DMPolytopeType(DM_POLYTOPE_SEG_PRISM_TENSOR); if (unlikely(!__pyx_t_11)) __PYX_ERR(54, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SEG_PRISM_TENSOR, __pyx_t_11) < 0) __PYX_ERR(54, 35, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DM.pyx":36 * QUADRILATERAL = DM_POLYTOPE_QUADRILATERAL * SEG_PRISM_TENSOR = DM_POLYTOPE_SEG_PRISM_TENSOR * TETRAHEDRON = DM_POLYTOPE_TETRAHEDRON # <<<<<<<<<<<<<< * HEXAHEDRON = DM_POLYTOPE_HEXAHEDRON * TRI_PRISM = DM_POLYTOPE_TRI_PRISM */ __pyx_t_11 = __Pyx_PyInt_From_DMPolytopeType(DM_POLYTOPE_TETRAHEDRON); if (unlikely(!__pyx_t_11)) __PYX_ERR(54, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_TETRAHEDRON, __pyx_t_11) < 0) __PYX_ERR(54, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DM.pyx":37 * SEG_PRISM_TENSOR = DM_POLYTOPE_SEG_PRISM_TENSOR * TETRAHEDRON = DM_POLYTOPE_TETRAHEDRON * HEXAHEDRON = DM_POLYTOPE_HEXAHEDRON # <<<<<<<<<<<<<< * TRI_PRISM = DM_POLYTOPE_TRI_PRISM * TRI_PRISM_TENSOR = DM_POLYTOPE_TRI_PRISM_TENSOR */ __pyx_t_11 = __Pyx_PyInt_From_DMPolytopeType(DM_POLYTOPE_HEXAHEDRON); if (unlikely(!__pyx_t_11)) __PYX_ERR(54, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_HEXAHEDRON, __pyx_t_11) < 0) __PYX_ERR(54, 37, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DM.pyx":38 * TETRAHEDRON = DM_POLYTOPE_TETRAHEDRON * HEXAHEDRON = DM_POLYTOPE_HEXAHEDRON * TRI_PRISM = DM_POLYTOPE_TRI_PRISM # <<<<<<<<<<<<<< * TRI_PRISM_TENSOR = DM_POLYTOPE_TRI_PRISM_TENSOR * QUAD_PRISM_TENSOR = DM_POLYTOPE_QUAD_PRISM_TENSOR */ __pyx_t_11 = __Pyx_PyInt_From_DMPolytopeType(DM_POLYTOPE_TRI_PRISM); if (unlikely(!__pyx_t_11)) __PYX_ERR(54, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_TRI_PRISM, __pyx_t_11) < 0) __PYX_ERR(54, 38, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DM.pyx":39 * HEXAHEDRON = DM_POLYTOPE_HEXAHEDRON * TRI_PRISM = DM_POLYTOPE_TRI_PRISM * TRI_PRISM_TENSOR = DM_POLYTOPE_TRI_PRISM_TENSOR # <<<<<<<<<<<<<< * QUAD_PRISM_TENSOR = DM_POLYTOPE_QUAD_PRISM_TENSOR * PYRAMID = DM_POLYTOPE_PYRAMID */ __pyx_t_11 = __Pyx_PyInt_From_DMPolytopeType(DM_POLYTOPE_TRI_PRISM_TENSOR); if (unlikely(!__pyx_t_11)) __PYX_ERR(54, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_TRI_PRISM_TENSOR, __pyx_t_11) < 0) __PYX_ERR(54, 39, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DM.pyx":40 * TRI_PRISM = DM_POLYTOPE_TRI_PRISM * TRI_PRISM_TENSOR = DM_POLYTOPE_TRI_PRISM_TENSOR * QUAD_PRISM_TENSOR = DM_POLYTOPE_QUAD_PRISM_TENSOR # <<<<<<<<<<<<<< * PYRAMID = DM_POLYTOPE_PYRAMID * FV_GHOST = DM_POLYTOPE_FV_GHOST */ __pyx_t_11 = __Pyx_PyInt_From_DMPolytopeType(DM_POLYTOPE_QUAD_PRISM_TENSOR); if (unlikely(!__pyx_t_11)) __PYX_ERR(54, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_QUAD_PRISM_TENSOR, __pyx_t_11) < 0) __PYX_ERR(54, 40, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DM.pyx":41 * TRI_PRISM_TENSOR = DM_POLYTOPE_TRI_PRISM_TENSOR * QUAD_PRISM_TENSOR = DM_POLYTOPE_QUAD_PRISM_TENSOR * PYRAMID = DM_POLYTOPE_PYRAMID # <<<<<<<<<<<<<< * FV_GHOST = DM_POLYTOPE_FV_GHOST * INTERIOR_GHOST = DM_POLYTOPE_INTERIOR_GHOST */ __pyx_t_11 = __Pyx_PyInt_From_DMPolytopeType(DM_POLYTOPE_PYRAMID); if (unlikely(!__pyx_t_11)) __PYX_ERR(54, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_PYRAMID, __pyx_t_11) < 0) __PYX_ERR(54, 41, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DM.pyx":42 * QUAD_PRISM_TENSOR = DM_POLYTOPE_QUAD_PRISM_TENSOR * PYRAMID = DM_POLYTOPE_PYRAMID * FV_GHOST = DM_POLYTOPE_FV_GHOST # <<<<<<<<<<<<<< * INTERIOR_GHOST = DM_POLYTOPE_INTERIOR_GHOST * UNKNOWN = DM_POLYTOPE_UNKNOWN */ __pyx_t_11 = __Pyx_PyInt_From_DMPolytopeType(DM_POLYTOPE_FV_GHOST); if (unlikely(!__pyx_t_11)) __PYX_ERR(54, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_FV_GHOST, __pyx_t_11) < 0) __PYX_ERR(54, 42, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DM.pyx":43 * PYRAMID = DM_POLYTOPE_PYRAMID * FV_GHOST = DM_POLYTOPE_FV_GHOST * INTERIOR_GHOST = DM_POLYTOPE_INTERIOR_GHOST # <<<<<<<<<<<<<< * UNKNOWN = DM_POLYTOPE_UNKNOWN * */ __pyx_t_11 = __Pyx_PyInt_From_DMPolytopeType(DM_POLYTOPE_INTERIOR_GHOST); if (unlikely(!__pyx_t_11)) __PYX_ERR(54, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_INTERIOR_GHOST, __pyx_t_11) < 0) __PYX_ERR(54, 43, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DM.pyx":44 * FV_GHOST = DM_POLYTOPE_FV_GHOST * INTERIOR_GHOST = DM_POLYTOPE_INTERIOR_GHOST * UNKNOWN = DM_POLYTOPE_UNKNOWN # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_t_11 = __Pyx_PyInt_From_DMPolytopeType(DM_POLYTOPE_UNKNOWN); if (unlikely(!__pyx_t_11)) __PYX_ERR(54, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_UNKNOWN, __pyx_t_11) < 0) __PYX_ERR(54, 44, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DM.pyx":29 * TWIST = DM_BOUNDARY_TWIST * * class DMPolytopeType(object): # <<<<<<<<<<<<<< * POINT = DM_POLYTOPE_POINT * SEGMENT = DM_POLYTOPE_SEGMENT */ __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_DMPolytopeType, __pyx_t_13, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(54, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_DMPolytopeType, __pyx_t_11) < 0) __PYX_ERR(54, 29, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/DM.pyx":53 * """ * * Type = DMType # <<<<<<<<<<<<<< * BoundaryType = DMBoundaryType * PolytopeType = DMPolytopeType */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_DMType); if (unlikely(!__pyx_t_13)) __PYX_ERR(54, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_n_s_Type, __pyx_t_13) < 0) __PYX_ERR(54, 53, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_DM); /* "petsc4py/PETSc/DM.pyx":54 * * Type = DMType * BoundaryType = DMBoundaryType # <<<<<<<<<<<<<< * PolytopeType = DMPolytopeType * */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_DMBoundaryType); if (unlikely(!__pyx_t_13)) __PYX_ERR(54, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_n_s_BoundaryType, __pyx_t_13) < 0) __PYX_ERR(54, 54, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_DM); /* "petsc4py/PETSc/DM.pyx":55 * Type = DMType * BoundaryType = DMBoundaryType * PolytopeType = DMPolytopeType # <<<<<<<<<<<<<< * * # */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_DMPolytopeType); if (unlikely(!__pyx_t_13)) __PYX_ERR(54, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_n_s_PolytopeType, __pyx_t_13) < 0) __PYX_ERR(54, 55, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_DM); /* "petsc4py/PETSc/DM.pyx":1554 * return sec * * setSection = setLocalSection # <<<<<<<<<<<<<< * getSection = getLocalSection * setDefaultSection = setLocalSection */ __Pyx_GetNameInClass(__pyx_t_13, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_n_s_setLocalSection); if (unlikely(!__pyx_t_13)) __PYX_ERR(54, 1554, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_n_s_setSection, __pyx_t_13) < 0) __PYX_ERR(54, 1554, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_DM); /* "petsc4py/PETSc/DM.pyx":1555 * * setSection = setLocalSection * getSection = getLocalSection # <<<<<<<<<<<<<< * setDefaultSection = setLocalSection * getDefaultSection = getLocalSection */ __Pyx_GetNameInClass(__pyx_t_13, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_n_s_getLocalSection); if (unlikely(!__pyx_t_13)) __PYX_ERR(54, 1555, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_n_s_getSection, __pyx_t_13) < 0) __PYX_ERR(54, 1555, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_DM); /* "petsc4py/PETSc/DM.pyx":1556 * setSection = setLocalSection * getSection = getLocalSection * setDefaultSection = setLocalSection # <<<<<<<<<<<<<< * getDefaultSection = getLocalSection * setDefaultLocalSection = setLocalSection */ __Pyx_GetNameInClass(__pyx_t_13, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_n_s_setLocalSection); if (unlikely(!__pyx_t_13)) __PYX_ERR(54, 1556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_n_s_setDefaultSection, __pyx_t_13) < 0) __PYX_ERR(54, 1556, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_DM); /* "petsc4py/PETSc/DM.pyx":1557 * getSection = getLocalSection * setDefaultSection = setLocalSection * getDefaultSection = getLocalSection # <<<<<<<<<<<<<< * setDefaultLocalSection = setLocalSection * getDefaultLocalSection = getLocalSection */ __Pyx_GetNameInClass(__pyx_t_13, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_n_s_getLocalSection); if (unlikely(!__pyx_t_13)) __PYX_ERR(54, 1557, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_n_s_getDefaultSection, __pyx_t_13) < 0) __PYX_ERR(54, 1557, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_DM); /* "petsc4py/PETSc/DM.pyx":1558 * setDefaultSection = setLocalSection * getDefaultSection = getLocalSection * setDefaultLocalSection = setLocalSection # <<<<<<<<<<<<<< * getDefaultLocalSection = getLocalSection * setDefaultGlobalSection = setGlobalSection */ __Pyx_GetNameInClass(__pyx_t_13, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_n_s_setLocalSection); if (unlikely(!__pyx_t_13)) __PYX_ERR(54, 1558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_n_s_setDefaultLocalSection, __pyx_t_13) < 0) __PYX_ERR(54, 1558, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_DM); /* "petsc4py/PETSc/DM.pyx":1559 * getDefaultSection = getLocalSection * setDefaultLocalSection = setLocalSection * getDefaultLocalSection = getLocalSection # <<<<<<<<<<<<<< * setDefaultGlobalSection = setGlobalSection * getDefaultGlobalSection = getGlobalSection */ __Pyx_GetNameInClass(__pyx_t_13, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_n_s_getLocalSection); if (unlikely(!__pyx_t_13)) __PYX_ERR(54, 1559, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_n_s_getDefaultLocalSection, __pyx_t_13) < 0) __PYX_ERR(54, 1559, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_DM); /* "petsc4py/PETSc/DM.pyx":1560 * setDefaultLocalSection = setLocalSection * getDefaultLocalSection = getLocalSection * setDefaultGlobalSection = setGlobalSection # <<<<<<<<<<<<<< * getDefaultGlobalSection = getGlobalSection * */ __Pyx_GetNameInClass(__pyx_t_13, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_n_s_setGlobalSection); if (unlikely(!__pyx_t_13)) __PYX_ERR(54, 1560, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_n_s_setDefaultGlobalSection, __pyx_t_13) < 0) __PYX_ERR(54, 1560, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_DM); /* "petsc4py/PETSc/DM.pyx":1561 * getDefaultLocalSection = getLocalSection * setDefaultGlobalSection = setGlobalSection * getDefaultGlobalSection = getGlobalSection # <<<<<<<<<<<<<< * * def createSectionSF(self, Section localsec, Section globalsec) -> None: */ __Pyx_GetNameInClass(__pyx_t_13, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_n_s_getGlobalSection); if (unlikely(!__pyx_t_13)) __PYX_ERR(54, 1561, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_n_s_getDefaultGlobalSection, __pyx_t_13) < 0) __PYX_ERR(54, 1561, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_DM); /* "petsc4py/PETSc/DM.pyx":1607 * CHKERR( DMSetSectionSF(self.dm, sf.sf) ) * * createDefaultSF = createSectionSF # <<<<<<<<<<<<<< * getDefaultSF = getSectionSF * setDefaultSF = setSectionSF */ __Pyx_GetNameInClass(__pyx_t_13, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_n_s_createSectionSF); if (unlikely(!__pyx_t_13)) __PYX_ERR(54, 1607, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_n_s_createDefaultSF, __pyx_t_13) < 0) __PYX_ERR(54, 1607, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_DM); /* "petsc4py/PETSc/DM.pyx":1608 * * createDefaultSF = createSectionSF * getDefaultSF = getSectionSF # <<<<<<<<<<<<<< * setDefaultSF = setSectionSF * */ __Pyx_GetNameInClass(__pyx_t_13, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_n_s_getSectionSF); if (unlikely(!__pyx_t_13)) __PYX_ERR(54, 1608, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_n_s_getDefaultSF, __pyx_t_13) < 0) __PYX_ERR(54, 1608, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_DM); /* "petsc4py/PETSc/DM.pyx":1609 * createDefaultSF = createSectionSF * getDefaultSF = getSectionSF * setDefaultSF = setSectionSF # <<<<<<<<<<<<<< * * def getPointSF(self) -> SF: */ __Pyx_GetNameInClass(__pyx_t_13, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_n_s_setSectionSF); if (unlikely(!__pyx_t_13)) __PYX_ERR(54, 1609, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_n_s_setDefaultSF, __pyx_t_13) < 0) __PYX_ERR(54, 1609, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_DM); /* "petsc4py/PETSc/DM.pyx":1957 * * # backward compatibility * createGlobalVector = createGlobalVec # <<<<<<<<<<<<<< * createLocalVector = createLocalVec * getMatrix = createMatrix = createMat */ __Pyx_GetNameInClass(__pyx_t_13, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_n_s_createGlobalVec); if (unlikely(!__pyx_t_13)) __PYX_ERR(54, 1957, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_n_s_createGlobalVector, __pyx_t_13) < 0) __PYX_ERR(54, 1957, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_DM); /* "petsc4py/PETSc/DM.pyx":1958 * # backward compatibility * createGlobalVector = createGlobalVec * createLocalVector = createLocalVec # <<<<<<<<<<<<<< * getMatrix = createMatrix = createMat * */ __Pyx_GetNameInClass(__pyx_t_13, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_n_s_createLocalVec); if (unlikely(!__pyx_t_13)) __PYX_ERR(54, 1958, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_n_s_createLocalVector, __pyx_t_13) < 0) __PYX_ERR(54, 1958, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_DM); /* "petsc4py/PETSc/DM.pyx":1959 * createGlobalVector = createGlobalVec * createLocalVector = createLocalVec * getMatrix = createMatrix = createMat # <<<<<<<<<<<<<< * * def setKSPComputeOperators( */ __Pyx_GetNameInClass(__pyx_t_13, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_n_s_createMat); if (unlikely(!__pyx_t_13)) __PYX_ERR(54, 1959, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_n_s_getMatrix, __pyx_t_13) < 0) __PYX_ERR(54, 1959, __pyx_L1_error) PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_DM); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_n_s_createMatrix, __pyx_t_13) < 0) __PYX_ERR(54, 1959, __pyx_L1_error) PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_DM); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/DM.pyx":2173 * # -------------------------------------------------------------------- * * del DMType # <<<<<<<<<<<<<< * del DMBoundaryType * del DMPolytopeType */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_DMType) < 0) __PYX_ERR(54, 2173, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":2174 * * del DMType * del DMBoundaryType # <<<<<<<<<<<<<< * del DMPolytopeType * */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_DMBoundaryType) < 0) __PYX_ERR(54, 2174, __pyx_L1_error) /* "petsc4py/PETSc/DM.pyx":2175 * del DMType * del DMBoundaryType * del DMPolytopeType # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_DMPolytopeType) < 0) __PYX_ERR(54, 2175, __pyx_L1_error) /* "petsc4py/PETSc/DS.pyx":3 * # -------------------------------------------------------------------- * * class DSType(object): # <<<<<<<<<<<<<< * BASIC = S_(PETSCDSBASIC) * */ __pyx_t_13 = __Pyx_PEP560_update_bases(__pyx_tuple__221); if (unlikely(!__pyx_t_13)) __PYX_ERR(55, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(55, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_13, __pyx_n_s_DSType, __pyx_n_s_DSType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(55, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_13 != __pyx_tuple__221) { if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_tuple__221) < 0))) __PYX_ERR(55, 3, __pyx_L1_error) } /* "petsc4py/PETSc/DS.pyx":4 * * class DSType(object): * BASIC = S_(PETSCDSBASIC) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PETSCDSBASIC); if (unlikely(!__pyx_t_11)) __PYX_ERR(55, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_BASIC, __pyx_t_11) < 0) __PYX_ERR(55, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DS.pyx":3 * # -------------------------------------------------------------------- * * class DSType(object): # <<<<<<<<<<<<<< * BASIC = S_(PETSCDSBASIC) * */ __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_DSType, __pyx_t_13, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(55, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_DSType, __pyx_t_11) < 0) __PYX_ERR(55, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/DS.pyx":11 * """Discrete System object.""" * * Type = DSType # <<<<<<<<<<<<<< * * # */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_DSType); if (unlikely(!__pyx_t_13)) __PYX_ERR(55, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DS, __pyx_n_s_Type, __pyx_t_13) < 0) __PYX_ERR(55, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_DS); /* "petsc4py/PETSc/DS.pyx":284 * # -------------------------------------------------------------------- * * del DSType # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_DSType) < 0) __PYX_ERR(55, 284, __pyx_L1_error) /* "petsc4py/PETSc/DMDA.pyx":3 * # -------------------------------------------------------------------- * * class DMDAStencilType(object): # <<<<<<<<<<<<<< * STAR = DMDA_STENCIL_STAR * BOX = DMDA_STENCIL_BOX */ __pyx_t_13 = __Pyx_PEP560_update_bases(__pyx_tuple__223); if (unlikely(!__pyx_t_13)) __PYX_ERR(56, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(56, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_13, __pyx_n_s_DMDAStencilType, __pyx_n_s_DMDAStencilType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(56, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_13 != __pyx_tuple__223) { if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_tuple__223) < 0))) __PYX_ERR(56, 3, __pyx_L1_error) } /* "petsc4py/PETSc/DMDA.pyx":4 * * class DMDAStencilType(object): * STAR = DMDA_STENCIL_STAR # <<<<<<<<<<<<<< * BOX = DMDA_STENCIL_BOX * */ __pyx_t_11 = __Pyx_PyInt_From_DMDAStencilType(DMDA_STENCIL_STAR); if (unlikely(!__pyx_t_11)) __PYX_ERR(56, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_STAR, __pyx_t_11) < 0) __PYX_ERR(56, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DMDA.pyx":5 * class DMDAStencilType(object): * STAR = DMDA_STENCIL_STAR * BOX = DMDA_STENCIL_BOX # <<<<<<<<<<<<<< * * class DMDAInterpolationType(object): */ __pyx_t_11 = __Pyx_PyInt_From_DMDAStencilType(DMDA_STENCIL_BOX); if (unlikely(!__pyx_t_11)) __PYX_ERR(56, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_BOX, __pyx_t_11) < 0) __PYX_ERR(56, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DMDA.pyx":3 * # -------------------------------------------------------------------- * * class DMDAStencilType(object): # <<<<<<<<<<<<<< * STAR = DMDA_STENCIL_STAR * BOX = DMDA_STENCIL_BOX */ __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_DMDAStencilType, __pyx_t_13, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(56, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_DMDAStencilType, __pyx_t_11) < 0) __PYX_ERR(56, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/DMDA.pyx":7 * BOX = DMDA_STENCIL_BOX * * class DMDAInterpolationType(object): # <<<<<<<<<<<<<< * Q0 = DMDA_INTERPOLATION_Q0 * Q1 = DMDA_INTERPOLATION_Q1 */ __pyx_t_13 = __Pyx_PEP560_update_bases(__pyx_tuple__225); if (unlikely(!__pyx_t_13)) __PYX_ERR(56, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(56, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_13, __pyx_n_s_DMDAInterpolationType, __pyx_n_s_DMDAInterpolationType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(56, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_13 != __pyx_tuple__225) { if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_tuple__225) < 0))) __PYX_ERR(56, 7, __pyx_L1_error) } /* "petsc4py/PETSc/DMDA.pyx":8 * * class DMDAInterpolationType(object): * Q0 = DMDA_INTERPOLATION_Q0 # <<<<<<<<<<<<<< * Q1 = DMDA_INTERPOLATION_Q1 * */ __pyx_t_11 = __Pyx_PyInt_From_DMDAInterpolationType(DMDA_Q0); if (unlikely(!__pyx_t_11)) __PYX_ERR(56, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_Q0, __pyx_t_11) < 0) __PYX_ERR(56, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DMDA.pyx":9 * class DMDAInterpolationType(object): * Q0 = DMDA_INTERPOLATION_Q0 * Q1 = DMDA_INTERPOLATION_Q1 # <<<<<<<<<<<<<< * * class DMDAElementType(object): */ __pyx_t_11 = __Pyx_PyInt_From_DMDAInterpolationType(DMDA_Q1); if (unlikely(!__pyx_t_11)) __PYX_ERR(56, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_Q1, __pyx_t_11) < 0) __PYX_ERR(56, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DMDA.pyx":7 * BOX = DMDA_STENCIL_BOX * * class DMDAInterpolationType(object): # <<<<<<<<<<<<<< * Q0 = DMDA_INTERPOLATION_Q0 * Q1 = DMDA_INTERPOLATION_Q1 */ __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_DMDAInterpolationType, __pyx_t_13, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(56, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_DMDAInterpolationType, __pyx_t_11) < 0) __PYX_ERR(56, 7, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/DMDA.pyx":11 * Q1 = DMDA_INTERPOLATION_Q1 * * class DMDAElementType(object): # <<<<<<<<<<<<<< * P1 = DMDA_ELEMENT_P1 * Q1 = DMDA_ELEMENT_Q1 */ __pyx_t_13 = __Pyx_PEP560_update_bases(__pyx_tuple__227); if (unlikely(!__pyx_t_13)) __PYX_ERR(56, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(56, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_13, __pyx_n_s_DMDAElementType, __pyx_n_s_DMDAElementType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(56, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_13 != __pyx_tuple__227) { if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_tuple__227) < 0))) __PYX_ERR(56, 11, __pyx_L1_error) } /* "petsc4py/PETSc/DMDA.pyx":12 * * class DMDAElementType(object): * P1 = DMDA_ELEMENT_P1 # <<<<<<<<<<<<<< * Q1 = DMDA_ELEMENT_Q1 * */ __pyx_t_11 = __Pyx_PyInt_From_DMDAElementType(DMDA_ELEMENT_P1); if (unlikely(!__pyx_t_11)) __PYX_ERR(56, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_P1, __pyx_t_11) < 0) __PYX_ERR(56, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DMDA.pyx":13 * class DMDAElementType(object): * P1 = DMDA_ELEMENT_P1 * Q1 = DMDA_ELEMENT_Q1 # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_t_11 = __Pyx_PyInt_From_DMDAElementType(DMDA_ELEMENT_Q1); if (unlikely(!__pyx_t_11)) __PYX_ERR(56, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_Q1, __pyx_t_11) < 0) __PYX_ERR(56, 13, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DMDA.pyx":11 * Q1 = DMDA_INTERPOLATION_Q1 * * class DMDAElementType(object): # <<<<<<<<<<<<<< * P1 = DMDA_ELEMENT_P1 * Q1 = DMDA_ELEMENT_Q1 */ __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_DMDAElementType, __pyx_t_13, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(56, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_DMDAElementType, __pyx_t_11) < 0) __PYX_ERR(56, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/DMDA.pyx":20 * """A DM object that is used to manage data for a structured grid.""" * * StencilType = DMDAStencilType # <<<<<<<<<<<<<< * InterpolationType = DMDAInterpolationType * ElementType = DMDAElementType */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_DMDAStencilType); if (unlikely(!__pyx_t_13)) __PYX_ERR(56, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DMDA, __pyx_n_s_StencilType, __pyx_t_13) < 0) __PYX_ERR(56, 20, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_DMDA); /* "petsc4py/PETSc/DMDA.pyx":21 * * StencilType = DMDAStencilType * InterpolationType = DMDAInterpolationType # <<<<<<<<<<<<<< * ElementType = DMDAElementType * */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_DMDAInterpolationType); if (unlikely(!__pyx_t_13)) __PYX_ERR(56, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DMDA, __pyx_n_s_InterpolationType, __pyx_t_13) < 0) __PYX_ERR(56, 21, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_DMDA); /* "petsc4py/PETSc/DMDA.pyx":22 * StencilType = DMDAStencilType * InterpolationType = DMDAInterpolationType * ElementType = DMDAElementType # <<<<<<<<<<<<<< * * # */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_DMDAElementType); if (unlikely(!__pyx_t_13)) __PYX_ERR(56, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DMDA, __pyx_n_s_ElementType, __pyx_t_13) < 0) __PYX_ERR(56, 22, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_DMDA); /* "petsc4py/PETSc/DMDA.pyx":1162 * * # backward compatibility * createNaturalVector = createNaturalVec # <<<<<<<<<<<<<< * * */ __Pyx_GetNameInClass(__pyx_t_13, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_DMDA, __pyx_n_s_createNaturalVec); if (unlikely(!__pyx_t_13)) __PYX_ERR(56, 1162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DMDA, __pyx_n_s_createNaturalVector, __pyx_t_13) < 0) __PYX_ERR(56, 1162, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_DMDA); /* "petsc4py/PETSc/DMDA.pyx":1166 * * # backward compatibility alias * DA = DMDA # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_DA, ((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DMDA)) < 0) __PYX_ERR(56, 1166, __pyx_L1_error) /* "petsc4py/PETSc/DMDA.pyx":1170 * # -------------------------------------------------------------------- * * del DMDAStencilType # <<<<<<<<<<<<<< * del DMDAInterpolationType * del DMDAElementType */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_DMDAStencilType) < 0) __PYX_ERR(56, 1170, __pyx_L1_error) /* "petsc4py/PETSc/DMDA.pyx":1171 * * del DMDAStencilType * del DMDAInterpolationType # <<<<<<<<<<<<<< * del DMDAElementType * */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_DMDAInterpolationType) < 0) __PYX_ERR(56, 1171, __pyx_L1_error) /* "petsc4py/PETSc/DMDA.pyx":1172 * del DMDAStencilType * del DMDAInterpolationType * del DMDAElementType # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_DMDAElementType) < 0) __PYX_ERR(56, 1172, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":3 * # -------------------------------------------------------------------- * * class DMPlexReorderDefaultFlag(object): # <<<<<<<<<<<<<< * NOTSET = DMPLEX_REORDER_DEFAULT_NOTSET * FALSE = DMPLEX_REORDER_DEFAULT_FALSE */ __pyx_t_13 = __Pyx_PEP560_update_bases(__pyx_tuple__229); if (unlikely(!__pyx_t_13)) __PYX_ERR(57, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(57, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_13, __pyx_n_s_DMPlexReorderDefaultFlag, __pyx_n_s_DMPlexReorderDefaultFlag, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(57, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_13 != __pyx_tuple__229) { if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_tuple__229) < 0))) __PYX_ERR(57, 3, __pyx_L1_error) } /* "petsc4py/PETSc/DMPlex.pyx":4 * * class DMPlexReorderDefaultFlag(object): * NOTSET = DMPLEX_REORDER_DEFAULT_NOTSET # <<<<<<<<<<<<<< * FALSE = DMPLEX_REORDER_DEFAULT_FALSE * TRUE = DMPLEX_REORDER_DEFAULT_TRUE */ __pyx_t_11 = __Pyx_PyInt_From_DMPlexReorderDefaultFlag(DMPLEX_REORDER_DEFAULT_NOTSET); if (unlikely(!__pyx_t_11)) __PYX_ERR(57, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_NOTSET, __pyx_t_11) < 0) __PYX_ERR(57, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DMPlex.pyx":5 * class DMPlexReorderDefaultFlag(object): * NOTSET = DMPLEX_REORDER_DEFAULT_NOTSET * FALSE = DMPLEX_REORDER_DEFAULT_FALSE # <<<<<<<<<<<<<< * TRUE = DMPLEX_REORDER_DEFAULT_TRUE * */ __pyx_t_11 = __Pyx_PyInt_From_DMPlexReorderDefaultFlag(DMPLEX_REORDER_DEFAULT_FALSE); if (unlikely(!__pyx_t_11)) __PYX_ERR(57, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_FALSE, __pyx_t_11) < 0) __PYX_ERR(57, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DMPlex.pyx":6 * NOTSET = DMPLEX_REORDER_DEFAULT_NOTSET * FALSE = DMPLEX_REORDER_DEFAULT_FALSE * TRUE = DMPLEX_REORDER_DEFAULT_TRUE # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_t_11 = __Pyx_PyInt_From_DMPlexReorderDefaultFlag(DMPLEX_REORDER_DEFAULT_TRUE); if (unlikely(!__pyx_t_11)) __PYX_ERR(57, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_TRUE, __pyx_t_11) < 0) __PYX_ERR(57, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DMPlex.pyx":3 * # -------------------------------------------------------------------- * * class DMPlexReorderDefaultFlag(object): # <<<<<<<<<<<<<< * NOTSET = DMPLEX_REORDER_DEFAULT_NOTSET * FALSE = DMPLEX_REORDER_DEFAULT_FALSE */ __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_DMPlexReorderDefaultFlag, __pyx_t_13, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(57, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_DMPlexReorderDefaultFlag, __pyx_t_11) < 0) __PYX_ERR(57, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/DMPlex.pyx":17 * """ * * ReorderDefaultFlag = DMPlexReorderDefaultFlag # <<<<<<<<<<<<<< * """Flag indicating whether `DMPlex` is reordered by default.""" * */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_DMPlexReorderDefaultFlag); if (unlikely(!__pyx_t_13)) __PYX_ERR(57, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_n_s_ReorderDefaultFlag, __pyx_t_13) < 0) __PYX_ERR(57, 17, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_DMPlex); /* "petsc4py/PETSc/DMPlex.pyx":3280 * # -------------------------------------------------------------------- * * del DMPlexReorderDefaultFlag # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_DMPlexReorderDefaultFlag) < 0) __PYX_ERR(57, 3280, __pyx_L1_error) /* "petsc4py/PETSc/DMPlex.pyx":3283 * * # -------------------------------------------------------------------- * class DMPlexTransformType(object): # <<<<<<<<<<<<<< * REFINEREGULAR = S_(DMPLEXREFINEREGULAR) * REFINEALFELD = S_(DMPLEXREFINEALFELD) */ __pyx_t_13 = __Pyx_PEP560_update_bases(__pyx_tuple__231); if (unlikely(!__pyx_t_13)) __PYX_ERR(57, 3283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(57, 3283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_13, __pyx_n_s_DMPlexTransformType, __pyx_n_s_DMPlexTransformType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(57, 3283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_13 != __pyx_tuple__231) { if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_tuple__231) < 0))) __PYX_ERR(57, 3283, __pyx_L1_error) } /* "petsc4py/PETSc/DMPlex.pyx":3284 * # -------------------------------------------------------------------- * class DMPlexTransformType(object): * REFINEREGULAR = S_(DMPLEXREFINEREGULAR) # <<<<<<<<<<<<<< * REFINEALFELD = S_(DMPLEXREFINEALFELD) * REFINEPOWELLSABIN = S_(DMPLEXREFINEPOWELLSABIN) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(DMPLEXREFINEREGULAR); if (unlikely(!__pyx_t_11)) __PYX_ERR(57, 3284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_REFINEREGULAR, __pyx_t_11) < 0) __PYX_ERR(57, 3284, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DMPlex.pyx":3285 * class DMPlexTransformType(object): * REFINEREGULAR = S_(DMPLEXREFINEREGULAR) * REFINEALFELD = S_(DMPLEXREFINEALFELD) # <<<<<<<<<<<<<< * REFINEPOWELLSABIN = S_(DMPLEXREFINEPOWELLSABIN) * REFINEBOUNDARYLAYER = S_(DMPLEXREFINEBOUNDARYLAYER) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(DMPLEXREFINEALFELD); if (unlikely(!__pyx_t_11)) __PYX_ERR(57, 3285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_REFINEALFELD, __pyx_t_11) < 0) __PYX_ERR(57, 3285, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DMPlex.pyx":3286 * REFINEREGULAR = S_(DMPLEXREFINEREGULAR) * REFINEALFELD = S_(DMPLEXREFINEALFELD) * REFINEPOWELLSABIN = S_(DMPLEXREFINEPOWELLSABIN) # <<<<<<<<<<<<<< * REFINEBOUNDARYLAYER = S_(DMPLEXREFINEBOUNDARYLAYER) * REFINESBR = S_(DMPLEXREFINESBR) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(DMPLEXREFINEPOWELLSABIN); if (unlikely(!__pyx_t_11)) __PYX_ERR(57, 3286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_REFINEPOWELLSABIN, __pyx_t_11) < 0) __PYX_ERR(57, 3286, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DMPlex.pyx":3287 * REFINEALFELD = S_(DMPLEXREFINEALFELD) * REFINEPOWELLSABIN = S_(DMPLEXREFINEPOWELLSABIN) * REFINEBOUNDARYLAYER = S_(DMPLEXREFINEBOUNDARYLAYER) # <<<<<<<<<<<<<< * REFINESBR = S_(DMPLEXREFINESBR) * REFINETOBOX = S_(DMPLEXREFINETOBOX) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(DMPLEXREFINEBOUNDARYLAYER); if (unlikely(!__pyx_t_11)) __PYX_ERR(57, 3287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_REFINEBOUNDARYLAYER, __pyx_t_11) < 0) __PYX_ERR(57, 3287, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DMPlex.pyx":3288 * REFINEPOWELLSABIN = S_(DMPLEXREFINEPOWELLSABIN) * REFINEBOUNDARYLAYER = S_(DMPLEXREFINEBOUNDARYLAYER) * REFINESBR = S_(DMPLEXREFINESBR) # <<<<<<<<<<<<<< * REFINETOBOX = S_(DMPLEXREFINETOBOX) * REFINETOSIMPLEX = S_(DMPLEXREFINETOSIMPLEX) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(DMPLEXREFINESBR); if (unlikely(!__pyx_t_11)) __PYX_ERR(57, 3288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_REFINESBR, __pyx_t_11) < 0) __PYX_ERR(57, 3288, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DMPlex.pyx":3289 * REFINEBOUNDARYLAYER = S_(DMPLEXREFINEBOUNDARYLAYER) * REFINESBR = S_(DMPLEXREFINESBR) * REFINETOBOX = S_(DMPLEXREFINETOBOX) # <<<<<<<<<<<<<< * REFINETOSIMPLEX = S_(DMPLEXREFINETOSIMPLEX) * REFINE1D = S_(DMPLEXREFINE1D) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(DMPLEXREFINETOBOX); if (unlikely(!__pyx_t_11)) __PYX_ERR(57, 3289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_REFINETOBOX, __pyx_t_11) < 0) __PYX_ERR(57, 3289, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DMPlex.pyx":3290 * REFINESBR = S_(DMPLEXREFINESBR) * REFINETOBOX = S_(DMPLEXREFINETOBOX) * REFINETOSIMPLEX = S_(DMPLEXREFINETOSIMPLEX) # <<<<<<<<<<<<<< * REFINE1D = S_(DMPLEXREFINE1D) * EXTRUDE = S_(DMPLEXEXTRUDE) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(DMPLEXREFINETOSIMPLEX); if (unlikely(!__pyx_t_11)) __PYX_ERR(57, 3290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_REFINETOSIMPLEX, __pyx_t_11) < 0) __PYX_ERR(57, 3290, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DMPlex.pyx":3291 * REFINETOBOX = S_(DMPLEXREFINETOBOX) * REFINETOSIMPLEX = S_(DMPLEXREFINETOSIMPLEX) * REFINE1D = S_(DMPLEXREFINE1D) # <<<<<<<<<<<<<< * EXTRUDE = S_(DMPLEXEXTRUDE) * TRANSFORMFILTER = S_(DMPLEXTRANSFORMFILTER) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(DMPLEXREFINE1D); if (unlikely(!__pyx_t_11)) __PYX_ERR(57, 3291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_REFINE1D, __pyx_t_11) < 0) __PYX_ERR(57, 3291, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DMPlex.pyx":3292 * REFINETOSIMPLEX = S_(DMPLEXREFINETOSIMPLEX) * REFINE1D = S_(DMPLEXREFINE1D) * EXTRUDE = S_(DMPLEXEXTRUDE) # <<<<<<<<<<<<<< * TRANSFORMFILTER = S_(DMPLEXTRANSFORMFILTER) * */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(DMPLEXEXTRUDE); if (unlikely(!__pyx_t_11)) __PYX_ERR(57, 3292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_EXTRUDE, __pyx_t_11) < 0) __PYX_ERR(57, 3292, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DMPlex.pyx":3293 * REFINE1D = S_(DMPLEXREFINE1D) * EXTRUDE = S_(DMPLEXEXTRUDE) * TRANSFORMFILTER = S_(DMPLEXTRANSFORMFILTER) # <<<<<<<<<<<<<< * * cdef class DMPlexTransform(Object): */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(DMPLEXTRANSFORMFILTER); if (unlikely(!__pyx_t_11)) __PYX_ERR(57, 3293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_TRANSFORMFILTER, __pyx_t_11) < 0) __PYX_ERR(57, 3293, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DMPlex.pyx":3283 * * # -------------------------------------------------------------------- * class DMPlexTransformType(object): # <<<<<<<<<<<<<< * REFINEREGULAR = S_(DMPLEXREFINEREGULAR) * REFINEALFELD = S_(DMPLEXREFINEALFELD) */ __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_DMPlexTransformType, __pyx_t_13, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(57, 3283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_DMPlexTransformType, __pyx_t_11) < 0) __PYX_ERR(57, 3283, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/DMStag.pyx":3 * # -------------------------------------------------------------------- * * class DMStagStencilType(object): # <<<<<<<<<<<<<< * STAR = DMSTAG_STENCIL_STAR * BOX = DMSTAG_STENCIL_BOX */ __pyx_t_13 = __Pyx_PEP560_update_bases(__pyx_tuple__233); if (unlikely(!__pyx_t_13)) __PYX_ERR(58, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(58, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_13, __pyx_n_s_DMStagStencilType, __pyx_n_s_DMStagStencilType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(58, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_13 != __pyx_tuple__233) { if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_tuple__233) < 0))) __PYX_ERR(58, 3, __pyx_L1_error) } /* "petsc4py/PETSc/DMStag.pyx":4 * * class DMStagStencilType(object): * STAR = DMSTAG_STENCIL_STAR # <<<<<<<<<<<<<< * BOX = DMSTAG_STENCIL_BOX * NONE = DMSTAG_STENCIL_NONE */ __pyx_t_11 = __Pyx_PyInt_From_DMStagStencilType(DMSTAG_STENCIL_STAR); if (unlikely(!__pyx_t_11)) __PYX_ERR(58, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_STAR, __pyx_t_11) < 0) __PYX_ERR(58, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DMStag.pyx":5 * class DMStagStencilType(object): * STAR = DMSTAG_STENCIL_STAR * BOX = DMSTAG_STENCIL_BOX # <<<<<<<<<<<<<< * NONE = DMSTAG_STENCIL_NONE * */ __pyx_t_11 = __Pyx_PyInt_From_DMStagStencilType(DMSTAG_STENCIL_BOX); if (unlikely(!__pyx_t_11)) __PYX_ERR(58, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_BOX, __pyx_t_11) < 0) __PYX_ERR(58, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DMStag.pyx":6 * STAR = DMSTAG_STENCIL_STAR * BOX = DMSTAG_STENCIL_BOX * NONE = DMSTAG_STENCIL_NONE # <<<<<<<<<<<<<< * * class DMStagStencilLocation(object): */ __pyx_t_11 = __Pyx_PyInt_From_DMStagStencilType(DMSTAG_STENCIL_NONE); if (unlikely(!__pyx_t_11)) __PYX_ERR(58, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_NONE, __pyx_t_11) < 0) __PYX_ERR(58, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DMStag.pyx":3 * # -------------------------------------------------------------------- * * class DMStagStencilType(object): # <<<<<<<<<<<<<< * STAR = DMSTAG_STENCIL_STAR * BOX = DMSTAG_STENCIL_BOX */ __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_DMStagStencilType, __pyx_t_13, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(58, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_DMStagStencilType, __pyx_t_11) < 0) __PYX_ERR(58, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/DMStag.pyx":8 * NONE = DMSTAG_STENCIL_NONE * * class DMStagStencilLocation(object): # <<<<<<<<<<<<<< * NULLLOC = DMSTAG_NULL_LOCATION * BACK_DOWN_LEFT = DMSTAG_BACK_DOWN_LEFT */ __pyx_t_13 = __Pyx_PEP560_update_bases(__pyx_tuple__235); if (unlikely(!__pyx_t_13)) __PYX_ERR(58, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(58, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_13, __pyx_n_s_DMStagStencilLocation, __pyx_n_s_DMStagStencilLocation, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(58, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_13 != __pyx_tuple__235) { if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_tuple__235) < 0))) __PYX_ERR(58, 8, __pyx_L1_error) } /* "petsc4py/PETSc/DMStag.pyx":9 * * class DMStagStencilLocation(object): * NULLLOC = DMSTAG_NULL_LOCATION # <<<<<<<<<<<<<< * BACK_DOWN_LEFT = DMSTAG_BACK_DOWN_LEFT * BACK_DOWN = DMSTAG_BACK_DOWN */ __pyx_t_11 = __Pyx_PyInt_From_DMStagStencilLocation(DMSTAG_NULL_LOCATION); if (unlikely(!__pyx_t_11)) __PYX_ERR(58, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_NULLLOC, __pyx_t_11) < 0) __PYX_ERR(58, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DMStag.pyx":10 * class DMStagStencilLocation(object): * NULLLOC = DMSTAG_NULL_LOCATION * BACK_DOWN_LEFT = DMSTAG_BACK_DOWN_LEFT # <<<<<<<<<<<<<< * BACK_DOWN = DMSTAG_BACK_DOWN * BACK_DOWN_RIGHT = DMSTAG_BACK_DOWN_RIGHT */ __pyx_t_11 = __Pyx_PyInt_From_DMStagStencilLocation(DMSTAG_BACK_DOWN_LEFT); if (unlikely(!__pyx_t_11)) __PYX_ERR(58, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_BACK_DOWN_LEFT, __pyx_t_11) < 0) __PYX_ERR(58, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DMStag.pyx":11 * NULLLOC = DMSTAG_NULL_LOCATION * BACK_DOWN_LEFT = DMSTAG_BACK_DOWN_LEFT * BACK_DOWN = DMSTAG_BACK_DOWN # <<<<<<<<<<<<<< * BACK_DOWN_RIGHT = DMSTAG_BACK_DOWN_RIGHT * BACK_LEFT = DMSTAG_BACK_LEFT */ __pyx_t_11 = __Pyx_PyInt_From_DMStagStencilLocation(DMSTAG_BACK_DOWN); if (unlikely(!__pyx_t_11)) __PYX_ERR(58, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_BACK_DOWN, __pyx_t_11) < 0) __PYX_ERR(58, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DMStag.pyx":12 * BACK_DOWN_LEFT = DMSTAG_BACK_DOWN_LEFT * BACK_DOWN = DMSTAG_BACK_DOWN * BACK_DOWN_RIGHT = DMSTAG_BACK_DOWN_RIGHT # <<<<<<<<<<<<<< * BACK_LEFT = DMSTAG_BACK_LEFT * BACK = DMSTAG_BACK */ __pyx_t_11 = __Pyx_PyInt_From_DMStagStencilLocation(DMSTAG_BACK_DOWN_RIGHT); if (unlikely(!__pyx_t_11)) __PYX_ERR(58, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_BACK_DOWN_RIGHT, __pyx_t_11) < 0) __PYX_ERR(58, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DMStag.pyx":13 * BACK_DOWN = DMSTAG_BACK_DOWN * BACK_DOWN_RIGHT = DMSTAG_BACK_DOWN_RIGHT * BACK_LEFT = DMSTAG_BACK_LEFT # <<<<<<<<<<<<<< * BACK = DMSTAG_BACK * BACK_RIGHT = DMSTAG_BACK_RIGHT */ __pyx_t_11 = __Pyx_PyInt_From_DMStagStencilLocation(DMSTAG_BACK_LEFT); if (unlikely(!__pyx_t_11)) __PYX_ERR(58, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_BACK_LEFT, __pyx_t_11) < 0) __PYX_ERR(58, 13, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DMStag.pyx":14 * BACK_DOWN_RIGHT = DMSTAG_BACK_DOWN_RIGHT * BACK_LEFT = DMSTAG_BACK_LEFT * BACK = DMSTAG_BACK # <<<<<<<<<<<<<< * BACK_RIGHT = DMSTAG_BACK_RIGHT * BACK_UP_LEFT = DMSTAG_BACK_UP_LEFT */ __pyx_t_11 = __Pyx_PyInt_From_DMStagStencilLocation(DMSTAG_BACK); if (unlikely(!__pyx_t_11)) __PYX_ERR(58, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_BACK, __pyx_t_11) < 0) __PYX_ERR(58, 14, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DMStag.pyx":15 * BACK_LEFT = DMSTAG_BACK_LEFT * BACK = DMSTAG_BACK * BACK_RIGHT = DMSTAG_BACK_RIGHT # <<<<<<<<<<<<<< * BACK_UP_LEFT = DMSTAG_BACK_UP_LEFT * BACK_UP = DMSTAG_BACK_UP */ __pyx_t_11 = __Pyx_PyInt_From_DMStagStencilLocation(DMSTAG_BACK_RIGHT); if (unlikely(!__pyx_t_11)) __PYX_ERR(58, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_BACK_RIGHT, __pyx_t_11) < 0) __PYX_ERR(58, 15, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DMStag.pyx":16 * BACK = DMSTAG_BACK * BACK_RIGHT = DMSTAG_BACK_RIGHT * BACK_UP_LEFT = DMSTAG_BACK_UP_LEFT # <<<<<<<<<<<<<< * BACK_UP = DMSTAG_BACK_UP * BACK_UP_RIGHT = DMSTAG_BACK_UP_RIGHT */ __pyx_t_11 = __Pyx_PyInt_From_DMStagStencilLocation(DMSTAG_BACK_UP_LEFT); if (unlikely(!__pyx_t_11)) __PYX_ERR(58, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_BACK_UP_LEFT, __pyx_t_11) < 0) __PYX_ERR(58, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DMStag.pyx":17 * BACK_RIGHT = DMSTAG_BACK_RIGHT * BACK_UP_LEFT = DMSTAG_BACK_UP_LEFT * BACK_UP = DMSTAG_BACK_UP # <<<<<<<<<<<<<< * BACK_UP_RIGHT = DMSTAG_BACK_UP_RIGHT * DOWN_LEFT = DMSTAG_DOWN_LEFT */ __pyx_t_11 = __Pyx_PyInt_From_DMStagStencilLocation(DMSTAG_BACK_UP); if (unlikely(!__pyx_t_11)) __PYX_ERR(58, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_BACK_UP, __pyx_t_11) < 0) __PYX_ERR(58, 17, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DMStag.pyx":18 * BACK_UP_LEFT = DMSTAG_BACK_UP_LEFT * BACK_UP = DMSTAG_BACK_UP * BACK_UP_RIGHT = DMSTAG_BACK_UP_RIGHT # <<<<<<<<<<<<<< * DOWN_LEFT = DMSTAG_DOWN_LEFT * DOWN = DMSTAG_DOWN */ __pyx_t_11 = __Pyx_PyInt_From_DMStagStencilLocation(DMSTAG_BACK_UP_RIGHT); if (unlikely(!__pyx_t_11)) __PYX_ERR(58, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_BACK_UP_RIGHT, __pyx_t_11) < 0) __PYX_ERR(58, 18, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DMStag.pyx":19 * BACK_UP = DMSTAG_BACK_UP * BACK_UP_RIGHT = DMSTAG_BACK_UP_RIGHT * DOWN_LEFT = DMSTAG_DOWN_LEFT # <<<<<<<<<<<<<< * DOWN = DMSTAG_DOWN * DOWN_RIGHT = DMSTAG_DOWN_RIGHT */ __pyx_t_11 = __Pyx_PyInt_From_DMStagStencilLocation(DMSTAG_DOWN_LEFT); if (unlikely(!__pyx_t_11)) __PYX_ERR(58, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DOWN_LEFT, __pyx_t_11) < 0) __PYX_ERR(58, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DMStag.pyx":20 * BACK_UP_RIGHT = DMSTAG_BACK_UP_RIGHT * DOWN_LEFT = DMSTAG_DOWN_LEFT * DOWN = DMSTAG_DOWN # <<<<<<<<<<<<<< * DOWN_RIGHT = DMSTAG_DOWN_RIGHT * LEFT = DMSTAG_LEFT */ __pyx_t_11 = __Pyx_PyInt_From_DMStagStencilLocation(DMSTAG_DOWN); if (unlikely(!__pyx_t_11)) __PYX_ERR(58, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DOWN, __pyx_t_11) < 0) __PYX_ERR(58, 20, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DMStag.pyx":21 * DOWN_LEFT = DMSTAG_DOWN_LEFT * DOWN = DMSTAG_DOWN * DOWN_RIGHT = DMSTAG_DOWN_RIGHT # <<<<<<<<<<<<<< * LEFT = DMSTAG_LEFT * ELEMENT = DMSTAG_ELEMENT */ __pyx_t_11 = __Pyx_PyInt_From_DMStagStencilLocation(DMSTAG_DOWN_RIGHT); if (unlikely(!__pyx_t_11)) __PYX_ERR(58, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_DOWN_RIGHT, __pyx_t_11) < 0) __PYX_ERR(58, 21, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DMStag.pyx":22 * DOWN = DMSTAG_DOWN * DOWN_RIGHT = DMSTAG_DOWN_RIGHT * LEFT = DMSTAG_LEFT # <<<<<<<<<<<<<< * ELEMENT = DMSTAG_ELEMENT * RIGHT = DMSTAG_RIGHT */ __pyx_t_11 = __Pyx_PyInt_From_DMStagStencilLocation(DMSTAG_LEFT); if (unlikely(!__pyx_t_11)) __PYX_ERR(58, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_LEFT, __pyx_t_11) < 0) __PYX_ERR(58, 22, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DMStag.pyx":23 * DOWN_RIGHT = DMSTAG_DOWN_RIGHT * LEFT = DMSTAG_LEFT * ELEMENT = DMSTAG_ELEMENT # <<<<<<<<<<<<<< * RIGHT = DMSTAG_RIGHT * UP_LEFT = DMSTAG_UP_LEFT */ __pyx_t_11 = __Pyx_PyInt_From_DMStagStencilLocation(DMSTAG_ELEMENT); if (unlikely(!__pyx_t_11)) __PYX_ERR(58, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_ELEMENT, __pyx_t_11) < 0) __PYX_ERR(58, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DMStag.pyx":24 * LEFT = DMSTAG_LEFT * ELEMENT = DMSTAG_ELEMENT * RIGHT = DMSTAG_RIGHT # <<<<<<<<<<<<<< * UP_LEFT = DMSTAG_UP_LEFT * UP = DMSTAG_UP */ __pyx_t_11 = __Pyx_PyInt_From_DMStagStencilLocation(DMSTAG_RIGHT); if (unlikely(!__pyx_t_11)) __PYX_ERR(58, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_RIGHT, __pyx_t_11) < 0) __PYX_ERR(58, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DMStag.pyx":25 * ELEMENT = DMSTAG_ELEMENT * RIGHT = DMSTAG_RIGHT * UP_LEFT = DMSTAG_UP_LEFT # <<<<<<<<<<<<<< * UP = DMSTAG_UP * UP_RIGHT = DMSTAG_UP_RIGHT */ __pyx_t_11 = __Pyx_PyInt_From_DMStagStencilLocation(DMSTAG_UP_LEFT); if (unlikely(!__pyx_t_11)) __PYX_ERR(58, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_UP_LEFT, __pyx_t_11) < 0) __PYX_ERR(58, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DMStag.pyx":26 * RIGHT = DMSTAG_RIGHT * UP_LEFT = DMSTAG_UP_LEFT * UP = DMSTAG_UP # <<<<<<<<<<<<<< * UP_RIGHT = DMSTAG_UP_RIGHT * FRONT_DOWN_LEFT = DMSTAG_FRONT_DOWN_LEFT */ __pyx_t_11 = __Pyx_PyInt_From_DMStagStencilLocation(DMSTAG_UP); if (unlikely(!__pyx_t_11)) __PYX_ERR(58, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_UP, __pyx_t_11) < 0) __PYX_ERR(58, 26, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DMStag.pyx":27 * UP_LEFT = DMSTAG_UP_LEFT * UP = DMSTAG_UP * UP_RIGHT = DMSTAG_UP_RIGHT # <<<<<<<<<<<<<< * FRONT_DOWN_LEFT = DMSTAG_FRONT_DOWN_LEFT * FRONT_DOWN = DMSTAG_FRONT_DOWN */ __pyx_t_11 = __Pyx_PyInt_From_DMStagStencilLocation(DMSTAG_UP_RIGHT); if (unlikely(!__pyx_t_11)) __PYX_ERR(58, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_UP_RIGHT, __pyx_t_11) < 0) __PYX_ERR(58, 27, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DMStag.pyx":28 * UP = DMSTAG_UP * UP_RIGHT = DMSTAG_UP_RIGHT * FRONT_DOWN_LEFT = DMSTAG_FRONT_DOWN_LEFT # <<<<<<<<<<<<<< * FRONT_DOWN = DMSTAG_FRONT_DOWN * FRONT_DOWN_RIGHT = DMSTAG_FRONT_DOWN_RIGHT */ __pyx_t_11 = __Pyx_PyInt_From_DMStagStencilLocation(DMSTAG_FRONT_DOWN_LEFT); if (unlikely(!__pyx_t_11)) __PYX_ERR(58, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_FRONT_DOWN_LEFT, __pyx_t_11) < 0) __PYX_ERR(58, 28, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DMStag.pyx":29 * UP_RIGHT = DMSTAG_UP_RIGHT * FRONT_DOWN_LEFT = DMSTAG_FRONT_DOWN_LEFT * FRONT_DOWN = DMSTAG_FRONT_DOWN # <<<<<<<<<<<<<< * FRONT_DOWN_RIGHT = DMSTAG_FRONT_DOWN_RIGHT * FRONT_LEFT = DMSTAG_FRONT_LEFT */ __pyx_t_11 = __Pyx_PyInt_From_DMStagStencilLocation(DMSTAG_FRONT_DOWN); if (unlikely(!__pyx_t_11)) __PYX_ERR(58, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_FRONT_DOWN, __pyx_t_11) < 0) __PYX_ERR(58, 29, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DMStag.pyx":30 * FRONT_DOWN_LEFT = DMSTAG_FRONT_DOWN_LEFT * FRONT_DOWN = DMSTAG_FRONT_DOWN * FRONT_DOWN_RIGHT = DMSTAG_FRONT_DOWN_RIGHT # <<<<<<<<<<<<<< * FRONT_LEFT = DMSTAG_FRONT_LEFT * FRONT = DMSTAG_FRONT */ __pyx_t_11 = __Pyx_PyInt_From_DMStagStencilLocation(DMSTAG_FRONT_DOWN_RIGHT); if (unlikely(!__pyx_t_11)) __PYX_ERR(58, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_FRONT_DOWN_RIGHT, __pyx_t_11) < 0) __PYX_ERR(58, 30, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DMStag.pyx":31 * FRONT_DOWN = DMSTAG_FRONT_DOWN * FRONT_DOWN_RIGHT = DMSTAG_FRONT_DOWN_RIGHT * FRONT_LEFT = DMSTAG_FRONT_LEFT # <<<<<<<<<<<<<< * FRONT = DMSTAG_FRONT * FRONT_RIGHT = DMSTAG_FRONT_RIGHT */ __pyx_t_11 = __Pyx_PyInt_From_DMStagStencilLocation(DMSTAG_FRONT_LEFT); if (unlikely(!__pyx_t_11)) __PYX_ERR(58, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_FRONT_LEFT, __pyx_t_11) < 0) __PYX_ERR(58, 31, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DMStag.pyx":32 * FRONT_DOWN_RIGHT = DMSTAG_FRONT_DOWN_RIGHT * FRONT_LEFT = DMSTAG_FRONT_LEFT * FRONT = DMSTAG_FRONT # <<<<<<<<<<<<<< * FRONT_RIGHT = DMSTAG_FRONT_RIGHT * FRONT_UP_LEFT = DMSTAG_FRONT_UP_LEFT */ __pyx_t_11 = __Pyx_PyInt_From_DMStagStencilLocation(DMSTAG_FRONT); if (unlikely(!__pyx_t_11)) __PYX_ERR(58, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_FRONT, __pyx_t_11) < 0) __PYX_ERR(58, 32, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DMStag.pyx":33 * FRONT_LEFT = DMSTAG_FRONT_LEFT * FRONT = DMSTAG_FRONT * FRONT_RIGHT = DMSTAG_FRONT_RIGHT # <<<<<<<<<<<<<< * FRONT_UP_LEFT = DMSTAG_FRONT_UP_LEFT * FRONT_UP = DMSTAG_FRONT_UP */ __pyx_t_11 = __Pyx_PyInt_From_DMStagStencilLocation(DMSTAG_FRONT_RIGHT); if (unlikely(!__pyx_t_11)) __PYX_ERR(58, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_FRONT_RIGHT, __pyx_t_11) < 0) __PYX_ERR(58, 33, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DMStag.pyx":34 * FRONT = DMSTAG_FRONT * FRONT_RIGHT = DMSTAG_FRONT_RIGHT * FRONT_UP_LEFT = DMSTAG_FRONT_UP_LEFT # <<<<<<<<<<<<<< * FRONT_UP = DMSTAG_FRONT_UP * FRONT_UP_RIGHT = DMSTAG_FRONT_UP_RIGHT */ __pyx_t_11 = __Pyx_PyInt_From_DMStagStencilLocation(DMSTAG_FRONT_UP_LEFT); if (unlikely(!__pyx_t_11)) __PYX_ERR(58, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_FRONT_UP_LEFT, __pyx_t_11) < 0) __PYX_ERR(58, 34, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DMStag.pyx":35 * FRONT_RIGHT = DMSTAG_FRONT_RIGHT * FRONT_UP_LEFT = DMSTAG_FRONT_UP_LEFT * FRONT_UP = DMSTAG_FRONT_UP # <<<<<<<<<<<<<< * FRONT_UP_RIGHT = DMSTAG_FRONT_UP_RIGHT * */ __pyx_t_11 = __Pyx_PyInt_From_DMStagStencilLocation(DMSTAG_FRONT_UP); if (unlikely(!__pyx_t_11)) __PYX_ERR(58, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_FRONT_UP, __pyx_t_11) < 0) __PYX_ERR(58, 35, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DMStag.pyx":36 * FRONT_UP_LEFT = DMSTAG_FRONT_UP_LEFT * FRONT_UP = DMSTAG_FRONT_UP * FRONT_UP_RIGHT = DMSTAG_FRONT_UP_RIGHT # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_t_11 = __Pyx_PyInt_From_DMStagStencilLocation(DMSTAG_FRONT_UP_RIGHT); if (unlikely(!__pyx_t_11)) __PYX_ERR(58, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_FRONT_UP_RIGHT, __pyx_t_11) < 0) __PYX_ERR(58, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DMStag.pyx":8 * NONE = DMSTAG_STENCIL_NONE * * class DMStagStencilLocation(object): # <<<<<<<<<<<<<< * NULLLOC = DMSTAG_NULL_LOCATION * BACK_DOWN_LEFT = DMSTAG_BACK_DOWN_LEFT */ __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_DMStagStencilLocation, __pyx_t_13, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(58, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_DMStagStencilLocation, __pyx_t_11) < 0) __PYX_ERR(58, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/DMStag.pyx":43 * """A DM object representing a "staggered grid" or a structured cell complex.""" * * StencilType = DMStagStencilType # <<<<<<<<<<<<<< * StencilLocation = DMStagStencilLocation * */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_DMStagStencilType); if (unlikely(!__pyx_t_13)) __PYX_ERR(58, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DMStag, __pyx_n_s_StencilType, __pyx_t_13) < 0) __PYX_ERR(58, 43, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_DMStag); /* "petsc4py/PETSc/DMStag.pyx":44 * * StencilType = DMStagStencilType * StencilLocation = DMStagStencilLocation # <<<<<<<<<<<<<< * * def create( */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_DMStagStencilLocation); if (unlikely(!__pyx_t_13)) __PYX_ERR(58, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DMStag, __pyx_n_s_StencilLocation, __pyx_t_13) < 0) __PYX_ERR(58, 44, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_DMStag); /* "petsc4py/PETSc/DMStag.pyx":896 * # -------------------------------------------------------------------- * * del DMStagStencilType # <<<<<<<<<<<<<< * del DMStagStencilLocation * */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_DMStagStencilType) < 0) __PYX_ERR(58, 896, __pyx_L1_error) /* "petsc4py/PETSc/DMStag.pyx":897 * * del DMStagStencilType * del DMStagStencilLocation # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_DMStagStencilLocation) < 0) __PYX_ERR(58, 897, __pyx_L1_error) /* "petsc4py/PETSc/DMComposite.pyx":63 * CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) * return toInt(n) * getNumberDM = getNumber # <<<<<<<<<<<<<< * * def getEntries(self) -> list[DM]: */ __Pyx_GetNameInClass(__pyx_t_13, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_DMComposite, __pyx_n_s_getNumber); if (unlikely(!__pyx_t_13)) __PYX_ERR(59, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DMComposite, __pyx_n_s_getNumberDM, __pyx_t_13) < 0) __PYX_ERR(59, 63, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_DMComposite); /* "petsc4py/PETSc/DMSwarm.pyx":3 * # -------------------------------------------------------------------- * * class DMSwarmType(object): # <<<<<<<<<<<<<< * BASIC = DMSWARM_BASIC * PIC = DMSWARM_PIC */ __pyx_t_13 = __Pyx_PEP560_update_bases(__pyx_tuple__237); if (unlikely(!__pyx_t_13)) __PYX_ERR(62, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(62, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_13, __pyx_n_s_DMSwarmType, __pyx_n_s_DMSwarmType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(62, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_13 != __pyx_tuple__237) { if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_tuple__237) < 0))) __PYX_ERR(62, 3, __pyx_L1_error) } /* "petsc4py/PETSc/DMSwarm.pyx":4 * * class DMSwarmType(object): * BASIC = DMSWARM_BASIC # <<<<<<<<<<<<<< * PIC = DMSWARM_PIC * */ __pyx_t_11 = __Pyx_PyInt_From_DMSwarmType(DMSWARM_BASIC); if (unlikely(!__pyx_t_11)) __PYX_ERR(62, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_BASIC, __pyx_t_11) < 0) __PYX_ERR(62, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DMSwarm.pyx":5 * class DMSwarmType(object): * BASIC = DMSWARM_BASIC * PIC = DMSWARM_PIC # <<<<<<<<<<<<<< * * class DMSwarmMigrateType(object): */ __pyx_t_11 = __Pyx_PyInt_From_DMSwarmType(DMSWARM_PIC); if (unlikely(!__pyx_t_11)) __PYX_ERR(62, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_PIC, __pyx_t_11) < 0) __PYX_ERR(62, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DMSwarm.pyx":3 * # -------------------------------------------------------------------- * * class DMSwarmType(object): # <<<<<<<<<<<<<< * BASIC = DMSWARM_BASIC * PIC = DMSWARM_PIC */ __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_DMSwarmType, __pyx_t_13, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(62, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_DMSwarmType, __pyx_t_11) < 0) __PYX_ERR(62, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/DMSwarm.pyx":7 * PIC = DMSWARM_PIC * * class DMSwarmMigrateType(object): # <<<<<<<<<<<<<< * MIGRATE_BASIC = DMSWARM_MIGRATE_BASIC * MIGRATE_DMCELLNSCATTER = DMSWARM_MIGRATE_DMCELLNSCATTER */ __pyx_t_13 = __Pyx_PEP560_update_bases(__pyx_tuple__239); if (unlikely(!__pyx_t_13)) __PYX_ERR(62, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(62, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_13, __pyx_n_s_DMSwarmMigrateType, __pyx_n_s_DMSwarmMigrateType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(62, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_13 != __pyx_tuple__239) { if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_tuple__239) < 0))) __PYX_ERR(62, 7, __pyx_L1_error) } /* "petsc4py/PETSc/DMSwarm.pyx":8 * * class DMSwarmMigrateType(object): * MIGRATE_BASIC = DMSWARM_MIGRATE_BASIC # <<<<<<<<<<<<<< * MIGRATE_DMCELLNSCATTER = DMSWARM_MIGRATE_DMCELLNSCATTER * MIGRATE_DMCELLEXACT = DMSWARM_MIGRATE_DMCELLEXACT */ __pyx_t_11 = __Pyx_PyInt_From_DMSwarmMigrateType(DMSWARM_MIGRATE_BASIC); if (unlikely(!__pyx_t_11)) __PYX_ERR(62, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_MIGRATE_BASIC, __pyx_t_11) < 0) __PYX_ERR(62, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DMSwarm.pyx":9 * class DMSwarmMigrateType(object): * MIGRATE_BASIC = DMSWARM_MIGRATE_BASIC * MIGRATE_DMCELLNSCATTER = DMSWARM_MIGRATE_DMCELLNSCATTER # <<<<<<<<<<<<<< * MIGRATE_DMCELLEXACT = DMSWARM_MIGRATE_DMCELLEXACT * MIGRATE_USER = DMSWARM_MIGRATE_USER */ __pyx_t_11 = __Pyx_PyInt_From_DMSwarmMigrateType(DMSWARM_MIGRATE_DMCELLNSCATTER); if (unlikely(!__pyx_t_11)) __PYX_ERR(62, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_MIGRATE_DMCELLNSCATTER, __pyx_t_11) < 0) __PYX_ERR(62, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DMSwarm.pyx":10 * MIGRATE_BASIC = DMSWARM_MIGRATE_BASIC * MIGRATE_DMCELLNSCATTER = DMSWARM_MIGRATE_DMCELLNSCATTER * MIGRATE_DMCELLEXACT = DMSWARM_MIGRATE_DMCELLEXACT # <<<<<<<<<<<<<< * MIGRATE_USER = DMSWARM_MIGRATE_USER * */ __pyx_t_11 = __Pyx_PyInt_From_DMSwarmMigrateType(DMSWARM_MIGRATE_DMCELLEXACT); if (unlikely(!__pyx_t_11)) __PYX_ERR(62, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_MIGRATE_DMCELLEXACT, __pyx_t_11) < 0) __PYX_ERR(62, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DMSwarm.pyx":11 * MIGRATE_DMCELLNSCATTER = DMSWARM_MIGRATE_DMCELLNSCATTER * MIGRATE_DMCELLEXACT = DMSWARM_MIGRATE_DMCELLEXACT * MIGRATE_USER = DMSWARM_MIGRATE_USER # <<<<<<<<<<<<<< * * class DMSwarmCollectType(object): */ __pyx_t_11 = __Pyx_PyInt_From_DMSwarmMigrateType(DMSWARM_MIGRATE_USER); if (unlikely(!__pyx_t_11)) __PYX_ERR(62, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_MIGRATE_USER, __pyx_t_11) < 0) __PYX_ERR(62, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DMSwarm.pyx":7 * PIC = DMSWARM_PIC * * class DMSwarmMigrateType(object): # <<<<<<<<<<<<<< * MIGRATE_BASIC = DMSWARM_MIGRATE_BASIC * MIGRATE_DMCELLNSCATTER = DMSWARM_MIGRATE_DMCELLNSCATTER */ __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_DMSwarmMigrateType, __pyx_t_13, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(62, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_DMSwarmMigrateType, __pyx_t_11) < 0) __PYX_ERR(62, 7, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/DMSwarm.pyx":13 * MIGRATE_USER = DMSWARM_MIGRATE_USER * * class DMSwarmCollectType(object): # <<<<<<<<<<<<<< * COLLECT_BASIC = DMSWARM_COLLECT_BASIC * COLLECT_DMDABOUNDINGBOX = DMSWARM_COLLECT_DMDABOUNDINGBOX */ __pyx_t_13 = __Pyx_PEP560_update_bases(__pyx_tuple__241); if (unlikely(!__pyx_t_13)) __PYX_ERR(62, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(62, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_13, __pyx_n_s_DMSwarmCollectType, __pyx_n_s_DMSwarmCollectType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(62, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_13 != __pyx_tuple__241) { if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_tuple__241) < 0))) __PYX_ERR(62, 13, __pyx_L1_error) } /* "petsc4py/PETSc/DMSwarm.pyx":14 * * class DMSwarmCollectType(object): * COLLECT_BASIC = DMSWARM_COLLECT_BASIC # <<<<<<<<<<<<<< * COLLECT_DMDABOUNDINGBOX = DMSWARM_COLLECT_DMDABOUNDINGBOX * COLLECT_GENERAL = DMSWARM_COLLECT_GENERAL */ __pyx_t_11 = __Pyx_PyInt_From_DMSwarmCollectType(DMSWARM_COLLECT_BASIC); if (unlikely(!__pyx_t_11)) __PYX_ERR(62, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_COLLECT_BASIC, __pyx_t_11) < 0) __PYX_ERR(62, 14, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DMSwarm.pyx":15 * class DMSwarmCollectType(object): * COLLECT_BASIC = DMSWARM_COLLECT_BASIC * COLLECT_DMDABOUNDINGBOX = DMSWARM_COLLECT_DMDABOUNDINGBOX # <<<<<<<<<<<<<< * COLLECT_GENERAL = DMSWARM_COLLECT_GENERAL * COLLECT_USER = DMSWARM_COLLECT_USER */ __pyx_t_11 = __Pyx_PyInt_From_DMSwarmCollectType(DMSWARM_COLLECT_DMDABOUNDINGBOX); if (unlikely(!__pyx_t_11)) __PYX_ERR(62, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_COLLECT_DMDABOUNDINGBOX, __pyx_t_11) < 0) __PYX_ERR(62, 15, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DMSwarm.pyx":16 * COLLECT_BASIC = DMSWARM_COLLECT_BASIC * COLLECT_DMDABOUNDINGBOX = DMSWARM_COLLECT_DMDABOUNDINGBOX * COLLECT_GENERAL = DMSWARM_COLLECT_GENERAL # <<<<<<<<<<<<<< * COLLECT_USER = DMSWARM_COLLECT_USER * */ __pyx_t_11 = __Pyx_PyInt_From_DMSwarmCollectType(DMSWARM_COLLECT_GENERAL); if (unlikely(!__pyx_t_11)) __PYX_ERR(62, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_COLLECT_GENERAL, __pyx_t_11) < 0) __PYX_ERR(62, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DMSwarm.pyx":17 * COLLECT_DMDABOUNDINGBOX = DMSWARM_COLLECT_DMDABOUNDINGBOX * COLLECT_GENERAL = DMSWARM_COLLECT_GENERAL * COLLECT_USER = DMSWARM_COLLECT_USER # <<<<<<<<<<<<<< * * class DMSwarmPICLayoutType(object): */ __pyx_t_11 = __Pyx_PyInt_From_DMSwarmCollectType(DMSWARM_COLLECT_USER); if (unlikely(!__pyx_t_11)) __PYX_ERR(62, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_COLLECT_USER, __pyx_t_11) < 0) __PYX_ERR(62, 17, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DMSwarm.pyx":13 * MIGRATE_USER = DMSWARM_MIGRATE_USER * * class DMSwarmCollectType(object): # <<<<<<<<<<<<<< * COLLECT_BASIC = DMSWARM_COLLECT_BASIC * COLLECT_DMDABOUNDINGBOX = DMSWARM_COLLECT_DMDABOUNDINGBOX */ __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_DMSwarmCollectType, __pyx_t_13, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(62, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_DMSwarmCollectType, __pyx_t_11) < 0) __PYX_ERR(62, 13, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/DMSwarm.pyx":19 * COLLECT_USER = DMSWARM_COLLECT_USER * * class DMSwarmPICLayoutType(object): # <<<<<<<<<<<<<< * LAYOUT_REGULAR = DMSWARMPIC_LAYOUT_REGULAR * LAYOUT_GAUSS = DMSWARMPIC_LAYOUT_GAUSS */ __pyx_t_13 = __Pyx_PEP560_update_bases(__pyx_tuple__243); if (unlikely(!__pyx_t_13)) __PYX_ERR(62, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(62, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_13, __pyx_n_s_DMSwarmPICLayoutType, __pyx_n_s_DMSwarmPICLayoutType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(62, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_13 != __pyx_tuple__243) { if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_tuple__243) < 0))) __PYX_ERR(62, 19, __pyx_L1_error) } /* "petsc4py/PETSc/DMSwarm.pyx":20 * * class DMSwarmPICLayoutType(object): * LAYOUT_REGULAR = DMSWARMPIC_LAYOUT_REGULAR # <<<<<<<<<<<<<< * LAYOUT_GAUSS = DMSWARMPIC_LAYOUT_GAUSS * LAYOUT_SUBDIVISION = DMSWARMPIC_LAYOUT_SUBDIVISION */ __pyx_t_11 = __Pyx_PyInt_From_DMSwarmPICLayoutType(DMSWARMPIC_LAYOUT_REGULAR); if (unlikely(!__pyx_t_11)) __PYX_ERR(62, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_LAYOUT_REGULAR, __pyx_t_11) < 0) __PYX_ERR(62, 20, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DMSwarm.pyx":21 * class DMSwarmPICLayoutType(object): * LAYOUT_REGULAR = DMSWARMPIC_LAYOUT_REGULAR * LAYOUT_GAUSS = DMSWARMPIC_LAYOUT_GAUSS # <<<<<<<<<<<<<< * LAYOUT_SUBDIVISION = DMSWARMPIC_LAYOUT_SUBDIVISION * */ __pyx_t_11 = __Pyx_PyInt_From_DMSwarmPICLayoutType(DMSWARMPIC_LAYOUT_GAUSS); if (unlikely(!__pyx_t_11)) __PYX_ERR(62, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_LAYOUT_GAUSS, __pyx_t_11) < 0) __PYX_ERR(62, 21, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DMSwarm.pyx":22 * LAYOUT_REGULAR = DMSWARMPIC_LAYOUT_REGULAR * LAYOUT_GAUSS = DMSWARMPIC_LAYOUT_GAUSS * LAYOUT_SUBDIVISION = DMSWARMPIC_LAYOUT_SUBDIVISION # <<<<<<<<<<<<<< * * */ __pyx_t_11 = __Pyx_PyInt_From_DMSwarmPICLayoutType(DMSWARMPIC_LAYOUT_SUBDIVISION); if (unlikely(!__pyx_t_11)) __PYX_ERR(62, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_LAYOUT_SUBDIVISION, __pyx_t_11) < 0) __PYX_ERR(62, 22, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/DMSwarm.pyx":19 * COLLECT_USER = DMSWARM_COLLECT_USER * * class DMSwarmPICLayoutType(object): # <<<<<<<<<<<<<< * LAYOUT_REGULAR = DMSWARMPIC_LAYOUT_REGULAR * LAYOUT_GAUSS = DMSWARMPIC_LAYOUT_GAUSS */ __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_DMSwarmPICLayoutType, __pyx_t_13, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(62, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_DMSwarmPICLayoutType, __pyx_t_11) < 0) __PYX_ERR(62, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/DMSwarm.pyx":27 * cdef class DMSwarm(DM): * """A `DM` object used to represent arrays of data (fields) of arbitrary type.""" * Type = DMSwarmType # <<<<<<<<<<<<<< * MigrateType = DMSwarmMigrateType * CollectType = DMSwarmCollectType */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_DMSwarmType); if (unlikely(!__pyx_t_13)) __PYX_ERR(62, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DMSwarm, __pyx_n_s_Type, __pyx_t_13) < 0) __PYX_ERR(62, 27, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_DMSwarm); /* "petsc4py/PETSc/DMSwarm.pyx":28 * """A `DM` object used to represent arrays of data (fields) of arbitrary type.""" * Type = DMSwarmType * MigrateType = DMSwarmMigrateType # <<<<<<<<<<<<<< * CollectType = DMSwarmCollectType * PICLayoutType = DMSwarmPICLayoutType */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_DMSwarmMigrateType); if (unlikely(!__pyx_t_13)) __PYX_ERR(62, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DMSwarm, __pyx_n_s_MigrateType, __pyx_t_13) < 0) __PYX_ERR(62, 28, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_DMSwarm); /* "petsc4py/PETSc/DMSwarm.pyx":29 * Type = DMSwarmType * MigrateType = DMSwarmMigrateType * CollectType = DMSwarmCollectType # <<<<<<<<<<<<<< * PICLayoutType = DMSwarmPICLayoutType * */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_DMSwarmCollectType); if (unlikely(!__pyx_t_13)) __PYX_ERR(62, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DMSwarm, __pyx_n_s_CollectType, __pyx_t_13) < 0) __PYX_ERR(62, 29, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_DMSwarm); /* "petsc4py/PETSc/DMSwarm.pyx":30 * MigrateType = DMSwarmMigrateType * CollectType = DMSwarmCollectType * PICLayoutType = DMSwarmPICLayoutType # <<<<<<<<<<<<<< * * def create(self, comm: Comm | None = None) -> Self: */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_DMSwarmPICLayoutType); if (unlikely(!__pyx_t_13)) __PYX_ERR(62, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DMSwarm, __pyx_n_s_PICLayoutType, __pyx_t_13) < 0) __PYX_ERR(62, 30, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_DMSwarm); /* "petsc4py/PETSc/DMSwarm.pyx":194 * return self * * def registerField(self, fieldname: str, blocksize: int, dtype: dtype = ScalarType) -> None: # <<<<<<<<<<<<<< * """Register a field to a `DMSwarm` with a native PETSc data type. * */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_ScalarType); if (unlikely(!__pyx_t_13)) __PYX_ERR(62, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_k__63 = __pyx_t_13; __Pyx_GIVEREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/DMSwarm.pyx":836 * * * del DMSwarmType # <<<<<<<<<<<<<< * del DMSwarmMigrateType * del DMSwarmCollectType */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_DMSwarmType) < 0) __PYX_ERR(62, 836, __pyx_L1_error) /* "petsc4py/PETSc/DMSwarm.pyx":837 * * del DMSwarmType * del DMSwarmMigrateType # <<<<<<<<<<<<<< * del DMSwarmCollectType * del DMSwarmPICLayoutType */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_DMSwarmMigrateType) < 0) __PYX_ERR(62, 837, __pyx_L1_error) /* "petsc4py/PETSc/DMSwarm.pyx":838 * del DMSwarmType * del DMSwarmMigrateType * del DMSwarmCollectType # <<<<<<<<<<<<<< * del DMSwarmPICLayoutType */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_DMSwarmCollectType) < 0) __PYX_ERR(62, 838, __pyx_L1_error) /* "petsc4py/PETSc/DMSwarm.pyx":839 * del DMSwarmMigrateType * del DMSwarmCollectType * del DMSwarmPICLayoutType # <<<<<<<<<<<<<< */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_DMSwarmPICLayoutType) < 0) __PYX_ERR(62, 839, __pyx_L1_error) /* "petsc4py/PETSc/Partitioner.pyx":3 * # -------------------------------------------------------------------- * * class PartitionerType(object): # <<<<<<<<<<<<<< * PARMETIS = S_(PETSCPARTITIONERPARMETIS) * PTSCOTCH = S_(PETSCPARTITIONERPTSCOTCH) */ __pyx_t_13 = __Pyx_PEP560_update_bases(__pyx_tuple__245); if (unlikely(!__pyx_t_13)) __PYX_ERR(63, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(63, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_13, __pyx_n_s_PartitionerType, __pyx_n_s_PartitionerType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(63, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_13 != __pyx_tuple__245) { if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_tuple__245) < 0))) __PYX_ERR(63, 3, __pyx_L1_error) } /* "petsc4py/PETSc/Partitioner.pyx":4 * * class PartitionerType(object): * PARMETIS = S_(PETSCPARTITIONERPARMETIS) # <<<<<<<<<<<<<< * PTSCOTCH = S_(PETSCPARTITIONERPTSCOTCH) * CHACO = S_(PETSCPARTITIONERCHACO) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PETSCPARTITIONERPARMETIS); if (unlikely(!__pyx_t_11)) __PYX_ERR(63, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_PARMETIS, __pyx_t_11) < 0) __PYX_ERR(63, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Partitioner.pyx":5 * class PartitionerType(object): * PARMETIS = S_(PETSCPARTITIONERPARMETIS) * PTSCOTCH = S_(PETSCPARTITIONERPTSCOTCH) # <<<<<<<<<<<<<< * CHACO = S_(PETSCPARTITIONERCHACO) * SIMPLE = S_(PETSCPARTITIONERSIMPLE) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PETSCPARTITIONERPTSCOTCH); if (unlikely(!__pyx_t_11)) __PYX_ERR(63, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_PTSCOTCH, __pyx_t_11) < 0) __PYX_ERR(63, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Partitioner.pyx":6 * PARMETIS = S_(PETSCPARTITIONERPARMETIS) * PTSCOTCH = S_(PETSCPARTITIONERPTSCOTCH) * CHACO = S_(PETSCPARTITIONERCHACO) # <<<<<<<<<<<<<< * SIMPLE = S_(PETSCPARTITIONERSIMPLE) * SHELL = S_(PETSCPARTITIONERSHELL) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PETSCPARTITIONERCHACO); if (unlikely(!__pyx_t_11)) __PYX_ERR(63, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_CHACO, __pyx_t_11) < 0) __PYX_ERR(63, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Partitioner.pyx":7 * PTSCOTCH = S_(PETSCPARTITIONERPTSCOTCH) * CHACO = S_(PETSCPARTITIONERCHACO) * SIMPLE = S_(PETSCPARTITIONERSIMPLE) # <<<<<<<<<<<<<< * SHELL = S_(PETSCPARTITIONERSHELL) * GATHER = S_(PETSCPARTITIONERGATHER) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PETSCPARTITIONERSIMPLE); if (unlikely(!__pyx_t_11)) __PYX_ERR(63, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SIMPLE, __pyx_t_11) < 0) __PYX_ERR(63, 7, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Partitioner.pyx":8 * CHACO = S_(PETSCPARTITIONERCHACO) * SIMPLE = S_(PETSCPARTITIONERSIMPLE) * SHELL = S_(PETSCPARTITIONERSHELL) # <<<<<<<<<<<<<< * GATHER = S_(PETSCPARTITIONERGATHER) * MATPARTITIONING = S_(PETSCPARTITIONERMATPARTITIONING) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PETSCPARTITIONERSHELL); if (unlikely(!__pyx_t_11)) __PYX_ERR(63, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SHELL, __pyx_t_11) < 0) __PYX_ERR(63, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Partitioner.pyx":9 * SIMPLE = S_(PETSCPARTITIONERSIMPLE) * SHELL = S_(PETSCPARTITIONERSHELL) * GATHER = S_(PETSCPARTITIONERGATHER) # <<<<<<<<<<<<<< * MATPARTITIONING = S_(PETSCPARTITIONERMATPARTITIONING) * */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PETSCPARTITIONERGATHER); if (unlikely(!__pyx_t_11)) __PYX_ERR(63, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_GATHER, __pyx_t_11) < 0) __PYX_ERR(63, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Partitioner.pyx":10 * SHELL = S_(PETSCPARTITIONERSHELL) * GATHER = S_(PETSCPARTITIONERGATHER) * MATPARTITIONING = S_(PETSCPARTITIONERMATPARTITIONING) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PETSCPARTITIONERMATPARTITIONING); if (unlikely(!__pyx_t_11)) __PYX_ERR(63, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_MATPARTITIONING, __pyx_t_11) < 0) __PYX_ERR(63, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Partitioner.pyx":3 * # -------------------------------------------------------------------- * * class PartitionerType(object): # <<<<<<<<<<<<<< * PARMETIS = S_(PETSCPARTITIONERPARMETIS) * PTSCOTCH = S_(PETSCPARTITIONERPTSCOTCH) */ __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_PartitionerType, __pyx_t_13, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(63, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_PartitionerType, __pyx_t_11) < 0) __PYX_ERR(63, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/Partitioner.pyx":17 * """A graph partitioner.""" * * Type = PartitionerType # <<<<<<<<<<<<<< * * def __cinit__(self): */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_PartitionerType); if (unlikely(!__pyx_t_13)) __PYX_ERR(63, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Partitioner, __pyx_n_s_Type, __pyx_t_13) < 0) __PYX_ERR(63, 17, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Partitioner); /* "petsc4py/PETSc/Partitioner.pyx":189 * # -------------------------------------------------------------------- * * del PartitionerType # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_PartitionerType) < 0) __PYX_ERR(63, 189, __pyx_L1_error) /* "petsc4py/PETSc/Space.pyx":3 * # -------------------------------------------------------------------- * * class SpaceType(object): # <<<<<<<<<<<<<< * POLYNOMIAL = S_(PETSCSPACEPOLYNOMIAL) * PTRIMMED = S_(PETSCSPACEPTRIMMED) */ __pyx_t_13 = __Pyx_PEP560_update_bases(__pyx_tuple__247); if (unlikely(!__pyx_t_13)) __PYX_ERR(64, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(64, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_13, __pyx_n_s_SpaceType, __pyx_n_s_SpaceType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(64, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_13 != __pyx_tuple__247) { if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_tuple__247) < 0))) __PYX_ERR(64, 3, __pyx_L1_error) } /* "petsc4py/PETSc/Space.pyx":4 * * class SpaceType(object): * POLYNOMIAL = S_(PETSCSPACEPOLYNOMIAL) # <<<<<<<<<<<<<< * PTRIMMED = S_(PETSCSPACEPTRIMMED) * TENSOR = S_(PETSCSPACETENSOR) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PETSCSPACEPOLYNOMIAL); if (unlikely(!__pyx_t_11)) __PYX_ERR(64, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_POLYNOMIAL, __pyx_t_11) < 0) __PYX_ERR(64, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Space.pyx":5 * class SpaceType(object): * POLYNOMIAL = S_(PETSCSPACEPOLYNOMIAL) * PTRIMMED = S_(PETSCSPACEPTRIMMED) # <<<<<<<<<<<<<< * TENSOR = S_(PETSCSPACETENSOR) * SUM = S_(PETSCSPACESUM) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PETSCSPACEPTRIMMED); if (unlikely(!__pyx_t_11)) __PYX_ERR(64, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_PTRIMMED, __pyx_t_11) < 0) __PYX_ERR(64, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Space.pyx":6 * POLYNOMIAL = S_(PETSCSPACEPOLYNOMIAL) * PTRIMMED = S_(PETSCSPACEPTRIMMED) * TENSOR = S_(PETSCSPACETENSOR) # <<<<<<<<<<<<<< * SUM = S_(PETSCSPACESUM) * POINT = S_(PETSCSPACEPOINT) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PETSCSPACETENSOR); if (unlikely(!__pyx_t_11)) __PYX_ERR(64, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_TENSOR, __pyx_t_11) < 0) __PYX_ERR(64, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Space.pyx":7 * PTRIMMED = S_(PETSCSPACEPTRIMMED) * TENSOR = S_(PETSCSPACETENSOR) * SUM = S_(PETSCSPACESUM) # <<<<<<<<<<<<<< * POINT = S_(PETSCSPACEPOINT) * SUBSPACE = S_(PETSCSPACESUBSPACE) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PETSCSPACESUM); if (unlikely(!__pyx_t_11)) __PYX_ERR(64, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SUM, __pyx_t_11) < 0) __PYX_ERR(64, 7, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Space.pyx":8 * TENSOR = S_(PETSCSPACETENSOR) * SUM = S_(PETSCSPACESUM) * POINT = S_(PETSCSPACEPOINT) # <<<<<<<<<<<<<< * SUBSPACE = S_(PETSCSPACESUBSPACE) * WXY = S_(PETSCSPACEWXY) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PETSCSPACEPOINT); if (unlikely(!__pyx_t_11)) __PYX_ERR(64, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_POINT, __pyx_t_11) < 0) __PYX_ERR(64, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Space.pyx":9 * SUM = S_(PETSCSPACESUM) * POINT = S_(PETSCSPACEPOINT) * SUBSPACE = S_(PETSCSPACESUBSPACE) # <<<<<<<<<<<<<< * WXY = S_(PETSCSPACEWXY) * */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PETSCSPACESUBSPACE); if (unlikely(!__pyx_t_11)) __PYX_ERR(64, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SUBSPACE, __pyx_t_11) < 0) __PYX_ERR(64, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Space.pyx":10 * POINT = S_(PETSCSPACEPOINT) * SUBSPACE = S_(PETSCSPACESUBSPACE) * WXY = S_(PETSCSPACEWXY) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PETSCSPACEWXY); if (unlikely(!__pyx_t_11)) __PYX_ERR(64, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_WXY, __pyx_t_11) < 0) __PYX_ERR(64, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Space.pyx":3 * # -------------------------------------------------------------------- * * class SpaceType(object): # <<<<<<<<<<<<<< * POLYNOMIAL = S_(PETSCSPACEPOLYNOMIAL) * PTRIMMED = S_(PETSCSPACEPTRIMMED) */ __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_SpaceType, __pyx_t_13, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(64, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_SpaceType, __pyx_t_11) < 0) __PYX_ERR(64, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/Space.pyx":16 * cdef class Space(Object): * """Linear space object.""" * Type = SpaceType # <<<<<<<<<<<<<< * * def __cinit__(self): */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_SpaceType); if (unlikely(!__pyx_t_13)) __PYX_ERR(64, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Space, __pyx_n_s_Type, __pyx_t_13) < 0) __PYX_ERR(64, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Space); /* "petsc4py/PETSc/Space.pyx":552 * # -------------------------------------------------------------------- * * class DualSpaceType(object): # <<<<<<<<<<<<<< * LAGRANGE = S_(PETSCDUALSPACELAGRANGE) * SIMPLE = S_(PETSCDUALSPACESIMPLE) */ __pyx_t_13 = __Pyx_PEP560_update_bases(__pyx_tuple__249); if (unlikely(!__pyx_t_13)) __PYX_ERR(64, 552, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(64, 552, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_13, __pyx_n_s_DualSpaceType, __pyx_n_s_DualSpaceType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(64, 552, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_13 != __pyx_tuple__249) { if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_tuple__249) < 0))) __PYX_ERR(64, 552, __pyx_L1_error) } /* "petsc4py/PETSc/Space.pyx":553 * * class DualSpaceType(object): * LAGRANGE = S_(PETSCDUALSPACELAGRANGE) # <<<<<<<<<<<<<< * SIMPLE = S_(PETSCDUALSPACESIMPLE) * REFINED = S_(PETSCDUALSPACEREFINED) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PETSCDUALSPACELAGRANGE); if (unlikely(!__pyx_t_11)) __PYX_ERR(64, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_LAGRANGE, __pyx_t_11) < 0) __PYX_ERR(64, 553, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Space.pyx":554 * class DualSpaceType(object): * LAGRANGE = S_(PETSCDUALSPACELAGRANGE) * SIMPLE = S_(PETSCDUALSPACESIMPLE) # <<<<<<<<<<<<<< * REFINED = S_(PETSCDUALSPACEREFINED) * BDM = S_(PETSCDUALSPACEBDM) */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PETSCDUALSPACESIMPLE); if (unlikely(!__pyx_t_11)) __PYX_ERR(64, 554, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_SIMPLE, __pyx_t_11) < 0) __PYX_ERR(64, 554, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Space.pyx":555 * LAGRANGE = S_(PETSCDUALSPACELAGRANGE) * SIMPLE = S_(PETSCDUALSPACESIMPLE) * REFINED = S_(PETSCDUALSPACEREFINED) # <<<<<<<<<<<<<< * BDM = S_(PETSCDUALSPACEBDM) * */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PETSCDUALSPACEREFINED); if (unlikely(!__pyx_t_11)) __PYX_ERR(64, 555, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_REFINED, __pyx_t_11) < 0) __PYX_ERR(64, 555, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Space.pyx":556 * SIMPLE = S_(PETSCDUALSPACESIMPLE) * REFINED = S_(PETSCDUALSPACEREFINED) * BDM = S_(PETSCDUALSPACEBDM) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_S_(PETSCDUALSPACEBDM); if (unlikely(!__pyx_t_11)) __PYX_ERR(64, 556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_BDM, __pyx_t_11) < 0) __PYX_ERR(64, 556, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "petsc4py/PETSc/Space.pyx":552 * # -------------------------------------------------------------------- * * class DualSpaceType(object): # <<<<<<<<<<<<<< * LAGRANGE = S_(PETSCDUALSPACELAGRANGE) * SIMPLE = S_(PETSCDUALSPACESIMPLE) */ __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_DualSpaceType, __pyx_t_13, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(64, 552, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_DualSpaceType, __pyx_t_11) < 0) __PYX_ERR(64, 552, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/Space.pyx":563 * """Dual space to a linear space.""" * * Type = DualSpaceType # <<<<<<<<<<<<<< * * def __cinit__(self): */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_DualSpaceType); if (unlikely(!__pyx_t_13)) __PYX_ERR(64, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DualSpace, __pyx_n_s_Type, __pyx_t_13) < 0) __PYX_ERR(64, 563, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_DualSpace); /* "petsc4py/PETSc/Space.pyx":1002 * CHKERR( PetscDualSpaceSimpleSetFunctional(self.dualspace, cfunc, functional.quad) ) * * del SpaceType # <<<<<<<<<<<<<< * del DualSpaceType */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_SpaceType) < 0) __PYX_ERR(64, 1002, __pyx_L1_error) /* "petsc4py/PETSc/Space.pyx":1003 * * del SpaceType * del DualSpaceType # <<<<<<<<<<<<<< */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_DualSpaceType) < 0) __PYX_ERR(64, 1003, __pyx_L1_error) /* "petsc4py/PETSc/libpetsc4py.pyx":32 * # -------------------------------------------------------------------- * * cdef char *FUNCT = NULL # <<<<<<<<<<<<<< * cdef char *fstack[1024] * cdef int istack = 0 */ __pyx_v_8petsc4py_5PETSc_FUNCT = NULL; /* "petsc4py/PETSc/libpetsc4py.pyx":34 * cdef char *FUNCT = NULL * cdef char *fstack[1024] * cdef int istack = 0 # <<<<<<<<<<<<<< * * cdef inline void FunctionBegin(char name[]) noexcept nogil: */ __pyx_v_8petsc4py_5PETSc_istack = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":151 * return (path, name) * * cdef dict module_cache = {} # <<<<<<<<<<<<<< * * cdef object load_module(object path): */ __pyx_t_13 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_13)) __PYX_ERR(11, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_v_8petsc4py_5PETSc_module_cache); __Pyx_DECREF_SET(__pyx_v_8petsc4py_5PETSc_module_cache, ((PyObject*)__pyx_t_13)); __Pyx_GIVEREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":378 * * #FIXME: view and setFromOptions? * cdef dict dMatOps = { 3 : 'mult', # <<<<<<<<<<<<<< * 4 : 'multAdd', * 5 : 'multTranspose', */ __pyx_t_13 = __Pyx_PyDict_NewPresized(29); if (unlikely(!__pyx_t_13)) __PYX_ERR(11, 378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (PyDict_SetItem(__pyx_t_13, __pyx_int_3, __pyx_n_s_mult) < 0) __PYX_ERR(11, 378, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_13, __pyx_int_4, __pyx_n_s_multAdd) < 0) __PYX_ERR(11, 378, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_13, __pyx_int_5, __pyx_n_s_multTranspose) < 0) __PYX_ERR(11, 378, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_13, __pyx_int_6, __pyx_n_s_multTransposeAdd) < 0) __PYX_ERR(11, 378, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_13, __pyx_int_7, __pyx_n_s_solve) < 0) __PYX_ERR(11, 378, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_13, __pyx_int_8, __pyx_n_s_solveAdd) < 0) __PYX_ERR(11, 378, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_13, __pyx_int_9, __pyx_n_s_solveTranspose) < 0) __PYX_ERR(11, 378, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_13, __pyx_int_10, __pyx_n_s_solveTransposeAdd) < 0) __PYX_ERR(11, 378, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_13, __pyx_int_13, __pyx_n_s_SOR) < 0) __PYX_ERR(11, 378, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_13, __pyx_int_17, __pyx_n_s_getDiagonal) < 0) __PYX_ERR(11, 378, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_13, __pyx_int_18, __pyx_n_s_diagonalScale) < 0) __PYX_ERR(11, 378, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_13, __pyx_int_19, __pyx_n_s_norm) < 0) __PYX_ERR(11, 378, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_13, __pyx_int_23, __pyx_n_s_zeroEntries) < 0) __PYX_ERR(11, 378, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_13, __pyx_int_32, __pyx_n_s_getDiagonalBlock) < 0) __PYX_ERR(11, 378, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_13, __pyx_int_34, __pyx_n_s_duplicate) < 0) __PYX_ERR(11, 378, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_13, __pyx_int_43, __pyx_n_s_copy) < 0) __PYX_ERR(11, 378, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_13, __pyx_int_45, __pyx_n_s_scale) < 0) __PYX_ERR(11, 378, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_13, __pyx_int_46, __pyx_n_s_shift) < 0) __PYX_ERR(11, 378, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_13, __pyx_int_47, __pyx_n_s_setDiagonal) < 0) __PYX_ERR(11, 378, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_13, __pyx_int_48, __pyx_n_s_zeroRowsColumns) < 0) __PYX_ERR(11, 378, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_13, __pyx_int_59, __pyx_n_s_createSubMatrix) < 0) __PYX_ERR(11, 378, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_13, __pyx_int_88, __pyx_n_s_getVecs) < 0) __PYX_ERR(11, 378, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_13, __pyx_int_102, __pyx_n_s_conjugate) < 0) __PYX_ERR(11, 378, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_13, __pyx_int_105, __pyx_n_s_realPart) < 0) __PYX_ERR(11, 378, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_13, __pyx_int_106, __pyx_n_s_imagPart) < 0) __PYX_ERR(11, 378, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_13, __pyx_int_113, __pyx_n_s_missingDiagonal) < 0) __PYX_ERR(11, 378, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_13, __pyx_int_119, __pyx_n_s_multDiagonalBlock) < 0) __PYX_ERR(11, 378, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_13, __pyx_int_121, __pyx_n_s_multHermitian) < 0) __PYX_ERR(11, 378, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_13, __pyx_int_122, __pyx_n_s_multHermitianAdd) < 0) __PYX_ERR(11, 378, __pyx_L1_error) __Pyx_XGOTREF(__pyx_v_8petsc4py_5PETSc_dMatOps); __Pyx_DECREF_SET(__pyx_v_8petsc4py_5PETSc_dMatOps, ((PyObject*)__pyx_t_13)); __Pyx_GIVEREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/libpetsc4py.pyx":1121 * return FunctionEnd() * * cdef PetscInt matmatid = -1 # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatProductSymbolic_Python( */ __pyx_v_8petsc4py_5PETSc_matmatid = -1L; /* "petsc4py/PETSc/PETSc.pyx":269 * PetscErrorCode PetscTBEH(MPI_Comm,int,char*,char*,int,PetscErrorType,char*,void*) * * cdef object tracebacklist = [] # <<<<<<<<<<<<<< * * cdef PetscErrorCode traceback( */ __pyx_t_13 = PyList_New(0); if (unlikely(!__pyx_t_13)) __PYX_ERR(12, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_v_8petsc4py_5PETSc_tracebacklist); __Pyx_DECREF_SET(__pyx_v_8petsc4py_5PETSc_tracebacklist, __pyx_t_13); __Pyx_GIVEREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/PETSc.pyx":358 * PetscErrorCode PetscInitializePackageAll() * * cdef int PyPetsc_Argc = 0 # <<<<<<<<<<<<<< * cdef char** PyPetsc_Argv = NULL * */ __pyx_v_8petsc4py_5PETSc_PyPetsc_Argc = 0; /* "petsc4py/PETSc/PETSc.pyx":359 * * cdef int PyPetsc_Argc = 0 * cdef char** PyPetsc_Argv = NULL # <<<<<<<<<<<<<< * * cdef int getinitargs(object args, int *argc, char **argv[]) except -1: */ __pyx_v_8petsc4py_5PETSc_PyPetsc_Argv = NULL; /* "petsc4py/PETSc/PETSc.pyx":425 * * cdef PetscErrorCode (*prevfprintf)(FILE*,const char*,va_list) except PETSC_ERR_PYTHON nogil * prevfprintf = NULL # <<<<<<<<<<<<<< * * cdef PetscErrorCode PetscVFPrintf_PythonStdStream( */ __pyx_v_8petsc4py_5PETSc_prevfprintf = NULL; /* "petsc4py/PETSc/PETSc.pyx":517 * PetscClassId PETSC_DEVICE_CONTEXT_CLASSID "PETSC_DEVICE_CONTEXT_CLASSID" * * cdef bint registercalled = 0 # <<<<<<<<<<<<<< * * cdef const char *citation = b"""\ */ __pyx_v_8petsc4py_5PETSc_registercalled = 0; /* "petsc4py/PETSc/PETSc.pyx":519 * cdef bint registercalled = 0 * * cdef const char *citation = b"""\ # <<<<<<<<<<<<<< * @Article{Dalcin2011, * Author = {Lisandro D. Dalcin and Rodrigo R. Paz and Pablo A. Kler and Alejandro Cosimo}, */ __pyx_v_8petsc4py_5PETSc_citation = ((char const *)"@Article{Dalcin2011,\n Author = {Lisandro D. Dalcin and Rodrigo R. Paz and Pablo A. Kler and Alejandro Cosimo},\n Title = {Parallel distributed computing using {P}ython},\n Journal = {Advances in Water Resources},\n Note = {New Computational Methods and Software Tools},\n Volume = {34},\n Number = {9},\n Pages = {1124--1139},\n Year = {2011},\n DOI = {https://doi.org/10.1016/j.advwatres.2011.04.013}\n}\n"); /* "petsc4py/PETSc/PETSc.pyx":574 * # -------------------------------------------------------------------- * * def _initialize(args=None, comm=None): # <<<<<<<<<<<<<< * import atexit * global tracebacklist */ __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_8petsc4py_5PETSc_5_initialize, NULL, __pyx_n_s_petsc4py_PETSc); if (unlikely(!__pyx_t_13)) __PYX_ERR(12, 574, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (PyDict_SetItem(__pyx_d, __pyx_n_s_initialize, __pyx_t_13) < 0) __PYX_ERR(12, 574, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/PETSc.pyx":593 * atexit.register(_pre_finalize) * * def _pre_finalize(): # <<<<<<<<<<<<<< * # Called while the Python interpreter is still running * garbage_cleanup() */ __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_8petsc4py_5PETSc_7_pre_finalize, NULL, __pyx_n_s_petsc4py_PETSc); if (unlikely(!__pyx_t_13)) __PYX_ERR(12, 593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pre_finalize, __pyx_t_13) < 0) __PYX_ERR(12, 593, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/PETSc.pyx":597 * garbage_cleanup() * * def _finalize(): # <<<<<<<<<<<<<< * finalize() * # */ __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_8petsc4py_5PETSc_9_finalize, NULL, __pyx_n_s_petsc4py_PETSc); if (unlikely(!__pyx_t_13)) __PYX_ERR(12, 597, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (PyDict_SetItem(__pyx_d, __pyx_n_s_finalize, __pyx_t_13) < 0) __PYX_ERR(12, 597, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/PETSc.pyx":619 * citations_registry.clear() * * def _push_python_vfprintf(): # <<<<<<<<<<<<<< * _push_vfprintf(&PetscVFPrintf_PythonStdStream) * */ __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_8petsc4py_5PETSc_11_push_python_vfprintf, NULL, __pyx_n_s_petsc4py_PETSc); if (unlikely(!__pyx_t_13)) __PYX_ERR(12, 619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (PyDict_SetItem(__pyx_d, __pyx_n_s_push_python_vfprintf, __pyx_t_13) < 0) __PYX_ERR(12, 619, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/PETSc.pyx":622 * _push_vfprintf(&PetscVFPrintf_PythonStdStream) * * def _pop_python_vfprintf(): # <<<<<<<<<<<<<< * _pop_vfprintf() * */ __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_8petsc4py_5PETSc_13_pop_python_vfprintf, NULL, __pyx_n_s_petsc4py_PETSc); if (unlikely(!__pyx_t_13)) __PYX_ERR(12, 622, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pop_python_vfprintf, __pyx_t_13) < 0) __PYX_ERR(12, 622, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "petsc4py/PETSc/PETSc.pyx":625 * _pop_vfprintf() * * def _stdout_is_stderr(): # <<<<<<<<<<<<<< * global PETSC_STDOUT, PETSC_STDERR * return PETSC_STDOUT == PETSC_STDERR */ __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_8petsc4py_5PETSc_15_stdout_is_stderr, NULL, __pyx_n_s_petsc4py_PETSc); if (unlikely(!__pyx_t_13)) __PYX_ERR(12, 625, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (PyDict_SetItem(__pyx_d, __pyx_n_s_stdout_is_stderr, __pyx_t_13) < 0) __PYX_ERR(12, 625, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /*--- Wrapped vars code ---*/ if (__Pyx_RegisterCleanup()) __PYX_ERR(14, 1, __pyx_L1_error) goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); if (__pyx_m) { if (__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init petsc4py.PETSc", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE Py_CLEAR(__pyx_m); #else Py_DECREF(__pyx_m); if (pystate_addmodule_run) { PyObject *tp, *value, *tb; PyErr_Fetch(&tp, &value, &tb); PyState_RemoveModule(&__pyx_moduledef); PyErr_Restore(tp, value, tb); } #endif } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init petsc4py.PETSc"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* #### Code section: cleanup_globals ### */ static CYTHON_SMALL_CODE void __Pyx_CleanupGlobals(void) { Py_CLEAR(__pyx_tuple__4); Py_CLEAR(__pyx_slice__5); Py_CLEAR(__pyx_tuple__8); Py_CLEAR(__pyx_tuple__15); Py_CLEAR(__pyx_tuple__17); Py_CLEAR(__pyx_tuple__19); Py_CLEAR(__pyx_slice__20); Py_CLEAR(__pyx_tuple__21); Py_CLEAR(__pyx_tuple__22); Py_CLEAR(__pyx_tuple__23); Py_CLEAR(__pyx_tuple__24); Py_CLEAR(__pyx_tuple__25); Py_CLEAR(__pyx_tuple__27); Py_CLEAR(__pyx_tuple__28); Py_CLEAR(__pyx_tuple__29); Py_CLEAR(__pyx_tuple__30); Py_CLEAR(__pyx_tuple__31); Py_CLEAR(__pyx_tuple__32); Py_CLEAR(__pyx_tuple__33); Py_CLEAR(__pyx_codeobj__34); Py_CLEAR(__pyx_tuple__35); Py_CLEAR(__pyx_codeobj__36); Py_CLEAR(__pyx_tuple__37); Py_CLEAR(__pyx_tuple__38); Py_CLEAR(__pyx_tuple__39); Py_CLEAR(__pyx_tuple__40); Py_CLEAR(__pyx_tuple__42); Py_CLEAR(__pyx_tuple__43); Py_CLEAR(__pyx_tuple__44); Py_CLEAR(__pyx_tuple__45); Py_CLEAR(__pyx_tuple__46); Py_CLEAR(__pyx_tuple__47); Py_CLEAR(__pyx_tuple__48); Py_CLEAR(__pyx_tuple__51); Py_CLEAR(__pyx_tuple__52); Py_CLEAR(__pyx_tuple__53); Py_CLEAR(__pyx_tuple__54); Py_CLEAR(__pyx_tuple__55); Py_CLEAR(__pyx_tuple__56); Py_CLEAR(__pyx_tuple__57); Py_CLEAR(__pyx_slice__58); Py_CLEAR(__pyx_slice__59); Py_CLEAR(__pyx_tuple__60); Py_CLEAR(__pyx_tuple__61); Py_CLEAR(__pyx_tuple__62); Py_CLEAR(__pyx_tuple__64); Py_CLEAR(__pyx_tuple__65); Py_CLEAR(__pyx_tuple__66); Py_CLEAR(__pyx_tuple__67); Py_CLEAR(__pyx_tuple__68); Py_CLEAR(__pyx_tuple__69); Py_CLEAR(__pyx_tuple__70); Py_CLEAR(__pyx_tuple__71); Py_CLEAR(__pyx_tuple__72); Py_CLEAR(__pyx_tuple__73); Py_CLEAR(__pyx_tuple__74); Py_CLEAR(__pyx_tuple__75); Py_CLEAR(__pyx_tuple__76); Py_CLEAR(__pyx_codeobj__77); Py_CLEAR(__pyx_tuple__78); Py_CLEAR(__pyx_tuple__79); Py_CLEAR(__pyx_tuple__80); Py_CLEAR(__pyx_tuple__81); Py_CLEAR(__pyx_tuple__82); Py_CLEAR(__pyx_tuple__83); Py_CLEAR(__pyx_tuple__84); Py_CLEAR(__pyx_tuple__85); Py_CLEAR(__pyx_tuple__86); Py_CLEAR(__pyx_codeobj__87); Py_CLEAR(__pyx_codeobj__88); Py_CLEAR(__pyx_tuple__89); Py_CLEAR(__pyx_codeobj__90); Py_CLEAR(__pyx_tuple__91); Py_CLEAR(__pyx_codeobj__92); Py_CLEAR(__pyx_tuple__93); Py_CLEAR(__pyx_codeobj__94); Py_CLEAR(__pyx_codeobj__95); Py_CLEAR(__pyx_tuple__96); Py_CLEAR(__pyx_tuple__97); Py_CLEAR(__pyx_tuple__98); Py_CLEAR(__pyx_tuple__99); Py_CLEAR(__pyx_tuple__100); Py_CLEAR(__pyx_tuple__101); Py_CLEAR(__pyx_tuple__102); Py_CLEAR(__pyx_tuple__103); Py_CLEAR(__pyx_tuple__104); Py_CLEAR(__pyx_tuple__105); Py_CLEAR(__pyx_tuple__106); Py_CLEAR(__pyx_tuple__107); Py_CLEAR(__pyx_tuple__108); Py_CLEAR(__pyx_codeobj__109); Py_CLEAR(__pyx_tuple__110); Py_CLEAR(__pyx_codeobj__111); Py_CLEAR(__pyx_tuple__112); Py_CLEAR(__pyx_codeobj__113); Py_CLEAR(__pyx_tuple__114); Py_CLEAR(__pyx_codeobj__115); Py_CLEAR(__pyx_tuple__116); Py_CLEAR(__pyx_tuple__117); Py_CLEAR(__pyx_tuple__118); Py_CLEAR(__pyx_tuple__119); Py_CLEAR(__pyx_tuple__120); Py_CLEAR(__pyx_tuple__121); Py_CLEAR(__pyx_tuple__122); Py_CLEAR(__pyx_tuple__123); Py_CLEAR(__pyx_tuple__124); Py_CLEAR(__pyx_tuple__125); Py_CLEAR(__pyx_tuple__126); Py_CLEAR(__pyx_tuple__127); Py_CLEAR(__pyx_tuple__128); Py_CLEAR(__pyx_tuple__129); Py_CLEAR(__pyx_tuple__130); Py_CLEAR(__pyx_tuple__131); Py_CLEAR(__pyx_tuple__132); Py_CLEAR(__pyx_tuple__133); Py_CLEAR(__pyx_tuple__134); Py_CLEAR(__pyx_tuple__135); Py_CLEAR(__pyx_tuple__136); Py_CLEAR(__pyx_tuple__137); Py_CLEAR(__pyx_tuple__138); Py_CLEAR(__pyx_tuple__139); Py_CLEAR(__pyx_tuple__140); Py_CLEAR(__pyx_tuple__141); Py_CLEAR(__pyx_tuple__142); Py_CLEAR(__pyx_tuple__143); Py_CLEAR(__pyx_tuple__144); Py_CLEAR(__pyx_tuple__145); Py_CLEAR(__pyx_tuple__146); Py_CLEAR(__pyx_tuple__147); Py_CLEAR(__pyx_tuple__148); Py_CLEAR(__pyx_tuple__149); Py_CLEAR(__pyx_tuple__150); Py_CLEAR(__pyx_tuple__151); Py_CLEAR(__pyx_tuple__152); Py_CLEAR(__pyx_tuple__153); Py_CLEAR(__pyx_tuple__154); Py_CLEAR(__pyx_tuple__155); Py_CLEAR(__pyx_tuple__156); Py_CLEAR(__pyx_tuple__157); Py_CLEAR(__pyx_tuple__158); Py_CLEAR(__pyx_tuple__159); Py_CLEAR(__pyx_tuple__160); Py_CLEAR(__pyx_tuple__161); Py_CLEAR(__pyx_tuple__162); Py_CLEAR(__pyx_tuple__163); Py_CLEAR(__pyx_tuple__164); Py_CLEAR(__pyx_tuple__165); Py_CLEAR(__pyx_tuple__166); Py_CLEAR(__pyx_tuple__167); Py_CLEAR(__pyx_tuple__168); Py_CLEAR(__pyx_tuple__169); Py_CLEAR(__pyx_tuple__170); Py_CLEAR(__pyx_tuple__171); Py_CLEAR(__pyx_tuple__172); Py_CLEAR(__pyx_tuple__173); Py_CLEAR(__pyx_tuple__174); Py_CLEAR(__pyx_tuple__175); Py_CLEAR(__pyx_tuple__176); Py_CLEAR(__pyx_tuple__177); Py_CLEAR(__pyx_tuple__178); Py_CLEAR(__pyx_tuple__179); Py_CLEAR(__pyx_tuple__180); Py_CLEAR(__pyx_tuple__181); Py_CLEAR(__pyx_tuple__182); Py_CLEAR(__pyx_tuple__183); Py_CLEAR(__pyx_tuple__184); Py_CLEAR(__pyx_tuple__185); Py_CLEAR(__pyx_tuple__186); Py_CLEAR(__pyx_tuple__187); Py_CLEAR(__pyx_tuple__188); Py_CLEAR(__pyx_tuple__189); Py_CLEAR(__pyx_tuple__190); Py_CLEAR(__pyx_tuple__191); Py_CLEAR(__pyx_tuple__192); Py_CLEAR(__pyx_tuple__193); Py_CLEAR(__pyx_tuple__194); Py_CLEAR(__pyx_tuple__195); Py_CLEAR(__pyx_tuple__196); Py_CLEAR(__pyx_tuple__197); Py_CLEAR(__pyx_tuple__198); Py_CLEAR(__pyx_tuple__199); Py_CLEAR(__pyx_tuple__200); Py_CLEAR(__pyx_tuple__201); Py_CLEAR(__pyx_tuple__202); Py_CLEAR(__pyx_tuple__203); Py_CLEAR(__pyx_tuple__204); Py_CLEAR(__pyx_tuple__205); Py_CLEAR(__pyx_tuple__206); Py_CLEAR(__pyx_tuple__207); Py_CLEAR(__pyx_tuple__208); Py_CLEAR(__pyx_tuple__209); Py_CLEAR(__pyx_tuple__210); Py_CLEAR(__pyx_tuple__211); Py_CLEAR(__pyx_tuple__212); Py_CLEAR(__pyx_tuple__213); Py_CLEAR(__pyx_tuple__214); Py_CLEAR(__pyx_tuple__215); Py_CLEAR(__pyx_tuple__216); Py_CLEAR(__pyx_tuple__217); Py_CLEAR(__pyx_tuple__218); Py_CLEAR(__pyx_tuple__219); Py_CLEAR(__pyx_tuple__220); Py_CLEAR(__pyx_tuple__221); Py_CLEAR(__pyx_tuple__222); Py_CLEAR(__pyx_tuple__223); Py_CLEAR(__pyx_tuple__224); Py_CLEAR(__pyx_tuple__225); Py_CLEAR(__pyx_tuple__226); Py_CLEAR(__pyx_tuple__227); Py_CLEAR(__pyx_tuple__228); Py_CLEAR(__pyx_tuple__229); Py_CLEAR(__pyx_tuple__230); Py_CLEAR(__pyx_tuple__231); Py_CLEAR(__pyx_tuple__232); Py_CLEAR(__pyx_tuple__233); Py_CLEAR(__pyx_tuple__234); Py_CLEAR(__pyx_tuple__235); Py_CLEAR(__pyx_tuple__236); Py_CLEAR(__pyx_tuple__237); Py_CLEAR(__pyx_tuple__238); Py_CLEAR(__pyx_tuple__239); Py_CLEAR(__pyx_tuple__240); Py_CLEAR(__pyx_tuple__241); Py_CLEAR(__pyx_tuple__242); Py_CLEAR(__pyx_tuple__243); Py_CLEAR(__pyx_tuple__244); Py_CLEAR(__pyx_tuple__245); Py_CLEAR(__pyx_tuple__246); Py_CLEAR(__pyx_tuple__247); Py_CLEAR(__pyx_tuple__248); Py_CLEAR(__pyx_tuple__249); Py_CLEAR(__pyx_tuple__250); Py_CLEAR(__pyx_codeobj__251); Py_CLEAR(__pyx_codeobj__252); Py_CLEAR(__pyx_codeobj__253); Py_CLEAR(__pyx_codeobj__254); Py_CLEAR(__pyx_codeobj__255); Py_CLEAR(__pyx_codeobj__256); /* CodeObjectCache.cleanup */ #if !CYTHON_COMPILING_IN_LIMITED_API if (__pyx_code_cache.entries) { __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; int i, count = __pyx_code_cache.count; __pyx_code_cache.count = 0; __pyx_code_cache.max_count = 0; __pyx_code_cache.entries = NULL; for (i=0; i 0) { PyObject* o = (PyObject*)__pyx_freelist_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator[--__pyx_freecount_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator]; #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); #endif } while (__pyx_freecount_8petsc4py_5PETSc___pyx_scope_struct_1_decorator > 0) { PyObject* o = (PyObject*)__pyx_freelist_8petsc4py_5PETSc___pyx_scope_struct_1_decorator[--__pyx_freecount_8petsc4py_5PETSc___pyx_scope_struct_1_decorator]; #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); #endif } Py_CLEAR(__pyx_cython_runtime); Py_CLEAR(__pyx_b); Py_CLEAR(__pyx_d); } /* #### Code section: main_method ### */ /* #### Code section: utility_code_pragmas ### */ #ifdef _MSC_VER #pragma warning( push ) /* Warning 4127: conditional expression is constant * Cython uses constant conditional expressions to allow in inline functions to be optimized at * compile-time, so this warning is not useful */ #pragma warning( disable : 4127 ) #endif /* #### Code section: utility_code_def ### */ /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule(modname); if (!m) goto end; p = PyObject_GetAttrString(m, "RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030C00A6 PyObject *current_exception = tstate->current_exception; if (unlikely(!current_exception)) return 0; exc_type = (PyObject*) Py_TYPE(current_exception); if (exc_type == err) return 1; #else exc_type = tstate->curexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; #endif #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(exc_type); #endif if (unlikely(PyTuple_Check(err))) { result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); } else { result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(exc_type); #endif return result; } #endif /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject *tmp_value; assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); if (value) { #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) #endif PyException_SetTraceback(value, tb); } tmp_value = tstate->current_exception; tstate->current_exception = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject* exc_value; exc_value = tstate->current_exception; tstate->current_exception = 0; *value = exc_value; *type = NULL; *tb = NULL; if (exc_value) { *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); #if CYTHON_COMPILING_IN_CPYTHON *tb = ((PyBaseExceptionObject*) exc_value)->traceback; Py_XINCREF(*tb); #else *tb = PyException_GetTraceback(exc_value); #endif } #else *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif } #endif /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #endif /* PyObjectGetAttrStrNoError */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) __Pyx_PyErr_Clear(); } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); } #endif result = __Pyx_PyObject_GetAttrStr(obj, attr_name); if (unlikely(!result)) { __Pyx_PyObject_GetAttrStr_ClearAttributeError(); } return result; #endif } /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* TupleAndListFromArray */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { PyObject *v; Py_ssize_t i; for (i = 0; i < length; i++) { v = dest[i] = src[i]; Py_INCREF(v); } } static CYTHON_INLINE PyObject * __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { Py_INCREF(__pyx_empty_tuple); return __pyx_empty_tuple; } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); return res; } static CYTHON_INLINE PyObject * __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { return PyList_New(0); } res = PyList_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); return res; } #endif /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { return (equals == Py_EQ); } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { const char *ps1, *ps2; Py_ssize_t length = PyBytes_GET_SIZE(s1); if (length != PyBytes_GET_SIZE(s2)) return (equals == Py_NE); ps1 = PyBytes_AS_STRING(s1); ps2 = PyBytes_AS_STRING(s2); if (ps1[0] != ps2[0]) { return (equals == Py_NE); } else if (length == 1) { return (equals == Py_EQ); } else { int result; #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) Py_hash_t hash1, hash2; hash1 = ((PyBytesObject*)s1)->ob_shash; hash2 = ((PyBytesObject*)s2)->ob_shash; if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { return (equals == Py_NE); } #endif result = memcmp(ps1, ps2, (size_t)length); return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { return (equals == Py_NE); } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { return (equals == Py_NE); } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } #endif } /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else #if PY_MAJOR_VERSION < 3 PyObject* owned_ref = NULL; #endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); #if PY_MAJOR_VERSION < 3 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { owned_ref = PyUnicode_FromObject(s2); if (unlikely(!owned_ref)) return -1; s2 = owned_ref; s2_is_unicode = 1; } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { owned_ref = PyUnicode_FromObject(s1); if (unlikely(!owned_ref)) return -1; s1 = owned_ref; s1_is_unicode = 1; } else if (((!s2_is_unicode) & (!s1_is_unicode))) { return __Pyx_PyBytes_Equals(s1, s2, equals); } #endif if (s1_is_unicode & s2_is_unicode) { Py_ssize_t length; int kind; void *data1, *data2; if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; length = __Pyx_PyUnicode_GET_LENGTH(s1); if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; #else hash1 = ((PyUnicodeObject*)s1)->hash; hash2 = ((PyUnicodeObject*)s2)->hash; #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } } #endif kind = __Pyx_PyUnicode_KIND(s1); if (kind != __Pyx_PyUnicode_KIND(s2)) { goto return_ne; } data1 = __Pyx_PyUnicode_DATA(s1); data2 = __Pyx_PyUnicode_DATA(s2); if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { goto return_ne; } else if (length == 1) { goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { goto return_ne; } else if ((s2 == Py_None) & s1_is_unicode) { goto return_ne; } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } return_eq: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ); return_ne: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_NE); #endif } /* fastcall */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); for (i = 0; i < n; i++) { if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; } for (i = 0; i < n; i++) { int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; // error return kwvalues[i]; } } return NULL; // not found (no exception set) } #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); PyObject *dict; dict = PyDict_New(); if (unlikely(!dict)) return NULL; for (i=0; i= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } /* ParseKeywords */ static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); while (1) { Py_XDECREF(key); key = NULL; Py_XDECREF(value); value = NULL; if (kwds_is_tuple) { Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(kwds); #else size = PyTuple_Size(kwds); if (size < 0) goto bad; #endif if (pos >= size) break; #if CYTHON_AVOID_BORROWED_REFS key = __Pyx_PySequence_ITEM(kwds, pos); if (!key) goto bad; #elif CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kwds, pos); #else key = PyTuple_GetItem(kwds, pos); if (!key) goto bad; #endif value = kwvalues[pos]; pos++; } else { if (!PyDict_Next(kwds, &pos, &key, &value)) break; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif } name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(value); // transfer ownership of value to values Py_DECREF(key); #endif key = NULL; value = NULL; continue; } #if !CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif Py_INCREF(value); name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; // ownership transferred to values #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = ( #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**name, key) ); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; // ownership transferred to values #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } Py_XDECREF(key); Py_XDECREF(value); return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: Py_XDECREF(key); Py_XDECREF(value); return -1; } /* ArgTypeTest */ static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) { __Pyx_TypeName type_name; __Pyx_TypeName obj_type_name; if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } else if (exact) { #if PY_MAJOR_VERSION == 2 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; #endif } else { if (likely(__Pyx_TypeCheck(obj, type))) return 1; } type_name = __Pyx_PyType_GetName(type); obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name); __Pyx_DECREF_TypeName(type_name); __Pyx_DECREF_TypeName(obj_type_name); return 0; } /* RaiseException */ #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { __Pyx_PyThreadState_declare CYTHON_UNUSED_VAR(cause); Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_PyThreadState_assign __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } if (cause) { PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyException_SetTraceback(value, tb); #elif CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #else PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #endif } bad: Py_XDECREF(owned_instance); return; } #endif /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = __Pyx_PyFrame_GetLocalsplus(f); for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { return NULL; } #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } #endif if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectFastCall */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; PyObject *result = 0; size_t i; argstuple = PyTuple_New((Py_ssize_t)nargs); if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: Py_DECREF(argstuple); return result; } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); #if CYTHON_COMPILING_IN_CPYTHON if (nargs == 0 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) return __Pyx_PyObject_CallMethO(func, NULL); } else if (nargs == 1 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) return __Pyx_PyObject_CallMethO(func, args[0]); } #endif #if PY_VERSION_HEX < 0x030800B1 #if CYTHON_FAST_PYCCALL if (PyCFunction_Check(func)) { if (kwargs) { return _PyCFunction_FastCallDict(func, args, nargs, kwargs); } else { return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); } #endif #endif if (kwargs == NULL) { #if CYTHON_VECTORCALL #if PY_VERSION_HEX < 0x03090000 vectorcallfunc f = _PyVectorcall_Function(func); #else vectorcallfunc f = PyVectorcall_Function(func); #endif if (f) { return f(func, args, (size_t)nargs, NULL); } #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL if (__Pyx_CyFunction_CheckExact(func)) { __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); if (f) return f(func, args, (size_t)nargs, NULL); } #endif } if (nargs == 0) { return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); #else return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); #endif } /* RaiseUnexpectedTypeError */ static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj) { __Pyx_TypeName obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "Expected %s, got " __Pyx_FMT_TYPENAME, expected, obj_type_name); __Pyx_DECREF_TypeName(obj_type_name); return 0; } /* CIntToDigits */ static const char DIGIT_PAIRS_10[2*10*10+1] = { "00010203040506070809" "10111213141516171819" "20212223242526272829" "30313233343536373839" "40414243444546474849" "50515253545556575859" "60616263646566676869" "70717273747576777879" "80818283848586878889" "90919293949596979899" }; static const char DIGIT_PAIRS_8[2*8*8+1] = { "0001020304050607" "1011121314151617" "2021222324252627" "3031323334353637" "4041424344454647" "5051525354555657" "6061626364656667" "7071727374757677" }; static const char DIGITS_HEX[2*16+1] = { "0123456789abcdef" "0123456789ABCDEF" }; /* BuildPyUnicode */ static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, char* chars, int clength, int prepend_sign, char padding_char) { PyObject *uval; Py_ssize_t uoffset = ulength - clength; #if CYTHON_USE_UNICODE_INTERNALS Py_ssize_t i; #if CYTHON_PEP393_ENABLED void *udata; uval = PyUnicode_New(ulength, 127); if (unlikely(!uval)) return NULL; udata = PyUnicode_DATA(uval); #else Py_UNICODE *udata; uval = PyUnicode_FromUnicode(NULL, ulength); if (unlikely(!uval)) return NULL; udata = PyUnicode_AS_UNICODE(uval); #endif if (uoffset > 0) { i = 0; if (prepend_sign) { __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, 0, '-'); i++; } for (; i < uoffset; i++) { __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, i, padding_char); } } for (i=0; i < clength; i++) { __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, uoffset+i, chars[i]); } #else { PyObject *sign = NULL, *padding = NULL; uval = NULL; if (uoffset > 0) { prepend_sign = !!prepend_sign; if (uoffset > prepend_sign) { padding = PyUnicode_FromOrdinal(padding_char); if (likely(padding) && uoffset > prepend_sign + 1) { PyObject *tmp; PyObject *repeat = PyInt_FromSsize_t(uoffset - prepend_sign); if (unlikely(!repeat)) goto done_or_error; tmp = PyNumber_Multiply(padding, repeat); Py_DECREF(repeat); Py_DECREF(padding); padding = tmp; } if (unlikely(!padding)) goto done_or_error; } if (prepend_sign) { sign = PyUnicode_FromOrdinal('-'); if (unlikely(!sign)) goto done_or_error; } } uval = PyUnicode_DecodeASCII(chars, clength, NULL); if (likely(uval) && padding) { PyObject *tmp = PyNumber_Add(padding, uval); Py_DECREF(uval); uval = tmp; } if (likely(uval) && sign) { PyObject *tmp = PyNumber_Add(sign, uval); Py_DECREF(uval); uval = tmp; } done_or_error: Py_XDECREF(padding); Py_XDECREF(sign); } #endif return uval; } /* CIntToPyUnicode */ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char, char format_char) { char digits[sizeof(int)*3+2]; char *dpos, *end = digits + sizeof(int)*3+2; const char *hex_digits = DIGITS_HEX; Py_ssize_t length, ulength; int prepend_sign, last_one_off; int remaining; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (format_char == 'X') { hex_digits += 16; format_char = 'x'; } remaining = value; last_one_off = 0; dpos = end; do { int digit_pos; switch (format_char) { case 'o': digit_pos = abs((int)(remaining % (8*8))); remaining = (int) (remaining / (8*8)); dpos -= 2; memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2); last_one_off = (digit_pos < 8); break; case 'd': digit_pos = abs((int)(remaining % (10*10))); remaining = (int) (remaining / (10*10)); dpos -= 2; memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2); last_one_off = (digit_pos < 10); break; case 'x': *(--dpos) = hex_digits[abs((int)(remaining % 16))]; remaining = (int) (remaining / 16); break; default: assert(0); break; } } while (unlikely(remaining != 0)); assert(!last_one_off || *dpos == '0'); dpos += last_one_off; length = end - dpos; ulength = length; prepend_sign = 0; if (!is_unsigned && value <= neg_one) { if (padding_char == ' ' || width <= length + 1) { *(--dpos) = '-'; ++length; } else { prepend_sign = 1; } ++ulength; } if (width > ulength) { ulength = width; } if (ulength == 1) { return PyUnicode_FromOrdinal(*dpos); } return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char); } /* CIntToPyUnicode */ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char, char format_char) { char digits[sizeof(Py_ssize_t)*3+2]; char *dpos, *end = digits + sizeof(Py_ssize_t)*3+2; const char *hex_digits = DIGITS_HEX; Py_ssize_t length, ulength; int prepend_sign, last_one_off; Py_ssize_t remaining; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const Py_ssize_t neg_one = (Py_ssize_t) -1, const_zero = (Py_ssize_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (format_char == 'X') { hex_digits += 16; format_char = 'x'; } remaining = value; last_one_off = 0; dpos = end; do { int digit_pos; switch (format_char) { case 'o': digit_pos = abs((int)(remaining % (8*8))); remaining = (Py_ssize_t) (remaining / (8*8)); dpos -= 2; memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2); last_one_off = (digit_pos < 8); break; case 'd': digit_pos = abs((int)(remaining % (10*10))); remaining = (Py_ssize_t) (remaining / (10*10)); dpos -= 2; memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2); last_one_off = (digit_pos < 10); break; case 'x': *(--dpos) = hex_digits[abs((int)(remaining % 16))]; remaining = (Py_ssize_t) (remaining / 16); break; default: assert(0); break; } } while (unlikely(remaining != 0)); assert(!last_one_off || *dpos == '0'); dpos += last_one_off; length = end - dpos; ulength = length; prepend_sign = 0; if (!is_unsigned && value <= neg_one) { if (padding_char == ' ' || width <= length + 1) { *(--dpos) = '-'; ++length; } else { prepend_sign = 1; } ++ulength; } if (width > ulength) { ulength = width; } if (ulength == 1) { return PyUnicode_FromOrdinal(*dpos); } return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char); } /* JoinPyUnicode */ static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength, Py_UCS4 max_char) { #if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS PyObject *result_uval; int result_ukind, kind_shift; Py_ssize_t i, char_pos; void *result_udata; CYTHON_MAYBE_UNUSED_VAR(max_char); #if CYTHON_PEP393_ENABLED result_uval = PyUnicode_New(result_ulength, max_char); if (unlikely(!result_uval)) return NULL; result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND; kind_shift = (result_ukind == PyUnicode_4BYTE_KIND) ? 2 : result_ukind - 1; result_udata = PyUnicode_DATA(result_uval); #else result_uval = PyUnicode_FromUnicode(NULL, result_ulength); if (unlikely(!result_uval)) return NULL; result_ukind = sizeof(Py_UNICODE); kind_shift = (result_ukind == 4) ? 2 : result_ukind - 1; result_udata = PyUnicode_AS_UNICODE(result_uval); #endif assert(kind_shift == 2 || kind_shift == 1 || kind_shift == 0); char_pos = 0; for (i=0; i < value_count; i++) { int ukind; Py_ssize_t ulength; void *udata; PyObject *uval = PyTuple_GET_ITEM(value_tuple, i); if (unlikely(__Pyx_PyUnicode_READY(uval))) goto bad; ulength = __Pyx_PyUnicode_GET_LENGTH(uval); if (unlikely(!ulength)) continue; if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - ulength < char_pos)) goto overflow; ukind = __Pyx_PyUnicode_KIND(uval); udata = __Pyx_PyUnicode_DATA(uval); if (!CYTHON_PEP393_ENABLED || ukind == result_ukind) { memcpy((char *)result_udata + (char_pos << kind_shift), udata, (size_t) (ulength << kind_shift)); } else { #if PY_VERSION_HEX >= 0x030d0000 if (unlikely(PyUnicode_CopyCharacters(result_uval, char_pos, uval, 0, ulength) < 0)) goto bad; #elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030300F0 || defined(_PyUnicode_FastCopyCharacters) _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength); #else Py_ssize_t j; for (j=0; j < ulength; j++) { Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j); __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar); } #endif } char_pos += ulength; } return result_uval; overflow: PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string"); bad: Py_DECREF(result_uval); return NULL; #else CYTHON_UNUSED_VAR(max_char); CYTHON_UNUSED_VAR(result_ulength); CYTHON_UNUSED_VAR(value_count); return PyUnicode_Join(__pyx_empty_unicode, value_tuple); #endif } /* GetAttr */ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { #if CYTHON_USE_TYPE_SLOTS #if PY_MAJOR_VERSION >= 3 if (likely(PyUnicode_Check(n))) #else if (likely(PyString_Check(n))) #endif return __Pyx_PyObject_GetAttrStr(o, n); #endif return PyObject_GetAttr(o, n); } /* GetItemInt */ static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (unlikely(!j)) return NULL; r = PyObject_GetItem(o, j); Py_DECREF(j); return r; } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyList_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyTuple_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { PyObject *r = PyList_GET_ITEM(o, n); Py_INCREF(r); return r; } } else if (PyTuple_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, n); Py_INCREF(r); return r; } } else { PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; if (mm && mm->mp_subscript) { PyObject *r, *key = PyInt_FromSsize_t(i); if (unlikely(!key)) return NULL; r = mm->mp_subscript(o, key); Py_DECREF(key); return r; } if (likely(sm && sm->sq_item)) { if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { Py_ssize_t l = sm->sq_length(o); if (likely(l >= 0)) { i += l; } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) return NULL; PyErr_Clear(); } } return sm->sq_item(o, i); } } #else if (is_list || !PyMapping_Check(o)) { return PySequence_GetItem(o, i); } #endif return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } /* PyObjectCallOneArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *args[2] = {NULL, arg}; return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* ObjectGetItem */ #if CYTHON_USE_TYPE_SLOTS static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) { PyObject *runerr = NULL; Py_ssize_t key_value; key_value = __Pyx_PyIndex_AsSsize_t(index); if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) { return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1); } if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { __Pyx_TypeName index_type_name = __Pyx_PyType_GetName(Py_TYPE(index)); PyErr_Clear(); PyErr_Format(PyExc_IndexError, "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer", index_type_name); __Pyx_DECREF_TypeName(index_type_name); } return NULL; } static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) { __Pyx_TypeName obj_type_name; if (likely(PyType_Check(obj))) { PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_n_s_class_getitem); if (!meth) { PyErr_Clear(); } else { PyObject *result = __Pyx_PyObject_CallOneArg(meth, key); Py_DECREF(meth); return result; } } obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj_type_name); __Pyx_DECREF_TypeName(obj_type_name); return NULL; } static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) { PyTypeObject *tp = Py_TYPE(obj); PyMappingMethods *mm = tp->tp_as_mapping; PySequenceMethods *sm = tp->tp_as_sequence; if (likely(mm && mm->mp_subscript)) { return mm->mp_subscript(obj, key); } if (likely(sm && sm->sq_item)) { return __Pyx_PyObject_GetIndex(obj, key); } return __Pyx_PyObject_GetItem_Slow(obj, key); } #endif /* DivInt[Py_ssize_t] */ static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) { Py_ssize_t q = a / b; Py_ssize_t r = a - q*b; q -= ((r != 0) & ((r ^ b) < 0)); return q; } /* GetAttr3 */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static PyObject *__Pyx_GetAttr3Default(PyObject *d) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) return NULL; __Pyx_PyErr_Clear(); Py_INCREF(d); return d; } #endif static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { PyObject *r; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 int res = PyObject_GetOptionalAttr(o, n, &r); return (res != 0) ? r : __Pyx_NewRef(d); #else #if CYTHON_USE_TYPE_SLOTS if (likely(PyString_Check(n))) { r = __Pyx_PyObject_GetAttrStrNoError(o, n); if (unlikely(!r) && likely(!PyErr_Occurred())) { r = __Pyx_NewRef(d); } return r; } #endif r = PyObject_GetAttr(o, n); return (likely(r)) ? r : __Pyx_GetAttr3Default(d); #endif } /* PyDictVersioning */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { PyObject *dict = Py_TYPE(obj)->tp_dict; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; } static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { PyObject **dictptr = NULL; Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; if (offset) { #if CYTHON_COMPILING_IN_CPYTHON dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else dictptr = _PyObject_GetDictPtr(obj); #endif } return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; } static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { PyObject *dict = Py_TYPE(obj)->tp_dict; if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) return 0; return obj_dict_version == __Pyx_get_object_dict_version(obj); } #endif /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) #else static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } else if (unlikely(PyErr_Occurred())) { return NULL; } #elif CYTHON_COMPILING_IN_LIMITED_API if (unlikely(!__pyx_m)) { return NULL; } result = PyObject_GetAttr(__pyx_m, name); if (likely(result)) { return result; } #else result = PyDict_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } #endif #else result = PyObject_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } PyErr_Clear(); #endif return __Pyx_GetBuiltinName(name); } /* RaiseTooManyValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); } /* RaiseNeedMoreValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", index, (index == 1) ? "" : "s"); } /* RaiseNoneIterError */ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); } /* ExtTypeTest */ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { __Pyx_TypeName obj_type_name; __Pyx_TypeName type_name; if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } if (likely(__Pyx_TypeCheck(obj, type))) return 1; obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); type_name = __Pyx_PyType_GetName(type); PyErr_Format(PyExc_TypeError, "Cannot convert " __Pyx_FMT_TYPENAME " to " __Pyx_FMT_TYPENAME, obj_type_name, type_name); __Pyx_DECREF_TypeName(obj_type_name); __Pyx_DECREF_TypeName(type_name); return 0; } /* GetTopmostException */ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate) { _PyErr_StackItem *exc_info = tstate->exc_info; while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) && exc_info->previous_item != NULL) { exc_info = exc_info->previous_item; } return exc_info; } #endif /* SaveResetException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); PyObject *exc_value = exc_info->exc_value; if (exc_value == NULL || exc_value == Py_None) { *value = NULL; *type = NULL; *tb = NULL; } else { *value = exc_value; Py_INCREF(*value); *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); *tb = PyException_GetTraceback(exc_value); } #elif CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); *type = exc_info->exc_type; *value = exc_info->exc_value; *tb = exc_info->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); #else *type = tstate->exc_type; *value = tstate->exc_value; *tb = tstate->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); #endif } static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = tstate->exc_info; PyObject *tmp_value = exc_info->exc_value; exc_info->exc_value = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; #if CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = tstate->exc_info; tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = type; exc_info->exc_value = value; exc_info->exc_traceback = tb; #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = type; tstate->exc_value = value; tstate->exc_traceback = tb; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } #endif /* GetException */ #if CYTHON_FAST_THREAD_STATE static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) #endif { PyObject *local_type = NULL, *local_value, *local_tb = NULL; #if CYTHON_FAST_THREAD_STATE PyObject *tmp_type, *tmp_value, *tmp_tb; #if PY_VERSION_HEX >= 0x030C00A6 local_value = tstate->current_exception; tstate->current_exception = 0; if (likely(local_value)) { local_type = (PyObject*) Py_TYPE(local_value); Py_INCREF(local_type); local_tb = PyException_GetTraceback(local_value); } #else local_type = tstate->curexc_type; local_value = tstate->curexc_value; local_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif #else PyErr_Fetch(&local_type, &local_value, &local_tb); #endif PyErr_NormalizeException(&local_type, &local_value, &local_tb); #if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6 if (unlikely(tstate->current_exception)) #elif CYTHON_FAST_THREAD_STATE if (unlikely(tstate->curexc_type)) #else if (unlikely(PyErr_Occurred())) #endif goto bad; #if PY_MAJOR_VERSION >= 3 if (local_tb) { if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) goto bad; } #endif Py_XINCREF(local_tb); Py_XINCREF(local_type); Py_XINCREF(local_value); *type = local_type; *value = local_value; *tb = local_tb; #if CYTHON_FAST_THREAD_STATE #if CYTHON_USE_EXC_INFO_STACK { _PyErr_StackItem *exc_info = tstate->exc_info; #if PY_VERSION_HEX >= 0x030B00a4 tmp_value = exc_info->exc_value; exc_info->exc_value = local_value; tmp_type = NULL; tmp_tb = NULL; Py_XDECREF(local_type); Py_XDECREF(local_tb); #else tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = local_type; exc_info->exc_value = local_value; exc_info->exc_traceback = local_tb; #endif } #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = local_type; tstate->exc_value = local_value; tstate->exc_traceback = local_tb; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_SetExcInfo(local_type, local_value, local_tb); #endif return 0; bad: *type = 0; *value = 0; *tb = 0; Py_XDECREF(local_type); Py_XDECREF(local_value); Py_XDECREF(local_tb); return -1; } /* SwapException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = tstate->exc_info; tmp_value = exc_info->exc_value; exc_info->exc_value = *value; if (tmp_value == NULL || tmp_value == Py_None) { Py_XDECREF(tmp_value); tmp_value = NULL; tmp_type = NULL; tmp_tb = NULL; } else { tmp_type = (PyObject*) Py_TYPE(tmp_value); Py_INCREF(tmp_type); #if CYTHON_COMPILING_IN_CPYTHON tmp_tb = ((PyBaseExceptionObject*) tmp_value)->traceback; Py_XINCREF(tmp_tb); #else tmp_tb = PyException_GetTraceback(tmp_value); #endif } #elif CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = tstate->exc_info; tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = *type; exc_info->exc_value = *value; exc_info->exc_traceback = *tb; #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = *type; tstate->exc_value = *value; tstate->exc_traceback = *tb; #endif *type = tmp_type; *value = tmp_value; *tb = tmp_tb; } #else static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); PyErr_SetExcInfo(*type, *value, *tb); *type = tmp_type; *value = tmp_value; *tb = tmp_tb; } #endif /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *module = 0; PyObject *empty_dict = 0; PyObject *empty_list = 0; #if PY_MAJOR_VERSION < 3 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (unlikely(!py_import)) goto bad; if (!from_list) { empty_list = PyList_New(0); if (unlikely(!empty_list)) goto bad; from_list = empty_list; } #endif empty_dict = PyDict_New(); if (unlikely(!empty_dict)) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, 1); if (unlikely(!module)) { if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_MAJOR_VERSION < 3 PyObject *py_level = PyInt_FromLong(level); if (unlikely(!py_level)) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, level); #endif } } bad: Py_XDECREF(empty_dict); Py_XDECREF(empty_list); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_import); #endif return module; } /* ImportDottedModule */ #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; if (unlikely(PyErr_Occurred())) { PyErr_Clear(); } if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) { partial_name = name; } else { slice = PySequence_GetSlice(parts_tuple, 0, count); if (unlikely(!slice)) goto bad; sep = PyUnicode_FromStringAndSize(".", 1); if (unlikely(!sep)) goto bad; partial_name = PyUnicode_Join(sep, slice); } PyErr_Format( #if PY_MAJOR_VERSION < 3 PyExc_ImportError, "No module named '%s'", PyString_AS_STRING(partial_name)); #else #if PY_VERSION_HEX >= 0x030600B1 PyExc_ModuleNotFoundError, #else PyExc_ImportError, #endif "No module named '%U'", partial_name); #endif bad: Py_XDECREF(sep); Py_XDECREF(slice); Py_XDECREF(partial_name); return NULL; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { PyObject *imported_module; #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) return NULL; imported_module = __Pyx_PyDict_GetItemStr(modules, name); Py_XINCREF(imported_module); #else imported_module = PyImport_GetModule(name); #endif return imported_module; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { Py_ssize_t i, nparts; nparts = PyTuple_GET_SIZE(parts_tuple); for (i=1; i < nparts && module; i++) { PyObject *part, *submodule; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS part = PyTuple_GET_ITEM(parts_tuple, i); #else part = PySequence_ITEM(parts_tuple, i); #endif submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(part); #endif Py_DECREF(module); module = submodule; } if (unlikely(!module)) { return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); } return module; } #endif static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if PY_MAJOR_VERSION < 3 PyObject *module, *from_list, *star = __pyx_n_s__3; CYTHON_UNUSED_VAR(parts_tuple); from_list = PyList_New(1); if (unlikely(!from_list)) return NULL; Py_INCREF(star); PyList_SET_ITEM(from_list, 0, star); module = __Pyx_Import(name, from_list, 0); Py_DECREF(from_list); return module; #else PyObject *imported_module; PyObject *module = __Pyx_Import(name, NULL, 0); if (!parts_tuple || unlikely(!module)) return module; imported_module = __Pyx__ImportDottedModule_Lookup(name); if (likely(imported_module)) { Py_DECREF(module); return imported_module; } PyErr_Clear(); return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); #endif } static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1 PyObject *module = __Pyx__ImportDottedModule_Lookup(name); if (likely(module)) { PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec); if (likely(spec)) { PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing); if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { Py_DECREF(spec); spec = NULL; } Py_XDECREF(unsafe); } if (likely(!spec)) { PyErr_Clear(); return module; } Py_DECREF(spec); Py_DECREF(module); } else if (PyErr_Occurred()) { PyErr_Clear(); } #endif return __Pyx__ImportDottedModule(name, parts_tuple); } /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (cls == a || cls == b) return 1; mro = cls->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { PyObject *base = PyTuple_GET_ITEM(mro, i); if (base == (PyObject *)a || base == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); } else { return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; itp_as_sequence && type->tp_as_sequence->sq_repeat)) { return type->tp_as_sequence->sq_repeat(seq, mul); } else #endif { return __Pyx_PySequence_Multiply_Generic(seq, mul); } } /* SetItemInt */ static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) { int r; if (unlikely(!j)) return -1; r = PyObject_SetItem(o, j, v); Py_DECREF(j); return r; } static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o)); if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o)))) { PyObject* old = PyList_GET_ITEM(o, n); Py_INCREF(v); PyList_SET_ITEM(o, n, v); Py_DECREF(old); return 1; } } else { PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; if (mm && mm->mp_ass_subscript) { int r; PyObject *key = PyInt_FromSsize_t(i); if (unlikely(!key)) return -1; r = mm->mp_ass_subscript(o, key, v); Py_DECREF(key); return r; } if (likely(sm && sm->sq_ass_item)) { if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { Py_ssize_t l = sm->sq_length(o); if (likely(l >= 0)) { i += l; } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) return -1; PyErr_Clear(); } } return sm->sq_ass_item(o, i, v); } } #else if (is_list || !PyMapping_Check(o)) { return PySequence_SetItem(o, i, v); } #endif return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v); } /* RaiseUnboundLocalError */ static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); } /* DivInt[long] */ static CYTHON_INLINE long __Pyx_div_long(long a, long b) { long q = a / b; long r = a - q*b; q -= ((r != 0) & ((r ^ b) < 0)); return q; } /* ImportFrom */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { const char* module_name_str = 0; PyObject* module_name = 0; PyObject* module_dot = 0; PyObject* full_name = 0; PyErr_Clear(); module_name_str = PyModule_GetName(module); if (unlikely(!module_name_str)) { goto modbad; } module_name = PyUnicode_FromString(module_name_str); if (unlikely(!module_name)) { goto modbad; } module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__2); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) goto modbad; value = PyObject_GetItem(modules, full_name); } #else value = PyImport_GetModule(full_name); #endif modbad: Py_XDECREF(full_name); Py_XDECREF(module_dot); Py_XDECREF(module_name); } if (unlikely(!value)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } /* HasAttr */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) { PyObject *r; if (unlikely(!__Pyx_PyBaseString_Check(n))) { PyErr_SetString(PyExc_TypeError, "hasattr(): attribute name must be string"); return -1; } r = __Pyx_GetAttr(o, n); if (!r) { PyErr_Clear(); return 0; } else { Py_DECREF(r); return 1; } } #endif /* PyObjectCall2Args */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { PyObject *args[3] = {NULL, arg1, arg2}; return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectGetMethod */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { PyObject *attr; #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP __Pyx_TypeName type_name; PyTypeObject *tp = Py_TYPE(obj); PyObject *descr; descrgetfunc f = NULL; PyObject **dictptr, *dict; int meth_found = 0; assert (*method == NULL); if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; } if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { return 0; } descr = _PyType_Lookup(tp, name); if (likely(descr != NULL)) { Py_INCREF(descr); #if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR)) #elif PY_MAJOR_VERSION >= 3 #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type))) #endif #else #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr))) #endif #endif { meth_found = 1; } else { f = Py_TYPE(descr)->tp_descr_get; if (f != NULL && PyDescr_IsData(descr)) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } } } dictptr = _PyObject_GetDictPtr(obj); if (dictptr != NULL && (dict = *dictptr) != NULL) { Py_INCREF(dict); attr = __Pyx_PyDict_GetItemStr(dict, name); if (attr != NULL) { Py_INCREF(attr); Py_DECREF(dict); Py_XDECREF(descr); goto try_unpack; } Py_DECREF(dict); } if (meth_found) { *method = descr; return 1; } if (f != NULL) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } if (likely(descr != NULL)) { *method = descr; return 0; } type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(name)); #endif __Pyx_DECREF_TypeName(type_name); return 0; #else attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; #endif try_unpack: #if CYTHON_UNPACK_METHODS if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { PyObject *function = PyMethod_GET_FUNCTION(attr); Py_INCREF(function); Py_DECREF(attr); *method = function; return 1; } #endif *method = attr; return 0; } /* PyObjectCallMethod1 */ #if !(CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C00A2) static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) { PyObject *result = __Pyx_PyObject_CallOneArg(method, arg); Py_DECREF(method); return result; } #endif static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { #if CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C00A2 PyObject *args[2] = {obj, arg}; (void) __Pyx_PyObject_GetMethod; (void) __Pyx_PyObject_CallOneArg; (void) __Pyx_PyObject_Call2Args; return PyObject_VectorcallMethod(method_name, args, 2 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL); #else PyObject *method = NULL, *result; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { result = __Pyx_PyObject_Call2Args(method, obj, arg); Py_DECREF(method); return result; } if (unlikely(!method)) return NULL; return __Pyx__PyObject_CallMethod1(method, arg); #endif } /* StringJoin */ static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) { (void) __Pyx_PyObject_CallMethod1; #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION < 3 return _PyString_Join(sep, values); #elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 return _PyBytes_Join(sep, values); #else return __Pyx_PyObject_CallMethod1(sep, __pyx_n_s_join, values); #endif } /* CIntToPyUnicode */ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_size_t(size_t value, Py_ssize_t width, char padding_char, char format_char) { char digits[sizeof(size_t)*3+2]; char *dpos, *end = digits + sizeof(size_t)*3+2; const char *hex_digits = DIGITS_HEX; Py_ssize_t length, ulength; int prepend_sign, last_one_off; size_t remaining; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const size_t neg_one = (size_t) -1, const_zero = (size_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (format_char == 'X') { hex_digits += 16; format_char = 'x'; } remaining = value; last_one_off = 0; dpos = end; do { int digit_pos; switch (format_char) { case 'o': digit_pos = abs((int)(remaining % (8*8))); remaining = (size_t) (remaining / (8*8)); dpos -= 2; memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2); last_one_off = (digit_pos < 8); break; case 'd': digit_pos = abs((int)(remaining % (10*10))); remaining = (size_t) (remaining / (10*10)); dpos -= 2; memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2); last_one_off = (digit_pos < 10); break; case 'x': *(--dpos) = hex_digits[abs((int)(remaining % 16))]; remaining = (size_t) (remaining / 16); break; default: assert(0); break; } } while (unlikely(remaining != 0)); assert(!last_one_off || *dpos == '0'); dpos += last_one_off; length = end - dpos; ulength = length; prepend_sign = 0; if (!is_unsigned && value <= neg_one) { if (padding_char == ' ' || width <= length + 1) { *(--dpos) = '-'; ++length; } else { prepend_sign = 1; } ++ulength; } if (width > ulength) { ulength = width; } if (ulength == 1) { return PyUnicode_FromOrdinal(*dpos); } return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char); } /* decode_c_bytes */ static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes( const char* cstring, Py_ssize_t length, Py_ssize_t start, Py_ssize_t stop, const char* encoding, const char* errors, PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) { if (unlikely((start < 0) | (stop < 0))) { if (start < 0) { start += length; if (start < 0) start = 0; } if (stop < 0) stop += length; } if (stop > length) stop = length; if (unlikely(stop <= start)) return __Pyx_NewRef(__pyx_empty_unicode); length = stop - start; cstring += start; if (decode_func) { return decode_func(cstring, length, errors); } else { return PyUnicode_Decode(cstring, length, encoding, errors); } } /* WriteUnraisableException */ static void __Pyx_WriteUnraisable(const char *name, int clineno, int lineno, const char *filename, int full_traceback, int nogil) { PyObject *old_exc, *old_val, *old_tb; PyObject *ctx; __Pyx_PyThreadState_declare #ifdef WITH_THREAD PyGILState_STATE state; if (nogil) state = PyGILState_Ensure(); else state = (PyGILState_STATE)0; #endif CYTHON_UNUSED_VAR(clineno); CYTHON_UNUSED_VAR(lineno); CYTHON_UNUSED_VAR(filename); CYTHON_MAYBE_UNUSED_VAR(nogil); __Pyx_PyThreadState_assign __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); if (full_traceback) { Py_XINCREF(old_exc); Py_XINCREF(old_val); Py_XINCREF(old_tb); __Pyx_ErrRestore(old_exc, old_val, old_tb); PyErr_PrintEx(1); } #if PY_MAJOR_VERSION < 3 ctx = PyString_FromString(name); #else ctx = PyUnicode_FromString(name); #endif __Pyx_ErrRestore(old_exc, old_val, old_tb); if (!ctx) { PyErr_WriteUnraisable(Py_None); } else { PyErr_WriteUnraisable(ctx); Py_DECREF(ctx); } #ifdef WITH_THREAD if (nogil) PyGILState_Release(state); #endif } /* pop_index */ static PyObject* __Pyx__PyObject_PopNewIndex(PyObject* L, PyObject* py_ix) { PyObject *r; if (unlikely(!py_ix)) return NULL; r = __Pyx__PyObject_PopIndex(L, py_ix); Py_DECREF(py_ix); return r; } static PyObject* __Pyx__PyObject_PopIndex(PyObject* L, PyObject* py_ix) { return __Pyx_PyObject_CallMethod1(L, __pyx_n_s_pop, py_ix); } #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static PyObject* __Pyx__PyList_PopIndex(PyObject* L, PyObject* py_ix, Py_ssize_t ix) { Py_ssize_t size = PyList_GET_SIZE(L); if (likely(size > (((PyListObject*)L)->allocated >> 1))) { Py_ssize_t cix = ix; if (cix < 0) { cix += size; } if (likely(__Pyx_is_valid_index(cix, size))) { PyObject* v = PyList_GET_ITEM(L, cix); __Pyx_SET_SIZE(L, Py_SIZE(L) - 1); size -= 1; memmove(&PyList_GET_ITEM(L, cix), &PyList_GET_ITEM(L, cix+1), (size_t)(size-cix)*sizeof(PyObject*)); return v; } } if (py_ix == Py_None) { return __Pyx__PyObject_PopNewIndex(L, PyInt_FromSsize_t(ix)); } else { return __Pyx__PyObject_PopIndex(L, py_ix); } } #endif /* SliceObject */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop, PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice, int has_cstart, int has_cstop, int wraparound) { __Pyx_TypeName obj_type_name; #if CYTHON_USE_TYPE_SLOTS PyMappingMethods* mp; #if PY_MAJOR_VERSION < 3 PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; if (likely(ms && ms->sq_slice)) { if (!has_cstart) { if (_py_start && (*_py_start != Py_None)) { cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; } else cstart = 0; } if (!has_cstop) { if (_py_stop && (*_py_stop != Py_None)) { cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; } else cstop = PY_SSIZE_T_MAX; } if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { Py_ssize_t l = ms->sq_length(obj); if (likely(l >= 0)) { if (cstop < 0) { cstop += l; if (cstop < 0) cstop = 0; } if (cstart < 0) { cstart += l; if (cstart < 0) cstart = 0; } } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) goto bad; PyErr_Clear(); } } return ms->sq_slice(obj, cstart, cstop); } #else CYTHON_UNUSED_VAR(wraparound); #endif mp = Py_TYPE(obj)->tp_as_mapping; if (likely(mp && mp->mp_subscript)) #else CYTHON_UNUSED_VAR(wraparound); #endif { PyObject* result; PyObject *py_slice, *py_start, *py_stop; if (_py_slice) { py_slice = *_py_slice; } else { PyObject* owned_start = NULL; PyObject* owned_stop = NULL; if (_py_start) { py_start = *_py_start; } else { if (has_cstart) { owned_start = py_start = PyInt_FromSsize_t(cstart); if (unlikely(!py_start)) goto bad; } else py_start = Py_None; } if (_py_stop) { py_stop = *_py_stop; } else { if (has_cstop) { owned_stop = py_stop = PyInt_FromSsize_t(cstop); if (unlikely(!py_stop)) { Py_XDECREF(owned_start); goto bad; } } else py_stop = Py_None; } py_slice = PySlice_New(py_start, py_stop, Py_None); Py_XDECREF(owned_start); Py_XDECREF(owned_stop); if (unlikely(!py_slice)) goto bad; } #if CYTHON_USE_TYPE_SLOTS result = mp->mp_subscript(obj, py_slice); #else result = PyObject_GetItem(obj, py_slice); #endif if (!_py_slice) { Py_DECREF(py_slice); } return result; } obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "'" __Pyx_FMT_TYPENAME "' object is unsliceable", obj_type_name); __Pyx_DECREF_TypeName(obj_type_name); bad: return NULL; } /* PyObjectCallNoArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { PyObject *arg[2] = {NULL, NULL}; return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* IterFinish */ static CYTHON_INLINE int __Pyx_IterFinish(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType(); if (unlikely(exc_type)) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) return -1; __Pyx_PyErr_Clear(); return 0; } return 0; } /* UnpackItemEndCheck */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); return -1; } return __Pyx_IterFinish(); } /* PyObjectSetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_setattro)) return tp->tp_setattro(obj, attr_name, value); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_setattr)) return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); #endif return PyObject_SetAttr(obj, attr_name, value); } #endif /* UnpackUnboundCMethod */ static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) { PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args)); if (unlikely(!selfless_args)) return NULL; PyObject *result = PyObject_Call(method, selfless_args, kwargs); Py_DECREF(selfless_args); return result; } static PyMethodDef __Pyx_UnboundCMethod_Def = { "CythonUnboundCMethod", __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall), METH_VARARGS | METH_KEYWORDS, NULL }; static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { PyObject *method; method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name); if (unlikely(!method)) return -1; target->method = method; #if CYTHON_COMPILING_IN_CPYTHON #if PY_MAJOR_VERSION >= 3 if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type))) #else if (likely(!__Pyx_CyOrPyCFunction_Check(method))) #endif { PyMethodDescrObject *descr = (PyMethodDescrObject*) method; target->func = descr->d_method->ml_meth; target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS); } else #endif #if CYTHON_COMPILING_IN_PYPY #else if (PyCFunction_Check(method)) #endif { PyObject *self; int self_found; #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY self = PyObject_GetAttrString(method, "__self__"); if (!self) { PyErr_Clear(); } #else self = PyCFunction_GET_SELF(method); #endif self_found = (self && self != Py_None); #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY Py_XDECREF(self); #endif if (self_found) { PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method); if (unlikely(!unbound_method)) return -1; Py_DECREF(method); target->method = unbound_method; } } return 0; } /* CallUnboundCMethod1 */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg) { if (likely(cfunc->func)) { int flag = cfunc->flag; if (flag == METH_O) { return (*(cfunc->func))(self, arg); } else if ((PY_VERSION_HEX >= 0x030600B1) && flag == METH_FASTCALL) { #if PY_VERSION_HEX >= 0x030700A0 return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, &arg, 1); #else return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL); #endif } else if ((PY_VERSION_HEX >= 0x030700A0) && flag == (METH_FASTCALL | METH_KEYWORDS)) { return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL); } } return __Pyx__CallUnboundCMethod1(cfunc, self, arg); } #endif static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){ PyObject *args, *result = NULL; if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; #if CYTHON_COMPILING_IN_CPYTHON if (cfunc->func && (cfunc->flag & METH_VARARGS)) { args = PyTuple_New(1); if (unlikely(!args)) goto bad; Py_INCREF(arg); PyTuple_SET_ITEM(args, 0, arg); if (cfunc->flag & METH_KEYWORDS) result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL); else result = (*cfunc->func)(self, args); } else { args = PyTuple_New(2); if (unlikely(!args)) goto bad; Py_INCREF(self); PyTuple_SET_ITEM(args, 0, self); Py_INCREF(arg); PyTuple_SET_ITEM(args, 1, arg); result = __Pyx_PyObject_Call(cfunc->method, args, NULL); } #else args = PyTuple_Pack(2, self, arg); if (unlikely(!args)) goto bad; result = __Pyx_PyObject_Call(cfunc->method, args, NULL); #endif bad: Py_XDECREF(args); return result; } /* CallUnboundCMethod2 */ #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1 static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) { if (likely(cfunc->func)) { PyObject *args[2] = {arg1, arg2}; if (cfunc->flag == METH_FASTCALL) { #if PY_VERSION_HEX >= 0x030700A0 return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, args, 2); #else return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL); #endif } #if PY_VERSION_HEX >= 0x030700A0 if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS)) return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL); #endif } return __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2); } #endif static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){ PyObject *args, *result = NULL; if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; #if CYTHON_COMPILING_IN_CPYTHON if (cfunc->func && (cfunc->flag & METH_VARARGS)) { args = PyTuple_New(2); if (unlikely(!args)) goto bad; Py_INCREF(arg1); PyTuple_SET_ITEM(args, 0, arg1); Py_INCREF(arg2); PyTuple_SET_ITEM(args, 1, arg2); if (cfunc->flag & METH_KEYWORDS) result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL); else result = (*cfunc->func)(self, args); } else { args = PyTuple_New(3); if (unlikely(!args)) goto bad; Py_INCREF(self); PyTuple_SET_ITEM(args, 0, self); Py_INCREF(arg1); PyTuple_SET_ITEM(args, 1, arg1); Py_INCREF(arg2); PyTuple_SET_ITEM(args, 2, arg2); result = __Pyx_PyObject_Call(cfunc->method, args, NULL); } #else args = PyTuple_Pack(3, self, arg1, arg2); if (unlikely(!args)) goto bad; result = __Pyx_PyObject_Call(cfunc->method, args, NULL); #endif bad: Py_XDECREF(args); return result; } /* dict_getitem_default */ static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) { PyObject* value; #if PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) value = PyDict_GetItemWithError(d, key); if (unlikely(!value)) { if (unlikely(PyErr_Occurred())) return NULL; value = default_value; } Py_INCREF(value); if ((1)); #else if (PyString_CheckExact(key) || PyUnicode_CheckExact(key) || PyInt_CheckExact(key)) { value = PyDict_GetItem(d, key); if (unlikely(!value)) { value = default_value; } Py_INCREF(value); } #endif else { if (default_value == Py_None) value = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_get, d, key); else value = __Pyx_CallUnboundCMethod2(&__pyx_umethod_PyDict_Type_get, d, key, default_value); } return value; } /* py_dict_pop */ static CYTHON_INLINE PyObject *__Pyx_PyDict_Pop(PyObject *d, PyObject *key, PyObject *default_value) { #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B3 & PY_VERSION_HEX < 0x030d0000 if ((1)) { return _PyDict_Pop(d, key, default_value); } else #endif if (default_value) { return __Pyx_CallUnboundCMethod2(&__pyx_umethod_PyDict_Type_pop, d, key, default_value); } else { return __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_pop, d, key); } } /* CallUnboundCMethod0 */ static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) { PyObject *args, *result = NULL; if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; #if CYTHON_ASSUME_SAFE_MACROS args = PyTuple_New(1); if (unlikely(!args)) goto bad; Py_INCREF(self); PyTuple_SET_ITEM(args, 0, self); #else args = PyTuple_Pack(1, self); if (unlikely(!args)) goto bad; #endif result = __Pyx_PyObject_Call(cfunc->method, args, NULL); Py_DECREF(args); bad: return result; } /* py_dict_keys */ static CYTHON_INLINE PyObject* __Pyx_PyDict_Keys(PyObject* d) { if (PY_MAJOR_VERSION >= 3) return __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyDict_Type_keys, d); else return PyDict_Keys(d); } /* PyIntCompare */ static CYTHON_INLINE int __Pyx_PyInt_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace) { CYTHON_MAYBE_UNUSED_VAR(intval); CYTHON_UNUSED_VAR(inplace); if (op1 == op2) { return 1; } #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long a = PyInt_AS_LONG(op1); return (a == b); } #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { int unequal; unsigned long uintval; Py_ssize_t size = __Pyx_PyLong_DigitCount(op1); const digit* digits = __Pyx_PyLong_Digits(op1); if (intval == 0) { return (__Pyx_PyLong_IsZero(op1) == 1); } else if (intval < 0) { if (__Pyx_PyLong_IsNonNeg(op1)) return 0; intval = -intval; } else { if (__Pyx_PyLong_IsNeg(op1)) return 0; } uintval = (unsigned long) intval; #if PyLong_SHIFT * 4 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 4)) { unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); } else #endif #if PyLong_SHIFT * 3 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 3)) { unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); } else #endif #if PyLong_SHIFT * 2 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 2)) { unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); } else #endif #if PyLong_SHIFT * 1 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 1)) { unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); } else #endif unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK)); return (unequal == 0); } #endif if (PyFloat_CheckExact(op1)) { const long b = intval; #if CYTHON_COMPILING_IN_LIMITED_API double a = __pyx_PyFloat_AsDouble(op1); #else double a = PyFloat_AS_DOUBLE(op1); #endif return ((double)a == (double)b); } return __Pyx_PyObject_IsTrueAndDecref( PyObject_RichCompare(op1, op2, Py_EQ)); } /* PyIntBinop */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { CYTHON_MAYBE_UNUSED_VAR(intval); CYTHON_MAYBE_UNUSED_VAR(inplace); CYTHON_UNUSED_VAR(zerodivision_check); #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long x; long a = PyInt_AS_LONG(op1); x = (long)((unsigned long)a + (unsigned long)b); if (likely((x^a) >= 0 || (x^b) >= 0)) return PyInt_FromLong(x); return PyLong_Type.tp_as_number->nb_add(op1, op2); } #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { const long b = intval; long a, x; #ifdef HAVE_LONG_LONG const PY_LONG_LONG llb = intval; PY_LONG_LONG lla, llx; #endif if (unlikely(__Pyx_PyLong_IsZero(op1))) { return __Pyx_NewRef(op2); } if (likely(__Pyx_PyLong_IsCompact(op1))) { a = __Pyx_PyLong_CompactValue(op1); } else { const digit* digits = __Pyx_PyLong_Digits(op1); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1); switch (size) { case -2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; default: return PyLong_Type.tp_as_number->nb_add(op1, op2); } } x = a + b; return PyLong_FromLong(x); #ifdef HAVE_LONG_LONG long_long: llx = lla + llb; return PyLong_FromLongLong(llx); #endif } #endif if (PyFloat_CheckExact(op1)) { const long b = intval; #if CYTHON_COMPILING_IN_LIMITED_API double a = __pyx_PyFloat_AsDouble(op1); #else double a = PyFloat_AS_DOUBLE(op1); #endif double result; PyFPE_START_PROTECT("add", return NULL) result = ((double)a) + (double)b; PyFPE_END_PROTECT(result) return PyFloat_FromDouble(result); } return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2); } #endif /* pyfrozenset_new */ static CYTHON_INLINE PyObject* __Pyx_PyFrozenSet_New(PyObject* it) { if (it) { PyObject* result; #if CYTHON_COMPILING_IN_PYPY PyObject* args; args = PyTuple_Pack(1, it); if (unlikely(!args)) return NULL; result = PyObject_Call((PyObject*)&PyFrozenSet_Type, args, NULL); Py_DECREF(args); return result; #else if (PyFrozenSet_CheckExact(it)) { Py_INCREF(it); return it; } result = PyFrozenSet_New(it); if (unlikely(!result)) return NULL; if ((PY_VERSION_HEX >= 0x031000A1) || likely(PySet_GET_SIZE(result))) return result; Py_DECREF(result); #endif } #if CYTHON_USE_TYPE_SLOTS return PyFrozenSet_Type.tp_new(&PyFrozenSet_Type, __pyx_empty_tuple, NULL); #else return PyObject_Call((PyObject*)&PyFrozenSet_Type, __pyx_empty_tuple, NULL); #endif } /* PySetContains */ static int __Pyx_PySet_ContainsUnhashable(PyObject *set, PyObject *key) { int result = -1; if (PySet_Check(key) && PyErr_ExceptionMatches(PyExc_TypeError)) { PyObject *tmpkey; PyErr_Clear(); tmpkey = __Pyx_PyFrozenSet_New(key); if (tmpkey != NULL) { result = PySet_Contains(set, tmpkey); Py_DECREF(tmpkey); } } return result; } static CYTHON_INLINE int __Pyx_PySet_ContainsTF(PyObject* key, PyObject* set, int eq) { int result = PySet_Contains(set, key); if (unlikely(result < 0)) { result = __Pyx_PySet_ContainsUnhashable(set, key); } return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); } /* append */ static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) { if (likely(PyList_CheckExact(L))) { if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1; } else { PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x); if (unlikely(!retval)) return -1; Py_DECREF(retval); } return 0; } /* PyObjectFormatAndDecref */ static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f) { if (unlikely(!s)) return NULL; if (likely(PyUnicode_CheckExact(s))) return s; #if PY_MAJOR_VERSION < 3 if (likely(PyString_CheckExact(s))) { PyObject *result = PyUnicode_FromEncodedObject(s, NULL, "strict"); Py_DECREF(s); return result; } #endif return __Pyx_PyObject_FormatAndDecref(s, f); } static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f) { PyObject *result; if (unlikely(!s)) return NULL; result = PyObject_Format(s, f); Py_DECREF(s); return result; } /* RaiseClosureNameError */ static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) { PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname); } /* PyObjectLookupSpecial */ #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error) { PyObject *res; PyTypeObject *tp = Py_TYPE(obj); #if PY_MAJOR_VERSION < 3 if (unlikely(PyInstance_Check(obj))) return with_error ? __Pyx_PyObject_GetAttrStr(obj, attr_name) : __Pyx_PyObject_GetAttrStrNoError(obj, attr_name); #endif res = _PyType_Lookup(tp, attr_name); if (likely(res)) { descrgetfunc f = Py_TYPE(res)->tp_descr_get; if (!f) { Py_INCREF(res); } else { res = f(res, obj, (PyObject *)tp); } } else if (with_error) { PyErr_SetObject(PyExc_AttributeError, attr_name); } return res; } #endif /* FixUpExtensionType */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(spec); CYTHON_UNUSED_VAR(type); #else const PyType_Slot *slot = spec->slots; while (slot && slot->slot && slot->slot != Py_tp_members) slot++; if (slot && slot->slot == Py_tp_members) { int changed = 0; #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) const #endif PyMemberDef *memb = (PyMemberDef*) slot->pfunc; while (memb && memb->name) { if (memb->name[0] == '_' && memb->name[1] == '_') { #if PY_VERSION_HEX < 0x030900b1 if (strcmp(memb->name, "__weaklistoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_weaklistoffset = memb->offset; changed = 1; } else if (strcmp(memb->name, "__dictoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_dictoffset = memb->offset; changed = 1; } #if CYTHON_METH_FASTCALL else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); #if PY_VERSION_HEX >= 0x030800b4 type->tp_vectorcall_offset = memb->offset; #else type->tp_print = (printfunc) memb->offset; #endif changed = 1; } #endif #else if ((0)); #endif #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON else if (strcmp(memb->name, "__module__") == 0) { PyObject *descr; assert(memb->type == T_OBJECT); assert(memb->flags == 0 || memb->flags == READONLY); descr = PyDescr_NewMember(type, memb); if (unlikely(!descr)) return -1; if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { Py_DECREF(descr); return -1; } Py_DECREF(descr); changed = 1; } #endif } memb++; } if (changed) PyType_Modified(type); } #endif return 0; } #endif /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); } /* FetchCommonType */ static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, Py_ssize_t basicsize, Py_ssize_t expected_basicsize) { if (!PyType_Check(cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", name); return -1; } if (basicsize != expected_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", name); return -1; } return 0; } #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* abi_module; const char* object_name; PyTypeObject *cached_type = NULL; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; object_name = strrchr(type->tp_name, '.'); object_name = object_name ? object_name+1 : type->tp_name; cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); if (cached_type) { if (__Pyx_VerifyCachedType( (PyObject *)cached_type, object_name, cached_type->tp_basicsize, type->tp_basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) goto bad; Py_INCREF(type); cached_type = type; done: Py_DECREF(abi_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #else static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *abi_module, *cached_type = NULL; const char* object_name = strrchr(spec->name, '.'); object_name = object_name ? object_name+1 : spec->name; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; cached_type = PyObject_GetAttrString(abi_module, object_name); if (cached_type) { Py_ssize_t basicsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); if (unlikely(!py_basicsize)) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; #else basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; #endif if (__Pyx_VerifyCachedType( cached_type, object_name, basicsize, spec->basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); CYTHON_UNUSED_VAR(module); cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); if (unlikely(!cached_type)) goto bad; if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; done: Py_DECREF(abi_module); assert(cached_type == NULL || PyType_Check(cached_type)); return (PyTypeObject *) cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #endif /* PyVectorcallFastCallDict */ #if CYTHON_METH_FASTCALL static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; PyObject *kwnames; PyObject **newargs; PyObject **kwvalues; Py_ssize_t i, pos; size_t j; PyObject *key, *value; unsigned long keys_are_strings; Py_ssize_t nkw = PyDict_GET_SIZE(kw); newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); if (unlikely(newargs == NULL)) { PyErr_NoMemory(); return NULL; } for (j = 0; j < nargs; j++) newargs[j] = args[j]; kwnames = PyTuple_New(nkw); if (unlikely(kwnames == NULL)) { PyMem_Free(newargs); return NULL; } kwvalues = newargs + nargs; pos = i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; while (PyDict_Next(kw, &pos, &key, &value)) { keys_are_strings &= Py_TYPE(key)->tp_flags; Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(kwnames, i, key); kwvalues[i] = value; i++; } if (unlikely(!keys_are_strings)) { PyErr_SetString(PyExc_TypeError, "keywords must be strings"); goto cleanup; } res = vc(func, newargs, nargs, kwnames); cleanup: Py_DECREF(kwnames); for (i = 0; i < nkw; i++) Py_DECREF(kwvalues[i]); PyMem_Free(newargs); return res; } static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { return vc(func, args, nargs, NULL); } return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif /* CythonFunctionShared */ #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { if (__Pyx_CyFunction_Check(func)) { return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; } else if (PyCFunction_Check(func)) { return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; } return 0; } #else static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; } #endif static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API __Pyx_Py_XDECREF_SET( __Pyx_CyFunction_GetClassObj(f), ((classobj) ? __Pyx_NewRef(classobj) : NULL)); #else __Pyx_Py_XDECREF_SET( ((PyCMethodObject *) (f))->mm_class, (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); #endif } static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) { CYTHON_UNUSED_VAR(closure); if (unlikely(op->func_doc == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); if (unlikely(!op->func_doc)) return NULL; #else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #else op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } #endif } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (value == NULL) { value = Py_None; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_doc, value); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_name == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_name = PyObject_GetAttrString(op->func, "__name__"); #elif PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_name, value); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_qualname, value); return 0; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_dict, value); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(op); CYTHON_UNUSED_VAR(context); Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) { PyObject* result = (op->func_code) ? op->func_code : Py_None; CYTHON_UNUSED_VAR(context); Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_tuple; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_kwdict; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value || value == Py_None) { value = NULL; } else if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); __Pyx_Py_XDECREF_SET(op->func_annotations, value); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->func_annotations; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyObject * __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { int is_coroutine; CYTHON_UNUSED_VAR(context); if (op->func_is_coroutine) { return __Pyx_NewRef(op->func_is_coroutine); } is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; #if PY_VERSION_HEX >= 0x03050000 if (is_coroutine) { PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); #if CYTHON_ASSUME_SAFE_MACROS PyList_SET_ITEM(fromlist, 0, marker); #else if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { Py_DECREF(marker); Py_DECREF(fromlist); return NULL; } #endif module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); Py_DECREF(module); if (likely(op->func_is_coroutine)) { return __Pyx_NewRef(op->func_is_coroutine); } ignore: PyErr_Clear(); } #endif op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); return __Pyx_NewRef(op->func_is_coroutine); } #if CYTHON_COMPILING_IN_LIMITED_API static PyObject * __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_GetAttrString(op->func, "__module__"); } static int __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_SetAttrString(op->func, "__module__", value); } #endif static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, #if CYTHON_COMPILING_IN_LIMITED_API {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, #endif {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif #if CYTHON_USE_TYPE_SPECS {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL #if CYTHON_BACKPORT_VECTORCALL {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif #endif #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, #endif #endif {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) { CYTHON_UNUSED_VAR(args); #if PY_MAJOR_VERSION >= 3 Py_INCREF(m->func_qualname); return m->func_qualname; #else return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) #endif static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { #if !CYTHON_COMPILING_IN_LIMITED_API PyCFunctionObject *cf = (PyCFunctionObject*) op; #endif if (unlikely(op == NULL)) return NULL; #if CYTHON_COMPILING_IN_LIMITED_API op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); if (unlikely(!op->func)) return NULL; #endif op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; #if !CYTHON_COMPILING_IN_LIMITED_API cf->m_ml = ml; cf->m_self = (PyObject *) op; #endif Py_XINCREF(closure); op->func_closure = closure; #if !CYTHON_COMPILING_IN_LIMITED_API Py_XINCREF(module); cf->m_module = module; #endif op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API op->func_classobj = NULL; #else ((PyCMethodObject*)op)->mm_class = NULL; #endif op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; op->func_is_coroutine = NULL; #if CYTHON_METH_FASTCALL switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { case METH_NOARGS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; break; case METH_O: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; break; case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; break; case METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; break; case METH_VARARGS | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = NULL; break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); Py_DECREF(op); return NULL; } #endif return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(m->func); #else Py_CLEAR(((PyCFunctionObject*)m)->m_module); #endif Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API #if PY_VERSION_HEX < 0x030900B1 Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); #else { PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; ((PyCMethodObject *) (m))->mm_class = NULL; Py_XDECREF(cls); } #endif #endif Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); Py_CLEAR(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) { if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); __Pyx_PyHeapTypeObject_GC_Del(m); } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); __Pyx__CyFunction_dealloc(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func); #else Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); #endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); Py_VISIT(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *f = ((__pyx_CyFunctionObject*)func)->func; PyObject *py_name = NULL; PyCFunction meth; int flags; meth = PyCFunction_GetFunction(f); if (unlikely(!meth)) return NULL; flags = PyCFunction_GetFlags(f); if (unlikely(flags < 0)) return NULL; #else PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; int flags = f->m_ml->ml_flags; #endif Py_ssize_t size; switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 0)) return (*meth)(self, NULL); #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(arg0); #endif return result; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", py_name); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); #endif return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *self, *result; #if CYTHON_COMPILING_IN_LIMITED_API self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); if (unlikely(!self) && PyErr_Occurred()) return NULL; #else self = ((PyCFunctionObject*)func)->m_self; #endif result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); return result; } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; #if CYTHON_METH_FASTCALL __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { #if CYTHON_ASSUME_SAFE_MACROS return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); #else (void) &__Pyx_PyVectorcall_FastCallDict; return PyVectorcall_Call(func, args, kw); #endif } #endif if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { Py_ssize_t argc; PyObject *new_args; PyObject *self; #if CYTHON_ASSUME_SAFE_MACROS argc = PyTuple_GET_SIZE(args); #else argc = PyTuple_Size(args); if (unlikely(!argc) < 0) return NULL; #endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); #if PY_MAJOR_VERSION > 2 PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); #else PyErr_SetString(PyExc_TypeError, "unbound method needs an argument"); #endif return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); Py_DECREF(new_args); } else { result = __Pyx_CyFunction_Call(func, args, kw); } return result; } #if CYTHON_METH_FASTCALL static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { if (unlikely(nargs < 1)) { PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } ret = 1; } if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } return ret; } static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 0)) { PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, NULL); } static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 1)) { PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, args[0]); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); } #endif #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_CyFunctionType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, {Py_tp_methods, (void *)__pyx_CyFunction_methods}, {Py_tp_members, (void *)__pyx_CyFunction_members}, {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, {0, 0}, }; static PyType_Spec __pyx_CyFunctionType_spec = { __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; #else static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, #if !CYTHON_METH_FASTCALL 0, #elif CYTHON_BACKPORT_VECTORCALL (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), #else offsetof(PyCFunctionObject, vectorcall), #endif 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_CallAsMethod, 0, 0, 0, 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_PyMethod_New, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, #endif #if __PYX_NEED_TP_PRINT_SLOT 0, #endif #if PY_VERSION_HEX >= 0x030C0000 0, #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, #endif }; #endif static int __pyx_CyFunction_init(PyObject *module) { #if CYTHON_USE_TYPE_SPECS __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); #else CYTHON_UNUSED_VAR(module); __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); #endif if (unlikely(__pyx_CyFunctionType == NULL)) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyObject_Malloc(size); if (unlikely(!m->defaults)) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; m->defaults_size = size; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } /* CythonFunction */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { PyObject *op = __Pyx_CyFunction_Init( PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { PyObject_GC_Track(op); } return op; } /* PyObjectCallMethod0 */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { PyObject *method = NULL, *result = NULL; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { result = __Pyx_PyObject_CallOneArg(method, obj); Py_DECREF(method); return result; } if (unlikely(!method)) goto bad; result = __Pyx_PyObject_CallNoArg(method); Py_DECREF(method); bad: return result; } /* pop */ static CYTHON_INLINE PyObject* __Pyx__PyObject_Pop(PyObject* L) { if (__Pyx_IS_TYPE(L, &PySet_Type)) { return PySet_Pop(L); } return __Pyx_PyObject_CallMethod0(L, __pyx_n_s_pop); } #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static CYTHON_INLINE PyObject* __Pyx_PyList_Pop(PyObject* L) { if (likely(PyList_GET_SIZE(L) > (((PyListObject*)L)->allocated >> 1))) { __Pyx_SET_SIZE(L, Py_SIZE(L) - 1); return PyList_GET_ITEM(L, PyList_GET_SIZE(L)); } return __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyList_Type_pop, L); } #endif /* DictGetItem */ #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { PyObject *value; value = PyDict_GetItemWithError(d, key); if (unlikely(!value)) { if (!PyErr_Occurred()) { if (unlikely(PyTuple_Check(key))) { PyObject* args = PyTuple_Pack(1, key); if (likely(args)) { PyErr_SetObject(PyExc_KeyError, args); Py_DECREF(args); } } else { PyErr_SetObject(PyExc_KeyError, key); } } return NULL; } Py_INCREF(value); return value; } #endif /* SliceObject */ static CYTHON_INLINE int __Pyx_PyObject_SetSlice(PyObject* obj, PyObject* value, Py_ssize_t cstart, Py_ssize_t cstop, PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice, int has_cstart, int has_cstop, int wraparound) { __Pyx_TypeName obj_type_name; #if CYTHON_USE_TYPE_SLOTS PyMappingMethods* mp; #if PY_MAJOR_VERSION < 3 PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; if (likely(ms && ms->sq_ass_slice)) { if (!has_cstart) { if (_py_start && (*_py_start != Py_None)) { cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; } else cstart = 0; } if (!has_cstop) { if (_py_stop && (*_py_stop != Py_None)) { cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; } else cstop = PY_SSIZE_T_MAX; } if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { Py_ssize_t l = ms->sq_length(obj); if (likely(l >= 0)) { if (cstop < 0) { cstop += l; if (cstop < 0) cstop = 0; } if (cstart < 0) { cstart += l; if (cstart < 0) cstart = 0; } } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) goto bad; PyErr_Clear(); } } return ms->sq_ass_slice(obj, cstart, cstop, value); } #else CYTHON_UNUSED_VAR(wraparound); #endif mp = Py_TYPE(obj)->tp_as_mapping; if (likely(mp && mp->mp_ass_subscript)) #else CYTHON_UNUSED_VAR(wraparound); #endif { int result; PyObject *py_slice, *py_start, *py_stop; if (_py_slice) { py_slice = *_py_slice; } else { PyObject* owned_start = NULL; PyObject* owned_stop = NULL; if (_py_start) { py_start = *_py_start; } else { if (has_cstart) { owned_start = py_start = PyInt_FromSsize_t(cstart); if (unlikely(!py_start)) goto bad; } else py_start = Py_None; } if (_py_stop) { py_stop = *_py_stop; } else { if (has_cstop) { owned_stop = py_stop = PyInt_FromSsize_t(cstop); if (unlikely(!py_stop)) { Py_XDECREF(owned_start); goto bad; } } else py_stop = Py_None; } py_slice = PySlice_New(py_start, py_stop, Py_None); Py_XDECREF(owned_start); Py_XDECREF(owned_stop); if (unlikely(!py_slice)) goto bad; } #if CYTHON_USE_TYPE_SLOTS result = mp->mp_ass_subscript(obj, py_slice, value); #else result = value ? PyObject_SetItem(obj, py_slice, value) : PyObject_DelItem(obj, py_slice); #endif if (!_py_slice) { Py_DECREF(py_slice); } return result; } obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "'" __Pyx_FMT_TYPENAME "' object does not support slice %.10s", obj_type_name, value ? "assignment" : "deletion"); __Pyx_DECREF_TypeName(obj_type_name); bad: return -1; } /* PyIntCompare */ static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, long inplace) { CYTHON_MAYBE_UNUSED_VAR(intval); CYTHON_UNUSED_VAR(inplace); if (op1 == op2) { Py_RETURN_TRUE; } #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long a = PyInt_AS_LONG(op1); if (a == b) Py_RETURN_TRUE; else Py_RETURN_FALSE; } #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { int unequal; unsigned long uintval; Py_ssize_t size = __Pyx_PyLong_DigitCount(op1); const digit* digits = __Pyx_PyLong_Digits(op1); if (intval == 0) { if (__Pyx_PyLong_IsZero(op1) == 1) Py_RETURN_TRUE; else Py_RETURN_FALSE; } else if (intval < 0) { if (__Pyx_PyLong_IsNonNeg(op1)) Py_RETURN_FALSE; intval = -intval; } else { if (__Pyx_PyLong_IsNeg(op1)) Py_RETURN_FALSE; } uintval = (unsigned long) intval; #if PyLong_SHIFT * 4 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 4)) { unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); } else #endif #if PyLong_SHIFT * 3 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 3)) { unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); } else #endif #if PyLong_SHIFT * 2 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 2)) { unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); } else #endif #if PyLong_SHIFT * 1 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 1)) { unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); } else #endif unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK)); if (unequal == 0) Py_RETURN_TRUE; else Py_RETURN_FALSE; } #endif if (PyFloat_CheckExact(op1)) { const long b = intval; #if CYTHON_COMPILING_IN_LIMITED_API double a = __pyx_PyFloat_AsDouble(op1); #else double a = PyFloat_AS_DOUBLE(op1); #endif if ((double)a == (double)b) Py_RETURN_TRUE; else Py_RETURN_FALSE; } return ( PyObject_RichCompare(op1, op2, Py_EQ)); } /* SliceTupleAndList */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_crop_slice(Py_ssize_t* _start, Py_ssize_t* _stop, Py_ssize_t* _length) { Py_ssize_t start = *_start, stop = *_stop, length = *_length; if (start < 0) { start += length; if (start < 0) start = 0; } if (stop < 0) stop += length; else if (stop > length) stop = length; *_length = stop - start; *_start = start; *_stop = stop; } static CYTHON_INLINE PyObject* __Pyx_PyList_GetSlice( PyObject* src, Py_ssize_t start, Py_ssize_t stop) { Py_ssize_t length = PyList_GET_SIZE(src); __Pyx_crop_slice(&start, &stop, &length); if (length <= 0) { return PyList_New(0); } return __Pyx_PyList_FromArray(((PyListObject*)src)->ob_item + start, length); } static CYTHON_INLINE PyObject* __Pyx_PyTuple_GetSlice( PyObject* src, Py_ssize_t start, Py_ssize_t stop) { Py_ssize_t length = PyTuple_GET_SIZE(src); __Pyx_crop_slice(&start, &stop, &length); return __Pyx_PyTuple_FromArray(((PyTupleObject*)src)->ob_item + start, length); } #endif /* PyExec */ static CYTHON_INLINE PyObject* __Pyx_PyExec2(PyObject* o, PyObject* globals) { return __Pyx_PyExec3(o, globals, NULL); } static PyObject* __Pyx_PyExec3(PyObject* o, PyObject* globals, PyObject* locals) { PyObject* result; PyObject* s = 0; char *code = 0; if (!globals || globals == Py_None) { globals = __pyx_d; } else if (unlikely(!PyDict_Check(globals))) { __Pyx_TypeName globals_type_name = __Pyx_PyType_GetName(Py_TYPE(globals)); PyErr_Format(PyExc_TypeError, "exec() arg 2 must be a dict, not " __Pyx_FMT_TYPENAME, globals_type_name); __Pyx_DECREF_TypeName(globals_type_name); goto bad; } if (!locals || locals == Py_None) { locals = globals; } if (__Pyx_PyDict_GetItemStr(globals, __pyx_n_s_builtins) == NULL) { if (unlikely(PyDict_SetItem(globals, __pyx_n_s_builtins, PyEval_GetBuiltins()) < 0)) goto bad; } if (PyCode_Check(o)) { if (unlikely(__Pyx_PyCode_HasFreeVars((PyCodeObject *)o))) { PyErr_SetString(PyExc_TypeError, "code object passed to exec() may not contain free variables"); goto bad; } #if PY_VERSION_HEX < 0x030200B1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) result = PyEval_EvalCode((PyCodeObject *)o, globals, locals); #else result = PyEval_EvalCode(o, globals, locals); #endif } else { PyCompilerFlags cf; cf.cf_flags = 0; #if PY_VERSION_HEX >= 0x030800A3 cf.cf_feature_version = PY_MINOR_VERSION; #endif if (PyUnicode_Check(o)) { cf.cf_flags = PyCF_SOURCE_IS_UTF8; s = PyUnicode_AsUTF8String(o); if (unlikely(!s)) goto bad; o = s; #if PY_MAJOR_VERSION >= 3 } else if (unlikely(!PyBytes_Check(o))) { #else } else if (unlikely(!PyString_Check(o))) { #endif __Pyx_TypeName o_type_name = __Pyx_PyType_GetName(Py_TYPE(o)); PyErr_Format(PyExc_TypeError, "exec: arg 1 must be string, bytes or code object, got " __Pyx_FMT_TYPENAME, o_type_name); __Pyx_DECREF_TypeName(o_type_name); goto bad; } #if PY_MAJOR_VERSION >= 3 code = PyBytes_AS_STRING(o); #else code = PyString_AS_STRING(o); #endif if (PyEval_MergeCompilerFlags(&cf)) { result = PyRun_StringFlags(code, Py_file_input, globals, locals, &cf); } else { result = PyRun_String(code, Py_file_input, globals, locals); } Py_XDECREF(s); } return result; bad: Py_XDECREF(s); return 0; } /* decode_c_string */ static CYTHON_INLINE PyObject* __Pyx_decode_c_string( const char* cstring, Py_ssize_t start, Py_ssize_t stop, const char* encoding, const char* errors, PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) { Py_ssize_t length; if (unlikely((start < 0) | (stop < 0))) { size_t slen = strlen(cstring); if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "c-string too long to convert to Python"); return NULL; } length = (Py_ssize_t) slen; if (start < 0) { start += length; if (start < 0) start = 0; } if (stop < 0) stop += length; } if (unlikely(stop <= start)) return __Pyx_NewRef(__pyx_empty_unicode); length = stop - start; cstring += start; if (decode_func) { return decode_func(cstring, length, errors); } else { return PyUnicode_Decode(cstring, length, encoding, errors); } } /* PyObject_GenericGetAttrNoDict */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, attr_name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(attr_name)); #endif __Pyx_DECREF_TypeName(type_name); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { PyObject *descr; PyTypeObject *tp = Py_TYPE(obj); if (unlikely(!PyString_Check(attr_name))) { return PyObject_GenericGetAttr(obj, attr_name); } assert(!tp->tp_dictoffset); descr = _PyType_Lookup(tp, attr_name); if (unlikely(!descr)) { return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); } Py_INCREF(descr); #if PY_MAJOR_VERSION < 3 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) #endif { descrgetfunc f = Py_TYPE(descr)->tp_descr_get; if (unlikely(f)) { PyObject *res = f(descr, obj, (PyObject *)tp); Py_DECREF(descr); return res; } } return descr; } #endif /* PyObject_GenericGetAttr */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { return PyObject_GenericGetAttr(obj, attr_name); } return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); } #endif /* ValidateBasesTuple */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) { Py_ssize_t i, n; #if CYTHON_ASSUME_SAFE_MACROS n = PyTuple_GET_SIZE(bases); #else n = PyTuple_Size(bases); if (n < 0) return -1; #endif for (i = 1; i < n; i++) { #if CYTHON_AVOID_BORROWED_REFS PyObject *b0 = PySequence_GetItem(bases, i); if (!b0) return -1; #elif CYTHON_ASSUME_SAFE_MACROS PyObject *b0 = PyTuple_GET_ITEM(bases, i); #else PyObject *b0 = PyTuple_GetItem(bases, i); if (!b0) return -1; #endif PyTypeObject *b; #if PY_MAJOR_VERSION < 3 if (PyClass_Check(b0)) { PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class", PyString_AS_STRING(((PyClassObject*)b0)->cl_name)); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } #endif b = (PyTypeObject*) b0; if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE)) { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name); __Pyx_DECREF_TypeName(b_name); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } if (dictoffset == 0) { Py_ssize_t b_dictoffset = 0; #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY b_dictoffset = b->tp_dictoffset; #else PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__"); if (!py_b_dictoffset) goto dictoffset_return; b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset); Py_DECREF(py_b_dictoffset); if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return; #endif if (b_dictoffset) { { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "extension type '%.200s' has no __dict__ slot, " "but base type '" __Pyx_FMT_TYPENAME "' has: " "either add 'cdef dict __dict__' to the extension type " "or add '__slots__ = [...]' to the base type", type_name, b_name); __Pyx_DECREF_TypeName(b_name); } #if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY) dictoffset_return: #endif #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif } return 0; } #endif /* PyType_Ready */ static int __Pyx_PyType_Ready(PyTypeObject *t) { #if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION) (void)__Pyx_PyObject_CallMethod0; #if CYTHON_USE_TYPE_SPECS (void)__Pyx_validate_bases_tuple; #endif return PyType_Ready(t); #else int r; PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*); if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1)) return -1; #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) { int gc_was_enabled; #if PY_VERSION_HEX >= 0x030A00b1 gc_was_enabled = PyGC_Disable(); (void)__Pyx_PyObject_CallMethod0; #else PyObject *ret, *py_status; PyObject *gc = NULL; #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) gc = PyImport_GetModule(__pyx_kp_u_gc); #endif if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc); if (unlikely(!gc)) return -1; py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled); if (unlikely(!py_status)) { Py_DECREF(gc); return -1; } gc_was_enabled = __Pyx_PyObject_IsTrue(py_status); Py_DECREF(py_status); if (gc_was_enabled > 0) { ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable); if (unlikely(!ret)) { Py_DECREF(gc); return -1; } Py_DECREF(ret); } else if (unlikely(gc_was_enabled == -1)) { Py_DECREF(gc); return -1; } #endif t->tp_flags |= Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A0000 t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE; #endif #else (void)__Pyx_PyObject_CallMethod0; #endif r = PyType_Ready(t); #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A00b1 if (gc_was_enabled) PyGC_Enable(); #else if (gc_was_enabled) { PyObject *tp, *v, *tb; PyErr_Fetch(&tp, &v, &tb); ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable); if (likely(ret || r == -1)) { Py_XDECREF(ret); PyErr_Restore(tp, v, tb); } else { Py_XDECREF(tp); Py_XDECREF(v); Py_XDECREF(tb); r = -1; } } Py_DECREF(gc); #endif } #endif return r; #endif } /* SetVTable */ static int __Pyx_SetVtable(PyTypeObject *type, void *vtable) { PyObject *ob = PyCapsule_New(vtable, 0, 0); if (unlikely(!ob)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API if (unlikely(PyObject_SetAttr((PyObject *) type, __pyx_n_s_pyx_vtable, ob) < 0)) #else if (unlikely(PyDict_SetItem(type->tp_dict, __pyx_n_s_pyx_vtable, ob) < 0)) #endif goto bad; Py_DECREF(ob); return 0; bad: Py_XDECREF(ob); return -1; } /* GetVTable */ static void* __Pyx_GetVtable(PyTypeObject *type) { void* ptr; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_n_s_pyx_vtable); #else PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_n_s_pyx_vtable); #endif if (!ob) goto bad; ptr = PyCapsule_GetPointer(ob, 0); if (!ptr && !PyErr_Occurred()) PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); Py_DECREF(ob); return ptr; bad: Py_XDECREF(ob); return NULL; } /* MergeVTables */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_MergeVtables(PyTypeObject *type) { int i; void** base_vtables; __Pyx_TypeName tp_base_name; __Pyx_TypeName base_name; void* unknown = (void*)-1; PyObject* bases = type->tp_bases; int base_depth = 0; { PyTypeObject* base = type->tp_base; while (base) { base_depth += 1; base = base->tp_base; } } base_vtables = (void**) malloc(sizeof(void*) * (size_t)(base_depth + 1)); base_vtables[0] = unknown; for (i = 1; i < PyTuple_GET_SIZE(bases); i++) { void* base_vtable = __Pyx_GetVtable(((PyTypeObject*)PyTuple_GET_ITEM(bases, i))); if (base_vtable != NULL) { int j; PyTypeObject* base = type->tp_base; for (j = 0; j < base_depth; j++) { if (base_vtables[j] == unknown) { base_vtables[j] = __Pyx_GetVtable(base); base_vtables[j + 1] = unknown; } if (base_vtables[j] == base_vtable) { break; } else if (base_vtables[j] == NULL) { goto bad; } base = base->tp_base; } } } PyErr_Clear(); free(base_vtables); return 0; bad: tp_base_name = __Pyx_PyType_GetName(type->tp_base); base_name = __Pyx_PyType_GetName((PyTypeObject*)PyTuple_GET_ITEM(bases, i)); PyErr_Format(PyExc_TypeError, "multiple bases have vtable conflict: '" __Pyx_FMT_TYPENAME "' and '" __Pyx_FMT_TYPENAME "'", tp_base_name, base_name); __Pyx_DECREF_TypeName(tp_base_name); __Pyx_DECREF_TypeName(base_name); free(base_vtables); return -1; } #endif /* TypeImport */ #ifndef __PYX_HAVE_RT_ImportType_3_0_6 #define __PYX_HAVE_RT_ImportType_3_0_6 static PyTypeObject *__Pyx_ImportType_3_0_6(PyObject *module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_6 check_size) { PyObject *result = 0; char warning[200]; Py_ssize_t basicsize; Py_ssize_t itemsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; PyObject *py_itemsize; #endif result = PyObject_GetAttrString(module, class_name); if (!result) goto bad; if (!PyType_Check(result)) { PyErr_Format(PyExc_TypeError, "%.200s.%.200s is not a type object", module_name, class_name); goto bad; } #if !CYTHON_COMPILING_IN_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; itemsize = ((PyTypeObject *)result)->tp_itemsize; #else py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; py_itemsize = PyObject_GetAttrString(result, "__itemsize__"); if (!py_itemsize) goto bad; itemsize = PyLong_AsSsize_t(py_itemsize); Py_DECREF(py_itemsize); py_itemsize = 0; if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; #endif if (itemsize) { if (size % alignment) { alignment = size % alignment; } if (itemsize < (Py_ssize_t)alignment) itemsize = (Py_ssize_t)alignment; } if ((size_t)(basicsize + itemsize) < size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize+itemsize); goto bad; } if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_6 && ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd-%zd from PyObject", module_name, class_name, size, basicsize, basicsize+itemsize); goto bad; } else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_6 && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; } return (PyTypeObject *)result; bad: Py_XDECREF(result); return NULL; } #endif /* SetupReduce */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { int ret; PyObject *name_attr; name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_n_s_name_2); if (likely(name_attr)) { ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); } else { ret = -1; } if (unlikely(ret < 0)) { PyErr_Clear(); ret = 0; } Py_XDECREF(name_attr); return ret; } static int __Pyx_setup_reduce(PyObject* type_obj) { int ret = 0; PyObject *object_reduce = NULL; PyObject *object_getstate = NULL; PyObject *object_reduce_ex = NULL; PyObject *reduce = NULL; PyObject *reduce_ex = NULL; PyObject *reduce_cython = NULL; PyObject *setstate = NULL; PyObject *setstate_cython = NULL; PyObject *getstate = NULL; #if CYTHON_USE_PYTYPE_LOOKUP getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate); #else getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate); if (!getstate && PyErr_Occurred()) { goto __PYX_BAD; } #endif if (getstate) { #if CYTHON_USE_PYTYPE_LOOKUP object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate); #else object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate); if (!object_getstate && PyErr_Occurred()) { goto __PYX_BAD; } #endif if (object_getstate != getstate) { goto __PYX_GOOD; } } #if CYTHON_USE_PYTYPE_LOOKUP object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #else object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #endif reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD; if (reduce_ex == object_reduce_ex) { #if CYTHON_USE_PYTYPE_LOOKUP object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; #else object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; #endif reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD; if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython); if (likely(reduce_cython)) { ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; } else if (reduce == object_reduce || PyErr_Occurred()) { goto __PYX_BAD; } setstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate); if (!setstate) PyErr_Clear(); if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython); if (likely(setstate_cython)) { ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; } else if (!setstate || PyErr_Occurred()) { goto __PYX_BAD; } } PyType_Modified((PyTypeObject*)type_obj); } } goto __PYX_GOOD; __PYX_BAD: if (!PyErr_Occurred()) { __Pyx_TypeName type_obj_name = __Pyx_PyType_GetName((PyTypeObject*)type_obj); PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for " __Pyx_FMT_TYPENAME, type_obj_name); __Pyx_DECREF_TypeName(type_obj_name); } ret = -1; __PYX_GOOD: #if !CYTHON_USE_PYTYPE_LOOKUP Py_XDECREF(object_reduce); Py_XDECREF(object_reduce_ex); Py_XDECREF(object_getstate); Py_XDECREF(getstate); #endif Py_XDECREF(reduce); Py_XDECREF(reduce_ex); Py_XDECREF(reduce_cython); Py_XDECREF(setstate); Py_XDECREF(setstate_cython); return ret; } #endif /* Py3UpdateBases */ static PyObject* __Pyx_PEP560_update_bases(PyObject *bases) { Py_ssize_t i, j, size_bases; PyObject *base, *meth, *new_base, *result, *new_bases = NULL; size_bases = PyTuple_GET_SIZE(bases); for (i = 0; i < size_bases; i++) { base = PyTuple_GET_ITEM(bases, i); if (PyType_Check(base)) { if (new_bases) { if (PyList_Append(new_bases, base) < 0) { goto error; } } continue; } meth = __Pyx_PyObject_GetAttrStrNoError(base, __pyx_n_s_mro_entries); if (!meth && PyErr_Occurred()) { goto error; } if (!meth) { if (new_bases) { if (PyList_Append(new_bases, base) < 0) { goto error; } } continue; } new_base = __Pyx_PyObject_CallOneArg(meth, bases); Py_DECREF(meth); if (!new_base) { goto error; } if (!PyTuple_Check(new_base)) { PyErr_SetString(PyExc_TypeError, "__mro_entries__ must return a tuple"); Py_DECREF(new_base); goto error; } if (!new_bases) { if (!(new_bases = PyList_New(i))) { goto error; } for (j = 0; j < i; j++) { base = PyTuple_GET_ITEM(bases, j); PyList_SET_ITEM(new_bases, j, base); Py_INCREF(base); } } j = PyList_GET_SIZE(new_bases); if (PyList_SetSlice(new_bases, j, j, new_base) < 0) { goto error; } Py_DECREF(new_base); } if (!new_bases) { Py_INCREF(bases); return bases; } result = PyList_AsTuple(new_bases); Py_DECREF(new_bases); return result; error: Py_XDECREF(new_bases); return NULL; } /* CalculateMetaclass */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { Py_ssize_t i, nbases; #if CYTHON_ASSUME_SAFE_MACROS nbases = PyTuple_GET_SIZE(bases); #else nbases = PyTuple_Size(bases); if (nbases < 0) return NULL; #endif for (i=0; i < nbases; i++) { PyTypeObject *tmptype; #if CYTHON_ASSUME_SAFE_MACROS PyObject *tmp = PyTuple_GET_ITEM(bases, i); #else PyObject *tmp = PyTuple_GetItem(bases, i); if (!tmp) return NULL; #endif tmptype = Py_TYPE(tmp); #if PY_MAJOR_VERSION < 3 if (tmptype == &PyClass_Type) continue; #endif if (!metaclass) { metaclass = tmptype; continue; } if (PyType_IsSubtype(metaclass, tmptype)) continue; if (PyType_IsSubtype(tmptype, metaclass)) { metaclass = tmptype; continue; } PyErr_SetString(PyExc_TypeError, "metaclass conflict: " "the metaclass of a derived class " "must be a (non-strict) subclass " "of the metaclasses of all its bases"); return NULL; } if (!metaclass) { #if PY_MAJOR_VERSION < 3 metaclass = &PyClass_Type; #else metaclass = &PyType_Type; #endif } Py_INCREF((PyObject*) metaclass); return (PyObject*) metaclass; } /* Py3ClassCreate */ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { PyObject *ns; if (metaclass) { PyObject *prep = __Pyx_PyObject_GetAttrStrNoError(metaclass, __pyx_n_s_prepare); if (prep) { PyObject *pargs[3] = {NULL, name, bases}; ns = __Pyx_PyObject_FastCallDict(prep, pargs+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw); Py_DECREF(prep); } else { if (unlikely(PyErr_Occurred())) return NULL; ns = PyDict_New(); } } else { ns = PyDict_New(); } if (unlikely(!ns)) return NULL; if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; #if PY_VERSION_HEX >= 0x03030000 if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; #else CYTHON_MAYBE_UNUSED_VAR(qualname); #endif if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; return ns; bad: Py_DECREF(ns); return NULL; } #if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS static int __Pyx_SetNamesPEP487(PyObject *type_obj) { PyTypeObject *type = (PyTypeObject*) type_obj; PyObject *names_to_set, *key, *value, *set_name, *tmp; Py_ssize_t i = 0; #if CYTHON_USE_TYPE_SLOTS names_to_set = PyDict_Copy(type->tp_dict); #else { PyObject *d = PyObject_GetAttr(type_obj, __pyx_n_s_dict); names_to_set = NULL; if (likely(d)) { PyObject *names_to_set = PyDict_New(); int ret = likely(names_to_set) ? PyDict_Update(names_to_set, d) : -1; Py_DECREF(d); if (unlikely(ret < 0)) Py_CLEAR(names_to_set); } } #endif if (unlikely(names_to_set == NULL)) goto bad; while (PyDict_Next(names_to_set, &i, &key, &value)) { set_name = __Pyx_PyObject_LookupSpecialNoError(value, __pyx_n_s_set_name); if (unlikely(set_name != NULL)) { tmp = __Pyx_PyObject_Call2Args(set_name, type_obj, key); Py_DECREF(set_name); if (unlikely(tmp == NULL)) { __Pyx_TypeName value_type_name = __Pyx_PyType_GetName(Py_TYPE(value)); __Pyx_TypeName type_name = __Pyx_PyType_GetName(type); PyErr_Format(PyExc_RuntimeError, #if PY_MAJOR_VERSION >= 3 "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %R " "in '" __Pyx_FMT_TYPENAME "'", value_type_name, key, type_name); #else "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %.100s in '" __Pyx_FMT_TYPENAME "'", value_type_name, PyString_Check(key) ? PyString_AS_STRING(key) : "?", type_name); #endif goto bad; } else { Py_DECREF(tmp); } } else if (unlikely(PyErr_Occurred())) { goto bad; } } Py_DECREF(names_to_set); return 0; bad: Py_XDECREF(names_to_set); return -1; } static PyObject *__Pyx_InitSubclassPEP487(PyObject *type_obj, PyObject *mkw) { #if CYTHON_USE_TYPE_SLOTS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS PyTypeObject *type = (PyTypeObject*) type_obj; PyObject *mro = type->tp_mro; Py_ssize_t i, nbases; if (unlikely(!mro)) goto done; (void) &__Pyx_GetBuiltinName; Py_INCREF(mro); nbases = PyTuple_GET_SIZE(mro); assert(PyTuple_GET_ITEM(mro, 0) == type_obj); for (i = 1; i < nbases-1; i++) { PyObject *base, *dict, *meth; base = PyTuple_GET_ITEM(mro, i); dict = ((PyTypeObject *)base)->tp_dict; meth = __Pyx_PyDict_GetItemStrWithError(dict, __pyx_n_s_init_subclass); if (unlikely(meth)) { descrgetfunc f = Py_TYPE(meth)->tp_descr_get; PyObject *res; Py_INCREF(meth); if (likely(f)) { res = f(meth, NULL, type_obj); Py_DECREF(meth); if (unlikely(!res)) goto bad; meth = res; } res = __Pyx_PyObject_FastCallDict(meth, NULL, 0, mkw); Py_DECREF(meth); if (unlikely(!res)) goto bad; Py_DECREF(res); goto done; } else if (unlikely(PyErr_Occurred())) { goto bad; } } done: Py_XDECREF(mro); return type_obj; bad: Py_XDECREF(mro); Py_DECREF(type_obj); return NULL; #else PyObject *super_type, *super, *func, *res; #if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type) super_type = __Pyx_GetBuiltinName(__pyx_n_s_super); #else super_type = (PyObject*) &PySuper_Type; (void) &__Pyx_GetBuiltinName; #endif super = likely(super_type) ? __Pyx_PyObject_Call2Args(super_type, type_obj, type_obj) : NULL; #if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type) Py_XDECREF(super_type); #endif if (unlikely(!super)) { Py_CLEAR(type_obj); goto done; } func = __Pyx_PyObject_GetAttrStrNoError(super, __pyx_n_s_init_subclass); Py_DECREF(super); if (likely(!func)) { if (unlikely(PyErr_Occurred())) Py_CLEAR(type_obj); goto done; } res = __Pyx_PyObject_FastCallDict(func, NULL, 0, mkw); Py_DECREF(func); if (unlikely(!res)) Py_CLEAR(type_obj); Py_XDECREF(res); done: return type_obj; #endif } #endif static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass) { PyObject *result; PyObject *owned_metaclass = NULL; PyObject *margs[4] = {NULL, name, bases, dict}; if (allow_py2_metaclass) { owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); if (owned_metaclass) { metaclass = owned_metaclass; } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { PyErr_Clear(); } else { return NULL; } } if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); Py_XDECREF(owned_metaclass); if (unlikely(!metaclass)) return NULL; owned_metaclass = metaclass; } result = __Pyx_PyObject_FastCallDict(metaclass, margs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, #if PY_VERSION_HEX < 0x030600A4 (metaclass == (PyObject*)&PyType_Type) ? NULL : mkw #else mkw #endif ); Py_XDECREF(owned_metaclass); #if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS if (likely(result) && likely(PyType_Check(result))) { if (unlikely(__Pyx_SetNamesPEP487(result) < 0)) { Py_CLEAR(result); } else { result = __Pyx_InitSubclassPEP487(result, mkw); } } #else (void) &__Pyx_GetBuiltinName; #endif return result; } /* ClassMethod */ static PyObject* __Pyx_Method_ClassMethod(PyObject *method) { #if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM <= 0x05080000 if (PyObject_TypeCheck(method, &PyWrapperDescr_Type)) { return PyClassMethod_New(method); } #else #if CYTHON_COMPILING_IN_PYPY if (PyMethodDescr_Check(method)) #else #if PY_MAJOR_VERSION == 2 static PyTypeObject *methoddescr_type = NULL; if (unlikely(methoddescr_type == NULL)) { PyObject *meth = PyObject_GetAttrString((PyObject*)&PyList_Type, "append"); if (unlikely(!meth)) return NULL; methoddescr_type = Py_TYPE(meth); Py_DECREF(meth); } #else PyTypeObject *methoddescr_type = &PyMethodDescr_Type; #endif if (__Pyx_TypeCheck(method, methoddescr_type)) #endif { PyMethodDescrObject *descr = (PyMethodDescrObject *)method; #if PY_VERSION_HEX < 0x03020000 PyTypeObject *d_type = descr->d_type; #else PyTypeObject *d_type = descr->d_common.d_type; #endif return PyDescr_NewClassMethod(d_type, descr->d_method); } #endif else if (PyMethod_Check(method)) { return PyClassMethod_New(PyMethod_GET_FUNCTION(method)); } else { return PyClassMethod_New(method); } } /* GetNameInClass */ static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name) { PyObject *result; PyObject *dict; assert(PyType_Check(nmspace)); #if CYTHON_USE_TYPE_SLOTS dict = ((PyTypeObject*)nmspace)->tp_dict; Py_XINCREF(dict); #else dict = PyObject_GetAttr(nmspace, __pyx_n_s_dict); #endif if (likely(dict)) { result = PyObject_GetItem(dict, name); Py_DECREF(dict); if (result) { return result; } } PyErr_Clear(); __Pyx_GetModuleGlobalNameUncached(result, name); return result; } /* RegisterModuleCleanup */ #if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY static PyObject* __pyx_module_cleanup_atexit(PyObject *module, PyObject *unused) { CYTHON_UNUSED_VAR(unused); __pyx_module_cleanup(module); Py_INCREF(Py_None); return Py_None; } static int __Pyx_RegisterCleanup(void) { static PyMethodDef cleanup_def = { "__cleanup", (PyCFunction)__pyx_module_cleanup_atexit, METH_NOARGS, 0}; PyObject *cleanup_func = 0; PyObject *atexit = 0; PyObject *reg = 0; PyObject *args = 0; PyObject *res = 0; int ret = -1; cleanup_func = PyCFunction_New(&cleanup_def, 0); if (!cleanup_func) goto bad; atexit = PyImport_ImportModule("atexit"); if (!atexit) goto bad; reg = PyObject_GetAttrString(atexit, "_exithandlers"); if (reg && PyList_Check(reg)) { PyObject *a, *kw; a = PyTuple_New(0); kw = PyDict_New(); if (!a || !kw) { Py_XDECREF(a); Py_XDECREF(kw); goto bad; } args = PyTuple_Pack(3, cleanup_func, a, kw); Py_DECREF(a); Py_DECREF(kw); if (!args) goto bad; ret = PyList_Insert(reg, 0, args); } else { if (!reg) PyErr_Clear(); Py_XDECREF(reg); reg = PyObject_GetAttrString(atexit, "register"); if (!reg) goto bad; args = PyTuple_Pack(1, cleanup_func); if (!args) goto bad; res = PyObject_CallObject(reg, args); if (!res) goto bad; ret = 0; } bad: Py_XDECREF(cleanup_func); Py_XDECREF(atexit); Py_XDECREF(reg); Py_XDECREF(args); Py_XDECREF(res); return ret; } #endif /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); if (unlikely(!__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #endif /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, PyObject *firstlineno, PyObject *name) { PyObject *replace = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { PyObject *result; result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); #if __PYX_LIMITED_VERSION_HEX < 0x030780000 { PyObject *compiled = NULL, *result = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; compiled = Py_CompileString( "out = type(code)(\n" " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" " code.co_lnotab)\n", "", Py_file_input); if (!compiled) return NULL; result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); Py_DECREF(compiled); if (!result) PyErr_Print(); Py_DECREF(result); result = PyDict_GetItemString(scratch_dict, "out"); if (result) Py_INCREF(result); return result; } #else return NULL; #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; PyObject *replace = NULL, *getframe = NULL, *frame = NULL; PyObject *exc_type, *exc_value, *exc_traceback; int success = 0; if (c_line) { (void) __pyx_cfilenm; (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); code_object = Py_CompileString("_getframe()", filename, Py_eval_input); if (unlikely(!code_object)) goto bad; py_py_line = PyLong_FromLong(py_line); if (unlikely(!py_py_line)) goto bad; py_funcname = PyUnicode_FromString(funcname); if (unlikely(!py_funcname)) goto bad; dict = PyDict_New(); if (unlikely(!dict)) goto bad; { PyObject *old_code_object = code_object; code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); Py_DECREF(old_code_object); } if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; frame = PyEval_EvalCode(code_object, dict, dict); if (unlikely(!frame) || frame == Py_None) goto bad; success = 1; bad: PyErr_Restore(exc_type, exc_value, exc_traceback); Py_XDECREF(code_object); Py_XDECREF(py_py_line); Py_XDECREF(py_funcname); Py_XDECREF(dict); Py_XDECREF(replace); if (success) { PyTraceBack_Here( (struct _frame*)frame); } Py_XDECREF(frame); } #else static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; #if PY_MAJOR_VERSION < 3 PyObject *py_srcfile = NULL; py_srcfile = PyString_FromString(filename); if (!py_srcfile) goto bad; #endif if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; #endif } #if PY_MAJOR_VERSION < 3 py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif Py_XDECREF(py_funcname); // XDECREF since it's only set on Py3 if cline return py_code; bad: Py_XDECREF(py_funcname); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_srcfile); #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject *ptype, *pvalue, *ptraceback; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) { /* If the code object creation fails, then we should clear the fetched exception references and propagate the new exception */ Py_XDECREF(ptype); Py_XDECREF(pvalue); Py_XDECREF(ptraceback); goto bad; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #endif #if PY_MAJOR_VERSION < 3 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) { __Pyx_TypeName obj_type_name; if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags); if (__Pyx_TypeCheck(obj, __pyx_ptype_8petsc4py_5PETSc_IS)) return __pyx_pw_8petsc4py_5PETSc_2IS_3__getbuffer__(obj, view, flags); if (__Pyx_TypeCheck(obj, __pyx_ptype_8petsc4py_5PETSc_Vec)) return __pyx_pw_8petsc4py_5PETSc_3Vec_45__getbuffer__(obj, view, flags); if (__Pyx_TypeCheck(obj, __pyx_ptype_8petsc4py_5PETSc__IS_buffer)) return __pyx_pw_8petsc4py_5PETSc_10_IS_buffer_5__getbuffer__(obj, view, flags); if (__Pyx_TypeCheck(obj, __pyx_ptype_8petsc4py_5PETSc__Vec_buffer)) return __pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_5__getbuffer__(obj, view, flags); if (__Pyx_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags); if (__Pyx_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags); obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "'" __Pyx_FMT_TYPENAME "' does not have the buffer interface", obj_type_name); __Pyx_DECREF_TypeName(obj_type_name); return -1; } static void __Pyx_ReleaseBuffer(Py_buffer *view) { PyObject *obj = view->obj; if (!obj) return; if (PyObject_CheckBuffer(obj)) { PyBuffer_Release(view); return; } if ((0)) {} else if (__Pyx_TypeCheck(obj, __pyx_ptype_8petsc4py_5PETSc_IS)) __pyx_pw_8petsc4py_5PETSc_2IS_5__releasebuffer__(obj, view); else if (__Pyx_TypeCheck(obj, __pyx_ptype_8petsc4py_5PETSc_Vec)) __pyx_pw_8petsc4py_5PETSc_3Vec_47__releasebuffer__(obj, view); else if (__Pyx_TypeCheck(obj, __pyx_ptype_8petsc4py_5PETSc__IS_buffer)) __pyx_pw_8petsc4py_5PETSc_10_IS_buffer_7__releasebuffer__(obj, view); else if (__Pyx_TypeCheck(obj, __pyx_ptype_8petsc4py_5PETSc__Vec_buffer)) __pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_7__releasebuffer__(obj, view); view->obj = NULL; Py_DECREF(obj); } #endif /* MemviewSliceIsContig */ static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim) { int i, index, step, start; Py_ssize_t itemsize = mvs.memview->view.itemsize; if (order == 'F') { step = 1; start = 0; } else { step = -1; start = ndim - 1; } for (i = 0; i < ndim; i++) { index = start + step * i; if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize) return 0; itemsize *= mvs.shape[index]; } return 1; } /* OverlappingSlices */ static void __pyx_get_array_memory_extents(__Pyx_memviewslice *slice, void **out_start, void **out_end, int ndim, size_t itemsize) { char *start, *end; int i; start = end = slice->data; for (i = 0; i < ndim; i++) { Py_ssize_t stride = slice->strides[i]; Py_ssize_t extent = slice->shape[i]; if (extent == 0) { *out_start = *out_end = start; return; } else { if (stride > 0) end += stride * (extent - 1); else start += stride * (extent - 1); } } *out_start = start; *out_end = end + itemsize; } static int __pyx_slices_overlap(__Pyx_memviewslice *slice1, __Pyx_memviewslice *slice2, int ndim, size_t itemsize) { void *start1, *end1, *start2, *end2; __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize); __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize); return (start1 < end2) && (start2 < end1); } /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* IsLittleEndian */ static CYTHON_INLINE int __Pyx_Is_Little_Endian(void) { union { uint32_t u32; uint8_t u8[4]; } S; S.u32 = 0x01020304; return S.u8[0] == 4; } /* BufferFormatCheck */ static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, __Pyx_BufFmt_StackElem* stack, __Pyx_TypeInfo* type) { stack[0].field = &ctx->root; stack[0].parent_offset = 0; ctx->root.type = type; ctx->root.name = "buffer dtype"; ctx->root.offset = 0; ctx->head = stack; ctx->head->field = &ctx->root; ctx->fmt_offset = 0; ctx->head->parent_offset = 0; ctx->new_packmode = '@'; ctx->enc_packmode = '@'; ctx->new_count = 1; ctx->enc_count = 0; ctx->enc_type = 0; ctx->is_complex = 0; ctx->is_valid_array = 0; ctx->struct_alignment = 0; while (type->typegroup == 'S') { ++ctx->head; ctx->head->field = type->fields; ctx->head->parent_offset = 0; type = type->fields->type; } } static int __Pyx_BufFmt_ParseNumber(const char** ts) { int count; const char* t = *ts; if (*t < '0' || *t > '9') { return -1; } else { count = *t++ - '0'; while (*t >= '0' && *t <= '9') { count *= 10; count += *t++ - '0'; } } *ts = t; return count; } static int __Pyx_BufFmt_ExpectNumber(const char **ts) { int number = __Pyx_BufFmt_ParseNumber(ts); if (number == -1) PyErr_Format(PyExc_ValueError,\ "Does not understand character buffer dtype format string ('%c')", **ts); return number; } static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) { PyErr_Format(PyExc_ValueError, "Unexpected format string character: '%c'", ch); } static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) { switch (ch) { case '?': return "'bool'"; case 'c': return "'char'"; case 'b': return "'signed char'"; case 'B': return "'unsigned char'"; case 'h': return "'short'"; case 'H': return "'unsigned short'"; case 'i': return "'int'"; case 'I': return "'unsigned int'"; case 'l': return "'long'"; case 'L': return "'unsigned long'"; case 'q': return "'long long'"; case 'Q': return "'unsigned long long'"; case 'f': return (is_complex ? "'complex float'" : "'float'"); case 'd': return (is_complex ? "'complex double'" : "'double'"); case 'g': return (is_complex ? "'complex long double'" : "'long double'"); case 'T': return "a struct"; case 'O': return "Python object"; case 'P': return "a pointer"; case 's': case 'p': return "a string"; case 0: return "end"; default: return "unparsable format string"; } } static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) { switch (ch) { case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; case 'h': case 'H': return 2; case 'i': case 'I': case 'l': case 'L': return 4; case 'q': case 'Q': return 8; case 'f': return (is_complex ? 8 : 4); case 'd': return (is_complex ? 16 : 8); case 'g': { PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g').."); return 0; } case 'O': case 'P': return sizeof(void*); default: __Pyx_BufFmt_RaiseUnexpectedChar(ch); return 0; } } static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) { switch (ch) { case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; case 'h': case 'H': return sizeof(short); case 'i': case 'I': return sizeof(int); case 'l': case 'L': return sizeof(long); #ifdef HAVE_LONG_LONG case 'q': case 'Q': return sizeof(PY_LONG_LONG); #endif case 'f': return sizeof(float) * (is_complex ? 2 : 1); case 'd': return sizeof(double) * (is_complex ? 2 : 1); case 'g': return sizeof(long double) * (is_complex ? 2 : 1); case 'O': case 'P': return sizeof(void*); default: { __Pyx_BufFmt_RaiseUnexpectedChar(ch); return 0; } } } typedef struct { char c; short x; } __Pyx_st_short; typedef struct { char c; int x; } __Pyx_st_int; typedef struct { char c; long x; } __Pyx_st_long; typedef struct { char c; float x; } __Pyx_st_float; typedef struct { char c; double x; } __Pyx_st_double; typedef struct { char c; long double x; } __Pyx_st_longdouble; typedef struct { char c; void *x; } __Pyx_st_void_p; #ifdef HAVE_LONG_LONG typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong; #endif static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, int is_complex) { CYTHON_UNUSED_VAR(is_complex); switch (ch) { case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short); case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int); case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long); #ifdef HAVE_LONG_LONG case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG); #endif case 'f': return sizeof(__Pyx_st_float) - sizeof(float); case 'd': return sizeof(__Pyx_st_double) - sizeof(double); case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double); case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*); default: __Pyx_BufFmt_RaiseUnexpectedChar(ch); return 0; } } /* These are for computing the padding at the end of the struct to align on the first member of the struct. This will probably the same as above, but we don't have any guarantees. */ typedef struct { short x; char c; } __Pyx_pad_short; typedef struct { int x; char c; } __Pyx_pad_int; typedef struct { long x; char c; } __Pyx_pad_long; typedef struct { float x; char c; } __Pyx_pad_float; typedef struct { double x; char c; } __Pyx_pad_double; typedef struct { long double x; char c; } __Pyx_pad_longdouble; typedef struct { void *x; char c; } __Pyx_pad_void_p; #ifdef HAVE_LONG_LONG typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong; #endif static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, int is_complex) { CYTHON_UNUSED_VAR(is_complex); switch (ch) { case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short); case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int); case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long); #ifdef HAVE_LONG_LONG case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG); #endif case 'f': return sizeof(__Pyx_pad_float) - sizeof(float); case 'd': return sizeof(__Pyx_pad_double) - sizeof(double); case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double); case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*); default: __Pyx_BufFmt_RaiseUnexpectedChar(ch); return 0; } } static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) { switch (ch) { case 'c': return 'H'; case 'b': case 'h': case 'i': case 'l': case 'q': case 's': case 'p': return 'I'; case '?': case 'B': case 'H': case 'I': case 'L': case 'Q': return 'U'; case 'f': case 'd': case 'g': return (is_complex ? 'C' : 'R'); case 'O': return 'O'; case 'P': return 'P'; default: { __Pyx_BufFmt_RaiseUnexpectedChar(ch); return 0; } } } static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) { if (ctx->head == NULL || ctx->head->field == &ctx->root) { const char* expected; const char* quote; if (ctx->head == NULL) { expected = "end"; quote = ""; } else { expected = ctx->head->field->type->name; quote = "'"; } PyErr_Format(PyExc_ValueError, "Buffer dtype mismatch, expected %s%s%s but got %s", quote, expected, quote, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex)); } else { __Pyx_StructField* field = ctx->head->field; __Pyx_StructField* parent = (ctx->head - 1)->field; PyErr_Format(PyExc_ValueError, "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'", field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex), parent->type->name, field->name); } } static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) { char group; size_t size, offset, arraysize = 1; if (ctx->enc_type == 0) return 0; if (ctx->head->field->type->arraysize[0]) { int i, ndim = 0; if (ctx->enc_type == 's' || ctx->enc_type == 'p') { ctx->is_valid_array = ctx->head->field->type->ndim == 1; ndim = 1; if (ctx->enc_count != ctx->head->field->type->arraysize[0]) { PyErr_Format(PyExc_ValueError, "Expected a dimension of size %zu, got %zu", ctx->head->field->type->arraysize[0], ctx->enc_count); return -1; } } if (!ctx->is_valid_array) { PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d", ctx->head->field->type->ndim, ndim); return -1; } for (i = 0; i < ctx->head->field->type->ndim; i++) { arraysize *= ctx->head->field->type->arraysize[i]; } ctx->is_valid_array = 0; ctx->enc_count = 1; } group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex); do { __Pyx_StructField* field = ctx->head->field; __Pyx_TypeInfo* type = field->type; if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') { size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex); } else { size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex); } if (ctx->enc_packmode == '@') { size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex); size_t align_mod_offset; if (align_at == 0) return -1; align_mod_offset = ctx->fmt_offset % align_at; if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset; if (ctx->struct_alignment == 0) ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type, ctx->is_complex); } if (type->size != size || type->typegroup != group) { if (type->typegroup == 'C' && type->fields != NULL) { size_t parent_offset = ctx->head->parent_offset + field->offset; ++ctx->head; ctx->head->field = type->fields; ctx->head->parent_offset = parent_offset; continue; } if ((type->typegroup == 'H' || group == 'H') && type->size == size) { } else { __Pyx_BufFmt_RaiseExpected(ctx); return -1; } } offset = ctx->head->parent_offset + field->offset; if (ctx->fmt_offset != offset) { PyErr_Format(PyExc_ValueError, "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected", (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset); return -1; } ctx->fmt_offset += size; if (arraysize) ctx->fmt_offset += (arraysize - 1) * size; --ctx->enc_count; while (1) { if (field == &ctx->root) { ctx->head = NULL; if (ctx->enc_count != 0) { __Pyx_BufFmt_RaiseExpected(ctx); return -1; } break; } ctx->head->field = ++field; if (field->type == NULL) { --ctx->head; field = ctx->head->field; continue; } else if (field->type->typegroup == 'S') { size_t parent_offset = ctx->head->parent_offset + field->offset; if (field->type->fields->type == NULL) continue; field = field->type->fields; ++ctx->head; ctx->head->field = field; ctx->head->parent_offset = parent_offset; break; } else { break; } } } while (ctx->enc_count); ctx->enc_type = 0; ctx->is_complex = 0; return 0; } static int __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp) { const char *ts = *tsp; int i = 0, number, ndim; ++ts; if (ctx->new_count != 1) { PyErr_SetString(PyExc_ValueError, "Cannot handle repeated arrays in format string"); return -1; } if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return -1; ndim = ctx->head->field->type->ndim; while (*ts && *ts != ')') { switch (*ts) { case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue; default: break; } number = __Pyx_BufFmt_ExpectNumber(&ts); if (number == -1) return -1; if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i]) { PyErr_Format(PyExc_ValueError, "Expected a dimension of size %zu, got %d", ctx->head->field->type->arraysize[i], number); return -1; } if (*ts != ',' && *ts != ')') { PyErr_Format(PyExc_ValueError, "Expected a comma in format string, got '%c'", *ts); return -1; } if (*ts == ',') ts++; i++; } if (i != ndim) { PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d", ctx->head->field->type->ndim, i); return -1; } if (!*ts) { PyErr_SetString(PyExc_ValueError, "Unexpected end of format string, expected ')'"); return -1; } ctx->is_valid_array = 1; ctx->new_count = 1; *tsp = ++ts; return 0; } static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) { int got_Z = 0; while (1) { switch(*ts) { case 0: if (ctx->enc_type != 0 && ctx->head == NULL) { __Pyx_BufFmt_RaiseExpected(ctx); return NULL; } if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; if (ctx->head != NULL) { __Pyx_BufFmt_RaiseExpected(ctx); return NULL; } return ts; case ' ': case '\r': case '\n': ++ts; break; case '<': if (!__Pyx_Is_Little_Endian()) { PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler"); return NULL; } ctx->new_packmode = '='; ++ts; break; case '>': case '!': if (__Pyx_Is_Little_Endian()) { PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler"); return NULL; } ctx->new_packmode = '='; ++ts; break; case '=': case '@': case '^': ctx->new_packmode = *ts++; break; case 'T': { const char* ts_after_sub; size_t i, struct_count = ctx->new_count; size_t struct_alignment = ctx->struct_alignment; ctx->new_count = 1; ++ts; if (*ts != '{') { PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'"); return NULL; } if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; ctx->enc_type = 0; ctx->enc_count = 0; ctx->struct_alignment = 0; ++ts; ts_after_sub = ts; for (i = 0; i != struct_count; ++i) { ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts); if (!ts_after_sub) return NULL; } ts = ts_after_sub; if (struct_alignment) ctx->struct_alignment = struct_alignment; } break; case '}': { size_t alignment = ctx->struct_alignment; ++ts; if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; ctx->enc_type = 0; if (alignment && ctx->fmt_offset % alignment) { ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment); } } return ts; case 'x': if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; ctx->fmt_offset += ctx->new_count; ctx->new_count = 1; ctx->enc_count = 0; ctx->enc_type = 0; ctx->enc_packmode = ctx->new_packmode; ++ts; break; case 'Z': got_Z = 1; ++ts; if (*ts != 'f' && *ts != 'd' && *ts != 'g') { __Pyx_BufFmt_RaiseUnexpectedChar('Z'); return NULL; } CYTHON_FALLTHROUGH; case '?': case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I': case 'l': case 'L': case 'q': case 'Q': case 'f': case 'd': case 'g': case 'O': case 'p': if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) && (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) { ctx->enc_count += ctx->new_count; ctx->new_count = 1; got_Z = 0; ++ts; break; } CYTHON_FALLTHROUGH; case 's': if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; ctx->enc_count = ctx->new_count; ctx->enc_packmode = ctx->new_packmode; ctx->enc_type = *ts; ctx->is_complex = got_Z; ++ts; ctx->new_count = 1; got_Z = 0; break; case ':': ++ts; while(*ts != ':') ++ts; ++ts; break; case '(': if (__pyx_buffmt_parse_array(ctx, &ts) < 0) return NULL; break; default: { int number = __Pyx_BufFmt_ExpectNumber(&ts); if (number == -1) return NULL; ctx->new_count = (size_t)number; } } } } /* TypeInfoCompare */ static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b) { int i; if (!a || !b) return 0; if (a == b) return 1; if (a->size != b->size || a->typegroup != b->typegroup || a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) { if (a->typegroup == 'H' || b->typegroup == 'H') { return a->size == b->size; } else { return 0; } } if (a->ndim) { for (i = 0; i < a->ndim; i++) if (a->arraysize[i] != b->arraysize[i]) return 0; } if (a->typegroup == 'S') { if (a->flags != b->flags) return 0; if (a->fields || b->fields) { if (!(a->fields && b->fields)) return 0; for (i = 0; a->fields[i].type && b->fields[i].type; i++) { __Pyx_StructField *field_a = a->fields + i; __Pyx_StructField *field_b = b->fields + i; if (field_a->offset != field_b->offset || !__pyx_typeinfo_cmp(field_a->type, field_b->type)) return 0; } return !a->fields[i].type && !b->fields[i].type; } } return 1; } /* MemviewSliceValidateAndInit */ static int __pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec) { if (buf->shape[dim] <= 1) return 1; if (buf->strides) { if (spec & __Pyx_MEMVIEW_CONTIG) { if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) { if (unlikely(buf->strides[dim] != sizeof(void *))) { PyErr_Format(PyExc_ValueError, "Buffer is not indirectly contiguous " "in dimension %d.", dim); goto fail; } } else if (unlikely(buf->strides[dim] != buf->itemsize)) { PyErr_SetString(PyExc_ValueError, "Buffer and memoryview are not contiguous " "in the same dimension."); goto fail; } } if (spec & __Pyx_MEMVIEW_FOLLOW) { Py_ssize_t stride = buf->strides[dim]; if (stride < 0) stride = -stride; if (unlikely(stride < buf->itemsize)) { PyErr_SetString(PyExc_ValueError, "Buffer and memoryview are not contiguous " "in the same dimension."); goto fail; } } } else { if (unlikely(spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1)) { PyErr_Format(PyExc_ValueError, "C-contiguous buffer is not contiguous in " "dimension %d", dim); goto fail; } else if (unlikely(spec & (__Pyx_MEMVIEW_PTR))) { PyErr_Format(PyExc_ValueError, "C-contiguous buffer is not indirect in " "dimension %d", dim); goto fail; } else if (unlikely(buf->suboffsets)) { PyErr_SetString(PyExc_ValueError, "Buffer exposes suboffsets but no strides"); goto fail; } } return 1; fail: return 0; } static int __pyx_check_suboffsets(Py_buffer *buf, int dim, int ndim, int spec) { CYTHON_UNUSED_VAR(ndim); if (spec & __Pyx_MEMVIEW_DIRECT) { if (unlikely(buf->suboffsets && buf->suboffsets[dim] >= 0)) { PyErr_Format(PyExc_ValueError, "Buffer not compatible with direct access " "in dimension %d.", dim); goto fail; } } if (spec & __Pyx_MEMVIEW_PTR) { if (unlikely(!buf->suboffsets || (buf->suboffsets[dim] < 0))) { PyErr_Format(PyExc_ValueError, "Buffer is not indirectly accessible " "in dimension %d.", dim); goto fail; } } return 1; fail: return 0; } static int __pyx_verify_contig(Py_buffer *buf, int ndim, int c_or_f_flag) { int i; if (c_or_f_flag & __Pyx_IS_F_CONTIG) { Py_ssize_t stride = 1; for (i = 0; i < ndim; i++) { if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) { PyErr_SetString(PyExc_ValueError, "Buffer not fortran contiguous."); goto fail; } stride = stride * buf->shape[i]; } } else if (c_or_f_flag & __Pyx_IS_C_CONTIG) { Py_ssize_t stride = 1; for (i = ndim - 1; i >- 1; i--) { if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) { PyErr_SetString(PyExc_ValueError, "Buffer not C contiguous."); goto fail; } stride = stride * buf->shape[i]; } } return 1; fail: return 0; } static int __Pyx_ValidateAndInit_memviewslice( int *axes_specs, int c_or_f_flag, int buf_flags, int ndim, __Pyx_TypeInfo *dtype, __Pyx_BufFmt_StackElem stack[], __Pyx_memviewslice *memviewslice, PyObject *original_obj) { struct __pyx_memoryview_obj *memview, *new_memview; __Pyx_RefNannyDeclarations Py_buffer *buf; int i, spec = 0, retval = -1; __Pyx_BufFmt_Context ctx; int from_memoryview = __pyx_memoryview_check(original_obj); __Pyx_RefNannySetupContext("ValidateAndInit_memviewslice", 0); if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((struct __pyx_memoryview_obj *) original_obj)->typeinfo)) { memview = (struct __pyx_memoryview_obj *) original_obj; new_memview = NULL; } else { memview = (struct __pyx_memoryview_obj *) __pyx_memoryview_new( original_obj, buf_flags, 0, dtype); new_memview = memview; if (unlikely(!memview)) goto fail; } buf = &memview->view; if (unlikely(buf->ndim != ndim)) { PyErr_Format(PyExc_ValueError, "Buffer has wrong number of dimensions (expected %d, got %d)", ndim, buf->ndim); goto fail; } if (new_memview) { __Pyx_BufFmt_Init(&ctx, stack, dtype); if (unlikely(!__Pyx_BufFmt_CheckString(&ctx, buf->format))) goto fail; } if (unlikely((unsigned) buf->itemsize != dtype->size)) { PyErr_Format(PyExc_ValueError, "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "u byte%s) " "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)", buf->itemsize, (buf->itemsize > 1) ? "s" : "", dtype->name, dtype->size, (dtype->size > 1) ? "s" : ""); goto fail; } if (buf->len > 0) { for (i = 0; i < ndim; i++) { spec = axes_specs[i]; if (unlikely(!__pyx_check_strides(buf, i, ndim, spec))) goto fail; if (unlikely(!__pyx_check_suboffsets(buf, i, ndim, spec))) goto fail; } if (unlikely(buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag))) goto fail; } if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice, new_memview != NULL) == -1)) { goto fail; } retval = 0; goto no_fail; fail: Py_XDECREF(new_memview); retval = -1; no_fail: __Pyx_RefNannyFinishContext(); return retval; } /* ObjectToMemviewSlice */ static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn_PetscInt(PyObject *obj, int writable_flag) { __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_BufFmt_StackElem stack[1]; int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; int retcode; if (obj == Py_None) { result.memview = (struct __pyx_memoryview_obj *) Py_None; return result; } retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, PyBUF_RECORDS_RO | writable_flag, 1, &__Pyx_TypeInfo_nn_PetscInt, stack, &result, obj); if (unlikely(retcode == -1)) goto __pyx_fail; return result; __pyx_fail: result.memview = NULL; result.data = NULL; return result; } /* MemviewDtypeToObject */ static CYTHON_INLINE PyObject *__pyx_memview_get_nn_PetscInt(const char *itemp) { return (PyObject *) __Pyx_PyInt_From_PetscInt(*(PetscInt *) itemp); } static CYTHON_INLINE int __pyx_memview_set_nn_PetscInt(const char *itemp, PyObject *obj) { PetscInt value = __Pyx_PyInt_As_PetscInt(obj); if (unlikely((value == ((PetscInt)-1)) && PyErr_Occurred())) return 0; *(PetscInt *) itemp = value; return 1; } static PyObject* __pyx_convert__to_py_PetscEventPerfInfo(PetscEventPerfInfo s) { PyObject* res; PyObject* member; res = __Pyx_PyDict_NewPresized(6); if (unlikely(!res)) return NULL; member = __Pyx_PyInt_From_int(s.count); if (unlikely(!member)) goto bad; if (unlikely(PyDict_SetItem(res, __pyx_n_s_count, member) < 0)) goto bad; Py_DECREF(member); member = PyFloat_FromDouble(s.flops); if (unlikely(!member)) goto bad; if (unlikely(PyDict_SetItem(res, __pyx_n_s_flops, member) < 0)) goto bad; Py_DECREF(member); member = PyFloat_FromDouble(s.time); if (unlikely(!member)) goto bad; if (unlikely(PyDict_SetItem(res, __pyx_n_s_time, member) < 0)) goto bad; Py_DECREF(member); member = PyFloat_FromDouble(s.numMessages); if (unlikely(!member)) goto bad; if (unlikely(PyDict_SetItem(res, __pyx_n_s_numMessages, member) < 0)) goto bad; Py_DECREF(member); member = PyFloat_FromDouble(s.messageLength); if (unlikely(!member)) goto bad; if (unlikely(PyDict_SetItem(res, __pyx_n_s_messageLength, member) < 0)) goto bad; Py_DECREF(member); member = PyFloat_FromDouble(s.numReductions); if (unlikely(!member)) goto bad; if (unlikely(PyDict_SetItem(res, __pyx_n_s_numReductions, member) < 0)) goto bad; Py_DECREF(member); return res; bad: Py_XDECREF(member); Py_DECREF(res); return NULL; } static PyObject* __pyx_convert__to_py_struct____pyx_t_8petsc4py_5PETSc_DLDataType(struct __pyx_t_8petsc4py_5PETSc_DLDataType s) { PyObject* res; PyObject* member; res = __Pyx_PyDict_NewPresized(3); if (unlikely(!res)) return NULL; member = __Pyx_PyInt_From_uint8_t(s.code); if (unlikely(!member)) goto bad; if (unlikely(PyDict_SetItem(res, __pyx_n_s_code, member) < 0)) goto bad; Py_DECREF(member); member = __Pyx_PyInt_From_uint8_t(s.bits); if (unlikely(!member)) goto bad; if (unlikely(PyDict_SetItem(res, __pyx_n_s_bits, member) < 0)) goto bad; Py_DECREF(member); member = __Pyx_PyInt_From_uint16_t(s.lanes); if (unlikely(!member)) goto bad; if (unlikely(PyDict_SetItem(res, __pyx_n_s_lanes, member) < 0)) goto bad; Py_DECREF(member); return res; bad: Py_XDECREF(member); Py_DECREF(res); return NULL; } static PyObject* __pyx_convert__to_py_MatInfo(MatInfo s) { PyObject* res; PyObject* member; res = __Pyx_PyDict_NewPresized(10); if (unlikely(!res)) return NULL; member = PyFloat_FromDouble(s.block_size); if (unlikely(!member)) goto bad; if (unlikely(PyDict_SetItem(res, __pyx_n_s_block_size, member) < 0)) goto bad; Py_DECREF(member); member = PyFloat_FromDouble(s.nz_allocated); if (unlikely(!member)) goto bad; if (unlikely(PyDict_SetItem(res, __pyx_n_s_nz_allocated, member) < 0)) goto bad; Py_DECREF(member); member = PyFloat_FromDouble(s.nz_used); if (unlikely(!member)) goto bad; if (unlikely(PyDict_SetItem(res, __pyx_n_s_nz_used, member) < 0)) goto bad; Py_DECREF(member); member = PyFloat_FromDouble(s.nz_unneeded); if (unlikely(!member)) goto bad; if (unlikely(PyDict_SetItem(res, __pyx_n_s_nz_unneeded, member) < 0)) goto bad; Py_DECREF(member); member = PyFloat_FromDouble(s.memory); if (unlikely(!member)) goto bad; if (unlikely(PyDict_SetItem(res, __pyx_n_s_memory, member) < 0)) goto bad; Py_DECREF(member); member = PyFloat_FromDouble(s.assemblies); if (unlikely(!member)) goto bad; if (unlikely(PyDict_SetItem(res, __pyx_n_s_assemblies, member) < 0)) goto bad; Py_DECREF(member); member = PyFloat_FromDouble(s.mallocs); if (unlikely(!member)) goto bad; if (unlikely(PyDict_SetItem(res, __pyx_n_s_mallocs, member) < 0)) goto bad; Py_DECREF(member); member = PyFloat_FromDouble(s.fill_ratio_given); if (unlikely(!member)) goto bad; if (unlikely(PyDict_SetItem(res, __pyx_n_s_fill_ratio_given, member) < 0)) goto bad; Py_DECREF(member); member = PyFloat_FromDouble(s.fill_ratio_needed); if (unlikely(!member)) goto bad; if (unlikely(PyDict_SetItem(res, __pyx_n_s_fill_ratio_needed, member) < 0)) goto bad; Py_DECREF(member); member = PyFloat_FromDouble(s.factor_mallocs); if (unlikely(!member)) goto bad; if (unlikely(PyDict_SetItem(res, __pyx_n_s_factor_mallocs, member) < 0)) goto bad; Py_DECREF(member); return res; bad: Py_XDECREF(member); Py_DECREF(res); return NULL; } /* MemviewSliceCopyTemplate */ static __Pyx_memviewslice __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs, const char *mode, int ndim, size_t sizeof_dtype, int contig_flag, int dtype_is_object) { __Pyx_RefNannyDeclarations int i; __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } }; struct __pyx_memoryview_obj *from_memview = from_mvs->memview; Py_buffer *buf = &from_memview->view; PyObject *shape_tuple = NULL; PyObject *temp_int = NULL; struct __pyx_array_obj *array_obj = NULL; struct __pyx_memoryview_obj *memview_obj = NULL; __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0); for (i = 0; i < ndim; i++) { if (unlikely(from_mvs->suboffsets[i] >= 0)) { PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with " "indirect dimensions (axis %d)", i); goto fail; } } shape_tuple = PyTuple_New(ndim); if (unlikely(!shape_tuple)) { goto fail; } __Pyx_GOTREF(shape_tuple); for(i = 0; i < ndim; i++) { temp_int = PyInt_FromSsize_t(from_mvs->shape[i]); if(unlikely(!temp_int)) { goto fail; } else { PyTuple_SET_ITEM(shape_tuple, i, temp_int); temp_int = NULL; } } array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL); if (unlikely(!array_obj)) { goto fail; } __Pyx_GOTREF(array_obj); memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new( (PyObject *) array_obj, contig_flag, dtype_is_object, from_mvs->memview->typeinfo); if (unlikely(!memview_obj)) goto fail; if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0)) goto fail; if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim, dtype_is_object) < 0)) goto fail; goto no_fail; fail: __Pyx_XDECREF(new_mvs.memview); new_mvs.memview = NULL; new_mvs.data = NULL; no_fail: __Pyx_XDECREF(shape_tuple); __Pyx_XDECREF(temp_int); __Pyx_XDECREF(array_obj); __Pyx_RefNannyFinishContext(); return new_mvs; } /* MemviewSliceInit */ static int __Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview, int ndim, __Pyx_memviewslice *memviewslice, int memview_is_new_reference) { __Pyx_RefNannyDeclarations int i, retval=-1; Py_buffer *buf = &memview->view; __Pyx_RefNannySetupContext("init_memviewslice", 0); if (unlikely(memviewslice->memview || memviewslice->data)) { PyErr_SetString(PyExc_ValueError, "memviewslice is already initialized!"); goto fail; } if (buf->strides) { for (i = 0; i < ndim; i++) { memviewslice->strides[i] = buf->strides[i]; } } else { Py_ssize_t stride = buf->itemsize; for (i = ndim - 1; i >= 0; i--) { memviewslice->strides[i] = stride; stride *= buf->shape[i]; } } for (i = 0; i < ndim; i++) { memviewslice->shape[i] = buf->shape[i]; if (buf->suboffsets) { memviewslice->suboffsets[i] = buf->suboffsets[i]; } else { memviewslice->suboffsets[i] = -1; } } memviewslice->memview = memview; memviewslice->data = (char *)buf->buf; if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) { Py_INCREF(memview); } retval = 0; goto no_fail; fail: memviewslice->memview = 0; memviewslice->data = 0; retval = -1; no_fail: __Pyx_RefNannyFinishContext(); return retval; } #ifndef Py_NO_RETURN #define Py_NO_RETURN #endif static void __pyx_fatalerror(const char *fmt, ...) Py_NO_RETURN { va_list vargs; char msg[200]; #if PY_VERSION_HEX >= 0x030A0000 || defined(HAVE_STDARG_PROTOTYPES) va_start(vargs, fmt); #else va_start(vargs); #endif vsnprintf(msg, 200, fmt, vargs); va_end(vargs); Py_FatalError(msg); } static CYTHON_INLINE int __pyx_add_acquisition_count_locked(__pyx_atomic_int_type *acquisition_count, PyThread_type_lock lock) { int result; PyThread_acquire_lock(lock, 1); result = (*acquisition_count)++; PyThread_release_lock(lock); return result; } static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(__pyx_atomic_int_type *acquisition_count, PyThread_type_lock lock) { int result; PyThread_acquire_lock(lock, 1); result = (*acquisition_count)--; PyThread_release_lock(lock); return result; } static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno) { __pyx_nonatomic_int_type old_acquisition_count; struct __pyx_memoryview_obj *memview = memslice->memview; if (unlikely(!memview || (PyObject *) memview == Py_None)) { return; } old_acquisition_count = __pyx_add_acquisition_count(memview); if (unlikely(old_acquisition_count <= 0)) { if (likely(old_acquisition_count == 0)) { if (have_gil) { Py_INCREF((PyObject *) memview); } else { PyGILState_STATE _gilstate = PyGILState_Ensure(); Py_INCREF((PyObject *) memview); PyGILState_Release(_gilstate); } } else { __pyx_fatalerror("Acquisition count is %d (line %d)", old_acquisition_count+1, lineno); } } } static CYTHON_INLINE void __Pyx_XCLEAR_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno) { __pyx_nonatomic_int_type old_acquisition_count; struct __pyx_memoryview_obj *memview = memslice->memview; if (unlikely(!memview || (PyObject *) memview == Py_None)) { memslice->memview = NULL; return; } old_acquisition_count = __pyx_sub_acquisition_count(memview); memslice->data = NULL; if (likely(old_acquisition_count > 1)) { memslice->memview = NULL; } else if (likely(old_acquisition_count == 1)) { if (have_gil) { Py_CLEAR(memslice->memview); } else { PyGILState_STATE _gilstate = PyGILState_Ensure(); Py_CLEAR(memslice->memview); PyGILState_Release(_gilstate); } } else { __pyx_fatalerror("Acquisition count is %d (line %d)", old_acquisition_count-1, lineno); } } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } } #endif if ((sizeof(int) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (int) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (int) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (int) -1; } else { stepval = __Pyx_NewRef(v); } val = (int) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From___pyx_anon_enum(int value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_InsertMode(InsertMode value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const InsertMode neg_one = (InsertMode) -1, const_zero = (InsertMode) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(InsertMode) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(InsertMode) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(InsertMode) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(InsertMode) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(InsertMode) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(InsertMode), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(InsertMode)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ScatterMode(ScatterMode value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const ScatterMode neg_one = (ScatterMode) -1, const_zero = (ScatterMode) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(ScatterMode) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(ScatterMode) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(ScatterMode) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(ScatterMode) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(ScatterMode) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(ScatterMode), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(ScatterMode)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_NormType(NormType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const NormType neg_one = (NormType) -1, const_zero = (NormType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(NormType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(NormType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(NormType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(NormType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(NormType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(NormType), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(NormType)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PetscViewerFormat(PetscViewerFormat value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PetscViewerFormat neg_one = (PetscViewerFormat) -1, const_zero = (PetscViewerFormat) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(PetscViewerFormat) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(PetscViewerFormat) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PetscViewerFormat) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(PetscViewerFormat) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PetscViewerFormat) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(PetscViewerFormat), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(PetscViewerFormat)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PetscFileMode(PetscFileMode value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PetscFileMode neg_one = (PetscFileMode) -1, const_zero = (PetscFileMode) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(PetscFileMode) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(PetscFileMode) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PetscFileMode) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(PetscFileMode) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PetscFileMode) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(PetscFileMode), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(PetscFileMode)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PetscDeviceType(PetscDeviceType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PetscDeviceType neg_one = (PetscDeviceType) -1, const_zero = (PetscDeviceType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(PetscDeviceType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(PetscDeviceType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PetscDeviceType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(PetscDeviceType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PetscDeviceType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(PetscDeviceType), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(PetscDeviceType)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PetscStreamType(PetscStreamType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PetscStreamType neg_one = (PetscStreamType) -1, const_zero = (PetscStreamType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(PetscStreamType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(PetscStreamType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PetscStreamType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(PetscStreamType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PetscStreamType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(PetscStreamType), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(PetscStreamType)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PetscDeviceContextJoinMode(PetscDeviceContextJoinMode value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PetscDeviceContextJoinMode neg_one = (PetscDeviceContextJoinMode) -1, const_zero = (PetscDeviceContextJoinMode) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(PetscDeviceContextJoinMode) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(PetscDeviceContextJoinMode) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PetscDeviceContextJoinMode) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(PetscDeviceContextJoinMode) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PetscDeviceContextJoinMode) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(PetscDeviceContextJoinMode), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(PetscDeviceContextJoinMode)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ISGlobalToLocalMappingMode(ISGlobalToLocalMappingMode value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const ISGlobalToLocalMappingMode neg_one = (ISGlobalToLocalMappingMode) -1, const_zero = (ISGlobalToLocalMappingMode) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(ISGlobalToLocalMappingMode) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(ISGlobalToLocalMappingMode) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(ISGlobalToLocalMappingMode) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(ISGlobalToLocalMappingMode) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(ISGlobalToLocalMappingMode) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(ISGlobalToLocalMappingMode), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(ISGlobalToLocalMappingMode)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_VecOption(VecOption value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const VecOption neg_one = (VecOption) -1, const_zero = (VecOption) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(VecOption) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(VecOption) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(VecOption) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(VecOption) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(VecOption) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(VecOption), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(VecOption)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_MatOption(MatOption value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const MatOption neg_one = (MatOption) -1, const_zero = (MatOption) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(MatOption) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(MatOption) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(MatOption) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(MatOption) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(MatOption) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(MatOption), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(MatOption)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_MatAssemblyType(MatAssemblyType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const MatAssemblyType neg_one = (MatAssemblyType) -1, const_zero = (MatAssemblyType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(MatAssemblyType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(MatAssemblyType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(MatAssemblyType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(MatAssemblyType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(MatAssemblyType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(MatAssemblyType), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(MatAssemblyType)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_MatInfoType(MatInfoType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const MatInfoType neg_one = (MatInfoType) -1, const_zero = (MatInfoType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(MatInfoType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(MatInfoType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(MatInfoType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(MatInfoType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(MatInfoType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(MatInfoType), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(MatInfoType)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_MatStructure(MatStructure value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const MatStructure neg_one = (MatStructure) -1, const_zero = (MatStructure) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(MatStructure) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(MatStructure) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(MatStructure) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(MatStructure) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(MatStructure) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(MatStructure), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(MatStructure)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_MatDuplicateOption(MatDuplicateOption value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const MatDuplicateOption neg_one = (MatDuplicateOption) -1, const_zero = (MatDuplicateOption) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(MatDuplicateOption) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(MatDuplicateOption) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(MatDuplicateOption) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(MatDuplicateOption) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(MatDuplicateOption) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(MatDuplicateOption), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(MatDuplicateOption)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_MatFactorShiftType(MatFactorShiftType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const MatFactorShiftType neg_one = (MatFactorShiftType) -1, const_zero = (MatFactorShiftType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(MatFactorShiftType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(MatFactorShiftType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(MatFactorShiftType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(MatFactorShiftType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(MatFactorShiftType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(MatFactorShiftType), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(MatFactorShiftType)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_MatSORType(MatSORType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const MatSORType neg_one = (MatSORType) -1, const_zero = (MatSORType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(MatSORType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(MatSORType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(MatSORType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(MatSORType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(MatSORType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(MatSORType), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(MatSORType)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PCSide(PCSide value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PCSide neg_one = (PCSide) -1, const_zero = (PCSide) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(PCSide) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(PCSide) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PCSide) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(PCSide) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PCSide) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(PCSide), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(PCSide)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PCASMType(PCASMType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PCASMType neg_one = (PCASMType) -1, const_zero = (PCASMType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(PCASMType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(PCASMType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PCASMType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(PCASMType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PCASMType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(PCASMType), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(PCASMType)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PCGASMType(PCGASMType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PCGASMType neg_one = (PCGASMType) -1, const_zero = (PCGASMType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(PCGASMType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(PCGASMType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PCGASMType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(PCGASMType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PCGASMType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(PCGASMType), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(PCGASMType)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PCMGType(PCMGType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PCMGType neg_one = (PCMGType) -1, const_zero = (PCMGType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(PCMGType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(PCMGType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PCMGType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(PCMGType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PCMGType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(PCMGType), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(PCMGType)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PCMGCycleType(PCMGCycleType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PCMGCycleType neg_one = (PCMGCycleType) -1, const_zero = (PCMGCycleType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(PCMGCycleType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(PCMGCycleType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PCMGCycleType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(PCMGCycleType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PCMGCycleType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(PCMGCycleType), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(PCMGCycleType)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PCCompositeType(PCCompositeType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PCCompositeType neg_one = (PCCompositeType) -1, const_zero = (PCCompositeType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(PCCompositeType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(PCCompositeType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PCCompositeType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(PCCompositeType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PCCompositeType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(PCCompositeType), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(PCCompositeType)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PCFieldSplitSchurPreType(PCFieldSplitSchurPreType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PCFieldSplitSchurPreType neg_one = (PCFieldSplitSchurPreType) -1, const_zero = (PCFieldSplitSchurPreType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(PCFieldSplitSchurPreType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(PCFieldSplitSchurPreType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PCFieldSplitSchurPreType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(PCFieldSplitSchurPreType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PCFieldSplitSchurPreType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(PCFieldSplitSchurPreType), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(PCFieldSplitSchurPreType)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PCFieldSplitSchurFactType(PCFieldSplitSchurFactType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PCFieldSplitSchurFactType neg_one = (PCFieldSplitSchurFactType) -1, const_zero = (PCFieldSplitSchurFactType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(PCFieldSplitSchurFactType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(PCFieldSplitSchurFactType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PCFieldSplitSchurFactType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(PCFieldSplitSchurFactType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PCFieldSplitSchurFactType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(PCFieldSplitSchurFactType), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(PCFieldSplitSchurFactType)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PCPatchConstructType(PCPatchConstructType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PCPatchConstructType neg_one = (PCPatchConstructType) -1, const_zero = (PCPatchConstructType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(PCPatchConstructType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(PCPatchConstructType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PCPatchConstructType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(PCPatchConstructType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PCPatchConstructType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(PCPatchConstructType), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(PCPatchConstructType)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PCHPDDMCoarseCorrectionType(PCHPDDMCoarseCorrectionType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PCHPDDMCoarseCorrectionType neg_one = (PCHPDDMCoarseCorrectionType) -1, const_zero = (PCHPDDMCoarseCorrectionType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(PCHPDDMCoarseCorrectionType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(PCHPDDMCoarseCorrectionType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PCHPDDMCoarseCorrectionType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(PCHPDDMCoarseCorrectionType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PCHPDDMCoarseCorrectionType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(PCHPDDMCoarseCorrectionType), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(PCHPDDMCoarseCorrectionType)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PCDeflationSpaceType(PCDeflationSpaceType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PCDeflationSpaceType neg_one = (PCDeflationSpaceType) -1, const_zero = (PCDeflationSpaceType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(PCDeflationSpaceType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(PCDeflationSpaceType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PCDeflationSpaceType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(PCDeflationSpaceType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PCDeflationSpaceType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(PCDeflationSpaceType), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(PCDeflationSpaceType)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PCFailedReason(PCFailedReason value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PCFailedReason neg_one = (PCFailedReason) -1, const_zero = (PCFailedReason) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(PCFailedReason) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(PCFailedReason) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PCFailedReason) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(PCFailedReason) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PCFailedReason) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(PCFailedReason), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(PCFailedReason)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_KSPNormType(KSPNormType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const KSPNormType neg_one = (KSPNormType) -1, const_zero = (KSPNormType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(KSPNormType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(KSPNormType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(KSPNormType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(KSPNormType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(KSPNormType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(KSPNormType), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(KSPNormType)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_KSPConvergedReason(KSPConvergedReason value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const KSPConvergedReason neg_one = (KSPConvergedReason) -1, const_zero = (KSPConvergedReason) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(KSPConvergedReason) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(KSPConvergedReason) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(KSPConvergedReason) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(KSPConvergedReason) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(KSPConvergedReason) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(KSPConvergedReason), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(KSPConvergedReason)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_KSPHPDDMType(KSPHPDDMType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const KSPHPDDMType neg_one = (KSPHPDDMType) -1, const_zero = (KSPHPDDMType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(KSPHPDDMType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(KSPHPDDMType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(KSPHPDDMType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(KSPHPDDMType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(KSPHPDDMType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(KSPHPDDMType), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(KSPHPDDMType)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SNESNormSchedule(SNESNormSchedule value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const SNESNormSchedule neg_one = (SNESNormSchedule) -1, const_zero = (SNESNormSchedule) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SNESNormSchedule) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SNESNormSchedule) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SNESNormSchedule) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(SNESNormSchedule) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SNESNormSchedule) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(SNESNormSchedule), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(SNESNormSchedule)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SNESConvergedReason(SNESConvergedReason value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const SNESConvergedReason neg_one = (SNESConvergedReason) -1, const_zero = (SNESConvergedReason) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SNESConvergedReason) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SNESConvergedReason) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SNESConvergedReason) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(SNESConvergedReason) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SNESConvergedReason) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(SNESConvergedReason), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(SNESConvergedReason)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_TSProblemType(TSProblemType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const TSProblemType neg_one = (TSProblemType) -1, const_zero = (TSProblemType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(TSProblemType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(TSProblemType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(TSProblemType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(TSProblemType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(TSProblemType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(TSProblemType), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(TSProblemType)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_TSEquationType(TSEquationType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const TSEquationType neg_one = (TSEquationType) -1, const_zero = (TSEquationType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(TSEquationType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(TSEquationType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(TSEquationType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(TSEquationType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(TSEquationType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(TSEquationType), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(TSEquationType)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_TSExactFinalTimeOption(TSExactFinalTimeOption value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const TSExactFinalTimeOption neg_one = (TSExactFinalTimeOption) -1, const_zero = (TSExactFinalTimeOption) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(TSExactFinalTimeOption) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(TSExactFinalTimeOption) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(TSExactFinalTimeOption) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(TSExactFinalTimeOption) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(TSExactFinalTimeOption) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(TSExactFinalTimeOption), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(TSExactFinalTimeOption)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_TSConvergedReason(TSConvergedReason value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const TSConvergedReason neg_one = (TSConvergedReason) -1, const_zero = (TSConvergedReason) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(TSConvergedReason) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(TSConvergedReason) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(TSConvergedReason) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(TSConvergedReason) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(TSConvergedReason) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(TSConvergedReason), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(TSConvergedReason)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_TaoConvergedReason(TaoConvergedReason value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const TaoConvergedReason neg_one = (TaoConvergedReason) -1, const_zero = (TaoConvergedReason) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(TaoConvergedReason) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(TaoConvergedReason) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(TaoConvergedReason) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(TaoConvergedReason) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(TaoConvergedReason) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(TaoConvergedReason), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(TaoConvergedReason)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_TaoBNCGType(TaoBNCGType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const TaoBNCGType neg_one = (TaoBNCGType) -1, const_zero = (TaoBNCGType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(TaoBNCGType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(TaoBNCGType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(TaoBNCGType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(TaoBNCGType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(TaoBNCGType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(TaoBNCGType), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(TaoBNCGType)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_TaoLineSearchConvergedReason(TaoLineSearchConvergedReason value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const TaoLineSearchConvergedReason neg_one = (TaoLineSearchConvergedReason) -1, const_zero = (TaoLineSearchConvergedReason) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(TaoLineSearchConvergedReason) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(TaoLineSearchConvergedReason) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(TaoLineSearchConvergedReason) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(TaoLineSearchConvergedReason) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(TaoLineSearchConvergedReason) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(TaoLineSearchConvergedReason), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(TaoLineSearchConvergedReason)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_DMBoundaryType(DMBoundaryType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const DMBoundaryType neg_one = (DMBoundaryType) -1, const_zero = (DMBoundaryType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(DMBoundaryType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(DMBoundaryType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(DMBoundaryType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(DMBoundaryType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(DMBoundaryType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(DMBoundaryType), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(DMBoundaryType)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_DMPolytopeType(DMPolytopeType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const DMPolytopeType neg_one = (DMPolytopeType) -1, const_zero = (DMPolytopeType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(DMPolytopeType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(DMPolytopeType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(DMPolytopeType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(DMPolytopeType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(DMPolytopeType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(DMPolytopeType), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(DMPolytopeType)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_DMDAStencilType(DMDAStencilType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const DMDAStencilType neg_one = (DMDAStencilType) -1, const_zero = (DMDAStencilType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(DMDAStencilType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(DMDAStencilType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(DMDAStencilType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(DMDAStencilType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(DMDAStencilType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(DMDAStencilType), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(DMDAStencilType)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_DMDAInterpolationType(DMDAInterpolationType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const DMDAInterpolationType neg_one = (DMDAInterpolationType) -1, const_zero = (DMDAInterpolationType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(DMDAInterpolationType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(DMDAInterpolationType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(DMDAInterpolationType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(DMDAInterpolationType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(DMDAInterpolationType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(DMDAInterpolationType), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(DMDAInterpolationType)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_DMDAElementType(DMDAElementType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const DMDAElementType neg_one = (DMDAElementType) -1, const_zero = (DMDAElementType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(DMDAElementType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(DMDAElementType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(DMDAElementType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(DMDAElementType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(DMDAElementType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(DMDAElementType), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(DMDAElementType)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_DMPlexReorderDefaultFlag(DMPlexReorderDefaultFlag value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const DMPlexReorderDefaultFlag neg_one = (DMPlexReorderDefaultFlag) -1, const_zero = (DMPlexReorderDefaultFlag) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(DMPlexReorderDefaultFlag) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(DMPlexReorderDefaultFlag) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(DMPlexReorderDefaultFlag) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(DMPlexReorderDefaultFlag) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(DMPlexReorderDefaultFlag) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(DMPlexReorderDefaultFlag), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(DMPlexReorderDefaultFlag)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_DMStagStencilType(DMStagStencilType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const DMStagStencilType neg_one = (DMStagStencilType) -1, const_zero = (DMStagStencilType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(DMStagStencilType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(DMStagStencilType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(DMStagStencilType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(DMStagStencilType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(DMStagStencilType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(DMStagStencilType), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(DMStagStencilType)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_DMStagStencilLocation(DMStagStencilLocation value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const DMStagStencilLocation neg_one = (DMStagStencilLocation) -1, const_zero = (DMStagStencilLocation) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(DMStagStencilLocation) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(DMStagStencilLocation) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(DMStagStencilLocation) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(DMStagStencilLocation) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(DMStagStencilLocation) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(DMStagStencilLocation), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(DMStagStencilLocation)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_DMSwarmType(DMSwarmType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const DMSwarmType neg_one = (DMSwarmType) -1, const_zero = (DMSwarmType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(DMSwarmType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(DMSwarmType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(DMSwarmType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(DMSwarmType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(DMSwarmType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(DMSwarmType), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(DMSwarmType)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_DMSwarmMigrateType(DMSwarmMigrateType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const DMSwarmMigrateType neg_one = (DMSwarmMigrateType) -1, const_zero = (DMSwarmMigrateType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(DMSwarmMigrateType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(DMSwarmMigrateType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(DMSwarmMigrateType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(DMSwarmMigrateType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(DMSwarmMigrateType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(DMSwarmMigrateType), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(DMSwarmMigrateType)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_DMSwarmCollectType(DMSwarmCollectType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const DMSwarmCollectType neg_one = (DMSwarmCollectType) -1, const_zero = (DMSwarmCollectType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(DMSwarmCollectType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(DMSwarmCollectType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(DMSwarmCollectType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(DMSwarmCollectType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(DMSwarmCollectType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(DMSwarmCollectType), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(DMSwarmCollectType)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_DMSwarmPICLayoutType(DMSwarmPICLayoutType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const DMSwarmPICLayoutType neg_one = (DMSwarmPICLayoutType) -1, const_zero = (DMSwarmPICLayoutType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(DMSwarmPICLayoutType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(DMSwarmPICLayoutType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(DMSwarmPICLayoutType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(DMSwarmPICLayoutType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(DMSwarmPICLayoutType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(DMSwarmPICLayoutType), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(DMSwarmPICLayoutType)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PetscInt(PetscInt value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PetscInt neg_one = (PetscInt) -1, const_zero = (PetscInt) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(PetscInt) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(PetscInt) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PetscInt) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(PetscInt) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PetscInt) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(PetscInt), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(PetscInt)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE PetscInt __Pyx_PyInt_As_PetscInt(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PetscInt neg_one = (PetscInt) -1, const_zero = (PetscInt) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(PetscInt) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(PetscInt, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (PetscInt) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(PetscInt, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(PetscInt) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscInt, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscInt) >= 2 * PyLong_SHIFT)) { return (PetscInt) (((((PetscInt)digits[1]) << PyLong_SHIFT) | (PetscInt)digits[0])); } } break; case 3: if ((8 * sizeof(PetscInt) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscInt, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscInt) >= 3 * PyLong_SHIFT)) { return (PetscInt) (((((((PetscInt)digits[2]) << PyLong_SHIFT) | (PetscInt)digits[1]) << PyLong_SHIFT) | (PetscInt)digits[0])); } } break; case 4: if ((8 * sizeof(PetscInt) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscInt, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscInt) >= 4 * PyLong_SHIFT)) { return (PetscInt) (((((((((PetscInt)digits[3]) << PyLong_SHIFT) | (PetscInt)digits[2]) << PyLong_SHIFT) | (PetscInt)digits[1]) << PyLong_SHIFT) | (PetscInt)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (PetscInt) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(PetscInt) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(PetscInt, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(PetscInt) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(PetscInt, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(PetscInt, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(PetscInt) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscInt, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscInt) - 1 > 2 * PyLong_SHIFT)) { return (PetscInt) (((PetscInt)-1)*(((((PetscInt)digits[1]) << PyLong_SHIFT) | (PetscInt)digits[0]))); } } break; case 2: if ((8 * sizeof(PetscInt) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscInt, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscInt) - 1 > 2 * PyLong_SHIFT)) { return (PetscInt) ((((((PetscInt)digits[1]) << PyLong_SHIFT) | (PetscInt)digits[0]))); } } break; case -3: if ((8 * sizeof(PetscInt) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscInt, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscInt) - 1 > 3 * PyLong_SHIFT)) { return (PetscInt) (((PetscInt)-1)*(((((((PetscInt)digits[2]) << PyLong_SHIFT) | (PetscInt)digits[1]) << PyLong_SHIFT) | (PetscInt)digits[0]))); } } break; case 3: if ((8 * sizeof(PetscInt) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscInt, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscInt) - 1 > 3 * PyLong_SHIFT)) { return (PetscInt) ((((((((PetscInt)digits[2]) << PyLong_SHIFT) | (PetscInt)digits[1]) << PyLong_SHIFT) | (PetscInt)digits[0]))); } } break; case -4: if ((8 * sizeof(PetscInt) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscInt, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscInt) - 1 > 4 * PyLong_SHIFT)) { return (PetscInt) (((PetscInt)-1)*(((((((((PetscInt)digits[3]) << PyLong_SHIFT) | (PetscInt)digits[2]) << PyLong_SHIFT) | (PetscInt)digits[1]) << PyLong_SHIFT) | (PetscInt)digits[0]))); } } break; case 4: if ((8 * sizeof(PetscInt) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscInt, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscInt) - 1 > 4 * PyLong_SHIFT)) { return (PetscInt) ((((((((((PetscInt)digits[3]) << PyLong_SHIFT) | (PetscInt)digits[2]) << PyLong_SHIFT) | (PetscInt)digits[1]) << PyLong_SHIFT) | (PetscInt)digits[0]))); } } break; } } #endif if ((sizeof(PetscInt) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(PetscInt, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(PetscInt) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(PetscInt, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { PetscInt val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (PetscInt) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (PetscInt) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (PetscInt) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (PetscInt) -1; } else { stepval = __Pyx_NewRef(v); } val = (PetscInt) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(PetscInt) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((PetscInt) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(PetscInt) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((PetscInt) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((PetscInt) 1) << (sizeof(PetscInt) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (PetscInt) -1; } } else { PetscInt val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (PetscInt) -1; val = __Pyx_PyInt_As_PetscInt(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to PetscInt"); return (PetscInt) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to PetscInt"); return (PetscInt) -1; } /* CIntFromPy */ static CYTHON_INLINE InsertMode __Pyx_PyInt_As_InsertMode(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const InsertMode neg_one = (InsertMode) -1, const_zero = (InsertMode) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(InsertMode) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(InsertMode, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (InsertMode) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(InsertMode, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(InsertMode) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(InsertMode, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(InsertMode) >= 2 * PyLong_SHIFT)) { return (InsertMode) (((((InsertMode)digits[1]) << PyLong_SHIFT) | (InsertMode)digits[0])); } } break; case 3: if ((8 * sizeof(InsertMode) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(InsertMode, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(InsertMode) >= 3 * PyLong_SHIFT)) { return (InsertMode) (((((((InsertMode)digits[2]) << PyLong_SHIFT) | (InsertMode)digits[1]) << PyLong_SHIFT) | (InsertMode)digits[0])); } } break; case 4: if ((8 * sizeof(InsertMode) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(InsertMode, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(InsertMode) >= 4 * PyLong_SHIFT)) { return (InsertMode) (((((((((InsertMode)digits[3]) << PyLong_SHIFT) | (InsertMode)digits[2]) << PyLong_SHIFT) | (InsertMode)digits[1]) << PyLong_SHIFT) | (InsertMode)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (InsertMode) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(InsertMode) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(InsertMode, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(InsertMode) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(InsertMode, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(InsertMode, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(InsertMode) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(InsertMode, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(InsertMode) - 1 > 2 * PyLong_SHIFT)) { return (InsertMode) (((InsertMode)-1)*(((((InsertMode)digits[1]) << PyLong_SHIFT) | (InsertMode)digits[0]))); } } break; case 2: if ((8 * sizeof(InsertMode) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(InsertMode, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(InsertMode) - 1 > 2 * PyLong_SHIFT)) { return (InsertMode) ((((((InsertMode)digits[1]) << PyLong_SHIFT) | (InsertMode)digits[0]))); } } break; case -3: if ((8 * sizeof(InsertMode) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(InsertMode, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(InsertMode) - 1 > 3 * PyLong_SHIFT)) { return (InsertMode) (((InsertMode)-1)*(((((((InsertMode)digits[2]) << PyLong_SHIFT) | (InsertMode)digits[1]) << PyLong_SHIFT) | (InsertMode)digits[0]))); } } break; case 3: if ((8 * sizeof(InsertMode) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(InsertMode, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(InsertMode) - 1 > 3 * PyLong_SHIFT)) { return (InsertMode) ((((((((InsertMode)digits[2]) << PyLong_SHIFT) | (InsertMode)digits[1]) << PyLong_SHIFT) | (InsertMode)digits[0]))); } } break; case -4: if ((8 * sizeof(InsertMode) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(InsertMode, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(InsertMode) - 1 > 4 * PyLong_SHIFT)) { return (InsertMode) (((InsertMode)-1)*(((((((((InsertMode)digits[3]) << PyLong_SHIFT) | (InsertMode)digits[2]) << PyLong_SHIFT) | (InsertMode)digits[1]) << PyLong_SHIFT) | (InsertMode)digits[0]))); } } break; case 4: if ((8 * sizeof(InsertMode) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(InsertMode, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(InsertMode) - 1 > 4 * PyLong_SHIFT)) { return (InsertMode) ((((((((((InsertMode)digits[3]) << PyLong_SHIFT) | (InsertMode)digits[2]) << PyLong_SHIFT) | (InsertMode)digits[1]) << PyLong_SHIFT) | (InsertMode)digits[0]))); } } break; } } #endif if ((sizeof(InsertMode) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(InsertMode, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(InsertMode) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(InsertMode, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available, cannot convert large enums"); return (InsertMode) -1; } else { InsertMode val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (InsertMode) -1; val = __Pyx_PyInt_As_InsertMode(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to InsertMode"); return (InsertMode) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to InsertMode"); return (InsertMode) -1; } /* CIntFromPy */ static CYTHON_INLINE ScatterMode __Pyx_PyInt_As_ScatterMode(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const ScatterMode neg_one = (ScatterMode) -1, const_zero = (ScatterMode) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(ScatterMode) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(ScatterMode, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (ScatterMode) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(ScatterMode, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(ScatterMode) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(ScatterMode, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(ScatterMode) >= 2 * PyLong_SHIFT)) { return (ScatterMode) (((((ScatterMode)digits[1]) << PyLong_SHIFT) | (ScatterMode)digits[0])); } } break; case 3: if ((8 * sizeof(ScatterMode) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(ScatterMode, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(ScatterMode) >= 3 * PyLong_SHIFT)) { return (ScatterMode) (((((((ScatterMode)digits[2]) << PyLong_SHIFT) | (ScatterMode)digits[1]) << PyLong_SHIFT) | (ScatterMode)digits[0])); } } break; case 4: if ((8 * sizeof(ScatterMode) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(ScatterMode, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(ScatterMode) >= 4 * PyLong_SHIFT)) { return (ScatterMode) (((((((((ScatterMode)digits[3]) << PyLong_SHIFT) | (ScatterMode)digits[2]) << PyLong_SHIFT) | (ScatterMode)digits[1]) << PyLong_SHIFT) | (ScatterMode)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (ScatterMode) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(ScatterMode) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(ScatterMode, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(ScatterMode) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(ScatterMode, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(ScatterMode, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(ScatterMode) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(ScatterMode, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(ScatterMode) - 1 > 2 * PyLong_SHIFT)) { return (ScatterMode) (((ScatterMode)-1)*(((((ScatterMode)digits[1]) << PyLong_SHIFT) | (ScatterMode)digits[0]))); } } break; case 2: if ((8 * sizeof(ScatterMode) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(ScatterMode, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(ScatterMode) - 1 > 2 * PyLong_SHIFT)) { return (ScatterMode) ((((((ScatterMode)digits[1]) << PyLong_SHIFT) | (ScatterMode)digits[0]))); } } break; case -3: if ((8 * sizeof(ScatterMode) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(ScatterMode, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(ScatterMode) - 1 > 3 * PyLong_SHIFT)) { return (ScatterMode) (((ScatterMode)-1)*(((((((ScatterMode)digits[2]) << PyLong_SHIFT) | (ScatterMode)digits[1]) << PyLong_SHIFT) | (ScatterMode)digits[0]))); } } break; case 3: if ((8 * sizeof(ScatterMode) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(ScatterMode, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(ScatterMode) - 1 > 3 * PyLong_SHIFT)) { return (ScatterMode) ((((((((ScatterMode)digits[2]) << PyLong_SHIFT) | (ScatterMode)digits[1]) << PyLong_SHIFT) | (ScatterMode)digits[0]))); } } break; case -4: if ((8 * sizeof(ScatterMode) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(ScatterMode, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(ScatterMode) - 1 > 4 * PyLong_SHIFT)) { return (ScatterMode) (((ScatterMode)-1)*(((((((((ScatterMode)digits[3]) << PyLong_SHIFT) | (ScatterMode)digits[2]) << PyLong_SHIFT) | (ScatterMode)digits[1]) << PyLong_SHIFT) | (ScatterMode)digits[0]))); } } break; case 4: if ((8 * sizeof(ScatterMode) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(ScatterMode, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(ScatterMode) - 1 > 4 * PyLong_SHIFT)) { return (ScatterMode) ((((((((((ScatterMode)digits[3]) << PyLong_SHIFT) | (ScatterMode)digits[2]) << PyLong_SHIFT) | (ScatterMode)digits[1]) << PyLong_SHIFT) | (ScatterMode)digits[0]))); } } break; } } #endif if ((sizeof(ScatterMode) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(ScatterMode, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(ScatterMode) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(ScatterMode, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available, cannot convert large enums"); return (ScatterMode) -1; } else { ScatterMode val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (ScatterMode) -1; val = __Pyx_PyInt_As_ScatterMode(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to ScatterMode"); return (ScatterMode) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to ScatterMode"); return (ScatterMode) -1; } /* CIntFromPy */ static CYTHON_INLINE PetscFileMode __Pyx_PyInt_As_PetscFileMode(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PetscFileMode neg_one = (PetscFileMode) -1, const_zero = (PetscFileMode) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(PetscFileMode) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(PetscFileMode, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (PetscFileMode) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(PetscFileMode, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(PetscFileMode) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscFileMode, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscFileMode) >= 2 * PyLong_SHIFT)) { return (PetscFileMode) (((((PetscFileMode)digits[1]) << PyLong_SHIFT) | (PetscFileMode)digits[0])); } } break; case 3: if ((8 * sizeof(PetscFileMode) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscFileMode, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscFileMode) >= 3 * PyLong_SHIFT)) { return (PetscFileMode) (((((((PetscFileMode)digits[2]) << PyLong_SHIFT) | (PetscFileMode)digits[1]) << PyLong_SHIFT) | (PetscFileMode)digits[0])); } } break; case 4: if ((8 * sizeof(PetscFileMode) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscFileMode, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscFileMode) >= 4 * PyLong_SHIFT)) { return (PetscFileMode) (((((((((PetscFileMode)digits[3]) << PyLong_SHIFT) | (PetscFileMode)digits[2]) << PyLong_SHIFT) | (PetscFileMode)digits[1]) << PyLong_SHIFT) | (PetscFileMode)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (PetscFileMode) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(PetscFileMode) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(PetscFileMode, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(PetscFileMode) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(PetscFileMode, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(PetscFileMode, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(PetscFileMode) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscFileMode, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscFileMode) - 1 > 2 * PyLong_SHIFT)) { return (PetscFileMode) (((PetscFileMode)-1)*(((((PetscFileMode)digits[1]) << PyLong_SHIFT) | (PetscFileMode)digits[0]))); } } break; case 2: if ((8 * sizeof(PetscFileMode) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscFileMode, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscFileMode) - 1 > 2 * PyLong_SHIFT)) { return (PetscFileMode) ((((((PetscFileMode)digits[1]) << PyLong_SHIFT) | (PetscFileMode)digits[0]))); } } break; case -3: if ((8 * sizeof(PetscFileMode) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscFileMode, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscFileMode) - 1 > 3 * PyLong_SHIFT)) { return (PetscFileMode) (((PetscFileMode)-1)*(((((((PetscFileMode)digits[2]) << PyLong_SHIFT) | (PetscFileMode)digits[1]) << PyLong_SHIFT) | (PetscFileMode)digits[0]))); } } break; case 3: if ((8 * sizeof(PetscFileMode) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscFileMode, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscFileMode) - 1 > 3 * PyLong_SHIFT)) { return (PetscFileMode) ((((((((PetscFileMode)digits[2]) << PyLong_SHIFT) | (PetscFileMode)digits[1]) << PyLong_SHIFT) | (PetscFileMode)digits[0]))); } } break; case -4: if ((8 * sizeof(PetscFileMode) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscFileMode, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscFileMode) - 1 > 4 * PyLong_SHIFT)) { return (PetscFileMode) (((PetscFileMode)-1)*(((((((((PetscFileMode)digits[3]) << PyLong_SHIFT) | (PetscFileMode)digits[2]) << PyLong_SHIFT) | (PetscFileMode)digits[1]) << PyLong_SHIFT) | (PetscFileMode)digits[0]))); } } break; case 4: if ((8 * sizeof(PetscFileMode) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscFileMode, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscFileMode) - 1 > 4 * PyLong_SHIFT)) { return (PetscFileMode) ((((((((((PetscFileMode)digits[3]) << PyLong_SHIFT) | (PetscFileMode)digits[2]) << PyLong_SHIFT) | (PetscFileMode)digits[1]) << PyLong_SHIFT) | (PetscFileMode)digits[0]))); } } break; } } #endif if ((sizeof(PetscFileMode) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(PetscFileMode, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(PetscFileMode) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(PetscFileMode, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available, cannot convert large enums"); return (PetscFileMode) -1; } else { PetscFileMode val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (PetscFileMode) -1; val = __Pyx_PyInt_As_PetscFileMode(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to PetscFileMode"); return (PetscFileMode) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to PetscFileMode"); return (PetscFileMode) -1; } /* CIntFromPy */ static CYTHON_INLINE PetscDeviceType __Pyx_PyInt_As_PetscDeviceType(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PetscDeviceType neg_one = (PetscDeviceType) -1, const_zero = (PetscDeviceType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(PetscDeviceType) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(PetscDeviceType, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (PetscDeviceType) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(PetscDeviceType, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(PetscDeviceType) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscDeviceType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscDeviceType) >= 2 * PyLong_SHIFT)) { return (PetscDeviceType) (((((PetscDeviceType)digits[1]) << PyLong_SHIFT) | (PetscDeviceType)digits[0])); } } break; case 3: if ((8 * sizeof(PetscDeviceType) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscDeviceType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscDeviceType) >= 3 * PyLong_SHIFT)) { return (PetscDeviceType) (((((((PetscDeviceType)digits[2]) << PyLong_SHIFT) | (PetscDeviceType)digits[1]) << PyLong_SHIFT) | (PetscDeviceType)digits[0])); } } break; case 4: if ((8 * sizeof(PetscDeviceType) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscDeviceType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscDeviceType) >= 4 * PyLong_SHIFT)) { return (PetscDeviceType) (((((((((PetscDeviceType)digits[3]) << PyLong_SHIFT) | (PetscDeviceType)digits[2]) << PyLong_SHIFT) | (PetscDeviceType)digits[1]) << PyLong_SHIFT) | (PetscDeviceType)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (PetscDeviceType) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(PetscDeviceType) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(PetscDeviceType, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(PetscDeviceType) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(PetscDeviceType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(PetscDeviceType, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(PetscDeviceType) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscDeviceType, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscDeviceType) - 1 > 2 * PyLong_SHIFT)) { return (PetscDeviceType) (((PetscDeviceType)-1)*(((((PetscDeviceType)digits[1]) << PyLong_SHIFT) | (PetscDeviceType)digits[0]))); } } break; case 2: if ((8 * sizeof(PetscDeviceType) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscDeviceType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscDeviceType) - 1 > 2 * PyLong_SHIFT)) { return (PetscDeviceType) ((((((PetscDeviceType)digits[1]) << PyLong_SHIFT) | (PetscDeviceType)digits[0]))); } } break; case -3: if ((8 * sizeof(PetscDeviceType) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscDeviceType, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscDeviceType) - 1 > 3 * PyLong_SHIFT)) { return (PetscDeviceType) (((PetscDeviceType)-1)*(((((((PetscDeviceType)digits[2]) << PyLong_SHIFT) | (PetscDeviceType)digits[1]) << PyLong_SHIFT) | (PetscDeviceType)digits[0]))); } } break; case 3: if ((8 * sizeof(PetscDeviceType) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscDeviceType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscDeviceType) - 1 > 3 * PyLong_SHIFT)) { return (PetscDeviceType) ((((((((PetscDeviceType)digits[2]) << PyLong_SHIFT) | (PetscDeviceType)digits[1]) << PyLong_SHIFT) | (PetscDeviceType)digits[0]))); } } break; case -4: if ((8 * sizeof(PetscDeviceType) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscDeviceType, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscDeviceType) - 1 > 4 * PyLong_SHIFT)) { return (PetscDeviceType) (((PetscDeviceType)-1)*(((((((((PetscDeviceType)digits[3]) << PyLong_SHIFT) | (PetscDeviceType)digits[2]) << PyLong_SHIFT) | (PetscDeviceType)digits[1]) << PyLong_SHIFT) | (PetscDeviceType)digits[0]))); } } break; case 4: if ((8 * sizeof(PetscDeviceType) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscDeviceType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscDeviceType) - 1 > 4 * PyLong_SHIFT)) { return (PetscDeviceType) ((((((((((PetscDeviceType)digits[3]) << PyLong_SHIFT) | (PetscDeviceType)digits[2]) << PyLong_SHIFT) | (PetscDeviceType)digits[1]) << PyLong_SHIFT) | (PetscDeviceType)digits[0]))); } } break; } } #endif if ((sizeof(PetscDeviceType) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(PetscDeviceType, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(PetscDeviceType) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(PetscDeviceType, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available, cannot convert large enums"); return (PetscDeviceType) -1; } else { PetscDeviceType val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (PetscDeviceType) -1; val = __Pyx_PyInt_As_PetscDeviceType(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to PetscDeviceType"); return (PetscDeviceType) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to PetscDeviceType"); return (PetscDeviceType) -1; } /* CIntFromPy */ static CYTHON_INLINE PetscStreamType __Pyx_PyInt_As_PetscStreamType(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PetscStreamType neg_one = (PetscStreamType) -1, const_zero = (PetscStreamType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(PetscStreamType) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(PetscStreamType, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (PetscStreamType) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(PetscStreamType, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(PetscStreamType) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscStreamType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscStreamType) >= 2 * PyLong_SHIFT)) { return (PetscStreamType) (((((PetscStreamType)digits[1]) << PyLong_SHIFT) | (PetscStreamType)digits[0])); } } break; case 3: if ((8 * sizeof(PetscStreamType) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscStreamType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscStreamType) >= 3 * PyLong_SHIFT)) { return (PetscStreamType) (((((((PetscStreamType)digits[2]) << PyLong_SHIFT) | (PetscStreamType)digits[1]) << PyLong_SHIFT) | (PetscStreamType)digits[0])); } } break; case 4: if ((8 * sizeof(PetscStreamType) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscStreamType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscStreamType) >= 4 * PyLong_SHIFT)) { return (PetscStreamType) (((((((((PetscStreamType)digits[3]) << PyLong_SHIFT) | (PetscStreamType)digits[2]) << PyLong_SHIFT) | (PetscStreamType)digits[1]) << PyLong_SHIFT) | (PetscStreamType)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (PetscStreamType) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(PetscStreamType) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(PetscStreamType, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(PetscStreamType) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(PetscStreamType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(PetscStreamType, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(PetscStreamType) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscStreamType, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscStreamType) - 1 > 2 * PyLong_SHIFT)) { return (PetscStreamType) (((PetscStreamType)-1)*(((((PetscStreamType)digits[1]) << PyLong_SHIFT) | (PetscStreamType)digits[0]))); } } break; case 2: if ((8 * sizeof(PetscStreamType) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscStreamType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscStreamType) - 1 > 2 * PyLong_SHIFT)) { return (PetscStreamType) ((((((PetscStreamType)digits[1]) << PyLong_SHIFT) | (PetscStreamType)digits[0]))); } } break; case -3: if ((8 * sizeof(PetscStreamType) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscStreamType, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscStreamType) - 1 > 3 * PyLong_SHIFT)) { return (PetscStreamType) (((PetscStreamType)-1)*(((((((PetscStreamType)digits[2]) << PyLong_SHIFT) | (PetscStreamType)digits[1]) << PyLong_SHIFT) | (PetscStreamType)digits[0]))); } } break; case 3: if ((8 * sizeof(PetscStreamType) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscStreamType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscStreamType) - 1 > 3 * PyLong_SHIFT)) { return (PetscStreamType) ((((((((PetscStreamType)digits[2]) << PyLong_SHIFT) | (PetscStreamType)digits[1]) << PyLong_SHIFT) | (PetscStreamType)digits[0]))); } } break; case -4: if ((8 * sizeof(PetscStreamType) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscStreamType, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscStreamType) - 1 > 4 * PyLong_SHIFT)) { return (PetscStreamType) (((PetscStreamType)-1)*(((((((((PetscStreamType)digits[3]) << PyLong_SHIFT) | (PetscStreamType)digits[2]) << PyLong_SHIFT) | (PetscStreamType)digits[1]) << PyLong_SHIFT) | (PetscStreamType)digits[0]))); } } break; case 4: if ((8 * sizeof(PetscStreamType) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscStreamType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscStreamType) - 1 > 4 * PyLong_SHIFT)) { return (PetscStreamType) ((((((((((PetscStreamType)digits[3]) << PyLong_SHIFT) | (PetscStreamType)digits[2]) << PyLong_SHIFT) | (PetscStreamType)digits[1]) << PyLong_SHIFT) | (PetscStreamType)digits[0]))); } } break; } } #endif if ((sizeof(PetscStreamType) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(PetscStreamType, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(PetscStreamType) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(PetscStreamType, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available, cannot convert large enums"); return (PetscStreamType) -1; } else { PetscStreamType val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (PetscStreamType) -1; val = __Pyx_PyInt_As_PetscStreamType(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to PetscStreamType"); return (PetscStreamType) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to PetscStreamType"); return (PetscStreamType) -1; } /* CIntFromPy */ static CYTHON_INLINE PetscDeviceContextJoinMode __Pyx_PyInt_As_PetscDeviceContextJoinMode(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PetscDeviceContextJoinMode neg_one = (PetscDeviceContextJoinMode) -1, const_zero = (PetscDeviceContextJoinMode) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(PetscDeviceContextJoinMode) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(PetscDeviceContextJoinMode, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (PetscDeviceContextJoinMode) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(PetscDeviceContextJoinMode, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(PetscDeviceContextJoinMode) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscDeviceContextJoinMode, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscDeviceContextJoinMode) >= 2 * PyLong_SHIFT)) { return (PetscDeviceContextJoinMode) (((((PetscDeviceContextJoinMode)digits[1]) << PyLong_SHIFT) | (PetscDeviceContextJoinMode)digits[0])); } } break; case 3: if ((8 * sizeof(PetscDeviceContextJoinMode) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscDeviceContextJoinMode, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscDeviceContextJoinMode) >= 3 * PyLong_SHIFT)) { return (PetscDeviceContextJoinMode) (((((((PetscDeviceContextJoinMode)digits[2]) << PyLong_SHIFT) | (PetscDeviceContextJoinMode)digits[1]) << PyLong_SHIFT) | (PetscDeviceContextJoinMode)digits[0])); } } break; case 4: if ((8 * sizeof(PetscDeviceContextJoinMode) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscDeviceContextJoinMode, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscDeviceContextJoinMode) >= 4 * PyLong_SHIFT)) { return (PetscDeviceContextJoinMode) (((((((((PetscDeviceContextJoinMode)digits[3]) << PyLong_SHIFT) | (PetscDeviceContextJoinMode)digits[2]) << PyLong_SHIFT) | (PetscDeviceContextJoinMode)digits[1]) << PyLong_SHIFT) | (PetscDeviceContextJoinMode)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (PetscDeviceContextJoinMode) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(PetscDeviceContextJoinMode) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(PetscDeviceContextJoinMode, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(PetscDeviceContextJoinMode) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(PetscDeviceContextJoinMode, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(PetscDeviceContextJoinMode, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(PetscDeviceContextJoinMode) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscDeviceContextJoinMode, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscDeviceContextJoinMode) - 1 > 2 * PyLong_SHIFT)) { return (PetscDeviceContextJoinMode) (((PetscDeviceContextJoinMode)-1)*(((((PetscDeviceContextJoinMode)digits[1]) << PyLong_SHIFT) | (PetscDeviceContextJoinMode)digits[0]))); } } break; case 2: if ((8 * sizeof(PetscDeviceContextJoinMode) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscDeviceContextJoinMode, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscDeviceContextJoinMode) - 1 > 2 * PyLong_SHIFT)) { return (PetscDeviceContextJoinMode) ((((((PetscDeviceContextJoinMode)digits[1]) << PyLong_SHIFT) | (PetscDeviceContextJoinMode)digits[0]))); } } break; case -3: if ((8 * sizeof(PetscDeviceContextJoinMode) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscDeviceContextJoinMode, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscDeviceContextJoinMode) - 1 > 3 * PyLong_SHIFT)) { return (PetscDeviceContextJoinMode) (((PetscDeviceContextJoinMode)-1)*(((((((PetscDeviceContextJoinMode)digits[2]) << PyLong_SHIFT) | (PetscDeviceContextJoinMode)digits[1]) << PyLong_SHIFT) | (PetscDeviceContextJoinMode)digits[0]))); } } break; case 3: if ((8 * sizeof(PetscDeviceContextJoinMode) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscDeviceContextJoinMode, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscDeviceContextJoinMode) - 1 > 3 * PyLong_SHIFT)) { return (PetscDeviceContextJoinMode) ((((((((PetscDeviceContextJoinMode)digits[2]) << PyLong_SHIFT) | (PetscDeviceContextJoinMode)digits[1]) << PyLong_SHIFT) | (PetscDeviceContextJoinMode)digits[0]))); } } break; case -4: if ((8 * sizeof(PetscDeviceContextJoinMode) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscDeviceContextJoinMode, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscDeviceContextJoinMode) - 1 > 4 * PyLong_SHIFT)) { return (PetscDeviceContextJoinMode) (((PetscDeviceContextJoinMode)-1)*(((((((((PetscDeviceContextJoinMode)digits[3]) << PyLong_SHIFT) | (PetscDeviceContextJoinMode)digits[2]) << PyLong_SHIFT) | (PetscDeviceContextJoinMode)digits[1]) << PyLong_SHIFT) | (PetscDeviceContextJoinMode)digits[0]))); } } break; case 4: if ((8 * sizeof(PetscDeviceContextJoinMode) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscDeviceContextJoinMode, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscDeviceContextJoinMode) - 1 > 4 * PyLong_SHIFT)) { return (PetscDeviceContextJoinMode) ((((((((((PetscDeviceContextJoinMode)digits[3]) << PyLong_SHIFT) | (PetscDeviceContextJoinMode)digits[2]) << PyLong_SHIFT) | (PetscDeviceContextJoinMode)digits[1]) << PyLong_SHIFT) | (PetscDeviceContextJoinMode)digits[0]))); } } break; } } #endif if ((sizeof(PetscDeviceContextJoinMode) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(PetscDeviceContextJoinMode, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(PetscDeviceContextJoinMode) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(PetscDeviceContextJoinMode, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available, cannot convert large enums"); return (PetscDeviceContextJoinMode) -1; } else { PetscDeviceContextJoinMode val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (PetscDeviceContextJoinMode) -1; val = __Pyx_PyInt_As_PetscDeviceContextJoinMode(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to PetscDeviceContextJoinMode"); return (PetscDeviceContextJoinMode) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to PetscDeviceContextJoinMode"); return (PetscDeviceContextJoinMode) -1; } /* TypeInfoToFormat */ static struct __pyx_typeinfo_string __Pyx_TypeInfoToFormat(__Pyx_TypeInfo *type) { struct __pyx_typeinfo_string result = { {0} }; char *buf = (char *) result.string; size_t size = type->size; switch (type->typegroup) { case 'H': *buf = 'c'; break; case 'I': case 'U': if (size == 1) *buf = (type->is_unsigned) ? 'B' : 'b'; else if (size == 2) *buf = (type->is_unsigned) ? 'H' : 'h'; else if (size == 4) *buf = (type->is_unsigned) ? 'I' : 'i'; else if (size == 8) *buf = (type->is_unsigned) ? 'Q' : 'q'; break; case 'P': *buf = 'P'; break; case 'C': { __Pyx_TypeInfo complex_type = *type; complex_type.typegroup = 'R'; complex_type.size /= 2; *buf++ = 'Z'; *buf = __Pyx_TypeInfoToFormat(&complex_type).string[0]; break; } case 'R': if (size == 4) *buf = 'f'; else if (size == 8) *buf = 'd'; else *buf = 'g'; break; } return result; } /* CIntFromPy */ static CYTHON_INLINE int64_t __Pyx_PyInt_As_int64_t(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int64_t neg_one = (int64_t) -1, const_zero = (int64_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int64_t) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int64_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int64_t) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int64_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int64_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int64_t) >= 2 * PyLong_SHIFT)) { return (int64_t) (((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])); } } break; case 3: if ((8 * sizeof(int64_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int64_t) >= 3 * PyLong_SHIFT)) { return (int64_t) (((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])); } } break; case 4: if ((8 * sizeof(int64_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int64_t) >= 4 * PyLong_SHIFT)) { return (int64_t) (((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int64_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int64_t) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int64_t, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int64_t) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int64_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int64_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int64_t) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT)) { return (int64_t) (((int64_t)-1)*(((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); } } break; case 2: if ((8 * sizeof(int64_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT)) { return (int64_t) ((((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); } } break; case -3: if ((8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT)) { return (int64_t) (((int64_t)-1)*(((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); } } break; case 3: if ((8 * sizeof(int64_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT)) { return (int64_t) ((((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); } } break; case -4: if ((8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int64_t) - 1 > 4 * PyLong_SHIFT)) { return (int64_t) (((int64_t)-1)*(((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); } } break; case 4: if ((8 * sizeof(int64_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int64_t) - 1 > 4 * PyLong_SHIFT)) { return (int64_t) ((((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); } } break; } } #endif if ((sizeof(int64_t) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int64_t, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int64_t) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int64_t, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int64_t val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (int64_t) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (int64_t) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int64_t) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (int64_t) -1; } else { stepval = __Pyx_NewRef(v); } val = (int64_t) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int64_t) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((int64_t) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int64_t) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int64_t) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((int64_t) 1) << (sizeof(int64_t) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (int64_t) -1; } } else { int64_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int64_t) -1; val = __Pyx_PyInt_As_int64_t(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int64_t"); return (int64_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int64_t"); return (int64_t) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PetscMemType(PetscMemType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PetscMemType neg_one = (PetscMemType) -1, const_zero = (PetscMemType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(PetscMemType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(PetscMemType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PetscMemType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(PetscMemType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PetscMemType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(PetscMemType), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(PetscMemType)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____pyx_t_8petsc4py_5PETSc_PetscDLDeviceType(enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType neg_one = (enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType) -1, const_zero = (enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64_t(int64_t value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int64_t neg_one = (int64_t) -1, const_zero = (int64_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int64_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int64_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int64_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int64_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int64_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(int64_t), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int64_t)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE MatStructure __Pyx_PyInt_As_MatStructure(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const MatStructure neg_one = (MatStructure) -1, const_zero = (MatStructure) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(MatStructure) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(MatStructure, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (MatStructure) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(MatStructure, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(MatStructure) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(MatStructure, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(MatStructure) >= 2 * PyLong_SHIFT)) { return (MatStructure) (((((MatStructure)digits[1]) << PyLong_SHIFT) | (MatStructure)digits[0])); } } break; case 3: if ((8 * sizeof(MatStructure) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(MatStructure, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(MatStructure) >= 3 * PyLong_SHIFT)) { return (MatStructure) (((((((MatStructure)digits[2]) << PyLong_SHIFT) | (MatStructure)digits[1]) << PyLong_SHIFT) | (MatStructure)digits[0])); } } break; case 4: if ((8 * sizeof(MatStructure) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(MatStructure, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(MatStructure) >= 4 * PyLong_SHIFT)) { return (MatStructure) (((((((((MatStructure)digits[3]) << PyLong_SHIFT) | (MatStructure)digits[2]) << PyLong_SHIFT) | (MatStructure)digits[1]) << PyLong_SHIFT) | (MatStructure)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (MatStructure) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(MatStructure) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(MatStructure, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(MatStructure) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(MatStructure, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(MatStructure, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(MatStructure) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(MatStructure, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(MatStructure) - 1 > 2 * PyLong_SHIFT)) { return (MatStructure) (((MatStructure)-1)*(((((MatStructure)digits[1]) << PyLong_SHIFT) | (MatStructure)digits[0]))); } } break; case 2: if ((8 * sizeof(MatStructure) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(MatStructure, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(MatStructure) - 1 > 2 * PyLong_SHIFT)) { return (MatStructure) ((((((MatStructure)digits[1]) << PyLong_SHIFT) | (MatStructure)digits[0]))); } } break; case -3: if ((8 * sizeof(MatStructure) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(MatStructure, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(MatStructure) - 1 > 3 * PyLong_SHIFT)) { return (MatStructure) (((MatStructure)-1)*(((((((MatStructure)digits[2]) << PyLong_SHIFT) | (MatStructure)digits[1]) << PyLong_SHIFT) | (MatStructure)digits[0]))); } } break; case 3: if ((8 * sizeof(MatStructure) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(MatStructure, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(MatStructure) - 1 > 3 * PyLong_SHIFT)) { return (MatStructure) ((((((((MatStructure)digits[2]) << PyLong_SHIFT) | (MatStructure)digits[1]) << PyLong_SHIFT) | (MatStructure)digits[0]))); } } break; case -4: if ((8 * sizeof(MatStructure) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(MatStructure, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(MatStructure) - 1 > 4 * PyLong_SHIFT)) { return (MatStructure) (((MatStructure)-1)*(((((((((MatStructure)digits[3]) << PyLong_SHIFT) | (MatStructure)digits[2]) << PyLong_SHIFT) | (MatStructure)digits[1]) << PyLong_SHIFT) | (MatStructure)digits[0]))); } } break; case 4: if ((8 * sizeof(MatStructure) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(MatStructure, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(MatStructure) - 1 > 4 * PyLong_SHIFT)) { return (MatStructure) ((((((((((MatStructure)digits[3]) << PyLong_SHIFT) | (MatStructure)digits[2]) << PyLong_SHIFT) | (MatStructure)digits[1]) << PyLong_SHIFT) | (MatStructure)digits[0]))); } } break; } } #endif if ((sizeof(MatStructure) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(MatStructure, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(MatStructure) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(MatStructure, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available, cannot convert large enums"); return (MatStructure) -1; } else { MatStructure val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (MatStructure) -1; val = __Pyx_PyInt_As_MatStructure(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to MatStructure"); return (MatStructure) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to MatStructure"); return (MatStructure) -1; } /* CIntFromPy */ static CYTHON_INLINE MatAssemblyType __Pyx_PyInt_As_MatAssemblyType(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const MatAssemblyType neg_one = (MatAssemblyType) -1, const_zero = (MatAssemblyType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(MatAssemblyType) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(MatAssemblyType, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (MatAssemblyType) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(MatAssemblyType, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(MatAssemblyType) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(MatAssemblyType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(MatAssemblyType) >= 2 * PyLong_SHIFT)) { return (MatAssemblyType) (((((MatAssemblyType)digits[1]) << PyLong_SHIFT) | (MatAssemblyType)digits[0])); } } break; case 3: if ((8 * sizeof(MatAssemblyType) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(MatAssemblyType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(MatAssemblyType) >= 3 * PyLong_SHIFT)) { return (MatAssemblyType) (((((((MatAssemblyType)digits[2]) << PyLong_SHIFT) | (MatAssemblyType)digits[1]) << PyLong_SHIFT) | (MatAssemblyType)digits[0])); } } break; case 4: if ((8 * sizeof(MatAssemblyType) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(MatAssemblyType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(MatAssemblyType) >= 4 * PyLong_SHIFT)) { return (MatAssemblyType) (((((((((MatAssemblyType)digits[3]) << PyLong_SHIFT) | (MatAssemblyType)digits[2]) << PyLong_SHIFT) | (MatAssemblyType)digits[1]) << PyLong_SHIFT) | (MatAssemblyType)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (MatAssemblyType) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(MatAssemblyType) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(MatAssemblyType, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(MatAssemblyType) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(MatAssemblyType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(MatAssemblyType, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(MatAssemblyType) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(MatAssemblyType, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(MatAssemblyType) - 1 > 2 * PyLong_SHIFT)) { return (MatAssemblyType) (((MatAssemblyType)-1)*(((((MatAssemblyType)digits[1]) << PyLong_SHIFT) | (MatAssemblyType)digits[0]))); } } break; case 2: if ((8 * sizeof(MatAssemblyType) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(MatAssemblyType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(MatAssemblyType) - 1 > 2 * PyLong_SHIFT)) { return (MatAssemblyType) ((((((MatAssemblyType)digits[1]) << PyLong_SHIFT) | (MatAssemblyType)digits[0]))); } } break; case -3: if ((8 * sizeof(MatAssemblyType) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(MatAssemblyType, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(MatAssemblyType) - 1 > 3 * PyLong_SHIFT)) { return (MatAssemblyType) (((MatAssemblyType)-1)*(((((((MatAssemblyType)digits[2]) << PyLong_SHIFT) | (MatAssemblyType)digits[1]) << PyLong_SHIFT) | (MatAssemblyType)digits[0]))); } } break; case 3: if ((8 * sizeof(MatAssemblyType) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(MatAssemblyType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(MatAssemblyType) - 1 > 3 * PyLong_SHIFT)) { return (MatAssemblyType) ((((((((MatAssemblyType)digits[2]) << PyLong_SHIFT) | (MatAssemblyType)digits[1]) << PyLong_SHIFT) | (MatAssemblyType)digits[0]))); } } break; case -4: if ((8 * sizeof(MatAssemblyType) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(MatAssemblyType, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(MatAssemblyType) - 1 > 4 * PyLong_SHIFT)) { return (MatAssemblyType) (((MatAssemblyType)-1)*(((((((((MatAssemblyType)digits[3]) << PyLong_SHIFT) | (MatAssemblyType)digits[2]) << PyLong_SHIFT) | (MatAssemblyType)digits[1]) << PyLong_SHIFT) | (MatAssemblyType)digits[0]))); } } break; case 4: if ((8 * sizeof(MatAssemblyType) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(MatAssemblyType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(MatAssemblyType) - 1 > 4 * PyLong_SHIFT)) { return (MatAssemblyType) ((((((((((MatAssemblyType)digits[3]) << PyLong_SHIFT) | (MatAssemblyType)digits[2]) << PyLong_SHIFT) | (MatAssemblyType)digits[1]) << PyLong_SHIFT) | (MatAssemblyType)digits[0]))); } } break; } } #endif if ((sizeof(MatAssemblyType) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(MatAssemblyType, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(MatAssemblyType) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(MatAssemblyType, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available, cannot convert large enums"); return (MatAssemblyType) -1; } else { MatAssemblyType val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (MatAssemblyType) -1; val = __Pyx_PyInt_As_MatAssemblyType(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to MatAssemblyType"); return (MatAssemblyType) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to MatAssemblyType"); return (MatAssemblyType) -1; } /* CIntFromPy */ static CYTHON_INLINE MatInfoType __Pyx_PyInt_As_MatInfoType(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const MatInfoType neg_one = (MatInfoType) -1, const_zero = (MatInfoType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(MatInfoType) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(MatInfoType, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (MatInfoType) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(MatInfoType, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(MatInfoType) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(MatInfoType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(MatInfoType) >= 2 * PyLong_SHIFT)) { return (MatInfoType) (((((MatInfoType)digits[1]) << PyLong_SHIFT) | (MatInfoType)digits[0])); } } break; case 3: if ((8 * sizeof(MatInfoType) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(MatInfoType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(MatInfoType) >= 3 * PyLong_SHIFT)) { return (MatInfoType) (((((((MatInfoType)digits[2]) << PyLong_SHIFT) | (MatInfoType)digits[1]) << PyLong_SHIFT) | (MatInfoType)digits[0])); } } break; case 4: if ((8 * sizeof(MatInfoType) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(MatInfoType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(MatInfoType) >= 4 * PyLong_SHIFT)) { return (MatInfoType) (((((((((MatInfoType)digits[3]) << PyLong_SHIFT) | (MatInfoType)digits[2]) << PyLong_SHIFT) | (MatInfoType)digits[1]) << PyLong_SHIFT) | (MatInfoType)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (MatInfoType) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(MatInfoType) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(MatInfoType, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(MatInfoType) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(MatInfoType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(MatInfoType, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(MatInfoType) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(MatInfoType, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(MatInfoType) - 1 > 2 * PyLong_SHIFT)) { return (MatInfoType) (((MatInfoType)-1)*(((((MatInfoType)digits[1]) << PyLong_SHIFT) | (MatInfoType)digits[0]))); } } break; case 2: if ((8 * sizeof(MatInfoType) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(MatInfoType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(MatInfoType) - 1 > 2 * PyLong_SHIFT)) { return (MatInfoType) ((((((MatInfoType)digits[1]) << PyLong_SHIFT) | (MatInfoType)digits[0]))); } } break; case -3: if ((8 * sizeof(MatInfoType) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(MatInfoType, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(MatInfoType) - 1 > 3 * PyLong_SHIFT)) { return (MatInfoType) (((MatInfoType)-1)*(((((((MatInfoType)digits[2]) << PyLong_SHIFT) | (MatInfoType)digits[1]) << PyLong_SHIFT) | (MatInfoType)digits[0]))); } } break; case 3: if ((8 * sizeof(MatInfoType) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(MatInfoType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(MatInfoType) - 1 > 3 * PyLong_SHIFT)) { return (MatInfoType) ((((((((MatInfoType)digits[2]) << PyLong_SHIFT) | (MatInfoType)digits[1]) << PyLong_SHIFT) | (MatInfoType)digits[0]))); } } break; case -4: if ((8 * sizeof(MatInfoType) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(MatInfoType, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(MatInfoType) - 1 > 4 * PyLong_SHIFT)) { return (MatInfoType) (((MatInfoType)-1)*(((((((((MatInfoType)digits[3]) << PyLong_SHIFT) | (MatInfoType)digits[2]) << PyLong_SHIFT) | (MatInfoType)digits[1]) << PyLong_SHIFT) | (MatInfoType)digits[0]))); } } break; case 4: if ((8 * sizeof(MatInfoType) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(MatInfoType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(MatInfoType) - 1 > 4 * PyLong_SHIFT)) { return (MatInfoType) ((((((((((MatInfoType)digits[3]) << PyLong_SHIFT) | (MatInfoType)digits[2]) << PyLong_SHIFT) | (MatInfoType)digits[1]) << PyLong_SHIFT) | (MatInfoType)digits[0]))); } } break; } } #endif if ((sizeof(MatInfoType) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(MatInfoType, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(MatInfoType) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(MatInfoType, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available, cannot convert large enums"); return (MatInfoType) -1; } else { MatInfoType val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (MatInfoType) -1; val = __Pyx_PyInt_As_MatInfoType(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to MatInfoType"); return (MatInfoType) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to MatInfoType"); return (MatInfoType) -1; } /* CIntFromPy */ static CYTHON_INLINE MatFactorShiftType __Pyx_PyInt_As_MatFactorShiftType(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const MatFactorShiftType neg_one = (MatFactorShiftType) -1, const_zero = (MatFactorShiftType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(MatFactorShiftType) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(MatFactorShiftType, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (MatFactorShiftType) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(MatFactorShiftType, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(MatFactorShiftType) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(MatFactorShiftType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(MatFactorShiftType) >= 2 * PyLong_SHIFT)) { return (MatFactorShiftType) (((((MatFactorShiftType)digits[1]) << PyLong_SHIFT) | (MatFactorShiftType)digits[0])); } } break; case 3: if ((8 * sizeof(MatFactorShiftType) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(MatFactorShiftType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(MatFactorShiftType) >= 3 * PyLong_SHIFT)) { return (MatFactorShiftType) (((((((MatFactorShiftType)digits[2]) << PyLong_SHIFT) | (MatFactorShiftType)digits[1]) << PyLong_SHIFT) | (MatFactorShiftType)digits[0])); } } break; case 4: if ((8 * sizeof(MatFactorShiftType) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(MatFactorShiftType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(MatFactorShiftType) >= 4 * PyLong_SHIFT)) { return (MatFactorShiftType) (((((((((MatFactorShiftType)digits[3]) << PyLong_SHIFT) | (MatFactorShiftType)digits[2]) << PyLong_SHIFT) | (MatFactorShiftType)digits[1]) << PyLong_SHIFT) | (MatFactorShiftType)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (MatFactorShiftType) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(MatFactorShiftType) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(MatFactorShiftType, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(MatFactorShiftType) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(MatFactorShiftType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(MatFactorShiftType, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(MatFactorShiftType) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(MatFactorShiftType, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(MatFactorShiftType) - 1 > 2 * PyLong_SHIFT)) { return (MatFactorShiftType) (((MatFactorShiftType)-1)*(((((MatFactorShiftType)digits[1]) << PyLong_SHIFT) | (MatFactorShiftType)digits[0]))); } } break; case 2: if ((8 * sizeof(MatFactorShiftType) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(MatFactorShiftType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(MatFactorShiftType) - 1 > 2 * PyLong_SHIFT)) { return (MatFactorShiftType) ((((((MatFactorShiftType)digits[1]) << PyLong_SHIFT) | (MatFactorShiftType)digits[0]))); } } break; case -3: if ((8 * sizeof(MatFactorShiftType) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(MatFactorShiftType, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(MatFactorShiftType) - 1 > 3 * PyLong_SHIFT)) { return (MatFactorShiftType) (((MatFactorShiftType)-1)*(((((((MatFactorShiftType)digits[2]) << PyLong_SHIFT) | (MatFactorShiftType)digits[1]) << PyLong_SHIFT) | (MatFactorShiftType)digits[0]))); } } break; case 3: if ((8 * sizeof(MatFactorShiftType) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(MatFactorShiftType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(MatFactorShiftType) - 1 > 3 * PyLong_SHIFT)) { return (MatFactorShiftType) ((((((((MatFactorShiftType)digits[2]) << PyLong_SHIFT) | (MatFactorShiftType)digits[1]) << PyLong_SHIFT) | (MatFactorShiftType)digits[0]))); } } break; case -4: if ((8 * sizeof(MatFactorShiftType) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(MatFactorShiftType, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(MatFactorShiftType) - 1 > 4 * PyLong_SHIFT)) { return (MatFactorShiftType) (((MatFactorShiftType)-1)*(((((((((MatFactorShiftType)digits[3]) << PyLong_SHIFT) | (MatFactorShiftType)digits[2]) << PyLong_SHIFT) | (MatFactorShiftType)digits[1]) << PyLong_SHIFT) | (MatFactorShiftType)digits[0]))); } } break; case 4: if ((8 * sizeof(MatFactorShiftType) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(MatFactorShiftType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(MatFactorShiftType) - 1 > 4 * PyLong_SHIFT)) { return (MatFactorShiftType) ((((((((((MatFactorShiftType)digits[3]) << PyLong_SHIFT) | (MatFactorShiftType)digits[2]) << PyLong_SHIFT) | (MatFactorShiftType)digits[1]) << PyLong_SHIFT) | (MatFactorShiftType)digits[0]))); } } break; } } #endif if ((sizeof(MatFactorShiftType) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(MatFactorShiftType, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(MatFactorShiftType) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(MatFactorShiftType, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available, cannot convert large enums"); return (MatFactorShiftType) -1; } else { MatFactorShiftType val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (MatFactorShiftType) -1; val = __Pyx_PyInt_As_MatFactorShiftType(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to MatFactorShiftType"); return (MatFactorShiftType) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to MatFactorShiftType"); return (MatFactorShiftType) -1; } /* CIntFromPy */ static CYTHON_INLINE KSPConvergedReason __Pyx_PyInt_As_KSPConvergedReason(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const KSPConvergedReason neg_one = (KSPConvergedReason) -1, const_zero = (KSPConvergedReason) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(KSPConvergedReason) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(KSPConvergedReason, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (KSPConvergedReason) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(KSPConvergedReason, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(KSPConvergedReason) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(KSPConvergedReason, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(KSPConvergedReason) >= 2 * PyLong_SHIFT)) { return (KSPConvergedReason) (((((KSPConvergedReason)digits[1]) << PyLong_SHIFT) | (KSPConvergedReason)digits[0])); } } break; case 3: if ((8 * sizeof(KSPConvergedReason) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(KSPConvergedReason, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(KSPConvergedReason) >= 3 * PyLong_SHIFT)) { return (KSPConvergedReason) (((((((KSPConvergedReason)digits[2]) << PyLong_SHIFT) | (KSPConvergedReason)digits[1]) << PyLong_SHIFT) | (KSPConvergedReason)digits[0])); } } break; case 4: if ((8 * sizeof(KSPConvergedReason) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(KSPConvergedReason, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(KSPConvergedReason) >= 4 * PyLong_SHIFT)) { return (KSPConvergedReason) (((((((((KSPConvergedReason)digits[3]) << PyLong_SHIFT) | (KSPConvergedReason)digits[2]) << PyLong_SHIFT) | (KSPConvergedReason)digits[1]) << PyLong_SHIFT) | (KSPConvergedReason)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (KSPConvergedReason) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(KSPConvergedReason) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(KSPConvergedReason, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(KSPConvergedReason) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(KSPConvergedReason, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(KSPConvergedReason, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(KSPConvergedReason) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(KSPConvergedReason, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(KSPConvergedReason) - 1 > 2 * PyLong_SHIFT)) { return (KSPConvergedReason) (((KSPConvergedReason)-1)*(((((KSPConvergedReason)digits[1]) << PyLong_SHIFT) | (KSPConvergedReason)digits[0]))); } } break; case 2: if ((8 * sizeof(KSPConvergedReason) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(KSPConvergedReason, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(KSPConvergedReason) - 1 > 2 * PyLong_SHIFT)) { return (KSPConvergedReason) ((((((KSPConvergedReason)digits[1]) << PyLong_SHIFT) | (KSPConvergedReason)digits[0]))); } } break; case -3: if ((8 * sizeof(KSPConvergedReason) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(KSPConvergedReason, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(KSPConvergedReason) - 1 > 3 * PyLong_SHIFT)) { return (KSPConvergedReason) (((KSPConvergedReason)-1)*(((((((KSPConvergedReason)digits[2]) << PyLong_SHIFT) | (KSPConvergedReason)digits[1]) << PyLong_SHIFT) | (KSPConvergedReason)digits[0]))); } } break; case 3: if ((8 * sizeof(KSPConvergedReason) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(KSPConvergedReason, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(KSPConvergedReason) - 1 > 3 * PyLong_SHIFT)) { return (KSPConvergedReason) ((((((((KSPConvergedReason)digits[2]) << PyLong_SHIFT) | (KSPConvergedReason)digits[1]) << PyLong_SHIFT) | (KSPConvergedReason)digits[0]))); } } break; case -4: if ((8 * sizeof(KSPConvergedReason) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(KSPConvergedReason, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(KSPConvergedReason) - 1 > 4 * PyLong_SHIFT)) { return (KSPConvergedReason) (((KSPConvergedReason)-1)*(((((((((KSPConvergedReason)digits[3]) << PyLong_SHIFT) | (KSPConvergedReason)digits[2]) << PyLong_SHIFT) | (KSPConvergedReason)digits[1]) << PyLong_SHIFT) | (KSPConvergedReason)digits[0]))); } } break; case 4: if ((8 * sizeof(KSPConvergedReason) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(KSPConvergedReason, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(KSPConvergedReason) - 1 > 4 * PyLong_SHIFT)) { return (KSPConvergedReason) ((((((((((KSPConvergedReason)digits[3]) << PyLong_SHIFT) | (KSPConvergedReason)digits[2]) << PyLong_SHIFT) | (KSPConvergedReason)digits[1]) << PyLong_SHIFT) | (KSPConvergedReason)digits[0]))); } } break; } } #endif if ((sizeof(KSPConvergedReason) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(KSPConvergedReason, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(KSPConvergedReason) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(KSPConvergedReason, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available, cannot convert large enums"); return (KSPConvergedReason) -1; } else { KSPConvergedReason val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (KSPConvergedReason) -1; val = __Pyx_PyInt_As_KSPConvergedReason(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to KSPConvergedReason"); return (KSPConvergedReason) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to KSPConvergedReason"); return (KSPConvergedReason) -1; } /* CIntFromPy */ static CYTHON_INLINE SNESConvergedReason __Pyx_PyInt_As_SNESConvergedReason(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const SNESConvergedReason neg_one = (SNESConvergedReason) -1, const_zero = (SNESConvergedReason) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(SNESConvergedReason) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(SNESConvergedReason, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (SNESConvergedReason) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(SNESConvergedReason, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(SNESConvergedReason) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SNESConvergedReason, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SNESConvergedReason) >= 2 * PyLong_SHIFT)) { return (SNESConvergedReason) (((((SNESConvergedReason)digits[1]) << PyLong_SHIFT) | (SNESConvergedReason)digits[0])); } } break; case 3: if ((8 * sizeof(SNESConvergedReason) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SNESConvergedReason, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SNESConvergedReason) >= 3 * PyLong_SHIFT)) { return (SNESConvergedReason) (((((((SNESConvergedReason)digits[2]) << PyLong_SHIFT) | (SNESConvergedReason)digits[1]) << PyLong_SHIFT) | (SNESConvergedReason)digits[0])); } } break; case 4: if ((8 * sizeof(SNESConvergedReason) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SNESConvergedReason, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SNESConvergedReason) >= 4 * PyLong_SHIFT)) { return (SNESConvergedReason) (((((((((SNESConvergedReason)digits[3]) << PyLong_SHIFT) | (SNESConvergedReason)digits[2]) << PyLong_SHIFT) | (SNESConvergedReason)digits[1]) << PyLong_SHIFT) | (SNESConvergedReason)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (SNESConvergedReason) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(SNESConvergedReason) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(SNESConvergedReason, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(SNESConvergedReason) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(SNESConvergedReason, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(SNESConvergedReason, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(SNESConvergedReason) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SNESConvergedReason, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SNESConvergedReason) - 1 > 2 * PyLong_SHIFT)) { return (SNESConvergedReason) (((SNESConvergedReason)-1)*(((((SNESConvergedReason)digits[1]) << PyLong_SHIFT) | (SNESConvergedReason)digits[0]))); } } break; case 2: if ((8 * sizeof(SNESConvergedReason) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SNESConvergedReason, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SNESConvergedReason) - 1 > 2 * PyLong_SHIFT)) { return (SNESConvergedReason) ((((((SNESConvergedReason)digits[1]) << PyLong_SHIFT) | (SNESConvergedReason)digits[0]))); } } break; case -3: if ((8 * sizeof(SNESConvergedReason) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SNESConvergedReason, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SNESConvergedReason) - 1 > 3 * PyLong_SHIFT)) { return (SNESConvergedReason) (((SNESConvergedReason)-1)*(((((((SNESConvergedReason)digits[2]) << PyLong_SHIFT) | (SNESConvergedReason)digits[1]) << PyLong_SHIFT) | (SNESConvergedReason)digits[0]))); } } break; case 3: if ((8 * sizeof(SNESConvergedReason) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SNESConvergedReason, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SNESConvergedReason) - 1 > 3 * PyLong_SHIFT)) { return (SNESConvergedReason) ((((((((SNESConvergedReason)digits[2]) << PyLong_SHIFT) | (SNESConvergedReason)digits[1]) << PyLong_SHIFT) | (SNESConvergedReason)digits[0]))); } } break; case -4: if ((8 * sizeof(SNESConvergedReason) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SNESConvergedReason, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SNESConvergedReason) - 1 > 4 * PyLong_SHIFT)) { return (SNESConvergedReason) (((SNESConvergedReason)-1)*(((((((((SNESConvergedReason)digits[3]) << PyLong_SHIFT) | (SNESConvergedReason)digits[2]) << PyLong_SHIFT) | (SNESConvergedReason)digits[1]) << PyLong_SHIFT) | (SNESConvergedReason)digits[0]))); } } break; case 4: if ((8 * sizeof(SNESConvergedReason) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SNESConvergedReason, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SNESConvergedReason) - 1 > 4 * PyLong_SHIFT)) { return (SNESConvergedReason) ((((((((((SNESConvergedReason)digits[3]) << PyLong_SHIFT) | (SNESConvergedReason)digits[2]) << PyLong_SHIFT) | (SNESConvergedReason)digits[1]) << PyLong_SHIFT) | (SNESConvergedReason)digits[0]))); } } break; } } #endif if ((sizeof(SNESConvergedReason) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(SNESConvergedReason, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(SNESConvergedReason) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(SNESConvergedReason, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available, cannot convert large enums"); return (SNESConvergedReason) -1; } else { SNESConvergedReason val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (SNESConvergedReason) -1; val = __Pyx_PyInt_As_SNESConvergedReason(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to SNESConvergedReason"); return (SNESConvergedReason) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to SNESConvergedReason"); return (SNESConvergedReason) -1; } /* CIntFromPy */ static CYTHON_INLINE TaoConvergedReason __Pyx_PyInt_As_TaoConvergedReason(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const TaoConvergedReason neg_one = (TaoConvergedReason) -1, const_zero = (TaoConvergedReason) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(TaoConvergedReason) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(TaoConvergedReason, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (TaoConvergedReason) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(TaoConvergedReason, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(TaoConvergedReason) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(TaoConvergedReason, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(TaoConvergedReason) >= 2 * PyLong_SHIFT)) { return (TaoConvergedReason) (((((TaoConvergedReason)digits[1]) << PyLong_SHIFT) | (TaoConvergedReason)digits[0])); } } break; case 3: if ((8 * sizeof(TaoConvergedReason) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(TaoConvergedReason, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(TaoConvergedReason) >= 3 * PyLong_SHIFT)) { return (TaoConvergedReason) (((((((TaoConvergedReason)digits[2]) << PyLong_SHIFT) | (TaoConvergedReason)digits[1]) << PyLong_SHIFT) | (TaoConvergedReason)digits[0])); } } break; case 4: if ((8 * sizeof(TaoConvergedReason) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(TaoConvergedReason, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(TaoConvergedReason) >= 4 * PyLong_SHIFT)) { return (TaoConvergedReason) (((((((((TaoConvergedReason)digits[3]) << PyLong_SHIFT) | (TaoConvergedReason)digits[2]) << PyLong_SHIFT) | (TaoConvergedReason)digits[1]) << PyLong_SHIFT) | (TaoConvergedReason)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (TaoConvergedReason) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(TaoConvergedReason) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(TaoConvergedReason, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(TaoConvergedReason) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(TaoConvergedReason, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(TaoConvergedReason, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(TaoConvergedReason) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(TaoConvergedReason, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(TaoConvergedReason) - 1 > 2 * PyLong_SHIFT)) { return (TaoConvergedReason) (((TaoConvergedReason)-1)*(((((TaoConvergedReason)digits[1]) << PyLong_SHIFT) | (TaoConvergedReason)digits[0]))); } } break; case 2: if ((8 * sizeof(TaoConvergedReason) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(TaoConvergedReason, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(TaoConvergedReason) - 1 > 2 * PyLong_SHIFT)) { return (TaoConvergedReason) ((((((TaoConvergedReason)digits[1]) << PyLong_SHIFT) | (TaoConvergedReason)digits[0]))); } } break; case -3: if ((8 * sizeof(TaoConvergedReason) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(TaoConvergedReason, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(TaoConvergedReason) - 1 > 3 * PyLong_SHIFT)) { return (TaoConvergedReason) (((TaoConvergedReason)-1)*(((((((TaoConvergedReason)digits[2]) << PyLong_SHIFT) | (TaoConvergedReason)digits[1]) << PyLong_SHIFT) | (TaoConvergedReason)digits[0]))); } } break; case 3: if ((8 * sizeof(TaoConvergedReason) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(TaoConvergedReason, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(TaoConvergedReason) - 1 > 3 * PyLong_SHIFT)) { return (TaoConvergedReason) ((((((((TaoConvergedReason)digits[2]) << PyLong_SHIFT) | (TaoConvergedReason)digits[1]) << PyLong_SHIFT) | (TaoConvergedReason)digits[0]))); } } break; case -4: if ((8 * sizeof(TaoConvergedReason) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(TaoConvergedReason, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(TaoConvergedReason) - 1 > 4 * PyLong_SHIFT)) { return (TaoConvergedReason) (((TaoConvergedReason)-1)*(((((((((TaoConvergedReason)digits[3]) << PyLong_SHIFT) | (TaoConvergedReason)digits[2]) << PyLong_SHIFT) | (TaoConvergedReason)digits[1]) << PyLong_SHIFT) | (TaoConvergedReason)digits[0]))); } } break; case 4: if ((8 * sizeof(TaoConvergedReason) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(TaoConvergedReason, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(TaoConvergedReason) - 1 > 4 * PyLong_SHIFT)) { return (TaoConvergedReason) ((((((((((TaoConvergedReason)digits[3]) << PyLong_SHIFT) | (TaoConvergedReason)digits[2]) << PyLong_SHIFT) | (TaoConvergedReason)digits[1]) << PyLong_SHIFT) | (TaoConvergedReason)digits[0]))); } } break; } } #endif if ((sizeof(TaoConvergedReason) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(TaoConvergedReason, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(TaoConvergedReason) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(TaoConvergedReason, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available, cannot convert large enums"); return (TaoConvergedReason) -1; } else { TaoConvergedReason val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (TaoConvergedReason) -1; val = __Pyx_PyInt_As_TaoConvergedReason(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to TaoConvergedReason"); return (TaoConvergedReason) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to TaoConvergedReason"); return (TaoConvergedReason) -1; } /* CIntFromPy */ static CYTHON_INLINE DMBoundaryType __Pyx_PyInt_As_DMBoundaryType(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const DMBoundaryType neg_one = (DMBoundaryType) -1, const_zero = (DMBoundaryType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(DMBoundaryType) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(DMBoundaryType, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (DMBoundaryType) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(DMBoundaryType, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(DMBoundaryType) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMBoundaryType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMBoundaryType) >= 2 * PyLong_SHIFT)) { return (DMBoundaryType) (((((DMBoundaryType)digits[1]) << PyLong_SHIFT) | (DMBoundaryType)digits[0])); } } break; case 3: if ((8 * sizeof(DMBoundaryType) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMBoundaryType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMBoundaryType) >= 3 * PyLong_SHIFT)) { return (DMBoundaryType) (((((((DMBoundaryType)digits[2]) << PyLong_SHIFT) | (DMBoundaryType)digits[1]) << PyLong_SHIFT) | (DMBoundaryType)digits[0])); } } break; case 4: if ((8 * sizeof(DMBoundaryType) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMBoundaryType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMBoundaryType) >= 4 * PyLong_SHIFT)) { return (DMBoundaryType) (((((((((DMBoundaryType)digits[3]) << PyLong_SHIFT) | (DMBoundaryType)digits[2]) << PyLong_SHIFT) | (DMBoundaryType)digits[1]) << PyLong_SHIFT) | (DMBoundaryType)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (DMBoundaryType) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(DMBoundaryType) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(DMBoundaryType, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(DMBoundaryType) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(DMBoundaryType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(DMBoundaryType, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(DMBoundaryType) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMBoundaryType, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMBoundaryType) - 1 > 2 * PyLong_SHIFT)) { return (DMBoundaryType) (((DMBoundaryType)-1)*(((((DMBoundaryType)digits[1]) << PyLong_SHIFT) | (DMBoundaryType)digits[0]))); } } break; case 2: if ((8 * sizeof(DMBoundaryType) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMBoundaryType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMBoundaryType) - 1 > 2 * PyLong_SHIFT)) { return (DMBoundaryType) ((((((DMBoundaryType)digits[1]) << PyLong_SHIFT) | (DMBoundaryType)digits[0]))); } } break; case -3: if ((8 * sizeof(DMBoundaryType) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMBoundaryType, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMBoundaryType) - 1 > 3 * PyLong_SHIFT)) { return (DMBoundaryType) (((DMBoundaryType)-1)*(((((((DMBoundaryType)digits[2]) << PyLong_SHIFT) | (DMBoundaryType)digits[1]) << PyLong_SHIFT) | (DMBoundaryType)digits[0]))); } } break; case 3: if ((8 * sizeof(DMBoundaryType) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMBoundaryType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMBoundaryType) - 1 > 3 * PyLong_SHIFT)) { return (DMBoundaryType) ((((((((DMBoundaryType)digits[2]) << PyLong_SHIFT) | (DMBoundaryType)digits[1]) << PyLong_SHIFT) | (DMBoundaryType)digits[0]))); } } break; case -4: if ((8 * sizeof(DMBoundaryType) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMBoundaryType, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMBoundaryType) - 1 > 4 * PyLong_SHIFT)) { return (DMBoundaryType) (((DMBoundaryType)-1)*(((((((((DMBoundaryType)digits[3]) << PyLong_SHIFT) | (DMBoundaryType)digits[2]) << PyLong_SHIFT) | (DMBoundaryType)digits[1]) << PyLong_SHIFT) | (DMBoundaryType)digits[0]))); } } break; case 4: if ((8 * sizeof(DMBoundaryType) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMBoundaryType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMBoundaryType) - 1 > 4 * PyLong_SHIFT)) { return (DMBoundaryType) ((((((((((DMBoundaryType)digits[3]) << PyLong_SHIFT) | (DMBoundaryType)digits[2]) << PyLong_SHIFT) | (DMBoundaryType)digits[1]) << PyLong_SHIFT) | (DMBoundaryType)digits[0]))); } } break; } } #endif if ((sizeof(DMBoundaryType) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(DMBoundaryType, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(DMBoundaryType) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(DMBoundaryType, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available, cannot convert large enums"); return (DMBoundaryType) -1; } else { DMBoundaryType val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (DMBoundaryType) -1; val = __Pyx_PyInt_As_DMBoundaryType(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to DMBoundaryType"); return (DMBoundaryType) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to DMBoundaryType"); return (DMBoundaryType) -1; } /* CIntFromPy */ static CYTHON_INLINE DMDAStencilType __Pyx_PyInt_As_DMDAStencilType(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const DMDAStencilType neg_one = (DMDAStencilType) -1, const_zero = (DMDAStencilType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(DMDAStencilType) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(DMDAStencilType, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (DMDAStencilType) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(DMDAStencilType, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(DMDAStencilType) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMDAStencilType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMDAStencilType) >= 2 * PyLong_SHIFT)) { return (DMDAStencilType) (((((DMDAStencilType)digits[1]) << PyLong_SHIFT) | (DMDAStencilType)digits[0])); } } break; case 3: if ((8 * sizeof(DMDAStencilType) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMDAStencilType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMDAStencilType) >= 3 * PyLong_SHIFT)) { return (DMDAStencilType) (((((((DMDAStencilType)digits[2]) << PyLong_SHIFT) | (DMDAStencilType)digits[1]) << PyLong_SHIFT) | (DMDAStencilType)digits[0])); } } break; case 4: if ((8 * sizeof(DMDAStencilType) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMDAStencilType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMDAStencilType) >= 4 * PyLong_SHIFT)) { return (DMDAStencilType) (((((((((DMDAStencilType)digits[3]) << PyLong_SHIFT) | (DMDAStencilType)digits[2]) << PyLong_SHIFT) | (DMDAStencilType)digits[1]) << PyLong_SHIFT) | (DMDAStencilType)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (DMDAStencilType) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(DMDAStencilType) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(DMDAStencilType, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(DMDAStencilType) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(DMDAStencilType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(DMDAStencilType, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(DMDAStencilType) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMDAStencilType, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMDAStencilType) - 1 > 2 * PyLong_SHIFT)) { return (DMDAStencilType) (((DMDAStencilType)-1)*(((((DMDAStencilType)digits[1]) << PyLong_SHIFT) | (DMDAStencilType)digits[0]))); } } break; case 2: if ((8 * sizeof(DMDAStencilType) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMDAStencilType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMDAStencilType) - 1 > 2 * PyLong_SHIFT)) { return (DMDAStencilType) ((((((DMDAStencilType)digits[1]) << PyLong_SHIFT) | (DMDAStencilType)digits[0]))); } } break; case -3: if ((8 * sizeof(DMDAStencilType) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMDAStencilType, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMDAStencilType) - 1 > 3 * PyLong_SHIFT)) { return (DMDAStencilType) (((DMDAStencilType)-1)*(((((((DMDAStencilType)digits[2]) << PyLong_SHIFT) | (DMDAStencilType)digits[1]) << PyLong_SHIFT) | (DMDAStencilType)digits[0]))); } } break; case 3: if ((8 * sizeof(DMDAStencilType) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMDAStencilType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMDAStencilType) - 1 > 3 * PyLong_SHIFT)) { return (DMDAStencilType) ((((((((DMDAStencilType)digits[2]) << PyLong_SHIFT) | (DMDAStencilType)digits[1]) << PyLong_SHIFT) | (DMDAStencilType)digits[0]))); } } break; case -4: if ((8 * sizeof(DMDAStencilType) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMDAStencilType, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMDAStencilType) - 1 > 4 * PyLong_SHIFT)) { return (DMDAStencilType) (((DMDAStencilType)-1)*(((((((((DMDAStencilType)digits[3]) << PyLong_SHIFT) | (DMDAStencilType)digits[2]) << PyLong_SHIFT) | (DMDAStencilType)digits[1]) << PyLong_SHIFT) | (DMDAStencilType)digits[0]))); } } break; case 4: if ((8 * sizeof(DMDAStencilType) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMDAStencilType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMDAStencilType) - 1 > 4 * PyLong_SHIFT)) { return (DMDAStencilType) ((((((((((DMDAStencilType)digits[3]) << PyLong_SHIFT) | (DMDAStencilType)digits[2]) << PyLong_SHIFT) | (DMDAStencilType)digits[1]) << PyLong_SHIFT) | (DMDAStencilType)digits[0]))); } } break; } } #endif if ((sizeof(DMDAStencilType) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(DMDAStencilType, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(DMDAStencilType) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(DMDAStencilType, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available, cannot convert large enums"); return (DMDAStencilType) -1; } else { DMDAStencilType val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (DMDAStencilType) -1; val = __Pyx_PyInt_As_DMDAStencilType(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to DMDAStencilType"); return (DMDAStencilType) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to DMDAStencilType"); return (DMDAStencilType) -1; } /* CIntFromPy */ static CYTHON_INLINE DMDAInterpolationType __Pyx_PyInt_As_DMDAInterpolationType(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const DMDAInterpolationType neg_one = (DMDAInterpolationType) -1, const_zero = (DMDAInterpolationType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(DMDAInterpolationType) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(DMDAInterpolationType, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (DMDAInterpolationType) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(DMDAInterpolationType, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(DMDAInterpolationType) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMDAInterpolationType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMDAInterpolationType) >= 2 * PyLong_SHIFT)) { return (DMDAInterpolationType) (((((DMDAInterpolationType)digits[1]) << PyLong_SHIFT) | (DMDAInterpolationType)digits[0])); } } break; case 3: if ((8 * sizeof(DMDAInterpolationType) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMDAInterpolationType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMDAInterpolationType) >= 3 * PyLong_SHIFT)) { return (DMDAInterpolationType) (((((((DMDAInterpolationType)digits[2]) << PyLong_SHIFT) | (DMDAInterpolationType)digits[1]) << PyLong_SHIFT) | (DMDAInterpolationType)digits[0])); } } break; case 4: if ((8 * sizeof(DMDAInterpolationType) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMDAInterpolationType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMDAInterpolationType) >= 4 * PyLong_SHIFT)) { return (DMDAInterpolationType) (((((((((DMDAInterpolationType)digits[3]) << PyLong_SHIFT) | (DMDAInterpolationType)digits[2]) << PyLong_SHIFT) | (DMDAInterpolationType)digits[1]) << PyLong_SHIFT) | (DMDAInterpolationType)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (DMDAInterpolationType) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(DMDAInterpolationType) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(DMDAInterpolationType, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(DMDAInterpolationType) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(DMDAInterpolationType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(DMDAInterpolationType, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(DMDAInterpolationType) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMDAInterpolationType, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMDAInterpolationType) - 1 > 2 * PyLong_SHIFT)) { return (DMDAInterpolationType) (((DMDAInterpolationType)-1)*(((((DMDAInterpolationType)digits[1]) << PyLong_SHIFT) | (DMDAInterpolationType)digits[0]))); } } break; case 2: if ((8 * sizeof(DMDAInterpolationType) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMDAInterpolationType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMDAInterpolationType) - 1 > 2 * PyLong_SHIFT)) { return (DMDAInterpolationType) ((((((DMDAInterpolationType)digits[1]) << PyLong_SHIFT) | (DMDAInterpolationType)digits[0]))); } } break; case -3: if ((8 * sizeof(DMDAInterpolationType) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMDAInterpolationType, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMDAInterpolationType) - 1 > 3 * PyLong_SHIFT)) { return (DMDAInterpolationType) (((DMDAInterpolationType)-1)*(((((((DMDAInterpolationType)digits[2]) << PyLong_SHIFT) | (DMDAInterpolationType)digits[1]) << PyLong_SHIFT) | (DMDAInterpolationType)digits[0]))); } } break; case 3: if ((8 * sizeof(DMDAInterpolationType) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMDAInterpolationType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMDAInterpolationType) - 1 > 3 * PyLong_SHIFT)) { return (DMDAInterpolationType) ((((((((DMDAInterpolationType)digits[2]) << PyLong_SHIFT) | (DMDAInterpolationType)digits[1]) << PyLong_SHIFT) | (DMDAInterpolationType)digits[0]))); } } break; case -4: if ((8 * sizeof(DMDAInterpolationType) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMDAInterpolationType, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMDAInterpolationType) - 1 > 4 * PyLong_SHIFT)) { return (DMDAInterpolationType) (((DMDAInterpolationType)-1)*(((((((((DMDAInterpolationType)digits[3]) << PyLong_SHIFT) | (DMDAInterpolationType)digits[2]) << PyLong_SHIFT) | (DMDAInterpolationType)digits[1]) << PyLong_SHIFT) | (DMDAInterpolationType)digits[0]))); } } break; case 4: if ((8 * sizeof(DMDAInterpolationType) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMDAInterpolationType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMDAInterpolationType) - 1 > 4 * PyLong_SHIFT)) { return (DMDAInterpolationType) ((((((((((DMDAInterpolationType)digits[3]) << PyLong_SHIFT) | (DMDAInterpolationType)digits[2]) << PyLong_SHIFT) | (DMDAInterpolationType)digits[1]) << PyLong_SHIFT) | (DMDAInterpolationType)digits[0]))); } } break; } } #endif if ((sizeof(DMDAInterpolationType) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(DMDAInterpolationType, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(DMDAInterpolationType) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(DMDAInterpolationType, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available, cannot convert large enums"); return (DMDAInterpolationType) -1; } else { DMDAInterpolationType val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (DMDAInterpolationType) -1; val = __Pyx_PyInt_As_DMDAInterpolationType(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to DMDAInterpolationType"); return (DMDAInterpolationType) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to DMDAInterpolationType"); return (DMDAInterpolationType) -1; } /* CIntFromPy */ static CYTHON_INLINE DMDAElementType __Pyx_PyInt_As_DMDAElementType(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const DMDAElementType neg_one = (DMDAElementType) -1, const_zero = (DMDAElementType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(DMDAElementType) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(DMDAElementType, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (DMDAElementType) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(DMDAElementType, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(DMDAElementType) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMDAElementType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMDAElementType) >= 2 * PyLong_SHIFT)) { return (DMDAElementType) (((((DMDAElementType)digits[1]) << PyLong_SHIFT) | (DMDAElementType)digits[0])); } } break; case 3: if ((8 * sizeof(DMDAElementType) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMDAElementType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMDAElementType) >= 3 * PyLong_SHIFT)) { return (DMDAElementType) (((((((DMDAElementType)digits[2]) << PyLong_SHIFT) | (DMDAElementType)digits[1]) << PyLong_SHIFT) | (DMDAElementType)digits[0])); } } break; case 4: if ((8 * sizeof(DMDAElementType) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMDAElementType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMDAElementType) >= 4 * PyLong_SHIFT)) { return (DMDAElementType) (((((((((DMDAElementType)digits[3]) << PyLong_SHIFT) | (DMDAElementType)digits[2]) << PyLong_SHIFT) | (DMDAElementType)digits[1]) << PyLong_SHIFT) | (DMDAElementType)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (DMDAElementType) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(DMDAElementType) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(DMDAElementType, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(DMDAElementType) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(DMDAElementType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(DMDAElementType, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(DMDAElementType) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMDAElementType, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMDAElementType) - 1 > 2 * PyLong_SHIFT)) { return (DMDAElementType) (((DMDAElementType)-1)*(((((DMDAElementType)digits[1]) << PyLong_SHIFT) | (DMDAElementType)digits[0]))); } } break; case 2: if ((8 * sizeof(DMDAElementType) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMDAElementType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMDAElementType) - 1 > 2 * PyLong_SHIFT)) { return (DMDAElementType) ((((((DMDAElementType)digits[1]) << PyLong_SHIFT) | (DMDAElementType)digits[0]))); } } break; case -3: if ((8 * sizeof(DMDAElementType) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMDAElementType, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMDAElementType) - 1 > 3 * PyLong_SHIFT)) { return (DMDAElementType) (((DMDAElementType)-1)*(((((((DMDAElementType)digits[2]) << PyLong_SHIFT) | (DMDAElementType)digits[1]) << PyLong_SHIFT) | (DMDAElementType)digits[0]))); } } break; case 3: if ((8 * sizeof(DMDAElementType) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMDAElementType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMDAElementType) - 1 > 3 * PyLong_SHIFT)) { return (DMDAElementType) ((((((((DMDAElementType)digits[2]) << PyLong_SHIFT) | (DMDAElementType)digits[1]) << PyLong_SHIFT) | (DMDAElementType)digits[0]))); } } break; case -4: if ((8 * sizeof(DMDAElementType) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMDAElementType, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMDAElementType) - 1 > 4 * PyLong_SHIFT)) { return (DMDAElementType) (((DMDAElementType)-1)*(((((((((DMDAElementType)digits[3]) << PyLong_SHIFT) | (DMDAElementType)digits[2]) << PyLong_SHIFT) | (DMDAElementType)digits[1]) << PyLong_SHIFT) | (DMDAElementType)digits[0]))); } } break; case 4: if ((8 * sizeof(DMDAElementType) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMDAElementType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMDAElementType) - 1 > 4 * PyLong_SHIFT)) { return (DMDAElementType) ((((((((((DMDAElementType)digits[3]) << PyLong_SHIFT) | (DMDAElementType)digits[2]) << PyLong_SHIFT) | (DMDAElementType)digits[1]) << PyLong_SHIFT) | (DMDAElementType)digits[0]))); } } break; } } #endif if ((sizeof(DMDAElementType) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(DMDAElementType, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(DMDAElementType) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(DMDAElementType, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available, cannot convert large enums"); return (DMDAElementType) -1; } else { DMDAElementType val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (DMDAElementType) -1; val = __Pyx_PyInt_As_DMDAElementType(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to DMDAElementType"); return (DMDAElementType) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to DMDAElementType"); return (DMDAElementType) -1; } /* CIntFromPy */ static CYTHON_INLINE DMStagStencilType __Pyx_PyInt_As_DMStagStencilType(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const DMStagStencilType neg_one = (DMStagStencilType) -1, const_zero = (DMStagStencilType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(DMStagStencilType) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(DMStagStencilType, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (DMStagStencilType) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(DMStagStencilType, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(DMStagStencilType) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMStagStencilType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMStagStencilType) >= 2 * PyLong_SHIFT)) { return (DMStagStencilType) (((((DMStagStencilType)digits[1]) << PyLong_SHIFT) | (DMStagStencilType)digits[0])); } } break; case 3: if ((8 * sizeof(DMStagStencilType) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMStagStencilType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMStagStencilType) >= 3 * PyLong_SHIFT)) { return (DMStagStencilType) (((((((DMStagStencilType)digits[2]) << PyLong_SHIFT) | (DMStagStencilType)digits[1]) << PyLong_SHIFT) | (DMStagStencilType)digits[0])); } } break; case 4: if ((8 * sizeof(DMStagStencilType) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMStagStencilType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMStagStencilType) >= 4 * PyLong_SHIFT)) { return (DMStagStencilType) (((((((((DMStagStencilType)digits[3]) << PyLong_SHIFT) | (DMStagStencilType)digits[2]) << PyLong_SHIFT) | (DMStagStencilType)digits[1]) << PyLong_SHIFT) | (DMStagStencilType)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (DMStagStencilType) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(DMStagStencilType) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(DMStagStencilType, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(DMStagStencilType) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(DMStagStencilType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(DMStagStencilType, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(DMStagStencilType) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMStagStencilType, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMStagStencilType) - 1 > 2 * PyLong_SHIFT)) { return (DMStagStencilType) (((DMStagStencilType)-1)*(((((DMStagStencilType)digits[1]) << PyLong_SHIFT) | (DMStagStencilType)digits[0]))); } } break; case 2: if ((8 * sizeof(DMStagStencilType) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMStagStencilType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMStagStencilType) - 1 > 2 * PyLong_SHIFT)) { return (DMStagStencilType) ((((((DMStagStencilType)digits[1]) << PyLong_SHIFT) | (DMStagStencilType)digits[0]))); } } break; case -3: if ((8 * sizeof(DMStagStencilType) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMStagStencilType, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMStagStencilType) - 1 > 3 * PyLong_SHIFT)) { return (DMStagStencilType) (((DMStagStencilType)-1)*(((((((DMStagStencilType)digits[2]) << PyLong_SHIFT) | (DMStagStencilType)digits[1]) << PyLong_SHIFT) | (DMStagStencilType)digits[0]))); } } break; case 3: if ((8 * sizeof(DMStagStencilType) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMStagStencilType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMStagStencilType) - 1 > 3 * PyLong_SHIFT)) { return (DMStagStencilType) ((((((((DMStagStencilType)digits[2]) << PyLong_SHIFT) | (DMStagStencilType)digits[1]) << PyLong_SHIFT) | (DMStagStencilType)digits[0]))); } } break; case -4: if ((8 * sizeof(DMStagStencilType) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMStagStencilType, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMStagStencilType) - 1 > 4 * PyLong_SHIFT)) { return (DMStagStencilType) (((DMStagStencilType)-1)*(((((((((DMStagStencilType)digits[3]) << PyLong_SHIFT) | (DMStagStencilType)digits[2]) << PyLong_SHIFT) | (DMStagStencilType)digits[1]) << PyLong_SHIFT) | (DMStagStencilType)digits[0]))); } } break; case 4: if ((8 * sizeof(DMStagStencilType) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMStagStencilType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMStagStencilType) - 1 > 4 * PyLong_SHIFT)) { return (DMStagStencilType) ((((((((((DMStagStencilType)digits[3]) << PyLong_SHIFT) | (DMStagStencilType)digits[2]) << PyLong_SHIFT) | (DMStagStencilType)digits[1]) << PyLong_SHIFT) | (DMStagStencilType)digits[0]))); } } break; } } #endif if ((sizeof(DMStagStencilType) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(DMStagStencilType, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(DMStagStencilType) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(DMStagStencilType, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available, cannot convert large enums"); return (DMStagStencilType) -1; } else { DMStagStencilType val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (DMStagStencilType) -1; val = __Pyx_PyInt_As_DMStagStencilType(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to DMStagStencilType"); return (DMStagStencilType) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to DMStagStencilType"); return (DMStagStencilType) -1; } /* CIntFromPy */ static CYTHON_INLINE DMStagStencilLocation __Pyx_PyInt_As_DMStagStencilLocation(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const DMStagStencilLocation neg_one = (DMStagStencilLocation) -1, const_zero = (DMStagStencilLocation) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(DMStagStencilLocation) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(DMStagStencilLocation, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (DMStagStencilLocation) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(DMStagStencilLocation, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(DMStagStencilLocation) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMStagStencilLocation, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMStagStencilLocation) >= 2 * PyLong_SHIFT)) { return (DMStagStencilLocation) (((((DMStagStencilLocation)digits[1]) << PyLong_SHIFT) | (DMStagStencilLocation)digits[0])); } } break; case 3: if ((8 * sizeof(DMStagStencilLocation) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMStagStencilLocation, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMStagStencilLocation) >= 3 * PyLong_SHIFT)) { return (DMStagStencilLocation) (((((((DMStagStencilLocation)digits[2]) << PyLong_SHIFT) | (DMStagStencilLocation)digits[1]) << PyLong_SHIFT) | (DMStagStencilLocation)digits[0])); } } break; case 4: if ((8 * sizeof(DMStagStencilLocation) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMStagStencilLocation, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMStagStencilLocation) >= 4 * PyLong_SHIFT)) { return (DMStagStencilLocation) (((((((((DMStagStencilLocation)digits[3]) << PyLong_SHIFT) | (DMStagStencilLocation)digits[2]) << PyLong_SHIFT) | (DMStagStencilLocation)digits[1]) << PyLong_SHIFT) | (DMStagStencilLocation)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (DMStagStencilLocation) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(DMStagStencilLocation) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(DMStagStencilLocation, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(DMStagStencilLocation) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(DMStagStencilLocation, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(DMStagStencilLocation, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(DMStagStencilLocation) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMStagStencilLocation, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMStagStencilLocation) - 1 > 2 * PyLong_SHIFT)) { return (DMStagStencilLocation) (((DMStagStencilLocation)-1)*(((((DMStagStencilLocation)digits[1]) << PyLong_SHIFT) | (DMStagStencilLocation)digits[0]))); } } break; case 2: if ((8 * sizeof(DMStagStencilLocation) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMStagStencilLocation, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMStagStencilLocation) - 1 > 2 * PyLong_SHIFT)) { return (DMStagStencilLocation) ((((((DMStagStencilLocation)digits[1]) << PyLong_SHIFT) | (DMStagStencilLocation)digits[0]))); } } break; case -3: if ((8 * sizeof(DMStagStencilLocation) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMStagStencilLocation, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMStagStencilLocation) - 1 > 3 * PyLong_SHIFT)) { return (DMStagStencilLocation) (((DMStagStencilLocation)-1)*(((((((DMStagStencilLocation)digits[2]) << PyLong_SHIFT) | (DMStagStencilLocation)digits[1]) << PyLong_SHIFT) | (DMStagStencilLocation)digits[0]))); } } break; case 3: if ((8 * sizeof(DMStagStencilLocation) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMStagStencilLocation, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMStagStencilLocation) - 1 > 3 * PyLong_SHIFT)) { return (DMStagStencilLocation) ((((((((DMStagStencilLocation)digits[2]) << PyLong_SHIFT) | (DMStagStencilLocation)digits[1]) << PyLong_SHIFT) | (DMStagStencilLocation)digits[0]))); } } break; case -4: if ((8 * sizeof(DMStagStencilLocation) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMStagStencilLocation, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMStagStencilLocation) - 1 > 4 * PyLong_SHIFT)) { return (DMStagStencilLocation) (((DMStagStencilLocation)-1)*(((((((((DMStagStencilLocation)digits[3]) << PyLong_SHIFT) | (DMStagStencilLocation)digits[2]) << PyLong_SHIFT) | (DMStagStencilLocation)digits[1]) << PyLong_SHIFT) | (DMStagStencilLocation)digits[0]))); } } break; case 4: if ((8 * sizeof(DMStagStencilLocation) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMStagStencilLocation, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMStagStencilLocation) - 1 > 4 * PyLong_SHIFT)) { return (DMStagStencilLocation) ((((((((((DMStagStencilLocation)digits[3]) << PyLong_SHIFT) | (DMStagStencilLocation)digits[2]) << PyLong_SHIFT) | (DMStagStencilLocation)digits[1]) << PyLong_SHIFT) | (DMStagStencilLocation)digits[0]))); } } break; } } #endif if ((sizeof(DMStagStencilLocation) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(DMStagStencilLocation, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(DMStagStencilLocation) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(DMStagStencilLocation, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available, cannot convert large enums"); return (DMStagStencilLocation) -1; } else { DMStagStencilLocation val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (DMStagStencilLocation) -1; val = __Pyx_PyInt_As_DMStagStencilLocation(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to DMStagStencilLocation"); return (DMStagStencilLocation) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to DMStagStencilLocation"); return (DMStagStencilLocation) -1; } /* CIntFromPy */ static CYTHON_INLINE PetscClassId __Pyx_PyInt_As_PetscClassId(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PetscClassId neg_one = (PetscClassId) -1, const_zero = (PetscClassId) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(PetscClassId) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(PetscClassId, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (PetscClassId) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(PetscClassId, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(PetscClassId) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscClassId, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscClassId) >= 2 * PyLong_SHIFT)) { return (PetscClassId) (((((PetscClassId)digits[1]) << PyLong_SHIFT) | (PetscClassId)digits[0])); } } break; case 3: if ((8 * sizeof(PetscClassId) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscClassId, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscClassId) >= 3 * PyLong_SHIFT)) { return (PetscClassId) (((((((PetscClassId)digits[2]) << PyLong_SHIFT) | (PetscClassId)digits[1]) << PyLong_SHIFT) | (PetscClassId)digits[0])); } } break; case 4: if ((8 * sizeof(PetscClassId) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscClassId, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscClassId) >= 4 * PyLong_SHIFT)) { return (PetscClassId) (((((((((PetscClassId)digits[3]) << PyLong_SHIFT) | (PetscClassId)digits[2]) << PyLong_SHIFT) | (PetscClassId)digits[1]) << PyLong_SHIFT) | (PetscClassId)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (PetscClassId) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(PetscClassId) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(PetscClassId, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(PetscClassId) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(PetscClassId, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(PetscClassId, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(PetscClassId) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscClassId, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscClassId) - 1 > 2 * PyLong_SHIFT)) { return (PetscClassId) (((PetscClassId)-1)*(((((PetscClassId)digits[1]) << PyLong_SHIFT) | (PetscClassId)digits[0]))); } } break; case 2: if ((8 * sizeof(PetscClassId) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscClassId, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscClassId) - 1 > 2 * PyLong_SHIFT)) { return (PetscClassId) ((((((PetscClassId)digits[1]) << PyLong_SHIFT) | (PetscClassId)digits[0]))); } } break; case -3: if ((8 * sizeof(PetscClassId) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscClassId, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscClassId) - 1 > 3 * PyLong_SHIFT)) { return (PetscClassId) (((PetscClassId)-1)*(((((((PetscClassId)digits[2]) << PyLong_SHIFT) | (PetscClassId)digits[1]) << PyLong_SHIFT) | (PetscClassId)digits[0]))); } } break; case 3: if ((8 * sizeof(PetscClassId) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscClassId, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscClassId) - 1 > 3 * PyLong_SHIFT)) { return (PetscClassId) ((((((((PetscClassId)digits[2]) << PyLong_SHIFT) | (PetscClassId)digits[1]) << PyLong_SHIFT) | (PetscClassId)digits[0]))); } } break; case -4: if ((8 * sizeof(PetscClassId) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscClassId, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscClassId) - 1 > 4 * PyLong_SHIFT)) { return (PetscClassId) (((PetscClassId)-1)*(((((((((PetscClassId)digits[3]) << PyLong_SHIFT) | (PetscClassId)digits[2]) << PyLong_SHIFT) | (PetscClassId)digits[1]) << PyLong_SHIFT) | (PetscClassId)digits[0]))); } } break; case 4: if ((8 * sizeof(PetscClassId) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscClassId, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscClassId) - 1 > 4 * PyLong_SHIFT)) { return (PetscClassId) ((((((((((PetscClassId)digits[3]) << PyLong_SHIFT) | (PetscClassId)digits[2]) << PyLong_SHIFT) | (PetscClassId)digits[1]) << PyLong_SHIFT) | (PetscClassId)digits[0]))); } } break; } } #endif if ((sizeof(PetscClassId) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(PetscClassId, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(PetscClassId) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(PetscClassId, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { PetscClassId val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (PetscClassId) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (PetscClassId) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (PetscClassId) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (PetscClassId) -1; } else { stepval = __Pyx_NewRef(v); } val = (PetscClassId) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(PetscClassId) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((PetscClassId) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(PetscClassId) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((PetscClassId) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((PetscClassId) 1) << (sizeof(PetscClassId) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (PetscClassId) -1; } } else { PetscClassId val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (PetscClassId) -1; val = __Pyx_PyInt_As_PetscClassId(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to PetscClassId"); return (PetscClassId) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to PetscClassId"); return (PetscClassId) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PetscLogStage(PetscLogStage value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PetscLogStage neg_one = (PetscLogStage) -1, const_zero = (PetscLogStage) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(PetscLogStage) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(PetscLogStage) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PetscLogStage) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(PetscLogStage) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PetscLogStage) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(PetscLogStage), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(PetscLogStage)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PetscClassId(PetscClassId value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PetscClassId neg_one = (PetscClassId) -1, const_zero = (PetscClassId) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(PetscClassId) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(PetscClassId) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PetscClassId) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(PetscClassId) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PetscClassId) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(PetscClassId), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(PetscClassId)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PetscLogEvent(PetscLogEvent value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PetscLogEvent neg_one = (PetscLogEvent) -1, const_zero = (PetscLogEvent) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(PetscLogEvent) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(PetscLogEvent) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PetscLogEvent) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(PetscLogEvent) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PetscLogEvent) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(PetscLogEvent), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(PetscLogEvent)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_MPI_Fint(MPI_Fint value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const MPI_Fint neg_one = (MPI_Fint) -1, const_zero = (MPI_Fint) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(MPI_Fint) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(MPI_Fint) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(MPI_Fint) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(MPI_Fint) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(MPI_Fint) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(MPI_Fint), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(MPI_Fint)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE PetscViewerFormat __Pyx_PyInt_As_PetscViewerFormat(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PetscViewerFormat neg_one = (PetscViewerFormat) -1, const_zero = (PetscViewerFormat) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(PetscViewerFormat) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(PetscViewerFormat, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (PetscViewerFormat) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(PetscViewerFormat, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(PetscViewerFormat) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscViewerFormat, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscViewerFormat) >= 2 * PyLong_SHIFT)) { return (PetscViewerFormat) (((((PetscViewerFormat)digits[1]) << PyLong_SHIFT) | (PetscViewerFormat)digits[0])); } } break; case 3: if ((8 * sizeof(PetscViewerFormat) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscViewerFormat, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscViewerFormat) >= 3 * PyLong_SHIFT)) { return (PetscViewerFormat) (((((((PetscViewerFormat)digits[2]) << PyLong_SHIFT) | (PetscViewerFormat)digits[1]) << PyLong_SHIFT) | (PetscViewerFormat)digits[0])); } } break; case 4: if ((8 * sizeof(PetscViewerFormat) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscViewerFormat, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscViewerFormat) >= 4 * PyLong_SHIFT)) { return (PetscViewerFormat) (((((((((PetscViewerFormat)digits[3]) << PyLong_SHIFT) | (PetscViewerFormat)digits[2]) << PyLong_SHIFT) | (PetscViewerFormat)digits[1]) << PyLong_SHIFT) | (PetscViewerFormat)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (PetscViewerFormat) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(PetscViewerFormat) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(PetscViewerFormat, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(PetscViewerFormat) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(PetscViewerFormat, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(PetscViewerFormat, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(PetscViewerFormat) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscViewerFormat, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscViewerFormat) - 1 > 2 * PyLong_SHIFT)) { return (PetscViewerFormat) (((PetscViewerFormat)-1)*(((((PetscViewerFormat)digits[1]) << PyLong_SHIFT) | (PetscViewerFormat)digits[0]))); } } break; case 2: if ((8 * sizeof(PetscViewerFormat) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscViewerFormat, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscViewerFormat) - 1 > 2 * PyLong_SHIFT)) { return (PetscViewerFormat) ((((((PetscViewerFormat)digits[1]) << PyLong_SHIFT) | (PetscViewerFormat)digits[0]))); } } break; case -3: if ((8 * sizeof(PetscViewerFormat) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscViewerFormat, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscViewerFormat) - 1 > 3 * PyLong_SHIFT)) { return (PetscViewerFormat) (((PetscViewerFormat)-1)*(((((((PetscViewerFormat)digits[2]) << PyLong_SHIFT) | (PetscViewerFormat)digits[1]) << PyLong_SHIFT) | (PetscViewerFormat)digits[0]))); } } break; case 3: if ((8 * sizeof(PetscViewerFormat) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscViewerFormat, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscViewerFormat) - 1 > 3 * PyLong_SHIFT)) { return (PetscViewerFormat) ((((((((PetscViewerFormat)digits[2]) << PyLong_SHIFT) | (PetscViewerFormat)digits[1]) << PyLong_SHIFT) | (PetscViewerFormat)digits[0]))); } } break; case -4: if ((8 * sizeof(PetscViewerFormat) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscViewerFormat, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscViewerFormat) - 1 > 4 * PyLong_SHIFT)) { return (PetscViewerFormat) (((PetscViewerFormat)-1)*(((((((((PetscViewerFormat)digits[3]) << PyLong_SHIFT) | (PetscViewerFormat)digits[2]) << PyLong_SHIFT) | (PetscViewerFormat)digits[1]) << PyLong_SHIFT) | (PetscViewerFormat)digits[0]))); } } break; case 4: if ((8 * sizeof(PetscViewerFormat) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscViewerFormat, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscViewerFormat) - 1 > 4 * PyLong_SHIFT)) { return (PetscViewerFormat) ((((((((((PetscViewerFormat)digits[3]) << PyLong_SHIFT) | (PetscViewerFormat)digits[2]) << PyLong_SHIFT) | (PetscViewerFormat)digits[1]) << PyLong_SHIFT) | (PetscViewerFormat)digits[0]))); } } break; } } #endif if ((sizeof(PetscViewerFormat) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(PetscViewerFormat, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(PetscViewerFormat) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(PetscViewerFormat, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available, cannot convert large enums"); return (PetscViewerFormat) -1; } else { PetscViewerFormat val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (PetscViewerFormat) -1; val = __Pyx_PyInt_As_PetscViewerFormat(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to PetscViewerFormat"); return (PetscViewerFormat) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to PetscViewerFormat"); return (PetscViewerFormat) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_long(unsigned long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const unsigned long neg_one = (unsigned long) -1, const_zero = (unsigned long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(unsigned long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(unsigned long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(unsigned long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(unsigned long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(unsigned long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(unsigned long), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(unsigned long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE unsigned long __Pyx_PyInt_As_unsigned_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const unsigned long neg_one = (unsigned long) -1, const_zero = (unsigned long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(unsigned long) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(unsigned long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (unsigned long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(unsigned long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(unsigned long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned long) >= 2 * PyLong_SHIFT)) { return (unsigned long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); } } break; case 3: if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned long) >= 3 * PyLong_SHIFT)) { return (unsigned long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); } } break; case 4: if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned long) >= 4 * PyLong_SHIFT)) { return (unsigned long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (unsigned long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(unsigned long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(unsigned long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(unsigned long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(unsigned long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(unsigned long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(unsigned long) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned long) - 1 > 2 * PyLong_SHIFT)) { return (unsigned long) (((unsigned long)-1)*(((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))); } } break; case 2: if ((8 * sizeof(unsigned long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned long) - 1 > 2 * PyLong_SHIFT)) { return (unsigned long) ((((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))); } } break; case -3: if ((8 * sizeof(unsigned long) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned long) - 1 > 3 * PyLong_SHIFT)) { return (unsigned long) (((unsigned long)-1)*(((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))); } } break; case 3: if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned long) - 1 > 3 * PyLong_SHIFT)) { return (unsigned long) ((((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))); } } break; case -4: if ((8 * sizeof(unsigned long) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned long) - 1 > 4 * PyLong_SHIFT)) { return (unsigned long) (((unsigned long)-1)*(((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))); } } break; case 4: if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned long) - 1 > 4 * PyLong_SHIFT)) { return (unsigned long) ((((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))); } } break; } } #endif if ((sizeof(unsigned long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(unsigned long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(unsigned long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(unsigned long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { unsigned long val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (unsigned long) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (unsigned long) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (unsigned long) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (unsigned long) -1; } else { stepval = __Pyx_NewRef(v); } val = (unsigned long) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(unsigned long) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((unsigned long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(unsigned long) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((unsigned long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((unsigned long) 1) << (sizeof(unsigned long) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (unsigned long) -1; } } else { unsigned long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (unsigned long) -1; val = __Pyx_PyInt_As_unsigned_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to unsigned long"); return (unsigned long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to unsigned long"); return (unsigned long) -1; } /* CIntFromPy */ static CYTHON_INLINE PetscBool __Pyx_PyInt_As_PetscBool(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PetscBool neg_one = (PetscBool) -1, const_zero = (PetscBool) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(PetscBool) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(PetscBool, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (PetscBool) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(PetscBool, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(PetscBool) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscBool, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscBool) >= 2 * PyLong_SHIFT)) { return (PetscBool) (((((PetscBool)digits[1]) << PyLong_SHIFT) | (PetscBool)digits[0])); } } break; case 3: if ((8 * sizeof(PetscBool) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscBool, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscBool) >= 3 * PyLong_SHIFT)) { return (PetscBool) (((((((PetscBool)digits[2]) << PyLong_SHIFT) | (PetscBool)digits[1]) << PyLong_SHIFT) | (PetscBool)digits[0])); } } break; case 4: if ((8 * sizeof(PetscBool) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscBool, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscBool) >= 4 * PyLong_SHIFT)) { return (PetscBool) (((((((((PetscBool)digits[3]) << PyLong_SHIFT) | (PetscBool)digits[2]) << PyLong_SHIFT) | (PetscBool)digits[1]) << PyLong_SHIFT) | (PetscBool)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (PetscBool) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(PetscBool) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(PetscBool, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(PetscBool) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(PetscBool, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(PetscBool, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(PetscBool) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscBool, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscBool) - 1 > 2 * PyLong_SHIFT)) { return (PetscBool) (((PetscBool)-1)*(((((PetscBool)digits[1]) << PyLong_SHIFT) | (PetscBool)digits[0]))); } } break; case 2: if ((8 * sizeof(PetscBool) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscBool, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscBool) - 1 > 2 * PyLong_SHIFT)) { return (PetscBool) ((((((PetscBool)digits[1]) << PyLong_SHIFT) | (PetscBool)digits[0]))); } } break; case -3: if ((8 * sizeof(PetscBool) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscBool, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscBool) - 1 > 3 * PyLong_SHIFT)) { return (PetscBool) (((PetscBool)-1)*(((((((PetscBool)digits[2]) << PyLong_SHIFT) | (PetscBool)digits[1]) << PyLong_SHIFT) | (PetscBool)digits[0]))); } } break; case 3: if ((8 * sizeof(PetscBool) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscBool, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscBool) - 1 > 3 * PyLong_SHIFT)) { return (PetscBool) ((((((((PetscBool)digits[2]) << PyLong_SHIFT) | (PetscBool)digits[1]) << PyLong_SHIFT) | (PetscBool)digits[0]))); } } break; case -4: if ((8 * sizeof(PetscBool) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscBool, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscBool) - 1 > 4 * PyLong_SHIFT)) { return (PetscBool) (((PetscBool)-1)*(((((((((PetscBool)digits[3]) << PyLong_SHIFT) | (PetscBool)digits[2]) << PyLong_SHIFT) | (PetscBool)digits[1]) << PyLong_SHIFT) | (PetscBool)digits[0]))); } } break; case 4: if ((8 * sizeof(PetscBool) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PetscBool, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PetscBool) - 1 > 4 * PyLong_SHIFT)) { return (PetscBool) ((((((((((PetscBool)digits[3]) << PyLong_SHIFT) | (PetscBool)digits[2]) << PyLong_SHIFT) | (PetscBool)digits[1]) << PyLong_SHIFT) | (PetscBool)digits[0]))); } } break; } } #endif if ((sizeof(PetscBool) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(PetscBool, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(PetscBool) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(PetscBool, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available, cannot convert large enums"); return (PetscBool) -1; } else { PetscBool val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (PetscBool) -1; val = __Pyx_PyInt_As_PetscBool(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to PetscBool"); return (PetscBool) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to PetscBool"); return (PetscBool) -1; } /* CIntFromPy */ static CYTHON_INLINE ISGlobalToLocalMappingMode __Pyx_PyInt_As_ISGlobalToLocalMappingMode(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const ISGlobalToLocalMappingMode neg_one = (ISGlobalToLocalMappingMode) -1, const_zero = (ISGlobalToLocalMappingMode) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(ISGlobalToLocalMappingMode) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(ISGlobalToLocalMappingMode, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (ISGlobalToLocalMappingMode) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(ISGlobalToLocalMappingMode, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(ISGlobalToLocalMappingMode) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(ISGlobalToLocalMappingMode, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(ISGlobalToLocalMappingMode) >= 2 * PyLong_SHIFT)) { return (ISGlobalToLocalMappingMode) (((((ISGlobalToLocalMappingMode)digits[1]) << PyLong_SHIFT) | (ISGlobalToLocalMappingMode)digits[0])); } } break; case 3: if ((8 * sizeof(ISGlobalToLocalMappingMode) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(ISGlobalToLocalMappingMode, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(ISGlobalToLocalMappingMode) >= 3 * PyLong_SHIFT)) { return (ISGlobalToLocalMappingMode) (((((((ISGlobalToLocalMappingMode)digits[2]) << PyLong_SHIFT) | (ISGlobalToLocalMappingMode)digits[1]) << PyLong_SHIFT) | (ISGlobalToLocalMappingMode)digits[0])); } } break; case 4: if ((8 * sizeof(ISGlobalToLocalMappingMode) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(ISGlobalToLocalMappingMode, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(ISGlobalToLocalMappingMode) >= 4 * PyLong_SHIFT)) { return (ISGlobalToLocalMappingMode) (((((((((ISGlobalToLocalMappingMode)digits[3]) << PyLong_SHIFT) | (ISGlobalToLocalMappingMode)digits[2]) << PyLong_SHIFT) | (ISGlobalToLocalMappingMode)digits[1]) << PyLong_SHIFT) | (ISGlobalToLocalMappingMode)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (ISGlobalToLocalMappingMode) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(ISGlobalToLocalMappingMode) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(ISGlobalToLocalMappingMode, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(ISGlobalToLocalMappingMode) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(ISGlobalToLocalMappingMode, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(ISGlobalToLocalMappingMode, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(ISGlobalToLocalMappingMode) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(ISGlobalToLocalMappingMode, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(ISGlobalToLocalMappingMode) - 1 > 2 * PyLong_SHIFT)) { return (ISGlobalToLocalMappingMode) (((ISGlobalToLocalMappingMode)-1)*(((((ISGlobalToLocalMappingMode)digits[1]) << PyLong_SHIFT) | (ISGlobalToLocalMappingMode)digits[0]))); } } break; case 2: if ((8 * sizeof(ISGlobalToLocalMappingMode) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(ISGlobalToLocalMappingMode, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(ISGlobalToLocalMappingMode) - 1 > 2 * PyLong_SHIFT)) { return (ISGlobalToLocalMappingMode) ((((((ISGlobalToLocalMappingMode)digits[1]) << PyLong_SHIFT) | (ISGlobalToLocalMappingMode)digits[0]))); } } break; case -3: if ((8 * sizeof(ISGlobalToLocalMappingMode) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(ISGlobalToLocalMappingMode, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(ISGlobalToLocalMappingMode) - 1 > 3 * PyLong_SHIFT)) { return (ISGlobalToLocalMappingMode) (((ISGlobalToLocalMappingMode)-1)*(((((((ISGlobalToLocalMappingMode)digits[2]) << PyLong_SHIFT) | (ISGlobalToLocalMappingMode)digits[1]) << PyLong_SHIFT) | (ISGlobalToLocalMappingMode)digits[0]))); } } break; case 3: if ((8 * sizeof(ISGlobalToLocalMappingMode) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(ISGlobalToLocalMappingMode, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(ISGlobalToLocalMappingMode) - 1 > 3 * PyLong_SHIFT)) { return (ISGlobalToLocalMappingMode) ((((((((ISGlobalToLocalMappingMode)digits[2]) << PyLong_SHIFT) | (ISGlobalToLocalMappingMode)digits[1]) << PyLong_SHIFT) | (ISGlobalToLocalMappingMode)digits[0]))); } } break; case -4: if ((8 * sizeof(ISGlobalToLocalMappingMode) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(ISGlobalToLocalMappingMode, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(ISGlobalToLocalMappingMode) - 1 > 4 * PyLong_SHIFT)) { return (ISGlobalToLocalMappingMode) (((ISGlobalToLocalMappingMode)-1)*(((((((((ISGlobalToLocalMappingMode)digits[3]) << PyLong_SHIFT) | (ISGlobalToLocalMappingMode)digits[2]) << PyLong_SHIFT) | (ISGlobalToLocalMappingMode)digits[1]) << PyLong_SHIFT) | (ISGlobalToLocalMappingMode)digits[0]))); } } break; case 4: if ((8 * sizeof(ISGlobalToLocalMappingMode) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(ISGlobalToLocalMappingMode, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(ISGlobalToLocalMappingMode) - 1 > 4 * PyLong_SHIFT)) { return (ISGlobalToLocalMappingMode) ((((((((((ISGlobalToLocalMappingMode)digits[3]) << PyLong_SHIFT) | (ISGlobalToLocalMappingMode)digits[2]) << PyLong_SHIFT) | (ISGlobalToLocalMappingMode)digits[1]) << PyLong_SHIFT) | (ISGlobalToLocalMappingMode)digits[0]))); } } break; } } #endif if ((sizeof(ISGlobalToLocalMappingMode) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(ISGlobalToLocalMappingMode, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(ISGlobalToLocalMappingMode) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(ISGlobalToLocalMappingMode, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available, cannot convert large enums"); return (ISGlobalToLocalMappingMode) -1; } else { ISGlobalToLocalMappingMode val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (ISGlobalToLocalMappingMode) -1; val = __Pyx_PyInt_As_ISGlobalToLocalMappingMode(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to ISGlobalToLocalMappingMode"); return (ISGlobalToLocalMappingMode) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to ISGlobalToLocalMappingMode"); return (ISGlobalToLocalMappingMode) -1; } /* CIntFromPy */ static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const size_t neg_one = (size_t) -1, const_zero = (size_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(size_t) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(size_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (size_t) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(size_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(size_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(size_t) >= 2 * PyLong_SHIFT)) { return (size_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } } break; case 3: if ((8 * sizeof(size_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(size_t) >= 3 * PyLong_SHIFT)) { return (size_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } } break; case 4: if ((8 * sizeof(size_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(size_t) >= 4 * PyLong_SHIFT)) { return (size_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (size_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(size_t) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(size_t) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(size_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(size_t) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT)) { return (size_t) (((size_t)-1)*(((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); } } break; case 2: if ((8 * sizeof(size_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT)) { return (size_t) ((((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); } } break; case -3: if ((8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT)) { return (size_t) (((size_t)-1)*(((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); } } break; case 3: if ((8 * sizeof(size_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT)) { return (size_t) ((((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); } } break; case -4: if ((8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT)) { return (size_t) (((size_t)-1)*(((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); } } break; case 4: if ((8 * sizeof(size_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT)) { return (size_t) ((((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); } } break; } } #endif if ((sizeof(size_t) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(size_t, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(size_t) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(size_t, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { size_t val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (size_t) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (size_t) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (size_t) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (size_t) -1; } else { stepval = __Pyx_NewRef(v); } val = (size_t) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(size_t) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((size_t) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(size_t) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((size_t) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((size_t) 1) << (sizeof(size_t) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (size_t) -1; } } else { size_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (size_t) -1; val = __Pyx_PyInt_As_size_t(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to size_t"); return (size_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to size_t"); return (size_t) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint8_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint8_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint8_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(uint8_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint8_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(uint8_t), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(uint8_t)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint16_t(uint16_t value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint16_t neg_one = (uint16_t) -1, const_zero = (uint16_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint16_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint16_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint16_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(uint16_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint16_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(uint16_t), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(uint16_t)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType __Pyx_PyInt_As_enum____pyx_t_8petsc4py_5PETSc_PetscDLDeviceType(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType neg_one = (enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType) -1, const_zero = (enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType) >= 2 * PyLong_SHIFT)) { return (enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType) (((((enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType)digits[0])); } } break; case 3: if ((8 * sizeof(enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType) >= 3 * PyLong_SHIFT)) { return (enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType) (((((((enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType)digits[0])); } } break; case 4: if ((8 * sizeof(enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType) >= 4 * PyLong_SHIFT)) { return (enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType) (((((((((enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType) - 1 > 2 * PyLong_SHIFT)) { return (enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType) (((enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType)-1)*(((((enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType)digits[0]))); } } break; case 2: if ((8 * sizeof(enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType) - 1 > 2 * PyLong_SHIFT)) { return (enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType) ((((((enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType)digits[0]))); } } break; case -3: if ((8 * sizeof(enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType) - 1 > 3 * PyLong_SHIFT)) { return (enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType) (((enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType)-1)*(((((((enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType)digits[0]))); } } break; case 3: if ((8 * sizeof(enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType) - 1 > 3 * PyLong_SHIFT)) { return (enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType) ((((((((enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType)digits[0]))); } } break; case -4: if ((8 * sizeof(enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType) - 1 > 4 * PyLong_SHIFT)) { return (enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType) (((enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType)-1)*(((((((((enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType)digits[0]))); } } break; case 4: if ((8 * sizeof(enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType) - 1 > 4 * PyLong_SHIFT)) { return (enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType) ((((((((((enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType)digits[0]))); } } break; } } #endif if ((sizeof(enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available, cannot convert large enums"); return (enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType) -1; } else { enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType) -1; val = __Pyx_PyInt_As_enum____pyx_t_8petsc4py_5PETSc_PetscDLDeviceType(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType"); return (enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType"); return (enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType) -1; } /* CIntFromPy */ static CYTHON_INLINE VecOption __Pyx_PyInt_As_VecOption(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const VecOption neg_one = (VecOption) -1, const_zero = (VecOption) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(VecOption) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(VecOption, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (VecOption) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(VecOption, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(VecOption) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(VecOption, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(VecOption) >= 2 * PyLong_SHIFT)) { return (VecOption) (((((VecOption)digits[1]) << PyLong_SHIFT) | (VecOption)digits[0])); } } break; case 3: if ((8 * sizeof(VecOption) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(VecOption, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(VecOption) >= 3 * PyLong_SHIFT)) { return (VecOption) (((((((VecOption)digits[2]) << PyLong_SHIFT) | (VecOption)digits[1]) << PyLong_SHIFT) | (VecOption)digits[0])); } } break; case 4: if ((8 * sizeof(VecOption) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(VecOption, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(VecOption) >= 4 * PyLong_SHIFT)) { return (VecOption) (((((((((VecOption)digits[3]) << PyLong_SHIFT) | (VecOption)digits[2]) << PyLong_SHIFT) | (VecOption)digits[1]) << PyLong_SHIFT) | (VecOption)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (VecOption) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(VecOption) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(VecOption, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(VecOption) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(VecOption, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(VecOption, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(VecOption) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(VecOption, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(VecOption) - 1 > 2 * PyLong_SHIFT)) { return (VecOption) (((VecOption)-1)*(((((VecOption)digits[1]) << PyLong_SHIFT) | (VecOption)digits[0]))); } } break; case 2: if ((8 * sizeof(VecOption) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(VecOption, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(VecOption) - 1 > 2 * PyLong_SHIFT)) { return (VecOption) ((((((VecOption)digits[1]) << PyLong_SHIFT) | (VecOption)digits[0]))); } } break; case -3: if ((8 * sizeof(VecOption) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(VecOption, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(VecOption) - 1 > 3 * PyLong_SHIFT)) { return (VecOption) (((VecOption)-1)*(((((((VecOption)digits[2]) << PyLong_SHIFT) | (VecOption)digits[1]) << PyLong_SHIFT) | (VecOption)digits[0]))); } } break; case 3: if ((8 * sizeof(VecOption) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(VecOption, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(VecOption) - 1 > 3 * PyLong_SHIFT)) { return (VecOption) ((((((((VecOption)digits[2]) << PyLong_SHIFT) | (VecOption)digits[1]) << PyLong_SHIFT) | (VecOption)digits[0]))); } } break; case -4: if ((8 * sizeof(VecOption) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(VecOption, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(VecOption) - 1 > 4 * PyLong_SHIFT)) { return (VecOption) (((VecOption)-1)*(((((((((VecOption)digits[3]) << PyLong_SHIFT) | (VecOption)digits[2]) << PyLong_SHIFT) | (VecOption)digits[1]) << PyLong_SHIFT) | (VecOption)digits[0]))); } } break; case 4: if ((8 * sizeof(VecOption) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(VecOption, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(VecOption) - 1 > 4 * PyLong_SHIFT)) { return (VecOption) ((((((((((VecOption)digits[3]) << PyLong_SHIFT) | (VecOption)digits[2]) << PyLong_SHIFT) | (VecOption)digits[1]) << PyLong_SHIFT) | (VecOption)digits[0]))); } } break; } } #endif if ((sizeof(VecOption) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(VecOption, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(VecOption) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(VecOption, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available, cannot convert large enums"); return (VecOption) -1; } else { VecOption val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (VecOption) -1; val = __Pyx_PyInt_As_VecOption(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to VecOption"); return (VecOption) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to VecOption"); return (VecOption) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PetscOffloadMask(PetscOffloadMask value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PetscOffloadMask neg_one = (PetscOffloadMask) -1, const_zero = (PetscOffloadMask) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(PetscOffloadMask) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(PetscOffloadMask) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PetscOffloadMask) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(PetscOffloadMask) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PetscOffloadMask) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(PetscOffloadMask), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(PetscOffloadMask)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE NormType __Pyx_PyInt_As_NormType(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const NormType neg_one = (NormType) -1, const_zero = (NormType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(NormType) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(NormType, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (NormType) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(NormType, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(NormType) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(NormType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(NormType) >= 2 * PyLong_SHIFT)) { return (NormType) (((((NormType)digits[1]) << PyLong_SHIFT) | (NormType)digits[0])); } } break; case 3: if ((8 * sizeof(NormType) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(NormType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(NormType) >= 3 * PyLong_SHIFT)) { return (NormType) (((((((NormType)digits[2]) << PyLong_SHIFT) | (NormType)digits[1]) << PyLong_SHIFT) | (NormType)digits[0])); } } break; case 4: if ((8 * sizeof(NormType) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(NormType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(NormType) >= 4 * PyLong_SHIFT)) { return (NormType) (((((((((NormType)digits[3]) << PyLong_SHIFT) | (NormType)digits[2]) << PyLong_SHIFT) | (NormType)digits[1]) << PyLong_SHIFT) | (NormType)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (NormType) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(NormType) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(NormType, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(NormType) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(NormType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(NormType, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(NormType) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(NormType, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(NormType) - 1 > 2 * PyLong_SHIFT)) { return (NormType) (((NormType)-1)*(((((NormType)digits[1]) << PyLong_SHIFT) | (NormType)digits[0]))); } } break; case 2: if ((8 * sizeof(NormType) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(NormType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(NormType) - 1 > 2 * PyLong_SHIFT)) { return (NormType) ((((((NormType)digits[1]) << PyLong_SHIFT) | (NormType)digits[0]))); } } break; case -3: if ((8 * sizeof(NormType) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(NormType, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(NormType) - 1 > 3 * PyLong_SHIFT)) { return (NormType) (((NormType)-1)*(((((((NormType)digits[2]) << PyLong_SHIFT) | (NormType)digits[1]) << PyLong_SHIFT) | (NormType)digits[0]))); } } break; case 3: if ((8 * sizeof(NormType) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(NormType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(NormType) - 1 > 3 * PyLong_SHIFT)) { return (NormType) ((((((((NormType)digits[2]) << PyLong_SHIFT) | (NormType)digits[1]) << PyLong_SHIFT) | (NormType)digits[0]))); } } break; case -4: if ((8 * sizeof(NormType) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(NormType, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(NormType) - 1 > 4 * PyLong_SHIFT)) { return (NormType) (((NormType)-1)*(((((((((NormType)digits[3]) << PyLong_SHIFT) | (NormType)digits[2]) << PyLong_SHIFT) | (NormType)digits[1]) << PyLong_SHIFT) | (NormType)digits[0]))); } } break; case 4: if ((8 * sizeof(NormType) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(NormType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(NormType) - 1 > 4 * PyLong_SHIFT)) { return (NormType) ((((((((((NormType)digits[3]) << PyLong_SHIFT) | (NormType)digits[2]) << PyLong_SHIFT) | (NormType)digits[1]) << PyLong_SHIFT) | (NormType)digits[0]))); } } break; } } #endif if ((sizeof(NormType) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(NormType, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(NormType) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(NormType, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available, cannot convert large enums"); return (NormType) -1; } else { NormType val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (NormType) -1; val = __Pyx_PyInt_As_NormType(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to NormType"); return (NormType) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to NormType"); return (NormType) -1; } /* CIntFromPy */ static CYTHON_INLINE MatOption __Pyx_PyInt_As_MatOption(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const MatOption neg_one = (MatOption) -1, const_zero = (MatOption) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(MatOption) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(MatOption, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (MatOption) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(MatOption, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(MatOption) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(MatOption, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(MatOption) >= 2 * PyLong_SHIFT)) { return (MatOption) (((((MatOption)digits[1]) << PyLong_SHIFT) | (MatOption)digits[0])); } } break; case 3: if ((8 * sizeof(MatOption) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(MatOption, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(MatOption) >= 3 * PyLong_SHIFT)) { return (MatOption) (((((((MatOption)digits[2]) << PyLong_SHIFT) | (MatOption)digits[1]) << PyLong_SHIFT) | (MatOption)digits[0])); } } break; case 4: if ((8 * sizeof(MatOption) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(MatOption, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(MatOption) >= 4 * PyLong_SHIFT)) { return (MatOption) (((((((((MatOption)digits[3]) << PyLong_SHIFT) | (MatOption)digits[2]) << PyLong_SHIFT) | (MatOption)digits[1]) << PyLong_SHIFT) | (MatOption)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (MatOption) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(MatOption) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(MatOption, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(MatOption) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(MatOption, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(MatOption, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(MatOption) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(MatOption, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(MatOption) - 1 > 2 * PyLong_SHIFT)) { return (MatOption) (((MatOption)-1)*(((((MatOption)digits[1]) << PyLong_SHIFT) | (MatOption)digits[0]))); } } break; case 2: if ((8 * sizeof(MatOption) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(MatOption, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(MatOption) - 1 > 2 * PyLong_SHIFT)) { return (MatOption) ((((((MatOption)digits[1]) << PyLong_SHIFT) | (MatOption)digits[0]))); } } break; case -3: if ((8 * sizeof(MatOption) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(MatOption, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(MatOption) - 1 > 3 * PyLong_SHIFT)) { return (MatOption) (((MatOption)-1)*(((((((MatOption)digits[2]) << PyLong_SHIFT) | (MatOption)digits[1]) << PyLong_SHIFT) | (MatOption)digits[0]))); } } break; case 3: if ((8 * sizeof(MatOption) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(MatOption, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(MatOption) - 1 > 3 * PyLong_SHIFT)) { return (MatOption) ((((((((MatOption)digits[2]) << PyLong_SHIFT) | (MatOption)digits[1]) << PyLong_SHIFT) | (MatOption)digits[0]))); } } break; case -4: if ((8 * sizeof(MatOption) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(MatOption, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(MatOption) - 1 > 4 * PyLong_SHIFT)) { return (MatOption) (((MatOption)-1)*(((((((((MatOption)digits[3]) << PyLong_SHIFT) | (MatOption)digits[2]) << PyLong_SHIFT) | (MatOption)digits[1]) << PyLong_SHIFT) | (MatOption)digits[0]))); } } break; case 4: if ((8 * sizeof(MatOption) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(MatOption, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(MatOption) - 1 > 4 * PyLong_SHIFT)) { return (MatOption) ((((((((((MatOption)digits[3]) << PyLong_SHIFT) | (MatOption)digits[2]) << PyLong_SHIFT) | (MatOption)digits[1]) << PyLong_SHIFT) | (MatOption)digits[0]))); } } break; } } #endif if ((sizeof(MatOption) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(MatOption, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(MatOption) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(MatOption, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available, cannot convert large enums"); return (MatOption) -1; } else { MatOption val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (MatOption) -1; val = __Pyx_PyInt_As_MatOption(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to MatOption"); return (MatOption) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to MatOption"); return (MatOption) -1; } /* CIntFromPy */ static CYTHON_INLINE PCFailedReason __Pyx_PyInt_As_PCFailedReason(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PCFailedReason neg_one = (PCFailedReason) -1, const_zero = (PCFailedReason) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(PCFailedReason) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(PCFailedReason, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (PCFailedReason) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(PCFailedReason, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(PCFailedReason) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCFailedReason, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCFailedReason) >= 2 * PyLong_SHIFT)) { return (PCFailedReason) (((((PCFailedReason)digits[1]) << PyLong_SHIFT) | (PCFailedReason)digits[0])); } } break; case 3: if ((8 * sizeof(PCFailedReason) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCFailedReason, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCFailedReason) >= 3 * PyLong_SHIFT)) { return (PCFailedReason) (((((((PCFailedReason)digits[2]) << PyLong_SHIFT) | (PCFailedReason)digits[1]) << PyLong_SHIFT) | (PCFailedReason)digits[0])); } } break; case 4: if ((8 * sizeof(PCFailedReason) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCFailedReason, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCFailedReason) >= 4 * PyLong_SHIFT)) { return (PCFailedReason) (((((((((PCFailedReason)digits[3]) << PyLong_SHIFT) | (PCFailedReason)digits[2]) << PyLong_SHIFT) | (PCFailedReason)digits[1]) << PyLong_SHIFT) | (PCFailedReason)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (PCFailedReason) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(PCFailedReason) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(PCFailedReason, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(PCFailedReason) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(PCFailedReason, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(PCFailedReason, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(PCFailedReason) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCFailedReason, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCFailedReason) - 1 > 2 * PyLong_SHIFT)) { return (PCFailedReason) (((PCFailedReason)-1)*(((((PCFailedReason)digits[1]) << PyLong_SHIFT) | (PCFailedReason)digits[0]))); } } break; case 2: if ((8 * sizeof(PCFailedReason) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCFailedReason, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCFailedReason) - 1 > 2 * PyLong_SHIFT)) { return (PCFailedReason) ((((((PCFailedReason)digits[1]) << PyLong_SHIFT) | (PCFailedReason)digits[0]))); } } break; case -3: if ((8 * sizeof(PCFailedReason) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCFailedReason, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCFailedReason) - 1 > 3 * PyLong_SHIFT)) { return (PCFailedReason) (((PCFailedReason)-1)*(((((((PCFailedReason)digits[2]) << PyLong_SHIFT) | (PCFailedReason)digits[1]) << PyLong_SHIFT) | (PCFailedReason)digits[0]))); } } break; case 3: if ((8 * sizeof(PCFailedReason) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCFailedReason, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCFailedReason) - 1 > 3 * PyLong_SHIFT)) { return (PCFailedReason) ((((((((PCFailedReason)digits[2]) << PyLong_SHIFT) | (PCFailedReason)digits[1]) << PyLong_SHIFT) | (PCFailedReason)digits[0]))); } } break; case -4: if ((8 * sizeof(PCFailedReason) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCFailedReason, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCFailedReason) - 1 > 4 * PyLong_SHIFT)) { return (PCFailedReason) (((PCFailedReason)-1)*(((((((((PCFailedReason)digits[3]) << PyLong_SHIFT) | (PCFailedReason)digits[2]) << PyLong_SHIFT) | (PCFailedReason)digits[1]) << PyLong_SHIFT) | (PCFailedReason)digits[0]))); } } break; case 4: if ((8 * sizeof(PCFailedReason) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCFailedReason, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCFailedReason) - 1 > 4 * PyLong_SHIFT)) { return (PCFailedReason) ((((((((((PCFailedReason)digits[3]) << PyLong_SHIFT) | (PCFailedReason)digits[2]) << PyLong_SHIFT) | (PCFailedReason)digits[1]) << PyLong_SHIFT) | (PCFailedReason)digits[0]))); } } break; } } #endif if ((sizeof(PCFailedReason) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(PCFailedReason, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(PCFailedReason) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(PCFailedReason, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available, cannot convert large enums"); return (PCFailedReason) -1; } else { PCFailedReason val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (PCFailedReason) -1; val = __Pyx_PyInt_As_PCFailedReason(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to PCFailedReason"); return (PCFailedReason) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to PCFailedReason"); return (PCFailedReason) -1; } /* CIntFromPy */ static CYTHON_INLINE PCASMType __Pyx_PyInt_As_PCASMType(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PCASMType neg_one = (PCASMType) -1, const_zero = (PCASMType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(PCASMType) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(PCASMType, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (PCASMType) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(PCASMType, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(PCASMType) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCASMType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCASMType) >= 2 * PyLong_SHIFT)) { return (PCASMType) (((((PCASMType)digits[1]) << PyLong_SHIFT) | (PCASMType)digits[0])); } } break; case 3: if ((8 * sizeof(PCASMType) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCASMType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCASMType) >= 3 * PyLong_SHIFT)) { return (PCASMType) (((((((PCASMType)digits[2]) << PyLong_SHIFT) | (PCASMType)digits[1]) << PyLong_SHIFT) | (PCASMType)digits[0])); } } break; case 4: if ((8 * sizeof(PCASMType) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCASMType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCASMType) >= 4 * PyLong_SHIFT)) { return (PCASMType) (((((((((PCASMType)digits[3]) << PyLong_SHIFT) | (PCASMType)digits[2]) << PyLong_SHIFT) | (PCASMType)digits[1]) << PyLong_SHIFT) | (PCASMType)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (PCASMType) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(PCASMType) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(PCASMType, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(PCASMType) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(PCASMType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(PCASMType, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(PCASMType) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCASMType, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCASMType) - 1 > 2 * PyLong_SHIFT)) { return (PCASMType) (((PCASMType)-1)*(((((PCASMType)digits[1]) << PyLong_SHIFT) | (PCASMType)digits[0]))); } } break; case 2: if ((8 * sizeof(PCASMType) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCASMType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCASMType) - 1 > 2 * PyLong_SHIFT)) { return (PCASMType) ((((((PCASMType)digits[1]) << PyLong_SHIFT) | (PCASMType)digits[0]))); } } break; case -3: if ((8 * sizeof(PCASMType) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCASMType, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCASMType) - 1 > 3 * PyLong_SHIFT)) { return (PCASMType) (((PCASMType)-1)*(((((((PCASMType)digits[2]) << PyLong_SHIFT) | (PCASMType)digits[1]) << PyLong_SHIFT) | (PCASMType)digits[0]))); } } break; case 3: if ((8 * sizeof(PCASMType) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCASMType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCASMType) - 1 > 3 * PyLong_SHIFT)) { return (PCASMType) ((((((((PCASMType)digits[2]) << PyLong_SHIFT) | (PCASMType)digits[1]) << PyLong_SHIFT) | (PCASMType)digits[0]))); } } break; case -4: if ((8 * sizeof(PCASMType) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCASMType, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCASMType) - 1 > 4 * PyLong_SHIFT)) { return (PCASMType) (((PCASMType)-1)*(((((((((PCASMType)digits[3]) << PyLong_SHIFT) | (PCASMType)digits[2]) << PyLong_SHIFT) | (PCASMType)digits[1]) << PyLong_SHIFT) | (PCASMType)digits[0]))); } } break; case 4: if ((8 * sizeof(PCASMType) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCASMType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCASMType) - 1 > 4 * PyLong_SHIFT)) { return (PCASMType) ((((((((((PCASMType)digits[3]) << PyLong_SHIFT) | (PCASMType)digits[2]) << PyLong_SHIFT) | (PCASMType)digits[1]) << PyLong_SHIFT) | (PCASMType)digits[0]))); } } break; } } #endif if ((sizeof(PCASMType) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(PCASMType, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(PCASMType) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(PCASMType, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available, cannot convert large enums"); return (PCASMType) -1; } else { PCASMType val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (PCASMType) -1; val = __Pyx_PyInt_As_PCASMType(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to PCASMType"); return (PCASMType) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to PCASMType"); return (PCASMType) -1; } /* CIntFromPy */ static CYTHON_INLINE PCGASMType __Pyx_PyInt_As_PCGASMType(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PCGASMType neg_one = (PCGASMType) -1, const_zero = (PCGASMType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(PCGASMType) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(PCGASMType, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (PCGASMType) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(PCGASMType, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(PCGASMType) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCGASMType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCGASMType) >= 2 * PyLong_SHIFT)) { return (PCGASMType) (((((PCGASMType)digits[1]) << PyLong_SHIFT) | (PCGASMType)digits[0])); } } break; case 3: if ((8 * sizeof(PCGASMType) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCGASMType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCGASMType) >= 3 * PyLong_SHIFT)) { return (PCGASMType) (((((((PCGASMType)digits[2]) << PyLong_SHIFT) | (PCGASMType)digits[1]) << PyLong_SHIFT) | (PCGASMType)digits[0])); } } break; case 4: if ((8 * sizeof(PCGASMType) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCGASMType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCGASMType) >= 4 * PyLong_SHIFT)) { return (PCGASMType) (((((((((PCGASMType)digits[3]) << PyLong_SHIFT) | (PCGASMType)digits[2]) << PyLong_SHIFT) | (PCGASMType)digits[1]) << PyLong_SHIFT) | (PCGASMType)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (PCGASMType) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(PCGASMType) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(PCGASMType, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(PCGASMType) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(PCGASMType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(PCGASMType, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(PCGASMType) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCGASMType, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCGASMType) - 1 > 2 * PyLong_SHIFT)) { return (PCGASMType) (((PCGASMType)-1)*(((((PCGASMType)digits[1]) << PyLong_SHIFT) | (PCGASMType)digits[0]))); } } break; case 2: if ((8 * sizeof(PCGASMType) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCGASMType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCGASMType) - 1 > 2 * PyLong_SHIFT)) { return (PCGASMType) ((((((PCGASMType)digits[1]) << PyLong_SHIFT) | (PCGASMType)digits[0]))); } } break; case -3: if ((8 * sizeof(PCGASMType) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCGASMType, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCGASMType) - 1 > 3 * PyLong_SHIFT)) { return (PCGASMType) (((PCGASMType)-1)*(((((((PCGASMType)digits[2]) << PyLong_SHIFT) | (PCGASMType)digits[1]) << PyLong_SHIFT) | (PCGASMType)digits[0]))); } } break; case 3: if ((8 * sizeof(PCGASMType) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCGASMType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCGASMType) - 1 > 3 * PyLong_SHIFT)) { return (PCGASMType) ((((((((PCGASMType)digits[2]) << PyLong_SHIFT) | (PCGASMType)digits[1]) << PyLong_SHIFT) | (PCGASMType)digits[0]))); } } break; case -4: if ((8 * sizeof(PCGASMType) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCGASMType, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCGASMType) - 1 > 4 * PyLong_SHIFT)) { return (PCGASMType) (((PCGASMType)-1)*(((((((((PCGASMType)digits[3]) << PyLong_SHIFT) | (PCGASMType)digits[2]) << PyLong_SHIFT) | (PCGASMType)digits[1]) << PyLong_SHIFT) | (PCGASMType)digits[0]))); } } break; case 4: if ((8 * sizeof(PCGASMType) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCGASMType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCGASMType) - 1 > 4 * PyLong_SHIFT)) { return (PCGASMType) ((((((((((PCGASMType)digits[3]) << PyLong_SHIFT) | (PCGASMType)digits[2]) << PyLong_SHIFT) | (PCGASMType)digits[1]) << PyLong_SHIFT) | (PCGASMType)digits[0]))); } } break; } } #endif if ((sizeof(PCGASMType) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(PCGASMType, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(PCGASMType) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(PCGASMType, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available, cannot convert large enums"); return (PCGASMType) -1; } else { PCGASMType val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (PCGASMType) -1; val = __Pyx_PyInt_As_PCGASMType(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to PCGASMType"); return (PCGASMType) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to PCGASMType"); return (PCGASMType) -1; } /* CIntFromPy */ static CYTHON_INLINE PCCompositeType __Pyx_PyInt_As_PCCompositeType(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PCCompositeType neg_one = (PCCompositeType) -1, const_zero = (PCCompositeType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(PCCompositeType) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(PCCompositeType, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (PCCompositeType) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(PCCompositeType, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(PCCompositeType) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCCompositeType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCCompositeType) >= 2 * PyLong_SHIFT)) { return (PCCompositeType) (((((PCCompositeType)digits[1]) << PyLong_SHIFT) | (PCCompositeType)digits[0])); } } break; case 3: if ((8 * sizeof(PCCompositeType) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCCompositeType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCCompositeType) >= 3 * PyLong_SHIFT)) { return (PCCompositeType) (((((((PCCompositeType)digits[2]) << PyLong_SHIFT) | (PCCompositeType)digits[1]) << PyLong_SHIFT) | (PCCompositeType)digits[0])); } } break; case 4: if ((8 * sizeof(PCCompositeType) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCCompositeType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCCompositeType) >= 4 * PyLong_SHIFT)) { return (PCCompositeType) (((((((((PCCompositeType)digits[3]) << PyLong_SHIFT) | (PCCompositeType)digits[2]) << PyLong_SHIFT) | (PCCompositeType)digits[1]) << PyLong_SHIFT) | (PCCompositeType)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (PCCompositeType) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(PCCompositeType) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(PCCompositeType, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(PCCompositeType) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(PCCompositeType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(PCCompositeType, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(PCCompositeType) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCCompositeType, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCCompositeType) - 1 > 2 * PyLong_SHIFT)) { return (PCCompositeType) (((PCCompositeType)-1)*(((((PCCompositeType)digits[1]) << PyLong_SHIFT) | (PCCompositeType)digits[0]))); } } break; case 2: if ((8 * sizeof(PCCompositeType) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCCompositeType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCCompositeType) - 1 > 2 * PyLong_SHIFT)) { return (PCCompositeType) ((((((PCCompositeType)digits[1]) << PyLong_SHIFT) | (PCCompositeType)digits[0]))); } } break; case -3: if ((8 * sizeof(PCCompositeType) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCCompositeType, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCCompositeType) - 1 > 3 * PyLong_SHIFT)) { return (PCCompositeType) (((PCCompositeType)-1)*(((((((PCCompositeType)digits[2]) << PyLong_SHIFT) | (PCCompositeType)digits[1]) << PyLong_SHIFT) | (PCCompositeType)digits[0]))); } } break; case 3: if ((8 * sizeof(PCCompositeType) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCCompositeType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCCompositeType) - 1 > 3 * PyLong_SHIFT)) { return (PCCompositeType) ((((((((PCCompositeType)digits[2]) << PyLong_SHIFT) | (PCCompositeType)digits[1]) << PyLong_SHIFT) | (PCCompositeType)digits[0]))); } } break; case -4: if ((8 * sizeof(PCCompositeType) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCCompositeType, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCCompositeType) - 1 > 4 * PyLong_SHIFT)) { return (PCCompositeType) (((PCCompositeType)-1)*(((((((((PCCompositeType)digits[3]) << PyLong_SHIFT) | (PCCompositeType)digits[2]) << PyLong_SHIFT) | (PCCompositeType)digits[1]) << PyLong_SHIFT) | (PCCompositeType)digits[0]))); } } break; case 4: if ((8 * sizeof(PCCompositeType) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCCompositeType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCCompositeType) - 1 > 4 * PyLong_SHIFT)) { return (PCCompositeType) ((((((((((PCCompositeType)digits[3]) << PyLong_SHIFT) | (PCCompositeType)digits[2]) << PyLong_SHIFT) | (PCCompositeType)digits[1]) << PyLong_SHIFT) | (PCCompositeType)digits[0]))); } } break; } } #endif if ((sizeof(PCCompositeType) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(PCCompositeType, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(PCCompositeType) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(PCCompositeType, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available, cannot convert large enums"); return (PCCompositeType) -1; } else { PCCompositeType val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (PCCompositeType) -1; val = __Pyx_PyInt_As_PCCompositeType(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to PCCompositeType"); return (PCCompositeType) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to PCCompositeType"); return (PCCompositeType) -1; } /* CIntFromPy */ static CYTHON_INLINE PCFieldSplitSchurFactType __Pyx_PyInt_As_PCFieldSplitSchurFactType(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PCFieldSplitSchurFactType neg_one = (PCFieldSplitSchurFactType) -1, const_zero = (PCFieldSplitSchurFactType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(PCFieldSplitSchurFactType) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(PCFieldSplitSchurFactType, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (PCFieldSplitSchurFactType) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(PCFieldSplitSchurFactType, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(PCFieldSplitSchurFactType) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCFieldSplitSchurFactType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCFieldSplitSchurFactType) >= 2 * PyLong_SHIFT)) { return (PCFieldSplitSchurFactType) (((((PCFieldSplitSchurFactType)digits[1]) << PyLong_SHIFT) | (PCFieldSplitSchurFactType)digits[0])); } } break; case 3: if ((8 * sizeof(PCFieldSplitSchurFactType) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCFieldSplitSchurFactType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCFieldSplitSchurFactType) >= 3 * PyLong_SHIFT)) { return (PCFieldSplitSchurFactType) (((((((PCFieldSplitSchurFactType)digits[2]) << PyLong_SHIFT) | (PCFieldSplitSchurFactType)digits[1]) << PyLong_SHIFT) | (PCFieldSplitSchurFactType)digits[0])); } } break; case 4: if ((8 * sizeof(PCFieldSplitSchurFactType) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCFieldSplitSchurFactType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCFieldSplitSchurFactType) >= 4 * PyLong_SHIFT)) { return (PCFieldSplitSchurFactType) (((((((((PCFieldSplitSchurFactType)digits[3]) << PyLong_SHIFT) | (PCFieldSplitSchurFactType)digits[2]) << PyLong_SHIFT) | (PCFieldSplitSchurFactType)digits[1]) << PyLong_SHIFT) | (PCFieldSplitSchurFactType)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (PCFieldSplitSchurFactType) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(PCFieldSplitSchurFactType) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(PCFieldSplitSchurFactType, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(PCFieldSplitSchurFactType) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(PCFieldSplitSchurFactType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(PCFieldSplitSchurFactType, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(PCFieldSplitSchurFactType) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCFieldSplitSchurFactType, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCFieldSplitSchurFactType) - 1 > 2 * PyLong_SHIFT)) { return (PCFieldSplitSchurFactType) (((PCFieldSplitSchurFactType)-1)*(((((PCFieldSplitSchurFactType)digits[1]) << PyLong_SHIFT) | (PCFieldSplitSchurFactType)digits[0]))); } } break; case 2: if ((8 * sizeof(PCFieldSplitSchurFactType) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCFieldSplitSchurFactType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCFieldSplitSchurFactType) - 1 > 2 * PyLong_SHIFT)) { return (PCFieldSplitSchurFactType) ((((((PCFieldSplitSchurFactType)digits[1]) << PyLong_SHIFT) | (PCFieldSplitSchurFactType)digits[0]))); } } break; case -3: if ((8 * sizeof(PCFieldSplitSchurFactType) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCFieldSplitSchurFactType, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCFieldSplitSchurFactType) - 1 > 3 * PyLong_SHIFT)) { return (PCFieldSplitSchurFactType) (((PCFieldSplitSchurFactType)-1)*(((((((PCFieldSplitSchurFactType)digits[2]) << PyLong_SHIFT) | (PCFieldSplitSchurFactType)digits[1]) << PyLong_SHIFT) | (PCFieldSplitSchurFactType)digits[0]))); } } break; case 3: if ((8 * sizeof(PCFieldSplitSchurFactType) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCFieldSplitSchurFactType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCFieldSplitSchurFactType) - 1 > 3 * PyLong_SHIFT)) { return (PCFieldSplitSchurFactType) ((((((((PCFieldSplitSchurFactType)digits[2]) << PyLong_SHIFT) | (PCFieldSplitSchurFactType)digits[1]) << PyLong_SHIFT) | (PCFieldSplitSchurFactType)digits[0]))); } } break; case -4: if ((8 * sizeof(PCFieldSplitSchurFactType) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCFieldSplitSchurFactType, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCFieldSplitSchurFactType) - 1 > 4 * PyLong_SHIFT)) { return (PCFieldSplitSchurFactType) (((PCFieldSplitSchurFactType)-1)*(((((((((PCFieldSplitSchurFactType)digits[3]) << PyLong_SHIFT) | (PCFieldSplitSchurFactType)digits[2]) << PyLong_SHIFT) | (PCFieldSplitSchurFactType)digits[1]) << PyLong_SHIFT) | (PCFieldSplitSchurFactType)digits[0]))); } } break; case 4: if ((8 * sizeof(PCFieldSplitSchurFactType) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCFieldSplitSchurFactType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCFieldSplitSchurFactType) - 1 > 4 * PyLong_SHIFT)) { return (PCFieldSplitSchurFactType) ((((((((((PCFieldSplitSchurFactType)digits[3]) << PyLong_SHIFT) | (PCFieldSplitSchurFactType)digits[2]) << PyLong_SHIFT) | (PCFieldSplitSchurFactType)digits[1]) << PyLong_SHIFT) | (PCFieldSplitSchurFactType)digits[0]))); } } break; } } #endif if ((sizeof(PCFieldSplitSchurFactType) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(PCFieldSplitSchurFactType, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(PCFieldSplitSchurFactType) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(PCFieldSplitSchurFactType, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available, cannot convert large enums"); return (PCFieldSplitSchurFactType) -1; } else { PCFieldSplitSchurFactType val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (PCFieldSplitSchurFactType) -1; val = __Pyx_PyInt_As_PCFieldSplitSchurFactType(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to PCFieldSplitSchurFactType"); return (PCFieldSplitSchurFactType) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to PCFieldSplitSchurFactType"); return (PCFieldSplitSchurFactType) -1; } /* CIntFromPy */ static CYTHON_INLINE PCFieldSplitSchurPreType __Pyx_PyInt_As_PCFieldSplitSchurPreType(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PCFieldSplitSchurPreType neg_one = (PCFieldSplitSchurPreType) -1, const_zero = (PCFieldSplitSchurPreType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(PCFieldSplitSchurPreType) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(PCFieldSplitSchurPreType, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (PCFieldSplitSchurPreType) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(PCFieldSplitSchurPreType, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(PCFieldSplitSchurPreType) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCFieldSplitSchurPreType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCFieldSplitSchurPreType) >= 2 * PyLong_SHIFT)) { return (PCFieldSplitSchurPreType) (((((PCFieldSplitSchurPreType)digits[1]) << PyLong_SHIFT) | (PCFieldSplitSchurPreType)digits[0])); } } break; case 3: if ((8 * sizeof(PCFieldSplitSchurPreType) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCFieldSplitSchurPreType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCFieldSplitSchurPreType) >= 3 * PyLong_SHIFT)) { return (PCFieldSplitSchurPreType) (((((((PCFieldSplitSchurPreType)digits[2]) << PyLong_SHIFT) | (PCFieldSplitSchurPreType)digits[1]) << PyLong_SHIFT) | (PCFieldSplitSchurPreType)digits[0])); } } break; case 4: if ((8 * sizeof(PCFieldSplitSchurPreType) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCFieldSplitSchurPreType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCFieldSplitSchurPreType) >= 4 * PyLong_SHIFT)) { return (PCFieldSplitSchurPreType) (((((((((PCFieldSplitSchurPreType)digits[3]) << PyLong_SHIFT) | (PCFieldSplitSchurPreType)digits[2]) << PyLong_SHIFT) | (PCFieldSplitSchurPreType)digits[1]) << PyLong_SHIFT) | (PCFieldSplitSchurPreType)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (PCFieldSplitSchurPreType) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(PCFieldSplitSchurPreType) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(PCFieldSplitSchurPreType, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(PCFieldSplitSchurPreType) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(PCFieldSplitSchurPreType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(PCFieldSplitSchurPreType, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(PCFieldSplitSchurPreType) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCFieldSplitSchurPreType, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCFieldSplitSchurPreType) - 1 > 2 * PyLong_SHIFT)) { return (PCFieldSplitSchurPreType) (((PCFieldSplitSchurPreType)-1)*(((((PCFieldSplitSchurPreType)digits[1]) << PyLong_SHIFT) | (PCFieldSplitSchurPreType)digits[0]))); } } break; case 2: if ((8 * sizeof(PCFieldSplitSchurPreType) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCFieldSplitSchurPreType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCFieldSplitSchurPreType) - 1 > 2 * PyLong_SHIFT)) { return (PCFieldSplitSchurPreType) ((((((PCFieldSplitSchurPreType)digits[1]) << PyLong_SHIFT) | (PCFieldSplitSchurPreType)digits[0]))); } } break; case -3: if ((8 * sizeof(PCFieldSplitSchurPreType) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCFieldSplitSchurPreType, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCFieldSplitSchurPreType) - 1 > 3 * PyLong_SHIFT)) { return (PCFieldSplitSchurPreType) (((PCFieldSplitSchurPreType)-1)*(((((((PCFieldSplitSchurPreType)digits[2]) << PyLong_SHIFT) | (PCFieldSplitSchurPreType)digits[1]) << PyLong_SHIFT) | (PCFieldSplitSchurPreType)digits[0]))); } } break; case 3: if ((8 * sizeof(PCFieldSplitSchurPreType) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCFieldSplitSchurPreType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCFieldSplitSchurPreType) - 1 > 3 * PyLong_SHIFT)) { return (PCFieldSplitSchurPreType) ((((((((PCFieldSplitSchurPreType)digits[2]) << PyLong_SHIFT) | (PCFieldSplitSchurPreType)digits[1]) << PyLong_SHIFT) | (PCFieldSplitSchurPreType)digits[0]))); } } break; case -4: if ((8 * sizeof(PCFieldSplitSchurPreType) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCFieldSplitSchurPreType, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCFieldSplitSchurPreType) - 1 > 4 * PyLong_SHIFT)) { return (PCFieldSplitSchurPreType) (((PCFieldSplitSchurPreType)-1)*(((((((((PCFieldSplitSchurPreType)digits[3]) << PyLong_SHIFT) | (PCFieldSplitSchurPreType)digits[2]) << PyLong_SHIFT) | (PCFieldSplitSchurPreType)digits[1]) << PyLong_SHIFT) | (PCFieldSplitSchurPreType)digits[0]))); } } break; case 4: if ((8 * sizeof(PCFieldSplitSchurPreType) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCFieldSplitSchurPreType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCFieldSplitSchurPreType) - 1 > 4 * PyLong_SHIFT)) { return (PCFieldSplitSchurPreType) ((((((((((PCFieldSplitSchurPreType)digits[3]) << PyLong_SHIFT) | (PCFieldSplitSchurPreType)digits[2]) << PyLong_SHIFT) | (PCFieldSplitSchurPreType)digits[1]) << PyLong_SHIFT) | (PCFieldSplitSchurPreType)digits[0]))); } } break; } } #endif if ((sizeof(PCFieldSplitSchurPreType) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(PCFieldSplitSchurPreType, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(PCFieldSplitSchurPreType) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(PCFieldSplitSchurPreType, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available, cannot convert large enums"); return (PCFieldSplitSchurPreType) -1; } else { PCFieldSplitSchurPreType val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (PCFieldSplitSchurPreType) -1; val = __Pyx_PyInt_As_PCFieldSplitSchurPreType(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to PCFieldSplitSchurPreType"); return (PCFieldSplitSchurPreType) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to PCFieldSplitSchurPreType"); return (PCFieldSplitSchurPreType) -1; } /* CIntFromPy */ static CYTHON_INLINE PCMGType __Pyx_PyInt_As_PCMGType(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PCMGType neg_one = (PCMGType) -1, const_zero = (PCMGType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(PCMGType) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(PCMGType, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (PCMGType) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(PCMGType, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(PCMGType) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCMGType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCMGType) >= 2 * PyLong_SHIFT)) { return (PCMGType) (((((PCMGType)digits[1]) << PyLong_SHIFT) | (PCMGType)digits[0])); } } break; case 3: if ((8 * sizeof(PCMGType) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCMGType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCMGType) >= 3 * PyLong_SHIFT)) { return (PCMGType) (((((((PCMGType)digits[2]) << PyLong_SHIFT) | (PCMGType)digits[1]) << PyLong_SHIFT) | (PCMGType)digits[0])); } } break; case 4: if ((8 * sizeof(PCMGType) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCMGType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCMGType) >= 4 * PyLong_SHIFT)) { return (PCMGType) (((((((((PCMGType)digits[3]) << PyLong_SHIFT) | (PCMGType)digits[2]) << PyLong_SHIFT) | (PCMGType)digits[1]) << PyLong_SHIFT) | (PCMGType)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (PCMGType) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(PCMGType) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(PCMGType, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(PCMGType) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(PCMGType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(PCMGType, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(PCMGType) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCMGType, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCMGType) - 1 > 2 * PyLong_SHIFT)) { return (PCMGType) (((PCMGType)-1)*(((((PCMGType)digits[1]) << PyLong_SHIFT) | (PCMGType)digits[0]))); } } break; case 2: if ((8 * sizeof(PCMGType) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCMGType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCMGType) - 1 > 2 * PyLong_SHIFT)) { return (PCMGType) ((((((PCMGType)digits[1]) << PyLong_SHIFT) | (PCMGType)digits[0]))); } } break; case -3: if ((8 * sizeof(PCMGType) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCMGType, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCMGType) - 1 > 3 * PyLong_SHIFT)) { return (PCMGType) (((PCMGType)-1)*(((((((PCMGType)digits[2]) << PyLong_SHIFT) | (PCMGType)digits[1]) << PyLong_SHIFT) | (PCMGType)digits[0]))); } } break; case 3: if ((8 * sizeof(PCMGType) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCMGType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCMGType) - 1 > 3 * PyLong_SHIFT)) { return (PCMGType) ((((((((PCMGType)digits[2]) << PyLong_SHIFT) | (PCMGType)digits[1]) << PyLong_SHIFT) | (PCMGType)digits[0]))); } } break; case -4: if ((8 * sizeof(PCMGType) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCMGType, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCMGType) - 1 > 4 * PyLong_SHIFT)) { return (PCMGType) (((PCMGType)-1)*(((((((((PCMGType)digits[3]) << PyLong_SHIFT) | (PCMGType)digits[2]) << PyLong_SHIFT) | (PCMGType)digits[1]) << PyLong_SHIFT) | (PCMGType)digits[0]))); } } break; case 4: if ((8 * sizeof(PCMGType) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCMGType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCMGType) - 1 > 4 * PyLong_SHIFT)) { return (PCMGType) ((((((((((PCMGType)digits[3]) << PyLong_SHIFT) | (PCMGType)digits[2]) << PyLong_SHIFT) | (PCMGType)digits[1]) << PyLong_SHIFT) | (PCMGType)digits[0]))); } } break; } } #endif if ((sizeof(PCMGType) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(PCMGType, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(PCMGType) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(PCMGType, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available, cannot convert large enums"); return (PCMGType) -1; } else { PCMGType val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (PCMGType) -1; val = __Pyx_PyInt_As_PCMGType(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to PCMGType"); return (PCMGType) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to PCMGType"); return (PCMGType) -1; } /* CIntFromPy */ static CYTHON_INLINE PCMGCycleType __Pyx_PyInt_As_PCMGCycleType(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PCMGCycleType neg_one = (PCMGCycleType) -1, const_zero = (PCMGCycleType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(PCMGCycleType) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(PCMGCycleType, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (PCMGCycleType) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(PCMGCycleType, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(PCMGCycleType) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCMGCycleType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCMGCycleType) >= 2 * PyLong_SHIFT)) { return (PCMGCycleType) (((((PCMGCycleType)digits[1]) << PyLong_SHIFT) | (PCMGCycleType)digits[0])); } } break; case 3: if ((8 * sizeof(PCMGCycleType) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCMGCycleType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCMGCycleType) >= 3 * PyLong_SHIFT)) { return (PCMGCycleType) (((((((PCMGCycleType)digits[2]) << PyLong_SHIFT) | (PCMGCycleType)digits[1]) << PyLong_SHIFT) | (PCMGCycleType)digits[0])); } } break; case 4: if ((8 * sizeof(PCMGCycleType) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCMGCycleType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCMGCycleType) >= 4 * PyLong_SHIFT)) { return (PCMGCycleType) (((((((((PCMGCycleType)digits[3]) << PyLong_SHIFT) | (PCMGCycleType)digits[2]) << PyLong_SHIFT) | (PCMGCycleType)digits[1]) << PyLong_SHIFT) | (PCMGCycleType)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (PCMGCycleType) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(PCMGCycleType) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(PCMGCycleType, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(PCMGCycleType) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(PCMGCycleType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(PCMGCycleType, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(PCMGCycleType) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCMGCycleType, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCMGCycleType) - 1 > 2 * PyLong_SHIFT)) { return (PCMGCycleType) (((PCMGCycleType)-1)*(((((PCMGCycleType)digits[1]) << PyLong_SHIFT) | (PCMGCycleType)digits[0]))); } } break; case 2: if ((8 * sizeof(PCMGCycleType) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCMGCycleType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCMGCycleType) - 1 > 2 * PyLong_SHIFT)) { return (PCMGCycleType) ((((((PCMGCycleType)digits[1]) << PyLong_SHIFT) | (PCMGCycleType)digits[0]))); } } break; case -3: if ((8 * sizeof(PCMGCycleType) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCMGCycleType, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCMGCycleType) - 1 > 3 * PyLong_SHIFT)) { return (PCMGCycleType) (((PCMGCycleType)-1)*(((((((PCMGCycleType)digits[2]) << PyLong_SHIFT) | (PCMGCycleType)digits[1]) << PyLong_SHIFT) | (PCMGCycleType)digits[0]))); } } break; case 3: if ((8 * sizeof(PCMGCycleType) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCMGCycleType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCMGCycleType) - 1 > 3 * PyLong_SHIFT)) { return (PCMGCycleType) ((((((((PCMGCycleType)digits[2]) << PyLong_SHIFT) | (PCMGCycleType)digits[1]) << PyLong_SHIFT) | (PCMGCycleType)digits[0]))); } } break; case -4: if ((8 * sizeof(PCMGCycleType) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCMGCycleType, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCMGCycleType) - 1 > 4 * PyLong_SHIFT)) { return (PCMGCycleType) (((PCMGCycleType)-1)*(((((((((PCMGCycleType)digits[3]) << PyLong_SHIFT) | (PCMGCycleType)digits[2]) << PyLong_SHIFT) | (PCMGCycleType)digits[1]) << PyLong_SHIFT) | (PCMGCycleType)digits[0]))); } } break; case 4: if ((8 * sizeof(PCMGCycleType) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCMGCycleType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCMGCycleType) - 1 > 4 * PyLong_SHIFT)) { return (PCMGCycleType) ((((((((((PCMGCycleType)digits[3]) << PyLong_SHIFT) | (PCMGCycleType)digits[2]) << PyLong_SHIFT) | (PCMGCycleType)digits[1]) << PyLong_SHIFT) | (PCMGCycleType)digits[0]))); } } break; } } #endif if ((sizeof(PCMGCycleType) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(PCMGCycleType, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(PCMGCycleType) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(PCMGCycleType, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available, cannot convert large enums"); return (PCMGCycleType) -1; } else { PCMGCycleType val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (PCMGCycleType) -1; val = __Pyx_PyInt_As_PCMGCycleType(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to PCMGCycleType"); return (PCMGCycleType) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to PCMGCycleType"); return (PCMGCycleType) -1; } /* CIntFromPy */ static CYTHON_INLINE PCPatchConstructType __Pyx_PyInt_As_PCPatchConstructType(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PCPatchConstructType neg_one = (PCPatchConstructType) -1, const_zero = (PCPatchConstructType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(PCPatchConstructType) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(PCPatchConstructType, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (PCPatchConstructType) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(PCPatchConstructType, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(PCPatchConstructType) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCPatchConstructType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCPatchConstructType) >= 2 * PyLong_SHIFT)) { return (PCPatchConstructType) (((((PCPatchConstructType)digits[1]) << PyLong_SHIFT) | (PCPatchConstructType)digits[0])); } } break; case 3: if ((8 * sizeof(PCPatchConstructType) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCPatchConstructType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCPatchConstructType) >= 3 * PyLong_SHIFT)) { return (PCPatchConstructType) (((((((PCPatchConstructType)digits[2]) << PyLong_SHIFT) | (PCPatchConstructType)digits[1]) << PyLong_SHIFT) | (PCPatchConstructType)digits[0])); } } break; case 4: if ((8 * sizeof(PCPatchConstructType) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCPatchConstructType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCPatchConstructType) >= 4 * PyLong_SHIFT)) { return (PCPatchConstructType) (((((((((PCPatchConstructType)digits[3]) << PyLong_SHIFT) | (PCPatchConstructType)digits[2]) << PyLong_SHIFT) | (PCPatchConstructType)digits[1]) << PyLong_SHIFT) | (PCPatchConstructType)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (PCPatchConstructType) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(PCPatchConstructType) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(PCPatchConstructType, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(PCPatchConstructType) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(PCPatchConstructType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(PCPatchConstructType, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(PCPatchConstructType) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCPatchConstructType, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCPatchConstructType) - 1 > 2 * PyLong_SHIFT)) { return (PCPatchConstructType) (((PCPatchConstructType)-1)*(((((PCPatchConstructType)digits[1]) << PyLong_SHIFT) | (PCPatchConstructType)digits[0]))); } } break; case 2: if ((8 * sizeof(PCPatchConstructType) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCPatchConstructType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCPatchConstructType) - 1 > 2 * PyLong_SHIFT)) { return (PCPatchConstructType) ((((((PCPatchConstructType)digits[1]) << PyLong_SHIFT) | (PCPatchConstructType)digits[0]))); } } break; case -3: if ((8 * sizeof(PCPatchConstructType) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCPatchConstructType, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCPatchConstructType) - 1 > 3 * PyLong_SHIFT)) { return (PCPatchConstructType) (((PCPatchConstructType)-1)*(((((((PCPatchConstructType)digits[2]) << PyLong_SHIFT) | (PCPatchConstructType)digits[1]) << PyLong_SHIFT) | (PCPatchConstructType)digits[0]))); } } break; case 3: if ((8 * sizeof(PCPatchConstructType) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCPatchConstructType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCPatchConstructType) - 1 > 3 * PyLong_SHIFT)) { return (PCPatchConstructType) ((((((((PCPatchConstructType)digits[2]) << PyLong_SHIFT) | (PCPatchConstructType)digits[1]) << PyLong_SHIFT) | (PCPatchConstructType)digits[0]))); } } break; case -4: if ((8 * sizeof(PCPatchConstructType) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCPatchConstructType, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCPatchConstructType) - 1 > 4 * PyLong_SHIFT)) { return (PCPatchConstructType) (((PCPatchConstructType)-1)*(((((((((PCPatchConstructType)digits[3]) << PyLong_SHIFT) | (PCPatchConstructType)digits[2]) << PyLong_SHIFT) | (PCPatchConstructType)digits[1]) << PyLong_SHIFT) | (PCPatchConstructType)digits[0]))); } } break; case 4: if ((8 * sizeof(PCPatchConstructType) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCPatchConstructType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCPatchConstructType) - 1 > 4 * PyLong_SHIFT)) { return (PCPatchConstructType) ((((((((((PCPatchConstructType)digits[3]) << PyLong_SHIFT) | (PCPatchConstructType)digits[2]) << PyLong_SHIFT) | (PCPatchConstructType)digits[1]) << PyLong_SHIFT) | (PCPatchConstructType)digits[0]))); } } break; } } #endif if ((sizeof(PCPatchConstructType) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(PCPatchConstructType, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(PCPatchConstructType) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(PCPatchConstructType, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available, cannot convert large enums"); return (PCPatchConstructType) -1; } else { PCPatchConstructType val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (PCPatchConstructType) -1; val = __Pyx_PyInt_As_PCPatchConstructType(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to PCPatchConstructType"); return (PCPatchConstructType) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to PCPatchConstructType"); return (PCPatchConstructType) -1; } /* CIntFromPy */ static CYTHON_INLINE PCHPDDMCoarseCorrectionType __Pyx_PyInt_As_PCHPDDMCoarseCorrectionType(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PCHPDDMCoarseCorrectionType neg_one = (PCHPDDMCoarseCorrectionType) -1, const_zero = (PCHPDDMCoarseCorrectionType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(PCHPDDMCoarseCorrectionType) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(PCHPDDMCoarseCorrectionType, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (PCHPDDMCoarseCorrectionType) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(PCHPDDMCoarseCorrectionType, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(PCHPDDMCoarseCorrectionType) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCHPDDMCoarseCorrectionType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCHPDDMCoarseCorrectionType) >= 2 * PyLong_SHIFT)) { return (PCHPDDMCoarseCorrectionType) (((((PCHPDDMCoarseCorrectionType)digits[1]) << PyLong_SHIFT) | (PCHPDDMCoarseCorrectionType)digits[0])); } } break; case 3: if ((8 * sizeof(PCHPDDMCoarseCorrectionType) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCHPDDMCoarseCorrectionType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCHPDDMCoarseCorrectionType) >= 3 * PyLong_SHIFT)) { return (PCHPDDMCoarseCorrectionType) (((((((PCHPDDMCoarseCorrectionType)digits[2]) << PyLong_SHIFT) | (PCHPDDMCoarseCorrectionType)digits[1]) << PyLong_SHIFT) | (PCHPDDMCoarseCorrectionType)digits[0])); } } break; case 4: if ((8 * sizeof(PCHPDDMCoarseCorrectionType) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCHPDDMCoarseCorrectionType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCHPDDMCoarseCorrectionType) >= 4 * PyLong_SHIFT)) { return (PCHPDDMCoarseCorrectionType) (((((((((PCHPDDMCoarseCorrectionType)digits[3]) << PyLong_SHIFT) | (PCHPDDMCoarseCorrectionType)digits[2]) << PyLong_SHIFT) | (PCHPDDMCoarseCorrectionType)digits[1]) << PyLong_SHIFT) | (PCHPDDMCoarseCorrectionType)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (PCHPDDMCoarseCorrectionType) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(PCHPDDMCoarseCorrectionType) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(PCHPDDMCoarseCorrectionType, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(PCHPDDMCoarseCorrectionType) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(PCHPDDMCoarseCorrectionType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(PCHPDDMCoarseCorrectionType, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(PCHPDDMCoarseCorrectionType) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCHPDDMCoarseCorrectionType, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCHPDDMCoarseCorrectionType) - 1 > 2 * PyLong_SHIFT)) { return (PCHPDDMCoarseCorrectionType) (((PCHPDDMCoarseCorrectionType)-1)*(((((PCHPDDMCoarseCorrectionType)digits[1]) << PyLong_SHIFT) | (PCHPDDMCoarseCorrectionType)digits[0]))); } } break; case 2: if ((8 * sizeof(PCHPDDMCoarseCorrectionType) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCHPDDMCoarseCorrectionType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCHPDDMCoarseCorrectionType) - 1 > 2 * PyLong_SHIFT)) { return (PCHPDDMCoarseCorrectionType) ((((((PCHPDDMCoarseCorrectionType)digits[1]) << PyLong_SHIFT) | (PCHPDDMCoarseCorrectionType)digits[0]))); } } break; case -3: if ((8 * sizeof(PCHPDDMCoarseCorrectionType) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCHPDDMCoarseCorrectionType, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCHPDDMCoarseCorrectionType) - 1 > 3 * PyLong_SHIFT)) { return (PCHPDDMCoarseCorrectionType) (((PCHPDDMCoarseCorrectionType)-1)*(((((((PCHPDDMCoarseCorrectionType)digits[2]) << PyLong_SHIFT) | (PCHPDDMCoarseCorrectionType)digits[1]) << PyLong_SHIFT) | (PCHPDDMCoarseCorrectionType)digits[0]))); } } break; case 3: if ((8 * sizeof(PCHPDDMCoarseCorrectionType) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCHPDDMCoarseCorrectionType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCHPDDMCoarseCorrectionType) - 1 > 3 * PyLong_SHIFT)) { return (PCHPDDMCoarseCorrectionType) ((((((((PCHPDDMCoarseCorrectionType)digits[2]) << PyLong_SHIFT) | (PCHPDDMCoarseCorrectionType)digits[1]) << PyLong_SHIFT) | (PCHPDDMCoarseCorrectionType)digits[0]))); } } break; case -4: if ((8 * sizeof(PCHPDDMCoarseCorrectionType) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCHPDDMCoarseCorrectionType, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCHPDDMCoarseCorrectionType) - 1 > 4 * PyLong_SHIFT)) { return (PCHPDDMCoarseCorrectionType) (((PCHPDDMCoarseCorrectionType)-1)*(((((((((PCHPDDMCoarseCorrectionType)digits[3]) << PyLong_SHIFT) | (PCHPDDMCoarseCorrectionType)digits[2]) << PyLong_SHIFT) | (PCHPDDMCoarseCorrectionType)digits[1]) << PyLong_SHIFT) | (PCHPDDMCoarseCorrectionType)digits[0]))); } } break; case 4: if ((8 * sizeof(PCHPDDMCoarseCorrectionType) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCHPDDMCoarseCorrectionType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCHPDDMCoarseCorrectionType) - 1 > 4 * PyLong_SHIFT)) { return (PCHPDDMCoarseCorrectionType) ((((((((((PCHPDDMCoarseCorrectionType)digits[3]) << PyLong_SHIFT) | (PCHPDDMCoarseCorrectionType)digits[2]) << PyLong_SHIFT) | (PCHPDDMCoarseCorrectionType)digits[1]) << PyLong_SHIFT) | (PCHPDDMCoarseCorrectionType)digits[0]))); } } break; } } #endif if ((sizeof(PCHPDDMCoarseCorrectionType) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(PCHPDDMCoarseCorrectionType, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(PCHPDDMCoarseCorrectionType) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(PCHPDDMCoarseCorrectionType, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available, cannot convert large enums"); return (PCHPDDMCoarseCorrectionType) -1; } else { PCHPDDMCoarseCorrectionType val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (PCHPDDMCoarseCorrectionType) -1; val = __Pyx_PyInt_As_PCHPDDMCoarseCorrectionType(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to PCHPDDMCoarseCorrectionType"); return (PCHPDDMCoarseCorrectionType) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to PCHPDDMCoarseCorrectionType"); return (PCHPDDMCoarseCorrectionType) -1; } /* CIntFromPy */ static CYTHON_INLINE PCDeflationSpaceType __Pyx_PyInt_As_PCDeflationSpaceType(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PCDeflationSpaceType neg_one = (PCDeflationSpaceType) -1, const_zero = (PCDeflationSpaceType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(PCDeflationSpaceType) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(PCDeflationSpaceType, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (PCDeflationSpaceType) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(PCDeflationSpaceType, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(PCDeflationSpaceType) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCDeflationSpaceType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCDeflationSpaceType) >= 2 * PyLong_SHIFT)) { return (PCDeflationSpaceType) (((((PCDeflationSpaceType)digits[1]) << PyLong_SHIFT) | (PCDeflationSpaceType)digits[0])); } } break; case 3: if ((8 * sizeof(PCDeflationSpaceType) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCDeflationSpaceType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCDeflationSpaceType) >= 3 * PyLong_SHIFT)) { return (PCDeflationSpaceType) (((((((PCDeflationSpaceType)digits[2]) << PyLong_SHIFT) | (PCDeflationSpaceType)digits[1]) << PyLong_SHIFT) | (PCDeflationSpaceType)digits[0])); } } break; case 4: if ((8 * sizeof(PCDeflationSpaceType) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCDeflationSpaceType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCDeflationSpaceType) >= 4 * PyLong_SHIFT)) { return (PCDeflationSpaceType) (((((((((PCDeflationSpaceType)digits[3]) << PyLong_SHIFT) | (PCDeflationSpaceType)digits[2]) << PyLong_SHIFT) | (PCDeflationSpaceType)digits[1]) << PyLong_SHIFT) | (PCDeflationSpaceType)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (PCDeflationSpaceType) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(PCDeflationSpaceType) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(PCDeflationSpaceType, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(PCDeflationSpaceType) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(PCDeflationSpaceType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(PCDeflationSpaceType, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(PCDeflationSpaceType) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCDeflationSpaceType, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCDeflationSpaceType) - 1 > 2 * PyLong_SHIFT)) { return (PCDeflationSpaceType) (((PCDeflationSpaceType)-1)*(((((PCDeflationSpaceType)digits[1]) << PyLong_SHIFT) | (PCDeflationSpaceType)digits[0]))); } } break; case 2: if ((8 * sizeof(PCDeflationSpaceType) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCDeflationSpaceType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCDeflationSpaceType) - 1 > 2 * PyLong_SHIFT)) { return (PCDeflationSpaceType) ((((((PCDeflationSpaceType)digits[1]) << PyLong_SHIFT) | (PCDeflationSpaceType)digits[0]))); } } break; case -3: if ((8 * sizeof(PCDeflationSpaceType) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCDeflationSpaceType, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCDeflationSpaceType) - 1 > 3 * PyLong_SHIFT)) { return (PCDeflationSpaceType) (((PCDeflationSpaceType)-1)*(((((((PCDeflationSpaceType)digits[2]) << PyLong_SHIFT) | (PCDeflationSpaceType)digits[1]) << PyLong_SHIFT) | (PCDeflationSpaceType)digits[0]))); } } break; case 3: if ((8 * sizeof(PCDeflationSpaceType) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCDeflationSpaceType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCDeflationSpaceType) - 1 > 3 * PyLong_SHIFT)) { return (PCDeflationSpaceType) ((((((((PCDeflationSpaceType)digits[2]) << PyLong_SHIFT) | (PCDeflationSpaceType)digits[1]) << PyLong_SHIFT) | (PCDeflationSpaceType)digits[0]))); } } break; case -4: if ((8 * sizeof(PCDeflationSpaceType) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCDeflationSpaceType, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCDeflationSpaceType) - 1 > 4 * PyLong_SHIFT)) { return (PCDeflationSpaceType) (((PCDeflationSpaceType)-1)*(((((((((PCDeflationSpaceType)digits[3]) << PyLong_SHIFT) | (PCDeflationSpaceType)digits[2]) << PyLong_SHIFT) | (PCDeflationSpaceType)digits[1]) << PyLong_SHIFT) | (PCDeflationSpaceType)digits[0]))); } } break; case 4: if ((8 * sizeof(PCDeflationSpaceType) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCDeflationSpaceType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCDeflationSpaceType) - 1 > 4 * PyLong_SHIFT)) { return (PCDeflationSpaceType) ((((((((((PCDeflationSpaceType)digits[3]) << PyLong_SHIFT) | (PCDeflationSpaceType)digits[2]) << PyLong_SHIFT) | (PCDeflationSpaceType)digits[1]) << PyLong_SHIFT) | (PCDeflationSpaceType)digits[0]))); } } break; } } #endif if ((sizeof(PCDeflationSpaceType) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(PCDeflationSpaceType, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(PCDeflationSpaceType) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(PCDeflationSpaceType, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available, cannot convert large enums"); return (PCDeflationSpaceType) -1; } else { PCDeflationSpaceType val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (PCDeflationSpaceType) -1; val = __Pyx_PyInt_As_PCDeflationSpaceType(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to PCDeflationSpaceType"); return (PCDeflationSpaceType) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to PCDeflationSpaceType"); return (PCDeflationSpaceType) -1; } /* CIntFromPy */ static CYTHON_INLINE PCSide __Pyx_PyInt_As_PCSide(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PCSide neg_one = (PCSide) -1, const_zero = (PCSide) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(PCSide) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(PCSide, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (PCSide) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(PCSide, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(PCSide) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCSide, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCSide) >= 2 * PyLong_SHIFT)) { return (PCSide) (((((PCSide)digits[1]) << PyLong_SHIFT) | (PCSide)digits[0])); } } break; case 3: if ((8 * sizeof(PCSide) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCSide, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCSide) >= 3 * PyLong_SHIFT)) { return (PCSide) (((((((PCSide)digits[2]) << PyLong_SHIFT) | (PCSide)digits[1]) << PyLong_SHIFT) | (PCSide)digits[0])); } } break; case 4: if ((8 * sizeof(PCSide) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCSide, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCSide) >= 4 * PyLong_SHIFT)) { return (PCSide) (((((((((PCSide)digits[3]) << PyLong_SHIFT) | (PCSide)digits[2]) << PyLong_SHIFT) | (PCSide)digits[1]) << PyLong_SHIFT) | (PCSide)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (PCSide) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(PCSide) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(PCSide, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(PCSide) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(PCSide, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(PCSide, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(PCSide) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCSide, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCSide) - 1 > 2 * PyLong_SHIFT)) { return (PCSide) (((PCSide)-1)*(((((PCSide)digits[1]) << PyLong_SHIFT) | (PCSide)digits[0]))); } } break; case 2: if ((8 * sizeof(PCSide) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCSide, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCSide) - 1 > 2 * PyLong_SHIFT)) { return (PCSide) ((((((PCSide)digits[1]) << PyLong_SHIFT) | (PCSide)digits[0]))); } } break; case -3: if ((8 * sizeof(PCSide) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCSide, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCSide) - 1 > 3 * PyLong_SHIFT)) { return (PCSide) (((PCSide)-1)*(((((((PCSide)digits[2]) << PyLong_SHIFT) | (PCSide)digits[1]) << PyLong_SHIFT) | (PCSide)digits[0]))); } } break; case 3: if ((8 * sizeof(PCSide) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCSide, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCSide) - 1 > 3 * PyLong_SHIFT)) { return (PCSide) ((((((((PCSide)digits[2]) << PyLong_SHIFT) | (PCSide)digits[1]) << PyLong_SHIFT) | (PCSide)digits[0]))); } } break; case -4: if ((8 * sizeof(PCSide) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCSide, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCSide) - 1 > 4 * PyLong_SHIFT)) { return (PCSide) (((PCSide)-1)*(((((((((PCSide)digits[3]) << PyLong_SHIFT) | (PCSide)digits[2]) << PyLong_SHIFT) | (PCSide)digits[1]) << PyLong_SHIFT) | (PCSide)digits[0]))); } } break; case 4: if ((8 * sizeof(PCSide) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PCSide, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PCSide) - 1 > 4 * PyLong_SHIFT)) { return (PCSide) ((((((((((PCSide)digits[3]) << PyLong_SHIFT) | (PCSide)digits[2]) << PyLong_SHIFT) | (PCSide)digits[1]) << PyLong_SHIFT) | (PCSide)digits[0]))); } } break; } } #endif if ((sizeof(PCSide) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(PCSide, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(PCSide) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(PCSide, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available, cannot convert large enums"); return (PCSide) -1; } else { PCSide val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (PCSide) -1; val = __Pyx_PyInt_As_PCSide(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to PCSide"); return (PCSide) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to PCSide"); return (PCSide) -1; } /* CIntFromPy */ static CYTHON_INLINE KSPNormType __Pyx_PyInt_As_KSPNormType(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const KSPNormType neg_one = (KSPNormType) -1, const_zero = (KSPNormType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(KSPNormType) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(KSPNormType, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (KSPNormType) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(KSPNormType, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(KSPNormType) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(KSPNormType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(KSPNormType) >= 2 * PyLong_SHIFT)) { return (KSPNormType) (((((KSPNormType)digits[1]) << PyLong_SHIFT) | (KSPNormType)digits[0])); } } break; case 3: if ((8 * sizeof(KSPNormType) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(KSPNormType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(KSPNormType) >= 3 * PyLong_SHIFT)) { return (KSPNormType) (((((((KSPNormType)digits[2]) << PyLong_SHIFT) | (KSPNormType)digits[1]) << PyLong_SHIFT) | (KSPNormType)digits[0])); } } break; case 4: if ((8 * sizeof(KSPNormType) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(KSPNormType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(KSPNormType) >= 4 * PyLong_SHIFT)) { return (KSPNormType) (((((((((KSPNormType)digits[3]) << PyLong_SHIFT) | (KSPNormType)digits[2]) << PyLong_SHIFT) | (KSPNormType)digits[1]) << PyLong_SHIFT) | (KSPNormType)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (KSPNormType) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(KSPNormType) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(KSPNormType, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(KSPNormType) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(KSPNormType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(KSPNormType, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(KSPNormType) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(KSPNormType, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(KSPNormType) - 1 > 2 * PyLong_SHIFT)) { return (KSPNormType) (((KSPNormType)-1)*(((((KSPNormType)digits[1]) << PyLong_SHIFT) | (KSPNormType)digits[0]))); } } break; case 2: if ((8 * sizeof(KSPNormType) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(KSPNormType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(KSPNormType) - 1 > 2 * PyLong_SHIFT)) { return (KSPNormType) ((((((KSPNormType)digits[1]) << PyLong_SHIFT) | (KSPNormType)digits[0]))); } } break; case -3: if ((8 * sizeof(KSPNormType) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(KSPNormType, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(KSPNormType) - 1 > 3 * PyLong_SHIFT)) { return (KSPNormType) (((KSPNormType)-1)*(((((((KSPNormType)digits[2]) << PyLong_SHIFT) | (KSPNormType)digits[1]) << PyLong_SHIFT) | (KSPNormType)digits[0]))); } } break; case 3: if ((8 * sizeof(KSPNormType) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(KSPNormType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(KSPNormType) - 1 > 3 * PyLong_SHIFT)) { return (KSPNormType) ((((((((KSPNormType)digits[2]) << PyLong_SHIFT) | (KSPNormType)digits[1]) << PyLong_SHIFT) | (KSPNormType)digits[0]))); } } break; case -4: if ((8 * sizeof(KSPNormType) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(KSPNormType, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(KSPNormType) - 1 > 4 * PyLong_SHIFT)) { return (KSPNormType) (((KSPNormType)-1)*(((((((((KSPNormType)digits[3]) << PyLong_SHIFT) | (KSPNormType)digits[2]) << PyLong_SHIFT) | (KSPNormType)digits[1]) << PyLong_SHIFT) | (KSPNormType)digits[0]))); } } break; case 4: if ((8 * sizeof(KSPNormType) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(KSPNormType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(KSPNormType) - 1 > 4 * PyLong_SHIFT)) { return (KSPNormType) ((((((((((KSPNormType)digits[3]) << PyLong_SHIFT) | (KSPNormType)digits[2]) << PyLong_SHIFT) | (KSPNormType)digits[1]) << PyLong_SHIFT) | (KSPNormType)digits[0]))); } } break; } } #endif if ((sizeof(KSPNormType) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(KSPNormType, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(KSPNormType) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(KSPNormType, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available, cannot convert large enums"); return (KSPNormType) -1; } else { KSPNormType val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (KSPNormType) -1; val = __Pyx_PyInt_As_KSPNormType(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to KSPNormType"); return (KSPNormType) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to KSPNormType"); return (KSPNormType) -1; } /* CIntFromPy */ static CYTHON_INLINE KSPHPDDMType __Pyx_PyInt_As_KSPHPDDMType(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const KSPHPDDMType neg_one = (KSPHPDDMType) -1, const_zero = (KSPHPDDMType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(KSPHPDDMType) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(KSPHPDDMType, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (KSPHPDDMType) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(KSPHPDDMType, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(KSPHPDDMType) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(KSPHPDDMType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(KSPHPDDMType) >= 2 * PyLong_SHIFT)) { return (KSPHPDDMType) (((((KSPHPDDMType)digits[1]) << PyLong_SHIFT) | (KSPHPDDMType)digits[0])); } } break; case 3: if ((8 * sizeof(KSPHPDDMType) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(KSPHPDDMType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(KSPHPDDMType) >= 3 * PyLong_SHIFT)) { return (KSPHPDDMType) (((((((KSPHPDDMType)digits[2]) << PyLong_SHIFT) | (KSPHPDDMType)digits[1]) << PyLong_SHIFT) | (KSPHPDDMType)digits[0])); } } break; case 4: if ((8 * sizeof(KSPHPDDMType) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(KSPHPDDMType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(KSPHPDDMType) >= 4 * PyLong_SHIFT)) { return (KSPHPDDMType) (((((((((KSPHPDDMType)digits[3]) << PyLong_SHIFT) | (KSPHPDDMType)digits[2]) << PyLong_SHIFT) | (KSPHPDDMType)digits[1]) << PyLong_SHIFT) | (KSPHPDDMType)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (KSPHPDDMType) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(KSPHPDDMType) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(KSPHPDDMType, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(KSPHPDDMType) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(KSPHPDDMType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(KSPHPDDMType, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(KSPHPDDMType) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(KSPHPDDMType, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(KSPHPDDMType) - 1 > 2 * PyLong_SHIFT)) { return (KSPHPDDMType) (((KSPHPDDMType)-1)*(((((KSPHPDDMType)digits[1]) << PyLong_SHIFT) | (KSPHPDDMType)digits[0]))); } } break; case 2: if ((8 * sizeof(KSPHPDDMType) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(KSPHPDDMType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(KSPHPDDMType) - 1 > 2 * PyLong_SHIFT)) { return (KSPHPDDMType) ((((((KSPHPDDMType)digits[1]) << PyLong_SHIFT) | (KSPHPDDMType)digits[0]))); } } break; case -3: if ((8 * sizeof(KSPHPDDMType) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(KSPHPDDMType, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(KSPHPDDMType) - 1 > 3 * PyLong_SHIFT)) { return (KSPHPDDMType) (((KSPHPDDMType)-1)*(((((((KSPHPDDMType)digits[2]) << PyLong_SHIFT) | (KSPHPDDMType)digits[1]) << PyLong_SHIFT) | (KSPHPDDMType)digits[0]))); } } break; case 3: if ((8 * sizeof(KSPHPDDMType) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(KSPHPDDMType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(KSPHPDDMType) - 1 > 3 * PyLong_SHIFT)) { return (KSPHPDDMType) ((((((((KSPHPDDMType)digits[2]) << PyLong_SHIFT) | (KSPHPDDMType)digits[1]) << PyLong_SHIFT) | (KSPHPDDMType)digits[0]))); } } break; case -4: if ((8 * sizeof(KSPHPDDMType) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(KSPHPDDMType, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(KSPHPDDMType) - 1 > 4 * PyLong_SHIFT)) { return (KSPHPDDMType) (((KSPHPDDMType)-1)*(((((((((KSPHPDDMType)digits[3]) << PyLong_SHIFT) | (KSPHPDDMType)digits[2]) << PyLong_SHIFT) | (KSPHPDDMType)digits[1]) << PyLong_SHIFT) | (KSPHPDDMType)digits[0]))); } } break; case 4: if ((8 * sizeof(KSPHPDDMType) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(KSPHPDDMType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(KSPHPDDMType) - 1 > 4 * PyLong_SHIFT)) { return (KSPHPDDMType) ((((((((((KSPHPDDMType)digits[3]) << PyLong_SHIFT) | (KSPHPDDMType)digits[2]) << PyLong_SHIFT) | (KSPHPDDMType)digits[1]) << PyLong_SHIFT) | (KSPHPDDMType)digits[0]))); } } break; } } #endif if ((sizeof(KSPHPDDMType) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(KSPHPDDMType, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(KSPHPDDMType) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(KSPHPDDMType, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available, cannot convert large enums"); return (KSPHPDDMType) -1; } else { KSPHPDDMType val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (KSPHPDDMType) -1; val = __Pyx_PyInt_As_KSPHPDDMType(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to KSPHPDDMType"); return (KSPHPDDMType) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to KSPHPDDMType"); return (KSPHPDDMType) -1; } /* CIntFromPy */ static CYTHON_INLINE SNESNormSchedule __Pyx_PyInt_As_SNESNormSchedule(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const SNESNormSchedule neg_one = (SNESNormSchedule) -1, const_zero = (SNESNormSchedule) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(SNESNormSchedule) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(SNESNormSchedule, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (SNESNormSchedule) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(SNESNormSchedule, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(SNESNormSchedule) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SNESNormSchedule, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SNESNormSchedule) >= 2 * PyLong_SHIFT)) { return (SNESNormSchedule) (((((SNESNormSchedule)digits[1]) << PyLong_SHIFT) | (SNESNormSchedule)digits[0])); } } break; case 3: if ((8 * sizeof(SNESNormSchedule) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SNESNormSchedule, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SNESNormSchedule) >= 3 * PyLong_SHIFT)) { return (SNESNormSchedule) (((((((SNESNormSchedule)digits[2]) << PyLong_SHIFT) | (SNESNormSchedule)digits[1]) << PyLong_SHIFT) | (SNESNormSchedule)digits[0])); } } break; case 4: if ((8 * sizeof(SNESNormSchedule) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SNESNormSchedule, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SNESNormSchedule) >= 4 * PyLong_SHIFT)) { return (SNESNormSchedule) (((((((((SNESNormSchedule)digits[3]) << PyLong_SHIFT) | (SNESNormSchedule)digits[2]) << PyLong_SHIFT) | (SNESNormSchedule)digits[1]) << PyLong_SHIFT) | (SNESNormSchedule)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (SNESNormSchedule) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(SNESNormSchedule) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(SNESNormSchedule, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(SNESNormSchedule) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(SNESNormSchedule, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(SNESNormSchedule, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(SNESNormSchedule) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SNESNormSchedule, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SNESNormSchedule) - 1 > 2 * PyLong_SHIFT)) { return (SNESNormSchedule) (((SNESNormSchedule)-1)*(((((SNESNormSchedule)digits[1]) << PyLong_SHIFT) | (SNESNormSchedule)digits[0]))); } } break; case 2: if ((8 * sizeof(SNESNormSchedule) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SNESNormSchedule, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SNESNormSchedule) - 1 > 2 * PyLong_SHIFT)) { return (SNESNormSchedule) ((((((SNESNormSchedule)digits[1]) << PyLong_SHIFT) | (SNESNormSchedule)digits[0]))); } } break; case -3: if ((8 * sizeof(SNESNormSchedule) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SNESNormSchedule, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SNESNormSchedule) - 1 > 3 * PyLong_SHIFT)) { return (SNESNormSchedule) (((SNESNormSchedule)-1)*(((((((SNESNormSchedule)digits[2]) << PyLong_SHIFT) | (SNESNormSchedule)digits[1]) << PyLong_SHIFT) | (SNESNormSchedule)digits[0]))); } } break; case 3: if ((8 * sizeof(SNESNormSchedule) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SNESNormSchedule, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SNESNormSchedule) - 1 > 3 * PyLong_SHIFT)) { return (SNESNormSchedule) ((((((((SNESNormSchedule)digits[2]) << PyLong_SHIFT) | (SNESNormSchedule)digits[1]) << PyLong_SHIFT) | (SNESNormSchedule)digits[0]))); } } break; case -4: if ((8 * sizeof(SNESNormSchedule) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SNESNormSchedule, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SNESNormSchedule) - 1 > 4 * PyLong_SHIFT)) { return (SNESNormSchedule) (((SNESNormSchedule)-1)*(((((((((SNESNormSchedule)digits[3]) << PyLong_SHIFT) | (SNESNormSchedule)digits[2]) << PyLong_SHIFT) | (SNESNormSchedule)digits[1]) << PyLong_SHIFT) | (SNESNormSchedule)digits[0]))); } } break; case 4: if ((8 * sizeof(SNESNormSchedule) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SNESNormSchedule, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SNESNormSchedule) - 1 > 4 * PyLong_SHIFT)) { return (SNESNormSchedule) ((((((((((SNESNormSchedule)digits[3]) << PyLong_SHIFT) | (SNESNormSchedule)digits[2]) << PyLong_SHIFT) | (SNESNormSchedule)digits[1]) << PyLong_SHIFT) | (SNESNormSchedule)digits[0]))); } } break; } } #endif if ((sizeof(SNESNormSchedule) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(SNESNormSchedule, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(SNESNormSchedule) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(SNESNormSchedule, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available, cannot convert large enums"); return (SNESNormSchedule) -1; } else { SNESNormSchedule val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (SNESNormSchedule) -1; val = __Pyx_PyInt_As_SNESNormSchedule(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to SNESNormSchedule"); return (SNESNormSchedule) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to SNESNormSchedule"); return (SNESNormSchedule) -1; } /* CIntFromPy */ static CYTHON_INLINE TSProblemType __Pyx_PyInt_As_TSProblemType(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const TSProblemType neg_one = (TSProblemType) -1, const_zero = (TSProblemType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(TSProblemType) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(TSProblemType, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (TSProblemType) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(TSProblemType, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(TSProblemType) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(TSProblemType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(TSProblemType) >= 2 * PyLong_SHIFT)) { return (TSProblemType) (((((TSProblemType)digits[1]) << PyLong_SHIFT) | (TSProblemType)digits[0])); } } break; case 3: if ((8 * sizeof(TSProblemType) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(TSProblemType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(TSProblemType) >= 3 * PyLong_SHIFT)) { return (TSProblemType) (((((((TSProblemType)digits[2]) << PyLong_SHIFT) | (TSProblemType)digits[1]) << PyLong_SHIFT) | (TSProblemType)digits[0])); } } break; case 4: if ((8 * sizeof(TSProblemType) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(TSProblemType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(TSProblemType) >= 4 * PyLong_SHIFT)) { return (TSProblemType) (((((((((TSProblemType)digits[3]) << PyLong_SHIFT) | (TSProblemType)digits[2]) << PyLong_SHIFT) | (TSProblemType)digits[1]) << PyLong_SHIFT) | (TSProblemType)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (TSProblemType) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(TSProblemType) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(TSProblemType, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(TSProblemType) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(TSProblemType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(TSProblemType, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(TSProblemType) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(TSProblemType, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(TSProblemType) - 1 > 2 * PyLong_SHIFT)) { return (TSProblemType) (((TSProblemType)-1)*(((((TSProblemType)digits[1]) << PyLong_SHIFT) | (TSProblemType)digits[0]))); } } break; case 2: if ((8 * sizeof(TSProblemType) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(TSProblemType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(TSProblemType) - 1 > 2 * PyLong_SHIFT)) { return (TSProblemType) ((((((TSProblemType)digits[1]) << PyLong_SHIFT) | (TSProblemType)digits[0]))); } } break; case -3: if ((8 * sizeof(TSProblemType) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(TSProblemType, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(TSProblemType) - 1 > 3 * PyLong_SHIFT)) { return (TSProblemType) (((TSProblemType)-1)*(((((((TSProblemType)digits[2]) << PyLong_SHIFT) | (TSProblemType)digits[1]) << PyLong_SHIFT) | (TSProblemType)digits[0]))); } } break; case 3: if ((8 * sizeof(TSProblemType) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(TSProblemType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(TSProblemType) - 1 > 3 * PyLong_SHIFT)) { return (TSProblemType) ((((((((TSProblemType)digits[2]) << PyLong_SHIFT) | (TSProblemType)digits[1]) << PyLong_SHIFT) | (TSProblemType)digits[0]))); } } break; case -4: if ((8 * sizeof(TSProblemType) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(TSProblemType, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(TSProblemType) - 1 > 4 * PyLong_SHIFT)) { return (TSProblemType) (((TSProblemType)-1)*(((((((((TSProblemType)digits[3]) << PyLong_SHIFT) | (TSProblemType)digits[2]) << PyLong_SHIFT) | (TSProblemType)digits[1]) << PyLong_SHIFT) | (TSProblemType)digits[0]))); } } break; case 4: if ((8 * sizeof(TSProblemType) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(TSProblemType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(TSProblemType) - 1 > 4 * PyLong_SHIFT)) { return (TSProblemType) ((((((((((TSProblemType)digits[3]) << PyLong_SHIFT) | (TSProblemType)digits[2]) << PyLong_SHIFT) | (TSProblemType)digits[1]) << PyLong_SHIFT) | (TSProblemType)digits[0]))); } } break; } } #endif if ((sizeof(TSProblemType) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(TSProblemType, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(TSProblemType) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(TSProblemType, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available, cannot convert large enums"); return (TSProblemType) -1; } else { TSProblemType val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (TSProblemType) -1; val = __Pyx_PyInt_As_TSProblemType(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to TSProblemType"); return (TSProblemType) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to TSProblemType"); return (TSProblemType) -1; } /* CIntFromPy */ static CYTHON_INLINE TSEquationType __Pyx_PyInt_As_TSEquationType(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const TSEquationType neg_one = (TSEquationType) -1, const_zero = (TSEquationType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(TSEquationType) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(TSEquationType, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (TSEquationType) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(TSEquationType, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(TSEquationType) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(TSEquationType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(TSEquationType) >= 2 * PyLong_SHIFT)) { return (TSEquationType) (((((TSEquationType)digits[1]) << PyLong_SHIFT) | (TSEquationType)digits[0])); } } break; case 3: if ((8 * sizeof(TSEquationType) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(TSEquationType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(TSEquationType) >= 3 * PyLong_SHIFT)) { return (TSEquationType) (((((((TSEquationType)digits[2]) << PyLong_SHIFT) | (TSEquationType)digits[1]) << PyLong_SHIFT) | (TSEquationType)digits[0])); } } break; case 4: if ((8 * sizeof(TSEquationType) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(TSEquationType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(TSEquationType) >= 4 * PyLong_SHIFT)) { return (TSEquationType) (((((((((TSEquationType)digits[3]) << PyLong_SHIFT) | (TSEquationType)digits[2]) << PyLong_SHIFT) | (TSEquationType)digits[1]) << PyLong_SHIFT) | (TSEquationType)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (TSEquationType) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(TSEquationType) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(TSEquationType, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(TSEquationType) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(TSEquationType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(TSEquationType, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(TSEquationType) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(TSEquationType, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(TSEquationType) - 1 > 2 * PyLong_SHIFT)) { return (TSEquationType) (((TSEquationType)-1)*(((((TSEquationType)digits[1]) << PyLong_SHIFT) | (TSEquationType)digits[0]))); } } break; case 2: if ((8 * sizeof(TSEquationType) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(TSEquationType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(TSEquationType) - 1 > 2 * PyLong_SHIFT)) { return (TSEquationType) ((((((TSEquationType)digits[1]) << PyLong_SHIFT) | (TSEquationType)digits[0]))); } } break; case -3: if ((8 * sizeof(TSEquationType) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(TSEquationType, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(TSEquationType) - 1 > 3 * PyLong_SHIFT)) { return (TSEquationType) (((TSEquationType)-1)*(((((((TSEquationType)digits[2]) << PyLong_SHIFT) | (TSEquationType)digits[1]) << PyLong_SHIFT) | (TSEquationType)digits[0]))); } } break; case 3: if ((8 * sizeof(TSEquationType) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(TSEquationType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(TSEquationType) - 1 > 3 * PyLong_SHIFT)) { return (TSEquationType) ((((((((TSEquationType)digits[2]) << PyLong_SHIFT) | (TSEquationType)digits[1]) << PyLong_SHIFT) | (TSEquationType)digits[0]))); } } break; case -4: if ((8 * sizeof(TSEquationType) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(TSEquationType, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(TSEquationType) - 1 > 4 * PyLong_SHIFT)) { return (TSEquationType) (((TSEquationType)-1)*(((((((((TSEquationType)digits[3]) << PyLong_SHIFT) | (TSEquationType)digits[2]) << PyLong_SHIFT) | (TSEquationType)digits[1]) << PyLong_SHIFT) | (TSEquationType)digits[0]))); } } break; case 4: if ((8 * sizeof(TSEquationType) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(TSEquationType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(TSEquationType) - 1 > 4 * PyLong_SHIFT)) { return (TSEquationType) ((((((((((TSEquationType)digits[3]) << PyLong_SHIFT) | (TSEquationType)digits[2]) << PyLong_SHIFT) | (TSEquationType)digits[1]) << PyLong_SHIFT) | (TSEquationType)digits[0]))); } } break; } } #endif if ((sizeof(TSEquationType) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(TSEquationType, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(TSEquationType) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(TSEquationType, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available, cannot convert large enums"); return (TSEquationType) -1; } else { TSEquationType val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (TSEquationType) -1; val = __Pyx_PyInt_As_TSEquationType(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to TSEquationType"); return (TSEquationType) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to TSEquationType"); return (TSEquationType) -1; } /* CIntFromPy */ static CYTHON_INLINE TSExactFinalTimeOption __Pyx_PyInt_As_TSExactFinalTimeOption(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const TSExactFinalTimeOption neg_one = (TSExactFinalTimeOption) -1, const_zero = (TSExactFinalTimeOption) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(TSExactFinalTimeOption) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(TSExactFinalTimeOption, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (TSExactFinalTimeOption) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(TSExactFinalTimeOption, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(TSExactFinalTimeOption) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(TSExactFinalTimeOption, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(TSExactFinalTimeOption) >= 2 * PyLong_SHIFT)) { return (TSExactFinalTimeOption) (((((TSExactFinalTimeOption)digits[1]) << PyLong_SHIFT) | (TSExactFinalTimeOption)digits[0])); } } break; case 3: if ((8 * sizeof(TSExactFinalTimeOption) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(TSExactFinalTimeOption, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(TSExactFinalTimeOption) >= 3 * PyLong_SHIFT)) { return (TSExactFinalTimeOption) (((((((TSExactFinalTimeOption)digits[2]) << PyLong_SHIFT) | (TSExactFinalTimeOption)digits[1]) << PyLong_SHIFT) | (TSExactFinalTimeOption)digits[0])); } } break; case 4: if ((8 * sizeof(TSExactFinalTimeOption) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(TSExactFinalTimeOption, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(TSExactFinalTimeOption) >= 4 * PyLong_SHIFT)) { return (TSExactFinalTimeOption) (((((((((TSExactFinalTimeOption)digits[3]) << PyLong_SHIFT) | (TSExactFinalTimeOption)digits[2]) << PyLong_SHIFT) | (TSExactFinalTimeOption)digits[1]) << PyLong_SHIFT) | (TSExactFinalTimeOption)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (TSExactFinalTimeOption) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(TSExactFinalTimeOption) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(TSExactFinalTimeOption, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(TSExactFinalTimeOption) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(TSExactFinalTimeOption, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(TSExactFinalTimeOption, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(TSExactFinalTimeOption) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(TSExactFinalTimeOption, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(TSExactFinalTimeOption) - 1 > 2 * PyLong_SHIFT)) { return (TSExactFinalTimeOption) (((TSExactFinalTimeOption)-1)*(((((TSExactFinalTimeOption)digits[1]) << PyLong_SHIFT) | (TSExactFinalTimeOption)digits[0]))); } } break; case 2: if ((8 * sizeof(TSExactFinalTimeOption) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(TSExactFinalTimeOption, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(TSExactFinalTimeOption) - 1 > 2 * PyLong_SHIFT)) { return (TSExactFinalTimeOption) ((((((TSExactFinalTimeOption)digits[1]) << PyLong_SHIFT) | (TSExactFinalTimeOption)digits[0]))); } } break; case -3: if ((8 * sizeof(TSExactFinalTimeOption) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(TSExactFinalTimeOption, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(TSExactFinalTimeOption) - 1 > 3 * PyLong_SHIFT)) { return (TSExactFinalTimeOption) (((TSExactFinalTimeOption)-1)*(((((((TSExactFinalTimeOption)digits[2]) << PyLong_SHIFT) | (TSExactFinalTimeOption)digits[1]) << PyLong_SHIFT) | (TSExactFinalTimeOption)digits[0]))); } } break; case 3: if ((8 * sizeof(TSExactFinalTimeOption) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(TSExactFinalTimeOption, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(TSExactFinalTimeOption) - 1 > 3 * PyLong_SHIFT)) { return (TSExactFinalTimeOption) ((((((((TSExactFinalTimeOption)digits[2]) << PyLong_SHIFT) | (TSExactFinalTimeOption)digits[1]) << PyLong_SHIFT) | (TSExactFinalTimeOption)digits[0]))); } } break; case -4: if ((8 * sizeof(TSExactFinalTimeOption) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(TSExactFinalTimeOption, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(TSExactFinalTimeOption) - 1 > 4 * PyLong_SHIFT)) { return (TSExactFinalTimeOption) (((TSExactFinalTimeOption)-1)*(((((((((TSExactFinalTimeOption)digits[3]) << PyLong_SHIFT) | (TSExactFinalTimeOption)digits[2]) << PyLong_SHIFT) | (TSExactFinalTimeOption)digits[1]) << PyLong_SHIFT) | (TSExactFinalTimeOption)digits[0]))); } } break; case 4: if ((8 * sizeof(TSExactFinalTimeOption) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(TSExactFinalTimeOption, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(TSExactFinalTimeOption) - 1 > 4 * PyLong_SHIFT)) { return (TSExactFinalTimeOption) ((((((((((TSExactFinalTimeOption)digits[3]) << PyLong_SHIFT) | (TSExactFinalTimeOption)digits[2]) << PyLong_SHIFT) | (TSExactFinalTimeOption)digits[1]) << PyLong_SHIFT) | (TSExactFinalTimeOption)digits[0]))); } } break; } } #endif if ((sizeof(TSExactFinalTimeOption) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(TSExactFinalTimeOption, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(TSExactFinalTimeOption) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(TSExactFinalTimeOption, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available, cannot convert large enums"); return (TSExactFinalTimeOption) -1; } else { TSExactFinalTimeOption val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (TSExactFinalTimeOption) -1; val = __Pyx_PyInt_As_TSExactFinalTimeOption(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to TSExactFinalTimeOption"); return (TSExactFinalTimeOption) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to TSExactFinalTimeOption"); return (TSExactFinalTimeOption) -1; } /* CIntFromPy */ static CYTHON_INLINE TSConvergedReason __Pyx_PyInt_As_TSConvergedReason(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const TSConvergedReason neg_one = (TSConvergedReason) -1, const_zero = (TSConvergedReason) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(TSConvergedReason) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(TSConvergedReason, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (TSConvergedReason) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(TSConvergedReason, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(TSConvergedReason) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(TSConvergedReason, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(TSConvergedReason) >= 2 * PyLong_SHIFT)) { return (TSConvergedReason) (((((TSConvergedReason)digits[1]) << PyLong_SHIFT) | (TSConvergedReason)digits[0])); } } break; case 3: if ((8 * sizeof(TSConvergedReason) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(TSConvergedReason, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(TSConvergedReason) >= 3 * PyLong_SHIFT)) { return (TSConvergedReason) (((((((TSConvergedReason)digits[2]) << PyLong_SHIFT) | (TSConvergedReason)digits[1]) << PyLong_SHIFT) | (TSConvergedReason)digits[0])); } } break; case 4: if ((8 * sizeof(TSConvergedReason) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(TSConvergedReason, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(TSConvergedReason) >= 4 * PyLong_SHIFT)) { return (TSConvergedReason) (((((((((TSConvergedReason)digits[3]) << PyLong_SHIFT) | (TSConvergedReason)digits[2]) << PyLong_SHIFT) | (TSConvergedReason)digits[1]) << PyLong_SHIFT) | (TSConvergedReason)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (TSConvergedReason) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(TSConvergedReason) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(TSConvergedReason, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(TSConvergedReason) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(TSConvergedReason, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(TSConvergedReason, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(TSConvergedReason) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(TSConvergedReason, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(TSConvergedReason) - 1 > 2 * PyLong_SHIFT)) { return (TSConvergedReason) (((TSConvergedReason)-1)*(((((TSConvergedReason)digits[1]) << PyLong_SHIFT) | (TSConvergedReason)digits[0]))); } } break; case 2: if ((8 * sizeof(TSConvergedReason) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(TSConvergedReason, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(TSConvergedReason) - 1 > 2 * PyLong_SHIFT)) { return (TSConvergedReason) ((((((TSConvergedReason)digits[1]) << PyLong_SHIFT) | (TSConvergedReason)digits[0]))); } } break; case -3: if ((8 * sizeof(TSConvergedReason) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(TSConvergedReason, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(TSConvergedReason) - 1 > 3 * PyLong_SHIFT)) { return (TSConvergedReason) (((TSConvergedReason)-1)*(((((((TSConvergedReason)digits[2]) << PyLong_SHIFT) | (TSConvergedReason)digits[1]) << PyLong_SHIFT) | (TSConvergedReason)digits[0]))); } } break; case 3: if ((8 * sizeof(TSConvergedReason) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(TSConvergedReason, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(TSConvergedReason) - 1 > 3 * PyLong_SHIFT)) { return (TSConvergedReason) ((((((((TSConvergedReason)digits[2]) << PyLong_SHIFT) | (TSConvergedReason)digits[1]) << PyLong_SHIFT) | (TSConvergedReason)digits[0]))); } } break; case -4: if ((8 * sizeof(TSConvergedReason) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(TSConvergedReason, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(TSConvergedReason) - 1 > 4 * PyLong_SHIFT)) { return (TSConvergedReason) (((TSConvergedReason)-1)*(((((((((TSConvergedReason)digits[3]) << PyLong_SHIFT) | (TSConvergedReason)digits[2]) << PyLong_SHIFT) | (TSConvergedReason)digits[1]) << PyLong_SHIFT) | (TSConvergedReason)digits[0]))); } } break; case 4: if ((8 * sizeof(TSConvergedReason) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(TSConvergedReason, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(TSConvergedReason) - 1 > 4 * PyLong_SHIFT)) { return (TSConvergedReason) ((((((((((TSConvergedReason)digits[3]) << PyLong_SHIFT) | (TSConvergedReason)digits[2]) << PyLong_SHIFT) | (TSConvergedReason)digits[1]) << PyLong_SHIFT) | (TSConvergedReason)digits[0]))); } } break; } } #endif if ((sizeof(TSConvergedReason) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(TSConvergedReason, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(TSConvergedReason) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(TSConvergedReason, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available, cannot convert large enums"); return (TSConvergedReason) -1; } else { TSConvergedReason val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (TSConvergedReason) -1; val = __Pyx_PyInt_As_TSConvergedReason(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to TSConvergedReason"); return (TSConvergedReason) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to TSConvergedReason"); return (TSConvergedReason) -1; } /* CIntFromPy */ static CYTHON_INLINE TaoBNCGType __Pyx_PyInt_As_TaoBNCGType(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const TaoBNCGType neg_one = (TaoBNCGType) -1, const_zero = (TaoBNCGType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(TaoBNCGType) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(TaoBNCGType, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (TaoBNCGType) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(TaoBNCGType, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(TaoBNCGType) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(TaoBNCGType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(TaoBNCGType) >= 2 * PyLong_SHIFT)) { return (TaoBNCGType) (((((TaoBNCGType)digits[1]) << PyLong_SHIFT) | (TaoBNCGType)digits[0])); } } break; case 3: if ((8 * sizeof(TaoBNCGType) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(TaoBNCGType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(TaoBNCGType) >= 3 * PyLong_SHIFT)) { return (TaoBNCGType) (((((((TaoBNCGType)digits[2]) << PyLong_SHIFT) | (TaoBNCGType)digits[1]) << PyLong_SHIFT) | (TaoBNCGType)digits[0])); } } break; case 4: if ((8 * sizeof(TaoBNCGType) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(TaoBNCGType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(TaoBNCGType) >= 4 * PyLong_SHIFT)) { return (TaoBNCGType) (((((((((TaoBNCGType)digits[3]) << PyLong_SHIFT) | (TaoBNCGType)digits[2]) << PyLong_SHIFT) | (TaoBNCGType)digits[1]) << PyLong_SHIFT) | (TaoBNCGType)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (TaoBNCGType) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(TaoBNCGType) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(TaoBNCGType, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(TaoBNCGType) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(TaoBNCGType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(TaoBNCGType, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(TaoBNCGType) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(TaoBNCGType, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(TaoBNCGType) - 1 > 2 * PyLong_SHIFT)) { return (TaoBNCGType) (((TaoBNCGType)-1)*(((((TaoBNCGType)digits[1]) << PyLong_SHIFT) | (TaoBNCGType)digits[0]))); } } break; case 2: if ((8 * sizeof(TaoBNCGType) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(TaoBNCGType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(TaoBNCGType) - 1 > 2 * PyLong_SHIFT)) { return (TaoBNCGType) ((((((TaoBNCGType)digits[1]) << PyLong_SHIFT) | (TaoBNCGType)digits[0]))); } } break; case -3: if ((8 * sizeof(TaoBNCGType) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(TaoBNCGType, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(TaoBNCGType) - 1 > 3 * PyLong_SHIFT)) { return (TaoBNCGType) (((TaoBNCGType)-1)*(((((((TaoBNCGType)digits[2]) << PyLong_SHIFT) | (TaoBNCGType)digits[1]) << PyLong_SHIFT) | (TaoBNCGType)digits[0]))); } } break; case 3: if ((8 * sizeof(TaoBNCGType) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(TaoBNCGType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(TaoBNCGType) - 1 > 3 * PyLong_SHIFT)) { return (TaoBNCGType) ((((((((TaoBNCGType)digits[2]) << PyLong_SHIFT) | (TaoBNCGType)digits[1]) << PyLong_SHIFT) | (TaoBNCGType)digits[0]))); } } break; case -4: if ((8 * sizeof(TaoBNCGType) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(TaoBNCGType, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(TaoBNCGType) - 1 > 4 * PyLong_SHIFT)) { return (TaoBNCGType) (((TaoBNCGType)-1)*(((((((((TaoBNCGType)digits[3]) << PyLong_SHIFT) | (TaoBNCGType)digits[2]) << PyLong_SHIFT) | (TaoBNCGType)digits[1]) << PyLong_SHIFT) | (TaoBNCGType)digits[0]))); } } break; case 4: if ((8 * sizeof(TaoBNCGType) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(TaoBNCGType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(TaoBNCGType) - 1 > 4 * PyLong_SHIFT)) { return (TaoBNCGType) ((((((((((TaoBNCGType)digits[3]) << PyLong_SHIFT) | (TaoBNCGType)digits[2]) << PyLong_SHIFT) | (TaoBNCGType)digits[1]) << PyLong_SHIFT) | (TaoBNCGType)digits[0]))); } } break; } } #endif if ((sizeof(TaoBNCGType) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(TaoBNCGType, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(TaoBNCGType) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(TaoBNCGType, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available, cannot convert large enums"); return (TaoBNCGType) -1; } else { TaoBNCGType val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (TaoBNCGType) -1; val = __Pyx_PyInt_As_TaoBNCGType(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to TaoBNCGType"); return (TaoBNCGType) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to TaoBNCGType"); return (TaoBNCGType) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PetscBool(PetscBool value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PetscBool neg_one = (PetscBool) -1, const_zero = (PetscBool) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(PetscBool) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(PetscBool) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PetscBool) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(PetscBool) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PetscBool) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(PetscBool), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(PetscBool)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE DMPolytopeType __Pyx_PyInt_As_DMPolytopeType(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const DMPolytopeType neg_one = (DMPolytopeType) -1, const_zero = (DMPolytopeType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(DMPolytopeType) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(DMPolytopeType, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (DMPolytopeType) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(DMPolytopeType, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(DMPolytopeType) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMPolytopeType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMPolytopeType) >= 2 * PyLong_SHIFT)) { return (DMPolytopeType) (((((DMPolytopeType)digits[1]) << PyLong_SHIFT) | (DMPolytopeType)digits[0])); } } break; case 3: if ((8 * sizeof(DMPolytopeType) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMPolytopeType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMPolytopeType) >= 3 * PyLong_SHIFT)) { return (DMPolytopeType) (((((((DMPolytopeType)digits[2]) << PyLong_SHIFT) | (DMPolytopeType)digits[1]) << PyLong_SHIFT) | (DMPolytopeType)digits[0])); } } break; case 4: if ((8 * sizeof(DMPolytopeType) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMPolytopeType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMPolytopeType) >= 4 * PyLong_SHIFT)) { return (DMPolytopeType) (((((((((DMPolytopeType)digits[3]) << PyLong_SHIFT) | (DMPolytopeType)digits[2]) << PyLong_SHIFT) | (DMPolytopeType)digits[1]) << PyLong_SHIFT) | (DMPolytopeType)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (DMPolytopeType) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(DMPolytopeType) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(DMPolytopeType, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(DMPolytopeType) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(DMPolytopeType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(DMPolytopeType, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(DMPolytopeType) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMPolytopeType, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMPolytopeType) - 1 > 2 * PyLong_SHIFT)) { return (DMPolytopeType) (((DMPolytopeType)-1)*(((((DMPolytopeType)digits[1]) << PyLong_SHIFT) | (DMPolytopeType)digits[0]))); } } break; case 2: if ((8 * sizeof(DMPolytopeType) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMPolytopeType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMPolytopeType) - 1 > 2 * PyLong_SHIFT)) { return (DMPolytopeType) ((((((DMPolytopeType)digits[1]) << PyLong_SHIFT) | (DMPolytopeType)digits[0]))); } } break; case -3: if ((8 * sizeof(DMPolytopeType) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMPolytopeType, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMPolytopeType) - 1 > 3 * PyLong_SHIFT)) { return (DMPolytopeType) (((DMPolytopeType)-1)*(((((((DMPolytopeType)digits[2]) << PyLong_SHIFT) | (DMPolytopeType)digits[1]) << PyLong_SHIFT) | (DMPolytopeType)digits[0]))); } } break; case 3: if ((8 * sizeof(DMPolytopeType) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMPolytopeType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMPolytopeType) - 1 > 3 * PyLong_SHIFT)) { return (DMPolytopeType) ((((((((DMPolytopeType)digits[2]) << PyLong_SHIFT) | (DMPolytopeType)digits[1]) << PyLong_SHIFT) | (DMPolytopeType)digits[0]))); } } break; case -4: if ((8 * sizeof(DMPolytopeType) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMPolytopeType, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMPolytopeType) - 1 > 4 * PyLong_SHIFT)) { return (DMPolytopeType) (((DMPolytopeType)-1)*(((((((((DMPolytopeType)digits[3]) << PyLong_SHIFT) | (DMPolytopeType)digits[2]) << PyLong_SHIFT) | (DMPolytopeType)digits[1]) << PyLong_SHIFT) | (DMPolytopeType)digits[0]))); } } break; case 4: if ((8 * sizeof(DMPolytopeType) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMPolytopeType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMPolytopeType) - 1 > 4 * PyLong_SHIFT)) { return (DMPolytopeType) ((((((((((DMPolytopeType)digits[3]) << PyLong_SHIFT) | (DMPolytopeType)digits[2]) << PyLong_SHIFT) | (DMPolytopeType)digits[1]) << PyLong_SHIFT) | (DMPolytopeType)digits[0]))); } } break; } } #endif if ((sizeof(DMPolytopeType) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(DMPolytopeType, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(DMPolytopeType) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(DMPolytopeType, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available, cannot convert large enums"); return (DMPolytopeType) -1; } else { DMPolytopeType val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (DMPolytopeType) -1; val = __Pyx_PyInt_As_DMPolytopeType(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to DMPolytopeType"); return (DMPolytopeType) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to DMPolytopeType"); return (DMPolytopeType) -1; } /* CIntFromPy */ static CYTHON_INLINE DMPlexReorderDefaultFlag __Pyx_PyInt_As_DMPlexReorderDefaultFlag(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const DMPlexReorderDefaultFlag neg_one = (DMPlexReorderDefaultFlag) -1, const_zero = (DMPlexReorderDefaultFlag) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(DMPlexReorderDefaultFlag) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(DMPlexReorderDefaultFlag, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (DMPlexReorderDefaultFlag) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(DMPlexReorderDefaultFlag, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(DMPlexReorderDefaultFlag) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMPlexReorderDefaultFlag, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMPlexReorderDefaultFlag) >= 2 * PyLong_SHIFT)) { return (DMPlexReorderDefaultFlag) (((((DMPlexReorderDefaultFlag)digits[1]) << PyLong_SHIFT) | (DMPlexReorderDefaultFlag)digits[0])); } } break; case 3: if ((8 * sizeof(DMPlexReorderDefaultFlag) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMPlexReorderDefaultFlag, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMPlexReorderDefaultFlag) >= 3 * PyLong_SHIFT)) { return (DMPlexReorderDefaultFlag) (((((((DMPlexReorderDefaultFlag)digits[2]) << PyLong_SHIFT) | (DMPlexReorderDefaultFlag)digits[1]) << PyLong_SHIFT) | (DMPlexReorderDefaultFlag)digits[0])); } } break; case 4: if ((8 * sizeof(DMPlexReorderDefaultFlag) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMPlexReorderDefaultFlag, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMPlexReorderDefaultFlag) >= 4 * PyLong_SHIFT)) { return (DMPlexReorderDefaultFlag) (((((((((DMPlexReorderDefaultFlag)digits[3]) << PyLong_SHIFT) | (DMPlexReorderDefaultFlag)digits[2]) << PyLong_SHIFT) | (DMPlexReorderDefaultFlag)digits[1]) << PyLong_SHIFT) | (DMPlexReorderDefaultFlag)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (DMPlexReorderDefaultFlag) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(DMPlexReorderDefaultFlag) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(DMPlexReorderDefaultFlag, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(DMPlexReorderDefaultFlag) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(DMPlexReorderDefaultFlag, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(DMPlexReorderDefaultFlag, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(DMPlexReorderDefaultFlag) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMPlexReorderDefaultFlag, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMPlexReorderDefaultFlag) - 1 > 2 * PyLong_SHIFT)) { return (DMPlexReorderDefaultFlag) (((DMPlexReorderDefaultFlag)-1)*(((((DMPlexReorderDefaultFlag)digits[1]) << PyLong_SHIFT) | (DMPlexReorderDefaultFlag)digits[0]))); } } break; case 2: if ((8 * sizeof(DMPlexReorderDefaultFlag) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMPlexReorderDefaultFlag, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMPlexReorderDefaultFlag) - 1 > 2 * PyLong_SHIFT)) { return (DMPlexReorderDefaultFlag) ((((((DMPlexReorderDefaultFlag)digits[1]) << PyLong_SHIFT) | (DMPlexReorderDefaultFlag)digits[0]))); } } break; case -3: if ((8 * sizeof(DMPlexReorderDefaultFlag) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMPlexReorderDefaultFlag, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMPlexReorderDefaultFlag) - 1 > 3 * PyLong_SHIFT)) { return (DMPlexReorderDefaultFlag) (((DMPlexReorderDefaultFlag)-1)*(((((((DMPlexReorderDefaultFlag)digits[2]) << PyLong_SHIFT) | (DMPlexReorderDefaultFlag)digits[1]) << PyLong_SHIFT) | (DMPlexReorderDefaultFlag)digits[0]))); } } break; case 3: if ((8 * sizeof(DMPlexReorderDefaultFlag) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMPlexReorderDefaultFlag, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMPlexReorderDefaultFlag) - 1 > 3 * PyLong_SHIFT)) { return (DMPlexReorderDefaultFlag) ((((((((DMPlexReorderDefaultFlag)digits[2]) << PyLong_SHIFT) | (DMPlexReorderDefaultFlag)digits[1]) << PyLong_SHIFT) | (DMPlexReorderDefaultFlag)digits[0]))); } } break; case -4: if ((8 * sizeof(DMPlexReorderDefaultFlag) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMPlexReorderDefaultFlag, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMPlexReorderDefaultFlag) - 1 > 4 * PyLong_SHIFT)) { return (DMPlexReorderDefaultFlag) (((DMPlexReorderDefaultFlag)-1)*(((((((((DMPlexReorderDefaultFlag)digits[3]) << PyLong_SHIFT) | (DMPlexReorderDefaultFlag)digits[2]) << PyLong_SHIFT) | (DMPlexReorderDefaultFlag)digits[1]) << PyLong_SHIFT) | (DMPlexReorderDefaultFlag)digits[0]))); } } break; case 4: if ((8 * sizeof(DMPlexReorderDefaultFlag) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMPlexReorderDefaultFlag, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMPlexReorderDefaultFlag) - 1 > 4 * PyLong_SHIFT)) { return (DMPlexReorderDefaultFlag) ((((((((((DMPlexReorderDefaultFlag)digits[3]) << PyLong_SHIFT) | (DMPlexReorderDefaultFlag)digits[2]) << PyLong_SHIFT) | (DMPlexReorderDefaultFlag)digits[1]) << PyLong_SHIFT) | (DMPlexReorderDefaultFlag)digits[0]))); } } break; } } #endif if ((sizeof(DMPlexReorderDefaultFlag) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(DMPlexReorderDefaultFlag, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(DMPlexReorderDefaultFlag) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(DMPlexReorderDefaultFlag, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available, cannot convert large enums"); return (DMPlexReorderDefaultFlag) -1; } else { DMPlexReorderDefaultFlag val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (DMPlexReorderDefaultFlag) -1; val = __Pyx_PyInt_As_DMPlexReorderDefaultFlag(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to DMPlexReorderDefaultFlag"); return (DMPlexReorderDefaultFlag) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to DMPlexReorderDefaultFlag"); return (DMPlexReorderDefaultFlag) -1; } /* CIntFromPy */ static CYTHON_INLINE DMSwarmType __Pyx_PyInt_As_DMSwarmType(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const DMSwarmType neg_one = (DMSwarmType) -1, const_zero = (DMSwarmType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(DMSwarmType) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(DMSwarmType, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (DMSwarmType) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(DMSwarmType, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(DMSwarmType) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMSwarmType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMSwarmType) >= 2 * PyLong_SHIFT)) { return (DMSwarmType) (((((DMSwarmType)digits[1]) << PyLong_SHIFT) | (DMSwarmType)digits[0])); } } break; case 3: if ((8 * sizeof(DMSwarmType) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMSwarmType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMSwarmType) >= 3 * PyLong_SHIFT)) { return (DMSwarmType) (((((((DMSwarmType)digits[2]) << PyLong_SHIFT) | (DMSwarmType)digits[1]) << PyLong_SHIFT) | (DMSwarmType)digits[0])); } } break; case 4: if ((8 * sizeof(DMSwarmType) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMSwarmType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMSwarmType) >= 4 * PyLong_SHIFT)) { return (DMSwarmType) (((((((((DMSwarmType)digits[3]) << PyLong_SHIFT) | (DMSwarmType)digits[2]) << PyLong_SHIFT) | (DMSwarmType)digits[1]) << PyLong_SHIFT) | (DMSwarmType)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (DMSwarmType) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(DMSwarmType) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(DMSwarmType, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(DMSwarmType) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(DMSwarmType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(DMSwarmType, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(DMSwarmType) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMSwarmType, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMSwarmType) - 1 > 2 * PyLong_SHIFT)) { return (DMSwarmType) (((DMSwarmType)-1)*(((((DMSwarmType)digits[1]) << PyLong_SHIFT) | (DMSwarmType)digits[0]))); } } break; case 2: if ((8 * sizeof(DMSwarmType) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMSwarmType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMSwarmType) - 1 > 2 * PyLong_SHIFT)) { return (DMSwarmType) ((((((DMSwarmType)digits[1]) << PyLong_SHIFT) | (DMSwarmType)digits[0]))); } } break; case -3: if ((8 * sizeof(DMSwarmType) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMSwarmType, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMSwarmType) - 1 > 3 * PyLong_SHIFT)) { return (DMSwarmType) (((DMSwarmType)-1)*(((((((DMSwarmType)digits[2]) << PyLong_SHIFT) | (DMSwarmType)digits[1]) << PyLong_SHIFT) | (DMSwarmType)digits[0]))); } } break; case 3: if ((8 * sizeof(DMSwarmType) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMSwarmType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMSwarmType) - 1 > 3 * PyLong_SHIFT)) { return (DMSwarmType) ((((((((DMSwarmType)digits[2]) << PyLong_SHIFT) | (DMSwarmType)digits[1]) << PyLong_SHIFT) | (DMSwarmType)digits[0]))); } } break; case -4: if ((8 * sizeof(DMSwarmType) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMSwarmType, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMSwarmType) - 1 > 4 * PyLong_SHIFT)) { return (DMSwarmType) (((DMSwarmType)-1)*(((((((((DMSwarmType)digits[3]) << PyLong_SHIFT) | (DMSwarmType)digits[2]) << PyLong_SHIFT) | (DMSwarmType)digits[1]) << PyLong_SHIFT) | (DMSwarmType)digits[0]))); } } break; case 4: if ((8 * sizeof(DMSwarmType) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMSwarmType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMSwarmType) - 1 > 4 * PyLong_SHIFT)) { return (DMSwarmType) ((((((((((DMSwarmType)digits[3]) << PyLong_SHIFT) | (DMSwarmType)digits[2]) << PyLong_SHIFT) | (DMSwarmType)digits[1]) << PyLong_SHIFT) | (DMSwarmType)digits[0]))); } } break; } } #endif if ((sizeof(DMSwarmType) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(DMSwarmType, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(DMSwarmType) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(DMSwarmType, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available, cannot convert large enums"); return (DMSwarmType) -1; } else { DMSwarmType val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (DMSwarmType) -1; val = __Pyx_PyInt_As_DMSwarmType(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to DMSwarmType"); return (DMSwarmType) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to DMSwarmType"); return (DMSwarmType) -1; } /* CIntFromPy */ static CYTHON_INLINE DMSwarmPICLayoutType __Pyx_PyInt_As_DMSwarmPICLayoutType(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const DMSwarmPICLayoutType neg_one = (DMSwarmPICLayoutType) -1, const_zero = (DMSwarmPICLayoutType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(DMSwarmPICLayoutType) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(DMSwarmPICLayoutType, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (DMSwarmPICLayoutType) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(DMSwarmPICLayoutType, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(DMSwarmPICLayoutType) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMSwarmPICLayoutType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMSwarmPICLayoutType) >= 2 * PyLong_SHIFT)) { return (DMSwarmPICLayoutType) (((((DMSwarmPICLayoutType)digits[1]) << PyLong_SHIFT) | (DMSwarmPICLayoutType)digits[0])); } } break; case 3: if ((8 * sizeof(DMSwarmPICLayoutType) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMSwarmPICLayoutType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMSwarmPICLayoutType) >= 3 * PyLong_SHIFT)) { return (DMSwarmPICLayoutType) (((((((DMSwarmPICLayoutType)digits[2]) << PyLong_SHIFT) | (DMSwarmPICLayoutType)digits[1]) << PyLong_SHIFT) | (DMSwarmPICLayoutType)digits[0])); } } break; case 4: if ((8 * sizeof(DMSwarmPICLayoutType) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMSwarmPICLayoutType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMSwarmPICLayoutType) >= 4 * PyLong_SHIFT)) { return (DMSwarmPICLayoutType) (((((((((DMSwarmPICLayoutType)digits[3]) << PyLong_SHIFT) | (DMSwarmPICLayoutType)digits[2]) << PyLong_SHIFT) | (DMSwarmPICLayoutType)digits[1]) << PyLong_SHIFT) | (DMSwarmPICLayoutType)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (DMSwarmPICLayoutType) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(DMSwarmPICLayoutType) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(DMSwarmPICLayoutType, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(DMSwarmPICLayoutType) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(DMSwarmPICLayoutType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(DMSwarmPICLayoutType, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(DMSwarmPICLayoutType) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMSwarmPICLayoutType, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMSwarmPICLayoutType) - 1 > 2 * PyLong_SHIFT)) { return (DMSwarmPICLayoutType) (((DMSwarmPICLayoutType)-1)*(((((DMSwarmPICLayoutType)digits[1]) << PyLong_SHIFT) | (DMSwarmPICLayoutType)digits[0]))); } } break; case 2: if ((8 * sizeof(DMSwarmPICLayoutType) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMSwarmPICLayoutType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMSwarmPICLayoutType) - 1 > 2 * PyLong_SHIFT)) { return (DMSwarmPICLayoutType) ((((((DMSwarmPICLayoutType)digits[1]) << PyLong_SHIFT) | (DMSwarmPICLayoutType)digits[0]))); } } break; case -3: if ((8 * sizeof(DMSwarmPICLayoutType) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMSwarmPICLayoutType, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMSwarmPICLayoutType) - 1 > 3 * PyLong_SHIFT)) { return (DMSwarmPICLayoutType) (((DMSwarmPICLayoutType)-1)*(((((((DMSwarmPICLayoutType)digits[2]) << PyLong_SHIFT) | (DMSwarmPICLayoutType)digits[1]) << PyLong_SHIFT) | (DMSwarmPICLayoutType)digits[0]))); } } break; case 3: if ((8 * sizeof(DMSwarmPICLayoutType) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMSwarmPICLayoutType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMSwarmPICLayoutType) - 1 > 3 * PyLong_SHIFT)) { return (DMSwarmPICLayoutType) ((((((((DMSwarmPICLayoutType)digits[2]) << PyLong_SHIFT) | (DMSwarmPICLayoutType)digits[1]) << PyLong_SHIFT) | (DMSwarmPICLayoutType)digits[0]))); } } break; case -4: if ((8 * sizeof(DMSwarmPICLayoutType) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMSwarmPICLayoutType, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMSwarmPICLayoutType) - 1 > 4 * PyLong_SHIFT)) { return (DMSwarmPICLayoutType) (((DMSwarmPICLayoutType)-1)*(((((((((DMSwarmPICLayoutType)digits[3]) << PyLong_SHIFT) | (DMSwarmPICLayoutType)digits[2]) << PyLong_SHIFT) | (DMSwarmPICLayoutType)digits[1]) << PyLong_SHIFT) | (DMSwarmPICLayoutType)digits[0]))); } } break; case 4: if ((8 * sizeof(DMSwarmPICLayoutType) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DMSwarmPICLayoutType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DMSwarmPICLayoutType) - 1 > 4 * PyLong_SHIFT)) { return (DMSwarmPICLayoutType) ((((((((((DMSwarmPICLayoutType)digits[3]) << PyLong_SHIFT) | (DMSwarmPICLayoutType)digits[2]) << PyLong_SHIFT) | (DMSwarmPICLayoutType)digits[1]) << PyLong_SHIFT) | (DMSwarmPICLayoutType)digits[0]))); } } break; } } #endif if ((sizeof(DMSwarmPICLayoutType) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(DMSwarmPICLayoutType, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(DMSwarmPICLayoutType) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(DMSwarmPICLayoutType, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available, cannot convert large enums"); return (DMSwarmPICLayoutType) -1; } else { DMSwarmPICLayoutType val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (DMSwarmPICLayoutType) -1; val = __Pyx_PyInt_As_DMSwarmPICLayoutType(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to DMSwarmPICLayoutType"); return (DMSwarmPICLayoutType) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to DMSwarmPICLayoutType"); return (DMSwarmPICLayoutType) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_MatProductType(MatProductType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const MatProductType neg_one = (MatProductType) -1, const_zero = (MatProductType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(MatProductType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(MatProductType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(MatProductType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(MatProductType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(MatProductType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(MatProductType), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(MatProductType)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(long) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } } #endif if ((sizeof(long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { long val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (long) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (long) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (long) -1; } else { stepval = __Pyx_NewRef(v); } val = (long) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* CIntFromPy */ static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const char neg_one = (char) -1, const_zero = (char) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(char) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (char) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(char, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(char) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(char) >= 2 * PyLong_SHIFT)) { return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])); } } break; case 3: if ((8 * sizeof(char) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(char) >= 3 * PyLong_SHIFT)) { return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])); } } break; case 4: if ((8 * sizeof(char) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(char) >= 4 * PyLong_SHIFT)) { return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (char) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(char) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(char) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(char, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(char) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(char) - 1 > 2 * PyLong_SHIFT)) { return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); } } break; case 2: if ((8 * sizeof(char) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(char) - 1 > 2 * PyLong_SHIFT)) { return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); } } break; case -3: if ((8 * sizeof(char) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(char) - 1 > 3 * PyLong_SHIFT)) { return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); } } break; case 3: if ((8 * sizeof(char) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(char) - 1 > 3 * PyLong_SHIFT)) { return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); } } break; case -4: if ((8 * sizeof(char) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(char) - 1 > 4 * PyLong_SHIFT)) { return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); } } break; case 4: if ((8 * sizeof(char) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(char) - 1 > 4 * PyLong_SHIFT)) { return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); } } break; } } #endif if ((sizeof(char) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(char) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { char val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (char) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (char) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (char) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (char) -1; } else { stepval = __Pyx_NewRef(v); } val = (char) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(char) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((char) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(char) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((char) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((char) 1) << (sizeof(char) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (char) -1; } } else { char val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (char) -1; val = __Pyx_PyInt_As_char(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to char"); return (char) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to char"); return (char) -1; } /* FormatTypeName */ #if CYTHON_COMPILING_IN_LIMITED_API static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp) { PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, __pyx_n_s_name_2); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); Py_XDECREF(name); name = __Pyx_NewRef(__pyx_n_s__257); } return name; } #endif /* CheckBinaryVersion */ static unsigned long __Pyx_get_runtime_version(void) { #if __PYX_LIMITED_VERSION_HEX >= 0x030B00A4 return Py_Version & ~0xFFUL; #else const char* rt_version = Py_GetVersion(); unsigned long version = 0; unsigned long factor = 0x01000000UL; unsigned int digit = 0; int i = 0; while (factor) { while ('0' <= rt_version[i] && rt_version[i] <= '9') { digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); ++i; } version += factor * digit; if (rt_version[i] != '.') break; digit = 0; factor >>= 8; ++i; } return version; #endif } static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) return 0; if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) return 1; { char message[200]; PyOS_snprintf(message, sizeof(message), "compile time Python version %d.%d " "of module '%.100s' " "%s " "runtime version %d.%d", (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), __Pyx_MODULE_NAME, (allow_newer) ? "was newer than" : "does not match", (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) ); return PyErr_WarnEx(NULL, message, 1); } } /* FunctionExport */ static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { void (*fp)(void); void *p; } tmp; d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__"); if (!d) { PyErr_Clear(); d = PyDict_New(); if (!d) goto bad; Py_INCREF(d); if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0) goto bad; } tmp.fp = f; cobj = PyCapsule_New(tmp.p, sig, 0); if (!cobj) goto bad; if (PyDict_SetItemString(d, name, cobj) < 0) goto bad; Py_DECREF(cobj); Py_DECREF(d); return 0; bad: Py_XDECREF(cobj); Py_XDECREF(d); return -1; } /* InitStrings */ #if PY_MAJOR_VERSION >= 3 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { if (t.is_unicode | t.is_str) { if (t.intern) { *str = PyUnicode_InternFromString(t.s); } else if (t.encoding) { *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); } else { *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); } } else { *str = PyBytes_FromStringAndSize(t.s, t.n - 1); } if (!*str) return -1; if (PyObject_Hash(*str) == -1) return -1; return 0; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION >= 3 __Pyx_InitString(*t, t->p); #else if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) return -1; #endif ++t; } return 0; } #include static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { size_t len = strlen(s); if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "byte string is too long"); return -1; } return (Py_ssize_t) len; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return __Pyx_PyUnicode_FromStringAndSize(c_str, len); } static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return PyByteArray_FromStringAndSize(c_str, len); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { int retval; if (unlikely(!x)) return -1; retval = __Pyx_PyObject_IsTrue(x); Py_DECREF(x); return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " "The ability to return an instance of a strict subclass of int is deprecated, " "and may be removed in a future version of Python.", result_type_name)) { __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } __Pyx_DECREF_TypeName(result_type_name); return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", type_name, type_name, result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(b); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { return __Pyx_PyLong_CompactValue(b); } else { const digit* digits = __Pyx_PyLong_Digits(b); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); #if PY_MAJOR_VERSION < 3 } else if (likely(PyInt_CheckExact(o))) { return PyInt_AS_LONG(o); #endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; ival = PyInt_AsLong(x); Py_DECREF(x); return ival; } } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER #pragma warning( pop ) #endif /* #### Code section: end ### */ #endif /* Py_PYTHON_H */